Built motion from commit 28b9e07c.|2.5.44
authorAndrea Amorese <andrea.amorese@xenialab.it>
Mon, 10 Jan 2022 15:39:13 +0000 (16:39 +0100)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Mon, 10 Jan 2022 15:39:13 +0000 (16:39 +0100)
1169 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/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 00ace13..e144616 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-01-10T14:34:18.870Z",
+    "time": "2022-01-10T15:10:34.270Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 537d306..e77fc88 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-01-10T14:34:18.870Z",
+    "time": "2022-01-10T15:10:34.270Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 8e9388e..d87b2b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36be=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','action','STRING','integration','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x61d144,_0x4ee2f5){var _0x4226a4=function(_0x48c915){while(--_0x48c915){_0x61d144['push'](_0x61d144['shift']());}};_0x4226a4(++_0x4ee2f5);}(_0x36be,0x198));var _0xe36b=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x36be[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xe36b('0x0'));module[_0xe36b('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x287c78){return this[_0xe36b('0x2')](_0xe36b('0x3'));}},'action':{'type':Sequelize[_0xe36b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xe36b('0x5'),'motionbar',_0xe36b('0x6'),_0xe36b('0x7'),_0xe36b('0x8'),_0xe36b('0x9'),'script']],'msg':_0xe36b('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xe36b('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xe36b('0xb')},'data3':{'type':Sequelize[_0xe36b('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':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xe36b('0x4')](0x1000),'comments':_0xe36b('0xc')},'data6':{'type':Sequelize['STRING'],'comments':_0xe36b('0xd')},'data7':{'type':Sequelize[_0xe36b('0xe')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xbadc=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','motionbar','jscripty','urlForward','browser','bot'];(function(_0x31b1c4,_0x58f217){var _0x34a96f=function(_0x391f41){while(--_0x391f41){_0x31b1c4['push'](_0x31b1c4['shift']());}};_0x34a96f(++_0x58f217);}(_0xbadc,0xc8));var _0xcbad=function(_0x22afd5,_0x488d9f){_0x22afd5=_0x22afd5-0x0;var _0x336ebc=_0xbadc[_0x22afd5];return _0x336ebc;};'use strict';var Sequelize=require(_0xcbad('0x0'));module['exports']={'name':{'type':Sequelize[_0xcbad('0x1')],'get':function(_0x325a17){return this[_0xcbad('0x2')](_0xcbad('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0xcbad('0x4'),_0xcbad('0x5'),_0xcbad('0x6'),_0xcbad('0x7'),_0xcbad('0x8'),_0xcbad('0x9')]],'msg':_0xcbad('0xa')}},'comment':_0xcbad('0xa')},'data1':{'type':Sequelize[_0xcbad('0xb')](0x1000),'comment':_0xcbad('0xc')},'data2':{'type':Sequelize[_0xcbad('0xb')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xcbad('0xb')](0x1000),'comment':_0xcbad('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xcbad('0xe')},'data5':{'type':Sequelize[_0xcbad('0xb')](0x1000),'comments':_0xcbad('0xf')},'data6':{'type':Sequelize[_0xcbad('0xb')],'comments':_0xcbad('0x10')},'data7':{'type':Sequelize[_0xcbad('0x11')],'comments':_0xcbad('0x12')}};
\ No newline at end of file
index c9e5552..ac29273 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc194=['../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','Action','find','body','catch','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x57a36f,_0x2cc40b){var _0x1db90b=function(_0x38fd10){while(--_0x38fd10){_0x57a36f['push'](_0x57a36f['shift']());}};_0x1db90b(++_0x2cc40b);}(_0xc194,0xf2));var _0x4c19=function(_0x556323,_0x576882){_0x556323=_0x556323-0x0;var _0x277798=_0xc194[_0x556323];return _0x277798;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4c19('0x0'));var jsonpatch=require(_0x4c19('0x1'));var rp=require('request-promise');var moment=require(_0x4c19('0x2'));var BPromise=require(_0x4c19('0x3'));var Mustache=require(_0x4c19('0x4'));var util=require('util');var path=require(_0x4c19('0x5'));var sox=require(_0x4c19('0x6'));var csv=require(_0x4c19('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c19('0x8'));var _=require(_0x4c19('0x9'));var squel=require(_0x4c19('0xa'));var crypto=require(_0x4c19('0xb'));var jsforce=require(_0x4c19('0xc'));var deskjs=require(_0x4c19('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4c19('0xe'));var Papa=require('papaparse');var Redis=require(_0x4c19('0xf'));var authService=require(_0x4c19('0x10'));var qs=require(_0x4c19('0x11'));var as=require(_0x4c19('0x12'));var hardwareService=require(_0x4c19('0x13'));var logger=require(_0x4c19('0x14'))(_0x4c19('0x15'));var utils=require(_0x4c19('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4c19('0x17'));var db=require(_0x4c19('0x18'))['db'];function respondWithStatusCode(_0x4e1c2b,_0x44f6da){_0x44f6da=_0x44f6da||0xcc;return function(_0x5e72de){if(_0x5e72de){return _0x4e1c2b['sendStatus'](_0x44f6da);}return _0x4e1c2b[_0x4c19('0x19')](_0x44f6da)['end']();};}function respondWithResult(_0x827c43,_0x2c5346){_0x2c5346=_0x2c5346||0xc8;return function(_0x1f11cd){if(_0x1f11cd){return _0x827c43[_0x4c19('0x19')](_0x2c5346)[_0x4c19('0x1a')](_0x1f11cd);}};}function respondWithFilteredResult(_0x3c0700,_0x1f6147){return function(_0x5d66ba){if(_0x5d66ba){var _0x4e9193=typeof _0x1f6147['offset']===_0x4c19('0x1b')&&typeof _0x1f6147['limit']===_0x4c19('0x1b');var _0x4a3bbe=_0x5d66ba[_0x4c19('0x1c')];var _0x350262=_0x4e9193?0x0:_0x1f6147['offset'];var _0x1a2ff7=_0x4e9193?_0x5d66ba[_0x4c19('0x1c')]:_0x1f6147['offset']+_0x1f6147[_0x4c19('0x1d')];var _0x3ea8b7;if(_0x1a2ff7>=_0x4a3bbe){_0x1a2ff7=_0x4a3bbe;_0x3ea8b7=0xc8;}else{_0x3ea8b7=0xce;}_0x3c0700[_0x4c19('0x19')](_0x3ea8b7);return _0x3c0700[_0x4c19('0x1e')](_0x4c19('0x1f'),_0x350262+'-'+_0x1a2ff7+'/'+_0x4a3bbe)[_0x4c19('0x1a')](_0x5d66ba);}return null;};}function patchUpdates(_0x16a19c){return function(_0x5e7cc1){try{jsonpatch[_0x4c19('0x20')](_0x5e7cc1,_0x16a19c,!![]);}catch(_0x24c82f){return BPromise[_0x4c19('0x21')](_0x24c82f);}return _0x5e7cc1['save']();};}function saveUpdates(_0x167230,_0x1263a1){return function(_0x423d5f){if(_0x423d5f){return _0x423d5f[_0x4c19('0x22')](_0x167230)[_0x4c19('0x23')](function(_0x2e2f4a){return _0x2e2f4a;});}return null;};}function removeEntity(_0x3cd14b,_0x53e1cc){return function(_0x4735c7){if(_0x4735c7){return _0x4735c7[_0x4c19('0x24')]()[_0x4c19('0x23')](function(){_0x3cd14b[_0x4c19('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ad352,_0x684d9b){return function(_0x389936){if(!_0x389936){_0x4ad352['sendStatus'](0x194);}return _0x389936;};}function handleError(_0x3aa79f,_0xefb2cb){_0xefb2cb=_0xefb2cb||0x1f4;return function(_0x1455d0){logger[_0x4c19('0x25')](_0x1455d0['stack']);if(_0x1455d0[_0x4c19('0x26')]){delete _0x1455d0[_0x4c19('0x26')];}_0x3aa79f[_0x4c19('0x19')](_0xefb2cb)[_0x4c19('0x27')](_0x1455d0);};}exports['update']=function(_0x4de997,_0x51fa8c){if(_0x4de997['body']['id']){delete _0x4de997['body']['id'];}return db[_0x4c19('0x28')][_0x4c19('0x29')]({'where':{'id':_0x4de997['params']['id']}})[_0x4c19('0x23')](handleEntityNotFound(_0x51fa8c,null))[_0x4c19('0x23')](saveUpdates(_0x4de997[_0x4c19('0x2a')],null))['then'](respondWithResult(_0x51fa8c,null))[_0x4c19('0x2b')](handleError(_0x51fa8c,null));};exports[_0x4c19('0x24')]=function(_0x3c1c33,_0x59ff1){return db[_0x4c19('0x28')][_0x4c19('0x29')]({'where':{'id':_0x3c1c33['params']['id']}})['then'](handleEntityNotFound(_0x59ff1,null))[_0x4c19('0x23')](removeEntity(_0x59ff1,null))['catch'](handleError(_0x59ff1,null));};
\ No newline at end of file
+var _0xe23f=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','body','Action','params','catch','find','request-promise','moment','util','path','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/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x15cffe,_0x8987a2){var _0x37de19=function(_0x40b8d8){while(--_0x40b8d8){_0x15cffe['push'](_0x15cffe['shift']());}};_0x37de19(++_0x8987a2);}(_0xe23f,0xf5));var _0xfe23=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xe23f[_0x53ccf2];return _0x5a2964;};'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(_0xfe23('0x0'));var moment=require(_0xfe23('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe23('0x2'));var path=require(_0xfe23('0x3'));var sox=require('sox');var csv=require(_0xfe23('0x4'));var ejs=require(_0xfe23('0x5'));var fs=require('fs');var fs_extra=require(_0xfe23('0x6'));var _=require(_0xfe23('0x7'));var squel=require('squel');var crypto=require(_0xfe23('0x8'));var jsforce=require(_0xfe23('0x9'));var deskjs=require(_0xfe23('0xa'));var toCsv=require(_0xfe23('0x4'));var querystring=require(_0xfe23('0xb'));var Papa=require(_0xfe23('0xc'));var Redis=require('ioredis');var authService=require(_0xfe23('0xd'));var qs=require(_0xfe23('0xe'));var as=require(_0xfe23('0xf'));var hardwareService=require(_0xfe23('0x10'));var logger=require(_0xfe23('0x11'))(_0xfe23('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfe23('0x13'));var db=require(_0xfe23('0x14'))['db'];function respondWithStatusCode(_0x3fe9b8,_0x2f9788){_0x2f9788=_0x2f9788||0xcc;return function(_0x56363a){if(_0x56363a){return _0x3fe9b8[_0xfe23('0x15')](_0x2f9788);}return _0x3fe9b8[_0xfe23('0x16')](_0x2f9788)['end']();};}function respondWithResult(_0x30d414,_0x57c466){_0x57c466=_0x57c466||0xc8;return function(_0x1dff3f){if(_0x1dff3f){return _0x30d414[_0xfe23('0x16')](_0x57c466)[_0xfe23('0x17')](_0x1dff3f);}};}function respondWithFilteredResult(_0x33ab8e,_0x4d554d){return function(_0x15ccab){if(_0x15ccab){var _0x1d097e=typeof _0x4d554d[_0xfe23('0x18')]===_0xfe23('0x19')&&typeof _0x4d554d[_0xfe23('0x1a')]===_0xfe23('0x19');var _0x2d3bb5=_0x15ccab[_0xfe23('0x1b')];var _0x15077c=_0x1d097e?0x0:_0x4d554d[_0xfe23('0x18')];var _0x4fd49a=_0x1d097e?_0x15ccab[_0xfe23('0x1b')]:_0x4d554d[_0xfe23('0x18')]+_0x4d554d[_0xfe23('0x1a')];var _0x3b978d;if(_0x4fd49a>=_0x2d3bb5){_0x4fd49a=_0x2d3bb5;_0x3b978d=0xc8;}else{_0x3b978d=0xce;}_0x33ab8e[_0xfe23('0x16')](_0x3b978d);return _0x33ab8e['set'](_0xfe23('0x1c'),_0x15077c+'-'+_0x4fd49a+'/'+_0x2d3bb5)[_0xfe23('0x17')](_0x15ccab);}return null;};}function patchUpdates(_0x59e0b3){return function(_0x2c4a0f){try{jsonpatch[_0xfe23('0x1d')](_0x2c4a0f,_0x59e0b3,!![]);}catch(_0x225a69){return BPromise[_0xfe23('0x1e')](_0x225a69);}return _0x2c4a0f[_0xfe23('0x1f')]();};}function saveUpdates(_0x56b959,_0x177c5c){return function(_0x348bd2){if(_0x348bd2){return _0x348bd2[_0xfe23('0x20')](_0x56b959)[_0xfe23('0x21')](function(_0x302816){return _0x302816;});}return null;};}function removeEntity(_0x1eb003,_0x9f08db){return function(_0x241c03){if(_0x241c03){return _0x241c03[_0xfe23('0x22')]()[_0xfe23('0x21')](function(){_0x1eb003[_0xfe23('0x16')](0xcc)[_0xfe23('0x23')]();});}};}function handleEntityNotFound(_0x24d1c2,_0x59af9e){return function(_0x332f0a){if(!_0x332f0a){_0x24d1c2['sendStatus'](0x194);}return _0x332f0a;};}function handleError(_0x4acfd7,_0xb13606){_0xb13606=_0xb13606||0x1f4;return function(_0xef2f79){logger[_0xfe23('0x24')](_0xef2f79[_0xfe23('0x25')]);if(_0xef2f79[_0xfe23('0x26')]){delete _0xef2f79['name'];}_0x4acfd7['status'](_0xb13606)[_0xfe23('0x27')](_0xef2f79);};}exports['update']=function(_0x121d43,_0x18fb50){if(_0x121d43[_0xfe23('0x28')]['id']){delete _0x121d43[_0xfe23('0x28')]['id'];}return db[_0xfe23('0x29')]['find']({'where':{'id':_0x121d43[_0xfe23('0x2a')]['id']}})[_0xfe23('0x21')](handleEntityNotFound(_0x18fb50,null))['then'](saveUpdates(_0x121d43[_0xfe23('0x28')],null))[_0xfe23('0x21')](respondWithResult(_0x18fb50,null))[_0xfe23('0x2b')](handleError(_0x18fb50,null));};exports[_0xfe23('0x22')]=function(_0x2d5094,_0x4bf523){return db['Action'][_0xfe23('0x2c')]({'where':{'id':_0x2d5094[_0xfe23('0x2a')]['id']}})[_0xfe23('0x21')](handleEntityNotFound(_0x4bf523,null))['then'](removeEntity(_0x4bf523,null))[_0xfe23('0x2b')](handleError(_0x4bf523,null));};
\ No newline at end of file
index 69ca748..ea10686 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cb8=['path','rimraf','exports','define','Action','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x0cb8,0x1b3));var _0x80cb=function(_0x5e58bf,_0x4957fb){_0x5e58bf=_0x5e58bf-0x0;var _0xccdaab=_0x0cb8[_0x5e58bf];return _0xccdaab;};'use strict';var _=require(_0x80cb('0x0'));var util=require(_0x80cb('0x1'));var logger=require(_0x80cb('0x2'))('api');var moment=require(_0x80cb('0x3'));var BPromise=require(_0x80cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80cb('0x5'));var rimraf=require(_0x80cb('0x6'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x80cb('0x7')]=function(_0x24d8b6,_0x3eb35e){return _0x24d8b6[_0x80cb('0x8')](_0x80cb('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x78db=['./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x78db,0x1d3));var _0xb78d=function(_0x18ae8f,_0x25f684){_0x18ae8f=_0x18ae8f-0x0;var _0x43e219=_0x78db[_0x18ae8f];return _0x43e219;};'use strict';var _=require(_0xb78d('0x0'));var util=require(_0xb78d('0x1'));var logger=require(_0xb78d('0x2'))(_0xb78d('0x3'));var moment=require(_0xb78d('0x4'));var BPromise=require(_0xb78d('0x5'));var rp=require(_0xb78d('0x6'));var fs=require('fs');var path=require(_0xb78d('0x7'));var rimraf=require(_0xb78d('0x8'));var config=require('../../config/environment');var attributes=require(_0xb78d('0x9'));module[_0xb78d('0xa')]=function(_0xa99b14,_0x3e2b7f){return _0xa99b14[_0xb78d('0xb')](_0xb78d('0xc'),attributes,{'tableName':_0xb78d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9be038b..e8445ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x35383d,_0xdce948){var _0x248db3=function(_0x378d62){while(--_0x378d62){_0x35383d['push'](_0x35383d['shift']());}};_0x248db3(++_0xdce948);}(_0xe14b,0x93));var _0xbe14=function(_0x32a846,_0x2bd5d0){_0x32a846=_0x32a846-0x0;var _0x476076=_0xe14b[_0x32a846];return _0x476076;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x4975,0x86));var _0x5497=function(_0x4470ae,_0x13844d){_0x4470ae=_0x4470ae-0x0;var _0x5b002c=_0x4975[_0x4470ae];return _0x5b002c;};'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')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
index 08be207..a70e140 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3ce=['../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xfa2430,_0x41140b){var _0xf81cad=function(_0x5328b7){while(--_0x5328b7){_0xfa2430['push'](_0xfa2430['shift']());}};_0xf81cad(++_0x41140b);}(_0xf3ce,0x79));var _0xef3c=function(_0x33cfe6,_0x3e215c){_0x33cfe6=_0x33cfe6-0x0;var _0x34b6cf=_0xf3ce[_0x33cfe6];return _0x34b6cf;};'use strict';var multer=require('multer');var util=require(_0xef3c('0x0'));var path=require(_0xef3c('0x1'));var timeout=require(_0xef3c('0x2'));var express=require(_0xef3c('0x3'));var router=express[_0xef3c('0x4')]();var fs_extra=require(_0xef3c('0x5'));var auth=require(_0xef3c('0x6'));var interaction=require(_0xef3c('0x7'));var config=require(_0xef3c('0x8'));var controller=require('./action.controller');router[_0xef3c('0x9')](_0xef3c('0xa'),auth[_0xef3c('0xb')](),controller[_0xef3c('0xc')]);router[_0xef3c('0xd')](_0xef3c('0xa'),auth[_0xef3c('0xb')](),controller[_0xef3c('0xe')]);module[_0xef3c('0xf')]=router;
\ No newline at end of file
+var _0xa59e=['multer','../../components/interaction/service','../../config/environment','./action.controller','put','delete','/:id','isAuthenticated','destroy','exports'];(function(_0x1cd4e,_0x2e7938){var _0x21fd1f=function(_0x5c18f0){while(--_0x5c18f0){_0x1cd4e['push'](_0x1cd4e['shift']());}};_0x21fd1f(++_0x2e7938);}(_0xa59e,0x19a));var _0xea59=function(_0x2e7615,_0x12e721){_0x2e7615=_0x2e7615-0x0;var _0x329415=_0xa59e[_0x2e7615];return _0x329415;};'use strict';var multer=require(_0xea59('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xea59('0x1'));var config=require(_0xea59('0x2'));var controller=require(_0xea59('0x3'));router[_0xea59('0x4')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xea59('0x5')](_0xea59('0x6'),auth[_0xea59('0x7')](),controller[_0xea59('0x8')]);module[_0xea59('0x9')]=router;
\ No newline at end of file
index 9ae4020..8ac605c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x56f55b,_0x1c02aa){var _0x232941=function(_0x3710c6){while(--_0x3710c6){_0x56f55b['push'](_0x56f55b['shift']());}};_0x232941(++_0x1c02aa);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x9efe0,_0x1e7272){_0x9efe0=_0x9efe0-0x0;var _0x232a0f=_0xf2ca[_0x9efe0];return _0x232a0f;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}};
\ No newline at end of file
+var _0x6aa7=['TEXT','sequelize','STRING'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0x6aa7,0x178));var _0x76aa=function(_0x1b3ee8,_0x1e7614){_0x1b3ee8=_0x1b3ee8-0x0;var _0xf0e6bf=_0x6aa7[_0x1b3ee8];return _0xf0e6bf;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x76aa('0x1')]},'parent':{'type':Sequelize[_0x76aa('0x1')]},'table':{'type':Sequelize[_0x76aa('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x76aa('0x2')]}};
\ No newline at end of file
index dce71cf..bd2cf77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe32a=['metric','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','right_join','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s)','IS\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','alias','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','QueryTypes','run','runReport','COUNT(DISTINCT\x20%s)','getFields','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','key','model','keys','intersection','query','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','rows','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','MAX(%s)','MIN(%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\x20NOT\x20EMPTY','rules','operator','group','field','condition','AnalyticMetric','findAll','keyBy','from','MetricId'];(function(_0x5e77c0,_0x1b4867){var _0x541bba=function(_0xcfb5de){while(--_0xcfb5de){_0x5e77c0['push'](_0x5e77c0['shift']());}};_0x541bba(++_0x1b4867);}(_0xe32a,0x192));var _0xae32=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0xe32a[_0x474d97];return _0x1edf25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae32('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae32('0x1'));var rp=require(_0xae32('0x2'));var moment=require('moment');var BPromise=require(_0xae32('0x3'));var Mustache=require(_0xae32('0x4'));var util=require('util');var path=require(_0xae32('0x5'));var sox=require(_0xae32('0x6'));var csv=require(_0xae32('0x7'));var ejs=require(_0xae32('0x8'));var fs=require('fs');var fs_extra=require(_0xae32('0x9'));var _=require(_0xae32('0xa'));var squel=require(_0xae32('0xb'));var crypto=require(_0xae32('0xc'));var jsforce=require(_0xae32('0xd'));var deskjs=require(_0xae32('0xe'));var toCsv=require(_0xae32('0x7'));var querystring=require(_0xae32('0xf'));var Papa=require('papaparse');var Redis=require(_0xae32('0x10'));var authService=require(_0xae32('0x11'));var qs=require(_0xae32('0x12'));var as=require(_0xae32('0x13'));var hardwareService=require(_0xae32('0x14'));var logger=require(_0xae32('0x15'))('api');var utils=require(_0xae32('0x16'));var config=require(_0xae32('0x17'));var licenseUtil=require(_0xae32('0x18'));var db=require(_0xae32('0x19'))['db'];var dbH=require(_0xae32('0x19'))[_0xae32('0x1a')];function respondWithStatusCode(_0x2394d8,_0x2dd580){_0x2dd580=_0x2dd580||0xcc;return function(_0x4458cd){if(_0x4458cd){return _0x2394d8[_0xae32('0x1b')](_0x2dd580);}return _0x2394d8[_0xae32('0x1c')](_0x2dd580)[_0xae32('0x1d')]();};}function respondWithResult(_0x202422,_0x13d856){_0x13d856=_0x13d856||0xc8;return function(_0x49eb2c){if(_0x49eb2c){return _0x202422['status'](_0x13d856)[_0xae32('0x1e')](_0x49eb2c);}};}function respondWithFilteredResult(_0x5d339c,_0x52f816){return function(_0x3f53f1){if(_0x3f53f1){var _0x290ac2=typeof _0x52f816['offset']===_0xae32('0x1f')&&typeof _0x52f816['limit']===_0xae32('0x1f');var _0x54c035=_0x3f53f1[_0xae32('0x20')];var _0x4ad3fe=_0x290ac2?0x0:_0x52f816['offset'];var _0xe32b6a=_0x290ac2?_0x3f53f1[_0xae32('0x20')]:_0x52f816[_0xae32('0x21')]+_0x52f816[_0xae32('0x22')];var _0x297fe7;if(_0xe32b6a>=_0x54c035){_0xe32b6a=_0x54c035;_0x297fe7=0xc8;}else{_0x297fe7=0xce;}_0x5d339c[_0xae32('0x1c')](_0x297fe7);return _0x5d339c[_0xae32('0x23')](_0xae32('0x24'),_0x4ad3fe+'-'+_0xe32b6a+'/'+_0x54c035)[_0xae32('0x1e')](_0x3f53f1);}return null;};}function patchUpdates(_0x40883a){return function(_0x2c6fac){try{jsonpatch[_0xae32('0x25')](_0x2c6fac,_0x40883a,!![]);}catch(_0x4cb117){return BPromise[_0xae32('0x26')](_0x4cb117);}return _0x2c6fac[_0xae32('0x27')]();};}function saveUpdates(_0x57dad4,_0x322605){return function(_0x2819dd){if(_0x2819dd){return _0x2819dd[_0xae32('0x28')](_0x57dad4)[_0xae32('0x29')](function(_0x9e653b){return _0x9e653b;});}return null;};}function removeEntity(_0x5c8499,_0x5c1522){return function(_0x1fd6bc){if(_0x1fd6bc){return _0x1fd6bc[_0xae32('0x2a')]()[_0xae32('0x29')](function(){var _0x1849c9=_0x1fd6bc[_0xae32('0x2b')]({'plain':!![]});var _0x11bd85=_0xae32('0x2c');return db[_0xae32('0x2d')][_0xae32('0x2a')]({'where':{'type':_0x11bd85,'resourceId':_0x1849c9['id']}})[_0xae32('0x29')](function(){return _0x1fd6bc;});})['then'](function(){_0x5c8499[_0xae32('0x1c')](0xcc)[_0xae32('0x1d')]();});}};}function handleEntityNotFound(_0x1ea62a,_0x561e7b){return function(_0x526c59){if(!_0x526c59){_0x1ea62a[_0xae32('0x1b')](0x194);}return _0x526c59;};}function handleError(_0x1e3686,_0x21bd6e){_0x21bd6e=_0x21bd6e||0x1f4;return function(_0x4e2488){logger[_0xae32('0x2e')](_0x4e2488[_0xae32('0x2f')]);if(_0x4e2488[_0xae32('0x30')]){delete _0x4e2488[_0xae32('0x30')];}_0x1e3686['status'](_0x21bd6e)[_0xae32('0x31')](_0x4e2488);};}exports[_0xae32('0x32')]=function(_0x3426e0,_0x356aa2){var _0xc4ed2d={},_0x1779ac={},_0x5143e5={'count':0x0,'rows':[]};var _0x5b7ee0=_['map'](db[_0xae32('0x33')][_0xae32('0x34')],function(_0x4b76ab){return{'name':_0x4b76ab[_0xae32('0x35')],'type':_0x4b76ab['type'][_0xae32('0x36')]};});_0x1779ac[_0xae32('0x37')]=_['map'](_0x5b7ee0,_0xae32('0x30'));_0x1779ac['query']=_[_0xae32('0x38')](_0x3426e0['query']);_0x1779ac['filters']=_[_0xae32('0x39')](_0x1779ac[_0xae32('0x37')],_0x1779ac[_0xae32('0x3a')]);_0xc4ed2d['attributes']=_['intersection'](_0x1779ac[_0xae32('0x37')],qs[_0xae32('0x3b')](_0x3426e0[_0xae32('0x3a')][_0xae32('0x3b')]));_0xc4ed2d['attributes']=_0xc4ed2d['attributes'][_0xae32('0x3c')]?_0xc4ed2d[_0xae32('0x3d')]:_0x1779ac[_0xae32('0x37')];if(!_0x3426e0[_0xae32('0x3a')][_0xae32('0x3e')](_0xae32('0x3f'))){_0xc4ed2d[_0xae32('0x22')]=qs[_0xae32('0x22')](_0x3426e0[_0xae32('0x3a')][_0xae32('0x22')]);_0xc4ed2d[_0xae32('0x21')]=qs[_0xae32('0x21')](_0x3426e0[_0xae32('0x3a')]['offset']);}_0xc4ed2d[_0xae32('0x40')]=qs[_0xae32('0x41')](_0x3426e0['query'][_0xae32('0x41')]);_0xc4ed2d[_0xae32('0x42')]=qs[_0xae32('0x43')](_[_0xae32('0x44')](_0x3426e0[_0xae32('0x3a')],_0x1779ac[_0xae32('0x43')]),_0x5b7ee0);if(_0x3426e0['query'][_0xae32('0x45')]){_0xc4ed2d[_0xae32('0x42')]=_[_0xae32('0x46')](_0xc4ed2d[_0xae32('0x42')],{'$or':_['map'](_0x5b7ee0,function(_0x16327b){if(_0x16327b[_0xae32('0x47')]!=='VIRTUAL'){var _0x3a070e={};_0x3a070e[_0x16327b[_0xae32('0x30')]]={'$like':'%'+_0x3426e0[_0xae32('0x3a')][_0xae32('0x45')]+'%'};return _0x3a070e;}})});}_0xc4ed2d=_[_0xae32('0x46')]({},_0xc4ed2d,_0x3426e0[_0xae32('0x48')]);var _0x362d7f={'where':_0xc4ed2d[_0xae32('0x42')]};return db[_0xae32('0x33')][_0xae32('0x20')](_0x362d7f)[_0xae32('0x29')](function(_0x56c4db){_0x5143e5[_0xae32('0x20')]=_0x56c4db;if(_0x3426e0[_0xae32('0x3a')][_0xae32('0x49')]){_0xc4ed2d['include']=[{'all':!![]}];}return db[_0xae32('0x33')]['findAll'](_0xc4ed2d);})[_0xae32('0x29')](function(_0x2dca7d){_0x5143e5[_0xae32('0x4a')]=_0x2dca7d;return _0x5143e5;})['then'](respondWithFilteredResult(_0x356aa2,_0xc4ed2d))['catch'](handleError(_0x356aa2,null));};exports['show']=function(_0x49a537,_0x5450fd){var _0x21c3bc={'raw':![],'where':{'id':_0x49a537[_0xae32('0x4b')]['id']}},_0x212a6c={};_0x212a6c['model']=_['keys'](db[_0xae32('0x33')][_0xae32('0x34')]);_0x212a6c[_0xae32('0x3a')]=_['keys'](_0x49a537[_0xae32('0x3a')]);_0x212a6c['filters']=_[_0xae32('0x39')](_0x212a6c[_0xae32('0x37')],_0x212a6c[_0xae32('0x3a')]);_0x21c3bc[_0xae32('0x3d')]=_[_0xae32('0x39')](_0x212a6c['model'],qs[_0xae32('0x3b')](_0x49a537[_0xae32('0x3a')][_0xae32('0x3b')]));_0x21c3bc[_0xae32('0x3d')]=_0x21c3bc['attributes'][_0xae32('0x3c')]?_0x21c3bc[_0xae32('0x3d')]:_0x212a6c[_0xae32('0x37')];if(_0x49a537[_0xae32('0x3a')][_0xae32('0x49')]){_0x21c3bc[_0xae32('0x4c')]=[{'all':!![]}];}_0x21c3bc=_[_0xae32('0x46')]({},_0x21c3bc,_0x49a537[_0xae32('0x48')]);return db[_0xae32('0x33')][_0xae32('0x4d')](_0x21c3bc)[_0xae32('0x29')](handleEntityNotFound(_0x5450fd,null))[_0xae32('0x29')](respondWithResult(_0x5450fd,null))['catch'](handleError(_0x5450fd,null));};exports[_0xae32('0x4e')]=function(_0x60fc77,_0x578a12){return db['AnalyticCustomReport'][_0xae32('0x4e')](_0x60fc77[_0xae32('0x4f')],{})[_0xae32('0x29')](function(_0x325e7e){var _0x443c1a=_0x60fc77['user'][_0xae32('0x2b')]({'plain':!![]});if(!_0x443c1a)throw new Error(_0xae32('0x50'));if(_0x443c1a['role']===_0xae32('0x51')){var _0xfa62aa=_0x325e7e[_0xae32('0x2b')]({'plain':!![]});var _0x310d99='Reports';return db[_0xae32('0x52')]['find']({'where':{'name':_0x310d99,'userProfileId':_0x443c1a[_0xae32('0x53')]},'raw':!![]})['then'](function(_0xa5d7d8){if(_0xa5d7d8&&_0xa5d7d8[_0xae32('0x54')]===0x0){return db[_0xae32('0x2d')][_0xae32('0x4e')]({'name':_0xfa62aa[_0xae32('0x30')],'resourceId':_0xfa62aa['id'],'type':_0xae32('0x2c'),'sectionId':_0xa5d7d8['id']},{})['then'](function(){return _0x325e7e;});}else{return _0x325e7e;}})[_0xae32('0x55')](function(_0x54ed4d){logger[_0xae32('0x2e')](_0xae32('0x56'),_0x54ed4d);throw _0x54ed4d;});}return _0x325e7e;})[_0xae32('0x29')](respondWithResult(_0x578a12,0xc9))['catch'](handleError(_0x578a12,null));};exports[_0xae32('0x28')]=function(_0x3c172d,_0xae37bf){if(_0x3c172d['body']['id']){delete _0x3c172d[_0xae32('0x4f')]['id'];}return db[_0xae32('0x33')][_0xae32('0x4d')]({'where':{'id':_0x3c172d[_0xae32('0x4b')]['id']}})[_0xae32('0x29')](handleEntityNotFound(_0xae37bf,null))[_0xae32('0x29')](saveUpdates(_0x3c172d[_0xae32('0x4f')],null))[_0xae32('0x29')](respondWithResult(_0xae37bf,null))['catch'](handleError(_0xae37bf,null));};exports[_0xae32('0x2a')]=function(_0x1a5328,_0x516ac8){return db[_0xae32('0x33')]['find']({'where':{'id':_0x1a5328['params']['id']}})[_0xae32('0x29')](handleEntityNotFound(_0x516ac8,null))[_0xae32('0x29')](removeEntity(_0x516ac8,null))[_0xae32('0x55')](handleError(_0x516ac8,null));};exports['preview']=function(_0x5eb812,_0x21c2b3){var _0x513a7e=0xa;var _0x468e2f=[_0xae32('0x57'),_0xae32('0x58'),'right_join',_0xae32('0x59')];var _0x193d85={'SUM':_0xae32('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xae32('0x5b'),'MIN':_0xae32('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xae32('0x5d'),'GROUP_CONCAT DESC':_0xae32('0x5e')};var _0xd4c2b9={'SEC_TO_TIME':_0xae32('0x5f'),'DATE':_0xae32('0x60'),'HOUR':_0xae32('0x61'),'ROUND':_0xae32('0x62'),'UNIX_TIMESTAMP':_0xae32('0x63')};var _0x3d1606=function(_0x5374cc){return!_[_0xae32('0x64')]([_0xae32('0x65'),_0xae32('0x66'),'IS\x20EMPTY',_0xae32('0x67')],_0x5374cc);};var _0x1701c0=function(_0x423d64){if(!_0x423d64||!_0x423d64[_0xae32('0x68')]['length']){return'';}for(var _0x54cbf4='(',_0x4cedd3=0x0;_0x4cedd3<_0x423d64[_0xae32('0x68')][_0xae32('0x3c')];_0x4cedd3+=0x1){_0x4cedd3>0x0&&(_0x54cbf4+='\x20'+_0x423d64[_0xae32('0x69')]+'\x20');_0x54cbf4+=_0x423d64['rules'][_0x4cedd3][_0xae32('0x6a')]?_0x1701c0(_0x423d64[_0xae32('0x68')][_0x4cedd3][_0xae32('0x6a')]):_0x423d64[_0xae32('0x68')][_0x4cedd3][_0xae32('0x6b')]+'\x20'+_0x423d64[_0xae32('0x68')][_0x4cedd3]['condition']+(_0x3d1606(_0x423d64[_0xae32('0x68')][_0x4cedd3][_0xae32('0x6c')])?'\x20'+_0x423d64[_0xae32('0x68')][_0x4cedd3]['value']:'');}return _0x54cbf4+')';};var _0x213200={'where':{'id':_0x5eb812[_0xae32('0x4b')]['id']}},_0x4a4572,_0x1929d1,_0xa78d8b,_0x460f37,_0x5273fe;_0x213200=_[_0xae32('0x46')]({},_0x213200,_0x5eb812['options']);return db[_0xae32('0x33')]['find'](_0x213200)[_0xae32('0x29')](function(_0x4a9ea6){if(_0x4a9ea6){_0x4a4572=_0x4a9ea6;return _0x4a9ea6['getFields']();}return null;})[_0xae32('0x29')](function(_0x272b17){if(_0x272b17){if(!_0x272b17['length']){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1929d1=_0x272b17;return db[_0xae32('0x6d')][_0xae32('0x6e')]({'raw':!![]});}return null;})[_0xae32('0x29')](function(_0x41ff8b){if(_0x41ff8b){_0xa78d8b=_[_0xae32('0x6f')](_0x41ff8b,'id');var _0x3fc903;var _0x6793a7=squel['select']();_0x6793a7[_0xae32('0x70')](_0x4a4572['table']);for(var _0x4c287a=0x0;_0x4c287a<_0x1929d1[_0xae32('0x3c')];_0x4c287a+=0x1){_0x3fc903=_0x1929d1[_0x4c287a]['MetricId']?_0xa78d8b[_0x1929d1[_0x4c287a][_0xae32('0x71')]][_0xae32('0x72')]:_0x1929d1[_0x4c287a][_0xae32('0x6b')];_0x3fc903=_0x1929d1[_0x4c287a][_0xae32('0x73')]?_['replace'](_0x193d85[_0x1929d1[_0x4c287a]['function']],'%s',_0x3fc903):_0x3fc903;_0x3fc903=_0x1929d1[_0x4c287a][_0xae32('0x74')]?_[_0xae32('0x75')](_0xd4c2b9[_0x1929d1[_0x4c287a][_0xae32('0x74')]],'%s',_0x3fc903):_0x3fc903;if(_0x1929d1[_0x4c287a][_0xae32('0x76')]){_0x6793a7[_0xae32('0x6a')](_0x3fc903);}_0x1929d1[_0x4c287a][_0xae32('0x77')]&&_0x6793a7[_0xae32('0x40')](_0x3fc903,_0x1929d1[_0x4c287a][_0xae32('0x77')]===_0xae32('0x78')?![]:!![]);_0x6793a7[_0xae32('0x6b')](_0x3fc903,_0x1929d1[_0x4c287a]['alias']||_0x3fc903);}if(_0x4a4572[_0xae32('0x79')]){_0x4a4572['joins']=JSON[_0xae32('0x7a')](_0x4a4572[_0xae32('0x79')]);for(var _0x45aa8f=0x0;_0x45aa8f<_0x4a4572[_0xae32('0x79')][_0xae32('0x3c')];_0x45aa8f+=0x1){if(_0x4a4572[_0xae32('0x79')][_0x45aa8f][_0xae32('0x47')]&&_[_0xae32('0x64')](_0x468e2f,_0x4a4572[_0xae32('0x79')][_0x45aa8f]['type'])&&_0x4a4572[_0xae32('0x79')][_0x45aa8f][_0xae32('0x7b')]&&_0x4a4572[_0xae32('0x79')][_0x45aa8f][_0xae32('0x7c')]&&_0x4a4572[_0xae32('0x79')][_0x45aa8f][_0xae32('0x7d')]){_0x6793a7[_0x4a4572['joins'][_0x45aa8f][_0xae32('0x47')]](_0x4a4572['joins'][_0x45aa8f][_0xae32('0x7c')],null,util[_0xae32('0x74')](_0xae32('0x7e'),_0x4a4572[_0xae32('0x7f')],_0x4a4572[_0xae32('0x79')][_0x45aa8f][_0xae32('0x7b')],_0x4a4572[_0xae32('0x79')][_0x45aa8f][_0xae32('0x7c')],_0x4a4572[_0xae32('0x79')][_0x45aa8f][_0xae32('0x7d')]));}}}if(_0x4a4572[_0xae32('0x80')]){_0x4a4572[_0xae32('0x80')]=JSON[_0xae32('0x7a')](_0x4a4572['conditions']);_0x6793a7[_0xae32('0x42')](_0x1701c0(_0x4a4572['conditions'][_0xae32('0x6a')]));}_0x5273fe=_0x6793a7['clone']();_0x6793a7['limit'](_0x513a7e);_0x6793a7[_0xae32('0x21')](0x0);logger[_0xae32('0x81')](_0xae32('0x82'),_0x6793a7['toString']());return dbH['sequelize']['query'](_0x6793a7[_0xae32('0x83')](),{'type':dbH[_0xae32('0x84')]['QueryTypes'][_0xae32('0x85')]});}})[_0xae32('0x29')](respondWithResult(_0x21c2b3,null))['catch'](handleError(_0x21c2b3,null));};function runReport(_0x4de833,_0x35b5d8,_0xdc0b69){var _0x4d96ab=_0x35b5d8[_0xae32('0x30')];var _0x397e2c=0xa;var _0xaf7cf8=[_0xae32('0x57'),_0xae32('0x58'),_0xae32('0x86'),_0xae32('0x59')];var _0x358f6c={'SUM':_0xae32('0x5a'),'COUNT':_0xae32('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xae32('0x5c'),'AVG':_0xae32('0x88'),'GROUP_CONCAT':_0xae32('0x89'),'GROUP_CONCAT ASC':_0xae32('0x5d'),'GROUP_CONCAT DESC':_0xae32('0x5e')};var _0x514be1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xae32('0x60'),'HOUR':_0xae32('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xae32('0x63')};var _0x9695ac=function(_0x4249dd){return!_[_0xae32('0x64')]([_0xae32('0x65'),'IS\x20NOT\x20NULL',_0xae32('0x8a'),_0xae32('0x67')],_0x4249dd);};var _0xa071f7=function(_0x3a78f0){if(!_0x3a78f0||!_0x3a78f0[_0xae32('0x68')][_0xae32('0x3c')]){return'';}for(var _0x2b1a6c='(',_0x16a5f7=0x0;_0x16a5f7<_0x3a78f0['rules']['length'];_0x16a5f7+=0x1){_0x16a5f7>0x0&&(_0x2b1a6c+='\x20'+_0x3a78f0[_0xae32('0x69')]+'\x20');_0x2b1a6c+=_0x3a78f0['rules'][_0x16a5f7][_0xae32('0x6a')]?_0xa071f7(_0x3a78f0[_0xae32('0x68')][_0x16a5f7][_0xae32('0x6a')]):_0x3a78f0[_0xae32('0x68')][_0x16a5f7][_0xae32('0x6b')]+'\x20'+_0x3a78f0['rules'][_0x16a5f7][_0xae32('0x6c')]+(_0x9695ac(_0x3a78f0[_0xae32('0x68')][_0x16a5f7]['condition'])?'\x20'+_0x3a78f0[_0xae32('0x68')][_0x16a5f7][_0xae32('0x8b')]:'');}return _0x2b1a6c+')';};var _0x19e85c={'where':{'id':_0x4de833['id']}},_0x323c93,_0x1ebbfa,_0x45c033,_0x365207,_0x588837;_0x19e85c=_[_0xae32('0x46')]({},_0x19e85c,_0xdc0b69);return db[_0xae32('0x33')][_0xae32('0x4d')](_0x19e85c)[_0xae32('0x29')](function(_0x4ccb9d){if(_0x4ccb9d){_0x323c93=_0x4ccb9d;return _0x4ccb9d['getFields']();}return null;})['then'](function(_0xe18884){if(_0xe18884){if(!_0xe18884[_0xae32('0x3c')]){throw new db['Sequelize'][(_0xae32('0x8c'))](_0xae32('0x8d'),0x193);}_0x1ebbfa=_0xe18884;return db[_0xae32('0x6d')][_0xae32('0x6e')]({'raw':!![]});}return null;})[_0xae32('0x29')](function(_0x5154d2){if(_0x5154d2){_0x45c033=_[_0xae32('0x6f')](_0x5154d2,'id');var _0x3ec48b;var _0x4d1d15=squel['select']();_0x4d1d15[_0xae32('0x70')](_0x323c93[_0xae32('0x7f')]);for(var _0x26235e=0x0;_0x26235e<_0x1ebbfa[_0xae32('0x3c')];_0x26235e+=0x1){_0x3ec48b=_0x1ebbfa[_0x26235e][_0xae32('0x71')]?_0x45c033[_0x1ebbfa[_0x26235e][_0xae32('0x71')]][_0xae32('0x72')]:_0x1ebbfa[_0x26235e][_0xae32('0x6b')];_0x3ec48b=_0x1ebbfa[_0x26235e][_0xae32('0x73')]?_[_0xae32('0x75')](_0x358f6c[_0x1ebbfa[_0x26235e]['function']],'%s',_0x3ec48b):_0x3ec48b;_0x3ec48b=_0x1ebbfa[_0x26235e][_0xae32('0x74')]?_['replace'](_0x514be1[_0x1ebbfa[_0x26235e]['format']],'%s',_0x3ec48b):_0x3ec48b;if(_0x1ebbfa[_0x26235e][_0xae32('0x76')]){_0x4d1d15[_0xae32('0x6a')](_0x3ec48b);}_0x1ebbfa[_0x26235e][_0xae32('0x77')]&&_0x4d1d15[_0xae32('0x40')](_0x3ec48b,_0x1ebbfa[_0x26235e][_0xae32('0x77')]===_0xae32('0x78')?![]:!![]);_0x4d1d15[_0xae32('0x6b')](_0x3ec48b,_0x1ebbfa[_0x26235e][_0xae32('0x8e')]||_0x3ec48b);}if(_0x323c93[_0xae32('0x79')]){_0x323c93[_0xae32('0x79')]=JSON[_0xae32('0x7a')](_0x323c93['joins']);for(var _0x45969c=0x0;_0x45969c<_0x323c93['joins'][_0xae32('0x3c')];_0x45969c+=0x1){if(_0x323c93[_0xae32('0x79')][_0x45969c]['type']&&_['includes'](_0xaf7cf8,_0x323c93[_0xae32('0x79')][_0x45969c][_0xae32('0x47')])&&_0x323c93['joins'][_0x45969c][_0xae32('0x7b')]&&_0x323c93[_0xae32('0x79')][_0x45969c][_0xae32('0x7c')]&&_0x323c93[_0xae32('0x79')][_0x45969c][_0xae32('0x7d')]){_0x4d1d15[_0x323c93['joins'][_0x45969c][_0xae32('0x47')]](_0x323c93[_0xae32('0x79')][_0x45969c][_0xae32('0x7c')],null,util[_0xae32('0x74')](_0xae32('0x7e'),_0x323c93[_0xae32('0x7f')],_0x323c93[_0xae32('0x79')][_0x45969c]['parentKey'],_0x323c93[_0xae32('0x79')][_0x45969c]['foreignTable'],_0x323c93[_0xae32('0x79')][_0x45969c][_0xae32('0x7d')]));}}}if(_0x323c93['conditions']){_0x323c93[_0xae32('0x80')]=JSON[_0xae32('0x7a')](_0x323c93[_0xae32('0x80')]);_0x4d1d15[_0xae32('0x42')](_0xa071f7(_0x323c93[_0xae32('0x80')][_0xae32('0x6a')]));}_0x588837=_0x4d1d15[_0xae32('0x8f')]();_0x4d1d15['limit'](_0x397e2c);_0x4d1d15[_0xae32('0x21')](0x0);return;}})[_0xae32('0x29')](function(){if(_0x35b5d8['output']===_0xae32('0x90')){return null;}var _0x4e8332=_[_0xae32('0x46')](_0x35b5d8,{'name':_0x35b5d8[_0xae32('0x91')]||_0x35b5d8[_0xae32('0x30')]||_0x323c93[_0xae32('0x30')],'basename':_0x4d96ab,'savename':util[_0xae32('0x74')](_0xae32('0x92'),_0x35b5d8['name']||_0x323c93[_0xae32('0x30')],require(_0xae32('0x93'))[_0xae32('0x94')](0x4),_0x35b5d8[_0xae32('0x95')]||_0xae32('0x96')),'reportId':_0x323c93['id'],'reportType':_0xae32('0x97')});return db[_0xae32('0x98')]['create'](_0x4e8332,{'raw':!![]});})[_0xae32('0x29')](function(_0x2d911c){if(_0x323c93[_0xae32('0x7f')]==='cdr'){_0x588837['where'](_0x323c93['table']+_0xae32('0x99'),_0x35b5d8['startDate'],_0x35b5d8[_0xae32('0x9a')]);}else{_0x588837[_0xae32('0x42')](_0x323c93[_0xae32('0x7f')]+_0xae32('0x9b'),_0x35b5d8[_0xae32('0x9c')],_0x35b5d8[_0xae32('0x9a')]);}if(_0x2d911c){logger[_0xae32('0x9d')](_0xae32('0x9e'),_0x588837['toString']());require(_0xae32('0x9f'))[_0xae32('0xa0')](path[_0xae32('0x57')](__dirname,_0xae32('0xa1'),_0x2d911c[_0xae32('0x95')]),[_0x2d911c['id'],_0x588837[_0xae32('0x83')](),path[_0xae32('0x57')](__dirname,_0xae32('0xa2'),_0x2d911c[_0xae32('0xa3')]),_0x4d96ab]);return _0x2d911c;}else{var _0x49c574=squel[_0xae32('0xa4')]();_0x49c574[_0xae32('0x70')]('('+_0x588837[_0xae32('0x83')]()+')',_0xae32('0xa5'));_0x49c574['field'](_0xae32('0xa6'),_0xae32('0x20'));_0x588837[_0xae32('0x22')](_0x35b5d8['limit']||_0x397e2c);_0x588837[_0xae32('0x21')](_0x35b5d8[_0xae32('0x21')]||0x0);return dbH[_0xae32('0x84')]['query'](_0x49c574[_0xae32('0x83')](),{'type':dbH[_0xae32('0x84')]['QueryTypes']['SELECT']})['then'](function(_0x2b401e){if(!_0x2b401e[_0xae32('0x3c')]){_0x365207=0x0;}else{_0x365207=_0x2b401e[0x0][_0xae32('0x20')]||0x0;}return dbH[_0xae32('0x84')][_0xae32('0x3a')](_0x588837['toString'](),{'type':dbH['sequelize'][_0xae32('0xa7')][_0xae32('0x85')]});})[_0xae32('0x29')](function(_0x4c14c8){return{'rows':_0x4c14c8||[],'count':_0x365207};});}});}exports[_0xae32('0xa8')]=function(_0x1990de,_0x5fec1a){return runReport(_0x1990de['params'],_0x1990de['query'],_0x1990de[_0xae32('0x48')])['then'](respondWithResult(_0x5fec1a,null))[_0xae32('0x55')](handleError(_0x5fec1a,null));};exports[_0xae32('0xa9')]=runReport;exports['query']=function(_0xa8d43b,_0x33daf6){var _0x500363=0xa;var _0x640726=['join','left_join',_0xae32('0x86'),_0xae32('0x59')];var _0x2ffaf6={'SUM':_0xae32('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xae32('0xaa'),'MAX':_0xae32('0x5b'),'MIN':_0xae32('0x5c'),'AVG':_0xae32('0x88'),'GROUP_CONCAT':_0xae32('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xae32('0x5e')};var _0x3febd1={'SEC_TO_TIME':_0xae32('0x5f'),'DATE':'DATE(%s)','HOUR':_0xae32('0x61'),'ROUND':_0xae32('0x62'),'UNIX_TIMESTAMP':_0xae32('0x63')};var _0x523d78=function(_0x56f7e3){return!_['includes']([_0xae32('0x65'),_0xae32('0x66'),_0xae32('0x8a'),_0xae32('0x67')],_0x56f7e3);};var _0xe533f4=function(_0x4697bb){if(!_0x4697bb||!_0x4697bb['rules'][_0xae32('0x3c')]){return'';}for(var _0x309190='(',_0x3a5302=0x0;_0x3a5302<_0x4697bb[_0xae32('0x68')]['length'];_0x3a5302+=0x1){_0x3a5302>0x0&&(_0x309190+='\x20'+_0x4697bb[_0xae32('0x69')]+'\x20');_0x309190+=_0x4697bb[_0xae32('0x68')][_0x3a5302][_0xae32('0x6a')]?_0xe533f4(_0x4697bb[_0xae32('0x68')][_0x3a5302][_0xae32('0x6a')]):_0x4697bb[_0xae32('0x68')][_0x3a5302]['field']+'\x20'+_0x4697bb[_0xae32('0x68')][_0x3a5302][_0xae32('0x6c')]+(_0x523d78(_0x4697bb[_0xae32('0x68')][_0x3a5302][_0xae32('0x6c')])?'\x20'+_0x4697bb[_0xae32('0x68')][_0x3a5302]['value']:'');}return _0x309190+')';};var _0x374f2d={'where':{'id':_0xa8d43b['params']['id']}},_0x36a87d,_0x1e1bda,_0x5c481b,_0x25bcbe,_0x3f0cc5;_0x374f2d=_['merge']({},_0x374f2d,_0xa8d43b[_0xae32('0x48')]);return db[_0xae32('0x33')][_0xae32('0x4d')](_0x374f2d)[_0xae32('0x29')](function(_0x28542b){if(_0x28542b){_0x36a87d=_0x28542b;return _0x28542b[_0xae32('0xab')]();}return null;})[_0xae32('0x29')](function(_0x37bd65){if(_0x37bd65){if(!_0x37bd65['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xae32('0x8d'),0x193);}_0x1e1bda=_0x37bd65;return db[_0xae32('0x6d')][_0xae32('0x6e')]({'raw':!![]});}return null;})['then'](function(_0x1318ea){if(_0x1318ea){_0x5c481b=_[_0xae32('0x6f')](_0x1318ea,'id');var _0x48e25b;var _0x399e75=squel[_0xae32('0xa4')]();_0x399e75['from'](_0x36a87d[_0xae32('0x7f')]);for(var _0x4697e3=0x0;_0x4697e3<_0x1e1bda[_0xae32('0x3c')];_0x4697e3+=0x1){_0x48e25b=_0x1e1bda[_0x4697e3][_0xae32('0x71')]?_0x5c481b[_0x1e1bda[_0x4697e3]['MetricId']][_0xae32('0x72')]:_0x1e1bda[_0x4697e3][_0xae32('0x6b')];_0x48e25b=_0x1e1bda[_0x4697e3][_0xae32('0x73')]?_[_0xae32('0x75')](_0x2ffaf6[_0x1e1bda[_0x4697e3]['function']],'%s',_0x48e25b):_0x48e25b;_0x48e25b=_0x1e1bda[_0x4697e3]['format']?_[_0xae32('0x75')](_0x3febd1[_0x1e1bda[_0x4697e3][_0xae32('0x74')]],'%s',_0x48e25b):_0x48e25b;if(_0x1e1bda[_0x4697e3][_0xae32('0x76')]){_0x399e75[_0xae32('0x6a')](_0x48e25b);}_0x1e1bda[_0x4697e3][_0xae32('0x77')]&&_0x399e75[_0xae32('0x40')](_0x48e25b,_0x1e1bda[_0x4697e3][_0xae32('0x77')]===_0xae32('0x78')?![]:!![]);_0x399e75['field'](_0x48e25b,_0x1e1bda[_0x4697e3][_0xae32('0x8e')]||_0x48e25b);}if(_0x36a87d[_0xae32('0x79')]){_0x36a87d[_0xae32('0x79')]=JSON[_0xae32('0x7a')](_0x36a87d[_0xae32('0x79')]);for(var _0x47c80f=0x0;_0x47c80f<_0x36a87d[_0xae32('0x79')][_0xae32('0x3c')];_0x47c80f+=0x1){if(_0x36a87d['joins'][_0x47c80f][_0xae32('0x47')]&&_['includes'](_0x640726,_0x36a87d['joins'][_0x47c80f][_0xae32('0x47')])&&_0x36a87d[_0xae32('0x79')][_0x47c80f][_0xae32('0x7b')]&&_0x36a87d[_0xae32('0x79')][_0x47c80f][_0xae32('0x7c')]&&_0x36a87d[_0xae32('0x79')][_0x47c80f][_0xae32('0x7d')]){_0x399e75[_0x36a87d[_0xae32('0x79')][_0x47c80f][_0xae32('0x47')]](_0x36a87d['joins'][_0x47c80f][_0xae32('0x7c')],null,util['format'](_0xae32('0x7e'),_0x36a87d[_0xae32('0x7f')],_0x36a87d[_0xae32('0x79')][_0x47c80f][_0xae32('0x7b')],_0x36a87d['joins'][_0x47c80f][_0xae32('0x7c')],_0x36a87d['joins'][_0x47c80f][_0xae32('0x7d')]));}}}if(_0x36a87d[_0xae32('0x80')]){_0x36a87d['conditions']=JSON[_0xae32('0x7a')](_0x36a87d[_0xae32('0x80')]);_0x399e75[_0xae32('0x42')](_0xe533f4(_0x36a87d[_0xae32('0x80')][_0xae32('0x6a')]));}_0x3f0cc5=_0x399e75[_0xae32('0x8f')]();_0x399e75[_0xae32('0x22')](_0x500363);_0x399e75[_0xae32('0x21')](0x0);logger[_0xae32('0x81')](_0xae32('0x82'),_0x399e75['toString']());return dbH['sequelize'][_0xae32('0x3a')](_0x399e75['toString'](),{'type':dbH[_0xae32('0x84')]['QueryTypes'][_0xae32('0x85')]});}})[_0xae32('0x29')](function(){return{'sql':_0x3f0cc5[_0xae32('0x83')]()};})[_0xae32('0x29')](respondWithResult(_0x33daf6,null))['catch'](handleError(_0x33daf6,null));};
\ No newline at end of file
+var _0xb29b=['Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','value','from','web','fullPath','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','output','../../files/reports','COUNT(*)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','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','dbH','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','intersection','find','create','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','left_join','right_join','cross_join','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','foreignTable','conditions','clone','debug'];(function(_0x2a84c7,_0x2b75ff){var _0x3bf1b8=function(_0x530e7e){while(--_0x530e7e){_0x2a84c7['push'](_0x2a84c7['shift']());}};_0x3bf1b8(++_0x2b75ff);}(_0xb29b,0x163));var _0xbb29=function(_0xfa66dd,_0x4607f9){_0xfa66dd=_0xfa66dd-0x0;var _0x39af85=_0xb29b[_0xfa66dd];return _0x39af85;};'use strict';var emlformat=require(_0xbb29('0x0'));var rimraf=require(_0xbb29('0x1'));var zipdir=require(_0xbb29('0x2'));var jsonpatch=require(_0xbb29('0x3'));var rp=require(_0xbb29('0x4'));var moment=require('moment');var BPromise=require(_0xbb29('0x5'));var Mustache=require(_0xbb29('0x6'));var util=require(_0xbb29('0x7'));var path=require('path');var sox=require(_0xbb29('0x8'));var csv=require('to-csv');var ejs=require(_0xbb29('0x9'));var fs=require('fs');var fs_extra=require(_0xbb29('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb29('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbb29('0xc'));var querystring=require(_0xbb29('0xd'));var Papa=require('papaparse');var Redis=require(_0xbb29('0xe'));var authService=require(_0xbb29('0xf'));var qs=require(_0xbb29('0x10'));var as=require(_0xbb29('0x11'));var hardwareService=require(_0xbb29('0x12'));var logger=require(_0xbb29('0x13'))(_0xbb29('0x14'));var utils=require(_0xbb29('0x15'));var config=require(_0xbb29('0x16'));var licenseUtil=require(_0xbb29('0x17'));var db=require(_0xbb29('0x18'))['db'];var dbH=require(_0xbb29('0x18'))[_0xbb29('0x19')];function respondWithStatusCode(_0x1b0baf,_0x40d22f){_0x40d22f=_0x40d22f||0xcc;return function(_0x898dbc){if(_0x898dbc){return _0x1b0baf['sendStatus'](_0x40d22f);}return _0x1b0baf[_0xbb29('0x1a')](_0x40d22f)[_0xbb29('0x1b')]();};}function respondWithResult(_0x535d9e,_0x3947d8){_0x3947d8=_0x3947d8||0xc8;return function(_0x6bc928){if(_0x6bc928){return _0x535d9e['status'](_0x3947d8)[_0xbb29('0x1c')](_0x6bc928);}};}function respondWithFilteredResult(_0x2a8786,_0x211706){return function(_0x3fd6c6){if(_0x3fd6c6){var _0x2cbf5f=typeof _0x211706['offset']===_0xbb29('0x1d')&&typeof _0x211706['limit']===_0xbb29('0x1d');var _0x385c85=_0x3fd6c6[_0xbb29('0x1e')];var _0x2485fb=_0x2cbf5f?0x0:_0x211706[_0xbb29('0x1f')];var _0x5375f3=_0x2cbf5f?_0x3fd6c6[_0xbb29('0x1e')]:_0x211706[_0xbb29('0x1f')]+_0x211706['limit'];var _0x1625e9;if(_0x5375f3>=_0x385c85){_0x5375f3=_0x385c85;_0x1625e9=0xc8;}else{_0x1625e9=0xce;}_0x2a8786[_0xbb29('0x1a')](_0x1625e9);return _0x2a8786[_0xbb29('0x20')](_0xbb29('0x21'),_0x2485fb+'-'+_0x5375f3+'/'+_0x385c85)[_0xbb29('0x1c')](_0x3fd6c6);}return null;};}function patchUpdates(_0x1a2e68){return function(_0x2324e6){try{jsonpatch[_0xbb29('0x22')](_0x2324e6,_0x1a2e68,!![]);}catch(_0x3e284e){return BPromise[_0xbb29('0x23')](_0x3e284e);}return _0x2324e6[_0xbb29('0x24')]();};}function saveUpdates(_0x4784b2,_0x280977){return function(_0x8d372e){if(_0x8d372e){return _0x8d372e[_0xbb29('0x25')](_0x4784b2)[_0xbb29('0x26')](function(_0x10a649){return _0x10a649;});}return null;};}function removeEntity(_0x159de9,_0x39f572){return function(_0x199b81){if(_0x199b81){return _0x199b81[_0xbb29('0x27')]()['then'](function(){var _0x2590a2=_0x199b81[_0xbb29('0x28')]({'plain':!![]});var _0x1c1bff=_0xbb29('0x29');return db[_0xbb29('0x2a')][_0xbb29('0x27')]({'where':{'type':_0x1c1bff,'resourceId':_0x2590a2['id']}})[_0xbb29('0x26')](function(){return _0x199b81;});})[_0xbb29('0x26')](function(){_0x159de9['status'](0xcc)[_0xbb29('0x1b')]();});}};}function handleEntityNotFound(_0x43d169,_0x3f6d7d){return function(_0x26e39a){if(!_0x26e39a){_0x43d169[_0xbb29('0x2b')](0x194);}return _0x26e39a;};}function handleError(_0x41bf6e,_0x135477){_0x135477=_0x135477||0x1f4;return function(_0x258f83){logger['error'](_0x258f83['stack']);if(_0x258f83[_0xbb29('0x2c')]){delete _0x258f83[_0xbb29('0x2c')];}_0x41bf6e[_0xbb29('0x1a')](_0x135477)[_0xbb29('0x2d')](_0x258f83);};}exports[_0xbb29('0x2e')]=function(_0x36cdc5,_0x48e9f0){var _0x169212={},_0x6a0bb5={},_0x517ca7={'count':0x0,'rows':[]};var _0x59ef80=_[_0xbb29('0x2f')](db[_0xbb29('0x30')][_0xbb29('0x31')],function(_0x53419e){return{'name':_0x53419e[_0xbb29('0x32')],'type':_0x53419e[_0xbb29('0x33')][_0xbb29('0x34')]};});_0x6a0bb5[_0xbb29('0x35')]=_['map'](_0x59ef80,_0xbb29('0x2c'));_0x6a0bb5[_0xbb29('0x36')]=_[_0xbb29('0x37')](_0x36cdc5[_0xbb29('0x36')]);_0x6a0bb5[_0xbb29('0x38')]=_['intersection'](_0x6a0bb5[_0xbb29('0x35')],_0x6a0bb5['query']);_0x169212[_0xbb29('0x39')]=_['intersection'](_0x6a0bb5[_0xbb29('0x35')],qs[_0xbb29('0x3a')](_0x36cdc5[_0xbb29('0x36')][_0xbb29('0x3a')]));_0x169212[_0xbb29('0x39')]=_0x169212[_0xbb29('0x39')][_0xbb29('0x3b')]?_0x169212[_0xbb29('0x39')]:_0x6a0bb5['model'];if(!_0x36cdc5['query'][_0xbb29('0x3c')](_0xbb29('0x3d'))){_0x169212[_0xbb29('0x3e')]=qs['limit'](_0x36cdc5[_0xbb29('0x36')][_0xbb29('0x3e')]);_0x169212['offset']=qs[_0xbb29('0x1f')](_0x36cdc5[_0xbb29('0x36')][_0xbb29('0x1f')]);}_0x169212[_0xbb29('0x3f')]=qs['sort'](_0x36cdc5[_0xbb29('0x36')]['sort']);_0x169212[_0xbb29('0x40')]=qs[_0xbb29('0x38')](_['pick'](_0x36cdc5[_0xbb29('0x36')],_0x6a0bb5[_0xbb29('0x38')]),_0x59ef80);if(_0x36cdc5[_0xbb29('0x36')][_0xbb29('0x41')]){_0x169212['where']=_[_0xbb29('0x42')](_0x169212['where'],{'$or':_[_0xbb29('0x2f')](_0x59ef80,function(_0x2ca0d0){if(_0x2ca0d0['type']!==_0xbb29('0x43')){var _0x294c94={};_0x294c94[_0x2ca0d0[_0xbb29('0x2c')]]={'$like':'%'+_0x36cdc5[_0xbb29('0x36')][_0xbb29('0x41')]+'%'};return _0x294c94;}})});}_0x169212=_[_0xbb29('0x42')]({},_0x169212,_0x36cdc5['options']);var _0x4326ed={'where':_0x169212['where']};return db['AnalyticCustomReport'][_0xbb29('0x1e')](_0x4326ed)['then'](function(_0x52419c){_0x517ca7['count']=_0x52419c;if(_0x36cdc5['query'][_0xbb29('0x44')]){_0x169212[_0xbb29('0x45')]=[{'all':!![]}];}return db[_0xbb29('0x30')][_0xbb29('0x46')](_0x169212);})[_0xbb29('0x26')](function(_0x158c4f){_0x517ca7[_0xbb29('0x47')]=_0x158c4f;return _0x517ca7;})[_0xbb29('0x26')](respondWithFilteredResult(_0x48e9f0,_0x169212))[_0xbb29('0x48')](handleError(_0x48e9f0,null));};exports['show']=function(_0x30677c,_0x3bf338){var _0x1db3d3={'raw':![],'where':{'id':_0x30677c[_0xbb29('0x49')]['id']}},_0x5801aa={};_0x5801aa[_0xbb29('0x35')]=_[_0xbb29('0x37')](db['AnalyticCustomReport']['rawAttributes']);_0x5801aa[_0xbb29('0x36')]=_[_0xbb29('0x37')](_0x30677c[_0xbb29('0x36')]);_0x5801aa[_0xbb29('0x38')]=_[_0xbb29('0x4a')](_0x5801aa[_0xbb29('0x35')],_0x5801aa['query']);_0x1db3d3[_0xbb29('0x39')]=_[_0xbb29('0x4a')](_0x5801aa[_0xbb29('0x35')],qs[_0xbb29('0x3a')](_0x30677c[_0xbb29('0x36')][_0xbb29('0x3a')]));_0x1db3d3[_0xbb29('0x39')]=_0x1db3d3[_0xbb29('0x39')]['length']?_0x1db3d3[_0xbb29('0x39')]:_0x5801aa[_0xbb29('0x35')];if(_0x30677c['query'][_0xbb29('0x44')]){_0x1db3d3['include']=[{'all':!![]}];}_0x1db3d3=_[_0xbb29('0x42')]({},_0x1db3d3,_0x30677c['options']);return db[_0xbb29('0x30')][_0xbb29('0x4b')](_0x1db3d3)[_0xbb29('0x26')](handleEntityNotFound(_0x3bf338,null))[_0xbb29('0x26')](respondWithResult(_0x3bf338,null))['catch'](handleError(_0x3bf338,null));};exports[_0xbb29('0x4c')]=function(_0x555ce6,_0xbccb9a){return db[_0xbb29('0x30')][_0xbb29('0x4c')](_0x555ce6['body'],{})[_0xbb29('0x26')](function(_0x33eb39){var _0x3e443e=_0x555ce6[_0xbb29('0x4d')][_0xbb29('0x28')]({'plain':!![]});if(!_0x3e443e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e443e['role']===_0xbb29('0x4d')){var _0x7571ad=_0x33eb39[_0xbb29('0x28')]({'plain':!![]});var _0x5ecdd1='Reports';return db[_0xbb29('0x4e')][_0xbb29('0x4b')]({'where':{'name':_0x5ecdd1,'userProfileId':_0x3e443e[_0xbb29('0x4f')]},'raw':!![]})[_0xbb29('0x26')](function(_0x28254c){if(_0x28254c&&_0x28254c[_0xbb29('0x50')]===0x0){return db[_0xbb29('0x2a')][_0xbb29('0x4c')]({'name':_0x7571ad[_0xbb29('0x2c')],'resourceId':_0x7571ad['id'],'type':_0xbb29('0x29'),'sectionId':_0x28254c['id']},{})[_0xbb29('0x26')](function(){return _0x33eb39;});}else{return _0x33eb39;}})[_0xbb29('0x48')](function(_0x12d60d){logger[_0xbb29('0x51')](_0xbb29('0x52'),_0x12d60d);throw _0x12d60d;});}return _0x33eb39;})[_0xbb29('0x26')](respondWithResult(_0xbccb9a,0xc9))[_0xbb29('0x48')](handleError(_0xbccb9a,null));};exports[_0xbb29('0x25')]=function(_0x3f497b,_0x222e04){if(_0x3f497b[_0xbb29('0x53')]['id']){delete _0x3f497b[_0xbb29('0x53')]['id'];}return db[_0xbb29('0x30')][_0xbb29('0x4b')]({'where':{'id':_0x3f497b[_0xbb29('0x49')]['id']}})[_0xbb29('0x26')](handleEntityNotFound(_0x222e04,null))[_0xbb29('0x26')](saveUpdates(_0x3f497b[_0xbb29('0x53')],null))[_0xbb29('0x26')](respondWithResult(_0x222e04,null))[_0xbb29('0x48')](handleError(_0x222e04,null));};exports[_0xbb29('0x27')]=function(_0x48dd63,_0x41cb64){return db['AnalyticCustomReport']['find']({'where':{'id':_0x48dd63[_0xbb29('0x49')]['id']}})['then'](handleEntityNotFound(_0x41cb64,null))[_0xbb29('0x26')](removeEntity(_0x41cb64,null))[_0xbb29('0x48')](handleError(_0x41cb64,null));};exports['preview']=function(_0x3129d4,_0x2f21b7){var _0x375732=0xa;var _0x3af38b=['join',_0xbb29('0x54'),_0xbb29('0x55'),_0xbb29('0x56')];var _0x19ac79={'SUM':'SUM(%s)','COUNT':_0xbb29('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xbb29('0x58'),'GROUP_CONCAT':_0xbb29('0x59'),'GROUP_CONCAT ASC':_0xbb29('0x5a'),'GROUP_CONCAT DESC':_0xbb29('0x5b')};var _0x19e06b={'SEC_TO_TIME':_0xbb29('0x5c'),'DATE':_0xbb29('0x5d'),'HOUR':_0xbb29('0x5e'),'ROUND':_0xbb29('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3086b4=function(_0x67f85){return!_[_0xbb29('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xbb29('0x61'),_0xbb29('0x62')],_0x67f85);};var _0x3ee0c7=function(_0x47e992){if(!_0x47e992||!_0x47e992[_0xbb29('0x63')]['length']){return'';}for(var _0x29d1cd='(',_0x14bd83=0x0;_0x14bd83<_0x47e992['rules'][_0xbb29('0x3b')];_0x14bd83+=0x1){_0x14bd83>0x0&&(_0x29d1cd+='\x20'+_0x47e992[_0xbb29('0x64')]+'\x20');_0x29d1cd+=_0x47e992[_0xbb29('0x63')][_0x14bd83]['group']?_0x3ee0c7(_0x47e992[_0xbb29('0x63')][_0x14bd83][_0xbb29('0x65')]):_0x47e992[_0xbb29('0x63')][_0x14bd83]['field']+'\x20'+_0x47e992[_0xbb29('0x63')][_0x14bd83][_0xbb29('0x66')]+(_0x3086b4(_0x47e992['rules'][_0x14bd83][_0xbb29('0x66')])?'\x20'+_0x47e992['rules'][_0x14bd83]['value']:'');}return _0x29d1cd+')';};var _0x5d0a29={'where':{'id':_0x3129d4['params']['id']}},_0x291d42,_0x38ac13,_0x25f21f,_0x800ac6,_0x3ccad6;_0x5d0a29=_[_0xbb29('0x42')]({},_0x5d0a29,_0x3129d4[_0xbb29('0x67')]);return db[_0xbb29('0x30')][_0xbb29('0x4b')](_0x5d0a29)[_0xbb29('0x26')](function(_0x352b21){if(_0x352b21){_0x291d42=_0x352b21;return _0x352b21[_0xbb29('0x68')]();}return null;})[_0xbb29('0x26')](function(_0x5885c3){if(_0x5885c3){if(!_0x5885c3[_0xbb29('0x3b')]){throw new db[(_0xbb29('0x69'))][(_0xbb29('0x6a'))](_0xbb29('0x6b'),0x193);}_0x38ac13=_0x5885c3;return db[_0xbb29('0x6c')][_0xbb29('0x46')]({'raw':!![]});}return null;})[_0xbb29('0x26')](function(_0x1b8317){if(_0x1b8317){_0x25f21f=_[_0xbb29('0x6d')](_0x1b8317,'id');var _0x22abcd;var _0xa7a183=squel[_0xbb29('0x6e')]();_0xa7a183['from'](_0x291d42[_0xbb29('0x6f')]);for(var _0x4b5e41=0x0;_0x4b5e41<_0x38ac13[_0xbb29('0x3b')];_0x4b5e41+=0x1){_0x22abcd=_0x38ac13[_0x4b5e41]['MetricId']?_0x25f21f[_0x38ac13[_0x4b5e41][_0xbb29('0x70')]][_0xbb29('0x71')]:_0x38ac13[_0x4b5e41][_0xbb29('0x72')];_0x22abcd=_0x38ac13[_0x4b5e41][_0xbb29('0x73')]?_[_0xbb29('0x74')](_0x19ac79[_0x38ac13[_0x4b5e41][_0xbb29('0x73')]],'%s',_0x22abcd):_0x22abcd;_0x22abcd=_0x38ac13[_0x4b5e41][_0xbb29('0x75')]?_[_0xbb29('0x74')](_0x19e06b[_0x38ac13[_0x4b5e41][_0xbb29('0x75')]],'%s',_0x22abcd):_0x22abcd;if(_0x38ac13[_0x4b5e41][_0xbb29('0x76')]){_0xa7a183[_0xbb29('0x65')](_0x22abcd);}_0x38ac13[_0x4b5e41][_0xbb29('0x77')]&&_0xa7a183[_0xbb29('0x3f')](_0x22abcd,_0x38ac13[_0x4b5e41]['orderBy']===_0xbb29('0x78')?![]:!![]);_0xa7a183[_0xbb29('0x72')](_0x22abcd,_0x38ac13[_0x4b5e41][_0xbb29('0x79')]||_0x22abcd);}if(_0x291d42[_0xbb29('0x7a')]){_0x291d42['joins']=JSON[_0xbb29('0x7b')](_0x291d42['joins']);for(var _0x1db164=0x0;_0x1db164<_0x291d42[_0xbb29('0x7a')][_0xbb29('0x3b')];_0x1db164+=0x1){if(_0x291d42[_0xbb29('0x7a')][_0x1db164][_0xbb29('0x33')]&&_[_0xbb29('0x60')](_0x3af38b,_0x291d42[_0xbb29('0x7a')][_0x1db164]['type'])&&_0x291d42[_0xbb29('0x7a')][_0x1db164]['parentKey']&&_0x291d42[_0xbb29('0x7a')][_0x1db164]['foreignTable']&&_0x291d42['joins'][_0x1db164][_0xbb29('0x7c')]){_0xa7a183[_0x291d42[_0xbb29('0x7a')][_0x1db164][_0xbb29('0x33')]](_0x291d42[_0xbb29('0x7a')][_0x1db164]['foreignTable'],null,util[_0xbb29('0x75')](_0xbb29('0x7d'),_0x291d42[_0xbb29('0x6f')],_0x291d42[_0xbb29('0x7a')][_0x1db164][_0xbb29('0x7e')],_0x291d42[_0xbb29('0x7a')][_0x1db164][_0xbb29('0x7f')],_0x291d42[_0xbb29('0x7a')][_0x1db164][_0xbb29('0x7c')]));}}}if(_0x291d42[_0xbb29('0x80')]){_0x291d42[_0xbb29('0x80')]=JSON[_0xbb29('0x7b')](_0x291d42[_0xbb29('0x80')]);_0xa7a183[_0xbb29('0x40')](_0x3ee0c7(_0x291d42[_0xbb29('0x80')]['group']));}_0x3ccad6=_0xa7a183[_0xbb29('0x81')]();_0xa7a183[_0xbb29('0x3e')](_0x375732);_0xa7a183[_0xbb29('0x1f')](0x0);logger[_0xbb29('0x82')](_0xbb29('0x83'),_0xa7a183[_0xbb29('0x84')]());return dbH[_0xbb29('0x85')][_0xbb29('0x36')](_0xa7a183[_0xbb29('0x84')](),{'type':dbH[_0xbb29('0x85')][_0xbb29('0x86')][_0xbb29('0x87')]});}})['then'](respondWithResult(_0x2f21b7,null))[_0xbb29('0x48')](handleError(_0x2f21b7,null));};function runReport(_0x211a50,_0x17d1a0,_0xb2e654){var _0x12f3f1=_0x17d1a0['name'];var _0x4c8272=0xa;var _0x3a9063=[_0xbb29('0x88'),_0xbb29('0x54'),_0xbb29('0x55'),'cross_join'];var _0x28eab4={'SUM':_0xbb29('0x89'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbb29('0x8a'),'MAX':_0xbb29('0x8b'),'MIN':_0xbb29('0x8c'),'AVG':_0xbb29('0x58'),'GROUP_CONCAT':_0xbb29('0x59'),'GROUP_CONCAT ASC':_0xbb29('0x5a'),'GROUP_CONCAT DESC':_0xbb29('0x5b')};var _0x566deb={'SEC_TO_TIME':_0xbb29('0x5c'),'DATE':_0xbb29('0x5d'),'HOUR':_0xbb29('0x5e'),'ROUND':_0xbb29('0x5f'),'UNIX_TIMESTAMP':_0xbb29('0x8d')};var _0x26ec63=function(_0x10aaeb){return!_[_0xbb29('0x60')]([_0xbb29('0x8e'),'IS\x20NOT\x20NULL',_0xbb29('0x61'),_0xbb29('0x62')],_0x10aaeb);};var _0x46346e=function(_0x4af82a){if(!_0x4af82a||!_0x4af82a['rules']['length']){return'';}for(var _0x1abfa5='(',_0xeb717d=0x0;_0xeb717d<_0x4af82a[_0xbb29('0x63')][_0xbb29('0x3b')];_0xeb717d+=0x1){_0xeb717d>0x0&&(_0x1abfa5+='\x20'+_0x4af82a[_0xbb29('0x64')]+'\x20');_0x1abfa5+=_0x4af82a[_0xbb29('0x63')][_0xeb717d][_0xbb29('0x65')]?_0x46346e(_0x4af82a[_0xbb29('0x63')][_0xeb717d][_0xbb29('0x65')]):_0x4af82a[_0xbb29('0x63')][_0xeb717d]['field']+'\x20'+_0x4af82a[_0xbb29('0x63')][_0xeb717d][_0xbb29('0x66')]+(_0x26ec63(_0x4af82a['rules'][_0xeb717d][_0xbb29('0x66')])?'\x20'+_0x4af82a[_0xbb29('0x63')][_0xeb717d][_0xbb29('0x8f')]:'');}return _0x1abfa5+')';};var _0x1e4fad={'where':{'id':_0x211a50['id']}},_0x388f6d,_0xa75fe4,_0x15475b,_0x4aee5d,_0x4b8361;_0x1e4fad=_['merge']({},_0x1e4fad,_0xb2e654);return db[_0xbb29('0x30')][_0xbb29('0x4b')](_0x1e4fad)[_0xbb29('0x26')](function(_0x1f8293){if(_0x1f8293){_0x388f6d=_0x1f8293;return _0x1f8293[_0xbb29('0x68')]();}return null;})[_0xbb29('0x26')](function(_0x15772f){if(_0x15772f){if(!_0x15772f[_0xbb29('0x3b')]){throw new db[(_0xbb29('0x69'))][(_0xbb29('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xa75fe4=_0x15772f;return db[_0xbb29('0x6c')][_0xbb29('0x46')]({'raw':!![]});}return null;})[_0xbb29('0x26')](function(_0x23b797){if(_0x23b797){_0x15475b=_[_0xbb29('0x6d')](_0x23b797,'id');var _0x287ce6;var _0x34d4ab=squel[_0xbb29('0x6e')]();_0x34d4ab[_0xbb29('0x90')](_0x388f6d[_0xbb29('0x6f')]);for(var _0x483dd9=0x0;_0x483dd9<_0xa75fe4[_0xbb29('0x3b')];_0x483dd9+=0x1){_0x287ce6=_0xa75fe4[_0x483dd9][_0xbb29('0x70')]?_0x15475b[_0xa75fe4[_0x483dd9][_0xbb29('0x70')]][_0xbb29('0x71')]:_0xa75fe4[_0x483dd9][_0xbb29('0x72')];_0x287ce6=_0xa75fe4[_0x483dd9][_0xbb29('0x73')]?_[_0xbb29('0x74')](_0x28eab4[_0xa75fe4[_0x483dd9][_0xbb29('0x73')]],'%s',_0x287ce6):_0x287ce6;_0x287ce6=_0xa75fe4[_0x483dd9][_0xbb29('0x75')]?_['replace'](_0x566deb[_0xa75fe4[_0x483dd9][_0xbb29('0x75')]],'%s',_0x287ce6):_0x287ce6;if(_0xa75fe4[_0x483dd9]['groupBy']){_0x34d4ab['group'](_0x287ce6);}_0xa75fe4[_0x483dd9][_0xbb29('0x77')]&&_0x34d4ab[_0xbb29('0x3f')](_0x287ce6,_0xa75fe4[_0x483dd9]['orderBy']==='DESC'?![]:!![]);_0x34d4ab[_0xbb29('0x72')](_0x287ce6,_0xa75fe4[_0x483dd9][_0xbb29('0x79')]||_0x287ce6);}if(_0x388f6d[_0xbb29('0x7a')]){_0x388f6d['joins']=JSON[_0xbb29('0x7b')](_0x388f6d[_0xbb29('0x7a')]);for(var _0x5b218e=0x0;_0x5b218e<_0x388f6d[_0xbb29('0x7a')]['length'];_0x5b218e+=0x1){if(_0x388f6d[_0xbb29('0x7a')][_0x5b218e][_0xbb29('0x33')]&&_['includes'](_0x3a9063,_0x388f6d['joins'][_0x5b218e][_0xbb29('0x33')])&&_0x388f6d[_0xbb29('0x7a')][_0x5b218e][_0xbb29('0x7e')]&&_0x388f6d[_0xbb29('0x7a')][_0x5b218e]['foreignTable']&&_0x388f6d[_0xbb29('0x7a')][_0x5b218e][_0xbb29('0x7c')]){_0x34d4ab[_0x388f6d['joins'][_0x5b218e][_0xbb29('0x33')]](_0x388f6d[_0xbb29('0x7a')][_0x5b218e]['foreignTable'],null,util[_0xbb29('0x75')]('%s.%s\x20=\x20%s.%s',_0x388f6d['table'],_0x388f6d['joins'][_0x5b218e][_0xbb29('0x7e')],_0x388f6d['joins'][_0x5b218e][_0xbb29('0x7f')],_0x388f6d[_0xbb29('0x7a')][_0x5b218e]['foreignKey']));}}}if(_0x388f6d[_0xbb29('0x80')]){_0x388f6d[_0xbb29('0x80')]=JSON[_0xbb29('0x7b')](_0x388f6d[_0xbb29('0x80')]);_0x34d4ab[_0xbb29('0x40')](_0x46346e(_0x388f6d['conditions']['group']));}_0x4b8361=_0x34d4ab['clone']();_0x34d4ab[_0xbb29('0x3e')](_0x4c8272);_0x34d4ab[_0xbb29('0x1f')](0x0);return;}})['then'](function(){if(_0x17d1a0['output']===_0xbb29('0x91')){return null;}var _0x515fc1=_[_0xbb29('0x42')](_0x17d1a0,{'name':_0x17d1a0[_0xbb29('0x92')]||_0x17d1a0[_0xbb29('0x2c')]||_0x388f6d['name'],'basename':_0x12f3f1,'savename':util[_0xbb29('0x75')](_0xbb29('0x93'),_0x17d1a0['name']||_0x388f6d[_0xbb29('0x2c')],require('randomstring')[_0xbb29('0x94')](0x4),_0x17d1a0['output']||_0xbb29('0x95')),'reportId':_0x388f6d['id'],'reportType':'custom'});return db[_0xbb29('0x96')][_0xbb29('0x4c')](_0x515fc1,{'raw':!![]});})[_0xbb29('0x26')](function(_0x503399){if(_0x388f6d[_0xbb29('0x6f')]===_0xbb29('0x97')){_0x4b8361[_0xbb29('0x40')](_0x388f6d[_0xbb29('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x17d1a0[_0xbb29('0x98')],_0x17d1a0[_0xbb29('0x99')]);}else{_0x4b8361[_0xbb29('0x40')](_0x388f6d['table']+_0xbb29('0x9a'),_0x17d1a0[_0xbb29('0x98')],_0x17d1a0[_0xbb29('0x99')]);}if(_0x503399){logger['info'](_0xbb29('0x9b'),_0x4b8361['toString']());require(_0xbb29('0x9c'))[_0xbb29('0x9d')](path[_0xbb29('0x88')](__dirname,_0xbb29('0x9e'),_0x503399[_0xbb29('0x9f')]),[_0x503399['id'],_0x4b8361[_0xbb29('0x84')](),path[_0xbb29('0x88')](__dirname,_0xbb29('0xa0'),_0x503399['savename']),_0x12f3f1]);return _0x503399;}else{var _0xe1a558=squel[_0xbb29('0x6e')]();_0xe1a558[_0xbb29('0x90')]('('+_0x4b8361[_0xbb29('0x84')]()+')','countTable');_0xe1a558['field'](_0xbb29('0xa1'),_0xbb29('0x1e'));_0x4b8361[_0xbb29('0x3e')](_0x17d1a0['limit']||_0x4c8272);_0x4b8361[_0xbb29('0x1f')](_0x17d1a0['offset']||0x0);return dbH['sequelize'][_0xbb29('0x36')](_0xe1a558['toString'](),{'type':dbH[_0xbb29('0x85')][_0xbb29('0x86')][_0xbb29('0x87')]})[_0xbb29('0x26')](function(_0x4f0e59){if(!_0x4f0e59[_0xbb29('0x3b')]){_0x4aee5d=0x0;}else{_0x4aee5d=_0x4f0e59[0x0][_0xbb29('0x1e')]||0x0;}return dbH[_0xbb29('0x85')][_0xbb29('0x36')](_0x4b8361[_0xbb29('0x84')](),{'type':dbH[_0xbb29('0x85')][_0xbb29('0x86')][_0xbb29('0x87')]});})[_0xbb29('0x26')](function(_0x3cbfed){return{'rows':_0x3cbfed||[],'count':_0x4aee5d};});}});}exports['run']=function(_0x22fb45,_0x1eb4eb){return runReport(_0x22fb45['params'],_0x22fb45[_0xbb29('0x36')],_0x22fb45[_0xbb29('0x67')])[_0xbb29('0x26')](respondWithResult(_0x1eb4eb,null))[_0xbb29('0x48')](handleError(_0x1eb4eb,null));};exports['runReport']=runReport;exports['query']=function(_0x5ac3da,_0x6e30b8){var _0x54558d=0xa;var _0x1adf7c=[_0xbb29('0x88'),_0xbb29('0x54'),_0xbb29('0x55'),_0xbb29('0x56')];var _0xc7ece7={'SUM':_0xbb29('0x89'),'COUNT':_0xbb29('0x57'),'COUNT DISTINCT':_0xbb29('0x8a'),'MAX':_0xbb29('0x8b'),'MIN':'MIN(%s)','AVG':_0xbb29('0x58'),'GROUP_CONCAT':_0xbb29('0x59'),'GROUP_CONCAT ASC':_0xbb29('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4a7cc8={'SEC_TO_TIME':_0xbb29('0x5c'),'DATE':'DATE(%s)','HOUR':_0xbb29('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xbb29('0x8d')};var _0x32e797=function(_0x3390f1){return!_[_0xbb29('0x60')]([_0xbb29('0x8e'),'IS\x20NOT\x20NULL',_0xbb29('0x61'),_0xbb29('0x62')],_0x3390f1);};var _0x586d6f=function(_0xbb4569){if(!_0xbb4569||!_0xbb4569['rules'][_0xbb29('0x3b')]){return'';}for(var _0x643998='(',_0x11959a=0x0;_0x11959a<_0xbb4569[_0xbb29('0x63')][_0xbb29('0x3b')];_0x11959a+=0x1){_0x11959a>0x0&&(_0x643998+='\x20'+_0xbb4569['operator']+'\x20');_0x643998+=_0xbb4569[_0xbb29('0x63')][_0x11959a][_0xbb29('0x65')]?_0x586d6f(_0xbb4569['rules'][_0x11959a]['group']):_0xbb4569[_0xbb29('0x63')][_0x11959a][_0xbb29('0x72')]+'\x20'+_0xbb4569[_0xbb29('0x63')][_0x11959a][_0xbb29('0x66')]+(_0x32e797(_0xbb4569['rules'][_0x11959a]['condition'])?'\x20'+_0xbb4569[_0xbb29('0x63')][_0x11959a][_0xbb29('0x8f')]:'');}return _0x643998+')';};var _0x236720={'where':{'id':_0x5ac3da[_0xbb29('0x49')]['id']}},_0x328de4,_0xd5d17c,_0x367772,_0x3a0171,_0x242c19;_0x236720=_['merge']({},_0x236720,_0x5ac3da['options']);return db['AnalyticCustomReport'][_0xbb29('0x4b')](_0x236720)[_0xbb29('0x26')](function(_0x4166d4){if(_0x4166d4){_0x328de4=_0x4166d4;return _0x4166d4[_0xbb29('0x68')]();}return null;})[_0xbb29('0x26')](function(_0x47281a){if(_0x47281a){if(!_0x47281a[_0xbb29('0x3b')]){throw new db['Sequelize']['ValidationErrorItem'](_0xbb29('0x6b'),0x193);}_0xd5d17c=_0x47281a;return db[_0xbb29('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xbb29('0x26')](function(_0x638aa1){if(_0x638aa1){_0x367772=_['keyBy'](_0x638aa1,'id');var _0x43355d;var _0x89a56c=squel['select']();_0x89a56c[_0xbb29('0x90')](_0x328de4[_0xbb29('0x6f')]);for(var _0x205113=0x0;_0x205113<_0xd5d17c[_0xbb29('0x3b')];_0x205113+=0x1){_0x43355d=_0xd5d17c[_0x205113][_0xbb29('0x70')]?_0x367772[_0xd5d17c[_0x205113][_0xbb29('0x70')]][_0xbb29('0x71')]:_0xd5d17c[_0x205113]['field'];_0x43355d=_0xd5d17c[_0x205113][_0xbb29('0x73')]?_[_0xbb29('0x74')](_0xc7ece7[_0xd5d17c[_0x205113]['function']],'%s',_0x43355d):_0x43355d;_0x43355d=_0xd5d17c[_0x205113][_0xbb29('0x75')]?_['replace'](_0x4a7cc8[_0xd5d17c[_0x205113][_0xbb29('0x75')]],'%s',_0x43355d):_0x43355d;if(_0xd5d17c[_0x205113][_0xbb29('0x76')]){_0x89a56c[_0xbb29('0x65')](_0x43355d);}_0xd5d17c[_0x205113][_0xbb29('0x77')]&&_0x89a56c[_0xbb29('0x3f')](_0x43355d,_0xd5d17c[_0x205113][_0xbb29('0x77')]===_0xbb29('0x78')?![]:!![]);_0x89a56c['field'](_0x43355d,_0xd5d17c[_0x205113][_0xbb29('0x79')]||_0x43355d);}if(_0x328de4[_0xbb29('0x7a')]){_0x328de4[_0xbb29('0x7a')]=JSON[_0xbb29('0x7b')](_0x328de4['joins']);for(var _0x597044=0x0;_0x597044<_0x328de4[_0xbb29('0x7a')][_0xbb29('0x3b')];_0x597044+=0x1){if(_0x328de4[_0xbb29('0x7a')][_0x597044][_0xbb29('0x33')]&&_['includes'](_0x1adf7c,_0x328de4['joins'][_0x597044][_0xbb29('0x33')])&&_0x328de4[_0xbb29('0x7a')][_0x597044][_0xbb29('0x7e')]&&_0x328de4['joins'][_0x597044][_0xbb29('0x7f')]&&_0x328de4[_0xbb29('0x7a')][_0x597044][_0xbb29('0x7c')]){_0x89a56c[_0x328de4[_0xbb29('0x7a')][_0x597044][_0xbb29('0x33')]](_0x328de4[_0xbb29('0x7a')][_0x597044][_0xbb29('0x7f')],null,util[_0xbb29('0x75')](_0xbb29('0x7d'),_0x328de4[_0xbb29('0x6f')],_0x328de4[_0xbb29('0x7a')][_0x597044][_0xbb29('0x7e')],_0x328de4[_0xbb29('0x7a')][_0x597044][_0xbb29('0x7f')],_0x328de4[_0xbb29('0x7a')][_0x597044][_0xbb29('0x7c')]));}}}if(_0x328de4[_0xbb29('0x80')]){_0x328de4[_0xbb29('0x80')]=JSON[_0xbb29('0x7b')](_0x328de4[_0xbb29('0x80')]);_0x89a56c[_0xbb29('0x40')](_0x586d6f(_0x328de4[_0xbb29('0x80')]['group']));}_0x242c19=_0x89a56c[_0xbb29('0x81')]();_0x89a56c[_0xbb29('0x3e')](_0x54558d);_0x89a56c[_0xbb29('0x1f')](0x0);logger['debug'](_0xbb29('0x83'),_0x89a56c[_0xbb29('0x84')]());return dbH[_0xbb29('0x85')][_0xbb29('0x36')](_0x89a56c['toString'](),{'type':dbH[_0xbb29('0x85')][_0xbb29('0x86')][_0xbb29('0x87')]});}})[_0xbb29('0x26')](function(){return{'sql':_0x242c19['toString']()};})['then'](respondWithResult(_0x6e30b8,null))[_0xbb29('0x48')](handleError(_0x6e30b8,null));};
\ No newline at end of file
index 18e9b8d..34b6a11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9d7=['AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x1a7b67,_0x322d58){var _0xa8265a=function(_0x3933e3){while(--_0x3933e3){_0x1a7b67['push'](_0x1a7b67['shift']());}};_0xa8265a(++_0x322d58);}(_0xe9d7,0x1ee));var _0x7e9d=function(_0x19b351,_0x547358){_0x19b351=_0x19b351-0x0;var _0x104803=_0xe9d7[_0x19b351];return _0x104803;};'use strict';var _=require('lodash');var util=require(_0x7e9d('0x0'));var logger=require(_0x7e9d('0x1'))('api');var moment=require(_0x7e9d('0x2'));var BPromise=require('bluebird');var rp=require(_0x7e9d('0x3'));var fs=require('fs');var path=require(_0x7e9d('0x4'));var rimraf=require(_0x7e9d('0x5'));var config=require(_0x7e9d('0x6'));var attributes=require(_0x7e9d('0x7'));module[_0x7e9d('0x8')]=function(_0x683ebf,_0x5b9bb7){return _0x683ebf[_0x7e9d('0x9')](_0x7e9d('0xa'),attributes,{'tableName':_0x7e9d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0e8=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./analyticCustomReport.attributes','exports','AnalyticCustomReport'];(function(_0x30f2b,_0x3f3d20){var _0x2374c1=function(_0xb0e8de){while(--_0xb0e8de){_0x30f2b['push'](_0x30f2b['shift']());}};_0x2374c1(++_0x3f3d20);}(_0xa0e8,0x1e4));var _0x8a0e=function(_0x4851ba,_0x10a4a4){_0x4851ba=_0x4851ba-0x0;var _0x5adec9=_0xa0e8[_0x4851ba];return _0x5adec9;};'use strict';var _=require(_0x8a0e('0x0'));var util=require(_0x8a0e('0x1'));var logger=require(_0x8a0e('0x2'))(_0x8a0e('0x3'));var moment=require(_0x8a0e('0x4'));var BPromise=require(_0x8a0e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a0e('0x6'));var rimraf=require(_0x8a0e('0x7'));var config=require('../../config/environment');var attributes=require(_0x8a0e('0x8'));module[_0x8a0e('0x9')]=function(_0x416d1c,_0x1e76fc){return _0x416d1c['define'](_0x8a0e('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2a44db4..9db687c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb49=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','AnalyticCustomReport,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','catch','moment'];(function(_0x16ed87,_0x1be1a2){var _0xc1a1d8=function(_0x3c0fcf){while(--_0x3c0fcf){_0x16ed87['push'](_0x16ed87['shift']());}};_0xc1a1d8(++_0x1be1a2);}(_0xfb49,0x18b));var _0x9fb4=function(_0x3439ea,_0x3c68ba){_0x3439ea=_0x3439ea-0x0;var _0x3900a3=_0xfb49[_0x3439ea];return _0x3900a3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9fb4('0x0'));var BPromise=require('bluebird');var rs=require(_0x9fb4('0x1'));var fs=require('fs');var Redis=require(_0x9fb4('0x2'));var db=require(_0x9fb4('0x3'))['db'];var utils=require(_0x9fb4('0x4'));var logger=require(_0x9fb4('0x5'))(_0x9fb4('0x6'));var config=require(_0x9fb4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9fb4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39466f,_0x2e4f26,_0x13fe26){return new BPromise(function(_0x29fa79,_0x24d4a9){return client[_0x9fb4('0x9')](_0x39466f,_0x13fe26)['then'](function(_0x5801cf){logger['info'](_0x9fb4('0xa'),_0x2e4f26,'request\x20sent');logger[_0x9fb4('0xb')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2e4f26,'request\x20sent',JSON[_0x9fb4('0xc')](_0x5801cf));if(_0x5801cf[_0x9fb4('0xd')]){if(_0x5801cf['error']['code']===0x1f4){logger[_0x9fb4('0xd')](_0x9fb4('0xa'),_0x2e4f26,_0x5801cf[_0x9fb4('0xd')][_0x9fb4('0xe')]);return _0x24d4a9(_0x5801cf['error'][_0x9fb4('0xe')]);}logger[_0x9fb4('0xd')](_0x9fb4('0xa'),_0x2e4f26,_0x5801cf[_0x9fb4('0xd')][_0x9fb4('0xe')]);return _0x29fa79(_0x5801cf[_0x9fb4('0xd')][_0x9fb4('0xe')]);}else{logger[_0x9fb4('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2e4f26,_0x9fb4('0x10'));_0x29fa79(_0x5801cf['result'][_0x9fb4('0xe')]);}})[_0x9fb4('0x11')](function(_0x55da76){logger[_0x9fb4('0xd')](_0x9fb4('0xa'),_0x2e4f26,_0x55da76);_0x24d4a9(_0x55da76);});});}
\ No newline at end of file
+var _0x8e3f=['client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0x8e3f,0x1a6));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xf8e3('0x0'));var moment=require(_0xf8e3('0x1'));var BPromise=require(_0xf8e3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8e3('0x3'));var db=require(_0xf8e3('0x4'))['db'];var utils=require(_0xf8e3('0x5'));var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require(_0xf8e3('0x8'));var jayson=require(_0xf8e3('0x9'));var client=jayson[_0xf8e3('0xa')][_0xf8e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b095e,_0x7a2989,_0x3b0526){return new BPromise(function(_0x4d4907,_0x2ec17b){return client[_0xf8e3('0xc')](_0x5b095e,_0x3b0526)[_0xf8e3('0xd')](function(_0x261801){logger[_0xf8e3('0xe')](_0xf8e3('0xf'),_0x7a2989,_0xf8e3('0x10'));logger[_0xf8e3('0x11')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x7a2989,_0xf8e3('0x10'),JSON[_0xf8e3('0x12')](_0x261801));if(_0x261801[_0xf8e3('0x13')]){if(_0x261801[_0xf8e3('0x13')][_0xf8e3('0x14')]===0x1f4){logger[_0xf8e3('0x13')](_0xf8e3('0xf'),_0x7a2989,_0x261801[_0xf8e3('0x13')][_0xf8e3('0x15')]);return _0x2ec17b(_0x261801[_0xf8e3('0x13')]['message']);}logger['error'](_0xf8e3('0xf'),_0x7a2989,_0x261801[_0xf8e3('0x13')][_0xf8e3('0x15')]);return _0x4d4907(_0x261801[_0xf8e3('0x13')]['message']);}else{logger[_0xf8e3('0xe')](_0xf8e3('0xf'),_0x7a2989,_0xf8e3('0x10'));_0x4d4907(_0x261801[_0xf8e3('0x16')][_0xf8e3('0x15')]);}})[_0xf8e3('0x17')](function(_0x1112be){logger['error'](_0xf8e3('0xf'),_0x7a2989,_0x1112be);_0x2ec17b(_0x1112be);});});}
\ No newline at end of file
index d6280c6..99dc584 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd39b=['/:id/preview','/:id/run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd39b,0x68));var _0xbd39=function(_0xb87266,_0x47586c){_0xb87266=_0xb87266-0x0;var _0x151fde=_0xd39b[_0xb87266];return _0x151fde;};'use strict';var multer=require(_0xbd39('0x0'));var util=require(_0xbd39('0x1'));var path=require(_0xbd39('0x2'));var timeout=require(_0xbd39('0x3'));var express=require(_0xbd39('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd39('0x5'));var interaction=require(_0xbd39('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xbd39('0x7')]('/',auth[_0xbd39('0x8')](),controller[_0xbd39('0x9')]);router['get']('/:id',auth[_0xbd39('0x8')](),controller[_0xbd39('0xa')]);router[_0xbd39('0x7')](_0xbd39('0xb'),auth[_0xbd39('0x8')](),controller['preview']);router[_0xbd39('0x7')](_0xbd39('0xc'),auth[_0xbd39('0x8')](),controller['run']);router['get'](_0xbd39('0xd'),auth[_0xbd39('0x8')](),controller[_0xbd39('0xe')]);router[_0xbd39('0xf')]('/',auth[_0xbd39('0x8')](),controller[_0xbd39('0x10')]);router[_0xbd39('0x11')](_0xbd39('0x12'),auth['isAuthenticated'](),controller[_0xbd39('0x13')]);router[_0xbd39('0x14')]('/:id',auth[_0xbd39('0x8')](),controller[_0xbd39('0x15')]);module[_0xbd39('0x16')]=router;
\ No newline at end of file
+var _0x0cff=['/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated'];(function(_0x4fa634,_0x2dbc39){var _0x4dd36b=function(_0x4daf59){while(--_0x4daf59){_0x4fa634['push'](_0x4fa634['shift']());}};_0x4dd36b(++_0x2dbc39);}(_0x0cff,0x68));var _0xf0cf=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x0cff[_0x5d7227];return _0x15ac55;};'use strict';var multer=require(_0xf0cf('0x0'));var util=require(_0xf0cf('0x1'));var path=require('path');var timeout=require(_0xf0cf('0x2'));var express=require(_0xf0cf('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf0cf('0x4'));var interaction=require(_0xf0cf('0x5'));var config=require(_0xf0cf('0x6'));var controller=require(_0xf0cf('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf0cf('0x8')](_0xf0cf('0x9'),auth[_0xf0cf('0xa')](),controller['show']);router[_0xf0cf('0x8')](_0xf0cf('0xb'),auth[_0xf0cf('0xa')](),controller[_0xf0cf('0xc')]);router['get'](_0xf0cf('0xd'),auth[_0xf0cf('0xa')](),controller[_0xf0cf('0xe')]);router[_0xf0cf('0x8')](_0xf0cf('0xf'),auth[_0xf0cf('0xa')](),controller[_0xf0cf('0x10')]);router[_0xf0cf('0x11')]('/',auth[_0xf0cf('0xa')](),controller[_0xf0cf('0x12')]);router[_0xf0cf('0x13')](_0xf0cf('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xf0cf('0x14')](_0xf0cf('0x9'),auth[_0xf0cf('0xa')](),controller[_0xf0cf('0x15')]);module[_0xf0cf('0x16')]=router;
\ No newline at end of file
index 67c9f06..8898fc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xdc97,0x13b));var _0x7dc9=function(_0x59e02f,_0x1005ce){_0x59e02f=_0x59e02f-0x0;var _0x870647=_0xdc97[_0x59e02f];return _0x870647;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
+var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x4f2dd6,_0x4d3d03){var _0x236e70=function(_0x2dd2be){while(--_0x2dd2be){_0x4f2dd6['push'](_0x4f2dd6['shift']());}};_0x236e70(++_0x4d3d03);}(_0xac9d,0x14d));var _0xdac9=function(_0x2586ad,_0x3a2816){_0x2586ad=_0x2586ad-0x0;var _0x4128db=_0xac9d[_0x2586ad];return _0x4128db;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
index 07a3057..a88c9aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x3c24e7,_0x2031f6){var _0x41cbe9=function(_0x2122bd){while(--_0x2122bd){_0x3c24e7['push'](_0x3c24e7['shift']());}};_0x41cbe9(++_0x2031f6);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
+var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x1168a3,_0x392f5d){var _0x58c701=function(_0x2ee889){while(--_0x2ee889){_0x1168a3['push'](_0x1168a3['shift']());}};_0x58c701(++_0x392f5d);}(_0xf494,0x1c6));var _0x4f49=function(_0x3d6f1e,_0x315443){_0x3d6f1e=_0x3d6f1e-0x0;var _0x4b6140=_0xf494[_0x3d6f1e];return _0x4b6140;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
index f3357f0..cbf8925 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dae=['../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x5dae,0x1da));var _0xe5da=function(_0xd86d32,_0x52f715){_0xd86d32=_0xd86d32-0x0;var _0x26bb4e=_0x5dae[_0xd86d32];return _0x26bb4e;};'use strict';var _=require(_0xe5da('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe5da('0x1'));var moment=require(_0xe5da('0x2'));var BPromise=require(_0xe5da('0x3'));var rp=require(_0xe5da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5da('0x5'));var config=require(_0xe5da('0x6'));var attributes=require(_0xe5da('0x7'));module[_0xe5da('0x8')]=function(_0x184d37,_0x2ed77a){return _0x184d37[_0xe5da('0x9')](_0xe5da('0xa'),attributes,{'tableName':_0xe5da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff98=['analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x3e1e2c,_0x1db07d){var _0x16344c=function(_0x34ccf7){while(--_0x34ccf7){_0x3e1e2c['push'](_0x3e1e2c['shift']());}};_0x16344c(++_0x1db07d);}(_0xff98,0xb5));var _0x8ff9=function(_0x40e1b6,_0x45d5cb){_0x40e1b6=_0x40e1b6-0x0;var _0x382f50=_0xff98[_0x40e1b6];return _0x382f50;};'use strict';var _=require(_0x8ff9('0x0'));var util=require(_0x8ff9('0x1'));var logger=require(_0x8ff9('0x2'))('api');var moment=require(_0x8ff9('0x3'));var BPromise=require(_0x8ff9('0x4'));var rp=require(_0x8ff9('0x5'));var fs=require('fs');var path=require(_0x8ff9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ff9('0x7'));module[_0x8ff9('0x8')]=function(_0x57a57c,_0x518a4b){return _0x57a57c[_0x8ff9('0x9')](_0x8ff9('0xa'),attributes,{'tableName':_0x8ff9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e27bbaf..8fce252 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a9d=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x14a08c,_0x294c76){var _0x3348bc=function(_0x246aa5){while(--_0x246aa5){_0x14a08c['push'](_0x14a08c['shift']());}};_0x3348bc(++_0x294c76);}(_0x0a9d,0x196));var _0xd0a9=function(_0x2beddc,_0x106694){_0x2beddc=_0x2beddc-0x0;var _0x291b7a=_0x0a9d[_0x2beddc];return _0x291b7a;};'use strict';var _=require(_0xd0a9('0x0'));var util=require('util');var moment=require(_0xd0a9('0x1'));var BPromise=require('bluebird');var rs=require(_0xd0a9('0x2'));var fs=require('fs');var Redis=require(_0xd0a9('0x3'));var db=require(_0xd0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0a9('0x5'))(_0xd0a9('0x6'));var config=require(_0xd0a9('0x7'));var jayson=require(_0xd0a9('0x8'));var client=jayson[_0xd0a9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x287d84,_0x4b7451,_0x41d47a){return new BPromise(function(_0x3528b2,_0x3cc68d){return client['request'](_0x287d84,_0x41d47a)[_0xd0a9('0xa')](function(_0x2ffceb){logger[_0xd0a9('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b7451,_0xd0a9('0xc'));logger[_0xd0a9('0xd')](_0xd0a9('0xe'),_0x4b7451,_0xd0a9('0xc'),JSON['stringify'](_0x2ffceb));if(_0x2ffceb['error']){if(_0x2ffceb[_0xd0a9('0xf')]['code']===0x1f4){logger[_0xd0a9('0xf')](_0xd0a9('0x10'),_0x4b7451,_0x2ffceb[_0xd0a9('0xf')][_0xd0a9('0x11')]);return _0x3cc68d(_0x2ffceb['error'][_0xd0a9('0x11')]);}logger[_0xd0a9('0xf')](_0xd0a9('0x10'),_0x4b7451,_0x2ffceb['error'][_0xd0a9('0x11')]);return _0x3528b2(_0x2ffceb[_0xd0a9('0xf')][_0xd0a9('0x11')]);}else{logger[_0xd0a9('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b7451,_0xd0a9('0xc'));_0x3528b2(_0x2ffceb[_0xd0a9('0x12')][_0xd0a9('0x11')]);}})['catch'](function(_0x566804){logger[_0xd0a9('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b7451,_0x566804);_0x3cc68d(_0x566804);});});}
\ No newline at end of file
+var _0xac51=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5ae400,_0x1a533f){var _0xe7ce02=function(_0x43617b){while(--_0x43617b){_0x5ae400['push'](_0x5ae400['shift']());}};_0xe7ce02(++_0x1a533f);}(_0xac51,0x155));var _0x1ac5=function(_0x4c6542,_0x22a548){_0x4c6542=_0x4c6542-0x0;var _0x273ee4=_0xac51[_0x4c6542];return _0x273ee4;};'use strict';var _=require('lodash');var util=require(_0x1ac5('0x0'));var moment=require(_0x1ac5('0x1'));var BPromise=require(_0x1ac5('0x2'));var rs=require(_0x1ac5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1ac5('0x4'));var logger=require(_0x1ac5('0x5'))(_0x1ac5('0x6'));var config=require(_0x1ac5('0x7'));var jayson=require(_0x1ac5('0x8'));var client=jayson[_0x1ac5('0x9')][_0x1ac5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4756b2,_0x451ba2,_0x366b4f){return new BPromise(function(_0x296cf9,_0x571133){return client[_0x1ac5('0xb')](_0x4756b2,_0x366b4f)[_0x1ac5('0xc')](function(_0x4f3a79){logger[_0x1ac5('0xd')](_0x1ac5('0xe'),_0x451ba2,_0x1ac5('0xf'));logger[_0x1ac5('0x10')](_0x1ac5('0x11'),_0x451ba2,_0x1ac5('0xf'),JSON['stringify'](_0x4f3a79));if(_0x4f3a79[_0x1ac5('0x12')]){if(_0x4f3a79['error'][_0x1ac5('0x13')]===0x1f4){logger[_0x1ac5('0x12')](_0x1ac5('0xe'),_0x451ba2,_0x4f3a79['error']['message']);return _0x571133(_0x4f3a79[_0x1ac5('0x12')][_0x1ac5('0x14')]);}logger['error'](_0x1ac5('0xe'),_0x451ba2,_0x4f3a79[_0x1ac5('0x12')][_0x1ac5('0x14')]);return _0x296cf9(_0x4f3a79[_0x1ac5('0x12')][_0x1ac5('0x14')]);}else{logger[_0x1ac5('0xd')](_0x1ac5('0xe'),_0x451ba2,_0x1ac5('0xf'));_0x296cf9(_0x4f3a79[_0x1ac5('0x15')][_0x1ac5('0x14')]);}})['catch'](function(_0x353bf9){logger[_0x1ac5('0x12')](_0x1ac5('0xe'),_0x451ba2,_0x353bf9);_0x571133(_0x353bf9);});});}
\ No newline at end of file
index 729368f..96c81b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc153=['get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x2ef251,_0x3687e5){var _0x5c931b=function(_0x3e1e36){while(--_0x3e1e36){_0x2ef251['push'](_0x2ef251['shift']());}};_0x5c931b(++_0x3687e5);}(_0xc153,0x191));var _0x3c15=function(_0x43630b,_0x480788){_0x43630b=_0x43630b-0x0;var _0x66d29=_0xc153[_0x43630b];return _0x66d29;};'use strict';var multer=require('multer');var util=require(_0x3c15('0x0'));var path=require(_0x3c15('0x1'));var timeout=require(_0x3c15('0x2'));var express=require(_0x3c15('0x3'));var router=express[_0x3c15('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3c15('0x5'));var config=require(_0x3c15('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0x3c15('0x7')]('/',auth[_0x3c15('0x8')](),controller[_0x3c15('0x9')]);router[_0x3c15('0x7')](_0x3c15('0xa'),auth[_0x3c15('0x8')](),controller['show']);router[_0x3c15('0x7')](_0x3c15('0xb'),auth['isAuthenticated'](),controller[_0x3c15('0xc')]);router['get'](_0x3c15('0xd'),auth[_0x3c15('0x8')](),controller[_0x3c15('0xe')]);router[_0x3c15('0x7')](_0x3c15('0xf'),auth[_0x3c15('0x8')](),controller[_0x3c15('0x10')]);router[_0x3c15('0x11')]('/',auth[_0x3c15('0x8')](),controller[_0x3c15('0x12')]);router[_0x3c15('0x13')]('/:id',auth[_0x3c15('0x8')](),controller[_0x3c15('0x14')]);router[_0x3c15('0x15')](_0x3c15('0xa'),auth['isAuthenticated'](),controller[_0x3c15('0x16')]);module[_0x3c15('0x17')]=router;
\ No newline at end of file
+var _0xf790=['/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','util','connect-timeout','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xf790,0xa5));var _0x0f79=function(_0x48899b,_0x374fb2){_0x48899b=_0x48899b-0x0;var _0x1e09a3=_0xf790[_0x48899b];return _0x1e09a3;};'use strict';var multer=require('multer');var util=require(_0x0f79('0x0'));var path=require('path');var timeout=require(_0x0f79('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0f79('0x2'));var config=require('../../config/environment');var controller=require(_0x0f79('0x3'));router[_0x0f79('0x4')]('/',auth[_0x0f79('0x5')](),controller[_0x0f79('0x6')]);router[_0x0f79('0x4')](_0x0f79('0x7'),auth['isAuthenticated'](),controller[_0x0f79('0x8')]);router[_0x0f79('0x4')](_0x0f79('0x9'),auth[_0x0f79('0x5')](),controller[_0x0f79('0xa')]);router[_0x0f79('0x4')](_0x0f79('0xb'),auth['isAuthenticated'](),controller[_0x0f79('0xc')]);router['get'](_0x0f79('0xd'),auth[_0x0f79('0x5')](),controller[_0x0f79('0xe')]);router[_0x0f79('0xf')]('/',auth[_0x0f79('0x5')](),controller[_0x0f79('0x10')]);router[_0x0f79('0x11')](_0x0f79('0x7'),auth['isAuthenticated'](),controller[_0x0f79('0x12')]);router[_0x0f79('0x13')]('/:id',auth[_0x0f79('0x5')](),controller[_0x0f79('0x14')]);module[_0x0f79('0x15')]=router;
\ No newline at end of file
index 252ed73..86bdcff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x729c=['exports','STRING','csv','pdf','DATE','Loading','ENUM','manual','UNSIGNED','sequelize'];(function(_0xca3269,_0x374910){var _0x3b015c=function(_0x287ed5){while(--_0x287ed5){_0xca3269['push'](_0xca3269['shift']());}};_0x3b015c(++_0x374910);}(_0x729c,0x1e9));var _0xc729=function(_0x584edb,_0x23585e){_0x584edb=_0x584edb-0x0;var _0x49393c=_0x729c[_0x584edb];return _0x49393c;};'use strict';var Sequelize=require(_0xc729('0x0'));var moment=require('moment');module[_0xc729('0x1')]={'name':{'type':Sequelize[_0xc729('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xc729('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xc729('0x3'),_0xc729('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0xc729('0x3')},'savename':{'type':Sequelize[_0xc729('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xc729('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xc729('0x6')},'type':{'type':Sequelize[_0xc729('0x7')](_0xc729('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0xc729('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xc729('0x9')]},'reportType':{'type':Sequelize[_0xc729('0x2')]}};
\ No newline at end of file
+var _0x92b3=['exports','csv','pdf','xlsx','DATE','ENUM','manual','scheduled','INTEGER','UNSIGNED','STRING','sequelize','moment'];(function(_0x512b48,_0xa3924f){var _0x278a76=function(_0x2360ec){while(--_0x2360ec){_0x512b48['push'](_0x512b48['shift']());}};_0x278a76(++_0xa3924f);}(_0x92b3,0xce));var _0x392b=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x92b3[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x392b('0x0'));var moment=require(_0x392b('0x1'));module[_0x392b('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x392b('0x3'),_0x392b('0x4'),_0x392b('0x5')),'allowNull':![],'defaultValue':_0x392b('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x392b('0x6')]},'endDate':{'type':Sequelize[_0x392b('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x392b('0x7')](_0x392b('0x8'),_0x392b('0x9')),'allowNull':![],'defaultValue':_0x392b('0x8')},'reportId':{'type':Sequelize[_0x392b('0xa')](0xb)[_0x392b('0xb')]},'reportType':{'type':Sequelize[_0x392b('0xc')]}};
\ No newline at end of file
index 7151346..b5abc67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04bb=['pick','VIRTUAL','filter','merge','includeAll','include','findAll','catch','show','params','find','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','update','download','basename','output','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','exists','root','format','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','ExtractedReports','UserProfileResource','end','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters'];(function(_0x3ef12b,_0x31de5c){var _0x4c1b57=function(_0x5ba9d1){while(--_0x5ba9d1){_0x3ef12b['push'](_0x3ef12b['shift']());}};_0x4c1b57(++_0x31de5c);}(_0x04bb,0x88));var _0xb04b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x04bb[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb04b('0x0'));var zipdir=require(_0xb04b('0x1'));var jsonpatch=require(_0xb04b('0x2'));var rp=require(_0xb04b('0x3'));var moment=require(_0xb04b('0x4'));var BPromise=require(_0xb04b('0x5'));var Mustache=require('mustache');var util=require(_0xb04b('0x6'));var path=require(_0xb04b('0x7'));var sox=require(_0xb04b('0x8'));var csv=require(_0xb04b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb04b('0xa'));var _=require('lodash');var squel=require(_0xb04b('0xb'));var crypto=require(_0xb04b('0xc'));var jsforce=require(_0xb04b('0xd'));var deskjs=require(_0xb04b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb04b('0xf'));var Redis=require(_0xb04b('0x10'));var authService=require(_0xb04b('0x11'));var qs=require(_0xb04b('0x12'));var as=require(_0xb04b('0x13'));var hardwareService=require(_0xb04b('0x14'));var logger=require(_0xb04b('0x15'))(_0xb04b('0x16'));var utils=require(_0xb04b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb04b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e9fd2,_0x2035ab){_0x2035ab=_0x2035ab||0xcc;return function(_0x4a4030){if(_0x4a4030){return _0x4e9fd2[_0xb04b('0x19')](_0x2035ab);}return _0x4e9fd2['status'](_0x2035ab)['end']();};}function respondWithResult(_0x5a1490,_0xaaeadd){_0xaaeadd=_0xaaeadd||0xc8;return function(_0x32e09a){if(_0x32e09a){return _0x5a1490['status'](_0xaaeadd)[_0xb04b('0x1a')](_0x32e09a);}};}function respondWithFilteredResult(_0x176a73,_0xc9832d){return function(_0x4163f7){if(_0x4163f7){var _0x3179de=typeof _0xc9832d[_0xb04b('0x1b')]===_0xb04b('0x1c')&&typeof _0xc9832d[_0xb04b('0x1d')]==='undefined';var _0x1f540b=_0x4163f7['count'];var _0x437d55=_0x3179de?0x0:_0xc9832d[_0xb04b('0x1b')];var _0x5961aa=_0x3179de?_0x4163f7[_0xb04b('0x1e')]:_0xc9832d[_0xb04b('0x1b')]+_0xc9832d[_0xb04b('0x1d')];var _0x4befa6;if(_0x5961aa>=_0x1f540b){_0x5961aa=_0x1f540b;_0x4befa6=0xc8;}else{_0x4befa6=0xce;}_0x176a73[_0xb04b('0x1f')](_0x4befa6);return _0x176a73[_0xb04b('0x20')](_0xb04b('0x21'),_0x437d55+'-'+_0x5961aa+'/'+_0x1f540b)['json'](_0x4163f7);}return null;};}function patchUpdates(_0x1c78b0){return function(_0xc4bdac){try{jsonpatch[_0xb04b('0x22')](_0xc4bdac,_0x1c78b0,!![]);}catch(_0x14b44c){return BPromise[_0xb04b('0x23')](_0x14b44c);}return _0xc4bdac[_0xb04b('0x24')]();};}function saveUpdates(_0x2cc784,_0x582113){return function(_0x572775){if(_0x572775){return _0x572775['update'](_0x2cc784)[_0xb04b('0x25')](function(_0x3075be){return _0x3075be;});}return null;};}function removeEntity(_0x4182b9,_0x25aae9){return function(_0x354d8e){if(_0x354d8e){return _0x354d8e[_0xb04b('0x26')]()['then'](function(){var _0x319c3d=_0x354d8e['get']({'plain':!![]});var _0x51039b=_0xb04b('0x27');return db[_0xb04b('0x28')][_0xb04b('0x26')]({'where':{'type':_0x51039b,'resourceId':_0x319c3d['id']}})['then'](function(){return _0x354d8e;});})[_0xb04b('0x25')](function(){_0x4182b9[_0xb04b('0x1f')](0xcc)[_0xb04b('0x29')]();});}};}function handleEntityNotFound(_0x307439,_0xffe570){return function(_0x50e36f){if(!_0x50e36f){_0x307439[_0xb04b('0x19')](0x194);}return _0x50e36f;};}function handleError(_0x29f061,_0x1215fb){_0x1215fb=_0x1215fb||0x1f4;return function(_0x17c86f){logger['error'](_0x17c86f[_0xb04b('0x2a')]);if(_0x17c86f['name']){delete _0x17c86f[_0xb04b('0x2b')];}_0x29f061[_0xb04b('0x1f')](_0x1215fb)[_0xb04b('0x2c')](_0x17c86f);};}exports[_0xb04b('0x2d')]=function(_0x16abf2,_0xdb67ce){var _0x2b292a={},_0x57e209={},_0x4b5af1={'count':0x0,'rows':[]};var _0x5ee4ff=_['map'](db[_0xb04b('0x2e')][_0xb04b('0x2f')],function(_0x3e49b9){return{'name':_0x3e49b9[_0xb04b('0x30')],'type':_0x3e49b9[_0xb04b('0x31')][_0xb04b('0x32')]};});_0x57e209[_0xb04b('0x33')]=_[_0xb04b('0x34')](_0x5ee4ff,_0xb04b('0x2b'));_0x57e209[_0xb04b('0x35')]=_[_0xb04b('0x36')](_0x16abf2['query']);_0x57e209['filters']=_[_0xb04b('0x37')](_0x57e209[_0xb04b('0x33')],_0x57e209[_0xb04b('0x35')]);_0x2b292a[_0xb04b('0x38')]=_['intersection'](_0x57e209[_0xb04b('0x33')],qs[_0xb04b('0x39')](_0x16abf2[_0xb04b('0x35')]['fields']));_0x2b292a[_0xb04b('0x38')]=_0x2b292a[_0xb04b('0x38')][_0xb04b('0x3a')]?_0x2b292a[_0xb04b('0x38')]:_0x57e209[_0xb04b('0x33')];if(!_0x16abf2[_0xb04b('0x35')][_0xb04b('0x3b')]('nolimit')){_0x2b292a[_0xb04b('0x1d')]=qs[_0xb04b('0x1d')](_0x16abf2[_0xb04b('0x35')][_0xb04b('0x1d')]);_0x2b292a[_0xb04b('0x1b')]=qs['offset'](_0x16abf2[_0xb04b('0x35')][_0xb04b('0x1b')]);}_0x2b292a[_0xb04b('0x3c')]=qs['sort'](_0x16abf2[_0xb04b('0x35')][_0xb04b('0x3d')]);_0x2b292a[_0xb04b('0x3e')]=qs[_0xb04b('0x3f')](_[_0xb04b('0x40')](_0x16abf2[_0xb04b('0x35')],_0x57e209[_0xb04b('0x3f')]),_0x5ee4ff);if(_0x16abf2[_0xb04b('0x35')]['filter']){_0x2b292a[_0xb04b('0x3e')]=_['merge'](_0x2b292a[_0xb04b('0x3e')],{'$or':_[_0xb04b('0x34')](_0x5ee4ff,function(_0xcccf9f){if(_0xcccf9f['type']!==_0xb04b('0x41')){var _0x17f810={};_0x17f810[_0xcccf9f['name']]={'$like':'%'+_0x16abf2[_0xb04b('0x35')][_0xb04b('0x42')]+'%'};return _0x17f810;}})});}_0x2b292a=_[_0xb04b('0x43')]({},_0x2b292a,_0x16abf2['options']);var _0x174364={'where':_0x2b292a[_0xb04b('0x3e')]};return db['AnalyticExtractedReport'][_0xb04b('0x1e')](_0x174364)[_0xb04b('0x25')](function(_0x602439){_0x4b5af1[_0xb04b('0x1e')]=_0x602439;if(_0x16abf2[_0xb04b('0x35')][_0xb04b('0x44')]){_0x2b292a[_0xb04b('0x45')]=[{'all':!![]}];}return db[_0xb04b('0x2e')][_0xb04b('0x46')](_0x2b292a);})[_0xb04b('0x25')](function(_0x9729d7){_0x4b5af1['rows']=_0x9729d7;return _0x4b5af1;})['then'](respondWithFilteredResult(_0xdb67ce,_0x2b292a))[_0xb04b('0x47')](handleError(_0xdb67ce,null));};exports[_0xb04b('0x48')]=function(_0x40317e,_0xba2b55){var _0x16d262={'raw':!![],'where':{'id':_0x40317e[_0xb04b('0x49')]['id']}},_0x41327a={};_0x41327a[_0xb04b('0x33')]=_[_0xb04b('0x36')](db[_0xb04b('0x2e')]['rawAttributes']);_0x41327a['query']=_[_0xb04b('0x36')](_0x40317e['query']);_0x41327a[_0xb04b('0x3f')]=_[_0xb04b('0x37')](_0x41327a[_0xb04b('0x33')],_0x41327a[_0xb04b('0x35')]);_0x16d262[_0xb04b('0x38')]=_[_0xb04b('0x37')](_0x41327a['model'],qs[_0xb04b('0x39')](_0x40317e[_0xb04b('0x35')][_0xb04b('0x39')]));_0x16d262[_0xb04b('0x38')]=_0x16d262['attributes']['length']?_0x16d262[_0xb04b('0x38')]:_0x41327a[_0xb04b('0x33')];if(_0x40317e[_0xb04b('0x35')][_0xb04b('0x44')]){_0x16d262[_0xb04b('0x45')]=[{'all':!![]}];}_0x16d262=_[_0xb04b('0x43')]({},_0x16d262,_0x40317e['options']);return db[_0xb04b('0x2e')][_0xb04b('0x4a')](_0x16d262)[_0xb04b('0x25')](handleEntityNotFound(_0xba2b55,null))[_0xb04b('0x25')](respondWithResult(_0xba2b55,null))[_0xb04b('0x47')](handleError(_0xba2b55,null));};exports[_0xb04b('0x4b')]=function(_0x54b2c0,_0x2a6dbc){return db[_0xb04b('0x2e')][_0xb04b('0x4b')](_0x54b2c0[_0xb04b('0x4c')],{})[_0xb04b('0x25')](function(_0x112d3a){var _0x308ad8=_0x54b2c0['user'][_0xb04b('0x4d')]({'plain':!![]});if(!_0x308ad8)throw new Error(_0xb04b('0x4e'));if(_0x308ad8[_0xb04b('0x4f')]===_0xb04b('0x50')){var _0xfaeebc=_0x112d3a[_0xb04b('0x4d')]({'plain':!![]});var _0x506ea2=_0xb04b('0x27');return db[_0xb04b('0x51')][_0xb04b('0x4a')]({'where':{'name':_0x506ea2,'userProfileId':_0x308ad8[_0xb04b('0x52')]},'raw':!![]})['then'](function(_0x28112e){if(_0x28112e&&_0x28112e[_0xb04b('0x53')]===0x0){return db[_0xb04b('0x28')][_0xb04b('0x4b')]({'name':_0xfaeebc['name'],'resourceId':_0xfaeebc['id'],'type':_0x28112e[_0xb04b('0x2b')],'sectionId':_0x28112e['id']},{})[_0xb04b('0x25')](function(){return _0x112d3a;});}else{return _0x112d3a;}})[_0xb04b('0x47')](function(_0x3050ab){logger[_0xb04b('0x54')](_0xb04b('0x55'),_0x3050ab);throw _0x3050ab;});}return _0x112d3a;})['then'](respondWithResult(_0x2a6dbc,0xc9))[_0xb04b('0x47')](handleError(_0x2a6dbc,null));};exports[_0xb04b('0x56')]=function(_0x1b91ec,_0xc976e){if(_0x1b91ec['body']['id']){delete _0x1b91ec['body']['id'];}return db[_0xb04b('0x2e')][_0xb04b('0x4a')]({'where':{'id':_0x1b91ec[_0xb04b('0x49')]['id']}})[_0xb04b('0x25')](handleEntityNotFound(_0xc976e,null))[_0xb04b('0x25')](saveUpdates(_0x1b91ec[_0xb04b('0x4c')],null))['then'](respondWithResult(_0xc976e,null))[_0xb04b('0x47')](handleError(_0xc976e,null));};exports[_0xb04b('0x26')]=function(_0x377754,_0x5e9de6){return db[_0xb04b('0x2e')][_0xb04b('0x4a')]({'where':{'id':_0x377754[_0xb04b('0x49')]['id']}})[_0xb04b('0x25')](handleEntityNotFound(_0x5e9de6,null))[_0xb04b('0x25')](removeEntity(_0x5e9de6,null))[_0xb04b('0x47')](handleError(_0x5e9de6,null));};exports[_0xb04b('0x57')]=function(_0xae241c,_0x550b9c,_0x412df2){return db[_0xb04b('0x2e')][_0xb04b('0x4a')]({'where':{'id':_0xae241c[_0xb04b('0x49')]['id']},'attributes':[_0xb04b('0x2b'),_0xb04b('0x58'),'savename',_0xb04b('0x59')],'raw':!![]})[_0xb04b('0x25')](handleEntityNotFound(_0x550b9c,null))['then'](function(_0x2e7a05){if(_0x2e7a05){if(!fs[_0xb04b('0x5a')](path[_0xb04b('0x5b')](config['root'],_0xb04b('0x5c'),_0x2e7a05[_0xb04b('0x5d')]))){throw new db[(_0xb04b('0x5e'))][(_0xb04b('0x5f'))]('Report\x20not\x20found\x20or\x20empty');}if(_0xae241c[_0xb04b('0x35')][_0xb04b('0x60')]){return _0x550b9c[_0xb04b('0x19')](0xc8);}return _0x550b9c[_0xb04b('0x57')](path[_0xb04b('0x5b')](config[_0xb04b('0x61')],_0xb04b('0x5c'),_0x2e7a05[_0xb04b('0x5d')]),util[_0xb04b('0x62')]('%s.%s',_0x2e7a05['basename']||_0x2e7a05['name'],_0x2e7a05[_0xb04b('0x59')][_0xb04b('0x63')]()));}})[_0xb04b('0x47')](handleError(_0x550b9c,null));};
\ No newline at end of file
+var _0xafb0=['map','rawAttributes','fieldName','type','model','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','AnalyticExtractedReport','create','body','user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','join','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','root','%s.%s','output','toLowerCase','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','ExtractedReports','status','error','stack','name','index'];(function(_0x5a7e16,_0x572317){var _0x2f5841=function(_0x27acdc){while(--_0x27acdc){_0x5a7e16['push'](_0x5a7e16['shift']());}};_0x2f5841(++_0x572317);}(_0xafb0,0x1f2));var _0x0afb=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xafb0[_0x5f09c5];return _0x426ad9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0afb('0x0'));var zipdir=require(_0x0afb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0afb('0x2'));var moment=require(_0x0afb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0afb('0x4'));var util=require('util');var path=require(_0x0afb('0x5'));var sox=require('sox');var csv=require(_0x0afb('0x6'));var ejs=require(_0x0afb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0afb('0x8'));var squel=require('squel');var crypto=require(_0x0afb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0afb('0xa'));var toCsv=require(_0x0afb('0x6'));var querystring=require(_0x0afb('0xb'));var Papa=require(_0x0afb('0xc'));var Redis=require(_0x0afb('0xd'));var authService=require(_0x0afb('0xe'));var qs=require(_0x0afb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0afb('0x10'));var logger=require(_0x0afb('0x11'))(_0x0afb('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0afb('0x13'));var db=require(_0x0afb('0x14'))['db'];function respondWithStatusCode(_0x493c32,_0x3aae4e){_0x3aae4e=_0x3aae4e||0xcc;return function(_0x5dccae){if(_0x5dccae){return _0x493c32[_0x0afb('0x15')](_0x3aae4e);}return _0x493c32['status'](_0x3aae4e)[_0x0afb('0x16')]();};}function respondWithResult(_0x1bb907,_0x4d2a11){_0x4d2a11=_0x4d2a11||0xc8;return function(_0x902563){if(_0x902563){return _0x1bb907['status'](_0x4d2a11)[_0x0afb('0x17')](_0x902563);}};}function respondWithFilteredResult(_0x1f5e01,_0x12822e){return function(_0x351856){if(_0x351856){var _0x3fc010=typeof _0x12822e['offset']===_0x0afb('0x18')&&typeof _0x12822e[_0x0afb('0x19')]===_0x0afb('0x18');var _0x55319d=_0x351856[_0x0afb('0x1a')];var _0xf240b1=_0x3fc010?0x0:_0x12822e[_0x0afb('0x1b')];var _0x1a67d1=_0x3fc010?_0x351856[_0x0afb('0x1a')]:_0x12822e[_0x0afb('0x1b')]+_0x12822e['limit'];var _0x3ddc0b;if(_0x1a67d1>=_0x55319d){_0x1a67d1=_0x55319d;_0x3ddc0b=0xc8;}else{_0x3ddc0b=0xce;}_0x1f5e01['status'](_0x3ddc0b);return _0x1f5e01[_0x0afb('0x1c')]('Content-Range',_0xf240b1+'-'+_0x1a67d1+'/'+_0x55319d)[_0x0afb('0x17')](_0x351856);}return null;};}function patchUpdates(_0x147c3a){return function(_0x41579a){try{jsonpatch[_0x0afb('0x1d')](_0x41579a,_0x147c3a,!![]);}catch(_0x280651){return BPromise[_0x0afb('0x1e')](_0x280651);}return _0x41579a[_0x0afb('0x1f')]();};}function saveUpdates(_0x12808e,_0x4a29ff){return function(_0x51a98a){if(_0x51a98a){return _0x51a98a[_0x0afb('0x20')](_0x12808e)[_0x0afb('0x21')](function(_0x1de157){return _0x1de157;});}return null;};}function removeEntity(_0x1728b7,_0xa9cb1f){return function(_0x11fefc){if(_0x11fefc){return _0x11fefc[_0x0afb('0x22')]()[_0x0afb('0x21')](function(){var _0x2a0537=_0x11fefc[_0x0afb('0x23')]({'plain':!![]});var _0x11c0c9=_0x0afb('0x24');return db['UserProfileResource'][_0x0afb('0x22')]({'where':{'type':_0x11c0c9,'resourceId':_0x2a0537['id']}})[_0x0afb('0x21')](function(){return _0x11fefc;});})[_0x0afb('0x21')](function(){_0x1728b7[_0x0afb('0x25')](0xcc)[_0x0afb('0x16')]();});}};}function handleEntityNotFound(_0x4bd4c6,_0x9c3341){return function(_0x542756){if(!_0x542756){_0x4bd4c6['sendStatus'](0x194);}return _0x542756;};}function handleError(_0x1f7170,_0x48a8bb){_0x48a8bb=_0x48a8bb||0x1f4;return function(_0x35b56b){logger[_0x0afb('0x26')](_0x35b56b[_0x0afb('0x27')]);if(_0x35b56b[_0x0afb('0x28')]){delete _0x35b56b['name'];}_0x1f7170[_0x0afb('0x25')](_0x48a8bb)['send'](_0x35b56b);};}exports[_0x0afb('0x29')]=function(_0x48f03c,_0x3432e9){var _0x3c5fe1={},_0x519101={},_0x3da79b={'count':0x0,'rows':[]};var _0x446140=_[_0x0afb('0x2a')](db['AnalyticExtractedReport'][_0x0afb('0x2b')],function(_0x175990){return{'name':_0x175990[_0x0afb('0x2c')],'type':_0x175990[_0x0afb('0x2d')]['key']};});_0x519101[_0x0afb('0x2e')]=_[_0x0afb('0x2a')](_0x446140,_0x0afb('0x28'));_0x519101[_0x0afb('0x2f')]=_['keys'](_0x48f03c['query']);_0x519101['filters']=_['intersection'](_0x519101[_0x0afb('0x2e')],_0x519101[_0x0afb('0x2f')]);_0x3c5fe1[_0x0afb('0x30')]=_['intersection'](_0x519101['model'],qs['fields'](_0x48f03c['query'][_0x0afb('0x31')]));_0x3c5fe1[_0x0afb('0x30')]=_0x3c5fe1['attributes'][_0x0afb('0x32')]?_0x3c5fe1[_0x0afb('0x30')]:_0x519101['model'];if(!_0x48f03c[_0x0afb('0x2f')]['hasOwnProperty'](_0x0afb('0x33'))){_0x3c5fe1[_0x0afb('0x19')]=qs['limit'](_0x48f03c['query']['limit']);_0x3c5fe1['offset']=qs['offset'](_0x48f03c[_0x0afb('0x2f')][_0x0afb('0x1b')]);}_0x3c5fe1[_0x0afb('0x34')]=qs[_0x0afb('0x35')](_0x48f03c[_0x0afb('0x2f')][_0x0afb('0x35')]);_0x3c5fe1[_0x0afb('0x36')]=qs[_0x0afb('0x37')](_[_0x0afb('0x38')](_0x48f03c['query'],_0x519101['filters']),_0x446140);if(_0x48f03c[_0x0afb('0x2f')]['filter']){_0x3c5fe1['where']=_['merge'](_0x3c5fe1['where'],{'$or':_['map'](_0x446140,function(_0x23cd4f){if(_0x23cd4f[_0x0afb('0x2d')]!==_0x0afb('0x39')){var _0xf63b9f={};_0xf63b9f[_0x23cd4f[_0x0afb('0x28')]]={'$like':'%'+_0x48f03c[_0x0afb('0x2f')]['filter']+'%'};return _0xf63b9f;}})});}_0x3c5fe1=_[_0x0afb('0x3a')]({},_0x3c5fe1,_0x48f03c[_0x0afb('0x3b')]);var _0x3f7e76={'where':_0x3c5fe1[_0x0afb('0x36')]};return db['AnalyticExtractedReport'][_0x0afb('0x1a')](_0x3f7e76)[_0x0afb('0x21')](function(_0x442a5b){_0x3da79b[_0x0afb('0x1a')]=_0x442a5b;if(_0x48f03c[_0x0afb('0x2f')][_0x0afb('0x3c')]){_0x3c5fe1[_0x0afb('0x3d')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x0afb('0x3e')](_0x3c5fe1);})[_0x0afb('0x21')](function(_0x3ec14){_0x3da79b[_0x0afb('0x3f')]=_0x3ec14;return _0x3da79b;})[_0x0afb('0x21')](respondWithFilteredResult(_0x3432e9,_0x3c5fe1))[_0x0afb('0x40')](handleError(_0x3432e9,null));};exports[_0x0afb('0x41')]=function(_0x4db891,_0x5bae54){var _0x24890e={'raw':!![],'where':{'id':_0x4db891[_0x0afb('0x42')]['id']}},_0x4eafac={};_0x4eafac[_0x0afb('0x2e')]=_[_0x0afb('0x43')](db['AnalyticExtractedReport'][_0x0afb('0x2b')]);_0x4eafac[_0x0afb('0x2f')]=_[_0x0afb('0x43')](_0x4db891[_0x0afb('0x2f')]);_0x4eafac[_0x0afb('0x37')]=_[_0x0afb('0x44')](_0x4eafac[_0x0afb('0x2e')],_0x4eafac[_0x0afb('0x2f')]);_0x24890e[_0x0afb('0x30')]=_[_0x0afb('0x44')](_0x4eafac[_0x0afb('0x2e')],qs['fields'](_0x4db891['query'][_0x0afb('0x31')]));_0x24890e[_0x0afb('0x30')]=_0x24890e[_0x0afb('0x30')][_0x0afb('0x32')]?_0x24890e['attributes']:_0x4eafac[_0x0afb('0x2e')];if(_0x4db891[_0x0afb('0x2f')][_0x0afb('0x3c')]){_0x24890e[_0x0afb('0x3d')]=[{'all':!![]}];}_0x24890e=_['merge']({},_0x24890e,_0x4db891['options']);return db[_0x0afb('0x45')]['find'](_0x24890e)[_0x0afb('0x21')](handleEntityNotFound(_0x5bae54,null))[_0x0afb('0x21')](respondWithResult(_0x5bae54,null))['catch'](handleError(_0x5bae54,null));};exports[_0x0afb('0x46')]=function(_0x46de12,_0x4ceeba){return db[_0x0afb('0x45')]['create'](_0x46de12[_0x0afb('0x47')],{})[_0x0afb('0x21')](function(_0x59b9dd){var _0x2e0103=_0x46de12[_0x0afb('0x48')][_0x0afb('0x23')]({'plain':!![]});if(!_0x2e0103)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e0103[_0x0afb('0x49')]==='user'){var _0x5b583f=_0x59b9dd[_0x0afb('0x23')]({'plain':!![]});var _0x5435dc=_0x0afb('0x24');return db[_0x0afb('0x4a')][_0x0afb('0x4b')]({'where':{'name':_0x5435dc,'userProfileId':_0x2e0103['userProfileId']},'raw':!![]})[_0x0afb('0x21')](function(_0x1f4144){if(_0x1f4144&&_0x1f4144[_0x0afb('0x4c')]===0x0){return db[_0x0afb('0x4d')][_0x0afb('0x46')]({'name':_0x5b583f[_0x0afb('0x28')],'resourceId':_0x5b583f['id'],'type':_0x1f4144[_0x0afb('0x28')],'sectionId':_0x1f4144['id']},{})[_0x0afb('0x21')](function(){return _0x59b9dd;});}else{return _0x59b9dd;}})['catch'](function(_0x392f05){logger[_0x0afb('0x26')](_0x0afb('0x4e'),_0x392f05);throw _0x392f05;});}return _0x59b9dd;})[_0x0afb('0x21')](respondWithResult(_0x4ceeba,0xc9))[_0x0afb('0x40')](handleError(_0x4ceeba,null));};exports[_0x0afb('0x20')]=function(_0xf2be3e,_0x119a0a){if(_0xf2be3e['body']['id']){delete _0xf2be3e[_0x0afb('0x47')]['id'];}return db[_0x0afb('0x45')]['find']({'where':{'id':_0xf2be3e[_0x0afb('0x42')]['id']}})[_0x0afb('0x21')](handleEntityNotFound(_0x119a0a,null))[_0x0afb('0x21')](saveUpdates(_0xf2be3e[_0x0afb('0x47')],null))[_0x0afb('0x21')](respondWithResult(_0x119a0a,null))[_0x0afb('0x40')](handleError(_0x119a0a,null));};exports['destroy']=function(_0x5d1a28,_0x3cb193){return db[_0x0afb('0x45')][_0x0afb('0x4b')]({'where':{'id':_0x5d1a28[_0x0afb('0x42')]['id']}})[_0x0afb('0x21')](handleEntityNotFound(_0x3cb193,null))['then'](removeEntity(_0x3cb193,null))[_0x0afb('0x40')](handleError(_0x3cb193,null));};exports['download']=function(_0x54b104,_0x28b5e1,_0x43f255){return db[_0x0afb('0x45')][_0x0afb('0x4b')]({'where':{'id':_0x54b104[_0x0afb('0x42')]['id']},'attributes':[_0x0afb('0x28'),'basename',_0x0afb('0x4f'),'output'],'raw':!![]})[_0x0afb('0x21')](handleEntityNotFound(_0x28b5e1,null))[_0x0afb('0x21')](function(_0x4a1c0f){if(_0x4a1c0f){if(!fs['existsSync'](path[_0x0afb('0x50')](config['root'],_0x0afb('0x51'),_0x4a1c0f[_0x0afb('0x4f')]))){throw new db[(_0x0afb('0x52'))]['ValidationError'](_0x0afb('0x53'));}if(_0x54b104['query'][_0x0afb('0x54')]){return _0x28b5e1[_0x0afb('0x15')](0xc8);}return _0x28b5e1[_0x0afb('0x55')](path[_0x0afb('0x50')](config[_0x0afb('0x56')],'server/files/reports',_0x4a1c0f[_0x0afb('0x4f')]),util['format'](_0x0afb('0x57'),_0x4a1c0f['basename']||_0x4a1c0f[_0x0afb('0x28')],_0x4a1c0f[_0x0afb('0x58')][_0x0afb('0x59')]()));}})['catch'](handleError(_0x28b5e1,null));};
\ No newline at end of file
index a44dc79..0976005 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fcc=['AnalyticExtractedReport','analytics_extracted_reports','lodash','api','moment','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','define'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9fcc,0xfc));var _0xc9fc=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9fcc[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xc9fc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc9fc('0x1'));var moment=require(_0xc9fc('0x2'));var BPromise=require('bluebird');var rp=require(_0xc9fc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9fc('0x4'));var config=require(_0xc9fc('0x5'));var attributes=require(_0xc9fc('0x6'));module['exports']=function(_0x5daaec,_0x181585){return _0x5daaec[_0xc9fc('0x7')](_0xc9fc('0x8'),attributes,{'tableName':_0xc9fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe598=['moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api'];(function(_0x1629db,_0x20237b){var _0x5a704e=function(_0x2959c9){while(--_0x2959c9){_0x1629db['push'](_0x1629db['shift']());}};_0x5a704e(++_0x20237b);}(_0xe598,0x1dd));var _0x8e59=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0xe598[_0x34d275];return _0x1379cc;};'use strict';var _=require(_0x8e59('0x0'));var util=require(_0x8e59('0x1'));var logger=require('../../config/logger')(_0x8e59('0x2'));var moment=require(_0x8e59('0x3'));var BPromise=require(_0x8e59('0x4'));var rp=require(_0x8e59('0x5'));var fs=require('fs');var path=require(_0x8e59('0x6'));var rimraf=require('rimraf');var config=require(_0x8e59('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x8e59('0x8')]=function(_0x57562b,_0x484eab){return _0x57562b[_0x8e59('0x9')](_0x8e59('0xa'),attributes,{'tableName':_0x8e59('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 69f371a..fec093e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca71=['then','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x316299,_0x966935){var _0x357872=function(_0x5453f8){while(--_0x5453f8){_0x316299['push'](_0x316299['shift']());}};_0x357872(++_0x966935);}(_0xca71,0x164));var _0x1ca7=function(_0x2d16d8,_0x295ba2){_0x2d16d8=_0x2d16d8-0x0;var _0x40e2bf=_0xca71[_0x2d16d8];return _0x40e2bf;};'use strict';var _=require('lodash');var util=require(_0x1ca7('0x0'));var moment=require(_0x1ca7('0x1'));var BPromise=require(_0x1ca7('0x2'));var rs=require(_0x1ca7('0x3'));var fs=require('fs');var Redis=require(_0x1ca7('0x4'));var db=require(_0x1ca7('0x5'))['db'];var utils=require(_0x1ca7('0x6'));var logger=require(_0x1ca7('0x7'))(_0x1ca7('0x8'));var config=require('../../config/environment');var jayson=require(_0x1ca7('0x9'));var client=jayson[_0x1ca7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57b5a4,_0x58dafb,_0x36bfe3){return new BPromise(function(_0x721bf9,_0x1a6e7d){return client[_0x1ca7('0xb')](_0x57b5a4,_0x36bfe3)[_0x1ca7('0xc')](function(_0x36abad){logger['info'](_0x1ca7('0xd'),_0x58dafb,'request\x20sent');logger[_0x1ca7('0xe')](_0x1ca7('0xf'),_0x58dafb,_0x1ca7('0x10'),JSON[_0x1ca7('0x11')](_0x36abad));if(_0x36abad[_0x1ca7('0x12')]){if(_0x36abad['error'][_0x1ca7('0x13')]===0x1f4){logger['error'](_0x1ca7('0xd'),_0x58dafb,_0x36abad['error']['message']);return _0x1a6e7d(_0x36abad['error'][_0x1ca7('0x14')]);}logger[_0x1ca7('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x58dafb,_0x36abad['error']['message']);return _0x721bf9(_0x36abad[_0x1ca7('0x12')][_0x1ca7('0x14')]);}else{logger['info'](_0x1ca7('0xd'),_0x58dafb,_0x1ca7('0x10'));_0x721bf9(_0x36abad[_0x1ca7('0x15')][_0x1ca7('0x14')]);}})[_0x1ca7('0x16')](function(_0x15b429){logger[_0x1ca7('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x58dafb,_0x15b429);_0x1a6e7d(_0x15b429);});});}
\ No newline at end of file
+var _0x865d=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x865d,0x8d));var _0xd865=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x865d[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xd865('0x0'));var util=require(_0xd865('0x1'));var moment=require(_0xd865('0x2'));var BPromise=require(_0xd865('0x3'));var rs=require(_0xd865('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd865('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd865('0x6'))(_0xd865('0x7'));var config=require(_0xd865('0x8'));var jayson=require(_0xd865('0x9'));var client=jayson[_0xd865('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e73ea,_0x574795,_0x3c070e){return new BPromise(function(_0x143ea4,_0xab2a53){return client[_0xd865('0xb')](_0x5e73ea,_0x3c070e)[_0xd865('0xc')](function(_0x5a0d71){logger[_0xd865('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x574795,_0xd865('0xe'));logger[_0xd865('0xf')](_0xd865('0x10'),_0x574795,_0xd865('0xe'),JSON[_0xd865('0x11')](_0x5a0d71));if(_0x5a0d71[_0xd865('0x12')]){if(_0x5a0d71[_0xd865('0x12')]['code']===0x1f4){logger['error'](_0xd865('0x13'),_0x574795,_0x5a0d71[_0xd865('0x12')]['message']);return _0xab2a53(_0x5a0d71[_0xd865('0x12')][_0xd865('0x14')]);}logger[_0xd865('0x12')](_0xd865('0x13'),_0x574795,_0x5a0d71[_0xd865('0x12')][_0xd865('0x14')]);return _0x143ea4(_0x5a0d71[_0xd865('0x12')][_0xd865('0x14')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x574795,_0xd865('0xe'));_0x143ea4(_0x5a0d71[_0xd865('0x15')][_0xd865('0x14')]);}})[_0xd865('0x16')](function(_0x1e9122){logger[_0xd865('0x12')](_0xd865('0x13'),_0x574795,_0x1e9122);_0xab2a53(_0x1e9122);});});}
\ No newline at end of file
index a0125b7..b3701cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1018=['./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x596512,_0x222ea3){var _0x4a0255=function(_0x68a1fc){while(--_0x68a1fc){_0x596512['push'](_0x596512['shift']());}};_0x4a0255(++_0x222ea3);}(_0x1018,0x1ef));var _0x8101=function(_0x154b20,_0x275202){_0x154b20=_0x154b20-0x0;var _0x2f2768=_0x1018[_0x154b20];return _0x2f2768;};'use strict';var multer=require(_0x8101('0x0'));var util=require(_0x8101('0x1'));var path=require(_0x8101('0x2'));var timeout=require(_0x8101('0x3'));var express=require('express');var router=express[_0x8101('0x4')]();var fs_extra=require(_0x8101('0x5'));var auth=require(_0x8101('0x6'));var interaction=require(_0x8101('0x7'));var config=require(_0x8101('0x8'));var controller=require(_0x8101('0x9'));router[_0x8101('0xa')]('/',auth[_0x8101('0xb')](),controller[_0x8101('0xc')]);router[_0x8101('0xa')](_0x8101('0xd'),auth[_0x8101('0xb')](),controller['show']);router[_0x8101('0xa')](_0x8101('0xe'),auth[_0x8101('0xb')](),controller[_0x8101('0xf')]);router[_0x8101('0x10')]('/',auth[_0x8101('0xb')](),controller[_0x8101('0x11')]);router['put'](_0x8101('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8101('0x12')](_0x8101('0xd'),auth[_0x8101('0xb')](),controller[_0x8101('0x13')]);module[_0x8101('0x14')]=router;
\ No newline at end of file
+var _0x44e1=['connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','show','/:id/download','post','create','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x503b8c,_0xdfc449){var _0x58be68=function(_0x5c5d91){while(--_0x5c5d91){_0x503b8c['push'](_0x503b8c['shift']());}};_0x58be68(++_0xdfc449);}(_0x44e1,0x141));var _0x144e=function(_0x4dcbe5,_0x3f98d7){_0x4dcbe5=_0x4dcbe5-0x0;var _0x45ac5c=_0x44e1[_0x4dcbe5];return _0x45ac5c;};'use strict';var multer=require(_0x144e('0x0'));var util=require('util');var path=require(_0x144e('0x1'));var timeout=require(_0x144e('0x2'));var express=require(_0x144e('0x3'));var router=express[_0x144e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x144e('0x5'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x144e('0x6')]('/',auth[_0x144e('0x7')](),controller[_0x144e('0x8')]);router['get']('/:id',auth[_0x144e('0x7')](),controller[_0x144e('0x9')]);router[_0x144e('0x6')](_0x144e('0xa'),auth['isAuthenticated'](),controller['download']);router[_0x144e('0xb')]('/',auth['isAuthenticated'](),controller[_0x144e('0xc')]);router[_0x144e('0xd')](_0x144e('0xe'),auth[_0x144e('0x7')](),controller[_0x144e('0xf')]);router[_0x144e('0x10')](_0x144e('0xe'),auth[_0x144e('0x7')](),controller[_0x144e('0x11')]);module[_0x144e('0x12')]=router;
\ No newline at end of file
index 2842c78..7c09fc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x902c=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x902c,0x198));var _0xc902=function(_0x3ba247,_0x203284){_0x3ba247=_0x3ba247-0x0;var _0x2c2b31=_0x902c[_0x3ba247];return _0x2c2b31;};'use strict';var Sequelize=require(_0xc902('0x0'));module[_0xc902('0x1')]={'field':{'type':Sequelize[_0xc902('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xc902('0x3')]},'groupBy':{'type':Sequelize[_0xc902('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc902('0x3')]},'custom':{'type':Sequelize[_0xc902('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x823c=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x1bef4a,_0x1531da){var _0x314cb0=function(_0x188b94){while(--_0x188b94){_0x1bef4a['push'](_0x1bef4a['shift']());}};_0x314cb0(++_0x1531da);}(_0x823c,0x130));var _0xc823=function(_0x5ba2ab,_0x5a8ff){_0x5ba2ab=_0x5ba2ab-0x0;var _0xc8e489=_0x823c[_0x5ba2ab];return _0xc8e489;};'use strict';var Sequelize=require(_0xc823('0x0'));module['exports']={'field':{'type':Sequelize[_0xc823('0x1')]},'alias':{'type':Sequelize[_0xc823('0x2')]},'function':{'type':Sequelize[_0xc823('0x2')]},'format':{'type':Sequelize[_0xc823('0x2')]},'groupBy':{'type':Sequelize[_0xc823('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc823('0x2')]},'custom':{'type':Sequelize[_0xc823('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 994aa2e..e66bd56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b59=['create','bulkCreate','body','find','bulkDestroy','destroy','ids','addFields','findOne','sequelize','transaction','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','error','stack','name','send','map','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','filter','merge','where','type','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','rows','catch','params','keys'];(function(_0x5cc97e,_0x513410){var _0xec2b27=function(_0x1ff7a3){while(--_0x1ff7a3){_0x5cc97e['push'](_0x5cc97e['shift']());}};_0xec2b27(++_0x513410);}(_0x0b59,0x18c));var _0x90b5=function(_0x40b0cb,_0x28116e){_0x40b0cb=_0x40b0cb-0x0;var _0x2e44ea=_0x0b59[_0x40b0cb];return _0x2e44ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90b5('0x0'));var zipdir=require(_0x90b5('0x1'));var jsonpatch=require(_0x90b5('0x2'));var rp=require('request-promise');var moment=require(_0x90b5('0x3'));var BPromise=require(_0x90b5('0x4'));var Mustache=require(_0x90b5('0x5'));var util=require(_0x90b5('0x6'));var path=require('path');var sox=require(_0x90b5('0x7'));var csv=require(_0x90b5('0x8'));var ejs=require(_0x90b5('0x9'));var fs=require('fs');var fs_extra=require(_0x90b5('0xa'));var _=require('lodash');var squel=require(_0x90b5('0xb'));var crypto=require(_0x90b5('0xc'));var jsforce=require(_0x90b5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x90b5('0x8'));var querystring=require(_0x90b5('0xe'));var Papa=require(_0x90b5('0xf'));var Redis=require(_0x90b5('0x10'));var authService=require(_0x90b5('0x11'));var qs=require(_0x90b5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x90b5('0x13'))(_0x90b5('0x14'));var utils=require(_0x90b5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x90b5('0x16'));var db=require(_0x90b5('0x17'))['db'];function respondWithStatusCode(_0x2e7013,_0x5efa3c){_0x5efa3c=_0x5efa3c||0xcc;return function(_0x4cb72c){if(_0x4cb72c){return _0x2e7013[_0x90b5('0x18')](_0x5efa3c);}return _0x2e7013[_0x90b5('0x19')](_0x5efa3c)[_0x90b5('0x1a')]();};}function respondWithResult(_0x1323ac,_0x2ae845){_0x2ae845=_0x2ae845||0xc8;return function(_0x53255f){if(_0x53255f){return _0x1323ac['status'](_0x2ae845)[_0x90b5('0x1b')](_0x53255f);}};}function respondWithFilteredResult(_0x4db2a9,_0x19c085){return function(_0x20b2b3){if(_0x20b2b3){var _0xdcf6b4=typeof _0x19c085[_0x90b5('0x1c')]==='undefined'&&typeof _0x19c085[_0x90b5('0x1d')]===_0x90b5('0x1e');var _0x897e0d=_0x20b2b3['count'];var _0x433c5e=_0xdcf6b4?0x0:_0x19c085[_0x90b5('0x1c')];var _0x3d2c28=_0xdcf6b4?_0x20b2b3[_0x90b5('0x1f')]:_0x19c085[_0x90b5('0x1c')]+_0x19c085[_0x90b5('0x1d')];var _0x53c0cd;if(_0x3d2c28>=_0x897e0d){_0x3d2c28=_0x897e0d;_0x53c0cd=0xc8;}else{_0x53c0cd=0xce;}_0x4db2a9[_0x90b5('0x19')](_0x53c0cd);return _0x4db2a9[_0x90b5('0x20')]('Content-Range',_0x433c5e+'-'+_0x3d2c28+'/'+_0x897e0d)[_0x90b5('0x1b')](_0x20b2b3);}return null;};}function patchUpdates(_0x4591e0){return function(_0x323f99){try{jsonpatch[_0x90b5('0x21')](_0x323f99,_0x4591e0,!![]);}catch(_0x5bc006){return BPromise[_0x90b5('0x22')](_0x5bc006);}return _0x323f99['save']();};}function saveUpdates(_0x257036,_0x427bd3){return function(_0x2f3173){if(_0x2f3173){return _0x2f3173[_0x90b5('0x23')](_0x257036)[_0x90b5('0x24')](function(_0x4c4cfa){return _0x4c4cfa;});}return null;};}function removeEntity(_0x2ef9fd,_0x274187){return function(_0x5438e6){if(_0x5438e6){return _0x5438e6['destroy']()[_0x90b5('0x24')](function(){_0x2ef9fd[_0x90b5('0x19')](0xcc)[_0x90b5('0x1a')]();});}};}function handleEntityNotFound(_0x3de7ce,_0x551486){return function(_0x2c718c){if(!_0x2c718c){_0x3de7ce[_0x90b5('0x18')](0x194);}return _0x2c718c;};}function handleError(_0x219a71,_0x5b403b){_0x5b403b=_0x5b403b||0x1f4;return function(_0x41613d){logger[_0x90b5('0x25')](_0x41613d[_0x90b5('0x26')]);if(_0x41613d[_0x90b5('0x27')]){delete _0x41613d[_0x90b5('0x27')];}_0x219a71['status'](_0x5b403b)[_0x90b5('0x28')](_0x41613d);};}exports['index']=function(_0xfb6d35,_0x3417b7){var _0x2f058b={},_0x346006={},_0x3f1e6b={'count':0x0,'rows':[]};var _0x35fa1b=_[_0x90b5('0x29')](db['AnalyticFieldReport']['rawAttributes'],function(_0x5de5b2){return{'name':_0x5de5b2[_0x90b5('0x2a')],'type':_0x5de5b2['type']['key']};});_0x346006[_0x90b5('0x2b')]=_['map'](_0x35fa1b,_0x90b5('0x27'));_0x346006[_0x90b5('0x2c')]=_['keys'](_0xfb6d35[_0x90b5('0x2c')]);_0x346006['filters']=_[_0x90b5('0x2d')](_0x346006['model'],_0x346006['query']);_0x2f058b[_0x90b5('0x2e')]=_[_0x90b5('0x2d')](_0x346006[_0x90b5('0x2b')],qs[_0x90b5('0x2f')](_0xfb6d35['query'][_0x90b5('0x2f')]));_0x2f058b[_0x90b5('0x2e')]=_0x2f058b['attributes'][_0x90b5('0x30')]?_0x2f058b[_0x90b5('0x2e')]:_0x346006[_0x90b5('0x2b')];if(!_0xfb6d35[_0x90b5('0x2c')][_0x90b5('0x31')]('nolimit')){_0x2f058b['limit']=qs[_0x90b5('0x1d')](_0xfb6d35[_0x90b5('0x2c')][_0x90b5('0x1d')]);_0x2f058b[_0x90b5('0x1c')]=qs['offset'](_0xfb6d35[_0x90b5('0x2c')][_0x90b5('0x1c')]);}_0x2f058b['order']=qs[_0x90b5('0x32')](_0xfb6d35[_0x90b5('0x2c')]['sort']);_0x2f058b['where']=qs[_0x90b5('0x33')](_['pick'](_0xfb6d35[_0x90b5('0x2c')],_0x346006[_0x90b5('0x33')]),_0x35fa1b);if(_0xfb6d35['query'][_0x90b5('0x34')]){_0x2f058b['where']=_[_0x90b5('0x35')](_0x2f058b[_0x90b5('0x36')],{'$or':_[_0x90b5('0x29')](_0x35fa1b,function(_0x2162c1){if(_0x2162c1[_0x90b5('0x37')]!==_0x90b5('0x38')){var _0x3bf306={};_0x3bf306[_0x2162c1[_0x90b5('0x27')]]={'$like':'%'+_0xfb6d35['query'][_0x90b5('0x34')]+'%'};return _0x3bf306;}})});}_0x2f058b=_[_0x90b5('0x35')]({},_0x2f058b,_0xfb6d35[_0x90b5('0x39')]);var _0x466029={'where':_0x2f058b[_0x90b5('0x36')]};return db[_0x90b5('0x3a')]['count'](_0x466029)[_0x90b5('0x24')](function(_0x89132c){_0x3f1e6b[_0x90b5('0x1f')]=_0x89132c;if(_0xfb6d35[_0x90b5('0x2c')][_0x90b5('0x3b')]){_0x2f058b[_0x90b5('0x3c')]=[{'all':!![]}];}return db[_0x90b5('0x3a')][_0x90b5('0x3d')](_0x2f058b);})[_0x90b5('0x24')](function(_0x400861){_0x3f1e6b[_0x90b5('0x3e')]=_0x400861;return _0x3f1e6b;})[_0x90b5('0x24')](respondWithFilteredResult(_0x3417b7,_0x2f058b))[_0x90b5('0x3f')](handleError(_0x3417b7,null));};exports['show']=function(_0x1f19ca,_0x3244c3){var _0x5c9f41={'raw':![],'where':{'id':_0x1f19ca[_0x90b5('0x40')]['id']}},_0x3dd7e3={};_0x3dd7e3['model']=_[_0x90b5('0x41')](db[_0x90b5('0x3a')]['rawAttributes']);_0x3dd7e3[_0x90b5('0x2c')]=_[_0x90b5('0x41')](_0x1f19ca[_0x90b5('0x2c')]);_0x3dd7e3[_0x90b5('0x33')]=_[_0x90b5('0x2d')](_0x3dd7e3[_0x90b5('0x2b')],_0x3dd7e3[_0x90b5('0x2c')]);_0x5c9f41['attributes']=_[_0x90b5('0x2d')](_0x3dd7e3[_0x90b5('0x2b')],qs[_0x90b5('0x2f')](_0x1f19ca['query'][_0x90b5('0x2f')]));_0x5c9f41[_0x90b5('0x2e')]=_0x5c9f41[_0x90b5('0x2e')][_0x90b5('0x30')]?_0x5c9f41[_0x90b5('0x2e')]:_0x3dd7e3['model'];if(_0x1f19ca[_0x90b5('0x2c')]['includeAll']){_0x5c9f41[_0x90b5('0x3c')]=[{'all':!![]}];}_0x5c9f41=_[_0x90b5('0x35')]({},_0x5c9f41,_0x1f19ca['options']);return db['AnalyticFieldReport']['find'](_0x5c9f41)[_0x90b5('0x24')](handleEntityNotFound(_0x3244c3,null))[_0x90b5('0x24')](respondWithResult(_0x3244c3,null))[_0x90b5('0x3f')](handleError(_0x3244c3,null));};exports[_0x90b5('0x42')]=function(_0x52071d,_0x570433){return db['AnalyticFieldReport'][_0x90b5('0x42')](_0x52071d['body'],{})[_0x90b5('0x24')](respondWithResult(_0x570433,0xc9))[_0x90b5('0x3f')](handleError(_0x570433,null));};exports[_0x90b5('0x43')]=function(_0xb6e68c,_0x1ca603){return db[_0x90b5('0x3a')][_0x90b5('0x43')](_0xb6e68c['body'],{'raw':![],'individualHooks':!![]})[_0x90b5('0x24')](respondWithResult(_0x1ca603,0xc9))[_0x90b5('0x3f')](handleError(_0x1ca603,null));};exports[_0x90b5('0x23')]=function(_0x55fe18,_0x282f64){if(_0x55fe18[_0x90b5('0x44')]['id']){delete _0x55fe18['body']['id'];}return db[_0x90b5('0x3a')]['find']({'where':{'id':_0x55fe18[_0x90b5('0x40')]['id']}})[_0x90b5('0x24')](handleEntityNotFound(_0x282f64,null))['then'](saveUpdates(_0x55fe18[_0x90b5('0x44')],null))['then'](respondWithResult(_0x282f64,null))['catch'](handleError(_0x282f64,null));};exports['destroy']=function(_0x5318c6,_0x572f49){return db['AnalyticFieldReport'][_0x90b5('0x45')]({'where':{'id':_0x5318c6['params']['id']}})[_0x90b5('0x24')](handleEntityNotFound(_0x572f49,null))[_0x90b5('0x24')](removeEntity(_0x572f49,null))[_0x90b5('0x3f')](handleError(_0x572f49,null));};exports[_0x90b5('0x46')]=function(_0x495a3d,_0x20eb5f){return db[_0x90b5('0x3a')][_0x90b5('0x47')]({'where':{'id':_0x495a3d[_0x90b5('0x2c')][_0x90b5('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x90b5('0x24')](respondWithResult(_0x20eb5f,0xcc))['catch'](handleError(_0x20eb5f,null));};exports[_0x90b5('0x49')]=function(_0x3ef77f,_0x45409d,_0x251ea5){return db['AnalyticCustomReport'][_0x90b5('0x4a')]({'where':{'id':_0x3ef77f[_0x90b5('0x40')]['id']}})[_0x90b5('0x24')](handleEntityNotFound(_0x45409d,null))['then'](function(_0xa9d77){if(_0xa9d77){return db[_0x90b5('0x4b')][_0x90b5('0x4c')](function(_0x4276e7){return db['AnalyticFieldReport'][_0x90b5('0x47')]({'where':{'CustomReportId':_0x3ef77f['params']['id']},'transaction':_0x4276e7})[_0x90b5('0x24')](function(_0x58615b){var _0x24ec7b=_[_0x90b5('0x29')](_0x3ef77f['body'],function(_0x264357){delete _0x264357['id'];_0x264357['CustomReportId']=_0x3ef77f['params']['id'];return _0x264357;});return db[_0x90b5('0x3a')][_0x90b5('0x43')](_0x24ec7b,{'transaction':_0x4276e7});});})['then'](function(){return db[_0x90b5('0x3a')][_0x90b5('0x3d')]({'where':{'CustomReportId':_0x3ef77f['params']['id']}});});}})[_0x90b5('0x24')](respondWithResult(_0x45409d,null))[_0x90b5('0x3f')](handleError(_0x45409d,null));};
\ No newline at end of file
+var _0xe4ff=['order','sort','filter','where','type','merge','includeAll','include','findAll','rows','catch','params','find','body','bulkCreate','bulkDestroy','findOne','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x363876,_0x1359e2){var _0x3cb88e=function(_0x510281){while(--_0x510281){_0x363876['push'](_0x363876['shift']());}};_0x3cb88e(++_0x1359e2);}(_0xe4ff,0x105));var _0xfe4f=function(_0x81fc31,_0x151260){_0x81fc31=_0x81fc31-0x0;var _0x3c1234=_0xe4ff[_0x81fc31];return _0x3c1234;};'use strict';var emlformat=require(_0xfe4f('0x0'));var rimraf=require(_0xfe4f('0x1'));var zipdir=require(_0xfe4f('0x2'));var jsonpatch=require(_0xfe4f('0x3'));var rp=require(_0xfe4f('0x4'));var moment=require(_0xfe4f('0x5'));var BPromise=require(_0xfe4f('0x6'));var Mustache=require(_0xfe4f('0x7'));var util=require(_0xfe4f('0x8'));var path=require(_0xfe4f('0x9'));var sox=require(_0xfe4f('0xa'));var csv=require(_0xfe4f('0xb'));var ejs=require(_0xfe4f('0xc'));var fs=require('fs');var fs_extra=require(_0xfe4f('0xd'));var _=require(_0xfe4f('0xe'));var squel=require(_0xfe4f('0xf'));var crypto=require(_0xfe4f('0x10'));var jsforce=require(_0xfe4f('0x11'));var deskjs=require(_0xfe4f('0x12'));var toCsv=require(_0xfe4f('0xb'));var querystring=require(_0xfe4f('0x13'));var Papa=require(_0xfe4f('0x14'));var Redis=require(_0xfe4f('0x15'));var authService=require(_0xfe4f('0x16'));var qs=require(_0xfe4f('0x17'));var as=require(_0xfe4f('0x18'));var hardwareService=require(_0xfe4f('0x19'));var logger=require(_0xfe4f('0x1a'))(_0xfe4f('0x1b'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16b383,_0x461928){_0x461928=_0x461928||0xcc;return function(_0x39c182){if(_0x39c182){return _0x16b383[_0xfe4f('0x1c')](_0x461928);}return _0x16b383[_0xfe4f('0x1d')](_0x461928)[_0xfe4f('0x1e')]();};}function respondWithResult(_0x4c687c,_0x3b7207){_0x3b7207=_0x3b7207||0xc8;return function(_0x39119f){if(_0x39119f){return _0x4c687c['status'](_0x3b7207)['json'](_0x39119f);}};}function respondWithFilteredResult(_0x346e63,_0x13aa3c){return function(_0x30cfd2){if(_0x30cfd2){var _0x5115da=typeof _0x13aa3c[_0xfe4f('0x1f')]===_0xfe4f('0x20')&&typeof _0x13aa3c['limit']===_0xfe4f('0x20');var _0x44542f=_0x30cfd2[_0xfe4f('0x21')];var _0x2abe42=_0x5115da?0x0:_0x13aa3c[_0xfe4f('0x1f')];var _0x12af4a=_0x5115da?_0x30cfd2[_0xfe4f('0x21')]:_0x13aa3c[_0xfe4f('0x1f')]+_0x13aa3c[_0xfe4f('0x22')];var _0x14c22c;if(_0x12af4a>=_0x44542f){_0x12af4a=_0x44542f;_0x14c22c=0xc8;}else{_0x14c22c=0xce;}_0x346e63[_0xfe4f('0x1d')](_0x14c22c);return _0x346e63[_0xfe4f('0x23')](_0xfe4f('0x24'),_0x2abe42+'-'+_0x12af4a+'/'+_0x44542f)[_0xfe4f('0x25')](_0x30cfd2);}return null;};}function patchUpdates(_0x78e1f3){return function(_0x13d119){try{jsonpatch[_0xfe4f('0x26')](_0x13d119,_0x78e1f3,!![]);}catch(_0x389f34){return BPromise[_0xfe4f('0x27')](_0x389f34);}return _0x13d119[_0xfe4f('0x28')]();};}function saveUpdates(_0x3daf8a,_0x372bc0){return function(_0x2dd045){if(_0x2dd045){return _0x2dd045[_0xfe4f('0x29')](_0x3daf8a)[_0xfe4f('0x2a')](function(_0x436f30){return _0x436f30;});}return null;};}function removeEntity(_0x574119,_0x59b18d){return function(_0x1621e4){if(_0x1621e4){return _0x1621e4[_0xfe4f('0x2b')]()[_0xfe4f('0x2a')](function(){_0x574119['status'](0xcc)[_0xfe4f('0x1e')]();});}};}function handleEntityNotFound(_0xe10e5c,_0x1240aa){return function(_0x55a2dd){if(!_0x55a2dd){_0xe10e5c[_0xfe4f('0x1c')](0x194);}return _0x55a2dd;};}function handleError(_0x54e6d9,_0x5b0a2c){_0x5b0a2c=_0x5b0a2c||0x1f4;return function(_0x35baef){logger['error'](_0x35baef[_0xfe4f('0x2c')]);if(_0x35baef[_0xfe4f('0x2d')]){delete _0x35baef['name'];}_0x54e6d9[_0xfe4f('0x1d')](_0x5b0a2c)[_0xfe4f('0x2e')](_0x35baef);};}exports[_0xfe4f('0x2f')]=function(_0x3533ce,_0xf5e21f){var _0x875493={},_0xa4795f={},_0x385d77={'count':0x0,'rows':[]};var _0x1dadd0=_['map'](db[_0xfe4f('0x30')][_0xfe4f('0x31')],function(_0x2b965b){return{'name':_0x2b965b[_0xfe4f('0x32')],'type':_0x2b965b['type'][_0xfe4f('0x33')]};});_0xa4795f[_0xfe4f('0x34')]=_[_0xfe4f('0x35')](_0x1dadd0,_0xfe4f('0x2d'));_0xa4795f[_0xfe4f('0x36')]=_[_0xfe4f('0x37')](_0x3533ce[_0xfe4f('0x36')]);_0xa4795f[_0xfe4f('0x38')]=_[_0xfe4f('0x39')](_0xa4795f['model'],_0xa4795f[_0xfe4f('0x36')]);_0x875493[_0xfe4f('0x3a')]=_[_0xfe4f('0x39')](_0xa4795f[_0xfe4f('0x34')],qs['fields'](_0x3533ce[_0xfe4f('0x36')][_0xfe4f('0x3b')]));_0x875493['attributes']=_0x875493['attributes'][_0xfe4f('0x3c')]?_0x875493[_0xfe4f('0x3a')]:_0xa4795f['model'];if(!_0x3533ce['query'][_0xfe4f('0x3d')](_0xfe4f('0x3e'))){_0x875493['limit']=qs['limit'](_0x3533ce[_0xfe4f('0x36')][_0xfe4f('0x22')]);_0x875493[_0xfe4f('0x1f')]=qs[_0xfe4f('0x1f')](_0x3533ce[_0xfe4f('0x36')][_0xfe4f('0x1f')]);}_0x875493[_0xfe4f('0x3f')]=qs[_0xfe4f('0x40')](_0x3533ce[_0xfe4f('0x36')][_0xfe4f('0x40')]);_0x875493['where']=qs[_0xfe4f('0x38')](_['pick'](_0x3533ce[_0xfe4f('0x36')],_0xa4795f[_0xfe4f('0x38')]),_0x1dadd0);if(_0x3533ce[_0xfe4f('0x36')][_0xfe4f('0x41')]){_0x875493[_0xfe4f('0x42')]=_['merge'](_0x875493['where'],{'$or':_[_0xfe4f('0x35')](_0x1dadd0,function(_0x346b95){if(_0x346b95[_0xfe4f('0x43')]!=='VIRTUAL'){var _0x11b6f1={};_0x11b6f1[_0x346b95[_0xfe4f('0x2d')]]={'$like':'%'+_0x3533ce['query']['filter']+'%'};return _0x11b6f1;}})});}_0x875493=_[_0xfe4f('0x44')]({},_0x875493,_0x3533ce['options']);var _0x2b0db4={'where':_0x875493[_0xfe4f('0x42')]};return db[_0xfe4f('0x30')][_0xfe4f('0x21')](_0x2b0db4)['then'](function(_0x46149d){_0x385d77['count']=_0x46149d;if(_0x3533ce[_0xfe4f('0x36')][_0xfe4f('0x45')]){_0x875493[_0xfe4f('0x46')]=[{'all':!![]}];}return db[_0xfe4f('0x30')][_0xfe4f('0x47')](_0x875493);})[_0xfe4f('0x2a')](function(_0x1d6e37){_0x385d77[_0xfe4f('0x48')]=_0x1d6e37;return _0x385d77;})[_0xfe4f('0x2a')](respondWithFilteredResult(_0xf5e21f,_0x875493))[_0xfe4f('0x49')](handleError(_0xf5e21f,null));};exports['show']=function(_0x24900b,_0x20f374){var _0x55b938={'raw':![],'where':{'id':_0x24900b[_0xfe4f('0x4a')]['id']}},_0x291009={};_0x291009['model']=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x291009['query']=_[_0xfe4f('0x37')](_0x24900b[_0xfe4f('0x36')]);_0x291009['filters']=_['intersection'](_0x291009[_0xfe4f('0x34')],_0x291009['query']);_0x55b938['attributes']=_[_0xfe4f('0x39')](_0x291009[_0xfe4f('0x34')],qs[_0xfe4f('0x3b')](_0x24900b[_0xfe4f('0x36')][_0xfe4f('0x3b')]));_0x55b938[_0xfe4f('0x3a')]=_0x55b938[_0xfe4f('0x3a')][_0xfe4f('0x3c')]?_0x55b938[_0xfe4f('0x3a')]:_0x291009[_0xfe4f('0x34')];if(_0x24900b['query'][_0xfe4f('0x45')]){_0x55b938[_0xfe4f('0x46')]=[{'all':!![]}];}_0x55b938=_[_0xfe4f('0x44')]({},_0x55b938,_0x24900b['options']);return db[_0xfe4f('0x30')][_0xfe4f('0x4b')](_0x55b938)[_0xfe4f('0x2a')](handleEntityNotFound(_0x20f374,null))['then'](respondWithResult(_0x20f374,null))['catch'](handleError(_0x20f374,null));};exports['create']=function(_0x4d45c0,_0x2d135f){return db['AnalyticFieldReport']['create'](_0x4d45c0[_0xfe4f('0x4c')],{})['then'](respondWithResult(_0x2d135f,0xc9))[_0xfe4f('0x49')](handleError(_0x2d135f,null));};exports['bulkCreate']=function(_0x491e5b,_0x32d56d){return db[_0xfe4f('0x30')][_0xfe4f('0x4d')](_0x491e5b[_0xfe4f('0x4c')],{'raw':![],'individualHooks':!![]})[_0xfe4f('0x2a')](respondWithResult(_0x32d56d,0xc9))[_0xfe4f('0x49')](handleError(_0x32d56d,null));};exports['update']=function(_0x1fc284,_0x1e40ba){if(_0x1fc284['body']['id']){delete _0x1fc284[_0xfe4f('0x4c')]['id'];}return db[_0xfe4f('0x30')][_0xfe4f('0x4b')]({'where':{'id':_0x1fc284[_0xfe4f('0x4a')]['id']}})[_0xfe4f('0x2a')](handleEntityNotFound(_0x1e40ba,null))[_0xfe4f('0x2a')](saveUpdates(_0x1fc284[_0xfe4f('0x4c')],null))[_0xfe4f('0x2a')](respondWithResult(_0x1e40ba,null))['catch'](handleError(_0x1e40ba,null));};exports[_0xfe4f('0x2b')]=function(_0x54793e,_0x287946){return db[_0xfe4f('0x30')][_0xfe4f('0x4b')]({'where':{'id':_0x54793e[_0xfe4f('0x4a')]['id']}})[_0xfe4f('0x2a')](handleEntityNotFound(_0x287946,null))[_0xfe4f('0x2a')](removeEntity(_0x287946,null))['catch'](handleError(_0x287946,null));};exports[_0xfe4f('0x4e')]=function(_0x32a619,_0x582625){return db[_0xfe4f('0x30')][_0xfe4f('0x2b')]({'where':{'id':_0x32a619['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x582625,0xcc))[_0xfe4f('0x49')](handleError(_0x582625,null));};exports['addFields']=function(_0x4a363a,_0x19f577,_0x1bddba){return db['AnalyticCustomReport'][_0xfe4f('0x4f')]({'where':{'id':_0x4a363a[_0xfe4f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x19f577,null))[_0xfe4f('0x2a')](function(_0xd2789b){if(_0xd2789b){return db[_0xfe4f('0x50')]['transaction'](function(_0x4a5f15){return db[_0xfe4f('0x30')][_0xfe4f('0x2b')]({'where':{'CustomReportId':_0x4a363a[_0xfe4f('0x4a')]['id']},'transaction':_0x4a5f15})['then'](function(_0x5efb65){var _0x58af8f=_[_0xfe4f('0x35')](_0x4a363a['body'],function(_0x20f828){delete _0x20f828['id'];_0x20f828['CustomReportId']=_0x4a363a[_0xfe4f('0x4a')]['id'];return _0x20f828;});return db[_0xfe4f('0x30')][_0xfe4f('0x4d')](_0x58af8f,{'transaction':_0x4a5f15});});})[_0xfe4f('0x2a')](function(){return db[_0xfe4f('0x30')]['findAll']({'where':{'CustomReportId':_0x4a363a[_0xfe4f('0x4a')]['id']}});});}})[_0xfe4f('0x2a')](respondWithResult(_0x19f577,null))[_0xfe4f('0x49')](handleError(_0x19f577,null));};
\ No newline at end of file
index b56c5ab..c6de6d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffd5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash'];(function(_0x4a66c1,_0x9458cb){var _0x22cd9e=function(_0x5a678a){while(--_0x5a678a){_0x4a66c1['push'](_0x4a66c1['shift']());}};_0x22cd9e(++_0x9458cb);}(_0xffd5,0xf6));var _0x5ffd=function(_0x37e886,_0x17d0ad){_0x37e886=_0x37e886-0x0;var _0x57c5cd=_0xffd5[_0x37e886];return _0x57c5cd;};'use strict';var _=require(_0x5ffd('0x0'));var util=require(_0x5ffd('0x1'));var logger=require(_0x5ffd('0x2'))(_0x5ffd('0x3'));var moment=require(_0x5ffd('0x4'));var BPromise=require(_0x5ffd('0x5'));var rp=require(_0x5ffd('0x6'));var fs=require('fs');var path=require(_0x5ffd('0x7'));var rimraf=require(_0x5ffd('0x8'));var config=require('../../config/environment');var attributes=require(_0x5ffd('0x9'));module['exports']=function(_0x16a090,_0x313b10){return _0x16a090[_0x5ffd('0xa')](_0x5ffd('0xb'),attributes,{'tableName':_0x5ffd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x61bb=['moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','api'];(function(_0x82e51,_0x555658){var _0x4ceef2=function(_0x5653f7){while(--_0x5653f7){_0x82e51['push'](_0x82e51['shift']());}};_0x4ceef2(++_0x555658);}(_0x61bb,0xd6));var _0xb61b=function(_0x5f46c2,_0x241a00){_0x5f46c2=_0x5f46c2-0x0;var _0xd6da55=_0x61bb[_0x5f46c2];return _0xd6da55;};'use strict';var _=require('lodash');var util=require(_0xb61b('0x0'));var logger=require('../../config/logger')(_0xb61b('0x1'));var moment=require(_0xb61b('0x2'));var BPromise=require(_0xb61b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb61b('0x4'));var rimraf=require(_0xb61b('0x5'));var config=require(_0xb61b('0x6'));var attributes=require(_0xb61b('0x7'));module[_0xb61b('0x8')]=function(_0x5e8276,_0x43e40b){return _0x5e8276[_0xb61b('0x9')](_0xb61b('0xa'),attributes,{'tableName':_0xb61b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b45b4bf..0eb830e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0723=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0723,0xbf));var _0x3072=function(_0x5521e6,_0x2fed18){_0x5521e6=_0x5521e6-0x0;var _0x2147e8=_0x0723[_0x5521e6];return _0x2147e8;};'use strict';var _=require(_0x3072('0x0'));var util=require(_0x3072('0x1'));var moment=require(_0x3072('0x2'));var BPromise=require(_0x3072('0x3'));var rs=require(_0x3072('0x4'));var fs=require('fs');var Redis=require(_0x3072('0x5'));var db=require(_0x3072('0x6'))['db'];var utils=require(_0x3072('0x7'));var logger=require('../../config/logger')(_0x3072('0x8'));var config=require(_0x3072('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3072('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481c09,_0x41474b,_0x3d72a8){return new BPromise(function(_0x5d31f6,_0x124497){return client[_0x3072('0xb')](_0x481c09,_0x3d72a8)[_0x3072('0xc')](function(_0x2d8f8c){logger[_0x3072('0xd')](_0x3072('0xe'),_0x41474b,_0x3072('0xf'));logger[_0x3072('0x10')](_0x3072('0x11'),_0x41474b,_0x3072('0xf'),JSON[_0x3072('0x12')](_0x2d8f8c));if(_0x2d8f8c[_0x3072('0x13')]){if(_0x2d8f8c[_0x3072('0x13')][_0x3072('0x14')]===0x1f4){logger[_0x3072('0x13')](_0x3072('0xe'),_0x41474b,_0x2d8f8c[_0x3072('0x13')]['message']);return _0x124497(_0x2d8f8c['error'][_0x3072('0x15')]);}logger[_0x3072('0x13')](_0x3072('0xe'),_0x41474b,_0x2d8f8c[_0x3072('0x13')][_0x3072('0x15')]);return _0x5d31f6(_0x2d8f8c[_0x3072('0x13')][_0x3072('0x15')]);}else{logger[_0x3072('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x41474b,_0x3072('0xf'));_0x5d31f6(_0x2d8f8c[_0x3072('0x16')][_0x3072('0x15')]);}})['catch'](function(_0x1d3b0f){logger['error'](_0x3072('0xe'),_0x41474b,_0x1d3b0f);_0x124497(_0x1d3b0f);});});}
\ No newline at end of file
+var _0x2bb7=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','lodash','util'];(function(_0x2d0d9f,_0x22c0d8){var _0x30243d=function(_0x29a92b){while(--_0x29a92b){_0x2d0d9f['push'](_0x2d0d9f['shift']());}};_0x30243d(++_0x22c0d8);}(_0x2bb7,0x167));var _0x72bb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2bb7[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x72bb('0x0'));var util=require(_0x72bb('0x1'));var moment=require(_0x72bb('0x2'));var BPromise=require(_0x72bb('0x3'));var rs=require(_0x72bb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72bb('0x5'))['db'];var utils=require(_0x72bb('0x6'));var logger=require('../../config/logger')(_0x72bb('0x7'));var config=require(_0x72bb('0x8'));var jayson=require(_0x72bb('0x9'));var client=jayson['client'][_0x72bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ed422,_0x13dfba,_0xf7b152){return new BPromise(function(_0x1866df,_0xc29d15){return client[_0x72bb('0xb')](_0x3ed422,_0xf7b152)[_0x72bb('0xc')](function(_0x2ce62){logger['info'](_0x72bb('0xd'),_0x13dfba,'request\x20sent');logger[_0x72bb('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x13dfba,_0x72bb('0xf'),JSON['stringify'](_0x2ce62));if(_0x2ce62[_0x72bb('0x10')]){if(_0x2ce62[_0x72bb('0x10')]['code']===0x1f4){logger['error'](_0x72bb('0xd'),_0x13dfba,_0x2ce62[_0x72bb('0x10')][_0x72bb('0x11')]);return _0xc29d15(_0x2ce62[_0x72bb('0x10')]['message']);}logger[_0x72bb('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x13dfba,_0x2ce62['error'][_0x72bb('0x11')]);return _0x1866df(_0x2ce62['error'][_0x72bb('0x11')]);}else{logger['info'](_0x72bb('0xd'),_0x13dfba,_0x72bb('0xf'));_0x1866df(_0x2ce62['result'][_0x72bb('0x11')]);}})[_0x72bb('0x12')](function(_0x2d3512){logger[_0x72bb('0x10')](_0x72bb('0xd'),_0x13dfba,_0x2d3512);_0xc29d15(_0x2d3512);});});}
\ No newline at end of file
index a90ba50..fd17617 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(_0x40c2e7,_0x256674){var _0x8509c4=function(_0x1d77b8){while(--_0x1d77b8){_0x40c2e7['push'](_0x40c2e7['shift']());}};_0x8509c4(++_0x256674);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x43bb7a,_0x33447e){var _0x19a198=function(_0x43fa58){while(--_0x43fa58){_0x43bb7a['push'](_0x43bb7a['shift']());}};_0x19a198(++_0x33447e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 2e2b18f..ab0e21b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf257=['TEXT','STRING','name'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xf257,0x82));var _0x7f25=function(_0x4101ab,_0x1777e6){_0x4101ab=_0x4101ab-0x0;var _0x4eaf40=_0xf257[_0x4101ab];return _0x4eaf40;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7f25('0x0')],'allowNull':![],'unique':_0x7f25('0x1')},'table':{'type':Sequelize[_0x7f25('0x0')]},'metric':{'type':Sequelize[_0x7f25('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x688a=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x688a,0x124));var _0xa688=function(_0x2749ce,_0x54fe04){_0x2749ce=_0x2749ce-0x0;var _0x293a07=_0x688a[_0x2749ce];return _0x293a07;};'use strict';var Sequelize=require(_0xa688('0x0'));module[_0xa688('0x1')]={'name':{'type':Sequelize[_0xa688('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xa688('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xa688('0x2')]}};
\ No newline at end of file
index 6a017ad..4d17c51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x153863,_0x41363d){var _0x3bfc32=function(_0x146041){while(--_0x146041){_0x153863['push'](_0x153863['shift']());}};_0x3bfc32(++_0x41363d);}(_0x008c,0x188));var _0xc008=function(_0x4453a9,_0x217f6c){_0x4453a9=_0x4453a9-0x0;var _0x2828ea=_0x008c[_0x4453a9];return _0x2828ea;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x592ae5,_0x20524b){var _0x20b7be=function(_0x3628ba){while(--_0x3628ba){_0x592ae5['push'](_0x592ae5['shift']());}};_0x20b7be(++_0x20524b);}(_0x4b84,0x1cc));var _0x44b8=function(_0xf1af27,_0x598bb1){_0xf1af27=_0xf1af27-0x0;var _0x46b274=_0x4b84[_0xf1af27];return _0x46b274;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
index 269fb68..e70e72e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15c6=['util','../../config/logger','api','moment','bluebird','request-promise','path','exports','AnalyticMetric','analytics_metrics','lodash'];(function(_0x4bd864,_0x4fb3c8){var _0x4e5732=function(_0x4e7649){while(--_0x4e7649){_0x4bd864['push'](_0x4bd864['shift']());}};_0x4e5732(++_0x4fb3c8);}(_0x15c6,0x1cd));var _0x615c=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0x15c6[_0x4de9e8];return _0x4db0de;};'use strict';var _=require(_0x615c('0x0'));var util=require(_0x615c('0x1'));var logger=require(_0x615c('0x2'))(_0x615c('0x3'));var moment=require(_0x615c('0x4'));var BPromise=require(_0x615c('0x5'));var rp=require(_0x615c('0x6'));var fs=require('fs');var path=require(_0x615c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x615c('0x8')]=function(_0x29de56,_0x15eee5){return _0x29de56['define'](_0x615c('0x9'),attributes,{'tableName':_0x615c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf70=['../../config/environment','./analyticMetric.attributes','define','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x2787d6,_0x441509){var _0x3e9e4a=function(_0x57f6a2){while(--_0x57f6a2){_0x2787d6['push'](_0x2787d6['shift']());}};_0x3e9e4a(++_0x441509);}(_0xdf70,0x86));var _0x0df7=function(_0xf3bc24,_0x1be6df){_0xf3bc24=_0xf3bc24-0x0;var _0x1d0280=_0xdf70[_0xf3bc24];return _0x1d0280;};'use strict';var _=require(_0x0df7('0x0'));var util=require(_0x0df7('0x1'));var logger=require(_0x0df7('0x2'))('api');var moment=require(_0x0df7('0x3'));var BPromise=require(_0x0df7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0df7('0x5'));var rimraf=require('rimraf');var config=require(_0x0df7('0x6'));var attributes=require(_0x0df7('0x7'));module['exports']=function(_0x523ac0,_0x2521b6){return _0x523ac0[_0x0df7('0x8')]('AnalyticMetric',attributes,{'tableName':_0x0df7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 941563d..f9a10f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc80f=['request','info','request\x20sent','debug','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x2e86e4,_0x427265){var _0x596235=function(_0x45a838){while(--_0x45a838){_0x2e86e4['push'](_0x2e86e4['shift']());}};_0x596235(++_0x427265);}(_0xc80f,0x15f));var _0xfc80=function(_0x58953b,_0x3c48ea){_0x58953b=_0x58953b-0x0;var _0xd55dd4=_0xc80f[_0x58953b];return _0xd55dd4;};'use strict';var _=require(_0xfc80('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfc80('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc80('0x2'))['db'];var utils=require(_0xfc80('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc80('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xfc80('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40cce9,_0x1ee26b,_0x38fa0d){return new BPromise(function(_0x325adc,_0xfdea39){return client[_0xfc80('0x6')](_0x40cce9,_0x38fa0d)['then'](function(_0x4a40c1){logger[_0xfc80('0x7')]('AnalyticMetric,\x20%s,\x20%s',_0x1ee26b,_0xfc80('0x8'));logger[_0xfc80('0x9')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1ee26b,_0xfc80('0x8'),JSON[_0xfc80('0xa')](_0x4a40c1));if(_0x4a40c1[_0xfc80('0xb')]){if(_0x4a40c1[_0xfc80('0xb')][_0xfc80('0xc')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x1ee26b,_0x4a40c1[_0xfc80('0xb')][_0xfc80('0xd')]);return _0xfdea39(_0x4a40c1[_0xfc80('0xb')][_0xfc80('0xd')]);}logger[_0xfc80('0xb')](_0xfc80('0xe'),_0x1ee26b,_0x4a40c1[_0xfc80('0xb')][_0xfc80('0xd')]);return _0x325adc(_0x4a40c1[_0xfc80('0xb')][_0xfc80('0xd')]);}else{logger[_0xfc80('0x7')](_0xfc80('0xe'),_0x1ee26b,_0xfc80('0x8'));_0x325adc(_0x4a40c1[_0xfc80('0xf')][_0xfc80('0xd')]);}})[_0xfc80('0x10')](function(_0x5502c1){logger[_0xfc80('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x1ee26b,_0x5502c1);_0xfdea39(_0x5502c1);});});}
\ No newline at end of file
+var _0x6ae6=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug'];(function(_0x2383c9,_0x4c188f){var _0x1fe3a3=function(_0x5f4e18){while(--_0x5f4e18){_0x2383c9['push'](_0x2383c9['shift']());}};_0x1fe3a3(++_0x4c188f);}(_0x6ae6,0x9a));var _0x66ae=function(_0x4d0662,_0x145963){_0x4d0662=_0x4d0662-0x0;var _0x6eea6d=_0x6ae6[_0x4d0662];return _0x6eea6d;};'use strict';var _=require(_0x66ae('0x0'));var util=require(_0x66ae('0x1'));var moment=require(_0x66ae('0x2'));var BPromise=require('bluebird');var rs=require(_0x66ae('0x3'));var fs=require('fs');var Redis=require(_0x66ae('0x4'));var db=require(_0x66ae('0x5'))['db'];var utils=require(_0x66ae('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x66ae('0x7'));var jayson=require(_0x66ae('0x8'));var client=jayson[_0x66ae('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe91128,_0x8f060b,_0xb4e412){return new BPromise(function(_0x3be814,_0xb7f96e){return client[_0x66ae('0xa')](_0xe91128,_0xb4e412)[_0x66ae('0xb')](function(_0xb80a85){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x8f060b,_0x66ae('0xc'));logger[_0x66ae('0xd')](_0x66ae('0xe'),_0x8f060b,'request\x20sent',JSON[_0x66ae('0xf')](_0xb80a85));if(_0xb80a85[_0x66ae('0x10')]){if(_0xb80a85['error'][_0x66ae('0x11')]===0x1f4){logger[_0x66ae('0x10')](_0x66ae('0x12'),_0x8f060b,_0xb80a85[_0x66ae('0x10')][_0x66ae('0x13')]);return _0xb7f96e(_0xb80a85[_0x66ae('0x10')][_0x66ae('0x13')]);}logger[_0x66ae('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x8f060b,_0xb80a85[_0x66ae('0x10')][_0x66ae('0x13')]);return _0x3be814(_0xb80a85[_0x66ae('0x10')][_0x66ae('0x13')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x8f060b,_0x66ae('0xc'));_0x3be814(_0xb80a85[_0x66ae('0x14')][_0x66ae('0x13')]);}})['catch'](function(_0x3e7be4){logger[_0x66ae('0x10')](_0x66ae('0x12'),_0x8f060b,_0x3e7be4);_0xb7f96e(_0x3e7be4);});});}
\ No newline at end of file
index 3a0f138..86c41a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4b8=['../../config/environment','./analyticMetric.controller','get','index','/:id','put','isAuthenticated','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1f6692,_0x456858){var _0x21811c=function(_0x59686d){while(--_0x59686d){_0x1f6692['push'](_0x1f6692['shift']());}};_0x21811c(++_0x456858);}(_0xe4b8,0x179));var _0x8e4b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe4b8[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x8e4b('0x0'));var util=require(_0x8e4b('0x1'));var path=require(_0x8e4b('0x2'));var timeout=require(_0x8e4b('0x3'));var express=require(_0x8e4b('0x4'));var router=express[_0x8e4b('0x5')]();var fs_extra=require(_0x8e4b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8e4b('0x7'));var controller=require(_0x8e4b('0x8'));router[_0x8e4b('0x9')]('/',auth['isAuthenticated'](),controller[_0x8e4b('0xa')]);router['get'](_0x8e4b('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8e4b('0xc')]('/:id',auth[_0x8e4b('0xd')](),controller[_0x8e4b('0xe')]);router['delete'](_0x8e4b('0xb'),auth[_0x8e4b('0xd')](),controller[_0x8e4b('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x79a8=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','update','multer'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x79a8,0x1d0));var _0x879a=function(_0x37e8e8,_0x1be63e){_0x37e8e8=_0x37e8e8-0x0;var _0x2c3c9e=_0x79a8[_0x37e8e8];return _0x2c3c9e;};'use strict';var multer=require(_0x879a('0x0'));var util=require('util');var path=require(_0x879a('0x1'));var timeout=require(_0x879a('0x2'));var express=require(_0x879a('0x3'));var router=express['Router']();var fs_extra=require(_0x879a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var controller=require(_0x879a('0x7'));router[_0x879a('0x8')]('/',auth[_0x879a('0x9')](),controller[_0x879a('0xa')]);router[_0x879a('0x8')](_0x879a('0xb'),auth['isAuthenticated'](),controller[_0x879a('0xc')]);router['post']('/',auth[_0x879a('0x9')](),controller[_0x879a('0xd')]);router['put'](_0x879a('0xb'),auth[_0x879a('0x9')](),controller[_0x879a('0xe')]);router['delete'](_0x879a('0xb'),auth[_0x879a('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4f07284..905897c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabf5=['sequelize','exports','TEXT'];(function(_0x5d09d9,_0x181abf){var _0x7ce182=function(_0x369277){while(--_0x369277){_0x5d09d9['push'](_0x5d09d9['shift']());}};_0x7ce182(++_0x181abf);}(_0xabf5,0x17d));var _0x5abf=function(_0x36ba5,_0x1960fb){_0x36ba5=_0x36ba5-0x0;var _0xde4d28=_0xabf5[_0x36ba5];return _0xde4d28;};'use strict';var Sequelize=require(_0x5abf('0x0'));module[_0x5abf('0x1')]={'tree':{'type':Sequelize[_0x5abf('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x4e83=['exports','TEXT'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4e83,0x88));var _0x34e8=function(_0x49b0bf,_0x2c50e9){_0x49b0bf=_0x49b0bf-0x0;var _0x4e6b5c=_0x4e83[_0x49b0bf];return _0x4e6b5c;};'use strict';var Sequelize=require('sequelize');module[_0x34e8('0x0')]={'tree':{'type':Sequelize[_0x34e8('0x1')],'allowNull':![]}};
\ No newline at end of file
index 6315dc9..b2dd4ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a1=['jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','map','VIRTUAL','merge','includeAll','include','AnalyticTreeReport','findAll','rows','catch','show','options','create','body','destroy','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3e7804,_0x121853){var _0x56efda=function(_0x1996f3){while(--_0x1996f3){_0x3e7804['push'](_0x3e7804['shift']());}};_0x56efda(++_0x121853);}(_0x91a1,0x124));var _0x191a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91a1[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x191a('0x0'));var rimraf=require(_0x191a('0x1'));var zipdir=require(_0x191a('0x2'));var jsonpatch=require(_0x191a('0x3'));var rp=require(_0x191a('0x4'));var moment=require(_0x191a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x191a('0x6'));var util=require(_0x191a('0x7'));var path=require(_0x191a('0x8'));var sox=require(_0x191a('0x9'));var csv=require(_0x191a('0xa'));var ejs=require(_0x191a('0xb'));var fs=require('fs');var fs_extra=require(_0x191a('0xc'));var _=require(_0x191a('0xd'));var squel=require(_0x191a('0xe'));var crypto=require(_0x191a('0xf'));var jsforce=require(_0x191a('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x191a('0x11'));var Papa=require(_0x191a('0x12'));var Redis=require(_0x191a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x191a('0x14'));var hardwareService=require(_0x191a('0x15'));var logger=require(_0x191a('0x16'))(_0x191a('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x191a('0x18'));var db=require(_0x191a('0x19'))['db'];function respondWithStatusCode(_0x4d15c3,_0x221226){_0x221226=_0x221226||0xcc;return function(_0x22d3e1){if(_0x22d3e1){return _0x4d15c3[_0x191a('0x1a')](_0x221226);}return _0x4d15c3['status'](_0x221226)[_0x191a('0x1b')]();};}function respondWithResult(_0x4c1439,_0x2987b6){_0x2987b6=_0x2987b6||0xc8;return function(_0x4c5a98){if(_0x4c5a98){return _0x4c1439[_0x191a('0x1c')](_0x2987b6)[_0x191a('0x1d')](_0x4c5a98);}};}function respondWithFilteredResult(_0x22eeae,_0x50823e){return function(_0xd6f9e9){if(_0xd6f9e9){var _0x330485=typeof _0x50823e[_0x191a('0x1e')]===_0x191a('0x1f')&&typeof _0x50823e['limit']===_0x191a('0x1f');var _0x298ea7=_0xd6f9e9[_0x191a('0x20')];var _0x349f70=_0x330485?0x0:_0x50823e[_0x191a('0x1e')];var _0x5ef105=_0x330485?_0xd6f9e9['count']:_0x50823e[_0x191a('0x1e')]+_0x50823e[_0x191a('0x21')];var _0x31c548;if(_0x5ef105>=_0x298ea7){_0x5ef105=_0x298ea7;_0x31c548=0xc8;}else{_0x31c548=0xce;}_0x22eeae['status'](_0x31c548);return _0x22eeae[_0x191a('0x22')](_0x191a('0x23'),_0x349f70+'-'+_0x5ef105+'/'+_0x298ea7)['json'](_0xd6f9e9);}return null;};}function patchUpdates(_0x2f9c3d){return function(_0x366336){try{jsonpatch[_0x191a('0x24')](_0x366336,_0x2f9c3d,!![]);}catch(_0x586dab){return BPromise[_0x191a('0x25')](_0x586dab);}return _0x366336[_0x191a('0x26')]();};}function saveUpdates(_0x3fa4fb,_0x11ebe9){return function(_0x5815fb){if(_0x5815fb){return _0x5815fb[_0x191a('0x27')](_0x3fa4fb)[_0x191a('0x28')](function(_0x2067b2){return _0x2067b2;});}return null;};}function removeEntity(_0x42a37f,_0x16b6c3){return function(_0x57d9ce){if(_0x57d9ce){return _0x57d9ce['destroy']()[_0x191a('0x28')](function(){_0x42a37f[_0x191a('0x1c')](0xcc)[_0x191a('0x1b')]();});}};}function handleEntityNotFound(_0x311973,_0x7a926d){return function(_0x3fd1c4){if(!_0x3fd1c4){_0x311973['sendStatus'](0x194);}return _0x3fd1c4;};}function handleError(_0x26c03a,_0x576f44){_0x576f44=_0x576f44||0x1f4;return function(_0x1ae0cf){logger[_0x191a('0x29')](_0x1ae0cf[_0x191a('0x2a')]);if(_0x1ae0cf[_0x191a('0x2b')]){delete _0x1ae0cf['name'];}_0x26c03a[_0x191a('0x1c')](_0x576f44)['send'](_0x1ae0cf);};}exports['index']=function(_0x13e271,_0x4cb66e){var _0x590c1a={},_0xc4df6e={},_0x5a8dea={'count':0x0,'rows':[]};var _0x38d081=_['map'](db['AnalyticTreeReport'][_0x191a('0x2c')],function(_0x2d473d){return{'name':_0x2d473d[_0x191a('0x2d')],'type':_0x2d473d[_0x191a('0x2e')][_0x191a('0x2f')]};});_0xc4df6e[_0x191a('0x30')]=_['map'](_0x38d081,'name');_0xc4df6e['query']=_[_0x191a('0x31')](_0x13e271[_0x191a('0x32')]);_0xc4df6e[_0x191a('0x33')]=_[_0x191a('0x34')](_0xc4df6e[_0x191a('0x30')],_0xc4df6e[_0x191a('0x32')]);_0x590c1a[_0x191a('0x35')]=_[_0x191a('0x34')](_0xc4df6e[_0x191a('0x30')],qs[_0x191a('0x36')](_0x13e271['query'][_0x191a('0x36')]));_0x590c1a['attributes']=_0x590c1a[_0x191a('0x35')][_0x191a('0x37')]?_0x590c1a[_0x191a('0x35')]:_0xc4df6e[_0x191a('0x30')];if(!_0x13e271['query'][_0x191a('0x38')]('nolimit')){_0x590c1a[_0x191a('0x21')]=qs[_0x191a('0x21')](_0x13e271['query'][_0x191a('0x21')]);_0x590c1a[_0x191a('0x1e')]=qs['offset'](_0x13e271[_0x191a('0x32')]['offset']);}_0x590c1a[_0x191a('0x39')]=qs[_0x191a('0x3a')](_0x13e271[_0x191a('0x32')][_0x191a('0x3a')]);_0x590c1a[_0x191a('0x3b')]=qs[_0x191a('0x33')](_['pick'](_0x13e271[_0x191a('0x32')],_0xc4df6e[_0x191a('0x33')]),_0x38d081);if(_0x13e271[_0x191a('0x32')][_0x191a('0x3c')]){_0x590c1a[_0x191a('0x3b')]=_['merge'](_0x590c1a[_0x191a('0x3b')],{'$or':_[_0x191a('0x3d')](_0x38d081,function(_0x29f643){if(_0x29f643[_0x191a('0x2e')]!==_0x191a('0x3e')){var _0x160699={};_0x160699[_0x29f643[_0x191a('0x2b')]]={'$like':'%'+_0x13e271[_0x191a('0x32')]['filter']+'%'};return _0x160699;}})});}_0x590c1a=_[_0x191a('0x3f')]({},_0x590c1a,_0x13e271['options']);var _0xe787d0={'where':_0x590c1a['where']};return db['AnalyticTreeReport'][_0x191a('0x20')](_0xe787d0)[_0x191a('0x28')](function(_0x338282){_0x5a8dea[_0x191a('0x20')]=_0x338282;if(_0x13e271[_0x191a('0x32')][_0x191a('0x40')]){_0x590c1a[_0x191a('0x41')]=[{'all':!![]}];}return db[_0x191a('0x42')][_0x191a('0x43')](_0x590c1a);})['then'](function(_0xb44870){_0x5a8dea[_0x191a('0x44')]=_0xb44870;return _0x5a8dea;})['then'](respondWithFilteredResult(_0x4cb66e,_0x590c1a))[_0x191a('0x45')](handleError(_0x4cb66e,null));};exports[_0x191a('0x46')]=function(_0x59b61b,_0x5201f1){var _0x1a880d={'raw':!![],'where':{'id':_0x59b61b['params']['id']}},_0x31d1ff={};_0x31d1ff[_0x191a('0x30')]=_[_0x191a('0x31')](db[_0x191a('0x42')]['rawAttributes']);_0x31d1ff[_0x191a('0x32')]=_[_0x191a('0x31')](_0x59b61b[_0x191a('0x32')]);_0x31d1ff[_0x191a('0x33')]=_[_0x191a('0x34')](_0x31d1ff[_0x191a('0x30')],_0x31d1ff[_0x191a('0x32')]);_0x1a880d[_0x191a('0x35')]=_['intersection'](_0x31d1ff['model'],qs[_0x191a('0x36')](_0x59b61b[_0x191a('0x32')]['fields']));_0x1a880d['attributes']=_0x1a880d[_0x191a('0x35')][_0x191a('0x37')]?_0x1a880d[_0x191a('0x35')]:_0x31d1ff[_0x191a('0x30')];if(_0x59b61b[_0x191a('0x32')][_0x191a('0x40')]){_0x1a880d['include']=[{'all':!![]}];}_0x1a880d=_[_0x191a('0x3f')]({},_0x1a880d,_0x59b61b[_0x191a('0x47')]);return db[_0x191a('0x42')]['find'](_0x1a880d)[_0x191a('0x28')](handleEntityNotFound(_0x5201f1,null))[_0x191a('0x28')](respondWithResult(_0x5201f1,null))[_0x191a('0x45')](handleError(_0x5201f1,null));};exports[_0x191a('0x48')]=function(_0x190dc3,_0x52380a){return db[_0x191a('0x42')][_0x191a('0x48')](_0x190dc3[_0x191a('0x49')],{})[_0x191a('0x28')](respondWithResult(_0x52380a,0xc9))['catch'](handleError(_0x52380a,null));};exports[_0x191a('0x27')]=function(_0x3db401,_0x298f69){if(_0x3db401['body']['id']){delete _0x3db401[_0x191a('0x49')]['id'];}return db[_0x191a('0x42')]['find']({'where':{'id':_0x3db401['params']['id']}})[_0x191a('0x28')](handleEntityNotFound(_0x298f69,null))[_0x191a('0x28')](saveUpdates(_0x3db401[_0x191a('0x49')],null))['then'](respondWithResult(_0x298f69,null))[_0x191a('0x45')](handleError(_0x298f69,null));};exports[_0x191a('0x4a')]=function(_0x1fd264,_0x363d6d){return db[_0x191a('0x42')][_0x191a('0x4b')]({'where':{'id':_0x1fd264[_0x191a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x363d6d,null))[_0x191a('0x28')](removeEntity(_0x363d6d,null))[_0x191a('0x45')](handleError(_0x363d6d,null));};
\ No newline at end of file
+var _0xad06=['Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','destroy','params','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xad06,0x15c));var _0x6ad0=function(_0x14e3f4,_0x5d577a){_0x14e3f4=_0x14e3f4-0x0;var _0x448a3a=_0xad06[_0x14e3f4];return _0x448a3a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ad0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ad0('0x1'));var rp=require(_0x6ad0('0x2'));var moment=require('moment');var BPromise=require(_0x6ad0('0x3'));var Mustache=require(_0x6ad0('0x4'));var util=require(_0x6ad0('0x5'));var path=require(_0x6ad0('0x6'));var sox=require(_0x6ad0('0x7'));var csv=require(_0x6ad0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ad0('0x9'));var _=require(_0x6ad0('0xa'));var squel=require(_0x6ad0('0xb'));var crypto=require(_0x6ad0('0xc'));var jsforce=require(_0x6ad0('0xd'));var deskjs=require(_0x6ad0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6ad0('0xf'));var Papa=require('papaparse');var Redis=require(_0x6ad0('0x10'));var authService=require(_0x6ad0('0x11'));var qs=require(_0x6ad0('0x12'));var as=require(_0x6ad0('0x13'));var hardwareService=require(_0x6ad0('0x14'));var logger=require(_0x6ad0('0x15'))(_0x6ad0('0x16'));var utils=require(_0x6ad0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6ad0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49b37b,_0x5b7dc0){_0x5b7dc0=_0x5b7dc0||0xcc;return function(_0x25e383){if(_0x25e383){return _0x49b37b['sendStatus'](_0x5b7dc0);}return _0x49b37b[_0x6ad0('0x19')](_0x5b7dc0)[_0x6ad0('0x1a')]();};}function respondWithResult(_0x4165aa,_0x2c79bf){_0x2c79bf=_0x2c79bf||0xc8;return function(_0x135335){if(_0x135335){return _0x4165aa[_0x6ad0('0x19')](_0x2c79bf)['json'](_0x135335);}};}function respondWithFilteredResult(_0x4f3f07,_0xdb233c){return function(_0x16901c){if(_0x16901c){var _0x361dc8=typeof _0xdb233c[_0x6ad0('0x1b')]===_0x6ad0('0x1c')&&typeof _0xdb233c[_0x6ad0('0x1d')]==='undefined';var _0x1a648e=_0x16901c[_0x6ad0('0x1e')];var _0x54036a=_0x361dc8?0x0:_0xdb233c[_0x6ad0('0x1b')];var _0x138b00=_0x361dc8?_0x16901c[_0x6ad0('0x1e')]:_0xdb233c['offset']+_0xdb233c[_0x6ad0('0x1d')];var _0x292337;if(_0x138b00>=_0x1a648e){_0x138b00=_0x1a648e;_0x292337=0xc8;}else{_0x292337=0xce;}_0x4f3f07['status'](_0x292337);return _0x4f3f07[_0x6ad0('0x1f')](_0x6ad0('0x20'),_0x54036a+'-'+_0x138b00+'/'+_0x1a648e)[_0x6ad0('0x21')](_0x16901c);}return null;};}function patchUpdates(_0xfd9e14){return function(_0xdfcfd6){try{jsonpatch[_0x6ad0('0x22')](_0xdfcfd6,_0xfd9e14,!![]);}catch(_0x4f143a){return BPromise[_0x6ad0('0x23')](_0x4f143a);}return _0xdfcfd6['save']();};}function saveUpdates(_0x144254,_0x54272c){return function(_0x4d4e3d){if(_0x4d4e3d){return _0x4d4e3d[_0x6ad0('0x24')](_0x144254)[_0x6ad0('0x25')](function(_0x199abf){return _0x199abf;});}return null;};}function removeEntity(_0x48a404,_0x2e07a8){return function(_0x14a560){if(_0x14a560){return _0x14a560['destroy']()[_0x6ad0('0x25')](function(){_0x48a404[_0x6ad0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7f0ad3,_0x19700f){return function(_0x599734){if(!_0x599734){_0x7f0ad3['sendStatus'](0x194);}return _0x599734;};}function handleError(_0x17e24d,_0x11ac34){_0x11ac34=_0x11ac34||0x1f4;return function(_0x2447ed){logger[_0x6ad0('0x26')](_0x2447ed[_0x6ad0('0x27')]);if(_0x2447ed[_0x6ad0('0x28')]){delete _0x2447ed[_0x6ad0('0x28')];}_0x17e24d[_0x6ad0('0x19')](_0x11ac34)[_0x6ad0('0x29')](_0x2447ed);};}exports[_0x6ad0('0x2a')]=function(_0x19cf3f,_0x4220b4){var _0x1929f1={},_0x3c7867={},_0x203c7b={'count':0x0,'rows':[]};var _0x232e97=_[_0x6ad0('0x2b')](db[_0x6ad0('0x2c')][_0x6ad0('0x2d')],function(_0x2c59eb){return{'name':_0x2c59eb[_0x6ad0('0x2e')],'type':_0x2c59eb['type'][_0x6ad0('0x2f')]};});_0x3c7867[_0x6ad0('0x30')]=_[_0x6ad0('0x2b')](_0x232e97,_0x6ad0('0x28'));_0x3c7867[_0x6ad0('0x31')]=_[_0x6ad0('0x32')](_0x19cf3f['query']);_0x3c7867[_0x6ad0('0x33')]=_['intersection'](_0x3c7867[_0x6ad0('0x30')],_0x3c7867['query']);_0x1929f1[_0x6ad0('0x34')]=_[_0x6ad0('0x35')](_0x3c7867[_0x6ad0('0x30')],qs[_0x6ad0('0x36')](_0x19cf3f['query'][_0x6ad0('0x36')]));_0x1929f1[_0x6ad0('0x34')]=_0x1929f1[_0x6ad0('0x34')][_0x6ad0('0x37')]?_0x1929f1[_0x6ad0('0x34')]:_0x3c7867[_0x6ad0('0x30')];if(!_0x19cf3f[_0x6ad0('0x31')][_0x6ad0('0x38')](_0x6ad0('0x39'))){_0x1929f1[_0x6ad0('0x1d')]=qs[_0x6ad0('0x1d')](_0x19cf3f['query']['limit']);_0x1929f1[_0x6ad0('0x1b')]=qs[_0x6ad0('0x1b')](_0x19cf3f['query']['offset']);}_0x1929f1['order']=qs[_0x6ad0('0x3a')](_0x19cf3f[_0x6ad0('0x31')]['sort']);_0x1929f1[_0x6ad0('0x3b')]=qs['filters'](_[_0x6ad0('0x3c')](_0x19cf3f['query'],_0x3c7867[_0x6ad0('0x33')]),_0x232e97);if(_0x19cf3f['query'][_0x6ad0('0x3d')]){_0x1929f1[_0x6ad0('0x3b')]=_[_0x6ad0('0x3e')](_0x1929f1['where'],{'$or':_[_0x6ad0('0x2b')](_0x232e97,function(_0x3d7398){if(_0x3d7398[_0x6ad0('0x3f')]!==_0x6ad0('0x40')){var _0x3f1151={};_0x3f1151[_0x3d7398[_0x6ad0('0x28')]]={'$like':'%'+_0x19cf3f['query'][_0x6ad0('0x3d')]+'%'};return _0x3f1151;}})});}_0x1929f1=_[_0x6ad0('0x3e')]({},_0x1929f1,_0x19cf3f[_0x6ad0('0x41')]);var _0x5f5197={'where':_0x1929f1[_0x6ad0('0x3b')]};return db[_0x6ad0('0x2c')][_0x6ad0('0x1e')](_0x5f5197)[_0x6ad0('0x25')](function(_0xca89c9){_0x203c7b[_0x6ad0('0x1e')]=_0xca89c9;if(_0x19cf3f[_0x6ad0('0x31')][_0x6ad0('0x42')]){_0x1929f1[_0x6ad0('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x6ad0('0x44')](_0x1929f1);})[_0x6ad0('0x25')](function(_0x323199){_0x203c7b[_0x6ad0('0x45')]=_0x323199;return _0x203c7b;})['then'](respondWithFilteredResult(_0x4220b4,_0x1929f1))[_0x6ad0('0x46')](handleError(_0x4220b4,null));};exports['show']=function(_0x27c68e,_0x4517f6){var _0x3d4424={'raw':!![],'where':{'id':_0x27c68e['params']['id']}},_0x2e931d={};_0x2e931d[_0x6ad0('0x30')]=_[_0x6ad0('0x32')](db[_0x6ad0('0x2c')]['rawAttributes']);_0x2e931d[_0x6ad0('0x31')]=_[_0x6ad0('0x32')](_0x27c68e['query']);_0x2e931d[_0x6ad0('0x33')]=_['intersection'](_0x2e931d['model'],_0x2e931d[_0x6ad0('0x31')]);_0x3d4424['attributes']=_['intersection'](_0x2e931d[_0x6ad0('0x30')],qs[_0x6ad0('0x36')](_0x27c68e[_0x6ad0('0x31')][_0x6ad0('0x36')]));_0x3d4424[_0x6ad0('0x34')]=_0x3d4424[_0x6ad0('0x34')]['length']?_0x3d4424[_0x6ad0('0x34')]:_0x2e931d[_0x6ad0('0x30')];if(_0x27c68e['query']['includeAll']){_0x3d4424[_0x6ad0('0x43')]=[{'all':!![]}];}_0x3d4424=_[_0x6ad0('0x3e')]({},_0x3d4424,_0x27c68e['options']);return db[_0x6ad0('0x2c')][_0x6ad0('0x47')](_0x3d4424)[_0x6ad0('0x25')](handleEntityNotFound(_0x4517f6,null))[_0x6ad0('0x25')](respondWithResult(_0x4517f6,null))[_0x6ad0('0x46')](handleError(_0x4517f6,null));};exports[_0x6ad0('0x48')]=function(_0x9b7b19,_0xb4fcf2){return db['AnalyticTreeReport'][_0x6ad0('0x48')](_0x9b7b19['body'],{})[_0x6ad0('0x25')](respondWithResult(_0xb4fcf2,0xc9))['catch'](handleError(_0xb4fcf2,null));};exports[_0x6ad0('0x24')]=function(_0x507169,_0x1cc7b4){if(_0x507169[_0x6ad0('0x49')]['id']){delete _0x507169[_0x6ad0('0x49')]['id'];}return db['AnalyticTreeReport'][_0x6ad0('0x47')]({'where':{'id':_0x507169['params']['id']}})[_0x6ad0('0x25')](handleEntityNotFound(_0x1cc7b4,null))[_0x6ad0('0x25')](saveUpdates(_0x507169[_0x6ad0('0x49')],null))['then'](respondWithResult(_0x1cc7b4,null))['catch'](handleError(_0x1cc7b4,null));};exports[_0x6ad0('0x4a')]=function(_0x592ad1,_0x1b519b){return db['AnalyticTreeReport'][_0x6ad0('0x47')]({'where':{'id':_0x592ad1[_0x6ad0('0x4b')]['id']}})[_0x6ad0('0x25')](handleEntityNotFound(_0x1b519b,null))[_0x6ad0('0x25')](removeEntity(_0x1b519b,null))[_0x6ad0('0x46')](handleError(_0x1b519b,null));};
\ No newline at end of file
index 82df70b..9c8c7e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7052=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees'];(function(_0x16f0db,_0x149a0d){var _0x1f30ff=function(_0x301c45){while(--_0x301c45){_0x16f0db['push'](_0x16f0db['shift']());}};_0x1f30ff(++_0x149a0d);}(_0x7052,0x1c3));var _0x2705=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0x7052[_0x2fb87c];return _0x43038b;};'use strict';var _=require('lodash');var util=require(_0x2705('0x0'));var logger=require(_0x2705('0x1'))(_0x2705('0x2'));var moment=require(_0x2705('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2705('0x4'));var rimraf=require(_0x2705('0x5'));var config=require(_0x2705('0x6'));var attributes=require(_0x2705('0x7'));module[_0x2705('0x8')]=function(_0x59dd8d,_0x132b96){return _0x59dd8d['define'](_0x2705('0x9'),attributes,{'tableName':_0x2705('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x38ff=['bluebird','path','rimraf','../../config/environment','exports','define','analytics_report_trees','util','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x38ff,0xa7));var _0xf38f=function(_0x27669b,_0x306a2c){_0x27669b=_0x27669b-0x0;var _0x31ed6e=_0x38ff[_0x27669b];return _0x31ed6e;};'use strict';var _=require('lodash');var util=require(_0xf38f('0x0'));var logger=require('../../config/logger')(_0xf38f('0x1'));var moment=require(_0xf38f('0x2'));var BPromise=require(_0xf38f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf38f('0x4'));var rimraf=require(_0xf38f('0x5'));var config=require(_0xf38f('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xf38f('0x7')]=function(_0x10df4b,_0x29b5fb){return _0x10df4b[_0xf38f('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0xf38f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0772b7b..e2563ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3a236b,_0x2baa96){var _0x145b1d=function(_0x204fc4){while(--_0x204fc4){_0x3a236b['push'](_0x3a236b['shift']());}};_0x145b1d(++_0x2baa96);}(_0x5f2f,0x73));var _0xf5f2=function(_0x42d7e1,_0x1fa9f8){_0x42d7e1=_0x42d7e1-0x0;var _0x51eabe=_0x5f2f[_0x42d7e1];return _0x51eabe;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+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(_0x51650a,_0x2a2362){var _0x5f183c=function(_0x50a9c6){while(--_0x50a9c6){_0x51650a['push'](_0x51650a['shift']());}};_0x5f183c(++_0x2a2362);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc4aa[_0x342baa];return _0x1208f3;};'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
index e2fb275..30f00e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe383=['create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x198d94,_0x38e5b9){var _0x585cb1=function(_0x29f3c9){while(--_0x29f3c9){_0x198d94['push'](_0x198d94['shift']());}};_0x585cb1(++_0x38e5b9);}(_0xe383,0x1a7));var _0x3e38=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe383[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x3e38('0x0'));var util=require(_0x3e38('0x1'));var path=require(_0x3e38('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e38('0x3'));var router=express[_0x3e38('0x4')]();var fs_extra=require(_0x3e38('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3e38('0x6'));var config=require('../../config/environment');var controller=require(_0x3e38('0x7'));router[_0x3e38('0x8')]('/',auth[_0x3e38('0x9')](),controller[_0x3e38('0xa')]);router[_0x3e38('0x8')](_0x3e38('0xb'),auth['isAuthenticated'](),controller[_0x3e38('0xc')]);router[_0x3e38('0xd')]('/',auth[_0x3e38('0x9')](),controller[_0x3e38('0xe')]);router[_0x3e38('0xf')](_0x3e38('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x3e38('0x10')](_0x3e38('0xb'),auth['isAuthenticated'](),controller[_0x3e38('0x11')]);module[_0x3e38('0x12')]=router;
\ No newline at end of file
+var _0xa28b=['update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x56396f,_0x12222b){var _0x340761=function(_0x27c3eb){while(--_0x27c3eb){_0x56396f['push'](_0x56396f['shift']());}};_0x340761(++_0x12222b);}(_0xa28b,0xae));var _0xba28=function(_0x2bfc72,_0x22406a){_0x2bfc72=_0x2bfc72-0x0;var _0x4c4a49=_0xa28b[_0x2bfc72];return _0x4c4a49;};'use strict';var multer=require(_0xba28('0x0'));var util=require(_0xba28('0x1'));var path=require(_0xba28('0x2'));var timeout=require(_0xba28('0x3'));var express=require(_0xba28('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xba28('0x5'));var interaction=require(_0xba28('0x6'));var config=require(_0xba28('0x7'));var controller=require(_0xba28('0x8'));router[_0xba28('0x9')]('/',auth[_0xba28('0xa')](),controller['index']);router[_0xba28('0x9')](_0xba28('0xb'),auth[_0xba28('0xa')](),controller[_0xba28('0xc')]);router[_0xba28('0xd')]('/',auth[_0xba28('0xa')](),controller[_0xba28('0xe')]);router[_0xba28('0xf')](_0xba28('0xb'),auth[_0xba28('0xa')](),controller[_0xba28('0x10')]);router['delete'](_0xba28('0xb'),auth[_0xba28('0xa')](),controller[_0xba28('0x11')]);module[_0xba28('0x12')]=router;
\ No newline at end of file
index 7ac3fd5..4605230 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdad2=['exports','STRING'];(function(_0x37ab3c,_0x4f67ff){var _0x2e51b6=function(_0x2eb102){while(--_0x2eb102){_0x37ab3c['push'](_0x37ab3c['shift']());}};_0x2e51b6(++_0x4f67ff);}(_0xdad2,0x14c));var _0x2dad=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xdad2[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0x2dad('0x0')]={'name':{'type':Sequelize[_0x2dad('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2dad('0x1')]}};
\ No newline at end of file
+var _0xb13b=['STRING','sequelize','exports'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0xb13b,0x1de));var _0xbb13=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xb13b[_0x9cd4c3];return _0x4c9025;};'use strict';var Sequelize=require(_0xbb13('0x0'));module[_0xbb13('0x1')]={'name':{'type':Sequelize[_0xbb13('0x2')]},'basename':{'type':Sequelize[_0xbb13('0x2')]},'type':{'type':Sequelize[_0xbb13('0x2')]}};
\ No newline at end of file
index ce10fb2..6a4545c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5390=['body','createdAt','create','destroy','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','order','sort','filters','where','filter','merge','options','Attachment','includeAll','include','findAll','catch','show','params','find','clone','omit'];(function(_0x115d5b,_0x26aff2){var _0x6cfc50=function(_0x39a786){while(--_0x39a786){_0x115d5b['push'](_0x115d5b['shift']());}};_0x6cfc50(++_0x26aff2);}(_0x5390,0x1cd));var _0x0539=function(_0x25e767,_0xbc6b74){_0x25e767=_0x25e767-0x0;var _0x3f34e2=_0x5390[_0x25e767];return _0x3f34e2;};'use strict';var emlformat=require(_0x0539('0x0'));var rimraf=require(_0x0539('0x1'));var zipdir=require(_0x0539('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0539('0x3'));var moment=require(_0x0539('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0539('0x5'));var util=require(_0x0539('0x6'));var path=require(_0x0539('0x7'));var sox=require(_0x0539('0x8'));var csv=require(_0x0539('0x9'));var ejs=require(_0x0539('0xa'));var fs=require('fs');var fs_extra=require(_0x0539('0xb'));var _=require('lodash');var squel=require(_0x0539('0xc'));var crypto=require('crypto');var jsforce=require(_0x0539('0xd'));var deskjs=require(_0x0539('0xe'));var toCsv=require(_0x0539('0x9'));var querystring=require(_0x0539('0xf'));var Papa=require(_0x0539('0x10'));var Redis=require(_0x0539('0x11'));var authService=require(_0x0539('0x12'));var qs=require(_0x0539('0x13'));var as=require(_0x0539('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0539('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x0539('0x16'));var licenseUtil=require(_0x0539('0x17'));var db=require(_0x0539('0x18'))['db'];function respondWithStatusCode(_0x3b7a16,_0x197746){_0x197746=_0x197746||0xcc;return function(_0x14863f){if(_0x14863f){return _0x3b7a16['sendStatus'](_0x197746);}return _0x3b7a16['status'](_0x197746)[_0x0539('0x19')]();};}function respondWithResult(_0x4fc484,_0x3274fc){_0x3274fc=_0x3274fc||0xc8;return function(_0xf4c948){if(_0xf4c948){return _0x4fc484['status'](_0x3274fc)['json'](_0xf4c948);}};}function respondWithFilteredResult(_0x4715e6,_0x7ae71){return function(_0x32a46c){if(_0x32a46c){var _0x1c3393=typeof _0x7ae71[_0x0539('0x1a')]===_0x0539('0x1b')&&typeof _0x7ae71[_0x0539('0x1c')]===_0x0539('0x1b');var _0x5d9595=_0x32a46c[_0x0539('0x1d')];var _0x9d37b1=_0x1c3393?0x0:_0x7ae71[_0x0539('0x1a')];var _0x9f96eb=_0x1c3393?_0x32a46c[_0x0539('0x1d')]:_0x7ae71['offset']+_0x7ae71[_0x0539('0x1c')];var _0xc7b520;if(_0x9f96eb>=_0x5d9595){_0x9f96eb=_0x5d9595;_0xc7b520=0xc8;}else{_0xc7b520=0xce;}_0x4715e6[_0x0539('0x1e')](_0xc7b520);return _0x4715e6[_0x0539('0x1f')](_0x0539('0x20'),_0x9d37b1+'-'+_0x9f96eb+'/'+_0x5d9595)[_0x0539('0x21')](_0x32a46c);}return null;};}function patchUpdates(_0x203696){return function(_0x7f5f6){try{jsonpatch[_0x0539('0x22')](_0x7f5f6,_0x203696,!![]);}catch(_0xf40938){return BPromise[_0x0539('0x23')](_0xf40938);}return _0x7f5f6[_0x0539('0x24')]();};}function saveUpdates(_0x57a19a,_0x507765){return function(_0x40df07){if(_0x40df07){return _0x40df07[_0x0539('0x25')](_0x57a19a)[_0x0539('0x26')](function(_0x27137e){return _0x27137e;});}return null;};}function removeEntity(_0x182194,_0x91016){return function(_0x5ec6a2){if(_0x5ec6a2){return _0x5ec6a2['destroy']()[_0x0539('0x26')](function(){_0x182194[_0x0539('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x457f1d,_0x20a356){return function(_0x21e570){if(!_0x21e570){_0x457f1d[_0x0539('0x27')](0x194);}return _0x21e570;};}function handleError(_0xdbffa6,_0x10f903){_0x10f903=_0x10f903||0x1f4;return function(_0x5c4a41){logger[_0x0539('0x28')](_0x5c4a41[_0x0539('0x29')]);if(_0x5c4a41['name']){delete _0x5c4a41[_0x0539('0x2a')];}_0xdbffa6[_0x0539('0x1e')](_0x10f903)[_0x0539('0x2b')](_0x5c4a41);};}exports[_0x0539('0x2c')]=function(_0x20a2d8,_0x232e86){var _0x13dcd7={},_0xc2efdf={},_0x512904={'count':0x0,'rows':[]};var _0x351422=_[_0x0539('0x2d')](db['Attachment']['rawAttributes'],function(_0x15d552){return{'name':_0x15d552[_0x0539('0x2e')],'type':_0x15d552[_0x0539('0x2f')][_0x0539('0x30')]};});_0xc2efdf[_0x0539('0x31')]=_[_0x0539('0x2d')](_0x351422,_0x0539('0x2a'));_0xc2efdf['query']=_[_0x0539('0x32')](_0x20a2d8[_0x0539('0x33')]);_0xc2efdf['filters']=_[_0x0539('0x34')](_0xc2efdf[_0x0539('0x31')],_0xc2efdf[_0x0539('0x33')]);_0x13dcd7[_0x0539('0x35')]=_[_0x0539('0x34')](_0xc2efdf['model'],qs['fields'](_0x20a2d8[_0x0539('0x33')][_0x0539('0x36')]));_0x13dcd7[_0x0539('0x35')]=_0x13dcd7['attributes'][_0x0539('0x37')]?_0x13dcd7[_0x0539('0x35')]:_0xc2efdf[_0x0539('0x31')];if(!_0x20a2d8[_0x0539('0x33')]['hasOwnProperty']('nolimit')){_0x13dcd7['limit']=qs['limit'](_0x20a2d8['query'][_0x0539('0x1c')]);_0x13dcd7[_0x0539('0x1a')]=qs[_0x0539('0x1a')](_0x20a2d8['query']['offset']);}_0x13dcd7[_0x0539('0x38')]=qs[_0x0539('0x39')](_0x20a2d8[_0x0539('0x33')][_0x0539('0x39')]);_0x13dcd7['where']=qs[_0x0539('0x3a')](_['pick'](_0x20a2d8['query'],_0xc2efdf[_0x0539('0x3a')]),_0x351422);if(_0x20a2d8[_0x0539('0x33')]['filter']){_0x13dcd7[_0x0539('0x3b')]=_['merge'](_0x13dcd7[_0x0539('0x3b')],{'$or':_['map'](_0x351422,function(_0x1487ab){if(_0x1487ab[_0x0539('0x2f')]!=='VIRTUAL'){var _0x47b2c3={};_0x47b2c3[_0x1487ab[_0x0539('0x2a')]]={'$like':'%'+_0x20a2d8['query'][_0x0539('0x3c')]+'%'};return _0x47b2c3;}})});}_0x13dcd7=_[_0x0539('0x3d')]({},_0x13dcd7,_0x20a2d8[_0x0539('0x3e')]);var _0x452f22={'where':_0x13dcd7[_0x0539('0x3b')]};return db[_0x0539('0x3f')][_0x0539('0x1d')](_0x452f22)[_0x0539('0x26')](function(_0xe92dad){_0x512904[_0x0539('0x1d')]=_0xe92dad;if(_0x20a2d8[_0x0539('0x33')][_0x0539('0x40')]){_0x13dcd7[_0x0539('0x41')]=[{'all':!![]}];}return db['Attachment'][_0x0539('0x42')](_0x13dcd7);})[_0x0539('0x26')](function(_0xd115b0){_0x512904['rows']=_0xd115b0;return _0x512904;})[_0x0539('0x26')](respondWithFilteredResult(_0x232e86,_0x13dcd7))[_0x0539('0x43')](handleError(_0x232e86,null));};exports[_0x0539('0x44')]=function(_0x2ada88,_0x3c15b3){var _0x1099df={'raw':!![],'where':{'id':_0x2ada88[_0x0539('0x45')]['id']}},_0xf74c2c={};_0xf74c2c[_0x0539('0x31')]=_[_0x0539('0x32')](db[_0x0539('0x3f')]['rawAttributes']);_0xf74c2c[_0x0539('0x33')]=_['keys'](_0x2ada88[_0x0539('0x33')]);_0xf74c2c['filters']=_[_0x0539('0x34')](_0xf74c2c[_0x0539('0x31')],_0xf74c2c['query']);_0x1099df[_0x0539('0x35')]=_[_0x0539('0x34')](_0xf74c2c[_0x0539('0x31')],qs[_0x0539('0x36')](_0x2ada88['query'][_0x0539('0x36')]));_0x1099df[_0x0539('0x35')]=_0x1099df['attributes'][_0x0539('0x37')]?_0x1099df[_0x0539('0x35')]:_0xf74c2c[_0x0539('0x31')];if(_0x2ada88['query'][_0x0539('0x40')]){_0x1099df[_0x0539('0x41')]=[{'all':!![]}];}_0x1099df=_[_0x0539('0x3d')]({},_0x1099df,_0x2ada88['options']);return db[_0x0539('0x3f')][_0x0539('0x46')](_0x1099df)[_0x0539('0x26')](handleEntityNotFound(_0x3c15b3,null))[_0x0539('0x26')](respondWithResult(_0x3c15b3,null))[_0x0539('0x43')](handleError(_0x3c15b3,null));};exports[_0x0539('0x47')]=function(_0x495b1a,_0x5f3926){var _0x470fdf={'where':{'id':_0x495b1a[_0x0539('0x45')]['id']}},_0x1941cf={};_0x1941cf[_0x0539('0x31')]=_[_0x0539('0x32')](db[_0x0539('0x3f')]['rawAttributes']);_0x470fdf[_0x0539('0x35')]=_[_0x0539('0x34')](_0x1941cf['model'],qs[_0x0539('0x36')](_0x495b1a[_0x0539('0x33')][_0x0539('0x36')]));_0x470fdf['attributes']=_0x470fdf[_0x0539('0x35')][_0x0539('0x37')]?_0x470fdf[_0x0539('0x35')]:_0x1941cf['model'];if(_0x495b1a[_0x0539('0x33')]['includeAll']){_0x470fdf[_0x0539('0x41')]=[{'all':!![]}];}_0x470fdf=_[_0x0539('0x3d')]({},_0x470fdf,_0x495b1a[_0x0539('0x3e')]);return db[_0x0539('0x3f')]['find'](_0x470fdf)[_0x0539('0x26')](handleEntityNotFound(_0x5f3926,null))[_0x0539('0x26')](function(_0x244dc0){if(_0x244dc0){var _0xc7f68f=_0x244dc0['get']({'plain':!![]});_0xc7f68f=qs[_0x0539('0x48')](_0xc7f68f,['id','createdAt','updatedAt']);_0x495b1a[_0x0539('0x49')]=_[_0x0539('0x48')](_0x495b1a[_0x0539('0x49')],['id',_0x0539('0x4a'),'updatedAt']);return db[_0x0539('0x3f')][_0x0539('0x4b')](_[_0x0539('0x3d')](_0xc7f68f,_0x495b1a[_0x0539('0x49')]),{'include':_0x495b1a[_0x0539('0x33')][_0x0539('0x40')]?[{'all':!![]}]:undefined});}})[_0x0539('0x26')](respondWithResult(_0x5f3926,0xc9))[_0x0539('0x43')](handleError(_0x5f3926,null));};exports[_0x0539('0x25')]=function(_0x5831c5,_0x3bf47d){if(_0x5831c5[_0x0539('0x49')]['id']){delete _0x5831c5[_0x0539('0x49')]['id'];}return db[_0x0539('0x3f')]['find']({'where':{'id':_0x5831c5[_0x0539('0x45')]['id']}})[_0x0539('0x26')](handleEntityNotFound(_0x3bf47d,null))[_0x0539('0x26')](saveUpdates(_0x5831c5[_0x0539('0x49')],null))[_0x0539('0x26')](respondWithResult(_0x3bf47d,null))[_0x0539('0x43')](handleError(_0x3bf47d,null));};exports[_0x0539('0x4c')]=function(_0x469d06,_0x4b433d){return db[_0x0539('0x3f')][_0x0539('0x46')]({'where':{'id':_0x469d06[_0x0539('0x45')]['id']}})[_0x0539('0x26')](handleEntityNotFound(_0x4b433d,null))[_0x0539('0x26')](removeEntity(_0x4b433d,null))['catch'](handleError(_0x4b433d,null));};exports[_0x0539('0x4b')]=function(_0x95def6,_0x5b2bbd,_0x2fe92c){_0x95def6[_0x0539('0x49')][_0x0539('0x2a')]=_0x95def6[_0x0539('0x4d')][_0x0539('0x4e')];_0x95def6[_0x0539('0x49')][_0x0539('0x4f')]=_0x95def6[_0x0539('0x4d')][_0x0539('0x50')];_0x95def6['body']['type']=_0x95def6[_0x0539('0x4d')][_0x0539('0x51')];return db[_0x0539('0x3f')]['create'](_0x95def6['body'])['then'](respondWithResult(_0x5b2bbd,0xc9))[_0x0539('0x43')](handleError(_0x5b2bbd,null));};exports[_0x0539('0x52')]=function(_0x285011,_0x35b1bc,_0x239846){return db[_0x0539('0x3f')][_0x0539('0x53')]({'where':{'id':_0x285011[_0x0539('0x45')]['id']},'raw':!![]})[_0x0539('0x26')](handleEntityNotFound(_0x35b1bc,null))[_0x0539('0x26')](function(_0x395137){if(_0x395137){var _0x499108=_0x395137[_0x0539('0x54')]!==null;var _0x30ac03=path[_0x0539('0x55')](config[_0x0539('0x56')],_0x0539('0x57'));if(_0x499108){_0x30ac03=path[_0x0539('0x55')](_0x30ac03,_0x0539('0x58'));}var _0xad1846=path[_0x0539('0x55')](_0x30ac03,_0x395137[_0x0539('0x4f')]);return _0x35b1bc['download'](_0xad1846);}})[_0x0539('0x43')](handleError(_0x35b1bc,null));};
\ No newline at end of file
+var _0x5322=['set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','Attachment','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','length','find','clone','fields','includeAll','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','end','json','undefined','limit','count','offset'];(function(_0x40a093,_0x20f2d8){var _0x4449ff=function(_0x99f249){while(--_0x99f249){_0x40a093['push'](_0x40a093['shift']());}};_0x4449ff(++_0x20f2d8);}(_0x5322,0x94));var _0x2532=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0x5322[_0x14e27a];return _0x288688;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2532('0x0'));var zipdir=require(_0x2532('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2532('0x2'));var moment=require(_0x2532('0x3'));var BPromise=require(_0x2532('0x4'));var Mustache=require(_0x2532('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2532('0x6'));var csv=require(_0x2532('0x7'));var ejs=require(_0x2532('0x8'));var fs=require('fs');var fs_extra=require(_0x2532('0x9'));var _=require(_0x2532('0xa'));var squel=require(_0x2532('0xb'));var crypto=require(_0x2532('0xc'));var jsforce=require(_0x2532('0xd'));var deskjs=require(_0x2532('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2532('0xf'));var Papa=require(_0x2532('0x10'));var Redis=require(_0x2532('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2532('0x12'));var as=require(_0x2532('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2532('0x14'))(_0x2532('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2532('0x16'))['db'];function respondWithStatusCode(_0x19f3b7,_0x1d44b0){_0x1d44b0=_0x1d44b0||0xcc;return function(_0x50c1ae){if(_0x50c1ae){return _0x19f3b7['sendStatus'](_0x1d44b0);}return _0x19f3b7[_0x2532('0x17')](_0x1d44b0)[_0x2532('0x18')]();};}function respondWithResult(_0x1eca5f,_0xfc75bf){_0xfc75bf=_0xfc75bf||0xc8;return function(_0x2e8ccf){if(_0x2e8ccf){return _0x1eca5f[_0x2532('0x17')](_0xfc75bf)[_0x2532('0x19')](_0x2e8ccf);}};}function respondWithFilteredResult(_0x53ceac,_0xa57ef7){return function(_0x592be1){if(_0x592be1){var _0x31f599=typeof _0xa57ef7['offset']===_0x2532('0x1a')&&typeof _0xa57ef7[_0x2532('0x1b')]===_0x2532('0x1a');var _0x4b4560=_0x592be1[_0x2532('0x1c')];var _0x255ddd=_0x31f599?0x0:_0xa57ef7[_0x2532('0x1d')];var _0x484dc9=_0x31f599?_0x592be1[_0x2532('0x1c')]:_0xa57ef7[_0x2532('0x1d')]+_0xa57ef7[_0x2532('0x1b')];var _0x242b37;if(_0x484dc9>=_0x4b4560){_0x484dc9=_0x4b4560;_0x242b37=0xc8;}else{_0x242b37=0xce;}_0x53ceac['status'](_0x242b37);return _0x53ceac[_0x2532('0x1e')](_0x2532('0x1f'),_0x255ddd+'-'+_0x484dc9+'/'+_0x4b4560)['json'](_0x592be1);}return null;};}function patchUpdates(_0x52f41f){return function(_0x4b9d7a){try{jsonpatch[_0x2532('0x20')](_0x4b9d7a,_0x52f41f,!![]);}catch(_0x14d0aa){return BPromise[_0x2532('0x21')](_0x14d0aa);}return _0x4b9d7a['save']();};}function saveUpdates(_0x1134c0,_0x2123cf){return function(_0x49dc46){if(_0x49dc46){return _0x49dc46[_0x2532('0x22')](_0x1134c0)[_0x2532('0x23')](function(_0x648747){return _0x648747;});}return null;};}function removeEntity(_0x570131,_0x57a2e6){return function(_0x24cc84){if(_0x24cc84){return _0x24cc84[_0x2532('0x24')]()[_0x2532('0x23')](function(){_0x570131[_0x2532('0x17')](0xcc)[_0x2532('0x18')]();});}};}function handleEntityNotFound(_0x3cb42e,_0x2aea8a){return function(_0x4b2a8d){if(!_0x4b2a8d){_0x3cb42e['sendStatus'](0x194);}return _0x4b2a8d;};}function handleError(_0x44d428,_0x50be33){_0x50be33=_0x50be33||0x1f4;return function(_0x36276f){logger[_0x2532('0x25')](_0x36276f[_0x2532('0x26')]);if(_0x36276f['name']){delete _0x36276f[_0x2532('0x27')];}_0x44d428['status'](_0x50be33)[_0x2532('0x28')](_0x36276f);};}exports['index']=function(_0xe49d09,_0x3cdda6){var _0x5d0380={},_0x396dba={},_0xd84cb={'count':0x0,'rows':[]};var _0x2a71cc=_[_0x2532('0x29')](db[_0x2532('0x2a')][_0x2532('0x2b')],function(_0x140e8a){return{'name':_0x140e8a[_0x2532('0x2c')],'type':_0x140e8a[_0x2532('0x2d')]['key']};});_0x396dba[_0x2532('0x2e')]=_[_0x2532('0x29')](_0x2a71cc,_0x2532('0x27'));_0x396dba[_0x2532('0x2f')]=_['keys'](_0xe49d09[_0x2532('0x2f')]);_0x396dba[_0x2532('0x30')]=_[_0x2532('0x31')](_0x396dba[_0x2532('0x2e')],_0x396dba[_0x2532('0x2f')]);_0x5d0380[_0x2532('0x32')]=_['intersection'](_0x396dba['model'],qs['fields'](_0xe49d09['query']['fields']));_0x5d0380[_0x2532('0x32')]=_0x5d0380[_0x2532('0x32')]['length']?_0x5d0380[_0x2532('0x32')]:_0x396dba[_0x2532('0x2e')];if(!_0xe49d09[_0x2532('0x2f')][_0x2532('0x33')](_0x2532('0x34'))){_0x5d0380[_0x2532('0x1b')]=qs[_0x2532('0x1b')](_0xe49d09[_0x2532('0x2f')][_0x2532('0x1b')]);_0x5d0380[_0x2532('0x1d')]=qs[_0x2532('0x1d')](_0xe49d09[_0x2532('0x2f')][_0x2532('0x1d')]);}_0x5d0380[_0x2532('0x35')]=qs[_0x2532('0x36')](_0xe49d09[_0x2532('0x2f')][_0x2532('0x36')]);_0x5d0380[_0x2532('0x37')]=qs[_0x2532('0x30')](_[_0x2532('0x38')](_0xe49d09[_0x2532('0x2f')],_0x396dba[_0x2532('0x30')]),_0x2a71cc);if(_0xe49d09['query'][_0x2532('0x39')]){_0x5d0380[_0x2532('0x37')]=_[_0x2532('0x3a')](_0x5d0380[_0x2532('0x37')],{'$or':_['map'](_0x2a71cc,function(_0x89043){if(_0x89043[_0x2532('0x2d')]!==_0x2532('0x3b')){var _0x38b9bd={};_0x38b9bd[_0x89043['name']]={'$like':'%'+_0xe49d09['query'][_0x2532('0x39')]+'%'};return _0x38b9bd;}})});}_0x5d0380=_['merge']({},_0x5d0380,_0xe49d09[_0x2532('0x3c')]);var _0x3a441e={'where':_0x5d0380[_0x2532('0x37')]};return db['Attachment'][_0x2532('0x1c')](_0x3a441e)['then'](function(_0x179dba){_0xd84cb[_0x2532('0x1c')]=_0x179dba;if(_0xe49d09[_0x2532('0x2f')]['includeAll']){_0x5d0380[_0x2532('0x3d')]=[{'all':!![]}];}return db['Attachment'][_0x2532('0x3e')](_0x5d0380);})['then'](function(_0x15efdf){_0xd84cb['rows']=_0x15efdf;return _0xd84cb;})[_0x2532('0x23')](respondWithFilteredResult(_0x3cdda6,_0x5d0380))[_0x2532('0x3f')](handleError(_0x3cdda6,null));};exports[_0x2532('0x40')]=function(_0x1a0871,_0x1ccc2f){var _0x2870a4={'raw':!![],'where':{'id':_0x1a0871[_0x2532('0x41')]['id']}},_0x2279f7={};_0x2279f7['model']=_[_0x2532('0x42')](db[_0x2532('0x2a')][_0x2532('0x2b')]);_0x2279f7[_0x2532('0x2f')]=_[_0x2532('0x42')](_0x1a0871[_0x2532('0x2f')]);_0x2279f7[_0x2532('0x30')]=_[_0x2532('0x31')](_0x2279f7[_0x2532('0x2e')],_0x2279f7['query']);_0x2870a4[_0x2532('0x32')]=_[_0x2532('0x31')](_0x2279f7[_0x2532('0x2e')],qs['fields'](_0x1a0871[_0x2532('0x2f')]['fields']));_0x2870a4[_0x2532('0x32')]=_0x2870a4[_0x2532('0x32')][_0x2532('0x43')]?_0x2870a4[_0x2532('0x32')]:_0x2279f7[_0x2532('0x2e')];if(_0x1a0871[_0x2532('0x2f')]['includeAll']){_0x2870a4[_0x2532('0x3d')]=[{'all':!![]}];}_0x2870a4=_[_0x2532('0x3a')]({},_0x2870a4,_0x1a0871['options']);return db[_0x2532('0x2a')][_0x2532('0x44')](_0x2870a4)[_0x2532('0x23')](handleEntityNotFound(_0x1ccc2f,null))['then'](respondWithResult(_0x1ccc2f,null))['catch'](handleError(_0x1ccc2f,null));};exports[_0x2532('0x45')]=function(_0x250d86,_0x254813){var _0x141cc3={'where':{'id':_0x250d86[_0x2532('0x41')]['id']}},_0x1d6e34={};_0x1d6e34[_0x2532('0x2e')]=_[_0x2532('0x42')](db[_0x2532('0x2a')][_0x2532('0x2b')]);_0x141cc3['attributes']=_['intersection'](_0x1d6e34[_0x2532('0x2e')],qs[_0x2532('0x46')](_0x250d86[_0x2532('0x2f')][_0x2532('0x46')]));_0x141cc3[_0x2532('0x32')]=_0x141cc3['attributes'][_0x2532('0x43')]?_0x141cc3[_0x2532('0x32')]:_0x1d6e34[_0x2532('0x2e')];if(_0x250d86[_0x2532('0x2f')][_0x2532('0x47')]){_0x141cc3['include']=[{'all':!![]}];}_0x141cc3=_[_0x2532('0x3a')]({},_0x141cc3,_0x250d86[_0x2532('0x3c')]);return db[_0x2532('0x2a')][_0x2532('0x44')](_0x141cc3)[_0x2532('0x23')](handleEntityNotFound(_0x254813,null))[_0x2532('0x23')](function(_0x421a89){if(_0x421a89){var _0x47818d=_0x421a89[_0x2532('0x48')]({'plain':!![]});_0x47818d=qs[_0x2532('0x49')](_0x47818d,['id',_0x2532('0x4a'),_0x2532('0x4b')]);_0x250d86[_0x2532('0x4c')]=_['omit'](_0x250d86[_0x2532('0x4c')],['id',_0x2532('0x4a'),_0x2532('0x4b')]);return db[_0x2532('0x2a')][_0x2532('0x4d')](_['merge'](_0x47818d,_0x250d86['body']),{'include':_0x250d86[_0x2532('0x2f')][_0x2532('0x47')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x254813,0xc9))['catch'](handleError(_0x254813,null));};exports[_0x2532('0x22')]=function(_0x204b1e,_0x1d85b3){if(_0x204b1e[_0x2532('0x4c')]['id']){delete _0x204b1e[_0x2532('0x4c')]['id'];}return db[_0x2532('0x2a')]['find']({'where':{'id':_0x204b1e['params']['id']}})[_0x2532('0x23')](handleEntityNotFound(_0x1d85b3,null))[_0x2532('0x23')](saveUpdates(_0x204b1e['body'],null))[_0x2532('0x23')](respondWithResult(_0x1d85b3,null))[_0x2532('0x3f')](handleError(_0x1d85b3,null));};exports[_0x2532('0x24')]=function(_0x2272bf,_0x2e9fbe){return db[_0x2532('0x2a')][_0x2532('0x44')]({'where':{'id':_0x2272bf[_0x2532('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e9fbe,null))[_0x2532('0x23')](removeEntity(_0x2e9fbe,null))[_0x2532('0x3f')](handleError(_0x2e9fbe,null));};exports[_0x2532('0x4d')]=function(_0x1b2e39,_0x3b3e7d,_0x347d83){_0x1b2e39[_0x2532('0x4c')][_0x2532('0x27')]=_0x1b2e39[_0x2532('0x4e')][_0x2532('0x4f')];_0x1b2e39[_0x2532('0x4c')]['basename']=_0x1b2e39['file'][_0x2532('0x50')];_0x1b2e39[_0x2532('0x4c')][_0x2532('0x2d')]=_0x1b2e39['file'][_0x2532('0x51')];return db[_0x2532('0x2a')][_0x2532('0x4d')](_0x1b2e39[_0x2532('0x4c')])[_0x2532('0x23')](respondWithResult(_0x3b3e7d,0xc9))[_0x2532('0x3f')](handleError(_0x3b3e7d,null));};exports[_0x2532('0x52')]=function(_0x18638d,_0x9c1759,_0x67b48b){return db[_0x2532('0x2a')][_0x2532('0x53')]({'where':{'id':_0x18638d[_0x2532('0x41')]['id']},'raw':!![]})[_0x2532('0x23')](handleEntityNotFound(_0x9c1759,null))[_0x2532('0x23')](function(_0x54a6c0){if(_0x54a6c0){var _0x9dd842=_0x54a6c0[_0x2532('0x54')]!==null;var _0x20726f=path[_0x2532('0x55')](config[_0x2532('0x56')],_0x2532('0x57'));if(_0x9dd842){_0x20726f=path[_0x2532('0x55')](_0x20726f,_0x2532('0x58'));}var _0x5dea05=path['join'](_0x20726f,_0x54a6c0['basename']);return _0x9c1759['download'](_0x5dea05);}})[_0x2532('0x3f')](handleError(_0x9c1759,null));};
\ No newline at end of file
index 19a909f..32c32af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c03=['path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','util','api'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x8c03,0x1e4));var _0x38c0=function(_0x145c20,_0x3900fb){_0x145c20=_0x145c20-0x0;var _0x18f7dc=_0x8c03[_0x145c20];return _0x18f7dc;};'use strict';var _=require('lodash');var util=require(_0x38c0('0x0'));var logger=require('../../config/logger')(_0x38c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x38c0('0x2'));var rimraf=require(_0x38c0('0x3'));var config=require(_0x38c0('0x4'));var attributes=require(_0x38c0('0x5'));module[_0x38c0('0x6')]=function(_0x30f7ea,_0x4e7f30){return _0x30f7ea[_0x38c0('0x7')]('Attachment',attributes,{'tableName':_0x38c0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7ba3=['moment','bluebird','path','rimraf','./attachment.attributes','exports','define','attachments','api'];(function(_0x357c88,_0xd46cd6){var _0x3a25f6=function(_0x248cf1){while(--_0x248cf1){_0x357c88['push'](_0x357c88['shift']());}};_0x3a25f6(++_0xd46cd6);}(_0x7ba3,0x155));var _0x37ba=function(_0x57eb2d,_0x5e4918){_0x57eb2d=_0x57eb2d-0x0;var _0xd8e18=_0x7ba3[_0x57eb2d];return _0xd8e18;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x37ba('0x0'));var moment=require(_0x37ba('0x1'));var BPromise=require(_0x37ba('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37ba('0x3'));var rimraf=require(_0x37ba('0x4'));var config=require('../../config/environment');var attributes=require(_0x37ba('0x5'));module[_0x37ba('0x6')]=function(_0x1d4400,_0x54d475){return _0x1d4400[_0x37ba('0x7')]('Attachment',attributes,{'tableName':_0x37ba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a861581..60c52f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1fd=['jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','CreateAttachment','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0xa1fd[_0x3fa37f];return _0x5a01d5;};'use strict';var _=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var moment=require(_0xda1f('0x2'));var BPromise=require(_0xda1f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda1f('0x4'));var db=require(_0xda1f('0x5'))['db'];var utils=require(_0xda1f('0x6'));var logger=require(_0xda1f('0x7'))(_0xda1f('0x8'));var config=require('../../config/environment');var jayson=require(_0xda1f('0x9'));var client=jayson[_0xda1f('0xa')][_0xda1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x552ba4,_0x33502e,_0x46a29e){return new BPromise(function(_0x199a8d,_0x338463){return client[_0xda1f('0xc')](_0x552ba4,_0x46a29e)[_0xda1f('0xd')](function(_0x1493f8){logger[_0xda1f('0xe')](_0xda1f('0xf'),_0x33502e,'request\x20sent');logger[_0xda1f('0x10')](_0xda1f('0x11'),_0x33502e,_0xda1f('0x12'),JSON[_0xda1f('0x13')](_0x1493f8));if(_0x1493f8['error']){if(_0x1493f8['error'][_0xda1f('0x14')]===0x1f4){logger[_0xda1f('0x15')](_0xda1f('0xf'),_0x33502e,_0x1493f8[_0xda1f('0x15')][_0xda1f('0x16')]);return _0x338463(_0x1493f8['error'][_0xda1f('0x16')]);}logger[_0xda1f('0x15')](_0xda1f('0xf'),_0x33502e,_0x1493f8[_0xda1f('0x15')][_0xda1f('0x16')]);return _0x199a8d(_0x1493f8[_0xda1f('0x15')]['message']);}else{logger[_0xda1f('0xe')](_0xda1f('0xf'),_0x33502e,_0xda1f('0x12'));_0x199a8d(_0x1493f8[_0xda1f('0x17')]['message']);}})['catch'](function(_0x3020ea){logger['error'](_0xda1f('0xf'),_0x33502e,_0x3020ea);_0x338463(_0x3020ea);});});}exports[_0xda1f('0x18')]=function(_0x1e10af){var _0x59b7bf=this;return new Promise(function(_0xe81fc2,_0xe18a0a){return db['Attachment'][_0xda1f('0x19')](_0x1e10af[_0xda1f('0x1a')],{'raw':_0x1e10af['options']?_0x1e10af[_0xda1f('0x1b')][_0xda1f('0x1c')]===undefined?!![]:![]:!![]})[_0xda1f('0xd')](function(_0xe85e94){logger[_0xda1f('0xe')](_0xda1f('0x18'),_0x1e10af);logger[_0xda1f('0x10')](_0xda1f('0x18'),_0x1e10af,JSON[_0xda1f('0x13')](_0xe85e94));_0xe81fc2(_0xe85e94);})[_0xda1f('0x1d')](function(_0x1d510b){logger[_0xda1f('0x15')]('CreateAttachment',_0x1d510b[_0xda1f('0x16')],_0x1e10af);_0xe18a0a(_0x59b7bf['error'](0x1f4,_0x1d510b[_0xda1f('0x16')]));});});};
\ No newline at end of file
+var _0x515d=['result','catch','CreateAttachment','Attachment','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x40cf05,_0x3f4b81){var _0x1ae5d7=function(_0x43ac59){while(--_0x43ac59){_0x40cf05['push'](_0x40cf05['shift']());}};_0x1ae5d7(++_0x3f4b81);}(_0x515d,0x104));var _0xd515=function(_0x1c6080,_0x6426de){_0x1c6080=_0x1c6080-0x0;var _0x4c53eb=_0x515d[_0x1c6080];return _0x4c53eb;};'use strict';var _=require('lodash');var util=require(_0xd515('0x0'));var moment=require(_0xd515('0x1'));var BPromise=require(_0xd515('0x2'));var rs=require(_0xd515('0x3'));var fs=require('fs');var Redis=require(_0xd515('0x4'));var db=require(_0xd515('0x5'))['db'];var utils=require(_0xd515('0x6'));var logger=require(_0xd515('0x7'))('rpc');var config=require(_0xd515('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd515('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1130fc,_0x43d633,_0x26a25d){return new BPromise(function(_0x2ec6e2,_0x55a0da){return client[_0xd515('0xa')](_0x1130fc,_0x26a25d)[_0xd515('0xb')](function(_0x138086){logger[_0xd515('0xc')](_0xd515('0xd'),_0x43d633,_0xd515('0xe'));logger['debug'](_0xd515('0xf'),_0x43d633,_0xd515('0xe'),JSON[_0xd515('0x10')](_0x138086));if(_0x138086[_0xd515('0x11')]){if(_0x138086['error'][_0xd515('0x12')]===0x1f4){logger[_0xd515('0x11')](_0xd515('0xd'),_0x43d633,_0x138086[_0xd515('0x11')][_0xd515('0x13')]);return _0x55a0da(_0x138086[_0xd515('0x11')][_0xd515('0x13')]);}logger[_0xd515('0x11')](_0xd515('0xd'),_0x43d633,_0x138086[_0xd515('0x11')][_0xd515('0x13')]);return _0x2ec6e2(_0x138086[_0xd515('0x11')][_0xd515('0x13')]);}else{logger['info'](_0xd515('0xd'),_0x43d633,_0xd515('0xe'));_0x2ec6e2(_0x138086[_0xd515('0x14')][_0xd515('0x13')]);}})[_0xd515('0x15')](function(_0x33dbb6){logger[_0xd515('0x11')](_0xd515('0xd'),_0x43d633,_0x33dbb6);_0x55a0da(_0x33dbb6);});});}exports[_0xd515('0x16')]=function(_0x564c4e){var _0x4ae5b7=this;return new Promise(function(_0x43bb12,_0x2b0173){return db[_0xd515('0x17')][_0xd515('0x18')](_0x564c4e[_0xd515('0x19')],{'raw':_0x564c4e[_0xd515('0x1a')]?_0x564c4e[_0xd515('0x1a')][_0xd515('0x1b')]===undefined?!![]:![]:!![]})[_0xd515('0xb')](function(_0x5c7fef){logger[_0xd515('0xc')](_0xd515('0x16'),_0x564c4e);logger['debug'](_0xd515('0x16'),_0x564c4e,JSON[_0xd515('0x10')](_0x5c7fef));_0x43bb12(_0x5c7fef);})[_0xd515('0x15')](function(_0x4e9d06){logger[_0xd515('0x11')](_0xd515('0x16'),_0x4e9d06[_0xd515('0x13')],_0x564c4e);_0x2b0173(_0x4ae5b7[_0xd515('0x11')](0x1f4,_0x4e9d06['message']));});});};
\ No newline at end of file
index 1ee9215..17144ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x5f107e,_0x14e78c){_0x5f107e=_0x5f107e-0x0;var _0x31e50d=_0xdb28[_0x5f107e];return _0x31e50d;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x18488e,_0x1a4965){_0x18488e=_0x18488e-0x0;var _0xcb8abb=_0xdb28[_0x18488e];return _0xcb8abb;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
index a7a98ea..320c1b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42b0=['then','name','blocked','blockedAt','minutes','getLicense','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','User','passport','passport-local','moment','bluebird','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','authenticate','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','Setting','findOne','adSsoEnabled','blockDuration','password','salt','online','admin','user','agent'];(function(_0x7fd596,_0x3a2875){var _0x595292=function(_0x43d125){while(--_0x43d125){_0x7fd596['push'](_0x7fd596['shift']());}};_0x595292(++_0x3a2875);}(_0x42b0,0xbc));var _0x042b=function(_0x378830,_0xb532d7){_0x378830=_0x378830-0x0;var _0x4e4348=_0x42b0[_0x378830];return _0x4e4348;};'use strict';var passport=require(_0x042b('0x0'));var LocalStrategy=require(_0x042b('0x1'))['Strategy'];var moment=require(_0x042b('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x042b('0x3'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0x042b('0x4'));var utils=require(_0x042b('0x5'));var config=require(_0x042b('0x6'));var logger=require(_0x042b('0x7'))(_0x042b('0x8'));function isActiveDirectoryConfigured(_0x5d194a){var _0x51c41c=![];if(typeof _0x5d194a[_0x042b('0x9')]!==_0x042b('0xa')){_0x51c41c=_0x5d194a['activedirectory']['baseDN']&&_0x5d194a[_0x042b('0x9')]['url']&&_0x5d194a[_0x042b('0x9')]['domain'];}return _0x51c41c;}function adAuthenticate(_0x3f01e1,_0x2ba4c2,_0x1d2796){return new BPromise(function(_0x25dec5,_0x2aba68){try{var _0x414f4a=new ActiveDirectory(_0x3f01e1);_0x414f4a[_0x042b('0xb')](_0x2ba4c2,_0x1d2796,function(_0xfc9528,_0x21bf5c){if(_0xfc9528){logger[_0x042b('0xc')](_0x042b('0xd'),_0x2ba4c2,util[_0x042b('0xe')](_0xfc9528,{'showHidden':![],'depth':null}));_0x2aba68(_0x042b('0xf'));}else if(!_0x21bf5c){logger['error'](_0x042b('0x10'),_0x2ba4c2);_0x2aba68('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x25dec5(_0x21bf5c);}});}catch(_0x1e5626){_0x2aba68(_0x1e5626);}});}function ActiveDirectoryAuthenticate(_0x5681bd,_0x31c22e,_0x32238e,_0x41f679){var _0xf9f4f3,_0x30c86f;if(!isActiveDirectoryConfigured(config)){logger[_0x042b('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x31c22e);return _0x41f679(null,![],{'message':_0x042b('0xf')});}return db[_0x042b('0x11')][_0x042b('0x12')]({'where':{'id':0x1},'attributes':[_0x042b('0x13'),_0x042b('0x14')],'raw':!![]})['then'](function(_0x2e2cb6){_0xf9f4f3=_0x2e2cb6;if(!_0xf9f4f3[_0x042b('0x13')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x31c22e);throw new Error(_0x042b('0xf'));}return _0x5681bd[_0x042b('0x12')]({'logging':!![],'attributes':['id','name',_0x042b('0x15'),_0x042b('0x16'),'role','disabled','blocked','blockedAt',_0x042b('0x17')],'where':{'name':_0x31c22e,'role':{'$or':[_0x042b('0x18'),_0x042b('0x19'),_0x042b('0x1a')]},'adSsoEnabled':!![]}});})[_0x042b('0x1b')](function(_0x50be84){if(!_0x50be84||_0x50be84&&_0x50be84[_0x042b('0x1c')]!==_0x31c22e){throw new Error(_0x042b('0xf'));}_0x30c86f=_0x50be84;var _0x533599=_0x30c86f['name']+'@'+config[_0x042b('0x9')]['domain'];return adAuthenticate(config['activedirectory'],_0x533599,_0x32238e);})[_0x042b('0x1b')](function(_0x216c1c){if(_0x30c86f['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0xf9f4f3[_0x042b('0x14')]>0x0){if(_0x30c86f[_0x042b('0x1d')]){if(moment(_0x30c86f[_0x042b('0x1e')])['add'](_0xf9f4f3[_0x042b('0x14')],_0x042b('0x1f'))>moment()){throw new Error(_0x042b('0xf'));}return utils['clearBlockUser'](_0x30c86f,0x0,![],null)[_0x042b('0x1b')](function(){return utils[_0x042b('0x20')](_0x30c86f);})['then'](function(){return _0x41f679(null,_0x30c86f);});}else{return utils[_0x042b('0x20')](_0x30c86f)[_0x042b('0x1b')](function(){return _0x41f679(null,_0x30c86f);});}}else{return utils[_0x042b('0x20')](_0x30c86f)[_0x042b('0x1b')](function(){return _0x41f679(null,_0x30c86f);});}})['catch'](function(_0x5b5fe7){return _0x41f679(null,![],_0x5b5fe7);});}function handleError(_0x572d6a,_0x5c0c41,_0x34bb9e){return _0x572d6a['status'](_0x5c0c41||0x1f4)[_0x042b('0x21')]({'message':_0x34bb9e?_0x34bb9e[_0x042b('0x22')]||_0x34bb9e:''});}exports[_0x042b('0x23')]=function(_0x379667,_0x318ba1,_0x157501){passport[_0x042b('0xb')](_0x042b('0x24'),function(_0x41a880,_0x162fea,_0x2344f4){var _0x70d39d=_0x41a880||_0x2344f4;if(_0x70d39d){return handleError(_0x318ba1,0x191,_0x70d39d);}if(!_0x162fea){return handleError(_0x318ba1,0x194,{'message':_0x042b('0x25')});}else{var _0x211e08={'payload':{'id':_0x162fea['id'],'role':_0x162fea[_0x042b('0x26')]},'options':{'expiresIn':0x15180}};return authService[_0x042b('0x27')](_0x211e08)['then'](function(_0x139cf4){_0x318ba1[_0x042b('0x28')]({'id':_0x162fea['id'],'token':_0x139cf4,'statusCall':'','isAlreadyLogged':_0x162fea[_0x042b('0x17')]});});}})(_0x379667,_0x318ba1,_0x157501);};passport[_0x042b('0x29')](_0x042b('0x24'),new LocalStrategy({'usernameField':_0x042b('0x1c'),'passwordField':'password'},function(_0x2738d0,_0x45207f,_0x58cf8e){return ActiveDirectoryAuthenticate(db[_0x042b('0x2a')],_0x2738d0,_0x45207f,_0x58cf8e);}));
\ No newline at end of file
+var _0x5685=['use','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/environment','../../config/logger','api','undefined','activedirectory','url','domain','authenticate','error','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','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','minutes','clearBlockUser','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online'];(function(_0x43660b,_0x42c7e4){var _0x1a492f=function(_0x4fa7d2){while(--_0x4fa7d2){_0x43660b['push'](_0x43660b['shift']());}};_0x1a492f(++_0x42c7e4);}(_0x5685,0x94));var _0x5568=function(_0x1882d2,_0x285bb5){_0x1882d2=_0x1882d2-0x0;var _0x557a14=_0x5685[_0x1882d2];return _0x557a14;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x5568('0x0'))[_0x5568('0x1')];var moment=require(_0x5568('0x2'));var ActiveDirectory=require(_0x5568('0x3'));var BPromise=require(_0x5568('0x4'));var util=require(_0x5568('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x5568('0x6'));var utils=require('../../config/utils');var config=require(_0x5568('0x7'));var logger=require(_0x5568('0x8'))(_0x5568('0x9'));function isActiveDirectoryConfigured(_0x1c4a69){var _0x3dcad3=![];if(typeof _0x1c4a69['activedirectory']!==_0x5568('0xa')){_0x3dcad3=_0x1c4a69[_0x5568('0xb')]['baseDN']&&_0x1c4a69[_0x5568('0xb')][_0x5568('0xc')]&&_0x1c4a69[_0x5568('0xb')][_0x5568('0xd')];}return _0x3dcad3;}function adAuthenticate(_0x43606f,_0x2ab234,_0x21f0b6){return new BPromise(function(_0x325a11,_0x3de9a8){try{var _0x52c410=new ActiveDirectory(_0x43606f);_0x52c410[_0x5568('0xe')](_0x2ab234,_0x21f0b6,function(_0x267141,_0x2d7482){if(_0x267141){logger[_0x5568('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x2ab234,util[_0x5568('0x10')](_0x267141,{'showHidden':![],'depth':null}));_0x3de9a8(_0x5568('0x11'));}else if(!_0x2d7482){logger[_0x5568('0xf')](_0x5568('0x12'),_0x2ab234);_0x3de9a8(_0x5568('0x11'));}else{_0x325a11(_0x2d7482);}});}catch(_0x254e61){_0x3de9a8(_0x254e61);}});}function ActiveDirectoryAuthenticate(_0x3996a6,_0xbcecb2,_0x3e5690,_0x1ffb4f){var _0x3e6d71,_0x1e7fed;if(!isActiveDirectoryConfigured(config)){logger[_0x5568('0xf')](_0x5568('0x13'),_0xbcecb2);return _0x1ffb4f(null,![],{'message':_0x5568('0x11')});}return db[_0x5568('0x14')][_0x5568('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x5568('0x16')],'raw':!![]})[_0x5568('0x17')](function(_0x13bfdc){_0x3e6d71=_0x13bfdc;if(!_0x3e6d71[_0x5568('0x18')]){logger['error'](_0x5568('0x19'),_0xbcecb2);throw new Error(_0x5568('0x11'));}return _0x3996a6['findOne']({'logging':!![],'attributes':['id',_0x5568('0x1a'),_0x5568('0x1b'),_0x5568('0x1c'),_0x5568('0x1d'),_0x5568('0x1e'),_0x5568('0x1f'),_0x5568('0x20'),'online'],'where':{'name':_0xbcecb2,'role':{'$or':[_0x5568('0x21'),_0x5568('0x22'),_0x5568('0x23')]},'adSsoEnabled':!![]}});})[_0x5568('0x17')](function(_0x45e593){if(!_0x45e593||_0x45e593&&_0x45e593[_0x5568('0x1a')]!==_0xbcecb2){throw new Error(_0x5568('0x11'));}_0x1e7fed=_0x45e593;var _0x20e5af=_0x1e7fed[_0x5568('0x1a')]+'@'+config[_0x5568('0xb')][_0x5568('0xd')];return adAuthenticate(config[_0x5568('0xb')],_0x20e5af,_0x3e5690);})[_0x5568('0x17')](function(_0x254c8c){if(_0x1e7fed[_0x5568('0x1e')]){throw new Error(_0x5568('0x11'));}if(_0x3e6d71[_0x5568('0x16')]>0x0){if(_0x1e7fed['blocked']){if(moment(_0x1e7fed[_0x5568('0x20')])['add'](_0x3e6d71['blockDuration'],_0x5568('0x24'))>moment()){throw new Error(_0x5568('0x11'));}return utils[_0x5568('0x25')](_0x1e7fed,0x0,![],null)[_0x5568('0x17')](function(){return utils[_0x5568('0x26')](_0x1e7fed);})['then'](function(){return _0x1ffb4f(null,_0x1e7fed);});}else{return utils['getLicense'](_0x1e7fed)['then'](function(){return _0x1ffb4f(null,_0x1e7fed);});}}else{return utils[_0x5568('0x26')](_0x1e7fed)['then'](function(){return _0x1ffb4f(null,_0x1e7fed);});}})[_0x5568('0x27')](function(_0x4a6736){return _0x1ffb4f(null,![],_0x4a6736);});}function handleError(_0x499637,_0x4073e9,_0x5bcedf){return _0x499637[_0x5568('0x28')](_0x4073e9||0x1f4)[_0x5568('0x29')]({'message':_0x5bcedf?_0x5bcedf['message']||_0x5bcedf:''});}exports[_0x5568('0x2a')]=function(_0x84b444,_0x3d0285,_0x52fa87){passport['authenticate'](_0x5568('0x2b'),function(_0x41d63a,_0x22408d,_0x1f362a){var _0x1e55d1=_0x41d63a||_0x1f362a;if(_0x1e55d1){return handleError(_0x3d0285,0x191,_0x1e55d1);}if(!_0x22408d){return handleError(_0x3d0285,0x194,{'message':_0x5568('0x2c')});}else{var _0x3be8b8={'payload':{'id':_0x22408d['id'],'role':_0x22408d[_0x5568('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x5568('0x2d')](_0x3be8b8)['then'](function(_0xf302a){_0x3d0285[_0x5568('0x2e')]({'id':_0x22408d['id'],'token':_0xf302a,'statusCall':'','isAlreadyLogged':_0x22408d[_0x5568('0x2f')]});});}})(_0x84b444,_0x3d0285,_0x52fa87);};passport[_0x5568('0x30')]('ad-login',new LocalStrategy({'usernameField':_0x5568('0x1a'),'passwordField':_0x5568('0x1b')},function(_0x313f55,_0x252d86,_0x516957){return ActiveDirectoryAuthenticate(db['User'],_0x313f55,_0x252d86,_0x516957);}));
\ No newline at end of file
index a149834..5624943 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05f1=['./authActiveDirectory.controller','post','login','exports','Router'];(function(_0x2395c8,_0x801582){var _0x2f9a12=function(_0x4c8cf5){while(--_0x4c8cf5){_0x2395c8['push'](_0x2395c8['shift']());}};_0x2f9a12(++_0x801582);}(_0x05f1,0xc7));var _0x105f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x05f1[_0x17d9e3];return _0x14192d;};'use strict';var express=require('express');var router=express[_0x105f('0x0')]();var controller=require(_0x105f('0x1'));router[_0x105f('0x2')]('/',controller[_0x105f('0x3')]);module[_0x105f('0x4')]=router;
\ No newline at end of file
+var _0xc69d=['./authActiveDirectory.controller','Router'];(function(_0x14912b,_0xbfbdb4){var _0x479757=function(_0x5bfa34){while(--_0x5bfa34){_0x14912b['push'](_0x14912b['shift']());}};_0x479757(++_0xbfbdb4);}(_0xc69d,0x197));var _0xdc69=function(_0xda6ad1,_0x5f09e3){_0xda6ad1=_0xda6ad1-0x0;var _0xedc3a5=_0xc69d[_0xda6ad1];return _0xedc3a5;};'use strict';var express=require('express');var router=express[_0xdc69('0x0')]();var controller=require(_0xdc69('0x1'));router['post']('/',controller['login']);module['exports']=router;
\ No newline at end of file
index 8b205b6..b57a47a 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(_0x36a0bd,_0x2513ba){var _0x3054a7=function(_0x233e4c){while(--_0x233e4c){_0x36a0bd['push'](_0x36a0bd['shift']());}};_0x3054a7(++_0x2513ba);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(_0x3643d5,_0x6e02f5){var _0x1f29d7=function(_0x4d89df){while(--_0x4d89df){_0x3643d5['push'](_0x3643d5['shift']());}};_0x1f29d7(++_0x6e02f5);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 ec467ae..82b4c59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc07=['Router','./authGoogle.controller','get','login','callback','isMiddleware','setTokenCookie','express','passport'];(function(_0x304efa,_0x4487d3){var _0xd12048=function(_0x2c8ae3){while(--_0x2c8ae3){_0x304efa['push'](_0x304efa['shift']());}};_0xd12048(++_0x4487d3);}(_0xcc07,0xbb));var _0x7cc0=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0xcc07[_0x47408e];return _0x1636bc;};'use strict';var express=require(_0x7cc0('0x0'));var passport=require(_0x7cc0('0x1'));var router=express[_0x7cc0('0x2')]();var controller=require(_0x7cc0('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x7cc0('0x4')]('/',controller[_0x7cc0('0x5')]);router[_0x7cc0('0x4')]('/callback',controller[_0x7cc0('0x6')],authService[_0x7cc0('0x7')],userController[_0x7cc0('0x5')],authService[_0x7cc0('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0xc7c6=['../user/user.controller.js','../../components/auth/service','get','callback','login','exports','express','passport','Router'];(function(_0x549d2b,_0x2acfaa){var _0x2f7f64=function(_0x25cdc5){while(--_0x25cdc5){_0x549d2b['push'](_0x549d2b['shift']());}};_0x2f7f64(++_0x2acfaa);}(_0xc7c6,0x14a));var _0x6c7c=function(_0x131a47,_0x1a0f95){_0x131a47=_0x131a47-0x0;var _0x5359c0=_0xc7c6[_0x131a47];return _0x5359c0;};'use strict';var express=require(_0x6c7c('0x0'));var passport=require(_0x6c7c('0x1'));var router=express[_0x6c7c('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x6c7c('0x3'));var authService=require(_0x6c7c('0x4'));router['get']('/',controller['login']);router[_0x6c7c('0x5')]('/callback',controller[_0x6c7c('0x6')],authService['isMiddleware'],userController[_0x6c7c('0x7')],authService['setTokenCookie']);module[_0x6c7c('0x8')]=router;
\ No newline at end of file
index e9a440b..4ab52bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fd2=['Smtp','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','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/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','passport-local','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','client','http','Setting','findOne','blockDuration','then','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email'];(function(_0x1b9c2a,_0x50582e){var _0x21ab47=function(_0x3382c6){while(--_0x3382c6){_0x1b9c2a['push'](_0x1b9c2a['shift']());}};_0x21ab47(++_0x50582e);}(_0x2fd2,0x130));var _0x22fd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2fd2[_0x3947c9];return _0x2e7871;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x22fd('0x0'))[_0x22fd('0x1')];var jayson=require(_0x22fd('0x2'));var _=require('lodash');var rs=require(_0x22fd('0x3'));var moment=require(_0x22fd('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x22fd('0x5'));var utils=require('../../config/utils');var client=jayson[_0x22fd('0x6')][_0x22fd('0x7')]({'port':0x232b});function localAuthenticate(_0x5dd36b,_0xf4b74,_0x35690d,_0x2a03d3){var _0x125df1,_0x3a6276;return db[_0x22fd('0x8')][_0x22fd('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x22fd('0xa')],'raw':!![]})[_0x22fd('0xb')](function(_0x5a1c2d){_0x125df1=_0x5a1c2d;return _0x5dd36b[_0x22fd('0x9')]({'attributes':['id',_0x22fd('0xc'),_0x22fd('0xd'),_0x22fd('0xe'),'role',_0x22fd('0xf'),_0x22fd('0x10'),_0x22fd('0x11'),_0x22fd('0x12')],'where':{'name':_0xf4b74,'role':{'$or':[_0x22fd('0x13'),_0x22fd('0x14'),'agent']}}});})[_0x22fd('0xb')](function(_0x454e79){if(!_0x454e79||_0x454e79&&_0x454e79[_0x22fd('0xc')]!==_0xf4b74){throw new Error(_0x22fd('0x15'));}else{_0x3a6276=_0x454e79;return _0x3a6276;}})[_0x22fd('0xb')](function(){_0x3a6276[_0x22fd('0x16')](_0x35690d,function(_0x3d70ec,_0x393ea8){var _0x162230=_0x3a6276['loginAttempts']+0x1;if(_0x3d70ec){return _0x2a03d3(_0x3d70ec);}else if(!_0x393ea8){if(_0x3a6276[_0x22fd('0xf')]){return _0x2a03d3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x125df1[_0x22fd('0x17')]>0x0){if(_0x3a6276[_0x22fd('0x10')]){if(_0x125df1[_0x22fd('0xa')]>0x0){if(moment(_0x3a6276[_0x22fd('0x11')])[_0x22fd('0x18')](_0x125df1[_0x22fd('0xa')],_0x22fd('0x19'))>moment()){return _0x2a03d3(null,![],{'message':_0x22fd('0x15')});}else{return utils['clearBlockUser'](_0x3a6276,_0x162230,![],null)[_0x22fd('0xb')](function(){return _0x2a03d3(null,![],{'message':_0x22fd('0x15')});});}}else{return _0x2a03d3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x162230>=_0x125df1[_0x22fd('0x17')]){return utils[_0x22fd('0x1a')](_0x3a6276,0x0,!![],moment())[_0x22fd('0xb')](function(){return _0x2a03d3(null,![],{'message':_0x22fd('0x15')});});}else{return utils[_0x22fd('0x1a')](_0x3a6276,_0x162230,![],null)[_0x22fd('0xb')](function(){return _0x2a03d3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2a03d3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3a6276[_0x22fd('0xf')]){return _0x2a03d3(null,![],{'message':_0x22fd('0x15')});}else if(_0x125df1[_0x22fd('0x17')]>0x0){if(_0x3a6276[_0x22fd('0x10')]){if(_0x125df1[_0x22fd('0xa')]>0x0){if(moment(_0x3a6276['blockedAt'])[_0x22fd('0x18')](_0x125df1[_0x22fd('0xa')],'minutes')>moment()){return _0x2a03d3(null,![],{'message':_0x22fd('0x15')});}else{return utils[_0x22fd('0x1a')](_0x3a6276,0x0,![],null)[_0x22fd('0xb')](function(){return utils[_0x22fd('0x1b')](_0x3a6276);})['then'](function(){return _0x2a03d3(null,_0x3a6276);});}}else{return _0x2a03d3(null,![],{'message':_0x22fd('0x15')});}}else{return utils[_0x22fd('0x1a')](_0x3a6276,0x0,![],null)[_0x22fd('0xb')](function(){return utils['getLicense'](_0x3a6276);})['then'](function(){return _0x2a03d3(null,_0x3a6276);})['catch'](function(_0x100454){return _0x2a03d3(null,![],_0x100454);});}}else{if(_0x3a6276[_0x22fd('0x10')]){return _0x2a03d3(null,![],{'message':_0x22fd('0x15')});}else{return utils['getLicense'](_0x3a6276)[_0x22fd('0xb')](function(){return _0x2a03d3(null,_0x3a6276);});}}}});})[_0x22fd('0x1c')](function(_0x38c6fe){return _0x2a03d3(null,![],_0x38c6fe);});}function sendServiceMail(_0x4d311f){return db[_0x22fd('0x1d')][_0x22fd('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x22fd('0xc'),_0x22fd('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x22fd('0x20')}]})[_0x22fd('0xb')](function(_0x157467){if(!_0x157467){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1ddf31={'tls':{'rejectUnauthorized':![]}};if(_0x157467[_0x22fd('0x20')]['service']){_0x1ddf31['service']=_0x157467[_0x22fd('0x20')]['service'];}else{_0x1ddf31[_0x22fd('0x21')]=_0x157467[_0x22fd('0x20')][_0x22fd('0x21')];_0x1ddf31[_0x22fd('0x22')]=_0x157467[_0x22fd('0x20')]['port'];_0x1ddf31[_0x22fd('0x23')]=_0x157467[_0x22fd('0x20')][_0x22fd('0x23')];}if(_0x157467[_0x22fd('0x20')][_0x22fd('0x24')]){_0x1ddf31[_0x22fd('0x25')]={'user':_0x157467['Smtp'][_0x22fd('0x14')],'pass':_0x157467['Smtp'][_0x22fd('0x26')]};}var _0x2d6d4c={'account':_0x1ddf31,'message':_[_0x22fd('0x27')]({'from':util[_0x22fd('0x28')](_0x22fd('0x29'),_0x157467['name'],_0x157467[_0x22fd('0x1f')]||_0x157467[_0x22fd('0x20')][_0x22fd('0x14')])},_0x4d311f)};return client[_0x22fd('0x2a')](_0x22fd('0x2b'),_0x2d6d4c);})[_0x22fd('0xb')](function(_0x2eeb07){if(_0x2eeb07[_0x22fd('0x2c')]){throw new Error(util[_0x22fd('0x28')](_0x22fd('0x2d'),_0x2eeb07[_0x22fd('0x2c')][_0x22fd('0x2e')]||JSON[_0x22fd('0x2f')](_0x2eeb07[_0x22fd('0x2c')])));}return!![];});}function handleError(_0x1f510b,_0x50fd04,_0x188bb9){return _0x1f510b['status'](_0x50fd04||0x1f4)[_0x22fd('0x30')]({'message':_0x188bb9?_0x188bb9[_0x22fd('0x2e')]||_0x188bb9:''});}exports[_0x22fd('0x31')]=function(_0x2555c0,_0xc8b4d3,_0x1c4d0b){passport[_0x22fd('0x16')](_0x22fd('0x32'),function(_0x581ac9,_0x2210d4,_0x598fe9){var _0x1ee458=_0x581ac9||_0x598fe9;if(_0x1ee458){return handleError(_0xc8b4d3,0x191,_0x1ee458);}if(!_0x2210d4){return handleError(_0xc8b4d3,0x194,{'message':_0x22fd('0x33')});}else{var _0x140f0d={'payload':{'id':_0x2210d4['id'],'role':_0x2210d4[_0x22fd('0x34')]},'options':{'expiresIn':0x15180}};return authService[_0x22fd('0x35')](_0x140f0d)[_0x22fd('0xb')](function(_0x1f2413){_0xc8b4d3['json']({'id':_0x2210d4['id'],'token':_0x1f2413,'statusCall':'','isAlreadyLogged':_0x2210d4[_0x22fd('0x36')]});});}})(_0x2555c0,_0xc8b4d3,_0x1c4d0b);};exports[_0x22fd('0x37')]=function(_0x32ff4f,_0x192c44,_0x46fe1d){if(!_0x32ff4f[_0x22fd('0x38')]['email']){return handleError(_0x192c44,0x1f4,{'message':_0x22fd('0x39')});}var _0x5b9a07=rs['generate']();_0x32ff4f[_0x22fd('0x38')][_0x22fd('0x1f')]=_0x32ff4f['body'][_0x22fd('0x1f')][_0x22fd('0x3a')]()[_0x22fd('0x3b')]();var _0xeb9e81;return db[_0x22fd('0x8')][_0x22fd('0x9')]({'where':{'id':0x1},'attributes':[_0x22fd('0x17'),_0x22fd('0xa')],'raw':!![]})['then'](function(_0x54cd8d){_0xeb9e81=_0x54cd8d;return db[_0x22fd('0x3c')]['find']({'where':{'email':_0x32ff4f['body'][_0x22fd('0x1f')]}});})[_0x22fd('0xb')](function(_0x2c912c){if(!_0x2c912c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2c912c[_0x22fd('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2c912c[_0x22fd('0x10')]){if(moment(_0x2c912c['blockedAt'])[_0x22fd('0x18')](_0xeb9e81[_0x22fd('0xa')],_0x22fd('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2c912c['blocked']=![];_0x2c912c[_0x22fd('0x11')]=null;}}_0x2c912c[_0x22fd('0x3d')]=_0x5b9a07;_0x2c912c[_0x22fd('0x3e')]=Date[_0x22fd('0x3f')]()+0x36ee80;return _0x2c912c[_0x22fd('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x32ff4f[_0x22fd('0x38')][_0x22fd('0x1f')],'subject':_0x22fd('0x41'),'text':_0x22fd('0x42')+_0x22fd('0x43')+_0x22fd('0x44')+_0x32ff4f['headers'][_0x22fd('0x21')]+_0x22fd('0x45')+_0x5b9a07+'\x0a\x0a'+_0x22fd('0x46')});})[_0x22fd('0xb')](function(){_0x192c44[_0x22fd('0x47')](0xc8)['send']({'message':_0x22fd('0x48')});})[_0x22fd('0x1c')](function(_0x1fc095){return handleError(_0x192c44,0x1f4,_0x1fc095);});};exports[_0x22fd('0x49')]=function(_0x3e9aa2,_0x530dba,_0x58b540){return db[_0x22fd('0x3c')][_0x22fd('0x1e')]({'where':{'resetPasswordToken':_0x3e9aa2[_0x22fd('0x4a')][_0x22fd('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x22fd('0xb')](function(_0x3ed17e){if(!_0x3ed17e){throw new Error(_0x22fd('0x4c'));}return db[_0x22fd('0x8')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0x22fd('0x4d')]})[_0x22fd('0xb')](function(_0x568f36){if(_0x568f36[_0x22fd('0x4e')])authService['validatePasswordPattern'](_0x3e9aa2['body'][_0x22fd('0xd')]);if(!_0x568f36[_0x22fd('0x4f')]||!_0x3ed17e[_0x22fd('0x50')])return _0x3ed17e;authService[_0x22fd('0x51')](_0x3e9aa2['body'][_0x22fd('0xd')],_0x3ed17e[_0x22fd('0x50')],_0x568f36[_0x22fd('0x4d')]);return _0x3ed17e;})[_0x22fd('0xb')](function(){_0x3ed17e[_0x22fd('0xd')]=_0x3e9aa2[_0x22fd('0x38')]['password'];_0x3ed17e['resetPasswordToken']=null;_0x3ed17e[_0x22fd('0x3e')]=null;return _0x3ed17e[_0x22fd('0x40')]();});})['then'](function(){_0x530dba['status'](0xc8)[_0x22fd('0x30')]({'message':_0x22fd('0x52')});})['catch'](function(_0x5d96a0){return handleError(_0x530dba,0x1f4,_0x5d96a0);});};passport[_0x22fd('0x53')](_0x22fd('0x32'),new LocalStrategy({'usernameField':'name','passwordField':_0x22fd('0xd')},function(_0x2f035a,_0x366ecf,_0x1b21b8){return localAuthenticate(db[_0x22fd('0x3c')],_0x2f035a,_0x366ecf,_0x1b21b8);}));
\ No newline at end of file
+var _0xfa6c=['../../config/utils','http','Setting','allowedLoginAttempts','blockDuration','then','password','salt','role','blocked','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','send','Password\x20reset!','use','util','passport','passport-local','jayson/promise','randomstring','moment'];(function(_0x4a9426,_0x6656fe){var _0x409f7e=function(_0x5970cb){while(--_0x5970cb){_0x4a9426['push'](_0x4a9426['shift']());}};_0x409f7e(++_0x6656fe);}(_0xfa6c,0x152));var _0xcfa6=function(_0x3ae049,_0x90ecd6){_0x3ae049=_0x3ae049-0x0;var _0x1939a2=_0xfa6c[_0x3ae049];return _0x1939a2;};'use strict';var util=require(_0xcfa6('0x0'));var passport=require(_0xcfa6('0x1'));var LocalStrategy=require(_0xcfa6('0x2'))['Strategy'];var jayson=require(_0xcfa6('0x3'));var _=require('lodash');var rs=require(_0xcfa6('0x4'));var moment=require(_0xcfa6('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0xcfa6('0x6'));var client=jayson['client'][_0xcfa6('0x7')]({'port':0x232b});function localAuthenticate(_0x2512f7,_0x386bce,_0x16c20d,_0x3ac64a){var _0x47eea0,_0x5bd6b8;return db[_0xcfa6('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xcfa6('0x9'),_0xcfa6('0xa')],'raw':!![]})[_0xcfa6('0xb')](function(_0x4a3efd){_0x47eea0=_0x4a3efd;return _0x2512f7['findOne']({'attributes':['id','name',_0xcfa6('0xc'),_0xcfa6('0xd'),_0xcfa6('0xe'),'disabled',_0xcfa6('0xf'),'blockedAt',_0xcfa6('0x10')],'where':{'name':_0x386bce,'role':{'$or':[_0xcfa6('0x11'),_0xcfa6('0x12'),_0xcfa6('0x13')]}}});})[_0xcfa6('0xb')](function(_0x5e59e3){if(!_0x5e59e3||_0x5e59e3&&_0x5e59e3[_0xcfa6('0x14')]!==_0x386bce){throw new Error(_0xcfa6('0x15'));}else{_0x5bd6b8=_0x5e59e3;return _0x5bd6b8;}})['then'](function(){_0x5bd6b8[_0xcfa6('0x16')](_0x16c20d,function(_0x33b609,_0x39400a){var _0x4b39bf=_0x5bd6b8['loginAttempts']+0x1;if(_0x33b609){return _0x3ac64a(_0x33b609);}else if(!_0x39400a){if(_0x5bd6b8['disabled']){return _0x3ac64a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x47eea0[_0xcfa6('0x9')]>0x0){if(_0x5bd6b8[_0xcfa6('0xf')]){if(_0x47eea0['blockDuration']>0x0){if(moment(_0x5bd6b8[_0xcfa6('0x17')])[_0xcfa6('0x18')](_0x47eea0[_0xcfa6('0xa')],_0xcfa6('0x19'))>moment()){return _0x3ac64a(null,![],{'message':_0xcfa6('0x15')});}else{return utils[_0xcfa6('0x1a')](_0x5bd6b8,_0x4b39bf,![],null)[_0xcfa6('0xb')](function(){return _0x3ac64a(null,![],{'message':_0xcfa6('0x15')});});}}else{return _0x3ac64a(null,![],{'message':_0xcfa6('0x15')});}}else{if(_0x4b39bf>=_0x47eea0['allowedLoginAttempts']){return utils['clearBlockUser'](_0x5bd6b8,0x0,!![],moment())[_0xcfa6('0xb')](function(){return _0x3ac64a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xcfa6('0x1a')](_0x5bd6b8,_0x4b39bf,![],null)[_0xcfa6('0xb')](function(){return _0x3ac64a(null,![],{'message':_0xcfa6('0x15')});});}}}else{return _0x3ac64a(null,![],{'message':_0xcfa6('0x15')});}}else{if(_0x5bd6b8[_0xcfa6('0x1b')]){return _0x3ac64a(null,![],{'message':_0xcfa6('0x15')});}else if(_0x47eea0[_0xcfa6('0x9')]>0x0){if(_0x5bd6b8['blocked']){if(_0x47eea0['blockDuration']>0x0){if(moment(_0x5bd6b8[_0xcfa6('0x17')])[_0xcfa6('0x18')](_0x47eea0[_0xcfa6('0xa')],_0xcfa6('0x19'))>moment()){return _0x3ac64a(null,![],{'message':_0xcfa6('0x15')});}else{return utils[_0xcfa6('0x1a')](_0x5bd6b8,0x0,![],null)[_0xcfa6('0xb')](function(){return utils[_0xcfa6('0x1c')](_0x5bd6b8);})['then'](function(){return _0x3ac64a(null,_0x5bd6b8);});}}else{return _0x3ac64a(null,![],{'message':_0xcfa6('0x15')});}}else{return utils[_0xcfa6('0x1a')](_0x5bd6b8,0x0,![],null)[_0xcfa6('0xb')](function(){return utils[_0xcfa6('0x1c')](_0x5bd6b8);})[_0xcfa6('0xb')](function(){return _0x3ac64a(null,_0x5bd6b8);})[_0xcfa6('0x1d')](function(_0x2d7a96){return _0x3ac64a(null,![],_0x2d7a96);});}}else{if(_0x5bd6b8[_0xcfa6('0xf')]){return _0x3ac64a(null,![],{'message':_0xcfa6('0x15')});}else{return utils[_0xcfa6('0x1c')](_0x5bd6b8)[_0xcfa6('0xb')](function(){return _0x3ac64a(null,_0x5bd6b8);});}}}});})['catch'](function(_0x41abd3){return _0x3ac64a(null,![],_0x41abd3);});}function sendServiceMail(_0x5200d7){return db[_0xcfa6('0x1e')][_0xcfa6('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xcfa6('0x14'),_0xcfa6('0x20')],'include':[{'model':db[_0xcfa6('0x21')],'as':_0xcfa6('0x22')}]})[_0xcfa6('0xb')](function(_0x4eeaf7){if(!_0x4eeaf7){throw new Error(_0xcfa6('0x23'));}var _0x3bd6bb={'tls':{'rejectUnauthorized':![]}};if(_0x4eeaf7[_0xcfa6('0x22')]['service']){_0x3bd6bb[_0xcfa6('0x24')]=_0x4eeaf7[_0xcfa6('0x22')][_0xcfa6('0x24')];}else{_0x3bd6bb[_0xcfa6('0x25')]=_0x4eeaf7['Smtp'][_0xcfa6('0x25')];_0x3bd6bb[_0xcfa6('0x26')]=_0x4eeaf7[_0xcfa6('0x22')][_0xcfa6('0x26')];_0x3bd6bb['secure']=_0x4eeaf7[_0xcfa6('0x22')][_0xcfa6('0x27')];}if(_0x4eeaf7[_0xcfa6('0x22')]['authentication']){_0x3bd6bb[_0xcfa6('0x28')]={'user':_0x4eeaf7['Smtp'][_0xcfa6('0x12')],'pass':_0x4eeaf7[_0xcfa6('0x22')][_0xcfa6('0x29')]};}var _0x20775e={'account':_0x3bd6bb,'message':_[_0xcfa6('0x2a')]({'from':util[_0xcfa6('0x2b')](_0xcfa6('0x2c'),_0x4eeaf7[_0xcfa6('0x14')],_0x4eeaf7[_0xcfa6('0x20')]||_0x4eeaf7[_0xcfa6('0x22')][_0xcfa6('0x12')])},_0x5200d7)};return client[_0xcfa6('0x2d')](_0xcfa6('0x2e'),_0x20775e);})[_0xcfa6('0xb')](function(_0x2e041b){if(_0x2e041b[_0xcfa6('0x2f')]){throw new Error(util[_0xcfa6('0x2b')](_0xcfa6('0x30'),_0x2e041b['error'][_0xcfa6('0x31')]||JSON['stringify'](_0x2e041b[_0xcfa6('0x2f')])));}return!![];});}function handleError(_0x27b0ec,_0xaceaaa,_0x3c574e){return _0x27b0ec[_0xcfa6('0x32')](_0xaceaaa||0x1f4)['send']({'message':_0x3c574e?_0x3c574e[_0xcfa6('0x31')]||_0x3c574e:''});}exports[_0xcfa6('0x33')]=function(_0x1f110e,_0x50acbb,_0x12f0b0){passport['authenticate'](_0xcfa6('0x34'),function(_0x5f2058,_0x2f3564,_0xd17072){var _0x1708aa=_0x5f2058||_0xd17072;if(_0x1708aa){return handleError(_0x50acbb,0x191,_0x1708aa);}if(!_0x2f3564){return handleError(_0x50acbb,0x194,{'message':_0xcfa6('0x35')});}else{var _0x11c539={'payload':{'id':_0x2f3564['id'],'role':_0x2f3564['role']},'options':{'expiresIn':0x15180}};return authService[_0xcfa6('0x36')](_0x11c539)[_0xcfa6('0xb')](function(_0x1fa457){_0x50acbb[_0xcfa6('0x37')]({'id':_0x2f3564['id'],'token':_0x1fa457,'statusCall':'','isAlreadyLogged':_0x2f3564[_0xcfa6('0x38')]});});}})(_0x1f110e,_0x50acbb,_0x12f0b0);};exports['forgot']=function(_0x2ad0f7,_0x3dbc7e,_0x241bc6){if(!_0x2ad0f7[_0xcfa6('0x39')][_0xcfa6('0x20')]){return handleError(_0x3dbc7e,0x1f4,{'message':_0xcfa6('0x3a')});}var _0x30d5f6=rs[_0xcfa6('0x3b')]();_0x2ad0f7[_0xcfa6('0x39')][_0xcfa6('0x20')]=_0x2ad0f7[_0xcfa6('0x39')][_0xcfa6('0x20')]['trim']()[_0xcfa6('0x3c')]();var _0x318f8c;return db[_0xcfa6('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xcfa6('0x9'),_0xcfa6('0xa')],'raw':!![]})[_0xcfa6('0xb')](function(_0x599d5b){_0x318f8c=_0x599d5b;return db['User'][_0xcfa6('0x1f')]({'where':{'email':_0x2ad0f7[_0xcfa6('0x39')][_0xcfa6('0x20')]}});})['then'](function(_0xe04a65){if(!_0xe04a65){throw new Error(_0xcfa6('0x3d'));}if(_0xe04a65[_0xcfa6('0x1b')]){throw new Error(_0xcfa6('0x3e'));}if(_0xe04a65[_0xcfa6('0xf')]){if(moment(_0xe04a65['blockedAt'])[_0xcfa6('0x18')](_0x318f8c['blockDuration'],_0xcfa6('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xe04a65['blocked']=![];_0xe04a65[_0xcfa6('0x17')]=null;}}_0xe04a65[_0xcfa6('0x3f')]=_0x30d5f6;_0xe04a65[_0xcfa6('0x40')]=Date['now']()+0x36ee80;return _0xe04a65['save']();})[_0xcfa6('0xb')](function(){return sendServiceMail({'to':_0x2ad0f7['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xcfa6('0x41')+_0xcfa6('0x42')+_0x2ad0f7['headers']['host']+_0xcfa6('0x43')+_0x30d5f6+'\x0a\x0a'+_0xcfa6('0x44')});})[_0xcfa6('0xb')](function(){_0x3dbc7e[_0xcfa6('0x32')](0xc8)['send']({'message':_0xcfa6('0x45')});})[_0xcfa6('0x1d')](function(_0x3eb645){return handleError(_0x3dbc7e,0x1f4,_0x3eb645);});};exports[_0xcfa6('0x46')]=function(_0x95d77c,_0x20c905,_0x4983ad){return db[_0xcfa6('0x47')][_0xcfa6('0x1f')]({'where':{'resetPasswordToken':_0x95d77c[_0xcfa6('0x48')][_0xcfa6('0x49')],'resetPasswordExpires':{'$gt':Date[_0xcfa6('0x4a')]()}}})[_0xcfa6('0xb')](function(_0x142daf){if(!_0x142daf){throw new Error(_0xcfa6('0x4b'));}return db[_0xcfa6('0x8')][_0xcfa6('0x4c')]({'attributes':['id',_0xcfa6('0x4d'),_0xcfa6('0x4e'),_0xcfa6('0x4f')]})[_0xcfa6('0xb')](function(_0x464115){if(_0x464115[_0xcfa6('0x4d')])authService[_0xcfa6('0x50')](_0x95d77c[_0xcfa6('0x39')]['password']);if(!_0x464115[_0xcfa6('0x4e')]||!_0x142daf[_0xcfa6('0x51')])return _0x142daf;authService[_0xcfa6('0x52')](_0x95d77c[_0xcfa6('0x39')]['password'],_0x142daf['previousPasswords'],_0x464115[_0xcfa6('0x4f')]);return _0x142daf;})['then'](function(){_0x142daf[_0xcfa6('0xc')]=_0x95d77c[_0xcfa6('0x39')]['password'];_0x142daf[_0xcfa6('0x3f')]=null;_0x142daf[_0xcfa6('0x40')]=null;return _0x142daf['save']();});})[_0xcfa6('0xb')](function(){_0x20c905[_0xcfa6('0x32')](0xc8)[_0xcfa6('0x53')]({'message':_0xcfa6('0x54')});})['catch'](function(_0x247fd4){return handleError(_0x20c905,0x1f4,_0x247fd4);});};passport[_0xcfa6('0x55')](_0xcfa6('0x34'),new LocalStrategy({'usernameField':_0xcfa6('0x14'),'passwordField':_0xcfa6('0xc')},function(_0x259b6a,_0x3bccb3,_0x43b12d){return localAuthenticate(db['User'],_0x259b6a,_0x3bccb3,_0x43b12d);}));
\ No newline at end of file
index 8573520..c6fc412 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbce2=['/reset/:token','exports','express','./authLocal.controller','login','post','/forgot','forgot'];(function(_0x4e2f70,_0x3073d9){var _0x30294f=function(_0x15e847){while(--_0x15e847){_0x4e2f70['push'](_0x4e2f70['shift']());}};_0x30294f(++_0x3073d9);}(_0xbce2,0x10a));var _0x2bce=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xbce2[_0x32f7d7];return _0x133d09;};'use strict';var express=require(_0x2bce('0x0'));var router=express['Router']();var controller=require(_0x2bce('0x1'));router['post']('/',controller[_0x2bce('0x2')]);router[_0x2bce('0x3')](_0x2bce('0x4'),controller[_0x2bce('0x5')]);router[_0x2bce('0x3')](_0x2bce('0x6'),controller['reset']);module[_0x2bce('0x7')]=router;
\ No newline at end of file
+var _0x23c6=['exports','express','./authLocal.controller','/forgot','forgot','post','reset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x23c6,0x151));var _0x623c=function(_0x5ce004,_0x3084c2){_0x5ce004=_0x5ce004-0x0;var _0x428f9b=_0x23c6[_0x5ce004];return _0x428f9b;};'use strict';var express=require(_0x623c('0x0'));var router=express['Router']();var controller=require(_0x623c('0x1'));router['post']('/',controller['login']);router['post'](_0x623c('0x2'),controller[_0x623c('0x3')]);router[_0x623c('0x4')]('/reset/:token',controller[_0x623c('0x5')]);module[_0x623c('0x6')]=router;
\ No newline at end of file
index 4fefa7e..cd940bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf212=['exports','STRING','INTEGER','sequelize'];(function(_0x225da7,_0x4cb147){var _0x10c28a=function(_0xfdede8){while(--_0xfdede8){_0x225da7['push'](_0x225da7['shift']());}};_0x10c28a(++_0x4cb147);}(_0xf212,0x1d7));var _0x2f21=function(_0x159de5,_0x2d205c){_0x159de5=_0x159de5-0x0;var _0xeb4898=_0xf212[_0x159de5];return _0xeb4898;};'use strict';var Sequelize=require(_0x2f21('0x0'));module[_0x2f21('0x1')]={'name':{'type':Sequelize[_0x2f21('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x2f21('0x2')]},'description':{'type':Sequelize[_0x2f21('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2f21('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xfa5e=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x256910,_0x3f61c3){var _0x540331=function(_0xe952de){while(--_0xe952de){_0x256910['push'](_0x256910['shift']());}};_0x540331(++_0x3f61c3);}(_0xfa5e,0xd4));var _0xefa5=function(_0x4b54e3,_0x54cadb){_0x4b54e3=_0x4b54e3-0x0;var _0x2cbb30=_0xfa5e[_0x4b54e3];return _0x2cbb30;};'use strict';var Sequelize=require(_0xefa5('0x0'));module[_0xefa5('0x1')]={'name':{'type':Sequelize[_0xefa5('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xefa5('0x2')]},'status':{'type':Sequelize[_0xefa5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xefa5('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index 62c160a..ab626c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91e6=['sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','addConditions','Condition','ids','omit','getConditions','hasOwnProperty','addActions','findOne','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','sendStatus','error','name','index','map','Automation','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order'];(function(_0x4fd2f3,_0x358bd9){var _0xdd6277=function(_0x46f29e){while(--_0x46f29e){_0x4fd2f3['push'](_0x4fd2f3['shift']());}};_0xdd6277(++_0x358bd9);}(_0x91e6,0xbf));var _0x691e=function(_0x1711bf,_0x57238e){_0x1711bf=_0x1711bf-0x0;var _0x3de506=_0x91e6[_0x1711bf];return _0x3de506;};'use strict';var emlformat=require(_0x691e('0x0'));var rimraf=require(_0x691e('0x1'));var zipdir=require(_0x691e('0x2'));var jsonpatch=require(_0x691e('0x3'));var rp=require(_0x691e('0x4'));var moment=require(_0x691e('0x5'));var BPromise=require(_0x691e('0x6'));var Mustache=require(_0x691e('0x7'));var util=require(_0x691e('0x8'));var path=require(_0x691e('0x9'));var sox=require(_0x691e('0xa'));var csv=require(_0x691e('0xb'));var ejs=require(_0x691e('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x691e('0xd'));var squel=require(_0x691e('0xe'));var crypto=require(_0x691e('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x691e('0xb'));var querystring=require(_0x691e('0x10'));var Papa=require(_0x691e('0x11'));var Redis=require(_0x691e('0x12'));var authService=require(_0x691e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x691e('0x14'));var hardwareService=require(_0x691e('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x691e('0x16'));var config=require(_0x691e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x691e('0x18'))['db'];function respondWithStatusCode(_0x20aacc,_0x407ffe){_0x407ffe=_0x407ffe||0xcc;return function(_0x471473){if(_0x471473){return _0x20aacc['sendStatus'](_0x407ffe);}return _0x20aacc[_0x691e('0x19')](_0x407ffe)[_0x691e('0x1a')]();};}function respondWithResult(_0xd48352,_0x46bcd6){_0x46bcd6=_0x46bcd6||0xc8;return function(_0x208ad7){if(_0x208ad7){return _0xd48352['status'](_0x46bcd6)[_0x691e('0x1b')](_0x208ad7);}};}function respondWithFilteredResult(_0x368fb0,_0x3ac53f){return function(_0x4055d9){if(_0x4055d9){var _0x3b1393=typeof _0x3ac53f[_0x691e('0x1c')]===_0x691e('0x1d')&&typeof _0x3ac53f[_0x691e('0x1e')]===_0x691e('0x1d');var _0x1a5114=_0x4055d9['count'];var _0x4c9411=_0x3b1393?0x0:_0x3ac53f[_0x691e('0x1c')];var _0x314515=_0x3b1393?_0x4055d9[_0x691e('0x1f')]:_0x3ac53f['offset']+_0x3ac53f[_0x691e('0x1e')];var _0x545329;if(_0x314515>=_0x1a5114){_0x314515=_0x1a5114;_0x545329=0xc8;}else{_0x545329=0xce;}_0x368fb0[_0x691e('0x19')](_0x545329);return _0x368fb0[_0x691e('0x20')]('Content-Range',_0x4c9411+'-'+_0x314515+'/'+_0x1a5114)['json'](_0x4055d9);}return null;};}function patchUpdates(_0x333196){return function(_0x31313c){try{jsonpatch[_0x691e('0x21')](_0x31313c,_0x333196,!![]);}catch(_0x5906bd){return BPromise[_0x691e('0x22')](_0x5906bd);}return _0x31313c[_0x691e('0x23')]();};}function saveUpdates(_0x15520e,_0x1619ae){return function(_0x3ca405){if(_0x3ca405){return _0x3ca405['update'](_0x15520e)[_0x691e('0x24')](function(_0x3c153e){return _0x3c153e;});}return null;};}function removeEntity(_0x2d6a2e,_0x1f2975){return function(_0x1871f7){if(_0x1871f7){return _0x1871f7[_0x691e('0x25')]()[_0x691e('0x24')](function(){_0x2d6a2e['status'](0xcc)[_0x691e('0x1a')]();});}};}function handleEntityNotFound(_0x38ff6c,_0x540cae){return function(_0x4236b7){if(!_0x4236b7){_0x38ff6c[_0x691e('0x26')](0x194);}return _0x4236b7;};}function handleError(_0x3cd278,_0x43d6a5){_0x43d6a5=_0x43d6a5||0x1f4;return function(_0x217cf4){logger[_0x691e('0x27')](_0x217cf4['stack']);if(_0x217cf4[_0x691e('0x28')]){delete _0x217cf4[_0x691e('0x28')];}_0x3cd278[_0x691e('0x19')](_0x43d6a5)['send'](_0x217cf4);};}exports[_0x691e('0x29')]=function(_0x59f18c,_0x41219d){var _0x41368b={},_0x3e919c={},_0x1b7803={'count':0x0,'rows':[]};var _0x5b6cff=_[_0x691e('0x2a')](db[_0x691e('0x2b')]['rawAttributes'],function(_0x4b3648){return{'name':_0x4b3648[_0x691e('0x2c')],'type':_0x4b3648[_0x691e('0x2d')]['key']};});_0x3e919c[_0x691e('0x2e')]=_[_0x691e('0x2a')](_0x5b6cff,_0x691e('0x28'));_0x3e919c[_0x691e('0x2f')]=_[_0x691e('0x30')](_0x59f18c[_0x691e('0x2f')]);_0x3e919c[_0x691e('0x31')]=_[_0x691e('0x32')](_0x3e919c[_0x691e('0x2e')],_0x3e919c[_0x691e('0x2f')]);_0x41368b[_0x691e('0x33')]=_['intersection'](_0x3e919c['model'],qs['fields'](_0x59f18c['query'][_0x691e('0x34')]));_0x41368b[_0x691e('0x33')]=_0x41368b[_0x691e('0x33')]['length']?_0x41368b['attributes']:_0x3e919c['model'];if(!_0x59f18c[_0x691e('0x2f')]['hasOwnProperty'](_0x691e('0x35'))){_0x41368b[_0x691e('0x1e')]=qs['limit'](_0x59f18c[_0x691e('0x2f')][_0x691e('0x1e')]);_0x41368b[_0x691e('0x1c')]=qs[_0x691e('0x1c')](_0x59f18c[_0x691e('0x2f')]['offset']);}_0x41368b[_0x691e('0x36')]=qs['sort'](_0x59f18c['query'][_0x691e('0x37')]);_0x41368b[_0x691e('0x38')]=qs[_0x691e('0x31')](_[_0x691e('0x39')](_0x59f18c[_0x691e('0x2f')],_0x3e919c[_0x691e('0x31')]),_0x5b6cff);if(_0x59f18c[_0x691e('0x2f')][_0x691e('0x3a')]){_0x41368b[_0x691e('0x38')]=_[_0x691e('0x3b')](_0x41368b[_0x691e('0x38')],{'$or':_[_0x691e('0x2a')](_0x5b6cff,function(_0x29f86b){if(_0x29f86b[_0x691e('0x2d')]!=='VIRTUAL'){var _0x139d2e={};_0x139d2e[_0x29f86b[_0x691e('0x28')]]={'$like':'%'+_0x59f18c[_0x691e('0x2f')][_0x691e('0x3a')]+'%'};return _0x139d2e;}})});}_0x41368b=_['merge']({},_0x41368b,_0x59f18c[_0x691e('0x3c')]);var _0x195ac4={'where':_0x41368b[_0x691e('0x38')]};return db[_0x691e('0x2b')][_0x691e('0x1f')](_0x195ac4)[_0x691e('0x24')](function(_0x4f28c5){_0x1b7803[_0x691e('0x1f')]=_0x4f28c5;if(_0x59f18c[_0x691e('0x2f')]['includeAll']){_0x41368b[_0x691e('0x3d')]=[{'all':!![]}];}return db[_0x691e('0x2b')][_0x691e('0x3e')](_0x41368b);})[_0x691e('0x24')](function(_0x4f7e15){_0x1b7803[_0x691e('0x3f')]=_0x4f7e15;return _0x1b7803;})[_0x691e('0x24')](respondWithFilteredResult(_0x41219d,_0x41368b))[_0x691e('0x40')](handleError(_0x41219d,null));};exports[_0x691e('0x41')]=function(_0x1c6414,_0x121abe){var _0x465f60={'raw':![],'where':{'id':_0x1c6414[_0x691e('0x42')]['id']}},_0x5e729f={};_0x5e729f['model']=_[_0x691e('0x30')](db['Automation'][_0x691e('0x43')]);_0x5e729f[_0x691e('0x2f')]=_[_0x691e('0x30')](_0x1c6414[_0x691e('0x2f')]);_0x5e729f[_0x691e('0x31')]=_[_0x691e('0x32')](_0x5e729f[_0x691e('0x2e')],_0x5e729f[_0x691e('0x2f')]);_0x465f60[_0x691e('0x33')]=_[_0x691e('0x32')](_0x5e729f['model'],qs[_0x691e('0x34')](_0x1c6414[_0x691e('0x2f')][_0x691e('0x34')]));_0x465f60[_0x691e('0x33')]=_0x465f60[_0x691e('0x33')][_0x691e('0x44')]?_0x465f60[_0x691e('0x33')]:_0x5e729f['model'];if(_0x1c6414[_0x691e('0x2f')][_0x691e('0x45')]){_0x465f60[_0x691e('0x3d')]=[{'all':!![]}];}_0x465f60=_[_0x691e('0x3b')]({},_0x465f60,_0x1c6414[_0x691e('0x3c')]);return db['Automation']['find'](_0x465f60)[_0x691e('0x24')](handleEntityNotFound(_0x121abe,null))['then'](respondWithResult(_0x121abe,null))[_0x691e('0x40')](handleError(_0x121abe,null));};exports[_0x691e('0x46')]=function(_0x438d02,_0x367c05){return db['Automation']['create'](_0x438d02['body'],{})[_0x691e('0x24')](respondWithResult(_0x367c05,0xc9))[_0x691e('0x40')](handleError(_0x367c05,null));};exports['update']=function(_0x2b5512,_0x4f8629){if(_0x2b5512[_0x691e('0x47')]['id']){delete _0x2b5512[_0x691e('0x47')]['id'];}return db[_0x691e('0x2b')][_0x691e('0x48')]({'where':{'id':_0x2b5512[_0x691e('0x42')]['id']}})[_0x691e('0x24')](handleEntityNotFound(_0x4f8629,null))[_0x691e('0x24')](saveUpdates(_0x2b5512[_0x691e('0x47')],null))['then'](respondWithResult(_0x4f8629,null))[_0x691e('0x40')](handleError(_0x4f8629,null));};exports[_0x691e('0x25')]=function(_0xd27d98,_0x8ff6a9){return db[_0x691e('0x2b')]['find']({'where':{'id':_0xd27d98[_0x691e('0x42')]['id']}})[_0x691e('0x24')](handleEntityNotFound(_0x8ff6a9,null))['then'](removeEntity(_0x8ff6a9,null))[_0x691e('0x40')](handleError(_0x8ff6a9,null));};exports[_0x691e('0x49')]=function(_0x3c1f30,_0x3d5121,_0x175a85){return db[_0x691e('0x4a')][_0x691e('0x48')]({'where':{'id':_0x3c1f30[_0x691e('0x42')]['id']}})['then'](handleEntityNotFound(_0x3d5121,null))[_0x691e('0x24')](function(_0x2716ca){if(_0x2716ca){return _0x2716ca['addConditions'](_0x3c1f30[_0x691e('0x47')][_0x691e('0x4b')],_[_0x691e('0x4c')](_0x3c1f30['body'],[_0x691e('0x4b'),'id'])||{});}})[_0x691e('0x24')](respondWithResult(_0x3d5121,null))[_0x691e('0x40')](handleError(_0x3d5121,null));};exports[_0x691e('0x4d')]=function(_0x5ee8b,_0x4d6a57,_0x24930f){var _0x5da60c={};var _0x5d9be0={};var _0x4fde2c;var _0x22dc13;return db['Automation']['findOne']({'where':{'id':_0x5ee8b[_0x691e('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d6a57,null))[_0x691e('0x24')](function(_0x24ad41){if(_0x24ad41){_0x4fde2c=_0x24ad41;_0x5d9be0[_0x691e('0x2e')]=_[_0x691e('0x30')](db['Condition'][_0x691e('0x43')]);_0x5d9be0['query']=_[_0x691e('0x30')](_0x5ee8b[_0x691e('0x2f')]);_0x5d9be0[_0x691e('0x31')]=_[_0x691e('0x32')](_0x5d9be0[_0x691e('0x2e')],_0x5d9be0['query']);_0x5da60c[_0x691e('0x33')]=_[_0x691e('0x32')](_0x5d9be0[_0x691e('0x2e')],qs[_0x691e('0x34')](_0x5ee8b['query'][_0x691e('0x34')]));_0x5da60c['attributes']=_0x5da60c[_0x691e('0x33')][_0x691e('0x44')]?_0x5da60c['attributes']:_0x5d9be0[_0x691e('0x2e')];_0x5da60c[_0x691e('0x36')]=qs['sort'](_0x5ee8b[_0x691e('0x2f')][_0x691e('0x37')]);_0x5da60c['where']=qs['filters'](_[_0x691e('0x39')](_0x5ee8b['query'],_0x5d9be0[_0x691e('0x31')]));if(_0x5ee8b[_0x691e('0x2f')][_0x691e('0x3a')]){_0x5da60c[_0x691e('0x38')]=_[_0x691e('0x3b')](_0x5da60c[_0x691e('0x38')],{'$or':_[_0x691e('0x2a')](_0x5da60c[_0x691e('0x33')],function(_0x130bb1){var _0x555e1d={};_0x555e1d[_0x130bb1]={'$like':'%'+_0x5ee8b[_0x691e('0x2f')]['filter']+'%'};return _0x555e1d;})});}_0x5da60c=_[_0x691e('0x3b')]({},_0x5da60c,_0x5ee8b['options']);return _0x4fde2c[_0x691e('0x4d')](_0x5da60c);}})['then'](function(_0xe5a72a){if(_0xe5a72a){_0x22dc13=_0xe5a72a[_0x691e('0x44')];if(!_0x5ee8b['query'][_0x691e('0x4e')](_0x691e('0x35'))){_0x5da60c['limit']=qs['limit'](_0x5ee8b[_0x691e('0x2f')][_0x691e('0x1e')]);_0x5da60c['offset']=qs[_0x691e('0x1c')](_0x5ee8b[_0x691e('0x2f')][_0x691e('0x1c')]);}return _0x4fde2c['getConditions'](_0x5da60c);}})[_0x691e('0x24')](function(_0x52684e){if(_0x52684e){return _0x52684e?{'count':_0x22dc13,'rows':_0x52684e}:null;}})['then'](respondWithResult(_0x4d6a57,null))[_0x691e('0x40')](handleError(_0x4d6a57,null));};exports[_0x691e('0x4f')]=function(_0x3bc982,_0x2d6452,_0x10131b){return db['Action'][_0x691e('0x48')]({'where':{'id':_0x3bc982[_0x691e('0x42')]['id']}})[_0x691e('0x24')](handleEntityNotFound(_0x2d6452,null))[_0x691e('0x24')](function(_0x341647){if(_0x341647){return _0x341647[_0x691e('0x4f')](_0x3bc982[_0x691e('0x47')][_0x691e('0x4b')],_[_0x691e('0x4c')](_0x3bc982[_0x691e('0x47')],['ids','id'])||{});}})[_0x691e('0x24')](respondWithResult(_0x2d6452,null))['catch'](handleError(_0x2d6452,null));};exports['getActions']=function(_0x2ed87c,_0x1512ad,_0x4df586){var _0x238d76={};var _0x5476b1={};var _0x352637;var _0x34f71b;return db['Automation'][_0x691e('0x50')]({'where':{'id':_0x2ed87c[_0x691e('0x42')]['id']}})[_0x691e('0x24')](handleEntityNotFound(_0x1512ad,null))[_0x691e('0x24')](function(_0x2fa716){if(_0x2fa716){_0x352637=_0x2fa716;_0x5476b1[_0x691e('0x2e')]=_['keys'](db['Action'][_0x691e('0x43')]);_0x5476b1['query']=_[_0x691e('0x30')](_0x2ed87c[_0x691e('0x2f')]);_0x5476b1['filters']=_[_0x691e('0x32')](_0x5476b1[_0x691e('0x2e')],_0x5476b1[_0x691e('0x2f')]);_0x238d76[_0x691e('0x33')]=_[_0x691e('0x32')](_0x5476b1[_0x691e('0x2e')],qs[_0x691e('0x34')](_0x2ed87c[_0x691e('0x2f')][_0x691e('0x34')]));_0x238d76[_0x691e('0x33')]=_0x238d76[_0x691e('0x33')][_0x691e('0x44')]?_0x238d76[_0x691e('0x33')]:_0x5476b1[_0x691e('0x2e')];_0x238d76['order']=qs[_0x691e('0x37')](_0x2ed87c[_0x691e('0x2f')][_0x691e('0x37')]);_0x238d76[_0x691e('0x38')]=qs['filters'](_['pick'](_0x2ed87c[_0x691e('0x2f')],_0x5476b1[_0x691e('0x31')]));if(_0x2ed87c['query'][_0x691e('0x3a')]){_0x238d76[_0x691e('0x38')]=_[_0x691e('0x3b')](_0x238d76[_0x691e('0x38')],{'$or':_[_0x691e('0x2a')](_0x238d76[_0x691e('0x33')],function(_0x35d1bb){var _0x3c03e6={};_0x3c03e6[_0x35d1bb]={'$like':'%'+_0x2ed87c[_0x691e('0x2f')][_0x691e('0x3a')]+'%'};return _0x3c03e6;})});}_0x238d76=_['merge']({},_0x238d76,_0x2ed87c[_0x691e('0x3c')]);return _0x352637[_0x691e('0x51')](_0x238d76);}})[_0x691e('0x24')](function(_0x21c496){if(_0x21c496){_0x34f71b=_0x21c496[_0x691e('0x44')];if(!_0x2ed87c['query'][_0x691e('0x4e')](_0x691e('0x35'))){_0x238d76[_0x691e('0x1e')]=qs['limit'](_0x2ed87c[_0x691e('0x2f')][_0x691e('0x1e')]);_0x238d76['offset']=qs[_0x691e('0x1c')](_0x2ed87c['query'][_0x691e('0x1c')]);}return _0x352637[_0x691e('0x51')](_0x238d76);}})[_0x691e('0x24')](function(_0x1c1ffd){if(_0x1c1ffd){return _0x1c1ffd?{'count':_0x34f71b,'rows':_0x1c1ffd}:null;}})[_0x691e('0x24')](respondWithResult(_0x1512ad,null))[_0x691e('0x40')](handleError(_0x1512ad,null));};
\ No newline at end of file
+var _0x1b87=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','show','params','keys','options','catch','create','body','find','Condition','addConditions','ids','getConditions','findOne','length','hasOwnProperty','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x2a5f58,_0x2b054b){var _0x8bcdee=function(_0x400297){while(--_0x400297){_0x2a5f58['push'](_0x2a5f58['shift']());}};_0x8bcdee(++_0x2b054b);}(_0x1b87,0x189));var _0x71b8=function(_0x260840,_0x1946db){_0x260840=_0x260840-0x0;var _0x1750a4=_0x1b87[_0x260840];return _0x1750a4;};'use strict';var emlformat=require(_0x71b8('0x0'));var rimraf=require(_0x71b8('0x1'));var zipdir=require(_0x71b8('0x2'));var jsonpatch=require(_0x71b8('0x3'));var rp=require(_0x71b8('0x4'));var moment=require(_0x71b8('0x5'));var BPromise=require(_0x71b8('0x6'));var Mustache=require(_0x71b8('0x7'));var util=require('util');var path=require('path');var sox=require(_0x71b8('0x8'));var csv=require(_0x71b8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71b8('0xa'));var _=require(_0x71b8('0xb'));var squel=require(_0x71b8('0xc'));var crypto=require(_0x71b8('0xd'));var jsforce=require(_0x71b8('0xe'));var deskjs=require(_0x71b8('0xf'));var toCsv=require(_0x71b8('0x9'));var querystring=require('querystring');var Papa=require(_0x71b8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x71b8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x71b8('0x12'));var logger=require(_0x71b8('0x13'))(_0x71b8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x71b8('0x15'));var db=require(_0x71b8('0x16'))['db'];function respondWithStatusCode(_0x3cc520,_0x3480f6){_0x3480f6=_0x3480f6||0xcc;return function(_0x2e093f){if(_0x2e093f){return _0x3cc520[_0x71b8('0x17')](_0x3480f6);}return _0x3cc520[_0x71b8('0x18')](_0x3480f6)[_0x71b8('0x19')]();};}function respondWithResult(_0x4b942b,_0x5cb87a){_0x5cb87a=_0x5cb87a||0xc8;return function(_0x4cd3b9){if(_0x4cd3b9){return _0x4b942b['status'](_0x5cb87a)[_0x71b8('0x1a')](_0x4cd3b9);}};}function respondWithFilteredResult(_0x25fe71,_0x15d663){return function(_0x12e1e3){if(_0x12e1e3){var _0x396a78=typeof _0x15d663[_0x71b8('0x1b')]===_0x71b8('0x1c')&&typeof _0x15d663['limit']===_0x71b8('0x1c');var _0x4ca59f=_0x12e1e3[_0x71b8('0x1d')];var _0x86f9d=_0x396a78?0x0:_0x15d663[_0x71b8('0x1b')];var _0x43aa5d=_0x396a78?_0x12e1e3['count']:_0x15d663['offset']+_0x15d663['limit'];var _0x2e6429;if(_0x43aa5d>=_0x4ca59f){_0x43aa5d=_0x4ca59f;_0x2e6429=0xc8;}else{_0x2e6429=0xce;}_0x25fe71['status'](_0x2e6429);return _0x25fe71[_0x71b8('0x1e')](_0x71b8('0x1f'),_0x86f9d+'-'+_0x43aa5d+'/'+_0x4ca59f)[_0x71b8('0x1a')](_0x12e1e3);}return null;};}function patchUpdates(_0x26a197){return function(_0x11272d){try{jsonpatch[_0x71b8('0x20')](_0x11272d,_0x26a197,!![]);}catch(_0x32f9a4){return BPromise[_0x71b8('0x21')](_0x32f9a4);}return _0x11272d[_0x71b8('0x22')]();};}function saveUpdates(_0x7223cb,_0x5bda51){return function(_0xe514db){if(_0xe514db){return _0xe514db[_0x71b8('0x23')](_0x7223cb)[_0x71b8('0x24')](function(_0x5ef47d){return _0x5ef47d;});}return null;};}function removeEntity(_0x744ba6,_0x2f5415){return function(_0x2bfd7c){if(_0x2bfd7c){return _0x2bfd7c[_0x71b8('0x25')]()[_0x71b8('0x24')](function(){_0x744ba6[_0x71b8('0x18')](0xcc)[_0x71b8('0x19')]();});}};}function handleEntityNotFound(_0x3b1ccb,_0x40f487){return function(_0x2dbc7d){if(!_0x2dbc7d){_0x3b1ccb[_0x71b8('0x17')](0x194);}return _0x2dbc7d;};}function handleError(_0x327d00,_0x35dc91){_0x35dc91=_0x35dc91||0x1f4;return function(_0x3096ba){logger[_0x71b8('0x26')](_0x3096ba[_0x71b8('0x27')]);if(_0x3096ba[_0x71b8('0x28')]){delete _0x3096ba[_0x71b8('0x28')];}_0x327d00[_0x71b8('0x18')](_0x35dc91)[_0x71b8('0x29')](_0x3096ba);};}exports[_0x71b8('0x2a')]=function(_0x1e2381,_0x2071e9){var _0x500b67={},_0xa1bb0a={},_0x61ff3={'count':0x0,'rows':[]};var _0x291af3=_[_0x71b8('0x2b')](db[_0x71b8('0x2c')][_0x71b8('0x2d')],function(_0x2b7a8d){return{'name':_0x2b7a8d[_0x71b8('0x2e')],'type':_0x2b7a8d[_0x71b8('0x2f')]['key']};});_0xa1bb0a[_0x71b8('0x30')]=_[_0x71b8('0x2b')](_0x291af3,'name');_0xa1bb0a['query']=_['keys'](_0x1e2381[_0x71b8('0x31')]);_0xa1bb0a[_0x71b8('0x32')]=_['intersection'](_0xa1bb0a[_0x71b8('0x30')],_0xa1bb0a[_0x71b8('0x31')]);_0x500b67['attributes']=_[_0x71b8('0x33')](_0xa1bb0a['model'],qs[_0x71b8('0x34')](_0x1e2381['query'][_0x71b8('0x34')]));_0x500b67['attributes']=_0x500b67[_0x71b8('0x35')]['length']?_0x500b67[_0x71b8('0x35')]:_0xa1bb0a[_0x71b8('0x30')];if(!_0x1e2381['query']['hasOwnProperty'](_0x71b8('0x36'))){_0x500b67[_0x71b8('0x37')]=qs[_0x71b8('0x37')](_0x1e2381[_0x71b8('0x31')]['limit']);_0x500b67[_0x71b8('0x1b')]=qs['offset'](_0x1e2381[_0x71b8('0x31')][_0x71b8('0x1b')]);}_0x500b67[_0x71b8('0x38')]=qs['sort'](_0x1e2381[_0x71b8('0x31')][_0x71b8('0x39')]);_0x500b67[_0x71b8('0x3a')]=qs[_0x71b8('0x32')](_[_0x71b8('0x3b')](_0x1e2381[_0x71b8('0x31')],_0xa1bb0a['filters']),_0x291af3);if(_0x1e2381['query'][_0x71b8('0x3c')]){_0x500b67['where']=_['merge'](_0x500b67[_0x71b8('0x3a')],{'$or':_[_0x71b8('0x2b')](_0x291af3,function(_0x1206f5){if(_0x1206f5[_0x71b8('0x2f')]!==_0x71b8('0x3d')){var _0xa53b07={};_0xa53b07[_0x1206f5[_0x71b8('0x28')]]={'$like':'%'+_0x1e2381['query'][_0x71b8('0x3c')]+'%'};return _0xa53b07;}})});}_0x500b67=_[_0x71b8('0x3e')]({},_0x500b67,_0x1e2381['options']);var _0x26e0b2={'where':_0x500b67['where']};return db['Automation']['count'](_0x26e0b2)[_0x71b8('0x24')](function(_0x1f09c5){_0x61ff3[_0x71b8('0x1d')]=_0x1f09c5;if(_0x1e2381[_0x71b8('0x31')][_0x71b8('0x3f')]){_0x500b67[_0x71b8('0x40')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x500b67);})['then'](function(_0x233e34){_0x61ff3['rows']=_0x233e34;return _0x61ff3;})['then'](respondWithFilteredResult(_0x2071e9,_0x500b67))['catch'](handleError(_0x2071e9,null));};exports[_0x71b8('0x41')]=function(_0x42949f,_0x32768e){var _0x225cbe={'raw':![],'where':{'id':_0x42949f[_0x71b8('0x42')]['id']}},_0x480901={};_0x480901[_0x71b8('0x30')]=_[_0x71b8('0x43')](db[_0x71b8('0x2c')]['rawAttributes']);_0x480901[_0x71b8('0x31')]=_[_0x71b8('0x43')](_0x42949f[_0x71b8('0x31')]);_0x480901[_0x71b8('0x32')]=_['intersection'](_0x480901[_0x71b8('0x30')],_0x480901[_0x71b8('0x31')]);_0x225cbe['attributes']=_[_0x71b8('0x33')](_0x480901['model'],qs[_0x71b8('0x34')](_0x42949f[_0x71b8('0x31')][_0x71b8('0x34')]));_0x225cbe[_0x71b8('0x35')]=_0x225cbe[_0x71b8('0x35')]['length']?_0x225cbe[_0x71b8('0x35')]:_0x480901[_0x71b8('0x30')];if(_0x42949f['query']['includeAll']){_0x225cbe[_0x71b8('0x40')]=[{'all':!![]}];}_0x225cbe=_[_0x71b8('0x3e')]({},_0x225cbe,_0x42949f[_0x71b8('0x44')]);return db[_0x71b8('0x2c')]['find'](_0x225cbe)['then'](handleEntityNotFound(_0x32768e,null))['then'](respondWithResult(_0x32768e,null))[_0x71b8('0x45')](handleError(_0x32768e,null));};exports['create']=function(_0x110bce,_0x931ac5){return db['Automation'][_0x71b8('0x46')](_0x110bce['body'],{})[_0x71b8('0x24')](respondWithResult(_0x931ac5,0xc9))[_0x71b8('0x45')](handleError(_0x931ac5,null));};exports[_0x71b8('0x23')]=function(_0x5bbfa9,_0x4e6b4e){if(_0x5bbfa9[_0x71b8('0x47')]['id']){delete _0x5bbfa9['body']['id'];}return db[_0x71b8('0x2c')][_0x71b8('0x48')]({'where':{'id':_0x5bbfa9['params']['id']}})[_0x71b8('0x24')](handleEntityNotFound(_0x4e6b4e,null))[_0x71b8('0x24')](saveUpdates(_0x5bbfa9[_0x71b8('0x47')],null))['then'](respondWithResult(_0x4e6b4e,null))[_0x71b8('0x45')](handleError(_0x4e6b4e,null));};exports[_0x71b8('0x25')]=function(_0x355ca7,_0x1b760b){return db[_0x71b8('0x2c')][_0x71b8('0x48')]({'where':{'id':_0x355ca7[_0x71b8('0x42')]['id']}})[_0x71b8('0x24')](handleEntityNotFound(_0x1b760b,null))[_0x71b8('0x24')](removeEntity(_0x1b760b,null))[_0x71b8('0x45')](handleError(_0x1b760b,null));};exports['addConditions']=function(_0x443828,_0xfbde68,_0x12bd83){return db[_0x71b8('0x49')]['find']({'where':{'id':_0x443828[_0x71b8('0x42')]['id']}})['then'](handleEntityNotFound(_0xfbde68,null))[_0x71b8('0x24')](function(_0x6fafd8){if(_0x6fafd8){return _0x6fafd8[_0x71b8('0x4a')](_0x443828[_0x71b8('0x47')][_0x71b8('0x4b')],_['omit'](_0x443828[_0x71b8('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0xfbde68,null))[_0x71b8('0x45')](handleError(_0xfbde68,null));};exports[_0x71b8('0x4c')]=function(_0x4e045c,_0x41f3db,_0x57febb){var _0x4a7c62={};var _0x2c8cd9={};var _0x5bff46;var _0x196c33;return db[_0x71b8('0x2c')][_0x71b8('0x4d')]({'where':{'id':_0x4e045c[_0x71b8('0x42')]['id']}})['then'](handleEntityNotFound(_0x41f3db,null))[_0x71b8('0x24')](function(_0x5c02df){if(_0x5c02df){_0x5bff46=_0x5c02df;_0x2c8cd9[_0x71b8('0x30')]=_[_0x71b8('0x43')](db[_0x71b8('0x49')][_0x71b8('0x2d')]);_0x2c8cd9[_0x71b8('0x31')]=_['keys'](_0x4e045c['query']);_0x2c8cd9[_0x71b8('0x32')]=_[_0x71b8('0x33')](_0x2c8cd9['model'],_0x2c8cd9[_0x71b8('0x31')]);_0x4a7c62['attributes']=_[_0x71b8('0x33')](_0x2c8cd9[_0x71b8('0x30')],qs[_0x71b8('0x34')](_0x4e045c[_0x71b8('0x31')]['fields']));_0x4a7c62['attributes']=_0x4a7c62['attributes'][_0x71b8('0x4e')]?_0x4a7c62[_0x71b8('0x35')]:_0x2c8cd9[_0x71b8('0x30')];_0x4a7c62[_0x71b8('0x38')]=qs[_0x71b8('0x39')](_0x4e045c['query'][_0x71b8('0x39')]);_0x4a7c62[_0x71b8('0x3a')]=qs[_0x71b8('0x32')](_['pick'](_0x4e045c[_0x71b8('0x31')],_0x2c8cd9[_0x71b8('0x32')]));if(_0x4e045c[_0x71b8('0x31')][_0x71b8('0x3c')]){_0x4a7c62['where']=_[_0x71b8('0x3e')](_0x4a7c62[_0x71b8('0x3a')],{'$or':_[_0x71b8('0x2b')](_0x4a7c62[_0x71b8('0x35')],function(_0x1940a8){var _0x1a399e={};_0x1a399e[_0x1940a8]={'$like':'%'+_0x4e045c[_0x71b8('0x31')][_0x71b8('0x3c')]+'%'};return _0x1a399e;})});}_0x4a7c62=_[_0x71b8('0x3e')]({},_0x4a7c62,_0x4e045c[_0x71b8('0x44')]);return _0x5bff46[_0x71b8('0x4c')](_0x4a7c62);}})[_0x71b8('0x24')](function(_0x3a257a){if(_0x3a257a){_0x196c33=_0x3a257a['length'];if(!_0x4e045c['query'][_0x71b8('0x4f')](_0x71b8('0x36'))){_0x4a7c62[_0x71b8('0x37')]=qs[_0x71b8('0x37')](_0x4e045c[_0x71b8('0x31')][_0x71b8('0x37')]);_0x4a7c62[_0x71b8('0x1b')]=qs['offset'](_0x4e045c['query'][_0x71b8('0x1b')]);}return _0x5bff46[_0x71b8('0x4c')](_0x4a7c62);}})[_0x71b8('0x24')](function(_0x3e0c04){if(_0x3e0c04){return _0x3e0c04?{'count':_0x196c33,'rows':_0x3e0c04}:null;}})[_0x71b8('0x24')](respondWithResult(_0x41f3db,null))[_0x71b8('0x45')](handleError(_0x41f3db,null));};exports['addActions']=function(_0x42cc8e,_0x20ad52,_0x516079){return db[_0x71b8('0x50')]['find']({'where':{'id':_0x42cc8e[_0x71b8('0x42')]['id']}})[_0x71b8('0x24')](handleEntityNotFound(_0x20ad52,null))[_0x71b8('0x24')](function(_0x204294){if(_0x204294){return _0x204294[_0x71b8('0x51')](_0x42cc8e[_0x71b8('0x47')][_0x71b8('0x4b')],_['omit'](_0x42cc8e[_0x71b8('0x47')],[_0x71b8('0x4b'),'id'])||{});}})[_0x71b8('0x24')](respondWithResult(_0x20ad52,null))['catch'](handleError(_0x20ad52,null));};exports[_0x71b8('0x52')]=function(_0x13f09f,_0x335d29,_0x2d547d){var _0x3aa2cb={};var _0x2041d0={};var _0x2f138e;var _0x198709;return db['Automation'][_0x71b8('0x4d')]({'where':{'id':_0x13f09f[_0x71b8('0x42')]['id']}})[_0x71b8('0x24')](handleEntityNotFound(_0x335d29,null))['then'](function(_0x5b719e){if(_0x5b719e){_0x2f138e=_0x5b719e;_0x2041d0[_0x71b8('0x30')]=_[_0x71b8('0x43')](db[_0x71b8('0x50')]['rawAttributes']);_0x2041d0[_0x71b8('0x31')]=_[_0x71b8('0x43')](_0x13f09f[_0x71b8('0x31')]);_0x2041d0['filters']=_['intersection'](_0x2041d0['model'],_0x2041d0['query']);_0x3aa2cb['attributes']=_[_0x71b8('0x33')](_0x2041d0[_0x71b8('0x30')],qs[_0x71b8('0x34')](_0x13f09f[_0x71b8('0x31')][_0x71b8('0x34')]));_0x3aa2cb['attributes']=_0x3aa2cb['attributes'][_0x71b8('0x4e')]?_0x3aa2cb[_0x71b8('0x35')]:_0x2041d0[_0x71b8('0x30')];_0x3aa2cb[_0x71b8('0x38')]=qs[_0x71b8('0x39')](_0x13f09f[_0x71b8('0x31')][_0x71b8('0x39')]);_0x3aa2cb[_0x71b8('0x3a')]=qs['filters'](_[_0x71b8('0x3b')](_0x13f09f[_0x71b8('0x31')],_0x2041d0[_0x71b8('0x32')]));if(_0x13f09f[_0x71b8('0x31')][_0x71b8('0x3c')]){_0x3aa2cb[_0x71b8('0x3a')]=_['merge'](_0x3aa2cb[_0x71b8('0x3a')],{'$or':_[_0x71b8('0x2b')](_0x3aa2cb[_0x71b8('0x35')],function(_0x257eef){var _0x4b9f2e={};_0x4b9f2e[_0x257eef]={'$like':'%'+_0x13f09f[_0x71b8('0x31')][_0x71b8('0x3c')]+'%'};return _0x4b9f2e;})});}_0x3aa2cb=_[_0x71b8('0x3e')]({},_0x3aa2cb,_0x13f09f['options']);return _0x2f138e['getActions'](_0x3aa2cb);}})[_0x71b8('0x24')](function(_0x5abe3a){if(_0x5abe3a){_0x198709=_0x5abe3a[_0x71b8('0x4e')];if(!_0x13f09f[_0x71b8('0x31')][_0x71b8('0x4f')](_0x71b8('0x36'))){_0x3aa2cb['limit']=qs[_0x71b8('0x37')](_0x13f09f[_0x71b8('0x31')][_0x71b8('0x37')]);_0x3aa2cb[_0x71b8('0x1b')]=qs[_0x71b8('0x1b')](_0x13f09f[_0x71b8('0x31')][_0x71b8('0x1b')]);}return _0x2f138e[_0x71b8('0x52')](_0x3aa2cb);}})[_0x71b8('0x24')](function(_0x42b1ac){if(_0x42b1ac){return _0x42b1ac?{'count':_0x198709,'rows':_0x42b1ac}:null;}})[_0x71b8('0x24')](respondWithResult(_0x335d29,null))[_0x71b8('0x45')](handleError(_0x335d29,null));};
\ No newline at end of file
index 4287f55..51ae50d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd92=['request-promise','../../config/environment','Automation','tools_automations','lodash','api','moment'];(function(_0x247136,_0x3d837c){var _0x2d2e9e=function(_0xd85cfb){while(--_0xd85cfb){_0x247136['push'](_0x247136['shift']());}};_0x2d2e9e(++_0x3d837c);}(_0xfd92,0x15b));var _0x2fd9=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0xfd92[_0x336ca2];return _0xda59a6;};'use strict';var _=require(_0x2fd9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2fd9('0x1'));var moment=require(_0x2fd9('0x2'));var BPromise=require('bluebird');var rp=require(_0x2fd9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2fd9('0x4'));var attributes=require('./automation.attributes');module['exports']=function(_0x3ca6f0,_0x13bf48){return _0x3ca6f0['define'](_0x2fd9('0x5'),attributes,{'tableName':_0x2fd9('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb77c=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x4b6420,_0x126201){var _0x37076f=function(_0x3ee471){while(--_0x3ee471){_0x4b6420['push'](_0x4b6420['shift']());}};_0x37076f(++_0x126201);}(_0xb77c,0x11e));var _0xcb77=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xb77c[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0xcb77('0x0'));var util=require(_0xcb77('0x1'));var logger=require(_0xcb77('0x2'))(_0xcb77('0x3'));var moment=require(_0xcb77('0x4'));var BPromise=require(_0xcb77('0x5'));var rp=require(_0xcb77('0x6'));var fs=require('fs');var path=require(_0xcb77('0x7'));var rimraf=require(_0xcb77('0x8'));var config=require(_0xcb77('0x9'));var attributes=require(_0xcb77('0xa'));module[_0xcb77('0xb')]=function(_0x510900,_0x1c0c77){return _0x510900[_0xcb77('0xc')](_0xcb77('0xd'),attributes,{'tableName':_0xcb77('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 568cff8..83bddc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfef9=['Automation,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2595af,_0x291f79){var _0x2cd29e=function(_0xd9a1e8){while(--_0xd9a1e8){_0x2595af['push'](_0x2595af['shift']());}};_0x2cd29e(++_0x291f79);}(_0xfef9,0xd3));var _0x9fef=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xfef9[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x9fef('0x0'));var util=require(_0x9fef('0x1'));var moment=require('moment');var BPromise=require(_0x9fef('0x2'));var rs=require(_0x9fef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fef('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9fef('0x5'))('rpc');var config=require(_0x9fef('0x6'));var jayson=require(_0x9fef('0x7'));var client=jayson['client'][_0x9fef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x311595,_0x480161,_0x2d8768){return new BPromise(function(_0x2d990b,_0x1e4342){return client['request'](_0x311595,_0x2d8768)[_0x9fef('0x9')](function(_0x171152){logger[_0x9fef('0xa')]('Automation,\x20%s,\x20%s',_0x480161,_0x9fef('0xb'));logger['debug'](_0x9fef('0xc'),_0x480161,_0x9fef('0xb'),JSON[_0x9fef('0xd')](_0x171152));if(_0x171152[_0x9fef('0xe')]){if(_0x171152[_0x9fef('0xe')][_0x9fef('0xf')]===0x1f4){logger[_0x9fef('0xe')]('Automation,\x20%s,\x20%s',_0x480161,_0x171152[_0x9fef('0xe')][_0x9fef('0x10')]);return _0x1e4342(_0x171152[_0x9fef('0xe')]['message']);}logger[_0x9fef('0xe')](_0x9fef('0x11'),_0x480161,_0x171152[_0x9fef('0xe')][_0x9fef('0x10')]);return _0x2d990b(_0x171152[_0x9fef('0xe')]['message']);}else{logger[_0x9fef('0xa')]('Automation,\x20%s,\x20%s',_0x480161,_0x9fef('0xb'));_0x2d990b(_0x171152['result'][_0x9fef('0x10')]);}})[_0x9fef('0x12')](function(_0x4d9197){logger[_0x9fef('0xe')](_0x9fef('0x11'),_0x480161,_0x4d9197);_0x1e4342(_0x4d9197);});});}
\ No newline at end of file
+var _0x3c8b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','bluebird','randomstring','ioredis'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x13cd1a,_0x49eee1){_0x13cd1a=_0x13cd1a-0x0;var _0x81fffe=_0x3c8b[_0x13cd1a];return _0x81fffe;};'use strict';var _=require('lodash');var util=require(_0xb3c8('0x0'));var moment=require('moment');var BPromise=require(_0xb3c8('0x1'));var rs=require(_0xb3c8('0x2'));var fs=require('fs');var Redis=require(_0xb3c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3c8('0x4'));var logger=require(_0xb3c8('0x5'))(_0xb3c8('0x6'));var config=require(_0xb3c8('0x7'));var jayson=require(_0xb3c8('0x8'));var client=jayson[_0xb3c8('0x9')][_0xb3c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x375af0,_0x47aa5b,_0x13c8f3){return new BPromise(function(_0x5ec6a7,_0x460956){return client[_0xb3c8('0xb')](_0x375af0,_0x13c8f3)['then'](function(_0x5cb72f){logger['info'](_0xb3c8('0xc'),_0x47aa5b,_0xb3c8('0xd'));logger[_0xb3c8('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x47aa5b,_0xb3c8('0xd'),JSON[_0xb3c8('0xf')](_0x5cb72f));if(_0x5cb72f[_0xb3c8('0x10')]){if(_0x5cb72f[_0xb3c8('0x10')]['code']===0x1f4){logger[_0xb3c8('0x10')]('Automation,\x20%s,\x20%s',_0x47aa5b,_0x5cb72f[_0xb3c8('0x10')]['message']);return _0x460956(_0x5cb72f[_0xb3c8('0x10')][_0xb3c8('0x11')]);}logger[_0xb3c8('0x10')]('Automation,\x20%s,\x20%s',_0x47aa5b,_0x5cb72f['error'][_0xb3c8('0x11')]);return _0x5ec6a7(_0x5cb72f[_0xb3c8('0x10')][_0xb3c8('0x11')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x47aa5b,_0xb3c8('0xd'));_0x5ec6a7(_0x5cb72f[_0xb3c8('0x12')][_0xb3c8('0x11')]);}})['catch'](function(_0x2ecca3){logger[_0xb3c8('0x10')](_0xb3c8('0xc'),_0x47aa5b,_0x2ecca3);_0x460956(_0x2ecca3);});});}
\ No newline at end of file
index 5d5a515..d34a728 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7531=['../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','getConditions','/:id/actions','getActions','create','post','/:id/conditions','addConditions','addActions','delete','exports','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0x7531,0x69));var _0x1753=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7531[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x1753('0x0'));var util=require(_0x1753('0x1'));var path=require(_0x1753('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1753('0x3'));var auth=require(_0x1753('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1753('0x5'));var controller=require(_0x1753('0x6'));router['get']('/',auth[_0x1753('0x7')](),controller[_0x1753('0x8')]);router[_0x1753('0x9')](_0x1753('0xa'),auth[_0x1753('0x7')](),controller[_0x1753('0xb')]);router[_0x1753('0x9')]('/:id/conditions',auth[_0x1753('0x7')](),controller[_0x1753('0xc')]);router[_0x1753('0x9')](_0x1753('0xd'),auth[_0x1753('0x7')](),controller[_0x1753('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1753('0xf')]);router[_0x1753('0x10')](_0x1753('0x11'),auth[_0x1753('0x7')](),controller[_0x1753('0x12')]);router[_0x1753('0x10')](_0x1753('0xd'),auth[_0x1753('0x7')](),controller[_0x1753('0x13')]);router['put'](_0x1753('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x1753('0x14')](_0x1753('0xa'),auth[_0x1753('0x7')](),controller['destroy']);module[_0x1753('0x15')]=router;
\ No newline at end of file
+var _0xb439=['/:id/actions','getActions','post','create','addConditions','addActions','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions'];(function(_0x2ca785,_0x1b0dfd){var _0x4a796e=function(_0x26d94e){while(--_0x26d94e){_0x2ca785['push'](_0x2ca785['shift']());}};_0x4a796e(++_0x1b0dfd);}(_0xb439,0x87));var _0x9b43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb439[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9b43('0x0'));var util=require(_0x9b43('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9b43('0x2'));var router=express[_0x9b43('0x3')]();var fs_extra=require(_0x9b43('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9b43('0x5'));var config=require(_0x9b43('0x6'));var controller=require(_0x9b43('0x7'));router[_0x9b43('0x8')]('/',auth[_0x9b43('0x9')](),controller[_0x9b43('0xa')]);router[_0x9b43('0x8')](_0x9b43('0xb'),auth[_0x9b43('0x9')](),controller[_0x9b43('0xc')]);router['get'](_0x9b43('0xd'),auth[_0x9b43('0x9')](),controller[_0x9b43('0xe')]);router['get'](_0x9b43('0xf'),auth[_0x9b43('0x9')](),controller[_0x9b43('0x10')]);router[_0x9b43('0x11')]('/',auth[_0x9b43('0x9')](),controller[_0x9b43('0x12')]);router[_0x9b43('0x11')](_0x9b43('0xd'),auth['isAuthenticated'](),controller[_0x9b43('0x13')]);router['post'](_0x9b43('0xf'),auth[_0x9b43('0x9')](),controller[_0x9b43('0x14')]);router['put'](_0x9b43('0xb'),auth[_0x9b43('0x9')](),controller[_0x9b43('0x15')]);router[_0x9b43('0x16')](_0x9b43('0xb'),auth[_0x9b43('0x9')](),controller[_0x9b43('0x17')]);module[_0x9b43('0x18')]=router;
\ No newline at end of file
index 2e4f123..60dd840 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fcc=['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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC'];(function(_0x1aa049,_0x9ae13c){var _0x357f29=function(_0xfd2f83){while(--_0xfd2f83){_0x1aa049['push'](_0x1aa049['shift']());}};_0x357f29(++_0x9ae13c);}(_0x5fcc,0x161));var _0xc5fc=function(_0x4b1634,_0x1b1258){_0x4b1634=_0x4b1634-0x0;var _0x2f9f9f=_0x5fcc[_0x4b1634];return _0x2f9f9f;};'use strict';var Sequelize=require(_0xc5fc('0x0'));module[_0xc5fc('0x1')]={'name':{'type':Sequelize[_0xc5fc('0x2')],'unique':_0xc5fc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc5fc('0x4')]('ivr'),'allowNull':![],'defaultValue':_0xc5fc('0x5')},'description':{'type':Sequelize[_0xc5fc('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc5fc('0x6')},'limitCalls':{'type':Sequelize[_0xc5fc('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc5fc('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc5fc('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc5fc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xc5fc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc5fc('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xc5fc('0x4')](_0xc5fc('0xe'),'never',_0xc5fc('0xf')),'defaultValue':_0xc5fc('0xe')},'dialAMDActive':{'type':Sequelize[_0xc5fc('0x10')],'defaultValue':0x0,'comment':_0xc5fc('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc5fc('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc5fc('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc5fc('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc5fc('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc5fc('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc5fc('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc5fc('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc5fc('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc5fc('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc5fc('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc5fc('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc5fc('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc5fc('0x7')](0x9)[_0xc5fc('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xc5fc('0x19'),_0xc5fc('0x1a')),'defaultValue':_0xc5fc('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc5fc('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc5fc('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc5fc('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)[_0xc5fc('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc5fc('0x7')](0x5)[_0xc5fc('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc5fc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc5fc('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc5fc('0x25')}};
\ No newline at end of file
+var _0x9bb3=['onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0x9bb3,0x134));var _0x39bb=function(_0x6ffd8c,_0x19b2ec){_0x6ffd8c=_0x6ffd8c-0x0;var _0x26fda8=_0x9bb3[_0x6ffd8c];return _0x26fda8;};'use strict';var Sequelize=require(_0x39bb('0x0'));module[_0x39bb('0x1')]={'name':{'type':Sequelize[_0x39bb('0x2')],'unique':_0x39bb('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x39bb('0x4')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x39bb('0x2')]},'active':{'type':Sequelize[_0x39bb('0x5')],'defaultValue':0x0,'comment':_0x39bb('0x6')},'limitCalls':{'type':Sequelize[_0x39bb('0x7')](0x4)[_0x39bb('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x39bb('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x39bb('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x39bb('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x39bb('0x7')](0x3)[_0x39bb('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x39bb('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x39bb('0x7')](0x3)[_0x39bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x39bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39bb('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x39bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x39bb('0x7')](0x5)[_0x39bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39bb('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x39bb('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x39bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39bb('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x39bb('0x7')](0x3)[_0x39bb('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x39bb('0xe')},'dialTimezone':{'type':Sequelize[_0x39bb('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x39bb('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x39bb('0xf'),'never',_0x39bb('0x10')),'defaultValue':_0x39bb('0xf')},'dialAMDActive':{'type':Sequelize[_0x39bb('0x5')],'defaultValue':0x0,'comment':_0x39bb('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x39bb('0x7')](0x9)[_0x39bb('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x39bb('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x39bb('0x7')](0x9)[_0x39bb('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x39bb('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x39bb('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x39bb('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x39bb('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x39bb('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x39bb('0x7')](0x9)[_0x39bb('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x39bb('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x39bb('0x7')](0x9)[_0x39bb('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x39bb('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x39bb('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x39bb('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x39bb('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x39bb('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x39bb('0x4')](_0x39bb('0x1a'),'ASC'),'defaultValue':_0x39bb('0x1a')},'dialPrefix':{'type':Sequelize[_0x39bb('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x39bb('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x39bb('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x39bb('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x39bb('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x39bb('0x7')](0x3)[_0x39bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x39bb('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39bb('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x39bb('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x39bb('0x7')](0x5)[_0x39bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39bb('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x39bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x39bb('0x7')](0x5)[_0x39bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x39bb('0x7')](0x3)[_0x39bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x39bb('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x39bb('0x7')](0x5)[_0x39bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39bb('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x39bb('0x7')](0x3)[_0x39bb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x39bb('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x39bb('0x7')](0x5)[_0x39bb('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39bb('0x23')}};
\ No newline at end of file
index 3c16f22..348b281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd23b=['select','field','phone','ContactId','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','onlyIfOpen','insert','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','update','destroy','get','IvrCampaigns','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','Campaign','create','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ListId'];(function(_0x55c808,_0x5ae146){var _0x51d372=function(_0x44eb84){while(--_0x44eb84){_0x55c808['push'](_0x55c808['shift']());}};_0x51d372(++_0x5ae146);}(_0xd23b,0x132));var _0xbd23=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0xd23b[_0x33bc64];return _0x3fdd34;};'use strict';var emlformat=require(_0xbd23('0x0'));var rimraf=require(_0xbd23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd23('0x2'));var rp=require(_0xbd23('0x3'));var moment=require(_0xbd23('0x4'));var BPromise=require(_0xbd23('0x5'));var Mustache=require(_0xbd23('0x6'));var util=require(_0xbd23('0x7'));var path=require(_0xbd23('0x8'));var sox=require(_0xbd23('0x9'));var csv=require(_0xbd23('0xa'));var ejs=require(_0xbd23('0xb'));var fs=require('fs');var fs_extra=require(_0xbd23('0xc'));var _=require('lodash');var squel=require(_0xbd23('0xd'));var crypto=require(_0xbd23('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbd23('0xf'));var toCsv=require(_0xbd23('0xa'));var querystring=require(_0xbd23('0x10'));var Papa=require(_0xbd23('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbd23('0x12'));var hardwareService=require(_0xbd23('0x13'));var logger=require(_0xbd23('0x14'))(_0xbd23('0x15'));var utils=require(_0xbd23('0x16'));var config=require(_0xbd23('0x17'));var licenseUtil=require(_0xbd23('0x18'));var db=require(_0xbd23('0x19'))['db'];function respondWithStatusCode(_0x5d5b6c,_0x337250){_0x337250=_0x337250||0xcc;return function(_0x329b92){if(_0x329b92){return _0x5d5b6c['sendStatus'](_0x337250);}return _0x5d5b6c['status'](_0x337250)[_0xbd23('0x1a')]();};}function respondWithResult(_0x8f99aa,_0x36e866){_0x36e866=_0x36e866||0xc8;return function(_0x5cc208){if(_0x5cc208){return _0x8f99aa['status'](_0x36e866)[_0xbd23('0x1b')](_0x5cc208);}};}function respondWithFilteredResult(_0x58e69d,_0x296a34){return function(_0x56e1f5){if(_0x56e1f5){var _0x230743=typeof _0x296a34[_0xbd23('0x1c')]==='undefined'&&typeof _0x296a34[_0xbd23('0x1d')]===_0xbd23('0x1e');var _0x5acc89=_0x56e1f5[_0xbd23('0x1f')];var _0x2a3b35=_0x230743?0x0:_0x296a34[_0xbd23('0x1c')];var _0x32a8c8=_0x230743?_0x56e1f5[_0xbd23('0x1f')]:_0x296a34[_0xbd23('0x1c')]+_0x296a34['limit'];var _0x536333;if(_0x32a8c8>=_0x5acc89){_0x32a8c8=_0x5acc89;_0x536333=0xc8;}else{_0x536333=0xce;}_0x58e69d[_0xbd23('0x20')](_0x536333);return _0x58e69d[_0xbd23('0x21')](_0xbd23('0x22'),_0x2a3b35+'-'+_0x32a8c8+'/'+_0x5acc89)[_0xbd23('0x1b')](_0x56e1f5);}return null;};}function patchUpdates(_0x1d12f1){return function(_0x67f666){try{jsonpatch['apply'](_0x67f666,_0x1d12f1,!![]);}catch(_0x467a53){return BPromise[_0xbd23('0x23')](_0x467a53);}return _0x67f666['save']();};}function saveUpdates(_0x3d5671,_0x43f53b){return function(_0x735ff3){if(_0x735ff3){return _0x735ff3[_0xbd23('0x24')](_0x3d5671)['then'](function(_0x5f3bb0){return _0x5f3bb0;});}return null;};}function removeEntity(_0x3396a1,_0x43aeb5){return function(_0xd644ac){if(_0xd644ac){return _0xd644ac[_0xbd23('0x25')]()['then'](function(){var _0x5659ca=_0xd644ac[_0xbd23('0x26')]({'plain':!![]});var _0x200767=_0xbd23('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x200767,'resourceId':_0x5659ca['id']}})[_0xbd23('0x28')](function(){return _0xd644ac;});})[_0xbd23('0x28')](function(){_0x3396a1[_0xbd23('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ecec4,_0x1d5f24){return function(_0x1900b4){if(!_0x1900b4){_0x5ecec4[_0xbd23('0x29')](0x194);}return _0x1900b4;};}function handleError(_0x207f51,_0x1a5287){_0x1a5287=_0x1a5287||0x1f4;return function(_0x422ee2){logger[_0xbd23('0x2a')](_0x422ee2[_0xbd23('0x2b')]);if(_0x422ee2['name']){delete _0x422ee2[_0xbd23('0x2c')];}_0x207f51[_0xbd23('0x20')](_0x1a5287)[_0xbd23('0x2d')](_0x422ee2);};}exports[_0xbd23('0x2e')]=function(_0x29e6dc,_0x420f13){var _0x3bd9ff={},_0x239970={},_0x34296a={'count':0x0,'rows':[]};var _0x3ddb6b=_[_0xbd23('0x2f')](db['Campaign'][_0xbd23('0x30')],function(_0x2caf4d){return{'name':_0x2caf4d[_0xbd23('0x31')],'type':_0x2caf4d['type'][_0xbd23('0x32')]};});_0x239970[_0xbd23('0x33')]=_['map'](_0x3ddb6b,_0xbd23('0x2c'));_0x239970[_0xbd23('0x34')]=_[_0xbd23('0x35')](_0x29e6dc[_0xbd23('0x34')]);_0x239970[_0xbd23('0x36')]=_[_0xbd23('0x37')](_0x239970[_0xbd23('0x33')],_0x239970[_0xbd23('0x34')]);_0x3bd9ff[_0xbd23('0x38')]=_[_0xbd23('0x37')](_0x239970[_0xbd23('0x33')],qs[_0xbd23('0x39')](_0x29e6dc[_0xbd23('0x34')][_0xbd23('0x39')]));_0x3bd9ff['attributes']=_0x3bd9ff[_0xbd23('0x38')][_0xbd23('0x3a')]?_0x3bd9ff[_0xbd23('0x38')]:_0x239970[_0xbd23('0x33')];if(!_0x29e6dc['query'][_0xbd23('0x3b')](_0xbd23('0x3c'))){_0x3bd9ff[_0xbd23('0x1d')]=qs[_0xbd23('0x1d')](_0x29e6dc[_0xbd23('0x34')][_0xbd23('0x1d')]);_0x3bd9ff[_0xbd23('0x1c')]=qs[_0xbd23('0x1c')](_0x29e6dc[_0xbd23('0x34')]['offset']);}_0x3bd9ff[_0xbd23('0x3d')]=qs[_0xbd23('0x3e')](_0x29e6dc[_0xbd23('0x34')]['sort']);_0x3bd9ff[_0xbd23('0x3f')]=qs[_0xbd23('0x36')](_[_0xbd23('0x40')](_0x29e6dc[_0xbd23('0x34')],_0x239970[_0xbd23('0x36')]),_0x3ddb6b);if(_0x29e6dc[_0xbd23('0x34')][_0xbd23('0x41')]){_0x3bd9ff[_0xbd23('0x3f')]=_[_0xbd23('0x42')](_0x3bd9ff['where'],{'$or':_[_0xbd23('0x2f')](_0x3ddb6b,function(_0x3b0e96){if(_0x3b0e96[_0xbd23('0x43')]!==_0xbd23('0x44')){var _0x51bc0d={};_0x51bc0d[_0x3b0e96[_0xbd23('0x2c')]]={'$like':'%'+_0x29e6dc['query'][_0xbd23('0x41')]+'%'};return _0x51bc0d;}})});}_0x3bd9ff=_[_0xbd23('0x42')]({},_0x3bd9ff,_0x29e6dc[_0xbd23('0x45')]);var _0x19c97a={'where':_0x3bd9ff[_0xbd23('0x3f')]};return db['Campaign']['count'](_0x19c97a)['then'](function(_0x3302e5){_0x34296a[_0xbd23('0x1f')]=_0x3302e5;if(_0x29e6dc['query'][_0xbd23('0x46')]){_0x3bd9ff[_0xbd23('0x47')]=[{'all':!![]}];}return db['Campaign'][_0xbd23('0x48')](_0x3bd9ff);})[_0xbd23('0x28')](function(_0x20c49e){_0x34296a[_0xbd23('0x49')]=_0x20c49e;return _0x34296a;})['then'](respondWithFilteredResult(_0x420f13,_0x3bd9ff))[_0xbd23('0x4a')](handleError(_0x420f13,null));};exports[_0xbd23('0x4b')]=function(_0xb46516,_0x3375b1){var _0x13d2b0={'raw':![],'where':{'id':_0xb46516[_0xbd23('0x4c')]['id']}},_0x1f32c9={};_0x1f32c9[_0xbd23('0x33')]=_['keys'](db[_0xbd23('0x4d')][_0xbd23('0x30')]);_0x1f32c9[_0xbd23('0x34')]=_[_0xbd23('0x35')](_0xb46516[_0xbd23('0x34')]);_0x1f32c9['filters']=_['intersection'](_0x1f32c9[_0xbd23('0x33')],_0x1f32c9['query']);_0x13d2b0[_0xbd23('0x38')]=_[_0xbd23('0x37')](_0x1f32c9[_0xbd23('0x33')],qs[_0xbd23('0x39')](_0xb46516['query'][_0xbd23('0x39')]));_0x13d2b0[_0xbd23('0x38')]=_0x13d2b0[_0xbd23('0x38')][_0xbd23('0x3a')]?_0x13d2b0[_0xbd23('0x38')]:_0x1f32c9[_0xbd23('0x33')];if(_0xb46516[_0xbd23('0x34')][_0xbd23('0x46')]){_0x13d2b0[_0xbd23('0x47')]=[{'all':!![]}];}_0x13d2b0=_['merge']({},_0x13d2b0,_0xb46516[_0xbd23('0x45')]);return db['Campaign']['find'](_0x13d2b0)['then'](handleEntityNotFound(_0x3375b1,null))['then'](respondWithResult(_0x3375b1,null))['catch'](handleError(_0x3375b1,null));};exports[_0xbd23('0x4e')]=function(_0x540c41,_0x458a69){return db[_0xbd23('0x4d')][_0xbd23('0x4e')](_0x540c41['body'],{})[_0xbd23('0x28')](function(_0x177f2f){var _0x267217=_0x540c41['user'][_0xbd23('0x26')]({'plain':!![]});if(!_0x267217)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x267217[_0xbd23('0x4f')]===_0xbd23('0x50')){var _0x5a594b=_0x177f2f[_0xbd23('0x26')]({'plain':!![]});var _0x4e29cd=_0xbd23('0x27');return db[_0xbd23('0x51')][_0xbd23('0x52')]({'where':{'name':_0x4e29cd,'userProfileId':_0x267217[_0xbd23('0x53')]},'raw':!![]})[_0xbd23('0x28')](function(_0xaf4021){if(_0xaf4021&&_0xaf4021[_0xbd23('0x54')]===0x0){return db['UserProfileResource'][_0xbd23('0x4e')]({'name':_0x5a594b[_0xbd23('0x2c')],'resourceId':_0x5a594b['id'],'type':_0xaf4021[_0xbd23('0x2c')],'sectionId':_0xaf4021['id']},{})['then'](function(){return _0x177f2f;});}else{return _0x177f2f;}})[_0xbd23('0x4a')](function(_0x427a59){logger[_0xbd23('0x2a')](_0xbd23('0x55'),_0x427a59);throw _0x427a59;});}return _0x177f2f;})[_0xbd23('0x28')](respondWithResult(_0x458a69,0xc9))[_0xbd23('0x4a')](handleError(_0x458a69,null));};exports[_0xbd23('0x56')]=function(_0x33fc5e,_0x29db17){var _0x58934d={'where':{'id':_0x33fc5e[_0xbd23('0x4c')]['id']}},_0x10b699={};_0x10b699[_0xbd23('0x33')]=_[_0xbd23('0x35')](db[_0xbd23('0x4d')][_0xbd23('0x30')]);_0x58934d['attributes']=_[_0xbd23('0x37')](_0x10b699[_0xbd23('0x33')],qs[_0xbd23('0x39')](_0x33fc5e[_0xbd23('0x34')][_0xbd23('0x39')]));_0x58934d[_0xbd23('0x38')]=_0x58934d[_0xbd23('0x38')][_0xbd23('0x3a')]?_0x58934d['attributes']:_0x10b699['model'];if(_0x33fc5e['query'][_0xbd23('0x46')]){_0x58934d[_0xbd23('0x47')]=[{'all':!![]}];}_0x58934d=_[_0xbd23('0x42')]({},_0x58934d,_0x33fc5e[_0xbd23('0x45')]);return db[_0xbd23('0x4d')][_0xbd23('0x52')](_0x58934d)[_0xbd23('0x28')](handleEntityNotFound(_0x29db17,null))[_0xbd23('0x28')](function(_0xa0e59e){if(_0xa0e59e){var _0x5cd945=_0xa0e59e[_0xbd23('0x26')]({'plain':!![]});_0x5cd945=qs[_0xbd23('0x57')](_0x5cd945,['id',_0xbd23('0x58'),_0xbd23('0x59')]);_0x33fc5e[_0xbd23('0x5a')]=_[_0xbd23('0x57')](_0x33fc5e[_0xbd23('0x5a')],['id',_0xbd23('0x58'),_0xbd23('0x59')]);return db[_0xbd23('0x4d')]['create'](_['merge'](_0x5cd945,_0x33fc5e[_0xbd23('0x5a')]),{'include':_0x33fc5e['query'][_0xbd23('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x3c9f48){var _0x4b0606=_0x33fc5e[_0xbd23('0x50')][_0xbd23('0x26')]({'plain':!![]});if(!_0x4b0606)throw new Error(_0xbd23('0x5b'));if(_0x4b0606['role']===_0xbd23('0x50')){var _0x567ba9=_0x3c9f48['get']({'plain':!![]});var _0x519c45='IvrCampaigns';return db['UserProfileSection'][_0xbd23('0x52')]({'where':{'name':_0x519c45,'userProfileId':_0x4b0606[_0xbd23('0x53')]},'raw':!![]})[_0xbd23('0x28')](function(_0x3d9a5b){if(_0x3d9a5b&&_0x3d9a5b[_0xbd23('0x54')]===0x0){return db[_0xbd23('0x5c')]['create']({'name':_0x567ba9['name'],'resourceId':_0x567ba9['id'],'type':_0x3d9a5b[_0xbd23('0x2c')],'sectionId':_0x3d9a5b['id']},{})[_0xbd23('0x28')](function(){return _0x3c9f48;});}else{return _0x3c9f48;}})[_0xbd23('0x4a')](function(_0x55d942){logger['error'](_0xbd23('0x55'),_0x55d942);throw _0x55d942;});}return _0x3c9f48;});}})[_0xbd23('0x28')](respondWithResult(_0x29db17,0xc9))['catch'](handleError(_0x29db17,null));};exports['update']=function(_0x1568d0,_0x51e113){if(_0x1568d0[_0xbd23('0x5a')]['id']){delete _0x1568d0[_0xbd23('0x5a')]['id'];}return db[_0xbd23('0x4d')][_0xbd23('0x52')]({'where':{'id':_0x1568d0[_0xbd23('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51e113,null))['then'](saveUpdates(_0x1568d0[_0xbd23('0x5a')],null))[_0xbd23('0x28')](respondWithResult(_0x51e113,null))[_0xbd23('0x4a')](handleError(_0x51e113,null));};exports['destroy']=function(_0x7c4bdd,_0x23ccb7){return db['Campaign']['find']({'where':{'id':_0x7c4bdd[_0xbd23('0x4c')]['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0x23ccb7,null))[_0xbd23('0x28')](removeEntity(_0x23ccb7,null))[_0xbd23('0x4a')](handleError(_0x23ccb7,null));};exports['getHoppers']=function(_0x2b6322,_0x5174d8,_0x1fc497){var _0x472dcf={'raw':!![],'where':{}};var _0x4e7aa1={};var _0x232f33={'count':0x0,'rows':[]};return db[_0xbd23('0x4d')][_0xbd23('0x5d')]({'where':{'id':_0x2b6322[_0xbd23('0x4c')]['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0x5174d8,null))[_0xbd23('0x28')](function(_0x439376){if(_0x439376){_0x4e7aa1[_0xbd23('0x33')]=_['keys'](db[_0xbd23('0x5e')][_0xbd23('0x30')]);_0x4e7aa1[_0xbd23('0x34')]=_['keys'](_0x2b6322[_0xbd23('0x34')]);_0x4e7aa1['filters']=_[_0xbd23('0x37')](_0x4e7aa1['model'],_0x4e7aa1[_0xbd23('0x34')]);_0x472dcf[_0xbd23('0x38')]=_[_0xbd23('0x37')](_0x4e7aa1[_0xbd23('0x33')],qs[_0xbd23('0x39')](_0x2b6322[_0xbd23('0x34')][_0xbd23('0x39')]));_0x472dcf[_0xbd23('0x38')]=_0x472dcf[_0xbd23('0x38')][_0xbd23('0x3a')]?_0x472dcf[_0xbd23('0x38')]:_0x4e7aa1[_0xbd23('0x33')];if(!_0x2b6322[_0xbd23('0x34')]['hasOwnProperty'](_0xbd23('0x3c'))){_0x472dcf[_0xbd23('0x1d')]=qs[_0xbd23('0x1d')](_0x2b6322[_0xbd23('0x34')][_0xbd23('0x1d')]);_0x472dcf[_0xbd23('0x1c')]=qs[_0xbd23('0x1c')](_0x2b6322[_0xbd23('0x34')][_0xbd23('0x1c')]);}_0x472dcf['order']=qs['sort'](_0x2b6322[_0xbd23('0x34')]['sort']);_0x472dcf[_0xbd23('0x3f')]=qs[_0xbd23('0x36')](_[_0xbd23('0x40')](_0x2b6322[_0xbd23('0x34')],_0x4e7aa1[_0xbd23('0x36')]));_0x472dcf['where'][_0xbd23('0x5f')]=_0x439376['id'];if(_0x2b6322['query'][_0xbd23('0x41')]){_0x472dcf['where']=_[_0xbd23('0x42')](_0x472dcf[_0xbd23('0x3f')],{'$or':_[_0xbd23('0x2f')](_0x472dcf[_0xbd23('0x38')],function(_0x57fce0){var _0x1d6b56={};_0x1d6b56[_0x57fce0]={'$like':'%'+_0x2b6322['query']['filter']+'%'};return _0x1d6b56;})});}_0x472dcf=_[_0xbd23('0x42')]({},_0x472dcf,_0x2b6322[_0xbd23('0x45')]);return db['CmHopper']['count']({'where':_0x472dcf[_0xbd23('0x3f')]})['then'](function(_0xbdb84b){_0x232f33[_0xbd23('0x1f')]=_0xbdb84b;if(_0x2b6322[_0xbd23('0x34')]['includeAll']){_0x472dcf[_0xbd23('0x47')]=[{'all':!![]}];}return db[_0xbd23('0x5e')][_0xbd23('0x48')](_0x472dcf);})[_0xbd23('0x28')](function(_0x14b855){_0x232f33[_0xbd23('0x49')]=_0x14b855;return _0x232f33;});}})['then'](respondWithFilteredResult(_0x5174d8,_0x472dcf))[_0xbd23('0x4a')](handleError(_0x5174d8,null));};exports[_0xbd23('0x60')]=function(_0xb45a07,_0x1af0bc,_0x12faad){var _0x18c4f7={'raw':!![],'where':{}};var _0x524717={};var _0x1e7465={'count':0x0,'rows':[]};return db['Campaign'][_0xbd23('0x5d')]({'where':{'id':_0xb45a07['params']['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0x1af0bc,null))[_0xbd23('0x28')](function(_0x5f1f93){if(_0x5f1f93){_0x524717['model']=_[_0xbd23('0x35')](db[_0xbd23('0x61')][_0xbd23('0x30')]);_0x524717[_0xbd23('0x34')]=_[_0xbd23('0x35')](_0xb45a07[_0xbd23('0x34')]);_0x524717[_0xbd23('0x36')]=_[_0xbd23('0x37')](_0x524717[_0xbd23('0x33')],_0x524717[_0xbd23('0x34')]);_0x18c4f7['attributes']=_['intersection'](_0x524717['model'],qs['fields'](_0xb45a07[_0xbd23('0x34')][_0xbd23('0x39')]));_0x18c4f7[_0xbd23('0x38')]=_0x18c4f7[_0xbd23('0x38')]['length']?_0x18c4f7['attributes']:_0x524717[_0xbd23('0x33')];if(!_0xb45a07['query']['hasOwnProperty'](_0xbd23('0x3c'))){_0x18c4f7['limit']=qs[_0xbd23('0x1d')](_0xb45a07['query']['limit']);_0x18c4f7['offset']=qs[_0xbd23('0x1c')](_0xb45a07['query'][_0xbd23('0x1c')]);}_0x18c4f7['order']=qs[_0xbd23('0x3e')](_0xb45a07[_0xbd23('0x34')][_0xbd23('0x3e')]);_0x18c4f7[_0xbd23('0x3f')]=qs[_0xbd23('0x36')](_[_0xbd23('0x40')](_0xb45a07[_0xbd23('0x34')],_0x524717[_0xbd23('0x36')]));_0x18c4f7[_0xbd23('0x3f')][_0xbd23('0x5f')]=_0x5f1f93['id'];if(_0xb45a07[_0xbd23('0x34')]['filter']){_0x18c4f7['where']=_[_0xbd23('0x42')](_0x18c4f7[_0xbd23('0x3f')],{'$or':_['map'](_0x18c4f7['attributes'],function(_0x4b921b){var _0x110cab={};_0x110cab[_0x4b921b]={'$like':'%'+_0xb45a07[_0xbd23('0x34')][_0xbd23('0x41')]+'%'};return _0x110cab;})});}_0x18c4f7=_[_0xbd23('0x42')]({},_0x18c4f7,_0xb45a07[_0xbd23('0x45')]);return db[_0xbd23('0x61')][_0xbd23('0x1f')]({'where':_0x18c4f7[_0xbd23('0x3f')]})[_0xbd23('0x28')](function(_0x170703){_0x1e7465['count']=_0x170703;if(_0xb45a07[_0xbd23('0x34')][_0xbd23('0x46')]){_0x18c4f7['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xbd23('0x48')](_0x18c4f7);})[_0xbd23('0x28')](function(_0x4812fa){_0x1e7465['rows']=_0x4812fa;return _0x1e7465;});}})['then'](respondWithFilteredResult(_0x1af0bc,_0x18c4f7))[_0xbd23('0x4a')](handleError(_0x1af0bc,null));};exports[_0xbd23('0x62')]=function(_0x344a45,_0xea335,_0xcd41fc){var _0x4e1499={'raw':!![],'where':{}};var _0x55ab21={};var _0x5015d3={'count':0x0,'rows':[]};return db[_0xbd23('0x4d')][_0xbd23('0x5d')]({'where':{'id':_0x344a45[_0xbd23('0x4c')]['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0xea335,null))[_0xbd23('0x28')](function(_0x324b4e){if(_0x324b4e){_0x55ab21['model']=_[_0xbd23('0x35')](db[_0xbd23('0x63')][_0xbd23('0x30')]);_0x55ab21[_0xbd23('0x34')]=_[_0xbd23('0x35')](_0x344a45[_0xbd23('0x34')]);_0x55ab21['filters']=_[_0xbd23('0x37')](_0x55ab21['model'],_0x55ab21['query']);_0x4e1499[_0xbd23('0x38')]=_[_0xbd23('0x37')](_0x55ab21['model'],qs[_0xbd23('0x39')](_0x344a45[_0xbd23('0x34')][_0xbd23('0x39')]));_0x4e1499[_0xbd23('0x38')]=_0x4e1499[_0xbd23('0x38')][_0xbd23('0x3a')]?_0x4e1499[_0xbd23('0x38')]:_0x55ab21[_0xbd23('0x33')];if(!_0x344a45[_0xbd23('0x34')][_0xbd23('0x3b')]('nolimit')){_0x4e1499[_0xbd23('0x1d')]=qs[_0xbd23('0x1d')](_0x344a45[_0xbd23('0x34')]['limit']);_0x4e1499[_0xbd23('0x1c')]=qs[_0xbd23('0x1c')](_0x344a45[_0xbd23('0x34')]['offset']);}_0x4e1499[_0xbd23('0x3d')]=qs['sort'](_0x344a45['query'][_0xbd23('0x3e')]);_0x4e1499[_0xbd23('0x3f')]=qs[_0xbd23('0x36')](_['pick'](_0x344a45[_0xbd23('0x34')],_0x55ab21[_0xbd23('0x36')]));_0x4e1499[_0xbd23('0x3f')]['CampaignId']=_0x324b4e['id'];if(_0x344a45['query'][_0xbd23('0x41')]){_0x4e1499['where']=_[_0xbd23('0x42')](_0x4e1499[_0xbd23('0x3f')],{'$or':_[_0xbd23('0x2f')](_0x4e1499[_0xbd23('0x38')],function(_0x3d1067){var _0x3e6ea0={};_0x3e6ea0[_0x3d1067]={'$like':'%'+_0x344a45['query'][_0xbd23('0x41')]+'%'};return _0x3e6ea0;})});}_0x4e1499=_[_0xbd23('0x42')]({},_0x4e1499,_0x344a45[_0xbd23('0x45')]);return db[_0xbd23('0x63')]['count']({'where':_0x4e1499['where']})['then'](function(_0xb1e7aa){_0x5015d3[_0xbd23('0x1f')]=_0xb1e7aa;if(_0x344a45[_0xbd23('0x34')][_0xbd23('0x46')]){_0x4e1499[_0xbd23('0x47')]=[{'all':!![]}];}return db[_0xbd23('0x63')][_0xbd23('0x48')](_0x4e1499);})[_0xbd23('0x28')](function(_0x3083f1){_0x5015d3[_0xbd23('0x49')]=_0x3083f1;return _0x5015d3;});}})[_0xbd23('0x28')](respondWithFilteredResult(_0xea335,_0x4e1499))['catch'](handleError(_0xea335,null));};exports[_0xbd23('0x64')]=function(_0x8ff5db,_0x5141f6,_0x1ae6de){var _0x4d9654={'raw':!![],'where':{}};var _0xc1f728={};var _0x18ec16={'count':0x0,'rows':[]};return db[_0xbd23('0x4d')][_0xbd23('0x5d')]({'where':{'id':_0x8ff5db[_0xbd23('0x4c')]['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0x5141f6,null))[_0xbd23('0x28')](function(_0x5cad12){if(_0x5cad12){_0xc1f728[_0xbd23('0x33')]=_[_0xbd23('0x35')](db[_0xbd23('0x65')]['rawAttributes']);_0xc1f728[_0xbd23('0x34')]=_[_0xbd23('0x35')](_0x8ff5db[_0xbd23('0x34')]);_0xc1f728[_0xbd23('0x36')]=_[_0xbd23('0x37')](_0xc1f728[_0xbd23('0x33')],_0xc1f728[_0xbd23('0x34')]);_0x4d9654[_0xbd23('0x38')]=_[_0xbd23('0x37')](_0xc1f728[_0xbd23('0x33')],qs[_0xbd23('0x39')](_0x8ff5db[_0xbd23('0x34')][_0xbd23('0x39')]));_0x4d9654['attributes']=_0x4d9654[_0xbd23('0x38')][_0xbd23('0x3a')]?_0x4d9654[_0xbd23('0x38')]:_0xc1f728[_0xbd23('0x33')];if(!_0x8ff5db[_0xbd23('0x34')][_0xbd23('0x3b')]('nolimit')){_0x4d9654[_0xbd23('0x1d')]=qs[_0xbd23('0x1d')](_0x8ff5db[_0xbd23('0x34')][_0xbd23('0x1d')]);_0x4d9654[_0xbd23('0x1c')]=qs[_0xbd23('0x1c')](_0x8ff5db['query'][_0xbd23('0x1c')]);}_0x4d9654[_0xbd23('0x3d')]=qs[_0xbd23('0x3e')](_0x8ff5db[_0xbd23('0x34')][_0xbd23('0x3e')]);_0x4d9654[_0xbd23('0x3f')]=qs[_0xbd23('0x36')](_[_0xbd23('0x40')](_0x8ff5db['query'],_0xc1f728[_0xbd23('0x36')]));_0x4d9654[_0xbd23('0x3f')][_0xbd23('0x5f')]=_0x5cad12['id'];if(_0x8ff5db[_0xbd23('0x34')][_0xbd23('0x41')]){_0x4d9654[_0xbd23('0x3f')]=_[_0xbd23('0x42')](_0x4d9654[_0xbd23('0x3f')],{'$or':_['map'](_0x4d9654['attributes'],function(_0x373161){var _0x4dbc99={};_0x4dbc99[_0x373161]={'$like':'%'+_0x8ff5db[_0xbd23('0x34')][_0xbd23('0x41')]+'%'};return _0x4dbc99;})});}_0x4d9654=_['merge']({},_0x4d9654,_0x8ff5db[_0xbd23('0x45')]);return db[_0xbd23('0x65')]['count']({'where':_0x4d9654['where']})[_0xbd23('0x28')](function(_0x2b77ea){_0x18ec16[_0xbd23('0x1f')]=_0x2b77ea;if(_0x8ff5db[_0xbd23('0x34')]['includeAll']){_0x4d9654[_0xbd23('0x47')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xbd23('0x48')](_0x4d9654);})[_0xbd23('0x28')](function(_0x37a22d){_0x18ec16['rows']=_0x37a22d;return _0x18ec16;});}})[_0xbd23('0x28')](respondWithFilteredResult(_0x5141f6,_0x4d9654))['catch'](handleError(_0x5141f6,null));};exports['getLists']=function(_0x30efec,_0x4fbbd1,_0x45723e){var _0x17e414={};var _0x5a4fce={};var _0x31d709;var _0x4f0d79;return db[_0xbd23('0x4d')][_0xbd23('0x5d')]({'where':{'id':_0x30efec[_0xbd23('0x4c')]['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0x4fbbd1,null))['then'](function(_0x4a8f11){if(_0x4a8f11){_0x31d709=_0x4a8f11;_0x5a4fce['model']=_[_0xbd23('0x35')](db[_0xbd23('0x66')][_0xbd23('0x30')]);_0x5a4fce[_0xbd23('0x34')]=_[_0xbd23('0x35')](_0x30efec['query']);_0x5a4fce[_0xbd23('0x36')]=_[_0xbd23('0x37')](_0x5a4fce[_0xbd23('0x33')],_0x5a4fce[_0xbd23('0x34')]);_0x17e414[_0xbd23('0x38')]=_[_0xbd23('0x37')](_0x5a4fce[_0xbd23('0x33')],qs['fields'](_0x30efec[_0xbd23('0x34')]['fields']));_0x17e414[_0xbd23('0x38')]=_0x17e414[_0xbd23('0x38')][_0xbd23('0x3a')]?_0x17e414[_0xbd23('0x38')]:_0x5a4fce[_0xbd23('0x33')];_0x17e414[_0xbd23('0x3d')]=qs[_0xbd23('0x3e')](_0x30efec[_0xbd23('0x34')][_0xbd23('0x3e')]);_0x17e414[_0xbd23('0x3f')]=qs[_0xbd23('0x36')](_[_0xbd23('0x40')](_0x30efec[_0xbd23('0x34')],_0x5a4fce[_0xbd23('0x36')]));if(_0x30efec[_0xbd23('0x34')][_0xbd23('0x41')]){_0x17e414[_0xbd23('0x3f')]=_['merge'](_0x17e414[_0xbd23('0x3f')],{'$or':_['map'](_0x17e414[_0xbd23('0x38')],function(_0x21965c){var _0x3cf38c={};_0x3cf38c[_0x21965c]={'$like':'%'+_0x30efec[_0xbd23('0x34')]['filter']+'%'};return _0x3cf38c;})});}_0x17e414=_[_0xbd23('0x42')]({},_0x17e414,_0x30efec[_0xbd23('0x45')]);return _0x31d709[_0xbd23('0x67')](_0x17e414);}})[_0xbd23('0x28')](function(_0x20718f){if(_0x20718f){_0x4f0d79=_0x20718f[_0xbd23('0x3a')];if(!_0x30efec[_0xbd23('0x34')]['hasOwnProperty'](_0xbd23('0x3c'))){_0x17e414['limit']=qs[_0xbd23('0x1d')](_0x30efec[_0xbd23('0x34')][_0xbd23('0x1d')]);_0x17e414[_0xbd23('0x1c')]=qs[_0xbd23('0x1c')](_0x30efec['query']['offset']);}return _0x31d709[_0xbd23('0x67')](_0x17e414);}})['then'](function(_0x30081c){if(_0x30081c){return _0x30081c?{'count':_0x4f0d79,'rows':_0x30081c}:null;}})[_0xbd23('0x28')](respondWithResult(_0x4fbbd1,null))[_0xbd23('0x4a')](handleError(_0x4fbbd1,null));};exports[_0xbd23('0x68')]=function(_0x390f28,_0x48060e,_0x4a58bc){var _0x2a8597,_0x532611;return db[_0xbd23('0x4d')][_0xbd23('0x52')]({'where':{'id':_0x390f28[_0xbd23('0x4c')]['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0x48060e,null))[_0xbd23('0x28')](function(_0x1fa95f){if(_0x1fa95f){_0x532611=_0x1fa95f;return _0x1fa95f[_0xbd23('0x68')](_0x390f28[_0xbd23('0x5a')][_0xbd23('0x69')],_[_0xbd23('0x57')](_0x390f28['body'],[_0xbd23('0x69'),'id'])||{});}return null;})[_0xbd23('0x6a')](function(_0x476006){var _0x1506f5;_0x2a8597=_0x476006||[];var _0x3c8f4c=[];if(_0x476006){for(var _0x31aff8=0x0;_0x31aff8<_0x476006[_0xbd23('0x3a')];_0x31aff8+=0x1){var _0x241cae=_0x476006[_0x31aff8][_0xbd23('0x26')]({'plain':!![]});_0x532611[_0xbd23('0x6b')]=_0x390f28[_0xbd23('0x5a')][_0xbd23('0x6b')]?_0x390f28['body'][_0xbd23('0x6b')]:_0x532611[_0xbd23('0x6b')];switch(_0x532611[_0xbd23('0x6b')]){case _0xbd23('0x6c'):_0x1506f5=squel['insert']()[_0xbd23('0x6d')](_0xbd23('0x6e'))[_0xbd23('0x6f')](['phone',_0xbd23('0x70'),'ContactId',_0xbd23('0x71'),_0xbd23('0x5f'),_0xbd23('0x58'),'updatedAt'],squel[_0xbd23('0x72')]()[_0xbd23('0x73')](_0xbd23('0x74'),_0xbd23('0x74'))[_0xbd23('0x73')]('NOW()',_0xbd23('0x70'))[_0xbd23('0x73')]('id',_0xbd23('0x75'))[_0xbd23('0x73')](_0x241cae[_0xbd23('0x76')][_0xbd23('0x77')](),_0xbd23('0x71'))[_0xbd23('0x73')](_0x390f28['params']['id']['toString'](),_0xbd23('0x5f'))[_0xbd23('0x73')](_0xbd23('0x78'),'createdAt')[_0xbd23('0x73')](_0xbd23('0x78'),_0xbd23('0x59'))['from'](_0xbd23('0x79'))[_0xbd23('0x3f')](_0xbd23('0x7a'))['where'](_0xbd23('0x7b'),_0x241cae[_0xbd23('0x76')]['toString']())[_0xbd23('0x3f')](_0xbd23('0x7c'))[_0xbd23('0x3f')](_0xbd23('0x7d'),squel['select']()[_0xbd23('0x73')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xbd23('0x7e'))[_0xbd23('0x3f')](_0xbd23('0x7f'),_0x390f28[_0xbd23('0x4c')]['id'][_0xbd23('0x77')]()))['where'](_0xbd23('0x7d'),squel[_0xbd23('0x72')]()[_0xbd23('0x73')](_0xbd23('0x80'))[_0xbd23('0x81')](_0xbd23('0x6e'))[_0xbd23('0x3f')](_0xbd23('0x7f'),_0x390f28[_0xbd23('0x4c')]['id']['toString']())))[_0xbd23('0x77')]();break;case _0xbd23('0x82'):_0x1506f5=squel[_0xbd23('0x83')]()[_0xbd23('0x6d')](_0xbd23('0x6e'))[_0xbd23('0x6f')](['phone',_0xbd23('0x70'),'ContactId',_0xbd23('0x71'),_0xbd23('0x5f'),_0xbd23('0x58'),_0xbd23('0x59')],squel[_0xbd23('0x72')]()[_0xbd23('0x73')](_0xbd23('0x74'),'phone')['field'](_0xbd23('0x78'),_0xbd23('0x70'))[_0xbd23('0x73')]('id','ContactId')[_0xbd23('0x73')](_0x241cae[_0xbd23('0x76')][_0xbd23('0x77')](),_0xbd23('0x71'))[_0xbd23('0x73')](_0x390f28[_0xbd23('0x4c')]['id'][_0xbd23('0x77')](),'CampaignId')['field']('NOW()',_0xbd23('0x58'))[_0xbd23('0x73')](_0xbd23('0x78'),_0xbd23('0x59'))[_0xbd23('0x81')]('cm_contacts')[_0xbd23('0x3f')](_0xbd23('0x7a'))[_0xbd23('0x3f')](_0xbd23('0x7b'),_0x241cae[_0xbd23('0x76')][_0xbd23('0x77')]())[_0xbd23('0x3f')](_0xbd23('0x7c'))[_0xbd23('0x3f')](_0xbd23('0x7d'),squel['select']()['field'](_0xbd23('0x80'))[_0xbd23('0x81')](_0xbd23('0x6e'))[_0xbd23('0x3f')](_0xbd23('0x7f'),_0x390f28['params']['id'][_0xbd23('0x77')]())))[_0xbd23('0x77')]();break;default:_0x1506f5=squel[_0xbd23('0x83')]()['into'](_0xbd23('0x6e'))[_0xbd23('0x6f')]([_0xbd23('0x74'),'scheduledAt',_0xbd23('0x75'),_0xbd23('0x71'),_0xbd23('0x5f'),'createdAt',_0xbd23('0x59')],squel[_0xbd23('0x72')]()[_0xbd23('0x73')](_0xbd23('0x74'),'phone')[_0xbd23('0x73')](_0xbd23('0x78'),_0xbd23('0x70'))[_0xbd23('0x73')]('id','ContactId')[_0xbd23('0x73')](_0x241cae[_0xbd23('0x76')]['toString'](),_0xbd23('0x71'))[_0xbd23('0x73')](_0x390f28['params']['id'][_0xbd23('0x77')](),_0xbd23('0x5f'))[_0xbd23('0x73')]('NOW()',_0xbd23('0x58'))['field']('NOW()','updatedAt')['from'](_0xbd23('0x79'))[_0xbd23('0x3f')](_0xbd23('0x7a'))['where']('ListId\x20=\x20?',_0x241cae['CmListId'][_0xbd23('0x77')]())['where'](_0xbd23('0x7c')))['toString']();}_0x3c8f4c[_0xbd23('0x84')](db[_0xbd23('0x85')][_0xbd23('0x34')](_0x1506f5));}return BPromise['all'](_0x3c8f4c);}})[_0xbd23('0x28')](function(){return _0x2a8597;})[_0xbd23('0x28')](respondWithResult(_0x48060e,null))[_0xbd23('0x4a')](handleError(_0x48060e,null));};exports['removeLists']=function(_0x1adc5b,_0x1fca0c,_0x5a2179){return db[_0xbd23('0x4d')]['find']({'where':{'id':_0x1adc5b['params']['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0x1fca0c,null))[_0xbd23('0x28')](function(_0x3a68d3){if(_0x3a68d3){return _0x3a68d3[_0xbd23('0x86')](_0x1adc5b[_0xbd23('0x34')][_0xbd23('0x69')]);}})['then'](function(_0x18cb74){if(_0x18cb74){return db[_0xbd23('0x5e')][_0xbd23('0x25')]({'where':{'ListId':_0x1adc5b[_0xbd23('0x34')][_0xbd23('0x69')],'CampaignId':_0x1adc5b['params']['id']}})[_0xbd23('0x28')](function(){return _0x18cb74;});}})[_0xbd23('0x28')](respondWithStatusCode(_0x1fca0c,null))[_0xbd23('0x4a')](handleError(_0x1fca0c,null));};exports[_0xbd23('0x87')]=function(_0x508041,_0x1fdf84,_0x961b32){var _0xd64ef3={};var _0x4ea693={};var _0x3ba615;var _0xf1dc45;return db['Campaign'][_0xbd23('0x5d')]({'where':{'id':_0x508041[_0xbd23('0x4c')]['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0x1fdf84,null))[_0xbd23('0x28')](function(_0xf3cf5a){if(_0xf3cf5a){_0x3ba615=_0xf3cf5a;_0x4ea693[_0xbd23('0x33')]=_[_0xbd23('0x35')](db[_0xbd23('0x66')][_0xbd23('0x30')]);_0x4ea693[_0xbd23('0x34')]=_['keys'](_0x508041[_0xbd23('0x34')]);_0x4ea693[_0xbd23('0x36')]=_[_0xbd23('0x37')](_0x4ea693[_0xbd23('0x33')],_0x4ea693[_0xbd23('0x34')]);_0xd64ef3[_0xbd23('0x38')]=_[_0xbd23('0x37')](_0x4ea693['model'],qs[_0xbd23('0x39')](_0x508041[_0xbd23('0x34')][_0xbd23('0x39')]));_0xd64ef3['attributes']=_0xd64ef3[_0xbd23('0x38')][_0xbd23('0x3a')]?_0xd64ef3[_0xbd23('0x38')]:_0x4ea693[_0xbd23('0x33')];_0xd64ef3[_0xbd23('0x3d')]=qs['sort'](_0x508041[_0xbd23('0x34')][_0xbd23('0x3e')]);_0xd64ef3[_0xbd23('0x3f')]=qs[_0xbd23('0x36')](_[_0xbd23('0x40')](_0x508041[_0xbd23('0x34')],_0x4ea693[_0xbd23('0x36')]));if(_0x508041['query'][_0xbd23('0x41')]){_0xd64ef3[_0xbd23('0x3f')]=_[_0xbd23('0x42')](_0xd64ef3[_0xbd23('0x3f')],{'$or':_['map'](_0xd64ef3[_0xbd23('0x38')],function(_0x3832fb){var _0x2c00ed={};_0x2c00ed[_0x3832fb]={'$like':'%'+_0x508041['query'][_0xbd23('0x41')]+'%'};return _0x2c00ed;})});}_0xd64ef3=_[_0xbd23('0x42')]({},_0xd64ef3,_0x508041[_0xbd23('0x45')]);return _0x3ba615[_0xbd23('0x87')](_0xd64ef3);}})[_0xbd23('0x28')](function(_0x8eb89b){if(_0x8eb89b){_0xf1dc45=_0x8eb89b[_0xbd23('0x3a')];if(!_0x508041[_0xbd23('0x34')][_0xbd23('0x3b')](_0xbd23('0x3c'))){_0xd64ef3[_0xbd23('0x1d')]=qs[_0xbd23('0x1d')](_0x508041[_0xbd23('0x34')][_0xbd23('0x1d')]);_0xd64ef3[_0xbd23('0x1c')]=qs['offset'](_0x508041['query'][_0xbd23('0x1c')]);}return _0x3ba615[_0xbd23('0x87')](_0xd64ef3);}})[_0xbd23('0x28')](function(_0x153526){if(_0x153526){return _0x153526?{'count':_0xf1dc45,'rows':_0x153526}:null;}})['then'](respondWithResult(_0x1fdf84,null))[_0xbd23('0x4a')](handleError(_0x1fdf84,null));};exports[_0xbd23('0x88')]=function(_0x1ab96,_0x443bb7,_0x539d03){var _0x4ff97c,_0x19f2eb;return db[_0xbd23('0x4d')]['find']({'where':{'id':_0x1ab96[_0xbd23('0x4c')]['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0x443bb7,null))[_0xbd23('0x28')](function(_0xbbb255){if(_0xbbb255){_0x19f2eb=_0xbbb255;return _0xbbb255['addBlackLists'](_0x1ab96['body'][_0xbd23('0x69')],_[_0xbd23('0x57')](_0x1ab96[_0xbd23('0x5a')],[_0xbd23('0x69'),'id'])||{});}return null;})[_0xbd23('0x6a')](function(_0x45b858){var _0x2bd588;_0x4ff97c=_0x45b858||[];var _0x5a9513=[];if(_0x45b858){for(var _0x3cab20=0x0;_0x3cab20<_0x45b858[_0xbd23('0x3a')];_0x3cab20+=0x1){var _0x243ff2=_0x45b858[_0x3cab20][_0xbd23('0x26')]({'plain':!![]});_0x2bd588=squel[_0xbd23('0x83')]()[_0xbd23('0x6d')](_0xbd23('0x89'))[_0xbd23('0x6f')]([_0xbd23('0x74'),_0xbd23('0x75'),_0xbd23('0x71'),_0xbd23('0x5f'),'createdAt',_0xbd23('0x59')],squel[_0xbd23('0x72')]()[_0xbd23('0x73')]('phone',_0xbd23('0x74'))[_0xbd23('0x73')]('id',_0xbd23('0x75'))[_0xbd23('0x73')](_0x243ff2['CmListId'][_0xbd23('0x77')](),_0xbd23('0x71'))['field'](_0x1ab96[_0xbd23('0x4c')]['id'][_0xbd23('0x77')](),_0xbd23('0x5f'))[_0xbd23('0x73')]('NOW()','createdAt')[_0xbd23('0x73')]('NOW()',_0xbd23('0x59'))[_0xbd23('0x81')](_0xbd23('0x79'))['where'](_0xbd23('0x7a'))['where']('ListId\x20=\x20?',_0x243ff2['CmListId']['toString']())['where'](_0xbd23('0x7c')))['toString']();_0x5a9513[_0xbd23('0x84')](db[_0xbd23('0x85')]['query'](_0x2bd588));}return BPromise[_0xbd23('0x8a')](_0x5a9513);}})[_0xbd23('0x28')](function(){return _0x4ff97c;})[_0xbd23('0x28')](respondWithResult(_0x443bb7,null))[_0xbd23('0x4a')](handleError(_0x443bb7,null));};exports['removeBlackLists']=function(_0x5e8c6e,_0x13dce9,_0xf7357b){return db[_0xbd23('0x4d')]['find']({'where':{'id':_0x5e8c6e['params']['id']}})[_0xbd23('0x28')](handleEntityNotFound(_0x13dce9,null))['then'](function(_0x20c335){if(_0x20c335){return _0x20c335[_0xbd23('0x8b')](_0x5e8c6e[_0xbd23('0x34')][_0xbd23('0x69')]);}})['then'](function(_0x549cbb){if(_0x549cbb){return db['CmHopperBlack'][_0xbd23('0x25')]({'where':{'ListId':_0x5e8c6e[_0xbd23('0x34')][_0xbd23('0x69')],'CampaignId':_0x5e8c6e['params']['id']}})[_0xbd23('0x28')](function(){return _0x549cbb;});}})['then'](respondWithStatusCode(_0x13dce9,null))[_0xbd23('0x4a')](handleError(_0x13dce9,null));};
\ No newline at end of file
+var _0xd3a4=['CmHopper','hasOwnProperty','nolimit','order','pick','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','ListId','select','field','phone','NOW()','scheduledAt','ContactId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','CmHopperBlack','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','name','index','map','Campaign','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','sort','where','filter','merge','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','role','autoAssociation','getHoppers','findOne'];(function(_0x11bb4f,_0x5cfac0){var _0x42edf6=function(_0x28f5d7){while(--_0x28f5d7){_0x11bb4f['push'](_0x11bb4f['shift']());}};_0x42edf6(++_0x5cfac0);}(_0xd3a4,0xbe));var _0x4d3a=function(_0x44bb1d,_0x130b30){_0x44bb1d=_0x44bb1d-0x0;var _0x380ed5=_0xd3a4[_0x44bb1d];return _0x380ed5;};'use strict';var emlformat=require(_0x4d3a('0x0'));var rimraf=require(_0x4d3a('0x1'));var zipdir=require(_0x4d3a('0x2'));var jsonpatch=require(_0x4d3a('0x3'));var rp=require(_0x4d3a('0x4'));var moment=require(_0x4d3a('0x5'));var BPromise=require(_0x4d3a('0x6'));var Mustache=require(_0x4d3a('0x7'));var util=require(_0x4d3a('0x8'));var path=require('path');var sox=require(_0x4d3a('0x9'));var csv=require('to-csv');var ejs=require(_0x4d3a('0xa'));var fs=require('fs');var fs_extra=require(_0x4d3a('0xb'));var _=require(_0x4d3a('0xc'));var squel=require(_0x4d3a('0xd'));var crypto=require(_0x4d3a('0xe'));var jsforce=require(_0x4d3a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4d3a('0x10'));var querystring=require(_0x4d3a('0x11'));var Papa=require('papaparse');var Redis=require(_0x4d3a('0x12'));var authService=require(_0x4d3a('0x13'));var qs=require(_0x4d3a('0x14'));var as=require(_0x4d3a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d3a('0x16'))('api');var utils=require(_0x4d3a('0x17'));var config=require(_0x4d3a('0x18'));var licenseUtil=require(_0x4d3a('0x19'));var db=require(_0x4d3a('0x1a'))['db'];function respondWithStatusCode(_0xc69494,_0x1c8d98){_0x1c8d98=_0x1c8d98||0xcc;return function(_0x246cd0){if(_0x246cd0){return _0xc69494[_0x4d3a('0x1b')](_0x1c8d98);}return _0xc69494['status'](_0x1c8d98)[_0x4d3a('0x1c')]();};}function respondWithResult(_0x3684e6,_0x5189f4){_0x5189f4=_0x5189f4||0xc8;return function(_0x227e25){if(_0x227e25){return _0x3684e6[_0x4d3a('0x1d')](_0x5189f4)[_0x4d3a('0x1e')](_0x227e25);}};}function respondWithFilteredResult(_0x85dc90,_0x218ba7){return function(_0x5b8bd1){if(_0x5b8bd1){var _0x41aea4=typeof _0x218ba7[_0x4d3a('0x1f')]===_0x4d3a('0x20')&&typeof _0x218ba7[_0x4d3a('0x21')]===_0x4d3a('0x20');var _0x4cd807=_0x5b8bd1[_0x4d3a('0x22')];var _0x42942d=_0x41aea4?0x0:_0x218ba7['offset'];var _0x1040f6=_0x41aea4?_0x5b8bd1['count']:_0x218ba7['offset']+_0x218ba7[_0x4d3a('0x21')];var _0x185cac;if(_0x1040f6>=_0x4cd807){_0x1040f6=_0x4cd807;_0x185cac=0xc8;}else{_0x185cac=0xce;}_0x85dc90[_0x4d3a('0x1d')](_0x185cac);return _0x85dc90[_0x4d3a('0x23')](_0x4d3a('0x24'),_0x42942d+'-'+_0x1040f6+'/'+_0x4cd807)[_0x4d3a('0x1e')](_0x5b8bd1);}return null;};}function patchUpdates(_0x1f63eb){return function(_0x33aade){try{jsonpatch[_0x4d3a('0x25')](_0x33aade,_0x1f63eb,!![]);}catch(_0x16ce8d){return BPromise['reject'](_0x16ce8d);}return _0x33aade[_0x4d3a('0x26')]();};}function saveUpdates(_0x3ec2cd,_0x2174f4){return function(_0x3c03f9){if(_0x3c03f9){return _0x3c03f9[_0x4d3a('0x27')](_0x3ec2cd)['then'](function(_0x5443b9){return _0x5443b9;});}return null;};}function removeEntity(_0x544cc8,_0x2a5a23){return function(_0x112460){if(_0x112460){return _0x112460[_0x4d3a('0x28')]()[_0x4d3a('0x29')](function(){var _0x39c650=_0x112460[_0x4d3a('0x2a')]({'plain':!![]});var _0x1f6e49=_0x4d3a('0x2b');return db[_0x4d3a('0x2c')][_0x4d3a('0x28')]({'where':{'type':_0x1f6e49,'resourceId':_0x39c650['id']}})[_0x4d3a('0x29')](function(){return _0x112460;});})[_0x4d3a('0x29')](function(){_0x544cc8['status'](0xcc)[_0x4d3a('0x1c')]();});}};}function handleEntityNotFound(_0x323504,_0x44a987){return function(_0x1b3c53){if(!_0x1b3c53){_0x323504[_0x4d3a('0x1b')](0x194);}return _0x1b3c53;};}function handleError(_0x2953ce,_0x38d785){_0x38d785=_0x38d785||0x1f4;return function(_0x569ac9){logger[_0x4d3a('0x2d')](_0x569ac9['stack']);if(_0x569ac9[_0x4d3a('0x2e')]){delete _0x569ac9[_0x4d3a('0x2e')];}_0x2953ce[_0x4d3a('0x1d')](_0x38d785)['send'](_0x569ac9);};}exports[_0x4d3a('0x2f')]=function(_0x4f0ca7,_0x293dcd){var _0x463705={},_0x14e872={},_0x4793b8={'count':0x0,'rows':[]};var _0x3eaa2a=_[_0x4d3a('0x30')](db[_0x4d3a('0x31')]['rawAttributes'],function(_0x5682a1){return{'name':_0x5682a1[_0x4d3a('0x32')],'type':_0x5682a1[_0x4d3a('0x33')][_0x4d3a('0x34')]};});_0x14e872['model']=_['map'](_0x3eaa2a,_0x4d3a('0x2e'));_0x14e872[_0x4d3a('0x35')]=_[_0x4d3a('0x36')](_0x4f0ca7[_0x4d3a('0x35')]);_0x14e872[_0x4d3a('0x37')]=_[_0x4d3a('0x38')](_0x14e872['model'],_0x14e872[_0x4d3a('0x35')]);_0x463705[_0x4d3a('0x39')]=_[_0x4d3a('0x38')](_0x14e872[_0x4d3a('0x3a')],qs['fields'](_0x4f0ca7[_0x4d3a('0x35')][_0x4d3a('0x3b')]));_0x463705[_0x4d3a('0x39')]=_0x463705[_0x4d3a('0x39')][_0x4d3a('0x3c')]?_0x463705['attributes']:_0x14e872[_0x4d3a('0x3a')];if(!_0x4f0ca7[_0x4d3a('0x35')]['hasOwnProperty']('nolimit')){_0x463705[_0x4d3a('0x21')]=qs[_0x4d3a('0x21')](_0x4f0ca7[_0x4d3a('0x35')][_0x4d3a('0x21')]);_0x463705[_0x4d3a('0x1f')]=qs['offset'](_0x4f0ca7[_0x4d3a('0x35')][_0x4d3a('0x1f')]);}_0x463705['order']=qs[_0x4d3a('0x3d')](_0x4f0ca7['query'][_0x4d3a('0x3d')]);_0x463705[_0x4d3a('0x3e')]=qs[_0x4d3a('0x37')](_['pick'](_0x4f0ca7['query'],_0x14e872[_0x4d3a('0x37')]),_0x3eaa2a);if(_0x4f0ca7['query'][_0x4d3a('0x3f')]){_0x463705[_0x4d3a('0x3e')]=_[_0x4d3a('0x40')](_0x463705['where'],{'$or':_[_0x4d3a('0x30')](_0x3eaa2a,function(_0x45278c){if(_0x45278c[_0x4d3a('0x33')]!=='VIRTUAL'){var _0x1ed4ca={};_0x1ed4ca[_0x45278c[_0x4d3a('0x2e')]]={'$like':'%'+_0x4f0ca7[_0x4d3a('0x35')]['filter']+'%'};return _0x1ed4ca;}})});}_0x463705=_[_0x4d3a('0x40')]({},_0x463705,_0x4f0ca7[_0x4d3a('0x41')]);var _0x5393f3={'where':_0x463705[_0x4d3a('0x3e')]};return db[_0x4d3a('0x31')][_0x4d3a('0x22')](_0x5393f3)[_0x4d3a('0x29')](function(_0x4c9b89){_0x4793b8[_0x4d3a('0x22')]=_0x4c9b89;if(_0x4f0ca7[_0x4d3a('0x35')]['includeAll']){_0x463705['include']=[{'all':!![]}];}return db[_0x4d3a('0x31')][_0x4d3a('0x42')](_0x463705);})[_0x4d3a('0x29')](function(_0x3cdb5c){_0x4793b8[_0x4d3a('0x43')]=_0x3cdb5c;return _0x4793b8;})[_0x4d3a('0x29')](respondWithFilteredResult(_0x293dcd,_0x463705))[_0x4d3a('0x44')](handleError(_0x293dcd,null));};exports[_0x4d3a('0x45')]=function(_0x12358d,_0x650040){var _0x20fd61={'raw':![],'where':{'id':_0x12358d[_0x4d3a('0x46')]['id']}},_0x5218cf={};_0x5218cf[_0x4d3a('0x3a')]=_[_0x4d3a('0x36')](db[_0x4d3a('0x31')][_0x4d3a('0x47')]);_0x5218cf[_0x4d3a('0x35')]=_[_0x4d3a('0x36')](_0x12358d[_0x4d3a('0x35')]);_0x5218cf[_0x4d3a('0x37')]=_[_0x4d3a('0x38')](_0x5218cf[_0x4d3a('0x3a')],_0x5218cf[_0x4d3a('0x35')]);_0x20fd61[_0x4d3a('0x39')]=_[_0x4d3a('0x38')](_0x5218cf[_0x4d3a('0x3a')],qs[_0x4d3a('0x3b')](_0x12358d[_0x4d3a('0x35')][_0x4d3a('0x3b')]));_0x20fd61[_0x4d3a('0x39')]=_0x20fd61[_0x4d3a('0x39')][_0x4d3a('0x3c')]?_0x20fd61['attributes']:_0x5218cf['model'];if(_0x12358d[_0x4d3a('0x35')][_0x4d3a('0x48')]){_0x20fd61[_0x4d3a('0x49')]=[{'all':!![]}];}_0x20fd61=_['merge']({},_0x20fd61,_0x12358d[_0x4d3a('0x41')]);return db['Campaign'][_0x4d3a('0x4a')](_0x20fd61)[_0x4d3a('0x29')](handleEntityNotFound(_0x650040,null))[_0x4d3a('0x29')](respondWithResult(_0x650040,null))[_0x4d3a('0x44')](handleError(_0x650040,null));};exports[_0x4d3a('0x4b')]=function(_0x56be2e,_0x4de5e2){return db[_0x4d3a('0x31')]['create'](_0x56be2e[_0x4d3a('0x4c')],{})[_0x4d3a('0x29')](function(_0x15470e){var _0x1c97cf=_0x56be2e[_0x4d3a('0x4d')]['get']({'plain':!![]});if(!_0x1c97cf)throw new Error(_0x4d3a('0x4e'));if(_0x1c97cf['role']===_0x4d3a('0x4d')){var _0x43f1c3=_0x15470e[_0x4d3a('0x2a')]({'plain':!![]});var _0x7121c6='IvrCampaigns';return db[_0x4d3a('0x4f')]['find']({'where':{'name':_0x7121c6,'userProfileId':_0x1c97cf[_0x4d3a('0x50')]},'raw':!![]})[_0x4d3a('0x29')](function(_0x1578e5){if(_0x1578e5&&_0x1578e5['autoAssociation']===0x0){return db[_0x4d3a('0x2c')][_0x4d3a('0x4b')]({'name':_0x43f1c3[_0x4d3a('0x2e')],'resourceId':_0x43f1c3['id'],'type':_0x1578e5[_0x4d3a('0x2e')],'sectionId':_0x1578e5['id']},{})['then'](function(){return _0x15470e;});}else{return _0x15470e;}})[_0x4d3a('0x44')](function(_0x40a798){logger[_0x4d3a('0x2d')](_0x4d3a('0x51'),_0x40a798);throw _0x40a798;});}return _0x15470e;})['then'](respondWithResult(_0x4de5e2,0xc9))[_0x4d3a('0x44')](handleError(_0x4de5e2,null));};exports[_0x4d3a('0x52')]=function(_0x49ce2b,_0x440144){var _0x512f4f={'where':{'id':_0x49ce2b[_0x4d3a('0x46')]['id']}},_0x336382={};_0x336382['model']=_[_0x4d3a('0x36')](db['Campaign'][_0x4d3a('0x47')]);_0x512f4f[_0x4d3a('0x39')]=_[_0x4d3a('0x38')](_0x336382[_0x4d3a('0x3a')],qs[_0x4d3a('0x3b')](_0x49ce2b[_0x4d3a('0x35')][_0x4d3a('0x3b')]));_0x512f4f[_0x4d3a('0x39')]=_0x512f4f[_0x4d3a('0x39')][_0x4d3a('0x3c')]?_0x512f4f[_0x4d3a('0x39')]:_0x336382[_0x4d3a('0x3a')];if(_0x49ce2b[_0x4d3a('0x35')][_0x4d3a('0x48')]){_0x512f4f[_0x4d3a('0x49')]=[{'all':!![]}];}_0x512f4f=_[_0x4d3a('0x40')]({},_0x512f4f,_0x49ce2b['options']);return db[_0x4d3a('0x31')][_0x4d3a('0x4a')](_0x512f4f)['then'](handleEntityNotFound(_0x440144,null))[_0x4d3a('0x29')](function(_0x426526){if(_0x426526){var _0x4e1949=_0x426526['get']({'plain':!![]});_0x4e1949=qs[_0x4d3a('0x53')](_0x4e1949,['id','createdAt',_0x4d3a('0x54')]);_0x49ce2b[_0x4d3a('0x4c')]=_['omit'](_0x49ce2b['body'],['id',_0x4d3a('0x55'),_0x4d3a('0x54')]);return db['Campaign'][_0x4d3a('0x4b')](_[_0x4d3a('0x40')](_0x4e1949,_0x49ce2b[_0x4d3a('0x4c')]),{'include':_0x49ce2b[_0x4d3a('0x35')][_0x4d3a('0x48')]?[{'all':!![]}]:undefined})[_0x4d3a('0x29')](function(_0x560a6a){var _0x52b211=_0x49ce2b['user'][_0x4d3a('0x2a')]({'plain':!![]});if(!_0x52b211)throw new Error(_0x4d3a('0x4e'));if(_0x52b211[_0x4d3a('0x56')]===_0x4d3a('0x4d')){var _0x4f9cd2=_0x560a6a[_0x4d3a('0x2a')]({'plain':!![]});var _0x2589c2=_0x4d3a('0x2b');return db[_0x4d3a('0x4f')][_0x4d3a('0x4a')]({'where':{'name':_0x2589c2,'userProfileId':_0x52b211[_0x4d3a('0x50')]},'raw':!![]})[_0x4d3a('0x29')](function(_0x19c9ff){if(_0x19c9ff&&_0x19c9ff[_0x4d3a('0x57')]===0x0){return db[_0x4d3a('0x2c')][_0x4d3a('0x4b')]({'name':_0x4f9cd2['name'],'resourceId':_0x4f9cd2['id'],'type':_0x19c9ff['name'],'sectionId':_0x19c9ff['id']},{})[_0x4d3a('0x29')](function(){return _0x560a6a;});}else{return _0x560a6a;}})[_0x4d3a('0x44')](function(_0x114cc2){logger[_0x4d3a('0x2d')](_0x4d3a('0x51'),_0x114cc2);throw _0x114cc2;});}return _0x560a6a;});}})['then'](respondWithResult(_0x440144,0xc9))[_0x4d3a('0x44')](handleError(_0x440144,null));};exports[_0x4d3a('0x27')]=function(_0xfb0815,_0x2a1d6f){if(_0xfb0815[_0x4d3a('0x4c')]['id']){delete _0xfb0815[_0x4d3a('0x4c')]['id'];}return db[_0x4d3a('0x31')][_0x4d3a('0x4a')]({'where':{'id':_0xfb0815[_0x4d3a('0x46')]['id']}})[_0x4d3a('0x29')](handleEntityNotFound(_0x2a1d6f,null))[_0x4d3a('0x29')](saveUpdates(_0xfb0815[_0x4d3a('0x4c')],null))[_0x4d3a('0x29')](respondWithResult(_0x2a1d6f,null))[_0x4d3a('0x44')](handleError(_0x2a1d6f,null));};exports[_0x4d3a('0x28')]=function(_0x1a9ea0,_0x11d9ca){return db[_0x4d3a('0x31')]['find']({'where':{'id':_0x1a9ea0[_0x4d3a('0x46')]['id']}})['then'](handleEntityNotFound(_0x11d9ca,null))[_0x4d3a('0x29')](removeEntity(_0x11d9ca,null))[_0x4d3a('0x44')](handleError(_0x11d9ca,null));};exports[_0x4d3a('0x58')]=function(_0x522dd5,_0x325918,_0xa71c3d){var _0x488beb={'raw':!![],'where':{}};var _0x3565dc={};var _0x31c0f1={'count':0x0,'rows':[]};return db[_0x4d3a('0x31')][_0x4d3a('0x59')]({'where':{'id':_0x522dd5[_0x4d3a('0x46')]['id']}})[_0x4d3a('0x29')](handleEntityNotFound(_0x325918,null))['then'](function(_0x43da69){if(_0x43da69){_0x3565dc['model']=_[_0x4d3a('0x36')](db[_0x4d3a('0x5a')]['rawAttributes']);_0x3565dc[_0x4d3a('0x35')]=_['keys'](_0x522dd5[_0x4d3a('0x35')]);_0x3565dc[_0x4d3a('0x37')]=_[_0x4d3a('0x38')](_0x3565dc[_0x4d3a('0x3a')],_0x3565dc[_0x4d3a('0x35')]);_0x488beb['attributes']=_[_0x4d3a('0x38')](_0x3565dc[_0x4d3a('0x3a')],qs[_0x4d3a('0x3b')](_0x522dd5['query']['fields']));_0x488beb['attributes']=_0x488beb[_0x4d3a('0x39')]['length']?_0x488beb[_0x4d3a('0x39')]:_0x3565dc['model'];if(!_0x522dd5[_0x4d3a('0x35')][_0x4d3a('0x5b')](_0x4d3a('0x5c'))){_0x488beb[_0x4d3a('0x21')]=qs[_0x4d3a('0x21')](_0x522dd5[_0x4d3a('0x35')]['limit']);_0x488beb[_0x4d3a('0x1f')]=qs[_0x4d3a('0x1f')](_0x522dd5[_0x4d3a('0x35')]['offset']);}_0x488beb[_0x4d3a('0x5d')]=qs[_0x4d3a('0x3d')](_0x522dd5[_0x4d3a('0x35')][_0x4d3a('0x3d')]);_0x488beb[_0x4d3a('0x3e')]=qs[_0x4d3a('0x37')](_[_0x4d3a('0x5e')](_0x522dd5['query'],_0x3565dc[_0x4d3a('0x37')]));_0x488beb['where'][_0x4d3a('0x5f')]=_0x43da69['id'];if(_0x522dd5[_0x4d3a('0x35')][_0x4d3a('0x3f')]){_0x488beb[_0x4d3a('0x3e')]=_[_0x4d3a('0x40')](_0x488beb['where'],{'$or':_[_0x4d3a('0x30')](_0x488beb['attributes'],function(_0x24cff8){var _0x984780={};_0x984780[_0x24cff8]={'$like':'%'+_0x522dd5[_0x4d3a('0x35')]['filter']+'%'};return _0x984780;})});}_0x488beb=_[_0x4d3a('0x40')]({},_0x488beb,_0x522dd5[_0x4d3a('0x41')]);return db[_0x4d3a('0x5a')][_0x4d3a('0x22')]({'where':_0x488beb['where']})[_0x4d3a('0x29')](function(_0x3a90d9){_0x31c0f1[_0x4d3a('0x22')]=_0x3a90d9;if(_0x522dd5[_0x4d3a('0x35')][_0x4d3a('0x48')]){_0x488beb[_0x4d3a('0x49')]=[{'all':!![]}];}return db[_0x4d3a('0x5a')][_0x4d3a('0x42')](_0x488beb);})['then'](function(_0x19ddcc){_0x31c0f1[_0x4d3a('0x43')]=_0x19ddcc;return _0x31c0f1;});}})[_0x4d3a('0x29')](respondWithFilteredResult(_0x325918,_0x488beb))['catch'](handleError(_0x325918,null));};exports[_0x4d3a('0x60')]=function(_0x4b69dc,_0x6337e7,_0x3497d1){var _0x1023a9={'raw':!![],'where':{}};var _0xbfc8c1={};var _0x2ba033={'count':0x0,'rows':[]};return db['Campaign'][_0x4d3a('0x59')]({'where':{'id':_0x4b69dc[_0x4d3a('0x46')]['id']}})[_0x4d3a('0x29')](handleEntityNotFound(_0x6337e7,null))['then'](function(_0x31b1b9){if(_0x31b1b9){_0xbfc8c1['model']=_[_0x4d3a('0x36')](db[_0x4d3a('0x61')][_0x4d3a('0x47')]);_0xbfc8c1['query']=_[_0x4d3a('0x36')](_0x4b69dc[_0x4d3a('0x35')]);_0xbfc8c1[_0x4d3a('0x37')]=_[_0x4d3a('0x38')](_0xbfc8c1['model'],_0xbfc8c1['query']);_0x1023a9[_0x4d3a('0x39')]=_[_0x4d3a('0x38')](_0xbfc8c1[_0x4d3a('0x3a')],qs[_0x4d3a('0x3b')](_0x4b69dc[_0x4d3a('0x35')]['fields']));_0x1023a9[_0x4d3a('0x39')]=_0x1023a9[_0x4d3a('0x39')][_0x4d3a('0x3c')]?_0x1023a9[_0x4d3a('0x39')]:_0xbfc8c1['model'];if(!_0x4b69dc[_0x4d3a('0x35')]['hasOwnProperty'](_0x4d3a('0x5c'))){_0x1023a9[_0x4d3a('0x21')]=qs[_0x4d3a('0x21')](_0x4b69dc[_0x4d3a('0x35')][_0x4d3a('0x21')]);_0x1023a9[_0x4d3a('0x1f')]=qs['offset'](_0x4b69dc['query'][_0x4d3a('0x1f')]);}_0x1023a9['order']=qs['sort'](_0x4b69dc[_0x4d3a('0x35')][_0x4d3a('0x3d')]);_0x1023a9[_0x4d3a('0x3e')]=qs[_0x4d3a('0x37')](_[_0x4d3a('0x5e')](_0x4b69dc[_0x4d3a('0x35')],_0xbfc8c1[_0x4d3a('0x37')]));_0x1023a9[_0x4d3a('0x3e')][_0x4d3a('0x5f')]=_0x31b1b9['id'];if(_0x4b69dc[_0x4d3a('0x35')][_0x4d3a('0x3f')]){_0x1023a9[_0x4d3a('0x3e')]=_[_0x4d3a('0x40')](_0x1023a9[_0x4d3a('0x3e')],{'$or':_[_0x4d3a('0x30')](_0x1023a9[_0x4d3a('0x39')],function(_0x1b677b){var _0x24e7c4={};_0x24e7c4[_0x1b677b]={'$like':'%'+_0x4b69dc[_0x4d3a('0x35')]['filter']+'%'};return _0x24e7c4;})});}_0x1023a9=_[_0x4d3a('0x40')]({},_0x1023a9,_0x4b69dc[_0x4d3a('0x41')]);return db[_0x4d3a('0x61')]['count']({'where':_0x1023a9[_0x4d3a('0x3e')]})[_0x4d3a('0x29')](function(_0xd9ab1f){_0x2ba033['count']=_0xd9ab1f;if(_0x4b69dc['query'][_0x4d3a('0x48')]){_0x1023a9[_0x4d3a('0x49')]=[{'all':!![]}];}return db[_0x4d3a('0x61')][_0x4d3a('0x42')](_0x1023a9);})['then'](function(_0x1be373){_0x2ba033[_0x4d3a('0x43')]=_0x1be373;return _0x2ba033;});}})[_0x4d3a('0x29')](respondWithFilteredResult(_0x6337e7,_0x1023a9))[_0x4d3a('0x44')](handleError(_0x6337e7,null));};exports['getHopperFinals']=function(_0x505aec,_0x36b5d4,_0x2d73b6){var _0x19ed9e={'raw':!![],'where':{}};var _0x343033={};var _0xab7a5f={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x505aec[_0x4d3a('0x46')]['id']}})['then'](handleEntityNotFound(_0x36b5d4,null))[_0x4d3a('0x29')](function(_0xc60be8){if(_0xc60be8){_0x343033[_0x4d3a('0x3a')]=_[_0x4d3a('0x36')](db['CmHopperFinal']['rawAttributes']);_0x343033[_0x4d3a('0x35')]=_[_0x4d3a('0x36')](_0x505aec[_0x4d3a('0x35')]);_0x343033[_0x4d3a('0x37')]=_['intersection'](_0x343033[_0x4d3a('0x3a')],_0x343033['query']);_0x19ed9e[_0x4d3a('0x39')]=_[_0x4d3a('0x38')](_0x343033['model'],qs[_0x4d3a('0x3b')](_0x505aec[_0x4d3a('0x35')][_0x4d3a('0x3b')]));_0x19ed9e[_0x4d3a('0x39')]=_0x19ed9e[_0x4d3a('0x39')]['length']?_0x19ed9e[_0x4d3a('0x39')]:_0x343033[_0x4d3a('0x3a')];if(!_0x505aec['query'][_0x4d3a('0x5b')](_0x4d3a('0x5c'))){_0x19ed9e[_0x4d3a('0x21')]=qs[_0x4d3a('0x21')](_0x505aec[_0x4d3a('0x35')]['limit']);_0x19ed9e[_0x4d3a('0x1f')]=qs[_0x4d3a('0x1f')](_0x505aec[_0x4d3a('0x35')][_0x4d3a('0x1f')]);}_0x19ed9e['order']=qs['sort'](_0x505aec[_0x4d3a('0x35')][_0x4d3a('0x3d')]);_0x19ed9e[_0x4d3a('0x3e')]=qs[_0x4d3a('0x37')](_[_0x4d3a('0x5e')](_0x505aec['query'],_0x343033[_0x4d3a('0x37')]));_0x19ed9e['where'][_0x4d3a('0x5f')]=_0xc60be8['id'];if(_0x505aec[_0x4d3a('0x35')][_0x4d3a('0x3f')]){_0x19ed9e['where']=_[_0x4d3a('0x40')](_0x19ed9e[_0x4d3a('0x3e')],{'$or':_['map'](_0x19ed9e[_0x4d3a('0x39')],function(_0x3d28d5){var _0x3a164f={};_0x3a164f[_0x3d28d5]={'$like':'%'+_0x505aec[_0x4d3a('0x35')][_0x4d3a('0x3f')]+'%'};return _0x3a164f;})});}_0x19ed9e=_[_0x4d3a('0x40')]({},_0x19ed9e,_0x505aec[_0x4d3a('0x41')]);return db[_0x4d3a('0x62')][_0x4d3a('0x22')]({'where':_0x19ed9e[_0x4d3a('0x3e')]})['then'](function(_0x37e978){_0xab7a5f[_0x4d3a('0x22')]=_0x37e978;if(_0x505aec['query'][_0x4d3a('0x48')]){_0x19ed9e[_0x4d3a('0x49')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x4d3a('0x42')](_0x19ed9e);})[_0x4d3a('0x29')](function(_0x258438){_0xab7a5f[_0x4d3a('0x43')]=_0x258438;return _0xab7a5f;});}})[_0x4d3a('0x29')](respondWithFilteredResult(_0x36b5d4,_0x19ed9e))[_0x4d3a('0x44')](handleError(_0x36b5d4,null));};exports[_0x4d3a('0x63')]=function(_0x4e1038,_0x15d2bc,_0x52600a){var _0x37f11c={'raw':!![],'where':{}};var _0x1df3be={};var _0xc67fa8={'count':0x0,'rows':[]};return db['Campaign'][_0x4d3a('0x59')]({'where':{'id':_0x4e1038[_0x4d3a('0x46')]['id']}})[_0x4d3a('0x29')](handleEntityNotFound(_0x15d2bc,null))['then'](function(_0x12fb78){if(_0x12fb78){_0x1df3be[_0x4d3a('0x3a')]=_[_0x4d3a('0x36')](db['CmHopperBlack'][_0x4d3a('0x47')]);_0x1df3be[_0x4d3a('0x35')]=_['keys'](_0x4e1038['query']);_0x1df3be['filters']=_[_0x4d3a('0x38')](_0x1df3be[_0x4d3a('0x3a')],_0x1df3be[_0x4d3a('0x35')]);_0x37f11c[_0x4d3a('0x39')]=_[_0x4d3a('0x38')](_0x1df3be[_0x4d3a('0x3a')],qs[_0x4d3a('0x3b')](_0x4e1038[_0x4d3a('0x35')]['fields']));_0x37f11c[_0x4d3a('0x39')]=_0x37f11c[_0x4d3a('0x39')][_0x4d3a('0x3c')]?_0x37f11c[_0x4d3a('0x39')]:_0x1df3be[_0x4d3a('0x3a')];if(!_0x4e1038[_0x4d3a('0x35')][_0x4d3a('0x5b')](_0x4d3a('0x5c'))){_0x37f11c[_0x4d3a('0x21')]=qs[_0x4d3a('0x21')](_0x4e1038[_0x4d3a('0x35')][_0x4d3a('0x21')]);_0x37f11c[_0x4d3a('0x1f')]=qs[_0x4d3a('0x1f')](_0x4e1038[_0x4d3a('0x35')][_0x4d3a('0x1f')]);}_0x37f11c[_0x4d3a('0x5d')]=qs[_0x4d3a('0x3d')](_0x4e1038['query']['sort']);_0x37f11c['where']=qs['filters'](_[_0x4d3a('0x5e')](_0x4e1038[_0x4d3a('0x35')],_0x1df3be[_0x4d3a('0x37')]));_0x37f11c['where'][_0x4d3a('0x5f')]=_0x12fb78['id'];if(_0x4e1038[_0x4d3a('0x35')][_0x4d3a('0x3f')]){_0x37f11c[_0x4d3a('0x3e')]=_[_0x4d3a('0x40')](_0x37f11c[_0x4d3a('0x3e')],{'$or':_['map'](_0x37f11c[_0x4d3a('0x39')],function(_0x59d3e2){var _0x6108fd={};_0x6108fd[_0x59d3e2]={'$like':'%'+_0x4e1038[_0x4d3a('0x35')][_0x4d3a('0x3f')]+'%'};return _0x6108fd;})});}_0x37f11c=_[_0x4d3a('0x40')]({},_0x37f11c,_0x4e1038['options']);return db['CmHopperBlack'][_0x4d3a('0x22')]({'where':_0x37f11c[_0x4d3a('0x3e')]})[_0x4d3a('0x29')](function(_0x393615){_0xc67fa8[_0x4d3a('0x22')]=_0x393615;if(_0x4e1038[_0x4d3a('0x35')][_0x4d3a('0x48')]){_0x37f11c['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x4d3a('0x42')](_0x37f11c);})[_0x4d3a('0x29')](function(_0x2e97da){_0xc67fa8[_0x4d3a('0x43')]=_0x2e97da;return _0xc67fa8;});}})['then'](respondWithFilteredResult(_0x15d2bc,_0x37f11c))[_0x4d3a('0x44')](handleError(_0x15d2bc,null));};exports[_0x4d3a('0x64')]=function(_0x47247f,_0x189917,_0x2ed024){var _0x5e63b8={};var _0x4bd4a0={};var _0x359591;var _0x6f80f3;return db[_0x4d3a('0x31')][_0x4d3a('0x59')]({'where':{'id':_0x47247f['params']['id']}})[_0x4d3a('0x29')](handleEntityNotFound(_0x189917,null))[_0x4d3a('0x29')](function(_0x408335){if(_0x408335){_0x359591=_0x408335;_0x4bd4a0['model']=_[_0x4d3a('0x36')](db[_0x4d3a('0x65')][_0x4d3a('0x47')]);_0x4bd4a0['query']=_[_0x4d3a('0x36')](_0x47247f[_0x4d3a('0x35')]);_0x4bd4a0[_0x4d3a('0x37')]=_[_0x4d3a('0x38')](_0x4bd4a0[_0x4d3a('0x3a')],_0x4bd4a0[_0x4d3a('0x35')]);_0x5e63b8[_0x4d3a('0x39')]=_['intersection'](_0x4bd4a0[_0x4d3a('0x3a')],qs[_0x4d3a('0x3b')](_0x47247f[_0x4d3a('0x35')][_0x4d3a('0x3b')]));_0x5e63b8['attributes']=_0x5e63b8[_0x4d3a('0x39')][_0x4d3a('0x3c')]?_0x5e63b8[_0x4d3a('0x39')]:_0x4bd4a0[_0x4d3a('0x3a')];_0x5e63b8['order']=qs[_0x4d3a('0x3d')](_0x47247f['query'][_0x4d3a('0x3d')]);_0x5e63b8[_0x4d3a('0x3e')]=qs[_0x4d3a('0x37')](_['pick'](_0x47247f[_0x4d3a('0x35')],_0x4bd4a0[_0x4d3a('0x37')]));if(_0x47247f[_0x4d3a('0x35')][_0x4d3a('0x3f')]){_0x5e63b8['where']=_['merge'](_0x5e63b8[_0x4d3a('0x3e')],{'$or':_['map'](_0x5e63b8[_0x4d3a('0x39')],function(_0x4f6303){var _0x2dc7a2={};_0x2dc7a2[_0x4f6303]={'$like':'%'+_0x47247f[_0x4d3a('0x35')][_0x4d3a('0x3f')]+'%'};return _0x2dc7a2;})});}_0x5e63b8=_['merge']({},_0x5e63b8,_0x47247f[_0x4d3a('0x41')]);return _0x359591[_0x4d3a('0x64')](_0x5e63b8);}})[_0x4d3a('0x29')](function(_0x49f038){if(_0x49f038){_0x6f80f3=_0x49f038[_0x4d3a('0x3c')];if(!_0x47247f[_0x4d3a('0x35')]['hasOwnProperty'](_0x4d3a('0x5c'))){_0x5e63b8[_0x4d3a('0x21')]=qs[_0x4d3a('0x21')](_0x47247f[_0x4d3a('0x35')][_0x4d3a('0x21')]);_0x5e63b8[_0x4d3a('0x1f')]=qs['offset'](_0x47247f[_0x4d3a('0x35')][_0x4d3a('0x1f')]);}return _0x359591['getLists'](_0x5e63b8);}})['then'](function(_0x1ed0a1){if(_0x1ed0a1){return _0x1ed0a1?{'count':_0x6f80f3,'rows':_0x1ed0a1}:null;}})[_0x4d3a('0x29')](respondWithResult(_0x189917,null))[_0x4d3a('0x44')](handleError(_0x189917,null));};exports[_0x4d3a('0x66')]=function(_0x5741f0,_0x5e3f41,_0x3f5f69){var _0x3cb530,_0x1a8412;return db[_0x4d3a('0x31')][_0x4d3a('0x4a')]({'where':{'id':_0x5741f0[_0x4d3a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e3f41,null))[_0x4d3a('0x29')](function(_0x5bf5a5){if(_0x5bf5a5){_0x1a8412=_0x5bf5a5;return _0x5bf5a5[_0x4d3a('0x66')](_0x5741f0[_0x4d3a('0x4c')][_0x4d3a('0x67')],_[_0x4d3a('0x53')](_0x5741f0['body'],[_0x4d3a('0x67'),'id'])||{});}return null;})['spread'](function(_0x5be680){var _0x5e64c4;_0x3cb530=_0x5be680||[];var _0x1229d0=[];if(_0x5be680){for(var _0x4c78d2=0x0;_0x4c78d2<_0x5be680[_0x4d3a('0x3c')];_0x4c78d2+=0x1){var _0x3ceaf6=_0x5be680[_0x4c78d2]['get']({'plain':!![]});_0x1a8412[_0x4d3a('0x68')]=_0x5741f0[_0x4d3a('0x4c')][_0x4d3a('0x68')]?_0x5741f0['body']['dialCheckDuplicateType']:_0x1a8412[_0x4d3a('0x68')];switch(_0x1a8412['dialCheckDuplicateType']){case _0x4d3a('0x69'):_0x5e64c4=squel[_0x4d3a('0x6a')]()[_0x4d3a('0x6b')](_0x4d3a('0x6c'))['fromQuery'](['phone','scheduledAt','ContactId',_0x4d3a('0x6d'),'CampaignId',_0x4d3a('0x55'),_0x4d3a('0x54')],squel[_0x4d3a('0x6e')]()[_0x4d3a('0x6f')](_0x4d3a('0x70'),'phone')[_0x4d3a('0x6f')](_0x4d3a('0x71'),_0x4d3a('0x72'))[_0x4d3a('0x6f')]('id',_0x4d3a('0x73'))[_0x4d3a('0x6f')](_0x3ceaf6['CmListId'][_0x4d3a('0x74')](),_0x4d3a('0x6d'))[_0x4d3a('0x6f')](_0x5741f0[_0x4d3a('0x46')]['id'][_0x4d3a('0x74')](),_0x4d3a('0x5f'))['field'](_0x4d3a('0x71'),_0x4d3a('0x55'))[_0x4d3a('0x6f')](_0x4d3a('0x71'),_0x4d3a('0x54'))[_0x4d3a('0x75')](_0x4d3a('0x76'))[_0x4d3a('0x3e')](_0x4d3a('0x77'))[_0x4d3a('0x3e')](_0x4d3a('0x78'),_0x3ceaf6[_0x4d3a('0x79')][_0x4d3a('0x74')]())['where'](_0x4d3a('0x7a'))[_0x4d3a('0x3e')](_0x4d3a('0x7b'),squel[_0x4d3a('0x6e')]()[_0x4d3a('0x6f')](_0x4d3a('0x7c'))['from'](_0x4d3a('0x7d'))[_0x4d3a('0x3e')](_0x4d3a('0x7e'),_0x5741f0[_0x4d3a('0x46')]['id'][_0x4d3a('0x74')]()))[_0x4d3a('0x3e')](_0x4d3a('0x7b'),squel['select']()['field'](_0x4d3a('0x7f'))[_0x4d3a('0x75')]('cm_hopper')[_0x4d3a('0x3e')](_0x4d3a('0x7e'),_0x5741f0[_0x4d3a('0x46')]['id'][_0x4d3a('0x74')]())))[_0x4d3a('0x74')]();break;case _0x4d3a('0x80'):_0x5e64c4=squel[_0x4d3a('0x6a')]()[_0x4d3a('0x6b')](_0x4d3a('0x6c'))[_0x4d3a('0x81')]([_0x4d3a('0x70'),_0x4d3a('0x72'),_0x4d3a('0x73'),_0x4d3a('0x6d'),'CampaignId',_0x4d3a('0x55'),_0x4d3a('0x54')],squel['select']()[_0x4d3a('0x6f')](_0x4d3a('0x70'),_0x4d3a('0x70'))[_0x4d3a('0x6f')]('NOW()',_0x4d3a('0x72'))[_0x4d3a('0x6f')]('id','ContactId')[_0x4d3a('0x6f')](_0x3ceaf6[_0x4d3a('0x79')][_0x4d3a('0x74')](),_0x4d3a('0x6d'))['field'](_0x5741f0['params']['id'][_0x4d3a('0x74')](),_0x4d3a('0x5f'))[_0x4d3a('0x6f')](_0x4d3a('0x71'),_0x4d3a('0x55'))[_0x4d3a('0x6f')]('NOW()',_0x4d3a('0x54'))[_0x4d3a('0x75')]('cm_contacts')[_0x4d3a('0x3e')](_0x4d3a('0x77'))['where'](_0x4d3a('0x78'),_0x3ceaf6[_0x4d3a('0x79')][_0x4d3a('0x74')]())[_0x4d3a('0x3e')](_0x4d3a('0x7a'))[_0x4d3a('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4d3a('0x6e')]()[_0x4d3a('0x6f')](_0x4d3a('0x7f'))[_0x4d3a('0x75')](_0x4d3a('0x6c'))[_0x4d3a('0x3e')](_0x4d3a('0x7e'),_0x5741f0[_0x4d3a('0x46')]['id'][_0x4d3a('0x74')]())))[_0x4d3a('0x74')]();break;default:_0x5e64c4=squel['insert']()[_0x4d3a('0x6b')](_0x4d3a('0x6c'))[_0x4d3a('0x81')]([_0x4d3a('0x70'),_0x4d3a('0x72'),_0x4d3a('0x73'),_0x4d3a('0x6d'),'CampaignId','createdAt',_0x4d3a('0x54')],squel['select']()[_0x4d3a('0x6f')](_0x4d3a('0x70'),_0x4d3a('0x70'))[_0x4d3a('0x6f')](_0x4d3a('0x71'),_0x4d3a('0x72'))[_0x4d3a('0x6f')]('id',_0x4d3a('0x73'))[_0x4d3a('0x6f')](_0x3ceaf6[_0x4d3a('0x79')][_0x4d3a('0x74')](),'ListId')[_0x4d3a('0x6f')](_0x5741f0[_0x4d3a('0x46')]['id'][_0x4d3a('0x74')](),_0x4d3a('0x5f'))[_0x4d3a('0x6f')](_0x4d3a('0x71'),_0x4d3a('0x55'))[_0x4d3a('0x6f')](_0x4d3a('0x71'),_0x4d3a('0x54'))[_0x4d3a('0x75')](_0x4d3a('0x76'))[_0x4d3a('0x3e')](_0x4d3a('0x77'))[_0x4d3a('0x3e')](_0x4d3a('0x78'),_0x3ceaf6[_0x4d3a('0x79')]['toString']())[_0x4d3a('0x3e')](_0x4d3a('0x7a')))['toString']();}_0x1229d0[_0x4d3a('0x82')](db[_0x4d3a('0x83')][_0x4d3a('0x35')](_0x5e64c4));}return BPromise[_0x4d3a('0x84')](_0x1229d0);}})[_0x4d3a('0x29')](function(){return _0x3cb530;})[_0x4d3a('0x29')](respondWithResult(_0x5e3f41,null))[_0x4d3a('0x44')](handleError(_0x5e3f41,null));};exports[_0x4d3a('0x85')]=function(_0x411ad0,_0x48044f,_0x2e2a53){return db['Campaign'][_0x4d3a('0x4a')]({'where':{'id':_0x411ad0['params']['id']}})['then'](handleEntityNotFound(_0x48044f,null))[_0x4d3a('0x29')](function(_0x2e6e19){if(_0x2e6e19){return _0x2e6e19[_0x4d3a('0x85')](_0x411ad0[_0x4d3a('0x35')][_0x4d3a('0x67')]);}})[_0x4d3a('0x29')](function(_0x11f646){if(_0x11f646){return db[_0x4d3a('0x5a')][_0x4d3a('0x28')]({'where':{'ListId':_0x411ad0[_0x4d3a('0x35')][_0x4d3a('0x67')],'CampaignId':_0x411ad0['params']['id']}})[_0x4d3a('0x29')](function(){return _0x11f646;});}})[_0x4d3a('0x29')](respondWithStatusCode(_0x48044f,null))[_0x4d3a('0x44')](handleError(_0x48044f,null));};exports[_0x4d3a('0x86')]=function(_0x1cd1a6,_0x2d5ced,_0x2a0a3d){var _0x45e21c={};var _0x197975={};var _0x1c90b9;var _0x5dccf1;return db[_0x4d3a('0x31')][_0x4d3a('0x59')]({'where':{'id':_0x1cd1a6['params']['id']}})[_0x4d3a('0x29')](handleEntityNotFound(_0x2d5ced,null))[_0x4d3a('0x29')](function(_0x5280d1){if(_0x5280d1){_0x1c90b9=_0x5280d1;_0x197975[_0x4d3a('0x3a')]=_['keys'](db[_0x4d3a('0x65')][_0x4d3a('0x47')]);_0x197975[_0x4d3a('0x35')]=_[_0x4d3a('0x36')](_0x1cd1a6[_0x4d3a('0x35')]);_0x197975['filters']=_[_0x4d3a('0x38')](_0x197975[_0x4d3a('0x3a')],_0x197975[_0x4d3a('0x35')]);_0x45e21c['attributes']=_[_0x4d3a('0x38')](_0x197975[_0x4d3a('0x3a')],qs[_0x4d3a('0x3b')](_0x1cd1a6[_0x4d3a('0x35')]['fields']));_0x45e21c[_0x4d3a('0x39')]=_0x45e21c['attributes'][_0x4d3a('0x3c')]?_0x45e21c[_0x4d3a('0x39')]:_0x197975['model'];_0x45e21c[_0x4d3a('0x5d')]=qs['sort'](_0x1cd1a6[_0x4d3a('0x35')][_0x4d3a('0x3d')]);_0x45e21c[_0x4d3a('0x3e')]=qs[_0x4d3a('0x37')](_[_0x4d3a('0x5e')](_0x1cd1a6[_0x4d3a('0x35')],_0x197975['filters']));if(_0x1cd1a6[_0x4d3a('0x35')][_0x4d3a('0x3f')]){_0x45e21c[_0x4d3a('0x3e')]=_['merge'](_0x45e21c[_0x4d3a('0x3e')],{'$or':_[_0x4d3a('0x30')](_0x45e21c[_0x4d3a('0x39')],function(_0x57556c){var _0x43a2d9={};_0x43a2d9[_0x57556c]={'$like':'%'+_0x1cd1a6[_0x4d3a('0x35')]['filter']+'%'};return _0x43a2d9;})});}_0x45e21c=_['merge']({},_0x45e21c,_0x1cd1a6[_0x4d3a('0x41')]);return _0x1c90b9[_0x4d3a('0x86')](_0x45e21c);}})[_0x4d3a('0x29')](function(_0x208b75){if(_0x208b75){_0x5dccf1=_0x208b75['length'];if(!_0x1cd1a6[_0x4d3a('0x35')][_0x4d3a('0x5b')]('nolimit')){_0x45e21c[_0x4d3a('0x21')]=qs[_0x4d3a('0x21')](_0x1cd1a6[_0x4d3a('0x35')]['limit']);_0x45e21c[_0x4d3a('0x1f')]=qs[_0x4d3a('0x1f')](_0x1cd1a6[_0x4d3a('0x35')][_0x4d3a('0x1f')]);}return _0x1c90b9[_0x4d3a('0x86')](_0x45e21c);}})[_0x4d3a('0x29')](function(_0x17abe4){if(_0x17abe4){return _0x17abe4?{'count':_0x5dccf1,'rows':_0x17abe4}:null;}})[_0x4d3a('0x29')](respondWithResult(_0x2d5ced,null))[_0x4d3a('0x44')](handleError(_0x2d5ced,null));};exports[_0x4d3a('0x87')]=function(_0x2ce89d,_0x106b09,_0x1654ba){var _0x557b81,_0x457dd4;return db[_0x4d3a('0x31')][_0x4d3a('0x4a')]({'where':{'id':_0x2ce89d[_0x4d3a('0x46')]['id']}})[_0x4d3a('0x29')](handleEntityNotFound(_0x106b09,null))[_0x4d3a('0x29')](function(_0x2ee1ce){if(_0x2ee1ce){_0x457dd4=_0x2ee1ce;return _0x2ee1ce[_0x4d3a('0x87')](_0x2ce89d['body'][_0x4d3a('0x67')],_[_0x4d3a('0x53')](_0x2ce89d['body'],[_0x4d3a('0x67'),'id'])||{});}return null;})[_0x4d3a('0x88')](function(_0x282e01){var _0x16f789;_0x557b81=_0x282e01||[];var _0x4ee56d=[];if(_0x282e01){for(var _0x55ac1e=0x0;_0x55ac1e<_0x282e01['length'];_0x55ac1e+=0x1){var _0x46b4f6=_0x282e01[_0x55ac1e][_0x4d3a('0x2a')]({'plain':!![]});_0x16f789=squel[_0x4d3a('0x6a')]()['into'](_0x4d3a('0x89'))[_0x4d3a('0x81')]([_0x4d3a('0x70'),_0x4d3a('0x73'),'ListId',_0x4d3a('0x5f'),'createdAt',_0x4d3a('0x54')],squel[_0x4d3a('0x6e')]()[_0x4d3a('0x6f')](_0x4d3a('0x70'),'phone')[_0x4d3a('0x6f')]('id',_0x4d3a('0x73'))[_0x4d3a('0x6f')](_0x46b4f6[_0x4d3a('0x79')][_0x4d3a('0x74')](),_0x4d3a('0x6d'))['field'](_0x2ce89d[_0x4d3a('0x46')]['id'][_0x4d3a('0x74')](),'CampaignId')[_0x4d3a('0x6f')]('NOW()','createdAt')['field'](_0x4d3a('0x71'),'updatedAt')[_0x4d3a('0x75')](_0x4d3a('0x76'))[_0x4d3a('0x3e')]('deletedAt\x20IS\x20NULL')[_0x4d3a('0x3e')](_0x4d3a('0x78'),_0x46b4f6[_0x4d3a('0x79')][_0x4d3a('0x74')]())[_0x4d3a('0x3e')](_0x4d3a('0x7a')))[_0x4d3a('0x74')]();_0x4ee56d[_0x4d3a('0x82')](db[_0x4d3a('0x83')][_0x4d3a('0x35')](_0x16f789));}return BPromise['all'](_0x4ee56d);}})[_0x4d3a('0x29')](function(){return _0x557b81;})[_0x4d3a('0x29')](respondWithResult(_0x106b09,null))[_0x4d3a('0x44')](handleError(_0x106b09,null));};exports[_0x4d3a('0x8a')]=function(_0x5ba8c1,_0x4b5257,_0x4a0be9){return db[_0x4d3a('0x31')][_0x4d3a('0x4a')]({'where':{'id':_0x5ba8c1[_0x4d3a('0x46')]['id']}})[_0x4d3a('0x29')](handleEntityNotFound(_0x4b5257,null))['then'](function(_0x45f5b2){if(_0x45f5b2){return _0x45f5b2['removeBlackLists'](_0x5ba8c1[_0x4d3a('0x35')][_0x4d3a('0x67')]);}})[_0x4d3a('0x29')](function(_0x4ac0f6){if(_0x4ac0f6){return db[_0x4d3a('0x8b')][_0x4d3a('0x28')]({'where':{'ListId':_0x5ba8c1['query'][_0x4d3a('0x67')],'CampaignId':_0x5ba8c1[_0x4d3a('0x46')]['id']}})[_0x4d3a('0x29')](function(){return _0x4ac0f6;});}})[_0x4d3a('0x29')](respondWithStatusCode(_0x4b5257,null))['catch'](handleError(_0x4b5257,null));};
\ No newline at end of file
index 9f1d699..bfbfe63 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(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a25cbdd..257e992 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cfa=['options','where','attributes','limit','model','map','include','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll'];(function(_0x1b2c93,_0x232cb8){var _0x4fa2e6=function(_0x5bc06c){while(--_0x5bc06c){_0x1b2c93['push'](_0x1b2c93['shift']());}};_0x4fa2e6(++_0x232cb8);}(_0x0cfa,0x18f));var _0xa0cf=function(_0x5ba857,_0x5712d7){_0x5ba857=_0x5ba857-0x0;var _0x3c8338=_0x0cfa[_0x5ba857];return _0x3c8338;};'use strict';var _=require(_0xa0cf('0x0'));var util=require(_0xa0cf('0x1'));var moment=require(_0xa0cf('0x2'));var BPromise=require(_0xa0cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa0cf('0x4'));var logger=require('../../config/logger')(_0xa0cf('0x5'));var config=require(_0xa0cf('0x6'));var jayson=require(_0xa0cf('0x7'));var client=jayson[_0xa0cf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27eb15,_0x5d9035,_0x232245){return new BPromise(function(_0x5f0054,_0xdee9d7){return client['request'](_0x27eb15,_0x232245)[_0xa0cf('0x9')](function(_0xaf7216){logger[_0xa0cf('0xa')]('Campaign,\x20%s,\x20%s',_0x5d9035,_0xa0cf('0xb'));logger[_0xa0cf('0xc')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5d9035,'request\x20sent',JSON[_0xa0cf('0xd')](_0xaf7216));if(_0xaf7216[_0xa0cf('0xe')]){if(_0xaf7216[_0xa0cf('0xe')]['code']===0x1f4){logger[_0xa0cf('0xe')](_0xa0cf('0xf'),_0x5d9035,_0xaf7216[_0xa0cf('0xe')][_0xa0cf('0x10')]);return _0xdee9d7(_0xaf7216[_0xa0cf('0xe')][_0xa0cf('0x10')]);}logger[_0xa0cf('0xe')]('Campaign,\x20%s,\x20%s',_0x5d9035,_0xaf7216[_0xa0cf('0xe')][_0xa0cf('0x10')]);return _0x5f0054(_0xaf7216[_0xa0cf('0xe')]['message']);}else{logger[_0xa0cf('0xa')](_0xa0cf('0xf'),_0x5d9035,_0xa0cf('0xb'));_0x5f0054(_0xaf7216[_0xa0cf('0x11')][_0xa0cf('0x10')]);}})['catch'](function(_0x19e263){logger[_0xa0cf('0xe')]('Campaign,\x20%s,\x20%s',_0x5d9035,_0x19e263);_0xdee9d7(_0x19e263);});});}exports[_0xa0cf('0x12')]=function(_0x36c524){var _0x53a186=this;return new Promise(function(_0x112ced,_0x175727){return db[_0xa0cf('0x13')][_0xa0cf('0x14')]({'raw':_0x36c524[_0xa0cf('0x15')]?_0x36c524[_0xa0cf('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x36c524[_0xa0cf('0x15')]?_0x36c524[_0xa0cf('0x15')][_0xa0cf('0x16')]||null:null,'attributes':_0x36c524[_0xa0cf('0x15')]?_0x36c524[_0xa0cf('0x15')][_0xa0cf('0x17')]||null:null,'limit':_0x36c524[_0xa0cf('0x15')]?_0x36c524[_0xa0cf('0x15')][_0xa0cf('0x18')]||null:null,'include':_0x36c524[_0xa0cf('0x15')]?_0x36c524[_0xa0cf('0x15')]['include']?_['map'](_0x36c524['options']['include'],function(_0x574085){return{'model':db[_0x574085[_0xa0cf('0x19')]],'as':_0x574085['as'],'attributes':_0x574085[_0xa0cf('0x17')],'include':_0x574085['include']?_[_0xa0cf('0x1a')](_0x574085[_0xa0cf('0x1b')],function(_0xeb9af){return{'model':db[_0xeb9af[_0xa0cf('0x19')]],'as':_0xeb9af['as'],'attributes':_0xeb9af['attributes'],'include':_0xeb9af[_0xa0cf('0x1b')]?_[_0xa0cf('0x1a')](_0xeb9af['include'],function(_0x543c66){return{'model':db[_0x543c66[_0xa0cf('0x19')]],'as':_0x543c66['as'],'attributes':_0x543c66[_0xa0cf('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa0cf('0x9')](function(_0x3d78f0){logger[_0xa0cf('0xa')](_0xa0cf('0x12'),_0x36c524);logger['debug']('GetCampaign',_0x36c524,JSON[_0xa0cf('0xd')](_0x3d78f0));_0x112ced(_0x3d78f0);})['catch'](function(_0xd627d){logger[_0xa0cf('0xe')](_0xa0cf('0x12'),_0xd627d[_0xa0cf('0x10')],_0x36c524);_0x175727(_0x53a186['error'](0x1f4,_0xd627d[_0xa0cf('0x10')]));});});};
\ No newline at end of file
+var _0xd73a=['debug','request\x20sent','error','code','message','result','catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s'];(function(_0x57b563,_0x10cfcc){var _0x7789fe=function(_0x5910d3){while(--_0x5910d3){_0x57b563['push'](_0x57b563['shift']());}};_0x7789fe(++_0x10cfcc);}(_0xd73a,0x171));var _0xad73=function(_0x293de7,_0x5e3188){_0x293de7=_0x293de7-0x0;var _0x4d29de=_0xd73a[_0x293de7];return _0x4d29de;};'use strict';var _=require(_0xad73('0x0'));var util=require(_0xad73('0x1'));var moment=require(_0xad73('0x2'));var BPromise=require(_0xad73('0x3'));var rs=require(_0xad73('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad73('0x5'));var logger=require(_0xad73('0x6'))(_0xad73('0x7'));var config=require(_0xad73('0x8'));var jayson=require(_0xad73('0x9'));var client=jayson[_0xad73('0xa')][_0xad73('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f4736,_0x24d620,_0x15cf28){return new BPromise(function(_0x1352b3,_0x524324){return client[_0xad73('0xc')](_0x2f4736,_0x15cf28)['then'](function(_0x3c07fa){logger[_0xad73('0xd')](_0xad73('0xe'),_0x24d620,'request\x20sent');logger[_0xad73('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x24d620,_0xad73('0x10'),JSON['stringify'](_0x3c07fa));if(_0x3c07fa[_0xad73('0x11')]){if(_0x3c07fa[_0xad73('0x11')][_0xad73('0x12')]===0x1f4){logger['error'](_0xad73('0xe'),_0x24d620,_0x3c07fa[_0xad73('0x11')]['message']);return _0x524324(_0x3c07fa[_0xad73('0x11')][_0xad73('0x13')]);}logger[_0xad73('0x11')](_0xad73('0xe'),_0x24d620,_0x3c07fa[_0xad73('0x11')][_0xad73('0x13')]);return _0x1352b3(_0x3c07fa['error'][_0xad73('0x13')]);}else{logger[_0xad73('0xd')](_0xad73('0xe'),_0x24d620,_0xad73('0x10'));_0x1352b3(_0x3c07fa[_0xad73('0x14')][_0xad73('0x13')]);}})[_0xad73('0x15')](function(_0x367a5d){logger[_0xad73('0x11')](_0xad73('0xe'),_0x24d620,_0x367a5d);_0x524324(_0x367a5d);});});}exports['GetCampaign']=function(_0x47381a){var _0x4cafad=this;return new Promise(function(_0x5bd242,_0x28bd73){return db[_0xad73('0x16')][_0xad73('0x17')]({'raw':_0x47381a['options']?_0x47381a[_0xad73('0x18')][_0xad73('0x19')]===undefined?!![]:![]:!![],'where':_0x47381a['options']?_0x47381a[_0xad73('0x18')][_0xad73('0x1a')]||null:null,'attributes':_0x47381a[_0xad73('0x18')]?_0x47381a[_0xad73('0x18')][_0xad73('0x1b')]||null:null,'limit':_0x47381a[_0xad73('0x18')]?_0x47381a[_0xad73('0x18')]['limit']||null:null,'include':_0x47381a[_0xad73('0x18')]?_0x47381a[_0xad73('0x18')][_0xad73('0x1c')]?_[_0xad73('0x1d')](_0x47381a[_0xad73('0x18')][_0xad73('0x1c')],function(_0xbfb297){return{'model':db[_0xbfb297[_0xad73('0x1e')]],'as':_0xbfb297['as'],'attributes':_0xbfb297[_0xad73('0x1b')],'include':_0xbfb297[_0xad73('0x1c')]?_[_0xad73('0x1d')](_0xbfb297[_0xad73('0x1c')],function(_0x182805){return{'model':db[_0x182805[_0xad73('0x1e')]],'as':_0x182805['as'],'attributes':_0x182805[_0xad73('0x1b')],'include':_0x182805[_0xad73('0x1c')]?_[_0xad73('0x1d')](_0x182805[_0xad73('0x1c')],function(_0xb7700c){return{'model':db[_0xb7700c[_0xad73('0x1e')]],'as':_0xb7700c['as'],'attributes':_0xb7700c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cd6a6){logger[_0xad73('0xd')](_0xad73('0x1f'),_0x47381a);logger['debug'](_0xad73('0x1f'),_0x47381a,JSON['stringify'](_0x5cd6a6));_0x5bd242(_0x5cd6a6);})['catch'](function(_0x1f826c){logger[_0xad73('0x11')](_0xad73('0x1f'),_0x1f826c[_0xad73('0x13')],_0x47381a);_0x28bd73(_0x4cafad['error'](0x1f4,_0x1f826c[_0xad73('0x13')]));});});};
\ No newline at end of file
index dc69953..36d2861 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36b6=['destroy','removeLists','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','index','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','update','delete'];(function(_0x1c764b,_0x5ed291){var _0x523f10=function(_0x291f4a){while(--_0x291f4a){_0x1c764b['push'](_0x1c764b['shift']());}};_0x523f10(++_0x5ed291);}(_0x36b6,0x1bf));var _0x636b=function(_0x488a5e,_0x590a4a){_0x488a5e=_0x488a5e-0x0;var _0x2e1442=_0x36b6[_0x488a5e];return _0x2e1442;};'use strict';var multer=require(_0x636b('0x0'));var util=require(_0x636b('0x1'));var path=require(_0x636b('0x2'));var timeout=require('connect-timeout');var express=require(_0x636b('0x3'));var router=express[_0x636b('0x4')]();var fs_extra=require(_0x636b('0x5'));var auth=require(_0x636b('0x6'));var interaction=require(_0x636b('0x7'));var config=require(_0x636b('0x8'));var controller=require(_0x636b('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x636b('0xa')]);router[_0x636b('0xb')](_0x636b('0xc'),auth[_0x636b('0xd')](),controller[_0x636b('0xe')]);router['get'](_0x636b('0xf'),auth[_0x636b('0xd')](),controller[_0x636b('0x10')]);router[_0x636b('0xb')](_0x636b('0x11'),auth[_0x636b('0xd')](),controller[_0x636b('0x12')]);router[_0x636b('0xb')](_0x636b('0x13'),auth[_0x636b('0xd')](),controller[_0x636b('0x14')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x636b('0x15')]);router[_0x636b('0xb')](_0x636b('0x16'),auth[_0x636b('0xd')](),controller[_0x636b('0x17')]);router[_0x636b('0xb')](_0x636b('0x18'),auth[_0x636b('0xd')](),controller[_0x636b('0x19')]);router[_0x636b('0x1a')]('/',auth[_0x636b('0xd')](),controller[_0x636b('0x1b')]);router[_0x636b('0x1a')](_0x636b('0x1c'),auth[_0x636b('0xd')](),controller[_0x636b('0x1d')]);router[_0x636b('0x1a')](_0x636b('0x16'),auth[_0x636b('0xd')](),controller[_0x636b('0x1e')]);router[_0x636b('0x1a')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0x636b('0x1f')]('/:id',auth[_0x636b('0xd')](),controller[_0x636b('0x20')]);router[_0x636b('0x21')](_0x636b('0xc'),auth[_0x636b('0xd')](),controller[_0x636b('0x22')]);router['delete'](_0x636b('0x16'),auth[_0x636b('0xd')](),controller[_0x636b('0x23')]);router['delete'](_0x636b('0x18'),auth[_0x636b('0xd')](),controller['removeBlackLists']);module[_0x636b('0x24')]=router;
\ No newline at end of file
+var _0x7fa6=['getBlackLists','post','create','/:id/clone','clone','addLists','put','update','delete','destroy','removeLists','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists'];(function(_0x41ea69,_0x445734){var _0x74292d=function(_0x3111be){while(--_0x3111be){_0x41ea69['push'](_0x41ea69['shift']());}};_0x74292d(++_0x445734);}(_0x7fa6,0xb1));var _0x67fa=function(_0x21997c,_0x167581){_0x21997c=_0x21997c-0x0;var _0x38735b=_0x7fa6[_0x21997c];return _0x38735b;};'use strict';var multer=require(_0x67fa('0x0'));var util=require(_0x67fa('0x1'));var path=require('path');var timeout=require(_0x67fa('0x2'));var express=require(_0x67fa('0x3'));var router=express[_0x67fa('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x67fa('0x5'));var config=require(_0x67fa('0x6'));var controller=require('./campaign.controller');router[_0x67fa('0x7')]('/',auth[_0x67fa('0x8')](),controller[_0x67fa('0x9')]);router[_0x67fa('0x7')](_0x67fa('0xa'),auth[_0x67fa('0x8')](),controller[_0x67fa('0xb')]);router[_0x67fa('0x7')](_0x67fa('0xc'),auth[_0x67fa('0x8')](),controller[_0x67fa('0xd')]);router['get'](_0x67fa('0xe'),auth[_0x67fa('0x8')](),controller[_0x67fa('0xf')]);router[_0x67fa('0x7')](_0x67fa('0x10'),auth['isAuthenticated'](),controller[_0x67fa('0x11')]);router['get'](_0x67fa('0x12'),auth[_0x67fa('0x8')](),controller['getHopperBlacks']);router[_0x67fa('0x7')](_0x67fa('0x13'),auth[_0x67fa('0x8')](),controller['getLists']);router[_0x67fa('0x7')](_0x67fa('0x14'),auth[_0x67fa('0x8')](),controller[_0x67fa('0x15')]);router[_0x67fa('0x16')]('/',auth[_0x67fa('0x8')](),controller[_0x67fa('0x17')]);router['post'](_0x67fa('0x18'),auth['isAuthenticated'](),controller[_0x67fa('0x19')]);router[_0x67fa('0x16')](_0x67fa('0x13'),auth[_0x67fa('0x8')](),controller[_0x67fa('0x1a')]);router[_0x67fa('0x16')]('/:id/blacklists',auth[_0x67fa('0x8')](),controller['addBlackLists']);router[_0x67fa('0x1b')](_0x67fa('0xa'),auth[_0x67fa('0x8')](),controller[_0x67fa('0x1c')]);router[_0x67fa('0x1d')](_0x67fa('0xa'),auth[_0x67fa('0x8')](),controller[_0x67fa('0x1e')]);router['delete'](_0x67fa('0x13'),auth['isAuthenticated'](),controller[_0x67fa('0x1f')]);router[_0x67fa('0x1d')](_0x67fa('0x14'),auth[_0x67fa('0x8')](),controller['removeBlackLists']);module[_0x67fa('0x20')]=router;
\ No newline at end of file
index 5c78e56..d5a644c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9511=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x359f97,_0x1b2357){var _0x2cb2ce=function(_0x5350c6){while(--_0x5350c6){_0x359f97['push'](_0x359f97['shift']());}};_0x2cb2ce(++_0x1b2357);}(_0x9511,0xf0));var _0x1951=function(_0x506ff5,_0x16d10f){_0x506ff5=_0x506ff5-0x0;var _0x2bd51b=_0x9511[_0x506ff5];return _0x2bd51b;};'use strict';var Sequelize=require(_0x1951('0x0'));module[_0x1951('0x1')]={'key':{'type':Sequelize[_0x1951('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x1951('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x1951('0x2')]},'name':{'type':Sequelize[_0x1951('0x4')],'get':function(){return this[_0x1951('0x5')]('key');}}};
\ No newline at end of file
+var _0x943e=['STRING','VIRTUAL','getDataValue','key','sequelize','exports','TEXT'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x943e,0xf9));var _0xe943=function(_0x5053f8,_0x338d04){_0x5053f8=_0x5053f8-0x0;var _0x50a912=_0x943e[_0x5053f8];return _0x50a912;};'use strict';var Sequelize=require(_0xe943('0x0'));module[_0xe943('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xe943('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe943('0x3')]},'name':{'type':Sequelize[_0xe943('0x4')],'get':function(){return this[_0xe943('0x5')](_0xe943('0x6'));}}};
\ No newline at end of file
index 4dc937d..1c2cc6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7175=['Content-Range','json','apply','reject','then','CannedAnswers','UserProfileResource','end','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','options','includeAll','findAll','rows','catch','params','merge','find','update','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set'];(function(_0x2e1574,_0x5577d9){var _0x210384=function(_0x3cb736){while(--_0x3cb736){_0x2e1574['push'](_0x2e1574['shift']());}};_0x210384(++_0x5577d9);}(_0x7175,0xe8));var _0x5717=function(_0x58f8a7,_0xbd36a7){_0x58f8a7=_0x58f8a7-0x0;var _0x149b97=_0x7175[_0x58f8a7];return _0x149b97;};'use strict';var emlformat=require(_0x5717('0x0'));var rimraf=require(_0x5717('0x1'));var zipdir=require(_0x5717('0x2'));var jsonpatch=require(_0x5717('0x3'));var rp=require(_0x5717('0x4'));var moment=require(_0x5717('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5717('0x6'));var util=require(_0x5717('0x7'));var path=require(_0x5717('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5717('0x9'));var _=require(_0x5717('0xa'));var squel=require(_0x5717('0xb'));var crypto=require(_0x5717('0xc'));var jsforce=require(_0x5717('0xd'));var deskjs=require(_0x5717('0xe'));var toCsv=require(_0x5717('0xf'));var querystring=require(_0x5717('0x10'));var Papa=require(_0x5717('0x11'));var Redis=require(_0x5717('0x12'));var authService=require(_0x5717('0x13'));var qs=require(_0x5717('0x14'));var as=require(_0x5717('0x15'));var hardwareService=require(_0x5717('0x16'));var logger=require(_0x5717('0x17'))(_0x5717('0x18'));var utils=require(_0x5717('0x19'));var config=require(_0x5717('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x5717('0x1b'))['db'];function respondWithStatusCode(_0x53834f,_0x2619bd){_0x2619bd=_0x2619bd||0xcc;return function(_0x50c841){if(_0x50c841){return _0x53834f[_0x5717('0x1c')](_0x2619bd);}return _0x53834f[_0x5717('0x1d')](_0x2619bd)['end']();};}function respondWithResult(_0x5ec771,_0x2affac){_0x2affac=_0x2affac||0xc8;return function(_0x2989d6){if(_0x2989d6){return _0x5ec771[_0x5717('0x1d')](_0x2affac)['json'](_0x2989d6);}};}function respondWithFilteredResult(_0x1d8b2d,_0x53d6f0){return function(_0x124fc9){if(_0x124fc9){var _0x4a5888=typeof _0x53d6f0[_0x5717('0x1e')]===_0x5717('0x1f')&&typeof _0x53d6f0['limit']==='undefined';var _0x47796a=_0x124fc9['count'];var _0x207801=_0x4a5888?0x0:_0x53d6f0[_0x5717('0x1e')];var _0x30fbe0=_0x4a5888?_0x124fc9[_0x5717('0x20')]:_0x53d6f0['offset']+_0x53d6f0[_0x5717('0x21')];var _0x255e7a;if(_0x30fbe0>=_0x47796a){_0x30fbe0=_0x47796a;_0x255e7a=0xc8;}else{_0x255e7a=0xce;}_0x1d8b2d[_0x5717('0x1d')](_0x255e7a);return _0x1d8b2d[_0x5717('0x22')](_0x5717('0x23'),_0x207801+'-'+_0x30fbe0+'/'+_0x47796a)[_0x5717('0x24')](_0x124fc9);}return null;};}function patchUpdates(_0x10276d){return function(_0x56503c){try{jsonpatch[_0x5717('0x25')](_0x56503c,_0x10276d,!![]);}catch(_0x4456b1){return BPromise[_0x5717('0x26')](_0x4456b1);}return _0x56503c['save']();};}function saveUpdates(_0x19abc1,_0xbe95fc){return function(_0x1c306c){if(_0x1c306c){return _0x1c306c['update'](_0x19abc1)[_0x5717('0x27')](function(_0x2b0407){return _0x2b0407;});}return null;};}function removeEntity(_0x55aafd,_0x187efd){return function(_0x4c1f8e){if(_0x4c1f8e){return _0x4c1f8e['destroy']()['then'](function(){var _0x262511=_0x4c1f8e['get']({'plain':!![]});var _0x37628a=_0x5717('0x28');return db[_0x5717('0x29')]['destroy']({'where':{'type':_0x37628a,'resourceId':_0x262511['id']}})['then'](function(){return _0x4c1f8e;});})[_0x5717('0x27')](function(){_0x55aafd[_0x5717('0x1d')](0xcc)[_0x5717('0x2a')]();});}};}function handleEntityNotFound(_0x105992,_0x45c078){return function(_0x3bef19){if(!_0x3bef19){_0x105992[_0x5717('0x1c')](0x194);}return _0x3bef19;};}function handleError(_0x2202d8,_0x306ea8){_0x306ea8=_0x306ea8||0x1f4;return function(_0x33daf3){logger[_0x5717('0x2b')](_0x33daf3[_0x5717('0x2c')]);if(_0x33daf3['name']){delete _0x33daf3[_0x5717('0x2d')];}_0x2202d8['status'](_0x306ea8)['send'](_0x33daf3);};}exports[_0x5717('0x2e')]=function(_0x345ef3,_0x32e5e0){var _0x857526={},_0x5dabd0={},_0x37b2b8={'count':0x0,'rows':[]};var _0x13f5a1=_[_0x5717('0x2f')](db[_0x5717('0x30')][_0x5717('0x31')],function(_0x55eaae){return{'name':_0x55eaae[_0x5717('0x32')],'type':_0x55eaae[_0x5717('0x33')][_0x5717('0x34')]};});_0x5dabd0[_0x5717('0x35')]=_['map'](_0x13f5a1,_0x5717('0x2d'));_0x5dabd0['query']=_[_0x5717('0x36')](_0x345ef3['query']);_0x5dabd0[_0x5717('0x37')]=_[_0x5717('0x38')](_0x5dabd0[_0x5717('0x35')],_0x5dabd0[_0x5717('0x39')]);_0x857526[_0x5717('0x3a')]=_[_0x5717('0x38')](_0x5dabd0['model'],qs[_0x5717('0x3b')](_0x345ef3[_0x5717('0x39')]['fields']));_0x857526['attributes']=_0x857526[_0x5717('0x3a')][_0x5717('0x3c')]?_0x857526[_0x5717('0x3a')]:_0x5dabd0[_0x5717('0x35')];if(!_0x345ef3[_0x5717('0x39')][_0x5717('0x3d')]('nolimit')){_0x857526[_0x5717('0x21')]=qs[_0x5717('0x21')](_0x345ef3['query'][_0x5717('0x21')]);_0x857526[_0x5717('0x1e')]=qs[_0x5717('0x1e')](_0x345ef3[_0x5717('0x39')]['offset']);}_0x857526[_0x5717('0x3e')]=qs[_0x5717('0x3f')](_0x345ef3['query']['sort']);_0x857526[_0x5717('0x40')]=qs[_0x5717('0x37')](_['pick'](_0x345ef3[_0x5717('0x39')],_0x5dabd0[_0x5717('0x37')]),_0x13f5a1);if(_0x345ef3[_0x5717('0x39')]['filter']){_0x857526['where']=_['merge'](_0x857526[_0x5717('0x40')],{'$or':[{'key':{'$like':'%'+_0x345ef3[_0x5717('0x39')][_0x5717('0x41')]+'%'}},{'value':{'$like':'%'+_0x345ef3[_0x5717('0x39')]['filter']+'%'}}]});}_0x857526=_['merge']({},_0x857526,_0x345ef3[_0x5717('0x42')]);var _0x5ec2c2={'where':_0x857526['where']};return db[_0x5717('0x30')][_0x5717('0x20')](_0x5ec2c2)[_0x5717('0x27')](function(_0x351390){_0x37b2b8[_0x5717('0x20')]=_0x351390;if(_0x345ef3[_0x5717('0x39')][_0x5717('0x43')]){_0x857526['include']=[{'all':!![]}];}return db[_0x5717('0x30')][_0x5717('0x44')](_0x857526);})[_0x5717('0x27')](function(_0x2be69b){_0x37b2b8[_0x5717('0x45')]=_0x2be69b;return _0x37b2b8;})[_0x5717('0x27')](respondWithFilteredResult(_0x32e5e0,_0x857526))[_0x5717('0x46')](handleError(_0x32e5e0,null));};exports['show']=function(_0x5b870c,_0xbb0030){var _0x29cece={'raw':!![],'where':{'id':_0x5b870c[_0x5717('0x47')]['id']}},_0x5d9af7={};_0x5d9af7[_0x5717('0x35')]=_[_0x5717('0x36')](db[_0x5717('0x30')]['rawAttributes']);_0x5d9af7[_0x5717('0x39')]=_[_0x5717('0x36')](_0x5b870c['query']);_0x5d9af7['filters']=_[_0x5717('0x38')](_0x5d9af7[_0x5717('0x35')],_0x5d9af7['query']);_0x29cece[_0x5717('0x3a')]=_['intersection'](_0x5d9af7['model'],qs[_0x5717('0x3b')](_0x5b870c[_0x5717('0x39')][_0x5717('0x3b')]));_0x29cece[_0x5717('0x3a')]=_0x29cece['attributes']['length']?_0x29cece['attributes']:_0x5d9af7[_0x5717('0x35')];if(_0x5b870c[_0x5717('0x39')][_0x5717('0x43')]){_0x29cece['include']=[{'all':!![]}];}_0x29cece=_[_0x5717('0x48')]({},_0x29cece,_0x5b870c[_0x5717('0x42')]);return db[_0x5717('0x30')][_0x5717('0x49')](_0x29cece)[_0x5717('0x27')](handleEntityNotFound(_0xbb0030,null))['then'](respondWithResult(_0xbb0030,null))[_0x5717('0x46')](handleError(_0xbb0030,null));};exports[_0x5717('0x4a')]=function(_0x3a83e6,_0x4bb251){if(_0x3a83e6[_0x5717('0x4b')]['id']){delete _0x3a83e6[_0x5717('0x4b')]['id'];}return db['CannedAnswer'][_0x5717('0x49')]({'where':{'id':_0x3a83e6[_0x5717('0x47')]['id']}})[_0x5717('0x27')](handleEntityNotFound(_0x4bb251,null))[_0x5717('0x27')](saveUpdates(_0x3a83e6[_0x5717('0x4b')],null))[_0x5717('0x27')](respondWithResult(_0x4bb251,null))[_0x5717('0x46')](handleError(_0x4bb251,null));};exports[_0x5717('0x4c')]=function(_0x569a7,_0x5428d7){return db[_0x5717('0x30')]['find']({'where':{'id':_0x569a7['params']['id']}})[_0x5717('0x27')](handleEntityNotFound(_0x5428d7,null))[_0x5717('0x27')](removeEntity(_0x5428d7,null))[_0x5717('0x46')](handleError(_0x5428d7,null));};exports[_0x5717('0x4d')]=function(_0x2baa4d,_0x493d5a){var _0x5d21ee={'key':_0x2baa4d['body'][_0x5717('0x34')]};if(_0x2baa4d[_0x5717('0x4b')][_0x5717('0x4e')]){_0x5d21ee['MailAccountId']=_0x2baa4d[_0x5717('0x4b')][_0x5717('0x4e')];}else if(_0x2baa4d[_0x5717('0x4b')][_0x5717('0x4f')]){_0x5d21ee[_0x5717('0x4f')]=_0x2baa4d[_0x5717('0x4b')]['SmsAccountId'];}else if(_0x2baa4d[_0x5717('0x4b')]['OpenchannelAccountId']){_0x5d21ee[_0x5717('0x50')]=_0x2baa4d[_0x5717('0x4b')]['OpenchannelAccountId'];}else if(_0x2baa4d[_0x5717('0x4b')]['ChatWebsiteId']){_0x5d21ee[_0x5717('0x51')]=_0x2baa4d['body'][_0x5717('0x51')];}return db[_0x5717('0x30')]['find']({'where':_0x5d21ee})[_0x5717('0x27')](function(_0x1cfcc3){if(_0x1cfcc3){throw new db['Sequelize'][(_0x5717('0x52'))](_0x5717('0x53'));}return db[_0x5717('0x30')][_0x5717('0x4d')](_0x2baa4d[_0x5717('0x4b')]);})[_0x5717('0x27')](function(_0x2aec3b){var _0x5b0e0b=_0x2baa4d[_0x5717('0x54')]['get']({'plain':!![]});if(!_0x5b0e0b)throw new Error(_0x5717('0x55'));if(_0x5b0e0b[_0x5717('0x56')]==='user'){var _0x12b0ac=_0x2aec3b['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5717('0x28'),'userProfileId':_0x5b0e0b[_0x5717('0x57')]},'raw':!![]})['then'](function(_0x2cd167){if(_0x2cd167&&_0x2cd167['autoAssociation']===0x0){return db['UserProfileResource'][_0x5717('0x4d')]({'name':_0x12b0ac[_0x5717('0x2d')],'resourceId':_0x12b0ac['id'],'type':_0x2cd167[_0x5717('0x2d')],'sectionId':_0x2cd167['id']},{})[_0x5717('0x27')](function(){return _0x2aec3b;});}else{return _0x2aec3b;}})['catch'](function(_0x37ff79){logger[_0x5717('0x2b')](_0x5717('0x58'),_0x37ff79);throw _0x37ff79;});}return _0x2aec3b;})[_0x5717('0x27')](respondWithResult(_0x493d5a,0xc9))['catch'](handleError(_0x493d5a,null));};
\ No newline at end of file
+var _0xb95a=['sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','index','map','CannedAnswer','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','catch','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb'];(function(_0x52f0a6,_0x1e6387){var _0x537a6e=function(_0x5f66f1){while(--_0x5f66f1){_0x52f0a6['push'](_0x52f0a6['shift']());}};_0x537a6e(++_0x1e6387);}(_0xb95a,0x1f3));var _0xab95=function(_0x5c29f9,_0x100ec8){_0x5c29f9=_0x5c29f9-0x0;var _0x2fb14c=_0xb95a[_0x5c29f9];return _0x2fb14c;};'use strict';var emlformat=require(_0xab95('0x0'));var rimraf=require(_0xab95('0x1'));var zipdir=require(_0xab95('0x2'));var jsonpatch=require(_0xab95('0x3'));var rp=require(_0xab95('0x4'));var moment=require(_0xab95('0x5'));var BPromise=require(_0xab95('0x6'));var Mustache=require(_0xab95('0x7'));var util=require(_0xab95('0x8'));var path=require(_0xab95('0x9'));var sox=require('sox');var csv=require(_0xab95('0xa'));var ejs=require(_0xab95('0xb'));var fs=require('fs');var fs_extra=require(_0xab95('0xc'));var _=require(_0xab95('0xd'));var squel=require('squel');var crypto=require(_0xab95('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xab95('0xf'));var toCsv=require(_0xab95('0xa'));var querystring=require(_0xab95('0x10'));var Papa=require('papaparse');var Redis=require(_0xab95('0x11'));var authService=require(_0xab95('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xab95('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab95('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab95('0x15'));var db=require(_0xab95('0x16'))['db'];function respondWithStatusCode(_0x4889e0,_0x2fa3ca){_0x2fa3ca=_0x2fa3ca||0xcc;return function(_0x476ef0){if(_0x476ef0){return _0x4889e0[_0xab95('0x17')](_0x2fa3ca);}return _0x4889e0[_0xab95('0x18')](_0x2fa3ca)[_0xab95('0x19')]();};}function respondWithResult(_0x560fbd,_0x12115d){_0x12115d=_0x12115d||0xc8;return function(_0x4a8d88){if(_0x4a8d88){return _0x560fbd[_0xab95('0x18')](_0x12115d)['json'](_0x4a8d88);}};}function respondWithFilteredResult(_0x56f94b,_0x375a45){return function(_0x3f59af){if(_0x3f59af){var _0x3e15ab=typeof _0x375a45[_0xab95('0x1a')]===_0xab95('0x1b')&&typeof _0x375a45[_0xab95('0x1c')]===_0xab95('0x1b');var _0x1d73e2=_0x3f59af['count'];var _0x1f4435=_0x3e15ab?0x0:_0x375a45[_0xab95('0x1a')];var _0x4a0050=_0x3e15ab?_0x3f59af[_0xab95('0x1d')]:_0x375a45[_0xab95('0x1a')]+_0x375a45[_0xab95('0x1c')];var _0x1b175e;if(_0x4a0050>=_0x1d73e2){_0x4a0050=_0x1d73e2;_0x1b175e=0xc8;}else{_0x1b175e=0xce;}_0x56f94b[_0xab95('0x18')](_0x1b175e);return _0x56f94b[_0xab95('0x1e')]('Content-Range',_0x1f4435+'-'+_0x4a0050+'/'+_0x1d73e2)[_0xab95('0x1f')](_0x3f59af);}return null;};}function patchUpdates(_0x2cc5fa){return function(_0x525a2a){try{jsonpatch[_0xab95('0x20')](_0x525a2a,_0x2cc5fa,!![]);}catch(_0x3f72d9){return BPromise[_0xab95('0x21')](_0x3f72d9);}return _0x525a2a[_0xab95('0x22')]();};}function saveUpdates(_0x3f3390,_0x55f57a){return function(_0x2d901b){if(_0x2d901b){return _0x2d901b[_0xab95('0x23')](_0x3f3390)[_0xab95('0x24')](function(_0x5778eb){return _0x5778eb;});}return null;};}function removeEntity(_0x4f19df,_0x1d87eb){return function(_0x4961a1){if(_0x4961a1){return _0x4961a1[_0xab95('0x25')]()[_0xab95('0x24')](function(){var _0x57cbd2=_0x4961a1[_0xab95('0x26')]({'plain':!![]});var _0x5058ea=_0xab95('0x27');return db[_0xab95('0x28')][_0xab95('0x25')]({'where':{'type':_0x5058ea,'resourceId':_0x57cbd2['id']}})[_0xab95('0x24')](function(){return _0x4961a1;});})[_0xab95('0x24')](function(){_0x4f19df[_0xab95('0x18')](0xcc)[_0xab95('0x19')]();});}};}function handleEntityNotFound(_0xb61d4a,_0x12b02c){return function(_0x34e99d){if(!_0x34e99d){_0xb61d4a['sendStatus'](0x194);}return _0x34e99d;};}function handleError(_0x199fe7,_0xf8ddd9){_0xf8ddd9=_0xf8ddd9||0x1f4;return function(_0x168f9e){logger[_0xab95('0x29')](_0x168f9e[_0xab95('0x2a')]);if(_0x168f9e['name']){delete _0x168f9e[_0xab95('0x2b')];}_0x199fe7[_0xab95('0x18')](_0xf8ddd9)['send'](_0x168f9e);};}exports[_0xab95('0x2c')]=function(_0x1003ce,_0x3ea9ba){var _0x5d696d={},_0x2539b0={},_0x114d09={'count':0x0,'rows':[]};var _0x46dac2=_[_0xab95('0x2d')](db[_0xab95('0x2e')][_0xab95('0x2f')],function(_0x18917a){return{'name':_0x18917a['fieldName'],'type':_0x18917a['type']['key']};});_0x2539b0[_0xab95('0x30')]=_[_0xab95('0x2d')](_0x46dac2,_0xab95('0x2b'));_0x2539b0[_0xab95('0x31')]=_[_0xab95('0x32')](_0x1003ce[_0xab95('0x31')]);_0x2539b0[_0xab95('0x33')]=_[_0xab95('0x34')](_0x2539b0[_0xab95('0x30')],_0x2539b0[_0xab95('0x31')]);_0x5d696d['attributes']=_[_0xab95('0x34')](_0x2539b0[_0xab95('0x30')],qs['fields'](_0x1003ce['query'][_0xab95('0x35')]));_0x5d696d[_0xab95('0x36')]=_0x5d696d[_0xab95('0x36')][_0xab95('0x37')]?_0x5d696d['attributes']:_0x2539b0[_0xab95('0x30')];if(!_0x1003ce[_0xab95('0x31')]['hasOwnProperty'](_0xab95('0x38'))){_0x5d696d[_0xab95('0x1c')]=qs['limit'](_0x1003ce[_0xab95('0x31')]['limit']);_0x5d696d[_0xab95('0x1a')]=qs[_0xab95('0x1a')](_0x1003ce[_0xab95('0x31')][_0xab95('0x1a')]);}_0x5d696d[_0xab95('0x39')]=qs[_0xab95('0x3a')](_0x1003ce[_0xab95('0x31')][_0xab95('0x3a')]);_0x5d696d['where']=qs[_0xab95('0x33')](_['pick'](_0x1003ce['query'],_0x2539b0[_0xab95('0x33')]),_0x46dac2);if(_0x1003ce[_0xab95('0x31')][_0xab95('0x3b')]){_0x5d696d[_0xab95('0x3c')]=_[_0xab95('0x3d')](_0x5d696d[_0xab95('0x3c')],{'$or':[{'key':{'$like':'%'+_0x1003ce['query'][_0xab95('0x3b')]+'%'}},{'value':{'$like':'%'+_0x1003ce[_0xab95('0x31')][_0xab95('0x3b')]+'%'}}]});}_0x5d696d=_[_0xab95('0x3d')]({},_0x5d696d,_0x1003ce[_0xab95('0x3e')]);var _0x4afe32={'where':_0x5d696d[_0xab95('0x3c')]};return db[_0xab95('0x2e')]['count'](_0x4afe32)[_0xab95('0x24')](function(_0x3520b4){_0x114d09['count']=_0x3520b4;if(_0x1003ce['query'][_0xab95('0x3f')]){_0x5d696d[_0xab95('0x40')]=[{'all':!![]}];}return db[_0xab95('0x2e')][_0xab95('0x41')](_0x5d696d);})['then'](function(_0x252e33){_0x114d09[_0xab95('0x42')]=_0x252e33;return _0x114d09;})[_0xab95('0x24')](respondWithFilteredResult(_0x3ea9ba,_0x5d696d))['catch'](handleError(_0x3ea9ba,null));};exports[_0xab95('0x43')]=function(_0x30c969,_0x3aedee){var _0x17006b={'raw':!![],'where':{'id':_0x30c969[_0xab95('0x44')]['id']}},_0x197997={};_0x197997[_0xab95('0x30')]=_[_0xab95('0x32')](db[_0xab95('0x2e')][_0xab95('0x2f')]);_0x197997[_0xab95('0x31')]=_[_0xab95('0x32')](_0x30c969[_0xab95('0x31')]);_0x197997[_0xab95('0x33')]=_[_0xab95('0x34')](_0x197997[_0xab95('0x30')],_0x197997['query']);_0x17006b[_0xab95('0x36')]=_[_0xab95('0x34')](_0x197997[_0xab95('0x30')],qs['fields'](_0x30c969[_0xab95('0x31')]['fields']));_0x17006b[_0xab95('0x36')]=_0x17006b[_0xab95('0x36')][_0xab95('0x37')]?_0x17006b['attributes']:_0x197997[_0xab95('0x30')];if(_0x30c969[_0xab95('0x31')][_0xab95('0x3f')]){_0x17006b[_0xab95('0x40')]=[{'all':!![]}];}_0x17006b=_[_0xab95('0x3d')]({},_0x17006b,_0x30c969[_0xab95('0x3e')]);return db['CannedAnswer'][_0xab95('0x45')](_0x17006b)[_0xab95('0x24')](handleEntityNotFound(_0x3aedee,null))[_0xab95('0x24')](respondWithResult(_0x3aedee,null))[_0xab95('0x46')](handleError(_0x3aedee,null));};exports[_0xab95('0x23')]=function(_0x4fd26b,_0x47cff0){if(_0x4fd26b[_0xab95('0x47')]['id']){delete _0x4fd26b[_0xab95('0x47')]['id'];}return db[_0xab95('0x2e')][_0xab95('0x45')]({'where':{'id':_0x4fd26b['params']['id']}})[_0xab95('0x24')](handleEntityNotFound(_0x47cff0,null))[_0xab95('0x24')](saveUpdates(_0x4fd26b[_0xab95('0x47')],null))[_0xab95('0x24')](respondWithResult(_0x47cff0,null))['catch'](handleError(_0x47cff0,null));};exports['destroy']=function(_0x4acf05,_0x1f6da9){return db[_0xab95('0x2e')][_0xab95('0x45')]({'where':{'id':_0x4acf05[_0xab95('0x44')]['id']}})[_0xab95('0x24')](handleEntityNotFound(_0x1f6da9,null))[_0xab95('0x24')](removeEntity(_0x1f6da9,null))[_0xab95('0x46')](handleError(_0x1f6da9,null));};exports[_0xab95('0x48')]=function(_0x202ef5,_0x4c7c46){var _0x155249={'key':_0x202ef5['body'][_0xab95('0x49')]};if(_0x202ef5[_0xab95('0x47')]['MailAccountId']){_0x155249[_0xab95('0x4a')]=_0x202ef5['body'][_0xab95('0x4a')];}else if(_0x202ef5['body'][_0xab95('0x4b')]){_0x155249[_0xab95('0x4b')]=_0x202ef5['body'][_0xab95('0x4b')];}else if(_0x202ef5[_0xab95('0x47')][_0xab95('0x4c')]){_0x155249[_0xab95('0x4c')]=_0x202ef5['body'][_0xab95('0x4c')];}else if(_0x202ef5[_0xab95('0x47')][_0xab95('0x4d')]){_0x155249[_0xab95('0x4d')]=_0x202ef5[_0xab95('0x47')]['ChatWebsiteId'];}return db[_0xab95('0x2e')][_0xab95('0x45')]({'where':_0x155249})[_0xab95('0x24')](function(_0x49a664){if(_0x49a664){throw new db['Sequelize'][(_0xab95('0x4e'))](_0xab95('0x4f'));}return db[_0xab95('0x2e')][_0xab95('0x48')](_0x202ef5[_0xab95('0x47')]);})[_0xab95('0x24')](function(_0x18f8ac){var _0x523342=_0x202ef5[_0xab95('0x50')][_0xab95('0x26')]({'plain':!![]});if(!_0x523342)throw new Error(_0xab95('0x51'));if(_0x523342[_0xab95('0x52')]===_0xab95('0x50')){var _0x297a15=_0x18f8ac[_0xab95('0x26')]({'plain':!![]});return db[_0xab95('0x53')][_0xab95('0x45')]({'where':{'name':'CannedAnswers','userProfileId':_0x523342[_0xab95('0x54')]},'raw':!![]})[_0xab95('0x24')](function(_0x28c985){if(_0x28c985&&_0x28c985[_0xab95('0x55')]===0x0){return db[_0xab95('0x28')]['create']({'name':_0x297a15[_0xab95('0x2b')],'resourceId':_0x297a15['id'],'type':_0x28c985[_0xab95('0x2b')],'sectionId':_0x28c985['id']},{})[_0xab95('0x24')](function(){return _0x18f8ac;});}else{return _0x18f8ac;}})[_0xab95('0x46')](function(_0xfa1c10){logger[_0xab95('0x29')](_0xab95('0x56'),_0xfa1c10);throw _0xfa1c10;});}return _0x18f8ac;})[_0xab95('0x24')](respondWithResult(_0x4c7c46,0xc9))[_0xab95('0x46')](handleError(_0x4c7c46,null));};
\ No newline at end of file
index 00dcbd3..550218c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce86=['path','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x15dbc1,_0x553399){var _0x2a178c=function(_0x5eb288){while(--_0x5eb288){_0x15dbc1['push'](_0x15dbc1['shift']());}};_0x2a178c(++_0x553399);}(_0xce86,0x19b));var _0x6ce8=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xce86[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x6ce8('0x0'));var util=require(_0x6ce8('0x1'));var logger=require(_0x6ce8('0x2'))(_0x6ce8('0x3'));var moment=require(_0x6ce8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ce8('0x5'));var rimraf=require('rimraf');var config=require(_0x6ce8('0x6'));var attributes=require(_0x6ce8('0x7'));module[_0x6ce8('0x8')]=function(_0x55be4b,_0x1fa00b){return _0x55be4b['define'](_0x6ce8('0x9'),attributes,{'tableName':_0x6ce8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6ce8('0xb'),'collate':_0x6ce8('0xc')});};
\ No newline at end of file
+var _0xe9ad=['bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xe9ad,0x82));var _0xde9a=function(_0x13bcbb,_0x2eb915){_0x13bcbb=_0x13bcbb-0x0;var _0x457c81=_0xe9ad[_0x13bcbb];return _0x457c81;};'use strict';var _=require(_0xde9a('0x0'));var util=require(_0xde9a('0x1'));var logger=require(_0xde9a('0x2'))(_0xde9a('0x3'));var moment=require(_0xde9a('0x4'));var BPromise=require(_0xde9a('0x5'));var rp=require(_0xde9a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde9a('0x7'));var config=require(_0xde9a('0x8'));var attributes=require(_0xde9a('0x9'));module[_0xde9a('0xa')]=function(_0x5290c5,_0x27b380){return _0x5290c5[_0xde9a('0xb')](_0xde9a('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde9a('0xd'),'collate':_0xde9a('0xe')});};
\ No newline at end of file
index b6e5254..ebe7c41 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(_0x236f1e,_0x37f58f){var _0x387ed9=function(_0x163f03){while(--_0x163f03){_0x236f1e['push'](_0x236f1e['shift']());}};_0x387ed9(++_0x37f58f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x407c24,_0x32e915){var _0x128e0b=function(_0x36956){while(--_0x36956){_0x407c24['push'](_0x407c24['shift']());}};_0x128e0b(++_0x32e915);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 bd2dbae..fd467fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf486=['put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','show','post','create'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xf486,0x146));var _0x6f48=function(_0x447348,_0x50f6da){_0x447348=_0x447348-0x0;var _0xdfa057=_0xf486[_0x447348];return _0xdfa057;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f48('0x0'));var timeout=require(_0x6f48('0x1'));var express=require(_0x6f48('0x2'));var router=express[_0x6f48('0x3')]();var fs_extra=require(_0x6f48('0x4'));var auth=require(_0x6f48('0x5'));var interaction=require(_0x6f48('0x6'));var config=require(_0x6f48('0x7'));var controller=require(_0x6f48('0x8'));router['get']('/',auth[_0x6f48('0x9')](),controller[_0x6f48('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6f48('0xb')]);router[_0x6f48('0xc')]('/',auth[_0x6f48('0x9')](),controller[_0x6f48('0xd')]);router[_0x6f48('0xe')](_0x6f48('0xf'),auth[_0x6f48('0x9')](),controller[_0x6f48('0x10')]);router[_0x6f48('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6f48('0x12')]);module[_0x6f48('0x13')]=router;
\ No newline at end of file
+var _0x0ffe=['express','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','put','update','multer','util','path'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x0ffe,0xa2));var _0xe0ff=function(_0x16bfae,_0x36ed25){_0x16bfae=_0x16bfae-0x0;var _0x3870f5=_0x0ffe[_0x16bfae];return _0x3870f5;};'use strict';var multer=require(_0xe0ff('0x0'));var util=require(_0xe0ff('0x1'));var path=require(_0xe0ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xe0ff('0x3'));var router=express['Router']();var fs_extra=require(_0xe0ff('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe0ff('0x5'));var config=require(_0xe0ff('0x6'));var controller=require(_0xe0ff('0x7'));router[_0xe0ff('0x8')]('/',auth[_0xe0ff('0x9')](),controller[_0xe0ff('0xa')]);router['get'](_0xe0ff('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe0ff('0xc')]('/',auth[_0xe0ff('0x9')](),controller['create']);router[_0xe0ff('0xd')]('/:id',auth[_0xe0ff('0x9')](),controller[_0xe0ff('0xe')]);router['delete'](_0xe0ff('0xb'),auth[_0xe0ff('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index ed18187..7dfdba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668b=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x668b,0x140));var _0xb668=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0x668b[_0x4cfc1d];return _0x1c01a0;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xb668('0x2')},'clid':{'type':Sequelize[_0xb668('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb668('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb668('0x3')]},'dstchannel':{'type':Sequelize[_0xb668('0x3')]},'lastapp':{'type':Sequelize[_0xb668('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb668('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb668('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb668('0x3')]},'amaflags':{'type':Sequelize[_0xb668('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb668('0x3')]},'userfield':{'type':Sequelize[_0xb668('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xb668('0x3')]},'sequence':{'type':Sequelize[_0xb668('0x3')]},'peeraccount':{'type':Sequelize[_0xb668('0x3')]},'type':{'type':Sequelize[_0xb668('0x3')]},'tag':{'type':Sequelize[_0xb668('0x3')]}};
\ No newline at end of file
+var _0xfdb5=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x5a7a54,_0x31a865){var _0x1a4c8f=function(_0x5240f1){while(--_0x5240f1){_0x5a7a54['push'](_0x5a7a54['shift']());}};_0x1a4c8f(++_0x31a865);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xfdb5[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x5fdb('0x0'));module[_0x5fdb('0x1')]={'calldate':{'type':Sequelize[_0x5fdb('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x5fdb('0x3')]},'src':{'type':Sequelize[_0x5fdb('0x3')]},'dst':{'type':Sequelize[_0x5fdb('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x5fdb('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5fdb('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5fdb('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5fdb('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5fdb('0x3')]},'linkedid':{'type':Sequelize[_0x5fdb('0x3')]},'sequence':{'type':Sequelize[_0x5fdb('0x3')]},'peeraccount':{'type':Sequelize[_0x5fdb('0x3')]},'type':{'type':Sequelize[_0x5fdb('0x3')]},'tag':{'type':Sequelize[_0x5fdb('0x3')]}};
\ No newline at end of file
index d4199f3..6d9875a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd67b=['include','findAll','rows','catch','show','keys','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x2b195a,_0x148117){var _0x448cfb=function(_0x2df957){while(--_0x2df957){_0x2b195a['push'](_0x2b195a['shift']());}};_0x448cfb(++_0x148117);}(_0xd67b,0x133));var _0xbd67=function(_0x2bc746,_0x2e664e){_0x2bc746=_0x2bc746-0x0;var _0x4cc0e3=_0xd67b[_0x2bc746];return _0x4cc0e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd67('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd67('0x1'));var rp=require(_0xbd67('0x2'));var moment=require(_0xbd67('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbd67('0x4'));var util=require('util');var path=require(_0xbd67('0x5'));var sox=require('sox');var csv=require(_0xbd67('0x6'));var ejs=require(_0xbd67('0x7'));var fs=require('fs');var fs_extra=require(_0xbd67('0x8'));var _=require(_0xbd67('0x9'));var squel=require(_0xbd67('0xa'));var crypto=require(_0xbd67('0xb'));var jsforce=require(_0xbd67('0xc'));var deskjs=require(_0xbd67('0xd'));var toCsv=require(_0xbd67('0x6'));var querystring=require(_0xbd67('0xe'));var Papa=require(_0xbd67('0xf'));var Redis=require(_0xbd67('0x10'));var authService=require(_0xbd67('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd67('0x12'));var logger=require('../../config/logger')(_0xbd67('0x13'));var utils=require(_0xbd67('0x14'));var config=require(_0xbd67('0x15'));var licenseUtil=require(_0xbd67('0x16'));var db=require(_0xbd67('0x17'))['db'];function respondWithStatusCode(_0xb05237,_0x3621ad){_0x3621ad=_0x3621ad||0xcc;return function(_0x32bd81){if(_0x32bd81){return _0xb05237[_0xbd67('0x18')](_0x3621ad);}return _0xb05237[_0xbd67('0x19')](_0x3621ad)['end']();};}function respondWithResult(_0xbe923c,_0x46d881){_0x46d881=_0x46d881||0xc8;return function(_0x2a5efd){if(_0x2a5efd){return _0xbe923c[_0xbd67('0x19')](_0x46d881)[_0xbd67('0x1a')](_0x2a5efd);}};}function respondWithFilteredResult(_0x23b626,_0x44c025){return function(_0xbdd027){if(_0xbdd027){var _0xa45c76=typeof _0x44c025[_0xbd67('0x1b')]==='undefined'&&typeof _0x44c025['limit']===_0xbd67('0x1c');var _0x475e36=_0xbdd027[_0xbd67('0x1d')];var _0x47d066=_0xa45c76?0x0:_0x44c025[_0xbd67('0x1b')];var _0x2e0e21=_0xa45c76?_0xbdd027[_0xbd67('0x1d')]:_0x44c025['offset']+_0x44c025[_0xbd67('0x1e')];var _0x5ceb31;if(_0x2e0e21>=_0x475e36){_0x2e0e21=_0x475e36;_0x5ceb31=0xc8;}else{_0x5ceb31=0xce;}_0x23b626[_0xbd67('0x19')](_0x5ceb31);return _0x23b626[_0xbd67('0x1f')](_0xbd67('0x20'),_0x47d066+'-'+_0x2e0e21+'/'+_0x475e36)['json'](_0xbdd027);}return null;};}function patchUpdates(_0x3c4102){return function(_0x40ec96){try{jsonpatch[_0xbd67('0x21')](_0x40ec96,_0x3c4102,!![]);}catch(_0x32037f){return BPromise[_0xbd67('0x22')](_0x32037f);}return _0x40ec96[_0xbd67('0x23')]();};}function saveUpdates(_0x5a95b6,_0x3ee2f1){return function(_0x36a634){if(_0x36a634){return _0x36a634[_0xbd67('0x24')](_0x5a95b6)[_0xbd67('0x25')](function(_0x8a7174){return _0x8a7174;});}return null;};}function removeEntity(_0x33fd8c,_0x46c519){return function(_0x922df8){if(_0x922df8){return _0x922df8[_0xbd67('0x26')]()[_0xbd67('0x25')](function(){_0x33fd8c[_0xbd67('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b75dc,_0x5a5227){return function(_0x25bf7a){if(!_0x25bf7a){_0x3b75dc[_0xbd67('0x18')](0x194);}return _0x25bf7a;};}function handleError(_0x144b89,_0x4bbee7){_0x4bbee7=_0x4bbee7||0x1f4;return function(_0x14f5c3){logger[_0xbd67('0x27')](_0x14f5c3['stack']);if(_0x14f5c3[_0xbd67('0x28')]){delete _0x14f5c3[_0xbd67('0x28')];}_0x144b89[_0xbd67('0x19')](_0x4bbee7)[_0xbd67('0x29')](_0x14f5c3);};}exports[_0xbd67('0x2a')]=function(_0x55c2d4,_0x5975dc){var _0x41856b={},_0x310d21={},_0x4675ac={'count':0x0,'rows':[]};var _0x44eced=_[_0xbd67('0x2b')](db[_0xbd67('0x2c')][_0xbd67('0x2d')],function(_0x2e123e){return{'name':_0x2e123e[_0xbd67('0x2e')],'type':_0x2e123e[_0xbd67('0x2f')]['key']};});_0x310d21['model']=_[_0xbd67('0x2b')](_0x44eced,_0xbd67('0x28'));_0x310d21[_0xbd67('0x30')]=_['keys'](_0x55c2d4[_0xbd67('0x30')]);_0x310d21[_0xbd67('0x31')]=_[_0xbd67('0x32')](_0x310d21[_0xbd67('0x33')],_0x310d21['query']);_0x41856b['attributes']=_['intersection'](_0x310d21[_0xbd67('0x33')],qs[_0xbd67('0x34')](_0x55c2d4[_0xbd67('0x30')]['fields']));_0x41856b['attributes']=_0x41856b[_0xbd67('0x35')][_0xbd67('0x36')]?_0x41856b[_0xbd67('0x35')]:_0x310d21[_0xbd67('0x33')];if(!_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x37')]('nolimit')){_0x41856b[_0xbd67('0x1e')]=qs[_0xbd67('0x1e')](_0x55c2d4[_0xbd67('0x30')]['limit']);_0x41856b[_0xbd67('0x1b')]=qs['offset'](_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x1b')]);}_0x41856b['order']=qs[_0xbd67('0x38')](_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x38')]);_0x41856b[_0xbd67('0x39')]=qs[_0xbd67('0x31')](_[_0xbd67('0x3a')](_0x55c2d4['query'],_0x310d21[_0xbd67('0x31')]),_0x44eced);if(_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x3b')]){_0x41856b[_0xbd67('0x39')]=_[_0xbd67('0x3c')](_0x41856b['where'],{'$or':_['map'](_0x44eced,function(_0x363cbe){if(_0x363cbe[_0xbd67('0x2f')]!==_0xbd67('0x3d')){var _0x4f0952={};_0x4f0952[_0x363cbe[_0xbd67('0x28')]]={'$like':'%'+_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x3b')]+'%'};return _0x4f0952;}})});}_0x41856b=_[_0xbd67('0x3c')]({},_0x41856b,_0x55c2d4['options']);var _0x577986={'where':_0x41856b['where']};return db['Cdr']['count'](_0x577986)[_0xbd67('0x25')](function(_0x5a6b2d){_0x4675ac['count']=_0x5a6b2d;if(_0x55c2d4['query'][_0xbd67('0x3e')]){_0x41856b[_0xbd67('0x3f')]=[{'all':!![]}];}return db[_0xbd67('0x2c')][_0xbd67('0x40')](_0x41856b);})['then'](function(_0x41f158){_0x4675ac[_0xbd67('0x41')]=_0x41f158;return _0x4675ac;})[_0xbd67('0x25')](respondWithFilteredResult(_0x5975dc,_0x41856b))[_0xbd67('0x42')](handleError(_0x5975dc,null));};exports[_0xbd67('0x43')]=function(_0x2da4fb,_0x17add8){var _0x532c9b={'raw':!![],'where':{'id':_0x2da4fb['params']['id']}},_0x121146={};_0x121146[_0xbd67('0x33')]=_[_0xbd67('0x44')](db[_0xbd67('0x2c')][_0xbd67('0x2d')]);_0x121146[_0xbd67('0x30')]=_[_0xbd67('0x44')](_0x2da4fb[_0xbd67('0x30')]);_0x121146[_0xbd67('0x31')]=_['intersection'](_0x121146[_0xbd67('0x33')],_0x121146[_0xbd67('0x30')]);_0x532c9b['attributes']=_[_0xbd67('0x32')](_0x121146[_0xbd67('0x33')],qs[_0xbd67('0x34')](_0x2da4fb['query']['fields']));_0x532c9b[_0xbd67('0x35')]=_0x532c9b[_0xbd67('0x35')][_0xbd67('0x36')]?_0x532c9b['attributes']:_0x121146[_0xbd67('0x33')];if(_0x2da4fb[_0xbd67('0x30')]['includeAll']){_0x532c9b['include']=[{'all':!![]}];}_0x532c9b=_['merge']({},_0x532c9b,_0x2da4fb['options']);return db[_0xbd67('0x2c')][_0xbd67('0x45')](_0x532c9b)[_0xbd67('0x25')](handleEntityNotFound(_0x17add8,null))[_0xbd67('0x25')](respondWithResult(_0x17add8,null))[_0xbd67('0x42')](handleError(_0x17add8,null));};exports['create']=function(_0x4543ce,_0x171d86){return db['Cdr'][_0xbd67('0x46')](_0x4543ce[_0xbd67('0x47')],{})[_0xbd67('0x25')](respondWithResult(_0x171d86,0xc9))[_0xbd67('0x42')](handleError(_0x171d86,null));};exports[_0xbd67('0x24')]=function(_0x5ea5cc,_0x29662b){if(_0x5ea5cc['body']['id']){delete _0x5ea5cc[_0xbd67('0x47')]['id'];}return db[_0xbd67('0x2c')]['find']({'where':{'id':_0x5ea5cc[_0xbd67('0x48')]['id']}})[_0xbd67('0x25')](handleEntityNotFound(_0x29662b,null))[_0xbd67('0x25')](saveUpdates(_0x5ea5cc['body'],null))[_0xbd67('0x25')](respondWithResult(_0x29662b,null))[_0xbd67('0x42')](handleError(_0x29662b,null));};exports[_0xbd67('0x26')]=function(_0x79f8ba,_0x42cc5a){return db[_0xbd67('0x2c')][_0xbd67('0x45')]({'where':{'id':_0x79f8ba['params']['id']}})['then'](handleEntityNotFound(_0x42cc5a,null))[_0xbd67('0x25')](removeEntity(_0x42cc5a,null))[_0xbd67('0x42')](handleError(_0x42cc5a,null));};exports[_0xbd67('0x49')]=function(_0x30d66e,_0x3d092){return db['Cdr']['describe']()[_0xbd67('0x25')](respondWithResult(_0x3d092,null))[_0xbd67('0x42')](handleError(_0x3d092,null));};
\ No newline at end of file
+var _0x0309=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','options','includeAll','include','Cdr','rows','catch','params','merge','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x55a1d7,_0x3c53d1){var _0x44ef89=function(_0x423f29){while(--_0x423f29){_0x55a1d7['push'](_0x55a1d7['shift']());}};_0x44ef89(++_0x3c53d1);}(_0x0309,0x165));var _0x9030=function(_0x300483,_0x56ff71){_0x300483=_0x300483-0x0;var _0x33a887=_0x0309[_0x300483];return _0x33a887;};'use strict';var emlformat=require(_0x9030('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9030('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9030('0x2'));var moment=require(_0x9030('0x3'));var BPromise=require(_0x9030('0x4'));var Mustache=require(_0x9030('0x5'));var util=require(_0x9030('0x6'));var path=require(_0x9030('0x7'));var sox=require(_0x9030('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9030('0x9'));var _=require(_0x9030('0xa'));var squel=require('squel');var crypto=require(_0x9030('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9030('0xc'));var toCsv=require(_0x9030('0xd'));var querystring=require(_0x9030('0xe'));var Papa=require('papaparse');var Redis=require(_0x9030('0xf'));var authService=require(_0x9030('0x10'));var qs=require(_0x9030('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9030('0x12'));var logger=require(_0x9030('0x13'))(_0x9030('0x14'));var utils=require(_0x9030('0x15'));var config=require(_0x9030('0x16'));var licenseUtil=require(_0x9030('0x17'));var db=require(_0x9030('0x18'))['db'];function respondWithStatusCode(_0x5ee60f,_0x45e28a){_0x45e28a=_0x45e28a||0xcc;return function(_0x3274c9){if(_0x3274c9){return _0x5ee60f[_0x9030('0x19')](_0x45e28a);}return _0x5ee60f[_0x9030('0x1a')](_0x45e28a)['end']();};}function respondWithResult(_0x28a505,_0x2dc875){_0x2dc875=_0x2dc875||0xc8;return function(_0x4a7465){if(_0x4a7465){return _0x28a505[_0x9030('0x1a')](_0x2dc875)[_0x9030('0x1b')](_0x4a7465);}};}function respondWithFilteredResult(_0x1615ab,_0x111f3b){return function(_0x1776e6){if(_0x1776e6){var _0xfc6f46=typeof _0x111f3b['offset']===_0x9030('0x1c')&&typeof _0x111f3b[_0x9030('0x1d')]===_0x9030('0x1c');var _0x37afac=_0x1776e6[_0x9030('0x1e')];var _0x1327ec=_0xfc6f46?0x0:_0x111f3b[_0x9030('0x1f')];var _0x28c035=_0xfc6f46?_0x1776e6[_0x9030('0x1e')]:_0x111f3b[_0x9030('0x1f')]+_0x111f3b[_0x9030('0x1d')];var _0x41d506;if(_0x28c035>=_0x37afac){_0x28c035=_0x37afac;_0x41d506=0xc8;}else{_0x41d506=0xce;}_0x1615ab[_0x9030('0x1a')](_0x41d506);return _0x1615ab[_0x9030('0x20')](_0x9030('0x21'),_0x1327ec+'-'+_0x28c035+'/'+_0x37afac)[_0x9030('0x1b')](_0x1776e6);}return null;};}function patchUpdates(_0x4105ec){return function(_0x4b0792){try{jsonpatch['apply'](_0x4b0792,_0x4105ec,!![]);}catch(_0x364d58){return BPromise[_0x9030('0x22')](_0x364d58);}return _0x4b0792['save']();};}function saveUpdates(_0x80098d,_0x2d28fd){return function(_0x1f806a){if(_0x1f806a){return _0x1f806a[_0x9030('0x23')](_0x80098d)['then'](function(_0x4753b2){return _0x4753b2;});}return null;};}function removeEntity(_0x51aca8,_0x4c8d4a){return function(_0xe65792){if(_0xe65792){return _0xe65792[_0x9030('0x24')]()[_0x9030('0x25')](function(){_0x51aca8['status'](0xcc)[_0x9030('0x26')]();});}};}function handleEntityNotFound(_0x408ce6,_0x35adfe){return function(_0xce2840){if(!_0xce2840){_0x408ce6[_0x9030('0x19')](0x194);}return _0xce2840;};}function handleError(_0x4d6bf9,_0x5ca691){_0x5ca691=_0x5ca691||0x1f4;return function(_0x455eeb){logger[_0x9030('0x27')](_0x455eeb[_0x9030('0x28')]);if(_0x455eeb[_0x9030('0x29')]){delete _0x455eeb[_0x9030('0x29')];}_0x4d6bf9[_0x9030('0x1a')](_0x5ca691)[_0x9030('0x2a')](_0x455eeb);};}exports[_0x9030('0x2b')]=function(_0x11c47d,_0x3be936){var _0x1d0c5c={},_0x528f75={},_0x18de34={'count':0x0,'rows':[]};var _0x584013=_[_0x9030('0x2c')](db['Cdr'][_0x9030('0x2d')],function(_0x5b745a){return{'name':_0x5b745a[_0x9030('0x2e')],'type':_0x5b745a[_0x9030('0x2f')][_0x9030('0x30')]};});_0x528f75['model']=_[_0x9030('0x2c')](_0x584013,_0x9030('0x29'));_0x528f75[_0x9030('0x31')]=_[_0x9030('0x32')](_0x11c47d[_0x9030('0x31')]);_0x528f75[_0x9030('0x33')]=_[_0x9030('0x34')](_0x528f75[_0x9030('0x35')],_0x528f75[_0x9030('0x31')]);_0x1d0c5c[_0x9030('0x36')]=_[_0x9030('0x34')](_0x528f75[_0x9030('0x35')],qs[_0x9030('0x37')](_0x11c47d[_0x9030('0x31')][_0x9030('0x37')]));_0x1d0c5c[_0x9030('0x36')]=_0x1d0c5c[_0x9030('0x36')][_0x9030('0x38')]?_0x1d0c5c['attributes']:_0x528f75['model'];if(!_0x11c47d[_0x9030('0x31')][_0x9030('0x39')]('nolimit')){_0x1d0c5c['limit']=qs[_0x9030('0x1d')](_0x11c47d[_0x9030('0x31')][_0x9030('0x1d')]);_0x1d0c5c[_0x9030('0x1f')]=qs['offset'](_0x11c47d[_0x9030('0x31')]['offset']);}_0x1d0c5c[_0x9030('0x3a')]=qs[_0x9030('0x3b')](_0x11c47d['query'][_0x9030('0x3b')]);_0x1d0c5c[_0x9030('0x3c')]=qs[_0x9030('0x33')](_['pick'](_0x11c47d[_0x9030('0x31')],_0x528f75['filters']),_0x584013);if(_0x11c47d[_0x9030('0x31')]['filter']){_0x1d0c5c[_0x9030('0x3c')]=_['merge'](_0x1d0c5c[_0x9030('0x3c')],{'$or':_[_0x9030('0x2c')](_0x584013,function(_0x3dc670){if(_0x3dc670[_0x9030('0x2f')]!==_0x9030('0x3d')){var _0x151d64={};_0x151d64[_0x3dc670[_0x9030('0x29')]]={'$like':'%'+_0x11c47d[_0x9030('0x31')][_0x9030('0x3e')]+'%'};return _0x151d64;}})});}_0x1d0c5c=_['merge']({},_0x1d0c5c,_0x11c47d[_0x9030('0x3f')]);var _0x209aca={'where':_0x1d0c5c[_0x9030('0x3c')]};return db['Cdr'][_0x9030('0x1e')](_0x209aca)[_0x9030('0x25')](function(_0x3ebb74){_0x18de34[_0x9030('0x1e')]=_0x3ebb74;if(_0x11c47d['query'][_0x9030('0x40')]){_0x1d0c5c[_0x9030('0x41')]=[{'all':!![]}];}return db[_0x9030('0x42')]['findAll'](_0x1d0c5c);})[_0x9030('0x25')](function(_0xa6a5ba){_0x18de34[_0x9030('0x43')]=_0xa6a5ba;return _0x18de34;})[_0x9030('0x25')](respondWithFilteredResult(_0x3be936,_0x1d0c5c))[_0x9030('0x44')](handleError(_0x3be936,null));};exports['show']=function(_0x58a351,_0x4c7272){var _0x2b596c={'raw':!![],'where':{'id':_0x58a351[_0x9030('0x45')]['id']}},_0x291eab={};_0x291eab[_0x9030('0x35')]=_[_0x9030('0x32')](db[_0x9030('0x42')][_0x9030('0x2d')]);_0x291eab[_0x9030('0x31')]=_['keys'](_0x58a351[_0x9030('0x31')]);_0x291eab[_0x9030('0x33')]=_[_0x9030('0x34')](_0x291eab[_0x9030('0x35')],_0x291eab[_0x9030('0x31')]);_0x2b596c[_0x9030('0x36')]=_[_0x9030('0x34')](_0x291eab[_0x9030('0x35')],qs[_0x9030('0x37')](_0x58a351[_0x9030('0x31')][_0x9030('0x37')]));_0x2b596c[_0x9030('0x36')]=_0x2b596c[_0x9030('0x36')][_0x9030('0x38')]?_0x2b596c['attributes']:_0x291eab[_0x9030('0x35')];if(_0x58a351[_0x9030('0x31')]['includeAll']){_0x2b596c[_0x9030('0x41')]=[{'all':!![]}];}_0x2b596c=_[_0x9030('0x46')]({},_0x2b596c,_0x58a351[_0x9030('0x3f')]);return db['Cdr']['find'](_0x2b596c)[_0x9030('0x25')](handleEntityNotFound(_0x4c7272,null))['then'](respondWithResult(_0x4c7272,null))['catch'](handleError(_0x4c7272,null));};exports[_0x9030('0x47')]=function(_0x35a574,_0x2b3e41){return db[_0x9030('0x42')]['create'](_0x35a574[_0x9030('0x48')],{})['then'](respondWithResult(_0x2b3e41,0xc9))[_0x9030('0x44')](handleError(_0x2b3e41,null));};exports[_0x9030('0x23')]=function(_0x42c414,_0x513ee4){if(_0x42c414[_0x9030('0x48')]['id']){delete _0x42c414[_0x9030('0x48')]['id'];}return db[_0x9030('0x42')]['find']({'where':{'id':_0x42c414[_0x9030('0x45')]['id']}})[_0x9030('0x25')](handleEntityNotFound(_0x513ee4,null))['then'](saveUpdates(_0x42c414[_0x9030('0x48')],null))['then'](respondWithResult(_0x513ee4,null))[_0x9030('0x44')](handleError(_0x513ee4,null));};exports['destroy']=function(_0x2a39ad,_0xfec731){return db[_0x9030('0x42')][_0x9030('0x49')]({'where':{'id':_0x2a39ad[_0x9030('0x45')]['id']}})[_0x9030('0x25')](handleEntityNotFound(_0xfec731,null))['then'](removeEntity(_0xfec731,null))[_0x9030('0x44')](handleError(_0xfec731,null));};exports[_0x9030('0x4a')]=function(_0x15347c,_0xe80a0b){return db[_0x9030('0x42')]['describe']()['then'](respondWithResult(_0xe80a0b,null))[_0x9030('0x44')](handleError(_0xe80a0b,null));};
\ No newline at end of file
index 1cd1df8..3b88cfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xab6758,_0x1b16e6){var _0x41b7b2=function(_0x28624b){while(--_0x28624b){_0xab6758['push'](_0xab6758['shift']());}};_0x41b7b2(++_0x1b16e6);}(_0x7a54,0x106));var _0x47a5=function(_0x2ab489,_0xda1354){_0x2ab489=_0x2ab489-0x0;var _0x4ce02c=_0x7a54[_0x2ab489];return _0x4ce02c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2ad000,_0x2af481){var _0x730757=function(_0x376a9d){while(--_0x376a9d){_0x2ad000['push'](_0x2ad000['shift']());}};_0x730757(++_0x2af481);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
index c09a498..3900205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d87=['Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x6d87,0xf5));var _0x76d8=function(_0x4287ae,_0x14e6d5){_0x4287ae=_0x4287ae-0x0;var _0x2ba072=_0x6d87[_0x4287ae];return _0x2ba072;};'use strict';var _=require(_0x76d8('0x0'));var util=require(_0x76d8('0x1'));var moment=require('moment');var BPromise=require(_0x76d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x76d8('0x3'));var logger=require(_0x76d8('0x4'))('rpc');var config=require(_0x76d8('0x5'));var jayson=require(_0x76d8('0x6'));var client=jayson['client'][_0x76d8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x29f0f9,_0x3c000e,_0x409c59){return new BPromise(function(_0x4de320,_0x59ba20){return client[_0x76d8('0x8')](_0x29f0f9,_0x409c59)['then'](function(_0xd0c778){logger[_0x76d8('0x9')](_0x76d8('0xa'),_0x3c000e,_0x76d8('0xb'));logger['debug'](_0x76d8('0xc'),_0x3c000e,'request\x20sent',JSON['stringify'](_0xd0c778));if(_0xd0c778[_0x76d8('0xd')]){if(_0xd0c778[_0x76d8('0xd')][_0x76d8('0xe')]===0x1f4){logger['error'](_0x76d8('0xa'),_0x3c000e,_0xd0c778[_0x76d8('0xd')]['message']);return _0x59ba20(_0xd0c778[_0x76d8('0xd')][_0x76d8('0xf')]);}logger[_0x76d8('0xd')](_0x76d8('0xa'),_0x3c000e,_0xd0c778['error'][_0x76d8('0xf')]);return _0x4de320(_0xd0c778[_0x76d8('0xd')]['message']);}else{logger['info'](_0x76d8('0xa'),_0x3c000e,_0x76d8('0xb'));_0x4de320(_0xd0c778['result'][_0x76d8('0xf')]);}})[_0x76d8('0x10')](function(_0x709e7){logger[_0x76d8('0xd')]('Cdr,\x20%s,\x20%s',_0x3c000e,_0x709e7);_0x59ba20(_0x709e7);});});}
\ No newline at end of file
+var _0x7d71=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0x7d71,0xe3));var _0x17d7=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x7d71[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0x17d7('0x0'));var util=require('util');var moment=require(_0x17d7('0x1'));var BPromise=require('bluebird');var rs=require(_0x17d7('0x2'));var fs=require('fs');var Redis=require(_0x17d7('0x3'));var db=require(_0x17d7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x17d7('0x5'))(_0x17d7('0x6'));var config=require(_0x17d7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x17d7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a69fa,_0x251ada,_0x5c0241){return new BPromise(function(_0x4506ad,_0x12baa1){return client[_0x17d7('0x9')](_0x2a69fa,_0x5c0241)[_0x17d7('0xa')](function(_0x1f3aea){logger[_0x17d7('0xb')](_0x17d7('0xc'),_0x251ada,'request\x20sent');logger[_0x17d7('0xd')](_0x17d7('0xe'),_0x251ada,'request\x20sent',JSON[_0x17d7('0xf')](_0x1f3aea));if(_0x1f3aea['error']){if(_0x1f3aea[_0x17d7('0x10')]['code']===0x1f4){logger[_0x17d7('0x10')](_0x17d7('0xc'),_0x251ada,_0x1f3aea[_0x17d7('0x10')][_0x17d7('0x11')]);return _0x12baa1(_0x1f3aea[_0x17d7('0x10')][_0x17d7('0x11')]);}logger[_0x17d7('0x10')](_0x17d7('0xc'),_0x251ada,_0x1f3aea[_0x17d7('0x10')]['message']);return _0x4506ad(_0x1f3aea[_0x17d7('0x10')][_0x17d7('0x11')]);}else{logger[_0x17d7('0xb')](_0x17d7('0xc'),_0x251ada,_0x17d7('0x12'));_0x4506ad(_0x1f3aea[_0x17d7('0x13')]['message']);}})[_0x17d7('0x14')](function(_0x5f02c4){logger[_0x17d7('0x10')](_0x17d7('0xc'),_0x251ada,_0x5f02c4);_0x12baa1(_0x5f02c4);});});}
\ No newline at end of file
index f625399..cc3dec7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x329905,_0x13c144){var _0x3aa42=function(_0x2fac43){while(--_0x2fac43){_0x329905['push'](_0x329905['shift']());}};_0x3aa42(++_0x13c144);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
index b35919e..3f47bff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd44c=['STRING','noop','*,*,*,*','sequelize'];(function(_0x5e8c7c,_0x3429c6){var _0x48f7bd=function(_0x2b8a0f){while(--_0x2b8a0f){_0x5e8c7c['push'](_0x5e8c7c['shift']());}};_0x48f7bd(++_0x3429c6);}(_0xd44c,0xb7));var _0xcd44=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0xd44c[_0x349148];return _0x2f2b0f;};'use strict';var Sequelize=require(_0xcd44('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xcd44('0x1')],'allowNull':![],'defaultValue':_0xcd44('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcd44('0x1')]},'interval':{'type':Sequelize[_0xcd44('0x1')],'defaultValue':_0xcd44('0x3')}};
\ No newline at end of file
+var _0x1d8c=['sequelize','STRING','noop'];(function(_0x1534f7,_0x342724){var _0x7252b1=function(_0x191991){while(--_0x191991){_0x1534f7['push'](_0x1534f7['shift']());}};_0x7252b1(++_0x342724);}(_0x1d8c,0x1d1));var _0xc1d8=function(_0x56b3c4,_0x37750b){_0x56b3c4=_0x56b3c4-0x0;var _0x4db89b=_0x1d8c[_0x56b3c4];return _0x4db89b;};'use strict';var Sequelize=require(_0xc1d8('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc1d8('0x1')],'allowNull':![],'defaultValue':_0xc1d8('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index c093bf5..c4ee42c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ca7=['path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','show','params','model','keys','intersection','query','attributes','fields','includeAll','include','merge','options','ChatApplication','catch','update','body','find','eml-format','rimraf','moment','bluebird','mustache'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0x1ca7,0x157));var _0x71ca=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x1ca7[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x71ca('0x0'));var rimraf=require(_0x71ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x71ca('0x2'));var BPromise=require(_0x71ca('0x3'));var Mustache=require(_0x71ca('0x4'));var util=require('util');var path=require(_0x71ca('0x5'));var sox=require(_0x71ca('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71ca('0x7'));var _=require(_0x71ca('0x8'));var squel=require(_0x71ca('0x9'));var crypto=require(_0x71ca('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x71ca('0xb'));var toCsv=require(_0x71ca('0xc'));var querystring=require('querystring');var Papa=require(_0x71ca('0xd'));var Redis=require(_0x71ca('0xe'));var authService=require(_0x71ca('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x71ca('0x10'));var hardwareService=require(_0x71ca('0x11'));var logger=require(_0x71ca('0x12'))(_0x71ca('0x13'));var utils=require(_0x71ca('0x14'));var config=require(_0x71ca('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x71ca('0x16'))['db'];function respondWithStatusCode(_0x1654d3,_0x4da234){_0x4da234=_0x4da234||0xcc;return function(_0x230345){if(_0x230345){return _0x1654d3[_0x71ca('0x17')](_0x4da234);}return _0x1654d3[_0x71ca('0x18')](_0x4da234)[_0x71ca('0x19')]();};}function respondWithResult(_0x37bc79,_0x393db8){_0x393db8=_0x393db8||0xc8;return function(_0x2a38af){if(_0x2a38af){return _0x37bc79[_0x71ca('0x18')](_0x393db8)[_0x71ca('0x1a')](_0x2a38af);}};}function respondWithFilteredResult(_0x3a2b30,_0x505f8e){return function(_0x4b65de){if(_0x4b65de){var _0x3f206d=typeof _0x505f8e['offset']===_0x71ca('0x1b')&&typeof _0x505f8e[_0x71ca('0x1c')]==='undefined';var _0x4c71e3=_0x4b65de[_0x71ca('0x1d')];var _0x4d43b1=_0x3f206d?0x0:_0x505f8e[_0x71ca('0x1e')];var _0x2c2347=_0x3f206d?_0x4b65de[_0x71ca('0x1d')]:_0x505f8e[_0x71ca('0x1e')]+_0x505f8e['limit'];var _0x4c92e8;if(_0x2c2347>=_0x4c71e3){_0x2c2347=_0x4c71e3;_0x4c92e8=0xc8;}else{_0x4c92e8=0xce;}_0x3a2b30['status'](_0x4c92e8);return _0x3a2b30[_0x71ca('0x1f')](_0x71ca('0x20'),_0x4d43b1+'-'+_0x2c2347+'/'+_0x4c71e3)[_0x71ca('0x1a')](_0x4b65de);}return null;};}function patchUpdates(_0x257ab1){return function(_0x363fb5){try{jsonpatch[_0x71ca('0x21')](_0x363fb5,_0x257ab1,!![]);}catch(_0x459359){return BPromise[_0x71ca('0x22')](_0x459359);}return _0x363fb5[_0x71ca('0x23')]();};}function saveUpdates(_0x1f0140,_0x5a501f){return function(_0x48692c){if(_0x48692c){return _0x48692c['update'](_0x1f0140)[_0x71ca('0x24')](function(_0x47a5ee){return _0x47a5ee;});}return null;};}function removeEntity(_0x4fa46e,_0x1015c0){return function(_0x2e2e22){if(_0x2e2e22){return _0x2e2e22[_0x71ca('0x25')]()[_0x71ca('0x24')](function(){_0x4fa46e[_0x71ca('0x18')](0xcc)[_0x71ca('0x19')]();});}};}function handleEntityNotFound(_0x5d4504,_0x106f65){return function(_0x35f577){if(!_0x35f577){_0x5d4504[_0x71ca('0x17')](0x194);}return _0x35f577;};}function handleError(_0x400ebb,_0xddd38a){_0xddd38a=_0xddd38a||0x1f4;return function(_0x35c857){logger[_0x71ca('0x26')](_0x35c857['stack']);if(_0x35c857[_0x71ca('0x27')]){delete _0x35c857[_0x71ca('0x27')];}_0x400ebb[_0x71ca('0x18')](_0xddd38a)[_0x71ca('0x28')](_0x35c857);};}exports[_0x71ca('0x29')]=function(_0x30deeb,_0x991bc){var _0x5f2367={'raw':!![],'where':{'id':_0x30deeb[_0x71ca('0x2a')]['id']}},_0x53562d={};_0x53562d[_0x71ca('0x2b')]=_[_0x71ca('0x2c')](db['ChatApplication']['rawAttributes']);_0x53562d['query']=_[_0x71ca('0x2c')](_0x30deeb['query']);_0x53562d['filters']=_[_0x71ca('0x2d')](_0x53562d['model'],_0x53562d[_0x71ca('0x2e')]);_0x5f2367[_0x71ca('0x2f')]=_[_0x71ca('0x2d')](_0x53562d['model'],qs[_0x71ca('0x30')](_0x30deeb[_0x71ca('0x2e')][_0x71ca('0x30')]));_0x5f2367[_0x71ca('0x2f')]=_0x5f2367[_0x71ca('0x2f')]['length']?_0x5f2367[_0x71ca('0x2f')]:_0x53562d[_0x71ca('0x2b')];if(_0x30deeb[_0x71ca('0x2e')][_0x71ca('0x31')]){_0x5f2367[_0x71ca('0x32')]=[{'all':!![]}];}_0x5f2367=_[_0x71ca('0x33')]({},_0x5f2367,_0x30deeb[_0x71ca('0x34')]);return db[_0x71ca('0x35')]['find'](_0x5f2367)['then'](handleEntityNotFound(_0x991bc,null))[_0x71ca('0x24')](respondWithResult(_0x991bc,null))[_0x71ca('0x36')](handleError(_0x991bc,null));};exports[_0x71ca('0x37')]=function(_0x2b049d,_0x5bdeda){if(_0x2b049d[_0x71ca('0x38')]['id']){delete _0x2b049d[_0x71ca('0x38')]['id'];}return db[_0x71ca('0x35')]['find']({'where':{'id':_0x2b049d[_0x71ca('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5bdeda,null))[_0x71ca('0x24')](saveUpdates(_0x2b049d[_0x71ca('0x38')],null))[_0x71ca('0x24')](respondWithResult(_0x5bdeda,null))[_0x71ca('0x36')](handleError(_0x5bdeda,null));};exports[_0x71ca('0x25')]=function(_0x16de9e,_0xd389bd){return db[_0x71ca('0x35')][_0x71ca('0x39')]({'where':{'id':_0x16de9e[_0x71ca('0x2a')]['id']}})[_0x71ca('0x24')](handleEntityNotFound(_0xd389bd,null))['then'](removeEntity(_0xd389bd,null))[_0x71ca('0x36')](handleError(_0xd389bd,null));};
\ No newline at end of file
+var _0x33d2=['fields','length','includeAll','merge','options','find','catch','body','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','show','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33d2,0x7f));var _0x233d=function(_0x4965d1,_0xb546d4){_0x4965d1=_0x4965d1-0x0;var _0x59e849=_0x33d2[_0x4965d1];return _0x59e849;};'use strict';var emlformat=require(_0x233d('0x0'));var rimraf=require(_0x233d('0x1'));var zipdir=require(_0x233d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x233d('0x3'));var moment=require(_0x233d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x233d('0x5'));var util=require(_0x233d('0x6'));var path=require(_0x233d('0x7'));var sox=require(_0x233d('0x8'));var csv=require(_0x233d('0x9'));var ejs=require(_0x233d('0xa'));var fs=require('fs');var fs_extra=require(_0x233d('0xb'));var _=require(_0x233d('0xc'));var squel=require('squel');var crypto=require(_0x233d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x233d('0xe'));var toCsv=require(_0x233d('0x9'));var querystring=require(_0x233d('0xf'));var Papa=require('papaparse');var Redis=require(_0x233d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x233d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x233d('0x12'));var logger=require(_0x233d('0x13'))(_0x233d('0x14'));var utils=require('../../config/utils');var config=require(_0x233d('0x15'));var licenseUtil=require(_0x233d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d36d3,_0x19f04c){_0x19f04c=_0x19f04c||0xcc;return function(_0x51c461){if(_0x51c461){return _0x2d36d3[_0x233d('0x17')](_0x19f04c);}return _0x2d36d3[_0x233d('0x18')](_0x19f04c)[_0x233d('0x19')]();};}function respondWithResult(_0x50a166,_0x36627d){_0x36627d=_0x36627d||0xc8;return function(_0x294703){if(_0x294703){return _0x50a166[_0x233d('0x18')](_0x36627d)[_0x233d('0x1a')](_0x294703);}};}function respondWithFilteredResult(_0xda6da2,_0x59b818){return function(_0xd7624c){if(_0xd7624c){var _0x552bbd=typeof _0x59b818[_0x233d('0x1b')]===_0x233d('0x1c')&&typeof _0x59b818[_0x233d('0x1d')]===_0x233d('0x1c');var _0x2b5bb0=_0xd7624c['count'];var _0x4f96c8=_0x552bbd?0x0:_0x59b818[_0x233d('0x1b')];var _0x409637=_0x552bbd?_0xd7624c[_0x233d('0x1e')]:_0x59b818[_0x233d('0x1b')]+_0x59b818[_0x233d('0x1d')];var _0x1b70da;if(_0x409637>=_0x2b5bb0){_0x409637=_0x2b5bb0;_0x1b70da=0xc8;}else{_0x1b70da=0xce;}_0xda6da2[_0x233d('0x18')](_0x1b70da);return _0xda6da2[_0x233d('0x1f')](_0x233d('0x20'),_0x4f96c8+'-'+_0x409637+'/'+_0x2b5bb0)[_0x233d('0x1a')](_0xd7624c);}return null;};}function patchUpdates(_0x3fa180){return function(_0x3ff3e3){try{jsonpatch[_0x233d('0x21')](_0x3ff3e3,_0x3fa180,!![]);}catch(_0x5aa707){return BPromise[_0x233d('0x22')](_0x5aa707);}return _0x3ff3e3[_0x233d('0x23')]();};}function saveUpdates(_0x5dd0e0,_0x12f8e8){return function(_0x19f575){if(_0x19f575){return _0x19f575[_0x233d('0x24')](_0x5dd0e0)[_0x233d('0x25')](function(_0x4f4c2a){return _0x4f4c2a;});}return null;};}function removeEntity(_0xe38aea,_0x19749f){return function(_0x3c3cba){if(_0x3c3cba){return _0x3c3cba[_0x233d('0x26')]()[_0x233d('0x25')](function(){_0xe38aea[_0x233d('0x18')](0xcc)[_0x233d('0x19')]();});}};}function handleEntityNotFound(_0x586f62,_0x517d61){return function(_0x507b5a){if(!_0x507b5a){_0x586f62['sendStatus'](0x194);}return _0x507b5a;};}function handleError(_0x24087a,_0x14cda3){_0x14cda3=_0x14cda3||0x1f4;return function(_0x1609ed){logger['error'](_0x1609ed[_0x233d('0x27')]);if(_0x1609ed[_0x233d('0x28')]){delete _0x1609ed[_0x233d('0x28')];}_0x24087a[_0x233d('0x18')](_0x14cda3)['send'](_0x1609ed);};}exports[_0x233d('0x29')]=function(_0xf10fbe,_0x3db64c){var _0x332962={'raw':!![],'where':{'id':_0xf10fbe['params']['id']}},_0x23f4a0={};_0x23f4a0['model']=_[_0x233d('0x2a')](db[_0x233d('0x2b')][_0x233d('0x2c')]);_0x23f4a0[_0x233d('0x2d')]=_[_0x233d('0x2a')](_0xf10fbe[_0x233d('0x2d')]);_0x23f4a0[_0x233d('0x2e')]=_[_0x233d('0x2f')](_0x23f4a0[_0x233d('0x30')],_0x23f4a0['query']);_0x332962[_0x233d('0x31')]=_[_0x233d('0x2f')](_0x23f4a0[_0x233d('0x30')],qs['fields'](_0xf10fbe['query'][_0x233d('0x32')]));_0x332962['attributes']=_0x332962['attributes'][_0x233d('0x33')]?_0x332962[_0x233d('0x31')]:_0x23f4a0[_0x233d('0x30')];if(_0xf10fbe[_0x233d('0x2d')][_0x233d('0x34')]){_0x332962['include']=[{'all':!![]}];}_0x332962=_[_0x233d('0x35')]({},_0x332962,_0xf10fbe[_0x233d('0x36')]);return db[_0x233d('0x2b')][_0x233d('0x37')](_0x332962)['then'](handleEntityNotFound(_0x3db64c,null))[_0x233d('0x25')](respondWithResult(_0x3db64c,null))[_0x233d('0x38')](handleError(_0x3db64c,null));};exports[_0x233d('0x24')]=function(_0xa82d72,_0x116578){if(_0xa82d72[_0x233d('0x39')]['id']){delete _0xa82d72[_0x233d('0x39')]['id'];}return db[_0x233d('0x2b')][_0x233d('0x37')]({'where':{'id':_0xa82d72[_0x233d('0x3a')]['id']}})[_0x233d('0x25')](handleEntityNotFound(_0x116578,null))[_0x233d('0x25')](saveUpdates(_0xa82d72[_0x233d('0x39')],null))[_0x233d('0x25')](respondWithResult(_0x116578,null))[_0x233d('0x38')](handleError(_0x116578,null));};exports[_0x233d('0x26')]=function(_0x573921,_0x5ec9a3){return db[_0x233d('0x2b')][_0x233d('0x37')]({'where':{'id':_0x573921[_0x233d('0x3a')]['id']}})[_0x233d('0x25')](handleEntityNotFound(_0x5ec9a3,null))[_0x233d('0x25')](removeEntity(_0x5ec9a3,null))[_0x233d('0x38')](handleError(_0x5ec9a3,null));};
\ No newline at end of file
index 7c67847..b634e89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c91=['utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','define','chat_applications'];(function(_0x63339f,_0x2527bd){var _0x209994=function(_0x2b5aa9){while(--_0x2b5aa9){_0x63339f['push'](_0x63339f['shift']());}};_0x209994(++_0x2527bd);}(_0x4c91,0x161));var _0x14c9=function(_0x1e01d2,_0x51578f){_0x1e01d2=_0x1e01d2-0x0;var _0xcfe8d2=_0x4c91[_0x1e01d2];return _0xcfe8d2;};'use strict';var _=require(_0x14c9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x14c9('0x1'));var moment=require(_0x14c9('0x2'));var BPromise=require(_0x14c9('0x3'));var rp=require(_0x14c9('0x4'));var fs=require('fs');var path=require(_0x14c9('0x5'));var rimraf=require(_0x14c9('0x6'));var config=require('../../config/environment');var attributes=require(_0x14c9('0x7'));module[_0x14c9('0x8')]=function(_0x2aadf3,_0x3721bf){return _0x2aadf3[_0x14c9('0x9')]('ChatApplication',attributes,{'tableName':_0x14c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x14c9('0xb'),'collate':_0x14c9('0xc')});};
\ No newline at end of file
+var _0x1b12=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1b12,0x1b6));var _0x21b1=function(_0x56dade,_0x442c33){_0x56dade=_0x56dade-0x0;var _0x53b6c6=_0x1b12[_0x56dade];return _0x53b6c6;};'use strict';var _=require(_0x21b1('0x0'));var util=require('util');var logger=require(_0x21b1('0x1'))(_0x21b1('0x2'));var moment=require(_0x21b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x21b1('0x4'));var fs=require('fs');var path=require(_0x21b1('0x5'));var rimraf=require(_0x21b1('0x6'));var config=require(_0x21b1('0x7'));var attributes=require('./chatApplication.attributes');module[_0x21b1('0x8')]=function(_0x16ab91,_0x34ed01){return _0x16ab91[_0x21b1('0x9')](_0x21b1('0xa'),attributes,{'tableName':_0x21b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x21b1('0xc'),'collate':_0x21b1('0xd')});};
\ No newline at end of file
index 6303141..d45e101 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aaa=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x2d71f0,_0x3bd5cd){var _0x157e69=function(_0x5306b2){while(--_0x5306b2){_0x2d71f0['push'](_0x2d71f0['shift']());}};_0x157e69(++_0x3bd5cd);}(_0x3aaa,0x176));var _0xa3aa=function(_0x6ad841,_0x4e70d0){_0x6ad841=_0x6ad841-0x0;var _0x11c4e3=_0x3aaa[_0x6ad841];return _0x11c4e3;};'use strict';var _=require('lodash');var util=require(_0xa3aa('0x0'));var moment=require(_0xa3aa('0x1'));var BPromise=require('bluebird');var rs=require(_0xa3aa('0x2'));var fs=require('fs');var Redis=require(_0xa3aa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3aa('0x4'));var logger=require('../../config/logger')(_0xa3aa('0x5'));var config=require(_0xa3aa('0x6'));var jayson=require(_0xa3aa('0x7'));var client=jayson[_0xa3aa('0x8')][_0xa3aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf07d,_0x214306,_0x446abe){return new BPromise(function(_0x92ae9e,_0x147dd3){return client['request'](_0x3bf07d,_0x446abe)['then'](function(_0x50bb66){logger[_0xa3aa('0xa')](_0xa3aa('0xb'),_0x214306,'request\x20sent');logger[_0xa3aa('0xc')](_0xa3aa('0xd'),_0x214306,_0xa3aa('0xe'),JSON[_0xa3aa('0xf')](_0x50bb66));if(_0x50bb66[_0xa3aa('0x10')]){if(_0x50bb66[_0xa3aa('0x10')][_0xa3aa('0x11')]===0x1f4){logger[_0xa3aa('0x10')](_0xa3aa('0xb'),_0x214306,_0x50bb66[_0xa3aa('0x10')]['message']);return _0x147dd3(_0x50bb66['error'][_0xa3aa('0x12')]);}logger[_0xa3aa('0x10')]('ChatApplication,\x20%s,\x20%s',_0x214306,_0x50bb66[_0xa3aa('0x10')][_0xa3aa('0x12')]);return _0x92ae9e(_0x50bb66[_0xa3aa('0x10')]['message']);}else{logger[_0xa3aa('0xa')](_0xa3aa('0xb'),_0x214306,_0xa3aa('0xe'));_0x92ae9e(_0x50bb66[_0xa3aa('0x13')][_0xa3aa('0x12')]);}})[_0xa3aa('0x14')](function(_0x18586c){logger[_0xa3aa('0x10')](_0xa3aa('0xb'),_0x214306,_0x18586c);_0x147dd3(_0x18586c);});});}
\ No newline at end of file
+var _0x3a55=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a55,0x172));var _0x53a5=function(_0x3503c9,_0x29651c){_0x3503c9=_0x3503c9-0x0;var _0x41a65a=_0x3a55[_0x3503c9];return _0x41a65a;};'use strict';var _=require(_0x53a5('0x0'));var util=require(_0x53a5('0x1'));var moment=require('moment');var BPromise=require(_0x53a5('0x2'));var rs=require(_0x53a5('0x3'));var fs=require('fs');var Redis=require(_0x53a5('0x4'));var db=require(_0x53a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x53a5('0x6'));var config=require(_0x53a5('0x7'));var jayson=require(_0x53a5('0x8'));var client=jayson[_0x53a5('0x9')][_0x53a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x404a47,_0x561d09,_0x55c41b){return new BPromise(function(_0x54fcfe,_0x322939){return client[_0x53a5('0xb')](_0x404a47,_0x55c41b)[_0x53a5('0xc')](function(_0x43b1e0){logger['info'](_0x53a5('0xd'),_0x561d09,'request\x20sent');logger[_0x53a5('0xe')](_0x53a5('0xf'),_0x561d09,_0x53a5('0x10'),JSON['stringify'](_0x43b1e0));if(_0x43b1e0[_0x53a5('0x11')]){if(_0x43b1e0[_0x53a5('0x11')][_0x53a5('0x12')]===0x1f4){logger[_0x53a5('0x11')](_0x53a5('0xd'),_0x561d09,_0x43b1e0[_0x53a5('0x11')][_0x53a5('0x13')]);return _0x322939(_0x43b1e0[_0x53a5('0x11')][_0x53a5('0x13')]);}logger[_0x53a5('0x11')](_0x53a5('0xd'),_0x561d09,_0x43b1e0[_0x53a5('0x11')]['message']);return _0x54fcfe(_0x43b1e0[_0x53a5('0x11')]['message']);}else{logger[_0x53a5('0x14')](_0x53a5('0xd'),_0x561d09,_0x53a5('0x10'));_0x54fcfe(_0x43b1e0[_0x53a5('0x15')][_0x53a5('0x13')]);}})[_0x53a5('0x16')](function(_0xcfbc43){logger[_0x53a5('0x11')]('ChatApplication,\x20%s,\x20%s',_0x561d09,_0xcfbc43);_0x322939(_0xcfbc43);});});}
\ No newline at end of file
index 5e1cde5..dfd1531 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x527e=['../../config/environment','get','/:id','isAuthenticated','show','put','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3a642c,_0x46a6e9){var _0x488ccb=function(_0x2b894f){while(--_0x2b894f){_0x3a642c['push'](_0x3a642c['shift']());}};_0x488ccb(++_0x46a6e9);}(_0x527e,0x1ba));var _0xe527=function(_0xe7ba73,_0x1a1dd3){_0xe7ba73=_0xe7ba73-0x0;var _0x9bfee0=_0x527e[_0xe7ba73];return _0x9bfee0;};'use strict';var multer=require('multer');var util=require(_0xe527('0x0'));var path=require('path');var timeout=require(_0xe527('0x1'));var express=require('express');var router=express[_0xe527('0x2')]();var fs_extra=require(_0xe527('0x3'));var auth=require(_0xe527('0x4'));var interaction=require(_0xe527('0x5'));var config=require(_0xe527('0x6'));var controller=require('./chatApplication.controller');router[_0xe527('0x7')](_0xe527('0x8'),auth[_0xe527('0x9')](),controller[_0xe527('0xa')]);router[_0xe527('0xb')](_0xe527('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xe527('0xc')](_0xe527('0x8'),auth[_0xe527('0x9')](),controller[_0xe527('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x6573=['show','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x10a68c,_0x576de9){var _0x28fa99=function(_0x38af15){while(--_0x38af15){_0x10a68c['push'](_0x10a68c['shift']());}};_0x28fa99(++_0x576de9);}(_0x6573,0xf6));var _0x3657=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6573[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x3657('0x0'));var path=require('path');var timeout=require(_0x3657('0x1'));var express=require(_0x3657('0x2'));var router=express['Router']();var fs_extra=require(_0x3657('0x3'));var auth=require(_0x3657('0x4'));var interaction=require(_0x3657('0x5'));var config=require('../../config/environment');var controller=require(_0x3657('0x6'));router[_0x3657('0x7')](_0x3657('0x8'),auth[_0x3657('0x9')](),controller[_0x3657('0xa')]);router[_0x3657('0xb')](_0x3657('0x8'),auth[_0x3657('0x9')](),controller[_0x3657('0xc')]);router[_0x3657('0xd')](_0x3657('0x8'),auth[_0x3657('0x9')](),controller[_0x3657('0xe')]);module[_0x3657('0xf')]=router;
\ No newline at end of file
index 0df29fb..999674b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86b8=['BOOLEAN','sequelize','exports','STRING'];(function(_0x52d762,_0x4a83c5){var _0x570afb=function(_0x58ae56){while(--_0x58ae56){_0x52d762['push'](_0x52d762['shift']());}};_0x570afb(++_0x4a83c5);}(_0x86b8,0x15d));var _0x886b=function(_0x5a83ec,_0x325915){_0x5a83ec=_0x5a83ec-0x0;var _0x128e5b=_0x86b8[_0x5a83ec];return _0x128e5b;};'use strict';var Sequelize=require(_0x886b('0x0'));module[_0x886b('0x1')]={'name':{'type':Sequelize[_0x886b('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x886b('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2cc4=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5d0594,_0x3d8ede){var _0x179e9a=function(_0x149b4e){while(--_0x149b4e){_0x5d0594['push'](_0x5d0594['shift']());}};_0x179e9a(++_0x3d8ede);}(_0x2cc4,0xdd));var _0x42cc=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x2cc4[_0x3511d3];return _0x5d6321;};'use strict';var Sequelize=require(_0x42cc('0x0'));module[_0x42cc('0x1')]={'name':{'type':Sequelize[_0x42cc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x42cc('0x2')]},'write':{'type':Sequelize[_0x42cc('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index f482037..984997b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59bd=['apply','save','update','then','end','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','length','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','rimraf','zip-dir','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','register','status','json','offset','undefined','limit','count','Content-Range'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x59bd,0x9d));var _0xd59b=function(_0x52f914,_0x3af39e){_0x52f914=_0x52f914-0x0;var _0x257b98=_0x59bd[_0x52f914];return _0x257b98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd59b('0x0'));var zipdir=require(_0xd59b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd59b('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd59b('0x3'));var path=require(_0xd59b('0x4'));var sox=require(_0xd59b('0x5'));var csv=require('to-csv');var ejs=require(_0xd59b('0x6'));var fs=require('fs');var fs_extra=require(_0xd59b('0x7'));var _=require(_0xd59b('0x8'));var squel=require('squel');var crypto=require(_0xd59b('0x9'));var jsforce=require(_0xd59b('0xa'));var deskjs=require(_0xd59b('0xb'));var toCsv=require(_0xd59b('0xc'));var querystring=require(_0xd59b('0xd'));var Papa=require(_0xd59b('0xe'));var Redis=require('ioredis');var authService=require(_0xd59b('0xf'));var qs=require(_0xd59b('0x10'));var as=require(_0xd59b('0x11'));var hardwareService=require(_0xd59b('0x12'));var logger=require(_0xd59b('0x13'))(_0xd59b('0x14'));var utils=require('../../config/utils');var config=require(_0xd59b('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd59b('0x16')]=_[_0xd59b('0x17')](config[_0xd59b('0x16')],{'host':_0xd59b('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xd59b('0x19')](socket);function respondWithStatusCode(_0x13cf05,_0x46a996){_0x46a996=_0x46a996||0xcc;return function(_0x374409){if(_0x374409){return _0x13cf05['sendStatus'](_0x46a996);}return _0x13cf05[_0xd59b('0x1a')](_0x46a996)['end']();};}function respondWithResult(_0x2c66a6,_0x161ba2){_0x161ba2=_0x161ba2||0xc8;return function(_0x1a6df9){if(_0x1a6df9){return _0x2c66a6[_0xd59b('0x1a')](_0x161ba2)[_0xd59b('0x1b')](_0x1a6df9);}};}function respondWithFilteredResult(_0x116781,_0x349772){return function(_0x1b3963){if(_0x1b3963){var _0x411097=typeof _0x349772[_0xd59b('0x1c')]===_0xd59b('0x1d')&&typeof _0x349772[_0xd59b('0x1e')]===_0xd59b('0x1d');var _0x7f4540=_0x1b3963[_0xd59b('0x1f')];var _0x2b8a63=_0x411097?0x0:_0x349772[_0xd59b('0x1c')];var _0xa1736c=_0x411097?_0x1b3963[_0xd59b('0x1f')]:_0x349772[_0xd59b('0x1c')]+_0x349772[_0xd59b('0x1e')];var _0x2f57ce;if(_0xa1736c>=_0x7f4540){_0xa1736c=_0x7f4540;_0x2f57ce=0xc8;}else{_0x2f57ce=0xce;}_0x116781[_0xd59b('0x1a')](_0x2f57ce);return _0x116781['set'](_0xd59b('0x20'),_0x2b8a63+'-'+_0xa1736c+'/'+_0x7f4540)[_0xd59b('0x1b')](_0x1b3963);}return null;};}function patchUpdates(_0x4b0509){return function(_0x30c7b2){try{jsonpatch[_0xd59b('0x21')](_0x30c7b2,_0x4b0509,!![]);}catch(_0x3c4d3c){return BPromise['reject'](_0x3c4d3c);}return _0x30c7b2[_0xd59b('0x22')]();};}function saveUpdates(_0x33a7a1,_0x4d7c78){return function(_0x55f121){if(_0x55f121){return _0x55f121[_0xd59b('0x23')](_0x33a7a1)[_0xd59b('0x24')](function(_0x4d7753){return _0x4d7753;});}return null;};}function removeEntity(_0x2e3cb0,_0x544e9c){return function(_0x5cc656){if(_0x5cc656){return _0x5cc656['destroy']()[_0xd59b('0x24')](function(){_0x2e3cb0[_0xd59b('0x1a')](0xcc)[_0xd59b('0x25')]();});}};}function handleEntityNotFound(_0x2ceab0,_0x1d1b11){return function(_0x390724){if(!_0x390724){_0x2ceab0[_0xd59b('0x26')](0x194);}return _0x390724;};}function handleError(_0x2ca3b9,_0x515d74){_0x515d74=_0x515d74||0x1f4;return function(_0x99c166){logger[_0xd59b('0x27')](_0x99c166[_0xd59b('0x28')]);if(_0x99c166[_0xd59b('0x29')]){delete _0x99c166[_0xd59b('0x29')];}_0x2ca3b9[_0xd59b('0x1a')](_0x515d74)[_0xd59b('0x2a')](_0x99c166);};}exports[_0xd59b('0x2b')]=function(_0x5a8a57,_0x50155c){var _0x42d28a={},_0x5d7e9c={},_0x332a52={'count':0x0,'rows':[]};var _0x43c3a3=_[_0xd59b('0x2c')](db[_0xd59b('0x2d')][_0xd59b('0x2e')],function(_0x287a53){return{'name':_0x287a53[_0xd59b('0x2f')],'type':_0x287a53[_0xd59b('0x30')][_0xd59b('0x31')]};});_0x5d7e9c[_0xd59b('0x32')]=_[_0xd59b('0x2c')](_0x43c3a3,_0xd59b('0x29'));_0x5d7e9c[_0xd59b('0x33')]=_[_0xd59b('0x34')](_0x5a8a57[_0xd59b('0x33')]);_0x5d7e9c[_0xd59b('0x35')]=_[_0xd59b('0x36')](_0x5d7e9c['model'],_0x5d7e9c[_0xd59b('0x33')]);_0x42d28a[_0xd59b('0x37')]=_[_0xd59b('0x36')](_0x5d7e9c[_0xd59b('0x32')],qs['fields'](_0x5a8a57[_0xd59b('0x33')][_0xd59b('0x38')]));_0x42d28a[_0xd59b('0x37')]=_0x42d28a[_0xd59b('0x37')]['length']?_0x42d28a['attributes']:_0x5d7e9c[_0xd59b('0x32')];if(!_0x5a8a57[_0xd59b('0x33')][_0xd59b('0x39')]('nolimit')){_0x42d28a[_0xd59b('0x1e')]=qs[_0xd59b('0x1e')](_0x5a8a57[_0xd59b('0x33')][_0xd59b('0x1e')]);_0x42d28a[_0xd59b('0x1c')]=qs['offset'](_0x5a8a57[_0xd59b('0x33')]['offset']);}_0x42d28a[_0xd59b('0x3a')]=qs[_0xd59b('0x3b')](_0x5a8a57[_0xd59b('0x33')][_0xd59b('0x3b')]);_0x42d28a[_0xd59b('0x3c')]=qs[_0xd59b('0x35')](_[_0xd59b('0x3d')](_0x5a8a57[_0xd59b('0x33')],_0x5d7e9c[_0xd59b('0x35')]),_0x43c3a3);if(_0x5a8a57[_0xd59b('0x33')][_0xd59b('0x3e')]){_0x42d28a[_0xd59b('0x3c')]=_[_0xd59b('0x3f')](_0x42d28a[_0xd59b('0x3c')],{'$or':_[_0xd59b('0x2c')](_0x43c3a3,function(_0x4471dd){if(_0x4471dd[_0xd59b('0x30')]!==_0xd59b('0x40')){var _0x314522={};_0x314522[_0x4471dd[_0xd59b('0x29')]]={'$like':'%'+_0x5a8a57[_0xd59b('0x33')][_0xd59b('0x3e')]+'%'};return _0x314522;}})});}_0x42d28a=_[_0xd59b('0x3f')]({},_0x42d28a,_0x5a8a57['options']);var _0x1f353e={'where':_0x42d28a[_0xd59b('0x3c')]};return db[_0xd59b('0x2d')][_0xd59b('0x1f')](_0x1f353e)[_0xd59b('0x24')](function(_0x2036b9){_0x332a52[_0xd59b('0x1f')]=_0x2036b9;if(_0x5a8a57[_0xd59b('0x33')][_0xd59b('0x41')]){_0x42d28a['include']=[{'all':!![]}];}return db[_0xd59b('0x2d')][_0xd59b('0x42')](_0x42d28a);})[_0xd59b('0x24')](function(_0x26e2e9){_0x332a52[_0xd59b('0x43')]=_0x26e2e9;return _0x332a52;})['then'](respondWithFilteredResult(_0x50155c,_0x42d28a))[_0xd59b('0x44')](handleError(_0x50155c,null));};exports[_0xd59b('0x45')]=function(_0x3cb0a2,_0x4511c0){var _0x3b41be={'raw':!![],'where':{'id':_0x3cb0a2[_0xd59b('0x46')]['id']}},_0x3018a0={};_0x3018a0['model']=_[_0xd59b('0x34')](db[_0xd59b('0x2d')]['rawAttributes']);_0x3018a0[_0xd59b('0x33')]=_[_0xd59b('0x34')](_0x3cb0a2[_0xd59b('0x33')]);_0x3018a0[_0xd59b('0x35')]=_[_0xd59b('0x36')](_0x3018a0[_0xd59b('0x32')],_0x3018a0['query']);_0x3b41be[_0xd59b('0x37')]=_['intersection'](_0x3018a0[_0xd59b('0x32')],qs[_0xd59b('0x38')](_0x3cb0a2[_0xd59b('0x33')][_0xd59b('0x38')]));_0x3b41be['attributes']=_0x3b41be[_0xd59b('0x37')]['length']?_0x3b41be[_0xd59b('0x37')]:_0x3018a0[_0xd59b('0x32')];if(_0x3cb0a2[_0xd59b('0x33')][_0xd59b('0x41')]){_0x3b41be[_0xd59b('0x47')]=[{'all':!![]}];}_0x3b41be=_[_0xd59b('0x3f')]({},_0x3b41be,_0x3cb0a2[_0xd59b('0x48')]);return db[_0xd59b('0x2d')]['find'](_0x3b41be)[_0xd59b('0x24')](handleEntityNotFound(_0x4511c0,null))[_0xd59b('0x24')](respondWithResult(_0x4511c0,null))[_0xd59b('0x44')](handleError(_0x4511c0,null));};exports[_0xd59b('0x49')]=function(_0xcb0b4f,_0x4e361a){return db[_0xd59b('0x2d')][_0xd59b('0x49')](_0xcb0b4f[_0xd59b('0x4a')],{})[_0xd59b('0x24')](respondWithResult(_0x4e361a,0xc9))[_0xd59b('0x44')](handleError(_0x4e361a,null));};exports[_0xd59b('0x23')]=function(_0x59a4a3,_0x35c6d3){if(_0x59a4a3[_0xd59b('0x4a')]['id']){delete _0x59a4a3[_0xd59b('0x4a')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x59a4a3['params']['id']}})[_0xd59b('0x24')](handleEntityNotFound(_0x35c6d3,null))[_0xd59b('0x24')](saveUpdates(_0x59a4a3['body'],null))['then'](respondWithResult(_0x35c6d3,null))[_0xd59b('0x44')](handleError(_0x35c6d3,null));};exports['destroy']=function(_0x1ab685,_0x1cd88c){return db[_0xd59b('0x2d')][_0xd59b('0x4b')]({'where':{'id':_0x1ab685['params']['id']}})[_0xd59b('0x24')](handleEntityNotFound(_0x1cd88c,null))[_0xd59b('0x24')](removeEntity(_0x1cd88c,null))['catch'](handleError(_0x1cd88c,null));};exports[_0xd59b('0x4c')]=function(_0x435bf2,_0x535d67){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x535d67,null))[_0xd59b('0x44')](handleError(_0x535d67,null));};exports[_0xd59b('0x4d')]=function(_0x2a3249,_0x158e14,_0x115a19){return db[_0xd59b('0x4e')][_0xd59b('0x1f')]({'where':{'ChatGroupId':_0x2a3249['params']['id'],'ToId':_0x2a3249[_0xd59b('0x4f')]['id'],'read':![]}})[_0xd59b('0x24')](function(_0x24a4e5){return{'id':_[_0xd59b('0x50')](_0x2a3249[_0xd59b('0x46')]['id']),'count':_0x24a4e5};})['then'](respondWithResult(_0x158e14,null))[_0xd59b('0x44')](handleError(_0x158e14,null));};exports[_0xd59b('0x51')]=function(_0x9682fc,_0x167a77,_0x2394c){return db[_0xd59b('0x2d')]['find']({'where':{'id':_0x9682fc['params']['id']}})['then'](handleEntityNotFound(_0x167a77,null))[_0xd59b('0x24')](function(_0x468352){if(_0x468352){return _0x468352[_0xd59b('0x51')](_0x9682fc[_0xd59b('0x4a')][_0xd59b('0x52')],_[_0xd59b('0x53')](_0x9682fc[_0xd59b('0x4a')],[_0xd59b('0x52'),'id'])||{});}})[_0xd59b('0x24')](respondWithResult(_0x167a77,null))[_0xd59b('0x44')](handleError(_0x167a77,null));};exports[_0xd59b('0x54')]=function(_0x353540,_0x411440,_0x45d5fa){var _0x59f4d7={};var _0x8bd36d={};var _0x217353;var _0x59966a;return db[_0xd59b('0x2d')][_0xd59b('0x55')]({'where':{'id':_0x353540[_0xd59b('0x46')]['id']}})[_0xd59b('0x24')](handleEntityNotFound(_0x411440,null))['then'](function(_0x17f2af){if(_0x17f2af){_0x217353=_0x17f2af;_0x8bd36d[_0xd59b('0x32')]=_[_0xd59b('0x34')](db['User'][_0xd59b('0x2e')]);_0x8bd36d[_0xd59b('0x33')]=_[_0xd59b('0x34')](_0x353540[_0xd59b('0x33')]);_0x8bd36d[_0xd59b('0x35')]=_[_0xd59b('0x36')](_0x8bd36d[_0xd59b('0x32')],_0x8bd36d[_0xd59b('0x33')]);_0x59f4d7['attributes']=_[_0xd59b('0x36')](_0x8bd36d[_0xd59b('0x32')],qs[_0xd59b('0x38')](_0x353540[_0xd59b('0x33')][_0xd59b('0x38')]));_0x59f4d7[_0xd59b('0x37')]=_0x59f4d7['attributes'][_0xd59b('0x56')]?_0x59f4d7['attributes']:_0x8bd36d['model'];_0x59f4d7[_0xd59b('0x3a')]=qs[_0xd59b('0x3b')](_0x353540[_0xd59b('0x33')][_0xd59b('0x3b')]);_0x59f4d7[_0xd59b('0x3c')]=qs['filters'](_[_0xd59b('0x3d')](_0x353540[_0xd59b('0x33')],_0x8bd36d[_0xd59b('0x35')]));if(_0x353540['query'][_0xd59b('0x3e')]){_0x59f4d7['where']=_['merge'](_0x59f4d7[_0xd59b('0x3c')],{'$or':_[_0xd59b('0x2c')](_0x59f4d7[_0xd59b('0x37')],function(_0xe1f873){var _0x2c2f7b={};_0x2c2f7b[_0xe1f873]={'$like':'%'+_0x353540['query'][_0xd59b('0x3e')]+'%'};return _0x2c2f7b;})});}_0x59f4d7=_[_0xd59b('0x3f')]({},_0x59f4d7,_0x353540[_0xd59b('0x48')]);return _0x217353[_0xd59b('0x54')](_0x59f4d7);}})['then'](function(_0x2b271f){if(_0x2b271f){_0x59966a=_0x2b271f[_0xd59b('0x56')];if(!_0x353540[_0xd59b('0x33')][_0xd59b('0x39')]('nolimit')){_0x59f4d7[_0xd59b('0x1e')]=qs[_0xd59b('0x1e')](_0x353540['query'][_0xd59b('0x1e')]);_0x59f4d7[_0xd59b('0x1c')]=qs['offset'](_0x353540[_0xd59b('0x33')]['offset']);}return _0x217353['getMembers'](_0x59f4d7);}})['then'](function(_0x35fa6a){if(_0x35fa6a){return _0x35fa6a?{'count':_0x59966a,'rows':_0x35fa6a}:null;}})[_0xd59b('0x24')](respondWithResult(_0x411440,null))['catch'](handleError(_0x411440,null));};exports[_0xd59b('0x57')]=function(_0x303773,_0x23e8cd,_0x2dd660){return db[_0xd59b('0x2d')][_0xd59b('0x4b')]({'where':{'id':_0x303773['params']['id']}})[_0xd59b('0x24')](handleEntityNotFound(_0x23e8cd,null))[_0xd59b('0x24')](function(_0x281ec2){if(_0x281ec2){return _0x281ec2[_0xd59b('0x57')](_0x303773['query'][_0xd59b('0x52')]);}})[_0xd59b('0x24')](respondWithStatusCode(_0x23e8cd,null))[_0xd59b('0x44')](handleError(_0x23e8cd,null));};exports['addMessage']=function(_0x322c51,_0x58f16e,_0x3ce6b9){if(_0x322c51[_0xd59b('0x4a')]['id']){delete _0x322c51[_0xd59b('0x4a')]['id'];}return db[_0xd59b('0x2d')][_0xd59b('0x4b')]({'where':{'id':_0x322c51[_0xd59b('0x46')]['id']}})[_0xd59b('0x24')](handleEntityNotFound(_0x58f16e,null))[_0xd59b('0x24')](function(_0x238bf5){if(_0x238bf5){_0x322c51[_0xd59b('0x4a')][_0xd59b('0x58')]=_0x238bf5['id'];return db[_0xd59b('0x4e')][_0xd59b('0x49')](_0x322c51[_0xd59b('0x4a')]);}})[_0xd59b('0x24')](respondWithResult(_0x58f16e,null))['catch'](handleError(_0x58f16e,null));};exports[_0xd59b('0x59')]=function(_0x50c600,_0xae94c7,_0xf7fa6f){var _0x282e5d={};var _0x5f9448={};var _0x37c384;var _0x31b002;return db[_0xd59b('0x2d')][_0xd59b('0x55')]({'where':{'id':_0x50c600['params']['id']}})['then'](handleEntityNotFound(_0xae94c7,null))['then'](function(_0x426c07){if(_0x426c07){_0x37c384=_0x426c07;_0x5f9448['model']=_[_0xd59b('0x34')](db[_0xd59b('0x4e')][_0xd59b('0x2e')]);_0x5f9448[_0xd59b('0x33')]=_[_0xd59b('0x34')](_0x50c600[_0xd59b('0x33')]);_0x5f9448[_0xd59b('0x35')]=_[_0xd59b('0x36')](_0x5f9448[_0xd59b('0x32')],_0x5f9448[_0xd59b('0x33')]);_0x282e5d[_0xd59b('0x37')]=_[_0xd59b('0x36')](_0x5f9448[_0xd59b('0x32')],qs['fields'](_0x50c600[_0xd59b('0x33')][_0xd59b('0x38')]));_0x282e5d[_0xd59b('0x37')]=_0x282e5d[_0xd59b('0x37')][_0xd59b('0x56')]?_0x282e5d[_0xd59b('0x37')]:_0x5f9448[_0xd59b('0x32')];_0x282e5d[_0xd59b('0x3a')]=qs['sort'](_0x50c600[_0xd59b('0x33')][_0xd59b('0x3b')]);_0x282e5d[_0xd59b('0x3c')]=qs['filters'](_['pick'](_0x50c600['query'],_0x5f9448[_0xd59b('0x35')]));if(_0x50c600[_0xd59b('0x33')][_0xd59b('0x3e')]){_0x282e5d[_0xd59b('0x3c')]=_[_0xd59b('0x3f')](_0x282e5d['where'],{'$or':_[_0xd59b('0x2c')](_0x282e5d[_0xd59b('0x37')],function(_0x4b2dda){var _0x5628b9={};_0x5628b9[_0x4b2dda]={'$like':'%'+_0x50c600['query'][_0xd59b('0x3e')]+'%'};return _0x5628b9;})});}if(_0x50c600[_0xd59b('0x33')][_0xd59b('0x5a')]){var _0x6750b2=_0x50c600[_0xd59b('0x33')][_0xd59b('0x5a')][_0xd59b('0x5b')](',');var _0x7cec13={};_0x7cec13[_0x6750b2[0x0]]={'$gte':moment(_0x6750b2[0x1])[_0xd59b('0x5c')](_0xd59b('0x5d'))};_0x282e5d[_0xd59b('0x3c')]=_['merge'](_0x282e5d[_0xd59b('0x3c')],_0x7cec13);}_0x282e5d=_[_0xd59b('0x3f')]({},_0x282e5d,_0x50c600['options']);return _0x37c384[_0xd59b('0x59')](_0x282e5d);}})[_0xd59b('0x24')](function(_0x328b1d){if(_0x328b1d){_0x31b002=_0x328b1d['length'];if(!_0x50c600[_0xd59b('0x33')][_0xd59b('0x39')](_0xd59b('0x5e'))){_0x282e5d[_0xd59b('0x1e')]=qs[_0xd59b('0x1e')](_0x50c600['query'][_0xd59b('0x1e')]);_0x282e5d[_0xd59b('0x1c')]=qs[_0xd59b('0x1c')](_0x50c600[_0xd59b('0x33')]['offset']);}return _0x37c384[_0xd59b('0x59')](_0x282e5d);}})['then'](function(_0x567335){if(_0x567335){return _0x567335?{'count':_0x31b002,'rows':_0x567335}:null;}})[_0xd59b('0x24')](respondWithResult(_0xae94c7,null))['catch'](handleError(_0xae94c7,null));};
\ No newline at end of file
+var _0xd61e=['create','body','update','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','ids','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','end','json','offset','undefined','limit','count','apply','reject','save','then','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','catch','show','params','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd61e,0x1df));var _0xed61=function(_0x63e0e9,_0x1d1096){_0x63e0e9=_0x63e0e9-0x0;var _0x3cd4ae=_0xd61e[_0x63e0e9];return _0x3cd4ae;};'use strict';var emlformat=require(_0xed61('0x0'));var rimraf=require(_0xed61('0x1'));var zipdir=require(_0xed61('0x2'));var jsonpatch=require(_0xed61('0x3'));var rp=require('request-promise');var moment=require(_0xed61('0x4'));var BPromise=require(_0xed61('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xed61('0x6'));var csv=require('to-csv');var ejs=require(_0xed61('0x7'));var fs=require('fs');var fs_extra=require(_0xed61('0x8'));var _=require(_0xed61('0x9'));var squel=require(_0xed61('0xa'));var crypto=require('crypto');var jsforce=require(_0xed61('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xed61('0xc'));var querystring=require(_0xed61('0xd'));var Papa=require(_0xed61('0xe'));var Redis=require('ioredis');var authService=require(_0xed61('0xf'));var qs=require(_0xed61('0x10'));var as=require(_0xed61('0x11'));var hardwareService=require(_0xed61('0x12'));var logger=require('../../config/logger')(_0xed61('0x13'));var utils=require(_0xed61('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xed61('0x15'));var db=require(_0xed61('0x16'))['db'];config[_0xed61('0x17')]=_[_0xed61('0x18')](config[_0xed61('0x17')],{'host':_0xed61('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed61('0x17')]));require('./chatGroup.socket')[_0xed61('0x1a')](socket);function respondWithStatusCode(_0x59bf9a,_0x274cb2){_0x274cb2=_0x274cb2||0xcc;return function(_0x48be71){if(_0x48be71){return _0x59bf9a['sendStatus'](_0x274cb2);}return _0x59bf9a[_0xed61('0x1b')](_0x274cb2)[_0xed61('0x1c')]();};}function respondWithResult(_0x41c3c5,_0x5dff0f){_0x5dff0f=_0x5dff0f||0xc8;return function(_0x464f76){if(_0x464f76){return _0x41c3c5[_0xed61('0x1b')](_0x5dff0f)[_0xed61('0x1d')](_0x464f76);}};}function respondWithFilteredResult(_0x285dd6,_0x159ea6){return function(_0xac1b1d){if(_0xac1b1d){var _0x39f45d=typeof _0x159ea6[_0xed61('0x1e')]===_0xed61('0x1f')&&typeof _0x159ea6[_0xed61('0x20')]===_0xed61('0x1f');var _0x2a1571=_0xac1b1d[_0xed61('0x21')];var _0x1d8c14=_0x39f45d?0x0:_0x159ea6[_0xed61('0x1e')];var _0x2cb7a2=_0x39f45d?_0xac1b1d[_0xed61('0x21')]:_0x159ea6[_0xed61('0x1e')]+_0x159ea6[_0xed61('0x20')];var _0x49c155;if(_0x2cb7a2>=_0x2a1571){_0x2cb7a2=_0x2a1571;_0x49c155=0xc8;}else{_0x49c155=0xce;}_0x285dd6[_0xed61('0x1b')](_0x49c155);return _0x285dd6['set']('Content-Range',_0x1d8c14+'-'+_0x2cb7a2+'/'+_0x2a1571)['json'](_0xac1b1d);}return null;};}function patchUpdates(_0x2f0b3f){return function(_0xc97e06){try{jsonpatch[_0xed61('0x22')](_0xc97e06,_0x2f0b3f,!![]);}catch(_0x85dda){return BPromise[_0xed61('0x23')](_0x85dda);}return _0xc97e06[_0xed61('0x24')]();};}function saveUpdates(_0x4f5d6e,_0x36a43c){return function(_0x456539){if(_0x456539){return _0x456539['update'](_0x4f5d6e)[_0xed61('0x25')](function(_0x4cf7db){return _0x4cf7db;});}return null;};}function removeEntity(_0x3c49e0,_0x302c5c){return function(_0x45e92b){if(_0x45e92b){return _0x45e92b['destroy']()[_0xed61('0x25')](function(){_0x3c49e0[_0xed61('0x1b')](0xcc)[_0xed61('0x1c')]();});}};}function handleEntityNotFound(_0x4ddb39,_0x2ae7ca){return function(_0x355736){if(!_0x355736){_0x4ddb39[_0xed61('0x26')](0x194);}return _0x355736;};}function handleError(_0x50e70d,_0x36ac9e){_0x36ac9e=_0x36ac9e||0x1f4;return function(_0x11b7f6){logger[_0xed61('0x27')](_0x11b7f6['stack']);if(_0x11b7f6[_0xed61('0x28')]){delete _0x11b7f6[_0xed61('0x28')];}_0x50e70d[_0xed61('0x1b')](_0x36ac9e)[_0xed61('0x29')](_0x11b7f6);};}exports[_0xed61('0x2a')]=function(_0x287062,_0x53f01d){var _0xe4c59f={},_0x281dd9={},_0x11792e={'count':0x0,'rows':[]};var _0x2e9ceb=_[_0xed61('0x2b')](db['ChatGroup'][_0xed61('0x2c')],function(_0xdbe468){return{'name':_0xdbe468['fieldName'],'type':_0xdbe468[_0xed61('0x2d')][_0xed61('0x2e')]};});_0x281dd9[_0xed61('0x2f')]=_[_0xed61('0x2b')](_0x2e9ceb,_0xed61('0x28'));_0x281dd9[_0xed61('0x30')]=_[_0xed61('0x31')](_0x287062[_0xed61('0x30')]);_0x281dd9[_0xed61('0x32')]=_[_0xed61('0x33')](_0x281dd9[_0xed61('0x2f')],_0x281dd9['query']);_0xe4c59f[_0xed61('0x34')]=_[_0xed61('0x33')](_0x281dd9[_0xed61('0x2f')],qs[_0xed61('0x35')](_0x287062[_0xed61('0x30')][_0xed61('0x35')]));_0xe4c59f[_0xed61('0x34')]=_0xe4c59f[_0xed61('0x34')][_0xed61('0x36')]?_0xe4c59f[_0xed61('0x34')]:_0x281dd9[_0xed61('0x2f')];if(!_0x287062[_0xed61('0x30')]['hasOwnProperty'](_0xed61('0x37'))){_0xe4c59f[_0xed61('0x20')]=qs['limit'](_0x287062[_0xed61('0x30')][_0xed61('0x20')]);_0xe4c59f[_0xed61('0x1e')]=qs[_0xed61('0x1e')](_0x287062['query'][_0xed61('0x1e')]);}_0xe4c59f[_0xed61('0x38')]=qs[_0xed61('0x39')](_0x287062[_0xed61('0x30')][_0xed61('0x39')]);_0xe4c59f[_0xed61('0x3a')]=qs[_0xed61('0x32')](_[_0xed61('0x3b')](_0x287062[_0xed61('0x30')],_0x281dd9[_0xed61('0x32')]),_0x2e9ceb);if(_0x287062[_0xed61('0x30')][_0xed61('0x3c')]){_0xe4c59f[_0xed61('0x3a')]=_[_0xed61('0x3d')](_0xe4c59f[_0xed61('0x3a')],{'$or':_[_0xed61('0x2b')](_0x2e9ceb,function(_0x537c64){if(_0x537c64[_0xed61('0x2d')]!==_0xed61('0x3e')){var _0x28d271={};_0x28d271[_0x537c64[_0xed61('0x28')]]={'$like':'%'+_0x287062[_0xed61('0x30')]['filter']+'%'};return _0x28d271;}})});}_0xe4c59f=_['merge']({},_0xe4c59f,_0x287062[_0xed61('0x3f')]);var _0x57e358={'where':_0xe4c59f[_0xed61('0x3a')]};return db[_0xed61('0x40')][_0xed61('0x21')](_0x57e358)[_0xed61('0x25')](function(_0x499534){_0x11792e[_0xed61('0x21')]=_0x499534;if(_0x287062[_0xed61('0x30')][_0xed61('0x41')]){_0xe4c59f[_0xed61('0x42')]=[{'all':!![]}];}return db['ChatGroup'][_0xed61('0x43')](_0xe4c59f);})['then'](function(_0x1b5dcf){_0x11792e[_0xed61('0x44')]=_0x1b5dcf;return _0x11792e;})[_0xed61('0x25')](respondWithFilteredResult(_0x53f01d,_0xe4c59f))[_0xed61('0x45')](handleError(_0x53f01d,null));};exports[_0xed61('0x46')]=function(_0x2cdcc2,_0xbc358f){var _0x4be327={'raw':!![],'where':{'id':_0x2cdcc2[_0xed61('0x47')]['id']}},_0xe414d={};_0xe414d['model']=_[_0xed61('0x31')](db['ChatGroup'][_0xed61('0x2c')]);_0xe414d[_0xed61('0x30')]=_[_0xed61('0x31')](_0x2cdcc2[_0xed61('0x30')]);_0xe414d[_0xed61('0x32')]=_['intersection'](_0xe414d[_0xed61('0x2f')],_0xe414d['query']);_0x4be327['attributes']=_[_0xed61('0x33')](_0xe414d[_0xed61('0x2f')],qs[_0xed61('0x35')](_0x2cdcc2[_0xed61('0x30')][_0xed61('0x35')]));_0x4be327[_0xed61('0x34')]=_0x4be327[_0xed61('0x34')][_0xed61('0x36')]?_0x4be327['attributes']:_0xe414d[_0xed61('0x2f')];if(_0x2cdcc2[_0xed61('0x30')][_0xed61('0x41')]){_0x4be327[_0xed61('0x42')]=[{'all':!![]}];}_0x4be327=_[_0xed61('0x3d')]({},_0x4be327,_0x2cdcc2['options']);return db[_0xed61('0x40')][_0xed61('0x48')](_0x4be327)[_0xed61('0x25')](handleEntityNotFound(_0xbc358f,null))[_0xed61('0x25')](respondWithResult(_0xbc358f,null))[_0xed61('0x45')](handleError(_0xbc358f,null));};exports[_0xed61('0x49')]=function(_0x3afce0,_0x2f1cb3){return db[_0xed61('0x40')][_0xed61('0x49')](_0x3afce0[_0xed61('0x4a')],{})['then'](respondWithResult(_0x2f1cb3,0xc9))[_0xed61('0x45')](handleError(_0x2f1cb3,null));};exports[_0xed61('0x4b')]=function(_0x159c83,_0x594e5b){if(_0x159c83['body']['id']){delete _0x159c83[_0xed61('0x4a')]['id'];}return db[_0xed61('0x40')]['find']({'where':{'id':_0x159c83['params']['id']}})[_0xed61('0x25')](handleEntityNotFound(_0x594e5b,null))[_0xed61('0x25')](saveUpdates(_0x159c83[_0xed61('0x4a')],null))[_0xed61('0x25')](respondWithResult(_0x594e5b,null))[_0xed61('0x45')](handleError(_0x594e5b,null));};exports[_0xed61('0x4c')]=function(_0x523cf0,_0x437891){return db[_0xed61('0x40')][_0xed61('0x48')]({'where':{'id':_0x523cf0[_0xed61('0x47')]['id']}})['then'](handleEntityNotFound(_0x437891,null))[_0xed61('0x25')](removeEntity(_0x437891,null))[_0xed61('0x45')](handleError(_0x437891,null));};exports[_0xed61('0x4d')]=function(_0x3bd3f8,_0x3cbf0b){return db[_0xed61('0x40')]['describe']()[_0xed61('0x25')](respondWithResult(_0x3cbf0b,null))[_0xed61('0x45')](handleError(_0x3cbf0b,null));};exports[_0xed61('0x4e')]=function(_0xa613ad,_0x46d687,_0x4df0ca){return db[_0xed61('0x4f')][_0xed61('0x21')]({'where':{'ChatGroupId':_0xa613ad[_0xed61('0x47')]['id'],'ToId':_0xa613ad[_0xed61('0x50')]['id'],'read':![]}})['then'](function(_0x180c58){return{'id':_[_0xed61('0x51')](_0xa613ad[_0xed61('0x47')]['id']),'count':_0x180c58};})['then'](respondWithResult(_0x46d687,null))[_0xed61('0x45')](handleError(_0x46d687,null));};exports[_0xed61('0x52')]=function(_0x5385ac,_0x5c9d89,_0x5d9da9){return db[_0xed61('0x40')]['find']({'where':{'id':_0x5385ac[_0xed61('0x47')]['id']}})[_0xed61('0x25')](handleEntityNotFound(_0x5c9d89,null))[_0xed61('0x25')](function(_0x1a2661){if(_0x1a2661){return _0x1a2661[_0xed61('0x52')](_0x5385ac['body']['ids'],_[_0xed61('0x53')](_0x5385ac['body'],['ids','id'])||{});}})[_0xed61('0x25')](respondWithResult(_0x5c9d89,null))[_0xed61('0x45')](handleError(_0x5c9d89,null));};exports[_0xed61('0x54')]=function(_0x2151f4,_0x32818f,_0x64b5f1){var _0x2fd461={};var _0x30cdbd={};var _0x3769a9;var _0x5942e3;return db[_0xed61('0x40')][_0xed61('0x55')]({'where':{'id':_0x2151f4[_0xed61('0x47')]['id']}})['then'](handleEntityNotFound(_0x32818f,null))[_0xed61('0x25')](function(_0x4d0807){if(_0x4d0807){_0x3769a9=_0x4d0807;_0x30cdbd[_0xed61('0x2f')]=_['keys'](db[_0xed61('0x56')][_0xed61('0x2c')]);_0x30cdbd[_0xed61('0x30')]=_[_0xed61('0x31')](_0x2151f4[_0xed61('0x30')]);_0x30cdbd[_0xed61('0x32')]=_[_0xed61('0x33')](_0x30cdbd['model'],_0x30cdbd[_0xed61('0x30')]);_0x2fd461[_0xed61('0x34')]=_[_0xed61('0x33')](_0x30cdbd[_0xed61('0x2f')],qs[_0xed61('0x35')](_0x2151f4[_0xed61('0x30')]['fields']));_0x2fd461[_0xed61('0x34')]=_0x2fd461[_0xed61('0x34')][_0xed61('0x36')]?_0x2fd461[_0xed61('0x34')]:_0x30cdbd[_0xed61('0x2f')];_0x2fd461[_0xed61('0x38')]=qs[_0xed61('0x39')](_0x2151f4[_0xed61('0x30')][_0xed61('0x39')]);_0x2fd461[_0xed61('0x3a')]=qs[_0xed61('0x32')](_[_0xed61('0x3b')](_0x2151f4[_0xed61('0x30')],_0x30cdbd[_0xed61('0x32')]));if(_0x2151f4[_0xed61('0x30')][_0xed61('0x3c')]){_0x2fd461[_0xed61('0x3a')]=_[_0xed61('0x3d')](_0x2fd461[_0xed61('0x3a')],{'$or':_['map'](_0x2fd461['attributes'],function(_0x3a2643){var _0x54bb3e={};_0x54bb3e[_0x3a2643]={'$like':'%'+_0x2151f4[_0xed61('0x30')][_0xed61('0x3c')]+'%'};return _0x54bb3e;})});}_0x2fd461=_['merge']({},_0x2fd461,_0x2151f4[_0xed61('0x3f')]);return _0x3769a9[_0xed61('0x54')](_0x2fd461);}})[_0xed61('0x25')](function(_0x3f2831){if(_0x3f2831){_0x5942e3=_0x3f2831['length'];if(!_0x2151f4['query'][_0xed61('0x57')](_0xed61('0x37'))){_0x2fd461['limit']=qs[_0xed61('0x20')](_0x2151f4['query']['limit']);_0x2fd461['offset']=qs['offset'](_0x2151f4[_0xed61('0x30')][_0xed61('0x1e')]);}return _0x3769a9['getMembers'](_0x2fd461);}})[_0xed61('0x25')](function(_0x5aa19e){if(_0x5aa19e){return _0x5aa19e?{'count':_0x5942e3,'rows':_0x5aa19e}:null;}})['then'](respondWithResult(_0x32818f,null))[_0xed61('0x45')](handleError(_0x32818f,null));};exports[_0xed61('0x58')]=function(_0xe63034,_0x1b48c5,_0x2da54f){return db['ChatGroup'][_0xed61('0x48')]({'where':{'id':_0xe63034[_0xed61('0x47')]['id']}})[_0xed61('0x25')](handleEntityNotFound(_0x1b48c5,null))['then'](function(_0x4e0768){if(_0x4e0768){return _0x4e0768[_0xed61('0x58')](_0xe63034[_0xed61('0x30')][_0xed61('0x59')]);}})[_0xed61('0x25')](respondWithStatusCode(_0x1b48c5,null))['catch'](handleError(_0x1b48c5,null));};exports['addMessage']=function(_0x3e7814,_0x1ddc71,_0x50edef){if(_0x3e7814['body']['id']){delete _0x3e7814['body']['id'];}return db[_0xed61('0x40')][_0xed61('0x48')]({'where':{'id':_0x3e7814[_0xed61('0x47')]['id']}})[_0xed61('0x25')](handleEntityNotFound(_0x1ddc71,null))[_0xed61('0x25')](function(_0x4d40cc){if(_0x4d40cc){_0x3e7814[_0xed61('0x4a')]['ChatGroupId']=_0x4d40cc['id'];return db['ChatInternalMessage'][_0xed61('0x49')](_0x3e7814['body']);}})[_0xed61('0x25')](respondWithResult(_0x1ddc71,null))[_0xed61('0x45')](handleError(_0x1ddc71,null));};exports['getMessages']=function(_0x1717b9,_0x49e06a,_0x1394da){var _0x34cae1={};var _0x5c163c={};var _0x94bfe9;var _0x3390d4;return db['ChatGroup'][_0xed61('0x55')]({'where':{'id':_0x1717b9['params']['id']}})[_0xed61('0x25')](handleEntityNotFound(_0x49e06a,null))['then'](function(_0x31d38f){if(_0x31d38f){_0x94bfe9=_0x31d38f;_0x5c163c['model']=_[_0xed61('0x31')](db[_0xed61('0x4f')]['rawAttributes']);_0x5c163c[_0xed61('0x30')]=_[_0xed61('0x31')](_0x1717b9[_0xed61('0x30')]);_0x5c163c[_0xed61('0x32')]=_['intersection'](_0x5c163c[_0xed61('0x2f')],_0x5c163c[_0xed61('0x30')]);_0x34cae1['attributes']=_['intersection'](_0x5c163c[_0xed61('0x2f')],qs[_0xed61('0x35')](_0x1717b9['query'][_0xed61('0x35')]));_0x34cae1[_0xed61('0x34')]=_0x34cae1[_0xed61('0x34')]['length']?_0x34cae1[_0xed61('0x34')]:_0x5c163c[_0xed61('0x2f')];_0x34cae1[_0xed61('0x38')]=qs[_0xed61('0x39')](_0x1717b9[_0xed61('0x30')][_0xed61('0x39')]);_0x34cae1[_0xed61('0x3a')]=qs['filters'](_['pick'](_0x1717b9[_0xed61('0x30')],_0x5c163c[_0xed61('0x32')]));if(_0x1717b9[_0xed61('0x30')][_0xed61('0x3c')]){_0x34cae1[_0xed61('0x3a')]=_['merge'](_0x34cae1['where'],{'$or':_[_0xed61('0x2b')](_0x34cae1[_0xed61('0x34')],function(_0x2f403b){var _0x1b61f9={};_0x1b61f9[_0x2f403b]={'$like':'%'+_0x1717b9['query'][_0xed61('0x3c')]+'%'};return _0x1b61f9;})});}if(_0x1717b9[_0xed61('0x30')]['$gte']){var _0x1ed8c3=_0x1717b9[_0xed61('0x30')]['$gte'][_0xed61('0x5a')](',');var _0xd2971e={};_0xd2971e[_0x1ed8c3[0x0]]={'$gte':moment(_0x1ed8c3[0x1])['format'](_0xed61('0x5b'))};_0x34cae1[_0xed61('0x3a')]=_['merge'](_0x34cae1['where'],_0xd2971e);}_0x34cae1=_[_0xed61('0x3d')]({},_0x34cae1,_0x1717b9[_0xed61('0x3f')]);return _0x94bfe9['getMessages'](_0x34cae1);}})['then'](function(_0x491b69){if(_0x491b69){_0x3390d4=_0x491b69[_0xed61('0x36')];if(!_0x1717b9[_0xed61('0x30')][_0xed61('0x57')](_0xed61('0x37'))){_0x34cae1[_0xed61('0x20')]=qs[_0xed61('0x20')](_0x1717b9[_0xed61('0x30')][_0xed61('0x20')]);_0x34cae1['offset']=qs['offset'](_0x1717b9[_0xed61('0x30')][_0xed61('0x1e')]);}return _0x94bfe9['getMessages'](_0x34cae1);}})[_0xed61('0x25')](function(_0x1857d8){if(_0x1857d8){return _0x1857d8?{'count':_0x3390d4,'rows':_0x1857d8}:null;}})['then'](respondWithResult(_0x49e06a,null))[_0xed61('0x45')](handleError(_0x49e06a,null));};
\ No newline at end of file
index abf275c..5325f38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fb7=['../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2fb7,0x90));var _0x72fb=function(_0x259efb,_0xd6941d){_0x259efb=_0x259efb-0x0;var _0x4e2ef1=_0x2fb7[_0x259efb];return _0x4e2ef1;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x72fb('0x0'))['db'][_0x72fb('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x72fb('0x2')](0x0);var events={'afterCreate':_0x72fb('0x3'),'afterUpdate':'update','afterDestroy':_0x72fb('0x4')};function emitEvent(_0x171f47){return function(_0x1a7ac7,_0x4e959b,_0x198c0a){ChatGroupEvents[_0x72fb('0x5')](_0x171f47+':'+_0x1a7ac7['id'],_0x1a7ac7);ChatGroupEvents[_0x72fb('0x5')](_0x171f47,_0x1a7ac7);_0x198c0a(null);};}for(var e in events){if(events[_0x72fb('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x72fb('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x4201=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x4201,0x71));var _0x1420=function(_0x3a8ce2,_0x552ad5){_0x3a8ce2=_0x3a8ce2-0x0;var _0x2e5a45=_0x4201[_0x3a8ce2];return _0x2e5a45;};'use strict';var EventEmitter=require(_0x1420('0x0'));var ChatGroup=require(_0x1420('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1420('0x2')](0x0);var events={'afterCreate':_0x1420('0x3'),'afterUpdate':_0x1420('0x4'),'afterDestroy':_0x1420('0x5')};function emitEvent(_0x239ca9){return function(_0x43d008,_0x59088c,_0x485039){ChatGroupEvents[_0x1420('0x6')](_0x239ca9+':'+_0x43d008['id'],_0x43d008);ChatGroupEvents[_0x1420('0x6')](_0x239ca9,_0x43d008);_0x485039(null);};}for(var e in events){if(events[_0x1420('0x7')](e)){var event=events[e];ChatGroup[_0x1420('0x8')](e,emitEvent(event));}}module[_0x1420('0x9')]=ChatGroupEvents;
\ No newline at end of file
index 1061521..bd38022 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46c4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','lodash','../../config/logger'];(function(_0x414180,_0x4bd188){var _0x1d475d=function(_0x23e44a){while(--_0x23e44a){_0x414180['push'](_0x414180['shift']());}};_0x1d475d(++_0x4bd188);}(_0x46c4,0x11e));var _0x446c=function(_0x29d004,_0x1e4368){_0x29d004=_0x29d004-0x0;var _0x440692=_0x46c4[_0x29d004];return _0x440692;};'use strict';var _=require(_0x446c('0x0'));var util=require('util');var logger=require(_0x446c('0x1'))(_0x446c('0x2'));var moment=require(_0x446c('0x3'));var BPromise=require(_0x446c('0x4'));var rp=require(_0x446c('0x5'));var fs=require('fs');var path=require(_0x446c('0x6'));var rimraf=require(_0x446c('0x7'));var config=require(_0x446c('0x8'));var attributes=require(_0x446c('0x9'));module[_0x446c('0xa')]=function(_0xa744f3,_0x54e0f8){return _0xa744f3['define'](_0x446c('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a9d=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','util','../../config/logger','api','request-promise','path'];(function(_0x25f142,_0x5002fa){var _0x346400=function(_0x557a37){while(--_0x557a37){_0x25f142['push'](_0x25f142['shift']());}};_0x346400(++_0x5002fa);}(_0x5a9d,0xc1));var _0xd5a9=function(_0x3dd434,_0x247688){_0x3dd434=_0x3dd434-0x0;var _0x1e280e=_0x5a9d[_0x3dd434];return _0x1e280e;};'use strict';var _=require('lodash');var util=require(_0xd5a9('0x0'));var logger=require(_0xd5a9('0x1'))(_0xd5a9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd5a9('0x3'));var fs=require('fs');var path=require(_0xd5a9('0x4'));var rimraf=require(_0xd5a9('0x5'));var config=require(_0xd5a9('0x6'));var attributes=require(_0xd5a9('0x7'));module[_0xd5a9('0x8')]=function(_0x2a3137,_0x10570b){return _0x2a3137[_0xd5a9('0x9')]('ChatGroup',attributes,{'tableName':_0xd5a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c8d4354..478d3ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0bf=['error','ChatGroup,\x20%s,\x20%s','message','info','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xb0bf,0xf4));var _0xfb0b=function(_0x7356ce,_0x5f2f5c){_0x7356ce=_0x7356ce-0x0;var _0x2da25b=_0xb0bf[_0x7356ce];return _0x2da25b;};'use strict';var _=require('lodash');var util=require(_0xfb0b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfb0b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfb0b('0x2'));var logger=require(_0xfb0b('0x3'))(_0xfb0b('0x4'));var config=require(_0xfb0b('0x5'));var jayson=require(_0xfb0b('0x6'));var client=jayson[_0xfb0b('0x7')]['http']({'port':0x232a});config[_0xfb0b('0x8')]=_[_0xfb0b('0x9')](config[_0xfb0b('0x8')],{'host':_0xfb0b('0xa'),'port':0x18eb});var socket=require(_0xfb0b('0xb'))(new Redis(config['redis']));require(_0xfb0b('0xc'))[_0xfb0b('0xd')](socket);function respondWithRpcPromise(_0x40b3f3,_0x40646e,_0x576b7d){return new BPromise(function(_0x37d423,_0xff1784){return client[_0xfb0b('0xe')](_0x40b3f3,_0x576b7d)[_0xfb0b('0xf')](function(_0x3c01a2){logger['info']('ChatGroup,\x20%s,\x20%s',_0x40646e,_0xfb0b('0x10'));logger[_0xfb0b('0x11')](_0xfb0b('0x12'),_0x40646e,'request\x20sent',JSON[_0xfb0b('0x13')](_0x3c01a2));if(_0x3c01a2['error']){if(_0x3c01a2[_0xfb0b('0x14')]['code']===0x1f4){logger['error'](_0xfb0b('0x15'),_0x40646e,_0x3c01a2['error']['message']);return _0xff1784(_0x3c01a2[_0xfb0b('0x14')][_0xfb0b('0x16')]);}logger[_0xfb0b('0x14')](_0xfb0b('0x15'),_0x40646e,_0x3c01a2[_0xfb0b('0x14')][_0xfb0b('0x16')]);return _0x37d423(_0x3c01a2[_0xfb0b('0x14')][_0xfb0b('0x16')]);}else{logger[_0xfb0b('0x17')](_0xfb0b('0x15'),_0x40646e,_0xfb0b('0x10'));_0x37d423(_0x3c01a2['result']['message']);}})['catch'](function(_0x4e1ace){logger[_0xfb0b('0x14')](_0xfb0b('0x15'),_0x40646e,_0x4e1ace);_0xff1784(_0x4e1ace);});});}
\ No newline at end of file
+var _0x3d3e=['redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http'];(function(_0x3aa8e3,_0xaa3ed4){var _0xe1b4af=function(_0x39f939){while(--_0x39f939){_0x3aa8e3['push'](_0x3aa8e3['shift']());}};_0xe1b4af(++_0xaa3ed4);}(_0x3d3e,0x155));var _0xe3d3=function(_0x3a5259,_0x56af50){_0x3a5259=_0x3a5259-0x0;var _0x47a6bb=_0x3d3e[_0x3a5259];return _0x47a6bb;};'use strict';var _=require(_0xe3d3('0x0'));var util=require(_0xe3d3('0x1'));var moment=require(_0xe3d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3d3('0x3'));var fs=require('fs');var Redis=require(_0xe3d3('0x4'));var db=require(_0xe3d3('0x5'))['db'];var utils=require(_0xe3d3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe3d3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe3d3('0x8')]({'port':0x232a});config[_0xe3d3('0x9')]=_[_0xe3d3('0xa')](config[_0xe3d3('0x9')],{'host':_0xe3d3('0xb'),'port':0x18eb});var socket=require(_0xe3d3('0xc'))(new Redis(config[_0xe3d3('0x9')]));require(_0xe3d3('0xd'))[_0xe3d3('0xe')](socket);function respondWithRpcPromise(_0x4d0e77,_0x13488b,_0x29fd30){return new BPromise(function(_0x48643d,_0x481e77){return client[_0xe3d3('0xf')](_0x4d0e77,_0x29fd30)[_0xe3d3('0x10')](function(_0x3b517c){logger['info'](_0xe3d3('0x11'),_0x13488b,_0xe3d3('0x12'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x13488b,_0xe3d3('0x12'),JSON[_0xe3d3('0x13')](_0x3b517c));if(_0x3b517c[_0xe3d3('0x14')]){if(_0x3b517c[_0xe3d3('0x14')][_0xe3d3('0x15')]===0x1f4){logger['error'](_0xe3d3('0x11'),_0x13488b,_0x3b517c[_0xe3d3('0x14')][_0xe3d3('0x16')]);return _0x481e77(_0x3b517c[_0xe3d3('0x14')]['message']);}logger[_0xe3d3('0x14')](_0xe3d3('0x11'),_0x13488b,_0x3b517c['error']['message']);return _0x48643d(_0x3b517c['error'][_0xe3d3('0x16')]);}else{logger[_0xe3d3('0x17')](_0xe3d3('0x11'),_0x13488b,'request\x20sent');_0x48643d(_0x3b517c['result'][_0xe3d3('0x16')]);}})[_0xe3d3('0x18')](function(_0x542a36){logger[_0xe3d3('0x14')]('ChatGroup,\x20%s,\x20%s',_0x13488b,_0x542a36);_0x481e77(_0x542a36);});});}
\ No newline at end of file
index f2c68f4..30a085a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe098=['length','chatGroup:','./chatGroup.events','save','emit','removeListener'];(function(_0x1ccf97,_0xbfb730){var _0xc0569e=function(_0x4bd31c){while(--_0x4bd31c){_0x1ccf97['push'](_0x1ccf97['shift']());}};_0xc0569e(++_0xbfb730);}(_0xe098,0x17c));var _0x8e09=function(_0x525815,_0x523737){_0x525815=_0x525815-0x0;var _0x352cc7=_0xe098[_0x525815];return _0x352cc7;};'use strict';var ChatGroupEvents=require(_0x8e09('0x0'));var events=[_0x8e09('0x1'),'remove','update'];function createListener(_0x3b0944,_0x4d6266){return function(_0x477301){_0x4d6266[_0x8e09('0x2')](_0x3b0944,_0x477301);};}function removeListener(_0x1866c6,_0x26168c){return function(){ChatGroupEvents[_0x8e09('0x3')](_0x1866c6,_0x26168c);};}exports['register']=function(_0x3e879a){for(var _0x46ebf0=0x0,_0x416cc7=events[_0x8e09('0x4')];_0x46ebf0<_0x416cc7;_0x46ebf0++){var _0x4f4e2c=events[_0x46ebf0];var _0x5a4384=createListener(_0x8e09('0x5')+_0x4f4e2c,_0x3e879a);ChatGroupEvents['on'](_0x4f4e2c,_0x5a4384);}};
\ No newline at end of file
+var _0x3670=['./chatGroup.events','remove','update','emit','register','length'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x3670,0xfc));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var ChatGroupEvents=require(_0x0367('0x0'));var events=['save',_0x0367('0x1'),_0x0367('0x2')];function createListener(_0x9a9776,_0x19646f){return function(_0x3f3a85){_0x19646f[_0x0367('0x3')](_0x9a9776,_0x3f3a85);};}function removeListener(_0x232c26,_0x21fd9f){return function(){ChatGroupEvents['removeListener'](_0x232c26,_0x21fd9f);};}exports[_0x0367('0x4')]=function(_0x36f42b){for(var _0x27a4f1=0x0,_0x5bf074=events[_0x0367('0x5')];_0x27a4f1<_0x5bf074;_0x27a4f1++){var _0x5a6292=events[_0x27a4f1];var _0x3d6dca=createListener('chatGroup:'+_0x5a6292,_0x36f42b);ChatGroupEvents['on'](_0x5a6292,_0x3d6dca);}};
\ No newline at end of file
index fde6795..b00bed6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6672=['./chatGroup.controller','get','index','/describe','describe','/:id','isAuthenticated','show','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0x6672,0x138));var _0x2667=function(_0x3889ae,_0x4770c3){_0x3889ae=_0x3889ae-0x0;var _0x6533dd=_0x6672[_0x3889ae];return _0x6533dd;};'use strict';var multer=require(_0x2667('0x0'));var util=require(_0x2667('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2667('0x2'));var router=express[_0x2667('0x3')]();var fs_extra=require(_0x2667('0x4'));var auth=require(_0x2667('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2667('0x6'));var controller=require(_0x2667('0x7'));router[_0x2667('0x8')]('/',auth['isAuthenticated'](),controller[_0x2667('0x9')]);router['get'](_0x2667('0xa'),auth['isAuthenticated'](),controller[_0x2667('0xb')]);router[_0x2667('0x8')](_0x2667('0xc'),auth[_0x2667('0xd')](),controller[_0x2667('0xe')]);router[_0x2667('0x8')]('/:id/unread',auth[_0x2667('0xd')](),controller[_0x2667('0xf')]);router[_0x2667('0x8')]('/:id/members',auth[_0x2667('0xd')](),controller[_0x2667('0x10')]);router[_0x2667('0x8')](_0x2667('0x11'),auth[_0x2667('0xd')](),controller[_0x2667('0x12')]);router[_0x2667('0x13')]('/',auth['isAuthenticated'](),controller[_0x2667('0x14')]);router['post'](_0x2667('0x15'),auth['isAuthenticated'](),controller[_0x2667('0x16')]);router[_0x2667('0x13')](_0x2667('0x11'),auth[_0x2667('0xd')](),controller[_0x2667('0x17')]);router['put'](_0x2667('0xc'),auth['isAuthenticated'](),controller[_0x2667('0x18')]);router[_0x2667('0x19')](_0x2667('0xc'),auth[_0x2667('0xd')](),controller[_0x2667('0x1a')]);router['delete'](_0x2667('0x15'),auth[_0x2667('0xd')](),controller[_0x2667('0x1b')]);module[_0x2667('0x1c')]=router;
\ No newline at end of file
+var _0xd089=['update','removeMembers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMessage','put'];(function(_0x38366d,_0x405df3){var _0x40e477=function(_0x802ebc){while(--_0x802ebc){_0x38366d['push'](_0x38366d['shift']());}};_0x40e477(++_0x405df3);}(_0xd089,0xf3));var _0x9d08=function(_0x5216c8,_0x9ec1c1){_0x5216c8=_0x5216c8-0x0;var _0x5d725c=_0xd089[_0x5216c8];return _0x5d725c;};'use strict';var multer=require(_0x9d08('0x0'));var util=require(_0x9d08('0x1'));var path=require(_0x9d08('0x2'));var timeout=require(_0x9d08('0x3'));var express=require('express');var router=express[_0x9d08('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9d08('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9d08('0x6'));var controller=require('./chatGroup.controller');router[_0x9d08('0x7')]('/',auth[_0x9d08('0x8')](),controller[_0x9d08('0x9')]);router[_0x9d08('0x7')](_0x9d08('0xa'),auth[_0x9d08('0x8')](),controller['describe']);router['get'](_0x9d08('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9d08('0x7')](_0x9d08('0xc'),auth[_0x9d08('0x8')](),controller[_0x9d08('0xd')]);router[_0x9d08('0x7')](_0x9d08('0xe'),auth[_0x9d08('0x8')](),controller['getMembers']);router[_0x9d08('0x7')](_0x9d08('0xf'),auth[_0x9d08('0x8')](),controller[_0x9d08('0x10')]);router[_0x9d08('0x11')]('/',auth[_0x9d08('0x8')](),controller[_0x9d08('0x12')]);router[_0x9d08('0x11')]('/:id/members',auth[_0x9d08('0x8')](),controller['addMembers']);router[_0x9d08('0x11')](_0x9d08('0xf'),auth[_0x9d08('0x8')](),controller[_0x9d08('0x13')]);router[_0x9d08('0x14')]('/:id',auth[_0x9d08('0x8')](),controller[_0x9d08('0x15')]);router['delete'](_0x9d08('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/members',auth[_0x9d08('0x8')](),controller[_0x9d08('0x16')]);module[_0x9d08('0x17')]=router;
\ No newline at end of file
index 91905ce..2daeec6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdca3=['sequelize','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x3c700f,_0x2ad2c8){var _0x1bf773=function(_0x205d1f){while(--_0x205d1f){_0x3c700f['push'](_0x3c700f['shift']());}};_0x1bf773(++_0x2ad2c8);}(_0xdca3,0x64));var _0x3dca=function(_0x33590f,_0x3b4be8){_0x33590f=_0x33590f-0x0;var _0x412e81=_0xdca3[_0x33590f];return _0x412e81;};'use strict';var Sequelize=require(_0x3dca('0x0'));module['exports']={'closed':{'type':Sequelize[_0x3dca('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3dca('0x2')]},'ratingType':{'type':Sequelize[_0x3dca('0x3')](_0x3dca('0x4'),_0x3dca('0x5')),'defaultValue':_0x3dca('0x4')},'ratingMessage':{'type':Sequelize[_0x3dca('0x6')]},'pathTranscript':{'type':Sequelize[_0x3dca('0x6')]},'mailTranscript':{'type':Sequelize[_0x3dca('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3dca('0x8')]},'disposition':{'type':Sequelize[_0x3dca('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3dca('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x3dca('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x3dca('0x7')]},'deviceModel':{'type':Sequelize[_0x3dca('0x7')]},'deviceVendor':{'type':Sequelize[_0x3dca('0x7')]},'deviceType':{'type':Sequelize[_0x3dca('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3dca('0x7')]},'formData':{'type':Sequelize[_0x3dca('0x6')](_0x3dca('0x9'))},'read1stAt':{'type':Sequelize[_0x3dca('0x8')]},'lastMsgAt':{'type':Sequelize[_0x3dca('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x3dca('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3dca('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x3dca('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8f59=['star','TEXT','STRING','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x121ff3,_0x35ecab){var _0x1ee354=function(_0x179bba){while(--_0x179bba){_0x121ff3['push'](_0x121ff3['shift']());}};_0x1ee354(++_0x35ecab);}(_0x8f59,0x11d));var _0x98f5=function(_0x1465dc,_0x4d684d){_0x1465dc=_0x1465dc-0x0;var _0x226206=_0x8f59[_0x1465dc];return _0x226206;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'closed':{'type':Sequelize[_0x98f5('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x98f5('0x3')]},'ratingType':{'type':Sequelize[_0x98f5('0x4')](_0x98f5('0x5'),'thumb'),'defaultValue':_0x98f5('0x5')},'ratingMessage':{'type':Sequelize[_0x98f5('0x6')]},'pathTranscript':{'type':Sequelize[_0x98f5('0x6')]},'mailTranscript':{'type':Sequelize[_0x98f5('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x98f5('0x7')]},'secondDisposition':{'type':Sequelize[_0x98f5('0x7')]},'thirdDisposition':{'type':Sequelize[_0x98f5('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x98f5('0x7')]},'osName':{'type':Sequelize[_0x98f5('0x7')]},'osVersion':{'type':Sequelize[_0x98f5('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x98f5('0x7')]},'deviceType':{'type':Sequelize[_0x98f5('0x7')]},'referer':{'type':Sequelize[_0x98f5('0x6')]},'customerIp':{'type':Sequelize[_0x98f5('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x98f5('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x98f5('0x4')]('in',_0x98f5('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x98f5('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x98f5('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x98f5('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 6035766..a21609f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef52=['http','client','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','sendStatus','end','status','json','undefined','limit','count','offset','apply','reject','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','Users','fullname','TagIds','Tags','forEach','push','catch','waiting','answered','unmanaged','abandoned','total','closed','UserId','talking','disposition','index','ChatInteraction','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','field','color','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','isEmpty','ChatWebsiteId','where','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','length','ui.ChatInteractionId\x20IN\x20?','groupBy','rows','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','file','originalname','mimetype','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','System','customer','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','ChatInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','includeAgent','addTags','setTags','emit','removeTags','unix','root','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','basename','existsSync','createReadStream','direction','out','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise'];(function(_0x3e9edb,_0x36feb5){var _0x59d228=function(_0xf51569){while(--_0xf51569){_0x3e9edb['push'](_0x3e9edb['shift']());}};_0x59d228(++_0x36feb5);}(_0xef52,0x126));var _0x2ef5=function(_0x3b3933,_0x4a5bd2){_0x3b3933=_0x3b3933-0x0;var _0x41d2c4=_0xef52[_0x3b3933];return _0x41d2c4;};'use strict';var emlformat=require(_0x2ef5('0x0'));var rimraf=require(_0x2ef5('0x1'));var zipdir=require(_0x2ef5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2ef5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2ef5('0x4'));var util=require(_0x2ef5('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2ef5('0x6'));var ejs=require(_0x2ef5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2ef5('0x8'));var crypto=require(_0x2ef5('0x9'));var jsforce=require(_0x2ef5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2ef5('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2ef5('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2ef5('0xc'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ef5('0xd'))(_0x2ef5('0xe'));var utils=require(_0x2ef5('0xf'));var config=require(_0x2ef5('0x10'));var licenseUtil=require(_0x2ef5('0x11'));var db=require(_0x2ef5('0x12'))['db'];config['redis']=_[_0x2ef5('0x13')](config[_0x2ef5('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ef5('0x15'))(new Redis(config[_0x2ef5('0x14')]));require(_0x2ef5('0x16'))[_0x2ef5('0x17')](socket);var jayson=require(_0x2ef5('0x18'));var client=jayson['client'][_0x2ef5('0x19')]({'port':0x232b});var client9004=jayson[_0x2ef5('0x1a')][_0x2ef5('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x52e3f2,_0x2373f1,_0x1cf3d0,_0x550112){return new BPromise(function(_0x3e7fdd,_0x11ecbc){var _0x4b3b5c=_0x550112||client;return _0x4b3b5c[_0x2ef5('0x1b')](_0x52e3f2,_0x1cf3d0)[_0x2ef5('0x1c')](function(_0x552f05){logger[_0x2ef5('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x2373f1,_0x2ef5('0x1e'));logger[_0x2ef5('0x1f')](_0x2ef5('0x20'),_0x2373f1,_0x2ef5('0x1e'),JSON[_0x2ef5('0x21')](_0x552f05));if(_0x552f05[_0x2ef5('0x22')]){if(_0x552f05[_0x2ef5('0x22')]['code']===0x1f4){logger[_0x2ef5('0x22')](_0x2ef5('0x23'),_0x2373f1,_0x552f05[_0x2ef5('0x22')]['message']);return _0x11ecbc(_0x552f05[_0x2ef5('0x22')][_0x2ef5('0x24')]);}logger[_0x2ef5('0x22')](_0x2ef5('0x23'),_0x2373f1,_0x552f05[_0x2ef5('0x22')][_0x2ef5('0x24')]);return _0x3e7fdd(_0x552f05['error'][_0x2ef5('0x24')]);}else{logger[_0x2ef5('0x1d')](_0x2ef5('0x23'),_0x2373f1,_0x2ef5('0x1e'));_0x3e7fdd(_0x552f05['result']['message']);}})['catch'](function(_0x7ca602){logger[_0x2ef5('0x22')](_0x2ef5('0x23'),_0x2373f1,_0x7ca602);_0x11ecbc(_0x7ca602);});});}function respondWithStatusCode(_0x23f915,_0x3f6602){_0x3f6602=_0x3f6602||0xcc;return function(_0x469649){if(_0x469649){return _0x23f915[_0x2ef5('0x25')](_0x3f6602);}return _0x23f915['status'](_0x3f6602)[_0x2ef5('0x26')]();};}function respondWithResult(_0x37c3be,_0x283c56){_0x283c56=_0x283c56||0xc8;return function(_0x221ec7){if(_0x221ec7){return _0x37c3be[_0x2ef5('0x27')](_0x283c56)[_0x2ef5('0x28')](_0x221ec7);}};}function respondWithFilteredResult(_0x1af6b9,_0x226d66){return function(_0x4e53a2){if(_0x4e53a2){var _0x70535d=typeof _0x226d66['offset']===_0x2ef5('0x29')&&typeof _0x226d66[_0x2ef5('0x2a')]===_0x2ef5('0x29');var _0x86cd2b=_0x4e53a2[_0x2ef5('0x2b')];var _0x229c7f=_0x70535d?0x0:_0x226d66[_0x2ef5('0x2c')];var _0x3c237d=_0x70535d?_0x4e53a2[_0x2ef5('0x2b')]:_0x226d66[_0x2ef5('0x2c')]+_0x226d66[_0x2ef5('0x2a')];var _0x139f3f;if(_0x3c237d>=_0x86cd2b){_0x3c237d=_0x86cd2b;_0x139f3f=0xc8;}else{_0x139f3f=0xce;}_0x1af6b9[_0x2ef5('0x27')](_0x139f3f);return _0x1af6b9['set']('Content-Range',_0x229c7f+'-'+_0x3c237d+'/'+_0x86cd2b)['json'](_0x4e53a2);}return null;};}function patchUpdates(_0x4fb99c){return function(_0x562fca){try{jsonpatch[_0x2ef5('0x2d')](_0x562fca,_0x4fb99c,!![]);}catch(_0x4fc154){return BPromise[_0x2ef5('0x2e')](_0x4fc154);}return _0x562fca[_0x2ef5('0x2f')]();};}function saveUpdates(_0x54e32a,_0x2ad01a){return function(_0x33c633){if(_0x33c633){return _0x33c633[_0x2ef5('0x30')](_0x54e32a)[_0x2ef5('0x1c')](function(_0x394ae2){return _0x394ae2;});}return null;};}function removeEntity(_0x49b9a8,_0x55943b){return function(_0x473f5a){if(_0x473f5a){return _0x473f5a[_0x2ef5('0x31')]()[_0x2ef5('0x1c')](function(){_0x49b9a8[_0x2ef5('0x27')](0xcc)[_0x2ef5('0x26')]();});}};}function handleEntityNotFound(_0x1674ce,_0x53ba97){return function(_0x25ff9f){if(!_0x25ff9f){_0x1674ce['sendStatus'](0x194);}return _0x25ff9f;};}function handleError(_0x122190,_0x3dafc5){_0x3dafc5=_0x3dafc5||0x1f4;return function(_0x3f5a8e){logger[_0x2ef5('0x22')](_0x3f5a8e[_0x2ef5('0x32')]);if(_0x3f5a8e[_0x2ef5('0x33')]){delete _0x3f5a8e[_0x2ef5('0x33')];}_0x122190['status'](_0x3dafc5)[_0x2ef5('0x34')](_0x3f5a8e);};}function getMustacheRender(_0x16df1e,_0x50f4d2){return Mustache[_0x2ef5('0x35')](_0x16df1e,_[_0x2ef5('0x36')](_0x50f4d2[_0x2ef5('0x37')],{'contact':_0x50f4d2[_0x2ef5('0x38')],'message':_0x50f4d2[_0x2ef5('0x24')],'agent':_0x50f4d2[_0x2ef5('0x39')],'interaction':_0x50f4d2[_0x2ef5('0x3a')],'account':_0x50f4d2[_0x2ef5('0x3b')]}))||'';}function getInteractionUsers(_0x2393ee,_0x41d254){return new BPromise(function(_0x2cc971,_0x47e3a4){try{if(_0x41d254[_0x2393ee['id']]){_0x2393ee[_0x2ef5('0x3c')]=_['map'](_0x41d254[_0x2393ee['id']],function(_0x464901){return{'id':_0x464901['id'],'fullname':_0x464901[_0x2ef5('0x3d')]};});}}catch(_0x3b9108){_0x47e3a4(_0x3b9108);}_0x2cc971(_0x2393ee);});}function getInteractionTags(_0x430e7e,_0x3f8704){return new BPromise(function(_0x3f64df,_0x5bab8e){try{if(_0x430e7e[_0x2ef5('0x3e')]){_0x430e7e[_0x2ef5('0x3f')]=[];_0x430e7e[_0x2ef5('0x3e')]['split'](',')[_0x2ef5('0x40')](function(_0x164dc8){_0x430e7e[_0x2ef5('0x3f')][_0x2ef5('0x41')](_0x3f8704[_0x164dc8]);});}delete _0x430e7e['TagIds'];}catch(_0x36238c){_0x5bab8e(_0x36238c);}_0x3f64df(_0x430e7e);});}function updateChatInteraction(_0x49c022,_0x83a41f,_0x3786c9){return new BPromise(function(_0x241210,_0x41e274){return getInteractionUsers(_0x49c022,_0x3786c9)[_0x2ef5('0x1c')](function(_0x4c29a8){return getInteractionTags(_0x4c29a8,_0x83a41f);})['then'](function(_0x15d325){return getStateInteraction(_0x15d325);})[_0x2ef5('0x1c')](function(_0x46b2e0){_0x241210(_0x46b2e0);})[_0x2ef5('0x42')](function(_0x211cbf){_0x41e274(_0x211cbf);});});}function getStateInteraction(_0x5dcf17){return new BPromise(function(_0xc2c25a){_0x5dcf17[_0x2ef5('0x43')]=0x0;_0x5dcf17['talking']=0x0;_0x5dcf17[_0x2ef5('0x44')]=0x0;_0x5dcf17[_0x2ef5('0x45')]=0x0;_0x5dcf17[_0x2ef5('0x46')]=0x0;_0x5dcf17[_0x2ef5('0x47')]=0x0;if(!_0x5dcf17[_0x2ef5('0x48')]&&!_0x5dcf17[_0x2ef5('0x49')]){_0x5dcf17[_0x2ef5('0x43')]+=0x1;}if(!_0x5dcf17['closed']&&_0x5dcf17[_0x2ef5('0x49')]){_0x5dcf17[_0x2ef5('0x4a')]+=0x1;if(_0x5dcf17[_0x2ef5('0x43')]){_0x5dcf17[_0x2ef5('0x43')]-=0x1;}}if(_0x5dcf17[_0x2ef5('0x48')]&&_0x5dcf17[_0x2ef5('0x4b')]===_0x2ef5('0x46')){_0x5dcf17[_0x2ef5('0x46')]+=0x1;if(_0x5dcf17[_0x2ef5('0x43')]){_0x5dcf17['waiting']-=0x1;}}else if(_0x5dcf17['closed']&&!_0x5dcf17[_0x2ef5('0x49')]&&_0x5dcf17[_0x2ef5('0x4b')]){_0x5dcf17['unmanaged']+=0x1;if(_0x5dcf17[_0x2ef5('0x43')]){_0x5dcf17[_0x2ef5('0x43')]-=0x1;}}else if(_0x5dcf17['closed']&&_0x5dcf17['UserId']){_0x5dcf17[_0x2ef5('0x44')]+=0x1;if(_0x5dcf17[_0x2ef5('0x4a')]){_0x5dcf17['talking']-=0x1;}}_0x5dcf17[_0x2ef5('0x47')]+=0x1;_0xc2c25a(_0x5dcf17);});}exports[_0x2ef5('0x4c')]=function(_0x13bc7a,_0x31a3a3){var _0x2d1378={},_0x17803e={},_0x5cf7c0={'count':0x0,'rows':[]};var _0xda5811=_['map'](db[_0x2ef5('0x4d')][_0x2ef5('0x4e')],function(_0x157ee0){return{'name':_0x157ee0[_0x2ef5('0x4f')],'type':_0x157ee0[_0x2ef5('0x50')][_0x2ef5('0x51')]};});_0x17803e['model']=_[_0x2ef5('0x52')](_0xda5811,_0x2ef5('0x33'));_0x17803e[_0x2ef5('0x53')]=_[_0x2ef5('0x54')](_0x13bc7a[_0x2ef5('0x53')]);_0x17803e[_0x2ef5('0x55')]=_[_0x2ef5('0x56')](_0x17803e[_0x2ef5('0x57')],_0x17803e[_0x2ef5('0x53')]);_0x2d1378[_0x2ef5('0x58')]=_[_0x2ef5('0x56')](_0x17803e[_0x2ef5('0x57')],qs[_0x2ef5('0x59')](_0x13bc7a[_0x2ef5('0x53')][_0x2ef5('0x59')]));_0x2d1378[_0x2ef5('0x58')]=_0x2d1378['attributes']['length']?_0x2d1378[_0x2ef5('0x58')]:_0x17803e['model'];if(!_0x13bc7a['query'][_0x2ef5('0x5a')](_0x2ef5('0x5b'))){_0x2d1378[_0x2ef5('0x2a')]=qs[_0x2ef5('0x2a')](_0x13bc7a[_0x2ef5('0x53')][_0x2ef5('0x2a')]);_0x2d1378['offset']=qs[_0x2ef5('0x2c')](_0x13bc7a[_0x2ef5('0x53')][_0x2ef5('0x2c')]);}_0x2d1378['order']=qs[_0x2ef5('0x5c')](_0x13bc7a['query']['sort']);_0x2d1378['where']=qs[_0x2ef5('0x55')](_[_0x2ef5('0x5d')](_0x13bc7a[_0x2ef5('0x53')],_0x17803e['filters']),_0xda5811);var _0x3b90a6=[];var _0x5a22e6=squel['select']()[_0x2ef5('0x5e')]('id')[_0x2ef5('0x5e')](_0x2ef5('0x33'))[_0x2ef5('0x5e')](_0x2ef5('0x5f'))['from'](_0x2ef5('0x60'));var _0x2de3ad=squel[_0x2ef5('0x61')]()[_0x2ef5('0x5e')](_0x2ef5('0x62'))['field'](_0x2ef5('0x63'))[_0x2ef5('0x5e')](_0x2ef5('0x64'))[_0x2ef5('0x65')](_0x2ef5('0x66'),'ui')[_0x2ef5('0x67')](_0x2ef5('0x68'),'u',_0x2ef5('0x69'));var _0x37c196=squel[_0x2ef5('0x61')]()[_0x2ef5('0x65')](_0x2ef5('0x6a'),'i')[_0x2ef5('0x67')](_0x2ef5('0x6b'),'c',_0x2ef5('0x6c'))[_0x2ef5('0x67')]('users','o','o.id\x20=\x20i.UserId')[_0x2ef5('0x67')](_0x2ef5('0x6d'),'a',_0x2ef5('0x6e'))['left_join']('chat_messages','me',_0x2ef5('0x6f'))[_0x2ef5('0x67')](_0x2ef5('0x70'),'it',_0x2ef5('0x71'))['left_join'](_0x2ef5('0x60'),'t',_0x2ef5('0x72'));var _0x1e2454=squel[_0x2ef5('0x73')]();var _0x331f28=[];var _0xa77a2b=squel[_0x2ef5('0x73')]();var _0xcd55aa;if(_0x13bc7a[_0x2ef5('0x53')]['search']){_0xcd55aa=as[_0x2ef5('0x74')](_0x13bc7a[_0x2ef5('0x53')][_0x2ef5('0x75')]);var _0x377bd0=_0xcd55aa[_0x2ef5('0x76')];for(var _0x2e993e=0x0;_0x2e993e<_0xcd55aa[_0x2ef5('0x77')]['length'];_0x2e993e++){var _0x319875=_0xcd55aa[_0x2ef5('0x77')][_0x2e993e];var _0xfbf56='i';var _0x58161c=_[_0x2ef5('0x78')](_0xda5811,[_0x2ef5('0x33'),_0x319875[_0x2ef5('0x5e')]]);if(!_0x58161c){switch(_0x319875[_0x2ef5('0x5e')]){case _0x2ef5('0x79'):if(_0x319875[_0x2ef5('0x7a')]==0x1){_0x37c196[_0x2ef5('0x7b')]('`'+_0x319875[_0x2ef5('0x5e')]+_0x2ef5('0x7c'));}else{_0x37c196[_0x2ef5('0x7b')]('`'+_0x319875[_0x2ef5('0x5e')]+'`\x20>\x200');}break;case _0x2ef5('0x7d'):if(_0x319875[_0x2ef5('0x7e')]===_0x2ef5('0x7f')){if(_0x319875['value'][_0x2ef5('0x80')]('\x20')['length']>0x1){_0x1e2454[_0x377bd0](_0x2ef5('0x81'),qs[_0x2ef5('0x82')](_0x319875[_0x2ef5('0x7a')]),null);}else{var _0x2766e0='%'+_0x319875['value']+'%';_0x1e2454[_0x377bd0]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2766e0,_0x2766e0,_0x2766e0);}}else{_0x58161c=_[_0x2ef5('0x78')](_0xda5811,[_0x2ef5('0x33'),_0x2ef5('0x83')]);_0x319875[_0x2ef5('0x5e')]=_0x2ef5('0x83');_0x33575e=as[_0x2ef5('0x84')](_0xfbf56,_0x58161c[_0x2ef5('0x50')],_0x319875);_0x1e2454[_0x377bd0](_0x33575e[_0x2ef5('0x85')],_0x33575e[_0x2ef5('0x7a')][_0x2ef5('0x86')],_0x33575e[_0x2ef5('0x7a')]['end']);}break;case _0x2ef5('0x87'):var _0x30bde0=_0x319875[_0x2ef5('0x7a')][_0x2ef5('0x80')](',')['map'](function(_0x5e5a2d){return Number(_0x5e5a2d);});_0x30bde0[_0x2ef5('0x40')](function(_0x159bcb){_0xa77a2b['or'](_0x2ef5('0x88'),'%,'+_0x159bcb+',%');});_0x331f28=_['union'](_0x331f28,_0x30bde0);break;case _0x2ef5('0x89'):if(_0x319875['operator']===_0x2ef5('0x7f')){_0x1e2454[_0x377bd0](_0x2ef5('0x8a'),'%'+_0x319875[_0x2ef5('0x7a')]+'%',null);}else{_0x58161c=_[_0x2ef5('0x78')](_0xda5811,[_0x2ef5('0x33'),_0x2ef5('0x49')]);_0x319875[_0x2ef5('0x5e')]=_0x2ef5('0x49');_0x33575e=as['buildExpression'](_0xfbf56,_0x58161c['type'],_0x319875);_0x1e2454[_0x377bd0](_0x33575e['text'],_0x33575e[_0x2ef5('0x7a')][_0x2ef5('0x86')],_0x33575e[_0x2ef5('0x7a')][_0x2ef5('0x26')]);}break;case _0x2ef5('0x37'):_0x33575e=as[_0x2ef5('0x84')]('me',null,_0x319875);_0x1e2454[_0x377bd0](_0x33575e[_0x2ef5('0x85')],_0x33575e[_0x2ef5('0x7a')][_0x2ef5('0x86')],_0x33575e[_0x2ef5('0x7a')][_0x2ef5('0x26')]);break;}}else{var _0x33575e=as[_0x2ef5('0x84')](_0xfbf56,_0x58161c[_0x2ef5('0x50')],_0x319875);_0x1e2454[_0x377bd0](_0x33575e['text'],_0x33575e[_0x2ef5('0x7a')]['start'],_0x33575e['value'][_0x2ef5('0x26')]);}}}else{var _0x1cd9ed=_(_0x13bc7a[_0x2ef5('0x53')])[_0x2ef5('0x54')]()[_0x2ef5('0x52')](function(_0x13480b){return _[_0x2ef5('0x8b')](_0xda5811,[_0x2ef5('0x33'),_0x13480b])?_0x13480b:undefined;})['compact']()['value']();if(!_[_0x2ef5('0x8c')](_0x1cd9ed)){_0x1cd9ed[_0x2ef5('0x40')](function(_0x37ec56){if(_0x37ec56===_0x2ef5('0x8d')){_0x37c196[_0x2ef5('0x8e')]('i.ChatWebsiteId\x20IN\x20?',[][_0x2ef5('0x8f')](_0x13bc7a[_0x2ef5('0x53')][_0x37ec56]));}else if(_0x37ec56===_0x2ef5('0x90')){var _0xd31b4e=JSON[_0x2ef5('0x91')](_0x13bc7a['query'][_0x37ec56])['$gte'];var _0x171bf7=JSON[_0x2ef5('0x91')](_0x13bc7a[_0x2ef5('0x53')][_0x37ec56])[_0x2ef5('0x92')];_0x37c196['where'](_0x2ef5('0x93'),_0xd31b4e,_0x171bf7);}else{if(_0x13bc7a[_0x2ef5('0x53')][_0x37ec56]===_0x2ef5('0x94')){_0x37c196[_0x2ef5('0x8e')]('i.'+_0x37ec56+_0x2ef5('0x95'));}else{_0x37c196['where']('i.'+_0x37ec56+'\x20=\x20?',_0x13bc7a[_0x2ef5('0x53')][_0x37ec56]);}}});}if(_0x13bc7a[_0x2ef5('0x53')][_0x2ef5('0x96')]){if(_0x13bc7a[_0x2ef5('0x53')][_0x2ef5('0x96')]==0x1){_0x37c196[_0x2ef5('0x7b')](_0x2ef5('0x97'));}else{_0x37c196[_0x2ef5('0x7b')]('`unreadMessages`\x20>\x200');}}if(_0x13bc7a[_0x2ef5('0x53')][_0x2ef5('0x98')]){_0x331f28=_[_0x2ef5('0x99')](_0x13bc7a[_0x2ef5('0x53')][_0x2ef5('0x98')])?_0x13bc7a[_0x2ef5('0x53')]['tag']:new Array(_0x13bc7a[_0x2ef5('0x53')]['tag']);_0x331f28[_0x2ef5('0x40')](function(_0x24fd43){_0xa77a2b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x24fd43+',%');});}if(_0x13bc7a[_0x2ef5('0x53')]['filter']){var _0x2eac63=_0x13bc7a['query'][_0x2ef5('0x9a')][_0x2ef5('0x9b')]('\x5c','\x5c\x5c')[_0x2ef5('0x9b')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2eac63)){_0x1e2454['or'](_0x2ef5('0x9c'),_0x2eac63+'%');}else{_0x1e2454['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x2eac63))['or'](_0x2ef5('0x9d'),_0x2eac63+'%');}}}_0x37c196[_0x2ef5('0x8e')](_0x1e2454);_0x37c196[_0x2ef5('0x9e')](_0x2ef5('0x9f'));var _0x41eaac={'type':db[_0x2ef5('0xa0')][_0x2ef5('0xa1')]['SELECT'],'raw':!![]};var _0x3f4a77=_0x37c196['clone']();_0x3f4a77[_0x2ef5('0x5e')](_0x2ef5('0x9f'));_0x3f4a77[_0x2ef5('0x5e')](_0x2ef5('0xa2'),'unreadMessages');if(_0x2d1378[_0x2ef5('0xa3')]){_0x2d1378['order'][_0x2ef5('0x40')](function(_0x161176){var _0x3c17aa=_0x161176[0x0]===_0x2ef5('0xa4')?_0x161176[0x0]:'i.'+_0x161176[0x0];_0x37c196[_0x2ef5('0xa3')](_0x3c17aa,_0x161176[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x331f28)){_0x37c196[_0x2ef5('0x7b')](_0xa77a2b);_0x3f4a77['where'](_0x2ef5('0xa5'),_0x331f28);}BPromise['resolve']()[_0x2ef5('0x1c')](function(){if(!_0xcd55aa){if(_0x13bc7a['query'][_0x2ef5('0x8d')])return;_0x3f4a77[_0x2ef5('0x8e')](_0x2ef5('0xa6'));_0x37c196['where'](_0x2ef5('0xa6'));return;}if(_0x13bc7a[_0x2ef5('0xa7')][_0x2ef5('0xa8')]!==_0x2ef5('0x39'))return;return _0x13bc7a[_0x2ef5('0xa7')][_0x2ef5('0xa9')]({'attributes':['id'],'raw':!![]})[_0x2ef5('0x1c')](function(_0x227040){if(_[_0x2ef5('0x8c')](_0x227040)){_0x3f4a77[_0x2ef5('0x8e')](_0x2ef5('0xaa'));_0x37c196[_0x2ef5('0x8e')](_0x2ef5('0xaa'));}else{_0x3f4a77[_0x2ef5('0x8e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x2ef5('0x52')](_0x227040,'id'));_0x37c196['where'](_0x2ef5('0xab'),_[_0x2ef5('0x52')](_0x227040,'id'));}});})[_0x2ef5('0x1c')](function(){if(_0x13bc7a[_0x2ef5('0xa7')]['role']===_0x2ef5('0x39')&&!_0xcd55aa&&!_0x13bc7a[_0x2ef5('0x53')][_0x2ef5('0x8d')])return[];return db[_0x2ef5('0xac')]['query'](_0x3f4a77[_0x2ef5('0xad')](),_0x41eaac);})['then'](function(_0x451487){_0x5cf7c0[_0x2ef5('0x2b')]=_0x451487['length'];if(_0x5cf7c0['count']===0x0)return[];return db['sequelize']['query'](_0x5a22e6[_0x2ef5('0xad')](),_0x41eaac)[_0x2ef5('0x1c')](function(_0x4f851f){_0x3b90a6=_[_0x2ef5('0xae')](_0x4f851f,'id');_0x41eaac=_[_0x2ef5('0x36')](_0x41eaac,{'model':db[_0x2ef5('0x4d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13bc7a[_0x2ef5('0x53')][_0x2ef5('0x59')]){_0x2d1378[_0x2ef5('0x58')][_0x2ef5('0x40')](function(_0x368cac){_0x37c196[_0x2ef5('0x5e')]('i.'+_0x368cac);});}else{_0x37c196[_0x2ef5('0x5e')](_0x2ef5('0xa2'),_0x2ef5('0x79'));_0x37c196[_0x2ef5('0x5e')](_0x2ef5('0xaf'),_0x2ef5('0xb0'));_0x37c196['field'](_0x2ef5('0xb1'),_0x2ef5('0xb2'));_0x37c196[_0x2ef5('0x5e')](_0x2ef5('0xb3'),'contactName');_0x37c196[_0x2ef5('0x5e')](_0x2ef5('0xb4'));_0x37c196[_0x2ef5('0x5e')]('c.firstName',_0x2ef5('0xb5'));_0x37c196[_0x2ef5('0x5e')](_0x2ef5('0xb6'),_0x2ef5('0xb7'));_0x37c196['field'](_0x2ef5('0xb8'),'Contact.email');_0x37c196['field'](_0x2ef5('0xb9'),_0x2ef5('0xba'));_0x37c196[_0x2ef5('0x5e')]('c.mobile',_0x2ef5('0xbb'));_0x37c196[_0x2ef5('0x5e')](_0x2ef5('0xbc'),'Contact.fax');_0x37c196['field'](_0x2ef5('0xbd'),_0x2ef5('0xbe'));_0x37c196[_0x2ef5('0x5e')](_0x2ef5('0xbf'),'Owner.internal');_0x37c196[_0x2ef5('0x5e')](_0x2ef5('0xc0'),'TagIds');}if(_0x2d1378[_0x2ef5('0x2a')])_0x37c196[_0x2ef5('0x2a')](_0x2d1378[_0x2ef5('0x2a')]);if(_0x2d1378[_0x2ef5('0x2c')])_0x37c196[_0x2ef5('0x2c')](_0x2d1378['offset']);return db[_0x2ef5('0xac')][_0x2ef5('0x53')](_0x37c196[_0x2ef5('0xad')](),_0x41eaac);})[_0x2ef5('0x1c')](function(_0x53c0b2){if(_0x53c0b2[_0x2ef5('0xc1')]>0x0)_0x2de3ad[_0x2ef5('0x8e')](_0x2ef5('0xc2'),_['map'](_0x53c0b2,'id'));return db['sequelize']['query'](_0x2de3ad['toString'](),_0x41eaac)[_0x2ef5('0x1c')](function(_0x1d5ca8){var _0x2006cd=_[_0x2ef5('0xc3')](_0x1d5ca8,'ChatInteractionId');var _0x182f12=[];_0x53c0b2[_0x2ef5('0x40')](function(_0x3f839a){_0x182f12[_0x2ef5('0x41')](updateChatInteraction(_0x3f839a,_0x3b90a6,_0x2006cd));});return BPromise['all'](_0x182f12);});});})[_0x2ef5('0x1c')](function(_0x1570af){_0x5cf7c0[_0x2ef5('0xc4')]=_0x1570af;return _0x5cf7c0;})[_0x2ef5('0x1c')](respondWithFilteredResult(_0x31a3a3,_0x2d1378))['catch'](handleError(_0x31a3a3,null));};exports[_0x2ef5('0xc5')]=function(_0x3e7e72,_0x483e30){var _0xe93e0a={'raw':![],'where':{'id':_0x3e7e72[_0x2ef5('0xc6')]['id']}},_0x3eb565={};_0x3eb565[_0x2ef5('0x57')]=_['keys'](db[_0x2ef5('0x4d')][_0x2ef5('0x4e')]);_0x3eb565[_0x2ef5('0x53')]=_['keys'](_0x3e7e72[_0x2ef5('0x53')]);_0x3eb565[_0x2ef5('0x55')]=_[_0x2ef5('0x56')](_0x3eb565['model'],_0x3eb565['query']);_0xe93e0a[_0x2ef5('0x58')]=_['intersection'](_0x3eb565[_0x2ef5('0x57')],qs[_0x2ef5('0x59')](_0x3e7e72[_0x2ef5('0x53')][_0x2ef5('0x59')]));_0xe93e0a['attributes']=_0xe93e0a[_0x2ef5('0x58')][_0x2ef5('0xc1')]?_0xe93e0a[_0x2ef5('0x58')]:_0x3eb565[_0x2ef5('0x57')];if(_0x3e7e72[_0x2ef5('0x53')][_0x2ef5('0xc7')]){_0xe93e0a[_0x2ef5('0xc8')]=[{'all':!![]}];}_0xe93e0a=_['merge']({},_0xe93e0a,_0x3e7e72[_0x2ef5('0xc9')]);return db['ChatInteraction'][_0x2ef5('0x78')](_0xe93e0a)[_0x2ef5('0x1c')](handleEntityNotFound(_0x483e30,null))[_0x2ef5('0x1c')](respondWithResult(_0x483e30,null))[_0x2ef5('0x42')](handleError(_0x483e30,null));};exports[_0x2ef5('0xca')]=function(_0x3342e6,_0x377944){return db[_0x2ef5('0x4d')]['create'](_0x3342e6['body'],{})['then'](respondWithResult(_0x377944,0xc9))['catch'](handleError(_0x377944,null));};exports[_0x2ef5('0x30')]=function(_0x58151d,_0x237df6){if(_0x58151d[_0x2ef5('0x37')]['id']){delete _0x58151d[_0x2ef5('0x37')]['id'];}return db[_0x2ef5('0x4d')][_0x2ef5('0x78')]({'where':{'id':_0x58151d[_0x2ef5('0xc6')]['id']}})['then'](handleEntityNotFound(_0x237df6,null))['then'](saveUpdates(_0x58151d[_0x2ef5('0x37')],null))['then'](respondWithResult(_0x237df6,null))[_0x2ef5('0x42')](handleError(_0x237df6,null));};exports['destroy']=function(_0x147a9b,_0x4c331b){return db[_0x2ef5('0x4d')][_0x2ef5('0x78')]({'where':{'id':_0x147a9b[_0x2ef5('0xc6')]['id']}})[_0x2ef5('0x1c')](handleEntityNotFound(_0x4c331b,null))['then'](removeEntity(_0x4c331b,null))[_0x2ef5('0x42')](handleError(_0x4c331b,null));};exports['describe']=function(_0x3d62c8,_0x305759){return db[_0x2ef5('0x4d')][_0x2ef5('0xcb')]()[_0x2ef5('0x1c')](respondWithResult(_0x305759,null))[_0x2ef5('0x42')](handleError(_0x305759,null));};exports[_0x2ef5('0xcc')]=function(_0x4a88d0,_0x43d362){var _0xbd1a97=_0x4a88d0[_0x2ef5('0xc6')]['id'];var _0x1eed5b;var _0x2434ce;var _0x5be1dd;return db['ChatInteraction'][_0x2ef5('0xcd')]({'where':{'id':_0xbd1a97}})['then'](function(_0x42ef33){_0x1eed5b=_0x42ef33;return db[_0x2ef5('0xce')][_0x2ef5('0xcd')]({'where':{'id':_0x42ef33[_0x2ef5('0x8d')]},'attributes':['id',_0x2ef5('0xcf'),_0x2ef5('0xd0'),_0x2ef5('0xd1'),_0x2ef5('0xd2'),_0x2ef5('0xd3')],'raw':!![]});})['then'](function(_0x564af1){if(_0x564af1&&_0x564af1[_0x2ef5('0xcf')]&&_0x564af1[_0x2ef5('0xd0')]){_0x2434ce=_0x564af1;var _0xf98979={'interaction':{'id':_0xbd1a97},'agent':{'id':_0x4a88d0[_0x2ef5('0xa7')]['id'],'name':_0x4a88d0[_0x2ef5('0xa7')][_0x2ef5('0x33')],'fullname':_0x4a88d0[_0x2ef5('0xa7')][_0x2ef5('0x3d')],'email':_0x4a88d0['user'][_0x2ef5('0xd4')]},'contact':_0x4a88d0[_0x2ef5('0x37')][_0x2ef5('0x38')],'account':_0x4a88d0[_0x2ef5('0x37')]['account']};var _0x2f323f={'rejectUnauthorized':![],'method':_0x2ef5('0xd5'),'url':_0x2ef5('0xd6'),'headers':{'X-APIKEY':_0x564af1[_0x2ef5('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4a88d0[_0x2ef5('0xa7')]['email']],'buttons':null,'topic':_0x2434ce['vidaooTopic'],'note':_[_0x2ef5('0xd7')](_0x2434ce[_0x2ef5('0xd2')])?null:getMustacheRender(_0x2434ce[_0x2ef5('0xd2')],_0xf98979),'metadata':null},'redirect':_0x2ef5('0xd8'),'json':!![]};try{if(!_[_0x2ef5('0xd7')](_0x2434ce['vidaooMetadata'])){var _0x46e4d2=getMustacheRender(_0x2434ce[_0x2ef5('0xd3')],_0xf98979);var _0x392e02=JSON[_0x2ef5('0x91')](_0x46e4d2);_0x2f323f['body']['metadata']=_0x392e02;}}catch(_0x18981a){throw new db['Sequelize'][(_0x2ef5('0xd9'))](_0x2ef5('0xda'));}return rp(_0x2f323f);}else{throw new db['Sequelize'][(_0x2ef5('0xd9'))](_0x2ef5('0xdb'));}})[_0x2ef5('0x1c')](function(_0x3c7f1f){_0x5be1dd=_0x3c7f1f;if(_0x5be1dd['id']){var _0x8c2534={'body':_0x5be1dd[_0x2ef5('0xdc')],'ChatWebsiteId':_0x2434ce['id'],'ChatInteractionId':_0x1eed5b['id'],'direction':'out','UserId':_0x4a88d0['user']['id']};return db[_0x2ef5('0xdd')][_0x2ef5('0xca')](_0x8c2534,{});}else{throw new db[(_0x2ef5('0xa0'))][(_0x2ef5('0xd9'))](_0x2ef5('0xde'));}})[_0x2ef5('0x1c')](function(){return _0x1eed5b[_0x2ef5('0xdf')]({'vidaooSessionId':_0x5be1dd['id']});})[_0x2ef5('0x1c')](respondWithResult(_0x43d362,null))['catch'](handleError(_0x43d362,null));};exports['customUpdate']=function(_0x5cc1d7,_0xdd9f92){if(_0x5cc1d7[_0x2ef5('0x37')]['id']){delete _0x5cc1d7[_0x2ef5('0x37')]['id'];}return db[_0x2ef5('0x4d')][_0x2ef5('0x78')]({'where':{'id':_0x5cc1d7['params']['id']},'include':[{'model':db['CmContact'],'as':_0x2ef5('0x7d')}]})[_0x2ef5('0x1c')](handleEntityNotFound(_0xdd9f92,null))[_0x2ef5('0x1c')](saveUpdates(_0x5cc1d7['body'],null))[_0x2ef5('0x1c')](respondWithResult(_0xdd9f92,null))[_0x2ef5('0x42')](handleError(_0xdd9f92,null));};exports[_0x2ef5('0xe0')]=function(_0x2553c4,_0x443bb6,_0x3e20e5){if(_0x2553c4['body']['id']){delete _0x2553c4[_0x2ef5('0x37')]['id'];}return db[_0x2ef5('0x4d')][_0x2ef5('0x78')]({'where':{'id':_0x2553c4[_0x2ef5('0xc6')]['id']}})[_0x2ef5('0x1c')](function(_0x4c1e97){if(!_0x4c1e97){logger[_0x2ef5('0x22')](_0x2ef5('0xe1'),_0x2ef5('0xe0'),0x194,_0x2ef5('0xe2'));_0x443bb6[_0x2ef5('0x25')](0x194);}else{if(_0x4c1e97[_0x2ef5('0x49')]){throw new db[(_0x2ef5('0xa0'))][(_0x2ef5('0xd9'))](_0x2ef5('0xe3'));}}return _0x4c1e97;})[_0x2ef5('0x1c')](function(_0x501bec){if(_0x501bec){return _0x501bec[_0x2ef5('0x30')]({'closed':_0x2553c4[_0x2ef5('0x37')][_0x2ef5('0x48')],'disposition':_0x2553c4[_0x2ef5('0x37')]['disposition']})[_0x2ef5('0x1c')](function(_0x54469d){return _0x54469d;});}})[_0x2ef5('0x1c')](function(_0x512aa5){return respondWithRpcPromise('AbandonInteraction',_0x2ef5('0xe0'),_0x2553c4[_0x2ef5('0x37')],client9004);})[_0x2ef5('0x1c')](respondWithResult(_0x443bb6,null))[_0x2ef5('0x42')](handleError(_0x443bb6,null));};exports['attachmentUpload']=function(_0x1a0988,_0x278b1b,_0x366ca9){_0x1a0988[_0x2ef5('0x37')][_0x2ef5('0x33')]=_0x1a0988[_0x2ef5('0xe4')][_0x2ef5('0xe5')];_0x1a0988[_0x2ef5('0x37')]['basename']=_0x1a0988[_0x2ef5('0xe4')]['filename'];_0x1a0988[_0x2ef5('0x37')][_0x2ef5('0x50')]=_0x1a0988[_0x2ef5('0xe4')][_0x2ef5('0xe6')];return db['Attachment'][_0x2ef5('0xca')](_0x1a0988[_0x2ef5('0x37')])[_0x2ef5('0x1c')](respondWithResult(_0x278b1b,0xc9))[_0x2ef5('0x42')](handleError(_0x278b1b,null));};exports['attachmentDownload']=function(_0x5f55e7,_0x2e8dad,_0x568b46){return db['ChatInteraction'][_0x2ef5('0xcd')]({'where':{'id':_0x5f55e7[_0x2ef5('0xc6')]['id']},'raw':!![]})[_0x2ef5('0x1c')](handleEntityNotFound(_0x2e8dad,null))['then'](function(_0xf5639c){if(_0xf5639c){if(_0xf5639c[_0x2ef5('0x48')]){return _0x2e8dad[_0x2ef5('0x27')](0x193)[_0x2ef5('0x28')]({'status':0x193,'message':'Unauthorized'});}return db[_0x2ef5('0xe7')][_0x2ef5('0xcd')]({'where':{'id':_0x5f55e7[_0x2ef5('0x53')][_0x2ef5('0xe8')]},'raw':!![]})[_0x2ef5('0x1c')](handleEntityNotFound(_0x2e8dad,null));}})[_0x2ef5('0x1c')](function(_0x32e925){if(_0x32e925){var _0x3bb8af=_0x32e925[_0x2ef5('0xe9')]!==null;var _0x4b162e=path[_0x2ef5('0xea')](config['root'],_0x2ef5('0xeb'));if(_0x3bb8af){_0x4b162e=path[_0x2ef5('0xea')](_0x4b162e,_0x2ef5('0xec'));}var _0x2380e4=path[_0x2ef5('0xea')](_0x4b162e,_0x32e925['basename']);return _0x2e8dad[_0x2ef5('0xed')](_0x2380e4);}})['catch'](handleError(_0x2e8dad,null));};exports[_0x2ef5('0xee')]=function(_0x3d8047,_0x326f2f){var _0x234491=null;var _0xddc26d=null;var _0x415ac2=null;var _0x32a9f4=null;if(_0x3d8047['body']['id']){delete _0x3d8047['body']['id'];}if(_0x3d8047[_0x2ef5('0x37')][_0x2ef5('0xef')]){_0x32a9f4=path[_0x2ef5('0xea')](config['root'],'server/files/chat/upload/',util[_0x2ef5('0xf0')](_0x2ef5('0xf1'),Date[_0x2ef5('0xf2')]()));_0x3d8047['body'][_0x2ef5('0xf3')]=_0x32a9f4;}return db['ChatInteraction'][_0x2ef5('0x78')]({'where':{'id':_0x3d8047[_0x2ef5('0xc6')]['id']},'include':[{'model':db[_0x2ef5('0xdd')],'as':_0x2ef5('0xf4'),'include':[{'model':db[_0x2ef5('0x89')],'as':'User'}]}]})[_0x2ef5('0x1c')](handleEntityNotFound(_0x326f2f,null))[_0x2ef5('0x1c')](saveUpdates(_0x3d8047[_0x2ef5('0x37')],null))['then'](function(_0xbb7e73){if(_0xbb7e73){_0x234491=_0xbb7e73;return db[_0x2ef5('0xce')]['find']({'where':{'id':_0x234491[_0x2ef5('0x8d')]}});}})[_0x2ef5('0x1c')](function(_0xfd2e93){if(_0xfd2e93){_0x415ac2=_0xfd2e93;return db[_0x2ef5('0xf5')]['find']({'where':{'id':_0x234491[_0x2ef5('0x83')]}});}})[_0x2ef5('0x1c')](function(_0x2e97a1){if(_0x2e97a1){_0xddc26d=_0x2e97a1;if(_0x32a9f4){var _0x3474de=null;for(var _0x103d19=0x1;_0x103d19<_0x234491[_0x2ef5('0xf4')][_0x2ef5('0xc1')];++_0x103d19){_0x3474de=_0x234491[_0x2ef5('0xf4')][_0x103d19];var _0x39a683=_0x3474de[_0x2ef5('0x49')]?util[_0x2ef5('0xf0')](_0x2ef5('0xf6'),_0x415ac2['agentAlias'],_0x3474de[_0x2ef5('0x49')]):_0x2ef5('0xf7');var _0x2fdda7=_0x3d8047[_0x2ef5('0x37')][_0x2ef5('0xf8')]||util[_0x2ef5('0xf0')](_0x2ef5('0xf6'),'Visitor',_0x3474de['ContactId']);switch(_0x415ac2[_0x2ef5('0xf9')]){case _0x2ef5('0xfa'):_0x39a683=_0x3474de[_0x2ef5('0x49')]?util['format']('%s%d',_0x415ac2[_0x2ef5('0xfb')],_0x3474de[_0x2ef5('0x49')]):_0x2ef5('0xf7');break;case _0x2ef5('0xfc'):_0x39a683=_0x3474de[_0x2ef5('0x49')]?_0x3474de[_0x2ef5('0x89')][_0x2ef5('0xfd')]||_0x3474de[_0x2ef5('0x89')][_0x2ef5('0x3d')]:'System';break;case _0x2ef5('0xfe'):_0x39a683=_0x3474de[_0x2ef5('0x49')]?_0x3474de[_0x2ef5('0x89')][_0x2ef5('0x3d')]:_0x2ef5('0xf7');break;default:_0x39a683=_0x3474de[_0x2ef5('0x49')]?util['format'](_0x2ef5('0xf6'),_0x415ac2[_0x2ef5('0xfb')],_0x3474de[_0x2ef5('0x49')]):'System';}var _0x3e90ec=util[_0x2ef5('0xf0')](_0x2ef5('0xff'),moment(_0x3474de['createdAt'])['format'](_0x2ef5('0x100')),_0x3474de['direction']==='in'?_0x2fdda7:_0x39a683,_0x3474de[_0x2ef5('0x37')]);if(!_0x3474de[_0x2ef5('0x101')]){fs[_0x2ef5('0x102')](_0x32a9f4,_0x3e90ec);}}return db[_0x2ef5('0x103')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x2ef5('0x1c')](function(_0x1430c9){if(_0x1430c9&&_0x1430c9[_0x2ef5('0x104')]&&_0x3d8047[_0x2ef5('0x37')]){var _0x33710a={'tls':{'rejectUnauthorized':![]}};if(_0x1430c9['Smtp']['service']){_0x33710a[_0x2ef5('0x105')]=_0x1430c9[_0x2ef5('0x104')][_0x2ef5('0x105')];}else{_0x33710a[_0x2ef5('0x106')]=_0x1430c9[_0x2ef5('0x104')][_0x2ef5('0x106')];_0x33710a[_0x2ef5('0x107')]=_0x1430c9[_0x2ef5('0x104')][_0x2ef5('0x107')];_0x33710a[_0x2ef5('0x108')]=_0x1430c9[_0x2ef5('0x104')]['secure'];}if(_0x1430c9[_0x2ef5('0x104')][_0x2ef5('0x109')]){_0x33710a[_0x2ef5('0x10a')]={'user':_0x1430c9[_0x2ef5('0x104')][_0x2ef5('0xa7')],'pass':_0x1430c9[_0x2ef5('0x104')][_0x2ef5('0x10b')]};}return respondWithRpcPromise('SendMail',_0x2ef5('0x10c'),{'account':_0x33710a,'message':{'from':util[_0x2ef5('0xf0')](_0x2ef5('0x10d'),_0x1430c9[_0x2ef5('0x33')],_0x1430c9[_0x2ef5('0xd4')]||_0x1430c9[_0x2ef5('0x104')][_0x2ef5('0xa7')]),'to':_0x3d8047['body'][_0x2ef5('0xef')],'subject':_0x2ef5('0x10e'),'text':util[_0x2ef5('0xf0')](_0x2ef5('0x10f'),_0x3d8047[_0x2ef5('0x37')][_0x2ef5('0xef')]),'attachments':[{'path':_0x32a9f4}]}})[_0x2ef5('0x1c')](function(){return _0x234491;})[_0x2ef5('0x42')](function(_0x23a23b){console[_0x2ef5('0x22')](_0x23a23b);});}else{return _0x234491;}})['then'](respondWithStatusCode(_0x326f2f,0xc8))[_0x2ef5('0x42')](handleError(_0x326f2f,null));};exports[_0x2ef5('0x110')]=function(_0x4745a3,_0x1e7f31,_0x125ad4){return db['ChatMessage'][_0x2ef5('0x78')]({'where':{'id':_0x4745a3[_0x2ef5('0xc6')]['id']}})[_0x2ef5('0x1c')](handleEntityNotFound(_0x1e7f31,null))[_0x2ef5('0x1c')](function(_0x52d6a9){if(_0x52d6a9){return _0x52d6a9['addMessage'](_0x4745a3[_0x2ef5('0x37')][_0x2ef5('0x111')],_[_0x2ef5('0x112')](_0x4745a3[_0x2ef5('0x37')],['ids','id'])||{});}})[_0x2ef5('0x1c')](respondWithResult(_0x1e7f31,null))[_0x2ef5('0x42')](handleError(_0x1e7f31,null));};exports[_0x2ef5('0x113')]=function(_0x3b8a33,_0x4dece6,_0x47b634){var _0x3c6cdf={'raw':![],'where':{}};var _0x94a4bc={};var _0x2425a3={'count':0x0,'rows':[]};return db[_0x2ef5('0x4d')][_0x2ef5('0xcd')]({'where':{'id':_0x3b8a33[_0x2ef5('0xc6')]['id']}})[_0x2ef5('0x1c')](handleEntityNotFound(_0x4dece6,null))[_0x2ef5('0x1c')](function(_0x5ac7d4){if(_0x5ac7d4){_0x94a4bc['model']=_[_0x2ef5('0x54')](db['ChatMessage'][_0x2ef5('0x4e')]);_0x94a4bc[_0x2ef5('0x53')]=_[_0x2ef5('0x54')](_0x3b8a33[_0x2ef5('0x53')]);_0x94a4bc[_0x2ef5('0x55')]=_[_0x2ef5('0x56')](_0x94a4bc[_0x2ef5('0x57')],_0x94a4bc[_0x2ef5('0x53')]);_0x3c6cdf[_0x2ef5('0x58')]=_[_0x2ef5('0x56')](_0x94a4bc['model'],qs['fields'](_0x3b8a33[_0x2ef5('0x53')][_0x2ef5('0x59')]));_0x3c6cdf[_0x2ef5('0x58')]=_0x3c6cdf[_0x2ef5('0x58')]['length']?_0x3c6cdf[_0x2ef5('0x58')]:_0x94a4bc[_0x2ef5('0x57')];if(!_0x3b8a33[_0x2ef5('0x53')][_0x2ef5('0x5a')](_0x2ef5('0x5b'))){_0x3c6cdf[_0x2ef5('0x2a')]=qs[_0x2ef5('0x2a')](_0x3b8a33[_0x2ef5('0x53')]['limit']);_0x3c6cdf[_0x2ef5('0x2c')]=qs[_0x2ef5('0x2c')](_0x3b8a33[_0x2ef5('0x53')]['offset']);}_0x3c6cdf['order']=qs[_0x2ef5('0x5c')](_0x3b8a33[_0x2ef5('0x53')]['sort']);_0x3c6cdf[_0x2ef5('0x8e')]=qs[_0x2ef5('0x55')](_[_0x2ef5('0x5d')](_0x3b8a33[_0x2ef5('0x53')],_0x94a4bc[_0x2ef5('0x55')]));_0x3c6cdf[_0x2ef5('0x8e')][_0x2ef5('0x114')]=_0x5ac7d4['id'];if(_0x3b8a33[_0x2ef5('0x53')][_0x2ef5('0x9a')]){_0x3c6cdf[_0x2ef5('0x8e')]=_[_0x2ef5('0x36')](_0x3c6cdf[_0x2ef5('0x8e')],{'$or':_[_0x2ef5('0x52')](_0x3c6cdf['attributes'],function(_0x3b1614){var _0x43c18e={};_0x43c18e[_0x3b1614]={'$like':'%'+_0x3b8a33['query'][_0x2ef5('0x9a')]+'%'};return _0x43c18e;})});}if(_0x3b8a33[_0x2ef5('0x53')][_0x2ef5('0x115')]){var _0x164778=_0x3b8a33['query'][_0x2ef5('0x115')][_0x2ef5('0x80')](',');var _0x55ca9a={};_0x55ca9a[_0x164778[0x0]]={'$gte':moment(_0x164778[0x1])[_0x2ef5('0xf0')](_0x2ef5('0x116'))};_0x3c6cdf[_0x2ef5('0x8e')]=_[_0x2ef5('0x36')](_0x3c6cdf[_0x2ef5('0x8e')],_0x55ca9a);}_0x3c6cdf=_[_0x2ef5('0x36')]({},_0x3c6cdf,_0x3b8a33[_0x2ef5('0xc9')]);return db[_0x2ef5('0xdd')][_0x2ef5('0x2b')]({'where':_0x3c6cdf[_0x2ef5('0x8e')]})[_0x2ef5('0x1c')](function(_0x452599){_0x2425a3[_0x2ef5('0x2b')]=_0x452599;if(_0x3b8a33[_0x2ef5('0x53')][_0x2ef5('0xc7')]){_0x3c6cdf[_0x2ef5('0xc8')]=[{'all':!![]}];}return db[_0x2ef5('0xdd')][_0x2ef5('0x117')](_0x3c6cdf);})[_0x2ef5('0x1c')](function(_0x117084){_0x2425a3[_0x2ef5('0xc4')]=_0x117084;return _0x2425a3;});}})[_0x2ef5('0x1c')](respondWithFilteredResult(_0x4dece6,_0x3c6cdf))[_0x2ef5('0x42')](handleError(_0x4dece6,null));};exports['getMyMessages']=function(_0x3e016f,_0x3c676e,_0x1e8b84){var _0x575a03={'where':{}},_0x23a57b={},_0xd6aded={'count':0x0,'rows':[]};return db[_0x2ef5('0x4d')]['findOne']({'where':{'id':_0x3e016f[_0x2ef5('0xc6')]['id']}})[_0x2ef5('0x1c')](handleEntityNotFound(_0x3c676e,null))['then'](function(_0x1a7b61){if(_0x1a7b61){_0x23a57b[_0x2ef5('0x57')]=_[_0x2ef5('0x54')](db[_0x2ef5('0xdd')]['rawAttributes']);_0x23a57b[_0x2ef5('0x53')]=_[_0x2ef5('0x54')](_0x3e016f[_0x2ef5('0x53')]);_0x23a57b[_0x2ef5('0x55')]=_['intersection'](_0x23a57b[_0x2ef5('0x57')],_0x23a57b[_0x2ef5('0x53')]);_0x575a03[_0x2ef5('0x58')]=_[_0x2ef5('0x56')](_0x23a57b[_0x2ef5('0x57')],qs[_0x2ef5('0x59')](_0x3e016f[_0x2ef5('0x53')][_0x2ef5('0x59')]));_0x575a03['attributes']=_0x575a03[_0x2ef5('0x58')][_0x2ef5('0xc1')]?_0x575a03[_0x2ef5('0x58')]:_0x23a57b['model'];if(!_0x3e016f['query']['hasOwnProperty'](_0x2ef5('0x5b'))){_0x575a03[_0x2ef5('0x2a')]=qs[_0x2ef5('0x2a')](_0x3e016f[_0x2ef5('0x53')]['limit']);_0x575a03[_0x2ef5('0x2c')]=qs[_0x2ef5('0x2c')](_0x3e016f['query'][_0x2ef5('0x2c')]);}_0x575a03[_0x2ef5('0xa3')]=qs['sort'](_0x3e016f['query'][_0x2ef5('0x5c')]);_0x575a03[_0x2ef5('0x8e')]=qs['filters'](_[_0x2ef5('0x5d')](_0x3e016f[_0x2ef5('0x53')],_0x23a57b[_0x2ef5('0x55')]));_0x575a03[_0x2ef5('0x8e')][_0x2ef5('0x114')]=_0x1a7b61['id'];if(_0x3e016f[_0x2ef5('0x53')][_0x2ef5('0x9a')]){_0x575a03['where']=_[_0x2ef5('0x36')](_0x575a03[_0x2ef5('0x8e')],{'$or':_[_0x2ef5('0x52')](_0x575a03[_0x2ef5('0x58')],function(_0x298cc2){var _0x224108={};_0x224108[_0x298cc2]={'$like':'%'+_0x3e016f['query'][_0x2ef5('0x9a')]+'%'};return _0x224108;})});}_0x575a03[_0x2ef5('0x8e')][_0x2ef5('0x101')]=![];if(_0x3e016f[_0x2ef5('0x53')]['id']){_0x575a03['where']['id']={'$gt':_0x3e016f[_0x2ef5('0x53')]['id']};}_0x575a03=_['merge']({},_0x575a03,_0x3e016f[_0x2ef5('0xc9')]);return db[_0x2ef5('0xdd')][_0x2ef5('0x2b')]({'where':_0x575a03[_0x2ef5('0x8e')]})['then'](function(_0x4b7596){_0xd6aded[_0x2ef5('0x2b')]=_0x4b7596;_0x575a03['include']=[];if(_0x3e016f['query'][_0x2ef5('0x118')]){_0x575a03['include'][_0x2ef5('0x41')]({'model':db[_0x2ef5('0x89')],'as':_0x2ef5('0x89'),'attributes':['id','fullname',_0x2ef5('0xfd')]});}if(_0x3e016f['query'][_0x2ef5('0xc7')]){_0x575a03[_0x2ef5('0xc8')]=[{'all':!![]}];}return db[_0x2ef5('0xdd')][_0x2ef5('0x117')](_0x575a03);})[_0x2ef5('0x1c')](function(_0x2be421){_0xd6aded[_0x2ef5('0xc4')]=_0x2be421;return _0xd6aded;});}})[_0x2ef5('0x1c')](respondWithFilteredResult(_0x3c676e,_0x575a03))[_0x2ef5('0x42')](handleError(_0x3c676e,null));};exports[_0x2ef5('0x119')]=function(_0x5b4c37,_0x5539d6,_0x33f13f){return db[_0x2ef5('0x4d')][_0x2ef5('0x78')]({'where':{'id':_0x5b4c37[_0x2ef5('0xc6')]['id']}})[_0x2ef5('0x1c')](handleEntityNotFound(_0x5539d6,null))['then'](function(_0x31c4e7){if(_0x31c4e7){return _0x31c4e7[_0x2ef5('0x11a')](_0x5b4c37[_0x2ef5('0x37')][_0x2ef5('0x111')],_['omit'](_0x5b4c37[_0x2ef5('0x37')],[_0x2ef5('0x111'),'id'])||{})['spread'](function(){return db[_0x2ef5('0x87')][_0x2ef5('0x117')]({'attributes':['id',_0x2ef5('0x33'),'color'],'where':{'id':_0x5b4c37['body'][_0x2ef5('0x111')]}});})[_0x2ef5('0x1c')](function(_0x3bd9f7){socket[_0x2ef5('0x11b')]('chatInteractionTags:save',{'id':Number(_0x5b4c37['params']['id']),'tags':_0x3bd9f7||[]});return{'id':Number(_0x5b4c37[_0x2ef5('0xc6')]['id']),'tags':_0x3bd9f7||[]};});}})['then'](respondWithResult(_0x5539d6,null))[_0x2ef5('0x42')](handleError(_0x5539d6,null));};exports['removeTags']=function(_0x3b1fa1,_0x1da311,_0x3d8c1f){return db['ChatInteraction'][_0x2ef5('0x78')]({'where':{'id':_0x3b1fa1[_0x2ef5('0xc6')]['id']}})['then'](handleEntityNotFound(_0x1da311,null))['then'](function(_0x3dfbf2){if(_0x3dfbf2){return _0x3dfbf2[_0x2ef5('0x11c')](_0x3b1fa1[_0x2ef5('0x53')]['ids']);}})[_0x2ef5('0x1c')](respondWithStatusCode(_0x1da311,null))[_0x2ef5('0x42')](handleError(_0x1da311,null));};exports[_0x2ef5('0xed')]=function(_0x3b84b0,_0x35332b){var _0x1022b0=moment()[_0x2ef5('0x11d')]()[_0x2ef5('0xad')]();var _0x1bca3a=path[_0x2ef5('0xea')](config[_0x2ef5('0x11e')],'server',_0x2ef5('0x11f'),_0x2ef5('0x120'));var _0x375344=path['join'](config[_0x2ef5('0x11e')],_0x2ef5('0x121'),_0x2ef5('0x11f'),_0x2ef5('0x122'));var _0x1b0f2c=path[_0x2ef5('0xea')](_0x1bca3a,_0x1022b0);var _0x1b5584=util[_0x2ef5('0xf0')](_0x2ef5('0x123'),_0x3b84b0[_0x2ef5('0xc6')]['id'],_0x1022b0);var _0x69db6f=path[_0x2ef5('0xea')](_0x1bca3a,_0x1b5584);var _0x2003d9=[];_0x2003d9[_0x2ef5('0x41')]({'model':db[_0x2ef5('0x89')],'as':_0x2ef5('0x89'),'attributes':['id','fullname'],'raw':!![]});_0x2003d9[_0x2ef5('0x41')]({'model':db[_0x2ef5('0xf5')],'as':_0x2ef5('0x7d'),'attributes':['id',_0x2ef5('0x124'),_0x2ef5('0x125')],'raw':!![]});if(_0x3b84b0[_0x2ef5('0x53')][_0x2ef5('0x122')]){_0x2003d9[_0x2ef5('0x41')]({'model':db['Attachment'],'as':_0x2ef5('0xe7'),'raw':!![]});}var _0x15c16a=[{'model':db[_0x2ef5('0xdd')],'as':'Messages','attributes':['id',_0x2ef5('0x37'),_0x2ef5('0x90'),'direction','secret',_0x2ef5('0x96')],'include':_0x2003d9}];_0x15c16a[_0x2ef5('0x41')]({'model':db['ChatWebsite'],'as':_0x2ef5('0x126'),'attributes':['id',_0x2ef5('0x33')]});_0x15c16a[_0x2ef5('0x41')]({'model':db[_0x2ef5('0x89')],'as':_0x2ef5('0x127'),'attributes':['id',_0x2ef5('0x3d')]});return db['ChatInteraction'][_0x2ef5('0x78')]({'where':{'id':_0x3b84b0[_0x2ef5('0xc6')]['id']},'include':_0x15c16a})[_0x2ef5('0x1c')](handleEntityNotFound(_0x35332b,null))[_0x2ef5('0x1c')](function(_0x136224){if(_0x136224){var _0x4e94b1=_0x136224['get']({'plain':!![]});fs[_0x2ef5('0x128')](_0x1b0f2c);var _0x564b54={'channel':_0x2ef5('0x129'),'account':_0x4e94b1[_0x2ef5('0x126')][_0x2ef5('0x33')],'agent':_0x4e94b1[_0x2ef5('0x127')]?_0x4e94b1['Owner']['fullname']:_0x2ef5('0x12a'),'createdAt':moment(_0x4e94b1[_0x2ef5('0x90')])[_0x2ef5('0xf0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2ef5('0xad')](),'closedAt':_0x4e94b1[_0x2ef5('0x48')]?moment(_0x4e94b1[_0x2ef5('0x12b')])[_0x2ef5('0xf0')](_0x2ef5('0x116'))['toString']():'','disposition':_0x4e94b1[_0x2ef5('0x4b')],'chatInfo':{'browser':_0x4e94b1[_0x2ef5('0x12c')],'os':_0x4e94b1[_0x2ef5('0x12d')],'referer':_0x4e94b1[_0x2ef5('0x12e')],'customerIp':_0x4e94b1[_0x2ef5('0x12f')],'customerPort':_0x4e94b1[_0x2ef5('0x130')]?_0x4e94b1['customerPort']:_0x2ef5('0x12a')},'messages':_(_0x4e94b1[_0x2ef5('0xf4')])[_0x2ef5('0x131')]()[_0x2ef5('0x9a')]({'secret':![]})[_0x2ef5('0x52')](function(_0x1d8078){if(_0x1d8078[_0x2ef5('0xe7')]){var _0x1bfdf5=path[_0x2ef5('0xea')](_0x375344,_0x1d8078[_0x2ef5('0xe7')][_0x2ef5('0x132')]);if(fs[_0x2ef5('0x133')](_0x1bfdf5)){fs[_0x2ef5('0x134')](_0x1bfdf5)['pipe'](fs['createWriteStream'](path[_0x2ef5('0xea')](_0x1b0f2c,_0x1d8078[_0x2ef5('0xe7')][_0x2ef5('0x132')])));}}return{'date':moment(_0x1d8078['createdAt'])[_0x2ef5('0xf0')](_0x2ef5('0x116'))[_0x2ef5('0xad')](),'sender':_0x1d8078[_0x2ef5('0x135')]===_0x2ef5('0x136')?_0x1d8078[_0x2ef5('0x89')]?_0x1d8078[_0x2ef5('0x89')][_0x2ef5('0x3d')]:'System':_0x1d8078[_0x2ef5('0x7d')][_0x2ef5('0x124')]+(_0x1d8078[_0x2ef5('0x7d')][_0x2ef5('0x125')]?'\x20'+_0x1d8078[_0x2ef5('0x7d')][_0x2ef5('0x125')]:''),'body':_0x1d8078[_0x2ef5('0xe7')]?_0x1d8078['Attachment'][_0x2ef5('0x132')]:_0x1d8078[_0x2ef5('0x37')],'direction':_0x1d8078[_0x2ef5('0x135')]==='out'?'A':'C','secret':_0x1d8078[_0x2ef5('0x101')],'read':_0x1d8078['read'],'attachment':_0x1d8078['Attachment']};})[_0x2ef5('0x7a')]()};return ejs[_0x2ef5('0x137')](path[_0x2ef5('0xea')](config[_0x2ef5('0x11e')],_0x2ef5('0x121'),_0x2ef5('0x138'),'downloadInteraction.ejs'),{'interaction':_0x564b54})['then'](function(_0x30bd40){var _0x3bf224=path['join'](_0x1b0f2c,_0x2ef5('0x139')+_0x4e94b1['id']+'-'+_0x1022b0+_0x2ef5('0x13a'));var _0x12240e={'path':_0x3bf224,'channel':'Chat','interactionId':_0x4e94b1['id']};return pdf[_0x2ef5('0x13b')](_0x30bd40,_0x12240e);})['then'](function(){return new BPromise(function(_0x49ba0e,_0x59b8fe){zipdir(_0x1b0f2c,{'saveTo':_0x69db6f},function(_0x5b0d97,_0x2f1b4d){if(_0x5b0d97)return _0x59b8fe(_0x5b0d97);return _0x49ba0e(_0x2f1b4d);});})[_0x2ef5('0x1c')](function(){return new BPromise(function(_0x56f1ab,_0x31c038){rimraf(_0x1b0f2c,function(_0x2000c4){if(_0x2000c4)_0x31c038(_0x2000c4);return _0x56f1ab();});});})[_0x2ef5('0x1c')](function(){return _0x35332b[_0x2ef5('0xed')](_0x69db6f,_0x1b5584,function(_0x11358f){if(_0x11358f){console[_0x2ef5('0x13c')](_0x2ef5('0x13d'),_0x11358f);}else{fs[_0x2ef5('0x13e')](_0x69db6f);}});});});}else{return _0x35332b[_0x2ef5('0x25')](0xc8);}})[_0x2ef5('0x42')](handleError(_0x35332b,null));};
\ No newline at end of file
+var _0x12ba=['QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.email','Contact.phone','c.fax','Contact.fax','Owner.fullname','Owner.internal','ChatInteractionId','push','rows','includeAll','include','merge','create','update','params','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','POST','isNull','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','AbandonInteraction','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','root','join','offline-chat/','download','close','server/files/chat/upload/','format','now','pathTranscript','Messages','%s%d','System','customer','Visitor','agentIdentifier','agentAlias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','service','port','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','includeAgent','alias','findAll','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','Account','get','mkdirSync','Owner','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','secret','views','downloadInteraction.ejs','.pdf','Chat','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost','redis','./chatInteraction.socket','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','destroy','name','send','render','contact','interaction','account','Users','map','Tags','TagIds','split','talking','answered','unmanaged','abandoned','closed','UserId','waiting','disposition','total','ChatInteraction','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','color','from','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','keys','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0x12ba,0x1c4));var _0xa12b=function(_0x569a97,_0x128763){_0x569a97=_0x569a97-0x0;var _0x1bc6f4=_0x12ba[_0x569a97];return _0x1bc6f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa12b('0x0'));var zipdir=require(_0xa12b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa12b('0x2'));var moment=require(_0xa12b('0x3'));var BPromise=require(_0xa12b('0x4'));var Mustache=require(_0xa12b('0x5'));var util=require(_0xa12b('0x6'));var path=require(_0xa12b('0x7'));var sox=require(_0xa12b('0x8'));var csv=require(_0xa12b('0x9'));var ejs=require(_0xa12b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa12b('0xb'));var squel=require(_0xa12b('0xc'));var crypto=require(_0xa12b('0xd'));var jsforce=require(_0xa12b('0xe'));var deskjs=require(_0xa12b('0xf'));var toCsv=require(_0xa12b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa12b('0x10'));var qs=require(_0xa12b('0x11'));var as=require(_0xa12b('0x12'));var pdf=require(_0xa12b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa12b('0x14'))(_0xa12b('0x15'));var utils=require(_0xa12b('0x16'));var config=require(_0xa12b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xa12b('0x18')](config['redis'],{'host':_0xa12b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa12b('0x1a')]));require(_0xa12b('0x1b'))[_0xa12b('0x1c')](socket);var jayson=require(_0xa12b('0x1d'));var client=jayson['client'][_0xa12b('0x1e')]({'port':0x232b});var client9004=jayson['client'][_0xa12b('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x1bc5f0,_0x19de0f,_0x6d003e,_0x49d4dc){return new BPromise(function(_0x3267cf,_0x314595){var _0x1ee610=_0x49d4dc||client;return _0x1ee610[_0xa12b('0x1f')](_0x1bc5f0,_0x6d003e)[_0xa12b('0x20')](function(_0xc71a77){logger[_0xa12b('0x21')](_0xa12b('0x22'),_0x19de0f,_0xa12b('0x23'));logger[_0xa12b('0x24')](_0xa12b('0x25'),_0x19de0f,_0xa12b('0x23'),JSON['stringify'](_0xc71a77));if(_0xc71a77[_0xa12b('0x26')]){if(_0xc71a77['error'][_0xa12b('0x27')]===0x1f4){logger[_0xa12b('0x26')](_0xa12b('0x22'),_0x19de0f,_0xc71a77[_0xa12b('0x26')]['message']);return _0x314595(_0xc71a77['error']['message']);}logger[_0xa12b('0x26')](_0xa12b('0x22'),_0x19de0f,_0xc71a77[_0xa12b('0x26')][_0xa12b('0x28')]);return _0x3267cf(_0xc71a77[_0xa12b('0x26')][_0xa12b('0x28')]);}else{logger['info'](_0xa12b('0x22'),_0x19de0f,_0xa12b('0x23'));_0x3267cf(_0xc71a77[_0xa12b('0x29')][_0xa12b('0x28')]);}})[_0xa12b('0x2a')](function(_0x4834d5){logger[_0xa12b('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x19de0f,_0x4834d5);_0x314595(_0x4834d5);});});}function respondWithStatusCode(_0x135d7b,_0x5b460e){_0x5b460e=_0x5b460e||0xcc;return function(_0xcc3112){if(_0xcc3112){return _0x135d7b[_0xa12b('0x2b')](_0x5b460e);}return _0x135d7b[_0xa12b('0x2c')](_0x5b460e)[_0xa12b('0x2d')]();};}function respondWithResult(_0x311e42,_0x251bdd){_0x251bdd=_0x251bdd||0xc8;return function(_0x2542c0){if(_0x2542c0){return _0x311e42[_0xa12b('0x2c')](_0x251bdd)[_0xa12b('0x2e')](_0x2542c0);}};}function respondWithFilteredResult(_0x3dcc6e,_0x4a6d4b){return function(_0x44a95e){if(_0x44a95e){var _0x20d5c6=typeof _0x4a6d4b[_0xa12b('0x2f')]===_0xa12b('0x30')&&typeof _0x4a6d4b[_0xa12b('0x31')]===_0xa12b('0x30');var _0x4c9ca4=_0x44a95e['count'];var _0x4a7dec=_0x20d5c6?0x0:_0x4a6d4b[_0xa12b('0x2f')];var _0x5b7b30=_0x20d5c6?_0x44a95e[_0xa12b('0x32')]:_0x4a6d4b[_0xa12b('0x2f')]+_0x4a6d4b[_0xa12b('0x31')];var _0x3ca66d;if(_0x5b7b30>=_0x4c9ca4){_0x5b7b30=_0x4c9ca4;_0x3ca66d=0xc8;}else{_0x3ca66d=0xce;}_0x3dcc6e[_0xa12b('0x2c')](_0x3ca66d);return _0x3dcc6e[_0xa12b('0x33')](_0xa12b('0x34'),_0x4a7dec+'-'+_0x5b7b30+'/'+_0x4c9ca4)['json'](_0x44a95e);}return null;};}function patchUpdates(_0x2a9735){return function(_0x3ec133){try{jsonpatch['apply'](_0x3ec133,_0x2a9735,!![]);}catch(_0xc5c9bc){return BPromise['reject'](_0xc5c9bc);}return _0x3ec133[_0xa12b('0x35')]();};}function saveUpdates(_0x1c8705,_0x3a5345){return function(_0x486c72){if(_0x486c72){return _0x486c72['update'](_0x1c8705)['then'](function(_0x566b0a){return _0x566b0a;});}return null;};}function removeEntity(_0x24a0d9,_0x161177){return function(_0x146edb){if(_0x146edb){return _0x146edb[_0xa12b('0x36')]()[_0xa12b('0x20')](function(){_0x24a0d9[_0xa12b('0x2c')](0xcc)[_0xa12b('0x2d')]();});}};}function handleEntityNotFound(_0x435ee3,_0x44149a){return function(_0x1164a5){if(!_0x1164a5){_0x435ee3['sendStatus'](0x194);}return _0x1164a5;};}function handleError(_0x2fbe27,_0x32d1bc){_0x32d1bc=_0x32d1bc||0x1f4;return function(_0x5908f8){logger['error'](_0x5908f8['stack']);if(_0x5908f8[_0xa12b('0x37')]){delete _0x5908f8[_0xa12b('0x37')];}_0x2fbe27[_0xa12b('0x2c')](_0x32d1bc)[_0xa12b('0x38')](_0x5908f8);};}function getMustacheRender(_0x48ab66,_0x38c585){return Mustache[_0xa12b('0x39')](_0x48ab66,_['merge'](_0x38c585['body'],{'contact':_0x38c585[_0xa12b('0x3a')],'message':_0x38c585[_0xa12b('0x28')],'agent':_0x38c585['agent'],'interaction':_0x38c585[_0xa12b('0x3b')],'account':_0x38c585[_0xa12b('0x3c')]}))||'';}function getInteractionUsers(_0x9c8b0c,_0x26a8fd){return new BPromise(function(_0x11a111,_0x5b13e1){try{if(_0x26a8fd[_0x9c8b0c['id']]){_0x9c8b0c[_0xa12b('0x3d')]=_[_0xa12b('0x3e')](_0x26a8fd[_0x9c8b0c['id']],function(_0x248ffc){return{'id':_0x248ffc['id'],'fullname':_0x248ffc['fullname']};});}}catch(_0xd6e77){_0x5b13e1(_0xd6e77);}_0x11a111(_0x9c8b0c);});}function getInteractionTags(_0x2b9ff8,_0x38e890){return new BPromise(function(_0x521671,_0x2ee1b9){try{if(_0x2b9ff8['TagIds']){_0x2b9ff8[_0xa12b('0x3f')]=[];_0x2b9ff8[_0xa12b('0x40')][_0xa12b('0x41')](',')['forEach'](function(_0x2a3aea){_0x2b9ff8['Tags']['push'](_0x38e890[_0x2a3aea]);});}delete _0x2b9ff8[_0xa12b('0x40')];}catch(_0x40ec52){_0x2ee1b9(_0x40ec52);}_0x521671(_0x2b9ff8);});}function updateChatInteraction(_0x63ed77,_0x9d50fc,_0x2f252e){return new BPromise(function(_0x56ce3e,_0x3c7fd0){return getInteractionUsers(_0x63ed77,_0x2f252e)[_0xa12b('0x20')](function(_0x51ee68){return getInteractionTags(_0x51ee68,_0x9d50fc);})[_0xa12b('0x20')](function(_0x918d56){return getStateInteraction(_0x918d56);})[_0xa12b('0x20')](function(_0x39c497){_0x56ce3e(_0x39c497);})[_0xa12b('0x2a')](function(_0x39ae57){_0x3c7fd0(_0x39ae57);});});}function getStateInteraction(_0x6c0404){return new BPromise(function(_0x421248){_0x6c0404['waiting']=0x0;_0x6c0404[_0xa12b('0x42')]=0x0;_0x6c0404[_0xa12b('0x43')]=0x0;_0x6c0404[_0xa12b('0x44')]=0x0;_0x6c0404[_0xa12b('0x45')]=0x0;_0x6c0404['total']=0x0;if(!_0x6c0404[_0xa12b('0x46')]&&!_0x6c0404[_0xa12b('0x47')]){_0x6c0404[_0xa12b('0x48')]+=0x1;}if(!_0x6c0404['closed']&&_0x6c0404['UserId']){_0x6c0404[_0xa12b('0x42')]+=0x1;if(_0x6c0404[_0xa12b('0x48')]){_0x6c0404[_0xa12b('0x48')]-=0x1;}}if(_0x6c0404['closed']&&_0x6c0404[_0xa12b('0x49')]===_0xa12b('0x45')){_0x6c0404[_0xa12b('0x45')]+=0x1;if(_0x6c0404['waiting']){_0x6c0404[_0xa12b('0x48')]-=0x1;}}else if(_0x6c0404[_0xa12b('0x46')]&&!_0x6c0404[_0xa12b('0x47')]&&_0x6c0404[_0xa12b('0x49')]){_0x6c0404[_0xa12b('0x44')]+=0x1;if(_0x6c0404[_0xa12b('0x48')]){_0x6c0404['waiting']-=0x1;}}else if(_0x6c0404[_0xa12b('0x46')]&&_0x6c0404['UserId']){_0x6c0404[_0xa12b('0x43')]+=0x1;if(_0x6c0404[_0xa12b('0x42')]){_0x6c0404[_0xa12b('0x42')]-=0x1;}}_0x6c0404[_0xa12b('0x4a')]+=0x1;_0x421248(_0x6c0404);});}exports['index']=function(_0x5e8061,_0xe344e8){var _0x55bb56={},_0x1c773f={},_0x39a61e={'count':0x0,'rows':[]};var _0x1e6c99=_[_0xa12b('0x3e')](db[_0xa12b('0x4b')][_0xa12b('0x4c')],function(_0x50a676){return{'name':_0x50a676[_0xa12b('0x4d')],'type':_0x50a676[_0xa12b('0x4e')]['key']};});_0x1c773f[_0xa12b('0x4f')]=_['map'](_0x1e6c99,_0xa12b('0x37'));_0x1c773f[_0xa12b('0x50')]=_['keys'](_0x5e8061[_0xa12b('0x50')]);_0x1c773f[_0xa12b('0x51')]=_['intersection'](_0x1c773f['model'],_0x1c773f['query']);_0x55bb56[_0xa12b('0x52')]=_[_0xa12b('0x53')](_0x1c773f['model'],qs[_0xa12b('0x54')](_0x5e8061[_0xa12b('0x50')]['fields']));_0x55bb56[_0xa12b('0x52')]=_0x55bb56[_0xa12b('0x52')][_0xa12b('0x55')]?_0x55bb56[_0xa12b('0x52')]:_0x1c773f[_0xa12b('0x4f')];if(!_0x5e8061[_0xa12b('0x50')][_0xa12b('0x56')](_0xa12b('0x57'))){_0x55bb56[_0xa12b('0x31')]=qs[_0xa12b('0x31')](_0x5e8061[_0xa12b('0x50')][_0xa12b('0x31')]);_0x55bb56['offset']=qs['offset'](_0x5e8061[_0xa12b('0x50')][_0xa12b('0x2f')]);}_0x55bb56['order']=qs[_0xa12b('0x58')](_0x5e8061['query'][_0xa12b('0x58')]);_0x55bb56[_0xa12b('0x59')]=qs[_0xa12b('0x51')](_[_0xa12b('0x5a')](_0x5e8061['query'],_0x1c773f[_0xa12b('0x51')]),_0x1e6c99);var _0x9fbe50=[];var _0x201fb4=squel['select']()[_0xa12b('0x5b')]('id')[_0xa12b('0x5b')](_0xa12b('0x37'))['field'](_0xa12b('0x5c'))[_0xa12b('0x5d')]('tools_tags');var _0x44cd8d=squel[_0xa12b('0x5e')]()['field']('u.id')[_0xa12b('0x5b')](_0xa12b('0x5f'))['field'](_0xa12b('0x60'))['from'](_0xa12b('0x61'),'ui')[_0xa12b('0x62')](_0xa12b('0x63'),'u',_0xa12b('0x64'));var _0x1a98b4=squel[_0xa12b('0x5e')]()['from'](_0xa12b('0x65'),'i')['left_join'](_0xa12b('0x66'),'c',_0xa12b('0x67'))[_0xa12b('0x62')](_0xa12b('0x63'),'o',_0xa12b('0x68'))[_0xa12b('0x62')](_0xa12b('0x69'),'a',_0xa12b('0x6a'))['left_join']('chat_messages','me',_0xa12b('0x6b'))[_0xa12b('0x62')](_0xa12b('0x6c'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xa12b('0x62')]('tools_tags','t',_0xa12b('0x6d'));var _0x2a43ec=squel[_0xa12b('0x6e')]();var _0x1c5594=[];var _0x442211=squel[_0xa12b('0x6e')]();var _0x47f151;if(_0x5e8061[_0xa12b('0x50')][_0xa12b('0x6f')]){_0x47f151=as[_0xa12b('0x70')](_0x5e8061['query'][_0xa12b('0x6f')]);var _0x338c0b=_0x47f151['sqlOperator'];for(var _0x211d90=0x0;_0x211d90<_0x47f151[_0xa12b('0x71')][_0xa12b('0x55')];_0x211d90++){var _0x22015d=_0x47f151[_0xa12b('0x71')][_0x211d90];var _0x58c027='i';var _0x1910c7=_[_0xa12b('0x72')](_0x1e6c99,[_0xa12b('0x37'),_0x22015d[_0xa12b('0x5b')]]);if(!_0x1910c7){switch(_0x22015d['field']){case'unreadMessages':if(_0x22015d['value']==0x1){_0x1a98b4[_0xa12b('0x73')]('`'+_0x22015d[_0xa12b('0x5b')]+_0xa12b('0x74'));}else{_0x1a98b4[_0xa12b('0x73')]('`'+_0x22015d[_0xa12b('0x5b')]+_0xa12b('0x75'));}break;case _0xa12b('0x76'):if(_0x22015d[_0xa12b('0x77')]===_0xa12b('0x78')){if(_0x22015d[_0xa12b('0x79')][_0xa12b('0x41')]('\x20')['length']>0x1){_0x2a43ec[_0x338c0b](_0xa12b('0x7a'),qs[_0xa12b('0x7b')](_0x22015d[_0xa12b('0x79')]),null);}else{var _0x98c193='%'+_0x22015d[_0xa12b('0x79')]+'%';_0x2a43ec[_0x338c0b](_0xa12b('0x7c'),_0x98c193,_0x98c193,_0x98c193);}}else{_0x1910c7=_['find'](_0x1e6c99,[_0xa12b('0x37'),_0xa12b('0x7d')]);_0x22015d['field']='ContactId';_0x1a75db=as[_0xa12b('0x7e')](_0x58c027,_0x1910c7[_0xa12b('0x4e')],_0x22015d);_0x2a43ec[_0x338c0b](_0x1a75db['text'],_0x1a75db['value'][_0xa12b('0x7f')],_0x1a75db[_0xa12b('0x79')][_0xa12b('0x2d')]);}break;case _0xa12b('0x80'):var _0x1d5ddc=_0x22015d[_0xa12b('0x79')][_0xa12b('0x41')](',')[_0xa12b('0x3e')](function(_0x2f6514){return Number(_0x2f6514);});_0x1d5ddc[_0xa12b('0x81')](function(_0x531ba1){_0x442211['or'](_0xa12b('0x82'),'%,'+_0x531ba1+',%');});_0x1c5594=_[_0xa12b('0x83')](_0x1c5594,_0x1d5ddc);break;case _0xa12b('0x84'):if(_0x22015d[_0xa12b('0x77')]===_0xa12b('0x78')){_0x2a43ec[_0x338c0b](_0xa12b('0x85'),'%'+_0x22015d[_0xa12b('0x79')]+'%',null);}else{_0x1910c7=_[_0xa12b('0x72')](_0x1e6c99,[_0xa12b('0x37'),'UserId']);_0x22015d[_0xa12b('0x5b')]=_0xa12b('0x47');_0x1a75db=as[_0xa12b('0x7e')](_0x58c027,_0x1910c7[_0xa12b('0x4e')],_0x22015d);_0x2a43ec[_0x338c0b](_0x1a75db[_0xa12b('0x86')],_0x1a75db['value'][_0xa12b('0x7f')],_0x1a75db[_0xa12b('0x79')][_0xa12b('0x2d')]);}break;case _0xa12b('0x87'):_0x1a75db=as[_0xa12b('0x7e')]('me',null,_0x22015d);_0x2a43ec[_0x338c0b](_0x1a75db[_0xa12b('0x86')],_0x1a75db['value'][_0xa12b('0x7f')],_0x1a75db[_0xa12b('0x79')][_0xa12b('0x2d')]);break;}}else{var _0x1a75db=as[_0xa12b('0x7e')](_0x58c027,_0x1910c7[_0xa12b('0x4e')],_0x22015d);_0x2a43ec[_0x338c0b](_0x1a75db[_0xa12b('0x86')],_0x1a75db[_0xa12b('0x79')][_0xa12b('0x7f')],_0x1a75db[_0xa12b('0x79')][_0xa12b('0x2d')]);}}}else{var _0x3c1add=_(_0x5e8061[_0xa12b('0x50')])[_0xa12b('0x88')]()[_0xa12b('0x3e')](function(_0x23feb4){return _['some'](_0x1e6c99,[_0xa12b('0x37'),_0x23feb4])?_0x23feb4:undefined;})[_0xa12b('0x89')]()['value']();if(!_['isEmpty'](_0x3c1add)){_0x3c1add['forEach'](function(_0x213276){if(_0x213276===_0xa12b('0x8a')){_0x1a98b4[_0xa12b('0x59')](_0xa12b('0x8b'),[][_0xa12b('0x8c')](_0x5e8061[_0xa12b('0x50')][_0x213276]));}else if(_0x213276===_0xa12b('0x8d')){var _0x2801d4=JSON['parse'](_0x5e8061['query'][_0x213276])[_0xa12b('0x8e')];var _0x2ac6e3=JSON[_0xa12b('0x8f')](_0x5e8061[_0xa12b('0x50')][_0x213276])[_0xa12b('0x90')];_0x1a98b4['where'](_0xa12b('0x91'),_0x2801d4,_0x2ac6e3);}else{if(_0x5e8061[_0xa12b('0x50')][_0x213276]===_0xa12b('0x92')){_0x1a98b4['where']('i.'+_0x213276+_0xa12b('0x93'));}else{_0x1a98b4['where']('i.'+_0x213276+_0xa12b('0x94'),_0x5e8061[_0xa12b('0x50')][_0x213276]);}}});}if(_0x5e8061[_0xa12b('0x50')][_0xa12b('0x95')]){if(_0x5e8061[_0xa12b('0x50')][_0xa12b('0x95')]==0x1){_0x1a98b4['having'](_0xa12b('0x96'));}else{_0x1a98b4[_0xa12b('0x73')](_0xa12b('0x97'));}}if(_0x5e8061[_0xa12b('0x50')][_0xa12b('0x98')]){_0x1c5594=_[_0xa12b('0x99')](_0x5e8061[_0xa12b('0x50')][_0xa12b('0x98')])?_0x5e8061['query']['tag']:new Array(_0x5e8061[_0xa12b('0x50')][_0xa12b('0x98')]);_0x1c5594['forEach'](function(_0x76ec6b){_0x442211['or'](_0xa12b('0x82'),'%,'+_0x76ec6b+',%');});}if(_0x5e8061['query'][_0xa12b('0x9a')]){var _0x156860=_0x5e8061[_0xa12b('0x50')][_0xa12b('0x9a')]['replace']('\x5c','\x5c\x5c')[_0xa12b('0x9b')](/'/g,'\x27\x27');if(qs[_0xa12b('0x9c')](_0x156860)){_0x2a43ec['or'](_0xa12b('0x9d'),_0x156860+'%');}else{_0x2a43ec['or'](_0xa12b('0x9e'),qs[_0xa12b('0x7b')](_0x156860))['or'](_0xa12b('0x9f'),_0x156860+'%');}}}_0x1a98b4[_0xa12b('0x59')](_0x2a43ec);_0x1a98b4['group'](_0xa12b('0xa0'));var _0x33a456={'type':db[_0xa12b('0xa1')][_0xa12b('0xa2')]['SELECT'],'raw':!![]};var _0x1e29ee=_0x1a98b4['clone']();_0x1e29ee['field'](_0xa12b('0xa0'));_0x1e29ee[_0xa12b('0x5b')](_0xa12b('0xa3'),_0xa12b('0xa4'));if(_0x55bb56['order']){_0x55bb56[_0xa12b('0xa5')][_0xa12b('0x81')](function(_0x29d731){var _0x528414=_0x29d731[0x0]===_0xa12b('0xa6')?_0x29d731[0x0]:'i.'+_0x29d731[0x0];_0x1a98b4['order'](_0x528414,_0x29d731[0x1]===_0xa12b('0xa7')?![]:!![]);});}if(!_['isEmpty'](_0x1c5594)){_0x1a98b4[_0xa12b('0x73')](_0x442211);_0x1e29ee[_0xa12b('0x59')]('t.id\x20IN\x20?',_0x1c5594);}BPromise['resolve']()[_0xa12b('0x20')](function(){if(!_0x47f151){if(_0x5e8061[_0xa12b('0x50')][_0xa12b('0x8a')])return;_0x1e29ee['where'](_0xa12b('0xa8'));_0x1a98b4['where'](_0xa12b('0xa8'));return;}if(_0x5e8061['user'][_0xa12b('0xa9')]!==_0xa12b('0xaa'))return;return _0x5e8061[_0xa12b('0xab')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xa12b('0x20')](function(_0x1079a6){if(_['isEmpty'](_0x1079a6)){_0x1e29ee[_0xa12b('0x59')](_0xa12b('0xac'));_0x1a98b4[_0xa12b('0x59')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1e29ee[_0xa12b('0x59')](_0xa12b('0x8b'),_[_0xa12b('0x3e')](_0x1079a6,'id'));_0x1a98b4[_0xa12b('0x59')](_0xa12b('0x8b'),_['map'](_0x1079a6,'id'));}});})[_0xa12b('0x20')](function(){if(_0x5e8061[_0xa12b('0xab')][_0xa12b('0xa9')]===_0xa12b('0xaa')&&!_0x47f151&&!_0x5e8061[_0xa12b('0x50')][_0xa12b('0x8a')])return[];return db[_0xa12b('0xad')]['query'](_0x1e29ee[_0xa12b('0xae')](),_0x33a456);})[_0xa12b('0x20')](function(_0x365a57){_0x39a61e[_0xa12b('0x32')]=_0x365a57[_0xa12b('0x55')];if(_0x39a61e[_0xa12b('0x32')]===0x0)return[];return db['sequelize'][_0xa12b('0x50')](_0x201fb4[_0xa12b('0xae')](),_0x33a456)[_0xa12b('0x20')](function(_0x5e1055){_0x9fbe50=_['keyBy'](_0x5e1055,'id');_0x33a456=_['merge'](_0x33a456,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5e8061[_0xa12b('0x50')][_0xa12b('0x54')]){_0x55bb56[_0xa12b('0x52')][_0xa12b('0x81')](function(_0x4d2ac5){_0x1a98b4['field']('i.'+_0x4d2ac5);});}else{_0x1a98b4['field'](_0xa12b('0xa3'),'unreadMessages');_0x1a98b4[_0xa12b('0x5b')]('a.key',_0xa12b('0xaf'));_0x1a98b4[_0xa12b('0x5b')](_0xa12b('0xb0'),_0xa12b('0xb1'));_0x1a98b4['field'](_0xa12b('0xb2'),'contactName');_0x1a98b4['field']('i.*');_0x1a98b4[_0xa12b('0x5b')](_0xa12b('0xb3'),'Contact.firstName');_0x1a98b4[_0xa12b('0x5b')]('c.lastName','Contact.lastName');_0x1a98b4[_0xa12b('0x5b')]('c.email',_0xa12b('0xb4'));_0x1a98b4[_0xa12b('0x5b')]('c.phone',_0xa12b('0xb5'));_0x1a98b4[_0xa12b('0x5b')]('c.mobile','Contact.mobile');_0x1a98b4[_0xa12b('0x5b')](_0xa12b('0xb6'),_0xa12b('0xb7'));_0x1a98b4[_0xa12b('0x5b')]('o.fullname',_0xa12b('0xb8'));_0x1a98b4[_0xa12b('0x5b')]('o.internal',_0xa12b('0xb9'));_0x1a98b4[_0xa12b('0x5b')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x55bb56[_0xa12b('0x31')])_0x1a98b4[_0xa12b('0x31')](_0x55bb56[_0xa12b('0x31')]);if(_0x55bb56['offset'])_0x1a98b4[_0xa12b('0x2f')](_0x55bb56[_0xa12b('0x2f')]);return db[_0xa12b('0xad')][_0xa12b('0x50')](_0x1a98b4[_0xa12b('0xae')](),_0x33a456);})[_0xa12b('0x20')](function(_0x107a7d){if(_0x107a7d[_0xa12b('0x55')]>0x0)_0x44cd8d['where']('ui.ChatInteractionId\x20IN\x20?',_[_0xa12b('0x3e')](_0x107a7d,'id'));return db[_0xa12b('0xad')]['query'](_0x44cd8d['toString'](),_0x33a456)['then'](function(_0x33a0f6){var _0x56336b=_['groupBy'](_0x33a0f6,_0xa12b('0xba'));var _0x9374d3=[];_0x107a7d[_0xa12b('0x81')](function(_0x377da5){_0x9374d3[_0xa12b('0xbb')](updateChatInteraction(_0x377da5,_0x9fbe50,_0x56336b));});return BPromise['all'](_0x9374d3);});});})[_0xa12b('0x20')](function(_0x5acd7e){_0x39a61e[_0xa12b('0xbc')]=_0x5acd7e;return _0x39a61e;})[_0xa12b('0x20')](respondWithFilteredResult(_0xe344e8,_0x55bb56))[_0xa12b('0x2a')](handleError(_0xe344e8,null));};exports['show']=function(_0xabc81f,_0x53aaa2){var _0x31748d={'raw':![],'where':{'id':_0xabc81f['params']['id']}},_0x104db5={};_0x104db5[_0xa12b('0x4f')]=_[_0xa12b('0x88')](db[_0xa12b('0x4b')]['rawAttributes']);_0x104db5[_0xa12b('0x50')]=_[_0xa12b('0x88')](_0xabc81f[_0xa12b('0x50')]);_0x104db5['filters']=_[_0xa12b('0x53')](_0x104db5[_0xa12b('0x4f')],_0x104db5[_0xa12b('0x50')]);_0x31748d[_0xa12b('0x52')]=_[_0xa12b('0x53')](_0x104db5[_0xa12b('0x4f')],qs[_0xa12b('0x54')](_0xabc81f[_0xa12b('0x50')]['fields']));_0x31748d[_0xa12b('0x52')]=_0x31748d[_0xa12b('0x52')]['length']?_0x31748d['attributes']:_0x104db5[_0xa12b('0x4f')];if(_0xabc81f[_0xa12b('0x50')][_0xa12b('0xbd')]){_0x31748d[_0xa12b('0xbe')]=[{'all':!![]}];}_0x31748d=_[_0xa12b('0xbf')]({},_0x31748d,_0xabc81f['options']);return db[_0xa12b('0x4b')]['find'](_0x31748d)['then'](handleEntityNotFound(_0x53aaa2,null))[_0xa12b('0x20')](respondWithResult(_0x53aaa2,null))['catch'](handleError(_0x53aaa2,null));};exports[_0xa12b('0xc0')]=function(_0x190c80,_0x50e2a1){return db[_0xa12b('0x4b')][_0xa12b('0xc0')](_0x190c80[_0xa12b('0x87')],{})[_0xa12b('0x20')](respondWithResult(_0x50e2a1,0xc9))[_0xa12b('0x2a')](handleError(_0x50e2a1,null));};exports[_0xa12b('0xc1')]=function(_0x2f654b,_0x4f1e4e){if(_0x2f654b[_0xa12b('0x87')]['id']){delete _0x2f654b['body']['id'];}return db[_0xa12b('0x4b')]['find']({'where':{'id':_0x2f654b[_0xa12b('0xc2')]['id']}})[_0xa12b('0x20')](handleEntityNotFound(_0x4f1e4e,null))[_0xa12b('0x20')](saveUpdates(_0x2f654b[_0xa12b('0x87')],null))['then'](respondWithResult(_0x4f1e4e,null))[_0xa12b('0x2a')](handleError(_0x4f1e4e,null));};exports[_0xa12b('0x36')]=function(_0xa99b85,_0x3c5790){return db[_0xa12b('0x4b')][_0xa12b('0x72')]({'where':{'id':_0xa99b85[_0xa12b('0xc2')]['id']}})['then'](handleEntityNotFound(_0x3c5790,null))[_0xa12b('0x20')](removeEntity(_0x3c5790,null))[_0xa12b('0x2a')](handleError(_0x3c5790,null));};exports[_0xa12b('0xc3')]=function(_0x426466,_0x2314ee){return db[_0xa12b('0x4b')][_0xa12b('0xc3')]()[_0xa12b('0x20')](respondWithResult(_0x2314ee,null))[_0xa12b('0x2a')](handleError(_0x2314ee,null));};exports[_0xa12b('0xc4')]=function(_0x51e45f,_0x5ba63a){var _0x10b9fa=_0x51e45f[_0xa12b('0xc2')]['id'];var _0x44ef45;var _0x16cc23;var _0x308f77;return db[_0xa12b('0x4b')]['findOne']({'where':{'id':_0x10b9fa}})[_0xa12b('0x20')](function(_0x473e91){_0x44ef45=_0x473e91;return db[_0xa12b('0xc5')][_0xa12b('0xc6')]({'where':{'id':_0x473e91['ChatWebsiteId']},'attributes':['id',_0xa12b('0xc7'),'vidaooEscalation','vidaooTopic',_0xa12b('0xc8'),_0xa12b('0xc9')],'raw':!![]});})[_0xa12b('0x20')](function(_0x4813ab){if(_0x4813ab&&_0x4813ab['vidaooApiKey']&&_0x4813ab[_0xa12b('0xca')]){_0x16cc23=_0x4813ab;var _0x458282={'interaction':{'id':_0x10b9fa},'agent':{'id':_0x51e45f[_0xa12b('0xab')]['id'],'name':_0x51e45f[_0xa12b('0xab')][_0xa12b('0x37')],'fullname':_0x51e45f[_0xa12b('0xab')][_0xa12b('0xcb')],'email':_0x51e45f['user'][_0xa12b('0xcc')]},'contact':_0x51e45f[_0xa12b('0x87')]['contact'],'account':_0x51e45f[_0xa12b('0x87')][_0xa12b('0x3c')]};var _0x3df682={'rejectUnauthorized':![],'method':_0xa12b('0xcd'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x4813ab[_0xa12b('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x51e45f[_0xa12b('0xab')][_0xa12b('0xcc')]],'buttons':null,'topic':_0x16cc23['vidaooTopic'],'note':_[_0xa12b('0xce')](_0x16cc23[_0xa12b('0xc8')])?null:getMustacheRender(_0x16cc23[_0xa12b('0xc8')],_0x458282),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xa12b('0xce')](_0x16cc23[_0xa12b('0xc9')])){var _0x15bc04=getMustacheRender(_0x16cc23[_0xa12b('0xc9')],_0x458282);var _0x21aa7c=JSON[_0xa12b('0x8f')](_0x15bc04);_0x3df682[_0xa12b('0x87')][_0xa12b('0xcf')]=_0x21aa7c;}}catch(_0x6c3f53){throw new db[(_0xa12b('0xa1'))]['ValidationError'](_0xa12b('0xd0'));}return rp(_0x3df682);}else{throw new db[(_0xa12b('0xa1'))][(_0xa12b('0xd1'))](_0xa12b('0xd2'));}})[_0xa12b('0x20')](function(_0x1ae261){_0x308f77=_0x1ae261;if(_0x308f77['id']){var _0x4d4135={'body':_0x308f77['join_url'],'ChatWebsiteId':_0x16cc23['id'],'ChatInteractionId':_0x44ef45['id'],'direction':'out','UserId':_0x51e45f[_0xa12b('0xab')]['id']};return db[_0xa12b('0xd3')][_0xa12b('0xc0')](_0x4d4135,{});}else{throw new db['Sequelize'][(_0xa12b('0xd1'))](_0xa12b('0xd4'));}})[_0xa12b('0x20')](function(){return _0x44ef45[_0xa12b('0xd5')]({'vidaooSessionId':_0x308f77['id']});})[_0xa12b('0x20')](respondWithResult(_0x5ba63a,null))[_0xa12b('0x2a')](handleError(_0x5ba63a,null));};exports[_0xa12b('0xd6')]=function(_0x268672,_0x5472b9){if(_0x268672['body']['id']){delete _0x268672[_0xa12b('0x87')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x268672[_0xa12b('0xc2')]['id']},'include':[{'model':db[_0xa12b('0xd7')],'as':'Contact'}]})[_0xa12b('0x20')](handleEntityNotFound(_0x5472b9,null))[_0xa12b('0x20')](saveUpdates(_0x268672[_0xa12b('0x87')],null))[_0xa12b('0x20')](respondWithResult(_0x5472b9,null))[_0xa12b('0x2a')](handleError(_0x5472b9,null));};exports[_0xa12b('0xd8')]=function(_0x5c3508,_0x2aae4a,_0xb9d34a){if(_0x5c3508['body']['id']){delete _0x5c3508[_0xa12b('0x87')]['id'];}return db[_0xa12b('0x4b')][_0xa12b('0x72')]({'where':{'id':_0x5c3508['params']['id']}})['then'](function(_0x9e5e75){if(!_0x9e5e75){logger[_0xa12b('0x26')](_0xa12b('0xd9'),'abandon',0x194,'entity\x20not\x20found');_0x2aae4a['sendStatus'](0x194);}else{if(_0x9e5e75[_0xa12b('0x47')]){throw new db[(_0xa12b('0xa1'))][(_0xa12b('0xd1'))](_0xa12b('0xda'));}}return _0x9e5e75;})[_0xa12b('0x20')](function(_0x1bdedc){if(_0x1bdedc){return _0x1bdedc[_0xa12b('0xc1')]({'closed':_0x5c3508[_0xa12b('0x87')][_0xa12b('0x46')],'disposition':_0x5c3508[_0xa12b('0x87')][_0xa12b('0x49')]})['then'](function(_0xdedca5){return _0xdedca5;});}})['then'](function(_0x2ce882){return respondWithRpcPromise(_0xa12b('0xdb'),'abandon',_0x5c3508[_0xa12b('0x87')],client9004);})[_0xa12b('0x20')](respondWithResult(_0x2aae4a,null))[_0xa12b('0x2a')](handleError(_0x2aae4a,null));};exports['attachmentUpload']=function(_0x1b7423,_0x48b7fc,_0x36fdf9){_0x1b7423['body'][_0xa12b('0x37')]=_0x1b7423[_0xa12b('0xdc')][_0xa12b('0xdd')];_0x1b7423[_0xa12b('0x87')][_0xa12b('0xde')]=_0x1b7423['file'][_0xa12b('0xdf')];_0x1b7423['body'][_0xa12b('0x4e')]=_0x1b7423[_0xa12b('0xdc')][_0xa12b('0xe0')];return db[_0xa12b('0xe1')][_0xa12b('0xc0')](_0x1b7423['body'])[_0xa12b('0x20')](respondWithResult(_0x48b7fc,0xc9))[_0xa12b('0x2a')](handleError(_0x48b7fc,null));};exports['attachmentDownload']=function(_0x267b89,_0x528e73,_0x4cde0f){return db[_0xa12b('0x4b')][_0xa12b('0xc6')]({'where':{'id':_0x267b89[_0xa12b('0xc2')]['id']},'raw':!![]})[_0xa12b('0x20')](handleEntityNotFound(_0x528e73,null))[_0xa12b('0x20')](function(_0x37ac22){if(_0x37ac22){if(_0x37ac22['closed']){return _0x528e73[_0xa12b('0x2c')](0x193)[_0xa12b('0x2e')]({'status':0x193,'message':_0xa12b('0xe2')});}return db[_0xa12b('0xe1')][_0xa12b('0xc6')]({'where':{'id':_0x267b89['query'][_0xa12b('0xe3')]},'raw':!![]})[_0xa12b('0x20')](handleEntityNotFound(_0x528e73,null));}})[_0xa12b('0x20')](function(_0x1c0088){if(_0x1c0088){var _0x499923=_0x1c0088[_0xa12b('0xe4')]!==null;var _0x7ce5e9=path['join'](config[_0xa12b('0xe5')],'server/files/attachments/');if(_0x499923){_0x7ce5e9=path[_0xa12b('0xe6')](_0x7ce5e9,_0xa12b('0xe7'));}var _0x1f5e2c=path[_0xa12b('0xe6')](_0x7ce5e9,_0x1c0088[_0xa12b('0xde')]);return _0x528e73[_0xa12b('0xe8')](_0x1f5e2c);}})[_0xa12b('0x2a')](handleError(_0x528e73,null));};exports[_0xa12b('0xe9')]=function(_0xf88e45,_0x5c70ce){var _0x4a0b85=null;var _0x3803b4=null;var _0x12dab0=null;var _0x8dafd2=null;if(_0xf88e45['body']['id']){delete _0xf88e45[_0xa12b('0x87')]['id'];}if(_0xf88e45[_0xa12b('0x87')]['mailTranscript']){_0x8dafd2=path[_0xa12b('0xe6')](config[_0xa12b('0xe5')],_0xa12b('0xea'),util[_0xa12b('0xeb')]('transcript-%s.txt',Date[_0xa12b('0xec')]()));_0xf88e45[_0xa12b('0x87')][_0xa12b('0xed')]=_0x8dafd2;}return db[_0xa12b('0x4b')]['find']({'where':{'id':_0xf88e45[_0xa12b('0xc2')]['id']},'include':[{'model':db[_0xa12b('0xd3')],'as':_0xa12b('0xee'),'include':[{'model':db['User'],'as':'User'}]}]})[_0xa12b('0x20')](handleEntityNotFound(_0x5c70ce,null))[_0xa12b('0x20')](saveUpdates(_0xf88e45[_0xa12b('0x87')],null))['then'](function(_0x5814b9){if(_0x5814b9){_0x4a0b85=_0x5814b9;return db[_0xa12b('0xc5')][_0xa12b('0x72')]({'where':{'id':_0x4a0b85[_0xa12b('0x8a')]}});}})[_0xa12b('0x20')](function(_0x503ad0){if(_0x503ad0){_0x12dab0=_0x503ad0;return db[_0xa12b('0xd7')][_0xa12b('0x72')]({'where':{'id':_0x4a0b85[_0xa12b('0x7d')]}});}})[_0xa12b('0x20')](function(_0x6bb09a){if(_0x6bb09a){_0x3803b4=_0x6bb09a;if(_0x8dafd2){var _0x3b91f2=null;for(var _0x23fcfd=0x1;_0x23fcfd<_0x4a0b85[_0xa12b('0xee')][_0xa12b('0x55')];++_0x23fcfd){_0x3b91f2=_0x4a0b85[_0xa12b('0xee')][_0x23fcfd];var _0x207469=_0x3b91f2['UserId']?util[_0xa12b('0xeb')](_0xa12b('0xef'),_0x12dab0['agentAlias'],_0x3b91f2['UserId']):_0xa12b('0xf0');var _0x5ceb7f=_0xf88e45[_0xa12b('0x87')][_0xa12b('0xf1')]||util[_0xa12b('0xeb')](_0xa12b('0xef'),_0xa12b('0xf2'),_0x3b91f2[_0xa12b('0x7d')]);switch(_0x12dab0[_0xa12b('0xf3')]){case'website_alias':_0x207469=_0x3b91f2[_0xa12b('0x47')]?util[_0xa12b('0xeb')](_0xa12b('0xef'),_0x12dab0[_0xa12b('0xf4')],_0x3b91f2[_0xa12b('0x47')]):_0xa12b('0xf0');break;case'agent_alias':_0x207469=_0x3b91f2[_0xa12b('0x47')]?_0x3b91f2[_0xa12b('0x84')]['alias']||_0x3b91f2[_0xa12b('0x84')][_0xa12b('0xcb')]:_0xa12b('0xf0');break;case _0xa12b('0xf5'):_0x207469=_0x3b91f2['UserId']?_0x3b91f2[_0xa12b('0x84')]['fullname']:_0xa12b('0xf0');break;default:_0x207469=_0x3b91f2['UserId']?util[_0xa12b('0xeb')](_0xa12b('0xef'),_0x12dab0[_0xa12b('0xf4')],_0x3b91f2[_0xa12b('0x47')]):_0xa12b('0xf0');}var _0x56692f=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x3b91f2[_0xa12b('0x8d')])['format'](_0xa12b('0xf6')),_0x3b91f2[_0xa12b('0xf7')]==='in'?_0x5ceb7f:_0x207469,_0x3b91f2[_0xa12b('0x87')]);if(!_0x3b91f2['secret']){fs['appendFileSync'](_0x8dafd2,_0x56692f);}}return db[_0xa12b('0xf8')][_0xa12b('0xc6')]({'where':{'service':!![]},'include':[{'model':db[_0xa12b('0xf9')],'as':_0xa12b('0xfa'),'raw':!![]}]});}}})[_0xa12b('0x20')](function(_0x19e3e9){if(_0x19e3e9&&_0x19e3e9[_0xa12b('0xfa')]&&_0xf88e45[_0xa12b('0x87')]){var _0x45908e={'tls':{'rejectUnauthorized':![]}};if(_0x19e3e9['Smtp']['service']){_0x45908e[_0xa12b('0xfb')]=_0x19e3e9[_0xa12b('0xfa')]['service'];}else{_0x45908e['host']=_0x19e3e9[_0xa12b('0xfa')]['host'];_0x45908e[_0xa12b('0xfc')]=_0x19e3e9[_0xa12b('0xfa')][_0xa12b('0xfc')];_0x45908e['secure']=_0x19e3e9[_0xa12b('0xfa')]['secure'];}if(_0x19e3e9['Smtp'][_0xa12b('0xfd')]){_0x45908e[_0xa12b('0xfe')]={'user':_0x19e3e9['Smtp']['user'],'pass':_0x19e3e9[_0xa12b('0xfa')]['pass']};}return respondWithRpcPromise(_0xa12b('0xff'),_0xa12b('0x100'),{'account':_0x45908e,'message':{'from':util[_0xa12b('0xeb')](_0xa12b('0x101'),_0x19e3e9['name'],_0x19e3e9['email']||_0x19e3e9['Smtp'][_0xa12b('0xab')]),'to':_0xf88e45[_0xa12b('0x87')][_0xa12b('0x102')],'subject':_0xa12b('0x103'),'text':util['format'](_0xa12b('0x104'),_0xf88e45[_0xa12b('0x87')][_0xa12b('0x102')]),'attachments':[{'path':_0x8dafd2}]}})[_0xa12b('0x20')](function(){return _0x4a0b85;})[_0xa12b('0x2a')](function(_0x2b6587){console[_0xa12b('0x26')](_0x2b6587);});}else{return _0x4a0b85;}})[_0xa12b('0x20')](respondWithStatusCode(_0x5c70ce,0xc8))['catch'](handleError(_0x5c70ce,null));};exports[_0xa12b('0x105')]=function(_0x104961,_0x2ce54c,_0x1f8bc0){return db['ChatMessage']['find']({'where':{'id':_0x104961[_0xa12b('0xc2')]['id']}})['then'](handleEntityNotFound(_0x2ce54c,null))[_0xa12b('0x20')](function(_0x5ce1d0){if(_0x5ce1d0){return _0x5ce1d0[_0xa12b('0x105')](_0x104961[_0xa12b('0x87')][_0xa12b('0x106')],_[_0xa12b('0x107')](_0x104961['body'],['ids','id'])||{});}})[_0xa12b('0x20')](respondWithResult(_0x2ce54c,null))[_0xa12b('0x2a')](handleError(_0x2ce54c,null));};exports[_0xa12b('0x108')]=function(_0x1d0b27,_0x26b7b3,_0x4c9254){var _0x50973d={'raw':![],'where':{}};var _0x22b53b={};var _0x5ede23={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa12b('0xc6')]({'where':{'id':_0x1d0b27['params']['id']}})['then'](handleEntityNotFound(_0x26b7b3,null))[_0xa12b('0x20')](function(_0x2cf5bd){if(_0x2cf5bd){_0x22b53b[_0xa12b('0x4f')]=_[_0xa12b('0x88')](db[_0xa12b('0xd3')][_0xa12b('0x4c')]);_0x22b53b[_0xa12b('0x50')]=_[_0xa12b('0x88')](_0x1d0b27[_0xa12b('0x50')]);_0x22b53b[_0xa12b('0x51')]=_[_0xa12b('0x53')](_0x22b53b[_0xa12b('0x4f')],_0x22b53b[_0xa12b('0x50')]);_0x50973d['attributes']=_['intersection'](_0x22b53b[_0xa12b('0x4f')],qs[_0xa12b('0x54')](_0x1d0b27[_0xa12b('0x50')][_0xa12b('0x54')]));_0x50973d[_0xa12b('0x52')]=_0x50973d[_0xa12b('0x52')][_0xa12b('0x55')]?_0x50973d[_0xa12b('0x52')]:_0x22b53b[_0xa12b('0x4f')];if(!_0x1d0b27[_0xa12b('0x50')][_0xa12b('0x56')](_0xa12b('0x57'))){_0x50973d[_0xa12b('0x31')]=qs[_0xa12b('0x31')](_0x1d0b27[_0xa12b('0x50')]['limit']);_0x50973d[_0xa12b('0x2f')]=qs[_0xa12b('0x2f')](_0x1d0b27[_0xa12b('0x50')][_0xa12b('0x2f')]);}_0x50973d[_0xa12b('0xa5')]=qs[_0xa12b('0x58')](_0x1d0b27['query']['sort']);_0x50973d[_0xa12b('0x59')]=qs[_0xa12b('0x51')](_[_0xa12b('0x5a')](_0x1d0b27[_0xa12b('0x50')],_0x22b53b['filters']));_0x50973d['where'][_0xa12b('0xba')]=_0x2cf5bd['id'];if(_0x1d0b27[_0xa12b('0x50')]['filter']){_0x50973d[_0xa12b('0x59')]=_['merge'](_0x50973d[_0xa12b('0x59')],{'$or':_['map'](_0x50973d[_0xa12b('0x52')],function(_0x488f8d){var _0x3a572f={};_0x3a572f[_0x488f8d]={'$like':'%'+_0x1d0b27[_0xa12b('0x50')][_0xa12b('0x9a')]+'%'};return _0x3a572f;})});}if(_0x1d0b27['query'][_0xa12b('0x8e')]){var _0x539409=_0x1d0b27[_0xa12b('0x50')]['$gte']['split'](',');var _0x268943={};_0x268943[_0x539409[0x0]]={'$gte':moment(_0x539409[0x1])[_0xa12b('0xeb')](_0xa12b('0x109'))};_0x50973d[_0xa12b('0x59')]=_['merge'](_0x50973d[_0xa12b('0x59')],_0x268943);}_0x50973d=_[_0xa12b('0xbf')]({},_0x50973d,_0x1d0b27[_0xa12b('0x10a')]);return db[_0xa12b('0xd3')][_0xa12b('0x32')]({'where':_0x50973d[_0xa12b('0x59')]})['then'](function(_0x4e6d5e){_0x5ede23[_0xa12b('0x32')]=_0x4e6d5e;if(_0x1d0b27[_0xa12b('0x50')][_0xa12b('0xbd')]){_0x50973d[_0xa12b('0xbe')]=[{'all':!![]}];}return db[_0xa12b('0xd3')]['findAll'](_0x50973d);})[_0xa12b('0x20')](function(_0x3b5866){_0x5ede23[_0xa12b('0xbc')]=_0x3b5866;return _0x5ede23;});}})[_0xa12b('0x20')](respondWithFilteredResult(_0x26b7b3,_0x50973d))['catch'](handleError(_0x26b7b3,null));};exports['getMyMessages']=function(_0x2e63f5,_0x247963,_0x5aa89b){var _0x479541={'where':{}},_0x21a29d={},_0x147d75={'count':0x0,'rows':[]};return db[_0xa12b('0x4b')][_0xa12b('0xc6')]({'where':{'id':_0x2e63f5[_0xa12b('0xc2')]['id']}})[_0xa12b('0x20')](handleEntityNotFound(_0x247963,null))['then'](function(_0x15d597){if(_0x15d597){_0x21a29d[_0xa12b('0x4f')]=_[_0xa12b('0x88')](db[_0xa12b('0xd3')][_0xa12b('0x4c')]);_0x21a29d[_0xa12b('0x50')]=_['keys'](_0x2e63f5[_0xa12b('0x50')]);_0x21a29d['filters']=_[_0xa12b('0x53')](_0x21a29d[_0xa12b('0x4f')],_0x21a29d[_0xa12b('0x50')]);_0x479541['attributes']=_[_0xa12b('0x53')](_0x21a29d['model'],qs[_0xa12b('0x54')](_0x2e63f5[_0xa12b('0x50')]['fields']));_0x479541[_0xa12b('0x52')]=_0x479541[_0xa12b('0x52')][_0xa12b('0x55')]?_0x479541[_0xa12b('0x52')]:_0x21a29d[_0xa12b('0x4f')];if(!_0x2e63f5[_0xa12b('0x50')][_0xa12b('0x56')]('nolimit')){_0x479541[_0xa12b('0x31')]=qs[_0xa12b('0x31')](_0x2e63f5[_0xa12b('0x50')]['limit']);_0x479541[_0xa12b('0x2f')]=qs[_0xa12b('0x2f')](_0x2e63f5[_0xa12b('0x50')]['offset']);}_0x479541['order']=qs[_0xa12b('0x58')](_0x2e63f5[_0xa12b('0x50')][_0xa12b('0x58')]);_0x479541[_0xa12b('0x59')]=qs['filters'](_['pick'](_0x2e63f5[_0xa12b('0x50')],_0x21a29d[_0xa12b('0x51')]));_0x479541[_0xa12b('0x59')][_0xa12b('0xba')]=_0x15d597['id'];if(_0x2e63f5[_0xa12b('0x50')]['filter']){_0x479541[_0xa12b('0x59')]=_['merge'](_0x479541[_0xa12b('0x59')],{'$or':_[_0xa12b('0x3e')](_0x479541['attributes'],function(_0x27380c){var _0x4a4615={};_0x4a4615[_0x27380c]={'$like':'%'+_0x2e63f5[_0xa12b('0x50')][_0xa12b('0x9a')]+'%'};return _0x4a4615;})});}_0x479541[_0xa12b('0x59')]['secret']=![];if(_0x2e63f5[_0xa12b('0x50')]['id']){_0x479541['where']['id']={'$gt':_0x2e63f5[_0xa12b('0x50')]['id']};}_0x479541=_['merge']({},_0x479541,_0x2e63f5[_0xa12b('0x10a')]);return db[_0xa12b('0xd3')][_0xa12b('0x32')]({'where':_0x479541[_0xa12b('0x59')]})[_0xa12b('0x20')](function(_0x5ee2e8){_0x147d75[_0xa12b('0x32')]=_0x5ee2e8;_0x479541[_0xa12b('0xbe')]=[];if(_0x2e63f5[_0xa12b('0x50')][_0xa12b('0x10b')]){_0x479541['include']['push']({'model':db[_0xa12b('0x84')],'as':_0xa12b('0x84'),'attributes':['id',_0xa12b('0xcb'),_0xa12b('0x10c')]});}if(_0x2e63f5[_0xa12b('0x50')]['includeAll']){_0x479541[_0xa12b('0xbe')]=[{'all':!![]}];}return db['ChatMessage'][_0xa12b('0x10d')](_0x479541);})['then'](function(_0x3512a3){_0x147d75[_0xa12b('0xbc')]=_0x3512a3;return _0x147d75;});}})[_0xa12b('0x20')](respondWithFilteredResult(_0x247963,_0x479541))['catch'](handleError(_0x247963,null));};exports[_0xa12b('0x10e')]=function(_0x13fd5a,_0x3292ed,_0x43a2dc){return db[_0xa12b('0x4b')][_0xa12b('0x72')]({'where':{'id':_0x13fd5a['params']['id']}})['then'](handleEntityNotFound(_0x3292ed,null))[_0xa12b('0x20')](function(_0x24f0c8){if(_0x24f0c8){return _0x24f0c8[_0xa12b('0x10f')](_0x13fd5a[_0xa12b('0x87')]['ids'],_[_0xa12b('0x107')](_0x13fd5a['body'],['ids','id'])||{})['spread'](function(){return db[_0xa12b('0x80')]['findAll']({'attributes':['id','name',_0xa12b('0x5c')],'where':{'id':_0x13fd5a[_0xa12b('0x87')][_0xa12b('0x106')]}});})['then'](function(_0x168dca){socket[_0xa12b('0x110')](_0xa12b('0x111'),{'id':Number(_0x13fd5a['params']['id']),'tags':_0x168dca||[]});return{'id':Number(_0x13fd5a[_0xa12b('0xc2')]['id']),'tags':_0x168dca||[]};});}})[_0xa12b('0x20')](respondWithResult(_0x3292ed,null))[_0xa12b('0x2a')](handleError(_0x3292ed,null));};exports[_0xa12b('0x112')]=function(_0x3b591c,_0x1e1e43,_0x26153e){return db[_0xa12b('0x4b')][_0xa12b('0x72')]({'where':{'id':_0x3b591c[_0xa12b('0xc2')]['id']}})['then'](handleEntityNotFound(_0x1e1e43,null))[_0xa12b('0x20')](function(_0x2f20e5){if(_0x2f20e5){return _0x2f20e5[_0xa12b('0x112')](_0x3b591c[_0xa12b('0x50')][_0xa12b('0x106')]);}})[_0xa12b('0x20')](respondWithStatusCode(_0x1e1e43,null))[_0xa12b('0x2a')](handleError(_0x1e1e43,null));};exports[_0xa12b('0xe8')]=function(_0x241bba,_0x51d47a){var _0x24d6cf=moment()[_0xa12b('0x113')]()['toString']();var _0x352cc2=path[_0xa12b('0xe6')](config[_0xa12b('0xe5')],_0xa12b('0x114'),'files',_0xa12b('0x115'));var _0x585a60=path[_0xa12b('0xe6')](config[_0xa12b('0xe5')],_0xa12b('0x114'),_0xa12b('0x116'),_0xa12b('0x117'));var _0x42ac01=path[_0xa12b('0xe6')](_0x352cc2,_0x24d6cf);var _0x45f1f5=util['format'](_0xa12b('0x118'),_0x241bba[_0xa12b('0xc2')]['id'],_0x24d6cf);var _0x5e7276=path[_0xa12b('0xe6')](_0x352cc2,_0x45f1f5);var _0xbe655d=[];_0xbe655d[_0xa12b('0xbb')]({'model':db[_0xa12b('0x84')],'as':_0xa12b('0x84'),'attributes':['id',_0xa12b('0xcb')],'raw':!![]});_0xbe655d[_0xa12b('0xbb')]({'model':db[_0xa12b('0xd7')],'as':_0xa12b('0x76'),'attributes':['id',_0xa12b('0x119'),_0xa12b('0x11a')],'raw':!![]});if(_0x241bba[_0xa12b('0x50')][_0xa12b('0x117')]){_0xbe655d['push']({'model':db[_0xa12b('0xe1')],'as':_0xa12b('0xe1'),'raw':!![]});}var _0x2dee6d=[{'model':db[_0xa12b('0xd3')],'as':'Messages','attributes':['id',_0xa12b('0x87'),_0xa12b('0x8d'),'direction','secret',_0xa12b('0x95')],'include':_0xbe655d}];_0x2dee6d[_0xa12b('0xbb')]({'model':db[_0xa12b('0xc5')],'as':_0xa12b('0x11b'),'attributes':['id',_0xa12b('0x37')]});_0x2dee6d[_0xa12b('0xbb')]({'model':db[_0xa12b('0x84')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction'][_0xa12b('0x72')]({'where':{'id':_0x241bba[_0xa12b('0xc2')]['id']},'include':_0x2dee6d})[_0xa12b('0x20')](handleEntityNotFound(_0x51d47a,null))['then'](function(_0x5db559){if(_0x5db559){var _0x4772ff=_0x5db559[_0xa12b('0x11c')]({'plain':!![]});fs[_0xa12b('0x11d')](_0x42ac01);var _0x14a59e={'channel':'Chat','account':_0x4772ff[_0xa12b('0x11b')]['name'],'agent':_0x4772ff['Owner']?_0x4772ff[_0xa12b('0x11e')]['fullname']:_0xa12b('0x11f'),'createdAt':moment(_0x4772ff[_0xa12b('0x8d')])[_0xa12b('0xeb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa12b('0xae')](),'closedAt':_0x4772ff[_0xa12b('0x46')]?moment(_0x4772ff[_0xa12b('0x120')])[_0xa12b('0xeb')](_0xa12b('0x109'))['toString']():'','disposition':_0x4772ff['disposition'],'chatInfo':{'browser':_0x4772ff[_0xa12b('0x121')],'os':_0x4772ff[_0xa12b('0x122')],'referer':_0x4772ff[_0xa12b('0x123')],'customerIp':_0x4772ff['customerIp'],'customerPort':_0x4772ff[_0xa12b('0x124')]?_0x4772ff[_0xa12b('0x124')]:_0xa12b('0x11f')},'messages':_(_0x4772ff['Messages'])[_0xa12b('0x125')]()['filter']({'secret':![]})[_0xa12b('0x3e')](function(_0x1db6e7){if(_0x1db6e7[_0xa12b('0xe1')]){var _0x37c6da=path[_0xa12b('0xe6')](_0x585a60,_0x1db6e7[_0xa12b('0xe1')]['basename']);if(fs[_0xa12b('0x126')](_0x37c6da)){fs[_0xa12b('0x127')](_0x37c6da)[_0xa12b('0x128')](fs[_0xa12b('0x129')](path[_0xa12b('0xe6')](_0x42ac01,_0x1db6e7[_0xa12b('0xe1')]['basename'])));}}return{'date':moment(_0x1db6e7[_0xa12b('0x8d')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa12b('0xae')](),'sender':_0x1db6e7['direction']===_0xa12b('0x12a')?_0x1db6e7['User']?_0x1db6e7[_0xa12b('0x84')]['fullname']:_0xa12b('0xf0'):_0x1db6e7[_0xa12b('0x76')][_0xa12b('0x119')]+(_0x1db6e7[_0xa12b('0x76')][_0xa12b('0x11a')]?'\x20'+_0x1db6e7[_0xa12b('0x76')][_0xa12b('0x11a')]:''),'body':_0x1db6e7[_0xa12b('0xe1')]?_0x1db6e7['Attachment'][_0xa12b('0xde')]:_0x1db6e7[_0xa12b('0x87')],'direction':_0x1db6e7[_0xa12b('0xf7')]===_0xa12b('0x12a')?'A':'C','secret':_0x1db6e7[_0xa12b('0x12b')],'read':_0x1db6e7[_0xa12b('0x95')],'attachment':_0x1db6e7[_0xa12b('0xe1')]};})[_0xa12b('0x79')]()};return ejs['renderFile'](path[_0xa12b('0xe6')](config['root'],_0xa12b('0x114'),_0xa12b('0x12c'),_0xa12b('0x12d')),{'interaction':_0x14a59e})[_0xa12b('0x20')](function(_0x1f9643){var _0x2272f2=path[_0xa12b('0xe6')](_0x42ac01,'transcript-'+_0x4772ff['id']+'-'+_0x24d6cf+_0xa12b('0x12e'));var _0x262fd8={'path':_0x2272f2,'channel':_0xa12b('0x12f'),'interactionId':_0x4772ff['id']};return pdf[_0xa12b('0x130')](_0x1f9643,_0x262fd8);})[_0xa12b('0x20')](function(){return new BPromise(function(_0x489dab,_0x4bf60e){zipdir(_0x42ac01,{'saveTo':_0x5e7276},function(_0x578e04,_0x55a061){if(_0x578e04)return _0x4bf60e(_0x578e04);return _0x489dab(_0x55a061);});})['then'](function(){return new BPromise(function(_0x34c411,_0x1b737a){rimraf(_0x42ac01,function(_0x2606b9){if(_0x2606b9)_0x1b737a(_0x2606b9);return _0x34c411();});});})[_0xa12b('0x20')](function(){return _0x51d47a[_0xa12b('0xe8')](_0x5e7276,_0x45f1f5,function(_0x244c9e){if(_0x244c9e){console[_0xa12b('0x131')]('err',_0x244c9e);}else{fs[_0xa12b('0x132')](_0x5e7276);}});});});}else{return _0x51d47a[_0xa12b('0x2b')](0xc8);}})[_0xa12b('0x2a')](handleError(_0x51d47a,null));};
\ No newline at end of file
index 1853e40..60e8a77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd88d=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','save','remove','getUsers','then','Users','findAll','setDataValue','unreadMessages','length'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xd88d,0x1d0));var _0xdd88=function(_0x5d1fd4,_0x44e2fb){_0x5d1fd4=_0x5d1fd4-0x0;var _0x31f23e=_0xd88d[_0x5d1fd4];return _0x31f23e;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xdd88('0x0'))['db'][_0xdd88('0x1')];var ChatMessage=require(_0xdd88('0x0'))['db'][_0xdd88('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdd88('0x3'),'afterUpdate':'update','afterDestroy':_0xdd88('0x4')};function emitEvent(_0x57ef90){return function(_0x35b23f,_0x458097,_0x4ed10b){_0x35b23f[_0xdd88('0x5')]({'attributes':['id'],'raw':!![]})[_0xdd88('0x6')](function(_0x30c0a9){_0x35b23f['setDataValue'](_0xdd88('0x7'),_0x30c0a9['map'](function(_0x3655f9){return{'id':_0x3655f9['id']};}));return ChatMessage[_0xdd88('0x8')]({'where':{'ChatInteractionId':_0x35b23f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdd88('0x6')](function(_0x140295){_0x35b23f[_0xdd88('0x9')](_0xdd88('0xa'),_0x140295[_0xdd88('0xb')]);ChatInteractionEvents[_0xdd88('0xc')](_0x57ef90+':'+_0x35b23f['id'],_0x35b23f);ChatInteractionEvents[_0xdd88('0xc')](_0x57ef90,_0x35b23f);_0x4ed10b(null);})[_0xdd88('0xd')](_0x4ed10b(null));};}for(var e in events){if(events[_0xdd88('0xe')](e)){var event=events[e];ChatInteraction[_0xdd88('0xf')](e,emitEvent(event));}}module[_0xdd88('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x4dd2=['ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction'];(function(_0x5daf84,_0x2b082b){var _0x35b5ed=function(_0x326df9){while(--_0x326df9){_0x5daf84['push'](_0x5daf84['shift']());}};_0x35b5ed(++_0x2b082b);}(_0x4dd2,0x89));var _0x24dd=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0x4dd2[_0x20e7e3];return _0x14b9de;};'use strict';var EventEmitter=require(_0x24dd('0x0'));var ChatInteraction=require(_0x24dd('0x1'))['db'][_0x24dd('0x2')];var ChatMessage=require(_0x24dd('0x1'))['db'][_0x24dd('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x24dd('0x4')](0x0);var events={'afterCreate':_0x24dd('0x5'),'afterUpdate':_0x24dd('0x6'),'afterDestroy':_0x24dd('0x7')};function emitEvent(_0x2b73e0){return function(_0x73ed1e,_0x2eb483,_0x233b0a){_0x73ed1e[_0x24dd('0x8')]({'attributes':['id'],'raw':!![]})[_0x24dd('0x9')](function(_0x55107f){_0x73ed1e[_0x24dd('0xa')](_0x24dd('0xb'),_0x55107f[_0x24dd('0xc')](function(_0x1a8c4e){return{'id':_0x1a8c4e['id']};}));return ChatMessage[_0x24dd('0xd')]({'where':{'ChatInteractionId':_0x73ed1e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x24dd('0x9')](function(_0x2fb356){_0x73ed1e['setDataValue'](_0x24dd('0xe'),_0x2fb356['length']);ChatInteractionEvents[_0x24dd('0xf')](_0x2b73e0+':'+_0x73ed1e['id'],_0x73ed1e);ChatInteractionEvents[_0x24dd('0xf')](_0x2b73e0,_0x73ed1e);_0x233b0a(null);})[_0x24dd('0x10')](_0x233b0a(null));};}for(var e in events){if(events[_0x24dd('0x11')](e)){var event=events[e];ChatInteraction[_0x24dd('0x12')](e,emitEvent(event));}}module[_0x24dd('0x13')]=ChatInteractionEvents;
\ No newline at end of file
index ecb64a9..5d38f85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf5a=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x1a3e1f,_0x49cb17){var _0x34f415=function(_0x3b3a93){while(--_0x3b3a93){_0x1a3e1f['push'](_0x1a3e1f['shift']());}};_0x34f415(++_0x49cb17);}(_0xbf5a,0xf8));var _0xabf5=function(_0x7723c9,_0xbeb6b3){_0x7723c9=_0x7723c9-0x0;var _0x1e63be=_0xbf5a[_0x7723c9];return _0x1e63be;};'use strict';var _=require(_0xabf5('0x0'));var util=require(_0xabf5('0x1'));var logger=require(_0xabf5('0x2'))(_0xabf5('0x3'));var moment=require(_0xabf5('0x4'));var BPromise=require(_0xabf5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabf5('0x6'));var rimraf=require(_0xabf5('0x7'));var config=require(_0xabf5('0x8'));var attributes=require(_0xabf5('0x9'));module[_0xabf5('0xa')]=function(_0x1e5c47,_0x2a39f3){return _0x1e5c47[_0xabf5('0xb')](_0xabf5('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x598be1,_0x477b87,_0x11fbb0){if(_0x598be1[_0xabf5('0xd')](_0xabf5('0xe'))){_0x598be1['closedAt']=moment()[_0xabf5('0xf')](_0xabf5('0x10'));}_0x11fbb0(null,_0x598be1);}},'charset':_0xabf5('0x11'),'collate':_0xabf5('0x12')});};
\ No newline at end of file
+var _0xb7ec=['chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','rimraf','exports','define','ChatInteraction'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xb7ec,0x1d7));var _0xcb7e=function(_0x4bea7a,_0x2cd929){_0x4bea7a=_0x4bea7a-0x0;var _0x3907df=_0xb7ec[_0x4bea7a];return _0x3907df;};'use strict';var _=require(_0xcb7e('0x0'));var util=require(_0xcb7e('0x1'));var logger=require(_0xcb7e('0x2'))('api');var moment=require(_0xcb7e('0x3'));var BPromise=require(_0xcb7e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcb7e('0x5'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0xcb7e('0x6')]=function(_0x165333,_0x25b135){return _0x165333[_0xcb7e('0x7')](_0xcb7e('0x8'),attributes,{'tableName':_0xcb7e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d9b11,_0x209502,_0x376344){if(_0x3d9b11[_0xcb7e('0xa')](_0xcb7e('0xb'))){_0x3d9b11[_0xcb7e('0xc')]=moment()[_0xcb7e('0xd')](_0xcb7e('0xe'));}_0x376344(null,_0x3d9b11);}},'charset':'utf8mb4','collate':_0xcb7e('0xf')});};
\ No newline at end of file
index 2667c26..080dddf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2136=['socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','ChatInteraction','options','raw','where','UpdateChatInteraction','catch','AddTagsToChatInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x31aa73,_0x41d911){var _0x4bb8e3=function(_0x4482a5){while(--_0x4482a5){_0x31aa73['push'](_0x31aa73['shift']());}};_0x4bb8e3(++_0x41d911);}(_0x2136,0x178));var _0x6213=function(_0x26bfb0,_0x5b0ffc){_0x26bfb0=_0x26bfb0-0x0;var _0x4454b3=_0x2136[_0x26bfb0];return _0x4454b3;};'use strict';var _=require(_0x6213('0x0'));var util=require(_0x6213('0x1'));var moment=require('moment');var BPromise=require(_0x6213('0x2'));var rs=require(_0x6213('0x3'));var fs=require('fs');var Redis=require(_0x6213('0x4'));var db=require(_0x6213('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6213('0x6'))(_0x6213('0x7'));var config=require(_0x6213('0x8'));var jayson=require(_0x6213('0x9'));var client=jayson[_0x6213('0xa')][_0x6213('0xb')]({'port':0x232a});config[_0x6213('0xc')]=_['defaults'](config[_0x6213('0xc')],{'host':_0x6213('0xd'),'port':0x18eb});var socket=require(_0x6213('0xe'))(new Redis(config[_0x6213('0xc')]));require(_0x6213('0xf'))[_0x6213('0x10')](socket);function respondWithRpcPromise(_0x354a12,_0x1344c8,_0x2c4821){return new BPromise(function(_0x341f40,_0x55b53c){return client[_0x6213('0x11')](_0x354a12,_0x2c4821)[_0x6213('0x12')](function(_0x34e5ba){logger[_0x6213('0x13')](_0x6213('0x14'),_0x1344c8,'request\x20sent');logger[_0x6213('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1344c8,_0x6213('0x16'),JSON[_0x6213('0x17')](_0x34e5ba));if(_0x34e5ba[_0x6213('0x18')]){if(_0x34e5ba[_0x6213('0x18')]['code']===0x1f4){logger[_0x6213('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x1344c8,_0x34e5ba[_0x6213('0x18')][_0x6213('0x19')]);return _0x55b53c(_0x34e5ba[_0x6213('0x18')]['message']);}logger[_0x6213('0x18')](_0x6213('0x14'),_0x1344c8,_0x34e5ba[_0x6213('0x18')][_0x6213('0x19')]);return _0x341f40(_0x34e5ba['error']['message']);}else{logger[_0x6213('0x13')](_0x6213('0x14'),_0x1344c8,_0x6213('0x16'));_0x341f40(_0x34e5ba['result'][_0x6213('0x19')]);}})['catch'](function(_0xcdf02d){logger['error'](_0x6213('0x14'),_0x1344c8,_0xcdf02d);_0x55b53c(_0xcdf02d);});});}exports['UpdateChatInteraction']=function(_0x54aaa5){var _0x5b6669=this;return new Promise(function(_0x5ea313,_0x9d6e3){return db[_0x6213('0x1a')]['update'](_0x54aaa5['body'],{'raw':_0x54aaa5[_0x6213('0x1b')]?_0x54aaa5[_0x6213('0x1b')][_0x6213('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54aaa5[_0x6213('0x1b')]?_0x54aaa5[_0x6213('0x1b')][_0x6213('0x1d')]||null:null,'attributes':_0x54aaa5[_0x6213('0x1b')]?_0x54aaa5[_0x6213('0x1b')]['attributes']||null:null,'limit':_0x54aaa5['options']?_0x54aaa5[_0x6213('0x1b')]['limit']||null:null})[_0x6213('0x12')](function(_0x24706b){logger[_0x6213('0x13')]('UpdateChatInteraction',_0x54aaa5);logger[_0x6213('0x15')](_0x6213('0x1e'),_0x54aaa5,JSON[_0x6213('0x17')](_0x24706b));_0x5ea313(_0x24706b);})[_0x6213('0x1f')](function(_0x10e397){logger[_0x6213('0x18')](_0x6213('0x1e'),_0x10e397[_0x6213('0x19')],_0x54aaa5);_0x9d6e3(_0x5b6669[_0x6213('0x18')](0x1f4,_0x10e397['message']));});});};exports[_0x6213('0x20')]=function(_0x2ece43){return new Promise(function(_0x1e6c43,_0x400721){return db[_0x6213('0x1a')]['find']({'where':_0x2ece43[_0x6213('0x1b')]?_0x2ece43['options']['where']||null:null})[_0x6213('0x12')](function(_0x1b1df3){if(_0x1b1df3){return _0x1b1df3[_0x6213('0x21')](_0x2ece43[_0x6213('0x22')][_0x6213('0x23')],_[_0x6213('0x24')](_0x2ece43[_0x6213('0x22')],['ids','id'])||{});}})[_0x6213('0x25')](function(_0x32bece){logger[_0x6213('0x13')](_0x6213('0x26'),_0x2ece43);logger[_0x6213('0x15')]('AddTags',_0x2ece43,JSON[_0x6213('0x17')](_0x32bece));_0x1e6c43(_0x32bece);})[_0x6213('0x1f')](function(_0x116da3){logger['error']('AddTags',_0x116da3['message'],_0x2ece43);_0x400721(_this[_0x6213('0x18')](0x1f4,_0x116da3[_0x6213('0x19')]));});});};
\ No newline at end of file
+var _0x7c4c=['AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','UpdateChatInteraction','body','options','attributes','limit','catch','ChatInteraction','where','ids','omit','spread'];(function(_0x48b88f,_0x2e1e94){var _0x34d441=function(_0x4eeea2){while(--_0x4eeea2){_0x48b88f['push'](_0x48b88f['shift']());}};_0x34d441(++_0x2e1e94);}(_0x7c4c,0x141));var _0xc7c4=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7c4c[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xc7c4('0x0'));var util=require(_0xc7c4('0x1'));var moment=require(_0xc7c4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc7c4('0x3'));var db=require(_0xc7c4('0x4'))['db'];var utils=require(_0xc7c4('0x5'));var logger=require('../../config/logger')(_0xc7c4('0x6'));var config=require(_0xc7c4('0x7'));var jayson=require(_0xc7c4('0x8'));var client=jayson[_0xc7c4('0x9')][_0xc7c4('0xa')]({'port':0x232a});config[_0xc7c4('0xb')]=_[_0xc7c4('0xc')](config[_0xc7c4('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc7c4('0xd'))(new Redis(config[_0xc7c4('0xb')]));require(_0xc7c4('0xe'))[_0xc7c4('0xf')](socket);function respondWithRpcPromise(_0x35519d,_0x2277b6,_0x2d87ab){return new BPromise(function(_0x534894,_0x499611){return client[_0xc7c4('0x10')](_0x35519d,_0x2d87ab)[_0xc7c4('0x11')](function(_0x370132){logger[_0xc7c4('0x12')](_0xc7c4('0x13'),_0x2277b6,_0xc7c4('0x14'));logger[_0xc7c4('0x15')](_0xc7c4('0x16'),_0x2277b6,_0xc7c4('0x14'),JSON[_0xc7c4('0x17')](_0x370132));if(_0x370132['error']){if(_0x370132['error'][_0xc7c4('0x18')]===0x1f4){logger[_0xc7c4('0x19')](_0xc7c4('0x13'),_0x2277b6,_0x370132[_0xc7c4('0x19')]['message']);return _0x499611(_0x370132[_0xc7c4('0x19')][_0xc7c4('0x1a')]);}logger[_0xc7c4('0x19')](_0xc7c4('0x13'),_0x2277b6,_0x370132[_0xc7c4('0x19')][_0xc7c4('0x1a')]);return _0x534894(_0x370132[_0xc7c4('0x19')][_0xc7c4('0x1a')]);}else{logger[_0xc7c4('0x12')](_0xc7c4('0x13'),_0x2277b6,_0xc7c4('0x14'));_0x534894(_0x370132[_0xc7c4('0x1b')]['message']);}})['catch'](function(_0x4bbc1c){logger['error'](_0xc7c4('0x13'),_0x2277b6,_0x4bbc1c);_0x499611(_0x4bbc1c);});});}exports[_0xc7c4('0x1c')]=function(_0x484d3c){var _0x3eaa02=this;return new Promise(function(_0x21f177,_0x5ae8f4){return db['ChatInteraction']['update'](_0x484d3c[_0xc7c4('0x1d')],{'raw':_0x484d3c['options']?_0x484d3c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x484d3c[_0xc7c4('0x1e')]?_0x484d3c['options']['where']||null:null,'attributes':_0x484d3c[_0xc7c4('0x1e')]?_0x484d3c['options'][_0xc7c4('0x1f')]||null:null,'limit':_0x484d3c[_0xc7c4('0x1e')]?_0x484d3c[_0xc7c4('0x1e')][_0xc7c4('0x20')]||null:null})[_0xc7c4('0x11')](function(_0x5d26f9){logger[_0xc7c4('0x12')](_0xc7c4('0x1c'),_0x484d3c);logger[_0xc7c4('0x15')](_0xc7c4('0x1c'),_0x484d3c,JSON[_0xc7c4('0x17')](_0x5d26f9));_0x21f177(_0x5d26f9);})[_0xc7c4('0x21')](function(_0x1c515b){logger[_0xc7c4('0x19')](_0xc7c4('0x1c'),_0x1c515b[_0xc7c4('0x1a')],_0x484d3c);_0x5ae8f4(_0x3eaa02[_0xc7c4('0x19')](0x1f4,_0x1c515b['message']));});});};exports['AddTagsToChatInteraction']=function(_0x25ddcc){return new Promise(function(_0x543840,_0x416613){return db[_0xc7c4('0x22')]['find']({'where':_0x25ddcc['options']?_0x25ddcc[_0xc7c4('0x1e')][_0xc7c4('0x23')]||null:null})[_0xc7c4('0x11')](function(_0x205152){if(_0x205152){return _0x205152['addTags'](_0x25ddcc[_0xc7c4('0x1d')][_0xc7c4('0x24')],_[_0xc7c4('0x25')](_0x25ddcc[_0xc7c4('0x1d')],[_0xc7c4('0x24'),'id'])||{});}})[_0xc7c4('0x26')](function(_0x25f8c1){logger['info'](_0xc7c4('0x27'),_0x25ddcc);logger['debug'](_0xc7c4('0x27'),_0x25ddcc,JSON[_0xc7c4('0x17')](_0x25f8c1));_0x543840(_0x25f8c1);})['catch'](function(_0x4d991f){logger['error'](_0xc7c4('0x27'),_0x4d991f[_0xc7c4('0x1a')],_0x25ddcc);_0x416613(_this[_0xc7c4('0x19')](0x1f4,_0x4d991f[_0xc7c4('0x1a')]));});});};
\ No newline at end of file
index ee329a2..75b8710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c71=['save','remove','emit','removeListener','register','length','./chatInteraction.events'];(function(_0x209213,_0x16a917){var _0xd194c0=function(_0x14256c){while(--_0x14256c){_0x209213['push'](_0x209213['shift']());}};_0xd194c0(++_0x16a917);}(_0x6c71,0x1e2));var _0x16c7=function(_0x15a914,_0x31d01){_0x15a914=_0x15a914-0x0;var _0x17cffc=_0x6c71[_0x15a914];return _0x17cffc;};'use strict';var ChatInteractionEvents=require(_0x16c7('0x0'));var events=[_0x16c7('0x1'),_0x16c7('0x2'),'update'];function createListener(_0x5d308e,_0x4599bd){return function(_0x332335){_0x4599bd[_0x16c7('0x3')](_0x5d308e,_0x332335);};}function removeListener(_0xbdfe25,_0x1ddd68){return function(){ChatInteractionEvents[_0x16c7('0x4')](_0xbdfe25,_0x1ddd68);};}exports[_0x16c7('0x5')]=function(_0x3fe6c9){for(var _0x538ea2=0x0,_0x31c705=events[_0x16c7('0x6')];_0x538ea2<_0x31c705;_0x538ea2++){var _0x6fb6af=events[_0x538ea2];var _0x3e8c3a=createListener('chatInteraction:'+_0x6fb6af,_0x3fe6c9);ChatInteractionEvents['on'](_0x6fb6af,_0x3e8c3a);}};
\ No newline at end of file
+var _0xb45f=['./chatInteraction.events','save','remove','update','emit','register','length','chatInteraction:'];(function(_0x20f002,_0x164d11){var _0x37e4e8=function(_0x1d3579){while(--_0x1d3579){_0x20f002['push'](_0x20f002['shift']());}};_0x37e4e8(++_0x164d11);}(_0xb45f,0x1b0));var _0xfb45=function(_0x34632f,_0x4114fb){_0x34632f=_0x34632f-0x0;var _0x2c7dfb=_0xb45f[_0x34632f];return _0x2c7dfb;};'use strict';var ChatInteractionEvents=require(_0xfb45('0x0'));var events=[_0xfb45('0x1'),_0xfb45('0x2'),_0xfb45('0x3')];function createListener(_0x26ab84,_0xa86c61){return function(_0x2dee95){_0xa86c61[_0xfb45('0x4')](_0x26ab84,_0x2dee95);};}function removeListener(_0x3ba178,_0x3fdd59){return function(){ChatInteractionEvents['removeListener'](_0x3ba178,_0x3fdd59);};}exports[_0xfb45('0x5')]=function(_0x362898){for(var _0x29d64b=0x0,_0x3c2ba6=events[_0xfb45('0x6')];_0x29d64b<_0x3c2ba6;_0x29d64b++){var _0x57a0e9=events[_0x29d64b];var _0x39f649=createListener(_0xfb45('0x7')+_0x57a0e9,_0x362898);ChatInteractionEvents['on'](_0x57a0e9,_0x39f649);}};
\ No newline at end of file
index 64fe415..4d02cb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9618=['/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','originalname','/:id/attachment_upload','attachmentUpload','isChatInteractionAuthorized','/:id/tags','tracked','chatinteraction:addtags','put','/:id','chat','chatinteraction:update','update','customUpdate'];(function(_0x4f5670,_0x3ef7e4){var _0x5a7277=function(_0x1de56f){while(--_0x1de56f){_0x4f5670['push'](_0x4f5670['shift']());}};_0x5a7277(++_0x3ef7e4);}(_0x9618,0x71));var _0x8961=function(_0x4241b8,_0x5eb5aa){_0x4241b8=_0x4241b8-0x0;var _0x213692=_0x9618[_0x4241b8];return _0x213692;};'use strict';var multer=require(_0x8961('0x0'));var util=require(_0x8961('0x1'));var path=require(_0x8961('0x2'));var timeout=require(_0x8961('0x3'));var express=require(_0x8961('0x4'));var router=express[_0x8961('0x5')]();var fs_extra=require(_0x8961('0x6'));var auth=require(_0x8961('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8961('0x8'));var controller=require(_0x8961('0x9'));router[_0x8961('0xa')]('/',auth[_0x8961('0xb')](),controller[_0x8961('0xc')]);router[_0x8961('0xa')](_0x8961('0xd'),auth[_0x8961('0xb')](),controller[_0x8961('0xe')]);router[_0x8961('0xa')]('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router[_0x8961('0xa')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x8961('0xf')]);router[_0x8961('0xa')](_0x8961('0x10'),auth[_0x8961('0xb')](),controller[_0x8961('0x11')]);router[_0x8961('0xa')](_0x8961('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x8961('0x13')]);router['get'](_0x8961('0x14'),auth[_0x8961('0xb')](),controller[_0x8961('0x15')]);router[_0x8961('0x16')]('/',auth[_0x8961('0xb')](),controller[_0x8961('0x17')]);router[_0x8961('0x16')](_0x8961('0x18'),auth[_0x8961('0xb')](),controller[_0x8961('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x40ac51,_0x2f800b,_0x294ff9){_0x294ff9(null,path[_0x8961('0x1a')](config[_0x8961('0x1b')],_0x8961('0x1c')));},'filename':function(_0x5142c1,_0x22d1d9,_0x2cb4bf){_0x2cb4bf(null,util[_0x8961('0x1d')]('%s-%s',Date['now'](),_0x22d1d9[_0x8961('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8961('0x16')](_0x8961('0x1f'),upload['single']('file'),controller[_0x8961('0x20')]);router[_0x8961('0x16')](_0x8961('0x10'),auth[_0x8961('0x21')](),controller['addMessage']);router[_0x8961('0x16')](_0x8961('0x22'),auth[_0x8961('0xb')](),interaction[_0x8961('0x23')]('chat',_0x8961('0x24')),controller['addTags']);router[_0x8961('0x25')](_0x8961('0x26'),auth[_0x8961('0xb')](),interaction[_0x8961('0x23')](_0x8961('0x27'),_0x8961('0x28')),controller[_0x8961('0x29')]);router[_0x8961('0x25')]('/:id/custom_update',controller[_0x8961('0x2a')]);router[_0x8961('0x25')](_0x8961('0x2b'),auth[_0x8961('0x21')](),controller[_0x8961('0x2c')]);router['put'](_0x8961('0x2d'),controller[_0x8961('0x2e')]);router[_0x8961('0x2f')](_0x8961('0x26'),auth[_0x8961('0xb')](),interaction[_0x8961('0x23')](_0x8961('0x27'),_0x8961('0x30')),controller[_0x8961('0x31')]);router[_0x8961('0x2f')](_0x8961('0x22'),auth[_0x8961('0xb')](),controller[_0x8961('0x32')]);module[_0x8961('0x33')]=router;
\ No newline at end of file
+var _0xf7be=['../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','isAuthenticated','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xf7be,0x15a));var _0xef7b=function(_0x930f73,_0xfe73ea){_0x930f73=_0x930f73-0x0;var _0x47762f=_0xf7be[_0x930f73];return _0x47762f;};'use strict';var multer=require(_0xef7b('0x0'));var util=require(_0xef7b('0x1'));var path=require(_0xef7b('0x2'));var timeout=require(_0xef7b('0x3'));var express=require(_0xef7b('0x4'));var router=express[_0xef7b('0x5')]();var fs_extra=require(_0xef7b('0x6'));var auth=require(_0xef7b('0x7'));var interaction=require(_0xef7b('0x8'));var config=require(_0xef7b('0x9'));var controller=require(_0xef7b('0xa'));router[_0xef7b('0xb')]('/',auth['isAuthenticated'](),controller[_0xef7b('0xc')]);router[_0xef7b('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xef7b('0xd')]);router[_0xef7b('0xb')](_0xef7b('0xe'),auth[_0xef7b('0xf')](),controller[_0xef7b('0x10')]);router['get'](_0xef7b('0x11'),auth[_0xef7b('0xf')](),controller[_0xef7b('0x12')]);router[_0xef7b('0xb')](_0xef7b('0x13'),auth['isAuthenticated'](),controller[_0xef7b('0x14')]);router[_0xef7b('0xb')](_0xef7b('0x15'),auth[_0xef7b('0xf')](),controller[_0xef7b('0x16')]);router['get'](_0xef7b('0x17'),auth[_0xef7b('0x18')](),controller[_0xef7b('0x19')]);router['post']('/',auth[_0xef7b('0x18')](),controller[_0xef7b('0x1a')]);router[_0xef7b('0x1b')](_0xef7b('0x1c'),auth[_0xef7b('0x18')](),controller[_0xef7b('0x1d')]);var upload=multer({'storage':multer[_0xef7b('0x1e')]({'destination':function(_0x27c4c3,_0x43e150,_0x30dfc6){_0x30dfc6(null,path['join'](config[_0xef7b('0x1f')],'server/files/attachments/'));},'filename':function(_0x523863,_0x50e5a7,_0x74d0e6){_0x74d0e6(null,util[_0xef7b('0x20')](_0xef7b('0x21'),Date[_0xef7b('0x22')](),_0x50e5a7[_0xef7b('0x23')][_0xef7b('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xef7b('0x25'),upload[_0xef7b('0x26')]('file'),controller['attachmentUpload']);router[_0xef7b('0x1b')](_0xef7b('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xef7b('0x27')]);router[_0xef7b('0x1b')](_0xef7b('0x28'),auth['isAuthenticated'](),interaction['tracked']('chat',_0xef7b('0x29')),controller[_0xef7b('0x2a')]);router[_0xef7b('0x2b')](_0xef7b('0xe'),auth[_0xef7b('0x18')](),interaction[_0xef7b('0x2c')](_0xef7b('0x2d'),_0xef7b('0x2e')),controller[_0xef7b('0x2f')]);router[_0xef7b('0x2b')](_0xef7b('0x30'),controller[_0xef7b('0x31')]);router['put'](_0xef7b('0x32'),auth['isChatInteractionAuthorized'](),controller[_0xef7b('0x33')]);router['put'](_0xef7b('0x34'),controller[_0xef7b('0x35')]);router[_0xef7b('0x36')](_0xef7b('0xe'),auth[_0xef7b('0x18')](),interaction['tracked']('chat',_0xef7b('0x37')),controller[_0xef7b('0x38')]);router[_0xef7b('0x36')](_0xef7b('0x28'),auth['isAuthenticated'](),controller[_0xef7b('0x39')]);module[_0xef7b('0x3a')]=router;
\ No newline at end of file
index 3863472..dfc8f15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e65=['medium','INTEGER','sequelize','exports'];(function(_0x2ad98e,_0x4ca72a){var _0x18e5ee=function(_0x5eaa1e){while(--_0x5eaa1e){_0x2ad98e['push'](_0x2ad98e['shift']());}};_0x18e5ee(++_0x4ca72a);}(_0x1e65,0xbe));var _0x51e6=function(_0x40f31d,_0x166318){_0x40f31d=_0x40f31d-0x0;var _0x10d4e4=_0x1e65[_0x40f31d];return _0x10d4e4;};'use strict';var Sequelize=require(_0x51e6('0x0'));module[_0x51e6('0x1')]={'body':{'type':Sequelize['TEXT'](_0x51e6('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x51e6('0x3')]}};
\ No newline at end of file
+var _0xa5e4=['INTEGER','exports','TEXT','BOOLEAN'];(function(_0x2f8e00,_0x45a166){var _0x4a57cc=function(_0x2bd76f){while(--_0x2bd76f){_0x2f8e00['push'](_0x2f8e00['shift']());}};_0x4a57cc(++_0x45a166);}(_0xa5e4,0x15d));var _0x4a5e=function(_0x4738ff,_0x15e384){_0x4738ff=_0x4738ff-0x0;var _0x534283=_0xa5e4[_0x4738ff];return _0x534283;};'use strict';var Sequelize=require('sequelize');module[_0x4a5e('0x0')]={'body':{'type':Sequelize[_0x4a5e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4a5e('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4a5e('0x3')]}};
\ No newline at end of file
index 46a6c76..6c848dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27a4=['./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','userpic','internal','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','UserProfileResource','findAll','role','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x5ed327,_0x201b73){var _0x4114c1=function(_0x2c3c7c){while(--_0x2c3c7c){_0x5ed327['push'](_0x5ed327['shift']());}};_0x4114c1(++_0x201b73);}(_0x27a4,0x1a9));var _0x427a=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x27a4[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0x427a('0x0'));var rimraf=require(_0x427a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x427a('0x2'));var moment=require(_0x427a('0x3'));var BPromise=require(_0x427a('0x4'));var Mustache=require(_0x427a('0x5'));var util=require(_0x427a('0x6'));var path=require(_0x427a('0x7'));var sox=require(_0x427a('0x8'));var csv=require(_0x427a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x427a('0xa'));var _=require(_0x427a('0xb'));var squel=require(_0x427a('0xc'));var crypto=require(_0x427a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x427a('0xe'));var toCsv=require(_0x427a('0x9'));var querystring=require('querystring');var Papa=require(_0x427a('0xf'));var Redis=require(_0x427a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x427a('0x11'));var as=require(_0x427a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x427a('0x13'));var utils=require(_0x427a('0x14'));var config=require(_0x427a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x427a('0x16'))['db'];config[_0x427a('0x17')]=_[_0x427a('0x18')](config[_0x427a('0x17')],{'host':_0x427a('0x19'),'port':0x18eb});var socket=require(_0x427a('0x1a'))(new Redis(config[_0x427a('0x17')]));require(_0x427a('0x1b'))[_0x427a('0x1c')](socket);function respondWithStatusCode(_0x18669e,_0x8195f9){_0x8195f9=_0x8195f9||0xcc;return function(_0x314124){if(_0x314124){return _0x18669e[_0x427a('0x1d')](_0x8195f9);}return _0x18669e[_0x427a('0x1e')](_0x8195f9)[_0x427a('0x1f')]();};}function respondWithResult(_0x142670,_0x476653){_0x476653=_0x476653||0xc8;return function(_0xa90cfd){if(_0xa90cfd){return _0x142670[_0x427a('0x1e')](_0x476653)[_0x427a('0x20')](_0xa90cfd);}};}function respondWithFilteredResult(_0x5b4e7c,_0x574722){return function(_0x19bccd){if(_0x19bccd){var _0x7a5964=typeof _0x574722[_0x427a('0x21')]===_0x427a('0x22')&&typeof _0x574722[_0x427a('0x23')]===_0x427a('0x22');var _0x3fda7b=_0x19bccd[_0x427a('0x24')];var _0x3f43fb=_0x7a5964?0x0:_0x574722[_0x427a('0x21')];var _0x118335=_0x7a5964?_0x19bccd[_0x427a('0x24')]:_0x574722['offset']+_0x574722[_0x427a('0x23')];var _0x515372;if(_0x118335>=_0x3fda7b){_0x118335=_0x3fda7b;_0x515372=0xc8;}else{_0x515372=0xce;}_0x5b4e7c['status'](_0x515372);return _0x5b4e7c[_0x427a('0x25')](_0x427a('0x26'),_0x3f43fb+'-'+_0x118335+'/'+_0x3fda7b)['json'](_0x19bccd);}return null;};}function patchUpdates(_0x4c45c5){return function(_0x974769){try{jsonpatch[_0x427a('0x27')](_0x974769,_0x4c45c5,!![]);}catch(_0x45ee39){return BPromise[_0x427a('0x28')](_0x45ee39);}return _0x974769[_0x427a('0x29')]();};}function saveUpdates(_0x47235e,_0x20e555){return function(_0x31a3bd){if(_0x31a3bd){return _0x31a3bd[_0x427a('0x2a')](_0x47235e)[_0x427a('0x2b')](function(_0x4edbc7){return _0x4edbc7;});}return null;};}function removeEntity(_0x17fb22,_0x338900){return function(_0xce70c8){if(_0xce70c8){return _0xce70c8[_0x427a('0x2c')]()[_0x427a('0x2b')](function(){_0x17fb22[_0x427a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b43a,_0xb47989){return function(_0x69ed1d){if(!_0x69ed1d){_0x59b43a['sendStatus'](0x194);}return _0x69ed1d;};}function handleError(_0xf35cca,_0x475583){_0x475583=_0x475583||0x1f4;return function(_0x1540b2){logger['error'](_0x1540b2[_0x427a('0x2d')]);if(_0x1540b2['name']){delete _0x1540b2[_0x427a('0x2e')];}_0xf35cca['status'](_0x475583)[_0x427a('0x2f')](_0x1540b2);};}exports[_0x427a('0x30')]=function(_0x1d936a,_0x163d82){var _0x3ec360={},_0x46be12={},_0x417212={'count':0x0,'rows':[]};var _0x57d563=_['map'](db[_0x427a('0x31')][_0x427a('0x32')],function(_0x2afae3){return{'name':_0x2afae3[_0x427a('0x33')],'type':_0x2afae3[_0x427a('0x34')]['key']};});_0x46be12[_0x427a('0x35')]=_[_0x427a('0x36')](_0x57d563,_0x427a('0x2e'));_0x46be12[_0x427a('0x37')]=_[_0x427a('0x38')](_0x1d936a[_0x427a('0x37')]);_0x46be12['filters']=_[_0x427a('0x39')](_0x46be12['model'],_0x46be12[_0x427a('0x37')]);_0x3ec360['attributes']=_[_0x427a('0x39')](_0x46be12[_0x427a('0x35')],qs[_0x427a('0x3a')](_0x1d936a[_0x427a('0x37')][_0x427a('0x3a')]));_0x3ec360[_0x427a('0x3b')]=_0x3ec360[_0x427a('0x3b')][_0x427a('0x3c')]?_0x3ec360[_0x427a('0x3b')]:_0x46be12[_0x427a('0x35')];if(!_0x1d936a[_0x427a('0x37')][_0x427a('0x3d')](_0x427a('0x3e'))){_0x3ec360['limit']=qs[_0x427a('0x23')](_0x1d936a[_0x427a('0x37')][_0x427a('0x23')]);_0x3ec360['offset']=qs[_0x427a('0x21')](_0x1d936a[_0x427a('0x37')][_0x427a('0x21')]);}_0x3ec360[_0x427a('0x3f')]=qs['sort'](_0x1d936a[_0x427a('0x37')][_0x427a('0x40')]);_0x3ec360[_0x427a('0x41')]=qs['filters'](_[_0x427a('0x42')](_0x1d936a[_0x427a('0x37')],_0x46be12[_0x427a('0x43')]),_0x57d563);if(_0x1d936a[_0x427a('0x37')][_0x427a('0x44')]){_0x3ec360['where']=_[_0x427a('0x45')](_0x3ec360[_0x427a('0x41')],{'$or':_[_0x427a('0x36')](_0x57d563,function(_0x591fad){if(_0x591fad['type']!=='VIRTUAL'){var _0x2c075d={};_0x2c075d[_0x591fad[_0x427a('0x2e')]]={'$like':'%'+_0x1d936a[_0x427a('0x37')][_0x427a('0x44')]+'%'};return _0x2c075d;}})});}_0x3ec360=_['merge']({},_0x3ec360,_0x1d936a[_0x427a('0x46')]);var _0x33e634={'where':_0x3ec360[_0x427a('0x41')]};return db[_0x427a('0x31')][_0x427a('0x24')](_0x33e634)[_0x427a('0x2b')](function(_0x102951){_0x417212['count']=_0x102951;if(_0x1d936a[_0x427a('0x37')][_0x427a('0x47')]){_0x3ec360[_0x427a('0x48')]=[{'all':!![]}];}return db[_0x427a('0x31')]['findAll'](_0x3ec360);})[_0x427a('0x2b')](function(_0x24e6d1){_0x417212[_0x427a('0x49')]=_0x24e6d1;return _0x417212;})[_0x427a('0x2b')](respondWithFilteredResult(_0x163d82,_0x3ec360))[_0x427a('0x4a')](handleError(_0x163d82,null));};exports[_0x427a('0x4b')]=function(_0x177245,_0x3113ac){var _0x5a64e3={'raw':!![],'where':{'id':_0x177245[_0x427a('0x4c')]['id']}},_0x50d1cf={};_0x50d1cf[_0x427a('0x35')]=_[_0x427a('0x38')](db['ChatInternalMessage'][_0x427a('0x32')]);_0x50d1cf[_0x427a('0x37')]=_[_0x427a('0x38')](_0x177245[_0x427a('0x37')]);_0x50d1cf['filters']=_[_0x427a('0x39')](_0x50d1cf[_0x427a('0x35')],_0x50d1cf[_0x427a('0x37')]);_0x5a64e3[_0x427a('0x3b')]=_['intersection'](_0x50d1cf[_0x427a('0x35')],qs[_0x427a('0x3a')](_0x177245[_0x427a('0x37')]['fields']));_0x5a64e3['attributes']=_0x5a64e3[_0x427a('0x3b')][_0x427a('0x3c')]?_0x5a64e3[_0x427a('0x3b')]:_0x50d1cf[_0x427a('0x35')];if(_0x177245[_0x427a('0x37')][_0x427a('0x47')]){_0x5a64e3[_0x427a('0x48')]=[{'all':!![]}];}_0x5a64e3=_[_0x427a('0x45')]({},_0x5a64e3,_0x177245[_0x427a('0x46')]);return db['ChatInternalMessage'][_0x427a('0x4d')](_0x5a64e3)[_0x427a('0x2b')](handleEntityNotFound(_0x3113ac,null))[_0x427a('0x2b')](respondWithResult(_0x3113ac,null))[_0x427a('0x4a')](handleError(_0x3113ac,null));};exports[_0x427a('0x4e')]=function(_0x194a9f,_0x18b0fb){return db[_0x427a('0x31')][_0x427a('0x4e')](_0x194a9f['body'],{})[_0x427a('0x2b')](respondWithResult(_0x18b0fb,0xc9))[_0x427a('0x4a')](handleError(_0x18b0fb,null));};exports[_0x427a('0x2a')]=function(_0x3a1652,_0x4a210e){if(_0x3a1652[_0x427a('0x4f')]['id']){delete _0x3a1652[_0x427a('0x4f')]['id'];}return db[_0x427a('0x31')][_0x427a('0x4d')]({'where':{'id':_0x3a1652['params']['id']}})[_0x427a('0x2b')](handleEntityNotFound(_0x4a210e,null))['then'](saveUpdates(_0x3a1652[_0x427a('0x4f')],null))[_0x427a('0x2b')](respondWithResult(_0x4a210e,null))[_0x427a('0x4a')](handleError(_0x4a210e,null));};exports[_0x427a('0x2c')]=function(_0x8b482e,_0x5af442){return db['ChatInternalMessage'][_0x427a('0x4d')]({'where':{'id':_0x8b482e[_0x427a('0x4c')]['id']}})[_0x427a('0x2b')](handleEntityNotFound(_0x5af442,null))['then'](removeEntity(_0x5af442,null))[_0x427a('0x4a')](handleError(_0x5af442,null));};exports[_0x427a('0x50')]=function(_0x191992,_0x521525){return db['ChatInternalMessage'][_0x427a('0x50')]()['then'](respondWithResult(_0x521525,null))[_0x427a('0x4a')](handleError(_0x521525,null));};function wrapUser(_0x4526d5){return function(_0x25b3a0){var _0x120efb=_0x4526d5[_0x427a('0x51')]({'plain':!![]});_0x120efb[_0x427a('0x52')]=[];if(_0x25b3a0){_0x120efb[_0x427a('0x53')]=_0x25b3a0[_0x427a('0x54')];_0x120efb['lastMessage']=_0x25b3a0;}else{_0x120efb[_0x427a('0x53')]=moment(0x0)[_0x427a('0x55')](_0x427a('0x56'));_0x120efb['lastMessage']={};}return _0x120efb;};}exports[_0x427a('0x57')]=function(_0x7333f4,_0x4ab311,_0x817401){var _0x1927f1=[];return db[_0x427a('0x58')]['findAll']({'where':{'role':['agent',_0x427a('0x59'),_0x427a('0x5a')]},'attributes':['id',_0x427a('0x5b'),'name','role',_0x427a('0x5c'),_0x427a('0x5d'),'online',_0x427a('0x5e'),'allowmessenger',_0x427a('0x5f')],'order':qs[_0x427a('0x40')](_0x427a('0x60')),'include':[{'model':db[_0x427a('0x61')],'as':_0x427a('0x62'),'attributes':['id',_0x427a('0x2e'),_0x427a('0x34')],'through':{'attributes':[]}}]})['then'](function(_0x119513){if(_0x119513){var _0x52e4e6=_0x7333f4['user'][_0x427a('0x51')]({'plain':!![]});if(!_0x52e4e6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52e4e6['role']==='user'){return db[_0x427a('0x63')]['find']({'where':{'name':_0x427a('0x64'),'userProfileId':_0x52e4e6[_0x427a('0x65')]},'raw':!![]})[_0x427a('0x2b')](function(_0x38046d){if(_0x38046d){if(_0x38046d['autoAssociation']===0x0){return db[_0x427a('0x66')][_0x427a('0x67')]({'where':{'sectionId':_0x38046d['id']},'raw':!![]})[_0x427a('0x2b')](function(_0x14c036){var _0x5af825=[];if(_['isEmpty'](_0x14c036)){_0x5af825=_['filter'](_0x119513,function(_0x13bb17){if(_0x13bb17['role']!=='agent'){return _0x13bb17;}});return _0x5af825;}else{for(var _0x5719f5=0x0;_0x5719f5<_0x119513['length'];_0x5719f5++){var _0x2cc5a9=_0x119513[_0x5719f5];if(_0x2cc5a9[_0x427a('0x68')]===_0x427a('0x69')){var _0x4ef410=_[_0x427a('0x4d')](_0x14c036,function(_0x3818a2){return _0x3818a2[_0x427a('0x6a')]===_0x2cc5a9['id'];});if(_0x4ef410)_0x5af825[_0x427a('0x6b')](_0x2cc5a9);}else{_0x5af825[_0x427a('0x6b')](_0x2cc5a9);}}return _0x5af825;}});}else{return _0x119513;}}else{var _0x1c401c=_['filter'](_0x119513,function(_0x12fee0){if(_0x12fee0[_0x427a('0x68')]!==_0x427a('0x69')){return _0x12fee0;}});return _0x1c401c;}});}else{return _0x119513;}}})[_0x427a('0x2b')](function(_0x4d4170){var _0x188fea=[];if(_0x4d4170){_0x1927f1=_0x4d4170;for(var _0x5a02e8=0x0;_0x5a02e8<_0x4d4170[_0x427a('0x3c')];_0x5a02e8+=0x1){_0x1927f1[_0x5a02e8][_0x427a('0x52')]=[];_0x188fea[_0x427a('0x6b')](db[_0x427a('0x31')][_0x427a('0x4d')]({'where':{'FromId':[_0x7333f4[_0x427a('0x5a')]['id'],_0x4d4170[_0x5a02e8]['id']],'ToId':[_0x7333f4[_0x427a('0x5a')]['id'],_0x4d4170[_0x5a02e8]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x427a('0x6c'),_0x427a('0x6d'),_0x427a('0x6e'),_0x427a('0x4f')],'order':qs[_0x427a('0x40')](_0x427a('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x427a('0x2b')](wrapUser(_0x4d4170[_0x5a02e8])));}return BPromise[_0x427a('0x70')](_0x188fea);}return[];})[_0x427a('0x2b')](function(_0x4d8a61){return{'rows':_0x4d8a61,'count':_0x4d8a61[_0x427a('0x3c')]};})[_0x427a('0x2b')](respondWithResult(_0x4ab311,null))[_0x427a('0x4a')](handleError(_0x4ab311,null));};
\ No newline at end of file
+var _0x47b2=['UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','length','resourceId','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','ChatInternalMessage','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','update','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','internal','online','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47b2,0x1c1));var _0x247b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47b2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x247b('0x0'));var zipdir=require(_0x247b('0x1'));var jsonpatch=require(_0x247b('0x2'));var rp=require('request-promise');var moment=require(_0x247b('0x3'));var BPromise=require(_0x247b('0x4'));var Mustache=require(_0x247b('0x5'));var util=require(_0x247b('0x6'));var path=require(_0x247b('0x7'));var sox=require(_0x247b('0x8'));var csv=require('to-csv');var ejs=require(_0x247b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x247b('0xa'));var squel=require('squel');var crypto=require(_0x247b('0xb'));var jsforce=require(_0x247b('0xc'));var deskjs=require(_0x247b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x247b('0xe'));var Papa=require(_0x247b('0xf'));var Redis=require(_0x247b('0x10'));var authService=require(_0x247b('0x11'));var qs=require(_0x247b('0x12'));var as=require(_0x247b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x247b('0x14'))(_0x247b('0x15'));var utils=require(_0x247b('0x16'));var config=require(_0x247b('0x17'));var licenseUtil=require(_0x247b('0x18'));var db=require('../../mysqldb')['db'];config[_0x247b('0x19')]=_['defaults'](config[_0x247b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x247b('0x1a'))(new Redis(config[_0x247b('0x19')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x38cc44,_0x1835c5){_0x1835c5=_0x1835c5||0xcc;return function(_0x5ba2a1){if(_0x5ba2a1){return _0x38cc44[_0x247b('0x1b')](_0x1835c5);}return _0x38cc44['status'](_0x1835c5)['end']();};}function respondWithResult(_0x25f65c,_0x2c37ab){_0x2c37ab=_0x2c37ab||0xc8;return function(_0x540089){if(_0x540089){return _0x25f65c[_0x247b('0x1c')](_0x2c37ab)[_0x247b('0x1d')](_0x540089);}};}function respondWithFilteredResult(_0x4df0f0,_0x55d428){return function(_0x4eb996){if(_0x4eb996){var _0x392927=typeof _0x55d428[_0x247b('0x1e')]===_0x247b('0x1f')&&typeof _0x55d428['limit']===_0x247b('0x1f');var _0x392fe0=_0x4eb996['count'];var _0x52df3b=_0x392927?0x0:_0x55d428['offset'];var _0x334ddf=_0x392927?_0x4eb996[_0x247b('0x20')]:_0x55d428[_0x247b('0x1e')]+_0x55d428['limit'];var _0x4ca712;if(_0x334ddf>=_0x392fe0){_0x334ddf=_0x392fe0;_0x4ca712=0xc8;}else{_0x4ca712=0xce;}_0x4df0f0[_0x247b('0x1c')](_0x4ca712);return _0x4df0f0[_0x247b('0x21')]('Content-Range',_0x52df3b+'-'+_0x334ddf+'/'+_0x392fe0)['json'](_0x4eb996);}return null;};}function patchUpdates(_0x4df28b){return function(_0x15e1c4){try{jsonpatch[_0x247b('0x22')](_0x15e1c4,_0x4df28b,!![]);}catch(_0x17a50d){return BPromise[_0x247b('0x23')](_0x17a50d);}return _0x15e1c4[_0x247b('0x24')]();};}function saveUpdates(_0x36ac07,_0x15f260){return function(_0x1d28d6){if(_0x1d28d6){return _0x1d28d6['update'](_0x36ac07)[_0x247b('0x25')](function(_0x401014){return _0x401014;});}return null;};}function removeEntity(_0x45bfe8,_0x57da39){return function(_0x271246){if(_0x271246){return _0x271246[_0x247b('0x26')]()['then'](function(){_0x45bfe8[_0x247b('0x1c')](0xcc)[_0x247b('0x27')]();});}};}function handleEntityNotFound(_0x5ee4df,_0x203866){return function(_0x2e5e84){if(!_0x2e5e84){_0x5ee4df['sendStatus'](0x194);}return _0x2e5e84;};}function handleError(_0x152d6f,_0x2383ad){_0x2383ad=_0x2383ad||0x1f4;return function(_0x114479){logger[_0x247b('0x28')](_0x114479[_0x247b('0x29')]);if(_0x114479['name']){delete _0x114479[_0x247b('0x2a')];}_0x152d6f['status'](_0x2383ad)[_0x247b('0x2b')](_0x114479);};}exports[_0x247b('0x2c')]=function(_0x1caeeb,_0x3c41e1){var _0x5a9e3a={},_0x13473a={},_0x379302={'count':0x0,'rows':[]};var _0x498dfc=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x136140){return{'name':_0x136140['fieldName'],'type':_0x136140[_0x247b('0x2d')][_0x247b('0x2e')]};});_0x13473a[_0x247b('0x2f')]=_[_0x247b('0x30')](_0x498dfc,_0x247b('0x2a'));_0x13473a[_0x247b('0x31')]=_[_0x247b('0x32')](_0x1caeeb[_0x247b('0x31')]);_0x13473a['filters']=_[_0x247b('0x33')](_0x13473a[_0x247b('0x2f')],_0x13473a[_0x247b('0x31')]);_0x5a9e3a[_0x247b('0x34')]=_[_0x247b('0x33')](_0x13473a[_0x247b('0x2f')],qs[_0x247b('0x35')](_0x1caeeb[_0x247b('0x31')][_0x247b('0x35')]));_0x5a9e3a[_0x247b('0x34')]=_0x5a9e3a[_0x247b('0x34')]['length']?_0x5a9e3a['attributes']:_0x13473a[_0x247b('0x2f')];if(!_0x1caeeb['query'][_0x247b('0x36')]('nolimit')){_0x5a9e3a['limit']=qs['limit'](_0x1caeeb['query']['limit']);_0x5a9e3a[_0x247b('0x1e')]=qs['offset'](_0x1caeeb[_0x247b('0x31')][_0x247b('0x1e')]);}_0x5a9e3a[_0x247b('0x37')]=qs[_0x247b('0x38')](_0x1caeeb[_0x247b('0x31')]['sort']);_0x5a9e3a[_0x247b('0x39')]=qs[_0x247b('0x3a')](_['pick'](_0x1caeeb[_0x247b('0x31')],_0x13473a[_0x247b('0x3a')]),_0x498dfc);if(_0x1caeeb[_0x247b('0x31')]['filter']){_0x5a9e3a['where']=_['merge'](_0x5a9e3a['where'],{'$or':_['map'](_0x498dfc,function(_0x15ace1){if(_0x15ace1[_0x247b('0x2d')]!==_0x247b('0x3b')){var _0x269fa2={};_0x269fa2[_0x15ace1[_0x247b('0x2a')]]={'$like':'%'+_0x1caeeb[_0x247b('0x31')][_0x247b('0x3c')]+'%'};return _0x269fa2;}})});}_0x5a9e3a=_[_0x247b('0x3d')]({},_0x5a9e3a,_0x1caeeb[_0x247b('0x3e')]);var _0x462747={'where':_0x5a9e3a['where']};return db[_0x247b('0x3f')][_0x247b('0x20')](_0x462747)[_0x247b('0x25')](function(_0x4feac5){_0x379302[_0x247b('0x20')]=_0x4feac5;if(_0x1caeeb['query'][_0x247b('0x40')]){_0x5a9e3a[_0x247b('0x41')]=[{'all':!![]}];}return db[_0x247b('0x3f')][_0x247b('0x42')](_0x5a9e3a);})[_0x247b('0x25')](function(_0x123d79){_0x379302[_0x247b('0x43')]=_0x123d79;return _0x379302;})[_0x247b('0x25')](respondWithFilteredResult(_0x3c41e1,_0x5a9e3a))['catch'](handleError(_0x3c41e1,null));};exports[_0x247b('0x44')]=function(_0x498482,_0x4631d7){var _0x2871a8={'raw':!![],'where':{'id':_0x498482[_0x247b('0x45')]['id']}},_0x554a8b={};_0x554a8b[_0x247b('0x2f')]=_[_0x247b('0x32')](db[_0x247b('0x3f')][_0x247b('0x46')]);_0x554a8b['query']=_[_0x247b('0x32')](_0x498482[_0x247b('0x31')]);_0x554a8b['filters']=_['intersection'](_0x554a8b['model'],_0x554a8b[_0x247b('0x31')]);_0x2871a8[_0x247b('0x34')]=_[_0x247b('0x33')](_0x554a8b[_0x247b('0x2f')],qs[_0x247b('0x35')](_0x498482[_0x247b('0x31')]['fields']));_0x2871a8['attributes']=_0x2871a8[_0x247b('0x34')]['length']?_0x2871a8['attributes']:_0x554a8b['model'];if(_0x498482['query']['includeAll']){_0x2871a8['include']=[{'all':!![]}];}_0x2871a8=_[_0x247b('0x3d')]({},_0x2871a8,_0x498482[_0x247b('0x3e')]);return db[_0x247b('0x3f')][_0x247b('0x47')](_0x2871a8)[_0x247b('0x25')](handleEntityNotFound(_0x4631d7,null))[_0x247b('0x25')](respondWithResult(_0x4631d7,null))[_0x247b('0x48')](handleError(_0x4631d7,null));};exports['create']=function(_0x462fe8,_0x17177c){return db['ChatInternalMessage'][_0x247b('0x49')](_0x462fe8[_0x247b('0x4a')],{})[_0x247b('0x25')](respondWithResult(_0x17177c,0xc9))[_0x247b('0x48')](handleError(_0x17177c,null));};exports[_0x247b('0x4b')]=function(_0xc573f4,_0x5ce36b){if(_0xc573f4[_0x247b('0x4a')]['id']){delete _0xc573f4[_0x247b('0x4a')]['id'];}return db[_0x247b('0x3f')]['find']({'where':{'id':_0xc573f4[_0x247b('0x45')]['id']}})[_0x247b('0x25')](handleEntityNotFound(_0x5ce36b,null))[_0x247b('0x25')](saveUpdates(_0xc573f4[_0x247b('0x4a')],null))[_0x247b('0x25')](respondWithResult(_0x5ce36b,null))['catch'](handleError(_0x5ce36b,null));};exports[_0x247b('0x26')]=function(_0x5931c2,_0x4354df){return db[_0x247b('0x3f')][_0x247b('0x47')]({'where':{'id':_0x5931c2[_0x247b('0x45')]['id']}})['then'](handleEntityNotFound(_0x4354df,null))[_0x247b('0x25')](removeEntity(_0x4354df,null))['catch'](handleError(_0x4354df,null));};exports[_0x247b('0x4c')]=function(_0x55f246,_0x50ca69){return db[_0x247b('0x3f')][_0x247b('0x4c')]()[_0x247b('0x25')](respondWithResult(_0x50ca69,null))[_0x247b('0x48')](handleError(_0x50ca69,null));};function wrapUser(_0x1fd0a3){return function(_0x488297){var _0x25ee81=_0x1fd0a3[_0x247b('0x4d')]({'plain':!![]});_0x25ee81[_0x247b('0x4e')]=[];if(_0x488297){_0x25ee81[_0x247b('0x4f')]=_0x488297[_0x247b('0x50')];_0x25ee81[_0x247b('0x51')]=_0x488297;}else{_0x25ee81[_0x247b('0x4f')]=moment(0x0)[_0x247b('0x52')](_0x247b('0x53'));_0x25ee81['lastMessage']={};}return _0x25ee81;};}exports[_0x247b('0x54')]=function(_0x232340,_0x5e40ad,_0x754a03){var _0x5b295b=[];return db['User']['findAll']({'where':{'role':[_0x247b('0x55'),_0x247b('0x56'),_0x247b('0x57')]},'attributes':['id',_0x247b('0x58'),'name','role','userpic',_0x247b('0x59'),_0x247b('0x5a'),'lastLoginAt',_0x247b('0x5b'),_0x247b('0x5c')],'order':qs[_0x247b('0x38')]('-online'),'include':[{'model':db[_0x247b('0x5d')],'as':'VoiceQueues','attributes':['id',_0x247b('0x2a'),_0x247b('0x2d')],'through':{'attributes':[]}}]})['then'](function(_0x5dcd3c){if(_0x5dcd3c){var _0x34ef76=_0x232340['user'][_0x247b('0x4d')]({'plain':!![]});if(!_0x34ef76)throw new Error(_0x247b('0x5e'));if(_0x34ef76[_0x247b('0x5f')]===_0x247b('0x57')){return db[_0x247b('0x60')]['find']({'where':{'name':_0x247b('0x61'),'userProfileId':_0x34ef76['userProfileId']},'raw':!![]})['then'](function(_0x52fb78){if(_0x52fb78){if(_0x52fb78[_0x247b('0x62')]===0x0){return db[_0x247b('0x63')][_0x247b('0x42')]({'where':{'sectionId':_0x52fb78['id']},'raw':!![]})[_0x247b('0x25')](function(_0xc1ef93){var _0x168497=[];if(_[_0x247b('0x64')](_0xc1ef93)){_0x168497=_[_0x247b('0x3c')](_0x5dcd3c,function(_0x6b8658){if(_0x6b8658[_0x247b('0x5f')]!==_0x247b('0x55')){return _0x6b8658;}});return _0x168497;}else{for(var _0x3d18db=0x0;_0x3d18db<_0x5dcd3c[_0x247b('0x65')];_0x3d18db++){var _0x226c33=_0x5dcd3c[_0x3d18db];if(_0x226c33['role']===_0x247b('0x55')){var _0x5b7987=_['find'](_0xc1ef93,function(_0x1ca12b){return _0x1ca12b[_0x247b('0x66')]===_0x226c33['id'];});if(_0x5b7987)_0x168497[_0x247b('0x67')](_0x226c33);}else{_0x168497['push'](_0x226c33);}}return _0x168497;}});}else{return _0x5dcd3c;}}else{var _0x59a937=_[_0x247b('0x3c')](_0x5dcd3c,function(_0x3afa59){if(_0x3afa59['role']!==_0x247b('0x55')){return _0x3afa59;}});return _0x59a937;}});}else{return _0x5dcd3c;}}})[_0x247b('0x25')](function(_0x703707){var _0x4603eb=[];if(_0x703707){_0x5b295b=_0x703707;for(var _0x41e2d7=0x0;_0x41e2d7<_0x703707[_0x247b('0x65')];_0x41e2d7+=0x1){_0x5b295b[_0x41e2d7][_0x247b('0x4e')]=[];_0x4603eb[_0x247b('0x67')](db[_0x247b('0x3f')][_0x247b('0x47')]({'where':{'FromId':[_0x232340[_0x247b('0x57')]['id'],_0x703707[_0x41e2d7]['id']],'ToId':[_0x232340[_0x247b('0x57')]['id'],_0x703707[_0x41e2d7]['id']],'ChatGroupId':null},'attributes':['id',_0x247b('0x50'),_0x247b('0x68'),_0x247b('0x69'),_0x247b('0x6a'),_0x247b('0x4a')],'order':qs['sort'](_0x247b('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x703707[_0x41e2d7])));}return BPromise[_0x247b('0x6c')](_0x4603eb);}return[];})[_0x247b('0x25')](function(_0x371aff){return{'rows':_0x371aff,'count':_0x371aff[_0x247b('0x65')]};})[_0x247b('0x25')](respondWithResult(_0x5e40ad,null))['catch'](handleError(_0x5e40ad,null));};
\ No newline at end of file
index 6d474af..406ad14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d02=['ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x54d462,_0x35f36d){var _0x4860a0=function(_0x1d221c){while(--_0x1d221c){_0x54d462['push'](_0x54d462['shift']());}};_0x4860a0(++_0x35f36d);}(_0x4d02,0x10c));var _0x24d0=function(_0xf2097f,_0x31dfe0){_0xf2097f=_0xf2097f-0x0;var _0xa70e10=_0x4d02[_0xf2097f];return _0xa70e10;};'use strict';var EventEmitter=require(_0x24d0('0x0'));var ChatInternalMessage=require(_0x24d0('0x1'))['db'][_0x24d0('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x24d0('0x3')](0x0);var events={'afterCreate':_0x24d0('0x4'),'afterUpdate':_0x24d0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x47cfe2){return function(_0xd8e803,_0xc8a73f,_0x787c4a){ChatInternalMessageEvents[_0x24d0('0x6')](_0x47cfe2+':'+_0xd8e803['id'],_0xd8e803);ChatInternalMessageEvents[_0x24d0('0x6')](_0x47cfe2,_0xd8e803);_0x787c4a(null);};}for(var e in events){if(events[_0x24d0('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x24d0('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x0415=['events','../../mysqldb','ChatInternalMessage','save','remove','emit','exports'];(function(_0x2d5491,_0xacf279){var _0x12f430=function(_0x44bb6a){while(--_0x44bb6a){_0x2d5491['push'](_0x2d5491['shift']());}};_0x12f430(++_0xacf279);}(_0x0415,0x12d));var _0x5041=function(_0x3fb105,_0x41c656){_0x3fb105=_0x3fb105-0x0;var _0x429efe=_0x0415[_0x3fb105];return _0x429efe;};'use strict';var EventEmitter=require(_0x5041('0x0'));var ChatInternalMessage=require(_0x5041('0x1'))['db'][_0x5041('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5041('0x3'),'afterUpdate':'update','afterDestroy':_0x5041('0x4')};function emitEvent(_0x2a1bdd){return function(_0x36716a,_0x41d8ba,_0x3adbff){ChatInternalMessageEvents[_0x5041('0x5')](_0x2a1bdd+':'+_0x36716a['id'],_0x36716a);ChatInternalMessageEvents[_0x5041('0x5')](_0x2a1bdd,_0x36716a);_0x3adbff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x5041('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
index bbc96f5..19154e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcee0=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','rimraf','exports','define','ChatInternalMessage'];(function(_0xa4b0f1,_0x5dbb61){var _0x2aa0ed=function(_0x2844fd){while(--_0x2844fd){_0xa4b0f1['push'](_0xa4b0f1['shift']());}};_0x2aa0ed(++_0x5dbb61);}(_0xcee0,0x10b));var _0x0cee=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0xcee0[_0x13594e];return _0x1a4f42;};'use strict';var _=require(_0x0cee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0cee('0x1'));var moment=require(_0x0cee('0x2'));var BPromise=require(_0x0cee('0x3'));var rp=require(_0x0cee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0cee('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x0cee('0x6')]=function(_0x30265f,_0x5719d1){return _0x30265f[_0x0cee('0x7')](_0x0cee('0x8'),attributes,{'tableName':_0x0cee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0cee('0xa'),'collate':_0x0cee('0xb')});};
\ No newline at end of file
+var _0xef03=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xef03,0x1e6));var _0x3ef0=function(_0x49816b,_0x319e9c){_0x49816b=_0x49816b-0x0;var _0x142236=_0xef03[_0x49816b];return _0x142236;};'use strict';var _=require(_0x3ef0('0x0'));var util=require(_0x3ef0('0x1'));var logger=require(_0x3ef0('0x2'))('api');var moment=require(_0x3ef0('0x3'));var BPromise=require('bluebird');var rp=require(_0x3ef0('0x4'));var fs=require('fs');var path=require(_0x3ef0('0x5'));var rimraf=require(_0x3ef0('0x6'));var config=require(_0x3ef0('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x3ef0('0x8')]=function(_0x3816be,_0x48e491){return _0x3816be[_0x3ef0('0x9')](_0x3ef0('0xa'),attributes,{'tableName':_0x3ef0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3ef0('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 8439b22..c488ab2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4536=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_0x4536,0xe9));var _0x6453=function(_0x5cf0e9,_0x6e80ba){_0x5cf0e9=_0x5cf0e9-0x0;var _0x27091d=_0x4536[_0x5cf0e9];return _0x27091d;};'use strict';var _=require(_0x6453('0x0'));var util=require(_0x6453('0x1'));var moment=require(_0x6453('0x2'));var BPromise=require(_0x6453('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6453('0x4'));var db=require(_0x6453('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6453('0x6'))(_0x6453('0x7'));var config=require(_0x6453('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6453('0x9')][_0x6453('0xa')]({'port':0x232a});config['redis']=_[_0x6453('0xb')](config[_0x6453('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6453('0xd'))(new Redis(config[_0x6453('0xc')]));require(_0x6453('0xe'))[_0x6453('0xf')](socket);function respondWithRpcPromise(_0x3bf9fb,_0x1d939d,_0x5eb169){return new BPromise(function(_0x46b362,_0x43b184){return client['request'](_0x3bf9fb,_0x5eb169)['then'](function(_0x233eec){logger[_0x6453('0x10')](_0x6453('0x11'),_0x1d939d,_0x6453('0x12'));logger[_0x6453('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1d939d,_0x6453('0x12'),JSON[_0x6453('0x14')](_0x233eec));if(_0x233eec[_0x6453('0x15')]){if(_0x233eec[_0x6453('0x15')][_0x6453('0x16')]===0x1f4){logger[_0x6453('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x1d939d,_0x233eec['error'][_0x6453('0x17')]);return _0x43b184(_0x233eec[_0x6453('0x15')][_0x6453('0x17')]);}logger[_0x6453('0x15')](_0x6453('0x11'),_0x1d939d,_0x233eec[_0x6453('0x15')][_0x6453('0x17')]);return _0x46b362(_0x233eec[_0x6453('0x15')][_0x6453('0x17')]);}else{logger['info'](_0x6453('0x11'),_0x1d939d,_0x6453('0x12'));_0x46b362(_0x233eec[_0x6453('0x18')][_0x6453('0x17')]);}})[_0x6453('0x19')](function(_0x1c0e79){logger[_0x6453('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x1d939d,_0x1c0e79);_0x43b184(_0x1c0e79);});});}
\ No newline at end of file
+var _0x7c8e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatInternalMessage,\x20%s,\x20%s','result','catch'];(function(_0x2b3312,_0x577b69){var _0x59208f=function(_0xc0098f){while(--_0xc0098f){_0x2b3312['push'](_0x2b3312['shift']());}};_0x59208f(++_0x577b69);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x3318fe,_0x3f5d89){_0x3318fe=_0x3318fe-0x0;var _0x574ad=_0x7c8e[_0x3318fe];return _0x574ad;};'use strict';var _=require('lodash');var util=require(_0xe7c8('0x0'));var moment=require(_0xe7c8('0x1'));var BPromise=require(_0xe7c8('0x2'));var rs=require(_0xe7c8('0x3'));var fs=require('fs');var Redis=require(_0xe7c8('0x4'));var db=require(_0xe7c8('0x5'))['db'];var utils=require(_0xe7c8('0x6'));var logger=require(_0xe7c8('0x7'))(_0xe7c8('0x8'));var config=require(_0xe7c8('0x9'));var jayson=require(_0xe7c8('0xa'));var client=jayson[_0xe7c8('0xb')][_0xe7c8('0xc')]({'port':0x232a});config[_0xe7c8('0xd')]=_[_0xe7c8('0xe')](config[_0xe7c8('0xd')],{'host':_0xe7c8('0xf'),'port':0x18eb});var socket=require(_0xe7c8('0x10'))(new Redis(config['redis']));require(_0xe7c8('0x11'))[_0xe7c8('0x12')](socket);function respondWithRpcPromise(_0x321566,_0x50c222,_0x27b924){return new BPromise(function(_0x329b4c,_0x297c01){return client[_0xe7c8('0x13')](_0x321566,_0x27b924)[_0xe7c8('0x14')](function(_0x44c1d8){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x50c222,_0xe7c8('0x15'));logger[_0xe7c8('0x16')](_0xe7c8('0x17'),_0x50c222,_0xe7c8('0x15'),JSON[_0xe7c8('0x18')](_0x44c1d8));if(_0x44c1d8[_0xe7c8('0x19')]){if(_0x44c1d8['error']['code']===0x1f4){logger[_0xe7c8('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x50c222,_0x44c1d8['error'][_0xe7c8('0x1a')]);return _0x297c01(_0x44c1d8[_0xe7c8('0x19')]['message']);}logger[_0xe7c8('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x50c222,_0x44c1d8['error']['message']);return _0x329b4c(_0x44c1d8['error'][_0xe7c8('0x1a')]);}else{logger['info'](_0xe7c8('0x1b'),_0x50c222,_0xe7c8('0x15'));_0x329b4c(_0x44c1d8[_0xe7c8('0x1c')][_0xe7c8('0x1a')]);}})[_0xe7c8('0x1d')](function(_0x35dfaa){logger[_0xe7c8('0x19')](_0xe7c8('0x1b'),_0x50c222,_0x35dfaa);_0x297c01(_0x35dfaa);});});}
\ No newline at end of file
index bb9bd5c..aace92d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1540=['save','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events'];(function(_0xd395c7,_0x1863d2){var _0x13b518=function(_0x472777){while(--_0x472777){_0xd395c7['push'](_0xd395c7['shift']());}};_0x13b518(++_0x1863d2);}(_0x1540,0x1d9));var _0x0154=function(_0xd1624b,_0x23fa96){_0xd1624b=_0xd1624b-0x0;var _0x4d9a29=_0x1540[_0xd1624b];return _0x4d9a29;};'use strict';var ChatInternalMessageEvents=require(_0x0154('0x0'));var events=[_0x0154('0x1'),'remove','update'];function createListener(_0x2c3286,_0x4fdcbc){return function(_0x42b028){_0x4fdcbc[_0x0154('0x2')](_0x2c3286,_0x42b028);};}function removeListener(_0x5e97a5,_0x2c2ee6){return function(){ChatInternalMessageEvents[_0x0154('0x3')](_0x5e97a5,_0x2c2ee6);};}exports[_0x0154('0x4')]=function(_0x53c668){for(var _0x4e9066=0x0,_0x467962=events['length'];_0x4e9066<_0x467962;_0x4e9066++){var _0x228e6f=events[_0x4e9066];var _0x47aff1=createListener(_0x0154('0x5')+_0x228e6f,_0x53c668);ChatInternalMessageEvents['on'](_0x228e6f,_0x47aff1);}};
\ No newline at end of file
+var _0xddfd=['save','remove','update','emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x39af91,_0x90a626){var _0x1827db=function(_0x56a405){while(--_0x56a405){_0x39af91['push'](_0x39af91['shift']());}};_0x1827db(++_0x90a626);}(_0xddfd,0x1c7));var _0xdddf=function(_0x3b3ec6,_0x42a4c4){_0x3b3ec6=_0x3b3ec6-0x0;var _0xd01230=_0xddfd[_0x3b3ec6];return _0xd01230;};'use strict';var ChatInternalMessageEvents=require(_0xdddf('0x0'));var events=[_0xdddf('0x1'),_0xdddf('0x2'),_0xdddf('0x3')];function createListener(_0x421e5e,_0x210e07){return function(_0x45d3ff){_0x210e07[_0xdddf('0x4')](_0x421e5e,_0x45d3ff);};}function removeListener(_0x1200f5,_0xb35500){return function(){ChatInternalMessageEvents[_0xdddf('0x5')](_0x1200f5,_0xb35500);};}exports['register']=function(_0x1cacc2){for(var _0x17e3e4=0x0,_0x22c340=events[_0xdddf('0x6')];_0x17e3e4<_0x22c340;_0x17e3e4++){var _0x595d33=events[_0x17e3e4];var _0x140d26=createListener(_0xdddf('0x7')+_0x595d33,_0x1cacc2);ChatInternalMessageEvents['on'](_0x595d33,_0x140d26);}};
\ No newline at end of file
index b849dc6..2392a45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2762=['getUsers','/:id','create','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','/users'];(function(_0x6d7060,_0x119c08){var _0x195046=function(_0x3a4923){while(--_0x3a4923){_0x6d7060['push'](_0x6d7060['shift']());}};_0x195046(++_0x119c08);}(_0x2762,0xa6));var _0x2276=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2762[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x2276('0x0'));var path=require('path');var timeout=require(_0x2276('0x1'));var express=require(_0x2276('0x2'));var router=express[_0x2276('0x3')]();var fs_extra=require(_0x2276('0x4'));var auth=require(_0x2276('0x5'));var interaction=require(_0x2276('0x6'));var config=require(_0x2276('0x7'));var controller=require(_0x2276('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2276('0x9')](_0x2276('0xa'),auth[_0x2276('0xb')](),controller[_0x2276('0xc')]);router[_0x2276('0x9')](_0x2276('0xd'),auth[_0x2276('0xb')](),controller[_0x2276('0xe')]);router[_0x2276('0x9')](_0x2276('0xf'),auth[_0x2276('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x2276('0x10')]);router['put'](_0x2276('0xf'),controller['update']);router[_0x2276('0x11')](_0x2276('0xf'),auth['isAuthenticated'](),controller[_0x2276('0x12')]);module[_0x2276('0x13')]=router;
\ No newline at end of file
+var _0xdc9b=['isAuthenticated','index','/users','getUsers','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x527dc5,_0x1de7e7){var _0x216de9=function(_0xde9c52){while(--_0xde9c52){_0x527dc5['push'](_0x527dc5['shift']());}};_0x216de9(++_0x1de7e7);}(_0xdc9b,0x1eb));var _0xbdc9=function(_0x243afd,_0x168463){_0x243afd=_0x243afd-0x0;var _0x2feecb=_0xdc9b[_0x243afd];return _0x2feecb;};'use strict';var multer=require(_0xbdc9('0x0'));var util=require(_0xbdc9('0x1'));var path=require(_0xbdc9('0x2'));var timeout=require(_0xbdc9('0x3'));var express=require(_0xbdc9('0x4'));var router=express[_0xbdc9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbdc9('0x6'));var interaction=require(_0xbdc9('0x7'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0xbdc9('0x8')]('/',auth[_0xbdc9('0x9')](),controller[_0xbdc9('0xa')]);router[_0xbdc9('0x8')]('/describe',auth[_0xbdc9('0x9')](),controller['describe']);router[_0xbdc9('0x8')](_0xbdc9('0xb'),auth[_0xbdc9('0x9')](),controller[_0xbdc9('0xc')]);router[_0xbdc9('0x8')](_0xbdc9('0xd'),auth['isAuthenticated'](),controller[_0xbdc9('0xe')]);router[_0xbdc9('0xf')]('/',auth[_0xbdc9('0x9')](),controller['create']);router[_0xbdc9('0x10')](_0xbdc9('0xd'),controller['update']);router[_0xbdc9('0x11')](_0xbdc9('0xd'),auth[_0xbdc9('0x9')](),controller[_0xbdc9('0x12')]);module[_0xbdc9('0x13')]=router;
\ No newline at end of file
index b3a41e6..ffff7c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81a5=['sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x81a5,0x1c8));var _0x581a=function(_0x56313a,_0x1d9306){_0x56313a=_0x56313a-0x0;var _0x3b0bee=_0x81a5[_0x56313a];return _0x3b0bee;};'use strict';var Sequelize=require(_0x581a('0x0'));module[_0x581a('0x1')]={'body':{'type':Sequelize[_0x581a('0x2')](_0x581a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x581a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x581a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x581a('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7df3=['out','DATE','STRING','TEXT','sequelize','exports','medium','BOOLEAN'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x7df3,0x1cc));var _0x37df=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7df3[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x37df('0x0'));module[_0x37df('0x1')]={'body':{'type':Sequelize['TEXT'](_0x37df('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x37df('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x37df('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x37df('0x5')]},'providerName':{'type':Sequelize[_0x37df('0x6')]},'providerResponse':{'type':Sequelize[_0x37df('0x7')]}};
\ No newline at end of file
index e5cbfd4..a6ad35c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x113c=['QueryTypes','SELECT','contact','agent','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','User','fullname','event','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','ChatMessage','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','fields','find','create','body','describe','accept','chat','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','get','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x113c,0xa0));var _0xc113=function(_0x3a8eb2,_0x36bc4f){_0x3a8eb2=_0x3a8eb2-0x0;var _0x42f15f=_0x113c[_0x3a8eb2];return _0x42f15f;};'use strict';var emlformat=require(_0xc113('0x0'));var rimraf=require(_0xc113('0x1'));var zipdir=require(_0xc113('0x2'));var jsonpatch=require(_0xc113('0x3'));var rp=require(_0xc113('0x4'));var moment=require('moment');var BPromise=require(_0xc113('0x5'));var Mustache=require(_0xc113('0x6'));var util=require(_0xc113('0x7'));var path=require('path');var sox=require(_0xc113('0x8'));var csv=require(_0xc113('0x9'));var ejs=require(_0xc113('0xa'));var fs=require('fs');var fs_extra=require(_0xc113('0xb'));var _=require(_0xc113('0xc'));var squel=require(_0xc113('0xd'));var crypto=require(_0xc113('0xe'));var jsforce=require(_0xc113('0xf'));var deskjs=require(_0xc113('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc113('0x11'));var Papa=require(_0xc113('0x12'));var Redis=require(_0xc113('0x13'));var authService=require(_0xc113('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc113('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc113('0x16'))(_0xc113('0x17'));var utils=require(_0xc113('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc113('0x19'))['db'];config[_0xc113('0x1a')]=_[_0xc113('0x1b')](config['redis'],{'host':_0xc113('0x1c'),'port':0x18eb});var socket=require(_0xc113('0x1d'))(new Redis(config['redis']));require(_0xc113('0x1e'))[_0xc113('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc113('0x20')][_0xc113('0x21')]({'port':0x232c});var client9002=jayson[_0xc113('0x20')][_0xc113('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4d019c,_0x3d0dd2,_0x42cdff,_0xb582d4){return new BPromise(function(_0x2d6abc,_0x584990){var _0x526a14=_0xb582d4||client;return _0x526a14['request'](_0x4d019c,_0x42cdff)[_0xc113('0x22')](function(_0xb695d4){logger['info'](_0xc113('0x23'),_0x3d0dd2,_0xc113('0x24'));logger[_0xc113('0x25')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3d0dd2,'request\x20sent',JSON['stringify'](_0xb695d4));if(_0xb695d4['error']){if(_0xb695d4[_0xc113('0x26')][_0xc113('0x27')]===0x1f4){logger['error'](_0xc113('0x23'),_0x3d0dd2,_0xb695d4[_0xc113('0x26')]['message']);return _0x584990(_0xb695d4[_0xc113('0x26')][_0xc113('0x28')]);}logger[_0xc113('0x26')](_0xc113('0x23'),_0x3d0dd2,_0xb695d4[_0xc113('0x26')][_0xc113('0x28')]);return _0x2d6abc(_0xb695d4[_0xc113('0x26')][_0xc113('0x28')]);}else{logger[_0xc113('0x29')](_0xc113('0x23'),_0x3d0dd2,_0xc113('0x24'));_0x2d6abc(_0xb695d4[_0xc113('0x2a')][_0xc113('0x28')]);}})[_0xc113('0x2b')](function(_0x4e14ad){logger[_0xc113('0x26')](_0xc113('0x23'),_0x3d0dd2,_0x4e14ad);_0x584990(_0x4e14ad);});});}function respondWithStatusCode(_0x37419d,_0x10bf2c){_0x10bf2c=_0x10bf2c||0xcc;return function(_0x5e9e9c){if(_0x5e9e9c){return _0x37419d[_0xc113('0x2c')](_0x10bf2c);}return _0x37419d[_0xc113('0x2d')](_0x10bf2c)[_0xc113('0x2e')]();};}function respondWithResult(_0x345884,_0x1d1c67){_0x1d1c67=_0x1d1c67||0xc8;return function(_0x4a62f4){if(_0x4a62f4){return _0x345884[_0xc113('0x2d')](_0x1d1c67)['json'](_0x4a62f4);}};}function respondWithFilteredResult(_0x347f12,_0x3cc1dc){return function(_0x3ad910){if(_0x3ad910){var _0x232aab=typeof _0x3cc1dc['offset']===_0xc113('0x2f')&&typeof _0x3cc1dc[_0xc113('0x30')]===_0xc113('0x2f');var _0x3f55b0=_0x3ad910[_0xc113('0x31')];var _0x232ea2=_0x232aab?0x0:_0x3cc1dc['offset'];var _0x2b6da6=_0x232aab?_0x3ad910[_0xc113('0x31')]:_0x3cc1dc[_0xc113('0x32')]+_0x3cc1dc[_0xc113('0x30')];var _0x3905d2;if(_0x2b6da6>=_0x3f55b0){_0x2b6da6=_0x3f55b0;_0x3905d2=0xc8;}else{_0x3905d2=0xce;}_0x347f12[_0xc113('0x2d')](_0x3905d2);return _0x347f12[_0xc113('0x33')](_0xc113('0x34'),_0x232ea2+'-'+_0x2b6da6+'/'+_0x3f55b0)[_0xc113('0x35')](_0x3ad910);}return null;};}function patchUpdates(_0x5bbf90){return function(_0x4b1227){try{jsonpatch[_0xc113('0x36')](_0x4b1227,_0x5bbf90,!![]);}catch(_0x569d19){return BPromise[_0xc113('0x37')](_0x569d19);}return _0x4b1227[_0xc113('0x38')]();};}function saveUpdates(_0x1cd7dc,_0x28ca85){return function(_0x112941){if(_0x112941){return _0x112941[_0xc113('0x39')](_0x1cd7dc)['then'](function(_0x508357){return _0x508357;});}return null;};}function removeEntity(_0x342e4d,_0x1e71a1){return function(_0x20d799){if(_0x20d799){return _0x20d799[_0xc113('0x3a')]()['then'](function(){_0x342e4d[_0xc113('0x2d')](0xcc)[_0xc113('0x2e')]();});}};}function handleEntityNotFound(_0x26802d,_0x294257){return function(_0x5eaddb){if(!_0x5eaddb){_0x26802d[_0xc113('0x2c')](0x194);}return _0x5eaddb;};}function handleError(_0x4e8605,_0x113d24){_0x113d24=_0x113d24||0x1f4;return function(_0x12236e){logger[_0xc113('0x26')](_0x12236e[_0xc113('0x3b')]);if(_0x12236e[_0xc113('0x3c')]){delete _0x12236e['name'];}_0x4e8605[_0xc113('0x2d')](_0x113d24)[_0xc113('0x3d')](_0x12236e);};}exports[_0xc113('0x3e')]=function(_0x1ceb8f,_0x4c4b72){var _0x392fb7={},_0x21d7a4={},_0x264286={'count':0x0,'rows':[]};var _0x5bfb80=_['map'](db[_0xc113('0x3f')]['rawAttributes'],function(_0x29ba4e){return{'name':_0x29ba4e['fieldName'],'type':_0x29ba4e[_0xc113('0x40')][_0xc113('0x41')]};});_0x21d7a4[_0xc113('0x42')]=_[_0xc113('0x43')](_0x5bfb80,_0xc113('0x3c'));_0x21d7a4[_0xc113('0x44')]=_[_0xc113('0x45')](_0x1ceb8f['query']);_0x21d7a4['filters']=_[_0xc113('0x46')](_0x21d7a4['model'],_0x21d7a4[_0xc113('0x44')]);_0x392fb7[_0xc113('0x47')]=_[_0xc113('0x46')](_0x21d7a4[_0xc113('0x42')],qs['fields'](_0x1ceb8f[_0xc113('0x44')]['fields']));_0x392fb7[_0xc113('0x47')]=_0x392fb7[_0xc113('0x47')][_0xc113('0x48')]?_0x392fb7[_0xc113('0x47')]:_0x21d7a4[_0xc113('0x42')];if(!_0x1ceb8f[_0xc113('0x44')][_0xc113('0x49')](_0xc113('0x4a'))){_0x392fb7[_0xc113('0x30')]=qs[_0xc113('0x30')](_0x1ceb8f['query'][_0xc113('0x30')]);_0x392fb7[_0xc113('0x32')]=qs['offset'](_0x1ceb8f[_0xc113('0x44')][_0xc113('0x32')]);}_0x392fb7[_0xc113('0x4b')]=qs[_0xc113('0x4c')](_0x1ceb8f[_0xc113('0x44')][_0xc113('0x4c')]);_0x392fb7[_0xc113('0x4d')]=qs[_0xc113('0x4e')](_[_0xc113('0x4f')](_0x1ceb8f[_0xc113('0x44')],_0x21d7a4[_0xc113('0x4e')]),_0x5bfb80);if(_0x1ceb8f[_0xc113('0x44')][_0xc113('0x50')]){_0x392fb7[_0xc113('0x4d')]=_[_0xc113('0x51')](_0x392fb7[_0xc113('0x4d')],{'$or':_['map'](_0x5bfb80,function(_0x58d449){if(_0x58d449[_0xc113('0x40')]!==_0xc113('0x52')){var _0x29c110={};_0x29c110[_0x58d449[_0xc113('0x3c')]]={'$like':'%'+_0x1ceb8f['query'][_0xc113('0x50')]+'%'};return _0x29c110;}})});}_0x392fb7=_[_0xc113('0x51')]({},_0x392fb7,_0x1ceb8f[_0xc113('0x53')]);var _0xad5993={'where':_0x392fb7[_0xc113('0x4d')]};return db[_0xc113('0x3f')][_0xc113('0x31')](_0xad5993)[_0xc113('0x22')](function(_0x344df1){_0x264286[_0xc113('0x31')]=_0x344df1;if(_0x1ceb8f[_0xc113('0x44')]['includeAll']){_0x392fb7[_0xc113('0x54')]=[{'all':!![]}];}return db[_0xc113('0x3f')][_0xc113('0x55')](_0x392fb7);})[_0xc113('0x22')](function(_0x2307e6){_0x264286[_0xc113('0x56')]=_0x2307e6;return _0x264286;})[_0xc113('0x22')](respondWithFilteredResult(_0x4c4b72,_0x392fb7))[_0xc113('0x2b')](handleError(_0x4c4b72,null));};exports[_0xc113('0x57')]=function(_0x4b6f96,_0x2affe6){var _0x46e8e8={'raw':!![],'where':{'id':_0x4b6f96[_0xc113('0x58')]['id']}},_0x40aa69={};_0x40aa69[_0xc113('0x42')]=_[_0xc113('0x45')](db[_0xc113('0x3f')][_0xc113('0x59')]);_0x40aa69[_0xc113('0x44')]=_[_0xc113('0x45')](_0x4b6f96['query']);_0x40aa69['filters']=_['intersection'](_0x40aa69[_0xc113('0x42')],_0x40aa69[_0xc113('0x44')]);_0x46e8e8[_0xc113('0x47')]=_['intersection'](_0x40aa69[_0xc113('0x42')],qs[_0xc113('0x5a')](_0x4b6f96['query'][_0xc113('0x5a')]));_0x46e8e8[_0xc113('0x47')]=_0x46e8e8['attributes'][_0xc113('0x48')]?_0x46e8e8[_0xc113('0x47')]:_0x40aa69[_0xc113('0x42')];if(_0x4b6f96[_0xc113('0x44')]['includeAll']){_0x46e8e8[_0xc113('0x54')]=[{'all':!![]}];}_0x46e8e8=_[_0xc113('0x51')]({},_0x46e8e8,_0x4b6f96[_0xc113('0x53')]);return db[_0xc113('0x3f')][_0xc113('0x5b')](_0x46e8e8)['then'](handleEntityNotFound(_0x2affe6,null))['then'](respondWithResult(_0x2affe6,null))[_0xc113('0x2b')](handleError(_0x2affe6,null));};exports['create']=function(_0x151c36,_0x560f8a){return db[_0xc113('0x3f')][_0xc113('0x5c')](_0x151c36['body'],{})[_0xc113('0x22')](respondWithResult(_0x560f8a,0xc9))[_0xc113('0x2b')](handleError(_0x560f8a,null));};exports[_0xc113('0x39')]=function(_0x228471,_0x43b3e1){if(_0x228471[_0xc113('0x5d')]['id']){delete _0x228471[_0xc113('0x5d')]['id'];}return db[_0xc113('0x3f')]['find']({'where':{'id':_0x228471[_0xc113('0x58')]['id']}})[_0xc113('0x22')](handleEntityNotFound(_0x43b3e1,null))[_0xc113('0x22')](saveUpdates(_0x228471['body'],null))['then'](respondWithResult(_0x43b3e1,null))[_0xc113('0x2b')](handleError(_0x43b3e1,null));};exports['destroy']=function(_0x367a76,_0x5ce9ec){return db['ChatMessage']['find']({'where':{'id':_0x367a76['params']['id']}})[_0xc113('0x22')](handleEntityNotFound(_0x5ce9ec,null))[_0xc113('0x22')](removeEntity(_0x5ce9ec,null))[_0xc113('0x2b')](handleError(_0x5ce9ec,null));};exports['describe']=function(_0x36b5f4,_0x2718be){return db[_0xc113('0x3f')][_0xc113('0x5e')]()[_0xc113('0x22')](respondWithResult(_0x2718be,null))[_0xc113('0x2b')](handleError(_0x2718be,null));};var interaction_log=require(_0xc113('0x16'))('chat-interactions');exports[_0xc113('0x5f')]=function(_0x508499,_0x516c6c,_0xa8ddfe){var _0x228296={'agent':{},'channel':_0xc113('0x60')};if(_0x508499[_0xc113('0x5d')]['id']){delete _0x508499[_0xc113('0x5d')]['id'];}_0x508499[_0xc113('0x5d')]['read']=!![];_0x508499[_0xc113('0x5d')]['readAt']=moment()['format'](_0xc113('0x61'));_0x508499[_0xc113('0x5d')][_0xc113('0x62')]=_0x508499[_0xc113('0x5d')][_0xc113('0x62')]||_0x508499[_0xc113('0x63')]['id'];_0x228296['agent']['id']=_0x508499['body'][_0xc113('0x62')];return db[_0xc113('0x3f')]['find']({'where':{'id':_0x508499[_0xc113('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x516c6c,null))[_0xc113('0x22')](saveUpdates(_0x508499[_0xc113('0x5d')],null))[_0xc113('0x22')](function(_0x388e85){if(_0x388e85){_0x228296[_0xc113('0x28')]=_0x388e85['get']({'plain':!![]});return db[_0xc113('0x64')][_0xc113('0x5b')]({'where':{'id':_0x388e85[_0xc113('0x65')]}});}return null;})[_0xc113('0x22')](handleEntityNotFound(_0x516c6c,null))['then'](function(_0x136948){if(_0x136948){return _0x136948[_0xc113('0x39')]({'UserId':_0x508499[_0xc113('0x5d')]['UserId'],'read1stAt':_[_0xc113('0x66')](_0x136948[_0xc113('0x67')])?moment()[_0xc113('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x160a0a){if(_0x160a0a){_0x228296[_0xc113('0x69')]=_0x160a0a[_0xc113('0x6a')]({'plain':!![]});interaction_log[_0xc113('0x29')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x508499[_0xc113('0x63')]['id'],_0x508499[_0xc113('0x63')][_0xc113('0x3c')],_0x508499['user'][_0xc113('0x6b')],_0x228296[_0xc113('0x69')]['id'],_0x508499[_0xc113('0x5d')]?JSON[_0xc113('0x6c')](_0x508499['body']):_0xc113('0x6d'));return respondWithRpcPromise(_0xc113('0x6e'),'acceptMessage',_0x228296);}return null;})['then'](function(_0x1ed9a6){var _0x428eef=_0xc113('0x6f')+_0x1ed9a6['message']['ContactId'];return db[_0xc113('0x70')][_0xc113('0x44')](_0x428eef,{'type':db[_0xc113('0x71')][_0xc113('0x72')][_0xc113('0x73')],'raw':!![]})[_0xc113('0x22')](function(_0x4c6f2c){return _0x4c6f2c;});})[_0xc113('0x22')](function(_0x4b19d2){if(_0x4b19d2){_0x228296[_0xc113('0x28')][_0xc113('0x74')]=_0x4b19d2[0x0];if(!_0x508499[_0xc113('0x5d')][_0xc113('0x62')])return;return db['User'][_0xc113('0x5b')]({'where':{'id':_0x508499[_0xc113('0x5d')][_0xc113('0x62')],'role':_0xc113('0x75')},'attributes':['id','name','fullname',_0xc113('0x76'),_0xc113('0x77')],'raw':!![]});}return null;})[_0xc113('0x22')](function(_0x562722){if(!_0x562722)return null;_0x228296['message']['agent']=_0x562722;return _0x228296;})['then'](function(_0x2f13ee){if(_0x2f13ee){if(_0x508499[_0xc113('0x5d')][_0xc113('0x78')]){_0x228296['message'][_0xc113('0x79')]=util[_0xc113('0x68')](_0xc113('0x7a'),_0x508499[_0xc113('0x63')]['name']);_0x228296[_0xc113('0x28')][_0xc113('0x7b')]=_0x228296[_0xc113('0x7b')];_0x228296[_0xc113('0x28')][_0xc113('0x7c')]=_0x228296[_0xc113('0x7b')];_0x228296[_0xc113('0x28')]['event']=_0xc113('0x5f');return respondWithRpcPromise(_0xc113('0x7d'),_0xc113('0x7d'),{'event':'acceptmessage','message':_[_0xc113('0x51')](_0x228296[_0xc113('0x28')],JSON['parse'](_0x228296[_0xc113('0x69')][_0xc113('0x7e')]))},client9002)[_0xc113('0x22')](function(){return _0x228296;});}return _0x228296;}return null;})['then'](respondWithResult(_0x516c6c,null))[_0xc113('0x2b')](handleError(_0x516c6c,null));};var interaction_log=require(_0xc113('0x16'))(_0xc113('0x7f'));exports[_0xc113('0x37')]=function(_0x1b3d54,_0xbaca23,_0x47fab7){var _0x22a5ab={'agent':{},'channel':_0xc113('0x60')};if(_0x1b3d54[_0xc113('0x5d')]['id']){delete _0x1b3d54[_0xc113('0x5d')]['id'];}_0x1b3d54[_0xc113('0x5d')][_0xc113('0x62')]=_0x1b3d54[_0xc113('0x5d')][_0xc113('0x62')]||_0x1b3d54[_0xc113('0x63')]['id'];_0x22a5ab[_0xc113('0x75')]['id']=_0x1b3d54[_0xc113('0x5d')]['UserId'];return db[_0xc113('0x3f')][_0xc113('0x5b')]({'where':{'id':_0x1b3d54['params']['id'],'UserId':null}})[_0xc113('0x22')](handleEntityNotFound(_0xbaca23,null))[_0xc113('0x22')](function(_0x17d8b6){if(_0x17d8b6){_0x22a5ab[_0xc113('0x28')]=_0x17d8b6['get']({'plain':!![]});return db['ChatInteraction'][_0xc113('0x5b')]({'where':{'id':_0x17d8b6[_0xc113('0x65')]}});}return null;})[_0xc113('0x22')](handleEntityNotFound(_0xbaca23,null))[_0xc113('0x22')](function(_0x3b7777){if(_0x3b7777){_0x22a5ab[_0xc113('0x69')]=_0x3b7777['get']({'plain':!![]});interaction_log[_0xc113('0x29')](_0xc113('0x80'),_0x1b3d54[_0xc113('0x63')]['id'],_0x1b3d54[_0xc113('0x63')][_0xc113('0x3c')],_0x1b3d54[_0xc113('0x63')]['role'],_0x22a5ab[_0xc113('0x69')]['id'],_0x1b3d54[_0xc113('0x5d')]?JSON[_0xc113('0x6c')](_0x1b3d54[_0xc113('0x5d')]):_0xc113('0x6d'));return respondWithRpcPromise(_0xc113('0x81'),_0xc113('0x82'),_0x22a5ab);}return null;})[_0xc113('0x22')](function(_0x9c583a){var _0xc37a23=_0xc113('0x6f')+_0x9c583a['message'][_0xc113('0x83')];return db[_0xc113('0x70')][_0xc113('0x44')](_0xc37a23,{'type':db['Sequelize'][_0xc113('0x72')]['SELECT'],'raw':!![]})['then'](function(_0x121705){return _0x121705;});})[_0xc113('0x22')](function(_0x4d8086){if(_0x4d8086){_0x22a5ab['message'][_0xc113('0x74')]=_0x4d8086[0x0];if(!_0x1b3d54[_0xc113('0x5d')][_0xc113('0x62')])return;return db[_0xc113('0x84')]['find']({'where':{'id':_0x1b3d54[_0xc113('0x5d')]['UserId'],'role':_0xc113('0x75')},'attributes':['id',_0xc113('0x3c'),_0xc113('0x85'),_0xc113('0x76'),_0xc113('0x77')],'raw':!![]});}return null;})[_0xc113('0x22')](function(_0x5e5bd8){if(!_0x5e5bd8)return null;_0x22a5ab[_0xc113('0x28')][_0xc113('0x75')]=_0x5e5bd8;return _0x22a5ab;})[_0xc113('0x22')](function(_0x145966){if(_0x145966){_0x145966['message'][_0xc113('0x79')]=util[_0xc113('0x68')]('SIP/%s',_0x1b3d54[_0xc113('0x63')]['name']);_0x145966[_0xc113('0x28')]['channel']=_0x22a5ab[_0xc113('0x7b')];_0x145966['message'][_0xc113('0x7c')]=_0x22a5ab[_0xc113('0x7b')];_0x145966[_0xc113('0x28')][_0xc113('0x86')]='reject';respondWithRpcPromise(_0xc113('0x7d'),_0xc113('0x7d'),{'event':_0xc113('0x87'),'message':_[_0xc113('0x51')](_0x22a5ab[_0xc113('0x28')],JSON[_0xc113('0x88')](_0x22a5ab['interaction'][_0xc113('0x7e')]))},client9002);return _0x22a5ab;}return null;})['then'](respondWithResult(_0xbaca23,null))['catch'](handleError(_0xbaca23,null));};
\ No newline at end of file
+var _0xe8f2=['show','rawAttributes','create','body','params','destroy','find','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','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','User','agent','fullname','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT','contact','email','interface','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xe8f2,0x13e));var _0x2e8f=function(_0x515e0f,_0x51d3d9){_0x515e0f=_0x515e0f-0x0;var _0x21fef5=_0xe8f2[_0x515e0f];return _0x21fef5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e8f('0x0'));var zipdir=require(_0x2e8f('0x1'));var jsonpatch=require(_0x2e8f('0x2'));var rp=require(_0x2e8f('0x3'));var moment=require(_0x2e8f('0x4'));var BPromise=require(_0x2e8f('0x5'));var Mustache=require(_0x2e8f('0x6'));var util=require('util');var path=require(_0x2e8f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e8f('0x8'));var fs=require('fs');var fs_extra=require(_0x2e8f('0x9'));var _=require(_0x2e8f('0xa'));var squel=require(_0x2e8f('0xb'));var crypto=require(_0x2e8f('0xc'));var jsforce=require(_0x2e8f('0xd'));var deskjs=require(_0x2e8f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e8f('0xf'));var Redis=require(_0x2e8f('0x10'));var authService=require(_0x2e8f('0x11'));var qs=require(_0x2e8f('0x12'));var as=require(_0x2e8f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e8f('0x14'))('api');var utils=require(_0x2e8f('0x15'));var config=require(_0x2e8f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e8f('0x17'))['db'];config['redis']=_[_0x2e8f('0x18')](config[_0x2e8f('0x19')],{'host':_0x2e8f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e8f('0x19')]));require(_0x2e8f('0x1b'))[_0x2e8f('0x1c')](socket);var jayson=require(_0x2e8f('0x1d'));var client=jayson[_0x2e8f('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x2e8f('0x1e')][_0x2e8f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x268021,_0x3dc296,_0x1f83c9,_0xe45875){return new BPromise(function(_0x219b71,_0x449401){var _0x4c0c88=_0xe45875||client;return _0x4c0c88[_0x2e8f('0x20')](_0x268021,_0x1f83c9)[_0x2e8f('0x21')](function(_0x5d5a48){logger[_0x2e8f('0x22')]('ChatMessage,\x20%s,\x20%s',_0x3dc296,_0x2e8f('0x23'));logger[_0x2e8f('0x24')](_0x2e8f('0x25'),_0x3dc296,'request\x20sent',JSON[_0x2e8f('0x26')](_0x5d5a48));if(_0x5d5a48[_0x2e8f('0x27')]){if(_0x5d5a48[_0x2e8f('0x27')][_0x2e8f('0x28')]===0x1f4){logger[_0x2e8f('0x27')](_0x2e8f('0x29'),_0x3dc296,_0x5d5a48[_0x2e8f('0x27')][_0x2e8f('0x2a')]);return _0x449401(_0x5d5a48[_0x2e8f('0x27')][_0x2e8f('0x2a')]);}logger[_0x2e8f('0x27')](_0x2e8f('0x29'),_0x3dc296,_0x5d5a48[_0x2e8f('0x27')][_0x2e8f('0x2a')]);return _0x219b71(_0x5d5a48['error'][_0x2e8f('0x2a')]);}else{logger[_0x2e8f('0x22')]('ChatMessage,\x20%s,\x20%s',_0x3dc296,_0x2e8f('0x23'));_0x219b71(_0x5d5a48[_0x2e8f('0x2b')]['message']);}})['catch'](function(_0x96402){logger[_0x2e8f('0x27')](_0x2e8f('0x29'),_0x3dc296,_0x96402);_0x449401(_0x96402);});});}function respondWithStatusCode(_0x28612b,_0x545b61){_0x545b61=_0x545b61||0xcc;return function(_0x5eb9db){if(_0x5eb9db){return _0x28612b[_0x2e8f('0x2c')](_0x545b61);}return _0x28612b[_0x2e8f('0x2d')](_0x545b61)[_0x2e8f('0x2e')]();};}function respondWithResult(_0x479826,_0x25489c){_0x25489c=_0x25489c||0xc8;return function(_0x46909b){if(_0x46909b){return _0x479826[_0x2e8f('0x2d')](_0x25489c)[_0x2e8f('0x2f')](_0x46909b);}};}function respondWithFilteredResult(_0x5c32ea,_0x19b36d){return function(_0x350333){if(_0x350333){var _0x165211=typeof _0x19b36d['offset']===_0x2e8f('0x30')&&typeof _0x19b36d[_0x2e8f('0x31')]===_0x2e8f('0x30');var _0x5da375=_0x350333[_0x2e8f('0x32')];var _0x27463d=_0x165211?0x0:_0x19b36d[_0x2e8f('0x33')];var _0x4cfdf5=_0x165211?_0x350333[_0x2e8f('0x32')]:_0x19b36d[_0x2e8f('0x33')]+_0x19b36d[_0x2e8f('0x31')];var _0xe89776;if(_0x4cfdf5>=_0x5da375){_0x4cfdf5=_0x5da375;_0xe89776=0xc8;}else{_0xe89776=0xce;}_0x5c32ea['status'](_0xe89776);return _0x5c32ea[_0x2e8f('0x34')](_0x2e8f('0x35'),_0x27463d+'-'+_0x4cfdf5+'/'+_0x5da375)[_0x2e8f('0x2f')](_0x350333);}return null;};}function patchUpdates(_0x15f6d4){return function(_0x2dbe5b){try{jsonpatch[_0x2e8f('0x36')](_0x2dbe5b,_0x15f6d4,!![]);}catch(_0x235108){return BPromise[_0x2e8f('0x37')](_0x235108);}return _0x2dbe5b['save']();};}function saveUpdates(_0x5317c3,_0x43b2d2){return function(_0x2e4d3b){if(_0x2e4d3b){return _0x2e4d3b[_0x2e8f('0x38')](_0x5317c3)[_0x2e8f('0x21')](function(_0x4d47eb){return _0x4d47eb;});}return null;};}function removeEntity(_0xdb0029,_0x265305){return function(_0x561fe4){if(_0x561fe4){return _0x561fe4['destroy']()[_0x2e8f('0x21')](function(){_0xdb0029[_0x2e8f('0x2d')](0xcc)[_0x2e8f('0x2e')]();});}};}function handleEntityNotFound(_0x425057,_0x57f3d7){return function(_0x123b1d){if(!_0x123b1d){_0x425057[_0x2e8f('0x2c')](0x194);}return _0x123b1d;};}function handleError(_0x5183d3,_0x51630e){_0x51630e=_0x51630e||0x1f4;return function(_0x58dd9b){logger[_0x2e8f('0x27')](_0x58dd9b['stack']);if(_0x58dd9b[_0x2e8f('0x39')]){delete _0x58dd9b['name'];}_0x5183d3[_0x2e8f('0x2d')](_0x51630e)[_0x2e8f('0x3a')](_0x58dd9b);};}exports[_0x2e8f('0x3b')]=function(_0x378836,_0x33169c){var _0x1c87ff={},_0x49d779={},_0x2def92={'count':0x0,'rows':[]};var _0x2d4576=_[_0x2e8f('0x3c')](db[_0x2e8f('0x3d')]['rawAttributes'],function(_0x354398){return{'name':_0x354398[_0x2e8f('0x3e')],'type':_0x354398[_0x2e8f('0x3f')][_0x2e8f('0x40')]};});_0x49d779[_0x2e8f('0x41')]=_['map'](_0x2d4576,'name');_0x49d779[_0x2e8f('0x42')]=_[_0x2e8f('0x43')](_0x378836[_0x2e8f('0x42')]);_0x49d779[_0x2e8f('0x44')]=_[_0x2e8f('0x45')](_0x49d779[_0x2e8f('0x41')],_0x49d779['query']);_0x1c87ff[_0x2e8f('0x46')]=_['intersection'](_0x49d779['model'],qs[_0x2e8f('0x47')](_0x378836[_0x2e8f('0x42')][_0x2e8f('0x47')]));_0x1c87ff['attributes']=_0x1c87ff['attributes'][_0x2e8f('0x48')]?_0x1c87ff[_0x2e8f('0x46')]:_0x49d779[_0x2e8f('0x41')];if(!_0x378836[_0x2e8f('0x42')]['hasOwnProperty'](_0x2e8f('0x49'))){_0x1c87ff[_0x2e8f('0x31')]=qs[_0x2e8f('0x31')](_0x378836['query']['limit']);_0x1c87ff[_0x2e8f('0x33')]=qs[_0x2e8f('0x33')](_0x378836[_0x2e8f('0x42')]['offset']);}_0x1c87ff['order']=qs[_0x2e8f('0x4a')](_0x378836[_0x2e8f('0x42')][_0x2e8f('0x4a')]);_0x1c87ff[_0x2e8f('0x4b')]=qs[_0x2e8f('0x44')](_['pick'](_0x378836[_0x2e8f('0x42')],_0x49d779[_0x2e8f('0x44')]),_0x2d4576);if(_0x378836[_0x2e8f('0x42')][_0x2e8f('0x4c')]){_0x1c87ff['where']=_[_0x2e8f('0x4d')](_0x1c87ff[_0x2e8f('0x4b')],{'$or':_['map'](_0x2d4576,function(_0x357299){if(_0x357299[_0x2e8f('0x3f')]!==_0x2e8f('0x4e')){var _0x2fe2bb={};_0x2fe2bb[_0x357299[_0x2e8f('0x39')]]={'$like':'%'+_0x378836[_0x2e8f('0x42')][_0x2e8f('0x4c')]+'%'};return _0x2fe2bb;}})});}_0x1c87ff=_[_0x2e8f('0x4d')]({},_0x1c87ff,_0x378836[_0x2e8f('0x4f')]);var _0x24690e={'where':_0x1c87ff[_0x2e8f('0x4b')]};return db[_0x2e8f('0x3d')][_0x2e8f('0x32')](_0x24690e)[_0x2e8f('0x21')](function(_0x3b69d4){_0x2def92['count']=_0x3b69d4;if(_0x378836[_0x2e8f('0x42')][_0x2e8f('0x50')]){_0x1c87ff[_0x2e8f('0x51')]=[{'all':!![]}];}return db['ChatMessage'][_0x2e8f('0x52')](_0x1c87ff);})['then'](function(_0x28b465){_0x2def92['rows']=_0x28b465;return _0x2def92;})[_0x2e8f('0x21')](respondWithFilteredResult(_0x33169c,_0x1c87ff))[_0x2e8f('0x53')](handleError(_0x33169c,null));};exports[_0x2e8f('0x54')]=function(_0x3dc518,_0x357cc3){var _0x379fe0={'raw':!![],'where':{'id':_0x3dc518['params']['id']}},_0x5327c5={};_0x5327c5[_0x2e8f('0x41')]=_[_0x2e8f('0x43')](db[_0x2e8f('0x3d')][_0x2e8f('0x55')]);_0x5327c5[_0x2e8f('0x42')]=_[_0x2e8f('0x43')](_0x3dc518['query']);_0x5327c5[_0x2e8f('0x44')]=_[_0x2e8f('0x45')](_0x5327c5['model'],_0x5327c5[_0x2e8f('0x42')]);_0x379fe0[_0x2e8f('0x46')]=_[_0x2e8f('0x45')](_0x5327c5[_0x2e8f('0x41')],qs[_0x2e8f('0x47')](_0x3dc518[_0x2e8f('0x42')][_0x2e8f('0x47')]));_0x379fe0['attributes']=_0x379fe0[_0x2e8f('0x46')][_0x2e8f('0x48')]?_0x379fe0[_0x2e8f('0x46')]:_0x5327c5[_0x2e8f('0x41')];if(_0x3dc518['query'][_0x2e8f('0x50')]){_0x379fe0[_0x2e8f('0x51')]=[{'all':!![]}];}_0x379fe0=_[_0x2e8f('0x4d')]({},_0x379fe0,_0x3dc518[_0x2e8f('0x4f')]);return db[_0x2e8f('0x3d')]['find'](_0x379fe0)['then'](handleEntityNotFound(_0x357cc3,null))[_0x2e8f('0x21')](respondWithResult(_0x357cc3,null))[_0x2e8f('0x53')](handleError(_0x357cc3,null));};exports[_0x2e8f('0x56')]=function(_0x5b4cab,_0x32ca3c){return db[_0x2e8f('0x3d')][_0x2e8f('0x56')](_0x5b4cab[_0x2e8f('0x57')],{})[_0x2e8f('0x21')](respondWithResult(_0x32ca3c,0xc9))['catch'](handleError(_0x32ca3c,null));};exports[_0x2e8f('0x38')]=function(_0x1bbef6,_0x33c66c){if(_0x1bbef6[_0x2e8f('0x57')]['id']){delete _0x1bbef6[_0x2e8f('0x57')]['id'];}return db[_0x2e8f('0x3d')]['find']({'where':{'id':_0x1bbef6[_0x2e8f('0x58')]['id']}})['then'](handleEntityNotFound(_0x33c66c,null))[_0x2e8f('0x21')](saveUpdates(_0x1bbef6[_0x2e8f('0x57')],null))[_0x2e8f('0x21')](respondWithResult(_0x33c66c,null))[_0x2e8f('0x53')](handleError(_0x33c66c,null));};exports[_0x2e8f('0x59')]=function(_0x38dd6e,_0x275448){return db[_0x2e8f('0x3d')][_0x2e8f('0x5a')]({'where':{'id':_0x38dd6e[_0x2e8f('0x58')]['id']}})[_0x2e8f('0x21')](handleEntityNotFound(_0x275448,null))['then'](removeEntity(_0x275448,null))[_0x2e8f('0x53')](handleError(_0x275448,null));};exports['describe']=function(_0x30f131,_0x2552dd){return db[_0x2e8f('0x3d')][_0x2e8f('0x5b')]()[_0x2e8f('0x21')](respondWithResult(_0x2552dd,null))[_0x2e8f('0x53')](handleError(_0x2552dd,null));};var interaction_log=require(_0x2e8f('0x14'))('chat-interactions');exports[_0x2e8f('0x5c')]=function(_0x52aeb9,_0x8267f4,_0x42772d){var _0xd82df={'agent':{},'channel':_0x2e8f('0x5d')};if(_0x52aeb9['body']['id']){delete _0x52aeb9[_0x2e8f('0x57')]['id'];}_0x52aeb9['body'][_0x2e8f('0x5e')]=!![];_0x52aeb9['body'][_0x2e8f('0x5f')]=moment()['format'](_0x2e8f('0x60'));_0x52aeb9[_0x2e8f('0x57')][_0x2e8f('0x61')]=_0x52aeb9['body'][_0x2e8f('0x61')]||_0x52aeb9[_0x2e8f('0x62')]['id'];_0xd82df['agent']['id']=_0x52aeb9[_0x2e8f('0x57')][_0x2e8f('0x61')];return db['ChatMessage'][_0x2e8f('0x5a')]({'where':{'id':_0x52aeb9[_0x2e8f('0x58')]['id'],'UserId':null}})[_0x2e8f('0x21')](handleEntityNotFound(_0x8267f4,null))['then'](saveUpdates(_0x52aeb9['body'],null))[_0x2e8f('0x21')](function(_0x1a8d77){if(_0x1a8d77){_0xd82df[_0x2e8f('0x2a')]=_0x1a8d77['get']({'plain':!![]});return db[_0x2e8f('0x63')][_0x2e8f('0x5a')]({'where':{'id':_0x1a8d77[_0x2e8f('0x64')]}});}return null;})[_0x2e8f('0x21')](handleEntityNotFound(_0x8267f4,null))[_0x2e8f('0x21')](function(_0x5b8825){if(_0x5b8825){return _0x5b8825[_0x2e8f('0x38')]({'UserId':_0x52aeb9[_0x2e8f('0x57')][_0x2e8f('0x61')],'read1stAt':_[_0x2e8f('0x65')](_0x5b8825['read1stAt'])?moment()[_0x2e8f('0x66')](_0x2e8f('0x60')):undefined});}return null;})[_0x2e8f('0x21')](function(_0x3d3ff6){if(_0x3d3ff6){_0xd82df[_0x2e8f('0x67')]=_0x3d3ff6['get']({'plain':!![]});interaction_log[_0x2e8f('0x22')](_0x2e8f('0x68'),_0x52aeb9[_0x2e8f('0x62')]['id'],_0x52aeb9[_0x2e8f('0x62')][_0x2e8f('0x39')],_0x52aeb9[_0x2e8f('0x62')]['role'],_0xd82df[_0x2e8f('0x67')]['id'],_0x52aeb9['body']?JSON[_0x2e8f('0x26')](_0x52aeb9[_0x2e8f('0x57')]):_0x2e8f('0x69'));return respondWithRpcPromise(_0x2e8f('0x6a'),_0x2e8f('0x6b'),_0xd82df);}return null;})[_0x2e8f('0x21')](function(_0x57ee6c){var _0x1bcc85=_0x2e8f('0x6c')+_0x57ee6c[_0x2e8f('0x2a')][_0x2e8f('0x6d')];return db[_0x2e8f('0x6e')][_0x2e8f('0x42')](_0x1bcc85,{'type':db[_0x2e8f('0x6f')][_0x2e8f('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x38490c){return _0x38490c;});})[_0x2e8f('0x21')](function(_0x55a3e2){if(_0x55a3e2){_0xd82df[_0x2e8f('0x2a')]['contact']=_0x55a3e2[0x0];if(!_0x52aeb9[_0x2e8f('0x57')][_0x2e8f('0x61')])return;return db[_0x2e8f('0x71')]['find']({'where':{'id':_0x52aeb9[_0x2e8f('0x57')][_0x2e8f('0x61')],'role':_0x2e8f('0x72')},'attributes':['id','name',_0x2e8f('0x73'),'email',_0x2e8f('0x74')],'raw':!![]});}return null;})['then'](function(_0x407c92){if(!_0x407c92)return null;_0xd82df[_0x2e8f('0x2a')][_0x2e8f('0x72')]=_0x407c92;return _0xd82df;})[_0x2e8f('0x21')](function(_0x8fa2c2){if(_0x8fa2c2){if(_0x52aeb9['body'][_0x2e8f('0x75')]){_0xd82df['message']['interface']=util[_0x2e8f('0x66')](_0x2e8f('0x76'),_0x52aeb9[_0x2e8f('0x62')][_0x2e8f('0x39')]);_0xd82df[_0x2e8f('0x2a')][_0x2e8f('0x77')]=_0xd82df[_0x2e8f('0x77')];_0xd82df[_0x2e8f('0x2a')]['motionChannel']=_0xd82df[_0x2e8f('0x77')];_0xd82df['message'][_0x2e8f('0x78')]='accept';return respondWithRpcPromise(_0x2e8f('0x79'),_0x2e8f('0x79'),{'event':_0x2e8f('0x7a'),'message':_['merge'](_0xd82df[_0x2e8f('0x2a')],JSON[_0x2e8f('0x7b')](_0xd82df[_0x2e8f('0x67')][_0x2e8f('0x7c')]))},client9002)['then'](function(){return _0xd82df;});}return _0xd82df;}return null;})[_0x2e8f('0x21')](respondWithResult(_0x8267f4,null))[_0x2e8f('0x53')](handleError(_0x8267f4,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['reject']=function(_0x1b81f6,_0x39a701,_0x43d763){var _0x3f1dd4={'agent':{},'channel':_0x2e8f('0x5d')};if(_0x1b81f6[_0x2e8f('0x57')]['id']){delete _0x1b81f6[_0x2e8f('0x57')]['id'];}_0x1b81f6['body'][_0x2e8f('0x61')]=_0x1b81f6[_0x2e8f('0x57')][_0x2e8f('0x61')]||_0x1b81f6[_0x2e8f('0x62')]['id'];_0x3f1dd4[_0x2e8f('0x72')]['id']=_0x1b81f6[_0x2e8f('0x57')]['UserId'];return db[_0x2e8f('0x3d')]['find']({'where':{'id':_0x1b81f6[_0x2e8f('0x58')]['id'],'UserId':null}})[_0x2e8f('0x21')](handleEntityNotFound(_0x39a701,null))[_0x2e8f('0x21')](function(_0x5e7042){if(_0x5e7042){_0x3f1dd4[_0x2e8f('0x2a')]=_0x5e7042['get']({'plain':!![]});return db[_0x2e8f('0x63')][_0x2e8f('0x5a')]({'where':{'id':_0x5e7042[_0x2e8f('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x39a701,null))[_0x2e8f('0x21')](function(_0x468b89){if(_0x468b89){_0x3f1dd4['interaction']=_0x468b89[_0x2e8f('0x7d')]({'plain':!![]});interaction_log[_0x2e8f('0x22')](_0x2e8f('0x7e'),_0x1b81f6[_0x2e8f('0x62')]['id'],_0x1b81f6['user'][_0x2e8f('0x39')],_0x1b81f6[_0x2e8f('0x62')][_0x2e8f('0x7f')],_0x3f1dd4[_0x2e8f('0x67')]['id'],_0x1b81f6[_0x2e8f('0x57')]?JSON[_0x2e8f('0x26')](_0x1b81f6[_0x2e8f('0x57')]):'null');return respondWithRpcPromise(_0x2e8f('0x80'),'rejectMessage',_0x3f1dd4);}return null;})[_0x2e8f('0x21')](function(_0x9bc36f){var _0x5ee444=_0x2e8f('0x6c')+_0x9bc36f[_0x2e8f('0x2a')][_0x2e8f('0x6d')];return db['sequelize'][_0x2e8f('0x42')](_0x5ee444,{'type':db['Sequelize'][_0x2e8f('0x70')][_0x2e8f('0x81')],'raw':!![]})[_0x2e8f('0x21')](function(_0x1d4ec1){return _0x1d4ec1;});})[_0x2e8f('0x21')](function(_0x18b8c4){if(_0x18b8c4){_0x3f1dd4[_0x2e8f('0x2a')][_0x2e8f('0x82')]=_0x18b8c4[0x0];if(!_0x1b81f6['body'][_0x2e8f('0x61')])return;return db['User'][_0x2e8f('0x5a')]({'where':{'id':_0x1b81f6[_0x2e8f('0x57')][_0x2e8f('0x61')],'role':'agent'},'attributes':['id',_0x2e8f('0x39'),'fullname',_0x2e8f('0x83'),_0x2e8f('0x74')],'raw':!![]});}return null;})[_0x2e8f('0x21')](function(_0x390b2b){if(!_0x390b2b)return null;_0x3f1dd4['message']['agent']=_0x390b2b;return _0x3f1dd4;})['then'](function(_0x2c3e51){if(_0x2c3e51){_0x2c3e51[_0x2e8f('0x2a')][_0x2e8f('0x84')]=util[_0x2e8f('0x66')](_0x2e8f('0x76'),_0x1b81f6[_0x2e8f('0x62')][_0x2e8f('0x39')]);_0x2c3e51[_0x2e8f('0x2a')][_0x2e8f('0x77')]=_0x3f1dd4['channel'];_0x2c3e51['message']['motionChannel']=_0x3f1dd4[_0x2e8f('0x77')];_0x2c3e51[_0x2e8f('0x2a')][_0x2e8f('0x78')]='reject';respondWithRpcPromise(_0x2e8f('0x79'),'EventManager',{'event':_0x2e8f('0x85'),'message':_[_0x2e8f('0x4d')](_0x3f1dd4[_0x2e8f('0x2a')],JSON[_0x2e8f('0x7b')](_0x3f1dd4[_0x2e8f('0x67')][_0x2e8f('0x7c')]))},client9002);return _0x3f1dd4;}return null;})[_0x2e8f('0x21')](respondWithResult(_0x39a701,null))['catch'](handleError(_0x39a701,null));};
\ No newline at end of file
index 3122b39..5b14fcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf107=['hook','exports','events','../../mysqldb','setMaxListeners','hasOwnProperty'];(function(_0x303dc2,_0x52b8cc){var _0x3f6b30=function(_0x32dbe7){while(--_0x32dbe7){_0x303dc2['push'](_0x303dc2['shift']());}};_0x3f6b30(++_0x52b8cc);}(_0xf107,0x188));var _0x7f10=function(_0xb26f5c,_0x547323){_0xb26f5c=_0xb26f5c-0x0;var _0x54656f=_0xf107[_0xb26f5c];return _0x54656f;};'use strict';var EventEmitter=require(_0x7f10('0x0'));var ChatMessage=require(_0x7f10('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7f10('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x271663){return function(_0x2b1482,_0x43aa12,_0x10032b){ChatMessageEvents['emit'](_0x271663+':'+_0x2b1482['id'],_0x2b1482);ChatMessageEvents['emit'](_0x271663,_0x2b1482);_0x10032b(null);};}for(var e in events){if(events[_0x7f10('0x3')](e)){var event=events[e];ChatMessage[_0x7f10('0x4')](e,emitEvent(event));}}module[_0x7f10('0x5')]=ChatMessageEvents;
\ No newline at end of file
+var _0xc141=['hasOwnProperty','hook','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x304a82,_0xd30762){var _0x3b6602=function(_0x4c296c){while(--_0x4c296c){_0x304a82['push'](_0x304a82['shift']());}};_0x3b6602(++_0xd30762);}(_0xc141,0xca));var _0x1c14=function(_0x1c60ef,_0x51da79){_0x1c60ef=_0x1c60ef-0x0;var _0x5b6b80=_0xc141[_0x1c60ef];return _0x5b6b80;};'use strict';var EventEmitter=require(_0x1c14('0x0'));var ChatMessage=require(_0x1c14('0x1'))['db'][_0x1c14('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1c14('0x3')](0x0);var events={'afterCreate':_0x1c14('0x4'),'afterUpdate':_0x1c14('0x5'),'afterDestroy':_0x1c14('0x6')};function emitEvent(_0x277227){return function(_0x589f4c,_0x3ac20b,_0x2897ce){ChatMessageEvents[_0x1c14('0x7')](_0x277227+':'+_0x589f4c['id'],_0x589f4c);ChatMessageEvents[_0x1c14('0x7')](_0x277227,_0x589f4c);_0x2897ce(null);};}for(var e in events){if(events[_0x1c14('0x8')](e)){var event=events[e];ChatMessage[_0x1c14('0x9')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index 02b3454..df224ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a7b=['exports','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','./chatMessage.attributes'];(function(_0x2602f9,_0x348d18){var _0x39316f=function(_0x576a51){while(--_0x576a51){_0x2602f9['push'](_0x2602f9['shift']());}};_0x39316f(++_0x348d18);}(_0x3a7b,0x1e8));var _0xb3a7=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3a7b[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0xb3a7('0x0'));var logger=require(_0xb3a7('0x1'))(_0xb3a7('0x2'));var moment=require('moment');var BPromise=require(_0xb3a7('0x3'));var rp=require(_0xb3a7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb3a7('0x5'));module[_0xb3a7('0x6')]=function(_0x1bdc02,_0x1ad1bc){return _0x1bdc02['define'](_0xb3a7('0x7'),attributes,{'tableName':_0xb3a7('0x8'),'paranoid':![],'indexes':[{'name':_0xb3a7('0x9'),'fields':[_0xb3a7('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x55e21d,_0x35c7b8,_0x53058d){var _0x50bd12=_0x1bdc02[_0xb3a7('0xb')];var _0x10bfa6=_0x55e21d[_0xb3a7('0xc')]({'plain':!![]});if(_0x10bfa6['direction']['toLowerCase']()==='in'||_0x10bfa6[_0xb3a7('0xd')][_0xb3a7('0xe')]()===_0xb3a7('0xf')&&!_0x10bfa6[_0xb3a7('0x10')]&&!_['isNil'](_0x10bfa6[_0xb3a7('0x11')])){_0x50bd12[_0xb3a7('0x12')]['findOne']({'where':{'id':_0x10bfa6['ChatInteractionId']}})[_0xb3a7('0x13')](function(_0x45181f){if(_0x45181f){_0x45181f[_0xb3a7('0x14')]({'lastMsgAt':_0x10bfa6[_0xb3a7('0x15')],'lastMsgDirection':_0x10bfa6[_0xb3a7('0xd')][_0xb3a7('0xe')]()});}})[_0xb3a7('0x16')](function(_0x32f489){console[_0xb3a7('0x17')](_0x32f489);});}_0x53058d();}},'charset':_0xb3a7('0x18'),'collate':_0xb3a7('0x19')});};
\ No newline at end of file
+var _0x4215=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4215,0x6e));var _0x5421=function(_0x3c0557,_0x18e165){_0x3c0557=_0x3c0557-0x0;var _0x470262=_0x4215[_0x3c0557];return _0x470262;};'use strict';var _=require(_0x5421('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5421('0x1'));var moment=require(_0x5421('0x2'));var BPromise=require(_0x5421('0x3'));var rp=require(_0x5421('0x4'));var fs=require('fs');var path=require(_0x5421('0x5'));var rimraf=require(_0x5421('0x6'));var config=require(_0x5421('0x7'));var attributes=require('./chatMessage.attributes');module[_0x5421('0x8')]=function(_0x5eb17f,_0x452801){return _0x5eb17f['define'](_0x5421('0x9'),attributes,{'tableName':_0x5421('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x5421('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4af061,_0x2bfa92,_0x59556b){var _0x6cc24f=_0x5eb17f[_0x5421('0xc')];var _0x308794=_0x4af061[_0x5421('0xd')]({'plain':!![]});if(_0x308794[_0x5421('0xe')][_0x5421('0xf')]()==='in'||_0x308794['direction'][_0x5421('0xf')]()===_0x5421('0x10')&&!_0x308794[_0x5421('0x11')]&&!_['isNil'](_0x308794[_0x5421('0x12')])){_0x6cc24f[_0x5421('0x13')]['findOne']({'where':{'id':_0x308794[_0x5421('0x14')]}})[_0x5421('0x15')](function(_0x452ad2){if(_0x452ad2){_0x452ad2[_0x5421('0x16')]({'lastMsgAt':_0x308794[_0x5421('0x17')],'lastMsgDirection':_0x308794['direction'][_0x5421('0xf')]()});}})[_0x5421('0x18')](function(_0xbe0c37){console[_0x5421('0x19')](_0xbe0c37);});}_0x59556b();}},'charset':_0x5421('0x1a'),'collate':_0x5421('0x1b')});};
\ No newline at end of file
index c95148e..8643e18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe314=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe314,0x7c));var _0x4e31=function(_0x7791d4,_0x4e649a){_0x7791d4=_0x7791d4-0x0;var _0xdf4ba9=_0xe314[_0x7791d4];return _0xdf4ba9;};'use strict';var _=require('lodash');var util=require(_0x4e31('0x0'));var moment=require(_0x4e31('0x1'));var BPromise=require(_0x4e31('0x2'));var rs=require(_0x4e31('0x3'));var fs=require('fs');var Redis=require(_0x4e31('0x4'));var db=require(_0x4e31('0x5'))['db'];var utils=require(_0x4e31('0x6'));var logger=require(_0x4e31('0x7'))(_0x4e31('0x8'));var config=require(_0x4e31('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4e31('0xa')]({'port':0x232a});config[_0x4e31('0xb')]=_[_0x4e31('0xc')](config[_0x4e31('0xb')],{'host':_0x4e31('0xd'),'port':0x18eb});var socket=require(_0x4e31('0xe'))(new Redis(config['redis']));require(_0x4e31('0xf'))[_0x4e31('0x10')](socket);function respondWithRpcPromise(_0x1c5ba0,_0x412fbe,_0x4e822f){return new BPromise(function(_0x36389d,_0xd0bbe0){return client[_0x4e31('0x11')](_0x1c5ba0,_0x4e822f)[_0x4e31('0x12')](function(_0x16405c){logger[_0x4e31('0x13')](_0x4e31('0x14'),_0x412fbe,_0x4e31('0x15'));logger[_0x4e31('0x16')](_0x4e31('0x17'),_0x412fbe,_0x4e31('0x15'),JSON[_0x4e31('0x18')](_0x16405c));if(_0x16405c[_0x4e31('0x19')]){if(_0x16405c[_0x4e31('0x19')][_0x4e31('0x1a')]===0x1f4){logger[_0x4e31('0x19')](_0x4e31('0x14'),_0x412fbe,_0x16405c[_0x4e31('0x19')]['message']);return _0xd0bbe0(_0x16405c[_0x4e31('0x19')][_0x4e31('0x1b')]);}logger['error'](_0x4e31('0x14'),_0x412fbe,_0x16405c[_0x4e31('0x19')][_0x4e31('0x1b')]);return _0x36389d(_0x16405c['error'][_0x4e31('0x1b')]);}else{logger[_0x4e31('0x13')](_0x4e31('0x14'),_0x412fbe,'request\x20sent');_0x36389d(_0x16405c[_0x4e31('0x1c')][_0x4e31('0x1b')]);}})[_0x4e31('0x1d')](function(_0x5b7670){logger[_0x4e31('0x19')](_0x4e31('0x14'),_0x412fbe,_0x5b7670);_0xd0bbe0(_0x5b7670);});});}exports['CreateChatMessage']=function(_0x496dad){var _0xba444d=this;return new Promise(function(_0x248bae,_0x38dd6c){return db[_0x4e31('0x1e')][_0x4e31('0x1f')](_0x496dad[_0x4e31('0x20')],{'raw':_0x496dad[_0x4e31('0x21')]?_0x496dad['options'][_0x4e31('0x22')]===undefined?!![]:![]:!![]})[_0x4e31('0x12')](function(_0x240d19){logger['info'](_0x4e31('0x23'),_0x496dad);logger[_0x4e31('0x16')](_0x4e31('0x23'),_0x496dad,JSON[_0x4e31('0x18')](_0x240d19));_0x248bae(_0x240d19);})[_0x4e31('0x1d')](function(_0x5d8438){logger[_0x4e31('0x19')](_0x4e31('0x23'),_0x5d8438[_0x4e31('0x1b')],_0x496dad);_0x38dd6c(_0xba444d['error'](0x1f4,_0x5d8438[_0x4e31('0x1b')]));});});};
\ No newline at end of file
+var _0x17b9=['defaults','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','redis'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0x17b9,0xd6));var _0x917b=function(_0x2e05a4,_0x1da80f){_0x2e05a4=_0x2e05a4-0x0;var _0x51da7e=_0x17b9[_0x2e05a4];return _0x51da7e;};'use strict';var _=require(_0x917b('0x0'));var util=require(_0x917b('0x1'));var moment=require('moment');var BPromise=require(_0x917b('0x2'));var rs=require(_0x917b('0x3'));var fs=require('fs');var Redis=require(_0x917b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x917b('0x5'));var logger=require('../../config/logger')(_0x917b('0x6'));var config=require(_0x917b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x917b('0x8')]({'port':0x232a});config[_0x917b('0x9')]=_[_0x917b('0xa')](config[_0x917b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x917b('0xb'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x917b('0xc')](socket);function respondWithRpcPromise(_0xe48286,_0x37439a,_0x37e2b9){return new BPromise(function(_0x2461d5,_0x108068){return client[_0x917b('0xd')](_0xe48286,_0x37e2b9)[_0x917b('0xe')](function(_0x23f914){logger['info'](_0x917b('0xf'),_0x37439a,_0x917b('0x10'));logger[_0x917b('0x11')](_0x917b('0x12'),_0x37439a,_0x917b('0x10'),JSON['stringify'](_0x23f914));if(_0x23f914['error']){if(_0x23f914[_0x917b('0x13')][_0x917b('0x14')]===0x1f4){logger[_0x917b('0x13')](_0x917b('0xf'),_0x37439a,_0x23f914[_0x917b('0x13')]['message']);return _0x108068(_0x23f914['error'][_0x917b('0x15')]);}logger[_0x917b('0x13')]('ChatMessage,\x20%s,\x20%s',_0x37439a,_0x23f914[_0x917b('0x13')][_0x917b('0x15')]);return _0x2461d5(_0x23f914[_0x917b('0x13')][_0x917b('0x15')]);}else{logger[_0x917b('0x16')](_0x917b('0xf'),_0x37439a,_0x917b('0x10'));_0x2461d5(_0x23f914[_0x917b('0x17')][_0x917b('0x15')]);}})['catch'](function(_0x415d75){logger['error'](_0x917b('0xf'),_0x37439a,_0x415d75);_0x108068(_0x415d75);});});}exports[_0x917b('0x18')]=function(_0x2f94e3){var _0x1d3df7=this;return new Promise(function(_0x57a4b7,_0x5055d0){return db[_0x917b('0x19')][_0x917b('0x1a')](_0x2f94e3[_0x917b('0x1b')],{'raw':_0x2f94e3[_0x917b('0x1c')]?_0x2f94e3[_0x917b('0x1c')][_0x917b('0x1d')]===undefined?!![]:![]:!![]})[_0x917b('0xe')](function(_0x3462d7){logger[_0x917b('0x16')](_0x917b('0x18'),_0x2f94e3);logger[_0x917b('0x11')]('CreateChatMessage',_0x2f94e3,JSON[_0x917b('0x1e')](_0x3462d7));_0x57a4b7(_0x3462d7);})[_0x917b('0x1f')](function(_0x4f51dd){logger[_0x917b('0x13')](_0x917b('0x18'),_0x4f51dd[_0x917b('0x15')],_0x2f94e3);_0x5055d0(_0x1d3df7[_0x917b('0x13')](0x1f4,_0x4f51dd['message']));});});};
\ No newline at end of file
index 1bcb7f6..8c6d19a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19da=['update','register','length','save'];(function(_0x223184,_0x5cecd4){var _0x41c39c=function(_0x3d51a1){while(--_0x3d51a1){_0x223184['push'](_0x223184['shift']());}};_0x41c39c(++_0x5cecd4);}(_0x19da,0x9f));var _0xa19d=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x19da[_0x3ce2c4];return _0x4047c1;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa19d('0x0'),'remove',_0xa19d('0x1')];function createListener(_0x5ba569,_0x3a48f4){return function(_0x17f1c6){_0x3a48f4['emit'](_0x5ba569,_0x17f1c6);};}function removeListener(_0x179db7,_0x28ec9a){return function(){ChatMessageEvents['removeListener'](_0x179db7,_0x28ec9a);};}exports[_0xa19d('0x2')]=function(_0x330adb){for(var _0x1f6e10=0x0,_0x14dc68=events[_0xa19d('0x3')];_0x1f6e10<_0x14dc68;_0x1f6e10++){var _0x4b4627=events[_0x1f6e10];var _0x197c4e=createListener('chatMessage:'+_0x4b4627,_0x330adb);ChatMessageEvents['on'](_0x4b4627,_0x197c4e);}};
\ No newline at end of file
+var _0x7b27=['update','emit','removeListener','register','length','./chatMessage.events','remove'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x7b27,0x186));var _0x77b2=function(_0x111439,_0xcd8186){_0x111439=_0x111439-0x0;var _0x4918d0=_0x7b27[_0x111439];return _0x4918d0;};'use strict';var ChatMessageEvents=require(_0x77b2('0x0'));var events=['save',_0x77b2('0x1'),_0x77b2('0x2')];function createListener(_0x4000dd,_0x2f5a3a){return function(_0x511dfe){_0x2f5a3a[_0x77b2('0x3')](_0x4000dd,_0x511dfe);};}function removeListener(_0x47075b,_0x5e5289){return function(){ChatMessageEvents[_0x77b2('0x4')](_0x47075b,_0x5e5289);};}exports[_0x77b2('0x5')]=function(_0x243b61){for(var _0x569bce=0x0,_0x22bdcf=events[_0x77b2('0x6')];_0x569bce<_0x22bdcf;_0x569bce++){var _0x2f01a2=events[_0x569bce];var _0x1308f7=createListener('chatMessage:'+_0x2f01a2,_0x243b61);ChatMessageEvents['on'](_0x2f01a2,_0x1308f7);}};
\ No newline at end of file
index 6b07554..a2ec7f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc930=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x5d1ae8,_0x1cfb7b){var _0x2e3995=function(_0x4e91d5){while(--_0x4e91d5){_0x5d1ae8['push'](_0x5d1ae8['shift']());}};_0x2e3995(++_0x1cfb7b);}(_0xc930,0x1c2));var _0x0c93=function(_0x557f57,_0x3a076c){_0x557f57=_0x557f57-0x0;var _0x1e8875=_0xc930[_0x557f57];return _0x1e8875;};'use strict';var multer=require(_0x0c93('0x0'));var util=require(_0x0c93('0x1'));var path=require(_0x0c93('0x2'));var timeout=require(_0x0c93('0x3'));var express=require(_0x0c93('0x4'));var router=express[_0x0c93('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0c93('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0c93('0x7'));var controller=require(_0x0c93('0x8'));router[_0x0c93('0x9')]('/',auth[_0x0c93('0xa')](),controller[_0x0c93('0xb')]);router[_0x0c93('0x9')](_0x0c93('0xc'),auth[_0x0c93('0xa')](),controller[_0x0c93('0xd')]);router[_0x0c93('0x9')](_0x0c93('0xe'),auth[_0x0c93('0xa')](),controller['show']);router[_0x0c93('0xf')]('/',auth['isAuthenticated'](),interaction[_0x0c93('0x10')](_0x0c93('0x11'),_0x0c93('0x12')),controller[_0x0c93('0x13')]);router[_0x0c93('0x14')](_0x0c93('0xe'),controller['update']);router[_0x0c93('0x14')](_0x0c93('0x15'),auth[_0x0c93('0xa')](),controller[_0x0c93('0x16')]);router[_0x0c93('0x14')](_0x0c93('0x17'),auth[_0x0c93('0xa')](),controller[_0x0c93('0x18')]);router[_0x0c93('0x19')](_0x0c93('0xe'),auth[_0x0c93('0xa')](),controller[_0x0c93('0x1a')]);module[_0x0c93('0x1b')]=router;
\ No newline at end of file
+var _0x185d=['express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/reject','reject','destroy','exports','multer','util','connect-timeout'];(function(_0x3ba537,_0x56b969){var _0x585c1a=function(_0x1dd30b){while(--_0x1dd30b){_0x3ba537['push'](_0x3ba537['shift']());}};_0x585c1a(++_0x56b969);}(_0x185d,0xb3));var _0xd185=function(_0x3ef4f1,_0x5f0f9b){_0x3ef4f1=_0x3ef4f1-0x0;var _0x69953c=_0x185d[_0x3ef4f1];return _0x69953c;};'use strict';var multer=require(_0xd185('0x0'));var util=require(_0xd185('0x1'));var path=require('path');var timeout=require(_0xd185('0x2'));var express=require(_0xd185('0x3'));var router=express[_0xd185('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd185('0x5'));var config=require(_0xd185('0x6'));var controller=require(_0xd185('0x7'));router['get']('/',auth[_0xd185('0x8')](),controller[_0xd185('0x9')]);router[_0xd185('0xa')](_0xd185('0xb'),auth['isAuthenticated'](),controller[_0xd185('0xc')]);router[_0xd185('0xa')](_0xd185('0xd'),auth['isAuthenticated'](),controller[_0xd185('0xe')]);router[_0xd185('0xf')]('/',auth['isAuthenticated'](),interaction[_0xd185('0x10')](_0xd185('0x11'),_0xd185('0x12')),controller[_0xd185('0x13')]);router[_0xd185('0x14')](_0xd185('0xd'),controller[_0xd185('0x15')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller['accept']);router['put'](_0xd185('0x16'),auth[_0xd185('0x8')](),controller[_0xd185('0x17')]);router['delete']('/:id',auth[_0xd185('0x8')](),controller[_0xd185('0x18')]);module[_0xd185('0x19')]=router;
\ No newline at end of file
index 8d887e9..bfe0131 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['medium','TEXT','exports'];(function(_0x3b3345,_0x2d8e73){var _0x56f3c1=function(_0x1594d6){while(--_0x1594d6){_0x3b3345['push'](_0x3b3345['shift']());}};_0x56f3c1(++_0x2d8e73);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'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 _0xadb5=['medium','TEXT','exports'];(function(_0x5cc109,_0x274a58){var _0x3f396a=function(_0x57f0ed){while(--_0x57f0ed){_0x5cc109['push'](_0x5cc109['shift']());}};_0x3f396a(++_0x274a58);}(_0xadb5,0xad));var _0x5adb=function(_0x247cce,_0x171867){_0x247cce=_0x247cce-0x0;var _0x541809=_0xadb5[_0x247cce];return _0x541809;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
index 297b198..cd3b431 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(_0x43c3f5,_0x588dc2){var _0x3aabe0=function(_0x447d76){while(--_0x447d76){_0x43c3f5['push'](_0x43c3f5['shift']());}};_0x3aabe0(++_0x588dc2);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x7a54,0x106));var _0x47a5=function(_0x2bd8a9,_0x8493f4){_0x2bd8a9=_0x2bd8a9-0x0;var _0x82e911=_0x7a54[_0x2bd8a9];return _0x82e911;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
index 77c6b90..2a22273 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dcf=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0x6dcf,0x114));var _0xf6dc=function(_0x264111,_0x34d234){_0x264111=_0x264111-0x0;var _0x4d4693=_0x6dcf[_0x264111];return _0x4d4693;};'use strict';var EventEmitter=require(_0xf6dc('0x0'));var ChatOfflineMessage=require(_0xf6dc('0x1'))['db'][_0xf6dc('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xf6dc('0x3')](0x0);var events={'afterCreate':_0xf6dc('0x4'),'afterUpdate':'update','afterDestroy':_0xf6dc('0x5')};function emitEvent(_0x2e36c6){return function(_0x40dcbc,_0x5ce64c,_0x38da99){ChatOfflineMessageEvents[_0xf6dc('0x6')](_0x2e36c6+':'+_0x40dcbc['id'],_0x40dcbc);ChatOfflineMessageEvents[_0xf6dc('0x6')](_0x2e36c6,_0x40dcbc);_0x38da99(null);};}for(var e in events){if(events[_0xf6dc('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xf6dc('0x8')](e,emitEvent(event));}}module[_0xf6dc('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x9235=['setMaxListeners','update','emit','hook','events','../../mysqldb','ChatOfflineMessage'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x9235,0xba));var _0x5923=function(_0x1fb9d6,_0xbbe8c6){_0x1fb9d6=_0x1fb9d6-0x0;var _0x44625c=_0x9235[_0x1fb9d6];return _0x44625c;};'use strict';var EventEmitter=require(_0x5923('0x0'));var ChatOfflineMessage=require(_0x5923('0x1'))['db'][_0x5923('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x5923('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5923('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1f3d1b){return function(_0x23f0a2,_0x32c32f,_0xdcfe1a){ChatOfflineMessageEvents['emit'](_0x1f3d1b+':'+_0x23f0a2['id'],_0x23f0a2);ChatOfflineMessageEvents[_0x5923('0x5')](_0x1f3d1b,_0x23f0a2);_0xdcfe1a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x5923('0x6')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
index d6e5e5a..bd74c51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddd7=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x32c83f,_0x4cb2d6){var _0x15e3cd=function(_0xc75568){while(--_0xc75568){_0x32c83f['push'](_0x32c83f['shift']());}};_0x15e3cd(++_0x4cb2d6);}(_0xddd7,0xe0));var _0x7ddd=function(_0x59fb47,_0x3b614f){_0x59fb47=_0x59fb47-0x0;var _0x410799=_0xddd7[_0x59fb47];return _0x410799;};'use strict';var attributes=require(_0x7ddd('0x0'));module['exports']=function(_0x4fef4d){return _0x4fef4d[_0x7ddd('0x1')](_0x7ddd('0x2'),attributes,{'tableName':_0x7ddd('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7ddd('0x4'),'collate':_0x7ddd('0x5')});};
\ No newline at end of file
+var _0x93d2=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x514369,_0x1deef7){var _0x5820ba=function(_0x2b43ea){while(--_0x2b43ea){_0x514369['push'](_0x514369['shift']());}};_0x5820ba(++_0x1deef7);}(_0x93d2,0xfc));var _0x293d=function(_0x1ae1e1,_0x4a2cbe){_0x1ae1e1=_0x1ae1e1-0x0;var _0x21baca=_0x93d2[_0x1ae1e1];return _0x21baca;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x266740){return _0x266740[_0x293d('0x0')](_0x293d('0x1'),attributes,{'tableName':_0x293d('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x293d('0x3'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 1a2f007..c297e56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc534=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x3a88a2,_0x4d1357){var _0x10fb3b=function(_0x36c7c8){while(--_0x36c7c8){_0x3a88a2['push'](_0x3a88a2['shift']());}};_0x10fb3b(++_0x4d1357);}(_0xc534,0x1ca));var _0x4c53=function(_0x16d991,_0x3f07cc){_0x16d991=_0x16d991-0x0;var _0x4f41c3=_0xc534[_0x16d991];return _0x4f41c3;};'use strict';var _=require('lodash');var util=require(_0x4c53('0x0'));var moment=require(_0x4c53('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c53('0x2'));var fs=require('fs');var Redis=require(_0x4c53('0x3'));var db=require(_0x4c53('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c53('0x5'))('rpc');var config=require(_0x4c53('0x6'));var jayson=require(_0x4c53('0x7'));var client=jayson[_0x4c53('0x8')][_0x4c53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32d211,_0x276764,_0x1ebbbf){return new BPromise(function(_0x46eccd,_0x5aa698){return client[_0x4c53('0xa')](_0x32d211,_0x1ebbbf)[_0x4c53('0xb')](function(_0x5ad461){logger[_0x4c53('0xc')](_0x4c53('0xd'),_0x276764,_0x4c53('0xe'));logger[_0x4c53('0xf')](_0x4c53('0x10'),_0x276764,_0x4c53('0xe'),JSON[_0x4c53('0x11')](_0x5ad461));if(_0x5ad461[_0x4c53('0x12')]){if(_0x5ad461[_0x4c53('0x12')][_0x4c53('0x13')]===0x1f4){logger[_0x4c53('0x12')](_0x4c53('0xd'),_0x276764,_0x5ad461[_0x4c53('0x12')][_0x4c53('0x14')]);return _0x5aa698(_0x5ad461[_0x4c53('0x12')]['message']);}logger[_0x4c53('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x276764,_0x5ad461[_0x4c53('0x12')][_0x4c53('0x14')]);return _0x46eccd(_0x5ad461[_0x4c53('0x12')][_0x4c53('0x14')]);}else{logger[_0x4c53('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x276764,_0x4c53('0xe'));_0x46eccd(_0x5ad461[_0x4c53('0x15')]['message']);}})[_0x4c53('0x16')](function(_0x880449){logger[_0x4c53('0x12')](_0x4c53('0xd'),_0x276764,_0x880449);_0x5aa698(_0x880449);});});}
\ No newline at end of file
+var _0xc586=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28972d,_0x5cd0ba){var _0x302084=function(_0x14df1a){while(--_0x14df1a){_0x28972d['push'](_0x28972d['shift']());}};_0x302084(++_0x5cd0ba);}(_0xc586,0xbb));var _0x6c58=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc586[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x6c58('0x0'));var util=require('util');var moment=require(_0x6c58('0x1'));var BPromise=require('bluebird');var rs=require(_0x6c58('0x2'));var fs=require('fs');var Redis=require(_0x6c58('0x3'));var db=require(_0x6c58('0x4'))['db'];var utils=require(_0x6c58('0x5'));var logger=require(_0x6c58('0x6'))(_0x6c58('0x7'));var config=require(_0x6c58('0x8'));var jayson=require(_0x6c58('0x9'));var client=jayson[_0x6c58('0xa')][_0x6c58('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b5f36,_0x58b66f,_0x6f205d){return new BPromise(function(_0x54fa20,_0x2f7310){return client[_0x6c58('0xc')](_0x2b5f36,_0x6f205d)['then'](function(_0x581761){logger['info'](_0x6c58('0xd'),_0x58b66f,_0x6c58('0xe'));logger[_0x6c58('0xf')](_0x6c58('0x10'),_0x58b66f,_0x6c58('0xe'),JSON[_0x6c58('0x11')](_0x581761));if(_0x581761[_0x6c58('0x12')]){if(_0x581761[_0x6c58('0x12')][_0x6c58('0x13')]===0x1f4){logger[_0x6c58('0x12')](_0x6c58('0xd'),_0x58b66f,_0x581761[_0x6c58('0x12')][_0x6c58('0x14')]);return _0x2f7310(_0x581761['error'][_0x6c58('0x14')]);}logger[_0x6c58('0x12')](_0x6c58('0xd'),_0x58b66f,_0x581761['error'][_0x6c58('0x14')]);return _0x54fa20(_0x581761[_0x6c58('0x12')][_0x6c58('0x14')]);}else{logger['info'](_0x6c58('0xd'),_0x58b66f,'request\x20sent');_0x54fa20(_0x581761[_0x6c58('0x15')][_0x6c58('0x14')]);}})[_0x6c58('0x16')](function(_0x2fbb92){logger['error'](_0x6c58('0xd'),_0x58b66f,_0x2fbb92);_0x2f7310(_0x2fbb92);});});}
\ No newline at end of file
index a1d8655..1453ecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x373f=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x6855c3,_0x84bb43){var _0x290091=function(_0x1c02c2){while(--_0x1c02c2){_0x6855c3['push'](_0x6855c3['shift']());}};_0x290091(++_0x84bb43);}(_0x373f,0x115));var _0xf373=function(_0x33855b,_0x35bd09){_0x33855b=_0x33855b-0x0;var _0x150e06=_0x373f[_0x33855b];return _0x150e06;};'use strict';var multer=require(_0xf373('0x0'));var util=require(_0xf373('0x1'));var path=require(_0xf373('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf373('0x3')]();var fs_extra=require(_0xf373('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf373('0x5'));var config=require(_0xf373('0x6'));var controller=require(_0xf373('0x7'));router[_0xf373('0x8')]('/',auth['isAuthenticated'](),controller[_0xf373('0x9')]);router['get']('/describe',auth[_0xf373('0xa')](),controller[_0xf373('0xb')]);router['get'](_0xf373('0xc'),auth[_0xf373('0xa')](),controller[_0xf373('0xd')]);router[_0xf373('0xe')]('/',auth[_0xf373('0xa')](),controller[_0xf373('0xf')]);router[_0xf373('0x10')]('/:id',auth[_0xf373('0xa')](),controller[_0xf373('0x11')]);router[_0xf373('0x12')](_0xf373('0xc'),auth[_0xf373('0xa')](),controller['destroy']);module[_0xf373('0x13')]=router;
\ No newline at end of file
+var _0x326b=['express','Router','../../components/auth/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','show','post','create','put','update','/:id','exports','util','path','connect-timeout'];(function(_0x1a4a06,_0x36a5c2){var _0x49ec08=function(_0x497f24){while(--_0x497f24){_0x1a4a06['push'](_0x1a4a06['shift']());}};_0x49ec08(++_0x36a5c2);}(_0x326b,0x11d));var _0xb326=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x326b[_0x13187a];return _0x65b85f;};'use strict';var multer=require('multer');var util=require(_0xb326('0x0'));var path=require(_0xb326('0x1'));var timeout=require(_0xb326('0x2'));var express=require(_0xb326('0x3'));var router=express[_0xb326('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb326('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb326('0x6'));router[_0xb326('0x7')]('/',auth[_0xb326('0x8')](),controller[_0xb326('0x9')]);router[_0xb326('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xb326('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb326('0xb')]);router[_0xb326('0xc')]('/',auth[_0xb326('0x8')](),controller[_0xb326('0xd')]);router[_0xb326('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xb326('0xf')]);router['delete'](_0xb326('0x10'),auth[_0xb326('0x8')](),controller['destroy']);module[_0xb326('0x11')]=router;
\ No newline at end of file
index 78169ae..7ed5033 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4db6=['ENUM','mouseOver','timeout','STRING','sequelize'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x4db6,0x135));var _0x64db=function(_0x3a166a,_0x2018be){_0x3a166a=_0x3a166a-0x0;var _0x1b0279=_0x4db6[_0x3a166a];return _0x1b0279;};'use strict';var Sequelize=require(_0x64db('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x64db('0x1')](_0x64db('0x2'),_0x64db('0x3')),'defaultValue':_0x64db('0x2')},'selector':{'type':Sequelize[_0x64db('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xcc0a=['sequelize','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x2c0485,_0x16e240){var _0xe5cab0=function(_0x337510){while(--_0x337510){_0x2c0485['push'](_0x2c0485['shift']());}};_0xe5cab0(++_0x16e240);}(_0xcc0a,0x8a));var _0xacc0=function(_0x5a927b,_0x468bee){_0x5a927b=_0x5a927b-0x0;var _0x2fa643=_0xcc0a[_0x5a927b];return _0x2fa643;};'use strict';var Sequelize=require(_0xacc0('0x0'));module['exports']={'name':{'type':Sequelize[_0xacc0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xacc0('0x2')](_0xacc0('0x3'),_0xacc0('0x4')),'defaultValue':_0xacc0('0x3')},'selector':{'type':Sequelize[_0xacc0('0x1')]},'timeout':{'type':Sequelize[_0xacc0('0x5')]}};
\ No newline at end of file
index cc94f05..a25cb54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fd1=['show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send'];(function(_0x432075,_0x308bed){var _0x575582=function(_0x1337e7){while(--_0x1337e7){_0x432075['push'](_0x432075['shift']());}};_0x575582(++_0x308bed);}(_0x5fd1,0x155));var _0x15fd=function(_0x2128f1,_0x356dc3){_0x2128f1=_0x2128f1-0x0;var _0x4ba6f9=_0x5fd1[_0x2128f1];return _0x4ba6f9;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={'raw':!![],'where':{'id':_0x27d2c4[_0x15fd('0x26')]['id']}},_0x218034={};_0x218034[_0x15fd('0x27')]=_[_0x15fd('0x28')](db[_0x15fd('0x29')]['rawAttributes']);_0x218034[_0x15fd('0x2a')]=_[_0x15fd('0x28')](_0x27d2c4['query']);_0x218034[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x218034['model'],_0x218034[_0x15fd('0x2a')]);_0x6c213b[_0x15fd('0x2d')]=_['intersection'](_0x218034[_0x15fd('0x27')],qs[_0x15fd('0x2e')](_0x27d2c4[_0x15fd('0x2a')][_0x15fd('0x2e')]));_0x6c213b[_0x15fd('0x2d')]=_0x6c213b[_0x15fd('0x2d')]['length']?_0x6c213b[_0x15fd('0x2d')]:_0x218034[_0x15fd('0x27')];if(_0x27d2c4[_0x15fd('0x2a')][_0x15fd('0x2f')]){_0x6c213b['include']=[{'all':!![]}];}_0x6c213b=_[_0x15fd('0x30')]({},_0x6c213b,_0x27d2c4[_0x15fd('0x31')]);return db[_0x15fd('0x29')][_0x15fd('0x32')](_0x6c213b)[_0x15fd('0x1f')](handleEntityNotFound(_0x233ed3,null))[_0x15fd('0x1f')](respondWithResult(_0x233ed3,null))['catch'](handleError(_0x233ed3,null));};exports[_0x15fd('0x33')]=function(_0xaae2d0,_0x57c118){return db[_0x15fd('0x29')][_0x15fd('0x33')](_0xaae2d0[_0x15fd('0x34')],{})['then'](respondWithResult(_0x57c118,0xc9))[_0x15fd('0x35')](handleError(_0x57c118,null));};exports[_0x15fd('0x1e')]=function(_0x1732bc,_0xbe50e7){if(_0x1732bc[_0x15fd('0x34')]['id']){delete _0x1732bc[_0x15fd('0x34')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x1732bc['params']['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0xbe50e7,null))[_0x15fd('0x1f')](saveUpdates(_0x1732bc[_0x15fd('0x34')],null))['then'](respondWithResult(_0xbe50e7,null))['catch'](handleError(_0xbe50e7,null));};exports[_0x15fd('0x20')]=function(_0x5962f5,_0x4f1c84){return db['ChatProactiveAction'][_0x15fd('0x32')]({'where':{'id':_0x5962f5[_0x15fd('0x26')]['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0x4f1c84,null))['then'](removeEntity(_0x4f1c84,null))[_0x15fd('0x35')](handleError(_0x4f1c84,null));};
\ No newline at end of file
+var _0x9b6d=['rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','name','params','ChatProactiveAction'];(function(_0x2e19ab,_0x4d527f){var _0x510981=function(_0x808e9){while(--_0x808e9){_0x2e19ab['push'](_0x2e19ab['shift']());}};_0x510981(++_0x4d527f);}(_0x9b6d,0x105));var _0xd9b6=function(_0x8a80a3,_0x5f4c6a){_0x8a80a3=_0x8a80a3-0x0;var _0x3c06fc=_0x9b6d[_0x8a80a3];return _0x3c06fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9b6('0x0'));var zipdir=require(_0xd9b6('0x1'));var jsonpatch=require(_0xd9b6('0x2'));var rp=require(_0xd9b6('0x3'));var moment=require(_0xd9b6('0x4'));var BPromise=require(_0xd9b6('0x5'));var Mustache=require(_0xd9b6('0x6'));var util=require(_0xd9b6('0x7'));var path=require(_0xd9b6('0x8'));var sox=require(_0xd9b6('0x9'));var csv=require(_0xd9b6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9b6('0xb'));var _=require(_0xd9b6('0xc'));var squel=require(_0xd9b6('0xd'));var crypto=require(_0xd9b6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd9b6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9b6('0x10'));var Papa=require(_0xd9b6('0x11'));var Redis=require(_0xd9b6('0x12'));var authService=require(_0xd9b6('0x13'));var qs=require(_0xd9b6('0x14'));var as=require(_0xd9b6('0x15'));var hardwareService=require(_0xd9b6('0x16'));var logger=require('../../config/logger')(_0xd9b6('0x17'));var utils=require(_0xd9b6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd9b6('0x19'));var db=require(_0xd9b6('0x1a'))['db'];function respondWithStatusCode(_0x21b6e2,_0x335e80){_0x335e80=_0x335e80||0xcc;return function(_0x323e0c){if(_0x323e0c){return _0x21b6e2[_0xd9b6('0x1b')](_0x335e80);}return _0x21b6e2[_0xd9b6('0x1c')](_0x335e80)['end']();};}function respondWithResult(_0xb6be96,_0x5e6d97){_0x5e6d97=_0x5e6d97||0xc8;return function(_0x15acd9){if(_0x15acd9){return _0xb6be96[_0xd9b6('0x1c')](_0x5e6d97)[_0xd9b6('0x1d')](_0x15acd9);}};}function respondWithFilteredResult(_0x274b5d,_0xb04585){return function(_0x544da8){if(_0x544da8){var _0x473bb2=typeof _0xb04585[_0xd9b6('0x1e')]===_0xd9b6('0x1f')&&typeof _0xb04585[_0xd9b6('0x20')]===_0xd9b6('0x1f');var _0x529658=_0x544da8[_0xd9b6('0x21')];var _0x1a380b=_0x473bb2?0x0:_0xb04585['offset'];var _0x17283d=_0x473bb2?_0x544da8[_0xd9b6('0x21')]:_0xb04585[_0xd9b6('0x1e')]+_0xb04585[_0xd9b6('0x20')];var _0xee83b3;if(_0x17283d>=_0x529658){_0x17283d=_0x529658;_0xee83b3=0xc8;}else{_0xee83b3=0xce;}_0x274b5d[_0xd9b6('0x1c')](_0xee83b3);return _0x274b5d['set'](_0xd9b6('0x22'),_0x1a380b+'-'+_0x17283d+'/'+_0x529658)[_0xd9b6('0x1d')](_0x544da8);}return null;};}function patchUpdates(_0xc5e7bb){return function(_0x297acf){try{jsonpatch[_0xd9b6('0x23')](_0x297acf,_0xc5e7bb,!![]);}catch(_0x2e8415){return BPromise['reject'](_0x2e8415);}return _0x297acf[_0xd9b6('0x24')]();};}function saveUpdates(_0x261520,_0x562609){return function(_0xd4e9cc){if(_0xd4e9cc){return _0xd4e9cc[_0xd9b6('0x25')](_0x261520)[_0xd9b6('0x26')](function(_0x130ae0){return _0x130ae0;});}return null;};}function removeEntity(_0x72990c,_0x1e3362){return function(_0x3d3055){if(_0x3d3055){return _0x3d3055[_0xd9b6('0x27')]()[_0xd9b6('0x26')](function(){_0x72990c[_0xd9b6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc7661,_0x2fd7d6){return function(_0x563c70){if(!_0x563c70){_0xc7661[_0xd9b6('0x1b')](0x194);}return _0x563c70;};}function handleError(_0x422e4f,_0x1341f8){_0x1341f8=_0x1341f8||0x1f4;return function(_0x4cb7f5){logger[_0xd9b6('0x28')](_0x4cb7f5['stack']);if(_0x4cb7f5[_0xd9b6('0x29')]){delete _0x4cb7f5['name'];}_0x422e4f[_0xd9b6('0x1c')](_0x1341f8)['send'](_0x4cb7f5);};}exports['show']=function(_0x35a09c,_0x5d12ba){var _0x2141d7={'raw':!![],'where':{'id':_0x35a09c[_0xd9b6('0x2a')]['id']}},_0xb4f599={};_0xb4f599['model']=_['keys'](db[_0xd9b6('0x2b')][_0xd9b6('0x2c')]);_0xb4f599[_0xd9b6('0x2d')]=_[_0xd9b6('0x2e')](_0x35a09c['query']);_0xb4f599[_0xd9b6('0x2f')]=_[_0xd9b6('0x30')](_0xb4f599[_0xd9b6('0x31')],_0xb4f599['query']);_0x2141d7[_0xd9b6('0x32')]=_[_0xd9b6('0x30')](_0xb4f599[_0xd9b6('0x31')],qs[_0xd9b6('0x33')](_0x35a09c[_0xd9b6('0x2d')][_0xd9b6('0x33')]));_0x2141d7[_0xd9b6('0x32')]=_0x2141d7['attributes'][_0xd9b6('0x34')]?_0x2141d7[_0xd9b6('0x32')]:_0xb4f599[_0xd9b6('0x31')];if(_0x35a09c[_0xd9b6('0x2d')][_0xd9b6('0x35')]){_0x2141d7[_0xd9b6('0x36')]=[{'all':!![]}];}_0x2141d7=_[_0xd9b6('0x37')]({},_0x2141d7,_0x35a09c[_0xd9b6('0x38')]);return db['ChatProactiveAction']['find'](_0x2141d7)[_0xd9b6('0x26')](handleEntityNotFound(_0x5d12ba,null))['then'](respondWithResult(_0x5d12ba,null))[_0xd9b6('0x39')](handleError(_0x5d12ba,null));};exports[_0xd9b6('0x3a')]=function(_0x1c8e67,_0x5d86a9){return db[_0xd9b6('0x2b')][_0xd9b6('0x3a')](_0x1c8e67['body'],{})['then'](respondWithResult(_0x5d86a9,0xc9))[_0xd9b6('0x39')](handleError(_0x5d86a9,null));};exports[_0xd9b6('0x25')]=function(_0x51093e,_0x3939ec){if(_0x51093e[_0xd9b6('0x3b')]['id']){delete _0x51093e[_0xd9b6('0x3b')]['id'];}return db[_0xd9b6('0x2b')][_0xd9b6('0x3c')]({'where':{'id':_0x51093e[_0xd9b6('0x2a')]['id']}})[_0xd9b6('0x26')](handleEntityNotFound(_0x3939ec,null))[_0xd9b6('0x26')](saveUpdates(_0x51093e['body'],null))[_0xd9b6('0x26')](respondWithResult(_0x3939ec,null))[_0xd9b6('0x39')](handleError(_0x3939ec,null));};exports[_0xd9b6('0x27')]=function(_0x4328f6,_0x23b54b){return db['ChatProactiveAction']['find']({'where':{'id':_0x4328f6[_0xd9b6('0x2a')]['id']}})[_0xd9b6('0x26')](handleEntityNotFound(_0x23b54b,null))[_0xd9b6('0x26')](removeEntity(_0x23b54b,null))[_0xd9b6('0x39')](handleError(_0x23b54b,null));};
\ No newline at end of file
index e71475b..c92421e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9236=['moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','api'];(function(_0x3c8880,_0x2c092c){var _0x1905d3=function(_0x118283){while(--_0x118283){_0x3c8880['push'](_0x3c8880['shift']());}};_0x1905d3(++_0x2c092c);}(_0x9236,0x8e));var _0x6923=function(_0x1000ea,_0x5504b4){_0x1000ea=_0x1000ea-0x0;var _0x1d9299=_0x9236[_0x1000ea];return _0x1d9299;};'use strict';var _=require('lodash');var util=require(_0x6923('0x0'));var logger=require('../../config/logger')(_0x6923('0x1'));var moment=require(_0x6923('0x2'));var BPromise=require('bluebird');var rp=require(_0x6923('0x3'));var fs=require('fs');var path=require(_0x6923('0x4'));var rimraf=require(_0x6923('0x5'));var config=require(_0x6923('0x6'));var attributes=require(_0x6923('0x7'));module[_0x6923('0x8')]=function(_0x3d843c,_0x282b8a){return _0x3d843c[_0x6923('0x9')](_0x6923('0xa'),attributes,{'tableName':_0x6923('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfde=['rimraf','ChatProactiveAction','util','../../config/logger','api','moment','bluebird','path'];(function(_0x166bb2,_0x22fda0){var _0x5b1a0c=function(_0x12493b){while(--_0x12493b){_0x166bb2['push'](_0x166bb2['shift']());}};_0x5b1a0c(++_0x22fda0);}(_0xcfde,0x1b2));var _0xecfd=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xcfde[_0x31cb5f];return _0x586042;};'use strict';var _=require('lodash');var util=require(_0xecfd('0x0'));var logger=require(_0xecfd('0x1'))(_0xecfd('0x2'));var moment=require(_0xecfd('0x3'));var BPromise=require(_0xecfd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecfd('0x5'));var rimraf=require(_0xecfd('0x6'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x42f2a6,_0x4d8846){return _0x42f2a6['define'](_0xecfd('0x7'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b566acb..db40804 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7a3=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x5c6e40,_0x36db76){var _0x44f5b5=function(_0x19c8d0){while(--_0x19c8d0){_0x5c6e40['push'](_0x5c6e40['shift']());}};_0x44f5b5(++_0x36db76);}(_0xe7a3,0x198));var _0x3e7a=function(_0x245adb,_0x1d8f43){_0x245adb=_0x245adb-0x0;var _0x224fcf=_0xe7a3[_0x245adb];return _0x224fcf;};'use strict';var _=require(_0x3e7a('0x0'));var util=require(_0x3e7a('0x1'));var moment=require(_0x3e7a('0x2'));var BPromise=require(_0x3e7a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e7a('0x4'));var db=require(_0x3e7a('0x5'))['db'];var utils=require(_0x3e7a('0x6'));var logger=require(_0x3e7a('0x7'))('rpc');var config=require(_0x3e7a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3e7a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdb8aa2,_0x57644d,_0x5b4693){return new BPromise(function(_0x6b4ab2,_0x3cfbda){return client[_0x3e7a('0xa')](_0xdb8aa2,_0x5b4693)[_0x3e7a('0xb')](function(_0xd5befa){logger[_0x3e7a('0xc')](_0x3e7a('0xd'),_0x57644d,'request\x20sent');logger[_0x3e7a('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x57644d,_0x3e7a('0xf'),JSON[_0x3e7a('0x10')](_0xd5befa));if(_0xd5befa[_0x3e7a('0x11')]){if(_0xd5befa['error'][_0x3e7a('0x12')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x57644d,_0xd5befa[_0x3e7a('0x11')]['message']);return _0x3cfbda(_0xd5befa[_0x3e7a('0x11')][_0x3e7a('0x13')]);}logger[_0x3e7a('0x11')](_0x3e7a('0xd'),_0x57644d,_0xd5befa[_0x3e7a('0x11')][_0x3e7a('0x13')]);return _0x6b4ab2(_0xd5befa[_0x3e7a('0x11')]['message']);}else{logger[_0x3e7a('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x57644d,'request\x20sent');_0x6b4ab2(_0xd5befa[_0x3e7a('0x14')][_0x3e7a('0x13')]);}})[_0x3e7a('0x15')](function(_0x2480db){logger[_0x3e7a('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x57644d,_0x2480db);_0x3cfbda(_0x2480db);});});}
\ No newline at end of file
+var _0x467e=['http','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','rpc','../../config/environment','client'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x467e,0x139));var _0xe467=function(_0x8b3778,_0x4453db){_0x8b3778=_0x8b3778-0x0;var _0x53bdc8=_0x467e[_0x8b3778];return _0x53bdc8;};'use strict';var _=require(_0xe467('0x0'));var util=require(_0xe467('0x1'));var moment=require(_0xe467('0x2'));var BPromise=require(_0xe467('0x3'));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')(_0xe467('0x4'));var config=require(_0xe467('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe467('0x6')][_0xe467('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16e853,_0x337138,_0x575b97){return new BPromise(function(_0x6ed22d,_0x2cb1ec){return client['request'](_0x16e853,_0x575b97)[_0xe467('0x8')](function(_0x4f60bc){logger[_0xe467('0x9')](_0xe467('0xa'),_0x337138,'request\x20sent');logger[_0xe467('0xb')](_0xe467('0xc'),_0x337138,_0xe467('0xd'),JSON[_0xe467('0xe')](_0x4f60bc));if(_0x4f60bc['error']){if(_0x4f60bc[_0xe467('0xf')][_0xe467('0x10')]===0x1f4){logger[_0xe467('0xf')](_0xe467('0xa'),_0x337138,_0x4f60bc[_0xe467('0xf')]['message']);return _0x2cb1ec(_0x4f60bc[_0xe467('0xf')][_0xe467('0x11')]);}logger[_0xe467('0xf')](_0xe467('0xa'),_0x337138,_0x4f60bc[_0xe467('0xf')][_0xe467('0x11')]);return _0x6ed22d(_0x4f60bc[_0xe467('0xf')][_0xe467('0x11')]);}else{logger['info'](_0xe467('0xa'),_0x337138,'request\x20sent');_0x6ed22d(_0x4f60bc[_0xe467('0x12')][_0xe467('0x11')]);}})[_0xe467('0x13')](function(_0x3d9de5){logger[_0xe467('0xf')](_0xe467('0xa'),_0x337138,_0x3d9de5);_0x2cb1ec(_0x3d9de5);});});}
\ No newline at end of file
index b71443c..a1631a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x342773,_0x386fd7){var _0x4f023e=function(_0x4d50f5){while(--_0x4d50f5){_0x342773['push'](_0x342773['shift']());}};_0x4f023e(++_0x386fd7);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x5ac26f,_0x459bfe){_0x5ac26f=_0x5ac26f-0x0;var _0x3586bd=_0x3eea[_0x5ac26f];return _0x3586bd;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x71ab=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x71ab,0x64));var _0xb71a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x71ab[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0xa')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xf')]);router[_0xb71a('0x10')]('/:id',auth[_0xb71a('0xa')](),controller['destroy']);module[_0xb71a('0x11')]=router;
\ No newline at end of file
index d060140..738db3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76e7=['ENUM','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x76e7,0x1f4));var _0x776e=function(_0x3d407c,_0x8127b5){_0x3d407c=_0x3d407c-0x0;var _0x7d17dc=_0x76e7[_0x3d407c];return _0x7d17dc;};'use strict';var Sequelize=require('sequelize');module[_0x776e('0x0')]={'name':{'type':Sequelize[_0x776e('0x1')],'unique':_0x776e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x776e('0x1')]},'timeout':{'type':Sequelize[_0x776e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x776e('0x4')]('rrmemory',_0x776e('0x5'),_0x776e('0x6'))}};
\ No newline at end of file
+var _0x4f81=['INTEGER','rrmemory','exports','STRING','name'];(function(_0x36147b,_0x57f40b){var _0x141351=function(_0x219aa1){while(--_0x219aa1){_0x36147b['push'](_0x36147b['shift']());}};_0x141351(++_0x57f40b);}(_0x4f81,0x1d8));var _0x14f8=function(_0x3456db,_0x5dbd04){_0x3456db=_0x3456db-0x0;var _0x22dc2d=_0x4f81[_0x3456db];return _0x22dc2d;};'use strict';var Sequelize=require('sequelize');module[_0x14f8('0x0')]={'name':{'type':Sequelize[_0x14f8('0x1')],'unique':_0x14f8('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x14f8('0x1')]},'timeout':{'type':Sequelize[_0x14f8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x14f8('0x4'),'beepall','roundrobin')}};
\ No newline at end of file
index 88dd31e..0a914db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3308=['type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','findOne','UserChatQueue','nolimit','order','ChatQueueId','User','findAndCountAll','UserId','chatPause','createdAt','format','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','online','interface','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','union','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','spread','userChatQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','ChatQueues','end','name','send','map','ChatQueue'];(function(_0x5c8ead,_0x21a076){var _0x4eb5a5=function(_0x508114){while(--_0x508114){_0x5c8ead['push'](_0x5c8ead['shift']());}};_0x4eb5a5(++_0x21a076);}(_0x3308,0x17c));var _0x8330=function(_0x4fbdba,_0x1e3e4d){_0x4fbdba=_0x4fbdba-0x0;var _0x38d1bf=_0x3308[_0x4fbdba];return _0x38d1bf;};'use strict';var emlformat=require(_0x8330('0x0'));var rimraf=require(_0x8330('0x1'));var zipdir=require(_0x8330('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8330('0x3'));var moment=require(_0x8330('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8330('0x5'));var path=require(_0x8330('0x6'));var sox=require(_0x8330('0x7'));var csv=require('to-csv');var ejs=require(_0x8330('0x8'));var fs=require('fs');var fs_extra=require(_0x8330('0x9'));var _=require('lodash');var squel=require(_0x8330('0xa'));var crypto=require(_0x8330('0xb'));var jsforce=require(_0x8330('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8330('0xd'));var Papa=require(_0x8330('0xe'));var Redis=require(_0x8330('0xf'));var authService=require(_0x8330('0x10'));var qs=require(_0x8330('0x11'));var as=require(_0x8330('0x12'));var hardwareService=require(_0x8330('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8330('0x14'));var config=require(_0x8330('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x8330('0x16')](config[_0x8330('0x17')],{'host':_0x8330('0x18'),'port':0x18eb});var socket=require(_0x8330('0x19'))(new Redis(config[_0x8330('0x17')]));require(_0x8330('0x1a'))[_0x8330('0x1b')](socket);var jayson=require(_0x8330('0x1c'));var client=jayson[_0x8330('0x1d')][_0x8330('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x46a2bf,_0x38e9f6,_0x25e9a3,_0x3e3f69){return new BPromise(function(_0xffe168,_0x2993b4){var _0x44dfbf=_0x3e3f69||client;return _0x44dfbf[_0x8330('0x1f')](_0x46a2bf,_0x25e9a3)[_0x8330('0x20')](function(_0x580ec2){logger[_0x8330('0x21')](_0x8330('0x22'),_0x38e9f6,_0x8330('0x23'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x38e9f6,_0x8330('0x23'),JSON['stringify'](_0x580ec2));if(_0x580ec2[_0x8330('0x24')]){if(_0x580ec2[_0x8330('0x24')]['code']===0x1f4){logger[_0x8330('0x24')](_0x8330('0x22'),_0x38e9f6,_0x580ec2[_0x8330('0x24')][_0x8330('0x25')]);return _0x2993b4(_0x580ec2['error'][_0x8330('0x25')]);}logger[_0x8330('0x24')](_0x8330('0x22'),_0x38e9f6,_0x580ec2[_0x8330('0x24')][_0x8330('0x25')]);return _0xffe168(_0x580ec2[_0x8330('0x24')][_0x8330('0x25')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x38e9f6,_0x8330('0x23'));_0xffe168(_0x580ec2[_0x8330('0x26')][_0x8330('0x25')]);}})['catch'](function(_0x493210){logger[_0x8330('0x24')](_0x8330('0x22'),_0x38e9f6,_0x493210);_0x2993b4(_0x493210);});});}function respondWithStatusCode(_0x442746,_0x1b6754){_0x1b6754=_0x1b6754||0xcc;return function(_0x1949b5){if(_0x1949b5){return _0x442746[_0x8330('0x27')](_0x1b6754);}return _0x442746[_0x8330('0x28')](_0x1b6754)['end']();};}function respondWithResult(_0x5c4d38,_0x167604){_0x167604=_0x167604||0xc8;return function(_0x52b582){if(_0x52b582){return _0x5c4d38['status'](_0x167604)[_0x8330('0x29')](_0x52b582);}};}function respondWithFilteredResult(_0x51ead7,_0x181055){return function(_0x31f171){if(_0x31f171){var _0x11df52=typeof _0x181055[_0x8330('0x2a')]===_0x8330('0x2b')&&typeof _0x181055[_0x8330('0x2c')]===_0x8330('0x2b');var _0x273d75=_0x31f171[_0x8330('0x2d')];var _0x2a3bcc=_0x11df52?0x0:_0x181055['offset'];var _0x589a86=_0x11df52?_0x31f171[_0x8330('0x2d')]:_0x181055['offset']+_0x181055[_0x8330('0x2c')];var _0x21e577;if(_0x589a86>=_0x273d75){_0x589a86=_0x273d75;_0x21e577=0xc8;}else{_0x21e577=0xce;}_0x51ead7[_0x8330('0x28')](_0x21e577);return _0x51ead7['set'](_0x8330('0x2e'),_0x2a3bcc+'-'+_0x589a86+'/'+_0x273d75)[_0x8330('0x29')](_0x31f171);}return null;};}function patchUpdates(_0x2d5a81){return function(_0x411c27){try{jsonpatch[_0x8330('0x2f')](_0x411c27,_0x2d5a81,!![]);}catch(_0x11746f){return BPromise[_0x8330('0x30')](_0x11746f);}return _0x411c27[_0x8330('0x31')]();};}function saveUpdates(_0xa13f2a,_0xf0a2d4){return function(_0x5a07ea){if(_0x5a07ea){return _0x5a07ea['update'](_0xa13f2a)['then'](function(_0x2c4e1d){return _0x2c4e1d;});}return null;};}function removeEntity(_0x47152a,_0x12904b){return function(_0x35e11d){if(_0x35e11d){return _0x35e11d[_0x8330('0x32')]()[_0x8330('0x20')](function(){var _0x527485=_0x35e11d[_0x8330('0x33')]({'plain':!![]});var _0x5e6bf7=_0x8330('0x34');return db['UserProfileResource'][_0x8330('0x32')]({'where':{'type':_0x5e6bf7,'resourceId':_0x527485['id']}})[_0x8330('0x20')](function(){return _0x35e11d;});})[_0x8330('0x20')](function(){_0x47152a['status'](0xcc)[_0x8330('0x35')]();});}};}function handleEntityNotFound(_0x3c89ec,_0x1e401c){return function(_0x3dda8a){if(!_0x3dda8a){_0x3c89ec['sendStatus'](0x194);}return _0x3dda8a;};}function handleError(_0x40dbdc,_0x260a78){_0x260a78=_0x260a78||0x1f4;return function(_0x318887){logger[_0x8330('0x24')](_0x318887['stack']);if(_0x318887[_0x8330('0x36')]){delete _0x318887[_0x8330('0x36')];}_0x40dbdc[_0x8330('0x28')](_0x260a78)[_0x8330('0x37')](_0x318887);};}exports['index']=function(_0x4a5249,_0x5e7b81){var _0x354ffb={},_0x409004={},_0x29d670={'count':0x0,'rows':[]};var _0xd22a20=_[_0x8330('0x38')](db[_0x8330('0x39')]['rawAttributes'],function(_0x13fb7c){return{'name':_0x13fb7c['fieldName'],'type':_0x13fb7c[_0x8330('0x3a')][_0x8330('0x3b')]};});_0x409004[_0x8330('0x3c')]=_[_0x8330('0x38')](_0xd22a20,_0x8330('0x36'));_0x409004['query']=_[_0x8330('0x3d')](_0x4a5249[_0x8330('0x3e')]);_0x409004[_0x8330('0x3f')]=_[_0x8330('0x40')](_0x409004[_0x8330('0x3c')],_0x409004[_0x8330('0x3e')]);_0x354ffb[_0x8330('0x41')]=_['intersection'](_0x409004['model'],qs[_0x8330('0x42')](_0x4a5249['query']['fields']));_0x354ffb['attributes']=_0x354ffb[_0x8330('0x41')][_0x8330('0x43')]?_0x354ffb[_0x8330('0x41')]:_0x409004['model'];if(!_0x4a5249[_0x8330('0x3e')][_0x8330('0x44')]('nolimit')){_0x354ffb[_0x8330('0x2c')]=qs[_0x8330('0x2c')](_0x4a5249[_0x8330('0x3e')]['limit']);_0x354ffb[_0x8330('0x2a')]=qs['offset'](_0x4a5249[_0x8330('0x3e')][_0x8330('0x2a')]);}_0x354ffb['order']=qs['sort'](_0x4a5249['query'][_0x8330('0x45')]);_0x354ffb[_0x8330('0x46')]=qs[_0x8330('0x3f')](_[_0x8330('0x47')](_0x4a5249['query'],_0x409004[_0x8330('0x3f')]),_0xd22a20);if(_0x4a5249['query'][_0x8330('0x48')]){_0x354ffb[_0x8330('0x46')]=_[_0x8330('0x49')](_0x354ffb[_0x8330('0x46')],{'$or':_['map'](_0xd22a20,function(_0x11d06e){if(_0x11d06e[_0x8330('0x3a')]!==_0x8330('0x4a')){var _0x25becf={};_0x25becf[_0x11d06e[_0x8330('0x36')]]={'$like':'%'+_0x4a5249[_0x8330('0x3e')]['filter']+'%'};return _0x25becf;}})});}_0x354ffb=_[_0x8330('0x49')]({},_0x354ffb,_0x4a5249[_0x8330('0x4b')]);var _0x3e5731={'where':_0x354ffb[_0x8330('0x46')]};return db[_0x8330('0x39')][_0x8330('0x2d')](_0x3e5731)[_0x8330('0x20')](function(_0x437044){_0x29d670[_0x8330('0x2d')]=_0x437044;if(_0x4a5249[_0x8330('0x3e')][_0x8330('0x4c')]){_0x354ffb[_0x8330('0x4d')]=[{'all':!![]}];}return db[_0x8330('0x39')][_0x8330('0x4e')](_0x354ffb);})[_0x8330('0x20')](function(_0x44c811){_0x29d670[_0x8330('0x4f')]=_0x44c811;return _0x29d670;})[_0x8330('0x20')](respondWithFilteredResult(_0x5e7b81,_0x354ffb))[_0x8330('0x50')](handleError(_0x5e7b81,null));};exports['show']=function(_0x3eb2b2,_0x197830){var _0x45f8a2={'raw':!![],'where':{'id':_0x3eb2b2[_0x8330('0x51')]['id']}},_0x4f56d1={};_0x4f56d1[_0x8330('0x3c')]=_[_0x8330('0x3d')](db[_0x8330('0x39')][_0x8330('0x52')]);_0x4f56d1['query']=_[_0x8330('0x3d')](_0x3eb2b2[_0x8330('0x3e')]);_0x4f56d1['filters']=_[_0x8330('0x40')](_0x4f56d1[_0x8330('0x3c')],_0x4f56d1[_0x8330('0x3e')]);_0x45f8a2[_0x8330('0x41')]=_[_0x8330('0x40')](_0x4f56d1[_0x8330('0x3c')],qs[_0x8330('0x42')](_0x3eb2b2[_0x8330('0x3e')][_0x8330('0x42')]));_0x45f8a2[_0x8330('0x41')]=_0x45f8a2[_0x8330('0x41')][_0x8330('0x43')]?_0x45f8a2[_0x8330('0x41')]:_0x4f56d1[_0x8330('0x3c')];if(_0x3eb2b2[_0x8330('0x3e')][_0x8330('0x4c')]){_0x45f8a2[_0x8330('0x4d')]=[{'all':!![]}];}_0x45f8a2=_[_0x8330('0x49')]({},_0x45f8a2,_0x3eb2b2[_0x8330('0x4b')]);return db[_0x8330('0x39')]['find'](_0x45f8a2)[_0x8330('0x20')](handleEntityNotFound(_0x197830,null))['then'](respondWithResult(_0x197830,null))[_0x8330('0x50')](handleError(_0x197830,null));};exports[_0x8330('0x53')]=function(_0x3aab23,_0x456062){return db[_0x8330('0x39')][_0x8330('0x53')](_0x3aab23[_0x8330('0x54')],{})[_0x8330('0x20')](function(_0x4ec636){var _0x3369c9=_0x3aab23['user'][_0x8330('0x33')]({'plain':!![]});if(!_0x3369c9)throw new Error(_0x8330('0x55'));if(_0x3369c9['role']===_0x8330('0x56')){var _0x259b46=_0x4ec636['get']({'plain':!![]});var _0x47baa4=_0x8330('0x34');return db[_0x8330('0x57')]['find']({'where':{'name':_0x47baa4,'userProfileId':_0x3369c9[_0x8330('0x58')]},'raw':!![]})[_0x8330('0x20')](function(_0x7beac5){if(_0x7beac5&&_0x7beac5[_0x8330('0x59')]===0x0){return db[_0x8330('0x5a')][_0x8330('0x53')]({'name':_0x259b46[_0x8330('0x36')],'resourceId':_0x259b46['id'],'type':_0x7beac5[_0x8330('0x36')],'sectionId':_0x7beac5['id']},{})[_0x8330('0x20')](function(){return _0x4ec636;});}else{return _0x4ec636;}})[_0x8330('0x50')](function(_0x1e5b68){logger[_0x8330('0x24')](_0x8330('0x5b'),_0x1e5b68);throw _0x1e5b68;});}return _0x4ec636;})['then'](respondWithResult(_0x456062,0xc9))['catch'](handleError(_0x456062,null));};exports[_0x8330('0x5c')]=function(_0x136a7d,_0x42a4fb){if(_0x136a7d['body']['id']){delete _0x136a7d[_0x8330('0x54')]['id'];}return db[_0x8330('0x39')]['find']({'where':{'id':_0x136a7d[_0x8330('0x51')]['id']}})['then'](handleEntityNotFound(_0x42a4fb,null))['then'](saveUpdates(_0x136a7d[_0x8330('0x54')],null))[_0x8330('0x20')](respondWithResult(_0x42a4fb,null))[_0x8330('0x50')](handleError(_0x42a4fb,null));};exports[_0x8330('0x32')]=function(_0x1bd18d,_0x5261c3){return db[_0x8330('0x39')][_0x8330('0x5d')]({'where':{'id':_0x1bd18d['params']['id']}})[_0x8330('0x20')](handleEntityNotFound(_0x5261c3,null))[_0x8330('0x20')](removeEntity(_0x5261c3,null))[_0x8330('0x50')](handleError(_0x5261c3,null));};exports[_0x8330('0x5e')]=function(_0x8c8105,_0x40c907){return db[_0x8330('0x39')][_0x8330('0x5e')]()['then'](respondWithResult(_0x40c907,null))[_0x8330('0x50')](handleError(_0x40c907,null));};exports[_0x8330('0x5f')]=function(_0x3f42c4,_0x1c5e83,_0x340127){var _0x272488={'raw':!![],'where':{}},_0x4749cf={},_0x30c342;return db['ChatQueue'][_0x8330('0x60')]({'where':{'id':_0x3f42c4[_0x8330('0x51')]['id']}})['then'](handleEntityNotFound(_0x1c5e83,null))[_0x8330('0x20')](function(_0x1c6800){if(_0x1c6800){_0x30c342=_0x1c6800[_0x8330('0x33')]({'plain':!![]});_0x4749cf['model']=_[_0x8330('0x3d')](db[_0x8330('0x61')][_0x8330('0x52')]);_0x4749cf[_0x8330('0x3e')]=_[_0x8330('0x3d')](_0x3f42c4['query']);_0x4749cf[_0x8330('0x3f')]=_[_0x8330('0x40')](_0x4749cf[_0x8330('0x3c')],_0x4749cf[_0x8330('0x3e')]);_0x272488['attributes']=_['intersection'](_0x4749cf[_0x8330('0x3c')],qs[_0x8330('0x42')](_0x3f42c4[_0x8330('0x3e')][_0x8330('0x42')]));_0x272488['attributes']=_0x272488[_0x8330('0x41')][_0x8330('0x43')]?_0x272488['attributes']:_0x4749cf[_0x8330('0x3c')];if(!_0x3f42c4[_0x8330('0x3e')][_0x8330('0x44')](_0x8330('0x62'))){_0x272488[_0x8330('0x2c')]=qs[_0x8330('0x2c')](_0x3f42c4['query'][_0x8330('0x2c')]);_0x272488[_0x8330('0x2a')]=qs['offset'](_0x3f42c4[_0x8330('0x3e')]['offset']);}_0x272488[_0x8330('0x63')]=qs[_0x8330('0x45')](_0x3f42c4['query'][_0x8330('0x45')]);_0x272488[_0x8330('0x46')]=qs[_0x8330('0x3f')](_[_0x8330('0x47')](_0x3f42c4['query'],_0x4749cf['filters']));_0x272488['where'][_0x8330('0x64')]=_0x1c6800['id'];if(_0x3f42c4['query'][_0x8330('0x48')]){_0x272488[_0x8330('0x46')]=_[_0x8330('0x49')](_0x272488[_0x8330('0x46')],{'$or':_['map'](_0x272488['attributes'],function(_0x4692da){var _0x466d33={};_0x466d33[_0x4692da]={'$like':'%'+_0x3f42c4[_0x8330('0x3e')][_0x8330('0x48')]+'%'};return _0x466d33;})});}_0x272488=_[_0x8330('0x49')]({},_0x272488,_0x3f42c4[_0x8330('0x4b')]);return db[_0x8330('0x61')]['findAll'](_0x272488);}})['then'](function(_0x359616){if(_0x359616){return db[_0x8330('0x65')][_0x8330('0x66')]({'where':{'id':_['map'](_0x359616,_0x8330('0x67')),'role':'agent'},'attributes':['id',_0x8330('0x36'),_0x8330('0x68'),'updatedAt',_0x8330('0x69')]});}})[_0x8330('0x20')](function(_0x10bffa){if(_0x10bffa){return{'count':_0x10bffa[_0x8330('0x2d')],'rows':_[_0x8330('0x38')](_0x10bffa[_0x8330('0x4f')],function(_0x122b5c){return{'membername':_0x122b5c[_0x8330('0x36')],'UserId':_0x122b5c['id'],'queue_name':_0x30c342[_0x8330('0x36')],'ChatQueueId':_0x30c342['id'],'interface':util[_0x8330('0x6a')]('%s/%s',_0x8330('0x6b'),_0x122b5c[_0x8330('0x36')]),'penalty':0x0,'paused':_0x122b5c[_0x8330('0x68')],'createdAt':_0x122b5c[_0x8330('0x69')],'updatedAt':_0x122b5c[_0x8330('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1c5e83,_0x272488))['catch'](handleError(_0x1c5e83,null));};exports['getTeams']=function(_0x41003d,_0x5e57a6,_0x2135d0){var _0x5ba208={};var _0x35a055={};var _0x241f96;var _0x49fb35;return db[_0x8330('0x39')][_0x8330('0x60')]({'where':{'id':_0x41003d[_0x8330('0x51')]['id']}})[_0x8330('0x20')](handleEntityNotFound(_0x5e57a6,null))[_0x8330('0x20')](function(_0x1cc29e){if(_0x1cc29e){_0x241f96=_0x1cc29e;_0x35a055[_0x8330('0x3c')]=_['keys'](db[_0x8330('0x6d')][_0x8330('0x52')]);_0x35a055[_0x8330('0x3e')]=_[_0x8330('0x3d')](_0x41003d[_0x8330('0x3e')]);_0x35a055[_0x8330('0x3f')]=_[_0x8330('0x40')](_0x35a055[_0x8330('0x3c')],_0x35a055['query']);_0x5ba208[_0x8330('0x41')]=_['intersection'](_0x35a055[_0x8330('0x3c')],qs[_0x8330('0x42')](_0x41003d[_0x8330('0x3e')]['fields']));_0x5ba208[_0x8330('0x41')]=_0x5ba208['attributes'][_0x8330('0x43')]?_0x5ba208[_0x8330('0x41')]:_0x35a055[_0x8330('0x3c')];_0x5ba208[_0x8330('0x63')]=qs[_0x8330('0x45')](_0x41003d[_0x8330('0x3e')][_0x8330('0x45')]);_0x5ba208[_0x8330('0x46')]=qs[_0x8330('0x3f')](_[_0x8330('0x47')](_0x41003d['query'],_0x35a055[_0x8330('0x3f')]));if(_0x41003d[_0x8330('0x3e')][_0x8330('0x48')]){_0x5ba208[_0x8330('0x46')]=_[_0x8330('0x49')](_0x5ba208[_0x8330('0x46')],{'$or':_[_0x8330('0x38')](_0x5ba208[_0x8330('0x41')],function(_0x34380c){var _0x3ef09c={};_0x3ef09c[_0x34380c]={'$like':'%'+_0x41003d[_0x8330('0x3e')][_0x8330('0x48')]+'%'};return _0x3ef09c;})});}_0x5ba208=_['merge']({},_0x5ba208,_0x41003d[_0x8330('0x4b')]);return _0x241f96[_0x8330('0x6e')](_0x5ba208);}})['then'](function(_0x31beb2){if(_0x31beb2){_0x49fb35=_0x31beb2['length'];if(!_0x41003d[_0x8330('0x3e')]['hasOwnProperty']('nolimit')){_0x5ba208[_0x8330('0x2c')]=qs[_0x8330('0x2c')](_0x41003d['query'][_0x8330('0x2c')]);_0x5ba208[_0x8330('0x2a')]=qs[_0x8330('0x2a')](_0x41003d[_0x8330('0x3e')][_0x8330('0x2a')]);}return _0x241f96[_0x8330('0x6e')](_0x5ba208);}})[_0x8330('0x20')](function(_0x1ab2f3){if(_0x1ab2f3){return _0x1ab2f3?{'count':_0x49fb35,'rows':_0x1ab2f3}:null;}})['then'](respondWithResult(_0x5e57a6,null))[_0x8330('0x50')](handleError(_0x5e57a6,null));};exports[_0x8330('0x6f')]=function(_0x2ad6ed,_0x4a2384,_0x3cc52c){var _0x1525eb=_0x2ad6ed['body'][_0x8330('0x70')];return db[_0x8330('0x6d')][_0x8330('0x4e')]({'where':{'id':_0x1525eb},'attributes':['id'],'include':[{'model':db[_0x8330('0x65')],'as':_0x8330('0x71'),'attributes':['id',_0x8330('0x36'),_0x8330('0x72'),'voicePause',_0x8330('0x73')],'raw':!![]}]})[_0x8330('0x20')](function(_0x57a64a){if(_0x57a64a){var _0x471726=_['flatMap'](_0x57a64a,function(_0x2d834e){var _0x11aa88=_0x2d834e[_0x8330('0x33')]({'plain':!![]});return _0x11aa88[_0x8330('0x71')];});return db[_0x8330('0x39')][_0x8330('0x5d')]({'where':{'id':_0x2ad6ed[_0x8330('0x51')]['id']}})[_0x8330('0x20')](function(_0x1d8785){return db[_0x8330('0x74')][_0x8330('0x75')](function(_0x56c4a3){return _0x1d8785[_0x8330('0x6f')](_0x1525eb,{'transaction':_0x56c4a3})[_0x8330('0x20')](function(){return BPromise[_0x8330('0x76')](_0x471726,function(_0x37e507){return db[_0x8330('0x61')][_0x8330('0x77')]({'where':{'UserId':_0x37e507['id'],'ChatQueueId':_0x2ad6ed[_0x8330('0x51')]['id']},'transaction':_0x56c4a3});});})[_0x8330('0x20')](function(){_0x471726[_0x8330('0x78')](function(_0x1bae2f){socket['emit']('userChatQueue:save',{'UserId':_0x1bae2f['id'],'ChatQueueId':_0x1d8785['id']});});});});});}})[_0x8330('0x20')](respondWithStatusCode(_0x4a2384,null))[_0x8330('0x50')](handleError(_0x4a2384,null));};exports[_0x8330('0x79')]=function(_0x2d497c,_0x519975,_0x5b952d){return db['Team'][_0x8330('0x4e')]({'where':{'id':_0x2d497c[_0x8330('0x3e')][_0x8330('0x70')]},'attributes':['id'],'include':[{'model':db[_0x8330('0x65')],'as':_0x8330('0x71'),'attributes':['id'],'raw':!![]}]})[_0x8330('0x20')](handleEntityNotFound(_0x519975,null))[_0x8330('0x20')](function(_0x2f77fe){var _0x6a2f31=_[_0x8330('0x38')](_0x2f77fe,'id');var _0x951c84=[];var _0x5163d5=[];var _0x41c712=squel[_0x8330('0x7a')]();_0x41c712[_0x8330('0x7b')]('tq.TeamId')[_0x8330('0x7c')](_0x8330('0x7d'),'tq')[_0x8330('0x7e')](_0x8330('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8330('0x80'),_0x2d497c[_0x8330('0x51')]['id']);for(var _0x1cd4b7=0x0;_0x1cd4b7<_0x2f77fe['length'];_0x1cd4b7+=0x1){let _0x2a826b=_0x2f77fe[_0x1cd4b7];for(var _0x14afc6=0x0;_0x14afc6<_0x2a826b[_0x8330('0x71')][_0x8330('0x43')];_0x14afc6+=0x1){let _0x37b6d8=_0x2a826b[_0x8330('0x71')][_0x14afc6];var _0x22c94e=_0x41c712[_0x8330('0x81')]();_0x22c94e['where'](_0x8330('0x82'),_0x37b6d8['id']);_0x5163d5['push'](db[_0x8330('0x74')]['query'](_0x22c94e[_0x8330('0x83')](),{'type':db[_0x8330('0x74')][_0x8330('0x84')]['SELECT']})[_0x8330('0x20')](function(_0x3c5d15){if(_0x3c5d15[_0x8330('0x43')]===0x1){return _0x37b6d8['id'];}else{var _0x298bea=_[_0x8330('0x85')](_[_0x8330('0x38')](_0x3c5d15,_0x8330('0x86')),function(_0x39a648){return _['includes'](_0x6a2f31,_0x39a648);});if(_0x298bea){return _0x37b6d8['id'];}}}));}}return BPromise['all'](_0x5163d5)['then'](function(_0x4d9411){_0x951c84=_(_0x951c84)[_0x8330('0x87')](_0x4d9411)['compact']()[_0x8330('0x88')]();return db[_0x8330('0x39')][_0x8330('0x5d')]({'where':{'id':_0x2d497c[_0x8330('0x51')]['id']}})['then'](function(_0x311c05){return db['sequelize'][_0x8330('0x75')](function(_0x3052b8){return _0x311c05['removeTeams'](_0x2d497c[_0x8330('0x3e')][_0x8330('0x70')],{'transaction':_0x3052b8})[_0x8330('0x20')](function(){if(!_[_0x8330('0x89')](_0x951c84)){return _0x311c05[_0x8330('0x8a')](_0x951c84,{'transaction':_0x3052b8});}})[_0x8330('0x20')](function(){_0x951c84['forEach'](function(_0x4df005){socket[_0x8330('0x8b')](_0x8330('0x8c'),{'UserId':_0x4df005,'ChatQueueId':_0x311c05['id']});});});});});});})[_0x8330('0x20')](respondWithStatusCode(_0x519975,null))[_0x8330('0x50')](handleError(_0x519975,null));};exports[_0x8330('0x8d')]=function(_0x26e40b,_0x36ebe0,_0x2f32ca){return db[_0x8330('0x39')]['find']({'where':{'id':_0x26e40b[_0x8330('0x51')]['id']}})['then'](handleEntityNotFound(_0x36ebe0,null))[_0x8330('0x20')](function(_0x339d57){if(_0x339d57){return _0x339d57['addAgents'](_0x26e40b[_0x8330('0x54')]['ids'],_['omit'](_0x26e40b[_0x8330('0x54')],[_0x8330('0x70'),'id'])||{})[_0x8330('0x8e')](function(_0x35b607){for(var _0x257194=0x0;_0x257194<_0x26e40b[_0x8330('0x54')][_0x8330('0x70')][_0x8330('0x43')];_0x257194+=0x1){socket[_0x8330('0x8b')](_0x8330('0x8f'),{'UserId':Number(_0x26e40b[_0x8330('0x54')][_0x8330('0x70')][_0x257194]),'ChatQueueId':Number(_0x26e40b[_0x8330('0x51')]['id'])});}return _0x35b607;});}})[_0x8330('0x20')](respondWithResult(_0x36ebe0,null))[_0x8330('0x50')](handleError(_0x36ebe0,null));};exports['removeAgents']=function(_0x400f7c,_0x2b6d19,_0x552b04){return db[_0x8330('0x39')][_0x8330('0x5d')]({'where':{'id':_0x400f7c[_0x8330('0x51')]['id']}})['then'](handleEntityNotFound(_0x2b6d19,null))['then'](function(_0x2cc826){if(_0x2cc826){return _0x2cc826[_0x8330('0x8a')](_0x400f7c[_0x8330('0x3e')][_0x8330('0x70')])['then'](function(){if(_[_0x8330('0x90')](_0x400f7c[_0x8330('0x3e')][_0x8330('0x70')])){for(var _0xf99b50=0x0;_0xf99b50<_0x400f7c[_0x8330('0x3e')][_0x8330('0x70')][_0x8330('0x43')];_0xf99b50+=0x1){socket[_0x8330('0x8b')]('userChatQueue:remove',{'UserId':Number(_0x400f7c[_0x8330('0x3e')]['ids'][_0xf99b50]),'ChatQueueId':Number(_0x400f7c[_0x8330('0x51')]['id'])});}}else{socket[_0x8330('0x8b')]('userChatQueue:remove',{'UserId':Number(_0x400f7c[_0x8330('0x3e')][_0x8330('0x70')]),'ChatQueueId':Number(_0x400f7c[_0x8330('0x51')]['id'])});}});}})[_0x8330('0x20')](respondWithStatusCode(_0x2b6d19,null))[_0x8330('0x50')](handleError(_0x2b6d19,null));};exports[_0x8330('0x91')]=function(_0x16ecaa,_0x2b70b7,_0x3ace33){var _0xa627f8={};var _0x5357cb={};var _0x3b50b5;var _0x23bb8f;return db[_0x8330('0x39')][_0x8330('0x60')]({'where':{'id':_0x16ecaa['params']['id']}})[_0x8330('0x20')](handleEntityNotFound(_0x2b70b7,null))[_0x8330('0x20')](function(_0x212905){if(_0x212905){_0x3b50b5=_0x212905;_0x5357cb['model']=_[_0x8330('0x3d')](db['User'][_0x8330('0x52')]);_0x5357cb[_0x8330('0x3e')]=_['keys'](_0x16ecaa[_0x8330('0x3e')]);_0x5357cb['filters']=_['intersection'](_0x5357cb[_0x8330('0x3c')],_0x5357cb[_0x8330('0x3e')]);_0xa627f8[_0x8330('0x41')]=_[_0x8330('0x40')](_0x5357cb[_0x8330('0x3c')],qs[_0x8330('0x42')](_0x16ecaa[_0x8330('0x3e')][_0x8330('0x42')]));_0xa627f8[_0x8330('0x41')]=_0xa627f8['attributes'][_0x8330('0x43')]?_0xa627f8['attributes']:_0x5357cb[_0x8330('0x3c')];_0xa627f8[_0x8330('0x63')]=qs[_0x8330('0x45')](_0x16ecaa[_0x8330('0x3e')][_0x8330('0x45')]);_0xa627f8[_0x8330('0x46')]=qs[_0x8330('0x3f')](_[_0x8330('0x47')](_0x16ecaa[_0x8330('0x3e')],_0x5357cb[_0x8330('0x3f')]));if(_0x16ecaa[_0x8330('0x3e')]['filter']){_0xa627f8[_0x8330('0x46')]=_[_0x8330('0x49')](_0xa627f8[_0x8330('0x46')],{'$or':_[_0x8330('0x38')](_0xa627f8[_0x8330('0x41')],function(_0xf95151){var _0x2f22e3={};_0x2f22e3[_0xf95151]={'$like':'%'+_0x16ecaa[_0x8330('0x3e')][_0x8330('0x48')]+'%'};return _0x2f22e3;})});}_0xa627f8=_[_0x8330('0x49')]({},_0xa627f8,_0x16ecaa['options']);return _0x3b50b5[_0x8330('0x91')](_0xa627f8);}})[_0x8330('0x20')](function(_0x3e0f52){if(_0x3e0f52){_0x23bb8f=_0x3e0f52[_0x8330('0x43')];if(!_0x16ecaa[_0x8330('0x3e')][_0x8330('0x44')](_0x8330('0x62'))){_0xa627f8['limit']=qs[_0x8330('0x2c')](_0x16ecaa[_0x8330('0x3e')]['limit']);_0xa627f8[_0x8330('0x2a')]=qs[_0x8330('0x2a')](_0x16ecaa[_0x8330('0x3e')][_0x8330('0x2a')]);}return _0x3b50b5['getAgents'](_0xa627f8);}})[_0x8330('0x20')](function(_0x30ac91){if(_0x30ac91){return _0x30ac91?{'count':_0x23bb8f,'rows':_0x30ac91}:null;}})['then'](respondWithResult(_0x2b70b7,null))[_0x8330('0x50')](handleError(_0x2b70b7,null));};
\ No newline at end of file
+var _0x345b=['http','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','offset','undefined','limit','count','set','apply','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','ChatQueue','rawAttributes','type','key','query','keys','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','include','rows','params','length','includeAll','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','describe','getMembers','findOne','UserChatQueue','fields','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','findAll','interface','Agents','transaction','findOrCreate','emit','userChatQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','SELECT','every','TeamId','includes','all','compact','value','isEmpty','forEach','userChatQueue:remove','addAgents','omit','spread','getAgents','rimraf','moment','bluebird','mustache','util','path','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','../../config/utils','redis','defaults','socket.io-emitter','register','jayson/promise','client'];(function(_0x1a3203,_0x4f6730){var _0x458d8e=function(_0x3e4f86){while(--_0x3e4f86){_0x1a3203['push'](_0x1a3203['shift']());}};_0x458d8e(++_0x4f6730);}(_0x345b,0x10a));var _0xb345=function(_0xfdd6ce,_0x11403d){_0xfdd6ce=_0xfdd6ce-0x0;var _0x4df03a=_0x345b[_0xfdd6ce];return _0x4df03a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb345('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb345('0x1'));var BPromise=require(_0xb345('0x2'));var Mustache=require(_0xb345('0x3'));var util=require(_0xb345('0x4'));var path=require(_0xb345('0x5'));var sox=require(_0xb345('0x6'));var csv=require(_0xb345('0x7'));var ejs=require(_0xb345('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb345('0x9'));var squel=require(_0xb345('0xa'));var crypto=require(_0xb345('0xb'));var jsforce=require(_0xb345('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb345('0xd'));var Papa=require(_0xb345('0xe'));var Redis=require(_0xb345('0xf'));var authService=require(_0xb345('0x10'));var qs=require(_0xb345('0x11'));var as=require(_0xb345('0x12'));var hardwareService=require(_0xb345('0x13'));var logger=require(_0xb345('0x14'))('api');var utils=require(_0xb345('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb345('0x16')]=_[_0xb345('0x17')](config[_0xb345('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xb345('0x18'))(new Redis(config[_0xb345('0x16')]));require('./chatQueue.socket')[_0xb345('0x19')](socket);var jayson=require(_0xb345('0x1a'));var client=jayson[_0xb345('0x1b')][_0xb345('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4a8d0d,_0x4df8be,_0x5ae1ef,_0x5291d1){return new BPromise(function(_0x42ea54,_0x118b1f){var _0x39d182=_0x5291d1||client;return _0x39d182[_0xb345('0x1d')](_0x4a8d0d,_0x5ae1ef)[_0xb345('0x1e')](function(_0x37738d){logger[_0xb345('0x1f')](_0xb345('0x20'),_0x4df8be,_0xb345('0x21'));logger['debug'](_0xb345('0x22'),_0x4df8be,_0xb345('0x21'),JSON[_0xb345('0x23')](_0x37738d));if(_0x37738d[_0xb345('0x24')]){if(_0x37738d[_0xb345('0x24')][_0xb345('0x25')]===0x1f4){logger[_0xb345('0x24')](_0xb345('0x20'),_0x4df8be,_0x37738d[_0xb345('0x24')][_0xb345('0x26')]);return _0x118b1f(_0x37738d['error'][_0xb345('0x26')]);}logger[_0xb345('0x24')](_0xb345('0x20'),_0x4df8be,_0x37738d['error'][_0xb345('0x26')]);return _0x42ea54(_0x37738d[_0xb345('0x24')][_0xb345('0x26')]);}else{logger['info'](_0xb345('0x20'),_0x4df8be,_0xb345('0x21'));_0x42ea54(_0x37738d[_0xb345('0x27')][_0xb345('0x26')]);}})[_0xb345('0x28')](function(_0x31ef9d){logger[_0xb345('0x24')](_0xb345('0x20'),_0x4df8be,_0x31ef9d);_0x118b1f(_0x31ef9d);});});}function respondWithStatusCode(_0x5853f2,_0x3dcd29){_0x3dcd29=_0x3dcd29||0xcc;return function(_0x23ac2b){if(_0x23ac2b){return _0x5853f2[_0xb345('0x29')](_0x3dcd29);}return _0x5853f2[_0xb345('0x2a')](_0x3dcd29)[_0xb345('0x2b')]();};}function respondWithResult(_0x1d0885,_0x31e1b3){_0x31e1b3=_0x31e1b3||0xc8;return function(_0x1ec6f3){if(_0x1ec6f3){return _0x1d0885[_0xb345('0x2a')](_0x31e1b3)[_0xb345('0x2c')](_0x1ec6f3);}};}function respondWithFilteredResult(_0x46388b,_0x5d36b5){return function(_0x4aedf1){if(_0x4aedf1){var _0x117102=typeof _0x5d36b5[_0xb345('0x2d')]===_0xb345('0x2e')&&typeof _0x5d36b5[_0xb345('0x2f')]===_0xb345('0x2e');var _0x5a4eb0=_0x4aedf1[_0xb345('0x30')];var _0x2d5eda=_0x117102?0x0:_0x5d36b5['offset'];var _0x4e2e12=_0x117102?_0x4aedf1[_0xb345('0x30')]:_0x5d36b5[_0xb345('0x2d')]+_0x5d36b5['limit'];var _0x2ad7f5;if(_0x4e2e12>=_0x5a4eb0){_0x4e2e12=_0x5a4eb0;_0x2ad7f5=0xc8;}else{_0x2ad7f5=0xce;}_0x46388b[_0xb345('0x2a')](_0x2ad7f5);return _0x46388b[_0xb345('0x31')]('Content-Range',_0x2d5eda+'-'+_0x4e2e12+'/'+_0x5a4eb0)[_0xb345('0x2c')](_0x4aedf1);}return null;};}function patchUpdates(_0x410138){return function(_0x362a0f){try{jsonpatch[_0xb345('0x32')](_0x362a0f,_0x410138,!![]);}catch(_0x3593fc){return BPromise['reject'](_0x3593fc);}return _0x362a0f[_0xb345('0x33')]();};}function saveUpdates(_0x4af8b3,_0x43b89e){return function(_0x1ad214){if(_0x1ad214){return _0x1ad214[_0xb345('0x34')](_0x4af8b3)[_0xb345('0x1e')](function(_0x185828){return _0x185828;});}return null;};}function removeEntity(_0x3d25fb,_0x21f35d){return function(_0x414564){if(_0x414564){return _0x414564[_0xb345('0x35')]()['then'](function(){var _0x5076a6=_0x414564[_0xb345('0x36')]({'plain':!![]});var _0x3ed375=_0xb345('0x37');return db[_0xb345('0x38')]['destroy']({'where':{'type':_0x3ed375,'resourceId':_0x5076a6['id']}})['then'](function(){return _0x414564;});})[_0xb345('0x1e')](function(){_0x3d25fb[_0xb345('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2beb4,_0x202d19){return function(_0x257422){if(!_0x257422){_0x2beb4[_0xb345('0x29')](0x194);}return _0x257422;};}function handleError(_0x4dc8dc,_0x2bb71c){_0x2bb71c=_0x2bb71c||0x1f4;return function(_0x2338eb){logger[_0xb345('0x24')](_0x2338eb[_0xb345('0x39')]);if(_0x2338eb[_0xb345('0x3a')]){delete _0x2338eb[_0xb345('0x3a')];}_0x4dc8dc[_0xb345('0x2a')](_0x2bb71c)[_0xb345('0x3b')](_0x2338eb);};}exports['index']=function(_0x1e26eb,_0x5b8218){var _0x5e298c={},_0x4e28fd={},_0x282775={'count':0x0,'rows':[]};var _0x96dace=_['map'](db[_0xb345('0x3c')][_0xb345('0x3d')],function(_0x49beec){return{'name':_0x49beec['fieldName'],'type':_0x49beec[_0xb345('0x3e')][_0xb345('0x3f')]};});_0x4e28fd['model']=_['map'](_0x96dace,'name');_0x4e28fd[_0xb345('0x40')]=_[_0xb345('0x41')](_0x1e26eb[_0xb345('0x40')]);_0x4e28fd['filters']=_[_0xb345('0x42')](_0x4e28fd['model'],_0x4e28fd[_0xb345('0x40')]);_0x5e298c[_0xb345('0x43')]=_[_0xb345('0x42')](_0x4e28fd['model'],qs['fields'](_0x1e26eb['query']['fields']));_0x5e298c[_0xb345('0x43')]=_0x5e298c['attributes']['length']?_0x5e298c[_0xb345('0x43')]:_0x4e28fd[_0xb345('0x44')];if(!_0x1e26eb[_0xb345('0x40')][_0xb345('0x45')](_0xb345('0x46'))){_0x5e298c[_0xb345('0x2f')]=qs[_0xb345('0x2f')](_0x1e26eb[_0xb345('0x40')]['limit']);_0x5e298c[_0xb345('0x2d')]=qs[_0xb345('0x2d')](_0x1e26eb[_0xb345('0x40')][_0xb345('0x2d')]);}_0x5e298c[_0xb345('0x47')]=qs[_0xb345('0x48')](_0x1e26eb[_0xb345('0x40')][_0xb345('0x48')]);_0x5e298c[_0xb345('0x49')]=qs[_0xb345('0x4a')](_[_0xb345('0x4b')](_0x1e26eb[_0xb345('0x40')],_0x4e28fd['filters']),_0x96dace);if(_0x1e26eb['query'][_0xb345('0x4c')]){_0x5e298c[_0xb345('0x49')]=_['merge'](_0x5e298c['where'],{'$or':_[_0xb345('0x4d')](_0x96dace,function(_0xee8d0a){if(_0xee8d0a['type']!==_0xb345('0x4e')){var _0x7416f4={};_0x7416f4[_0xee8d0a['name']]={'$like':'%'+_0x1e26eb[_0xb345('0x40')]['filter']+'%'};return _0x7416f4;}})});}_0x5e298c=_[_0xb345('0x4f')]({},_0x5e298c,_0x1e26eb[_0xb345('0x50')]);var _0x30d14b={'where':_0x5e298c[_0xb345('0x49')]};return db[_0xb345('0x3c')]['count'](_0x30d14b)[_0xb345('0x1e')](function(_0x18b72d){_0x282775[_0xb345('0x30')]=_0x18b72d;if(_0x1e26eb['query']['includeAll']){_0x5e298c[_0xb345('0x51')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x5e298c);})[_0xb345('0x1e')](function(_0x43235f){_0x282775[_0xb345('0x52')]=_0x43235f;return _0x282775;})[_0xb345('0x1e')](respondWithFilteredResult(_0x5b8218,_0x5e298c))[_0xb345('0x28')](handleError(_0x5b8218,null));};exports['show']=function(_0x565f63,_0x438a05){var _0x149773={'raw':!![],'where':{'id':_0x565f63[_0xb345('0x53')]['id']}},_0x53a567={};_0x53a567[_0xb345('0x44')]=_[_0xb345('0x41')](db[_0xb345('0x3c')][_0xb345('0x3d')]);_0x53a567[_0xb345('0x40')]=_['keys'](_0x565f63[_0xb345('0x40')]);_0x53a567[_0xb345('0x4a')]=_[_0xb345('0x42')](_0x53a567[_0xb345('0x44')],_0x53a567[_0xb345('0x40')]);_0x149773[_0xb345('0x43')]=_['intersection'](_0x53a567[_0xb345('0x44')],qs['fields'](_0x565f63['query']['fields']));_0x149773['attributes']=_0x149773['attributes'][_0xb345('0x54')]?_0x149773[_0xb345('0x43')]:_0x53a567['model'];if(_0x565f63['query'][_0xb345('0x55')]){_0x149773[_0xb345('0x51')]=[{'all':!![]}];}_0x149773=_[_0xb345('0x4f')]({},_0x149773,_0x565f63[_0xb345('0x50')]);return db[_0xb345('0x3c')][_0xb345('0x56')](_0x149773)['then'](handleEntityNotFound(_0x438a05,null))[_0xb345('0x1e')](respondWithResult(_0x438a05,null))['catch'](handleError(_0x438a05,null));};exports['create']=function(_0x542cae,_0x5c2860){return db[_0xb345('0x3c')][_0xb345('0x57')](_0x542cae[_0xb345('0x58')],{})[_0xb345('0x1e')](function(_0x192dde){var _0x4ac863=_0x542cae['user'][_0xb345('0x36')]({'plain':!![]});if(!_0x4ac863)throw new Error(_0xb345('0x59'));if(_0x4ac863[_0xb345('0x5a')]===_0xb345('0x5b')){var _0x2bd09e=_0x192dde[_0xb345('0x36')]({'plain':!![]});var _0x472752=_0xb345('0x37');return db[_0xb345('0x5c')][_0xb345('0x56')]({'where':{'name':_0x472752,'userProfileId':_0x4ac863[_0xb345('0x5d')]},'raw':!![]})[_0xb345('0x1e')](function(_0x312153){if(_0x312153&&_0x312153[_0xb345('0x5e')]===0x0){return db[_0xb345('0x38')]['create']({'name':_0x2bd09e[_0xb345('0x3a')],'resourceId':_0x2bd09e['id'],'type':_0x312153['name'],'sectionId':_0x312153['id']},{})[_0xb345('0x1e')](function(){return _0x192dde;});}else{return _0x192dde;}})['catch'](function(_0x3f9bd7){logger['error'](_0xb345('0x5f'),_0x3f9bd7);throw _0x3f9bd7;});}return _0x192dde;})[_0xb345('0x1e')](respondWithResult(_0x5c2860,0xc9))[_0xb345('0x28')](handleError(_0x5c2860,null));};exports[_0xb345('0x34')]=function(_0xebfe3b,_0x7590ac){if(_0xebfe3b[_0xb345('0x58')]['id']){delete _0xebfe3b[_0xb345('0x58')]['id'];}return db[_0xb345('0x3c')][_0xb345('0x56')]({'where':{'id':_0xebfe3b[_0xb345('0x53')]['id']}})[_0xb345('0x1e')](handleEntityNotFound(_0x7590ac,null))[_0xb345('0x1e')](saveUpdates(_0xebfe3b['body'],null))[_0xb345('0x1e')](respondWithResult(_0x7590ac,null))[_0xb345('0x28')](handleError(_0x7590ac,null));};exports['destroy']=function(_0x8eb26f,_0x467ed0){return db[_0xb345('0x3c')]['find']({'where':{'id':_0x8eb26f[_0xb345('0x53')]['id']}})[_0xb345('0x1e')](handleEntityNotFound(_0x467ed0,null))['then'](removeEntity(_0x467ed0,null))[_0xb345('0x28')](handleError(_0x467ed0,null));};exports['describe']=function(_0x1d0c4c,_0x34be94){return db[_0xb345('0x3c')][_0xb345('0x60')]()['then'](respondWithResult(_0x34be94,null))[_0xb345('0x28')](handleError(_0x34be94,null));};exports[_0xb345('0x61')]=function(_0x3e7873,_0x6e4e1b,_0x22ebba){var _0x3dd06f={'raw':!![],'where':{}},_0x18238a={},_0x1952cb;return db[_0xb345('0x3c')][_0xb345('0x62')]({'where':{'id':_0x3e7873[_0xb345('0x53')]['id']}})[_0xb345('0x1e')](handleEntityNotFound(_0x6e4e1b,null))[_0xb345('0x1e')](function(_0x738984){if(_0x738984){_0x1952cb=_0x738984['get']({'plain':!![]});_0x18238a['model']=_[_0xb345('0x41')](db[_0xb345('0x63')]['rawAttributes']);_0x18238a[_0xb345('0x40')]=_['keys'](_0x3e7873['query']);_0x18238a[_0xb345('0x4a')]=_[_0xb345('0x42')](_0x18238a[_0xb345('0x44')],_0x18238a[_0xb345('0x40')]);_0x3dd06f[_0xb345('0x43')]=_[_0xb345('0x42')](_0x18238a['model'],qs[_0xb345('0x64')](_0x3e7873[_0xb345('0x40')][_0xb345('0x64')]));_0x3dd06f[_0xb345('0x43')]=_0x3dd06f[_0xb345('0x43')][_0xb345('0x54')]?_0x3dd06f[_0xb345('0x43')]:_0x18238a[_0xb345('0x44')];if(!_0x3e7873[_0xb345('0x40')][_0xb345('0x45')](_0xb345('0x46'))){_0x3dd06f[_0xb345('0x2f')]=qs['limit'](_0x3e7873['query'][_0xb345('0x2f')]);_0x3dd06f['offset']=qs['offset'](_0x3e7873[_0xb345('0x40')][_0xb345('0x2d')]);}_0x3dd06f[_0xb345('0x47')]=qs[_0xb345('0x48')](_0x3e7873['query'][_0xb345('0x48')]);_0x3dd06f[_0xb345('0x49')]=qs['filters'](_[_0xb345('0x4b')](_0x3e7873[_0xb345('0x40')],_0x18238a['filters']));_0x3dd06f[_0xb345('0x49')]['ChatQueueId']=_0x738984['id'];if(_0x3e7873[_0xb345('0x40')][_0xb345('0x4c')]){_0x3dd06f[_0xb345('0x49')]=_[_0xb345('0x4f')](_0x3dd06f[_0xb345('0x49')],{'$or':_[_0xb345('0x4d')](_0x3dd06f['attributes'],function(_0x17cb42){var _0x434cf1={};_0x434cf1[_0x17cb42]={'$like':'%'+_0x3e7873[_0xb345('0x40')][_0xb345('0x4c')]+'%'};return _0x434cf1;})});}_0x3dd06f=_[_0xb345('0x4f')]({},_0x3dd06f,_0x3e7873[_0xb345('0x50')]);return db[_0xb345('0x63')]['findAll'](_0x3dd06f);}})['then'](function(_0x4bd768){if(_0x4bd768){return db['User']['findAndCountAll']({'where':{'id':_[_0xb345('0x4d')](_0x4bd768,_0xb345('0x65')),'role':_0xb345('0x66')},'attributes':['id',_0xb345('0x3a'),_0xb345('0x67'),'updatedAt',_0xb345('0x68')]});}})[_0xb345('0x1e')](function(_0x34bc80){if(_0x34bc80){return{'count':_0x34bc80[_0xb345('0x30')],'rows':_[_0xb345('0x4d')](_0x34bc80[_0xb345('0x52')],function(_0x177e51){return{'membername':_0x177e51[_0xb345('0x3a')],'UserId':_0x177e51['id'],'queue_name':_0x1952cb[_0xb345('0x3a')],'ChatQueueId':_0x1952cb['id'],'interface':util[_0xb345('0x69')](_0xb345('0x6a'),_0xb345('0x6b'),_0x177e51[_0xb345('0x3a')]),'penalty':0x0,'paused':_0x177e51['chatPause'],'createdAt':_0x177e51[_0xb345('0x68')],'updatedAt':_0x177e51['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb345('0x1e')](respondWithFilteredResult(_0x6e4e1b,_0x3dd06f))[_0xb345('0x28')](handleError(_0x6e4e1b,null));};exports['getTeams']=function(_0x5ea3a0,_0x47328c,_0xa6f354){var _0x192455={};var _0x3fdee6={};var _0x47cfb0;var _0x5acc29;return db['ChatQueue']['findOne']({'where':{'id':_0x5ea3a0[_0xb345('0x53')]['id']}})['then'](handleEntityNotFound(_0x47328c,null))[_0xb345('0x1e')](function(_0x381204){if(_0x381204){_0x47cfb0=_0x381204;_0x3fdee6[_0xb345('0x44')]=_[_0xb345('0x41')](db[_0xb345('0x6c')][_0xb345('0x3d')]);_0x3fdee6[_0xb345('0x40')]=_[_0xb345('0x41')](_0x5ea3a0[_0xb345('0x40')]);_0x3fdee6[_0xb345('0x4a')]=_[_0xb345('0x42')](_0x3fdee6['model'],_0x3fdee6[_0xb345('0x40')]);_0x192455[_0xb345('0x43')]=_[_0xb345('0x42')](_0x3fdee6[_0xb345('0x44')],qs[_0xb345('0x64')](_0x5ea3a0['query']['fields']));_0x192455[_0xb345('0x43')]=_0x192455[_0xb345('0x43')][_0xb345('0x54')]?_0x192455[_0xb345('0x43')]:_0x3fdee6[_0xb345('0x44')];_0x192455[_0xb345('0x47')]=qs[_0xb345('0x48')](_0x5ea3a0['query'][_0xb345('0x48')]);_0x192455[_0xb345('0x49')]=qs[_0xb345('0x4a')](_[_0xb345('0x4b')](_0x5ea3a0['query'],_0x3fdee6[_0xb345('0x4a')]));if(_0x5ea3a0[_0xb345('0x40')][_0xb345('0x4c')]){_0x192455[_0xb345('0x49')]=_[_0xb345('0x4f')](_0x192455[_0xb345('0x49')],{'$or':_[_0xb345('0x4d')](_0x192455[_0xb345('0x43')],function(_0x107654){var _0x1b53af={};_0x1b53af[_0x107654]={'$like':'%'+_0x5ea3a0[_0xb345('0x40')][_0xb345('0x4c')]+'%'};return _0x1b53af;})});}_0x192455=_['merge']({},_0x192455,_0x5ea3a0[_0xb345('0x50')]);return _0x47cfb0[_0xb345('0x6d')](_0x192455);}})[_0xb345('0x1e')](function(_0x4c942a){if(_0x4c942a){_0x5acc29=_0x4c942a['length'];if(!_0x5ea3a0[_0xb345('0x40')][_0xb345('0x45')]('nolimit')){_0x192455['limit']=qs[_0xb345('0x2f')](_0x5ea3a0[_0xb345('0x40')][_0xb345('0x2f')]);_0x192455[_0xb345('0x2d')]=qs[_0xb345('0x2d')](_0x5ea3a0[_0xb345('0x40')][_0xb345('0x2d')]);}return _0x47cfb0[_0xb345('0x6d')](_0x192455);}})[_0xb345('0x1e')](function(_0x13693e){if(_0x13693e){return _0x13693e?{'count':_0x5acc29,'rows':_0x13693e}:null;}})[_0xb345('0x1e')](respondWithResult(_0x47328c,null))['catch'](handleError(_0x47328c,null));};exports[_0xb345('0x6e')]=function(_0x57fc01,_0x30ce4f,_0x3d5280){var _0xcab041=_0x57fc01[_0xb345('0x58')][_0xb345('0x6f')];return db[_0xb345('0x6c')][_0xb345('0x70')]({'where':{'id':_0xcab041},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb345('0x3a'),'online','voicePause',_0xb345('0x71')],'raw':!![]}]})['then'](function(_0x298758){if(_0x298758){var _0x2097a2=_['flatMap'](_0x298758,function(_0x534320){var _0x187046=_0x534320[_0xb345('0x36')]({'plain':!![]});return _0x187046[_0xb345('0x72')];});return db[_0xb345('0x3c')][_0xb345('0x56')]({'where':{'id':_0x57fc01[_0xb345('0x53')]['id']}})[_0xb345('0x1e')](function(_0x1185ab){return db['sequelize'][_0xb345('0x73')](function(_0x11b561){return _0x1185ab[_0xb345('0x6e')](_0xcab041,{'transaction':_0x11b561})[_0xb345('0x1e')](function(){return BPromise['each'](_0x2097a2,function(_0x32ae35){return db[_0xb345('0x63')][_0xb345('0x74')]({'where':{'UserId':_0x32ae35['id'],'ChatQueueId':_0x57fc01['params']['id']},'transaction':_0x11b561});});})[_0xb345('0x1e')](function(){_0x2097a2['forEach'](function(_0x483f84){socket[_0xb345('0x75')](_0xb345('0x76'),{'UserId':_0x483f84['id'],'ChatQueueId':_0x1185ab['id']});});});});});}})[_0xb345('0x1e')](respondWithStatusCode(_0x30ce4f,null))['catch'](handleError(_0x30ce4f,null));};exports[_0xb345('0x77')]=function(_0x5d7826,_0x1dcd37,_0x1e0c35){return db[_0xb345('0x6c')]['findAll']({'where':{'id':_0x5d7826['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xb345('0x78')],'as':_0xb345('0x72'),'attributes':['id'],'raw':!![]}]})[_0xb345('0x1e')](handleEntityNotFound(_0x1dcd37,null))[_0xb345('0x1e')](function(_0x349d2c){var _0x1dac68=_['map'](_0x349d2c,'id');var _0xb5e085=[];var _0x472c26=[];var _0x5e2e1d=squel[_0xb345('0x79')]();_0x5e2e1d[_0xb345('0x7a')](_0xb345('0x7b'))[_0xb345('0x7c')](_0xb345('0x7d'),'tq')[_0xb345('0x7e')](_0xb345('0x7f'),'ut',_0xb345('0x80'))['where'](_0xb345('0x81'),_0x5d7826[_0xb345('0x53')]['id']);for(var _0x1acc72=0x0;_0x1acc72<_0x349d2c[_0xb345('0x54')];_0x1acc72+=0x1){let _0x1d42c3=_0x349d2c[_0x1acc72];for(var _0x6b45c2=0x0;_0x6b45c2<_0x1d42c3[_0xb345('0x72')][_0xb345('0x54')];_0x6b45c2+=0x1){let _0x5772b6=_0x1d42c3[_0xb345('0x72')][_0x6b45c2];var _0x5e7932=_0x5e2e1d[_0xb345('0x82')]();_0x5e7932[_0xb345('0x49')](_0xb345('0x83'),_0x5772b6['id']);_0x472c26['push'](db['sequelize'][_0xb345('0x40')](_0x5e7932['toString'](),{'type':db[_0xb345('0x84')]['QueryTypes'][_0xb345('0x85')]})[_0xb345('0x1e')](function(_0x5992f7){if(_0x5992f7[_0xb345('0x54')]===0x1){return _0x5772b6['id'];}else{var _0x48fac8=_[_0xb345('0x86')](_[_0xb345('0x4d')](_0x5992f7,_0xb345('0x87')),function(_0xf4b5af){return _[_0xb345('0x88')](_0x1dac68,_0xf4b5af);});if(_0x48fac8){return _0x5772b6['id'];}}}));}}return BPromise[_0xb345('0x89')](_0x472c26)[_0xb345('0x1e')](function(_0x16917a){_0xb5e085=_(_0xb5e085)['union'](_0x16917a)[_0xb345('0x8a')]()[_0xb345('0x8b')]();return db[_0xb345('0x3c')][_0xb345('0x56')]({'where':{'id':_0x5d7826[_0xb345('0x53')]['id']}})[_0xb345('0x1e')](function(_0x1fd361){return db[_0xb345('0x84')][_0xb345('0x73')](function(_0x506fcd){return _0x1fd361[_0xb345('0x77')](_0x5d7826[_0xb345('0x40')][_0xb345('0x6f')],{'transaction':_0x506fcd})['then'](function(){if(!_[_0xb345('0x8c')](_0xb5e085)){return _0x1fd361['removeAgents'](_0xb5e085,{'transaction':_0x506fcd});}})[_0xb345('0x1e')](function(){_0xb5e085[_0xb345('0x8d')](function(_0x10e07d){socket['emit'](_0xb345('0x8e'),{'UserId':_0x10e07d,'ChatQueueId':_0x1fd361['id']});});});});});});})[_0xb345('0x1e')](respondWithStatusCode(_0x1dcd37,null))[_0xb345('0x28')](handleError(_0x1dcd37,null));};exports['addAgents']=function(_0x1e3a1c,_0x4e881a,_0x1f5af7){return db['ChatQueue'][_0xb345('0x56')]({'where':{'id':_0x1e3a1c[_0xb345('0x53')]['id']}})[_0xb345('0x1e')](handleEntityNotFound(_0x4e881a,null))[_0xb345('0x1e')](function(_0x51ce06){if(_0x51ce06){return _0x51ce06[_0xb345('0x8f')](_0x1e3a1c['body'][_0xb345('0x6f')],_[_0xb345('0x90')](_0x1e3a1c['body'],[_0xb345('0x6f'),'id'])||{})[_0xb345('0x91')](function(_0x42c3da){for(var _0x5b3575=0x0;_0x5b3575<_0x1e3a1c['body'][_0xb345('0x6f')][_0xb345('0x54')];_0x5b3575+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x1e3a1c[_0xb345('0x58')]['ids'][_0x5b3575]),'ChatQueueId':Number(_0x1e3a1c['params']['id'])});}return _0x42c3da;});}})[_0xb345('0x1e')](respondWithResult(_0x4e881a,null))[_0xb345('0x28')](handleError(_0x4e881a,null));};exports['removeAgents']=function(_0x1fd11f,_0xd4b275,_0x379364){return db[_0xb345('0x3c')][_0xb345('0x56')]({'where':{'id':_0x1fd11f[_0xb345('0x53')]['id']}})[_0xb345('0x1e')](handleEntityNotFound(_0xd4b275,null))[_0xb345('0x1e')](function(_0x47a213){if(_0x47a213){return _0x47a213['removeAgents'](_0x1fd11f[_0xb345('0x40')]['ids'])[_0xb345('0x1e')](function(){if(_['isArray'](_0x1fd11f[_0xb345('0x40')][_0xb345('0x6f')])){for(var _0x45c7bf=0x0;_0x45c7bf<_0x1fd11f[_0xb345('0x40')][_0xb345('0x6f')]['length'];_0x45c7bf+=0x1){socket[_0xb345('0x75')]('userChatQueue:remove',{'UserId':Number(_0x1fd11f[_0xb345('0x40')]['ids'][_0x45c7bf]),'ChatQueueId':Number(_0x1fd11f[_0xb345('0x53')]['id'])});}}else{socket[_0xb345('0x75')](_0xb345('0x8e'),{'UserId':Number(_0x1fd11f['query']['ids']),'ChatQueueId':Number(_0x1fd11f['params']['id'])});}});}})['then'](respondWithStatusCode(_0xd4b275,null))[_0xb345('0x28')](handleError(_0xd4b275,null));};exports[_0xb345('0x92')]=function(_0xd73e1a,_0x2ebb76,_0x408e08){var _0x35c81f={};var _0x733662={};var _0x5d6073;var _0x15bb42;return db[_0xb345('0x3c')][_0xb345('0x62')]({'where':{'id':_0xd73e1a['params']['id']}})[_0xb345('0x1e')](handleEntityNotFound(_0x2ebb76,null))[_0xb345('0x1e')](function(_0x433e55){if(_0x433e55){_0x5d6073=_0x433e55;_0x733662[_0xb345('0x44')]=_[_0xb345('0x41')](db[_0xb345('0x78')][_0xb345('0x3d')]);_0x733662[_0xb345('0x40')]=_[_0xb345('0x41')](_0xd73e1a['query']);_0x733662[_0xb345('0x4a')]=_[_0xb345('0x42')](_0x733662[_0xb345('0x44')],_0x733662[_0xb345('0x40')]);_0x35c81f[_0xb345('0x43')]=_[_0xb345('0x42')](_0x733662[_0xb345('0x44')],qs[_0xb345('0x64')](_0xd73e1a[_0xb345('0x40')][_0xb345('0x64')]));_0x35c81f[_0xb345('0x43')]=_0x35c81f['attributes'][_0xb345('0x54')]?_0x35c81f[_0xb345('0x43')]:_0x733662['model'];_0x35c81f[_0xb345('0x47')]=qs[_0xb345('0x48')](_0xd73e1a[_0xb345('0x40')]['sort']);_0x35c81f['where']=qs[_0xb345('0x4a')](_['pick'](_0xd73e1a['query'],_0x733662[_0xb345('0x4a')]));if(_0xd73e1a[_0xb345('0x40')][_0xb345('0x4c')]){_0x35c81f[_0xb345('0x49')]=_['merge'](_0x35c81f[_0xb345('0x49')],{'$or':_[_0xb345('0x4d')](_0x35c81f[_0xb345('0x43')],function(_0x49491c){var _0x188093={};_0x188093[_0x49491c]={'$like':'%'+_0xd73e1a['query']['filter']+'%'};return _0x188093;})});}_0x35c81f=_[_0xb345('0x4f')]({},_0x35c81f,_0xd73e1a[_0xb345('0x50')]);return _0x5d6073[_0xb345('0x92')](_0x35c81f);}})['then'](function(_0xaa67e){if(_0xaa67e){_0x15bb42=_0xaa67e[_0xb345('0x54')];if(!_0xd73e1a[_0xb345('0x40')]['hasOwnProperty']('nolimit')){_0x35c81f[_0xb345('0x2f')]=qs[_0xb345('0x2f')](_0xd73e1a[_0xb345('0x40')][_0xb345('0x2f')]);_0x35c81f[_0xb345('0x2d')]=qs['offset'](_0xd73e1a[_0xb345('0x40')][_0xb345('0x2d')]);}return _0x5d6073['getAgents'](_0x35c81f);}})[_0xb345('0x1e')](function(_0x28e878){if(_0x28e878){return _0x28e878?{'count':_0x15bb42,'rows':_0x28e878}:null;}})[_0xb345('0x1e')](respondWithResult(_0x2ebb76,null))[_0xb345('0x28')](handleError(_0x2ebb76,null));};
\ No newline at end of file
index 0b1e1cb..4c3778a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaef=['remove','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update'];(function(_0x554c4c,_0x29c1d2){var _0x4bcde9=function(_0x2d40de){while(--_0x2d40de){_0x554c4c['push'](_0x554c4c['shift']());}};_0x4bcde9(++_0x29c1d2);}(_0xbaef,0x1db));var _0xfbae=function(_0x3c82e2,_0x2bff81){_0x3c82e2=_0x3c82e2-0x0;var _0x1317b8=_0xbaef[_0x3c82e2];return _0x1317b8;};'use strict';var EventEmitter=require(_0xfbae('0x0'));var ChatQueue=require(_0xfbae('0x1'))['db'][_0xfbae('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xfbae('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfbae('0x4'),'afterDestroy':_0xfbae('0x5')};function emitEvent(_0x22c78c){return function(_0xa129d1,_0x58558e,_0x3a7f55){ChatQueueEvents['emit'](_0x22c78c+':'+_0xa129d1['id'],_0xa129d1);ChatQueueEvents['emit'](_0x22c78c,_0xa129d1);_0x3a7f55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xfbae('0x6')](e,emitEvent(event));}}module[_0xfbae('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x17c6=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2a881d,_0x3df3fd){var _0x5b8b41=function(_0x1ecb06){while(--_0x1ecb06){_0x2a881d['push'](_0x2a881d['shift']());}};_0x5b8b41(++_0x3df3fd);}(_0x17c6,0x19b));var _0x617c=function(_0xafb342,_0x4f3eb2){_0xafb342=_0xafb342-0x0;var _0x32b494=_0x17c6[_0xafb342];return _0x32b494;};'use strict';var EventEmitter=require(_0x617c('0x0'));var ChatQueue=require(_0x617c('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x617c('0x2')](0x0);var events={'afterCreate':_0x617c('0x3'),'afterUpdate':_0x617c('0x4'),'afterDestroy':_0x617c('0x5')};function emitEvent(_0x1340d6){return function(_0x17bb92,_0xe037dd,_0x5a1b42){ChatQueueEvents['emit'](_0x1340d6+':'+_0x17bb92['id'],_0x17bb92);ChatQueueEvents[_0x617c('0x6')](_0x1340d6,_0x17bb92);_0x5a1b42(null);};}for(var e in events){if(events[_0x617c('0x7')](e)){var event=events[e];ChatQueue[_0x617c('0x8')](e,emitEvent(event));}}module[_0x617c('0x9')]=ChatQueueEvents;
\ No newline at end of file
index 12b88be..4c1f33a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6733=['../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','../../config/logger','api','moment','path','rimraf'];(function(_0xa8691c,_0x5d7a58){var _0x2d2817=function(_0x4725bd){while(--_0x4725bd){_0xa8691c['push'](_0xa8691c['shift']());}};_0x2d2817(++_0x5d7a58);}(_0x6733,0x148));var _0x3673=function(_0x15065e,_0x108051){_0x15065e=_0x15065e-0x0;var _0x36f316=_0x6733[_0x15065e];return _0x36f316;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3673('0x0'))(_0x3673('0x1'));var moment=require(_0x3673('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3673('0x3'));var rimraf=require(_0x3673('0x4'));var config=require(_0x3673('0x5'));var attributes=require(_0x3673('0x6'));module['exports']=function(_0x8fbc52,_0x256c64){return _0x8fbc52['define'](_0x3673('0x7'),attributes,{'tableName':_0x3673('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xedbe=['./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x475654,_0x5dd7e6){var _0x485099=function(_0x32af9c){while(--_0x32af9c){_0x475654['push'](_0x475654['shift']());}};_0x485099(++_0x5dd7e6);}(_0xedbe,0x19c));var _0xeedb=function(_0x49c2ad,_0x37ee7b){_0x49c2ad=_0x49c2ad-0x0;var _0xeb3a70=_0xedbe[_0x49c2ad];return _0xeb3a70;};'use strict';var _=require(_0xeedb('0x0'));var util=require(_0xeedb('0x1'));var logger=require(_0xeedb('0x2'))(_0xeedb('0x3'));var moment=require(_0xeedb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeedb('0x5'));var rimraf=require(_0xeedb('0x6'));var config=require(_0xeedb('0x7'));var attributes=require(_0xeedb('0x8'));module[_0xeedb('0x9')]=function(_0x4cdcc0,_0x25db1d){return _0x4cdcc0[_0xeedb('0xa')](_0xeedb('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fa7d475..db77a3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fce=['where','attributes','limit','include','map','model','then','stringify','ShowChatQueue','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','debug','request\x20sent','error','code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','ChatQueue','options'];(function(_0x15da5e,_0x5de6c4){var _0xfc5ca4=function(_0x4d1768){while(--_0x4d1768){_0x15da5e['push'](_0x15da5e['shift']());}};_0xfc5ca4(++_0x5de6c4);}(_0x7fce,0xdc));var _0xe7fc=function(_0x40e400,_0x56155c){_0x40e400=_0x40e400-0x0;var _0x59e103=_0x7fce[_0x40e400];return _0x59e103;};'use strict';var _=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var moment=require(_0xe7fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xe7fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7fc('0x5'))(_0xe7fc('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe7fc('0x7')]['http']({'port':0x232a});config[_0xe7fc('0x8')]=_[_0xe7fc('0x9')](config[_0xe7fc('0x8')],{'host':_0xe7fc('0xa'),'port':0x18eb});var socket=require(_0xe7fc('0xb'))(new Redis(config['redis']));require(_0xe7fc('0xc'))['register'](socket);function respondWithRpcPromise(_0xc98c5e,_0x4e16a1,_0x16cc1b){return new BPromise(function(_0x1c05d3,_0x1fcfdd){return client[_0xe7fc('0xd')](_0xc98c5e,_0x16cc1b)['then'](function(_0x278e9a){logger[_0xe7fc('0xe')]('ChatQueue,\x20%s,\x20%s',_0x4e16a1,'request\x20sent');logger[_0xe7fc('0xf')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4e16a1,_0xe7fc('0x10'),JSON['stringify'](_0x278e9a));if(_0x278e9a['error']){if(_0x278e9a[_0xe7fc('0x11')][_0xe7fc('0x12')]===0x1f4){logger[_0xe7fc('0x11')](_0xe7fc('0x13'),_0x4e16a1,_0x278e9a[_0xe7fc('0x11')]['message']);return _0x1fcfdd(_0x278e9a[_0xe7fc('0x11')]['message']);}logger['error'](_0xe7fc('0x13'),_0x4e16a1,_0x278e9a[_0xe7fc('0x11')][_0xe7fc('0x14')]);return _0x1c05d3(_0x278e9a[_0xe7fc('0x11')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4e16a1,'request\x20sent');_0x1c05d3(_0x278e9a['result']['message']);}})[_0xe7fc('0x15')](function(_0x4a59d5){logger[_0xe7fc('0x11')](_0xe7fc('0x13'),_0x4e16a1,_0x4a59d5);_0x1fcfdd(_0x4a59d5);});});}exports[_0xe7fc('0x16')]=function(_0x1dae95){var _0x33ae4c=this;return new Promise(function(_0xc86a59,_0x329051){return db[_0xe7fc('0x17')]['findAll']({'raw':_0x1dae95[_0xe7fc('0x18')]?_0x1dae95[_0xe7fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1dae95['options']?_0x1dae95[_0xe7fc('0x18')][_0xe7fc('0x19')]||null:null,'attributes':_0x1dae95[_0xe7fc('0x18')]?_0x1dae95[_0xe7fc('0x18')][_0xe7fc('0x1a')]||null:null,'limit':_0x1dae95[_0xe7fc('0x18')]?_0x1dae95[_0xe7fc('0x18')][_0xe7fc('0x1b')]||null:null,'include':_0x1dae95[_0xe7fc('0x18')]?_0x1dae95[_0xe7fc('0x18')][_0xe7fc('0x1c')]?_[_0xe7fc('0x1d')](_0x1dae95[_0xe7fc('0x18')]['include'],function(_0x2d9e77){return{'model':db[_0x2d9e77[_0xe7fc('0x1e')]],'as':_0x2d9e77['as'],'attributes':_0x2d9e77[_0xe7fc('0x1a')],'include':_0x2d9e77[_0xe7fc('0x1c')]?_[_0xe7fc('0x1d')](_0x2d9e77[_0xe7fc('0x1c')],function(_0x553ac5){return{'model':db[_0x553ac5[_0xe7fc('0x1e')]],'as':_0x553ac5['as'],'attributes':_0x553ac5[_0xe7fc('0x1a')],'include':_0x553ac5[_0xe7fc('0x1c')]?_[_0xe7fc('0x1d')](_0x553ac5[_0xe7fc('0x1c')],function(_0x4416b5){return{'model':db[_0x4416b5[_0xe7fc('0x1e')]],'as':_0x4416b5['as'],'attributes':_0x4416b5['attributes']};}):[]};}):[]};}):[]:[]})[_0xe7fc('0x1f')](function(_0x2a08a4){logger['info'](_0xe7fc('0x16'),_0x1dae95);logger['debug'](_0xe7fc('0x16'),_0x1dae95,JSON[_0xe7fc('0x20')](_0x2a08a4));_0xc86a59(_0x2a08a4);})['catch'](function(_0x2b3830){logger['error'](_0xe7fc('0x16'),_0x2b3830[_0xe7fc('0x14')],_0x1dae95);_0x329051(_0x33ae4c[_0xe7fc('0x11')](0x1f4,_0x2b3830['message']));});});};exports[_0xe7fc('0x21')]=function(_0x4e780c){var _0x214f9c=this;return new Promise(function(_0x24dc00,_0x57b19b){return db['ChatQueue']['find']({'raw':_0x4e780c['options']?_0x4e780c[_0xe7fc('0x18')][_0xe7fc('0x22')]===undefined?!![]:![]:!![],'where':_0x4e780c[_0xe7fc('0x18')]?_0x4e780c[_0xe7fc('0x18')][_0xe7fc('0x19')]||null:null,'attributes':_0x4e780c[_0xe7fc('0x18')]?_0x4e780c[_0xe7fc('0x18')][_0xe7fc('0x1a')]||null:null,'include':_0x4e780c[_0xe7fc('0x18')]?_0x4e780c[_0xe7fc('0x18')]['include']?_[_0xe7fc('0x1d')](_0x4e780c[_0xe7fc('0x18')][_0xe7fc('0x1c')],function(_0x266856){return{'model':db[_0x266856[_0xe7fc('0x1e')]],'as':_0x266856['as'],'attributes':_0x266856['attributes'],'include':_0x266856[_0xe7fc('0x1c')]?_[_0xe7fc('0x1d')](_0x266856[_0xe7fc('0x1c')],function(_0x26ccdc){return{'model':db[_0x26ccdc[_0xe7fc('0x1e')]],'as':_0x26ccdc['as'],'attributes':_0x26ccdc[_0xe7fc('0x1a')],'include':_0x26ccdc[_0xe7fc('0x1c')]?_[_0xe7fc('0x1d')](_0x26ccdc[_0xe7fc('0x1c')],function(_0xb0e7b2){return{'model':db[_0xb0e7b2[_0xe7fc('0x1e')]],'as':_0xb0e7b2['as'],'attributes':_0xb0e7b2[_0xe7fc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c6ea6){logger[_0xe7fc('0xe')](_0xe7fc('0x21'),_0x4e780c);logger[_0xe7fc('0xf')](_0xe7fc('0x21'),_0x4e780c,JSON['stringify'](_0x3c6ea6));_0x24dc00(_0x3c6ea6);})[_0xe7fc('0x15')](function(_0xddc053){logger[_0xe7fc('0x11')](_0xe7fc('0x21'),_0xddc053[_0xe7fc('0x14')],_0x4e780c);_0x57b19b(_0x214f9c[_0xe7fc('0x11')](0x1f4,_0xddc053['message']));});});};
\ No newline at end of file
+var _0x3495=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','redis','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetChatQueue','options','raw','where','attributes','limit','map','include','model','then','catch','ShowChatQueue','find','lodash','util'];(function(_0x5bf185,_0x619801){var _0x16b83a=function(_0x168524){while(--_0x168524){_0x5bf185['push'](_0x5bf185['shift']());}};_0x16b83a(++_0x619801);}(_0x3495,0x1de));var _0x5349=function(_0x242cf9,_0x543e8d){_0x242cf9=_0x242cf9-0x0;var _0x3ee956=_0x3495[_0x242cf9];return _0x3ee956;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var moment=require(_0x5349('0x2'));var BPromise=require(_0x5349('0x3'));var rs=require(_0x5349('0x4'));var fs=require('fs');var Redis=require(_0x5349('0x5'));var db=require(_0x5349('0x6'))['db'];var utils=require(_0x5349('0x7'));var logger=require(_0x5349('0x8'))('rpc');var config=require(_0x5349('0x9'));var jayson=require(_0x5349('0xa'));var client=jayson['client'][_0x5349('0xb')]({'port':0x232a});config['redis']=_[_0x5349('0xc')](config['redis'],{'host':_0x5349('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5349('0xe')]));require(_0x5349('0xf'))[_0x5349('0x10')](socket);function respondWithRpcPromise(_0x23a1c7,_0x21bf91,_0x3a416e){return new BPromise(function(_0x35d425,_0x4bf160){return client[_0x5349('0x11')](_0x23a1c7,_0x3a416e)['then'](function(_0x2cbd83){logger[_0x5349('0x12')](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));logger[_0x5349('0x15')](_0x5349('0x16'),_0x21bf91,_0x5349('0x14'),JSON[_0x5349('0x17')](_0x2cbd83));if(_0x2cbd83[_0x5349('0x18')]){if(_0x2cbd83[_0x5349('0x18')]['code']===0x1f4){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x4bf160(_0x2cbd83[_0x5349('0x18')][_0x5349('0x19')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x35d425(_0x2cbd83['error'][_0x5349('0x19')]);}else{logger['info'](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));_0x35d425(_0x2cbd83[_0x5349('0x1a')][_0x5349('0x19')]);}})['catch'](function(_0x22d1ca){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x22d1ca);_0x4bf160(_0x22d1ca);});});}exports[_0x5349('0x1b')]=function(_0x4be827){var _0xeaab5a=this;return new Promise(function(_0x3594a4,_0x4f2cb6){return db['ChatQueue']['findAll']({'raw':_0x4be827[_0x5349('0x1c')]?_0x4be827['options'][_0x5349('0x1d')]===undefined?!![]:![]:!![],'where':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')][_0x5349('0x1e')]||null:null,'attributes':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')][_0x5349('0x1f')]||null:null,'limit':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')][_0x5349('0x20')]||null:null,'include':_0x4be827[_0x5349('0x1c')]?_0x4be827[_0x5349('0x1c')]['include']?_[_0x5349('0x21')](_0x4be827[_0x5349('0x1c')][_0x5349('0x22')],function(_0x49435a){return{'model':db[_0x49435a[_0x5349('0x23')]],'as':_0x49435a['as'],'attributes':_0x49435a['attributes'],'include':_0x49435a[_0x5349('0x22')]?_[_0x5349('0x21')](_0x49435a[_0x5349('0x22')],function(_0x49153e){return{'model':db[_0x49153e[_0x5349('0x23')]],'as':_0x49153e['as'],'attributes':_0x49153e[_0x5349('0x1f')],'include':_0x49153e[_0x5349('0x22')]?_[_0x5349('0x21')](_0x49153e[_0x5349('0x22')],function(_0x16edcb){return{'model':db[_0x16edcb[_0x5349('0x23')]],'as':_0x16edcb['as'],'attributes':_0x16edcb[_0x5349('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5349('0x24')](function(_0x5b5d6c){logger[_0x5349('0x12')](_0x5349('0x1b'),_0x4be827);logger['debug'](_0x5349('0x1b'),_0x4be827,JSON['stringify'](_0x5b5d6c));_0x3594a4(_0x5b5d6c);})[_0x5349('0x25')](function(_0x262f62){logger[_0x5349('0x18')](_0x5349('0x1b'),_0x262f62[_0x5349('0x19')],_0x4be827);_0x4f2cb6(_0xeaab5a[_0x5349('0x18')](0x1f4,_0x262f62['message']));});});};exports[_0x5349('0x26')]=function(_0x3162c8){var _0xb0bc68=this;return new Promise(function(_0x2c24f4,_0x538814){return db['ChatQueue'][_0x5349('0x27')]({'raw':_0x3162c8[_0x5349('0x1c')]?_0x3162c8[_0x5349('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3162c8[_0x5349('0x1c')]?_0x3162c8['options'][_0x5349('0x1e')]||null:null,'attributes':_0x3162c8[_0x5349('0x1c')]?_0x3162c8[_0x5349('0x1c')][_0x5349('0x1f')]||null:null,'include':_0x3162c8[_0x5349('0x1c')]?_0x3162c8[_0x5349('0x1c')]['include']?_['map'](_0x3162c8[_0x5349('0x1c')][_0x5349('0x22')],function(_0x1be201){return{'model':db[_0x1be201[_0x5349('0x23')]],'as':_0x1be201['as'],'attributes':_0x1be201[_0x5349('0x1f')],'include':_0x1be201[_0x5349('0x22')]?_[_0x5349('0x21')](_0x1be201['include'],function(_0x544557){return{'model':db[_0x544557[_0x5349('0x23')]],'as':_0x544557['as'],'attributes':_0x544557['attributes'],'include':_0x544557['include']?_[_0x5349('0x21')](_0x544557['include'],function(_0x18f881){return{'model':db[_0x18f881[_0x5349('0x23')]],'as':_0x18f881['as'],'attributes':_0x18f881[_0x5349('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd2376d){logger['info'](_0x5349('0x26'),_0x3162c8);logger[_0x5349('0x15')](_0x5349('0x26'),_0x3162c8,JSON['stringify'](_0xd2376d));_0x2c24f4(_0xd2376d);})['catch'](function(_0x5e5799){logger[_0x5349('0x18')](_0x5349('0x26'),_0x5e5799[_0x5349('0x19')],_0x3162c8);_0x538814(_0xb0bc68[_0x5349('0x18')](0x1f4,_0x5e5799[_0x5349('0x19')]));});});};
\ No newline at end of file
index 8638edb..1e54553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dae=['remove','update','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x5dfd2c,_0x1752cc){var _0x5edd0c=function(_0x233800){while(--_0x233800){_0x5dfd2c['push'](_0x5dfd2c['shift']());}};_0x5edd0c(++_0x1752cc);}(_0x2dae,0xc3));var _0xe2da=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x2dae[_0x4e9628];return _0x27bc8c;};'use strict';var ChatQueueEvents=require(_0xe2da('0x0'));var events=['save',_0xe2da('0x1'),_0xe2da('0x2')];function createListener(_0xcd0055,_0x167432){return function(_0x99b46f){_0x167432['emit'](_0xcd0055,_0x99b46f);};}function removeListener(_0x25b9f2,_0x439b5d){return function(){ChatQueueEvents[_0xe2da('0x3')](_0x25b9f2,_0x439b5d);};}exports[_0xe2da('0x4')]=function(_0x523c60){for(var _0x3e3e25=0x0,_0x89c70b=events[_0xe2da('0x5')];_0x3e3e25<_0x89c70b;_0x3e3e25++){var _0x2efbd8=events[_0x3e3e25];var _0x238da3=createListener(_0xe2da('0x6')+_0x2efbd8,_0x523c60);ChatQueueEvents['on'](_0x2efbd8,_0x238da3);}};
\ No newline at end of file
+var _0x5c12=['removeListener','chatQueue:','save','remove','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5c12,0x188));var _0x25c1=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0x5c12[_0x297c55];return _0x120389;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x25c1('0x0'),_0x25c1('0x1'),'update'];function createListener(_0x44bc2e,_0x1991e5){return function(_0x4042fe){_0x1991e5[_0x25c1('0x2')](_0x44bc2e,_0x4042fe);};}function removeListener(_0x2c5df0,_0x21ec20){return function(){ChatQueueEvents[_0x25c1('0x3')](_0x2c5df0,_0x21ec20);};}exports['register']=function(_0x204287){for(var _0x42ac16=0x0,_0x382922=events['length'];_0x42ac16<_0x382922;_0x42ac16++){var _0x5c69b1=events[_0x42ac16];var _0x24981c=createListener(_0x25c1('0x4')+_0x5c69b1,_0x204287);ChatQueueEvents['on'](_0x5c69b1,_0x24981c);}};
\ No newline at end of file
index 3809a0d..1298e9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x275c1b,_0x13947f){var _0x467b53=function(_0x513054){while(--_0x513054){_0x275c1b['push'](_0x275c1b['shift']());}};_0x467b53(++_0x13947f);}(_0x55ca,0x126));var _0xa55c=function(_0x17f716,_0x4a06c7){_0x17f716=_0x17f716-0x0;var _0x31f0de=_0x55ca[_0x17f716];return _0x31f0de;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3e74,0x175));var _0x43e7=function(_0x39692f,_0x2bc463){_0x39692f=_0x39692f-0x0;var _0x450664=_0x3e74[_0x39692f];return _0x450664;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
index 9c25001..46fb4c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc650=['STRING','DATE','moment','sequelize','exports'];(function(_0xb2ef0a,_0x34a268){var _0x3c80fe=function(_0x2ea3bc){while(--_0x2ea3bc){_0xb2ef0a['push'](_0xb2ef0a['shift']());}};_0x3c80fe(++_0x34a268);}(_0xc650,0xd9));var _0x0c65=function(_0x512395,_0x362341){_0x512395=_0x512395-0x0;var _0x3dfdda=_0xc650[_0x512395];return _0x3dfdda;};'use strict';var moment=require(_0x0c65('0x0'));var Sequelize=require(_0x0c65('0x1'));module[_0x0c65('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x0c65('0x3')]},'joinAt':{'type':Sequelize[_0x0c65('0x4')]},'leaveAt':{'type':Sequelize[_0x0c65('0x4')]},'acceptAt':{'type':Sequelize[_0x0c65('0x4')]},'exitAt':{'type':Sequelize[_0x0c65('0x4')]},'reason':{'type':Sequelize[_0x0c65('0x3')]}};
\ No newline at end of file
+var _0x06bf=['DATE','moment','sequelize','exports','STRING'];(function(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0x06bf,0x105));var _0xf06b=function(_0x5c79a3,_0xf8764e){_0x5c79a3=_0x5c79a3-0x0;var _0x3fc19b=_0x06bf[_0x5c79a3];return _0x3fc19b;};'use strict';var moment=require(_0xf06b('0x0'));var Sequelize=require(_0xf06b('0x1'));module[_0xf06b('0x2')]={'uniqueid':{'type':Sequelize[_0xf06b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf06b('0x3')]},'joinAt':{'type':Sequelize[_0xf06b('0x4')]},'leaveAt':{'type':Sequelize[_0xf06b('0x4')]},'acceptAt':{'type':Sequelize[_0xf06b('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf06b('0x3')]}};
\ No newline at end of file
index 63d9ac3..a4962ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecb2=['pick','filter','merge','VIRTUAL','options','findAll','show','params','rawAttributes','includeAll','include','find','catch','create','body','update','destroy','describe','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x947fd2,_0x975e90){var _0x5acc57=function(_0x48334e){while(--_0x48334e){_0x947fd2['push'](_0x947fd2['shift']());}};_0x5acc57(++_0x975e90);}(_0xecb2,0xf6));var _0x2ecb=function(_0x528785,_0x3e14b9){_0x528785=_0x528785-0x0;var _0x2c0c72=_0xecb2[_0x528785];return _0x2c0c72;};'use strict';var emlformat=require(_0x2ecb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2ecb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2ecb('0x2'));var Mustache=require(_0x2ecb('0x3'));var util=require(_0x2ecb('0x4'));var path=require(_0x2ecb('0x5'));var sox=require(_0x2ecb('0x6'));var csv=require(_0x2ecb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2ecb('0x8'));var crypto=require(_0x2ecb('0x9'));var jsforce=require(_0x2ecb('0xa'));var deskjs=require(_0x2ecb('0xb'));var toCsv=require(_0x2ecb('0x7'));var querystring=require('querystring');var Papa=require(_0x2ecb('0xc'));var Redis=require(_0x2ecb('0xd'));var authService=require(_0x2ecb('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2ecb('0xf'));var hardwareService=require(_0x2ecb('0x10'));var logger=require(_0x2ecb('0x11'))(_0x2ecb('0x12'));var utils=require(_0x2ecb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2ecb('0x14'));var db=require(_0x2ecb('0x15'))['db'];function respondWithStatusCode(_0x3d74b3,_0x29cb3d){_0x29cb3d=_0x29cb3d||0xcc;return function(_0x59568c){if(_0x59568c){return _0x3d74b3[_0x2ecb('0x16')](_0x29cb3d);}return _0x3d74b3[_0x2ecb('0x17')](_0x29cb3d)['end']();};}function respondWithResult(_0x10bc58,_0x234741){_0x234741=_0x234741||0xc8;return function(_0x48505e){if(_0x48505e){return _0x10bc58[_0x2ecb('0x17')](_0x234741)[_0x2ecb('0x18')](_0x48505e);}};}function respondWithFilteredResult(_0x121f29,_0x3fda3b){return function(_0xe429aa){if(_0xe429aa){var _0x37ea40=typeof _0x3fda3b[_0x2ecb('0x19')]===_0x2ecb('0x1a')&&typeof _0x3fda3b[_0x2ecb('0x1b')]==='undefined';var _0x1c3e62=_0xe429aa[_0x2ecb('0x1c')];var _0x5a1d41=_0x37ea40?0x0:_0x3fda3b[_0x2ecb('0x19')];var _0x4c17cf=_0x37ea40?_0xe429aa[_0x2ecb('0x1c')]:_0x3fda3b[_0x2ecb('0x19')]+_0x3fda3b[_0x2ecb('0x1b')];var _0x3101fa;if(_0x4c17cf>=_0x1c3e62){_0x4c17cf=_0x1c3e62;_0x3101fa=0xc8;}else{_0x3101fa=0xce;}_0x121f29[_0x2ecb('0x17')](_0x3101fa);return _0x121f29[_0x2ecb('0x1d')](_0x2ecb('0x1e'),_0x5a1d41+'-'+_0x4c17cf+'/'+_0x1c3e62)['json'](_0xe429aa);}return null;};}function patchUpdates(_0x8ff004){return function(_0x3aaaae){try{jsonpatch[_0x2ecb('0x1f')](_0x3aaaae,_0x8ff004,!![]);}catch(_0x4c8330){return BPromise[_0x2ecb('0x20')](_0x4c8330);}return _0x3aaaae[_0x2ecb('0x21')]();};}function saveUpdates(_0x4e3d3c,_0x5b9d50){return function(_0x2db610){if(_0x2db610){return _0x2db610['update'](_0x4e3d3c)[_0x2ecb('0x22')](function(_0x2a1834){return _0x2a1834;});}return null;};}function removeEntity(_0xba8379,_0x296ae0){return function(_0x1ff315){if(_0x1ff315){return _0x1ff315['destroy']()['then'](function(){_0xba8379[_0x2ecb('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa13f,_0x8f21c){return function(_0x45249b){if(!_0x45249b){_0x3fa13f[_0x2ecb('0x16')](0x194);}return _0x45249b;};}function handleError(_0x2eaaac,_0x20071b){_0x20071b=_0x20071b||0x1f4;return function(_0x171259){logger[_0x2ecb('0x23')](_0x171259[_0x2ecb('0x24')]);if(_0x171259[_0x2ecb('0x25')]){delete _0x171259[_0x2ecb('0x25')];}_0x2eaaac[_0x2ecb('0x17')](_0x20071b)[_0x2ecb('0x26')](_0x171259);};}exports[_0x2ecb('0x27')]=function(_0x75c8cb,_0x45059a){var _0x46092e={},_0x2d5ae3={},_0x294ff5={'count':0x0,'rows':[]};var _0x3e52b7=_[_0x2ecb('0x28')](db[_0x2ecb('0x29')]['rawAttributes'],function(_0x52f9f4){return{'name':_0x52f9f4[_0x2ecb('0x2a')],'type':_0x52f9f4[_0x2ecb('0x2b')][_0x2ecb('0x2c')]};});_0x2d5ae3[_0x2ecb('0x2d')]=_['map'](_0x3e52b7,_0x2ecb('0x25'));_0x2d5ae3[_0x2ecb('0x2e')]=_[_0x2ecb('0x2f')](_0x75c8cb[_0x2ecb('0x2e')]);_0x2d5ae3[_0x2ecb('0x30')]=_[_0x2ecb('0x31')](_0x2d5ae3['model'],_0x2d5ae3[_0x2ecb('0x2e')]);_0x46092e['attributes']=_[_0x2ecb('0x31')](_0x2d5ae3[_0x2ecb('0x2d')],qs[_0x2ecb('0x32')](_0x75c8cb[_0x2ecb('0x2e')][_0x2ecb('0x32')]));_0x46092e[_0x2ecb('0x33')]=_0x46092e[_0x2ecb('0x33')][_0x2ecb('0x34')]?_0x46092e[_0x2ecb('0x33')]:_0x2d5ae3['model'];if(!_0x75c8cb[_0x2ecb('0x2e')][_0x2ecb('0x35')](_0x2ecb('0x36'))){_0x46092e['limit']=qs[_0x2ecb('0x1b')](_0x75c8cb[_0x2ecb('0x2e')][_0x2ecb('0x1b')]);_0x46092e['offset']=qs[_0x2ecb('0x19')](_0x75c8cb[_0x2ecb('0x2e')][_0x2ecb('0x19')]);}_0x46092e[_0x2ecb('0x37')]=qs[_0x2ecb('0x38')](_0x75c8cb[_0x2ecb('0x2e')][_0x2ecb('0x38')]);_0x46092e[_0x2ecb('0x39')]=qs[_0x2ecb('0x30')](_[_0x2ecb('0x3a')](_0x75c8cb['query'],_0x2d5ae3[_0x2ecb('0x30')]),_0x3e52b7);if(_0x75c8cb['query'][_0x2ecb('0x3b')]){_0x46092e[_0x2ecb('0x39')]=_[_0x2ecb('0x3c')](_0x46092e[_0x2ecb('0x39')],{'$or':_[_0x2ecb('0x28')](_0x3e52b7,function(_0x369f44){if(_0x369f44['type']!==_0x2ecb('0x3d')){var _0x2f8f8c={};_0x2f8f8c[_0x369f44[_0x2ecb('0x25')]]={'$like':'%'+_0x75c8cb[_0x2ecb('0x2e')][_0x2ecb('0x3b')]+'%'};return _0x2f8f8c;}})});}_0x46092e=_[_0x2ecb('0x3c')]({},_0x46092e,_0x75c8cb[_0x2ecb('0x3e')]);var _0x361bde={'where':_0x46092e[_0x2ecb('0x39')]};return db[_0x2ecb('0x29')][_0x2ecb('0x1c')](_0x361bde)[_0x2ecb('0x22')](function(_0xa90974){_0x294ff5['count']=_0xa90974;if(_0x75c8cb[_0x2ecb('0x2e')]['includeAll']){_0x46092e['include']=[{'all':!![]}];}return db[_0x2ecb('0x29')][_0x2ecb('0x3f')](_0x46092e);})[_0x2ecb('0x22')](function(_0x818b70){_0x294ff5['rows']=_0x818b70;return _0x294ff5;})['then'](respondWithFilteredResult(_0x45059a,_0x46092e))['catch'](handleError(_0x45059a,null));};exports[_0x2ecb('0x40')]=function(_0x51ea11,_0x5d566e){var _0x231076={'raw':!![],'where':{'id':_0x51ea11[_0x2ecb('0x41')]['id']}},_0x312b35={};_0x312b35[_0x2ecb('0x2d')]=_[_0x2ecb('0x2f')](db[_0x2ecb('0x29')][_0x2ecb('0x42')]);_0x312b35[_0x2ecb('0x2e')]=_[_0x2ecb('0x2f')](_0x51ea11[_0x2ecb('0x2e')]);_0x312b35[_0x2ecb('0x30')]=_['intersection'](_0x312b35[_0x2ecb('0x2d')],_0x312b35[_0x2ecb('0x2e')]);_0x231076['attributes']=_[_0x2ecb('0x31')](_0x312b35[_0x2ecb('0x2d')],qs[_0x2ecb('0x32')](_0x51ea11['query']['fields']));_0x231076[_0x2ecb('0x33')]=_0x231076[_0x2ecb('0x33')][_0x2ecb('0x34')]?_0x231076[_0x2ecb('0x33')]:_0x312b35['model'];if(_0x51ea11[_0x2ecb('0x2e')][_0x2ecb('0x43')]){_0x231076[_0x2ecb('0x44')]=[{'all':!![]}];}_0x231076=_[_0x2ecb('0x3c')]({},_0x231076,_0x51ea11[_0x2ecb('0x3e')]);return db['ChatQueueReport'][_0x2ecb('0x45')](_0x231076)[_0x2ecb('0x22')](handleEntityNotFound(_0x5d566e,null))[_0x2ecb('0x22')](respondWithResult(_0x5d566e,null))[_0x2ecb('0x46')](handleError(_0x5d566e,null));};exports['create']=function(_0x6cb307,_0x5b66a7){return db[_0x2ecb('0x29')][_0x2ecb('0x47')](_0x6cb307[_0x2ecb('0x48')],{})['then'](respondWithResult(_0x5b66a7,0xc9))[_0x2ecb('0x46')](handleError(_0x5b66a7,null));};exports[_0x2ecb('0x49')]=function(_0x5f5350,_0x3afd6d){if(_0x5f5350[_0x2ecb('0x48')]['id']){delete _0x5f5350['body']['id'];}return db['ChatQueueReport'][_0x2ecb('0x45')]({'where':{'id':_0x5f5350[_0x2ecb('0x41')]['id']}})[_0x2ecb('0x22')](handleEntityNotFound(_0x3afd6d,null))['then'](saveUpdates(_0x5f5350[_0x2ecb('0x48')],null))['then'](respondWithResult(_0x3afd6d,null))['catch'](handleError(_0x3afd6d,null));};exports[_0x2ecb('0x4a')]=function(_0x273286,_0x1642ed){return db['ChatQueueReport'][_0x2ecb('0x45')]({'where':{'id':_0x273286['params']['id']}})[_0x2ecb('0x22')](handleEntityNotFound(_0x1642ed,null))[_0x2ecb('0x22')](removeEntity(_0x1642ed,null))[_0x2ecb('0x46')](handleError(_0x1642ed,null));};exports[_0x2ecb('0x4b')]=function(_0x414240,_0x479aca){return db[_0x2ecb('0x29')]['describe']()['then'](respondWithResult(_0x479aca,null))[_0x2ecb('0x46')](handleError(_0x479aca,null));};
\ No newline at end of file
+var _0x018c=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','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/logger','api','../../config/utils','../../config/license/util','sendStatus'];(function(_0x459e9c,_0x27535f){var _0x540355=function(_0x6cebde){while(--_0x6cebde){_0x459e9c['push'](_0x459e9c['shift']());}};_0x540355(++_0x27535f);}(_0x018c,0xda));var _0xc018=function(_0x598c27,_0x4af6a5){_0x598c27=_0x598c27-0x0;var _0x5efd18=_0x018c[_0x598c27];return _0x5efd18;};'use strict';var emlformat=require(_0xc018('0x0'));var rimraf=require(_0xc018('0x1'));var zipdir=require(_0xc018('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc018('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc018('0x4'));var util=require(_0xc018('0x5'));var path=require(_0xc018('0x6'));var sox=require(_0xc018('0x7'));var csv=require('to-csv');var ejs=require(_0xc018('0x8'));var fs=require('fs');var fs_extra=require(_0xc018('0x9'));var _=require(_0xc018('0xa'));var squel=require(_0xc018('0xb'));var crypto=require(_0xc018('0xc'));var jsforce=require(_0xc018('0xd'));var deskjs=require(_0xc018('0xe'));var toCsv=require(_0xc018('0xf'));var querystring=require(_0xc018('0x10'));var Papa=require(_0xc018('0x11'));var Redis=require(_0xc018('0x12'));var authService=require(_0xc018('0x13'));var qs=require(_0xc018('0x14'));var as=require(_0xc018('0x15'));var hardwareService=require(_0xc018('0x16'));var logger=require(_0xc018('0x17'))(_0xc018('0x18'));var utils=require(_0xc018('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc018('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53d2a3,_0x296006){_0x296006=_0x296006||0xcc;return function(_0x9221ef){if(_0x9221ef){return _0x53d2a3[_0xc018('0x1b')](_0x296006);}return _0x53d2a3[_0xc018('0x1c')](_0x296006)[_0xc018('0x1d')]();};}function respondWithResult(_0x3f4a28,_0x405f17){_0x405f17=_0x405f17||0xc8;return function(_0x316d7f){if(_0x316d7f){return _0x3f4a28[_0xc018('0x1c')](_0x405f17)[_0xc018('0x1e')](_0x316d7f);}};}function respondWithFilteredResult(_0x5d0ae3,_0x2f1a73){return function(_0x2a6598){if(_0x2a6598){var _0x21b840=typeof _0x2f1a73[_0xc018('0x1f')]===_0xc018('0x20')&&typeof _0x2f1a73[_0xc018('0x21')]===_0xc018('0x20');var _0x2a157d=_0x2a6598['count'];var _0x5f2c11=_0x21b840?0x0:_0x2f1a73[_0xc018('0x1f')];var _0x4e388e=_0x21b840?_0x2a6598[_0xc018('0x22')]:_0x2f1a73[_0xc018('0x1f')]+_0x2f1a73[_0xc018('0x21')];var _0x4a7380;if(_0x4e388e>=_0x2a157d){_0x4e388e=_0x2a157d;_0x4a7380=0xc8;}else{_0x4a7380=0xce;}_0x5d0ae3[_0xc018('0x1c')](_0x4a7380);return _0x5d0ae3[_0xc018('0x23')](_0xc018('0x24'),_0x5f2c11+'-'+_0x4e388e+'/'+_0x2a157d)['json'](_0x2a6598);}return null;};}function patchUpdates(_0x447b4d){return function(_0x4488eb){try{jsonpatch[_0xc018('0x25')](_0x4488eb,_0x447b4d,!![]);}catch(_0x428a57){return BPromise[_0xc018('0x26')](_0x428a57);}return _0x4488eb[_0xc018('0x27')]();};}function saveUpdates(_0x30e7a6,_0xfbbc65){return function(_0x991e64){if(_0x991e64){return _0x991e64[_0xc018('0x28')](_0x30e7a6)[_0xc018('0x29')](function(_0x117346){return _0x117346;});}return null;};}function removeEntity(_0x32687c,_0x1ff3f6){return function(_0x41b7da){if(_0x41b7da){return _0x41b7da[_0xc018('0x2a')]()[_0xc018('0x29')](function(){_0x32687c[_0xc018('0x1c')](0xcc)[_0xc018('0x1d')]();});}};}function handleEntityNotFound(_0x68871,_0x5bb786){return function(_0x365eb2){if(!_0x365eb2){_0x68871[_0xc018('0x1b')](0x194);}return _0x365eb2;};}function handleError(_0x195f7e,_0x331a0d){_0x331a0d=_0x331a0d||0x1f4;return function(_0x4a857d){logger[_0xc018('0x2b')](_0x4a857d[_0xc018('0x2c')]);if(_0x4a857d[_0xc018('0x2d')]){delete _0x4a857d['name'];}_0x195f7e['status'](_0x331a0d)[_0xc018('0x2e')](_0x4a857d);};}exports[_0xc018('0x2f')]=function(_0x4aa577,_0x5268d6){var _0x1a631c={},_0x31373c={},_0x31fcdc={'count':0x0,'rows':[]};var _0x5092a3=_[_0xc018('0x30')](db[_0xc018('0x31')][_0xc018('0x32')],function(_0x2e8fcd){return{'name':_0x2e8fcd[_0xc018('0x33')],'type':_0x2e8fcd[_0xc018('0x34')][_0xc018('0x35')]};});_0x31373c[_0xc018('0x36')]=_[_0xc018('0x30')](_0x5092a3,_0xc018('0x2d'));_0x31373c[_0xc018('0x37')]=_[_0xc018('0x38')](_0x4aa577[_0xc018('0x37')]);_0x31373c[_0xc018('0x39')]=_['intersection'](_0x31373c[_0xc018('0x36')],_0x31373c[_0xc018('0x37')]);_0x1a631c[_0xc018('0x3a')]=_[_0xc018('0x3b')](_0x31373c[_0xc018('0x36')],qs[_0xc018('0x3c')](_0x4aa577[_0xc018('0x37')][_0xc018('0x3c')]));_0x1a631c[_0xc018('0x3a')]=_0x1a631c[_0xc018('0x3a')][_0xc018('0x3d')]?_0x1a631c[_0xc018('0x3a')]:_0x31373c[_0xc018('0x36')];if(!_0x4aa577[_0xc018('0x37')]['hasOwnProperty'](_0xc018('0x3e'))){_0x1a631c[_0xc018('0x21')]=qs[_0xc018('0x21')](_0x4aa577[_0xc018('0x37')][_0xc018('0x21')]);_0x1a631c[_0xc018('0x1f')]=qs[_0xc018('0x1f')](_0x4aa577[_0xc018('0x37')][_0xc018('0x1f')]);}_0x1a631c[_0xc018('0x3f')]=qs[_0xc018('0x40')](_0x4aa577[_0xc018('0x37')]['sort']);_0x1a631c[_0xc018('0x41')]=qs[_0xc018('0x39')](_[_0xc018('0x42')](_0x4aa577[_0xc018('0x37')],_0x31373c[_0xc018('0x39')]),_0x5092a3);if(_0x4aa577[_0xc018('0x37')][_0xc018('0x43')]){_0x1a631c[_0xc018('0x41')]=_[_0xc018('0x44')](_0x1a631c[_0xc018('0x41')],{'$or':_[_0xc018('0x30')](_0x5092a3,function(_0x1409f9){if(_0x1409f9[_0xc018('0x34')]!==_0xc018('0x45')){var _0x52465a={};_0x52465a[_0x1409f9['name']]={'$like':'%'+_0x4aa577['query'][_0xc018('0x43')]+'%'};return _0x52465a;}})});}_0x1a631c=_[_0xc018('0x44')]({},_0x1a631c,_0x4aa577[_0xc018('0x46')]);var _0x5f1fe0={'where':_0x1a631c[_0xc018('0x41')]};return db[_0xc018('0x31')][_0xc018('0x22')](_0x5f1fe0)['then'](function(_0x187282){_0x31fcdc[_0xc018('0x22')]=_0x187282;if(_0x4aa577['query'][_0xc018('0x47')]){_0x1a631c['include']=[{'all':!![]}];}return db[_0xc018('0x31')][_0xc018('0x48')](_0x1a631c);})[_0xc018('0x29')](function(_0x2a18fb){_0x31fcdc[_0xc018('0x49')]=_0x2a18fb;return _0x31fcdc;})[_0xc018('0x29')](respondWithFilteredResult(_0x5268d6,_0x1a631c))[_0xc018('0x4a')](handleError(_0x5268d6,null));};exports[_0xc018('0x4b')]=function(_0x499d0b,_0x5ac004){var _0x38484d={'raw':!![],'where':{'id':_0x499d0b[_0xc018('0x4c')]['id']}},_0x29f6ab={};_0x29f6ab['model']=_[_0xc018('0x38')](db[_0xc018('0x31')]['rawAttributes']);_0x29f6ab[_0xc018('0x37')]=_[_0xc018('0x38')](_0x499d0b[_0xc018('0x37')]);_0x29f6ab[_0xc018('0x39')]=_[_0xc018('0x3b')](_0x29f6ab[_0xc018('0x36')],_0x29f6ab[_0xc018('0x37')]);_0x38484d['attributes']=_['intersection'](_0x29f6ab[_0xc018('0x36')],qs[_0xc018('0x3c')](_0x499d0b['query'][_0xc018('0x3c')]));_0x38484d[_0xc018('0x3a')]=_0x38484d[_0xc018('0x3a')]['length']?_0x38484d[_0xc018('0x3a')]:_0x29f6ab[_0xc018('0x36')];if(_0x499d0b['query'][_0xc018('0x47')]){_0x38484d[_0xc018('0x4d')]=[{'all':!![]}];}_0x38484d=_[_0xc018('0x44')]({},_0x38484d,_0x499d0b[_0xc018('0x46')]);return db[_0xc018('0x31')][_0xc018('0x4e')](_0x38484d)['then'](handleEntityNotFound(_0x5ac004,null))[_0xc018('0x29')](respondWithResult(_0x5ac004,null))[_0xc018('0x4a')](handleError(_0x5ac004,null));};exports[_0xc018('0x4f')]=function(_0x16116a,_0x53e83b){return db['ChatQueueReport']['create'](_0x16116a['body'],{})['then'](respondWithResult(_0x53e83b,0xc9))[_0xc018('0x4a')](handleError(_0x53e83b,null));};exports[_0xc018('0x28')]=function(_0x2c757e,_0x2428af){if(_0x2c757e[_0xc018('0x50')]['id']){delete _0x2c757e['body']['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x2c757e[_0xc018('0x4c')]['id']}})[_0xc018('0x29')](handleEntityNotFound(_0x2428af,null))[_0xc018('0x29')](saveUpdates(_0x2c757e[_0xc018('0x50')],null))[_0xc018('0x29')](respondWithResult(_0x2428af,null))['catch'](handleError(_0x2428af,null));};exports[_0xc018('0x2a')]=function(_0x2d86aa,_0x28532e){return db[_0xc018('0x31')][_0xc018('0x4e')]({'where':{'id':_0x2d86aa[_0xc018('0x4c')]['id']}})[_0xc018('0x29')](handleEntityNotFound(_0x28532e,null))[_0xc018('0x29')](removeEntity(_0x28532e,null))['catch'](handleError(_0x28532e,null));};exports['describe']=function(_0x8063f5,_0x3dd32c){return db[_0xc018('0x31')][_0xc018('0x51')]()['then'](respondWithResult(_0x3dd32c,null))['catch'](handleError(_0x3dd32c,null));};
\ No newline at end of file
index e268871..ca5e2ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x6e51f1,_0x11371a){var _0x141b4c=function(_0x2e85e7){while(--_0x2e85e7){_0x6e51f1['push'](_0x6e51f1['shift']());}};_0x141b4c(++_0x11371a);}(_0xe706,0xa3));var _0x6e70=function(_0x25ccb6,_0x429ba4){_0x25ccb6=_0x25ccb6-0x0;var _0x3c8292=_0xe706[_0x25ccb6];return _0x3c8292;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x4931c7,_0x5515db){var _0x57d4eb=function(_0x5a31d9){while(--_0x5a31d9){_0x4931c7['push'](_0x4931c7['shift']());}};_0x57d4eb(++_0x5515db);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x6182ff,_0x59d492){_0x6182ff=_0x6182ff-0x0;var _0x1cec22=_0xcb91[_0x6182ff];return _0x1cec22;};'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
index ed5f6fb..eb8caae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeef7=['ChatQueueReport','create','body','options','raw','CreateChatQueueReport','update','limit','UpdateChatQueueReport','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xeef7,0x7d));var _0x7eef=function(_0x4386f2,_0x252e18){_0x4386f2=_0x4386f2-0x0;var _0x50285e=_0xeef7[_0x4386f2];return _0x50285e;};'use strict';var _=require(_0x7eef('0x0'));var util=require(_0x7eef('0x1'));var moment=require('moment');var BPromise=require(_0x7eef('0x2'));var rs=require(_0x7eef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7eef('0x4'))(_0x7eef('0x5'));var config=require(_0x7eef('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x378a20,_0x4261aa,_0x4283d3){return new BPromise(function(_0x51bca2,_0x3c3c2b){return client[_0x7eef('0x7')](_0x378a20,_0x4283d3)[_0x7eef('0x8')](function(_0x16c390){logger[_0x7eef('0x9')](_0x7eef('0xa'),_0x4261aa,_0x7eef('0xb'));logger[_0x7eef('0xc')](_0x7eef('0xd'),_0x4261aa,'request\x20sent',JSON[_0x7eef('0xe')](_0x16c390));if(_0x16c390[_0x7eef('0xf')]){if(_0x16c390[_0x7eef('0xf')][_0x7eef('0x10')]===0x1f4){logger[_0x7eef('0xf')](_0x7eef('0xa'),_0x4261aa,_0x16c390[_0x7eef('0xf')]['message']);return _0x3c3c2b(_0x16c390[_0x7eef('0xf')][_0x7eef('0x11')]);}logger[_0x7eef('0xf')](_0x7eef('0xa'),_0x4261aa,_0x16c390['error']['message']);return _0x51bca2(_0x16c390[_0x7eef('0xf')][_0x7eef('0x11')]);}else{logger[_0x7eef('0x9')](_0x7eef('0xa'),_0x4261aa,_0x7eef('0xb'));_0x51bca2(_0x16c390[_0x7eef('0x12')][_0x7eef('0x11')]);}})[_0x7eef('0x13')](function(_0x263c33){logger[_0x7eef('0xf')](_0x7eef('0xa'),_0x4261aa,_0x263c33);_0x3c3c2b(_0x263c33);});});}exports['CreateChatQueueReport']=function(_0x25fa10){var _0x111d87=this;return new Promise(function(_0x576cc1,_0x3c957b){return db[_0x7eef('0x14')][_0x7eef('0x15')](_0x25fa10[_0x7eef('0x16')],{'raw':_0x25fa10[_0x7eef('0x17')]?_0x25fa10[_0x7eef('0x17')][_0x7eef('0x18')]===undefined?!![]:![]:!![]})[_0x7eef('0x8')](function(_0x1f3fa9){logger[_0x7eef('0x9')](_0x7eef('0x19'),_0x25fa10);logger[_0x7eef('0xc')](_0x7eef('0x19'),_0x25fa10,JSON[_0x7eef('0xe')](_0x1f3fa9));_0x576cc1(_0x1f3fa9);})[_0x7eef('0x13')](function(_0x4512d7){logger[_0x7eef('0xf')](_0x7eef('0x19'),_0x4512d7['message'],_0x25fa10);_0x3c957b(_0x111d87[_0x7eef('0xf')](0x1f4,_0x4512d7['message']));});});};exports['UpdateChatQueueReport']=function(_0x34b975){var _0x359156=this;return new Promise(function(_0xf38d6f,_0x223444){return db[_0x7eef('0x14')][_0x7eef('0x1a')](_0x34b975['body'],{'raw':_0x34b975[_0x7eef('0x17')]?_0x34b975[_0x7eef('0x17')][_0x7eef('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34b975[_0x7eef('0x17')]?_0x34b975[_0x7eef('0x17')]['where']||null:null,'attributes':_0x34b975[_0x7eef('0x17')]?_0x34b975[_0x7eef('0x17')]['attributes']||null:null,'limit':_0x34b975[_0x7eef('0x17')]?_0x34b975[_0x7eef('0x17')][_0x7eef('0x1b')]||null:null})[_0x7eef('0x8')](function(_0x34c700){logger[_0x7eef('0x9')](_0x7eef('0x1c'),_0x34b975);logger[_0x7eef('0xc')](_0x7eef('0x1c'),_0x34b975,JSON['stringify'](_0x34c700));_0xf38d6f(_0x34c700);})[_0x7eef('0x13')](function(_0x7637f5){logger['error'](_0x7eef('0x1c'),_0x7637f5[_0x7eef('0x11')],_0x34b975);_0x223444(_0x359156[_0x7eef('0xf')](0x1f4,_0x7637f5[_0x7eef('0x11')]));});});};
\ No newline at end of file
+var _0x367b=['options','raw','then','ChatQueueReport','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body'];(function(_0x65373e,_0x189b71){var _0x23ca97=function(_0x3df52b){while(--_0x3df52b){_0x65373e['push'](_0x65373e['shift']());}};_0x23ca97(++_0x189b71);}(_0x367b,0xad));var _0xb367=function(_0x9332c6,_0xe86afd){_0x9332c6=_0x9332c6-0x0;var _0xcd4647=_0x367b[_0x9332c6];return _0xcd4647;};'use strict';var _=require(_0xb367('0x0'));var util=require(_0xb367('0x1'));var moment=require(_0xb367('0x2'));var BPromise=require(_0xb367('0x3'));var rs=require(_0xb367('0x4'));var fs=require('fs');var Redis=require(_0xb367('0x5'));var db=require(_0xb367('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb367('0x7'));var jayson=require(_0xb367('0x8'));var client=jayson['client'][_0xb367('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15aad3,_0x35850a,_0x3c2e3b){return new BPromise(function(_0x20d220,_0x345816){return client[_0xb367('0xa')](_0x15aad3,_0x3c2e3b)['then'](function(_0x372876){logger[_0xb367('0xb')](_0xb367('0xc'),_0x35850a,_0xb367('0xd'));logger[_0xb367('0xe')](_0xb367('0xf'),_0x35850a,_0xb367('0xd'),JSON[_0xb367('0x10')](_0x372876));if(_0x372876[_0xb367('0x11')]){if(_0x372876[_0xb367('0x11')][_0xb367('0x12')]===0x1f4){logger[_0xb367('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x35850a,_0x372876[_0xb367('0x11')]['message']);return _0x345816(_0x372876[_0xb367('0x11')][_0xb367('0x13')]);}logger[_0xb367('0x11')](_0xb367('0xc'),_0x35850a,_0x372876[_0xb367('0x11')][_0xb367('0x13')]);return _0x20d220(_0x372876[_0xb367('0x11')][_0xb367('0x13')]);}else{logger['info'](_0xb367('0xc'),_0x35850a,_0xb367('0xd'));_0x20d220(_0x372876[_0xb367('0x14')][_0xb367('0x13')]);}})[_0xb367('0x15')](function(_0xea6211){logger[_0xb367('0x11')](_0xb367('0xc'),_0x35850a,_0xea6211);_0x345816(_0xea6211);});});}exports[_0xb367('0x16')]=function(_0x27109a){var _0x40c363=this;return new Promise(function(_0x334cee,_0x4b794b){return db['ChatQueueReport'][_0xb367('0x17')](_0x27109a[_0xb367('0x18')],{'raw':_0x27109a[_0xb367('0x19')]?_0x27109a[_0xb367('0x19')][_0xb367('0x1a')]===undefined?!![]:![]:!![]})[_0xb367('0x1b')](function(_0x9e34e){logger[_0xb367('0xb')](_0xb367('0x16'),_0x27109a);logger[_0xb367('0xe')](_0xb367('0x16'),_0x27109a,JSON[_0xb367('0x10')](_0x9e34e));_0x334cee(_0x9e34e);})[_0xb367('0x15')](function(_0x6a1563){logger[_0xb367('0x11')](_0xb367('0x16'),_0x6a1563[_0xb367('0x13')],_0x27109a);_0x4b794b(_0x40c363[_0xb367('0x11')](0x1f4,_0x6a1563['message']));});});};exports['UpdateChatQueueReport']=function(_0x54bf6f){var _0x33da17=this;return new Promise(function(_0x5ebdd7,_0xd35e34){return db[_0xb367('0x1c')]['update'](_0x54bf6f['body'],{'raw':_0x54bf6f['options']?_0x54bf6f['options'][_0xb367('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54bf6f[_0xb367('0x19')]?_0x54bf6f['options'][_0xb367('0x1d')]||null:null,'attributes':_0x54bf6f['options']?_0x54bf6f[_0xb367('0x19')][_0xb367('0x1e')]||null:null,'limit':_0x54bf6f['options']?_0x54bf6f[_0xb367('0x19')][_0xb367('0x1f')]||null:null})[_0xb367('0x1b')](function(_0x1247cd){logger['info'](_0xb367('0x20'),_0x54bf6f);logger['debug']('UpdateChatQueueReport',_0x54bf6f,JSON[_0xb367('0x10')](_0x1247cd));_0x5ebdd7(_0x1247cd);})[_0xb367('0x15')](function(_0x398b62){logger['error'](_0xb367('0x20'),_0x398b62[_0xb367('0x13')],_0x54bf6f);_0xd35e34(_0x33da17[_0xb367('0x11')](0x1f4,_0x398b62[_0xb367('0x13')]));});});};
\ No newline at end of file
index c63a6ec..2e16260 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabfe=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','post','put','update','destroy','exports','util','connect-timeout','express'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xabfe,0x11d));var _0xeabf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabfe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xeabf('0x0'));var path=require('path');var timeout=require(_0xeabf('0x1'));var express=require(_0xeabf('0x2'));var router=express[_0xeabf('0x3')]();var fs_extra=require(_0xeabf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeabf('0x5'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xeabf('0x6')]('/',auth[_0xeabf('0x7')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xeabf('0x8')]);router[_0xeabf('0x6')](_0xeabf('0x9'),auth[_0xeabf('0x7')](),controller[_0xeabf('0xa')]);router[_0xeabf('0xb')]('/',auth[_0xeabf('0x7')](),controller['create']);router[_0xeabf('0xc')](_0xeabf('0x9'),auth[_0xeabf('0x7')](),controller[_0xeabf('0xd')]);router['delete'](_0xeabf('0x9'),auth[_0xeabf('0x7')](),controller[_0xeabf('0xe')]);module[_0xeabf('0xf')]=router;
\ No newline at end of file
+var _0xb8c8=['show','post','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb8c8,0x6a));var _0x8b8c=function(_0x37553a,_0x57c562){_0x37553a=_0x37553a-0x0;var _0x297816=_0xb8c8[_0x37553a];return _0x297816;};'use strict';var multer=require(_0x8b8c('0x0'));var util=require(_0x8b8c('0x1'));var path=require('path');var timeout=require(_0x8b8c('0x2'));var express=require(_0x8b8c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8b8c('0x4'));var config=require(_0x8b8c('0x5'));var controller=require(_0x8b8c('0x6'));router['get']('/',auth[_0x8b8c('0x7')](),controller[_0x8b8c('0x8')]);router[_0x8b8c('0x9')](_0x8b8c('0xa'),auth['isAuthenticated'](),controller[_0x8b8c('0xb')]);router[_0x8b8c('0x9')](_0x8b8c('0xc'),auth[_0x8b8c('0x7')](),controller[_0x8b8c('0xd')]);router[_0x8b8c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8b8c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8b8c('0xf')]('/:id',auth[_0x8b8c('0x7')](),controller[_0x8b8c('0x10')]);module['exports']=router;
\ No newline at end of file
index b868bbc..0f6f53a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x500439,_0x24b02e){var _0x476501=function(_0x1b92ca){while(--_0x1b92ca){_0x500439['push'](_0x500439['shift']());}};_0x476501(++_0x24b02e);}(_0x54ef,0x112));var _0xf54e=function(_0x54fdfa,_0x1fc863){_0x54fdfa=_0x54fdfa-0x0;var _0x38b692=_0x54ef[_0x54fdfa];return _0x38b692;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x9bde,0xe1));var _0xe9bd=function(_0x32bd69,_0xb0c398){_0x32bd69=_0x32bd69-0x0;var _0x210d4b=_0x9bde[_0x32bd69];return _0x210d4b;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
index da919a6..328eab8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x163c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','send','index','map','ChatTransferReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x57a64c,_0x4876bb){var _0x1165d0=function(_0x4922f8){while(--_0x4922f8){_0x57a64c['push'](_0x57a64c['shift']());}};_0x1165d0(++_0x4876bb);}(_0x163c,0x172));var _0xc163=function(_0x248153,_0x19f032){_0x248153=_0x248153-0x0;var _0x1b30e0=_0x163c[_0x248153];return _0x1b30e0;};'use strict';var emlformat=require(_0xc163('0x0'));var rimraf=require(_0xc163('0x1'));var zipdir=require(_0xc163('0x2'));var jsonpatch=require(_0xc163('0x3'));var rp=require(_0xc163('0x4'));var moment=require(_0xc163('0x5'));var BPromise=require(_0xc163('0x6'));var Mustache=require(_0xc163('0x7'));var util=require(_0xc163('0x8'));var path=require(_0xc163('0x9'));var sox=require(_0xc163('0xa'));var csv=require(_0xc163('0xb'));var ejs=require(_0xc163('0xc'));var fs=require('fs');var fs_extra=require(_0xc163('0xd'));var _=require(_0xc163('0xe'));var squel=require(_0xc163('0xf'));var crypto=require(_0xc163('0x10'));var jsforce=require(_0xc163('0x11'));var deskjs=require(_0xc163('0x12'));var toCsv=require(_0xc163('0xb'));var querystring=require(_0xc163('0x13'));var Papa=require(_0xc163('0x14'));var Redis=require(_0xc163('0x15'));var authService=require(_0xc163('0x16'));var qs=require(_0xc163('0x17'));var as=require(_0xc163('0x18'));var hardwareService=require(_0xc163('0x19'));var logger=require(_0xc163('0x1a'))('api');var utils=require(_0xc163('0x1b'));var config=require(_0xc163('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0xc163('0x1d'))['db'];function respondWithStatusCode(_0x4f005b,_0x3eee87){_0x3eee87=_0x3eee87||0xcc;return function(_0x5795e8){if(_0x5795e8){return _0x4f005b[_0xc163('0x1e')](_0x3eee87);}return _0x4f005b['status'](_0x3eee87)[_0xc163('0x1f')]();};}function respondWithResult(_0x46cc4e,_0x57700d){_0x57700d=_0x57700d||0xc8;return function(_0x5354af){if(_0x5354af){return _0x46cc4e[_0xc163('0x20')](_0x57700d)[_0xc163('0x21')](_0x5354af);}};}function respondWithFilteredResult(_0x26b654,_0x6d7e47){return function(_0x5c9369){if(_0x5c9369){var _0x3ace1a=typeof _0x6d7e47[_0xc163('0x22')]===_0xc163('0x23')&&typeof _0x6d7e47[_0xc163('0x24')]===_0xc163('0x23');var _0x311ba7=_0x5c9369[_0xc163('0x25')];var _0x122310=_0x3ace1a?0x0:_0x6d7e47[_0xc163('0x22')];var _0x239624=_0x3ace1a?_0x5c9369['count']:_0x6d7e47[_0xc163('0x22')]+_0x6d7e47[_0xc163('0x24')];var _0x20f4a2;if(_0x239624>=_0x311ba7){_0x239624=_0x311ba7;_0x20f4a2=0xc8;}else{_0x20f4a2=0xce;}_0x26b654[_0xc163('0x20')](_0x20f4a2);return _0x26b654['set'](_0xc163('0x26'),_0x122310+'-'+_0x239624+'/'+_0x311ba7)[_0xc163('0x21')](_0x5c9369);}return null;};}function patchUpdates(_0x30d49f){return function(_0x46dd0f){try{jsonpatch[_0xc163('0x27')](_0x46dd0f,_0x30d49f,!![]);}catch(_0x118c59){return BPromise[_0xc163('0x28')](_0x118c59);}return _0x46dd0f[_0xc163('0x29')]();};}function saveUpdates(_0x10aa63,_0x5e063b){return function(_0xacc58e){if(_0xacc58e){return _0xacc58e['update'](_0x10aa63)[_0xc163('0x2a')](function(_0x4d7af9){return _0x4d7af9;});}return null;};}function removeEntity(_0x13a2f5,_0x57eda8){return function(_0x22e7a7){if(_0x22e7a7){return _0x22e7a7[_0xc163('0x2b')]()[_0xc163('0x2a')](function(){_0x13a2f5[_0xc163('0x20')](0xcc)[_0xc163('0x1f')]();});}};}function handleEntityNotFound(_0x359ed8,_0x53e623){return function(_0x4ea108){if(!_0x4ea108){_0x359ed8[_0xc163('0x1e')](0x194);}return _0x4ea108;};}function handleError(_0x569938,_0x3973a6){_0x3973a6=_0x3973a6||0x1f4;return function(_0x11a2cb){logger['error'](_0x11a2cb['stack']);if(_0x11a2cb[_0xc163('0x2c')]){delete _0x11a2cb[_0xc163('0x2c')];}_0x569938['status'](_0x3973a6)[_0xc163('0x2d')](_0x11a2cb);};}exports[_0xc163('0x2e')]=function(_0x446165,_0x35f4c8){var _0x5e440d={},_0x5cf081={},_0x587153={'count':0x0,'rows':[]};var _0x3e6e63=_[_0xc163('0x2f')](db[_0xc163('0x30')][_0xc163('0x31')],function(_0x33b326){return{'name':_0x33b326['fieldName'],'type':_0x33b326['type'][_0xc163('0x32')]};});_0x5cf081[_0xc163('0x33')]=_[_0xc163('0x2f')](_0x3e6e63,_0xc163('0x2c'));_0x5cf081[_0xc163('0x34')]=_[_0xc163('0x35')](_0x446165[_0xc163('0x34')]);_0x5cf081[_0xc163('0x36')]=_[_0xc163('0x37')](_0x5cf081[_0xc163('0x33')],_0x5cf081['query']);_0x5e440d[_0xc163('0x38')]=_[_0xc163('0x37')](_0x5cf081['model'],qs['fields'](_0x446165['query'][_0xc163('0x39')]));_0x5e440d[_0xc163('0x38')]=_0x5e440d[_0xc163('0x38')]['length']?_0x5e440d[_0xc163('0x38')]:_0x5cf081[_0xc163('0x33')];if(!_0x446165[_0xc163('0x34')][_0xc163('0x3a')](_0xc163('0x3b'))){_0x5e440d[_0xc163('0x24')]=qs[_0xc163('0x24')](_0x446165[_0xc163('0x34')][_0xc163('0x24')]);_0x5e440d[_0xc163('0x22')]=qs[_0xc163('0x22')](_0x446165[_0xc163('0x34')][_0xc163('0x22')]);}_0x5e440d['order']=qs['sort'](_0x446165[_0xc163('0x34')][_0xc163('0x3c')]);_0x5e440d[_0xc163('0x3d')]=qs[_0xc163('0x36')](_[_0xc163('0x3e')](_0x446165[_0xc163('0x34')],_0x5cf081[_0xc163('0x36')]),_0x3e6e63);if(_0x446165['query']['filter']){_0x5e440d[_0xc163('0x3d')]=_[_0xc163('0x3f')](_0x5e440d[_0xc163('0x3d')],{'$or':_[_0xc163('0x2f')](_0x3e6e63,function(_0x2170a0){if(_0x2170a0[_0xc163('0x40')]!==_0xc163('0x41')){var _0x52d365={};_0x52d365[_0x2170a0[_0xc163('0x2c')]]={'$like':'%'+_0x446165[_0xc163('0x34')][_0xc163('0x42')]+'%'};return _0x52d365;}})});}_0x5e440d=_[_0xc163('0x3f')]({},_0x5e440d,_0x446165['options']);var _0x1d427e={'where':_0x5e440d[_0xc163('0x3d')]};return db[_0xc163('0x30')][_0xc163('0x25')](_0x1d427e)[_0xc163('0x2a')](function(_0x278842){_0x587153[_0xc163('0x25')]=_0x278842;if(_0x446165[_0xc163('0x34')][_0xc163('0x43')]){_0x5e440d[_0xc163('0x44')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xc163('0x45')](_0x5e440d);})[_0xc163('0x2a')](function(_0x145296){_0x587153[_0xc163('0x46')]=_0x145296;return _0x587153;})['then'](respondWithFilteredResult(_0x35f4c8,_0x5e440d))[_0xc163('0x47')](handleError(_0x35f4c8,null));};exports[_0xc163('0x48')]=function(_0x615d0c,_0x2a1e63){var _0x77d19f={'raw':!![],'where':{'id':_0x615d0c[_0xc163('0x49')]['id']}},_0x116043={};_0x116043[_0xc163('0x33')]=_[_0xc163('0x35')](db[_0xc163('0x30')][_0xc163('0x31')]);_0x116043[_0xc163('0x34')]=_[_0xc163('0x35')](_0x615d0c[_0xc163('0x34')]);_0x116043[_0xc163('0x36')]=_[_0xc163('0x37')](_0x116043['model'],_0x116043['query']);_0x77d19f[_0xc163('0x38')]=_[_0xc163('0x37')](_0x116043['model'],qs[_0xc163('0x39')](_0x615d0c['query'][_0xc163('0x39')]));_0x77d19f['attributes']=_0x77d19f['attributes'][_0xc163('0x4a')]?_0x77d19f[_0xc163('0x38')]:_0x116043[_0xc163('0x33')];if(_0x615d0c[_0xc163('0x34')][_0xc163('0x43')]){_0x77d19f['include']=[{'all':!![]}];}_0x77d19f=_[_0xc163('0x3f')]({},_0x77d19f,_0x615d0c['options']);return db[_0xc163('0x30')][_0xc163('0x4b')](_0x77d19f)[_0xc163('0x2a')](handleEntityNotFound(_0x2a1e63,null))['then'](respondWithResult(_0x2a1e63,null))[_0xc163('0x47')](handleError(_0x2a1e63,null));};exports[_0xc163('0x4c')]=function(_0x53dca8,_0x1c2813){return db['ChatTransferReport']['create'](_0x53dca8[_0xc163('0x4d')],{})[_0xc163('0x2a')](respondWithResult(_0x1c2813,0xc9))[_0xc163('0x47')](handleError(_0x1c2813,null));};exports['update']=function(_0x112bce,_0x53856a){if(_0x112bce[_0xc163('0x4d')]['id']){delete _0x112bce['body']['id'];}return db[_0xc163('0x30')]['find']({'where':{'id':_0x112bce[_0xc163('0x49')]['id']}})[_0xc163('0x2a')](handleEntityNotFound(_0x53856a,null))[_0xc163('0x2a')](saveUpdates(_0x112bce[_0xc163('0x4d')],null))[_0xc163('0x2a')](respondWithResult(_0x53856a,null))[_0xc163('0x47')](handleError(_0x53856a,null));};exports['destroy']=function(_0x2b34a4,_0xe73673){return db[_0xc163('0x30')][_0xc163('0x4b')]({'where':{'id':_0x2b34a4[_0xc163('0x49')]['id']}})[_0xc163('0x2a')](handleEntityNotFound(_0xe73673,null))[_0xc163('0x2a')](removeEntity(_0xe73673,null))[_0xc163('0x47')](handleError(_0xe73673,null));};exports['describe']=function(_0x5cb7d7,_0xfe3540){return db[_0xc163('0x30')]['describe']()['then'](respondWithResult(_0xfe3540,null))['catch'](handleError(_0xfe3540,null));};
\ No newline at end of file
+var _0x4d53=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','end','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','create','update','body','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','to-csv'];(function(_0x38d4c7,_0x5573b1){var _0x537afd=function(_0x459a0f){while(--_0x459a0f){_0x38d4c7['push'](_0x38d4c7['shift']());}};_0x537afd(++_0x5573b1);}(_0x4d53,0x170));var _0x34d5=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x4d53[_0x134c2e];return _0x2825db;};'use strict';var emlformat=require(_0x34d5('0x0'));var rimraf=require(_0x34d5('0x1'));var zipdir=require(_0x34d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x34d5('0x3'));var BPromise=require(_0x34d5('0x4'));var Mustache=require(_0x34d5('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x34d5('0x6'));var ejs=require(_0x34d5('0x7'));var fs=require('fs');var fs_extra=require(_0x34d5('0x8'));var _=require(_0x34d5('0x9'));var squel=require(_0x34d5('0xa'));var crypto=require(_0x34d5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x34d5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x34d5('0xd'));var Papa=require(_0x34d5('0xe'));var Redis=require(_0x34d5('0xf'));var authService=require(_0x34d5('0x10'));var qs=require(_0x34d5('0x11'));var as=require(_0x34d5('0x12'));var hardwareService=require(_0x34d5('0x13'));var logger=require('../../config/logger')(_0x34d5('0x14'));var utils=require(_0x34d5('0x15'));var config=require(_0x34d5('0x16'));var licenseUtil=require(_0x34d5('0x17'));var db=require(_0x34d5('0x18'))['db'];function respondWithStatusCode(_0x57e56f,_0x46301e){_0x46301e=_0x46301e||0xcc;return function(_0x4370da){if(_0x4370da){return _0x57e56f['sendStatus'](_0x46301e);}return _0x57e56f[_0x34d5('0x19')](_0x46301e)['end']();};}function respondWithResult(_0x1c67ac,_0x562e91){_0x562e91=_0x562e91||0xc8;return function(_0x1dceba){if(_0x1dceba){return _0x1c67ac['status'](_0x562e91)[_0x34d5('0x1a')](_0x1dceba);}};}function respondWithFilteredResult(_0x3b900f,_0x571579){return function(_0x4fdaa5){if(_0x4fdaa5){var _0x5cb48f=typeof _0x571579[_0x34d5('0x1b')]===_0x34d5('0x1c')&&typeof _0x571579['limit']==='undefined';var _0xfa4220=_0x4fdaa5[_0x34d5('0x1d')];var _0x66acc5=_0x5cb48f?0x0:_0x571579['offset'];var _0x174373=_0x5cb48f?_0x4fdaa5[_0x34d5('0x1d')]:_0x571579[_0x34d5('0x1b')]+_0x571579[_0x34d5('0x1e')];var _0x595c48;if(_0x174373>=_0xfa4220){_0x174373=_0xfa4220;_0x595c48=0xc8;}else{_0x595c48=0xce;}_0x3b900f['status'](_0x595c48);return _0x3b900f[_0x34d5('0x1f')]('Content-Range',_0x66acc5+'-'+_0x174373+'/'+_0xfa4220)[_0x34d5('0x1a')](_0x4fdaa5);}return null;};}function patchUpdates(_0x3331fc){return function(_0x3a59d8){try{jsonpatch[_0x34d5('0x20')](_0x3a59d8,_0x3331fc,!![]);}catch(_0x45aa40){return BPromise[_0x34d5('0x21')](_0x45aa40);}return _0x3a59d8[_0x34d5('0x22')]();};}function saveUpdates(_0x14f062,_0x11c167){return function(_0x504013){if(_0x504013){return _0x504013['update'](_0x14f062)[_0x34d5('0x23')](function(_0x552b53){return _0x552b53;});}return null;};}function removeEntity(_0x25309d,_0x4bc844){return function(_0x2fe725){if(_0x2fe725){return _0x2fe725[_0x34d5('0x24')]()[_0x34d5('0x23')](function(){_0x25309d[_0x34d5('0x19')](0xcc)[_0x34d5('0x25')]();});}};}function handleEntityNotFound(_0x44cf8f,_0x1e5b1c){return function(_0x5df2db){if(!_0x5df2db){_0x44cf8f['sendStatus'](0x194);}return _0x5df2db;};}function handleError(_0x218423,_0x4532da){_0x4532da=_0x4532da||0x1f4;return function(_0x4dc2e2){logger[_0x34d5('0x26')](_0x4dc2e2['stack']);if(_0x4dc2e2[_0x34d5('0x27')]){delete _0x4dc2e2[_0x34d5('0x27')];}_0x218423[_0x34d5('0x19')](_0x4532da)[_0x34d5('0x28')](_0x4dc2e2);};}exports[_0x34d5('0x29')]=function(_0x5d143b,_0xa760da){var _0x46fd41={},_0x1a0a60={},_0x586c4f={'count':0x0,'rows':[]};var _0x509102=_[_0x34d5('0x2a')](db[_0x34d5('0x2b')][_0x34d5('0x2c')],function(_0x2a2ad4){return{'name':_0x2a2ad4[_0x34d5('0x2d')],'type':_0x2a2ad4[_0x34d5('0x2e')][_0x34d5('0x2f')]};});_0x1a0a60[_0x34d5('0x30')]=_[_0x34d5('0x2a')](_0x509102,_0x34d5('0x27'));_0x1a0a60['query']=_[_0x34d5('0x31')](_0x5d143b['query']);_0x1a0a60[_0x34d5('0x32')]=_['intersection'](_0x1a0a60[_0x34d5('0x30')],_0x1a0a60[_0x34d5('0x33')]);_0x46fd41[_0x34d5('0x34')]=_[_0x34d5('0x35')](_0x1a0a60['model'],qs[_0x34d5('0x36')](_0x5d143b[_0x34d5('0x33')][_0x34d5('0x36')]));_0x46fd41['attributes']=_0x46fd41[_0x34d5('0x34')][_0x34d5('0x37')]?_0x46fd41['attributes']:_0x1a0a60[_0x34d5('0x30')];if(!_0x5d143b[_0x34d5('0x33')][_0x34d5('0x38')](_0x34d5('0x39'))){_0x46fd41[_0x34d5('0x1e')]=qs[_0x34d5('0x1e')](_0x5d143b[_0x34d5('0x33')][_0x34d5('0x1e')]);_0x46fd41[_0x34d5('0x1b')]=qs[_0x34d5('0x1b')](_0x5d143b[_0x34d5('0x33')][_0x34d5('0x1b')]);}_0x46fd41[_0x34d5('0x3a')]=qs[_0x34d5('0x3b')](_0x5d143b[_0x34d5('0x33')][_0x34d5('0x3b')]);_0x46fd41[_0x34d5('0x3c')]=qs[_0x34d5('0x32')](_[_0x34d5('0x3d')](_0x5d143b[_0x34d5('0x33')],_0x1a0a60[_0x34d5('0x32')]),_0x509102);if(_0x5d143b['query']['filter']){_0x46fd41[_0x34d5('0x3c')]=_[_0x34d5('0x3e')](_0x46fd41[_0x34d5('0x3c')],{'$or':_[_0x34d5('0x2a')](_0x509102,function(_0x28bbe1){if(_0x28bbe1[_0x34d5('0x2e')]!==_0x34d5('0x3f')){var _0x31b762={};_0x31b762[_0x28bbe1[_0x34d5('0x27')]]={'$like':'%'+_0x5d143b[_0x34d5('0x33')]['filter']+'%'};return _0x31b762;}})});}_0x46fd41=_['merge']({},_0x46fd41,_0x5d143b[_0x34d5('0x40')]);var _0x316ae1={'where':_0x46fd41['where']};return db[_0x34d5('0x2b')][_0x34d5('0x1d')](_0x316ae1)[_0x34d5('0x23')](function(_0x1f598c){_0x586c4f[_0x34d5('0x1d')]=_0x1f598c;if(_0x5d143b[_0x34d5('0x33')][_0x34d5('0x41')]){_0x46fd41['include']=[{'all':!![]}];}return db[_0x34d5('0x2b')][_0x34d5('0x42')](_0x46fd41);})['then'](function(_0x59285b){_0x586c4f['rows']=_0x59285b;return _0x586c4f;})[_0x34d5('0x23')](respondWithFilteredResult(_0xa760da,_0x46fd41))[_0x34d5('0x43')](handleError(_0xa760da,null));};exports[_0x34d5('0x44')]=function(_0x4ebc81,_0x33f0d7){var _0x13f453={'raw':!![],'where':{'id':_0x4ebc81[_0x34d5('0x45')]['id']}},_0x30855f={};_0x30855f['model']=_[_0x34d5('0x31')](db[_0x34d5('0x2b')][_0x34d5('0x2c')]);_0x30855f[_0x34d5('0x33')]=_[_0x34d5('0x31')](_0x4ebc81[_0x34d5('0x33')]);_0x30855f[_0x34d5('0x32')]=_[_0x34d5('0x35')](_0x30855f[_0x34d5('0x30')],_0x30855f['query']);_0x13f453[_0x34d5('0x34')]=_[_0x34d5('0x35')](_0x30855f[_0x34d5('0x30')],qs[_0x34d5('0x36')](_0x4ebc81['query'][_0x34d5('0x36')]));_0x13f453['attributes']=_0x13f453[_0x34d5('0x34')][_0x34d5('0x37')]?_0x13f453[_0x34d5('0x34')]:_0x30855f[_0x34d5('0x30')];if(_0x4ebc81[_0x34d5('0x33')]['includeAll']){_0x13f453['include']=[{'all':!![]}];}_0x13f453=_['merge']({},_0x13f453,_0x4ebc81[_0x34d5('0x40')]);return db['ChatTransferReport']['find'](_0x13f453)[_0x34d5('0x23')](handleEntityNotFound(_0x33f0d7,null))['then'](respondWithResult(_0x33f0d7,null))[_0x34d5('0x43')](handleError(_0x33f0d7,null));};exports[_0x34d5('0x46')]=function(_0x5ee096,_0x540f4b){return db[_0x34d5('0x2b')][_0x34d5('0x46')](_0x5ee096['body'],{})[_0x34d5('0x23')](respondWithResult(_0x540f4b,0xc9))['catch'](handleError(_0x540f4b,null));};exports[_0x34d5('0x47')]=function(_0x54de4b,_0x13f946){if(_0x54de4b[_0x34d5('0x48')]['id']){delete _0x54de4b[_0x34d5('0x48')]['id'];}return db[_0x34d5('0x2b')][_0x34d5('0x49')]({'where':{'id':_0x54de4b[_0x34d5('0x45')]['id']}})[_0x34d5('0x23')](handleEntityNotFound(_0x13f946,null))['then'](saveUpdates(_0x54de4b[_0x34d5('0x48')],null))[_0x34d5('0x23')](respondWithResult(_0x13f946,null))[_0x34d5('0x43')](handleError(_0x13f946,null));};exports[_0x34d5('0x24')]=function(_0x13f8c2,_0x2e5dff){return db['ChatTransferReport']['find']({'where':{'id':_0x13f8c2[_0x34d5('0x45')]['id']}})[_0x34d5('0x23')](handleEntityNotFound(_0x2e5dff,null))[_0x34d5('0x23')](removeEntity(_0x2e5dff,null))[_0x34d5('0x43')](handleError(_0x2e5dff,null));};exports[_0x34d5('0x4a')]=function(_0x5db2ac,_0x251717){return db[_0x34d5('0x2b')]['describe']()['then'](respondWithResult(_0x251717,null))['catch'](handleError(_0x251717,null));};
\ No newline at end of file
index 30772c7..e2ddc3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6fc=['bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatTransferReport','uniqueid','lodash','../../config/logger','moment'];(function(_0x8de00b,_0x1ac32b){var _0x4c4552=function(_0x46733f){while(--_0x46733f){_0x8de00b['push'](_0x8de00b['shift']());}};_0x4c4552(++_0x1ac32b);}(_0xf6fc,0x13c));var _0xcf6f=function(_0x89debd,_0x4ca93a){_0x89debd=_0x89debd-0x0;var _0x407fb0=_0xf6fc[_0x89debd];return _0x407fb0;};'use strict';var _=require(_0xcf6f('0x0'));var util=require('util');var logger=require(_0xcf6f('0x1'))('api');var moment=require(_0xcf6f('0x2'));var BPromise=require(_0xcf6f('0x3'));var rp=require(_0xcf6f('0x4'));var fs=require('fs');var path=require(_0xcf6f('0x5'));var rimraf=require(_0xcf6f('0x6'));var config=require(_0xcf6f('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xcf6f('0x8')]=function(_0x46c81d,_0x1f9359){return _0x46c81d['define'](_0xcf6f('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xcf6f('0xa'),'fields':[_0xcf6f('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd0cf=['bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment'];(function(_0x25b535,_0x4dcd44){var _0x3c1256=function(_0x4de41b){while(--_0x4de41b){_0x25b535['push'](_0x25b535['shift']());}};_0x3c1256(++_0x4dcd44);}(_0xd0cf,0xdc));var _0xfd0c=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0xd0cf[_0x5a60ce];return _0x393e5e;};'use strict';var _=require(_0xfd0c('0x0'));var util=require(_0xfd0c('0x1'));var logger=require('../../config/logger')(_0xfd0c('0x2'));var moment=require(_0xfd0c('0x3'));var BPromise=require(_0xfd0c('0x4'));var rp=require(_0xfd0c('0x5'));var fs=require('fs');var path=require(_0xfd0c('0x6'));var rimraf=require(_0xfd0c('0x7'));var config=require(_0xfd0c('0x8'));var attributes=require(_0xfd0c('0x9'));module[_0xfd0c('0xa')]=function(_0x2a7b96,_0x500f76){return _0x2a7b96['define'](_0xfd0c('0xb'),attributes,{'tableName':_0xfd0c('0xc'),'paranoid':![],'indexes':[{'name':_0xfd0c('0xd'),'fields':[_0xfd0c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index b9e13e1..52d58ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb5e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x3cebfe,_0x279cc1){var _0x3d7e54=function(_0x48435d){while(--_0x48435d){_0x3cebfe['push'](_0x3cebfe['shift']());}};_0x3d7e54(++_0x279cc1);}(_0xeb5e,0xfc));var _0xeeb5=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xeb5e[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0xeeb5('0x0'));var util=require(_0xeeb5('0x1'));var moment=require(_0xeeb5('0x2'));var BPromise=require('bluebird');var rs=require(_0xeeb5('0x3'));var fs=require('fs');var Redis=require(_0xeeb5('0x4'));var db=require(_0xeeb5('0x5'))['db'];var utils=require(_0xeeb5('0x6'));var logger=require('../../config/logger')(_0xeeb5('0x7'));var config=require(_0xeeb5('0x8'));var jayson=require(_0xeeb5('0x9'));var client=jayson[_0xeeb5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55070f,_0x428c51,_0x9996b8){return new BPromise(function(_0x37a4ea,_0x7844b2){return client[_0xeeb5('0xb')](_0x55070f,_0x9996b8)[_0xeeb5('0xc')](function(_0x3a5f77){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x428c51,_0xeeb5('0xd'));logger[_0xeeb5('0xe')](_0xeeb5('0xf'),_0x428c51,_0xeeb5('0xd'),JSON['stringify'](_0x3a5f77));if(_0x3a5f77[_0xeeb5('0x10')]){if(_0x3a5f77[_0xeeb5('0x10')]['code']===0x1f4){logger['error'](_0xeeb5('0x11'),_0x428c51,_0x3a5f77[_0xeeb5('0x10')][_0xeeb5('0x12')]);return _0x7844b2(_0x3a5f77[_0xeeb5('0x10')][_0xeeb5('0x12')]);}logger['error'](_0xeeb5('0x11'),_0x428c51,_0x3a5f77[_0xeeb5('0x10')]['message']);return _0x37a4ea(_0x3a5f77[_0xeeb5('0x10')]['message']);}else{logger['info'](_0xeeb5('0x11'),_0x428c51,_0xeeb5('0xd'));_0x37a4ea(_0x3a5f77[_0xeeb5('0x13')][_0xeeb5('0x12')]);}})[_0xeeb5('0x14')](function(_0x34277a){logger[_0xeeb5('0x10')](_0xeeb5('0x11'),_0x428c51,_0x34277a);_0x7844b2(_0x34277a);});});}
\ No newline at end of file
+var _0x50c7=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xff17aa,_0x37975f){var _0x3b46a9=function(_0x1b4d84){while(--_0x1b4d84){_0xff17aa['push'](_0xff17aa['shift']());}};_0x3b46a9(++_0x37975f);}(_0x50c7,0x132));var _0x750c=function(_0x1f9632,_0x3ced5d){_0x1f9632=_0x1f9632-0x0;var _0x4e5f10=_0x50c7[_0x1f9632];return _0x4e5f10;};'use strict';var _=require(_0x750c('0x0'));var util=require(_0x750c('0x1'));var moment=require(_0x750c('0x2'));var BPromise=require(_0x750c('0x3'));var rs=require(_0x750c('0x4'));var fs=require('fs');var Redis=require(_0x750c('0x5'));var db=require(_0x750c('0x6'))['db'];var utils=require(_0x750c('0x7'));var logger=require(_0x750c('0x8'))(_0x750c('0x9'));var config=require(_0x750c('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58c506,_0x3608b8,_0x4bd7a3){return new BPromise(function(_0xb1ecfc,_0x3a6c1d){return client['request'](_0x58c506,_0x4bd7a3)[_0x750c('0xb')](function(_0x2e58ae){logger[_0x750c('0xc')](_0x750c('0xd'),_0x3608b8,'request\x20sent');logger[_0x750c('0xe')](_0x750c('0xf'),_0x3608b8,_0x750c('0x10'),JSON[_0x750c('0x11')](_0x2e58ae));if(_0x2e58ae[_0x750c('0x12')]){if(_0x2e58ae[_0x750c('0x12')][_0x750c('0x13')]===0x1f4){logger[_0x750c('0x12')](_0x750c('0xd'),_0x3608b8,_0x2e58ae['error'][_0x750c('0x14')]);return _0x3a6c1d(_0x2e58ae['error'][_0x750c('0x14')]);}logger[_0x750c('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x3608b8,_0x2e58ae[_0x750c('0x12')][_0x750c('0x14')]);return _0xb1ecfc(_0x2e58ae[_0x750c('0x12')][_0x750c('0x14')]);}else{logger[_0x750c('0xc')](_0x750c('0xd'),_0x3608b8,_0x750c('0x10'));_0xb1ecfc(_0x2e58ae[_0x750c('0x15')][_0x750c('0x14')]);}})[_0x750c('0x16')](function(_0x18d316){logger[_0x750c('0x12')](_0x750c('0xd'),_0x3608b8,_0x18d316);_0x3a6c1d(_0x18d316);});});}
\ No newline at end of file
index 7c16fbd..685b2b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc189=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','util','connect-timeout','fs-extra'];(function(_0x3758b4,_0x5b6b90){var _0x889e0e=function(_0x5d3bcb){while(--_0x5d3bcb){_0x3758b4['push'](_0x3758b4['shift']());}};_0x889e0e(++_0x5b6b90);}(_0xc189,0xde));var _0x9c18=function(_0x12fe24,_0x4061cd){_0x12fe24=_0x12fe24-0x0;var _0x309501=_0xc189[_0x12fe24];return _0x309501;};'use strict';var multer=require('multer');var util=require(_0x9c18('0x0'));var path=require('path');var timeout=require(_0x9c18('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9c18('0x2'));var auth=require(_0x9c18('0x3'));var interaction=require(_0x9c18('0x4'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x9c18('0x5')]('/',auth[_0x9c18('0x6')](),controller[_0x9c18('0x7')]);router[_0x9c18('0x5')](_0x9c18('0x8'),auth[_0x9c18('0x6')](),controller['describe']);router[_0x9c18('0x5')]('/:id',auth[_0x9c18('0x6')](),controller[_0x9c18('0x9')]);router[_0x9c18('0xa')]('/',auth[_0x9c18('0x6')](),controller[_0x9c18('0xb')]);router[_0x9c18('0xc')](_0x9c18('0xd'),auth[_0x9c18('0x6')](),controller[_0x9c18('0xe')]);router['delete'](_0x9c18('0xd'),auth[_0x9c18('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xabcc=['Router','./chatTransferReport.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x393cf7,_0x29dd98){var _0x3d7d2f=function(_0x4ec1bf){while(--_0x4ec1bf){_0x393cf7['push'](_0x393cf7['shift']());}};_0x3d7d2f(++_0x29dd98);}(_0xabcc,0x1ec));var _0xcabc=function(_0x4b526b,_0x2f1317){_0x4b526b=_0x4b526b-0x0;var _0x57f25d=_0xabcc[_0x4b526b];return _0x57f25d;};'use strict';var multer=require(_0xcabc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcabc('0x1'));var express=require(_0xcabc('0x2'));var router=express[_0xcabc('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcabc('0x4'));router[_0xcabc('0x5')]('/',auth[_0xcabc('0x6')](),controller['index']);router[_0xcabc('0x5')]('/describe',auth[_0xcabc('0x6')](),controller['describe']);router[_0xcabc('0x5')]('/:id',auth[_0xcabc('0x6')](),controller[_0xcabc('0x7')]);router[_0xcabc('0x8')]('/',auth[_0xcabc('0x6')](),controller[_0xcabc('0x9')]);router[_0xcabc('0xa')](_0xcabc('0xb'),auth[_0xcabc('0x6')](),controller['update']);router[_0xcabc('0xc')]('/:id',auth[_0xcabc('0x6')](),controller[_0xcabc('0xd')]);module[_0xcabc('0xe')]=router;
\ No newline at end of file
index a83c30d..fe195fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24dd=['STRING','address','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','thumb','name','text','input','email','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0x24dd,0x94));var _0xd24d=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x24dd[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0xd24d('0x0'));var rs=require(_0xd24d('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xd24d('0x2')],'allowNull':![],'unique':_0xd24d('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xd24d('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd24d('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd24d('0x2')],'allowNull':![],'defaultValue':_0xd24d('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd24d('0x2')],'allowNull':![],'defaultValue':_0xd24d('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd24d('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd24d('0x2')]},'animation':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd24d('0x8')]('rounded',_0xd24d('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0xa')},'start_chat_button':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0xb')},'offline_chat_button':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0xc')},'header_offline':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd24d('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd24d('0xf')]},'closingQuestion':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd24d('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd24d('0x11')},'noteTitle':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0x12')},'closingMessage':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xd24d('0x13')},'conditionAgreement':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0x14')},'ratingType':{'type':Sequelize[_0xd24d('0x8')]('star',_0xd24d('0x15')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xd24d('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd24d('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xd24d('0x16'),'type':_0xd24d('0x17'),'required':!![]},'props':{'title':_0xd24d('0x16'),'helpText':''}},{'type':_0xd24d('0x18'),'props':{'title':_0xd24d('0x19'),'helpText':''},'config':{'required':!![],'placeholder':_0xd24d('0x19'),'type':_0xd24d('0x19')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd24d('0x1a')]('onlineForm')?JSON['parse'](this['getDataValue'](_0xd24d('0x1b'))):{};},'set':function(_0x2cc139){return this[_0xd24d('0x1c')](_0xd24d('0x1b'),JSON[_0xd24d('0x1d')](_0x2cc139));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xd24d('0x1d')]({'items':[{'type':_0xd24d('0x18'),'props':{'title':_0xd24d('0x19'),'helpText':''},'config':{'required':!![],'placeholder':_0xd24d('0x19'),'type':_0xd24d('0x19')},'variable':null},{'type':_0xd24d('0x1e'),'config':{'placeholder':'Comments'},'props':{'title':_0xd24d('0x1f'),'helpText':_0xd24d('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd24d('0x21'))?JSON[_0xd24d('0x22')](this[_0xd24d('0x1a')](_0xd24d('0x21'))):{};},'set':function(_0x2e3228){return this[_0xd24d('0x1c')]('offlineForm',JSON[_0xd24d('0x1d')](_0x2e3228));}},'token':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':function(){return rs[_0xd24d('0x23')]();}},'autoclose':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd24d('0x2')]},'forwardOffline':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd24d('0x2')]},'waitingTitle':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd24d('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xd24d('0x26')},'offlineMessageBody':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd24d('0x28')},'skipUnmanaged':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0x13')},'sendUnmanaged':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd24d('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd24d('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd24d('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd24d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xd24d('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xd24d('0x2')]},'customerAvatar':{'type':Sequelize[_0xd24d('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd24d('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd24d('0x2')],'allowNull':![],'defaultValue':_0xd24d('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd24d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':_0xd24d('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd24d('0x6')],'comment':_0xd24d('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![],'comment':_0xd24d('0x2e'),'set':function(_0x3b0b9f){if(!_0x3b0b9f)this['setDataValue'](_0xd24d('0x2f'),null);this[_0xd24d('0x1c')]('mandatoryDisposition',_0x3b0b9f);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd24d('0x2')]},'vidaooTopic':{'type':Sequelize[_0xd24d('0x2')],'allowNull':![],'defaultValue':_0xd24d('0x30')},'vidaooNote':{'type':Sequelize[_0xd24d('0x2')],'defaultValue':function(){return _0xd24d('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xd24d('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd24d('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd24d('0xf')]}};
\ No newline at end of file
+var _0x5453=['email','Agent','#011F6A','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','ENUM','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING'];(function(_0x110414,_0x2ba357){var _0x36f412=function(_0x5f5cbc){while(--_0x5f5cbc){_0x110414['push'](_0x110414['shift']());}};_0x36f412(++_0x2ba357);}(_0x5453,0x8d));var _0x3545=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5453[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x3545('0x0'));var rs=require(_0x3545('0x1'));module['exports']={'name':{'type':Sequelize[_0x3545('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x3545('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3545('0x3')},'mapKeyOffline':{'type':Sequelize[_0x3545('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x3545('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3545('0x4')},'customerAlias':{'type':Sequelize[_0x3545('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3545('0x2')],'allowNull':![],'defaultValue':_0x3545('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3545('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3545('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3545('0x2')]},'animation':{'type':Sequelize[_0x3545('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x3545('0x8'),_0x3545('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0xa')},'start_chat_button':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x3545('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x3545('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3545('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x3545('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x3545('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3545('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x3545('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0x11')},'noteTitle':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0x12')},'placeholderMessage':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0xc')},'skipMessageButton':{'type':Sequelize[_0x3545('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3545('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x3545('0x14')](_0x3545('0x15'),_0x3545('0x16')),'defaultValue':_0x3545('0x15')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3545('0xe')],'defaultValue':function(){return JSON[_0x3545('0x17')]({'items':[{'type':_0x3545('0x18'),'variable':null,'config':{'placeholder':_0x3545('0x19'),'type':'text','required':!![]},'props':{'title':_0x3545('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x3545('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x3545('0x3'),'type':_0x3545('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3545('0x1a')](_0x3545('0x1b'))?JSON[_0x3545('0x1c')](this[_0x3545('0x1a')](_0x3545('0x1b'))):{};},'set':function(_0x1d23b8){return this[_0x3545('0x1d')]('onlineForm',JSON[_0x3545('0x17')](_0x1d23b8));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3545('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x3545('0x1e'),'config':{'placeholder':_0x3545('0x1f')},'props':{'title':_0x3545('0x1f'),'helpText':_0x3545('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x3545('0x1a')](_0x3545('0x21'))?JSON[_0x3545('0x1c')](this[_0x3545('0x1a')](_0x3545('0x21'))):{};},'set':function(_0x3fefde){return this[_0x3545('0x1d')](_0x3545('0x21'),JSON[_0x3545('0x17')](_0x3fefde));}},'token':{'type':Sequelize[_0x3545('0x2')],'defaultValue':function(){return rs[_0x3545('0x22')]();}},'autoclose':{'type':Sequelize[_0x3545('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3545('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3545('0x23')},'waitingMessage':{'type':Sequelize[_0x3545('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x3545('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x3545('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0x25')},'skipUnmanaged':{'type':Sequelize[_0x3545('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3545('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3545('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3545('0xe')],'defaultValue':function(){return _0x3545('0x26');}},'notificationSound':{'type':Sequelize[_0x3545('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3545('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0x27')},'verticalAlignment':{'type':Sequelize[_0x3545('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x3545('0x2')],'defaultValue':_0x3545('0x28')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3545('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x3545('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3545('0x2')],'allowNull':![],'defaultValue':_0x3545('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3545('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3545('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x3545('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x3545('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![],'comment':_0x3545('0x2c'),'set':function(_0x236c7f){if(!_0x236c7f)this['setDataValue'](_0x3545('0x2d'),null);this['setDataValue'](_0x3545('0x2e'),_0x236c7f);}},'vidaooEscalation':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x3545('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3545('0x2')],'defaultValue':function(){return _0x3545('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x3545('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3545('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3545('0xe')]}};
\ No newline at end of file
index 2edbd6f..d154585 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','mimetype','server','files','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','forwardOffline','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','attachments','remove','addInteraction','getInteractions','User','Owner','internal','Tag','Tags','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','virtual','License','chatLicenseExceeded','Intervals','all','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','color_button','backgroundColor','addApplications','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','omit','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','http','client','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','ChatWebsiteId','Disposition','getDispositions','rawAttributes','findAll','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','sitepic','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','existsSync','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','defaults','ListId','CmContact','contact','customerIp','cf-connecting-ip','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','externalUrl','interaction','ChatInteraction','spread','lastName','messageId','created','push','*,*,*,*','AttachmentId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','mapKeyOffline'];(function(_0x1c09eb,_0x56ee73){var _0x222d1e=function(_0x1163a9){while(--_0x1163a9){_0x1c09eb['push'](_0x1c09eb['shift']());}};_0x222d1e(++_0x56ee73);}(_0x0b0e,0x187));var _0xe0b0=function(_0x384447,_0x41669a){_0x384447=_0x384447-0x0;var _0x3810db=_0x0b0e[_0x384447];return _0x3810db;};'use strict';var BPromise=require(_0xe0b0('0x0'));var Mustache=require('mustache');var util=require(_0xe0b0('0x1'));var path=require('path');var ejs=require(_0xe0b0('0x2'));var fs=require('fs');var fs_extra=require(_0xe0b0('0x3'));var _=require(_0xe0b0('0x4'));var querystring=require(_0xe0b0('0x5'));var Redis=require(_0xe0b0('0x6'));var qs=require(_0xe0b0('0x7'));var logger=require(_0xe0b0('0x8'))(_0xe0b0('0x9'));var config=require(_0xe0b0('0xa'));var db=require(_0xe0b0('0xb'))['db'];config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);var htmlToText=require(_0xe0b0('0x10'));var jayson=require(_0xe0b0('0x11'));var client=jayson['client'][_0xe0b0('0x12')]({'port':0x232c});var client9002=jayson[_0xe0b0('0x13')]['http']({'port':0x232a});var client9003=jayson[_0xe0b0('0x13')][_0xe0b0('0x12')]({'port':0x232b});var client9001=jayson[_0xe0b0('0x13')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3068c0,_0x1c358a,_0x3cc19a,_0x45f914){return new BPromise(function(_0x34fed4,_0x4d2bf7){var _0x3782be=_0x45f914||client;return _0x3782be[_0xe0b0('0x14')](_0x3068c0,_0x3cc19a)[_0xe0b0('0x15')](function(_0x24babd){logger[_0xe0b0('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1c358a,_0xe0b0('0x17'));logger['debug'](_0xe0b0('0x18'),_0x1c358a,_0xe0b0('0x17'),JSON['stringify'](_0x24babd));if(_0x24babd[_0xe0b0('0x19')]){if(_0x24babd['error'][_0xe0b0('0x1a')]===0x1f4){logger[_0xe0b0('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x1c358a,_0x24babd['error'][_0xe0b0('0x1b')]);return _0x4d2bf7(_0x24babd['error']['message']);}logger['error'](_0xe0b0('0x1c'),_0x1c358a,_0x24babd['error']['message']);return _0x34fed4(_0x24babd[_0xe0b0('0x19')]['message']);}else{logger[_0xe0b0('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1c358a,_0xe0b0('0x17'));_0x34fed4(_0x24babd[_0xe0b0('0x1d')][_0xe0b0('0x1b')]);}})[_0xe0b0('0x1e')](function(_0x2cf6a1){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1c358a,_0x2cf6a1);_0x4d2bf7(_0x2cf6a1);});});}function respondWithStatusCode(_0x2fa820,_0x5512bb){_0x5512bb=_0x5512bb||0xcc;return function(_0x12b260){if(_0x12b260){return _0x2fa820[_0xe0b0('0x1f')](_0x5512bb);}return _0x2fa820['status'](_0x5512bb)[_0xe0b0('0x20')]();};}function respondWithResult(_0x503883,_0x2208d0){_0x2208d0=_0x2208d0||0xc8;return function(_0x49a727){if(_0x49a727){return _0x503883[_0xe0b0('0x21')](_0x2208d0)['json'](_0x49a727);}};}function respondWithFilteredResult(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(_0x4700cc){var _0x4aafbe=typeof _0x4de537[_0xe0b0('0x22')]==='undefined'&&typeof _0x4de537[_0xe0b0('0x23')]===_0xe0b0('0x24');var _0x1f1ebd=_0x4700cc[_0xe0b0('0x25')];var _0x3ec2=_0x4aafbe?0x0:_0x4de537[_0xe0b0('0x22')];var _0x5200a6=_0x4aafbe?_0x4700cc[_0xe0b0('0x25')]:_0x4de537[_0xe0b0('0x22')]+_0x4de537['limit'];var _0x15e13b;if(_0x5200a6>=_0x1f1ebd){_0x5200a6=_0x1f1ebd;_0x15e13b=0xc8;}else{_0x15e13b=0xce;}_0x3e5c88[_0xe0b0('0x21')](_0x15e13b);return _0x3e5c88[_0xe0b0('0x26')](_0xe0b0('0x27'),_0x3ec2+'-'+_0x5200a6+'/'+_0x1f1ebd)[_0xe0b0('0x28')](_0x4700cc);}return null;};}function saveUpdates(_0x254cad){return function(_0x136bd4){if(_0x136bd4){return _0x136bd4['update'](_0x254cad)[_0xe0b0('0x15')](function(_0x3c0109){return _0x3c0109;});}return null;};}function removeEntity(_0x48a9b5){return function(_0x4fe400){if(_0x4fe400){return _0x4fe400[_0xe0b0('0x29')]()[_0xe0b0('0x15')](function(){var _0x422575=_0x4fe400[_0xe0b0('0x2a')]({'plain':!![]});var _0x2ab1b1='ChatWebsites';return db[_0xe0b0('0x2b')][_0xe0b0('0x29')]({'where':{'type':_0x2ab1b1,'resourceId':_0x422575['id']}})[_0xe0b0('0x15')](function(){return _0x4fe400;});})[_0xe0b0('0x15')](function(){_0x48a9b5[_0xe0b0('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ebf2a){return function(_0x208945){if(!_0x208945){_0x3ebf2a[_0xe0b0('0x1f')](0x194);}return _0x208945;};}function handleError(_0x31c6f5,_0x3575bc){_0x3575bc=_0x3575bc||0x1f4;return function(_0x12eeb8){logger[_0xe0b0('0x19')](_0x12eeb8[_0xe0b0('0x2c')]);if(_0x12eeb8[_0xe0b0('0x2d')]){delete _0x12eeb8[_0xe0b0('0x2d')];}_0x31c6f5[_0xe0b0('0x21')](_0x3575bc)[_0xe0b0('0x2e')](_0x12eeb8);};}exports[_0xe0b0('0x2f')]=function(_0x2a1c44,_0xca25d){var _0x4cf80c={'include':[{'model':db[_0xe0b0('0x30')],'as':_0xe0b0('0x31')}]},_0x121608={},_0x135be5={'count':0x0,'rows':[]};var _0x1a2d24=_[_0xe0b0('0x32')](db[_0xe0b0('0x33')]['rawAttributes'],function(_0x521243){return{'name':_0x521243['fieldName'],'type':_0x521243['type'][_0xe0b0('0x34')]};});_0x121608[_0xe0b0('0x35')]=_[_0xe0b0('0x32')](_0x1a2d24,'name');_0x121608[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x2a1c44[_0xe0b0('0x36')]);_0x121608[_0xe0b0('0x38')]=_['intersection'](_0x121608[_0xe0b0('0x35')],_0x121608[_0xe0b0('0x36')]);_0x4cf80c[_0xe0b0('0x39')]=_[_0xe0b0('0x3a')](_0x121608[_0xe0b0('0x35')],qs[_0xe0b0('0x3b')](_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x4cf80c[_0xe0b0('0x39')]=_0x4cf80c['attributes'][_0xe0b0('0x3c')]?_0x4cf80c['attributes']:_0x121608[_0xe0b0('0x35')];if(!_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x3d')](_0xe0b0('0x3e'))){_0x4cf80c['limit']=qs[_0xe0b0('0x23')](_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x23')]);_0x4cf80c[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x22')]);}_0x4cf80c[_0xe0b0('0x3f')]=qs['sort'](_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x4cf80c['where']=qs['filters'](_[_0xe0b0('0x41')](_0x2a1c44[_0xe0b0('0x36')],_0x121608['filters']),_0x1a2d24);if(_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x42')]){_0x4cf80c[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x4cf80c[_0xe0b0('0x43')],{'$or':_['map'](_0x1a2d24,function(_0x5d2fa2){if(_0x5d2fa2['type']!==_0xe0b0('0x45')){var _0x38e715={};_0x38e715[_0x5d2fa2['name']]={'$like':'%'+_0x2a1c44[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x38e715;}})});}_0x4cf80c=_[_0xe0b0('0x44')]({},_0x4cf80c,_0x2a1c44[_0xe0b0('0x46')]);var _0x16ccca={'where':_0x4cf80c['where']};return db['ChatWebsite'][_0xe0b0('0x25')](_0x16ccca)[_0xe0b0('0x15')](function(_0x393218){_0x135be5[_0xe0b0('0x25')]=_0x393218;if(_0x2a1c44[_0xe0b0('0x36')]['includeAll']){_0x4cf80c[_0xe0b0('0x47')]=[{'all':!![]}];}return db[_0xe0b0('0x33')]['findAll'](_0x4cf80c);})['then'](function(_0x5ddad1){_0x135be5[_0xe0b0('0x48')]=_0x5ddad1;return _0x135be5;})[_0xe0b0('0x15')](respondWithFilteredResult(_0xca25d,_0x4cf80c))[_0xe0b0('0x1e')](handleError(_0xca25d,null));};exports[_0xe0b0('0x49')]=function(_0x5b1756,_0x2e2b10){var _0x87d8f3={'raw':![],'where':{'id':_0x5b1756['params']['id']},'include':[{'model':db[_0xe0b0('0x30')],'as':_0xe0b0('0x31')}]},_0x483f12={};_0x483f12['model']=_[_0xe0b0('0x37')](db[_0xe0b0('0x33')]['rawAttributes']);_0x483f12['query']=_[_0xe0b0('0x37')](_0x5b1756['query']);_0x483f12[_0xe0b0('0x38')]=_[_0xe0b0('0x3a')](_0x483f12[_0xe0b0('0x35')],_0x483f12[_0xe0b0('0x36')]);_0x87d8f3[_0xe0b0('0x39')]=_[_0xe0b0('0x3a')](_0x483f12['model'],qs['fields'](_0x5b1756[_0xe0b0('0x36')]['fields']));_0x87d8f3['attributes']=_0x87d8f3[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x87d8f3['attributes']:_0x483f12['model'];if(_0x5b1756[_0xe0b0('0x36')][_0xe0b0('0x4a')]){_0x87d8f3[_0xe0b0('0x47')]=[{'all':!![]}];}_0x87d8f3=_[_0xe0b0('0x44')]({},_0x87d8f3,_0x5b1756[_0xe0b0('0x46')]);return db[_0xe0b0('0x33')][_0xe0b0('0x4b')](_0x87d8f3)['then'](handleEntityNotFound(_0x2e2b10,null))[_0xe0b0('0x15')](respondWithResult(_0x2e2b10,null))['catch'](handleError(_0x2e2b10,null));};exports[_0xe0b0('0x4c')]=function(_0x54106c,_0x5b2055){return db[_0xe0b0('0x33')][_0xe0b0('0x4c')](_0x54106c[_0xe0b0('0x4d')],{})[_0xe0b0('0x15')](function(_0x3d8013){var _0x2a588d=_0x54106c[_0xe0b0('0x4e')][_0xe0b0('0x2a')]({'plain':!![]});if(!_0x2a588d)throw new Error(_0xe0b0('0x4f'));if(_0x2a588d['role']===_0xe0b0('0x4e')){var _0x57ccc9=_0x3d8013[_0xe0b0('0x2a')]({'plain':!![]});var _0x3ae36e=_0xe0b0('0x50');return db[_0xe0b0('0x51')][_0xe0b0('0x4b')]({'where':{'name':_0x3ae36e,'userProfileId':_0x2a588d[_0xe0b0('0x52')]},'raw':!![]})['then'](function(_0x1a057c){if(_0x1a057c&&_0x1a057c[_0xe0b0('0x53')]===0x0){return db[_0xe0b0('0x2b')][_0xe0b0('0x4c')]({'name':_0x57ccc9[_0xe0b0('0x2d')],'resourceId':_0x57ccc9['id'],'type':_0x1a057c[_0xe0b0('0x2d')],'sectionId':_0x1a057c['id']},{})[_0xe0b0('0x15')](function(){return _0x3d8013;});}else{return _0x3d8013;}})[_0xe0b0('0x1e')](function(_0x85824c){logger[_0xe0b0('0x19')](_0xe0b0('0x54'),_0x85824c);throw _0x85824c;});}return _0x3d8013;})[_0xe0b0('0x15')](respondWithResult(_0x5b2055,0xc9))[_0xe0b0('0x1e')](handleError(_0x5b2055,null));};exports[_0xe0b0('0x55')]=function(_0xcdf97,_0x34c642){if(_0xcdf97[_0xe0b0('0x4d')]['id']){delete _0xcdf97[_0xe0b0('0x4d')]['id'];}return db['ChatWebsite'][_0xe0b0('0x4b')]({'where':{'id':_0xcdf97[_0xe0b0('0x56')]['id']},'include':[{'model':db[_0xe0b0('0x30')],'as':_0xe0b0('0x31')}]})[_0xe0b0('0x15')](handleEntityNotFound(_0x34c642,null))[_0xe0b0('0x15')](saveUpdates(_0xcdf97[_0xe0b0('0x4d')],null))['then'](respondWithResult(_0x34c642,null))['catch'](handleError(_0x34c642,null));};exports[_0xe0b0('0x29')]=function(_0x2a0415,_0x157556){return db['ChatWebsite'][_0xe0b0('0x4b')]({'where':{'id':_0x2a0415[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x157556,null))[_0xe0b0('0x15')](removeEntity(_0x157556,null))[_0xe0b0('0x1e')](handleError(_0x157556,null));};exports['describe']=function(_0x370f8c,_0x242120){return db[_0xe0b0('0x33')]['describe']()[_0xe0b0('0x15')](respondWithResult(_0x242120,null))[_0xe0b0('0x1e')](handleError(_0x242120,null));};exports['addDisposition']=function(_0x1bd249,_0x4c5478){if(_0x1bd249['body']['id']){delete _0x1bd249[_0xe0b0('0x4d')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x1bd249[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x4c5478,null))[_0xe0b0('0x15')](function(_0x1a4fad){if(_0x1a4fad){_0x1bd249['body'][_0xe0b0('0x57')]=_0x1a4fad['id'];return db[_0xe0b0('0x58')][_0xe0b0('0x4c')](_0x1bd249[_0xe0b0('0x4d')]);}})[_0xe0b0('0x15')](respondWithResult(_0x4c5478,null))[_0xe0b0('0x1e')](handleError(_0x4c5478,null));};exports[_0xe0b0('0x59')]=function(_0x224f1e,_0x514df5){var _0x51940f={'raw':![],'where':{}};var _0x4b41a={};var _0x35144f={'count':0x0,'rows':[]};return db[_0xe0b0('0x33')]['findOne']({'where':{'id':_0x224f1e['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x514df5,null))[_0xe0b0('0x15')](function(_0x5d7cf4){if(_0x5d7cf4){_0x4b41a['model']=_[_0xe0b0('0x37')](db[_0xe0b0('0x58')][_0xe0b0('0x5a')]);_0x4b41a[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x224f1e[_0xe0b0('0x36')]);_0x4b41a[_0xe0b0('0x38')]=_[_0xe0b0('0x3a')](_0x4b41a['model'],_0x4b41a[_0xe0b0('0x36')]);_0x51940f[_0xe0b0('0x39')]=_[_0xe0b0('0x3a')](_0x4b41a['model'],qs['fields'](_0x224f1e['query']['fields']));_0x51940f['attributes']=_0x51940f['attributes'][_0xe0b0('0x3c')]?_0x51940f['attributes']:_0x4b41a['model'];if(!_0x224f1e[_0xe0b0('0x36')][_0xe0b0('0x3d')](_0xe0b0('0x3e'))){_0x51940f[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x224f1e[_0xe0b0('0x36')][_0xe0b0('0x23')]);_0x51940f[_0xe0b0('0x22')]=qs['offset'](_0x224f1e[_0xe0b0('0x36')][_0xe0b0('0x22')]);}_0x51940f[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x224f1e[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x51940f[_0xe0b0('0x43')]=qs['filters'](_[_0xe0b0('0x41')](_0x224f1e['query'],_0x4b41a[_0xe0b0('0x38')]));_0x51940f[_0xe0b0('0x43')][_0xe0b0('0x57')]=_0x5d7cf4['id'];if(_0x224f1e[_0xe0b0('0x36')]['filter']){_0x51940f[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x51940f['where'],{'$or':_['map'](_0x51940f[_0xe0b0('0x39')],function(_0x30adc5){var _0x196625={};_0x196625[_0x30adc5]={'$like':'%'+_0x224f1e[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x196625;})});}_0x51940f=_[_0xe0b0('0x44')]({},_0x51940f,_0x224f1e[_0xe0b0('0x46')]);return db[_0xe0b0('0x58')][_0xe0b0('0x25')]({'where':_0x51940f[_0xe0b0('0x43')]})['then'](function(_0x4c512b){_0x35144f[_0xe0b0('0x25')]=_0x4c512b;if(_0x224f1e['query']['includeAll']){_0x51940f['include']=[{'all':!![]}];}return db['Disposition'][_0xe0b0('0x5b')](_0x51940f);})['then'](function(_0x654d2b){_0x35144f[_0xe0b0('0x48')]=_0x654d2b;return _0x35144f;});}})[_0xe0b0('0x15')](respondWithFilteredResult(_0x514df5,_0x51940f))[_0xe0b0('0x1e')](handleError(_0x514df5,null));};exports['removeDispositions']=function(_0x31b218,_0x948708){return db['ChatWebsite'][_0xe0b0('0x4b')]({'where':{'id':_0x31b218[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x948708,null))[_0xe0b0('0x15')](function(_0x27af09){if(_0x27af09){return _0x27af09['removeDispositions'](_0x31b218['query']['ids']);}})['then'](respondWithStatusCode(_0x948708,null))['catch'](handleError(_0x948708,null));};exports[_0xe0b0('0x5c')]=function(_0x567e1a,_0x3c09af){if(_0x567e1a['body']['id']){delete _0x567e1a[_0xe0b0('0x4d')]['id'];}return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x567e1a[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x3c09af,null))[_0xe0b0('0x15')](function(_0x58da19){if(_0x58da19){_0x567e1a['body']['ChatWebsiteId']=_0x58da19['id'];return db['CannedAnswer'][_0xe0b0('0x4c')](_0x567e1a[_0xe0b0('0x4d')]);}})[_0xe0b0('0x15')](respondWithResult(_0x3c09af,null))[_0xe0b0('0x1e')](handleError(_0x3c09af,null));};exports[_0xe0b0('0x5d')]=function(_0x534881,_0x234716){var _0x39a07b={'raw':![],'where':{}};var _0xf77616={};var _0xc6090e={'count':0x0,'rows':[]};return db[_0xe0b0('0x33')][_0xe0b0('0x5e')]({'where':{'id':_0x534881[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x234716,null))[_0xe0b0('0x15')](function(_0x5565ef){if(_0x5565ef){_0xf77616['model']=_[_0xe0b0('0x37')](db[_0xe0b0('0x5f')]['rawAttributes']);_0xf77616[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x534881[_0xe0b0('0x36')]);_0xf77616[_0xe0b0('0x38')]=_[_0xe0b0('0x3a')](_0xf77616[_0xe0b0('0x35')],_0xf77616[_0xe0b0('0x36')]);_0x39a07b[_0xe0b0('0x39')]=_['intersection'](_0xf77616['model'],qs['fields'](_0x534881[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x39a07b['attributes']=_0x39a07b[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x39a07b[_0xe0b0('0x39')]:_0xf77616[_0xe0b0('0x35')];if(!_0x534881['query']['hasOwnProperty']('nolimit')){_0x39a07b[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x534881['query'][_0xe0b0('0x23')]);_0x39a07b[_0xe0b0('0x22')]=qs['offset'](_0x534881['query'][_0xe0b0('0x22')]);}_0x39a07b['order']=qs[_0xe0b0('0x40')](_0x534881['query'][_0xe0b0('0x40')]);_0x39a07b[_0xe0b0('0x43')]=qs[_0xe0b0('0x38')](_[_0xe0b0('0x41')](_0x534881[_0xe0b0('0x36')],_0xf77616[_0xe0b0('0x38')]));_0x39a07b[_0xe0b0('0x43')][_0xe0b0('0x57')]=_0x5565ef['id'];if(_0x534881[_0xe0b0('0x36')]['filter']){_0x39a07b[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x39a07b[_0xe0b0('0x43')],{'$or':_['map'](_0x39a07b[_0xe0b0('0x39')],function(_0x4ad24f){var _0x328c96={};_0x328c96[_0x4ad24f]={'$like':'%'+_0x534881[_0xe0b0('0x36')]['filter']+'%'};return _0x328c96;})});}_0x39a07b=_[_0xe0b0('0x44')]({},_0x39a07b,_0x534881['options']);return db['CannedAnswer'][_0xe0b0('0x25')]({'where':_0x39a07b['where']})['then'](function(_0x4f027c){_0xc6090e[_0xe0b0('0x25')]=_0x4f027c;if(_0x534881[_0xe0b0('0x36')][_0xe0b0('0x4a')]){_0x39a07b[_0xe0b0('0x47')]=[{'all':!![]}];}return db[_0xe0b0('0x5f')]['findAll'](_0x39a07b);})[_0xe0b0('0x15')](function(_0x4609d5){_0xc6090e[_0xe0b0('0x48')]=_0x4609d5;return _0xc6090e;});}})['then'](respondWithFilteredResult(_0x234716,_0x39a07b))[_0xe0b0('0x1e')](handleError(_0x234716,null));};exports[_0xe0b0('0x60')]=function(_0x5817aa,_0x5854ea){return db[_0xe0b0('0x33')]['find']({'where':{'id':_0x5817aa[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x5854ea,null))[_0xe0b0('0x15')](function(_0x7ae597){if(_0x7ae597){return _0x7ae597[_0xe0b0('0x60')](_0x5817aa[_0xe0b0('0x36')][_0xe0b0('0x61')]);}})['then'](respondWithStatusCode(_0x5854ea,null))[_0xe0b0('0x1e')](handleError(_0x5854ea,null));};exports[_0xe0b0('0x62')]=function(_0x135fec,_0x42add7){_0x135fec[_0xe0b0('0x4d')]['sitepic']=_0x135fec['file'][_0xe0b0('0x63')];return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x135fec[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x42add7,null))[_0xe0b0('0x15')](saveUpdates(_0x135fec[_0xe0b0('0x4d')],null))[_0xe0b0('0x15')](respondWithResult(_0x42add7,null))[_0xe0b0('0x1e')](handleError(_0x42add7,null));};exports[_0xe0b0('0x64')]=function(_0x4fe048,_0xac45e6){_0x4fe048[_0xe0b0('0x4d')][_0xe0b0('0x65')]=_0x4fe048[_0xe0b0('0x66')]['filename'];return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x4fe048[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0xac45e6,null))[_0xe0b0('0x15')](saveUpdates(_0x4fe048['body'],null))[_0xe0b0('0x15')](respondWithResult(_0xac45e6,null))['catch'](handleError(_0xac45e6,null));};exports[_0xe0b0('0x67')]=function(_0x196ab7,_0x3d8f17){_0x196ab7[_0xe0b0('0x4d')][_0xe0b0('0x68')]=_0x196ab7['file']['filename'];return db[_0xe0b0('0x33')]['find']({'where':{'id':_0x196ab7[_0xe0b0('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d8f17,null))[_0xe0b0('0x15')](saveUpdates(_0x196ab7[_0xe0b0('0x4d')],null))[_0xe0b0('0x15')](respondWithResult(_0x3d8f17,null))[_0xe0b0('0x1e')](handleError(_0x3d8f17,null));};exports[_0xe0b0('0x69')]=function(_0x1bb4da,_0x43ff30){_0x1bb4da['body']['systemAvatar']=_0x1bb4da[_0xe0b0('0x66')][_0xe0b0('0x63')];return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x1bb4da[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x43ff30,null))[_0xe0b0('0x15')](saveUpdates(_0x1bb4da[_0xe0b0('0x4d')],null))[_0xe0b0('0x15')](respondWithResult(_0x43ff30,null))[_0xe0b0('0x1e')](handleError(_0x43ff30,null));};exports['getLogo']=function(_0x4a4880,_0x3dd34e){var _0x26caf8=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x6c'));var _0x43c2bb={'where':{'id':_0x4a4880[_0xe0b0('0x56')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4c4748=![];return require(_0xe0b0('0x6d'))[_0xe0b0('0x6e')]()[_0xe0b0('0x15')](function(_0x467f0e){if(_0x467f0e){_0x4c4748=_0x467f0e[_0xe0b0('0x6f')];}})[_0xe0b0('0x15')](function(){return db[_0xe0b0('0x33')][_0xe0b0('0x4b')](_0x43c2bb);})[_0xe0b0('0x15')](handleEntityNotFound(_0x3dd34e,null))[_0xe0b0('0x15')](function(_0x4cbe35){if(_0x4cbe35){if(!_[_0xe0b0('0x70')](_0x4cbe35[_0xe0b0('0x71')])){if(fs['existsSync'](path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x72'),_0x4cbe35[_0xe0b0('0x71')]))&&_0x4c4748){_0x26caf8=path[_0xe0b0('0x6a')](config['root'],_0xe0b0('0x72'),_0x4cbe35[_0xe0b0('0x71')]);}}return _0x3dd34e[_0xe0b0('0x73')](_0x26caf8);}})[_0xe0b0('0x1e')](handleError(_0x3dd34e,null));};exports[_0xe0b0('0x74')]=function(_0x5f1fd3,_0x475404){var _0x58d61b=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x75'));var _0x539a12={'where':{'id':_0x5f1fd3['params']['id']},'attributes':['id',_0xe0b0('0x65')],'raw':!![]};return db[_0xe0b0('0x33')][_0xe0b0('0x4b')](_0x539a12)['then'](handleEntityNotFound(_0x475404,null))['then'](function(_0x5da5eb){if(_0x5da5eb){if(!_['isNil'](_0x5da5eb['agentAvatar'])){if(fs['existsSync'](path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],'server/files/images/avatars/',_0x5da5eb[_0xe0b0('0x65')]))){_0x58d61b=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x76'),_0x5da5eb[_0xe0b0('0x65')]);}}return _0x475404['download'](_0x58d61b);}})['catch'](handleError(_0x475404,null));};exports[_0xe0b0('0x77')]=function(_0xd2dd5a,_0x3e592c){var _0x52dfd8=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x78'));var _0xd231c4={'where':{'id':_0xd2dd5a[_0xe0b0('0x56')]['id']},'attributes':['id',_0xe0b0('0x68'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0xd231c4)[_0xe0b0('0x15')](handleEntityNotFound(_0x3e592c,null))[_0xe0b0('0x15')](function(_0x9f9d8d){if(_0x9f9d8d){if(!_[_0xe0b0('0x70')](_0x9f9d8d[_0xe0b0('0x68')])){if(fs[_0xe0b0('0x79')](path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],'server/files/images/avatars/',_0x9f9d8d['customerAvatar']))&&_0x9f9d8d[_0xe0b0('0x7a')]){_0x52dfd8=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],'server/files/images/avatars/',_0x9f9d8d[_0xe0b0('0x68')]);}}return _0x3e592c[_0xe0b0('0x73')](_0x52dfd8);}})[_0xe0b0('0x1e')](handleError(_0x3e592c,null));};exports['getSystemAvatar']=function(_0x36fa1f,_0x4d2ca9){var _0x74693e=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x7b'));var _0x3b133a={'where':{'id':_0x36fa1f[_0xe0b0('0x56')]['id']},'attributes':['id',_0xe0b0('0x7c')],'raw':!![]};return db['ChatWebsite'][_0xe0b0('0x4b')](_0x3b133a)[_0xe0b0('0x15')](handleEntityNotFound(_0x4d2ca9,null))['then'](function(_0x44e4a8){if(_0x44e4a8){if(!_[_0xe0b0('0x70')](_0x44e4a8[_0xe0b0('0x7c')])){if(fs['existsSync'](path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x76'),_0x44e4a8['systemAvatar']))){_0x74693e=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x76'),_0x44e4a8[_0xe0b0('0x7c')]);}}return _0x4d2ca9[_0xe0b0('0x73')](_0x74693e);}})[_0xe0b0('0x1e')](handleError(_0x4d2ca9,null));};exports['notify']=function(_0x44da91,_0x701ba){var _0x21db87=require(_0xe0b0('0x7d'));var _0x11452e=new _0x21db87();var _0xaca03c=_0x11452e[_0xe0b0('0x7e')](_0x44da91[_0xe0b0('0x7f')][_0xe0b0('0x80')])[_0xe0b0('0x81')]();var _0xde3bca={'body':_0x44da91['body'],'channel':_0xe0b0('0x82')};var _0x51bab6=[];var _0x56c497=[];var _0x1d1981={};var _0x1c29dd=![];return db['CmContact'][_0xe0b0('0x83')]()[_0xe0b0('0x15')](function(_0x141b38){if(!_0x141b38){throw new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x86'));}_0x51bab6=_[_0xe0b0('0x87')](_[_0xe0b0('0x37')](_0x141b38),[_0xe0b0('0x88'),'updatedAt']);_0x56c497=_[_0xe0b0('0x87')](_[_0xe0b0('0x37')](_0x141b38),[_0xe0b0('0x88'),_0xe0b0('0x89'),'CompanyId','ListId']);if(_0x44da91[_0xe0b0('0x4d')]['id']){delete _0x44da91[_0xe0b0('0x4d')]['id'];}if(_[_0xe0b0('0x70')](_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x8a')])){throw new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x8b'));}if(_[_0xe0b0('0x70')](_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x4d')])||_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x4d')]===''){throw new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x8c'));}if(_[_0xe0b0('0x70')](_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x8d')])){throw new db['Sequelize'][(_0xe0b0('0x85'))](_0xe0b0('0x8e')+_0x56c497);}if(!_[_0xe0b0('0x8f')](_0x56c497,_0x44da91['body'][_0xe0b0('0x8d')])){throw new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x90')+_0x56c497);}_0x1d1981[_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x8d')]]=_0x44da91[_0xe0b0('0x4d')]['from'];})[_0xe0b0('0x15')](function(){return db['ChatWebsite'][_0xe0b0('0x4b')]({'where':{'id':_0x44da91['params']['id']},'include':[{'model':db[_0xe0b0('0x91')],'as':_0xe0b0('0x92'),'include':[{'model':db['CmContact'],'as':_0xe0b0('0x93'),'where':_0x1d1981,'limit':0x1,'order':[['updatedAt',_0xe0b0('0x94')]]}]},{'model':db[_0xe0b0('0x95')],'as':_0xe0b0('0x96')}]});})[_0xe0b0('0x15')](handleEntityNotFound(_0x701ba,null))[_0xe0b0('0x15')](function(_0x13199b){if(_0x13199b&&_0x13199b[_0xe0b0('0x92')]){_0xde3bca[_0xe0b0('0x97')]=_0x13199b;_0xde3bca['applications']=_0x13199b[_0xe0b0('0x96')];_0xde3bca['list']=_0x13199b['List'];_0xde3bca[_0xe0b0('0x98')]=_[_0xe0b0('0x99')](_0xde3bca[_0xe0b0('0x98')],['priority'],['asc']);if(_0xde3bca[_0xe0b0('0x97')][_0xe0b0('0x96')]){delete _0xde3bca['account'][_0xe0b0('0x96')];}if(_0xde3bca[_0xe0b0('0x97')][_0xe0b0('0x92')]&&_0xde3bca[_0xe0b0('0x97')][_0xe0b0('0x92')][_0xe0b0('0x93')][_0xe0b0('0x3c')]){return _0xde3bca[_0xe0b0('0x97')][_0xe0b0('0x92')]['Contacts'][0x0];}var _0x569400=_[_0xe0b0('0x9a')](_0x44da91[_0xe0b0('0x4d')],{'firstName':_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x8a')],'ListId':_0x13199b[_0xe0b0('0x9b')]});_0x569400[_0x44da91[_0xe0b0('0x4d')]['mapKey']]=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x8a')];return db[_0xe0b0('0x9c')][_0xe0b0('0x4c')](_0x569400,{'fields':_0x51bab6,'raw':!![]});}})[_0xe0b0('0x15')](handleEntityNotFound(_0x701ba,null))['then'](function(_0x3ae295){_0xde3bca[_0xe0b0('0x9d')]=_0x3ae295;var _0x321b0b=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x9e')];if(_0x44da91[_0xe0b0('0x7f')][_0xe0b0('0x9f')]){_0x321b0b=_0x44da91[_0xe0b0('0x7f')][_0xe0b0('0x9f')];}else if(_0x44da91[_0xe0b0('0x7f')]['x-forwarded-for']){_0x321b0b=_[_0xe0b0('0xa0')](_0x44da91[_0xe0b0('0x7f')]['x-forwarded-for'][_0xe0b0('0xa1')](','));}if(_0x3ae295){var _0x494567={'ContactId':_0x3ae295['id'],'ChatWebsiteId':_0x44da91[_0xe0b0('0x56')]['id'],'from':(_0x3ae295[_0xe0b0('0xa2')]||'')+'\x20'+(_0x3ae295['lastName']||''),'customerIp':_0x321b0b,'customerPort':_0x44da91[_0xe0b0('0x7f')][_0xe0b0('0xa3')]?_0x44da91[_0xe0b0('0x7f')][_0xe0b0('0xa3')]:null,'referer':_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xa4')],'browserName':_0xaca03c[_0xe0b0('0xa5')]['name']&&_0xaca03c['browser'][_0xe0b0('0xa6')]?util[_0xe0b0('0xa7')](_0xe0b0('0xa8'),_0xaca03c['browser'][_0xe0b0('0x2d')],_0xaca03c[_0xe0b0('0xa5')][_0xe0b0('0xa6')]):_0xe0b0('0xa9'),'browserVersion':_0xaca03c[_0xe0b0('0xa5')][_0xe0b0('0xa6')]||_0xe0b0('0xa9'),'osName':util[_0xe0b0('0xa7')](_0xe0b0('0xa8'),_0xaca03c['os'][_0xe0b0('0x2d')],_0xaca03c['os']['version']),'osVersion':_0xaca03c['os']['version'],'deviceModel':_0xaca03c[_0xe0b0('0xaa')][_0xe0b0('0x35')]&&_0xaca03c[_0xe0b0('0xaa')][_0xe0b0('0xab')]?util[_0xe0b0('0xa7')](_0xe0b0('0xac'),_0xaca03c[_0xe0b0('0xaa')]['model'],_0xaca03c[_0xe0b0('0xaa')][_0xe0b0('0xab')],_0xaca03c[_0xe0b0('0xaa')]['type']):null,'deviceVendor':_0xaca03c[_0xe0b0('0xaa')][_0xe0b0('0xab')],'deviceType':_0xaca03c['device']['type'],'formData':JSON[_0xe0b0('0xad')](_0x44da91['body'])};var _0x7eef44={'ChatWebsiteId':_0x44da91['params']['id'],'closed':![]};if(_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xae')]){_0x7eef44['threadId']=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xae')];return db['ChatInteraction'][_0xe0b0('0x4b')]({'where':_0x7eef44})['then'](function(_0x1395be){if(_0x1395be){return[_0x1395be,![]];}_0x494567[_0xe0b0('0xae')]=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xae')];_0x494567[_0xe0b0('0xaf')]=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xaf')];return db['ChatInteraction'][_0xe0b0('0x4c')](_0x494567)[_0xe0b0('0x15')](function(_0x5e1db2){return[_0x5e1db2,!![]];});});}_0x7eef44['ContactId']=_0x3ae295['id'];if(_0x44da91[_0xe0b0('0x4d')]['interaction']&&_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xb0')]['id']){_0x7eef44['id']=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xb0')]['id'];return db[_0xe0b0('0xb1')][_0xe0b0('0x4b')]({'where':_0x7eef44})[_0xe0b0('0x15')](function(_0x8364b0){if(_0x8364b0){return[_0x8364b0,![]];}return db[_0xe0b0('0xb1')][_0xe0b0('0x4c')](_0x494567)[_0xe0b0('0x15')](function(_0x3fc0d6){return[_0x3fc0d6,!![]];});});}return db[_0xe0b0('0xb1')][_0xe0b0('0x4c')](_0x494567)['then'](function(_0x180b6c){return[_0x180b6c,!![]];});}})[_0xe0b0('0xb2')](function(_0x2cd15d,_0x3e82b4){if(_0x2cd15d){_0x1c29dd=_0x3e82b4;if(!_0x3e82b4){var _0x3cbf47={'from':(_0xde3bca['contact'][_0xe0b0('0xa2')]||'')+'\x20'+(_0xde3bca[_0xe0b0('0x9d')][_0xe0b0('0xb3')]||'')};if(_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xae')]&&_0x44da91[_0xe0b0('0x4d')]['messageId']&&_0x44da91[_0xe0b0('0x4d')]['threadId']!=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xb4')]){_0x3cbf47[_0xe0b0('0xae')]=_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xb4')];}return _0x2cd15d[_0xe0b0('0x55')](_0x3cbf47);}else{return _0x2cd15d;}}})['then'](function(_0xe574f1){_0xde3bca[_0xe0b0('0xb0')]=_0xe574f1[_0xe0b0('0x2a')]({'plain':!![]});_0xde3bca[_0xe0b0('0xb0')][_0xe0b0('0xb5')]=_0x1c29dd;if(_0xde3bca[_0xe0b0('0xb0')][_0xe0b0('0xb5')]){if(_0xde3bca[_0xe0b0('0x97')]['autoclose']){_0xde3bca['applications'][_0xe0b0('0xb6')]({'id':0x0,'priority':_0xde3bca['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xe0b0('0xb7')});}}return db['ChatMessage']['create']({'body':_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0x4d')],'ChatWebsiteId':_0x44da91[_0xe0b0('0x56')]['id'],'ChatInteractionId':_0xe574f1['id'],'direction':'in','ContactId':_0xde3bca[_0xe0b0('0x9d')]['id'],'AttachmentId':_0x44da91[_0xe0b0('0x4d')][_0xe0b0('0xb8')]});})[_0xe0b0('0x15')](function(_0x450b09){_0xde3bca[_0xe0b0('0x1b')]=_0x450b09;if(_0xde3bca[_0xe0b0('0xb0')]['UserId']){return db['User'][_0xe0b0('0x4b')]({'attributes':['id',_0xe0b0('0x2d')],'where':{'id':_0xde3bca[_0xe0b0('0xb0')]['UserId']}})['then'](function(_0x254691){if(_0x254691){_0xde3bca['applications'][_0xe0b0('0xb9')]({'id':0x0,'priority':0x0,'app':_0xe0b0('0xba'),'appdata':_0x254691['name']+','+(_0xde3bca[_0xe0b0('0x97')][_0xe0b0('0xbb')]||0xa),'interval':_0xe0b0('0xb7')});_0xde3bca[_0xe0b0('0xbc')]=!![];}return respondWithRpcPromise(_0xe0b0('0xbd'),_0xe0b0('0xbe'),_0xde3bca);});}return respondWithRpcPromise(_0xe0b0('0xbd'),'startRouting',_0xde3bca);})[_0xe0b0('0x15')](function(_0xea6b40){respondWithRpcPromise(_0xe0b0('0xbf'),_0xe0b0('0xbf'),{'event':_0xe0b0('0xc0'),'message':_0xea6b40},client9002);return _0xea6b40;})['then'](respondWithResult(_0x701ba,null))['catch'](handleError(_0x701ba,null));};exports[_0xe0b0('0xc1')]=function(_0x4a8dfc,_0x4bfa22){var _0x3df5c8,_0x588a19,_0x36901a;var _0x151da2=[];var _0x330ed5={};var _0x35f5c1=_0x4a8dfc['files']||[];var _0x50b163=[];var _0x42affa;return db[_0xe0b0('0x9c')][_0xe0b0('0x83')]()[_0xe0b0('0x15')](function(_0xbafa53){if(!_0xbafa53){throw new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x86'));}_0x151da2=_['difference'](_[_0xe0b0('0x37')](_0xbafa53),[_0xe0b0('0x88'),_0xe0b0('0x89'),'CompanyId',_0xe0b0('0x9b')]);if(_0x4a8dfc[_0xe0b0('0x4d')]['id']){delete _0x4a8dfc[_0xe0b0('0x4d')]['id'];}if(_[_0xe0b0('0x70')](_0x4a8dfc[_0xe0b0('0x4d')][_0xe0b0('0x8a')])){throw _0x4bfa22['status'](0x1f4)[_0xe0b0('0x2e')](new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))]('from\x20is\x20mandatory'));}if(_[_0xe0b0('0x70')](_0x4a8dfc[_0xe0b0('0x4d')][_0xe0b0('0x4d')])||_0x4a8dfc[_0xe0b0('0x4d')]['body']===''){throw _0x4bfa22[_0xe0b0('0x21')](0x1f4)[_0xe0b0('0x2e')](new db[(_0xe0b0('0x84'))][(_0xe0b0('0x85'))](_0xe0b0('0x8c')));}if(_[_0xe0b0('0x70')](_0x4a8dfc[_0xe0b0('0x4d')][_0xe0b0('0xc2')])){throw _0x4bfa22['status'](0x1f4)[_0xe0b0('0x2e')](new db['Sequelize']['ValidationError'](_0xe0b0('0xc3')+_0x151da2));}if(!_[_0xe0b0('0x8f')](_0x151da2,_0x4a8dfc[_0xe0b0('0x4d')]['mapKeyOffline'])){throw _0x4bfa22[_0xe0b0('0x21')](0x1f4)['send'](new db[(_0xe0b0('0x84'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x151da2));}_0x330ed5[_0x4a8dfc['body'][_0xe0b0('0xc2')]]=_0x4a8dfc[_0xe0b0('0x4d')]['from'];})[_0xe0b0('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4a8dfc[_0xe0b0('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xe0b0('0x92')},{'model':db[_0xe0b0('0xc4')],'as':_0xe0b0('0xc4')}]});})[_0xe0b0('0x15')](handleEntityNotFound(_0x4bfa22,null))['then'](function(_0x2fe1ab){if(_0x2fe1ab&&_0x2fe1ab[_0xe0b0('0x92')]){_0x588a19=_0x2fe1ab;var _0x4187aa=_[_0xe0b0('0x9a')](_0x4a8dfc[_0xe0b0('0x4d')],{'firstName':_0x4a8dfc['body'][_0xe0b0('0x8a')],'phone':_0x4a8dfc[_0xe0b0('0x4d')]['from'],'ListId':_0x2fe1ab[_0xe0b0('0x9b')]});_0x4187aa[_0x4a8dfc['body'][_0xe0b0('0xc2')]]=_0x4a8dfc[_0xe0b0('0x4d')][_0xe0b0('0x8a')];return db[_0xe0b0('0x9c')][_0xe0b0('0xc5')]({'where':_0x330ed5,'defaults':_0x4187aa});}})[_0xe0b0('0xb2')](function(_0x403f30){if(_0x403f30){_0x36901a=_0x403f30;var _0x5b7b02=fs['readFileSync'](path[_0xe0b0('0x6a')](config['root'],_0xe0b0('0xc6')),_0xe0b0('0xc7'));var _0xdde041=ejs[_0xe0b0('0xc8')](_0x5b7b02,{'body':_[_0xe0b0('0xc9')](_0x4a8dfc[_0xe0b0('0x4d')]['body']),'bodyTitle':_0x588a19['offlineMessageBody']});return db[_0xe0b0('0xca')][_0xe0b0('0x4c')]({'body':_0xdde041,'plainBody':htmlToText['fromString'](_0xdde041),'ContactId':_0x403f30['id'],'ChatWebsiteId':_0x588a19['id']});}})[_0xe0b0('0x15')](function(_0x2d0ba8){_0x42affa=_0x2d0ba8;if(_0x35f5c1['length']){var _0x2ad35d=_0x35f5c1[_0xe0b0('0x32')](function(_0x337db8){return{'name':_0x337db8['originalname'],'basename':_0x337db8[_0xe0b0('0x63')],'type':_0x337db8[_0xe0b0('0xcb')],'ChatOfflineMessageId':_0x2d0ba8['id']};});_0x50b163=_0x2ad35d[_0xe0b0('0x32')](_0x24d9ee=>{var _0x57e90f={'filename':_0x24d9ee[_0xe0b0('0x2d')],'path':path['join'](config[_0xe0b0('0x6b')],_0xe0b0('0xcc'),_0xe0b0('0xcd'),'attachments',_0xe0b0('0xce'),_0x24d9ee[_0xe0b0('0xcf')])};return _0x57e90f;});if(!_0x588a19[_0xe0b0('0xd0')]){return db[_0xe0b0('0xd1')]['transaction'](function(_0x1266c8){return db[_0xe0b0('0xd2')][_0xe0b0('0xd3')](_0x2ad35d,{'transaction':_0x1266c8});});}}})[_0xe0b0('0x15')](function(){if(_0x42affa){_0x3df5c8=_0x42affa;return db[_0xe0b0('0xc4')][_0xe0b0('0x5e')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x25d3fe){if(_0x25d3fe&&_0x25d3fe['Smtp']&&_0x588a19[_0xe0b0('0xd4')]&&_0x588a19['forwardOfflineAddress']){var _0x47d689={'tls':{'rejectUnauthorized':![]}};if(_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0xd6')]){_0x47d689[_0xe0b0('0xd6')]=_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0xd6')];}else{_0x47d689[_0xe0b0('0xd7')]=_0x25d3fe[_0xe0b0('0xd5')]['host'];_0x47d689[_0xe0b0('0xd8')]=_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0xd8')];_0x47d689[_0xe0b0('0xd9')]=_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0xd9')];}if(_0x25d3fe['Smtp']['authentication']){_0x47d689[_0xe0b0('0xda')]={'user':_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0x4e')],'pass':_0x25d3fe[_0xe0b0('0xd5')][_0xe0b0('0xdb')]};}return respondWithRpcPromise(_0xe0b0('0xdc'),_0xe0b0('0xdd'),{'account':_0x47d689,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x25d3fe[_0xe0b0('0x2d')],_0x25d3fe[_0xe0b0('0xde')]||_0x25d3fe[_0xe0b0('0xd5')]['user']),'to':_0x588a19['forwardOfflineAddress'],'subject':_0x588a19[_0xe0b0('0xdf')],'html':_0x3df5c8[_0xe0b0('0x4d')],'attachments':_0x50b163}},client9003)[_0xe0b0('0x15')](function(){return _0x3df5c8;})[_0xe0b0('0x1e')](function(_0x1427a9){console[_0xe0b0('0x19')](_0x1427a9);});}})[_0xe0b0('0x15')](function(){if(_0x588a19&&_0x588a19[_0xe0b0('0xd0')]&&_0x588a19[_0xe0b0('0xe0')]){var _0x233c95=[];if(_0x35f5c1['length']){_0x233c95=_0x35f5c1[_0xe0b0('0x32')](function(_0x4a577b){return{'name':_0x4a577b[_0xe0b0('0xe1')],'basename':_0x4a577b['filename'],'type':_0x4a577b[_0xe0b0('0xcb')],'ChatOfflineMessageId':_0x42affa['id']};});}var _0x326470;if(!_['isNil'](_0x588a19[_0xe0b0('0xe2')])){var _0x41fd0e=_[_0xe0b0('0x32')](_0x4a8dfc['body'],function(_0x172318){return _0x172318;});var _0xb3018b=_['toPairsIn'](_0x41fd0e)[0x0];var _0x34338e=_[_0xe0b0('0xe3')](_0xb3018b,function(_0x50828f){return _0x50828f;});_0x326470=_0x34338e[0x1][_0x588a19['subjectOffline']];}var _0x33c97b={'from':_0x36901a[_0xe0b0('0xde')],'firstName':_0x36901a['firstName'],'lastName':_0x36901a['lastName'],'mapKey':_0xe0b0('0xde'),'message':{'from':_0x36901a['email'],'to':_0x588a19[_0xe0b0('0xc4')][_0xe0b0('0xde')],'cc':'','subject':_[_0xe0b0('0x70')](_0x326470)?_0x588a19[_0xe0b0('0xdf')]:_0x326470,'messageId':'','sentAt':new Date(),'attach':_0x233c95[_0xe0b0('0x3c')],'attachments':_0x233c95,'originChannel':_0xe0b0('0xe4'),'ChatWebsiteId':_0x588a19['id'],'ChatOfflineMessageId':_0x3df5c8['id'],'originTo':_0x588a19[_0xe0b0('0xc4')]['email']},'body':_0x3df5c8[_0xe0b0('0x4d')]};var _0x5f059f={'account':{'id':_0x588a19['MailAccountId']},'body':_0x33c97b,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xe0b0('0xe5'),_0xe0b0('0xe6'),_0x5f059f,client9001)[_0xe0b0('0x15')](function(){return _0x3df5c8;})[_0xe0b0('0x1e')](function(_0x21ccfe){console['error'](_0x21ccfe);});}return;})['then'](function(){if(_0x3df5c8){return _0x3df5c8;}})['then'](respondWithResult(_0x4bfa22,null))['catch'](function(_0x41b52){console[_0xe0b0('0x19')](_0xe0b0('0x1e'),_0x41b52);for(var _0x5d8613 of _0x35f5c1){var _0x2c18b9=path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0xcc'),_0xe0b0('0xcd'),_0xe0b0('0xe7'),_0xe0b0('0xce'),_0x5d8613['filename']);fs_extra[_0xe0b0('0xe8')](_0x2c18b9)[_0xe0b0('0x1e')](function(_0x2bb49d){console[_0xe0b0('0x19')]('Could\x20not\x20remove\x20attachment\x20file',_0x2c18b9,_0x2bb49d);});}});};exports[_0xe0b0('0xe9')]=function(_0x20f040,_0x3eb643){return db[_0xe0b0('0xb1')]['find']({'where':{'id':_0x20f040['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x3eb643,null))[_0xe0b0('0x15')](function(_0x26bd6c){if(_0x26bd6c){return _0x26bd6c[_0xe0b0('0xe9')](_0x20f040[_0xe0b0('0x4d')][_0xe0b0('0x61')],_['omit'](_0x20f040[_0xe0b0('0x4d')],[_0xe0b0('0x61'),'id'])||{});}})[_0xe0b0('0x15')](respondWithResult(_0x3eb643,null))[_0xe0b0('0x1e')](handleError(_0x3eb643,null));};exports[_0xe0b0('0xea')]=function(_0x48706b,_0x164b25){var _0x51afab={'raw':![],'where':{}};var _0x49632d={};var _0x257dda={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x48706b[_0xe0b0('0x56')]['id']}})['then'](handleEntityNotFound(_0x164b25,null))['then'](function(_0x5a04c8){if(_0x5a04c8){_0x49632d[_0xe0b0('0x35')]=_[_0xe0b0('0x37')](db['ChatInteraction'][_0xe0b0('0x5a')]);_0x49632d['query']=_[_0xe0b0('0x37')](_0x48706b[_0xe0b0('0x36')]);_0x49632d[_0xe0b0('0x38')]=_[_0xe0b0('0x3a')](_0x49632d['model'],_0x49632d['query']);_0x51afab['attributes']=_[_0xe0b0('0x3a')](_0x49632d[_0xe0b0('0x35')],qs['fields'](_0x48706b['query'][_0xe0b0('0x3b')]));_0x51afab[_0xe0b0('0x39')]=_0x51afab[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x51afab['attributes']:_0x49632d['model'];if(!_0x48706b[_0xe0b0('0x36')][_0xe0b0('0x3d')]('nolimit')){_0x51afab[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x48706b['query']['limit']);_0x51afab['offset']=qs[_0xe0b0('0x22')](_0x48706b[_0xe0b0('0x36')]['offset']);}_0x51afab[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x48706b[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x51afab['where']=qs[_0xe0b0('0x38')](_[_0xe0b0('0x41')](_0x48706b['query'],_0x49632d['filters']));_0x51afab['where'][_0xe0b0('0x57')]=_0x5a04c8['id'];if(_0x48706b['query'][_0xe0b0('0x42')]){_0x51afab['where']=_['merge'](_0x51afab[_0xe0b0('0x43')],{'$or':_[_0xe0b0('0x32')](_0x51afab[_0xe0b0('0x39')],function(_0xe1891c){var _0x4cfd4f={};_0x4cfd4f[_0xe1891c]={'$like':'%'+_0x48706b['query']['filter']+'%'};return _0x4cfd4f;})});}_0x51afab=_['merge']({},_0x51afab,_0x48706b[_0xe0b0('0x46')]);return db[_0xe0b0('0xb1')][_0xe0b0('0x25')]({'where':_0x51afab['where']})[_0xe0b0('0x15')](function(_0x1f1133){_0x257dda['count']=_0x1f1133;if(_0x48706b[_0xe0b0('0x36')][_0xe0b0('0x4a')]){_0x51afab[_0xe0b0('0x47')]=[{'model':db[_0xe0b0('0x9c')],'as':'Contact','required':![]},{'model':db[_0xe0b0('0xeb')],'as':_0xe0b0('0xec'),'attributes':[_0xe0b0('0x2d'),'fullname',_0xe0b0('0xed')],'required':![]},{'model':db[_0xe0b0('0xee')],'as':_0xe0b0('0xef'),'attributes':['id',_0xe0b0('0x2d'),'color'],'where':_0x48706b[_0xe0b0('0x36')][_0xe0b0('0xf0')]?{'id':_0x48706b[_0xe0b0('0x36')][_0xe0b0('0xf0')]}:undefined,'required':_0x48706b[_0xe0b0('0x36')]['tag']?!![]:![]}];}return db[_0xe0b0('0xb1')][_0xe0b0('0x5b')](_0x51afab);})['then'](function(_0xb263f6){_0x257dda[_0xe0b0('0x48')]=_0xb263f6;return _0x257dda;});}})[_0xe0b0('0x15')](respondWithFilteredResult(_0x164b25,_0x51afab))[_0xe0b0('0x1e')](handleError(_0x164b25,null));};function iftimePromise(_0x1ffc75,_0x3a39d7){return respondWithRpcPromise('Command',_0xe0b0('0xf1'),{'command':_0x3a39d7[_0xe0b0('0xf2')]?util[_0xe0b0('0xa7')](_0xe0b0('0xf3'),_0x1ffc75[_0xe0b0('0xf4')],_0x3a39d7[_0xe0b0('0xf2')]):util[_0xe0b0('0xa7')](_0xe0b0('0xf5'),_0x1ffc75[_0xe0b0('0xf4')])},client9002)[_0xe0b0('0x15')](function(_0x4d12b2){var _0xeeff22=_0x4d12b2&&_0x4d12b2['indexOf'](_0xe0b0('0xf6'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3a39d7['id'],_0x1ffc75['id'],_0x1ffc75[_0xe0b0('0xf4')],_0xeeff22?_0xe0b0('0xf7'):'OFFLINE',_0x3a39d7['timezone']?_0x3a39d7[_0xe0b0('0xf2')]:_0xe0b0('0xf8'));return _0xeeff22;})['catch'](function(_0x5501c2){logger[_0xe0b0('0x19')](_0xe0b0('0xf9'),_0x3a39d7['id'],_0x1ffc75['id'],_0x1ffc75['interval'],util[_0xe0b0('0xfa')](_0x5501c2,{'showHidden':![],'depth':null}),_0x3a39d7[_0xe0b0('0xf2')]?_0x3a39d7[_0xe0b0('0xf2')]:_0xe0b0('0xf8'));return![];});}exports['getSnippet']=function(_0x230ff2,_0x22d53d){var _0x2251c2=0x0;var _0x24271d=0x0;var _0x385ffb=![];var _0x594eaa;var _0x2932c3;return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x230ff2['params']['id']},'include':[{'model':db[_0xe0b0('0xfb')],'as':_0xe0b0('0xfb'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xe0b0('0xf4')],'raw':!![]}]}]})[_0xe0b0('0x15')](handleEntityNotFound(_0x22d53d,null))[_0xe0b0('0x15')](function(_0x46fbdc){if(_0x46fbdc){_0x594eaa=_0x46fbdc;return _0x46fbdc[_0xe0b0('0xfc')]({'raw':!![]});}})[_0xe0b0('0x15')](function(_0x34e1bf){if(_0x594eaa){if(_0x34e1bf){_0x2932c3=_0x34e1bf;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0x5c001a){if(_0x5c001a){_0x24271d=_0x5c001a[_0xe0b0('0xfd')];_0x385ffb=_0x5c001a[_0xe0b0('0x6f')];}})[_0xe0b0('0x15')](function(){return db['ChatInteraction'][_0xe0b0('0x25')]({'where':{'closed':![]}});})[_0xe0b0('0x15')](function(_0x1a5a0f){_0x2251c2=_0x1a5a0f;if(_0x24271d&&_0x1a5a0f>_0x24271d){return db[_0xe0b0('0xfe')][_0xe0b0('0x5e')]({'where':{'id':0x1}})[_0xe0b0('0x15')](function(_0x5910e6){if(_0x5910e6){_0x5910e6['increment'](_0xe0b0('0xff'));}});}})[_0xe0b0('0x15')](function(){if(_0x594eaa[_0xe0b0('0xfb')]&&_0x594eaa[_0xe0b0('0xfb')][_0xe0b0('0x100')]){var _0x55e2ba=[];for(var _0x1e4f9d=0x0;_0x1e4f9d<_0x594eaa[_0xe0b0('0xfb')][_0xe0b0('0x100')][_0xe0b0('0x3c')];_0x1e4f9d++){var _0x224e67=_0x594eaa[_0xe0b0('0xfb')][_0xe0b0('0x100')][_0x1e4f9d][_0xe0b0('0x2a')]({'plain':!![]});_0x55e2ba[_0xe0b0('0xb6')](iftimePromise(_0x224e67,_0x594eaa));}return BPromise[_0xe0b0('0x101')](_0x55e2ba)['then'](function(_0x5bc9dc){return _['some'](_0x5bc9dc);});}else{return!![];}})[_0xe0b0('0x15')](function(_0x344877){var _0xa604c3=fs[_0xe0b0('0x102')](path[_0xe0b0('0x6a')](config[_0xe0b0('0x6b')],_0xe0b0('0x103')),'utf8');var _0xa6e316={'remote':_0x594eaa[_0xe0b0('0x104')],'query':querystring[_0xe0b0('0xad')](_['merge'](_0x594eaa[_0xe0b0('0x2a')]({'plain':!![]}),{'customerIp':_0x230ff2[_0xe0b0('0x7f')]['x-forwarded-for']||_0x230ff2[_0xe0b0('0x7f')][_0xe0b0('0x105')]||_0x230ff2[_0xe0b0('0x106')][_0xe0b0('0x107')]||_0x230ff2['ip'],'referer':_0x230ff2['headers']['referer'],'openedInteractions':_0x2251c2,'maxInteractions':_0x24271d,'virtual':_0x385ffb[_0xe0b0('0xfd')],'online':_0x344877,'custom':_0x385ffb}))['replace'](/'/g,'\x5c\x27')};_0x22d53d[_0xe0b0('0x2e')](ejs['render'](Mustache[_0xe0b0('0xc8')](_0xa604c3,_0xa6e316),{'proactiveActions':_0x2932c3,'alignment':_0x594eaa[_0xe0b0('0x108')],'verticalAlignment':_0x594eaa[_0xe0b0('0x109')],'div_color':_0x594eaa['color'],'labelText':_0x594eaa[_0xe0b0('0x10a')],'text_color':_0x594eaa['textColor'],'button_color':_0x594eaa[_0xe0b0('0x10b')],'background_color':_0x594eaa[_0xe0b0('0x10c')]}));})['catch'](handleError(_0x22d53d,null));};exports[_0xe0b0('0x10d')]=function(_0x3888d7,_0x2ed835){var _0x8c9efb=_0x3888d7['params']['id'];var _0x161a8c=_0x3888d7[_0xe0b0('0x4d')];var _0x2522f7=0xc8;var _0x523818=null;return db[_0xe0b0('0xd1')]['transaction']({'isolationLevel':db[_0xe0b0('0xd1')]['Transaction'][_0xe0b0('0x10e')][_0xe0b0('0x10f')]},function(_0x18d0eb){return db['ChatWebsite'][_0xe0b0('0x5e')]({'where':{'id':_0x8c9efb},'transaction':_0x18d0eb})[_0xe0b0('0x15')](function(_0x2eb954){if(_0x2eb954){return db[_0xe0b0('0x95')][_0xe0b0('0x29')]({'where':{'ChatWebsiteId':_0x8c9efb},'transaction':_0x18d0eb})[_0xe0b0('0x15')](function(){var _0x2961c1=_['map'](_0x161a8c,function(_0x31063b){_0x31063b['ChatWebsiteId']=_0x8c9efb;return _0x31063b;});return db[_0xe0b0('0x95')]['bulkCreate'](_0x2961c1,{'transaction':_0x18d0eb});});}else{_0x2522f7=0x194;_0x523818=[];}});})[_0xe0b0('0x15')](function(){if(_0x2522f7!==0x194){return db[_0xe0b0('0x95')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x8c9efb},'order':'priority'})[_0xe0b0('0x15')](function(_0x32c330){_0x523818=_0x32c330;});}})[_0xe0b0('0x1e')](function(_0x299f82){_0x2522f7=0x1f4;logger[_0xe0b0('0x19')](_0x299f82[_0xe0b0('0x2c')]);if(_0x299f82['name']){delete _0x299f82[_0xe0b0('0x2d')];}_0x523818=_0x299f82;})[_0xe0b0('0x110')](function(){if(_0x523818===null){_0x2ed835['sendStatus'](_0x2522f7);}else{if(_0x2522f7===0x1f4){_0x2ed835[_0xe0b0('0x21')](_0x2522f7)[_0xe0b0('0x2e')](_0x523818);}else{_0x2ed835[_0xe0b0('0x21')](_0x2522f7)[_0xe0b0('0x28')](_0x523818);}}});};exports[_0xe0b0('0x111')]=function(_0x5ac9af,_0x220bb1){var _0x51fab9={};var _0x2309cf={};var _0x436d2c;var _0x3b6cac;return db[_0xe0b0('0x33')][_0xe0b0('0x5e')]({'where':{'id':_0x5ac9af['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x220bb1,null))[_0xe0b0('0x15')](function(_0x49da50){if(_0x49da50){_0x436d2c=_0x49da50;_0x2309cf[_0xe0b0('0x35')]=_[_0xe0b0('0x37')](db[_0xe0b0('0x95')][_0xe0b0('0x5a')]);_0x2309cf[_0xe0b0('0x36')]=_['keys'](_0x5ac9af['query']);_0x2309cf['filters']=_[_0xe0b0('0x3a')](_0x2309cf[_0xe0b0('0x35')],_0x2309cf[_0xe0b0('0x36')]);_0x51fab9['attributes']=_[_0xe0b0('0x3a')](_0x2309cf['model'],qs[_0xe0b0('0x3b')](_0x5ac9af[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x51fab9[_0xe0b0('0x39')]=_0x51fab9[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x51fab9['attributes']:_0x2309cf[_0xe0b0('0x35')];_0x51fab9[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x5ac9af['query'][_0xe0b0('0x40')]);_0x51fab9[_0xe0b0('0x43')]=qs['filters'](_[_0xe0b0('0x41')](_0x5ac9af['query'],_0x2309cf[_0xe0b0('0x38')]));if(_0x5ac9af[_0xe0b0('0x36')][_0xe0b0('0x42')]){_0x51fab9[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x51fab9[_0xe0b0('0x43')],{'$or':_[_0xe0b0('0x32')](_0x51fab9[_0xe0b0('0x39')],function(_0x41e4be){var _0x3338bb={};_0x3338bb[_0x41e4be]={'$like':'%'+_0x5ac9af[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x3338bb;})});}_0x51fab9=_[_0xe0b0('0x44')]({},_0x51fab9,_0x5ac9af[_0xe0b0('0x46')]);return _0x436d2c['getApplications'](_0x51fab9);}})[_0xe0b0('0x15')](function(_0xce17d3){if(_0xce17d3){_0x3b6cac=_0xce17d3[_0xe0b0('0x3c')];if(!_0x5ac9af[_0xe0b0('0x36')][_0xe0b0('0x3d')](_0xe0b0('0x3e'))){_0x51fab9[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x5ac9af[_0xe0b0('0x36')][_0xe0b0('0x23')]);_0x51fab9[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x5ac9af['query'][_0xe0b0('0x22')]);}return _0x436d2c['getApplications'](_0x51fab9);}})['then'](function(_0xd60c40){if(_0xd60c40){return _0xd60c40?{'count':_0x3b6cac,'rows':_0xd60c40}:null;}})[_0xe0b0('0x15')](respondWithResult(_0x220bb1,null))['catch'](handleError(_0x220bb1,null));};exports[_0xe0b0('0x112')]=function(_0x1ebfdc,_0x5d1b30){return db[_0xe0b0('0x113')][_0xe0b0('0x4b')]({'where':{'id':_0x1ebfdc[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x5d1b30,null))[_0xe0b0('0x15')](function(_0x4ba58d){if(_0x4ba58d){return _0x4ba58d[_0xe0b0('0x112')](_0x1ebfdc[_0xe0b0('0x4d')][_0xe0b0('0x61')],_['omit'](_0x1ebfdc[_0xe0b0('0x4d')],[_0xe0b0('0x61'),'id'])||{});}})[_0xe0b0('0x15')](respondWithResult(_0x5d1b30,null))[_0xe0b0('0x1e')](handleError(_0x5d1b30,null));};exports[_0xe0b0('0xfc')]=function(_0x15373d,_0x207b52){var _0x421f85={};var _0x7a18d8={};var _0x245796;var _0x51d6f0;return db['ChatWebsite'][_0xe0b0('0x5e')]({'where':{'id':_0x15373d['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x207b52,null))['then'](function(_0xaad4b4){if(_0xaad4b4){_0x245796=_0xaad4b4;_0x7a18d8[_0xe0b0('0x35')]=_[_0xe0b0('0x37')](db['ChatProactiveAction']['rawAttributes']);_0x7a18d8['query']=_[_0xe0b0('0x37')](_0x15373d[_0xe0b0('0x36')]);_0x7a18d8['filters']=_[_0xe0b0('0x3a')](_0x7a18d8[_0xe0b0('0x35')],_0x7a18d8[_0xe0b0('0x36')]);_0x421f85[_0xe0b0('0x39')]=_[_0xe0b0('0x3a')](_0x7a18d8[_0xe0b0('0x35')],qs[_0xe0b0('0x3b')](_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x421f85[_0xe0b0('0x39')]=_0x421f85[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x421f85[_0xe0b0('0x39')]:_0x7a18d8['model'];_0x421f85[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x421f85[_0xe0b0('0x43')]=qs[_0xe0b0('0x38')](_[_0xe0b0('0x41')](_0x15373d[_0xe0b0('0x36')],_0x7a18d8[_0xe0b0('0x38')]));if(_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x42')]){_0x421f85[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x421f85[_0xe0b0('0x43')],{'$or':_['map'](_0x421f85[_0xe0b0('0x39')],function(_0x12fec1){var _0x1fc2ba={};_0x1fc2ba[_0x12fec1]={'$like':'%'+_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x1fc2ba;})});}_0x421f85=_['merge']({},_0x421f85,_0x15373d[_0xe0b0('0x46')]);return _0x245796[_0xe0b0('0xfc')](_0x421f85);}})['then'](function(_0x4ed950){if(_0x4ed950){_0x51d6f0=_0x4ed950['length'];if(!_0x15373d[_0xe0b0('0x36')]['hasOwnProperty'](_0xe0b0('0x3e'))){_0x421f85[_0xe0b0('0x23')]=qs['limit'](_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x23')]);_0x421f85['offset']=qs[_0xe0b0('0x22')](_0x15373d[_0xe0b0('0x36')][_0xe0b0('0x22')]);}return _0x245796['getProactiveActions'](_0x421f85);}})[_0xe0b0('0x15')](function(_0xac72b0){if(_0xac72b0){return _0xac72b0?{'count':_0x51d6f0,'rows':_0xac72b0}:null;}})[_0xe0b0('0x15')](respondWithResult(_0x207b52,null))[_0xe0b0('0x1e')](handleError(_0x207b52,null));};exports[_0xe0b0('0x114')]=function(_0x806731,_0x5632cd){var _0x454673=_0x806731[_0xe0b0('0x36')][_0xe0b0('0x115')]===_0xe0b0('0x116')?_0xe0b0('0x117'):_0xe0b0('0x118');return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'attributes':['id',_0x454673],'where':{'id':_0x806731['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x5632cd,null))[_0xe0b0('0x15')](function(_0xc88c18){if(_0xc88c18){var _0x3ea089=_0xc88c18[_0x454673];var _0x30af0e=_0x3ea089&&_0x3ea089[_0xe0b0('0x119')]?_0x3ea089[_0xe0b0('0x119')]:[];_0x5632cd[_0xe0b0('0x2e')]({'fromKey':_['isNil'](_0x3ea089[_0xe0b0('0x11a')])?undefined:_0x3ea089[_0xe0b0('0x11a')],'count':_0x30af0e['length'],'rows':_0x30af0e});}})[_0xe0b0('0x1e')](handleError(_0x5632cd,null));};exports[_0xe0b0('0x11b')]=function(_0x443352,_0x404b24){var _0x1654d4={'raw':![],'where':{}};var _0x1214bd={};var _0x150f88={'count':0x0,'rows':[]};return db[_0xe0b0('0x33')][_0xe0b0('0x5e')]({'where':{'id':_0x443352[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x404b24,null))['then'](function(_0x2bafbe){if(_0x2bafbe){_0x1214bd[_0xe0b0('0x35')]=_[_0xe0b0('0x37')](db[_0xe0b0('0xca')][_0xe0b0('0x5a')]);_0x1214bd['query']=_[_0xe0b0('0x37')](_0x443352['query']);_0x1214bd['filters']=_[_0xe0b0('0x3a')](_0x1214bd[_0xe0b0('0x35')],_0x1214bd[_0xe0b0('0x36')]);_0x1654d4[_0xe0b0('0x39')]=_[_0xe0b0('0x3a')](_0x1214bd[_0xe0b0('0x35')],qs['fields'](_0x443352[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x1654d4[_0xe0b0('0x39')]=_0x1654d4[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x1654d4[_0xe0b0('0x39')]:_0x1214bd[_0xe0b0('0x35')];if(!_0x443352['query'][_0xe0b0('0x3d')](_0xe0b0('0x3e'))){_0x1654d4[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x443352['query']['limit']);_0x1654d4[_0xe0b0('0x22')]=qs['offset'](_0x443352[_0xe0b0('0x36')]['offset']);}_0x1654d4[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x443352[_0xe0b0('0x36')]['sort']);_0x1654d4['where']=qs[_0xe0b0('0x38')](_[_0xe0b0('0x41')](_0x443352[_0xe0b0('0x36')],_0x1214bd['filters']));_0x1654d4[_0xe0b0('0x43')][_0xe0b0('0x57')]=_0x2bafbe['id'];if(_0x443352[_0xe0b0('0x36')][_0xe0b0('0x42')]){_0x1654d4[_0xe0b0('0x43')]=_[_0xe0b0('0x44')](_0x1654d4[_0xe0b0('0x43')],{'$or':_[_0xe0b0('0x32')](_0x1654d4[_0xe0b0('0x39')],function(_0x5815f5){var _0x1eacdf={};_0x1eacdf[_0x5815f5]={'$like':'%'+_0x443352[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x1eacdf;})});}_0x1654d4=_[_0xe0b0('0x44')]({},_0x1654d4,_0x443352[_0xe0b0('0x46')]);return db[_0xe0b0('0xca')][_0xe0b0('0x25')]({'where':_0x1654d4[_0xe0b0('0x43')]})[_0xe0b0('0x15')](function(_0x4496d0){_0x150f88[_0xe0b0('0x25')]=_0x4496d0;if(_0x443352['query']['includeAll']){_0x1654d4['include']=[{'all':!![]}];}else{_0x1654d4['include']=[{'model':db[_0xe0b0('0x9c')],'as':_0xe0b0('0x11c'),'required':![]},{'model':db[_0xe0b0('0xd2')],'as':_0xe0b0('0x11d'),'required':![]}];}return db[_0xe0b0('0xca')][_0xe0b0('0x5b')](_0x1654d4);})[_0xe0b0('0x15')](function(_0x306f80){_0x150f88[_0xe0b0('0x48')]=_0x306f80;return _0x150f88;});}})['then'](respondWithFilteredResult(_0x404b24,_0x1654d4))['catch'](handleError(_0x404b24,null));};exports[_0xe0b0('0x11e')]=function(_0x2c6de2,_0x49f1df){return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x2c6de2[_0xe0b0('0x56')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x49f1df,null))['then'](function(_0x1612e9){if(_0x1612e9){return _0x1612e9['addAgents'](_0x2c6de2[_0xe0b0('0x4d')][_0xe0b0('0x61')],_[_0xe0b0('0x11f')](_0x2c6de2[_0xe0b0('0x4d')],[_0xe0b0('0x61'),'id'])||{})[_0xe0b0('0xb2')](function(_0x9d6a15){for(var _0x2601ab=0x0;_0x2601ab<_0x2c6de2[_0xe0b0('0x4d')]['ids']['length'];_0x2601ab+=0x1){socket[_0xe0b0('0x120')]('userChatWebsite:save',{'UserId':Number(_0x2c6de2[_0xe0b0('0x4d')][_0xe0b0('0x61')][_0x2601ab]),'ChatWebsiteId':Number(_0x2c6de2[_0xe0b0('0x56')]['id'])});}return _0x9d6a15;});}})[_0xe0b0('0x15')](respondWithResult(_0x49f1df,null))[_0xe0b0('0x1e')](handleError(_0x49f1df,null));};exports[_0xe0b0('0x121')]=function(_0x3c3bc2,_0x285e1d){return db[_0xe0b0('0x33')][_0xe0b0('0x4b')]({'where':{'id':_0x3c3bc2['params']['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x285e1d,null))['then'](function(_0x1a6915){if(_0x1a6915){return _0x1a6915['removeAgents'](_0x3c3bc2[_0xe0b0('0x36')][_0xe0b0('0x61')])[_0xe0b0('0x15')](function(){if(_[_0xe0b0('0x122')](_0x3c3bc2[_0xe0b0('0x36')][_0xe0b0('0x61')])){for(var _0x82d32f=0x0;_0x82d32f<_0x3c3bc2[_0xe0b0('0x36')][_0xe0b0('0x61')][_0xe0b0('0x3c')];_0x82d32f+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x3c3bc2[_0xe0b0('0x36')][_0xe0b0('0x61')][_0x82d32f]),'ChatWebsiteId':Number(_0x3c3bc2[_0xe0b0('0x56')]['id'])});}}else{socket[_0xe0b0('0x120')](_0xe0b0('0x123'),{'UserId':Number(_0x3c3bc2[_0xe0b0('0x36')][_0xe0b0('0x61')]),'ChatWebsiteId':Number(_0x3c3bc2[_0xe0b0('0x56')]['id'])});}});}})[_0xe0b0('0x15')](respondWithStatusCode(_0x285e1d,null))[_0xe0b0('0x1e')](handleError(_0x285e1d,null));};exports[_0xe0b0('0x124')]=function(_0x54e11c,_0x4d6351){var _0x2e872b={};var _0x1f9b27={};var _0x229485;var _0x21a549;return db[_0xe0b0('0x33')]['findOne']({'where':{'id':_0x54e11c[_0xe0b0('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d6351,null))[_0xe0b0('0x15')](function(_0x4d04bf){if(_0x4d04bf){_0x229485=_0x4d04bf;_0x1f9b27[_0xe0b0('0x35')]=_[_0xe0b0('0x37')](db[_0xe0b0('0xeb')][_0xe0b0('0x5a')]);_0x1f9b27[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x54e11c[_0xe0b0('0x36')]);_0x1f9b27['filters']=_['intersection'](_0x1f9b27['model'],_0x1f9b27['query']);_0x2e872b[_0xe0b0('0x39')]=_['intersection'](_0x1f9b27['model'],qs['fields'](_0x54e11c[_0xe0b0('0x36')][_0xe0b0('0x3b')]));_0x2e872b[_0xe0b0('0x39')]=_0x2e872b[_0xe0b0('0x39')][_0xe0b0('0x3c')]?_0x2e872b['attributes']:_0x1f9b27['model'];_0x2e872b[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x54e11c[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x2e872b[_0xe0b0('0x43')]=qs['filters'](_['pick'](_0x54e11c[_0xe0b0('0x36')],_0x1f9b27[_0xe0b0('0x38')]));if(_0x54e11c[_0xe0b0('0x36')]['filter']){_0x2e872b['where']=_[_0xe0b0('0x44')](_0x2e872b[_0xe0b0('0x43')],{'$or':_[_0xe0b0('0x32')](_0x2e872b[_0xe0b0('0x39')],function(_0x9a8a0d){var _0x938810={};_0x938810[_0x9a8a0d]={'$like':'%'+_0x54e11c[_0xe0b0('0x36')][_0xe0b0('0x42')]+'%'};return _0x938810;})});}_0x2e872b=_['merge']({},_0x2e872b,_0x54e11c['options']);return _0x229485[_0xe0b0('0x124')](_0x2e872b);}})[_0xe0b0('0x15')](function(_0x1717d3){if(_0x1717d3){_0x21a549=_0x1717d3[_0xe0b0('0x3c')];if(!_0x54e11c[_0xe0b0('0x36')][_0xe0b0('0x3d')](_0xe0b0('0x3e'))){_0x2e872b[_0xe0b0('0x23')]=qs['limit'](_0x54e11c[_0xe0b0('0x36')]['limit']);_0x2e872b[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x54e11c[_0xe0b0('0x36')]['offset']);}return _0x229485[_0xe0b0('0x124')](_0x2e872b);}})[_0xe0b0('0x15')](function(_0x7d6993){if(_0x7d6993){return _0x7d6993?{'count':_0x21a549,'rows':_0x7d6993}:null;}})[_0xe0b0('0x15')](respondWithResult(_0x4d6351,null))[_0xe0b0('0x1e')](handleError(_0x4d6351,null));};
\ No newline at end of file
+var _0xb10b=['removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','get','UserProfileResource','stack','name','index','map','ChatWebsite','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','includeAll','findAll','rows','mandatoryDispositionPause','intersection','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','Pause','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','filename','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','asc','defaults','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','referer','browser','version','format','%s\x20%s','unknown','device','threadId','ChatInteraction','ContactId','interaction','spread','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','describe','ListId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','labelText','textColor','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit'];(function(_0x2f1d24,_0x63a618){var _0x24f9ce=function(_0x58af47){while(--_0x58af47){_0x2f1d24['push'](_0x2f1d24['shift']());}};_0x24f9ce(++_0x63a618);}(_0xb10b,0x12a));var _0xbb10=function(_0x42a721,_0x2098e5){_0x42a721=_0x42a721-0x0;var _0x300148=_0xb10b[_0x42a721];return _0x300148;};'use strict';var BPromise=require(_0xbb10('0x0'));var Mustache=require('mustache');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var ejs=require(_0xbb10('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb10('0x4'));var querystring=require(_0xbb10('0x5'));var Redis=require(_0xbb10('0x6'));var qs=require(_0xbb10('0x7'));var logger=require(_0xbb10('0x8'))(_0xbb10('0x9'));var config=require('../../config/environment');var db=require(_0xbb10('0xa'))['db'];config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);var htmlToText=require(_0xbb10('0x10'));var jayson=require(_0xbb10('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xbb10('0x12')][_0xbb10('0x13')]({'port':0x232a});var client9003=jayson[_0xbb10('0x12')]['http']({'port':0x232b});var client9001=jayson[_0xbb10('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x44fb19,_0x916a32,_0x285009,_0x193a27){return new BPromise(function(_0x442548,_0x147230){var _0x58a612=_0x193a27||client;return _0x58a612[_0xbb10('0x14')](_0x44fb19,_0x285009)[_0xbb10('0x15')](function(_0x45b9d6){logger[_0xbb10('0x16')](_0xbb10('0x17'),_0x916a32,_0xbb10('0x18'));logger[_0xbb10('0x19')](_0xbb10('0x1a'),_0x916a32,_0xbb10('0x18'),JSON[_0xbb10('0x1b')](_0x45b9d6));if(_0x45b9d6['error']){if(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1d')]===0x1f4){logger[_0xbb10('0x1c')](_0xbb10('0x17'),_0x916a32,_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);return _0x147230(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);}logger[_0xbb10('0x1c')](_0xbb10('0x17'),_0x916a32,_0x45b9d6['error'][_0xbb10('0x1e')]);return _0x442548(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);}else{logger[_0xbb10('0x16')](_0xbb10('0x17'),_0x916a32,_0xbb10('0x18'));_0x442548(_0x45b9d6['result'][_0xbb10('0x1e')]);}})[_0xbb10('0x1f')](function(_0x50aea1){logger['error'](_0xbb10('0x17'),_0x916a32,_0x50aea1);_0x147230(_0x50aea1);});});}function respondWithStatusCode(_0x311abe,_0x2e911d){_0x2e911d=_0x2e911d||0xcc;return function(_0x317da4){if(_0x317da4){return _0x311abe[_0xbb10('0x20')](_0x2e911d);}return _0x311abe[_0xbb10('0x21')](_0x2e911d)[_0xbb10('0x22')]();};}function respondWithResult(_0x436104,_0x7f2377){_0x7f2377=_0x7f2377||0xc8;return function(_0x395404){if(_0x395404){return _0x436104[_0xbb10('0x21')](_0x7f2377)[_0xbb10('0x23')](_0x395404);}};}function respondWithFilteredResult(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(_0x4fb5e0){var _0xc93a04=typeof _0x4fedac[_0xbb10('0x24')]===_0xbb10('0x25')&&typeof _0x4fedac['limit']===_0xbb10('0x25');var _0x24d586=_0x4fb5e0[_0xbb10('0x26')];var _0x1d5e95=_0xc93a04?0x0:_0x4fedac[_0xbb10('0x24')];var _0x20d946=_0xc93a04?_0x4fb5e0[_0xbb10('0x26')]:_0x4fedac['offset']+_0x4fedac[_0xbb10('0x27')];var _0x21ac54;if(_0x20d946>=_0x24d586){_0x20d946=_0x24d586;_0x21ac54=0xc8;}else{_0x21ac54=0xce;}_0x537898[_0xbb10('0x21')](_0x21ac54);return _0x537898[_0xbb10('0x28')](_0xbb10('0x29'),_0x1d5e95+'-'+_0x20d946+'/'+_0x24d586)[_0xbb10('0x23')](_0x4fb5e0);}return null;};}function saveUpdates(_0x5d5c80){return function(_0x221624){if(_0x221624){return _0x221624['update'](_0x5d5c80)[_0xbb10('0x15')](function(_0x56f2da){return _0x56f2da;});}return null;};}function removeEntity(_0x16ad2a){return function(_0x1dcc9c){if(_0x1dcc9c){return _0x1dcc9c[_0xbb10('0x2a')]()['then'](function(){var _0x518d47=_0x1dcc9c[_0xbb10('0x2b')]({'plain':!![]});var _0x34f65e='ChatWebsites';return db[_0xbb10('0x2c')][_0xbb10('0x2a')]({'where':{'type':_0x34f65e,'resourceId':_0x518d47['id']}})[_0xbb10('0x15')](function(){return _0x1dcc9c;});})[_0xbb10('0x15')](function(){_0x16ad2a[_0xbb10('0x21')](0xcc)[_0xbb10('0x22')]();});}};}function handleEntityNotFound(_0xf85197){return function(_0x4975f5){if(!_0x4975f5){_0xf85197[_0xbb10('0x20')](0x194);}return _0x4975f5;};}function handleError(_0x1da9c9,_0x441d15){_0x441d15=_0x441d15||0x1f4;return function(_0x8c1ce6){logger[_0xbb10('0x1c')](_0x8c1ce6[_0xbb10('0x2d')]);if(_0x8c1ce6[_0xbb10('0x2e')]){delete _0x8c1ce6[_0xbb10('0x2e')];}_0x1da9c9[_0xbb10('0x21')](_0x441d15)['send'](_0x8c1ce6);};}exports[_0xbb10('0x2f')]=function(_0x150107,_0x1ddd9e){var _0x3c3c45={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x570f5a={},_0x111762={'count':0x0,'rows':[]};var _0x3eb3cc=_[_0xbb10('0x30')](db[_0xbb10('0x31')][_0xbb10('0x32')],function(_0x15d895){return{'name':_0x15d895[_0xbb10('0x33')],'type':_0x15d895['type'][_0xbb10('0x34')]};});_0x570f5a[_0xbb10('0x35')]=_['map'](_0x3eb3cc,'name');_0x570f5a['query']=_[_0xbb10('0x36')](_0x150107[_0xbb10('0x37')]);_0x570f5a[_0xbb10('0x38')]=_['intersection'](_0x570f5a[_0xbb10('0x35')],_0x570f5a[_0xbb10('0x37')]);_0x3c3c45[_0xbb10('0x39')]=_['intersection'](_0x570f5a[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x150107[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x3c3c45['attributes']=_0x3c3c45[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x3c3c45['attributes']:_0x570f5a[_0xbb10('0x35')];if(!_0x150107[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x3c3c45[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x150107['query'][_0xbb10('0x27')]);_0x3c3c45[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x150107[_0xbb10('0x37')]['offset']);}_0x3c3c45[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x150107[_0xbb10('0x37')][_0xbb10('0x3f')]);_0x3c3c45['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x150107['query'],_0x570f5a['filters']),_0x3eb3cc);if(_0x150107[_0xbb10('0x37')]['filter']){_0x3c3c45[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x3c3c45['where'],{'$or':_[_0xbb10('0x30')](_0x3eb3cc,function(_0x1d82bf){if(_0x1d82bf[_0xbb10('0x43')]!=='VIRTUAL'){var _0x2dd02b={};_0x2dd02b[_0x1d82bf[_0xbb10('0x2e')]]={'$like':'%'+_0x150107[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x2dd02b;}})});}_0x3c3c45=_[_0xbb10('0x42')]({},_0x3c3c45,_0x150107[_0xbb10('0x45')]);var _0x190781={'where':_0x3c3c45[_0xbb10('0x41')]};return db[_0xbb10('0x31')][_0xbb10('0x26')](_0x190781)[_0xbb10('0x15')](function(_0x1eadd2){_0x111762['count']=_0x1eadd2;if(_0x150107[_0xbb10('0x37')][_0xbb10('0x46')]){_0x3c3c45['include']=[{'all':!![]}];}return db[_0xbb10('0x31')][_0xbb10('0x47')](_0x3c3c45);})[_0xbb10('0x15')](function(_0x5a5226){_0x111762[_0xbb10('0x48')]=_0x5a5226;return _0x111762;})[_0xbb10('0x15')](respondWithFilteredResult(_0x1ddd9e,_0x3c3c45))[_0xbb10('0x1f')](handleError(_0x1ddd9e,null));};exports['show']=function(_0x4a9793,_0xcb3354){var _0x76a208={'raw':![],'where':{'id':_0x4a9793['params']['id']},'include':[{'model':db['Pause'],'as':_0xbb10('0x49')}]},_0x2b12bd={};_0x2b12bd[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x31')][_0xbb10('0x32')]);_0x2b12bd[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x4a9793[_0xbb10('0x37')]);_0x2b12bd[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x2b12bd['model'],_0x2b12bd['query']);_0x76a208[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x2b12bd[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x4a9793[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x76a208[_0xbb10('0x39')]=_0x76a208[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x76a208[_0xbb10('0x39')]:_0x2b12bd[_0xbb10('0x35')];if(_0x4a9793[_0xbb10('0x37')][_0xbb10('0x46')]){_0x76a208[_0xbb10('0x4b')]=[{'all':!![]}];}_0x76a208=_[_0xbb10('0x42')]({},_0x76a208,_0x4a9793['options']);return db[_0xbb10('0x31')]['find'](_0x76a208)[_0xbb10('0x15')](handleEntityNotFound(_0xcb3354,null))[_0xbb10('0x15')](respondWithResult(_0xcb3354,null))[_0xbb10('0x1f')](handleError(_0xcb3354,null));};exports[_0xbb10('0x4c')]=function(_0x26e66e,_0x32d8e9){return db[_0xbb10('0x31')][_0xbb10('0x4c')](_0x26e66e[_0xbb10('0x4d')],{})[_0xbb10('0x15')](function(_0x44a056){var _0x1c2dce=_0x26e66e[_0xbb10('0x4e')][_0xbb10('0x2b')]({'plain':!![]});if(!_0x1c2dce)throw new Error(_0xbb10('0x4f'));if(_0x1c2dce['role']===_0xbb10('0x4e')){var _0x466eb7=_0x44a056[_0xbb10('0x2b')]({'plain':!![]});var _0x4ce8e7=_0xbb10('0x50');return db[_0xbb10('0x51')]['find']({'where':{'name':_0x4ce8e7,'userProfileId':_0x1c2dce[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x15')](function(_0x2909a1){if(_0x2909a1&&_0x2909a1[_0xbb10('0x53')]===0x0){return db[_0xbb10('0x2c')][_0xbb10('0x4c')]({'name':_0x466eb7[_0xbb10('0x2e')],'resourceId':_0x466eb7['id'],'type':_0x2909a1[_0xbb10('0x2e')],'sectionId':_0x2909a1['id']},{})[_0xbb10('0x15')](function(){return _0x44a056;});}else{return _0x44a056;}})[_0xbb10('0x1f')](function(_0x2eb05a){logger[_0xbb10('0x1c')](_0xbb10('0x54'),_0x2eb05a);throw _0x2eb05a;});}return _0x44a056;})['then'](respondWithResult(_0x32d8e9,0xc9))['catch'](handleError(_0x32d8e9,null));};exports[_0xbb10('0x55')]=function(_0x3e6338,_0x3d0cb7){if(_0x3e6338[_0xbb10('0x4d')]['id']){delete _0x3e6338['body']['id'];}return db['ChatWebsite'][_0xbb10('0x56')]({'where':{'id':_0x3e6338[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x58')],'as':_0xbb10('0x49')}]})[_0xbb10('0x15')](handleEntityNotFound(_0x3d0cb7,null))[_0xbb10('0x15')](saveUpdates(_0x3e6338[_0xbb10('0x4d')],null))['then'](respondWithResult(_0x3d0cb7,null))[_0xbb10('0x1f')](handleError(_0x3d0cb7,null));};exports[_0xbb10('0x2a')]=function(_0x4917a5,_0x5e03cb){return db['ChatWebsite'][_0xbb10('0x56')]({'where':{'id':_0x4917a5[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5e03cb,null))['then'](removeEntity(_0x5e03cb,null))['catch'](handleError(_0x5e03cb,null));};exports['describe']=function(_0x3ebc5f,_0x249b33){return db[_0xbb10('0x31')]['describe']()[_0xbb10('0x15')](respondWithResult(_0x249b33,null))[_0xbb10('0x1f')](handleError(_0x249b33,null));};exports['addDisposition']=function(_0x4a560c,_0x27d7b9){if(_0x4a560c[_0xbb10('0x4d')]['id']){delete _0x4a560c[_0xbb10('0x4d')]['id'];}return db[_0xbb10('0x31')]['find']({'where':{'id':_0x4a560c[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x27d7b9,null))[_0xbb10('0x15')](function(_0x5202d7){if(_0x5202d7){_0x4a560c[_0xbb10('0x4d')][_0xbb10('0x59')]=_0x5202d7['id'];return db[_0xbb10('0x5a')]['create'](_0x4a560c[_0xbb10('0x4d')]);}})[_0xbb10('0x15')](respondWithResult(_0x27d7b9,null))[_0xbb10('0x1f')](handleError(_0x27d7b9,null));};exports[_0xbb10('0x5b')]=function(_0x5e4a6e,_0x251417){var _0x258e55={'raw':![],'where':{}};var _0x108e5b={};var _0x2d0f4b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x5e4a6e[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x251417,null))[_0xbb10('0x15')](function(_0x12f750){if(_0x12f750){_0x108e5b[_0xbb10('0x35')]=_[_0xbb10('0x36')](db['Disposition']['rawAttributes']);_0x108e5b['query']=_[_0xbb10('0x36')](_0x5e4a6e[_0xbb10('0x37')]);_0x108e5b[_0xbb10('0x38')]=_['intersection'](_0x108e5b['model'],_0x108e5b[_0xbb10('0x37')]);_0x258e55[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x108e5b[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x5e4a6e[_0xbb10('0x37')]['fields']));_0x258e55[_0xbb10('0x39')]=_0x258e55[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x258e55[_0xbb10('0x39')]:_0x108e5b[_0xbb10('0x35')];if(!_0x5e4a6e['query']['hasOwnProperty']('nolimit')){_0x258e55[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x27')]);_0x258e55[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x5e4a6e['query'][_0xbb10('0x24')]);}_0x258e55['order']=qs['sort'](_0x5e4a6e['query'][_0xbb10('0x3f')]);_0x258e55[_0xbb10('0x41')]=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x5e4a6e['query'],_0x108e5b[_0xbb10('0x38')]));_0x258e55['where']['ChatWebsiteId']=_0x12f750['id'];if(_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x44')]){_0x258e55[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x258e55[_0xbb10('0x41')],{'$or':_['map'](_0x258e55[_0xbb10('0x39')],function(_0x19fcec){var _0x2c6429={};_0x2c6429[_0x19fcec]={'$like':'%'+_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x2c6429;})});}_0x258e55=_[_0xbb10('0x42')]({},_0x258e55,_0x5e4a6e[_0xbb10('0x45')]);return db['Disposition'][_0xbb10('0x26')]({'where':_0x258e55[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x322b41){_0x2d0f4b[_0xbb10('0x26')]=_0x322b41;if(_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x46')]){_0x258e55[_0xbb10('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0xbb10('0x47')](_0x258e55);})[_0xbb10('0x15')](function(_0x145baf){_0x2d0f4b['rows']=_0x145baf;return _0x2d0f4b;});}})['then'](respondWithFilteredResult(_0x251417,_0x258e55))['catch'](handleError(_0x251417,null));};exports[_0xbb10('0x5d')]=function(_0x5a3c44,_0x4e3d6a){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5a3c44[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x4e3d6a,null))[_0xbb10('0x15')](function(_0x24dca6){if(_0x24dca6){return _0x24dca6[_0xbb10('0x5d')](_0x5a3c44[_0xbb10('0x37')][_0xbb10('0x5e')]);}})['then'](respondWithStatusCode(_0x4e3d6a,null))[_0xbb10('0x1f')](handleError(_0x4e3d6a,null));};exports[_0xbb10('0x5f')]=function(_0x46b6d2,_0x35b811){if(_0x46b6d2['body']['id']){delete _0x46b6d2['body']['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x46b6d2[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x35b811,null))['then'](function(_0x17d596){if(_0x17d596){_0x46b6d2[_0xbb10('0x4d')][_0xbb10('0x59')]=_0x17d596['id'];return db[_0xbb10('0x60')][_0xbb10('0x4c')](_0x46b6d2['body']);}})['then'](respondWithResult(_0x35b811,null))[_0xbb10('0x1f')](handleError(_0x35b811,null));};exports[_0xbb10('0x61')]=function(_0x22c030,_0x5239da){var _0x256b35={'raw':![],'where':{}};var _0x13e2ab={};var _0x50bcc9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x22c030[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5239da,null))['then'](function(_0x32d5a5){if(_0x32d5a5){_0x13e2ab[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x60')][_0xbb10('0x32')]);_0x13e2ab[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x22c030[_0xbb10('0x37')]);_0x13e2ab[_0xbb10('0x38')]=_['intersection'](_0x13e2ab[_0xbb10('0x35')],_0x13e2ab[_0xbb10('0x37')]);_0x256b35[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x13e2ab[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x22c030[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x256b35[_0xbb10('0x39')]=_0x256b35[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x256b35[_0xbb10('0x39')]:_0x13e2ab['model'];if(!_0x22c030['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x256b35[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x22c030[_0xbb10('0x37')]['limit']);_0x256b35[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x22c030[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x256b35[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x22c030['query'][_0xbb10('0x3f')]);_0x256b35[_0xbb10('0x41')]=qs['filters'](_[_0xbb10('0x40')](_0x22c030['query'],_0x13e2ab[_0xbb10('0x38')]));_0x256b35[_0xbb10('0x41')][_0xbb10('0x59')]=_0x32d5a5['id'];if(_0x22c030[_0xbb10('0x37')][_0xbb10('0x44')]){_0x256b35['where']=_[_0xbb10('0x42')](_0x256b35['where'],{'$or':_[_0xbb10('0x30')](_0x256b35[_0xbb10('0x39')],function(_0x5d767f){var _0x5aaa20={};_0x5aaa20[_0x5d767f]={'$like':'%'+_0x22c030[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x5aaa20;})});}_0x256b35=_[_0xbb10('0x42')]({},_0x256b35,_0x22c030[_0xbb10('0x45')]);return db[_0xbb10('0x60')][_0xbb10('0x26')]({'where':_0x256b35[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x252ab8){_0x50bcc9[_0xbb10('0x26')]=_0x252ab8;if(_0x22c030[_0xbb10('0x37')]['includeAll']){_0x256b35[_0xbb10('0x4b')]=[{'all':!![]}];}return db[_0xbb10('0x60')][_0xbb10('0x47')](_0x256b35);})[_0xbb10('0x15')](function(_0xfe02f5){_0x50bcc9[_0xbb10('0x48')]=_0xfe02f5;return _0x50bcc9;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x5239da,_0x256b35))[_0xbb10('0x1f')](handleError(_0x5239da,null));};exports[_0xbb10('0x62')]=function(_0x18a136,_0x1c4235){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x18a136[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c4235,null))[_0xbb10('0x15')](function(_0x3675cd){if(_0x3675cd){return _0x3675cd[_0xbb10('0x62')](_0x18a136[_0xbb10('0x37')][_0xbb10('0x5e')]);}})['then'](respondWithStatusCode(_0x1c4235,null))[_0xbb10('0x1f')](handleError(_0x1c4235,null));};exports[_0xbb10('0x63')]=function(_0x44d1d2,_0x12e89d){_0x44d1d2[_0xbb10('0x4d')][_0xbb10('0x64')]=_0x44d1d2['file']['filename'];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x44d1d2[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x12e89d,null))[_0xbb10('0x15')](saveUpdates(_0x44d1d2[_0xbb10('0x4d')],null))['then'](respondWithResult(_0x12e89d,null))[_0xbb10('0x1f')](handleError(_0x12e89d,null));};exports[_0xbb10('0x65')]=function(_0x5642c3,_0xdd3c7e){_0x5642c3['body'][_0xbb10('0x66')]=_0x5642c3[_0xbb10('0x67')]['filename'];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5642c3['params']['id']}})['then'](handleEntityNotFound(_0xdd3c7e,null))[_0xbb10('0x15')](saveUpdates(_0x5642c3[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0xdd3c7e,null))[_0xbb10('0x1f')](handleError(_0xdd3c7e,null));};exports[_0xbb10('0x68')]=function(_0x4c3bdc,_0xe7c0a3){_0x4c3bdc[_0xbb10('0x4d')][_0xbb10('0x69')]=_0x4c3bdc['file'][_0xbb10('0x6a')];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x4c3bdc[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0xe7c0a3,null))[_0xbb10('0x15')](saveUpdates(_0x4c3bdc[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0xe7c0a3,null))[_0xbb10('0x1f')](handleError(_0xe7c0a3,null));};exports['addSystemAvatar']=function(_0x4fc544,_0x37e40c){_0x4fc544[_0xbb10('0x4d')][_0xbb10('0x6b')]=_0x4fc544[_0xbb10('0x67')][_0xbb10('0x6a')];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x4fc544[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x37e40c,null))[_0xbb10('0x15')](saveUpdates(_0x4fc544[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0x37e40c,null))[_0xbb10('0x1f')](handleError(_0x37e40c,null));};exports['getLogo']=function(_0x1e022d,_0x123587){var _0x24076a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x6e'));var _0x4258fc={'where':{'id':_0x1e022d[_0xbb10('0x57')]['id']},'attributes':['id',_0xbb10('0x64')],'raw':!![]};var _0x3c92f4=![];return require(_0xbb10('0x6f'))['getLicense']()[_0xbb10('0x15')](function(_0x5e1ac5){if(_0x5e1ac5){_0x3c92f4=_0x5e1ac5[_0xbb10('0x70')];}})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')](_0x4258fc);})[_0xbb10('0x15')](handleEntityNotFound(_0x123587,null))[_0xbb10('0x15')](function(_0x4e9cad){if(_0x4e9cad){if(!_[_0xbb10('0x71')](_0x4e9cad['sitepic'])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x73'),_0x4e9cad[_0xbb10('0x64')]))&&_0x3c92f4){_0x24076a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x73'),_0x4e9cad[_0xbb10('0x64')]);}}return _0x123587[_0xbb10('0x74')](_0x24076a);}})[_0xbb10('0x1f')](handleError(_0x123587,null));};exports[_0xbb10('0x75')]=function(_0x589565,_0x3696b3){var _0x516520=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x76'));var _0x7673a0={'where':{'id':_0x589565[_0xbb10('0x57')]['id']},'attributes':['id',_0xbb10('0x66')],'raw':!![]};return db[_0xbb10('0x31')]['find'](_0x7673a0)[_0xbb10('0x15')](handleEntityNotFound(_0x3696b3,null))['then'](function(_0x51063a){if(_0x51063a){if(!_[_0xbb10('0x71')](_0x51063a[_0xbb10('0x66')])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x51063a['agentAvatar']))){_0x516520=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x51063a[_0xbb10('0x66')]);}}return _0x3696b3[_0xbb10('0x74')](_0x516520);}})[_0xbb10('0x1f')](handleError(_0x3696b3,null));};exports['getCustomerAvatar']=function(_0xdfdc42,_0x4093a4){var _0xb7c454=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x78'));var _0x2764e1={'where':{'id':_0xdfdc42['params']['id']},'attributes':['id',_0xbb10('0x69'),'showCustomerAvatar'],'raw':!![]};return db[_0xbb10('0x31')]['find'](_0x2764e1)['then'](handleEntityNotFound(_0x4093a4,null))[_0xbb10('0x15')](function(_0x225064){if(_0x225064){if(!_[_0xbb10('0x71')](_0x225064[_0xbb10('0x69')])){if(fs[_0xbb10('0x72')](path['join'](config[_0xbb10('0x6d')],'server/files/images/avatars/',_0x225064['customerAvatar']))&&_0x225064['showCustomerAvatar']){_0xb7c454=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x225064[_0xbb10('0x69')]);}}return _0x4093a4[_0xbb10('0x74')](_0xb7c454);}})['catch'](handleError(_0x4093a4,null));};exports[_0xbb10('0x79')]=function(_0x42a2d7,_0x352de4){var _0x1bd1c1=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x7a'));var _0x485c1a={'where':{'id':_0x42a2d7['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xbb10('0x31')][_0xbb10('0x56')](_0x485c1a)[_0xbb10('0x15')](handleEntityNotFound(_0x352de4,null))[_0xbb10('0x15')](function(_0x25cba1){if(_0x25cba1){if(!_[_0xbb10('0x71')](_0x25cba1[_0xbb10('0x6b')])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],'server/files/images/avatars/',_0x25cba1['systemAvatar']))){_0x1bd1c1=path['join'](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x25cba1[_0xbb10('0x6b')]);}}return _0x352de4['download'](_0x1bd1c1);}})[_0xbb10('0x1f')](handleError(_0x352de4,null));};exports[_0xbb10('0x7b')]=function(_0x2c638d,_0x290280){var _0x2a6589=require(_0xbb10('0x7c'));var _0x485f46=new _0x2a6589();var _0x57fe03=_0x485f46[_0xbb10('0x7d')](_0x2c638d['headers'][_0xbb10('0x7e')])[_0xbb10('0x7f')]();var _0x152ca9={'body':_0x2c638d[_0xbb10('0x4d')],'channel':_0xbb10('0x80')};var _0x2dfa04=[];var _0x13a29e=[];var _0x1388f6={};var _0xd3c2c8=![];return db[_0xbb10('0x81')]['describe']()[_0xbb10('0x15')](function(_0x5a9277){if(!_0x5a9277){throw new db[(_0xbb10('0x82'))]['ValidationError'](_0xbb10('0x83'));}_0x2dfa04=_[_0xbb10('0x84')](_[_0xbb10('0x36')](_0x5a9277),[_0xbb10('0x85'),'updatedAt']);_0x13a29e=_[_0xbb10('0x84')](_['keys'](_0x5a9277),[_0xbb10('0x85'),_0xbb10('0x86'),_0xbb10('0x87'),'ListId']);if(_0x2c638d[_0xbb10('0x4d')]['id']){delete _0x2c638d[_0xbb10('0x4d')]['id'];}if(_[_0xbb10('0x71')](_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')])){throw new db[(_0xbb10('0x82'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x2c638d[_0xbb10('0x4d')]['body'])||_0x2c638d[_0xbb10('0x4d')]['body']===''){throw new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))](_0xbb10('0x8a'));}if(_['isNil'](_0x2c638d['body'][_0xbb10('0x8b')])){throw new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13a29e);}if(!_[_0xbb10('0x8c')](_0x13a29e,_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x8b')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13a29e);}_0x1388f6[_0x2c638d[_0xbb10('0x4d')]['mapKey']]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')];})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x2c638d[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x8d')],'as':_0xbb10('0x8e'),'include':[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0x8f'),'where':_0x1388f6,'limit':0x1,'order':[[_0xbb10('0x86'),'DESC']]}]},{'model':db[_0xbb10('0x90')],'as':_0xbb10('0x91')}]});})['then'](handleEntityNotFound(_0x290280,null))[_0xbb10('0x15')](function(_0x5e3fac){if(_0x5e3fac&&_0x5e3fac['List']){_0x152ca9[_0xbb10('0x92')]=_0x5e3fac;_0x152ca9[_0xbb10('0x93')]=_0x5e3fac[_0xbb10('0x91')];_0x152ca9[_0xbb10('0x94')]=_0x5e3fac[_0xbb10('0x8e')];_0x152ca9['applications']=_[_0xbb10('0x95')](_0x152ca9[_0xbb10('0x93')],['priority'],[_0xbb10('0x96')]);if(_0x152ca9[_0xbb10('0x92')]['Applications']){delete _0x152ca9[_0xbb10('0x92')]['Applications'];}if(_0x152ca9[_0xbb10('0x92')][_0xbb10('0x8e')]&&_0x152ca9[_0xbb10('0x92')][_0xbb10('0x8e')][_0xbb10('0x8f')][_0xbb10('0x3b')]){return _0x152ca9[_0xbb10('0x92')]['List'][_0xbb10('0x8f')][0x0];}var _0x4720a1=_[_0xbb10('0x97')](_0x2c638d[_0xbb10('0x4d')],{'firstName':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')],'ListId':_0x5e3fac['ListId']});_0x4720a1[_0x2c638d['body']['mapKey']]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')];return db[_0xbb10('0x81')][_0xbb10('0x4c')](_0x4720a1,{'fields':_0x2dfa04,'raw':!![]});}})['then'](handleEntityNotFound(_0x290280,null))[_0xbb10('0x15')](function(_0x3d7b4d){_0x152ca9[_0xbb10('0x98')]=_0x3d7b4d;var _0x577d27=_0x2c638d['body'][_0xbb10('0x99')];if(_0x2c638d['headers'][_0xbb10('0x9a')]){_0x577d27=_0x2c638d[_0xbb10('0x9b')][_0xbb10('0x9a')];}else if(_0x2c638d[_0xbb10('0x9b')][_0xbb10('0x9c')]){_0x577d27=_[_0xbb10('0x9d')](_0x2c638d[_0xbb10('0x9b')]['x-forwarded-for'][_0xbb10('0x9e')](','));}if(_0x3d7b4d){var _0x1eca6c={'ContactId':_0x3d7b4d['id'],'ChatWebsiteId':_0x2c638d['params']['id'],'from':(_0x3d7b4d[_0xbb10('0x9f')]||'')+'\x20'+(_0x3d7b4d[_0xbb10('0xa0')]||''),'customerIp':_0x577d27,'customerPort':_0x2c638d[_0xbb10('0x9b')]['x-real-port']?_0x2c638d['headers']['x-real-port']:null,'referer':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa1')],'browserName':_0x57fe03['browser'][_0xbb10('0x2e')]&&_0x57fe03[_0xbb10('0xa2')][_0xbb10('0xa3')]?util[_0xbb10('0xa4')](_0xbb10('0xa5'),_0x57fe03[_0xbb10('0xa2')][_0xbb10('0x2e')],_0x57fe03['browser'][_0xbb10('0xa3')]):'unknown','browserVersion':_0x57fe03['browser']['version']||_0xbb10('0xa6'),'osName':util[_0xbb10('0xa4')]('%s\x20%s',_0x57fe03['os'][_0xbb10('0x2e')],_0x57fe03['os']['version']),'osVersion':_0x57fe03['os'][_0xbb10('0xa3')],'deviceModel':_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x35')]&&_0x57fe03['device']['vendor']?util[_0xbb10('0xa4')]('%s\x20%s\x20%s',_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x35')],_0x57fe03['device']['vendor'],_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x43')]):null,'deviceVendor':_0x57fe03[_0xbb10('0xa7')]['vendor'],'deviceType':_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x43')],'formData':JSON[_0xbb10('0x1b')](_0x2c638d['body'])};var _0x414066={'ChatWebsiteId':_0x2c638d[_0xbb10('0x57')]['id'],'closed':![]};if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')]){_0x414066[_0xbb10('0xa8')]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')];return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':_0x414066})[_0xbb10('0x15')](function(_0x10ca4a){if(_0x10ca4a){return[_0x10ca4a,![]];}_0x1eca6c[_0xbb10('0xa8')]=_0x2c638d[_0xbb10('0x4d')]['threadId'];_0x1eca6c['externalUrl']=_0x2c638d[_0xbb10('0x4d')]['externalUrl'];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x1eca6c)[_0xbb10('0x15')](function(_0x4e5236){return[_0x4e5236,!![]];});});}_0x414066[_0xbb10('0xaa')]=_0x3d7b4d['id'];if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xab')]&&_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xab')]['id']){_0x414066['id']=_0x2c638d['body'][_0xbb10('0xab')]['id'];return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':_0x414066})[_0xbb10('0x15')](function(_0x150d4c){if(_0x150d4c){return[_0x150d4c,![]];}return db[_0xbb10('0xa9')]['create'](_0x1eca6c)[_0xbb10('0x15')](function(_0x2f0262){return[_0x2f0262,!![]];});});}return db['ChatInteraction'][_0xbb10('0x4c')](_0x1eca6c)[_0xbb10('0x15')](function(_0x2d0de5){return[_0x2d0de5,!![]];});}})[_0xbb10('0xac')](function(_0x3abc15,_0x43df3c){if(_0x3abc15){_0xd3c2c8=_0x43df3c;if(!_0x43df3c){var _0x45593c={'from':(_0x152ca9[_0xbb10('0x98')][_0xbb10('0x9f')]||'')+'\x20'+(_0x152ca9[_0xbb10('0x98')][_0xbb10('0xa0')]||'')};if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')]&&_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xad')]&&_0x2c638d['body'][_0xbb10('0xa8')]!=_0x2c638d[_0xbb10('0x4d')]['messageId']){_0x45593c['threadId']=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xad')];}return _0x3abc15[_0xbb10('0x55')](_0x45593c);}else{return _0x3abc15;}}})[_0xbb10('0x15')](function(_0x27fb82){_0x152ca9[_0xbb10('0xab')]=_0x27fb82[_0xbb10('0x2b')]({'plain':!![]});_0x152ca9[_0xbb10('0xab')][_0xbb10('0xae')]=_0xd3c2c8;if(_0x152ca9['interaction']['created']){if(_0x152ca9['account']['autoclose']){_0x152ca9['applications']['push']({'id':0x0,'priority':_0x152ca9[_0xbb10('0x93')][_0xbb10('0x3b')]+0x1,'app':_0xbb10('0xaf'),'appdata':_0xbb10('0xb0'),'interval':'*,*,*,*'});}}return db[_0xbb10('0xb1')][_0xbb10('0x4c')]({'body':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x4d')],'ChatWebsiteId':_0x2c638d['params']['id'],'ChatInteractionId':_0x27fb82['id'],'direction':'in','ContactId':_0x152ca9['contact']['id'],'AttachmentId':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xb2')]});})['then'](function(_0x581832){_0x152ca9[_0xbb10('0x1e')]=_0x581832;if(_0x152ca9[_0xbb10('0xab')][_0xbb10('0xb3')]){return db[_0xbb10('0xb4')][_0xbb10('0x56')]({'attributes':['id','name'],'where':{'id':_0x152ca9[_0xbb10('0xab')]['UserId']}})['then'](function(_0x9d96e2){if(_0x9d96e2){_0x152ca9[_0xbb10('0x93')][_0xbb10('0xb5')]({'id':0x0,'priority':0x0,'app':_0xbb10('0xb6'),'appdata':_0x9d96e2[_0xbb10('0x2e')]+','+(_0x152ca9[_0xbb10('0x92')]['waitForTheAssignedAgent']||0xa),'interval':_0xbb10('0xb7')});_0x152ca9[_0xbb10('0xb8')]=!![];}return respondWithRpcPromise(_0xbb10('0xb9'),_0xbb10('0xba'),_0x152ca9);});}return respondWithRpcPromise(_0xbb10('0xb9'),_0xbb10('0xba'),_0x152ca9);})[_0xbb10('0x15')](function(_0xce60f4){respondWithRpcPromise(_0xbb10('0xbb'),_0xbb10('0xbb'),{'event':_0xbb10('0x7b'),'message':_0xce60f4},client9002);return _0xce60f4;})[_0xbb10('0x15')](respondWithResult(_0x290280,null))[_0xbb10('0x1f')](handleError(_0x290280,null));};exports[_0xbb10('0xbc')]=function(_0x45b31c,_0x3cf074){var _0x232a1b,_0xbdc520,_0x246ee3;var _0x43a203=[];var _0x1ca43e={};var _0x1f84b0=_0x45b31c['files']||[];var _0x2158e2=[];var _0x47883f;return db[_0xbb10('0x81')][_0xbb10('0xbd')]()[_0xbb10('0x15')](function(_0x2b1f0f){if(!_0x2b1f0f){throw new db[(_0xbb10('0x82'))]['ValidationError']('no\x20available\x20attributes');}_0x43a203=_['difference'](_[_0xbb10('0x36')](_0x2b1f0f),[_0xbb10('0x85'),'updatedAt',_0xbb10('0x87'),_0xbb10('0xbe')]);if(_0x45b31c[_0xbb10('0x4d')]['id']){delete _0x45b31c['body']['id'];}if(_[_0xbb10('0x71')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x88')])){throw _0x3cf074['status'](0x1f4)[_0xbb10('0xbf')](new db['Sequelize'][(_0xbb10('0x89'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x45b31c['body']['body'])||_0x45b31c['body']['body']===''){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xbb10('0x71')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0xc0')])){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))](_0xbb10('0xc1')+_0x43a203));}if(!_[_0xbb10('0x8c')](_0x43a203,_0x45b31c[_0xbb10('0x4d')]['mapKeyOffline'])){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))]['ValidationError'](_0xbb10('0xc2')+_0x43a203));}_0x1ca43e[_0x45b31c[_0xbb10('0x4d')][_0xbb10('0xc0')]]=_0x45b31c[_0xbb10('0x4d')]['from'];})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x45b31c[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x8d')],'as':_0xbb10('0x8e')},{'model':db[_0xbb10('0xc3')],'as':_0xbb10('0xc3')}]});})[_0xbb10('0x15')](handleEntityNotFound(_0x3cf074,null))[_0xbb10('0x15')](function(_0x3c01ff){if(_0x3c01ff&&_0x3c01ff['List']){_0xbdc520=_0x3c01ff;var _0x59d917=_[_0xbb10('0x97')](_0x45b31c['body'],{'firstName':_0x45b31c['body'][_0xbb10('0x88')],'phone':_0x45b31c[_0xbb10('0x4d')]['from'],'ListId':_0x3c01ff[_0xbb10('0xbe')]});_0x59d917[_0x45b31c[_0xbb10('0x4d')]['mapKeyOffline']]=_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x88')];return db[_0xbb10('0x81')][_0xbb10('0xc4')]({'where':_0x1ca43e,'defaults':_0x59d917});}})[_0xbb10('0xac')](function(_0x4d2c76){if(_0x4d2c76){_0x246ee3=_0x4d2c76;var _0x4fc260=fs['readFileSync'](path[_0xbb10('0x6c')](config['root'],_0xbb10('0xc5')),'utf8');var _0x510467=ejs[_0xbb10('0xc6')](_0x4fc260,{'body':_[_0xbb10('0xc7')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x4d')]),'bodyTitle':_0xbdc520[_0xbb10('0xc8')]});return db[_0xbb10('0xc9')]['create']({'body':_0x510467,'plainBody':htmlToText['fromString'](_0x510467),'ContactId':_0x4d2c76['id'],'ChatWebsiteId':_0xbdc520['id']});}})['then'](function(_0x5ad067){_0x47883f=_0x5ad067;if(_0x1f84b0[_0xbb10('0x3b')]){var _0x18632f=_0x1f84b0[_0xbb10('0x30')](function(_0x26bc1c){return{'name':_0x26bc1c[_0xbb10('0xca')],'basename':_0x26bc1c[_0xbb10('0x6a')],'type':_0x26bc1c['mimetype'],'ChatOfflineMessageId':_0x5ad067['id']};});_0x2158e2=_0x18632f[_0xbb10('0x30')](_0x207bbb=>{var _0x35586a={'filename':_0x207bbb[_0xbb10('0x2e')],'path':path['join'](config[_0xbb10('0x6d')],'server','files',_0xbb10('0xcb'),_0xbb10('0xcc'),_0x207bbb[_0xbb10('0xcd')])};return _0x35586a;});if(!_0xbdc520[_0xbb10('0xce')]){return db[_0xbb10('0xcf')][_0xbb10('0xd0')](function(_0x4b7bf8){return db[_0xbb10('0xd1')][_0xbb10('0xd2')](_0x18632f,{'transaction':_0x4b7bf8});});}}})[_0xbb10('0x15')](function(){if(_0x47883f){_0x232a1b=_0x47883f;return db[_0xbb10('0xc3')][_0xbb10('0x5c')]({'where':{'active':!![]},'include':[{'model':db[_0xbb10('0xd3')],'as':_0xbb10('0xd4'),'raw':!![]}]});}})['then'](function(_0x2cbbb6){if(_0x2cbbb6&&_0x2cbbb6[_0xbb10('0xd4')]&&_0xbdc520[_0xbb10('0xd5')]&&_0xbdc520['forwardOfflineAddress']){var _0x595664={'tls':{'rejectUnauthorized':![]}};if(_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd6')]){_0x595664[_0xbb10('0xd6')]=_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd6')];}else{_0x595664[_0xbb10('0xd7')]=_0x2cbbb6[_0xbb10('0xd4')]['host'];_0x595664[_0xbb10('0xd8')]=_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd8')];_0x595664['secure']=_0x2cbbb6['Smtp']['secure'];}if(_0x2cbbb6['Smtp'][_0xbb10('0xd9')]){_0x595664[_0xbb10('0xda')]={'user':_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0x4e')],'pass':_0x2cbbb6['Smtp'][_0xbb10('0xdb')]};}return respondWithRpcPromise('SendMail',_0xbb10('0xdc'),{'account':_0x595664,'message':{'from':util[_0xbb10('0xa4')](_0xbb10('0xdd'),_0x2cbbb6[_0xbb10('0x2e')],_0x2cbbb6[_0xbb10('0xde')]||_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0x4e')]),'to':_0xbdc520[_0xbb10('0xdf')],'subject':_0xbdc520[_0xbb10('0xe0')],'html':_0x232a1b[_0xbb10('0x4d')],'attachments':_0x2158e2}},client9003)[_0xbb10('0x15')](function(){return _0x232a1b;})[_0xbb10('0x1f')](function(_0x4c969d){console[_0xbb10('0x1c')](_0x4c969d);});}})[_0xbb10('0x15')](function(){if(_0xbdc520&&_0xbdc520[_0xbb10('0xce')]&&_0xbdc520['MailAccountId']){var _0x204ebf=[];if(_0x1f84b0['length']){_0x204ebf=_0x1f84b0[_0xbb10('0x30')](function(_0x446bcf){return{'name':_0x446bcf[_0xbb10('0xca')],'basename':_0x446bcf[_0xbb10('0x6a')],'type':_0x446bcf[_0xbb10('0xe1')],'ChatOfflineMessageId':_0x47883f['id']};});}var _0x533327;if(!_['isNil'](_0xbdc520[_0xbb10('0xe2')])){var _0x4cf5cc=_['map'](_0x45b31c[_0xbb10('0x4d')],function(_0x5621b1){return _0x5621b1;});var _0xa9ed32=_[_0xbb10('0xe3')](_0x4cf5cc)[0x0];var _0x3f0a4e=_[_0xbb10('0xe4')](_0xa9ed32,function(_0x309b4a){return _0x309b4a;});_0x533327=_0x3f0a4e[0x1][_0xbdc520[_0xbb10('0xe2')]];}var _0x3a0940={'from':_0x246ee3[_0xbb10('0xde')],'firstName':_0x246ee3['firstName'],'lastName':_0x246ee3[_0xbb10('0xa0')],'mapKey':'email','message':{'from':_0x246ee3[_0xbb10('0xde')],'to':_0xbdc520['MailAccount'][_0xbb10('0xde')],'cc':'','subject':_[_0xbb10('0x71')](_0x533327)?_0xbdc520['offlineMessageSubject']:_0x533327,'messageId':'','sentAt':new Date(),'attach':_0x204ebf[_0xbb10('0x3b')],'attachments':_0x204ebf,'originChannel':_0xbb10('0xe5'),'ChatWebsiteId':_0xbdc520['id'],'ChatOfflineMessageId':_0x232a1b['id'],'originTo':_0xbdc520[_0xbb10('0xc3')]['email']},'body':_0x232a1b[_0xbb10('0x4d')]};var _0x1a8503={'account':{'id':_0xbdc520[_0xbb10('0xe6')]},'body':_0x3a0940,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xbb10('0xe7'),_0xbb10('0xe8'),_0x1a8503,client9001)[_0xbb10('0x15')](function(){return _0x232a1b;})['catch'](function(_0x3e6756){console['error'](_0x3e6756);});}return;})[_0xbb10('0x15')](function(){if(_0x232a1b){return _0x232a1b;}})[_0xbb10('0x15')](respondWithResult(_0x3cf074,null))[_0xbb10('0x1f')](function(_0xd94118){console[_0xbb10('0x1c')](_0xbb10('0x1f'),_0xd94118);for(var _0x23e592 of _0x1f84b0){var _0x44d28a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],'server','files',_0xbb10('0xcb'),_0xbb10('0xcc'),_0x23e592[_0xbb10('0x6a')]);fs_extra['remove'](_0x44d28a)[_0xbb10('0x1f')](function(_0x1067f2){console[_0xbb10('0x1c')](_0xbb10('0xe9'),_0x44d28a,_0x1067f2);});}});};exports[_0xbb10('0xea')]=function(_0x431673,_0x81d970){return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':{'id':_0x431673['params']['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x81d970,null))[_0xbb10('0x15')](function(_0x4102af){if(_0x4102af){return _0x4102af[_0xbb10('0xea')](_0x431673['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x431673[_0xbb10('0x4d')],['ids','id'])||{});}})['then'](respondWithResult(_0x81d970,null))[_0xbb10('0x1f')](handleError(_0x81d970,null));};exports['getInteractions']=function(_0x37c688,_0x4874be){var _0x3fd69e={'raw':![],'where':{}};var _0x1aa860={};var _0x28cd8e={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x37c688[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x4874be,null))['then'](function(_0x20c514){if(_0x20c514){_0x1aa860[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xa9')][_0xbb10('0x32')]);_0x1aa860[_0xbb10('0x37')]=_['keys'](_0x37c688[_0xbb10('0x37')]);_0x1aa860[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x1aa860[_0xbb10('0x35')],_0x1aa860[_0xbb10('0x37')]);_0x3fd69e[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x1aa860['model'],qs[_0xbb10('0x3a')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x3fd69e['attributes']=_0x3fd69e[_0xbb10('0x39')]['length']?_0x3fd69e[_0xbb10('0x39')]:_0x1aa860[_0xbb10('0x35')];if(!_0x37c688[_0xbb10('0x37')]['hasOwnProperty']('nolimit')){_0x3fd69e[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x27')]);_0x3fd69e[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x3fd69e[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x37c688[_0xbb10('0x37')]['sort']);_0x3fd69e['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x37c688['query'],_0x1aa860['filters']));_0x3fd69e[_0xbb10('0x41')][_0xbb10('0x59')]=_0x20c514['id'];if(_0x37c688[_0xbb10('0x37')]['filter']){_0x3fd69e[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x3fd69e['where'],{'$or':_[_0xbb10('0x30')](_0x3fd69e[_0xbb10('0x39')],function(_0x544c9c){var _0x5a5349={};_0x5a5349[_0x544c9c]={'$like':'%'+_0x37c688[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x5a5349;})});}_0x3fd69e=_[_0xbb10('0x42')]({},_0x3fd69e,_0x37c688['options']);return db['ChatInteraction'][_0xbb10('0x26')]({'where':_0x3fd69e[_0xbb10('0x41')]})['then'](function(_0x1e9dd2){_0x28cd8e[_0xbb10('0x26')]=_0x1e9dd2;if(_0x37c688['query'][_0xbb10('0x46')]){_0x3fd69e[_0xbb10('0x4b')]=[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0xec'),'required':![]},{'model':db['User'],'as':_0xbb10('0xed'),'attributes':['name',_0xbb10('0xee'),_0xbb10('0xef')],'required':![]},{'model':db[_0xbb10('0xf0')],'as':_0xbb10('0xf1'),'attributes':['id',_0xbb10('0x2e'),_0xbb10('0xf2')],'where':_0x37c688[_0xbb10('0x37')][_0xbb10('0xf3')]?{'id':_0x37c688['query'][_0xbb10('0xf3')]}:undefined,'required':_0x37c688[_0xbb10('0x37')][_0xbb10('0xf3')]?!![]:![]}];}return db[_0xbb10('0xa9')]['findAll'](_0x3fd69e);})['then'](function(_0xd23108){_0x28cd8e[_0xbb10('0x48')]=_0xd23108;return _0x28cd8e;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x4874be,_0x3fd69e))[_0xbb10('0x1f')](handleError(_0x4874be,null));};function iftimePromise(_0x5b2e0b,_0x215028){return respondWithRpcPromise(_0xbb10('0xf4'),'getSnippet',{'command':_0x215028[_0xbb10('0xf5')]?util['format']('iftime\x20%s,%s',_0x5b2e0b[_0xbb10('0xf6')],_0x215028[_0xbb10('0xf5')]):util[_0xbb10('0xa4')](_0xbb10('0xf7'),_0x5b2e0b[_0xbb10('0xf6')])},client9002)['then'](function(_0x38403e){var _0x262078=_0x38403e&&_0x38403e[_0xbb10('0xf8')](_0xbb10('0xf9'))>=0x0?!![]:![];logger[_0xbb10('0x16')](_0xbb10('0xfa'),_0x215028['id'],_0x5b2e0b['id'],_0x5b2e0b[_0xbb10('0xf6')],_0x262078?_0xbb10('0xfb'):_0xbb10('0xfc'),_0x215028[_0xbb10('0xf5')]?_0x215028[_0xbb10('0xf5')]:_0xbb10('0xfd'));return _0x262078;})[_0xbb10('0x1f')](function(_0x9fcc26){logger[_0xbb10('0x1c')](_0xbb10('0xfa'),_0x215028['id'],_0x5b2e0b['id'],_0x5b2e0b[_0xbb10('0xf6')],util[_0xbb10('0xfe')](_0x9fcc26,{'showHidden':![],'depth':null}),_0x215028[_0xbb10('0xf5')]?_0x215028[_0xbb10('0xf5')]:_0xbb10('0xfd'));return![];});}exports[_0xbb10('0xff')]=function(_0x1b4873,_0x1ca72c){var _0x36615e=0x0;var _0x2f38d3=0x0;var _0x5a4d21=![];var _0x57b891;var _0x19eaa2;return db[_0xbb10('0x31')]['find']({'where':{'id':_0x1b4873[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x100')],'as':'Interval','include':[{'model':db[_0xbb10('0x100')],'as':_0xbb10('0x101'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xbb10('0x15')](handleEntityNotFound(_0x1ca72c,null))[_0xbb10('0x15')](function(_0xb4fdea){if(_0xb4fdea){_0x57b891=_0xb4fdea;return _0xb4fdea[_0xbb10('0x102')]({'raw':!![]});}})['then'](function(_0x170061){if(_0x57b891){if(_0x170061){_0x19eaa2=_0x170061;}}return require(_0xbb10('0x6f'))[_0xbb10('0x103')]();})[_0xbb10('0x15')](function(_0x5c0732){if(_0x5c0732){_0x2f38d3=_0x5c0732[_0xbb10('0x104')];_0x5a4d21=_0x5c0732[_0xbb10('0x70')];}})[_0xbb10('0x15')](function(){return db[_0xbb10('0xa9')][_0xbb10('0x26')]({'where':{'closed':![]}});})[_0xbb10('0x15')](function(_0x2f626b){_0x36615e=_0x2f626b;if(_0x2f38d3&&_0x2f626b>_0x2f38d3){return db[_0xbb10('0x105')][_0xbb10('0x5c')]({'where':{'id':0x1}})[_0xbb10('0x15')](function(_0x2fd942){if(_0x2fd942){_0x2fd942['increment'](_0xbb10('0x106'));}});}})[_0xbb10('0x15')](function(){if(_0x57b891[_0xbb10('0x100')]&&_0x57b891[_0xbb10('0x100')]['Intervals']){var _0x5116d8=[];for(var _0x8bfc0f=0x0;_0x8bfc0f<_0x57b891[_0xbb10('0x100')][_0xbb10('0x101')][_0xbb10('0x3b')];_0x8bfc0f++){var _0x5f0576=_0x57b891[_0xbb10('0x100')][_0xbb10('0x101')][_0x8bfc0f][_0xbb10('0x2b')]({'plain':!![]});_0x5116d8['push'](iftimePromise(_0x5f0576,_0x57b891));}return BPromise['all'](_0x5116d8)[_0xbb10('0x15')](function(_0xd6b33){return _['some'](_0xd6b33);});}else{return!![];}})['then'](function(_0x424bb1){var _0x615606=fs[_0xbb10('0x107')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x108')),'utf8');var _0x408544={'remote':_0x57b891[_0xbb10('0x109')],'query':querystring[_0xbb10('0x1b')](_[_0xbb10('0x42')](_0x57b891[_0xbb10('0x2b')]({'plain':!![]}),{'customerIp':_0x1b4873[_0xbb10('0x9b')][_0xbb10('0x9c')]||_0x1b4873[_0xbb10('0x9b')][_0xbb10('0x10a')]||_0x1b4873[_0xbb10('0x10b')]['remoteAddress']||_0x1b4873['ip'],'referer':_0x1b4873[_0xbb10('0x9b')][_0xbb10('0xa1')],'openedInteractions':_0x36615e,'maxInteractions':_0x2f38d3,'virtual':_0x5a4d21['virtual'],'online':_0x424bb1,'custom':_0x5a4d21}))['replace'](/'/g,'\x5c\x27')};_0x1ca72c['send'](ejs['render'](Mustache['render'](_0x615606,_0x408544),{'proactiveActions':_0x19eaa2,'alignment':_0x57b891['alignment'],'verticalAlignment':_0x57b891['verticalAlignment'],'div_color':_0x57b891['color'],'labelText':_0x57b891[_0xbb10('0x10c')],'text_color':_0x57b891[_0xbb10('0x10d')],'button_color':_0x57b891['color_button'],'background_color':_0x57b891[_0xbb10('0x10e')]}));})[_0xbb10('0x1f')](handleError(_0x1ca72c,null));};exports[_0xbb10('0x10f')]=function(_0x3b9bec,_0x1d099a){var _0x1d36fa=_0x3b9bec[_0xbb10('0x57')]['id'];var _0x23179d=_0x3b9bec[_0xbb10('0x4d')];var _0x14d9e7=0xc8;var _0x19dfef=null;return db[_0xbb10('0xcf')]['transaction']({'isolationLevel':db[_0xbb10('0xcf')][_0xbb10('0x110')][_0xbb10('0x111')][_0xbb10('0x112')]},function(_0x155f92){return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x1d36fa},'transaction':_0x155f92})['then'](function(_0x52209c){if(_0x52209c){return db[_0xbb10('0x90')][_0xbb10('0x2a')]({'where':{'ChatWebsiteId':_0x1d36fa},'transaction':_0x155f92})['then'](function(){var _0x3e433b=_[_0xbb10('0x30')](_0x23179d,function(_0x201e05){_0x201e05[_0xbb10('0x59')]=_0x1d36fa;return _0x201e05;});return db[_0xbb10('0x90')]['bulkCreate'](_0x3e433b,{'transaction':_0x155f92});});}else{_0x14d9e7=0x194;_0x19dfef=[];}});})['then'](function(){if(_0x14d9e7!==0x194){return db[_0xbb10('0x90')][_0xbb10('0x113')]({'where':{'ChatWebsiteId':_0x1d36fa},'order':'priority'})[_0xbb10('0x15')](function(_0x4cf976){_0x19dfef=_0x4cf976;});}})[_0xbb10('0x1f')](function(_0x1a2f42){_0x14d9e7=0x1f4;logger[_0xbb10('0x1c')](_0x1a2f42[_0xbb10('0x2d')]);if(_0x1a2f42[_0xbb10('0x2e')]){delete _0x1a2f42[_0xbb10('0x2e')];}_0x19dfef=_0x1a2f42;})[_0xbb10('0x114')](function(){if(_0x19dfef===null){_0x1d099a['sendStatus'](_0x14d9e7);}else{if(_0x14d9e7===0x1f4){_0x1d099a[_0xbb10('0x21')](_0x14d9e7)[_0xbb10('0xbf')](_0x19dfef);}else{_0x1d099a[_0xbb10('0x21')](_0x14d9e7)[_0xbb10('0x23')](_0x19dfef);}}});};exports['getApplications']=function(_0x20347b,_0x22ffc6){var _0x530785={};var _0x49ef50={};var _0xeac82d;var _0x5a4de3;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x20347b[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x22ffc6,null))['then'](function(_0x90ab9f){if(_0x90ab9f){_0xeac82d=_0x90ab9f;_0x49ef50['model']=_[_0xbb10('0x36')](db[_0xbb10('0x90')][_0xbb10('0x32')]);_0x49ef50[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x20347b[_0xbb10('0x37')]);_0x49ef50[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x49ef50[_0xbb10('0x35')],_0x49ef50['query']);_0x530785[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x49ef50[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x20347b[_0xbb10('0x37')]['fields']));_0x530785[_0xbb10('0x39')]=_0x530785[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x530785[_0xbb10('0x39')]:_0x49ef50[_0xbb10('0x35')];_0x530785['order']=qs['sort'](_0x20347b['query'][_0xbb10('0x3f')]);_0x530785['where']=qs['filters'](_[_0xbb10('0x40')](_0x20347b['query'],_0x49ef50[_0xbb10('0x38')]));if(_0x20347b[_0xbb10('0x37')]['filter']){_0x530785[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x530785[_0xbb10('0x41')],{'$or':_[_0xbb10('0x30')](_0x530785['attributes'],function(_0x4b08b2){var _0x57abfe={};_0x57abfe[_0x4b08b2]={'$like':'%'+_0x20347b[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x57abfe;})});}_0x530785=_['merge']({},_0x530785,_0x20347b[_0xbb10('0x45')]);return _0xeac82d[_0xbb10('0x115')](_0x530785);}})[_0xbb10('0x15')](function(_0x33a92a){if(_0x33a92a){_0x5a4de3=_0x33a92a[_0xbb10('0x3b')];if(!_0x20347b['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x530785[_0xbb10('0x27')]=qs['limit'](_0x20347b[_0xbb10('0x37')]['limit']);_0x530785[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x20347b[_0xbb10('0x37')]['offset']);}return _0xeac82d[_0xbb10('0x115')](_0x530785);}})[_0xbb10('0x15')](function(_0x4ba58f){if(_0x4ba58f){return _0x4ba58f?{'count':_0x5a4de3,'rows':_0x4ba58f}:null;}})[_0xbb10('0x15')](respondWithResult(_0x22ffc6,null))[_0xbb10('0x1f')](handleError(_0x22ffc6,null));};exports[_0xbb10('0x116')]=function(_0x2e03eb,_0x24e7bc){return db['chatProactiveAction']['find']({'where':{'id':_0x2e03eb[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x24e7bc,null))[_0xbb10('0x15')](function(_0x1b0734){if(_0x1b0734){return _0x1b0734[_0xbb10('0x116')](_0x2e03eb['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x2e03eb[_0xbb10('0x4d')],[_0xbb10('0x5e'),'id'])||{});}})[_0xbb10('0x15')](respondWithResult(_0x24e7bc,null))['catch'](handleError(_0x24e7bc,null));};exports['getProactiveActions']=function(_0x2f675c,_0x18f6b1){var _0x1052f5={};var _0x119e8f={};var _0x5a031b;var _0x4c8e28;return db[_0xbb10('0x31')]['findOne']({'where':{'id':_0x2f675c['params']['id']}})['then'](handleEntityNotFound(_0x18f6b1,null))['then'](function(_0x3758dd){if(_0x3758dd){_0x5a031b=_0x3758dd;_0x119e8f[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x117')][_0xbb10('0x32')]);_0x119e8f['query']=_[_0xbb10('0x36')](_0x2f675c[_0xbb10('0x37')]);_0x119e8f[_0xbb10('0x38')]=_['intersection'](_0x119e8f[_0xbb10('0x35')],_0x119e8f[_0xbb10('0x37')]);_0x1052f5[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x119e8f[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x2f675c[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x1052f5[_0xbb10('0x39')]=_0x1052f5[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x1052f5[_0xbb10('0x39')]:_0x119e8f[_0xbb10('0x35')];_0x1052f5[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x2f675c['query']['sort']);_0x1052f5['where']=qs[_0xbb10('0x38')](_['pick'](_0x2f675c[_0xbb10('0x37')],_0x119e8f['filters']));if(_0x2f675c[_0xbb10('0x37')]['filter']){_0x1052f5['where']=_[_0xbb10('0x42')](_0x1052f5[_0xbb10('0x41')],{'$or':_['map'](_0x1052f5[_0xbb10('0x39')],function(_0x131d48){var _0x338e7a={};_0x338e7a[_0x131d48]={'$like':'%'+_0x2f675c[_0xbb10('0x37')]['filter']+'%'};return _0x338e7a;})});}_0x1052f5=_['merge']({},_0x1052f5,_0x2f675c[_0xbb10('0x45')]);return _0x5a031b[_0xbb10('0x102')](_0x1052f5);}})[_0xbb10('0x15')](function(_0x53f3c2){if(_0x53f3c2){_0x4c8e28=_0x53f3c2[_0xbb10('0x3b')];if(!_0x2f675c[_0xbb10('0x37')][_0xbb10('0x3c')]('nolimit')){_0x1052f5[_0xbb10('0x27')]=qs['limit'](_0x2f675c['query'][_0xbb10('0x27')]);_0x1052f5['offset']=qs[_0xbb10('0x24')](_0x2f675c[_0xbb10('0x37')][_0xbb10('0x24')]);}return _0x5a031b[_0xbb10('0x102')](_0x1052f5);}})[_0xbb10('0x15')](function(_0x57a6bc){if(_0x57a6bc){return _0x57a6bc?{'count':_0x4c8e28,'rows':_0x57a6bc}:null;}})[_0xbb10('0x15')](respondWithResult(_0x18f6b1,null))[_0xbb10('0x1f')](handleError(_0x18f6b1,null));};exports[_0xbb10('0x118')]=function(_0x2701e8,_0x1b0086){var _0x1c387b=_0x2701e8['query']['online']===_0xbb10('0x119')?_0xbb10('0x11a'):_0xbb10('0x11b');return db[_0xbb10('0x31')][_0xbb10('0x56')]({'attributes':['id',_0x1c387b],'where':{'id':_0x2701e8['params']['id']}})['then'](handleEntityNotFound(_0x1b0086,null))[_0xbb10('0x15')](function(_0x23cbf4){if(_0x23cbf4){var _0x536519=_0x23cbf4[_0x1c387b];var _0x50dde9=_0x536519&&_0x536519[_0xbb10('0x11c')]?_0x536519[_0xbb10('0x11c')]:[];_0x1b0086[_0xbb10('0xbf')]({'fromKey':_[_0xbb10('0x71')](_0x536519[_0xbb10('0x11d')])?undefined:_0x536519[_0xbb10('0x11d')],'count':_0x50dde9['length'],'rows':_0x50dde9});}})[_0xbb10('0x1f')](handleError(_0x1b0086,null));};exports[_0xbb10('0x11e')]=function(_0x261c9b,_0x232794){var _0x35b3f8={'raw':![],'where':{}};var _0x3783d0={};var _0xdd7d5c={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x261c9b['params']['id']}})['then'](handleEntityNotFound(_0x232794,null))['then'](function(_0x111c15){if(_0x111c15){_0x3783d0[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xc9')]['rawAttributes']);_0x3783d0['query']=_['keys'](_0x261c9b[_0xbb10('0x37')]);_0x3783d0[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x3783d0[_0xbb10('0x35')],_0x3783d0[_0xbb10('0x37')]);_0x35b3f8[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x3783d0[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x35b3f8[_0xbb10('0x39')]=_0x35b3f8[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x35b3f8['attributes']:_0x3783d0[_0xbb10('0x35')];if(!_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x35b3f8[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x261c9b['query'][_0xbb10('0x27')]);_0x35b3f8[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x35b3f8[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3f')]);_0x35b3f8['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x261c9b[_0xbb10('0x37')],_0x3783d0[_0xbb10('0x38')]));_0x35b3f8[_0xbb10('0x41')][_0xbb10('0x59')]=_0x111c15['id'];if(_0x261c9b[_0xbb10('0x37')][_0xbb10('0x44')]){_0x35b3f8[_0xbb10('0x41')]=_['merge'](_0x35b3f8[_0xbb10('0x41')],{'$or':_['map'](_0x35b3f8[_0xbb10('0x39')],function(_0x2cd1b0){var _0x57e0b2={};_0x57e0b2[_0x2cd1b0]={'$like':'%'+_0x261c9b['query'][_0xbb10('0x44')]+'%'};return _0x57e0b2;})});}_0x35b3f8=_[_0xbb10('0x42')]({},_0x35b3f8,_0x261c9b[_0xbb10('0x45')]);return db[_0xbb10('0xc9')][_0xbb10('0x26')]({'where':_0x35b3f8[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x40a208){_0xdd7d5c[_0xbb10('0x26')]=_0x40a208;if(_0x261c9b[_0xbb10('0x37')][_0xbb10('0x46')]){_0x35b3f8[_0xbb10('0x4b')]=[{'all':!![]}];}else{_0x35b3f8[_0xbb10('0x4b')]=[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0xec'),'required':![]},{'model':db['Attachment'],'as':_0xbb10('0x11f'),'required':![]}];}return db['ChatOfflineMessage'][_0xbb10('0x47')](_0x35b3f8);})[_0xbb10('0x15')](function(_0x234dc5){_0xdd7d5c[_0xbb10('0x48')]=_0x234dc5;return _0xdd7d5c;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x232794,_0x35b3f8))[_0xbb10('0x1f')](handleError(_0x232794,null));};exports[_0xbb10('0x120')]=function(_0x45dcaa,_0x5c88bd){return db['ChatWebsite']['find']({'where':{'id':_0x45dcaa[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5c88bd,null))[_0xbb10('0x15')](function(_0x54c61c){if(_0x54c61c){return _0x54c61c[_0xbb10('0x120')](_0x45dcaa['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x45dcaa['body'],[_0xbb10('0x5e'),'id'])||{})[_0xbb10('0xac')](function(_0xa52322){for(var _0xc1691=0x0;_0xc1691<_0x45dcaa[_0xbb10('0x4d')]['ids'][_0xbb10('0x3b')];_0xc1691+=0x1){socket[_0xbb10('0x121')]('userChatWebsite:save',{'UserId':Number(_0x45dcaa[_0xbb10('0x4d')][_0xbb10('0x5e')][_0xc1691]),'ChatWebsiteId':Number(_0x45dcaa['params']['id'])});}return _0xa52322;});}})[_0xbb10('0x15')](respondWithResult(_0x5c88bd,null))[_0xbb10('0x1f')](handleError(_0x5c88bd,null));};exports[_0xbb10('0x122')]=function(_0x24f1d2,_0x481a0a){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x24f1d2[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x481a0a,null))['then'](function(_0x284b77){if(_0x284b77){return _0x284b77[_0xbb10('0x122')](_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')])['then'](function(){if(_[_0xbb10('0x123')](_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')])){for(var _0x28c680=0x0;_0x28c680<_0x24f1d2[_0xbb10('0x37')]['ids']['length'];_0x28c680+=0x1){socket[_0xbb10('0x121')](_0xbb10('0x124'),{'UserId':Number(_0x24f1d2['query']['ids'][_0x28c680]),'ChatWebsiteId':Number(_0x24f1d2[_0xbb10('0x57')]['id'])});}}else{socket[_0xbb10('0x121')](_0xbb10('0x124'),{'UserId':Number(_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')]),'ChatWebsiteId':Number(_0x24f1d2[_0xbb10('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x481a0a,null))['catch'](handleError(_0x481a0a,null));};exports[_0xbb10('0x125')]=function(_0x1c3cbc,_0x24bda8){var _0x27ddfc={};var _0x39a047={};var _0x9a80a7;var _0x5e08c5;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x1c3cbc[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x24bda8,null))['then'](function(_0x21ad98){if(_0x21ad98){_0x9a80a7=_0x21ad98;_0x39a047[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xb4')][_0xbb10('0x32')]);_0x39a047[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x1c3cbc[_0xbb10('0x37')]);_0x39a047[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x39a047[_0xbb10('0x35')],_0x39a047[_0xbb10('0x37')]);_0x27ddfc['attributes']=_[_0xbb10('0x4a')](_0x39a047[_0xbb10('0x35')],qs['fields'](_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x27ddfc[_0xbb10('0x39')]=_0x27ddfc['attributes'][_0xbb10('0x3b')]?_0x27ddfc[_0xbb10('0x39')]:_0x39a047[_0xbb10('0x35')];_0x27ddfc[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x1c3cbc[_0xbb10('0x37')]['sort']);_0x27ddfc[_0xbb10('0x41')]=qs['filters'](_[_0xbb10('0x40')](_0x1c3cbc[_0xbb10('0x37')],_0x39a047[_0xbb10('0x38')]));if(_0x1c3cbc[_0xbb10('0x37')]['filter']){_0x27ddfc[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x27ddfc['where'],{'$or':_[_0xbb10('0x30')](_0x27ddfc['attributes'],function(_0x31c086){var _0x40845c={};_0x40845c[_0x31c086]={'$like':'%'+_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x40845c;})});}_0x27ddfc=_[_0xbb10('0x42')]({},_0x27ddfc,_0x1c3cbc[_0xbb10('0x45')]);return _0x9a80a7[_0xbb10('0x125')](_0x27ddfc);}})[_0xbb10('0x15')](function(_0x55ee36){if(_0x55ee36){_0x5e08c5=_0x55ee36['length'];if(!_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x27ddfc[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x27')]);_0x27ddfc[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x1c3cbc['query'][_0xbb10('0x24')]);}return _0x9a80a7['getAgents'](_0x27ddfc);}})[_0xbb10('0x15')](function(_0x2a618a){if(_0x2a618a){return _0x2a618a?{'count':_0x5e08c5,'rows':_0x2a618a}:null;}})['then'](respondWithResult(_0x24bda8,null))[_0xbb10('0x1f')](handleError(_0x24bda8,null));};
\ No newline at end of file
index cf86ff8..2c0f7de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x089f=['ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x4e38cc,_0x8c72d0){var _0x51fe26=function(_0x3f10f4){while(--_0x3f10f4){_0x4e38cc['push'](_0x4e38cc['shift']());}};_0x51fe26(++_0x8c72d0);}(_0x089f,0x1c7));var _0xf089=function(_0x43c20a,_0x503566){_0x43c20a=_0x43c20a-0x0;var _0x22bc61=_0x089f[_0x43c20a];return _0x22bc61;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xf089('0x0'))['db'][_0xf089('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf089('0x2')](0x0);var events={'afterCreate':_0xf089('0x3'),'afterUpdate':_0xf089('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2b7602){return function(_0x3195ed,_0x250428,_0x5ea026){ChatWebsiteEvents[_0xf089('0x5')](_0x2b7602+':'+_0x3195ed['id'],_0x3195ed);ChatWebsiteEvents[_0xf089('0x5')](_0x2b7602,_0x3195ed);_0x5ea026(null);};}for(var e in events){if(events[_0xf089('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xf089('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x238f=['save','update','remove','emit','exports','events','../../mysqldb','ChatWebsite'];(function(_0x5d9304,_0x3c30b4){var _0x37dbc4=function(_0xa93092){while(--_0xa93092){_0x5d9304['push'](_0x5d9304['shift']());}};_0x37dbc4(++_0x3c30b4);}(_0x238f,0xa5));var _0xf238=function(_0x58704a,_0x18ff6e){_0x58704a=_0x58704a-0x0;var _0x376a8f=_0x238f[_0x58704a];return _0x376a8f;};'use strict';var EventEmitter=require(_0xf238('0x0'));var ChatWebsite=require(_0xf238('0x1'))['db'][_0xf238('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf238('0x3'),'afterUpdate':_0xf238('0x4'),'afterDestroy':_0xf238('0x5')};function emitEvent(_0xb2d281){return function(_0x1bd4aa,_0xfcef92,_0x520c15){ChatWebsiteEvents[_0xf238('0x6')](_0xb2d281+':'+_0x1bd4aa['id'],_0x1bd4aa);ChatWebsiteEvents[_0xf238('0x6')](_0xb2d281,_0x1bd4aa);_0x520c15(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xf238('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
index 7db4019..981e80a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87b5=['chat_websites','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x30b9f1,_0x4274b3){var _0x244301=function(_0x1e3ec3){while(--_0x1e3ec3){_0x30b9f1['push'](_0x30b9f1['shift']());}};_0x244301(++_0x4274b3);}(_0x87b5,0x90));var _0x587b=function(_0x185ccf,_0x198152){_0x185ccf=_0x185ccf-0x0;var _0x29b618=_0x87b5[_0x185ccf];return _0x29b618;};'use strict';var _=require(_0x587b('0x0'));var util=require('util');var logger=require(_0x587b('0x1'))('api');var moment=require(_0x587b('0x2'));var BPromise=require(_0x587b('0x3'));var rp=require(_0x587b('0x4'));var fs=require('fs');var path=require(_0x587b('0x5'));var rimraf=require(_0x587b('0x6'));var config=require(_0x587b('0x7'));var attributes=require(_0x587b('0x8'));module[_0x587b('0x9')]=function(_0x46f483,_0x3b4a90){return _0x46f483[_0x587b('0xa')](_0x587b('0xb'),attributes,{'tableName':_0x587b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6089=['api','bluebird','path','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','lodash','util','../../config/logger'];(function(_0x2aad1f,_0x40cdfe){var _0x20cf22=function(_0x5e9944){while(--_0x5e9944){_0x2aad1f['push'](_0x2aad1f['shift']());}};_0x20cf22(++_0x40cdfe);}(_0x6089,0x93));var _0x9608=function(_0x1ba6ed,_0x698774){_0x1ba6ed=_0x1ba6ed-0x0;var _0x49b51a=_0x6089[_0x1ba6ed];return _0x49b51a;};'use strict';var _=require(_0x9608('0x0'));var util=require(_0x9608('0x1'));var logger=require(_0x9608('0x2'))(_0x9608('0x3'));var moment=require('moment');var BPromise=require(_0x9608('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9608('0x5'));var rimraf=require('rimraf');var config=require(_0x9608('0x6'));var attributes=require(_0x9608('0x7'));module[_0x9608('0x8')]=function(_0x4b540e,_0x1eee87){return _0x4b540e['define'](_0x9608('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7166c5d..5b6ae12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc870=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc'];(function(_0x2729cd,_0x462966){var _0x1c259=function(_0x51f3a4){while(--_0x51f3a4){_0x2729cd['push'](_0x2729cd['shift']());}};_0x1c259(++_0x462966);}(_0xc870,0x181));var _0x0c87=function(_0x31dd54,_0x9d6067){_0x31dd54=_0x31dd54-0x0;var _0x515553=_0xc870[_0x31dd54];return _0x515553;};'use strict';var _=require(_0x0c87('0x0'));var util=require(_0x0c87('0x1'));var moment=require(_0x0c87('0x2'));var BPromise=require(_0x0c87('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c87('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c87('0x5'))(_0x0c87('0x6'));var config=require(_0x0c87('0x7'));var jayson=require(_0x0c87('0x8'));var client=jayson[_0x0c87('0x9')][_0x0c87('0xa')]({'port':0x232a});config[_0x0c87('0xb')]=_[_0x0c87('0xc')](config[_0x0c87('0xb')],{'host':_0x0c87('0xd'),'port':0x18eb});var socket=require(_0x0c87('0xe'))(new Redis(config[_0x0c87('0xb')]));require(_0x0c87('0xf'))[_0x0c87('0x10')](socket);function respondWithRpcPromise(_0x162d11,_0x242aea,_0x51a72b){return new BPromise(function(_0x3e9680,_0x503c92){return client[_0x0c87('0x11')](_0x162d11,_0x51a72b)[_0x0c87('0x12')](function(_0x562312){logger['info'](_0x0c87('0x13'),_0x242aea,_0x0c87('0x14'));logger[_0x0c87('0x15')](_0x0c87('0x16'),_0x242aea,_0x0c87('0x14'),JSON[_0x0c87('0x17')](_0x562312));if(_0x562312[_0x0c87('0x18')]){if(_0x562312[_0x0c87('0x18')][_0x0c87('0x19')]===0x1f4){logger['error'](_0x0c87('0x13'),_0x242aea,_0x562312[_0x0c87('0x18')][_0x0c87('0x1a')]);return _0x503c92(_0x562312[_0x0c87('0x18')]['message']);}logger[_0x0c87('0x18')](_0x0c87('0x13'),_0x242aea,_0x562312['error'][_0x0c87('0x1a')]);return _0x3e9680(_0x562312['error'][_0x0c87('0x1a')]);}else{logger['info'](_0x0c87('0x13'),_0x242aea,_0x0c87('0x14'));_0x3e9680(_0x562312['result'][_0x0c87('0x1a')]);}})[_0x0c87('0x1b')](function(_0x3878b2){logger[_0x0c87('0x18')](_0x0c87('0x13'),_0x242aea,_0x3878b2);_0x503c92(_0x3878b2);});});}
\ No newline at end of file
+var _0xa446=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x575d25,_0x2666c3){var _0x4710a3=function(_0x3a2af0){while(--_0x3a2af0){_0x575d25['push'](_0x575d25['shift']());}};_0x4710a3(++_0x2666c3);}(_0xa446,0x180));var _0x6a44=function(_0x194b0a,_0x109a2f){_0x194b0a=_0x194b0a-0x0;var _0xf6f177=_0xa446[_0x194b0a];return _0xf6f177;};'use strict';var _=require(_0x6a44('0x0'));var util=require('util');var moment=require(_0x6a44('0x1'));var BPromise=require(_0x6a44('0x2'));var rs=require(_0x6a44('0x3'));var fs=require('fs');var Redis=require(_0x6a44('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a44('0x5'));var logger=require(_0x6a44('0x6'))(_0x6a44('0x7'));var config=require(_0x6a44('0x8'));var jayson=require(_0x6a44('0x9'));var client=jayson[_0x6a44('0xa')][_0x6a44('0xb')]({'port':0x232a});config['redis']=_[_0x6a44('0xc')](config[_0x6a44('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6a44('0xe'))(new Redis(config['redis']));require(_0x6a44('0xf'))['register'](socket);function respondWithRpcPromise(_0x195303,_0x34c1da,_0x5bec27){return new BPromise(function(_0x2d989e,_0x165297){return client[_0x6a44('0x10')](_0x195303,_0x5bec27)['then'](function(_0x536c84){logger[_0x6a44('0x11')](_0x6a44('0x12'),_0x34c1da,_0x6a44('0x13'));logger['debug'](_0x6a44('0x14'),_0x34c1da,_0x6a44('0x13'),JSON[_0x6a44('0x15')](_0x536c84));if(_0x536c84['error']){if(_0x536c84[_0x6a44('0x16')][_0x6a44('0x17')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x34c1da,_0x536c84[_0x6a44('0x16')][_0x6a44('0x18')]);return _0x165297(_0x536c84[_0x6a44('0x16')][_0x6a44('0x18')]);}logger[_0x6a44('0x16')](_0x6a44('0x12'),_0x34c1da,_0x536c84[_0x6a44('0x16')]['message']);return _0x2d989e(_0x536c84[_0x6a44('0x16')][_0x6a44('0x18')]);}else{logger[_0x6a44('0x11')](_0x6a44('0x12'),_0x34c1da,_0x6a44('0x13'));_0x2d989e(_0x536c84[_0x6a44('0x19')][_0x6a44('0x18')]);}})[_0x6a44('0x1a')](function(_0x56fb23){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x34c1da,_0x56fb23);_0x165297(_0x56fb23);});});}
\ No newline at end of file
index 7935221..d679d5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb3a=['emit','register','length','save','remove','update'];(function(_0x3207ed,_0x318402){var _0x1c74db=function(_0x2c9666){while(--_0x2c9666){_0x3207ed['push'](_0x3207ed['shift']());}};_0x1c74db(++_0x318402);}(_0xfb3a,0x123));var _0xafb3=function(_0x1a20bd,_0x146750){_0x1a20bd=_0x1a20bd-0x0;var _0x147836=_0xfb3a[_0x1a20bd];return _0x147836;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xafb3('0x0'),_0xafb3('0x1'),_0xafb3('0x2')];function createListener(_0x472c54,_0x13eed2){return function(_0x37f0c6){_0x13eed2[_0xafb3('0x3')](_0x472c54,_0x37f0c6);};}function removeListener(_0x18bb80,_0x2e7623){return function(){ChatWebsiteEvents['removeListener'](_0x18bb80,_0x2e7623);};}exports[_0xafb3('0x4')]=function(_0x56bdf3){for(var _0x1a1c74=0x0,_0x491972=events[_0xafb3('0x5')];_0x1a1c74<_0x491972;_0x1a1c74++){var _0x4b2e56=events[_0x1a1c74];var _0x570975=createListener('chatWebsite:'+_0x4b2e56,_0x56bdf3);ChatWebsiteEvents['on'](_0x4b2e56,_0x570975);}};
\ No newline at end of file
+var _0x9fcc=['length','chatWebsite:','save','remove','update','removeListener','register'];(function(_0x3f08e5,_0x290303){var _0x508b16=function(_0x155b9e){while(--_0x155b9e){_0x3f08e5['push'](_0x3f08e5['shift']());}};_0x508b16(++_0x290303);}(_0x9fcc,0xbf));var _0xc9fc=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9fcc[_0x13e741];return _0x3f8bb3;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xc9fc('0x0'),_0xc9fc('0x1'),_0xc9fc('0x2')];function createListener(_0x3dfa9a,_0x3c5e4e){return function(_0x41bf38){_0x3c5e4e['emit'](_0x3dfa9a,_0x41bf38);};}function removeListener(_0x19c7c6,_0x3da382){return function(){ChatWebsiteEvents[_0xc9fc('0x3')](_0x19c7c6,_0x3da382);};}exports[_0xc9fc('0x4')]=function(_0x5afded){for(var _0x339f73=0x0,_0x337956=events[_0xc9fc('0x5')];_0x339f73<_0x337956;_0x339f73++){var _0x564a63=events[_0x339f73];var _0x410877=createListener(_0xc9fc('0x6')+_0x564a63,_0x5afded);ChatWebsiteEvents['on'](_0x564a63,_0x410877);}};
\ No newline at end of file
index 888bc37..cd97d81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8af3=['removeAnswers','removeAgents','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','join','root','format','now','originalname','/:id/logo','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','single','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','destroy','delete'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x8af3,0x1c5));var _0x38af=function(_0x599709,_0x4e405c){_0x599709=_0x599709-0x0;var _0x5e098f=_0x8af3[_0x599709];return _0x5e098f;};'use strict';var multer=require(_0x38af('0x0'));var util=require('util');var path=require(_0x38af('0x1'));var timeout=require(_0x38af('0x2'));var express=require('express');var router=express[_0x38af('0x3')]();var fs_extra=require(_0x38af('0x4'));var auth=require(_0x38af('0x5'));var interaction=require(_0x38af('0x6'));var config=require(_0x38af('0x7'));var controller=require(_0x38af('0x8'));router[_0x38af('0x9')]('/',auth[_0x38af('0xa')](),controller[_0x38af('0xb')]);router['get'](_0x38af('0xc'),auth['isAuthenticated'](),controller[_0x38af('0xd')]);router[_0x38af('0x9')]('/:id',auth[_0x38af('0xa')](),controller[_0x38af('0xe')]);router[_0x38af('0x9')](_0x38af('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x38af('0x9')](_0x38af('0x10'),auth[_0x38af('0xa')](),controller[_0x38af('0x11')]);router[_0x38af('0x9')]('/:id/logo',controller[_0x38af('0x12')]);router[_0x38af('0x9')](_0x38af('0x13'),controller[_0x38af('0x14')]);router[_0x38af('0x9')]('/:id/customer_avatar',controller[_0x38af('0x15')]);router[_0x38af('0x9')](_0x38af('0x16'),controller[_0x38af('0x17')]);router[_0x38af('0x9')](_0x38af('0x18'),auth[_0x38af('0xa')](),controller[_0x38af('0x19')]);router[_0x38af('0x9')]('/:id/snippet',controller[_0x38af('0x1a')]);router[_0x38af('0x9')](_0x38af('0x1b'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x38af('0x1c'),auth[_0x38af('0xa')](),controller[_0x38af('0x1d')]);router[_0x38af('0x9')](_0x38af('0x1e'),controller[_0x38af('0x1f')]);router['get'](_0x38af('0x20'),auth[_0x38af('0xa')](),controller[_0x38af('0x21')]);router[_0x38af('0x9')](_0x38af('0x22'),auth['isAuthenticated'](),controller['getAgents']);router[_0x38af('0x23')]('/',auth['isAuthenticated'](),controller[_0x38af('0x24')]);router[_0x38af('0x23')](_0x38af('0xf'),auth[_0x38af('0xa')](),controller[_0x38af('0x25')]);router[_0x38af('0x23')](_0x38af('0x10'),auth[_0x38af('0xa')](),controller[_0x38af('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x33042f,_0x2f80b8,_0x733a39){_0x733a39(null,path[_0x38af('0x27')](config[_0x38af('0x28')],'server/files/images/logos/'));},'filename':function(_0x31d84c,_0x359b13,_0xe47c4e){_0xe47c4e(null,util[_0x38af('0x29')]('%s-%s',Date[_0x38af('0x2a')](),_0x359b13[_0x38af('0x2b')]));}})});router[_0x38af('0x23')](_0x38af('0x2c'),upload['single'](_0x38af('0x2d')),controller[_0x38af('0x2e')]);var upload=multer({'storage':multer[_0x38af('0x2f')]({'destination':function(_0x50ce68,_0x5a9724,_0x7e7938){_0x7e7938(null,path[_0x38af('0x27')](config[_0x38af('0x28')],_0x38af('0x30')));},'filename':function(_0xb9f388,_0x1b2012,_0x3e1b5b){_0x3e1b5b(null,util[_0x38af('0x29')](_0x38af('0x31'),Date['now'](),_0x1b2012[_0x38af('0x2b')]));}})});router[_0x38af('0x23')](_0x38af('0x13'),upload[_0x38af('0x32')]('file'),controller[_0x38af('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a4492,_0x5e6ef6,_0x3ce7f9){_0x3ce7f9(null,path[_0x38af('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3d948d,_0x13bb59,_0xcb1ae7){_0xcb1ae7(null,util['format'](_0x38af('0x31'),Date[_0x38af('0x2a')](),_0x13bb59['originalname']));}})});router[_0x38af('0x23')](_0x38af('0x34'),upload['single']('file'),controller[_0x38af('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a032f,_0x2faf27,_0x437e33){_0x437e33(null,path[_0x38af('0x27')](config['root'],_0x38af('0x30')));},'filename':function(_0x5bb746,_0x36656d,_0x43697e){_0x43697e(null,util[_0x38af('0x29')]('%s-%s',Date[_0x38af('0x2a')](),_0x36656d[_0x38af('0x2b')]));}})});router[_0x38af('0x23')](_0x38af('0x16'),upload[_0x38af('0x32')](_0x38af('0x2d')),controller[_0x38af('0x36')]);router[_0x38af('0x23')]('/:id/notify',controller[_0x38af('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x38af('0x2f')]({'destination':function(_0x2e9a7b,_0x584195,_0x3f2318){const _0x4e3fcc=path[_0x38af('0x27')](config['root'],_0x38af('0x38'),_0x38af('0x39'),_0x38af('0x3a'));fs_extra[_0x38af('0x3b')](_0x4e3fcc,function(){_0x3f2318(null,_0x4e3fcc);});},'filename':function(_0x3d4234,_0x4d4041,_0x26c52c){const _0x57f568=_0x4d4041[_0x38af('0x2b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x26119b=path[_0x38af('0x3c')](_0x57f568);const _0xd8bc6f=Date[_0x38af('0x2a')]()+'-'+_0x57f568['replace'](_0x26119b,'')+_0x26119b;_0x26c52c(null,_0xd8bc6f);}})});router[_0x38af('0x23')](_0x38af('0x3d'),offlineUploadMulter['any'](),controller[_0x38af('0x3e')]);router['post']('/:id/interactions',auth[_0x38af('0xa')](),controller[_0x38af('0x3f')]);router[_0x38af('0x23')](_0x38af('0x1b'),auth[_0x38af('0xa')](),controller[_0x38af('0x40')]);router['post'](_0x38af('0x1c'),auth['isAuthenticated'](),controller[_0x38af('0x41')]);router[_0x38af('0x23')](_0x38af('0x22'),auth[_0x38af('0xa')](),controller[_0x38af('0x42')]);router[_0x38af('0x43')](_0x38af('0x44'),auth[_0x38af('0xa')](),controller[_0x38af('0x45')]);router['delete']('/:id',auth[_0x38af('0xa')](),controller[_0x38af('0x46')]);router['delete'](_0x38af('0xf'),auth[_0x38af('0xa')](),controller['removeDispositions']);router[_0x38af('0x47')](_0x38af('0x10'),auth[_0x38af('0xa')](),controller[_0x38af('0x48')]);router[_0x38af('0x47')]('/:id/users',auth[_0x38af('0xa')](),controller[_0x38af('0x49')]);module[_0x38af('0x4a')]=router;
\ No newline at end of file
+var _0x79dc=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','/:id/users','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','attachments','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x79dc,0xc8));var _0xc79d=function(_0x2987d1,_0x25270d){_0x2987d1=_0x2987d1-0x0;var _0x16f483=_0x79dc[_0x2987d1];return _0x16f483;};'use strict';var multer=require(_0xc79d('0x0'));var util=require(_0xc79d('0x1'));var path=require(_0xc79d('0x2'));var timeout=require(_0xc79d('0x3'));var express=require('express');var router=express[_0xc79d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc79d('0x5'));var config=require(_0xc79d('0x6'));var controller=require('./chatWebsite.controller');router[_0xc79d('0x7')]('/',auth[_0xc79d('0x8')](),controller['index']);router[_0xc79d('0x7')](_0xc79d('0x9'),auth[_0xc79d('0x8')](),controller[_0xc79d('0xa')]);router[_0xc79d('0x7')](_0xc79d('0xb'),auth[_0xc79d('0x8')](),controller['show']);router[_0xc79d('0x7')](_0xc79d('0xc'),auth[_0xc79d('0x8')](),controller[_0xc79d('0xd')]);router['get'](_0xc79d('0xe'),auth[_0xc79d('0x8')](),controller[_0xc79d('0xf')]);router[_0xc79d('0x7')](_0xc79d('0x10'),controller['getLogo']);router[_0xc79d('0x7')](_0xc79d('0x11'),controller[_0xc79d('0x12')]);router[_0xc79d('0x7')](_0xc79d('0x13'),controller[_0xc79d('0x14')]);router[_0xc79d('0x7')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0xc79d('0x7')](_0xc79d('0x15'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x16')]);router[_0xc79d('0x7')](_0xc79d('0x17'),controller['getSnippet']);router['get'](_0xc79d('0x18'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x19')]);router[_0xc79d('0x7')](_0xc79d('0x1a'),auth[_0xc79d('0x8')](),controller['getProactiveActions']);router['get'](_0xc79d('0x1b'),controller['getFields']);router[_0xc79d('0x7')](_0xc79d('0x1c'),auth[_0xc79d('0x8')](),controller['getOfflineMessages']);router['get'](_0xc79d('0x1d'),auth[_0xc79d('0x8')](),controller['getAgents']);router['post']('/',auth[_0xc79d('0x8')](),controller['create']);router[_0xc79d('0x1e')](_0xc79d('0xc'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x1f')]);router[_0xc79d('0x1e')](_0xc79d('0xe'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x20')]);var upload=multer({'storage':multer[_0xc79d('0x21')]({'destination':function(_0x42b448,_0x22116a,_0x2ca100){_0x2ca100(null,path[_0xc79d('0x22')](config[_0xc79d('0x23')],_0xc79d('0x24')));},'filename':function(_0x472e6f,_0x286135,_0x5d901f){_0x5d901f(null,util[_0xc79d('0x25')](_0xc79d('0x26'),Date[_0xc79d('0x27')](),_0x286135[_0xc79d('0x28')]));}})});router[_0xc79d('0x1e')](_0xc79d('0x10'),upload[_0xc79d('0x29')](_0xc79d('0x2a')),controller['addLogo']);var upload=multer({'storage':multer[_0xc79d('0x21')]({'destination':function(_0x183916,_0x5bf446,_0x3339e7){_0x3339e7(null,path[_0xc79d('0x22')](config[_0xc79d('0x23')],_0xc79d('0x2b')));},'filename':function(_0x338562,_0x4651c6,_0x1c455){_0x1c455(null,util[_0xc79d('0x25')](_0xc79d('0x26'),Date[_0xc79d('0x27')](),_0x4651c6[_0xc79d('0x28')]));}})});router[_0xc79d('0x1e')](_0xc79d('0x11'),upload[_0xc79d('0x29')](_0xc79d('0x2a')),controller[_0xc79d('0x2c')]);var upload=multer({'storage':multer[_0xc79d('0x21')]({'destination':function(_0x561670,_0x52f7f3,_0x162c91){_0x162c91(null,path[_0xc79d('0x22')](config[_0xc79d('0x23')],_0xc79d('0x2b')));},'filename':function(_0x1969a3,_0x2bf9cf,_0x47c851){_0x47c851(null,util['format'](_0xc79d('0x26'),Date[_0xc79d('0x27')](),_0x2bf9cf[_0xc79d('0x28')]));}})});router[_0xc79d('0x1e')](_0xc79d('0x13'),upload[_0xc79d('0x29')](_0xc79d('0x2a')),controller[_0xc79d('0x2d')]);var upload=multer({'storage':multer[_0xc79d('0x21')]({'destination':function(_0x10ab0b,_0x3b77ae,_0x1a687d){_0x1a687d(null,path[_0xc79d('0x22')](config[_0xc79d('0x23')],'server/files/images/avatars/'));},'filename':function(_0x28e785,_0x42daa9,_0x13f85f){_0x13f85f(null,util[_0xc79d('0x25')](_0xc79d('0x26'),Date[_0xc79d('0x27')](),_0x42daa9['originalname']));}})});router[_0xc79d('0x1e')](_0xc79d('0x2e'),upload[_0xc79d('0x29')](_0xc79d('0x2a')),controller[_0xc79d('0x2f')]);router[_0xc79d('0x1e')]('/:id/notify',controller[_0xc79d('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0xc79d('0x21')]({'destination':function(_0x25c1eb,_0x7a0921,_0xf4f54a){const _0x44ae6c=path['join'](config[_0xc79d('0x23')],'server/files',_0xc79d('0x31'),'offline-chat');fs_extra[_0xc79d('0x32')](_0x44ae6c,function(){_0xf4f54a(null,_0x44ae6c);});},'filename':function(_0xb765d5,_0x4fbe76,_0x312504){const _0x2deea2=_0x4fbe76[_0xc79d('0x28')][_0xc79d('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x28c4be=path['extname'](_0x2deea2);const _0x4d292f=Date[_0xc79d('0x27')]()+'-'+_0x2deea2[_0xc79d('0x33')](_0x28c4be,'')+_0x28c4be;_0x312504(null,_0x4d292f);}})});router[_0xc79d('0x1e')](_0xc79d('0x34'),offlineUploadMulter[_0xc79d('0x35')](),controller[_0xc79d('0x36')]);router['post'](_0xc79d('0x15'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x37')]);router[_0xc79d('0x1e')](_0xc79d('0x18'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x38')]);router['post'](_0xc79d('0x1a'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x39')]);router[_0xc79d('0x1e')]('/:id/users',auth[_0xc79d('0x8')](),controller[_0xc79d('0x3a')]);router[_0xc79d('0x3b')](_0xc79d('0xb'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x3c')]);router[_0xc79d('0x3d')](_0xc79d('0xb'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x3e')]);router[_0xc79d('0x3d')](_0xc79d('0xc'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x3f')]);router[_0xc79d('0x3d')](_0xc79d('0xe'),auth['isAuthenticated'](),controller[_0xc79d('0x40')]);router[_0xc79d('0x3d')](_0xc79d('0x1d'),auth[_0xc79d('0x8')](),controller[_0xc79d('0x41')]);module[_0xc79d('0x42')]=router;
\ No newline at end of file
index 976944b..b893f61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16cf=['exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','production','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x16cf,0x1da));var _0xf16c=function(_0x4a7836,_0x2ac870){_0x4a7836=_0x4a7836-0x0;var _0x4f9bb4=_0x16cf[_0x4a7836];return _0x4f9bb4;};var beaverLogger=require(_0xf16c('0x0'));var express=require(_0xf16c('0x1'));var auth=require(_0xf16c('0x2'));var config=require(_0xf16c('0x3'));var router=express['Router']();var isProduction=config[_0xf16c('0x4')]===_0xf16c('0x5')||![];function clientSideLogs(_0x2bf5b8,_0x8ace28,_0x311694){var _0x1c4171=_0x2bf5b8[_0xf16c('0x6')]['get']('client-side-logger');if(!_0x1c4171){throw new Error(_0xf16c('0x7'));}return beaverLogger[_0xf16c('0x8')]({'uri':_0xf16c('0x9'),'logger':_0x1c4171,'enableCors':!isProduction})(_0x2bf5b8,_0x8ace28,_0x311694);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xf16c('0xa')]=router;
\ No newline at end of file
+var _0x19c0=['../config/environment','Router','env','production','get','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports'];(function(_0x2bbc50,_0x3af3ac){var _0xf10632=function(_0x69c4d2){while(--_0x69c4d2){_0x2bbc50['push'](_0x2bbc50['shift']());}};_0xf10632(++_0x3af3ac);}(_0x19c0,0x1f4));var _0x019c=function(_0x285ca3,_0x139c18){_0x285ca3=_0x285ca3-0x0;var _0xe64412=_0x19c0[_0x285ca3];return _0xe64412;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require('../components/auth/service');var config=require(_0x019c('0x0'));var router=express[_0x019c('0x1')]();var isProduction=config[_0x019c('0x2')]===_0x019c('0x3')||![];function clientSideLogs(_0x318510,_0x12b470,_0x13501e){var _0x534376=_0x318510['app'][_0x019c('0x4')]('client-side-logger');if(!_0x534376){throw new Error(_0x019c('0x5'));}return beaverLogger['expressEndpoint']({'uri':_0x019c('0x6'),'logger':_0x534376,'enableCors':!isProduction})(_0x318510,_0x12b470,_0x13501e);}router[_0x019c('0x7')](auth[_0x019c('0x8')](),clientSideLogs);module[_0x019c('0x9')]=router;
\ No newline at end of file
index 31f119d..013bea1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b08=['Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM'];(function(_0x4671eb,_0xf21de7){var _0x4ea584=function(_0x2b6494){while(--_0x2b6494){_0x4671eb['push'](_0x4671eb['shift']());}};_0x4ea584(++_0xf21de7);}(_0x8b08,0x1e6));var _0x88b0=function(_0x5a259b,_0x131453){_0x5a259b=_0x5a259b-0x0;var _0xaa2973=_0x8b08[_0x5a259b];return _0xaa2973;};'use strict';var Sequelize=require(_0x88b0('0x0'));module[_0x88b0('0x1')]={'name':{'type':Sequelize[_0x88b0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x88b0('0x3')]('AmazonAWS',_0x88b0('0x4'),_0x88b0('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x88b0('0x3')]('Outlook365',_0x88b0('0x6'))},'data1':{'type':Sequelize[_0x88b0('0x2')],'comment':_0x88b0('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0x88b0('0x8')},'data3':{'type':Sequelize[_0x88b0('0x2')],'comment':_0x88b0('0x9')},'data4':{'type':Sequelize[_0x88b0('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x88b0('0xa')],'comment':_0x88b0('0xb')},'data6':{'type':Sequelize[_0x88b0('0xa')],'comment':_0x88b0('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x88b0('0xd')}};
\ No newline at end of file
+var _0x933c=['Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','exports','ENUM','AmazonAWS'];(function(_0x594a71,_0x1347b7){var _0x480fc5=function(_0x348446){while(--_0x348446){_0x594a71['push'](_0x594a71['shift']());}};_0x480fc5(++_0x1347b7);}(_0x933c,0x123));var _0xc933=function(_0x5a7795,_0x1976da){_0x5a7795=_0x5a7795-0x0;var _0x4446e2=_0x933c[_0x5a7795];return _0x4446e2;};'use strict';var Sequelize=require('sequelize');module[_0xc933('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc933('0x1')](_0xc933('0x2'),_0xc933('0x3'),_0xc933('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc933('0x1')](_0xc933('0x5'),_0xc933('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0xc933('0x7')},'data2':{'type':Sequelize[_0xc933('0x8')],'comment':_0xc933('0x9')},'data3':{'type':Sequelize[_0xc933('0x8')],'comment':_0xc933('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0xc933('0xb')},'data5':{'type':Sequelize[_0xc933('0xc')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize['TEXT'],'comment':_0xc933('0xd')},'data7':{'type':Sequelize[_0xc933('0xc')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
index 49f5524..cd05fa2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e64=['length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','keys','find','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','padEnd','slice','map','CloudProvider','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields'];(function(_0x4a9774,_0x146c49){var _0x181fe0=function(_0x5184b4){while(--_0x5184b4){_0x4a9774['push'](_0x4a9774['shift']());}};_0x181fe0(++_0x146c49);}(_0x7e64,0x173));var _0x47e6=function(_0x5da7e3,_0x44edd0){_0x5da7e3=_0x5da7e3-0x0;var _0x4ac28b=_0x7e64[_0x5da7e3];return _0x4ac28b;};'use strict';var _=require(_0x47e6('0x0'));var Redis=require(_0x47e6('0x1'));var qs=require(_0x47e6('0x2'));var encryptor=require(_0x47e6('0x3'));var config=require(_0x47e6('0x4'));var logger=require(_0x47e6('0x5'))(_0x47e6('0x6'));var db=require(_0x47e6('0x7'))['db'];var oauth=require(_0x47e6('0x8'));config['redis']=_[_0x47e6('0x9')](config[_0x47e6('0xa')],{'host':_0x47e6('0xb'),'port':0x18eb});var socket=require(_0x47e6('0xc'))(new Redis(config['redis']));var redis=new Redis(config[_0x47e6('0xa')]);function respondWithStatusCode(_0x578e27,_0x429eaa){_0x429eaa=_0x429eaa||0xcc;return function(_0x131eea){if(_0x131eea){return _0x578e27[_0x47e6('0xd')](_0x429eaa);}return _0x578e27[_0x47e6('0xe')](_0x429eaa)[_0x47e6('0xf')]();};}function respondWithResult(_0x4f168a,_0x9009be){_0x9009be=_0x9009be||0xc8;return function(_0x21d5d9){if(_0x21d5d9){return _0x4f168a[_0x47e6('0xe')](_0x9009be)[_0x47e6('0x10')](_0x21d5d9);}};}function respondWithFilteredResult(_0x19758a,_0x1f7a07){return function(_0x222fc3){if(_0x222fc3){var _0x10cbf7=typeof _0x1f7a07[_0x47e6('0x11')]===_0x47e6('0x12')&&typeof _0x1f7a07[_0x47e6('0x13')]==='undefined';var _0x5de351=_0x222fc3['count'];var _0x48bbe2=_0x10cbf7?0x0:_0x1f7a07['offset'];var _0x40274b=_0x10cbf7?_0x222fc3[_0x47e6('0x14')]:_0x1f7a07[_0x47e6('0x11')]+_0x1f7a07['limit'];var _0x2193ac;if(_0x40274b>=_0x5de351){_0x40274b=_0x5de351;_0x2193ac=0xc8;}else{_0x2193ac=0xce;}_0x19758a[_0x47e6('0xe')](_0x2193ac);return _0x19758a[_0x47e6('0x15')](_0x47e6('0x16'),_0x48bbe2+'-'+_0x40274b+'/'+_0x5de351)[_0x47e6('0x10')](_0x222fc3);}return null;};}function saveUpdates(_0xe82333){return function(_0x3ee4a2){if(_0x3ee4a2){return _0x3ee4a2['update'](_0xe82333)[_0x47e6('0x17')](function(_0x46c490){return _0x46c490;});}return null;};}function removeEntity(_0x19d51e){return function(_0x4b6d08){if(_0x4b6d08){return _0x4b6d08[_0x47e6('0x18')]()[_0x47e6('0x17')](function(){_0x19d51e['status'](0xcc)[_0x47e6('0xf')]();});}};}function handleEntityNotFound(_0x597ba9){return function(_0x356eac){if(!_0x356eac){_0x597ba9['sendStatus'](0x194);}return _0x356eac;};}function handleError(_0x2a7ce4,_0x4eb1ca){_0x4eb1ca=_0x4eb1ca||0x1f4;return function(_0x35d868){logger[_0x47e6('0x19')](_0x35d868[_0x47e6('0x1a')]);if(_0x35d868[_0x47e6('0x1b')]){delete _0x35d868['name'];}_0x2a7ce4[_0x47e6('0xe')](_0x4eb1ca)['send'](_0x35d868);};}function maskClientSecret(_0x16a21a){return _[_0x47e6('0x1c')](_0x16a21a[_0x47e6('0x1d')](0x0,0x3),0x14,'*');}exports['index']=function(_0x3d5d48,_0x2f215d){var _0x102376={},_0x2518bc={},_0x1d5023={'count':0x0,'rows':[]};var _0x2f83ac=_[_0x47e6('0x1e')](db[_0x47e6('0x1f')][_0x47e6('0x20')],function(_0x3cca18){return{'name':_0x3cca18[_0x47e6('0x21')],'type':_0x3cca18['type'][_0x47e6('0x22')]};});_0x2518bc[_0x47e6('0x23')]=_[_0x47e6('0x1e')](_0x2f83ac,_0x47e6('0x1b'));_0x2518bc['query']=_['keys'](_0x3d5d48[_0x47e6('0x24')]);_0x2518bc[_0x47e6('0x25')]=_[_0x47e6('0x26')](_0x2518bc[_0x47e6('0x23')],_0x2518bc[_0x47e6('0x24')]);_0x102376[_0x47e6('0x27')]=_['intersection'](_0x2518bc[_0x47e6('0x23')],qs[_0x47e6('0x28')](_0x3d5d48['query']['fields']));_0x102376[_0x47e6('0x27')]=_0x102376[_0x47e6('0x27')][_0x47e6('0x29')]?_0x102376[_0x47e6('0x27')]:_0x2518bc['model'];if(!_0x3d5d48['query'][_0x47e6('0x2a')](_0x47e6('0x2b'))){_0x102376[_0x47e6('0x13')]=qs[_0x47e6('0x13')](_0x3d5d48['query'][_0x47e6('0x13')]);_0x102376[_0x47e6('0x11')]=qs['offset'](_0x3d5d48[_0x47e6('0x24')]['offset']);}_0x102376[_0x47e6('0x2c')]=qs[_0x47e6('0x2d')](_0x3d5d48[_0x47e6('0x24')][_0x47e6('0x2d')]);_0x102376['where']=qs[_0x47e6('0x25')](_[_0x47e6('0x2e')](_0x3d5d48['query'],_0x2518bc[_0x47e6('0x25')]),_0x2f83ac);if(_0x3d5d48[_0x47e6('0x24')][_0x47e6('0x2f')]){_0x102376[_0x47e6('0x30')]=_[_0x47e6('0x31')](_0x102376[_0x47e6('0x30')],{'$or':_[_0x47e6('0x1e')](_0x2f83ac,function(_0x2cdfa5){if(_0x2cdfa5[_0x47e6('0x32')]!==_0x47e6('0x33')){var _0x1237ce={};_0x1237ce[_0x2cdfa5[_0x47e6('0x1b')]]={'$like':'%'+_0x3d5d48[_0x47e6('0x24')]['filter']+'%'};return _0x1237ce;}})});}_0x102376=_[_0x47e6('0x31')]({},_0x102376,_0x3d5d48[_0x47e6('0x34')]);var _0x27b955={'where':_0x102376['where']};return db[_0x47e6('0x1f')][_0x47e6('0x14')](_0x27b955)['then'](function(_0x2f747d){_0x1d5023[_0x47e6('0x14')]=_0x2f747d;if(_0x3d5d48['query'][_0x47e6('0x35')]){_0x102376[_0x47e6('0x36')]=[{'all':!![]}];}return db[_0x47e6('0x1f')][_0x47e6('0x37')](_0x102376);})[_0x47e6('0x17')](function(_0x3f0484){_0x1d5023[_0x47e6('0x38')]=_[_0x47e6('0x1e')](_0x3f0484,function(_0xcca909){if(_0xcca909[_0x47e6('0x39')]===_0x47e6('0x3a')){var _0x455a19=encryptor[_0x47e6('0x3b')](_0xcca909[_0x47e6('0x3c')]);_0xcca909['data3']=maskClientSecret(_0x455a19);}return _0xcca909;});return _0x1d5023;})['then'](respondWithFilteredResult(_0x2f215d,_0x102376))['catch'](handleError(_0x2f215d,null));};exports[_0x47e6('0x3d')]=function(_0x427938,_0x1fbf66){var _0x47e2e2={'raw':!![],'where':{'id':_0x427938[_0x47e6('0x3e')]['id']}},_0x210a93={};_0x210a93[_0x47e6('0x23')]=_[_0x47e6('0x3f')](db[_0x47e6('0x1f')]['rawAttributes']);_0x210a93['query']=_['keys'](_0x427938[_0x47e6('0x24')]);_0x210a93[_0x47e6('0x25')]=_[_0x47e6('0x26')](_0x210a93[_0x47e6('0x23')],_0x210a93[_0x47e6('0x24')]);_0x47e2e2[_0x47e6('0x27')]=_[_0x47e6('0x26')](_0x210a93[_0x47e6('0x23')],qs[_0x47e6('0x28')](_0x427938[_0x47e6('0x24')][_0x47e6('0x28')]));_0x47e2e2[_0x47e6('0x27')]=_0x47e2e2[_0x47e6('0x27')]['length']?_0x47e2e2['attributes']:_0x210a93[_0x47e6('0x23')];if(_0x427938[_0x47e6('0x24')][_0x47e6('0x35')]){_0x47e2e2[_0x47e6('0x36')]=[{'all':!![]}];}_0x47e2e2=_[_0x47e6('0x31')]({},_0x47e2e2,_0x427938['options']);return db[_0x47e6('0x1f')][_0x47e6('0x40')](_0x47e2e2)[_0x47e6('0x17')](handleEntityNotFound(_0x1fbf66,null))['then'](function(_0x50cb43){if(_0x50cb43[_0x47e6('0x39')]===_0x47e6('0x3a')){var _0x241871=encryptor[_0x47e6('0x3b')](_0x50cb43[_0x47e6('0x3c')]);_0x50cb43['data3']=maskClientSecret(_0x241871);}return _0x50cb43;})[_0x47e6('0x17')](respondWithResult(_0x1fbf66,null))[_0x47e6('0x41')](handleError(_0x1fbf66,null));};exports[_0x47e6('0x42')]=function(_0x53672b,_0x3f7224){if(!_0x53672b[_0x47e6('0x43')][_0x47e6('0x1b')])throw new Error(_0x47e6('0x44'));if(!_0x53672b[_0x47e6('0x43')][_0x47e6('0x39')])throw new Error(_0x47e6('0x45'));var _0x13a507=db[_0x47e6('0x1f')][_0x47e6('0x20')][_0x47e6('0x39')][_0x47e6('0x46')];if(!_0x13a507[_0x47e6('0x47')](_0x53672b[_0x47e6('0x43')][_0x47e6('0x39')]))throw new Error(_0x47e6('0x48')+_0x13a507[_0x47e6('0x49')](',\x20'));if(_0x53672b[_0x47e6('0x43')][_0x47e6('0x39')]==='MicrosoftAzure'&&_0x53672b[_0x47e6('0x43')][_0x47e6('0x3c')]){_0x53672b[_0x47e6('0x43')]['data3']=encryptor[_0x47e6('0x4a')](_0x53672b[_0x47e6('0x43')][_0x47e6('0x3c')]);}return db[_0x47e6('0x1f')][_0x47e6('0x42')](_0x53672b[_0x47e6('0x43')],{})['then'](respondWithResult(_0x3f7224,0xc9))['catch'](handleError(_0x3f7224,null));};exports[_0x47e6('0x4b')]=function(_0x1b7b7f,_0x4f5b0c){if(_0x1b7b7f[_0x47e6('0x43')]['id']){delete _0x1b7b7f[_0x47e6('0x43')]['id'];}return db['CloudProvider'][_0x47e6('0x40')]({'where':{'id':_0x1b7b7f[_0x47e6('0x3e')]['id']}})[_0x47e6('0x17')](handleEntityNotFound(_0x4f5b0c,null))[_0x47e6('0x17')](function(_0x139443){if(_0x139443[_0x47e6('0x39')]==='MicrosoftAzure'&&_0x1b7b7f[_0x47e6('0x43')][_0x47e6('0x3c')]){_0x1b7b7f['body'][_0x47e6('0x3c')]=encryptor[_0x47e6('0x4a')](_0x1b7b7f[_0x47e6('0x43')]['data3']);}return _0x139443;})[_0x47e6('0x17')](saveUpdates(_0x1b7b7f[_0x47e6('0x43')],null))[_0x47e6('0x17')](respondWithResult(_0x4f5b0c,null))[_0x47e6('0x41')](handleError(_0x4f5b0c,null));};exports['destroy']=function(_0xa4b3a0,_0x5ba403){return db[_0x47e6('0x1f')][_0x47e6('0x40')]({'where':{'id':_0xa4b3a0['params']['id']}})[_0x47e6('0x17')](handleEntityNotFound(_0x5ba403,null))[_0x47e6('0x17')](removeEntity(_0x5ba403,null))[_0x47e6('0x41')](handleError(_0x5ba403,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2e59de,_0x41594d){return db[_0x47e6('0x1f')][_0x47e6('0x4c')]({'where':{'id':_0x2e59de[_0x47e6('0x3e')]['id']},'raw':!![]})[_0x47e6('0x17')](function(_0x1f23a){if(!_0x1f23a)return _0x41594d['sendStatus'](0x194);return{'url':oauth[_0x47e6('0x4d')](_0x1f23a,_0x2e59de[_0x47e6('0x4e')]['id'])};})['then'](respondWithResult(_0x41594d,null))[_0x47e6('0x41')](handleError(_0x41594d,null));};exports[_0x47e6('0x4f')]=function(_0x51333e,_0x16adfe){var _0x5a8a39=_0x51333e[_0x47e6('0x43')];var _0x9f5936;var _0x2ad858;if(_0x5a8a39['error'])throw _0x5a8a39;redis['get'](_0x5a8a39['state'])[_0x47e6('0x17')](function(_0x521438){if(!_0x521438)throw new Error(_0x47e6('0x50'));_0x9f5936=JSON[_0x47e6('0x51')](_0x521438);var _0x594b8f=Buffer[_0x47e6('0x52')](_0x5a8a39[_0x47e6('0x53')],_0x47e6('0x54'))[_0x47e6('0x55')](_0x47e6('0x56'));_0x2ad858=JSON[_0x47e6('0x51')](_0x594b8f);if(!oauth[_0x47e6('0x57')](_0x5a8a39[_0x47e6('0x58')],_0x9f5936[_0x47e6('0x59')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x47e6('0x5a')](_0x5a8a39['state']);return oauth[_0x47e6('0x5b')](_0x5a8a39[_0x47e6('0x5c')],_0x9f5936);})[_0x47e6('0x17')](function(_0x425a32){_0x9f5936[_0x47e6('0x5d')]=_0x425a32['access_token'];_0x9f5936[_0x47e6('0x5e')]=_0x425a32['refresh_token'];return db[_0x47e6('0x1f')][_0x47e6('0x4b')]({'data5':_0x9f5936['data5'],'data6':_0x9f5936[_0x47e6('0x5e')]},{'where':{'id':_0x9f5936['id']}});})[_0x47e6('0x17')](function(){oauth[_0x47e6('0x5f')](_0x9f5936);socket[_0x47e6('0x60')](_0x47e6('0x61'),{'id':_0x2ad858['id']});return;})[_0x47e6('0x17')](respondWithStatusCode(_0x16adfe,null))['catch'](function(_0x26c537){if(_0x2ad858){socket['emit'](_0x47e6('0x62'),{'id':_0x2ad858['id']});}if(!_0x9f5936){logger[_0x47e6('0x19')](_0x47e6('0x63'),_0x26c537);return _0x16adfe['status'](0x1f4)[_0x47e6('0x64')](_0x26c537[_0x47e6('0x65')]);}logger['error'](_0x47e6('0x66'),_0x9f5936['id'],JSON['stringify'](_0x26c537));});};
\ No newline at end of file
+var _0x2890=['MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','rawAttributes','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','update','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','fieldName','type','query','filters','model','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','service','decryptString','data3','catch','show','params','keys','find'];(function(_0x26eead,_0x821bc8){var _0x24e4ac=function(_0x51b4b1){while(--_0x51b4b1){_0x26eead['push'](_0x26eead['shift']());}};_0x24e4ac(++_0x821bc8);}(_0x2890,0x89));var _0x0289=function(_0x44f138,_0x446372){_0x44f138=_0x44f138-0x0;var _0x228099=_0x2890[_0x44f138];return _0x228099;};'use strict';var _=require(_0x0289('0x0'));var Redis=require(_0x0289('0x1'));var qs=require(_0x0289('0x2'));var encryptor=require(_0x0289('0x3'));var config=require('../../config/environment');var logger=require(_0x0289('0x4'))('api');var db=require('../../mysqldb')['db'];var oauth=require(_0x0289('0x5'));config['redis']=_[_0x0289('0x6')](config[_0x0289('0x7')],{'host':_0x0289('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0289('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5232f1,_0x120887){_0x120887=_0x120887||0xcc;return function(_0x5c5bad){if(_0x5c5bad){return _0x5232f1[_0x0289('0x9')](_0x120887);}return _0x5232f1[_0x0289('0xa')](_0x120887)[_0x0289('0xb')]();};}function respondWithResult(_0x294f99,_0x560c8f){_0x560c8f=_0x560c8f||0xc8;return function(_0x5538e0){if(_0x5538e0){return _0x294f99[_0x0289('0xa')](_0x560c8f)[_0x0289('0xc')](_0x5538e0);}};}function respondWithFilteredResult(_0x303c15,_0x2320af){return function(_0x2be719){if(_0x2be719){var _0x55b224=typeof _0x2320af[_0x0289('0xd')]===_0x0289('0xe')&&typeof _0x2320af['limit']==='undefined';var _0x390f73=_0x2be719[_0x0289('0xf')];var _0x314610=_0x55b224?0x0:_0x2320af['offset'];var _0x540a9f=_0x55b224?_0x2be719[_0x0289('0xf')]:_0x2320af[_0x0289('0xd')]+_0x2320af[_0x0289('0x10')];var _0x38da5e;if(_0x540a9f>=_0x390f73){_0x540a9f=_0x390f73;_0x38da5e=0xc8;}else{_0x38da5e=0xce;}_0x303c15[_0x0289('0xa')](_0x38da5e);return _0x303c15[_0x0289('0x11')](_0x0289('0x12'),_0x314610+'-'+_0x540a9f+'/'+_0x390f73)['json'](_0x2be719);}return null;};}function saveUpdates(_0x49ca6f){return function(_0x47b3cd){if(_0x47b3cd){return _0x47b3cd['update'](_0x49ca6f)[_0x0289('0x13')](function(_0x55c711){return _0x55c711;});}return null;};}function removeEntity(_0xec6583){return function(_0x40b5d7){if(_0x40b5d7){return _0x40b5d7[_0x0289('0x14')]()[_0x0289('0x13')](function(){_0xec6583[_0x0289('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e6d7b){return function(_0x54045e){if(!_0x54045e){_0x3e6d7b[_0x0289('0x9')](0x194);}return _0x54045e;};}function handleError(_0x3f5769,_0x2df0e7){_0x2df0e7=_0x2df0e7||0x1f4;return function(_0x21705b){logger[_0x0289('0x15')](_0x21705b[_0x0289('0x16')]);if(_0x21705b[_0x0289('0x17')]){delete _0x21705b[_0x0289('0x17')];}_0x3f5769[_0x0289('0xa')](_0x2df0e7)[_0x0289('0x18')](_0x21705b);};}function maskClientSecret(_0x11c821){return _[_0x0289('0x19')](_0x11c821[_0x0289('0x1a')](0x0,0x3),0x14,'*');}exports[_0x0289('0x1b')]=function(_0x1b4ab5,_0x4b7f34){var _0x201be0={},_0x1d6b18={},_0x1dc2d7={'count':0x0,'rows':[]};var _0x16e3eb=_[_0x0289('0x1c')](db[_0x0289('0x1d')]['rawAttributes'],function(_0x5e576f){return{'name':_0x5e576f[_0x0289('0x1e')],'type':_0x5e576f[_0x0289('0x1f')]['key']};});_0x1d6b18['model']=_[_0x0289('0x1c')](_0x16e3eb,'name');_0x1d6b18[_0x0289('0x20')]=_['keys'](_0x1b4ab5[_0x0289('0x20')]);_0x1d6b18[_0x0289('0x21')]=_['intersection'](_0x1d6b18[_0x0289('0x22')],_0x1d6b18[_0x0289('0x20')]);_0x201be0[_0x0289('0x23')]=_['intersection'](_0x1d6b18[_0x0289('0x22')],qs[_0x0289('0x24')](_0x1b4ab5[_0x0289('0x20')][_0x0289('0x24')]));_0x201be0[_0x0289('0x23')]=_0x201be0[_0x0289('0x23')][_0x0289('0x25')]?_0x201be0['attributes']:_0x1d6b18['model'];if(!_0x1b4ab5[_0x0289('0x20')]['hasOwnProperty']('nolimit')){_0x201be0[_0x0289('0x10')]=qs[_0x0289('0x10')](_0x1b4ab5['query'][_0x0289('0x10')]);_0x201be0[_0x0289('0xd')]=qs[_0x0289('0xd')](_0x1b4ab5[_0x0289('0x20')]['offset']);}_0x201be0['order']=qs[_0x0289('0x26')](_0x1b4ab5[_0x0289('0x20')][_0x0289('0x26')]);_0x201be0[_0x0289('0x27')]=qs[_0x0289('0x21')](_['pick'](_0x1b4ab5[_0x0289('0x20')],_0x1d6b18['filters']),_0x16e3eb);if(_0x1b4ab5['query'][_0x0289('0x28')]){_0x201be0[_0x0289('0x27')]=_[_0x0289('0x29')](_0x201be0['where'],{'$or':_['map'](_0x16e3eb,function(_0x403781){if(_0x403781[_0x0289('0x1f')]!==_0x0289('0x2a')){var _0x1c80e1={};_0x1c80e1[_0x403781[_0x0289('0x17')]]={'$like':'%'+_0x1b4ab5[_0x0289('0x20')][_0x0289('0x28')]+'%'};return _0x1c80e1;}})});}_0x201be0=_['merge']({},_0x201be0,_0x1b4ab5[_0x0289('0x2b')]);var _0x33d0a5={'where':_0x201be0['where']};return db[_0x0289('0x1d')][_0x0289('0xf')](_0x33d0a5)[_0x0289('0x13')](function(_0x2a6620){_0x1dc2d7[_0x0289('0xf')]=_0x2a6620;if(_0x1b4ab5['query'][_0x0289('0x2c')]){_0x201be0[_0x0289('0x2d')]=[{'all':!![]}];}return db['CloudProvider'][_0x0289('0x2e')](_0x201be0);})[_0x0289('0x13')](function(_0x74cebf){_0x1dc2d7['rows']=_[_0x0289('0x1c')](_0x74cebf,function(_0x6f9ba4){if(_0x6f9ba4[_0x0289('0x2f')]==='MicrosoftAzure'){var _0x34c57e=encryptor[_0x0289('0x30')](_0x6f9ba4['data3']);_0x6f9ba4[_0x0289('0x31')]=maskClientSecret(_0x34c57e);}return _0x6f9ba4;});return _0x1dc2d7;})[_0x0289('0x13')](respondWithFilteredResult(_0x4b7f34,_0x201be0))[_0x0289('0x32')](handleError(_0x4b7f34,null));};exports[_0x0289('0x33')]=function(_0x3f4899,_0x5202f1){var _0x2ac35f={'raw':!![],'where':{'id':_0x3f4899[_0x0289('0x34')]['id']}},_0x582267={};_0x582267[_0x0289('0x22')]=_['keys'](db[_0x0289('0x1d')]['rawAttributes']);_0x582267[_0x0289('0x20')]=_[_0x0289('0x35')](_0x3f4899['query']);_0x582267[_0x0289('0x21')]=_['intersection'](_0x582267[_0x0289('0x22')],_0x582267['query']);_0x2ac35f['attributes']=_['intersection'](_0x582267[_0x0289('0x22')],qs[_0x0289('0x24')](_0x3f4899[_0x0289('0x20')][_0x0289('0x24')]));_0x2ac35f['attributes']=_0x2ac35f[_0x0289('0x23')][_0x0289('0x25')]?_0x2ac35f[_0x0289('0x23')]:_0x582267[_0x0289('0x22')];if(_0x3f4899[_0x0289('0x20')][_0x0289('0x2c')]){_0x2ac35f[_0x0289('0x2d')]=[{'all':!![]}];}_0x2ac35f=_[_0x0289('0x29')]({},_0x2ac35f,_0x3f4899[_0x0289('0x2b')]);return db['CloudProvider'][_0x0289('0x36')](_0x2ac35f)[_0x0289('0x13')](handleEntityNotFound(_0x5202f1,null))['then'](function(_0x744c2b){if(_0x744c2b[_0x0289('0x2f')]===_0x0289('0x37')){var _0x4fd8ce=encryptor[_0x0289('0x30')](_0x744c2b['data3']);_0x744c2b['data3']=maskClientSecret(_0x4fd8ce);}return _0x744c2b;})[_0x0289('0x13')](respondWithResult(_0x5202f1,null))[_0x0289('0x32')](handleError(_0x5202f1,null));};exports[_0x0289('0x38')]=function(_0x1ebaa6,_0x27a236){if(!_0x1ebaa6[_0x0289('0x39')]['name'])throw new Error(_0x0289('0x3a'));if(!_0x1ebaa6['body'][_0x0289('0x2f')])throw new Error(_0x0289('0x3b'));var _0xcc5425=db[_0x0289('0x1d')][_0x0289('0x3c')][_0x0289('0x2f')][_0x0289('0x3d')];if(!_0xcc5425[_0x0289('0x3e')](_0x1ebaa6['body'][_0x0289('0x2f')]))throw new Error(_0x0289('0x3f')+_0xcc5425[_0x0289('0x40')](',\x20'));if(_0x1ebaa6[_0x0289('0x39')][_0x0289('0x2f')]==='MicrosoftAzure'&&_0x1ebaa6['body'][_0x0289('0x31')]){_0x1ebaa6[_0x0289('0x39')][_0x0289('0x31')]=encryptor[_0x0289('0x41')](_0x1ebaa6[_0x0289('0x39')]['data3']);}return db[_0x0289('0x1d')][_0x0289('0x38')](_0x1ebaa6[_0x0289('0x39')],{})[_0x0289('0x13')](respondWithResult(_0x27a236,0xc9))[_0x0289('0x32')](handleError(_0x27a236,null));};exports['update']=function(_0x5bbd11,_0x4b818b){if(_0x5bbd11['body']['id']){delete _0x5bbd11[_0x0289('0x39')]['id'];}return db['CloudProvider'][_0x0289('0x36')]({'where':{'id':_0x5bbd11['params']['id']}})[_0x0289('0x13')](handleEntityNotFound(_0x4b818b,null))['then'](function(_0x41d125){if(_0x41d125[_0x0289('0x2f')]===_0x0289('0x37')&&_0x5bbd11[_0x0289('0x39')][_0x0289('0x31')]){_0x5bbd11[_0x0289('0x39')][_0x0289('0x31')]=encryptor[_0x0289('0x41')](_0x5bbd11[_0x0289('0x39')][_0x0289('0x31')]);}return _0x41d125;})[_0x0289('0x13')](saveUpdates(_0x5bbd11[_0x0289('0x39')],null))[_0x0289('0x13')](respondWithResult(_0x4b818b,null))['catch'](handleError(_0x4b818b,null));};exports[_0x0289('0x14')]=function(_0x54cd00,_0x3f9f85){return db[_0x0289('0x1d')][_0x0289('0x36')]({'where':{'id':_0x54cd00[_0x0289('0x34')]['id']}})[_0x0289('0x13')](handleEntityNotFound(_0x3f9f85,null))[_0x0289('0x13')](removeEntity(_0x3f9f85,null))[_0x0289('0x32')](handleError(_0x3f9f85,null));};exports[_0x0289('0x42')]=function(_0x575e11,_0x59e968){return db['CloudProvider'][_0x0289('0x43')]({'where':{'id':_0x575e11[_0x0289('0x34')]['id']},'raw':!![]})[_0x0289('0x13')](function(_0x5292e5){if(!_0x5292e5)return _0x59e968[_0x0289('0x9')](0x194);return{'url':oauth[_0x0289('0x44')](_0x5292e5,_0x575e11[_0x0289('0x45')]['id'])};})[_0x0289('0x13')](respondWithResult(_0x59e968,null))[_0x0289('0x32')](handleError(_0x59e968,null));};exports[_0x0289('0x46')]=function(_0x4a40ab,_0x9f63fc){var _0x5289db=_0x4a40ab['body'];var _0x16ead7;var _0x6f12bb;if(_0x5289db[_0x0289('0x15')])throw _0x5289db;redis[_0x0289('0x47')](_0x5289db[_0x0289('0x48')])[_0x0289('0x13')](function(_0xfee872){if(!_0xfee872)throw new Error(_0x0289('0x49'));_0x16ead7=JSON[_0x0289('0x4a')](_0xfee872);var _0x487e61=Buffer[_0x0289('0x4b')](_0x5289db[_0x0289('0x48')],_0x0289('0x4c'))[_0x0289('0x4d')](_0x0289('0x4e'));_0x6f12bb=JSON[_0x0289('0x4a')](_0x487e61);if(!oauth[_0x0289('0x4f')](_0x5289db['id_token'],_0x16ead7[_0x0289('0x50')]))throw new Error(_0x0289('0x51'));redis[_0x0289('0x52')](_0x5289db[_0x0289('0x48')]);return oauth['getOauth2MicrosoftAccessToken'](_0x5289db[_0x0289('0x53')],_0x16ead7);})[_0x0289('0x13')](function(_0x23d903){_0x16ead7[_0x0289('0x54')]=_0x23d903[_0x0289('0x55')];_0x16ead7[_0x0289('0x56')]=_0x23d903[_0x0289('0x57')];return db['CloudProvider'][_0x0289('0x58')]({'data5':_0x16ead7[_0x0289('0x54')],'data6':_0x16ead7['data6']},{'where':{'id':_0x16ead7['id']}});})[_0x0289('0x13')](function(){oauth[_0x0289('0x59')](_0x16ead7);socket[_0x0289('0x5a')](_0x0289('0x5b'),{'id':_0x6f12bb['id']});return;})['then'](respondWithStatusCode(_0x9f63fc,null))[_0x0289('0x32')](function(_0x5c11ee){if(_0x6f12bb){socket['emit']('microsoftAuthorization:error',{'id':_0x6f12bb['id']});}if(!_0x16ead7){logger[_0x0289('0x15')](_0x0289('0x5c'),_0x5c11ee);return _0x9f63fc[_0x0289('0xa')](0x1f4)[_0x0289('0x18')](_0x5c11ee[_0x0289('0x5d')]);}logger['error'](_0x0289('0x5e'),_0x16ead7['id'],JSON[_0x0289('0x5f')](_0x5c11ee));});};
\ No newline at end of file
index 33b5219..2333ec2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf90b=['CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','path','../../config/environment','./cloudProvider.attributes'];(function(_0x3c53bf,_0x43f522){var _0x55ebb6=function(_0x5a73ec){while(--_0x5a73ec){_0x3c53bf['push'](_0x3c53bf['shift']());}};_0x55ebb6(++_0x43f522);}(_0xf90b,0x13d));var _0xbf90=function(_0x38dbfe,_0x28b6a0){_0x38dbfe=_0x38dbfe-0x0;var _0x4c7f63=_0xf90b[_0x38dbfe];return _0x4c7f63;};'use strict';var _=require(_0xbf90('0x0'));var util=require('util');var logger=require(_0xbf90('0x1'))(_0xbf90('0x2'));var moment=require('moment');var BPromise=require(_0xbf90('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf90('0x4'));var rimraf=require('rimraf');var config=require(_0xbf90('0x5'));var attributes=require(_0xbf90('0x6'));module['exports']=function(_0x38102c,_0x590d2d){return _0x38102c['define'](_0xbf90('0x7'),attributes,{'tableName':_0xbf90('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x50cb=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash','../../config/logger','bluebird'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0x50cb,0x197));var _0xb50c=function(_0x3f8535,_0x1db959){_0x3f8535=_0x3f8535-0x0;var _0x28cc80=_0x50cb[_0x3f8535];return _0x28cc80;};'use strict';var _=require(_0xb50c('0x0'));var util=require('util');var logger=require(_0xb50c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb50c('0x2'));var rp=require(_0xb50c('0x3'));var fs=require('fs');var path=require(_0xb50c('0x4'));var rimraf=require(_0xb50c('0x5'));var config=require(_0xb50c('0x6'));var attributes=require(_0xb50c('0x7'));module[_0xb50c('0x8')]=function(_0x330777,_0x35def3){return _0x330777['define']('CloudProvider',attributes,{'tableName':_0xb50c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0f5504e..9e41b36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c4f=['POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','bind','intervals','findAll','map','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','jsonwebtoken','moment','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','push','data7','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','Dynamics365','/.default','replace','{TENANT_ID}','data2','code','id_token','base64','hex','client_id','data1','response_type','redirect_uri','form_post','state','nonce','prompt','key','value','oauth2/','set','stringify','decode','payload','iss','issuer','aud','audience','unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','data4','decryptString'];(function(_0x31d329,_0x2a8219){var _0x10f281=function(_0x14ff35){while(--_0x14ff35){_0x31d329['push'](_0x31d329['shift']());}};_0x10f281(++_0x2a8219);}(_0x5c4f,0xff));var _0xf5c4=function(_0x1a4519,_0x292f84){_0x1a4519=_0x1a4519-0x0;var _0x1c0bbd=_0x5c4f[_0x1a4519];return _0x1c0bbd;};'use strict';var _=require(_0xf5c4('0x0'));var crypto=require('crypto');var jwt=require(_0xf5c4('0x1'));var moment=require(_0xf5c4('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0xf5c4('0x3'));var encryptor=require(_0xf5c4('0x4'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xf5c4('0x5'));var schedule=require(_0xf5c4('0x6'));var db=require(_0xf5c4('0x7'))['db'];config['redis']=_[_0xf5c4('0x8')](config[_0xf5c4('0x9')],{'host':_0xf5c4('0xa'),'port':0x18eb});var redis=new Redis(config[_0xf5c4('0x9')]);var MICROSOFT_AUTH_URL=_0xf5c4('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf5c4('0xc'),_0xf5c4('0xd'),_0xf5c4('0xe'),_0xf5c4('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xf5c4('0x10'),_0xf5c4('0x11')],'Dynamics365':[_0xf5c4('0xc'),_0xf5c4('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xf5c4('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xf5c4('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x24e87b){var _0x35bf33=_['map'](AZURE_AUTH_SCOPES[_0x24e87b[_0xf5c4('0x14')]]);if(_0x24e87b['type']==='Dynamics365')_0x35bf33[_0xf5c4('0x15')](_0x24e87b[_0xf5c4('0x16')]+'/.default');return _0x35bf33[_0xf5c4('0x17')]('\x20');}function getAccessTokenScope(_0x438e09){if(_0x438e09['type']===_0xf5c4('0x18'))return _0xf5c4('0x19');if(_0x438e09[_0xf5c4('0x14')]===_0xf5c4('0x1a'))return _0x438e09[_0xf5c4('0x16')]+_0xf5c4('0x1b');}function generateMicrosoftAuthorizationUrl(_0x2ea7a6,_0x344a66){var _0xd12c92=MICROSOFT_AUTH_URL[_0xf5c4('0x1c')](_0xf5c4('0x1d'),_0x2ea7a6[_0xf5c4('0x1e')]);var _0x41460c=[_0xf5c4('0x1f'),_0xf5c4('0x20')];var _0x5acd91=Buffer['from'](JSON['stringify']({'id':_0x344a66}))['toString'](_0xf5c4('0x21'));var _0x42c306=crypto['randomBytes'](0x10)['toString'](_0xf5c4('0x22'));var _0x35b6a9=getAuthorizationScopes(_0x2ea7a6);var _0x5db87a=[{'key':_0xf5c4('0x23'),'value':_0x2ea7a6[_0xf5c4('0x24')]},{'key':_0xf5c4('0x25'),'value':encodeURIComponent(_0x41460c[_0xf5c4('0x17')]('\x20'))},{'key':_0xf5c4('0x26'),'value':_0x2ea7a6['data4']},{'key':'response_mode','value':_0xf5c4('0x27')},{'key':'scope','value':encodeURIComponent(_0x35b6a9)},{'key':_0xf5c4('0x28'),'value':_0x5acd91},{'key':_0xf5c4('0x29'),'value':_0x42c306},{'key':_0xf5c4('0x2a'),'value':'login'}];var _0x5b6427=_0xd12c92+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x5db87a,function(_0xf9db2d){return _0xf9db2d[_0xf5c4('0x2b')]+'='+_0xf9db2d[_0xf5c4('0x2c')];})[_0xf5c4('0x17')]('&');_0x2ea7a6['oauth2Claims']={'issuer':_0xd12c92['replace'](_0xf5c4('0x2d'),''),'audience':_0x2ea7a6[_0xf5c4('0x24')],'state':_0x5acd91,'nonce':_0x42c306};redis[_0xf5c4('0x2e')](_0x5acd91,JSON[_0xf5c4('0x2f')](_0x2ea7a6));return _0x5b6427;}function isValidIdToken(_0x1740e,_0xcd175f){try{var _0x1dd677=jwt[_0xf5c4('0x30')](_0x1740e,{'complete':!![]});var _0x5cbab0=_0x1dd677[_0xf5c4('0x31')];if(_0x5cbab0[_0xf5c4('0x32')]!==_0xcd175f[_0xf5c4('0x33')])return![];if(_0x5cbab0[_0xf5c4('0x34')]!==_0xcd175f[_0xf5c4('0x35')])return![];if(_0x5cbab0[_0xf5c4('0x29')]!==_0xcd175f[_0xf5c4('0x29')])return![];if(moment()['isAfter'](moment[_0xf5c4('0x36')](_0x5cbab0[_0xf5c4('0x37')])))return![];return!![];}catch(_0x516ea9){throw _0x516ea9;}}function refreshOauth2MicrosoftAccessToken(_0x6f32fa){return Promise[_0xf5c4('0x38')]()['then'](function(){if(_0x6f32fa[_0xf5c4('0x39')])return _0x6f32fa;return db[_0xf5c4('0x3a')][_0xf5c4('0x3b')]({'where':{'id':_0x6f32fa['id']},'raw':!![]});})[_0xf5c4('0x3c')](function(_0xabd8c9){var _0x86a110={'grant_type':_0xf5c4('0x3d'),'refresh_token':_0xabd8c9[_0xf5c4('0x3e')],'scope':getAccessTokenScope(_0xabd8c9),'redirect_uri':_0xabd8c9[_0xf5c4('0x3f')],'client_id':_0xabd8c9[_0xf5c4('0x24')],'client_secret':encryptor[_0xf5c4('0x40')](_0xabd8c9[_0xf5c4('0x39')])};var _0x313daf={'method':_0xf5c4('0x41'),'uri':MICROSOFT_AUTH_URL[_0xf5c4('0x1c')]('{TENANT_ID}',_0xabd8c9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x86a110,'json':!![]};return rp(_0x313daf);})['then'](function(_0x34e69e){_0x6f32fa[_0xf5c4('0x42')]=_0x34e69e[_0xf5c4('0x43')];_0x6f32fa[_0xf5c4('0x3e')]=_0x34e69e[_0xf5c4('0x3d')];return db[_0xf5c4('0x3a')][_0xf5c4('0x44')]({'data5':_0x6f32fa['data5'],'data6':_0x6f32fa[_0xf5c4('0x3e')]},{'where':{'id':_0x6f32fa['id']}});})['then'](function(){return _0x6f32fa;})[_0xf5c4('0x45')](function(_0x486512){logger[_0xf5c4('0x46')](_0xf5c4('0x47'),_0x6f32fa['id'],_0x486512);});}function getOauth2MicrosoftAccessToken(_0x2ed8a4,_0x2b2125){var _0x412c23={'grant_type':_0xf5c4('0x48'),'code':_0x2ed8a4,'scope':getAccessTokenScope(_0x2b2125),'redirect_uri':_0x2b2125[_0xf5c4('0x3f')],'client_id':_0x2b2125['data1'],'client_secret':encryptor[_0xf5c4('0x40')](_0x2b2125[_0xf5c4('0x39')])};var _0x84dae7={'method':_0xf5c4('0x41'),'uri':MICROSOFT_AUTH_URL[_0xf5c4('0x1c')]('{TENANT_ID}',_0x2b2125[_0xf5c4('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x412c23,'json':!![]};return rp(_0x84dae7);}function startRefreshInterval(_0x330c07){var _0xbdd54f=schedule['intervals'];if(_0xbdd54f[_0x330c07['id']])clearInterval(_0xbdd54f[_0x330c07['id']]);_0xbdd54f[_0x330c07['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf5c4('0x49')](this,{'id':_0x330c07['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf5c4('0x4a')]=_0xbdd54f;}function startAllRefreshIntervals(){return db[_0xf5c4('0x3a')][_0xf5c4('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf5c4('0x3c')](function(_0x49111f){var _0x3e25c8=_0x49111f[_0xf5c4('0x4c')](function(_0x5358c0){return refreshOauth2MicrosoftAccessToken(_0x5358c0)[_0xf5c4('0x3c')](function(_0x164e85){startRefreshInterval(_0x164e85);});});return Promise[_0xf5c4('0x4d')](_0x3e25c8);})[_0xf5c4('0x45')](function(_0x2a5d63){var _0x4aae75=_0x2a5d63?util[_0xf5c4('0x4e')](_0x2a5d63,{'showHidden':![],'depth':null}):'';logger[_0xf5c4('0x46')](_0xf5c4('0x4f'),_0x4aae75);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x9ea0=['request-promise','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','toString','base64','hex','client_id','data1','response_type','data4','response_mode','form_post','scope','state','nonce','login','key','value','set','decode','payload','issuer','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','data6','access_token','refresh_token','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','POST','intervals','bind','map','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','ioredis'];(function(_0xacb5d6,_0xfe015e){var _0x34cf8a=function(_0x5748ef){while(--_0x5748ef){_0xacb5d6['push'](_0xacb5d6['shift']());}};_0x34cf8a(++_0xfe015e);}(_0x9ea0,0xdb));var _0x09ea=function(_0xc988e4,_0x4e3b13){_0xc988e4=_0xc988e4-0x0;var _0x2c9d58=_0x9ea0[_0xc988e4];return _0x2c9d58;};'use strict';var _=require('lodash');var crypto=require(_0x09ea('0x0'));var jwt=require(_0x09ea('0x1'));var moment=require('moment');var Redis=require(_0x09ea('0x2'));var rp=require(_0x09ea('0x3'));var util=require('util');var encryptor=require(_0x09ea('0x4'));var config=require(_0x09ea('0x5'));var logger=require(_0x09ea('0x6'))('api');var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x09ea('0x7'))['db'];config['redis']=_['defaults'](config[_0x09ea('0x8')],{'host':_0x09ea('0x9'),'port':0x18eb});var redis=new Redis(config[_0x09ea('0x8')]);var MICROSOFT_AUTH_URL=_0x09ea('0xa');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x09ea('0xb'),_0x09ea('0xc'),_0x09ea('0xd'),_0x09ea('0xe'),_0x09ea('0xf'),_0x09ea('0x10')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x09ea('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x09ea('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x8b1db1){var _0x97a7f2=_['map'](AZURE_AUTH_SCOPES[_0x8b1db1[_0x09ea('0x13')]]);if(_0x8b1db1[_0x09ea('0x13')]===_0x09ea('0x14'))_0x97a7f2[_0x09ea('0x15')](_0x8b1db1[_0x09ea('0x16')]+_0x09ea('0x17'));return _0x97a7f2[_0x09ea('0x18')]('\x20');}function getAccessTokenScope(_0x27ea9b){if(_0x27ea9b[_0x09ea('0x13')]===_0x09ea('0x19'))return _0x09ea('0xe');if(_0x27ea9b[_0x09ea('0x13')]===_0x09ea('0x14'))return _0x27ea9b[_0x09ea('0x16')]+_0x09ea('0x17');}function generateMicrosoftAuthorizationUrl(_0x2b6504,_0x64be43){var _0x52928d=MICROSOFT_AUTH_URL[_0x09ea('0x1a')](_0x09ea('0x1b'),_0x2b6504[_0x09ea('0x1c')]);var _0x4f0c5c=[_0x09ea('0x1d'),'id_token'];var _0x2429cf=Buffer[_0x09ea('0x1e')](JSON[_0x09ea('0x1f')]({'id':_0x64be43}))[_0x09ea('0x20')](_0x09ea('0x21'));var _0x57a7c2=crypto['randomBytes'](0x10)[_0x09ea('0x20')](_0x09ea('0x22'));var _0x55b3b2=getAuthorizationScopes(_0x2b6504);var _0x88bcc8=[{'key':_0x09ea('0x23'),'value':_0x2b6504[_0x09ea('0x24')]},{'key':_0x09ea('0x25'),'value':encodeURIComponent(_0x4f0c5c[_0x09ea('0x18')]('\x20'))},{'key':'redirect_uri','value':_0x2b6504[_0x09ea('0x26')]},{'key':_0x09ea('0x27'),'value':_0x09ea('0x28')},{'key':_0x09ea('0x29'),'value':encodeURIComponent(_0x55b3b2)},{'key':_0x09ea('0x2a'),'value':_0x2429cf},{'key':_0x09ea('0x2b'),'value':_0x57a7c2},{'key':'prompt','value':_0x09ea('0x2c')}];var _0x41b832=_0x52928d+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x88bcc8,function(_0x4f89bd){return _0x4f89bd[_0x09ea('0x2d')]+'='+_0x4f89bd[_0x09ea('0x2e')];})['join']('&');_0x2b6504['oauth2Claims']={'issuer':_0x52928d[_0x09ea('0x1a')]('oauth2/',''),'audience':_0x2b6504['data1'],'state':_0x2429cf,'nonce':_0x57a7c2};redis[_0x09ea('0x2f')](_0x2429cf,JSON[_0x09ea('0x1f')](_0x2b6504));return _0x41b832;}function isValidIdToken(_0x31d3e3,_0x2be1f7){try{var _0x47bf06=jwt[_0x09ea('0x30')](_0x31d3e3,{'complete':!![]});var _0x559b37=_0x47bf06[_0x09ea('0x31')];if(_0x559b37['iss']!==_0x2be1f7[_0x09ea('0x32')])return![];if(_0x559b37['aud']!==_0x2be1f7[_0x09ea('0x33')])return![];if(_0x559b37[_0x09ea('0x2b')]!==_0x2be1f7[_0x09ea('0x2b')])return![];if(moment()[_0x09ea('0x34')](moment[_0x09ea('0x35')](_0x559b37['exp'])))return![];return!![];}catch(_0x52fbea){throw _0x52fbea;}}function refreshOauth2MicrosoftAccessToken(_0x1cc061){return Promise[_0x09ea('0x36')]()[_0x09ea('0x37')](function(){if(_0x1cc061[_0x09ea('0x38')])return _0x1cc061;return db[_0x09ea('0x39')][_0x09ea('0x3a')]({'where':{'id':_0x1cc061['id']},'raw':!![]});})[_0x09ea('0x37')](function(_0x8209a){var _0x186f0c={'grant_type':'refresh_token','refresh_token':_0x8209a[_0x09ea('0x3b')],'scope':getAccessTokenScope(_0x8209a),'redirect_uri':_0x8209a[_0x09ea('0x26')],'client_id':_0x8209a[_0x09ea('0x24')],'client_secret':encryptor['decryptString'](_0x8209a['data3'])};var _0x37188f={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x09ea('0x1a')](_0x09ea('0x1b'),_0x8209a[_0x09ea('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x186f0c,'json':!![]};return rp(_0x37188f);})[_0x09ea('0x37')](function(_0x1f2039){_0x1cc061['data5']=_0x1f2039[_0x09ea('0x3c')];_0x1cc061[_0x09ea('0x3b')]=_0x1f2039[_0x09ea('0x3d')];return db[_0x09ea('0x39')]['update']({'data5':_0x1cc061['data5'],'data6':_0x1cc061['data6']},{'where':{'id':_0x1cc061['id']}});})[_0x09ea('0x37')](function(){return _0x1cc061;})[_0x09ea('0x3e')](function(_0x389682){logger['error'](_0x09ea('0x3f'),_0x1cc061['id'],_0x389682);});}function getOauth2MicrosoftAccessToken(_0x31d8cb,_0x354ec3){var _0x4ef458={'grant_type':_0x09ea('0x40'),'code':_0x31d8cb,'scope':getAccessTokenScope(_0x354ec3),'redirect_uri':_0x354ec3[_0x09ea('0x26')],'client_id':_0x354ec3[_0x09ea('0x24')],'client_secret':encryptor[_0x09ea('0x41')](_0x354ec3['data3'])};var _0xedd218={'method':_0x09ea('0x42'),'uri':MICROSOFT_AUTH_URL[_0x09ea('0x1a')](_0x09ea('0x1b'),_0x354ec3[_0x09ea('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4ef458,'json':!![]};return rp(_0xedd218);}function startRefreshInterval(_0x969f8b){var _0x24eb6e=schedule[_0x09ea('0x43')];if(_0x24eb6e[_0x969f8b['id']])clearInterval(_0x24eb6e[_0x969f8b['id']]);_0x24eb6e[_0x969f8b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x09ea('0x44')](this,{'id':_0x969f8b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x09ea('0x43')]=_0x24eb6e;}function startAllRefreshIntervals(){return db[_0x09ea('0x39')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x09ea('0x37')](function(_0x2d794b){var _0x9e1bff=_0x2d794b[_0x09ea('0x45')](function(_0x533721){return refreshOauth2MicrosoftAccessToken(_0x533721)['then'](function(_0x51de49){startRefreshInterval(_0x51de49);});});return Promise[_0x09ea('0x46')](_0x9e1bff);})[_0x09ea('0x3e')](function(_0x4370a0){var _0x6b5274=_0x4370a0?util[_0x09ea('0x47')](_0x4370a0,{'showHidden':![],'depth':null}):'';logger['error'](_0x09ea('0x48'),_0x6b5274);});}module[_0x09ea('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index 56385c4..7e62c48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ab9=['jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x44830a,_0x30341e){var _0x54c409=function(_0x126905){while(--_0x126905){_0x44830a['push'](_0x44830a['shift']());}};_0x54c409(++_0x30341e);}(_0x6ab9,0x19a));var _0x96ab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6ab9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x96ab('0x0'));var util=require(_0x96ab('0x1'));var moment=require('moment');var BPromise=require(_0x96ab('0x2'));var rs=require(_0x96ab('0x3'));var fs=require('fs');var Redis=require(_0x96ab('0x4'));var db=require(_0x96ab('0x5'))['db'];var utils=require(_0x96ab('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x96ab('0x7'));var jayson=require(_0x96ab('0x8'));var client=jayson[_0x96ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d2a35,_0xf8e2b1,_0x516cf7){return new BPromise(function(_0x313efb,_0x1e3f17){return client[_0x96ab('0xa')](_0x3d2a35,_0x516cf7)[_0x96ab('0xb')](function(_0x39b50e){logger[_0x96ab('0xc')](_0x96ab('0xd'),_0xf8e2b1,_0x96ab('0xe'));logger[_0x96ab('0xf')](_0x96ab('0x10'),_0xf8e2b1,_0x96ab('0xe'),JSON[_0x96ab('0x11')](_0x39b50e));if(_0x39b50e[_0x96ab('0x12')]){if(_0x39b50e['error'][_0x96ab('0x13')]===0x1f4){logger['error'](_0x96ab('0xd'),_0xf8e2b1,_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);return _0x1e3f17(_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);}logger[_0x96ab('0x12')](_0x96ab('0xd'),_0xf8e2b1,_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);return _0x313efb(_0x39b50e[_0x96ab('0x12')][_0x96ab('0x14')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0xf8e2b1,_0x96ab('0xe'));_0x313efb(_0x39b50e[_0x96ab('0x15')][_0x96ab('0x14')]);}})['catch'](function(_0x43e35e){logger[_0x96ab('0x12')]('CloudProvider,\x20%s,\x20%s',_0xf8e2b1,_0x43e35e);_0x1e3f17(_0x43e35e);});});}
\ No newline at end of file
+var _0xa9fc=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','CloudProvider,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa9fc,0x19f));var _0xca9f=function(_0x34aec4,_0x3801da){_0x34aec4=_0x34aec4-0x0;var _0x51e1a7=_0xa9fc[_0x34aec4];return _0x51e1a7;};'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')]('CloudProvider,\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')]('CloudProvider,\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
index c61d80c..17fba05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x36296d,_0x2ff5a5){var _0x3d45f6=function(_0x71e799){while(--_0x71e799){_0x36296d['push'](_0x36296d['shift']());}};_0x3d45f6(++_0x2ff5a5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x4631bf,_0x8f03cb){var _0x36a00a=function(_0x45d964){while(--_0x45d964){_0x4631bf['push'](_0x4631bf['shift']());}};_0x36a00a(++_0x8f03cb);}(_0xdb28,0x106));var _0x8db2=function(_0x26ef12,_0x828a36){_0x26ef12=_0x26ef12-0x0;var _0x38a7bb=_0xdb28[_0x26ef12];return _0x38a7bb;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
index 50bf20c..0e6a8a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f9=['name','exports','STRING'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x73f9,0x1c6));var _0x973f=function(_0x39b4ee,_0x581017){_0x39b4ee=_0x39b4ee-0x0;var _0x32386d=_0x73f9[_0x39b4ee];return _0x32386d;};'use strict';var Sequelize=require('sequelize');module[_0x973f('0x0')]={'name':{'type':Sequelize[_0x973f('0x1')],'unique':_0x973f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x973f('0x1')]},'companyId':{'type':Sequelize[_0x973f('0x1')]},'website':{'type':Sequelize[_0x973f('0x1')]},'phone':{'type':Sequelize[_0x973f('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x973f('0x1')]},'street':{'type':Sequelize[_0x973f('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x973f('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x973f('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x973f('0x1')]},'sCountry':{'type':Sequelize[_0x973f('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2873=['sequelize','exports','STRING'];(function(_0x1bdc52,_0x4876a9){var _0xdf3fa3=function(_0x2a3ba4){while(--_0x2a3ba4){_0x1bdc52['push'](_0x1bdc52['shift']());}};_0xdf3fa3(++_0x4876a9);}(_0x2873,0x168));var _0x3287=function(_0x31c5d9,_0x374134){_0x31c5d9=_0x31c5d9-0x0;var _0x30aaee=_0x2873[_0x31c5d9];return _0x30aaee;};'use strict';var Sequelize=require(_0x3287('0x0'));module[_0x3287('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x3287('0x2')]},'website':{'type':Sequelize[_0x3287('0x2')]},'phone':{'type':Sequelize[_0x3287('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3287('0x2')]},'street':{'type':Sequelize[_0x3287('0x2')]},'postalCode':{'type':Sequelize[_0x3287('0x2')]},'city':{'type':Sequelize[_0x3287('0x2')]},'country':{'type':Sequelize[_0x3287('0x2')]},'email':{'type':Sequelize[_0x3287('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3287('0x2')]},'sStreet':{'type':Sequelize[_0x3287('0x2')]},'sPostalCode':{'type':Sequelize[_0x3287('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ac0f924..ed5b0c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3625=['count','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','sendStatus','name','index','describe','model','keys','query','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','pick','filter','merge','map','options','CmCompany','include','findAll','rows','catch','show','params','rawAttributes','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','ids','omit','getContacts','findOne','CmContact','length','hasOwnProperty','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined'];(function(_0x6718b,_0x5b7aa4){var _0x798643=function(_0x4e5bf2){while(--_0x4e5bf2){_0x6718b['push'](_0x6718b['shift']());}};_0x798643(++_0x5b7aa4);}(_0x3625,0x90));var _0x5362=function(_0x27f619,_0x23697e){_0x27f619=_0x27f619-0x0;var _0x23eec3=_0x3625[_0x27f619];return _0x23eec3;};'use strict';var emlformat=require(_0x5362('0x0'));var rimraf=require(_0x5362('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5362('0x2'));var rp=require('request-promise');var moment=require(_0x5362('0x3'));var BPromise=require(_0x5362('0x4'));var Mustache=require(_0x5362('0x5'));var util=require(_0x5362('0x6'));var path=require('path');var sox=require(_0x5362('0x7'));var csv=require('to-csv');var ejs=require(_0x5362('0x8'));var fs=require('fs');var fs_extra=require(_0x5362('0x9'));var _=require(_0x5362('0xa'));var squel=require(_0x5362('0xb'));var crypto=require(_0x5362('0xc'));var jsforce=require(_0x5362('0xd'));var deskjs=require(_0x5362('0xe'));var toCsv=require(_0x5362('0xf'));var querystring=require(_0x5362('0x10'));var Papa=require(_0x5362('0x11'));var Redis=require('ioredis');var authService=require(_0x5362('0x12'));var qs=require(_0x5362('0x13'));var as=require(_0x5362('0x14'));var hardwareService=require(_0x5362('0x15'));var logger=require(_0x5362('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x5362('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5362('0x18'))['db'];function respondWithStatusCode(_0x4b342b,_0x5a7734){_0x5a7734=_0x5a7734||0xcc;return function(_0x1650d7){if(_0x1650d7){return _0x4b342b['sendStatus'](_0x5a7734);}return _0x4b342b[_0x5362('0x19')](_0x5a7734)[_0x5362('0x1a')]();};}function respondWithResult(_0x58b254,_0x37f997){_0x37f997=_0x37f997||0xc8;return function(_0x1c180e){if(_0x1c180e){return _0x58b254[_0x5362('0x19')](_0x37f997)[_0x5362('0x1b')](_0x1c180e);}};}function respondWithFilteredResult(_0x205c2b,_0x48af2c){return function(_0x1a7d8e){if(_0x1a7d8e){var _0x4790d5=typeof _0x48af2c[_0x5362('0x1c')]===_0x5362('0x1d')&&typeof _0x48af2c['limit']===_0x5362('0x1d');var _0x2f5bb3=_0x1a7d8e[_0x5362('0x1e')];var _0x18fad0=_0x4790d5?0x0:_0x48af2c[_0x5362('0x1c')];var _0x5214ad=_0x4790d5?_0x1a7d8e[_0x5362('0x1e')]:_0x48af2c['offset']+_0x48af2c['limit'];var _0x55938c;if(_0x5214ad>=_0x2f5bb3){_0x5214ad=_0x2f5bb3;_0x55938c=0xc8;}else{_0x55938c=0xce;}_0x205c2b[_0x5362('0x19')](_0x55938c);return _0x205c2b[_0x5362('0x1f')](_0x5362('0x20'),_0x18fad0+'-'+_0x5214ad+'/'+_0x2f5bb3)[_0x5362('0x1b')](_0x1a7d8e);}return null;};}function patchUpdates(_0x387a71){return function(_0x370fc1){try{jsonpatch[_0x5362('0x21')](_0x370fc1,_0x387a71,!![]);}catch(_0x58e6dc){return BPromise[_0x5362('0x22')](_0x58e6dc);}return _0x370fc1['save']();};}function saveUpdates(_0x34809b,_0x107adf){return function(_0x1c3d11){if(_0x1c3d11){return _0x1c3d11['update'](_0x34809b)[_0x5362('0x23')](function(_0x3c7ac0){return _0x3c7ac0;});}return null;};}function removeEntity(_0x2e7500,_0xfc9f77){return function(_0x26d16c){if(_0x26d16c){return _0x26d16c[_0x5362('0x24')]()[_0x5362('0x23')](function(){var _0x173c45=_0x26d16c[_0x5362('0x25')]({'plain':!![]});var _0x26b78a='Companies';return db[_0x5362('0x26')][_0x5362('0x24')]({'where':{'type':_0x26b78a,'resourceId':_0x173c45['id']}})['then'](function(){return _0x26d16c;});})[_0x5362('0x23')](function(){_0x2e7500[_0x5362('0x19')](0xcc)[_0x5362('0x1a')]();});}};}function handleEntityNotFound(_0x5425e9,_0x5a958d){return function(_0x325861){if(!_0x325861){_0x5425e9[_0x5362('0x27')](0x194);}return _0x325861;};}function handleError(_0x3f3bb0,_0x4b088d){_0x4b088d=_0x4b088d||0x1f4;return function(_0xb5fcc4){logger['error'](_0xb5fcc4['stack']);if(_0xb5fcc4[_0x5362('0x28')]){delete _0xb5fcc4[_0x5362('0x28')];}_0x3f3bb0[_0x5362('0x19')](_0x4b088d)['send'](_0xb5fcc4);};}exports[_0x5362('0x29')]=function(_0x5ecc23,_0x499fe0){var _0x3ba2c2={},_0x5da07f={},_0x468749={'count':0x0,'rows':[]};return db['CmCompany'][_0x5362('0x2a')]()[_0x5362('0x23')](function(_0x438aab){_0x5da07f[_0x5362('0x2b')]=_[_0x5362('0x2c')](_0x438aab);_0x5da07f[_0x5362('0x2d')]=_[_0x5362('0x2c')](_0x5ecc23[_0x5362('0x2d')]);_0x5da07f[_0x5362('0x2e')]=_['intersection'](_0x5da07f['model'],_0x5da07f[_0x5362('0x2d')]);_0x3ba2c2[_0x5362('0x2f')]=_[_0x5362('0x30')](_0x5da07f[_0x5362('0x2b')],qs[_0x5362('0x31')](_0x5ecc23['query'][_0x5362('0x31')]));_0x3ba2c2[_0x5362('0x2f')]=_0x3ba2c2[_0x5362('0x2f')]['length']?_0x3ba2c2[_0x5362('0x2f')]:_0x5da07f[_0x5362('0x2b')];if(!_0x5ecc23[_0x5362('0x2d')]['hasOwnProperty'](_0x5362('0x32'))){_0x3ba2c2[_0x5362('0x33')]=qs[_0x5362('0x33')](_0x5ecc23['query'][_0x5362('0x33')]);_0x3ba2c2[_0x5362('0x1c')]=qs['offset'](_0x5ecc23[_0x5362('0x2d')][_0x5362('0x1c')]);}_0x3ba2c2[_0x5362('0x34')]=qs['sort'](_0x5ecc23[_0x5362('0x2d')][_0x5362('0x35')]);_0x3ba2c2[_0x5362('0x36')]=qs['filters'](_[_0x5362('0x37')](_0x5ecc23[_0x5362('0x2d')],_0x5da07f[_0x5362('0x2e')]),_0x438aab);if(_0x5ecc23['query'][_0x5362('0x38')]){_0x3ba2c2['where']=_[_0x5362('0x39')](_0x3ba2c2[_0x5362('0x36')],{'$or':_[_0x5362('0x3a')](_0x3ba2c2[_0x5362('0x2f')],function(_0x2a5850){var _0x300217={};_0x300217[_0x2a5850]={'$like':'%'+_0x5ecc23[_0x5362('0x2d')]['filter']+'%'};return _0x300217;})});}_0x3ba2c2=_[_0x5362('0x39')]({},_0x3ba2c2,_0x5ecc23[_0x5362('0x3b')]);var _0xda72d2={'where':_0x3ba2c2[_0x5362('0x36')]};return db[_0x5362('0x3c')][_0x5362('0x1e')](_0xda72d2)[_0x5362('0x23')](function(_0x11db3b){_0x468749[_0x5362('0x1e')]=_0x11db3b;if(_0x5ecc23['query']['includeAll']){_0x3ba2c2[_0x5362('0x3d')]=[{'all':!![]}];}return db[_0x5362('0x3c')][_0x5362('0x3e')](_0x3ba2c2);})['then'](function(_0x2866f9){_0x468749[_0x5362('0x3f')]=_0x2866f9;return _0x468749;})['then'](respondWithFilteredResult(_0x499fe0,_0x3ba2c2))['catch'](handleError(_0x499fe0,null));})[_0x5362('0x40')](handleError(_0x499fe0,null));};exports[_0x5362('0x41')]=function(_0x7cdda8,_0x280bbb){var _0x4926ae={'raw':![],'where':{'id':_0x7cdda8[_0x5362('0x42')]['id']}},_0x3cb8b9={};_0x3cb8b9[_0x5362('0x2b')]=_[_0x5362('0x2c')](db['CmCompany'][_0x5362('0x43')]);_0x3cb8b9[_0x5362('0x2d')]=_['keys'](_0x7cdda8[_0x5362('0x2d')]);_0x3cb8b9[_0x5362('0x2e')]=_['intersection'](_0x3cb8b9[_0x5362('0x2b')],_0x3cb8b9['query']);_0x4926ae['attributes']=_[_0x5362('0x30')](_0x3cb8b9[_0x5362('0x2b')],qs[_0x5362('0x31')](_0x7cdda8[_0x5362('0x2d')][_0x5362('0x31')]));_0x4926ae[_0x5362('0x2f')]=_0x4926ae[_0x5362('0x2f')]['length']?_0x4926ae[_0x5362('0x2f')]:_0x3cb8b9['model'];if(_0x7cdda8[_0x5362('0x2d')]['includeAll']){_0x4926ae[_0x5362('0x3d')]=[{'all':!![]}];}_0x4926ae=_['merge']({},_0x4926ae,_0x7cdda8[_0x5362('0x3b')]);return db['CmCompany'][_0x5362('0x44')](_0x4926ae)['then'](handleEntityNotFound(_0x280bbb,null))['then'](respondWithResult(_0x280bbb,null))['catch'](handleError(_0x280bbb,null));};exports['create']=function(_0x3c17a1,_0x5dae02){return db[_0x5362('0x3c')]['create'](_0x3c17a1['body'],{})[_0x5362('0x23')](function(_0x50499f){var _0x2116f2=_0x3c17a1[_0x5362('0x45')]['get']({'plain':!![]});if(!_0x2116f2)throw new Error(_0x5362('0x46'));if(_0x2116f2['role']==='user'){var _0x1d686c=_0x50499f[_0x5362('0x25')]({'plain':!![]});var _0x2bd146=_0x5362('0x47');return db[_0x5362('0x48')][_0x5362('0x44')]({'where':{'name':_0x2bd146,'userProfileId':_0x2116f2[_0x5362('0x49')]},'raw':!![]})[_0x5362('0x23')](function(_0x42ae27){if(_0x42ae27&&_0x42ae27[_0x5362('0x4a')]===0x0){return db[_0x5362('0x26')][_0x5362('0x4b')]({'name':_0x1d686c[_0x5362('0x28')],'resourceId':_0x1d686c['id'],'type':_0x42ae27[_0x5362('0x28')],'sectionId':_0x42ae27['id']},{})['then'](function(){return _0x50499f;});}else{return _0x50499f;}})[_0x5362('0x40')](function(_0x319d80){logger[_0x5362('0x4c')](_0x5362('0x4d'),_0x319d80);throw _0x319d80;});}return _0x50499f;})[_0x5362('0x23')](respondWithResult(_0x5dae02,0xc9))['catch'](handleError(_0x5dae02,null));};exports['update']=function(_0x4d2641,_0x18f29d){if(_0x4d2641[_0x5362('0x4e')]['id']){delete _0x4d2641[_0x5362('0x4e')]['id'];}return db[_0x5362('0x3c')][_0x5362('0x44')]({'where':{'id':_0x4d2641[_0x5362('0x42')]['id']}})[_0x5362('0x23')](handleEntityNotFound(_0x18f29d,null))[_0x5362('0x23')](saveUpdates(_0x4d2641[_0x5362('0x4e')],null))[_0x5362('0x23')](respondWithResult(_0x18f29d,null))['catch'](handleError(_0x18f29d,null));};exports['destroy']=function(_0x2eb7f9,_0x4934bb){return db[_0x5362('0x3c')][_0x5362('0x44')]({'where':{'id':_0x2eb7f9[_0x5362('0x42')]['id']}})[_0x5362('0x23')](handleEntityNotFound(_0x4934bb,null))[_0x5362('0x23')](removeEntity(_0x4934bb,null))[_0x5362('0x40')](handleError(_0x4934bb,null));};exports[_0x5362('0x2a')]=function(_0x3e971a,_0x315910){return db[_0x5362('0x3c')]['describe']()['then'](respondWithResult(_0x315910,null))['catch'](handleError(_0x315910,null));};exports['addContacts']=function(_0x5be58c,_0x2d1bec,_0x41a8ec){return db['CmContact'][_0x5362('0x44')]({'where':{'id':_0x5be58c[_0x5362('0x42')]['id']}})[_0x5362('0x23')](handleEntityNotFound(_0x2d1bec,null))[_0x5362('0x23')](function(_0x562788){if(_0x562788){return _0x562788[_0x5362('0x4f')](_0x5be58c[_0x5362('0x4e')][_0x5362('0x50')],_[_0x5362('0x51')](_0x5be58c[_0x5362('0x4e')],['ids','id'])||{});}})[_0x5362('0x23')](respondWithResult(_0x2d1bec,null))[_0x5362('0x40')](handleError(_0x2d1bec,null));};exports[_0x5362('0x52')]=function(_0x437a38,_0x152566,_0x1e078e){var _0x40cb04={};var _0x57c276={};var _0x489ba4;var _0x1977ef;return db[_0x5362('0x3c')][_0x5362('0x53')]({'where':{'id':_0x437a38[_0x5362('0x42')]['id']}})[_0x5362('0x23')](handleEntityNotFound(_0x152566,null))[_0x5362('0x23')](function(_0x52df10){if(_0x52df10){_0x489ba4=_0x52df10;_0x57c276[_0x5362('0x2b')]=_[_0x5362('0x2c')](db[_0x5362('0x54')]['rawAttributes']);_0x57c276[_0x5362('0x2d')]=_[_0x5362('0x2c')](_0x437a38[_0x5362('0x2d')]);_0x57c276['filters']=_[_0x5362('0x30')](_0x57c276[_0x5362('0x2b')],_0x57c276[_0x5362('0x2d')]);_0x40cb04['attributes']=_[_0x5362('0x30')](_0x57c276[_0x5362('0x2b')],qs[_0x5362('0x31')](_0x437a38[_0x5362('0x2d')][_0x5362('0x31')]));_0x40cb04[_0x5362('0x2f')]=_0x40cb04['attributes'][_0x5362('0x55')]?_0x40cb04[_0x5362('0x2f')]:_0x57c276[_0x5362('0x2b')];_0x40cb04['order']=qs[_0x5362('0x35')](_0x437a38[_0x5362('0x2d')][_0x5362('0x35')]);_0x40cb04[_0x5362('0x36')]=qs[_0x5362('0x2e')](_['pick'](_0x437a38['query'],_0x57c276[_0x5362('0x2e')]));if(_0x437a38[_0x5362('0x2d')][_0x5362('0x38')]){_0x40cb04[_0x5362('0x36')]=_[_0x5362('0x39')](_0x40cb04[_0x5362('0x36')],{'$or':_['map'](_0x40cb04[_0x5362('0x2f')],function(_0x52a497){var _0x1917d2={};_0x1917d2[_0x52a497]={'$like':'%'+_0x437a38[_0x5362('0x2d')][_0x5362('0x38')]+'%'};return _0x1917d2;})});}_0x40cb04=_[_0x5362('0x39')]({},_0x40cb04,_0x437a38[_0x5362('0x3b')]);return _0x489ba4[_0x5362('0x52')](_0x40cb04);}})[_0x5362('0x23')](function(_0x2ee90c){if(_0x2ee90c){_0x1977ef=_0x2ee90c[_0x5362('0x55')];if(!_0x437a38['query'][_0x5362('0x56')](_0x5362('0x32'))){_0x40cb04['limit']=qs[_0x5362('0x33')](_0x437a38['query'][_0x5362('0x33')]);_0x40cb04[_0x5362('0x1c')]=qs[_0x5362('0x1c')](_0x437a38[_0x5362('0x2d')][_0x5362('0x1c')]);}return _0x489ba4[_0x5362('0x52')](_0x40cb04);}})['then'](function(_0x18305b){if(_0x18305b){return _0x18305b?{'count':_0x1977ef,'rows':_0x18305b}:null;}})[_0x5362('0x23')](respondWithResult(_0x152566,null))[_0x5362('0x40')](handleError(_0x152566,null));};
\ No newline at end of file
+var _0x34a1=['options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','addContacts','CmContact','ids','omit','getContacts','findOne','map','hasOwnProperty','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','save','update','destroy','then','get','Companies','UserProfileResource','sendStatus','error','name','send','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x34a1,0x1b2));var _0x134a=function(_0xd1d5c1,_0x1a79e6){_0xd1d5c1=_0xd1d5c1-0x0;var _0x4c95a5=_0x34a1[_0xd1d5c1];return _0x4c95a5;};'use strict';var emlformat=require(_0x134a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x134a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x134a('0x2'));var moment=require(_0x134a('0x3'));var BPromise=require(_0x134a('0x4'));var Mustache=require(_0x134a('0x5'));var util=require('util');var path=require(_0x134a('0x6'));var sox=require(_0x134a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x134a('0x8'));var crypto=require(_0x134a('0x9'));var jsforce=require(_0x134a('0xa'));var deskjs=require(_0x134a('0xb'));var toCsv=require(_0x134a('0xc'));var querystring=require(_0x134a('0xd'));var Papa=require(_0x134a('0xe'));var Redis=require('ioredis');var authService=require(_0x134a('0xf'));var qs=require(_0x134a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x134a('0x11'));var logger=require(_0x134a('0x12'))(_0x134a('0x13'));var utils=require(_0x134a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x134a('0x15'));var db=require(_0x134a('0x16'))['db'];function respondWithStatusCode(_0xc107f,_0x361896){_0x361896=_0x361896||0xcc;return function(_0x353254){if(_0x353254){return _0xc107f['sendStatus'](_0x361896);}return _0xc107f[_0x134a('0x17')](_0x361896)[_0x134a('0x18')]();};}function respondWithResult(_0x5bc5e7,_0x4681e1){_0x4681e1=_0x4681e1||0xc8;return function(_0x38a3b9){if(_0x38a3b9){return _0x5bc5e7['status'](_0x4681e1)[_0x134a('0x19')](_0x38a3b9);}};}function respondWithFilteredResult(_0x1ef691,_0x5f4ec7){return function(_0x33ec2c){if(_0x33ec2c){var _0x36fa87=typeof _0x5f4ec7[_0x134a('0x1a')]===_0x134a('0x1b')&&typeof _0x5f4ec7['limit']===_0x134a('0x1b');var _0x4f7677=_0x33ec2c[_0x134a('0x1c')];var _0x23c286=_0x36fa87?0x0:_0x5f4ec7[_0x134a('0x1a')];var _0x54de40=_0x36fa87?_0x33ec2c[_0x134a('0x1c')]:_0x5f4ec7[_0x134a('0x1a')]+_0x5f4ec7[_0x134a('0x1d')];var _0x141813;if(_0x54de40>=_0x4f7677){_0x54de40=_0x4f7677;_0x141813=0xc8;}else{_0x141813=0xce;}_0x1ef691[_0x134a('0x17')](_0x141813);return _0x1ef691['set']('Content-Range',_0x23c286+'-'+_0x54de40+'/'+_0x4f7677)['json'](_0x33ec2c);}return null;};}function patchUpdates(_0x26773d){return function(_0x463470){try{jsonpatch['apply'](_0x463470,_0x26773d,!![]);}catch(_0x4c2338){return BPromise['reject'](_0x4c2338);}return _0x463470[_0x134a('0x1e')]();};}function saveUpdates(_0x1df1a2,_0x5a83d0){return function(_0x2a86a5){if(_0x2a86a5){return _0x2a86a5[_0x134a('0x1f')](_0x1df1a2)['then'](function(_0x2149a6){return _0x2149a6;});}return null;};}function removeEntity(_0x3bc64f,_0x487cd8){return function(_0x1ae320){if(_0x1ae320){return _0x1ae320[_0x134a('0x20')]()[_0x134a('0x21')](function(){var _0x5a6f13=_0x1ae320[_0x134a('0x22')]({'plain':!![]});var _0x5d1c2f=_0x134a('0x23');return db[_0x134a('0x24')][_0x134a('0x20')]({'where':{'type':_0x5d1c2f,'resourceId':_0x5a6f13['id']}})['then'](function(){return _0x1ae320;});})[_0x134a('0x21')](function(){_0x3bc64f[_0x134a('0x17')](0xcc)[_0x134a('0x18')]();});}};}function handleEntityNotFound(_0x2c6f26,_0x4523d6){return function(_0x4d54df){if(!_0x4d54df){_0x2c6f26[_0x134a('0x25')](0x194);}return _0x4d54df;};}function handleError(_0x3f2ad1,_0x41bdae){_0x41bdae=_0x41bdae||0x1f4;return function(_0x2cc20d){logger[_0x134a('0x26')](_0x2cc20d['stack']);if(_0x2cc20d[_0x134a('0x27')]){delete _0x2cc20d[_0x134a('0x27')];}_0x3f2ad1[_0x134a('0x17')](_0x41bdae)[_0x134a('0x28')](_0x2cc20d);};}exports['index']=function(_0x5c3c54,_0x164ffb){var _0x4f98c0={},_0x52b704={},_0x25057d={'count':0x0,'rows':[]};return db[_0x134a('0x29')][_0x134a('0x2a')]()[_0x134a('0x21')](function(_0x5791be){_0x52b704['model']=_[_0x134a('0x2b')](_0x5791be);_0x52b704[_0x134a('0x2c')]=_[_0x134a('0x2b')](_0x5c3c54[_0x134a('0x2c')]);_0x52b704[_0x134a('0x2d')]=_[_0x134a('0x2e')](_0x52b704[_0x134a('0x2f')],_0x52b704[_0x134a('0x2c')]);_0x4f98c0[_0x134a('0x30')]=_[_0x134a('0x2e')](_0x52b704[_0x134a('0x2f')],qs[_0x134a('0x31')](_0x5c3c54['query'][_0x134a('0x31')]));_0x4f98c0[_0x134a('0x30')]=_0x4f98c0[_0x134a('0x30')][_0x134a('0x32')]?_0x4f98c0[_0x134a('0x30')]:_0x52b704[_0x134a('0x2f')];if(!_0x5c3c54[_0x134a('0x2c')]['hasOwnProperty'](_0x134a('0x33'))){_0x4f98c0[_0x134a('0x1d')]=qs[_0x134a('0x1d')](_0x5c3c54['query']['limit']);_0x4f98c0[_0x134a('0x1a')]=qs[_0x134a('0x1a')](_0x5c3c54['query'][_0x134a('0x1a')]);}_0x4f98c0[_0x134a('0x34')]=qs[_0x134a('0x35')](_0x5c3c54[_0x134a('0x2c')]['sort']);_0x4f98c0[_0x134a('0x36')]=qs[_0x134a('0x2d')](_[_0x134a('0x37')](_0x5c3c54[_0x134a('0x2c')],_0x52b704[_0x134a('0x2d')]),_0x5791be);if(_0x5c3c54[_0x134a('0x2c')][_0x134a('0x38')]){_0x4f98c0[_0x134a('0x36')]=_[_0x134a('0x39')](_0x4f98c0['where'],{'$or':_['map'](_0x4f98c0[_0x134a('0x30')],function(_0x2c502a){var _0x2349e6={};_0x2349e6[_0x2c502a]={'$like':'%'+_0x5c3c54['query'][_0x134a('0x38')]+'%'};return _0x2349e6;})});}_0x4f98c0=_[_0x134a('0x39')]({},_0x4f98c0,_0x5c3c54[_0x134a('0x3a')]);var _0x49298e={'where':_0x4f98c0['where']};return db[_0x134a('0x29')][_0x134a('0x1c')](_0x49298e)[_0x134a('0x21')](function(_0x143d22){_0x25057d[_0x134a('0x1c')]=_0x143d22;if(_0x5c3c54[_0x134a('0x2c')][_0x134a('0x3b')]){_0x4f98c0[_0x134a('0x3c')]=[{'all':!![]}];}return db[_0x134a('0x29')][_0x134a('0x3d')](_0x4f98c0);})[_0x134a('0x21')](function(_0x3b7d26){_0x25057d[_0x134a('0x3e')]=_0x3b7d26;return _0x25057d;})[_0x134a('0x21')](respondWithFilteredResult(_0x164ffb,_0x4f98c0))[_0x134a('0x3f')](handleError(_0x164ffb,null));})[_0x134a('0x3f')](handleError(_0x164ffb,null));};exports[_0x134a('0x40')]=function(_0x1d5f15,_0xb50777){var _0x265f46={'raw':![],'where':{'id':_0x1d5f15[_0x134a('0x41')]['id']}},_0x24a8f0={};_0x24a8f0[_0x134a('0x2f')]=_['keys'](db[_0x134a('0x29')][_0x134a('0x42')]);_0x24a8f0[_0x134a('0x2c')]=_['keys'](_0x1d5f15[_0x134a('0x2c')]);_0x24a8f0[_0x134a('0x2d')]=_[_0x134a('0x2e')](_0x24a8f0[_0x134a('0x2f')],_0x24a8f0[_0x134a('0x2c')]);_0x265f46[_0x134a('0x30')]=_[_0x134a('0x2e')](_0x24a8f0['model'],qs[_0x134a('0x31')](_0x1d5f15[_0x134a('0x2c')]['fields']));_0x265f46[_0x134a('0x30')]=_0x265f46[_0x134a('0x30')]['length']?_0x265f46[_0x134a('0x30')]:_0x24a8f0[_0x134a('0x2f')];if(_0x1d5f15[_0x134a('0x2c')][_0x134a('0x3b')]){_0x265f46[_0x134a('0x3c')]=[{'all':!![]}];}_0x265f46=_[_0x134a('0x39')]({},_0x265f46,_0x1d5f15[_0x134a('0x3a')]);return db[_0x134a('0x29')]['find'](_0x265f46)[_0x134a('0x21')](handleEntityNotFound(_0xb50777,null))['then'](respondWithResult(_0xb50777,null))['catch'](handleError(_0xb50777,null));};exports[_0x134a('0x43')]=function(_0x4c60dd,_0x3dccd1){return db['CmCompany'][_0x134a('0x43')](_0x4c60dd[_0x134a('0x44')],{})[_0x134a('0x21')](function(_0x45041f){var _0x5af801=_0x4c60dd['user'][_0x134a('0x22')]({'plain':!![]});if(!_0x5af801)throw new Error(_0x134a('0x45'));if(_0x5af801[_0x134a('0x46')]===_0x134a('0x47')){var _0x11aae8=_0x45041f[_0x134a('0x22')]({'plain':!![]});var _0x29c135=_0x134a('0x23');return db['UserProfileSection'][_0x134a('0x48')]({'where':{'name':_0x29c135,'userProfileId':_0x5af801[_0x134a('0x49')]},'raw':!![]})[_0x134a('0x21')](function(_0x58bd21){if(_0x58bd21&&_0x58bd21['autoAssociation']===0x0){return db[_0x134a('0x24')][_0x134a('0x43')]({'name':_0x11aae8[_0x134a('0x27')],'resourceId':_0x11aae8['id'],'type':_0x58bd21['name'],'sectionId':_0x58bd21['id']},{})[_0x134a('0x21')](function(){return _0x45041f;});}else{return _0x45041f;}})[_0x134a('0x3f')](function(_0xe81111){logger[_0x134a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe81111);throw _0xe81111;});}return _0x45041f;})[_0x134a('0x21')](respondWithResult(_0x3dccd1,0xc9))[_0x134a('0x3f')](handleError(_0x3dccd1,null));};exports['update']=function(_0xfed320,_0x4183e0){if(_0xfed320[_0x134a('0x44')]['id']){delete _0xfed320[_0x134a('0x44')]['id'];}return db[_0x134a('0x29')][_0x134a('0x48')]({'where':{'id':_0xfed320['params']['id']}})[_0x134a('0x21')](handleEntityNotFound(_0x4183e0,null))['then'](saveUpdates(_0xfed320[_0x134a('0x44')],null))['then'](respondWithResult(_0x4183e0,null))['catch'](handleError(_0x4183e0,null));};exports['destroy']=function(_0x274ae4,_0x50f2d5){return db[_0x134a('0x29')][_0x134a('0x48')]({'where':{'id':_0x274ae4[_0x134a('0x41')]['id']}})['then'](handleEntityNotFound(_0x50f2d5,null))[_0x134a('0x21')](removeEntity(_0x50f2d5,null))[_0x134a('0x3f')](handleError(_0x50f2d5,null));};exports['describe']=function(_0x86c6a2,_0x48a159){return db[_0x134a('0x29')][_0x134a('0x2a')]()[_0x134a('0x21')](respondWithResult(_0x48a159,null))[_0x134a('0x3f')](handleError(_0x48a159,null));};exports[_0x134a('0x4a')]=function(_0x496061,_0x5dedad,_0x3a4551){return db[_0x134a('0x4b')][_0x134a('0x48')]({'where':{'id':_0x496061[_0x134a('0x41')]['id']}})[_0x134a('0x21')](handleEntityNotFound(_0x5dedad,null))[_0x134a('0x21')](function(_0x942983){if(_0x942983){return _0x942983[_0x134a('0x4a')](_0x496061['body'][_0x134a('0x4c')],_[_0x134a('0x4d')](_0x496061[_0x134a('0x44')],[_0x134a('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x5dedad,null))['catch'](handleError(_0x5dedad,null));};exports[_0x134a('0x4e')]=function(_0x34c43d,_0x5ca4af,_0x257263){var _0x3adbc0={};var _0x470aae={};var _0x4e890e;var _0x3f5f09;return db['CmCompany'][_0x134a('0x4f')]({'where':{'id':_0x34c43d[_0x134a('0x41')]['id']}})[_0x134a('0x21')](handleEntityNotFound(_0x5ca4af,null))[_0x134a('0x21')](function(_0xa8e5c3){if(_0xa8e5c3){_0x4e890e=_0xa8e5c3;_0x470aae[_0x134a('0x2f')]=_[_0x134a('0x2b')](db[_0x134a('0x4b')][_0x134a('0x42')]);_0x470aae[_0x134a('0x2c')]=_[_0x134a('0x2b')](_0x34c43d['query']);_0x470aae[_0x134a('0x2d')]=_[_0x134a('0x2e')](_0x470aae[_0x134a('0x2f')],_0x470aae[_0x134a('0x2c')]);_0x3adbc0['attributes']=_[_0x134a('0x2e')](_0x470aae[_0x134a('0x2f')],qs['fields'](_0x34c43d[_0x134a('0x2c')][_0x134a('0x31')]));_0x3adbc0[_0x134a('0x30')]=_0x3adbc0[_0x134a('0x30')][_0x134a('0x32')]?_0x3adbc0[_0x134a('0x30')]:_0x470aae[_0x134a('0x2f')];_0x3adbc0[_0x134a('0x34')]=qs['sort'](_0x34c43d[_0x134a('0x2c')]['sort']);_0x3adbc0[_0x134a('0x36')]=qs[_0x134a('0x2d')](_[_0x134a('0x37')](_0x34c43d[_0x134a('0x2c')],_0x470aae[_0x134a('0x2d')]));if(_0x34c43d[_0x134a('0x2c')][_0x134a('0x38')]){_0x3adbc0[_0x134a('0x36')]=_[_0x134a('0x39')](_0x3adbc0[_0x134a('0x36')],{'$or':_[_0x134a('0x50')](_0x3adbc0[_0x134a('0x30')],function(_0x2c4925){var _0x4916a8={};_0x4916a8[_0x2c4925]={'$like':'%'+_0x34c43d[_0x134a('0x2c')][_0x134a('0x38')]+'%'};return _0x4916a8;})});}_0x3adbc0=_[_0x134a('0x39')]({},_0x3adbc0,_0x34c43d[_0x134a('0x3a')]);return _0x4e890e[_0x134a('0x4e')](_0x3adbc0);}})[_0x134a('0x21')](function(_0x5d6ab6){if(_0x5d6ab6){_0x3f5f09=_0x5d6ab6['length'];if(!_0x34c43d[_0x134a('0x2c')][_0x134a('0x51')]('nolimit')){_0x3adbc0['limit']=qs[_0x134a('0x1d')](_0x34c43d[_0x134a('0x2c')][_0x134a('0x1d')]);_0x3adbc0[_0x134a('0x1a')]=qs['offset'](_0x34c43d['query'][_0x134a('0x1a')]);}return _0x4e890e['getContacts'](_0x3adbc0);}})[_0x134a('0x21')](function(_0x481b86){if(_0x481b86){return _0x481b86?{'count':_0x3f5f09,'rows':_0x481b86}:null;}})[_0x134a('0x21')](respondWithResult(_0x5ca4af,null))[_0x134a('0x3f')](handleError(_0x5ca4af,null));};
\ No newline at end of file
index cadc75a..41dd989 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4906=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x158d09,_0x53f5a8){var _0x738525=function(_0x4286a9){while(--_0x4286a9){_0x158d09['push'](_0x158d09['shift']());}};_0x738525(++_0x53f5a8);}(_0x4906,0x114));var _0x6490=function(_0x54ac20,_0x3a5081){_0x54ac20=_0x54ac20-0x0;var _0x56e273=_0x4906[_0x54ac20];return _0x56e273;};'use strict';var _=require(_0x6490('0x0'));var util=require(_0x6490('0x1'));var logger=require('../../config/logger')(_0x6490('0x2'));var moment=require(_0x6490('0x3'));var BPromise=require(_0x6490('0x4'));var rp=require(_0x6490('0x5'));var fs=require('fs');var path=require(_0x6490('0x6'));var rimraf=require(_0x6490('0x7'));var config=require(_0x6490('0x8'));var attributes=require(_0x6490('0x9'));module[_0x6490('0xa')]=function(_0x5c5469,_0x5dfc50){return _0x5c5469[_0x6490('0xb')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x50d6=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x486bd4,_0x416099){var _0x460018=function(_0x4cd3f8){while(--_0x4cd3f8){_0x486bd4['push'](_0x486bd4['shift']());}};_0x460018(++_0x416099);}(_0x50d6,0x196));var _0x650d=function(_0x57120e,_0x427d2d){_0x57120e=_0x57120e-0x0;var _0x1539f5=_0x50d6[_0x57120e];return _0x1539f5;};'use strict';var _=require(_0x650d('0x0'));var util=require(_0x650d('0x1'));var logger=require(_0x650d('0x2'))(_0x650d('0x3'));var moment=require(_0x650d('0x4'));var BPromise=require(_0x650d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x650d('0x6'));var rimraf=require(_0x650d('0x7'));var config=require(_0x650d('0x8'));var attributes=require(_0x650d('0x9'));module[_0x650d('0xa')]=function(_0x53cb2c,_0x462acb){return _0x53cb2c[_0x650d('0xb')](_0x650d('0xc'),attributes,{'tableName':_0x650d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ee39c87..6c22afe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74e3=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error'];(function(_0x642a05,_0xcc9a5a){var _0x516d64=function(_0x4b81de){while(--_0x4b81de){_0x642a05['push'](_0x642a05['shift']());}};_0x516d64(++_0xcc9a5a);}(_0x74e3,0x7a));var _0x374e=function(_0x326e28,_0x2c3264){_0x326e28=_0x326e28-0x0;var _0x1f583a=_0x74e3[_0x326e28];return _0x1f583a;};'use strict';var _=require(_0x374e('0x0'));var util=require(_0x374e('0x1'));var moment=require(_0x374e('0x2'));var BPromise=require(_0x374e('0x3'));var rs=require(_0x374e('0x4'));var fs=require('fs');var Redis=require(_0x374e('0x5'));var db=require(_0x374e('0x6'))['db'];var utils=require(_0x374e('0x7'));var logger=require(_0x374e('0x8'))('rpc');var config=require(_0x374e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x374e('0xa')][_0x374e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1693ba,_0x4e6370,_0x213fd0){return new BPromise(function(_0x4addd0,_0x9a1b1a){return client['request'](_0x1693ba,_0x213fd0)['then'](function(_0xda8da9){logger[_0x374e('0xc')](_0x374e('0xd'),_0x4e6370,_0x374e('0xe'));logger[_0x374e('0xf')](_0x374e('0x10'),_0x4e6370,_0x374e('0xe'),JSON['stringify'](_0xda8da9));if(_0xda8da9[_0x374e('0x11')]){if(_0xda8da9[_0x374e('0x11')]['code']===0x1f4){logger[_0x374e('0x11')](_0x374e('0xd'),_0x4e6370,_0xda8da9[_0x374e('0x11')][_0x374e('0x12')]);return _0x9a1b1a(_0xda8da9[_0x374e('0x11')][_0x374e('0x12')]);}logger['error'](_0x374e('0xd'),_0x4e6370,_0xda8da9[_0x374e('0x11')][_0x374e('0x12')]);return _0x4addd0(_0xda8da9[_0x374e('0x11')][_0x374e('0x12')]);}else{logger[_0x374e('0xc')](_0x374e('0xd'),_0x4e6370,'request\x20sent');_0x4addd0(_0xda8da9['result']['message']);}})[_0x374e('0x13')](function(_0x44ec03){logger['error'](_0x374e('0xd'),_0x4e6370,_0x44ec03);_0x9a1b1a(_0x44ec03);});});}
\ No newline at end of file
+var _0x9293=['jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x536788,_0x4d9183){var _0x11ca30=function(_0x557e3f){while(--_0x557e3f){_0x536788['push'](_0x536788['shift']());}};_0x11ca30(++_0x4d9183);}(_0x9293,0x142));var _0x3929=function(_0x19af51,_0x3834ac){_0x19af51=_0x19af51-0x0;var _0x997581=_0x9293[_0x19af51];return _0x997581;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3929('0x0'));var BPromise=require(_0x3929('0x1'));var rs=require(_0x3929('0x2'));var fs=require('fs');var Redis=require(_0x3929('0x3'));var db=require(_0x3929('0x4'))['db'];var utils=require(_0x3929('0x5'));var logger=require(_0x3929('0x6'))(_0x3929('0x7'));var config=require('../../config/environment');var jayson=require(_0x3929('0x8'));var client=jayson['client'][_0x3929('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc26497,_0x54ec1a,_0x9b73dc){return new BPromise(function(_0x47a264,_0x2c064c){return client[_0x3929('0xa')](_0xc26497,_0x9b73dc)[_0x3929('0xb')](function(_0x5d8bb8){logger[_0x3929('0xc')](_0x3929('0xd'),_0x54ec1a,_0x3929('0xe'));logger[_0x3929('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x54ec1a,_0x3929('0xe'),JSON[_0x3929('0x10')](_0x5d8bb8));if(_0x5d8bb8[_0x3929('0x11')]){if(_0x5d8bb8['error'][_0x3929('0x12')]===0x1f4){logger[_0x3929('0x11')](_0x3929('0xd'),_0x54ec1a,_0x5d8bb8[_0x3929('0x11')][_0x3929('0x13')]);return _0x2c064c(_0x5d8bb8[_0x3929('0x11')][_0x3929('0x13')]);}logger[_0x3929('0x11')]('CmCompany,\x20%s,\x20%s',_0x54ec1a,_0x5d8bb8[_0x3929('0x11')][_0x3929('0x13')]);return _0x47a264(_0x5d8bb8[_0x3929('0x11')][_0x3929('0x13')]);}else{logger['info'](_0x3929('0xd'),_0x54ec1a,_0x3929('0xe'));_0x47a264(_0x5d8bb8[_0x3929('0x14')][_0x3929('0x13')]);}})[_0x3929('0x15')](function(_0x2315a7){logger['error'](_0x3929('0xd'),_0x54ec1a,_0x2315a7);_0x2c064c(_0x2315a7);});});}
\ No newline at end of file
index 4f64d97..56f5f2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafbb=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','delete','destroy','exports'];(function(_0x370f46,_0x374580){var _0xc013da=function(_0xf811f2){while(--_0xf811f2){_0x370f46['push'](_0x370f46['shift']());}};_0xc013da(++_0x374580);}(_0xafbb,0x1db));var _0xbafb=function(_0x1ea5b4,_0x62b573){_0x1ea5b4=_0x1ea5b4-0x0;var _0xda5525=_0xafbb[_0x1ea5b4];return _0xda5525;};'use strict';var multer=require('multer');var util=require(_0xbafb('0x0'));var path=require(_0xbafb('0x1'));var timeout=require(_0xbafb('0x2'));var express=require(_0xbafb('0x3'));var router=express[_0xbafb('0x4')]();var fs_extra=require(_0xbafb('0x5'));var auth=require(_0xbafb('0x6'));var interaction=require(_0xbafb('0x7'));var config=require(_0xbafb('0x8'));var controller=require(_0xbafb('0x9'));router[_0xbafb('0xa')]('/',auth['isAuthenticated'](),controller[_0xbafb('0xb')]);router[_0xbafb('0xa')](_0xbafb('0xc'),auth[_0xbafb('0xd')](),controller['describe']);router[_0xbafb('0xa')](_0xbafb('0xe'),auth[_0xbafb('0xd')](),controller[_0xbafb('0xf')]);router[_0xbafb('0xa')](_0xbafb('0x10'),auth['isAuthenticated'](),controller[_0xbafb('0x11')]);router[_0xbafb('0x12')]('/',auth[_0xbafb('0xd')](),controller[_0xbafb('0x13')]);router[_0xbafb('0x12')]('/:id/contacts',auth[_0xbafb('0xd')](),controller[_0xbafb('0x14')]);router['put'](_0xbafb('0xe'),auth['isAuthenticated'](),controller[_0xbafb('0x15')]);router[_0xbafb('0x16')](_0xbafb('0xe'),auth[_0xbafb('0xd')](),controller[_0xbafb('0x17')]);module[_0xbafb('0x18')]=router;
\ No newline at end of file
+var _0xe8e1=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','getContacts','post','/:id/contacts','update','destroy','exports','multer','util'];(function(_0x46e724,_0x3bdce4){var _0x27ceb8=function(_0x296517){while(--_0x296517){_0x46e724['push'](_0x46e724['shift']());}};_0x27ceb8(++_0x3bdce4);}(_0xe8e1,0xc6));var _0x1e8e=function(_0x15f236,_0x59a12b){_0x15f236=_0x15f236-0x0;var _0x3645c0=_0xe8e1[_0x15f236];return _0x3645c0;};'use strict';var multer=require(_0x1e8e('0x0'));var util=require(_0x1e8e('0x1'));var path=require('path');var timeout=require(_0x1e8e('0x2'));var express=require('express');var router=express[_0x1e8e('0x3')]();var fs_extra=require(_0x1e8e('0x4'));var auth=require(_0x1e8e('0x5'));var interaction=require(_0x1e8e('0x6'));var config=require(_0x1e8e('0x7'));var controller=require('./cmCompany.controller');router[_0x1e8e('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e8e('0x9')]);router['get'](_0x1e8e('0xa'),auth[_0x1e8e('0xb')](),controller['describe']);router[_0x1e8e('0x8')](_0x1e8e('0xc'),auth[_0x1e8e('0xb')](),controller[_0x1e8e('0xd')]);router[_0x1e8e('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x1e8e('0xe')]);router[_0x1e8e('0xf')]('/',auth[_0x1e8e('0xb')](),controller['create']);router[_0x1e8e('0xf')](_0x1e8e('0x10'),auth['isAuthenticated'](),controller['addContacts']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1e8e('0x11')]);router['delete'](_0x1e8e('0xc'),auth[_0x1e8e('0xb')](),controller[_0x1e8e('0x12')]);module[_0x1e8e('0x13')]=router;
\ No newline at end of file
index 90a704e..793e468 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['STRING','TEXT','INTEGER','UNSIGNED','DATE','sequelize','exports'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x757a,0xde));var _0xa757=function(_0x1a6db8,_0x3cbb87){_0x1a6db8=_0x1a6db8-0x0;var _0x3c3563=_0x757a[_0x1a6db8];return _0x3c3563;};'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(_0x142499,_0xba03ad){var _0x3722fd=function(_0x4758fa){while(--_0x4758fa){_0x142499['push'](_0x142499['shift']());}};_0x3722fd(++_0xba03ad);}(_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 1addf4c..84d9067 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfea4=['lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','sendStatus','error','name','send','index','CmContact','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','start','filter','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','resolve','user','role','agent','some','getLists','sequelize','toString','keyBy','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','params','describe','tags','columnName','displayName','analytics','alias','values','merge','body','findAll','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','create','ChatInteraction','MailInteraction','MailMessage','SmsInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','duplicates','$or','findOrCreate','show','Tag','$and','format','omit','cf_%d','table','cm_contacts','toParam','text','phone','CmHopper','getTags','options','setTags','ids','getHoppers','rawAttributes','ContactId','includeAll','rows','CmHopperHistory','CmHopperFinal','include','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','child_process','fork','../../components/import/cm/csv','json','File\x20uploaded\x20correctly!','upload','createReadStream','file','path','parse','meta','import','binding','No\x20phone\x20column\x20specified','../../components/import/cm/csv2','stringify','message','pid','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','destination','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','DESC','findAndCountAll','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','Owner','browserName','customerIp','customerPort','osName','ratingMessage','ratingValue','referer','externalUrl','startCase','all','flatten','slice','moment','bluebird','util'];(function(_0x523ae7,_0x2737ba){var _0x4f3dab=function(_0x2c0fbe){while(--_0x2c0fbe){_0x523ae7['push'](_0x523ae7['shift']());}};_0x4f3dab(++_0x2737ba);}(_0xfea4,0x117));var _0x4fea=function(_0x5e9876,_0x16052d){_0x5e9876=_0x5e9876-0x0;var _0x576c48=_0xfea4[_0x5e9876];return _0x576c48;};'use strict';var moment=require(_0x4fea('0x0'));var BPromise=require(_0x4fea('0x1'));var util=require(_0x4fea('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x4fea('0x3'));var squel=require(_0x4fea('0x4'));var Papa=require(_0x4fea('0x5'));var Redis=require(_0x4fea('0x6'));var qs=require(_0x4fea('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x4fea('0x8'))(_0x4fea('0x9'));var config=require(_0x4fea('0xa'));var shared=require(_0x4fea('0xb'));var db=require(_0x4fea('0xc'))['db'];config[_0x4fea('0xd')]=_[_0x4fea('0xe')](config[_0x4fea('0xd')],{'host':_0x4fea('0xf'),'port':0x18eb});var socket=require(_0x4fea('0x10'))(new Redis(config['redis']));require(_0x4fea('0x11'))['register'](socket);function respondWithResult(_0x5ed2c2,_0x356aa7){_0x356aa7=_0x356aa7||0xc8;return function(_0xdcc078){if(_0xdcc078){return _0x5ed2c2[_0x4fea('0x12')](_0x356aa7)['json'](_0xdcc078);}};}function respondWithFilteredResult(_0xd040b4,_0x8e9864){return function(_0x3a41fd){if(_0x3a41fd){var _0x20e8a1=typeof _0x8e9864['offset']===_0x4fea('0x13')&&typeof _0x8e9864[_0x4fea('0x14')]===_0x4fea('0x13');var _0x3e9054=_0x3a41fd[_0x4fea('0x15')];var _0xa20c6b=_0x20e8a1?0x0:_0x8e9864[_0x4fea('0x16')];var _0x38dd7a=_0x20e8a1?_0x3a41fd[_0x4fea('0x15')]:_0x8e9864[_0x4fea('0x16')]+_0x8e9864['limit'];var _0x38d1d9;if(_0x38dd7a>=_0x3e9054){_0x38dd7a=_0x3e9054;_0x38d1d9=0xc8;}else{_0x38d1d9=0xce;}_0xd040b4[_0x4fea('0x12')](_0x38d1d9);return _0xd040b4[_0x4fea('0x17')](_0x4fea('0x18'),_0xa20c6b+'-'+_0x38dd7a+'/'+_0x3e9054)['json'](_0x3a41fd);}return null;};}function saveUpdates(_0x7225ab){return function(_0x30f6e6){if(_0x30f6e6){return _0x30f6e6[_0x4fea('0x19')](_0x7225ab)[_0x4fea('0x1a')](function(_0x334053){return _0x334053;});}return null;};}function removeEntity(_0x49358f){return function(_0x5a852a){if(_0x5a852a){return _0x5a852a[_0x4fea('0x1b')]()[_0x4fea('0x1a')](function(){_0x49358f[_0x4fea('0x12')](0xcc)[_0x4fea('0x1c')]();});}};}function handleEntityNotFound(_0x5b791e){return function(_0x1a6e70){if(!_0x1a6e70){_0x5b791e[_0x4fea('0x1d')](0x194);}return _0x1a6e70;};}function handleError(_0x258468,_0x39deaf){_0x39deaf=_0x39deaf||0x1f4;return function(_0x2d1e9e){logger[_0x4fea('0x1e')](_0x2d1e9e['stack']);if(_0x2d1e9e[_0x4fea('0x1f')]){delete _0x2d1e9e['name'];}_0x258468[_0x4fea('0x12')](_0x39deaf)[_0x4fea('0x20')](_0x2d1e9e);};}exports[_0x4fea('0x21')]=function(_0x46fe72,_0x5b03ec){var _0x346344={},_0x2e7627={},_0x232cbe={'count':0x0,'rows':[]};return db[_0x4fea('0x22')]['describe']()[_0x4fea('0x1a')](function(_0x238b3f){var _0x1196b4=[];for(var _0x2a8cb0=0x0;_0x2a8cb0<Object[_0x4fea('0x23')](_0x238b3f)[_0x4fea('0x24')];_0x2a8cb0++){var _0x5d63b2=Object[_0x4fea('0x23')](_0x238b3f)[_0x2a8cb0];if(_[_0x4fea('0x25')](_0x5d63b2,_0x4fea('0x26'))){_0x1196b4[_0x4fea('0x27')](db[_0x4fea('0x28')][_0x4fea('0x29')]({'where':{'id':_[_0x4fea('0x2a')](_0x5d63b2,'cf_')},'raw':!![]}));}}return BPromise['all'](_0x1196b4)['then'](function(_0x32fc89){for(var _0x585155=0x0;_0x585155<_0x32fc89[_0x4fea('0x24')];_0x585155++){if(_0x32fc89[_0x585155]){var _0x27414a=_0x4fea('0x26')+_0x32fc89[_0x585155]['id'];var _0x36009c=_0x238b3f[_0x27414a];_0x36009c[_0x4fea('0x2b')]=_0x32fc89[_0x585155][_0x4fea('0x2c')];}}return _0x238b3f;});})['then'](function(_0x24d4f6){_0x2e7627[_0x4fea('0x2d')]=_[_0x4fea('0x23')](_0x24d4f6);_0x2e7627[_0x4fea('0x2e')]=_['keys'](_0x46fe72[_0x4fea('0x2e')]);_0x2e7627[_0x4fea('0x2f')]=_[_0x4fea('0x30')](_0x2e7627[_0x4fea('0x2d')],_0x2e7627[_0x4fea('0x2e')]);_0x346344['attributes']=_['intersection'](_0x2e7627['model'],qs[_0x4fea('0x31')](_0x46fe72[_0x4fea('0x2e')]['fields']));_0x346344[_0x4fea('0x32')]=_0x346344['attributes'][_0x4fea('0x24')]?_0x346344['attributes']:_0x2e7627[_0x4fea('0x2d')];if(!_0x46fe72[_0x4fea('0x2e')][_0x4fea('0x33')](_0x4fea('0x34'))){_0x346344[_0x4fea('0x14')]=qs[_0x4fea('0x14')](_0x46fe72['query']['limit']);_0x346344[_0x4fea('0x16')]=qs[_0x4fea('0x16')](_0x46fe72[_0x4fea('0x2e')][_0x4fea('0x16')]);}_0x346344[_0x4fea('0x35')]=qs['sort'](_0x46fe72[_0x4fea('0x2e')][_0x4fea('0x36')]);_0x346344[_0x4fea('0x37')]=qs[_0x4fea('0x2f')](_[_0x4fea('0x38')](_0x46fe72[_0x4fea('0x2e')],_0x2e7627[_0x4fea('0x2f')]),_0x24d4f6);var _0x38481a=[];var _0x50d16a=squel[_0x4fea('0x39')]()[_0x4fea('0x3a')]('id')[_0x4fea('0x3a')](_0x4fea('0x1f'))[_0x4fea('0x3a')](_0x4fea('0x3b'))[_0x4fea('0x3c')](_0x4fea('0x3d'));var _0x11adcc=squel[_0x4fea('0x39')]()['from']('cm_contacts','c')['left_join'](_0x4fea('0x3e'),'uc',_0x4fea('0x3f'))[_0x4fea('0x40')](_0x4fea('0x41'),'ct',_0x4fea('0x42'))[_0x4fea('0x40')](_0x4fea('0x3d'),'t',_0x4fea('0x43'))[_0x4fea('0x37')](_0x4fea('0x44'));var _0x5afc14=squel[_0x4fea('0x45')]();var _0x5f230e=[];var _0x2f92ab=squel[_0x4fea('0x45')]();var _0x434794;if(_0x46fe72[_0x4fea('0x2e')][_0x4fea('0x46')]){_0x434794=as[_0x4fea('0x47')](_0x46fe72['query'][_0x4fea('0x46')]);var _0x510b82=_0x434794[_0x4fea('0x48')];for(var _0x3136be=0x0;_0x3136be<_0x434794[_0x4fea('0x49')]['length'];_0x3136be++){var _0x2038c0=_0x434794[_0x4fea('0x49')][_0x3136be];var _0x2524be='c';var _0x100d2f=_(_0x24d4f6)['keys']()[_0x4fea('0x4a')](function(_0x5e7e6a){return _0x5e7e6a===_0x2038c0[_0x4fea('0x3a')];});if(_0x100d2f)_0x100d2f=_0x24d4f6[_0x2038c0[_0x4fea('0x3a')]];if(!_0x100d2f){if(_0x2038c0[_0x4fea('0x3a')]==='Tag'){var _0x246425=_0x2038c0[_0x4fea('0x4b')][_0x4fea('0x4c')](',')[_0x4fea('0x4d')](function(_0x19af25){return Number(_0x19af25);});_0x246425['forEach'](function(_0x1208ba){_0x2f92ab['or'](_0x4fea('0x4e'),'%,'+_0x1208ba+',%');});_0x5f230e=_['union'](_0x5f230e,_0x246425);}else if(_0x2038c0[_0x4fea('0x3a')]===_0x4fea('0x4f')){_0x5afc14['and'](_0x4fea('0x50'),_0x2038c0[_0x4fea('0x4b')]);}}else{if(_0x2038c0[_0x4fea('0x3a')]===_0x4fea('0x51')||_0x100d2f[_0x4fea('0x2b')]===_0x4fea('0x52'))_0x2038c0[_0x4fea('0x53')]=_0x4fea('0x54');var _0x7afb42=as['buildExpression'](_0x2524be,_0x100d2f[_0x4fea('0x2c')],_0x2038c0);_0x5afc14[_0x510b82](_0x7afb42['text'],_0x7afb42[_0x4fea('0x4b')][_0x4fea('0x55')],_0x7afb42[_0x4fea('0x4b')]['end']);}}}else{var _0x2ff7e8=_(Object[_0x4fea('0x23')](_0x46fe72[_0x4fea('0x2e')]))[_0x4fea('0x4d')](function(_0x582d95){return _0x24d4f6[_0x4fea('0x33')](_0x582d95)?_0x582d95:undefined;})[_0x4fea('0x56')](function(_0x732ec2){return!_[_0x4fea('0x57')](_0x732ec2);})[_0x4fea('0x4b')]();if(_0x46fe72[_0x4fea('0x2e')]['Contact'])_0x2ff7e8[_0x4fea('0x27')](_0x4fea('0x58'));if(!_[_0x4fea('0x59')](_0x2ff7e8)){_0x2ff7e8[_0x4fea('0x5a')](function(_0x5f5cb1){if(_0x5f5cb1===_0x4fea('0x5b')){_0x11adcc[_0x4fea('0x37')](_0x4fea('0x5c'),[][_0x4fea('0x5d')](_0x46fe72[_0x4fea('0x2e')][_0x5f5cb1]));}else if(_0x5f5cb1===_0x4fea('0x58')){var _0x70d6fe='%'+_0x46fe72['query'][_0x5f5cb1]+'%';_0x11adcc[_0x4fea('0x37')](_0x4fea('0x5e'),_0x70d6fe);}else{_0x11adcc[_0x4fea('0x37')]('c.'+_0x5f5cb1+_0x4fea('0x5f'),_0x46fe72[_0x4fea('0x2e')][_0x5f5cb1]);}});}if(_0x46fe72['query'][_0x4fea('0x60')]){_0x5f230e=_[_0x4fea('0x61')](_0x46fe72[_0x4fea('0x2e')][_0x4fea('0x60')])?_0x46fe72['query'][_0x4fea('0x60')]:new Array(_0x46fe72[_0x4fea('0x2e')][_0x4fea('0x60')]);_0x5f230e[_0x4fea('0x5a')](function(_0x4762ba){_0x2f92ab['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4762ba+',%');});}if(_0x46fe72[_0x4fea('0x2e')][_0x4fea('0x56')]){var _0x1f4123=_0x46fe72[_0x4fea('0x2e')][_0x4fea('0x56')]['replace']('\x5c','\x5c\x5c')[_0x4fea('0x62')](/'/g,'\x27\x27');if(_0x1f4123[_0x4fea('0x4c')]('\x20')['length']>0x1){_0x5afc14['or'](_0x4fea('0x63'),qs['getFullTextValue'](_0x1f4123),null);}else{if(qs[_0x4fea('0x64')](_0x1f4123)){_0x5afc14['or'](_0x4fea('0x65'),_0x1f4123+'%');_0x5afc14['or'](_0x4fea('0x66'),_0x1f4123+'%');_0x5afc14['or'](_0x4fea('0x67'),_0x1f4123+'%');_0x5afc14['or']('c.fax\x20LIKE\x20?',_0x1f4123+'%');}else if(qs[_0x4fea('0x68')](_0x1f4123)){_0x5afc14['or'](_0x4fea('0x69'),_0x1f4123+'%');}else{_0x5afc14['or'](_0x4fea('0x6a'),'%'+_0x1f4123+'%');_0x5afc14['or'](_0x4fea('0x6b'),'%'+_0x1f4123+'%');_0x5afc14['or']('c.email\x20LIKE\x20?','%'+_0x1f4123+'%');}}}}_0x11adcc[_0x4fea('0x37')](_0x5afc14);_0x11adcc[_0x4fea('0x6c')](_0x4fea('0x6d'));var _0x4aced8={'type':db[_0x4fea('0x6e')][_0x4fea('0x6f')][_0x4fea('0x70')],'raw':!![]};var _0x283687=_0x11adcc[_0x4fea('0x71')]()[_0x4fea('0x3a')]('c.id');if(_0x346344[_0x4fea('0x35')]){_0x346344[_0x4fea('0x35')]['forEach'](function(_0x5e1546){_0x11adcc['order']('c.'+_0x5e1546[0x0],_0x5e1546[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4fea('0x59')](_0x5f230e)){_0x11adcc[_0x4fea('0x72')](_0x2f92ab);_0x283687['where']('t.id\x20IN\x20?',_0x5f230e);}BPromise[_0x4fea('0x73')]()[_0x4fea('0x1a')](function(){if(!_0x434794)return;if(_0x46fe72[_0x4fea('0x74')][_0x4fea('0x75')]!==_0x4fea('0x76'))return;if(!_[_0x4fea('0x77')](_0x434794[_0x4fea('0x49')],[_0x4fea('0x3a'),_0x4fea('0x4f')])){return _0x46fe72[_0x4fea('0x74')][_0x4fea('0x78')]({'attributes':['id'],'raw':!![]})[_0x4fea('0x1a')](function(_0x42ded5){if(_[_0x4fea('0x59')](_0x42ded5)){_0x283687[_0x4fea('0x37')]('c.ListId\x20IS\x20NULL');_0x11adcc[_0x4fea('0x37')]('c.ListId\x20IS\x20NULL');}else{_0x283687[_0x4fea('0x37')](_0x4fea('0x5c'),_[_0x4fea('0x4d')](_0x42ded5,'id'));_0x11adcc[_0x4fea('0x37')](_0x4fea('0x5c'),_[_0x4fea('0x4d')](_0x42ded5,'id'));}});}})[_0x4fea('0x1a')](function(){if(_0x46fe72['user']['role']===_0x4fea('0x76')&&!_0x434794&&!_0x46fe72[_0x4fea('0x2e')][_0x4fea('0x5b')])return[];return db[_0x4fea('0x79')][_0x4fea('0x2e')](_0x283687['toString'](),_0x4aced8);})[_0x4fea('0x1a')](function(_0x2887e0){_0x232cbe[_0x4fea('0x15')]=_0x2887e0['length'];if(_0x232cbe[_0x4fea('0x15')]===0x0)return[];return db[_0x4fea('0x79')]['query'](_0x50d16a[_0x4fea('0x7a')](),_0x4aced8)[_0x4fea('0x1a')](function(_0x3c7113){_0x38481a=_[_0x4fea('0x7b')](_0x3c7113,'id');_0x4aced8=_['merge'](_0x4aced8,{'model':db[_0x4fea('0x22')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46fe72[_0x4fea('0x2e')]['fields']){_0x346344['attributes'][_0x4fea('0x5a')](function(_0x2afb35){_0x11adcc[_0x4fea('0x3a')]('c.'+_0x2afb35);});}else{_0x11adcc[_0x4fea('0x3a')]('c.id');_0x11adcc['field'](_0x4fea('0x7c'));_0x11adcc[_0x4fea('0x3a')](_0x4fea('0x7d'));_0x11adcc['field'](_0x4fea('0x7e'));_0x11adcc[_0x4fea('0x3a')](_0x4fea('0x7f'));_0x11adcc['field'](_0x4fea('0x80'));_0x11adcc[_0x4fea('0x3a')](_0x4fea('0x81'));_0x11adcc[_0x4fea('0x3a')](_0x4fea('0x82'));_0x11adcc[_0x4fea('0x3a')](_0x4fea('0x83'));_0x11adcc[_0x4fea('0x3a')]('c.deletedAt');_0x11adcc['field'](_0x4fea('0x84'));_0x11adcc['field'](_0x4fea('0x85'),_0x4fea('0x86'));}if(_0x346344[_0x4fea('0x14')])_0x11adcc['limit'](_0x346344[_0x4fea('0x14')]);if(_0x346344[_0x4fea('0x16')])_0x11adcc[_0x4fea('0x16')](_0x346344['offset']);return db[_0x4fea('0x79')]['query'](_0x11adcc[_0x4fea('0x7a')](),_0x4aced8);});})[_0x4fea('0x1a')](function(_0x332bed){_0x332bed[_0x4fea('0x5a')](function(_0x536931){if(_0x536931[_0x4fea('0x86')]){_0x536931[_0x4fea('0x87')]=[];_0x536931[_0x4fea('0x86')][_0x4fea('0x4c')](',')[_0x4fea('0x5a')](function(_0x19a8d4){_0x536931[_0x4fea('0x87')]['push'](_0x38481a[_0x19a8d4]);});}delete _0x536931[_0x4fea('0x86')];});_0x232cbe['rows']=_0x332bed;return _0x232cbe;})[_0x4fea('0x1a')](respondWithFilteredResult(_0x5b03ec,_0x346344));})[_0x4fea('0x88')](handleError(_0x5b03ec,null));};exports['destroy']=function(_0x361abd,_0x7edf6e){return db['CmContact'][_0x4fea('0x4a')]({'where':{'id':_0x361abd[_0x4fea('0x89')]['id']}})[_0x4fea('0x1a')](handleEntityNotFound(_0x7edf6e,null))[_0x4fea('0x1a')](removeEntity(_0x7edf6e,null))[_0x4fea('0x88')](handleError(_0x7edf6e,null));};exports[_0x4fea('0x8a')]=function(_0x2b249f,_0x25c85c){return db[_0x4fea('0x22')][_0x4fea('0x8a')]()[_0x4fea('0x1a')](function(_0x2ed7b5){delete _0x2ed7b5[_0x4fea('0x8b')];for(var _0x259699=0x0;_0x259699<Object[_0x4fea('0x23')](_0x2ed7b5)[_0x4fea('0x24')];_0x259699++){var _0x354e9f=Object[_0x4fea('0x23')](_0x2ed7b5)[_0x259699];if(!_[_0x4fea('0x25')](_0x354e9f,'cf_')){_0x2ed7b5[_0x354e9f][_0x4fea('0x8c')]=_0x354e9f;_0x2ed7b5[_0x354e9f][_0x4fea('0x8d')]=_0x354e9f;}}return _0x2ed7b5;})['then'](function(_0xa56f48){var _0x5a2b08={'where':Boolean(_0x2b249f['query'][_0x4fea('0x8e')])===!![]?undefined:{'$or':[{'ListId':_0x2b249f['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0x4fea('0x28')]['findAll'](_0x5a2b08)[_0x4fea('0x1a')](function(_0x40773b){for(var _0x4bfff4=0x0;_0x4bfff4<_0x40773b[_0x4fea('0x24')];_0x4bfff4++){var _0x399643=_0x4fea('0x26')+_0x40773b[_0x4bfff4]['id'];_0xa56f48[_0x399643][_0x4fea('0x8c')]=_0x399643;_0xa56f48[_0x399643][_0x4fea('0x8d')]=_0x40773b[_0x4bfff4][_0x4fea('0x8f')];_0xa56f48[_0x399643]['custom']={'type':_0x40773b[_0x4bfff4]['type'],'values':_0x40773b[_0x4bfff4][_0x4fea('0x90')]};}Object[_0x4fea('0x23')](_0xa56f48)[_0x4fea('0x5a')](function(_0x467f47){if(!_0xa56f48[_0x467f47][_0x4fea('0x33')](_0x4fea('0x8c'))){delete _0xa56f48[_0x467f47];}});return _0xa56f48;});})['then'](respondWithResult(_0x25c85c,null))['catch'](handleError(_0x25c85c,null));};exports[_0x4fea('0x91')]=function(_0x4da1e5,_0x5f1584){var _0x405fe3;var _0x10c57c;var _0x147743;if(_0x4da1e5[_0x4fea('0x92')]['id']){delete _0x4da1e5[_0x4fea('0x92')]['id'];}return db[_0x4fea('0x22')][_0x4fea('0x93')]({'where':{'id':[_0x4da1e5['body']['to'],_0x4da1e5[_0x4fea('0x92')]['from']]}})['then'](function(_0x559fa9){if(_0x559fa9){if(_0x559fa9[_0x4fea('0x24')]!==0x2){return null;}_0x559fa9[0x0]=_0x559fa9[0x0][_0x4fea('0x94')]({'plain':!![]});_0x559fa9[0x1]=_0x559fa9[0x1][_0x4fea('0x94')]({'plain':!![]});delete _0x559fa9[0x0]['id'];delete _0x559fa9[0x1]['id'];return _[_0x4fea('0x95')](_0x559fa9[0x0],_0x559fa9[0x1],function(_0x1b6cbb,_0x3e0c53){if(Array[_0x4fea('0x61')](_0x3e0c53)&&!_0x3e0c53[_0x4fea('0x24')]){return _0x1b6cbb;}else if(!_0x3e0c53){return _0x1b6cbb;}});}})[_0x4fea('0x1a')](handleEntityNotFound(_0x5f1584,null))[_0x4fea('0x1a')](function(_0x164b9b){if(_0x164b9b){if(_0x164b9b[_0x4fea('0x8b')]&&_[_0x4fea('0x61')](_0x164b9b[_0x4fea('0x8b')])){_0x164b9b[_0x4fea('0x8b')]=_0x164b9b[_0x4fea('0x8b')][_0x4fea('0x96')]();}logger[_0x4fea('0x97')](_0x4fea('0x98'),_0x4da1e5[_0x4fea('0x92')]['to'],_0x4da1e5[_0x4fea('0x92')][_0x4fea('0x3c')]);return db['CmHopper']['destroy']({'where':{'ContactId':[_0x4da1e5[_0x4fea('0x92')]['to'],_0x4da1e5[_0x4fea('0x92')][_0x4fea('0x3c')]]}})['then'](function(_0x517af4){logger['info']('[CmContact][merge][destroy][CmHopper],\x20%s',_0x517af4);return db['CmHopperBlack'][_0x4fea('0x1b')]({'where':{'ContactId':[_0x4da1e5[_0x4fea('0x92')]['to'],_0x4da1e5[_0x4fea('0x92')][_0x4fea('0x3c')]]}})[_0x4fea('0x1a')](function(_0x122974){logger[_0x4fea('0x97')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x122974);return db[_0x4fea('0x22')][_0x4fea('0x99')](_0x164b9b);});});}})[_0x4fea('0x1a')](function(_0x39a39b){if(_0x39a39b){_0x405fe3=_0x39a39b;_0x10c57c={'ContactId':_0x405fe3['id']};_0x147743={'where':{'ContactId':[_0x4da1e5[_0x4fea('0x92')]['to'],_0x4da1e5[_0x4fea('0x92')][_0x4fea('0x3c')]]}};return db[_0x4fea('0x9a')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db['ChatMessage']['update'](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db['ChatOfflineMessage'][_0x4fea('0x19')](_0x10c57c,_0x147743);}})['then'](function(){if(_0x405fe3){return db[_0x4fea('0x9b')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0x9c')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})['then'](function(){if(_0x405fe3){return db[_0x4fea('0x9b')]['update'](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db['MailMessage'][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0x9d')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db['SmsMessage'][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db['FaxInteraction']['update'](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0x9e')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0x9f')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0xa0')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db['CmHopperFinal'][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db['CmHopperHistory']['update'](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0xa1')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0xa2')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0xa3')]['update'](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0xa4')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db['MailQueueReport'][_0x4fea('0x19')](_0x10c57c,_0x147743);}})['then'](function(){if(_0x405fe3){return db['OpenchannelQueueReport'][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0xa5')]['update'](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db['JscriptySessionReport'][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0xa6')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0xa7')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return db[_0x4fea('0xa8')][_0x4fea('0x19')](_0x10c57c,_0x147743);}})['then'](function(){if(_0x405fe3){return db[_0x4fea('0x22')][_0x4fea('0x1b')]({'where':{'id':[_0x4da1e5['body']['to'],_0x4da1e5[_0x4fea('0x92')][_0x4fea('0x3c')]]}});}})[_0x4fea('0x1a')](function(){if(_0x405fe3){return _0x405fe3;}})[_0x4fea('0x1a')](respondWithResult(_0x5f1584,null))['catch'](handleError(_0x5f1584,null));};exports[_0x4fea('0x99')]=function(_0x39cacb,_0xc03410){return db[_0x4fea('0x22')]['describe']()['then'](function(_0x33685a){if(_0x39cacb[_0x4fea('0x92')]['tags']&&_[_0x4fea('0x61')](_0x39cacb[_0x4fea('0x92')][_0x4fea('0x8b')])){if(_0x39cacb[_0x4fea('0x92')][_0x4fea('0x8b')][_0x4fea('0x24')]){_0x39cacb[_0x4fea('0x92')]['tags']=_0x39cacb[_0x4fea('0x92')][_0x4fea('0x8b')][_0x4fea('0x96')](';')+';';}else{_0x39cacb[_0x4fea('0x92')][_0x4fea('0x8b')]=null;}}else{_0x39cacb[_0x4fea('0x92')][_0x4fea('0x8b')]=null;}if(!_[_0x4fea('0x57')](_0x39cacb[_0x4fea('0x92')][_0x4fea('0xa9')])){var _0x16f8ee=_0x39cacb[_0x4fea('0x92')][_0x4fea('0xa9')];if(!_[_0x4fea('0x57')](shared[_0x4fea('0xaa')][_0x16f8ee]))_0x39cacb[_0x4fea('0x92')][_0x4fea('0xab')]=shared[_0x4fea('0xaa')][_0x16f8ee]['utcOffset'];}return db[_0x4fea('0x22')][_0x4fea('0x99')](_0x39cacb[_0x4fea('0x92')],{'fields':_[_0x4fea('0x23')](_0x33685a),'raw':!![]});})[_0x4fea('0x1a')](respondWithResult(_0xc03410,0xc9))['catch'](handleError(_0xc03410,null));};exports['bulkCreate']=function(_0x552cdc,_0x1a78bc){var _0x336b14=0x0;var _0x4ea6c0=0x0;var _0x1a8ecd=0x0;return db[_0x4fea('0x22')]['describe']()[_0x4fea('0x1a')](function(_0x51a1c3){return BPromise['each'](_0x552cdc[_0x4fea('0x92')],function(_0x169946){var _0x341fd1={'where':{'$or':[]},'defaults':_0x169946,'fields':_[_0x4fea('0x23')](_0x51a1c3),'raw':!![]};if(_0x169946[_0x4fea('0xac')]){for(var _0x34f501=0x0;_0x34f501<_0x169946[_0x4fea('0xac')]['length'];_0x34f501++){var _0x5065d5={};_0x5065d5[_0x169946['duplicates'][_0x34f501]]=_0x169946[_0x169946['duplicates'][_0x34f501]];_0x341fd1[_0x4fea('0x37')][_0x4fea('0xad')]['push'](_0x5065d5);}_0x341fd1[_0x4fea('0x37')][_0x4fea('0x5b')]=_0x169946['ListId'];}return db[_0x4fea('0x22')][_0x4fea('0xae')](_0x341fd1)['spread'](function(_0xbd3d95,_0x606420){if(_0x606420){_0x336b14++;}else{_0x1a8ecd++;}})[_0x4fea('0x88')](function(){_0x4ea6c0++;});});})[_0x4fea('0x1a')](function(_0x4e1546){if(_0x4e1546){return{'success':_0x336b14,'failure':_0x4ea6c0,'duplicates':_0x1a8ecd};}})[_0x4fea('0x1a')](respondWithResult(_0x1a78bc,0xc9))[_0x4fea('0x88')](handleError(_0x1a78bc,null));};exports[_0x4fea('0xaf')]=function(_0x43e3a3,_0x4ae8e8){var _0x1cbf8d;return db[_0x4fea('0x22')][_0x4fea('0x8a')]()[_0x4fea('0x1a')](function(_0x2e1f76){return db['CmContact']['find']({'where':{'id':_0x43e3a3[_0x4fea('0x89')]['id']},'include':[{'model':db[_0x4fea('0xb0')],'as':_0x4fea('0x87'),'attributes':['id',_0x4fea('0x1f'),_0x4fea('0x3b')],'required':_0x43e3a3[_0x4fea('0x2e')][_0x4fea('0x60')]?!![]:![]}],'attributes':_[_0x4fea('0x23')](_0x2e1f76)});})['then'](function(_0x179ae4){if(!_[_0x4fea('0x57')](_0x179ae4)){_0x1cbf8d=_0x179ae4['get']({'plain':!![]});var _0x170274={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x179ae4&&_0x179ae4[_0x4fea('0x5b')]){if(_0x179ae4[_0x4fea('0x5b')]){_0x170274[_0x4fea('0x37')][_0x4fea('0xb1')][_0x4fea('0x27')]({'ListId':{'$ne':_0x179ae4[_0x4fea('0x5b')]}});}}return db[_0x4fea('0x28')]['findAll'](_0x170274);}})['then'](function(_0x35c57f){if(!_[_0x4fea('0x57')](_0x35c57f)){return _['omit'](_0x1cbf8d,_[_0x4fea('0x4d')](_0x35c57f,function(_0x2a36b6){return util[_0x4fea('0xb2')]('cf_%d',_0x2a36b6['id']);}));}})[_0x4fea('0x1a')](handleEntityNotFound(_0x4ae8e8,null))[_0x4fea('0x1a')](respondWithResult(_0x4ae8e8,null))['catch'](handleError(_0x4ae8e8,null));};exports['update']=function(_0x4d0919,_0x5a16c2){var _0x2afa7d;if(_0x4d0919[_0x4fea('0x92')]['id']){delete _0x4d0919['body']['id'];}if(!_[_0x4fea('0x57')](_0x4d0919[_0x4fea('0x92')][_0x4fea('0xa9')])){var _0x31149c=_0x4d0919[_0x4fea('0x92')][_0x4fea('0xa9')];if(!_[_0x4fea('0x57')](shared[_0x4fea('0xaa')][_0x31149c]))_0x4d0919[_0x4fea('0x92')]['utcOffset']=shared[_0x4fea('0xaa')][_0x31149c][_0x4fea('0xab')];}return db['CmContact'][_0x4fea('0x4a')]({'where':{'id':_0x4d0919[_0x4fea('0x89')]['id']}})[_0x4fea('0x1a')](handleEntityNotFound(_0x5a16c2,null))[_0x4fea('0x1a')](saveUpdates(_0x4d0919[_0x4fea('0x92')],null))[_0x4fea('0x1a')](function(_0x4c3e94){_0x2afa7d=_0x4c3e94;var _0x4b2206={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4c3e94&&_0x4c3e94['ListId']){if(_0x4c3e94[_0x4fea('0x5b')]){_0x4b2206[_0x4fea('0x37')]['$and'][_0x4fea('0x27')]({'ListId':{'$ne':_0x4c3e94['ListId']}});}}return db[_0x4fea('0x28')][_0x4fea('0x93')](_0x4b2206);})['then'](function(_0x58f5df){if(_0x58f5df){return _[_0x4fea('0xb3')](_['pickBy'](_0x4d0919[_0x4fea('0x92')],function(_0x5503e6,_0x427a4d){return _[_0x4fea('0x25')](_0x427a4d,_0x4fea('0x26'));}),_['map'](_0x58f5df,function(_0x5ed1a3){return util[_0x4fea('0xb2')](_0x4fea('0xb4'),_0x5ed1a3['id']);}));}})[_0x4fea('0x1a')](function(_0x4fa572){if(_0x4fa572&&!_[_0x4fea('0x59')](_0x4fa572)){var _0x51609f=squel[_0x4fea('0x19')]()[_0x4fea('0xb5')](_0x4fea('0xb6'))['setFields'](_0x4fa572)[_0x4fea('0x37')]('id\x20=\x20?',_0x4d0919[_0x4fea('0x89')]['id'])[_0x4fea('0xb7')]();return db[_0x4fea('0x79')][_0x4fea('0x2e')](_0x51609f[_0x4fea('0xb8')],{'replacements':_0x51609f[_0x4fea('0x90')]});}})[_0x4fea('0x1a')](function(){if(_0x4d0919[_0x4fea('0x92')][_0x4fea('0xb9')]&&_0x2afa7d){return db[_0x4fea('0xba')][_0x4fea('0x19')]({'phone':_0x4d0919['body']['phone']},{'where':{'ContactId':_0x2afa7d['id']}});}})['then'](function(){return _0x2afa7d;})[_0x4fea('0x1a')](respondWithResult(_0x5a16c2,null))[_0x4fea('0x88')](handleError(_0x5a16c2,null));};exports[_0x4fea('0xbb')]=function(_0x5acba3,_0x4b17bf){var _0x4e36a6={};var _0xdf2206={};var _0x321125;var _0x5a7e55;return db[_0x4fea('0x22')][_0x4fea('0x29')]({'where':{'id':_0x5acba3[_0x4fea('0x89')]['id']}})['then'](handleEntityNotFound(_0x4b17bf,null))[_0x4fea('0x1a')](function(_0x199321){if(_0x199321){_0x321125=_0x199321;_0xdf2206[_0x4fea('0x2d')]=_[_0x4fea('0x23')](db['Tag']['rawAttributes']);_0xdf2206['query']=_['keys'](_0x5acba3[_0x4fea('0x2e')]);_0xdf2206[_0x4fea('0x2f')]=_[_0x4fea('0x30')](_0xdf2206['model'],_0xdf2206[_0x4fea('0x2e')]);_0x4e36a6[_0x4fea('0x32')]=_['intersection'](_0xdf2206[_0x4fea('0x2d')],qs[_0x4fea('0x31')](_0x5acba3[_0x4fea('0x2e')][_0x4fea('0x31')]));_0x4e36a6['attributes']=_0x4e36a6[_0x4fea('0x32')][_0x4fea('0x24')]?_0x4e36a6[_0x4fea('0x32')]:_0xdf2206['model'];_0x4e36a6['order']=qs[_0x4fea('0x36')](_0x5acba3[_0x4fea('0x2e')][_0x4fea('0x36')]);_0x4e36a6[_0x4fea('0x37')]=qs[_0x4fea('0x2f')](_[_0x4fea('0x38')](_0x5acba3[_0x4fea('0x2e')],_0xdf2206[_0x4fea('0x2f')]));if(_0x5acba3[_0x4fea('0x2e')][_0x4fea('0x56')]){_0x4e36a6[_0x4fea('0x37')]=_[_0x4fea('0x91')](_0x4e36a6[_0x4fea('0x37')],{'$or':_[_0x4fea('0x4d')](_0x4e36a6[_0x4fea('0x32')],function(_0x1d953e){var _0x28137c={};_0x28137c[_0x1d953e]={'$like':'%'+_0x5acba3[_0x4fea('0x2e')][_0x4fea('0x56')]+'%'};return _0x28137c;})});}_0x4e36a6=_[_0x4fea('0x91')]({},_0x4e36a6,_0x5acba3[_0x4fea('0xbc')]);return _0x321125[_0x4fea('0xbb')](_0x4e36a6);}})[_0x4fea('0x1a')](function(_0x5c6755){if(_0x5c6755){_0x5a7e55=_0x5c6755[_0x4fea('0x24')];if(!_0x5acba3[_0x4fea('0x2e')][_0x4fea('0x33')]('nolimit')){_0x4e36a6['limit']=qs[_0x4fea('0x14')](_0x5acba3[_0x4fea('0x2e')][_0x4fea('0x14')]);_0x4e36a6[_0x4fea('0x16')]=qs['offset'](_0x5acba3[_0x4fea('0x2e')]['offset']);}return _0x321125[_0x4fea('0xbb')](_0x4e36a6);}})[_0x4fea('0x1a')](function(_0x538951){if(_0x538951){return _0x538951?{'count':_0x5a7e55,'rows':_0x538951}:null;}})['then'](respondWithResult(_0x4b17bf,null))[_0x4fea('0x88')](handleError(_0x4b17bf,null));};exports[_0x4fea('0xbd')]=function(_0x51f460,_0x471e0a){if(_0x51f460['body']['id']){delete _0x51f460[_0x4fea('0x92')]['id'];}return db[_0x4fea('0x22')]['findOne']({'where':{'id':_0x51f460['params']['id']}})[_0x4fea('0x1a')](handleEntityNotFound(_0x471e0a,null))[_0x4fea('0x1a')](function(_0x5f4132){if(_0x5f4132){return _0x5f4132[_0x4fea('0xbd')](_0x51f460['body'][_0x4fea('0xbe')]||[]);}return null;})[_0x4fea('0x1a')](respondWithResult(_0x471e0a,null))['catch'](handleError(_0x471e0a,null));};exports[_0x4fea('0xbf')]=function(_0x10e6f0,_0x2f0e15){var _0x58be97={'raw':![],'where':{}};var _0x1bf2a1={};var _0x48dd29={'count':0x0,'rows':[]};return db[_0x4fea('0x22')][_0x4fea('0x29')]({'where':{'id':_0x10e6f0[_0x4fea('0x89')]['id']}})[_0x4fea('0x1a')](handleEntityNotFound(_0x2f0e15,null))[_0x4fea('0x1a')](function(_0x39e328){if(_0x39e328){_0x1bf2a1['model']=_['keys'](db[_0x4fea('0xba')][_0x4fea('0xc0')]);_0x1bf2a1['query']=_[_0x4fea('0x23')](_0x10e6f0[_0x4fea('0x2e')]);_0x1bf2a1[_0x4fea('0x2f')]=_['intersection'](_0x1bf2a1[_0x4fea('0x2d')],_0x1bf2a1['query']);_0x58be97[_0x4fea('0x32')]=_[_0x4fea('0x30')](_0x1bf2a1['model'],qs[_0x4fea('0x31')](_0x10e6f0[_0x4fea('0x2e')][_0x4fea('0x31')]));_0x58be97[_0x4fea('0x32')]=_0x58be97[_0x4fea('0x32')][_0x4fea('0x24')]?_0x58be97[_0x4fea('0x32')]:_0x1bf2a1[_0x4fea('0x2d')];if(!_0x10e6f0['query'][_0x4fea('0x33')](_0x4fea('0x34'))){_0x58be97[_0x4fea('0x14')]=qs[_0x4fea('0x14')](_0x10e6f0[_0x4fea('0x2e')][_0x4fea('0x14')]);_0x58be97[_0x4fea('0x16')]=qs[_0x4fea('0x16')](_0x10e6f0[_0x4fea('0x2e')]['offset']);}_0x58be97[_0x4fea('0x35')]=qs[_0x4fea('0x36')](_0x10e6f0[_0x4fea('0x2e')][_0x4fea('0x36')]);_0x58be97[_0x4fea('0x37')]=qs['filters'](_[_0x4fea('0x38')](_0x10e6f0[_0x4fea('0x2e')],_0x1bf2a1[_0x4fea('0x2f')]));_0x58be97[_0x4fea('0x37')][_0x4fea('0xc1')]=_0x39e328['id'];if(_0x10e6f0[_0x4fea('0x2e')][_0x4fea('0x56')]){_0x58be97[_0x4fea('0x37')]=_[_0x4fea('0x91')](_0x58be97['where'],{'$or':_['map'](_0x58be97[_0x4fea('0x32')],function(_0x208b92){var _0x3d73fe={};_0x3d73fe[_0x208b92]={'$like':'%'+_0x10e6f0[_0x4fea('0x2e')][_0x4fea('0x56')]+'%'};return _0x3d73fe;})});}_0x58be97=_[_0x4fea('0x91')]({},_0x58be97,_0x10e6f0[_0x4fea('0xbc')]);return db[_0x4fea('0xba')][_0x4fea('0x15')]({'where':_0x58be97[_0x4fea('0x37')]})['then'](function(_0x1b5017){_0x48dd29['count']=_0x1b5017;if(_0x10e6f0[_0x4fea('0x2e')][_0x4fea('0xc2')]){_0x58be97['include']=[{'all':!![]}];}return db[_0x4fea('0xba')][_0x4fea('0x93')](_0x58be97);})[_0x4fea('0x1a')](function(_0x2ba63e){_0x48dd29[_0x4fea('0xc3')]=_0x2ba63e;return _0x48dd29;});}})[_0x4fea('0x1a')](respondWithFilteredResult(_0x2f0e15,_0x58be97))['catch'](handleError(_0x2f0e15,null));};exports['getHopperHistories']=function(_0x356229,_0x56dbad){var _0x39ca23={'raw':!![],'where':{}};var _0x3b08f5={};var _0x1da4cc={'count':0x0,'rows':[]};return db[_0x4fea('0x22')][_0x4fea('0x29')]({'where':{'id':_0x356229[_0x4fea('0x89')]['id']}})[_0x4fea('0x1a')](handleEntityNotFound(_0x56dbad,null))[_0x4fea('0x1a')](function(_0x1e7450){if(_0x1e7450){_0x3b08f5[_0x4fea('0x2d')]=_['keys'](db[_0x4fea('0xc4')][_0x4fea('0xc0')]);_0x3b08f5[_0x4fea('0x2e')]=_[_0x4fea('0x23')](_0x356229[_0x4fea('0x2e')]);_0x3b08f5[_0x4fea('0x2f')]=_[_0x4fea('0x30')](_0x3b08f5['model'],_0x3b08f5[_0x4fea('0x2e')]);_0x39ca23[_0x4fea('0x32')]=_[_0x4fea('0x30')](_0x3b08f5[_0x4fea('0x2d')],qs[_0x4fea('0x31')](_0x356229['query'][_0x4fea('0x31')]));_0x39ca23[_0x4fea('0x32')]=_0x39ca23[_0x4fea('0x32')]['length']?_0x39ca23[_0x4fea('0x32')]:_0x3b08f5[_0x4fea('0x2d')];if(!_0x356229[_0x4fea('0x2e')]['hasOwnProperty'](_0x4fea('0x34'))){_0x39ca23['limit']=qs[_0x4fea('0x14')](_0x356229[_0x4fea('0x2e')][_0x4fea('0x14')]);_0x39ca23[_0x4fea('0x16')]=qs[_0x4fea('0x16')](_0x356229[_0x4fea('0x2e')][_0x4fea('0x16')]);}_0x39ca23[_0x4fea('0x35')]=qs[_0x4fea('0x36')](_0x356229[_0x4fea('0x2e')][_0x4fea('0x36')]);_0x39ca23[_0x4fea('0x37')]=qs[_0x4fea('0x2f')](_['pick'](_0x356229['query'],_0x3b08f5[_0x4fea('0x2f')]));_0x39ca23['where'][_0x4fea('0xc1')]=_0x1e7450['id'];if(_0x356229[_0x4fea('0x2e')][_0x4fea('0x56')]){_0x39ca23['where']=_['merge'](_0x39ca23[_0x4fea('0x37')],{'$or':_[_0x4fea('0x4d')](_0x39ca23[_0x4fea('0x32')],function(_0x3c7291){var _0x24c547={};_0x24c547[_0x3c7291]={'$like':'%'+_0x356229[_0x4fea('0x2e')]['filter']+'%'};return _0x24c547;})});}_0x39ca23=_['merge']({},_0x39ca23,_0x356229[_0x4fea('0xbc')]);return db[_0x4fea('0xc4')][_0x4fea('0x15')]({'where':_0x39ca23['where']})[_0x4fea('0x1a')](function(_0x338785){_0x1da4cc['count']=_0x338785;if(_0x356229[_0x4fea('0x2e')]['includeAll']){_0x39ca23['include']=[{'all':!![]}];}return db[_0x4fea('0xc4')][_0x4fea('0x93')](_0x39ca23);})[_0x4fea('0x1a')](function(_0x41386c){_0x1da4cc[_0x4fea('0xc3')]=_0x41386c;return _0x1da4cc;});}})[_0x4fea('0x1a')](respondWithFilteredResult(_0x56dbad,_0x39ca23))[_0x4fea('0x88')](handleError(_0x56dbad,null));};exports['getHopperFinals']=function(_0x3785cb,_0x192340){var _0x11f4c9={'raw':!![],'where':{}};var _0x251ed4={};var _0x44c0b5={'count':0x0,'rows':[]};return db[_0x4fea('0x22')][_0x4fea('0x29')]({'where':{'id':_0x3785cb[_0x4fea('0x89')]['id']}})[_0x4fea('0x1a')](handleEntityNotFound(_0x192340,null))[_0x4fea('0x1a')](function(_0x336237){if(_0x336237){_0x251ed4['model']=_['keys'](db[_0x4fea('0xc5')]['rawAttributes']);_0x251ed4[_0x4fea('0x2e')]=_['keys'](_0x3785cb[_0x4fea('0x2e')]);_0x251ed4[_0x4fea('0x2f')]=_[_0x4fea('0x30')](_0x251ed4[_0x4fea('0x2d')],_0x251ed4['query']);_0x11f4c9[_0x4fea('0x32')]=_[_0x4fea('0x30')](_0x251ed4[_0x4fea('0x2d')],qs[_0x4fea('0x31')](_0x3785cb[_0x4fea('0x2e')]['fields']));_0x11f4c9[_0x4fea('0x32')]=_0x11f4c9[_0x4fea('0x32')]['length']?_0x11f4c9['attributes']:_0x251ed4['model'];if(!_0x3785cb[_0x4fea('0x2e')][_0x4fea('0x33')](_0x4fea('0x34'))){_0x11f4c9[_0x4fea('0x14')]=qs[_0x4fea('0x14')](_0x3785cb['query'][_0x4fea('0x14')]);_0x11f4c9[_0x4fea('0x16')]=qs[_0x4fea('0x16')](_0x3785cb[_0x4fea('0x2e')]['offset']);}_0x11f4c9[_0x4fea('0x35')]=qs[_0x4fea('0x36')](_0x3785cb[_0x4fea('0x2e')][_0x4fea('0x36')]);_0x11f4c9[_0x4fea('0x37')]=qs[_0x4fea('0x2f')](_['pick'](_0x3785cb[_0x4fea('0x2e')],_0x251ed4[_0x4fea('0x2f')]));_0x11f4c9['where'][_0x4fea('0xc1')]=_0x336237['id'];if(_0x3785cb['query']['filter']){_0x11f4c9[_0x4fea('0x37')]=_[_0x4fea('0x91')](_0x11f4c9[_0x4fea('0x37')],{'$or':_[_0x4fea('0x4d')](_0x11f4c9[_0x4fea('0x32')],function(_0x3ff354){var _0x571e0e={};_0x571e0e[_0x3ff354]={'$like':'%'+_0x3785cb[_0x4fea('0x2e')][_0x4fea('0x56')]+'%'};return _0x571e0e;})});}_0x11f4c9=_[_0x4fea('0x91')]({},_0x11f4c9,_0x3785cb[_0x4fea('0xbc')]);return db[_0x4fea('0xc5')][_0x4fea('0x15')]({'where':_0x11f4c9[_0x4fea('0x37')]})[_0x4fea('0x1a')](function(_0x4e4039){_0x44c0b5[_0x4fea('0x15')]=_0x4e4039;if(_0x3785cb[_0x4fea('0x2e')][_0x4fea('0xc2')]){_0x11f4c9[_0x4fea('0xc6')]=[{'all':!![]}];}return db[_0x4fea('0xc5')][_0x4fea('0x93')](_0x11f4c9);})[_0x4fea('0x1a')](function(_0x27b4a0){_0x44c0b5['rows']=_0x27b4a0;return _0x44c0b5;});}})[_0x4fea('0x1a')](respondWithFilteredResult(_0x192340,_0x11f4c9))['catch'](handleError(_0x192340,null));};exports[_0x4fea('0xc7')]=function(_0x21d00d,_0x60280b){var _0x5d712d={'raw':!![],'where':{}};var _0x40a811={};var _0x398a54={'count':0x0,'rows':[]};return db[_0x4fea('0x22')][_0x4fea('0x29')]({'where':{'id':_0x21d00d[_0x4fea('0x89')]['id']}})[_0x4fea('0x1a')](handleEntityNotFound(_0x60280b,null))['then'](function(_0x5b3287){if(_0x5b3287){_0x40a811[_0x4fea('0x2d')]=_['keys'](db[_0x4fea('0xc8')][_0x4fea('0xc0')]);_0x40a811[_0x4fea('0x2e')]=_[_0x4fea('0x23')](_0x21d00d['query']);_0x40a811[_0x4fea('0x2f')]=_[_0x4fea('0x30')](_0x40a811[_0x4fea('0x2d')],_0x40a811[_0x4fea('0x2e')]);_0x5d712d['attributes']=_[_0x4fea('0x30')](_0x40a811[_0x4fea('0x2d')],qs[_0x4fea('0x31')](_0x21d00d[_0x4fea('0x2e')]['fields']));_0x5d712d[_0x4fea('0x32')]=_0x5d712d['attributes'][_0x4fea('0x24')]?_0x5d712d[_0x4fea('0x32')]:_0x40a811['model'];if(!_0x21d00d['query'][_0x4fea('0x33')]('nolimit')){_0x5d712d[_0x4fea('0x14')]=qs['limit'](_0x21d00d[_0x4fea('0x2e')]['limit']);_0x5d712d[_0x4fea('0x16')]=qs[_0x4fea('0x16')](_0x21d00d[_0x4fea('0x2e')][_0x4fea('0x16')]);}_0x5d712d['order']=qs[_0x4fea('0x36')](_0x21d00d[_0x4fea('0x2e')][_0x4fea('0x36')]);_0x5d712d['where']=qs[_0x4fea('0x2f')](_['pick'](_0x21d00d[_0x4fea('0x2e')],_0x40a811['filters']));_0x5d712d['where'][_0x4fea('0xc1')]=_0x5b3287['id'];if(_0x21d00d[_0x4fea('0x2e')][_0x4fea('0x56')]){_0x5d712d[_0x4fea('0x37')]=_[_0x4fea('0x91')](_0x5d712d[_0x4fea('0x37')],{'$or':_[_0x4fea('0x4d')](_0x5d712d[_0x4fea('0x32')],function(_0x35dbad){var _0x4d98d4={};_0x4d98d4[_0x35dbad]={'$like':'%'+_0x21d00d['query'][_0x4fea('0x56')]+'%'};return _0x4d98d4;})});}_0x5d712d=_[_0x4fea('0x91')]({},_0x5d712d,_0x21d00d[_0x4fea('0xbc')]);return db[_0x4fea('0xc8')][_0x4fea('0x15')]({'where':_0x5d712d[_0x4fea('0x37')]})[_0x4fea('0x1a')](function(_0x1fc632){_0x398a54[_0x4fea('0x15')]=_0x1fc632;if(_0x21d00d[_0x4fea('0x2e')][_0x4fea('0xc2')]){_0x5d712d['include']=[{'all':!![]}];}return db[_0x4fea('0xc8')][_0x4fea('0x93')](_0x5d712d);})[_0x4fea('0x1a')](function(_0x315a9e){_0x398a54[_0x4fea('0xc3')]=_0x315a9e;return _0x398a54;});}})['then'](respondWithFilteredResult(_0x60280b,_0x5d712d))[_0x4fea('0x88')](handleError(_0x60280b,null));};exports[_0x4fea('0xc9')]=function(_0x4fd8d8,_0x2e37c1){try{if(!_0x4fd8d8[_0x4fea('0x92')][_0x4fea('0x5b')]){throw new Error(_0x4fea('0xca'));}if(!_0x4fd8d8[_0x4fea('0x92')]['binding_keys']){throw new Error(_0x4fea('0xcb'));}if(!_0x4fd8d8[_0x4fea('0x92')]['binding_values']){throw new Error(_0x4fea('0xcc'));}if(!_0x4fd8d8['body'][_0x4fea('0xcd')]){throw new Error(_0x4fea('0xce'));}var _0x3fdbff=_0x4fd8d8['body']['binding_keys'][_0x4fea('0x4c')](',');var _0x141f9b=_0x4fd8d8[_0x4fea('0x92')][_0x4fea('0xcf')][_0x4fea('0x4c')](',');if(!_0x3fdbff[_0x4fea('0x24')]||!_0x141f9b['length']||_0x3fdbff[_0x4fea('0x24')]!==_0x141f9b['length']){throw new Error(_0x4fea('0xd0'));}_0x4fd8d8[_0x4fea('0x92')]['fields']=_['zipObject'](_0x3fdbff,_0x141f9b);if(!_0x4fd8d8[_0x4fea('0x92')]['fields']['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x4fd8d8['body'][_0x4fea('0x31')][_0x4fea('0xd1')]){throw new Error(_0x4fea('0xd2'));}var _0x4b1277=path[_0x4fea('0x96')](config[_0x4fea('0xd3')],_0x4fea('0xd4'),_0x4fd8d8['file'][_0x4fea('0xd5')]);fs['chmodSync'](_0x4b1277,parseInt('0777',0x8));var _0x3640f6=require(_0x4fea('0xd6'))[_0x4fea('0xd7')](path[_0x4fea('0x96')](__dirname,_0x4fea('0xd8')),[_0x4b1277,_0x4fd8d8['body']['binding_keys'],_0x4fd8d8[_0x4fea('0x92')][_0x4fea('0xcf')],_0x4fd8d8['body']['ListId'],_0x4fd8d8[_0x4fea('0x92')]['CompanyId'],_0x4fd8d8[_0x4fea('0x92')][_0x4fea('0xac')],_0x4fd8d8[_0x4fea('0x92')][_0x4fea('0xcd')]]);return _0x2e37c1['status'](0xc8)[_0x4fea('0xd9')]({'message':_0x4fea('0xda'),'pid':_0x3640f6['pid']});}catch(_0xb55e98){return _0x2e37c1[_0x4fea('0x12')](0x1f4)[_0x4fea('0x20')](_0xb55e98);}};exports[_0x4fea('0xdb')]=function(_0x4e48a0,_0x164e25){var _0x3e4cf8=fs[_0x4fea('0xdc')](_0x4e48a0[_0x4fea('0xdd')][_0x4fea('0xde')]);Papa[_0x4fea('0xdf')](_0x3e4cf8,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x1631a1){return _0x164e25[_0x4fea('0x12')](0xc8)[_0x4fea('0xd9')]({'file':_0x4e48a0[_0x4fea('0xdd')],'fields':_0x1631a1[_0x4fea('0xe0')][_0x4fea('0x31')]});}});};exports[_0x4fea('0xe1')]=function(_0x40745a,_0x1082c9){return db[_0x4fea('0x4f')][_0x4fea('0x93')]({'raw':!![],'attributes':['id'],'where':{'role':_0x4fea('0x76')}})[_0x4fea('0x1a')](function(_0x673ac){var _0x4744de=![];if(!_0x40745a[_0x4fea('0x92')]['ListId']){throw new Error(_0x4fea('0xca'));}if(!_0x40745a[_0x4fea('0x92')][_0x4fea('0xe2')][_0x4fea('0xb9')]){throw new Error(_0x4fea('0xe3'));}if(!_0x40745a[_0x4fea('0x92')]['binding'][_0x4fea('0xd1')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x40745a[_0x4fea('0x92')][_0x4fea('0xcd')]){throw new Error(_0x4fea('0xce'));}var _0x3d69a0=require(_0x4fea('0xd6'))[_0x4fea('0xd7')](path[_0x4fea('0x96')](__dirname,_0x4fea('0xe4')),[_0x40745a[_0x4fea('0x89')]['id'],JSON[_0x4fea('0xe5')](_0x40745a[_0x4fea('0x92')]),JSON[_0x4fea('0xe5')](_0x673ac)]);_0x3d69a0['on'](_0x4fea('0xe6'),function(){_0x4744de=!![];return _0x1082c9[_0x4fea('0x12')](0xc8)[_0x4fea('0xd9')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x3d69a0[_0x4fea('0xe7')]});});_0x3d69a0['on'](_0x4fea('0xe8'),function(_0x558764){if(_0x558764&&!_0x4744de){return _0x1082c9[_0x4fea('0x12')](0x1f4)['json']({'message':_0x4fea('0xe9'),'pid':_0x3d69a0['pid']});}});})['catch'](handleError(_0x1082c9,null));};exports[_0x4fea('0xea')]=function(_0x4fcae1,_0x3bd32d){var _0x3296ab=[_0x4fea('0xeb'),_0x4fea('0xec'),_0x4fea('0xed'),_0x4fea('0xee'),'fax','whatsapp',_0x4fea('0xef')];var _0x5e36b0={'offset':0x0,'order':qs['sort'](_0x4fea('0xf0'))},_0x3c65cb={'count':0x0,'rows':[]};Promise[_0x4fea('0x73')]()[_0x4fea('0x1a')](function(){if(_0x4fcae1[_0x4fea('0x2e')][_0x4fea('0xf1')]){if(!_[_0x4fea('0xf2')](_0x3296ab,_0x4fcae1[_0x4fea('0x2e')][_0x4fea('0xf1')][_0x4fea('0xf3')]())){throw new Error(_0x4fea('0xf4'));}_0x3296ab=[_0x4fcae1[_0x4fea('0x2e')]['channel'][_0x4fea('0xf3')]()];}if(_0x4fcae1[_0x4fea('0x2e')][_0x4fea('0xf5')]){try{var _0x3ecd05=JSON[_0x4fea('0xdf')](_0x4fcae1[_0x4fea('0x2e')][_0x4fea('0xf5')]);if(!moment(_0x3ecd05[_0x4fea('0x3c')])[_0x4fea('0xf6')]()){throw new Error(_0x4fea('0xf7'));}if(!moment(_0x3ecd05['to'])[_0x4fea('0xf6')]()){throw new Error(_0x4fea('0xf8'));}}catch(_0x5bd14f){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x4fcae1[_0x4fea('0x2e')][_0x4fea('0x33')]('nolimit')){_0x5e36b0[_0x4fea('0x14')]=qs[_0x4fea('0x14')](_0x4fcae1[_0x4fea('0x2e')][_0x4fea('0x14')]||0xa);_0x5e36b0[_0x4fea('0x16')]=qs[_0x4fea('0x16')](_0x4fcae1[_0x4fea('0x2e')][_0x4fea('0x16')]);}var _0x385ac9=_0x3296ab['map'](function(_0x1dbb65){if(_0x1dbb65===_0x4fea('0xef')){var _0x13b703={'attributes':['id','uniqueid',_0x4fea('0x2c'),'source',_0x4fea('0xf9'),'callerid',_0x4fea('0xfa'),_0x4fea('0xfb'),_0x4fea('0xfc'),_0x4fea('0xfd'),_0x4fea('0xfe'),_0x4fea('0xff'),_0x4fea('0x100'),_0x4fea('0x101'),'UserId'],'where':{'ContactId':_0x4fcae1['params']['id']},'include':[{'model':db[_0x4fea('0x4f')],'as':_0x4fea('0x4f'),'attributes':['id','name',_0x4fea('0x102'),_0x4fea('0x8f')]}],'order':[[_0x4fea('0xfe'),_0x4fea('0x103')]]};if(_0x4fcae1[_0x4fea('0x2e')][_0x4fea('0xf5')]){_0x13b703[_0x4fea('0x37')][_0x4fea('0xfe')]={'$gte':_0x3ecd05[_0x4fea('0x3c')],'$lte':_0x3ecd05['to']};}return db[_0x4fea('0xa2')][_0x4fea('0x104')](_0x13b703)['then'](function(_0x1cb41a){_0x3c65cb[_0x4fea('0x15')]+=_0x1cb41a[_0x4fea('0x15')];return _[_0x4fea('0x4d')](_0x1cb41a['rows'],function(_0x398cc7){var _0x3af411=_0x398cc7[_0x4fea('0x94')]({'plain':!![]});_0x3af411['channel']=_0x1dbb65;if(_0x3af411[_0x4fea('0x4f')]){_0x3af411[_0x4fea('0x4f')]={'id':_0x3af411['User']['id'],'name':_0x3af411['User'][_0x4fea('0x1f')],'fullname':_0x3af411['User'][_0x4fea('0x102')],'alias':_0x3af411[_0x4fea('0x4f')]['alias']};}return _0x3af411;});});}else{var _0x1e434c=_['startCase'](_0x1dbb65)+(_0x1dbb65===_0x4fea('0xec')?_0x4fea('0x105'):_0x4fea('0x106'));var _0x5371ed={'attributes':['id',_0x4fea('0x107'),_0x4fea('0x108'),_0x4fea('0xfe'),_0x4fea('0xfd'),_0x4fea('0x109'),_0x4fea('0x10a'),_0x4fea('0x10b'),_0x4fea('0x10c'),_0x1e434c+'Id'],'where':{'ContactId':_0x4fcae1[_0x4fea('0x89')]['id']},'include':[{'model':db[_0x1e434c],'as':_0x4fea('0x106'),'attributes':['id',_0x4fea('0x1f'),'key']},{'model':db[_0x4fea('0x4f')],'as':_0x4fea('0x10d'),'attributes':['id',_0x4fea('0x1f'),'fullname']},{'model':db[_0x4fea('0xb0')],'as':_0x4fea('0x87'),'attributes':['id',_0x4fea('0x1f'),_0x4fea('0x3b')],'through':{'attributes':[]}}],'order':[[_0x4fea('0xfe'),_0x4fea('0x103')]]};if(_0x4fcae1[_0x4fea('0x2e')][_0x4fea('0xf5')]){_0x5371ed[_0x4fea('0x37')][_0x4fea('0xfe')]={'$gte':_0x3ecd05[_0x4fea('0x3c')],'$lte':_0x3ecd05['to']};}switch(_0x1dbb65){case _0x4fea('0xec'):_0x5371ed['attributes']['push'](_0x4fea('0x10e'),_0x4fea('0x10f'),_0x4fea('0x110'),'deviceModel',_0x4fea('0x111'),_0x4fea('0x112'),'ratingType',_0x4fea('0x113'),_0x4fea('0x114'));break;case _0x4fea('0xeb'):_0x5371ed[_0x4fea('0x32')][_0x4fea('0x27')]('subject','substatus');break;case _0x4fea('0xee'):_0x5371ed['attributes'][_0x4fea('0x27')](_0x4fea('0x115'),'threadId');break;}return db[_[_0x4fea('0x116')](_0x1dbb65)+'Interaction'][_0x4fea('0x104')](_0x5371ed)[_0x4fea('0x1a')](function(_0x240bac){_0x3c65cb[_0x4fea('0x15')]+=_0x240bac['count'];return _[_0x4fea('0x4d')](_0x240bac[_0x4fea('0xc3')],function(_0x4dbf0f){var _0xdef24=_0x4dbf0f[_0x4fea('0x94')]({'plain':!![]});_0xdef24['channel']=_0x1dbb65;if(_0xdef24['Owner']){_0xdef24[_0x4fea('0x10d')]={'id':_0xdef24[_0x4fea('0x10d')]['id'],'name':_0xdef24[_0x4fea('0x10d')][_0x4fea('0x1f')],'fullname':_0xdef24['Owner'][_0x4fea('0x102')]};}return _0xdef24;});});}});return Promise[_0x4fea('0x117')](_0x385ac9);})[_0x4fea('0x1a')](function(_0x1dfba2){return _(_0x1dfba2)[_0x4fea('0x118')]()['sortBy']('createdAt')['reverse']()[_0x4fea('0x4b')]();})['then'](function(_0xf1758c){_0x3c65cb['rows']=_0x5e36b0[_0x4fea('0x14')]?_0xf1758c[_0x4fea('0x119')](_0x5e36b0[_0x4fea('0x16')],_0x5e36b0[_0x4fea('0x16')]+_0x5e36b0[_0x4fea('0x14')]):_0xf1758c;return _0x3c65cb;})[_0x4fea('0x1a')](respondWithFilteredResult(_0x3bd32d,_0x5e36b0))['catch'](handleError(_0x3bd32d,null));};
\ No newline at end of file
+var _0x766f=['field','color','from','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','tools_tags','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','buildExpression','start','filter','isNil','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','forEach','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','DESC','having','t.id\x20IN\x20?','resolve','user','agent','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','catch','params','describe','tags','columnName','displayName','alias','body','findAll','get','mergeWith','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','join','utcOffset','duplicates','findOrCreate','show','$and','omit','dialTimezone','timezones','format','cf_%d','cm_contacts','setFields','toParam','text','phone','getTags','findOne','rawAttributes','pick','options','setTags','getHoppers','fields','ContactId','include','rows','getHopperHistories','includeAll','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','import','binding','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','getJourney','mail','chat','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','parse','range','isValid','Invalid\x20createdAt\x20filter','uniqueid','source','callerid','starttime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','VoiceCallReport','findAndCountAll','startCase','Website','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerPort','deviceModel','osName','ratingType','ratingValue','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','moment','bluebird','util','path','lodash','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','status','json','limit','undefined','offset','count','Content-Range','update','then','destroy','end','sendStatus','stack','name','CmContact','keys','length','startsWith','cf_','CmCustomField','trimStart','fieldType','type','model','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','select'];(function(_0x549b34,_0x3be2e2){var _0x386370=function(_0x4bfe4c){while(--_0x4bfe4c){_0x549b34['push'](_0x549b34['shift']());}};_0x386370(++_0x3be2e2);}(_0x766f,0xe9));var _0xf766=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x766f[_0x4792c8];return _0x35edb1;};'use strict';var moment=require(_0xf766('0x0'));var BPromise=require(_0xf766('0x1'));var util=require(_0xf766('0x2'));var path=require(_0xf766('0x3'));var fs=require('fs');var _=require(_0xf766('0x4'));var squel=require('squel');var Papa=require(_0xf766('0x5'));var Redis=require(_0xf766('0x6'));var qs=require(_0xf766('0x7'));var as=require(_0xf766('0x8'));var logger=require(_0xf766('0x9'))(_0xf766('0xa'));var config=require(_0xf766('0xb'));var shared=require('../../config/environment/shared');var db=require(_0xf766('0xc'))['db'];config[_0xf766('0xd')]=_[_0xf766('0xe')](config['redis'],{'host':_0xf766('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf766('0xd')]));require(_0xf766('0x10'))[_0xf766('0x11')](socket);function respondWithResult(_0x3745a0,_0x571849){_0x571849=_0x571849||0xc8;return function(_0x1c425a){if(_0x1c425a){return _0x3745a0[_0xf766('0x12')](_0x571849)[_0xf766('0x13')](_0x1c425a);}};}function respondWithFilteredResult(_0x468d30,_0x25dab8){return function(_0x291943){if(_0x291943){var _0x3c1a8c=typeof _0x25dab8['offset']==='undefined'&&typeof _0x25dab8[_0xf766('0x14')]===_0xf766('0x15');var _0x5dace2=_0x291943['count'];var _0x4b7e9c=_0x3c1a8c?0x0:_0x25dab8[_0xf766('0x16')];var _0xfb55da=_0x3c1a8c?_0x291943[_0xf766('0x17')]:_0x25dab8[_0xf766('0x16')]+_0x25dab8['limit'];var _0x5b6030;if(_0xfb55da>=_0x5dace2){_0xfb55da=_0x5dace2;_0x5b6030=0xc8;}else{_0x5b6030=0xce;}_0x468d30[_0xf766('0x12')](_0x5b6030);return _0x468d30['set'](_0xf766('0x18'),_0x4b7e9c+'-'+_0xfb55da+'/'+_0x5dace2)['json'](_0x291943);}return null;};}function saveUpdates(_0x2d83eb){return function(_0x2cf95d){if(_0x2cf95d){return _0x2cf95d[_0xf766('0x19')](_0x2d83eb)[_0xf766('0x1a')](function(_0xf2b486){return _0xf2b486;});}return null;};}function removeEntity(_0x43479b){return function(_0x3b3396){if(_0x3b3396){return _0x3b3396[_0xf766('0x1b')]()['then'](function(){_0x43479b[_0xf766('0x12')](0xcc)[_0xf766('0x1c')]();});}};}function handleEntityNotFound(_0x5783f3){return function(_0x36310e){if(!_0x36310e){_0x5783f3[_0xf766('0x1d')](0x194);}return _0x36310e;};}function handleError(_0x1fe319,_0x3ea370){_0x3ea370=_0x3ea370||0x1f4;return function(_0x4da08a){logger['error'](_0x4da08a[_0xf766('0x1e')]);if(_0x4da08a['name']){delete _0x4da08a[_0xf766('0x1f')];}_0x1fe319[_0xf766('0x12')](_0x3ea370)['send'](_0x4da08a);};}exports['index']=function(_0x39ae5b,_0x47196b){var _0x2f0289={},_0x15bf10={},_0x3f7fad={'count':0x0,'rows':[]};return db[_0xf766('0x20')]['describe']()[_0xf766('0x1a')](function(_0x14953d){var _0x6e7ad7=[];for(var _0x1bbeb5=0x0;_0x1bbeb5<Object[_0xf766('0x21')](_0x14953d)[_0xf766('0x22')];_0x1bbeb5++){var _0x31feaf=Object['keys'](_0x14953d)[_0x1bbeb5];if(_[_0xf766('0x23')](_0x31feaf,_0xf766('0x24'))){_0x6e7ad7['push'](db[_0xf766('0x25')]['findOne']({'where':{'id':_[_0xf766('0x26')](_0x31feaf,_0xf766('0x24'))},'raw':!![]}));}}return BPromise['all'](_0x6e7ad7)[_0xf766('0x1a')](function(_0x5748d4){for(var _0x240300=0x0;_0x240300<_0x5748d4['length'];_0x240300++){if(_0x5748d4[_0x240300]){var _0xb2e46c='cf_'+_0x5748d4[_0x240300]['id'];var _0x16fcb4=_0x14953d[_0xb2e46c];_0x16fcb4[_0xf766('0x27')]=_0x5748d4[_0x240300][_0xf766('0x28')];}}return _0x14953d;});})[_0xf766('0x1a')](function(_0x15125b){_0x15bf10[_0xf766('0x29')]=_[_0xf766('0x21')](_0x15125b);_0x15bf10['query']=_['keys'](_0x39ae5b[_0xf766('0x2a')]);_0x15bf10[_0xf766('0x2b')]=_['intersection'](_0x15bf10[_0xf766('0x29')],_0x15bf10[_0xf766('0x2a')]);_0x2f0289[_0xf766('0x2c')]=_[_0xf766('0x2d')](_0x15bf10['model'],qs['fields'](_0x39ae5b[_0xf766('0x2a')]['fields']));_0x2f0289['attributes']=_0x2f0289[_0xf766('0x2c')][_0xf766('0x22')]?_0x2f0289[_0xf766('0x2c')]:_0x15bf10[_0xf766('0x29')];if(!_0x39ae5b[_0xf766('0x2a')][_0xf766('0x2e')](_0xf766('0x2f'))){_0x2f0289[_0xf766('0x14')]=qs[_0xf766('0x14')](_0x39ae5b[_0xf766('0x2a')]['limit']);_0x2f0289[_0xf766('0x16')]=qs[_0xf766('0x16')](_0x39ae5b[_0xf766('0x2a')][_0xf766('0x16')]);}_0x2f0289[_0xf766('0x30')]=qs['sort'](_0x39ae5b[_0xf766('0x2a')][_0xf766('0x31')]);_0x2f0289[_0xf766('0x32')]=qs[_0xf766('0x2b')](_['pick'](_0x39ae5b[_0xf766('0x2a')],_0x15bf10[_0xf766('0x2b')]),_0x15125b);var _0x3f909f=[];var _0x25f6a1=squel[_0xf766('0x33')]()[_0xf766('0x34')]('id')[_0xf766('0x34')](_0xf766('0x1f'))[_0xf766('0x34')](_0xf766('0x35'))['from']('tools_tags');var _0x1aedfe=squel[_0xf766('0x33')]()[_0xf766('0x36')]('cm_contacts','c')[_0xf766('0x37')](_0xf766('0x38'),'uc',_0xf766('0x39'))[_0xf766('0x37')]('cm_contact_has_tags','ct',_0xf766('0x3a'))[_0xf766('0x37')](_0xf766('0x3b'),'t','t.id\x20=\x20ct.TagId')['where'](_0xf766('0x3c'));var _0xdbf359=squel[_0xf766('0x3d')]();var _0xbe8dcf=[];var _0x4af140=squel['expr']();var _0x40213a;if(_0x39ae5b[_0xf766('0x2a')][_0xf766('0x3e')]){_0x40213a=as[_0xf766('0x3f')](_0x39ae5b['query'][_0xf766('0x3e')]);var _0x4f0a03=_0x40213a[_0xf766('0x40')];for(var _0x32eaac=0x0;_0x32eaac<_0x40213a['conditions']['length'];_0x32eaac++){var _0x7bb945=_0x40213a[_0xf766('0x41')][_0x32eaac];var _0x4c1e1e='c';var _0x287177=_(_0x15125b)[_0xf766('0x21')]()[_0xf766('0x42')](function(_0x58bcdc){return _0x58bcdc===_0x7bb945[_0xf766('0x34')];});if(_0x287177)_0x287177=_0x15125b[_0x7bb945[_0xf766('0x34')]];if(!_0x287177){if(_0x7bb945['field']===_0xf766('0x43')){var _0x3f6799=_0x7bb945[_0xf766('0x44')]['split'](',')[_0xf766('0x45')](function(_0x1f3b32){return Number(_0x1f3b32);});_0x3f6799['forEach'](function(_0x548556){_0x4af140['or'](_0xf766('0x46'),'%,'+_0x548556+',%');});_0xbe8dcf=_['union'](_0xbe8dcf,_0x3f6799);}else if(_0x7bb945[_0xf766('0x34')]===_0xf766('0x47')){_0xdbf359[_0xf766('0x48')](_0xf766('0x49'),_0x7bb945[_0xf766('0x44')]);}}else{if(_0x7bb945[_0xf766('0x34')]===_0xf766('0x4a')||_0x287177[_0xf766('0x27')]===_0xf766('0x4b'))_0x7bb945[_0xf766('0x4c')]='DATE';var _0x38def9=as[_0xf766('0x4d')](_0x4c1e1e,_0x287177['type'],_0x7bb945);_0xdbf359[_0x4f0a03](_0x38def9['text'],_0x38def9['value'][_0xf766('0x4e')],_0x38def9[_0xf766('0x44')][_0xf766('0x1c')]);}}}else{var _0x193b4c=_(Object['keys'](_0x39ae5b[_0xf766('0x2a')]))[_0xf766('0x45')](function(_0xe570f2){return _0x15125b[_0xf766('0x2e')](_0xe570f2)?_0xe570f2:undefined;})[_0xf766('0x4f')](function(_0x4233d7){return!_[_0xf766('0x50')](_0x4233d7);})[_0xf766('0x44')]();if(_0x39ae5b[_0xf766('0x2a')][_0xf766('0x51')])_0x193b4c[_0xf766('0x52')](_0xf766('0x51'));if(!_[_0xf766('0x53')](_0x193b4c)){_0x193b4c['forEach'](function(_0x437a23){if(_0x437a23===_0xf766('0x54')){_0x1aedfe[_0xf766('0x32')](_0xf766('0x55'),[]['concat'](_0x39ae5b[_0xf766('0x2a')][_0x437a23]));}else if(_0x437a23==='Contact'){var _0xd5bcdc='%'+_0x39ae5b[_0xf766('0x2a')][_0x437a23]+'%';_0x1aedfe[_0xf766('0x32')](_0xf766('0x56'),_0xd5bcdc);}else{_0x1aedfe[_0xf766('0x32')]('c.'+_0x437a23+_0xf766('0x57'),_0x39ae5b['query'][_0x437a23]);}});}if(_0x39ae5b[_0xf766('0x2a')][_0xf766('0x58')]){_0xbe8dcf=_[_0xf766('0x59')](_0x39ae5b[_0xf766('0x2a')][_0xf766('0x58')])?_0x39ae5b[_0xf766('0x2a')][_0xf766('0x58')]:new Array(_0x39ae5b['query'][_0xf766('0x58')]);_0xbe8dcf[_0xf766('0x5a')](function(_0x29fac5){_0x4af140['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29fac5+',%');});}if(_0x39ae5b[_0xf766('0x2a')][_0xf766('0x4f')]){var _0x209228=_0x39ae5b['query']['filter'][_0xf766('0x5b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x209228['split']('\x20')[_0xf766('0x22')]>0x1){_0xdbf359['or'](_0xf766('0x5c'),qs[_0xf766('0x5d')](_0x209228),null);}else{if(qs['isNumeric'](_0x209228)){_0xdbf359['or'](_0xf766('0x5e'),_0x209228+'%');_0xdbf359['or'](_0xf766('0x5f'),_0x209228+'%');_0xdbf359['or']('c.mobile\x20LIKE\x20?',_0x209228+'%');_0xdbf359['or'](_0xf766('0x60'),_0x209228+'%');}else if(qs[_0xf766('0x61')](_0x209228)){_0xdbf359['or'](_0xf766('0x62'),_0x209228+'%');}else{_0xdbf359['or'](_0xf766('0x63'),'%'+_0x209228+'%');_0xdbf359['or']('c.lastName\x20LIKE\x20?','%'+_0x209228+'%');_0xdbf359['or'](_0xf766('0x62'),'%'+_0x209228+'%');}}}}_0x1aedfe[_0xf766('0x32')](_0xdbf359);_0x1aedfe[_0xf766('0x64')](_0xf766('0x65'));var _0x40cef9={'type':db[_0xf766('0x66')][_0xf766('0x67')]['SELECT'],'raw':!![]};var _0x3e88f5=_0x1aedfe[_0xf766('0x68')]()[_0xf766('0x34')]('c.id');if(_0x2f0289[_0xf766('0x30')]){_0x2f0289[_0xf766('0x30')][_0xf766('0x5a')](function(_0x9efefd){_0x1aedfe[_0xf766('0x30')]('c.'+_0x9efefd[0x0],_0x9efefd[0x1]===_0xf766('0x69')?![]:!![]);});}if(!_['isEmpty'](_0xbe8dcf)){_0x1aedfe[_0xf766('0x6a')](_0x4af140);_0x3e88f5[_0xf766('0x32')](_0xf766('0x6b'),_0xbe8dcf);}BPromise[_0xf766('0x6c')]()[_0xf766('0x1a')](function(){if(!_0x40213a)return;if(_0x39ae5b[_0xf766('0x6d')]['role']!==_0xf766('0x6e'))return;if(!_['some'](_0x40213a[_0xf766('0x41')],[_0xf766('0x34'),_0xf766('0x47')])){return _0x39ae5b['user'][_0xf766('0x6f')]({'attributes':['id'],'raw':!![]})[_0xf766('0x1a')](function(_0x47f4d0){if(_[_0xf766('0x53')](_0x47f4d0)){_0x3e88f5[_0xf766('0x32')](_0xf766('0x70'));_0x1aedfe[_0xf766('0x32')](_0xf766('0x70'));}else{_0x3e88f5[_0xf766('0x32')](_0xf766('0x55'),_[_0xf766('0x45')](_0x47f4d0,'id'));_0x1aedfe[_0xf766('0x32')]('c.ListId\x20IN\x20?',_[_0xf766('0x45')](_0x47f4d0,'id'));}});}})[_0xf766('0x1a')](function(){if(_0x39ae5b['user'][_0xf766('0x71')]===_0xf766('0x6e')&&!_0x40213a&&!_0x39ae5b['query'][_0xf766('0x54')])return[];return db[_0xf766('0x72')][_0xf766('0x2a')](_0x3e88f5[_0xf766('0x73')](),_0x40cef9);})['then'](function(_0xf1258f){_0x3f7fad[_0xf766('0x17')]=_0xf1258f['length'];if(_0x3f7fad[_0xf766('0x17')]===0x0)return[];return db[_0xf766('0x72')][_0xf766('0x2a')](_0x25f6a1[_0xf766('0x73')](),_0x40cef9)[_0xf766('0x1a')](function(_0x249cb2){_0x3f909f=_[_0xf766('0x74')](_0x249cb2,'id');_0x40cef9=_[_0xf766('0x75')](_0x40cef9,{'model':db[_0xf766('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39ae5b['query']['fields']){_0x2f0289['attributes']['forEach'](function(_0x424e58){_0x1aedfe['field']('c.'+_0x424e58);});}else{_0x1aedfe[_0xf766('0x34')](_0xf766('0x65'));_0x1aedfe[_0xf766('0x34')](_0xf766('0x76'));_0x1aedfe['field'](_0xf766('0x77'));_0x1aedfe[_0xf766('0x34')]('c.phone');_0x1aedfe[_0xf766('0x34')](_0xf766('0x78'));_0x1aedfe[_0xf766('0x34')](_0xf766('0x79'));_0x1aedfe['field'](_0xf766('0x7a'));_0x1aedfe[_0xf766('0x34')](_0xf766('0x7b'));_0x1aedfe[_0xf766('0x34')]('c.createdAt');_0x1aedfe['field'](_0xf766('0x7c'));_0x1aedfe[_0xf766('0x34')](_0xf766('0x7d'));_0x1aedfe['field'](_0xf766('0x7e'),_0xf766('0x7f'));}if(_0x2f0289[_0xf766('0x14')])_0x1aedfe[_0xf766('0x14')](_0x2f0289[_0xf766('0x14')]);if(_0x2f0289[_0xf766('0x16')])_0x1aedfe[_0xf766('0x16')](_0x2f0289[_0xf766('0x16')]);return db[_0xf766('0x72')][_0xf766('0x2a')](_0x1aedfe[_0xf766('0x73')](),_0x40cef9);});})[_0xf766('0x1a')](function(_0x12fc72){_0x12fc72[_0xf766('0x5a')](function(_0x56d3ad){if(_0x56d3ad[_0xf766('0x7f')]){_0x56d3ad[_0xf766('0x80')]=[];_0x56d3ad[_0xf766('0x7f')][_0xf766('0x81')](',')['forEach'](function(_0x414959){_0x56d3ad[_0xf766('0x80')][_0xf766('0x52')](_0x3f909f[_0x414959]);});}delete _0x56d3ad[_0xf766('0x7f')];});_0x3f7fad['rows']=_0x12fc72;return _0x3f7fad;})['then'](respondWithFilteredResult(_0x47196b,_0x2f0289));})[_0xf766('0x82')](handleError(_0x47196b,null));};exports[_0xf766('0x1b')]=function(_0x33a7b9,_0x2ab68b){return db['CmContact'][_0xf766('0x42')]({'where':{'id':_0x33a7b9[_0xf766('0x83')]['id']}})[_0xf766('0x1a')](handleEntityNotFound(_0x2ab68b,null))[_0xf766('0x1a')](removeEntity(_0x2ab68b,null))['catch'](handleError(_0x2ab68b,null));};exports[_0xf766('0x84')]=function(_0x1f853d,_0x4121fc){return db['CmContact'][_0xf766('0x84')]()[_0xf766('0x1a')](function(_0xb55ebb){delete _0xb55ebb[_0xf766('0x85')];for(var _0x3ac7bf=0x0;_0x3ac7bf<Object['keys'](_0xb55ebb)[_0xf766('0x22')];_0x3ac7bf++){var _0x14a16d=Object['keys'](_0xb55ebb)[_0x3ac7bf];if(!_[_0xf766('0x23')](_0x14a16d,_0xf766('0x24'))){_0xb55ebb[_0x14a16d][_0xf766('0x86')]=_0x14a16d;_0xb55ebb[_0x14a16d]['displayName']=_0x14a16d;}}return _0xb55ebb;})[_0xf766('0x1a')](function(_0x58382b){var _0x34fea7={'where':Boolean(_0x1f853d['query']['analytics'])===!![]?undefined:{'$or':[{'ListId':_0x1f853d[_0xf766('0x2a')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xf766('0x25')]['findAll'](_0x34fea7)[_0xf766('0x1a')](function(_0x5e5341){for(var _0x4d8826=0x0;_0x4d8826<_0x5e5341[_0xf766('0x22')];_0x4d8826++){var _0x2e6df5=_0xf766('0x24')+_0x5e5341[_0x4d8826]['id'];_0x58382b[_0x2e6df5][_0xf766('0x86')]=_0x2e6df5;_0x58382b[_0x2e6df5][_0xf766('0x87')]=_0x5e5341[_0x4d8826][_0xf766('0x88')];_0x58382b[_0x2e6df5]['custom']={'type':_0x5e5341[_0x4d8826]['type'],'values':_0x5e5341[_0x4d8826]['values']};}Object[_0xf766('0x21')](_0x58382b)[_0xf766('0x5a')](function(_0x5240fc){if(!_0x58382b[_0x5240fc]['hasOwnProperty'](_0xf766('0x86'))){delete _0x58382b[_0x5240fc];}});return _0x58382b;});})[_0xf766('0x1a')](respondWithResult(_0x4121fc,null))['catch'](handleError(_0x4121fc,null));};exports[_0xf766('0x75')]=function(_0x25bfbd,_0x2a7bbf){var _0x212f73;var _0x28e061;var _0x32b748;if(_0x25bfbd[_0xf766('0x89')]['id']){delete _0x25bfbd[_0xf766('0x89')]['id'];}return db['CmContact'][_0xf766('0x8a')]({'where':{'id':[_0x25bfbd[_0xf766('0x89')]['to'],_0x25bfbd['body']['from']]}})[_0xf766('0x1a')](function(_0x5c9f05){if(_0x5c9f05){if(_0x5c9f05[_0xf766('0x22')]!==0x2){return null;}_0x5c9f05[0x0]=_0x5c9f05[0x0][_0xf766('0x8b')]({'plain':!![]});_0x5c9f05[0x1]=_0x5c9f05[0x1][_0xf766('0x8b')]({'plain':!![]});delete _0x5c9f05[0x0]['id'];delete _0x5c9f05[0x1]['id'];return _[_0xf766('0x8c')](_0x5c9f05[0x0],_0x5c9f05[0x1],function(_0x37556d,_0x3657dc){if(Array[_0xf766('0x59')](_0x3657dc)&&!_0x3657dc['length']){return _0x37556d;}else if(!_0x3657dc){return _0x37556d;}});}})[_0xf766('0x1a')](handleEntityNotFound(_0x2a7bbf,null))[_0xf766('0x1a')](function(_0x37943b){if(_0x37943b){if(_0x37943b['tags']&&_[_0xf766('0x59')](_0x37943b[_0xf766('0x85')])){_0x37943b[_0xf766('0x85')]=_0x37943b[_0xf766('0x85')]['join']();}logger['info'](_0xf766('0x8d'),_0x25bfbd[_0xf766('0x89')]['to'],_0x25bfbd[_0xf766('0x89')]['from']);return db[_0xf766('0x8e')]['destroy']({'where':{'ContactId':[_0x25bfbd[_0xf766('0x89')]['to'],_0x25bfbd['body'][_0xf766('0x36')]]}})[_0xf766('0x1a')](function(_0x33bb9d){logger[_0xf766('0x8f')](_0xf766('0x90'),_0x33bb9d);return db[_0xf766('0x91')][_0xf766('0x1b')]({'where':{'ContactId':[_0x25bfbd[_0xf766('0x89')]['to'],_0x25bfbd[_0xf766('0x89')][_0xf766('0x36')]]}})[_0xf766('0x1a')](function(_0x226a0a){logger[_0xf766('0x8f')](_0xf766('0x92'),_0x226a0a);return db['CmContact']['create'](_0x37943b);});});}})['then'](function(_0x5b5f26){if(_0x5b5f26){_0x212f73=_0x5b5f26;_0x28e061={'ContactId':_0x212f73['id']};_0x32b748={'where':{'ContactId':[_0x25bfbd['body']['to'],_0x25bfbd[_0xf766('0x89')]['from']]}};return db[_0xf766('0x93')][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0x94')]['update'](_0x28e061,_0x32b748);}})['then'](function(){if(_0x212f73){return db['ChatOfflineMessage']['update'](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0x95')][_0xf766('0x19')](_0x28e061,_0x32b748);}})['then'](function(){if(_0x212f73){return db['MailMessage'][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0x95')][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0x96')][_0xf766('0x19')](_0x28e061,_0x32b748);}})['then'](function(){if(_0x212f73){return db[_0xf766('0x97')]['update'](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0x98')][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0x99')][_0xf766('0x19')](_0x28e061,_0x32b748);}})['then'](function(){if(_0x212f73){return db['FaxMessage']['update'](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0x9a')][_0xf766('0x19')](_0x28e061,_0x32b748);}})['then'](function(){if(_0x212f73){return db[_0xf766('0x9b')][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db['CmHopperFinal']['update'](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0x9c')][_0xf766('0x19')](_0x28e061,_0x32b748);}})['then'](function(){if(_0x212f73){return db[_0xf766('0x9d')][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db['VoiceCallReport']['update'](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db['ChatQueueReport']['update'](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0x9e')][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0x9f')][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0xa0')][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0xa1')][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0xa2')][_0xf766('0x19')](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0xa3')]['update'](_0x28e061,_0x32b748);}})[_0xf766('0x1a')](function(){if(_0x212f73){return db[_0xf766('0xa4')][_0xf766('0x19')](_0x28e061,_0x32b748);}})['then'](function(){if(_0x212f73){return db[_0xf766('0xa5')]['update'](_0x28e061,_0x32b748);}})['then'](function(){if(_0x212f73){return db[_0xf766('0x20')][_0xf766('0x1b')]({'where':{'id':[_0x25bfbd['body']['to'],_0x25bfbd[_0xf766('0x89')][_0xf766('0x36')]]}});}})[_0xf766('0x1a')](function(){if(_0x212f73){return _0x212f73;}})[_0xf766('0x1a')](respondWithResult(_0x2a7bbf,null))[_0xf766('0x82')](handleError(_0x2a7bbf,null));};exports[_0xf766('0xa6')]=function(_0x5dbdd0,_0x3bf263){return db[_0xf766('0x20')][_0xf766('0x84')]()[_0xf766('0x1a')](function(_0x5d321a){if(_0x5dbdd0[_0xf766('0x89')][_0xf766('0x85')]&&_[_0xf766('0x59')](_0x5dbdd0[_0xf766('0x89')][_0xf766('0x85')])){if(_0x5dbdd0[_0xf766('0x89')][_0xf766('0x85')][_0xf766('0x22')]){_0x5dbdd0[_0xf766('0x89')]['tags']=_0x5dbdd0[_0xf766('0x89')][_0xf766('0x85')][_0xf766('0xa7')](';')+';';}else{_0x5dbdd0[_0xf766('0x89')][_0xf766('0x85')]=null;}}else{_0x5dbdd0[_0xf766('0x89')]['tags']=null;}if(!_[_0xf766('0x50')](_0x5dbdd0['body']['dialTimezone'])){var _0x25295b=_0x5dbdd0[_0xf766('0x89')]['dialTimezone'];if(!_[_0xf766('0x50')](shared['timezones'][_0x25295b]))_0x5dbdd0[_0xf766('0x89')]['utcOffset']=shared['timezones'][_0x25295b][_0xf766('0xa8')];}return db[_0xf766('0x20')]['create'](_0x5dbdd0[_0xf766('0x89')],{'fields':_[_0xf766('0x21')](_0x5d321a),'raw':!![]});})[_0xf766('0x1a')](respondWithResult(_0x3bf263,0xc9))[_0xf766('0x82')](handleError(_0x3bf263,null));};exports['bulkCreate']=function(_0x207baa,_0x21811d){var _0x5b43e0=0x0;var _0x12e664=0x0;var _0x2b2fc3=0x0;return db[_0xf766('0x20')][_0xf766('0x84')]()['then'](function(_0x36499b){return BPromise['each'](_0x207baa['body'],function(_0x1b466b){var _0x389105={'where':{'$or':[]},'defaults':_0x1b466b,'fields':_[_0xf766('0x21')](_0x36499b),'raw':!![]};if(_0x1b466b['duplicates']){for(var _0x4e669e=0x0;_0x4e669e<_0x1b466b[_0xf766('0xa9')][_0xf766('0x22')];_0x4e669e++){var _0x1525ef={};_0x1525ef[_0x1b466b[_0xf766('0xa9')][_0x4e669e]]=_0x1b466b[_0x1b466b[_0xf766('0xa9')][_0x4e669e]];_0x389105[_0xf766('0x32')]['$or']['push'](_0x1525ef);}_0x389105[_0xf766('0x32')][_0xf766('0x54')]=_0x1b466b[_0xf766('0x54')];}return db[_0xf766('0x20')][_0xf766('0xaa')](_0x389105)['spread'](function(_0x84e7c7,_0x2e7c82){if(_0x2e7c82){_0x5b43e0++;}else{_0x2b2fc3++;}})[_0xf766('0x82')](function(){_0x12e664++;});});})['then'](function(_0x3ac9d2){if(_0x3ac9d2){return{'success':_0x5b43e0,'failure':_0x12e664,'duplicates':_0x2b2fc3};}})[_0xf766('0x1a')](respondWithResult(_0x21811d,0xc9))[_0xf766('0x82')](handleError(_0x21811d,null));};exports[_0xf766('0xab')]=function(_0xa3d07a,_0x3980a1){var _0x3b79ae;return db[_0xf766('0x20')][_0xf766('0x84')]()[_0xf766('0x1a')](function(_0x263c40){return db[_0xf766('0x20')]['find']({'where':{'id':_0xa3d07a[_0xf766('0x83')]['id']},'include':[{'model':db[_0xf766('0x43')],'as':'Tags','attributes':['id',_0xf766('0x1f'),_0xf766('0x35')],'required':_0xa3d07a[_0xf766('0x2a')][_0xf766('0x58')]?!![]:![]}],'attributes':_[_0xf766('0x21')](_0x263c40)});})[_0xf766('0x1a')](function(_0x1d8a90){if(!_[_0xf766('0x50')](_0x1d8a90)){_0x3b79ae=_0x1d8a90[_0xf766('0x8b')]({'plain':!![]});var _0x1f1ddd={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1d8a90&&_0x1d8a90[_0xf766('0x54')]){if(_0x1d8a90['ListId']){_0x1f1ddd['where'][_0xf766('0xac')]['push']({'ListId':{'$ne':_0x1d8a90[_0xf766('0x54')]}});}}return db['CmCustomField']['findAll'](_0x1f1ddd);}})[_0xf766('0x1a')](function(_0x297c64){if(!_[_0xf766('0x50')](_0x297c64)){return _[_0xf766('0xad')](_0x3b79ae,_['map'](_0x297c64,function(_0x43ba2f){return util['format']('cf_%d',_0x43ba2f['id']);}));}})[_0xf766('0x1a')](handleEntityNotFound(_0x3980a1,null))[_0xf766('0x1a')](respondWithResult(_0x3980a1,null))[_0xf766('0x82')](handleError(_0x3980a1,null));};exports[_0xf766('0x19')]=function(_0x6a2823,_0xb58a5b){var _0x3d2b26;if(_0x6a2823[_0xf766('0x89')]['id']){delete _0x6a2823[_0xf766('0x89')]['id'];}if(!_[_0xf766('0x50')](_0x6a2823['body']['dialTimezone'])){var _0x1c5194=_0x6a2823[_0xf766('0x89')][_0xf766('0xae')];if(!_[_0xf766('0x50')](shared[_0xf766('0xaf')][_0x1c5194]))_0x6a2823[_0xf766('0x89')]['utcOffset']=shared[_0xf766('0xaf')][_0x1c5194][_0xf766('0xa8')];}return db['CmContact']['find']({'where':{'id':_0x6a2823[_0xf766('0x83')]['id']}})[_0xf766('0x1a')](handleEntityNotFound(_0xb58a5b,null))[_0xf766('0x1a')](saveUpdates(_0x6a2823[_0xf766('0x89')],null))['then'](function(_0x585bc2){_0x3d2b26=_0x585bc2;var _0x337dda={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x585bc2&&_0x585bc2['ListId']){if(_0x585bc2[_0xf766('0x54')]){_0x337dda[_0xf766('0x32')]['$and'][_0xf766('0x52')]({'ListId':{'$ne':_0x585bc2['ListId']}});}}return db[_0xf766('0x25')][_0xf766('0x8a')](_0x337dda);})[_0xf766('0x1a')](function(_0x557106){if(_0x557106){return _[_0xf766('0xad')](_['pickBy'](_0x6a2823[_0xf766('0x89')],function(_0x2fefd9,_0x31170f){return _[_0xf766('0x23')](_0x31170f,_0xf766('0x24'));}),_[_0xf766('0x45')](_0x557106,function(_0x498c14){return util[_0xf766('0xb0')](_0xf766('0xb1'),_0x498c14['id']);}));}})[_0xf766('0x1a')](function(_0x3ffa8a){if(_0x3ffa8a&&!_[_0xf766('0x53')](_0x3ffa8a)){var _0x423480=squel[_0xf766('0x19')]()['table'](_0xf766('0xb2'))[_0xf766('0xb3')](_0x3ffa8a)[_0xf766('0x32')]('id\x20=\x20?',_0x6a2823[_0xf766('0x83')]['id'])[_0xf766('0xb4')]();return db[_0xf766('0x72')][_0xf766('0x2a')](_0x423480[_0xf766('0xb5')],{'replacements':_0x423480['values']});}})[_0xf766('0x1a')](function(){if(_0x6a2823['body'][_0xf766('0xb6')]&&_0x3d2b26){return db[_0xf766('0x8e')][_0xf766('0x19')]({'phone':_0x6a2823[_0xf766('0x89')]['phone']},{'where':{'ContactId':_0x3d2b26['id']}});}})['then'](function(){return _0x3d2b26;})['then'](respondWithResult(_0xb58a5b,null))[_0xf766('0x82')](handleError(_0xb58a5b,null));};exports[_0xf766('0xb7')]=function(_0x56b3cd,_0x22cebd){var _0x3651bc={};var _0x53acd9={};var _0x1a4d46;var _0x4103e6;return db[_0xf766('0x20')][_0xf766('0xb8')]({'where':{'id':_0x56b3cd['params']['id']}})[_0xf766('0x1a')](handleEntityNotFound(_0x22cebd,null))[_0xf766('0x1a')](function(_0x5f1de7){if(_0x5f1de7){_0x1a4d46=_0x5f1de7;_0x53acd9[_0xf766('0x29')]=_[_0xf766('0x21')](db[_0xf766('0x43')][_0xf766('0xb9')]);_0x53acd9[_0xf766('0x2a')]=_[_0xf766('0x21')](_0x56b3cd[_0xf766('0x2a')]);_0x53acd9['filters']=_[_0xf766('0x2d')](_0x53acd9[_0xf766('0x29')],_0x53acd9[_0xf766('0x2a')]);_0x3651bc[_0xf766('0x2c')]=_[_0xf766('0x2d')](_0x53acd9[_0xf766('0x29')],qs['fields'](_0x56b3cd[_0xf766('0x2a')]['fields']));_0x3651bc[_0xf766('0x2c')]=_0x3651bc[_0xf766('0x2c')][_0xf766('0x22')]?_0x3651bc[_0xf766('0x2c')]:_0x53acd9[_0xf766('0x29')];_0x3651bc[_0xf766('0x30')]=qs[_0xf766('0x31')](_0x56b3cd[_0xf766('0x2a')][_0xf766('0x31')]);_0x3651bc[_0xf766('0x32')]=qs['filters'](_[_0xf766('0xba')](_0x56b3cd['query'],_0x53acd9[_0xf766('0x2b')]));if(_0x56b3cd['query']['filter']){_0x3651bc[_0xf766('0x32')]=_[_0xf766('0x75')](_0x3651bc['where'],{'$or':_[_0xf766('0x45')](_0x3651bc[_0xf766('0x2c')],function(_0x1bc93c){var _0x25b4ca={};_0x25b4ca[_0x1bc93c]={'$like':'%'+_0x56b3cd[_0xf766('0x2a')][_0xf766('0x4f')]+'%'};return _0x25b4ca;})});}_0x3651bc=_[_0xf766('0x75')]({},_0x3651bc,_0x56b3cd[_0xf766('0xbb')]);return _0x1a4d46[_0xf766('0xb7')](_0x3651bc);}})['then'](function(_0x64bea5){if(_0x64bea5){_0x4103e6=_0x64bea5[_0xf766('0x22')];if(!_0x56b3cd['query'][_0xf766('0x2e')](_0xf766('0x2f'))){_0x3651bc[_0xf766('0x14')]=qs['limit'](_0x56b3cd[_0xf766('0x2a')][_0xf766('0x14')]);_0x3651bc[_0xf766('0x16')]=qs[_0xf766('0x16')](_0x56b3cd[_0xf766('0x2a')][_0xf766('0x16')]);}return _0x1a4d46[_0xf766('0xb7')](_0x3651bc);}})[_0xf766('0x1a')](function(_0x37ac0b){if(_0x37ac0b){return _0x37ac0b?{'count':_0x4103e6,'rows':_0x37ac0b}:null;}})[_0xf766('0x1a')](respondWithResult(_0x22cebd,null))[_0xf766('0x82')](handleError(_0x22cebd,null));};exports[_0xf766('0xbc')]=function(_0x2e4b34,_0x18cba8){if(_0x2e4b34[_0xf766('0x89')]['id']){delete _0x2e4b34[_0xf766('0x89')]['id'];}return db['CmContact'][_0xf766('0xb8')]({'where':{'id':_0x2e4b34[_0xf766('0x83')]['id']}})[_0xf766('0x1a')](handleEntityNotFound(_0x18cba8,null))[_0xf766('0x1a')](function(_0x47fdf3){if(_0x47fdf3){return _0x47fdf3[_0xf766('0xbc')](_0x2e4b34['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x18cba8,null))[_0xf766('0x82')](handleError(_0x18cba8,null));};exports[_0xf766('0xbd')]=function(_0xc11a08,_0x4d616a){var _0x30f486={'raw':![],'where':{}};var _0x2d68e9={};var _0x55c648={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0xc11a08[_0xf766('0x83')]['id']}})[_0xf766('0x1a')](handleEntityNotFound(_0x4d616a,null))[_0xf766('0x1a')](function(_0x384a8e){if(_0x384a8e){_0x2d68e9[_0xf766('0x29')]=_[_0xf766('0x21')](db['CmHopper'][_0xf766('0xb9')]);_0x2d68e9[_0xf766('0x2a')]=_[_0xf766('0x21')](_0xc11a08[_0xf766('0x2a')]);_0x2d68e9['filters']=_['intersection'](_0x2d68e9[_0xf766('0x29')],_0x2d68e9[_0xf766('0x2a')]);_0x30f486[_0xf766('0x2c')]=_[_0xf766('0x2d')](_0x2d68e9[_0xf766('0x29')],qs[_0xf766('0xbe')](_0xc11a08[_0xf766('0x2a')][_0xf766('0xbe')]));_0x30f486['attributes']=_0x30f486[_0xf766('0x2c')][_0xf766('0x22')]?_0x30f486[_0xf766('0x2c')]:_0x2d68e9['model'];if(!_0xc11a08['query'][_0xf766('0x2e')](_0xf766('0x2f'))){_0x30f486['limit']=qs[_0xf766('0x14')](_0xc11a08[_0xf766('0x2a')][_0xf766('0x14')]);_0x30f486[_0xf766('0x16')]=qs[_0xf766('0x16')](_0xc11a08['query']['offset']);}_0x30f486[_0xf766('0x30')]=qs[_0xf766('0x31')](_0xc11a08[_0xf766('0x2a')][_0xf766('0x31')]);_0x30f486[_0xf766('0x32')]=qs[_0xf766('0x2b')](_[_0xf766('0xba')](_0xc11a08[_0xf766('0x2a')],_0x2d68e9[_0xf766('0x2b')]));_0x30f486[_0xf766('0x32')][_0xf766('0xbf')]=_0x384a8e['id'];if(_0xc11a08[_0xf766('0x2a')][_0xf766('0x4f')]){_0x30f486['where']=_[_0xf766('0x75')](_0x30f486['where'],{'$or':_[_0xf766('0x45')](_0x30f486[_0xf766('0x2c')],function(_0x4a2700){var _0x3dc6f7={};_0x3dc6f7[_0x4a2700]={'$like':'%'+_0xc11a08[_0xf766('0x2a')][_0xf766('0x4f')]+'%'};return _0x3dc6f7;})});}_0x30f486=_[_0xf766('0x75')]({},_0x30f486,_0xc11a08[_0xf766('0xbb')]);return db[_0xf766('0x8e')][_0xf766('0x17')]({'where':_0x30f486[_0xf766('0x32')]})[_0xf766('0x1a')](function(_0x259305){_0x55c648['count']=_0x259305;if(_0xc11a08[_0xf766('0x2a')]['includeAll']){_0x30f486[_0xf766('0xc0')]=[{'all':!![]}];}return db['CmHopper'][_0xf766('0x8a')](_0x30f486);})[_0xf766('0x1a')](function(_0x43fbdc){_0x55c648[_0xf766('0xc1')]=_0x43fbdc;return _0x55c648;});}})[_0xf766('0x1a')](respondWithFilteredResult(_0x4d616a,_0x30f486))[_0xf766('0x82')](handleError(_0x4d616a,null));};exports[_0xf766('0xc2')]=function(_0x1b40f8,_0x421e18){var _0x2908b2={'raw':!![],'where':{}};var _0x124e2c={};var _0x333676={'count':0x0,'rows':[]};return db[_0xf766('0x20')][_0xf766('0xb8')]({'where':{'id':_0x1b40f8[_0xf766('0x83')]['id']}})[_0xf766('0x1a')](handleEntityNotFound(_0x421e18,null))[_0xf766('0x1a')](function(_0xdb6532){if(_0xdb6532){_0x124e2c[_0xf766('0x29')]=_[_0xf766('0x21')](db[_0xf766('0x9c')]['rawAttributes']);_0x124e2c[_0xf766('0x2a')]=_[_0xf766('0x21')](_0x1b40f8[_0xf766('0x2a')]);_0x124e2c['filters']=_[_0xf766('0x2d')](_0x124e2c[_0xf766('0x29')],_0x124e2c[_0xf766('0x2a')]);_0x2908b2[_0xf766('0x2c')]=_['intersection'](_0x124e2c[_0xf766('0x29')],qs[_0xf766('0xbe')](_0x1b40f8[_0xf766('0x2a')][_0xf766('0xbe')]));_0x2908b2[_0xf766('0x2c')]=_0x2908b2[_0xf766('0x2c')][_0xf766('0x22')]?_0x2908b2[_0xf766('0x2c')]:_0x124e2c['model'];if(!_0x1b40f8['query'][_0xf766('0x2e')]('nolimit')){_0x2908b2['limit']=qs['limit'](_0x1b40f8[_0xf766('0x2a')]['limit']);_0x2908b2[_0xf766('0x16')]=qs[_0xf766('0x16')](_0x1b40f8['query'][_0xf766('0x16')]);}_0x2908b2[_0xf766('0x30')]=qs['sort'](_0x1b40f8['query']['sort']);_0x2908b2[_0xf766('0x32')]=qs[_0xf766('0x2b')](_[_0xf766('0xba')](_0x1b40f8['query'],_0x124e2c[_0xf766('0x2b')]));_0x2908b2['where']['ContactId']=_0xdb6532['id'];if(_0x1b40f8['query'][_0xf766('0x4f')]){_0x2908b2['where']=_[_0xf766('0x75')](_0x2908b2['where'],{'$or':_[_0xf766('0x45')](_0x2908b2[_0xf766('0x2c')],function(_0x4fbf2e){var _0x159f4d={};_0x159f4d[_0x4fbf2e]={'$like':'%'+_0x1b40f8[_0xf766('0x2a')]['filter']+'%'};return _0x159f4d;})});}_0x2908b2=_[_0xf766('0x75')]({},_0x2908b2,_0x1b40f8[_0xf766('0xbb')]);return db[_0xf766('0x9c')][_0xf766('0x17')]({'where':_0x2908b2[_0xf766('0x32')]})['then'](function(_0x372433){_0x333676[_0xf766('0x17')]=_0x372433;if(_0x1b40f8[_0xf766('0x2a')][_0xf766('0xc3')]){_0x2908b2['include']=[{'all':!![]}];}return db[_0xf766('0x9c')]['findAll'](_0x2908b2);})[_0xf766('0x1a')](function(_0x368da6){_0x333676[_0xf766('0xc1')]=_0x368da6;return _0x333676;});}})[_0xf766('0x1a')](respondWithFilteredResult(_0x421e18,_0x2908b2))['catch'](handleError(_0x421e18,null));};exports[_0xf766('0xc4')]=function(_0x374598,_0x1f1b8b){var _0x7e3d88={'raw':!![],'where':{}};var _0x181313={};var _0x464b63={'count':0x0,'rows':[]};return db[_0xf766('0x20')][_0xf766('0xb8')]({'where':{'id':_0x374598[_0xf766('0x83')]['id']}})[_0xf766('0x1a')](handleEntityNotFound(_0x1f1b8b,null))[_0xf766('0x1a')](function(_0x52a2f9){if(_0x52a2f9){_0x181313[_0xf766('0x29')]=_[_0xf766('0x21')](db[_0xf766('0xc5')][_0xf766('0xb9')]);_0x181313[_0xf766('0x2a')]=_['keys'](_0x374598[_0xf766('0x2a')]);_0x181313[_0xf766('0x2b')]=_['intersection'](_0x181313[_0xf766('0x29')],_0x181313['query']);_0x7e3d88[_0xf766('0x2c')]=_['intersection'](_0x181313[_0xf766('0x29')],qs[_0xf766('0xbe')](_0x374598['query']['fields']));_0x7e3d88['attributes']=_0x7e3d88[_0xf766('0x2c')][_0xf766('0x22')]?_0x7e3d88[_0xf766('0x2c')]:_0x181313[_0xf766('0x29')];if(!_0x374598[_0xf766('0x2a')][_0xf766('0x2e')](_0xf766('0x2f'))){_0x7e3d88[_0xf766('0x14')]=qs[_0xf766('0x14')](_0x374598[_0xf766('0x2a')][_0xf766('0x14')]);_0x7e3d88[_0xf766('0x16')]=qs[_0xf766('0x16')](_0x374598['query'][_0xf766('0x16')]);}_0x7e3d88[_0xf766('0x30')]=qs[_0xf766('0x31')](_0x374598[_0xf766('0x2a')]['sort']);_0x7e3d88[_0xf766('0x32')]=qs[_0xf766('0x2b')](_[_0xf766('0xba')](_0x374598[_0xf766('0x2a')],_0x181313['filters']));_0x7e3d88[_0xf766('0x32')]['ContactId']=_0x52a2f9['id'];if(_0x374598['query'][_0xf766('0x4f')]){_0x7e3d88[_0xf766('0x32')]=_['merge'](_0x7e3d88[_0xf766('0x32')],{'$or':_[_0xf766('0x45')](_0x7e3d88['attributes'],function(_0x2d063b){var _0x535365={};_0x535365[_0x2d063b]={'$like':'%'+_0x374598[_0xf766('0x2a')][_0xf766('0x4f')]+'%'};return _0x535365;})});}_0x7e3d88=_[_0xf766('0x75')]({},_0x7e3d88,_0x374598[_0xf766('0xbb')]);return db['CmHopperFinal'][_0xf766('0x17')]({'where':_0x7e3d88[_0xf766('0x32')]})[_0xf766('0x1a')](function(_0x4e275c){_0x464b63[_0xf766('0x17')]=_0x4e275c;if(_0x374598[_0xf766('0x2a')][_0xf766('0xc3')]){_0x7e3d88['include']=[{'all':!![]}];}return db[_0xf766('0xc5')]['findAll'](_0x7e3d88);})[_0xf766('0x1a')](function(_0x24b5f1){_0x464b63[_0xf766('0xc1')]=_0x24b5f1;return _0x464b63;});}})[_0xf766('0x1a')](respondWithFilteredResult(_0x1f1b8b,_0x7e3d88))[_0xf766('0x82')](handleError(_0x1f1b8b,null));};exports[_0xf766('0xc6')]=function(_0x32b076,_0x18f66d){var _0x4be96d={'raw':!![],'where':{}};var _0x13a4cc={};var _0x18dfcd={'count':0x0,'rows':[]};return db[_0xf766('0x20')][_0xf766('0xb8')]({'where':{'id':_0x32b076[_0xf766('0x83')]['id']}})[_0xf766('0x1a')](handleEntityNotFound(_0x18f66d,null))['then'](function(_0x116ff4){if(_0x116ff4){_0x13a4cc[_0xf766('0x29')]=_[_0xf766('0x21')](db[_0xf766('0xa2')][_0xf766('0xb9')]);_0x13a4cc['query']=_['keys'](_0x32b076[_0xf766('0x2a')]);_0x13a4cc[_0xf766('0x2b')]=_[_0xf766('0x2d')](_0x13a4cc['model'],_0x13a4cc[_0xf766('0x2a')]);_0x4be96d[_0xf766('0x2c')]=_[_0xf766('0x2d')](_0x13a4cc[_0xf766('0x29')],qs[_0xf766('0xbe')](_0x32b076['query'][_0xf766('0xbe')]));_0x4be96d[_0xf766('0x2c')]=_0x4be96d[_0xf766('0x2c')]['length']?_0x4be96d[_0xf766('0x2c')]:_0x13a4cc[_0xf766('0x29')];if(!_0x32b076[_0xf766('0x2a')][_0xf766('0x2e')]('nolimit')){_0x4be96d[_0xf766('0x14')]=qs['limit'](_0x32b076['query'][_0xf766('0x14')]);_0x4be96d[_0xf766('0x16')]=qs[_0xf766('0x16')](_0x32b076[_0xf766('0x2a')][_0xf766('0x16')]);}_0x4be96d[_0xf766('0x30')]=qs[_0xf766('0x31')](_0x32b076[_0xf766('0x2a')][_0xf766('0x31')]);_0x4be96d[_0xf766('0x32')]=qs[_0xf766('0x2b')](_[_0xf766('0xba')](_0x32b076[_0xf766('0x2a')],_0x13a4cc[_0xf766('0x2b')]));_0x4be96d[_0xf766('0x32')][_0xf766('0xbf')]=_0x116ff4['id'];if(_0x32b076[_0xf766('0x2a')][_0xf766('0x4f')]){_0x4be96d[_0xf766('0x32')]=_[_0xf766('0x75')](_0x4be96d[_0xf766('0x32')],{'$or':_[_0xf766('0x45')](_0x4be96d[_0xf766('0x2c')],function(_0x4e6782){var _0x2e834a={};_0x2e834a[_0x4e6782]={'$like':'%'+_0x32b076[_0xf766('0x2a')][_0xf766('0x4f')]+'%'};return _0x2e834a;})});}_0x4be96d=_['merge']({},_0x4be96d,_0x32b076[_0xf766('0xbb')]);return db[_0xf766('0xa2')][_0xf766('0x17')]({'where':_0x4be96d['where']})['then'](function(_0x48ff8a){_0x18dfcd[_0xf766('0x17')]=_0x48ff8a;if(_0x32b076['query']['includeAll']){_0x4be96d[_0xf766('0xc0')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xf766('0x8a')](_0x4be96d);})['then'](function(_0x4d97d7){_0x18dfcd['rows']=_0x4d97d7;return _0x18dfcd;});}})['then'](respondWithFilteredResult(_0x18f66d,_0x4be96d))[_0xf766('0x82')](handleError(_0x18f66d,null));};exports[_0xf766('0xc7')]=function(_0x7f827c,_0x1fce10){try{if(!_0x7f827c[_0xf766('0x89')][_0xf766('0x54')]){throw new Error(_0xf766('0xc8'));}if(!_0x7f827c[_0xf766('0x89')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x7f827c[_0xf766('0x89')]['binding_values']){throw new Error(_0xf766('0xc9'));}if(!_0x7f827c['body']['socket_timestamp']){throw new Error(_0xf766('0xca'));}var _0x114566=_0x7f827c[_0xf766('0x89')][_0xf766('0xcb')][_0xf766('0x81')](',');var _0x12182d=_0x7f827c[_0xf766('0x89')][_0xf766('0xcc')][_0xf766('0x81')](',');if(!_0x114566['length']||!_0x12182d[_0xf766('0x22')]||_0x114566[_0xf766('0x22')]!==_0x12182d[_0xf766('0x22')]){throw new Error(_0xf766('0xcd'));}_0x7f827c['body'][_0xf766('0xbe')]=_[_0xf766('0xce')](_0x114566,_0x12182d);if(!_0x7f827c[_0xf766('0x89')][_0xf766('0xbe')][_0xf766('0xb6')]){throw new Error(_0xf766('0xcf'));}if(!_0x7f827c[_0xf766('0x89')][_0xf766('0xbe')][_0xf766('0xd0')]){throw new Error(_0xf766('0xd1'));}var _0x27ac75=path[_0xf766('0xa7')](config[_0xf766('0xd2')],_0xf766('0xd3'),_0x7f827c[_0xf766('0xd4')][_0xf766('0xd5')]);fs['chmodSync'](_0x27ac75,parseInt('0777',0x8));var _0x3d93dd=require('child_process')[_0xf766('0xd6')](path[_0xf766('0xa7')](__dirname,_0xf766('0xd7')),[_0x27ac75,_0x7f827c['body'][_0xf766('0xcb')],_0x7f827c[_0xf766('0x89')][_0xf766('0xcc')],_0x7f827c[_0xf766('0x89')]['ListId'],_0x7f827c['body'][_0xf766('0xd8')],_0x7f827c[_0xf766('0x89')]['duplicates'],_0x7f827c['body'][_0xf766('0xd9')]]);return _0x1fce10[_0xf766('0x12')](0xc8)[_0xf766('0x13')]({'message':_0xf766('0xda'),'pid':_0x3d93dd[_0xf766('0xdb')]});}catch(_0x4c7e06){return _0x1fce10[_0xf766('0x12')](0x1f4)[_0xf766('0xdc')](_0x4c7e06);}};exports[_0xf766('0xdd')]=function(_0x28b698,_0x12649a){var _0xf02a4e=fs[_0xf766('0xde')](_0x28b698[_0xf766('0xd4')][_0xf766('0x3')]);Papa['parse'](_0xf02a4e,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x534a93){return _0x12649a[_0xf766('0x12')](0xc8)[_0xf766('0x13')]({'file':_0x28b698[_0xf766('0xd4')],'fields':_0x534a93['meta']['fields']});}});};exports[_0xf766('0xdf')]=function(_0x2283e9,_0x4b7c09){return db[_0xf766('0x47')][_0xf766('0x8a')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xf766('0x1a')](function(_0x183eb4){var _0x555e4b=![];if(!_0x2283e9[_0xf766('0x89')][_0xf766('0x54')]){throw new Error(_0xf766('0xc8'));}if(!_0x2283e9[_0xf766('0x89')][_0xf766('0xe0')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x2283e9[_0xf766('0x89')][_0xf766('0xe0')][_0xf766('0xd0')]){throw new Error(_0xf766('0xd1'));}if(!_0x2283e9['body'][_0xf766('0xd9')]){throw new Error(_0xf766('0xca'));}var _0xd61f54=require(_0xf766('0xe1'))[_0xf766('0xd6')](path['join'](__dirname,_0xf766('0xe2')),[_0x2283e9[_0xf766('0x83')]['id'],JSON[_0xf766('0xe3')](_0x2283e9[_0xf766('0x89')]),JSON['stringify'](_0x183eb4)]);_0xd61f54['on'](_0xf766('0xe4'),function(){_0x555e4b=!![];return _0x4b7c09[_0xf766('0x12')](0xc8)[_0xf766('0x13')]({'message':_0xf766('0xe5'),'pid':_0xd61f54['pid']});});_0xd61f54['on'](_0xf766('0xe6'),function(_0x47ca09){if(_0x47ca09&&!_0x555e4b){return _0x4b7c09[_0xf766('0x12')](0x1f4)[_0xf766('0x13')]({'message':'error\x20child\x20process','pid':_0xd61f54[_0xf766('0xdb')]});}});})[_0xf766('0x82')](handleError(_0x4b7c09,null));};exports[_0xf766('0xe7')]=function(_0x58d415,_0x1be55d){var _0x5b422d=[_0xf766('0xe8'),_0xf766('0xe9'),'sms',_0xf766('0xea'),_0xf766('0xeb'),_0xf766('0xec'),_0xf766('0xed')];var _0x874799={'offset':0x0,'order':qs['sort'](_0xf766('0xee'))},_0x145341={'count':0x0,'rows':[]};Promise[_0xf766('0x6c')]()[_0xf766('0x1a')](function(){if(_0x58d415[_0xf766('0x2a')]['channel']){if(!_[_0xf766('0xef')](_0x5b422d,_0x58d415[_0xf766('0x2a')][_0xf766('0xf0')][_0xf766('0xf1')]())){throw new Error(_0xf766('0xf2'));}_0x5b422d=[_0x58d415[_0xf766('0x2a')][_0xf766('0xf0')]['toLowerCase']()];}if(_0x58d415[_0xf766('0x2a')]['range']){try{var _0x4c84c5=JSON[_0xf766('0xf3')](_0x58d415[_0xf766('0x2a')][_0xf766('0xf4')]);if(!moment(_0x4c84c5['from'])[_0xf766('0xf5')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x4c84c5['to'])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x110c90){throw new Error(_0xf766('0xf6'));}}if(!_0x58d415[_0xf766('0x2a')][_0xf766('0x2e')](_0xf766('0x2f'))){_0x874799['limit']=qs[_0xf766('0x14')](_0x58d415['query'][_0xf766('0x14')]||0xa);_0x874799[_0xf766('0x16')]=qs[_0xf766('0x16')](_0x58d415['query'][_0xf766('0x16')]);}var _0x31ae36=_0x5b422d['map'](function(_0x54c62f){if(_0x54c62f==='voice'){var _0x1dc0ec={'attributes':['id',_0xf766('0xf7'),_0xf766('0x28'),_0xf766('0xf8'),'destination',_0xf766('0xf9'),_0xf766('0xfa'),'endtime',_0xf766('0xfb'),'note',_0xf766('0xfc'),_0xf766('0xfd'),_0xf766('0xfe'),_0xf766('0xff'),_0xf766('0x100')],'where':{'ContactId':_0x58d415[_0xf766('0x83')]['id']},'include':[{'model':db['User'],'as':_0xf766('0x47'),'attributes':['id','name',_0xf766('0x101'),_0xf766('0x88')]}],'order':[[_0xf766('0xfc'),_0xf766('0x69')]]};if(_0x58d415['query'][_0xf766('0xf4')]){_0x1dc0ec[_0xf766('0x32')]['createdAt']={'$gte':_0x4c84c5[_0xf766('0x36')],'$lte':_0x4c84c5['to']};}return db[_0xf766('0x102')][_0xf766('0x103')](_0x1dc0ec)[_0xf766('0x1a')](function(_0x33af9d){_0x145341[_0xf766('0x17')]+=_0x33af9d[_0xf766('0x17')];return _[_0xf766('0x45')](_0x33af9d[_0xf766('0xc1')],function(_0x3e2946){var _0x1f3fb=_0x3e2946[_0xf766('0x8b')]({'plain':!![]});_0x1f3fb[_0xf766('0xf0')]=_0x54c62f;if(_0x1f3fb['User']){_0x1f3fb[_0xf766('0x47')]={'id':_0x1f3fb[_0xf766('0x47')]['id'],'name':_0x1f3fb[_0xf766('0x47')]['name'],'fullname':_0x1f3fb[_0xf766('0x47')][_0xf766('0x101')],'alias':_0x1f3fb[_0xf766('0x47')][_0xf766('0x88')]};}return _0x1f3fb;});});}else{var _0xfddc44=_[_0xf766('0x104')](_0x54c62f)+(_0x54c62f==='chat'?_0xf766('0x105'):'Account');var _0x23cfe1={'attributes':['id',_0xf766('0x106'),_0xf766('0x107'),'createdAt',_0xf766('0x108'),_0xf766('0x109'),_0xf766('0x10a'),_0xf766('0x10b'),_0xf766('0x100'),_0xfddc44+'Id'],'where':{'ContactId':_0x58d415['params']['id']},'include':[{'model':db[_0xfddc44],'as':_0xf766('0x10c'),'attributes':['id',_0xf766('0x1f'),_0xf766('0x10d')]},{'model':db[_0xf766('0x47')],'as':_0xf766('0x10e'),'attributes':['id','name','fullname']},{'model':db[_0xf766('0x43')],'as':_0xf766('0x80'),'attributes':['id',_0xf766('0x1f'),_0xf766('0x35')],'through':{'attributes':[]}}],'order':[['createdAt',_0xf766('0x69')]]};if(_0x58d415[_0xf766('0x2a')][_0xf766('0xf4')]){_0x23cfe1[_0xf766('0x32')]['createdAt']={'$gte':_0x4c84c5[_0xf766('0x36')],'$lte':_0x4c84c5['to']};}switch(_0x54c62f){case _0xf766('0xe9'):_0x23cfe1['attributes'][_0xf766('0x52')](_0xf766('0x10f'),'customerIp',_0xf766('0x110'),_0xf766('0x111'),_0xf766('0x112'),'ratingMessage',_0xf766('0x113'),_0xf766('0x114'),'referer');break;case _0xf766('0xe8'):_0x23cfe1['attributes'][_0xf766('0x52')](_0xf766('0x115'),_0xf766('0x116'));break;case _0xf766('0xea'):_0x23cfe1['attributes'][_0xf766('0x52')](_0xf766('0x117'),_0xf766('0x118'));break;}return db[_[_0xf766('0x104')](_0x54c62f)+_0xf766('0x119')][_0xf766('0x103')](_0x23cfe1)[_0xf766('0x1a')](function(_0x32d29c){_0x145341[_0xf766('0x17')]+=_0x32d29c[_0xf766('0x17')];return _[_0xf766('0x45')](_0x32d29c[_0xf766('0xc1')],function(_0x4ed845){var _0x5ec4e4=_0x4ed845[_0xf766('0x8b')]({'plain':!![]});_0x5ec4e4[_0xf766('0xf0')]=_0x54c62f;if(_0x5ec4e4[_0xf766('0x10e')]){_0x5ec4e4[_0xf766('0x10e')]={'id':_0x5ec4e4[_0xf766('0x10e')]['id'],'name':_0x5ec4e4[_0xf766('0x10e')][_0xf766('0x1f')],'fullname':_0x5ec4e4[_0xf766('0x10e')][_0xf766('0x101')]};}return _0x5ec4e4;});});}});return Promise['all'](_0x31ae36);})[_0xf766('0x1a')](function(_0x2d6195){return _(_0x2d6195)[_0xf766('0x11a')]()[_0xf766('0x11b')](_0xf766('0xfc'))[_0xf766('0x11c')]()[_0xf766('0x44')]();})[_0xf766('0x1a')](function(_0x36d5a1){_0x145341['rows']=_0x874799[_0xf766('0x14')]?_0x36d5a1['slice'](_0x874799[_0xf766('0x16')],_0x874799[_0xf766('0x16')]+_0x874799[_0xf766('0x14')]):_0x36d5a1;return _0x145341;})[_0xf766('0x1a')](respondWithFilteredResult(_0x1be55d,_0x874799))[_0xf766('0x82')](handleError(_0x1be55d,null));};
\ No newline at end of file
index 1dd7268..2706c26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7399=['events','../../mysqldb','CmContact','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x171ed8,_0x190fdb){var _0x194f60=function(_0x2374f5){while(--_0x2374f5){_0x171ed8['push'](_0x171ed8['shift']());}};_0x194f60(++_0x190fdb);}(_0x7399,0xbd));var _0x9739=function(_0x5a9776,_0x4b5ab3){_0x5a9776=_0x5a9776-0x0;var _0x454edb=_0x7399[_0x5a9776];return _0x454edb;};'use strict';var EventEmitter=require(_0x9739('0x0'));var CmContact=require(_0x9739('0x1'))['db'][_0x9739('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x9739('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9739('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4cea04){return function(_0x53c121,_0xcdba24,_0x23fc7b){CmContactEvents[_0x9739('0x5')](_0x4cea04+':'+_0x53c121['id'],_0x53c121);CmContactEvents[_0x9739('0x5')](_0x4cea04,_0x53c121);_0x23fc7b(null);};}for(var e in events){if(events[_0x9739('0x6')](e)){var event=events[e];CmContact[_0x9739('0x7')](e,emitEvent(event));}}module[_0x9739('0x8')]=CmContactEvents;
\ No newline at end of file
+var _0x146b=['update','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save'];(function(_0x15a79d,_0x387176){var _0x50192d=function(_0x202850){while(--_0x202850){_0x15a79d['push'](_0x15a79d['shift']());}};_0x50192d(++_0x387176);}(_0x146b,0x10d));var _0xb146=function(_0x387c2e,_0x1bc867){_0x387c2e=_0x387c2e-0x0;var _0x8987e1=_0x146b[_0x387c2e];return _0x8987e1;};'use strict';var EventEmitter=require(_0xb146('0x0'));var CmContact=require(_0xb146('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb146('0x2')](0x0);var events={'afterCreate':_0xb146('0x3'),'afterUpdate':_0xb146('0x4'),'afterDestroy':'remove'};function emitEvent(_0x46c54d){return function(_0x45e31d,_0x2e1582,_0xc9347b){CmContactEvents[_0xb146('0x5')](_0x46c54d+':'+_0x45e31d['id'],_0x45e31d);CmContactEvents['emit'](_0x46c54d,_0x45e31d);_0xc9347b(null);};}for(var e in events){if(events[_0xb146('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
index d634594..31417d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7423=['callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','inspect','Campaign','timezones','\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','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','Lists','dialCheckDuplicateType','always','onlyIfOpen','CmList','BlackLists','length','CmHopperBlack','afterCreate','message','get','cmContact,\x20%s,\x20%s','isEmpty','destroy','ContactId','VoiceQueueId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','api','moment','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','phone','firstName','mobile','fax','email','FULLTEXT','error','cmContact','format','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','scheduledat','add','minutes','YYYY-MM-DD\x20HH:mm:ss','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority'];(function(_0x144a08,_0x1df329){var _0x28f52a=function(_0x1fbbdf){while(--_0x1fbbdf){_0x144a08['push'](_0x144a08['shift']());}};_0x28f52a(++_0x1df329);}(_0x7423,0xab));var _0x3742=function(_0x5ece72,_0x46e5d1){_0x5ece72=_0x5ece72-0x0;var _0x389d35=_0x7423[_0x5ece72];return _0x389d35;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3742('0x0'));var moment=require(_0x3742('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3742('0x2'));var rimraf=require(_0x3742('0x3'));var config=require(_0x3742('0x4'));var shared=require(_0x3742('0x5'));var attributes=require(_0x3742('0x6'));module[_0x3742('0x7')]=function(_0x59c556,_0x185238){return _0x59c556[_0x3742('0x8')](_0x3742('0x9'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':[_0x3742('0xa')]},{'name':'fti_cm_contacts','fields':[_0x3742('0xb'),'lastName',_0x3742('0xa'),_0x3742('0xc'),_0x3742('0xd'),_0x3742('0xe')],'type':_0x3742('0xf')}],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x19c77e,_0x1a6b4e,_0x30d555){var _0x4d8440=_0x59c556['models'];var _0x551938=_0x19c77e['get']({'plain':!![]});function _0x5c5bf4(){return function(_0x12bce6){logger[_0x3742('0x10')](_0x3742('0x11'),'afterCreate',util['inspect'](_0x12bce6,{'showHidden':![],'depth':null}));};}function _0x2d30d2(_0x23e9f4,_0x211a66){var _0x58d48b=_0x211a66['scheduledat']?_0x211a66['scheduledat']:moment()[_0x3742('0x12')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x3a8bed,_0x4b3f4a){if(_[_0x3742('0x13')](_0x211a66[_0x3742('0x14')])){_0x3a8bed({'ret':_0x58d48b});}else{_0x4d8440[_0x3742('0x15')][_0x3742('0x16')]({'where':{'id':_0x23e9f4['id']}})[_0x3742('0x17')](function(_0x320a19){if(!_[_0x3742('0x13')](_0x320a19)){var _0x264cd3=_0x320a19['dialTimezone'];if(!_[_0x3742('0x13')](_0x264cd3)){var _0x2dd350=shared['timezones'];var _0x573df5=_0x2dd350[_0x264cd3];var _0x41b809=_0x2dd350[_0x211a66[_0x3742('0x14')]];if(!_[_0x3742('0x13')](_0x573df5)&&!_[_0x3742('0x13')](_0x41b809)){var _0x39259e=_0x573df5[_0x3742('0x18')]-_0x41b809['utcOffset'];_0x58d48b=_0x211a66[_0x3742('0x19')]?_0x211a66[_0x3742('0x19')]:moment();var _0x5338d4=moment(_0x58d48b)[_0x3742('0x1a')](_0x39259e,_0x3742('0x1b'));_0x3a8bed({'ret':_0x5338d4[_0x3742('0x12')](_0x3742('0x1c'))});}else _0x3a8bed({'ret':_0x58d48b});}else _0x3a8bed({'ret':_0x58d48b});}else{_0x3a8bed({'ret':_0x58d48b});}});}});return 0xa;}var _0x432d63=function(_0x143fdf){return new BPromise(function(_0x738f34,_0x558a31){_0x2d30d2(_0x143fdf,_0x551938)[_0x3742('0x17')](function(_0x30460a){_0x551938[_0x3742('0x19')]=_0x30460a[_0x3742('0x1d')];_0x4d8440[_0x3742('0x1e')][_0x3742('0x16')]({'where':{'phone':_0x551938['phone'],'VoiceQueueId':_0x143fdf['id']}})[_0x3742('0x17')](function(_0x109823){if(!_[_0x3742('0x13')](_0x109823)){throw new Error(_0x3742('0x1f')+_0x551938[_0x3742('0xa')]+_0x3742('0x20')+_0x143fdf['id']);}return _0x4d8440[_0x3742('0x1e')][_0x3742('0x21')]({'phone':_0x551938[_0x3742('0xa')],'ContactId':_0x551938['id'],'ListId':_0x551938[_0x3742('0x22')],'priority':_0x551938[_0x3742('0x23')]?_0x551938['priority']:0x2,'scheduledat':_0x551938[_0x3742('0x19')]?_0x551938[_0x3742('0x19')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x551938[_0x3742('0x24')]?!![]:![],'callbackuniqueid':_0x551938['callbackUniqueid']?_0x551938[_0x3742('0x24')]:undefined,'callbackat':_0x551938['callbackUniqueid']?moment()['format'](_0x3742('0x1c')):undefined,'VoiceQueueId':_0x143fdf['id']});})[_0x3742('0x25')](function(_0x5d367e){_0x558a31(_0x5d367e);});});});};var _0x38a675=function(_0xb8b64f){return new BPromise(function(_0x1afe88,_0x4df112){_0x2d30d2(_0xb8b64f,_0x551938)[_0x3742('0x17')](function(_0x5e90c9){_0x551938[_0x3742('0x19')]=_0x5e90c9[_0x3742('0x1d')];_0x4d8440[_0x3742('0x1e')]['findOne']({'where':{'phone':_0x551938[_0x3742('0xa')],'VoiceQueueId':_0xb8b64f['id']}})['then'](function(_0x460140){if(!_[_0x3742('0x13')](_0x460140)){throw new Error(_0x3742('0x1f')+_0x551938['phone']+_0x3742('0x26')+_0xb8b64f['id']);}return _0x4d8440[_0x3742('0x27')][_0x3742('0x16')]({'where':{'calleridnum':_0x551938['phone'],'VoiceQueueId':_0xb8b64f['id']}});})[_0x3742('0x17')](function(_0x4a2e85){if(!_[_0x3742('0x13')](_0x4a2e85)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x551938['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0xb8b64f['id']);}return _0x4d8440[_0x3742('0x1e')][_0x3742('0x21')]({'phone':_0x551938['phone'],'ContactId':_0x551938['id'],'ListId':_0x551938[_0x3742('0x22')],'priority':_0x551938[_0x3742('0x23')]?_0x551938[_0x3742('0x23')]:0x2,'scheduledat':_0x551938[_0x3742('0x19')]?_0x551938['scheduledat']:moment()[_0x3742('0x12')](_0x3742('0x1c')),'callback':_0x551938[_0x3742('0x24')]?!![]:![],'callbackuniqueid':_0x551938[_0x3742('0x24')]?_0x551938[_0x3742('0x24')]:undefined,'callbackat':_0x551938[_0x3742('0x24')]?moment()[_0x3742('0x12')](_0x3742('0x1c')):undefined,'VoiceQueueId':_0xb8b64f['id']});})[_0x3742('0x25')](function(_0x21c800){_0x4df112(_0x21c800);});});});};function _0x397c5b(){return function(_0x6c8617){logger[_0x3742('0x10')](_0x3742('0x11'),'afterCreate',util[_0x3742('0x28')](_0x6c8617,{'showHidden':![],'depth':null}));};}function _0x1e9a25(_0x22ab5e,_0x26ebb5){var _0x2799aa=_0x26ebb5[_0x3742('0x19')]?_0x26ebb5[_0x3742('0x19')]:moment()[_0x3742('0x12')](_0x3742('0x1c'));return new BPromise(function(_0x4f4bba,_0x99985){if(_['isNil'](_0x26ebb5['dialTimezone'])){_0x4f4bba({'ret':_0x2799aa});}else{_0x4d8440[_0x3742('0x29')][_0x3742('0x16')]({'where':{'id':_0x22ab5e['id']}})['then'](function(_0xcd002b){if(!_['isNil'](_0xcd002b)){var _0x2f15b7=_0xcd002b[_0x3742('0x14')];if(!_[_0x3742('0x13')](_0x2f15b7)){var _0xbd9fe1=shared[_0x3742('0x2a')];var _0x4f727e=_0xbd9fe1[_0x2f15b7];var _0x486f5e=_0xbd9fe1[_0x26ebb5[_0x3742('0x14')]];if(!_[_0x3742('0x13')](_0x4f727e)&&!_['isNil'](_0x486f5e)){var _0x307682=_0x4f727e[_0x3742('0x18')]-_0x486f5e['utcOffset'];_0x2799aa=_0x26ebb5[_0x3742('0x19')]?_0x26ebb5[_0x3742('0x19')]:moment();var _0x56a27b=moment(_0x2799aa)[_0x3742('0x1a')](_0x307682,'minutes');_0x4f4bba({'ret':_0x56a27b[_0x3742('0x12')](_0x3742('0x1c'))});}else _0x4f4bba({'ret':_0x2799aa});}else _0x4f4bba({'ret':_0x2799aa});}else{_0x4f4bba({'ret':_0x2799aa});}});}});return 0xa;}var _0x420a62=function(_0x396f80){return new BPromise(function(_0x574a80,_0x3f235b){_0x1e9a25(_0x396f80,_0x551938)[_0x3742('0x17')](function(_0x18b7c4){_0x551938[_0x3742('0x19')]=_0x18b7c4[_0x3742('0x1d')];_0x4d8440[_0x3742('0x1e')][_0x3742('0x16')]({'where':{'phone':_0x551938[_0x3742('0xa')],'CampaignId':_0x396f80['id']}})[_0x3742('0x17')](function(_0x2052fa){if(!_[_0x3742('0x13')](_0x2052fa)){throw new Error(_0x3742('0x1f')+_0x551938[_0x3742('0xa')]+_0x3742('0x2b')+_0x396f80['id']);}return _0x4d8440['CmHopper'][_0x3742('0x21')]({'phone':_0x551938['phone'],'ContactId':_0x551938['id'],'ListId':_0x551938['ListId'],'priority':_0x551938[_0x3742('0x23')]?_0x551938[_0x3742('0x23')]:0x2,'scheduledat':_0x551938['scheduledat']?_0x551938[_0x3742('0x19')]:moment()[_0x3742('0x12')](_0x3742('0x1c')),'callback':_0x551938['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x551938[_0x3742('0x24')]?_0x551938['callbackUniqueid']:undefined,'callbackat':_0x551938['callbackUniqueid']?moment()[_0x3742('0x12')](_0x3742('0x1c')):undefined,'CampaignId':_0x396f80['id']});})[_0x3742('0x25')](function(_0xa078bc){_0x3f235b(_0xa078bc);});});});};var _0x309d35=function(_0x3023fe){return new BPromise(function(_0xd170c9,_0x1e4761){_0x1e9a25(_0x3023fe,_0x551938)[_0x3742('0x17')](function(_0x48a5bd){_0x551938[_0x3742('0x19')]=_0x48a5bd[_0x3742('0x1d')];_0x4d8440[_0x3742('0x1e')][_0x3742('0x16')]({'where':{'phone':_0x551938[_0x3742('0xa')],'CampaignId':_0x3023fe['id']}})['then'](function(_0x110328){if(!_[_0x3742('0x13')](_0x110328)){throw new Error(_0x3742('0x1f')+_0x551938[_0x3742('0xa')]+_0x3742('0x2c')+_0x3023fe['id']);}return _0x4d8440['CmHopperFinal'][_0x3742('0x16')]({'where':{'calleridnum':_0x551938[_0x3742('0xa')],'CampaignId':_0x3023fe['id']}});})[_0x3742('0x17')](function(_0x41ebdc){if(!_['isNil'](_0x41ebdc)){throw new Error(_0x3742('0x2d')+_0x551938[_0x3742('0xa')]+_0x3742('0x2e')+_0x3023fe['id']);}return _0x4d8440[_0x3742('0x1e')]['create']({'phone':_0x551938['phone'],'ContactId':_0x551938['id'],'ListId':_0x551938['ListId'],'priority':_0x551938[_0x3742('0x23')]?_0x551938[_0x3742('0x23')]:0x2,'scheduledat':_0x551938[_0x3742('0x19')]?_0x551938['scheduledat']:moment()[_0x3742('0x12')](_0x3742('0x1c')),'callback':_0x551938[_0x3742('0x24')]?!![]:![],'callbackuniqueid':_0x551938['callbackUniqueid']?_0x551938[_0x3742('0x24')]:undefined,'callbackat':_0x551938[_0x3742('0x24')]?moment()[_0x3742('0x12')](_0x3742('0x1c')):undefined,'CampaignId':_0x3023fe['id']});})[_0x3742('0x25')](function(_0x322727){_0x1e4761(_0x322727);});});});};if(_0x551938['ListId']){_0x4d8440[_0x3742('0x15')][_0x3742('0x2f')]({'where':{'type':_0x3742('0x30')},'attributes':['id','dialCheckDuplicateType',_0x3742('0x14')],'include':[{'model':_0x4d8440['CmList'],'as':_0x3742('0x31'),'where':{'id':_0x551938[_0x3742('0x22')]}}]})[_0x3742('0x17')](function(_0x36912c){if(_0x36912c){var _0x35a87b=[];for(var _0x66dbee=0x0,_0x1dbd48;_0x66dbee<_0x36912c['length'];_0x66dbee+=0x1){_0x1dbd48=_0x36912c[_0x66dbee]['get']({'plain':!![]});switch(_0x1dbd48[_0x3742('0x32')]){case _0x3742('0x33'):_0x38a675(_0x1dbd48)['catch'](_0x5c5bf4());break;case _0x3742('0x34'):_0x432d63(_0x1dbd48)[_0x3742('0x25')](_0x5c5bf4());break;default:_0x1e9a25(_0x1dbd48,_0x551938)[_0x3742('0x17')](function(_0x43bb81){_0x551938[_0x3742('0x19')]=_0x43bb81[_0x3742('0x1d')];_0x4d8440[_0x3742('0x1e')][_0x3742('0x21')]({'phone':_0x551938[_0x3742('0xa')],'ContactId':_0x551938['id'],'ListId':_0x551938['ListId'],'scheduledat':_0x551938[_0x3742('0x19')]?_0x551938[_0x3742('0x19')]:moment()[_0x3742('0x12')](_0x3742('0x1c')),'priority':_0x551938[_0x3742('0x23')]?_0x551938[_0x3742('0x23')]:0x2,'callback':_0x551938[_0x3742('0x24')]?!![]:![],'callbackuniqueid':_0x551938[_0x3742('0x24')]?_0x551938[_0x3742('0x24')]:undefined,'callbackat':_0x551938[_0x3742('0x24')]?moment()[_0x3742('0x12')](_0x3742('0x1c')):undefined,'VoiceQueueId':_0x1dbd48['id']})[_0x3742('0x25')](_0x5c5bf4());});}}}})[_0x3742('0x17')](function(){return _0x4d8440[_0x3742('0x15')][_0x3742('0x2f')]({'where':{'type':_0x3742('0x30')},'attributes':['id'],'include':[{'model':_0x4d8440[_0x3742('0x35')],'as':_0x3742('0x36'),'where':{'id':_0x551938['ListId']}}]})[_0x3742('0x17')](function(_0x5daef6){if(_0x5daef6){var _0x3da7e8=[];for(var _0xbada9e=0x0,_0x4f7ac8;_0xbada9e<_0x5daef6[_0x3742('0x37')];_0xbada9e+=0x1){_0x4f7ac8=_0x5daef6[_0xbada9e]['get']({'plain':!![]});_0x4d8440[_0x3742('0x38')]['create']({'phone':_0x551938[_0x3742('0xa')],'ContactId':_0x551938['id'],'ListId':_0x551938[_0x3742('0x22')],'VoiceQueueId':_0x4f7ac8['id']})[_0x3742('0x25')](function(_0x1e840a){logger[_0x3742('0x10')]('cmContact,\x20%s,\x20%s',_0x3742('0x39'),_0x1e840a[_0x3742('0x3a')]);});}}});})[_0x3742('0x17')](function(){return _0x4d8440[_0x3742('0x29')][_0x3742('0x2f')]({'attributes':['id',_0x3742('0x32'),_0x3742('0x14')],'include':[{'model':_0x4d8440[_0x3742('0x35')],'as':_0x3742('0x31'),'where':{'id':_0x551938[_0x3742('0x22')]}}]})[_0x3742('0x17')](function(_0x448e7e){if(_0x448e7e){var _0xd9c497=[];for(var _0x1c730b=0x0,_0x3b2d57;_0x1c730b<_0x448e7e[_0x3742('0x37')];_0x1c730b+=0x1){_0x3b2d57=_0x448e7e[_0x1c730b][_0x3742('0x3b')]({'plain':!![]});switch(_0x3b2d57['dialCheckDuplicateType']){case _0x3742('0x33'):_0x309d35(_0x3b2d57)[_0x3742('0x25')](_0x397c5b());break;case _0x3742('0x34'):_0x420a62(_0x3b2d57)['catch'](_0x397c5b());break;default:_0x4d8440[_0x3742('0x1e')][_0x3742('0x21')]({'phone':_0x551938[_0x3742('0xa')],'ContactId':_0x551938['id'],'ListId':_0x551938['ListId'],'scheduledat':_0x551938['scheduledat']?_0x551938[_0x3742('0x19')]:moment()[_0x3742('0x12')](_0x3742('0x1c')),'priority':_0x551938[_0x3742('0x23')]?_0x551938[_0x3742('0x23')]:0x2,'callback':_0x551938['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x551938['callbackUniqueid']?_0x551938[_0x3742('0x24')]:undefined,'callbackat':_0x551938[_0x3742('0x24')]?moment()[_0x3742('0x12')](_0x3742('0x1c')):undefined,'CampaignId':_0x3b2d57['id']})['catch'](_0x397c5b());}}}});})[_0x3742('0x17')](function(){return _0x4d8440[_0x3742('0x29')]['findAll']({'attributes':['id'],'include':[{'model':_0x4d8440[_0x3742('0x35')],'as':_0x3742('0x36'),'where':{'id':_0x551938[_0x3742('0x22')]}}]})[_0x3742('0x17')](function(_0x958915){if(_0x958915){var _0x254c8b=[];for(var _0x5cdff9=0x0,_0x1b53cb;_0x5cdff9<_0x958915[_0x3742('0x37')];_0x5cdff9+=0x1){_0x1b53cb=_0x958915[_0x5cdff9][_0x3742('0x3b')]({'plain':!![]});_0x4d8440[_0x3742('0x38')]['create']({'phone':_0x551938[_0x3742('0xa')],'ContactId':_0x551938['id'],'ListId':_0x551938['ListId'],'CampaignId':_0x1b53cb['id']})[_0x3742('0x25')](function(_0x1bc87c){logger['error'](_0x3742('0x3c'),_0x3742('0x39'),_0x1bc87c[_0x3742('0x3a')]);});}}});})[_0x3742('0x17')](function(){_0x30d555();})[_0x3742('0x25')](function(_0x4669bf){logger['error'](_0x3742('0x3c'),'afterCreate',_0x4669bf[_0x3742('0x3a')]);_0x30d555(_0x4669bf);});}else{_0x30d555(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x25fe46,_0xd1922f,_0x25192d){var _0x51e6f3=_0x59c556['models'];var _0x121cbe=_0x25fe46['get']({'plain':!![]});return _0x51e6f3[_0x3742('0x1e')][_0x3742('0x2f')]({'raw':!![],'where':{'ListId':_0x121cbe[_0x3742('0x22')],'ContactId':_0x121cbe['id']}})['then'](function(_0x3b28eb){if(!_[_0x3742('0x3d')](_0x3b28eb)){var _0x36b74f=[];for(var _0x3a7970=0x0;_0x3a7970<_0x3b28eb[_0x3742('0x37')];_0x3a7970+=0x1){var _0x470373=_0x51e6f3['CmHopper'][_0x3742('0x3e')]({'where':{'ListId':_0x3b28eb[_0x3a7970]['ListId'],'ContactId':_0x3b28eb[_0x3a7970][_0x3742('0x3f')],'VoiceQueueId':_0x3b28eb[_0x3a7970][_0x3742('0x40')],'CampaignId':_0x3b28eb[_0x3a7970]['CampaignId']}});_0x36b74f['push'](_0x470373);}return BPromise[_0x3742('0x41')](_0x36b74f);}})[_0x3742('0x17')](function(_0x154b57){logger[_0x3742('0x42')](_0x3742('0x43'),util[_0x3742('0x28')](_0x154b57,{'showHidden':![],'depth':null}));_0x25192d();})[_0x3742('0x25')](function(_0x483a61){logger['error'](_0x3742('0x44'),util[_0x3742('0x28')](_0x483a61,{'showHidden':![],'depth':null}));_0x25192d(_0x483a61);});}}});};
\ No newline at end of file
+var _0x0b24=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','length','get','always','onlyIfOpen','outbound','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','then','dialTimezone','timezones','utcOffset','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','create','cmContact','Campaign','add','minutes','ret'];(function(_0x4dc389,_0x12155c){var _0x95f4d=function(_0x1621d6){while(--_0x1621d6){_0x4dc389['push'](_0x4dc389['shift']());}};_0x95f4d(++_0x12155c);}(_0x0b24,0x139));var _0x40b2=function(_0x22e6e7,_0x248d94){_0x22e6e7=_0x22e6e7-0x0;var _0x26f3cb=_0x0b24[_0x22e6e7];return _0x26f3cb;};'use strict';var _=require('lodash');var util=require(_0x40b2('0x0'));var logger=require(_0x40b2('0x1'))(_0x40b2('0x2'));var moment=require('moment');var BPromise=require(_0x40b2('0x3'));var rp=require(_0x40b2('0x4'));var fs=require('fs');var path=require(_0x40b2('0x5'));var rimraf=require(_0x40b2('0x6'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');module[_0x40b2('0x7')]=function(_0x26cb12,_0x2ed1cd){return _0x26cb12['define'](_0x40b2('0x8'),attributes,{'tableName':_0x40b2('0x9'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x40b2('0xa')]},{'name':_0x40b2('0xb'),'fields':['firstName',_0x40b2('0xc'),'phone','mobile',_0x40b2('0xd'),_0x40b2('0xe')],'type':_0x40b2('0xf')}],'timestamps':!![],'charset':_0x40b2('0x10'),'collate':_0x40b2('0x11'),'hooks':{'afterCreate':function(_0x473655,_0x15a479,_0x5a686f){var _0x5b4e36=_0x26cb12[_0x40b2('0x12')];var _0x179bbf=_0x473655['get']({'plain':!![]});function _0x59a1b4(){return function(_0x382ccb){logger[_0x40b2('0x13')]('cmContact',_0x40b2('0x14'),util[_0x40b2('0x15')](_0x382ccb,{'showHidden':![],'depth':null}));};}function _0x211f6d(_0x45c7df,_0x4bd2b3){var _0x213761=_0x4bd2b3[_0x40b2('0x16')]?_0x4bd2b3[_0x40b2('0x16')]:moment()[_0x40b2('0x17')](_0x40b2('0x18'));return new BPromise(function(_0x3f11f6,_0x42c8ac){if(_[_0x40b2('0x19')](_0x4bd2b3['dialTimezone'])){_0x3f11f6({'ret':_0x213761});}else{_0x5b4e36['VoiceQueue']['findOne']({'where':{'id':_0x45c7df['id']}})[_0x40b2('0x1a')](function(_0x525d35){if(!_['isNil'](_0x525d35)){var _0x5588b2=_0x525d35[_0x40b2('0x1b')];if(!_[_0x40b2('0x19')](_0x5588b2)){var _0x376d66=shared[_0x40b2('0x1c')];var _0x855c27=_0x376d66[_0x5588b2];var _0x17390d=_0x376d66[_0x4bd2b3[_0x40b2('0x1b')]];if(!_[_0x40b2('0x19')](_0x855c27)&&!_[_0x40b2('0x19')](_0x17390d)){var _0x5b799c=_0x855c27[_0x40b2('0x1d')]-_0x17390d[_0x40b2('0x1d')];_0x213761=_0x4bd2b3['scheduledat']?_0x4bd2b3['scheduledat']:moment();var _0x1302df=moment(_0x213761)['add'](_0x5b799c,'minutes');_0x3f11f6({'ret':_0x1302df[_0x40b2('0x17')](_0x40b2('0x18'))});}else _0x3f11f6({'ret':_0x213761});}else _0x3f11f6({'ret':_0x213761});}else{_0x3f11f6({'ret':_0x213761});}});}});return 0xa;}var _0xd0cd08=function(_0x1d171c){return new BPromise(function(_0x216724,_0xfff56e){_0x211f6d(_0x1d171c,_0x179bbf)[_0x40b2('0x1a')](function(_0x116d9b){_0x179bbf['scheduledat']=_0x116d9b['ret'];_0x5b4e36[_0x40b2('0x1e')]['findOne']({'where':{'phone':_0x179bbf[_0x40b2('0xa')],'VoiceQueueId':_0x1d171c['id']}})['then'](function(_0x34e9c0){if(!_[_0x40b2('0x19')](_0x34e9c0)){throw new Error(_0x40b2('0x1f')+_0x179bbf[_0x40b2('0xa')]+_0x40b2('0x20')+_0x1d171c['id']);}return _0x5b4e36[_0x40b2('0x1e')]['create']({'phone':_0x179bbf[_0x40b2('0xa')],'ContactId':_0x179bbf['id'],'ListId':_0x179bbf[_0x40b2('0x21')],'priority':_0x179bbf[_0x40b2('0x22')]?_0x179bbf[_0x40b2('0x22')]:0x2,'scheduledat':_0x179bbf[_0x40b2('0x16')]?_0x179bbf[_0x40b2('0x16')]:moment()[_0x40b2('0x17')](_0x40b2('0x18')),'callback':_0x179bbf[_0x40b2('0x23')]?!![]:![],'callbackuniqueid':_0x179bbf[_0x40b2('0x23')]?_0x179bbf[_0x40b2('0x23')]:undefined,'callbackat':_0x179bbf[_0x40b2('0x23')]?moment()[_0x40b2('0x17')](_0x40b2('0x18')):undefined,'VoiceQueueId':_0x1d171c['id']});})[_0x40b2('0x24')](function(_0x2aea2b){_0xfff56e(_0x2aea2b);});});});};var _0xa0caf7=function(_0x5338f0){return new BPromise(function(_0x10fa88,_0x55e9c8){_0x211f6d(_0x5338f0,_0x179bbf)[_0x40b2('0x1a')](function(_0x981f30){_0x179bbf[_0x40b2('0x16')]=_0x981f30['ret'];_0x5b4e36[_0x40b2('0x1e')][_0x40b2('0x25')]({'where':{'phone':_0x179bbf[_0x40b2('0xa')],'VoiceQueueId':_0x5338f0['id']}})[_0x40b2('0x1a')](function(_0x48e0da){if(!_[_0x40b2('0x19')](_0x48e0da)){throw new Error(_0x40b2('0x1f')+_0x179bbf['phone']+_0x40b2('0x26')+_0x5338f0['id']);}return _0x5b4e36[_0x40b2('0x27')][_0x40b2('0x25')]({'where':{'calleridnum':_0x179bbf['phone'],'VoiceQueueId':_0x5338f0['id']}});})['then'](function(_0x4dca03){if(!_[_0x40b2('0x19')](_0x4dca03)){throw new Error(_0x40b2('0x28')+_0x179bbf['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x5338f0['id']);}return _0x5b4e36['CmHopper'][_0x40b2('0x29')]({'phone':_0x179bbf['phone'],'ContactId':_0x179bbf['id'],'ListId':_0x179bbf[_0x40b2('0x21')],'priority':_0x179bbf[_0x40b2('0x22')]?_0x179bbf[_0x40b2('0x22')]:0x2,'scheduledat':_0x179bbf[_0x40b2('0x16')]?_0x179bbf['scheduledat']:moment()[_0x40b2('0x17')](_0x40b2('0x18')),'callback':_0x179bbf[_0x40b2('0x23')]?!![]:![],'callbackuniqueid':_0x179bbf[_0x40b2('0x23')]?_0x179bbf[_0x40b2('0x23')]:undefined,'callbackat':_0x179bbf['callbackUniqueid']?moment()['format'](_0x40b2('0x18')):undefined,'VoiceQueueId':_0x5338f0['id']});})['catch'](function(_0x3117de){_0x55e9c8(_0x3117de);});});});};function _0x5a2315(){return function(_0xe06eef){logger[_0x40b2('0x13')](_0x40b2('0x2a'),'afterCreate',util[_0x40b2('0x15')](_0xe06eef,{'showHidden':![],'depth':null}));};}function _0x2b9972(_0x3e325b,_0x4b7a31){var _0xc21290=_0x4b7a31['scheduledat']?_0x4b7a31['scheduledat']:moment()[_0x40b2('0x17')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x39125b,_0x252c8f){if(_[_0x40b2('0x19')](_0x4b7a31[_0x40b2('0x1b')])){_0x39125b({'ret':_0xc21290});}else{_0x5b4e36[_0x40b2('0x2b')][_0x40b2('0x25')]({'where':{'id':_0x3e325b['id']}})[_0x40b2('0x1a')](function(_0x5c89da){if(!_[_0x40b2('0x19')](_0x5c89da)){var _0x5cb82d=_0x5c89da['dialTimezone'];if(!_[_0x40b2('0x19')](_0x5cb82d)){var _0x1cd028=shared['timezones'];var _0x3818ea=_0x1cd028[_0x5cb82d];var _0x10996d=_0x1cd028[_0x4b7a31[_0x40b2('0x1b')]];if(!_[_0x40b2('0x19')](_0x3818ea)&&!_[_0x40b2('0x19')](_0x10996d)){var _0x175a10=_0x3818ea[_0x40b2('0x1d')]-_0x10996d[_0x40b2('0x1d')];_0xc21290=_0x4b7a31[_0x40b2('0x16')]?_0x4b7a31[_0x40b2('0x16')]:moment();var _0x3c8d2d=moment(_0xc21290)[_0x40b2('0x2c')](_0x175a10,_0x40b2('0x2d'));_0x39125b({'ret':_0x3c8d2d['format'](_0x40b2('0x18'))});}else _0x39125b({'ret':_0xc21290});}else _0x39125b({'ret':_0xc21290});}else{_0x39125b({'ret':_0xc21290});}});}});return 0xa;}var _0x27691a=function(_0x5c2b18){return new BPromise(function(_0x5ef00c,_0x2f44bb){_0x2b9972(_0x5c2b18,_0x179bbf)[_0x40b2('0x1a')](function(_0x476047){_0x179bbf[_0x40b2('0x16')]=_0x476047['ret'];_0x5b4e36[_0x40b2('0x1e')][_0x40b2('0x25')]({'where':{'phone':_0x179bbf['phone'],'CampaignId':_0x5c2b18['id']}})[_0x40b2('0x1a')](function(_0x1a3c03){if(!_[_0x40b2('0x19')](_0x1a3c03)){throw new Error('cmContact,\x20afterCreate\x20'+_0x179bbf[_0x40b2('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x5c2b18['id']);}return _0x5b4e36['CmHopper']['create']({'phone':_0x179bbf[_0x40b2('0xa')],'ContactId':_0x179bbf['id'],'ListId':_0x179bbf[_0x40b2('0x21')],'priority':_0x179bbf['priority']?_0x179bbf[_0x40b2('0x22')]:0x2,'scheduledat':_0x179bbf[_0x40b2('0x16')]?_0x179bbf[_0x40b2('0x16')]:moment()[_0x40b2('0x17')](_0x40b2('0x18')),'callback':_0x179bbf['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x179bbf['callbackUniqueid']?_0x179bbf[_0x40b2('0x23')]:undefined,'callbackat':_0x179bbf[_0x40b2('0x23')]?moment()[_0x40b2('0x17')](_0x40b2('0x18')):undefined,'CampaignId':_0x5c2b18['id']});})[_0x40b2('0x24')](function(_0x155c93){_0x2f44bb(_0x155c93);});});});};var _0x3c7c10=function(_0xc6fde2){return new BPromise(function(_0x117819,_0x17ccb9){_0x2b9972(_0xc6fde2,_0x179bbf)[_0x40b2('0x1a')](function(_0x37ee22){_0x179bbf['scheduledat']=_0x37ee22[_0x40b2('0x2e')];_0x5b4e36[_0x40b2('0x1e')][_0x40b2('0x25')]({'where':{'phone':_0x179bbf['phone'],'CampaignId':_0xc6fde2['id']}})[_0x40b2('0x1a')](function(_0x5d3bdc){if(!_[_0x40b2('0x19')](_0x5d3bdc)){throw new Error(_0x40b2('0x1f')+_0x179bbf[_0x40b2('0xa')]+_0x40b2('0x2f')+_0xc6fde2['id']);}return _0x5b4e36['CmHopperFinal'][_0x40b2('0x25')]({'where':{'calleridnum':_0x179bbf[_0x40b2('0xa')],'CampaignId':_0xc6fde2['id']}});})[_0x40b2('0x1a')](function(_0x1fa68b){if(!_[_0x40b2('0x19')](_0x1fa68b)){throw new Error(_0x40b2('0x28')+_0x179bbf[_0x40b2('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0xc6fde2['id']);}return _0x5b4e36['CmHopper'][_0x40b2('0x29')]({'phone':_0x179bbf['phone'],'ContactId':_0x179bbf['id'],'ListId':_0x179bbf[_0x40b2('0x21')],'priority':_0x179bbf['priority']?_0x179bbf[_0x40b2('0x22')]:0x2,'scheduledat':_0x179bbf[_0x40b2('0x16')]?_0x179bbf[_0x40b2('0x16')]:moment()[_0x40b2('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x179bbf[_0x40b2('0x23')]?!![]:![],'callbackuniqueid':_0x179bbf[_0x40b2('0x23')]?_0x179bbf['callbackUniqueid']:undefined,'callbackat':_0x179bbf['callbackUniqueid']?moment()[_0x40b2('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0xc6fde2['id']});})[_0x40b2('0x24')](function(_0x1a70b2){_0x17ccb9(_0x1a70b2);});});});};if(_0x179bbf[_0x40b2('0x21')]){_0x5b4e36[_0x40b2('0x30')][_0x40b2('0x31')]({'where':{'type':'outbound'},'attributes':['id',_0x40b2('0x32'),'dialTimezone'],'include':[{'model':_0x5b4e36[_0x40b2('0x33')],'as':_0x40b2('0x34'),'where':{'id':_0x179bbf[_0x40b2('0x21')]}}]})[_0x40b2('0x1a')](function(_0x30ad1e){if(_0x30ad1e){var _0x209938=[];for(var _0x24e20b=0x0,_0x3a894a;_0x24e20b<_0x30ad1e[_0x40b2('0x35')];_0x24e20b+=0x1){_0x3a894a=_0x30ad1e[_0x24e20b][_0x40b2('0x36')]({'plain':!![]});switch(_0x3a894a[_0x40b2('0x32')]){case _0x40b2('0x37'):_0xa0caf7(_0x3a894a)['catch'](_0x59a1b4());break;case _0x40b2('0x38'):_0xd0cd08(_0x3a894a)[_0x40b2('0x24')](_0x59a1b4());break;default:_0x2b9972(_0x3a894a,_0x179bbf)[_0x40b2('0x1a')](function(_0x3c0525){_0x179bbf[_0x40b2('0x16')]=_0x3c0525[_0x40b2('0x2e')];_0x5b4e36[_0x40b2('0x1e')]['create']({'phone':_0x179bbf[_0x40b2('0xa')],'ContactId':_0x179bbf['id'],'ListId':_0x179bbf[_0x40b2('0x21')],'scheduledat':_0x179bbf['scheduledat']?_0x179bbf[_0x40b2('0x16')]:moment()['format'](_0x40b2('0x18')),'priority':_0x179bbf[_0x40b2('0x22')]?_0x179bbf['priority']:0x2,'callback':_0x179bbf[_0x40b2('0x23')]?!![]:![],'callbackuniqueid':_0x179bbf[_0x40b2('0x23')]?_0x179bbf['callbackUniqueid']:undefined,'callbackat':_0x179bbf['callbackUniqueid']?moment()[_0x40b2('0x17')](_0x40b2('0x18')):undefined,'VoiceQueueId':_0x3a894a['id']})['catch'](_0x59a1b4());});}}}})[_0x40b2('0x1a')](function(){return _0x5b4e36['VoiceQueue'][_0x40b2('0x31')]({'where':{'type':_0x40b2('0x39')},'attributes':['id'],'include':[{'model':_0x5b4e36[_0x40b2('0x33')],'as':_0x40b2('0x3a'),'where':{'id':_0x179bbf[_0x40b2('0x21')]}}]})[_0x40b2('0x1a')](function(_0x393f58){if(_0x393f58){var _0x5e84db=[];for(var _0x5fe1b4=0x0,_0x5717db;_0x5fe1b4<_0x393f58[_0x40b2('0x35')];_0x5fe1b4+=0x1){_0x5717db=_0x393f58[_0x5fe1b4]['get']({'plain':!![]});_0x5b4e36[_0x40b2('0x3b')]['create']({'phone':_0x179bbf[_0x40b2('0xa')],'ContactId':_0x179bbf['id'],'ListId':_0x179bbf[_0x40b2('0x21')],'VoiceQueueId':_0x5717db['id']})[_0x40b2('0x24')](function(_0x119e36){logger[_0x40b2('0x13')]('cmContact,\x20%s,\x20%s',_0x40b2('0x14'),_0x119e36['message']);});}}});})[_0x40b2('0x1a')](function(){return _0x5b4e36[_0x40b2('0x2b')][_0x40b2('0x31')]({'attributes':['id','dialCheckDuplicateType',_0x40b2('0x1b')],'include':[{'model':_0x5b4e36[_0x40b2('0x33')],'as':_0x40b2('0x34'),'where':{'id':_0x179bbf[_0x40b2('0x21')]}}]})[_0x40b2('0x1a')](function(_0x4e1a46){if(_0x4e1a46){var _0x4ff275=[];for(var _0x206b43=0x0,_0x5dc765;_0x206b43<_0x4e1a46['length'];_0x206b43+=0x1){_0x5dc765=_0x4e1a46[_0x206b43][_0x40b2('0x36')]({'plain':!![]});switch(_0x5dc765['dialCheckDuplicateType']){case _0x40b2('0x37'):_0x3c7c10(_0x5dc765)[_0x40b2('0x24')](_0x5a2315());break;case _0x40b2('0x38'):_0x27691a(_0x5dc765)['catch'](_0x5a2315());break;default:_0x5b4e36[_0x40b2('0x1e')][_0x40b2('0x29')]({'phone':_0x179bbf[_0x40b2('0xa')],'ContactId':_0x179bbf['id'],'ListId':_0x179bbf[_0x40b2('0x21')],'scheduledat':_0x179bbf[_0x40b2('0x16')]?_0x179bbf[_0x40b2('0x16')]:moment()[_0x40b2('0x17')](_0x40b2('0x18')),'priority':_0x179bbf[_0x40b2('0x22')]?_0x179bbf[_0x40b2('0x22')]:0x2,'callback':_0x179bbf[_0x40b2('0x23')]?!![]:![],'callbackuniqueid':_0x179bbf[_0x40b2('0x23')]?_0x179bbf[_0x40b2('0x23')]:undefined,'callbackat':_0x179bbf['callbackUniqueid']?moment()[_0x40b2('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5dc765['id']})[_0x40b2('0x24')](_0x5a2315());}}}});})[_0x40b2('0x1a')](function(){return _0x5b4e36['Campaign'][_0x40b2('0x31')]({'attributes':['id'],'include':[{'model':_0x5b4e36[_0x40b2('0x33')],'as':'BlackLists','where':{'id':_0x179bbf[_0x40b2('0x21')]}}]})[_0x40b2('0x1a')](function(_0x592e1a){if(_0x592e1a){var _0x57a035=[];for(var _0x4de3db=0x0,_0x4e53c8;_0x4de3db<_0x592e1a[_0x40b2('0x35')];_0x4de3db+=0x1){_0x4e53c8=_0x592e1a[_0x4de3db][_0x40b2('0x36')]({'plain':!![]});_0x5b4e36[_0x40b2('0x3b')][_0x40b2('0x29')]({'phone':_0x179bbf[_0x40b2('0xa')],'ContactId':_0x179bbf['id'],'ListId':_0x179bbf[_0x40b2('0x21')],'CampaignId':_0x4e53c8['id']})[_0x40b2('0x24')](function(_0x211517){logger[_0x40b2('0x13')](_0x40b2('0x3c'),_0x40b2('0x14'),_0x211517[_0x40b2('0x3d')]);});}}});})[_0x40b2('0x1a')](function(){_0x5a686f();})[_0x40b2('0x24')](function(_0x35d28e){logger[_0x40b2('0x13')](_0x40b2('0x3c'),_0x40b2('0x14'),_0x35d28e[_0x40b2('0x3d')]);_0x5a686f(_0x35d28e);});}else{_0x5a686f(new Error(_0x40b2('0x3e')));}},'afterDestroy':function(_0x5b70db,_0x4c072a,_0xcc719d){var _0x3b441f=_0x26cb12[_0x40b2('0x12')];var _0x4232ac=_0x5b70db[_0x40b2('0x36')]({'plain':!![]});return _0x3b441f[_0x40b2('0x1e')][_0x40b2('0x31')]({'raw':!![],'where':{'ListId':_0x4232ac['ListId'],'ContactId':_0x4232ac['id']}})[_0x40b2('0x1a')](function(_0x13787a){if(!_[_0x40b2('0x3f')](_0x13787a)){var _0x1ec64b=[];for(var _0x386e63=0x0;_0x386e63<_0x13787a[_0x40b2('0x35')];_0x386e63+=0x1){var _0x315daf=_0x3b441f['CmHopper'][_0x40b2('0x40')]({'where':{'ListId':_0x13787a[_0x386e63][_0x40b2('0x21')],'ContactId':_0x13787a[_0x386e63][_0x40b2('0x41')],'VoiceQueueId':_0x13787a[_0x386e63][_0x40b2('0x42')],'CampaignId':_0x13787a[_0x386e63]['CampaignId']}});_0x1ec64b[_0x40b2('0x43')](_0x315daf);}return BPromise[_0x40b2('0x44')](_0x1ec64b);}})[_0x40b2('0x1a')](function(_0x3b4479){logger[_0x40b2('0x45')](_0x40b2('0x46'),util[_0x40b2('0x15')](_0x3b4479,{'showHidden':![],'depth':null}));_0xcc719d();})['catch'](function(_0x4ba243){logger[_0x40b2('0x13')](_0x40b2('0x47'),util[_0x40b2('0x15')](_0x4ba243,{'showHidden':![],'depth':null}));_0xcc719d(_0x4ba243);});}}});};
\ No newline at end of file
index a985dfc..6d4092d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5d2=['CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetCmContact','CmContact','options','raw','where','attributes','limit','include','model','map','stringify','catch','create','body','keys','length','startsWith','cf_','table','cm_contacts','set','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','bluebird','randomstring','squel','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','request','then','CmContact,\x20%s,\x20%s','debug'];(function(_0x3186cc,_0x16e517){var _0x4002c7=function(_0x5df774){while(--_0x5df774){_0x3186cc['push'](_0x3186cc['shift']());}};_0x4002c7(++_0x16e517);}(_0xb5d2,0x146));var _0x2b5d=function(_0x3a6ada,_0x37c01b){_0x3a6ada=_0x3a6ada-0x0;var _0x4f1336=_0xb5d2[_0x3a6ada];return _0x4f1336;};'use strict';var _=require(_0x2b5d('0x0'));var util=require(_0x2b5d('0x1'));var moment=require('moment');var BPromise=require(_0x2b5d('0x2'));var rs=require(_0x2b5d('0x3'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0x2b5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b5d('0x5'));var logger=require('../../config/logger')(_0x2b5d('0x6'));var config=require(_0x2b5d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2b5d('0x8')]({'port':0x232a});config[_0x2b5d('0x9')]=_[_0x2b5d('0xa')](config[_0x2b5d('0x9')],{'host':_0x2b5d('0xb'),'port':0x18eb});var socket=require(_0x2b5d('0xc'))(new Redis(config[_0x2b5d('0x9')]));require('./cmContact.socket')['register'](socket);function respondWithRpcPromise(_0x434cf0,_0x3d6c00,_0x1cc626){return new BPromise(function(_0x4d3d39,_0x36ba03){return client[_0x2b5d('0xd')](_0x434cf0,_0x1cc626)[_0x2b5d('0xe')](function(_0x134e88){logger['info'](_0x2b5d('0xf'),_0x3d6c00,'request\x20sent');logger[_0x2b5d('0x10')](_0x2b5d('0x11'),_0x3d6c00,_0x2b5d('0x12'),JSON['stringify'](_0x134e88));if(_0x134e88[_0x2b5d('0x13')]){if(_0x134e88[_0x2b5d('0x13')][_0x2b5d('0x14')]===0x1f4){logger[_0x2b5d('0x13')](_0x2b5d('0xf'),_0x3d6c00,_0x134e88[_0x2b5d('0x13')][_0x2b5d('0x15')]);return _0x36ba03(_0x134e88['error']['message']);}logger[_0x2b5d('0x13')](_0x2b5d('0xf'),_0x3d6c00,_0x134e88[_0x2b5d('0x13')][_0x2b5d('0x15')]);return _0x4d3d39(_0x134e88[_0x2b5d('0x13')]['message']);}else{logger[_0x2b5d('0x16')](_0x2b5d('0xf'),_0x3d6c00,_0x2b5d('0x12'));_0x4d3d39(_0x134e88[_0x2b5d('0x17')][_0x2b5d('0x15')]);}})['catch'](function(_0xaadde3){logger[_0x2b5d('0x13')]('CmContact,\x20%s,\x20%s',_0x3d6c00,_0xaadde3);_0x36ba03(_0xaadde3);});});}exports[_0x2b5d('0x18')]=function(_0x512ed5){var _0x5193d0=this;return new Promise(function(_0x260469,_0x4e6ad9){return db[_0x2b5d('0x19')]['findAll']({'raw':_0x512ed5[_0x2b5d('0x1a')]?_0x512ed5[_0x2b5d('0x1a')][_0x2b5d('0x1b')]===undefined?!![]:![]:!![],'where':_0x512ed5[_0x2b5d('0x1a')]?_0x512ed5[_0x2b5d('0x1a')][_0x2b5d('0x1c')]||null:null,'attributes':_0x512ed5['options']?_0x512ed5[_0x2b5d('0x1a')][_0x2b5d('0x1d')]||null:null,'limit':_0x512ed5[_0x2b5d('0x1a')]?_0x512ed5[_0x2b5d('0x1a')][_0x2b5d('0x1e')]||null:null,'include':_0x512ed5[_0x2b5d('0x1a')]?_0x512ed5['options'][_0x2b5d('0x1f')]?_['map'](_0x512ed5[_0x2b5d('0x1a')]['include'],function(_0x450c48){return{'model':db[_0x450c48[_0x2b5d('0x20')]],'as':_0x450c48['as'],'attributes':_0x450c48[_0x2b5d('0x1d')],'include':_0x450c48[_0x2b5d('0x1f')]?_[_0x2b5d('0x21')](_0x450c48[_0x2b5d('0x1f')],function(_0x559b33){return{'model':db[_0x559b33['model']],'as':_0x559b33['as'],'attributes':_0x559b33[_0x2b5d('0x1d')],'include':_0x559b33[_0x2b5d('0x1f')]?_[_0x2b5d('0x21')](_0x559b33[_0x2b5d('0x1f')],function(_0x19a2bf){return{'model':db[_0x19a2bf[_0x2b5d('0x20')]],'as':_0x19a2bf['as'],'attributes':_0x19a2bf['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b5d('0xe')](function(_0x3ba489){logger[_0x2b5d('0x16')](_0x2b5d('0x18'),_0x512ed5);logger[_0x2b5d('0x10')](_0x2b5d('0x18'),_0x512ed5,JSON[_0x2b5d('0x22')](_0x3ba489));_0x260469(_0x3ba489);})[_0x2b5d('0x23')](function(_0x2ed61c){logger[_0x2b5d('0x13')](_0x2b5d('0x18'),_0x2ed61c[_0x2b5d('0x15')],_0x512ed5);_0x4e6ad9(_0x5193d0['error'](0x1f4,_0x2ed61c[_0x2b5d('0x15')]));});});};exports['CreateCmContact']=function(_0x3c657a){var _0x4bf082=this;return new Promise(function(_0x2a537d,_0x9318b0){return db[_0x2b5d('0x19')][_0x2b5d('0x24')](_0x3c657a[_0x2b5d('0x25')],{'raw':_0x3c657a[_0x2b5d('0x1a')]?_0x3c657a[_0x2b5d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x2b5d('0xe')](function(_0xc64f9b){var _0x12d0a5;for(var _0x2d9077=0x0;_0x2d9077<Object[_0x2b5d('0x26')](_0x3c657a[_0x2b5d('0x25')])[_0x2b5d('0x27')];_0x2d9077++){var _0x289b5a=Object[_0x2b5d('0x26')](_0x3c657a[_0x2b5d('0x25')])[_0x2d9077];if(_0x289b5a[_0x2b5d('0x28')](_0x2b5d('0x29'))){_0x12d0a5=squel['update']()[_0x2b5d('0x2a')](_0x2b5d('0x2b'))[_0x2b5d('0x2c')](_0x289b5a,_0x3c657a['body'][_0x289b5a])[_0x2b5d('0x1c')](_0x2b5d('0x2d'),_0xc64f9b['id'])['toString']();break;}}if(!_0x12d0a5)return _0xc64f9b;return db[_0x2b5d('0x2e')][_0x2b5d('0x2f')](_0x12d0a5)[_0x2b5d('0xe')](function(){return _0xc64f9b;});})[_0x2b5d('0xe')](function(_0x418421){logger[_0x2b5d('0x16')]('CreateCmContact',_0x3c657a);logger[_0x2b5d('0x10')](_0x2b5d('0x30'),_0x3c657a,JSON[_0x2b5d('0x22')](_0x418421));_0x2a537d(_0x418421);})['catch'](function(_0x895fe8){logger[_0x2b5d('0x13')](_0x2b5d('0x30'),_0x895fe8['message'],_0x3c657a);_0x9318b0(_0x4bf082[_0x2b5d('0x13')](0x1f4,_0x895fe8[_0x2b5d('0x15')]));});});};
\ No newline at end of file
+var _0xb5f9=['randomstring','ioredis','squel','../../mysqldb','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','request','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','raw','where','attributes','limit','include','model','map','info','CreateCmContact','body','then','keys','length','startsWith','cf_','table','set','toString','sequelize','query','lodash','util','bluebird'];(function(_0x3df4d4,_0x32d02a){var _0x178c06=function(_0x1a5b95){while(--_0x1a5b95){_0x3df4d4['push'](_0x3df4d4['shift']());}};_0x178c06(++_0x32d02a);}(_0xb5f9,0x93));var _0x9b5f=function(_0x45ae39,_0x403652){_0x45ae39=_0x45ae39-0x0;var _0x5b137f=_0xb5f9[_0x45ae39];return _0x5b137f;};'use strict';var _=require(_0x9b5f('0x0'));var util=require(_0x9b5f('0x1'));var moment=require('moment');var BPromise=require(_0x9b5f('0x2'));var rs=require(_0x9b5f('0x3'));var fs=require('fs');var Redis=require(_0x9b5f('0x4'));var squel=require(_0x9b5f('0x5'));var db=require(_0x9b5f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9b5f('0x7'));var jayson=require(_0x9b5f('0x8'));var client=jayson[_0x9b5f('0x9')]['http']({'port':0x232a});config['redis']=_[_0x9b5f('0xa')](config[_0x9b5f('0xb')],{'host':_0x9b5f('0xc'),'port':0x18eb});var socket=require(_0x9b5f('0xd'))(new Redis(config[_0x9b5f('0xb')]));require(_0x9b5f('0xe'))['register'](socket);function respondWithRpcPromise(_0x6f52d3,_0x1939e1,_0x14f59c){return new BPromise(function(_0xd41205,_0x34b45b){return client[_0x9b5f('0xf')](_0x6f52d3,_0x14f59c)['then'](function(_0x2bf131){logger['info'](_0x9b5f('0x10'),_0x1939e1,_0x9b5f('0x11'));logger[_0x9b5f('0x12')](_0x9b5f('0x13'),_0x1939e1,'request\x20sent',JSON[_0x9b5f('0x14')](_0x2bf131));if(_0x2bf131['error']){if(_0x2bf131[_0x9b5f('0x15')][_0x9b5f('0x16')]===0x1f4){logger[_0x9b5f('0x15')]('CmContact,\x20%s,\x20%s',_0x1939e1,_0x2bf131[_0x9b5f('0x15')][_0x9b5f('0x17')]);return _0x34b45b(_0x2bf131['error'][_0x9b5f('0x17')]);}logger[_0x9b5f('0x15')](_0x9b5f('0x10'),_0x1939e1,_0x2bf131[_0x9b5f('0x15')][_0x9b5f('0x17')]);return _0xd41205(_0x2bf131[_0x9b5f('0x15')]['message']);}else{logger['info'](_0x9b5f('0x10'),_0x1939e1,_0x9b5f('0x11'));_0xd41205(_0x2bf131[_0x9b5f('0x18')]['message']);}})[_0x9b5f('0x19')](function(_0x11f862){logger[_0x9b5f('0x15')](_0x9b5f('0x10'),_0x1939e1,_0x11f862);_0x34b45b(_0x11f862);});});}exports[_0x9b5f('0x1a')]=function(_0x504ac0){var _0x5bd485=this;return new Promise(function(_0x574731,_0x76d4ff){return db[_0x9b5f('0x1b')][_0x9b5f('0x1c')]({'raw':_0x504ac0[_0x9b5f('0x1d')]?_0x504ac0[_0x9b5f('0x1d')][_0x9b5f('0x1e')]===undefined?!![]:![]:!![],'where':_0x504ac0[_0x9b5f('0x1d')]?_0x504ac0['options'][_0x9b5f('0x1f')]||null:null,'attributes':_0x504ac0['options']?_0x504ac0[_0x9b5f('0x1d')][_0x9b5f('0x20')]||null:null,'limit':_0x504ac0[_0x9b5f('0x1d')]?_0x504ac0[_0x9b5f('0x1d')][_0x9b5f('0x21')]||null:null,'include':_0x504ac0[_0x9b5f('0x1d')]?_0x504ac0[_0x9b5f('0x1d')][_0x9b5f('0x22')]?_['map'](_0x504ac0['options'][_0x9b5f('0x22')],function(_0xcee16c){return{'model':db[_0xcee16c[_0x9b5f('0x23')]],'as':_0xcee16c['as'],'attributes':_0xcee16c[_0x9b5f('0x20')],'include':_0xcee16c[_0x9b5f('0x22')]?_[_0x9b5f('0x24')](_0xcee16c['include'],function(_0x3600a1){return{'model':db[_0x3600a1[_0x9b5f('0x23')]],'as':_0x3600a1['as'],'attributes':_0x3600a1[_0x9b5f('0x20')],'include':_0x3600a1['include']?_[_0x9b5f('0x24')](_0x3600a1['include'],function(_0x188370){return{'model':db[_0x188370[_0x9b5f('0x23')]],'as':_0x188370['as'],'attributes':_0x188370['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x595e8b){logger[_0x9b5f('0x25')]('GetCmContact',_0x504ac0);logger[_0x9b5f('0x12')](_0x9b5f('0x1a'),_0x504ac0,JSON[_0x9b5f('0x14')](_0x595e8b));_0x574731(_0x595e8b);})[_0x9b5f('0x19')](function(_0xa0c4fe){logger[_0x9b5f('0x15')]('GetCmContact',_0xa0c4fe[_0x9b5f('0x17')],_0x504ac0);_0x76d4ff(_0x5bd485[_0x9b5f('0x15')](0x1f4,_0xa0c4fe[_0x9b5f('0x17')]));});});};exports[_0x9b5f('0x26')]=function(_0x224eb4){var _0x1ade8f=this;return new Promise(function(_0x4df914,_0x25d117){return db[_0x9b5f('0x1b')]['create'](_0x224eb4[_0x9b5f('0x27')],{'raw':_0x224eb4[_0x9b5f('0x1d')]?_0x224eb4[_0x9b5f('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x9b5f('0x28')](function(_0x29897b){var _0x38fb10;for(var _0x2c24d4=0x0;_0x2c24d4<Object[_0x9b5f('0x29')](_0x224eb4[_0x9b5f('0x27')])[_0x9b5f('0x2a')];_0x2c24d4++){var _0x454452=Object[_0x9b5f('0x29')](_0x224eb4['body'])[_0x2c24d4];if(_0x454452[_0x9b5f('0x2b')](_0x9b5f('0x2c'))){_0x38fb10=squel['update']()[_0x9b5f('0x2d')]('cm_contacts')[_0x9b5f('0x2e')](_0x454452,_0x224eb4[_0x9b5f('0x27')][_0x454452])[_0x9b5f('0x1f')]('id\x20=\x20?',_0x29897b['id'])[_0x9b5f('0x2f')]();break;}}if(!_0x38fb10)return _0x29897b;return db[_0x9b5f('0x30')][_0x9b5f('0x31')](_0x38fb10)['then'](function(){return _0x29897b;});})[_0x9b5f('0x28')](function(_0x459f1a){logger[_0x9b5f('0x25')](_0x9b5f('0x26'),_0x224eb4);logger[_0x9b5f('0x12')](_0x9b5f('0x26'),_0x224eb4,JSON[_0x9b5f('0x14')](_0x459f1a));_0x4df914(_0x459f1a);})[_0x9b5f('0x19')](function(_0x398656){logger[_0x9b5f('0x15')](_0x9b5f('0x26'),_0x398656[_0x9b5f('0x17')],_0x224eb4);_0x25d117(_0x1ade8f[_0x9b5f('0x15')](0x1f4,_0x398656[_0x9b5f('0x17')]));});});};
\ No newline at end of file
index 38f368c..1bcda78 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 2ba08c7..cbe463e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc739=['post','/merge','merge','create','bulkCreate','/:id/tags','setTags','root','originalname','replace','%s-%s%s','basename','extname','now','single','file','uploadCsv','diskStorage','join','server/files/tmp','format','/upload','upload','/upload/:id','import','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/:id','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions'];(function(_0x128598,_0xe28ce0){var _0xb2add5=function(_0x3e10da){while(--_0x3e10da){_0x128598['push'](_0x128598['shift']());}};_0xb2add5(++_0xe28ce0);}(_0xc739,0x14f));var _0x9c73=function(_0x257f34,_0x5914a9){_0x257f34=_0x257f34-0x0;var _0x38420e=_0xc739[_0x257f34];return _0x38420e;};'use strict';var multer=require(_0x9c73('0x0'));var util=require(_0x9c73('0x1'));var path=require('path');var timeout=require(_0x9c73('0x2'));var express=require(_0x9c73('0x3'));var router=express[_0x9c73('0x4')]();var fs_extra=require(_0x9c73('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9c73('0x6'));var config=require(_0x9c73('0x7'));var controller=require(_0x9c73('0x8'));router[_0x9c73('0x9')]('/',auth[_0x9c73('0xa')](),controller['index']);router[_0x9c73('0x9')]('/describe',auth[_0x9c73('0xa')](),controller['describe']);router[_0x9c73('0x9')](_0x9c73('0xb'),auth[_0x9c73('0xa')](),controller[_0x9c73('0xc')]);router[_0x9c73('0x9')]('/:id/tags',auth[_0x9c73('0xa')](),controller[_0x9c73('0xd')]);router[_0x9c73('0x9')](_0x9c73('0xe'),auth['isAuthenticated'](),controller[_0x9c73('0xf')]);router[_0x9c73('0x9')](_0x9c73('0x10'),auth['isAuthenticated'](),controller[_0x9c73('0x11')]);router[_0x9c73('0x9')](_0x9c73('0x12'),auth['isAuthenticated'](),controller[_0x9c73('0x13')]);router[_0x9c73('0x9')](_0x9c73('0x14'),auth[_0x9c73('0xa')](),controller[_0x9c73('0x15')]);router[_0x9c73('0x9')]('/:id/journey',auth['isAuthenticated'](),controller['getJourney']);router[_0x9c73('0x16')](_0x9c73('0x17'),auth[_0x9c73('0xa')](),controller[_0x9c73('0x18')]);router[_0x9c73('0x16')]('/',auth[_0x9c73('0xa')](),controller[_0x9c73('0x19')]);router[_0x9c73('0x16')]('/create_many',auth[_0x9c73('0xa')](),controller[_0x9c73('0x1a')]);router[_0x9c73('0x16')](_0x9c73('0x1b'),auth[_0x9c73('0xa')](),controller[_0x9c73('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3bfc71,_0x25f7c7,_0x3d0018){_0x3d0018(null,path['join'](config[_0x9c73('0x1d')],'server/files/tmp'));},'filename':function(_0x2b7b3e,_0x441dc6,_0x30c2e4){_0x441dc6[_0x9c73('0x1e')]=_0x441dc6[_0x9c73('0x1e')][_0x9c73('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x30c2e4(null,util['format'](_0x9c73('0x20'),path[_0x9c73('0x21')](_0x441dc6[_0x9c73('0x1e')],path[_0x9c73('0x22')](_0x441dc6['originalname'])),Date[_0x9c73('0x23')](),path[_0x9c73('0x22')](_0x441dc6[_0x9c73('0x1e')])));}})});router[_0x9c73('0x16')]('/csv',upload[_0x9c73('0x24')](_0x9c73('0x25')),controller[_0x9c73('0x26')]);var upload=multer({'storage':multer[_0x9c73('0x27')]({'destination':function(_0x371fe6,_0x265a70,_0x16d286){_0x16d286(null,path[_0x9c73('0x28')](config[_0x9c73('0x1d')],_0x9c73('0x29')));},'filename':function(_0x593aa4,_0x4a8bf2,_0x5a2e9d){_0x4a8bf2[_0x9c73('0x1e')]=_0x4a8bf2[_0x9c73('0x1e')][_0x9c73('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a2e9d(null,util[_0x9c73('0x2a')](_0x9c73('0x20'),path['basename'](_0x4a8bf2['originalname'],path[_0x9c73('0x22')](_0x4a8bf2[_0x9c73('0x1e')])),Date['now'](),path[_0x9c73('0x22')](_0x4a8bf2['originalname'])));}})});router[_0x9c73('0x16')](_0x9c73('0x2b'),upload[_0x9c73('0x24')]('file'),controller[_0x9c73('0x2c')]);router[_0x9c73('0x16')](_0x9c73('0x2d'),auth['isAuthenticated'](),controller[_0x9c73('0x2e')]);router[_0x9c73('0x2f')](_0x9c73('0xb'),auth[_0x9c73('0xa')](),controller[_0x9c73('0x30')]);router[_0x9c73('0x31')](_0x9c73('0xb'),auth[_0x9c73('0xa')](),controller['destroy']);module[_0x9c73('0x32')]=router;
\ No newline at end of file
+var _0xde63=['format','%s-%s%s','basename','extname','now','/csv','single','file','import','put','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/tags','getTags','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getJscriptySessions','/:id/journey','getJourney','merge','/create_many','bulkCreate','post','diskStorage','join','server/files/tmp','originalname','replace'];(function(_0x210718,_0x5c8eb6){var _0x279fca=function(_0x5bf319){while(--_0x5bf319){_0x210718['push'](_0x210718['shift']());}};_0x279fca(++_0x5c8eb6);}(_0xde63,0xb8));var _0x3de6=function(_0x1a72b8,_0x1e4f4b){_0x1a72b8=_0x1a72b8-0x0;var _0x39f72d=_0xde63[_0x1a72b8];return _0x39f72d;};'use strict';var multer=require(_0x3de6('0x0'));var util=require(_0x3de6('0x1'));var path=require('path');var timeout=require(_0x3de6('0x2'));var express=require('express');var router=express[_0x3de6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3de6('0x4'));var interaction=require(_0x3de6('0x5'));var config=require(_0x3de6('0x6'));var controller=require(_0x3de6('0x7'));router[_0x3de6('0x8')]('/',auth[_0x3de6('0x9')](),controller[_0x3de6('0xa')]);router[_0x3de6('0x8')](_0x3de6('0xb'),auth[_0x3de6('0x9')](),controller['describe']);router[_0x3de6('0x8')](_0x3de6('0xc'),auth['isAuthenticated'](),controller[_0x3de6('0xd')]);router['get'](_0x3de6('0xe'),auth[_0x3de6('0x9')](),controller[_0x3de6('0xf')]);router[_0x3de6('0x8')]('/:id/hoppers',auth[_0x3de6('0x9')](),controller[_0x3de6('0x10')]);router[_0x3de6('0x8')](_0x3de6('0x11'),auth[_0x3de6('0x9')](),controller['getHopperHistories']);router[_0x3de6('0x8')](_0x3de6('0x12'),auth[_0x3de6('0x9')](),controller['getHopperFinals']);router['get']('/:id/jscripty_sessions',auth[_0x3de6('0x9')](),controller[_0x3de6('0x13')]);router[_0x3de6('0x8')](_0x3de6('0x14'),auth[_0x3de6('0x9')](),controller[_0x3de6('0x15')]);router['post']('/merge',auth[_0x3de6('0x9')](),controller[_0x3de6('0x16')]);router['post']('/',auth[_0x3de6('0x9')](),controller['create']);router['post'](_0x3de6('0x17'),auth[_0x3de6('0x9')](),controller[_0x3de6('0x18')]);router[_0x3de6('0x19')](_0x3de6('0xe'),auth['isAuthenticated'](),controller['setTags']);var upload=multer({'storage':multer[_0x3de6('0x1a')]({'destination':function(_0x257e0f,_0x2e57cd,_0x27472b){_0x27472b(null,path[_0x3de6('0x1b')](config['root'],_0x3de6('0x1c')));},'filename':function(_0x2c6814,_0x415893,_0x2763c9){_0x415893[_0x3de6('0x1d')]=_0x415893[_0x3de6('0x1d')][_0x3de6('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2763c9(null,util[_0x3de6('0x1f')](_0x3de6('0x20'),path[_0x3de6('0x21')](_0x415893[_0x3de6('0x1d')],path[_0x3de6('0x22')](_0x415893[_0x3de6('0x1d')])),Date[_0x3de6('0x23')](),path['extname'](_0x415893[_0x3de6('0x1d')])));}})});router['post'](_0x3de6('0x24'),upload[_0x3de6('0x25')](_0x3de6('0x26')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x3de6('0x1a')]({'destination':function(_0x77e02a,_0x33b4ef,_0xe30853){_0xe30853(null,path[_0x3de6('0x1b')](config['root'],'server/files/tmp'));},'filename':function(_0x116ffb,_0x5dadb9,_0x33c43f){_0x5dadb9[_0x3de6('0x1d')]=_0x5dadb9['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x33c43f(null,util[_0x3de6('0x1f')](_0x3de6('0x20'),path[_0x3de6('0x21')](_0x5dadb9['originalname'],path[_0x3de6('0x22')](_0x5dadb9[_0x3de6('0x1d')])),Date[_0x3de6('0x23')](),path['extname'](_0x5dadb9[_0x3de6('0x1d')])));}})});router[_0x3de6('0x19')]('/upload',upload['single'](_0x3de6('0x26')),controller['upload']);router[_0x3de6('0x19')]('/upload/:id',auth['isAuthenticated'](),controller[_0x3de6('0x27')]);router[_0x3de6('0x28')](_0x3de6('0xc'),auth[_0x3de6('0x9')](),controller['update']);router[_0x3de6('0x29')]('/:id',auth[_0x3de6('0x9')](),controller['destroy']);module[_0x3de6('0x2a')]=router;
\ No newline at end of file
index 389d3a1..7ca9e2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59fe=['getDataValue','alias','setDataValue','TEXT','long','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL'];(function(_0xcdf809,_0x2881f0){var _0x4d4d70=function(_0x277c61){while(--_0x277c61){_0xcdf809['push'](_0xcdf809['shift']());}};_0x4d4d70(++_0x2881f0);}(_0x59fe,0x174));var _0xe59f=function(_0x38b8e7,_0x775dec){_0x38b8e7=_0x38b8e7-0x0;var _0x125a54=_0x59fe[_0x38b8e7];return _0x125a54;};'use strict';var Sequelize=require('sequelize');var _=require(_0xe59f('0x0'));module[_0xe59f('0x1')]={'name':{'type':Sequelize[_0xe59f('0x2')],'get':function(_0x7596c6){return this[_0xe59f('0x3')](_0xe59f('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3b21d0){this[_0xe59f('0x5')](_0xe59f('0x4'),_0x3b21d0?_0x3b21d0:this[_0xe59f('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xe59f('0x6')](_0xe59f('0x7')),'get':function(){if(this[_0xe59f('0x3')]('type')==='select'){return JSON[_0xe59f('0x8')](this[_0xe59f('0x3')](_0xe59f('0x9')));}else{return this[_0xe59f('0x3')](_0xe59f('0x9'));}},'set':function(_0x3976a3){if(Array[_0xe59f('0xa')](_0x3976a3)){this['setDataValue'](_0xe59f('0x9'),JSON[_0xe59f('0xb')](_0x3976a3));}else{this['setDataValue']('values',_0x3976a3);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe59f('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe59f('0xd')](_0xe59f('0xe'))}};
\ No newline at end of file
+var _0xf960=['exports','VIRTUAL','getDataValue','alias','STRING','name','TEXT','long','select','values','isArray','stringify','setDataValue','voice','sequelize'];(function(_0x38ba9c,_0x1daf18){var _0x4de41d=function(_0x4aed5d){while(--_0x4aed5d){_0x38ba9c['push'](_0x38ba9c['shift']());}};_0x4de41d(++_0x1daf18);}(_0xf960,0x95));var _0x0f96=function(_0x104a84,_0x285970){_0x104a84=_0x104a84-0x0;var _0x4973ff=_0xf960[_0x104a84];return _0x4973ff;};'use strict';var Sequelize=require(_0x0f96('0x0'));var _=require('lodash');module[_0x0f96('0x1')]={'name':{'type':Sequelize[_0x0f96('0x2')],'get':function(_0x3ef0b2){return this[_0x0f96('0x3')](_0x0f96('0x4'));}},'alias':{'type':Sequelize[_0x0f96('0x5')],'allowNull':![],'set':function(_0x5f2d59){this['setDataValue'](_0x0f96('0x4'),_0x5f2d59?_0x5f2d59:this[_0x0f96('0x3')](_0x0f96('0x6')));}},'type':{'type':Sequelize[_0x0f96('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x0f96('0x7')](_0x0f96('0x8')),'get':function(){if(this[_0x0f96('0x3')]('type')===_0x0f96('0x9')){return JSON['parse'](this[_0x0f96('0x3')](_0x0f96('0xa')));}else{return this[_0x0f96('0x3')](_0x0f96('0xa'));}},'set':function(_0x4f7718){if(Array[_0x0f96('0xb')](_0x4f7718)){this['setDataValue']('values',JSON[_0x0f96('0xc')](_0x4f7718));}else{this[_0x0f96('0xd')]('values',_0x4f7718);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x0f96('0xe'))}};
\ No newline at end of file
index 63f77e1..9f582c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88c7=['then','destroy','end','error','stack','name','index','map','CmCustomField','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','body','create','sequelize','transaction','Sequelize','text','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update'];(function(_0x834994,_0x19bb3d){var _0x3af23d=function(_0x1b62d0){while(--_0x1b62d0){_0x834994['push'](_0x834994['shift']());}};_0x3af23d(++_0x19bb3d);}(_0x88c7,0x185));var _0x788c=function(_0x5d97ea,_0x1fb93e){_0x5d97ea=_0x5d97ea-0x0;var _0x2d53ea=_0x88c7[_0x5d97ea];return _0x2d53ea;};'use strict';var emlformat=require(_0x788c('0x0'));var rimraf=require(_0x788c('0x1'));var zipdir=require(_0x788c('0x2'));var jsonpatch=require(_0x788c('0x3'));var rp=require(_0x788c('0x4'));var moment=require(_0x788c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x788c('0x6'));var path=require(_0x788c('0x7'));var sox=require(_0x788c('0x8'));var csv=require('to-csv');var ejs=require(_0x788c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x788c('0xa'));var crypto=require(_0x788c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x788c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x788c('0xd'));var Papa=require(_0x788c('0xe'));var Redis=require(_0x788c('0xf'));var authService=require(_0x788c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x788c('0x11'));var hardwareService=require(_0x788c('0x12'));var logger=require(_0x788c('0x13'))(_0x788c('0x14'));var utils=require(_0x788c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x788c('0x16'));var db=require(_0x788c('0x17'))['db'];function respondWithStatusCode(_0x3228ca,_0x2abecb){_0x2abecb=_0x2abecb||0xcc;return function(_0x24cccb){if(_0x24cccb){return _0x3228ca[_0x788c('0x18')](_0x2abecb);}return _0x3228ca[_0x788c('0x19')](_0x2abecb)['end']();};}function respondWithResult(_0x2bd0b4,_0x3e68ed){_0x3e68ed=_0x3e68ed||0xc8;return function(_0x1c0bc1){if(_0x1c0bc1){return _0x2bd0b4[_0x788c('0x19')](_0x3e68ed)[_0x788c('0x1a')](_0x1c0bc1);}};}function respondWithFilteredResult(_0x20c0f5,_0x4cd1fa){return function(_0x4b320f){if(_0x4b320f){var _0x10acf1=typeof _0x4cd1fa[_0x788c('0x1b')]===_0x788c('0x1c')&&typeof _0x4cd1fa[_0x788c('0x1d')]===_0x788c('0x1c');var _0x41fb6d=_0x4b320f[_0x788c('0x1e')];var _0x46470c=_0x10acf1?0x0:_0x4cd1fa['offset'];var _0x193e89=_0x10acf1?_0x4b320f[_0x788c('0x1e')]:_0x4cd1fa[_0x788c('0x1b')]+_0x4cd1fa[_0x788c('0x1d')];var _0x1f4839;if(_0x193e89>=_0x41fb6d){_0x193e89=_0x41fb6d;_0x1f4839=0xc8;}else{_0x1f4839=0xce;}_0x20c0f5[_0x788c('0x19')](_0x1f4839);return _0x20c0f5[_0x788c('0x1f')]('Content-Range',_0x46470c+'-'+_0x193e89+'/'+_0x41fb6d)[_0x788c('0x1a')](_0x4b320f);}return null;};}function patchUpdates(_0x2c0c18){return function(_0xa75f1c){try{jsonpatch[_0x788c('0x20')](_0xa75f1c,_0x2c0c18,!![]);}catch(_0x61608a){return BPromise[_0x788c('0x21')](_0x61608a);}return _0xa75f1c[_0x788c('0x22')]();};}function saveUpdates(_0x4c9f26,_0x308ea8){return function(_0x1e104f){if(_0x1e104f){return _0x1e104f[_0x788c('0x23')](_0x4c9f26)[_0x788c('0x24')](function(_0x35122f){return _0x35122f;});}return null;};}function removeEntity(_0x58dbb4,_0x20d3b0){return function(_0x48f7cd){if(_0x48f7cd){return _0x48f7cd[_0x788c('0x25')]()[_0x788c('0x24')](function(){_0x58dbb4[_0x788c('0x19')](0xcc)[_0x788c('0x26')]();});}};}function handleEntityNotFound(_0x5549c7,_0x195bba){return function(_0x5f5c50){if(!_0x5f5c50){_0x5549c7[_0x788c('0x18')](0x194);}return _0x5f5c50;};}function handleError(_0x25765b,_0x1d8b9e){_0x1d8b9e=_0x1d8b9e||0x1f4;return function(_0x4d72b5){logger[_0x788c('0x27')](_0x4d72b5[_0x788c('0x28')]);if(_0x4d72b5[_0x788c('0x29')]){delete _0x4d72b5[_0x788c('0x29')];}_0x25765b[_0x788c('0x19')](_0x1d8b9e)['send'](_0x4d72b5);};}exports[_0x788c('0x2a')]=function(_0x6431a6,_0x2e7483){var _0x5d3c5a={},_0x1a6f11={},_0x5f5a41={'count':0x0,'rows':[]};var _0x304bd3=_[_0x788c('0x2b')](db[_0x788c('0x2c')][_0x788c('0x2d')],function(_0x531c06){return{'name':_0x531c06[_0x788c('0x2e')],'type':_0x531c06[_0x788c('0x2f')]['key']};});_0x1a6f11[_0x788c('0x30')]=_['differenceBy'](_[_0x788c('0x2b')](_0x304bd3,_0x788c('0x29')),['name']);_0x1a6f11[_0x788c('0x31')]=_['keys'](_0x6431a6[_0x788c('0x31')]);_0x1a6f11['filters']=_[_0x788c('0x32')](_0x1a6f11[_0x788c('0x30')],_0x1a6f11[_0x788c('0x31')]);_0x5d3c5a[_0x788c('0x33')]=_[_0x788c('0x32')](_0x1a6f11[_0x788c('0x30')],qs[_0x788c('0x34')](_0x6431a6['query'][_0x788c('0x34')]));_0x5d3c5a[_0x788c('0x33')]=_0x5d3c5a['attributes'][_0x788c('0x35')]?_0x5d3c5a[_0x788c('0x33')]:_0x1a6f11[_0x788c('0x30')];if(!_0x6431a6[_0x788c('0x31')][_0x788c('0x36')](_0x788c('0x37'))){_0x5d3c5a[_0x788c('0x1d')]=qs[_0x788c('0x1d')](_0x6431a6[_0x788c('0x31')][_0x788c('0x1d')]);_0x5d3c5a[_0x788c('0x1b')]=qs[_0x788c('0x1b')](_0x6431a6[_0x788c('0x31')][_0x788c('0x1b')]);}_0x5d3c5a[_0x788c('0x38')]=qs[_0x788c('0x39')](_0x6431a6[_0x788c('0x31')][_0x788c('0x39')]);_0x5d3c5a[_0x788c('0x3a')]=qs[_0x788c('0x3b')](_['pick'](_0x6431a6['query'],_0x1a6f11[_0x788c('0x3b')]),_0x304bd3);if(_0x6431a6[_0x788c('0x31')]['filter']){_0x5d3c5a[_0x788c('0x3a')]=_['merge'](_0x5d3c5a[_0x788c('0x3a')],{'$or':_[_0x788c('0x2b')](_0x304bd3,function(_0x35e3a4){if(_0x35e3a4[_0x788c('0x2f')]!==_0x788c('0x3c')){var _0x3c9b9f={};_0x3c9b9f[_0x35e3a4['name']]={'$like':'%'+_0x6431a6[_0x788c('0x31')][_0x788c('0x3d')]+'%'};return _0x3c9b9f;}})});}_0x5d3c5a=_[_0x788c('0x3e')]({},_0x5d3c5a,_0x6431a6[_0x788c('0x3f')]);var _0x548370={'where':_0x5d3c5a[_0x788c('0x3a')]};return db[_0x788c('0x2c')][_0x788c('0x1e')](_0x548370)[_0x788c('0x24')](function(_0x3448b4){_0x5f5a41[_0x788c('0x1e')]=_0x3448b4;if(_0x6431a6[_0x788c('0x31')][_0x788c('0x40')]){_0x5d3c5a[_0x788c('0x41')]=[{'all':!![]}];}return db['CmCustomField'][_0x788c('0x42')](_0x5d3c5a);})['then'](function(_0x446811){_0x5f5a41[_0x788c('0x43')]=_0x446811;return _0x5f5a41;})[_0x788c('0x24')](respondWithFilteredResult(_0x2e7483,_0x5d3c5a))[_0x788c('0x44')](handleError(_0x2e7483,null));};exports[_0x788c('0x45')]=function(_0x4db9e8,_0x5ab339){var _0x19243e={'raw':!![],'where':{'id':_0x4db9e8['params']['id']}},_0x48a8b6={};_0x48a8b6['model']=_[_0x788c('0x46')](db[_0x788c('0x2c')][_0x788c('0x2d')]);_0x48a8b6[_0x788c('0x31')]=_[_0x788c('0x46')](_0x4db9e8[_0x788c('0x31')]);_0x48a8b6['filters']=_[_0x788c('0x32')](_0x48a8b6[_0x788c('0x30')],_0x48a8b6[_0x788c('0x31')]);_0x19243e[_0x788c('0x33')]=_[_0x788c('0x32')](_0x48a8b6[_0x788c('0x30')],qs[_0x788c('0x34')](_0x4db9e8[_0x788c('0x31')][_0x788c('0x34')]));_0x19243e[_0x788c('0x33')]=_0x19243e[_0x788c('0x33')][_0x788c('0x35')]?_0x19243e[_0x788c('0x33')]:_0x48a8b6[_0x788c('0x30')];if(_0x4db9e8[_0x788c('0x31')][_0x788c('0x40')]){_0x19243e[_0x788c('0x41')]=[{'all':!![]}];}_0x19243e=_[_0x788c('0x3e')]({},_0x19243e,_0x4db9e8[_0x788c('0x3f')]);return db[_0x788c('0x2c')][_0x788c('0x47')](_0x19243e)[_0x788c('0x24')](handleEntityNotFound(_0x5ab339,null))[_0x788c('0x24')](respondWithResult(_0x5ab339,null))[_0x788c('0x44')](handleError(_0x5ab339,null));};exports[_0x788c('0x23')]=function(_0x28ce27,_0x496073){if(_0x28ce27[_0x788c('0x48')]['id']){delete _0x28ce27[_0x788c('0x48')]['id'];}return db[_0x788c('0x2c')][_0x788c('0x47')]({'where':{'id':_0x28ce27['params']['id']}})[_0x788c('0x24')](handleEntityNotFound(_0x496073,null))['then'](saveUpdates(_0x28ce27['body'],null))[_0x788c('0x24')](respondWithResult(_0x496073,null))[_0x788c('0x44')](handleError(_0x496073,null));};exports[_0x788c('0x25')]=function(_0x9880d0,_0x596e9f){return db[_0x788c('0x2c')][_0x788c('0x47')]({'where':{'id':_0x9880d0['params']['id']}})[_0x788c('0x24')](handleEntityNotFound(_0x596e9f,null))['then'](removeEntity(_0x596e9f,null))[_0x788c('0x44')](handleError(_0x596e9f,null));};exports[_0x788c('0x49')]=function(_0x4aefde,_0x4066dc){var _0x49a869;return db[_0x788c('0x4a')][_0x788c('0x4b')](function(_0x336fe3){return db[_0x788c('0x2c')][_0x788c('0x49')](_0x4aefde[_0x788c('0x48')],{'transaction':_0x336fe3})[_0x788c('0x24')](function(_0x2148f5){_0x49a869=_0x2148f5;var _0x5a370e={'type':db[_0x788c('0x4c')]['TEXT'],'transaction':_0x336fe3};switch(_0x4aefde[_0x788c('0x48')][_0x788c('0x2f')]){case _0x788c('0x4d'):_0x5a370e['type']=db[_0x788c('0x4c')][_0x788c('0x4e')];break;case'number':_0x5a370e[_0x788c('0x2f')]=db[_0x788c('0x4c')][_0x788c('0x4f')];break;case _0x788c('0x50'):_0x5a370e['type']=db[_0x788c('0x4c')][_0x788c('0x51')];_0x5a370e[_0x788c('0x52')]=![];break;default:}return db[_0x788c('0x4a')][_0x788c('0x53')]['addColumn']('cm_contacts',util['format'](_0x788c('0x54'),_0x49a869['id']),_0x5a370e);})[_0x788c('0x24')](function(){return _0x49a869;});})[_0x788c('0x24')](respondWithResult(_0x4066dc,0xc9))[_0x788c('0x44')](handleError(_0x4066dc,null));};
\ No newline at end of file
+var _0xc52a=['squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','name','map','CmCustomField','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','VIRTUAL','merge','findAll','rows','show','params','include','find','catch','body','create','transaction','Sequelize','TEXT','text','number','switch','defaultValue','sequelize','queryInterface','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs'];(function(_0x402c34,_0x4582fd){var _0x2bad90=function(_0x361b7f){while(--_0x361b7f){_0x402c34['push'](_0x402c34['shift']());}};_0x2bad90(++_0x4582fd);}(_0xc52a,0x123));var _0xac52=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0xc52a[_0x466247];return _0x4b352e;};'use strict';var emlformat=require(_0xac52('0x0'));var rimraf=require(_0xac52('0x1'));var zipdir=require(_0xac52('0x2'));var jsonpatch=require(_0xac52('0x3'));var rp=require('request-promise');var moment=require(_0xac52('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac52('0x5'));var util=require(_0xac52('0x6'));var path=require('path');var sox=require(_0xac52('0x7'));var csv=require('to-csv');var ejs=require(_0xac52('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xac52('0x9'));var crypto=require(_0xac52('0xa'));var jsforce=require(_0xac52('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xac52('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xac52('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xac52('0xe'));var as=require(_0xac52('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xac52('0x10'));var utils=require('../../config/utils');var config=require(_0xac52('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xac52('0x12'))['db'];function respondWithStatusCode(_0x487dea,_0x54b03f){_0x54b03f=_0x54b03f||0xcc;return function(_0x431fb5){if(_0x431fb5){return _0x487dea[_0xac52('0x13')](_0x54b03f);}return _0x487dea[_0xac52('0x14')](_0x54b03f)[_0xac52('0x15')]();};}function respondWithResult(_0x232c2b,_0x1494b3){_0x1494b3=_0x1494b3||0xc8;return function(_0x1f92ff){if(_0x1f92ff){return _0x232c2b[_0xac52('0x14')](_0x1494b3)[_0xac52('0x16')](_0x1f92ff);}};}function respondWithFilteredResult(_0x5e985a,_0x2a29e9){return function(_0x5239fb){if(_0x5239fb){var _0x2ad6d2=typeof _0x2a29e9[_0xac52('0x17')]===_0xac52('0x18')&&typeof _0x2a29e9[_0xac52('0x19')]===_0xac52('0x18');var _0x58cf18=_0x5239fb['count'];var _0x2476f7=_0x2ad6d2?0x0:_0x2a29e9[_0xac52('0x17')];var _0x592223=_0x2ad6d2?_0x5239fb[_0xac52('0x1a')]:_0x2a29e9[_0xac52('0x17')]+_0x2a29e9['limit'];var _0x41d941;if(_0x592223>=_0x58cf18){_0x592223=_0x58cf18;_0x41d941=0xc8;}else{_0x41d941=0xce;}_0x5e985a[_0xac52('0x14')](_0x41d941);return _0x5e985a[_0xac52('0x1b')](_0xac52('0x1c'),_0x2476f7+'-'+_0x592223+'/'+_0x58cf18)[_0xac52('0x16')](_0x5239fb);}return null;};}function patchUpdates(_0x30c45b){return function(_0x3b469c){try{jsonpatch[_0xac52('0x1d')](_0x3b469c,_0x30c45b,!![]);}catch(_0xb089af){return BPromise[_0xac52('0x1e')](_0xb089af);}return _0x3b469c[_0xac52('0x1f')]();};}function saveUpdates(_0x30bfda,_0x507d8c){return function(_0x2f0190){if(_0x2f0190){return _0x2f0190['update'](_0x30bfda)['then'](function(_0x2e40a6){return _0x2e40a6;});}return null;};}function removeEntity(_0x561f3d,_0xaa69e9){return function(_0x4031e3){if(_0x4031e3){return _0x4031e3[_0xac52('0x20')]()[_0xac52('0x21')](function(){_0x561f3d[_0xac52('0x14')](0xcc)[_0xac52('0x15')]();});}};}function handleEntityNotFound(_0x5d95e2,_0x27fb90){return function(_0x162fb5){if(!_0x162fb5){_0x5d95e2['sendStatus'](0x194);}return _0x162fb5;};}function handleError(_0xa56b10,_0x4ecc90){_0x4ecc90=_0x4ecc90||0x1f4;return function(_0x208b28){logger['error'](_0x208b28['stack']);if(_0x208b28[_0xac52('0x22')]){delete _0x208b28[_0xac52('0x22')];}_0xa56b10[_0xac52('0x14')](_0x4ecc90)['send'](_0x208b28);};}exports['index']=function(_0x5da6a0,_0x27951e){var _0x145c3a={},_0x2caef1={},_0x364838={'count':0x0,'rows':[]};var _0xc6bf24=_[_0xac52('0x23')](db[_0xac52('0x24')][_0xac52('0x25')],function(_0x593b4c){return{'name':_0x593b4c[_0xac52('0x26')],'type':_0x593b4c[_0xac52('0x27')]['key']};});_0x2caef1[_0xac52('0x28')]=_['differenceBy'](_[_0xac52('0x23')](_0xc6bf24,_0xac52('0x22')),['name']);_0x2caef1[_0xac52('0x29')]=_[_0xac52('0x2a')](_0x5da6a0[_0xac52('0x29')]);_0x2caef1['filters']=_[_0xac52('0x2b')](_0x2caef1[_0xac52('0x28')],_0x2caef1[_0xac52('0x29')]);_0x145c3a[_0xac52('0x2c')]=_[_0xac52('0x2b')](_0x2caef1[_0xac52('0x28')],qs[_0xac52('0x2d')](_0x5da6a0[_0xac52('0x29')][_0xac52('0x2d')]));_0x145c3a[_0xac52('0x2c')]=_0x145c3a[_0xac52('0x2c')][_0xac52('0x2e')]?_0x145c3a[_0xac52('0x2c')]:_0x2caef1[_0xac52('0x28')];if(!_0x5da6a0[_0xac52('0x29')][_0xac52('0x2f')](_0xac52('0x30'))){_0x145c3a[_0xac52('0x19')]=qs[_0xac52('0x19')](_0x5da6a0[_0xac52('0x29')]['limit']);_0x145c3a['offset']=qs[_0xac52('0x17')](_0x5da6a0[_0xac52('0x29')][_0xac52('0x17')]);}_0x145c3a['order']=qs[_0xac52('0x31')](_0x5da6a0[_0xac52('0x29')]['sort']);_0x145c3a['where']=qs[_0xac52('0x32')](_['pick'](_0x5da6a0[_0xac52('0x29')],_0x2caef1[_0xac52('0x32')]),_0xc6bf24);if(_0x5da6a0[_0xac52('0x29')][_0xac52('0x33')]){_0x145c3a[_0xac52('0x34')]=_['merge'](_0x145c3a['where'],{'$or':_['map'](_0xc6bf24,function(_0x23d474){if(_0x23d474[_0xac52('0x27')]!==_0xac52('0x35')){var _0x5145aa={};_0x5145aa[_0x23d474[_0xac52('0x22')]]={'$like':'%'+_0x5da6a0['query'][_0xac52('0x33')]+'%'};return _0x5145aa;}})});}_0x145c3a=_[_0xac52('0x36')]({},_0x145c3a,_0x5da6a0['options']);var _0xd7c00e={'where':_0x145c3a[_0xac52('0x34')]};return db['CmCustomField'][_0xac52('0x1a')](_0xd7c00e)[_0xac52('0x21')](function(_0x57a383){_0x364838[_0xac52('0x1a')]=_0x57a383;if(_0x5da6a0[_0xac52('0x29')]['includeAll']){_0x145c3a['include']=[{'all':!![]}];}return db[_0xac52('0x24')][_0xac52('0x37')](_0x145c3a);})['then'](function(_0x15e86b){_0x364838[_0xac52('0x38')]=_0x15e86b;return _0x364838;})['then'](respondWithFilteredResult(_0x27951e,_0x145c3a))['catch'](handleError(_0x27951e,null));};exports[_0xac52('0x39')]=function(_0x4a047b,_0x154b39){var _0x40c599={'raw':!![],'where':{'id':_0x4a047b[_0xac52('0x3a')]['id']}},_0x5571a2={};_0x5571a2['model']=_[_0xac52('0x2a')](db[_0xac52('0x24')]['rawAttributes']);_0x5571a2[_0xac52('0x29')]=_[_0xac52('0x2a')](_0x4a047b['query']);_0x5571a2[_0xac52('0x32')]=_[_0xac52('0x2b')](_0x5571a2[_0xac52('0x28')],_0x5571a2[_0xac52('0x29')]);_0x40c599[_0xac52('0x2c')]=_[_0xac52('0x2b')](_0x5571a2[_0xac52('0x28')],qs[_0xac52('0x2d')](_0x4a047b['query'][_0xac52('0x2d')]));_0x40c599['attributes']=_0x40c599[_0xac52('0x2c')][_0xac52('0x2e')]?_0x40c599[_0xac52('0x2c')]:_0x5571a2['model'];if(_0x4a047b[_0xac52('0x29')]['includeAll']){_0x40c599[_0xac52('0x3b')]=[{'all':!![]}];}_0x40c599=_[_0xac52('0x36')]({},_0x40c599,_0x4a047b['options']);return db[_0xac52('0x24')][_0xac52('0x3c')](_0x40c599)[_0xac52('0x21')](handleEntityNotFound(_0x154b39,null))[_0xac52('0x21')](respondWithResult(_0x154b39,null))[_0xac52('0x3d')](handleError(_0x154b39,null));};exports['update']=function(_0x526f75,_0x285742){if(_0x526f75[_0xac52('0x3e')]['id']){delete _0x526f75['body']['id'];}return db['CmCustomField'][_0xac52('0x3c')]({'where':{'id':_0x526f75[_0xac52('0x3a')]['id']}})['then'](handleEntityNotFound(_0x285742,null))[_0xac52('0x21')](saveUpdates(_0x526f75[_0xac52('0x3e')],null))[_0xac52('0x21')](respondWithResult(_0x285742,null))[_0xac52('0x3d')](handleError(_0x285742,null));};exports[_0xac52('0x20')]=function(_0x3fbc6f,_0x2f9ad8){return db[_0xac52('0x24')][_0xac52('0x3c')]({'where':{'id':_0x3fbc6f[_0xac52('0x3a')]['id']}})[_0xac52('0x21')](handleEntityNotFound(_0x2f9ad8,null))[_0xac52('0x21')](removeEntity(_0x2f9ad8,null))[_0xac52('0x3d')](handleError(_0x2f9ad8,null));};exports[_0xac52('0x3f')]=function(_0x431aa7,_0x411a6f){var _0x1c30be;return db['sequelize'][_0xac52('0x40')](function(_0x2cd2d3){return db['CmCustomField'][_0xac52('0x3f')](_0x431aa7['body'],{'transaction':_0x2cd2d3})[_0xac52('0x21')](function(_0x5572b9){_0x1c30be=_0x5572b9;var _0xb5187e={'type':db[_0xac52('0x41')][_0xac52('0x42')],'transaction':_0x2cd2d3};switch(_0x431aa7[_0xac52('0x3e')]['type']){case _0xac52('0x43'):_0xb5187e[_0xac52('0x27')]=db[_0xac52('0x41')][_0xac52('0x42')];break;case _0xac52('0x44'):_0xb5187e[_0xac52('0x27')]=db[_0xac52('0x41')]['INTEGER'];break;case _0xac52('0x45'):_0xb5187e[_0xac52('0x27')]=db['Sequelize']['BOOLEAN'];_0xb5187e[_0xac52('0x46')]=![];break;default:}return db[_0xac52('0x47')][_0xac52('0x48')]['addColumn']('cm_contacts',util[_0xac52('0x49')](_0xac52('0x4a'),_0x1c30be['id']),_0xb5187e);})[_0xac52('0x21')](function(){return _0x1c30be;});})[_0xac52('0x21')](respondWithResult(_0x411a6f,0xc9))[_0xac52('0x3d')](handleError(_0x411a6f,null));};
\ No newline at end of file
index d9bdb0c..da77588 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7d3=['./cmCustomField.attributes','exports','CmCustomField','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xe7d3,0x159));var _0x3e7d=function(_0x3334fc,_0xfd9e1d){_0x3334fc=_0x3334fc-0x0;var _0x3f1da3=_0xe7d3[_0x3334fc];return _0x3f1da3;};'use strict';var _=require(_0x3e7d('0x0'));var util=require('util');var logger=require(_0x3e7d('0x1'))(_0x3e7d('0x2'));var moment=require(_0x3e7d('0x3'));var BPromise=require('bluebird');var rp=require(_0x3e7d('0x4'));var fs=require('fs');var path=require(_0x3e7d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e7d('0x6'));module[_0x3e7d('0x7')]=function(_0x38f22b,_0x570758){return _0x38f22b['define'](_0x3e7d('0x8'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc1b9=['CmCustomField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x167cc4,_0xc04bd4){var _0x2b5e98=function(_0x371b0f){while(--_0x371b0f){_0x167cc4['push'](_0x167cc4['shift']());}};_0x2b5e98(++_0xc04bd4);}(_0xc1b9,0x140));var _0x9c1b=function(_0x2d2e85,_0x22faa9){_0x2d2e85=_0x2d2e85-0x0;var _0x3e9f5e=_0xc1b9[_0x2d2e85];return _0x3e9f5e;};'use strict';var _=require(_0x9c1b('0x0'));var util=require(_0x9c1b('0x1'));var logger=require(_0x9c1b('0x2'))(_0x9c1b('0x3'));var moment=require('moment');var BPromise=require(_0x9c1b('0x4'));var rp=require(_0x9c1b('0x5'));var fs=require('fs');var path=require(_0x9c1b('0x6'));var rimraf=require(_0x9c1b('0x7'));var config=require(_0x9c1b('0x8'));var attributes=require('./cmCustomField.attributes');module[_0x9c1b('0x9')]=function(_0x16ab92,_0x4da0fd){return _0x16ab92['define'](_0x9c1b('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d636da8..fa7d5e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d42=['result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x37f01e,_0x3a4638){var _0xc44e43=function(_0x2394f1){while(--_0x2394f1){_0x37f01e['push'](_0x37f01e['shift']());}};_0xc44e43(++_0x3a4638);}(_0x1d42,0x11f));var _0x21d4=function(_0x3b57d2,_0x440aa9){_0x3b57d2=_0x3b57d2-0x0;var _0x5a133f=_0x1d42[_0x3b57d2];return _0x5a133f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x21d4('0x0'));var BPromise=require(_0x21d4('0x1'));var rs=require(_0x21d4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x21d4('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x21d4('0x4'));var jayson=require(_0x21d4('0x5'));var client=jayson[_0x21d4('0x6')][_0x21d4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x29b27c,_0x29d5b8,_0x44c53e){return new BPromise(function(_0x3f7c88,_0x992319){return client[_0x21d4('0x8')](_0x29b27c,_0x44c53e)['then'](function(_0x5e6aa1){logger[_0x21d4('0x9')](_0x21d4('0xa'),_0x29d5b8,'request\x20sent');logger['debug'](_0x21d4('0xb'),_0x29d5b8,_0x21d4('0xc'),JSON[_0x21d4('0xd')](_0x5e6aa1));if(_0x5e6aa1[_0x21d4('0xe')]){if(_0x5e6aa1[_0x21d4('0xe')][_0x21d4('0xf')]===0x1f4){logger[_0x21d4('0xe')]('CmCustomField,\x20%s,\x20%s',_0x29d5b8,_0x5e6aa1[_0x21d4('0xe')][_0x21d4('0x10')]);return _0x992319(_0x5e6aa1[_0x21d4('0xe')][_0x21d4('0x10')]);}logger[_0x21d4('0xe')](_0x21d4('0xa'),_0x29d5b8,_0x5e6aa1['error'][_0x21d4('0x10')]);return _0x3f7c88(_0x5e6aa1[_0x21d4('0xe')][_0x21d4('0x10')]);}else{logger[_0x21d4('0x9')](_0x21d4('0xa'),_0x29d5b8,_0x21d4('0xc'));_0x3f7c88(_0x5e6aa1[_0x21d4('0x11')][_0x21d4('0x10')]);}})[_0x21d4('0x12')](function(_0x227b1a){logger[_0x21d4('0xe')](_0x21d4('0xa'),_0x29d5b8,_0x227b1a);_0x992319(_0x227b1a);});});}
\ No newline at end of file
+var _0x3a0c=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s'];(function(_0x5deea5,_0x230d81){var _0x3d1998=function(_0x39341d){while(--_0x39341d){_0x5deea5['push'](_0x5deea5['shift']());}};_0x3d1998(++_0x230d81);}(_0x3a0c,0x14c));var _0xc3a0=function(_0x450351,_0x37a30d){_0x450351=_0x450351-0x0;var _0x39d8f1=_0x3a0c[_0x450351];return _0x39d8f1;};'use strict';var _=require(_0xc3a0('0x0'));var util=require(_0xc3a0('0x1'));var moment=require(_0xc3a0('0x2'));var BPromise=require(_0xc3a0('0x3'));var rs=require(_0xc3a0('0x4'));var fs=require('fs');var Redis=require(_0xc3a0('0x5'));var db=require(_0xc3a0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3a0('0x7'))(_0xc3a0('0x8'));var config=require(_0xc3a0('0x9'));var jayson=require(_0xc3a0('0xa'));var client=jayson[_0xc3a0('0xb')][_0xc3a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x575326,_0x495a7e,_0x57c6d1){return new BPromise(function(_0x1509bf,_0x648108){return client['request'](_0x575326,_0x57c6d1)['then'](function(_0x180581){logger[_0xc3a0('0xd')]('CmCustomField,\x20%s,\x20%s',_0x495a7e,_0xc3a0('0xe'));logger[_0xc3a0('0xf')](_0xc3a0('0x10'),_0x495a7e,'request\x20sent',JSON[_0xc3a0('0x11')](_0x180581));if(_0x180581['error']){if(_0x180581[_0xc3a0('0x12')]['code']===0x1f4){logger[_0xc3a0('0x12')](_0xc3a0('0x13'),_0x495a7e,_0x180581[_0xc3a0('0x12')][_0xc3a0('0x14')]);return _0x648108(_0x180581['error'][_0xc3a0('0x14')]);}logger[_0xc3a0('0x12')](_0xc3a0('0x13'),_0x495a7e,_0x180581[_0xc3a0('0x12')][_0xc3a0('0x14')]);return _0x1509bf(_0x180581[_0xc3a0('0x12')][_0xc3a0('0x14')]);}else{logger[_0xc3a0('0xd')](_0xc3a0('0x13'),_0x495a7e,_0xc3a0('0xe'));_0x1509bf(_0x180581['result'][_0xc3a0('0x14')]);}})[_0xc3a0('0x15')](function(_0x2fedc5){logger['error'](_0xc3a0('0x13'),_0x495a7e,_0x2fedc5);_0x648108(_0x2fedc5);});});}
\ No newline at end of file
index 89b3b2c..e949724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x812d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','/:id','post','put','delete','destroy','util','path'];(function(_0x3f8374,_0x19c3f4){var _0x4aabfe=function(_0x2dccae){while(--_0x2dccae){_0x3f8374['push'](_0x3f8374['shift']());}};_0x4aabfe(++_0x19c3f4);}(_0x812d,0x6e));var _0xd812=function(_0x2121ff,_0x2bd483){_0x2121ff=_0x2121ff-0x0;var _0x2a8a3f=_0x812d[_0x2121ff];return _0x2a8a3f;};'use strict';var multer=require('multer');var util=require(_0xd812('0x0'));var path=require(_0xd812('0x1'));var timeout=require(_0xd812('0x2'));var express=require(_0xd812('0x3'));var router=express[_0xd812('0x4')]();var fs_extra=require(_0xd812('0x5'));var auth=require(_0xd812('0x6'));var interaction=require(_0xd812('0x7'));var config=require('../../config/environment');var controller=require(_0xd812('0x8'));router[_0xd812('0x9')]('/',auth[_0xd812('0xa')](),controller['index']);router['get'](_0xd812('0xb'),auth[_0xd812('0xa')](),controller['show']);router[_0xd812('0xc')]('/',auth[_0xd812('0xa')](),controller['create']);router[_0xd812('0xd')](_0xd812('0xb'),auth[_0xd812('0xa')](),controller['update']);router[_0xd812('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xd812('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xc57c=['express','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer'];(function(_0x43918d,_0x255ee2){var _0xdf6288=function(_0x4bf671){while(--_0x4bf671){_0x43918d['push'](_0x43918d['shift']());}};_0xdf6288(++_0x255ee2);}(_0xc57c,0x149));var _0xcc57=function(_0x47d848,_0x24595f){_0x47d848=_0x47d848-0x0;var _0x551833=_0xc57c[_0x47d848];return _0x551833;};'use strict';var multer=require(_0xcc57('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc57('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcc57('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xcc57('0x3'));var controller=require(_0xcc57('0x4'));router[_0xcc57('0x5')]('/',auth[_0xcc57('0x6')](),controller[_0xcc57('0x7')]);router[_0xcc57('0x5')](_0xcc57('0x8'),auth['isAuthenticated'](),controller[_0xcc57('0x9')]);router[_0xcc57('0xa')]('/',auth[_0xcc57('0x6')](),controller[_0xcc57('0xb')]);router[_0xcc57('0xc')](_0xcc57('0x8'),auth[_0xcc57('0x6')](),controller['update']);router['delete']('/:id',auth[_0xcc57('0x6')](),controller[_0xcc57('0xd')]);module[_0xcc57('0xe')]=router;
\ No newline at end of file
index e243ade..a304613 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781d=['moment','sequelize','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue'];(function(_0x3cceb4,_0xdbdbb5){var _0x1ad401=function(_0x7ca684){while(--_0x7ca684){_0x3cceb4['push'](_0x3cceb4['shift']());}};_0x1ad401(++_0xdbdbb5);}(_0x781d,0x14a));var _0xd781=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x781d[_0x1035c1];return _0x308d67;};'use strict';var moment=require(_0xd781('0x0'));var Sequelize=require(_0xd781('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xd781('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xd781('0x3')],'defaultValue':moment()[_0xd781('0x4')](_0xd781('0x5'))},'countbusyretry':{'type':Sequelize[_0xd781('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd781('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd781('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xd781('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd781('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd781('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xd781('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xd781('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xd781('0x6')],'unique':_0xd781('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xd781('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xd781('0x6')],'unique':_0xd781('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xd781('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd781('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd781('0x6')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd781('0x7')]},'recallmeNotifiedDate':{'type':Sequelize[_0xd781('0x3')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0xd943=['sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','contactListQueue','moment'];(function(_0x2c73f6,_0x40601d){var _0x2db19e=function(_0x1b545c){while(--_0x1b545c){_0x2c73f6['push'](_0x2c73f6['shift']());}};_0x2db19e(++_0x40601d);}(_0xd943,0x15d));var _0x3d94=function(_0x15d500,_0x3c886c){_0x15d500=_0x15d500-0x0;var _0x4f58a1=_0xd943[_0x15d500];return _0x4f58a1;};'use strict';var moment=require(_0x3d94('0x0'));var Sequelize=require(_0x3d94('0x1'));module[_0x3d94('0x2')]={'phone':{'type':Sequelize[_0x3d94('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3d94('0x4')],'defaultValue':moment()[_0x3d94('0x5')](_0x3d94('0x6'))},'countbusyretry':{'type':Sequelize[_0x3d94('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3d94('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3d94('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3d94('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3d94('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x3d94('0x9')},'UserId':{'type':Sequelize[_0x3d94('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x3d94('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x3d94('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3d94('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3d94('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3d94('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3d94('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x3d94('0x4')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index ad95c4e..214a0c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf1b=['includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','describe','destroy','CampaignId','VoiceQueue','VoiceQueueId','omit','updatedAt','state','statedesc','deleted','campaign','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','hopperId','findOne','recallme','UPDATE','getOpenContacts','isNumber','error','getTimezones','timezones','push','utcOffset','getTimezone','eml-format','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','name','send','index','map','fieldName','type','key','model','keys','query','filters','$and','$or','$gt','$gte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$iLike','$contains','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','CmHopper'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0xaf1b,0x182));var _0xbaf1=function(_0x2293c6,_0x4c9438){_0x2293c6=_0x2293c6-0x0;var _0xaca35a=_0xaf1b[_0x2293c6];return _0xaca35a;};'use strict';var emlformat=require(_0xbaf1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbaf1('0x1'));var jsonpatch=require(_0xbaf1('0x2'));var rp=require(_0xbaf1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbaf1('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xbaf1('0x5'));var ejs=require(_0xbaf1('0x6'));var fs=require('fs');var fs_extra=require(_0xbaf1('0x7'));var _=require('lodash');var squel=require(_0xbaf1('0x8'));var crypto=require(_0xbaf1('0x9'));var jsforce=require(_0xbaf1('0xa'));var deskjs=require(_0xbaf1('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbaf1('0xc'));var Papa=require('papaparse');var Redis=require(_0xbaf1('0xd'));var authService=require(_0xbaf1('0xe'));var qs=require(_0xbaf1('0xf'));var as=require(_0xbaf1('0x10'));var hardwareService=require(_0xbaf1('0x11'));var logger=require(_0xbaf1('0x12'))('api');var utils=require(_0xbaf1('0x13'));var config=require(_0xbaf1('0x14'));var shared=require(_0xbaf1('0x14'));var licenseUtil=require(_0xbaf1('0x15'));var db=require(_0xbaf1('0x16'))['db'];function respondWithStatusCode(_0x11ce5d,_0x4375fa){_0x4375fa=_0x4375fa||0xcc;return function(_0x3b7acd){if(_0x3b7acd){return _0x11ce5d[_0xbaf1('0x17')](_0x4375fa);}return _0x11ce5d[_0xbaf1('0x18')](_0x4375fa)['end']();};}function respondWithResult(_0x106bfe,_0x42fd2a){_0x42fd2a=_0x42fd2a||0xc8;return function(_0x30a00b){if(_0x30a00b){return _0x106bfe[_0xbaf1('0x18')](_0x42fd2a)[_0xbaf1('0x19')](_0x30a00b);}};}function respondWithFilteredResult(_0x56ee33,_0x292f7b){return function(_0x33bf65){if(_0x33bf65){var _0x410997=typeof _0x292f7b[_0xbaf1('0x1a')]===_0xbaf1('0x1b')&&typeof _0x292f7b[_0xbaf1('0x1c')]===_0xbaf1('0x1b');var _0x42fce8=_0x33bf65[_0xbaf1('0x1d')];var _0x147854=_0x410997?0x0:_0x292f7b[_0xbaf1('0x1a')];var _0x44e3af=_0x410997?_0x33bf65[_0xbaf1('0x1d')]:_0x292f7b[_0xbaf1('0x1a')]+_0x292f7b[_0xbaf1('0x1c')];var _0x708ba9;if(_0x44e3af>=_0x42fce8){_0x44e3af=_0x42fce8;_0x708ba9=0xc8;}else{_0x708ba9=0xce;}_0x56ee33[_0xbaf1('0x18')](_0x708ba9);return _0x56ee33[_0xbaf1('0x1e')]('Content-Range',_0x147854+'-'+_0x44e3af+'/'+_0x42fce8)['json'](_0x33bf65);}return null;};}function patchUpdates(_0x2be3fc){return function(_0x1e306e){try{jsonpatch[_0xbaf1('0x1f')](_0x1e306e,_0x2be3fc,!![]);}catch(_0x262c90){return BPromise[_0xbaf1('0x20')](_0x262c90);}return _0x1e306e[_0xbaf1('0x21')]();};}function saveUpdates(_0x5aefb0,_0x215038){return function(_0x227c05){if(_0x227c05){return _0x227c05[_0xbaf1('0x22')](_0x5aefb0)['then'](function(_0x157f78){return _0x157f78;});}return null;};}function removeEntity(_0xc79a99,_0x336a3e){return function(_0x39ff33){if(_0x39ff33){return _0x39ff33['destroy']()[_0xbaf1('0x23')](function(){_0xc79a99['status'](0xcc)[_0xbaf1('0x24')]();});}};}function handleEntityNotFound(_0x133e34,_0x32042a){return function(_0x4ddd5c){if(!_0x4ddd5c){_0x133e34['sendStatus'](0x194);}return _0x4ddd5c;};}function handleError(_0x1b406d,_0x3ef84c){_0x3ef84c=_0x3ef84c||0x1f4;return function(_0x472cab){logger['error'](_0x472cab['stack']);if(_0x472cab[_0xbaf1('0x25')]){delete _0x472cab[_0xbaf1('0x25')];}_0x1b406d[_0xbaf1('0x18')](_0x3ef84c)[_0xbaf1('0x26')](_0x472cab);};}exports[_0xbaf1('0x27')]=function(_0x4be717,_0x5b9d60){var _0x1f0ff8={},_0x59271f={},_0x163efd={'count':0x0,'rows':[]};var _0x29e7c5=_[_0xbaf1('0x28')](db['CmHopper']['rawAttributes'],function(_0x36691f){return{'name':_0x36691f[_0xbaf1('0x29')],'type':_0x36691f[_0xbaf1('0x2a')][_0xbaf1('0x2b')]};});_0x59271f[_0xbaf1('0x2c')]=_[_0xbaf1('0x28')](_0x29e7c5,_0xbaf1('0x25'));_0x59271f['query']=_[_0xbaf1('0x2d')](_0x4be717[_0xbaf1('0x2e')]);_0x59271f['filters']=_['intersection'](_0x59271f['model'],_0x59271f['query']);_0x59271f[_0xbaf1('0x2f')]=_['concat'](_0x59271f[_0xbaf1('0x2f')],[_0xbaf1('0x30'),_0xbaf1('0x31'),_0xbaf1('0x32'),_0xbaf1('0x33'),'$lt','$lte',_0xbaf1('0x34'),_0xbaf1('0x35'),_0xbaf1('0x36'),_0xbaf1('0x37'),_0xbaf1('0x38'),'$in',_0xbaf1('0x39'),_0xbaf1('0x3a'),'$notLike',_0xbaf1('0x3b'),'$notILike',_0xbaf1('0x3a'),'$overlap',_0xbaf1('0x3c'),'$contained','$any']);_0x1f0ff8['attributes']=_[_0xbaf1('0x3d')](_0x59271f[_0xbaf1('0x2c')],qs[_0xbaf1('0x3e')](_0x4be717[_0xbaf1('0x2e')][_0xbaf1('0x3e')]));_0x1f0ff8[_0xbaf1('0x3f')]=_0x1f0ff8['attributes'][_0xbaf1('0x40')]?_0x1f0ff8['attributes']:_0x59271f[_0xbaf1('0x2c')];if(!_0x4be717['query'][_0xbaf1('0x41')](_0xbaf1('0x42'))){_0x1f0ff8[_0xbaf1('0x1c')]=qs[_0xbaf1('0x1c')](_0x4be717[_0xbaf1('0x2e')][_0xbaf1('0x1c')]);_0x1f0ff8[_0xbaf1('0x1a')]=qs[_0xbaf1('0x1a')](_0x4be717[_0xbaf1('0x2e')][_0xbaf1('0x1a')]);}_0x1f0ff8[_0xbaf1('0x43')]=qs[_0xbaf1('0x44')](_0x4be717[_0xbaf1('0x2e')][_0xbaf1('0x44')]);_0x1f0ff8['where']=qs[_0xbaf1('0x2f')](_[_0xbaf1('0x45')](_0x4be717[_0xbaf1('0x2e')],_0x59271f[_0xbaf1('0x2f')]),_0x29e7c5);if(_0x4be717['query'][_0xbaf1('0x46')]){_0x1f0ff8[_0xbaf1('0x47')]=_[_0xbaf1('0x48')](_0x1f0ff8[_0xbaf1('0x47')],{'$or':_['map'](_0x29e7c5,function(_0x533ab4){if(_0x533ab4[_0xbaf1('0x2a')]!==_0xbaf1('0x49')){var _0x137ab6={};_0x137ab6[_0x533ab4[_0xbaf1('0x25')]]={'$like':'%'+_0x4be717['query']['filter']+'%'};return _0x137ab6;}})});}_0x1f0ff8=_[_0xbaf1('0x48')]({},_0x1f0ff8,_0x4be717[_0xbaf1('0x4a')]);var _0x467280={'where':_0x1f0ff8['where']};return db[_0xbaf1('0x4b')]['count'](_0x467280)['then'](function(_0x3a668f){_0x163efd[_0xbaf1('0x1d')]=_0x3a668f;if(_0x4be717[_0xbaf1('0x2e')][_0xbaf1('0x4c')]){_0x1f0ff8['include']=[{'all':!![]}];}return db[_0xbaf1('0x4b')][_0xbaf1('0x4d')](_0x1f0ff8);})[_0xbaf1('0x23')](function(_0x506ffc){_0x163efd['rows']=_0x506ffc;return _0x163efd;})[_0xbaf1('0x23')](respondWithFilteredResult(_0x5b9d60,_0x1f0ff8))[_0xbaf1('0x4e')](handleError(_0x5b9d60,null));};exports[_0xbaf1('0x4f')]=function(_0xd99d1e,_0xe55ef1){var _0x2526f3={'raw':!![],'where':{'id':_0xd99d1e[_0xbaf1('0x50')]['id']}},_0x420b8e={};_0x420b8e[_0xbaf1('0x2c')]=_[_0xbaf1('0x2d')](db[_0xbaf1('0x4b')][_0xbaf1('0x51')]);_0x420b8e['query']=_[_0xbaf1('0x2d')](_0xd99d1e[_0xbaf1('0x2e')]);_0x420b8e['filters']=_[_0xbaf1('0x3d')](_0x420b8e[_0xbaf1('0x2c')],_0x420b8e[_0xbaf1('0x2e')]);_0x2526f3[_0xbaf1('0x3f')]=_['intersection'](_0x420b8e[_0xbaf1('0x2c')],qs[_0xbaf1('0x3e')](_0xd99d1e[_0xbaf1('0x2e')][_0xbaf1('0x3e')]));_0x2526f3[_0xbaf1('0x3f')]=_0x2526f3['attributes']['length']?_0x2526f3[_0xbaf1('0x3f')]:_0x420b8e['model'];if(_0xd99d1e['query']['includeAll']){_0x2526f3[_0xbaf1('0x52')]=[{'all':!![]}];}_0x2526f3=_[_0xbaf1('0x48')]({},_0x2526f3,_0xd99d1e['options']);return db[_0xbaf1('0x4b')][_0xbaf1('0x53')](_0x2526f3)[_0xbaf1('0x23')](handleEntityNotFound(_0xe55ef1,null))['then'](respondWithResult(_0xe55ef1,null))[_0xbaf1('0x4e')](handleError(_0xe55ef1,null));};exports['create']=function(_0x2dcb8f,_0x305bdd){return db[_0xbaf1('0x4b')][_0xbaf1('0x54')](_0x2dcb8f['body'],{})['then'](respondWithResult(_0x305bdd,0xc9))[_0xbaf1('0x4e')](handleError(_0x305bdd,null));};exports[_0xbaf1('0x22')]=function(_0x3e3c0a,_0x37eafd){if(_0x3e3c0a[_0xbaf1('0x55')]['id']){delete _0x3e3c0a[_0xbaf1('0x55')]['id'];}return db[_0xbaf1('0x4b')]['find']({'where':{'id':_0x3e3c0a[_0xbaf1('0x50')]['id']}})['then'](handleEntityNotFound(_0x37eafd,null))['then'](saveUpdates(_0x3e3c0a[_0xbaf1('0x55')],null))[_0xbaf1('0x23')](respondWithResult(_0x37eafd,null))[_0xbaf1('0x4e')](handleError(_0x37eafd,null));};exports[_0xbaf1('0x56')]=function(_0x1cae0f,_0x6b483c){return db[_0xbaf1('0x4b')][_0xbaf1('0x56')]()['then'](respondWithResult(_0x6b483c,null))[_0xbaf1('0x4e')](handleError(_0x6b483c,null));};exports[_0xbaf1('0x57')]=function(_0x5be8b7,_0x31755b){var _0x584855;return db[_0xbaf1('0x4b')][_0xbaf1('0x53')]({'where':{'id':_0x5be8b7['params']['id']}})[_0xbaf1('0x23')](handleEntityNotFound(_0x31755b,null))[_0xbaf1('0x23')](function(_0x569147){if(_0x569147){return _0x569147[_0xbaf1('0x57')]()[_0xbaf1('0x23')](function(_0x2d449c){return _0x2d449c;});}})['then'](function(_0xf0048b){_0x584855=_0xf0048b;if(_0xf0048b){if(_0xf0048b['VoiceQueueId']||_0xf0048b[_0xbaf1('0x58')]){return db[_0xf0048b['VoiceQueueId']?_0xbaf1('0x59'):'Campaign'][_0xbaf1('0x53')]({'where':{'id':_0xf0048b[_0xbaf1('0x5a')]?_0xf0048b[_0xbaf1('0x5a')]:_0xf0048b['CampaignId']},'attributes':['id',_0xbaf1('0x25')],'raw':!![]});}}})[_0xbaf1('0x23')](function(_0x411ecf){var _0x4cbf45={};if(_0x411ecf){_[_0xbaf1('0x48')](_0x4cbf45,_[_0xbaf1('0x5b')](_0x584855['dataValues'],['createdAt',_0xbaf1('0x5c'),'id']));_0x4cbf45[_0xbaf1('0x5d')]=0x15;_0x4cbf45[_0xbaf1('0x5e')]=_0xbaf1('0x5f');_0x4cbf45[_0xbaf1('0x60')]=_0x411ecf['name'];_0x4cbf45['membername']=_0x5be8b7['user'][_0xbaf1('0x25')];_0x4cbf45[_0xbaf1('0x61')]=_0x5be8b7[_0xbaf1('0x62')]['id'];_0x4cbf45[_0xbaf1('0x5f')]=!![];_0x4cbf45[_0xbaf1('0x63')]=moment()[_0xbaf1('0x64')](_0xbaf1('0x65'));_0x4cbf45[_0xbaf1('0x66')]=_0x584855[_0xbaf1('0x67')];_0x4cbf45['campaigntype']=_0x584855[_0xbaf1('0x5a')]?'queue':_0xbaf1('0x68');return db[_0xbaf1('0x69')][_0xbaf1('0x53')]({'where':{'id':_0x4cbf45[_0xbaf1('0x6a')]},'attributes':[_0xbaf1('0x6b'),_0xbaf1('0x6c')]})[_0xbaf1('0x23')](function(_0x77ac93){if(!_['isNil'](_0x31755b)&&!_[_0xbaf1('0x6d')](_0x77ac93[_0xbaf1('0x6b')])){_0x4cbf45[_0xbaf1('0x6e')]=_0x77ac93[_0xbaf1('0x6b')];if(!_['isNil'](_0x77ac93['lastName'])){_0x4cbf45[_0xbaf1('0x6e')]+='\x20'+_0x77ac93[_0xbaf1('0x6c')];}}})[_0xbaf1('0x6f')](function(){return db['CmHopperFinal'][_0xbaf1('0x54')](_0x4cbf45);});}})[_0xbaf1('0x23')](function(){return _0x31755b[_0xbaf1('0x18')](0xcc)[_0xbaf1('0x24')]();})[_0xbaf1('0x4e')](handleError(_0x31755b,null));};exports[_0xbaf1('0x70')]=function(_0x481e6d,_0x3c7180,_0x48b94f){var _0x5f1cc9=[];return db['CmContact'][_0xbaf1('0x56')]()[_0xbaf1('0x23')](function(_0x1c6899){_0x5f1cc9=_[_0xbaf1('0x2d')](_0x1c6899);return _0x481e6d[_0xbaf1('0x62')][_0xbaf1('0x71')]({'where':{'type':_0xbaf1('0x72'),'dialActive':!![],'dialMethod':_0xbaf1('0x73')},'attributes':['id',_0xbaf1('0x74'),_0xbaf1('0x75')],'raw':!![]});})[_0xbaf1('0x23')](function(_0x565202){if(_0x565202&&_0x565202['length']){return db[_0xbaf1('0x76')][_0xbaf1('0x77')](function(_0x4ecb9b){var _0x59c959={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbaf1('0x64')](_0xbaf1('0x65'))},'VoiceQueueId':{'$in':_[_0xbaf1('0x28')](_0x565202,'id')},'$or':[{'UserId':null},{'UserId':_0x481e6d[_0xbaf1('0x62')]['id']}]};var _0x4c3614={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x565202)[_0xbaf1('0x46')]([_0xbaf1('0x75'),0x0])[_0xbaf1('0x28')]('id')[_0xbaf1('0x78')]()},'$or':[{'UserId':null},{'UserId':_0x481e6d[_0xbaf1('0x62')]['id']}]};var _0x2976a5={'$or':[_0x59c959,_0x4c3614]};var _0x141391=[];if(_0x481e6d['body']['direction']&&_0x481e6d['body'][_0xbaf1('0x79')]===_0xbaf1('0x7a')){if(!_[_0xbaf1('0x7b')](_0x481e6d[_0xbaf1('0x55')][_0xbaf1('0x7c')])){_0x2976a5['id']={'$in':_0x481e6d['body']['hopperIds']};}_0x141391=[[_0xbaf1('0x7d'),_0xbaf1('0x7e')],[_0xbaf1('0x7f'),_0x565202[0x0][_0xbaf1('0x74')]===_0xbaf1('0x7e')?_0xbaf1('0x80'):_0xbaf1('0x7e')],db[_0xbaf1('0x76')][_0xbaf1('0x81')](_0xbaf1('0x82')),['id','DESC']];}else{if(!_[_0xbaf1('0x7b')](_0x481e6d[_0xbaf1('0x55')][_0xbaf1('0x7c')])){_0x2976a5['id']={'$notIn':_0x481e6d[_0xbaf1('0x55')]['hopperIds']};}_0x141391=[[_0xbaf1('0x7d'),'DESC'],[_0xbaf1('0x7f'),_0x565202[0x0][_0xbaf1('0x74')]],db['sequelize'][_0xbaf1('0x81')](_0xbaf1('0x83')),['id','ASC']];}return db[_0xbaf1('0x4b')]['findOne']({'attributes':['id',_0xbaf1('0x84'),'recallme'],'where':_0x2976a5,'order':_0x141391,'transaction':_0x4ecb9b,'lock':_0x4ecb9b[_0xbaf1('0x85')]['UPDATE'],'include':[{'model':db[_0xbaf1('0x69')],'as':_0xbaf1('0x86'),'attributes':_0x5f1cc9,'include':[{'model':db[_0xbaf1('0x87')],'as':_0xbaf1('0x88'),'attributes':['id',_0xbaf1('0x25')]}]},{'model':db[_0xbaf1('0x89')],'as':_0xbaf1('0x8a'),'attributes':['id',_0xbaf1('0x25')]},{'model':db[_0xbaf1('0x59')],'as':_0xbaf1('0x8b'),'attributes':['id','name',_0xbaf1('0x8c')]}]})['then'](function(_0x1ebd16){if(_0x1ebd16){return _0x1ebd16[_0xbaf1('0x22')]({'UserId':_0x481e6d[_0xbaf1('0x62')]['id']},{'transaction':_0x4ecb9b});}});});}})[_0xbaf1('0x23')](handleEntityNotFound(_0x3c7180,null))[_0xbaf1('0x23')](respondWithResult(_0x3c7180,null))[_0xbaf1('0x4e')](handleError(_0x3c7180,null));};exports[_0xbaf1('0x8d')]=function(_0x293394,_0x4887ae,_0x4777d4){var _0x3dc5ed=[];return db[_0xbaf1('0x69')][_0xbaf1('0x56')]()[_0xbaf1('0x23')](function(_0x2a6036){_0x3dc5ed=_[_0xbaf1('0x2d')](_0x2a6036);return _0x293394['user'][_0xbaf1('0x71')]({'where':{'type':_0xbaf1('0x72'),'dialActive':!![],'dialMethod':_0xbaf1('0x73')},'attributes':['id','dialOrderByScheduledAt',_0xbaf1('0x75')],'raw':!![]});})['then'](function(_0x4c0132){if(_0x4c0132&&_0x4c0132[_0xbaf1('0x40')]){return db['sequelize'][_0xbaf1('0x77')](function(_0x275eb4){var _0x10fc2b={'active':![],'recallme':!![],'id':_0x293394[_0xbaf1('0x55')][_0xbaf1('0x8e')]};return db[_0xbaf1('0x4b')][_0xbaf1('0x8f')]({'attributes':['id',_0xbaf1('0x84'),_0xbaf1('0x90')],'where':_0x10fc2b,'transaction':_0x275eb4,'lock':_0x275eb4['LOCK'][_0xbaf1('0x91')],'include':[{'model':db[_0xbaf1('0x69')],'as':_0xbaf1('0x86'),'attributes':_0x3dc5ed,'include':[{'model':db[_0xbaf1('0x87')],'as':_0xbaf1('0x88'),'attributes':['id',_0xbaf1('0x25')]}]},{'model':db[_0xbaf1('0x89')],'as':_0xbaf1('0x8a'),'attributes':['id',_0xbaf1('0x25')]},{'model':db[_0xbaf1('0x59')],'as':'Queue','attributes':['id',_0xbaf1('0x25'),_0xbaf1('0x8c')]}]})[_0xbaf1('0x23')](function(_0x12948c){if(_0x12948c){return _0x12948c[_0xbaf1('0x22')]({'UserId':_0x293394[_0xbaf1('0x62')]['id']},{'transaction':_0x275eb4});}});});}})['then'](handleEntityNotFound(_0x4887ae,null))[_0xbaf1('0x23')](respondWithResult(_0x4887ae,null))[_0xbaf1('0x4e')](handleError(_0x4887ae,null));};exports[_0xbaf1('0x92')]=function(_0xe56fd8,_0x374122,_0x5ad1e3){return _0xe56fd8[_0xbaf1('0x62')][_0xbaf1('0x71')]({'where':{'type':_0xbaf1('0x72'),'dialActive':!![],'dialMethod':_0xbaf1('0x73')},'attributes':['id'],'raw':!![]})['then'](function(_0x452719){if(_0x452719&&_0x452719[_0xbaf1('0x40')]){return db[_0xbaf1('0x4b')][_0xbaf1('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbaf1('0x64')](_0xbaf1('0x65'))},'VoiceQueueId':{'$in':_[_0xbaf1('0x28')](_0x452719,'id')},'$or':[{'UserId':null},{'UserId':_0xe56fd8['user']['id']}]}});}return 0x0;})[_0xbaf1('0x23')](function(_0x1d8794){if(!_[_0xbaf1('0x6d')](_0x1d8794)&&_[_0xbaf1('0x93')](_0x1d8794)){return _0x374122[_0xbaf1('0x18')](0xc8)[_0xbaf1('0x19')]({'contacts':_0x1d8794});}else{logger[_0xbaf1('0x94')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xbaf1('0x92'),0x194,'entity\x20not\x20found');_0x374122[_0xbaf1('0x17')](0x194);}})[_0xbaf1('0x4e')](handleError(_0x374122,null));};exports[_0xbaf1('0x95')]=function(_0x573eec,_0x5aa6f5,_0x195c09){var _0x49cbf5=shared[_0xbaf1('0x96')];var _0x50bdb6=[];_[_0xbaf1('0x28')](_0x49cbf5,function(_0x209e9c){_0x50bdb6[_0xbaf1('0x97')]({'id':_0x209e9c['name'],'name':_0x209e9c[_0xbaf1('0x25')],'utcOffset':_0x209e9c[_0xbaf1('0x98')]});});return _0x5aa6f5['status'](0xc8)[_0xbaf1('0x19')]({'tz':_0x50bdb6});};exports[_0xbaf1('0x99')]=function(_0x2c2cb7,_0x5dc30d,_0x10c6ad){var _0x589989=shared[_0xbaf1('0x96')];var _0x467fa8={};if(!_['isNil'](_0x589989[_0x2c2cb7[_0xbaf1('0x55')]['id']]))_0x467fa8=_0x589989[_0x2c2cb7['body']['id']];return _0x5dc30d[_0xbaf1('0x18')](0xc8)[_0xbaf1('0x19')](_0x467fa8);};
\ No newline at end of file
+var _0xd398=['CmCompany','Company','CmList','List','dialActive','getPreviewRecall','transaction','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','status','reject','save','update','then','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','$or','$gte','$lt','$lte','$eq','$not','$notBetween','$in','$notIn','$notLike','$notILike','$like','$contains','$contained','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','name','filter','options','CmHopper','includeAll','include','findAll','show','params','catch','create','body','find','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','createdAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','campaigntype','queue','CmContact','firstName','isNil','lastName','calleridname','finally','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','format','value','direction','prev','hopperIds','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','isEmpty','findOne','scheduledat','recallme','LOCK','UPDATE','Contact'];(function(_0x3fa4bd,_0x14a72d){var _0x358c95=function(_0x55c7fc){while(--_0x55c7fc){_0x3fa4bd['push'](_0x3fa4bd['shift']());}};_0x358c95(++_0x14a72d);}(_0xd398,0x1dd));var _0x8d39=function(_0x4b6053,_0x302ff9){_0x4b6053=_0x4b6053-0x0;var _0x211dbd=_0xd398[_0x4b6053];return _0x211dbd;};'use strict';var emlformat=require(_0x8d39('0x0'));var rimraf=require(_0x8d39('0x1'));var zipdir=require(_0x8d39('0x2'));var jsonpatch=require(_0x8d39('0x3'));var rp=require(_0x8d39('0x4'));var moment=require('moment');var BPromise=require(_0x8d39('0x5'));var Mustache=require(_0x8d39('0x6'));var util=require(_0x8d39('0x7'));var path=require(_0x8d39('0x8'));var sox=require(_0x8d39('0x9'));var csv=require(_0x8d39('0xa'));var ejs=require(_0x8d39('0xb'));var fs=require('fs');var fs_extra=require(_0x8d39('0xc'));var _=require(_0x8d39('0xd'));var squel=require(_0x8d39('0xe'));var crypto=require(_0x8d39('0xf'));var jsforce=require(_0x8d39('0x10'));var deskjs=require(_0x8d39('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8d39('0x12'));var Papa=require(_0x8d39('0x13'));var Redis=require(_0x8d39('0x14'));var authService=require(_0x8d39('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x8d39('0x16'));var hardwareService=require(_0x8d39('0x17'));var logger=require(_0x8d39('0x18'))('api');var utils=require(_0x8d39('0x19'));var config=require(_0x8d39('0x1a'));var shared=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8d39('0x1b'))['db'];function respondWithStatusCode(_0x40caa6,_0x343353){_0x343353=_0x343353||0xcc;return function(_0x17f196){if(_0x17f196){return _0x40caa6['sendStatus'](_0x343353);}return _0x40caa6['status'](_0x343353)[_0x8d39('0x1c')]();};}function respondWithResult(_0x43da62,_0x3e01fc){_0x3e01fc=_0x3e01fc||0xc8;return function(_0x276ab8){if(_0x276ab8){return _0x43da62['status'](_0x3e01fc)[_0x8d39('0x1d')](_0x276ab8);}};}function respondWithFilteredResult(_0x14b0d6,_0x56d6ca){return function(_0x4fbbf3){if(_0x4fbbf3){var _0x370b40=typeof _0x56d6ca[_0x8d39('0x1e')]===_0x8d39('0x1f')&&typeof _0x56d6ca[_0x8d39('0x20')]===_0x8d39('0x1f');var _0x53014d=_0x4fbbf3[_0x8d39('0x21')];var _0x295ae5=_0x370b40?0x0:_0x56d6ca[_0x8d39('0x1e')];var _0x531e41=_0x370b40?_0x4fbbf3[_0x8d39('0x21')]:_0x56d6ca['offset']+_0x56d6ca[_0x8d39('0x20')];var _0x36061e;if(_0x531e41>=_0x53014d){_0x531e41=_0x53014d;_0x36061e=0xc8;}else{_0x36061e=0xce;}_0x14b0d6[_0x8d39('0x22')](_0x36061e);return _0x14b0d6['set']('Content-Range',_0x295ae5+'-'+_0x531e41+'/'+_0x53014d)[_0x8d39('0x1d')](_0x4fbbf3);}return null;};}function patchUpdates(_0x378e09){return function(_0x23df8d){try{jsonpatch['apply'](_0x23df8d,_0x378e09,!![]);}catch(_0x5dd5fc){return BPromise[_0x8d39('0x23')](_0x5dd5fc);}return _0x23df8d[_0x8d39('0x24')]();};}function saveUpdates(_0x48d0e2,_0x5b5266){return function(_0x4e732d){if(_0x4e732d){return _0x4e732d[_0x8d39('0x25')](_0x48d0e2)[_0x8d39('0x26')](function(_0xde939){return _0xde939;});}return null;};}function removeEntity(_0x170f1e,_0x57e88d){return function(_0x2f4f85){if(_0x2f4f85){return _0x2f4f85['destroy']()['then'](function(){_0x170f1e[_0x8d39('0x22')](0xcc)[_0x8d39('0x1c')]();});}};}function handleEntityNotFound(_0x6b3a54,_0x625dcd){return function(_0x4aa911){if(!_0x4aa911){_0x6b3a54[_0x8d39('0x27')](0x194);}return _0x4aa911;};}function handleError(_0x2dd27e,_0x1c637d){_0x1c637d=_0x1c637d||0x1f4;return function(_0x149911){logger[_0x8d39('0x28')](_0x149911[_0x8d39('0x29')]);if(_0x149911['name']){delete _0x149911['name'];}_0x2dd27e[_0x8d39('0x22')](_0x1c637d)[_0x8d39('0x2a')](_0x149911);};}exports[_0x8d39('0x2b')]=function(_0x1120b6,_0x305e33){var _0x7f61a3={},_0xd2c4f1={},_0x43c57e={'count':0x0,'rows':[]};var _0x112a7f=_[_0x8d39('0x2c')](db['CmHopper'][_0x8d39('0x2d')],function(_0x520d6f){return{'name':_0x520d6f[_0x8d39('0x2e')],'type':_0x520d6f[_0x8d39('0x2f')][_0x8d39('0x30')]};});_0xd2c4f1[_0x8d39('0x31')]=_['map'](_0x112a7f,'name');_0xd2c4f1[_0x8d39('0x32')]=_[_0x8d39('0x33')](_0x1120b6[_0x8d39('0x32')]);_0xd2c4f1[_0x8d39('0x34')]=_[_0x8d39('0x35')](_0xd2c4f1[_0x8d39('0x31')],_0xd2c4f1[_0x8d39('0x32')]);_0xd2c4f1['filters']=_['concat'](_0xd2c4f1[_0x8d39('0x34')],['$and',_0x8d39('0x36'),'$gt',_0x8d39('0x37'),_0x8d39('0x38'),_0x8d39('0x39'),'$ne',_0x8d39('0x3a'),_0x8d39('0x3b'),'$between',_0x8d39('0x3c'),_0x8d39('0x3d'),_0x8d39('0x3e'),'$like',_0x8d39('0x3f'),'$iLike',_0x8d39('0x40'),_0x8d39('0x41'),'$overlap',_0x8d39('0x42'),_0x8d39('0x43'),'$any']);_0x7f61a3[_0x8d39('0x44')]=_[_0x8d39('0x35')](_0xd2c4f1[_0x8d39('0x31')],qs[_0x8d39('0x45')](_0x1120b6[_0x8d39('0x32')]['fields']));_0x7f61a3['attributes']=_0x7f61a3[_0x8d39('0x44')][_0x8d39('0x46')]?_0x7f61a3['attributes']:_0xd2c4f1[_0x8d39('0x31')];if(!_0x1120b6['query'][_0x8d39('0x47')]('nolimit')){_0x7f61a3[_0x8d39('0x20')]=qs['limit'](_0x1120b6[_0x8d39('0x32')][_0x8d39('0x20')]);_0x7f61a3['offset']=qs['offset'](_0x1120b6['query'][_0x8d39('0x1e')]);}_0x7f61a3[_0x8d39('0x48')]=qs[_0x8d39('0x49')](_0x1120b6[_0x8d39('0x32')][_0x8d39('0x49')]);_0x7f61a3[_0x8d39('0x4a')]=qs[_0x8d39('0x34')](_[_0x8d39('0x4b')](_0x1120b6[_0x8d39('0x32')],_0xd2c4f1['filters']),_0x112a7f);if(_0x1120b6[_0x8d39('0x32')]['filter']){_0x7f61a3[_0x8d39('0x4a')]=_[_0x8d39('0x4c')](_0x7f61a3['where'],{'$or':_['map'](_0x112a7f,function(_0x4484c9){if(_0x4484c9[_0x8d39('0x2f')]!==_0x8d39('0x4d')){var _0x1c7580={};_0x1c7580[_0x4484c9[_0x8d39('0x4e')]]={'$like':'%'+_0x1120b6['query'][_0x8d39('0x4f')]+'%'};return _0x1c7580;}})});}_0x7f61a3=_[_0x8d39('0x4c')]({},_0x7f61a3,_0x1120b6[_0x8d39('0x50')]);var _0x16953b={'where':_0x7f61a3[_0x8d39('0x4a')]};return db[_0x8d39('0x51')][_0x8d39('0x21')](_0x16953b)[_0x8d39('0x26')](function(_0x34ed3d){_0x43c57e[_0x8d39('0x21')]=_0x34ed3d;if(_0x1120b6['query'][_0x8d39('0x52')]){_0x7f61a3[_0x8d39('0x53')]=[{'all':!![]}];}return db[_0x8d39('0x51')][_0x8d39('0x54')](_0x7f61a3);})[_0x8d39('0x26')](function(_0x47172e){_0x43c57e['rows']=_0x47172e;return _0x43c57e;})[_0x8d39('0x26')](respondWithFilteredResult(_0x305e33,_0x7f61a3))['catch'](handleError(_0x305e33,null));};exports[_0x8d39('0x55')]=function(_0xf79967,_0x1d8025){var _0x3e8833={'raw':!![],'where':{'id':_0xf79967[_0x8d39('0x56')]['id']}},_0x3b226e={};_0x3b226e[_0x8d39('0x31')]=_[_0x8d39('0x33')](db['CmHopper'][_0x8d39('0x2d')]);_0x3b226e[_0x8d39('0x32')]=_[_0x8d39('0x33')](_0xf79967[_0x8d39('0x32')]);_0x3b226e[_0x8d39('0x34')]=_['intersection'](_0x3b226e[_0x8d39('0x31')],_0x3b226e['query']);_0x3e8833[_0x8d39('0x44')]=_[_0x8d39('0x35')](_0x3b226e[_0x8d39('0x31')],qs[_0x8d39('0x45')](_0xf79967[_0x8d39('0x32')][_0x8d39('0x45')]));_0x3e8833['attributes']=_0x3e8833[_0x8d39('0x44')]['length']?_0x3e8833[_0x8d39('0x44')]:_0x3b226e['model'];if(_0xf79967[_0x8d39('0x32')][_0x8d39('0x52')]){_0x3e8833[_0x8d39('0x53')]=[{'all':!![]}];}_0x3e8833=_[_0x8d39('0x4c')]({},_0x3e8833,_0xf79967[_0x8d39('0x50')]);return db['CmHopper']['find'](_0x3e8833)[_0x8d39('0x26')](handleEntityNotFound(_0x1d8025,null))['then'](respondWithResult(_0x1d8025,null))[_0x8d39('0x57')](handleError(_0x1d8025,null));};exports[_0x8d39('0x58')]=function(_0x12f8ae,_0x37a5d6){return db[_0x8d39('0x51')][_0x8d39('0x58')](_0x12f8ae[_0x8d39('0x59')],{})[_0x8d39('0x26')](respondWithResult(_0x37a5d6,0xc9))[_0x8d39('0x57')](handleError(_0x37a5d6,null));};exports[_0x8d39('0x25')]=function(_0x23a04a,_0x423dde){if(_0x23a04a['body']['id']){delete _0x23a04a['body']['id'];}return db[_0x8d39('0x51')][_0x8d39('0x5a')]({'where':{'id':_0x23a04a[_0x8d39('0x56')]['id']}})[_0x8d39('0x26')](handleEntityNotFound(_0x423dde,null))[_0x8d39('0x26')](saveUpdates(_0x23a04a[_0x8d39('0x59')],null))[_0x8d39('0x26')](respondWithResult(_0x423dde,null))[_0x8d39('0x57')](handleError(_0x423dde,null));};exports[_0x8d39('0x5b')]=function(_0x4e31fe,_0x2e266d){return db[_0x8d39('0x51')]['describe']()[_0x8d39('0x26')](respondWithResult(_0x2e266d,null))[_0x8d39('0x57')](handleError(_0x2e266d,null));};exports['destroy']=function(_0x385ea3,_0x38436b){var _0x266806;return db[_0x8d39('0x51')][_0x8d39('0x5a')]({'where':{'id':_0x385ea3['params']['id']}})[_0x8d39('0x26')](handleEntityNotFound(_0x38436b,null))[_0x8d39('0x26')](function(_0x15f285){if(_0x15f285){return _0x15f285['destroy']()[_0x8d39('0x26')](function(_0x4632da){return _0x4632da;});}})['then'](function(_0x404693){_0x266806=_0x404693;if(_0x404693){if(_0x404693[_0x8d39('0x5c')]||_0x404693[_0x8d39('0x5d')]){return db[_0x404693[_0x8d39('0x5c')]?_0x8d39('0x5e'):'Campaign']['find']({'where':{'id':_0x404693[_0x8d39('0x5c')]?_0x404693['VoiceQueueId']:_0x404693[_0x8d39('0x5d')]},'attributes':['id',_0x8d39('0x4e')],'raw':!![]});}}})[_0x8d39('0x26')](function(_0x256b20){var _0x417a44={};if(_0x256b20){_[_0x8d39('0x4c')](_0x417a44,_[_0x8d39('0x5f')](_0x266806['dataValues'],[_0x8d39('0x60'),'updatedAt','id']));_0x417a44[_0x8d39('0x61')]=0x15;_0x417a44[_0x8d39('0x62')]=_0x8d39('0x63');_0x417a44[_0x8d39('0x64')]=_0x256b20[_0x8d39('0x4e')];_0x417a44[_0x8d39('0x65')]=_0x385ea3[_0x8d39('0x66')][_0x8d39('0x4e')];_0x417a44[_0x8d39('0x67')]=_0x385ea3[_0x8d39('0x66')]['id'];_0x417a44['deleted']=!![];_0x417a44[_0x8d39('0x68')]=moment()['format'](_0x8d39('0x69'));_0x417a44['calleridnum']=_0x266806['phone'];_0x417a44[_0x8d39('0x6a')]=_0x266806[_0x8d39('0x5c')]?_0x8d39('0x6b'):'ivr';return db[_0x8d39('0x6c')][_0x8d39('0x5a')]({'where':{'id':_0x417a44['ContactId']},'attributes':[_0x8d39('0x6d'),'lastName']})['then'](function(_0x48cc08){if(!_[_0x8d39('0x6e')](_0x38436b)&&!_[_0x8d39('0x6e')](_0x48cc08[_0x8d39('0x6d')])){_0x417a44['calleridname']=_0x48cc08[_0x8d39('0x6d')];if(!_['isNil'](_0x48cc08[_0x8d39('0x6f')])){_0x417a44[_0x8d39('0x70')]+='\x20'+_0x48cc08[_0x8d39('0x6f')];}}})[_0x8d39('0x71')](function(){return db['CmHopperFinal'][_0x8d39('0x58')](_0x417a44);});}})[_0x8d39('0x26')](function(){return _0x38436b['status'](0xcc)['end']();})[_0x8d39('0x57')](handleError(_0x38436b,null));};exports[_0x8d39('0x72')]=function(_0x49747a,_0x226b36,_0x37e216){var _0x18793f=[];return db[_0x8d39('0x6c')]['describe']()[_0x8d39('0x26')](function(_0x383042){_0x18793f=_[_0x8d39('0x33')](_0x383042);return _0x49747a[_0x8d39('0x66')][_0x8d39('0x73')]({'where':{'type':_0x8d39('0x74'),'dialActive':!![],'dialMethod':_0x8d39('0x75')},'attributes':['id',_0x8d39('0x76'),_0x8d39('0x77')],'raw':!![]});})[_0x8d39('0x26')](function(_0x507fd7){if(_0x507fd7&&_0x507fd7[_0x8d39('0x46')]){return db[_0x8d39('0x78')]['transaction'](function(_0x3633c8){var _0x31f4ac={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8d39('0x79')](_0x8d39('0x69'))},'VoiceQueueId':{'$in':_[_0x8d39('0x2c')](_0x507fd7,'id')},'$or':[{'UserId':null},{'UserId':_0x49747a[_0x8d39('0x66')]['id']}]};var _0x2d444d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x507fd7)['filter'](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0x8d39('0x7a')]()},'$or':[{'UserId':null},{'UserId':_0x49747a[_0x8d39('0x66')]['id']}]};var _0x20069e={'$or':[_0x31f4ac,_0x2d444d]};var _0x2f66df=[];if(_0x49747a[_0x8d39('0x59')][_0x8d39('0x7b')]&&_0x49747a['body'][_0x8d39('0x7b')]===_0x8d39('0x7c')){if(!_['isEmpty'](_0x49747a[_0x8d39('0x59')][_0x8d39('0x7d')])){_0x20069e['id']={'$in':_0x49747a[_0x8d39('0x59')][_0x8d39('0x7d')]};}_0x2f66df=[[_0x8d39('0x7e'),_0x8d39('0x7f')],[_0x8d39('0x80'),_0x507fd7[0x0][_0x8d39('0x76')]==='ASC'?'DESC':'ASC'],db[_0x8d39('0x78')][_0x8d39('0x81')](_0x8d39('0x82')),['id',_0x8d39('0x83')]];}else{if(!_[_0x8d39('0x84')](_0x49747a[_0x8d39('0x59')][_0x8d39('0x7d')])){_0x20069e['id']={'$notIn':_0x49747a[_0x8d39('0x59')][_0x8d39('0x7d')]};}_0x2f66df=[[_0x8d39('0x7e'),_0x8d39('0x83')],['scheduledAt',_0x507fd7[0x0][_0x8d39('0x76')]],db[_0x8d39('0x78')][_0x8d39('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x8d39('0x7f')]];}return db[_0x8d39('0x51')][_0x8d39('0x85')]({'attributes':['id',_0x8d39('0x86'),_0x8d39('0x87')],'where':_0x20069e,'order':_0x2f66df,'transaction':_0x3633c8,'lock':_0x3633c8[_0x8d39('0x88')][_0x8d39('0x89')],'include':[{'model':db[_0x8d39('0x6c')],'as':_0x8d39('0x8a'),'attributes':_0x18793f,'include':[{'model':db[_0x8d39('0x8b')],'as':_0x8d39('0x8c'),'attributes':['id',_0x8d39('0x4e')]}]},{'model':db[_0x8d39('0x8d')],'as':_0x8d39('0x8e'),'attributes':['id',_0x8d39('0x4e')]},{'model':db[_0x8d39('0x5e')],'as':'Queue','attributes':['id',_0x8d39('0x4e'),_0x8d39('0x8f')]}]})['then'](function(_0x77441){if(_0x77441){return _0x77441[_0x8d39('0x25')]({'UserId':_0x49747a[_0x8d39('0x66')]['id']},{'transaction':_0x3633c8});}});});}})[_0x8d39('0x26')](handleEntityNotFound(_0x226b36,null))[_0x8d39('0x26')](respondWithResult(_0x226b36,null))[_0x8d39('0x57')](handleError(_0x226b36,null));};exports[_0x8d39('0x90')]=function(_0x22409e,_0x1be65f,_0x425bc1){var _0x1f2dd8=[];return db['CmContact'][_0x8d39('0x5b')]()[_0x8d39('0x26')](function(_0x30b947){_0x1f2dd8=_[_0x8d39('0x33')](_0x30b947);return _0x22409e['user'][_0x8d39('0x73')]({'where':{'type':_0x8d39('0x74'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x8d39('0x76'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x8d39('0x26')](function(_0x5c73f3){if(_0x5c73f3&&_0x5c73f3[_0x8d39('0x46')]){return db[_0x8d39('0x78')][_0x8d39('0x91')](function(_0x23e2f5){var _0x40c2d9={'active':![],'recallme':!![],'id':_0x22409e[_0x8d39('0x59')]['hopperId']};return db[_0x8d39('0x51')][_0x8d39('0x85')]({'attributes':['id',_0x8d39('0x86'),_0x8d39('0x87')],'where':_0x40c2d9,'transaction':_0x23e2f5,'lock':_0x23e2f5[_0x8d39('0x88')][_0x8d39('0x89')],'include':[{'model':db['CmContact'],'as':_0x8d39('0x8a'),'attributes':_0x1f2dd8,'include':[{'model':db[_0x8d39('0x8b')],'as':_0x8d39('0x8c'),'attributes':['id',_0x8d39('0x4e')]}]},{'model':db[_0x8d39('0x8d')],'as':_0x8d39('0x8e'),'attributes':['id',_0x8d39('0x4e')]},{'model':db[_0x8d39('0x5e')],'as':'Queue','attributes':['id',_0x8d39('0x4e'),'dialActive']}]})[_0x8d39('0x26')](function(_0x560e4c){if(_0x560e4c){return _0x560e4c[_0x8d39('0x25')]({'UserId':_0x22409e['user']['id']},{'transaction':_0x23e2f5});}});});}})[_0x8d39('0x26')](handleEntityNotFound(_0x1be65f,null))[_0x8d39('0x26')](respondWithResult(_0x1be65f,null))['catch'](handleError(_0x1be65f,null));};exports[_0x8d39('0x92')]=function(_0x1a02da,_0x349391,_0x3d8963){return _0x1a02da[_0x8d39('0x66')][_0x8d39('0x73')]({'where':{'type':_0x8d39('0x74'),'dialActive':!![],'dialMethod':_0x8d39('0x75')},'attributes':['id'],'raw':!![]})['then'](function(_0x4cea2a){if(_0x4cea2a&&_0x4cea2a[_0x8d39('0x46')]){return db[_0x8d39('0x51')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x8d39('0x69'))},'VoiceQueueId':{'$in':_['map'](_0x4cea2a,'id')},'$or':[{'UserId':null},{'UserId':_0x1a02da['user']['id']}]}});}return 0x0;})[_0x8d39('0x26')](function(_0x52e75e){if(!_['isNil'](_0x52e75e)&&_['isNumber'](_0x52e75e)){return _0x349391[_0x8d39('0x22')](0xc8)[_0x8d39('0x1d')]({'contacts':_0x52e75e});}else{logger[_0x8d39('0x28')](_0x8d39('0x93'),_0x8d39('0x92'),0x194,_0x8d39('0x94'));_0x349391['sendStatus'](0x194);}})[_0x8d39('0x57')](handleError(_0x349391,null));};exports[_0x8d39('0x95')]=function(_0x4c8b44,_0x3ed268,_0x3e31d8){var _0x257b24=shared[_0x8d39('0x96')];var _0x826fc9=[];_['map'](_0x257b24,function(_0x6ba595){_0x826fc9[_0x8d39('0x97')]({'id':_0x6ba595[_0x8d39('0x4e')],'name':_0x6ba595[_0x8d39('0x4e')],'utcOffset':_0x6ba595[_0x8d39('0x98')]});});return _0x3ed268[_0x8d39('0x22')](0xc8)[_0x8d39('0x1d')]({'tz':_0x826fc9});};exports[_0x8d39('0x99')]=function(_0x53bec5,_0x4e6c75,_0x2fac1f){var _0x216c80=shared['timezones'];var _0x87a026={};if(!_['isNil'](_0x216c80[_0x53bec5['body']['id']]))_0x87a026=_0x216c80[_0x53bec5[_0x8d39('0x59')]['id']];return _0x4e6c75[_0x8d39('0x22')](0xc8)[_0x8d39('0x1d')](_0x87a026);};
\ No newline at end of file
index 88ef131..4790cf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5496=['request-promise','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x45808c,_0x3dbb6c){var _0x3a30b8=function(_0xcb1a05){while(--_0xcb1a05){_0x45808c['push'](_0x45808c['shift']());}};_0x3a30b8(++_0x3dbb6c);}(_0x5496,0x175));var _0x6549=function(_0x289f5c,_0x4c312c){_0x289f5c=_0x289f5c-0x0;var _0x4e18e0=_0x5496[_0x289f5c];return _0x4e18e0;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('CmHopper',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xb')]},{'name':'phone','fields':[_0x6549('0xc')]},{'name':_0x6549('0xd'),'fields':[_0x6549('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xda19=['define','CmHopper','cm_hopper','scheduledat','priority','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xda19,0xd5));var _0x9da1=function(_0x6b89e3,_0x3b540f){_0x6b89e3=_0x6b89e3-0x0;var _0x11d980=_0xda19[_0x6b89e3];return _0x11d980;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0x9da1('0xc'),'fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
index c69fb8b..051d592 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6197=['code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper','update','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','LOCK','keys','User','name','voicePause','length','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','sequelize','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UPDATE','GetCmHopperPreview','Contact','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','literal','NOW()\x20+\x20INTERVAL\x20','Agent','CmList','List','\x20MINUTE','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xace5bb,_0x4322f6){var _0x37bd48=function(_0x1d31c7){while(--_0x1d31c7){_0xace5bb['push'](_0xace5bb['shift']());}};_0x37bd48(++_0x4322f6);}(_0x6197,0x153));var _0x7619=function(_0x18d07f,_0x2975e5){_0x18d07f=_0x18d07f-0x0;var _0x5c5360=_0x6197[_0x18d07f];return _0x5c5360;};'use strict';var _=require(_0x7619('0x0'));var util=require(_0x7619('0x1'));var moment=require(_0x7619('0x2'));var BPromise=require('bluebird');var rs=require(_0x7619('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7619('0x4'))['db'];var utils=require(_0x7619('0x5'));var logger=require(_0x7619('0x6'))('rpc');var config=require(_0x7619('0x7'));var jayson=require('jayson/promise');const {validateExpressRequest}=require('twilio/lib/webhooks/webhooks');var client=jayson[_0x7619('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6bb9d4,_0x5e6994,_0x58398c){return new BPromise(function(_0xe86d3e,_0x54a184){return client['request'](_0x6bb9d4,_0x58398c)[_0x7619('0x9')](function(_0x545b93){logger[_0x7619('0xa')](_0x7619('0xb'),_0x5e6994,_0x7619('0xc'));logger[_0x7619('0xd')](_0x7619('0xe'),_0x5e6994,_0x7619('0xc'),JSON[_0x7619('0xf')](_0x545b93));if(_0x545b93['error']){if(_0x545b93[_0x7619('0x10')][_0x7619('0x11')]===0x1f4){logger[_0x7619('0x10')](_0x7619('0xb'),_0x5e6994,_0x545b93[_0x7619('0x10')][_0x7619('0x12')]);return _0x54a184(_0x545b93[_0x7619('0x10')][_0x7619('0x12')]);}logger['error'](_0x7619('0xb'),_0x5e6994,_0x545b93[_0x7619('0x10')][_0x7619('0x12')]);return _0xe86d3e(_0x545b93[_0x7619('0x10')][_0x7619('0x12')]);}else{logger[_0x7619('0xa')](_0x7619('0xb'),_0x5e6994,'request\x20sent');_0xe86d3e(_0x545b93[_0x7619('0x13')]['message']);}})[_0x7619('0x14')](function(_0x46b291){logger[_0x7619('0x10')](_0x7619('0xb'),_0x5e6994,_0x46b291);_0x54a184(_0x46b291);});});}exports[_0x7619('0x15')]=function(_0x4e898b){var _0x3a4daa=this;return new Promise(function(_0x240bd4,_0x448092){return db[_0x7619('0x16')][_0x7619('0x17')]({'raw':_0x4e898b['options']?_0x4e898b[_0x7619('0x18')][_0x7619('0x19')]===undefined?!![]:![]:!![],'where':_0x4e898b[_0x7619('0x18')]?_0x4e898b[_0x7619('0x18')][_0x7619('0x1a')]||null:null,'attributes':_0x4e898b[_0x7619('0x18')]?_0x4e898b[_0x7619('0x18')][_0x7619('0x1b')]||null:null,'limit':_0x4e898b['options']?_0x4e898b[_0x7619('0x18')][_0x7619('0x1c')]||null:null,'include':_0x4e898b['options']?_0x4e898b[_0x7619('0x18')][_0x7619('0x1d')]?_[_0x7619('0x1e')](_0x4e898b[_0x7619('0x18')][_0x7619('0x1d')],function(_0x194680){return{'model':db[_0x194680[_0x7619('0x1f')]],'as':_0x194680['as'],'attributes':_0x194680[_0x7619('0x1b')],'include':_0x194680[_0x7619('0x1d')]?_[_0x7619('0x1e')](_0x194680[_0x7619('0x1d')],function(_0x12cfa9){return{'model':db[_0x12cfa9['model']],'as':_0x12cfa9['as'],'attributes':_0x12cfa9[_0x7619('0x1b')],'include':_0x12cfa9['include']?_[_0x7619('0x1e')](_0x12cfa9[_0x7619('0x1d')],function(_0x4bf4cb){return{'model':db[_0x4bf4cb['model']],'as':_0x4bf4cb['as'],'attributes':_0x4bf4cb[_0x7619('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7619('0x9')](function(_0x721966){logger[_0x7619('0xa')]('GetCmHopper',_0x4e898b);logger[_0x7619('0xd')](_0x7619('0x15'),_0x4e898b,JSON['stringify'](_0x721966));_0x240bd4(_0x721966);})[_0x7619('0x14')](function(_0x4152f7){logger[_0x7619('0x10')](_0x7619('0x15'),_0x4152f7['message'],_0x4e898b);_0x448092(_0x3a4daa[_0x7619('0x10')](0x1f4,_0x4152f7['message']));});});};exports['ShowCmHopper']=function(_0xa30a23){var _0x45b6a5=this;return new Promise(function(_0x187cae,_0x5ba101){return db['CmHopper'][_0x7619('0x20')]({'raw':_0xa30a23['options']?_0xa30a23[_0x7619('0x18')][_0x7619('0x19')]===undefined?!![]:![]:!![],'where':_0xa30a23[_0x7619('0x18')]?_0xa30a23[_0x7619('0x18')]['where']||null:null,'attributes':_0xa30a23[_0x7619('0x18')]?_0xa30a23['options'][_0x7619('0x1b')]||null:null,'include':_0xa30a23[_0x7619('0x18')]?_0xa30a23[_0x7619('0x18')][_0x7619('0x1d')]?_[_0x7619('0x1e')](_0xa30a23[_0x7619('0x18')][_0x7619('0x1d')],function(_0x51f501){return{'model':db[_0x51f501[_0x7619('0x1f')]],'as':_0x51f501['as'],'attributes':_0x51f501[_0x7619('0x1b')],'include':_0x51f501[_0x7619('0x1d')]?_['map'](_0x51f501[_0x7619('0x1d')],function(_0x4b9af0){return{'model':db[_0x4b9af0[_0x7619('0x1f')]],'as':_0x4b9af0['as'],'attributes':_0x4b9af0['attributes'],'include':_0x4b9af0[_0x7619('0x1d')]?_[_0x7619('0x1e')](_0x4b9af0['include'],function(_0x5e00fd){return{'model':db[_0x5e00fd[_0x7619('0x1f')]],'as':_0x5e00fd['as'],'attributes':_0x5e00fd[_0x7619('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7619('0x9')](function(_0x3878f4){logger[_0x7619('0xa')](_0x7619('0x21'),_0xa30a23);logger[_0x7619('0xd')]('ShowCmHopper',_0xa30a23,JSON[_0x7619('0xf')](_0x3878f4));_0x187cae(_0x3878f4);})['catch'](function(_0x27057b){logger['error'](_0x7619('0x21'),_0x27057b['message'],_0xa30a23);_0x5ba101(_0x45b6a5[_0x7619('0x10')](0x1f4,_0x27057b[_0x7619('0x12')]));});});};exports[_0x7619('0x22')]=function(_0x4090d9){var _0x927fe0=this;return new Promise(function(_0x9d970,_0x34eedc){return db[_0x7619('0x16')][_0x7619('0x23')](_0x4090d9['body'],{'raw':_0x4090d9[_0x7619('0x18')]?_0x4090d9[_0x7619('0x18')][_0x7619('0x19')]===undefined?!![]:![]:!![]})[_0x7619('0x9')](function(_0x38c891){logger[_0x7619('0xa')]('CreateCmHopper',_0x4090d9);logger[_0x7619('0xd')]('CreateCmHopper',_0x4090d9,JSON[_0x7619('0xf')](_0x38c891));_0x9d970(_0x38c891);})[_0x7619('0x14')](function(_0x55cd01){logger[_0x7619('0x10')](_0x7619('0x22'),_0x55cd01[_0x7619('0x12')],_0x4090d9);_0x34eedc(_0x927fe0[_0x7619('0x10')](0x1f4,_0x55cd01[_0x7619('0x12')]));});});};exports[_0x7619('0x24')]=function(_0x16f2be){var _0x4e9d7d=this;return new Promise(function(_0x4dadf4,_0x294769){return db['CmHopper'][_0x7619('0x25')](_0x16f2be[_0x7619('0x26')],{'raw':_0x16f2be[_0x7619('0x18')]?_0x16f2be[_0x7619('0x18')][_0x7619('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16f2be[_0x7619('0x18')]?_0x16f2be['options'][_0x7619('0x1a')]||null:null,'attributes':_0x16f2be[_0x7619('0x18')]?_0x16f2be[_0x7619('0x18')][_0x7619('0x1b')]||null:null,'limit':_0x16f2be[_0x7619('0x18')]?_0x16f2be[_0x7619('0x18')]['limit']||null:null})[_0x7619('0x9')](function(_0x33713a){logger[_0x7619('0xa')](_0x7619('0x24'),_0x16f2be);logger[_0x7619('0xa')](_0x7619('0x27'),JSON[_0x7619('0xf')](_0x16f2be[_0x7619('0x18')][_0x7619('0x1a')]),_0x16f2be[_0x7619('0x26')][_0x7619('0x28')]);logger[_0x7619('0xd')]('UpdateCmHopper',_0x16f2be,JSON[_0x7619('0xf')](_0x33713a));_0x4dadf4(_0x33713a);})[_0x7619('0x14')](function(_0x464262){logger[_0x7619('0x10')]('UpdateCmHopper',_0x464262[_0x7619('0x12')],_0x16f2be);_0x294769(_0x4e9d7d[_0x7619('0x10')](0x1f4,_0x464262[_0x7619('0x12')]));});});};exports[_0x7619('0x29')]=function(_0x4a10aa){var _0x2bdcec=this;return new Promise(function(_0x5e9503,_0x2bdf03){return db[_0x7619('0x16')][_0x7619('0x2a')]({'where':_0x4a10aa[_0x7619('0x18')]?_0x4a10aa['options']['where']||null:null})['then'](function(_0x50c7fe){logger[_0x7619('0xa')](_0x7619('0x29'),_0x4a10aa);logger['debug'](_0x7619('0x29'),_0x4a10aa,JSON[_0x7619('0xf')](_0x50c7fe));_0x5e9503(_0x50c7fe);})[_0x7619('0x14')](function(_0x13bb2b){logger[_0x7619('0x10')](_0x7619('0x29'),_0x13bb2b[_0x7619('0x12')],_0x4a10aa);_0x2bdf03(_0x2bdcec[_0x7619('0x10')](0x1f4,_0x13bb2b[_0x7619('0x12')]));});});};exports[_0x7619('0x2b')]=function(_0x2ea36b){var _0x513a82=this;return new Promise(function(_0x7417d6,_0x51c0c8){return db[_0x7619('0x2c')][_0x7619('0x2d')]()[_0x7619('0x9')](function(_0x3df806){return db['sequelize']['transaction'](function(_0x6a79b0){return db[_0x7619('0x16')][_0x7619('0x17')]({'where':_0x2ea36b[_0x7619('0x18')]?_0x2ea36b['options']['where']||null:null,'attributes':_0x2ea36b[_0x7619('0x18')]?_0x2ea36b[_0x7619('0x18')][_0x7619('0x1b')]||null:null,'limit':_0x2ea36b[_0x7619('0x18')]?_0x2ea36b[_0x7619('0x18')]['limit']||null:null,'order':_0x2ea36b[_0x7619('0x18')]?_0x2ea36b[_0x7619('0x18')]['order']||null:null,'transaction':_0x6a79b0,'lock':_0x6a79b0[_0x7619('0x2e')]['UPDATE'],'include':[{'model':db[_0x7619('0x2c')],'as':'Contact','attributes':_[_0x7619('0x2f')](_0x3df806)},{'model':db[_0x7619('0x30')],'as':'Agent','attributes':['id',_0x7619('0x31'),_0x7619('0x32')]}]})[_0x7619('0x9')](function(_0x300b34){var _0x78a64b=[];var _0xbdc214=[];for(var _0x57324b=0x0;_0x57324b<_0x300b34[_0x7619('0x33')];_0x57324b+=0x1){var _0x250e2c=_0x300b34[_0x57324b][_0x7619('0x34')];if(_0x250e2c===null){_0x78a64b[_0x7619('0x35')](_0x300b34[_0x57324b][_0x7619('0x25')](_0x2ea36b[_0x7619('0x26')],{'transaction':_0x6a79b0}));}else if(!_0xbdc214['includes'](_0x250e2c)){_0xbdc214['push'](_0x250e2c);_0x78a64b['push'](_0x300b34[_0x57324b][_0x7619('0x25')](_0x2ea36b['body'],{'transaction':_0x6a79b0}));}}return BPromise[_0x7619('0x36')](_0x78a64b);});})[_0x7619('0x9')](function(_0x6e421){logger[_0x7619('0xa')](_0x7619('0x2b'),_0x2ea36b);if(_0x6e421[_0x7619('0x33')]>0x0){logger['info'](_0x7619('0x37'),_0x6e421[0x0]['dataValues']['id'],_0x6e421[0x0][_0x7619('0x38')]['ContactId'],_0x6e421[0x0]['dataValues']['active']);}logger[_0x7619('0xd')](_0x7619('0x2b'),_0x2ea36b,JSON['stringify'](_0x6e421));_0x7417d6(_0x6e421);})['catch'](function(_0x5e55d0){logger[_0x7619('0x10')](_0x7619('0x2b'),_0x5e55d0[_0x7619('0x12')],_0x2ea36b);_0x51c0c8(_0x513a82[_0x7619('0x10')](0x1f4,_0x5e55d0[_0x7619('0x12')]));});});});};exports['MoveContactManagedDialer']=function(_0x40f94d){var _0xca72ae=this;return new Promise(function(_0x1824c8,_0x16bcde){return db[_0x7619('0x39')][_0x7619('0x3a')](function(_0x2889cd){return db[_0x7619('0x3b')]['create'](_0x40f94d['body'],{'raw':_0x40f94d[_0x7619('0x18')]?_0x40f94d['options'][_0x7619('0x19')]===undefined?!![]:![]:!![],'transaction':_0x2889cd})[_0x7619('0x9')](function(){logger['info'](_0x7619('0x3c'),JSON['stringify'](_0x40f94d['options'][_0x7619('0x1a')]),_0x40f94d[_0x7619('0x18')][_0x7619('0x1a')][_0x7619('0x28')]);return db['CmHopper']['destroy']({'where':_0x40f94d[_0x7619('0x18')]?_0x40f94d[_0x7619('0x18')]['where']||null:null,'transaction':_0x2889cd});});})[_0x7619('0x9')](function(_0x298811){logger[_0x7619('0xa')](_0x7619('0x3d'),_0x40f94d);logger[_0x7619('0xd')](_0x7619('0x3d'),_0x40f94d,JSON[_0x7619('0xf')](_0x298811));_0x1824c8(_0x298811);})[_0x7619('0x14')](function(_0x468263){logger[_0x7619('0x10')](_0x7619('0x3d'),_0x468263['message'],_0x40f94d);_0x16bcde(_0xca72ae[_0x7619('0x10')](0x1f4,_0x468263[_0x7619('0x12')]));});});};exports[_0x7619('0x3e')]=function(_0x340ed6){var _0x30cd6d=this;return new Promise(function(_0x41c08d,_0x43cded){return db[_0x7619('0x16')][_0x7619('0x17')]({'raw':_0x340ed6[_0x7619('0x18')]?_0x340ed6[_0x7619('0x18')][_0x7619('0x19')]===undefined?!![]:![]:!![],'where':_0x340ed6[_0x7619('0x18')]?_0x340ed6[_0x7619('0x18')][_0x7619('0x1a')]||null:null,'attributes':[[db[_0x7619('0x39')]['fn'](_0x7619('0x3f'),db[_0x7619('0x39')]['fn']('IF',db[_0x7619('0x39')]['literal'](_0x7619('0x40')+util['format'](_0x7619('0x41'),moment()[_0x7619('0x42')](_0x7619('0x43')))+_0x7619('0x44')))),_0x7619('0x45')]]})[_0x7619('0x9')](function(_0x201371){logger[_0x7619('0xa')](_0x7619('0x3e'),_0x340ed6);logger[_0x7619('0xd')](_0x7619('0x3e'),_0x340ed6,JSON[_0x7619('0xf')](_0x201371));_0x41c08d(_0x201371);})[_0x7619('0x14')](function(_0x2290ef){logger[_0x7619('0x10')]('CountReScheduled',_0x2290ef['message'],_0x340ed6);_0x43cded(_0x30cd6d[_0x7619('0x10')](0x1f4,_0x2290ef['message']));});});};exports[_0x7619('0x46')]=function(_0x355c47){var _0x45186a=this;return new Promise(function(_0x43d256,_0x342cb4){return db[_0x7619('0x2c')][_0x7619('0x2d')]()['then'](function(_0x16fce7){return db[_0x7619('0x39')][_0x7619('0x3a')](function(_0x2d1c83){return db[_0x7619('0x16')][_0x7619('0x17')]({'where':_0x355c47[_0x7619('0x18')]?_0x355c47['options']['where']||null:null,'attributes':_0x355c47[_0x7619('0x18')]?_0x355c47[_0x7619('0x18')][_0x7619('0x1b')]||null:null,'limit':0x1,'order':_0x355c47[_0x7619('0x18')]?_0x355c47[_0x7619('0x18')][_0x7619('0x47')]||null:null,'group':db[_0x7619('0x16')][_0x7619('0x34')],'transaction':_0x2d1c83,'lock':_0x2d1c83[_0x7619('0x2e')][_0x7619('0x48')],'include':_0x355c47['options']?_0x355c47['options'][_0x7619('0x1d')]?_[_0x7619('0x1e')](_0x355c47[_0x7619('0x18')][_0x7619('0x1d')],function(_0x1dc2ab){return{'model':db[_0x1dc2ab[_0x7619('0x1f')]],'as':_0x1dc2ab['as'],'attributes':_0x1dc2ab[_0x7619('0x1b')],'include':_0x1dc2ab[_0x7619('0x1d')]?_[_0x7619('0x1e')](_0x1dc2ab[_0x7619('0x1d')],function(_0x1ce48e){return{'model':db[_0x1ce48e['model']],'as':_0x1ce48e['as'],'attributes':_0x1ce48e[_0x7619('0x1b')],'include':_0x1ce48e['include']?_[_0x7619('0x1e')](_0x1ce48e[_0x7619('0x1d')],function(_0x476500){return{'model':db[_0x476500[_0x7619('0x1f')]],'as':_0x476500['as'],'attributes':_0x476500[_0x7619('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7619('0x9')](function(_0x18fd9c){var _0x223aab=[];for(var _0x490d55=0x0;_0x490d55<_0x18fd9c[_0x7619('0x33')];_0x490d55+=0x1){_0x223aab[_0x7619('0x35')](_0x18fd9c[_0x490d55][_0x7619('0x25')](_0x355c47[_0x7619('0x26')],{'transaction':_0x2d1c83}));}return BPromise[_0x7619('0x36')](_0x223aab);});})['then'](function(_0xe0b65a){logger[_0x7619('0xa')](_0x7619('0x46'),_0x355c47);logger['debug'](_0x7619('0x46'),_0x355c47,JSON[_0x7619('0xf')](_0xe0b65a));_0x43d256(_0xe0b65a);})[_0x7619('0x14')](function(_0x247ced){logger[_0x7619('0x10')](_0x7619('0x46'),_0x247ced[_0x7619('0x12')],_0x355c47);_0x342cb4(_0x45186a['error'](0x1f4,_0x247ced[_0x7619('0x12')]));});});});};exports[_0x7619('0x49')]=function(_0x5c017e){var _0x1bc7b0=this;return new Promise(function(_0x327af8,_0x1fd52b){db[_0x7619('0x2c')][_0x7619('0x2d')]()[_0x7619('0x9')](function(_0x5a32fb){return db[_0x7619('0x16')][_0x7619('0x17')]({'raw':_0x5c017e[_0x7619('0x18')]?_0x5c017e[_0x7619('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c017e['options']?_0x5c017e['options']['where']||null:null,'attributes':_0x5c017e[_0x7619('0x18')]?_0x5c017e[_0x7619('0x18')]['attributes']||null:null,'limit':_0x5c017e[_0x7619('0x18')]?_0x5c017e['options']['limit']||null:null,'include':_0x5c017e[_0x7619('0x18')]?_0x5c017e[_0x7619('0x18')][_0x7619('0x1d')]?_['map'](_0x5c017e[_0x7619('0x18')][_0x7619('0x1d')],function(_0x4fbba3){return{'model':db[_0x4fbba3[_0x7619('0x1f')]],'as':_0x4fbba3['as'],'attributes':_0x4fbba3['as']===_0x7619('0x4a')?_[_0x7619('0x2f')](_0x5a32fb):_0x4fbba3[_0x7619('0x1b')],'include':_0x4fbba3[_0x7619('0x1d')]?_['map'](_0x4fbba3[_0x7619('0x1d')],function(_0x2e8c27){return{'model':db[_0x2e8c27[_0x7619('0x1f')]],'as':_0x2e8c27['as'],'attributes':_0x2e8c27['attributes'],'include':_0x2e8c27['include']?_['map'](_0x2e8c27[_0x7619('0x1d')],function(_0x9f6ed6){return{'model':db[_0x9f6ed6[_0x7619('0x1f')]],'as':_0x9f6ed6['as'],'attributes':_0x9f6ed6[_0x7619('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7619('0x9')](function(_0x178773){logger[_0x7619('0xa')]('GetCmHopper',_0x5c017e);logger[_0x7619('0xd')](_0x7619('0x15'),_0x5c017e,JSON[_0x7619('0xf')](_0x178773));_0x327af8(_0x178773);})[_0x7619('0x14')](function(_0x3b9e50){logger['error'](_0x7619('0x15'),_0x3b9e50[_0x7619('0x12')],_0x5c017e);_0x1fd52b(_0x1bc7b0[_0x7619('0x10')](0x1f4,_0x3b9e50[_0x7619('0x12')]));});});});};exports['GetContactByPhone']=function(_0x11f6ce){var _0x39d3bb=this;return new Promise(function(_0x40e4ad,_0x540c2b){return db['CmContact'][_0x7619('0x4b')]({'raw':!![],'where':{'phone':_0x11f6ce[_0x7619('0x18')]['where'][_0x7619('0x4c')]},'attributes':['id','dialTimezone'],'order':[['id',_0x7619('0x4d')]]})[_0x7619('0x9')](function(_0x3351d8){logger[_0x7619('0xa')](_0x7619('0x4e'),_0x11f6ce);logger['debug'](_0x7619('0x4e'),_0x11f6ce,JSON[_0x7619('0xf')](_0x3351d8));_0x40e4ad(_0x3351d8);})[_0x7619('0x14')](function(_0x374f40){logger['error'](_0x7619('0x4e'),_0x374f40[_0x7619('0x12')],_0x11f6ce);_0x540c2b(_0x39d3bb[_0x7619('0x10')](0x1f4,_0x374f40[_0x7619('0x12')]));});});};exports[_0x7619('0x4f')]=function(_0x437052){var _0x5ea139=this;return new Promise(function(_0x239472,_0x2c25bb){return db[_0x7619('0x39')][_0x7619('0x3a')](function(_0x35760a){return db[_0x7619('0x16')][_0x7619('0x25')]({'active':![]},{'where':{},'transaction':_0x35760a})[_0x7619('0x9')](function(_0x47a842){logger[_0x7619('0xa')](_0x7619('0x4f'),_0x437052);logger[_0x7619('0xd')](_0x7619('0x4f'),_0x437052,JSON[_0x7619('0xf')](_0x47a842));_0x239472(_0x47a842);})[_0x7619('0x14')](function(_0x1d293f){logger[_0x7619('0x10')](_0x7619('0x4f'),_0x1d293f[_0x7619('0x12')],_0x437052);_0x2c25bb(_0x5ea139[_0x7619('0x10')](0x1f4,_0x1d293f[_0x7619('0x12')]));});});});};exports[_0x7619('0x50')]=function(_0x828852){var _0x46ab8a=this;var _0x12ffdd=_0x828852[_0x7619('0x26')][_0x7619('0x1a')][_0x7619('0x51')];var _0x225389=_0x828852[_0x7619('0x26')][_0x7619('0x1a')][_0x7619('0x52')];return new Promise(function(_0x25fbbd,_0x2a9ae1){return db[_0x7619('0x16')][_0x7619('0x17')]({'where':{'voiceQueueId':_0x12ffdd,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x7619('0x39')][_0x7619('0x53')](_0x7619('0x54')+_0x225389+'\x20MINUTE')}},'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db[_0x7619('0x30')],'as':_0x7619('0x55'),'attributes':['id',_0x7619('0x31'),_0x7619('0x32')]},{'model':db[_0x7619('0x56')],'as':_0x7619('0x57')}]})[_0x7619('0x9')](function(_0x4e8651){return db[_0x7619('0x39')]['transaction'](function(_0x466ebd){return db[_0x7619('0x16')][_0x7619('0x25')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x12ffdd,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x7619('0x39')][_0x7619('0x53')](_0x7619('0x54')+_0x225389+_0x7619('0x58'))}},'transaction':_0x466ebd})['then'](function(_0x4f293c){_0x25fbbd(_0x4e8651);})[_0x7619('0x14')](function(_0x5aa10b){logger[_0x7619('0x10')](_0x7619('0x50'),_0x5aa10b['message'],_0x828852);_0x2a9ae1(validateExpressRequest);});});})[_0x7619('0x14')](function(_0x178f8f){logger[_0x7619('0x10')](_0x7619('0x50'),_0x178f8f[_0x7619('0x12')],_0x828852);_0x2a9ae1(_0x46ab8a[_0x7619('0x10')](0x1f4,_0x178f8f[_0x7619('0x12')]));});});};
\ No newline at end of file
+var _0xe4b6=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','twilio/lib/webhooks/webhooks','http','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','model','then','debug','catch','ShowCmHopper','map','create','body','CreateCmHopper','active','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','Agent','voicePause','length','push','update','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','all','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','\x20MINUTE','User','CmList','List','NOW()\x20+\x20INTERVAL\x20','util','moment','bluebird'];(function(_0x49b984,_0x387c83){var _0x49d1e0=function(_0x3664c7){while(--_0x3664c7){_0x49b984['push'](_0x49b984['shift']());}};_0x49d1e0(++_0x387c83);}(_0xe4b6,0xad));var _0x6e4b=function(_0x40ef1c,_0x5916a9){_0x40ef1c=_0x40ef1c-0x0;var _0x1858b3=_0xe4b6[_0x40ef1c];return _0x1858b3;};'use strict';var _=require('lodash');var util=require(_0x6e4b('0x0'));var moment=require(_0x6e4b('0x1'));var BPromise=require(_0x6e4b('0x2'));var rs=require(_0x6e4b('0x3'));var fs=require('fs');var Redis=require(_0x6e4b('0x4'));var db=require(_0x6e4b('0x5'))['db'];var utils=require(_0x6e4b('0x6'));var logger=require('../../config/logger')(_0x6e4b('0x7'));var config=require(_0x6e4b('0x8'));var jayson=require('jayson/promise');const {validateExpressRequest}=require(_0x6e4b('0x9'));var client=jayson['client'][_0x6e4b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47a785,_0x3f8448,_0x377d32){return new BPromise(function(_0x1a053b,_0x5460f1){return client['request'](_0x47a785,_0x377d32)['then'](function(_0xabeaa){logger[_0x6e4b('0xb')](_0x6e4b('0xc'),_0x3f8448,'request\x20sent');logger['debug'](_0x6e4b('0xd'),_0x3f8448,_0x6e4b('0xe'),JSON[_0x6e4b('0xf')](_0xabeaa));if(_0xabeaa[_0x6e4b('0x10')]){if(_0xabeaa[_0x6e4b('0x10')][_0x6e4b('0x11')]===0x1f4){logger[_0x6e4b('0x10')](_0x6e4b('0xc'),_0x3f8448,_0xabeaa['error'][_0x6e4b('0x12')]);return _0x5460f1(_0xabeaa[_0x6e4b('0x10')][_0x6e4b('0x12')]);}logger[_0x6e4b('0x10')](_0x6e4b('0xc'),_0x3f8448,_0xabeaa[_0x6e4b('0x10')][_0x6e4b('0x12')]);return _0x1a053b(_0xabeaa['error'][_0x6e4b('0x12')]);}else{logger['info'](_0x6e4b('0xc'),_0x3f8448,_0x6e4b('0xe'));_0x1a053b(_0xabeaa[_0x6e4b('0x13')][_0x6e4b('0x12')]);}})['catch'](function(_0x98402d){logger[_0x6e4b('0x10')](_0x6e4b('0xc'),_0x3f8448,_0x98402d);_0x5460f1(_0x98402d);});});}exports[_0x6e4b('0x14')]=function(_0x42972a){var _0x5af9b8=this;return new Promise(function(_0xcae170,_0x15c9ec){return db[_0x6e4b('0x15')][_0x6e4b('0x16')]({'raw':_0x42972a[_0x6e4b('0x17')]?_0x42972a[_0x6e4b('0x17')][_0x6e4b('0x18')]===undefined?!![]:![]:!![],'where':_0x42972a[_0x6e4b('0x17')]?_0x42972a[_0x6e4b('0x17')][_0x6e4b('0x19')]||null:null,'attributes':_0x42972a['options']?_0x42972a[_0x6e4b('0x17')][_0x6e4b('0x1a')]||null:null,'limit':_0x42972a[_0x6e4b('0x17')]?_0x42972a[_0x6e4b('0x17')][_0x6e4b('0x1b')]||null:null,'include':_0x42972a[_0x6e4b('0x17')]?_0x42972a[_0x6e4b('0x17')][_0x6e4b('0x1c')]?_['map'](_0x42972a[_0x6e4b('0x17')][_0x6e4b('0x1c')],function(_0x4f3223){return{'model':db[_0x4f3223['model']],'as':_0x4f3223['as'],'attributes':_0x4f3223['attributes'],'include':_0x4f3223[_0x6e4b('0x1c')]?_['map'](_0x4f3223['include'],function(_0x28d69b){return{'model':db[_0x28d69b[_0x6e4b('0x1d')]],'as':_0x28d69b['as'],'attributes':_0x28d69b['attributes'],'include':_0x28d69b['include']?_['map'](_0x28d69b[_0x6e4b('0x1c')],function(_0x25a9e1){return{'model':db[_0x25a9e1[_0x6e4b('0x1d')]],'as':_0x25a9e1['as'],'attributes':_0x25a9e1['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e4b('0x1e')](function(_0x1bc235){logger[_0x6e4b('0xb')]('GetCmHopper',_0x42972a);logger[_0x6e4b('0x1f')](_0x6e4b('0x14'),_0x42972a,JSON[_0x6e4b('0xf')](_0x1bc235));_0xcae170(_0x1bc235);})[_0x6e4b('0x20')](function(_0x45b469){logger[_0x6e4b('0x10')](_0x6e4b('0x14'),_0x45b469[_0x6e4b('0x12')],_0x42972a);_0x15c9ec(_0x5af9b8[_0x6e4b('0x10')](0x1f4,_0x45b469[_0x6e4b('0x12')]));});});};exports[_0x6e4b('0x21')]=function(_0x2fac23){var _0x33910a=this;return new Promise(function(_0x52d9ca,_0xa251c3){return db[_0x6e4b('0x15')]['find']({'raw':_0x2fac23['options']?_0x2fac23[_0x6e4b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2fac23[_0x6e4b('0x17')]?_0x2fac23[_0x6e4b('0x17')][_0x6e4b('0x19')]||null:null,'attributes':_0x2fac23[_0x6e4b('0x17')]?_0x2fac23[_0x6e4b('0x17')][_0x6e4b('0x1a')]||null:null,'include':_0x2fac23[_0x6e4b('0x17')]?_0x2fac23['options'][_0x6e4b('0x1c')]?_['map'](_0x2fac23[_0x6e4b('0x17')][_0x6e4b('0x1c')],function(_0x5f500c){return{'model':db[_0x5f500c[_0x6e4b('0x1d')]],'as':_0x5f500c['as'],'attributes':_0x5f500c['attributes'],'include':_0x5f500c[_0x6e4b('0x1c')]?_[_0x6e4b('0x22')](_0x5f500c['include'],function(_0x3e7b19){return{'model':db[_0x3e7b19[_0x6e4b('0x1d')]],'as':_0x3e7b19['as'],'attributes':_0x3e7b19['attributes'],'include':_0x3e7b19[_0x6e4b('0x1c')]?_[_0x6e4b('0x22')](_0x3e7b19[_0x6e4b('0x1c')],function(_0x1baa46){return{'model':db[_0x1baa46[_0x6e4b('0x1d')]],'as':_0x1baa46['as'],'attributes':_0x1baa46[_0x6e4b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6e4b('0x1e')](function(_0x4d890b){logger['info'](_0x6e4b('0x21'),_0x2fac23);logger[_0x6e4b('0x1f')](_0x6e4b('0x21'),_0x2fac23,JSON[_0x6e4b('0xf')](_0x4d890b));_0x52d9ca(_0x4d890b);})[_0x6e4b('0x20')](function(_0x51de2a){logger[_0x6e4b('0x10')](_0x6e4b('0x21'),_0x51de2a[_0x6e4b('0x12')],_0x2fac23);_0xa251c3(_0x33910a[_0x6e4b('0x10')](0x1f4,_0x51de2a[_0x6e4b('0x12')]));});});};exports['CreateCmHopper']=function(_0x3dae7a){var _0x41f264=this;return new Promise(function(_0x451ec0,_0x1acee7){return db['CmHopper'][_0x6e4b('0x23')](_0x3dae7a[_0x6e4b('0x24')],{'raw':_0x3dae7a[_0x6e4b('0x17')]?_0x3dae7a[_0x6e4b('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x6e4b('0x1e')](function(_0x29939b){logger['info']('CreateCmHopper',_0x3dae7a);logger[_0x6e4b('0x1f')](_0x6e4b('0x25'),_0x3dae7a,JSON['stringify'](_0x29939b));_0x451ec0(_0x29939b);})[_0x6e4b('0x20')](function(_0x561c2a){logger[_0x6e4b('0x10')](_0x6e4b('0x25'),_0x561c2a[_0x6e4b('0x12')],_0x3dae7a);_0x1acee7(_0x41f264[_0x6e4b('0x10')](0x1f4,_0x561c2a[_0x6e4b('0x12')]));});});};exports['UpdateCmHopper']=function(_0x58ae18){var _0x53afa1=this;return new Promise(function(_0x46e086,_0x218dfc){return db[_0x6e4b('0x15')]['update'](_0x58ae18[_0x6e4b('0x24')],{'raw':_0x58ae18[_0x6e4b('0x17')]?_0x58ae18[_0x6e4b('0x17')][_0x6e4b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58ae18[_0x6e4b('0x17')]?_0x58ae18[_0x6e4b('0x17')][_0x6e4b('0x19')]||null:null,'attributes':_0x58ae18[_0x6e4b('0x17')]?_0x58ae18['options'][_0x6e4b('0x1a')]||null:null,'limit':_0x58ae18[_0x6e4b('0x17')]?_0x58ae18[_0x6e4b('0x17')]['limit']||null:null})[_0x6e4b('0x1e')](function(_0x2c51af){logger[_0x6e4b('0xb')]('UpdateCmHopper',_0x58ae18);logger[_0x6e4b('0xb')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x6e4b('0xf')](_0x58ae18[_0x6e4b('0x17')][_0x6e4b('0x19')]),_0x58ae18[_0x6e4b('0x24')][_0x6e4b('0x26')]);logger['debug'](_0x6e4b('0x27'),_0x58ae18,JSON['stringify'](_0x2c51af));_0x46e086(_0x2c51af);})[_0x6e4b('0x20')](function(_0x39c80d){logger[_0x6e4b('0x10')](_0x6e4b('0x27'),_0x39c80d['message'],_0x58ae18);_0x218dfc(_0x53afa1['error'](0x1f4,_0x39c80d[_0x6e4b('0x12')]));});});};exports['DestroyCmHopper']=function(_0x23a92f){var _0x1ae919=this;return new Promise(function(_0x5c7247,_0x45d701){return db[_0x6e4b('0x15')][_0x6e4b('0x28')]({'where':_0x23a92f[_0x6e4b('0x17')]?_0x23a92f['options'][_0x6e4b('0x19')]||null:null})['then'](function(_0xc0dd07){logger[_0x6e4b('0xb')](_0x6e4b('0x29'),_0x23a92f);logger['debug']('DestroyCmHopper',_0x23a92f,JSON['stringify'](_0xc0dd07));_0x5c7247(_0xc0dd07);})[_0x6e4b('0x20')](function(_0x2ab5c4){logger[_0x6e4b('0x10')](_0x6e4b('0x29'),_0x2ab5c4[_0x6e4b('0x12')],_0x23a92f);_0x45d701(_0x1ae919['error'](0x1f4,_0x2ab5c4[_0x6e4b('0x12')]));});});};exports[_0x6e4b('0x2a')]=function(_0x3e21f8){var _0x2891b1=this;return new Promise(function(_0xc6fdc,_0x17a3ba){return db[_0x6e4b('0x2b')][_0x6e4b('0x2c')]()[_0x6e4b('0x1e')](function(_0x16058f){return db[_0x6e4b('0x2d')][_0x6e4b('0x2e')](function(_0x19a1a9){return db[_0x6e4b('0x15')][_0x6e4b('0x16')]({'where':_0x3e21f8['options']?_0x3e21f8['options'][_0x6e4b('0x19')]||null:null,'attributes':_0x3e21f8[_0x6e4b('0x17')]?_0x3e21f8['options'][_0x6e4b('0x1a')]||null:null,'limit':_0x3e21f8['options']?_0x3e21f8[_0x6e4b('0x17')][_0x6e4b('0x1b')]||null:null,'order':_0x3e21f8[_0x6e4b('0x17')]?_0x3e21f8[_0x6e4b('0x17')][_0x6e4b('0x2f')]||null:null,'transaction':_0x19a1a9,'lock':_0x19a1a9[_0x6e4b('0x30')][_0x6e4b('0x31')],'include':[{'model':db[_0x6e4b('0x2b')],'as':_0x6e4b('0x32'),'attributes':_[_0x6e4b('0x33')](_0x16058f)},{'model':db['User'],'as':_0x6e4b('0x34'),'attributes':['id','name',_0x6e4b('0x35')]}]})['then'](function(_0x573db8){var _0x3534c5=[];var _0x366188=[];for(var _0x50e7f9=0x0;_0x50e7f9<_0x573db8[_0x6e4b('0x36')];_0x50e7f9+=0x1){var _0x340fa0=_0x573db8[_0x50e7f9]['UserId'];if(_0x340fa0===null){_0x3534c5[_0x6e4b('0x37')](_0x573db8[_0x50e7f9][_0x6e4b('0x38')](_0x3e21f8[_0x6e4b('0x24')],{'transaction':_0x19a1a9}));}else if(!_0x366188[_0x6e4b('0x39')](_0x340fa0)){_0x366188['push'](_0x340fa0);_0x3534c5[_0x6e4b('0x37')](_0x573db8[_0x50e7f9]['update'](_0x3e21f8[_0x6e4b('0x24')],{'transaction':_0x19a1a9}));}}return BPromise['all'](_0x3534c5);});})[_0x6e4b('0x1e')](function(_0x52caa0){logger[_0x6e4b('0xb')](_0x6e4b('0x2a'),_0x3e21f8);if(_0x52caa0[_0x6e4b('0x36')]>0x0){logger['info'](_0x6e4b('0x3a'),_0x52caa0[0x0][_0x6e4b('0x3b')]['id'],_0x52caa0[0x0][_0x6e4b('0x3b')][_0x6e4b('0x3c')],_0x52caa0[0x0]['dataValues']['active']);}logger[_0x6e4b('0x1f')](_0x6e4b('0x2a'),_0x3e21f8,JSON[_0x6e4b('0xf')](_0x52caa0));_0xc6fdc(_0x52caa0);})[_0x6e4b('0x20')](function(_0x5f0921){logger['error'](_0x6e4b('0x2a'),_0x5f0921[_0x6e4b('0x12')],_0x3e21f8);_0x17a3ba(_0x2891b1[_0x6e4b('0x10')](0x1f4,_0x5f0921[_0x6e4b('0x12')]));});});});};exports['MoveContactManagedDialer']=function(_0x92f84){var _0x32d788=this;return new Promise(function(_0x1a9830,_0x2590c6){return db[_0x6e4b('0x2d')][_0x6e4b('0x2e')](function(_0xc82751){return db[_0x6e4b('0x3d')][_0x6e4b('0x23')](_0x92f84[_0x6e4b('0x24')],{'raw':_0x92f84[_0x6e4b('0x17')]?_0x92f84['options']['raw']===undefined?!![]:![]:!![],'transaction':_0xc82751})[_0x6e4b('0x1e')](function(){logger['info'](_0x6e4b('0x3e'),JSON[_0x6e4b('0xf')](_0x92f84[_0x6e4b('0x17')][_0x6e4b('0x19')]),_0x92f84[_0x6e4b('0x17')][_0x6e4b('0x19')]['active']);return db[_0x6e4b('0x15')][_0x6e4b('0x28')]({'where':_0x92f84['options']?_0x92f84[_0x6e4b('0x17')][_0x6e4b('0x19')]||null:null,'transaction':_0xc82751});});})['then'](function(_0x4e9292){logger[_0x6e4b('0xb')](_0x6e4b('0x3f'),_0x92f84);logger[_0x6e4b('0x1f')](_0x6e4b('0x3f'),_0x92f84,JSON[_0x6e4b('0xf')](_0x4e9292));_0x1a9830(_0x4e9292);})['catch'](function(_0x492a80){logger[_0x6e4b('0x10')]('MoveContactManagedDialer',_0x492a80[_0x6e4b('0x12')],_0x92f84);_0x2590c6(_0x32d788[_0x6e4b('0x10')](0x1f4,_0x492a80[_0x6e4b('0x12')]));});});};exports[_0x6e4b('0x40')]=function(_0x3ede13){var _0x2c2d02=this;return new Promise(function(_0x38eb75,_0x177967){return db[_0x6e4b('0x15')]['findAll']({'raw':_0x3ede13[_0x6e4b('0x17')]?_0x3ede13[_0x6e4b('0x17')][_0x6e4b('0x18')]===undefined?!![]:![]:!![],'where':_0x3ede13[_0x6e4b('0x17')]?_0x3ede13[_0x6e4b('0x17')][_0x6e4b('0x19')]||null:null,'attributes':[[db[_0x6e4b('0x2d')]['fn']('COUNT',db[_0x6e4b('0x2d')]['fn']('IF',db[_0x6e4b('0x2d')][_0x6e4b('0x41')](_0x6e4b('0x42')+util[_0x6e4b('0x43')](_0x6e4b('0x44'),moment()[_0x6e4b('0x43')](_0x6e4b('0x45')))+_0x6e4b('0x46')))),_0x6e4b('0x47')]]})[_0x6e4b('0x1e')](function(_0xe2fabb){logger[_0x6e4b('0xb')](_0x6e4b('0x40'),_0x3ede13);logger[_0x6e4b('0x1f')](_0x6e4b('0x40'),_0x3ede13,JSON['stringify'](_0xe2fabb));_0x38eb75(_0xe2fabb);})[_0x6e4b('0x20')](function(_0xc439df){logger[_0x6e4b('0x10')](_0x6e4b('0x40'),_0xc439df[_0x6e4b('0x12')],_0x3ede13);_0x177967(_0x2c2d02[_0x6e4b('0x10')](0x1f4,_0xc439df[_0x6e4b('0x12')]));});});};exports['GetContactRecallMe']=function(_0x172c27){var _0x438a12=this;return new Promise(function(_0x4950aa,_0x1cd5b4){return db['CmContact'][_0x6e4b('0x2c')]()[_0x6e4b('0x1e')](function(_0x36a4eb){return db[_0x6e4b('0x2d')][_0x6e4b('0x2e')](function(_0x5e084e){return db['CmHopper'][_0x6e4b('0x16')]({'where':_0x172c27[_0x6e4b('0x17')]?_0x172c27['options'][_0x6e4b('0x19')]||null:null,'attributes':_0x172c27[_0x6e4b('0x17')]?_0x172c27['options'][_0x6e4b('0x1a')]||null:null,'limit':0x1,'order':_0x172c27['options']?_0x172c27['options'][_0x6e4b('0x2f')]||null:null,'group':db[_0x6e4b('0x15')]['UserId'],'transaction':_0x5e084e,'lock':_0x5e084e[_0x6e4b('0x30')][_0x6e4b('0x31')],'include':_0x172c27[_0x6e4b('0x17')]?_0x172c27[_0x6e4b('0x17')]['include']?_[_0x6e4b('0x22')](_0x172c27[_0x6e4b('0x17')][_0x6e4b('0x1c')],function(_0x68a8a4){return{'model':db[_0x68a8a4[_0x6e4b('0x1d')]],'as':_0x68a8a4['as'],'attributes':_0x68a8a4['attributes'],'include':_0x68a8a4[_0x6e4b('0x1c')]?_[_0x6e4b('0x22')](_0x68a8a4[_0x6e4b('0x1c')],function(_0x47c8c7){return{'model':db[_0x47c8c7[_0x6e4b('0x1d')]],'as':_0x47c8c7['as'],'attributes':_0x47c8c7[_0x6e4b('0x1a')],'include':_0x47c8c7[_0x6e4b('0x1c')]?_[_0x6e4b('0x22')](_0x47c8c7[_0x6e4b('0x1c')],function(_0x305214){return{'model':db[_0x305214[_0x6e4b('0x1d')]],'as':_0x305214['as'],'attributes':_0x305214['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e4b('0x1e')](function(_0x3311d3){var _0x490f38=[];for(var _0x23caf7=0x0;_0x23caf7<_0x3311d3[_0x6e4b('0x36')];_0x23caf7+=0x1){_0x490f38['push'](_0x3311d3[_0x23caf7][_0x6e4b('0x38')](_0x172c27[_0x6e4b('0x24')],{'transaction':_0x5e084e}));}return BPromise[_0x6e4b('0x48')](_0x490f38);});})['then'](function(_0x3f4f91){logger['info'](_0x6e4b('0x49'),_0x172c27);logger[_0x6e4b('0x1f')](_0x6e4b('0x49'),_0x172c27,JSON[_0x6e4b('0xf')](_0x3f4f91));_0x4950aa(_0x3f4f91);})[_0x6e4b('0x20')](function(_0x177645){logger['error'](_0x6e4b('0x49'),_0x177645['message'],_0x172c27);_0x1cd5b4(_0x438a12[_0x6e4b('0x10')](0x1f4,_0x177645[_0x6e4b('0x12')]));});});});};exports[_0x6e4b('0x4a')]=function(_0x1ac30e){var _0xe008eb=this;return new Promise(function(_0x4e696c,_0x57189e){db['CmContact']['describe']()[_0x6e4b('0x1e')](function(_0x2d24b1){return db[_0x6e4b('0x15')]['findAll']({'raw':_0x1ac30e[_0x6e4b('0x17')]?_0x1ac30e[_0x6e4b('0x17')][_0x6e4b('0x18')]===undefined?!![]:![]:!![],'where':_0x1ac30e[_0x6e4b('0x17')]?_0x1ac30e[_0x6e4b('0x17')][_0x6e4b('0x19')]||null:null,'attributes':_0x1ac30e['options']?_0x1ac30e[_0x6e4b('0x17')][_0x6e4b('0x1a')]||null:null,'limit':_0x1ac30e[_0x6e4b('0x17')]?_0x1ac30e[_0x6e4b('0x17')]['limit']||null:null,'include':_0x1ac30e[_0x6e4b('0x17')]?_0x1ac30e[_0x6e4b('0x17')][_0x6e4b('0x1c')]?_[_0x6e4b('0x22')](_0x1ac30e[_0x6e4b('0x17')][_0x6e4b('0x1c')],function(_0x5bcd9e){return{'model':db[_0x5bcd9e['model']],'as':_0x5bcd9e['as'],'attributes':_0x5bcd9e['as']==='Contact'?_[_0x6e4b('0x33')](_0x2d24b1):_0x5bcd9e[_0x6e4b('0x1a')],'include':_0x5bcd9e[_0x6e4b('0x1c')]?_[_0x6e4b('0x22')](_0x5bcd9e[_0x6e4b('0x1c')],function(_0x94d3c2){return{'model':db[_0x94d3c2[_0x6e4b('0x1d')]],'as':_0x94d3c2['as'],'attributes':_0x94d3c2[_0x6e4b('0x1a')],'include':_0x94d3c2[_0x6e4b('0x1c')]?_[_0x6e4b('0x22')](_0x94d3c2[_0x6e4b('0x1c')],function(_0x391c59){return{'model':db[_0x391c59[_0x6e4b('0x1d')]],'as':_0x391c59['as'],'attributes':_0x391c59['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e4b('0x1e')](function(_0x2c3cd8){logger[_0x6e4b('0xb')](_0x6e4b('0x14'),_0x1ac30e);logger[_0x6e4b('0x1f')](_0x6e4b('0x14'),_0x1ac30e,JSON[_0x6e4b('0xf')](_0x2c3cd8));_0x4e696c(_0x2c3cd8);})[_0x6e4b('0x20')](function(_0x27a04c){logger[_0x6e4b('0x10')]('GetCmHopper',_0x27a04c['message'],_0x1ac30e);_0x57189e(_0xe008eb[_0x6e4b('0x10')](0x1f4,_0x27a04c[_0x6e4b('0x12')]));});});});};exports[_0x6e4b('0x4b')]=function(_0x302c64){var _0x57fa5a=this;return new Promise(function(_0x4fa417,_0x36c746){return db[_0x6e4b('0x2b')][_0x6e4b('0x4c')]({'raw':!![],'where':{'phone':_0x302c64[_0x6e4b('0x17')][_0x6e4b('0x19')]['phone']},'attributes':['id',_0x6e4b('0x4d')],'order':[['id',_0x6e4b('0x4e')]]})[_0x6e4b('0x1e')](function(_0x493331){logger['info'](_0x6e4b('0x4f'),_0x302c64);logger[_0x6e4b('0x1f')]('getContactByPhone',_0x302c64,JSON['stringify'](_0x493331));_0x4fa417(_0x493331);})['catch'](function(_0x5c2497){logger[_0x6e4b('0x10')](_0x6e4b('0x4f'),_0x5c2497[_0x6e4b('0x12')],_0x302c64);_0x36c746(_0x57fa5a[_0x6e4b('0x10')](0x1f4,_0x5c2497['message']));});});};exports[_0x6e4b('0x50')]=function(_0x4556d7){var _0x313e59=this;return new Promise(function(_0x12d118,_0x1ecb08){return db[_0x6e4b('0x2d')][_0x6e4b('0x2e')](function(_0x4c674c){return db[_0x6e4b('0x15')][_0x6e4b('0x38')]({'active':![]},{'where':{},'transaction':_0x4c674c})[_0x6e4b('0x1e')](function(_0x4de93a){logger[_0x6e4b('0xb')](_0x6e4b('0x50'),_0x4556d7);logger['debug'](_0x6e4b('0x50'),_0x4556d7,JSON[_0x6e4b('0xf')](_0x4de93a));_0x12d118(_0x4de93a);})['catch'](function(_0x272fd9){logger[_0x6e4b('0x10')](_0x6e4b('0x50'),_0x272fd9[_0x6e4b('0x12')],_0x4556d7);_0x1ecb08(_0x313e59[_0x6e4b('0x10')](0x1f4,_0x272fd9[_0x6e4b('0x12')]));});});});};exports[_0x6e4b('0x51')]=function(_0x62796c){var _0x44f645=this;var _0x2cb25a=_0x62796c[_0x6e4b('0x24')][_0x6e4b('0x19')]['voiceQueueId'];var _0x4adf40=_0x62796c[_0x6e4b('0x24')]['where'][_0x6e4b('0x52')];return new Promise(function(_0x21b990,_0x63135){return db[_0x6e4b('0x15')][_0x6e4b('0x16')]({'where':{'voiceQueueId':_0x2cb25a,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x6e4b('0x2d')][_0x6e4b('0x41')]('NOW()\x20+\x20INTERVAL\x20'+_0x4adf40+_0x6e4b('0x53'))}},'include':[{'model':db[_0x6e4b('0x2b')],'as':_0x6e4b('0x32')},{'model':db[_0x6e4b('0x54')],'as':'Agent','attributes':['id','name','voicePause']},{'model':db[_0x6e4b('0x55')],'as':_0x6e4b('0x56')}]})[_0x6e4b('0x1e')](function(_0x2cfe45){return db['sequelize'][_0x6e4b('0x2e')](function(_0x432afb){return db[_0x6e4b('0x15')][_0x6e4b('0x38')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x2cb25a,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x6e4b('0x41')](_0x6e4b('0x57')+_0x4adf40+_0x6e4b('0x53'))}},'transaction':_0x432afb})[_0x6e4b('0x1e')](function(_0x2dc622){_0x21b990(_0x2cfe45);})[_0x6e4b('0x20')](function(_0x3c8bcd){logger[_0x6e4b('0x10')]('CmHopperHandlePreviewRecallNotifications',_0x3c8bcd[_0x6e4b('0x12')],_0x62796c);_0x63135(validateExpressRequest);});});})[_0x6e4b('0x20')](function(_0x441ce5){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x441ce5[_0x6e4b('0x12')],_0x62796c);_0x63135(_0x44f645[_0x6e4b('0x10')](0x1f4,_0x441ce5[_0x6e4b('0x12')]));});});};
\ No newline at end of file
index d067df7..dbb88ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b39=['getPreviewRecall','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','getOpenContacts','getTimezones','/:id','create','post','getPreview','/previewrecall'];(function(_0x5b7e2e,_0x689e00){var _0x31c1a2=function(_0x2c2949){while(--_0x2c2949){_0x5b7e2e['push'](_0x5b7e2e['shift']());}};_0x31c1a2(++_0x689e00);}(_0x2b39,0xae));var _0x92b3=function(_0x3b1a8a,_0x3c4177){_0x3b1a8a=_0x3b1a8a-0x0;var _0x4f8b9e=_0x2b39[_0x3b1a8a];return _0x4f8b9e;};'use strict';var multer=require(_0x92b3('0x0'));var util=require('util');var path=require(_0x92b3('0x1'));var timeout=require(_0x92b3('0x2'));var express=require(_0x92b3('0x3'));var router=express[_0x92b3('0x4')]();var fs_extra=require(_0x92b3('0x5'));var auth=require(_0x92b3('0x6'));var interaction=require(_0x92b3('0x7'));var config=require(_0x92b3('0x8'));var controller=require(_0x92b3('0x9'));router[_0x92b3('0xa')]('/',auth['isAuthenticated'](),controller[_0x92b3('0xb')]);router['get'](_0x92b3('0xc'),auth[_0x92b3('0xd')](),controller[_0x92b3('0xe')]);router[_0x92b3('0xa')]('/opencontacts',auth[_0x92b3('0xd')](),controller[_0x92b3('0xf')]);router[_0x92b3('0xa')]('/timezones',auth['isAuthenticated'](),controller[_0x92b3('0x10')]);router[_0x92b3('0xa')](_0x92b3('0x11'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x92b3('0x12')]);router[_0x92b3('0x13')]('/preview',auth[_0x92b3('0xd')](),controller[_0x92b3('0x14')]);router[_0x92b3('0x13')]('/timezone',auth['isAuthenticated'](),controller['getTimezone']);router[_0x92b3('0x13')](_0x92b3('0x15'),auth[_0x92b3('0xd')](),controller[_0x92b3('0x16')]);router[_0x92b3('0x17')](_0x92b3('0x11'),auth['isAuthenticated'](),controller[_0x92b3('0x18')]);router[_0x92b3('0x19')](_0x92b3('0x11'),auth[_0x92b3('0xd')](),controller[_0x92b3('0x1a')]);module[_0x92b3('0x1b')]=router;
\ No newline at end of file
+var _0xbc1b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','post','create','/preview','getPreview','/timezone','/previewrecall','getPreviewRecall','put','update'];(function(_0x6bb390,_0x5d249a){var _0xaf9b54=function(_0x1218d2){while(--_0x1218d2){_0x6bb390['push'](_0x6bb390['shift']());}};_0xaf9b54(++_0x5d249a);}(_0xbc1b,0x1e3));var _0xbbc1=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xbc1b[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0xbbc1('0x0'));var util=require(_0xbbc1('0x1'));var path=require(_0xbbc1('0x2'));var timeout=require(_0xbbc1('0x3'));var express=require(_0xbbc1('0x4'));var router=express[_0xbbc1('0x5')]();var fs_extra=require(_0xbbc1('0x6'));var auth=require(_0xbbc1('0x7'));var interaction=require(_0xbbc1('0x8'));var config=require(_0xbbc1('0x9'));var controller=require('./cmHopper.controller');router[_0xbbc1('0xa')]('/',auth['isAuthenticated'](),controller[_0xbbc1('0xb')]);router[_0xbbc1('0xa')](_0xbbc1('0xc'),auth[_0xbbc1('0xd')](),controller[_0xbbc1('0xe')]);router[_0xbbc1('0xa')](_0xbbc1('0xf'),auth['isAuthenticated'](),controller[_0xbbc1('0x10')]);router[_0xbbc1('0xa')](_0xbbc1('0x11'),auth[_0xbbc1('0xd')](),controller[_0xbbc1('0x12')]);router['get'](_0xbbc1('0x13'),auth[_0xbbc1('0xd')](),controller['show']);router[_0xbbc1('0x14')]('/',auth['isAuthenticated'](),controller[_0xbbc1('0x15')]);router[_0xbbc1('0x14')](_0xbbc1('0x16'),auth['isAuthenticated'](),controller[_0xbbc1('0x17')]);router[_0xbbc1('0x14')](_0xbbc1('0x18'),auth['isAuthenticated'](),controller['getTimezone']);router[_0xbbc1('0x14')](_0xbbc1('0x19'),auth[_0xbbc1('0xd')](),controller[_0xbbc1('0x1a')]);router[_0xbbc1('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xbbc1('0x1c')]);router[_0xbbc1('0x1d')](_0xbbc1('0x13'),auth[_0xbbc1('0xd')](),controller[_0xbbc1('0x1e')]);module[_0xbbc1('0x1f')]=router;
\ No newline at end of file
index f7c2e9f..aa0af36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06f1=['moment','sequelize','exports','INTEGER','contactListQueue'];(function(_0xe33b12,_0x2a9761){var _0x30699d=function(_0x209952){while(--_0x209952){_0xe33b12['push'](_0xe33b12['shift']());}};_0x30699d(++_0x2a9761);}(_0x06f1,0x6e));var _0x106f=function(_0x329ce8,_0x49d7c8){_0x329ce8=_0x329ce8-0x0;var _0x452a2e=_0x06f1[_0x329ce8];return _0x452a2e;};'use strict';var moment=require(_0x106f('0x0'));var Sequelize=require(_0x106f('0x1'));module[_0x106f('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x106f('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x106f('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x106f('0x4')}};
\ No newline at end of file
+var _0xfdb3=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0xfdb3,0x10c));var _0x3fdb=function(_0x2eaebc,_0x398f86){_0x2eaebc=_0x2eaebc-0x0;var _0x580e51=_0xfdb3[_0x2eaebc];return _0x580e51;};'use strict';var moment=require(_0x3fdb('0x0'));var Sequelize=require(_0x3fdb('0x1'));module['exports']={'phone':{'type':Sequelize[_0x3fdb('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x3fdb('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x3fdb('0x3')],'unique':_0x3fdb('0x4')}};
\ No newline at end of file
index 5930986..ce6a078 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4dc=['status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','end','name','send','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','CmHopperBlack','count','include','rows','show','rawAttributes','includeAll','catch','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x34125d,_0x5857fd){var _0x4dfce9=function(_0xbad638){while(--_0xbad638){_0x34125d['push'](_0x34125d['shift']());}};_0x4dfce9(++_0x5857fd);}(_0xc4dc,0x19c));var _0xcc4d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc4dc[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xcc4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc4d('0x1'));var jsonpatch=require(_0xcc4d('0x2'));var rp=require(_0xcc4d('0x3'));var moment=require(_0xcc4d('0x4'));var BPromise=require(_0xcc4d('0x5'));var Mustache=require(_0xcc4d('0x6'));var util=require(_0xcc4d('0x7'));var path=require('path');var sox=require(_0xcc4d('0x8'));var csv=require('to-csv');var ejs=require(_0xcc4d('0x9'));var fs=require('fs');var fs_extra=require(_0xcc4d('0xa'));var _=require(_0xcc4d('0xb'));var squel=require(_0xcc4d('0xc'));var crypto=require('crypto');var jsforce=require(_0xcc4d('0xd'));var deskjs=require(_0xcc4d('0xe'));var toCsv=require(_0xcc4d('0xf'));var querystring=require(_0xcc4d('0x10'));var Papa=require('papaparse');var Redis=require(_0xcc4d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcc4d('0x12'));var as=require(_0xcc4d('0x13'));var hardwareService=require(_0xcc4d('0x14'));var logger=require(_0xcc4d('0x15'))(_0xcc4d('0x16'));var utils=require('../../config/utils');var config=require(_0xcc4d('0x17'));var licenseUtil=require(_0xcc4d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50328c,_0x31d43b){_0x31d43b=_0x31d43b||0xcc;return function(_0x5b5a56){if(_0x5b5a56){return _0x50328c[_0xcc4d('0x19')](_0x31d43b);}return _0x50328c[_0xcc4d('0x1a')](_0x31d43b)['end']();};}function respondWithResult(_0x73c132,_0x32a676){_0x32a676=_0x32a676||0xc8;return function(_0x9c55fc){if(_0x9c55fc){return _0x73c132[_0xcc4d('0x1a')](_0x32a676)[_0xcc4d('0x1b')](_0x9c55fc);}};}function respondWithFilteredResult(_0x5387a9,_0x4469df){return function(_0xa8d4e9){if(_0xa8d4e9){var _0x314803=typeof _0x4469df[_0xcc4d('0x1c')]===_0xcc4d('0x1d')&&typeof _0x4469df[_0xcc4d('0x1e')]===_0xcc4d('0x1d');var _0x763e6=_0xa8d4e9['count'];var _0x43d591=_0x314803?0x0:_0x4469df[_0xcc4d('0x1c')];var _0x270a34=_0x314803?_0xa8d4e9['count']:_0x4469df['offset']+_0x4469df[_0xcc4d('0x1e')];var _0x306937;if(_0x270a34>=_0x763e6){_0x270a34=_0x763e6;_0x306937=0xc8;}else{_0x306937=0xce;}_0x5387a9[_0xcc4d('0x1a')](_0x306937);return _0x5387a9[_0xcc4d('0x1f')](_0xcc4d('0x20'),_0x43d591+'-'+_0x270a34+'/'+_0x763e6)[_0xcc4d('0x1b')](_0xa8d4e9);}return null;};}function patchUpdates(_0x5c0db8){return function(_0x569aef){try{jsonpatch[_0xcc4d('0x21')](_0x569aef,_0x5c0db8,!![]);}catch(_0x1a8b8f){return BPromise['reject'](_0x1a8b8f);}return _0x569aef[_0xcc4d('0x22')]();};}function saveUpdates(_0x25bb51,_0x114787){return function(_0x5dd99e){if(_0x5dd99e){return _0x5dd99e[_0xcc4d('0x23')](_0x25bb51)[_0xcc4d('0x24')](function(_0x4f367a){return _0x4f367a;});}return null;};}function removeEntity(_0x231b77,_0x371120){return function(_0xe8a7b2){if(_0xe8a7b2){return _0xe8a7b2['destroy']()[_0xcc4d('0x24')](function(){_0x231b77[_0xcc4d('0x1a')](0xcc)[_0xcc4d('0x25')]();});}};}function handleEntityNotFound(_0x51e22d,_0x1124e5){return function(_0xd7e3e2){if(!_0xd7e3e2){_0x51e22d[_0xcc4d('0x19')](0x194);}return _0xd7e3e2;};}function handleError(_0x50f99c,_0x41fd38){_0x41fd38=_0x41fd38||0x1f4;return function(_0x2cbfb5){logger['error'](_0x2cbfb5['stack']);if(_0x2cbfb5[_0xcc4d('0x26')]){delete _0x2cbfb5[_0xcc4d('0x26')];}_0x50f99c['status'](_0x41fd38)[_0xcc4d('0x27')](_0x2cbfb5);};}exports['index']=function(_0x47a166,_0x5f0f46){var _0x54d711={},_0x5c19f5={},_0x52ab7b={'count':0x0,'rows':[]};var _0x2de157=_[_0xcc4d('0x28')](db['CmHopperBlack']['rawAttributes'],function(_0x18e847){return{'name':_0x18e847[_0xcc4d('0x29')],'type':_0x18e847['type'][_0xcc4d('0x2a')]};});_0x5c19f5[_0xcc4d('0x2b')]=_[_0xcc4d('0x28')](_0x2de157,_0xcc4d('0x26'));_0x5c19f5[_0xcc4d('0x2c')]=_[_0xcc4d('0x2d')](_0x47a166[_0xcc4d('0x2c')]);_0x5c19f5[_0xcc4d('0x2e')]=_['intersection'](_0x5c19f5[_0xcc4d('0x2b')],_0x5c19f5[_0xcc4d('0x2c')]);_0x54d711[_0xcc4d('0x2f')]=_[_0xcc4d('0x30')](_0x5c19f5[_0xcc4d('0x2b')],qs[_0xcc4d('0x31')](_0x47a166['query'][_0xcc4d('0x31')]));_0x54d711['attributes']=_0x54d711[_0xcc4d('0x2f')][_0xcc4d('0x32')]?_0x54d711[_0xcc4d('0x2f')]:_0x5c19f5[_0xcc4d('0x2b')];if(!_0x47a166[_0xcc4d('0x2c')][_0xcc4d('0x33')](_0xcc4d('0x34'))){_0x54d711[_0xcc4d('0x1e')]=qs['limit'](_0x47a166[_0xcc4d('0x2c')]['limit']);_0x54d711[_0xcc4d('0x1c')]=qs[_0xcc4d('0x1c')](_0x47a166[_0xcc4d('0x2c')][_0xcc4d('0x1c')]);}_0x54d711[_0xcc4d('0x35')]=qs[_0xcc4d('0x36')](_0x47a166[_0xcc4d('0x2c')]['sort']);_0x54d711[_0xcc4d('0x37')]=qs[_0xcc4d('0x2e')](_[_0xcc4d('0x38')](_0x47a166[_0xcc4d('0x2c')],_0x5c19f5[_0xcc4d('0x2e')]),_0x2de157);if(_0x47a166[_0xcc4d('0x2c')][_0xcc4d('0x39')]){_0x54d711[_0xcc4d('0x37')]=_[_0xcc4d('0x3a')](_0x54d711[_0xcc4d('0x37')],{'$or':_[_0xcc4d('0x28')](_0x2de157,function(_0x1c2fee){if(_0x1c2fee[_0xcc4d('0x3b')]!==_0xcc4d('0x3c')){var _0x473833={};_0x473833[_0x1c2fee[_0xcc4d('0x26')]]={'$like':'%'+_0x47a166['query'][_0xcc4d('0x39')]+'%'};return _0x473833;}})});}_0x54d711=_[_0xcc4d('0x3a')]({},_0x54d711,_0x47a166['options']);var _0x519dca={'where':_0x54d711['where']};return db[_0xcc4d('0x3d')][_0xcc4d('0x3e')](_0x519dca)[_0xcc4d('0x24')](function(_0x325c42){_0x52ab7b[_0xcc4d('0x3e')]=_0x325c42;if(_0x47a166[_0xcc4d('0x2c')]['includeAll']){_0x54d711[_0xcc4d('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x54d711);})['then'](function(_0x374b1e){_0x52ab7b[_0xcc4d('0x40')]=_0x374b1e;return _0x52ab7b;})['then'](respondWithFilteredResult(_0x5f0f46,_0x54d711))['catch'](handleError(_0x5f0f46,null));};exports[_0xcc4d('0x41')]=function(_0x50339f,_0x30f6a4){var _0x392b05={'raw':!![],'where':{'id':_0x50339f['params']['id']}},_0x454ee0={};_0x454ee0[_0xcc4d('0x2b')]=_[_0xcc4d('0x2d')](db[_0xcc4d('0x3d')][_0xcc4d('0x42')]);_0x454ee0[_0xcc4d('0x2c')]=_[_0xcc4d('0x2d')](_0x50339f['query']);_0x454ee0[_0xcc4d('0x2e')]=_[_0xcc4d('0x30')](_0x454ee0[_0xcc4d('0x2b')],_0x454ee0['query']);_0x392b05['attributes']=_[_0xcc4d('0x30')](_0x454ee0[_0xcc4d('0x2b')],qs['fields'](_0x50339f['query']['fields']));_0x392b05[_0xcc4d('0x2f')]=_0x392b05[_0xcc4d('0x2f')][_0xcc4d('0x32')]?_0x392b05[_0xcc4d('0x2f')]:_0x454ee0['model'];if(_0x50339f[_0xcc4d('0x2c')][_0xcc4d('0x43')]){_0x392b05[_0xcc4d('0x3f')]=[{'all':!![]}];}_0x392b05=_[_0xcc4d('0x3a')]({},_0x392b05,_0x50339f['options']);return db[_0xcc4d('0x3d')]['find'](_0x392b05)['then'](handleEntityNotFound(_0x30f6a4,null))[_0xcc4d('0x24')](respondWithResult(_0x30f6a4,null))[_0xcc4d('0x44')](handleError(_0x30f6a4,null));};exports[_0xcc4d('0x23')]=function(_0x3533d5,_0x26cc15){if(_0x3533d5[_0xcc4d('0x45')]['id']){delete _0x3533d5[_0xcc4d('0x45')]['id'];}return db['CmHopperBlack'][_0xcc4d('0x46')]({'where':{'id':_0x3533d5[_0xcc4d('0x47')]['id']}})[_0xcc4d('0x24')](handleEntityNotFound(_0x26cc15,null))[_0xcc4d('0x24')](saveUpdates(_0x3533d5[_0xcc4d('0x45')],null))[_0xcc4d('0x24')](respondWithResult(_0x26cc15,null))[_0xcc4d('0x44')](handleError(_0x26cc15,null));};exports['destroy']=function(_0x7ca7fb,_0x37d7d4){return db[_0xcc4d('0x3d')][_0xcc4d('0x46')]({'where':{'id':_0x7ca7fb[_0xcc4d('0x47')]['id']}})['then'](handleEntityNotFound(_0x37d7d4,null))['then'](removeEntity(_0x37d7d4,null))[_0xcc4d('0x44')](handleError(_0x37d7d4,null));};exports[_0xcc4d('0x48')]=function(_0x1d22ad,_0x1064f2){return db[_0xcc4d('0x3d')]['describe']()[_0xcc4d('0x24')](respondWithResult(_0x1064f2,null))[_0xcc4d('0x44')](handleError(_0x1064f2,null));};
\ No newline at end of file
+var _0x2041=['intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperBlack','include','findAll','rows','show','params','fields','includeAll','find','catch','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','then','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','keys','filters'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x2041,0x10d));var _0x1204=function(_0x2d7055,_0x219e5e){_0x2d7055=_0x2d7055-0x0;var _0x543292=_0x2041[_0x2d7055];return _0x543292;};'use strict';var emlformat=require(_0x1204('0x0'));var rimraf=require(_0x1204('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1204('0x2'));var rp=require(_0x1204('0x3'));var moment=require(_0x1204('0x4'));var BPromise=require(_0x1204('0x5'));var Mustache=require('mustache');var util=require(_0x1204('0x6'));var path=require(_0x1204('0x7'));var sox=require(_0x1204('0x8'));var csv=require(_0x1204('0x9'));var ejs=require(_0x1204('0xa'));var fs=require('fs');var fs_extra=require(_0x1204('0xb'));var _=require(_0x1204('0xc'));var squel=require(_0x1204('0xd'));var crypto=require(_0x1204('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1204('0xf'));var toCsv=require(_0x1204('0x9'));var querystring=require(_0x1204('0x10'));var Papa=require(_0x1204('0x11'));var Redis=require(_0x1204('0x12'));var authService=require(_0x1204('0x13'));var qs=require(_0x1204('0x14'));var as=require(_0x1204('0x15'));var hardwareService=require(_0x1204('0x16'));var logger=require(_0x1204('0x17'))(_0x1204('0x18'));var utils=require(_0x1204('0x19'));var config=require(_0x1204('0x1a'));var licenseUtil=require(_0x1204('0x1b'));var db=require(_0x1204('0x1c'))['db'];function respondWithStatusCode(_0x4ef992,_0xebebcc){_0xebebcc=_0xebebcc||0xcc;return function(_0xd88068){if(_0xd88068){return _0x4ef992[_0x1204('0x1d')](_0xebebcc);}return _0x4ef992[_0x1204('0x1e')](_0xebebcc)[_0x1204('0x1f')]();};}function respondWithResult(_0x537b90,_0x3f9b49){_0x3f9b49=_0x3f9b49||0xc8;return function(_0x2340b9){if(_0x2340b9){return _0x537b90[_0x1204('0x1e')](_0x3f9b49)['json'](_0x2340b9);}};}function respondWithFilteredResult(_0xcb7777,_0xe1f5ab){return function(_0x340f04){if(_0x340f04){var _0x353bbd=typeof _0xe1f5ab[_0x1204('0x20')]===_0x1204('0x21')&&typeof _0xe1f5ab[_0x1204('0x22')]==='undefined';var _0x5f5dfc=_0x340f04[_0x1204('0x23')];var _0x5b6f66=_0x353bbd?0x0:_0xe1f5ab[_0x1204('0x20')];var _0x13826e=_0x353bbd?_0x340f04[_0x1204('0x23')]:_0xe1f5ab['offset']+_0xe1f5ab[_0x1204('0x22')];var _0x329194;if(_0x13826e>=_0x5f5dfc){_0x13826e=_0x5f5dfc;_0x329194=0xc8;}else{_0x329194=0xce;}_0xcb7777['status'](_0x329194);return _0xcb7777[_0x1204('0x24')](_0x1204('0x25'),_0x5b6f66+'-'+_0x13826e+'/'+_0x5f5dfc)[_0x1204('0x26')](_0x340f04);}return null;};}function patchUpdates(_0x5b6d01){return function(_0x5788d8){try{jsonpatch[_0x1204('0x27')](_0x5788d8,_0x5b6d01,!![]);}catch(_0x3935f2){return BPromise['reject'](_0x3935f2);}return _0x5788d8['save']();};}function saveUpdates(_0x13ed05,_0x4d9dc3){return function(_0x38583b){if(_0x38583b){return _0x38583b[_0x1204('0x28')](_0x13ed05)['then'](function(_0x35c9be){return _0x35c9be;});}return null;};}function removeEntity(_0x583abd,_0x5c3fee){return function(_0x3205e8){if(_0x3205e8){return _0x3205e8[_0x1204('0x29')]()[_0x1204('0x2a')](function(){_0x583abd[_0x1204('0x1e')](0xcc)[_0x1204('0x1f')]();});}};}function handleEntityNotFound(_0x15a345,_0x5a2081){return function(_0x1eaae6){if(!_0x1eaae6){_0x15a345[_0x1204('0x1d')](0x194);}return _0x1eaae6;};}function handleError(_0x212119,_0x14ae21){_0x14ae21=_0x14ae21||0x1f4;return function(_0x38211c){logger[_0x1204('0x2b')](_0x38211c[_0x1204('0x2c')]);if(_0x38211c['name']){delete _0x38211c['name'];}_0x212119[_0x1204('0x1e')](_0x14ae21)[_0x1204('0x2d')](_0x38211c);};}exports['index']=function(_0xa26f89,_0xc013af){var _0x102ba7={},_0xbf433b={},_0x3df3f8={'count':0x0,'rows':[]};var _0x161227=_[_0x1204('0x2e')](db['CmHopperBlack'][_0x1204('0x2f')],function(_0xb9fb96){return{'name':_0xb9fb96[_0x1204('0x30')],'type':_0xb9fb96[_0x1204('0x31')][_0x1204('0x32')]};});_0xbf433b[_0x1204('0x33')]=_[_0x1204('0x2e')](_0x161227,_0x1204('0x34'));_0xbf433b['query']=_[_0x1204('0x35')](_0xa26f89['query']);_0xbf433b[_0x1204('0x36')]=_[_0x1204('0x37')](_0xbf433b['model'],_0xbf433b[_0x1204('0x38')]);_0x102ba7[_0x1204('0x39')]=_[_0x1204('0x37')](_0xbf433b[_0x1204('0x33')],qs['fields'](_0xa26f89[_0x1204('0x38')]['fields']));_0x102ba7['attributes']=_0x102ba7[_0x1204('0x39')][_0x1204('0x3a')]?_0x102ba7['attributes']:_0xbf433b[_0x1204('0x33')];if(!_0xa26f89['query'][_0x1204('0x3b')](_0x1204('0x3c'))){_0x102ba7[_0x1204('0x22')]=qs[_0x1204('0x22')](_0xa26f89[_0x1204('0x38')][_0x1204('0x22')]);_0x102ba7[_0x1204('0x20')]=qs[_0x1204('0x20')](_0xa26f89[_0x1204('0x38')][_0x1204('0x20')]);}_0x102ba7[_0x1204('0x3d')]=qs[_0x1204('0x3e')](_0xa26f89[_0x1204('0x38')][_0x1204('0x3e')]);_0x102ba7[_0x1204('0x3f')]=qs[_0x1204('0x36')](_[_0x1204('0x40')](_0xa26f89[_0x1204('0x38')],_0xbf433b['filters']),_0x161227);if(_0xa26f89[_0x1204('0x38')][_0x1204('0x41')]){_0x102ba7[_0x1204('0x3f')]=_[_0x1204('0x42')](_0x102ba7['where'],{'$or':_[_0x1204('0x2e')](_0x161227,function(_0x5a402a){if(_0x5a402a[_0x1204('0x31')]!==_0x1204('0x43')){var _0x321d32={};_0x321d32[_0x5a402a[_0x1204('0x34')]]={'$like':'%'+_0xa26f89[_0x1204('0x38')][_0x1204('0x41')]+'%'};return _0x321d32;}})});}_0x102ba7=_[_0x1204('0x42')]({},_0x102ba7,_0xa26f89[_0x1204('0x44')]);var _0x26650e={'where':_0x102ba7[_0x1204('0x3f')]};return db[_0x1204('0x45')][_0x1204('0x23')](_0x26650e)['then'](function(_0xa9ed6e){_0x3df3f8[_0x1204('0x23')]=_0xa9ed6e;if(_0xa26f89[_0x1204('0x38')]['includeAll']){_0x102ba7[_0x1204('0x46')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x1204('0x47')](_0x102ba7);})[_0x1204('0x2a')](function(_0x5cf4fd){_0x3df3f8[_0x1204('0x48')]=_0x5cf4fd;return _0x3df3f8;})['then'](respondWithFilteredResult(_0xc013af,_0x102ba7))['catch'](handleError(_0xc013af,null));};exports[_0x1204('0x49')]=function(_0xce3fe0,_0x2caad0){var _0x1ab272={'raw':!![],'where':{'id':_0xce3fe0[_0x1204('0x4a')]['id']}},_0x4b6f93={};_0x4b6f93['model']=_[_0x1204('0x35')](db[_0x1204('0x45')][_0x1204('0x2f')]);_0x4b6f93['query']=_[_0x1204('0x35')](_0xce3fe0[_0x1204('0x38')]);_0x4b6f93[_0x1204('0x36')]=_['intersection'](_0x4b6f93[_0x1204('0x33')],_0x4b6f93['query']);_0x1ab272['attributes']=_[_0x1204('0x37')](_0x4b6f93[_0x1204('0x33')],qs[_0x1204('0x4b')](_0xce3fe0[_0x1204('0x38')]['fields']));_0x1ab272[_0x1204('0x39')]=_0x1ab272[_0x1204('0x39')][_0x1204('0x3a')]?_0x1ab272[_0x1204('0x39')]:_0x4b6f93[_0x1204('0x33')];if(_0xce3fe0['query'][_0x1204('0x4c')]){_0x1ab272[_0x1204('0x46')]=[{'all':!![]}];}_0x1ab272=_[_0x1204('0x42')]({},_0x1ab272,_0xce3fe0[_0x1204('0x44')]);return db[_0x1204('0x45')][_0x1204('0x4d')](_0x1ab272)[_0x1204('0x2a')](handleEntityNotFound(_0x2caad0,null))['then'](respondWithResult(_0x2caad0,null))[_0x1204('0x4e')](handleError(_0x2caad0,null));};exports['update']=function(_0x1cef43,_0x38f797){if(_0x1cef43[_0x1204('0x4f')]['id']){delete _0x1cef43['body']['id'];}return db[_0x1204('0x45')][_0x1204('0x4d')]({'where':{'id':_0x1cef43[_0x1204('0x4a')]['id']}})['then'](handleEntityNotFound(_0x38f797,null))[_0x1204('0x2a')](saveUpdates(_0x1cef43[_0x1204('0x4f')],null))['then'](respondWithResult(_0x38f797,null))['catch'](handleError(_0x38f797,null));};exports[_0x1204('0x29')]=function(_0x150fa7,_0x185a6d){return db[_0x1204('0x45')][_0x1204('0x4d')]({'where':{'id':_0x150fa7[_0x1204('0x4a')]['id']}})[_0x1204('0x2a')](handleEntityNotFound(_0x185a6d,null))['then'](removeEntity(_0x185a6d,null))[_0x1204('0x4e')](handleError(_0x185a6d,null));};exports[_0x1204('0x50')]=function(_0x24c326,_0x32c938){return db[_0x1204('0x45')]['describe']()[_0x1204('0x2a')](respondWithResult(_0x32c938,null))[_0x1204('0x4e')](handleError(_0x32c938,null));};
\ No newline at end of file
index 09d7ee0..93da21b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x968d=['../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0x968d,0x1dc));var _0xd968=function(_0x430cb0,_0x860700){_0x430cb0=_0x430cb0-0x0;var _0x4e21d5=_0x968d[_0x430cb0];return _0x4e21d5;};'use strict';var _=require(_0xd968('0x0'));var util=require(_0xd968('0x1'));var logger=require(_0xd968('0x2'))(_0xd968('0x3'));var moment=require(_0xd968('0x4'));var BPromise=require('bluebird');var rp=require(_0xd968('0x5'));var fs=require('fs');var path=require(_0xd968('0x6'));var rimraf=require(_0xd968('0x7'));var config=require(_0xd968('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0xd968('0x9')]=function(_0x15f477,_0x236026){return _0x15f477[_0xd968('0xa')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa427=['lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa427,0x13f));var _0x7a42=function(_0x4f9fe2,_0x5a5c30){_0x4f9fe2=_0x4f9fe2-0x0;var _0x347243=_0xa427[_0x4f9fe2];return _0x347243;};'use strict';var _=require(_0x7a42('0x0'));var util=require('util');var logger=require(_0x7a42('0x1'))(_0x7a42('0x2'));var moment=require(_0x7a42('0x3'));var BPromise=require(_0x7a42('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7a42('0x5'));var config=require(_0x7a42('0x6'));var attributes=require(_0x7a42('0x7'));module['exports']=function(_0x3df062,_0x53df7a){return _0x3df062[_0x7a42('0x8')](_0x7a42('0x9'),attributes,{'tableName':_0x7a42('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2f210b4..e47b881 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1fc=['raw','limit','DestroyCmHopperBlack','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CmHopperBlack','options','where','attributes','include','map','model','debug','GetCmHopperBlack','UpdateCmHopperBlack','update'];(function(_0x367b97,_0x34ce40){var _0x18e5f8=function(_0x571f38){while(--_0x571f38){_0x367b97['push'](_0x367b97['shift']());}};_0x18e5f8(++_0x34ce40);}(_0xa1fc,0xdb));var _0xca1f=function(_0x5bf61f,_0x2633cb){_0x5bf61f=_0x5bf61f-0x0;var _0x1f2610=_0xa1fc[_0x5bf61f];return _0x1f2610;};'use strict';var _=require(_0xca1f('0x0'));var util=require(_0xca1f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca1f('0x2'));var fs=require('fs');var Redis=require(_0xca1f('0x3'));var db=require(_0xca1f('0x4'))['db'];var utils=require(_0xca1f('0x5'));var logger=require('../../config/logger')(_0xca1f('0x6'));var config=require(_0xca1f('0x7'));var jayson=require(_0xca1f('0x8'));var client=jayson[_0xca1f('0x9')][_0xca1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bd917,_0x2d06bd,_0x420f97){return new BPromise(function(_0x55602e,_0x2b749f){return client['request'](_0x1bd917,_0x420f97)[_0xca1f('0xb')](function(_0x2e34d1){logger[_0xca1f('0xc')](_0xca1f('0xd'),_0x2d06bd,_0xca1f('0xe'));logger['debug'](_0xca1f('0xf'),_0x2d06bd,_0xca1f('0xe'),JSON[_0xca1f('0x10')](_0x2e34d1));if(_0x2e34d1['error']){if(_0x2e34d1['error'][_0xca1f('0x11')]===0x1f4){logger[_0xca1f('0x12')](_0xca1f('0xd'),_0x2d06bd,_0x2e34d1['error'][_0xca1f('0x13')]);return _0x2b749f(_0x2e34d1[_0xca1f('0x12')][_0xca1f('0x13')]);}logger[_0xca1f('0x12')](_0xca1f('0xd'),_0x2d06bd,_0x2e34d1[_0xca1f('0x12')][_0xca1f('0x13')]);return _0x55602e(_0x2e34d1[_0xca1f('0x12')][_0xca1f('0x13')]);}else{logger[_0xca1f('0xc')](_0xca1f('0xd'),_0x2d06bd,_0xca1f('0xe'));_0x55602e(_0x2e34d1[_0xca1f('0x14')]['message']);}})[_0xca1f('0x15')](function(_0xfc9a14){logger[_0xca1f('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x2d06bd,_0xfc9a14);_0x2b749f(_0xfc9a14);});});}exports['GetCmHopperBlack']=function(_0x389563){var _0x3cbcdc=this;return new Promise(function(_0x1ec158,_0xfedb3f){return db[_0xca1f('0x16')]['findAll']({'raw':_0x389563[_0xca1f('0x17')]?_0x389563['options']['raw']===undefined?!![]:![]:!![],'where':_0x389563[_0xca1f('0x17')]?_0x389563[_0xca1f('0x17')][_0xca1f('0x18')]||null:null,'attributes':_0x389563[_0xca1f('0x17')]?_0x389563['options'][_0xca1f('0x19')]||null:null,'limit':_0x389563['options']?_0x389563[_0xca1f('0x17')]['limit']||null:null,'include':_0x389563[_0xca1f('0x17')]?_0x389563[_0xca1f('0x17')][_0xca1f('0x1a')]?_[_0xca1f('0x1b')](_0x389563[_0xca1f('0x17')][_0xca1f('0x1a')],function(_0x1db481){return{'model':db[_0x1db481['model']],'as':_0x1db481['as'],'attributes':_0x1db481[_0xca1f('0x19')],'include':_0x1db481[_0xca1f('0x1a')]?_['map'](_0x1db481[_0xca1f('0x1a')],function(_0x2a0aee){return{'model':db[_0x2a0aee[_0xca1f('0x1c')]],'as':_0x2a0aee['as'],'attributes':_0x2a0aee[_0xca1f('0x19')],'include':_0x2a0aee[_0xca1f('0x1a')]?_[_0xca1f('0x1b')](_0x2a0aee['include'],function(_0x4d6b45){return{'model':db[_0x4d6b45['model']],'as':_0x4d6b45['as'],'attributes':_0x4d6b45[_0xca1f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xca1f('0xb')](function(_0x54f41d){logger[_0xca1f('0xc')]('GetCmHopperBlack',_0x389563);logger[_0xca1f('0x1d')](_0xca1f('0x1e'),_0x389563,JSON[_0xca1f('0x10')](_0x54f41d));_0x1ec158(_0x54f41d);})[_0xca1f('0x15')](function(_0x4bddea){logger['error'](_0xca1f('0x1e'),_0x4bddea[_0xca1f('0x13')],_0x389563);_0xfedb3f(_0x3cbcdc[_0xca1f('0x12')](0x1f4,_0x4bddea[_0xca1f('0x13')]));});});};exports[_0xca1f('0x1f')]=function(_0x1c9b03){var _0x33ef4f=this;return new Promise(function(_0x360db2,_0x140ce5){return db[_0xca1f('0x16')][_0xca1f('0x20')](_0x1c9b03['body'],{'raw':_0x1c9b03[_0xca1f('0x17')]?_0x1c9b03['options'][_0xca1f('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c9b03['options']?_0x1c9b03[_0xca1f('0x17')][_0xca1f('0x18')]||null:null,'attributes':_0x1c9b03[_0xca1f('0x17')]?_0x1c9b03[_0xca1f('0x17')][_0xca1f('0x19')]||null:null,'limit':_0x1c9b03[_0xca1f('0x17')]?_0x1c9b03[_0xca1f('0x17')][_0xca1f('0x22')]||null:null})['then'](function(_0x485794){logger['info'](_0xca1f('0x1f'),_0x1c9b03);logger[_0xca1f('0x1d')](_0xca1f('0x1f'),_0x1c9b03,JSON[_0xca1f('0x10')](_0x485794));_0x360db2(_0x485794);})[_0xca1f('0x15')](function(_0xb83863){logger[_0xca1f('0x12')]('UpdateCmHopperBlack',_0xb83863[_0xca1f('0x13')],_0x1c9b03);_0x140ce5(_0x33ef4f[_0xca1f('0x12')](0x1f4,_0xb83863[_0xca1f('0x13')]));});});};exports[_0xca1f('0x23')]=function(_0x230324){var _0x5b8e8b=this;return new Promise(function(_0x29ad3a,_0x34f6fd){return db[_0xca1f('0x16')]['destroy']({'where':_0x230324[_0xca1f('0x17')]?_0x230324[_0xca1f('0x17')]['where']||null:null})[_0xca1f('0xb')](function(_0x2366e7){logger[_0xca1f('0xc')](_0xca1f('0x23'),_0x230324);logger['debug']('DestroyCmHopperBlack',_0x230324,JSON[_0xca1f('0x10')](_0x2366e7));_0x29ad3a(_0x2366e7);})[_0xca1f('0x15')](function(_0x4f445f){logger['error']('DestroyCmHopperBlack',_0x4f445f['message'],_0x230324);_0x34f6fd(_0x5b8e8b['error'](0x1f4,_0x4f445f[_0xca1f('0x13')]));});});};
\ No newline at end of file
+var _0x3a11=['error','code','message','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','map','include','model','UpdateCmHopperBlack','update','body','stringify','destroy','DestroyCmHopperBlack','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x5f3ebe,_0x161e96){var _0x3c93a2=function(_0x5bc126){while(--_0x5bc126){_0x5f3ebe['push'](_0x5f3ebe['shift']());}};_0x3c93a2(++_0x161e96);}(_0x3a11,0xf2));var _0x13a1=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x3a11[_0x53c256];return _0x25feb6;};'use strict';var _=require(_0x13a1('0x0'));var util=require('util');var moment=require(_0x13a1('0x1'));var BPromise=require('bluebird');var rs=require(_0x13a1('0x2'));var fs=require('fs');var Redis=require(_0x13a1('0x3'));var db=require(_0x13a1('0x4'))['db'];var utils=require(_0x13a1('0x5'));var logger=require(_0x13a1('0x6'))('rpc');var config=require(_0x13a1('0x7'));var jayson=require(_0x13a1('0x8'));var client=jayson['client'][_0x13a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x594348,_0x1f9945,_0x839ef){return new BPromise(function(_0x2c4e21,_0x5ecd0e){return client[_0x13a1('0xa')](_0x594348,_0x839ef)[_0x13a1('0xb')](function(_0x3f11fe){logger[_0x13a1('0xc')](_0x13a1('0xd'),_0x1f9945,_0x13a1('0xe'));logger[_0x13a1('0xf')](_0x13a1('0x10'),_0x1f9945,'request\x20sent',JSON['stringify'](_0x3f11fe));if(_0x3f11fe[_0x13a1('0x11')]){if(_0x3f11fe[_0x13a1('0x11')][_0x13a1('0x12')]===0x1f4){logger[_0x13a1('0x11')](_0x13a1('0xd'),_0x1f9945,_0x3f11fe[_0x13a1('0x11')][_0x13a1('0x13')]);return _0x5ecd0e(_0x3f11fe['error'][_0x13a1('0x13')]);}logger[_0x13a1('0x11')](_0x13a1('0xd'),_0x1f9945,_0x3f11fe[_0x13a1('0x11')]['message']);return _0x2c4e21(_0x3f11fe[_0x13a1('0x11')][_0x13a1('0x13')]);}else{logger[_0x13a1('0xc')](_0x13a1('0xd'),_0x1f9945,_0x13a1('0xe'));_0x2c4e21(_0x3f11fe['result'][_0x13a1('0x13')]);}})[_0x13a1('0x14')](function(_0x1aeb78){logger[_0x13a1('0x11')](_0x13a1('0xd'),_0x1f9945,_0x1aeb78);_0x5ecd0e(_0x1aeb78);});});}exports[_0x13a1('0x15')]=function(_0xc9dfe4){var _0x152cf8=this;return new Promise(function(_0x1e562f,_0xa26f92){return db[_0x13a1('0x16')]['findAll']({'raw':_0xc9dfe4[_0x13a1('0x17')]?_0xc9dfe4[_0x13a1('0x17')][_0x13a1('0x18')]===undefined?!![]:![]:!![],'where':_0xc9dfe4['options']?_0xc9dfe4[_0x13a1('0x17')][_0x13a1('0x19')]||null:null,'attributes':_0xc9dfe4[_0x13a1('0x17')]?_0xc9dfe4['options'][_0x13a1('0x1a')]||null:null,'limit':_0xc9dfe4[_0x13a1('0x17')]?_0xc9dfe4[_0x13a1('0x17')][_0x13a1('0x1b')]||null:null,'include':_0xc9dfe4[_0x13a1('0x17')]?_0xc9dfe4['options']['include']?_[_0x13a1('0x1c')](_0xc9dfe4[_0x13a1('0x17')][_0x13a1('0x1d')],function(_0x41791a){return{'model':db[_0x41791a[_0x13a1('0x1e')]],'as':_0x41791a['as'],'attributes':_0x41791a[_0x13a1('0x1a')],'include':_0x41791a['include']?_[_0x13a1('0x1c')](_0x41791a[_0x13a1('0x1d')],function(_0xc1e3f6){return{'model':db[_0xc1e3f6['model']],'as':_0xc1e3f6['as'],'attributes':_0xc1e3f6[_0x13a1('0x1a')],'include':_0xc1e3f6[_0x13a1('0x1d')]?_['map'](_0xc1e3f6['include'],function(_0x552fba){return{'model':db[_0x552fba[_0x13a1('0x1e')]],'as':_0x552fba['as'],'attributes':_0x552fba[_0x13a1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x553aa7){logger[_0x13a1('0xc')]('GetCmHopperBlack',_0xc9dfe4);logger['debug'](_0x13a1('0x15'),_0xc9dfe4,JSON['stringify'](_0x553aa7));_0x1e562f(_0x553aa7);})[_0x13a1('0x14')](function(_0x4b665a){logger[_0x13a1('0x11')]('GetCmHopperBlack',_0x4b665a['message'],_0xc9dfe4);_0xa26f92(_0x152cf8[_0x13a1('0x11')](0x1f4,_0x4b665a[_0x13a1('0x13')]));});});};exports[_0x13a1('0x1f')]=function(_0x47efd4){var _0x4c7851=this;return new Promise(function(_0x36a12b,_0x93a6b5){return db[_0x13a1('0x16')][_0x13a1('0x20')](_0x47efd4[_0x13a1('0x21')],{'raw':_0x47efd4[_0x13a1('0x17')]?_0x47efd4[_0x13a1('0x17')][_0x13a1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47efd4[_0x13a1('0x17')]?_0x47efd4[_0x13a1('0x17')]['where']||null:null,'attributes':_0x47efd4[_0x13a1('0x17')]?_0x47efd4[_0x13a1('0x17')][_0x13a1('0x1a')]||null:null,'limit':_0x47efd4[_0x13a1('0x17')]?_0x47efd4[_0x13a1('0x17')][_0x13a1('0x1b')]||null:null})['then'](function(_0x24a35b){logger['info'](_0x13a1('0x1f'),_0x47efd4);logger[_0x13a1('0xf')](_0x13a1('0x1f'),_0x47efd4,JSON[_0x13a1('0x22')](_0x24a35b));_0x36a12b(_0x24a35b);})[_0x13a1('0x14')](function(_0x240d98){logger[_0x13a1('0x11')]('UpdateCmHopperBlack',_0x240d98['message'],_0x47efd4);_0x93a6b5(_0x4c7851[_0x13a1('0x11')](0x1f4,_0x240d98[_0x13a1('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x3417b9){var _0x5c2ed1=this;return new Promise(function(_0xe445e0,_0x318874){return db[_0x13a1('0x16')][_0x13a1('0x23')]({'where':_0x3417b9['options']?_0x3417b9[_0x13a1('0x17')][_0x13a1('0x19')]||null:null})['then'](function(_0x2b19fb){logger[_0x13a1('0xc')](_0x13a1('0x24'),_0x3417b9);logger[_0x13a1('0xf')](_0x13a1('0x24'),_0x3417b9,JSON['stringify'](_0x2b19fb));_0xe445e0(_0x2b19fb);})[_0x13a1('0x14')](function(_0x4b4887){logger['error']('DestroyCmHopperBlack',_0x4b4887['message'],_0x3417b9);_0x318874(_0x5c2ed1[_0x13a1('0x11')](0x1f4,_0x4b4887[_0x13a1('0x13')]));});});};
\ No newline at end of file
index bdb4993..ceefd88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c6c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','put','update','destroy','multer','path','connect-timeout','express','Router'];(function(_0x201f2b,_0x53d06c){var _0x4a96b1=function(_0x1b976f){while(--_0x1b976f){_0x201f2b['push'](_0x201f2b['shift']());}};_0x4a96b1(++_0x53d06c);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x38a76e,_0x41996c){_0x38a76e=_0x38a76e-0x0;var _0x184ee7=_0x3c6c[_0x38a76e];return _0x184ee7;};'use strict';var multer=require(_0xc3c6('0x0'));var util=require('util');var path=require(_0xc3c6('0x1'));var timeout=require(_0xc3c6('0x2'));var express=require(_0xc3c6('0x3'));var router=express[_0xc3c6('0x4')]();var fs_extra=require(_0xc3c6('0x5'));var auth=require(_0xc3c6('0x6'));var interaction=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var controller=require('./cmHopperBlack.controller');router[_0xc3c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3c6('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller['show']);router[_0xc3c6('0xd')](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0xe')]);router['delete'](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xaa3f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','util'];(function(_0x5eec6b,_0x5fa1da){var _0x16f7c7=function(_0x5050fb){while(--_0x5050fb){_0x5eec6b['push'](_0x5eec6b['shift']());}};_0x16f7c7(++_0x5fa1da);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x2aa548,_0x19b0b9){_0x2aa548=_0x2aa548-0x0;var _0x39e88b=_0xaa3f[_0x2aa548];return _0x39e88b;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var fs_extra=require(_0xfaa3('0x6'));var auth=require(_0xfaa3('0x7'));var interaction=require(_0xfaa3('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0xfaa3('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0xa')]);router[_0xfaa3('0x9')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0xd')]);router[_0xfaa3('0x9')](_0xfaa3('0xe'),auth['isAuthenticated'](),controller[_0xfaa3('0xf')]);router[_0xfaa3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfaa3('0x11')]);router[_0xfaa3('0x12')](_0xfaa3('0xe'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x13')]);module[_0xfaa3('0x14')]=router;
\ No newline at end of file
index 1b140d7..8193f53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9c9=['dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING','endtime','setDataValue','followuptime','diff','seconds'];(function(_0xd31945,_0x4d108c){var _0x1a9f9d=function(_0x33702e){while(--_0x33702e){_0xd31945['push'](_0xd31945['shift']());}};_0x1a9f9d(++_0x4d108c);}(_0xb9c9,0x84));var _0x9b9c=function(_0x35d8f0,_0x546996){_0x35d8f0=_0x35d8f0-0x0;var _0x2db3fa=_0xb9c9[_0x35d8f0];return _0x2db3fa;};'use strict';var Sequelize=require(_0x9b9c('0x0'));var moment=require(_0x9b9c('0x1'));module[_0x9b9c('0x2')]={'state':{'type':Sequelize[_0x9b9c('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x9b9c('0x4')]},'countbusyretry':{'type':Sequelize[_0x9b9c('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9b9c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9b9c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9b9c('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9b9c('0x5')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9b9c('0x5')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9b9c('0x4')]},'responsetime':{'type':Sequelize[_0x9b9c('0x4')]},'answertime':{'type':Sequelize[_0x9b9c('0x4')]},'droptime':{'type':Sequelize[_0x9b9c('0x4')]},'endtime':{'type':Sequelize[_0x9b9c('0x4')]},'ringtime':{'type':Sequelize[_0x9b9c('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9b9c('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9b9c('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x9b9c('0x5')]},'membername':{'type':Sequelize[_0x9b9c('0x5')]},'reason':{'type':Sequelize[_0x9b9c('0x5')]},'disposition':{'type':Sequelize[_0x9b9c('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9b9c('0x5')]},'dispositionat':{'type':Sequelize[_0x9b9c('0x4')],'set':function(_0x22abcf){var _0x2633ac=this['getDataValue'](_0x9b9c('0x6'));if(_0x2633ac&&_0x22abcf){this[_0x9b9c('0x7')](_0x9b9c('0x8'),moment(_0x22abcf)[_0x9b9c('0x9')](moment(_0x2633ac),_0x9b9c('0xa')));}return this[_0x9b9c('0x7')](_0x9b9c('0xb'),_0x22abcf);}},'amd':{'type':Sequelize[_0x9b9c('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9b9c('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9b9c('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9b9c('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x9b9c('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9b9c('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9b9c('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x9b9c('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9b9c('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x9b9c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9b9c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9b9c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb085=['getDataValue','diff','seconds','setDataValue','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE'];(function(_0x55c0d4,_0x5d84b2){var _0x1f4a53=function(_0x161229){while(--_0x161229){_0x55c0d4['push'](_0x55c0d4['shift']());}};_0x1f4a53(++_0x5d84b2);}(_0xb085,0x9b));var _0x5b08=function(_0x5b3cdf,_0x1a8807){_0x5b3cdf=_0x5b3cdf-0x0;var _0xa43335=_0xb085[_0x5b3cdf];return _0xa43335;};'use strict';var Sequelize=require(_0x5b08('0x0'));var moment=require(_0x5b08('0x1'));module['exports']={'state':{'type':Sequelize[_0x5b08('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5b08('0x3')]},'scheduledat':{'type':Sequelize[_0x5b08('0x4')]},'countbusyretry':{'type':Sequelize[_0x5b08('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5b08('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5b08('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5b08('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5b08('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5b08('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5b08('0x3')]},'calleridname':{'type':Sequelize[_0x5b08('0x3')]},'starttime':{'type':Sequelize[_0x5b08('0x4')]},'responsetime':{'type':Sequelize[_0x5b08('0x4')]},'answertime':{'type':Sequelize[_0x5b08('0x4')]},'droptime':{'type':Sequelize[_0x5b08('0x4')]},'endtime':{'type':Sequelize[_0x5b08('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5b08('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5b08('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5b08('0x3')]},'campaign':{'type':Sequelize[_0x5b08('0x3')]},'campaigntype':{'type':Sequelize[_0x5b08('0x3')]},'membername':{'type':Sequelize[_0x5b08('0x3')]},'reason':{'type':Sequelize[_0x5b08('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5b08('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x5b08('0x4')],'set':function(_0x3e0ccb){var _0xb397db=this[_0x5b08('0x5')]('endtime');if(_0xb397db&&_0x3e0ccb){this['setDataValue']('followuptime',moment(_0x3e0ccb)[_0x5b08('0x6')](moment(_0xb397db),_0x5b08('0x7')));}return this[_0x5b08('0x8')]('dispositionat',_0x3e0ccb);}},'amd':{'type':Sequelize[_0x5b08('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5b08('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5b08('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5b08('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5b08('0x4')]},'callback':{'type':Sequelize[_0x5b08('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5b08('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x5b08('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x5b08('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x5b08('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5b08('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5b08('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5b08('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 593c63d..95a1f56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`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','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x4c044d,_0x5477d9){var _0xce5027=function(_0x3c8811){while(--_0x3c8811){_0x4c044d['push'](_0x4c044d['shift']());}};_0xce5027(++_0x5477d9);}(_0x71ab,0x64));var _0xb71a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x71ab[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));};
\ No newline at end of file
+var _0x90b1=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ListId','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','CmHopperFinal','includeAll','rows','include','find','catch','update','body'];(function(_0x14f8f0,_0x5e2d51){var _0x5a1286=function(_0x550da7){while(--_0x550da7){_0x14f8f0['push'](_0x14f8f0['shift']());}};_0x5a1286(++_0x5e2d51);}(_0x90b1,0x1bb));var _0x190b=function(_0x4090c2,_0x1f6da9){_0x4090c2=_0x4090c2-0x0;var _0x14d3dd=_0x90b1[_0x4090c2];return _0x14d3dd;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['CmHopperFinal'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['describe']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['describe']()[_0x190b('0x22')](respondWithResult(_0xadc789,null))[_0x190b('0x42')](handleError(_0xadc789,null));};exports[_0x190b('0x43')]=function(_0x505e52,_0x4cb561){if(_0x505e52[_0x190b('0x44')][_0x190b('0x45')]){delete _0x505e52[_0x190b('0x44')][_0x190b('0x45')];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'uniqueid':_0x505e52['params']['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x4cb561,null))[_0x190b('0x22')](saveUpdates(_0x505e52[_0x190b('0x44')],null))['then'](respondWithResult(_0x4cb561,null))[_0x190b('0x42')](handleError(_0x4cb561,null));};exports[_0x190b('0x46')]=function(_0x215ab6,_0x503700,_0xbc6757){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x215ab6[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db['sequelize']['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),_0x190b('0x50')],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0x503700,null))[_0x190b('0x22')](respondWithResult(_0x503700,null))['catch'](handleError(_0x503700,null));};exports[_0x190b('0x58')]=function(_0x270b59,_0xffe7cb,_0x405e04){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'CampaignId':_0x270b59[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x59')))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),'busyContacts'],[db[_0x190b('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x190b('0x5a')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x5b')))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0xffe7cb,null))['then'](respondWithResult(_0xffe7cb,null))[_0x190b('0x42')](handleError(_0xffe7cb,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2495c9,_0x348beb,_0x360d39){return db[_0x190b('0x5c')]['find']({'where':{'id':_0x2495c9[_0x190b('0x48')]['id']}})['then'](handleEntityNotFound(_0x348beb,null))[_0x190b('0x22')](function(_0x5073d2){var _0x49b60c;if(_0x5073d2){_0x49b60c=squel[_0x190b('0x5d')]()['into'](_0x190b('0x5e'))[_0x190b('0x5f')]([_0x190b('0x60'),_0x190b('0x61'),_0x190b('0x62'),'ListId',_0x190b('0x63'),_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),'phone')[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))['field'](_0x190b('0x69'),_0x190b('0x62'))[_0x190b('0x66')](_0x190b('0x6a'),'ListId')[_0x190b('0x66')](_0x190b('0x6b'),_0x190b('0x63'))['field'](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')]('NOW()',_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']())[_0x190b('0x3a')](_0x190b('0x6f'),_0x2495c9['body'][_0x190b('0x70')][_0x190b('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x190b('0x3a')](_0x190b('0x72'),squel['select']()['field'](_0x190b('0x60'))[_0x190b('0x6c')](_0x190b('0x5e'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']()))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9[_0x190b('0x48')]['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')]['query'](_0x49b60c);}return[];})['then'](respondWithResult(_0x348beb,null))[_0x190b('0x42')](handleError(_0x348beb,null));};exports[_0x190b('0x76')]=function(_0x4b988d,_0x40ac95,_0x18c5f4){return db[_0x190b('0x77')]['find']({'where':{'id':_0x4b988d[_0x190b('0x48')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x40ac95,null))['then'](function(_0x23298e){var _0x2ba27b;if(_0x23298e){_0x2ba27b=squel['insert']()[_0x190b('0x78')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x190b('0x62'),_0x190b('0x79'),'CampaignId',_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),_0x190b('0x60'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))[_0x190b('0x66')](_0x190b('0x69'),_0x190b('0x62'))['field'](_0x190b('0x6a'),'ListId')['field'](_0x190b('0x7a'),_0x190b('0x7b'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x6f'),_0x4b988d[_0x190b('0x44')][_0x190b('0x70')][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x7d'))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x60'))['from'](_0x190b('0x5e'))[_0x190b('0x3a')]('CampaignId\x20=\x20?',_0x4b988d['params']['id'][_0x190b('0x71')]()))[_0x190b('0x3a')](_0x190b('0x72'),squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')][_0x190b('0x2d')](_0x2ba27b);}return[];})[_0x190b('0x22')](respondWithResult(_0x40ac95,null))[_0x190b('0x42')](handleError(_0x40ac95,null));};exports['checkContactHopper']=function(_0x476c86,_0x298824,_0x5e7c76){return db[_0x190b('0x7e')][_0x190b('0x7f')]({'where':{'VoiceQueueId':_0x476c86[_0x190b('0x44')][_0x190b('0x63')],'CampaignId':_0x476c86[_0x190b('0x44')][_0x190b('0x7b')],'ContactId':_0x476c86[_0x190b('0x44')][_0x190b('0x62')]}})['then'](handleEntityNotFound(_0x298824,null))[_0x190b('0x22')](function(_0x1b3168){if(_0x1b3168){return _0x1b3168;}return null;})[_0x190b('0x22')](respondWithResult(_0x298824,null))[_0x190b('0x42')](handleError(_0x298824,null));};
\ No newline at end of file
index 69b919a..efaedc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd31c=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xd31c,0x197));var _0xcd31=function(_0x1bffd0,_0x5c57f3){_0x1bffd0=_0x1bffd0-0x0;var _0x15893a=_0xd31c[_0x1bffd0];return _0x15893a;};'use strict';var _=require(_0xcd31('0x0'));var util=require(_0xcd31('0x1'));var logger=require(_0xcd31('0x2'))(_0xcd31('0x3'));var moment=require(_0xcd31('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd31('0x5'));var fs=require('fs');var path=require(_0xcd31('0x6'));var rimraf=require(_0xcd31('0x7'));var config=require(_0xcd31('0x8'));var attributes=require(_0xcd31('0x9'));module[_0xcd31('0xa')]=function(_0x531263,_0x5b1b8d){return _0x531263[_0xcd31('0xb')](_0xcd31('0xc'),attributes,{'tableName':_0xcd31('0xd'),'paranoid':![],'indexes':[{'name':_0xcd31('0xe'),'fields':['calleridnum']},{'name':_0xcd31('0xf'),'fields':[_0xcd31('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x297f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x5f0c76,_0x44b266){var _0x308606=function(_0x14bc96){while(--_0x14bc96){_0x5f0c76['push'](_0x5f0c76['shift']());}};_0x308606(++_0x44b266);}(_0x297f,0xff));var _0xf297=function(_0x515e64,_0x58471d){_0x515e64=_0x515e64-0x0;var _0x3f24fa=_0x297f[_0x515e64];return _0x3f24fa;};'use strict';var _=require('lodash');var util=require(_0xf297('0x0'));var logger=require(_0xf297('0x1'))(_0xf297('0x2'));var moment=require(_0xf297('0x3'));var BPromise=require(_0xf297('0x4'));var rp=require(_0xf297('0x5'));var fs=require('fs');var path=require(_0xf297('0x6'));var rimraf=require(_0xf297('0x7'));var config=require(_0xf297('0x8'));var attributes=require(_0xf297('0x9'));module['exports']=function(_0x7eacc9,_0x5c45bd){return _0x7eacc9[_0xf297('0xa')](_0xf297('0xb'),attributes,{'tableName':_0xf297('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xf297('0xd')]},{'name':'uniqueid','fields':[_0xf297('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 8e5879e..8ed9d6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x219e27,_0x5bc6ce){var _0x579607=function(_0x571674){while(--_0x571674){_0x219e27['push'](_0x219e27['shift']());}};_0x579607(++_0x5bc6ce);}(_0xb10b,0x12a));var _0xbb10=function(_0x476f49,_0x105660){_0x476f49=_0x476f49-0x0;var _0x48addd=_0xb10b[_0x476f49];return _0x48addd;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x44093f,_0x2a2e5e){var _0x27cfb9=function(_0x342e2a){while(--_0x342e2a){_0x44093f['push'](_0x44093f['shift']());}};_0x27cfb9(++_0x2a2e5e);}(_0x7a54,0x106));var _0x47a5=function(_0x3ed6b8,_0x358870){_0x3ed6b8=_0x3ed6b8-0x0;var _0x320e05=_0x7a54[_0x3ed6b8];return _0x320e05;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
index 5abd35e..75aa288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a25=['/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x8a25,0xb7));var _0x58a2=function(_0x1444e4,_0xb9594c){_0x1444e4=_0x1444e4-0x0;var _0x306585=_0x8a25[_0x1444e4];return _0x306585;};'use strict';var multer=require(_0x58a2('0x0'));var util=require(_0x58a2('0x1'));var path=require(_0x58a2('0x2'));var timeout=require(_0x58a2('0x3'));var express=require(_0x58a2('0x4'));var router=express[_0x58a2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x58a2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x58a2('0x7'));router[_0x58a2('0x8')]('/',auth[_0x58a2('0x9')](),controller[_0x58a2('0xa')]);router[_0x58a2('0x8')](_0x58a2('0xb'),auth[_0x58a2('0x9')](),controller['describe']);router[_0x58a2('0x8')](_0x58a2('0xc'),auth[_0x58a2('0x9')](),controller[_0x58a2('0xd')]);router['get']('/voice/queue/countAttributes/:id',auth[_0x58a2('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x58a2('0xe'),auth[_0x58a2('0x9')](),controller[_0x58a2('0xf')]);router[_0x58a2('0x10')](_0x58a2('0x11'),auth[_0x58a2('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0x58a2('0x12'),auth[_0x58a2('0x9')](),controller[_0x58a2('0x13')]);router[_0x58a2('0x10')](_0x58a2('0x14'),auth[_0x58a2('0x9')](),controller[_0x58a2('0x15')]);router[_0x58a2('0x16')](_0x58a2('0xc'),auth[_0x58a2('0x9')](),controller[_0x58a2('0x17')]);module[_0x58a2('0x18')]=router;
\ No newline at end of file
+var _0x7d13=['index','/describe','isAuthenticated','describe','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','post','put','/:id','update','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x7d13,0x176));var _0x37d1=function(_0x5d8010,_0x7463b){_0x5d8010=_0x5d8010-0x0;var _0x1099c2=_0x7d13[_0x5d8010];return _0x1099c2;};'use strict';var multer=require(_0x37d1('0x0'));var util=require(_0x37d1('0x1'));var path=require('path');var timeout=require(_0x37d1('0x2'));var express=require('express');var router=express[_0x37d1('0x3')]();var fs_extra=require(_0x37d1('0x4'));var auth=require(_0x37d1('0x5'));var interaction=require(_0x37d1('0x6'));var config=require(_0x37d1('0x7'));var controller=require(_0x37d1('0x8'));router[_0x37d1('0x9')]('/',auth['isAuthenticated'](),controller[_0x37d1('0xa')]);router[_0x37d1('0x9')](_0x37d1('0xb'),auth[_0x37d1('0xc')](),controller[_0x37d1('0xd')]);router[_0x37d1('0x9')]('/:id',auth[_0x37d1('0xc')](),controller['show']);router['get'](_0x37d1('0xe'),auth[_0x37d1('0xc')](),controller[_0x37d1('0xf')]);router[_0x37d1('0x9')](_0x37d1('0x10'),auth[_0x37d1('0xc')](),controller[_0x37d1('0x11')]);router['post'](_0x37d1('0x12'),auth[_0x37d1('0xc')](),controller['moveContactsQueueCampaignHopperFinal']);router['post']('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x37d1('0x13')]);router[_0x37d1('0x14')]('/checkContactHopper',auth[_0x37d1('0xc')](),controller['checkContactHopper']);router[_0x37d1('0x15')](_0x37d1('0x16'),auth['isAuthenticated'](),controller[_0x37d1('0x17')]);module['exports']=router;
\ No newline at end of file
index 9c959f2..9d02678 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6635=['BOOLEAN','INTEGER','STRING','DATE'];(function(_0x610062,_0x4335de){var _0x4044a9=function(_0x11c633){while(--_0x11c633){_0x610062['push'](_0x610062['shift']());}};_0x4044a9(++_0x4335de);}(_0x6635,0x10d));var _0x5663=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x6635[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x5663('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x5663('0x1')]},'scheduledat':{'type':Sequelize[_0x5663('0x2')]},'countbusyretry':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5663('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x5663('0x1')]},'originatecalleridname':{'type':Sequelize[_0x5663('0x1')]},'calleridnum':{'type':Sequelize[_0x5663('0x1')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5663('0x2')]},'responsetime':{'type':Sequelize[_0x5663('0x2')]},'answertime':{'type':Sequelize[_0x5663('0x2')]},'droptime':{'type':Sequelize[_0x5663('0x2')]},'endtime':{'type':Sequelize[_0x5663('0x2')]},'ringtime':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5663('0x1')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x5663('0x1')]},'membername':{'type':Sequelize[_0x5663('0x1')]},'reason':{'type':Sequelize[_0x5663('0x1')]},'amd':{'type':Sequelize[_0x5663('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5663('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x5663('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5663('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5663('0x2')]},'recallme':{'type':Sequelize[_0x5663('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5663('0x2')]},'edited':{'type':Sequelize[_0x5663('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5663('0x0')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5663('0x1')]}};
\ No newline at end of file
+var _0xb683=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x479988,_0x17b763){var _0x17610c=function(_0x1dc420){while(--_0x1dc420){_0x479988['push'](_0x479988['shift']());}};_0x17610c(++_0x17b763);}(_0xb683,0x199));var _0x3b68=function(_0x500d35,_0x3f5d69){_0x500d35=_0x500d35-0x0;var _0x383af4=_0xb683[_0x500d35];return _0x383af4;};'use strict';var Sequelize=require('sequelize');module[_0x3b68('0x0')]={'state':{'type':Sequelize[_0x3b68('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3b68('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x3b68('0x2')]},'originatecalleridname':{'type':Sequelize[_0x3b68('0x2')]},'calleridnum':{'type':Sequelize[_0x3b68('0x2')]},'calleridname':{'type':Sequelize[_0x3b68('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x3b68('0x3')]},'answertime':{'type':Sequelize[_0x3b68('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x3b68('0x3')]},'ringtime':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3b68('0x2')]},'campaign':{'type':Sequelize[_0x3b68('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x3b68('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x3b68('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3b68('0x3')]},'recallme':{'type':Sequelize[_0x3b68('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x3b68('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3b68('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3b68('0x2')]}};
\ No newline at end of file
index 9f37769..c349d22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90f6=['moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','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','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','name','send','index','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','catch','show','params','merge','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0x90f6,0xee));var _0x690f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x90f6[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x690f('0x0'));var rimraf=require(_0x690f('0x1'));var zipdir=require(_0x690f('0x2'));var jsonpatch=require(_0x690f('0x3'));var rp=require(_0x690f('0x4'));var moment=require(_0x690f('0x5'));var BPromise=require(_0x690f('0x6'));var Mustache=require(_0x690f('0x7'));var util=require(_0x690f('0x8'));var path=require(_0x690f('0x9'));var sox=require(_0x690f('0xa'));var csv=require('to-csv');var ejs=require(_0x690f('0xb'));var fs=require('fs');var fs_extra=require(_0x690f('0xc'));var _=require(_0x690f('0xd'));var squel=require('squel');var crypto=require(_0x690f('0xe'));var jsforce=require(_0x690f('0xf'));var deskjs=require(_0x690f('0x10'));var toCsv=require(_0x690f('0x11'));var querystring=require(_0x690f('0x12'));var Papa=require(_0x690f('0x13'));var Redis=require(_0x690f('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x690f('0x15'));var as=require(_0x690f('0x16'));var hardwareService=require(_0x690f('0x17'));var logger=require('../../config/logger')(_0x690f('0x18'));var utils=require(_0x690f('0x19'));var config=require(_0x690f('0x1a'));var licenseUtil=require(_0x690f('0x1b'));var db=require(_0x690f('0x1c'))['db'];function respondWithStatusCode(_0x1f5dc1,_0xca1d7c){_0xca1d7c=_0xca1d7c||0xcc;return function(_0x4807db){if(_0x4807db){return _0x1f5dc1[_0x690f('0x1d')](_0xca1d7c);}return _0x1f5dc1[_0x690f('0x1e')](_0xca1d7c)[_0x690f('0x1f')]();};}function respondWithResult(_0x38de35,_0x2929ef){_0x2929ef=_0x2929ef||0xc8;return function(_0x4efbd7){if(_0x4efbd7){return _0x38de35[_0x690f('0x1e')](_0x2929ef)[_0x690f('0x20')](_0x4efbd7);}};}function respondWithFilteredResult(_0x2ebaed,_0x3faf4d){return function(_0x123688){if(_0x123688){var _0x4ffe36=typeof _0x3faf4d[_0x690f('0x21')]===_0x690f('0x22')&&typeof _0x3faf4d[_0x690f('0x23')]===_0x690f('0x22');var _0x35c549=_0x123688[_0x690f('0x24')];var _0x11ea3e=_0x4ffe36?0x0:_0x3faf4d[_0x690f('0x21')];var _0x5cd8b4=_0x4ffe36?_0x123688[_0x690f('0x24')]:_0x3faf4d[_0x690f('0x21')]+_0x3faf4d[_0x690f('0x23')];var _0x412deb;if(_0x5cd8b4>=_0x35c549){_0x5cd8b4=_0x35c549;_0x412deb=0xc8;}else{_0x412deb=0xce;}_0x2ebaed['status'](_0x412deb);return _0x2ebaed[_0x690f('0x25')]('Content-Range',_0x11ea3e+'-'+_0x5cd8b4+'/'+_0x35c549)['json'](_0x123688);}return null;};}function patchUpdates(_0x1c10a2){return function(_0x4180d0){try{jsonpatch[_0x690f('0x26')](_0x4180d0,_0x1c10a2,!![]);}catch(_0x16a687){return BPromise[_0x690f('0x27')](_0x16a687);}return _0x4180d0[_0x690f('0x28')]();};}function saveUpdates(_0x18f580,_0x3fcb64){return function(_0x192f0f){if(_0x192f0f){return _0x192f0f[_0x690f('0x29')](_0x18f580)['then'](function(_0x484878){return _0x484878;});}return null;};}function removeEntity(_0x319542,_0x5a526f){return function(_0x13691c){if(_0x13691c){return _0x13691c['destroy']()[_0x690f('0x2a')](function(){_0x319542['status'](0xcc)[_0x690f('0x1f')]();});}};}function handleEntityNotFound(_0x560757,_0x5f3ecd){return function(_0x390ba1){if(!_0x390ba1){_0x560757['sendStatus'](0x194);}return _0x390ba1;};}function handleError(_0xcd307e,_0x1373fb){_0x1373fb=_0x1373fb||0x1f4;return function(_0x47aaa8){logger[_0x690f('0x2b')](_0x47aaa8['stack']);if(_0x47aaa8[_0x690f('0x2c')]){delete _0x47aaa8[_0x690f('0x2c')];}_0xcd307e[_0x690f('0x1e')](_0x1373fb)[_0x690f('0x2d')](_0x47aaa8);};}exports[_0x690f('0x2e')]=function(_0x5420b4,_0x2ef027){var _0x4c2bc9={},_0x23f1f5={},_0x2f9641={'count':0x0,'rows':[]};var _0x1856c8=_['map'](db['CmHopperHistory'][_0x690f('0x2f')],function(_0x315538){return{'name':_0x315538['fieldName'],'type':_0x315538[_0x690f('0x30')][_0x690f('0x31')]};});_0x23f1f5[_0x690f('0x32')]=_[_0x690f('0x33')](_0x1856c8,_0x690f('0x2c'));_0x23f1f5['query']=_[_0x690f('0x34')](_0x5420b4[_0x690f('0x35')]);_0x23f1f5[_0x690f('0x36')]=_[_0x690f('0x37')](_0x23f1f5['model'],_0x23f1f5[_0x690f('0x35')]);_0x4c2bc9[_0x690f('0x38')]=_[_0x690f('0x37')](_0x23f1f5[_0x690f('0x32')],qs[_0x690f('0x39')](_0x5420b4[_0x690f('0x35')]['fields']));_0x4c2bc9[_0x690f('0x38')]=_0x4c2bc9[_0x690f('0x38')][_0x690f('0x3a')]?_0x4c2bc9[_0x690f('0x38')]:_0x23f1f5[_0x690f('0x32')];if(!_0x5420b4[_0x690f('0x35')][_0x690f('0x3b')](_0x690f('0x3c'))){_0x4c2bc9['limit']=qs[_0x690f('0x23')](_0x5420b4[_0x690f('0x35')][_0x690f('0x23')]);_0x4c2bc9[_0x690f('0x21')]=qs[_0x690f('0x21')](_0x5420b4['query'][_0x690f('0x21')]);}_0x4c2bc9[_0x690f('0x3d')]=qs['sort'](_0x5420b4[_0x690f('0x35')][_0x690f('0x3e')]);_0x4c2bc9[_0x690f('0x3f')]=qs[_0x690f('0x36')](_[_0x690f('0x40')](_0x5420b4[_0x690f('0x35')],_0x23f1f5[_0x690f('0x36')]),_0x1856c8);if(_0x5420b4[_0x690f('0x35')][_0x690f('0x41')]){_0x4c2bc9[_0x690f('0x3f')]=_['merge'](_0x4c2bc9['where'],{'$or':_['map'](_0x1856c8,function(_0x122cc2){if(_0x122cc2[_0x690f('0x30')]!==_0x690f('0x42')){var _0x46c2d4={};_0x46c2d4[_0x122cc2[_0x690f('0x2c')]]={'$like':'%'+_0x5420b4[_0x690f('0x35')][_0x690f('0x41')]+'%'};return _0x46c2d4;}})});}_0x4c2bc9=_['merge']({},_0x4c2bc9,_0x5420b4[_0x690f('0x43')]);var _0xf0e1e1={'where':_0x4c2bc9[_0x690f('0x3f')]};return db[_0x690f('0x44')][_0x690f('0x24')](_0xf0e1e1)[_0x690f('0x2a')](function(_0x55f651){_0x2f9641[_0x690f('0x24')]=_0x55f651;if(_0x5420b4[_0x690f('0x35')][_0x690f('0x45')]){_0x4c2bc9[_0x690f('0x46')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x690f('0x47')](_0x4c2bc9);})[_0x690f('0x2a')](function(_0x527d48){_0x2f9641['rows']=_0x527d48;return _0x2f9641;})[_0x690f('0x2a')](respondWithFilteredResult(_0x2ef027,_0x4c2bc9))[_0x690f('0x48')](handleError(_0x2ef027,null));};exports[_0x690f('0x49')]=function(_0x3ca234,_0x388969){var _0x480553={'raw':!![],'where':{'id':_0x3ca234[_0x690f('0x4a')]['id']}},_0x3276ed={};_0x3276ed[_0x690f('0x32')]=_[_0x690f('0x34')](db['CmHopperHistory'][_0x690f('0x2f')]);_0x3276ed['query']=_[_0x690f('0x34')](_0x3ca234[_0x690f('0x35')]);_0x3276ed[_0x690f('0x36')]=_[_0x690f('0x37')](_0x3276ed[_0x690f('0x32')],_0x3276ed[_0x690f('0x35')]);_0x480553['attributes']=_[_0x690f('0x37')](_0x3276ed[_0x690f('0x32')],qs[_0x690f('0x39')](_0x3ca234[_0x690f('0x35')][_0x690f('0x39')]));_0x480553[_0x690f('0x38')]=_0x480553[_0x690f('0x38')]['length']?_0x480553[_0x690f('0x38')]:_0x3276ed[_0x690f('0x32')];if(_0x3ca234[_0x690f('0x35')][_0x690f('0x45')]){_0x480553[_0x690f('0x46')]=[{'all':!![]}];}_0x480553=_[_0x690f('0x4b')]({},_0x480553,_0x3ca234['options']);return db[_0x690f('0x44')][_0x690f('0x4c')](_0x480553)[_0x690f('0x2a')](handleEntityNotFound(_0x388969,null))[_0x690f('0x2a')](respondWithResult(_0x388969,null))[_0x690f('0x48')](handleError(_0x388969,null));};exports['create']=function(_0x4d2e30,_0x3c0fee){return db['CmHopperHistory'][_0x690f('0x4d')](_0x4d2e30[_0x690f('0x4e')],{})['then'](respondWithResult(_0x3c0fee,0xc9))[_0x690f('0x48')](handleError(_0x3c0fee,null));};exports[_0x690f('0x4f')]=function(_0x1dd21c,_0x3d646e){return db[_0x690f('0x44')][_0x690f('0x4f')]()[_0x690f('0x2a')](respondWithResult(_0x3d646e,null))[_0x690f('0x48')](handleError(_0x3d646e,null));};exports[_0x690f('0x29')]=function(_0x14ba13,_0xa79341){if(_0x14ba13[_0x690f('0x4e')][_0x690f('0x50')]){delete _0x14ba13[_0x690f('0x4e')][_0x690f('0x50')];}return db['CmHopperHistory'][_0x690f('0x4c')]({'where':{'uniqueid':_0x14ba13[_0x690f('0x4a')]['id']}})[_0x690f('0x2a')](handleEntityNotFound(_0xa79341,null))[_0x690f('0x2a')](saveUpdates(_0x14ba13['body'],null))[_0x690f('0x2a')](respondWithResult(_0xa79341,null))['catch'](handleError(_0xa79341,null));};
\ No newline at end of file
+var _0x0578=['map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','filter','where','includeAll','findAll','show','params','include','options','find','catch','create','describe','body','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index'];(function(_0x5f5768,_0x404c7c){var _0x190b11=function(_0x52a803){while(--_0x52a803){_0x5f5768['push'](_0x5f5768['shift']());}};_0x190b11(++_0x404c7c);}(_0x0578,0xc0));var _0x8057=function(_0x270497,_0x2ba171){_0x270497=_0x270497-0x0;var _0x304dcc=_0x0578[_0x270497];return _0x304dcc;};'use strict';var emlformat=require(_0x8057('0x0'));var rimraf=require(_0x8057('0x1'));var zipdir=require(_0x8057('0x2'));var jsonpatch=require(_0x8057('0x3'));var rp=require(_0x8057('0x4'));var moment=require(_0x8057('0x5'));var BPromise=require(_0x8057('0x6'));var Mustache=require(_0x8057('0x7'));var util=require('util');var path=require(_0x8057('0x8'));var sox=require(_0x8057('0x9'));var csv=require('to-csv');var ejs=require(_0x8057('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8057('0xb'));var squel=require(_0x8057('0xc'));var crypto=require(_0x8057('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8057('0xe'));var toCsv=require(_0x8057('0xf'));var querystring=require(_0x8057('0x10'));var Papa=require(_0x8057('0x11'));var Redis=require(_0x8057('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8057('0x13'));var as=require(_0x8057('0x14'));var hardwareService=require(_0x8057('0x15'));var logger=require(_0x8057('0x16'))(_0x8057('0x17'));var utils=require(_0x8057('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8057('0x19'))['db'];function respondWithStatusCode(_0x54266f,_0x4776ef){_0x4776ef=_0x4776ef||0xcc;return function(_0x3a7c41){if(_0x3a7c41){return _0x54266f[_0x8057('0x1a')](_0x4776ef);}return _0x54266f[_0x8057('0x1b')](_0x4776ef)[_0x8057('0x1c')]();};}function respondWithResult(_0x288361,_0x1a2864){_0x1a2864=_0x1a2864||0xc8;return function(_0x50643a){if(_0x50643a){return _0x288361[_0x8057('0x1b')](_0x1a2864)[_0x8057('0x1d')](_0x50643a);}};}function respondWithFilteredResult(_0x507b84,_0x55e9cf){return function(_0x469761){if(_0x469761){var _0x34b7db=typeof _0x55e9cf[_0x8057('0x1e')]===_0x8057('0x1f')&&typeof _0x55e9cf[_0x8057('0x20')]===_0x8057('0x1f');var _0x1f8e6a=_0x469761[_0x8057('0x21')];var _0x349eed=_0x34b7db?0x0:_0x55e9cf[_0x8057('0x1e')];var _0x34e2e9=_0x34b7db?_0x469761[_0x8057('0x21')]:_0x55e9cf[_0x8057('0x1e')]+_0x55e9cf[_0x8057('0x20')];var _0xa1c92f;if(_0x34e2e9>=_0x1f8e6a){_0x34e2e9=_0x1f8e6a;_0xa1c92f=0xc8;}else{_0xa1c92f=0xce;}_0x507b84['status'](_0xa1c92f);return _0x507b84['set'](_0x8057('0x22'),_0x349eed+'-'+_0x34e2e9+'/'+_0x1f8e6a)[_0x8057('0x1d')](_0x469761);}return null;};}function patchUpdates(_0x5caad2){return function(_0x2f8818){try{jsonpatch[_0x8057('0x23')](_0x2f8818,_0x5caad2,!![]);}catch(_0x54c65b){return BPromise[_0x8057('0x24')](_0x54c65b);}return _0x2f8818[_0x8057('0x25')]();};}function saveUpdates(_0x1f45df,_0x3d9b62){return function(_0xb9b089){if(_0xb9b089){return _0xb9b089[_0x8057('0x26')](_0x1f45df)[_0x8057('0x27')](function(_0x2f689f){return _0x2f689f;});}return null;};}function removeEntity(_0x3aa798,_0x165e8e){return function(_0x3f5b15){if(_0x3f5b15){return _0x3f5b15[_0x8057('0x28')]()[_0x8057('0x27')](function(){_0x3aa798[_0x8057('0x1b')](0xcc)[_0x8057('0x1c')]();});}};}function handleEntityNotFound(_0x25b7ad,_0x2036e3){return function(_0x5c64fa){if(!_0x5c64fa){_0x25b7ad[_0x8057('0x1a')](0x194);}return _0x5c64fa;};}function handleError(_0x462874,_0x2c2ed9){_0x2c2ed9=_0x2c2ed9||0x1f4;return function(_0x2ee50e){logger[_0x8057('0x29')](_0x2ee50e[_0x8057('0x2a')]);if(_0x2ee50e[_0x8057('0x2b')]){delete _0x2ee50e[_0x8057('0x2b')];}_0x462874[_0x8057('0x1b')](_0x2c2ed9)['send'](_0x2ee50e);};}exports[_0x8057('0x2c')]=function(_0x4ed4f4,_0x22b7ee){var _0x2c80e2={},_0x4eb151={},_0x940041={'count':0x0,'rows':[]};var _0x56715f=_[_0x8057('0x2d')](db[_0x8057('0x2e')][_0x8057('0x2f')],function(_0x47ba67){return{'name':_0x47ba67[_0x8057('0x30')],'type':_0x47ba67[_0x8057('0x31')][_0x8057('0x32')]};});_0x4eb151[_0x8057('0x33')]=_[_0x8057('0x2d')](_0x56715f,_0x8057('0x2b'));_0x4eb151[_0x8057('0x34')]=_[_0x8057('0x35')](_0x4ed4f4[_0x8057('0x34')]);_0x4eb151['filters']=_[_0x8057('0x36')](_0x4eb151[_0x8057('0x33')],_0x4eb151[_0x8057('0x34')]);_0x2c80e2[_0x8057('0x37')]=_['intersection'](_0x4eb151['model'],qs[_0x8057('0x38')](_0x4ed4f4['query']['fields']));_0x2c80e2[_0x8057('0x37')]=_0x2c80e2[_0x8057('0x37')][_0x8057('0x39')]?_0x2c80e2[_0x8057('0x37')]:_0x4eb151['model'];if(!_0x4ed4f4[_0x8057('0x34')][_0x8057('0x3a')](_0x8057('0x3b'))){_0x2c80e2['limit']=qs['limit'](_0x4ed4f4[_0x8057('0x34')][_0x8057('0x20')]);_0x2c80e2[_0x8057('0x1e')]=qs['offset'](_0x4ed4f4[_0x8057('0x34')]['offset']);}_0x2c80e2[_0x8057('0x3c')]=qs[_0x8057('0x3d')](_0x4ed4f4['query']['sort']);_0x2c80e2['where']=qs[_0x8057('0x3e')](_[_0x8057('0x3f')](_0x4ed4f4[_0x8057('0x34')],_0x4eb151['filters']),_0x56715f);if(_0x4ed4f4[_0x8057('0x34')]['filter']){_0x2c80e2['where']=_[_0x8057('0x40')](_0x2c80e2['where'],{'$or':_[_0x8057('0x2d')](_0x56715f,function(_0xf4558d){if(_0xf4558d[_0x8057('0x31')]!=='VIRTUAL'){var _0x3745f2={};_0x3745f2[_0xf4558d['name']]={'$like':'%'+_0x4ed4f4[_0x8057('0x34')][_0x8057('0x41')]+'%'};return _0x3745f2;}})});}_0x2c80e2=_['merge']({},_0x2c80e2,_0x4ed4f4['options']);var _0x2dd9f2={'where':_0x2c80e2[_0x8057('0x42')]};return db[_0x8057('0x2e')][_0x8057('0x21')](_0x2dd9f2)[_0x8057('0x27')](function(_0x78b998){_0x940041[_0x8057('0x21')]=_0x78b998;if(_0x4ed4f4[_0x8057('0x34')][_0x8057('0x43')]){_0x2c80e2['include']=[{'all':!![]}];}return db[_0x8057('0x2e')][_0x8057('0x44')](_0x2c80e2);})['then'](function(_0x252202){_0x940041['rows']=_0x252202;return _0x940041;})['then'](respondWithFilteredResult(_0x22b7ee,_0x2c80e2))['catch'](handleError(_0x22b7ee,null));};exports[_0x8057('0x45')]=function(_0x48e7a1,_0xbd542d){var _0x448851={'raw':!![],'where':{'id':_0x48e7a1[_0x8057('0x46')]['id']}},_0x25845e={};_0x25845e[_0x8057('0x33')]=_['keys'](db['CmHopperHistory'][_0x8057('0x2f')]);_0x25845e[_0x8057('0x34')]=_[_0x8057('0x35')](_0x48e7a1['query']);_0x25845e[_0x8057('0x3e')]=_[_0x8057('0x36')](_0x25845e[_0x8057('0x33')],_0x25845e[_0x8057('0x34')]);_0x448851['attributes']=_[_0x8057('0x36')](_0x25845e[_0x8057('0x33')],qs[_0x8057('0x38')](_0x48e7a1['query'][_0x8057('0x38')]));_0x448851[_0x8057('0x37')]=_0x448851[_0x8057('0x37')][_0x8057('0x39')]?_0x448851[_0x8057('0x37')]:_0x25845e['model'];if(_0x48e7a1[_0x8057('0x34')][_0x8057('0x43')]){_0x448851[_0x8057('0x47')]=[{'all':!![]}];}_0x448851=_[_0x8057('0x40')]({},_0x448851,_0x48e7a1[_0x8057('0x48')]);return db[_0x8057('0x2e')][_0x8057('0x49')](_0x448851)[_0x8057('0x27')](handleEntityNotFound(_0xbd542d,null))[_0x8057('0x27')](respondWithResult(_0xbd542d,null))[_0x8057('0x4a')](handleError(_0xbd542d,null));};exports['create']=function(_0x4e3f26,_0x522e0e){return db['CmHopperHistory'][_0x8057('0x4b')](_0x4e3f26['body'],{})[_0x8057('0x27')](respondWithResult(_0x522e0e,0xc9))['catch'](handleError(_0x522e0e,null));};exports['describe']=function(_0x2a26b2,_0x12bc45){return db[_0x8057('0x2e')][_0x8057('0x4c')]()[_0x8057('0x27')](respondWithResult(_0x12bc45,null))[_0x8057('0x4a')](handleError(_0x12bc45,null));};exports['update']=function(_0x109432,_0x42abe8){if(_0x109432[_0x8057('0x4d')][_0x8057('0x4e')]){delete _0x109432['body']['uniqueid'];}return db[_0x8057('0x2e')][_0x8057('0x49')]({'where':{'uniqueid':_0x109432[_0x8057('0x46')]['id']}})[_0x8057('0x27')](handleEntityNotFound(_0x42abe8,null))[_0x8057('0x27')](saveUpdates(_0x109432[_0x8057('0x4d')],null))[_0x8057('0x27')](respondWithResult(_0x42abe8,null))[_0x8057('0x4a')](handleError(_0x42abe8,null));};
\ No newline at end of file
index 3e642c3..084a790 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x508a=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','define','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x508a,0x1aa));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa508('0x0'));var util=require('util');var logger=require(_0xa508('0x1'))(_0xa508('0x2'));var moment=require(_0xa508('0x3'));var BPromise=require(_0xa508('0x4'));var rp=require(_0xa508('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa508('0x6'));var config=require(_0xa508('0x7'));var attributes=require(_0xa508('0x8'));module['exports']=function(_0x89d08e,_0x11c154){return _0x89d08e[_0xa508('0x9')]('CmHopperHistory',attributes,{'tableName':_0xa508('0xa'),'paranoid':![],'indexes':[{'name':_0xa508('0xb'),'fields':['endtime']},{'name':_0xa508('0xc'),'fields':[_0xa508('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x18b2=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x18b2,0x85));var _0x218b=function(_0x12987f,_0x2040d8){_0x12987f=_0x12987f-0x0;var _0x5c674c=_0x18b2[_0x12987f];return _0x5c674c;};'use strict';var _=require('lodash');var util=require(_0x218b('0x0'));var logger=require(_0x218b('0x1'))(_0x218b('0x2'));var moment=require('moment');var BPromise=require(_0x218b('0x3'));var rp=require(_0x218b('0x4'));var fs=require('fs');var path=require(_0x218b('0x5'));var rimraf=require(_0x218b('0x6'));var config=require(_0x218b('0x7'));var attributes=require(_0x218b('0x8'));module[_0x218b('0x9')]=function(_0x3a9261,_0x1c2c17){return _0x3a9261[_0x218b('0xa')](_0x218b('0xb'),attributes,{'tableName':_0x218b('0xc'),'paranoid':![],'indexes':[{'name':_0x218b('0xd'),'fields':[_0x218b('0xd')]},{'name':_0x218b('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index c8b6dbe..d78266f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec3=['predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','debug','GetCampaignHopperHistory','where','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperHistory,\x20%s,\x20%s','CreateCmHopperHistory','CmHopperHistory','body','options','AvgHandleTime','findAll','raw','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime'];(function(_0x8ca0e6,_0x3681d3){var _0x1e9654=function(_0x385e5b){while(--_0x385e5b){_0x8ca0e6['push'](_0x8ca0e6['shift']());}};_0x1e9654(++_0x3681d3);}(_0xeec3,0x1c3));var _0x3eec=function(_0x17bd62,_0x5ea16b){_0x17bd62=_0x17bd62-0x0;var _0x483c2c=_0xeec3[_0x17bd62];return _0x483c2c;};'use strict';var _=require(_0x3eec('0x0'));var util=require(_0x3eec('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(_0x3eec('0x2'));var logger=require(_0x3eec('0x3'))('rpc');var config=require(_0x3eec('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x3eec('0x5')][_0x3eec('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x57be71,_0x3a019f,_0x3b8171){return new BPromise(function(_0xa6821e,_0x3dcfdb){return client[_0x3eec('0x7')](_0x57be71,_0x3b8171)[_0x3eec('0x8')](function(_0xd06d6c){logger[_0x3eec('0x9')]('CmHopperHistory,\x20%s,\x20%s',_0x3a019f,_0x3eec('0xa'));logger['debug'](_0x3eec('0xb'),_0x3a019f,_0x3eec('0xa'),JSON[_0x3eec('0xc')](_0xd06d6c));if(_0xd06d6c[_0x3eec('0xd')]){if(_0xd06d6c['error'][_0x3eec('0xe')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x3a019f,_0xd06d6c['error'][_0x3eec('0xf')]);return _0x3dcfdb(_0xd06d6c[_0x3eec('0xd')][_0x3eec('0xf')]);}logger[_0x3eec('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x3a019f,_0xd06d6c[_0x3eec('0xd')]['message']);return _0xa6821e(_0xd06d6c['error']['message']);}else{logger[_0x3eec('0x9')]('CmHopperHistory,\x20%s,\x20%s',_0x3a019f,'request\x20sent');_0xa6821e(_0xd06d6c[_0x3eec('0x10')][_0x3eec('0xf')]);}})[_0x3eec('0x11')](function(_0x48b170){logger['error'](_0x3eec('0x12'),_0x3a019f,_0x48b170);_0x3dcfdb(_0x48b170);});});}exports[_0x3eec('0x13')]=function(_0x500109){var _0x1c1251=this;return new Promise(function(_0x497d60,_0x140639){return db[_0x3eec('0x14')]['create'](_0x500109[_0x3eec('0x15')],{'raw':_0x500109['options']?_0x500109[_0x3eec('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x3eec('0x8')](function(_0x2dd282){logger['info'](_0x3eec('0x13'),_0x500109);logger['debug']('CreateCmHopperHistory',_0x500109,JSON[_0x3eec('0xc')](_0x2dd282));_0x497d60(_0x2dd282);})[_0x3eec('0x11')](function(_0x4847b3){logger[_0x3eec('0xd')]('CreateCmHopperHistory',_0x4847b3[_0x3eec('0xf')],_0x500109);_0x140639(_0x1c1251[_0x3eec('0xd')](0x1f4,_0x4847b3[_0x3eec('0xf')]));});});};exports[_0x3eec('0x17')]=function(_0x3cda64){var _0x203b3f=this;return new Promise(function(_0x34fbe4,_0x1023a0){return db[_0x3eec('0x14')][_0x3eec('0x18')]({'raw':_0x3cda64[_0x3eec('0x16')]?_0x3cda64[_0x3eec('0x16')][_0x3eec('0x19')]===undefined?!![]:![]:!![],'where':_0x3cda64['options']?_0x3cda64[_0x3eec('0x16')]['where']||null:null,'attributes':[[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')][_0x3eec('0x1c')]('id')),_0x3eec('0x1d')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')][_0x3eec('0x1e')](_0x3eec('0x1f')))),_0x3eec('0x20')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')]['literal'](_0x3eec('0x21')))),_0x3eec('0x22')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x3eec('0x23')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x24'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')][_0x3eec('0x1e')](_0x3eec('0x25')))),_0x3eec('0x26')],[db['sequelize']['fn'](_0x3eec('0x24'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x3eec('0x27')]]})[_0x3eec('0x8')](function(_0x5e4efe){logger['info'](_0x3eec('0x17'),_0x3cda64);logger['debug'](_0x3eec('0x17'),_0x3cda64,JSON[_0x3eec('0xc')](_0x5e4efe));_0x34fbe4(_0x5e4efe);})['catch'](function(_0x1cf03a){logger[_0x3eec('0xd')]('AvgHandleTime',_0x1cf03a['message'],_0x3cda64);_0x1023a0(_0x203b3f[_0x3eec('0xd')](0x1f4,_0x1cf03a[_0x3eec('0xf')]));});});};exports[_0x3eec('0x28')]=function(_0x4f5c6e){var _0x2a8297=this;return new Promise(function(_0x5f4b3f,_0x5c1b5e){return db['CmHopperHistory'][_0x3eec('0x18')]({'raw':_0x4f5c6e[_0x3eec('0x16')]?_0x4f5c6e[_0x3eec('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4f5c6e[_0x3eec('0x16')]?_0x4f5c6e[_0x3eec('0x16')]['where']||null:null,'attributes':[[_0x3eec('0x29'),'name'],[db['sequelize']['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')][_0x3eec('0x1e')]('`state`\x20=\x200,\x201,\x20null'))),_0x3eec('0x2a')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x3eec('0x2b')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')][_0x3eec('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0x3eec('0x2c')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')][_0x3eec('0x1e')]('`state`\x20=\x205,\x201,\x20null'))),_0x3eec('0x2d')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')][_0x3eec('0x1e')](_0x3eec('0x2e')))),_0x3eec('0x2f')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')][_0x3eec('0x1e')](_0x3eec('0x30')))),_0x3eec('0x31')],[db['sequelize']['fn'](_0x3eec('0x1b'),db['sequelize']['fn']('IF',db[_0x3eec('0x1a')]['literal'](_0x3eec('0x32')))),_0x3eec('0x33')],[db['sequelize']['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db['sequelize'][_0x3eec('0x1e')](_0x3eec('0x34')))),_0x3eec('0x35')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db['sequelize']['literal'](_0x3eec('0x36')))),_0x3eec('0x37')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db['sequelize'][_0x3eec('0x1e')](_0x3eec('0x38')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db['sequelize'][_0x3eec('0x1e')](_0x3eec('0x39')))),_0x3eec('0x3a')],[db['sequelize']['fn'](_0x3eec('0x1b'),db['sequelize']['fn']('IF',db[_0x3eec('0x1a')][_0x3eec('0x1e')](_0x3eec('0x3b')))),_0x3eec('0x3c')],[db['sequelize']['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')][_0x3eec('0x1e')](_0x3eec('0x3d')))),_0x3eec('0x3a')],[db['sequelize']['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db['sequelize'][_0x3eec('0x1e')](_0x3eec('0x3e')))),_0x3eec('0x3f')]],'group':[_0x3eec('0x29')]})['then'](function(_0xae7b70){logger[_0x3eec('0x9')](_0x3eec('0x28'),_0x4f5c6e);logger[_0x3eec('0x40')](_0x3eec('0x28'),_0x4f5c6e,JSON[_0x3eec('0xc')](_0xae7b70));_0x5f4b3f(_0xae7b70);})['catch'](function(_0x22a8ce){logger[_0x3eec('0xd')](_0x3eec('0x28'),_0x22a8ce['message'],_0x4f5c6e);_0x5c1b5e(_0x2a8297[_0x3eec('0xd')](0x1f4,_0x22a8ce['message']));});});};exports[_0x3eec('0x41')]=function(_0x4b390a){var _0x10cb90=this;return new Promise(function(_0x4da4fa,_0x11ab79){return db[_0x3eec('0x14')][_0x3eec('0x18')]({'raw':_0x4b390a[_0x3eec('0x16')]?_0x4b390a['options'][_0x3eec('0x19')]===undefined?!![]:![]:!![],'where':_0x4b390a[_0x3eec('0x16')]?_0x4b390a[_0x3eec('0x16')][_0x3eec('0x42')]||null:null,'attributes':[[_0x3eec('0x29'),_0x3eec('0x43')],[db['sequelize']['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')][_0x3eec('0x1c')]('id')),_0x3eec('0x44')],[db[_0x3eec('0x1a')]['fn'](_0x3eec('0x1b'),db[_0x3eec('0x1a')]['fn']('IF',db[_0x3eec('0x1a')][_0x3eec('0x1e')](_0x3eec('0x1f')))),_0x3eec('0x45')]],'group':[_0x3eec('0x29')]})['then'](function(_0x2030e8){logger[_0x3eec('0x9')](_0x3eec('0x41'),_0x4b390a);logger[_0x3eec('0x40')](_0x3eec('0x41'),_0x4b390a,JSON[_0x3eec('0xc')](_0x2030e8));_0x4da4fa(_0x2030e8);})[_0x3eec('0x11')](function(_0x53a0e5){logger['error'](_0x3eec('0x41'),_0x53a0e5[_0x3eec('0xf')],_0x4b390a);_0x11ab79(_0x10cb90['error'](0x1f4,_0x53a0e5['message']));});});};
\ No newline at end of file
+var _0x25a8=['outboundNoSuchCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundReCallsDay','GetVoiceQueueHopperHistory','CmHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','CreateCmHopperHistory','create','body','options','raw','then','catch','AvgHandleTime','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','stringify','campaign','`state`\x20=\x200,\x201,\x20null'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x25a8,0x126));var _0x825a=function(_0x28d519,_0x741257){_0x28d519=_0x28d519-0x0;var _0xcf2fe6=_0x25a8[_0x28d519];return _0xcf2fe6;};'use strict';var _=require('lodash');var util=require(_0x825a('0x0'));var moment=require(_0x825a('0x1'));var BPromise=require(_0x825a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x825a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x825a('0x4'));var logger=require(_0x825a('0x5'))(_0x825a('0x6'));var config=require(_0x825a('0x7'));var jayson=require(_0x825a('0x8'));var client=jayson[_0x825a('0x9')][_0x825a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29a13c,_0x31be45,_0x215c51){return new BPromise(function(_0x4edb07,_0x13b61d){return client['request'](_0x29a13c,_0x215c51)['then'](function(_0x48696e){logger[_0x825a('0xb')](_0x825a('0xc'),_0x31be45,'request\x20sent');logger[_0x825a('0xd')](_0x825a('0xe'),_0x31be45,_0x825a('0xf'),JSON['stringify'](_0x48696e));if(_0x48696e[_0x825a('0x10')]){if(_0x48696e[_0x825a('0x10')]['code']===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x31be45,_0x48696e[_0x825a('0x10')][_0x825a('0x11')]);return _0x13b61d(_0x48696e[_0x825a('0x10')][_0x825a('0x11')]);}logger[_0x825a('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x31be45,_0x48696e[_0x825a('0x10')][_0x825a('0x11')]);return _0x4edb07(_0x48696e[_0x825a('0x10')][_0x825a('0x11')]);}else{logger[_0x825a('0xb')](_0x825a('0xc'),_0x31be45,_0x825a('0xf'));_0x4edb07(_0x48696e[_0x825a('0x12')][_0x825a('0x11')]);}})['catch'](function(_0x77b603){logger['error'](_0x825a('0xc'),_0x31be45,_0x77b603);_0x13b61d(_0x77b603);});});}exports[_0x825a('0x13')]=function(_0x4a65b6){var _0x364bd1=this;return new Promise(function(_0x5ad432,_0x1007e3){return db['CmHopperHistory'][_0x825a('0x14')](_0x4a65b6[_0x825a('0x15')],{'raw':_0x4a65b6[_0x825a('0x16')]?_0x4a65b6[_0x825a('0x16')][_0x825a('0x17')]===undefined?!![]:![]:!![]})[_0x825a('0x18')](function(_0x208709){logger['info']('CreateCmHopperHistory',_0x4a65b6);logger[_0x825a('0xd')](_0x825a('0x13'),_0x4a65b6,JSON['stringify'](_0x208709));_0x5ad432(_0x208709);})[_0x825a('0x19')](function(_0xc8b2fa){logger[_0x825a('0x10')](_0x825a('0x13'),_0xc8b2fa[_0x825a('0x11')],_0x4a65b6);_0x1007e3(_0x364bd1[_0x825a('0x10')](0x1f4,_0xc8b2fa[_0x825a('0x11')]));});});};exports[_0x825a('0x1a')]=function(_0xdc1fd6){var _0x39ea98=this;return new Promise(function(_0x44f27c,_0xaa4f4a){return db['CmHopperHistory'][_0x825a('0x1b')]({'raw':_0xdc1fd6['options']?_0xdc1fd6['options'][_0x825a('0x17')]===undefined?!![]:![]:!![],'where':_0xdc1fd6[_0x825a('0x16')]?_0xdc1fd6['options'][_0x825a('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')][_0x825a('0x1f')]('id')),_0x825a('0x20')],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db['sequelize']['fn']('IF',db[_0x825a('0x1e')]['literal'](_0x825a('0x21')))),_0x825a('0x22')],[db['sequelize']['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')](_0x825a('0x24')))),_0x825a('0x25')],[db[_0x825a('0x1e')]['fn']('COUNT',db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),_0x825a('0x26')],[db[_0x825a('0x1e')]['fn']('AVG',db[_0x825a('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x825a('0x27')],[db[_0x825a('0x1e')]['fn'](_0x825a('0x28'),db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')](_0x825a('0x29')))),_0x825a('0x2a')]]})['then'](function(_0x151bcf){logger['info'](_0x825a('0x1a'),_0xdc1fd6);logger[_0x825a('0xd')](_0x825a('0x1a'),_0xdc1fd6,JSON[_0x825a('0x2b')](_0x151bcf));_0x44f27c(_0x151bcf);})['catch'](function(_0x45c539){logger[_0x825a('0x10')](_0x825a('0x1a'),_0x45c539[_0x825a('0x11')],_0xdc1fd6);_0xaa4f4a(_0x39ea98[_0x825a('0x10')](0x1f4,_0x45c539['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x237d3a){var _0x468abc=this;return new Promise(function(_0xe246c7,_0x4d8726){return db['CmHopperHistory'][_0x825a('0x1b')]({'raw':_0x237d3a[_0x825a('0x16')]?_0x237d3a[_0x825a('0x16')][_0x825a('0x17')]===undefined?!![]:![]:!![],'where':_0x237d3a[_0x825a('0x16')]?_0x237d3a['options'][_0x825a('0x1c')]||null:null,'attributes':[[_0x825a('0x2c'),'name'],[db[_0x825a('0x1e')]['fn']('COUNT',db[_0x825a('0x1e')]['fn']('IF',db['sequelize'][_0x825a('0x23')](_0x825a('0x2d')))),_0x825a('0x2e')],[db['sequelize']['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x825a('0x1d'),db['sequelize']['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')](_0x825a('0x21')))),'outboundAnswerCallsDay'],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db['sequelize']['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')](_0x825a('0x2f')))),_0x825a('0x30')],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')](_0x825a('0x31')))),_0x825a('0x32')],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')]['fn']('IF',db['sequelize'][_0x825a('0x23')](_0x825a('0x33')))),'outboundDropCallsDayTimeout'],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')](_0x825a('0x34')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0x825a('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x825a('0x23')]('`state`\x20=\x2012,\x201,\x20null'))),_0x825a('0x35')],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db['sequelize']['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')](_0x825a('0x36')))),_0x825a('0x37')],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')]['literal'](_0x825a('0x38')))),'outboundOriginateFailureCallsDay'],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db['sequelize']['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')](_0x825a('0x39')))),_0x825a('0x3a')],[db['sequelize']['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')](_0x825a('0x3b')))),_0x825a('0x3c')],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x825a('0x3a')],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x825a('0x3d')]],'group':[_0x825a('0x2c')]})[_0x825a('0x18')](function(_0x3cc95c){logger[_0x825a('0xb')](_0x825a('0x3e'),_0x237d3a);logger['debug'](_0x825a('0x3e'),_0x237d3a,JSON[_0x825a('0x2b')](_0x3cc95c));_0xe246c7(_0x3cc95c);})['catch'](function(_0x396ce3){logger['error'](_0x825a('0x3e'),_0x396ce3[_0x825a('0x11')],_0x237d3a);_0x4d8726(_0x468abc[_0x825a('0x10')](0x1f4,_0x396ce3[_0x825a('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x54381f){var _0x45b6a2=this;return new Promise(function(_0x26ac5e,_0xf15c99){return db[_0x825a('0x3f')][_0x825a('0x1b')]({'raw':_0x54381f[_0x825a('0x16')]?_0x54381f[_0x825a('0x16')][_0x825a('0x17')]===undefined?!![]:![]:!![],'where':_0x54381f['options']?_0x54381f['options']['where']||null:null,'attributes':[['campaign',_0x825a('0x40')],[db[_0x825a('0x1e')]['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')][_0x825a('0x1f')]('id')),_0x825a('0x41')],[db['sequelize']['fn'](_0x825a('0x1d'),db[_0x825a('0x1e')]['fn']('IF',db[_0x825a('0x1e')][_0x825a('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0x825a('0x42')]],'group':['campaign']})['then'](function(_0x3e7f97){logger['info'](_0x825a('0x43'),_0x54381f);logger['debug'](_0x825a('0x43'),_0x54381f,JSON['stringify'](_0x3e7f97));_0x26ac5e(_0x3e7f97);})[_0x825a('0x19')](function(_0x587485){logger[_0x825a('0x10')](_0x825a('0x43'),_0x587485[_0x825a('0x11')],_0x54381f);_0xf15c99(_0x45b6a2['error'](0x1f4,_0x587485[_0x825a('0x11')]));});});};
\ No newline at end of file
index bdb999b..38b7764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3806=['put','update','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id','show','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3806,0x178));var _0x6380=function(_0xf9bc64,_0x424295){_0xf9bc64=_0xf9bc64-0x0;var _0x526317=_0x3806[_0xf9bc64];return _0x526317;};'use strict';var multer=require(_0x6380('0x0'));var util=require(_0x6380('0x1'));var path=require(_0x6380('0x2'));var timeout=require(_0x6380('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6380('0x4'));var auth=require(_0x6380('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6380('0x6'));var controller=require(_0x6380('0x7'));router[_0x6380('0x8')]('/',auth[_0x6380('0x9')](),controller['index']);router[_0x6380('0x8')](_0x6380('0xa'),auth[_0x6380('0x9')](),controller[_0x6380('0xb')]);router[_0x6380('0x8')](_0x6380('0xc'),auth[_0x6380('0x9')](),controller[_0x6380('0xd')]);router['post']('/',auth[_0x6380('0x9')](),controller[_0x6380('0xe')]);router[_0x6380('0xf')](_0x6380('0xc'),auth[_0x6380('0x9')](),controller[_0x6380('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x6b62=['isAuthenticated','index','/describe','/:id','show','post','create','put','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get'];(function(_0x464eb8,_0x581b99){var _0x4f3483=function(_0x41f74b){while(--_0x41f74b){_0x464eb8['push'](_0x464eb8['shift']());}};_0x4f3483(++_0x581b99);}(_0x6b62,0x1a6));var _0x26b6=function(_0xa30598,_0x438a0e){_0xa30598=_0xa30598-0x0;var _0xbd5948=_0x6b62[_0xa30598];return _0xbd5948;};'use strict';var multer=require(_0x26b6('0x0'));var util=require(_0x26b6('0x1'));var path=require(_0x26b6('0x2'));var timeout=require(_0x26b6('0x3'));var express=require(_0x26b6('0x4'));var router=express[_0x26b6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x26b6('0x6'));var interaction=require(_0x26b6('0x7'));var config=require('../../config/environment');var controller=require(_0x26b6('0x8'));router[_0x26b6('0x9')]('/',auth[_0x26b6('0xa')](),controller[_0x26b6('0xb')]);router[_0x26b6('0x9')](_0x26b6('0xc'),auth[_0x26b6('0xa')](),controller['describe']);router[_0x26b6('0x9')](_0x26b6('0xd'),auth['isAuthenticated'](),controller[_0x26b6('0xe')]);router[_0x26b6('0xf')]('/',auth['isAuthenticated'](),controller[_0x26b6('0x10')]);router[_0x26b6('0x11')]('/:id',auth[_0x26b6('0xa')](),controller['update']);module['exports']=router;
\ No newline at end of file
index ba90124..c374b94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd846=['sequelize','exports','STRING'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0xd846,0x195));var _0x6d84=function(_0x4d516a,_0x3e2339){_0x4d516a=_0x4d516a-0x0;var _0x1d8ff=_0xd846[_0x4d516a];return _0x1d8ff;};'use strict';var Sequelize=require(_0x6d84('0x0'));module[_0x6d84('0x1')]={'name':{'type':Sequelize[_0x6d84('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x6d84('0x2')]}};
\ No newline at end of file
+var _0x09f4=['STRING','name'];(function(_0xeef058,_0x2b5251){var _0x21770f=function(_0x3d76a2){while(--_0x3d76a2){_0xeef058['push'](_0xeef058['shift']());}};_0x21770f(++_0x2b5251);}(_0x09f4,0xe4));var _0x409f=function(_0x28e9ff,_0x138f17){_0x28e9ff=_0x28e9ff-0x0;var _0xfd6e53=_0x09f4[_0x28e9ff];return _0xfd6e53;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x409f('0x0')],'unique':_0x409f('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x409f('0x0')]},'dialPrefix':{'type':Sequelize[_0x409f('0x0')]}};
\ No newline at end of file
index e90127c..6f6001e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16fa=['sort','pick','filter','where','merge','VIRTUAL','options','CmList','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','each','omit','success','dataValues','message','json','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','concat','writeFileSync','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','text/csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x16fa,0x179));var _0xa16f=function(_0x3bceea,_0x58af75){_0x3bceea=_0x3bceea-0x0;var _0x30a8d3=_0x16fa[_0x3bceea];return _0x30a8d3;};'use strict';var emlformat=require(_0xa16f('0x0'));var rimraf=require(_0xa16f('0x1'));var zipdir=require(_0xa16f('0x2'));var jsonpatch=require(_0xa16f('0x3'));var rp=require('request-promise');var moment=require(_0xa16f('0x4'));var BPromise=require(_0xa16f('0x5'));var Mustache=require(_0xa16f('0x6'));var util=require(_0xa16f('0x7'));var path=require(_0xa16f('0x8'));var sox=require(_0xa16f('0x9'));var csv=require(_0xa16f('0xa'));var ejs=require(_0xa16f('0xb'));var fs=require('fs');var fs_extra=require(_0xa16f('0xc'));var _=require(_0xa16f('0xd'));var squel=require(_0xa16f('0xe'));var crypto=require(_0xa16f('0xf'));var jsforce=require(_0xa16f('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa16f('0x11'));var Redis=require(_0xa16f('0x12'));var authService=require(_0xa16f('0x13'));var qs=require(_0xa16f('0x14'));var as=require(_0xa16f('0x15'));var hardwareService=require(_0xa16f('0x16'));var logger=require(_0xa16f('0x17'))('api');var utils=require(_0xa16f('0x18'));var config=require(_0xa16f('0x19'));var licenseUtil=require(_0xa16f('0x1a'));var db=require(_0xa16f('0x1b'))['db'];config['redis']=_[_0xa16f('0x1c')](config[_0xa16f('0x1d')],{'host':_0xa16f('0x1e'),'port':0x18eb});var socket=require(_0xa16f('0x1f'))(new Redis(config[_0xa16f('0x1d')]));require('./cmList.socket')[_0xa16f('0x20')](socket);function respondWithStatusCode(_0x1dd5ff,_0x5c2d38){_0x5c2d38=_0x5c2d38||0xcc;return function(_0x3f21df){if(_0x3f21df){return _0x1dd5ff[_0xa16f('0x21')](_0x5c2d38);}return _0x1dd5ff[_0xa16f('0x22')](_0x5c2d38)[_0xa16f('0x23')]();};}function respondWithResult(_0x11df7f,_0xe91006){_0xe91006=_0xe91006||0xc8;return function(_0x301563){if(_0x301563){return _0x11df7f['status'](_0xe91006)['json'](_0x301563);}};}function respondWithFilteredResult(_0x5d687d,_0x23ae38){return function(_0x5352e0){if(_0x5352e0){var _0x23f0f7=typeof _0x23ae38[_0xa16f('0x24')]===_0xa16f('0x25')&&typeof _0x23ae38[_0xa16f('0x26')]==='undefined';var _0xabd188=_0x5352e0['count'];var _0x5449cd=_0x23f0f7?0x0:_0x23ae38[_0xa16f('0x24')];var _0x308bb0=_0x23f0f7?_0x5352e0[_0xa16f('0x27')]:_0x23ae38[_0xa16f('0x24')]+_0x23ae38['limit'];var _0x2d0fea;if(_0x308bb0>=_0xabd188){_0x308bb0=_0xabd188;_0x2d0fea=0xc8;}else{_0x2d0fea=0xce;}_0x5d687d[_0xa16f('0x22')](_0x2d0fea);return _0x5d687d[_0xa16f('0x28')](_0xa16f('0x29'),_0x5449cd+'-'+_0x308bb0+'/'+_0xabd188)['json'](_0x5352e0);}return null;};}function patchUpdates(_0x27b1b1){return function(_0x35cf3a){try{jsonpatch[_0xa16f('0x2a')](_0x35cf3a,_0x27b1b1,!![]);}catch(_0x258be3){return BPromise[_0xa16f('0x2b')](_0x258be3);}return _0x35cf3a[_0xa16f('0x2c')]();};}function saveUpdates(_0x3c9fd3,_0x5d34ec){return function(_0x45fb56){if(_0x45fb56){return _0x45fb56[_0xa16f('0x2d')](_0x3c9fd3)[_0xa16f('0x2e')](function(_0x511e6f){return _0x511e6f;});}return null;};}function removeEntity(_0x52f811,_0x3e34cb){return function(_0x2ad84d){if(_0x2ad84d){return _0x2ad84d['destroy']()['then'](function(){var _0x1633ad=_0x2ad84d[_0xa16f('0x2f')]({'plain':!![]});var _0x5a5037=_0xa16f('0x30');return db[_0xa16f('0x31')][_0xa16f('0x32')]({'where':{'type':_0x5a5037,'resourceId':_0x1633ad['id']}})[_0xa16f('0x2e')](function(){return _0x2ad84d;});})[_0xa16f('0x2e')](function(){_0x52f811[_0xa16f('0x22')](0xcc)[_0xa16f('0x23')]();});}};}function handleEntityNotFound(_0x428d53,_0x2dcff4){return function(_0x1456a7){if(!_0x1456a7){_0x428d53[_0xa16f('0x21')](0x194);}return _0x1456a7;};}function handleError(_0x54441d,_0x12cc92){_0x12cc92=_0x12cc92||0x1f4;return function(_0x425490){logger['error'](_0x425490['stack']);if(_0x425490['name']){delete _0x425490[_0xa16f('0x33')];}_0x54441d[_0xa16f('0x22')](_0x12cc92)['send'](_0x425490);};}exports['index']=function(_0x1f2327,_0x41fd5b){var _0x1fe285={},_0x2935bd={},_0x50b80e={'count':0x0,'rows':[]};var _0x442db7=_[_0xa16f('0x34')](db['CmList'][_0xa16f('0x35')],function(_0x4e0245){return{'name':_0x4e0245['fieldName'],'type':_0x4e0245[_0xa16f('0x36')][_0xa16f('0x37')]};});_0x2935bd[_0xa16f('0x38')]=_[_0xa16f('0x34')](_0x442db7,_0xa16f('0x33'));_0x2935bd[_0xa16f('0x39')]=_[_0xa16f('0x3a')](_0x1f2327[_0xa16f('0x39')]);_0x2935bd[_0xa16f('0x3b')]=_[_0xa16f('0x3c')](_0x2935bd[_0xa16f('0x38')],_0x2935bd[_0xa16f('0x39')]);_0x1fe285[_0xa16f('0x3d')]=_[_0xa16f('0x3c')](_0x2935bd['model'],qs[_0xa16f('0x3e')](_0x1f2327[_0xa16f('0x39')]['fields']));_0x1fe285[_0xa16f('0x3d')]=_0x1fe285['attributes'][_0xa16f('0x3f')]?_0x1fe285[_0xa16f('0x3d')]:_0x2935bd[_0xa16f('0x38')];if(!_0x1f2327[_0xa16f('0x39')][_0xa16f('0x40')](_0xa16f('0x41'))){_0x1fe285['limit']=qs['limit'](_0x1f2327[_0xa16f('0x39')][_0xa16f('0x26')]);_0x1fe285[_0xa16f('0x24')]=qs['offset'](_0x1f2327[_0xa16f('0x39')][_0xa16f('0x24')]);}_0x1fe285[_0xa16f('0x42')]=qs[_0xa16f('0x43')](_0x1f2327[_0xa16f('0x39')][_0xa16f('0x43')]);_0x1fe285['where']=qs[_0xa16f('0x3b')](_[_0xa16f('0x44')](_0x1f2327[_0xa16f('0x39')],_0x2935bd['filters']),_0x442db7);if(_0x1f2327[_0xa16f('0x39')][_0xa16f('0x45')]){_0x1fe285[_0xa16f('0x46')]=_[_0xa16f('0x47')](_0x1fe285[_0xa16f('0x46')],{'$or':_[_0xa16f('0x34')](_0x442db7,function(_0x13ebab){if(_0x13ebab[_0xa16f('0x36')]!==_0xa16f('0x48')){var _0x43f6c9={};_0x43f6c9[_0x13ebab['name']]={'$like':'%'+_0x1f2327[_0xa16f('0x39')][_0xa16f('0x45')]+'%'};return _0x43f6c9;}})});}_0x1fe285=_['merge']({},_0x1fe285,_0x1f2327[_0xa16f('0x49')]);var _0x5e39f2={'where':_0x1fe285[_0xa16f('0x46')]};return db[_0xa16f('0x4a')][_0xa16f('0x27')](_0x5e39f2)[_0xa16f('0x2e')](function(_0x3e18bb){_0x50b80e[_0xa16f('0x27')]=_0x3e18bb;if(_0x1f2327[_0xa16f('0x39')][_0xa16f('0x4b')]){_0x1fe285[_0xa16f('0x4c')]=[{'all':!![]}];}return db[_0xa16f('0x4a')][_0xa16f('0x4d')](_0x1fe285);})[_0xa16f('0x2e')](function(_0x2611f9){_0x50b80e[_0xa16f('0x4e')]=_0x2611f9;return _0x50b80e;})[_0xa16f('0x2e')](respondWithFilteredResult(_0x41fd5b,_0x1fe285))[_0xa16f('0x4f')](handleError(_0x41fd5b,null));};exports[_0xa16f('0x50')]=function(_0x54547b,_0x53c0cb){var _0x5d268b={'raw':![],'where':{'id':_0x54547b[_0xa16f('0x51')]['id']}},_0x79213d={};_0x79213d[_0xa16f('0x38')]=_[_0xa16f('0x3a')](db[_0xa16f('0x4a')][_0xa16f('0x35')]);_0x79213d[_0xa16f('0x39')]=_[_0xa16f('0x3a')](_0x54547b[_0xa16f('0x39')]);_0x79213d['filters']=_[_0xa16f('0x3c')](_0x79213d[_0xa16f('0x38')],_0x79213d['query']);_0x5d268b[_0xa16f('0x3d')]=_[_0xa16f('0x3c')](_0x79213d[_0xa16f('0x38')],qs[_0xa16f('0x3e')](_0x54547b[_0xa16f('0x39')]['fields']));_0x5d268b[_0xa16f('0x3d')]=_0x5d268b[_0xa16f('0x3d')]['length']?_0x5d268b['attributes']:_0x79213d[_0xa16f('0x38')];if(_0x54547b[_0xa16f('0x39')][_0xa16f('0x4b')]){_0x5d268b[_0xa16f('0x4c')]=[{'all':!![]}];}_0x5d268b=_[_0xa16f('0x47')]({},_0x5d268b,_0x54547b['options']);return db[_0xa16f('0x4a')][_0xa16f('0x52')](_0x5d268b)['then'](handleEntityNotFound(_0x53c0cb,null))['then'](respondWithResult(_0x53c0cb,null))[_0xa16f('0x4f')](handleError(_0x53c0cb,null));};exports[_0xa16f('0x53')]=function(_0x21bb6d,_0x42b155){return db[_0xa16f('0x4a')][_0xa16f('0x53')](_0x21bb6d['body'],{})['then'](function(_0x50daae){var _0x412dd4=_0x21bb6d[_0xa16f('0x54')]['get']({'plain':!![]});if(!_0x412dd4)throw new Error(_0xa16f('0x55'));if(_0x412dd4['role']===_0xa16f('0x54')){var _0x20d2b6=_0x50daae[_0xa16f('0x2f')]({'plain':!![]});var _0x1f1b9c='Lists';return db[_0xa16f('0x56')][_0xa16f('0x52')]({'where':{'name':_0x1f1b9c,'userProfileId':_0x412dd4[_0xa16f('0x57')]},'raw':!![]})['then'](function(_0x265f47){if(_0x265f47&&_0x265f47[_0xa16f('0x58')]===0x0){return db['UserProfileResource'][_0xa16f('0x53')]({'name':_0x20d2b6[_0xa16f('0x33')],'resourceId':_0x20d2b6['id'],'type':_0x265f47[_0xa16f('0x33')],'sectionId':_0x265f47['id']},{})[_0xa16f('0x2e')](function(){return _0x50daae;});}else{return _0x50daae;}})[_0xa16f('0x4f')](function(_0x562244){logger[_0xa16f('0x59')](_0xa16f('0x5a'),_0x562244);throw _0x562244;});}return _0x50daae;})[_0xa16f('0x2e')](respondWithResult(_0x42b155,0xc9))[_0xa16f('0x4f')](handleError(_0x42b155,null));};exports[_0xa16f('0x2d')]=function(_0x409c0e,_0x28256d){if(_0x409c0e['body']['id']){delete _0x409c0e[_0xa16f('0x5b')]['id'];}return db[_0xa16f('0x4a')][_0xa16f('0x52')]({'where':{'id':_0x409c0e[_0xa16f('0x51')]['id']}})[_0xa16f('0x2e')](handleEntityNotFound(_0x28256d,null))['then'](saveUpdates(_0x409c0e[_0xa16f('0x5b')],null))[_0xa16f('0x2e')](respondWithResult(_0x28256d,null))[_0xa16f('0x4f')](handleError(_0x28256d,null));};exports[_0xa16f('0x32')]=function(_0x3602da,_0x3323f8){return db['CmList']['find']({'where':{'id':_0x3602da[_0xa16f('0x51')]['id']}})[_0xa16f('0x2e')](handleEntityNotFound(_0x3323f8,null))[_0xa16f('0x2e')](removeEntity(_0x3323f8,null))['catch'](handleError(_0x3323f8,null));};exports['describe']=function(_0x4a228e,_0x4630b1){return db[_0xa16f('0x4a')][_0xa16f('0x5c')]()['then'](respondWithResult(_0x4630b1,null))[_0xa16f('0x4f')](handleError(_0x4630b1,null));};exports['addDisposition']=function(_0x1563d8,_0xe0a1ef,_0x3a1e9c){if(_0x1563d8['body']['id']){delete _0x1563d8['body']['id'];}return db[_0xa16f('0x4a')]['find']({'where':{'id':_0x1563d8[_0xa16f('0x51')]['id']}})['then'](handleEntityNotFound(_0xe0a1ef,null))[_0xa16f('0x2e')](function(_0x28ad50){if(_0x28ad50){_0x1563d8[_0xa16f('0x5b')][_0xa16f('0x5d')]=_0x28ad50['id'];return db[_0xa16f('0x5e')][_0xa16f('0x53')](_0x1563d8[_0xa16f('0x5b')]);}})[_0xa16f('0x2e')](respondWithResult(_0xe0a1ef,null))['catch'](handleError(_0xe0a1ef,null));};exports[_0xa16f('0x5f')]=function(_0x4a6ae4,_0x412141,_0x4ac23d){var _0x1c0267={'raw':![],'where':{}};var _0x5bf827={};var _0x171346={'count':0x0,'rows':[]};return db[_0xa16f('0x4a')][_0xa16f('0x60')]({'where':{'id':_0x4a6ae4[_0xa16f('0x51')]['id']}})['then'](handleEntityNotFound(_0x412141,null))[_0xa16f('0x2e')](function(_0x111872){if(_0x111872){_0x5bf827['model']=_['keys'](db[_0xa16f('0x5e')][_0xa16f('0x35')]);_0x5bf827[_0xa16f('0x39')]=_[_0xa16f('0x3a')](_0x4a6ae4[_0xa16f('0x39')]);_0x5bf827['filters']=_[_0xa16f('0x3c')](_0x5bf827['model'],_0x5bf827[_0xa16f('0x39')]);_0x1c0267[_0xa16f('0x3d')]=_['intersection'](_0x5bf827[_0xa16f('0x38')],qs[_0xa16f('0x3e')](_0x4a6ae4[_0xa16f('0x39')][_0xa16f('0x3e')]));_0x1c0267[_0xa16f('0x3d')]=_0x1c0267[_0xa16f('0x3d')][_0xa16f('0x3f')]?_0x1c0267[_0xa16f('0x3d')]:_0x5bf827[_0xa16f('0x38')];if(!_0x4a6ae4[_0xa16f('0x39')][_0xa16f('0x40')]('nolimit')){_0x1c0267['limit']=qs[_0xa16f('0x26')](_0x4a6ae4['query'][_0xa16f('0x26')]);_0x1c0267[_0xa16f('0x24')]=qs['offset'](_0x4a6ae4[_0xa16f('0x39')][_0xa16f('0x24')]);}_0x1c0267[_0xa16f('0x42')]=qs[_0xa16f('0x43')](_0x4a6ae4['query'][_0xa16f('0x43')]);_0x1c0267[_0xa16f('0x46')]=qs[_0xa16f('0x3b')](_[_0xa16f('0x44')](_0x4a6ae4[_0xa16f('0x39')],_0x5bf827['filters']));_0x1c0267['where'][_0xa16f('0x5d')]=_0x111872['id'];if(_0x4a6ae4[_0xa16f('0x39')]['filter']){_0x1c0267['where']=_[_0xa16f('0x47')](_0x1c0267[_0xa16f('0x46')],{'$or':_[_0xa16f('0x34')](_0x1c0267[_0xa16f('0x3d')],function(_0x4c35a6){var _0x2408af={};_0x2408af[_0x4c35a6]={'$like':'%'+_0x4a6ae4[_0xa16f('0x39')][_0xa16f('0x45')]+'%'};return _0x2408af;})});}_0x1c0267=_[_0xa16f('0x47')]({},_0x1c0267,_0x4a6ae4[_0xa16f('0x49')]);return db[_0xa16f('0x5e')]['count']({'where':_0x1c0267[_0xa16f('0x46')]})[_0xa16f('0x2e')](function(_0x2510ad){_0x171346['count']=_0x2510ad;if(_0x4a6ae4[_0xa16f('0x39')]['includeAll']){_0x1c0267[_0xa16f('0x4c')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1c0267);})[_0xa16f('0x2e')](function(_0x441d99){_0x171346[_0xa16f('0x4e')]=_0x441d99;return _0x171346;});}})[_0xa16f('0x2e')](respondWithFilteredResult(_0x412141,_0x1c0267))['catch'](handleError(_0x412141,null));};exports[_0xa16f('0x61')]=function(_0x2b922f,_0x3be0ca,_0x15c9a4){return db[_0xa16f('0x4a')][_0xa16f('0x52')]({'where':{'id':_0x2b922f[_0xa16f('0x51')]['id']}})[_0xa16f('0x2e')](handleEntityNotFound(_0x3be0ca,null))[_0xa16f('0x2e')](function(_0x4842fd){if(_0x4842fd){return _0x4842fd[_0xa16f('0x61')](_0x2b922f[_0xa16f('0x39')][_0xa16f('0x62')]);}})['then'](respondWithStatusCode(_0x3be0ca,null))[_0xa16f('0x4f')](handleError(_0x3be0ca,null));};exports[_0xa16f('0x63')]=function(_0x17cbb4,_0x12a551,_0x2fcdac){return db[_0xa16f('0x4a')][_0xa16f('0x52')]({'where':{'id':_0x17cbb4[_0xa16f('0x51')]['id']}})[_0xa16f('0x2e')](handleEntityNotFound(_0x12a551,null))[_0xa16f('0x2e')](function(_0x1d91e3){if(_0x1d91e3){var _0x16f85f=[];var _0x539087={'success':[],'errors':[]};return db[_0xa16f('0x64')]['describe']()['then'](function(_0x17fa3a){if(_0x17cbb4['body']['tags']&&_[_0xa16f('0x65')](_0x17cbb4[_0xa16f('0x5b')]['tags'])){if(_0x17cbb4[_0xa16f('0x5b')]['tags'][_0xa16f('0x3f')]){_0x17cbb4['body']['tags']=_0x17cbb4['body'][_0xa16f('0x66')][_0xa16f('0x67')](';')+';';}else{_0x17cbb4['body'][_0xa16f('0x66')]=null;}}else{_0x17cbb4['body'][_0xa16f('0x66')]=null;}if(_0x17cbb4['body']&&_[_0xa16f('0x65')](_0x17cbb4[_0xa16f('0x5b')])){for(var _0x448043=0x0;_0x448043<_0x17cbb4[_0xa16f('0x5b')][_0xa16f('0x3f')];_0x448043+=0x1){_0x17cbb4['body'][_0x448043][_0xa16f('0x5d')]=_0x17cbb4[_0xa16f('0x51')]['id'];_0x16f85f[_0xa16f('0x68')](_0x17cbb4[_0xa16f('0x5b')][_0x448043]);}return BPromise[_0xa16f('0x69')](_0x16f85f,function(_0x52f8ab){return db[_0xa16f('0x64')][_0xa16f('0x53')](_[_0xa16f('0x6a')](_0x52f8ab,[_0xa16f('0x62'),'id'])||{},{'fields':_[_0xa16f('0x3a')](_0x17fa3a),'raw':!![]})['then'](function(_0x32a425){_0x539087[_0xa16f('0x6b')]['push'](_0x32a425[_0xa16f('0x6c')]);})[_0xa16f('0x4f')](function(_0x32f70b){_0x539087['errors']['push']({'data':_0x52f8ab,'error':_0x32f70b[_0xa16f('0x6d')]});});})[_0xa16f('0x2e')](function(_0x309fe3){return _0x539087;})[_0xa16f('0x4f')](function(_0x23bdc7){return _0x23bdc7;});}else{_0x12a551['status'](0x190)[_0xa16f('0x6e')]({'message':_0xa16f('0x6f')});}});}})[_0xa16f('0x2e')](respondWithResult(_0x12a551,null))[_0xa16f('0x4f')](handleError(_0x12a551,null));};exports[_0xa16f('0x70')]=function(_0x2723b9,_0x217939,_0x3e377c){var _0x4bf855;return db[_0xa16f('0x4a')]['find']({'where':{'id':_0x2723b9[_0xa16f('0x51')]['id']},'include':[{'model':db[_0xa16f('0x71')],'as':_0xa16f('0x72')}]})[_0xa16f('0x2e')](handleEntityNotFound(_0x217939,null))['then'](function(_0x4b2083){if(_0x4b2083){_0x4bf855=_0x4b2083;return db[_0xa16f('0x64')][_0xa16f('0x35')];}})[_0xa16f('0x2e')](function(_0x2b73ec){if(_0x2b73ec){var _0x54ffbc={};var _0x5b62b6={};_0x5b62b6['model']=_['concat'](_[_0xa16f('0x3a')](_0x2b73ec),_['map'](_0x4bf855[_0xa16f('0x72')],function(_0x227363){return util[_0xa16f('0x73')](_0xa16f('0x74'),_0x227363['id']);}));_0x5b62b6[_0xa16f('0x39')]=_[_0xa16f('0x3a')](_0x2723b9[_0xa16f('0x39')]);_0x5b62b6['filters']=_[_0xa16f('0x3c')](_0x5b62b6[_0xa16f('0x38')],_0x5b62b6[_0xa16f('0x39')]);_0x54ffbc[_0xa16f('0x3d')]=_[_0xa16f('0x3c')](_0x5b62b6[_0xa16f('0x38')],qs[_0xa16f('0x3e')](_0x2723b9[_0xa16f('0x39')][_0xa16f('0x3e')]));_0x54ffbc[_0xa16f('0x3d')]=_0x54ffbc[_0xa16f('0x3d')]['length']?_0x54ffbc[_0xa16f('0x3d')]:_0x5b62b6[_0xa16f('0x38')];if(!_0x2723b9[_0xa16f('0x39')][_0xa16f('0x40')](_0xa16f('0x41'))){_0x54ffbc[_0xa16f('0x26')]=qs[_0xa16f('0x26')](_0x2723b9[_0xa16f('0x39')]['limit']);_0x54ffbc[_0xa16f('0x24')]=qs['offset'](_0x2723b9['query'][_0xa16f('0x24')]);}_0x54ffbc['order']=qs[_0xa16f('0x43')](_0x2723b9[_0xa16f('0x39')][_0xa16f('0x43')]);_0x54ffbc[_0xa16f('0x46')]=qs[_0xa16f('0x3b')](_['pick'](_0x2723b9[_0xa16f('0x39')],_0x5b62b6[_0xa16f('0x3b')]));_0x54ffbc[_0xa16f('0x75')]=!![];if(_0x2723b9[_0xa16f('0x39')]['filter']){_0x54ffbc[_0xa16f('0x46')]=_[_0xa16f('0x47')](_0x54ffbc['where'],{'$or':_[_0xa16f('0x34')](_0x54ffbc[_0xa16f('0x3d')],function(_0x2c9798){var _0x3b55ca={};_0x3b55ca[_0x2c9798]={'$like':'%'+_0x2723b9['query']['filter']+'%'};return _0x3b55ca;})});}_0x54ffbc=_[_0xa16f('0x47')]({},_0x54ffbc,_0x2723b9[_0xa16f('0x49')]);return _0x4bf855['getContacts'](_0x54ffbc);}})[_0xa16f('0x2e')](respondWithResult(_0x217939,null))['catch'](handleError(_0x217939,null));};exports[_0xa16f('0x76')]=function(_0x5ec50d,_0x3a8fd7,_0xa8bc68){var _0x3d222e;return db[_0xa16f('0x4a')]['find']({'where':{'id':_0x5ec50d[_0xa16f('0x51')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xa16f('0x2e')](handleEntityNotFound(_0x3a8fd7,null))['then'](function(_0x2e1385){if(_0x2e1385){_0x3d222e=_0x2e1385;return db[_0xa16f('0x64')][_0xa16f('0x35')];}})['then'](function(_0x19577f){if(_0x19577f){var _0x43ca28={};var _0x36db17={};_0x36db17[_0xa16f('0x38')]=_[_0xa16f('0x77')](_[_0xa16f('0x3a')](_0x19577f),_['map'](_0x3d222e['CustomFields'],function(_0x3561ea){return util[_0xa16f('0x73')](_0xa16f('0x74'),_0x3561ea['id']);}));_0x36db17['query']=_[_0xa16f('0x3a')](_0x5ec50d[_0xa16f('0x39')]);_0x36db17[_0xa16f('0x3b')]=_[_0xa16f('0x3c')](_0x36db17[_0xa16f('0x38')],_0x36db17[_0xa16f('0x39')]);_0x43ca28['attributes']=_['intersection'](_0x36db17['model'],qs[_0xa16f('0x3e')](_0x5ec50d[_0xa16f('0x39')][_0xa16f('0x3e')]));_0x43ca28[_0xa16f('0x3d')]=_0x43ca28[_0xa16f('0x3d')][_0xa16f('0x3f')]?_0x43ca28[_0xa16f('0x3d')]:_0x36db17[_0xa16f('0x38')];if(!_0x5ec50d[_0xa16f('0x39')][_0xa16f('0x40')](_0xa16f('0x41'))){_0x43ca28['limit']=qs[_0xa16f('0x26')](_0x5ec50d[_0xa16f('0x39')][_0xa16f('0x26')]);_0x43ca28[_0xa16f('0x24')]=qs['offset'](_0x5ec50d[_0xa16f('0x39')][_0xa16f('0x24')]);}_0x43ca28[_0xa16f('0x42')]=qs[_0xa16f('0x43')](_0x5ec50d['query'][_0xa16f('0x43')]);_0x43ca28[_0xa16f('0x46')]=qs['filters'](_['pick'](_0x5ec50d[_0xa16f('0x39')],_0x36db17['filters']));_0x43ca28['raw']=!![];if(_0x5ec50d[_0xa16f('0x39')][_0xa16f('0x45')]){_0x43ca28[_0xa16f('0x46')]=_[_0xa16f('0x47')](_0x43ca28['where'],{'$or':_[_0xa16f('0x34')](_0x43ca28[_0xa16f('0x3d')],function(_0x3dff7a){var _0x413152={};_0x413152[_0x3dff7a]={'$like':'%'+_0x5ec50d[_0xa16f('0x39')][_0xa16f('0x45')]+'%'};return _0x413152;})});}_0x43ca28=_[_0xa16f('0x47')]({},_0x43ca28,_0x5ec50d[_0xa16f('0x49')]);return _0x3d222e[_0xa16f('0x70')](_0x43ca28);}})[_0xa16f('0x2e')](function(_0xa8a349){if(!_['isEmpty'](_0xa8a349)){var _0x2e2d18=toCsv(_0xa8a349);var _0xe9fed3=Date['now']();fs[_0xa16f('0x78')](util[_0xa16f('0x73')](_0xa16f('0x79'),_0x3d222e['id'],_0xe9fed3),_0x2e2d18);_0x3a8fd7[_0xa16f('0x7a')]('Content-disposition','attachment;\x20filename='+util[_0xa16f('0x73')](_0xa16f('0x7b'),_0x3d222e['id'],_0xe9fed3));_0x3a8fd7[_0xa16f('0x7a')]('Content-type',_0xa16f('0x7c'));return _0x3a8fd7['download'](util[_0xa16f('0x73')]('/tmp/list_%d_%s.csv',_0x3d222e['id'],_0xe9fed3));}else{return _0x3a8fd7[_0xa16f('0x21')](0xcc);}})[_0xa16f('0x4f')](handleError(_0x3a8fd7,null));};exports[_0xa16f('0x7d')]=function(_0xedb7a4,_0x164ba5,_0x317f88){var _0x1cbf91;delete _0xedb7a4[_0xa16f('0x5b')]['id'];return db[_0xa16f('0x4a')][_0xa16f('0x60')]({'where':{'id':_0xedb7a4[_0xa16f('0x51')]['id']}})[_0xa16f('0x2e')](handleEntityNotFound(_0x164ba5,null))[_0xa16f('0x2e')](function(_0x50db0b){if(_0x50db0b){return db[_0xa16f('0x7e')][_0xa16f('0x7f')](function(_0x60cbd8){return db['CmCustomField']['create'](_0xedb7a4['body'],{'transaction':_0x60cbd8})[_0xa16f('0x2e')](function(_0x3b3040){_0x1cbf91=_0x3b3040;return _0x50db0b[_0xa16f('0x80')](_0x3b3040,{'transaction':_0x60cbd8});})['then'](function(){var _0x3c639b={'type':db['Sequelize'][_0xa16f('0x81')],'transaction':_0x60cbd8};switch(_0xedb7a4['body'][_0xa16f('0x36')]){case _0xa16f('0x82'):_0x3c639b[_0xa16f('0x36')]=db[_0xa16f('0x83')][_0xa16f('0x81')];break;case _0xa16f('0x84'):_0x3c639b[_0xa16f('0x36')]=db[_0xa16f('0x83')][_0xa16f('0x85')];break;case'switch':_0x3c639b['type']=db[_0xa16f('0x83')][_0xa16f('0x86')];_0x3c639b[_0xa16f('0x87')]=![];break;default:}return db[_0xa16f('0x7e')]['queryInterface'][_0xa16f('0x88')](_0xa16f('0x89'),util[_0xa16f('0x73')](_0xa16f('0x8a'),_0x1cbf91['id']),_0x3c639b);})['then'](function(){return _0x1cbf91;});});}})[_0xa16f('0x2e')](respondWithResult(_0x164ba5,null))['catch'](handleError(_0x164ba5,null));};exports[_0xa16f('0x8b')]=function(_0x881809,_0x2a5008,_0x23677e){var _0x512ce1={};var _0x42cdc4={};var _0x287bd2;var _0x15d97a;return db[_0xa16f('0x4a')]['findOne']({'where':{'id':_0x881809[_0xa16f('0x51')]['id']}})[_0xa16f('0x2e')](handleEntityNotFound(_0x2a5008,null))[_0xa16f('0x2e')](function(_0x3fdde4){if(_0x3fdde4){_0x287bd2=_0x3fdde4;_0x42cdc4[_0xa16f('0x38')]=_[_0xa16f('0x3a')](db[_0xa16f('0x71')][_0xa16f('0x35')]);_0x42cdc4[_0xa16f('0x39')]=_[_0xa16f('0x3a')](_0x881809[_0xa16f('0x39')]);_0x42cdc4['filters']=_['intersection'](_0x42cdc4[_0xa16f('0x38')],_0x42cdc4['query']);_0x512ce1[_0xa16f('0x3d')]=_['intersection'](_0x42cdc4['model'],qs['fields'](_0x881809[_0xa16f('0x39')][_0xa16f('0x3e')]));_0x512ce1[_0xa16f('0x3d')]=_0x512ce1[_0xa16f('0x3d')]['length']?_0x512ce1[_0xa16f('0x3d')]:_0x42cdc4[_0xa16f('0x38')];_0x512ce1[_0xa16f('0x42')]=qs[_0xa16f('0x43')](_0x881809[_0xa16f('0x39')][_0xa16f('0x43')]);_0x512ce1[_0xa16f('0x46')]=qs['filters'](_['pick'](_0x881809[_0xa16f('0x39')],_0x42cdc4[_0xa16f('0x3b')]));_0x512ce1[_0xa16f('0x46')]=_[_0xa16f('0x47')](_0x512ce1[_0xa16f('0x46')],{'$or':[{'ListId':_0x3fdde4['id']},{'ListId':null}]});if(_0x881809[_0xa16f('0x39')][_0xa16f('0x45')]){_0x512ce1['where']=_[_0xa16f('0x47')](_0x512ce1[_0xa16f('0x46')],{'$or':_[_0xa16f('0x34')](_0x512ce1[_0xa16f('0x3d')],function(_0x24400a){var _0x36a19a={};_0x36a19a[_0x24400a]={'$like':'%'+_0x881809[_0xa16f('0x39')][_0xa16f('0x45')]+'%'};return _0x36a19a;})});}_0x512ce1=_['merge']({},_0x512ce1,_0x881809[_0xa16f('0x49')]);return db[_0xa16f('0x71')]['findAndCountAll'](_0x512ce1);}})[_0xa16f('0x2e')](respondWithResult(_0x2a5008,null))[_0xa16f('0x4f')](handleError(_0x2a5008,null));};exports[_0xa16f('0x8c')]=function(_0x1750e,_0x581dac,_0x411ec8){return db[_0xa16f('0x4a')][_0xa16f('0x52')]({'where':{'id':_0x1750e[_0xa16f('0x51')]['id']}})[_0xa16f('0x2e')](handleEntityNotFound(_0x581dac,null))[_0xa16f('0x2e')](function(_0x1caf91){if(_0x1caf91){return _0x1caf91[_0xa16f('0x8c')](_0x1750e[_0xa16f('0x5b')][_0xa16f('0x62')],_[_0xa16f('0x6a')](_0x1750e[_0xa16f('0x5b')],['ids','id'])||{})[_0xa16f('0x8d')](function(_0x2bbaa5){for(var _0xd46b76=0x0;_0xd46b76<_0x1750e[_0xa16f('0x5b')][_0xa16f('0x62')][_0xa16f('0x3f')];_0xd46b76+=0x1){socket[_0xa16f('0x8e')](_0xa16f('0x8f'),{'UserId':Number(_0x1750e[_0xa16f('0x5b')][_0xa16f('0x62')][_0xd46b76]),'CmListId':Number(_0x1750e[_0xa16f('0x51')]['id'])});}return _0x2bbaa5;});}})[_0xa16f('0x2e')](respondWithResult(_0x581dac,null))[_0xa16f('0x4f')](handleError(_0x581dac,null));};exports['removeAgents']=function(_0x20eb30,_0x359faa,_0x2daf9d){return db['CmList'][_0xa16f('0x52')]({'where':{'id':_0x20eb30[_0xa16f('0x51')]['id']}})[_0xa16f('0x2e')](handleEntityNotFound(_0x359faa,null))['then'](function(_0x23058c){if(_0x23058c){return _0x23058c[_0xa16f('0x90')](_0x20eb30[_0xa16f('0x39')][_0xa16f('0x62')])['then'](function(){if(_[_0xa16f('0x65')](_0x20eb30[_0xa16f('0x39')]['ids'])){for(var _0xd79175=0x0;_0xd79175<_0x20eb30[_0xa16f('0x39')][_0xa16f('0x62')][_0xa16f('0x3f')];_0xd79175+=0x1){socket['emit'](_0xa16f('0x91'),{'UserId':Number(_0x20eb30[_0xa16f('0x39')][_0xa16f('0x62')][_0xd79175]),'CmListId':Number(_0x20eb30['params']['id'])});}}else{socket[_0xa16f('0x8e')](_0xa16f('0x91'),{'UserId':Number(_0x20eb30[_0xa16f('0x39')]['ids']),'CmListId':Number(_0x20eb30[_0xa16f('0x51')]['id'])});}});}})[_0xa16f('0x2e')](respondWithStatusCode(_0x359faa,null))['catch'](handleError(_0x359faa,null));};exports[_0xa16f('0x92')]=function(_0x1ce6fa,_0x370576,_0x3b83a3){var _0x35bb76={};var _0x518951={};var _0x28fba8;var _0x2e6e91;return db['CmList'][_0xa16f('0x60')]({'where':{'id':_0x1ce6fa['params']['id']}})[_0xa16f('0x2e')](handleEntityNotFound(_0x370576,null))[_0xa16f('0x2e')](function(_0x2220cd){if(_0x2220cd){_0x28fba8=_0x2220cd;_0x518951['model']=_[_0xa16f('0x3a')](db[_0xa16f('0x93')][_0xa16f('0x35')]);_0x518951['query']=_['keys'](_0x1ce6fa[_0xa16f('0x39')]);_0x518951[_0xa16f('0x3b')]=_[_0xa16f('0x3c')](_0x518951[_0xa16f('0x38')],_0x518951['query']);_0x35bb76[_0xa16f('0x3d')]=_[_0xa16f('0x3c')](_0x518951[_0xa16f('0x38')],qs[_0xa16f('0x3e')](_0x1ce6fa[_0xa16f('0x39')]['fields']));_0x35bb76[_0xa16f('0x3d')]=_0x35bb76['attributes']['length']?_0x35bb76[_0xa16f('0x3d')]:_0x518951[_0xa16f('0x38')];_0x35bb76[_0xa16f('0x42')]=qs['sort'](_0x1ce6fa['query'][_0xa16f('0x43')]);_0x35bb76[_0xa16f('0x46')]=qs[_0xa16f('0x3b')](_['pick'](_0x1ce6fa['query'],_0x518951[_0xa16f('0x3b')]));if(_0x1ce6fa[_0xa16f('0x39')][_0xa16f('0x45')]){_0x35bb76['where']=_[_0xa16f('0x47')](_0x35bb76[_0xa16f('0x46')],{'$or':_['map'](_0x35bb76[_0xa16f('0x3d')],function(_0x74dc83){var _0x405916={};_0x405916[_0x74dc83]={'$like':'%'+_0x1ce6fa['query'][_0xa16f('0x45')]+'%'};return _0x405916;})});}_0x35bb76=_[_0xa16f('0x47')]({},_0x35bb76,_0x1ce6fa[_0xa16f('0x49')]);return _0x28fba8['getAgents'](_0x35bb76);}})[_0xa16f('0x2e')](function(_0x36abcb){if(_0x36abcb){_0x2e6e91=_0x36abcb[_0xa16f('0x3f')];if(!_0x1ce6fa[_0xa16f('0x39')]['hasOwnProperty'](_0xa16f('0x41'))){_0x35bb76['limit']=qs[_0xa16f('0x26')](_0x1ce6fa[_0xa16f('0x39')][_0xa16f('0x26')]);_0x35bb76['offset']=qs[_0xa16f('0x24')](_0x1ce6fa[_0xa16f('0x39')]['offset']);}return _0x28fba8[_0xa16f('0x92')](_0x35bb76);}})[_0xa16f('0x2e')](function(_0x1b51db){if(_0x1b51db){return _0x1b51db?{'count':_0x2e6e91,'rows':_0x1b51db}:null;}})[_0xa16f('0x2e')](respondWithResult(_0x370576,null))[_0xa16f('0x4f')](handleError(_0x370576,null));};
\ No newline at end of file
+var _0x8794=['then','get','UserProfileResource','destroy','stack','name','map','CmList','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','findAll','rows','params','includeAll','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','findOne','nolimit','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','each','omit','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','format','cf_%d','getContacts','concat','raw','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','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','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update'];(function(_0x19b980,_0x40c574){var _0x320fd8=function(_0x58f323){while(--_0x58f323){_0x19b980['push'](_0x19b980['shift']());}};_0x320fd8(++_0x40c574);}(_0x8794,0x69));var _0x4879=function(_0x56f73c,_0x4cdf1c){_0x56f73c=_0x56f73c-0x0;var _0xbc199c=_0x8794[_0x56f73c];return _0xbc199c;};'use strict';var emlformat=require(_0x4879('0x0'));var rimraf=require(_0x4879('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4879('0x2'));var rp=require(_0x4879('0x3'));var moment=require(_0x4879('0x4'));var BPromise=require(_0x4879('0x5'));var Mustache=require('mustache');var util=require(_0x4879('0x6'));var path=require(_0x4879('0x7'));var sox=require(_0x4879('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4879('0x9'));var squel=require('squel');var crypto=require(_0x4879('0xa'));var jsforce=require(_0x4879('0xb'));var deskjs=require(_0x4879('0xc'));var toCsv=require(_0x4879('0xd'));var querystring=require(_0x4879('0xe'));var Papa=require(_0x4879('0xf'));var Redis=require(_0x4879('0x10'));var authService=require(_0x4879('0x11'));var qs=require(_0x4879('0x12'));var as=require(_0x4879('0x13'));var hardwareService=require(_0x4879('0x14'));var logger=require(_0x4879('0x15'))(_0x4879('0x16'));var utils=require(_0x4879('0x17'));var config=require(_0x4879('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4879('0x19'))['db'];config['redis']=_[_0x4879('0x1a')](config[_0x4879('0x1b')],{'host':_0x4879('0x1c'),'port':0x18eb});var socket=require(_0x4879('0x1d'))(new Redis(config[_0x4879('0x1b')]));require(_0x4879('0x1e'))[_0x4879('0x1f')](socket);function respondWithStatusCode(_0x10ac16,_0x506634){_0x506634=_0x506634||0xcc;return function(_0x4917ed){if(_0x4917ed){return _0x10ac16[_0x4879('0x20')](_0x506634);}return _0x10ac16[_0x4879('0x21')](_0x506634)[_0x4879('0x22')]();};}function respondWithResult(_0x297320,_0x19a300){_0x19a300=_0x19a300||0xc8;return function(_0x22d30c){if(_0x22d30c){return _0x297320[_0x4879('0x21')](_0x19a300)[_0x4879('0x23')](_0x22d30c);}};}function respondWithFilteredResult(_0x7a64e,_0x2175d7){return function(_0x6c1edd){if(_0x6c1edd){var _0x923777=typeof _0x2175d7[_0x4879('0x24')]===_0x4879('0x25')&&typeof _0x2175d7['limit']===_0x4879('0x25');var _0x548fa5=_0x6c1edd[_0x4879('0x26')];var _0x1f3171=_0x923777?0x0:_0x2175d7[_0x4879('0x24')];var _0x6ccd83=_0x923777?_0x6c1edd[_0x4879('0x26')]:_0x2175d7['offset']+_0x2175d7[_0x4879('0x27')];var _0x58837d;if(_0x6ccd83>=_0x548fa5){_0x6ccd83=_0x548fa5;_0x58837d=0xc8;}else{_0x58837d=0xce;}_0x7a64e[_0x4879('0x21')](_0x58837d);return _0x7a64e[_0x4879('0x28')](_0x4879('0x29'),_0x1f3171+'-'+_0x6ccd83+'/'+_0x548fa5)[_0x4879('0x23')](_0x6c1edd);}return null;};}function patchUpdates(_0xdb7c45){return function(_0x295f2f){try{jsonpatch[_0x4879('0x2a')](_0x295f2f,_0xdb7c45,!![]);}catch(_0x2a102f){return BPromise['reject'](_0x2a102f);}return _0x295f2f[_0x4879('0x2b')]();};}function saveUpdates(_0x3ae151,_0x6ea0c2){return function(_0x28f9ae){if(_0x28f9ae){return _0x28f9ae[_0x4879('0x2c')](_0x3ae151)['then'](function(_0x5e4f10){return _0x5e4f10;});}return null;};}function removeEntity(_0xbdd007,_0x460dfa){return function(_0xbfd9a1){if(_0xbfd9a1){return _0xbfd9a1['destroy']()[_0x4879('0x2d')](function(){var _0x3dbb10=_0xbfd9a1[_0x4879('0x2e')]({'plain':!![]});var _0x2a2514='Lists';return db[_0x4879('0x2f')][_0x4879('0x30')]({'where':{'type':_0x2a2514,'resourceId':_0x3dbb10['id']}})[_0x4879('0x2d')](function(){return _0xbfd9a1;});})['then'](function(){_0xbdd007['status'](0xcc)[_0x4879('0x22')]();});}};}function handleEntityNotFound(_0x2e5311,_0x5b9077){return function(_0x79e1e5){if(!_0x79e1e5){_0x2e5311['sendStatus'](0x194);}return _0x79e1e5;};}function handleError(_0x524b65,_0x1f0708){_0x1f0708=_0x1f0708||0x1f4;return function(_0x1eae3b){logger['error'](_0x1eae3b[_0x4879('0x31')]);if(_0x1eae3b[_0x4879('0x32')]){delete _0x1eae3b[_0x4879('0x32')];}_0x524b65[_0x4879('0x21')](_0x1f0708)['send'](_0x1eae3b);};}exports['index']=function(_0x2bff18,_0x53b63f){var _0x1f6587={},_0x583fb1={},_0x4d9691={'count':0x0,'rows':[]};var _0x18e883=_[_0x4879('0x33')](db[_0x4879('0x34')][_0x4879('0x35')],function(_0x17dc48){return{'name':_0x17dc48[_0x4879('0x36')],'type':_0x17dc48['type'][_0x4879('0x37')]};});_0x583fb1[_0x4879('0x38')]=_['map'](_0x18e883,'name');_0x583fb1[_0x4879('0x39')]=_[_0x4879('0x3a')](_0x2bff18[_0x4879('0x39')]);_0x583fb1['filters']=_[_0x4879('0x3b')](_0x583fb1['model'],_0x583fb1[_0x4879('0x39')]);_0x1f6587[_0x4879('0x3c')]=_[_0x4879('0x3b')](_0x583fb1['model'],qs[_0x4879('0x3d')](_0x2bff18['query'][_0x4879('0x3d')]));_0x1f6587[_0x4879('0x3c')]=_0x1f6587[_0x4879('0x3c')][_0x4879('0x3e')]?_0x1f6587[_0x4879('0x3c')]:_0x583fb1['model'];if(!_0x2bff18['query'][_0x4879('0x3f')]('nolimit')){_0x1f6587[_0x4879('0x27')]=qs[_0x4879('0x27')](_0x2bff18['query'][_0x4879('0x27')]);_0x1f6587[_0x4879('0x24')]=qs[_0x4879('0x24')](_0x2bff18[_0x4879('0x39')][_0x4879('0x24')]);}_0x1f6587[_0x4879('0x40')]=qs[_0x4879('0x41')](_0x2bff18['query'][_0x4879('0x41')]);_0x1f6587['where']=qs['filters'](_[_0x4879('0x42')](_0x2bff18[_0x4879('0x39')],_0x583fb1[_0x4879('0x43')]),_0x18e883);if(_0x2bff18[_0x4879('0x39')][_0x4879('0x44')]){_0x1f6587[_0x4879('0x45')]=_[_0x4879('0x46')](_0x1f6587[_0x4879('0x45')],{'$or':_['map'](_0x18e883,function(_0x21e57a){if(_0x21e57a[_0x4879('0x47')]!==_0x4879('0x48')){var _0x2562ab={};_0x2562ab[_0x21e57a[_0x4879('0x32')]]={'$like':'%'+_0x2bff18[_0x4879('0x39')][_0x4879('0x44')]+'%'};return _0x2562ab;}})});}_0x1f6587=_[_0x4879('0x46')]({},_0x1f6587,_0x2bff18[_0x4879('0x49')]);var _0x201592={'where':_0x1f6587[_0x4879('0x45')]};return db[_0x4879('0x34')][_0x4879('0x26')](_0x201592)[_0x4879('0x2d')](function(_0x3e25c0){_0x4d9691['count']=_0x3e25c0;if(_0x2bff18[_0x4879('0x39')]['includeAll']){_0x1f6587['include']=[{'all':!![]}];}return db['CmList'][_0x4879('0x4a')](_0x1f6587);})[_0x4879('0x2d')](function(_0x5a1ba7){_0x4d9691[_0x4879('0x4b')]=_0x5a1ba7;return _0x4d9691;})[_0x4879('0x2d')](respondWithFilteredResult(_0x53b63f,_0x1f6587))['catch'](handleError(_0x53b63f,null));};exports['show']=function(_0x2eead3,_0x517090){var _0x3675ec={'raw':![],'where':{'id':_0x2eead3[_0x4879('0x4c')]['id']}},_0x25a448={};_0x25a448['model']=_['keys'](db['CmList']['rawAttributes']);_0x25a448['query']=_['keys'](_0x2eead3['query']);_0x25a448[_0x4879('0x43')]=_[_0x4879('0x3b')](_0x25a448[_0x4879('0x38')],_0x25a448['query']);_0x3675ec[_0x4879('0x3c')]=_['intersection'](_0x25a448['model'],qs[_0x4879('0x3d')](_0x2eead3[_0x4879('0x39')][_0x4879('0x3d')]));_0x3675ec[_0x4879('0x3c')]=_0x3675ec[_0x4879('0x3c')][_0x4879('0x3e')]?_0x3675ec[_0x4879('0x3c')]:_0x25a448[_0x4879('0x38')];if(_0x2eead3[_0x4879('0x39')][_0x4879('0x4d')]){_0x3675ec[_0x4879('0x4e')]=[{'all':!![]}];}_0x3675ec=_[_0x4879('0x46')]({},_0x3675ec,_0x2eead3['options']);return db[_0x4879('0x34')][_0x4879('0x4f')](_0x3675ec)[_0x4879('0x2d')](handleEntityNotFound(_0x517090,null))[_0x4879('0x2d')](respondWithResult(_0x517090,null))[_0x4879('0x50')](handleError(_0x517090,null));};exports['create']=function(_0xd1495e,_0xeec044){return db[_0x4879('0x34')][_0x4879('0x51')](_0xd1495e['body'],{})['then'](function(_0x377caf){var _0x2708d1=_0xd1495e[_0x4879('0x52')]['get']({'plain':!![]});if(!_0x2708d1)throw new Error(_0x4879('0x53'));if(_0x2708d1[_0x4879('0x54')]===_0x4879('0x52')){var _0x4c3c6e=_0x377caf[_0x4879('0x2e')]({'plain':!![]});var _0x2ca12f=_0x4879('0x55');return db['UserProfileSection'][_0x4879('0x4f')]({'where':{'name':_0x2ca12f,'userProfileId':_0x2708d1[_0x4879('0x56')]},'raw':!![]})[_0x4879('0x2d')](function(_0x489864){if(_0x489864&&_0x489864[_0x4879('0x57')]===0x0){return db[_0x4879('0x2f')][_0x4879('0x51')]({'name':_0x4c3c6e[_0x4879('0x32')],'resourceId':_0x4c3c6e['id'],'type':_0x489864[_0x4879('0x32')],'sectionId':_0x489864['id']},{})['then'](function(){return _0x377caf;});}else{return _0x377caf;}})['catch'](function(_0x3ddb97){logger['error'](_0x4879('0x58'),_0x3ddb97);throw _0x3ddb97;});}return _0x377caf;})['then'](respondWithResult(_0xeec044,0xc9))[_0x4879('0x50')](handleError(_0xeec044,null));};exports[_0x4879('0x2c')]=function(_0x1c5513,_0x443311){if(_0x1c5513[_0x4879('0x59')]['id']){delete _0x1c5513[_0x4879('0x59')]['id'];}return db['CmList'][_0x4879('0x4f')]({'where':{'id':_0x1c5513['params']['id']}})[_0x4879('0x2d')](handleEntityNotFound(_0x443311,null))[_0x4879('0x2d')](saveUpdates(_0x1c5513[_0x4879('0x59')],null))['then'](respondWithResult(_0x443311,null))[_0x4879('0x50')](handleError(_0x443311,null));};exports[_0x4879('0x30')]=function(_0x3af3e8,_0x27296a){return db[_0x4879('0x34')][_0x4879('0x4f')]({'where':{'id':_0x3af3e8[_0x4879('0x4c')]['id']}})[_0x4879('0x2d')](handleEntityNotFound(_0x27296a,null))['then'](removeEntity(_0x27296a,null))['catch'](handleError(_0x27296a,null));};exports[_0x4879('0x5a')]=function(_0x5c991f,_0x1addf4){return db[_0x4879('0x34')][_0x4879('0x5a')]()[_0x4879('0x2d')](respondWithResult(_0x1addf4,null))[_0x4879('0x50')](handleError(_0x1addf4,null));};exports[_0x4879('0x5b')]=function(_0x1f3e04,_0x1b3ec6,_0x401801){if(_0x1f3e04['body']['id']){delete _0x1f3e04['body']['id'];}return db[_0x4879('0x34')][_0x4879('0x4f')]({'where':{'id':_0x1f3e04['params']['id']}})['then'](handleEntityNotFound(_0x1b3ec6,null))['then'](function(_0x80833d){if(_0x80833d){_0x1f3e04[_0x4879('0x59')][_0x4879('0x5c')]=_0x80833d['id'];return db[_0x4879('0x5d')][_0x4879('0x51')](_0x1f3e04['body']);}})[_0x4879('0x2d')](respondWithResult(_0x1b3ec6,null))[_0x4879('0x50')](handleError(_0x1b3ec6,null));};exports['getDispositions']=function(_0x382269,_0x3e1b3a,_0x33c862){var _0x32bb7c={'raw':![],'where':{}};var _0xbf0e47={};var _0x2e7a15={'count':0x0,'rows':[]};return db[_0x4879('0x34')][_0x4879('0x5e')]({'where':{'id':_0x382269[_0x4879('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3e1b3a,null))[_0x4879('0x2d')](function(_0x2d0cb8){if(_0x2d0cb8){_0xbf0e47[_0x4879('0x38')]=_['keys'](db[_0x4879('0x5d')][_0x4879('0x35')]);_0xbf0e47[_0x4879('0x39')]=_[_0x4879('0x3a')](_0x382269[_0x4879('0x39')]);_0xbf0e47[_0x4879('0x43')]=_['intersection'](_0xbf0e47[_0x4879('0x38')],_0xbf0e47[_0x4879('0x39')]);_0x32bb7c['attributes']=_[_0x4879('0x3b')](_0xbf0e47[_0x4879('0x38')],qs[_0x4879('0x3d')](_0x382269[_0x4879('0x39')][_0x4879('0x3d')]));_0x32bb7c[_0x4879('0x3c')]=_0x32bb7c[_0x4879('0x3c')][_0x4879('0x3e')]?_0x32bb7c['attributes']:_0xbf0e47[_0x4879('0x38')];if(!_0x382269[_0x4879('0x39')][_0x4879('0x3f')](_0x4879('0x5f'))){_0x32bb7c[_0x4879('0x27')]=qs[_0x4879('0x27')](_0x382269[_0x4879('0x39')][_0x4879('0x27')]);_0x32bb7c[_0x4879('0x24')]=qs[_0x4879('0x24')](_0x382269[_0x4879('0x39')][_0x4879('0x24')]);}_0x32bb7c[_0x4879('0x40')]=qs[_0x4879('0x41')](_0x382269['query'][_0x4879('0x41')]);_0x32bb7c[_0x4879('0x45')]=qs['filters'](_[_0x4879('0x42')](_0x382269[_0x4879('0x39')],_0xbf0e47[_0x4879('0x43')]));_0x32bb7c[_0x4879('0x45')]['ListId']=_0x2d0cb8['id'];if(_0x382269[_0x4879('0x39')][_0x4879('0x44')]){_0x32bb7c['where']=_[_0x4879('0x46')](_0x32bb7c[_0x4879('0x45')],{'$or':_[_0x4879('0x33')](_0x32bb7c[_0x4879('0x3c')],function(_0x1d4864){var _0x692f93={};_0x692f93[_0x1d4864]={'$like':'%'+_0x382269[_0x4879('0x39')]['filter']+'%'};return _0x692f93;})});}_0x32bb7c=_['merge']({},_0x32bb7c,_0x382269[_0x4879('0x49')]);return db['Disposition'][_0x4879('0x26')]({'where':_0x32bb7c[_0x4879('0x45')]})['then'](function(_0x149c2f){_0x2e7a15[_0x4879('0x26')]=_0x149c2f;if(_0x382269['query'][_0x4879('0x4d')]){_0x32bb7c['include']=[{'all':!![]}];}return db[_0x4879('0x5d')][_0x4879('0x4a')](_0x32bb7c);})[_0x4879('0x2d')](function(_0x1bd147){_0x2e7a15['rows']=_0x1bd147;return _0x2e7a15;});}})['then'](respondWithFilteredResult(_0x3e1b3a,_0x32bb7c))['catch'](handleError(_0x3e1b3a,null));};exports['removeDispositions']=function(_0x34052d,_0x3a830b,_0x5462db){return db[_0x4879('0x34')]['find']({'where':{'id':_0x34052d['params']['id']}})['then'](handleEntityNotFound(_0x3a830b,null))[_0x4879('0x2d')](function(_0xb0cd11){if(_0xb0cd11){return _0xb0cd11[_0x4879('0x60')](_0x34052d['query'][_0x4879('0x61')]);}})[_0x4879('0x2d')](respondWithStatusCode(_0x3a830b,null))[_0x4879('0x50')](handleError(_0x3a830b,null));};exports[_0x4879('0x62')]=function(_0x5d488c,_0x5c2bcb,_0x2d82ea){return db['CmList']['find']({'where':{'id':_0x5d488c[_0x4879('0x4c')]['id']}})[_0x4879('0x2d')](handleEntityNotFound(_0x5c2bcb,null))[_0x4879('0x2d')](function(_0x16b190){if(_0x16b190){var _0x10cdd6=[];var _0x391f33={'success':[],'errors':[]};return db[_0x4879('0x63')]['describe']()[_0x4879('0x2d')](function(_0x4557f7){if(_0x5d488c['body'][_0x4879('0x64')]&&_[_0x4879('0x65')](_0x5d488c['body']['tags'])){if(_0x5d488c[_0x4879('0x59')][_0x4879('0x64')][_0x4879('0x3e')]){_0x5d488c[_0x4879('0x59')][_0x4879('0x64')]=_0x5d488c['body'][_0x4879('0x64')][_0x4879('0x66')](';')+';';}else{_0x5d488c[_0x4879('0x59')][_0x4879('0x64')]=null;}}else{_0x5d488c[_0x4879('0x59')]['tags']=null;}if(_0x5d488c[_0x4879('0x59')]&&_[_0x4879('0x65')](_0x5d488c[_0x4879('0x59')])){for(var _0x161ec7=0x0;_0x161ec7<_0x5d488c[_0x4879('0x59')][_0x4879('0x3e')];_0x161ec7+=0x1){_0x5d488c[_0x4879('0x59')][_0x161ec7][_0x4879('0x5c')]=_0x5d488c[_0x4879('0x4c')]['id'];_0x10cdd6['push'](_0x5d488c[_0x4879('0x59')][_0x161ec7]);}return BPromise[_0x4879('0x67')](_0x10cdd6,function(_0x51b771){return db['CmContact'][_0x4879('0x51')](_[_0x4879('0x68')](_0x51b771,['ids','id'])||{},{'fields':_[_0x4879('0x3a')](_0x4557f7),'raw':!![]})[_0x4879('0x2d')](function(_0x5b242a){_0x391f33[_0x4879('0x69')][_0x4879('0x6a')](_0x5b242a[_0x4879('0x6b')]);})['catch'](function(_0x3db39e){_0x391f33[_0x4879('0x6c')][_0x4879('0x6a')]({'data':_0x51b771,'error':_0x3db39e[_0x4879('0x6d')]});});})['then'](function(_0x119f89){return _0x391f33;})[_0x4879('0x50')](function(_0x2442d1){return _0x2442d1;});}else{_0x5c2bcb[_0x4879('0x21')](0x190)[_0x4879('0x23')]({'message':_0x4879('0x6e')});}});}})[_0x4879('0x2d')](respondWithResult(_0x5c2bcb,null))[_0x4879('0x50')](handleError(_0x5c2bcb,null));};exports['getContacts']=function(_0xeef5d2,_0x1eb2b1,_0x117731){var _0x51e346;return db['CmList'][_0x4879('0x4f')]({'where':{'id':_0xeef5d2['params']['id']},'include':[{'model':db[_0x4879('0x6f')],'as':'CustomFields'}]})[_0x4879('0x2d')](handleEntityNotFound(_0x1eb2b1,null))[_0x4879('0x2d')](function(_0x34cc51){if(_0x34cc51){_0x51e346=_0x34cc51;return db[_0x4879('0x63')][_0x4879('0x35')];}})[_0x4879('0x2d')](function(_0x1acc3a){if(_0x1acc3a){var _0x29ed26={};var _0x4bfda9={};_0x4bfda9[_0x4879('0x38')]=_['concat'](_['keys'](_0x1acc3a),_['map'](_0x51e346[_0x4879('0x70')],function(_0x4e35b8){return util[_0x4879('0x71')](_0x4879('0x72'),_0x4e35b8['id']);}));_0x4bfda9[_0x4879('0x39')]=_[_0x4879('0x3a')](_0xeef5d2[_0x4879('0x39')]);_0x4bfda9[_0x4879('0x43')]=_[_0x4879('0x3b')](_0x4bfda9[_0x4879('0x38')],_0x4bfda9[_0x4879('0x39')]);_0x29ed26[_0x4879('0x3c')]=_[_0x4879('0x3b')](_0x4bfda9[_0x4879('0x38')],qs[_0x4879('0x3d')](_0xeef5d2[_0x4879('0x39')][_0x4879('0x3d')]));_0x29ed26['attributes']=_0x29ed26[_0x4879('0x3c')][_0x4879('0x3e')]?_0x29ed26['attributes']:_0x4bfda9[_0x4879('0x38')];if(!_0xeef5d2[_0x4879('0x39')][_0x4879('0x3f')](_0x4879('0x5f'))){_0x29ed26['limit']=qs[_0x4879('0x27')](_0xeef5d2[_0x4879('0x39')][_0x4879('0x27')]);_0x29ed26[_0x4879('0x24')]=qs[_0x4879('0x24')](_0xeef5d2['query']['offset']);}_0x29ed26[_0x4879('0x40')]=qs['sort'](_0xeef5d2[_0x4879('0x39')]['sort']);_0x29ed26[_0x4879('0x45')]=qs[_0x4879('0x43')](_[_0x4879('0x42')](_0xeef5d2[_0x4879('0x39')],_0x4bfda9[_0x4879('0x43')]));_0x29ed26['raw']=!![];if(_0xeef5d2['query'][_0x4879('0x44')]){_0x29ed26[_0x4879('0x45')]=_[_0x4879('0x46')](_0x29ed26['where'],{'$or':_[_0x4879('0x33')](_0x29ed26[_0x4879('0x3c')],function(_0x4d7392){var _0x275db1={};_0x275db1[_0x4d7392]={'$like':'%'+_0xeef5d2[_0x4879('0x39')][_0x4879('0x44')]+'%'};return _0x275db1;})});}_0x29ed26=_[_0x4879('0x46')]({},_0x29ed26,_0xeef5d2[_0x4879('0x49')]);return _0x51e346[_0x4879('0x73')](_0x29ed26);}})[_0x4879('0x2d')](respondWithResult(_0x1eb2b1,null))[_0x4879('0x50')](handleError(_0x1eb2b1,null));};exports['getContactsCsv']=function(_0x37f274,_0x2db13a,_0x29511f){var _0x4a28f3;return db[_0x4879('0x34')][_0x4879('0x4f')]({'where':{'id':_0x37f274[_0x4879('0x4c')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x4879('0x70')}]})[_0x4879('0x2d')](handleEntityNotFound(_0x2db13a,null))['then'](function(_0x2aee28){if(_0x2aee28){_0x4a28f3=_0x2aee28;return db[_0x4879('0x63')][_0x4879('0x35')];}})['then'](function(_0x3f028e){if(_0x3f028e){var _0x62d8be={};var _0x2d44b6={};_0x2d44b6['model']=_[_0x4879('0x74')](_[_0x4879('0x3a')](_0x3f028e),_[_0x4879('0x33')](_0x4a28f3[_0x4879('0x70')],function(_0x55a601){return util['format'](_0x4879('0x72'),_0x55a601['id']);}));_0x2d44b6[_0x4879('0x39')]=_[_0x4879('0x3a')](_0x37f274[_0x4879('0x39')]);_0x2d44b6[_0x4879('0x43')]=_['intersection'](_0x2d44b6[_0x4879('0x38')],_0x2d44b6[_0x4879('0x39')]);_0x62d8be[_0x4879('0x3c')]=_['intersection'](_0x2d44b6[_0x4879('0x38')],qs[_0x4879('0x3d')](_0x37f274[_0x4879('0x39')][_0x4879('0x3d')]));_0x62d8be[_0x4879('0x3c')]=_0x62d8be['attributes']['length']?_0x62d8be[_0x4879('0x3c')]:_0x2d44b6[_0x4879('0x38')];if(!_0x37f274['query']['hasOwnProperty'](_0x4879('0x5f'))){_0x62d8be[_0x4879('0x27')]=qs[_0x4879('0x27')](_0x37f274[_0x4879('0x39')][_0x4879('0x27')]);_0x62d8be[_0x4879('0x24')]=qs[_0x4879('0x24')](_0x37f274[_0x4879('0x39')][_0x4879('0x24')]);}_0x62d8be[_0x4879('0x40')]=qs[_0x4879('0x41')](_0x37f274[_0x4879('0x39')][_0x4879('0x41')]);_0x62d8be[_0x4879('0x45')]=qs['filters'](_[_0x4879('0x42')](_0x37f274[_0x4879('0x39')],_0x2d44b6[_0x4879('0x43')]));_0x62d8be[_0x4879('0x75')]=!![];if(_0x37f274['query'][_0x4879('0x44')]){_0x62d8be[_0x4879('0x45')]=_['merge'](_0x62d8be[_0x4879('0x45')],{'$or':_[_0x4879('0x33')](_0x62d8be['attributes'],function(_0x2e1dbb){var _0xb8b6d3={};_0xb8b6d3[_0x2e1dbb]={'$like':'%'+_0x37f274[_0x4879('0x39')]['filter']+'%'};return _0xb8b6d3;})});}_0x62d8be=_[_0x4879('0x46')]({},_0x62d8be,_0x37f274[_0x4879('0x49')]);return _0x4a28f3[_0x4879('0x73')](_0x62d8be);}})[_0x4879('0x2d')](function(_0x20d3e2){if(!_['isEmpty'](_0x20d3e2)){var _0x2eed50=toCsv(_0x20d3e2);var _0x54992f=Date[_0x4879('0x76')]();fs[_0x4879('0x77')](util[_0x4879('0x71')](_0x4879('0x78'),_0x4a28f3['id'],_0x54992f),_0x2eed50);_0x2db13a['setHeader'](_0x4879('0x79'),_0x4879('0x7a')+util[_0x4879('0x71')](_0x4879('0x7b'),_0x4a28f3['id'],_0x54992f));_0x2db13a[_0x4879('0x7c')](_0x4879('0x7d'),_0x4879('0x7e'));return _0x2db13a[_0x4879('0x7f')](util['format']('/tmp/list_%d_%s.csv',_0x4a28f3['id'],_0x54992f));}else{return _0x2db13a['sendStatus'](0xcc);}})[_0x4879('0x50')](handleError(_0x2db13a,null));};exports[_0x4879('0x80')]=function(_0x552241,_0x300b05,_0x316e4b){var _0x288c5f;delete _0x552241[_0x4879('0x59')]['id'];return db['CmList']['findOne']({'where':{'id':_0x552241[_0x4879('0x4c')]['id']}})[_0x4879('0x2d')](handleEntityNotFound(_0x300b05,null))[_0x4879('0x2d')](function(_0x56bca0){if(_0x56bca0){return db['sequelize'][_0x4879('0x81')](function(_0x54fecc){return db['CmCustomField'][_0x4879('0x51')](_0x552241['body'],{'transaction':_0x54fecc})[_0x4879('0x2d')](function(_0xb30f72){_0x288c5f=_0xb30f72;return _0x56bca0[_0x4879('0x82')](_0xb30f72,{'transaction':_0x54fecc});})['then'](function(){var _0x11f7c7={'type':db[_0x4879('0x83')][_0x4879('0x84')],'transaction':_0x54fecc};switch(_0x552241[_0x4879('0x59')][_0x4879('0x47')]){case _0x4879('0x85'):_0x11f7c7[_0x4879('0x47')]=db['Sequelize'][_0x4879('0x84')];break;case'number':_0x11f7c7[_0x4879('0x47')]=db[_0x4879('0x83')][_0x4879('0x86')];break;case _0x4879('0x87'):_0x11f7c7[_0x4879('0x47')]=db[_0x4879('0x83')][_0x4879('0x88')];_0x11f7c7['defaultValue']=![];break;default:}return db[_0x4879('0x89')][_0x4879('0x8a')][_0x4879('0x8b')](_0x4879('0x8c'),util['format'](_0x4879('0x8d'),_0x288c5f['id']),_0x11f7c7);})['then'](function(){return _0x288c5f;});});}})['then'](respondWithResult(_0x300b05,null))['catch'](handleError(_0x300b05,null));};exports['getCustomFields']=function(_0x304f42,_0x4fdbdf,_0x3e43d7){var _0x14884b={};var _0x35baa2={};var _0x3b1118;var _0x56ab6c;return db['CmList'][_0x4879('0x5e')]({'where':{'id':_0x304f42['params']['id']}})[_0x4879('0x2d')](handleEntityNotFound(_0x4fdbdf,null))[_0x4879('0x2d')](function(_0x28c1ae){if(_0x28c1ae){_0x3b1118=_0x28c1ae;_0x35baa2[_0x4879('0x38')]=_[_0x4879('0x3a')](db['CmCustomField']['rawAttributes']);_0x35baa2[_0x4879('0x39')]=_[_0x4879('0x3a')](_0x304f42['query']);_0x35baa2[_0x4879('0x43')]=_[_0x4879('0x3b')](_0x35baa2[_0x4879('0x38')],_0x35baa2[_0x4879('0x39')]);_0x14884b[_0x4879('0x3c')]=_[_0x4879('0x3b')](_0x35baa2[_0x4879('0x38')],qs[_0x4879('0x3d')](_0x304f42['query'][_0x4879('0x3d')]));_0x14884b[_0x4879('0x3c')]=_0x14884b[_0x4879('0x3c')][_0x4879('0x3e')]?_0x14884b[_0x4879('0x3c')]:_0x35baa2['model'];_0x14884b[_0x4879('0x40')]=qs['sort'](_0x304f42[_0x4879('0x39')][_0x4879('0x41')]);_0x14884b[_0x4879('0x45')]=qs['filters'](_[_0x4879('0x42')](_0x304f42[_0x4879('0x39')],_0x35baa2[_0x4879('0x43')]));_0x14884b[_0x4879('0x45')]=_[_0x4879('0x46')](_0x14884b[_0x4879('0x45')],{'$or':[{'ListId':_0x28c1ae['id']},{'ListId':null}]});if(_0x304f42['query']['filter']){_0x14884b[_0x4879('0x45')]=_[_0x4879('0x46')](_0x14884b[_0x4879('0x45')],{'$or':_[_0x4879('0x33')](_0x14884b[_0x4879('0x3c')],function(_0x257a5c){var _0x418b39={};_0x418b39[_0x257a5c]={'$like':'%'+_0x304f42[_0x4879('0x39')][_0x4879('0x44')]+'%'};return _0x418b39;})});}_0x14884b=_[_0x4879('0x46')]({},_0x14884b,_0x304f42['options']);return db['CmCustomField'][_0x4879('0x8e')](_0x14884b);}})[_0x4879('0x2d')](respondWithResult(_0x4fdbdf,null))[_0x4879('0x50')](handleError(_0x4fdbdf,null));};exports[_0x4879('0x8f')]=function(_0xd82397,_0xed4c54,_0x33a9ad){return db['CmList'][_0x4879('0x4f')]({'where':{'id':_0xd82397['params']['id']}})[_0x4879('0x2d')](handleEntityNotFound(_0xed4c54,null))[_0x4879('0x2d')](function(_0x46e8b8){if(_0x46e8b8){return _0x46e8b8[_0x4879('0x8f')](_0xd82397[_0x4879('0x59')]['ids'],_[_0x4879('0x68')](_0xd82397['body'],['ids','id'])||{})[_0x4879('0x90')](function(_0x49f281){for(var _0x47a6cc=0x0;_0x47a6cc<_0xd82397[_0x4879('0x59')][_0x4879('0x61')][_0x4879('0x3e')];_0x47a6cc+=0x1){socket[_0x4879('0x91')](_0x4879('0x92'),{'UserId':Number(_0xd82397[_0x4879('0x59')][_0x4879('0x61')][_0x47a6cc]),'CmListId':Number(_0xd82397[_0x4879('0x4c')]['id'])});}return _0x49f281;});}})[_0x4879('0x2d')](respondWithResult(_0xed4c54,null))['catch'](handleError(_0xed4c54,null));};exports[_0x4879('0x93')]=function(_0xf4c20c,_0x560b38,_0x220a58){return db['CmList']['find']({'where':{'id':_0xf4c20c[_0x4879('0x4c')]['id']}})[_0x4879('0x2d')](handleEntityNotFound(_0x560b38,null))[_0x4879('0x2d')](function(_0x5a59e6){if(_0x5a59e6){return _0x5a59e6['removeAgents'](_0xf4c20c['query']['ids'])['then'](function(){if(_['isArray'](_0xf4c20c[_0x4879('0x39')][_0x4879('0x61')])){for(var _0x2a33f8=0x0;_0x2a33f8<_0xf4c20c[_0x4879('0x39')][_0x4879('0x61')][_0x4879('0x3e')];_0x2a33f8+=0x1){socket[_0x4879('0x91')](_0x4879('0x94'),{'UserId':Number(_0xf4c20c['query'][_0x4879('0x61')][_0x2a33f8]),'CmListId':Number(_0xf4c20c[_0x4879('0x4c')]['id'])});}}else{socket[_0x4879('0x91')]('userCmList:remove',{'UserId':Number(_0xf4c20c['query']['ids']),'CmListId':Number(_0xf4c20c[_0x4879('0x4c')]['id'])});}});}})[_0x4879('0x2d')](respondWithStatusCode(_0x560b38,null))[_0x4879('0x50')](handleError(_0x560b38,null));};exports['getAgents']=function(_0x445d40,_0x47772f,_0x1ec2cc){var _0x59cf3c={};var _0x106d29={};var _0xbd1e70;var _0x187d32;return db['CmList'][_0x4879('0x5e')]({'where':{'id':_0x445d40[_0x4879('0x4c')]['id']}})[_0x4879('0x2d')](handleEntityNotFound(_0x47772f,null))['then'](function(_0x3a69cc){if(_0x3a69cc){_0xbd1e70=_0x3a69cc;_0x106d29[_0x4879('0x38')]=_[_0x4879('0x3a')](db['User'][_0x4879('0x35')]);_0x106d29[_0x4879('0x39')]=_[_0x4879('0x3a')](_0x445d40['query']);_0x106d29[_0x4879('0x43')]=_[_0x4879('0x3b')](_0x106d29['model'],_0x106d29[_0x4879('0x39')]);_0x59cf3c[_0x4879('0x3c')]=_[_0x4879('0x3b')](_0x106d29[_0x4879('0x38')],qs['fields'](_0x445d40[_0x4879('0x39')][_0x4879('0x3d')]));_0x59cf3c[_0x4879('0x3c')]=_0x59cf3c['attributes'][_0x4879('0x3e')]?_0x59cf3c[_0x4879('0x3c')]:_0x106d29[_0x4879('0x38')];_0x59cf3c[_0x4879('0x40')]=qs['sort'](_0x445d40[_0x4879('0x39')][_0x4879('0x41')]);_0x59cf3c['where']=qs[_0x4879('0x43')](_[_0x4879('0x42')](_0x445d40[_0x4879('0x39')],_0x106d29[_0x4879('0x43')]));if(_0x445d40[_0x4879('0x39')][_0x4879('0x44')]){_0x59cf3c[_0x4879('0x45')]=_[_0x4879('0x46')](_0x59cf3c[_0x4879('0x45')],{'$or':_[_0x4879('0x33')](_0x59cf3c[_0x4879('0x3c')],function(_0x324c9e){var _0x571bde={};_0x571bde[_0x324c9e]={'$like':'%'+_0x445d40['query'][_0x4879('0x44')]+'%'};return _0x571bde;})});}_0x59cf3c=_[_0x4879('0x46')]({},_0x59cf3c,_0x445d40[_0x4879('0x49')]);return _0xbd1e70[_0x4879('0x95')](_0x59cf3c);}})[_0x4879('0x2d')](function(_0x2274a8){if(_0x2274a8){_0x187d32=_0x2274a8[_0x4879('0x3e')];if(!_0x445d40['query']['hasOwnProperty'](_0x4879('0x5f'))){_0x59cf3c[_0x4879('0x27')]=qs['limit'](_0x445d40['query'][_0x4879('0x27')]);_0x59cf3c['offset']=qs[_0x4879('0x24')](_0x445d40[_0x4879('0x39')][_0x4879('0x24')]);}return _0xbd1e70[_0x4879('0x95')](_0x59cf3c);}})['then'](function(_0x57a158){if(_0x57a158){return _0x57a158?{'count':_0x187d32,'rows':_0x57a158}:null;}})['then'](respondWithResult(_0x47772f,null))[_0x4879('0x50')](handleError(_0x47772f,null));};
\ No newline at end of file
index 438e84e..f19b740 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x55ca,0x126));var _0xa55c=function(_0x465533,_0x56ab66){_0x465533=_0x465533-0x0;var _0x49489b=_0x55ca[_0x465533];return _0x49489b;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
+var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x123601,_0x24c858){var _0x12db70=function(_0x31abf8){while(--_0x31abf8){_0x123601['push'](_0x123601['shift']());}};_0x12db70(++_0x24c858);}(_0x814b,0x1a2));var _0xb814=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0x814b[_0xe7281f];return _0x90dc99;};'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 bf0b75e..3c6ee09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['request-promise','path','rimraf','./cmList.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x50b66d,_0x11c61c){_0x50b66d=_0x50b66d-0x0;var _0x41aa8e=_0xbdb7[_0x50b66d];return _0x41aa8e;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf109=['CmList','cm_lists','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x136a6f,_0x26996d){var _0x4c5c07=function(_0x47ff36){while(--_0x47ff36){_0x136a6f['push'](_0x136a6f['shift']());}};_0x4c5c07(++_0x26996d);}(_0xf109,0xce));var _0x9f10=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf109[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9f26aa6..22e9c93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e07=['client','http','redis','localhost','socket.io-emitter','./cmList.socket','request','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e07,0x161));var _0x79e0=function(_0x58c6ec,_0xa0b4cd){_0x58c6ec=_0x58c6ec-0x0;var _0x3e134b=_0x9e07[_0x58c6ec];return _0x3e134b;};'use strict';var _=require(_0x79e0('0x0'));var util=require(_0x79e0('0x1'));var moment=require(_0x79e0('0x2'));var BPromise=require(_0x79e0('0x3'));var rs=require(_0x79e0('0x4'));var fs=require('fs');var Redis=require(_0x79e0('0x5'));var db=require(_0x79e0('0x6'))['db'];var utils=require(_0x79e0('0x7'));var logger=require('../../config/logger')(_0x79e0('0x8'));var config=require(_0x79e0('0x9'));var jayson=require(_0x79e0('0xa'));var client=jayson[_0x79e0('0xb')][_0x79e0('0xc')]({'port':0x232a});config[_0x79e0('0xd')]=_['defaults'](config['redis'],{'host':_0x79e0('0xe'),'port':0x18eb});var socket=require(_0x79e0('0xf'))(new Redis(config[_0x79e0('0xd')]));require(_0x79e0('0x10'))['register'](socket);function respondWithRpcPromise(_0x2b4a3e,_0x320459,_0x24341f){return new BPromise(function(_0x36790e,_0x275bb9){return client[_0x79e0('0x11')](_0x2b4a3e,_0x24341f)[_0x79e0('0x12')](function(_0x488180){logger['info'](_0x79e0('0x13'),_0x320459,_0x79e0('0x14'));logger['debug'](_0x79e0('0x15'),_0x320459,_0x79e0('0x14'),JSON[_0x79e0('0x16')](_0x488180));if(_0x488180['error']){if(_0x488180['error'][_0x79e0('0x17')]===0x1f4){logger['error'](_0x79e0('0x13'),_0x320459,_0x488180[_0x79e0('0x18')][_0x79e0('0x19')]);return _0x275bb9(_0x488180[_0x79e0('0x18')][_0x79e0('0x19')]);}logger[_0x79e0('0x18')](_0x79e0('0x13'),_0x320459,_0x488180['error']['message']);return _0x36790e(_0x488180[_0x79e0('0x18')][_0x79e0('0x19')]);}else{logger[_0x79e0('0x1a')]('CmList,\x20%s,\x20%s',_0x320459,_0x79e0('0x14'));_0x36790e(_0x488180['result'][_0x79e0('0x19')]);}})[_0x79e0('0x1b')](function(_0x4e31ec){logger[_0x79e0('0x18')](_0x79e0('0x13'),_0x320459,_0x4e31ec);_0x275bb9(_0x4e31ec);});});}
\ No newline at end of file
+var _0x033c=['socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0xf15414,_0x3fc902){var _0x498acf=function(_0x54b635){while(--_0x54b635){_0xf15414['push'](_0xf15414['shift']());}};_0x498acf(++_0x3fc902);}(_0x033c,0x76));var _0xc033=function(_0x149b40,_0x38a09e){_0x149b40=_0x149b40-0x0;var _0x1e749d=_0x033c[_0x149b40];return _0x1e749d;};'use strict';var _=require(_0xc033('0x0'));var util=require(_0xc033('0x1'));var moment=require('moment');var BPromise=require(_0xc033('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc033('0x3'));var logger=require(_0xc033('0x4'))('rpc');var config=require(_0xc033('0x5'));var jayson=require(_0xc033('0x6'));var client=jayson[_0xc033('0x7')][_0xc033('0x8')]({'port':0x232a});config['redis']=_[_0xc033('0x9')](config[_0xc033('0xa')],{'host':_0xc033('0xb'),'port':0x18eb});var socket=require(_0xc033('0xc'))(new Redis(config['redis']));require(_0xc033('0xd'))[_0xc033('0xe')](socket);function respondWithRpcPromise(_0x472377,_0x557eb9,_0x14d96e){return new BPromise(function(_0x12d01b,_0xfdb96a){return client['request'](_0x472377,_0x14d96e)[_0xc033('0xf')](function(_0x286113){logger[_0xc033('0x10')](_0xc033('0x11'),_0x557eb9,_0xc033('0x12'));logger[_0xc033('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x557eb9,_0xc033('0x12'),JSON[_0xc033('0x14')](_0x286113));if(_0x286113[_0xc033('0x15')]){if(_0x286113[_0xc033('0x15')][_0xc033('0x16')]===0x1f4){logger[_0xc033('0x15')](_0xc033('0x11'),_0x557eb9,_0x286113['error'][_0xc033('0x17')]);return _0xfdb96a(_0x286113[_0xc033('0x15')]['message']);}logger[_0xc033('0x15')](_0xc033('0x11'),_0x557eb9,_0x286113[_0xc033('0x15')][_0xc033('0x17')]);return _0x12d01b(_0x286113['error'][_0xc033('0x17')]);}else{logger[_0xc033('0x10')](_0xc033('0x11'),_0x557eb9,_0xc033('0x12'));_0x12d01b(_0x286113[_0xc033('0x18')][_0xc033('0x17')]);}})[_0xc033('0x19')](function(_0x265dc2){logger[_0xc033('0x15')](_0xc033('0x11'),_0x557eb9,_0x265dc2);_0xfdb96a(_0x265dc2);});});}
\ No newline at end of file
index 7554788..7a97524 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c6c=['emit','removeListener','register','cmList:','./cmList.events','save','remove'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0x1c6c,0x1af));var _0xc1c6=function(_0x5b28bd,_0x202e11){_0x5b28bd=_0x5b28bd-0x0;var _0x533a04=_0x1c6c[_0x5b28bd];return _0x533a04;};'use strict';var CmListEvents=require(_0xc1c6('0x0'));var events=[_0xc1c6('0x1'),_0xc1c6('0x2'),'update'];function createListener(_0x4f78db,_0x4d0a9d){return function(_0x15c9aa){_0x4d0a9d[_0xc1c6('0x3')](_0x4f78db,_0x15c9aa);};}function removeListener(_0x5e4136,_0x28565c){return function(){CmListEvents[_0xc1c6('0x4')](_0x5e4136,_0x28565c);};}exports[_0xc1c6('0x5')]=function(_0x14e3c4){for(var _0x20440f=0x0,_0x1cb411=events['length'];_0x20440f<_0x1cb411;_0x20440f++){var _0x8b782b=events[_0x20440f];var _0x81de80=createListener(_0xc1c6('0x6')+_0x8b782b,_0x14e3c4);CmListEvents['on'](_0x8b782b,_0x81de80);}};
\ No newline at end of file
+var _0x82de=['cmList:','./cmList.events','save','remove','update','emit','length'];(function(_0x42b878,_0x14971e){var _0x4180aa=function(_0x1b3e03){while(--_0x1b3e03){_0x42b878['push'](_0x42b878['shift']());}};_0x4180aa(++_0x14971e);}(_0x82de,0xa2));var _0xe82d=function(_0x3c3021,_0x189015){_0x3c3021=_0x3c3021-0x0;var _0x347432=_0x82de[_0x3c3021];return _0x347432;};'use strict';var CmListEvents=require(_0xe82d('0x0'));var events=[_0xe82d('0x1'),_0xe82d('0x2'),_0xe82d('0x3')];function createListener(_0x51f163,_0x1b0639){return function(_0x188779){_0x1b0639[_0xe82d('0x4')](_0x51f163,_0x188779);};}function removeListener(_0xbf8215,_0x113859){return function(){CmListEvents['removeListener'](_0xbf8215,_0x113859);};}exports['register']=function(_0x423591){for(var _0x19b567=0x0,_0x74f622=events[_0xe82d('0x5')];_0x19b567<_0x74f622;_0x19b567++){var _0x376d30=events[_0x19b567];var _0x112196=createListener(_0xe82d('0x6')+_0x376d30,_0x423591);CmListEvents['on'](_0x376d30,_0x112196);}};
\ No newline at end of file
index b7f7994..fbb7d9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dc4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','create','post','addDisposition','addContacts','addCustomField','put','update','delete','removeDispositions','removeAgents','exports','util','path','connect-timeout','express'];(function(_0x39b959,_0x1c3165){var _0x5952b5=function(_0x53446a){while(--_0x53446a){_0x39b959['push'](_0x39b959['shift']());}};_0x5952b5(++_0x1c3165);}(_0x9dc4,0x1e6));var _0x49dc=function(_0x17598a,_0x486bbb){_0x17598a=_0x17598a-0x0;var _0x3333db=_0x9dc4[_0x17598a];return _0x3333db;};'use strict';var multer=require('multer');var util=require(_0x49dc('0x0'));var path=require(_0x49dc('0x1'));var timeout=require(_0x49dc('0x2'));var express=require(_0x49dc('0x3'));var router=express[_0x49dc('0x4')]();var fs_extra=require(_0x49dc('0x5'));var auth=require(_0x49dc('0x6'));var interaction=require(_0x49dc('0x7'));var config=require(_0x49dc('0x8'));var controller=require(_0x49dc('0x9'));router[_0x49dc('0xa')]('/',auth[_0x49dc('0xb')](),controller[_0x49dc('0xc')]);router[_0x49dc('0xa')]('/describe',auth[_0x49dc('0xb')](),controller['describe']);router[_0x49dc('0xa')](_0x49dc('0xd'),auth['isAuthenticated'](),controller[_0x49dc('0xe')]);router[_0x49dc('0xa')](_0x49dc('0xf'),auth['isAuthenticated'](),controller[_0x49dc('0x10')]);router[_0x49dc('0xa')](_0x49dc('0x11'),auth[_0x49dc('0xb')](),controller[_0x49dc('0x12')]);router[_0x49dc('0xa')](_0x49dc('0x13'),auth[_0x49dc('0xb')](),controller['getContactsCsv']);router['get'](_0x49dc('0x14'),auth[_0x49dc('0xb')](),controller[_0x49dc('0x15')]);router[_0x49dc('0xa')](_0x49dc('0x16'),auth[_0x49dc('0xb')](),controller[_0x49dc('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0x49dc('0x18')]);router[_0x49dc('0x19')](_0x49dc('0xf'),auth[_0x49dc('0xb')](),controller[_0x49dc('0x1a')]);router[_0x49dc('0x19')](_0x49dc('0x11'),auth[_0x49dc('0xb')](),controller[_0x49dc('0x1b')]);router[_0x49dc('0x19')](_0x49dc('0x14'),auth['isAuthenticated'](),controller[_0x49dc('0x1c')]);router[_0x49dc('0x19')](_0x49dc('0x16'),auth[_0x49dc('0xb')](),controller['addAgents']);router[_0x49dc('0x1d')](_0x49dc('0xd'),auth['isAuthenticated'](),controller[_0x49dc('0x1e')]);router[_0x49dc('0x1f')](_0x49dc('0xd'),auth[_0x49dc('0xb')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x49dc('0xb')](),controller[_0x49dc('0x20')]);router[_0x49dc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x49dc('0x21')]);module[_0x49dc('0x22')]=router;
\ No newline at end of file
+var _0x44a2=['getContacts','getContactsCsv','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/fields','addCustomField','addAgents','put','update','delete','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./cmList.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/contacts'];(function(_0x2fc5a9,_0x2a92f0){var _0x2b1b8b=function(_0x1f4e55){while(--_0x1f4e55){_0x2fc5a9['push'](_0x2fc5a9['shift']());}};_0x2b1b8b(++_0x2a92f0);}(_0x44a2,0x1c2));var _0x244a=function(_0x2b3fc7,_0x44d8c1){_0x2b3fc7=_0x2b3fc7-0x0;var _0x5e146e=_0x44a2[_0x2b3fc7];return _0x5e146e;};'use strict';var multer=require(_0x244a('0x0'));var util=require(_0x244a('0x1'));var path=require(_0x244a('0x2'));var timeout=require(_0x244a('0x3'));var express=require(_0x244a('0x4'));var router=express['Router']();var fs_extra=require(_0x244a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x244a('0x6'));var controller=require(_0x244a('0x7'));router[_0x244a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x244a('0x9'),auth['isAuthenticated'](),controller[_0x244a('0xa')]);router[_0x244a('0x8')](_0x244a('0xb'),auth[_0x244a('0xc')](),controller[_0x244a('0xd')]);router[_0x244a('0x8')]('/:id/dispositions',auth[_0x244a('0xc')](),controller['getDispositions']);router[_0x244a('0x8')](_0x244a('0xe'),auth[_0x244a('0xc')](),controller[_0x244a('0xf')]);router[_0x244a('0x8')]('/:id/contacts/csv',auth[_0x244a('0xc')](),controller[_0x244a('0x10')]);router[_0x244a('0x8')]('/:id/fields',auth[_0x244a('0xc')](),controller['getCustomFields']);router[_0x244a('0x8')](_0x244a('0x11'),auth['isAuthenticated'](),controller[_0x244a('0x12')]);router[_0x244a('0x13')]('/',auth[_0x244a('0xc')](),controller[_0x244a('0x14')]);router[_0x244a('0x13')](_0x244a('0x15'),auth[_0x244a('0xc')](),controller[_0x244a('0x16')]);router[_0x244a('0x13')](_0x244a('0xe'),auth[_0x244a('0xc')](),controller['addContacts']);router[_0x244a('0x13')](_0x244a('0x17'),auth[_0x244a('0xc')](),controller[_0x244a('0x18')]);router['post'](_0x244a('0x11'),auth['isAuthenticated'](),controller[_0x244a('0x19')]);router[_0x244a('0x1a')]('/:id',auth[_0x244a('0xc')](),controller[_0x244a('0x1b')]);router[_0x244a('0x1c')](_0x244a('0xb'),auth[_0x244a('0xc')](),controller['destroy']);router[_0x244a('0x1c')](_0x244a('0x15'),auth[_0x244a('0xc')](),controller[_0x244a('0x1d')]);router[_0x244a('0x1c')](_0x244a('0x11'),auth['isAuthenticated'](),controller[_0x244a('0x1e')]);module['exports']=router;
\ No newline at end of file
index bac672e..7454eaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd151=['field','sequelize','exports','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd151,0x1a5));var _0x1d15=function(_0x40edbb,_0x4b8e85){_0x40edbb=_0x40edbb-0x0;var _0x1c34e1=_0xd151[_0x40edbb];return _0x1c34e1;};'use strict';var Sequelize=require(_0x1d15('0x0'));module[_0x1d15('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4e266b){return this[_0x1d15('0x2')](_0x1d15('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xfe6f=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x4c0825,_0x313b46){var _0x5e495a=function(_0x48cb5d){while(--_0x48cb5d){_0x4c0825['push'](_0x4c0825['shift']());}};_0x5e495a(++_0x313b46);}(_0xfe6f,0x1e2));var _0xffe6=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xfe6f[_0x1e3c16];return _0x47a0c9;};'use strict';var Sequelize=require(_0xffe6('0x0'));module[_0xffe6('0x1')]={'name':{'type':Sequelize[_0xffe6('0x2')],'get':function(_0x106bc6){return this[_0xffe6('0x3')](_0xffe6('0x4'));}},'field':{'type':Sequelize[_0xffe6('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xffe6('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xffe6('0x5')],'allowNull':![]}};
\ No newline at end of file
index 3317050..34487c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x180c93,_0x37b075){var _0x112448=function(_0x12b434){while(--_0x12b434){_0x180c93['push'](_0x180c93['shift']());}};_0x112448(++_0x37b075);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _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(_0x3c12f3,_0x36b991){var _0x5a044a=function(_0xfaac9d){while(--_0xfaac9d){_0x3c12f3['push'](_0x3c12f3['shift']());}};_0x5a044a(++_0x36b991);}(_0x7a54,0x106));var _0x47a5=function(_0x1b72cc,_0x1dc3da){_0x1b72cc=_0x1b72cc-0x0;var _0x33b52b=_0x7a54[_0x1b72cc];return _0x33b52b;};'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 237a761..e1874b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5b7=['tools_conditions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x36ac26,_0x541ef9){var _0x4a8e26=function(_0x2ea9c7){while(--_0x2ea9c7){_0x36ac26['push'](_0x36ac26['shift']());}};_0x4a8e26(++_0x541ef9);}(_0xa5b7,0xa9));var _0x7a5b=function(_0x4123aa,_0xf63d03){_0x4123aa=_0x4123aa-0x0;var _0x3cfb49=_0xa5b7[_0x4123aa];return _0x3cfb49;};'use strict';var _=require(_0x7a5b('0x0'));var util=require(_0x7a5b('0x1'));var logger=require(_0x7a5b('0x2'))('api');var moment=require(_0x7a5b('0x3'));var BPromise=require(_0x7a5b('0x4'));var rp=require(_0x7a5b('0x5'));var fs=require('fs');var path=require(_0x7a5b('0x6'));var rimraf=require(_0x7a5b('0x7'));var config=require(_0x7a5b('0x8'));var attributes=require(_0x7a5b('0x9'));module[_0x7a5b('0xa')]=function(_0x80ae78,_0x27d618){return _0x80ae78['define']('Condition',attributes,{'tableName':_0x7a5b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7af3=['rimraf','exports','Condition','tools_conditions','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x7af3,0xd5));var _0x37af=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x7af3[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x37af('0x0'));var util=require('util');var logger=require(_0x37af('0x1'))(_0x37af('0x2'));var moment=require(_0x37af('0x3'));var BPromise=require(_0x37af('0x4'));var rp=require(_0x37af('0x5'));var fs=require('fs');var path=require(_0x37af('0x6'));var rimraf=require(_0x37af('0x7'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0x37af('0x8')]=function(_0x519a9b,_0x4e68ea){return _0x519a9b['define'](_0x37af('0x9'),attributes,{'tableName':_0x37af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e209da4..3452b82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8de0=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result'];(function(_0x1308ec,_0x32c99e){var _0x1a43c8=function(_0x18ff62){while(--_0x18ff62){_0x1308ec['push'](_0x1308ec['shift']());}};_0x1a43c8(++_0x32c99e);}(_0x8de0,0x1e5));var _0x08de=function(_0x2efd2c,_0xbce300){_0x2efd2c=_0x2efd2c-0x0;var _0x23e30e=_0x8de0[_0x2efd2c];return _0x23e30e;};'use strict';var _=require(_0x08de('0x0'));var util=require(_0x08de('0x1'));var moment=require(_0x08de('0x2'));var BPromise=require(_0x08de('0x3'));var rs=require(_0x08de('0x4'));var fs=require('fs');var Redis=require(_0x08de('0x5'));var db=require(_0x08de('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x08de('0x7'));var config=require('../../config/environment');var jayson=require(_0x08de('0x8'));var client=jayson[_0x08de('0x9')][_0x08de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ad53b,_0x2af6ba,_0x662acd){return new BPromise(function(_0x2bd290,_0x4d3c4f){return client[_0x08de('0xb')](_0x2ad53b,_0x662acd)[_0x08de('0xc')](function(_0x2bec82){logger['info'](_0x08de('0xd'),_0x2af6ba,'request\x20sent');logger['debug'](_0x08de('0xe'),_0x2af6ba,'request\x20sent',JSON['stringify'](_0x2bec82));if(_0x2bec82['error']){if(_0x2bec82[_0x08de('0xf')][_0x08de('0x10')]===0x1f4){logger[_0x08de('0xf')](_0x08de('0xd'),_0x2af6ba,_0x2bec82['error']['message']);return _0x4d3c4f(_0x2bec82[_0x08de('0xf')][_0x08de('0x11')]);}logger[_0x08de('0xf')](_0x08de('0xd'),_0x2af6ba,_0x2bec82[_0x08de('0xf')][_0x08de('0x11')]);return _0x2bd290(_0x2bec82[_0x08de('0xf')]['message']);}else{logger[_0x08de('0x12')]('Condition,\x20%s,\x20%s',_0x2af6ba,_0x08de('0x13'));_0x2bd290(_0x2bec82[_0x08de('0x14')]['message']);}})[_0x08de('0x15')](function(_0x1d423b){logger[_0x08de('0xf')](_0x08de('0xd'),_0x2af6ba,_0x1d423b);_0x4d3c4f(_0x1d423b);});});}
\ No newline at end of file
+var _0x1036=['Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info'];(function(_0x294747,_0x379ea7){var _0x1a4b30=function(_0xac96e8){while(--_0xac96e8){_0x294747['push'](_0x294747['shift']());}};_0x1a4b30(++_0x379ea7);}(_0x1036,0x98));var _0x6103=function(_0x376af4,_0x386e65){_0x376af4=_0x376af4-0x0;var _0x2b7494=_0x1036[_0x376af4];return _0x2b7494;};'use strict';var _=require(_0x6103('0x0'));var util=require('util');var moment=require(_0x6103('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6103('0x2'))['db'];var utils=require(_0x6103('0x3'));var logger=require(_0x6103('0x4'))('rpc');var config=require(_0x6103('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x6103('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2973d0,_0x4cb1c5,_0x30e3bc){return new BPromise(function(_0x1f8948,_0x4e3ba6){return client[_0x6103('0x7')](_0x2973d0,_0x30e3bc)[_0x6103('0x8')](function(_0x2bd60d){logger[_0x6103('0x9')](_0x6103('0xa'),_0x4cb1c5,'request\x20sent');logger[_0x6103('0xb')](_0x6103('0xc'),_0x4cb1c5,_0x6103('0xd'),JSON['stringify'](_0x2bd60d));if(_0x2bd60d['error']){if(_0x2bd60d[_0x6103('0xe')][_0x6103('0xf')]===0x1f4){logger[_0x6103('0xe')](_0x6103('0xa'),_0x4cb1c5,_0x2bd60d[_0x6103('0xe')][_0x6103('0x10')]);return _0x4e3ba6(_0x2bd60d[_0x6103('0xe')][_0x6103('0x10')]);}logger[_0x6103('0xe')](_0x6103('0xa'),_0x4cb1c5,_0x2bd60d[_0x6103('0xe')][_0x6103('0x10')]);return _0x1f8948(_0x2bd60d[_0x6103('0xe')][_0x6103('0x10')]);}else{logger[_0x6103('0x9')](_0x6103('0xa'),_0x4cb1c5,_0x6103('0xd'));_0x1f8948(_0x2bd60d['result'][_0x6103('0x10')]);}})[_0x6103('0x11')](function(_0xb82c67){logger[_0x6103('0xe')](_0x6103('0xa'),_0x4cb1c5,_0xb82c67);_0x4e3ba6(_0xb82c67);});});}
\ No newline at end of file
index a2cc386..d7a621e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49ee=['delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update'];(function(_0x421df,_0x3fcd43){var _0x24f937=function(_0x55835f){while(--_0x55835f){_0x421df['push'](_0x421df['shift']());}};_0x24f937(++_0x3fcd43);}(_0x49ee,0x199));var _0xe49e=function(_0x4a3d3e,_0x4f546b){_0x4a3d3e=_0x4a3d3e-0x0;var _0x17e88a=_0x49ee[_0x4a3d3e];return _0x17e88a;};'use strict';var multer=require(_0xe49e('0x0'));var util=require('util');var path=require(_0xe49e('0x1'));var timeout=require(_0xe49e('0x2'));var express=require('express');var router=express[_0xe49e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe49e('0x4'));var interaction=require(_0xe49e('0x5'));var config=require(_0xe49e('0x6'));var controller=require(_0xe49e('0x7'));router['put'](_0xe49e('0x8'),auth[_0xe49e('0x9')](),controller[_0xe49e('0xa')]);router[_0xe49e('0xb')](_0xe49e('0x8'),auth[_0xe49e('0x9')](),controller[_0xe49e('0xc')]);module[_0xe49e('0xd')]=router;
\ No newline at end of file
+var _0xfa8d=['Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','/:id','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2aadfd,_0x4470af){var _0x5a9eb9=function(_0x283f5c){while(--_0x283f5c){_0x2aadfd['push'](_0x2aadfd['shift']());}};_0x5a9eb9(++_0x4470af);}(_0xfa8d,0x1f4));var _0xdfa8=function(_0x222dc5,_0x5335ef){_0x222dc5=_0x222dc5-0x0;var _0x2293ab=_0xfa8d[_0x222dc5];return _0x2293ab;};'use strict';var multer=require(_0xdfa8('0x0'));var util=require(_0xdfa8('0x1'));var path=require(_0xdfa8('0x2'));var timeout=require(_0xdfa8('0x3'));var express=require('express');var router=express[_0xdfa8('0x4')]();var fs_extra=require(_0xdfa8('0x5'));var auth=require(_0xdfa8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdfa8('0x7'));var controller=require(_0xdfa8('0x8'));router['put'](_0xdfa8('0x9'),auth[_0xdfa8('0xa')](),controller['update']);router[_0xdfa8('0xb')]('/:id',auth[_0xdfa8('0xa')](),controller[_0xdfa8('0xc')]);module[_0xdfa8('0xd')]=router;
\ No newline at end of file
index de52309..49d05fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x253f0b,_0x52e566){var _0xfd0095=function(_0x42e5d5){while(--_0x42e5d5){_0x253f0b['push'](_0x253f0b['shift']());}};_0xfd0095(++_0x52e566);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b89a0,_0x315a2a){_0x5b89a0=_0x5b89a0-0x0;var _0x44d81a=_0xb10b[_0x5b89a0];return _0x44d81a;};'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 _0xb10b=['name','sequelize','STRING'];(function(_0x69cd0,_0x542800){var _0x43d520=function(_0x2074e9){while(--_0x2074e9){_0x69cd0['push'](_0x69cd0['shift']());}};_0x43d520(++_0x542800);}(_0xb10b,0x12a));var _0xbb10=function(_0x5046cf,_0x44c493){_0x5046cf=_0x5046cf-0x0;var _0x2fb819=_0xb10b[_0x5046cf];return _0x2fb819;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
index b7d5d39..2dd0f88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4596=['attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','attrFaxAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./dashboard.socket','register','status','end','limit','undefined','count','offset','set','json','apply','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','error','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','fields','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','params','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts'];(function(_0x1e0c0e,_0x5ccb80){var _0x53fecc=function(_0x21145a){while(--_0x21145a){_0x1e0c0e['push'](_0x1e0c0e['shift']());}};_0x53fecc(++_0x5ccb80);}(_0x4596,0x119));var _0x6459=function(_0x28ee76,_0x142b18){_0x28ee76=_0x28ee76-0x0;var _0x13dc03=_0x4596[_0x28ee76];return _0x13dc03;};'use strict';var emlformat=require(_0x6459('0x0'));var rimraf=require(_0x6459('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6459('0x2'));var rp=require(_0x6459('0x3'));var moment=require(_0x6459('0x4'));var BPromise=require(_0x6459('0x5'));var Mustache=require(_0x6459('0x6'));var util=require(_0x6459('0x7'));var path=require(_0x6459('0x8'));var sox=require(_0x6459('0x9'));var csv=require(_0x6459('0xa'));var ejs=require(_0x6459('0xb'));var fs=require('fs');var fs_extra=require(_0x6459('0xc'));var _=require(_0x6459('0xd'));var squel=require(_0x6459('0xe'));var crypto=require(_0x6459('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6459('0x10'));var toCsv=require(_0x6459('0xa'));var querystring=require('querystring');var Papa=require(_0x6459('0x11'));var Redis=require(_0x6459('0x12'));var authService=require(_0x6459('0x13'));var qs=require(_0x6459('0x14'));var as=require(_0x6459('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6459('0x16'));var utils=require(_0x6459('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6459('0x18'));var db=require('../../mysqldb')['db'];config[_0x6459('0x19')]=_[_0x6459('0x1a')](config[_0x6459('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x6459('0x1b'))(new Redis(config[_0x6459('0x19')]));require(_0x6459('0x1c'))[_0x6459('0x1d')](socket);function respondWithStatusCode(_0x1178cc,_0x32dc78){_0x32dc78=_0x32dc78||0xcc;return function(_0xf96e71){if(_0xf96e71){return _0x1178cc['sendStatus'](_0x32dc78);}return _0x1178cc[_0x6459('0x1e')](_0x32dc78)[_0x6459('0x1f')]();};}function respondWithResult(_0x390aec,_0x353a4d){_0x353a4d=_0x353a4d||0xc8;return function(_0x349025){if(_0x349025){return _0x390aec[_0x6459('0x1e')](_0x353a4d)['json'](_0x349025);}};}function respondWithFilteredResult(_0x3981de,_0x34779b){return function(_0x30c84a){if(_0x30c84a){var _0x5bb293=typeof _0x34779b['offset']==='undefined'&&typeof _0x34779b[_0x6459('0x20')]===_0x6459('0x21');var _0x28c8c9=_0x30c84a[_0x6459('0x22')];var _0x1a60b5=_0x5bb293?0x0:_0x34779b[_0x6459('0x23')];var _0x5f55b8=_0x5bb293?_0x30c84a[_0x6459('0x22')]:_0x34779b['offset']+_0x34779b[_0x6459('0x20')];var _0x5294cb;if(_0x5f55b8>=_0x28c8c9){_0x5f55b8=_0x28c8c9;_0x5294cb=0xc8;}else{_0x5294cb=0xce;}_0x3981de[_0x6459('0x1e')](_0x5294cb);return _0x3981de[_0x6459('0x24')]('Content-Range',_0x1a60b5+'-'+_0x5f55b8+'/'+_0x28c8c9)[_0x6459('0x25')](_0x30c84a);}return null;};}function patchUpdates(_0x1bdbac){return function(_0xa4376d){try{jsonpatch[_0x6459('0x26')](_0xa4376d,_0x1bdbac,!![]);}catch(_0x3fd7da){return BPromise[_0x6459('0x27')](_0x3fd7da);}return _0xa4376d[_0x6459('0x28')]();};}function saveUpdates(_0x2473a0,_0xc96271){return function(_0x522f50){if(_0x522f50){return _0x522f50['update'](_0x2473a0)[_0x6459('0x29')](function(_0x59ded6){return _0x59ded6;});}return null;};}function removeEntity(_0x1c096c,_0x4bc4b5){return function(_0x54d3d7){if(_0x54d3d7){return _0x54d3d7[_0x6459('0x2a')]()['then'](function(){var _0x3788bd=_0x54d3d7[_0x6459('0x2b')]({'plain':!![]});var _0x19fb5a=_0x6459('0x2c');return db[_0x6459('0x2d')][_0x6459('0x2a')]({'where':{'type':_0x19fb5a,'resourceId':_0x3788bd['id']}})[_0x6459('0x29')](function(){return _0x54d3d7;});})['then'](function(){_0x1c096c[_0x6459('0x1e')](0xcc)[_0x6459('0x1f')]();});}};}function handleEntityNotFound(_0x451d9d,_0x364277){return function(_0x242e0f){if(!_0x242e0f){_0x451d9d[_0x6459('0x2e')](0x194);}return _0x242e0f;};}function handleError(_0x949033,_0x45bd02){_0x45bd02=_0x45bd02||0x1f4;return function(_0x54fc88){logger[_0x6459('0x2f')](_0x54fc88['stack']);if(_0x54fc88[_0x6459('0x30')]){delete _0x54fc88[_0x6459('0x30')];}_0x949033[_0x6459('0x1e')](_0x45bd02)[_0x6459('0x31')](_0x54fc88);};}exports[_0x6459('0x32')]=function(_0x4a8b4b,_0x798bae){var _0x581f5d={},_0x27b5f3={},_0x305eea={'count':0x0,'rows':[]};var _0x324cbd=_[_0x6459('0x33')](db[_0x6459('0x34')][_0x6459('0x35')],function(_0x4ce4b1){return{'name':_0x4ce4b1[_0x6459('0x36')],'type':_0x4ce4b1[_0x6459('0x37')][_0x6459('0x38')]};});_0x27b5f3[_0x6459('0x39')]=_[_0x6459('0x33')](_0x324cbd,_0x6459('0x30'));_0x27b5f3[_0x6459('0x3a')]=_[_0x6459('0x3b')](_0x4a8b4b[_0x6459('0x3a')]);_0x27b5f3[_0x6459('0x3c')]=_[_0x6459('0x3d')](_0x27b5f3['model'],_0x27b5f3[_0x6459('0x3a')]);_0x581f5d[_0x6459('0x3e')]=_['intersection'](_0x27b5f3['model'],qs['fields'](_0x4a8b4b[_0x6459('0x3a')]['fields']));_0x581f5d['attributes']=_0x581f5d[_0x6459('0x3e')][_0x6459('0x3f')]?_0x581f5d[_0x6459('0x3e')]:_0x27b5f3['model'];if(!_0x4a8b4b[_0x6459('0x3a')][_0x6459('0x40')](_0x6459('0x41'))){_0x581f5d[_0x6459('0x20')]=qs[_0x6459('0x20')](_0x4a8b4b[_0x6459('0x3a')][_0x6459('0x20')]);_0x581f5d[_0x6459('0x23')]=qs[_0x6459('0x23')](_0x4a8b4b[_0x6459('0x3a')][_0x6459('0x23')]);}_0x581f5d[_0x6459('0x42')]=qs['sort'](_0x4a8b4b['query'][_0x6459('0x43')]);_0x581f5d['where']=qs['filters'](_[_0x6459('0x44')](_0x4a8b4b[_0x6459('0x3a')],_0x27b5f3[_0x6459('0x3c')]),_0x324cbd);if(_0x4a8b4b['query'][_0x6459('0x45')]){_0x581f5d[_0x6459('0x46')]=_['merge'](_0x581f5d[_0x6459('0x46')],{'$or':_[_0x6459('0x33')](_0x324cbd,function(_0x217bac){if(_0x217bac[_0x6459('0x37')]!==_0x6459('0x47')){var _0x5689ad={};_0x5689ad[_0x217bac[_0x6459('0x30')]]={'$like':'%'+_0x4a8b4b['query'][_0x6459('0x45')]+'%'};return _0x5689ad;}})});}_0x581f5d=_[_0x6459('0x48')]({},_0x581f5d,_0x4a8b4b[_0x6459('0x49')]);var _0x50afee={'where':_0x581f5d[_0x6459('0x46')]};return db[_0x6459('0x34')][_0x6459('0x22')](_0x50afee)['then'](function(_0x11400e){_0x305eea[_0x6459('0x22')]=_0x11400e;if(_0x4a8b4b[_0x6459('0x3a')][_0x6459('0x4a')]){_0x581f5d[_0x6459('0x4b')]=[{'all':!![]}];}return db[_0x6459('0x34')][_0x6459('0x4c')](_0x581f5d);})[_0x6459('0x29')](function(_0x5ce38e){_0x305eea[_0x6459('0x4d')]=_0x5ce38e;return _0x305eea;})[_0x6459('0x29')](respondWithFilteredResult(_0x798bae,_0x581f5d))[_0x6459('0x4e')](handleError(_0x798bae,null));};exports[_0x6459('0x4f')]=function(_0x965be4,_0xc84beb){var _0x4467f9={'raw':![],'where':{'id':_0x965be4['params']['id']}},_0x210e68={};_0x210e68[_0x6459('0x39')]=_[_0x6459('0x3b')](db[_0x6459('0x34')][_0x6459('0x35')]);_0x210e68['query']=_[_0x6459('0x3b')](_0x965be4[_0x6459('0x3a')]);_0x210e68[_0x6459('0x3c')]=_[_0x6459('0x3d')](_0x210e68['model'],_0x210e68[_0x6459('0x3a')]);_0x4467f9['attributes']=_[_0x6459('0x3d')](_0x210e68['model'],qs[_0x6459('0x50')](_0x965be4[_0x6459('0x3a')][_0x6459('0x50')]));_0x4467f9['attributes']=_0x4467f9['attributes']['length']?_0x4467f9[_0x6459('0x3e')]:_0x210e68[_0x6459('0x39')];if(_0x965be4[_0x6459('0x3a')][_0x6459('0x4a')]){_0x4467f9['include']=[{'all':!![]}];}_0x4467f9=_[_0x6459('0x48')]({},_0x4467f9,_0x965be4['options']);return db['Dashboard'][_0x6459('0x51')](_0x4467f9)[_0x6459('0x29')](handleEntityNotFound(_0xc84beb,null))[_0x6459('0x29')](respondWithResult(_0xc84beb,null))[_0x6459('0x4e')](handleError(_0xc84beb,null));};exports[_0x6459('0x52')]=function(_0x393f72,_0x167f33){return db['Dashboard'][_0x6459('0x52')](_0x393f72[_0x6459('0x53')],{})[_0x6459('0x29')](function(_0x24bb07){var _0x8bbd2a=_0x393f72[_0x6459('0x54')]['get']({'plain':!![]});if(!_0x8bbd2a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8bbd2a[_0x6459('0x55')]===_0x6459('0x54')){var _0x3e4a9a=_0x24bb07[_0x6459('0x2b')]({'plain':!![]});var _0x2f9210='CustomDashboards';return db[_0x6459('0x56')][_0x6459('0x51')]({'where':{'name':_0x2f9210,'userProfileId':_0x8bbd2a[_0x6459('0x57')]},'raw':!![]})[_0x6459('0x29')](function(_0x564059){if(_0x564059&&_0x564059[_0x6459('0x58')]===0x0){return db[_0x6459('0x2d')][_0x6459('0x52')]({'name':_0x3e4a9a[_0x6459('0x30')],'resourceId':_0x3e4a9a['id'],'type':_0x564059['name'],'sectionId':_0x564059['id']},{})[_0x6459('0x29')](function(){return _0x24bb07;});}else{return _0x24bb07;}})[_0x6459('0x4e')](function(_0x3bdd43){logger['error'](_0x6459('0x59'),_0x3bdd43);throw _0x3bdd43;});}return _0x24bb07;})[_0x6459('0x29')](respondWithResult(_0x167f33,0xc9))[_0x6459('0x4e')](handleError(_0x167f33,null));};exports[_0x6459('0x5a')]=function(_0xdda9a0,_0x4bbffe){var _0x4a0bc4={'where':{'id':_0xdda9a0['params']['id']}},_0x4b30d5={};_0x4b30d5[_0x6459('0x39')]=_['keys'](db[_0x6459('0x34')][_0x6459('0x35')]);_0x4a0bc4['attributes']=_[_0x6459('0x3d')](_0x4b30d5[_0x6459('0x39')],qs[_0x6459('0x50')](_0xdda9a0['query'][_0x6459('0x50')]));_0x4a0bc4['attributes']=_0x4a0bc4[_0x6459('0x3e')][_0x6459('0x3f')]?_0x4a0bc4[_0x6459('0x3e')]:_0x4b30d5[_0x6459('0x39')];if(_0xdda9a0['query']['includeAll']){_0x4a0bc4['include']=[{'all':!![]}];}_0x4a0bc4=_['merge']({},_0x4a0bc4,_0xdda9a0[_0x6459('0x49')]);return db[_0x6459('0x34')]['find'](_0x4a0bc4)[_0x6459('0x29')](handleEntityNotFound(_0x4bbffe,null))[_0x6459('0x29')](function(_0x435a41){if(_0x435a41){var _0x4383b5=_0x435a41[_0x6459('0x2b')]({'plain':!![]});_0x4383b5=qs[_0x6459('0x5b')](_0x4383b5,['id',_0x6459('0x5c'),_0x6459('0x5d')]);_0xdda9a0['body']=_[_0x6459('0x5b')](_0xdda9a0['body'],['id',_0x6459('0x5c'),_0x6459('0x5d')]);return db[_0x6459('0x34')][_0x6459('0x52')](_[_0x6459('0x48')](_0x4383b5,_0xdda9a0[_0x6459('0x53')]),{'include':_0xdda9a0[_0x6459('0x3a')][_0x6459('0x4a')]?[{'all':!![]}]:undefined})[_0x6459('0x29')](function(_0x2f59bf){var _0x6deb7e=_0xdda9a0['user']['get']({'plain':!![]});if(!_0x6deb7e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6deb7e[_0x6459('0x55')]===_0x6459('0x54')){var _0x540303=_0x2f59bf[_0x6459('0x2b')]({'plain':!![]});var _0x1f6129=_0x6459('0x2c');return db['UserProfileSection'][_0x6459('0x51')]({'where':{'name':_0x1f6129,'userProfileId':_0x6deb7e['userProfileId']},'raw':!![]})[_0x6459('0x29')](function(_0x355309){if(_0x355309&&_0x355309['autoAssociation']===0x0){return db[_0x6459('0x2d')][_0x6459('0x52')]({'name':_0x540303[_0x6459('0x30')],'resourceId':_0x540303['id'],'type':_0x355309[_0x6459('0x30')],'sectionId':_0x355309['id']},{})[_0x6459('0x29')](function(){return _0x2f59bf;});}else{return _0x2f59bf;}})['catch'](function(_0x4f3a55){logger[_0x6459('0x2f')](_0x6459('0x59'),_0x4f3a55);throw _0x4f3a55;});}return _0x2f59bf;});}})[_0x6459('0x29')](respondWithResult(_0x4bbffe,0xc9))[_0x6459('0x4e')](handleError(_0x4bbffe,null));};exports['update']=function(_0x4af891,_0x452122){if(_0x4af891[_0x6459('0x53')]['id']){delete _0x4af891[_0x6459('0x53')]['id'];}return db[_0x6459('0x34')][_0x6459('0x51')]({'where':{'id':_0x4af891[_0x6459('0x5e')]['id']}})[_0x6459('0x29')](handleEntityNotFound(_0x452122,null))[_0x6459('0x29')](saveUpdates(_0x4af891[_0x6459('0x53')],null))[_0x6459('0x29')](respondWithResult(_0x452122,null))['catch'](handleError(_0x452122,null));};exports[_0x6459('0x2a')]=function(_0x3ce5e3,_0x2f26c2){return db[_0x6459('0x34')]['find']({'where':{'id':_0x3ce5e3['params']['id']}})[_0x6459('0x29')](handleEntityNotFound(_0x2f26c2,null))[_0x6459('0x29')](removeEntity(_0x2f26c2,null))[_0x6459('0x4e')](handleError(_0x2f26c2,null));};function widgetAttributes(_0x3e9f5f){try{switch(_0x3e9f5f['type']){case _0x6459('0x5f'):return[{'name':_0x6459('0x60'),'value':_0x3e9f5f['attrUrl']||(_0x3e9f5f['attrs']&&_0x3e9f5f[_0x6459('0x61')][0x0]?_0x3e9f5f[_0x6459('0x61')][0x0][_0x6459('0x62')]:undefined)||'https://'}];case _0x6459('0x63'):return[{'name':_0x6459('0x64'),'value':_0x3e9f5f['attrPath']||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f['attrs'][0x0]?_0x3e9f5f[_0x6459('0x61')][0x0][_0x6459('0x62')]:undefined)||''}];case _0x6459('0x65'):return[{'name':_0x6459('0x66'),'value':_0x3e9f5f['attrHourFormat']||(_0x3e9f5f['attrs']&&_0x3e9f5f['attrs'][0x0]?_0x3e9f5f[_0x6459('0x61')][0x0][_0x6459('0x62')]:undefined)||_0x6459('0x67')},{'name':_0x6459('0x68'),'value':_0x3e9f5f['attrTimezone']||(_0x3e9f5f['attrs']&&_0x3e9f5f[_0x6459('0x61')][0x1]?_0x3e9f5f[_0x6459('0x61')][0x1][_0x6459('0x62')]:undefined)||'0.00'},{'name':_0x6459('0x69'),'value':_0x3e9f5f[_0x6459('0x69')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x2]?_0x3e9f5f[_0x6459('0x61')][0x2][_0x6459('0x62')]:undefined)||0xc}];case _0x6459('0x6a'):return[{'name':'attrMetric','value':_0x3e9f5f[_0x6459('0x6b')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x0]?_0x3e9f5f[_0x6459('0x61')][0x0][_0x6459('0x62')]:undefined)||_0x6459('0x6c')},{'name':_0x6459('0x6d'),'value':_0x3e9f5f[_0x6459('0x6d')]||(_0x3e9f5f['attrs']&&_0x3e9f5f[_0x6459('0x61')][0x1]?_0x3e9f5f['attrs'][0x1]['value']:undefined)||[]},{'name':_0x6459('0x69'),'value':_0x3e9f5f[_0x6459('0x69')]||(_0x3e9f5f['attrs']&&_0x3e9f5f[_0x6459('0x61')][0x2]?_0x3e9f5f[_0x6459('0x61')][0x2][_0x6459('0x62')]:undefined)||0x14},{'name':_0x6459('0x6e'),'value':_0x3e9f5f[_0x6459('0x6e')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x3]?_0x3e9f5f['attrs'][0x3][_0x6459('0x62')]:undefined)||'voice'},{'name':_0x6459('0x6f'),'value':_0x3e9f5f[_0x6459('0x6f')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x4]?_0x3e9f5f[_0x6459('0x61')][0x4][_0x6459('0x62')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x3e9f5f['attrFaxAccounts']||(_0x3e9f5f['attrs']&&_0x3e9f5f[_0x6459('0x61')][0x5]?_0x3e9f5f['attrs'][0x5][_0x6459('0x62')]:undefined)||''},{'name':_0x6459('0x70'),'value':_0x3e9f5f['attrSmsAccounts']||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x6]?_0x3e9f5f[_0x6459('0x61')][0x6][_0x6459('0x62')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3e9f5f[_0x6459('0x71')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x7]?_0x3e9f5f[_0x6459('0x61')][0x7][_0x6459('0x62')]:undefined)||''},{'name':_0x6459('0x72'),'value':_0x3e9f5f[_0x6459('0x72')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x8]?_0x3e9f5f[_0x6459('0x61')][0x8][_0x6459('0x62')]:undefined)||''},{'name':_0x6459('0x73'),'value':_0x3e9f5f['attrChatWebsites']||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x9]?_0x3e9f5f['attrs'][0x9][_0x6459('0x62')]:undefined)||''}];case _0x6459('0x74'):case _0x6459('0x75'):return[{'name':'attrSerie1','value':_0x3e9f5f[_0x6459('0x76')]||(_0x3e9f5f['attrs']&&_0x3e9f5f['attrs'][0x0]?_0x3e9f5f['attrs'][0x0][_0x6459('0x62')]:undefined)||_0x6459('0x6c')},{'name':'attrSerie2','value':_0x3e9f5f['attrSerie2']||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x1]?_0x3e9f5f[_0x6459('0x61')][0x1][_0x6459('0x62')]:undefined)||null},{'name':_0x6459('0x77'),'value':_0x3e9f5f['attrSerie3']||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x2]?_0x3e9f5f[_0x6459('0x61')][0x2][_0x6459('0x62')]:undefined)||null},{'name':_0x6459('0x6d'),'value':_0x3e9f5f[_0x6459('0x6d')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x3]?_0x3e9f5f[_0x6459('0x61')][0x3]['value']:undefined)||[]},{'name':_0x6459('0x6e'),'value':_0x3e9f5f[_0x6459('0x6e')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x4]?_0x3e9f5f['attrs'][0x4][_0x6459('0x62')]:undefined)||'voice'},{'name':_0x6459('0x6f'),'value':_0x3e9f5f[_0x6459('0x6f')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x5]?_0x3e9f5f[_0x6459('0x61')][0x5]['value']:undefined)||''},{'name':_0x6459('0x78'),'value':_0x3e9f5f[_0x6459('0x78')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x6]?_0x3e9f5f[_0x6459('0x61')][0x6]['value']:undefined)||''},{'name':_0x6459('0x70'),'value':_0x3e9f5f['attrSmsAccounts']||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x7]?_0x3e9f5f[_0x6459('0x61')][0x7][_0x6459('0x62')]:undefined)||''},{'name':_0x6459('0x71'),'value':_0x3e9f5f[_0x6459('0x71')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x8]?_0x3e9f5f[_0x6459('0x61')][0x8][_0x6459('0x62')]:undefined)||''},{'name':_0x6459('0x72'),'value':_0x3e9f5f[_0x6459('0x72')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f['attrs'][0x9]?_0x3e9f5f['attrs'][0x9][_0x6459('0x62')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3e9f5f[_0x6459('0x73')]||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0xa]?_0x3e9f5f[_0x6459('0x61')][0xa]['value']:undefined)||''}];case _0x6459('0x79'):return[{'name':_0x6459('0x7a'),'type':_0x3e9f5f[_0x6459('0x7b')]||(_0x3e9f5f['attrs']&&_0x3e9f5f['attrs'][0x0]?_0x3e9f5f['attrs'][0x0]['type']:undefined)||null,'value':_0x3e9f5f['attrReport']||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x0]?_0x3e9f5f[_0x6459('0x61')][0x0][_0x6459('0x62')]:undefined)||null},{'name':_0x6459('0x7c'),'value':_0x3e9f5f['attrRefresh']||(_0x3e9f5f[_0x6459('0x61')]&&_0x3e9f5f[_0x6459('0x61')][0x1]?_0x3e9f5f[_0x6459('0x61')][0x1][_0x6459('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x5f1607){logger[_0x6459('0x2f')](_0x6459('0x7d'),JSON[_0x6459('0x7e')](_0x5f1607));return[];}}exports[_0x6459('0x7f')]=function(_0x1dc471,_0x3ddc99,_0x56b4ba){if(_0x1dc471[_0x6459('0x53')]['id']){delete _0x1dc471[_0x6459('0x53')]['id'];}return db['Dashboard'][_0x6459('0x51')]({'where':{'id':_0x1dc471[_0x6459('0x5e')]['id']}})[_0x6459('0x29')](handleEntityNotFound(_0x3ddc99,null))['then'](function(_0x36e35a){if(_0x36e35a){_0x1dc471[_0x6459('0x53')][_0x6459('0x80')]=_0x36e35a['id'];_0x1dc471[_0x6459('0x53')][_0x6459('0x61')]=widgetAttributes(_0x1dc471[_0x6459('0x53')]);return db[_0x6459('0x81')]['create'](_0x1dc471[_0x6459('0x53')]);}})[_0x6459('0x29')](respondWithResult(_0x3ddc99,null))['catch'](handleError(_0x3ddc99,null));};exports[_0x6459('0x82')]=function(_0x2cdde5,_0x4504b0,_0x4ec49b){var _0xe78f41={};var _0x32cdee={};var _0x2ae498;var _0x511c12;return db['Dashboard'][_0x6459('0x83')]({'where':{'id':_0x2cdde5[_0x6459('0x5e')]['id']}})[_0x6459('0x29')](handleEntityNotFound(_0x4504b0,null))[_0x6459('0x29')](function(_0x2b3fd5){if(_0x2b3fd5){_0x2ae498=_0x2b3fd5;_0x32cdee[_0x6459('0x39')]=_['keys'](db[_0x6459('0x81')][_0x6459('0x35')]);_0x32cdee[_0x6459('0x3a')]=_[_0x6459('0x3b')](_0x2cdde5[_0x6459('0x3a')]);_0x32cdee[_0x6459('0x3c')]=_['intersection'](_0x32cdee[_0x6459('0x39')],_0x32cdee[_0x6459('0x3a')]);_0xe78f41[_0x6459('0x3e')]=_[_0x6459('0x3d')](_0x32cdee[_0x6459('0x39')],qs[_0x6459('0x50')](_0x2cdde5[_0x6459('0x3a')][_0x6459('0x50')]));_0xe78f41[_0x6459('0x3e')]=_0xe78f41[_0x6459('0x3e')][_0x6459('0x3f')]?_0xe78f41[_0x6459('0x3e')]:_0x32cdee[_0x6459('0x39')];_0xe78f41['order']=qs[_0x6459('0x43')](_0x2cdde5[_0x6459('0x3a')][_0x6459('0x43')]);_0xe78f41['where']=qs['filters'](_[_0x6459('0x44')](_0x2cdde5[_0x6459('0x3a')],_0x32cdee[_0x6459('0x3c')]));if(_0x2cdde5['query'][_0x6459('0x45')]){_0xe78f41[_0x6459('0x46')]=_[_0x6459('0x48')](_0xe78f41['where'],{'$or':_['map'](_0xe78f41[_0x6459('0x3e')],function(_0x4425a4){var _0x35b89d={};_0x35b89d[_0x4425a4]={'$like':'%'+_0x2cdde5[_0x6459('0x3a')][_0x6459('0x45')]+'%'};return _0x35b89d;})});}_0xe78f41=_['merge']({},_0xe78f41,_0x2cdde5[_0x6459('0x49')]);return _0x2ae498[_0x6459('0x82')](_0xe78f41);}})[_0x6459('0x29')](function(_0x2a856e){if(_0x2a856e){_0x511c12=_0x2a856e['length'];if(!_0x2cdde5[_0x6459('0x3a')][_0x6459('0x40')](_0x6459('0x41'))){_0xe78f41[_0x6459('0x20')]=qs[_0x6459('0x20')](_0x2cdde5[_0x6459('0x3a')][_0x6459('0x20')]);_0xe78f41[_0x6459('0x23')]=qs[_0x6459('0x23')](_0x2cdde5[_0x6459('0x3a')][_0x6459('0x23')]);}return _0x2ae498[_0x6459('0x82')](_0xe78f41);}})[_0x6459('0x29')](function(_0x1a6cbd){if(_0x1a6cbd){return _0x1a6cbd?{'count':_0x511c12,'rows':_0x1a6cbd}:null;}})[_0x6459('0x29')](respondWithResult(_0x4504b0,null))['catch'](handleError(_0x4504b0,null));};
\ No newline at end of file
+var _0x24aa=['clone','createdAt','updatedAt','includeAll','update','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','findOne','DashboardItem','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','get','CustomDashboards','UserProfileResource','then','sendStatus','error','stack','name','send','index','type','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','Dashboard','catch','show','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x11228e,_0x26860a){var _0x32d714=function(_0x2ae361){while(--_0x2ae361){_0x11228e['push'](_0x11228e['shift']());}};_0x32d714(++_0x26860a);}(_0x24aa,0xaa));var _0xa24a=function(_0x532888,_0x440e7b){_0x532888=_0x532888-0x0;var _0x2393da=_0x24aa[_0x532888];return _0x2393da;};'use strict';var emlformat=require(_0xa24a('0x0'));var rimraf=require(_0xa24a('0x1'));var zipdir=require(_0xa24a('0x2'));var jsonpatch=require(_0xa24a('0x3'));var rp=require(_0xa24a('0x4'));var moment=require(_0xa24a('0x5'));var BPromise=require(_0xa24a('0x6'));var Mustache=require(_0xa24a('0x7'));var util=require('util');var path=require(_0xa24a('0x8'));var sox=require(_0xa24a('0x9'));var csv=require(_0xa24a('0xa'));var ejs=require(_0xa24a('0xb'));var fs=require('fs');var fs_extra=require(_0xa24a('0xc'));var _=require(_0xa24a('0xd'));var squel=require('squel');var crypto=require(_0xa24a('0xe'));var jsforce=require(_0xa24a('0xf'));var deskjs=require(_0xa24a('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa24a('0x11'));var Papa=require(_0xa24a('0x12'));var Redis=require(_0xa24a('0x13'));var authService=require(_0xa24a('0x14'));var qs=require(_0xa24a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa24a('0x16'));var utils=require(_0xa24a('0x17'));var config=require(_0xa24a('0x18'));var licenseUtil=require(_0xa24a('0x19'));var db=require('../../mysqldb')['db'];config[_0xa24a('0x1a')]=_[_0xa24a('0x1b')](config[_0xa24a('0x1a')],{'host':_0xa24a('0x1c'),'port':0x18eb});var socket=require(_0xa24a('0x1d'))(new Redis(config[_0xa24a('0x1a')]));require(_0xa24a('0x1e'))[_0xa24a('0x1f')](socket);function respondWithStatusCode(_0x3e13fa,_0xf363ea){_0xf363ea=_0xf363ea||0xcc;return function(_0x2d6ead){if(_0x2d6ead){return _0x3e13fa['sendStatus'](_0xf363ea);}return _0x3e13fa[_0xa24a('0x20')](_0xf363ea)[_0xa24a('0x21')]();};}function respondWithResult(_0x3d9f4f,_0x197441){_0x197441=_0x197441||0xc8;return function(_0x1247ae){if(_0x1247ae){return _0x3d9f4f[_0xa24a('0x20')](_0x197441)[_0xa24a('0x22')](_0x1247ae);}};}function respondWithFilteredResult(_0x1a0dfc,_0x6c58ee){return function(_0x180ee1){if(_0x180ee1){var _0x54daf2=typeof _0x6c58ee[_0xa24a('0x23')]==='undefined'&&typeof _0x6c58ee[_0xa24a('0x24')]===_0xa24a('0x25');var _0x5ea80d=_0x180ee1[_0xa24a('0x26')];var _0x1c502a=_0x54daf2?0x0:_0x6c58ee['offset'];var _0x33ebc9=_0x54daf2?_0x180ee1['count']:_0x6c58ee[_0xa24a('0x23')]+_0x6c58ee[_0xa24a('0x24')];var _0x2bbb82;if(_0x33ebc9>=_0x5ea80d){_0x33ebc9=_0x5ea80d;_0x2bbb82=0xc8;}else{_0x2bbb82=0xce;}_0x1a0dfc[_0xa24a('0x20')](_0x2bbb82);return _0x1a0dfc[_0xa24a('0x27')](_0xa24a('0x28'),_0x1c502a+'-'+_0x33ebc9+'/'+_0x5ea80d)['json'](_0x180ee1);}return null;};}function patchUpdates(_0x2c7172){return function(_0x144780){try{jsonpatch[_0xa24a('0x29')](_0x144780,_0x2c7172,!![]);}catch(_0x18780a){return BPromise['reject'](_0x18780a);}return _0x144780[_0xa24a('0x2a')]();};}function saveUpdates(_0x278585,_0x3de913){return function(_0x23bd1a){if(_0x23bd1a){return _0x23bd1a['update'](_0x278585)['then'](function(_0xb413af){return _0xb413af;});}return null;};}function removeEntity(_0x1b7df3,_0x5714bf){return function(_0x5ccb49){if(_0x5ccb49){return _0x5ccb49[_0xa24a('0x2b')]()['then'](function(){var _0x2d4660=_0x5ccb49[_0xa24a('0x2c')]({'plain':!![]});var _0x9e557=_0xa24a('0x2d');return db[_0xa24a('0x2e')]['destroy']({'where':{'type':_0x9e557,'resourceId':_0x2d4660['id']}})[_0xa24a('0x2f')](function(){return _0x5ccb49;});})[_0xa24a('0x2f')](function(){_0x1b7df3[_0xa24a('0x20')](0xcc)[_0xa24a('0x21')]();});}};}function handleEntityNotFound(_0x313b96,_0x1bd4bf){return function(_0x4610e1){if(!_0x4610e1){_0x313b96[_0xa24a('0x30')](0x194);}return _0x4610e1;};}function handleError(_0x55b647,_0x260385){_0x260385=_0x260385||0x1f4;return function(_0x5f4529){logger[_0xa24a('0x31')](_0x5f4529[_0xa24a('0x32')]);if(_0x5f4529[_0xa24a('0x33')]){delete _0x5f4529[_0xa24a('0x33')];}_0x55b647['status'](_0x260385)[_0xa24a('0x34')](_0x5f4529);};}exports[_0xa24a('0x35')]=function(_0x1b894f,_0x1b18e9){var _0x17f494={},_0x470db2={},_0x3a2c40={'count':0x0,'rows':[]};var _0xd044d9=_['map'](db['Dashboard']['rawAttributes'],function(_0x3d7c47){return{'name':_0x3d7c47['fieldName'],'type':_0x3d7c47[_0xa24a('0x36')]['key']};});_0x470db2[_0xa24a('0x37')]=_[_0xa24a('0x38')](_0xd044d9,_0xa24a('0x33'));_0x470db2['query']=_[_0xa24a('0x39')](_0x1b894f['query']);_0x470db2[_0xa24a('0x3a')]=_[_0xa24a('0x3b')](_0x470db2[_0xa24a('0x37')],_0x470db2[_0xa24a('0x3c')]);_0x17f494[_0xa24a('0x3d')]=_[_0xa24a('0x3b')](_0x470db2[_0xa24a('0x37')],qs[_0xa24a('0x3e')](_0x1b894f['query'][_0xa24a('0x3e')]));_0x17f494[_0xa24a('0x3d')]=_0x17f494['attributes'][_0xa24a('0x3f')]?_0x17f494[_0xa24a('0x3d')]:_0x470db2['model'];if(!_0x1b894f[_0xa24a('0x3c')][_0xa24a('0x40')](_0xa24a('0x41'))){_0x17f494[_0xa24a('0x24')]=qs[_0xa24a('0x24')](_0x1b894f[_0xa24a('0x3c')]['limit']);_0x17f494[_0xa24a('0x23')]=qs[_0xa24a('0x23')](_0x1b894f['query']['offset']);}_0x17f494[_0xa24a('0x42')]=qs[_0xa24a('0x43')](_0x1b894f[_0xa24a('0x3c')][_0xa24a('0x43')]);_0x17f494[_0xa24a('0x44')]=qs[_0xa24a('0x3a')](_[_0xa24a('0x45')](_0x1b894f['query'],_0x470db2[_0xa24a('0x3a')]),_0xd044d9);if(_0x1b894f[_0xa24a('0x3c')][_0xa24a('0x46')]){_0x17f494[_0xa24a('0x44')]=_[_0xa24a('0x47')](_0x17f494[_0xa24a('0x44')],{'$or':_[_0xa24a('0x38')](_0xd044d9,function(_0x36a86a){if(_0x36a86a[_0xa24a('0x36')]!==_0xa24a('0x48')){var _0x505277={};_0x505277[_0x36a86a[_0xa24a('0x33')]]={'$like':'%'+_0x1b894f['query'][_0xa24a('0x46')]+'%'};return _0x505277;}})});}_0x17f494=_['merge']({},_0x17f494,_0x1b894f[_0xa24a('0x49')]);var _0x1cbaba={'where':_0x17f494[_0xa24a('0x44')]};return db['Dashboard'][_0xa24a('0x26')](_0x1cbaba)[_0xa24a('0x2f')](function(_0x50d1be){_0x3a2c40[_0xa24a('0x26')]=_0x50d1be;if(_0x1b894f[_0xa24a('0x3c')]['includeAll']){_0x17f494[_0xa24a('0x4a')]=[{'all':!![]}];}return db[_0xa24a('0x4b')]['findAll'](_0x17f494);})[_0xa24a('0x2f')](function(_0x4c623b){_0x3a2c40['rows']=_0x4c623b;return _0x3a2c40;})[_0xa24a('0x2f')](respondWithFilteredResult(_0x1b18e9,_0x17f494))[_0xa24a('0x4c')](handleError(_0x1b18e9,null));};exports[_0xa24a('0x4d')]=function(_0x2f72eb,_0x5d1b2f){var _0xbb908c={'raw':![],'where':{'id':_0x2f72eb[_0xa24a('0x4e')]['id']}},_0x337724={};_0x337724['model']=_[_0xa24a('0x39')](db[_0xa24a('0x4b')][_0xa24a('0x4f')]);_0x337724[_0xa24a('0x3c')]=_[_0xa24a('0x39')](_0x2f72eb[_0xa24a('0x3c')]);_0x337724[_0xa24a('0x3a')]=_[_0xa24a('0x3b')](_0x337724[_0xa24a('0x37')],_0x337724[_0xa24a('0x3c')]);_0xbb908c['attributes']=_['intersection'](_0x337724[_0xa24a('0x37')],qs[_0xa24a('0x3e')](_0x2f72eb[_0xa24a('0x3c')][_0xa24a('0x3e')]));_0xbb908c[_0xa24a('0x3d')]=_0xbb908c[_0xa24a('0x3d')]['length']?_0xbb908c[_0xa24a('0x3d')]:_0x337724[_0xa24a('0x37')];if(_0x2f72eb[_0xa24a('0x3c')]['includeAll']){_0xbb908c[_0xa24a('0x4a')]=[{'all':!![]}];}_0xbb908c=_[_0xa24a('0x47')]({},_0xbb908c,_0x2f72eb['options']);return db['Dashboard']['find'](_0xbb908c)[_0xa24a('0x2f')](handleEntityNotFound(_0x5d1b2f,null))[_0xa24a('0x2f')](respondWithResult(_0x5d1b2f,null))[_0xa24a('0x4c')](handleError(_0x5d1b2f,null));};exports['create']=function(_0x305efc,_0x1abeab){return db[_0xa24a('0x4b')][_0xa24a('0x50')](_0x305efc[_0xa24a('0x51')],{})[_0xa24a('0x2f')](function(_0x32fa6e){var _0x575369=_0x305efc['user'][_0xa24a('0x2c')]({'plain':!![]});if(!_0x575369)throw new Error(_0xa24a('0x52'));if(_0x575369[_0xa24a('0x53')]===_0xa24a('0x54')){var _0x44c24e=_0x32fa6e['get']({'plain':!![]});var _0x135e96=_0xa24a('0x2d');return db[_0xa24a('0x55')][_0xa24a('0x56')]({'where':{'name':_0x135e96,'userProfileId':_0x575369[_0xa24a('0x57')]},'raw':!![]})[_0xa24a('0x2f')](function(_0x91ad83){if(_0x91ad83&&_0x91ad83[_0xa24a('0x58')]===0x0){return db[_0xa24a('0x2e')][_0xa24a('0x50')]({'name':_0x44c24e['name'],'resourceId':_0x44c24e['id'],'type':_0x91ad83[_0xa24a('0x33')],'sectionId':_0x91ad83['id']},{})['then'](function(){return _0x32fa6e;});}else{return _0x32fa6e;}})[_0xa24a('0x4c')](function(_0x2303c1){logger[_0xa24a('0x31')](_0xa24a('0x59'),_0x2303c1);throw _0x2303c1;});}return _0x32fa6e;})['then'](respondWithResult(_0x1abeab,0xc9))[_0xa24a('0x4c')](handleError(_0x1abeab,null));};exports[_0xa24a('0x5a')]=function(_0x594744,_0xfa277a){var _0x6fa115={'where':{'id':_0x594744[_0xa24a('0x4e')]['id']}},_0x3ec76b={};_0x3ec76b[_0xa24a('0x37')]=_['keys'](db[_0xa24a('0x4b')]['rawAttributes']);_0x6fa115[_0xa24a('0x3d')]=_['intersection'](_0x3ec76b[_0xa24a('0x37')],qs[_0xa24a('0x3e')](_0x594744[_0xa24a('0x3c')][_0xa24a('0x3e')]));_0x6fa115[_0xa24a('0x3d')]=_0x6fa115[_0xa24a('0x3d')][_0xa24a('0x3f')]?_0x6fa115[_0xa24a('0x3d')]:_0x3ec76b['model'];if(_0x594744[_0xa24a('0x3c')]['includeAll']){_0x6fa115[_0xa24a('0x4a')]=[{'all':!![]}];}_0x6fa115=_[_0xa24a('0x47')]({},_0x6fa115,_0x594744[_0xa24a('0x49')]);return db['Dashboard'][_0xa24a('0x56')](_0x6fa115)[_0xa24a('0x2f')](handleEntityNotFound(_0xfa277a,null))[_0xa24a('0x2f')](function(_0x449e84){if(_0x449e84){var _0x4b315a=_0x449e84[_0xa24a('0x2c')]({'plain':!![]});_0x4b315a=qs['omit'](_0x4b315a,['id',_0xa24a('0x5b'),_0xa24a('0x5c')]);_0x594744[_0xa24a('0x51')]=_['omit'](_0x594744[_0xa24a('0x51')],['id',_0xa24a('0x5b'),'updatedAt']);return db[_0xa24a('0x4b')]['create'](_[_0xa24a('0x47')](_0x4b315a,_0x594744[_0xa24a('0x51')]),{'include':_0x594744['query'][_0xa24a('0x5d')]?[{'all':!![]}]:undefined})[_0xa24a('0x2f')](function(_0x262f47){var _0xc018e8=_0x594744[_0xa24a('0x54')][_0xa24a('0x2c')]({'plain':!![]});if(!_0xc018e8)throw new Error(_0xa24a('0x52'));if(_0xc018e8[_0xa24a('0x53')]===_0xa24a('0x54')){var _0x2f0773=_0x262f47['get']({'plain':!![]});var _0x544577=_0xa24a('0x2d');return db['UserProfileSection'][_0xa24a('0x56')]({'where':{'name':_0x544577,'userProfileId':_0xc018e8['userProfileId']},'raw':!![]})[_0xa24a('0x2f')](function(_0x2158d7){if(_0x2158d7&&_0x2158d7[_0xa24a('0x58')]===0x0){return db[_0xa24a('0x2e')][_0xa24a('0x50')]({'name':_0x2f0773['name'],'resourceId':_0x2f0773['id'],'type':_0x2158d7['name'],'sectionId':_0x2158d7['id']},{})['then'](function(){return _0x262f47;});}else{return _0x262f47;}})[_0xa24a('0x4c')](function(_0x5e254f){logger[_0xa24a('0x31')](_0xa24a('0x59'),_0x5e254f);throw _0x5e254f;});}return _0x262f47;});}})[_0xa24a('0x2f')](respondWithResult(_0xfa277a,0xc9))[_0xa24a('0x4c')](handleError(_0xfa277a,null));};exports[_0xa24a('0x5e')]=function(_0x5d9880,_0x1a1a8d){if(_0x5d9880[_0xa24a('0x51')]['id']){delete _0x5d9880[_0xa24a('0x51')]['id'];}return db['Dashboard'][_0xa24a('0x56')]({'where':{'id':_0x5d9880['params']['id']}})[_0xa24a('0x2f')](handleEntityNotFound(_0x1a1a8d,null))[_0xa24a('0x2f')](saveUpdates(_0x5d9880[_0xa24a('0x51')],null))['then'](respondWithResult(_0x1a1a8d,null))[_0xa24a('0x4c')](handleError(_0x1a1a8d,null));};exports[_0xa24a('0x2b')]=function(_0x1fd55d,_0x52c47e){return db[_0xa24a('0x4b')]['find']({'where':{'id':_0x1fd55d[_0xa24a('0x4e')]['id']}})[_0xa24a('0x2f')](handleEntityNotFound(_0x52c47e,null))['then'](removeEntity(_0x52c47e,null))[_0xa24a('0x4c')](handleError(_0x52c47e,null));};function widgetAttributes(_0x10868b){try{switch(_0x10868b[_0xa24a('0x36')]){case _0xa24a('0x5f'):return[{'name':_0xa24a('0x60'),'value':_0x10868b[_0xa24a('0x60')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b['attrs'][0x0]?_0x10868b[_0xa24a('0x61')][0x0]['value']:undefined)||_0xa24a('0x62')}];case _0xa24a('0x63'):return[{'name':_0xa24a('0x64'),'value':_0x10868b['attrPath']||(_0x10868b['attrs']&&_0x10868b['attrs'][0x0]?_0x10868b[_0xa24a('0x61')][0x0][_0xa24a('0x65')]:undefined)||''}];case'clock':return[{'name':_0xa24a('0x66'),'value':_0x10868b[_0xa24a('0x66')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x0]?_0x10868b[_0xa24a('0x61')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xa24a('0x67'),'value':_0x10868b[_0xa24a('0x67')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x1]?_0x10868b[_0xa24a('0x61')][0x1][_0xa24a('0x65')]:undefined)||_0xa24a('0x68')},{'name':_0xa24a('0x69'),'value':_0x10868b[_0xa24a('0x69')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x2]?_0x10868b[_0xa24a('0x61')][0x2]['value']:undefined)||0xc}];case _0xa24a('0x6a'):return[{'name':_0xa24a('0x6b'),'value':_0x10868b[_0xa24a('0x6b')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b['attrs'][0x0]?_0x10868b[_0xa24a('0x61')][0x0][_0xa24a('0x65')]:undefined)||_0xa24a('0x6c')},{'name':'attrVoiceQueues','value':_0x10868b[_0xa24a('0x6d')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x1]?_0x10868b['attrs'][0x1][_0xa24a('0x65')]:undefined)||[]},{'name':_0xa24a('0x69'),'value':_0x10868b[_0xa24a('0x69')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x2]?_0x10868b['attrs'][0x2][_0xa24a('0x65')]:undefined)||0x14},{'name':'attrChannel','value':_0x10868b[_0xa24a('0x6e')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x3]?_0x10868b[_0xa24a('0x61')][0x3][_0xa24a('0x65')]:undefined)||_0xa24a('0x6f')},{'name':'attrEmailAccounts','value':_0x10868b[_0xa24a('0x70')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x4]?_0x10868b[_0xa24a('0x61')][0x4]['value']:undefined)||''},{'name':_0xa24a('0x71'),'value':_0x10868b['attrFaxAccounts']||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x5]?_0x10868b[_0xa24a('0x61')][0x5][_0xa24a('0x65')]:undefined)||''},{'name':_0xa24a('0x72'),'value':_0x10868b['attrSmsAccounts']||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x6]?_0x10868b[_0xa24a('0x61')][0x6][_0xa24a('0x65')]:undefined)||''},{'name':_0xa24a('0x73'),'value':_0x10868b[_0xa24a('0x73')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b['attrs'][0x7]?_0x10868b['attrs'][0x7]['value']:undefined)||''},{'name':_0xa24a('0x74'),'value':_0x10868b['attrWhatsappAccounts']||(_0x10868b['attrs']&&_0x10868b['attrs'][0x8]?_0x10868b['attrs'][0x8]['value']:undefined)||''},{'name':_0xa24a('0x75'),'value':_0x10868b[_0xa24a('0x75')]||(_0x10868b['attrs']&&_0x10868b[_0xa24a('0x61')][0x9]?_0x10868b[_0xa24a('0x61')][0x9][_0xa24a('0x65')]:undefined)||''}];case'multibar-chart':case _0xa24a('0x76'):return[{'name':_0xa24a('0x77'),'value':_0x10868b[_0xa24a('0x77')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b['attrs'][0x0]?_0x10868b['attrs'][0x0][_0xa24a('0x65')]:undefined)||_0xa24a('0x6c')},{'name':_0xa24a('0x78'),'value':_0x10868b[_0xa24a('0x78')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x1]?_0x10868b['attrs'][0x1][_0xa24a('0x65')]:undefined)||null},{'name':_0xa24a('0x79'),'value':_0x10868b[_0xa24a('0x79')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x2]?_0x10868b[_0xa24a('0x61')][0x2]['value']:undefined)||null},{'name':_0xa24a('0x6d'),'value':_0x10868b[_0xa24a('0x6d')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x3]?_0x10868b['attrs'][0x3][_0xa24a('0x65')]:undefined)||[]},{'name':_0xa24a('0x6e'),'value':_0x10868b[_0xa24a('0x6e')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x4]?_0x10868b[_0xa24a('0x61')][0x4][_0xa24a('0x65')]:undefined)||_0xa24a('0x6f')},{'name':_0xa24a('0x70'),'value':_0x10868b['attrEmailAccounts']||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x5]?_0x10868b[_0xa24a('0x61')][0x5]['value']:undefined)||''},{'name':_0xa24a('0x71'),'value':_0x10868b[_0xa24a('0x71')]||(_0x10868b['attrs']&&_0x10868b[_0xa24a('0x61')][0x6]?_0x10868b[_0xa24a('0x61')][0x6][_0xa24a('0x65')]:undefined)||''},{'name':_0xa24a('0x72'),'value':_0x10868b[_0xa24a('0x72')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x7]?_0x10868b[_0xa24a('0x61')][0x7][_0xa24a('0x65')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x10868b[_0xa24a('0x73')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b['attrs'][0x8]?_0x10868b['attrs'][0x8][_0xa24a('0x65')]:undefined)||''},{'name':_0xa24a('0x74'),'value':_0x10868b[_0xa24a('0x74')]||(_0x10868b[_0xa24a('0x61')]&&_0x10868b[_0xa24a('0x61')][0x9]?_0x10868b[_0xa24a('0x61')][0x9][_0xa24a('0x65')]:undefined)||''},{'name':'attrChatWebsites','value':_0x10868b[_0xa24a('0x75')]||(_0x10868b['attrs']&&_0x10868b[_0xa24a('0x61')][0xa]?_0x10868b['attrs'][0xa][_0xa24a('0x65')]:undefined)||''}];case'web-report':return[{'name':_0xa24a('0x7a'),'type':_0x10868b[_0xa24a('0x7b')]||(_0x10868b['attrs']&&_0x10868b[_0xa24a('0x61')][0x0]?_0x10868b[_0xa24a('0x61')][0x0][_0xa24a('0x36')]:undefined)||null,'value':_0x10868b['attrReport']||(_0x10868b['attrs']&&_0x10868b[_0xa24a('0x61')][0x0]?_0x10868b[_0xa24a('0x61')][0x0][_0xa24a('0x65')]:undefined)||null},{'name':'attrRefresh','value':_0x10868b['attrRefresh']||(_0x10868b[_0xa24a('0x61')]&&_0x10868b['attrs'][0x1]?_0x10868b[_0xa24a('0x61')][0x1][_0xa24a('0x65')]:undefined)||0x0}];default:return[];}}catch(_0x10eeeb){logger[_0xa24a('0x31')](_0xa24a('0x7c'),JSON[_0xa24a('0x7d')](_0x10eeeb));return[];}}exports[_0xa24a('0x7e')]=function(_0xa38962,_0xdc3aa4,_0x3bf8e0){if(_0xa38962['body']['id']){delete _0xa38962['body']['id'];}return db[_0xa24a('0x4b')][_0xa24a('0x56')]({'where':{'id':_0xa38962[_0xa24a('0x4e')]['id']}})[_0xa24a('0x2f')](handleEntityNotFound(_0xdc3aa4,null))[_0xa24a('0x2f')](function(_0x5c71e5){if(_0x5c71e5){_0xa38962['body']['DashboardId']=_0x5c71e5['id'];_0xa38962[_0xa24a('0x51')][_0xa24a('0x61')]=widgetAttributes(_0xa38962[_0xa24a('0x51')]);return db['DashboardItem']['create'](_0xa38962[_0xa24a('0x51')]);}})[_0xa24a('0x2f')](respondWithResult(_0xdc3aa4,null))['catch'](handleError(_0xdc3aa4,null));};exports['getItems']=function(_0x36ce9f,_0x52ba5b,_0x44dee6){var _0x33c82c={};var _0x23af5a={};var _0x2071e1;var _0x340df8;return db['Dashboard'][_0xa24a('0x7f')]({'where':{'id':_0x36ce9f['params']['id']}})['then'](handleEntityNotFound(_0x52ba5b,null))[_0xa24a('0x2f')](function(_0x2bacc6){if(_0x2bacc6){_0x2071e1=_0x2bacc6;_0x23af5a[_0xa24a('0x37')]=_[_0xa24a('0x39')](db[_0xa24a('0x80')][_0xa24a('0x4f')]);_0x23af5a['query']=_[_0xa24a('0x39')](_0x36ce9f['query']);_0x23af5a[_0xa24a('0x3a')]=_[_0xa24a('0x3b')](_0x23af5a[_0xa24a('0x37')],_0x23af5a[_0xa24a('0x3c')]);_0x33c82c[_0xa24a('0x3d')]=_['intersection'](_0x23af5a[_0xa24a('0x37')],qs[_0xa24a('0x3e')](_0x36ce9f[_0xa24a('0x3c')][_0xa24a('0x3e')]));_0x33c82c['attributes']=_0x33c82c['attributes'][_0xa24a('0x3f')]?_0x33c82c[_0xa24a('0x3d')]:_0x23af5a[_0xa24a('0x37')];_0x33c82c['order']=qs[_0xa24a('0x43')](_0x36ce9f[_0xa24a('0x3c')][_0xa24a('0x43')]);_0x33c82c[_0xa24a('0x44')]=qs[_0xa24a('0x3a')](_[_0xa24a('0x45')](_0x36ce9f[_0xa24a('0x3c')],_0x23af5a[_0xa24a('0x3a')]));if(_0x36ce9f[_0xa24a('0x3c')][_0xa24a('0x46')]){_0x33c82c[_0xa24a('0x44')]=_[_0xa24a('0x47')](_0x33c82c[_0xa24a('0x44')],{'$or':_[_0xa24a('0x38')](_0x33c82c[_0xa24a('0x3d')],function(_0x24efdd){var _0x12a7b2={};_0x12a7b2[_0x24efdd]={'$like':'%'+_0x36ce9f['query']['filter']+'%'};return _0x12a7b2;})});}_0x33c82c=_[_0xa24a('0x47')]({},_0x33c82c,_0x36ce9f['options']);return _0x2071e1[_0xa24a('0x81')](_0x33c82c);}})[_0xa24a('0x2f')](function(_0xa17cfe){if(_0xa17cfe){_0x340df8=_0xa17cfe[_0xa24a('0x3f')];if(!_0x36ce9f[_0xa24a('0x3c')][_0xa24a('0x40')](_0xa24a('0x41'))){_0x33c82c[_0xa24a('0x24')]=qs[_0xa24a('0x24')](_0x36ce9f['query'][_0xa24a('0x24')]);_0x33c82c[_0xa24a('0x23')]=qs[_0xa24a('0x23')](_0x36ce9f[_0xa24a('0x3c')][_0xa24a('0x23')]);}return _0x2071e1[_0xa24a('0x81')](_0x33c82c);}})[_0xa24a('0x2f')](function(_0x51912c){if(_0x51912c){return _0x51912c?{'count':_0x340df8,'rows':_0x51912c}:null;}})[_0xa24a('0x2f')](respondWithResult(_0x52ba5b,null))[_0xa24a('0x4c')](handleError(_0x52ba5b,null));};
\ No newline at end of file
index cd43b0c..634b1c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4815=['exports','events','Dashboard','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x193f3f,_0x1218b3){var _0x4b9f09=function(_0x3081aa){while(--_0x3081aa){_0x193f3f['push'](_0x193f3f['shift']());}};_0x4b9f09(++_0x1218b3);}(_0x4815,0x1f1));var _0x5481=function(_0x4e8451,_0x2f352e){_0x4e8451=_0x4e8451-0x0;var _0x45d1f0=_0x4815[_0x4e8451];return _0x45d1f0;};'use strict';var EventEmitter=require(_0x5481('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x5481('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5481('0x2')](0x0);var events={'afterCreate':_0x5481('0x3'),'afterUpdate':'update','afterDestroy':_0x5481('0x4')};function emitEvent(_0x90f394){return function(_0x5916f1,_0x101ca1,_0x3ab021){DashboardEvents[_0x5481('0x5')](_0x90f394+':'+_0x5916f1['id'],_0x5916f1);DashboardEvents['emit'](_0x90f394,_0x5916f1);_0x3ab021(null);};}for(var e in events){if(events[_0x5481('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x5481('0x7')]=DashboardEvents;
\ No newline at end of file
+var _0x4b07=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','remove'];(function(_0x145e4f,_0x1e072e){var _0x2356d0=function(_0xdfa0d9){while(--_0xdfa0d9){_0x145e4f['push'](_0x145e4f['shift']());}};_0x2356d0(++_0x1e072e);}(_0x4b07,0x15c));var _0x74b0=function(_0x3294dd,_0x5217cb){_0x3294dd=_0x3294dd-0x0;var _0x4377f5=_0x4b07[_0x3294dd];return _0x4377f5;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x74b0('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x74b0('0x1')](0x0);var events={'afterCreate':_0x74b0('0x2'),'afterUpdate':'update','afterDestroy':_0x74b0('0x3')};function emitEvent(_0x5cebc7){return function(_0x255b31,_0x22813d,_0x2a2653){DashboardEvents[_0x74b0('0x4')](_0x5cebc7+':'+_0x255b31['id'],_0x255b31);DashboardEvents['emit'](_0x5cebc7,_0x255b31);_0x2a2653(null);};}for(var e in events){if(events[_0x74b0('0x5')](e)){var event=events[e];Dashboard[_0x74b0('0x6')](e,emitEvent(event));}}module[_0x74b0('0x7')]=DashboardEvents;
\ No newline at end of file
index 4c4c19b..767661e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabe7=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Dashboard','dashboards'];(function(_0x5068a5,_0x1a89d2){var _0x535026=function(_0x3a7304){while(--_0x3a7304){_0x5068a5['push'](_0x5068a5['shift']());}};_0x535026(++_0x1a89d2);}(_0xabe7,0x1b0));var _0x7abe=function(_0x4b054,_0x1ae131){_0x4b054=_0x4b054-0x0;var _0x4a211a=_0xabe7[_0x4b054];return _0x4a211a;};'use strict';var _=require(_0x7abe('0x0'));var util=require(_0x7abe('0x1'));var logger=require(_0x7abe('0x2'))('api');var moment=require(_0x7abe('0x3'));var BPromise=require(_0x7abe('0x4'));var rp=require(_0x7abe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7abe('0x6'));var config=require(_0x7abe('0x7'));var attributes=require('./dashboard.attributes');module[_0x7abe('0x8')]=function(_0x2ed698,_0x56d6ae){return _0x2ed698[_0x7abe('0x9')](_0x7abe('0xa'),attributes,{'tableName':_0x7abe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x97f5=['rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x531469,_0x51dc7b){var _0x35d17c=function(_0x45a085){while(--_0x45a085){_0x531469['push'](_0x531469['shift']());}};_0x35d17c(++_0x51dc7b);}(_0x97f5,0x72));var _0x597f=function(_0x38ad56,_0x552996){_0x38ad56=_0x38ad56-0x0;var _0x10c087=_0x97f5[_0x38ad56];return _0x10c087;};'use strict';var _=require(_0x597f('0x0'));var util=require(_0x597f('0x1'));var logger=require(_0x597f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x597f('0x3'));var rp=require(_0x597f('0x4'));var fs=require('fs');var path=require(_0x597f('0x5'));var rimraf=require(_0x597f('0x6'));var config=require(_0x597f('0x7'));var attributes=require(_0x597f('0x8'));module[_0x597f('0x9')]=function(_0x1abf16,_0x89d13a){return _0x1abf16['define'](_0x597f('0xa'),attributes,{'tableName':_0x597f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2c103b5..ef34e5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa079=['request\x20sent','debug','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','Dashboard,\x20%s,\x20%s'];(function(_0x2f9c3a,_0x376e7a){var _0x2d3416=function(_0x13cbac){while(--_0x13cbac){_0x2f9c3a['push'](_0x2f9c3a['shift']());}};_0x2d3416(++_0x376e7a);}(_0xa079,0x1d4));var _0x9a07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa079[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a07('0x0'));var util=require('util');var moment=require(_0x9a07('0x1'));var BPromise=require(_0x9a07('0x2'));var rs=require(_0x9a07('0x3'));var fs=require('fs');var Redis=require(_0x9a07('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a07('0x5'));var logger=require(_0x9a07('0x6'))(_0x9a07('0x7'));var config=require('../../config/environment');var jayson=require(_0x9a07('0x8'));var client=jayson[_0x9a07('0x9')][_0x9a07('0xa')]({'port':0x232a});config[_0x9a07('0xb')]=_['defaults'](config[_0x9a07('0xb')],{'host':_0x9a07('0xc'),'port':0x18eb});var socket=require(_0x9a07('0xd'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x57d74d,_0x4c8f60,_0x2efb96){return new BPromise(function(_0x4dbc7e,_0x53c7de){return client[_0x9a07('0xe')](_0x57d74d,_0x2efb96)['then'](function(_0x4491e3){logger['info'](_0x9a07('0xf'),_0x4c8f60,_0x9a07('0x10'));logger[_0x9a07('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x4c8f60,_0x9a07('0x10'),JSON[_0x9a07('0x12')](_0x4491e3));if(_0x4491e3[_0x9a07('0x13')]){if(_0x4491e3[_0x9a07('0x13')]['code']===0x1f4){logger['error'](_0x9a07('0xf'),_0x4c8f60,_0x4491e3['error'][_0x9a07('0x14')]);return _0x53c7de(_0x4491e3[_0x9a07('0x13')][_0x9a07('0x14')]);}logger[_0x9a07('0x13')](_0x9a07('0xf'),_0x4c8f60,_0x4491e3[_0x9a07('0x13')]['message']);return _0x4dbc7e(_0x4491e3[_0x9a07('0x13')]['message']);}else{logger['info'](_0x9a07('0xf'),_0x4c8f60,_0x9a07('0x10'));_0x4dbc7e(_0x4491e3['result'][_0x9a07('0x14')]);}})[_0x9a07('0x15')](function(_0x43e8a0){logger['error'](_0x9a07('0xf'),_0x4c8f60,_0x43e8a0);_0x53c7de(_0x43e8a0);});});}
\ No newline at end of file
+var _0x7250=['info','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4066c3,_0x32d3a0){var _0x5798fa=function(_0x379ddc){while(--_0x379ddc){_0x4066c3['push'](_0x4066c3['shift']());}};_0x5798fa(++_0x32d3a0);}(_0x7250,0x147));var _0x0725=function(_0x11971f,_0x4e2362){_0x11971f=_0x11971f-0x0;var _0x57dbc1=_0x7250[_0x11971f];return _0x57dbc1;};'use strict';var _=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0725('0x2'));var fs=require('fs');var Redis=require(_0x0725('0x3'));var db=require(_0x0725('0x4'))['db'];var utils=require(_0x0725('0x5'));var logger=require(_0x0725('0x6'))(_0x0725('0x7'));var config=require(_0x0725('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0725('0x9')]({'port':0x232a});config[_0x0725('0xa')]=_[_0x0725('0xb')](config[_0x0725('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0725('0xc'))(new Redis(config[_0x0725('0xa')]));require('./dashboard.socket')[_0x0725('0xd')](socket);function respondWithRpcPromise(_0x4fbc43,_0x31acb8,_0x53a1d2){return new BPromise(function(_0x32389f,_0x2f248c){return client[_0x0725('0xe')](_0x4fbc43,_0x53a1d2)[_0x0725('0xf')](function(_0x45f74d){logger['info'](_0x0725('0x10'),_0x31acb8,_0x0725('0x11'));logger[_0x0725('0x12')](_0x0725('0x13'),_0x31acb8,_0x0725('0x11'),JSON[_0x0725('0x14')](_0x45f74d));if(_0x45f74d['error']){if(_0x45f74d[_0x0725('0x15')]['code']===0x1f4){logger[_0x0725('0x15')](_0x0725('0x10'),_0x31acb8,_0x45f74d['error'][_0x0725('0x16')]);return _0x2f248c(_0x45f74d['error']['message']);}logger[_0x0725('0x15')]('Dashboard,\x20%s,\x20%s',_0x31acb8,_0x45f74d[_0x0725('0x15')][_0x0725('0x16')]);return _0x32389f(_0x45f74d[_0x0725('0x15')]['message']);}else{logger[_0x0725('0x17')](_0x0725('0x10'),_0x31acb8,'request\x20sent');_0x32389f(_0x45f74d['result'][_0x0725('0x16')]);}})[_0x0725('0x18')](function(_0x2dd30e){logger['error'](_0x0725('0x10'),_0x31acb8,_0x2dd30e);_0x2f248c(_0x2dd30e);});});}
\ No newline at end of file
index 96a54a8..9ba3e71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bac=['remove','update','emit','removeListener','register','length','./dashboard.events','save'];(function(_0x24eeec,_0x484dc1){var _0x304645=function(_0x32ed88){while(--_0x32ed88){_0x24eeec['push'](_0x24eeec['shift']());}};_0x304645(++_0x484dc1);}(_0x5bac,0xbe));var _0xc5ba=function(_0x5300a8,_0x89fed7){_0x5300a8=_0x5300a8-0x0;var _0x2081e1=_0x5bac[_0x5300a8];return _0x2081e1;};'use strict';var DashboardEvents=require(_0xc5ba('0x0'));var events=[_0xc5ba('0x1'),_0xc5ba('0x2'),_0xc5ba('0x3')];function createListener(_0x540699,_0x50a764){return function(_0x462ddb){_0x50a764[_0xc5ba('0x4')](_0x540699,_0x462ddb);};}function removeListener(_0x123c24,_0x1d1635){return function(){DashboardEvents[_0xc5ba('0x5')](_0x123c24,_0x1d1635);};}exports[_0xc5ba('0x6')]=function(_0x1c7c69){for(var _0x140e83=0x0,_0x3f72f1=events[_0xc5ba('0x7')];_0x140e83<_0x3f72f1;_0x140e83++){var _0x516cbd=events[_0x140e83];var _0x5119e0=createListener('dashboard:'+_0x516cbd,_0x1c7c69);DashboardEvents['on'](_0x516cbd,_0x5119e0);}};
\ No newline at end of file
+var _0xe50d=['update','register','dashboard:','./dashboard.events','remove'];(function(_0x3cf9d7,_0x540aa1){var _0x3a09e9=function(_0x330710){while(--_0x330710){_0x3cf9d7['push'](_0x3cf9d7['shift']());}};_0x3a09e9(++_0x540aa1);}(_0xe50d,0x161));var _0xde50=function(_0x473731,_0x568bd4){_0x473731=_0x473731-0x0;var _0x4b0e8f=_0xe50d[_0x473731];return _0x4b0e8f;};'use strict';var DashboardEvents=require(_0xde50('0x0'));var events=['save',_0xde50('0x1'),_0xde50('0x2')];function createListener(_0x447a87,_0xb3ee49){return function(_0x47ad6a){_0xb3ee49['emit'](_0x447a87,_0x47ad6a);};}function removeListener(_0x31ed18,_0x463ef5){return function(){DashboardEvents['removeListener'](_0x31ed18,_0x463ef5);};}exports[_0xde50('0x3')]=function(_0x225ec5){for(var _0x3c99a3=0x0,_0x2cb62b=events['length'];_0x3c99a3<_0x2cb62b;_0x3c99a3++){var _0x33b767=events[_0x3c99a3];var _0x50a482=createListener(_0xde50('0x4')+_0x33b767,_0x225ec5);DashboardEvents['on'](_0x33b767,_0x50a482);}};
\ No newline at end of file
index 5baabd5..ebd27f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed57=['fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems','post','create','/:id/clone','clone','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x430fef,_0x575f8c){var _0x143b62=function(_0x773fd0){while(--_0x773fd0){_0x430fef['push'](_0x430fef['shift']());}};_0x143b62(++_0x575f8c);}(_0xed57,0x133));var _0x7ed5=function(_0x433df2,_0x3873de){_0x433df2=_0x433df2-0x0;var _0x30b4cb=_0xed57[_0x433df2];return _0x30b4cb;};'use strict';var multer=require(_0x7ed5('0x0'));var util=require(_0x7ed5('0x1'));var path=require('path');var timeout=require(_0x7ed5('0x2'));var express=require(_0x7ed5('0x3'));var router=express[_0x7ed5('0x4')]();var fs_extra=require(_0x7ed5('0x5'));var auth=require(_0x7ed5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ed5('0x7'));var controller=require(_0x7ed5('0x8'));router[_0x7ed5('0x9')]('/',auth[_0x7ed5('0xa')](),controller[_0x7ed5('0xb')]);router[_0x7ed5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7ed5('0xc')]);router[_0x7ed5('0x9')](_0x7ed5('0xd'),auth[_0x7ed5('0xa')](),controller[_0x7ed5('0xe')]);router[_0x7ed5('0xf')]('/',auth[_0x7ed5('0xa')](),controller[_0x7ed5('0x10')]);router[_0x7ed5('0xf')](_0x7ed5('0x11'),auth[_0x7ed5('0xa')](),controller[_0x7ed5('0x12')]);router[_0x7ed5('0xf')](_0x7ed5('0xd'),auth['isAuthenticated'](),controller['addItem']);router[_0x7ed5('0x13')](_0x7ed5('0x14'),auth[_0x7ed5('0xa')](),controller[_0x7ed5('0x15')]);router[_0x7ed5('0x16')](_0x7ed5('0x14'),auth[_0x7ed5('0xa')](),controller['destroy']);module[_0x7ed5('0x17')]=router;
\ No newline at end of file
+var _0xd5c6=['addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','clone'];(function(_0x4753b2,_0x335945){var _0x114db3=function(_0x13640b){while(--_0x13640b){_0x4753b2['push'](_0x4753b2['shift']());}};_0x114db3(++_0x335945);}(_0xd5c6,0x158));var _0x6d5c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd5c6[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x6d5c('0x0'));var util=require(_0x6d5c('0x1'));var path=require(_0x6d5c('0x2'));var timeout=require(_0x6d5c('0x3'));var express=require(_0x6d5c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6d5c('0x5'));var interaction=require(_0x6d5c('0x6'));var config=require(_0x6d5c('0x7'));var controller=require(_0x6d5c('0x8'));router[_0x6d5c('0x9')]('/',auth[_0x6d5c('0xa')](),controller[_0x6d5c('0xb')]);router[_0x6d5c('0x9')](_0x6d5c('0xc'),auth[_0x6d5c('0xa')](),controller[_0x6d5c('0xd')]);router[_0x6d5c('0x9')](_0x6d5c('0xe'),auth[_0x6d5c('0xa')](),controller[_0x6d5c('0xf')]);router['post']('/',auth[_0x6d5c('0xa')](),controller[_0x6d5c('0x10')]);router[_0x6d5c('0x11')](_0x6d5c('0x12'),auth[_0x6d5c('0xa')](),controller[_0x6d5c('0x13')]);router[_0x6d5c('0x11')](_0x6d5c('0xe'),auth['isAuthenticated'](),controller[_0x6d5c('0x14')]);router[_0x6d5c('0x15')](_0x6d5c('0xc'),auth[_0x6d5c('0xa')](),controller[_0x6d5c('0x16')]);router[_0x6d5c('0x17')](_0x6d5c('0xc'),auth[_0x6d5c('0xa')](),controller[_0x6d5c('0x18')]);module[_0x6d5c('0x19')]=router;
\ No newline at end of file
index 96e2f08..abf438a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bd8=['TEXT','long','parse','attrs','stringify','setDataValue','INTEGER','sequelize','lodash','exports','STRING'];(function(_0x2fe91b,_0x4789e3){var _0x3f8f58=function(_0x453dd3){while(--_0x453dd3){_0x2fe91b['push'](_0x2fe91b['shift']());}};_0x3f8f58(++_0x4789e3);}(_0x2bd8,0x130));var _0x82bd=function(_0x43536e,_0x25a728){_0x43536e=_0x43536e-0x0;var _0x58d6c7=_0x2bd8[_0x43536e];return _0x58d6c7;};'use strict';var Sequelize=require(_0x82bd('0x0'));var squel=require('squel');var _=require(_0x82bd('0x1'));module[_0x82bd('0x2')]={'title':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x82bd('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x82bd('0x4')](_0x82bd('0x5')),'get':function(){try{return JSON[_0x82bd('0x6')](this['getDataValue'](_0x82bd('0x7')));}catch(_0x2e1a98){return[];}},'set':function(_0x3bf810){try{this['setDataValue'](_0x82bd('0x7'),JSON[_0x82bd('0x8')](_0x3bf810));}catch(_0x226f60){this[_0x82bd('0x9')]('attrs',JSON[_0x82bd('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x82bd('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x82bd('0xa')],'defaultValue':0xc}};
\ No newline at end of file
+var _0x326f=['#2196f3','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff'];(function(_0x3100e4,_0x537b8f){var _0x1b1c8a=function(_0x45041c){while(--_0x45041c){_0x3100e4['push'](_0x3100e4['shift']());}};_0x1b1c8a(++_0x537b8f);}(_0x326f,0xd1));var _0xf326=function(_0x26e9b9,_0x27b3f2){_0x26e9b9=_0x26e9b9-0x0;var _0x11f246=_0x326f[_0x26e9b9];return _0x11f246;};'use strict';var Sequelize=require(_0xf326('0x0'));var squel=require('squel');var _=require('lodash');module[_0xf326('0x1')]={'title':{'type':Sequelize[_0xf326('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf326('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf326('0x3')](_0xf326('0x4')),'get':function(){try{return JSON[_0xf326('0x5')](this[_0xf326('0x6')](_0xf326('0x7')));}catch(_0x1b5a56){return[];}},'set':function(_0x3ace29){try{this['setDataValue'](_0xf326('0x7'),JSON[_0xf326('0x8')](_0x3ace29));}catch(_0x165f95){this[_0xf326('0x9')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf326('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xf326('0xa')]},'col':{'type':Sequelize[_0xf326('0xa')]},'background':{'type':Sequelize[_0xf326('0x2')],'allowNull':![],'defaultValue':_0xf326('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf326('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xf326('0xa')],'defaultValue':0xc}};
\ No newline at end of file
index b5713da..af45c18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad5f=['attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','catch','find','type','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone'];(function(_0x219781,_0x5971ec){var _0x243a6a=function(_0xdc0495){while(--_0xdc0495){_0x219781['push'](_0x219781['shift']());}};_0x243a6a(++_0x5971ec);}(_0xad5f,0x1a8));var _0xfad5=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0xad5f[_0x4f1da5];return _0xe972a8;};'use strict';var emlformat=require(_0xfad5('0x0'));var rimraf=require(_0xfad5('0x1'));var zipdir=require(_0xfad5('0x2'));var jsonpatch=require(_0xfad5('0x3'));var rp=require(_0xfad5('0x4'));var moment=require(_0xfad5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfad5('0x6'));var util=require(_0xfad5('0x7'));var path=require(_0xfad5('0x8'));var sox=require(_0xfad5('0x9'));var csv=require(_0xfad5('0xa'));var ejs=require(_0xfad5('0xb'));var fs=require('fs');var fs_extra=require(_0xfad5('0xc'));var _=require('lodash');var squel=require(_0xfad5('0xd'));var crypto=require(_0xfad5('0xe'));var jsforce=require(_0xfad5('0xf'));var deskjs=require(_0xfad5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfad5('0x11'));var Papa=require(_0xfad5('0x12'));var Redis=require(_0xfad5('0x13'));var authService=require(_0xfad5('0x14'));var qs=require(_0xfad5('0x15'));var as=require(_0xfad5('0x16'));var hardwareService=require(_0xfad5('0x17'));var logger=require('../../config/logger')(_0xfad5('0x18'));var utils=require(_0xfad5('0x19'));var config=require(_0xfad5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfad5('0x1b')]=_[_0xfad5('0x1c')](config[_0xfad5('0x1b')],{'host':_0xfad5('0x1d'),'port':0x18eb});var socket=require(_0xfad5('0x1e'))(new Redis(config['redis']));require(_0xfad5('0x1f'))[_0xfad5('0x20')](socket);function respondWithStatusCode(_0x162d27,_0xd65a8a){_0xd65a8a=_0xd65a8a||0xcc;return function(_0x45f731){if(_0x45f731){return _0x162d27[_0xfad5('0x21')](_0xd65a8a);}return _0x162d27[_0xfad5('0x22')](_0xd65a8a)['end']();};}function respondWithResult(_0x5bc9f6,_0x17ba21){_0x17ba21=_0x17ba21||0xc8;return function(_0xf84cc4){if(_0xf84cc4){return _0x5bc9f6[_0xfad5('0x22')](_0x17ba21)[_0xfad5('0x23')](_0xf84cc4);}};}function respondWithFilteredResult(_0x3a5b8a,_0x15c41f){return function(_0x10ae77){if(_0x10ae77){var _0x2fc3ed=typeof _0x15c41f[_0xfad5('0x24')]==='undefined'&&typeof _0x15c41f['limit']===_0xfad5('0x25');var _0x40f087=_0x10ae77['count'];var _0x5a05ff=_0x2fc3ed?0x0:_0x15c41f[_0xfad5('0x24')];var _0x2d58b6=_0x2fc3ed?_0x10ae77['count']:_0x15c41f['offset']+_0x15c41f[_0xfad5('0x26')];var _0x58c3ae;if(_0x2d58b6>=_0x40f087){_0x2d58b6=_0x40f087;_0x58c3ae=0xc8;}else{_0x58c3ae=0xce;}_0x3a5b8a[_0xfad5('0x22')](_0x58c3ae);return _0x3a5b8a[_0xfad5('0x27')](_0xfad5('0x28'),_0x5a05ff+'-'+_0x2d58b6+'/'+_0x40f087)['json'](_0x10ae77);}return null;};}function patchUpdates(_0x354a31){return function(_0x4e6ecc){try{jsonpatch[_0xfad5('0x29')](_0x4e6ecc,_0x354a31,!![]);}catch(_0x75dab5){return BPromise[_0xfad5('0x2a')](_0x75dab5);}return _0x4e6ecc[_0xfad5('0x2b')]();};}function saveUpdates(_0x1205fd,_0x341d85){return function(_0x178894){if(_0x178894){return _0x178894[_0xfad5('0x2c')](_0x1205fd)[_0xfad5('0x2d')](function(_0x45c149){return _0x45c149;});}return null;};}function removeEntity(_0x3ea0d8,_0x503b98){return function(_0x1a9344){if(_0x1a9344){return _0x1a9344[_0xfad5('0x2e')]()[_0xfad5('0x2d')](function(){_0x3ea0d8[_0xfad5('0x22')](0xcc)[_0xfad5('0x2f')]();});}};}function handleEntityNotFound(_0x59e2f4,_0x132d1d){return function(_0x3d9d95){if(!_0x3d9d95){_0x59e2f4[_0xfad5('0x21')](0x194);}return _0x3d9d95;};}function handleError(_0x4e3c29,_0x3f4760){_0x3f4760=_0x3f4760||0x1f4;return function(_0x504ae6){logger[_0xfad5('0x30')](_0x504ae6[_0xfad5('0x31')]);if(_0x504ae6[_0xfad5('0x32')]){delete _0x504ae6['name'];}_0x4e3c29[_0xfad5('0x22')](_0x3f4760)['send'](_0x504ae6);};}exports['show']=function(_0x4c0e11,_0x3fa9b6){var _0x1f5329={'raw':![],'where':{'id':_0x4c0e11[_0xfad5('0x33')]['id']}},_0x3c3f0f={};_0x3c3f0f[_0xfad5('0x34')]=_[_0xfad5('0x35')](db[_0xfad5('0x36')][_0xfad5('0x37')]);_0x3c3f0f[_0xfad5('0x38')]=_[_0xfad5('0x35')](_0x4c0e11['query']);_0x3c3f0f[_0xfad5('0x39')]=_[_0xfad5('0x3a')](_0x3c3f0f[_0xfad5('0x34')],_0x3c3f0f['query']);_0x1f5329[_0xfad5('0x3b')]=_[_0xfad5('0x3a')](_0x3c3f0f[_0xfad5('0x34')],qs[_0xfad5('0x3c')](_0x4c0e11['query'][_0xfad5('0x3c')]));_0x1f5329[_0xfad5('0x3b')]=_0x1f5329[_0xfad5('0x3b')][_0xfad5('0x3d')]?_0x1f5329[_0xfad5('0x3b')]:_0x3c3f0f['model'];if(_0x4c0e11[_0xfad5('0x38')][_0xfad5('0x3e')]){_0x1f5329[_0xfad5('0x3f')]=[{'all':!![]}];}_0x1f5329=_['merge']({},_0x1f5329,_0x4c0e11[_0xfad5('0x40')]);return db[_0xfad5('0x36')]['find'](_0x1f5329)['then'](handleEntityNotFound(_0x3fa9b6,null))[_0xfad5('0x2d')](respondWithResult(_0x3fa9b6,null))[_0xfad5('0x41')](handleError(_0x3fa9b6,null));};exports[_0xfad5('0x2e')]=function(_0x29c15e,_0x232192){return db[_0xfad5('0x36')][_0xfad5('0x42')]({'where':{'id':_0x29c15e['params']['id']}})[_0xfad5('0x2d')](handleEntityNotFound(_0x232192,null))[_0xfad5('0x2d')](removeEntity(_0x232192,null))[_0xfad5('0x41')](handleError(_0x232192,null));};function widgetAttributes(_0x3aa0e2){try{switch(_0x3aa0e2[_0xfad5('0x43')]){case'iframe':return[{'name':_0xfad5('0x44'),'value':_0x3aa0e2[_0xfad5('0x44')]||(_0x3aa0e2['attrs']&&_0x3aa0e2[_0xfad5('0x45')][0x0]?_0x3aa0e2[_0xfad5('0x45')][0x0][_0xfad5('0x46')]:undefined)||'https://'}];case'custom':return[{'name':_0xfad5('0x47'),'value':_0x3aa0e2[_0xfad5('0x47')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x0]?_0x3aa0e2[_0xfad5('0x45')][0x0][_0xfad5('0x46')]:undefined)||''}];case _0xfad5('0x48'):return[{'name':_0xfad5('0x49'),'value':_0x3aa0e2[_0xfad5('0x49')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x0]?_0x3aa0e2[_0xfad5('0x45')][0x0][_0xfad5('0x46')]:undefined)||_0xfad5('0x4a')},{'name':_0xfad5('0x4b'),'value':_0x3aa0e2[_0xfad5('0x4b')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x1]?_0x3aa0e2[_0xfad5('0x45')][0x1][_0xfad5('0x46')]:undefined)||'0.00'},{'name':_0xfad5('0x4c'),'value':_0x3aa0e2[_0xfad5('0x4c')]||(_0x3aa0e2['attrs']&&_0x3aa0e2[_0xfad5('0x45')][0x2]?_0x3aa0e2['attrs'][0x2]['value']:undefined)||0xc}];case _0xfad5('0x4d'):return[{'name':'attrMetric','value':_0x3aa0e2[_0xfad5('0x4e')]||(_0x3aa0e2['attrs']&&_0x3aa0e2[_0xfad5('0x45')][0x0]?_0x3aa0e2[_0xfad5('0x45')][0x0]['value']:undefined)||_0xfad5('0x4f')},{'name':_0xfad5('0x50'),'value':_0x3aa0e2['attrVoiceQueues']||(_0x3aa0e2['attrs']&&_0x3aa0e2[_0xfad5('0x45')][0x1]?_0x3aa0e2['attrs'][0x1]['value']:undefined)||[]},{'name':_0xfad5('0x4c'),'value':_0x3aa0e2['attrFontSize']||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x2]?_0x3aa0e2[_0xfad5('0x45')][0x2][_0xfad5('0x46')]:undefined)||0x14},{'name':_0xfad5('0x51'),'value':_0x3aa0e2['attrChannel']||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x3]?_0x3aa0e2[_0xfad5('0x45')][0x3]['value']:undefined)||_0xfad5('0x52')},{'name':_0xfad5('0x53'),'value':_0x3aa0e2['attrEmailAccounts']||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x4]?_0x3aa0e2['attrs'][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x3aa0e2[_0xfad5('0x54')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x5]?_0x3aa0e2[_0xfad5('0x45')][0x5]['value']:undefined)||''},{'name':_0xfad5('0x55'),'value':_0x3aa0e2[_0xfad5('0x55')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x6]?_0x3aa0e2[_0xfad5('0x45')][0x6][_0xfad5('0x46')]:undefined)||''},{'name':_0xfad5('0x56'),'value':_0x3aa0e2[_0xfad5('0x56')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2['attrs'][0x7]?_0x3aa0e2[_0xfad5('0x45')][0x7][_0xfad5('0x46')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3aa0e2[_0xfad5('0x57')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x8]?_0x3aa0e2[_0xfad5('0x45')][0x8][_0xfad5('0x46')]:undefined)||''},{'name':_0xfad5('0x58'),'value':_0x3aa0e2['attrChatWebsites']||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x9]?_0x3aa0e2[_0xfad5('0x45')][0x9][_0xfad5('0x46')]:undefined)||''}];case _0xfad5('0x59'):case _0xfad5('0x5a'):return[{'name':'attrSerie1','value':_0x3aa0e2['attrSerie1']||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x0]?_0x3aa0e2[_0xfad5('0x45')][0x0]['value']:undefined)||_0xfad5('0x4f')},{'name':'attrSerie2','value':_0x3aa0e2['attrSerie2']||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x1]?_0x3aa0e2[_0xfad5('0x45')][0x1][_0xfad5('0x46')]:undefined)||null},{'name':_0xfad5('0x5b'),'value':_0x3aa0e2[_0xfad5('0x5b')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2['attrs'][0x2]?_0x3aa0e2[_0xfad5('0x45')][0x2][_0xfad5('0x46')]:undefined)||null},{'name':_0xfad5('0x50'),'value':_0x3aa0e2[_0xfad5('0x50')]||(_0x3aa0e2['attrs']&&_0x3aa0e2['attrs'][0x3]?_0x3aa0e2[_0xfad5('0x45')][0x3][_0xfad5('0x46')]:undefined)||[]},{'name':_0xfad5('0x51'),'value':_0x3aa0e2[_0xfad5('0x51')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2['attrs'][0x4]?_0x3aa0e2['attrs'][0x4][_0xfad5('0x46')]:undefined)||'voice'},{'name':_0xfad5('0x53'),'value':_0x3aa0e2[_0xfad5('0x53')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x5]?_0x3aa0e2[_0xfad5('0x45')][0x5]['value']:undefined)||''},{'name':_0xfad5('0x54'),'value':_0x3aa0e2[_0xfad5('0x54')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x6]?_0x3aa0e2[_0xfad5('0x45')][0x6]['value']:undefined)||''},{'name':_0xfad5('0x55'),'value':_0x3aa0e2['attrSmsAccounts']||(_0x3aa0e2['attrs']&&_0x3aa0e2[_0xfad5('0x45')][0x7]?_0x3aa0e2[_0xfad5('0x45')][0x7][_0xfad5('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3aa0e2[_0xfad5('0x56')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x8]?_0x3aa0e2['attrs'][0x8][_0xfad5('0x46')]:undefined)||''},{'name':_0xfad5('0x57'),'value':_0x3aa0e2[_0xfad5('0x57')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x9]?_0x3aa0e2[_0xfad5('0x45')][0x9][_0xfad5('0x46')]:undefined)||''},{'name':_0xfad5('0x58'),'value':_0x3aa0e2[_0xfad5('0x58')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0xa]?_0x3aa0e2['attrs'][0xa][_0xfad5('0x46')]:undefined)||''}];case _0xfad5('0x5c'):return[{'name':_0xfad5('0x5d'),'type':_0x3aa0e2[_0xfad5('0x5e')]||(_0x3aa0e2['attrs']&&_0x3aa0e2[_0xfad5('0x45')][0x0]?_0x3aa0e2['attrs'][0x0][_0xfad5('0x43')]:undefined)||null,'value':_0x3aa0e2[_0xfad5('0x5d')]||(_0x3aa0e2[_0xfad5('0x45')]&&_0x3aa0e2[_0xfad5('0x45')][0x0]?_0x3aa0e2[_0xfad5('0x45')][0x0]['value']:undefined)||null},{'name':_0xfad5('0x5f'),'value':_0x3aa0e2[_0xfad5('0x5f')]||(_0x3aa0e2['attrs']&&_0x3aa0e2['attrs'][0x1]?_0x3aa0e2[_0xfad5('0x45')][0x1][_0xfad5('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x214281){logger['error'](_0xfad5('0x60'),JSON[_0xfad5('0x61')](_0x214281));return[];}}exports[_0xfad5('0x62')]=function(_0x19a13f,_0x2f9b88){if(_0x19a13f[_0xfad5('0x63')]){_0x19a13f['body'][_0xfad5('0x45')]=widgetAttributes(_0x19a13f[_0xfad5('0x63')]);}return db[_0xfad5('0x36')][_0xfad5('0x62')](_0x19a13f[_0xfad5('0x63')],{})['then'](respondWithResult(_0x2f9b88,0xc9))[_0xfad5('0x41')](handleError(_0x2f9b88,null));};exports['update']=function(_0x2e5ef2,_0x25739a){if(_0x2e5ef2[_0xfad5('0x63')]['id']){delete _0x2e5ef2[_0xfad5('0x63')]['id'];}_0x2e5ef2[_0xfad5('0x63')][_0xfad5('0x45')]=widgetAttributes(_0x2e5ef2[_0xfad5('0x63')]);return db['DashboardItem'][_0xfad5('0x42')]({'where':{'id':_0x2e5ef2[_0xfad5('0x33')]['id']}})[_0xfad5('0x2d')](handleEntityNotFound(_0x25739a,null))[_0xfad5('0x2d')](saveUpdates(_0x2e5ef2[_0xfad5('0x63')],null))[_0xfad5('0x2d')](respondWithResult(_0x25739a,null))['catch'](handleError(_0x25739a,null));};
\ No newline at end of file
+var _0x1f2d=['then','error','name','show','model','rawAttributes','query','keys','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','DashboardItem','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','json','reject'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0x1f2d[_0x529f1c];return _0x4d57ab;};'use strict';var emlformat=require(_0xd1f2('0x0'));var rimraf=require(_0xd1f2('0x1'));var zipdir=require(_0xd1f2('0x2'));var jsonpatch=require(_0xd1f2('0x3'));var rp=require('request-promise');var moment=require(_0xd1f2('0x4'));var BPromise=require(_0xd1f2('0x5'));var Mustache=require(_0xd1f2('0x6'));var util=require(_0xd1f2('0x7'));var path=require(_0xd1f2('0x8'));var sox=require(_0xd1f2('0x9'));var csv=require(_0xd1f2('0xa'));var ejs=require(_0xd1f2('0xb'));var fs=require('fs');var fs_extra=require(_0xd1f2('0xc'));var _=require(_0xd1f2('0xd'));var squel=require(_0xd1f2('0xe'));var crypto=require(_0xd1f2('0xf'));var jsforce=require(_0xd1f2('0x10'));var deskjs=require(_0xd1f2('0x11'));var toCsv=require(_0xd1f2('0xa'));var querystring=require(_0xd1f2('0x12'));var Papa=require(_0xd1f2('0x13'));var Redis=require('ioredis');var authService=require(_0xd1f2('0x14'));var qs=require(_0xd1f2('0x15'));var as=require(_0xd1f2('0x16'));var hardwareService=require(_0xd1f2('0x17'));var logger=require('../../config/logger')(_0xd1f2('0x18'));var utils=require(_0xd1f2('0x19'));var config=require(_0xd1f2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd1f2('0x1b'))['db'];config[_0xd1f2('0x1c')]=_[_0xd1f2('0x1d')](config[_0xd1f2('0x1c')],{'host':_0xd1f2('0x1e'),'port':0x18eb});var socket=require(_0xd1f2('0x1f'))(new Redis(config[_0xd1f2('0x1c')]));require('./dashboardItem.socket')[_0xd1f2('0x20')](socket);function respondWithStatusCode(_0x5a3c44,_0x50648f){_0x50648f=_0x50648f||0xcc;return function(_0x487bac){if(_0x487bac){return _0x5a3c44[_0xd1f2('0x21')](_0x50648f);}return _0x5a3c44[_0xd1f2('0x22')](_0x50648f)[_0xd1f2('0x23')]();};}function respondWithResult(_0x1bd6ac,_0x2b4c50){_0x2b4c50=_0x2b4c50||0xc8;return function(_0x3315b1){if(_0x3315b1){return _0x1bd6ac[_0xd1f2('0x22')](_0x2b4c50)['json'](_0x3315b1);}};}function respondWithFilteredResult(_0x2af2d8,_0x44e9e4){return function(_0x2cd4fa){if(_0x2cd4fa){var _0x2301dd=typeof _0x44e9e4[_0xd1f2('0x24')]===_0xd1f2('0x25')&&typeof _0x44e9e4[_0xd1f2('0x26')]==='undefined';var _0x12343a=_0x2cd4fa[_0xd1f2('0x27')];var _0x214a99=_0x2301dd?0x0:_0x44e9e4[_0xd1f2('0x24')];var _0x1bafd8=_0x2301dd?_0x2cd4fa[_0xd1f2('0x27')]:_0x44e9e4[_0xd1f2('0x24')]+_0x44e9e4[_0xd1f2('0x26')];var _0x23250f;if(_0x1bafd8>=_0x12343a){_0x1bafd8=_0x12343a;_0x23250f=0xc8;}else{_0x23250f=0xce;}_0x2af2d8[_0xd1f2('0x22')](_0x23250f);return _0x2af2d8[_0xd1f2('0x28')]('Content-Range',_0x214a99+'-'+_0x1bafd8+'/'+_0x12343a)[_0xd1f2('0x29')](_0x2cd4fa);}return null;};}function patchUpdates(_0x779022){return function(_0x510023){try{jsonpatch['apply'](_0x510023,_0x779022,!![]);}catch(_0x36c147){return BPromise[_0xd1f2('0x2a')](_0x36c147);}return _0x510023['save']();};}function saveUpdates(_0x527471,_0x4ec9a3){return function(_0x559243){if(_0x559243){return _0x559243['update'](_0x527471)[_0xd1f2('0x2b')](function(_0x3f181b){return _0x3f181b;});}return null;};}function removeEntity(_0x2557d0,_0x2c0bbb){return function(_0x1f648a){if(_0x1f648a){return _0x1f648a['destroy']()[_0xd1f2('0x2b')](function(){_0x2557d0[_0xd1f2('0x22')](0xcc)[_0xd1f2('0x23')]();});}};}function handleEntityNotFound(_0x464b1f,_0x10f224){return function(_0x44e657){if(!_0x44e657){_0x464b1f[_0xd1f2('0x21')](0x194);}return _0x44e657;};}function handleError(_0x4628dd,_0x23ebcb){_0x23ebcb=_0x23ebcb||0x1f4;return function(_0x2c1d0e){logger[_0xd1f2('0x2c')](_0x2c1d0e['stack']);if(_0x2c1d0e['name']){delete _0x2c1d0e[_0xd1f2('0x2d')];}_0x4628dd[_0xd1f2('0x22')](_0x23ebcb)['send'](_0x2c1d0e);};}exports[_0xd1f2('0x2e')]=function(_0x4ce6cd,_0x1b9c0f){var _0x3e2a98={'raw':![],'where':{'id':_0x4ce6cd['params']['id']}},_0x1a6c08={};_0x1a6c08[_0xd1f2('0x2f')]=_['keys'](db['DashboardItem'][_0xd1f2('0x30')]);_0x1a6c08[_0xd1f2('0x31')]=_[_0xd1f2('0x32')](_0x4ce6cd[_0xd1f2('0x31')]);_0x1a6c08['filters']=_[_0xd1f2('0x33')](_0x1a6c08['model'],_0x1a6c08[_0xd1f2('0x31')]);_0x3e2a98[_0xd1f2('0x34')]=_['intersection'](_0x1a6c08[_0xd1f2('0x2f')],qs['fields'](_0x4ce6cd[_0xd1f2('0x31')][_0xd1f2('0x35')]));_0x3e2a98[_0xd1f2('0x34')]=_0x3e2a98[_0xd1f2('0x34')][_0xd1f2('0x36')]?_0x3e2a98[_0xd1f2('0x34')]:_0x1a6c08['model'];if(_0x4ce6cd[_0xd1f2('0x31')][_0xd1f2('0x37')]){_0x3e2a98[_0xd1f2('0x38')]=[{'all':!![]}];}_0x3e2a98=_[_0xd1f2('0x39')]({},_0x3e2a98,_0x4ce6cd[_0xd1f2('0x3a')]);return db['DashboardItem'][_0xd1f2('0x3b')](_0x3e2a98)[_0xd1f2('0x2b')](handleEntityNotFound(_0x1b9c0f,null))['then'](respondWithResult(_0x1b9c0f,null))[_0xd1f2('0x3c')](handleError(_0x1b9c0f,null));};exports['destroy']=function(_0x67f9e5,_0x228f11){return db[_0xd1f2('0x3d')][_0xd1f2('0x3b')]({'where':{'id':_0x67f9e5['params']['id']}})[_0xd1f2('0x2b')](handleEntityNotFound(_0x228f11,null))[_0xd1f2('0x2b')](removeEntity(_0x228f11,null))[_0xd1f2('0x3c')](handleError(_0x228f11,null));};function widgetAttributes(_0x336d16){try{switch(_0x336d16[_0xd1f2('0x3e')]){case _0xd1f2('0x3f'):return[{'name':_0xd1f2('0x40'),'value':_0x336d16['attrUrl']||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16['attrs'][0x0]?_0x336d16[_0xd1f2('0x41')][0x0][_0xd1f2('0x42')]:undefined)||_0xd1f2('0x43')}];case'custom':return[{'name':_0xd1f2('0x44'),'value':_0x336d16['attrPath']||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x0]?_0x336d16[_0xd1f2('0x41')][0x0][_0xd1f2('0x42')]:undefined)||''}];case _0xd1f2('0x45'):return[{'name':'attrHourFormat','value':_0x336d16[_0xd1f2('0x46')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16['attrs'][0x0]?_0x336d16[_0xd1f2('0x41')][0x0]['value']:undefined)||_0xd1f2('0x47')},{'name':_0xd1f2('0x48'),'value':_0x336d16[_0xd1f2('0x48')]||(_0x336d16['attrs']&&_0x336d16[_0xd1f2('0x41')][0x1]?_0x336d16['attrs'][0x1][_0xd1f2('0x42')]:undefined)||_0xd1f2('0x49')},{'name':_0xd1f2('0x4a'),'value':_0x336d16[_0xd1f2('0x4a')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x2]?_0x336d16[_0xd1f2('0x41')][0x2][_0xd1f2('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0xd1f2('0x4b'),'value':_0x336d16[_0xd1f2('0x4b')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x0]?_0x336d16[_0xd1f2('0x41')][0x0][_0xd1f2('0x42')]:undefined)||'total'},{'name':_0xd1f2('0x4c'),'value':_0x336d16[_0xd1f2('0x4c')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16['attrs'][0x1]?_0x336d16[_0xd1f2('0x41')][0x1][_0xd1f2('0x42')]:undefined)||[]},{'name':_0xd1f2('0x4a'),'value':_0x336d16[_0xd1f2('0x4a')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x2]?_0x336d16['attrs'][0x2][_0xd1f2('0x42')]:undefined)||0x14},{'name':_0xd1f2('0x4d'),'value':_0x336d16[_0xd1f2('0x4d')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16['attrs'][0x3]?_0x336d16[_0xd1f2('0x41')][0x3][_0xd1f2('0x42')]:undefined)||'voice'},{'name':_0xd1f2('0x4e'),'value':_0x336d16['attrEmailAccounts']||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16['attrs'][0x4]?_0x336d16[_0xd1f2('0x41')][0x4][_0xd1f2('0x42')]:undefined)||''},{'name':_0xd1f2('0x4f'),'value':_0x336d16[_0xd1f2('0x4f')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x5]?_0x336d16['attrs'][0x5][_0xd1f2('0x42')]:undefined)||''},{'name':_0xd1f2('0x50'),'value':_0x336d16[_0xd1f2('0x50')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x6]?_0x336d16['attrs'][0x6][_0xd1f2('0x42')]:undefined)||''},{'name':_0xd1f2('0x51'),'value':_0x336d16[_0xd1f2('0x51')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x7]?_0x336d16['attrs'][0x7][_0xd1f2('0x42')]:undefined)||''},{'name':_0xd1f2('0x52'),'value':_0x336d16[_0xd1f2('0x52')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x8]?_0x336d16[_0xd1f2('0x41')][0x8][_0xd1f2('0x42')]:undefined)||''},{'name':_0xd1f2('0x53'),'value':_0x336d16[_0xd1f2('0x53')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16['attrs'][0x9]?_0x336d16['attrs'][0x9][_0xd1f2('0x42')]:undefined)||''}];case _0xd1f2('0x54'):case _0xd1f2('0x55'):return[{'name':_0xd1f2('0x56'),'value':_0x336d16[_0xd1f2('0x56')]||(_0x336d16['attrs']&&_0x336d16[_0xd1f2('0x41')][0x0]?_0x336d16[_0xd1f2('0x41')][0x0]['value']:undefined)||_0xd1f2('0x57')},{'name':_0xd1f2('0x58'),'value':_0x336d16[_0xd1f2('0x58')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16['attrs'][0x1]?_0x336d16['attrs'][0x1][_0xd1f2('0x42')]:undefined)||null},{'name':_0xd1f2('0x59'),'value':_0x336d16['attrSerie3']||(_0x336d16['attrs']&&_0x336d16[_0xd1f2('0x41')][0x2]?_0x336d16[_0xd1f2('0x41')][0x2]['value']:undefined)||null},{'name':_0xd1f2('0x4c'),'value':_0x336d16[_0xd1f2('0x4c')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x3]?_0x336d16[_0xd1f2('0x41')][0x3][_0xd1f2('0x42')]:undefined)||[]},{'name':_0xd1f2('0x4d'),'value':_0x336d16[_0xd1f2('0x4d')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x4]?_0x336d16[_0xd1f2('0x41')][0x4]['value']:undefined)||_0xd1f2('0x5a')},{'name':'attrEmailAccounts','value':_0x336d16[_0xd1f2('0x4e')]||(_0x336d16['attrs']&&_0x336d16[_0xd1f2('0x41')][0x5]?_0x336d16[_0xd1f2('0x41')][0x5][_0xd1f2('0x42')]:undefined)||''},{'name':_0xd1f2('0x4f'),'value':_0x336d16[_0xd1f2('0x4f')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x6]?_0x336d16[_0xd1f2('0x41')][0x6]['value']:undefined)||''},{'name':_0xd1f2('0x50'),'value':_0x336d16[_0xd1f2('0x50')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x7]?_0x336d16[_0xd1f2('0x41')][0x7][_0xd1f2('0x42')]:undefined)||''},{'name':_0xd1f2('0x51'),'value':_0x336d16[_0xd1f2('0x51')]||(_0x336d16['attrs']&&_0x336d16['attrs'][0x8]?_0x336d16[_0xd1f2('0x41')][0x8][_0xd1f2('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x336d16[_0xd1f2('0x52')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16['attrs'][0x9]?_0x336d16[_0xd1f2('0x41')][0x9]['value']:undefined)||''},{'name':_0xd1f2('0x53'),'value':_0x336d16[_0xd1f2('0x53')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0xa]?_0x336d16['attrs'][0xa]['value']:undefined)||''}];case _0xd1f2('0x5b'):return[{'name':_0xd1f2('0x5c'),'type':_0x336d16[_0xd1f2('0x5d')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x0]?_0x336d16['attrs'][0x0][_0xd1f2('0x3e')]:undefined)||null,'value':_0x336d16['attrReport']||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16[_0xd1f2('0x41')][0x0]?_0x336d16[_0xd1f2('0x41')][0x0][_0xd1f2('0x42')]:undefined)||null},{'name':_0xd1f2('0x5e'),'value':_0x336d16[_0xd1f2('0x5e')]||(_0x336d16[_0xd1f2('0x41')]&&_0x336d16['attrs'][0x1]?_0x336d16[_0xd1f2('0x41')][0x1][_0xd1f2('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x521cd5){logger[_0xd1f2('0x2c')](_0xd1f2('0x5f'),JSON[_0xd1f2('0x60')](_0x521cd5));return[];}}exports[_0xd1f2('0x61')]=function(_0x28c41b,_0x3ccb1a){if(_0x28c41b[_0xd1f2('0x62')]){_0x28c41b[_0xd1f2('0x62')][_0xd1f2('0x41')]=widgetAttributes(_0x28c41b[_0xd1f2('0x62')]);}return db[_0xd1f2('0x3d')][_0xd1f2('0x61')](_0x28c41b[_0xd1f2('0x62')],{})['then'](respondWithResult(_0x3ccb1a,0xc9))['catch'](handleError(_0x3ccb1a,null));};exports['update']=function(_0x3c628f,_0x110184){if(_0x3c628f[_0xd1f2('0x62')]['id']){delete _0x3c628f[_0xd1f2('0x62')]['id'];}_0x3c628f[_0xd1f2('0x62')][_0xd1f2('0x41')]=widgetAttributes(_0x3c628f[_0xd1f2('0x62')]);return db[_0xd1f2('0x3d')][_0xd1f2('0x3b')]({'where':{'id':_0x3c628f['params']['id']}})['then'](handleEntityNotFound(_0x110184,null))['then'](saveUpdates(_0x3c628f['body'],null))[_0xd1f2('0x2b')](respondWithResult(_0x110184,null))[_0xd1f2('0x3c')](handleError(_0x110184,null));};
\ No newline at end of file
index 231854b..11e7d0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1aaf=['hook','events','setMaxListeners','save','update','emit'];(function(_0x5c5f6b,_0x185d31){var _0x2df757=function(_0x4f6af4){while(--_0x4f6af4){_0x5c5f6b['push'](_0x5c5f6b['shift']());}};_0x2df757(++_0x185d31);}(_0x1aaf,0x103));var _0xf1aa=function(_0x1f97fa,_0x4324cc){_0x1f97fa=_0x1f97fa-0x0;var _0xcc903d=_0x1aaf[_0x1f97fa];return _0xcc903d;};'use strict';var EventEmitter=require(_0xf1aa('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf1aa('0x1')](0x0);var events={'afterCreate':_0xf1aa('0x2'),'afterUpdate':_0xf1aa('0x3'),'afterDestroy':'remove'};function emitEvent(_0x44a705){return function(_0x454011,_0x10eeb7,_0x3dc479){DashboardItemEvents[_0xf1aa('0x4')](_0x44a705+':'+_0x454011['id'],_0x454011);DashboardItemEvents[_0xf1aa('0x4')](_0x44a705,_0x454011);_0x3dc479(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xf1aa('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0x3f75=['events','DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x3f75,0xc8));var _0x53f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f75[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x53f7('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x53f7('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x53f7('0x2')](0x0);var events={'afterCreate':_0x53f7('0x3'),'afterUpdate':_0x53f7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x492333){return function(_0x16ff8b,_0xf0efd6,_0x481129){DashboardItemEvents[_0x53f7('0x5')](_0x492333+':'+_0x16ff8b['id'],_0x16ff8b);DashboardItemEvents[_0x53f7('0x5')](_0x492333,_0x16ff8b);_0x481129(null);};}for(var e in events){if(events[_0x53f7('0x6')](e)){var event=events[e];DashboardItem[_0x53f7('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index eddee5d..f30e514 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a54=['./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util','api','moment','request-promise','rimraf'];(function(_0x16f275,_0x2fc8b0){var _0x55656d=function(_0x50c1a4){while(--_0x50c1a4){_0x16f275['push'](_0x16f275['shift']());}};_0x55656d(++_0x2fc8b0);}(_0x1a54,0x14f));var _0x41a5=function(_0x4b512,_0x16e65c){_0x4b512=_0x4b512-0x0;var _0xc189ba=_0x1a54[_0x4b512];return _0xc189ba;};'use strict';var _=require('lodash');var util=require(_0x41a5('0x0'));var logger=require('../../config/logger')(_0x41a5('0x1'));var moment=require(_0x41a5('0x2'));var BPromise=require('bluebird');var rp=require(_0x41a5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41a5('0x4'));var config=require('../../config/environment');var attributes=require(_0x41a5('0x5'));module[_0x41a5('0x6')]=function(_0x11d8de,_0x5ef0aa){return _0x11d8de[_0x41a5('0x7')](_0x41a5('0x8'),attributes,{'tableName':_0x41a5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf51e=['api','moment','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','util','../../config/logger'];(function(_0x1945f4,_0x472fb1){var _0x343e46=function(_0x455189){while(--_0x455189){_0x1945f4['push'](_0x1945f4['shift']());}};_0x343e46(++_0x472fb1);}(_0xf51e,0x9a));var _0xef51=function(_0x359a8a,_0x48a338){_0x359a8a=_0x359a8a-0x0;var _0x1438ca=_0xf51e[_0x359a8a];return _0x1438ca;};'use strict';var _=require('lodash');var util=require(_0xef51('0x0'));var logger=require(_0xef51('0x1'))(_0xef51('0x2'));var moment=require(_0xef51('0x3'));var BPromise=require(_0xef51('0x4'));var rp=require(_0xef51('0x5'));var fs=require('fs');var path=require(_0xef51('0x6'));var rimraf=require('rimraf');var config=require(_0xef51('0x7'));var attributes=require(_0xef51('0x8'));module[_0xef51('0x9')]=function(_0x1f13f0,_0x4b159f){return _0x1f13f0[_0xef51('0xa')](_0xef51('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 48c5b29..e410a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf712=['defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x4b978a,_0x472e65){var _0x2dbd2c=function(_0x18be84){while(--_0x18be84){_0x4b978a['push'](_0x4b978a['shift']());}};_0x2dbd2c(++_0x472e65);}(_0xf712,0xac));var _0x2f71=function(_0x3fedc8,_0xe537c4){_0x3fedc8=_0x3fedc8-0x0;var _0x352a94=_0xf712[_0x3fedc8];return _0x352a94;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2f71('0x0'));var fs=require('fs');var Redis=require(_0x2f71('0x1'));var db=require(_0x2f71('0x2'))['db'];var utils=require(_0x2f71('0x3'));var logger=require(_0x2f71('0x4'))(_0x2f71('0x5'));var config=require('../../config/environment');var jayson=require(_0x2f71('0x6'));var client=jayson[_0x2f71('0x7')][_0x2f71('0x8')]({'port':0x232a});config[_0x2f71('0x9')]=_[_0x2f71('0xa')](config['redis'],{'host':_0x2f71('0xb'),'port':0x18eb});var socket=require(_0x2f71('0xc'))(new Redis(config[_0x2f71('0x9')]));require(_0x2f71('0xd'))[_0x2f71('0xe')](socket);function respondWithRpcPromise(_0x337f75,_0xbccb44,_0x37e3ee){return new BPromise(function(_0x55e5df,_0x22fbc4){return client[_0x2f71('0xf')](_0x337f75,_0x37e3ee)[_0x2f71('0x10')](function(_0x4f2171){logger[_0x2f71('0x11')](_0x2f71('0x12'),_0xbccb44,_0x2f71('0x13'));logger['debug'](_0x2f71('0x14'),_0xbccb44,_0x2f71('0x13'),JSON[_0x2f71('0x15')](_0x4f2171));if(_0x4f2171['error']){if(_0x4f2171[_0x2f71('0x16')]['code']===0x1f4){logger['error'](_0x2f71('0x12'),_0xbccb44,_0x4f2171[_0x2f71('0x16')]['message']);return _0x22fbc4(_0x4f2171[_0x2f71('0x16')][_0x2f71('0x17')]);}logger['error'](_0x2f71('0x12'),_0xbccb44,_0x4f2171[_0x2f71('0x16')]['message']);return _0x55e5df(_0x4f2171['error']['message']);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0xbccb44,_0x2f71('0x13'));_0x55e5df(_0x4f2171[_0x2f71('0x18')][_0x2f71('0x17')]);}})[_0x2f71('0x19')](function(_0x39d405){logger[_0x2f71('0x16')](_0x2f71('0x12'),_0xbccb44,_0x39d405);_0x22fbc4(_0x39d405);});});}
\ No newline at end of file
+var _0x875b=['request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x875b,0xa9));var _0xb875=function(_0x1830ce,_0x305798){_0x1830ce=_0x1830ce-0x0;var _0x2bce9f=_0x875b[_0x1830ce];return _0x2bce9f;};'use strict';var _=require(_0xb875('0x0'));var util=require(_0xb875('0x1'));var moment=require(_0xb875('0x2'));var BPromise=require(_0xb875('0x3'));var rs=require(_0xb875('0x4'));var fs=require('fs');var Redis=require(_0xb875('0x5'));var db=require(_0xb875('0x6'))['db'];var utils=require(_0xb875('0x7'));var logger=require('../../config/logger')(_0xb875('0x8'));var config=require(_0xb875('0x9'));var jayson=require(_0xb875('0xa'));var client=jayson[_0xb875('0xb')][_0xb875('0xc')]({'port':0x232a});config[_0xb875('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb875('0xe'))(new Redis(config[_0xb875('0xd')]));require(_0xb875('0xf'))[_0xb875('0x10')](socket);function respondWithRpcPromise(_0x50923b,_0x1cb36a,_0x240036){return new BPromise(function(_0xdf71fe,_0x55d627){return client[_0xb875('0x11')](_0x50923b,_0x240036)['then'](function(_0x2602c6){logger[_0xb875('0x12')](_0xb875('0x13'),_0x1cb36a,_0xb875('0x14'));logger[_0xb875('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x1cb36a,_0xb875('0x14'),JSON['stringify'](_0x2602c6));if(_0x2602c6[_0xb875('0x16')]){if(_0x2602c6[_0xb875('0x16')][_0xb875('0x17')]===0x1f4){logger[_0xb875('0x16')](_0xb875('0x13'),_0x1cb36a,_0x2602c6[_0xb875('0x16')]['message']);return _0x55d627(_0x2602c6[_0xb875('0x16')]['message']);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x1cb36a,_0x2602c6[_0xb875('0x16')][_0xb875('0x18')]);return _0xdf71fe(_0x2602c6[_0xb875('0x16')][_0xb875('0x18')]);}else{logger[_0xb875('0x12')](_0xb875('0x13'),_0x1cb36a,_0xb875('0x14'));_0xdf71fe(_0x2602c6[_0xb875('0x19')]['message']);}})[_0xb875('0x1a')](function(_0x12efe9){logger[_0xb875('0x16')](_0xb875('0x13'),_0x1cb36a,_0x12efe9);_0x55d627(_0x12efe9);});});}
\ No newline at end of file
index 60fe03b..91e07f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8807=['./dashboardItem.events','save','remove','update','removeListener','register','dashboardItem:'];(function(_0xea1bc8,_0x325c9b){var _0x1a7b3c=function(_0x1cc48a){while(--_0x1cc48a){_0xea1bc8['push'](_0xea1bc8['shift']());}};_0x1a7b3c(++_0x325c9b);}(_0x8807,0xa8));var _0x7880=function(_0x312cd8,_0x426245){_0x312cd8=_0x312cd8-0x0;var _0x137254=_0x8807[_0x312cd8];return _0x137254;};'use strict';var DashboardItemEvents=require(_0x7880('0x0'));var events=[_0x7880('0x1'),_0x7880('0x2'),_0x7880('0x3')];function createListener(_0x5939ad,_0x43b096){return function(_0x4f39b0){_0x43b096['emit'](_0x5939ad,_0x4f39b0);};}function removeListener(_0x4c6e25,_0x42212e){return function(){DashboardItemEvents[_0x7880('0x4')](_0x4c6e25,_0x42212e);};}exports[_0x7880('0x5')]=function(_0x4cb1fe){for(var _0x44040c=0x0,_0xc5c9a4=events['length'];_0x44040c<_0xc5c9a4;_0x44040c++){var _0x3a72de=events[_0x44040c];var _0xcfe9e5=createListener(_0x7880('0x6')+_0x3a72de,_0x4cb1fe);DashboardItemEvents['on'](_0x3a72de,_0xcfe9e5);}};
\ No newline at end of file
+var _0x3ba0=['update','register','dashboardItem:','save','remove'];(function(_0xfeef0f,_0x740ddd){var _0x5a4ddd=function(_0x3a8b63){while(--_0x3a8b63){_0xfeef0f['push'](_0xfeef0f['shift']());}};_0x5a4ddd(++_0x740ddd);}(_0x3ba0,0x17f));var _0x03ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3ba0[_0x14add3];return _0x4a174f;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x03ba('0x0'),_0x03ba('0x1'),_0x03ba('0x2')];function createListener(_0x3615ae,_0x49c44c){return function(_0x5791f3){_0x49c44c['emit'](_0x3615ae,_0x5791f3);};}function removeListener(_0x2b64dc,_0x12ced8){return function(){DashboardItemEvents['removeListener'](_0x2b64dc,_0x12ced8);};}exports[_0x03ba('0x3')]=function(_0xef72d0){for(var _0x4cd6d2=0x0,_0x472f94=events['length'];_0x4cd6d2<_0x472f94;_0x4cd6d2++){var _0x516ea2=events[_0x4cd6d2];var _0x42bce1=createListener(_0x03ba('0x4')+_0x516ea2,_0xef72d0);DashboardItemEvents['on'](_0x516ea2,_0x42bce1);}};
\ No newline at end of file
index 900749e..7f93122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ee2=['fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4803a2,_0x45c9d9){var _0x1c3b44=function(_0x302c02){while(--_0x302c02){_0x4803a2['push'](_0x4803a2['shift']());}};_0x1c3b44(++_0x45c9d9);}(_0x7ee2,0x83));var _0x27ee=function(_0x2dd8c1,_0x4ad192){_0x2dd8c1=_0x2dd8c1-0x0;var _0x2c41d8=_0x7ee2[_0x2dd8c1];return _0x2c41d8;};'use strict';var multer=require(_0x27ee('0x0'));var util=require(_0x27ee('0x1'));var path=require(_0x27ee('0x2'));var timeout=require(_0x27ee('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x27ee('0x4'));var auth=require(_0x27ee('0x5'));var interaction=require(_0x27ee('0x6'));var config=require('../../config/environment');var controller=require(_0x27ee('0x7'));router['get'](_0x27ee('0x8'),auth[_0x27ee('0x9')](),controller['show']);router['post']('/',auth[_0x27ee('0x9')](),controller['create']);router[_0x27ee('0xa')]('/:id',auth[_0x27ee('0x9')](),controller[_0x27ee('0xb')]);router[_0x27ee('0xc')](_0x27ee('0x8'),auth[_0x27ee('0x9')](),controller[_0x27ee('0xd')]);module[_0x27ee('0xe')]=router;
\ No newline at end of file
+var _0x77ba=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','update','destroy','exports','multer','util'];(function(_0x32659d,_0x58ece9){var _0x10d610=function(_0x35bded){while(--_0x35bded){_0x32659d['push'](_0x32659d['shift']());}};_0x10d610(++_0x58ece9);}(_0x77ba,0x1de));var _0xa77b=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0x77ba[_0x2ef8f1];return _0x17498d;};'use strict';var multer=require(_0xa77b('0x0'));var util=require(_0xa77b('0x1'));var path=require(_0xa77b('0x2'));var timeout=require(_0xa77b('0x3'));var express=require('express');var router=express[_0xa77b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa77b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa77b('0x6'));var controller=require('./dashboardItem.controller');router[_0xa77b('0x7')](_0xa77b('0x8'),auth['isAuthenticated'](),controller[_0xa77b('0x9')]);router['post']('/',auth[_0xa77b('0xa')](),controller[_0xa77b('0xb')]);router[_0xa77b('0xc')](_0xa77b('0x8'),auth['isAuthenticated'](),controller[_0xa77b('0xd')]);router['delete'](_0xa77b('0x8'),auth[_0xa77b('0xa')](),controller[_0xa77b('0xe')]);module[_0xa77b('0xf')]=router;
\ No newline at end of file
index 3a16832..a000285 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x749a=['third','ENUM','first'];(function(_0x17f9f2,_0x4250d5){var _0x204717=function(_0x28c46f){while(--_0x28c46f){_0x17f9f2['push'](_0x17f9f2['shift']());}};_0x204717(++_0x4250d5);}(_0x749a,0x1c9));var _0xa749=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x749a[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xa749('0x0')](_0xa749('0x1'),'second',_0xa749('0x2')),'allowNull':![],'defaultValue':_0xa749('0x1')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb9fb=['sequelize','exports','ENUM','first','second','third','STRING'];(function(_0x29c8d5,_0x4a4c64){var _0x4ad2d8=function(_0x3e71d0){while(--_0x3e71d0){_0x29c8d5['push'](_0x29c8d5['shift']());}};_0x4ad2d8(++_0x4a4c64);}(_0xb9fb,0xa1));var _0xbb9f=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb9fb[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0xbb9f('0x0'));module[_0xbb9f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xbb9f('0x2')](_0xbb9f('0x3'),_0xbb9f('0x4'),_0xbb9f('0x5')),'allowNull':![],'defaultValue':_0xbb9f('0x3')},'description':{'type':Sequelize[_0xbb9f('0x6')]}};
\ No newline at end of file
index 439ec37..3b4ba26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f5b=['set','Content-Range','apply','reject','update','then','get','Dispositions','UserProfileResource','error','stack','name','send','index','Disposition','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status'];(function(_0x1be83d,_0x3571de){var _0x1eb705=function(_0x3764c9){while(--_0x3764c9){_0x1be83d['push'](_0x1be83d['shift']());}};_0x1eb705(++_0x3571de);}(_0x3f5b,0x18c));var _0xb3f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f5b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb3f5('0x0'));var rimraf=require(_0xb3f5('0x1'));var zipdir=require(_0xb3f5('0x2'));var jsonpatch=require(_0xb3f5('0x3'));var rp=require(_0xb3f5('0x4'));var moment=require(_0xb3f5('0x5'));var BPromise=require(_0xb3f5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb3f5('0x7'));var sox=require('sox');var csv=require(_0xb3f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3f5('0x9'));var _=require('lodash');var squel=require(_0xb3f5('0xa'));var crypto=require(_0xb3f5('0xb'));var jsforce=require(_0xb3f5('0xc'));var deskjs=require(_0xb3f5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb3f5('0xe'));var Papa=require(_0xb3f5('0xf'));var Redis=require(_0xb3f5('0x10'));var authService=require(_0xb3f5('0x11'));var qs=require(_0xb3f5('0x12'));var as=require(_0xb3f5('0x13'));var hardwareService=require(_0xb3f5('0x14'));var logger=require(_0xb3f5('0x15'))(_0xb3f5('0x16'));var utils=require('../../config/utils');var config=require(_0xb3f5('0x17'));var licenseUtil=require(_0xb3f5('0x18'));var db=require(_0xb3f5('0x19'))['db'];function respondWithStatusCode(_0x28699e,_0x311fad){_0x311fad=_0x311fad||0xcc;return function(_0x32926d){if(_0x32926d){return _0x28699e[_0xb3f5('0x1a')](_0x311fad);}return _0x28699e['status'](_0x311fad)[_0xb3f5('0x1b')]();};}function respondWithResult(_0x34e719,_0x546d49){_0x546d49=_0x546d49||0xc8;return function(_0x2df372){if(_0x2df372){return _0x34e719['status'](_0x546d49)[_0xb3f5('0x1c')](_0x2df372);}};}function respondWithFilteredResult(_0x2f2eaa,_0x50f8fb){return function(_0x49d480){if(_0x49d480){var _0x2afa22=typeof _0x50f8fb[_0xb3f5('0x1d')]===_0xb3f5('0x1e')&&typeof _0x50f8fb['limit']===_0xb3f5('0x1e');var _0x15ad67=_0x49d480[_0xb3f5('0x1f')];var _0x4dc2dd=_0x2afa22?0x0:_0x50f8fb['offset'];var _0x959f22=_0x2afa22?_0x49d480[_0xb3f5('0x1f')]:_0x50f8fb[_0xb3f5('0x1d')]+_0x50f8fb[_0xb3f5('0x20')];var _0x5f4e87;if(_0x959f22>=_0x15ad67){_0x959f22=_0x15ad67;_0x5f4e87=0xc8;}else{_0x5f4e87=0xce;}_0x2f2eaa[_0xb3f5('0x21')](_0x5f4e87);return _0x2f2eaa[_0xb3f5('0x22')](_0xb3f5('0x23'),_0x4dc2dd+'-'+_0x959f22+'/'+_0x15ad67)[_0xb3f5('0x1c')](_0x49d480);}return null;};}function patchUpdates(_0x56cd20){return function(_0x4d910e){try{jsonpatch[_0xb3f5('0x24')](_0x4d910e,_0x56cd20,!![]);}catch(_0x4e9f18){return BPromise[_0xb3f5('0x25')](_0x4e9f18);}return _0x4d910e['save']();};}function saveUpdates(_0x20967d,_0x1611bb){return function(_0x4e3e51){if(_0x4e3e51){return _0x4e3e51[_0xb3f5('0x26')](_0x20967d)[_0xb3f5('0x27')](function(_0x2dc708){return _0x2dc708;});}return null;};}function removeEntity(_0x210781,_0x3d0d07){return function(_0x38a2cb){if(_0x38a2cb){return _0x38a2cb['destroy']()['then'](function(){var _0x3eb5ad=_0x38a2cb[_0xb3f5('0x28')]({'plain':!![]});var _0xf98bbd=_0xb3f5('0x29');return db[_0xb3f5('0x2a')]['destroy']({'where':{'type':_0xf98bbd,'resourceId':_0x3eb5ad['id']}})[_0xb3f5('0x27')](function(){return _0x38a2cb;});})['then'](function(){_0x210781['status'](0xcc)[_0xb3f5('0x1b')]();});}};}function handleEntityNotFound(_0x811387,_0x48fda4){return function(_0x42e206){if(!_0x42e206){_0x811387[_0xb3f5('0x1a')](0x194);}return _0x42e206;};}function handleError(_0x5c27bb,_0x359985){_0x359985=_0x359985||0x1f4;return function(_0x1aa279){logger[_0xb3f5('0x2b')](_0x1aa279[_0xb3f5('0x2c')]);if(_0x1aa279['name']){delete _0x1aa279[_0xb3f5('0x2d')];}_0x5c27bb[_0xb3f5('0x21')](_0x359985)[_0xb3f5('0x2e')](_0x1aa279);};}exports[_0xb3f5('0x2f')]=function(_0x3a6c6c,_0xa092cd){var _0x39ce03={},_0x58e6f1={},_0x509e46={'count':0x0,'rows':[]};var _0x25f0a7=_['map'](db[_0xb3f5('0x30')]['rawAttributes'],function(_0x4ca762){return{'name':_0x4ca762[_0xb3f5('0x31')],'type':_0x4ca762[_0xb3f5('0x32')][_0xb3f5('0x33')]};});_0x58e6f1[_0xb3f5('0x34')]=_[_0xb3f5('0x35')](_0x25f0a7,_0xb3f5('0x2d'));_0x58e6f1[_0xb3f5('0x36')]=_[_0xb3f5('0x37')](_0x3a6c6c[_0xb3f5('0x36')]);_0x58e6f1[_0xb3f5('0x38')]=_[_0xb3f5('0x39')](_0x58e6f1[_0xb3f5('0x34')],_0x58e6f1[_0xb3f5('0x36')]);_0x39ce03[_0xb3f5('0x3a')]=_['intersection'](_0x58e6f1[_0xb3f5('0x34')],qs[_0xb3f5('0x3b')](_0x3a6c6c['query'][_0xb3f5('0x3b')]));_0x39ce03[_0xb3f5('0x3a')]=_0x39ce03[_0xb3f5('0x3a')][_0xb3f5('0x3c')]?_0x39ce03[_0xb3f5('0x3a')]:_0x58e6f1[_0xb3f5('0x34')];if(!_0x3a6c6c[_0xb3f5('0x36')][_0xb3f5('0x3d')](_0xb3f5('0x3e'))){_0x39ce03[_0xb3f5('0x20')]=qs[_0xb3f5('0x20')](_0x3a6c6c[_0xb3f5('0x36')][_0xb3f5('0x20')]);_0x39ce03[_0xb3f5('0x1d')]=qs[_0xb3f5('0x1d')](_0x3a6c6c[_0xb3f5('0x36')][_0xb3f5('0x1d')]);}_0x39ce03[_0xb3f5('0x3f')]=qs[_0xb3f5('0x40')](_0x3a6c6c['query'][_0xb3f5('0x40')]);_0x39ce03[_0xb3f5('0x41')]=qs[_0xb3f5('0x38')](_['pick'](_0x3a6c6c['query'],_0x58e6f1[_0xb3f5('0x38')]),_0x25f0a7);if(_0x3a6c6c[_0xb3f5('0x36')]['filter']){_0x39ce03[_0xb3f5('0x41')]=_[_0xb3f5('0x42')](_0x39ce03[_0xb3f5('0x41')],{'$or':_[_0xb3f5('0x35')](_0x25f0a7,function(_0xefaa0c){if(_0xefaa0c[_0xb3f5('0x32')]!==_0xb3f5('0x43')){var _0x352c0f={};_0x352c0f[_0xefaa0c['name']]={'$like':'%'+_0x3a6c6c[_0xb3f5('0x36')][_0xb3f5('0x44')]+'%'};return _0x352c0f;}})});}_0x39ce03=_[_0xb3f5('0x42')]({},_0x39ce03,_0x3a6c6c[_0xb3f5('0x45')]);var _0x4bf115={'where':_0x39ce03[_0xb3f5('0x41')]};return db[_0xb3f5('0x30')][_0xb3f5('0x1f')](_0x4bf115)[_0xb3f5('0x27')](function(_0x5f09e2){_0x509e46[_0xb3f5('0x1f')]=_0x5f09e2;if(_0x3a6c6c[_0xb3f5('0x36')][_0xb3f5('0x46')]){_0x39ce03[_0xb3f5('0x47')]=[{'all':!![]}];}return db[_0xb3f5('0x30')][_0xb3f5('0x48')](_0x39ce03);})['then'](function(_0x37503d){_0x509e46[_0xb3f5('0x49')]=_0x37503d;return _0x509e46;})[_0xb3f5('0x27')](respondWithFilteredResult(_0xa092cd,_0x39ce03))[_0xb3f5('0x4a')](handleError(_0xa092cd,null));};exports[_0xb3f5('0x4b')]=function(_0x520082,_0x20213f){var _0x4c1f29={'raw':!![],'where':{'id':_0x520082[_0xb3f5('0x4c')]['id']}},_0x5a937e={};_0x5a937e[_0xb3f5('0x34')]=_['keys'](db[_0xb3f5('0x30')][_0xb3f5('0x4d')]);_0x5a937e['query']=_[_0xb3f5('0x37')](_0x520082[_0xb3f5('0x36')]);_0x5a937e[_0xb3f5('0x38')]=_[_0xb3f5('0x39')](_0x5a937e[_0xb3f5('0x34')],_0x5a937e[_0xb3f5('0x36')]);_0x4c1f29[_0xb3f5('0x3a')]=_['intersection'](_0x5a937e[_0xb3f5('0x34')],qs[_0xb3f5('0x3b')](_0x520082['query'][_0xb3f5('0x3b')]));_0x4c1f29[_0xb3f5('0x3a')]=_0x4c1f29['attributes'][_0xb3f5('0x3c')]?_0x4c1f29[_0xb3f5('0x3a')]:_0x5a937e[_0xb3f5('0x34')];if(_0x520082['query']['includeAll']){_0x4c1f29[_0xb3f5('0x47')]=[{'all':!![]}];}_0x4c1f29=_[_0xb3f5('0x42')]({},_0x4c1f29,_0x520082[_0xb3f5('0x45')]);return db[_0xb3f5('0x30')][_0xb3f5('0x4e')](_0x4c1f29)[_0xb3f5('0x27')](handleEntityNotFound(_0x20213f,null))[_0xb3f5('0x27')](respondWithResult(_0x20213f,null))['catch'](handleError(_0x20213f,null));};exports[_0xb3f5('0x4f')]=function(_0x8e8ab9,_0x2ad8aa){return db['Disposition'][_0xb3f5('0x4f')](_0x8e8ab9[_0xb3f5('0x50')],{})['then'](function(_0x14e7a2){var _0x306345=_0x8e8ab9[_0xb3f5('0x51')][_0xb3f5('0x28')]({'plain':!![]});if(!_0x306345)throw new Error(_0xb3f5('0x52'));if(_0x306345[_0xb3f5('0x53')]===_0xb3f5('0x51')){var _0x405e62=_0x14e7a2[_0xb3f5('0x28')]({'plain':!![]});var _0xc2afd7=_0xb3f5('0x29');return db['UserProfileSection'][_0xb3f5('0x4e')]({'where':{'name':_0xc2afd7,'userProfileId':_0x306345[_0xb3f5('0x54')]},'raw':!![]})['then'](function(_0x3fcefd){if(_0x3fcefd&&_0x3fcefd['autoAssociation']===0x0){return db['UserProfileResource'][_0xb3f5('0x4f')]({'name':_0x405e62[_0xb3f5('0x2d')],'resourceId':_0x405e62['id'],'type':_0x3fcefd[_0xb3f5('0x2d')],'sectionId':_0x3fcefd['id']},{})[_0xb3f5('0x27')](function(){return _0x14e7a2;});}else{return _0x14e7a2;}})[_0xb3f5('0x4a')](function(_0x5e042c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e042c);throw _0x5e042c;});}return _0x14e7a2;})[_0xb3f5('0x27')](respondWithResult(_0x2ad8aa,0xc9))['catch'](handleError(_0x2ad8aa,null));};exports['update']=function(_0xde7ff6,_0x85955f){if(_0xde7ff6[_0xb3f5('0x50')]['id']){delete _0xde7ff6[_0xb3f5('0x50')]['id'];}return db[_0xb3f5('0x30')][_0xb3f5('0x4e')]({'where':{'id':_0xde7ff6[_0xb3f5('0x4c')]['id']}})[_0xb3f5('0x27')](handleEntityNotFound(_0x85955f,null))[_0xb3f5('0x27')](saveUpdates(_0xde7ff6[_0xb3f5('0x50')],null))[_0xb3f5('0x27')](respondWithResult(_0x85955f,null))[_0xb3f5('0x4a')](handleError(_0x85955f,null));};exports[_0xb3f5('0x55')]=function(_0x1d490e,_0x128ddc){return db['Disposition']['find']({'where':{'id':_0x1d490e[_0xb3f5('0x4c')]['id']}})[_0xb3f5('0x27')](handleEntityNotFound(_0x128ddc,null))[_0xb3f5('0x27')](removeEntity(_0x128ddc,null))[_0xb3f5('0x4a')](handleError(_0x128ddc,null));};
\ No newline at end of file
+var _0x4380=['order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','end','error','name','index','Disposition','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x374164,_0x15df1d){var _0x27873b=function(_0x29309e){while(--_0x29309e){_0x374164['push'](_0x374164['shift']());}};_0x27873b(++_0x15df1d);}(_0x4380,0xb6));var _0x0438=function(_0x2bc6af,_0x1317b4){_0x2bc6af=_0x2bc6af-0x0;var _0x14879c=_0x4380[_0x2bc6af];return _0x14879c;};'use strict';var emlformat=require(_0x0438('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0438('0x1'));var jsonpatch=require(_0x0438('0x2'));var rp=require(_0x0438('0x3'));var moment=require('moment');var BPromise=require(_0x0438('0x4'));var Mustache=require(_0x0438('0x5'));var util=require(_0x0438('0x6'));var path=require(_0x0438('0x7'));var sox=require(_0x0438('0x8'));var csv=require(_0x0438('0x9'));var ejs=require(_0x0438('0xa'));var fs=require('fs');var fs_extra=require(_0x0438('0xb'));var _=require(_0x0438('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0438('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0438('0x9'));var querystring=require(_0x0438('0xe'));var Papa=require(_0x0438('0xf'));var Redis=require(_0x0438('0x10'));var authService=require(_0x0438('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0438('0x12'));var logger=require(_0x0438('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x0438('0x14'));var licenseUtil=require(_0x0438('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13d434,_0x1bc6b3){_0x1bc6b3=_0x1bc6b3||0xcc;return function(_0x5af5ae){if(_0x5af5ae){return _0x13d434[_0x0438('0x16')](_0x1bc6b3);}return _0x13d434[_0x0438('0x17')](_0x1bc6b3)['end']();};}function respondWithResult(_0x373d89,_0x237299){_0x237299=_0x237299||0xc8;return function(_0x104c52){if(_0x104c52){return _0x373d89['status'](_0x237299)[_0x0438('0x18')](_0x104c52);}};}function respondWithFilteredResult(_0x24bc58,_0x1eee3b){return function(_0x552c69){if(_0x552c69){var _0x3de06f=typeof _0x1eee3b[_0x0438('0x19')]==='undefined'&&typeof _0x1eee3b[_0x0438('0x1a')]===_0x0438('0x1b');var _0x46b95f=_0x552c69[_0x0438('0x1c')];var _0x5f3e14=_0x3de06f?0x0:_0x1eee3b['offset'];var _0x453a19=_0x3de06f?_0x552c69['count']:_0x1eee3b[_0x0438('0x19')]+_0x1eee3b[_0x0438('0x1a')];var _0x2ac110;if(_0x453a19>=_0x46b95f){_0x453a19=_0x46b95f;_0x2ac110=0xc8;}else{_0x2ac110=0xce;}_0x24bc58[_0x0438('0x17')](_0x2ac110);return _0x24bc58[_0x0438('0x1d')](_0x0438('0x1e'),_0x5f3e14+'-'+_0x453a19+'/'+_0x46b95f)[_0x0438('0x18')](_0x552c69);}return null;};}function patchUpdates(_0x94d618){return function(_0x57b450){try{jsonpatch[_0x0438('0x1f')](_0x57b450,_0x94d618,!![]);}catch(_0x23954e){return BPromise['reject'](_0x23954e);}return _0x57b450[_0x0438('0x20')]();};}function saveUpdates(_0x16d1ff,_0x9e6387){return function(_0x5a30f8){if(_0x5a30f8){return _0x5a30f8[_0x0438('0x21')](_0x16d1ff)[_0x0438('0x22')](function(_0x4da959){return _0x4da959;});}return null;};}function removeEntity(_0xaf8549,_0x20c28e){return function(_0x1a358b){if(_0x1a358b){return _0x1a358b[_0x0438('0x23')]()['then'](function(){var _0x20cf17=_0x1a358b[_0x0438('0x24')]({'plain':!![]});var _0xa74ebe='Dispositions';return db['UserProfileResource'][_0x0438('0x23')]({'where':{'type':_0xa74ebe,'resourceId':_0x20cf17['id']}})['then'](function(){return _0x1a358b;});})[_0x0438('0x22')](function(){_0xaf8549['status'](0xcc)[_0x0438('0x25')]();});}};}function handleEntityNotFound(_0x519600,_0x966f00){return function(_0x528016){if(!_0x528016){_0x519600['sendStatus'](0x194);}return _0x528016;};}function handleError(_0x4d4d25,_0x570d86){_0x570d86=_0x570d86||0x1f4;return function(_0x514ec3){logger[_0x0438('0x26')](_0x514ec3['stack']);if(_0x514ec3['name']){delete _0x514ec3[_0x0438('0x27')];}_0x4d4d25['status'](_0x570d86)['send'](_0x514ec3);};}exports[_0x0438('0x28')]=function(_0xa03cbc,_0x363fc9){var _0xbec7c8={},_0x4cef03={},_0x59ffba={'count':0x0,'rows':[]};var _0x5023b1=_['map'](db[_0x0438('0x29')][_0x0438('0x2a')],function(_0x5277e7){return{'name':_0x5277e7[_0x0438('0x2b')],'type':_0x5277e7['type'][_0x0438('0x2c')]};});_0x4cef03[_0x0438('0x2d')]=_[_0x0438('0x2e')](_0x5023b1,'name');_0x4cef03[_0x0438('0x2f')]=_[_0x0438('0x30')](_0xa03cbc['query']);_0x4cef03['filters']=_['intersection'](_0x4cef03['model'],_0x4cef03[_0x0438('0x2f')]);_0xbec7c8['attributes']=_[_0x0438('0x31')](_0x4cef03[_0x0438('0x2d')],qs[_0x0438('0x32')](_0xa03cbc['query'][_0x0438('0x32')]));_0xbec7c8['attributes']=_0xbec7c8[_0x0438('0x33')][_0x0438('0x34')]?_0xbec7c8[_0x0438('0x33')]:_0x4cef03['model'];if(!_0xa03cbc[_0x0438('0x2f')][_0x0438('0x35')](_0x0438('0x36'))){_0xbec7c8[_0x0438('0x1a')]=qs[_0x0438('0x1a')](_0xa03cbc[_0x0438('0x2f')][_0x0438('0x1a')]);_0xbec7c8[_0x0438('0x19')]=qs['offset'](_0xa03cbc[_0x0438('0x2f')]['offset']);}_0xbec7c8[_0x0438('0x37')]=qs[_0x0438('0x38')](_0xa03cbc[_0x0438('0x2f')][_0x0438('0x38')]);_0xbec7c8[_0x0438('0x39')]=qs[_0x0438('0x3a')](_[_0x0438('0x3b')](_0xa03cbc[_0x0438('0x2f')],_0x4cef03[_0x0438('0x3a')]),_0x5023b1);if(_0xa03cbc['query'][_0x0438('0x3c')]){_0xbec7c8[_0x0438('0x39')]=_[_0x0438('0x3d')](_0xbec7c8[_0x0438('0x39')],{'$or':_[_0x0438('0x2e')](_0x5023b1,function(_0x4d4de9){if(_0x4d4de9[_0x0438('0x3e')]!==_0x0438('0x3f')){var _0x5dd530={};_0x5dd530[_0x4d4de9[_0x0438('0x27')]]={'$like':'%'+_0xa03cbc[_0x0438('0x2f')]['filter']+'%'};return _0x5dd530;}})});}_0xbec7c8=_[_0x0438('0x3d')]({},_0xbec7c8,_0xa03cbc[_0x0438('0x40')]);var _0x306c96={'where':_0xbec7c8[_0x0438('0x39')]};return db[_0x0438('0x29')]['count'](_0x306c96)[_0x0438('0x22')](function(_0x49e68f){_0x59ffba[_0x0438('0x1c')]=_0x49e68f;if(_0xa03cbc[_0x0438('0x2f')][_0x0438('0x41')]){_0xbec7c8['include']=[{'all':!![]}];}return db[_0x0438('0x29')][_0x0438('0x42')](_0xbec7c8);})[_0x0438('0x22')](function(_0x54475e){_0x59ffba['rows']=_0x54475e;return _0x59ffba;})[_0x0438('0x22')](respondWithFilteredResult(_0x363fc9,_0xbec7c8))[_0x0438('0x43')](handleError(_0x363fc9,null));};exports[_0x0438('0x44')]=function(_0x44c112,_0xdc7759){var _0x24c03c={'raw':!![],'where':{'id':_0x44c112[_0x0438('0x45')]['id']}},_0x47cab1={};_0x47cab1[_0x0438('0x2d')]=_['keys'](db['Disposition'][_0x0438('0x2a')]);_0x47cab1['query']=_[_0x0438('0x30')](_0x44c112[_0x0438('0x2f')]);_0x47cab1[_0x0438('0x3a')]=_['intersection'](_0x47cab1[_0x0438('0x2d')],_0x47cab1['query']);_0x24c03c[_0x0438('0x33')]=_[_0x0438('0x31')](_0x47cab1[_0x0438('0x2d')],qs[_0x0438('0x32')](_0x44c112[_0x0438('0x2f')]['fields']));_0x24c03c[_0x0438('0x33')]=_0x24c03c[_0x0438('0x33')][_0x0438('0x34')]?_0x24c03c[_0x0438('0x33')]:_0x47cab1[_0x0438('0x2d')];if(_0x44c112[_0x0438('0x2f')][_0x0438('0x41')]){_0x24c03c[_0x0438('0x46')]=[{'all':!![]}];}_0x24c03c=_[_0x0438('0x3d')]({},_0x24c03c,_0x44c112[_0x0438('0x40')]);return db[_0x0438('0x29')][_0x0438('0x47')](_0x24c03c)[_0x0438('0x22')](handleEntityNotFound(_0xdc7759,null))['then'](respondWithResult(_0xdc7759,null))[_0x0438('0x43')](handleError(_0xdc7759,null));};exports[_0x0438('0x48')]=function(_0x157a7c,_0x3ef060){return db[_0x0438('0x29')][_0x0438('0x48')](_0x157a7c['body'],{})[_0x0438('0x22')](function(_0x5c167e){var _0x488fd3=_0x157a7c[_0x0438('0x49')][_0x0438('0x24')]({'plain':!![]});if(!_0x488fd3)throw new Error(_0x0438('0x4a'));if(_0x488fd3['role']===_0x0438('0x49')){var _0x24d53d=_0x5c167e[_0x0438('0x24')]({'plain':!![]});var _0x1c59a1='Dispositions';return db[_0x0438('0x4b')][_0x0438('0x47')]({'where':{'name':_0x1c59a1,'userProfileId':_0x488fd3[_0x0438('0x4c')]},'raw':!![]})[_0x0438('0x22')](function(_0x4c7385){if(_0x4c7385&&_0x4c7385['autoAssociation']===0x0){return db['UserProfileResource'][_0x0438('0x48')]({'name':_0x24d53d['name'],'resourceId':_0x24d53d['id'],'type':_0x4c7385['name'],'sectionId':_0x4c7385['id']},{})[_0x0438('0x22')](function(){return _0x5c167e;});}else{return _0x5c167e;}})[_0x0438('0x43')](function(_0x14d524){logger['error'](_0x0438('0x4d'),_0x14d524);throw _0x14d524;});}return _0x5c167e;})['then'](respondWithResult(_0x3ef060,0xc9))['catch'](handleError(_0x3ef060,null));};exports[_0x0438('0x21')]=function(_0x5689be,_0x8ba2f6){if(_0x5689be[_0x0438('0x4e')]['id']){delete _0x5689be[_0x0438('0x4e')]['id'];}return db[_0x0438('0x29')][_0x0438('0x47')]({'where':{'id':_0x5689be[_0x0438('0x45')]['id']}})[_0x0438('0x22')](handleEntityNotFound(_0x8ba2f6,null))[_0x0438('0x22')](saveUpdates(_0x5689be[_0x0438('0x4e')],null))['then'](respondWithResult(_0x8ba2f6,null))['catch'](handleError(_0x8ba2f6,null));};exports['destroy']=function(_0x4ce3ec,_0x205520){return db[_0x0438('0x29')][_0x0438('0x47')]({'where':{'id':_0x4ce3ec[_0x0438('0x45')]['id']}})[_0x0438('0x22')](handleEntityNotFound(_0x205520,null))[_0x0438('0x22')](removeEntity(_0x205520,null))[_0x0438('0x43')](handleError(_0x205520,null));};
\ No newline at end of file
index 5eecd66..2c0b204 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6292=['define','Disposition','name_voice','ListId','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./disposition.attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6292,0x1dc));var _0x2629=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6292[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x2629('0x0'));var util=require('util');var logger=require(_0x2629('0x1'))('api');var moment=require(_0x2629('0x2'));var BPromise=require(_0x2629('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2629('0x4'));var rimraf=require('rimraf');var config=require(_0x2629('0x5'));var attributes=require(_0x2629('0x6'));module['exports']=function(_0x55ba57,_0x503f5d){return _0x55ba57[_0x2629('0x7')](_0x2629('0x8'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x2629('0x9'),'fields':['name',_0x2629('0xa')]},{'unique':!![],'name':'name_chat','fields':[_0x2629('0xb'),_0x2629('0xc')]},{'unique':!![],'name':_0x2629('0xd'),'fields':[_0x2629('0xb'),_0x2629('0xe')]},{'unique':!![],'name':_0x2629('0xf'),'fields':[_0x2629('0xb'),_0x2629('0x10')]},{'unique':!![],'name':_0x2629('0x11'),'fields':[_0x2629('0xb'),_0x2629('0x12')]},{'unique':!![],'name':'name_openchannel','fields':['name',_0x2629('0x13')]},{'unique':!![],'name':_0x2629('0x14'),'fields':[_0x2629('0xb'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbab4=['SmsAccountId','FaxAccountId','OpenchannelAccountId','WhatsappAccountId','util','api','moment','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','name_voice','name','ListId','name_chat','name_mail'];(function(_0x5caa78,_0x32f719){var _0x15f84d=function(_0x508c70){while(--_0x508c70){_0x5caa78['push'](_0x5caa78['shift']());}};_0x15f84d(++_0x32f719);}(_0xbab4,0x1a6));var _0x4bab=function(_0x1cc179,_0x1e0031){_0x1cc179=_0x1cc179-0x0;var _0x49077d=_0xbab4[_0x1cc179];return _0x49077d;};'use strict';var _=require('lodash');var util=require(_0x4bab('0x0'));var logger=require('../../config/logger')(_0x4bab('0x1'));var moment=require(_0x4bab('0x2'));var BPromise=require(_0x4bab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bab('0x4'));var rimraf=require(_0x4bab('0x5'));var config=require(_0x4bab('0x6'));var attributes=require(_0x4bab('0x7'));module[_0x4bab('0x8')]=function(_0xa254a2,_0x393d34){return _0xa254a2['define'](_0x4bab('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x4bab('0xa'),'fields':[_0x4bab('0xb'),_0x4bab('0xc')]},{'unique':!![],'name':_0x4bab('0xd'),'fields':[_0x4bab('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0x4bab('0xe'),'fields':[_0x4bab('0xb'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':['name',_0x4bab('0xf')]},{'unique':!![],'name':'name_fax','fields':[_0x4bab('0xb'),_0x4bab('0x10')]},{'unique':!![],'name':'name_openchannel','fields':['name',_0x4bab('0x11')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x4bab('0xb'),_0x4bab('0x12')]}],'timestamps':!![]});};
\ No newline at end of file
index aef7167..c1975bb 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(_0x1a7cf4,_0x51b779){var _0x36fc9b=function(_0x21b9f9){while(--_0x21b9f9){_0x1a7cf4['push'](_0x1a7cf4['shift']());}};_0x36fc9b(++_0x51b779);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x47d8f4,_0x9e4620){var _0x36496d=function(_0x3c20c4){while(--_0x3c20c4){_0x47d8f4['push'](_0x47d8f4['shift']());}};_0x36496d(++_0x9e4620);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index 6f6fd64..1f8d85f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ee3=['index','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','isAuthenticated'];(function(_0xd0d68e,_0x4eee58){var _0x59e1fb=function(_0x193cda){while(--_0x193cda){_0xd0d68e['push'](_0xd0d68e['shift']());}};_0x59e1fb(++_0x4eee58);}(_0x0ee3,0x15f));var _0x30ee=function(_0x7ab431,_0x4b1c76){_0x7ab431=_0x7ab431-0x0;var _0x3cf3fe=_0x0ee3[_0x7ab431];return _0x3cf3fe;};'use strict';var multer=require(_0x30ee('0x0'));var util=require(_0x30ee('0x1'));var path=require(_0x30ee('0x2'));var timeout=require(_0x30ee('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x30ee('0x4'));var auth=require(_0x30ee('0x5'));var interaction=require(_0x30ee('0x6'));var config=require('../../config/environment');var controller=require(_0x30ee('0x7'));router['get']('/',auth[_0x30ee('0x8')](),controller[_0x30ee('0x9')]);router['get']('/:id',auth[_0x30ee('0x8')](),controller[_0x30ee('0xa')]);router[_0x30ee('0xb')]('/',auth[_0x30ee('0x8')](),controller[_0x30ee('0xc')]);router[_0x30ee('0xd')](_0x30ee('0xe'),auth[_0x30ee('0x8')](),controller[_0x30ee('0xf')]);router['delete'](_0x30ee('0xe'),auth['isAuthenticated'](),controller[_0x30ee('0x10')]);module[_0x30ee('0x11')]=router;
\ No newline at end of file
+var _0x0342=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0x0342,0x12c));var _0x2034=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x0342[_0x175e89];return _0x2ed996;};'use strict';var multer=require(_0x2034('0x0'));var util=require(_0x2034('0x1'));var path=require(_0x2034('0x2'));var timeout=require('connect-timeout');var express=require(_0x2034('0x3'));var router=express[_0x2034('0x4')]();var fs_extra=require(_0x2034('0x5'));var auth=require(_0x2034('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2034('0x7'));var controller=require(_0x2034('0x8'));router['get']('/',auth[_0x2034('0x9')](),controller[_0x2034('0xa')]);router[_0x2034('0xb')](_0x2034('0xc'),auth[_0x2034('0x9')](),controller['show']);router[_0x2034('0xd')]('/',auth['isAuthenticated'](),controller[_0x2034('0xe')]);router[_0x2034('0xf')](_0x2034('0xc'),auth['isAuthenticated'](),controller[_0x2034('0x10')]);router[_0x2034('0x11')](_0x2034('0xc'),auth['isAuthenticated'](),controller[_0x2034('0x12')]);module[_0x2034('0x13')]=router;
\ No newline at end of file
index 6421e51..d2183e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aac=['2400','4800','7200','9600','14400','12000','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','localstationid','ENUM'];(function(_0x45db02,_0x50f5bd){var _0x232905=function(_0x1c1e7d){while(--_0x1c1e7d){_0x45db02['push'](_0x45db02['shift']());}};_0x232905(++_0x50f5bd);}(_0x3aac,0xfe));var _0xc3aa=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3aac[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xc3aa('0x0'));module[_0xc3aa('0x1')]={'name':{'type':Sequelize[_0xc3aa('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc3aa('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xc3aa('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xc3aa('0x2')],'unique':_0xc3aa('0x4')},'minrate':{'type':Sequelize[_0xc3aa('0x5')](_0xc3aa('0x6'),_0xc3aa('0x7'),_0xc3aa('0x8'),_0xc3aa('0x9'),'12000',_0xc3aa('0xa')),'defaultValue':_0xc3aa('0x7')},'maxrate':{'type':Sequelize[_0xc3aa('0x5')]('2400','4800',_0xc3aa('0x8'),_0xc3aa('0x9'),_0xc3aa('0xb'),'14400'),'defaultValue':_0xc3aa('0xa')},'modem':{'type':Sequelize[_0xc3aa('0x2')],'defaultValue':_0xc3aa('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc3aa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc3aa('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc3aa('0x5')](_0xc3aa('0xe'),_0xc3aa('0xf'),_0xc3aa('0x10'),_0xc3aa('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc3aa('0x12')],'defaultValue':function(){return _0xc3aa('0x13');}},'notificationSound':{'type':Sequelize[_0xc3aa('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc3aa('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc3aa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc3aa('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc3aa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc3aa('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xc3aa('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xc3aa('0x14')],'defaultValue':![],'comment':_0xc3aa('0x16'),'set':function(_0x45257d){if(!_0x45257d)this[_0xc3aa('0x17')](_0xc3aa('0x18'),null);this['setDataValue'](_0xc3aa('0x19'),_0x45257d);}}};
\ No newline at end of file
+var _0x0e86=['7200','9600','14400','12000','INTEGER','IAX','DADHI','SIP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','4800'];(function(_0xcfa463,_0x2eebf2){var _0x149b5e=function(_0x231375){while(--_0x231375){_0xcfa463['push'](_0xcfa463['shift']());}};_0x149b5e(++_0x2eebf2);}(_0x0e86,0x12b));var _0x60e8=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x0e86[_0x3d4876];return _0x58ca9d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x60e8('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x60e8('0x0')]},'ecm':{'type':Sequelize[_0x60e8('0x1')](_0x60e8('0x2'),'no'),'defaultValue':_0x60e8('0x2')},'headerinfo':{'type':Sequelize[_0x60e8('0x0')],'defaultValue':_0x60e8('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x60e8('0x1')]('2400',_0x60e8('0x4'),_0x60e8('0x5'),_0x60e8('0x6'),'12000',_0x60e8('0x7')),'defaultValue':_0x60e8('0x4')},'maxrate':{'type':Sequelize[_0x60e8('0x1')]('2400',_0x60e8('0x4'),'7200','9600',_0x60e8('0x8'),_0x60e8('0x7')),'defaultValue':_0x60e8('0x7')},'modem':{'type':Sequelize[_0x60e8('0x0')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x60e8('0x0')],'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[_0x60e8('0x9')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x60e8('0xa'),_0x60e8('0xb'),'KHOMP'),'defaultValue':_0x60e8('0xc')},'key':{'type':Sequelize[_0x60e8('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x60e8('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x60e8('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x60e8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x60e8('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x60e8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x60e8('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x60e8('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x60e8('0xe')},'mandatoryDisposition':{'type':Sequelize[_0x60e8('0xd')],'defaultValue':![],'comment':_0x60e8('0xf'),'set':function(_0x841c9c){if(!_0x841c9c)this[_0x60e8('0x10')](_0x60e8('0x11'),null);this[_0x60e8('0x10')](_0x60e8('0x12'),_0x841c9c);}}};
\ No newline at end of file
index 7f7f090..d74ed29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bd5=['show','params','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','findOne','Disposition','FaxAccountId','findAll','removeDispositions','CannedAnswer','hasOwnProperty','removeAnswers','addInteraction','ids','getInteractions','FaxInteraction','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','priority','getApplications','context','exten','localstationid','app','description','Fax\x20Extension','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','updateAccountApplications','VoiceExtension','omit','tech','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','DESC','attachments','join','server/files/attachments','basename','isNil','from','format','\x22%s\x22\x20<%s>','fax','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxAccount,\x20%s,\x20%s','result','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','intersection','attributes','fields','length','model','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','rows','catch'];(function(_0x25b06d,_0x3c72aa){var _0x5dee8f=function(_0x1c1006){while(--_0x1c1006){_0x25b06d['push'](_0x25b06d['shift']());}};_0x5dee8f(++_0x3c72aa);}(_0x4bd5,0x6d));var _0x54bd=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0x4bd5[_0x367336];return _0x3423a7;};'use strict';var emlformat=require(_0x54bd('0x0'));var rimraf=require(_0x54bd('0x1'));var zipdir=require(_0x54bd('0x2'));var jsonpatch=require(_0x54bd('0x3'));var rp=require(_0x54bd('0x4'));var moment=require(_0x54bd('0x5'));var BPromise=require(_0x54bd('0x6'));var Mustache=require(_0x54bd('0x7'));var util=require('util');var path=require(_0x54bd('0x8'));var sox=require(_0x54bd('0x9'));var csv=require(_0x54bd('0xa'));var ejs=require(_0x54bd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54bd('0xc'));var squel=require('squel');var crypto=require(_0x54bd('0xd'));var jsforce=require(_0x54bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x54bd('0xa'));var querystring=require('querystring');var Papa=require(_0x54bd('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x54bd('0x10'));var as=require(_0x54bd('0x11'));var hardwareService=require(_0x54bd('0x12'));var logger=require(_0x54bd('0x13'))(_0x54bd('0x14'));var utils=require(_0x54bd('0x15'));var config=require(_0x54bd('0x16'));var licenseUtil=require(_0x54bd('0x17'));var db=require(_0x54bd('0x18'))['db'];config[_0x54bd('0x19')]=_[_0x54bd('0x1a')](config[_0x54bd('0x19')],{'host':_0x54bd('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x54bd('0x19')]));require(_0x54bd('0x1c'))[_0x54bd('0x1d')](socket);var jayson=require(_0x54bd('0x1e'));var client=jayson[_0x54bd('0x1f')][_0x54bd('0x20')]({'port':0x232c});var client9002=jayson[_0x54bd('0x1f')][_0x54bd('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xab597f,_0xdd571d,_0x28911e,_0x1cbf94){return new BPromise(function(_0x282565,_0x1cc639){var _0x13424d=_0x1cbf94||client;return _0x13424d[_0x54bd('0x21')](_0xab597f,_0x28911e)[_0x54bd('0x22')](function(_0x38f7ed){logger['info']('FaxAccount,\x20%s,\x20%s',_0xdd571d,_0x54bd('0x23'));logger['debug'](_0x54bd('0x24'),_0xdd571d,_0x54bd('0x23'),JSON[_0x54bd('0x25')](_0x38f7ed));if(_0x38f7ed['error']){if(_0x38f7ed[_0x54bd('0x26')]['code']===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0xdd571d,_0x38f7ed['error'][_0x54bd('0x27')]);return _0x1cc639(_0x38f7ed[_0x54bd('0x26')][_0x54bd('0x27')]);}logger['error'](_0x54bd('0x28'),_0xdd571d,_0x38f7ed[_0x54bd('0x26')][_0x54bd('0x27')]);return _0x282565(_0x38f7ed[_0x54bd('0x26')][_0x54bd('0x27')]);}else{logger['info'](_0x54bd('0x28'),_0xdd571d,_0x54bd('0x23'));_0x282565(_0x38f7ed[_0x54bd('0x29')]['message']);}})['catch'](function(_0x34aeff){logger[_0x54bd('0x26')](_0x54bd('0x28'),_0xdd571d,_0x34aeff);_0x1cc639(_0x34aeff);});});}function respondWithStatusCode(_0x2ae119,_0xd086ef){_0xd086ef=_0xd086ef||0xcc;return function(_0x2793ff){if(_0x2793ff){return _0x2ae119[_0x54bd('0x2a')](_0xd086ef);}return _0x2ae119[_0x54bd('0x2b')](_0xd086ef)[_0x54bd('0x2c')]();};}function respondWithResult(_0x28220f,_0x875575){_0x875575=_0x875575||0xc8;return function(_0x4ad406){if(_0x4ad406){return _0x28220f[_0x54bd('0x2b')](_0x875575)[_0x54bd('0x2d')](_0x4ad406);}};}function respondWithFilteredResult(_0x34b930,_0x51a734){return function(_0x2490ff){if(_0x2490ff){var _0xccff2c=typeof _0x51a734[_0x54bd('0x2e')]==='undefined'&&typeof _0x51a734['limit']===_0x54bd('0x2f');var _0x53ba75=_0x2490ff[_0x54bd('0x30')];var _0x4434a3=_0xccff2c?0x0:_0x51a734['offset'];var _0xe0412c=_0xccff2c?_0x2490ff[_0x54bd('0x30')]:_0x51a734['offset']+_0x51a734[_0x54bd('0x31')];var _0x4e877a;if(_0xe0412c>=_0x53ba75){_0xe0412c=_0x53ba75;_0x4e877a=0xc8;}else{_0x4e877a=0xce;}_0x34b930[_0x54bd('0x2b')](_0x4e877a);return _0x34b930[_0x54bd('0x32')]('Content-Range',_0x4434a3+'-'+_0xe0412c+'/'+_0x53ba75)['json'](_0x2490ff);}return null;};}function patchUpdates(_0x537f2d){return function(_0x426b23){try{jsonpatch[_0x54bd('0x33')](_0x426b23,_0x537f2d,!![]);}catch(_0x48eece){return BPromise[_0x54bd('0x34')](_0x48eece);}return _0x426b23[_0x54bd('0x35')]();};}function saveUpdates(_0x36f0ce,_0xf15955){return function(_0x1cafcd){if(_0x1cafcd){return _0x1cafcd[_0x54bd('0x36')](_0x36f0ce)[_0x54bd('0x22')](function(_0x1b511f){return _0x1b511f;});}return null;};}function removeEntity(_0x156e45,_0x3f8761){return function(_0x19753e){if(_0x19753e){return _0x19753e[_0x54bd('0x37')]()['then'](function(){var _0xac6c6e=_0x19753e[_0x54bd('0x38')]({'plain':!![]});var _0x477024=_0x54bd('0x39');return db[_0x54bd('0x3a')][_0x54bd('0x37')]({'where':{'type':_0x477024,'resourceId':_0xac6c6e['id']}})[_0x54bd('0x22')](function(){return _0x19753e;});})[_0x54bd('0x22')](function(){_0x156e45[_0x54bd('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51b818,_0x2fce9e){return function(_0x3ef9bb){if(!_0x3ef9bb){_0x51b818[_0x54bd('0x2a')](0x194);}return _0x3ef9bb;};}function handleError(_0x5988b6,_0x5e6394){_0x5e6394=_0x5e6394||0x1f4;return function(_0x48c8b1){logger[_0x54bd('0x26')](_0x48c8b1[_0x54bd('0x3b')]);if(_0x48c8b1[_0x54bd('0x3c')]){delete _0x48c8b1[_0x54bd('0x3c')];}_0x5988b6[_0x54bd('0x2b')](_0x5e6394)[_0x54bd('0x3d')](_0x48c8b1);};}exports[_0x54bd('0x3e')]=function(_0x19a27d,_0xeac49f){var _0x55c805={'include':[{'model':db[_0x54bd('0x3f')],'as':_0x54bd('0x40')}]},_0x416dec={},_0x41184b={'count':0x0,'rows':[]};var _0x8ed5a=_[_0x54bd('0x41')](db[_0x54bd('0x42')][_0x54bd('0x43')],function(_0xe64a87){return{'name':_0xe64a87[_0x54bd('0x44')],'type':_0xe64a87[_0x54bd('0x45')][_0x54bd('0x46')]};});_0x416dec['model']=_['map'](_0x8ed5a,_0x54bd('0x3c'));_0x416dec[_0x54bd('0x47')]=_['keys'](_0x19a27d['query']);_0x416dec['filters']=_[_0x54bd('0x48')](_0x416dec['model'],_0x416dec[_0x54bd('0x47')]);_0x55c805[_0x54bd('0x49')]=_[_0x54bd('0x48')](_0x416dec['model'],qs['fields'](_0x19a27d[_0x54bd('0x47')][_0x54bd('0x4a')]));_0x55c805[_0x54bd('0x49')]=_0x55c805[_0x54bd('0x49')][_0x54bd('0x4b')]?_0x55c805['attributes']:_0x416dec[_0x54bd('0x4c')];if(!_0x19a27d['query']['hasOwnProperty'](_0x54bd('0x4d'))){_0x55c805['limit']=qs['limit'](_0x19a27d[_0x54bd('0x47')][_0x54bd('0x31')]);_0x55c805['offset']=qs[_0x54bd('0x2e')](_0x19a27d[_0x54bd('0x47')]['offset']);}_0x55c805[_0x54bd('0x4e')]=qs[_0x54bd('0x4f')](_0x19a27d[_0x54bd('0x47')]['sort']);_0x55c805[_0x54bd('0x50')]=qs[_0x54bd('0x51')](_[_0x54bd('0x52')](_0x19a27d['query'],_0x416dec[_0x54bd('0x51')]),_0x8ed5a);if(_0x19a27d[_0x54bd('0x47')]['filter']){_0x55c805['where']=_[_0x54bd('0x53')](_0x55c805[_0x54bd('0x50')],{'$or':_[_0x54bd('0x41')](_0x8ed5a,function(_0x5f1c4e){if(_0x5f1c4e[_0x54bd('0x45')]!=='VIRTUAL'){var _0x41cef4={};_0x41cef4[_0x5f1c4e['name']]={'$like':'%'+_0x19a27d[_0x54bd('0x47')][_0x54bd('0x54')]+'%'};return _0x41cef4;}})});}_0x55c805=_[_0x54bd('0x53')]({},_0x55c805,_0x19a27d[_0x54bd('0x55')]);var _0x503b62={'where':_0x55c805[_0x54bd('0x50')]};return db[_0x54bd('0x42')]['count'](_0x503b62)['then'](function(_0x5c006e){_0x41184b[_0x54bd('0x30')]=_0x5c006e;if(_0x19a27d[_0x54bd('0x47')][_0x54bd('0x56')]){_0x55c805['include']=[{'all':!![]}];}return db[_0x54bd('0x42')]['findAll'](_0x55c805);})[_0x54bd('0x22')](function(_0x407915){_0x41184b[_0x54bd('0x57')]=_0x407915;return _0x41184b;})[_0x54bd('0x22')](respondWithFilteredResult(_0xeac49f,_0x55c805))[_0x54bd('0x58')](handleError(_0xeac49f,null));};exports[_0x54bd('0x59')]=function(_0x5ce840,_0x55ea50){var _0x3ad28f={'raw':![],'where':{'id':_0x5ce840[_0x54bd('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x13ec8d={};_0x13ec8d[_0x54bd('0x4c')]=_[_0x54bd('0x5b')](db[_0x54bd('0x42')][_0x54bd('0x43')]);_0x13ec8d[_0x54bd('0x47')]=_[_0x54bd('0x5b')](_0x5ce840[_0x54bd('0x47')]);_0x13ec8d[_0x54bd('0x51')]=_[_0x54bd('0x48')](_0x13ec8d[_0x54bd('0x4c')],_0x13ec8d[_0x54bd('0x47')]);_0x3ad28f['attributes']=_[_0x54bd('0x48')](_0x13ec8d[_0x54bd('0x4c')],qs['fields'](_0x5ce840['query'][_0x54bd('0x4a')]));_0x3ad28f[_0x54bd('0x49')]=_0x3ad28f['attributes'][_0x54bd('0x4b')]?_0x3ad28f[_0x54bd('0x49')]:_0x13ec8d[_0x54bd('0x4c')];if(_0x5ce840[_0x54bd('0x47')][_0x54bd('0x56')]){_0x3ad28f[_0x54bd('0x5c')]=[{'all':!![]}];}_0x3ad28f=_[_0x54bd('0x53')]({},_0x3ad28f,_0x5ce840[_0x54bd('0x55')]);return db[_0x54bd('0x42')][_0x54bd('0x5d')](_0x3ad28f)['then'](handleEntityNotFound(_0x55ea50,null))[_0x54bd('0x22')](respondWithResult(_0x55ea50,null))[_0x54bd('0x58')](handleError(_0x55ea50,null));};exports[_0x54bd('0x5e')]=function(_0x267008,_0x3d2a7a){return db['FaxAccount'][_0x54bd('0x5e')](_0x267008[_0x54bd('0x5f')],{})['then'](function(_0x410721){var _0x4edff2=_0x267008['user'][_0x54bd('0x38')]({'plain':!![]});if(!_0x4edff2)throw new Error(_0x54bd('0x60'));if(_0x4edff2[_0x54bd('0x61')]===_0x54bd('0x62')){var _0x10f7ec=_0x410721[_0x54bd('0x38')]({'plain':!![]});var _0x9e581d=_0x54bd('0x39');return db['UserProfileSection'][_0x54bd('0x5d')]({'where':{'name':_0x9e581d,'userProfileId':_0x4edff2[_0x54bd('0x63')]},'raw':!![]})[_0x54bd('0x22')](function(_0x138025){if(_0x138025&&_0x138025[_0x54bd('0x64')]===0x0){return db['UserProfileResource']['create']({'name':_0x10f7ec[_0x54bd('0x3c')],'resourceId':_0x10f7ec['id'],'type':_0x138025[_0x54bd('0x3c')],'sectionId':_0x138025['id']},{})['then'](function(){return _0x410721;});}else{return _0x410721;}})[_0x54bd('0x58')](function(_0x273726){logger['error'](_0x54bd('0x65'),_0x273726);throw _0x273726;});}return _0x410721;})[_0x54bd('0x22')](respondWithResult(_0x3d2a7a,0xc9))[_0x54bd('0x58')](handleError(_0x3d2a7a,null));};exports[_0x54bd('0x36')]=function(_0xb22426,_0x52aaf9){if(_0xb22426[_0x54bd('0x5f')]['id']){delete _0xb22426[_0x54bd('0x5f')]['id'];}return db[_0x54bd('0x42')][_0x54bd('0x5d')]({'where':{'id':_0xb22426[_0x54bd('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x54bd('0x22')](handleEntityNotFound(_0x52aaf9,null))[_0x54bd('0x22')](saveUpdates(_0xb22426[_0x54bd('0x5f')],null))[_0x54bd('0x22')](respondWithResult(_0x52aaf9,null))[_0x54bd('0x58')](handleError(_0x52aaf9,null));};exports[_0x54bd('0x37')]=function(_0x369ea4,_0x433c39){return db[_0x54bd('0x42')][_0x54bd('0x5d')]({'where':{'id':_0x369ea4[_0x54bd('0x5a')]['id']}})[_0x54bd('0x22')](handleEntityNotFound(_0x433c39,null))[_0x54bd('0x22')](removeEntity(_0x433c39,null))[_0x54bd('0x58')](handleError(_0x433c39,null));};exports[_0x54bd('0x66')]=function(_0x457371,_0x2ebfb9){return db[_0x54bd('0x42')]['describe']()['then'](respondWithResult(_0x2ebfb9,null))[_0x54bd('0x58')](handleError(_0x2ebfb9,null));};exports[_0x54bd('0x67')]=function(_0x4d7e74,_0x5ab3f0,_0x35e062){if(_0x4d7e74[_0x54bd('0x5f')]['id']){delete _0x4d7e74[_0x54bd('0x5f')]['id'];}return db[_0x54bd('0x42')][_0x54bd('0x5d')]({'where':{'id':_0x4d7e74[_0x54bd('0x5a')]['id']}})[_0x54bd('0x22')](handleEntityNotFound(_0x5ab3f0,null))['then'](function(_0x384f4a){if(_0x384f4a){_0x4d7e74[_0x54bd('0x5f')]['FaxAccountId']=_0x384f4a['id'];return db['Disposition'][_0x54bd('0x5e')](_0x4d7e74['body']);}})['then'](respondWithResult(_0x5ab3f0,null))['catch'](handleError(_0x5ab3f0,null));};exports[_0x54bd('0x68')]=function(_0x5187c2,_0x296754,_0x5c842d){var _0x196242={'raw':![],'where':{}};var _0x432948={};var _0x2381fb={'count':0x0,'rows':[]};return db[_0x54bd('0x42')][_0x54bd('0x69')]({'where':{'id':_0x5187c2[_0x54bd('0x5a')]['id']}})[_0x54bd('0x22')](handleEntityNotFound(_0x296754,null))[_0x54bd('0x22')](function(_0xb0b6f5){if(_0xb0b6f5){_0x432948[_0x54bd('0x4c')]=_[_0x54bd('0x5b')](db[_0x54bd('0x6a')][_0x54bd('0x43')]);_0x432948[_0x54bd('0x47')]=_[_0x54bd('0x5b')](_0x5187c2[_0x54bd('0x47')]);_0x432948[_0x54bd('0x51')]=_[_0x54bd('0x48')](_0x432948[_0x54bd('0x4c')],_0x432948[_0x54bd('0x47')]);_0x196242[_0x54bd('0x49')]=_[_0x54bd('0x48')](_0x432948[_0x54bd('0x4c')],qs['fields'](_0x5187c2[_0x54bd('0x47')][_0x54bd('0x4a')]));_0x196242[_0x54bd('0x49')]=_0x196242[_0x54bd('0x49')][_0x54bd('0x4b')]?_0x196242[_0x54bd('0x49')]:_0x432948[_0x54bd('0x4c')];if(!_0x5187c2[_0x54bd('0x47')]['hasOwnProperty']('nolimit')){_0x196242['limit']=qs[_0x54bd('0x31')](_0x5187c2[_0x54bd('0x47')][_0x54bd('0x31')]);_0x196242[_0x54bd('0x2e')]=qs[_0x54bd('0x2e')](_0x5187c2['query'][_0x54bd('0x2e')]);}_0x196242['order']=qs[_0x54bd('0x4f')](_0x5187c2[_0x54bd('0x47')][_0x54bd('0x4f')]);_0x196242[_0x54bd('0x50')]=qs[_0x54bd('0x51')](_[_0x54bd('0x52')](_0x5187c2[_0x54bd('0x47')],_0x432948[_0x54bd('0x51')]));_0x196242[_0x54bd('0x50')][_0x54bd('0x6b')]=_0xb0b6f5['id'];if(_0x5187c2[_0x54bd('0x47')][_0x54bd('0x54')]){_0x196242['where']=_['merge'](_0x196242[_0x54bd('0x50')],{'$or':_[_0x54bd('0x41')](_0x196242['attributes'],function(_0x1dc708){var _0x33fdb7={};_0x33fdb7[_0x1dc708]={'$like':'%'+_0x5187c2[_0x54bd('0x47')][_0x54bd('0x54')]+'%'};return _0x33fdb7;})});}_0x196242=_[_0x54bd('0x53')]({},_0x196242,_0x5187c2[_0x54bd('0x55')]);return db[_0x54bd('0x6a')][_0x54bd('0x30')]({'where':_0x196242['where']})[_0x54bd('0x22')](function(_0x1aa7ba){_0x2381fb[_0x54bd('0x30')]=_0x1aa7ba;if(_0x5187c2[_0x54bd('0x47')][_0x54bd('0x56')]){_0x196242[_0x54bd('0x5c')]=[{'all':!![]}];}return db[_0x54bd('0x6a')][_0x54bd('0x6c')](_0x196242);})[_0x54bd('0x22')](function(_0x4a25f7){_0x2381fb['rows']=_0x4a25f7;return _0x2381fb;});}})[_0x54bd('0x22')](respondWithFilteredResult(_0x296754,_0x196242))[_0x54bd('0x58')](handleError(_0x296754,null));};exports[_0x54bd('0x6d')]=function(_0x4d46e9,_0xe97f8a,_0x36c367){return db[_0x54bd('0x42')]['find']({'where':{'id':_0x4d46e9[_0x54bd('0x5a')]['id']}})['then'](handleEntityNotFound(_0xe97f8a,null))[_0x54bd('0x22')](function(_0x2cf402){if(_0x2cf402){return _0x2cf402[_0x54bd('0x6d')](_0x4d46e9[_0x54bd('0x47')]['ids']);}})[_0x54bd('0x22')](respondWithStatusCode(_0xe97f8a,null))[_0x54bd('0x58')](handleError(_0xe97f8a,null));};exports['addAnswer']=function(_0x20876a,_0x42e1fd,_0x4d545c){if(_0x20876a[_0x54bd('0x5f')]['id']){delete _0x20876a[_0x54bd('0x5f')]['id'];}return db[_0x54bd('0x42')][_0x54bd('0x5d')]({'where':{'id':_0x20876a[_0x54bd('0x5a')]['id']}})[_0x54bd('0x22')](handleEntityNotFound(_0x42e1fd,null))[_0x54bd('0x22')](function(_0x905fdc){if(_0x905fdc){_0x20876a[_0x54bd('0x5f')][_0x54bd('0x6b')]=_0x905fdc['id'];return db['CannedAnswer'][_0x54bd('0x5e')](_0x20876a[_0x54bd('0x5f')]);}})[_0x54bd('0x22')](respondWithResult(_0x42e1fd,null))['catch'](handleError(_0x42e1fd,null));};exports['getAnswers']=function(_0xe98c38,_0x4c1c25,_0x34ed09){var _0x332d79={'raw':![],'where':{}};var _0x34eed0={};var _0x5003fd={'count':0x0,'rows':[]};return db[_0x54bd('0x42')][_0x54bd('0x69')]({'where':{'id':_0xe98c38[_0x54bd('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4c1c25,null))[_0x54bd('0x22')](function(_0x58d8ad){if(_0x58d8ad){_0x34eed0[_0x54bd('0x4c')]=_[_0x54bd('0x5b')](db[_0x54bd('0x6e')][_0x54bd('0x43')]);_0x34eed0[_0x54bd('0x47')]=_[_0x54bd('0x5b')](_0xe98c38[_0x54bd('0x47')]);_0x34eed0[_0x54bd('0x51')]=_[_0x54bd('0x48')](_0x34eed0[_0x54bd('0x4c')],_0x34eed0[_0x54bd('0x47')]);_0x332d79[_0x54bd('0x49')]=_[_0x54bd('0x48')](_0x34eed0['model'],qs[_0x54bd('0x4a')](_0xe98c38[_0x54bd('0x47')][_0x54bd('0x4a')]));_0x332d79[_0x54bd('0x49')]=_0x332d79[_0x54bd('0x49')][_0x54bd('0x4b')]?_0x332d79[_0x54bd('0x49')]:_0x34eed0[_0x54bd('0x4c')];if(!_0xe98c38['query'][_0x54bd('0x6f')](_0x54bd('0x4d'))){_0x332d79[_0x54bd('0x31')]=qs[_0x54bd('0x31')](_0xe98c38[_0x54bd('0x47')][_0x54bd('0x31')]);_0x332d79[_0x54bd('0x2e')]=qs[_0x54bd('0x2e')](_0xe98c38[_0x54bd('0x47')][_0x54bd('0x2e')]);}_0x332d79['order']=qs['sort'](_0xe98c38[_0x54bd('0x47')][_0x54bd('0x4f')]);_0x332d79[_0x54bd('0x50')]=qs[_0x54bd('0x51')](_[_0x54bd('0x52')](_0xe98c38[_0x54bd('0x47')],_0x34eed0[_0x54bd('0x51')]));_0x332d79['where'][_0x54bd('0x6b')]=_0x58d8ad['id'];if(_0xe98c38['query']['filter']){_0x332d79['where']=_[_0x54bd('0x53')](_0x332d79[_0x54bd('0x50')],{'$or':_[_0x54bd('0x41')](_0x332d79[_0x54bd('0x49')],function(_0xd8c208){var _0x445eb3={};_0x445eb3[_0xd8c208]={'$like':'%'+_0xe98c38[_0x54bd('0x47')][_0x54bd('0x54')]+'%'};return _0x445eb3;})});}_0x332d79=_[_0x54bd('0x53')]({},_0x332d79,_0xe98c38[_0x54bd('0x55')]);return db[_0x54bd('0x6e')][_0x54bd('0x30')]({'where':_0x332d79[_0x54bd('0x50')]})['then'](function(_0x10e43){_0x5003fd[_0x54bd('0x30')]=_0x10e43;if(_0xe98c38[_0x54bd('0x47')][_0x54bd('0x56')]){_0x332d79[_0x54bd('0x5c')]=[{'all':!![]}];}return db['CannedAnswer'][_0x54bd('0x6c')](_0x332d79);})['then'](function(_0x194ad4){_0x5003fd[_0x54bd('0x57')]=_0x194ad4;return _0x5003fd;});}})[_0x54bd('0x22')](respondWithFilteredResult(_0x4c1c25,_0x332d79))['catch'](handleError(_0x4c1c25,null));};exports['removeAnswers']=function(_0x5e0406,_0xe47c8b,_0x39158f){return db[_0x54bd('0x42')]['find']({'where':{'id':_0x5e0406[_0x54bd('0x5a')]['id']}})['then'](handleEntityNotFound(_0xe47c8b,null))[_0x54bd('0x22')](function(_0x57586e){if(_0x57586e){return _0x57586e[_0x54bd('0x70')](_0x5e0406[_0x54bd('0x47')]['ids']);}})[_0x54bd('0x22')](respondWithStatusCode(_0xe47c8b,null))[_0x54bd('0x58')](handleError(_0xe47c8b,null));};exports['addInteraction']=function(_0x2c658d,_0x5472d5,_0x54dd03){return db['FaxInteraction'][_0x54bd('0x5d')]({'where':{'id':_0x2c658d['params']['id']}})['then'](handleEntityNotFound(_0x5472d5,null))[_0x54bd('0x22')](function(_0x31b036){if(_0x31b036){return _0x31b036[_0x54bd('0x71')](_0x2c658d['body']['ids'],_['omit'](_0x2c658d['body'],[_0x54bd('0x72'),'id'])||{});}})[_0x54bd('0x22')](respondWithResult(_0x5472d5,null))[_0x54bd('0x58')](handleError(_0x5472d5,null));};exports[_0x54bd('0x73')]=function(_0x49c9ed,_0x568aef,_0x2ae421){var _0x45b382={'raw':![],'where':{}};var _0x2b3007={};var _0x348fc8={'count':0x0,'rows':[]};return db[_0x54bd('0x42')][_0x54bd('0x69')]({'where':{'id':_0x49c9ed[_0x54bd('0x5a')]['id']}})[_0x54bd('0x22')](handleEntityNotFound(_0x568aef,null))[_0x54bd('0x22')](function(_0x5c3891){if(_0x5c3891){_0x2b3007['model']=_[_0x54bd('0x5b')](db[_0x54bd('0x74')][_0x54bd('0x43')]);_0x2b3007[_0x54bd('0x47')]=_[_0x54bd('0x5b')](_0x49c9ed[_0x54bd('0x47')]);_0x2b3007[_0x54bd('0x51')]=_[_0x54bd('0x48')](_0x2b3007[_0x54bd('0x4c')],_0x2b3007['query']);_0x45b382[_0x54bd('0x49')]=_[_0x54bd('0x48')](_0x2b3007[_0x54bd('0x4c')],qs[_0x54bd('0x4a')](_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x4a')]));_0x45b382['attributes']=_0x45b382[_0x54bd('0x49')]['length']?_0x45b382[_0x54bd('0x49')]:_0x2b3007[_0x54bd('0x4c')];if(!_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x6f')](_0x54bd('0x4d'))){_0x45b382[_0x54bd('0x31')]=qs['limit'](_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x31')]);_0x45b382[_0x54bd('0x2e')]=qs[_0x54bd('0x2e')](_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x2e')]);}_0x45b382[_0x54bd('0x4e')]=qs[_0x54bd('0x4f')](_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x4f')]);_0x45b382['where']=qs[_0x54bd('0x51')](_[_0x54bd('0x52')](_0x49c9ed[_0x54bd('0x47')],_0x2b3007['filters']));_0x45b382[_0x54bd('0x50')][_0x54bd('0x6b')]=_0x5c3891['id'];if(_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x54')]){_0x45b382[_0x54bd('0x50')]=_['merge'](_0x45b382[_0x54bd('0x50')],{'$or':_['map'](_0x45b382[_0x54bd('0x49')],function(_0x5ba65a){var _0x46e36d={};_0x46e36d[_0x5ba65a]={'$like':'%'+_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x54')]+'%'};return _0x46e36d;})});}_0x45b382=_['merge']({},_0x45b382,_0x49c9ed[_0x54bd('0x55')]);return db[_0x54bd('0x74')][_0x54bd('0x30')]({'where':_0x45b382[_0x54bd('0x50')]})[_0x54bd('0x22')](function(_0x5c8460){_0x348fc8['count']=_0x5c8460;if(_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x56')]){_0x45b382[_0x54bd('0x5c')]=[{'model':db[_0x54bd('0x75')],'as':_0x54bd('0x76'),'required':![]},{'model':db[_0x54bd('0x77')],'as':'Owner','attributes':[_0x54bd('0x3c'),_0x54bd('0x78'),_0x54bd('0x79')],'required':![]},{'model':db[_0x54bd('0x7a')],'as':_0x54bd('0x7b'),'attributes':['id',_0x54bd('0x3c'),_0x54bd('0x7c')],'where':_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x7d')]?{'id':_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x7d')]}:undefined,'required':_0x49c9ed[_0x54bd('0x47')][_0x54bd('0x7d')]?!![]:![]}];}return db[_0x54bd('0x74')][_0x54bd('0x6c')](_0x45b382);})[_0x54bd('0x22')](function(_0x1b2a81){_0x348fc8[_0x54bd('0x57')]=_0x1b2a81;return _0x348fc8;});}})[_0x54bd('0x22')](respondWithFilteredResult(_0x568aef,_0x45b382))[_0x54bd('0x58')](handleError(_0x568aef,null));};exports[_0x54bd('0x7e')]=function(_0x490b8f,_0x34b1f3){var _0x544877=_0x490b8f[_0x54bd('0x5a')]['id'];var _0x1d143b=_0x490b8f[_0x54bd('0x5f')];var _0x43acbc=0xc8;var _0x2d8d37=null;return db[_0x54bd('0x7f')]['transaction']({'isolationLevel':db['sequelize'][_0x54bd('0x80')][_0x54bd('0x81')]['READ_COMMITTED']},function(_0x3e7626){return db['FaxAccount'][_0x54bd('0x69')]({'where':{'id':_0x544877},'transaction':_0x3e7626})[_0x54bd('0x22')](function(_0x5e0296){if(_0x5e0296){return db[_0x54bd('0x82')]['destroy']({'where':{'FaxAccountId':_0x544877},'transaction':_0x3e7626})['then'](function(){var _0x3081f6=_[_0x54bd('0x41')](_0x1d143b,function(_0x3711b2){_0x3711b2[_0x54bd('0x6b')]=_0x544877;return _0x3711b2;});return db[_0x54bd('0x82')][_0x54bd('0x83')](_0x3081f6,{'transaction':_0x3e7626});});}else{_0x43acbc=0x194;_0x2d8d37=[];}});})['then'](function(){if(_0x43acbc!==0x194){return db[_0x54bd('0x82')]['findAndCountAll']({'where':{'FaxAccountId':_0x544877},'order':_0x54bd('0x84')})[_0x54bd('0x22')](function(_0x665387){_0x2d8d37=_0x665387;});}})[_0x54bd('0x58')](function(_0x15cbb5){_0x43acbc=0x1f4;logger[_0x54bd('0x26')](_0x15cbb5['stack']);if(_0x15cbb5['name']){delete _0x15cbb5[_0x54bd('0x3c')];}_0x2d8d37=_0x15cbb5;})['finally'](function(){if(_0x2d8d37===null){_0x34b1f3[_0x54bd('0x2a')](_0x43acbc);}else{if(_0x43acbc===0x1f4){_0x34b1f3['status'](_0x43acbc)[_0x54bd('0x3d')](_0x2d8d37);}else{_0x34b1f3[_0x54bd('0x2b')](_0x43acbc)[_0x54bd('0x2d')](_0x2d8d37);}}});};exports[_0x54bd('0x85')]=function(_0x346f45,_0x46aa65,_0x2f1806){var _0x2e22c6={};var _0x2a54b1={};var _0xb4a243;var _0x24b2e8;return db[_0x54bd('0x42')]['findOne']({'where':{'id':_0x346f45[_0x54bd('0x5a')]['id']}})[_0x54bd('0x22')](handleEntityNotFound(_0x46aa65,null))['then'](function(_0x4c30e9){if(_0x4c30e9){_0xb4a243=_0x4c30e9;_0x2a54b1['model']=_[_0x54bd('0x5b')](db[_0x54bd('0x82')][_0x54bd('0x43')]);_0x2a54b1[_0x54bd('0x47')]=_[_0x54bd('0x5b')](_0x346f45[_0x54bd('0x47')]);_0x2a54b1['filters']=_[_0x54bd('0x48')](_0x2a54b1[_0x54bd('0x4c')],_0x2a54b1[_0x54bd('0x47')]);_0x2e22c6[_0x54bd('0x49')]=_['intersection'](_0x2a54b1['model'],qs[_0x54bd('0x4a')](_0x346f45[_0x54bd('0x47')][_0x54bd('0x4a')]));_0x2e22c6['attributes']=_0x2e22c6['attributes'][_0x54bd('0x4b')]?_0x2e22c6[_0x54bd('0x49')]:_0x2a54b1['model'];_0x2e22c6[_0x54bd('0x4e')]=qs['sort'](_0x346f45[_0x54bd('0x47')]['sort']);_0x2e22c6['where']=qs['filters'](_['pick'](_0x346f45['query'],_0x2a54b1[_0x54bd('0x51')]));if(_0x346f45[_0x54bd('0x47')][_0x54bd('0x54')]){_0x2e22c6[_0x54bd('0x50')]=_['merge'](_0x2e22c6[_0x54bd('0x50')],{'$or':_[_0x54bd('0x41')](_0x2e22c6[_0x54bd('0x49')],function(_0x522746){var _0x392bba={};_0x392bba[_0x522746]={'$like':'%'+_0x346f45['query']['filter']+'%'};return _0x392bba;})});}_0x2e22c6=_[_0x54bd('0x53')]({},_0x2e22c6,_0x346f45['options']);return _0xb4a243[_0x54bd('0x85')](_0x2e22c6);}})[_0x54bd('0x22')](function(_0x444ebf){if(_0x444ebf){_0x24b2e8=_0x444ebf[_0x54bd('0x4b')];if(!_0x346f45[_0x54bd('0x47')][_0x54bd('0x6f')](_0x54bd('0x4d'))){_0x2e22c6['limit']=qs[_0x54bd('0x31')](_0x346f45['query']['limit']);_0x2e22c6[_0x54bd('0x2e')]=qs[_0x54bd('0x2e')](_0x346f45[_0x54bd('0x47')][_0x54bd('0x2e')]);}return _0xb4a243[_0x54bd('0x85')](_0x2e22c6);}})['then'](function(_0x5641a3){if(_0x5641a3){return _0x5641a3?{'count':_0x24b2e8,'rows':_0x5641a3}:null;}})['then'](respondWithResult(_0x46aa65,null))[_0x54bd('0x58')](handleError(_0x46aa65,null));};function Extension(_0x36cb23,_0x3489d4,_0x3732c1,_0x1644ee){this[_0x54bd('0x86')]='from-voip-provider';this[_0x54bd('0x87')]=_0x36cb23[_0x54bd('0x88')];this[_0x54bd('0x89')]=_0x1644ee;this[_0x54bd('0x45')]='system';this[_0x54bd('0x8a')]=_0x54bd('0x8b');this[_0x54bd('0x6b')]=_0x36cb23['id'];this[_0x54bd('0x84')]=_0x3489d4;this['appdata']=_0x3732c1;}function createExtensionsReciveFax(_0x3340e1){var _0x238454=0x1;var _0x1f1a1a=[];_0x1f1a1a[_0x54bd('0x8c')](new Extension(_0x3340e1,_0x238454,'','Answer'));_0x238454+=0x1;_0x1f1a1a['push'](new Extension(_0x3340e1,_0x238454,_0x54bd('0x8d'),_0x54bd('0x8e')));_0x238454+=0x1;for(var _0x3cad2f in _0x3340e1){if(_0x3340e1[_0x54bd('0x6f')](_0x3cad2f)&&(_0x3cad2f===_0x54bd('0x8f')||_0x3cad2f===_0x54bd('0x88')||_0x3cad2f===_0x54bd('0x90')||_0x3cad2f===_0x54bd('0x91')||_0x3cad2f==='headerinfo'||_0x3cad2f===_0x54bd('0x92')||_0x3cad2f===_0x54bd('0x93')||_0x3cad2f===_0x54bd('0x94')||_0x3cad2f===_0x54bd('0x95'))){_0x1f1a1a[_0x54bd('0x8c')](new Extension(_0x3340e1,_0x238454,_0x54bd('0x96')+_0x3cad2f+')='+_0x3340e1[_0x3cad2f],_0x54bd('0x8e')));_0x238454+=0x1;}}_0x1f1a1a[_0x54bd('0x8c')](new Extension(_0x3340e1,_0x238454,'6',_0x54bd('0x97')));_0x238454+=0x1;_0x1f1a1a['push'](new Extension(_0x3340e1,_0x238454,_0x54bd('0x98'),_0x54bd('0x99')));_0x238454=0x0;return _0x1f1a1a;}exports[_0x54bd('0x9a')]=function(_0x3d071e,_0x2bd7c0,_0x1b045c){var _0x33390a;return db[_0x54bd('0x7f')][_0x54bd('0x9b')](function(_0x34c10f){return db['FaxAccount'][_0x54bd('0x5e')](_0x3d071e[_0x54bd('0x5f')],{'transaction':_0x34c10f})[_0x54bd('0x22')](function(_0x153518){_0x33390a=_0x153518[_0x54bd('0x38')]({'plain':!![]});return db['VoiceExtension'][_0x54bd('0x83')](createExtensionsReciveFax(_0x33390a),{'transaction':_0x34c10f});});})[_0x54bd('0x22')](function(){return _0x33390a;})['then'](respondWithResult(_0x2bd7c0,null))[_0x54bd('0x58')](handleError(_0x2bd7c0,null));};exports[_0x54bd('0x9c')]=function(_0x4e2efd,_0x44e6ee,_0x53b62d){var _0x50de3a;return db[_0x54bd('0x7f')][_0x54bd('0x9b')](function(_0x6d2a66){return db[_0x54bd('0x42')][_0x54bd('0x36')](_0x4e2efd[_0x54bd('0x5f')],{'where':{'id':_0x4e2efd[_0x54bd('0x5f')]['id']},'transaction':_0x6d2a66})[_0x54bd('0x22')](function(_0x2e3756){return db[_0x54bd('0x9d')][_0x54bd('0x37')]({'where':{'FaxAccountId':_0x4e2efd[_0x54bd('0x5f')]['id']},'transaction':_0x6d2a66})[_0x54bd('0x22')](function(_0x24a026){return db[_0x54bd('0x9d')][_0x54bd('0x83')](createExtensionsReciveFax(_[_0x54bd('0x9e')](_0x4e2efd[_0x54bd('0x5f')],[_0x54bd('0x9f'),_0x54bd('0x46'),'createdAt',_0x54bd('0xa0'),_0x54bd('0xa1'),_0x54bd('0xa2')])),{'transaction':_0x6d2a66});});});})[_0x54bd('0x22')](function(){return db[_0x54bd('0x42')]['findById'](_0x4e2efd[_0x54bd('0x5f')]['id']);})[_0x54bd('0x22')](respondWithResult(_0x44e6ee,null))['catch'](handleError(_0x44e6ee,null));};exports[_0x54bd('0xa3')]=function(_0x2ac8ba,_0x2acd6d,_0x396692){var _0x13166d={'raw':!![],'where':{}};var _0x4ccf41={};var _0x4c9501={'count':0x0,'rows':[]};return db[_0x54bd('0x42')][_0x54bd('0x69')]({'where':{'id':_0x2ac8ba[_0x54bd('0x5a')]['id']}})[_0x54bd('0x22')](handleEntityNotFound(_0x2acd6d,null))[_0x54bd('0x22')](function(_0x46cce5){if(_0x46cce5){_0x4ccf41['model']=_[_0x54bd('0x5b')](db[_0x54bd('0xa4')]['rawAttributes']);_0x4ccf41[_0x54bd('0x47')]=_['keys'](_0x2ac8ba[_0x54bd('0x47')]);_0x4ccf41['filters']=_[_0x54bd('0x48')](_0x4ccf41['model'],_0x4ccf41['query']);_0x13166d['attributes']=_[_0x54bd('0x48')](_0x4ccf41[_0x54bd('0x4c')],qs[_0x54bd('0x4a')](_0x2ac8ba[_0x54bd('0x47')][_0x54bd('0x4a')]));_0x13166d[_0x54bd('0x49')]=_0x13166d[_0x54bd('0x49')][_0x54bd('0x4b')]?_0x13166d[_0x54bd('0x49')]:_0x4ccf41[_0x54bd('0x4c')];if(!_0x2ac8ba[_0x54bd('0x47')][_0x54bd('0x6f')](_0x54bd('0x4d'))){_0x13166d[_0x54bd('0x31')]=qs[_0x54bd('0x31')](_0x2ac8ba['query'][_0x54bd('0x31')]);_0x13166d[_0x54bd('0x2e')]=qs[_0x54bd('0x2e')](_0x2ac8ba[_0x54bd('0x47')][_0x54bd('0x2e')]);}_0x13166d[_0x54bd('0x4e')]=qs[_0x54bd('0x4f')](_0x2ac8ba['query']['sort']);_0x13166d[_0x54bd('0x50')]=qs[_0x54bd('0x51')](_[_0x54bd('0x52')](_0x2ac8ba[_0x54bd('0x47')],_0x4ccf41[_0x54bd('0x51')]));_0x13166d['where']['FaxAccountId']=_0x46cce5['id'];if(_0x2ac8ba[_0x54bd('0x47')][_0x54bd('0x54')]){_0x13166d[_0x54bd('0x50')]=_[_0x54bd('0x53')](_0x13166d[_0x54bd('0x50')],{'$or':_['map'](_0x13166d[_0x54bd('0x49')],function(_0x87f833){var _0x22e7ab={};_0x22e7ab[_0x87f833]={'$like':'%'+_0x2ac8ba[_0x54bd('0x47')][_0x54bd('0x54')]+'%'};return _0x22e7ab;})});}if(_0x2ac8ba['query'][_0x54bd('0xa5')]){var _0x1c8500=_0x2ac8ba['query'][_0x54bd('0xa5')][_0x54bd('0xa6')](',');var _0x5f4256={};_0x5f4256[_0x1c8500[0x0]]={'$gte':moment(_0x1c8500[0x1])['format'](_0x54bd('0xa7'))};_0x13166d[_0x54bd('0x50')]=_[_0x54bd('0x53')](_0x13166d[_0x54bd('0x50')],_0x5f4256);}_0x13166d=_[_0x54bd('0x53')]({},_0x13166d,_0x2ac8ba['options']);return db['FaxMessage']['count']({'where':_0x13166d['where']})[_0x54bd('0x22')](function(_0x3c305c){_0x4c9501[_0x54bd('0x30')]=_0x3c305c;if(_0x2ac8ba[_0x54bd('0x47')]['includeAll']){_0x13166d['include']=[{'all':!![]}];}return db[_0x54bd('0xa4')]['findAll'](_0x13166d);})[_0x54bd('0x22')](function(_0x371463){_0x4c9501[_0x54bd('0x57')]=_0x371463;return _0x4c9501;});}})[_0x54bd('0x22')](respondWithFilteredResult(_0x2acd6d,_0x13166d))[_0x54bd('0x58')](handleError(_0x2acd6d,null));};exports[_0x54bd('0x3d')]=function(_0x58963a,_0xab172f,_0x417263){var _0x241364,_0x3e7538={},_0x9041b3;if(_0x58963a[_0x54bd('0x5f')]['to']){_0x9041b3=_0x58963a[_0x54bd('0x5f')]['to'][0x0];}return db[_0x54bd('0x42')][_0x54bd('0x5d')]({'where':{'id':_0x58963a['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x54bd('0x75')],'as':'Contacts','where':{'fax':_0x9041b3},'limit':0x1,'order':[['updatedAt',_0x54bd('0xa8')]]}]}]})[_0x54bd('0x22')](handleEntityNotFound(_0xab172f,null))[_0x54bd('0x22')](function(_0x34621e){_0x241364=_0x34621e;if(_0x58963a['body'][_0x54bd('0xa9')]&&_0x58963a[_0x54bd('0x5f')][_0x54bd('0xa9')][_0x54bd('0x4b')]){for(var _0xd20e86=0x0;_0xd20e86<_0x58963a[_0x54bd('0x5f')]['attachments'][_0x54bd('0x4b')];_0xd20e86+=0x1){_0x58963a[_0x54bd('0x5f')][_0x54bd('0xa9')][_0xd20e86]={'filename':_0x58963a[_0x54bd('0x5f')][_0x54bd('0xa9')][_0xd20e86]['name'],'id':_0x58963a['body'][_0x54bd('0xa9')][_0xd20e86]['id'],'path':path[_0x54bd('0xaa')](config['root'],_0x54bd('0xab'),_0x58963a[_0x54bd('0x5f')][_0x54bd('0xa9')][_0xd20e86][_0x54bd('0xac')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0x54bd('0xad')](_0x58963a[_0x54bd('0x5a')]['id'])?undefined:_0x58963a[_0x54bd('0x5a')]['id'],'path':_[_0x54bd('0xad')](_0x58963a['body'][_0x54bd('0xa9')][0x0][_0x54bd('0x8')])?undefined:_0x58963a[_0x54bd('0x5f')][_0x54bd('0xa9')][0x0][_0x54bd('0x8')],'fax':_[_0x54bd('0xad')](_0x58963a[_0x54bd('0x5f')]['to'][0x0])?undefined:_0x58963a['body']['to'][0x0]},client9002);})[_0x54bd('0x22')](function(){if(_0x241364){if(_[_0x54bd('0xad')](_0x58963a[_0x54bd('0x5f')]['from'])){_0x58963a[_0x54bd('0x5f')][_0x54bd('0xae')]=util[_0x54bd('0xaf')](_0x54bd('0xb0'),_0x241364[_0x54bd('0x3c')],_0x241364[_0x54bd('0xb1')]);}if(_0x241364[_0x54bd('0xb2')]){if(_0x241364[_0x54bd('0xb2')][_0x54bd('0xb3')][_0x54bd('0x4b')]){return _0x241364['List'][_0x54bd('0xb3')][0x0];}else{return db[_0x54bd('0x75')][_0x54bd('0x5e')](_[_0x54bd('0x1a')](_0x58963a[_0x54bd('0x5f')],{'firstName':_0x58963a[_0x54bd('0x5f')]['to'][0x0],'phone':_0x58963a[_0x54bd('0x5f')]['to'][0x0],'fax':_0x58963a[_0x54bd('0x5f')]['to'][0x0],'ListId':_0x241364[_0x54bd('0xa2')]}));}}else{throw new Error(_0x54bd('0xb4'));}}else{throw new Error(_0x54bd('0xb5'));}})[_0x54bd('0x22')](function(_0xc1b5fc){if(_0xc1b5fc){return db[_0x54bd('0x74')][_0x54bd('0x5d')]({'where':{'ContactId':_0xc1b5fc['id'],'closed':![],'FaxAccountId':_0x241364['id']}})[_0x54bd('0x22')](function(_0x1c36a3){if(_0x1c36a3){return[_0x1c36a3,![]];}return db['FaxInteraction'][_0x54bd('0x5e')]({'UserId':_0x58963a[_0x54bd('0x62')]['id'],'ContactId':_0xc1b5fc['id'],'FaxAccountId':_0x241364['id'],'fax':_0x58963a[_0x54bd('0x5f')]['to'][0x0],'firstMsgDirection':_0x54bd('0xb6'),'Messages':[_[_0x54bd('0x53')](_0x58963a[_0x54bd('0x5f')],{'read':![],'body':_0x58963a['body'][_0x54bd('0xa9')][0x0][_0x54bd('0xb7')],'FaxAccountId':_0x241364['id'],'UserId':_0x58963a[_0x54bd('0x62')]['id'],'ContactId':_0xc1b5fc['id'],'AttachmentId':_0x58963a[_0x54bd('0x5f')][_0x54bd('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0x54bd('0xa4')],'as':_0x54bd('0xb8')}]})['then'](function(_0x28d6ce){return[_0x28d6ce,!![]];});});}else{throw new Error(_0x54bd('0xb9'));}})['spread'](function(_0x5015c6,_0x50491f){if(_0x50491f){return _0x5015c6;}return db[_0x54bd('0xa4')][_0x54bd('0x5e')]({'direction':_0x54bd('0xb6'),'read':![],'body':_0x58963a['body'][_0x54bd('0xa9')][0x0][_0x54bd('0xb7')],'FaxAccountId':_0x241364['id'],'FaxInteractionId':_0x5015c6['id'],'UserId':_0x58963a['user']['id'],'ContactId':_0x5015c6[_0x54bd('0xba')],'AttachmentId':_0x58963a[_0x54bd('0x5f')][_0x54bd('0xa9')][0x0]['id']})[_0x54bd('0x22')](function(_0x4af335){_0x5015c6['dataValues'][_0x54bd('0xb8')]=[];_0x5015c6['dataValues'][_0x54bd('0xb8')][_0x54bd('0x8c')](_0x4af335[_0x54bd('0xbb')]);return _0x5015c6;});})[_0x54bd('0x22')](function(_0x1c8423){respondWithRpcPromise(_0x54bd('0xbc'),_0x54bd('0xbc'),{'FaxAccountId':_[_0x54bd('0xad')](_0x58963a[_0x54bd('0x5a')]['id'])?undefined:_0x58963a[_0x54bd('0x5a')]['id'],'path':_[_0x54bd('0xad')](_0x58963a[_0x54bd('0x5f')][_0x54bd('0xa9')][0x0][_0x54bd('0x8')])?undefined:_0x58963a[_0x54bd('0x5f')][_0x54bd('0xa9')][0x0][_0x54bd('0x8')],'fax':_['isNil'](_0x58963a[_0x54bd('0x5f')]['to'][0x0])?undefined:_0x58963a['body']['to'][0x0],'AttachmentId':_0x58963a[_0x54bd('0x5f')]['attachments'][0x0]['id']},client9002)['then'](function(_0x43a2fd){logger[_0x54bd('0xbd')](_0x54bd('0xbe'),_0x43a2fd);})[_0x54bd('0x58')](function(_0x25c3ed){logger[_0x54bd('0xbd')](_0x54bd('0xbe'),_0x25c3ed);});return _0x1c8423;})[_0x54bd('0x22')](respondWithResult(_0xab172f,null))[_0x54bd('0x58')](handleError(_0xab172f,null));};exports['addAgents']=function(_0x4612fc,_0x4ff467,_0x5d6732){return db[_0x54bd('0x42')]['find']({'where':{'id':_0x4612fc[_0x54bd('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4ff467,null))[_0x54bd('0x22')](function(_0xef689){if(_0xef689){return _0xef689['addAgents'](_0x4612fc['body'][_0x54bd('0x72')],_['omit'](_0x4612fc[_0x54bd('0x5f')],[_0x54bd('0x72'),'id'])||{})[_0x54bd('0xbf')](function(_0x338221){for(var _0xd58eb8=0x0;_0xd58eb8<_0x4612fc[_0x54bd('0x5f')]['ids'][_0x54bd('0x4b')];_0xd58eb8+=0x1){socket[_0x54bd('0xc0')](_0x54bd('0xc1'),{'UserId':Number(_0x4612fc[_0x54bd('0x5f')][_0x54bd('0x72')][_0xd58eb8]),'FaxAccountId':Number(_0x4612fc['params']['id'])});}return _0x338221;});}})[_0x54bd('0x22')](respondWithResult(_0x4ff467,null))[_0x54bd('0x58')](handleError(_0x4ff467,null));};exports[_0x54bd('0xc2')]=function(_0x160fa2,_0x52820c,_0x96e4fc){return db[_0x54bd('0x42')][_0x54bd('0x5d')]({'where':{'id':_0x160fa2['params']['id']}})['then'](handleEntityNotFound(_0x52820c,null))[_0x54bd('0x22')](function(_0x5981f4){if(_0x5981f4){return _0x5981f4[_0x54bd('0xc2')](_0x160fa2[_0x54bd('0x47')][_0x54bd('0x72')])[_0x54bd('0x22')](function(){if(_[_0x54bd('0xc3')](_0x160fa2['query'][_0x54bd('0x72')])){for(var _0x454395=0x0;_0x454395<_0x160fa2['query'][_0x54bd('0x72')][_0x54bd('0x4b')];_0x454395+=0x1){socket[_0x54bd('0xc0')](_0x54bd('0xc4'),{'UserId':Number(_0x160fa2[_0x54bd('0x47')][_0x54bd('0x72')][_0x454395]),'FaxAccountId':Number(_0x160fa2['params']['id'])});}}else{socket[_0x54bd('0xc0')](_0x54bd('0xc4'),{'UserId':Number(_0x160fa2[_0x54bd('0x47')][_0x54bd('0x72')]),'FaxAccountId':Number(_0x160fa2[_0x54bd('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x52820c,null))['catch'](handleError(_0x52820c,null));};exports[_0x54bd('0xc5')]=function(_0x3f9d05,_0x24c86d,_0x4acab5){var _0x3a2ede={};var _0x237d57={};var _0x74df13;var _0x5d4b51;return db[_0x54bd('0x42')][_0x54bd('0x69')]({'where':{'id':_0x3f9d05['params']['id']}})[_0x54bd('0x22')](handleEntityNotFound(_0x24c86d,null))[_0x54bd('0x22')](function(_0x4420d3){if(_0x4420d3){_0x74df13=_0x4420d3;_0x237d57['model']=_['keys'](db[_0x54bd('0x77')][_0x54bd('0x43')]);_0x237d57['query']=_[_0x54bd('0x5b')](_0x3f9d05[_0x54bd('0x47')]);_0x237d57['filters']=_[_0x54bd('0x48')](_0x237d57[_0x54bd('0x4c')],_0x237d57[_0x54bd('0x47')]);_0x3a2ede[_0x54bd('0x49')]=_[_0x54bd('0x48')](_0x237d57[_0x54bd('0x4c')],qs[_0x54bd('0x4a')](_0x3f9d05['query'][_0x54bd('0x4a')]));_0x3a2ede[_0x54bd('0x49')]=_0x3a2ede[_0x54bd('0x49')][_0x54bd('0x4b')]?_0x3a2ede[_0x54bd('0x49')]:_0x237d57[_0x54bd('0x4c')];_0x3a2ede[_0x54bd('0x4e')]=qs[_0x54bd('0x4f')](_0x3f9d05[_0x54bd('0x47')]['sort']);_0x3a2ede[_0x54bd('0x50')]=qs[_0x54bd('0x51')](_[_0x54bd('0x52')](_0x3f9d05[_0x54bd('0x47')],_0x237d57[_0x54bd('0x51')]));if(_0x3f9d05[_0x54bd('0x47')]['filter']){_0x3a2ede[_0x54bd('0x50')]=_['merge'](_0x3a2ede[_0x54bd('0x50')],{'$or':_['map'](_0x3a2ede[_0x54bd('0x49')],function(_0x5b2da0){var _0xe124d1={};_0xe124d1[_0x5b2da0]={'$like':'%'+_0x3f9d05[_0x54bd('0x47')][_0x54bd('0x54')]+'%'};return _0xe124d1;})});}_0x3a2ede=_[_0x54bd('0x53')]({},_0x3a2ede,_0x3f9d05[_0x54bd('0x55')]);return _0x74df13['getAgents'](_0x3a2ede);}})[_0x54bd('0x22')](function(_0x12a068){if(_0x12a068){_0x5d4b51=_0x12a068[_0x54bd('0x4b')];if(!_0x3f9d05[_0x54bd('0x47')][_0x54bd('0x6f')](_0x54bd('0x4d'))){_0x3a2ede[_0x54bd('0x31')]=qs[_0x54bd('0x31')](_0x3f9d05[_0x54bd('0x47')][_0x54bd('0x31')]);_0x3a2ede[_0x54bd('0x2e')]=qs[_0x54bd('0x2e')](_0x3f9d05[_0x54bd('0x47')]['offset']);}return _0x74df13[_0x54bd('0xc5')](_0x3a2ede);}})[_0x54bd('0x22')](function(_0x185f09){if(_0x185f09){return _0x185f09?{'count':_0x5d4b51,'rows':_0x185f09}:null;}})['then'](respondWithResult(_0x24c86d,null))[_0x54bd('0x58')](handleError(_0x24c86d,null));};
\ No newline at end of file
+var _0x5fb9=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','FaxAccount','count','includeAll','include','findAll','rows','show','length','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','FaxAccountId','Disposition','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','tag','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','localstationid','app','system','description','priority','appdata','push','Answer','ecm','gateway','faxdetect','maxrate','minrate','FAXOPT(','Set','/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','transaction','updateAccountApplications','VoiceExtension','key','createdAt','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x3cd2ef,_0x21a867){var _0x10557b=function(_0x1c2c42){while(--_0x1c2c42){_0x3cd2ef['push'](_0x3cd2ef['shift']());}};_0x10557b(++_0x21a867);}(_0x5fb9,0x167));var _0x95fb=function(_0x4479a4,_0x51fe76){_0x4479a4=_0x4479a4-0x0;var _0x567076=_0x5fb9[_0x4479a4];return _0x567076;};'use strict';var emlformat=require(_0x95fb('0x0'));var rimraf=require(_0x95fb('0x1'));var zipdir=require(_0x95fb('0x2'));var jsonpatch=require(_0x95fb('0x3'));var rp=require(_0x95fb('0x4'));var moment=require(_0x95fb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x95fb('0x6'));var util=require('util');var path=require(_0x95fb('0x7'));var sox=require('sox');var csv=require(_0x95fb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95fb('0x9'));var _=require(_0x95fb('0xa'));var squel=require(_0x95fb('0xb'));var crypto=require(_0x95fb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x95fb('0xd'));var toCsv=require(_0x95fb('0x8'));var querystring=require(_0x95fb('0xe'));var Papa=require(_0x95fb('0xf'));var Redis=require(_0x95fb('0x10'));var authService=require(_0x95fb('0x11'));var qs=require(_0x95fb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x95fb('0x13'))(_0x95fb('0x14'));var utils=require(_0x95fb('0x15'));var config=require(_0x95fb('0x16'));var licenseUtil=require(_0x95fb('0x17'));var db=require(_0x95fb('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x95fb('0x19'))(new Redis(config[_0x95fb('0x1a')]));require(_0x95fb('0x1b'))[_0x95fb('0x1c')](socket);var jayson=require(_0x95fb('0x1d'));var client=jayson[_0x95fb('0x1e')][_0x95fb('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x95fb('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4c25af,_0x105a7d,_0x489667,_0x3745d3){return new BPromise(function(_0x12df55,_0x4c16aa){var _0x3da045=_0x3745d3||client;return _0x3da045[_0x95fb('0x20')](_0x4c25af,_0x489667)[_0x95fb('0x21')](function(_0x18815b){logger[_0x95fb('0x22')](_0x95fb('0x23'),_0x105a7d,_0x95fb('0x24'));logger['debug'](_0x95fb('0x25'),_0x105a7d,_0x95fb('0x24'),JSON[_0x95fb('0x26')](_0x18815b));if(_0x18815b[_0x95fb('0x27')]){if(_0x18815b[_0x95fb('0x27')][_0x95fb('0x28')]===0x1f4){logger[_0x95fb('0x27')](_0x95fb('0x23'),_0x105a7d,_0x18815b[_0x95fb('0x27')]['message']);return _0x4c16aa(_0x18815b[_0x95fb('0x27')][_0x95fb('0x29')]);}logger['error'](_0x95fb('0x23'),_0x105a7d,_0x18815b['error'][_0x95fb('0x29')]);return _0x12df55(_0x18815b['error'][_0x95fb('0x29')]);}else{logger[_0x95fb('0x22')](_0x95fb('0x23'),_0x105a7d,'request\x20sent');_0x12df55(_0x18815b['result'][_0x95fb('0x29')]);}})[_0x95fb('0x2a')](function(_0x17186c){logger['error'](_0x95fb('0x23'),_0x105a7d,_0x17186c);_0x4c16aa(_0x17186c);});});}function respondWithStatusCode(_0xb7342d,_0x59277e){_0x59277e=_0x59277e||0xcc;return function(_0x199ca4){if(_0x199ca4){return _0xb7342d['sendStatus'](_0x59277e);}return _0xb7342d['status'](_0x59277e)[_0x95fb('0x2b')]();};}function respondWithResult(_0x1bf4df,_0x4721c1){_0x4721c1=_0x4721c1||0xc8;return function(_0x1fdecc){if(_0x1fdecc){return _0x1bf4df[_0x95fb('0x2c')](_0x4721c1)[_0x95fb('0x2d')](_0x1fdecc);}};}function respondWithFilteredResult(_0x3fbafa,_0x291bac){return function(_0x1adb0e){if(_0x1adb0e){var _0x208d7f=typeof _0x291bac[_0x95fb('0x2e')]===_0x95fb('0x2f')&&typeof _0x291bac[_0x95fb('0x30')]==='undefined';var _0x3bfcba=_0x1adb0e['count'];var _0x3c42f5=_0x208d7f?0x0:_0x291bac['offset'];var _0x4805ab=_0x208d7f?_0x1adb0e['count']:_0x291bac[_0x95fb('0x2e')]+_0x291bac['limit'];var _0xd15eb0;if(_0x4805ab>=_0x3bfcba){_0x4805ab=_0x3bfcba;_0xd15eb0=0xc8;}else{_0xd15eb0=0xce;}_0x3fbafa[_0x95fb('0x2c')](_0xd15eb0);return _0x3fbafa[_0x95fb('0x31')]('Content-Range',_0x3c42f5+'-'+_0x4805ab+'/'+_0x3bfcba)[_0x95fb('0x2d')](_0x1adb0e);}return null;};}function patchUpdates(_0x166628){return function(_0x30f194){try{jsonpatch[_0x95fb('0x32')](_0x30f194,_0x166628,!![]);}catch(_0x54d052){return BPromise[_0x95fb('0x33')](_0x54d052);}return _0x30f194[_0x95fb('0x34')]();};}function saveUpdates(_0x51af03,_0x441871){return function(_0x40dd01){if(_0x40dd01){return _0x40dd01[_0x95fb('0x35')](_0x51af03)[_0x95fb('0x21')](function(_0x59249c){return _0x59249c;});}return null;};}function removeEntity(_0x3ce93c,_0x5c6744){return function(_0x5cacbc){if(_0x5cacbc){return _0x5cacbc[_0x95fb('0x36')]()[_0x95fb('0x21')](function(){var _0x31b0e0=_0x5cacbc['get']({'plain':!![]});var _0x26c3b1=_0x95fb('0x37');return db[_0x95fb('0x38')][_0x95fb('0x36')]({'where':{'type':_0x26c3b1,'resourceId':_0x31b0e0['id']}})[_0x95fb('0x21')](function(){return _0x5cacbc;});})[_0x95fb('0x21')](function(){_0x3ce93c['status'](0xcc)[_0x95fb('0x2b')]();});}};}function handleEntityNotFound(_0x5d4f18,_0x494333){return function(_0x337f64){if(!_0x337f64){_0x5d4f18['sendStatus'](0x194);}return _0x337f64;};}function handleError(_0x52e3c4,_0x2e6b39){_0x2e6b39=_0x2e6b39||0x1f4;return function(_0x15c318){logger[_0x95fb('0x27')](_0x15c318[_0x95fb('0x39')]);if(_0x15c318[_0x95fb('0x3a')]){delete _0x15c318[_0x95fb('0x3a')];}_0x52e3c4['status'](_0x2e6b39)[_0x95fb('0x3b')](_0x15c318);};}exports['index']=function(_0x537ea9,_0x3afcdf){var _0x28686c={'include':[{'model':db[_0x95fb('0x3c')],'as':_0x95fb('0x3d')}]},_0x2541ea={},_0x566dbc={'count':0x0,'rows':[]};var _0xb7b3e7=_[_0x95fb('0x3e')](db['FaxAccount'][_0x95fb('0x3f')],function(_0x1efe8d){return{'name':_0x1efe8d['fieldName'],'type':_0x1efe8d[_0x95fb('0x40')]['key']};});_0x2541ea[_0x95fb('0x41')]=_[_0x95fb('0x3e')](_0xb7b3e7,'name');_0x2541ea['query']=_[_0x95fb('0x42')](_0x537ea9[_0x95fb('0x43')]);_0x2541ea[_0x95fb('0x44')]=_[_0x95fb('0x45')](_0x2541ea[_0x95fb('0x41')],_0x2541ea['query']);_0x28686c[_0x95fb('0x46')]=_[_0x95fb('0x45')](_0x2541ea[_0x95fb('0x41')],qs['fields'](_0x537ea9['query'][_0x95fb('0x47')]));_0x28686c[_0x95fb('0x46')]=_0x28686c[_0x95fb('0x46')]['length']?_0x28686c[_0x95fb('0x46')]:_0x2541ea['model'];if(!_0x537ea9['query'][_0x95fb('0x48')](_0x95fb('0x49'))){_0x28686c['limit']=qs[_0x95fb('0x30')](_0x537ea9['query']['limit']);_0x28686c[_0x95fb('0x2e')]=qs['offset'](_0x537ea9[_0x95fb('0x43')][_0x95fb('0x2e')]);}_0x28686c['order']=qs[_0x95fb('0x4a')](_0x537ea9['query'][_0x95fb('0x4a')]);_0x28686c['where']=qs['filters'](_['pick'](_0x537ea9[_0x95fb('0x43')],_0x2541ea['filters']),_0xb7b3e7);if(_0x537ea9[_0x95fb('0x43')][_0x95fb('0x4b')]){_0x28686c['where']=_[_0x95fb('0x4c')](_0x28686c[_0x95fb('0x4d')],{'$or':_[_0x95fb('0x3e')](_0xb7b3e7,function(_0x312e3c){if(_0x312e3c[_0x95fb('0x40')]!==_0x95fb('0x4e')){var _0x26b180={};_0x26b180[_0x312e3c[_0x95fb('0x3a')]]={'$like':'%'+_0x537ea9[_0x95fb('0x43')][_0x95fb('0x4b')]+'%'};return _0x26b180;}})});}_0x28686c=_[_0x95fb('0x4c')]({},_0x28686c,_0x537ea9['options']);var _0x325f9c={'where':_0x28686c[_0x95fb('0x4d')]};return db[_0x95fb('0x4f')][_0x95fb('0x50')](_0x325f9c)[_0x95fb('0x21')](function(_0xf6fecb){_0x566dbc[_0x95fb('0x50')]=_0xf6fecb;if(_0x537ea9[_0x95fb('0x43')][_0x95fb('0x51')]){_0x28686c[_0x95fb('0x52')]=[{'all':!![]}];}return db[_0x95fb('0x4f')][_0x95fb('0x53')](_0x28686c);})['then'](function(_0x42f9a3){_0x566dbc[_0x95fb('0x54')]=_0x42f9a3;return _0x566dbc;})[_0x95fb('0x21')](respondWithFilteredResult(_0x3afcdf,_0x28686c))[_0x95fb('0x2a')](handleError(_0x3afcdf,null));};exports[_0x95fb('0x55')]=function(_0x384fb6,_0x49a4ac){var _0x7e5032={'raw':![],'where':{'id':_0x384fb6['params']['id']},'include':[{'model':db[_0x95fb('0x3c')],'as':'mandatoryDispositionPause'}]},_0x499259={};_0x499259[_0x95fb('0x41')]=_['keys'](db[_0x95fb('0x4f')][_0x95fb('0x3f')]);_0x499259[_0x95fb('0x43')]=_['keys'](_0x384fb6[_0x95fb('0x43')]);_0x499259[_0x95fb('0x44')]=_['intersection'](_0x499259[_0x95fb('0x41')],_0x499259['query']);_0x7e5032[_0x95fb('0x46')]=_[_0x95fb('0x45')](_0x499259[_0x95fb('0x41')],qs[_0x95fb('0x47')](_0x384fb6[_0x95fb('0x43')][_0x95fb('0x47')]));_0x7e5032[_0x95fb('0x46')]=_0x7e5032['attributes'][_0x95fb('0x56')]?_0x7e5032['attributes']:_0x499259[_0x95fb('0x41')];if(_0x384fb6[_0x95fb('0x43')][_0x95fb('0x51')]){_0x7e5032[_0x95fb('0x52')]=[{'all':!![]}];}_0x7e5032=_[_0x95fb('0x4c')]({},_0x7e5032,_0x384fb6[_0x95fb('0x57')]);return db['FaxAccount'][_0x95fb('0x58')](_0x7e5032)['then'](handleEntityNotFound(_0x49a4ac,null))[_0x95fb('0x21')](respondWithResult(_0x49a4ac,null))[_0x95fb('0x2a')](handleError(_0x49a4ac,null));};exports[_0x95fb('0x59')]=function(_0x2b8337,_0x9bb5f1){return db[_0x95fb('0x4f')]['create'](_0x2b8337[_0x95fb('0x5a')],{})['then'](function(_0x4b1d6e){var _0xab0a86=_0x2b8337['user'][_0x95fb('0x5b')]({'plain':!![]});if(!_0xab0a86)throw new Error(_0x95fb('0x5c'));if(_0xab0a86['role']===_0x95fb('0x5d')){var _0x573ca9=_0x4b1d6e['get']({'plain':!![]});var _0x472515='FaxAccounts';return db[_0x95fb('0x5e')][_0x95fb('0x58')]({'where':{'name':_0x472515,'userProfileId':_0xab0a86['userProfileId']},'raw':!![]})[_0x95fb('0x21')](function(_0x1de07b){if(_0x1de07b&&_0x1de07b['autoAssociation']===0x0){return db[_0x95fb('0x38')]['create']({'name':_0x573ca9[_0x95fb('0x3a')],'resourceId':_0x573ca9['id'],'type':_0x1de07b[_0x95fb('0x3a')],'sectionId':_0x1de07b['id']},{})[_0x95fb('0x21')](function(){return _0x4b1d6e;});}else{return _0x4b1d6e;}})[_0x95fb('0x2a')](function(_0x307be5){logger[_0x95fb('0x27')](_0x95fb('0x5f'),_0x307be5);throw _0x307be5;});}return _0x4b1d6e;})[_0x95fb('0x21')](respondWithResult(_0x9bb5f1,0xc9))[_0x95fb('0x2a')](handleError(_0x9bb5f1,null));};exports[_0x95fb('0x35')]=function(_0x56c2d3,_0x2ca213){if(_0x56c2d3[_0x95fb('0x5a')]['id']){delete _0x56c2d3[_0x95fb('0x5a')]['id'];}return db[_0x95fb('0x4f')][_0x95fb('0x58')]({'where':{'id':_0x56c2d3['params']['id']},'include':[{'model':db[_0x95fb('0x3c')],'as':_0x95fb('0x3d')}]})[_0x95fb('0x21')](handleEntityNotFound(_0x2ca213,null))[_0x95fb('0x21')](saveUpdates(_0x56c2d3[_0x95fb('0x5a')],null))[_0x95fb('0x21')](respondWithResult(_0x2ca213,null))[_0x95fb('0x2a')](handleError(_0x2ca213,null));};exports[_0x95fb('0x36')]=function(_0x31f13e,_0x19e77b){return db[_0x95fb('0x4f')][_0x95fb('0x58')]({'where':{'id':_0x31f13e[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x19e77b,null))[_0x95fb('0x21')](removeEntity(_0x19e77b,null))[_0x95fb('0x2a')](handleError(_0x19e77b,null));};exports[_0x95fb('0x61')]=function(_0x56a9bc,_0x9a6e7){return db['FaxAccount'][_0x95fb('0x61')]()['then'](respondWithResult(_0x9a6e7,null))['catch'](handleError(_0x9a6e7,null));};exports['addDisposition']=function(_0x24bca2,_0x169b06,_0x10be34){if(_0x24bca2[_0x95fb('0x5a')]['id']){delete _0x24bca2[_0x95fb('0x5a')]['id'];}return db['FaxAccount'][_0x95fb('0x58')]({'where':{'id':_0x24bca2[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x169b06,null))[_0x95fb('0x21')](function(_0x5a133b){if(_0x5a133b){_0x24bca2['body'][_0x95fb('0x62')]=_0x5a133b['id'];return db['Disposition']['create'](_0x24bca2[_0x95fb('0x5a')]);}})[_0x95fb('0x21')](respondWithResult(_0x169b06,null))[_0x95fb('0x2a')](handleError(_0x169b06,null));};exports['getDispositions']=function(_0x5f3388,_0x2ba1fa,_0x9d6681){var _0x16f058={'raw':![],'where':{}};var _0x33b2fe={};var _0x46ddb9={'count':0x0,'rows':[]};return db[_0x95fb('0x4f')]['findOne']({'where':{'id':_0x5f3388[_0x95fb('0x60')]['id']}})['then'](handleEntityNotFound(_0x2ba1fa,null))[_0x95fb('0x21')](function(_0x46d46a){if(_0x46d46a){_0x33b2fe[_0x95fb('0x41')]=_[_0x95fb('0x42')](db[_0x95fb('0x63')]['rawAttributes']);_0x33b2fe['query']=_[_0x95fb('0x42')](_0x5f3388[_0x95fb('0x43')]);_0x33b2fe[_0x95fb('0x44')]=_[_0x95fb('0x45')](_0x33b2fe[_0x95fb('0x41')],_0x33b2fe['query']);_0x16f058[_0x95fb('0x46')]=_['intersection'](_0x33b2fe[_0x95fb('0x41')],qs['fields'](_0x5f3388[_0x95fb('0x43')][_0x95fb('0x47')]));_0x16f058[_0x95fb('0x46')]=_0x16f058[_0x95fb('0x46')][_0x95fb('0x56')]?_0x16f058['attributes']:_0x33b2fe[_0x95fb('0x41')];if(!_0x5f3388['query']['hasOwnProperty']('nolimit')){_0x16f058[_0x95fb('0x30')]=qs[_0x95fb('0x30')](_0x5f3388[_0x95fb('0x43')][_0x95fb('0x30')]);_0x16f058[_0x95fb('0x2e')]=qs[_0x95fb('0x2e')](_0x5f3388['query'][_0x95fb('0x2e')]);}_0x16f058[_0x95fb('0x64')]=qs[_0x95fb('0x4a')](_0x5f3388[_0x95fb('0x43')]['sort']);_0x16f058[_0x95fb('0x4d')]=qs[_0x95fb('0x44')](_[_0x95fb('0x65')](_0x5f3388[_0x95fb('0x43')],_0x33b2fe[_0x95fb('0x44')]));_0x16f058['where'][_0x95fb('0x62')]=_0x46d46a['id'];if(_0x5f3388[_0x95fb('0x43')][_0x95fb('0x4b')]){_0x16f058[_0x95fb('0x4d')]=_[_0x95fb('0x4c')](_0x16f058[_0x95fb('0x4d')],{'$or':_[_0x95fb('0x3e')](_0x16f058['attributes'],function(_0x10506e){var _0x2e30b6={};_0x2e30b6[_0x10506e]={'$like':'%'+_0x5f3388[_0x95fb('0x43')][_0x95fb('0x4b')]+'%'};return _0x2e30b6;})});}_0x16f058=_[_0x95fb('0x4c')]({},_0x16f058,_0x5f3388[_0x95fb('0x57')]);return db[_0x95fb('0x63')][_0x95fb('0x50')]({'where':_0x16f058['where']})[_0x95fb('0x21')](function(_0x2c1122){_0x46ddb9[_0x95fb('0x50')]=_0x2c1122;if(_0x5f3388[_0x95fb('0x43')][_0x95fb('0x51')]){_0x16f058[_0x95fb('0x52')]=[{'all':!![]}];}return db[_0x95fb('0x63')][_0x95fb('0x53')](_0x16f058);})['then'](function(_0x1d84d6){_0x46ddb9[_0x95fb('0x54')]=_0x1d84d6;return _0x46ddb9;});}})[_0x95fb('0x21')](respondWithFilteredResult(_0x2ba1fa,_0x16f058))[_0x95fb('0x2a')](handleError(_0x2ba1fa,null));};exports['removeDispositions']=function(_0x40efe0,_0x556a40,_0x4d1baa){return db[_0x95fb('0x4f')]['find']({'where':{'id':_0x40efe0[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x556a40,null))[_0x95fb('0x21')](function(_0x5b7eb8){if(_0x5b7eb8){return _0x5b7eb8[_0x95fb('0x66')](_0x40efe0['query'][_0x95fb('0x67')]);}})[_0x95fb('0x21')](respondWithStatusCode(_0x556a40,null))[_0x95fb('0x2a')](handleError(_0x556a40,null));};exports[_0x95fb('0x68')]=function(_0x356541,_0x2be86f,_0x3a6110){if(_0x356541[_0x95fb('0x5a')]['id']){delete _0x356541[_0x95fb('0x5a')]['id'];}return db[_0x95fb('0x4f')][_0x95fb('0x58')]({'where':{'id':_0x356541[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x2be86f,null))[_0x95fb('0x21')](function(_0x533eac){if(_0x533eac){_0x356541[_0x95fb('0x5a')]['FaxAccountId']=_0x533eac['id'];return db[_0x95fb('0x69')]['create'](_0x356541[_0x95fb('0x5a')]);}})[_0x95fb('0x21')](respondWithResult(_0x2be86f,null))[_0x95fb('0x2a')](handleError(_0x2be86f,null));};exports[_0x95fb('0x6a')]=function(_0x331907,_0x3dba42,_0x5b6c64){var _0x5ce4ae={'raw':![],'where':{}};var _0x253fcb={};var _0x1057a5={'count':0x0,'rows':[]};return db[_0x95fb('0x4f')][_0x95fb('0x6b')]({'where':{'id':_0x331907['params']['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x3dba42,null))[_0x95fb('0x21')](function(_0x146f28){if(_0x146f28){_0x253fcb[_0x95fb('0x41')]=_[_0x95fb('0x42')](db[_0x95fb('0x69')]['rawAttributes']);_0x253fcb[_0x95fb('0x43')]=_[_0x95fb('0x42')](_0x331907[_0x95fb('0x43')]);_0x253fcb[_0x95fb('0x44')]=_['intersection'](_0x253fcb[_0x95fb('0x41')],_0x253fcb[_0x95fb('0x43')]);_0x5ce4ae[_0x95fb('0x46')]=_['intersection'](_0x253fcb[_0x95fb('0x41')],qs['fields'](_0x331907[_0x95fb('0x43')][_0x95fb('0x47')]));_0x5ce4ae[_0x95fb('0x46')]=_0x5ce4ae[_0x95fb('0x46')][_0x95fb('0x56')]?_0x5ce4ae[_0x95fb('0x46')]:_0x253fcb['model'];if(!_0x331907[_0x95fb('0x43')][_0x95fb('0x48')](_0x95fb('0x49'))){_0x5ce4ae[_0x95fb('0x30')]=qs[_0x95fb('0x30')](_0x331907[_0x95fb('0x43')][_0x95fb('0x30')]);_0x5ce4ae[_0x95fb('0x2e')]=qs[_0x95fb('0x2e')](_0x331907[_0x95fb('0x43')]['offset']);}_0x5ce4ae[_0x95fb('0x64')]=qs['sort'](_0x331907['query'][_0x95fb('0x4a')]);_0x5ce4ae[_0x95fb('0x4d')]=qs[_0x95fb('0x44')](_[_0x95fb('0x65')](_0x331907[_0x95fb('0x43')],_0x253fcb[_0x95fb('0x44')]));_0x5ce4ae['where'][_0x95fb('0x62')]=_0x146f28['id'];if(_0x331907[_0x95fb('0x43')][_0x95fb('0x4b')]){_0x5ce4ae[_0x95fb('0x4d')]=_[_0x95fb('0x4c')](_0x5ce4ae[_0x95fb('0x4d')],{'$or':_[_0x95fb('0x3e')](_0x5ce4ae[_0x95fb('0x46')],function(_0x55433f){var _0x2daf19={};_0x2daf19[_0x55433f]={'$like':'%'+_0x331907[_0x95fb('0x43')]['filter']+'%'};return _0x2daf19;})});}_0x5ce4ae=_[_0x95fb('0x4c')]({},_0x5ce4ae,_0x331907[_0x95fb('0x57')]);return db[_0x95fb('0x69')][_0x95fb('0x50')]({'where':_0x5ce4ae[_0x95fb('0x4d')]})[_0x95fb('0x21')](function(_0x131d5f){_0x1057a5[_0x95fb('0x50')]=_0x131d5f;if(_0x331907[_0x95fb('0x43')][_0x95fb('0x51')]){_0x5ce4ae[_0x95fb('0x52')]=[{'all':!![]}];}return db[_0x95fb('0x69')][_0x95fb('0x53')](_0x5ce4ae);})['then'](function(_0x52080c){_0x1057a5[_0x95fb('0x54')]=_0x52080c;return _0x1057a5;});}})['then'](respondWithFilteredResult(_0x3dba42,_0x5ce4ae))[_0x95fb('0x2a')](handleError(_0x3dba42,null));};exports[_0x95fb('0x6c')]=function(_0x3cc951,_0x16c626,_0x373767){return db[_0x95fb('0x4f')][_0x95fb('0x58')]({'where':{'id':_0x3cc951[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x16c626,null))['then'](function(_0x12b6fa){if(_0x12b6fa){return _0x12b6fa[_0x95fb('0x6c')](_0x3cc951[_0x95fb('0x43')][_0x95fb('0x67')]);}})[_0x95fb('0x21')](respondWithStatusCode(_0x16c626,null))[_0x95fb('0x2a')](handleError(_0x16c626,null));};exports[_0x95fb('0x6d')]=function(_0x24ebe3,_0x54476d,_0x11ba82){return db[_0x95fb('0x6e')][_0x95fb('0x58')]({'where':{'id':_0x24ebe3[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x54476d,null))[_0x95fb('0x21')](function(_0x10ea92){if(_0x10ea92){return _0x10ea92[_0x95fb('0x6d')](_0x24ebe3['body'][_0x95fb('0x67')],_[_0x95fb('0x6f')](_0x24ebe3[_0x95fb('0x5a')],[_0x95fb('0x67'),'id'])||{});}})[_0x95fb('0x21')](respondWithResult(_0x54476d,null))[_0x95fb('0x2a')](handleError(_0x54476d,null));};exports[_0x95fb('0x70')]=function(_0xf17852,_0x5c3de3,_0x185829){var _0x39ac44={'raw':![],'where':{}};var _0x161130={};var _0x3c7497={'count':0x0,'rows':[]};return db[_0x95fb('0x4f')][_0x95fb('0x6b')]({'where':{'id':_0xf17852[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x5c3de3,null))[_0x95fb('0x21')](function(_0x5a6ced){if(_0x5a6ced){_0x161130[_0x95fb('0x41')]=_['keys'](db[_0x95fb('0x6e')][_0x95fb('0x3f')]);_0x161130[_0x95fb('0x43')]=_[_0x95fb('0x42')](_0xf17852[_0x95fb('0x43')]);_0x161130[_0x95fb('0x44')]=_[_0x95fb('0x45')](_0x161130[_0x95fb('0x41')],_0x161130[_0x95fb('0x43')]);_0x39ac44[_0x95fb('0x46')]=_[_0x95fb('0x45')](_0x161130['model'],qs[_0x95fb('0x47')](_0xf17852[_0x95fb('0x43')][_0x95fb('0x47')]));_0x39ac44[_0x95fb('0x46')]=_0x39ac44['attributes'][_0x95fb('0x56')]?_0x39ac44['attributes']:_0x161130[_0x95fb('0x41')];if(!_0xf17852[_0x95fb('0x43')][_0x95fb('0x48')](_0x95fb('0x49'))){_0x39ac44['limit']=qs[_0x95fb('0x30')](_0xf17852[_0x95fb('0x43')]['limit']);_0x39ac44['offset']=qs[_0x95fb('0x2e')](_0xf17852['query'][_0x95fb('0x2e')]);}_0x39ac44[_0x95fb('0x64')]=qs[_0x95fb('0x4a')](_0xf17852[_0x95fb('0x43')][_0x95fb('0x4a')]);_0x39ac44['where']=qs['filters'](_['pick'](_0xf17852[_0x95fb('0x43')],_0x161130['filters']));_0x39ac44['where'][_0x95fb('0x62')]=_0x5a6ced['id'];if(_0xf17852[_0x95fb('0x43')][_0x95fb('0x4b')]){_0x39ac44['where']=_[_0x95fb('0x4c')](_0x39ac44['where'],{'$or':_[_0x95fb('0x3e')](_0x39ac44[_0x95fb('0x46')],function(_0x3198aa){var _0xf816cd={};_0xf816cd[_0x3198aa]={'$like':'%'+_0xf17852[_0x95fb('0x43')][_0x95fb('0x4b')]+'%'};return _0xf816cd;})});}_0x39ac44=_[_0x95fb('0x4c')]({},_0x39ac44,_0xf17852[_0x95fb('0x57')]);return db[_0x95fb('0x6e')][_0x95fb('0x50')]({'where':_0x39ac44['where']})['then'](function(_0x2e5e0b){_0x3c7497[_0x95fb('0x50')]=_0x2e5e0b;if(_0xf17852['query'][_0x95fb('0x51')]){_0x39ac44[_0x95fb('0x52')]=[{'model':db[_0x95fb('0x71')],'as':_0x95fb('0x72'),'required':![]},{'model':db[_0x95fb('0x73')],'as':_0x95fb('0x74'),'attributes':[_0x95fb('0x3a'),_0x95fb('0x75'),_0x95fb('0x76')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0xf17852['query'][_0x95fb('0x77')]?{'id':_0xf17852[_0x95fb('0x43')][_0x95fb('0x77')]}:undefined,'required':_0xf17852[_0x95fb('0x43')][_0x95fb('0x77')]?!![]:![]}];}return db[_0x95fb('0x6e')][_0x95fb('0x53')](_0x39ac44);})[_0x95fb('0x21')](function(_0x4601ae){_0x3c7497[_0x95fb('0x54')]=_0x4601ae;return _0x3c7497;});}})[_0x95fb('0x21')](respondWithFilteredResult(_0x5c3de3,_0x39ac44))['catch'](handleError(_0x5c3de3,null));};exports['addApplications']=function(_0x5416d4,_0x4ea663){var _0x340dc5=_0x5416d4[_0x95fb('0x60')]['id'];var _0x3954e7=_0x5416d4['body'];var _0x1818a4=0xc8;var _0x41e3c9=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x95fb('0x78')][_0x95fb('0x79')][_0x95fb('0x7a')]['READ_COMMITTED']},function(_0x5a4ccc){return db[_0x95fb('0x4f')]['findOne']({'where':{'id':_0x340dc5},'transaction':_0x5a4ccc})[_0x95fb('0x21')](function(_0x2c8f11){if(_0x2c8f11){return db[_0x95fb('0x7b')]['destroy']({'where':{'FaxAccountId':_0x340dc5},'transaction':_0x5a4ccc})[_0x95fb('0x21')](function(){var _0x591664=_[_0x95fb('0x3e')](_0x3954e7,function(_0x40b73f){_0x40b73f['FaxAccountId']=_0x340dc5;return _0x40b73f;});return db[_0x95fb('0x7b')][_0x95fb('0x7c')](_0x591664,{'transaction':_0x5a4ccc});});}else{_0x1818a4=0x194;_0x41e3c9=[];}});})[_0x95fb('0x21')](function(){if(_0x1818a4!==0x194){return db['FaxApplication'][_0x95fb('0x7d')]({'where':{'FaxAccountId':_0x340dc5},'order':'priority'})[_0x95fb('0x21')](function(_0x498002){_0x41e3c9=_0x498002;});}})['catch'](function(_0x117085){_0x1818a4=0x1f4;logger[_0x95fb('0x27')](_0x117085[_0x95fb('0x39')]);if(_0x117085[_0x95fb('0x3a')]){delete _0x117085[_0x95fb('0x3a')];}_0x41e3c9=_0x117085;})['finally'](function(){if(_0x41e3c9===null){_0x4ea663['sendStatus'](_0x1818a4);}else{if(_0x1818a4===0x1f4){_0x4ea663[_0x95fb('0x2c')](_0x1818a4)[_0x95fb('0x3b')](_0x41e3c9);}else{_0x4ea663[_0x95fb('0x2c')](_0x1818a4)[_0x95fb('0x2d')](_0x41e3c9);}}});};exports[_0x95fb('0x7e')]=function(_0x2c6da7,_0x3e6bcb,_0x326969){var _0x420008={};var _0x5ebe91={};var _0x165011;var _0x29d059;return db[_0x95fb('0x4f')][_0x95fb('0x6b')]({'where':{'id':_0x2c6da7[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x3e6bcb,null))['then'](function(_0x10a142){if(_0x10a142){_0x165011=_0x10a142;_0x5ebe91[_0x95fb('0x41')]=_['keys'](db[_0x95fb('0x7b')][_0x95fb('0x3f')]);_0x5ebe91[_0x95fb('0x43')]=_[_0x95fb('0x42')](_0x2c6da7[_0x95fb('0x43')]);_0x5ebe91['filters']=_[_0x95fb('0x45')](_0x5ebe91[_0x95fb('0x41')],_0x5ebe91[_0x95fb('0x43')]);_0x420008[_0x95fb('0x46')]=_['intersection'](_0x5ebe91[_0x95fb('0x41')],qs[_0x95fb('0x47')](_0x2c6da7['query'][_0x95fb('0x47')]));_0x420008[_0x95fb('0x46')]=_0x420008['attributes'][_0x95fb('0x56')]?_0x420008['attributes']:_0x5ebe91[_0x95fb('0x41')];_0x420008[_0x95fb('0x64')]=qs['sort'](_0x2c6da7[_0x95fb('0x43')]['sort']);_0x420008[_0x95fb('0x4d')]=qs[_0x95fb('0x44')](_[_0x95fb('0x65')](_0x2c6da7[_0x95fb('0x43')],_0x5ebe91['filters']));if(_0x2c6da7[_0x95fb('0x43')][_0x95fb('0x4b')]){_0x420008[_0x95fb('0x4d')]=_[_0x95fb('0x4c')](_0x420008[_0x95fb('0x4d')],{'$or':_['map'](_0x420008['attributes'],function(_0x4626ca){var _0x4d2fc9={};_0x4d2fc9[_0x4626ca]={'$like':'%'+_0x2c6da7[_0x95fb('0x43')][_0x95fb('0x4b')]+'%'};return _0x4d2fc9;})});}_0x420008=_['merge']({},_0x420008,_0x2c6da7[_0x95fb('0x57')]);return _0x165011[_0x95fb('0x7e')](_0x420008);}})[_0x95fb('0x21')](function(_0x389ca3){if(_0x389ca3){_0x29d059=_0x389ca3[_0x95fb('0x56')];if(!_0x2c6da7[_0x95fb('0x43')][_0x95fb('0x48')](_0x95fb('0x49'))){_0x420008[_0x95fb('0x30')]=qs[_0x95fb('0x30')](_0x2c6da7[_0x95fb('0x43')][_0x95fb('0x30')]);_0x420008[_0x95fb('0x2e')]=qs['offset'](_0x2c6da7[_0x95fb('0x43')][_0x95fb('0x2e')]);}return _0x165011['getApplications'](_0x420008);}})[_0x95fb('0x21')](function(_0x84c6d9){if(_0x84c6d9){return _0x84c6d9?{'count':_0x29d059,'rows':_0x84c6d9}:null;}})[_0x95fb('0x21')](respondWithResult(_0x3e6bcb,null))['catch'](handleError(_0x3e6bcb,null));};function Extension(_0x5beece,_0x54c875,_0x28dc3e,_0x32e7aa){this[_0x95fb('0x7f')]=_0x95fb('0x80');this['exten']=_0x5beece[_0x95fb('0x81')];this[_0x95fb('0x82')]=_0x32e7aa;this[_0x95fb('0x40')]=_0x95fb('0x83');this[_0x95fb('0x84')]='Fax\x20Extension';this['FaxAccountId']=_0x5beece['id'];this[_0x95fb('0x85')]=_0x54c875;this[_0x95fb('0x86')]=_0x28dc3e;}function createExtensionsReciveFax(_0x56916d){var _0xa0a94f=0x1;var _0x2f0e6d=[];_0x2f0e6d[_0x95fb('0x87')](new Extension(_0x56916d,_0xa0a94f,'',_0x95fb('0x88')));_0xa0a94f+=0x1;_0x2f0e6d[_0x95fb('0x87')](new Extension(_0x56916d,_0xa0a94f,'CDR(type)=inbound-fax','Set'));_0xa0a94f+=0x1;for(var _0x30640e in _0x56916d){if(_0x56916d[_0x95fb('0x48')](_0x30640e)&&(_0x30640e===_0x95fb('0x89')||_0x30640e==='localstationid'||_0x30640e===_0x95fb('0x8a')||_0x30640e===_0x95fb('0x8b')||_0x30640e==='headerinfo'||_0x30640e===_0x95fb('0x8c')||_0x30640e===_0x95fb('0x8d')||_0x30640e==='modem'||_0x30640e==='t38timeout')){_0x2f0e6d[_0x95fb('0x87')](new Extension(_0x56916d,_0xa0a94f,_0x95fb('0x8e')+_0x30640e+')='+_0x56916d[_0x30640e],_0x95fb('0x8f')));_0xa0a94f+=0x1;}}_0x2f0e6d[_0x95fb('0x87')](new Extension(_0x56916d,_0xa0a94f,'6','Wait'));_0xa0a94f+=0x1;_0x2f0e6d[_0x95fb('0x87')](new Extension(_0x56916d,_0xa0a94f,_0x95fb('0x90'),_0x95fb('0x91')));_0xa0a94f=0x0;return _0x2f0e6d;}exports['addAccountApplications']=function(_0x24a2e8,_0x5b4ec5,_0x6ea9c6){var _0x4bbc90;return db[_0x95fb('0x78')][_0x95fb('0x92')](function(_0x495aa0){return db[_0x95fb('0x4f')][_0x95fb('0x59')](_0x24a2e8['body'],{'transaction':_0x495aa0})[_0x95fb('0x21')](function(_0x458135){_0x4bbc90=_0x458135[_0x95fb('0x5b')]({'plain':!![]});return db['VoiceExtension'][_0x95fb('0x7c')](createExtensionsReciveFax(_0x4bbc90),{'transaction':_0x495aa0});});})[_0x95fb('0x21')](function(){return _0x4bbc90;})[_0x95fb('0x21')](respondWithResult(_0x5b4ec5,null))[_0x95fb('0x2a')](handleError(_0x5b4ec5,null));};exports[_0x95fb('0x93')]=function(_0x1d03d1,_0x365eec,_0x39fa78){var _0x29caf6;return db[_0x95fb('0x78')][_0x95fb('0x92')](function(_0x40735a){return db[_0x95fb('0x4f')][_0x95fb('0x35')](_0x1d03d1[_0x95fb('0x5a')],{'where':{'id':_0x1d03d1['body']['id']},'transaction':_0x40735a})['then'](function(_0x3a4109){return db[_0x95fb('0x94')][_0x95fb('0x36')]({'where':{'FaxAccountId':_0x1d03d1[_0x95fb('0x5a')]['id']},'transaction':_0x40735a})[_0x95fb('0x21')](function(_0x57304f){return db[_0x95fb('0x94')][_0x95fb('0x7c')](createExtensionsReciveFax(_['omit'](_0x1d03d1[_0x95fb('0x5a')],['tech',_0x95fb('0x95'),_0x95fb('0x96'),'updatedAt','TrunkId',_0x95fb('0x97')])),{'transaction':_0x40735a});});});})[_0x95fb('0x21')](function(){return db[_0x95fb('0x4f')][_0x95fb('0x98')](_0x1d03d1[_0x95fb('0x5a')]['id']);})['then'](respondWithResult(_0x365eec,null))[_0x95fb('0x2a')](handleError(_0x365eec,null));};exports[_0x95fb('0x99')]=function(_0x5a38bf,_0x4c1f43,_0x474617){var _0x4fa662={'raw':!![],'where':{}};var _0x3a0a44={};var _0x59a29d={'count':0x0,'rows':[]};return db[_0x95fb('0x4f')]['findOne']({'where':{'id':_0x5a38bf[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x4c1f43,null))['then'](function(_0x329519){if(_0x329519){_0x3a0a44[_0x95fb('0x41')]=_[_0x95fb('0x42')](db[_0x95fb('0x9a')][_0x95fb('0x3f')]);_0x3a0a44[_0x95fb('0x43')]=_[_0x95fb('0x42')](_0x5a38bf[_0x95fb('0x43')]);_0x3a0a44[_0x95fb('0x44')]=_[_0x95fb('0x45')](_0x3a0a44[_0x95fb('0x41')],_0x3a0a44['query']);_0x4fa662[_0x95fb('0x46')]=_[_0x95fb('0x45')](_0x3a0a44[_0x95fb('0x41')],qs[_0x95fb('0x47')](_0x5a38bf['query'][_0x95fb('0x47')]));_0x4fa662[_0x95fb('0x46')]=_0x4fa662['attributes'][_0x95fb('0x56')]?_0x4fa662[_0x95fb('0x46')]:_0x3a0a44[_0x95fb('0x41')];if(!_0x5a38bf[_0x95fb('0x43')]['hasOwnProperty']('nolimit')){_0x4fa662[_0x95fb('0x30')]=qs[_0x95fb('0x30')](_0x5a38bf[_0x95fb('0x43')][_0x95fb('0x30')]);_0x4fa662['offset']=qs[_0x95fb('0x2e')](_0x5a38bf['query'][_0x95fb('0x2e')]);}_0x4fa662[_0x95fb('0x64')]=qs['sort'](_0x5a38bf[_0x95fb('0x43')]['sort']);_0x4fa662[_0x95fb('0x4d')]=qs[_0x95fb('0x44')](_['pick'](_0x5a38bf['query'],_0x3a0a44[_0x95fb('0x44')]));_0x4fa662['where'][_0x95fb('0x62')]=_0x329519['id'];if(_0x5a38bf['query'][_0x95fb('0x4b')]){_0x4fa662[_0x95fb('0x4d')]=_[_0x95fb('0x4c')](_0x4fa662[_0x95fb('0x4d')],{'$or':_[_0x95fb('0x3e')](_0x4fa662[_0x95fb('0x46')],function(_0x4d40ee){var _0x224525={};_0x224525[_0x4d40ee]={'$like':'%'+_0x5a38bf['query']['filter']+'%'};return _0x224525;})});}if(_0x5a38bf[_0x95fb('0x43')][_0x95fb('0x9b')]){var _0x2e3925=_0x5a38bf[_0x95fb('0x43')][_0x95fb('0x9b')]['split'](',');var _0x4b5af1={};_0x4b5af1[_0x2e3925[0x0]]={'$gte':moment(_0x2e3925[0x1])[_0x95fb('0x9c')](_0x95fb('0x9d'))};_0x4fa662[_0x95fb('0x4d')]=_['merge'](_0x4fa662['where'],_0x4b5af1);}_0x4fa662=_['merge']({},_0x4fa662,_0x5a38bf[_0x95fb('0x57')]);return db['FaxMessage'][_0x95fb('0x50')]({'where':_0x4fa662[_0x95fb('0x4d')]})[_0x95fb('0x21')](function(_0x562b10){_0x59a29d['count']=_0x562b10;if(_0x5a38bf[_0x95fb('0x43')][_0x95fb('0x51')]){_0x4fa662['include']=[{'all':!![]}];}return db[_0x95fb('0x9a')][_0x95fb('0x53')](_0x4fa662);})[_0x95fb('0x21')](function(_0x5cd7d3){_0x59a29d['rows']=_0x5cd7d3;return _0x59a29d;});}})[_0x95fb('0x21')](respondWithFilteredResult(_0x4c1f43,_0x4fa662))['catch'](handleError(_0x4c1f43,null));};exports[_0x95fb('0x3b')]=function(_0x29ebdd,_0x245e26,_0x430164){var _0x30ef52,_0x5f32eb={},_0x1d6f64;if(_0x29ebdd['body']['to']){_0x1d6f64=_0x29ebdd[_0x95fb('0x5a')]['to'][0x0];}return db[_0x95fb('0x4f')][_0x95fb('0x58')]({'where':{'id':_0x29ebdd[_0x95fb('0x60')]['id']},'include':[{'model':db[_0x95fb('0x9e')],'as':_0x95fb('0x9f'),'include':[{'model':db[_0x95fb('0x71')],'as':_0x95fb('0xa0'),'where':{'fax':_0x1d6f64},'limit':0x1,'order':[[_0x95fb('0xa1'),'DESC']]}]}]})[_0x95fb('0x21')](handleEntityNotFound(_0x245e26,null))[_0x95fb('0x21')](function(_0x3f6289){_0x30ef52=_0x3f6289;if(_0x29ebdd[_0x95fb('0x5a')][_0x95fb('0xa2')]&&_0x29ebdd[_0x95fb('0x5a')][_0x95fb('0xa2')][_0x95fb('0x56')]){for(var _0x546ca2=0x0;_0x546ca2<_0x29ebdd[_0x95fb('0x5a')][_0x95fb('0xa2')][_0x95fb('0x56')];_0x546ca2+=0x1){_0x29ebdd[_0x95fb('0x5a')][_0x95fb('0xa2')][_0x546ca2]={'filename':_0x29ebdd['body']['attachments'][_0x546ca2][_0x95fb('0x3a')],'id':_0x29ebdd[_0x95fb('0x5a')][_0x95fb('0xa2')][_0x546ca2]['id'],'path':path[_0x95fb('0xa3')](config[_0x95fb('0xa4')],_0x95fb('0xa5'),_0x29ebdd[_0x95fb('0x5a')][_0x95fb('0xa2')][_0x546ca2]['basename'])};}}return respondWithRpcPromise(_0x95fb('0xa6'),_0x95fb('0xa6'),{'FaxAccountId':_['isNil'](_0x29ebdd['params']['id'])?undefined:_0x29ebdd[_0x95fb('0x60')]['id'],'path':_['isNil'](_0x29ebdd['body'][_0x95fb('0xa2')][0x0]['path'])?undefined:_0x29ebdd[_0x95fb('0x5a')][_0x95fb('0xa2')][0x0][_0x95fb('0x7')],'fax':_[_0x95fb('0xa7')](_0x29ebdd[_0x95fb('0x5a')]['to'][0x0])?undefined:_0x29ebdd[_0x95fb('0x5a')]['to'][0x0]},client9002);})[_0x95fb('0x21')](function(){if(_0x30ef52){if(_[_0x95fb('0xa7')](_0x29ebdd['body'][_0x95fb('0xa8')])){_0x29ebdd[_0x95fb('0x5a')]['from']=util['format'](_0x95fb('0xa9'),_0x30ef52['name'],_0x30ef52[_0x95fb('0xaa')]);}if(_0x30ef52[_0x95fb('0x9f')]){if(_0x30ef52[_0x95fb('0x9f')][_0x95fb('0xa0')][_0x95fb('0x56')]){return _0x30ef52[_0x95fb('0x9f')][_0x95fb('0xa0')][0x0];}else{return db[_0x95fb('0x71')][_0x95fb('0x59')](_[_0x95fb('0xab')](_0x29ebdd[_0x95fb('0x5a')],{'firstName':_0x29ebdd['body']['to'][0x0],'phone':_0x29ebdd['body']['to'][0x0],'fax':_0x29ebdd[_0x95fb('0x5a')]['to'][0x0],'ListId':_0x30ef52[_0x95fb('0x97')]}));}}else{throw new Error(_0x95fb('0xac'));}}else{throw new Error(_0x95fb('0xad'));}})[_0x95fb('0x21')](function(_0x4284c0){if(_0x4284c0){return db['FaxInteraction'][_0x95fb('0x58')]({'where':{'ContactId':_0x4284c0['id'],'closed':![],'FaxAccountId':_0x30ef52['id']}})['then'](function(_0x5285e6){if(_0x5285e6){return[_0x5285e6,![]];}return db[_0x95fb('0x6e')][_0x95fb('0x59')]({'UserId':_0x29ebdd[_0x95fb('0x5d')]['id'],'ContactId':_0x4284c0['id'],'FaxAccountId':_0x30ef52['id'],'fax':_0x29ebdd[_0x95fb('0x5a')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x29ebdd[_0x95fb('0x5a')],{'read':![],'body':_0x29ebdd['body']['attachments'][0x0][_0x95fb('0xae')],'FaxAccountId':_0x30ef52['id'],'UserId':_0x29ebdd[_0x95fb('0x5d')]['id'],'ContactId':_0x4284c0['id'],'AttachmentId':_0x29ebdd[_0x95fb('0x5a')][_0x95fb('0xa2')][0x0]['id']})]},{'include':[{'model':db[_0x95fb('0x9a')],'as':_0x95fb('0xaf')}]})[_0x95fb('0x21')](function(_0x4e6f76){return[_0x4e6f76,!![]];});});}else{throw new Error(_0x95fb('0xb0'));}})[_0x95fb('0xb1')](function(_0x17ac6c,_0x1eb2bd){if(_0x1eb2bd){return _0x17ac6c;}return db[_0x95fb('0x9a')][_0x95fb('0x59')]({'direction':_0x95fb('0xb2'),'read':![],'body':_0x29ebdd['body'][_0x95fb('0xa2')][0x0][_0x95fb('0xae')],'FaxAccountId':_0x30ef52['id'],'FaxInteractionId':_0x17ac6c['id'],'UserId':_0x29ebdd[_0x95fb('0x5d')]['id'],'ContactId':_0x17ac6c[_0x95fb('0xb3')],'AttachmentId':_0x29ebdd[_0x95fb('0x5a')]['attachments'][0x0]['id']})['then'](function(_0x5991a9){_0x17ac6c[_0x95fb('0xb4')][_0x95fb('0xaf')]=[];_0x17ac6c['dataValues']['Messages'][_0x95fb('0x87')](_0x5991a9['dataValues']);return _0x17ac6c;});})[_0x95fb('0x21')](function(_0x93106d){respondWithRpcPromise(_0x95fb('0xb5'),_0x95fb('0xb5'),{'FaxAccountId':_[_0x95fb('0xa7')](_0x29ebdd[_0x95fb('0x60')]['id'])?undefined:_0x29ebdd[_0x95fb('0x60')]['id'],'path':_['isNil'](_0x29ebdd[_0x95fb('0x5a')]['attachments'][0x0]['path'])?undefined:_0x29ebdd[_0x95fb('0x5a')][_0x95fb('0xa2')][0x0][_0x95fb('0x7')],'fax':_[_0x95fb('0xa7')](_0x29ebdd[_0x95fb('0x5a')]['to'][0x0])?undefined:_0x29ebdd[_0x95fb('0x5a')]['to'][0x0],'AttachmentId':_0x29ebdd[_0x95fb('0x5a')][_0x95fb('0xa2')][0x0]['id']},client9002)['then'](function(_0x194645){logger[_0x95fb('0x22')](_0x95fb('0xb6'),_0x194645);})[_0x95fb('0x2a')](function(_0x11a2cd){logger[_0x95fb('0x22')]('SendFaxRpc,\x20%s',_0x11a2cd);});return _0x93106d;})[_0x95fb('0x21')](respondWithResult(_0x245e26,null))[_0x95fb('0x2a')](handleError(_0x245e26,null));};exports[_0x95fb('0xb7')]=function(_0x409fa1,_0x320a43,_0x3ed1ec){return db['FaxAccount']['find']({'where':{'id':_0x409fa1[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x320a43,null))['then'](function(_0x1fbcfb){if(_0x1fbcfb){return _0x1fbcfb['addAgents'](_0x409fa1[_0x95fb('0x5a')]['ids'],_[_0x95fb('0x6f')](_0x409fa1[_0x95fb('0x5a')],[_0x95fb('0x67'),'id'])||{})[_0x95fb('0xb1')](function(_0x4d8699){for(var _0x375cb3=0x0;_0x375cb3<_0x409fa1[_0x95fb('0x5a')]['ids'][_0x95fb('0x56')];_0x375cb3+=0x1){socket[_0x95fb('0xb8')]('userFaxAccount:save',{'UserId':Number(_0x409fa1[_0x95fb('0x5a')]['ids'][_0x375cb3]),'FaxAccountId':Number(_0x409fa1[_0x95fb('0x60')]['id'])});}return _0x4d8699;});}})[_0x95fb('0x21')](respondWithResult(_0x320a43,null))[_0x95fb('0x2a')](handleError(_0x320a43,null));};exports[_0x95fb('0xb9')]=function(_0x33e3fa,_0x31c71b,_0x27a29c){return db['FaxAccount'][_0x95fb('0x58')]({'where':{'id':_0x33e3fa[_0x95fb('0x60')]['id']}})['then'](handleEntityNotFound(_0x31c71b,null))['then'](function(_0x52c7c0){if(_0x52c7c0){return _0x52c7c0[_0x95fb('0xb9')](_0x33e3fa['query']['ids'])[_0x95fb('0x21')](function(){if(_['isArray'](_0x33e3fa[_0x95fb('0x43')][_0x95fb('0x67')])){for(var _0x3601b9=0x0;_0x3601b9<_0x33e3fa[_0x95fb('0x43')][_0x95fb('0x67')][_0x95fb('0x56')];_0x3601b9+=0x1){socket['emit'](_0x95fb('0xba'),{'UserId':Number(_0x33e3fa['query'][_0x95fb('0x67')][_0x3601b9]),'FaxAccountId':Number(_0x33e3fa[_0x95fb('0x60')]['id'])});}}else{socket[_0x95fb('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x33e3fa[_0x95fb('0x43')][_0x95fb('0x67')]),'FaxAccountId':Number(_0x33e3fa[_0x95fb('0x60')]['id'])});}});}})[_0x95fb('0x21')](respondWithStatusCode(_0x31c71b,null))[_0x95fb('0x2a')](handleError(_0x31c71b,null));};exports[_0x95fb('0xbb')]=function(_0x3dc820,_0x1aa01b,_0x4a7013){var _0x34b61a={};var _0x5e8123={};var _0x119c49;var _0xe216ce;return db[_0x95fb('0x4f')][_0x95fb('0x6b')]({'where':{'id':_0x3dc820[_0x95fb('0x60')]['id']}})[_0x95fb('0x21')](handleEntityNotFound(_0x1aa01b,null))[_0x95fb('0x21')](function(_0x1d32b0){if(_0x1d32b0){_0x119c49=_0x1d32b0;_0x5e8123[_0x95fb('0x41')]=_[_0x95fb('0x42')](db[_0x95fb('0x73')][_0x95fb('0x3f')]);_0x5e8123[_0x95fb('0x43')]=_[_0x95fb('0x42')](_0x3dc820['query']);_0x5e8123['filters']=_[_0x95fb('0x45')](_0x5e8123[_0x95fb('0x41')],_0x5e8123['query']);_0x34b61a[_0x95fb('0x46')]=_[_0x95fb('0x45')](_0x5e8123[_0x95fb('0x41')],qs[_0x95fb('0x47')](_0x3dc820[_0x95fb('0x43')][_0x95fb('0x47')]));_0x34b61a[_0x95fb('0x46')]=_0x34b61a['attributes'][_0x95fb('0x56')]?_0x34b61a[_0x95fb('0x46')]:_0x5e8123[_0x95fb('0x41')];_0x34b61a[_0x95fb('0x64')]=qs[_0x95fb('0x4a')](_0x3dc820[_0x95fb('0x43')][_0x95fb('0x4a')]);_0x34b61a[_0x95fb('0x4d')]=qs[_0x95fb('0x44')](_[_0x95fb('0x65')](_0x3dc820[_0x95fb('0x43')],_0x5e8123[_0x95fb('0x44')]));if(_0x3dc820[_0x95fb('0x43')][_0x95fb('0x4b')]){_0x34b61a[_0x95fb('0x4d')]=_[_0x95fb('0x4c')](_0x34b61a[_0x95fb('0x4d')],{'$or':_[_0x95fb('0x3e')](_0x34b61a[_0x95fb('0x46')],function(_0x41f6b9){var _0x4f2c48={};_0x4f2c48[_0x41f6b9]={'$like':'%'+_0x3dc820[_0x95fb('0x43')][_0x95fb('0x4b')]+'%'};return _0x4f2c48;})});}_0x34b61a=_[_0x95fb('0x4c')]({},_0x34b61a,_0x3dc820['options']);return _0x119c49[_0x95fb('0xbb')](_0x34b61a);}})[_0x95fb('0x21')](function(_0x1b1129){if(_0x1b1129){_0xe216ce=_0x1b1129[_0x95fb('0x56')];if(!_0x3dc820[_0x95fb('0x43')][_0x95fb('0x48')](_0x95fb('0x49'))){_0x34b61a['limit']=qs[_0x95fb('0x30')](_0x3dc820[_0x95fb('0x43')]['limit']);_0x34b61a['offset']=qs[_0x95fb('0x2e')](_0x3dc820[_0x95fb('0x43')][_0x95fb('0x2e')]);}return _0x119c49[_0x95fb('0xbb')](_0x34b61a);}})[_0x95fb('0x21')](function(_0x30c770){if(_0x30c770){return _0x30c770?{'count':_0xe216ce,'rows':_0x30c770}:null;}})['then'](respondWithResult(_0x1aa01b,null))[_0x95fb('0x2a')](handleError(_0x1aa01b,null));};
\ No newline at end of file
index b3eb305..c1fba52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x664b=['hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit'];(function(_0x46f066,_0x1742cf){var _0x4c7c55=function(_0x403a7d){while(--_0x403a7d){_0x46f066['push'](_0x46f066['shift']());}};_0x4c7c55(++_0x1742cf);}(_0x664b,0xc0));var _0xb664=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x664b[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0xb664('0x0'));var FaxAccount=require(_0xb664('0x1'))['db'][_0xb664('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb664('0x3')](0x0);var events={'afterCreate':_0xb664('0x4'),'afterUpdate':_0xb664('0x5'),'afterDestroy':_0xb664('0x6')};function emitEvent(_0x5664c2){return function(_0x446303,_0x4881fe,_0x3838c3){FaxAccountEvents[_0xb664('0x7')](_0x5664c2+':'+_0x446303['id'],_0x446303);FaxAccountEvents[_0xb664('0x7')](_0x5664c2,_0x446303);_0x3838c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xb664('0x8')](e,emitEvent(event));}}module[_0xb664('0x9')]=FaxAccountEvents;
\ No newline at end of file
+var _0x00bf=['exports','../../mysqldb','FaxAccount','setMaxListeners','save','emit','hasOwnProperty'];(function(_0xb65cee,_0x499314){var _0x5c546b=function(_0x3d0aba){while(--_0x3d0aba){_0xb65cee['push'](_0xb65cee['shift']());}};_0x5c546b(++_0x499314);}(_0x00bf,0x7f));var _0xf00b=function(_0x5002ea,_0x55e27f){_0x5002ea=_0x5002ea-0x0;var _0x1cfab4=_0x00bf[_0x5002ea];return _0x1cfab4;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xf00b('0x0'))['db'][_0xf00b('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf00b('0x2')](0x0);var events={'afterCreate':_0xf00b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x472fc6){return function(_0x39c646,_0x159eb9,_0xd868f1){FaxAccountEvents[_0xf00b('0x4')](_0x472fc6+':'+_0x39c646['id'],_0x39c646);FaxAccountEvents['emit'](_0x472fc6,_0x39c646);_0xd868f1(null);};}for(var e in events){if(events[_0xf00b('0x5')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xf00b('0x6')]=FaxAccountEvents;
\ No newline at end of file
index 7c004a5..1330ecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb21d=['lodash','util','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','fax_accounts'];(function(_0x364602,_0x8f68e9){var _0x460de2=function(_0x208900){while(--_0x208900){_0x364602['push'](_0x364602['shift']());}};_0x460de2(++_0x8f68e9);}(_0xb21d,0x140));var _0xdb21=function(_0x5b12f5,_0x446015){_0x5b12f5=_0x5b12f5-0x0;var _0x5380dc=_0xb21d[_0x5b12f5];return _0x5380dc;};'use strict';var _=require(_0xdb21('0x0'));var util=require(_0xdb21('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xdb21('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb21('0x3'));var rimraf=require(_0xdb21('0x4'));var config=require(_0xdb21('0x5'));var attributes=require(_0xdb21('0x6'));module[_0xdb21('0x7')]=function(_0x2680d7,_0x1f8630){return _0x2680d7[_0xdb21('0x8')]('FaxAccount',attributes,{'tableName':_0xdb21('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd740=['rimraf','../../config/environment','./faxAccount.attributes','define','fax_accounts','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x13c9f4,_0x14de52){var _0xbb329f=function(_0x2bfab8){while(--_0x2bfab8){_0x13c9f4['push'](_0x13c9f4['shift']());}};_0xbb329f(++_0x14de52);}(_0xd740,0x14f));var _0x0d74=function(_0x114984,_0x5c9593){_0x114984=_0x114984-0x0;var _0x44822b=_0xd740[_0x114984];return _0x44822b;};'use strict';var _=require(_0x0d74('0x0'));var util=require('util');var logger=require(_0x0d74('0x1'))(_0x0d74('0x2'));var moment=require(_0x0d74('0x3'));var BPromise=require(_0x0d74('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d74('0x5'));var rimraf=require(_0x0d74('0x6'));var config=require(_0x0d74('0x7'));var attributes=require(_0x0d74('0x8'));module['exports']=function(_0x1c4417,_0x84ff9b){return _0x1c4417[_0x0d74('0x9')]('FaxAccount',attributes,{'tableName':_0x0d74('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 345b91b..56783fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb330=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FaxAccount','findAll','options','where','include','map','model','attributes','then','GetFaxAccount','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','DESC','Applications','List','applications','list','orderBy','priority','defaults','create','FaxInteraction','find','spread','get','push','length','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xb330,0x113));var _0x0b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb330[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0b33('0x0'));var util=require(_0x0b33('0x1'));var moment=require(_0x0b33('0x2'));var BPromise=require(_0x0b33('0x3'));var rs=require(_0x0b33('0x4'));var fs=require('fs');var Redis=require(_0x0b33('0x5'));var db=require(_0x0b33('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0b33('0x7'))(_0x0b33('0x8'));var config=require(_0x0b33('0x9'));var jayson=require(_0x0b33('0xa'));var client=jayson[_0x0b33('0xb')][_0x0b33('0xc')]({'port':0x232c});config['redis']=_['defaults'](config[_0x0b33('0xd')],{'host':_0x0b33('0xe'),'port':0x18eb});var socket=require(_0x0b33('0xf'))(new Redis(config['redis']));require(_0x0b33('0x10'))[_0x0b33('0x11')](socket);function respondWithRpcPromise(_0x38cfa9,_0x458783,_0x296351){return new BPromise(function(_0x3a64eb,_0x574cf9){return client[_0x0b33('0x12')](_0x38cfa9,_0x296351)['then'](function(_0x10fd15){logger[_0x0b33('0x13')](_0x0b33('0x14'),_0x458783,_0x0b33('0x15'));logger[_0x0b33('0x16')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x458783,_0x0b33('0x15'),JSON[_0x0b33('0x17')](_0x10fd15));if(_0x10fd15[_0x0b33('0x18')]){if(_0x10fd15[_0x0b33('0x18')][_0x0b33('0x19')]===0x1f4){logger['error'](_0x0b33('0x14'),_0x458783,_0x10fd15['error'][_0x0b33('0x1a')]);return _0x574cf9(_0x10fd15[_0x0b33('0x18')][_0x0b33('0x1a')]);}logger[_0x0b33('0x18')](_0x0b33('0x14'),_0x458783,_0x10fd15['error'][_0x0b33('0x1a')]);return _0x3a64eb(_0x10fd15[_0x0b33('0x18')][_0x0b33('0x1a')]);}else{logger[_0x0b33('0x13')](_0x0b33('0x14'),_0x458783,_0x0b33('0x15'));_0x3a64eb(_0x10fd15[_0x0b33('0x1b')][_0x0b33('0x1a')]);}})[_0x0b33('0x1c')](function(_0x7d3427){logger[_0x0b33('0x18')]('FaxAccount,\x20%s,\x20%s',_0x458783,_0x7d3427);_0x574cf9(_0x7d3427);});});}exports['GetFaxAccount']=function(_0x5912e8){var _0x51338b=this;return new Promise(function(_0x48c5ed,_0x20ecc0){return db[_0x0b33('0x1d')][_0x0b33('0x1e')]({'raw':_0x5912e8[_0x0b33('0x1f')]?_0x5912e8[_0x0b33('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5912e8[_0x0b33('0x1f')]?_0x5912e8[_0x0b33('0x1f')][_0x0b33('0x20')]||null:null,'attributes':_0x5912e8[_0x0b33('0x1f')]?_0x5912e8[_0x0b33('0x1f')]['attributes']||null:null,'limit':_0x5912e8[_0x0b33('0x1f')]?_0x5912e8[_0x0b33('0x1f')]['limit']||null:null,'include':_0x5912e8[_0x0b33('0x1f')]?_0x5912e8[_0x0b33('0x1f')][_0x0b33('0x21')]?_[_0x0b33('0x22')](_0x5912e8['options'][_0x0b33('0x21')],function(_0x20d2de){return{'model':db[_0x20d2de[_0x0b33('0x23')]],'as':_0x20d2de['as'],'attributes':_0x20d2de[_0x0b33('0x24')],'include':_0x20d2de[_0x0b33('0x21')]?_[_0x0b33('0x22')](_0x20d2de[_0x0b33('0x21')],function(_0x43620){return{'model':db[_0x43620[_0x0b33('0x23')]],'as':_0x43620['as'],'attributes':_0x43620[_0x0b33('0x24')],'include':_0x43620[_0x0b33('0x21')]?_[_0x0b33('0x22')](_0x43620[_0x0b33('0x21')],function(_0x597d32){return{'model':db[_0x597d32[_0x0b33('0x23')]],'as':_0x597d32['as'],'attributes':_0x597d32[_0x0b33('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0b33('0x25')](function(_0x4d3cf7){logger['info']('GetFaxAccount',_0x5912e8);logger[_0x0b33('0x16')](_0x0b33('0x26'),_0x5912e8,JSON['stringify'](_0x4d3cf7));_0x48c5ed(_0x4d3cf7);})[_0x0b33('0x1c')](function(_0x3e85e4){logger['error']('GetFaxAccount',_0x3e85e4[_0x0b33('0x1a')],_0x5912e8);_0x20ecc0(_0x51338b[_0x0b33('0x18')](0x1f4,_0x3e85e4[_0x0b33('0x1a')]));});});};exports[_0x0b33('0x27')]=function(_0x372b62,_0x525ae0,_0x42db12){var _0x3866e2=this;return new Promise(function(_0x56ed7f,_0xe4ad06){var _0x5e3ef9={'body':_0x372b62[_0x0b33('0x28')],'channel':_0x0b33('0x29')};var _0x524ee8=[];var _0x2a2785=[];var _0x40064a={};return db[_0x0b33('0x2a')][_0x0b33('0x2b')]()[_0x0b33('0x25')](function(_0x3290ab){if(!_0x3290ab){throw new db[(_0x0b33('0x2c'))]['ValidationError']('no\x20available\x20attributes');}_0x524ee8=_[_0x0b33('0x2d')](_[_0x0b33('0x2e')](_0x3290ab),['createdAt','updatedAt']);_0x2a2785=_[_0x0b33('0x2d')](_[_0x0b33('0x2e')](_0x3290ab),[_0x0b33('0x2f'),_0x0b33('0x30'),_0x0b33('0x31'),_0x0b33('0x32')]);if(_0x372b62[_0x0b33('0x28')]['id']){delete _0x372b62[_0x0b33('0x28')]['id'];}if(_[_0x0b33('0x33')](_0x372b62[_0x0b33('0x28')]['from'])){throw new db['Sequelize'][(_0x0b33('0x34'))](_0x0b33('0x35'));}if(_[_0x0b33('0x33')](_0x372b62[_0x0b33('0x28')][_0x0b33('0x28')])||_0x372b62[_0x0b33('0x28')][_0x0b33('0x28')]===''){throw new db[(_0x0b33('0x2c'))][(_0x0b33('0x34'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0b33('0x33')](_0x372b62['body'][_0x0b33('0x36')])){throw new db[(_0x0b33('0x2c'))][(_0x0b33('0x34'))](_0x0b33('0x37')+_0x2a2785);}if(!_[_0x0b33('0x38')](_0x2a2785,_0x372b62[_0x0b33('0x28')][_0x0b33('0x36')])){throw new db[(_0x0b33('0x2c'))]['ValidationError'](_0x0b33('0x39')+_0x2a2785);}_0x40064a[_0x372b62[_0x0b33('0x28')]['mapKey']]=_0x372b62[_0x0b33('0x28')][_0x0b33('0x3a')];})[_0x0b33('0x25')](function(){return db[_0x0b33('0x1d')]['find']({'where':{'id':_0x372b62[_0x0b33('0x3b')]['id']},'include':[{'model':db[_0x0b33('0x3c')],'as':'List','include':[{'model':db[_0x0b33('0x2a')],'as':_0x0b33('0x3d'),'where':_0x40064a,'limit':0x1,'order':[[_0x0b33('0x30'),_0x0b33('0x3e')]]}]},{'model':db['FaxApplication'],'as':_0x0b33('0x3f')}]});})['then'](function(_0x4ff6ce){if(_0x4ff6ce&&_0x4ff6ce[_0x0b33('0x40')]){var _0x2777f9=_0x4ff6ce['get']({'plain':!![]});_0x5e3ef9['account']=_0x2777f9;_0x5e3ef9[_0x0b33('0x41')]=_0x2777f9[_0x0b33('0x3f')];_0x5e3ef9[_0x0b33('0x42')]=_0x2777f9[_0x0b33('0x40')];_0x5e3ef9[_0x0b33('0x41')]=_[_0x0b33('0x43')](_0x5e3ef9[_0x0b33('0x41')],[_0x0b33('0x44')],['asc']);if(_0x5e3ef9[_0x0b33('0x3b')][_0x0b33('0x3f')]){delete _0x5e3ef9[_0x0b33('0x3b')]['Applications'];}if(_0x5e3ef9[_0x0b33('0x3b')][_0x0b33('0x40')]&&_0x5e3ef9[_0x0b33('0x3b')]['List'][_0x0b33('0x3d')]['length']){return _0x5e3ef9[_0x0b33('0x3b')][_0x0b33('0x40')][_0x0b33('0x3d')][0x0];}var _0x59541f=_[_0x0b33('0x45')](_0x372b62['body'],{'firstName':_0x372b62['body'][_0x0b33('0x3a')],'ListId':_0x2777f9[_0x0b33('0x32')]});_0x59541f[_0x372b62[_0x0b33('0x28')][_0x0b33('0x36')]]=_0x372b62['body'][_0x0b33('0x3a')];return db['CmContact'][_0x0b33('0x46')](_0x59541f,{'fields':_0x524ee8,'raw':!![]});}})['then'](function(_0x396d3c){_0x5e3ef9['contact']=_0x396d3c;if(_0x396d3c){var _0x48ca84={'ContactId':_0x396d3c['id'],'FaxAccountId':_0x372b62['account']['id'],'fax':_0x396d3c['fax']};return db[_0x0b33('0x47')][_0x0b33('0x48')]({'where':{'ContactId':_0x396d3c['id'],'closed':![],'FaxAccountId':_0x372b62[_0x0b33('0x3b')]['id']}})[_0x0b33('0x25')](function(_0x7275f9){if(_0x7275f9){return[_0x7275f9,![]];}return db['FaxInteraction'][_0x0b33('0x46')](_0x48ca84)[_0x0b33('0x25')](function(_0x44790e){return[_0x44790e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0b33('0x49')](function(_0x51cd4c,_0x4e8c22){var _0x360302=_0x51cd4c[_0x0b33('0x4a')]({'plain':!![]});if(_0x4e8c22){if(_0x5e3ef9[_0x0b33('0x3b')]['autoclose']){_0x5e3ef9[_0x0b33('0x41')][_0x0b33('0x4b')]({'id':0x0,'priority':_0x5e3ef9[_0x0b33('0x41')][_0x0b33('0x4c')]+0x1,'app':'close','appdata':_0x0b33('0x4d'),'interval':_0x0b33('0x4e')});}_0x360302[_0x0b33('0x4f')]=!![];}else{_0x360302['created']=![];}_0x5e3ef9[_0x0b33('0x50')]=_0x360302;return db[_0x0b33('0x51')][_0x0b33('0x46')]({'body':_0x372b62[_0x0b33('0x28')][_0x0b33('0x28')],'FaxAccountId':_0x372b62[_0x0b33('0x3b')]['id'],'FaxInteractionId':_0x51cd4c['id'],'direction':'in','ContactId':_0x51cd4c[_0x0b33('0x52')],'AttachmentId':_0x372b62[_0x0b33('0x28')][_0x0b33('0x53')]});})[_0x0b33('0x25')](function(_0x423b60){_0x5e3ef9[_0x0b33('0x1a')]=_0x423b60;if(_0x5e3ef9[_0x0b33('0x50')][_0x0b33('0x54')]){return db[_0x0b33('0x55')][_0x0b33('0x48')]({'attributes':['id',_0x0b33('0x56')],'where':{'id':_0x5e3ef9[_0x0b33('0x50')][_0x0b33('0x54')]}})['then'](function(_0x3228cb){if(_0x3228cb){_0x5e3ef9['applications'][_0x0b33('0x57')]({'id':0x0,'priority':0x0,'app':_0x0b33('0x58'),'appdata':_0x3228cb[_0x0b33('0x56')]+','+(_0x5e3ef9[_0x0b33('0x3b')][_0x0b33('0x59')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x0b33('0x5a'),_0x5e3ef9);});}return respondWithRpcPromise(_0x0b33('0x5b'),_0x0b33('0x5a'),_0x5e3ef9);})[_0x0b33('0x25')](function(_0x17b0a7){_0x56ed7f(_0x17b0a7);})[_0x0b33('0x1c')](function(_0x48c6e1){_0xe4ad06(_0x3866e2[_0x0b33('0x18')](0x1f4,_0x48c6e1['message']));});});};
\ No newline at end of file
+var _0xe8c2=['Applications','list','orderBy','priority','asc','Contacts','length','defaults','create','fax','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','FaxAccount,\x20%s,\x20%s','error','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','limit','include','map','model','attributes','NotifyFaxAccount','body','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmContact','DESC','FaxApplication','List','get','applications'];(function(_0x5af86d,_0xca3ea3){var _0x1b9d05=function(_0x216ef0){while(--_0x216ef0){_0x5af86d['push'](_0x5af86d['shift']());}};_0x1b9d05(++_0xca3ea3);}(_0xe8c2,0x79));var _0x2e8c=function(_0x27e674,_0x3af13f){_0x27e674=_0x27e674-0x0;var _0x1d64ee=_0xe8c2[_0x27e674];return _0x1d64ee;};'use strict';var _=require(_0x2e8c('0x0'));var util=require(_0x2e8c('0x1'));var moment=require(_0x2e8c('0x2'));var BPromise=require(_0x2e8c('0x3'));var rs=require(_0x2e8c('0x4'));var fs=require('fs');var Redis=require(_0x2e8c('0x5'));var db=require(_0x2e8c('0x6'))['db'];var utils=require(_0x2e8c('0x7'));var logger=require('../../config/logger')(_0x2e8c('0x8'));var config=require(_0x2e8c('0x9'));var jayson=require(_0x2e8c('0xa'));var client=jayson[_0x2e8c('0xb')][_0x2e8c('0xc')]({'port':0x232c});config[_0x2e8c('0xd')]=_['defaults'](config[_0x2e8c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x2e8c('0xe'))(new Redis(config[_0x2e8c('0xd')]));require('./faxAccount.socket')[_0x2e8c('0xf')](socket);function respondWithRpcPromise(_0x5d3ae9,_0x52ac11,_0x420ae8){return new BPromise(function(_0x44bba9,_0x4b5e28){return client[_0x2e8c('0x10')](_0x5d3ae9,_0x420ae8)[_0x2e8c('0x11')](function(_0x5e57be){logger[_0x2e8c('0x12')]('FaxAccount,\x20%s,\x20%s',_0x52ac11,_0x2e8c('0x13'));logger[_0x2e8c('0x14')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x52ac11,_0x2e8c('0x13'),JSON[_0x2e8c('0x15')](_0x5e57be));if(_0x5e57be['error']){if(_0x5e57be['error']['code']===0x1f4){logger['error'](_0x2e8c('0x16'),_0x52ac11,_0x5e57be[_0x2e8c('0x17')][_0x2e8c('0x18')]);return _0x4b5e28(_0x5e57be[_0x2e8c('0x17')][_0x2e8c('0x18')]);}logger[_0x2e8c('0x17')]('FaxAccount,\x20%s,\x20%s',_0x52ac11,_0x5e57be[_0x2e8c('0x17')][_0x2e8c('0x18')]);return _0x44bba9(_0x5e57be[_0x2e8c('0x17')][_0x2e8c('0x18')]);}else{logger[_0x2e8c('0x12')]('FaxAccount,\x20%s,\x20%s',_0x52ac11,_0x2e8c('0x13'));_0x44bba9(_0x5e57be['result'][_0x2e8c('0x18')]);}})[_0x2e8c('0x19')](function(_0x775494){logger[_0x2e8c('0x17')]('FaxAccount,\x20%s,\x20%s',_0x52ac11,_0x775494);_0x4b5e28(_0x775494);});});}exports[_0x2e8c('0x1a')]=function(_0x17be35){var _0x4e97ba=this;return new Promise(function(_0x4ecf03,_0x3896f2){return db[_0x2e8c('0x1b')][_0x2e8c('0x1c')]({'raw':_0x17be35[_0x2e8c('0x1d')]?_0x17be35[_0x2e8c('0x1d')][_0x2e8c('0x1e')]===undefined?!![]:![]:!![],'where':_0x17be35[_0x2e8c('0x1d')]?_0x17be35[_0x2e8c('0x1d')]['where']||null:null,'attributes':_0x17be35[_0x2e8c('0x1d')]?_0x17be35['options']['attributes']||null:null,'limit':_0x17be35['options']?_0x17be35[_0x2e8c('0x1d')][_0x2e8c('0x1f')]||null:null,'include':_0x17be35['options']?_0x17be35[_0x2e8c('0x1d')][_0x2e8c('0x20')]?_[_0x2e8c('0x21')](_0x17be35[_0x2e8c('0x1d')][_0x2e8c('0x20')],function(_0xa6f379){return{'model':db[_0xa6f379[_0x2e8c('0x22')]],'as':_0xa6f379['as'],'attributes':_0xa6f379['attributes'],'include':_0xa6f379[_0x2e8c('0x20')]?_[_0x2e8c('0x21')](_0xa6f379[_0x2e8c('0x20')],function(_0x3b4190){return{'model':db[_0x3b4190['model']],'as':_0x3b4190['as'],'attributes':_0x3b4190['attributes'],'include':_0x3b4190['include']?_['map'](_0x3b4190[_0x2e8c('0x20')],function(_0x186377){return{'model':db[_0x186377[_0x2e8c('0x22')]],'as':_0x186377['as'],'attributes':_0x186377[_0x2e8c('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c9c4e){logger[_0x2e8c('0x12')](_0x2e8c('0x1a'),_0x17be35);logger['debug']('GetFaxAccount',_0x17be35,JSON['stringify'](_0x3c9c4e));_0x4ecf03(_0x3c9c4e);})[_0x2e8c('0x19')](function(_0x4c1301){logger['error'](_0x2e8c('0x1a'),_0x4c1301[_0x2e8c('0x18')],_0x17be35);_0x3896f2(_0x4e97ba[_0x2e8c('0x17')](0x1f4,_0x4c1301[_0x2e8c('0x18')]));});});};exports[_0x2e8c('0x24')]=function(_0x4a272e,_0x260809,_0x40c609){var _0x45a01d=this;return new Promise(function(_0x40261b,_0x40e585){var _0x5b7594={'body':_0x4a272e[_0x2e8c('0x25')],'channel':'fax'};var _0x206603=[];var _0x46305d=[];var _0x2762dc={};return db['CmContact']['describe']()[_0x2e8c('0x11')](function(_0x347997){if(!_0x347997){throw new db[(_0x2e8c('0x26'))][(_0x2e8c('0x27'))](_0x2e8c('0x28'));}_0x206603=_[_0x2e8c('0x29')](_[_0x2e8c('0x2a')](_0x347997),[_0x2e8c('0x2b'),_0x2e8c('0x2c')]);_0x46305d=_['difference'](_[_0x2e8c('0x2a')](_0x347997),['createdAt',_0x2e8c('0x2c'),_0x2e8c('0x2d'),_0x2e8c('0x2e')]);if(_0x4a272e[_0x2e8c('0x25')]['id']){delete _0x4a272e[_0x2e8c('0x25')]['id'];}if(_[_0x2e8c('0x2f')](_0x4a272e[_0x2e8c('0x25')]['from'])){throw new db[(_0x2e8c('0x26'))]['ValidationError'](_0x2e8c('0x30'));}if(_[_0x2e8c('0x2f')](_0x4a272e[_0x2e8c('0x25')][_0x2e8c('0x25')])||_0x4a272e[_0x2e8c('0x25')][_0x2e8c('0x25')]===''){throw new db[(_0x2e8c('0x26'))][(_0x2e8c('0x27'))](_0x2e8c('0x31'));}if(_[_0x2e8c('0x2f')](_0x4a272e[_0x2e8c('0x25')][_0x2e8c('0x32')])){throw new db['Sequelize'][(_0x2e8c('0x27'))](_0x2e8c('0x33')+_0x46305d);}if(!_[_0x2e8c('0x34')](_0x46305d,_0x4a272e['body']['mapKey'])){throw new db[(_0x2e8c('0x26'))][(_0x2e8c('0x27'))](_0x2e8c('0x35')+_0x46305d);}_0x2762dc[_0x4a272e[_0x2e8c('0x25')][_0x2e8c('0x32')]]=_0x4a272e['body'][_0x2e8c('0x36')];})[_0x2e8c('0x11')](function(){return db[_0x2e8c('0x1b')][_0x2e8c('0x37')]({'where':{'id':_0x4a272e[_0x2e8c('0x38')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x2e8c('0x39')],'as':'Contacts','where':_0x2762dc,'limit':0x1,'order':[[_0x2e8c('0x2c'),_0x2e8c('0x3a')]]}]},{'model':db[_0x2e8c('0x3b')],'as':'Applications'}]});})[_0x2e8c('0x11')](function(_0x485839){if(_0x485839&&_0x485839[_0x2e8c('0x3c')]){var _0x44a16f=_0x485839[_0x2e8c('0x3d')]({'plain':!![]});_0x5b7594[_0x2e8c('0x38')]=_0x44a16f;_0x5b7594[_0x2e8c('0x3e')]=_0x44a16f[_0x2e8c('0x3f')];_0x5b7594[_0x2e8c('0x40')]=_0x44a16f['List'];_0x5b7594['applications']=_[_0x2e8c('0x41')](_0x5b7594[_0x2e8c('0x3e')],[_0x2e8c('0x42')],[_0x2e8c('0x43')]);if(_0x5b7594[_0x2e8c('0x38')]['Applications']){delete _0x5b7594[_0x2e8c('0x38')][_0x2e8c('0x3f')];}if(_0x5b7594[_0x2e8c('0x38')][_0x2e8c('0x3c')]&&_0x5b7594[_0x2e8c('0x38')][_0x2e8c('0x3c')][_0x2e8c('0x44')][_0x2e8c('0x45')]){return _0x5b7594[_0x2e8c('0x38')]['List'][_0x2e8c('0x44')][0x0];}var _0x599fdc=_[_0x2e8c('0x46')](_0x4a272e['body'],{'firstName':_0x4a272e[_0x2e8c('0x25')]['from'],'ListId':_0x44a16f[_0x2e8c('0x2e')]});_0x599fdc[_0x4a272e[_0x2e8c('0x25')][_0x2e8c('0x32')]]=_0x4a272e[_0x2e8c('0x25')][_0x2e8c('0x36')];return db['CmContact'][_0x2e8c('0x47')](_0x599fdc,{'fields':_0x206603,'raw':!![]});}})['then'](function(_0x18a488){_0x5b7594['contact']=_0x18a488;if(_0x18a488){var _0x294f2e={'ContactId':_0x18a488['id'],'FaxAccountId':_0x4a272e[_0x2e8c('0x38')]['id'],'fax':_0x18a488[_0x2e8c('0x48')]};return db['FaxInteraction'][_0x2e8c('0x37')]({'where':{'ContactId':_0x18a488['id'],'closed':![],'FaxAccountId':_0x4a272e['account']['id']}})[_0x2e8c('0x11')](function(_0x2e02d5){if(_0x2e02d5){return[_0x2e02d5,![]];}return db[_0x2e8c('0x49')][_0x2e8c('0x47')](_0x294f2e)['then'](function(_0x506330){return[_0x506330,!![]];});});}else{throw new Error(_0x2e8c('0x4a'));}})[_0x2e8c('0x4b')](function(_0x267fec,_0x4b54ff){var _0x3070ff=_0x267fec[_0x2e8c('0x3d')]({'plain':!![]});if(_0x4b54ff){if(_0x5b7594[_0x2e8c('0x38')]['autoclose']){_0x5b7594[_0x2e8c('0x3e')][_0x2e8c('0x4c')]({'id':0x0,'priority':_0x5b7594[_0x2e8c('0x3e')][_0x2e8c('0x45')]+0x1,'app':_0x2e8c('0x4d'),'appdata':_0x2e8c('0x4e'),'interval':_0x2e8c('0x4f')});}_0x3070ff[_0x2e8c('0x50')]=!![];}else{_0x3070ff[_0x2e8c('0x50')]=![];}_0x5b7594[_0x2e8c('0x51')]=_0x3070ff;return db[_0x2e8c('0x52')][_0x2e8c('0x47')]({'body':_0x4a272e['body'][_0x2e8c('0x25')],'FaxAccountId':_0x4a272e['account']['id'],'FaxInteractionId':_0x267fec['id'],'direction':'in','ContactId':_0x267fec[_0x2e8c('0x53')],'AttachmentId':_0x4a272e[_0x2e8c('0x25')][_0x2e8c('0x54')]});})[_0x2e8c('0x11')](function(_0x12098e){_0x5b7594[_0x2e8c('0x18')]=_0x12098e;if(_0x5b7594[_0x2e8c('0x51')]['UserId']){return db[_0x2e8c('0x55')][_0x2e8c('0x37')]({'attributes':['id',_0x2e8c('0x56')],'where':{'id':_0x5b7594[_0x2e8c('0x51')][_0x2e8c('0x57')]}})[_0x2e8c('0x11')](function(_0x17802f){if(_0x17802f){_0x5b7594[_0x2e8c('0x3e')][_0x2e8c('0x58')]({'id':0x0,'priority':0x0,'app':_0x2e8c('0x59'),'appdata':_0x17802f[_0x2e8c('0x56')]+','+(_0x5b7594[_0x2e8c('0x38')]['waitForTheAssignedAgent']||0xa),'interval':_0x2e8c('0x4f')});}return respondWithRpcPromise(_0x2e8c('0x5a'),_0x2e8c('0x5b'),_0x5b7594);});}return respondWithRpcPromise('Start',_0x2e8c('0x5b'),_0x5b7594);})[_0x2e8c('0x11')](function(_0x34f102){_0x40261b(_0x34f102);})[_0x2e8c('0x19')](function(_0x3e0863){_0x40e585(_0x45a01d[_0x2e8c('0x17')](0x1f4,_0x3e0863['message']));});});};
\ No newline at end of file
index 12b4da8..7d0d124 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39af=['save','remove','update','emit','register','length','faxAccount:'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x39af,0x69));var _0xf39a=function(_0x961de6,_0x36542e){_0x961de6=_0x961de6-0x0;var _0x2dd81c=_0x39af[_0x961de6];return _0x2dd81c;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xf39a('0x0'),_0xf39a('0x1'),_0xf39a('0x2')];function createListener(_0x578948,_0x19e765){return function(_0x2bf35e){_0x19e765[_0xf39a('0x3')](_0x578948,_0x2bf35e);};}function removeListener(_0x1c3562,_0x4596af){return function(){FaxAccountEvents['removeListener'](_0x1c3562,_0x4596af);};}exports[_0xf39a('0x4')]=function(_0x2009a7){for(var _0x402a28=0x0,_0x5e9160=events[_0xf39a('0x5')];_0x402a28<_0x5e9160;_0x402a28++){var _0x95d482=events[_0x402a28];var _0x15688c=createListener(_0xf39a('0x6')+_0x95d482,_0x2009a7);FaxAccountEvents['on'](_0x95d482,_0x15688c);}};
\ No newline at end of file
+var _0x8d38=['save','remove','removeListener','register'];(function(_0x639f5f,_0x4d98c1){var _0x1a42f4=function(_0x5478d9){while(--_0x5478d9){_0x639f5f['push'](_0x639f5f['shift']());}};_0x1a42f4(++_0x4d98c1);}(_0x8d38,0x90));var _0x88d3=function(_0xd6d11,_0x1c0104){_0xd6d11=_0xd6d11-0x0;var _0x2fa03c=_0x8d38[_0xd6d11];return _0x2fa03c;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x88d3('0x0'),_0x88d3('0x1'),'update'];function createListener(_0x3567dd,_0x2b345e){return function(_0x435287){_0x2b345e['emit'](_0x3567dd,_0x435287);};}function removeListener(_0x366b82,_0x509a6b){return function(){FaxAccountEvents[_0x88d3('0x2')](_0x366b82,_0x509a6b);};}exports[_0x88d3('0x3')]=function(_0xf72e45){for(var _0x1b0ec9=0x0,_0x126b41=events['length'];_0x1b0ec9<_0x126b41;_0x1b0ec9++){var _0x4bfbf4=events[_0x1b0ec9];var _0x360d40=createListener('faxAccount:'+_0x4bfbf4,_0xf72e45);FaxAccountEvents['on'](_0x4bfbf4,_0x360d40);}};
\ No newline at end of file
index 1d72d2b..64bc17c 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(_0x12d6dd,_0x48ceb6){var _0x36344a=function(_0x50f2ca){while(--_0x50f2ca){_0x12d6dd['push'](_0x12d6dd['shift']());}};_0x36344a(++_0x48ceb6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 c4a81c0..6d9f534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x853b=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x372470,_0xb4109c){var _0x8fc64a=function(_0x102c5a){while(--_0x102c5a){_0x372470['push'](_0x372470['shift']());}};_0x8fc64a(++_0xb4109c);}(_0x853b,0x73));var _0xb853=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x853b[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xb853('0x0'));module[_0xb853('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb853('0x2')],'allowNull':![],'defaultValue':_0xb853('0x3')},'appdata':{'type':Sequelize[_0xb853('0x4')]()},'description':{'type':Sequelize[_0xb853('0x2')]},'interval':{'type':Sequelize[_0xb853('0x2')],'defaultValue':_0xb853('0x5')}};
\ No newline at end of file
+var _0x9e9e=['TEXT','sequelize','INTEGER','STRING','noop'];(function(_0x3cd77b,_0x570710){var _0x1ca2b3=function(_0x5532d2){while(--_0x5532d2){_0x3cd77b['push'](_0x3cd77b['shift']());}};_0x1ca2b3(++_0x570710);}(_0x9e9e,0x13c));var _0xe9e9=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x9e9e[_0x547e20];return _0x359171;};'use strict';var Sequelize=require(_0xe9e9('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe9e9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe9e9('0x2')],'allowNull':![],'defaultValue':_0xe9e9('0x3')},'appdata':{'type':Sequelize[_0xe9e9('0x4')]()},'description':{'type':Sequelize[_0xe9e9('0x2')]},'interval':{'type':Sequelize[_0xe9e9('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 30205a3..01554e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x338f=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','name','send','index','map','FaxApplication','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','keys','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x9aed79,_0x304c4b){var _0x4b0e35=function(_0xa5abd0){while(--_0xa5abd0){_0x9aed79['push'](_0x9aed79['shift']());}};_0x4b0e35(++_0x304c4b);}(_0x338f,0x80));var _0xf338=function(_0x51c726,_0x332b95){_0x51c726=_0x51c726-0x0;var _0x23fe86=_0x338f[_0x51c726];return _0x23fe86;};'use strict';var emlformat=require(_0xf338('0x0'));var rimraf=require(_0xf338('0x1'));var zipdir=require(_0xf338('0x2'));var jsonpatch=require(_0xf338('0x3'));var rp=require(_0xf338('0x4'));var moment=require(_0xf338('0x5'));var BPromise=require(_0xf338('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf338('0x7'));var ejs=require(_0xf338('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf338('0x9'));var squel=require(_0xf338('0xa'));var crypto=require(_0xf338('0xb'));var jsforce=require(_0xf338('0xc'));var deskjs=require(_0xf338('0xd'));var toCsv=require(_0xf338('0x7'));var querystring=require(_0xf338('0xe'));var Papa=require('papaparse');var Redis=require(_0xf338('0xf'));var authService=require(_0xf338('0x10'));var qs=require(_0xf338('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf338('0x12'));var logger=require(_0xf338('0x13'))(_0xf338('0x14'));var utils=require(_0xf338('0x15'));var config=require(_0xf338('0x16'));var licenseUtil=require(_0xf338('0x17'));var db=require(_0xf338('0x18'))['db'];function respondWithStatusCode(_0x18432a,_0x5d6134){_0x5d6134=_0x5d6134||0xcc;return function(_0x1ac259){if(_0x1ac259){return _0x18432a['sendStatus'](_0x5d6134);}return _0x18432a[_0xf338('0x19')](_0x5d6134)['end']();};}function respondWithResult(_0x54bafc,_0x88fb06){_0x88fb06=_0x88fb06||0xc8;return function(_0x21e082){if(_0x21e082){return _0x54bafc[_0xf338('0x19')](_0x88fb06)[_0xf338('0x1a')](_0x21e082);}};}function respondWithFilteredResult(_0x1fe8b0,_0xbc867e){return function(_0x2e1e2c){if(_0x2e1e2c){var _0x453577=typeof _0xbc867e[_0xf338('0x1b')]===_0xf338('0x1c')&&typeof _0xbc867e[_0xf338('0x1d')]===_0xf338('0x1c');var _0x1f8a68=_0x2e1e2c[_0xf338('0x1e')];var _0x189ffc=_0x453577?0x0:_0xbc867e[_0xf338('0x1b')];var _0x3f900a=_0x453577?_0x2e1e2c['count']:_0xbc867e['offset']+_0xbc867e['limit'];var _0x142713;if(_0x3f900a>=_0x1f8a68){_0x3f900a=_0x1f8a68;_0x142713=0xc8;}else{_0x142713=0xce;}_0x1fe8b0[_0xf338('0x19')](_0x142713);return _0x1fe8b0[_0xf338('0x1f')](_0xf338('0x20'),_0x189ffc+'-'+_0x3f900a+'/'+_0x1f8a68)[_0xf338('0x1a')](_0x2e1e2c);}return null;};}function patchUpdates(_0x461ce1){return function(_0x11b517){try{jsonpatch[_0xf338('0x21')](_0x11b517,_0x461ce1,!![]);}catch(_0x5504ab){return BPromise[_0xf338('0x22')](_0x5504ab);}return _0x11b517['save']();};}function saveUpdates(_0x2ac9db,_0x1f7b01){return function(_0x515dc2){if(_0x515dc2){return _0x515dc2[_0xf338('0x23')](_0x2ac9db)['then'](function(_0x185bbe){return _0x185bbe;});}return null;};}function removeEntity(_0x24f23e,_0x336161){return function(_0x254650){if(_0x254650){return _0x254650[_0xf338('0x24')]()[_0xf338('0x25')](function(){_0x24f23e[_0xf338('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b9b76,_0x32b3d4){return function(_0x5e47f5){if(!_0x5e47f5){_0x1b9b76[_0xf338('0x26')](0x194);}return _0x5e47f5;};}function handleError(_0x1fcc55,_0x33f9d4){_0x33f9d4=_0x33f9d4||0x1f4;return function(_0x583fda){logger['error'](_0x583fda[_0xf338('0x27')]);if(_0x583fda[_0xf338('0x28')]){delete _0x583fda[_0xf338('0x28')];}_0x1fcc55[_0xf338('0x19')](_0x33f9d4)[_0xf338('0x29')](_0x583fda);};}exports[_0xf338('0x2a')]=function(_0x1de3b8,_0x5974a3){var _0x343799={},_0x38dc0b={},_0x31ceec={'count':0x0,'rows':[]};var _0xe626f5=_[_0xf338('0x2b')](db[_0xf338('0x2c')]['rawAttributes'],function(_0x3d4e36){return{'name':_0x3d4e36['fieldName'],'type':_0x3d4e36[_0xf338('0x2d')][_0xf338('0x2e')]};});_0x38dc0b[_0xf338('0x2f')]=_['map'](_0xe626f5,_0xf338('0x28'));_0x38dc0b[_0xf338('0x30')]=_['keys'](_0x1de3b8['query']);_0x38dc0b[_0xf338('0x31')]=_[_0xf338('0x32')](_0x38dc0b[_0xf338('0x2f')],_0x38dc0b[_0xf338('0x30')]);_0x343799[_0xf338('0x33')]=_[_0xf338('0x32')](_0x38dc0b[_0xf338('0x2f')],qs[_0xf338('0x34')](_0x1de3b8[_0xf338('0x30')][_0xf338('0x34')]));_0x343799[_0xf338('0x33')]=_0x343799[_0xf338('0x33')][_0xf338('0x35')]?_0x343799[_0xf338('0x33')]:_0x38dc0b[_0xf338('0x2f')];if(!_0x1de3b8[_0xf338('0x30')]['hasOwnProperty'](_0xf338('0x36'))){_0x343799[_0xf338('0x1d')]=qs[_0xf338('0x1d')](_0x1de3b8[_0xf338('0x30')]['limit']);_0x343799[_0xf338('0x1b')]=qs['offset'](_0x1de3b8['query']['offset']);}_0x343799[_0xf338('0x37')]=qs[_0xf338('0x38')](_0x1de3b8[_0xf338('0x30')][_0xf338('0x38')]);_0x343799[_0xf338('0x39')]=qs[_0xf338('0x31')](_[_0xf338('0x3a')](_0x1de3b8[_0xf338('0x30')],_0x38dc0b[_0xf338('0x31')]),_0xe626f5);if(_0x1de3b8[_0xf338('0x30')][_0xf338('0x3b')]){_0x343799['where']=_[_0xf338('0x3c')](_0x343799[_0xf338('0x39')],{'$or':_[_0xf338('0x2b')](_0xe626f5,function(_0x4686bb){if(_0x4686bb['type']!==_0xf338('0x3d')){var _0x337edb={};_0x337edb[_0x4686bb[_0xf338('0x28')]]={'$like':'%'+_0x1de3b8[_0xf338('0x30')]['filter']+'%'};return _0x337edb;}})});}_0x343799=_[_0xf338('0x3c')]({},_0x343799,_0x1de3b8['options']);var _0x188b85={'where':_0x343799[_0xf338('0x39')]};return db[_0xf338('0x2c')][_0xf338('0x1e')](_0x188b85)[_0xf338('0x25')](function(_0x5d3a72){_0x31ceec[_0xf338('0x1e')]=_0x5d3a72;if(_0x1de3b8[_0xf338('0x30')]['includeAll']){_0x343799[_0xf338('0x3e')]=[{'all':!![]}];}return db[_0xf338('0x2c')][_0xf338('0x3f')](_0x343799);})[_0xf338('0x25')](function(_0x49546b){_0x31ceec[_0xf338('0x40')]=_0x49546b;return _0x31ceec;})[_0xf338('0x25')](respondWithFilteredResult(_0x5974a3,_0x343799))[_0xf338('0x41')](handleError(_0x5974a3,null));};exports['show']=function(_0x3672fd,_0x39379d){var _0x387375={'raw':!![],'where':{'id':_0x3672fd[_0xf338('0x42')]['id']}},_0x562e38={};_0x562e38['model']=_[_0xf338('0x43')](db[_0xf338('0x2c')][_0xf338('0x44')]);_0x562e38[_0xf338('0x30')]=_['keys'](_0x3672fd[_0xf338('0x30')]);_0x562e38[_0xf338('0x31')]=_[_0xf338('0x32')](_0x562e38[_0xf338('0x2f')],_0x562e38[_0xf338('0x30')]);_0x387375[_0xf338('0x33')]=_['intersection'](_0x562e38[_0xf338('0x2f')],qs[_0xf338('0x34')](_0x3672fd['query'][_0xf338('0x34')]));_0x387375[_0xf338('0x33')]=_0x387375[_0xf338('0x33')][_0xf338('0x35')]?_0x387375[_0xf338('0x33')]:_0x562e38[_0xf338('0x2f')];if(_0x3672fd['query']['includeAll']){_0x387375[_0xf338('0x3e')]=[{'all':!![]}];}_0x387375=_['merge']({},_0x387375,_0x3672fd[_0xf338('0x45')]);return db[_0xf338('0x2c')][_0xf338('0x46')](_0x387375)[_0xf338('0x25')](handleEntityNotFound(_0x39379d,null))[_0xf338('0x25')](respondWithResult(_0x39379d,null))[_0xf338('0x41')](handleError(_0x39379d,null));};exports[_0xf338('0x47')]=function(_0x358023,_0x323778){return db[_0xf338('0x2c')]['create'](_0x358023[_0xf338('0x48')],{})[_0xf338('0x25')](respondWithResult(_0x323778,0xc9))[_0xf338('0x41')](handleError(_0x323778,null));};exports['update']=function(_0x409285,_0x3560cc){if(_0x409285[_0xf338('0x48')]['id']){delete _0x409285[_0xf338('0x48')]['id'];}return db[_0xf338('0x2c')][_0xf338('0x46')]({'where':{'id':_0x409285['params']['id']}})['then'](handleEntityNotFound(_0x3560cc,null))[_0xf338('0x25')](saveUpdates(_0x409285[_0xf338('0x48')],null))['then'](respondWithResult(_0x3560cc,null))[_0xf338('0x41')](handleError(_0x3560cc,null));};exports[_0xf338('0x24')]=function(_0x5d8b62,_0x2e4465){return db[_0xf338('0x2c')][_0xf338('0x46')]({'where':{'id':_0x5d8b62[_0xf338('0x42')]['id']}})[_0xf338('0x25')](handleEntityNotFound(_0x2e4465,null))['then'](removeEntity(_0x2e4465,null))[_0xf338('0x41')](handleError(_0x2e4465,null));};
\ No newline at end of file
+var _0x32b5=['rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','index','FaxApplication'];(function(_0x4c8dc7,_0x4f2e91){var _0x27c33b=function(_0x392e7c){while(--_0x392e7c){_0x4c8dc7['push'](_0x4c8dc7['shift']());}};_0x27c33b(++_0x4f2e91);}(_0x32b5,0x14b));var _0x532b=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x32b5[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0x532b('0x0'));var rimraf=require(_0x532b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x532b('0x2'));var rp=require(_0x532b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x532b('0x4'));var util=require(_0x532b('0x5'));var path=require('path');var sox=require(_0x532b('0x6'));var csv=require(_0x532b('0x7'));var ejs=require(_0x532b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x532b('0x9'));var squel=require(_0x532b('0xa'));var crypto=require(_0x532b('0xb'));var jsforce=require(_0x532b('0xc'));var deskjs=require(_0x532b('0xd'));var toCsv=require(_0x532b('0x7'));var querystring=require(_0x532b('0xe'));var Papa=require(_0x532b('0xf'));var Redis=require('ioredis');var authService=require(_0x532b('0x10'));var qs=require(_0x532b('0x11'));var as=require(_0x532b('0x12'));var hardwareService=require(_0x532b('0x13'));var logger=require(_0x532b('0x14'))('api');var utils=require(_0x532b('0x15'));var config=require(_0x532b('0x16'));var licenseUtil=require(_0x532b('0x17'));var db=require(_0x532b('0x18'))['db'];function respondWithStatusCode(_0x60f1da,_0x1b24fa){_0x1b24fa=_0x1b24fa||0xcc;return function(_0x24340d){if(_0x24340d){return _0x60f1da['sendStatus'](_0x1b24fa);}return _0x60f1da[_0x532b('0x19')](_0x1b24fa)['end']();};}function respondWithResult(_0x400b26,_0x23df34){_0x23df34=_0x23df34||0xc8;return function(_0x4d8f12){if(_0x4d8f12){return _0x400b26['status'](_0x23df34)[_0x532b('0x1a')](_0x4d8f12);}};}function respondWithFilteredResult(_0x39ef20,_0x7a8a33){return function(_0x3aebd8){if(_0x3aebd8){var _0x5874fd=typeof _0x7a8a33[_0x532b('0x1b')]===_0x532b('0x1c')&&typeof _0x7a8a33['limit']===_0x532b('0x1c');var _0x3b28a1=_0x3aebd8[_0x532b('0x1d')];var _0x3f0689=_0x5874fd?0x0:_0x7a8a33[_0x532b('0x1b')];var _0x32ea87=_0x5874fd?_0x3aebd8[_0x532b('0x1d')]:_0x7a8a33[_0x532b('0x1b')]+_0x7a8a33[_0x532b('0x1e')];var _0x527d50;if(_0x32ea87>=_0x3b28a1){_0x32ea87=_0x3b28a1;_0x527d50=0xc8;}else{_0x527d50=0xce;}_0x39ef20[_0x532b('0x19')](_0x527d50);return _0x39ef20[_0x532b('0x1f')]('Content-Range',_0x3f0689+'-'+_0x32ea87+'/'+_0x3b28a1)[_0x532b('0x1a')](_0x3aebd8);}return null;};}function patchUpdates(_0x4edc8d){return function(_0x4ade22){try{jsonpatch[_0x532b('0x20')](_0x4ade22,_0x4edc8d,!![]);}catch(_0x560254){return BPromise[_0x532b('0x21')](_0x560254);}return _0x4ade22[_0x532b('0x22')]();};}function saveUpdates(_0x545459,_0x413da5){return function(_0x1ece13){if(_0x1ece13){return _0x1ece13[_0x532b('0x23')](_0x545459)[_0x532b('0x24')](function(_0x40da66){return _0x40da66;});}return null;};}function removeEntity(_0x3e54c7,_0x5abe4a){return function(_0x3e71b9){if(_0x3e71b9){return _0x3e71b9[_0x532b('0x25')]()['then'](function(){_0x3e54c7[_0x532b('0x19')](0xcc)[_0x532b('0x26')]();});}};}function handleEntityNotFound(_0x3f23bb,_0x37557e){return function(_0x1e0547){if(!_0x1e0547){_0x3f23bb['sendStatus'](0x194);}return _0x1e0547;};}function handleError(_0x421654,_0x4a070f){_0x4a070f=_0x4a070f||0x1f4;return function(_0x439265){logger[_0x532b('0x27')](_0x439265[_0x532b('0x28')]);if(_0x439265['name']){delete _0x439265[_0x532b('0x29')];}_0x421654['status'](_0x4a070f)['send'](_0x439265);};}exports[_0x532b('0x2a')]=function(_0x5b0ba5,_0x397343){var _0x336862={},_0x109ccd={},_0x2f16df={'count':0x0,'rows':[]};var _0x5195d3=_['map'](db[_0x532b('0x2b')][_0x532b('0x2c')],function(_0x164c6f){return{'name':_0x164c6f['fieldName'],'type':_0x164c6f[_0x532b('0x2d')]['key']};});_0x109ccd[_0x532b('0x2e')]=_[_0x532b('0x2f')](_0x5195d3,'name');_0x109ccd[_0x532b('0x30')]=_[_0x532b('0x31')](_0x5b0ba5[_0x532b('0x30')]);_0x109ccd[_0x532b('0x32')]=_[_0x532b('0x33')](_0x109ccd[_0x532b('0x2e')],_0x109ccd['query']);_0x336862[_0x532b('0x34')]=_[_0x532b('0x33')](_0x109ccd[_0x532b('0x2e')],qs[_0x532b('0x35')](_0x5b0ba5['query'][_0x532b('0x35')]));_0x336862['attributes']=_0x336862[_0x532b('0x34')][_0x532b('0x36')]?_0x336862[_0x532b('0x34')]:_0x109ccd[_0x532b('0x2e')];if(!_0x5b0ba5[_0x532b('0x30')][_0x532b('0x37')](_0x532b('0x38'))){_0x336862[_0x532b('0x1e')]=qs[_0x532b('0x1e')](_0x5b0ba5['query'][_0x532b('0x1e')]);_0x336862[_0x532b('0x1b')]=qs[_0x532b('0x1b')](_0x5b0ba5[_0x532b('0x30')][_0x532b('0x1b')]);}_0x336862[_0x532b('0x39')]=qs[_0x532b('0x3a')](_0x5b0ba5['query']['sort']);_0x336862[_0x532b('0x3b')]=qs['filters'](_[_0x532b('0x3c')](_0x5b0ba5[_0x532b('0x30')],_0x109ccd[_0x532b('0x32')]),_0x5195d3);if(_0x5b0ba5[_0x532b('0x30')][_0x532b('0x3d')]){_0x336862[_0x532b('0x3b')]=_[_0x532b('0x3e')](_0x336862[_0x532b('0x3b')],{'$or':_[_0x532b('0x2f')](_0x5195d3,function(_0x56cd10){if(_0x56cd10['type']!==_0x532b('0x3f')){var _0xff4c05={};_0xff4c05[_0x56cd10['name']]={'$like':'%'+_0x5b0ba5[_0x532b('0x30')]['filter']+'%'};return _0xff4c05;}})});}_0x336862=_[_0x532b('0x3e')]({},_0x336862,_0x5b0ba5[_0x532b('0x40')]);var _0x18d8f8={'where':_0x336862[_0x532b('0x3b')]};return db['FaxApplication'][_0x532b('0x1d')](_0x18d8f8)[_0x532b('0x24')](function(_0x5ee351){_0x2f16df[_0x532b('0x1d')]=_0x5ee351;if(_0x5b0ba5['query'][_0x532b('0x41')]){_0x336862[_0x532b('0x42')]=[{'all':!![]}];}return db['FaxApplication'][_0x532b('0x43')](_0x336862);})['then'](function(_0x270fa6){_0x2f16df[_0x532b('0x44')]=_0x270fa6;return _0x2f16df;})['then'](respondWithFilteredResult(_0x397343,_0x336862))['catch'](handleError(_0x397343,null));};exports[_0x532b('0x45')]=function(_0x443075,_0x2739ab){var _0x638d64={'raw':!![],'where':{'id':_0x443075[_0x532b('0x46')]['id']}},_0x1ef764={};_0x1ef764[_0x532b('0x2e')]=_['keys'](db[_0x532b('0x2b')]['rawAttributes']);_0x1ef764[_0x532b('0x30')]=_[_0x532b('0x31')](_0x443075[_0x532b('0x30')]);_0x1ef764['filters']=_[_0x532b('0x33')](_0x1ef764[_0x532b('0x2e')],_0x1ef764[_0x532b('0x30')]);_0x638d64[_0x532b('0x34')]=_[_0x532b('0x33')](_0x1ef764[_0x532b('0x2e')],qs[_0x532b('0x35')](_0x443075['query'][_0x532b('0x35')]));_0x638d64[_0x532b('0x34')]=_0x638d64[_0x532b('0x34')][_0x532b('0x36')]?_0x638d64['attributes']:_0x1ef764[_0x532b('0x2e')];if(_0x443075['query'][_0x532b('0x41')]){_0x638d64[_0x532b('0x42')]=[{'all':!![]}];}_0x638d64=_['merge']({},_0x638d64,_0x443075[_0x532b('0x40')]);return db[_0x532b('0x2b')][_0x532b('0x47')](_0x638d64)[_0x532b('0x24')](handleEntityNotFound(_0x2739ab,null))[_0x532b('0x24')](respondWithResult(_0x2739ab,null))['catch'](handleError(_0x2739ab,null));};exports[_0x532b('0x48')]=function(_0x56dfea,_0xd945a3){return db['FaxApplication'][_0x532b('0x48')](_0x56dfea[_0x532b('0x49')],{})[_0x532b('0x24')](respondWithResult(_0xd945a3,0xc9))[_0x532b('0x4a')](handleError(_0xd945a3,null));};exports[_0x532b('0x23')]=function(_0x418d86,_0x53a9ee){if(_0x418d86['body']['id']){delete _0x418d86[_0x532b('0x49')]['id'];}return db[_0x532b('0x2b')][_0x532b('0x47')]({'where':{'id':_0x418d86['params']['id']}})['then'](handleEntityNotFound(_0x53a9ee,null))[_0x532b('0x24')](saveUpdates(_0x418d86[_0x532b('0x49')],null))['then'](respondWithResult(_0x53a9ee,null))['catch'](handleError(_0x53a9ee,null));};exports[_0x532b('0x25')]=function(_0x4f92e6,_0x4f4d17){return db[_0x532b('0x2b')][_0x532b('0x47')]({'where':{'id':_0x4f92e6['params']['id']}})[_0x532b('0x24')](handleEntityNotFound(_0x4f4d17,null))[_0x532b('0x24')](removeEntity(_0x4f4d17,null))[_0x532b('0x4a')](handleError(_0x4f4d17,null));};
\ No newline at end of file
index ded3b15..b5e8864 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc324=['moment','request-promise','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','api'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0xc324,0x1be));var _0x4c32=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc324[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4c32('0x0'));var logger=require('../../config/logger')(_0x4c32('0x1'));var moment=require(_0x4c32('0x2'));var BPromise=require('bluebird');var rp=require(_0x4c32('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x517e1b,_0x21553c){return _0x517e1b['define'](_0x4c32('0x4'),attributes,{'tableName':_0x4c32('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c32('0x6'),'collate':_0x4c32('0x7')});};
\ No newline at end of file
+var _0x6b00=['request-promise','path','../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3d7f26,_0x314586){var _0x49d178=function(_0x12a04a){while(--_0x12a04a){_0x3d7f26['push'](_0x3d7f26['shift']());}};_0x49d178(++_0x314586);}(_0x6b00,0x19b));var _0x06b0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6b00[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x06b0('0x0'));var util=require(_0x06b0('0x1'));var logger=require(_0x06b0('0x2'))('api');var moment=require(_0x06b0('0x3'));var BPromise=require(_0x06b0('0x4'));var rp=require(_0x06b0('0x5'));var fs=require('fs');var path=require(_0x06b0('0x6'));var rimraf=require('rimraf');var config=require(_0x06b0('0x7'));var attributes=require(_0x06b0('0x8'));module['exports']=function(_0x5e8f67,_0x465225){return _0x5e8f67[_0x06b0('0x9')](_0x06b0('0xa'),attributes,{'tableName':_0x06b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x06b0('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index a3e0710..487fad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2da=['message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','then','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dbe86,_0x23dced){var _0x40e00e=function(_0x4f3860){while(--_0x4f3860){_0x3dbe86['push'](_0x3dbe86['shift']());}};_0x40e00e(++_0x23dced);}(_0xb2da,0x111));var _0xab2d=function(_0x49db83,_0x535617){_0x49db83=_0x49db83-0x0;var _0x44dba6=_0xb2da[_0x49db83];return _0x44dba6;};'use strict';var _=require('lodash');var util=require(_0xab2d('0x0'));var moment=require(_0xab2d('0x1'));var BPromise=require(_0xab2d('0x2'));var rs=require(_0xab2d('0x3'));var fs=require('fs');var Redis=require(_0xab2d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xab2d('0x5'))('rpc');var config=require(_0xab2d('0x6'));var jayson=require(_0xab2d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24df63,_0x21c7e0,_0x178b85){return new BPromise(function(_0x17811c,_0x2f0f78){return client[_0xab2d('0x8')](_0x24df63,_0x178b85)['then'](function(_0x166ba2){logger[_0xab2d('0x9')](_0xab2d('0xa'),_0x21c7e0,_0xab2d('0xb'));logger[_0xab2d('0xc')](_0xab2d('0xd'),_0x21c7e0,_0xab2d('0xb'),JSON[_0xab2d('0xe')](_0x166ba2));if(_0x166ba2[_0xab2d('0xf')]){if(_0x166ba2[_0xab2d('0xf')][_0xab2d('0x10')]===0x1f4){logger[_0xab2d('0xf')](_0xab2d('0xa'),_0x21c7e0,_0x166ba2[_0xab2d('0xf')][_0xab2d('0x11')]);return _0x2f0f78(_0x166ba2[_0xab2d('0xf')]['message']);}logger[_0xab2d('0xf')](_0xab2d('0xa'),_0x21c7e0,_0x166ba2[_0xab2d('0xf')][_0xab2d('0x11')]);return _0x17811c(_0x166ba2[_0xab2d('0xf')][_0xab2d('0x11')]);}else{logger['info'](_0xab2d('0xa'),_0x21c7e0,_0xab2d('0xb'));_0x17811c(_0x166ba2[_0xab2d('0x12')]['message']);}})[_0xab2d('0x13')](function(_0x10c331){logger[_0xab2d('0xf')]('FaxApplication,\x20%s,\x20%s',_0x21c7e0,_0x10c331);_0x2f0f78(_0x10c331);});});}exports[_0xab2d('0x14')]=function(_0x58e362){var _0xab2d12=this;return new Promise(function(_0x2f2904,_0x6c072e){return db[_0xab2d('0x15')][_0xab2d('0x16')](_0x58e362[_0xab2d('0x17')],{'raw':_0x58e362['options']?_0x58e362['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58e362['options']?_0x58e362[_0xab2d('0x18')][_0xab2d('0x19')]||null:null,'attributes':_0x58e362['options']?_0x58e362[_0xab2d('0x18')][_0xab2d('0x1a')]||null:null,'limit':_0x58e362[_0xab2d('0x18')]?_0x58e362[_0xab2d('0x18')][_0xab2d('0x1b')]||null:null})[_0xab2d('0x1c')](function(_0x8ed560){logger[_0xab2d('0x9')]('UpdateFaxApplication',_0x58e362);logger[_0xab2d('0xc')](_0xab2d('0x14'),_0x58e362,JSON[_0xab2d('0xe')](_0x8ed560));_0x2f2904(_0x8ed560);})[_0xab2d('0x13')](function(_0x3a88ff){logger[_0xab2d('0xf')](_0xab2d('0x14'),_0x3a88ff['message'],_0x58e362);_0x6c072e(_0xab2d12['error'](0x1f4,_0x3a88ff[_0xab2d('0x11')]));});});};
\ No newline at end of file
+var _0xeeea=['debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxApplication','FaxApplication','update','body','raw','options','attributes','limit','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FaxApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x3f1659,_0x20db14){var _0x2171fa=function(_0x5be24e){while(--_0x5be24e){_0x3f1659['push'](_0x3f1659['shift']());}};_0x2171fa(++_0x20db14);}(_0xeeea,0x1a3));var _0xaeee=function(_0x5df210,_0x246c9a){_0x5df210=_0x5df210-0x0;var _0x390467=_0xeeea[_0x5df210];return _0x390467;};'use strict';var _=require(_0xaeee('0x0'));var util=require(_0xaeee('0x1'));var moment=require(_0xaeee('0x2'));var BPromise=require(_0xaeee('0x3'));var rs=require(_0xaeee('0x4'));var fs=require('fs');var Redis=require(_0xaeee('0x5'));var db=require(_0xaeee('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaeee('0x7'))(_0xaeee('0x8'));var config=require(_0xaeee('0x9'));var jayson=require(_0xaeee('0xa'));var client=jayson[_0xaeee('0xb')][_0xaeee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31ede4,_0x307d6a,_0x363d60){return new BPromise(function(_0x19f101,_0x1bd524){return client['request'](_0x31ede4,_0x363d60)['then'](function(_0x30f9dc){logger['info'](_0xaeee('0xd'),_0x307d6a,_0xaeee('0xe'));logger[_0xaeee('0xf')](_0xaeee('0x10'),_0x307d6a,_0xaeee('0xe'),JSON[_0xaeee('0x11')](_0x30f9dc));if(_0x30f9dc[_0xaeee('0x12')]){if(_0x30f9dc[_0xaeee('0x12')][_0xaeee('0x13')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x307d6a,_0x30f9dc[_0xaeee('0x12')][_0xaeee('0x14')]);return _0x1bd524(_0x30f9dc[_0xaeee('0x12')][_0xaeee('0x14')]);}logger['error'](_0xaeee('0xd'),_0x307d6a,_0x30f9dc['error'][_0xaeee('0x14')]);return _0x19f101(_0x30f9dc[_0xaeee('0x12')][_0xaeee('0x14')]);}else{logger['info'](_0xaeee('0xd'),_0x307d6a,_0xaeee('0xe'));_0x19f101(_0x30f9dc['result'][_0xaeee('0x14')]);}})[_0xaeee('0x15')](function(_0x75da67){logger[_0xaeee('0x12')](_0xaeee('0xd'),_0x307d6a,_0x75da67);_0x1bd524(_0x75da67);});});}exports[_0xaeee('0x16')]=function(_0x337c34){var _0x4ef492=this;return new Promise(function(_0x2d7b18,_0x14b10a){return db[_0xaeee('0x17')][_0xaeee('0x18')](_0x337c34[_0xaeee('0x19')],{'raw':_0x337c34['options']?_0x337c34['options'][_0xaeee('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x337c34[_0xaeee('0x1b')]?_0x337c34[_0xaeee('0x1b')]['where']||null:null,'attributes':_0x337c34[_0xaeee('0x1b')]?_0x337c34[_0xaeee('0x1b')][_0xaeee('0x1c')]||null:null,'limit':_0x337c34['options']?_0x337c34[_0xaeee('0x1b')][_0xaeee('0x1d')]||null:null})['then'](function(_0x387b5a){logger[_0xaeee('0x1e')]('UpdateFaxApplication',_0x337c34);logger[_0xaeee('0xf')]('UpdateFaxApplication',_0x337c34,JSON[_0xaeee('0x11')](_0x387b5a));_0x2d7b18(_0x387b5a);})[_0xaeee('0x15')](function(_0x114920){logger[_0xaeee('0x12')](_0xaeee('0x16'),_0x114920['message'],_0x337c34);_0x14b10a(_0x4ef492[_0xaeee('0x12')](0x1f4,_0x114920[_0xaeee('0x14')]));});});};
\ No newline at end of file
index cb64abc..e19ddfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x3d3cd4,_0x164263){var _0x70d940=function(_0x1fda27){while(--_0x1fda27){_0x3d3cd4['push'](_0x3d3cd4['shift']());}};_0x70d940(++_0x164263);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5515a7,_0x2c4af1){_0x5515a7=_0x5515a7-0x0;var _0x43f4bf=_0x5eb8[_0x5515a7];return _0x43f4bf;};'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['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router;
\ No newline at end of file
+var _0xf4f4=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2aaeac,_0x30bda5){var _0x757741=function(_0x5893d2){while(--_0x5893d2){_0x2aaeac['push'](_0x2aaeac['shift']());}};_0x757741(++_0x30bda5);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x2b7389,_0x58311b){_0x2b7389=_0x2b7389-0x0;var _0xe5d9da=_0xf4f4[_0x2b7389];return _0xe5d9da;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./faxApplication.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xd')]('/',auth['isAuthenticated'](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xf')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0x11')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 1ee71d4..3ed58e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48a5=['STRING','ENUM','sequelize','BOOLEAN','DATE'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x48a5,0x1b0));var _0x548a=function(_0x2fe1ba,_0x48862c){_0x2fe1ba=_0x2fe1ba-0x0;var _0x4174c3=_0x48a5[_0x2fe1ba];return _0x4174c3;};'use strict';var Sequelize=require(_0x548a('0x0'));module['exports']={'closed':{'type':Sequelize[_0x548a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x548a('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x548a('0x2')]},'fax':{'type':Sequelize[_0x548a('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x548a('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x3fc3=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x4c048d,_0x4889bf){var _0x10e4c9=function(_0x35919a){while(--_0x35919a){_0x4c048d['push'](_0x4c048d['shift']());}};_0x10e4c9(++_0x4889bf);}(_0x3fc3,0x1da));var _0x33fc=function(_0x21b167,_0x4e9b66){_0x21b167=_0x21b167-0x0;var _0x391c68=_0x3fc3[_0x21b167];return _0x391c68;};'use strict';var Sequelize=require(_0x33fc('0x0'));module[_0x33fc('0x1')]={'closed':{'type':Sequelize[_0x33fc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x33fc('0x3')]},'secondDisposition':{'type':Sequelize[_0x33fc('0x3')]},'thirdDisposition':{'type':Sequelize[_0x33fc('0x3')]},'note':{'type':Sequelize[_0x33fc('0x3')]},'read1stAt':{'type':Sequelize[_0x33fc('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x33fc('0x5')]('in',_0x33fc('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x33fc('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x33fc('0x5')]('in',_0x33fc('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 06b6040..4b42c36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe010=['fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','left_join','fax_interactions','cm_contacts','users','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','text','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','FaxInteraction','includeAll','include','options','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','faxInteractionTags:save','removeTags','download','unix','join','server','files','root','Attachment','Messages','get','basename','existsSync','createReadStream','createWriteStream','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','error','name','send','map'];(function(_0x37bca9,_0x437f7f){var _0x695ffe=function(_0x29e533){while(--_0x29e533){_0x37bca9['push'](_0x37bca9['shift']());}};_0x695ffe(++_0x437f7f);}(_0xe010,0x18a));var _0x0e01=function(_0xed8b0b,_0x52d8d7){_0xed8b0b=_0xed8b0b-0x0;var _0x1748aa=_0xe010[_0xed8b0b];return _0x1748aa;};'use strict';var emlformat=require(_0x0e01('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0e01('0x1'));var rp=require(_0x0e01('0x2'));var moment=require(_0x0e01('0x3'));var BPromise=require(_0x0e01('0x4'));var Mustache=require('mustache');var util=require(_0x0e01('0x5'));var path=require(_0x0e01('0x6'));var sox=require(_0x0e01('0x7'));var csv=require(_0x0e01('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e01('0x9'));var _=require(_0x0e01('0xa'));var squel=require(_0x0e01('0xb'));var crypto=require(_0x0e01('0xc'));var jsforce=require(_0x0e01('0xd'));var deskjs=require(_0x0e01('0xe'));var toCsv=require(_0x0e01('0x8'));var querystring=require('querystring');var Papa=require(_0x0e01('0xf'));var Redis=require(_0x0e01('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0e01('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e01('0x12'));var logger=require('../../config/logger')(_0x0e01('0x13'));var utils=require('../../config/utils');var config=require(_0x0e01('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e01('0x15'))['db'];config[_0x0e01('0x16')]=_[_0x0e01('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e01('0x16')]));require('./faxInteraction.socket')[_0x0e01('0x18')](socket);function respondWithStatusCode(_0x29c898,_0x4a39fd){_0x4a39fd=_0x4a39fd||0xcc;return function(_0xa1b44a){if(_0xa1b44a){return _0x29c898[_0x0e01('0x19')](_0x4a39fd);}return _0x29c898['status'](_0x4a39fd)[_0x0e01('0x1a')]();};}function respondWithResult(_0x5879cf,_0x8c71b2){_0x8c71b2=_0x8c71b2||0xc8;return function(_0x2518e6){if(_0x2518e6){return _0x5879cf['status'](_0x8c71b2)['json'](_0x2518e6);}};}function respondWithFilteredResult(_0x20261f,_0xb17817){return function(_0x5f585c){if(_0x5f585c){var _0x6c701e=typeof _0xb17817[_0x0e01('0x1b')]===_0x0e01('0x1c')&&typeof _0xb17817[_0x0e01('0x1d')]===_0x0e01('0x1c');var _0x40168=_0x5f585c[_0x0e01('0x1e')];var _0x25a26c=_0x6c701e?0x0:_0xb17817[_0x0e01('0x1b')];var _0x2083d0=_0x6c701e?_0x5f585c['count']:_0xb17817['offset']+_0xb17817[_0x0e01('0x1d')];var _0x311c3c;if(_0x2083d0>=_0x40168){_0x2083d0=_0x40168;_0x311c3c=0xc8;}else{_0x311c3c=0xce;}_0x20261f[_0x0e01('0x1f')](_0x311c3c);return _0x20261f[_0x0e01('0x20')](_0x0e01('0x21'),_0x25a26c+'-'+_0x2083d0+'/'+_0x40168)[_0x0e01('0x22')](_0x5f585c);}return null;};}function patchUpdates(_0x363306){return function(_0xb6cb75){try{jsonpatch[_0x0e01('0x23')](_0xb6cb75,_0x363306,!![]);}catch(_0x27e29d){return BPromise[_0x0e01('0x24')](_0x27e29d);}return _0xb6cb75[_0x0e01('0x25')]();};}function saveUpdates(_0x41336e,_0x21a5d2){return function(_0x4859d9){if(_0x4859d9){return _0x4859d9[_0x0e01('0x26')](_0x41336e)[_0x0e01('0x27')](function(_0x24dfce){return _0x24dfce;});}return null;};}function removeEntity(_0x2ed6bc,_0x5b4ac6){return function(_0x16e7ac){if(_0x16e7ac){return _0x16e7ac['destroy']()[_0x0e01('0x27')](function(){_0x2ed6bc[_0x0e01('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x239b5a,_0x20447d){return function(_0xdbbc4f){if(!_0xdbbc4f){_0x239b5a[_0x0e01('0x19')](0x194);}return _0xdbbc4f;};}function handleError(_0x1c835d,_0x542bea){_0x542bea=_0x542bea||0x1f4;return function(_0x3fd350){logger[_0x0e01('0x28')](_0x3fd350['stack']);if(_0x3fd350['name']){delete _0x3fd350[_0x0e01('0x29')];}_0x1c835d['status'](_0x542bea)[_0x0e01('0x2a')](_0x3fd350);};}function getInteractionUsers(_0x542075,_0x445ff5){return new BPromise(function(_0x36363d,_0x25e589){try{if(_0x445ff5[_0x542075['id']]){_0x542075['Users']=_[_0x0e01('0x2b')](_0x445ff5[_0x542075['id']],function(_0xe8f0e3){return{'id':_0xe8f0e3['id'],'fullname':_0xe8f0e3[_0x0e01('0x2c')]};});}}catch(_0x26da27){_0x25e589(_0x26da27);}_0x36363d(_0x542075);});}function getInteractionTags(_0x5237da,_0x46a90e){return new BPromise(function(_0x40a4cd,_0xad1433){try{if(_0x5237da[_0x0e01('0x2d')]){_0x5237da[_0x0e01('0x2e')]=[];_0x5237da[_0x0e01('0x2d')][_0x0e01('0x2f')](',')[_0x0e01('0x30')](function(_0x115827){_0x5237da[_0x0e01('0x2e')][_0x0e01('0x31')](_0x46a90e[_0x115827]);});}delete _0x5237da[_0x0e01('0x2d')];}catch(_0x5433f7){_0xad1433(_0x5433f7);}_0x40a4cd(_0x5237da);});}function updateFaxInteraction(_0x4a0dd7,_0x3083e1,_0x469a17){return new BPromise(function(_0x2a9704,_0x3afbcf){return getInteractionUsers(_0x4a0dd7,_0x469a17)[_0x0e01('0x27')](function(_0x299e25){return getInteractionTags(_0x299e25,_0x3083e1);})[_0x0e01('0x27')](function(_0x4b96ea){return getStateInteraction(_0x4b96ea);})[_0x0e01('0x27')](function(_0x3af4a4){_0x2a9704(_0x3af4a4);})[_0x0e01('0x32')](function(_0x97ed1d){_0x3afbcf(_0x97ed1d);});});}function getStateInteraction(_0x12f2c6){return new BPromise(function(_0x4cb349){_0x12f2c6[_0x0e01('0x33')]=0x0;_0x12f2c6[_0x0e01('0x34')]=0x0;_0x12f2c6[_0x0e01('0x35')]=0x0;_0x12f2c6[_0x0e01('0x36')]=0x0;_0x12f2c6[_0x0e01('0x37')]=0x0;if(!_0x12f2c6[_0x0e01('0x38')]&&!_0x12f2c6[_0x0e01('0x39')]){_0x12f2c6[_0x0e01('0x33')]+=0x1;}if(!_0x12f2c6['closed']&&_0x12f2c6[_0x0e01('0x39')]){_0x12f2c6[_0x0e01('0x34')]+=0x1;if(_0x12f2c6[_0x0e01('0x33')]){_0x12f2c6['waiting']-=0x1;}}if(_0x12f2c6[_0x0e01('0x38')]&&_0x12f2c6['UserId']){_0x12f2c6[_0x0e01('0x35')]+=0x1;if(_0x12f2c6[_0x0e01('0x34')]){_0x12f2c6['talking']-=0x1;}}if(_0x12f2c6['closed']&&!_0x12f2c6['UserId']){_0x12f2c6['unmanaged']+=0x1;if(_0x12f2c6[_0x0e01('0x33')]){_0x12f2c6[_0x0e01('0x33')]-=0x1;}}_0x12f2c6[_0x0e01('0x37')]+=0x1;_0x4cb349(_0x12f2c6);});}exports[_0x0e01('0x3a')]=function(_0xfdd544,_0x546b16){var _0x469906={},_0xb4d7fc={},_0x2459ee={'count':0x0,'rows':[]};var _0x315f0e=_[_0x0e01('0x2b')](db['FaxInteraction'][_0x0e01('0x3b')],function(_0x57e096){return{'name':_0x57e096['fieldName'],'type':_0x57e096[_0x0e01('0x3c')][_0x0e01('0x3d')]};});_0xb4d7fc[_0x0e01('0x3e')]=_[_0x0e01('0x2b')](_0x315f0e,_0x0e01('0x29'));_0xb4d7fc[_0x0e01('0x3f')]=_[_0x0e01('0x40')](_0xfdd544[_0x0e01('0x3f')]);_0xb4d7fc[_0x0e01('0x41')]=_[_0x0e01('0x42')](_0xb4d7fc['model'],_0xb4d7fc[_0x0e01('0x3f')]);_0x469906['attributes']=_[_0x0e01('0x42')](_0xb4d7fc[_0x0e01('0x3e')],qs[_0x0e01('0x43')](_0xfdd544[_0x0e01('0x3f')]['fields']));_0x469906[_0x0e01('0x44')]=_0x469906['attributes']['length']?_0x469906[_0x0e01('0x44')]:_0xb4d7fc[_0x0e01('0x3e')];if(!_0xfdd544[_0x0e01('0x3f')][_0x0e01('0x45')](_0x0e01('0x46'))){_0x469906['limit']=qs['limit'](_0xfdd544[_0x0e01('0x3f')]['limit']);_0x469906[_0x0e01('0x1b')]=qs['offset'](_0xfdd544[_0x0e01('0x3f')][_0x0e01('0x1b')]);}_0x469906['order']=qs[_0x0e01('0x47')](_0xfdd544[_0x0e01('0x3f')]['sort']);_0x469906[_0x0e01('0x48')]=qs[_0x0e01('0x41')](_['pick'](_0xfdd544['query'],_0xb4d7fc['filters']),_0x315f0e);var _0x3f224f=[];var _0x305849=squel[_0x0e01('0x49')]()[_0x0e01('0x4a')]('id')[_0x0e01('0x4a')](_0x0e01('0x29'))[_0x0e01('0x4a')](_0x0e01('0x4b'))[_0x0e01('0x4c')](_0x0e01('0x4d'));var _0x46fcef=squel[_0x0e01('0x49')]()[_0x0e01('0x4a')](_0x0e01('0x4e'))[_0x0e01('0x4a')](_0x0e01('0x4f'))[_0x0e01('0x4a')]('ui.FaxInteractionId')[_0x0e01('0x4c')]('user_has_fax_interactions','ui')[_0x0e01('0x50')]('users','u','u.id\x20=\x20ui.UserId');var _0x24f98d=squel['select']()['from'](_0x0e01('0x51'),'i')[_0x0e01('0x50')](_0x0e01('0x52'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0e01('0x50')](_0x0e01('0x53'),'o','o.id\x20=\x20i.UserId')[_0x0e01('0x50')](_0x0e01('0x54'),'a',_0x0e01('0x55'))['left_join'](_0x0e01('0x56'),'me',_0x0e01('0x57'))['left_join'](_0x0e01('0x58'),'it',_0x0e01('0x59'))['left_join']('tools_tags','t',_0x0e01('0x5a'));var _0xe0a146=squel[_0x0e01('0x5b')]();var _0x2ab40e=[];var _0x423df4=squel[_0x0e01('0x5b')]();var _0xf84c44;if(_0xfdd544[_0x0e01('0x3f')][_0x0e01('0x5c')]){_0xf84c44=as[_0x0e01('0x5d')](_0xfdd544[_0x0e01('0x3f')][_0x0e01('0x5c')]);var _0x75151b=_0xf84c44['sqlOperator'];for(var _0x3f65a4=0x0;_0x3f65a4<_0xf84c44[_0x0e01('0x5e')]['length'];_0x3f65a4++){var _0x1a1393=_0xf84c44['conditions'][_0x3f65a4];var _0x33be4c='i';var _0x5e4949=_[_0x0e01('0x5f')](_0x315f0e,['name',_0x1a1393['field']]);if(!_0x5e4949){switch(_0x1a1393[_0x0e01('0x4a')]){case'unreadMessages':if(_0x1a1393['value']==0x1){_0x24f98d[_0x0e01('0x60')]('`'+_0x1a1393[_0x0e01('0x4a')]+_0x0e01('0x61'));}else{_0x24f98d[_0x0e01('0x60')]('`'+_0x1a1393[_0x0e01('0x4a')]+_0x0e01('0x62'));}break;case _0x0e01('0x63'):if(_0x1a1393[_0x0e01('0x64')]==='$substring'){if(_0x1a1393['value'][_0x0e01('0x2f')]('\x20')[_0x0e01('0x65')]>0x1){_0xe0a146[_0x75151b](_0x0e01('0x66'),qs['getFullTextValue'](_0x1a1393[_0x0e01('0x67')]),null);}else{var _0xb5322='%'+_0x1a1393[_0x0e01('0x67')]+'%';_0xe0a146[_0x75151b](_0x0e01('0x68'),_0xb5322,_0xb5322,_0xb5322);}}else{_0x5e4949=_[_0x0e01('0x5f')](_0x315f0e,['name',_0x0e01('0x69')]);_0x1a1393['field']=_0x0e01('0x69');_0x4154f2=as[_0x0e01('0x6a')](_0x33be4c,_0x5e4949[_0x0e01('0x3c')],_0x1a1393);_0xe0a146[_0x75151b](_0x4154f2['text'],_0x4154f2[_0x0e01('0x67')][_0x0e01('0x6b')],_0x4154f2[_0x0e01('0x67')]['end']);}break;case'Tag':var _0x188f8c=_0x1a1393['value'][_0x0e01('0x2f')](',')[_0x0e01('0x2b')](function(_0x1193a1){return Number(_0x1193a1);});_0x188f8c[_0x0e01('0x30')](function(_0x436f1a){_0x423df4['or'](_0x0e01('0x6c'),'%,'+_0x436f1a+',%');});_0x2ab40e=_[_0x0e01('0x6d')](_0x2ab40e,_0x188f8c);break;case _0x0e01('0x6e'):if(_0x1a1393[_0x0e01('0x64')]===_0x0e01('0x6f')){_0xe0a146[_0x75151b](_0x0e01('0x70'),'%'+_0x1a1393['value']+'%',null);}else{_0x5e4949=_['find'](_0x315f0e,[_0x0e01('0x29'),'UserId']);_0x1a1393[_0x0e01('0x4a')]='UserId';_0x4154f2=as[_0x0e01('0x6a')](_0x33be4c,_0x5e4949['type'],_0x1a1393);_0xe0a146[_0x75151b](_0x4154f2['text'],_0x4154f2[_0x0e01('0x67')][_0x0e01('0x6b')],_0x4154f2[_0x0e01('0x67')][_0x0e01('0x1a')]);}break;case _0x0e01('0x71'):_0x4154f2=as['buildExpression']('me',null,_0x1a1393);_0xe0a146[_0x75151b](_0x4154f2['text'],_0x4154f2['value'][_0x0e01('0x6b')],_0x4154f2[_0x0e01('0x67')][_0x0e01('0x1a')]);break;}}else{var _0x4154f2=as[_0x0e01('0x6a')](_0x33be4c,_0x5e4949[_0x0e01('0x3c')],_0x1a1393);_0xe0a146[_0x75151b](_0x4154f2[_0x0e01('0x72')],_0x4154f2[_0x0e01('0x67')][_0x0e01('0x6b')],_0x4154f2[_0x0e01('0x67')][_0x0e01('0x1a')]);}}}else{var _0x55ea4f=_(_0xfdd544[_0x0e01('0x3f')])[_0x0e01('0x40')]()['map'](function(_0x19538c){return _[_0x0e01('0x73')](_0x315f0e,['name',_0x19538c])?_0x19538c:undefined;})[_0x0e01('0x74')]()[_0x0e01('0x67')]();if(!_[_0x0e01('0x75')](_0x55ea4f)){_0x55ea4f['forEach'](function(_0x41546d){if(_0x41546d===_0x0e01('0x76')){_0x24f98d[_0x0e01('0x48')](_0x0e01('0x77'),[]['concat'](_0xfdd544[_0x0e01('0x3f')][_0x41546d]));}else if(_0x41546d===_0x0e01('0x78')){var _0x25255c=JSON[_0x0e01('0x79')](_0xfdd544[_0x0e01('0x3f')][_0x41546d])['$gte'];var _0x41b213=JSON[_0x0e01('0x79')](_0xfdd544['query'][_0x41546d])[_0x0e01('0x7a')];_0x24f98d[_0x0e01('0x48')](_0x0e01('0x7b'),_0x25255c,_0x41b213);}else{if(_0xfdd544[_0x0e01('0x3f')][_0x41546d]===_0x0e01('0x7c')){_0x24f98d[_0x0e01('0x48')]('i.'+_0x41546d+_0x0e01('0x7d'));}else{_0x24f98d[_0x0e01('0x48')]('i.'+_0x41546d+_0x0e01('0x7e'),_0xfdd544['query'][_0x41546d]);}}});}if(_0xfdd544[_0x0e01('0x3f')][_0x0e01('0x7f')]){if(_0xfdd544[_0x0e01('0x3f')]['read']==0x1){_0x24f98d[_0x0e01('0x60')](_0x0e01('0x80'));}else{_0x24f98d[_0x0e01('0x60')](_0x0e01('0x81'));}}if(_0xfdd544[_0x0e01('0x3f')][_0x0e01('0x82')]){_0x2ab40e=_[_0x0e01('0x83')](_0xfdd544[_0x0e01('0x3f')]['tag'])?_0xfdd544[_0x0e01('0x3f')][_0x0e01('0x82')]:new Array(_0xfdd544['query'][_0x0e01('0x82')]);_0x2ab40e[_0x0e01('0x30')](function(_0x32ff80){_0x423df4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x32ff80+',%');});}if(_0xfdd544[_0x0e01('0x3f')]['filter']){var _0x32b2f7=_0xfdd544[_0x0e01('0x3f')][_0x0e01('0x84')]['replace']('\x5c','\x5c\x5c')[_0x0e01('0x85')](/'/g,'\x27\x27');if(qs[_0x0e01('0x86')](_0x32b2f7)){_0xe0a146['or'](_0x0e01('0x87'),_0x32b2f7+'%')['or'](_0x0e01('0x88'),_0x32b2f7+'%');}_0xe0a146['or'](_0x0e01('0x89'),_0x32b2f7+'%');}}_0x24f98d[_0x0e01('0x48')](_0xe0a146);_0x24f98d[_0x0e01('0x8a')](_0x0e01('0x8b'));var _0x2ec4c3={'type':db[_0x0e01('0x8c')][_0x0e01('0x8d')][_0x0e01('0x8e')],'raw':!![]};var _0x5d1a6f=_0x24f98d[_0x0e01('0x8f')]();_0x5d1a6f['field'](_0x0e01('0x8b'));_0x5d1a6f['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0e01('0x90'));if(_0x469906[_0x0e01('0x91')]){_0x469906[_0x0e01('0x91')][_0x0e01('0x30')](function(_0x594f33){var _0x510ae2=_0x594f33[0x0]===_0x0e01('0x92')?_0x594f33[0x0]:'i.'+_0x594f33[0x0];_0x24f98d[_0x0e01('0x91')](_0x510ae2,_0x594f33[0x1]===_0x0e01('0x93')?![]:!![]);});}if(!_['isEmpty'](_0x2ab40e)){_0x24f98d[_0x0e01('0x60')](_0x423df4);_0x5d1a6f['where'](_0x0e01('0x94'),_0x2ab40e);}BPromise[_0x0e01('0x95')]()[_0x0e01('0x27')](function(){if(!_0xf84c44){if(_0xfdd544['query'][_0x0e01('0x76')])return;_0x5d1a6f['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x24f98d[_0x0e01('0x48')](_0x0e01('0x96'));return;}if(_0xfdd544[_0x0e01('0x97')][_0x0e01('0x98')]!==_0x0e01('0x99'))return;return _0xfdd544['user'][_0x0e01('0x9a')]({'attributes':['id'],'raw':!![]})[_0x0e01('0x27')](function(_0x21ea2b){if(_[_0x0e01('0x75')](_0x21ea2b)){_0x5d1a6f[_0x0e01('0x48')](_0x0e01('0x9b'));_0x24f98d[_0x0e01('0x48')](_0x0e01('0x9b'));}else{_0x5d1a6f['where'](_0x0e01('0x77'),_[_0x0e01('0x2b')](_0x21ea2b,'id'));_0x24f98d[_0x0e01('0x48')](_0x0e01('0x77'),_['map'](_0x21ea2b,'id'));}});})[_0x0e01('0x27')](function(){if(_0xfdd544[_0x0e01('0x97')][_0x0e01('0x98')]==='agent'&&!_0xf84c44&&!_0xfdd544['query']['FaxAccountId'])return[];return db[_0x0e01('0x9c')]['query'](_0x5d1a6f[_0x0e01('0x9d')](),_0x2ec4c3);})[_0x0e01('0x27')](function(_0x512f23){_0x2459ee[_0x0e01('0x1e')]=_0x512f23[_0x0e01('0x65')];if(_0x2459ee['count']===0x0)return[];return db[_0x0e01('0x9c')][_0x0e01('0x3f')](_0x305849['toString'](),_0x2ec4c3)['then'](function(_0x287cb5){_0x3f224f=_['keyBy'](_0x287cb5,'id');_0x2ec4c3=_[_0x0e01('0x9e')](_0x2ec4c3,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xfdd544[_0x0e01('0x3f')][_0x0e01('0x43')]){_0x469906[_0x0e01('0x44')][_0x0e01('0x30')](function(_0x1fb226){_0x24f98d[_0x0e01('0x4a')]('i.'+_0x1fb226);});}else{_0x24f98d[_0x0e01('0x4a')](_0x0e01('0x9f'),_0x0e01('0x90'));_0x24f98d[_0x0e01('0x4a')]('a.key','Account.key');_0x24f98d[_0x0e01('0x4a')](_0x0e01('0xa0'),_0x0e01('0xa1'));_0x24f98d[_0x0e01('0x4a')](_0x0e01('0xa2'),_0x0e01('0x92'));_0x24f98d['field'](_0x0e01('0xa3'));_0x24f98d['field']('c.firstName',_0x0e01('0xa4'));_0x24f98d[_0x0e01('0x4a')](_0x0e01('0xa5'),_0x0e01('0xa6'));_0x24f98d['field']('c.email',_0x0e01('0xa7'));_0x24f98d[_0x0e01('0x4a')](_0x0e01('0xa8'),'Contact.phone');_0x24f98d[_0x0e01('0x4a')](_0x0e01('0xa9'),_0x0e01('0xaa'));_0x24f98d[_0x0e01('0x4a')](_0x0e01('0xab'),_0x0e01('0xac'));_0x24f98d['field'](_0x0e01('0xad'),'Owner.fullname');_0x24f98d[_0x0e01('0x4a')](_0x0e01('0xae'),'Owner.internal');_0x24f98d[_0x0e01('0x4a')](_0x0e01('0xaf'),_0x0e01('0x2d'));}if(_0x469906['limit'])_0x24f98d['limit'](_0x469906[_0x0e01('0x1d')]);if(_0x469906[_0x0e01('0x1b')])_0x24f98d['offset'](_0x469906[_0x0e01('0x1b')]);return db[_0x0e01('0x9c')][_0x0e01('0x3f')](_0x24f98d['toString'](),_0x2ec4c3);})[_0x0e01('0x27')](function(_0x52ee1c){if(_0x52ee1c[_0x0e01('0x65')]>0x0)_0x46fcef[_0x0e01('0x48')](_0x0e01('0xb0'),_[_0x0e01('0x2b')](_0x52ee1c,'id'));return db[_0x0e01('0x9c')]['query'](_0x46fcef['toString'](),_0x2ec4c3)[_0x0e01('0x27')](function(_0x5dd236){var _0x347816=_[_0x0e01('0xb1')](_0x5dd236,_0x0e01('0xb2'));var _0x110b14=[];_0x52ee1c['forEach'](function(_0x1642b8){_0x110b14[_0x0e01('0x31')](updateFaxInteraction(_0x1642b8,_0x3f224f,_0x347816));});return BPromise[_0x0e01('0xb3')](_0x110b14);});});})[_0x0e01('0x27')](function(_0x3a2c44){_0x2459ee[_0x0e01('0xb4')]=_0x3a2c44;return _0x2459ee;})[_0x0e01('0x27')](respondWithFilteredResult(_0x546b16,_0x469906))[_0x0e01('0x32')](handleError(_0x546b16,null));};exports[_0x0e01('0xb5')]=function(_0x43a048,_0x146c7b){var _0x42d887={'raw':![],'where':{'id':_0x43a048[_0x0e01('0xb6')]['id']}},_0x5516fb={};_0x5516fb['model']=_[_0x0e01('0x40')](db[_0x0e01('0xb7')][_0x0e01('0x3b')]);_0x5516fb['query']=_[_0x0e01('0x40')](_0x43a048[_0x0e01('0x3f')]);_0x5516fb[_0x0e01('0x41')]=_['intersection'](_0x5516fb[_0x0e01('0x3e')],_0x5516fb['query']);_0x42d887['attributes']=_[_0x0e01('0x42')](_0x5516fb[_0x0e01('0x3e')],qs[_0x0e01('0x43')](_0x43a048['query'][_0x0e01('0x43')]));_0x42d887[_0x0e01('0x44')]=_0x42d887[_0x0e01('0x44')]['length']?_0x42d887['attributes']:_0x5516fb[_0x0e01('0x3e')];if(_0x43a048[_0x0e01('0x3f')][_0x0e01('0xb8')]){_0x42d887[_0x0e01('0xb9')]=[{'all':!![]}];}_0x42d887=_[_0x0e01('0x9e')]({},_0x42d887,_0x43a048[_0x0e01('0xba')]);return db[_0x0e01('0xb7')][_0x0e01('0x5f')](_0x42d887)[_0x0e01('0x27')](handleEntityNotFound(_0x146c7b,null))[_0x0e01('0x27')](respondWithResult(_0x146c7b,null))[_0x0e01('0x32')](handleError(_0x146c7b,null));};exports['create']=function(_0xc75ef0,_0x4443cf){return db['FaxInteraction']['create'](_0xc75ef0[_0x0e01('0x71')],{})[_0x0e01('0x27')](respondWithResult(_0x4443cf,0xc9))['catch'](handleError(_0x4443cf,null));};exports[_0x0e01('0x26')]=function(_0x5e3c6d,_0x48cefe){if(_0x5e3c6d[_0x0e01('0x71')]['id']){delete _0x5e3c6d[_0x0e01('0x71')]['id'];}return db[_0x0e01('0xb7')]['find']({'where':{'id':_0x5e3c6d[_0x0e01('0xb6')]['id']}})['then'](handleEntityNotFound(_0x48cefe,null))[_0x0e01('0x27')](saveUpdates(_0x5e3c6d[_0x0e01('0x71')],null))[_0x0e01('0x27')](respondWithResult(_0x48cefe,null))[_0x0e01('0x32')](handleError(_0x48cefe,null));};exports[_0x0e01('0xbb')]=function(_0x59999d,_0x42866c){return db[_0x0e01('0xb7')]['find']({'where':{'id':_0x59999d[_0x0e01('0xb6')]['id']}})[_0x0e01('0x27')](handleEntityNotFound(_0x42866c,null))[_0x0e01('0x27')](removeEntity(_0x42866c,null))['catch'](handleError(_0x42866c,null));};exports[_0x0e01('0xbc')]=function(_0x27c7f2,_0xb2e7b5){return db[_0x0e01('0xb7')][_0x0e01('0xbc')]()[_0x0e01('0x27')](respondWithResult(_0xb2e7b5,null))[_0x0e01('0x32')](handleError(_0xb2e7b5,null));};exports[_0x0e01('0xbd')]=function(_0x39c981,_0x4c6951,_0x10f933){return db[_0x0e01('0xbe')][_0x0e01('0x5f')]({'where':{'id':_0x39c981[_0x0e01('0xb6')]['id']}})[_0x0e01('0x27')](handleEntityNotFound(_0x4c6951,null))[_0x0e01('0x27')](function(_0x1b0ca9){if(_0x1b0ca9){return _0x1b0ca9['addMessage'](_0x39c981[_0x0e01('0x71')][_0x0e01('0xbf')],_[_0x0e01('0xc0')](_0x39c981['body'],[_0x0e01('0xbf'),'id'])||{});}})[_0x0e01('0x27')](respondWithResult(_0x4c6951,null))[_0x0e01('0x32')](handleError(_0x4c6951,null));};exports[_0x0e01('0xc1')]=function(_0x4bd686,_0x14bd70,_0x137f4){var _0x182312={'raw':![],'where':{}};var _0x4fec59={};var _0x51e342={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x0e01('0xc2')]({'where':{'id':_0x4bd686[_0x0e01('0xb6')]['id']}})[_0x0e01('0x27')](handleEntityNotFound(_0x14bd70,null))[_0x0e01('0x27')](function(_0x58f243){if(_0x58f243){_0x4fec59[_0x0e01('0x3e')]=_[_0x0e01('0x40')](db['FaxMessage'][_0x0e01('0x3b')]);_0x4fec59[_0x0e01('0x3f')]=_[_0x0e01('0x40')](_0x4bd686[_0x0e01('0x3f')]);_0x4fec59[_0x0e01('0x41')]=_[_0x0e01('0x42')](_0x4fec59[_0x0e01('0x3e')],_0x4fec59[_0x0e01('0x3f')]);_0x182312[_0x0e01('0x44')]=_[_0x0e01('0x42')](_0x4fec59[_0x0e01('0x3e')],qs[_0x0e01('0x43')](_0x4bd686[_0x0e01('0x3f')][_0x0e01('0x43')]));_0x182312[_0x0e01('0x44')]=_0x182312[_0x0e01('0x44')][_0x0e01('0x65')]?_0x182312[_0x0e01('0x44')]:_0x4fec59[_0x0e01('0x3e')];if(!_0x4bd686[_0x0e01('0x3f')]['hasOwnProperty'](_0x0e01('0x46'))){_0x182312[_0x0e01('0x1d')]=qs[_0x0e01('0x1d')](_0x4bd686[_0x0e01('0x3f')][_0x0e01('0x1d')]);_0x182312['offset']=qs[_0x0e01('0x1b')](_0x4bd686[_0x0e01('0x3f')][_0x0e01('0x1b')]);}_0x182312[_0x0e01('0x91')]=qs[_0x0e01('0x47')](_0x4bd686[_0x0e01('0x3f')][_0x0e01('0x47')]);_0x182312[_0x0e01('0x48')]=qs['filters'](_[_0x0e01('0xc3')](_0x4bd686[_0x0e01('0x3f')],_0x4fec59[_0x0e01('0x41')]));_0x182312[_0x0e01('0x48')][_0x0e01('0xb2')]=_0x58f243['id'];if(_0x4bd686[_0x0e01('0x3f')]['filter']){_0x182312[_0x0e01('0x48')]=_[_0x0e01('0x9e')](_0x182312[_0x0e01('0x48')],{'$or':_['map'](_0x182312['attributes'],function(_0x56255d){var _0x5c3cf0={};_0x5c3cf0[_0x56255d]={'$like':'%'+_0x4bd686[_0x0e01('0x3f')]['filter']+'%'};return _0x5c3cf0;})});}if(_0x4bd686['query']['$gte']){var _0x486975=_0x4bd686[_0x0e01('0x3f')][_0x0e01('0xc4')]['split'](',');var _0x15714c={};_0x15714c[_0x486975[0x0]]={'$gte':moment(_0x486975[0x1])[_0x0e01('0xc5')](_0x0e01('0xc6'))};_0x182312[_0x0e01('0x48')]=_[_0x0e01('0x9e')](_0x182312[_0x0e01('0x48')],_0x15714c);}_0x182312=_[_0x0e01('0x9e')]({},_0x182312,_0x4bd686[_0x0e01('0xba')]);return db[_0x0e01('0xbe')]['count']({'where':_0x182312[_0x0e01('0x48')]})[_0x0e01('0x27')](function(_0x282e6e){_0x51e342[_0x0e01('0x1e')]=_0x282e6e;if(_0x4bd686[_0x0e01('0x3f')][_0x0e01('0xb8')]){_0x182312[_0x0e01('0xb9')]=[{'all':!![]}];}return db['FaxMessage'][_0x0e01('0xc7')](_0x182312);})[_0x0e01('0x27')](function(_0x6c3fcb){_0x51e342[_0x0e01('0xb4')]=_0x6c3fcb;return _0x51e342;});}})[_0x0e01('0x27')](respondWithFilteredResult(_0x14bd70,_0x182312))[_0x0e01('0x32')](handleError(_0x14bd70,null));};exports['addTags']=function(_0x349de9,_0x122501,_0x5643c2){return db[_0x0e01('0xb7')]['find']({'where':{'id':_0x349de9[_0x0e01('0xb6')]['id']}})['then'](handleEntityNotFound(_0x122501,null))[_0x0e01('0x27')](function(_0x458d4a){if(_0x458d4a){return _0x458d4a[_0x0e01('0xc8')](_0x349de9[_0x0e01('0x71')][_0x0e01('0xbf')],_['omit'](_0x349de9[_0x0e01('0x71')],[_0x0e01('0xbf'),'id'])||{})[_0x0e01('0xc9')](function(){return db['Tag'][_0x0e01('0xc7')]({'attributes':['id',_0x0e01('0x29'),_0x0e01('0x4b')],'where':{'id':_0x349de9[_0x0e01('0x71')][_0x0e01('0xbf')]}});})[_0x0e01('0x27')](function(_0x115b38){socket['emit'](_0x0e01('0xca'),{'id':Number(_0x349de9['params']['id']),'tags':_0x115b38||[]});return{'id':Number(_0x349de9[_0x0e01('0xb6')]['id']),'tags':_0x115b38||[]};});}})[_0x0e01('0x27')](respondWithResult(_0x122501,null))['catch'](handleError(_0x122501,null));};exports['removeTags']=function(_0x9f9b8d,_0x2543c9,_0x12e0ae){return db[_0x0e01('0xb7')]['find']({'where':{'id':_0x9f9b8d['params']['id']}})[_0x0e01('0x27')](handleEntityNotFound(_0x2543c9,null))[_0x0e01('0x27')](function(_0x52d695){if(_0x52d695){return _0x52d695[_0x0e01('0xcb')](_0x9f9b8d[_0x0e01('0x3f')]['ids']);}})[_0x0e01('0x27')](respondWithStatusCode(_0x2543c9,null))[_0x0e01('0x32')](handleError(_0x2543c9,null));};exports[_0x0e01('0xcc')]=function(_0x50f498,_0xdb4ee){var _0x41e2f0=moment()[_0x0e01('0xcd')]()['toString']();var _0x4d4d5c=path[_0x0e01('0xce')](config['root'],_0x0e01('0xcf'),_0x0e01('0xd0'),'tmp');var _0x19b5b3=path[_0x0e01('0xce')](config[_0x0e01('0xd1')],_0x0e01('0xcf'),_0x0e01('0xd0'),'attachments');var _0x29cb1d=path[_0x0e01('0xce')](_0x4d4d5c,_0x41e2f0);var _0x416c21=util['format']('transcript-%d-%s.zip',_0x50f498[_0x0e01('0xb6')]['id'],_0x41e2f0);var _0xf5f57e=path[_0x0e01('0xce')](_0x4d4d5c,_0x416c21);var _0x29e814=[];_0x29e814[_0x0e01('0x31')]({'model':db[_0x0e01('0xd2')],'as':_0x0e01('0xd2'),'raw':!![]});var _0x5675f7=[{'model':db[_0x0e01('0xbe')],'as':'Messages','attributes':['id',_0x0e01('0x71'),_0x0e01('0x78')],'include':_0x29e814}];return db[_0x0e01('0xb7')]['find']({'where':{'id':_0x50f498[_0x0e01('0xb6')]['id']},'include':_0x5675f7})[_0x0e01('0x27')](handleEntityNotFound(_0xdb4ee,null))[_0x0e01('0x27')](function(_0x1cd02a){if(_0x1cd02a&&_0x1cd02a[_0x0e01('0xd3')]){var _0x242f66=_0x1cd02a[_0x0e01('0xd4')]({'plain':!![]});fs['mkdirSync'](_0x29cb1d);for(var _0x41e13c=0x0;_0x41e13c<_0x242f66[_0x0e01('0xd3')][_0x0e01('0x65')];_0x41e13c++){var _0x123e4b=_0x242f66[_0x0e01('0xd3')][_0x41e13c]['Attachment'];if(_0x123e4b){var _0x2ef404=path[_0x0e01('0xce')](_0x19b5b3,_0x123e4b[_0x0e01('0xd5')]);if(fs[_0x0e01('0xd6')](_0x2ef404)){fs[_0x0e01('0xd7')](_0x2ef404)['pipe'](fs[_0x0e01('0xd8')](path[_0x0e01('0xce')](_0x29cb1d,_0x123e4b[_0x0e01('0xd5')])));}}}return BPromise['resolve']()[_0x0e01('0x27')](function(){return new BPromise(function(_0x1a51af,_0x59a2ec){zipdir(_0x29cb1d,{'saveTo':_0xf5f57e},function(_0x574a2f,_0x5af803){if(_0x574a2f)return _0x59a2ec(_0x574a2f);return _0x1a51af(_0x5af803);});})['then'](function(){return new BPromise(function(_0x2af9d3,_0x38adfe){rimraf(_0x29cb1d,function(_0x595199){if(_0x595199)_0x38adfe(_0x595199);return _0x2af9d3();});});})['then'](function(){return _0xdb4ee['download'](_0xf5f57e,_0x416c21,function(_0x310f92){if(_0x310f92){console['log'](_0x0e01('0xd9'),_0x310f92);}else{fs[_0x0e01('0xda')](_0xf5f57e);}});});});}else{return _0xdb4ee[_0x0e01('0x19')](0xc8);}})[_0x0e01('0x32')](handleError(_0xdb4ee,null));};
\ No newline at end of file
+var _0x9708=['operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','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','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','user','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','catch','params','includeAll','include','options','create','update','describe','addMessage','FaxMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','faxInteractionTags:save','removeTags','unix','root','files','tmp','join','server','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','download','log','err','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','map','fullname','TagIds','Tags','split','push','waiting','answered','unmanaged','total','UserId','closed','talking','FaxInteraction','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','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','expr','parseSearch','search','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact'];(function(_0x377af8,_0x26b451){var _0x497df2=function(_0x4e5023){while(--_0x4e5023){_0x377af8['push'](_0x377af8['shift']());}};_0x497df2(++_0x26b451);}(_0x9708,0x15a));var _0x8970=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0x9708[_0xf55e73];return _0x116b99;};'use strict';var emlformat=require(_0x8970('0x0'));var rimraf=require(_0x8970('0x1'));var zipdir=require(_0x8970('0x2'));var jsonpatch=require(_0x8970('0x3'));var rp=require('request-promise');var moment=require(_0x8970('0x4'));var BPromise=require(_0x8970('0x5'));var Mustache=require(_0x8970('0x6'));var util=require(_0x8970('0x7'));var path=require(_0x8970('0x8'));var sox=require(_0x8970('0x9'));var csv=require(_0x8970('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8970('0xb'));var _=require(_0x8970('0xc'));var squel=require(_0x8970('0xd'));var crypto=require(_0x8970('0xe'));var jsforce=require(_0x8970('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8970('0xa'));var querystring=require(_0x8970('0x10'));var Papa=require(_0x8970('0x11'));var Redis=require('ioredis');var authService=require(_0x8970('0x12'));var qs=require(_0x8970('0x13'));var as=require(_0x8970('0x14'));var hardwareService=require(_0x8970('0x15'));var logger=require(_0x8970('0x16'))(_0x8970('0x17'));var utils=require('../../config/utils');var config=require(_0x8970('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8970('0x19')]=_[_0x8970('0x1a')](config[_0x8970('0x19')],{'host':_0x8970('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8970('0x19')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x43d0f3,_0x470f89){_0x470f89=_0x470f89||0xcc;return function(_0x3b1f44){if(_0x3b1f44){return _0x43d0f3['sendStatus'](_0x470f89);}return _0x43d0f3[_0x8970('0x1c')](_0x470f89)[_0x8970('0x1d')]();};}function respondWithResult(_0x1d39d0,_0x33b450){_0x33b450=_0x33b450||0xc8;return function(_0x50b410){if(_0x50b410){return _0x1d39d0[_0x8970('0x1c')](_0x33b450)[_0x8970('0x1e')](_0x50b410);}};}function respondWithFilteredResult(_0x567ff4,_0x52d0ee){return function(_0x258507){if(_0x258507){var _0x2b27d1=typeof _0x52d0ee[_0x8970('0x1f')]===_0x8970('0x20')&&typeof _0x52d0ee[_0x8970('0x21')]==='undefined';var _0x9e9437=_0x258507[_0x8970('0x22')];var _0x1a94b9=_0x2b27d1?0x0:_0x52d0ee[_0x8970('0x1f')];var _0x283548=_0x2b27d1?_0x258507[_0x8970('0x22')]:_0x52d0ee[_0x8970('0x1f')]+_0x52d0ee[_0x8970('0x21')];var _0x577d88;if(_0x283548>=_0x9e9437){_0x283548=_0x9e9437;_0x577d88=0xc8;}else{_0x577d88=0xce;}_0x567ff4[_0x8970('0x1c')](_0x577d88);return _0x567ff4['set'](_0x8970('0x23'),_0x1a94b9+'-'+_0x283548+'/'+_0x9e9437)[_0x8970('0x1e')](_0x258507);}return null;};}function patchUpdates(_0x2f07f5){return function(_0xb5907b){try{jsonpatch[_0x8970('0x24')](_0xb5907b,_0x2f07f5,!![]);}catch(_0x4c18d4){return BPromise[_0x8970('0x25')](_0x4c18d4);}return _0xb5907b[_0x8970('0x26')]();};}function saveUpdates(_0x24fd02,_0x3f88f9){return function(_0x3cb2c1){if(_0x3cb2c1){return _0x3cb2c1['update'](_0x24fd02)[_0x8970('0x27')](function(_0x58451e){return _0x58451e;});}return null;};}function removeEntity(_0x5143ec,_0x1bedaa){return function(_0x18aaef){if(_0x18aaef){return _0x18aaef[_0x8970('0x28')]()[_0x8970('0x27')](function(){_0x5143ec['status'](0xcc)[_0x8970('0x1d')]();});}};}function handleEntityNotFound(_0xf324bd,_0x3bc4bc){return function(_0x5e6384){if(!_0x5e6384){_0xf324bd['sendStatus'](0x194);}return _0x5e6384;};}function handleError(_0x1167c9,_0x509c70){_0x509c70=_0x509c70||0x1f4;return function(_0x959f51){logger['error'](_0x959f51['stack']);if(_0x959f51[_0x8970('0x29')]){delete _0x959f51[_0x8970('0x29')];}_0x1167c9[_0x8970('0x1c')](_0x509c70)['send'](_0x959f51);};}function getInteractionUsers(_0x52016b,_0x2e1003){return new BPromise(function(_0x46a4d6,_0x19963d){try{if(_0x2e1003[_0x52016b['id']]){_0x52016b['Users']=_[_0x8970('0x2a')](_0x2e1003[_0x52016b['id']],function(_0x124535){return{'id':_0x124535['id'],'fullname':_0x124535[_0x8970('0x2b')]};});}}catch(_0x23a008){_0x19963d(_0x23a008);}_0x46a4d6(_0x52016b);});}function getInteractionTags(_0x49b424,_0x51e9f8){return new BPromise(function(_0x1fc857,_0x44d151){try{if(_0x49b424[_0x8970('0x2c')]){_0x49b424[_0x8970('0x2d')]=[];_0x49b424[_0x8970('0x2c')][_0x8970('0x2e')](',')['forEach'](function(_0x738781){_0x49b424[_0x8970('0x2d')][_0x8970('0x2f')](_0x51e9f8[_0x738781]);});}delete _0x49b424[_0x8970('0x2c')];}catch(_0x52b14b){_0x44d151(_0x52b14b);}_0x1fc857(_0x49b424);});}function updateFaxInteraction(_0x585fae,_0x4795df,_0x514f4b){return new BPromise(function(_0x3ea506,_0x3c0ace){return getInteractionUsers(_0x585fae,_0x514f4b)[_0x8970('0x27')](function(_0xcc0b6f){return getInteractionTags(_0xcc0b6f,_0x4795df);})[_0x8970('0x27')](function(_0x563f8d){return getStateInteraction(_0x563f8d);})[_0x8970('0x27')](function(_0x322fa3){_0x3ea506(_0x322fa3);})['catch'](function(_0x5ca7c8){_0x3c0ace(_0x5ca7c8);});});}function getStateInteraction(_0x49072f){return new BPromise(function(_0x1ab224){_0x49072f[_0x8970('0x30')]=0x0;_0x49072f['talking']=0x0;_0x49072f[_0x8970('0x31')]=0x0;_0x49072f[_0x8970('0x32')]=0x0;_0x49072f[_0x8970('0x33')]=0x0;if(!_0x49072f['closed']&&!_0x49072f[_0x8970('0x34')]){_0x49072f[_0x8970('0x30')]+=0x1;}if(!_0x49072f[_0x8970('0x35')]&&_0x49072f[_0x8970('0x34')]){_0x49072f[_0x8970('0x36')]+=0x1;if(_0x49072f[_0x8970('0x30')]){_0x49072f[_0x8970('0x30')]-=0x1;}}if(_0x49072f[_0x8970('0x35')]&&_0x49072f[_0x8970('0x34')]){_0x49072f[_0x8970('0x31')]+=0x1;if(_0x49072f[_0x8970('0x36')]){_0x49072f[_0x8970('0x36')]-=0x1;}}if(_0x49072f[_0x8970('0x35')]&&!_0x49072f[_0x8970('0x34')]){_0x49072f[_0x8970('0x32')]+=0x1;if(_0x49072f[_0x8970('0x30')]){_0x49072f['waiting']-=0x1;}}_0x49072f[_0x8970('0x33')]+=0x1;_0x1ab224(_0x49072f);});}exports['index']=function(_0x1beb12,_0x3fc2a5){var _0x3fbd0c={},_0x2e7a99={},_0x15257b={'count':0x0,'rows':[]};var _0x47bd23=_['map'](db[_0x8970('0x37')][_0x8970('0x38')],function(_0xa6e721){return{'name':_0xa6e721['fieldName'],'type':_0xa6e721[_0x8970('0x39')]['key']};});_0x2e7a99[_0x8970('0x3a')]=_['map'](_0x47bd23,'name');_0x2e7a99['query']=_[_0x8970('0x3b')](_0x1beb12[_0x8970('0x3c')]);_0x2e7a99[_0x8970('0x3d')]=_[_0x8970('0x3e')](_0x2e7a99[_0x8970('0x3a')],_0x2e7a99['query']);_0x3fbd0c[_0x8970('0x3f')]=_[_0x8970('0x3e')](_0x2e7a99[_0x8970('0x3a')],qs[_0x8970('0x40')](_0x1beb12[_0x8970('0x3c')][_0x8970('0x40')]));_0x3fbd0c[_0x8970('0x3f')]=_0x3fbd0c[_0x8970('0x3f')][_0x8970('0x41')]?_0x3fbd0c[_0x8970('0x3f')]:_0x2e7a99[_0x8970('0x3a')];if(!_0x1beb12[_0x8970('0x3c')][_0x8970('0x42')](_0x8970('0x43'))){_0x3fbd0c[_0x8970('0x21')]=qs[_0x8970('0x21')](_0x1beb12[_0x8970('0x3c')][_0x8970('0x21')]);_0x3fbd0c[_0x8970('0x1f')]=qs[_0x8970('0x1f')](_0x1beb12['query'][_0x8970('0x1f')]);}_0x3fbd0c[_0x8970('0x44')]=qs[_0x8970('0x45')](_0x1beb12[_0x8970('0x3c')][_0x8970('0x45')]);_0x3fbd0c[_0x8970('0x46')]=qs[_0x8970('0x3d')](_[_0x8970('0x47')](_0x1beb12[_0x8970('0x3c')],_0x2e7a99[_0x8970('0x3d')]),_0x47bd23);var _0x51f42a=[];var _0x16e3f9=squel['select']()[_0x8970('0x48')]('id')['field'](_0x8970('0x29'))['field'](_0x8970('0x49'))[_0x8970('0x4a')](_0x8970('0x4b'));var _0x345ce7=squel[_0x8970('0x4c')]()[_0x8970('0x48')](_0x8970('0x4d'))['field'](_0x8970('0x4e'))[_0x8970('0x48')](_0x8970('0x4f'))[_0x8970('0x4a')](_0x8970('0x50'),'ui')[_0x8970('0x51')]('users','u',_0x8970('0x52'));var _0xe87a7a=squel[_0x8970('0x4c')]()[_0x8970('0x4a')](_0x8970('0x53'),'i')[_0x8970('0x51')](_0x8970('0x54'),'c',_0x8970('0x55'))[_0x8970('0x51')](_0x8970('0x56'),'o',_0x8970('0x57'))['left_join'](_0x8970('0x58'),'a',_0x8970('0x59'))[_0x8970('0x51')]('fax_messages','me',_0x8970('0x5a'))['left_join'](_0x8970('0x5b'),'it',_0x8970('0x5c'))[_0x8970('0x51')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x41870b=squel['expr']();var _0x5ce498=[];var _0x348044=squel[_0x8970('0x5d')]();var _0x9bec0a;if(_0x1beb12[_0x8970('0x3c')]['search']){_0x9bec0a=as[_0x8970('0x5e')](_0x1beb12[_0x8970('0x3c')][_0x8970('0x5f')]);var _0xa222a4=_0x9bec0a['sqlOperator'];for(var _0x274933=0x0;_0x274933<_0x9bec0a[_0x8970('0x60')][_0x8970('0x41')];_0x274933++){var _0x1118de=_0x9bec0a[_0x8970('0x60')][_0x274933];var _0x378da8='i';var _0x4364e0=_['find'](_0x47bd23,[_0x8970('0x29'),_0x1118de[_0x8970('0x48')]]);if(!_0x4364e0){switch(_0x1118de[_0x8970('0x48')]){case _0x8970('0x61'):if(_0x1118de['value']==0x1){_0xe87a7a[_0x8970('0x62')]('`'+_0x1118de[_0x8970('0x48')]+_0x8970('0x63'));}else{_0xe87a7a[_0x8970('0x62')]('`'+_0x1118de['field']+_0x8970('0x64'));}break;case _0x8970('0x65'):if(_0x1118de[_0x8970('0x66')]===_0x8970('0x67')){if(_0x1118de[_0x8970('0x68')][_0x8970('0x2e')]('\x20')[_0x8970('0x41')]>0x1){_0x41870b[_0xa222a4](_0x8970('0x69'),qs['getFullTextValue'](_0x1118de['value']),null);}else{var _0x528572='%'+_0x1118de[_0x8970('0x68')]+'%';_0x41870b[_0xa222a4](_0x8970('0x6a'),_0x528572,_0x528572,_0x528572);}}else{_0x4364e0=_[_0x8970('0x6b')](_0x47bd23,['name',_0x8970('0x6c')]);_0x1118de['field']=_0x8970('0x6c');_0x451fe6=as['buildExpression'](_0x378da8,_0x4364e0['type'],_0x1118de);_0x41870b[_0xa222a4](_0x451fe6[_0x8970('0x6d')],_0x451fe6[_0x8970('0x68')][_0x8970('0x6e')],_0x451fe6[_0x8970('0x68')]['end']);}break;case _0x8970('0x6f'):var _0x16bf38=_0x1118de[_0x8970('0x68')][_0x8970('0x2e')](',')[_0x8970('0x2a')](function(_0x139c88){return Number(_0x139c88);});_0x16bf38[_0x8970('0x70')](function(_0x5b2a39){_0x348044['or'](_0x8970('0x71'),'%,'+_0x5b2a39+',%');});_0x5ce498=_[_0x8970('0x72')](_0x5ce498,_0x16bf38);break;case _0x8970('0x73'):if(_0x1118de[_0x8970('0x66')]==='$substring'){_0x41870b[_0xa222a4](_0x8970('0x74'),'%'+_0x1118de[_0x8970('0x68')]+'%',null);}else{_0x4364e0=_['find'](_0x47bd23,[_0x8970('0x29'),_0x8970('0x34')]);_0x1118de[_0x8970('0x48')]=_0x8970('0x34');_0x451fe6=as[_0x8970('0x75')](_0x378da8,_0x4364e0[_0x8970('0x39')],_0x1118de);_0x41870b[_0xa222a4](_0x451fe6[_0x8970('0x6d')],_0x451fe6[_0x8970('0x68')][_0x8970('0x6e')],_0x451fe6['value'][_0x8970('0x1d')]);}break;case _0x8970('0x76'):_0x451fe6=as[_0x8970('0x75')]('me',null,_0x1118de);_0x41870b[_0xa222a4](_0x451fe6[_0x8970('0x6d')],_0x451fe6[_0x8970('0x68')]['start'],_0x451fe6[_0x8970('0x68')][_0x8970('0x1d')]);break;}}else{var _0x451fe6=as[_0x8970('0x75')](_0x378da8,_0x4364e0[_0x8970('0x39')],_0x1118de);_0x41870b[_0xa222a4](_0x451fe6[_0x8970('0x6d')],_0x451fe6[_0x8970('0x68')]['start'],_0x451fe6['value']['end']);}}}else{var _0x2e6cbf=_(_0x1beb12['query'])[_0x8970('0x3b')]()['map'](function(_0x278a4f){return _[_0x8970('0x77')](_0x47bd23,[_0x8970('0x29'),_0x278a4f])?_0x278a4f:undefined;})[_0x8970('0x78')]()[_0x8970('0x68')]();if(!_[_0x8970('0x79')](_0x2e6cbf)){_0x2e6cbf['forEach'](function(_0xd552b2){if(_0xd552b2==='FaxAccountId'){_0xe87a7a[_0x8970('0x46')](_0x8970('0x7a'),[]['concat'](_0x1beb12[_0x8970('0x3c')][_0xd552b2]));}else if(_0xd552b2===_0x8970('0x7b')){var _0x5d1929=JSON[_0x8970('0x7c')](_0x1beb12[_0x8970('0x3c')][_0xd552b2])[_0x8970('0x7d')];var _0x2f41ff=JSON[_0x8970('0x7c')](_0x1beb12[_0x8970('0x3c')][_0xd552b2])[_0x8970('0x7e')];_0xe87a7a[_0x8970('0x46')](_0x8970('0x7f'),_0x5d1929,_0x2f41ff);}else{if(_0x1beb12['query'][_0xd552b2]===_0x8970('0x80')){_0xe87a7a[_0x8970('0x46')]('i.'+_0xd552b2+'\x20IS\x20NULL');}else{_0xe87a7a[_0x8970('0x46')]('i.'+_0xd552b2+_0x8970('0x81'),_0x1beb12['query'][_0xd552b2]);}}});}if(_0x1beb12[_0x8970('0x3c')][_0x8970('0x82')]){if(_0x1beb12[_0x8970('0x3c')][_0x8970('0x82')]==0x1){_0xe87a7a[_0x8970('0x62')](_0x8970('0x83'));}else{_0xe87a7a[_0x8970('0x62')](_0x8970('0x84'));}}if(_0x1beb12[_0x8970('0x3c')][_0x8970('0x85')]){_0x5ce498=_[_0x8970('0x86')](_0x1beb12[_0x8970('0x3c')]['tag'])?_0x1beb12[_0x8970('0x3c')][_0x8970('0x85')]:new Array(_0x1beb12[_0x8970('0x3c')][_0x8970('0x85')]);_0x5ce498['forEach'](function(_0x3dd31a){_0x348044['or'](_0x8970('0x71'),'%,'+_0x3dd31a+',%');});}if(_0x1beb12[_0x8970('0x3c')][_0x8970('0x87')]){var _0x104e66=_0x1beb12['query'][_0x8970('0x87')][_0x8970('0x88')]('\x5c','\x5c\x5c')[_0x8970('0x88')](/'/g,'\x27\x27');if(qs[_0x8970('0x89')](_0x104e66)){_0x41870b['or'](_0x8970('0x8a'),_0x104e66+'%')['or'](_0x8970('0x8b'),_0x104e66+'%');}_0x41870b['or'](_0x8970('0x8c'),_0x104e66+'%');}}_0xe87a7a['where'](_0x41870b);_0xe87a7a[_0x8970('0x8d')](_0x8970('0x8e'));var _0x83e4f={'type':db[_0x8970('0x8f')]['QueryTypes'][_0x8970('0x90')],'raw':!![]};var _0x587c6a=_0xe87a7a['clone']();_0x587c6a[_0x8970('0x48')](_0x8970('0x8e'));_0x587c6a[_0x8970('0x48')](_0x8970('0x91'),_0x8970('0x61'));if(_0x3fbd0c[_0x8970('0x44')]){_0x3fbd0c[_0x8970('0x44')]['forEach'](function(_0xc8ee23){var _0x430d57=_0xc8ee23[0x0]===_0x8970('0x92')?_0xc8ee23[0x0]:'i.'+_0xc8ee23[0x0];_0xe87a7a['order'](_0x430d57,_0xc8ee23[0x1]===_0x8970('0x93')?![]:!![]);});}if(!_[_0x8970('0x79')](_0x5ce498)){_0xe87a7a[_0x8970('0x62')](_0x348044);_0x587c6a['where'](_0x8970('0x94'),_0x5ce498);}BPromise[_0x8970('0x95')]()['then'](function(){if(!_0x9bec0a){if(_0x1beb12[_0x8970('0x3c')][_0x8970('0x96')])return;_0x587c6a[_0x8970('0x46')](_0x8970('0x97'));_0xe87a7a[_0x8970('0x46')](_0x8970('0x97'));return;}if(_0x1beb12['user'][_0x8970('0x98')]!==_0x8970('0x99'))return;return _0x1beb12['user'][_0x8970('0x9a')]({'attributes':['id'],'raw':!![]})[_0x8970('0x27')](function(_0x2bf763){if(_[_0x8970('0x79')](_0x2bf763)){_0x587c6a[_0x8970('0x46')](_0x8970('0x9b'));_0xe87a7a['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x587c6a[_0x8970('0x46')](_0x8970('0x7a'),_[_0x8970('0x2a')](_0x2bf763,'id'));_0xe87a7a['where'](_0x8970('0x7a'),_[_0x8970('0x2a')](_0x2bf763,'id'));}});})[_0x8970('0x27')](function(){if(_0x1beb12[_0x8970('0x9c')][_0x8970('0x98')]==='agent'&&!_0x9bec0a&&!_0x1beb12[_0x8970('0x3c')][_0x8970('0x96')])return[];return db[_0x8970('0x9d')][_0x8970('0x3c')](_0x587c6a['toString'](),_0x83e4f);})['then'](function(_0x3a5b54){_0x15257b[_0x8970('0x22')]=_0x3a5b54[_0x8970('0x41')];if(_0x15257b[_0x8970('0x22')]===0x0)return[];return db['sequelize']['query'](_0x16e3f9[_0x8970('0x9e')](),_0x83e4f)['then'](function(_0x1e57d1){_0x51f42a=_[_0x8970('0x9f')](_0x1e57d1,'id');_0x83e4f=_[_0x8970('0xa0')](_0x83e4f,{'model':db[_0x8970('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1beb12[_0x8970('0x3c')][_0x8970('0x40')]){_0x3fbd0c[_0x8970('0x3f')][_0x8970('0x70')](function(_0x4bb6e5){_0xe87a7a[_0x8970('0x48')]('i.'+_0x4bb6e5);});}else{_0xe87a7a[_0x8970('0x48')](_0x8970('0x91'),_0x8970('0x61'));_0xe87a7a[_0x8970('0x48')](_0x8970('0xa1'),'Account.key');_0xe87a7a['field'](_0x8970('0xa2'),'Account.mandatoryDisposition');_0xe87a7a['field'](_0x8970('0xa3'),_0x8970('0x92'));_0xe87a7a[_0x8970('0x48')](_0x8970('0xa4'));_0xe87a7a[_0x8970('0x48')](_0x8970('0xa5'),_0x8970('0xa6'));_0xe87a7a[_0x8970('0x48')]('c.lastName',_0x8970('0xa7'));_0xe87a7a[_0x8970('0x48')](_0x8970('0xa8'),_0x8970('0xa9'));_0xe87a7a[_0x8970('0x48')](_0x8970('0xaa'),_0x8970('0xab'));_0xe87a7a[_0x8970('0x48')](_0x8970('0xac'),_0x8970('0xad'));_0xe87a7a[_0x8970('0x48')](_0x8970('0xae'),_0x8970('0xaf'));_0xe87a7a[_0x8970('0x48')](_0x8970('0xb0'),'Owner.fullname');_0xe87a7a[_0x8970('0x48')](_0x8970('0xb1'),'Owner.internal');_0xe87a7a[_0x8970('0x48')](_0x8970('0xb2'),_0x8970('0x2c'));}if(_0x3fbd0c[_0x8970('0x21')])_0xe87a7a['limit'](_0x3fbd0c[_0x8970('0x21')]);if(_0x3fbd0c['offset'])_0xe87a7a[_0x8970('0x1f')](_0x3fbd0c[_0x8970('0x1f')]);return db[_0x8970('0x9d')][_0x8970('0x3c')](_0xe87a7a[_0x8970('0x9e')](),_0x83e4f);})[_0x8970('0x27')](function(_0x56fd29){if(_0x56fd29[_0x8970('0x41')]>0x0)_0x345ce7[_0x8970('0x46')](_0x8970('0xb3'),_[_0x8970('0x2a')](_0x56fd29,'id'));return db['sequelize'][_0x8970('0x3c')](_0x345ce7[_0x8970('0x9e')](),_0x83e4f)['then'](function(_0x1766c9){var _0x3d2224=_['groupBy'](_0x1766c9,_0x8970('0xb4'));var _0x243aa2=[];_0x56fd29['forEach'](function(_0x15b9a2){_0x243aa2[_0x8970('0x2f')](updateFaxInteraction(_0x15b9a2,_0x51f42a,_0x3d2224));});return BPromise[_0x8970('0xb5')](_0x243aa2);});});})[_0x8970('0x27')](function(_0x33448e){_0x15257b[_0x8970('0xb6')]=_0x33448e;return _0x15257b;})[_0x8970('0x27')](respondWithFilteredResult(_0x3fc2a5,_0x3fbd0c))[_0x8970('0xb7')](handleError(_0x3fc2a5,null));};exports['show']=function(_0x14afa0,_0x49175f){var _0x2fe08b={'raw':![],'where':{'id':_0x14afa0[_0x8970('0xb8')]['id']}},_0x594f26={};_0x594f26['model']=_[_0x8970('0x3b')](db[_0x8970('0x37')][_0x8970('0x38')]);_0x594f26[_0x8970('0x3c')]=_['keys'](_0x14afa0[_0x8970('0x3c')]);_0x594f26[_0x8970('0x3d')]=_[_0x8970('0x3e')](_0x594f26[_0x8970('0x3a')],_0x594f26['query']);_0x2fe08b[_0x8970('0x3f')]=_[_0x8970('0x3e')](_0x594f26[_0x8970('0x3a')],qs[_0x8970('0x40')](_0x14afa0[_0x8970('0x3c')][_0x8970('0x40')]));_0x2fe08b[_0x8970('0x3f')]=_0x2fe08b['attributes']['length']?_0x2fe08b['attributes']:_0x594f26['model'];if(_0x14afa0['query'][_0x8970('0xb9')]){_0x2fe08b[_0x8970('0xba')]=[{'all':!![]}];}_0x2fe08b=_[_0x8970('0xa0')]({},_0x2fe08b,_0x14afa0[_0x8970('0xbb')]);return db[_0x8970('0x37')][_0x8970('0x6b')](_0x2fe08b)['then'](handleEntityNotFound(_0x49175f,null))[_0x8970('0x27')](respondWithResult(_0x49175f,null))[_0x8970('0xb7')](handleError(_0x49175f,null));};exports[_0x8970('0xbc')]=function(_0x98657b,_0x33bfa7){return db['FaxInteraction'][_0x8970('0xbc')](_0x98657b['body'],{})[_0x8970('0x27')](respondWithResult(_0x33bfa7,0xc9))[_0x8970('0xb7')](handleError(_0x33bfa7,null));};exports[_0x8970('0xbd')]=function(_0x2923d8,_0x3ff848){if(_0x2923d8[_0x8970('0x76')]['id']){delete _0x2923d8[_0x8970('0x76')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x2923d8[_0x8970('0xb8')]['id']}})[_0x8970('0x27')](handleEntityNotFound(_0x3ff848,null))[_0x8970('0x27')](saveUpdates(_0x2923d8[_0x8970('0x76')],null))[_0x8970('0x27')](respondWithResult(_0x3ff848,null))[_0x8970('0xb7')](handleError(_0x3ff848,null));};exports[_0x8970('0x28')]=function(_0x183444,_0x460dc3){return db[_0x8970('0x37')][_0x8970('0x6b')]({'where':{'id':_0x183444[_0x8970('0xb8')]['id']}})['then'](handleEntityNotFound(_0x460dc3,null))[_0x8970('0x27')](removeEntity(_0x460dc3,null))[_0x8970('0xb7')](handleError(_0x460dc3,null));};exports['describe']=function(_0xba0fb2,_0x904229){return db[_0x8970('0x37')][_0x8970('0xbe')]()[_0x8970('0x27')](respondWithResult(_0x904229,null))[_0x8970('0xb7')](handleError(_0x904229,null));};exports[_0x8970('0xbf')]=function(_0x29e812,_0x45af91,_0x387dc5){return db[_0x8970('0xc0')]['find']({'where':{'id':_0x29e812[_0x8970('0xb8')]['id']}})[_0x8970('0x27')](handleEntityNotFound(_0x45af91,null))['then'](function(_0x3dccf5){if(_0x3dccf5){return _0x3dccf5['addMessage'](_0x29e812[_0x8970('0x76')][_0x8970('0xc1')],_[_0x8970('0xc2')](_0x29e812['body'],[_0x8970('0xc1'),'id'])||{});}})[_0x8970('0x27')](respondWithResult(_0x45af91,null))[_0x8970('0xb7')](handleError(_0x45af91,null));};exports[_0x8970('0xc3')]=function(_0x30f18b,_0x4d9cc4,_0x36cd54){var _0x4f1ab6={'raw':![],'where':{}};var _0x50f1bc={};var _0x343ee7={'count':0x0,'rows':[]};return db[_0x8970('0x37')]['findOne']({'where':{'id':_0x30f18b[_0x8970('0xb8')]['id']}})[_0x8970('0x27')](handleEntityNotFound(_0x4d9cc4,null))[_0x8970('0x27')](function(_0x19c3ec){if(_0x19c3ec){_0x50f1bc[_0x8970('0x3a')]=_['keys'](db['FaxMessage'][_0x8970('0x38')]);_0x50f1bc[_0x8970('0x3c')]=_[_0x8970('0x3b')](_0x30f18b['query']);_0x50f1bc[_0x8970('0x3d')]=_[_0x8970('0x3e')](_0x50f1bc['model'],_0x50f1bc['query']);_0x4f1ab6[_0x8970('0x3f')]=_['intersection'](_0x50f1bc[_0x8970('0x3a')],qs[_0x8970('0x40')](_0x30f18b[_0x8970('0x3c')][_0x8970('0x40')]));_0x4f1ab6[_0x8970('0x3f')]=_0x4f1ab6['attributes']['length']?_0x4f1ab6[_0x8970('0x3f')]:_0x50f1bc['model'];if(!_0x30f18b['query'][_0x8970('0x42')](_0x8970('0x43'))){_0x4f1ab6[_0x8970('0x21')]=qs[_0x8970('0x21')](_0x30f18b['query'][_0x8970('0x21')]);_0x4f1ab6['offset']=qs[_0x8970('0x1f')](_0x30f18b['query'][_0x8970('0x1f')]);}_0x4f1ab6[_0x8970('0x44')]=qs[_0x8970('0x45')](_0x30f18b[_0x8970('0x3c')][_0x8970('0x45')]);_0x4f1ab6[_0x8970('0x46')]=qs[_0x8970('0x3d')](_[_0x8970('0x47')](_0x30f18b[_0x8970('0x3c')],_0x50f1bc[_0x8970('0x3d')]));_0x4f1ab6['where'][_0x8970('0xb4')]=_0x19c3ec['id'];if(_0x30f18b[_0x8970('0x3c')][_0x8970('0x87')]){_0x4f1ab6[_0x8970('0x46')]=_[_0x8970('0xa0')](_0x4f1ab6['where'],{'$or':_[_0x8970('0x2a')](_0x4f1ab6[_0x8970('0x3f')],function(_0x23db89){var _0x57915a={};_0x57915a[_0x23db89]={'$like':'%'+_0x30f18b['query']['filter']+'%'};return _0x57915a;})});}if(_0x30f18b[_0x8970('0x3c')][_0x8970('0x7d')]){var _0x5c106c=_0x30f18b[_0x8970('0x3c')][_0x8970('0x7d')][_0x8970('0x2e')](',');var _0x3b9d0b={};_0x3b9d0b[_0x5c106c[0x0]]={'$gte':moment(_0x5c106c[0x1])[_0x8970('0xc4')](_0x8970('0xc5'))};_0x4f1ab6[_0x8970('0x46')]=_[_0x8970('0xa0')](_0x4f1ab6[_0x8970('0x46')],_0x3b9d0b);}_0x4f1ab6=_[_0x8970('0xa0')]({},_0x4f1ab6,_0x30f18b[_0x8970('0xbb')]);return db[_0x8970('0xc0')]['count']({'where':_0x4f1ab6['where']})['then'](function(_0x592b2f){_0x343ee7[_0x8970('0x22')]=_0x592b2f;if(_0x30f18b[_0x8970('0x3c')][_0x8970('0xb9')]){_0x4f1ab6[_0x8970('0xba')]=[{'all':!![]}];}return db[_0x8970('0xc0')][_0x8970('0xc6')](_0x4f1ab6);})[_0x8970('0x27')](function(_0x5bd2b4){_0x343ee7[_0x8970('0xb6')]=_0x5bd2b4;return _0x343ee7;});}})[_0x8970('0x27')](respondWithFilteredResult(_0x4d9cc4,_0x4f1ab6))[_0x8970('0xb7')](handleError(_0x4d9cc4,null));};exports[_0x8970('0xc7')]=function(_0x21b115,_0x183d74,_0x4eb908){return db[_0x8970('0x37')][_0x8970('0x6b')]({'where':{'id':_0x21b115[_0x8970('0xb8')]['id']}})[_0x8970('0x27')](handleEntityNotFound(_0x183d74,null))[_0x8970('0x27')](function(_0x1666b2){if(_0x1666b2){return _0x1666b2[_0x8970('0xc8')](_0x21b115[_0x8970('0x76')][_0x8970('0xc1')],_['omit'](_0x21b115[_0x8970('0x76')],[_0x8970('0xc1'),'id'])||{})[_0x8970('0xc9')](function(){return db['Tag']['findAll']({'attributes':['id',_0x8970('0x29'),'color'],'where':{'id':_0x21b115[_0x8970('0x76')]['ids']}});})[_0x8970('0x27')](function(_0x534f43){socket['emit'](_0x8970('0xca'),{'id':Number(_0x21b115[_0x8970('0xb8')]['id']),'tags':_0x534f43||[]});return{'id':Number(_0x21b115[_0x8970('0xb8')]['id']),'tags':_0x534f43||[]};});}})[_0x8970('0x27')](respondWithResult(_0x183d74,null))[_0x8970('0xb7')](handleError(_0x183d74,null));};exports['removeTags']=function(_0x4b2e23,_0x39f568,_0x3c0690){return db[_0x8970('0x37')][_0x8970('0x6b')]({'where':{'id':_0x4b2e23['params']['id']}})[_0x8970('0x27')](handleEntityNotFound(_0x39f568,null))['then'](function(_0x1d6e65){if(_0x1d6e65){return _0x1d6e65[_0x8970('0xcb')](_0x4b2e23[_0x8970('0x3c')][_0x8970('0xc1')]);}})[_0x8970('0x27')](respondWithStatusCode(_0x39f568,null))[_0x8970('0xb7')](handleError(_0x39f568,null));};exports['download']=function(_0x20d529,_0x25255a){var _0x5cd0e0=moment()[_0x8970('0xcc')]()[_0x8970('0x9e')]();var _0x2ca682=path['join'](config[_0x8970('0xcd')],'server',_0x8970('0xce'),_0x8970('0xcf'));var _0x374c3f=path[_0x8970('0xd0')](config[_0x8970('0xcd')],_0x8970('0xd1'),_0x8970('0xce'),'attachments');var _0x427bae=path['join'](_0x2ca682,_0x5cd0e0);var _0x1f1935=util[_0x8970('0xc4')](_0x8970('0xd2'),_0x20d529[_0x8970('0xb8')]['id'],_0x5cd0e0);var _0x1fd922=path[_0x8970('0xd0')](_0x2ca682,_0x1f1935);var _0x42d238=[];_0x42d238[_0x8970('0x2f')]({'model':db[_0x8970('0xd3')],'as':_0x8970('0xd3'),'raw':!![]});var _0x4edc7f=[{'model':db[_0x8970('0xc0')],'as':_0x8970('0xd4'),'attributes':['id',_0x8970('0x76'),_0x8970('0x7b')],'include':_0x42d238}];return db['FaxInteraction'][_0x8970('0x6b')]({'where':{'id':_0x20d529[_0x8970('0xb8')]['id']},'include':_0x4edc7f})[_0x8970('0x27')](handleEntityNotFound(_0x25255a,null))[_0x8970('0x27')](function(_0x14a13f){if(_0x14a13f&&_0x14a13f[_0x8970('0xd4')]){var _0x2b8a07=_0x14a13f[_0x8970('0xd5')]({'plain':!![]});fs[_0x8970('0xd6')](_0x427bae);for(var _0x1240bd=0x0;_0x1240bd<_0x2b8a07[_0x8970('0xd4')][_0x8970('0x41')];_0x1240bd++){var _0x2942de=_0x2b8a07['Messages'][_0x1240bd][_0x8970('0xd3')];if(_0x2942de){var _0x154100=path['join'](_0x374c3f,_0x2942de[_0x8970('0xd7')]);if(fs[_0x8970('0xd8')](_0x154100)){fs[_0x8970('0xd9')](_0x154100)[_0x8970('0xda')](fs[_0x8970('0xdb')](path['join'](_0x427bae,_0x2942de[_0x8970('0xd7')])));}}}return BPromise['resolve']()[_0x8970('0x27')](function(){return new BPromise(function(_0x263eb0,_0x1c8900){zipdir(_0x427bae,{'saveTo':_0x1fd922},function(_0x2d3d37,_0x121627){if(_0x2d3d37)return _0x1c8900(_0x2d3d37);return _0x263eb0(_0x121627);});})[_0x8970('0x27')](function(){return new BPromise(function(_0x1e8d52,_0x19e5fa){rimraf(_0x427bae,function(_0x3478ed){if(_0x3478ed)_0x19e5fa(_0x3478ed);return _0x1e8d52();});});})[_0x8970('0x27')](function(){return _0x25255a[_0x8970('0xdc')](_0x1fd922,_0x1f1935,function(_0x130cb6){if(_0x130cb6){console[_0x8970('0xdd')](_0x8970('0xde'),_0x130cb6);}else{fs['unlinkSync'](_0x1fd922);}});});});}else{return _0x25255a[_0x8970('0xdf')](0xc8);}})[_0x8970('0xb7')](handleError(_0x25255a,null));};
\ No newline at end of file
index 15be7eb..9c76c3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb73=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','getUsers','then','Users','map','findAll','unreadMessages','length'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfb73,0xcb));var _0x3fb7=function(_0x2f28a0,_0x31b5ed){_0x2f28a0=_0x2f28a0-0x0;var _0x323237=_0xfb73[_0x2f28a0];return _0x323237;};'use strict';var EventEmitter=require(_0x3fb7('0x0'));var FaxInteraction=require(_0x3fb7('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x3fb7('0x1'))['db'][_0x3fb7('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3fb7('0x3')](0x0);var events={'afterCreate':_0x3fb7('0x4'),'afterUpdate':_0x3fb7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x56cb28){return function(_0xd2226c,_0x55f1df,_0x46d827){_0xd2226c[_0x3fb7('0x6')]({'attributes':['id'],'raw':!![]})[_0x3fb7('0x7')](function(_0x28a0e8){_0xd2226c['setDataValue'](_0x3fb7('0x8'),_0x28a0e8[_0x3fb7('0x9')](function(_0x5d7eb2){return{'id':_0x5d7eb2['id']};}));return FaxMessage[_0x3fb7('0xa')]({'where':{'FaxInteractionId':_0xd2226c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3fb7('0x7')](function(_0x15568f){_0xd2226c['setDataValue'](_0x3fb7('0xb'),_0x15568f[_0x3fb7('0xc')]);FaxInteractionEvents[_0x3fb7('0xd')](_0x56cb28+':'+_0xd2226c['id'],_0xd2226c);FaxInteractionEvents[_0x3fb7('0xd')](_0x56cb28,_0xd2226c);_0x46d827(null);})[_0x3fb7('0xe')](_0x46d827(null));};}for(var e in events){if(events[_0x3fb7('0xf')](e)){var event=events[e];FaxInteraction[_0x3fb7('0x10')](e,emitEvent(event));}}module[_0x3fb7('0x11')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x2067=['findAll','unreadMessages','length','emit','exports','events','FaxInteraction','FaxMessage','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x588337,_0x38f5ed){var _0x5ab441=function(_0x4b7ae8){while(--_0x4b7ae8){_0x588337['push'](_0x588337['shift']());}};_0x5ab441(++_0x38f5ed);}(_0x2067,0x17c));var _0x7206=function(_0x1ed46f,_0x7691d7){_0x1ed46f=_0x1ed46f-0x0;var _0x43b931=_0x2067[_0x1ed46f];return _0x43b931;};'use strict';var EventEmitter=require(_0x7206('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x7206('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0x7206('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7206('0x3'),'afterUpdate':_0x7206('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e0b5c){return function(_0x72697f,_0x3a7b21,_0x5973b3){_0x72697f[_0x7206('0x5')]({'attributes':['id'],'raw':!![]})[_0x7206('0x6')](function(_0x10ac21){_0x72697f[_0x7206('0x7')](_0x7206('0x8'),_0x10ac21[_0x7206('0x9')](function(_0x10d1df){return{'id':_0x10d1df['id']};}));return FaxMessage[_0x7206('0xa')]({'where':{'FaxInteractionId':_0x72697f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x583975){_0x72697f[_0x7206('0x7')](_0x7206('0xb'),_0x583975[_0x7206('0xc')]);FaxInteractionEvents[_0x7206('0xd')](_0x2e0b5c+':'+_0x72697f['id'],_0x72697f);FaxInteractionEvents[_0x7206('0xd')](_0x2e0b5c,_0x72697f);_0x5973b3(null);})['catch'](_0x5973b3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x7206('0xe')]=FaxInteractionEvents;
\ No newline at end of file
index dc55de3..7c0d614 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2732=['define','FaxInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','rimraf','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x1c7bdf,_0x1aebb3){var _0x267fa3=function(_0x4af194){while(--_0x4af194){_0x1c7bdf['push'](_0x1c7bdf['shift']());}};_0x267fa3(++_0x1aebb3);}(_0x2732,0x17f));var _0x2273=function(_0x3ca0ef,_0x13da45){_0x3ca0ef=_0x3ca0ef-0x0;var _0x1b1127=_0x2732[_0x3ca0ef];return _0x1b1127;};'use strict';var _=require('lodash');var util=require(_0x2273('0x0'));var logger=require(_0x2273('0x1'))('api');var moment=require(_0x2273('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2273('0x3'));var config=require(_0x2273('0x4'));var attributes=require(_0x2273('0x5'));module[_0x2273('0x6')]=function(_0x317289,_0x487e57){return _0x317289[_0x2273('0x7')](_0x2273('0x8'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29df4e,_0x542716,_0x1a623d){if(_0x29df4e['changed'](_0x2273('0x9'))){_0x29df4e[_0x2273('0xa')]=moment()[_0x2273('0xb')](_0x2273('0xc'));}_0x1a623d(null,_0x29df4e);}}});};
\ No newline at end of file
+var _0x2f63=['exports','fax_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','api','bluebird','request-promise','path','rimraf'];(function(_0x176f43,_0x1d688b){var _0x1bd2ea=function(_0x51d294){while(--_0x51d294){_0x176f43['push'](_0x176f43['shift']());}};_0x1bd2ea(++_0x1d688b);}(_0x2f63,0xf5));var _0x32f6=function(_0x4965d1,_0xb546d4){_0x4965d1=_0x4965d1-0x0;var _0x59e849=_0x2f63[_0x4965d1];return _0x59e849;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x32f6('0x0'));var moment=require('moment');var BPromise=require(_0x32f6('0x1'));var rp=require(_0x32f6('0x2'));var fs=require('fs');var path=require(_0x32f6('0x3'));var rimraf=require(_0x32f6('0x4'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x32f6('0x5')]=function(_0x525c4e,_0x1c9389){return _0x525c4e['define']('FaxInteraction',attributes,{'tableName':_0x32f6('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c9ab7,_0x1f4960,_0x3896e4){if(_0x4c9ab7['changed']('closed')){_0x4c9ab7[_0x32f6('0x7')]=moment()[_0x32f6('0x8')](_0x32f6('0x9'));}_0x3896e4(null,_0x4c9ab7);}}});};
\ No newline at end of file
index 5a05013..e996cc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b22=['body','options','raw','where','attributes','limit','info','UpdateFaxInteraction','catch','AddTagsToFaxInteraction','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FaxInteraction'];(function(_0x41fcf1,_0xc3f450){var _0x2f14f8=function(_0x5a94a4){while(--_0x5a94a4){_0x41fcf1['push'](_0x41fcf1['shift']());}};_0x2f14f8(++_0xc3f450);}(_0x8b22,0x8c));var _0x28b2=function(_0x531733,_0x5d98ac){_0x531733=_0x531733-0x0;var _0x195df5=_0x8b22[_0x531733];return _0x195df5;};'use strict';var _=require('lodash');var util=require(_0x28b2('0x0'));var moment=require(_0x28b2('0x1'));var BPromise=require(_0x28b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28b2('0x3'));var db=require(_0x28b2('0x4'))['db'];var utils=require(_0x28b2('0x5'));var logger=require(_0x28b2('0x6'))(_0x28b2('0x7'));var config=require(_0x28b2('0x8'));var jayson=require(_0x28b2('0x9'));var client=jayson[_0x28b2('0xa')][_0x28b2('0xb')]({'port':0x232a});config[_0x28b2('0xc')]=_[_0x28b2('0xd')](config[_0x28b2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x28b2('0xe'))(new Redis(config[_0x28b2('0xc')]));require(_0x28b2('0xf'))[_0x28b2('0x10')](socket);function respondWithRpcPromise(_0x219b16,_0xe77250,_0x21d446){return new BPromise(function(_0x5b6b94,_0xc06278){return client[_0x28b2('0x11')](_0x219b16,_0x21d446)[_0x28b2('0x12')](function(_0x5a23dd){logger['info'](_0x28b2('0x13'),_0xe77250,_0x28b2('0x14'));logger[_0x28b2('0x15')](_0x28b2('0x16'),_0xe77250,_0x28b2('0x14'),JSON[_0x28b2('0x17')](_0x5a23dd));if(_0x5a23dd[_0x28b2('0x18')]){if(_0x5a23dd[_0x28b2('0x18')]['code']===0x1f4){logger[_0x28b2('0x18')]('FaxInteraction,\x20%s,\x20%s',_0xe77250,_0x5a23dd['error'][_0x28b2('0x19')]);return _0xc06278(_0x5a23dd[_0x28b2('0x18')][_0x28b2('0x19')]);}logger[_0x28b2('0x18')](_0x28b2('0x13'),_0xe77250,_0x5a23dd['error']['message']);return _0x5b6b94(_0x5a23dd['error']['message']);}else{logger['info'](_0x28b2('0x13'),_0xe77250,_0x28b2('0x14'));_0x5b6b94(_0x5a23dd[_0x28b2('0x1a')]['message']);}})['catch'](function(_0x4ee639){logger['error'](_0x28b2('0x13'),_0xe77250,_0x4ee639);_0xc06278(_0x4ee639);});});}exports['UpdateFaxInteraction']=function(_0x6b2b98){var _0x46f6db=this;return new Promise(function(_0x38fc3f,_0x56c60a){return db[_0x28b2('0x1b')]['update'](_0x6b2b98[_0x28b2('0x1c')],{'raw':_0x6b2b98['options']?_0x6b2b98[_0x28b2('0x1d')][_0x28b2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6b2b98['options']?_0x6b2b98[_0x28b2('0x1d')][_0x28b2('0x1f')]||null:null,'attributes':_0x6b2b98[_0x28b2('0x1d')]?_0x6b2b98[_0x28b2('0x1d')][_0x28b2('0x20')]||null:null,'limit':_0x6b2b98[_0x28b2('0x1d')]?_0x6b2b98[_0x28b2('0x1d')][_0x28b2('0x21')]||null:null})[_0x28b2('0x12')](function(_0x2ef1ab){logger[_0x28b2('0x22')](_0x28b2('0x23'),_0x6b2b98);logger[_0x28b2('0x15')](_0x28b2('0x23'),_0x6b2b98,JSON[_0x28b2('0x17')](_0x2ef1ab));_0x38fc3f(_0x2ef1ab);})[_0x28b2('0x24')](function(_0x10e57d){logger[_0x28b2('0x18')](_0x28b2('0x23'),_0x10e57d[_0x28b2('0x19')],_0x6b2b98);_0x56c60a(_0x46f6db[_0x28b2('0x18')](0x1f4,_0x10e57d['message']));});});};exports[_0x28b2('0x25')]=function(_0x55f458){return new Promise(function(_0x2e03b0,_0x382a6f){return db[_0x28b2('0x1b')]['find']({'where':_0x55f458[_0x28b2('0x1d')]?_0x55f458[_0x28b2('0x1d')][_0x28b2('0x1f')]||null:null})[_0x28b2('0x12')](function(_0x78cba8){if(_0x78cba8){return _0x78cba8['addTags'](_0x55f458[_0x28b2('0x1c')][_0x28b2('0x26')],_[_0x28b2('0x27')](_0x55f458[_0x28b2('0x1c')],[_0x28b2('0x26'),'id'])||{});}})[_0x28b2('0x28')](function(_0xd50ad6){logger['info'](_0x28b2('0x29'),_0x55f458);logger[_0x28b2('0x15')](_0x28b2('0x29'),_0x55f458,JSON[_0x28b2('0x17')](_0xd50ad6));_0x2e03b0(_0xd50ad6);})[_0x28b2('0x24')](function(_0x47ef0f){logger[_0x28b2('0x18')](_0x28b2('0x29'),_0x47ef0f['message'],_0x55f458);_0x382a6f(_this[_0x28b2('0x18')](0x1f4,_0x47ef0f[_0x28b2('0x19')]));});});};
\ No newline at end of file
+var _0x4385=['options','where','attributes','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','update','body','raw'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x4385,0xd7));var _0x5438=function(_0x17b50e,_0x2beec7){_0x17b50e=_0x17b50e-0x0;var _0x2c9142=_0x4385[_0x17b50e];return _0x2c9142;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5438('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5438('0x1'))['db'];var utils=require(_0x5438('0x2'));var logger=require('../../config/logger')(_0x5438('0x3'));var config=require(_0x5438('0x4'));var jayson=require(_0x5438('0x5'));var client=jayson[_0x5438('0x6')][_0x5438('0x7')]({'port':0x232a});config['redis']=_[_0x5438('0x8')](config[_0x5438('0x9')],{'host':_0x5438('0xa'),'port':0x18eb});var socket=require(_0x5438('0xb'))(new Redis(config[_0x5438('0x9')]));require(_0x5438('0xc'))[_0x5438('0xd')](socket);function respondWithRpcPromise(_0x13b918,_0x4cc9c9,_0x182324){return new BPromise(function(_0x379f09,_0x160e4a){return client[_0x5438('0xe')](_0x13b918,_0x182324)[_0x5438('0xf')](function(_0x144b6d){logger['info'](_0x5438('0x10'),_0x4cc9c9,_0x5438('0x11'));logger[_0x5438('0x12')](_0x5438('0x13'),_0x4cc9c9,_0x5438('0x11'),JSON[_0x5438('0x14')](_0x144b6d));if(_0x144b6d[_0x5438('0x15')]){if(_0x144b6d[_0x5438('0x15')][_0x5438('0x16')]===0x1f4){logger[_0x5438('0x15')](_0x5438('0x10'),_0x4cc9c9,_0x144b6d['error'][_0x5438('0x17')]);return _0x160e4a(_0x144b6d[_0x5438('0x15')][_0x5438('0x17')]);}logger[_0x5438('0x15')](_0x5438('0x10'),_0x4cc9c9,_0x144b6d[_0x5438('0x15')][_0x5438('0x17')]);return _0x379f09(_0x144b6d[_0x5438('0x15')][_0x5438('0x17')]);}else{logger[_0x5438('0x18')](_0x5438('0x10'),_0x4cc9c9,_0x5438('0x11'));_0x379f09(_0x144b6d[_0x5438('0x19')]['message']);}})[_0x5438('0x1a')](function(_0xa22aaf){logger['error'](_0x5438('0x10'),_0x4cc9c9,_0xa22aaf);_0x160e4a(_0xa22aaf);});});}exports[_0x5438('0x1b')]=function(_0xaf4904){var _0x59e647=this;return new Promise(function(_0x746c87,_0x52d098){return db['FaxInteraction'][_0x5438('0x1c')](_0xaf4904[_0x5438('0x1d')],{'raw':_0xaf4904['options']?_0xaf4904['options'][_0x5438('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaf4904['options']?_0xaf4904[_0x5438('0x1f')][_0x5438('0x20')]||null:null,'attributes':_0xaf4904[_0x5438('0x1f')]?_0xaf4904[_0x5438('0x1f')][_0x5438('0x21')]||null:null,'limit':_0xaf4904[_0x5438('0x1f')]?_0xaf4904[_0x5438('0x1f')]['limit']||null:null})[_0x5438('0xf')](function(_0x2212fc){logger[_0x5438('0x18')](_0x5438('0x1b'),_0xaf4904);logger[_0x5438('0x12')](_0x5438('0x1b'),_0xaf4904,JSON[_0x5438('0x14')](_0x2212fc));_0x746c87(_0x2212fc);})['catch'](function(_0x247b1c){logger[_0x5438('0x15')](_0x5438('0x1b'),_0x247b1c[_0x5438('0x17')],_0xaf4904);_0x52d098(_0x59e647['error'](0x1f4,_0x247b1c[_0x5438('0x17')]));});});};exports[_0x5438('0x22')]=function(_0x3eec67){return new Promise(function(_0x262e13,_0x483969){return db['FaxInteraction'][_0x5438('0x23')]({'where':_0x3eec67['options']?_0x3eec67[_0x5438('0x1f')]['where']||null:null})[_0x5438('0xf')](function(_0xee0ba1){if(_0xee0ba1){return _0xee0ba1[_0x5438('0x24')](_0x3eec67[_0x5438('0x1d')][_0x5438('0x25')],_[_0x5438('0x26')](_0x3eec67['body'],[_0x5438('0x25'),'id'])||{});}})[_0x5438('0x27')](function(_0x1b4e2d){logger[_0x5438('0x18')](_0x5438('0x28'),_0x3eec67);logger[_0x5438('0x12')](_0x5438('0x28'),_0x3eec67,JSON['stringify'](_0x1b4e2d));_0x262e13(_0x1b4e2d);})[_0x5438('0x1a')](function(_0x1ceb79){logger[_0x5438('0x15')]('AddTags',_0x1ceb79[_0x5438('0x17')],_0x3eec67);_0x483969(_this[_0x5438('0x15')](0x1f4,_0x1ceb79['message']));});});};
\ No newline at end of file
index 3858b7d..eca739a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a07=['register','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x232b67,_0x3dc89e){var _0x39fcc0=function(_0x3e20c6){while(--_0x3e20c6){_0x232b67['push'](_0x232b67['shift']());}};_0x39fcc0(++_0x3dc89e);}(_0x3a07,0x10c));var _0x73a0=function(_0x5a115d,_0x4b098b){_0x5a115d=_0x5a115d-0x0;var _0x289ad0=_0x3a07[_0x5a115d];return _0x289ad0;};'use strict';var FaxInteractionEvents=require(_0x73a0('0x0'));var events=[_0x73a0('0x1'),_0x73a0('0x2'),_0x73a0('0x3')];function createListener(_0x4b97d6,_0x1f5813){return function(_0x3293c0){_0x1f5813[_0x73a0('0x4')](_0x4b97d6,_0x3293c0);};}function removeListener(_0xef34b6,_0x157952){return function(){FaxInteractionEvents['removeListener'](_0xef34b6,_0x157952);};}exports[_0x73a0('0x5')]=function(_0x7d3760){for(var _0x5cb9e0=0x0,_0x286bbd=events['length'];_0x5cb9e0<_0x286bbd;_0x5cb9e0++){var _0x40bde1=events[_0x5cb9e0];var _0x1f90a3=createListener(_0x73a0('0x6')+_0x40bde1,_0x7d3760);FaxInteractionEvents['on'](_0x40bde1,_0x1f90a3);}};
\ No newline at end of file
+var _0xdda7=['register','length','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x185af2,_0x2d0be5){var _0x46d876=function(_0x489545){while(--_0x489545){_0x185af2['push'](_0x185af2['shift']());}};_0x46d876(++_0x2d0be5);}(_0xdda7,0x1bb));var _0x7dda=function(_0x1259af,_0x217fbf){_0x1259af=_0x1259af-0x0;var _0x41ee33=_0xdda7[_0x1259af];return _0x41ee33;};'use strict';var FaxInteractionEvents=require(_0x7dda('0x0'));var events=[_0x7dda('0x1'),_0x7dda('0x2'),_0x7dda('0x3')];function createListener(_0x459110,_0x58c01c){return function(_0x44b4d6){_0x58c01c[_0x7dda('0x4')](_0x459110,_0x44b4d6);};}function removeListener(_0x13d309,_0x15b7d7){return function(){FaxInteractionEvents['removeListener'](_0x13d309,_0x15b7d7);};}exports[_0x7dda('0x5')]=function(_0x3cfb52){for(var _0x4dbe10=0x0,_0x37f314=events[_0x7dda('0x6')];_0x4dbe10<_0x37f314;_0x4dbe10++){var _0x5e02ef=events[_0x4dbe10];var _0x57563f=createListener(_0x7dda('0x7')+_0x5e02ef,_0x3cfb52);FaxInteractionEvents['on'](_0x5e02ef,_0x57563f);}};
\ No newline at end of file
index b045a61..48c89ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce50=['Router','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','tracked','faxinteraction:addtags','put','fax','faxinteraction:update','update','delete','destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','express'];(function(_0x8e70f7,_0x3c3ec6){var _0x28585e=function(_0x434a56){while(--_0x434a56){_0x8e70f7['push'](_0x8e70f7['shift']());}};_0x28585e(++_0x3c3ec6);}(_0xce50,0x1d8));var _0x0ce5=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xce50[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require('multer');var util=require(_0x0ce5('0x0'));var path=require(_0x0ce5('0x1'));var timeout=require(_0x0ce5('0x2'));var express=require(_0x0ce5('0x3'));var router=express[_0x0ce5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0ce5('0x5'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0x0ce5('0x6')]('/',auth[_0x0ce5('0x7')](),controller[_0x0ce5('0x8')]);router[_0x0ce5('0x6')]('/describe',auth[_0x0ce5('0x7')](),controller[_0x0ce5('0x9')]);router['get'](_0x0ce5('0xa'),auth['isAuthenticated'](),controller[_0x0ce5('0xb')]);router[_0x0ce5('0x6')](_0x0ce5('0xc'),auth[_0x0ce5('0x7')](),controller['getMessages']);router[_0x0ce5('0x6')](_0x0ce5('0xd'),auth[_0x0ce5('0x7')](),controller[_0x0ce5('0xe')]);router[_0x0ce5('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x0ce5('0xc'),auth[_0x0ce5('0x7')](),controller[_0x0ce5('0x10')]);router[_0x0ce5('0xf')]('/:id/tags',auth[_0x0ce5('0x7')](),interaction[_0x0ce5('0x11')]('fax',_0x0ce5('0x12')),controller['addTags']);router[_0x0ce5('0x13')](_0x0ce5('0xa'),auth[_0x0ce5('0x7')](),interaction[_0x0ce5('0x11')](_0x0ce5('0x14'),_0x0ce5('0x15')),controller[_0x0ce5('0x16')]);router[_0x0ce5('0x17')]('/:id',auth[_0x0ce5('0x7')](),interaction[_0x0ce5('0x11')]('fax','faxinteraction:destroy'),controller[_0x0ce5('0x18')]);router['delete'](_0x0ce5('0x19'),auth[_0x0ce5('0x7')](),controller[_0x0ce5('0x1a')]);module[_0x0ce5('0x1b')]=router;
\ No newline at end of file
+var _0x76dd=['/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','put','update','delete','destroy','removeTags','exports','multer','Router','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x4bfade,_0xb26c0e){var _0x272465=function(_0x3b38cb){while(--_0x3b38cb){_0x4bfade['push'](_0x4bfade['shift']());}};_0x272465(++_0xb26c0e);}(_0x76dd,0xb4));var _0xd76d=function(_0x323c99,_0x526df9){_0x323c99=_0x323c99-0x0;var _0xe20b38=_0x76dd[_0x323c99];return _0xe20b38;};'use strict';var multer=require(_0xd76d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd76d('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd76d('0x2'));var controller=require(_0xd76d('0x3'));router['get']('/',auth[_0xd76d('0x4')](),controller[_0xd76d('0x5')]);router[_0xd76d('0x6')](_0xd76d('0x7'),auth[_0xd76d('0x4')](),controller[_0xd76d('0x8')]);router['get'](_0xd76d('0x9'),auth[_0xd76d('0x4')](),controller[_0xd76d('0xa')]);router['get'](_0xd76d('0xb'),auth['isAuthenticated'](),controller[_0xd76d('0xc')]);router[_0xd76d('0x6')](_0xd76d('0xd'),auth[_0xd76d('0x4')](),controller[_0xd76d('0xe')]);router[_0xd76d('0xf')]('/',auth[_0xd76d('0x4')](),controller[_0xd76d('0x10')]);router[_0xd76d('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0xd76d('0x11')]);router[_0xd76d('0xf')](_0xd76d('0x12'),auth[_0xd76d('0x4')](),interaction[_0xd76d('0x13')](_0xd76d('0x14'),'faxinteraction:addtags'),controller['addTags']);router[_0xd76d('0x15')](_0xd76d('0x9'),auth[_0xd76d('0x4')](),interaction[_0xd76d('0x13')](_0xd76d('0x14'),'faxinteraction:update'),controller[_0xd76d('0x16')]);router[_0xd76d('0x17')](_0xd76d('0x9'),auth['isAuthenticated'](),interaction['tracked'](_0xd76d('0x14'),'faxinteraction:destroy'),controller[_0xd76d('0x18')]);router[_0xd76d('0x17')](_0xd76d('0x12'),auth[_0xd76d('0x4')](),controller[_0xd76d('0x19')]);module[_0xd76d('0x1a')]=router;
\ No newline at end of file
index 2149ed8..ba6dae3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1da1=['sequelize','exports','TEXT','medium','BOOLEAN','out','DATE'];(function(_0x570b19,_0xe4cb1f){var _0x44c8ce=function(_0x2a93e8){while(--_0x2a93e8){_0x570b19['push'](_0x570b19['shift']());}};_0x44c8ce(++_0xe4cb1f);}(_0x1da1,0x1a4));var _0x11da=function(_0x1a57d5,_0x4babee){_0x1a57d5=_0x1a57d5-0x0;var _0x4199bc=_0x1da1[_0x1a57d5];return _0x4199bc;};'use strict';var Sequelize=require(_0x11da('0x0'));module[_0x11da('0x1')]={'body':{'type':Sequelize[_0x11da('0x2')](_0x11da('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x11da('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x11da('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x11da('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x11da('0x6')]}};
\ No newline at end of file
+var _0xac95=['sequelize','exports','TEXT','medium','out','DATE'];(function(_0x4ec13d,_0x358a8f){var _0x3c3fa7=function(_0x2615f6){while(--_0x2615f6){_0x4ec13d['push'](_0x4ec13d['shift']());}};_0x3c3fa7(++_0x358a8f);}(_0xac95,0xa8));var _0x5ac9=function(_0x48412b,_0x161b7b){_0x48412b=_0x48412b-0x0;var _0x8482eb=_0xac95[_0x48412b];return _0x8482eb;};'use strict';var Sequelize=require(_0x5ac9('0x0'));module[_0x5ac9('0x1')]={'body':{'type':Sequelize[_0x5ac9('0x2')](_0x5ac9('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5ac9('0x4')),'defaultValue':_0x5ac9('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x5ac9('0x5')]}};
\ No newline at end of file
index abf9fa4..3e690ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa500=['params','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','agent','email','internal','manual','interface','channel','event','EventManager','acceptmessage','FaxInteraction','interaction','null','RejectMessage','rejectMessage','Sequelize','contact','fullname','SIP/%s','motionChannel','rejectmessage','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','basename','join','root','server','files','download','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','defaults','redis','socket.io-emitter','jayson/promise','client','http','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','FaxMessage,\x20%s,\x20%s','message','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','fields','length','includeAll','find','catch','body','destroy'];(function(_0x5e057d,_0x46d3e2){var _0x4d68ca=function(_0xaac746){while(--_0xaac746){_0x5e057d['push'](_0x5e057d['shift']());}};_0x4d68ca(++_0x46d3e2);}(_0xa500,0x1d9));var _0x0a50=function(_0x915a38,_0x34c630){_0x915a38=_0x915a38-0x0;var _0x11ed84=_0xa500[_0x915a38];return _0x11ed84;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a50('0x0'));var zipdir=require(_0x0a50('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a50('0x2'));var moment=require('moment');var BPromise=require(_0x0a50('0x3'));var Mustache=require(_0x0a50('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0a50('0x5'));var csv=require(_0x0a50('0x6'));var ejs=require(_0x0a50('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0a50('0x8'));var crypto=require(_0x0a50('0x9'));var jsforce=require(_0x0a50('0xa'));var deskjs=require(_0x0a50('0xb'));var toCsv=require(_0x0a50('0x6'));var querystring=require(_0x0a50('0xc'));var Papa=require(_0x0a50('0xd'));var Redis=require(_0x0a50('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a50('0xf'))(_0x0a50('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a50('0x11')](config[_0x0a50('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a50('0x13'))(new Redis(config[_0x0a50('0x12')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0x0a50('0x14'));var client=jayson[_0x0a50('0x15')]['http']({'port':0x232c});var client9002=jayson['client'][_0x0a50('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x452bd3,_0x35a640,_0x123cec,_0x514740){return new BPromise(function(_0xc0d89d,_0x11f940){var _0x313ad9=_0x514740||client;return _0x313ad9['request'](_0x452bd3,_0x123cec)['then'](function(_0x38cd21){logger[_0x0a50('0x17')]('FaxMessage,\x20%s,\x20%s',_0x35a640,_0x0a50('0x18'));logger[_0x0a50('0x19')](_0x0a50('0x1a'),_0x35a640,_0x0a50('0x18'),JSON['stringify'](_0x38cd21));if(_0x38cd21[_0x0a50('0x1b')]){if(_0x38cd21[_0x0a50('0x1b')][_0x0a50('0x1c')]===0x1f4){logger[_0x0a50('0x1b')](_0x0a50('0x1d'),_0x35a640,_0x38cd21['error'][_0x0a50('0x1e')]);return _0x11f940(_0x38cd21[_0x0a50('0x1b')][_0x0a50('0x1e')]);}logger['error'](_0x0a50('0x1d'),_0x35a640,_0x38cd21[_0x0a50('0x1b')][_0x0a50('0x1e')]);return _0xc0d89d(_0x38cd21[_0x0a50('0x1b')][_0x0a50('0x1e')]);}else{logger[_0x0a50('0x17')](_0x0a50('0x1d'),_0x35a640,_0x0a50('0x18'));_0xc0d89d(_0x38cd21['result'][_0x0a50('0x1e')]);}})['catch'](function(_0x245a6c){logger[_0x0a50('0x1b')]('FaxMessage,\x20%s,\x20%s',_0x35a640,_0x245a6c);_0x11f940(_0x245a6c);});});}function respondWithStatusCode(_0x1c33b2,_0x4511b5){_0x4511b5=_0x4511b5||0xcc;return function(_0x1bd696){if(_0x1bd696){return _0x1c33b2[_0x0a50('0x1f')](_0x4511b5);}return _0x1c33b2['status'](_0x4511b5)[_0x0a50('0x20')]();};}function respondWithResult(_0x1437f9,_0x299064){_0x299064=_0x299064||0xc8;return function(_0x12af6d){if(_0x12af6d){return _0x1437f9[_0x0a50('0x21')](_0x299064)[_0x0a50('0x22')](_0x12af6d);}};}function respondWithFilteredResult(_0x5e8110,_0x228b16){return function(_0x136416){if(_0x136416){var _0xdd71d=typeof _0x228b16[_0x0a50('0x23')]===_0x0a50('0x24')&&typeof _0x228b16[_0x0a50('0x25')]===_0x0a50('0x24');var _0xb692d0=_0x136416['count'];var _0x5c54e7=_0xdd71d?0x0:_0x228b16['offset'];var _0x41d5bc=_0xdd71d?_0x136416[_0x0a50('0x26')]:_0x228b16[_0x0a50('0x23')]+_0x228b16[_0x0a50('0x25')];var _0x3a3689;if(_0x41d5bc>=_0xb692d0){_0x41d5bc=_0xb692d0;_0x3a3689=0xc8;}else{_0x3a3689=0xce;}_0x5e8110['status'](_0x3a3689);return _0x5e8110[_0x0a50('0x27')](_0x0a50('0x28'),_0x5c54e7+'-'+_0x41d5bc+'/'+_0xb692d0)[_0x0a50('0x22')](_0x136416);}return null;};}function patchUpdates(_0x1f1c04){return function(_0x360419){try{jsonpatch[_0x0a50('0x29')](_0x360419,_0x1f1c04,!![]);}catch(_0x191729){return BPromise[_0x0a50('0x2a')](_0x191729);}return _0x360419[_0x0a50('0x2b')]();};}function saveUpdates(_0x448cc9,_0x1de3d8){return function(_0x2cc864){if(_0x2cc864){return _0x2cc864[_0x0a50('0x2c')](_0x448cc9)[_0x0a50('0x2d')](function(_0x200531){return _0x200531;});}return null;};}function removeEntity(_0x3879c4,_0x15ab9a){return function(_0x4b6afa){if(_0x4b6afa){return _0x4b6afa['destroy']()['then'](function(){_0x3879c4['status'](0xcc)[_0x0a50('0x20')]();});}};}function handleEntityNotFound(_0x2369d9,_0x6c4401){return function(_0x2caad9){if(!_0x2caad9){_0x2369d9[_0x0a50('0x1f')](0x194);}return _0x2caad9;};}function handleError(_0x4b8072,_0x3fe3fe){_0x3fe3fe=_0x3fe3fe||0x1f4;return function(_0x135dd2){logger[_0x0a50('0x1b')](_0x135dd2[_0x0a50('0x2e')]);if(_0x135dd2[_0x0a50('0x2f')]){delete _0x135dd2['name'];}_0x4b8072[_0x0a50('0x21')](_0x3fe3fe)[_0x0a50('0x30')](_0x135dd2);};}exports[_0x0a50('0x31')]=function(_0x196897,_0x107e3a){var _0x5872ce={},_0x12f0eb={},_0x2d9fde={'count':0x0,'rows':[]};var _0x3b99ca=_[_0x0a50('0x32')](db[_0x0a50('0x33')][_0x0a50('0x34')],function(_0x4a1449){return{'name':_0x4a1449[_0x0a50('0x35')],'type':_0x4a1449[_0x0a50('0x36')][_0x0a50('0x37')]};});_0x12f0eb[_0x0a50('0x38')]=_[_0x0a50('0x32')](_0x3b99ca,_0x0a50('0x2f'));_0x12f0eb[_0x0a50('0x39')]=_[_0x0a50('0x3a')](_0x196897['query']);_0x12f0eb[_0x0a50('0x3b')]=_[_0x0a50('0x3c')](_0x12f0eb[_0x0a50('0x38')],_0x12f0eb[_0x0a50('0x39')]);_0x5872ce[_0x0a50('0x3d')]=_[_0x0a50('0x3c')](_0x12f0eb[_0x0a50('0x38')],qs['fields'](_0x196897[_0x0a50('0x39')]['fields']));_0x5872ce[_0x0a50('0x3d')]=_0x5872ce[_0x0a50('0x3d')]['length']?_0x5872ce[_0x0a50('0x3d')]:_0x12f0eb[_0x0a50('0x38')];if(!_0x196897[_0x0a50('0x39')][_0x0a50('0x3e')](_0x0a50('0x3f'))){_0x5872ce[_0x0a50('0x25')]=qs['limit'](_0x196897[_0x0a50('0x39')][_0x0a50('0x25')]);_0x5872ce['offset']=qs[_0x0a50('0x23')](_0x196897[_0x0a50('0x39')][_0x0a50('0x23')]);}_0x5872ce[_0x0a50('0x40')]=qs[_0x0a50('0x41')](_0x196897[_0x0a50('0x39')]['sort']);_0x5872ce[_0x0a50('0x42')]=qs[_0x0a50('0x3b')](_[_0x0a50('0x43')](_0x196897[_0x0a50('0x39')],_0x12f0eb[_0x0a50('0x3b')]),_0x3b99ca);if(_0x196897[_0x0a50('0x39')][_0x0a50('0x44')]){_0x5872ce[_0x0a50('0x42')]=_[_0x0a50('0x45')](_0x5872ce[_0x0a50('0x42')],{'$or':_[_0x0a50('0x32')](_0x3b99ca,function(_0x37ce94){if(_0x37ce94['type']!==_0x0a50('0x46')){var _0x436113={};_0x436113[_0x37ce94[_0x0a50('0x2f')]]={'$like':'%'+_0x196897[_0x0a50('0x39')]['filter']+'%'};return _0x436113;}})});}_0x5872ce=_[_0x0a50('0x45')]({},_0x5872ce,_0x196897[_0x0a50('0x47')]);var _0x1b9a98={'where':_0x5872ce[_0x0a50('0x42')]};return db[_0x0a50('0x33')][_0x0a50('0x26')](_0x1b9a98)[_0x0a50('0x2d')](function(_0x7b4608){_0x2d9fde[_0x0a50('0x26')]=_0x7b4608;if(_0x196897[_0x0a50('0x39')]['includeAll']){_0x5872ce[_0x0a50('0x48')]=[{'all':!![]}];}return db[_0x0a50('0x33')][_0x0a50('0x49')](_0x5872ce);})[_0x0a50('0x2d')](function(_0x1a093f){_0x2d9fde[_0x0a50('0x4a')]=_0x1a093f;return _0x2d9fde;})[_0x0a50('0x2d')](respondWithFilteredResult(_0x107e3a,_0x5872ce))['catch'](handleError(_0x107e3a,null));};exports[_0x0a50('0x4b')]=function(_0x212d7b,_0x48dac3){var _0x20a43c={'raw':!![],'where':{'id':_0x212d7b['params']['id']}},_0x217a0d={};_0x217a0d[_0x0a50('0x38')]=_[_0x0a50('0x3a')](db['FaxMessage']['rawAttributes']);_0x217a0d[_0x0a50('0x39')]=_[_0x0a50('0x3a')](_0x212d7b[_0x0a50('0x39')]);_0x217a0d[_0x0a50('0x3b')]=_[_0x0a50('0x3c')](_0x217a0d[_0x0a50('0x38')],_0x217a0d[_0x0a50('0x39')]);_0x20a43c['attributes']=_['intersection'](_0x217a0d[_0x0a50('0x38')],qs[_0x0a50('0x4c')](_0x212d7b['query'][_0x0a50('0x4c')]));_0x20a43c[_0x0a50('0x3d')]=_0x20a43c[_0x0a50('0x3d')][_0x0a50('0x4d')]?_0x20a43c['attributes']:_0x217a0d[_0x0a50('0x38')];if(_0x212d7b[_0x0a50('0x39')][_0x0a50('0x4e')]){_0x20a43c[_0x0a50('0x48')]=[{'all':!![]}];}_0x20a43c=_[_0x0a50('0x45')]({},_0x20a43c,_0x212d7b['options']);return db['FaxMessage'][_0x0a50('0x4f')](_0x20a43c)[_0x0a50('0x2d')](handleEntityNotFound(_0x48dac3,null))[_0x0a50('0x2d')](respondWithResult(_0x48dac3,null))[_0x0a50('0x50')](handleError(_0x48dac3,null));};exports[_0x0a50('0x2c')]=function(_0x22558b,_0x1aa1ed){if(_0x22558b[_0x0a50('0x51')]['id']){delete _0x22558b[_0x0a50('0x51')]['id'];}return db[_0x0a50('0x33')][_0x0a50('0x4f')]({'where':{'id':_0x22558b['params']['id']}})[_0x0a50('0x2d')](handleEntityNotFound(_0x1aa1ed,null))[_0x0a50('0x2d')](saveUpdates(_0x22558b['body'],null))[_0x0a50('0x2d')](respondWithResult(_0x1aa1ed,null))[_0x0a50('0x50')](handleError(_0x1aa1ed,null));};exports[_0x0a50('0x52')]=function(_0x330bdb,_0x19468d){return db[_0x0a50('0x33')][_0x0a50('0x4f')]({'where':{'id':_0x330bdb[_0x0a50('0x53')]['id']}})['then'](handleEntityNotFound(_0x19468d,null))[_0x0a50('0x2d')](removeEntity(_0x19468d,null))[_0x0a50('0x50')](handleError(_0x19468d,null));};exports[_0x0a50('0x54')]=function(_0x5ea40f,_0x3ff615){return db[_0x0a50('0x33')][_0x0a50('0x54')]()[_0x0a50('0x2d')](respondWithResult(_0x3ff615,null))['catch'](handleError(_0x3ff615,null));};var interaction_log=require(_0x0a50('0xf'))(_0x0a50('0x55'));exports[_0x0a50('0x56')]=function(_0x3e81c4,_0x2e692b,_0x394fb3){var _0x393afe={'agent':{},'channel':_0x0a50('0x57')};if(_0x3e81c4[_0x0a50('0x51')]['id']){delete _0x3e81c4[_0x0a50('0x51')]['id'];}_0x3e81c4['body']['read']=!![];_0x3e81c4[_0x0a50('0x51')][_0x0a50('0x58')]=moment()[_0x0a50('0x59')](_0x0a50('0x5a'));_0x3e81c4[_0x0a50('0x51')][_0x0a50('0x5b')]=_0x3e81c4[_0x0a50('0x51')]['UserId']||_0x3e81c4[_0x0a50('0x5c')]['id'];_0x393afe['agent']['id']=_0x3e81c4[_0x0a50('0x51')][_0x0a50('0x5b')];return db['FaxMessage'][_0x0a50('0x4f')]({'where':{'id':_0x3e81c4['params']['id'],'UserId':null}})[_0x0a50('0x2d')](handleEntityNotFound(_0x2e692b,null))['then'](saveUpdates(_0x3e81c4[_0x0a50('0x51')],null))['then'](function(_0x1aa15c){if(_0x1aa15c){_0x393afe[_0x0a50('0x1e')]=_0x1aa15c[_0x0a50('0x5d')]({'plain':!![]});return db['FaxInteraction'][_0x0a50('0x4f')]({'where':{'id':_0x1aa15c[_0x0a50('0x5e')]}});}return null;})[_0x0a50('0x2d')](handleEntityNotFound(_0x2e692b,null))[_0x0a50('0x2d')](function(_0x2c0b26){if(_0x2c0b26){return _0x2c0b26[_0x0a50('0x2c')]({'UserId':_0x3e81c4[_0x0a50('0x51')]['UserId'],'read1stAt':_[_0x0a50('0x5f')](_0x2c0b26[_0x0a50('0x60')])?moment()[_0x0a50('0x59')](_0x0a50('0x5a')):undefined});}return null;})[_0x0a50('0x2d')](function(_0x314c5c){if(_0x314c5c){_0x393afe['interaction']=_0x314c5c[_0x0a50('0x5d')]({'plain':!![]});interaction_log['info'](_0x0a50('0x61'),_0x3e81c4[_0x0a50('0x5c')]['id'],_0x3e81c4['user'][_0x0a50('0x2f')],_0x3e81c4['user'][_0x0a50('0x62')],_0x393afe['interaction']['id'],_0x3e81c4[_0x0a50('0x51')]?JSON[_0x0a50('0x63')](_0x3e81c4[_0x0a50('0x51')]):'null');return respondWithRpcPromise('AcceptMessage',_0x0a50('0x64'),_0x393afe);}return null;})[_0x0a50('0x2d')](function(_0xabd5a2){var _0x3f994b=_0x0a50('0x65')+_0xabd5a2[_0x0a50('0x1e')][_0x0a50('0x66')];return db[_0x0a50('0x67')][_0x0a50('0x39')](_0x3f994b,{'type':db['Sequelize'][_0x0a50('0x68')][_0x0a50('0x69')],'raw':!![]})['then'](function(_0x5b86cc){return _0x5b86cc;});})[_0x0a50('0x2d')](function(_0x3a219b){if(_0x3a219b){_0x393afe['message']['contact']=_0x3a219b[0x0];if(!_0x3e81c4['body']['UserId'])return;return db[_0x0a50('0x6a')][_0x0a50('0x4f')]({'where':{'id':_0x3e81c4[_0x0a50('0x51')][_0x0a50('0x5b')],'role':_0x0a50('0x6b')},'attributes':['id',_0x0a50('0x2f'),'fullname',_0x0a50('0x6c'),_0x0a50('0x6d')],'raw':!![]});}return null;})['then'](function(_0x8f46b){if(!_0x8f46b)return null;_0x393afe[_0x0a50('0x1e')][_0x0a50('0x6b')]=_0x8f46b;return _0x393afe;})[_0x0a50('0x2d')](function(_0x1ae379){if(_0x1ae379){if(_0x3e81c4[_0x0a50('0x51')][_0x0a50('0x6e')]){_0x393afe['message'][_0x0a50('0x6f')]=util[_0x0a50('0x59')]('SIP/%s',_0x3e81c4[_0x0a50('0x5c')][_0x0a50('0x2f')]);_0x393afe['message'][_0x0a50('0x70')]=_0x393afe[_0x0a50('0x70')];_0x393afe[_0x0a50('0x1e')]['motionChannel']=_0x393afe[_0x0a50('0x70')];_0x393afe[_0x0a50('0x1e')][_0x0a50('0x71')]=_0x0a50('0x56');return respondWithRpcPromise(_0x0a50('0x72'),_0x0a50('0x72'),{'event':_0x0a50('0x73'),'message':_0x393afe[_0x0a50('0x1e')]},client9002)[_0x0a50('0x2d')](function(){return _0x393afe;});}return _0x393afe;}return null;})[_0x0a50('0x2d')](respondWithResult(_0x2e692b,null))[_0x0a50('0x50')](handleError(_0x2e692b,null));};var interaction_log=require(_0x0a50('0xf'))(_0x0a50('0x55'));exports['reject']=function(_0x3db19b,_0xb4237a,_0x521ff8){var _0x119dc3={'agent':{},'channel':_0x0a50('0x57')};if(_0x3db19b[_0x0a50('0x51')]['id']){delete _0x3db19b['body']['id'];}_0x3db19b[_0x0a50('0x51')][_0x0a50('0x5b')]=_0x3db19b[_0x0a50('0x51')]['UserId']||_0x3db19b[_0x0a50('0x5c')]['id'];_0x119dc3[_0x0a50('0x6b')]['id']=_0x3db19b['body'][_0x0a50('0x5b')];return db[_0x0a50('0x33')][_0x0a50('0x4f')]({'where':{'id':_0x3db19b[_0x0a50('0x53')]['id'],'UserId':null}})[_0x0a50('0x2d')](handleEntityNotFound(_0xb4237a,null))['then'](function(_0x1a818a){if(_0x1a818a){_0x119dc3[_0x0a50('0x1e')]=_0x1a818a['get']({'plain':!![]});return db[_0x0a50('0x74')]['find']({'where':{'id':_0x1a818a[_0x0a50('0x5e')]}});}return null;})[_0x0a50('0x2d')](handleEntityNotFound(_0xb4237a,null))['then'](function(_0x1ed83b){if(_0x1ed83b){_0x119dc3[_0x0a50('0x75')]=_0x1ed83b['get']({'plain':!![]});interaction_log[_0x0a50('0x17')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3db19b['user']['id'],_0x3db19b['user'][_0x0a50('0x2f')],_0x3db19b[_0x0a50('0x5c')][_0x0a50('0x62')],_0x119dc3['interaction']['id'],_0x3db19b[_0x0a50('0x51')]?JSON['stringify'](_0x3db19b[_0x0a50('0x51')]):_0x0a50('0x76'));return respondWithRpcPromise(_0x0a50('0x77'),_0x0a50('0x78'),_0x119dc3);}return null;})['then'](function(_0x2ab57a){var _0x45cb09=_0x0a50('0x65')+_0x2ab57a[_0x0a50('0x1e')][_0x0a50('0x66')];return db[_0x0a50('0x67')][_0x0a50('0x39')](_0x45cb09,{'type':db[_0x0a50('0x79')]['QueryTypes'][_0x0a50('0x69')],'raw':!![]})[_0x0a50('0x2d')](function(_0x7984da){return _0x7984da;});})[_0x0a50('0x2d')](function(_0x31842c){if(_0x31842c){_0x119dc3[_0x0a50('0x1e')][_0x0a50('0x7a')]=_0x31842c[0x0];if(!_0x3db19b[_0x0a50('0x51')]['UserId'])return;return db[_0x0a50('0x6a')][_0x0a50('0x4f')]({'where':{'id':_0x3db19b[_0x0a50('0x51')]['UserId'],'role':'agent'},'attributes':['id',_0x0a50('0x2f'),_0x0a50('0x7b'),_0x0a50('0x6c'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2ab14a){if(!_0x2ab14a)return null;_0x119dc3['message'][_0x0a50('0x6b')]=_0x2ab14a;return _0x119dc3;})[_0x0a50('0x2d')](function(_0xcae622){if(_0xcae622){_0xcae622[_0x0a50('0x1e')]['interface']=util[_0x0a50('0x59')](_0x0a50('0x7c'),_0x3db19b[_0x0a50('0x5c')]['name']);_0xcae622[_0x0a50('0x1e')]['channel']=_0x119dc3['channel'];_0xcae622[_0x0a50('0x1e')][_0x0a50('0x7d')]=_0x119dc3[_0x0a50('0x70')];_0xcae622[_0x0a50('0x1e')][_0x0a50('0x71')]=_0x0a50('0x2a');respondWithRpcPromise(_0x0a50('0x72'),_0x0a50('0x72'),{'event':_0x0a50('0x7e'),'message':_0xcae622[_0x0a50('0x1e')]},client9002);return _0x119dc3;}return null;})[_0x0a50('0x2d')](respondWithResult(_0xb4237a,null))[_0x0a50('0x50')](handleError(_0xb4237a,null));};exports[_0x0a50('0x7f')]=function(_0x19b4ca,_0x2b1550){var _0x27ecd2;return db[_0x0a50('0x33')][_0x0a50('0x7f')](_0x19b4ca[_0x0a50('0x51')],{})['then'](function(_0x2522a1){_0x27ecd2=_0x2522a1;return db['CmContact']['findOne']({'where':{'id':_0x27ecd2['ContactId']}});})['then'](function(_0x5fbec0){if(_['isNil'](_0x5fbec0)){return;}else{_0x27ecd2[_0x0a50('0x57')]=_0x5fbec0['fax'];return db[_0x0a50('0x80')][_0x0a50('0x81')]({'where':{'id':_0x27ecd2[_0x0a50('0x82')]}});}})[_0x0a50('0x2d')](function(_0x2fbc41){return respondWithRpcPromise(_0x0a50('0x83'),_0x0a50('0x83'),{'FaxAccountId':_[_0x0a50('0x5f')](_0x19b4ca[_0x0a50('0x51')])?undefined:_0x19b4ca[_0x0a50('0x51')][_0x0a50('0x84')],'path':_[_0x0a50('0x5f')](_0x2fbc41)?undefined:util[_0x0a50('0x59')]('/var/opt/motion2/server/files/attachments/%s',_0x2fbc41[_0x0a50('0x85')]),'fax':_[_0x0a50('0x5f')](_0x27ecd2['fax'])?undefined:_0x27ecd2[_0x0a50('0x57')],'AttachmentId':_0x27ecd2['AttachmentId']},client9002);})[_0x0a50('0x2d')](respondWithResult(_0x2b1550,0xc9))[_0x0a50('0x50')](handleError(_0x2b1550,null));};exports['download']=function(_0x40e12c,_0x351d85){var _0x54bcf8=path[_0x0a50('0x86')](config[_0x0a50('0x87')],_0x0a50('0x88'),_0x0a50('0x89'),'attachments');return db[_0x0a50('0x33')][_0x0a50('0x4f')]({'where':{'id':_0x40e12c[_0x0a50('0x53')]['id']},'include':[{'model':db[_0x0a50('0x80')],'as':_0x0a50('0x80')}]})[_0x0a50('0x2d')](handleEntityNotFound(_0x351d85,null))['then'](function(_0x598e0b){if(_0x598e0b){return _0x351d85[_0x0a50('0x8a')](path['join'](_0x54bcf8,_0x598e0b['Attachment'][_0x0a50('0x85')]));}})[_0x0a50('0x50')](handleError(_0x351d85,null));};
\ No newline at end of file
+var _0x6556=['client','request','then','info','debug','request\x20sent','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','FaxMessage','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','body','describe','fax-interactions','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','isNil','read1stAt','format','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','channel','motionChannel','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','contact','fullname','SIP/%s','event','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','http'];(function(_0x1a14e9,_0x243839){var _0x3c6d83=function(_0x253cbd){while(--_0x253cbd){_0x1a14e9['push'](_0x1a14e9['shift']());}};_0x3c6d83(++_0x243839);}(_0x6556,0x74));var _0x6655=function(_0x3d2e69,_0x2dabb9){_0x3d2e69=_0x3d2e69-0x0;var _0x108bb4=_0x6556[_0x3d2e69];return _0x108bb4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6655('0x0'));var zipdir=require(_0x6655('0x1'));var jsonpatch=require(_0x6655('0x2'));var rp=require(_0x6655('0x3'));var moment=require(_0x6655('0x4'));var BPromise=require(_0x6655('0x5'));var Mustache=require(_0x6655('0x6'));var util=require(_0x6655('0x7'));var path=require(_0x6655('0x8'));var sox=require(_0x6655('0x9'));var csv=require(_0x6655('0xa'));var ejs=require(_0x6655('0xb'));var fs=require('fs');var fs_extra=require(_0x6655('0xc'));var _=require(_0x6655('0xd'));var squel=require(_0x6655('0xe'));var crypto=require(_0x6655('0xf'));var jsforce=require(_0x6655('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6655('0xa'));var querystring=require(_0x6655('0x11'));var Papa=require(_0x6655('0x12'));var Redis=require('ioredis');var authService=require(_0x6655('0x13'));var qs=require(_0x6655('0x14'));var as=require(_0x6655('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6655('0x16'))(_0x6655('0x17'));var utils=require(_0x6655('0x18'));var config=require(_0x6655('0x19'));var licenseUtil=require(_0x6655('0x1a'));var db=require(_0x6655('0x1b'))['db'];config[_0x6655('0x1c')]=_[_0x6655('0x1d')](config[_0x6655('0x1c')],{'host':_0x6655('0x1e'),'port':0x18eb});var socket=require(_0x6655('0x1f'))(new Redis(config[_0x6655('0x1c')]));require(_0x6655('0x20'))['register'](socket);var jayson=require(_0x6655('0x21'));var client=jayson['client'][_0x6655('0x22')]({'port':0x232c});var client9002=jayson[_0x6655('0x23')][_0x6655('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x452731,_0x2f51cf,_0x3edaa4,_0x5798ca){return new BPromise(function(_0xf717d2,_0x2ada23){var _0x4a5c90=_0x5798ca||client;return _0x4a5c90[_0x6655('0x24')](_0x452731,_0x3edaa4)[_0x6655('0x25')](function(_0x50dcad){logger[_0x6655('0x26')]('FaxMessage,\x20%s,\x20%s',_0x2f51cf,'request\x20sent');logger[_0x6655('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2f51cf,_0x6655('0x28'),JSON['stringify'](_0x50dcad));if(_0x50dcad[_0x6655('0x29')]){if(_0x50dcad[_0x6655('0x29')][_0x6655('0x2a')]===0x1f4){logger[_0x6655('0x29')](_0x6655('0x2b'),_0x2f51cf,_0x50dcad['error'][_0x6655('0x2c')]);return _0x2ada23(_0x50dcad[_0x6655('0x29')][_0x6655('0x2c')]);}logger[_0x6655('0x29')](_0x6655('0x2b'),_0x2f51cf,_0x50dcad[_0x6655('0x29')][_0x6655('0x2c')]);return _0xf717d2(_0x50dcad[_0x6655('0x29')][_0x6655('0x2c')]);}else{logger[_0x6655('0x26')](_0x6655('0x2b'),_0x2f51cf,_0x6655('0x28'));_0xf717d2(_0x50dcad[_0x6655('0x2d')][_0x6655('0x2c')]);}})[_0x6655('0x2e')](function(_0x22ac18){logger[_0x6655('0x29')]('FaxMessage,\x20%s,\x20%s',_0x2f51cf,_0x22ac18);_0x2ada23(_0x22ac18);});});}function respondWithStatusCode(_0x5e1391,_0x1e2010){_0x1e2010=_0x1e2010||0xcc;return function(_0x226cef){if(_0x226cef){return _0x5e1391['sendStatus'](_0x1e2010);}return _0x5e1391['status'](_0x1e2010)['end']();};}function respondWithResult(_0x1118fd,_0x4b4127){_0x4b4127=_0x4b4127||0xc8;return function(_0x26a06e){if(_0x26a06e){return _0x1118fd[_0x6655('0x2f')](_0x4b4127)[_0x6655('0x30')](_0x26a06e);}};}function respondWithFilteredResult(_0x3d51f2,_0x5ee84d){return function(_0x4fb963){if(_0x4fb963){var _0x358644=typeof _0x5ee84d[_0x6655('0x31')]===_0x6655('0x32')&&typeof _0x5ee84d['limit']==='undefined';var _0xa6b61=_0x4fb963[_0x6655('0x33')];var _0x565d3a=_0x358644?0x0:_0x5ee84d['offset'];var _0x194612=_0x358644?_0x4fb963[_0x6655('0x33')]:_0x5ee84d[_0x6655('0x31')]+_0x5ee84d[_0x6655('0x34')];var _0x2814f4;if(_0x194612>=_0xa6b61){_0x194612=_0xa6b61;_0x2814f4=0xc8;}else{_0x2814f4=0xce;}_0x3d51f2[_0x6655('0x2f')](_0x2814f4);return _0x3d51f2[_0x6655('0x35')](_0x6655('0x36'),_0x565d3a+'-'+_0x194612+'/'+_0xa6b61)[_0x6655('0x30')](_0x4fb963);}return null;};}function patchUpdates(_0xdbdad0){return function(_0x32b6e4){try{jsonpatch[_0x6655('0x37')](_0x32b6e4,_0xdbdad0,!![]);}catch(_0x37be06){return BPromise[_0x6655('0x38')](_0x37be06);}return _0x32b6e4[_0x6655('0x39')]();};}function saveUpdates(_0x205cb9,_0x528632){return function(_0x69a6db){if(_0x69a6db){return _0x69a6db[_0x6655('0x3a')](_0x205cb9)[_0x6655('0x25')](function(_0x13430b){return _0x13430b;});}return null;};}function removeEntity(_0x41cbd6,_0x15286e){return function(_0x28d76b){if(_0x28d76b){return _0x28d76b[_0x6655('0x3b')]()[_0x6655('0x25')](function(){_0x41cbd6['status'](0xcc)[_0x6655('0x3c')]();});}};}function handleEntityNotFound(_0x4c791f,_0x49058a){return function(_0x22b3c8){if(!_0x22b3c8){_0x4c791f['sendStatus'](0x194);}return _0x22b3c8;};}function handleError(_0x4a450f,_0x51e3ca){_0x51e3ca=_0x51e3ca||0x1f4;return function(_0x42408f){logger['error'](_0x42408f[_0x6655('0x3d')]);if(_0x42408f[_0x6655('0x3e')]){delete _0x42408f['name'];}_0x4a450f['status'](_0x51e3ca)[_0x6655('0x3f')](_0x42408f);};}exports[_0x6655('0x40')]=function(_0x4ff2aa,_0x4de0c8){var _0x5044cf={},_0x2bfa8f={},_0x203ef2={'count':0x0,'rows':[]};var _0x56b5ac=_[_0x6655('0x41')](db[_0x6655('0x42')][_0x6655('0x43')],function(_0x12fa4e){return{'name':_0x12fa4e['fieldName'],'type':_0x12fa4e[_0x6655('0x44')][_0x6655('0x45')]};});_0x2bfa8f[_0x6655('0x46')]=_[_0x6655('0x41')](_0x56b5ac,_0x6655('0x3e'));_0x2bfa8f['query']=_[_0x6655('0x47')](_0x4ff2aa[_0x6655('0x48')]);_0x2bfa8f['filters']=_['intersection'](_0x2bfa8f[_0x6655('0x46')],_0x2bfa8f[_0x6655('0x48')]);_0x5044cf[_0x6655('0x49')]=_[_0x6655('0x4a')](_0x2bfa8f[_0x6655('0x46')],qs[_0x6655('0x4b')](_0x4ff2aa[_0x6655('0x48')]['fields']));_0x5044cf[_0x6655('0x49')]=_0x5044cf['attributes'][_0x6655('0x4c')]?_0x5044cf[_0x6655('0x49')]:_0x2bfa8f[_0x6655('0x46')];if(!_0x4ff2aa[_0x6655('0x48')][_0x6655('0x4d')](_0x6655('0x4e'))){_0x5044cf['limit']=qs[_0x6655('0x34')](_0x4ff2aa[_0x6655('0x48')][_0x6655('0x34')]);_0x5044cf[_0x6655('0x31')]=qs[_0x6655('0x31')](_0x4ff2aa[_0x6655('0x48')][_0x6655('0x31')]);}_0x5044cf[_0x6655('0x4f')]=qs[_0x6655('0x50')](_0x4ff2aa[_0x6655('0x48')][_0x6655('0x50')]);_0x5044cf[_0x6655('0x51')]=qs[_0x6655('0x52')](_[_0x6655('0x53')](_0x4ff2aa[_0x6655('0x48')],_0x2bfa8f[_0x6655('0x52')]),_0x56b5ac);if(_0x4ff2aa[_0x6655('0x48')][_0x6655('0x54')]){_0x5044cf['where']=_[_0x6655('0x55')](_0x5044cf[_0x6655('0x51')],{'$or':_[_0x6655('0x41')](_0x56b5ac,function(_0x593a3b){if(_0x593a3b['type']!==_0x6655('0x56')){var _0x748ef={};_0x748ef[_0x593a3b[_0x6655('0x3e')]]={'$like':'%'+_0x4ff2aa['query'][_0x6655('0x54')]+'%'};return _0x748ef;}})});}_0x5044cf=_[_0x6655('0x55')]({},_0x5044cf,_0x4ff2aa[_0x6655('0x57')]);var _0x3744e7={'where':_0x5044cf[_0x6655('0x51')]};return db[_0x6655('0x42')][_0x6655('0x33')](_0x3744e7)[_0x6655('0x25')](function(_0x3fdbb0){_0x203ef2[_0x6655('0x33')]=_0x3fdbb0;if(_0x4ff2aa[_0x6655('0x48')]['includeAll']){_0x5044cf['include']=[{'all':!![]}];}return db[_0x6655('0x42')][_0x6655('0x58')](_0x5044cf);})[_0x6655('0x25')](function(_0x208124){_0x203ef2[_0x6655('0x59')]=_0x208124;return _0x203ef2;})[_0x6655('0x25')](respondWithFilteredResult(_0x4de0c8,_0x5044cf))[_0x6655('0x2e')](handleError(_0x4de0c8,null));};exports[_0x6655('0x5a')]=function(_0x385080,_0x3bb5f9){var _0xf2eb69={'raw':!![],'where':{'id':_0x385080[_0x6655('0x5b')]['id']}},_0x4d8734={};_0x4d8734[_0x6655('0x46')]=_[_0x6655('0x47')](db[_0x6655('0x42')][_0x6655('0x43')]);_0x4d8734['query']=_[_0x6655('0x47')](_0x385080[_0x6655('0x48')]);_0x4d8734[_0x6655('0x52')]=_[_0x6655('0x4a')](_0x4d8734[_0x6655('0x46')],_0x4d8734['query']);_0xf2eb69['attributes']=_['intersection'](_0x4d8734[_0x6655('0x46')],qs[_0x6655('0x4b')](_0x385080[_0x6655('0x48')][_0x6655('0x4b')]));_0xf2eb69[_0x6655('0x49')]=_0xf2eb69[_0x6655('0x49')][_0x6655('0x4c')]?_0xf2eb69[_0x6655('0x49')]:_0x4d8734['model'];if(_0x385080[_0x6655('0x48')][_0x6655('0x5c')]){_0xf2eb69[_0x6655('0x5d')]=[{'all':!![]}];}_0xf2eb69=_[_0x6655('0x55')]({},_0xf2eb69,_0x385080['options']);return db['FaxMessage'][_0x6655('0x5e')](_0xf2eb69)[_0x6655('0x25')](handleEntityNotFound(_0x3bb5f9,null))[_0x6655('0x25')](respondWithResult(_0x3bb5f9,null))[_0x6655('0x2e')](handleError(_0x3bb5f9,null));};exports[_0x6655('0x3a')]=function(_0x43495f,_0x5f1373){if(_0x43495f[_0x6655('0x5f')]['id']){delete _0x43495f[_0x6655('0x5f')]['id'];}return db[_0x6655('0x42')][_0x6655('0x5e')]({'where':{'id':_0x43495f['params']['id']}})[_0x6655('0x25')](handleEntityNotFound(_0x5f1373,null))['then'](saveUpdates(_0x43495f[_0x6655('0x5f')],null))[_0x6655('0x25')](respondWithResult(_0x5f1373,null))[_0x6655('0x2e')](handleError(_0x5f1373,null));};exports[_0x6655('0x3b')]=function(_0x33188d,_0x145df8){return db[_0x6655('0x42')]['find']({'where':{'id':_0x33188d[_0x6655('0x5b')]['id']}})[_0x6655('0x25')](handleEntityNotFound(_0x145df8,null))['then'](removeEntity(_0x145df8,null))[_0x6655('0x2e')](handleError(_0x145df8,null));};exports[_0x6655('0x60')]=function(_0x49e6aa,_0x5c1e7f){return db[_0x6655('0x42')][_0x6655('0x60')]()[_0x6655('0x25')](respondWithResult(_0x5c1e7f,null))[_0x6655('0x2e')](handleError(_0x5c1e7f,null));};var interaction_log=require(_0x6655('0x16'))(_0x6655('0x61'));exports['accept']=function(_0x59d777,_0x43ce9b,_0x25c890){var _0x5f237e={'agent':{},'channel':_0x6655('0x62')};if(_0x59d777[_0x6655('0x5f')]['id']){delete _0x59d777[_0x6655('0x5f')]['id'];}_0x59d777['body']['read']=!![];_0x59d777[_0x6655('0x5f')][_0x6655('0x63')]=moment()['format'](_0x6655('0x64'));_0x59d777[_0x6655('0x5f')][_0x6655('0x65')]=_0x59d777['body'][_0x6655('0x65')]||_0x59d777[_0x6655('0x66')]['id'];_0x5f237e[_0x6655('0x67')]['id']=_0x59d777[_0x6655('0x5f')][_0x6655('0x65')];return db[_0x6655('0x42')][_0x6655('0x5e')]({'where':{'id':_0x59d777[_0x6655('0x5b')]['id'],'UserId':null}})[_0x6655('0x25')](handleEntityNotFound(_0x43ce9b,null))[_0x6655('0x25')](saveUpdates(_0x59d777[_0x6655('0x5f')],null))[_0x6655('0x25')](function(_0x2102a4){if(_0x2102a4){_0x5f237e[_0x6655('0x2c')]=_0x2102a4[_0x6655('0x68')]({'plain':!![]});return db['FaxInteraction'][_0x6655('0x5e')]({'where':{'id':_0x2102a4[_0x6655('0x69')]}});}return null;})[_0x6655('0x25')](handleEntityNotFound(_0x43ce9b,null))[_0x6655('0x25')](function(_0x5a5dd1){if(_0x5a5dd1){return _0x5a5dd1[_0x6655('0x3a')]({'UserId':_0x59d777[_0x6655('0x5f')]['UserId'],'read1stAt':_[_0x6655('0x6a')](_0x5a5dd1[_0x6655('0x6b')])?moment()[_0x6655('0x6c')](_0x6655('0x64')):undefined});}return null;})[_0x6655('0x25')](function(_0x38cb55){if(_0x38cb55){_0x5f237e[_0x6655('0x6d')]=_0x38cb55['get']({'plain':!![]});interaction_log[_0x6655('0x26')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59d777[_0x6655('0x66')]['id'],_0x59d777['user'][_0x6655('0x3e')],_0x59d777[_0x6655('0x66')]['role'],_0x5f237e[_0x6655('0x6d')]['id'],_0x59d777[_0x6655('0x5f')]?JSON['stringify'](_0x59d777[_0x6655('0x5f')]):_0x6655('0x6e'));return respondWithRpcPromise(_0x6655('0x6f'),_0x6655('0x70'),_0x5f237e);}return null;})['then'](function(_0x167b1e){var _0x256d7b=_0x6655('0x71')+_0x167b1e[_0x6655('0x2c')][_0x6655('0x72')];return db[_0x6655('0x73')]['query'](_0x256d7b,{'type':db[_0x6655('0x74')][_0x6655('0x75')][_0x6655('0x76')],'raw':!![]})[_0x6655('0x25')](function(_0x3d5786){return _0x3d5786;});})[_0x6655('0x25')](function(_0x49c509){if(_0x49c509){_0x5f237e[_0x6655('0x2c')]['contact']=_0x49c509[0x0];if(!_0x59d777[_0x6655('0x5f')][_0x6655('0x65')])return;return db[_0x6655('0x77')][_0x6655('0x5e')]({'where':{'id':_0x59d777[_0x6655('0x5f')]['UserId'],'role':_0x6655('0x67')},'attributes':['id',_0x6655('0x3e'),'fullname',_0x6655('0x78'),_0x6655('0x79')],'raw':!![]});}return null;})['then'](function(_0x2228fc){if(!_0x2228fc)return null;_0x5f237e['message'][_0x6655('0x67')]=_0x2228fc;return _0x5f237e;})['then'](function(_0xaf3a9e){if(_0xaf3a9e){if(_0x59d777[_0x6655('0x5f')][_0x6655('0x7a')]){_0x5f237e[_0x6655('0x2c')][_0x6655('0x7b')]=util[_0x6655('0x6c')]('SIP/%s',_0x59d777[_0x6655('0x66')]['name']);_0x5f237e['message'][_0x6655('0x7c')]=_0x5f237e[_0x6655('0x7c')];_0x5f237e[_0x6655('0x2c')][_0x6655('0x7d')]=_0x5f237e['channel'];_0x5f237e[_0x6655('0x2c')]['event']=_0x6655('0x7e');return respondWithRpcPromise(_0x6655('0x7f'),_0x6655('0x7f'),{'event':_0x6655('0x80'),'message':_0x5f237e[_0x6655('0x2c')]},client9002)[_0x6655('0x25')](function(){return _0x5f237e;});}return _0x5f237e;}return null;})[_0x6655('0x25')](respondWithResult(_0x43ce9b,null))[_0x6655('0x2e')](handleError(_0x43ce9b,null));};var interaction_log=require(_0x6655('0x16'))(_0x6655('0x61'));exports[_0x6655('0x38')]=function(_0x34c25f,_0x34c9e5,_0xef829a){var _0x2f194f={'agent':{},'channel':_0x6655('0x62')};if(_0x34c25f['body']['id']){delete _0x34c25f[_0x6655('0x5f')]['id'];}_0x34c25f['body'][_0x6655('0x65')]=_0x34c25f[_0x6655('0x5f')]['UserId']||_0x34c25f['user']['id'];_0x2f194f[_0x6655('0x67')]['id']=_0x34c25f[_0x6655('0x5f')][_0x6655('0x65')];return db[_0x6655('0x42')]['find']({'where':{'id':_0x34c25f['params']['id'],'UserId':null}})[_0x6655('0x25')](handleEntityNotFound(_0x34c9e5,null))['then'](function(_0x29355c){if(_0x29355c){_0x2f194f[_0x6655('0x2c')]=_0x29355c['get']({'plain':!![]});return db['FaxInteraction'][_0x6655('0x5e')]({'where':{'id':_0x29355c['FaxInteractionId']}});}return null;})[_0x6655('0x25')](handleEntityNotFound(_0x34c9e5,null))[_0x6655('0x25')](function(_0x4d4898){if(_0x4d4898){_0x2f194f['interaction']=_0x4d4898[_0x6655('0x68')]({'plain':!![]});interaction_log['info'](_0x6655('0x81'),_0x34c25f[_0x6655('0x66')]['id'],_0x34c25f[_0x6655('0x66')]['name'],_0x34c25f['user'][_0x6655('0x82')],_0x2f194f['interaction']['id'],_0x34c25f[_0x6655('0x5f')]?JSON['stringify'](_0x34c25f['body']):'null');return respondWithRpcPromise('RejectMessage',_0x6655('0x83'),_0x2f194f);}return null;})[_0x6655('0x25')](function(_0x14d8dc){var _0x387982='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14d8dc['message'][_0x6655('0x72')];return db['sequelize'][_0x6655('0x48')](_0x387982,{'type':db['Sequelize']['QueryTypes'][_0x6655('0x76')],'raw':!![]})[_0x6655('0x25')](function(_0x5db668){return _0x5db668;});})[_0x6655('0x25')](function(_0xdddaa5){if(_0xdddaa5){_0x2f194f[_0x6655('0x2c')][_0x6655('0x84')]=_0xdddaa5[0x0];if(!_0x34c25f['body'][_0x6655('0x65')])return;return db[_0x6655('0x77')]['find']({'where':{'id':_0x34c25f['body'][_0x6655('0x65')],'role':_0x6655('0x67')},'attributes':['id',_0x6655('0x3e'),_0x6655('0x85'),_0x6655('0x78'),_0x6655('0x79')],'raw':!![]});}return null;})['then'](function(_0x252b26){if(!_0x252b26)return null;_0x2f194f['message']['agent']=_0x252b26;return _0x2f194f;})[_0x6655('0x25')](function(_0x58eef3){if(_0x58eef3){_0x58eef3[_0x6655('0x2c')][_0x6655('0x7b')]=util['format'](_0x6655('0x86'),_0x34c25f[_0x6655('0x66')]['name']);_0x58eef3[_0x6655('0x2c')]['channel']=_0x2f194f[_0x6655('0x7c')];_0x58eef3[_0x6655('0x2c')][_0x6655('0x7d')]=_0x2f194f[_0x6655('0x7c')];_0x58eef3[_0x6655('0x2c')][_0x6655('0x87')]=_0x6655('0x38');respondWithRpcPromise(_0x6655('0x7f'),_0x6655('0x7f'),{'event':_0x6655('0x88'),'message':_0x58eef3[_0x6655('0x2c')]},client9002);return _0x2f194f;}return null;})['then'](respondWithResult(_0x34c9e5,null))[_0x6655('0x2e')](handleError(_0x34c9e5,null));};exports[_0x6655('0x89')]=function(_0x232d3b,_0x38c2cf){var _0x46be0b;return db[_0x6655('0x42')][_0x6655('0x89')](_0x232d3b[_0x6655('0x5f')],{})[_0x6655('0x25')](function(_0x5736cf){_0x46be0b=_0x5736cf;return db[_0x6655('0x8a')][_0x6655('0x8b')]({'where':{'id':_0x46be0b[_0x6655('0x72')]}});})['then'](function(_0x3bf8b8){if(_[_0x6655('0x6a')](_0x3bf8b8)){return;}else{_0x46be0b[_0x6655('0x62')]=_0x3bf8b8[_0x6655('0x62')];return db[_0x6655('0x8c')][_0x6655('0x8b')]({'where':{'id':_0x46be0b[_0x6655('0x8d')]}});}})[_0x6655('0x25')](function(_0x1cc68f){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x6655('0x6a')](_0x232d3b[_0x6655('0x5f')])?undefined:_0x232d3b['body'][_0x6655('0x8e')],'path':_[_0x6655('0x6a')](_0x1cc68f)?undefined:util['format'](_0x6655('0x8f'),_0x1cc68f[_0x6655('0x90')]),'fax':_[_0x6655('0x6a')](_0x46be0b[_0x6655('0x62')])?undefined:_0x46be0b[_0x6655('0x62')],'AttachmentId':_0x46be0b[_0x6655('0x8d')]},client9002);})[_0x6655('0x25')](respondWithResult(_0x38c2cf,0xc9))[_0x6655('0x2e')](handleError(_0x38c2cf,null));};exports[_0x6655('0x91')]=function(_0x658622,_0x38c6be){var _0x1f8b60=path[_0x6655('0x92')](config[_0x6655('0x93')],_0x6655('0x94'),_0x6655('0x95'),_0x6655('0x96'));return db['FaxMessage']['find']({'where':{'id':_0x658622[_0x6655('0x5b')]['id']},'include':[{'model':db['Attachment'],'as':_0x6655('0x8c')}]})[_0x6655('0x25')](handleEntityNotFound(_0x38c6be,null))[_0x6655('0x25')](function(_0x2a8872){if(_0x2a8872){return _0x38c6be['download'](path[_0x6655('0x92')](_0x1f8b60,_0x2a8872[_0x6655('0x8c')][_0x6655('0x90')]));}})['catch'](handleError(_0x38c6be,null));};
\ No newline at end of file
index a929c22..4c48cbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5226=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x246af3,_0x2d5530){var _0xdb2b6b=function(_0x54276d){while(--_0x54276d){_0x246af3['push'](_0x246af3['shift']());}};_0xdb2b6b(++_0x2d5530);}(_0x5226,0x137));var _0x6522=function(_0x561e73,_0x1d41c5){_0x561e73=_0x561e73-0x0;var _0x2b000e=_0x5226[_0x561e73];return _0x2b000e;};'use strict';var EventEmitter=require(_0x6522('0x0'));var FaxMessage=require(_0x6522('0x1'))['db'][_0x6522('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6522('0x3')](0x0);var events={'afterCreate':_0x6522('0x4'),'afterUpdate':'update','afterDestroy':_0x6522('0x5')};function emitEvent(_0x43f913){return function(_0x12dffe,_0x48d4db,_0x228009){FaxMessageEvents['emit'](_0x43f913+':'+_0x12dffe['id'],_0x12dffe);FaxMessageEvents[_0x6522('0x6')](_0x43f913,_0x12dffe);_0x228009(null);};}for(var e in events){if(events[_0x6522('0x7')](e)){var event=events[e];FaxMessage[_0x6522('0x8')](e,emitEvent(event));}}module[_0x6522('0x9')]=FaxMessageEvents;
\ No newline at end of file
+var _0x8921=['exports','events','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x568414,_0x307a08){var _0x475d6c=function(_0x127f35){while(--_0x127f35){_0x568414['push'](_0x568414['shift']());}};_0x475d6c(++_0x307a08);}(_0x8921,0x9a));var _0x1892=function(_0x1e57e5,_0x503953){_0x1e57e5=_0x1e57e5-0x0;var _0x169938=_0x8921[_0x1e57e5];return _0x169938;};'use strict';var EventEmitter=require(_0x1892('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x1892('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1892('0x2')](0x0);var events={'afterCreate':_0x1892('0x3'),'afterUpdate':_0x1892('0x4'),'afterDestroy':_0x1892('0x5')};function emitEvent(_0x110b75){return function(_0x28a89b,_0x15aa1b,_0x2790a1){FaxMessageEvents[_0x1892('0x6')](_0x110b75+':'+_0x28a89b['id'],_0x28a89b);FaxMessageEvents[_0x1892('0x6')](_0x110b75,_0x28a89b);_0x2790a1(null);};}for(var e in events){if(events[_0x1892('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1892('0x8')]=FaxMessageEvents;
\ No newline at end of file
index 6324a7c..1d672c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71a7=['direction','toLowerCase','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT'];(function(_0x2eea92,_0x4f1804){var _0x52bd4c=function(_0x3bc017){while(--_0x3bc017){_0x2eea92['push'](_0x2eea92['shift']());}};_0x52bd4c(++_0x4f1804);}(_0x71a7,0x124));var _0x771a=function(_0x2e46c4,_0xa6838e){_0x2e46c4=_0x2e46c4-0x0;var _0x4a2f37=_0x71a7[_0x2e46c4];return _0x4a2f37;};'use strict';var _=require(_0x771a('0x0'));var util=require(_0x771a('0x1'));var logger=require(_0x771a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x771a('0x3'));var rp=require(_0x771a('0x4'));var fs=require('fs');var path=require(_0x771a('0x5'));var rimraf=require(_0x771a('0x6'));var config=require(_0x771a('0x7'));var attributes=require(_0x771a('0x8'));module[_0x771a('0x9')]=function(_0x2e12e8,_0x1a9077){return _0x2e12e8[_0x771a('0xa')](_0x771a('0xb'),attributes,{'tableName':_0x771a('0xc'),'paranoid':![],'indexes':[{'name':_0x771a('0xd'),'fields':[_0x771a('0xe')],'type':_0x771a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x345667,_0x2a0479,_0x184d11){var _0x588b74=_0x2e12e8['models'];var _0x349dbe=_0x345667['get']({'plain':!![]});if(_0x349dbe[_0x771a('0x10')][_0x771a('0x11')]()==='in'||_0x349dbe[_0x771a('0x10')][_0x771a('0x11')]()==='out'&&!_0x349dbe['secret']&&!_[_0x771a('0x12')](_0x349dbe[_0x771a('0x13')])){_0x588b74[_0x771a('0x14')][_0x771a('0x15')]({'where':{'id':_0x349dbe[_0x771a('0x16')]}})[_0x771a('0x17')](function(_0xac6f26){if(_0xac6f26){_0xac6f26[_0x771a('0x18')]({'lastMsgAt':_0x349dbe[_0x771a('0x19')],'lastMsgDirection':_0x349dbe[_0x771a('0x10')]['toLowerCase']()});}})['catch'](function(_0x467218){console[_0x771a('0x1a')](_0x467218);});}_0x184d11();}},'charset':_0x771a('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb6cf=['body','FULLTEXT','toLowerCase','out','secret','isNil','FaxInteraction','findOne','then','update','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages'];(function(_0x4f9e44,_0x22d5ff){var _0x4af341=function(_0x9ec6d){while(--_0x9ec6d){_0x4f9e44['push'](_0x4f9e44['shift']());}};_0x4af341(++_0x22d5ff);}(_0xb6cf,0xb7));var _0xfb6c=function(_0x1ac41c,_0x1dacbf){_0x1ac41c=_0x1ac41c-0x0;var _0x561d64=_0xb6cf[_0x1ac41c];return _0x561d64;};'use strict';var _=require('lodash');var util=require(_0xfb6c('0x0'));var logger=require(_0xfb6c('0x1'))(_0xfb6c('0x2'));var moment=require(_0xfb6c('0x3'));var BPromise=require(_0xfb6c('0x4'));var rp=require(_0xfb6c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb6c('0x6'));var config=require(_0xfb6c('0x7'));var attributes=require(_0xfb6c('0x8'));module[_0xfb6c('0x9')]=function(_0x24d2cc,_0x5bd4e0){return _0x24d2cc[_0xfb6c('0xa')]('FaxMessage',attributes,{'tableName':_0xfb6c('0xb'),'paranoid':![],'indexes':[{'name':_0xfb6c('0xc'),'fields':[_0xfb6c('0xd')],'type':_0xfb6c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x361e16,_0x3c4a68,_0x5957c3){var _0x2fdc1c=_0x24d2cc['models'];var _0x433b91=_0x361e16['get']({'plain':!![]});if(_0x433b91['direction'][_0xfb6c('0xf')]()==='in'||_0x433b91['direction'][_0xfb6c('0xf')]()===_0xfb6c('0x10')&&!_0x433b91[_0xfb6c('0x11')]&&!_[_0xfb6c('0x12')](_0x433b91['UserId'])){_0x2fdc1c[_0xfb6c('0x13')][_0xfb6c('0x14')]({'where':{'id':_0x433b91['FaxInteractionId']}})[_0xfb6c('0x15')](function(_0xd482ab){if(_0xd482ab){_0xd482ab[_0xfb6c('0x16')]({'lastMsgAt':_0x433b91['createdAt'],'lastMsgDirection':_0x433b91[_0xfb6c('0x17')]['toLowerCase']()});}})[_0xfb6c('0x18')](function(_0x456c40){console[_0xfb6c('0x19')](_0x456c40);});}_0x5957c3();}},'charset':_0xfb6c('0x1a'),'collate':_0xfb6c('0x1b')});};
\ No newline at end of file
index 89c0fea..8b1beb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668b=['./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body','raw','UpdateFaxMessage','update','options','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x1ee5b6,_0x2e072f){var _0x45715a=function(_0x2dd186){while(--_0x2dd186){_0x1ee5b6['push'](_0x1ee5b6['shift']());}};_0x45715a(++_0x2e072f);}(_0x668b,0x140));var _0xb668=function(_0x589248,_0x31dea3){_0x589248=_0x589248-0x0;var _0x486750=_0x668b[_0x589248];return _0x486750;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});config[_0xb668('0xa')]=_[_0xb668('0xb')](config[_0xb668('0xa')],{'host':_0xb668('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb668('0xa')]));require(_0xb668('0xd'))[_0xb668('0xe')](socket);function respondWithRpcPromise(_0x16d50d,_0x39b79c,_0x3606a7){return new BPromise(function(_0x45bc39,_0x3616e9){return client['request'](_0x16d50d,_0x3606a7)[_0xb668('0xf')](function(_0x27dbf7){logger[_0xb668('0x10')](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));logger[_0xb668('0x13')](_0xb668('0x14'),_0x39b79c,_0xb668('0x12'),JSON[_0xb668('0x15')](_0x27dbf7));if(_0x27dbf7[_0xb668('0x16')]){if(_0x27dbf7[_0xb668('0x16')][_0xb668('0x17')]===0x1f4){logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x3616e9(_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);}logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x45bc39(_0x27dbf7['error'][_0xb668('0x18')]);}else{logger['info'](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));_0x45bc39(_0x27dbf7['result'][_0xb668('0x18')]);}})[_0xb668('0x19')](function(_0x53ff78){logger[_0xb668('0x16')]('FaxMessage,\x20%s,\x20%s',_0x39b79c,_0x53ff78);_0x3616e9(_0x53ff78);});});}exports[_0xb668('0x1a')]=function(_0x178a5d){var _0x253ba5=this;return new Promise(function(_0x12805a,_0x5d33ae){return db[_0xb668('0x1b')][_0xb668('0x1c')](_0x178a5d[_0xb668('0x1d')],{'raw':_0x178a5d['options']?_0x178a5d['options'][_0xb668('0x1e')]===undefined?!![]:![]:!![]})[_0xb668('0xf')](function(_0x517eee){logger[_0xb668('0x10')]('CreateFaxMessage',_0x178a5d);logger[_0xb668('0x13')]('CreateFaxMessage',_0x178a5d,JSON[_0xb668('0x15')](_0x517eee));_0x12805a(_0x517eee);})[_0xb668('0x19')](function(_0x3f84c7){logger[_0xb668('0x16')](_0xb668('0x1a'),_0x3f84c7[_0xb668('0x18')],_0x178a5d);_0x5d33ae(_0x253ba5['error'](0x1f4,_0x3f84c7[_0xb668('0x18')]));});});};exports[_0xb668('0x1f')]=function(_0x2ab8c2){var _0x49abfd=this;return new Promise(function(_0x5e0cee,_0xe62fce){return db[_0xb668('0x1b')][_0xb668('0x20')](_0x2ab8c2['body'],{'raw':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab8c2['options']?_0x2ab8c2['options'][_0xb668('0x22')]||null:null,'attributes':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2['options'][_0xb668('0x23')]||null:null,'limit':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x24')]||null:null})[_0xb668('0xf')](function(_0x5f36b5){logger[_0xb668('0x10')](_0xb668('0x1f'),_0x2ab8c2);logger['debug'](_0xb668('0x1f'),_0x2ab8c2,JSON['stringify'](_0x5f36b5));_0x5e0cee(_0x5f36b5);})[_0xb668('0x19')](function(_0x406cc5){logger[_0xb668('0x16')](_0xb668('0x1f'),_0x406cc5[_0xb668('0x18')],_0x2ab8c2);_0xe62fce(_0x49abfd[_0xb668('0x16')](0x1f4,_0x406cc5[_0xb668('0x18')]));});});};
\ No newline at end of file
+var _0xbd50=['request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','options','raw','then','UpdateFaxMessage','FaxMessage','update','body','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','./faxMessage.socket','register'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xbd50,0x196));var _0x0bd5=function(_0x5dee44,_0x115b60){_0x5dee44=_0x5dee44-0x0;var _0x46f720=_0xbd50[_0x5dee44];return _0x46f720;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});config[_0x0bd5('0xa')]=_[_0x0bd5('0xb')](config[_0x0bd5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bd5('0xa')]));require(_0x0bd5('0xc'))[_0x0bd5('0xd')](socket);function respondWithRpcPromise(_0x5f5a0c,_0xa98f54,_0x2fa7d1){return new BPromise(function(_0x519bc6,_0x210f45){return client[_0x0bd5('0xe')](_0x5f5a0c,_0x2fa7d1)['then'](function(_0x1ce7dd){logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,'request\x20sent');logger[_0x0bd5('0x11')](_0x0bd5('0x12'),_0xa98f54,_0x0bd5('0x13'),JSON[_0x0bd5('0x14')](_0x1ce7dd));if(_0x1ce7dd[_0x0bd5('0x15')]){if(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x16')]===0x1f4){logger[_0x0bd5('0x15')]('FaxMessage,\x20%s,\x20%s',_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);return _0x210f45(_0x1ce7dd['error'][_0x0bd5('0x17')]);}logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')]['message']);return _0x519bc6(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);}else{logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,_0x0bd5('0x13'));_0x519bc6(_0x1ce7dd[_0x0bd5('0x18')][_0x0bd5('0x17')]);}})[_0x0bd5('0x19')](function(_0x29fa4c){logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x29fa4c);_0x210f45(_0x29fa4c);});});}exports[_0x0bd5('0x1a')]=function(_0x4008bd){var _0x2dc1e5=this;return new Promise(function(_0x527c37,_0x5ba943){return db['FaxMessage']['create'](_0x4008bd['body'],{'raw':_0x4008bd[_0x0bd5('0x1b')]?_0x4008bd[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![]})[_0x0bd5('0x1d')](function(_0x6ee1a8){logger['info'](_0x0bd5('0x1a'),_0x4008bd);logger[_0x0bd5('0x11')](_0x0bd5('0x1a'),_0x4008bd,JSON['stringify'](_0x6ee1a8));_0x527c37(_0x6ee1a8);})[_0x0bd5('0x19')](function(_0x4a8787){logger['error'](_0x0bd5('0x1a'),_0x4a8787[_0x0bd5('0x17')],_0x4008bd);_0x5ba943(_0x2dc1e5[_0x0bd5('0x15')](0x1f4,_0x4a8787['message']));});});};exports[_0x0bd5('0x1e')]=function(_0x5eab3e){var _0x456e87=this;return new Promise(function(_0x3ffb08,_0x18cec3){return db[_0x0bd5('0x1f')][_0x0bd5('0x20')](_0x5eab3e[_0x0bd5('0x21')],{'raw':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x22')]||null:null,'attributes':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['attributes']||null:null,'limit':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['limit']||null:null})[_0x0bd5('0x1d')](function(_0x8eccc9){logger['info'](_0x0bd5('0x1e'),_0x5eab3e);logger[_0x0bd5('0x11')](_0x0bd5('0x1e'),_0x5eab3e,JSON[_0x0bd5('0x14')](_0x8eccc9));_0x3ffb08(_0x8eccc9);})['catch'](function(_0x440e69){logger[_0x0bd5('0x15')](_0x0bd5('0x1e'),_0x440e69[_0x0bd5('0x17')],_0x5eab3e);_0x18cec3(_0x456e87[_0x0bd5('0x15')](0x1f4,_0x440e69[_0x0bd5('0x17')]));});});};
\ No newline at end of file
index 76b1b2d..ba9804f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39bd=['emit','removeListener','register','length','faxMessage:','./faxMessage.events','remove','update'];(function(_0x3d7e61,_0x4e75e5){var _0x13b7a3=function(_0x4b00a7){while(--_0x4b00a7){_0x3d7e61['push'](_0x3d7e61['shift']());}};_0x13b7a3(++_0x4e75e5);}(_0x39bd,0x85));var _0xd39b=function(_0x69ba26,_0x509236){_0x69ba26=_0x69ba26-0x0;var _0x20cb08=_0x39bd[_0x69ba26];return _0x20cb08;};'use strict';var FaxMessageEvents=require(_0xd39b('0x0'));var events=['save',_0xd39b('0x1'),_0xd39b('0x2')];function createListener(_0x1eba0a,_0x38c7fe){return function(_0x16c36f){_0x38c7fe[_0xd39b('0x3')](_0x1eba0a,_0x16c36f);};}function removeListener(_0x38c83c,_0x21925e){return function(){FaxMessageEvents[_0xd39b('0x4')](_0x38c83c,_0x21925e);};}exports[_0xd39b('0x5')]=function(_0x38a00d){for(var _0x3695bc=0x0,_0x47332f=events[_0xd39b('0x6')];_0x3695bc<_0x47332f;_0x3695bc++){var _0xae49af=events[_0x3695bc];var _0x216357=createListener(_0xd39b('0x7')+_0xae49af,_0x38a00d);FaxMessageEvents['on'](_0xae49af,_0x216357);}};
\ No newline at end of file
+var _0xbafe=['register','remove','update','emit','removeListener'];(function(_0x54f01c,_0x59dbe3){var _0x1ad071=function(_0x32e107){while(--_0x32e107){_0x54f01c['push'](_0x54f01c['shift']());}};_0x1ad071(++_0x59dbe3);}(_0xbafe,0x83));var _0xebaf=function(_0x40d862,_0x1990bc){_0x40d862=_0x40d862-0x0;var _0x104ae4=_0xbafe[_0x40d862];return _0x104ae4;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0xebaf('0x0'),_0xebaf('0x1')];function createListener(_0x3b243e,_0x2faf78){return function(_0x25b6ab){_0x2faf78[_0xebaf('0x2')](_0x3b243e,_0x25b6ab);};}function removeListener(_0x16f831,_0x4f7c72){return function(){FaxMessageEvents[_0xebaf('0x3')](_0x16f831,_0x4f7c72);};}exports[_0xebaf('0x4')]=function(_0xdce74d){for(var _0x4357d2=0x0,_0x305c47=events['length'];_0x4357d2<_0x305c47;_0x4357d2++){var _0x126d92=events[_0x4357d2];var _0x389f23=createListener('faxMessage:'+_0x126d92,_0xdce74d);FaxMessageEvents['on'](_0x126d92,_0x389f23);}};
\ No newline at end of file
index 4f7de86..ba02776 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf45e=['get','isAuthenticated','index','/describe','describe','/:id','show','download','post','tracked','fax','create','put','update','/:id/reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller'];(function(_0x3ecbcb,_0x48122d){var _0x5dca39=function(_0x3b67a3){while(--_0x3b67a3){_0x3ecbcb['push'](_0x3ecbcb['shift']());}};_0x5dca39(++_0x48122d);}(_0xf45e,0x115));var _0xef45=function(_0x31c779,_0x1c9dfc){_0x31c779=_0x31c779-0x0;var _0x3b31a9=_0xf45e[_0x31c779];return _0x3b31a9;};'use strict';var multer=require(_0xef45('0x0'));var util=require('util');var path=require(_0xef45('0x1'));var timeout=require('connect-timeout');var express=require(_0xef45('0x2'));var router=express[_0xef45('0x3')]();var fs_extra=require(_0xef45('0x4'));var auth=require(_0xef45('0x5'));var interaction=require(_0xef45('0x6'));var config=require(_0xef45('0x7'));var controller=require(_0xef45('0x8'));router[_0xef45('0x9')]('/',auth[_0xef45('0xa')](),controller[_0xef45('0xb')]);router[_0xef45('0x9')](_0xef45('0xc'),auth[_0xef45('0xa')](),controller[_0xef45('0xd')]);router[_0xef45('0x9')](_0xef45('0xe'),auth[_0xef45('0xa')](),controller[_0xef45('0xf')]);router[_0xef45('0x9')]('/:id/download',auth[_0xef45('0xa')](),controller[_0xef45('0x10')]);router[_0xef45('0x11')]('/',auth[_0xef45('0xa')](),interaction[_0xef45('0x12')](_0xef45('0x13'),'faxmessage:create'),controller[_0xef45('0x14')]);router[_0xef45('0x15')](_0xef45('0xe'),auth[_0xef45('0xa')](),controller[_0xef45('0x16')]);router['put']('/:id/accept',auth[_0xef45('0xa')](),controller['accept']);router[_0xef45('0x15')](_0xef45('0x17'),auth[_0xef45('0xa')](),controller['reject']);router['delete'](_0xef45('0xe'),auth['isAuthenticated'](),controller[_0xef45('0x18')]);module[_0xef45('0x19')]=router;
\ No newline at end of file
+var _0xa75b=['get','isAuthenticated','index','/describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller'];(function(_0x4d533f,_0xcd02f5){var _0x40bbba=function(_0x181718){while(--_0x181718){_0x4d533f['push'](_0x4d533f['shift']());}};_0x40bbba(++_0xcd02f5);}(_0xa75b,0x170));var _0xba75=function(_0x9f52eb,_0x413205){_0x9f52eb=_0x9f52eb-0x0;var _0x552d97=_0xa75b[_0x9f52eb];return _0x552d97;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var fs_extra=require(_0xba75('0x4'));var auth=require(_0xba75('0x5'));var interaction=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var controller=require(_0xba75('0x8'));router[_0xba75('0x9')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0xb')]);router[_0xba75('0x9')](_0xba75('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xba75('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba75('0xd')]);router['get'](_0xba75('0xe'),auth[_0xba75('0xa')](),controller[_0xba75('0xf')]);router[_0xba75('0x10')]('/',auth[_0xba75('0xa')](),interaction[_0xba75('0x11')](_0xba75('0x12'),_0xba75('0x13')),controller[_0xba75('0x14')]);router[_0xba75('0x15')](_0xba75('0x16'),auth[_0xba75('0xa')](),controller['update']);router['put'](_0xba75('0x17'),auth['isAuthenticated'](),controller[_0xba75('0x18')]);router[_0xba75('0x15')](_0xba75('0x19'),auth[_0xba75('0xa')](),controller['reject']);router[_0xba75('0x1a')](_0xba75('0x16'),auth[_0xba75('0xa')](),controller[_0xba75('0x1b')]);module[_0xba75('0x1c')]=router;
\ No newline at end of file
index 0645661..df8fb42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5ad=['beepall','roundrobin','INTEGER','sequelize','exports','STRING','name','ENUM'];(function(_0x587ce1,_0x1e331c){var _0x3e5ba4=function(_0x183ac6){while(--_0x183ac6){_0x587ce1['push'](_0x587ce1['shift']());}};_0x3e5ba4(++_0x1e331c);}(_0xa5ad,0x1ab));var _0xda5a=function(_0x4824bb,_0x320188){_0x4824bb=_0x4824bb-0x0;var _0x1e2bcc=_0xa5ad[_0x4824bb];return _0x1e2bcc;};'use strict';var Sequelize=require(_0xda5a('0x0'));module[_0xda5a('0x1')]={'name':{'type':Sequelize[_0xda5a('0x2')],'unique':_0xda5a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xda5a('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xda5a('0x4')]('rrmemory',_0xda5a('0x5'),_0xda5a('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xda5a('0x7')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf8a8=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x176814,_0x3e36dd){var _0x484b4f=function(_0x1f685c){while(--_0x1f685c){_0x176814['push'](_0x176814['shift']());}};_0x484b4f(++_0x3e36dd);}(_0xf8a8,0x14f));var _0x8f8a=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xf8a8[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0x8f8a('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f8a('0x1')],'unique':_0x8f8a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8f8a('0x1')]},'timeout':{'type':Sequelize[_0x8f8a('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8f8a('0x4')](_0x8f8a('0x5'),_0x8f8a('0x6'),_0x8f8a('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8f8a('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 6b827e1..1594c43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x587f=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','destroy','error','stack','name','send','index','FaxQueue','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','params','describe','getMembers','findOne','UserFaxQueue','order','merge','User','UserId','faxPause','createdAt','format','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise'];(function(_0x53b7ce,_0x18422f){var _0x3f47c3=function(_0x3cc535){while(--_0x3cc535){_0x53b7ce['push'](_0x53b7ce['shift']());}};_0x3f47c3(++_0x18422f);}(_0x587f,0x8e));var _0xf587=function(_0x2460d9,_0x15da87){_0x2460d9=_0x2460d9-0x0;var _0x4bc204=_0x587f[_0x2460d9];return _0x4bc204;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf587('0x0'));var jsonpatch=require(_0xf587('0x1'));var rp=require(_0xf587('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf587('0x3'));var sox=require(_0xf587('0x4'));var csv=require(_0xf587('0x5'));var ejs=require(_0xf587('0x6'));var fs=require('fs');var fs_extra=require(_0xf587('0x7'));var _=require(_0xf587('0x8'));var squel=require(_0xf587('0x9'));var crypto=require(_0xf587('0xa'));var jsforce=require(_0xf587('0xb'));var deskjs=require(_0xf587('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf587('0xd'));var Papa=require(_0xf587('0xe'));var Redis=require(_0xf587('0xf'));var authService=require(_0xf587('0x10'));var qs=require(_0xf587('0x11'));var as=require(_0xf587('0x12'));var hardwareService=require(_0xf587('0x13'));var logger=require(_0xf587('0x14'))(_0xf587('0x15'));var utils=require(_0xf587('0x16'));var config=require(_0xf587('0x17'));var licenseUtil=require(_0xf587('0x18'));var db=require(_0xf587('0x19'))['db'];config[_0xf587('0x1a')]=_[_0xf587('0x1b')](config['redis'],{'host':_0xf587('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf587('0x1d'))[_0xf587('0x1e')](socket);function respondWithStatusCode(_0x565969,_0x459a8b){_0x459a8b=_0x459a8b||0xcc;return function(_0x450bc6){if(_0x450bc6){return _0x565969[_0xf587('0x1f')](_0x459a8b);}return _0x565969[_0xf587('0x20')](_0x459a8b)['end']();};}function respondWithResult(_0x11d08c,_0x152406){_0x152406=_0x152406||0xc8;return function(_0x1dd336){if(_0x1dd336){return _0x11d08c[_0xf587('0x20')](_0x152406)[_0xf587('0x21')](_0x1dd336);}};}function respondWithFilteredResult(_0x3a24ee,_0x14f2fa){return function(_0x175b5c){if(_0x175b5c){var _0x351f9b=typeof _0x14f2fa[_0xf587('0x22')]===_0xf587('0x23')&&typeof _0x14f2fa[_0xf587('0x24')]==='undefined';var _0x424a05=_0x175b5c[_0xf587('0x25')];var _0x275025=_0x351f9b?0x0:_0x14f2fa[_0xf587('0x22')];var _0x21ec23=_0x351f9b?_0x175b5c['count']:_0x14f2fa[_0xf587('0x22')]+_0x14f2fa[_0xf587('0x24')];var _0x4c2d4d;if(_0x21ec23>=_0x424a05){_0x21ec23=_0x424a05;_0x4c2d4d=0xc8;}else{_0x4c2d4d=0xce;}_0x3a24ee[_0xf587('0x20')](_0x4c2d4d);return _0x3a24ee[_0xf587('0x26')](_0xf587('0x27'),_0x275025+'-'+_0x21ec23+'/'+_0x424a05)[_0xf587('0x21')](_0x175b5c);}return null;};}function patchUpdates(_0x229566){return function(_0x5df8ec){try{jsonpatch[_0xf587('0x28')](_0x5df8ec,_0x229566,!![]);}catch(_0x3bb071){return BPromise[_0xf587('0x29')](_0x3bb071);}return _0x5df8ec[_0xf587('0x2a')]();};}function saveUpdates(_0x27dab3,_0xea463c){return function(_0x82d346){if(_0x82d346){return _0x82d346[_0xf587('0x2b')](_0x27dab3)[_0xf587('0x2c')](function(_0x33e127){return _0x33e127;});}return null;};}function removeEntity(_0x8d0793,_0xf823e5){return function(_0x509b45){if(_0x509b45){return _0x509b45['destroy']()[_0xf587('0x2c')](function(){var _0xdc9cd8=_0x509b45[_0xf587('0x2d')]({'plain':!![]});var _0x1627a4=_0xf587('0x2e');return db[_0xf587('0x2f')][_0xf587('0x30')]({'where':{'type':_0x1627a4,'resourceId':_0xdc9cd8['id']}})['then'](function(){return _0x509b45;});})[_0xf587('0x2c')](function(){_0x8d0793[_0xf587('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a72b3,_0x475792){return function(_0x187190){if(!_0x187190){_0x5a72b3[_0xf587('0x1f')](0x194);}return _0x187190;};}function handleError(_0x2e2c81,_0x30eac2){_0x30eac2=_0x30eac2||0x1f4;return function(_0x186ecb){logger[_0xf587('0x31')](_0x186ecb[_0xf587('0x32')]);if(_0x186ecb[_0xf587('0x33')]){delete _0x186ecb[_0xf587('0x33')];}_0x2e2c81[_0xf587('0x20')](_0x30eac2)[_0xf587('0x34')](_0x186ecb);};}exports[_0xf587('0x35')]=function(_0x2022f9,_0x328e0c){var _0x1ba0ad={},_0x1a45ed={},_0x5c2a5e={'count':0x0,'rows':[]};var _0x4f5d4a=_['map'](db[_0xf587('0x36')][_0xf587('0x37')],function(_0x218809){return{'name':_0x218809[_0xf587('0x38')],'type':_0x218809[_0xf587('0x39')][_0xf587('0x3a')]};});_0x1a45ed[_0xf587('0x3b')]=_[_0xf587('0x3c')](_0x4f5d4a,'name');_0x1a45ed[_0xf587('0x3d')]=_['keys'](_0x2022f9[_0xf587('0x3d')]);_0x1a45ed[_0xf587('0x3e')]=_[_0xf587('0x3f')](_0x1a45ed[_0xf587('0x3b')],_0x1a45ed[_0xf587('0x3d')]);_0x1ba0ad[_0xf587('0x40')]=_[_0xf587('0x3f')](_0x1a45ed[_0xf587('0x3b')],qs[_0xf587('0x41')](_0x2022f9[_0xf587('0x3d')][_0xf587('0x41')]));_0x1ba0ad[_0xf587('0x40')]=_0x1ba0ad['attributes'][_0xf587('0x42')]?_0x1ba0ad[_0xf587('0x40')]:_0x1a45ed[_0xf587('0x3b')];if(!_0x2022f9[_0xf587('0x3d')][_0xf587('0x43')](_0xf587('0x44'))){_0x1ba0ad['limit']=qs[_0xf587('0x24')](_0x2022f9[_0xf587('0x3d')][_0xf587('0x24')]);_0x1ba0ad[_0xf587('0x22')]=qs[_0xf587('0x22')](_0x2022f9[_0xf587('0x3d')][_0xf587('0x22')]);}_0x1ba0ad['order']=qs[_0xf587('0x45')](_0x2022f9[_0xf587('0x3d')][_0xf587('0x45')]);_0x1ba0ad[_0xf587('0x46')]=qs[_0xf587('0x3e')](_[_0xf587('0x47')](_0x2022f9['query'],_0x1a45ed[_0xf587('0x3e')]),_0x4f5d4a);if(_0x2022f9['query'][_0xf587('0x48')]){_0x1ba0ad[_0xf587('0x46')]=_['merge'](_0x1ba0ad[_0xf587('0x46')],{'$or':_['map'](_0x4f5d4a,function(_0x1abe1a){if(_0x1abe1a[_0xf587('0x39')]!==_0xf587('0x49')){var _0x5de2ca={};_0x5de2ca[_0x1abe1a['name']]={'$like':'%'+_0x2022f9[_0xf587('0x3d')]['filter']+'%'};return _0x5de2ca;}})});}_0x1ba0ad=_['merge']({},_0x1ba0ad,_0x2022f9[_0xf587('0x4a')]);var _0x3a28cf={'where':_0x1ba0ad[_0xf587('0x46')]};return db[_0xf587('0x36')][_0xf587('0x25')](_0x3a28cf)[_0xf587('0x2c')](function(_0x3a9d68){_0x5c2a5e[_0xf587('0x25')]=_0x3a9d68;if(_0x2022f9['query'][_0xf587('0x4b')]){_0x1ba0ad[_0xf587('0x4c')]=[{'all':!![]}];}return db['FaxQueue'][_0xf587('0x4d')](_0x1ba0ad);})[_0xf587('0x2c')](function(_0x380736){_0x5c2a5e[_0xf587('0x4e')]=_0x380736;return _0x5c2a5e;})['then'](respondWithFilteredResult(_0x328e0c,_0x1ba0ad))[_0xf587('0x4f')](handleError(_0x328e0c,null));};exports[_0xf587('0x50')]=function(_0x1a03c7,_0x2ea616){var _0x52e72a={'raw':!![],'where':{'id':_0x1a03c7['params']['id']}},_0x3e2465={};_0x3e2465[_0xf587('0x3b')]=_[_0xf587('0x51')](db['FaxQueue'][_0xf587('0x37')]);_0x3e2465[_0xf587('0x3d')]=_[_0xf587('0x51')](_0x1a03c7[_0xf587('0x3d')]);_0x3e2465['filters']=_[_0xf587('0x3f')](_0x3e2465[_0xf587('0x3b')],_0x3e2465[_0xf587('0x3d')]);_0x52e72a[_0xf587('0x40')]=_['intersection'](_0x3e2465[_0xf587('0x3b')],qs[_0xf587('0x41')](_0x1a03c7[_0xf587('0x3d')]['fields']));_0x52e72a[_0xf587('0x40')]=_0x52e72a[_0xf587('0x40')][_0xf587('0x42')]?_0x52e72a['attributes']:_0x3e2465['model'];if(_0x1a03c7[_0xf587('0x3d')][_0xf587('0x4b')]){_0x52e72a['include']=[{'all':!![]}];}_0x52e72a=_['merge']({},_0x52e72a,_0x1a03c7[_0xf587('0x4a')]);return db[_0xf587('0x36')][_0xf587('0x52')](_0x52e72a)[_0xf587('0x2c')](handleEntityNotFound(_0x2ea616,null))[_0xf587('0x2c')](respondWithResult(_0x2ea616,null))[_0xf587('0x4f')](handleError(_0x2ea616,null));};exports['create']=function(_0x3689d2,_0x258ed6){return db[_0xf587('0x36')][_0xf587('0x53')](_0x3689d2[_0xf587('0x54')],{})[_0xf587('0x2c')](function(_0x1d5f66){var _0xa9876d=_0x3689d2['user'][_0xf587('0x2d')]({'plain':!![]});if(!_0xa9876d)throw new Error(_0xf587('0x55'));if(_0xa9876d[_0xf587('0x56')]===_0xf587('0x57')){var _0x3942ea=_0x1d5f66[_0xf587('0x2d')]({'plain':!![]});var _0x1cfa00='FaxQueues';return db['UserProfileSection']['find']({'where':{'name':_0x1cfa00,'userProfileId':_0xa9876d[_0xf587('0x58')]},'raw':!![]})['then'](function(_0x173106){if(_0x173106&&_0x173106[_0xf587('0x59')]===0x0){return db['UserProfileResource'][_0xf587('0x53')]({'name':_0x3942ea[_0xf587('0x33')],'resourceId':_0x3942ea['id'],'type':_0x173106[_0xf587('0x33')],'sectionId':_0x173106['id']},{})[_0xf587('0x2c')](function(){return _0x1d5f66;});}else{return _0x1d5f66;}})[_0xf587('0x4f')](function(_0x4d27a7){logger[_0xf587('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d27a7);throw _0x4d27a7;});}return _0x1d5f66;})['then'](respondWithResult(_0x258ed6,0xc9))[_0xf587('0x4f')](handleError(_0x258ed6,null));};exports[_0xf587('0x2b')]=function(_0x4071f6,_0x24cbcd){if(_0x4071f6[_0xf587('0x54')]['id']){delete _0x4071f6[_0xf587('0x54')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x4071f6[_0xf587('0x5a')]['id']}})[_0xf587('0x2c')](handleEntityNotFound(_0x24cbcd,null))[_0xf587('0x2c')](saveUpdates(_0x4071f6[_0xf587('0x54')],null))['then'](respondWithResult(_0x24cbcd,null))[_0xf587('0x4f')](handleError(_0x24cbcd,null));};exports[_0xf587('0x30')]=function(_0x2d261d,_0x2e559b){return db[_0xf587('0x36')][_0xf587('0x52')]({'where':{'id':_0x2d261d['params']['id']}})['then'](handleEntityNotFound(_0x2e559b,null))[_0xf587('0x2c')](removeEntity(_0x2e559b,null))['catch'](handleError(_0x2e559b,null));};exports[_0xf587('0x5b')]=function(_0xe4cc52,_0x299ffb){return db['FaxQueue'][_0xf587('0x5b')]()['then'](respondWithResult(_0x299ffb,null))[_0xf587('0x4f')](handleError(_0x299ffb,null));};exports[_0xf587('0x5c')]=function(_0x587b95,_0x269d19,_0x5938db){var _0x23326c={'raw':!![],'where':{}},_0x16d24c={},_0x34570e;return db['FaxQueue'][_0xf587('0x5d')]({'where':{'id':_0x587b95[_0xf587('0x5a')]['id']}})[_0xf587('0x2c')](handleEntityNotFound(_0x269d19,null))[_0xf587('0x2c')](function(_0xb1aad6){if(_0xb1aad6){_0x34570e=_0xb1aad6[_0xf587('0x2d')]({'plain':!![]});_0x16d24c[_0xf587('0x3b')]=_['keys'](db[_0xf587('0x5e')][_0xf587('0x37')]);_0x16d24c[_0xf587('0x3d')]=_[_0xf587('0x51')](_0x587b95['query']);_0x16d24c[_0xf587('0x3e')]=_[_0xf587('0x3f')](_0x16d24c[_0xf587('0x3b')],_0x16d24c[_0xf587('0x3d')]);_0x23326c['attributes']=_[_0xf587('0x3f')](_0x16d24c[_0xf587('0x3b')],qs[_0xf587('0x41')](_0x587b95[_0xf587('0x3d')]['fields']));_0x23326c[_0xf587('0x40')]=_0x23326c[_0xf587('0x40')][_0xf587('0x42')]?_0x23326c[_0xf587('0x40')]:_0x16d24c['model'];if(!_0x587b95[_0xf587('0x3d')][_0xf587('0x43')]('nolimit')){_0x23326c['limit']=qs[_0xf587('0x24')](_0x587b95[_0xf587('0x3d')][_0xf587('0x24')]);_0x23326c[_0xf587('0x22')]=qs[_0xf587('0x22')](_0x587b95[_0xf587('0x3d')]['offset']);}_0x23326c[_0xf587('0x5f')]=qs[_0xf587('0x45')](_0x587b95[_0xf587('0x3d')][_0xf587('0x45')]);_0x23326c['where']=qs[_0xf587('0x3e')](_['pick'](_0x587b95[_0xf587('0x3d')],_0x16d24c['filters']));_0x23326c[_0xf587('0x46')]['FaxQueueId']=_0xb1aad6['id'];if(_0x587b95[_0xf587('0x3d')][_0xf587('0x48')]){_0x23326c[_0xf587('0x46')]=_[_0xf587('0x60')](_0x23326c['where'],{'$or':_['map'](_0x23326c[_0xf587('0x40')],function(_0x2b1236){var _0x30f515={};_0x30f515[_0x2b1236]={'$like':'%'+_0x587b95[_0xf587('0x3d')][_0xf587('0x48')]+'%'};return _0x30f515;})});}_0x23326c=_[_0xf587('0x60')]({},_0x23326c,_0x587b95['options']);return db[_0xf587('0x5e')][_0xf587('0x4d')](_0x23326c);}})['then'](function(_0x45c938){if(_0x45c938){return db[_0xf587('0x61')]['findAndCountAll']({'where':{'id':_[_0xf587('0x3c')](_0x45c938,_0xf587('0x62')),'role':'agent'},'attributes':['id',_0xf587('0x33'),_0xf587('0x63'),'updatedAt',_0xf587('0x64')]});}})[_0xf587('0x2c')](function(_0x308253){if(_0x308253){return{'count':_0x308253[_0xf587('0x25')],'rows':_[_0xf587('0x3c')](_0x308253[_0xf587('0x4e')],function(_0x574b89){return{'membername':_0x574b89[_0xf587('0x33')],'UserId':_0x574b89['id'],'queue_name':_0x34570e[_0xf587('0x33')],'FaxQueueId':_0x34570e['id'],'interface':util[_0xf587('0x65')]('%s/%s',_0xf587('0x66'),_0x574b89[_0xf587('0x33')]),'penalty':0x0,'paused':_0x574b89[_0xf587('0x63')],'createdAt':_0x574b89['createdAt'],'updatedAt':_0x574b89[_0xf587('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf587('0x2c')](respondWithFilteredResult(_0x269d19,_0x23326c))['catch'](handleError(_0x269d19,null));};exports[_0xf587('0x68')]=function(_0xd73ac9,_0xf0654e,_0x56aa18){var _0x1bf362={};var _0x111bec={};var _0xf3e34;var _0x4244da;return db[_0xf587('0x36')][_0xf587('0x5d')]({'where':{'id':_0xd73ac9[_0xf587('0x5a')]['id']}})[_0xf587('0x2c')](handleEntityNotFound(_0xf0654e,null))[_0xf587('0x2c')](function(_0x31df3e){if(_0x31df3e){_0xf3e34=_0x31df3e;_0x111bec[_0xf587('0x3b')]=_[_0xf587('0x51')](db[_0xf587('0x69')][_0xf587('0x37')]);_0x111bec[_0xf587('0x3d')]=_['keys'](_0xd73ac9[_0xf587('0x3d')]);_0x111bec[_0xf587('0x3e')]=_[_0xf587('0x3f')](_0x111bec[_0xf587('0x3b')],_0x111bec[_0xf587('0x3d')]);_0x1bf362['attributes']=_[_0xf587('0x3f')](_0x111bec[_0xf587('0x3b')],qs[_0xf587('0x41')](_0xd73ac9[_0xf587('0x3d')][_0xf587('0x41')]));_0x1bf362[_0xf587('0x40')]=_0x1bf362[_0xf587('0x40')][_0xf587('0x42')]?_0x1bf362['attributes']:_0x111bec[_0xf587('0x3b')];_0x1bf362[_0xf587('0x5f')]=qs['sort'](_0xd73ac9[_0xf587('0x3d')][_0xf587('0x45')]);_0x1bf362[_0xf587('0x46')]=qs[_0xf587('0x3e')](_[_0xf587('0x47')](_0xd73ac9[_0xf587('0x3d')],_0x111bec[_0xf587('0x3e')]));if(_0xd73ac9[_0xf587('0x3d')]['filter']){_0x1bf362['where']=_['merge'](_0x1bf362[_0xf587('0x46')],{'$or':_[_0xf587('0x3c')](_0x1bf362[_0xf587('0x40')],function(_0x396389){var _0x21756f={};_0x21756f[_0x396389]={'$like':'%'+_0xd73ac9[_0xf587('0x3d')][_0xf587('0x48')]+'%'};return _0x21756f;})});}_0x1bf362=_[_0xf587('0x60')]({},_0x1bf362,_0xd73ac9[_0xf587('0x4a')]);return _0xf3e34[_0xf587('0x68')](_0x1bf362);}})['then'](function(_0xec54fc){if(_0xec54fc){_0x4244da=_0xec54fc[_0xf587('0x42')];if(!_0xd73ac9[_0xf587('0x3d')]['hasOwnProperty'](_0xf587('0x44'))){_0x1bf362[_0xf587('0x24')]=qs['limit'](_0xd73ac9['query']['limit']);_0x1bf362[_0xf587('0x22')]=qs[_0xf587('0x22')](_0xd73ac9[_0xf587('0x3d')][_0xf587('0x22')]);}return _0xf3e34[_0xf587('0x68')](_0x1bf362);}})[_0xf587('0x2c')](function(_0x20160a){if(_0x20160a){return _0x20160a?{'count':_0x4244da,'rows':_0x20160a}:null;}})[_0xf587('0x2c')](respondWithResult(_0xf0654e,null))[_0xf587('0x4f')](handleError(_0xf0654e,null));};exports[_0xf587('0x6a')]=function(_0x46d3f1,_0x1073fd,_0x24860a){var _0x190f09=_0x46d3f1[_0xf587('0x54')][_0xf587('0x6b')];return db[_0xf587('0x69')]['findAll']({'where':{'id':_0x190f09},'attributes':['id'],'include':[{'model':db[_0xf587('0x61')],'as':_0xf587('0x6c'),'attributes':['id',_0xf587('0x33'),'online',_0xf587('0x6d'),_0xf587('0x6e')],'raw':!![]}]})[_0xf587('0x2c')](function(_0x966055){if(_0x966055){var _0x2a4afb=_[_0xf587('0x6f')](_0x966055,function(_0x476fde){var _0x246532=_0x476fde[_0xf587('0x2d')]({'plain':!![]});return _0x246532[_0xf587('0x6c')];});return db['FaxQueue']['find']({'where':{'id':_0x46d3f1[_0xf587('0x5a')]['id']}})[_0xf587('0x2c')](function(_0x4a752e){return db[_0xf587('0x70')]['transaction'](function(_0x5b5ed6){return _0x4a752e[_0xf587('0x6a')](_0x190f09,{'transaction':_0x5b5ed6})[_0xf587('0x2c')](function(){return BPromise[_0xf587('0x71')](_0x2a4afb,function(_0x5e95ef){return db[_0xf587('0x5e')][_0xf587('0x72')]({'where':{'UserId':_0x5e95ef['id'],'FaxQueueId':_0x46d3f1[_0xf587('0x5a')]['id']},'transaction':_0x5b5ed6});});})['then'](function(){_0x2a4afb[_0xf587('0x73')](function(_0x491566){socket[_0xf587('0x74')](_0xf587('0x75'),{'UserId':_0x491566['id'],'FaxQueueId':_0x4a752e['id']});});});});});}})[_0xf587('0x2c')](respondWithStatusCode(_0x1073fd,null))[_0xf587('0x4f')](handleError(_0x1073fd,null));};exports[_0xf587('0x76')]=function(_0x5c1092,_0x43c091,_0x5db414){return db[_0xf587('0x69')][_0xf587('0x4d')]({'where':{'id':_0x5c1092[_0xf587('0x3d')][_0xf587('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xf587('0x61')],'as':_0xf587('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x43c091,null))[_0xf587('0x2c')](function(_0x20d4fe){var _0x1b2899=_['map'](_0x20d4fe,'id');var _0x135917=[];var _0xcb623=[];var _0x2557ba=squel[_0xf587('0x77')]();_0x2557ba[_0xf587('0x78')](_0xf587('0x79'))['from'](_0xf587('0x7a'),'tq')[_0xf587('0x7b')](_0xf587('0x7c'),'ut',_0xf587('0x7d'))[_0xf587('0x46')](_0xf587('0x7e'),_0x5c1092[_0xf587('0x5a')]['id']);for(var _0x2bf868=0x0;_0x2bf868<_0x20d4fe[_0xf587('0x42')];_0x2bf868+=0x1){let _0x580612=_0x20d4fe[_0x2bf868];for(var _0x482075=0x0;_0x482075<_0x580612[_0xf587('0x6c')][_0xf587('0x42')];_0x482075+=0x1){let _0x42e60e=_0x580612[_0xf587('0x6c')][_0x482075];var _0x1aa87d=_0x2557ba['clone']();_0x1aa87d[_0xf587('0x46')](_0xf587('0x7f'),_0x42e60e['id']);_0xcb623[_0xf587('0x80')](db[_0xf587('0x70')][_0xf587('0x3d')](_0x1aa87d[_0xf587('0x81')](),{'type':db[_0xf587('0x70')]['QueryTypes'][_0xf587('0x82')]})[_0xf587('0x2c')](function(_0x4eb201){if(_0x4eb201[_0xf587('0x42')]===0x1){return _0x42e60e['id'];}else{var _0x4dcdb7=_[_0xf587('0x83')](_['map'](_0x4eb201,_0xf587('0x84')),function(_0x55634b){return _['includes'](_0x1b2899,_0x55634b);});if(_0x4dcdb7){return _0x42e60e['id'];}}}));}}return BPromise[_0xf587('0x85')](_0xcb623)[_0xf587('0x2c')](function(_0x25c33e){_0x135917=_(_0x135917)[_0xf587('0x86')](_0x25c33e)[_0xf587('0x87')]()[_0xf587('0x88')]();return db['FaxQueue'][_0xf587('0x52')]({'where':{'id':_0x5c1092[_0xf587('0x5a')]['id']}})[_0xf587('0x2c')](function(_0x253b36){return db[_0xf587('0x70')][_0xf587('0x89')](function(_0x36bc12){return _0x253b36[_0xf587('0x76')](_0x5c1092[_0xf587('0x3d')][_0xf587('0x6b')],{'transaction':_0x36bc12})[_0xf587('0x2c')](function(){if(!_[_0xf587('0x8a')](_0x135917)){return _0x253b36[_0xf587('0x8b')](_0x135917,{'transaction':_0x36bc12});}})['then'](function(){_0x135917[_0xf587('0x73')](function(_0x55920a){socket[_0xf587('0x74')](_0xf587('0x8c'),{'UserId':_0x55920a,'FaxQueueId':_0x253b36['id']});});});});});});})[_0xf587('0x2c')](respondWithStatusCode(_0x43c091,null))[_0xf587('0x4f')](handleError(_0x43c091,null));};exports[_0xf587('0x8d')]=function(_0x5cc235,_0x1663c9,_0x1c753a){return db[_0xf587('0x36')][_0xf587('0x52')]({'where':{'id':_0x5cc235[_0xf587('0x5a')]['id']}})[_0xf587('0x2c')](handleEntityNotFound(_0x1663c9,null))[_0xf587('0x2c')](function(_0x144927){if(_0x144927){return _0x144927[_0xf587('0x8d')](_0x5cc235[_0xf587('0x54')][_0xf587('0x6b')],_['omit'](_0x5cc235[_0xf587('0x54')],[_0xf587('0x6b'),'id'])||{})[_0xf587('0x8e')](function(_0x377ac6){for(var _0x5eac9d=0x0;_0x5eac9d<_0x5cc235[_0xf587('0x54')][_0xf587('0x6b')][_0xf587('0x42')];_0x5eac9d+=0x1){socket[_0xf587('0x74')](_0xf587('0x75'),{'UserId':Number(_0x5cc235[_0xf587('0x54')][_0xf587('0x6b')][_0x5eac9d]),'FaxQueueId':Number(_0x5cc235['params']['id'])});}return _0x377ac6;});}})[_0xf587('0x2c')](respondWithResult(_0x1663c9,null))[_0xf587('0x4f')](handleError(_0x1663c9,null));};exports[_0xf587('0x8b')]=function(_0x4bb59b,_0x4b3680,_0x3b0fcf){return db['FaxQueue'][_0xf587('0x52')]({'where':{'id':_0x4bb59b[_0xf587('0x5a')]['id']}})[_0xf587('0x2c')](handleEntityNotFound(_0x4b3680,null))[_0xf587('0x2c')](function(_0x2b5a31){if(_0x2b5a31){return _0x2b5a31[_0xf587('0x8b')](_0x4bb59b[_0xf587('0x3d')][_0xf587('0x6b')])[_0xf587('0x2c')](function(){if(_[_0xf587('0x8f')](_0x4bb59b['query'][_0xf587('0x6b')])){for(var _0x470ed0=0x0;_0x470ed0<_0x4bb59b['query'][_0xf587('0x6b')][_0xf587('0x42')];_0x470ed0+=0x1){socket[_0xf587('0x74')]('userFaxQueue:remove',{'UserId':Number(_0x4bb59b[_0xf587('0x3d')][_0xf587('0x6b')][_0x470ed0]),'FaxQueueId':Number(_0x4bb59b['params']['id'])});}}else{socket[_0xf587('0x74')](_0xf587('0x8c'),{'UserId':Number(_0x4bb59b[_0xf587('0x3d')][_0xf587('0x6b')]),'FaxQueueId':Number(_0x4bb59b[_0xf587('0x5a')]['id'])});}});}})[_0xf587('0x2c')](respondWithStatusCode(_0x4b3680,null))[_0xf587('0x4f')](handleError(_0x4b3680,null));};exports['getAgents']=function(_0x3e12b2,_0x5bce6b,_0x3ac431){var _0x1d4b42={};var _0x31b6c5={};var _0x1963d4;var _0x9a016c;return db[_0xf587('0x36')][_0xf587('0x5d')]({'where':{'id':_0x3e12b2[_0xf587('0x5a')]['id']}})[_0xf587('0x2c')](handleEntityNotFound(_0x5bce6b,null))['then'](function(_0x576624){if(_0x576624){_0x1963d4=_0x576624;_0x31b6c5[_0xf587('0x3b')]=_[_0xf587('0x51')](db[_0xf587('0x61')]['rawAttributes']);_0x31b6c5[_0xf587('0x3d')]=_[_0xf587('0x51')](_0x3e12b2[_0xf587('0x3d')]);_0x31b6c5[_0xf587('0x3e')]=_[_0xf587('0x3f')](_0x31b6c5['model'],_0x31b6c5['query']);_0x1d4b42[_0xf587('0x40')]=_[_0xf587('0x3f')](_0x31b6c5[_0xf587('0x3b')],qs[_0xf587('0x41')](_0x3e12b2[_0xf587('0x3d')]['fields']));_0x1d4b42[_0xf587('0x40')]=_0x1d4b42[_0xf587('0x40')][_0xf587('0x42')]?_0x1d4b42[_0xf587('0x40')]:_0x31b6c5[_0xf587('0x3b')];_0x1d4b42[_0xf587('0x5f')]=qs[_0xf587('0x45')](_0x3e12b2[_0xf587('0x3d')][_0xf587('0x45')]);_0x1d4b42['where']=qs[_0xf587('0x3e')](_[_0xf587('0x47')](_0x3e12b2['query'],_0x31b6c5[_0xf587('0x3e')]));if(_0x3e12b2['query']['filter']){_0x1d4b42[_0xf587('0x46')]=_['merge'](_0x1d4b42[_0xf587('0x46')],{'$or':_[_0xf587('0x3c')](_0x1d4b42[_0xf587('0x40')],function(_0x2baa6b){var _0x162f5b={};_0x162f5b[_0x2baa6b]={'$like':'%'+_0x3e12b2[_0xf587('0x3d')][_0xf587('0x48')]+'%'};return _0x162f5b;})});}_0x1d4b42=_[_0xf587('0x60')]({},_0x1d4b42,_0x3e12b2[_0xf587('0x4a')]);return _0x1963d4[_0xf587('0x90')](_0x1d4b42);}})[_0xf587('0x2c')](function(_0x138983){if(_0x138983){_0x9a016c=_0x138983[_0xf587('0x42')];if(!_0x3e12b2[_0xf587('0x3d')][_0xf587('0x43')]('nolimit')){_0x1d4b42[_0xf587('0x24')]=qs[_0xf587('0x24')](_0x3e12b2[_0xf587('0x3d')][_0xf587('0x24')]);_0x1d4b42[_0xf587('0x22')]=qs[_0xf587('0x22')](_0x3e12b2['query'][_0xf587('0x22')]);}return _0x1963d4[_0xf587('0x90')](_0x1d4b42);}})[_0xf587('0x2c')](function(_0x45cffe){if(_0x45cffe){return _0x45cffe?{'count':_0x9a016c,'rows':_0x45cffe}:null;}})[_0xf587('0x2c')](respondWithResult(_0x5bce6b,null))[_0xf587('0x4f')](handleError(_0x5bce6b,null));};
\ No newline at end of file
+var _0x42dc=['%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userFaxQueue:save','removeTeams','select','from','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','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','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','destroy','get','FaxQueues','UserProfileResource','then','error','stack','name','send','map','FaxQueue','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','describe','getMembers','findOne','length','UserFaxQueue','findAll','User','findAndCountAll','agent','faxPause','updatedAt','createdAt','format'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x42dc,0xb0));var _0xc42d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x42dc[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0xc42d('0x0'));var rimraf=require(_0xc42d('0x1'));var zipdir=require(_0xc42d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc42d('0x3'));var moment=require(_0xc42d('0x4'));var BPromise=require(_0xc42d('0x5'));var Mustache=require(_0xc42d('0x6'));var util=require('util');var path=require(_0xc42d('0x7'));var sox=require(_0xc42d('0x8'));var csv=require(_0xc42d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc42d('0xa'));var _=require('lodash');var squel=require(_0xc42d('0xb'));var crypto=require(_0xc42d('0xc'));var jsforce=require(_0xc42d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc42d('0xe'));var Papa=require(_0xc42d('0xf'));var Redis=require('ioredis');var authService=require(_0xc42d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc42d('0x11'));var hardwareService=require(_0xc42d('0x12'));var logger=require(_0xc42d('0x13'))('api');var utils=require(_0xc42d('0x14'));var config=require(_0xc42d('0x15'));var licenseUtil=require(_0xc42d('0x16'));var db=require('../../mysqldb')['db'];config[_0xc42d('0x17')]=_[_0xc42d('0x18')](config[_0xc42d('0x17')],{'host':_0xc42d('0x19'),'port':0x18eb});var socket=require(_0xc42d('0x1a'))(new Redis(config[_0xc42d('0x17')]));require('./faxQueue.socket')[_0xc42d('0x1b')](socket);function respondWithStatusCode(_0x4ff2b3,_0x4f8451){_0x4f8451=_0x4f8451||0xcc;return function(_0xafa978){if(_0xafa978){return _0x4ff2b3[_0xc42d('0x1c')](_0x4f8451);}return _0x4ff2b3[_0xc42d('0x1d')](_0x4f8451)[_0xc42d('0x1e')]();};}function respondWithResult(_0x1a73e7,_0x3e2616){_0x3e2616=_0x3e2616||0xc8;return function(_0x59dc82){if(_0x59dc82){return _0x1a73e7['status'](_0x3e2616)['json'](_0x59dc82);}};}function respondWithFilteredResult(_0x46816c,_0x30a884){return function(_0x1ff98f){if(_0x1ff98f){var _0x424df0=typeof _0x30a884[_0xc42d('0x1f')]==='undefined'&&typeof _0x30a884[_0xc42d('0x20')]===_0xc42d('0x21');var _0x3b0590=_0x1ff98f[_0xc42d('0x22')];var _0x2daf3e=_0x424df0?0x0:_0x30a884[_0xc42d('0x1f')];var _0x511ec3=_0x424df0?_0x1ff98f[_0xc42d('0x22')]:_0x30a884[_0xc42d('0x1f')]+_0x30a884['limit'];var _0x5a3051;if(_0x511ec3>=_0x3b0590){_0x511ec3=_0x3b0590;_0x5a3051=0xc8;}else{_0x5a3051=0xce;}_0x46816c[_0xc42d('0x1d')](_0x5a3051);return _0x46816c[_0xc42d('0x23')](_0xc42d('0x24'),_0x2daf3e+'-'+_0x511ec3+'/'+_0x3b0590)[_0xc42d('0x25')](_0x1ff98f);}return null;};}function patchUpdates(_0x2fac40){return function(_0x4716f5){try{jsonpatch['apply'](_0x4716f5,_0x2fac40,!![]);}catch(_0x310579){return BPromise[_0xc42d('0x26')](_0x310579);}return _0x4716f5['save']();};}function saveUpdates(_0x582a30,_0x51c410){return function(_0x12cfc0){if(_0x12cfc0){return _0x12cfc0[_0xc42d('0x27')](_0x582a30)['then'](function(_0x2c7948){return _0x2c7948;});}return null;};}function removeEntity(_0x3eaa88,_0x270e1d){return function(_0x2ce2a4){if(_0x2ce2a4){return _0x2ce2a4[_0xc42d('0x28')]()['then'](function(){var _0x14787c=_0x2ce2a4[_0xc42d('0x29')]({'plain':!![]});var _0x24c6fb=_0xc42d('0x2a');return db[_0xc42d('0x2b')][_0xc42d('0x28')]({'where':{'type':_0x24c6fb,'resourceId':_0x14787c['id']}})[_0xc42d('0x2c')](function(){return _0x2ce2a4;});})[_0xc42d('0x2c')](function(){_0x3eaa88[_0xc42d('0x1d')](0xcc)[_0xc42d('0x1e')]();});}};}function handleEntityNotFound(_0x512ced,_0x446b04){return function(_0x56c00d){if(!_0x56c00d){_0x512ced['sendStatus'](0x194);}return _0x56c00d;};}function handleError(_0xfea00f,_0x30c3ea){_0x30c3ea=_0x30c3ea||0x1f4;return function(_0x4e357c){logger[_0xc42d('0x2d')](_0x4e357c[_0xc42d('0x2e')]);if(_0x4e357c[_0xc42d('0x2f')]){delete _0x4e357c[_0xc42d('0x2f')];}_0xfea00f[_0xc42d('0x1d')](_0x30c3ea)[_0xc42d('0x30')](_0x4e357c);};}exports['index']=function(_0x1e1868,_0x14f6b6){var _0x5a7a3c={},_0x525e65={},_0x1edf0={'count':0x0,'rows':[]};var _0x5082e4=_[_0xc42d('0x31')](db[_0xc42d('0x32')][_0xc42d('0x33')],function(_0x157fb4){return{'name':_0x157fb4[_0xc42d('0x34')],'type':_0x157fb4['type'][_0xc42d('0x35')]};});_0x525e65[_0xc42d('0x36')]=_[_0xc42d('0x31')](_0x5082e4,_0xc42d('0x2f'));_0x525e65[_0xc42d('0x37')]=_[_0xc42d('0x38')](_0x1e1868[_0xc42d('0x37')]);_0x525e65[_0xc42d('0x39')]=_['intersection'](_0x525e65[_0xc42d('0x36')],_0x525e65[_0xc42d('0x37')]);_0x5a7a3c[_0xc42d('0x3a')]=_[_0xc42d('0x3b')](_0x525e65[_0xc42d('0x36')],qs[_0xc42d('0x3c')](_0x1e1868['query'][_0xc42d('0x3c')]));_0x5a7a3c[_0xc42d('0x3a')]=_0x5a7a3c[_0xc42d('0x3a')]['length']?_0x5a7a3c[_0xc42d('0x3a')]:_0x525e65[_0xc42d('0x36')];if(!_0x1e1868[_0xc42d('0x37')][_0xc42d('0x3d')](_0xc42d('0x3e'))){_0x5a7a3c[_0xc42d('0x20')]=qs['limit'](_0x1e1868[_0xc42d('0x37')]['limit']);_0x5a7a3c['offset']=qs['offset'](_0x1e1868[_0xc42d('0x37')][_0xc42d('0x1f')]);}_0x5a7a3c[_0xc42d('0x3f')]=qs[_0xc42d('0x40')](_0x1e1868[_0xc42d('0x37')]['sort']);_0x5a7a3c[_0xc42d('0x41')]=qs[_0xc42d('0x39')](_[_0xc42d('0x42')](_0x1e1868[_0xc42d('0x37')],_0x525e65['filters']),_0x5082e4);if(_0x1e1868[_0xc42d('0x37')][_0xc42d('0x43')]){_0x5a7a3c['where']=_['merge'](_0x5a7a3c[_0xc42d('0x41')],{'$or':_[_0xc42d('0x31')](_0x5082e4,function(_0x588924){if(_0x588924[_0xc42d('0x44')]!==_0xc42d('0x45')){var _0x19702c={};_0x19702c[_0x588924[_0xc42d('0x2f')]]={'$like':'%'+_0x1e1868[_0xc42d('0x37')][_0xc42d('0x43')]+'%'};return _0x19702c;}})});}_0x5a7a3c=_['merge']({},_0x5a7a3c,_0x1e1868[_0xc42d('0x46')]);var _0x4f0d87={'where':_0x5a7a3c[_0xc42d('0x41')]};return db[_0xc42d('0x32')]['count'](_0x4f0d87)[_0xc42d('0x2c')](function(_0x379f24){_0x1edf0[_0xc42d('0x22')]=_0x379f24;if(_0x1e1868[_0xc42d('0x37')][_0xc42d('0x47')]){_0x5a7a3c[_0xc42d('0x48')]=[{'all':!![]}];}return db[_0xc42d('0x32')]['findAll'](_0x5a7a3c);})[_0xc42d('0x2c')](function(_0x361e48){_0x1edf0[_0xc42d('0x49')]=_0x361e48;return _0x1edf0;})[_0xc42d('0x2c')](respondWithFilteredResult(_0x14f6b6,_0x5a7a3c))[_0xc42d('0x4a')](handleError(_0x14f6b6,null));};exports[_0xc42d('0x4b')]=function(_0x306e4a,_0xddf1e8){var _0x2d95b8={'raw':!![],'where':{'id':_0x306e4a[_0xc42d('0x4c')]['id']}},_0x13ff4a={};_0x13ff4a[_0xc42d('0x36')]=_[_0xc42d('0x38')](db[_0xc42d('0x32')][_0xc42d('0x33')]);_0x13ff4a[_0xc42d('0x37')]=_[_0xc42d('0x38')](_0x306e4a[_0xc42d('0x37')]);_0x13ff4a[_0xc42d('0x39')]=_[_0xc42d('0x3b')](_0x13ff4a[_0xc42d('0x36')],_0x13ff4a[_0xc42d('0x37')]);_0x2d95b8[_0xc42d('0x3a')]=_['intersection'](_0x13ff4a['model'],qs[_0xc42d('0x3c')](_0x306e4a['query'][_0xc42d('0x3c')]));_0x2d95b8['attributes']=_0x2d95b8['attributes']['length']?_0x2d95b8['attributes']:_0x13ff4a[_0xc42d('0x36')];if(_0x306e4a['query'][_0xc42d('0x47')]){_0x2d95b8[_0xc42d('0x48')]=[{'all':!![]}];}_0x2d95b8=_[_0xc42d('0x4d')]({},_0x2d95b8,_0x306e4a[_0xc42d('0x46')]);return db['FaxQueue'][_0xc42d('0x4e')](_0x2d95b8)['then'](handleEntityNotFound(_0xddf1e8,null))['then'](respondWithResult(_0xddf1e8,null))[_0xc42d('0x4a')](handleError(_0xddf1e8,null));};exports[_0xc42d('0x4f')]=function(_0x12004e,_0x350482){return db['FaxQueue']['create'](_0x12004e[_0xc42d('0x50')],{})[_0xc42d('0x2c')](function(_0x97616c){var _0x1b9316=_0x12004e[_0xc42d('0x51')][_0xc42d('0x29')]({'plain':!![]});if(!_0x1b9316)throw new Error(_0xc42d('0x52'));if(_0x1b9316['role']===_0xc42d('0x51')){var _0x106b32=_0x97616c[_0xc42d('0x29')]({'plain':!![]});var _0x3aca92=_0xc42d('0x2a');return db['UserProfileSection'][_0xc42d('0x4e')]({'where':{'name':_0x3aca92,'userProfileId':_0x1b9316[_0xc42d('0x53')]},'raw':!![]})['then'](function(_0x32178b){if(_0x32178b&&_0x32178b[_0xc42d('0x54')]===0x0){return db[_0xc42d('0x2b')][_0xc42d('0x4f')]({'name':_0x106b32[_0xc42d('0x2f')],'resourceId':_0x106b32['id'],'type':_0x32178b['name'],'sectionId':_0x32178b['id']},{})[_0xc42d('0x2c')](function(){return _0x97616c;});}else{return _0x97616c;}})[_0xc42d('0x4a')](function(_0x213fa2){logger[_0xc42d('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x213fa2);throw _0x213fa2;});}return _0x97616c;})['then'](respondWithResult(_0x350482,0xc9))[_0xc42d('0x4a')](handleError(_0x350482,null));};exports[_0xc42d('0x27')]=function(_0x1354f9,_0x217ee2){if(_0x1354f9[_0xc42d('0x50')]['id']){delete _0x1354f9[_0xc42d('0x50')]['id'];}return db[_0xc42d('0x32')][_0xc42d('0x4e')]({'where':{'id':_0x1354f9['params']['id']}})[_0xc42d('0x2c')](handleEntityNotFound(_0x217ee2,null))[_0xc42d('0x2c')](saveUpdates(_0x1354f9['body'],null))[_0xc42d('0x2c')](respondWithResult(_0x217ee2,null))[_0xc42d('0x4a')](handleError(_0x217ee2,null));};exports[_0xc42d('0x28')]=function(_0x1d99ae,_0x237fb1){return db[_0xc42d('0x32')][_0xc42d('0x4e')]({'where':{'id':_0x1d99ae['params']['id']}})[_0xc42d('0x2c')](handleEntityNotFound(_0x237fb1,null))['then'](removeEntity(_0x237fb1,null))[_0xc42d('0x4a')](handleError(_0x237fb1,null));};exports[_0xc42d('0x55')]=function(_0x3d2ecb,_0x3a6d45){return db[_0xc42d('0x32')][_0xc42d('0x55')]()['then'](respondWithResult(_0x3a6d45,null))[_0xc42d('0x4a')](handleError(_0x3a6d45,null));};exports[_0xc42d('0x56')]=function(_0x20fd32,_0x23c043,_0x2e8220){var _0x464c94={'raw':!![],'where':{}},_0x37b3d9={},_0x1e37fa;return db['FaxQueue'][_0xc42d('0x57')]({'where':{'id':_0x20fd32['params']['id']}})[_0xc42d('0x2c')](handleEntityNotFound(_0x23c043,null))[_0xc42d('0x2c')](function(_0x3481e3){if(_0x3481e3){_0x1e37fa=_0x3481e3[_0xc42d('0x29')]({'plain':!![]});_0x37b3d9['model']=_[_0xc42d('0x38')](db['UserFaxQueue']['rawAttributes']);_0x37b3d9[_0xc42d('0x37')]=_['keys'](_0x20fd32[_0xc42d('0x37')]);_0x37b3d9[_0xc42d('0x39')]=_[_0xc42d('0x3b')](_0x37b3d9[_0xc42d('0x36')],_0x37b3d9['query']);_0x464c94['attributes']=_['intersection'](_0x37b3d9['model'],qs[_0xc42d('0x3c')](_0x20fd32[_0xc42d('0x37')][_0xc42d('0x3c')]));_0x464c94[_0xc42d('0x3a')]=_0x464c94['attributes'][_0xc42d('0x58')]?_0x464c94[_0xc42d('0x3a')]:_0x37b3d9[_0xc42d('0x36')];if(!_0x20fd32[_0xc42d('0x37')][_0xc42d('0x3d')](_0xc42d('0x3e'))){_0x464c94['limit']=qs[_0xc42d('0x20')](_0x20fd32['query']['limit']);_0x464c94[_0xc42d('0x1f')]=qs[_0xc42d('0x1f')](_0x20fd32[_0xc42d('0x37')][_0xc42d('0x1f')]);}_0x464c94[_0xc42d('0x3f')]=qs[_0xc42d('0x40')](_0x20fd32[_0xc42d('0x37')]['sort']);_0x464c94['where']=qs['filters'](_['pick'](_0x20fd32[_0xc42d('0x37')],_0x37b3d9[_0xc42d('0x39')]));_0x464c94[_0xc42d('0x41')]['FaxQueueId']=_0x3481e3['id'];if(_0x20fd32[_0xc42d('0x37')][_0xc42d('0x43')]){_0x464c94[_0xc42d('0x41')]=_[_0xc42d('0x4d')](_0x464c94[_0xc42d('0x41')],{'$or':_[_0xc42d('0x31')](_0x464c94['attributes'],function(_0x38e9be){var _0x576297={};_0x576297[_0x38e9be]={'$like':'%'+_0x20fd32[_0xc42d('0x37')][_0xc42d('0x43')]+'%'};return _0x576297;})});}_0x464c94=_[_0xc42d('0x4d')]({},_0x464c94,_0x20fd32[_0xc42d('0x46')]);return db[_0xc42d('0x59')][_0xc42d('0x5a')](_0x464c94);}})['then'](function(_0x4314ab){if(_0x4314ab){return db[_0xc42d('0x5b')][_0xc42d('0x5c')]({'where':{'id':_[_0xc42d('0x31')](_0x4314ab,'UserId'),'role':_0xc42d('0x5d')},'attributes':['id',_0xc42d('0x2f'),_0xc42d('0x5e'),_0xc42d('0x5f'),_0xc42d('0x60')]});}})[_0xc42d('0x2c')](function(_0x33e5ee){if(_0x33e5ee){return{'count':_0x33e5ee[_0xc42d('0x22')],'rows':_[_0xc42d('0x31')](_0x33e5ee[_0xc42d('0x49')],function(_0x44a390){return{'membername':_0x44a390[_0xc42d('0x2f')],'UserId':_0x44a390['id'],'queue_name':_0x1e37fa[_0xc42d('0x2f')],'FaxQueueId':_0x1e37fa['id'],'interface':util[_0xc42d('0x61')](_0xc42d('0x62'),_0xc42d('0x63'),_0x44a390[_0xc42d('0x2f')]),'penalty':0x0,'paused':_0x44a390[_0xc42d('0x5e')],'createdAt':_0x44a390[_0xc42d('0x60')],'updatedAt':_0x44a390['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc42d('0x2c')](respondWithFilteredResult(_0x23c043,_0x464c94))[_0xc42d('0x4a')](handleError(_0x23c043,null));};exports[_0xc42d('0x64')]=function(_0x3ebf47,_0x132777,_0x27c2f7){var _0x175434={};var _0x4164a6={};var _0x2f9dd0;var _0x37d6f6;return db[_0xc42d('0x32')]['findOne']({'where':{'id':_0x3ebf47[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2c')](handleEntityNotFound(_0x132777,null))['then'](function(_0x1e4d13){if(_0x1e4d13){_0x2f9dd0=_0x1e4d13;_0x4164a6[_0xc42d('0x36')]=_[_0xc42d('0x38')](db[_0xc42d('0x65')][_0xc42d('0x33')]);_0x4164a6['query']=_['keys'](_0x3ebf47[_0xc42d('0x37')]);_0x4164a6['filters']=_[_0xc42d('0x3b')](_0x4164a6[_0xc42d('0x36')],_0x4164a6[_0xc42d('0x37')]);_0x175434[_0xc42d('0x3a')]=_[_0xc42d('0x3b')](_0x4164a6['model'],qs[_0xc42d('0x3c')](_0x3ebf47['query'][_0xc42d('0x3c')]));_0x175434['attributes']=_0x175434['attributes']['length']?_0x175434[_0xc42d('0x3a')]:_0x4164a6[_0xc42d('0x36')];_0x175434['order']=qs[_0xc42d('0x40')](_0x3ebf47[_0xc42d('0x37')][_0xc42d('0x40')]);_0x175434[_0xc42d('0x41')]=qs['filters'](_[_0xc42d('0x42')](_0x3ebf47[_0xc42d('0x37')],_0x4164a6[_0xc42d('0x39')]));if(_0x3ebf47[_0xc42d('0x37')][_0xc42d('0x43')]){_0x175434[_0xc42d('0x41')]=_[_0xc42d('0x4d')](_0x175434[_0xc42d('0x41')],{'$or':_['map'](_0x175434[_0xc42d('0x3a')],function(_0x45bac8){var _0x554a62={};_0x554a62[_0x45bac8]={'$like':'%'+_0x3ebf47['query']['filter']+'%'};return _0x554a62;})});}_0x175434=_[_0xc42d('0x4d')]({},_0x175434,_0x3ebf47['options']);return _0x2f9dd0[_0xc42d('0x64')](_0x175434);}})[_0xc42d('0x2c')](function(_0x3cb4e7){if(_0x3cb4e7){_0x37d6f6=_0x3cb4e7[_0xc42d('0x58')];if(!_0x3ebf47[_0xc42d('0x37')][_0xc42d('0x3d')](_0xc42d('0x3e'))){_0x175434[_0xc42d('0x20')]=qs[_0xc42d('0x20')](_0x3ebf47['query'][_0xc42d('0x20')]);_0x175434[_0xc42d('0x1f')]=qs[_0xc42d('0x1f')](_0x3ebf47['query'][_0xc42d('0x1f')]);}return _0x2f9dd0[_0xc42d('0x64')](_0x175434);}})['then'](function(_0x392d41){if(_0x392d41){return _0x392d41?{'count':_0x37d6f6,'rows':_0x392d41}:null;}})[_0xc42d('0x2c')](respondWithResult(_0x132777,null))[_0xc42d('0x4a')](handleError(_0x132777,null));};exports[_0xc42d('0x66')]=function(_0x5af597,_0x12df36,_0x2df123){var _0x6be97=_0x5af597['body'][_0xc42d('0x67')];return db[_0xc42d('0x65')][_0xc42d('0x5a')]({'where':{'id':_0x6be97},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc42d('0x68'),'attributes':['id',_0xc42d('0x2f'),_0xc42d('0x69'),_0xc42d('0x6a'),'interface'],'raw':!![]}]})[_0xc42d('0x2c')](function(_0x5d35f3){if(_0x5d35f3){var _0x3e4fe7=_[_0xc42d('0x6b')](_0x5d35f3,function(_0x1ede3b){var _0x3762d6=_0x1ede3b[_0xc42d('0x29')]({'plain':!![]});return _0x3762d6['Agents'];});return db[_0xc42d('0x32')][_0xc42d('0x4e')]({'where':{'id':_0x5af597[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2c')](function(_0x90fe32){return db[_0xc42d('0x6c')][_0xc42d('0x6d')](function(_0x27a40b){return _0x90fe32[_0xc42d('0x66')](_0x6be97,{'transaction':_0x27a40b})[_0xc42d('0x2c')](function(){return BPromise[_0xc42d('0x6e')](_0x3e4fe7,function(_0x29b757){return db[_0xc42d('0x59')]['findOrCreate']({'where':{'UserId':_0x29b757['id'],'FaxQueueId':_0x5af597['params']['id']},'transaction':_0x27a40b});});})[_0xc42d('0x2c')](function(){_0x3e4fe7[_0xc42d('0x6f')](function(_0xc60ef5){socket[_0xc42d('0x70')](_0xc42d('0x71'),{'UserId':_0xc60ef5['id'],'FaxQueueId':_0x90fe32['id']});});});});});}})[_0xc42d('0x2c')](respondWithStatusCode(_0x12df36,null))['catch'](handleError(_0x12df36,null));};exports[_0xc42d('0x72')]=function(_0x46f6b3,_0xcd9525,_0x5236d9){return db['Team'][_0xc42d('0x5a')]({'where':{'id':_0x46f6b3[_0xc42d('0x37')][_0xc42d('0x67')]},'attributes':['id'],'include':[{'model':db[_0xc42d('0x5b')],'as':_0xc42d('0x68'),'attributes':['id'],'raw':!![]}]})[_0xc42d('0x2c')](handleEntityNotFound(_0xcd9525,null))[_0xc42d('0x2c')](function(_0x47c1d9){var _0x4fb96c=_[_0xc42d('0x31')](_0x47c1d9,'id');var _0x5cd974=[];var _0x1afe53=[];var _0x1bc740=squel[_0xc42d('0x73')]();_0x1bc740['field']('tq.TeamId')[_0xc42d('0x74')]('team_has_fax_queues','tq')[_0xc42d('0x75')]('user_has_teams','ut',_0xc42d('0x76'))['where']('FaxQueueId\x20=\x20?',_0x46f6b3['params']['id']);for(var _0x272395=0x0;_0x272395<_0x47c1d9[_0xc42d('0x58')];_0x272395+=0x1){let _0x99939=_0x47c1d9[_0x272395];for(var _0x364bd6=0x0;_0x364bd6<_0x99939[_0xc42d('0x68')][_0xc42d('0x58')];_0x364bd6+=0x1){let _0x1baed9=_0x99939[_0xc42d('0x68')][_0x364bd6];var _0x25de67=_0x1bc740[_0xc42d('0x77')]();_0x25de67[_0xc42d('0x41')](_0xc42d('0x78'),_0x1baed9['id']);_0x1afe53[_0xc42d('0x79')](db[_0xc42d('0x6c')][_0xc42d('0x37')](_0x25de67[_0xc42d('0x7a')](),{'type':db[_0xc42d('0x6c')]['QueryTypes'][_0xc42d('0x7b')]})[_0xc42d('0x2c')](function(_0x4d37b0){if(_0x4d37b0[_0xc42d('0x58')]===0x1){return _0x1baed9['id'];}else{var _0x1ae062=_[_0xc42d('0x7c')](_['map'](_0x4d37b0,_0xc42d('0x7d')),function(_0x168030){return _[_0xc42d('0x7e')](_0x4fb96c,_0x168030);});if(_0x1ae062){return _0x1baed9['id'];}}}));}}return BPromise[_0xc42d('0x7f')](_0x1afe53)[_0xc42d('0x2c')](function(_0x39309d){_0x5cd974=_(_0x5cd974)[_0xc42d('0x80')](_0x39309d)[_0xc42d('0x81')]()['value']();return db[_0xc42d('0x32')][_0xc42d('0x4e')]({'where':{'id':_0x46f6b3[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2c')](function(_0xd8bd18){return db[_0xc42d('0x6c')][_0xc42d('0x6d')](function(_0xb9dde1){return _0xd8bd18[_0xc42d('0x72')](_0x46f6b3[_0xc42d('0x37')][_0xc42d('0x67')],{'transaction':_0xb9dde1})[_0xc42d('0x2c')](function(){if(!_[_0xc42d('0x82')](_0x5cd974)){return _0xd8bd18[_0xc42d('0x83')](_0x5cd974,{'transaction':_0xb9dde1});}})[_0xc42d('0x2c')](function(){_0x5cd974['forEach'](function(_0x312c6e){socket['emit']('userFaxQueue:remove',{'UserId':_0x312c6e,'FaxQueueId':_0xd8bd18['id']});});});});});});})[_0xc42d('0x2c')](respondWithStatusCode(_0xcd9525,null))[_0xc42d('0x4a')](handleError(_0xcd9525,null));};exports[_0xc42d('0x84')]=function(_0x4f78c1,_0x422d10,_0x1d3c9a){return db[_0xc42d('0x32')][_0xc42d('0x4e')]({'where':{'id':_0x4f78c1[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2c')](handleEntityNotFound(_0x422d10,null))['then'](function(_0x50967d){if(_0x50967d){return _0x50967d[_0xc42d('0x84')](_0x4f78c1[_0xc42d('0x50')]['ids'],_['omit'](_0x4f78c1[_0xc42d('0x50')],[_0xc42d('0x67'),'id'])||{})[_0xc42d('0x85')](function(_0x5f5d6e){for(var _0x3a28ab=0x0;_0x3a28ab<_0x4f78c1[_0xc42d('0x50')][_0xc42d('0x67')]['length'];_0x3a28ab+=0x1){socket[_0xc42d('0x70')](_0xc42d('0x71'),{'UserId':Number(_0x4f78c1['body'][_0xc42d('0x67')][_0x3a28ab]),'FaxQueueId':Number(_0x4f78c1[_0xc42d('0x4c')]['id'])});}return _0x5f5d6e;});}})[_0xc42d('0x2c')](respondWithResult(_0x422d10,null))['catch'](handleError(_0x422d10,null));};exports[_0xc42d('0x83')]=function(_0x508fa4,_0x241a3f,_0x53fced){return db[_0xc42d('0x32')]['find']({'where':{'id':_0x508fa4[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2c')](handleEntityNotFound(_0x241a3f,null))[_0xc42d('0x2c')](function(_0x5a7df6){if(_0x5a7df6){return _0x5a7df6[_0xc42d('0x83')](_0x508fa4[_0xc42d('0x37')][_0xc42d('0x67')])['then'](function(){if(_[_0xc42d('0x86')](_0x508fa4[_0xc42d('0x37')][_0xc42d('0x67')])){for(var _0x5b87b9=0x0;_0x5b87b9<_0x508fa4['query']['ids'][_0xc42d('0x58')];_0x5b87b9+=0x1){socket[_0xc42d('0x70')](_0xc42d('0x87'),{'UserId':Number(_0x508fa4[_0xc42d('0x37')][_0xc42d('0x67')][_0x5b87b9]),'FaxQueueId':Number(_0x508fa4[_0xc42d('0x4c')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x508fa4[_0xc42d('0x37')][_0xc42d('0x67')]),'FaxQueueId':Number(_0x508fa4[_0xc42d('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x241a3f,null))[_0xc42d('0x4a')](handleError(_0x241a3f,null));};exports[_0xc42d('0x88')]=function(_0x707e86,_0x3873e7,_0x416b4e){var _0xbeb923={};var _0x54695b={};var _0x2d4b88;var _0x363425;return db[_0xc42d('0x32')][_0xc42d('0x57')]({'where':{'id':_0x707e86[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2c')](handleEntityNotFound(_0x3873e7,null))[_0xc42d('0x2c')](function(_0x118852){if(_0x118852){_0x2d4b88=_0x118852;_0x54695b[_0xc42d('0x36')]=_[_0xc42d('0x38')](db[_0xc42d('0x5b')]['rawAttributes']);_0x54695b[_0xc42d('0x37')]=_[_0xc42d('0x38')](_0x707e86[_0xc42d('0x37')]);_0x54695b[_0xc42d('0x39')]=_['intersection'](_0x54695b[_0xc42d('0x36')],_0x54695b[_0xc42d('0x37')]);_0xbeb923[_0xc42d('0x3a')]=_[_0xc42d('0x3b')](_0x54695b['model'],qs[_0xc42d('0x3c')](_0x707e86['query'][_0xc42d('0x3c')]));_0xbeb923[_0xc42d('0x3a')]=_0xbeb923[_0xc42d('0x3a')]['length']?_0xbeb923[_0xc42d('0x3a')]:_0x54695b[_0xc42d('0x36')];_0xbeb923[_0xc42d('0x3f')]=qs[_0xc42d('0x40')](_0x707e86['query']['sort']);_0xbeb923[_0xc42d('0x41')]=qs[_0xc42d('0x39')](_[_0xc42d('0x42')](_0x707e86['query'],_0x54695b[_0xc42d('0x39')]));if(_0x707e86['query'][_0xc42d('0x43')]){_0xbeb923[_0xc42d('0x41')]=_[_0xc42d('0x4d')](_0xbeb923[_0xc42d('0x41')],{'$or':_[_0xc42d('0x31')](_0xbeb923[_0xc42d('0x3a')],function(_0x4d8d33){var _0x5b31f0={};_0x5b31f0[_0x4d8d33]={'$like':'%'+_0x707e86[_0xc42d('0x37')]['filter']+'%'};return _0x5b31f0;})});}_0xbeb923=_['merge']({},_0xbeb923,_0x707e86[_0xc42d('0x46')]);return _0x2d4b88[_0xc42d('0x88')](_0xbeb923);}})[_0xc42d('0x2c')](function(_0x38efd2){if(_0x38efd2){_0x363425=_0x38efd2['length'];if(!_0x707e86[_0xc42d('0x37')][_0xc42d('0x3d')](_0xc42d('0x3e'))){_0xbeb923['limit']=qs[_0xc42d('0x20')](_0x707e86[_0xc42d('0x37')][_0xc42d('0x20')]);_0xbeb923[_0xc42d('0x1f')]=qs[_0xc42d('0x1f')](_0x707e86[_0xc42d('0x37')][_0xc42d('0x1f')]);}return _0x2d4b88[_0xc42d('0x88')](_0xbeb923);}})[_0xc42d('0x2c')](function(_0x250cf9){if(_0x250cf9){return _0x250cf9?{'count':_0x363425,'rows':_0x250cf9}:null;}})['then'](respondWithResult(_0x3873e7,null))['catch'](handleError(_0x3873e7,null));};
\ No newline at end of file
index 8e9dd14..49884fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb627=['hasOwnProperty','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb627,0xe1));var _0x7b62=function(_0x2a18ff,_0x1cde3a){_0x2a18ff=_0x2a18ff-0x0;var _0x1ab0b5=_0xb627[_0x2a18ff];return _0x1ab0b5;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x7b62('0x0'))['db'][_0x7b62('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7b62('0x2')](0x0);var events={'afterCreate':_0x7b62('0x3'),'afterUpdate':_0x7b62('0x4'),'afterDestroy':_0x7b62('0x5')};function emitEvent(_0x121439){return function(_0xd34045,_0x2d715b,_0x18e6ab){FaxQueueEvents[_0x7b62('0x6')](_0x121439+':'+_0xd34045['id'],_0xd34045);FaxQueueEvents[_0x7b62('0x6')](_0x121439,_0xd34045);_0x18e6ab(null);};}for(var e in events){if(events[_0x7b62('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
+var _0x1215=['remove','emit','hasOwnProperty','hook','../../mysqldb','save','update'];(function(_0xe78b1c,_0x52d144){var _0x1586a7=function(_0x4f7fb5){while(--_0x4f7fb5){_0xe78b1c['push'](_0xe78b1c['shift']());}};_0x1586a7(++_0x52d144);}(_0x1215,0x1d2));var _0x5121=function(_0x3e449b,_0x4db44f){_0x3e449b=_0x3e449b-0x0;var _0x15ae82=_0x1215[_0x3e449b];return _0x15ae82;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x5121('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5121('0x1'),'afterUpdate':_0x5121('0x2'),'afterDestroy':_0x5121('0x3')};function emitEvent(_0xe90feb){return function(_0x1397d5,_0x32b961,_0x375473){FaxQueueEvents[_0x5121('0x4')](_0xe90feb+':'+_0x1397d5['id'],_0x1397d5);FaxQueueEvents['emit'](_0xe90feb,_0x1397d5);_0x375473(null);};}for(var e in events){if(events[_0x5121('0x5')](e)){var event=events[e];FaxQueue[_0x5121('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
index e789d0f..87d9322 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x731c=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','fax_queues','lodash'];(function(_0x20ae1e,_0x735fa){var _0x35e67e=function(_0x431562){while(--_0x431562){_0x20ae1e['push'](_0x20ae1e['shift']());}};_0x35e67e(++_0x735fa);}(_0x731c,0x1e3));var _0xc731=function(_0x16889d,_0x308b58){_0x16889d=_0x16889d-0x0;var _0x13d133=_0x731c[_0x16889d];return _0x13d133;};'use strict';var _=require(_0xc731('0x0'));var util=require(_0xc731('0x1'));var logger=require(_0xc731('0x2'))(_0xc731('0x3'));var moment=require(_0xc731('0x4'));var BPromise=require(_0xc731('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc731('0x6'));var rimraf=require(_0xc731('0x7'));var config=require(_0xc731('0x8'));var attributes=require('./faxQueue.attributes');module[_0xc731('0x9')]=function(_0x35217a,_0x5d6fc8){return _0x35217a['define']('FaxQueue',attributes,{'tableName':_0xc731('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4032=['fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4032,0x139));var _0x2403=function(_0x156b23,_0x361acf){_0x156b23=_0x156b23-0x0;var _0x26d5ee=_0x4032[_0x156b23];return _0x26d5ee;};'use strict';var _=require(_0x2403('0x0'));var util=require(_0x2403('0x1'));var logger=require(_0x2403('0x2'))(_0x2403('0x3'));var moment=require(_0x2403('0x4'));var BPromise=require(_0x2403('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2403('0x6'));var rimraf=require('rimraf');var config=require(_0x2403('0x7'));var attributes=require(_0x2403('0x8'));module[_0x2403('0x9')]=function(_0x4884ec,_0xfffdd3){return _0x4884ec[_0x2403('0xa')]('FaxQueue',attributes,{'tableName':_0x2403('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 554510b..e3d4030 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x146e=['redis','localhost','register','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','FaxQueue','options','raw','where','attributes','limit','include','map','model','then','GetFaxQueue','debug','stringify','ShowFaxQueue','find','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http'];(function(_0x195f81,_0x15de17){var _0x3f7e16=function(_0x11a1ff){while(--_0x11a1ff){_0x195f81['push'](_0x195f81['shift']());}};_0x3f7e16(++_0x15de17);}(_0x146e,0x1d4));var _0xe146=function(_0x4f18da,_0x34dd74){_0x4f18da=_0x4f18da-0x0;var _0x36d46b=_0x146e[_0x4f18da];return _0x36d46b;};'use strict';var _=require(_0xe146('0x0'));var util=require('util');var moment=require(_0xe146('0x1'));var BPromise=require('bluebird');var rs=require(_0xe146('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe146('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe146('0x4'))('rpc');var config=require(_0xe146('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe146('0x6')][_0xe146('0x7')]({'port':0x232a});config[_0xe146('0x8')]=_['defaults'](config[_0xe146('0x8')],{'host':_0xe146('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe146('0x8')]));require('./faxQueue.socket')[_0xe146('0xa')](socket);function respondWithRpcPromise(_0x594539,_0x25c2b5,_0x4ff456){return new BPromise(function(_0x1dcff8,_0x5cc08d){return client['request'](_0x594539,_0x4ff456)['then'](function(_0x335d8c){logger[_0xe146('0xb')](_0xe146('0xc'),_0x25c2b5,'request\x20sent');logger['debug'](_0xe146('0xd'),_0x25c2b5,_0xe146('0xe'),JSON['stringify'](_0x335d8c));if(_0x335d8c[_0xe146('0xf')]){if(_0x335d8c[_0xe146('0xf')]['code']===0x1f4){logger['error'](_0xe146('0xc'),_0x25c2b5,_0x335d8c['error'][_0xe146('0x10')]);return _0x5cc08d(_0x335d8c[_0xe146('0xf')][_0xe146('0x10')]);}logger[_0xe146('0xf')](_0xe146('0xc'),_0x25c2b5,_0x335d8c['error'][_0xe146('0x10')]);return _0x1dcff8(_0x335d8c[_0xe146('0xf')]['message']);}else{logger[_0xe146('0xb')]('FaxQueue,\x20%s,\x20%s',_0x25c2b5,_0xe146('0xe'));_0x1dcff8(_0x335d8c[_0xe146('0x11')][_0xe146('0x10')]);}})[_0xe146('0x12')](function(_0x3dbed2){logger['error'](_0xe146('0xc'),_0x25c2b5,_0x3dbed2);_0x5cc08d(_0x3dbed2);});});}exports['GetFaxQueue']=function(_0x1943b9){var _0x41fbb9=this;return new Promise(function(_0xdd0db2,_0x5aa0a1){return db[_0xe146('0x13')]['findAll']({'raw':_0x1943b9[_0xe146('0x14')]?_0x1943b9[_0xe146('0x14')][_0xe146('0x15')]===undefined?!![]:![]:!![],'where':_0x1943b9['options']?_0x1943b9['options'][_0xe146('0x16')]||null:null,'attributes':_0x1943b9[_0xe146('0x14')]?_0x1943b9[_0xe146('0x14')][_0xe146('0x17')]||null:null,'limit':_0x1943b9[_0xe146('0x14')]?_0x1943b9[_0xe146('0x14')][_0xe146('0x18')]||null:null,'include':_0x1943b9[_0xe146('0x14')]?_0x1943b9[_0xe146('0x14')][_0xe146('0x19')]?_[_0xe146('0x1a')](_0x1943b9[_0xe146('0x14')][_0xe146('0x19')],function(_0x3c3f56){return{'model':db[_0x3c3f56[_0xe146('0x1b')]],'as':_0x3c3f56['as'],'attributes':_0x3c3f56[_0xe146('0x17')],'include':_0x3c3f56[_0xe146('0x19')]?_[_0xe146('0x1a')](_0x3c3f56[_0xe146('0x19')],function(_0x292f03){return{'model':db[_0x292f03[_0xe146('0x1b')]],'as':_0x292f03['as'],'attributes':_0x292f03['attributes'],'include':_0x292f03['include']?_['map'](_0x292f03[_0xe146('0x19')],function(_0x388d3e){return{'model':db[_0x388d3e[_0xe146('0x1b')]],'as':_0x388d3e['as'],'attributes':_0x388d3e[_0xe146('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe146('0x1c')](function(_0x5023cb){logger[_0xe146('0xb')](_0xe146('0x1d'),_0x1943b9);logger[_0xe146('0x1e')](_0xe146('0x1d'),_0x1943b9,JSON[_0xe146('0x1f')](_0x5023cb));_0xdd0db2(_0x5023cb);})[_0xe146('0x12')](function(_0x2f8a73){logger[_0xe146('0xf')](_0xe146('0x1d'),_0x2f8a73['message'],_0x1943b9);_0x5aa0a1(_0x41fbb9[_0xe146('0xf')](0x1f4,_0x2f8a73[_0xe146('0x10')]));});});};exports[_0xe146('0x20')]=function(_0x175f29){var _0x10a637=this;return new Promise(function(_0x3f5aeb,_0x4ba916){return db[_0xe146('0x13')][_0xe146('0x21')]({'raw':_0x175f29[_0xe146('0x14')]?_0x175f29[_0xe146('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x175f29[_0xe146('0x14')]?_0x175f29[_0xe146('0x14')][_0xe146('0x16')]||null:null,'attributes':_0x175f29['options']?_0x175f29['options'][_0xe146('0x17')]||null:null,'include':_0x175f29[_0xe146('0x14')]?_0x175f29[_0xe146('0x14')][_0xe146('0x19')]?_['map'](_0x175f29['options'][_0xe146('0x19')],function(_0x300db4){return{'model':db[_0x300db4[_0xe146('0x1b')]],'as':_0x300db4['as'],'attributes':_0x300db4[_0xe146('0x17')],'include':_0x300db4[_0xe146('0x19')]?_['map'](_0x300db4[_0xe146('0x19')],function(_0x5541e7){return{'model':db[_0x5541e7[_0xe146('0x1b')]],'as':_0x5541e7['as'],'attributes':_0x5541e7[_0xe146('0x17')],'include':_0x5541e7[_0xe146('0x19')]?_[_0xe146('0x1a')](_0x5541e7['include'],function(_0x1e1c0f){return{'model':db[_0x1e1c0f[_0xe146('0x1b')]],'as':_0x1e1c0f['as'],'attributes':_0x1e1c0f[_0xe146('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe146('0x1c')](function(_0x511029){logger[_0xe146('0xb')](_0xe146('0x20'),_0x175f29);logger[_0xe146('0x1e')](_0xe146('0x20'),_0x175f29,JSON[_0xe146('0x1f')](_0x511029));_0x3f5aeb(_0x511029);})['catch'](function(_0x251fe0){logger[_0xe146('0xf')](_0xe146('0x20'),_0x251fe0[_0xe146('0x10')],_0x175f29);_0x4ba916(_0x10a637[_0xe146('0xf')](0x1f4,_0x251fe0[_0xe146('0x10')]));});});};
\ No newline at end of file
+var _0x61cd=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetFaxQueue','find','ShowFaxQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xc8e387,_0x31b2b4){var _0x3610c9=function(_0x511776){while(--_0x511776){_0xc8e387['push'](_0xc8e387['shift']());}};_0x3610c9(++_0x31b2b4);}(_0x61cd,0x111));var _0xd61c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x61cd[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd61c('0x0'));var util=require(_0xd61c('0x1'));var moment=require('moment');var BPromise=require(_0xd61c('0x2'));var rs=require(_0xd61c('0x3'));var fs=require('fs');var Redis=require(_0xd61c('0x4'));var db=require(_0xd61c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd61c('0x6'))(_0xd61c('0x7'));var config=require('../../config/environment');var jayson=require(_0xd61c('0x8'));var client=jayson[_0xd61c('0x9')][_0xd61c('0xa')]({'port':0x232a});config[_0xd61c('0xb')]=_[_0xd61c('0xc')](config[_0xd61c('0xb')],{'host':_0xd61c('0xd'),'port':0x18eb});var socket=require(_0xd61c('0xe'))(new Redis(config['redis']));require(_0xd61c('0xf'))[_0xd61c('0x10')](socket);function respondWithRpcPromise(_0x1030f8,_0xf60c11,_0x321f3e){return new BPromise(function(_0x4b4b2c,_0x23f721){return client[_0xd61c('0x11')](_0x1030f8,_0x321f3e)[_0xd61c('0x12')](function(_0x392902){logger[_0xd61c('0x13')](_0xd61c('0x14'),_0xf60c11,_0xd61c('0x15'));logger[_0xd61c('0x16')](_0xd61c('0x17'),_0xf60c11,_0xd61c('0x15'),JSON[_0xd61c('0x18')](_0x392902));if(_0x392902[_0xd61c('0x19')]){if(_0x392902[_0xd61c('0x19')]['code']===0x1f4){logger[_0xd61c('0x19')](_0xd61c('0x14'),_0xf60c11,_0x392902[_0xd61c('0x19')][_0xd61c('0x1a')]);return _0x23f721(_0x392902[_0xd61c('0x19')]['message']);}logger['error']('FaxQueue,\x20%s,\x20%s',_0xf60c11,_0x392902['error'][_0xd61c('0x1a')]);return _0x4b4b2c(_0x392902[_0xd61c('0x19')][_0xd61c('0x1a')]);}else{logger[_0xd61c('0x13')]('FaxQueue,\x20%s,\x20%s',_0xf60c11,'request\x20sent');_0x4b4b2c(_0x392902['result']['message']);}})[_0xd61c('0x1b')](function(_0x1a74b3){logger[_0xd61c('0x19')](_0xd61c('0x14'),_0xf60c11,_0x1a74b3);_0x23f721(_0x1a74b3);});});}exports['GetFaxQueue']=function(_0x280798){var _0x41b019=this;return new Promise(function(_0x15df09,_0x1d77c2){return db['FaxQueue'][_0xd61c('0x1c')]({'raw':_0x280798[_0xd61c('0x1d')]?_0x280798[_0xd61c('0x1d')][_0xd61c('0x1e')]===undefined?!![]:![]:!![],'where':_0x280798['options']?_0x280798[_0xd61c('0x1d')][_0xd61c('0x1f')]||null:null,'attributes':_0x280798['options']?_0x280798[_0xd61c('0x1d')][_0xd61c('0x20')]||null:null,'limit':_0x280798[_0xd61c('0x1d')]?_0x280798[_0xd61c('0x1d')][_0xd61c('0x21')]||null:null,'include':_0x280798[_0xd61c('0x1d')]?_0x280798[_0xd61c('0x1d')][_0xd61c('0x22')]?_['map'](_0x280798[_0xd61c('0x1d')][_0xd61c('0x22')],function(_0x1fe879){return{'model':db[_0x1fe879[_0xd61c('0x23')]],'as':_0x1fe879['as'],'attributes':_0x1fe879[_0xd61c('0x20')],'include':_0x1fe879[_0xd61c('0x22')]?_[_0xd61c('0x24')](_0x1fe879[_0xd61c('0x22')],function(_0x44c3c7){return{'model':db[_0x44c3c7[_0xd61c('0x23')]],'as':_0x44c3c7['as'],'attributes':_0x44c3c7[_0xd61c('0x20')],'include':_0x44c3c7[_0xd61c('0x22')]?_[_0xd61c('0x24')](_0x44c3c7['include'],function(_0x320be7){return{'model':db[_0x320be7[_0xd61c('0x23')]],'as':_0x320be7['as'],'attributes':_0x320be7[_0xd61c('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2646eb){logger['info']('GetFaxQueue',_0x280798);logger[_0xd61c('0x16')](_0xd61c('0x25'),_0x280798,JSON['stringify'](_0x2646eb));_0x15df09(_0x2646eb);})[_0xd61c('0x1b')](function(_0x549345){logger[_0xd61c('0x19')](_0xd61c('0x25'),_0x549345[_0xd61c('0x1a')],_0x280798);_0x1d77c2(_0x41b019[_0xd61c('0x19')](0x1f4,_0x549345['message']));});});};exports['ShowFaxQueue']=function(_0x432b25){var _0x48483c=this;return new Promise(function(_0x2157cf,_0x1ad364){return db['FaxQueue'][_0xd61c('0x26')]({'raw':_0x432b25['options']?_0x432b25[_0xd61c('0x1d')][_0xd61c('0x1e')]===undefined?!![]:![]:!![],'where':_0x432b25[_0xd61c('0x1d')]?_0x432b25[_0xd61c('0x1d')][_0xd61c('0x1f')]||null:null,'attributes':_0x432b25[_0xd61c('0x1d')]?_0x432b25[_0xd61c('0x1d')]['attributes']||null:null,'include':_0x432b25['options']?_0x432b25[_0xd61c('0x1d')]['include']?_[_0xd61c('0x24')](_0x432b25[_0xd61c('0x1d')][_0xd61c('0x22')],function(_0x4eb25e){return{'model':db[_0x4eb25e[_0xd61c('0x23')]],'as':_0x4eb25e['as'],'attributes':_0x4eb25e[_0xd61c('0x20')],'include':_0x4eb25e[_0xd61c('0x22')]?_[_0xd61c('0x24')](_0x4eb25e[_0xd61c('0x22')],function(_0x37125f){return{'model':db[_0x37125f[_0xd61c('0x23')]],'as':_0x37125f['as'],'attributes':_0x37125f['attributes'],'include':_0x37125f[_0xd61c('0x22')]?_['map'](_0x37125f[_0xd61c('0x22')],function(_0x3b6263){return{'model':db[_0x3b6263[_0xd61c('0x23')]],'as':_0x3b6263['as'],'attributes':_0x3b6263['attributes']};}):[]};}):[]};}):[]:[]})[_0xd61c('0x12')](function(_0x5b18b6){logger[_0xd61c('0x13')](_0xd61c('0x27'),_0x432b25);logger[_0xd61c('0x16')](_0xd61c('0x27'),_0x432b25,JSON['stringify'](_0x5b18b6));_0x2157cf(_0x5b18b6);})[_0xd61c('0x1b')](function(_0x444b1e){logger[_0xd61c('0x19')](_0xd61c('0x27'),_0x444b1e[_0xd61c('0x1a')],_0x432b25);_0x1ad364(_0x48483c['error'](0x1f4,_0x444b1e[_0xd61c('0x1a')]));});});};
\ No newline at end of file
index 6a9134a..6c72400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6152=['register','faxQueue:','./faxQueue.events','save','remove','emit','removeListener'];(function(_0x27085f,_0x59d074){var _0x37f71b=function(_0x2800a7){while(--_0x2800a7){_0x27085f['push'](_0x27085f['shift']());}};_0x37f71b(++_0x59d074);}(_0x6152,0x95));var _0x2615=function(_0x59f981,_0x497e5f){_0x59f981=_0x59f981-0x0;var _0x3f458c=_0x6152[_0x59f981];return _0x3f458c;};'use strict';var FaxQueueEvents=require(_0x2615('0x0'));var events=[_0x2615('0x1'),_0x2615('0x2'),'update'];function createListener(_0x50bcaa,_0x2d9724){return function(_0x33df7c){_0x2d9724[_0x2615('0x3')](_0x50bcaa,_0x33df7c);};}function removeListener(_0x5ecca0,_0x78637e){return function(){FaxQueueEvents[_0x2615('0x4')](_0x5ecca0,_0x78637e);};}exports[_0x2615('0x5')]=function(_0x367069){for(var _0x2ce0ba=0x0,_0x13e166=events['length'];_0x2ce0ba<_0x13e166;_0x2ce0ba++){var _0xc3985f=events[_0x2ce0ba];var _0x313060=createListener(_0x2615('0x6')+_0xc3985f,_0x367069);FaxQueueEvents['on'](_0xc3985f,_0x313060);}};
\ No newline at end of file
+var _0x9fd0=['./faxQueue.events','emit','removeListener','register','length','faxQueue:'];(function(_0x12f98b,_0x2d378d){var _0x2b30bc=function(_0x36005f){while(--_0x36005f){_0x12f98b['push'](_0x12f98b['shift']());}};_0x2b30bc(++_0x2d378d);}(_0x9fd0,0x1c2));var _0x09fd=function(_0x4591c6,_0x229f57){_0x4591c6=_0x4591c6-0x0;var _0x36bc74=_0x9fd0[_0x4591c6];return _0x36bc74;};'use strict';var FaxQueueEvents=require(_0x09fd('0x0'));var events=['save','remove','update'];function createListener(_0x236af4,_0x4767fc){return function(_0x3b8626){_0x4767fc[_0x09fd('0x1')](_0x236af4,_0x3b8626);};}function removeListener(_0x298321,_0x1629ff){return function(){FaxQueueEvents[_0x09fd('0x2')](_0x298321,_0x1629ff);};}exports[_0x09fd('0x3')]=function(_0x509521){for(var _0x2b9262=0x0,_0x161604=events[_0x09fd('0x4')];_0x2b9262<_0x161604;_0x2b9262++){var _0x369e91=events[_0x2b9262];var _0xced1bc=createListener(_0x09fd('0x5')+_0x369e91,_0x509521);FaxQueueEvents['on'](_0x369e91,_0xced1bc);}};
\ No newline at end of file
index 6c7e2ca..1dcec96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f37=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','getTeams','getAgents','post','/:id/teams','addTeams','/:id/users','put','update','delete','removeTeams','removeAgents'];(function(_0x166957,_0x3eca1e){var _0x3a4697=function(_0x541f3d){while(--_0x541f3d){_0x166957['push'](_0x166957['shift']());}};_0x3a4697(++_0x3eca1e);}(_0x9f37,0xd1));var _0x79f3=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x9f37[_0x7e2eb0];return _0xd92de4;};'use strict';var multer=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var path=require('path');var timeout=require(_0x79f3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x79f3('0x3'));var auth=require(_0x79f3('0x4'));var interaction=require(_0x79f3('0x5'));var config=require('../../config/environment');var controller=require(_0x79f3('0x6'));router[_0x79f3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x79f3('0x7')](_0x79f3('0x8'),auth[_0x79f3('0x9')](),controller[_0x79f3('0xa')]);router['get'](_0x79f3('0xb'),auth[_0x79f3('0x9')](),controller['show']);router[_0x79f3('0x7')](_0x79f3('0xc'),auth[_0x79f3('0x9')](),controller[_0x79f3('0xd')]);router[_0x79f3('0x7')]('/:id/teams',auth[_0x79f3('0x9')](),controller[_0x79f3('0xe')]);router['get']('/:id/users',auth[_0x79f3('0x9')](),controller[_0x79f3('0xf')]);router[_0x79f3('0x10')]('/',auth[_0x79f3('0x9')](),controller['create']);router[_0x79f3('0x10')](_0x79f3('0x11'),auth[_0x79f3('0x9')](),controller[_0x79f3('0x12')]);router[_0x79f3('0x10')](_0x79f3('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0x79f3('0x14')](_0x79f3('0xb'),auth['isAuthenticated'](),controller[_0x79f3('0x15')]);router[_0x79f3('0x16')](_0x79f3('0xb'),auth[_0x79f3('0x9')](),controller['destroy']);router[_0x79f3('0x16')](_0x79f3('0x11'),auth[_0x79f3('0x9')](),controller[_0x79f3('0x17')]);router[_0x79f3('0x16')](_0x79f3('0x13'),auth[_0x79f3('0x9')](),controller[_0x79f3('0x18')]);module[_0x79f3('0x19')]=router;
\ No newline at end of file
+var _0xb934=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb934,0x92));var _0x4b93=function(_0x58b21a,_0x407f54){_0x58b21a=_0x58b21a-0x0;var _0x4ddfae=_0xb934[_0x58b21a];return _0x4ddfae;};'use strict';var multer=require(_0x4b93('0x0'));var util=require(_0x4b93('0x1'));var path=require(_0x4b93('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b93('0x3'));var router=express[_0x4b93('0x4')]();var fs_extra=require(_0x4b93('0x5'));var auth=require(_0x4b93('0x6'));var interaction=require(_0x4b93('0x7'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x4b93('0x8')]('/',auth[_0x4b93('0x9')](),controller[_0x4b93('0xa')]);router[_0x4b93('0x8')]('/describe',auth[_0x4b93('0x9')](),controller[_0x4b93('0xb')]);router[_0x4b93('0x8')](_0x4b93('0xc'),auth[_0x4b93('0x9')](),controller[_0x4b93('0xd')]);router[_0x4b93('0x8')](_0x4b93('0xe'),auth[_0x4b93('0x9')](),controller['getMembers']);router[_0x4b93('0x8')](_0x4b93('0xf'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x10')]);router[_0x4b93('0x8')](_0x4b93('0x11'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x12')]);router[_0x4b93('0x13')]('/',auth[_0x4b93('0x9')](),controller[_0x4b93('0x14')]);router[_0x4b93('0x13')](_0x4b93('0xf'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x15')]);router['post'](_0x4b93('0x11'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x16')]);router['put'](_0x4b93('0xc'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x17')]);router[_0x4b93('0x18')](_0x4b93('0xc'),auth['isAuthenticated'](),controller[_0x4b93('0x19')]);router[_0x4b93('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4b93('0x1a')]);router[_0x4b93('0x18')](_0x4b93('0x11'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x1b')]);module[_0x4b93('0x1c')]=router;
\ No newline at end of file
index dde1a18..305613c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x302e=['sequelize','STRING','DATE','moment'];(function(_0x34f9cd,_0xc6ab67){var _0x31ced2=function(_0x18e7b6){while(--_0x18e7b6){_0x34f9cd['push'](_0x34f9cd['shift']());}};_0x31ced2(++_0xc6ab67);}(_0x302e,0x187));var _0xe302=function(_0x396525,_0x3b2acb){_0x396525=_0x396525-0x0;var _0x5c6b7b=_0x302e[_0x396525];return _0x5c6b7b;};'use strict';var moment=require(_0xe302('0x0'));var Sequelize=require(_0xe302('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe302('0x2')]},'joinAt':{'type':Sequelize[_0xe302('0x3')]},'leaveAt':{'type':Sequelize[_0xe302('0x3')]},'acceptAt':{'type':Sequelize[_0xe302('0x3')]},'exitAt':{'type':Sequelize[_0xe302('0x3')]},'reason':{'type':Sequelize[_0xe302('0x2')]}};
\ No newline at end of file
+var _0x89bc=['sequelize','STRING','DATE'];(function(_0x51664f,_0x5e90e3){var _0x5587d2=function(_0x25dc9d){while(--_0x25dc9d){_0x51664f['push'](_0x51664f['shift']());}};_0x5587d2(++_0x5e90e3);}(_0x89bc,0x183));var _0xc89b=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x89bc[_0x587dd0];return _0x56f153;};'use strict';var moment=require('moment');var Sequelize=require(_0xc89b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc89b('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xc89b('0x1')]},'joinAt':{'type':Sequelize[_0xc89b('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc89b('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc89b('0x1')]}};
\ No newline at end of file
index 99e7eb4..bbad15e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e5=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','stack','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format'];(function(_0x1b69aa,_0x5aa147){var _0x42647d=function(_0x1743fd){while(--_0x1743fd){_0x1b69aa['push'](_0x1b69aa['shift']());}};_0x42647d(++_0x5aa147);}(_0x58e5,0xd1));var _0x558e=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x58e5[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require(_0x558e('0x0'));var rimraf=require(_0x558e('0x1'));var zipdir=require(_0x558e('0x2'));var jsonpatch=require(_0x558e('0x3'));var rp=require(_0x558e('0x4'));var moment=require(_0x558e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x558e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x558e('0x7'));var csv=require('to-csv');var ejs=require(_0x558e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x558e('0x9'));var squel=require(_0x558e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x558e('0xb'));var Redis=require(_0x558e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x558e('0xd'));var as=require(_0x558e('0xe'));var hardwareService=require(_0x558e('0xf'));var logger=require(_0x558e('0x10'))('api');var utils=require(_0x558e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x558e('0x12'));var db=require(_0x558e('0x13'))['db'];function respondWithStatusCode(_0x1328b5,_0x3bd154){_0x3bd154=_0x3bd154||0xcc;return function(_0x4a0889){if(_0x4a0889){return _0x1328b5[_0x558e('0x14')](_0x3bd154);}return _0x1328b5[_0x558e('0x15')](_0x3bd154)['end']();};}function respondWithResult(_0x288e2f,_0x9933cd){_0x9933cd=_0x9933cd||0xc8;return function(_0x4a6f57){if(_0x4a6f57){return _0x288e2f[_0x558e('0x15')](_0x9933cd)['json'](_0x4a6f57);}};}function respondWithFilteredResult(_0x134bdf,_0x13d3b1){return function(_0x5d61ab){if(_0x5d61ab){var _0x21552c=typeof _0x13d3b1[_0x558e('0x16')]===_0x558e('0x17')&&typeof _0x13d3b1[_0x558e('0x18')]==='undefined';var _0x2225d5=_0x5d61ab[_0x558e('0x19')];var _0x84da47=_0x21552c?0x0:_0x13d3b1[_0x558e('0x16')];var _0xb955b2=_0x21552c?_0x5d61ab[_0x558e('0x19')]:_0x13d3b1[_0x558e('0x16')]+_0x13d3b1['limit'];var _0x4afcfe;if(_0xb955b2>=_0x2225d5){_0xb955b2=_0x2225d5;_0x4afcfe=0xc8;}else{_0x4afcfe=0xce;}_0x134bdf[_0x558e('0x15')](_0x4afcfe);return _0x134bdf[_0x558e('0x1a')](_0x558e('0x1b'),_0x84da47+'-'+_0xb955b2+'/'+_0x2225d5)[_0x558e('0x1c')](_0x5d61ab);}return null;};}function patchUpdates(_0x208288){return function(_0xc046be){try{jsonpatch[_0x558e('0x1d')](_0xc046be,_0x208288,!![]);}catch(_0x2e3279){return BPromise[_0x558e('0x1e')](_0x2e3279);}return _0xc046be[_0x558e('0x1f')]();};}function saveUpdates(_0x4c402d,_0x39b61d){return function(_0x10d323){if(_0x10d323){return _0x10d323['update'](_0x4c402d)['then'](function(_0x448485){return _0x448485;});}return null;};}function removeEntity(_0x59a349,_0x87fb47){return function(_0x44b7fe){if(_0x44b7fe){return _0x44b7fe['destroy']()[_0x558e('0x20')](function(){_0x59a349[_0x558e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26874d,_0x4e9182){return function(_0x29caf3){if(!_0x29caf3){_0x26874d[_0x558e('0x14')](0x194);}return _0x29caf3;};}function handleError(_0x2ce831,_0x391da8){_0x391da8=_0x391da8||0x1f4;return function(_0x489f65){logger['error'](_0x489f65[_0x558e('0x21')]);if(_0x489f65['name']){delete _0x489f65['name'];}_0x2ce831[_0x558e('0x15')](_0x391da8)[_0x558e('0x22')](_0x489f65);};}exports[_0x558e('0x23')]=function(_0x17bf74,_0x42fb72){var _0x4deb75={},_0x2e0166={},_0x17a06c={'count':0x0,'rows':[]};var _0x9b421=_['map'](db[_0x558e('0x24')][_0x558e('0x25')],function(_0x254528){return{'name':_0x254528[_0x558e('0x26')],'type':_0x254528[_0x558e('0x27')][_0x558e('0x28')]};});_0x2e0166[_0x558e('0x29')]=_[_0x558e('0x2a')](_0x9b421,_0x558e('0x2b'));_0x2e0166[_0x558e('0x2c')]=_['keys'](_0x17bf74[_0x558e('0x2c')]);_0x2e0166[_0x558e('0x2d')]=_[_0x558e('0x2e')](_0x2e0166[_0x558e('0x29')],_0x2e0166['query']);_0x4deb75['attributes']=_[_0x558e('0x2e')](_0x2e0166[_0x558e('0x29')],qs[_0x558e('0x2f')](_0x17bf74[_0x558e('0x2c')]['fields']));_0x4deb75['attributes']=_0x4deb75[_0x558e('0x30')][_0x558e('0x31')]?_0x4deb75[_0x558e('0x30')]:_0x2e0166[_0x558e('0x29')];if(!_0x17bf74[_0x558e('0x2c')][_0x558e('0x32')](_0x558e('0x33'))){_0x4deb75[_0x558e('0x18')]=qs[_0x558e('0x18')](_0x17bf74[_0x558e('0x2c')][_0x558e('0x18')]);_0x4deb75['offset']=qs[_0x558e('0x16')](_0x17bf74[_0x558e('0x2c')]['offset']);}_0x4deb75['order']=qs['sort'](_0x17bf74[_0x558e('0x2c')][_0x558e('0x34')]);_0x4deb75['where']=qs[_0x558e('0x2d')](_[_0x558e('0x35')](_0x17bf74[_0x558e('0x2c')],_0x2e0166[_0x558e('0x2d')]),_0x9b421);if(_0x17bf74['query'][_0x558e('0x36')]){_0x4deb75[_0x558e('0x37')]=_['merge'](_0x4deb75['where'],{'$or':_[_0x558e('0x2a')](_0x9b421,function(_0x289adc){if(_0x289adc['type']!==_0x558e('0x38')){var _0x3f8f91={};_0x3f8f91[_0x289adc[_0x558e('0x2b')]]={'$like':'%'+_0x17bf74['query'][_0x558e('0x36')]+'%'};return _0x3f8f91;}})});}_0x4deb75=_[_0x558e('0x39')]({},_0x4deb75,_0x17bf74[_0x558e('0x3a')]);var _0x226aad={'where':_0x4deb75[_0x558e('0x37')]};return db[_0x558e('0x24')][_0x558e('0x19')](_0x226aad)[_0x558e('0x20')](function(_0x31dbaa){_0x17a06c['count']=_0x31dbaa;if(_0x17bf74[_0x558e('0x2c')][_0x558e('0x3b')]){_0x4deb75[_0x558e('0x3c')]=[{'all':!![]}];}return db[_0x558e('0x24')][_0x558e('0x3d')](_0x4deb75);})[_0x558e('0x20')](function(_0x8909){_0x17a06c[_0x558e('0x3e')]=_0x8909;return _0x17a06c;})[_0x558e('0x20')](respondWithFilteredResult(_0x42fb72,_0x4deb75))[_0x558e('0x3f')](handleError(_0x42fb72,null));};exports[_0x558e('0x40')]=function(_0xf9be75,_0xe8425e){var _0x52ed70={'raw':!![],'where':{'id':_0xf9be75[_0x558e('0x41')]['id']}},_0x1f2010={};_0x1f2010[_0x558e('0x29')]=_['keys'](db[_0x558e('0x24')][_0x558e('0x25')]);_0x1f2010[_0x558e('0x2c')]=_['keys'](_0xf9be75[_0x558e('0x2c')]);_0x1f2010[_0x558e('0x2d')]=_[_0x558e('0x2e')](_0x1f2010[_0x558e('0x29')],_0x1f2010[_0x558e('0x2c')]);_0x52ed70[_0x558e('0x30')]=_[_0x558e('0x2e')](_0x1f2010[_0x558e('0x29')],qs[_0x558e('0x2f')](_0xf9be75[_0x558e('0x2c')][_0x558e('0x2f')]));_0x52ed70[_0x558e('0x30')]=_0x52ed70[_0x558e('0x30')][_0x558e('0x31')]?_0x52ed70['attributes']:_0x1f2010[_0x558e('0x29')];if(_0xf9be75[_0x558e('0x2c')]['includeAll']){_0x52ed70[_0x558e('0x3c')]=[{'all':!![]}];}_0x52ed70=_['merge']({},_0x52ed70,_0xf9be75[_0x558e('0x3a')]);return db[_0x558e('0x24')][_0x558e('0x42')](_0x52ed70)[_0x558e('0x20')](handleEntityNotFound(_0xe8425e,null))[_0x558e('0x20')](respondWithResult(_0xe8425e,null))[_0x558e('0x3f')](handleError(_0xe8425e,null));};exports['create']=function(_0x542b99,_0x575cdc){return db['FaxQueueReport'][_0x558e('0x43')](_0x542b99[_0x558e('0x44')],{})[_0x558e('0x20')](respondWithResult(_0x575cdc,0xc9))[_0x558e('0x3f')](handleError(_0x575cdc,null));};exports['update']=function(_0x195801,_0x2066a2){if(_0x195801[_0x558e('0x44')]['id']){delete _0x195801[_0x558e('0x44')]['id'];}return db[_0x558e('0x24')][_0x558e('0x42')]({'where':{'id':_0x195801[_0x558e('0x41')]['id']}})[_0x558e('0x20')](handleEntityNotFound(_0x2066a2,null))['then'](saveUpdates(_0x195801[_0x558e('0x44')],null))[_0x558e('0x20')](respondWithResult(_0x2066a2,null))[_0x558e('0x3f')](handleError(_0x2066a2,null));};exports['destroy']=function(_0x1cdaa6,_0x45f52a){return db[_0x558e('0x24')]['find']({'where':{'id':_0x1cdaa6['params']['id']}})[_0x558e('0x20')](handleEntityNotFound(_0x45f52a,null))[_0x558e('0x20')](removeEntity(_0x45f52a,null))[_0x558e('0x3f')](handleError(_0x45f52a,null));};exports[_0x558e('0x45')]=function(_0x474def,_0x11f17c){return db['FaxQueueReport']['describe']()['then'](respondWithResult(_0x11f17c,null))[_0x558e('0x3f')](handleError(_0x11f17c,null));};
\ No newline at end of file
+var _0x1bca=['key','model','keys','filters','intersection','fields','attributes','query','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','FaxQueueReport','body','find','describe','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','send','index','map','fieldName'];(function(_0x457b2a,_0x2415cb){var _0x3064fe=function(_0x3edcb0){while(--_0x3edcb0){_0x457b2a['push'](_0x457b2a['shift']());}};_0x3064fe(++_0x2415cb);}(_0x1bca,0xb6));var _0xa1bc=function(_0x1a5170,_0x5a7ef6){_0x1a5170=_0x1a5170-0x0;var _0x17cbf2=_0x1bca[_0x1a5170];return _0x17cbf2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1bc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa1bc('0x1'));var moment=require('moment');var BPromise=require(_0xa1bc('0x2'));var Mustache=require(_0xa1bc('0x3'));var util=require(_0xa1bc('0x4'));var path=require('path');var sox=require(_0xa1bc('0x5'));var csv=require(_0xa1bc('0x6'));var ejs=require(_0xa1bc('0x7'));var fs=require('fs');var fs_extra=require(_0xa1bc('0x8'));var _=require('lodash');var squel=require(_0xa1bc('0x9'));var crypto=require(_0xa1bc('0xa'));var jsforce=require(_0xa1bc('0xb'));var deskjs=require(_0xa1bc('0xc'));var toCsv=require(_0xa1bc('0x6'));var querystring=require(_0xa1bc('0xd'));var Papa=require(_0xa1bc('0xe'));var Redis=require('ioredis');var authService=require(_0xa1bc('0xf'));var qs=require(_0xa1bc('0x10'));var as=require(_0xa1bc('0x11'));var hardwareService=require(_0xa1bc('0x12'));var logger=require(_0xa1bc('0x13'))(_0xa1bc('0x14'));var utils=require(_0xa1bc('0x15'));var config=require(_0xa1bc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f65bc,_0x37913b){_0x37913b=_0x37913b||0xcc;return function(_0x2b38cf){if(_0x2b38cf){return _0x1f65bc[_0xa1bc('0x17')](_0x37913b);}return _0x1f65bc[_0xa1bc('0x18')](_0x37913b)[_0xa1bc('0x19')]();};}function respondWithResult(_0x165acf,_0x2c5f01){_0x2c5f01=_0x2c5f01||0xc8;return function(_0xe0d028){if(_0xe0d028){return _0x165acf[_0xa1bc('0x18')](_0x2c5f01)[_0xa1bc('0x1a')](_0xe0d028);}};}function respondWithFilteredResult(_0x5a22e0,_0x565bc2){return function(_0xdb513d){if(_0xdb513d){var _0xf8c08e=typeof _0x565bc2[_0xa1bc('0x1b')]===_0xa1bc('0x1c')&&typeof _0x565bc2[_0xa1bc('0x1d')]===_0xa1bc('0x1c');var _0x36b899=_0xdb513d[_0xa1bc('0x1e')];var _0x4765be=_0xf8c08e?0x0:_0x565bc2['offset'];var _0x510046=_0xf8c08e?_0xdb513d[_0xa1bc('0x1e')]:_0x565bc2[_0xa1bc('0x1b')]+_0x565bc2[_0xa1bc('0x1d')];var _0x2b0410;if(_0x510046>=_0x36b899){_0x510046=_0x36b899;_0x2b0410=0xc8;}else{_0x2b0410=0xce;}_0x5a22e0['status'](_0x2b0410);return _0x5a22e0['set'](_0xa1bc('0x1f'),_0x4765be+'-'+_0x510046+'/'+_0x36b899)[_0xa1bc('0x1a')](_0xdb513d);}return null;};}function patchUpdates(_0x322703){return function(_0x95a766){try{jsonpatch[_0xa1bc('0x20')](_0x95a766,_0x322703,!![]);}catch(_0x3e8cd7){return BPromise['reject'](_0x3e8cd7);}return _0x95a766[_0xa1bc('0x21')]();};}function saveUpdates(_0xc81195,_0x1e4f4e){return function(_0x4fdf7d){if(_0x4fdf7d){return _0x4fdf7d[_0xa1bc('0x22')](_0xc81195)['then'](function(_0x10636d){return _0x10636d;});}return null;};}function removeEntity(_0x44f952,_0x23d67d){return function(_0x2a77a2){if(_0x2a77a2){return _0x2a77a2[_0xa1bc('0x23')]()[_0xa1bc('0x24')](function(){_0x44f952['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc2e0,_0x3a87f4){return function(_0x5eff38){if(!_0x5eff38){_0x3cc2e0[_0xa1bc('0x17')](0x194);}return _0x5eff38;};}function handleError(_0x31d31c,_0x14e37b){_0x14e37b=_0x14e37b||0x1f4;return function(_0x2a0348){logger[_0xa1bc('0x25')](_0x2a0348[_0xa1bc('0x26')]);if(_0x2a0348['name']){delete _0x2a0348['name'];}_0x31d31c[_0xa1bc('0x18')](_0x14e37b)[_0xa1bc('0x27')](_0x2a0348);};}exports[_0xa1bc('0x28')]=function(_0x1270f5,_0x16a9d7){var _0x4ae5d0={},_0x228fc8={},_0x512608={'count':0x0,'rows':[]};var _0x332201=_[_0xa1bc('0x29')](db['FaxQueueReport']['rawAttributes'],function(_0x4a120c){return{'name':_0x4a120c[_0xa1bc('0x2a')],'type':_0x4a120c['type'][_0xa1bc('0x2b')]};});_0x228fc8[_0xa1bc('0x2c')]=_[_0xa1bc('0x29')](_0x332201,'name');_0x228fc8['query']=_[_0xa1bc('0x2d')](_0x1270f5['query']);_0x228fc8[_0xa1bc('0x2e')]=_[_0xa1bc('0x2f')](_0x228fc8[_0xa1bc('0x2c')],_0x228fc8['query']);_0x4ae5d0['attributes']=_['intersection'](_0x228fc8[_0xa1bc('0x2c')],qs[_0xa1bc('0x30')](_0x1270f5['query'][_0xa1bc('0x30')]));_0x4ae5d0[_0xa1bc('0x31')]=_0x4ae5d0[_0xa1bc('0x31')]['length']?_0x4ae5d0[_0xa1bc('0x31')]:_0x228fc8[_0xa1bc('0x2c')];if(!_0x1270f5[_0xa1bc('0x32')]['hasOwnProperty'](_0xa1bc('0x33'))){_0x4ae5d0[_0xa1bc('0x1d')]=qs[_0xa1bc('0x1d')](_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x1d')]);_0x4ae5d0[_0xa1bc('0x1b')]=qs[_0xa1bc('0x1b')](_0x1270f5[_0xa1bc('0x32')]['offset']);}_0x4ae5d0[_0xa1bc('0x34')]=qs[_0xa1bc('0x35')](_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x35')]);_0x4ae5d0['where']=qs[_0xa1bc('0x2e')](_[_0xa1bc('0x36')](_0x1270f5['query'],_0x228fc8[_0xa1bc('0x2e')]),_0x332201);if(_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x37')]){_0x4ae5d0[_0xa1bc('0x38')]=_[_0xa1bc('0x39')](_0x4ae5d0['where'],{'$or':_[_0xa1bc('0x29')](_0x332201,function(_0x14c645){if(_0x14c645[_0xa1bc('0x3a')]!==_0xa1bc('0x3b')){var _0x3abf84={};_0x3abf84[_0x14c645['name']]={'$like':'%'+_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x37')]+'%'};return _0x3abf84;}})});}_0x4ae5d0=_[_0xa1bc('0x39')]({},_0x4ae5d0,_0x1270f5[_0xa1bc('0x3c')]);var _0xf9b275={'where':_0x4ae5d0['where']};return db['FaxQueueReport']['count'](_0xf9b275)[_0xa1bc('0x24')](function(_0x57160e){_0x512608[_0xa1bc('0x1e')]=_0x57160e;if(_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x3d')]){_0x4ae5d0[_0xa1bc('0x3e')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xa1bc('0x3f')](_0x4ae5d0);})['then'](function(_0x482d37){_0x512608[_0xa1bc('0x40')]=_0x482d37;return _0x512608;})['then'](respondWithFilteredResult(_0x16a9d7,_0x4ae5d0))[_0xa1bc('0x41')](handleError(_0x16a9d7,null));};exports[_0xa1bc('0x42')]=function(_0x5d6c5c,_0x1d8e3c){var _0x5cd49d={'raw':!![],'where':{'id':_0x5d6c5c[_0xa1bc('0x43')]['id']}},_0x1544c8={};_0x1544c8[_0xa1bc('0x2c')]=_[_0xa1bc('0x2d')](db['FaxQueueReport'][_0xa1bc('0x44')]);_0x1544c8[_0xa1bc('0x32')]=_['keys'](_0x5d6c5c[_0xa1bc('0x32')]);_0x1544c8[_0xa1bc('0x2e')]=_[_0xa1bc('0x2f')](_0x1544c8[_0xa1bc('0x2c')],_0x1544c8[_0xa1bc('0x32')]);_0x5cd49d[_0xa1bc('0x31')]=_[_0xa1bc('0x2f')](_0x1544c8[_0xa1bc('0x2c')],qs[_0xa1bc('0x30')](_0x5d6c5c[_0xa1bc('0x32')][_0xa1bc('0x30')]));_0x5cd49d[_0xa1bc('0x31')]=_0x5cd49d[_0xa1bc('0x31')][_0xa1bc('0x45')]?_0x5cd49d['attributes']:_0x1544c8[_0xa1bc('0x2c')];if(_0x5d6c5c['query'][_0xa1bc('0x3d')]){_0x5cd49d[_0xa1bc('0x3e')]=[{'all':!![]}];}_0x5cd49d=_[_0xa1bc('0x39')]({},_0x5cd49d,_0x5d6c5c[_0xa1bc('0x3c')]);return db['FaxQueueReport']['find'](_0x5cd49d)['then'](handleEntityNotFound(_0x1d8e3c,null))['then'](respondWithResult(_0x1d8e3c,null))['catch'](handleError(_0x1d8e3c,null));};exports[_0xa1bc('0x46')]=function(_0x5cc542,_0x2dfad5){return db[_0xa1bc('0x47')][_0xa1bc('0x46')](_0x5cc542[_0xa1bc('0x48')],{})['then'](respondWithResult(_0x2dfad5,0xc9))[_0xa1bc('0x41')](handleError(_0x2dfad5,null));};exports[_0xa1bc('0x22')]=function(_0x3fa784,_0x3eb3d7){if(_0x3fa784[_0xa1bc('0x48')]['id']){delete _0x3fa784['body']['id'];}return db[_0xa1bc('0x47')][_0xa1bc('0x49')]({'where':{'id':_0x3fa784[_0xa1bc('0x43')]['id']}})[_0xa1bc('0x24')](handleEntityNotFound(_0x3eb3d7,null))['then'](saveUpdates(_0x3fa784['body'],null))['then'](respondWithResult(_0x3eb3d7,null))[_0xa1bc('0x41')](handleError(_0x3eb3d7,null));};exports[_0xa1bc('0x23')]=function(_0x5b3b1,_0x274684){return db[_0xa1bc('0x47')]['find']({'where':{'id':_0x5b3b1['params']['id']}})[_0xa1bc('0x24')](handleEntityNotFound(_0x274684,null))[_0xa1bc('0x24')](removeEntity(_0x274684,null))[_0xa1bc('0x41')](handleError(_0x274684,null));};exports[_0xa1bc('0x4a')]=function(_0x228b42,_0x16fc65){return db[_0xa1bc('0x47')][_0xa1bc('0x4a')]()[_0xa1bc('0x24')](respondWithResult(_0x16fc65,null))['catch'](handleError(_0x16fc65,null));};
\ No newline at end of file
index 9431e6b..1ad5ad5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x3239e7,_0x4121bc){var _0x3ec813=function(_0x3d3c25){while(--_0x3d3c25){_0x3239e7['push'](_0x3239e7['shift']());}};_0x3ec813(++_0x4121bc);}(_0x326f,0xd1));var _0xf326=function(_0x1d5810,_0x1dbb57){_0x1d5810=_0x1d5810-0x0;var _0x56dd5a=_0x326f[_0x1d5810];return _0x56dd5a;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x2821f0,_0x26c4db){var _0x34863c=function(_0x1a4567){while(--_0x1a4567){_0x2821f0['push'](_0x2821f0['shift']());}};_0x34863c(++_0x26c4db);}(_0xe14b,0x93));var _0xbe14=function(_0x26ad64,_0x15b880){_0x26ad64=_0x26ad64-0x0;var _0x2ed4dc=_0xe14b[_0x26ad64];return _0x2ed4dc;};'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 556131e..890eb40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc426=['UpdateFaxQueueReport','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw'];(function(_0x3bb23d,_0x10fbda){var _0x503b57=function(_0x4d0473){while(--_0x4d0473){_0x3bb23d['push'](_0x3bb23d['shift']());}};_0x503b57(++_0x10fbda);}(_0xc426,0x13a));var _0x6c42=function(_0x2ac0b4,_0x2e7aaf){_0x2ac0b4=_0x2ac0b4-0x0;var _0xbb08d2=_0xc426[_0x2ac0b4];return _0xbb08d2;};'use strict';var _=require(_0x6c42('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6c42('0x1'));var rs=require(_0x6c42('0x2'));var fs=require('fs');var Redis=require(_0x6c42('0x3'));var db=require(_0x6c42('0x4'))['db'];var utils=require(_0x6c42('0x5'));var logger=require('../../config/logger')(_0x6c42('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6c42('0x7')][_0x6c42('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a2d08,_0x1b950e,_0x2cce2e){return new BPromise(function(_0x4950e6,_0x5f0acd){return client[_0x6c42('0x9')](_0x2a2d08,_0x2cce2e)[_0x6c42('0xa')](function(_0x30f866){logger[_0x6c42('0xb')](_0x6c42('0xc'),_0x1b950e,'request\x20sent');logger[_0x6c42('0xd')](_0x6c42('0xe'),_0x1b950e,'request\x20sent',JSON[_0x6c42('0xf')](_0x30f866));if(_0x30f866[_0x6c42('0x10')]){if(_0x30f866[_0x6c42('0x10')][_0x6c42('0x11')]===0x1f4){logger[_0x6c42('0x10')](_0x6c42('0xc'),_0x1b950e,_0x30f866['error'][_0x6c42('0x12')]);return _0x5f0acd(_0x30f866[_0x6c42('0x10')][_0x6c42('0x12')]);}logger[_0x6c42('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x1b950e,_0x30f866[_0x6c42('0x10')][_0x6c42('0x12')]);return _0x4950e6(_0x30f866[_0x6c42('0x10')]['message']);}else{logger[_0x6c42('0xb')](_0x6c42('0xc'),_0x1b950e,_0x6c42('0x13'));_0x4950e6(_0x30f866[_0x6c42('0x14')]['message']);}})[_0x6c42('0x15')](function(_0x38cf2a){logger['error'](_0x6c42('0xc'),_0x1b950e,_0x38cf2a);_0x5f0acd(_0x38cf2a);});});}exports[_0x6c42('0x16')]=function(_0x444a09){var _0x54f652=this;return new Promise(function(_0xfe82e2,_0x17a203){return db[_0x6c42('0x17')]['create'](_0x444a09[_0x6c42('0x18')],{'raw':_0x444a09[_0x6c42('0x19')]?_0x444a09[_0x6c42('0x19')][_0x6c42('0x1a')]===undefined?!![]:![]:!![]})[_0x6c42('0xa')](function(_0x3342f8){logger[_0x6c42('0xb')](_0x6c42('0x16'),_0x444a09);logger[_0x6c42('0xd')](_0x6c42('0x16'),_0x444a09,JSON[_0x6c42('0xf')](_0x3342f8));_0xfe82e2(_0x3342f8);})[_0x6c42('0x15')](function(_0x21f46f){logger[_0x6c42('0x10')](_0x6c42('0x16'),_0x21f46f[_0x6c42('0x12')],_0x444a09);_0x17a203(_0x54f652[_0x6c42('0x10')](0x1f4,_0x21f46f['message']));});});};exports[_0x6c42('0x1b')]=function(_0x263cb1){var _0x44c2d4=this;return new Promise(function(_0x476090,_0x28acec){return db[_0x6c42('0x17')]['update'](_0x263cb1[_0x6c42('0x18')],{'raw':_0x263cb1[_0x6c42('0x19')]?_0x263cb1['options'][_0x6c42('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x263cb1[_0x6c42('0x19')]?_0x263cb1['options'][_0x6c42('0x1c')]||null:null,'attributes':_0x263cb1[_0x6c42('0x19')]?_0x263cb1['options'][_0x6c42('0x1d')]||null:null,'limit':_0x263cb1['options']?_0x263cb1['options'][_0x6c42('0x1e')]||null:null})[_0x6c42('0xa')](function(_0x425823){logger['info'](_0x6c42('0x1b'),_0x263cb1);logger[_0x6c42('0xd')](_0x6c42('0x1b'),_0x263cb1,JSON[_0x6c42('0xf')](_0x425823));_0x476090(_0x425823);})['catch'](function(_0x2f1364){logger[_0x6c42('0x10')](_0x6c42('0x1b'),_0x2f1364[_0x6c42('0x12')],_0x263cb1);_0x28acec(_0x44c2d4['error'](0x1f4,_0x2f1364['message']));});});};
\ No newline at end of file
+var _0x9633=['jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x9633,0x1d3));var _0x3963=function(_0x11c93e,_0x3edb7d){_0x11c93e=_0x11c93e-0x0;var _0x4e8cdc=_0x9633[_0x11c93e];return _0x4e8cdc;};'use strict';var _=require(_0x3963('0x0'));var util=require(_0x3963('0x1'));var moment=require(_0x3963('0x2'));var BPromise=require(_0x3963('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3963('0x4'));var db=require(_0x3963('0x5'))['db'];var utils=require(_0x3963('0x6'));var logger=require(_0x3963('0x7'))('rpc');var config=require(_0x3963('0x8'));var jayson=require(_0x3963('0x9'));var client=jayson[_0x3963('0xa')][_0x3963('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2708dd,_0x383c5f,_0x55c5d6){return new BPromise(function(_0x4fcfb7,_0x5b32d4){return client[_0x3963('0xc')](_0x2708dd,_0x55c5d6)[_0x3963('0xd')](function(_0x503757){logger[_0x3963('0xe')](_0x3963('0xf'),_0x383c5f,_0x3963('0x10'));logger[_0x3963('0x11')](_0x3963('0x12'),_0x383c5f,_0x3963('0x10'),JSON[_0x3963('0x13')](_0x503757));if(_0x503757[_0x3963('0x14')]){if(_0x503757[_0x3963('0x14')]['code']===0x1f4){logger['error'](_0x3963('0xf'),_0x383c5f,_0x503757[_0x3963('0x14')]['message']);return _0x5b32d4(_0x503757['error'][_0x3963('0x15')]);}logger['error'](_0x3963('0xf'),_0x383c5f,_0x503757[_0x3963('0x14')][_0x3963('0x15')]);return _0x4fcfb7(_0x503757[_0x3963('0x14')][_0x3963('0x15')]);}else{logger[_0x3963('0xe')](_0x3963('0xf'),_0x383c5f,_0x3963('0x10'));_0x4fcfb7(_0x503757[_0x3963('0x16')][_0x3963('0x15')]);}})[_0x3963('0x17')](function(_0x1a7c4f){logger[_0x3963('0x14')](_0x3963('0xf'),_0x383c5f,_0x1a7c4f);_0x5b32d4(_0x1a7c4f);});});}exports['CreateFaxQueueReport']=function(_0x2b374a){var _0x5826ca=this;return new Promise(function(_0x31e41c,_0x14c273){return db[_0x3963('0x18')][_0x3963('0x19')](_0x2b374a[_0x3963('0x1a')],{'raw':_0x2b374a[_0x3963('0x1b')]?_0x2b374a[_0x3963('0x1b')][_0x3963('0x1c')]===undefined?!![]:![]:!![]})[_0x3963('0xd')](function(_0x1f47e7){logger[_0x3963('0xe')](_0x3963('0x1d'),_0x2b374a);logger[_0x3963('0x11')](_0x3963('0x1d'),_0x2b374a,JSON['stringify'](_0x1f47e7));_0x31e41c(_0x1f47e7);})[_0x3963('0x17')](function(_0x1a0406){logger[_0x3963('0x14')](_0x3963('0x1d'),_0x1a0406['message'],_0x2b374a);_0x14c273(_0x5826ca[_0x3963('0x14')](0x1f4,_0x1a0406['message']));});});};exports[_0x3963('0x1e')]=function(_0x571c48){var _0x2f01de=this;return new Promise(function(_0x542f88,_0x44d359){return db[_0x3963('0x18')][_0x3963('0x1f')](_0x571c48[_0x3963('0x1a')],{'raw':_0x571c48[_0x3963('0x1b')]?_0x571c48[_0x3963('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x571c48[_0x3963('0x1b')]?_0x571c48[_0x3963('0x1b')]['where']||null:null,'attributes':_0x571c48['options']?_0x571c48[_0x3963('0x1b')][_0x3963('0x20')]||null:null,'limit':_0x571c48[_0x3963('0x1b')]?_0x571c48[_0x3963('0x1b')][_0x3963('0x21')]||null:null})[_0x3963('0xd')](function(_0x43b75a){logger['info'](_0x3963('0x1e'),_0x571c48);logger[_0x3963('0x11')](_0x3963('0x1e'),_0x571c48,JSON['stringify'](_0x43b75a));_0x542f88(_0x43b75a);})[_0x3963('0x17')](function(_0x33ac55){logger[_0x3963('0x14')]('UpdateFaxQueueReport',_0x33ac55['message'],_0x571c48);_0x44d359(_0x2f01de[_0x3963('0x14')](0x1f4,_0x33ac55['message']));});});};
\ No newline at end of file
index 13fb9e7..19a5803 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01cf=['/:id','isAuthenticated','update','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','index','get','/describe','describe','show','post','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x01cf,0x16e));var _0xf01c=function(_0x34a0b1,_0x22814e){_0x34a0b1=_0x34a0b1-0x0;var _0x304595=_0x01cf[_0x34a0b1];return _0x304595;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf01c('0x0'));var timeout=require(_0xf01c('0x1'));var express=require(_0xf01c('0x2'));var router=express[_0xf01c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf01c('0x4'));var config=require(_0xf01c('0x5'));var controller=require(_0xf01c('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xf01c('0x7')]);router[_0xf01c('0x8')](_0xf01c('0x9'),auth['isAuthenticated'](),controller[_0xf01c('0xa')]);router[_0xf01c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf01c('0xb')]);router[_0xf01c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf01c('0xd')](_0xf01c('0xe'),auth[_0xf01c('0xf')](),controller[_0xf01c('0x10')]);router[_0xf01c('0x11')](_0xf01c('0xe'),auth[_0xf01c('0xf')](),controller[_0xf01c('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x966b=['index','/describe','isAuthenticated','describe','/:id','show','create','put','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0x966b,0x1de));var _0xb966=function(_0x2c27f9,_0x120e57){_0x2c27f9=_0x2c27f9-0x0;var _0x38edef=_0x966b[_0x2c27f9];return _0x38edef;};'use strict';var multer=require(_0xb966('0x0'));var util=require(_0xb966('0x1'));var path=require(_0xb966('0x2'));var timeout=require(_0xb966('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb966('0x4'));var auth=require(_0xb966('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb966('0x6'));var controller=require(_0xb966('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb966('0x8')]);router['get'](_0xb966('0x9'),auth[_0xb966('0xa')](),controller[_0xb966('0xb')]);router['get'](_0xb966('0xc'),auth[_0xb966('0xa')](),controller[_0xb966('0xd')]);router['post']('/',auth[_0xb966('0xa')](),controller[_0xb966('0xe')]);router[_0xb966('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb966('0x10')](_0xb966('0xc'),auth[_0xb966('0xa')](),controller[_0xb966('0x11')]);module['exports']=router;
\ No newline at end of file
index 58f23bb..0e86f40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x526286,_0xc12707){var _0x49d240=function(_0x1a9489){while(--_0x1a9489){_0x526286['push'](_0x526286['shift']());}};_0x49d240(++_0xc12707);}(_0x70e0,0x17b));var _0x070e=function(_0x3d7aa6,_0xc8efdf){_0x3d7aa6=_0x3d7aa6-0x0;var _0x241db6=_0x70e0[_0x3d7aa6];return _0x241db6;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x520ce8,_0x445e56){var _0x64369e=function(_0x3861e4){while(--_0x3861e4){_0x520ce8['push'](_0x520ce8['shift']());}};_0x64369e(++_0x445e56);}(_0x54ef,0x112));var _0xf54e=function(_0x3277fb,_0x1ed826){_0x3277fb=_0x3277fb-0x0;var _0x468673=_0x54ef[_0x3277fb];return _0x468673;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
index e65427f..d830e46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6892=['sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','map','FaxTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x6892,0x1c7));var _0x2689=function(_0x4be386,_0x54076e){_0x4be386=_0x4be386-0x0;var _0x5bd543=_0x6892[_0x4be386];return _0x5bd543;};'use strict';var emlformat=require(_0x2689('0x0'));var rimraf=require(_0x2689('0x1'));var zipdir=require(_0x2689('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2689('0x3'));var moment=require(_0x2689('0x4'));var BPromise=require(_0x2689('0x5'));var Mustache=require(_0x2689('0x6'));var util=require('util');var path=require(_0x2689('0x7'));var sox=require('sox');var csv=require(_0x2689('0x8'));var ejs=require(_0x2689('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2689('0xa'));var squel=require(_0x2689('0xb'));var crypto=require(_0x2689('0xc'));var jsforce=require(_0x2689('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2689('0x8'));var querystring=require(_0x2689('0xe'));var Papa=require(_0x2689('0xf'));var Redis=require(_0x2689('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2689('0x11'));var as=require(_0x2689('0x12'));var hardwareService=require(_0x2689('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2689('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3423ae,_0x1cad8c){_0x1cad8c=_0x1cad8c||0xcc;return function(_0x4f43f5){if(_0x4f43f5){return _0x3423ae[_0x2689('0x15')](_0x1cad8c);}return _0x3423ae[_0x2689('0x16')](_0x1cad8c)[_0x2689('0x17')]();};}function respondWithResult(_0x43d29e,_0x146012){_0x146012=_0x146012||0xc8;return function(_0x1055e2){if(_0x1055e2){return _0x43d29e[_0x2689('0x16')](_0x146012)[_0x2689('0x18')](_0x1055e2);}};}function respondWithFilteredResult(_0x48f30d,_0x1c4a17){return function(_0x31ba7a){if(_0x31ba7a){var _0x14dba9=typeof _0x1c4a17['offset']===_0x2689('0x19')&&typeof _0x1c4a17[_0x2689('0x1a')]==='undefined';var _0x1cf4bc=_0x31ba7a['count'];var _0x1999e1=_0x14dba9?0x0:_0x1c4a17['offset'];var _0x3242ff=_0x14dba9?_0x31ba7a[_0x2689('0x1b')]:_0x1c4a17['offset']+_0x1c4a17[_0x2689('0x1a')];var _0x112631;if(_0x3242ff>=_0x1cf4bc){_0x3242ff=_0x1cf4bc;_0x112631=0xc8;}else{_0x112631=0xce;}_0x48f30d[_0x2689('0x16')](_0x112631);return _0x48f30d[_0x2689('0x1c')](_0x2689('0x1d'),_0x1999e1+'-'+_0x3242ff+'/'+_0x1cf4bc)[_0x2689('0x18')](_0x31ba7a);}return null;};}function patchUpdates(_0x5e63e6){return function(_0x6bc13b){try{jsonpatch[_0x2689('0x1e')](_0x6bc13b,_0x5e63e6,!![]);}catch(_0x1ff29f){return BPromise['reject'](_0x1ff29f);}return _0x6bc13b['save']();};}function saveUpdates(_0x373aad,_0x411e53){return function(_0x51831b){if(_0x51831b){return _0x51831b[_0x2689('0x1f')](_0x373aad)[_0x2689('0x20')](function(_0x2b38e9){return _0x2b38e9;});}return null;};}function removeEntity(_0x7c7e82,_0x2bfde2){return function(_0x3fdba8){if(_0x3fdba8){return _0x3fdba8[_0x2689('0x21')]()['then'](function(){_0x7c7e82[_0x2689('0x16')](0xcc)[_0x2689('0x17')]();});}};}function handleEntityNotFound(_0x303667,_0x1483a9){return function(_0x563085){if(!_0x563085){_0x303667['sendStatus'](0x194);}return _0x563085;};}function handleError(_0x5588ee,_0x228a24){_0x228a24=_0x228a24||0x1f4;return function(_0x365762){logger[_0x2689('0x22')](_0x365762[_0x2689('0x23')]);if(_0x365762[_0x2689('0x24')]){delete _0x365762[_0x2689('0x24')];}_0x5588ee[_0x2689('0x16')](_0x228a24)[_0x2689('0x25')](_0x365762);};}exports['index']=function(_0x4dbd01,_0x17a0ce){var _0x389e32={},_0x481742={},_0x1671d0={'count':0x0,'rows':[]};var _0x2559b5=_[_0x2689('0x26')](db[_0x2689('0x27')]['rawAttributes'],function(_0xf7785c){return{'name':_0xf7785c['fieldName'],'type':_0xf7785c[_0x2689('0x28')][_0x2689('0x29')]};});_0x481742[_0x2689('0x2a')]=_[_0x2689('0x26')](_0x2559b5,_0x2689('0x24'));_0x481742[_0x2689('0x2b')]=_[_0x2689('0x2c')](_0x4dbd01[_0x2689('0x2b')]);_0x481742[_0x2689('0x2d')]=_[_0x2689('0x2e')](_0x481742['model'],_0x481742[_0x2689('0x2b')]);_0x389e32[_0x2689('0x2f')]=_[_0x2689('0x2e')](_0x481742[_0x2689('0x2a')],qs[_0x2689('0x30')](_0x4dbd01[_0x2689('0x2b')][_0x2689('0x30')]));_0x389e32['attributes']=_0x389e32[_0x2689('0x2f')]['length']?_0x389e32[_0x2689('0x2f')]:_0x481742['model'];if(!_0x4dbd01['query'][_0x2689('0x31')](_0x2689('0x32'))){_0x389e32[_0x2689('0x1a')]=qs[_0x2689('0x1a')](_0x4dbd01['query']['limit']);_0x389e32[_0x2689('0x33')]=qs['offset'](_0x4dbd01[_0x2689('0x2b')][_0x2689('0x33')]);}_0x389e32[_0x2689('0x34')]=qs[_0x2689('0x35')](_0x4dbd01[_0x2689('0x2b')]['sort']);_0x389e32[_0x2689('0x36')]=qs['filters'](_['pick'](_0x4dbd01[_0x2689('0x2b')],_0x481742[_0x2689('0x2d')]),_0x2559b5);if(_0x4dbd01[_0x2689('0x2b')][_0x2689('0x37')]){_0x389e32[_0x2689('0x36')]=_[_0x2689('0x38')](_0x389e32[_0x2689('0x36')],{'$or':_[_0x2689('0x26')](_0x2559b5,function(_0x43fb06){if(_0x43fb06['type']!==_0x2689('0x39')){var _0x4fa968={};_0x4fa968[_0x43fb06['name']]={'$like':'%'+_0x4dbd01[_0x2689('0x2b')]['filter']+'%'};return _0x4fa968;}})});}_0x389e32=_[_0x2689('0x38')]({},_0x389e32,_0x4dbd01[_0x2689('0x3a')]);var _0x24c643={'where':_0x389e32[_0x2689('0x36')]};return db[_0x2689('0x27')]['count'](_0x24c643)[_0x2689('0x20')](function(_0x78e53a){_0x1671d0[_0x2689('0x1b')]=_0x78e53a;if(_0x4dbd01[_0x2689('0x2b')][_0x2689('0x3b')]){_0x389e32[_0x2689('0x3c')]=[{'all':!![]}];}return db[_0x2689('0x27')][_0x2689('0x3d')](_0x389e32);})['then'](function(_0x1d1ee0){_0x1671d0['rows']=_0x1d1ee0;return _0x1671d0;})[_0x2689('0x20')](respondWithFilteredResult(_0x17a0ce,_0x389e32))[_0x2689('0x3e')](handleError(_0x17a0ce,null));};exports['show']=function(_0x2e4f8,_0x3b6f2b){var _0x447808={'raw':!![],'where':{'id':_0x2e4f8[_0x2689('0x3f')]['id']}},_0x1e2f3b={};_0x1e2f3b[_0x2689('0x2a')]=_[_0x2689('0x2c')](db[_0x2689('0x27')]['rawAttributes']);_0x1e2f3b[_0x2689('0x2b')]=_[_0x2689('0x2c')](_0x2e4f8[_0x2689('0x2b')]);_0x1e2f3b['filters']=_['intersection'](_0x1e2f3b['model'],_0x1e2f3b['query']);_0x447808[_0x2689('0x2f')]=_['intersection'](_0x1e2f3b['model'],qs[_0x2689('0x30')](_0x2e4f8['query'][_0x2689('0x30')]));_0x447808[_0x2689('0x2f')]=_0x447808[_0x2689('0x2f')]['length']?_0x447808[_0x2689('0x2f')]:_0x1e2f3b[_0x2689('0x2a')];if(_0x2e4f8[_0x2689('0x2b')][_0x2689('0x3b')]){_0x447808['include']=[{'all':!![]}];}_0x447808=_[_0x2689('0x38')]({},_0x447808,_0x2e4f8[_0x2689('0x3a')]);return db['FaxTransferReport'][_0x2689('0x40')](_0x447808)[_0x2689('0x20')](handleEntityNotFound(_0x3b6f2b,null))[_0x2689('0x20')](respondWithResult(_0x3b6f2b,null))[_0x2689('0x3e')](handleError(_0x3b6f2b,null));};exports[_0x2689('0x41')]=function(_0x22b513,_0x22a2e4){return db['FaxTransferReport']['create'](_0x22b513[_0x2689('0x42')],{})[_0x2689('0x20')](respondWithResult(_0x22a2e4,0xc9))[_0x2689('0x3e')](handleError(_0x22a2e4,null));};exports[_0x2689('0x1f')]=function(_0x2faa13,_0x203f52){if(_0x2faa13[_0x2689('0x42')]['id']){delete _0x2faa13[_0x2689('0x42')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x2faa13[_0x2689('0x3f')]['id']}})[_0x2689('0x20')](handleEntityNotFound(_0x203f52,null))[_0x2689('0x20')](saveUpdates(_0x2faa13[_0x2689('0x42')],null))[_0x2689('0x20')](respondWithResult(_0x203f52,null))['catch'](handleError(_0x203f52,null));};exports[_0x2689('0x21')]=function(_0x522011,_0x51a13d){return db[_0x2689('0x27')][_0x2689('0x40')]({'where':{'id':_0x522011[_0x2689('0x3f')]['id']}})[_0x2689('0x20')](handleEntityNotFound(_0x51a13d,null))[_0x2689('0x20')](removeEntity(_0x51a13d,null))['catch'](handleError(_0x51a13d,null));};exports['describe']=function(_0x1c3eda,_0x185ecd){return db[_0x2689('0x27')][_0x2689('0x43')]()[_0x2689('0x20')](respondWithResult(_0x185ecd,null))[_0x2689('0x3e')](handleError(_0x185ecd,null));};
\ No newline at end of file
+var _0x67e3=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','then','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','FaxTransferReport','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','key','model','query','keys'];(function(_0xd7d0a6,_0x1148e4){var _0x1a9f1d=function(_0x48b513){while(--_0x48b513){_0xd7d0a6['push'](_0xd7d0a6['shift']());}};_0x1a9f1d(++_0x1148e4);}(_0x67e3,0x159));var _0x367e=function(_0x42c118,_0xcdf25b){_0x42c118=_0x42c118-0x0;var _0x4151f2=_0x67e3[_0x42c118];return _0x4151f2;};'use strict';var emlformat=require(_0x367e('0x0'));var rimraf=require(_0x367e('0x1'));var zipdir=require(_0x367e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x367e('0x3'));var moment=require(_0x367e('0x4'));var BPromise=require(_0x367e('0x5'));var Mustache=require('mustache');var util=require(_0x367e('0x6'));var path=require('path');var sox=require(_0x367e('0x7'));var csv=require('to-csv');var ejs=require(_0x367e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x367e('0x9'));var squel=require(_0x367e('0xa'));var crypto=require(_0x367e('0xb'));var jsforce=require(_0x367e('0xc'));var deskjs=require(_0x367e('0xd'));var toCsv=require(_0x367e('0xe'));var querystring=require(_0x367e('0xf'));var Papa=require(_0x367e('0x10'));var Redis=require(_0x367e('0x11'));var authService=require(_0x367e('0x12'));var qs=require(_0x367e('0x13'));var as=require(_0x367e('0x14'));var hardwareService=require(_0x367e('0x15'));var logger=require('../../config/logger')(_0x367e('0x16'));var utils=require(_0x367e('0x17'));var config=require(_0x367e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x367e('0x19'))['db'];function respondWithStatusCode(_0x203045,_0x26313e){_0x26313e=_0x26313e||0xcc;return function(_0x354e24){if(_0x354e24){return _0x203045['sendStatus'](_0x26313e);}return _0x203045[_0x367e('0x1a')](_0x26313e)[_0x367e('0x1b')]();};}function respondWithResult(_0xe5a591,_0x292148){_0x292148=_0x292148||0xc8;return function(_0x2c1418){if(_0x2c1418){return _0xe5a591[_0x367e('0x1a')](_0x292148)[_0x367e('0x1c')](_0x2c1418);}};}function respondWithFilteredResult(_0x384188,_0x7014f1){return function(_0x995052){if(_0x995052){var _0x25f620=typeof _0x7014f1[_0x367e('0x1d')]===_0x367e('0x1e')&&typeof _0x7014f1[_0x367e('0x1f')]===_0x367e('0x1e');var _0x520362=_0x995052[_0x367e('0x20')];var _0x52f0ba=_0x25f620?0x0:_0x7014f1[_0x367e('0x1d')];var _0x2e230c=_0x25f620?_0x995052[_0x367e('0x20')]:_0x7014f1[_0x367e('0x1d')]+_0x7014f1[_0x367e('0x1f')];var _0x503498;if(_0x2e230c>=_0x520362){_0x2e230c=_0x520362;_0x503498=0xc8;}else{_0x503498=0xce;}_0x384188['status'](_0x503498);return _0x384188[_0x367e('0x21')](_0x367e('0x22'),_0x52f0ba+'-'+_0x2e230c+'/'+_0x520362)['json'](_0x995052);}return null;};}function patchUpdates(_0xb178f4){return function(_0x1c4e4c){try{jsonpatch[_0x367e('0x23')](_0x1c4e4c,_0xb178f4,!![]);}catch(_0x1479dc){return BPromise[_0x367e('0x24')](_0x1479dc);}return _0x1c4e4c[_0x367e('0x25')]();};}function saveUpdates(_0x5a4630,_0x49678d){return function(_0x318936){if(_0x318936){return _0x318936[_0x367e('0x26')](_0x5a4630)['then'](function(_0x3ede95){return _0x3ede95;});}return null;};}function removeEntity(_0x21261a,_0x732cd1){return function(_0x39306e){if(_0x39306e){return _0x39306e[_0x367e('0x27')]()['then'](function(){_0x21261a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44bbc2,_0x5e0727){return function(_0xf385cf){if(!_0xf385cf){_0x44bbc2['sendStatus'](0x194);}return _0xf385cf;};}function handleError(_0x4b34e5,_0x2339c3){_0x2339c3=_0x2339c3||0x1f4;return function(_0x4f7cd7){logger[_0x367e('0x28')](_0x4f7cd7[_0x367e('0x29')]);if(_0x4f7cd7[_0x367e('0x2a')]){delete _0x4f7cd7[_0x367e('0x2a')];}_0x4b34e5[_0x367e('0x1a')](_0x2339c3)[_0x367e('0x2b')](_0x4f7cd7);};}exports[_0x367e('0x2c')]=function(_0x1ddd0e,_0x590508){var _0xb4908e={},_0x7744de={},_0x173a30={'count':0x0,'rows':[]};var _0xbffcde=_[_0x367e('0x2d')](db['FaxTransferReport']['rawAttributes'],function(_0x43da00){return{'name':_0x43da00['fieldName'],'type':_0x43da00['type'][_0x367e('0x2e')]};});_0x7744de[_0x367e('0x2f')]=_[_0x367e('0x2d')](_0xbffcde,_0x367e('0x2a'));_0x7744de[_0x367e('0x30')]=_[_0x367e('0x31')](_0x1ddd0e['query']);_0x7744de[_0x367e('0x32')]=_['intersection'](_0x7744de[_0x367e('0x2f')],_0x7744de['query']);_0xb4908e['attributes']=_[_0x367e('0x33')](_0x7744de[_0x367e('0x2f')],qs[_0x367e('0x34')](_0x1ddd0e['query'][_0x367e('0x34')]));_0xb4908e[_0x367e('0x35')]=_0xb4908e[_0x367e('0x35')][_0x367e('0x36')]?_0xb4908e[_0x367e('0x35')]:_0x7744de['model'];if(!_0x1ddd0e[_0x367e('0x30')][_0x367e('0x37')](_0x367e('0x38'))){_0xb4908e['limit']=qs[_0x367e('0x1f')](_0x1ddd0e[_0x367e('0x30')][_0x367e('0x1f')]);_0xb4908e[_0x367e('0x1d')]=qs['offset'](_0x1ddd0e[_0x367e('0x30')]['offset']);}_0xb4908e[_0x367e('0x39')]=qs[_0x367e('0x3a')](_0x1ddd0e[_0x367e('0x30')][_0x367e('0x3a')]);_0xb4908e[_0x367e('0x3b')]=qs['filters'](_[_0x367e('0x3c')](_0x1ddd0e[_0x367e('0x30')],_0x7744de['filters']),_0xbffcde);if(_0x1ddd0e['query'][_0x367e('0x3d')]){_0xb4908e['where']=_[_0x367e('0x3e')](_0xb4908e[_0x367e('0x3b')],{'$or':_[_0x367e('0x2d')](_0xbffcde,function(_0x529fc2){if(_0x529fc2[_0x367e('0x3f')]!=='VIRTUAL'){var _0xcd638e={};_0xcd638e[_0x529fc2[_0x367e('0x2a')]]={'$like':'%'+_0x1ddd0e[_0x367e('0x30')][_0x367e('0x3d')]+'%'};return _0xcd638e;}})});}_0xb4908e=_[_0x367e('0x3e')]({},_0xb4908e,_0x1ddd0e[_0x367e('0x40')]);var _0x1f68f3={'where':_0xb4908e[_0x367e('0x3b')]};return db['FaxTransferReport'][_0x367e('0x20')](_0x1f68f3)[_0x367e('0x41')](function(_0x3a32f2){_0x173a30[_0x367e('0x20')]=_0x3a32f2;if(_0x1ddd0e[_0x367e('0x30')][_0x367e('0x42')]){_0xb4908e['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x367e('0x43')](_0xb4908e);})[_0x367e('0x41')](function(_0x3559d6){_0x173a30[_0x367e('0x44')]=_0x3559d6;return _0x173a30;})['then'](respondWithFilteredResult(_0x590508,_0xb4908e))['catch'](handleError(_0x590508,null));};exports[_0x367e('0x45')]=function(_0x29ee96,_0x2062eb){var _0x26c16b={'raw':!![],'where':{'id':_0x29ee96[_0x367e('0x46')]['id']}},_0x4d1641={};_0x4d1641[_0x367e('0x2f')]=_[_0x367e('0x31')](db['FaxTransferReport'][_0x367e('0x47')]);_0x4d1641[_0x367e('0x30')]=_['keys'](_0x29ee96[_0x367e('0x30')]);_0x4d1641['filters']=_[_0x367e('0x33')](_0x4d1641[_0x367e('0x2f')],_0x4d1641[_0x367e('0x30')]);_0x26c16b[_0x367e('0x35')]=_['intersection'](_0x4d1641[_0x367e('0x2f')],qs['fields'](_0x29ee96[_0x367e('0x30')][_0x367e('0x34')]));_0x26c16b[_0x367e('0x35')]=_0x26c16b[_0x367e('0x35')][_0x367e('0x36')]?_0x26c16b['attributes']:_0x4d1641[_0x367e('0x2f')];if(_0x29ee96[_0x367e('0x30')][_0x367e('0x42')]){_0x26c16b[_0x367e('0x48')]=[{'all':!![]}];}_0x26c16b=_['merge']({},_0x26c16b,_0x29ee96[_0x367e('0x40')]);return db['FaxTransferReport'][_0x367e('0x49')](_0x26c16b)[_0x367e('0x41')](handleEntityNotFound(_0x2062eb,null))[_0x367e('0x41')](respondWithResult(_0x2062eb,null))[_0x367e('0x4a')](handleError(_0x2062eb,null));};exports[_0x367e('0x4b')]=function(_0x4fa723,_0x47ee00){return db[_0x367e('0x4c')]['create'](_0x4fa723[_0x367e('0x4d')],{})[_0x367e('0x41')](respondWithResult(_0x47ee00,0xc9))[_0x367e('0x4a')](handleError(_0x47ee00,null));};exports[_0x367e('0x26')]=function(_0x34f59a,_0x90f3c8){if(_0x34f59a[_0x367e('0x4d')]['id']){delete _0x34f59a[_0x367e('0x4d')]['id'];}return db['FaxTransferReport'][_0x367e('0x49')]({'where':{'id':_0x34f59a['params']['id']}})[_0x367e('0x41')](handleEntityNotFound(_0x90f3c8,null))[_0x367e('0x41')](saveUpdates(_0x34f59a[_0x367e('0x4d')],null))[_0x367e('0x41')](respondWithResult(_0x90f3c8,null))[_0x367e('0x4a')](handleError(_0x90f3c8,null));};exports[_0x367e('0x27')]=function(_0x431c9f,_0x4e9568){return db[_0x367e('0x4c')]['find']({'where':{'id':_0x431c9f[_0x367e('0x46')]['id']}})[_0x367e('0x41')](handleEntityNotFound(_0x4e9568,null))[_0x367e('0x41')](removeEntity(_0x4e9568,null))[_0x367e('0x4a')](handleError(_0x4e9568,null));};exports[_0x367e('0x4e')]=function(_0xd24690,_0x304ec6){return db[_0x367e('0x4c')][_0x367e('0x4e')]()[_0x367e('0x41')](respondWithResult(_0x304ec6,null))[_0x367e('0x4a')](handleError(_0x304ec6,null));};
\ No newline at end of file
index f09ca50..5ea9a65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a3e=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./faxTransferReport.attributes','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x1f5834,_0x421950){var _0x418e31=function(_0x5f5cc4){while(--_0x5f5cc4){_0x1f5834['push'](_0x1f5834['shift']());}};_0x418e31(++_0x421950);}(_0x0a3e,0x79));var _0xe0a3=function(_0x155fed,_0x15ff05){_0x155fed=_0x155fed-0x0;var _0xf83ad=_0x0a3e[_0x155fed];return _0xf83ad;};'use strict';var _=require(_0xe0a3('0x0'));var util=require('util');var logger=require(_0xe0a3('0x1'))(_0xe0a3('0x2'));var moment=require(_0xe0a3('0x3'));var BPromise=require(_0xe0a3('0x4'));var rp=require(_0xe0a3('0x5'));var fs=require('fs');var path=require(_0xe0a3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe0a3('0x7'));module['exports']=function(_0x4745d9,_0x56c082){return _0x4745d9['define'](_0xe0a3('0x8'),attributes,{'tableName':_0xe0a3('0x9'),'paranoid':![],'indexes':[{'name':_0xe0a3('0xa'),'fields':[_0xe0a3('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4f8=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','util'];(function(_0x5df1c5,_0x1e5575){var _0x5309b7=function(_0xe611b9){while(--_0xe611b9){_0x5df1c5['push'](_0x5df1c5['shift']());}};_0x5309b7(++_0x1e5575);}(_0xb4f8,0x83));var _0x8b4f=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xb4f8[_0x1beef3];return _0x5af964;};'use strict';var _=require('lodash');var util=require(_0x8b4f('0x0'));var logger=require(_0x8b4f('0x1'))(_0x8b4f('0x2'));var moment=require(_0x8b4f('0x3'));var BPromise=require(_0x8b4f('0x4'));var rp=require(_0x8b4f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b4f('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b4f('0x7'));module[_0x8b4f('0x8')]=function(_0x533e63,_0x17e04f){return _0x533e63[_0x8b4f('0x9')]('FaxTransferReport',attributes,{'tableName':_0x8b4f('0xa'),'paranoid':![],'indexes':[{'name':_0x8b4f('0xb'),'fields':[_0x8b4f('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index a61d869..6a5d78f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c0e=['../../config/logger','rpc','../../config/environment','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x3c0e,0x9b));var _0xe3c0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3c0e[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xe3c0('0x0'));var util=require(_0xe3c0('0x1'));var moment=require('moment');var BPromise=require(_0xe3c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3c0('0x3'))['db'];var utils=require(_0xe3c0('0x4'));var logger=require(_0xe3c0('0x5'))(_0xe3c0('0x6'));var config=require(_0xe3c0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe3c0('0x8')][_0xe3c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x104a99,_0x35d9e9,_0x897ca8){return new BPromise(function(_0x22ad32,_0x2d0198){return client[_0xe3c0('0xa')](_0x104a99,_0x897ca8)['then'](function(_0x3f3451){logger[_0xe3c0('0xb')](_0xe3c0('0xc'),_0x35d9e9,_0xe3c0('0xd'));logger[_0xe3c0('0xe')](_0xe3c0('0xf'),_0x35d9e9,_0xe3c0('0xd'),JSON['stringify'](_0x3f3451));if(_0x3f3451[_0xe3c0('0x10')]){if(_0x3f3451[_0xe3c0('0x10')][_0xe3c0('0x11')]===0x1f4){logger[_0xe3c0('0x10')](_0xe3c0('0xc'),_0x35d9e9,_0x3f3451['error'][_0xe3c0('0x12')]);return _0x2d0198(_0x3f3451['error'][_0xe3c0('0x12')]);}logger[_0xe3c0('0x10')](_0xe3c0('0xc'),_0x35d9e9,_0x3f3451[_0xe3c0('0x10')][_0xe3c0('0x12')]);return _0x22ad32(_0x3f3451['error'][_0xe3c0('0x12')]);}else{logger['info'](_0xe3c0('0xc'),_0x35d9e9,'request\x20sent');_0x22ad32(_0x3f3451['result'][_0xe3c0('0x12')]);}})[_0xe3c0('0x13')](function(_0x3e41bb){logger['error'](_0xe3c0('0xc'),_0x35d9e9,_0x3e41bb);_0x2d0198(_0x3e41bb);});});}
\ No newline at end of file
+var _0x1e37=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x1e37,0x80));var _0x71e3=function(_0x2815d3,_0x45fa9f){_0x2815d3=_0x2815d3-0x0;var _0x3baae3=_0x1e37[_0x2815d3];return _0x3baae3;};'use strict';var _=require(_0x71e3('0x0'));var util=require(_0x71e3('0x1'));var moment=require('moment');var BPromise=require(_0x71e3('0x2'));var rs=require(_0x71e3('0x3'));var fs=require('fs');var Redis=require(_0x71e3('0x4'));var db=require(_0x71e3('0x5'))['db'];var utils=require(_0x71e3('0x6'));var logger=require('../../config/logger')(_0x71e3('0x7'));var config=require(_0x71e3('0x8'));var jayson=require(_0x71e3('0x9'));var client=jayson[_0x71e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x502f39,_0x467582,_0x1e41f8){return new BPromise(function(_0x5ced03,_0xfb3427){return client[_0x71e3('0xb')](_0x502f39,_0x1e41f8)['then'](function(_0x24fb07){logger[_0x71e3('0xc')](_0x71e3('0xd'),_0x467582,_0x71e3('0xe'));logger[_0x71e3('0xf')](_0x71e3('0x10'),_0x467582,_0x71e3('0xe'),JSON[_0x71e3('0x11')](_0x24fb07));if(_0x24fb07['error']){if(_0x24fb07[_0x71e3('0x12')]['code']===0x1f4){logger[_0x71e3('0x12')](_0x71e3('0xd'),_0x467582,_0x24fb07['error'][_0x71e3('0x13')]);return _0xfb3427(_0x24fb07[_0x71e3('0x12')][_0x71e3('0x13')]);}logger[_0x71e3('0x12')](_0x71e3('0xd'),_0x467582,_0x24fb07[_0x71e3('0x12')]['message']);return _0x5ced03(_0x24fb07['error'][_0x71e3('0x13')]);}else{logger[_0x71e3('0xc')](_0x71e3('0xd'),_0x467582,_0x71e3('0xe'));_0x5ced03(_0x24fb07[_0x71e3('0x14')][_0x71e3('0x13')]);}})['catch'](function(_0xa3aa0c){logger[_0x71e3('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x467582,_0xa3aa0c);_0xfb3427(_0xa3aa0c);});});}
\ No newline at end of file
index fea0f45..a6cdb10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9067=['Router','fs-extra','../../components/auth/service','./faxTransferReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5914a3,_0x114d18){var _0xcf0c51=function(_0x287be8){while(--_0x287be8){_0x5914a3['push'](_0x5914a3['shift']());}};_0xcf0c51(++_0x114d18);}(_0x9067,0x18c));var _0x7906=function(_0x34928f,_0x61984a){_0x34928f=_0x34928f-0x0;var _0x2e75a5=_0x9067[_0x34928f];return _0x2e75a5;};'use strict';var multer=require(_0x7906('0x0'));var util=require('util');var path=require(_0x7906('0x1'));var timeout=require(_0x7906('0x2'));var express=require(_0x7906('0x3'));var router=express[_0x7906('0x4')]();var fs_extra=require(_0x7906('0x5'));var auth=require(_0x7906('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7906('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x7906('0x8')]);router['get'](_0x7906('0x9'),auth[_0x7906('0xa')](),controller[_0x7906('0xb')]);router[_0x7906('0xc')](_0x7906('0xd'),auth[_0x7906('0xa')](),controller[_0x7906('0xe')]);router['post']('/',auth[_0x7906('0xa')](),controller[_0x7906('0xf')]);router[_0x7906('0x10')](_0x7906('0xd'),auth[_0x7906('0xa')](),controller['update']);router[_0x7906('0x11')](_0x7906('0xd'),auth[_0x7906('0xa')](),controller[_0x7906('0x12')]);module[_0x7906('0x13')]=router;
\ No newline at end of file
+var _0xf456=['Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','delete','destroy','multer','path','connect-timeout'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0xf456,0xce));var _0x6f45=function(_0x1cd4e4,_0x2fbf5f){_0x1cd4e4=_0x1cd4e4-0x0;var _0x595a44=_0xf456[_0x1cd4e4];return _0x595a44;};'use strict';var multer=require(_0x6f45('0x0'));var util=require('util');var path=require(_0x6f45('0x1'));var timeout=require(_0x6f45('0x2'));var express=require('express');var router=express[_0x6f45('0x3')]();var fs_extra=require(_0x6f45('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6f45('0x5'));var config=require(_0x6f45('0x6'));var controller=require(_0x6f45('0x7'));router['get']('/',auth[_0x6f45('0x8')](),controller[_0x6f45('0x9')]);router[_0x6f45('0xa')](_0x6f45('0xb'),auth[_0x6f45('0x8')](),controller[_0x6f45('0xc')]);router[_0x6f45('0xa')](_0x6f45('0xd'),auth[_0x6f45('0x8')](),controller[_0x6f45('0xe')]);router['post']('/',auth[_0x6f45('0x8')](),controller[_0x6f45('0xf')]);router[_0x6f45('0x10')](_0x6f45('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6f45('0x11')](_0x6f45('0xd'),auth[_0x6f45('0x8')](),controller[_0x6f45('0x12')]);module['exports']=router;
\ No newline at end of file
index 7c04798..b4109e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06cc=['post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields'];(function(_0x4937c7,_0x25ba18){var _0x381882=function(_0x1d43c0){while(--_0x1d43c0){_0x4937c7['push'](_0x4937c7['shift']());}};_0x381882(++_0x25ba18);}(_0x06cc,0x18e));var _0xc06c=function(_0x4c1c50,_0x4c98cc){_0x4c1c50=_0x4c1c50-0x0;var _0x4cd310=_0x06cc[_0x4c1c50];return _0x4cd310;};'use strict';var multer=require(_0xc06c('0x0'));var util=require(_0xc06c('0x1'));var path=require(_0xc06c('0x2'));var timeout=require(_0xc06c('0x3'));var express=require(_0xc06c('0x4'));var router=express['Router']();var fs_extra=require(_0xc06c('0x5'));var auth=require(_0xc06c('0x6'));var interaction=require(_0xc06c('0x7'));var config=require(_0xc06c('0x8'));var controller=require('./intDeskAccount.controller');router[_0xc06c('0x9')]('/',auth[_0xc06c('0xa')](),controller[_0xc06c('0xb')]);router[_0xc06c('0x9')](_0xc06c('0xc'),auth[_0xc06c('0xa')](),controller[_0xc06c('0xd')]);router[_0xc06c('0x9')](_0xc06c('0xe'),auth[_0xc06c('0xa')](),controller['getConfigurations']);router[_0xc06c('0x9')](_0xc06c('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xc06c('0x10')]('/',auth[_0xc06c('0xa')](),controller['create']);router[_0xc06c('0x10')]('/:id/configurations',auth[_0xc06c('0xa')](),controller[_0xc06c('0x11')]);router[_0xc06c('0x12')]('/:id',auth[_0xc06c('0xa')](),controller[_0xc06c('0x13')]);router[_0xc06c('0x14')](_0xc06c('0xc'),auth['isAuthenticated'](),controller[_0xc06c('0x15')]);module[_0xc06c('0x16')]=router;
\ No newline at end of file
+var _0x7a8f=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','getConfigurations','post','create','/:id/configurations','put','delete','destroy'];(function(_0x38579f,_0x119131){var _0x1da51a=function(_0x5c85df){while(--_0x5c85df){_0x38579f['push'](_0x38579f['shift']());}};_0x1da51a(++_0x119131);}(_0x7a8f,0x1ed));var _0xf7a8=function(_0x13b631,_0x10e7fc){_0x13b631=_0x13b631-0x0;var _0x5abafc=_0x7a8f[_0x13b631];return _0x5abafc;};'use strict';var multer=require('multer');var util=require(_0xf7a8('0x0'));var path=require('path');var timeout=require(_0xf7a8('0x1'));var express=require('express');var router=express[_0xf7a8('0x2')]();var fs_extra=require(_0xf7a8('0x3'));var auth=require(_0xf7a8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf7a8('0x5'));var controller=require(_0xf7a8('0x6'));router[_0xf7a8('0x7')]('/',auth[_0xf7a8('0x8')](),controller['index']);router[_0xf7a8('0x7')](_0xf7a8('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xf7a8('0x7')]('/:id/configurations',auth[_0xf7a8('0x8')](),controller[_0xf7a8('0xa')]);router[_0xf7a8('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xf7a8('0xb')]('/',auth['isAuthenticated'](),controller[_0xf7a8('0xc')]);router[_0xf7a8('0xb')](_0xf7a8('0xd'),auth[_0xf7a8('0x8')](),controller['addConfiguration']);router[_0xf7a8('0xe')](_0xf7a8('0x9'),auth[_0xf7a8('0x8')](),controller['update']);router[_0xf7a8('0xf')]('/:id',auth[_0xf7a8('0x8')](),controller[_0xf7a8('0x10')]);module['exports']=router;
\ No newline at end of file
index 41df71a..a306e25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1ab=['basic','integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x3fdd56,_0x33f7d1){var _0x4473aa=function(_0x44a9d6){while(--_0x44a9d6){_0x3fdd56['push'](_0x3fdd56['shift']());}};_0x4473aa(++_0x33f7d1);}(_0xd1ab,0x153));var _0xbd1a=function(_0x2aa13a,_0x20350b){_0x2aa13a=_0x2aa13a-0x0;var _0x51c0cf=_0xd1ab[_0x2aa13a];return _0x51c0cf;};'use strict';var Sequelize=require(_0xbd1a('0x0'));module[_0xbd1a('0x1')]={'name':{'type':Sequelize[_0xbd1a('0x2')]},'description':{'type':Sequelize[_0xbd1a('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xbd1a('0x3')](_0xbd1a('0x4')),'defaultValue':_0xbd1a('0x4')},'password':{'type':Sequelize[_0xbd1a('0x2')]},'consumerKey':{'type':Sequelize[_0xbd1a('0x2')]},'consumerSecret':{'type':Sequelize[_0xbd1a('0x2')]},'token':{'type':Sequelize[_0xbd1a('0x2')]},'tokenSecret':{'type':Sequelize[_0xbd1a('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbd1a('0x3')](_0xbd1a('0x5'),_0xbd1a('0x6')),'defaultValue':_0xbd1a('0x5')}};
\ No newline at end of file
+var _0x0b42=['newTab','exports','STRING','basic','integrationTab'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x0b42,0x97));var _0x20b4=function(_0x5c7ad5,_0x452c34){_0x5c7ad5=_0x5c7ad5-0x0;var _0x31d92a=_0x0b42[_0x5c7ad5];return _0x31d92a;};'use strict';var Sequelize=require('sequelize');module[_0x20b4('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x20b4('0x1')]},'username':{'type':Sequelize[_0x20b4('0x1')]},'remoteUri':{'type':Sequelize[_0x20b4('0x1')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x20b4('0x2')},'password':{'type':Sequelize[_0x20b4('0x1')]},'consumerKey':{'type':Sequelize[_0x20b4('0x1')]},'consumerSecret':{'type':Sequelize[_0x20b4('0x1')]},'token':{'type':Sequelize[_0x20b4('0x1')]},'tokenSecret':{'type':Sequelize[_0x20b4('0x1')]},'serverUrl':{'type':Sequelize[_0x20b4('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x20b4('0x3'),_0x20b4('0x4')),'defaultValue':_0x20b4('0x3')}};
\ No newline at end of file
index 4d9fd8b..9f05a4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08d6=['DeskAccount','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','map','VIRTUAL','options','includeAll','findAll','rows','catch','rawAttributes','include','find','create','body','getConfigurations','params','DeskConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','findOne','password','consumerKey','consumerSecret','tokenSecret','remoteUri','GET','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','username','toString','base64','concat','_embedded','test','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index'];(function(_0x2b5ee5,_0x3741bf){var _0x1c480b=function(_0x437a18){while(--_0x437a18){_0x2b5ee5['push'](_0x2b5ee5['shift']());}};_0x1c480b(++_0x3741bf);}(_0x08d6,0x10e));var _0x608d=function(_0x3c268a,_0x43e6a1){_0x3c268a=_0x3c268a-0x0;var _0x489b02=_0x08d6[_0x3c268a];return _0x489b02;};'use strict';var emlformat=require(_0x608d('0x0'));var rimraf=require(_0x608d('0x1'));var zipdir=require(_0x608d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x608d('0x3'));var moment=require(_0x608d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x608d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x608d('0x6'));var csv=require(_0x608d('0x7'));var ejs=require(_0x608d('0x8'));var fs=require('fs');var fs_extra=require(_0x608d('0x9'));var _=require('lodash');var squel=require(_0x608d('0xa'));var crypto=require('crypto');var jsforce=require(_0x608d('0xb'));var deskjs=require(_0x608d('0xc'));var toCsv=require(_0x608d('0x7'));var querystring=require(_0x608d('0xd'));var Papa=require('papaparse');var Redis=require(_0x608d('0xe'));var authService=require(_0x608d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x608d('0x10'));var hardwareService=require(_0x608d('0x11'));var logger=require('../../config/logger')(_0x608d('0x12'));var utils=require(_0x608d('0x13'));var config=require(_0x608d('0x14'));var licenseUtil=require(_0x608d('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x213c1a,_0x2fa40c){_0x2fa40c=_0x2fa40c||0xcc;return function(_0x490578){if(_0x490578){return _0x213c1a['sendStatus'](_0x2fa40c);}return _0x213c1a[_0x608d('0x16')](_0x2fa40c)[_0x608d('0x17')]();};}function respondWithResult(_0x5c1682,_0x3bba09){_0x3bba09=_0x3bba09||0xc8;return function(_0xde0795){if(_0xde0795){return _0x5c1682[_0x608d('0x16')](_0x3bba09)[_0x608d('0x18')](_0xde0795);}};}function respondWithFilteredResult(_0xb54b4d,_0xc04e8f){return function(_0x2dcf24){if(_0x2dcf24){var _0x3fa462=typeof _0xc04e8f[_0x608d('0x19')]===_0x608d('0x1a')&&typeof _0xc04e8f['limit']===_0x608d('0x1a');var _0x27f4c6=_0x2dcf24['count'];var _0xe5fcda=_0x3fa462?0x0:_0xc04e8f[_0x608d('0x19')];var _0x2733f3=_0x3fa462?_0x2dcf24[_0x608d('0x1b')]:_0xc04e8f[_0x608d('0x19')]+_0xc04e8f[_0x608d('0x1c')];var _0x418326;if(_0x2733f3>=_0x27f4c6){_0x2733f3=_0x27f4c6;_0x418326=0xc8;}else{_0x418326=0xce;}_0xb54b4d[_0x608d('0x16')](_0x418326);return _0xb54b4d[_0x608d('0x1d')]('Content-Range',_0xe5fcda+'-'+_0x2733f3+'/'+_0x27f4c6)[_0x608d('0x18')](_0x2dcf24);}return null;};}function patchUpdates(_0x2e09a9){return function(_0x5298ae){try{jsonpatch[_0x608d('0x1e')](_0x5298ae,_0x2e09a9,!![]);}catch(_0x2169fa){return BPromise[_0x608d('0x1f')](_0x2169fa);}return _0x5298ae[_0x608d('0x20')]();};}function saveUpdates(_0x4c1009,_0x56d040){return function(_0x456733){if(_0x456733){return _0x456733[_0x608d('0x21')](_0x4c1009)['then'](function(_0x49ebaf){return _0x49ebaf;});}return null;};}function removeEntity(_0xbe37aa,_0x109c19){return function(_0x428ef9){if(_0x428ef9){return _0x428ef9[_0x608d('0x22')]()[_0x608d('0x23')](function(){_0xbe37aa[_0x608d('0x16')](0xcc)[_0x608d('0x17')]();});}};}function handleEntityNotFound(_0x1f6697,_0x4f192f){return function(_0x3d3d3c){if(!_0x3d3d3c){_0x1f6697[_0x608d('0x24')](0x194);}return _0x3d3d3c;};}function handleError(_0x5caec0,_0x4d3aca){_0x4d3aca=_0x4d3aca||0x1f4;return function(_0x2ec523){logger[_0x608d('0x25')](_0x2ec523[_0x608d('0x26')]);if(_0x2ec523[_0x608d('0x27')]){delete _0x2ec523[_0x608d('0x27')];}_0x5caec0[_0x608d('0x16')](_0x4d3aca)[_0x608d('0x28')](_0x2ec523);};}exports[_0x608d('0x29')]=function(_0x3c2309,_0x278dd2){var _0x2706a4={},_0x51ee1d={},_0x1db405={'count':0x0,'rows':[]};var _0x4ade15=_['map'](db[_0x608d('0x2a')]['rawAttributes'],function(_0x3e50f1){return{'name':_0x3e50f1['fieldName'],'type':_0x3e50f1['type']['key']};});_0x51ee1d[_0x608d('0x2b')]=_['map'](_0x4ade15,_0x608d('0x27'));_0x51ee1d[_0x608d('0x2c')]=_[_0x608d('0x2d')](_0x3c2309[_0x608d('0x2c')]);_0x51ee1d['filters']=_[_0x608d('0x2e')](_0x51ee1d[_0x608d('0x2b')],_0x51ee1d[_0x608d('0x2c')]);_0x2706a4[_0x608d('0x2f')]=_[_0x608d('0x2e')](_0x51ee1d[_0x608d('0x2b')],qs[_0x608d('0x30')](_0x3c2309[_0x608d('0x2c')][_0x608d('0x30')]));_0x2706a4[_0x608d('0x2f')]=_0x2706a4[_0x608d('0x2f')][_0x608d('0x31')]?_0x2706a4[_0x608d('0x2f')]:_0x51ee1d['model'];if(!_0x3c2309['query'][_0x608d('0x32')](_0x608d('0x33'))){_0x2706a4[_0x608d('0x1c')]=qs[_0x608d('0x1c')](_0x3c2309[_0x608d('0x2c')][_0x608d('0x1c')]);_0x2706a4[_0x608d('0x19')]=qs[_0x608d('0x19')](_0x3c2309[_0x608d('0x2c')]['offset']);}_0x2706a4[_0x608d('0x34')]=qs[_0x608d('0x35')](_0x3c2309['query'][_0x608d('0x35')]);_0x2706a4['where']=qs[_0x608d('0x36')](_[_0x608d('0x37')](_0x3c2309[_0x608d('0x2c')],_0x51ee1d[_0x608d('0x36')]),_0x4ade15);if(_0x3c2309['query'][_0x608d('0x38')]){_0x2706a4['where']=_[_0x608d('0x39')](_0x2706a4[_0x608d('0x3a')],{'$or':_[_0x608d('0x3b')](_0x4ade15,function(_0x3227e0){if(_0x3227e0['type']!==_0x608d('0x3c')){var _0x1b0a55={};_0x1b0a55[_0x3227e0[_0x608d('0x27')]]={'$like':'%'+_0x3c2309['query'][_0x608d('0x38')]+'%'};return _0x1b0a55;}})});}_0x2706a4=_[_0x608d('0x39')]({},_0x2706a4,_0x3c2309[_0x608d('0x3d')]);var _0x4fa3d6={'where':_0x2706a4[_0x608d('0x3a')]};return db[_0x608d('0x2a')][_0x608d('0x1b')](_0x4fa3d6)[_0x608d('0x23')](function(_0xd91e9f){_0x1db405[_0x608d('0x1b')]=_0xd91e9f;if(_0x3c2309[_0x608d('0x2c')][_0x608d('0x3e')]){_0x2706a4['include']=[{'all':!![]}];}return db[_0x608d('0x2a')][_0x608d('0x3f')](_0x2706a4);})[_0x608d('0x23')](function(_0x5639c9){_0x1db405[_0x608d('0x40')]=_0x5639c9;return _0x1db405;})[_0x608d('0x23')](respondWithFilteredResult(_0x278dd2,_0x2706a4))[_0x608d('0x41')](handleError(_0x278dd2,null));};exports['show']=function(_0x1e02a1,_0x2ac997){var _0x5bb1c3={'raw':![],'where':{'id':_0x1e02a1['params']['id']}},_0x4f4d36={};_0x4f4d36[_0x608d('0x2b')]=_[_0x608d('0x2d')](db[_0x608d('0x2a')][_0x608d('0x42')]);_0x4f4d36['query']=_[_0x608d('0x2d')](_0x1e02a1['query']);_0x4f4d36[_0x608d('0x36')]=_[_0x608d('0x2e')](_0x4f4d36['model'],_0x4f4d36['query']);_0x5bb1c3[_0x608d('0x2f')]=_[_0x608d('0x2e')](_0x4f4d36['model'],qs[_0x608d('0x30')](_0x1e02a1[_0x608d('0x2c')][_0x608d('0x30')]));_0x5bb1c3[_0x608d('0x2f')]=_0x5bb1c3[_0x608d('0x2f')][_0x608d('0x31')]?_0x5bb1c3[_0x608d('0x2f')]:_0x4f4d36[_0x608d('0x2b')];if(_0x1e02a1[_0x608d('0x2c')][_0x608d('0x3e')]){_0x5bb1c3[_0x608d('0x43')]=[{'all':!![]}];}_0x5bb1c3=_[_0x608d('0x39')]({},_0x5bb1c3,_0x1e02a1[_0x608d('0x3d')]);return db[_0x608d('0x2a')][_0x608d('0x44')](_0x5bb1c3)[_0x608d('0x23')](handleEntityNotFound(_0x2ac997,null))[_0x608d('0x23')](respondWithResult(_0x2ac997,null))[_0x608d('0x41')](handleError(_0x2ac997,null));};exports['create']=function(_0x11f7d1,_0xb56cf3){return db[_0x608d('0x2a')][_0x608d('0x45')](_0x11f7d1['body'],{})[_0x608d('0x23')](respondWithResult(_0xb56cf3,0xc9))[_0x608d('0x41')](handleError(_0xb56cf3,null));};exports[_0x608d('0x21')]=function(_0x15662d,_0x2e283a){if(_0x15662d[_0x608d('0x46')]['id']){delete _0x15662d[_0x608d('0x46')]['id'];}return db[_0x608d('0x2a')][_0x608d('0x44')]({'where':{'id':_0x15662d['params']['id']}})[_0x608d('0x23')](handleEntityNotFound(_0x2e283a,null))[_0x608d('0x23')](saveUpdates(_0x15662d[_0x608d('0x46')],null))[_0x608d('0x23')](respondWithResult(_0x2e283a,null))[_0x608d('0x41')](handleError(_0x2e283a,null));};exports['destroy']=function(_0x13fbf8,_0x2a54ce){return db[_0x608d('0x2a')][_0x608d('0x44')]({'where':{'id':_0x13fbf8['params']['id']}})[_0x608d('0x23')](handleEntityNotFound(_0x2a54ce,null))[_0x608d('0x23')](removeEntity(_0x2a54ce,null))[_0x608d('0x41')](handleError(_0x2a54ce,null));};exports[_0x608d('0x47')]=function(_0x32b795,_0x2615eb,_0x1df76c){var _0x150caf={};var _0x1f7b6b={};var _0x2c6ac0;var _0x5e3ed9;return db[_0x608d('0x2a')]['findOne']({'where':{'id':_0x32b795[_0x608d('0x48')]['id']}})['then'](handleEntityNotFound(_0x2615eb,null))['then'](function(_0xc0bdd2){if(_0xc0bdd2){_0x2c6ac0=_0xc0bdd2;_0x1f7b6b[_0x608d('0x2b')]=_[_0x608d('0x2d')](db[_0x608d('0x49')]['rawAttributes']);_0x1f7b6b[_0x608d('0x2c')]=_[_0x608d('0x2d')](_0x32b795[_0x608d('0x2c')]);_0x1f7b6b[_0x608d('0x36')]=_[_0x608d('0x2e')](_0x1f7b6b['model'],_0x1f7b6b[_0x608d('0x2c')]);_0x150caf['attributes']=_[_0x608d('0x2e')](_0x1f7b6b['model'],qs[_0x608d('0x30')](_0x32b795[_0x608d('0x2c')][_0x608d('0x30')]));_0x150caf[_0x608d('0x2f')]=_0x150caf[_0x608d('0x2f')][_0x608d('0x31')]?_0x150caf[_0x608d('0x2f')]:_0x1f7b6b[_0x608d('0x2b')];_0x150caf[_0x608d('0x34')]=qs[_0x608d('0x35')](_0x32b795['query']['sort']);_0x150caf['where']=qs[_0x608d('0x36')](_['pick'](_0x32b795[_0x608d('0x2c')],_0x1f7b6b[_0x608d('0x36')]));if(_0x32b795[_0x608d('0x2c')]['filter']){_0x150caf[_0x608d('0x3a')]=_[_0x608d('0x39')](_0x150caf['where'],{'$or':_[_0x608d('0x3b')](_0x150caf['attributes'],function(_0x9d5b83){var _0x1a6603={};_0x1a6603[_0x9d5b83]={'$like':'%'+_0x32b795[_0x608d('0x2c')][_0x608d('0x38')]+'%'};return _0x1a6603;})});}_0x150caf=_[_0x608d('0x39')]({},_0x150caf,_0x32b795['options']);return _0x2c6ac0[_0x608d('0x47')](_0x150caf);}})['then'](function(_0x4248fb){if(_0x4248fb){_0x5e3ed9=_0x4248fb[_0x608d('0x31')];if(!_0x32b795[_0x608d('0x2c')][_0x608d('0x32')](_0x608d('0x33'))){_0x150caf[_0x608d('0x1c')]=qs[_0x608d('0x1c')](_0x32b795[_0x608d('0x2c')][_0x608d('0x1c')]);_0x150caf[_0x608d('0x19')]=qs['offset'](_0x32b795['query'][_0x608d('0x19')]);}return _0x2c6ac0[_0x608d('0x47')](_0x150caf);}})['then'](function(_0x223dfc){if(_0x223dfc){return _0x223dfc?{'count':_0x5e3ed9,'rows':_0x223dfc}:null;}})[_0x608d('0x23')](respondWithResult(_0x2615eb,null))[_0x608d('0x41')](handleError(_0x2615eb,null));};exports['addConfiguration']=function(_0x4c591c,_0x1ec87d,_0x2b1439){if(_0x4c591c[_0x608d('0x46')]['id']){delete _0x4c591c[_0x608d('0x46')]['id'];}return db[_0x608d('0x2a')]['findOne']({'where':{'id':_0x4c591c[_0x608d('0x48')]['id']}})[_0x608d('0x23')](handleEntityNotFound(_0x1ec87d,null))[_0x608d('0x23')](function(_0x37027c){if(_0x37027c){_0x4c591c['body']['AccountId']=_0x37027c['id'];_0x4c591c[_0x608d('0x46')][_0x608d('0x4a')]=integrations[_0x608d('0x4b')](_0x4c591c[_0x608d('0x46')][_0x608d('0x4c')],_0x4c591c[_0x608d('0x46')]['type']);_0x4c591c['body'][_0x608d('0x4d')]=integrations[_0x608d('0x4e')](_0x4c591c[_0x608d('0x46')][_0x608d('0x4c')],_0x4c591c['body']['type']);return db['DeskConfiguration'][_0x608d('0x45')](_0x4c591c[_0x608d('0x46')],{'include':[{'model':db['DeskField'],'as':_0x608d('0x4a')},{'model':db[_0x608d('0x4f')],'as':_0x608d('0x4d')}]});}return null;})[_0x608d('0x23')](respondWithResult(_0x1ec87d,null))[_0x608d('0x41')](handleError(_0x1ec87d,null));};exports['getFields']=function(_0x3a9f36,_0x43bf6f,_0x2dbaef){var _0x280599=[{'name':_0x608d('0x50'),'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 _0x5518b6='';return db[_0x608d('0x2a')][_0x608d('0x51')]({'where':{'id':_0x3a9f36[_0x608d('0x48')]['id']},'attributes':['id','remoteUri','authType','username',_0x608d('0x52'),_0x608d('0x53'),_0x608d('0x54'),'token',_0x608d('0x55')]})['then'](handleEntityNotFound(_0x43bf6f,null))[_0x608d('0x23')](function(_0x4780af){if(_0x4780af){_0x5518b6=_0x4780af[_0x608d('0x56')];var _0x3b1848=_0x5518b6['slice'](-0x1);if(_0x3b1848==='/'){_0x5518b6=_0x5518b6['substring'](0x0,_0x5518b6['lastIndexOf'](_0x3b1848));}var _0x11369b={'method':_0x608d('0x57'),'uri':util[_0x608d('0x58')]('%s/custom_fields',_0x5518b6),'headers':{'Content-Type':_0x608d('0x59'),'Accept':_0x608d('0x59')},'json':!![]};if(_0x4780af['authType']===_0x608d('0x5a')){_0x11369b[_0x608d('0x5b')][_0x608d('0x5c')]=util[_0x608d('0x58')](_0x608d('0x5d'),new Buffer(util[_0x608d('0x58')](_0x608d('0x5e'),_0x4780af[_0x608d('0x5f')],_0x4780af[_0x608d('0x52')]))[_0x608d('0x60')](_0x608d('0x61')));}return rp(_0x11369b)[_0x608d('0x23')](function(_0x58f62a){return _0x280599[_0x608d('0x62')](_['map'](_0x58f62a[_0x608d('0x63')]['entries'],function(_0x5c3cbe){return{'id':_0x5c3cbe[_0x608d('0x27')],'name':_0x5c3cbe[_0x608d('0x27')],'type':_0x5c3cbe['type'],'active':_0x5c3cbe['active'],'label':_0x5c3cbe['label'],'custom':!![]};}));});}})[_0x608d('0x23')](function(_0x1307ce){return{'count':_0x1307ce[_0x608d('0x31')],'rows':_0x1307ce};})[_0x608d('0x23')](respondWithResult(_0x43bf6f,null))[_0x608d('0x41')](function(_0xf108bf){var _0x48d434=_0x3a9f36[_0x608d('0x2c')][_0x608d('0x64')]?0x1f4:_0xf108bf['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x608d('0x65'),_0x48d434,JSON['stringify'](_0xf108bf));delete _0xf108bf['name'];if(_0x48d434===0x191){_0x48d434=0x190;}_0x43bf6f[_0x608d('0x16')](_0x48d434)[_0x608d('0x28')](_0x3a9f36[_0x608d('0x2c')]['test']?{'message':_0x608d('0x66'),'statusCode':_0xf108bf[_0x608d('0x67')]}:_0xf108bf);});};
\ No newline at end of file
+var _0x022c=['send','index','map','rawAttributes','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','intersection','length','DeskAccount','find','create','body','findOne','DeskConfiguration','options','getConfigurations','addConfiguration','Subjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','authType','username','token','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','password','toString','base64','concat','_embedded','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name'];(function(_0x25498f,_0x17abfb){var _0x2b338f=function(_0x3b330e){while(--_0x3b330e){_0x25498f['push'](_0x25498f['shift']());}};_0x2b338f(++_0x17abfb);}(_0x022c,0xb6));var _0xc022=function(_0x9886f1,_0x590394){_0x9886f1=_0x9886f1-0x0;var _0x19aa1b=_0x022c[_0x9886f1];return _0x19aa1b;};'use strict';var emlformat=require(_0xc022('0x0'));var rimraf=require(_0xc022('0x1'));var zipdir=require(_0xc022('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc022('0x3'));var moment=require('moment');var BPromise=require(_0xc022('0x4'));var Mustache=require(_0xc022('0x5'));var util=require(_0xc022('0x6'));var path=require('path');var sox=require(_0xc022('0x7'));var csv=require(_0xc022('0x8'));var ejs=require(_0xc022('0x9'));var fs=require('fs');var fs_extra=require(_0xc022('0xa'));var _=require(_0xc022('0xb'));var squel=require('squel');var crypto=require(_0xc022('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc022('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc022('0xe'));var Papa=require(_0xc022('0xf'));var Redis=require('ioredis');var authService=require(_0xc022('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc022('0x11'));var hardwareService=require(_0xc022('0x12'));var logger=require('../../config/logger')(_0xc022('0x13'));var utils=require(_0xc022('0x14'));var config=require(_0xc022('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc022('0x16'))['db'];var integrations=require(_0xc022('0x17'));function respondWithStatusCode(_0x4b967f,_0x528486){_0x528486=_0x528486||0xcc;return function(_0x42d502){if(_0x42d502){return _0x4b967f[_0xc022('0x18')](_0x528486);}return _0x4b967f[_0xc022('0x19')](_0x528486)[_0xc022('0x1a')]();};}function respondWithResult(_0x43ecdc,_0x175959){_0x175959=_0x175959||0xc8;return function(_0x272304){if(_0x272304){return _0x43ecdc[_0xc022('0x19')](_0x175959)[_0xc022('0x1b')](_0x272304);}};}function respondWithFilteredResult(_0xd0fc28,_0x1006a0){return function(_0x396e81){if(_0x396e81){var _0x24d5b3=typeof _0x1006a0[_0xc022('0x1c')]===_0xc022('0x1d')&&typeof _0x1006a0[_0xc022('0x1e')]===_0xc022('0x1d');var _0xaabeaf=_0x396e81[_0xc022('0x1f')];var _0xd92df3=_0x24d5b3?0x0:_0x1006a0[_0xc022('0x1c')];var _0x46b667=_0x24d5b3?_0x396e81[_0xc022('0x1f')]:_0x1006a0[_0xc022('0x1c')]+_0x1006a0['limit'];var _0x42eaf2;if(_0x46b667>=_0xaabeaf){_0x46b667=_0xaabeaf;_0x42eaf2=0xc8;}else{_0x42eaf2=0xce;}_0xd0fc28[_0xc022('0x19')](_0x42eaf2);return _0xd0fc28[_0xc022('0x20')](_0xc022('0x21'),_0xd92df3+'-'+_0x46b667+'/'+_0xaabeaf)['json'](_0x396e81);}return null;};}function patchUpdates(_0x5a6cd4){return function(_0x25ac77){try{jsonpatch[_0xc022('0x22')](_0x25ac77,_0x5a6cd4,!![]);}catch(_0x819277){return BPromise[_0xc022('0x23')](_0x819277);}return _0x25ac77[_0xc022('0x24')]();};}function saveUpdates(_0x57b0f8,_0xaae446){return function(_0xe19cb0){if(_0xe19cb0){return _0xe19cb0['update'](_0x57b0f8)[_0xc022('0x25')](function(_0x41ab80){return _0x41ab80;});}return null;};}function removeEntity(_0xbfef72,_0x4cade7){return function(_0x5bc89b){if(_0x5bc89b){return _0x5bc89b[_0xc022('0x26')]()[_0xc022('0x25')](function(){_0xbfef72[_0xc022('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x822ad,_0x20618d){return function(_0x380245){if(!_0x380245){_0x822ad[_0xc022('0x18')](0x194);}return _0x380245;};}function handleError(_0x51a50b,_0x284db4){_0x284db4=_0x284db4||0x1f4;return function(_0x51ba72){logger[_0xc022('0x27')](_0x51ba72[_0xc022('0x28')]);if(_0x51ba72['name']){delete _0x51ba72[_0xc022('0x29')];}_0x51a50b[_0xc022('0x19')](_0x284db4)[_0xc022('0x2a')](_0x51ba72);};}exports[_0xc022('0x2b')]=function(_0x55818f,_0x152701){var _0x35c7be={},_0x1fcc2b={},_0x3e0b41={'count':0x0,'rows':[]};var _0x2f8284=_[_0xc022('0x2c')](db['DeskAccount'][_0xc022('0x2d')],function(_0x5f04b1){return{'name':_0x5f04b1['fieldName'],'type':_0x5f04b1['type'][_0xc022('0x2e')]};});_0x1fcc2b['model']=_[_0xc022('0x2c')](_0x2f8284,_0xc022('0x29'));_0x1fcc2b[_0xc022('0x2f')]=_[_0xc022('0x30')](_0x55818f[_0xc022('0x2f')]);_0x1fcc2b[_0xc022('0x31')]=_['intersection'](_0x1fcc2b[_0xc022('0x32')],_0x1fcc2b['query']);_0x35c7be[_0xc022('0x33')]=_['intersection'](_0x1fcc2b[_0xc022('0x32')],qs[_0xc022('0x34')](_0x55818f[_0xc022('0x2f')]['fields']));_0x35c7be[_0xc022('0x33')]=_0x35c7be['attributes']['length']?_0x35c7be[_0xc022('0x33')]:_0x1fcc2b[_0xc022('0x32')];if(!_0x55818f[_0xc022('0x2f')][_0xc022('0x35')](_0xc022('0x36'))){_0x35c7be[_0xc022('0x1e')]=qs[_0xc022('0x1e')](_0x55818f[_0xc022('0x2f')][_0xc022('0x1e')]);_0x35c7be[_0xc022('0x1c')]=qs[_0xc022('0x1c')](_0x55818f['query'][_0xc022('0x1c')]);}_0x35c7be[_0xc022('0x37')]=qs[_0xc022('0x38')](_0x55818f['query'][_0xc022('0x38')]);_0x35c7be['where']=qs[_0xc022('0x31')](_[_0xc022('0x39')](_0x55818f['query'],_0x1fcc2b[_0xc022('0x31')]),_0x2f8284);if(_0x55818f[_0xc022('0x2f')][_0xc022('0x3a')]){_0x35c7be[_0xc022('0x3b')]=_[_0xc022('0x3c')](_0x35c7be[_0xc022('0x3b')],{'$or':_['map'](_0x2f8284,function(_0x303ce3){if(_0x303ce3[_0xc022('0x3d')]!==_0xc022('0x3e')){var _0x15b00c={};_0x15b00c[_0x303ce3[_0xc022('0x29')]]={'$like':'%'+_0x55818f['query'][_0xc022('0x3a')]+'%'};return _0x15b00c;}})});}_0x35c7be=_[_0xc022('0x3c')]({},_0x35c7be,_0x55818f['options']);var _0x249ead={'where':_0x35c7be[_0xc022('0x3b')]};return db['DeskAccount'][_0xc022('0x1f')](_0x249ead)[_0xc022('0x25')](function(_0x3332de){_0x3e0b41[_0xc022('0x1f')]=_0x3332de;if(_0x55818f[_0xc022('0x2f')][_0xc022('0x3f')]){_0x35c7be[_0xc022('0x40')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x35c7be);})[_0xc022('0x25')](function(_0x1d714f){_0x3e0b41[_0xc022('0x41')]=_0x1d714f;return _0x3e0b41;})[_0xc022('0x25')](respondWithFilteredResult(_0x152701,_0x35c7be))[_0xc022('0x42')](handleError(_0x152701,null));};exports[_0xc022('0x43')]=function(_0x460b6e,_0x182dbf){var _0x1068e9={'raw':![],'where':{'id':_0x460b6e[_0xc022('0x44')]['id']}},_0x189c77={};_0x189c77[_0xc022('0x32')]=_[_0xc022('0x30')](db['DeskAccount'][_0xc022('0x2d')]);_0x189c77[_0xc022('0x2f')]=_[_0xc022('0x30')](_0x460b6e[_0xc022('0x2f')]);_0x189c77[_0xc022('0x31')]=_[_0xc022('0x45')](_0x189c77['model'],_0x189c77[_0xc022('0x2f')]);_0x1068e9[_0xc022('0x33')]=_['intersection'](_0x189c77[_0xc022('0x32')],qs[_0xc022('0x34')](_0x460b6e[_0xc022('0x2f')][_0xc022('0x34')]));_0x1068e9[_0xc022('0x33')]=_0x1068e9[_0xc022('0x33')][_0xc022('0x46')]?_0x1068e9['attributes']:_0x189c77[_0xc022('0x32')];if(_0x460b6e[_0xc022('0x2f')][_0xc022('0x3f')]){_0x1068e9[_0xc022('0x40')]=[{'all':!![]}];}_0x1068e9=_[_0xc022('0x3c')]({},_0x1068e9,_0x460b6e['options']);return db[_0xc022('0x47')][_0xc022('0x48')](_0x1068e9)[_0xc022('0x25')](handleEntityNotFound(_0x182dbf,null))[_0xc022('0x25')](respondWithResult(_0x182dbf,null))[_0xc022('0x42')](handleError(_0x182dbf,null));};exports['create']=function(_0xe3d3ab,_0x5d7cb1){return db['DeskAccount'][_0xc022('0x49')](_0xe3d3ab[_0xc022('0x4a')],{})['then'](respondWithResult(_0x5d7cb1,0xc9))[_0xc022('0x42')](handleError(_0x5d7cb1,null));};exports['update']=function(_0xf92c04,_0x33b17f){if(_0xf92c04['body']['id']){delete _0xf92c04['body']['id'];}return db[_0xc022('0x47')][_0xc022('0x48')]({'where':{'id':_0xf92c04[_0xc022('0x44')]['id']}})['then'](handleEntityNotFound(_0x33b17f,null))[_0xc022('0x25')](saveUpdates(_0xf92c04[_0xc022('0x4a')],null))[_0xc022('0x25')](respondWithResult(_0x33b17f,null))['catch'](handleError(_0x33b17f,null));};exports['destroy']=function(_0x10846b,_0x250dc0){return db[_0xc022('0x47')][_0xc022('0x48')]({'where':{'id':_0x10846b[_0xc022('0x44')]['id']}})[_0xc022('0x25')](handleEntityNotFound(_0x250dc0,null))['then'](removeEntity(_0x250dc0,null))['catch'](handleError(_0x250dc0,null));};exports['getConfigurations']=function(_0x464f5c,_0x13652f,_0x11968e){var _0x50bbb2={};var _0x4d2ad9={};var _0x2650d0;var _0x568adc;return db[_0xc022('0x47')][_0xc022('0x4b')]({'where':{'id':_0x464f5c[_0xc022('0x44')]['id']}})[_0xc022('0x25')](handleEntityNotFound(_0x13652f,null))[_0xc022('0x25')](function(_0x3af3ba){if(_0x3af3ba){_0x2650d0=_0x3af3ba;_0x4d2ad9['model']=_[_0xc022('0x30')](db[_0xc022('0x4c')][_0xc022('0x2d')]);_0x4d2ad9['query']=_[_0xc022('0x30')](_0x464f5c[_0xc022('0x2f')]);_0x4d2ad9['filters']=_[_0xc022('0x45')](_0x4d2ad9[_0xc022('0x32')],_0x4d2ad9['query']);_0x50bbb2[_0xc022('0x33')]=_[_0xc022('0x45')](_0x4d2ad9[_0xc022('0x32')],qs[_0xc022('0x34')](_0x464f5c[_0xc022('0x2f')][_0xc022('0x34')]));_0x50bbb2['attributes']=_0x50bbb2[_0xc022('0x33')]['length']?_0x50bbb2['attributes']:_0x4d2ad9[_0xc022('0x32')];_0x50bbb2[_0xc022('0x37')]=qs[_0xc022('0x38')](_0x464f5c[_0xc022('0x2f')]['sort']);_0x50bbb2[_0xc022('0x3b')]=qs[_0xc022('0x31')](_[_0xc022('0x39')](_0x464f5c[_0xc022('0x2f')],_0x4d2ad9[_0xc022('0x31')]));if(_0x464f5c[_0xc022('0x2f')]['filter']){_0x50bbb2[_0xc022('0x3b')]=_[_0xc022('0x3c')](_0x50bbb2[_0xc022('0x3b')],{'$or':_['map'](_0x50bbb2[_0xc022('0x33')],function(_0x502606){var _0x508255={};_0x508255[_0x502606]={'$like':'%'+_0x464f5c[_0xc022('0x2f')][_0xc022('0x3a')]+'%'};return _0x508255;})});}_0x50bbb2=_['merge']({},_0x50bbb2,_0x464f5c[_0xc022('0x4d')]);return _0x2650d0[_0xc022('0x4e')](_0x50bbb2);}})[_0xc022('0x25')](function(_0x3d5fb5){if(_0x3d5fb5){_0x568adc=_0x3d5fb5[_0xc022('0x46')];if(!_0x464f5c['query'][_0xc022('0x35')](_0xc022('0x36'))){_0x50bbb2['limit']=qs[_0xc022('0x1e')](_0x464f5c[_0xc022('0x2f')][_0xc022('0x1e')]);_0x50bbb2[_0xc022('0x1c')]=qs[_0xc022('0x1c')](_0x464f5c[_0xc022('0x2f')][_0xc022('0x1c')]);}return _0x2650d0[_0xc022('0x4e')](_0x50bbb2);}})[_0xc022('0x25')](function(_0x2082f7){if(_0x2082f7){return _0x2082f7?{'count':_0x568adc,'rows':_0x2082f7}:null;}})[_0xc022('0x25')](respondWithResult(_0x13652f,null))[_0xc022('0x42')](handleError(_0x13652f,null));};exports[_0xc022('0x4f')]=function(_0x1085da,_0x4f2ea4,_0x581396){if(_0x1085da[_0xc022('0x4a')]['id']){delete _0x1085da[_0xc022('0x4a')]['id'];}return db[_0xc022('0x47')][_0xc022('0x4b')]({'where':{'id':_0x1085da[_0xc022('0x44')]['id']}})[_0xc022('0x25')](handleEntityNotFound(_0x4f2ea4,null))[_0xc022('0x25')](function(_0x4800e0){if(_0x4800e0){_0x1085da[_0xc022('0x4a')]['AccountId']=_0x4800e0['id'];_0x1085da[_0xc022('0x4a')][_0xc022('0x50')]=integrations['getSubjects'](_0x1085da[_0xc022('0x4a')][_0xc022('0x51')],_0x1085da[_0xc022('0x4a')][_0xc022('0x3d')]);_0x1085da[_0xc022('0x4a')][_0xc022('0x52')]=integrations['getDescriptions'](_0x1085da[_0xc022('0x4a')][_0xc022('0x51')],_0x1085da[_0xc022('0x4a')][_0xc022('0x3d')]);return db[_0xc022('0x4c')]['create'](_0x1085da['body'],{'include':[{'model':db[_0xc022('0x53')],'as':_0xc022('0x50')},{'model':db[_0xc022('0x53')],'as':_0xc022('0x52')}]});}return null;})[_0xc022('0x25')](respondWithResult(_0x4f2ea4,null))['catch'](handleError(_0x4f2ea4,null));};exports[_0xc022('0x54')]=function(_0x314df1,_0x2f5747,_0x38d942){var _0x253391=[{'name':_0xc022('0x55'),'label':_0xc022('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x152361='';return db['DeskAccount'][_0xc022('0x4b')]({'where':{'id':_0x314df1[_0xc022('0x44')]['id']},'attributes':['id',_0xc022('0x56'),_0xc022('0x57'),_0xc022('0x58'),'password','consumerKey','consumerSecret',_0xc022('0x59'),_0xc022('0x5a')]})[_0xc022('0x25')](handleEntityNotFound(_0x2f5747,null))[_0xc022('0x25')](function(_0x30ffd0){if(_0x30ffd0){_0x152361=_0x30ffd0[_0xc022('0x56')];var _0x2a7b76=_0x152361['slice'](-0x1);if(_0x2a7b76==='/'){_0x152361=_0x152361[_0xc022('0x5b')](0x0,_0x152361[_0xc022('0x5c')](_0x2a7b76));}var _0x3bc0f2={'method':_0xc022('0x5d'),'uri':util[_0xc022('0x5e')](_0xc022('0x5f'),_0x152361),'headers':{'Content-Type':_0xc022('0x60'),'Accept':_0xc022('0x60')},'json':!![]};if(_0x30ffd0[_0xc022('0x57')]===_0xc022('0x61')){_0x3bc0f2['headers'][_0xc022('0x62')]=util[_0xc022('0x5e')](_0xc022('0x63'),new Buffer(util[_0xc022('0x5e')](_0xc022('0x64'),_0x30ffd0['username'],_0x30ffd0[_0xc022('0x65')]))[_0xc022('0x66')](_0xc022('0x67')));}return rp(_0x3bc0f2)[_0xc022('0x25')](function(_0x12f899){return _0x253391[_0xc022('0x68')](_[_0xc022('0x2c')](_0x12f899[_0xc022('0x69')]['entries'],function(_0x1470ae){return{'id':_0x1470ae[_0xc022('0x29')],'name':_0x1470ae[_0xc022('0x29')],'type':_0x1470ae['type'],'active':_0x1470ae[_0xc022('0x6a')],'label':_0x1470ae[_0xc022('0x6b')],'custom':!![]};}));});}})[_0xc022('0x25')](function(_0x313fbc){return{'count':_0x313fbc['length'],'rows':_0x313fbc};})[_0xc022('0x25')](respondWithResult(_0x2f5747,null))[_0xc022('0x42')](function(_0xd6822c){var _0x5e235f=_0x314df1['query'][_0xc022('0x6c')]?0x1f4:_0xd6822c['statusCode']||0x1f4;logger[_0xc022('0x27')](_0xc022('0x6d'),'getFields',_0x5e235f,JSON[_0xc022('0x6e')](_0xd6822c));delete _0xd6822c['name'];if(_0x5e235f===0x191){_0x5e235f=0x190;}_0x2f5747[_0xc022('0x19')](_0x5e235f)[_0xc022('0x2a')](_0x314df1[_0xc022('0x2f')][_0xc022('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0xd6822c[_0xc022('0x6f')]}:_0xd6822c);});};
\ No newline at end of file
index b1cd101..e94f74b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99bd=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','api','moment','../../config/environment'];(function(_0x594b3a,_0x60242d){var _0x2ea77a=function(_0x14fe30){while(--_0x14fe30){_0x594b3a['push'](_0x594b3a['shift']());}};_0x2ea77a(++_0x60242d);}(_0x99bd,0x15b));var _0xd99b=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x99bd[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require(_0xd99b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd99b('0x1'));var moment=require(_0xd99b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd99b('0x3'));var attributes=require(_0xd99b('0x4'));var integrations=require(_0xd99b('0x5'));module[_0xd99b('0x6')]=function(_0x34f0ab,_0x696851){return _0x34f0ab['define'](_0xd99b('0x7'),attributes,{'tableName':_0xd99b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf16e=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf16e,0xd7));var _0xef16=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xf16e[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xef16('0x0'));var util=require(_0xef16('0x1'));var logger=require('../../config/logger')(_0xef16('0x2'));var moment=require('moment');var BPromise=require(_0xef16('0x3'));var rp=require(_0xef16('0x4'));var fs=require('fs');var path=require(_0xef16('0x5'));var rimraf=require(_0xef16('0x6'));var config=require(_0xef16('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xef16('0x8'));module[_0xef16('0x9')]=function(_0x3be11d,_0x9bb35c){return _0x3be11d['define'](_0xef16('0xa'),attributes,{'tableName':_0xef16('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d40d9f2..a1117d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d76=['include','model','debug','GetDeskAccount','ShowDeskAccount','find','then','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','DeskAccount','findAll','options','where','attributes','limit','map'];(function(_0x1bb91e,_0x4d6778){var _0x76925b=function(_0x34d074){while(--_0x34d074){_0x1bb91e['push'](_0x1bb91e['shift']());}};_0x76925b(++_0x4d6778);}(_0x5d76,0x8b));var _0x65d7=function(_0x5856cc,_0x56a9ce){_0x5856cc=_0x5856cc-0x0;var _0xc97e3a=_0x5d76[_0x5856cc];return _0xc97e3a;};'use strict';var _=require('lodash');var util=require(_0x65d7('0x0'));var moment=require(_0x65d7('0x1'));var BPromise=require('bluebird');var rs=require(_0x65d7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65d7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x65d7('0x4'))(_0x65d7('0x5'));var config=require('../../config/environment');var jayson=require(_0x65d7('0x6'));var client=jayson[_0x65d7('0x7')][_0x65d7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ef493,_0x5b37d6,_0x2f8f3d){return new BPromise(function(_0x242eba,_0x50705e){return client[_0x65d7('0x9')](_0x5ef493,_0x2f8f3d)['then'](function(_0x5f334e){logger['info'](_0x65d7('0xa'),_0x5b37d6,_0x65d7('0xb'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5b37d6,'request\x20sent',JSON[_0x65d7('0xc')](_0x5f334e));if(_0x5f334e[_0x65d7('0xd')]){if(_0x5f334e[_0x65d7('0xd')][_0x65d7('0xe')]===0x1f4){logger[_0x65d7('0xd')](_0x65d7('0xa'),_0x5b37d6,_0x5f334e[_0x65d7('0xd')]['message']);return _0x50705e(_0x5f334e[_0x65d7('0xd')]['message']);}logger[_0x65d7('0xd')](_0x65d7('0xa'),_0x5b37d6,_0x5f334e['error'][_0x65d7('0xf')]);return _0x242eba(_0x5f334e[_0x65d7('0xd')]['message']);}else{logger[_0x65d7('0x10')]('DeskAccount,\x20%s,\x20%s',_0x5b37d6,_0x65d7('0xb'));_0x242eba(_0x5f334e[_0x65d7('0x11')]['message']);}})[_0x65d7('0x12')](function(_0x38afd8){logger[_0x65d7('0xd')]('DeskAccount,\x20%s,\x20%s',_0x5b37d6,_0x38afd8);_0x50705e(_0x38afd8);});});}exports['GetDeskAccount']=function(_0x34cdd7){var _0x4feb1b=this;return new Promise(function(_0x13cfc6,_0x335e99){return db[_0x65d7('0x13')][_0x65d7('0x14')]({'raw':_0x34cdd7['options']?_0x34cdd7[_0x65d7('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x34cdd7[_0x65d7('0x15')]?_0x34cdd7[_0x65d7('0x15')][_0x65d7('0x16')]||null:null,'attributes':_0x34cdd7[_0x65d7('0x15')]?_0x34cdd7[_0x65d7('0x15')][_0x65d7('0x17')]||null:null,'limit':_0x34cdd7[_0x65d7('0x15')]?_0x34cdd7[_0x65d7('0x15')][_0x65d7('0x18')]||null:null,'include':_0x34cdd7[_0x65d7('0x15')]?_0x34cdd7[_0x65d7('0x15')]['include']?_[_0x65d7('0x19')](_0x34cdd7['options'][_0x65d7('0x1a')],function(_0x4d707a){return{'model':db[_0x4d707a['model']],'as':_0x4d707a['as'],'attributes':_0x4d707a['attributes'],'include':_0x4d707a[_0x65d7('0x1a')]?_['map'](_0x4d707a[_0x65d7('0x1a')],function(_0x23866d){return{'model':db[_0x23866d[_0x65d7('0x1b')]],'as':_0x23866d['as'],'attributes':_0x23866d[_0x65d7('0x17')],'include':_0x23866d[_0x65d7('0x1a')]?_[_0x65d7('0x19')](_0x23866d['include'],function(_0x5762b6){return{'model':db[_0x5762b6['model']],'as':_0x5762b6['as'],'attributes':_0x5762b6[_0x65d7('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x282d01){logger[_0x65d7('0x10')]('GetDeskAccount',_0x34cdd7);logger[_0x65d7('0x1c')](_0x65d7('0x1d'),_0x34cdd7,JSON['stringify'](_0x282d01));_0x13cfc6(_0x282d01);})[_0x65d7('0x12')](function(_0x5be1f0){logger[_0x65d7('0xd')](_0x65d7('0x1d'),_0x5be1f0['message'],_0x34cdd7);_0x335e99(_0x4feb1b['error'](0x1f4,_0x5be1f0[_0x65d7('0xf')]));});});};exports[_0x65d7('0x1e')]=function(_0xea09eb){var _0x13f334=this;return new Promise(function(_0x210a2a,_0x3bd78e){return db[_0x65d7('0x13')][_0x65d7('0x1f')]({'raw':_0xea09eb[_0x65d7('0x15')]?_0xea09eb[_0x65d7('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xea09eb[_0x65d7('0x15')]?_0xea09eb[_0x65d7('0x15')][_0x65d7('0x16')]||null:null,'attributes':_0xea09eb[_0x65d7('0x15')]?_0xea09eb['options']['attributes']||null:null,'include':_0xea09eb[_0x65d7('0x15')]?_0xea09eb[_0x65d7('0x15')][_0x65d7('0x1a')]?_[_0x65d7('0x19')](_0xea09eb[_0x65d7('0x15')][_0x65d7('0x1a')],function(_0x401e11){return{'model':db[_0x401e11['model']],'as':_0x401e11['as'],'attributes':_0x401e11[_0x65d7('0x17')],'include':_0x401e11['include']?_[_0x65d7('0x19')](_0x401e11[_0x65d7('0x1a')],function(_0xd32f7e){return{'model':db[_0xd32f7e[_0x65d7('0x1b')]],'as':_0xd32f7e['as'],'attributes':_0xd32f7e[_0x65d7('0x17')],'include':_0xd32f7e[_0x65d7('0x1a')]?_[_0x65d7('0x19')](_0xd32f7e[_0x65d7('0x1a')],function(_0x287628){return{'model':db[_0x287628[_0x65d7('0x1b')]],'as':_0x287628['as'],'attributes':_0x287628[_0x65d7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x65d7('0x20')](function(_0x77008b){logger[_0x65d7('0x10')]('ShowDeskAccount',_0xea09eb);logger['debug'](_0x65d7('0x1e'),_0xea09eb,JSON[_0x65d7('0xc')](_0x77008b));_0x210a2a(_0x77008b);})[_0x65d7('0x12')](function(_0x1c8ec8){logger['error'](_0x65d7('0x1e'),_0x1c8ec8[_0x65d7('0xf')],_0xea09eb);_0x3bd78e(_0x13f334[_0x65d7('0xd')](0x1f4,_0x1c8ec8['message']));});});};
\ No newline at end of file
+var _0x5520=['code','message','result','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','map','model','include','catch','ShowDeskAccount','find','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0xee6366,_0xe36b0a){var _0xe4d7bc=function(_0x1ce306){while(--_0x1ce306){_0xee6366['push'](_0xee6366['shift']());}};_0xe4d7bc(++_0xe36b0a);}(_0x5520,0x120));var _0x0552=function(_0x179320,_0x41f6c9){_0x179320=_0x179320-0x0;var _0x503481=_0x5520[_0x179320];return _0x503481;};'use strict';var _=require(_0x0552('0x0'));var util=require(_0x0552('0x1'));var moment=require(_0x0552('0x2'));var BPromise=require(_0x0552('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0552('0x4'));var logger=require(_0x0552('0x5'))(_0x0552('0x6'));var config=require(_0x0552('0x7'));var jayson=require(_0x0552('0x8'));var client=jayson[_0x0552('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b2250,_0xeb501f,_0x35be0b){return new BPromise(function(_0x31eb26,_0x3f9df8){return client[_0x0552('0xa')](_0x2b2250,_0x35be0b)[_0x0552('0xb')](function(_0x9540f1){logger[_0x0552('0xc')](_0x0552('0xd'),_0xeb501f,_0x0552('0xe'));logger[_0x0552('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xeb501f,_0x0552('0xe'),JSON[_0x0552('0x10')](_0x9540f1));if(_0x9540f1[_0x0552('0x11')]){if(_0x9540f1['error'][_0x0552('0x12')]===0x1f4){logger[_0x0552('0x11')](_0x0552('0xd'),_0xeb501f,_0x9540f1[_0x0552('0x11')][_0x0552('0x13')]);return _0x3f9df8(_0x9540f1[_0x0552('0x11')][_0x0552('0x13')]);}logger[_0x0552('0x11')](_0x0552('0xd'),_0xeb501f,_0x9540f1[_0x0552('0x11')]['message']);return _0x31eb26(_0x9540f1[_0x0552('0x11')][_0x0552('0x13')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0xeb501f,_0x0552('0xe'));_0x31eb26(_0x9540f1[_0x0552('0x14')]['message']);}})['catch'](function(_0x26503a){logger[_0x0552('0x11')](_0x0552('0xd'),_0xeb501f,_0x26503a);_0x3f9df8(_0x26503a);});});}exports[_0x0552('0x15')]=function(_0x2e2fc9){var _0x4f99dc=this;return new Promise(function(_0x4799eb,_0xaa5fc2){return db[_0x0552('0x16')][_0x0552('0x17')]({'raw':_0x2e2fc9[_0x0552('0x18')]?_0x2e2fc9[_0x0552('0x18')][_0x0552('0x19')]===undefined?!![]:![]:!![],'where':_0x2e2fc9[_0x0552('0x18')]?_0x2e2fc9[_0x0552('0x18')][_0x0552('0x1a')]||null:null,'attributes':_0x2e2fc9[_0x0552('0x18')]?_0x2e2fc9[_0x0552('0x18')][_0x0552('0x1b')]||null:null,'limit':_0x2e2fc9[_0x0552('0x18')]?_0x2e2fc9[_0x0552('0x18')]['limit']||null:null,'include':_0x2e2fc9[_0x0552('0x18')]?_0x2e2fc9['options']['include']?_[_0x0552('0x1c')](_0x2e2fc9[_0x0552('0x18')]['include'],function(_0x44280f){return{'model':db[_0x44280f[_0x0552('0x1d')]],'as':_0x44280f['as'],'attributes':_0x44280f[_0x0552('0x1b')],'include':_0x44280f[_0x0552('0x1e')]?_['map'](_0x44280f[_0x0552('0x1e')],function(_0x25321){return{'model':db[_0x25321[_0x0552('0x1d')]],'as':_0x25321['as'],'attributes':_0x25321[_0x0552('0x1b')],'include':_0x25321[_0x0552('0x1e')]?_['map'](_0x25321[_0x0552('0x1e')],function(_0x107e46){return{'model':db[_0x107e46[_0x0552('0x1d')]],'as':_0x107e46['as'],'attributes':_0x107e46['attributes']};}):[]};}):[]};}):[]:[]})[_0x0552('0xb')](function(_0x354e31){logger['info']('GetDeskAccount',_0x2e2fc9);logger[_0x0552('0xf')](_0x0552('0x15'),_0x2e2fc9,JSON['stringify'](_0x354e31));_0x4799eb(_0x354e31);})[_0x0552('0x1f')](function(_0x44a1fb){logger[_0x0552('0x11')](_0x0552('0x15'),_0x44a1fb[_0x0552('0x13')],_0x2e2fc9);_0xaa5fc2(_0x4f99dc['error'](0x1f4,_0x44a1fb[_0x0552('0x13')]));});});};exports[_0x0552('0x20')]=function(_0x5d0f5d){var _0x1b2b61=this;return new Promise(function(_0x1d6667,_0x38f15e){return db[_0x0552('0x16')][_0x0552('0x21')]({'raw':_0x5d0f5d['options']?_0x5d0f5d[_0x0552('0x18')][_0x0552('0x19')]===undefined?!![]:![]:!![],'where':_0x5d0f5d[_0x0552('0x18')]?_0x5d0f5d[_0x0552('0x18')][_0x0552('0x1a')]||null:null,'attributes':_0x5d0f5d[_0x0552('0x18')]?_0x5d0f5d[_0x0552('0x18')]['attributes']||null:null,'include':_0x5d0f5d['options']?_0x5d0f5d[_0x0552('0x18')][_0x0552('0x1e')]?_[_0x0552('0x1c')](_0x5d0f5d[_0x0552('0x18')][_0x0552('0x1e')],function(_0x3f263a){return{'model':db[_0x3f263a[_0x0552('0x1d')]],'as':_0x3f263a['as'],'attributes':_0x3f263a[_0x0552('0x1b')],'include':_0x3f263a['include']?_[_0x0552('0x1c')](_0x3f263a[_0x0552('0x1e')],function(_0x4c3669){return{'model':db[_0x4c3669[_0x0552('0x1d')]],'as':_0x4c3669['as'],'attributes':_0x4c3669[_0x0552('0x1b')],'include':_0x4c3669[_0x0552('0x1e')]?_[_0x0552('0x1c')](_0x4c3669['include'],function(_0x5e422a){return{'model':db[_0x5e422a['model']],'as':_0x5e422a['as'],'attributes':_0x5e422a[_0x0552('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0552('0xb')](function(_0x57121c){logger[_0x0552('0xc')](_0x0552('0x20'),_0x5d0f5d);logger['debug'](_0x0552('0x20'),_0x5d0f5d,JSON[_0x0552('0x10')](_0x57121c));_0x1d6667(_0x57121c);})[_0x0552('0x1f')](function(_0x116531){logger['error'](_0x0552('0x20'),_0x116531['message'],_0x5d0f5d);_0x38f15e(_0x1b2b61[_0x0552('0x11')](0x1f4,_0x116531[_0x0552('0x13')]));});});};
\ No newline at end of file
index 763786f..0b67fa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x3e6912,_0x2184dc){var _0x2837fe=function(_0x47915d){while(--_0x47915d){_0x3e6912['push'](_0x3e6912['shift']());}};_0x2837fe(++_0x2184dc);}(_0x3e74,0x175));var _0x43e7=function(_0x5c7503,_0x98ab83){_0x5c7503=_0x5c7503-0x0;var _0x51b8ae=_0x3e74[_0x5c7503];return _0x51b8ae;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router;
\ No newline at end of file
+var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xd9ad7b,_0x201b1d){var _0x44362b=function(_0x3394b5){while(--_0x3394b5){_0xd9ad7b['push'](_0xd9ad7b['shift']());}};_0x44362b(++_0x201b1d);}(_0x34e8,0x12c));var _0x834e=function(_0x2d2199,_0x3ab4a6){_0x2d2199=_0x2d2199-0x0;var _0x44e9ef=_0x34e8[_0x2d2199];return _0x44e9ef;};'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('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router;
\ No newline at end of file
index 17a3b91..7cdbe58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35ee=['exports','STRING','sequelize'];(function(_0x26d016,_0x36bcf7){var _0x475388=function(_0xb2b7ac){while(--_0xb2b7ac){_0x26d016['push'](_0x26d016['shift']());}};_0x475388(++_0x36bcf7);}(_0x35ee,0x1b2));var _0xe35e=function(_0x3b6f07,_0x472dd8){_0x3b6f07=_0x3b6f07-0x0;var _0x41ded2=_0x35ee[_0x3b6f07];return _0x41ded2;};'use strict';var Sequelize=require(_0xe35e('0x0'));module[_0xe35e('0x1')]={'name':{'type':Sequelize[_0xe35e('0x2')]},'description':{'type':Sequelize[_0xe35e('0x2')]}};
\ No newline at end of file
+var _0x2f2e=['sequelize','exports','STRING'];(function(_0x534b9e,_0x1012e4){var _0x185a48=function(_0x32e8d9){while(--_0x32e8d9){_0x534b9e['push'](_0x534b9e['shift']());}};_0x185a48(++_0x1012e4);}(_0x2f2e,0x12c));var _0xe2f2=function(_0x15b192,_0x38c235){_0x15b192=_0x15b192-0x0;var _0x396e73=_0x2f2e[_0x15b192];return _0x396e73;};'use strict';var Sequelize=require(_0xe2f2('0x0'));module[_0xe2f2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe2f2('0x2')]}};
\ No newline at end of file
index c7f57a6..4fc8dab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaa0=['merge','type','DeskConfiguration','includeAll','include','findAll','rows','catch','show','find','create','body','params','DeskField','pick','options','nolimit','getFields','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter'];(function(_0x111e94,_0x31c837){var _0x3de107=function(_0x65bd1e){while(--_0x65bd1e){_0x111e94['push'](_0x111e94['shift']());}};_0x3de107(++_0x31c837);}(_0xfaa0,0x6d));var _0x0faa=function(_0x4ab896,_0x4e9e78){_0x4ab896=_0x4ab896-0x0;var _0x46d31c=_0xfaa0[_0x4ab896];return _0x46d31c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0faa('0x0'));var zipdir=require(_0x0faa('0x1'));var jsonpatch=require(_0x0faa('0x2'));var rp=require('request-promise');var moment=require(_0x0faa('0x3'));var BPromise=require(_0x0faa('0x4'));var Mustache=require('mustache');var util=require(_0x0faa('0x5'));var path=require(_0x0faa('0x6'));var sox=require(_0x0faa('0x7'));var csv=require(_0x0faa('0x8'));var ejs=require(_0x0faa('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0faa('0xa'));var squel=require(_0x0faa('0xb'));var crypto=require(_0x0faa('0xc'));var jsforce=require(_0x0faa('0xd'));var deskjs=require(_0x0faa('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0faa('0xf'));var Papa=require(_0x0faa('0x10'));var Redis=require('ioredis');var authService=require(_0x0faa('0x11'));var qs=require(_0x0faa('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0faa('0x13'))(_0x0faa('0x14'));var utils=require(_0x0faa('0x15'));var config=require(_0x0faa('0x16'));var licenseUtil=require(_0x0faa('0x17'));var db=require(_0x0faa('0x18'))['db'];function respondWithStatusCode(_0x2b1257,_0x25be7d){_0x25be7d=_0x25be7d||0xcc;return function(_0x144878){if(_0x144878){return _0x2b1257[_0x0faa('0x19')](_0x25be7d);}return _0x2b1257[_0x0faa('0x1a')](_0x25be7d)[_0x0faa('0x1b')]();};}function respondWithResult(_0x38f8f6,_0xb1f2f4){_0xb1f2f4=_0xb1f2f4||0xc8;return function(_0x1df94a){if(_0x1df94a){return _0x38f8f6[_0x0faa('0x1a')](_0xb1f2f4)[_0x0faa('0x1c')](_0x1df94a);}};}function respondWithFilteredResult(_0x30add5,_0x28d312){return function(_0xad893c){if(_0xad893c){var _0x3e3b61=typeof _0x28d312[_0x0faa('0x1d')]===_0x0faa('0x1e')&&typeof _0x28d312[_0x0faa('0x1f')]==='undefined';var _0x5b02c2=_0xad893c['count'];var _0x4872f6=_0x3e3b61?0x0:_0x28d312[_0x0faa('0x1d')];var _0x4ec497=_0x3e3b61?_0xad893c[_0x0faa('0x20')]:_0x28d312[_0x0faa('0x1d')]+_0x28d312['limit'];var _0x10fe45;if(_0x4ec497>=_0x5b02c2){_0x4ec497=_0x5b02c2;_0x10fe45=0xc8;}else{_0x10fe45=0xce;}_0x30add5[_0x0faa('0x1a')](_0x10fe45);return _0x30add5[_0x0faa('0x21')](_0x0faa('0x22'),_0x4872f6+'-'+_0x4ec497+'/'+_0x5b02c2)[_0x0faa('0x1c')](_0xad893c);}return null;};}function patchUpdates(_0x26e7db){return function(_0x424fe7){try{jsonpatch[_0x0faa('0x23')](_0x424fe7,_0x26e7db,!![]);}catch(_0x525f91){return BPromise[_0x0faa('0x24')](_0x525f91);}return _0x424fe7['save']();};}function saveUpdates(_0x374a39,_0x29e6a1){return function(_0xd8c9fb){if(_0xd8c9fb){return _0xd8c9fb[_0x0faa('0x25')](_0x374a39)[_0x0faa('0x26')](function(_0x3dd2ba){return _0x3dd2ba;});}return null;};}function removeEntity(_0xa9d3d9,_0x53d8a3){return function(_0x446c9a){if(_0x446c9a){return _0x446c9a[_0x0faa('0x27')]()[_0x0faa('0x26')](function(){_0xa9d3d9['status'](0xcc)[_0x0faa('0x1b')]();});}};}function handleEntityNotFound(_0x3daec9,_0x297d8a){return function(_0x1efc8b){if(!_0x1efc8b){_0x3daec9[_0x0faa('0x19')](0x194);}return _0x1efc8b;};}function handleError(_0x33e926,_0x272c4c){_0x272c4c=_0x272c4c||0x1f4;return function(_0x8d1c3d){logger[_0x0faa('0x28')](_0x8d1c3d[_0x0faa('0x29')]);if(_0x8d1c3d[_0x0faa('0x2a')]){delete _0x8d1c3d['name'];}_0x33e926[_0x0faa('0x1a')](_0x272c4c)[_0x0faa('0x2b')](_0x8d1c3d);};}exports[_0x0faa('0x2c')]=function(_0x2e7473,_0x14ebbe){var _0x5010e6={},_0x5285b9={},_0x379796={'count':0x0,'rows':[]};var _0x2184a6=_[_0x0faa('0x2d')](db['DeskConfiguration'][_0x0faa('0x2e')],function(_0x2db587){return{'name':_0x2db587[_0x0faa('0x2f')],'type':_0x2db587['type']['key']};});_0x5285b9[_0x0faa('0x30')]=_[_0x0faa('0x2d')](_0x2184a6,_0x0faa('0x2a'));_0x5285b9[_0x0faa('0x31')]=_[_0x0faa('0x32')](_0x2e7473[_0x0faa('0x31')]);_0x5285b9['filters']=_[_0x0faa('0x33')](_0x5285b9['model'],_0x5285b9[_0x0faa('0x31')]);_0x5010e6['attributes']=_[_0x0faa('0x33')](_0x5285b9[_0x0faa('0x30')],qs[_0x0faa('0x34')](_0x2e7473[_0x0faa('0x31')][_0x0faa('0x34')]));_0x5010e6[_0x0faa('0x35')]=_0x5010e6[_0x0faa('0x35')][_0x0faa('0x36')]?_0x5010e6['attributes']:_0x5285b9['model'];if(!_0x2e7473['query'][_0x0faa('0x37')]('nolimit')){_0x5010e6[_0x0faa('0x1f')]=qs[_0x0faa('0x1f')](_0x2e7473['query'][_0x0faa('0x1f')]);_0x5010e6['offset']=qs[_0x0faa('0x1d')](_0x2e7473[_0x0faa('0x31')][_0x0faa('0x1d')]);}_0x5010e6[_0x0faa('0x38')]=qs['sort'](_0x2e7473['query'][_0x0faa('0x39')]);_0x5010e6[_0x0faa('0x3a')]=qs[_0x0faa('0x3b')](_['pick'](_0x2e7473[_0x0faa('0x31')],_0x5285b9[_0x0faa('0x3b')]),_0x2184a6);if(_0x2e7473[_0x0faa('0x31')][_0x0faa('0x3c')]){_0x5010e6[_0x0faa('0x3a')]=_[_0x0faa('0x3d')](_0x5010e6[_0x0faa('0x3a')],{'$or':_['map'](_0x2184a6,function(_0x4bf3db){if(_0x4bf3db[_0x0faa('0x3e')]!=='VIRTUAL'){var _0x18563c={};_0x18563c[_0x4bf3db[_0x0faa('0x2a')]]={'$like':'%'+_0x2e7473[_0x0faa('0x31')]['filter']+'%'};return _0x18563c;}})});}_0x5010e6=_['merge']({},_0x5010e6,_0x2e7473['options']);var _0x508046={'where':_0x5010e6[_0x0faa('0x3a')]};return db[_0x0faa('0x3f')][_0x0faa('0x20')](_0x508046)[_0x0faa('0x26')](function(_0x2397ab){_0x379796['count']=_0x2397ab;if(_0x2e7473[_0x0faa('0x31')][_0x0faa('0x40')]){_0x5010e6[_0x0faa('0x41')]=[{'all':!![]}];}return db[_0x0faa('0x3f')][_0x0faa('0x42')](_0x5010e6);})[_0x0faa('0x26')](function(_0x4c8b24){_0x379796[_0x0faa('0x43')]=_0x4c8b24;return _0x379796;})[_0x0faa('0x26')](respondWithFilteredResult(_0x14ebbe,_0x5010e6))[_0x0faa('0x44')](handleError(_0x14ebbe,null));};exports[_0x0faa('0x45')]=function(_0xfd4cc2,_0x2879c3){var _0x17b1ea={'raw':![],'where':{'id':_0xfd4cc2['params']['id']}},_0x4637ae={};_0x4637ae[_0x0faa('0x30')]=_['keys'](db[_0x0faa('0x3f')][_0x0faa('0x2e')]);_0x4637ae[_0x0faa('0x31')]=_[_0x0faa('0x32')](_0xfd4cc2[_0x0faa('0x31')]);_0x4637ae[_0x0faa('0x3b')]=_[_0x0faa('0x33')](_0x4637ae[_0x0faa('0x30')],_0x4637ae[_0x0faa('0x31')]);_0x17b1ea[_0x0faa('0x35')]=_[_0x0faa('0x33')](_0x4637ae[_0x0faa('0x30')],qs[_0x0faa('0x34')](_0xfd4cc2[_0x0faa('0x31')][_0x0faa('0x34')]));_0x17b1ea['attributes']=_0x17b1ea['attributes'][_0x0faa('0x36')]?_0x17b1ea[_0x0faa('0x35')]:_0x4637ae[_0x0faa('0x30')];if(_0xfd4cc2[_0x0faa('0x31')]['includeAll']){_0x17b1ea['include']=[{'all':!![]}];}_0x17b1ea=_[_0x0faa('0x3d')]({},_0x17b1ea,_0xfd4cc2['options']);return db[_0x0faa('0x3f')][_0x0faa('0x46')](_0x17b1ea)[_0x0faa('0x26')](handleEntityNotFound(_0x2879c3,null))[_0x0faa('0x26')](respondWithResult(_0x2879c3,null))['catch'](handleError(_0x2879c3,null));};exports[_0x0faa('0x47')]=function(_0x4ec805,_0x35be88){return db[_0x0faa('0x3f')][_0x0faa('0x47')](_0x4ec805[_0x0faa('0x48')],{})[_0x0faa('0x26')](respondWithResult(_0x35be88,0xc9))[_0x0faa('0x44')](handleError(_0x35be88,null));};exports['update']=function(_0xe4dda6,_0x2c2e40){if(_0xe4dda6[_0x0faa('0x48')]['id']){delete _0xe4dda6[_0x0faa('0x48')]['id'];}return db[_0x0faa('0x3f')]['find']({'where':{'id':_0xe4dda6[_0x0faa('0x49')]['id']}})[_0x0faa('0x26')](handleEntityNotFound(_0x2c2e40,null))[_0x0faa('0x26')](saveUpdates(_0xe4dda6['body'],null))[_0x0faa('0x26')](respondWithResult(_0x2c2e40,null))[_0x0faa('0x44')](handleError(_0x2c2e40,null));};exports[_0x0faa('0x27')]=function(_0x45a824,_0x3da39a){return db['DeskConfiguration']['find']({'where':{'id':_0x45a824[_0x0faa('0x49')]['id']}})[_0x0faa('0x26')](handleEntityNotFound(_0x3da39a,null))[_0x0faa('0x26')](removeEntity(_0x3da39a,null))[_0x0faa('0x44')](handleError(_0x3da39a,null));};exports['getFields']=function(_0x53cd95,_0x3ee595,_0x36d49f){var _0x1e1709={};var _0xcd9d59={};var _0x24ba02;var _0x2f3858;return db['DeskConfiguration']['findOne']({'where':{'id':_0x53cd95[_0x0faa('0x49')]['id']}})[_0x0faa('0x26')](handleEntityNotFound(_0x3ee595,null))[_0x0faa('0x26')](function(_0x3ba197){if(_0x3ba197){_0x24ba02=_0x3ba197;_0xcd9d59['model']=_[_0x0faa('0x32')](db[_0x0faa('0x4a')][_0x0faa('0x2e')]);_0xcd9d59['query']=_[_0x0faa('0x32')](_0x53cd95[_0x0faa('0x31')]);_0xcd9d59[_0x0faa('0x3b')]=_[_0x0faa('0x33')](_0xcd9d59['model'],_0xcd9d59[_0x0faa('0x31')]);_0x1e1709['attributes']=_['intersection'](_0xcd9d59[_0x0faa('0x30')],qs[_0x0faa('0x34')](_0x53cd95[_0x0faa('0x31')]['fields']));_0x1e1709['attributes']=_0x1e1709['attributes'][_0x0faa('0x36')]?_0x1e1709['attributes']:_0xcd9d59[_0x0faa('0x30')];_0x1e1709['order']=qs[_0x0faa('0x39')](_0x53cd95['query'][_0x0faa('0x39')]);_0x1e1709[_0x0faa('0x3a')]=qs[_0x0faa('0x3b')](_[_0x0faa('0x4b')](_0x53cd95[_0x0faa('0x31')],_0xcd9d59[_0x0faa('0x3b')]));if(_0x53cd95[_0x0faa('0x31')][_0x0faa('0x3c')]){_0x1e1709[_0x0faa('0x3a')]=_['merge'](_0x1e1709['where'],{'$or':_[_0x0faa('0x2d')](_0x1e1709[_0x0faa('0x35')],function(_0x39495a){var _0xd8cfe0={};_0xd8cfe0[_0x39495a]={'$like':'%'+_0x53cd95[_0x0faa('0x31')]['filter']+'%'};return _0xd8cfe0;})});}_0x1e1709=_['merge']({},_0x1e1709,_0x53cd95[_0x0faa('0x4c')]);return _0x24ba02['getFields'](_0x1e1709);}})[_0x0faa('0x26')](function(_0x6657f7){if(_0x6657f7){_0x2f3858=_0x6657f7['length'];if(!_0x53cd95['query'][_0x0faa('0x37')](_0x0faa('0x4d'))){_0x1e1709[_0x0faa('0x1f')]=qs['limit'](_0x53cd95['query'][_0x0faa('0x1f')]);_0x1e1709[_0x0faa('0x1d')]=qs['offset'](_0x53cd95['query'][_0x0faa('0x1d')]);}return _0x24ba02[_0x0faa('0x4e')](_0x1e1709);}})['then'](function(_0x3f4a97){if(_0x3f4a97){return _0x3f4a97?{'count':_0x2f3858,'rows':_0x3f4a97}:null;}})['then'](respondWithResult(_0x3ee595,null))[_0x0faa('0x44')](handleError(_0x3ee595,null));};exports[_0x0faa('0x4f')]=function(_0x299ca3,_0x251c77,_0xd6508c){var _0x5509e1={};var _0x5f2b3e={};var _0x51a09b;var _0x447e8e;return db[_0x0faa('0x3f')][_0x0faa('0x50')]({'where':{'id':_0x299ca3[_0x0faa('0x49')]['id']}})[_0x0faa('0x26')](handleEntityNotFound(_0x251c77,null))[_0x0faa('0x26')](function(_0x32ffd4){if(_0x32ffd4){_0x51a09b=_0x32ffd4;_0x5f2b3e['model']=_[_0x0faa('0x32')](db[_0x0faa('0x4a')][_0x0faa('0x2e')]);_0x5f2b3e[_0x0faa('0x31')]=_['keys'](_0x299ca3[_0x0faa('0x31')]);_0x5f2b3e[_0x0faa('0x3b')]=_[_0x0faa('0x33')](_0x5f2b3e[_0x0faa('0x30')],_0x5f2b3e[_0x0faa('0x31')]);_0x5509e1[_0x0faa('0x35')]=_[_0x0faa('0x33')](_0x5f2b3e[_0x0faa('0x30')],qs[_0x0faa('0x34')](_0x299ca3['query'][_0x0faa('0x34')]));_0x5509e1[_0x0faa('0x35')]=_0x5509e1[_0x0faa('0x35')]['length']?_0x5509e1[_0x0faa('0x35')]:_0x5f2b3e['model'];_0x5509e1[_0x0faa('0x38')]=qs[_0x0faa('0x39')](_0x299ca3[_0x0faa('0x31')][_0x0faa('0x39')]);_0x5509e1[_0x0faa('0x3a')]=qs[_0x0faa('0x3b')](_[_0x0faa('0x4b')](_0x299ca3['query'],_0x5f2b3e[_0x0faa('0x3b')]));if(_0x299ca3[_0x0faa('0x31')]['filter']){_0x5509e1[_0x0faa('0x3a')]=_[_0x0faa('0x3d')](_0x5509e1['where'],{'$or':_[_0x0faa('0x2d')](_0x5509e1[_0x0faa('0x35')],function(_0x43f1dc){var _0x18eee1={};_0x18eee1[_0x43f1dc]={'$like':'%'+_0x299ca3['query'][_0x0faa('0x3c')]+'%'};return _0x18eee1;})});}_0x5509e1=_[_0x0faa('0x3d')]({},_0x5509e1,_0x299ca3['options']);return _0x51a09b[_0x0faa('0x4f')](_0x5509e1);}})[_0x0faa('0x26')](function(_0x4e2164){if(_0x4e2164){_0x447e8e=_0x4e2164['length'];if(!_0x299ca3[_0x0faa('0x31')][_0x0faa('0x37')](_0x0faa('0x4d'))){_0x5509e1[_0x0faa('0x1f')]=qs[_0x0faa('0x1f')](_0x299ca3[_0x0faa('0x31')][_0x0faa('0x1f')]);_0x5509e1[_0x0faa('0x1d')]=qs['offset'](_0x299ca3['query'][_0x0faa('0x1d')]);}return _0x51a09b['getSubjects'](_0x5509e1);}})[_0x0faa('0x26')](function(_0x3c9cd0){if(_0x3c9cd0){return _0x3c9cd0?{'count':_0x447e8e,'rows':_0x3c9cd0}:null;}})[_0x0faa('0x26')](respondWithResult(_0x251c77,null))['catch'](handleError(_0x251c77,null));};exports[_0x0faa('0x51')]=function(_0x261546,_0x534adc,_0x556455){var _0x497df4={};var _0x3ecd55={};var _0x553ea6;var _0x516f90;return db[_0x0faa('0x3f')]['findOne']({'where':{'id':_0x261546['params']['id']}})[_0x0faa('0x26')](handleEntityNotFound(_0x534adc,null))[_0x0faa('0x26')](function(_0x49a685){if(_0x49a685){_0x553ea6=_0x49a685;_0x3ecd55[_0x0faa('0x30')]=_[_0x0faa('0x32')](db[_0x0faa('0x4a')]['rawAttributes']);_0x3ecd55[_0x0faa('0x31')]=_[_0x0faa('0x32')](_0x261546['query']);_0x3ecd55[_0x0faa('0x3b')]=_[_0x0faa('0x33')](_0x3ecd55[_0x0faa('0x30')],_0x3ecd55[_0x0faa('0x31')]);_0x497df4['attributes']=_[_0x0faa('0x33')](_0x3ecd55['model'],qs['fields'](_0x261546[_0x0faa('0x31')][_0x0faa('0x34')]));_0x497df4[_0x0faa('0x35')]=_0x497df4[_0x0faa('0x35')][_0x0faa('0x36')]?_0x497df4[_0x0faa('0x35')]:_0x3ecd55['model'];_0x497df4['order']=qs[_0x0faa('0x39')](_0x261546['query']['sort']);_0x497df4[_0x0faa('0x3a')]=qs[_0x0faa('0x3b')](_[_0x0faa('0x4b')](_0x261546['query'],_0x3ecd55[_0x0faa('0x3b')]));if(_0x261546['query'][_0x0faa('0x3c')]){_0x497df4['where']=_['merge'](_0x497df4[_0x0faa('0x3a')],{'$or':_[_0x0faa('0x2d')](_0x497df4[_0x0faa('0x35')],function(_0x998a34){var _0x551a64={};_0x551a64[_0x998a34]={'$like':'%'+_0x261546[_0x0faa('0x31')][_0x0faa('0x3c')]+'%'};return _0x551a64;})});}_0x497df4=_[_0x0faa('0x3d')]({},_0x497df4,_0x261546['options']);return _0x553ea6[_0x0faa('0x51')](_0x497df4);}})[_0x0faa('0x26')](function(_0x2f73a4){if(_0x2f73a4){_0x516f90=_0x2f73a4[_0x0faa('0x36')];if(!_0x261546[_0x0faa('0x31')][_0x0faa('0x37')](_0x0faa('0x4d'))){_0x497df4['limit']=qs[_0x0faa('0x1f')](_0x261546[_0x0faa('0x31')]['limit']);_0x497df4[_0x0faa('0x1d')]=qs['offset'](_0x261546[_0x0faa('0x31')][_0x0faa('0x1d')]);}return _0x553ea6['getDescriptions'](_0x497df4);}})['then'](function(_0x29441b){if(_0x29441b){return _0x29441b?{'count':_0x516f90,'rows':_0x29441b}:null;}})['then'](respondWithResult(_0x534adc,null))['catch'](handleError(_0x534adc,null));};exports['getTags']=function(_0x3c1820,_0x32cc52,_0x1f55a1){var _0x33e528={};var _0x4e5fb0={};var _0x4d6358;var _0x20c93e;return db[_0x0faa('0x3f')][_0x0faa('0x50')]({'where':{'id':_0x3c1820[_0x0faa('0x49')]['id']}})['then'](handleEntityNotFound(_0x32cc52,null))[_0x0faa('0x26')](function(_0x5e7e45){if(_0x5e7e45){_0x4d6358=_0x5e7e45;_0x4e5fb0['model']=_[_0x0faa('0x32')](db[_0x0faa('0x52')][_0x0faa('0x2e')]);_0x4e5fb0[_0x0faa('0x31')]=_['keys'](_0x3c1820['query']);_0x4e5fb0[_0x0faa('0x3b')]=_['intersection'](_0x4e5fb0[_0x0faa('0x30')],_0x4e5fb0[_0x0faa('0x31')]);_0x33e528[_0x0faa('0x35')]=_[_0x0faa('0x33')](_0x4e5fb0[_0x0faa('0x30')],qs[_0x0faa('0x34')](_0x3c1820[_0x0faa('0x31')][_0x0faa('0x34')]));_0x33e528[_0x0faa('0x35')]=_0x33e528['attributes'][_0x0faa('0x36')]?_0x33e528[_0x0faa('0x35')]:_0x4e5fb0['model'];_0x33e528[_0x0faa('0x38')]=qs[_0x0faa('0x39')](_0x3c1820[_0x0faa('0x31')][_0x0faa('0x39')]);_0x33e528['where']=qs['filters'](_[_0x0faa('0x4b')](_0x3c1820[_0x0faa('0x31')],_0x4e5fb0[_0x0faa('0x3b')]));if(_0x3c1820[_0x0faa('0x31')][_0x0faa('0x3c')]){_0x33e528[_0x0faa('0x3a')]=_[_0x0faa('0x3d')](_0x33e528[_0x0faa('0x3a')],{'$or':_[_0x0faa('0x2d')](_0x33e528['attributes'],function(_0x565c3a){var _0x11c199={};_0x11c199[_0x565c3a]={'$like':'%'+_0x3c1820[_0x0faa('0x31')][_0x0faa('0x3c')]+'%'};return _0x11c199;})});}_0x33e528=_[_0x0faa('0x3d')]({},_0x33e528,_0x3c1820[_0x0faa('0x4c')]);return _0x4d6358[_0x0faa('0x53')](_0x33e528);}})[_0x0faa('0x26')](function(_0x42104c){if(_0x42104c){_0x20c93e=_0x42104c[_0x0faa('0x36')];if(!_0x3c1820['query'][_0x0faa('0x37')](_0x0faa('0x4d'))){_0x33e528[_0x0faa('0x1f')]=qs['limit'](_0x3c1820[_0x0faa('0x31')][_0x0faa('0x1f')]);_0x33e528[_0x0faa('0x1d')]=qs[_0x0faa('0x1d')](_0x3c1820[_0x0faa('0x31')][_0x0faa('0x1d')]);}return _0x4d6358['getTags'](_0x33e528);}})['then'](function(_0x322116){if(_0x322116){return _0x322116?{'count':_0x20c93e,'rows':_0x322116}:null;}})[_0x0faa('0x26')](respondWithResult(_0x32cc52,null))['catch'](handleError(_0x32cc52,null));};exports[_0x0faa('0x54')]=function(_0x56bc92,_0x35800f,_0x33222b){if(_0x56bc92['body']['id']){delete _0x56bc92[_0x0faa('0x48')]['id'];}return db[_0x0faa('0x3f')][_0x0faa('0x50')]({'where':{'id':_0x56bc92[_0x0faa('0x49')]['id']}})[_0x0faa('0x26')](handleEntityNotFound(_0x35800f,null))[_0x0faa('0x26')](function(_0x8463e1){if(_0x8463e1){return _0x8463e1['setTags'](_0x56bc92[_0x0faa('0x48')]['ids']||[]);}return null;})['then'](respondWithResult(_0x35800f,null))['catch'](handleError(_0x35800f,null));};
\ No newline at end of file
+var _0x316e=['findOne','DeskField','filter','nolimit','getSubjects','pick','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','error','name','index','DeskConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','merge','map','VIRTUAL','catch','show','params','includeAll','include','options','find','create','body','destroy','getFields'];(function(_0x5bf040,_0xaa20d0){var _0x59342f=function(_0x1db0e4){while(--_0x1db0e4){_0x5bf040['push'](_0x5bf040['shift']());}};_0x59342f(++_0xaa20d0);}(_0x316e,0x1a4));var _0xe316=function(_0x19e4ce,_0x1a8a80){_0x19e4ce=_0x19e4ce-0x0;var _0x1c9c08=_0x316e[_0x19e4ce];return _0x1c9c08;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe316('0x0'));var zipdir=require(_0xe316('0x1'));var jsonpatch=require(_0xe316('0x2'));var rp=require(_0xe316('0x3'));var moment=require(_0xe316('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe316('0x5'));var path=require(_0xe316('0x6'));var sox=require(_0xe316('0x7'));var csv=require(_0xe316('0x8'));var ejs=require(_0xe316('0x9'));var fs=require('fs');var fs_extra=require(_0xe316('0xa'));var _=require(_0xe316('0xb'));var squel=require(_0xe316('0xc'));var crypto=require(_0xe316('0xd'));var jsforce=require(_0xe316('0xe'));var deskjs=require(_0xe316('0xf'));var toCsv=require(_0xe316('0x8'));var querystring=require(_0xe316('0x10'));var Papa=require(_0xe316('0x11'));var Redis=require(_0xe316('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe316('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe316('0x14'));var logger=require(_0xe316('0x15'))(_0xe316('0x16'));var utils=require('../../config/utils');var config=require(_0xe316('0x17'));var licenseUtil=require(_0xe316('0x18'));var db=require(_0xe316('0x19'))['db'];function respondWithStatusCode(_0x35f948,_0x157df7){_0x157df7=_0x157df7||0xcc;return function(_0x3733c6){if(_0x3733c6){return _0x35f948[_0xe316('0x1a')](_0x157df7);}return _0x35f948[_0xe316('0x1b')](_0x157df7)[_0xe316('0x1c')]();};}function respondWithResult(_0x2f105c,_0x539642){_0x539642=_0x539642||0xc8;return function(_0x54ea7c){if(_0x54ea7c){return _0x2f105c[_0xe316('0x1b')](_0x539642)[_0xe316('0x1d')](_0x54ea7c);}};}function respondWithFilteredResult(_0x374a23,_0x1bbc34){return function(_0x32828f){if(_0x32828f){var _0x66fc86=typeof _0x1bbc34[_0xe316('0x1e')]==='undefined'&&typeof _0x1bbc34[_0xe316('0x1f')]===_0xe316('0x20');var _0x429929=_0x32828f[_0xe316('0x21')];var _0x3d006c=_0x66fc86?0x0:_0x1bbc34[_0xe316('0x1e')];var _0x54ab9e=_0x66fc86?_0x32828f[_0xe316('0x21')]:_0x1bbc34[_0xe316('0x1e')]+_0x1bbc34[_0xe316('0x1f')];var _0x30a327;if(_0x54ab9e>=_0x429929){_0x54ab9e=_0x429929;_0x30a327=0xc8;}else{_0x30a327=0xce;}_0x374a23[_0xe316('0x1b')](_0x30a327);return _0x374a23['set'](_0xe316('0x22'),_0x3d006c+'-'+_0x54ab9e+'/'+_0x429929)[_0xe316('0x1d')](_0x32828f);}return null;};}function patchUpdates(_0x277d80){return function(_0x2d0d64){try{jsonpatch[_0xe316('0x23')](_0x2d0d64,_0x277d80,!![]);}catch(_0x181213){return BPromise[_0xe316('0x24')](_0x181213);}return _0x2d0d64['save']();};}function saveUpdates(_0x4af416,_0x752678){return function(_0x24ae57){if(_0x24ae57){return _0x24ae57[_0xe316('0x25')](_0x4af416)[_0xe316('0x26')](function(_0x81ee49){return _0x81ee49;});}return null;};}function removeEntity(_0x5c6826,_0x442675){return function(_0x5e567e){if(_0x5e567e){return _0x5e567e['destroy']()['then'](function(){_0x5c6826[_0xe316('0x1b')](0xcc)[_0xe316('0x1c')]();});}};}function handleEntityNotFound(_0x3b94f0,_0x26e981){return function(_0x486ce5){if(!_0x486ce5){_0x3b94f0[_0xe316('0x1a')](0x194);}return _0x486ce5;};}function handleError(_0x25f8b4,_0x75a74){_0x75a74=_0x75a74||0x1f4;return function(_0x36e9b0){logger[_0xe316('0x27')](_0x36e9b0['stack']);if(_0x36e9b0[_0xe316('0x28')]){delete _0x36e9b0[_0xe316('0x28')];}_0x25f8b4[_0xe316('0x1b')](_0x75a74)['send'](_0x36e9b0);};}exports[_0xe316('0x29')]=function(_0x4c8d11,_0x4f9866){var _0x4e4153={},_0x2e85ef={},_0x3f2589={'count':0x0,'rows':[]};var _0x46be1c=_['map'](db[_0xe316('0x2a')][_0xe316('0x2b')],function(_0x529956){return{'name':_0x529956[_0xe316('0x2c')],'type':_0x529956[_0xe316('0x2d')]['key']};});_0x2e85ef[_0xe316('0x2e')]=_['map'](_0x46be1c,_0xe316('0x28'));_0x2e85ef[_0xe316('0x2f')]=_[_0xe316('0x30')](_0x4c8d11['query']);_0x2e85ef['filters']=_[_0xe316('0x31')](_0x2e85ef[_0xe316('0x2e')],_0x2e85ef[_0xe316('0x2f')]);_0x4e4153[_0xe316('0x32')]=_['intersection'](_0x2e85ef[_0xe316('0x2e')],qs[_0xe316('0x33')](_0x4c8d11[_0xe316('0x2f')][_0xe316('0x33')]));_0x4e4153[_0xe316('0x32')]=_0x4e4153[_0xe316('0x32')][_0xe316('0x34')]?_0x4e4153[_0xe316('0x32')]:_0x2e85ef['model'];if(!_0x4c8d11['query'][_0xe316('0x35')]('nolimit')){_0x4e4153['limit']=qs['limit'](_0x4c8d11['query'][_0xe316('0x1f')]);_0x4e4153[_0xe316('0x1e')]=qs['offset'](_0x4c8d11[_0xe316('0x2f')][_0xe316('0x1e')]);}_0x4e4153[_0xe316('0x36')]=qs[_0xe316('0x37')](_0x4c8d11[_0xe316('0x2f')][_0xe316('0x37')]);_0x4e4153[_0xe316('0x38')]=qs[_0xe316('0x39')](_['pick'](_0x4c8d11['query'],_0x2e85ef[_0xe316('0x39')]),_0x46be1c);if(_0x4c8d11[_0xe316('0x2f')]['filter']){_0x4e4153[_0xe316('0x38')]=_[_0xe316('0x3a')](_0x4e4153[_0xe316('0x38')],{'$or':_[_0xe316('0x3b')](_0x46be1c,function(_0x2dc953){if(_0x2dc953[_0xe316('0x2d')]!==_0xe316('0x3c')){var _0x109203={};_0x109203[_0x2dc953[_0xe316('0x28')]]={'$like':'%'+_0x4c8d11[_0xe316('0x2f')]['filter']+'%'};return _0x109203;}})});}_0x4e4153=_[_0xe316('0x3a')]({},_0x4e4153,_0x4c8d11['options']);var _0x50c8d3={'where':_0x4e4153[_0xe316('0x38')]};return db[_0xe316('0x2a')][_0xe316('0x21')](_0x50c8d3)[_0xe316('0x26')](function(_0x420ab5){_0x3f2589[_0xe316('0x21')]=_0x420ab5;if(_0x4c8d11[_0xe316('0x2f')]['includeAll']){_0x4e4153['include']=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x4e4153);})[_0xe316('0x26')](function(_0x43c420){_0x3f2589['rows']=_0x43c420;return _0x3f2589;})['then'](respondWithFilteredResult(_0x4f9866,_0x4e4153))[_0xe316('0x3d')](handleError(_0x4f9866,null));};exports[_0xe316('0x3e')]=function(_0x5ae432,_0x439412){var _0x9473b={'raw':![],'where':{'id':_0x5ae432[_0xe316('0x3f')]['id']}},_0x27892e={};_0x27892e['model']=_[_0xe316('0x30')](db[_0xe316('0x2a')]['rawAttributes']);_0x27892e[_0xe316('0x2f')]=_[_0xe316('0x30')](_0x5ae432[_0xe316('0x2f')]);_0x27892e[_0xe316('0x39')]=_[_0xe316('0x31')](_0x27892e[_0xe316('0x2e')],_0x27892e['query']);_0x9473b['attributes']=_[_0xe316('0x31')](_0x27892e[_0xe316('0x2e')],qs[_0xe316('0x33')](_0x5ae432['query'][_0xe316('0x33')]));_0x9473b[_0xe316('0x32')]=_0x9473b[_0xe316('0x32')][_0xe316('0x34')]?_0x9473b[_0xe316('0x32')]:_0x27892e[_0xe316('0x2e')];if(_0x5ae432['query'][_0xe316('0x40')]){_0x9473b[_0xe316('0x41')]=[{'all':!![]}];}_0x9473b=_[_0xe316('0x3a')]({},_0x9473b,_0x5ae432[_0xe316('0x42')]);return db[_0xe316('0x2a')][_0xe316('0x43')](_0x9473b)[_0xe316('0x26')](handleEntityNotFound(_0x439412,null))['then'](respondWithResult(_0x439412,null))['catch'](handleError(_0x439412,null));};exports[_0xe316('0x44')]=function(_0x4f03b5,_0x173b4b){return db[_0xe316('0x2a')]['create'](_0x4f03b5[_0xe316('0x45')],{})[_0xe316('0x26')](respondWithResult(_0x173b4b,0xc9))[_0xe316('0x3d')](handleError(_0x173b4b,null));};exports[_0xe316('0x25')]=function(_0x22fc64,_0x1df215){if(_0x22fc64['body']['id']){delete _0x22fc64[_0xe316('0x45')]['id'];}return db['DeskConfiguration'][_0xe316('0x43')]({'where':{'id':_0x22fc64[_0xe316('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1df215,null))[_0xe316('0x26')](saveUpdates(_0x22fc64[_0xe316('0x45')],null))[_0xe316('0x26')](respondWithResult(_0x1df215,null))[_0xe316('0x3d')](handleError(_0x1df215,null));};exports[_0xe316('0x46')]=function(_0x30eab1,_0x707f4f){return db[_0xe316('0x2a')]['find']({'where':{'id':_0x30eab1['params']['id']}})[_0xe316('0x26')](handleEntityNotFound(_0x707f4f,null))[_0xe316('0x26')](removeEntity(_0x707f4f,null))[_0xe316('0x3d')](handleError(_0x707f4f,null));};exports[_0xe316('0x47')]=function(_0x3d223b,_0x4e6743,_0x354144){var _0x15ec37={};var _0x547a71={};var _0x4ab837;var _0x451c38;return db[_0xe316('0x2a')][_0xe316('0x48')]({'where':{'id':_0x3d223b[_0xe316('0x3f')]['id']}})[_0xe316('0x26')](handleEntityNotFound(_0x4e6743,null))[_0xe316('0x26')](function(_0x19e547){if(_0x19e547){_0x4ab837=_0x19e547;_0x547a71[_0xe316('0x2e')]=_[_0xe316('0x30')](db[_0xe316('0x49')][_0xe316('0x2b')]);_0x547a71[_0xe316('0x2f')]=_[_0xe316('0x30')](_0x3d223b[_0xe316('0x2f')]);_0x547a71[_0xe316('0x39')]=_[_0xe316('0x31')](_0x547a71[_0xe316('0x2e')],_0x547a71[_0xe316('0x2f')]);_0x15ec37[_0xe316('0x32')]=_['intersection'](_0x547a71[_0xe316('0x2e')],qs['fields'](_0x3d223b['query']['fields']));_0x15ec37[_0xe316('0x32')]=_0x15ec37[_0xe316('0x32')][_0xe316('0x34')]?_0x15ec37[_0xe316('0x32')]:_0x547a71[_0xe316('0x2e')];_0x15ec37[_0xe316('0x36')]=qs['sort'](_0x3d223b['query'][_0xe316('0x37')]);_0x15ec37[_0xe316('0x38')]=qs['filters'](_['pick'](_0x3d223b[_0xe316('0x2f')],_0x547a71[_0xe316('0x39')]));if(_0x3d223b[_0xe316('0x2f')]['filter']){_0x15ec37[_0xe316('0x38')]=_[_0xe316('0x3a')](_0x15ec37[_0xe316('0x38')],{'$or':_['map'](_0x15ec37['attributes'],function(_0x32b7a4){var _0x85013d={};_0x85013d[_0x32b7a4]={'$like':'%'+_0x3d223b[_0xe316('0x2f')][_0xe316('0x4a')]+'%'};return _0x85013d;})});}_0x15ec37=_['merge']({},_0x15ec37,_0x3d223b[_0xe316('0x42')]);return _0x4ab837[_0xe316('0x47')](_0x15ec37);}})[_0xe316('0x26')](function(_0x15ebde){if(_0x15ebde){_0x451c38=_0x15ebde[_0xe316('0x34')];if(!_0x3d223b['query']['hasOwnProperty'](_0xe316('0x4b'))){_0x15ec37[_0xe316('0x1f')]=qs[_0xe316('0x1f')](_0x3d223b['query'][_0xe316('0x1f')]);_0x15ec37[_0xe316('0x1e')]=qs['offset'](_0x3d223b[_0xe316('0x2f')][_0xe316('0x1e')]);}return _0x4ab837['getFields'](_0x15ec37);}})[_0xe316('0x26')](function(_0x5d962c){if(_0x5d962c){return _0x5d962c?{'count':_0x451c38,'rows':_0x5d962c}:null;}})[_0xe316('0x26')](respondWithResult(_0x4e6743,null))['catch'](handleError(_0x4e6743,null));};exports[_0xe316('0x4c')]=function(_0x4e119c,_0x2b8bf2,_0x2025a7){var _0x209d38={};var _0x114090={};var _0x315286;var _0x158809;return db[_0xe316('0x2a')][_0xe316('0x48')]({'where':{'id':_0x4e119c[_0xe316('0x3f')]['id']}})[_0xe316('0x26')](handleEntityNotFound(_0x2b8bf2,null))[_0xe316('0x26')](function(_0x3bd2aa){if(_0x3bd2aa){_0x315286=_0x3bd2aa;_0x114090[_0xe316('0x2e')]=_[_0xe316('0x30')](db[_0xe316('0x49')][_0xe316('0x2b')]);_0x114090['query']=_['keys'](_0x4e119c['query']);_0x114090[_0xe316('0x39')]=_[_0xe316('0x31')](_0x114090[_0xe316('0x2e')],_0x114090['query']);_0x209d38['attributes']=_[_0xe316('0x31')](_0x114090[_0xe316('0x2e')],qs[_0xe316('0x33')](_0x4e119c['query']['fields']));_0x209d38[_0xe316('0x32')]=_0x209d38[_0xe316('0x32')][_0xe316('0x34')]?_0x209d38[_0xe316('0x32')]:_0x114090['model'];_0x209d38[_0xe316('0x36')]=qs[_0xe316('0x37')](_0x4e119c[_0xe316('0x2f')][_0xe316('0x37')]);_0x209d38[_0xe316('0x38')]=qs[_0xe316('0x39')](_[_0xe316('0x4d')](_0x4e119c[_0xe316('0x2f')],_0x114090[_0xe316('0x39')]));if(_0x4e119c[_0xe316('0x2f')][_0xe316('0x4a')]){_0x209d38[_0xe316('0x38')]=_['merge'](_0x209d38[_0xe316('0x38')],{'$or':_['map'](_0x209d38[_0xe316('0x32')],function(_0x9c782e){var _0x7909c6={};_0x7909c6[_0x9c782e]={'$like':'%'+_0x4e119c['query'][_0xe316('0x4a')]+'%'};return _0x7909c6;})});}_0x209d38=_[_0xe316('0x3a')]({},_0x209d38,_0x4e119c[_0xe316('0x42')]);return _0x315286[_0xe316('0x4c')](_0x209d38);}})[_0xe316('0x26')](function(_0x5cf77b){if(_0x5cf77b){_0x158809=_0x5cf77b['length'];if(!_0x4e119c[_0xe316('0x2f')]['hasOwnProperty'](_0xe316('0x4b'))){_0x209d38[_0xe316('0x1f')]=qs[_0xe316('0x1f')](_0x4e119c['query'][_0xe316('0x1f')]);_0x209d38[_0xe316('0x1e')]=qs[_0xe316('0x1e')](_0x4e119c[_0xe316('0x2f')][_0xe316('0x1e')]);}return _0x315286[_0xe316('0x4c')](_0x209d38);}})[_0xe316('0x26')](function(_0x3c5cc9){if(_0x3c5cc9){return _0x3c5cc9?{'count':_0x158809,'rows':_0x3c5cc9}:null;}})[_0xe316('0x26')](respondWithResult(_0x2b8bf2,null))[_0xe316('0x3d')](handleError(_0x2b8bf2,null));};exports['getDescriptions']=function(_0x5c4783,_0x46c6fc,_0x58ec0e){var _0x2b7642={};var _0x3d991a={};var _0x56798c;var _0x9d78e3;return db[_0xe316('0x2a')][_0xe316('0x48')]({'where':{'id':_0x5c4783[_0xe316('0x3f')]['id']}})[_0xe316('0x26')](handleEntityNotFound(_0x46c6fc,null))[_0xe316('0x26')](function(_0x38aace){if(_0x38aace){_0x56798c=_0x38aace;_0x3d991a['model']=_[_0xe316('0x30')](db[_0xe316('0x49')]['rawAttributes']);_0x3d991a['query']=_[_0xe316('0x30')](_0x5c4783[_0xe316('0x2f')]);_0x3d991a['filters']=_[_0xe316('0x31')](_0x3d991a[_0xe316('0x2e')],_0x3d991a[_0xe316('0x2f')]);_0x2b7642[_0xe316('0x32')]=_[_0xe316('0x31')](_0x3d991a[_0xe316('0x2e')],qs[_0xe316('0x33')](_0x5c4783['query'][_0xe316('0x33')]));_0x2b7642[_0xe316('0x32')]=_0x2b7642['attributes'][_0xe316('0x34')]?_0x2b7642['attributes']:_0x3d991a[_0xe316('0x2e')];_0x2b7642['order']=qs[_0xe316('0x37')](_0x5c4783[_0xe316('0x2f')][_0xe316('0x37')]);_0x2b7642[_0xe316('0x38')]=qs[_0xe316('0x39')](_[_0xe316('0x4d')](_0x5c4783[_0xe316('0x2f')],_0x3d991a[_0xe316('0x39')]));if(_0x5c4783[_0xe316('0x2f')][_0xe316('0x4a')]){_0x2b7642[_0xe316('0x38')]=_[_0xe316('0x3a')](_0x2b7642[_0xe316('0x38')],{'$or':_['map'](_0x2b7642[_0xe316('0x32')],function(_0x28109d){var _0x50b6e1={};_0x50b6e1[_0x28109d]={'$like':'%'+_0x5c4783[_0xe316('0x2f')]['filter']+'%'};return _0x50b6e1;})});}_0x2b7642=_[_0xe316('0x3a')]({},_0x2b7642,_0x5c4783[_0xe316('0x42')]);return _0x56798c[_0xe316('0x4e')](_0x2b7642);}})[_0xe316('0x26')](function(_0x55412a){if(_0x55412a){_0x9d78e3=_0x55412a[_0xe316('0x34')];if(!_0x5c4783[_0xe316('0x2f')][_0xe316('0x35')](_0xe316('0x4b'))){_0x2b7642[_0xe316('0x1f')]=qs[_0xe316('0x1f')](_0x5c4783[_0xe316('0x2f')][_0xe316('0x1f')]);_0x2b7642[_0xe316('0x1e')]=qs[_0xe316('0x1e')](_0x5c4783[_0xe316('0x2f')][_0xe316('0x1e')]);}return _0x56798c[_0xe316('0x4e')](_0x2b7642);}})[_0xe316('0x26')](function(_0x13c9d2){if(_0x13c9d2){return _0x13c9d2?{'count':_0x9d78e3,'rows':_0x13c9d2}:null;}})[_0xe316('0x26')](respondWithResult(_0x46c6fc,null))[_0xe316('0x3d')](handleError(_0x46c6fc,null));};exports[_0xe316('0x4f')]=function(_0x2453e3,_0x2f6cad,_0x1c1b6c){var _0x3077cc={};var _0x1a8d05={};var _0x265a5a;var _0x20ddf6;return db[_0xe316('0x2a')][_0xe316('0x48')]({'where':{'id':_0x2453e3[_0xe316('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2f6cad,null))[_0xe316('0x26')](function(_0x59e166){if(_0x59e166){_0x265a5a=_0x59e166;_0x1a8d05[_0xe316('0x2e')]=_[_0xe316('0x30')](db[_0xe316('0x50')][_0xe316('0x2b')]);_0x1a8d05[_0xe316('0x2f')]=_[_0xe316('0x30')](_0x2453e3['query']);_0x1a8d05[_0xe316('0x39')]=_[_0xe316('0x31')](_0x1a8d05[_0xe316('0x2e')],_0x1a8d05[_0xe316('0x2f')]);_0x3077cc[_0xe316('0x32')]=_[_0xe316('0x31')](_0x1a8d05[_0xe316('0x2e')],qs[_0xe316('0x33')](_0x2453e3[_0xe316('0x2f')][_0xe316('0x33')]));_0x3077cc[_0xe316('0x32')]=_0x3077cc[_0xe316('0x32')][_0xe316('0x34')]?_0x3077cc[_0xe316('0x32')]:_0x1a8d05['model'];_0x3077cc[_0xe316('0x36')]=qs[_0xe316('0x37')](_0x2453e3[_0xe316('0x2f')][_0xe316('0x37')]);_0x3077cc[_0xe316('0x38')]=qs[_0xe316('0x39')](_['pick'](_0x2453e3[_0xe316('0x2f')],_0x1a8d05[_0xe316('0x39')]));if(_0x2453e3[_0xe316('0x2f')][_0xe316('0x4a')]){_0x3077cc['where']=_[_0xe316('0x3a')](_0x3077cc[_0xe316('0x38')],{'$or':_[_0xe316('0x3b')](_0x3077cc['attributes'],function(_0xa48630){var _0x3a1ecd={};_0x3a1ecd[_0xa48630]={'$like':'%'+_0x2453e3[_0xe316('0x2f')]['filter']+'%'};return _0x3a1ecd;})});}_0x3077cc=_[_0xe316('0x3a')]({},_0x3077cc,_0x2453e3[_0xe316('0x42')]);return _0x265a5a[_0xe316('0x4f')](_0x3077cc);}})[_0xe316('0x26')](function(_0x102422){if(_0x102422){_0x20ddf6=_0x102422['length'];if(!_0x2453e3['query'][_0xe316('0x35')](_0xe316('0x4b'))){_0x3077cc[_0xe316('0x1f')]=qs[_0xe316('0x1f')](_0x2453e3[_0xe316('0x2f')][_0xe316('0x1f')]);_0x3077cc[_0xe316('0x1e')]=qs[_0xe316('0x1e')](_0x2453e3[_0xe316('0x2f')][_0xe316('0x1e')]);}return _0x265a5a[_0xe316('0x4f')](_0x3077cc);}})['then'](function(_0x5f1792){if(_0x5f1792){return _0x5f1792?{'count':_0x20ddf6,'rows':_0x5f1792}:null;}})[_0xe316('0x26')](respondWithResult(_0x2f6cad,null))['catch'](handleError(_0x2f6cad,null));};exports[_0xe316('0x51')]=function(_0x4be1f4,_0x2f3939,_0x31fa2b){if(_0x4be1f4[_0xe316('0x45')]['id']){delete _0x4be1f4[_0xe316('0x45')]['id'];}return db[_0xe316('0x2a')][_0xe316('0x48')]({'where':{'id':_0x4be1f4[_0xe316('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2f3939,null))[_0xe316('0x26')](function(_0x1b3819){if(_0x1b3819){return _0x1b3819['setTags'](_0x4be1f4[_0xe316('0x45')]['ids']||[]);}return null;})[_0xe316('0x26')](respondWithResult(_0x2f3939,null))[_0xe316('0x3d')](handleError(_0x2f3939,null));};
\ No newline at end of file
index 4a76d22..5b8aeec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5978=['DeskConfiguration','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3d6005,_0x5235b0){var _0x57f042=function(_0x2ae255){while(--_0x2ae255){_0x3d6005['push'](_0x3d6005['shift']());}};_0x57f042(++_0x5235b0);}(_0x5978,0xdd));var _0x8597=function(_0x113ce8,_0x26d59f){_0x113ce8=_0x113ce8-0x0;var _0x269fb4=_0x5978[_0x113ce8];return _0x269fb4;};'use strict';var _=require(_0x8597('0x0'));var util=require(_0x8597('0x1'));var logger=require(_0x8597('0x2'))(_0x8597('0x3'));var moment=require(_0x8597('0x4'));var BPromise=require('bluebird');var rp=require(_0x8597('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8597('0x6'));var config=require(_0x8597('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0x8597('0x8')]=function(_0x1a8256,_0x438947){return _0x1a8256[_0x8597('0x9')](_0x8597('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad60=['request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird'];(function(_0x2072e7,_0x2715bc){var _0x545329=function(_0x30a199){while(--_0x30a199){_0x2072e7['push'](_0x2072e7['shift']());}};_0x545329(++_0x2715bc);}(_0xad60,0xe5));var _0x0ad6=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xad60[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x0ad6('0x0'));var util=require(_0x0ad6('0x1'));var logger=require('../../config/logger')(_0x0ad6('0x2'));var moment=require(_0x0ad6('0x3'));var BPromise=require(_0x0ad6('0x4'));var rp=require(_0x0ad6('0x5'));var fs=require('fs');var path=require(_0x0ad6('0x6'));var rimraf=require('rimraf');var config=require(_0x0ad6('0x7'));var attributes=require(_0x0ad6('0x8'));module[_0x0ad6('0x9')]=function(_0x47d469,_0x44a6ad){return _0x47d469[_0x0ad6('0xa')](_0x0ad6('0xb'),attributes,{'tableName':_0x0ad6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fb1d646..973594f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd89=['request\x20sent','debug','error','message','result','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s'];(function(_0x51fcc4,_0x217bcc){var _0x4b067b=function(_0x2098e1){while(--_0x2098e1){_0x51fcc4['push'](_0x51fcc4['shift']());}};_0x4b067b(++_0x217bcc);}(_0xbd89,0x9e));var _0x9bd8=function(_0x612527,_0x275797){_0x612527=_0x612527-0x0;var _0x40f18a=_0xbd89[_0x612527];return _0x40f18a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9bd8('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bd8('0x1'));var db=require(_0x9bd8('0x2'))['db'];var utils=require(_0x9bd8('0x3'));var logger=require(_0x9bd8('0x4'))(_0x9bd8('0x5'));var config=require('../../config/environment');var jayson=require(_0x9bd8('0x6'));var client=jayson[_0x9bd8('0x7')][_0x9bd8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x351096,_0x3c0f2f,_0x20e92c){return new BPromise(function(_0x219c66,_0x233e9e){return client[_0x9bd8('0x9')](_0x351096,_0x20e92c)[_0x9bd8('0xa')](function(_0x531a57){logger['info'](_0x9bd8('0xb'),_0x3c0f2f,_0x9bd8('0xc'));logger[_0x9bd8('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3c0f2f,_0x9bd8('0xc'),JSON['stringify'](_0x531a57));if(_0x531a57[_0x9bd8('0xe')]){if(_0x531a57[_0x9bd8('0xe')]['code']===0x1f4){logger[_0x9bd8('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x3c0f2f,_0x531a57[_0x9bd8('0xe')][_0x9bd8('0xf')]);return _0x233e9e(_0x531a57[_0x9bd8('0xe')]['message']);}logger[_0x9bd8('0xe')](_0x9bd8('0xb'),_0x3c0f2f,_0x531a57[_0x9bd8('0xe')][_0x9bd8('0xf')]);return _0x219c66(_0x531a57[_0x9bd8('0xe')][_0x9bd8('0xf')]);}else{logger['info'](_0x9bd8('0xb'),_0x3c0f2f,_0x9bd8('0xc'));_0x219c66(_0x531a57[_0x9bd8('0x10')][_0x9bd8('0xf')]);}})['catch'](function(_0x506b3d){logger['error'](_0x9bd8('0xb'),_0x3c0f2f,_0x506b3d);_0x233e9e(_0x506b3d);});});}
\ No newline at end of file
+var _0x023d=['message','result','catch','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2d46b1,_0xe4f490){var _0x452d77=function(_0x31a4b1){while(--_0x31a4b1){_0x2d46b1['push'](_0x2d46b1['shift']());}};_0x452d77(++_0xe4f490);}(_0x023d,0x67));var _0xd023=function(_0x22a370,_0x8f438f){_0x22a370=_0x22a370-0x0;var _0x5aff56=_0x023d[_0x22a370];return _0x5aff56;};'use strict';var _=require('lodash');var util=require(_0xd023('0x0'));var moment=require('moment');var BPromise=require(_0xd023('0x1'));var rs=require(_0xd023('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd023('0x3'));var logger=require('../../config/logger')(_0xd023('0x4'));var config=require(_0xd023('0x5'));var jayson=require(_0xd023('0x6'));var client=jayson[_0xd023('0x7')][_0xd023('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35a7a0,_0x45d4c4,_0x47b336){return new BPromise(function(_0x5c529a,_0x1563ce){return client['request'](_0x35a7a0,_0x47b336)[_0xd023('0x9')](function(_0x1a7188){logger['info'](_0xd023('0xa'),_0x45d4c4,_0xd023('0xb'));logger[_0xd023('0xc')](_0xd023('0xd'),_0x45d4c4,_0xd023('0xb'),JSON[_0xd023('0xe')](_0x1a7188));if(_0x1a7188[_0xd023('0xf')]){if(_0x1a7188['error'][_0xd023('0x10')]===0x1f4){logger['error'](_0xd023('0xa'),_0x45d4c4,_0x1a7188[_0xd023('0xf')][_0xd023('0x11')]);return _0x1563ce(_0x1a7188[_0xd023('0xf')]['message']);}logger['error'](_0xd023('0xa'),_0x45d4c4,_0x1a7188[_0xd023('0xf')]['message']);return _0x5c529a(_0x1a7188[_0xd023('0xf')][_0xd023('0x11')]);}else{logger['info'](_0xd023('0xa'),_0x45d4c4,'request\x20sent');_0x5c529a(_0x1a7188[_0xd023('0x12')]['message']);}})[_0xd023('0x13')](function(_0xad58b8){logger[_0xd023('0xf')](_0xd023('0xa'),_0x45d4c4,_0xad58b8);_0x1563ce(_0xad58b8);});});}
\ No newline at end of file
index 74bd5b7..c1be82f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b99=['../../components/auth/service','../../config/environment','./intDeskField.controller','index','get','isAuthenticated','show','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b99,0x161));var _0x93b9=function(_0x9c2052,_0xb2ae32){_0x9c2052=_0x9c2052-0x0;var _0x318352=_0x3b99[_0x9c2052];return _0x318352;};'use strict';var multer=require(_0x93b9('0x0'));var util=require(_0x93b9('0x1'));var path=require(_0x93b9('0x2'));var timeout=require(_0x93b9('0x3'));var express=require(_0x93b9('0x4'));var router=express[_0x93b9('0x5')]();var fs_extra=require(_0x93b9('0x6'));var auth=require(_0x93b9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x93b9('0x8'));var controller=require(_0x93b9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x93b9('0xa')]);router[_0x93b9('0xb')]('/:id',auth[_0x93b9('0xc')](),controller[_0x93b9('0xd')]);router[_0x93b9('0xe')]('/',auth[_0x93b9('0xc')](),controller[_0x93b9('0xf')]);router['put'](_0x93b9('0x10'),auth['isAuthenticated'](),controller[_0x93b9('0x11')]);router[_0x93b9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x93b9('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xdadc=['isAuthenticated','index','show','post','create','put','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5c2748,_0x564960){var _0x59761d=function(_0x1ccb1a){while(--_0x1ccb1a){_0x5c2748['push'](_0x5c2748['shift']());}};_0x59761d(++_0x564960);}(_0xdadc,0x75));var _0xcdad=function(_0x2eb29d,_0x3a90fc){_0x2eb29d=_0x2eb29d-0x0;var _0x175b1e=_0xdadc[_0x2eb29d];return _0x175b1e;};'use strict';var multer=require(_0xcdad('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcdad('0x1'));var express=require(_0xcdad('0x2'));var router=express[_0xcdad('0x3')]();var fs_extra=require(_0xcdad('0x4'));var auth=require(_0xcdad('0x5'));var interaction=require(_0xcdad('0x6'));var config=require(_0xcdad('0x7'));var controller=require('./intDeskField.controller');router[_0xcdad('0x8')]('/',auth[_0xcdad('0x9')](),controller[_0xcdad('0xa')]);router['get']('/:id',auth[_0xcdad('0x9')](),controller[_0xcdad('0xb')]);router[_0xcdad('0xc')]('/',auth['isAuthenticated'](),controller[_0xcdad('0xd')]);router[_0xcdad('0xe')](_0xcdad('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xcdad('0xf'),auth[_0xcdad('0x9')](),controller[_0xcdad('0x10')]);module[_0xcdad('0x11')]=router;
\ No newline at end of file
index 56dd789..15bcaa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c1=['ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0xc4e129,_0x586990){var _0x24ae73=function(_0x17608a){while(--_0x17608a){_0xc4e129['push'](_0xc4e129['shift']());}};_0x24ae73(++_0x586990);}(_0xe0c1,0x1f1));var _0x1e0c=function(_0x16cb93,_0x3ee011){_0x16cb93=_0x16cb93-0x0;var _0x491614=_0xe0c1[_0x16cb93];return _0x491614;};'use strict';var Sequelize=require(_0x1e0c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x1e0c('0x1'),_0x1e0c('0x2'),_0x1e0c('0x3'),_0x1e0c('0x4'),_0x1e0c('0x5')),'defaultValue':_0x1e0c('0x1')},'content':{'type':Sequelize[_0x1e0c('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1e0c('0x7')](_0x1e0c('0x1'),_0x1e0c('0x2'),_0x1e0c('0x3'))},'keyContent':{'type':Sequelize[_0x1e0c('0x6')]},'idField':{'type':Sequelize[_0x1e0c('0x6')]},'nameField':{'type':Sequelize[_0x1e0c('0x6')]},'customField':{'type':Sequelize[_0x1e0c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1e0c('0x6')]}};
\ No newline at end of file
+var _0x96da=['STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x96da,0x157));var _0xa96d=function(_0x3a6e2d,_0x5228c5){_0x3a6e2d=_0x3a6e2d-0x0;var _0x247385=_0x96da[_0x3a6e2d];return _0x247385;};'use strict';var Sequelize=require(_0xa96d('0x0'));module[_0xa96d('0x1')]={'type':{'type':Sequelize[_0xa96d('0x2')](_0xa96d('0x3'),'variable',_0xa96d('0x4'),_0xa96d('0x5'),_0xa96d('0x6')),'defaultValue':_0xa96d('0x3')},'content':{'type':Sequelize[_0xa96d('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xa96d('0x8'),_0xa96d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa96d('0x7')]},'customField':{'type':Sequelize[_0xa96d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa96d('0x7')]}};
\ No newline at end of file
index 1f2e6d1..e6e3add 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5aae=['index','map','DeskField','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','include','findAll','show','find','catch','body','params','destroy','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5aae,0xe5));var _0xe5aa=function(_0x3eea50,_0x54d651){_0x3eea50=_0x3eea50-0x0;var _0x3f1f0e=_0x5aae[_0x3eea50];return _0x3f1f0e;};'use strict';var emlformat=require(_0xe5aa('0x0'));var rimraf=require(_0xe5aa('0x1'));var zipdir=require(_0xe5aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe5aa('0x3'));var Mustache=require(_0xe5aa('0x4'));var util=require(_0xe5aa('0x5'));var path=require('path');var sox=require(_0xe5aa('0x6'));var csv=require('to-csv');var ejs=require(_0xe5aa('0x7'));var fs=require('fs');var fs_extra=require(_0xe5aa('0x8'));var _=require('lodash');var squel=require(_0xe5aa('0x9'));var crypto=require('crypto');var jsforce=require(_0xe5aa('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe5aa('0xb'));var querystring=require(_0xe5aa('0xc'));var Papa=require('papaparse');var Redis=require(_0xe5aa('0xd'));var authService=require(_0xe5aa('0xe'));var qs=require(_0xe5aa('0xf'));var as=require(_0xe5aa('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5aa('0x11'))(_0xe5aa('0x12'));var utils=require('../../config/utils');var config=require(_0xe5aa('0x13'));var licenseUtil=require(_0xe5aa('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f4d74,_0x1e842a){_0x1e842a=_0x1e842a||0xcc;return function(_0x4df815){if(_0x4df815){return _0x3f4d74[_0xe5aa('0x15')](_0x1e842a);}return _0x3f4d74[_0xe5aa('0x16')](_0x1e842a)[_0xe5aa('0x17')]();};}function respondWithResult(_0x58ff00,_0x48f466){_0x48f466=_0x48f466||0xc8;return function(_0x5e7117){if(_0x5e7117){return _0x58ff00[_0xe5aa('0x16')](_0x48f466)[_0xe5aa('0x18')](_0x5e7117);}};}function respondWithFilteredResult(_0xe136ca,_0x468d63){return function(_0x16b561){if(_0x16b561){var _0x615cb3=typeof _0x468d63[_0xe5aa('0x19')]===_0xe5aa('0x1a')&&typeof _0x468d63[_0xe5aa('0x1b')]===_0xe5aa('0x1a');var _0x2f223b=_0x16b561[_0xe5aa('0x1c')];var _0x261267=_0x615cb3?0x0:_0x468d63[_0xe5aa('0x19')];var _0x325e3b=_0x615cb3?_0x16b561[_0xe5aa('0x1c')]:_0x468d63[_0xe5aa('0x19')]+_0x468d63[_0xe5aa('0x1b')];var _0x55e237;if(_0x325e3b>=_0x2f223b){_0x325e3b=_0x2f223b;_0x55e237=0xc8;}else{_0x55e237=0xce;}_0xe136ca['status'](_0x55e237);return _0xe136ca[_0xe5aa('0x1d')](_0xe5aa('0x1e'),_0x261267+'-'+_0x325e3b+'/'+_0x2f223b)[_0xe5aa('0x18')](_0x16b561);}return null;};}function patchUpdates(_0x3a3f11){return function(_0x981a6f){try{jsonpatch[_0xe5aa('0x1f')](_0x981a6f,_0x3a3f11,!![]);}catch(_0xcd3872){return BPromise[_0xe5aa('0x20')](_0xcd3872);}return _0x981a6f[_0xe5aa('0x21')]();};}function saveUpdates(_0x28aa98,_0x89aaf3){return function(_0x545376){if(_0x545376){return _0x545376[_0xe5aa('0x22')](_0x28aa98)[_0xe5aa('0x23')](function(_0x12942e){return _0x12942e;});}return null;};}function removeEntity(_0x108288,_0x5d6613){return function(_0x25252e){if(_0x25252e){return _0x25252e['destroy']()[_0xe5aa('0x23')](function(){_0x108288[_0xe5aa('0x16')](0xcc)[_0xe5aa('0x17')]();});}};}function handleEntityNotFound(_0x21496b,_0x3850db){return function(_0x19747d){if(!_0x19747d){_0x21496b[_0xe5aa('0x15')](0x194);}return _0x19747d;};}function handleError(_0x198efc,_0x2590fe){_0x2590fe=_0x2590fe||0x1f4;return function(_0x3e4ec3){logger[_0xe5aa('0x24')](_0x3e4ec3['stack']);if(_0x3e4ec3[_0xe5aa('0x25')]){delete _0x3e4ec3[_0xe5aa('0x25')];}_0x198efc[_0xe5aa('0x16')](_0x2590fe)[_0xe5aa('0x26')](_0x3e4ec3);};}exports[_0xe5aa('0x27')]=function(_0x143fab,_0x240015){var _0x28487d={},_0x524175={},_0x2f793f={'count':0x0,'rows':[]};var _0x53c05a=_[_0xe5aa('0x28')](db[_0xe5aa('0x29')][_0xe5aa('0x2a')],function(_0x26688e){return{'name':_0x26688e[_0xe5aa('0x2b')],'type':_0x26688e['type']['key']};});_0x524175[_0xe5aa('0x2c')]=_[_0xe5aa('0x28')](_0x53c05a,_0xe5aa('0x25'));_0x524175[_0xe5aa('0x2d')]=_[_0xe5aa('0x2e')](_0x143fab[_0xe5aa('0x2d')]);_0x524175[_0xe5aa('0x2f')]=_['intersection'](_0x524175['model'],_0x524175['query']);_0x28487d[_0xe5aa('0x30')]=_[_0xe5aa('0x31')](_0x524175[_0xe5aa('0x2c')],qs['fields'](_0x143fab['query'][_0xe5aa('0x32')]));_0x28487d[_0xe5aa('0x30')]=_0x28487d[_0xe5aa('0x30')][_0xe5aa('0x33')]?_0x28487d[_0xe5aa('0x30')]:_0x524175[_0xe5aa('0x2c')];if(!_0x143fab[_0xe5aa('0x2d')][_0xe5aa('0x34')]('nolimit')){_0x28487d[_0xe5aa('0x1b')]=qs[_0xe5aa('0x1b')](_0x143fab[_0xe5aa('0x2d')][_0xe5aa('0x1b')]);_0x28487d[_0xe5aa('0x19')]=qs[_0xe5aa('0x19')](_0x143fab[_0xe5aa('0x2d')]['offset']);}_0x28487d['order']=qs['sort'](_0x143fab[_0xe5aa('0x2d')][_0xe5aa('0x35')]);_0x28487d[_0xe5aa('0x36')]=qs[_0xe5aa('0x2f')](_['pick'](_0x143fab[_0xe5aa('0x2d')],_0x524175[_0xe5aa('0x2f')]),_0x53c05a);if(_0x143fab[_0xe5aa('0x2d')][_0xe5aa('0x37')]){_0x28487d[_0xe5aa('0x36')]=_[_0xe5aa('0x38')](_0x28487d['where'],{'$or':_[_0xe5aa('0x28')](_0x53c05a,function(_0xb6d248){if(_0xb6d248[_0xe5aa('0x39')]!==_0xe5aa('0x3a')){var _0x448221={};_0x448221[_0xb6d248[_0xe5aa('0x25')]]={'$like':'%'+_0x143fab[_0xe5aa('0x2d')][_0xe5aa('0x37')]+'%'};return _0x448221;}})});}_0x28487d=_[_0xe5aa('0x38')]({},_0x28487d,_0x143fab['options']);var _0x5599f7={'where':_0x28487d[_0xe5aa('0x36')]};return db[_0xe5aa('0x29')][_0xe5aa('0x1c')](_0x5599f7)['then'](function(_0x56eb3f){_0x2f793f[_0xe5aa('0x1c')]=_0x56eb3f;if(_0x143fab[_0xe5aa('0x2d')]['includeAll']){_0x28487d[_0xe5aa('0x3b')]=[{'all':!![]}];}return db[_0xe5aa('0x29')][_0xe5aa('0x3c')](_0x28487d);})['then'](function(_0x2f0fbe){_0x2f793f['rows']=_0x2f0fbe;return _0x2f793f;})['then'](respondWithFilteredResult(_0x240015,_0x28487d))['catch'](handleError(_0x240015,null));};exports[_0xe5aa('0x3d')]=function(_0x515ad5,_0x97e17c){var _0x58d386={'raw':!![],'where':{'id':_0x515ad5['params']['id']}},_0x420bb9={};_0x420bb9[_0xe5aa('0x2c')]=_['keys'](db[_0xe5aa('0x29')]['rawAttributes']);_0x420bb9[_0xe5aa('0x2d')]=_['keys'](_0x515ad5[_0xe5aa('0x2d')]);_0x420bb9[_0xe5aa('0x2f')]=_[_0xe5aa('0x31')](_0x420bb9[_0xe5aa('0x2c')],_0x420bb9['query']);_0x58d386[_0xe5aa('0x30')]=_['intersection'](_0x420bb9[_0xe5aa('0x2c')],qs[_0xe5aa('0x32')](_0x515ad5[_0xe5aa('0x2d')][_0xe5aa('0x32')]));_0x58d386['attributes']=_0x58d386['attributes']['length']?_0x58d386['attributes']:_0x420bb9[_0xe5aa('0x2c')];if(_0x515ad5[_0xe5aa('0x2d')]['includeAll']){_0x58d386[_0xe5aa('0x3b')]=[{'all':!![]}];}_0x58d386=_[_0xe5aa('0x38')]({},_0x58d386,_0x515ad5['options']);return db[_0xe5aa('0x29')][_0xe5aa('0x3e')](_0x58d386)[_0xe5aa('0x23')](handleEntityNotFound(_0x97e17c,null))['then'](respondWithResult(_0x97e17c,null))[_0xe5aa('0x3f')](handleError(_0x97e17c,null));};exports['create']=function(_0x37d720,_0xdd9dff){return db[_0xe5aa('0x29')]['create'](_0x37d720['body'],{})['then'](respondWithResult(_0xdd9dff,0xc9))['catch'](handleError(_0xdd9dff,null));};exports[_0xe5aa('0x22')]=function(_0x2254c7,_0x2b9fdd){if(_0x2254c7[_0xe5aa('0x40')]['id']){delete _0x2254c7[_0xe5aa('0x40')]['id'];}return db[_0xe5aa('0x29')]['find']({'where':{'id':_0x2254c7[_0xe5aa('0x41')]['id']}})[_0xe5aa('0x23')](handleEntityNotFound(_0x2b9fdd,null))[_0xe5aa('0x23')](saveUpdates(_0x2254c7[_0xe5aa('0x40')],null))[_0xe5aa('0x23')](respondWithResult(_0x2b9fdd,null))[_0xe5aa('0x3f')](handleError(_0x2b9fdd,null));};exports[_0xe5aa('0x42')]=function(_0x3143ef,_0x41cc3){return db[_0xe5aa('0x29')]['find']({'where':{'id':_0x3143ef[_0xe5aa('0x41')]['id']}})[_0xe5aa('0x23')](handleEntityNotFound(_0x41cc3,null))[_0xe5aa('0x23')](removeEntity(_0x41cc3,null))[_0xe5aa('0x3f')](handleError(_0x41cc3,null));};
\ No newline at end of file
+var _0x4cfd=['show','rawAttributes','find','catch','create','body','destroy','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','end','sendStatus','stack','send','map','DeskField','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4cfd,0x170));var _0xd4cf=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0x4cfd[_0x74892f];return _0x10ee61;};'use strict';var emlformat=require(_0xd4cf('0x0'));var rimraf=require(_0xd4cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4cf('0x2'));var rp=require(_0xd4cf('0x3'));var moment=require(_0xd4cf('0x4'));var BPromise=require(_0xd4cf('0x5'));var Mustache=require(_0xd4cf('0x6'));var util=require(_0xd4cf('0x7'));var path=require('path');var sox=require(_0xd4cf('0x8'));var csv=require(_0xd4cf('0x9'));var ejs=require(_0xd4cf('0xa'));var fs=require('fs');var fs_extra=require(_0xd4cf('0xb'));var _=require(_0xd4cf('0xc'));var squel=require(_0xd4cf('0xd'));var crypto=require('crypto');var jsforce=require(_0xd4cf('0xe'));var deskjs=require(_0xd4cf('0xf'));var toCsv=require(_0xd4cf('0x9'));var querystring=require(_0xd4cf('0x10'));var Papa=require(_0xd4cf('0x11'));var Redis=require(_0xd4cf('0x12'));var authService=require(_0xd4cf('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd4cf('0x14'));var hardwareService=require(_0xd4cf('0x15'));var logger=require(_0xd4cf('0x16'))(_0xd4cf('0x17'));var utils=require(_0xd4cf('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd4cf('0x19'))['db'];function respondWithStatusCode(_0x294c99,_0x544065){_0x544065=_0x544065||0xcc;return function(_0x3ff2db){if(_0x3ff2db){return _0x294c99['sendStatus'](_0x544065);}return _0x294c99[_0xd4cf('0x1a')](_0x544065)['end']();};}function respondWithResult(_0x330630,_0xa597cd){_0xa597cd=_0xa597cd||0xc8;return function(_0x51c61e){if(_0x51c61e){return _0x330630[_0xd4cf('0x1a')](_0xa597cd)[_0xd4cf('0x1b')](_0x51c61e);}};}function respondWithFilteredResult(_0x2f8607,_0x13c0a1){return function(_0x44abd7){if(_0x44abd7){var _0x2ff69e=typeof _0x13c0a1['offset']===_0xd4cf('0x1c')&&typeof _0x13c0a1[_0xd4cf('0x1d')]===_0xd4cf('0x1c');var _0x11b06a=_0x44abd7[_0xd4cf('0x1e')];var _0x3e749d=_0x2ff69e?0x0:_0x13c0a1[_0xd4cf('0x1f')];var _0x1df3e0=_0x2ff69e?_0x44abd7[_0xd4cf('0x1e')]:_0x13c0a1[_0xd4cf('0x1f')]+_0x13c0a1[_0xd4cf('0x1d')];var _0x540e2b;if(_0x1df3e0>=_0x11b06a){_0x1df3e0=_0x11b06a;_0x540e2b=0xc8;}else{_0x540e2b=0xce;}_0x2f8607[_0xd4cf('0x1a')](_0x540e2b);return _0x2f8607[_0xd4cf('0x20')](_0xd4cf('0x21'),_0x3e749d+'-'+_0x1df3e0+'/'+_0x11b06a)[_0xd4cf('0x1b')](_0x44abd7);}return null;};}function patchUpdates(_0x1caa70){return function(_0x2bef15){try{jsonpatch[_0xd4cf('0x22')](_0x2bef15,_0x1caa70,!![]);}catch(_0x5338dc){return BPromise[_0xd4cf('0x23')](_0x5338dc);}return _0x2bef15['save']();};}function saveUpdates(_0x4ec111,_0x10f6a7){return function(_0x3dbe6d){if(_0x3dbe6d){return _0x3dbe6d[_0xd4cf('0x24')](_0x4ec111)[_0xd4cf('0x25')](function(_0x2fe806){return _0x2fe806;});}return null;};}function removeEntity(_0x40c251,_0x54aaab){return function(_0x14c159){if(_0x14c159){return _0x14c159['destroy']()[_0xd4cf('0x25')](function(){_0x40c251[_0xd4cf('0x1a')](0xcc)[_0xd4cf('0x26')]();});}};}function handleEntityNotFound(_0x4c1896,_0x5266aa){return function(_0x52c21b){if(!_0x52c21b){_0x4c1896[_0xd4cf('0x27')](0x194);}return _0x52c21b;};}function handleError(_0x413317,_0x4fd6ea){_0x4fd6ea=_0x4fd6ea||0x1f4;return function(_0x59c215){logger['error'](_0x59c215[_0xd4cf('0x28')]);if(_0x59c215['name']){delete _0x59c215['name'];}_0x413317['status'](_0x4fd6ea)[_0xd4cf('0x29')](_0x59c215);};}exports['index']=function(_0xd08f38,_0xa9ae56){var _0x2459f4={},_0x3b507f={},_0x45943d={'count':0x0,'rows':[]};var _0x2183c1=_[_0xd4cf('0x2a')](db[_0xd4cf('0x2b')]['rawAttributes'],function(_0x1c6ae5){return{'name':_0x1c6ae5[_0xd4cf('0x2c')],'type':_0x1c6ae5[_0xd4cf('0x2d')]['key']};});_0x3b507f['model']=_[_0xd4cf('0x2a')](_0x2183c1,_0xd4cf('0x2e'));_0x3b507f[_0xd4cf('0x2f')]=_[_0xd4cf('0x30')](_0xd08f38[_0xd4cf('0x2f')]);_0x3b507f[_0xd4cf('0x31')]=_[_0xd4cf('0x32')](_0x3b507f[_0xd4cf('0x33')],_0x3b507f['query']);_0x2459f4[_0xd4cf('0x34')]=_[_0xd4cf('0x32')](_0x3b507f[_0xd4cf('0x33')],qs[_0xd4cf('0x35')](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x35')]));_0x2459f4[_0xd4cf('0x34')]=_0x2459f4[_0xd4cf('0x34')][_0xd4cf('0x36')]?_0x2459f4[_0xd4cf('0x34')]:_0x3b507f[_0xd4cf('0x33')];if(!_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x37')]('nolimit')){_0x2459f4['limit']=qs[_0xd4cf('0x1d')](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x1d')]);_0x2459f4[_0xd4cf('0x1f')]=qs[_0xd4cf('0x1f')](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x1f')]);}_0x2459f4[_0xd4cf('0x38')]=qs['sort'](_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x39')]);_0x2459f4[_0xd4cf('0x3a')]=qs['filters'](_['pick'](_0xd08f38[_0xd4cf('0x2f')],_0x3b507f[_0xd4cf('0x31')]),_0x2183c1);if(_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x3b')]){_0x2459f4['where']=_[_0xd4cf('0x3c')](_0x2459f4[_0xd4cf('0x3a')],{'$or':_[_0xd4cf('0x2a')](_0x2183c1,function(_0x222669){if(_0x222669['type']!=='VIRTUAL'){var _0x4aeaa8={};_0x4aeaa8[_0x222669[_0xd4cf('0x2e')]]={'$like':'%'+_0xd08f38[_0xd4cf('0x2f')][_0xd4cf('0x3b')]+'%'};return _0x4aeaa8;}})});}_0x2459f4=_[_0xd4cf('0x3c')]({},_0x2459f4,_0xd08f38[_0xd4cf('0x3d')]);var _0x17a8ee={'where':_0x2459f4[_0xd4cf('0x3a')]};return db[_0xd4cf('0x2b')]['count'](_0x17a8ee)['then'](function(_0x52fa6b){_0x45943d[_0xd4cf('0x1e')]=_0x52fa6b;if(_0xd08f38['query'][_0xd4cf('0x3e')]){_0x2459f4[_0xd4cf('0x3f')]=[{'all':!![]}];}return db[_0xd4cf('0x2b')]['findAll'](_0x2459f4);})[_0xd4cf('0x25')](function(_0x1ee4e2){_0x45943d['rows']=_0x1ee4e2;return _0x45943d;})[_0xd4cf('0x25')](respondWithFilteredResult(_0xa9ae56,_0x2459f4))['catch'](handleError(_0xa9ae56,null));};exports[_0xd4cf('0x40')]=function(_0x4b6da5,_0x4541db){var _0x476b2d={'raw':!![],'where':{'id':_0x4b6da5['params']['id']}},_0x4b874e={};_0x4b874e['model']=_[_0xd4cf('0x30')](db[_0xd4cf('0x2b')][_0xd4cf('0x41')]);_0x4b874e[_0xd4cf('0x2f')]=_[_0xd4cf('0x30')](_0x4b6da5[_0xd4cf('0x2f')]);_0x4b874e['filters']=_[_0xd4cf('0x32')](_0x4b874e[_0xd4cf('0x33')],_0x4b874e[_0xd4cf('0x2f')]);_0x476b2d[_0xd4cf('0x34')]=_['intersection'](_0x4b874e[_0xd4cf('0x33')],qs['fields'](_0x4b6da5[_0xd4cf('0x2f')][_0xd4cf('0x35')]));_0x476b2d['attributes']=_0x476b2d['attributes'][_0xd4cf('0x36')]?_0x476b2d[_0xd4cf('0x34')]:_0x4b874e['model'];if(_0x4b6da5[_0xd4cf('0x2f')][_0xd4cf('0x3e')]){_0x476b2d[_0xd4cf('0x3f')]=[{'all':!![]}];}_0x476b2d=_[_0xd4cf('0x3c')]({},_0x476b2d,_0x4b6da5[_0xd4cf('0x3d')]);return db['DeskField'][_0xd4cf('0x42')](_0x476b2d)[_0xd4cf('0x25')](handleEntityNotFound(_0x4541db,null))[_0xd4cf('0x25')](respondWithResult(_0x4541db,null))[_0xd4cf('0x43')](handleError(_0x4541db,null));};exports[_0xd4cf('0x44')]=function(_0x1a547a,_0x55504f){return db[_0xd4cf('0x2b')][_0xd4cf('0x44')](_0x1a547a[_0xd4cf('0x45')],{})[_0xd4cf('0x25')](respondWithResult(_0x55504f,0xc9))[_0xd4cf('0x43')](handleError(_0x55504f,null));};exports[_0xd4cf('0x24')]=function(_0x14af9f,_0x532c7b){if(_0x14af9f[_0xd4cf('0x45')]['id']){delete _0x14af9f[_0xd4cf('0x45')]['id'];}return db[_0xd4cf('0x2b')][_0xd4cf('0x42')]({'where':{'id':_0x14af9f['params']['id']}})[_0xd4cf('0x25')](handleEntityNotFound(_0x532c7b,null))[_0xd4cf('0x25')](saveUpdates(_0x14af9f[_0xd4cf('0x45')],null))[_0xd4cf('0x25')](respondWithResult(_0x532c7b,null))[_0xd4cf('0x43')](handleError(_0x532c7b,null));};exports[_0xd4cf('0x46')]=function(_0xe69dbf,_0x4fd5e0){return db['DeskField']['find']({'where':{'id':_0xe69dbf[_0xd4cf('0x47')]['id']}})[_0xd4cf('0x25')](handleEntityNotFound(_0x4fd5e0,null))[_0xd4cf('0x25')](removeEntity(_0x4fd5e0,null))[_0xd4cf('0x43')](handleError(_0x4fd5e0,null));};
\ No newline at end of file
index dede45e..01ac42c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0c5=['bluebird','request-promise','path','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','moment'];(function(_0x5b4451,_0x1600ff){var _0x141772=function(_0x5ba8cf){while(--_0x5ba8cf){_0x5b4451['push'](_0x5b4451['shift']());}};_0x141772(++_0x1600ff);}(_0xa0c5,0x81));var _0x5a0c=function(_0x8144bb,_0x14ade0){_0x8144bb=_0x8144bb-0x0;var _0x551630=_0xa0c5[_0x8144bb];return _0x551630;};'use strict';var _=require('lodash');var util=require(_0x5a0c('0x0'));var logger=require(_0x5a0c('0x1'))('api');var moment=require(_0x5a0c('0x2'));var BPromise=require(_0x5a0c('0x3'));var rp=require(_0x5a0c('0x4'));var fs=require('fs');var path=require(_0x5a0c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x5a0c('0x6')]=function(_0x83a158,_0x529c9e){return _0x83a158[_0x5a0c('0x7')]('DeskField',attributes,{'tableName':_0x5a0c('0x8'),'paranoid':![],'indexes':[{'name':_0x5a0c('0x9'),'fields':[_0x5a0c('0xa'),_0x5a0c('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe98f=['idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./intDeskField.attributes','exports','define','DeskField','desk_unique_index'];(function(_0x1a663e,_0x357c47){var _0x4055ab=function(_0x3deb3c){while(--_0x3deb3c){_0x1a663e['push'](_0x1a663e['shift']());}};_0x4055ab(++_0x357c47);}(_0xe98f,0x1af));var _0xfe98=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe98f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xfe98('0x0'));var util=require(_0xfe98('0x1'));var logger=require(_0xfe98('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfe98('0x3'));var rp=require(_0xfe98('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe98('0x5'));var config=require('../../config/environment');var attributes=require(_0xfe98('0x6'));module[_0xfe98('0x7')]=function(_0x17d567,_0x6e73d3){return _0x17d567[_0xfe98('0x8')](_0xfe98('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xfe98('0xa'),'fields':[_0xfe98('0xb'),_0xfe98('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c6f915c..5c01c7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb457=['request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x501a94,_0x2c2ce7){var _0x22d42c=function(_0x5dc0cd){while(--_0x5dc0cd){_0x501a94['push'](_0x501a94['shift']());}};_0x22d42c(++_0x2c2ce7);}(_0xb457,0x1ad));var _0x7b45=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0xb457[_0xcf4569];return _0x7fef;};'use strict';var _=require(_0x7b45('0x0'));var util=require(_0x7b45('0x1'));var moment=require(_0x7b45('0x2'));var BPromise=require(_0x7b45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b45('0x4'));var db=require(_0x7b45('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b45('0x6'))(_0x7b45('0x7'));var config=require(_0x7b45('0x8'));var jayson=require(_0x7b45('0x9'));var client=jayson[_0x7b45('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34bdad,_0x3253a0,_0x632eec){return new BPromise(function(_0x445e9d,_0x242e19){return client[_0x7b45('0xb')](_0x34bdad,_0x632eec)[_0x7b45('0xc')](function(_0x37ee19){logger[_0x7b45('0xd')](_0x7b45('0xe'),_0x3253a0,_0x7b45('0xf'));logger['debug'](_0x7b45('0x10'),_0x3253a0,_0x7b45('0xf'),JSON[_0x7b45('0x11')](_0x37ee19));if(_0x37ee19[_0x7b45('0x12')]){if(_0x37ee19['error']['code']===0x1f4){logger[_0x7b45('0x12')](_0x7b45('0xe'),_0x3253a0,_0x37ee19[_0x7b45('0x12')]['message']);return _0x242e19(_0x37ee19[_0x7b45('0x12')]['message']);}logger['error']('DeskField,\x20%s,\x20%s',_0x3253a0,_0x37ee19[_0x7b45('0x12')][_0x7b45('0x13')]);return _0x445e9d(_0x37ee19[_0x7b45('0x12')][_0x7b45('0x13')]);}else{logger[_0x7b45('0xd')](_0x7b45('0xe'),_0x3253a0,'request\x20sent');_0x445e9d(_0x37ee19[_0x7b45('0x14')][_0x7b45('0x13')]);}})[_0x7b45('0x15')](function(_0x175831){logger[_0x7b45('0x12')]('DeskField,\x20%s,\x20%s',_0x3253a0,_0x175831);_0x242e19(_0x175831);});});}
\ No newline at end of file
+var _0xa385=['../../config/environment','client','http','request','then','info','request\x20sent','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa385,0x13e));var _0x5a38=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xa385[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x5a38('0x0'));var util=require('util');var moment=require(_0x5a38('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a38('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a38('0x3'))['db'];var utils=require(_0x5a38('0x4'));var logger=require('../../config/logger')(_0x5a38('0x5'));var config=require(_0x5a38('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5a38('0x7')][_0x5a38('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcf6b29,_0x4e454f,_0x194ab5){return new BPromise(function(_0x480f5c,_0x5d658e){return client[_0x5a38('0x9')](_0xcf6b29,_0x194ab5)[_0x5a38('0xa')](function(_0xfc3c64){logger[_0x5a38('0xb')]('DeskField,\x20%s,\x20%s',_0x4e454f,_0x5a38('0xc'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x4e454f,'request\x20sent',JSON['stringify'](_0xfc3c64));if(_0xfc3c64['error']){if(_0xfc3c64[_0x5a38('0xd')][_0x5a38('0xe')]===0x1f4){logger[_0x5a38('0xd')](_0x5a38('0xf'),_0x4e454f,_0xfc3c64[_0x5a38('0xd')][_0x5a38('0x10')]);return _0x5d658e(_0xfc3c64[_0x5a38('0xd')][_0x5a38('0x10')]);}logger[_0x5a38('0xd')](_0x5a38('0xf'),_0x4e454f,_0xfc3c64[_0x5a38('0xd')][_0x5a38('0x10')]);return _0x480f5c(_0xfc3c64['error']['message']);}else{logger[_0x5a38('0xb')](_0x5a38('0xf'),_0x4e454f,_0x5a38('0xc'));_0x480f5c(_0xfc3c64['result'][_0x5a38('0x10')]);}})[_0x5a38('0x11')](function(_0x1db651){logger[_0x5a38('0xd')](_0x5a38('0xf'),_0x4e454f,_0x1db651);_0x5d658e(_0x1db651);});});}
\ No newline at end of file
index 6f10cb8..baa8523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78ea=['put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','create','/:id/configurations'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x78ea,0xa5));var _0xa78e=function(_0x127364,_0x591295){_0x127364=_0x127364-0x0;var _0x12c89a=_0x78ea[_0x127364];return _0x12c89a;};'use strict';var multer=require(_0xa78e('0x0'));var util=require(_0xa78e('0x1'));var path=require(_0xa78e('0x2'));var timeout=require(_0xa78e('0x3'));var express=require('express');var router=express[_0xa78e('0x4')]();var fs_extra=require(_0xa78e('0x5'));var auth=require(_0xa78e('0x6'));var interaction=require(_0xa78e('0x7'));var config=require(_0xa78e('0x8'));var controller=require(_0xa78e('0x9'));router[_0xa78e('0xa')]('/',auth[_0xa78e('0xb')](),controller[_0xa78e('0xc')]);router[_0xa78e('0xa')](_0xa78e('0xd'),auth[_0xa78e('0xb')](),controller[_0xa78e('0xe')]);router[_0xa78e('0xa')]('/:id/configurations',auth[_0xa78e('0xb')](),controller['getConfigurations']);router['get'](_0xa78e('0xf'),auth[_0xa78e('0xb')](),controller[_0xa78e('0x10')]);router['post']('/',auth[_0xa78e('0xb')](),controller[_0xa78e('0x11')]);router['post'](_0xa78e('0x12'),auth[_0xa78e('0xb')](),controller['addConfiguration']);router[_0xa78e('0x13')]('/:id',auth[_0xa78e('0xb')](),controller['update']);router[_0xa78e('0x14')](_0xa78e('0xd'),auth[_0xa78e('0xb')](),controller[_0xa78e('0x15')]);module[_0xa78e('0x16')]=router;
\ No newline at end of file
+var _0xdb2b=['isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','./intDynamics365Account.controller','get'];(function(_0x4e17aa,_0x4a59c2){var _0xd49c3f=function(_0x5e2209){while(--_0x5e2209){_0x4e17aa['push'](_0x4e17aa['shift']());}};_0xd49c3f(++_0x4a59c2);}(_0xdb2b,0x86));var _0xbdb2=function(_0x132889,_0x2207a8){_0x132889=_0x132889-0x0;var _0xd93752=_0xdb2b[_0x132889];return _0xd93752;};'use strict';var multer=require(_0xbdb2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbdb2('0x1'));var express=require(_0xbdb2('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbdb2('0x3'));var config=require('../../config/environment');var controller=require(_0xbdb2('0x4'));router[_0xbdb2('0x5')]('/',auth[_0xbdb2('0x6')](),controller[_0xbdb2('0x7')]);router[_0xbdb2('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xbdb2('0x8')]);router[_0xbdb2('0x5')](_0xbdb2('0x9'),auth[_0xbdb2('0x6')](),controller[_0xbdb2('0xa')]);router[_0xbdb2('0x5')]('/:id/fields',auth[_0xbdb2('0x6')](),controller[_0xbdb2('0xb')]);router[_0xbdb2('0xc')]('/',auth['isAuthenticated'](),controller[_0xbdb2('0xd')]);router['post'](_0xbdb2('0x9'),auth[_0xbdb2('0x6')](),controller[_0xbdb2('0xe')]);router[_0xbdb2('0xf')](_0xbdb2('0x10'),auth[_0xbdb2('0x6')](),controller[_0xbdb2('0x11')]);router['delete'](_0xbdb2('0x10'),auth[_0xbdb2('0x6')](),controller[_0xbdb2('0x12')]);module[_0xbdb2('0x13')]=router;
\ No newline at end of file
index 367944e..2a0f9d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0960=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0x0960,0xc2));var _0x0096=function(_0x500ae,_0x4bd1a0){_0x500ae=_0x500ae-0x0;var _0x2997cc=_0x0960[_0x500ae];return _0x2997cc;};'use strict';var Sequelize=require(_0x0096('0x0'));module[_0x0096('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0096('0x2')]},'password':{'type':Sequelize[_0x0096('0x2')]},'remoteUri':{'type':Sequelize[_0x0096('0x2')]},'tenantId':{'type':Sequelize[_0x0096('0x2')]},'clientId':{'type':Sequelize[_0x0096('0x2')]},'clientSecret':{'type':Sequelize[_0x0096('0x2')]},'serverUrl':{'type':Sequelize[_0x0096('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0096('0x2')]},'modernAuthentication':{'type':Sequelize[_0x0096('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x26d1=['BOOLEAN','sequelize','STRING'];(function(_0x4de877,_0x340170){var _0xb2cfeb=function(_0x488634){while(--_0x488634){_0x4de877['push'](_0x4de877['shift']());}};_0xb2cfeb(++_0x340170);}(_0x26d1,0x8e));var _0x126d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x26d1[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x126d('0x0'));module['exports']={'name':{'type':Sequelize[_0x126d('0x1')]},'username':{'type':Sequelize[_0x126d('0x1')]},'password':{'type':Sequelize[_0x126d('0x1')]},'remoteUri':{'type':Sequelize[_0x126d('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x126d('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x126d('0x1')]},'modernAuthentication':{'type':Sequelize[_0x126d('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index bc27266..a92745e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9956=['remoteUri','tenantId','clientId','clientSecret','CloudProvider','data5','data7','modernAuthentication','access_token','POST','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','request-promise','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','count','Content-Range','update','sendStatus','error','stack','name','index','map','Dynamics365Account','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','rows','catch','show','params','options','find','create','body','findOne','Dynamics365Configuration','getConfigurations','addConfiguration','AccountId','getSubjects','channel','type','Descriptions','getDescriptions','Subjects','Dynamics365Field','slice','format','%s/api/data/v9.0/','ticketType','incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password'];(function(_0x5dac60,_0x2a3533){var _0x4ffd5c=function(_0x101189){while(--_0x101189){_0x5dac60['push'](_0x5dac60['shift']());}};_0x4ffd5c(++_0x2a3533);}(_0x9956,0x1b6));var _0x6995=function(_0x13367e,_0x49fabd){_0x13367e=_0x13367e-0x0;var _0xca1a63=_0x9956[_0x13367e];return _0xca1a63;};'use strict';var rp=require(_0x6995('0x0'));var util=require('util');var _=require(_0x6995('0x1'));var qs=require(_0x6995('0x2'));var logger=require(_0x6995('0x3'))('api');var db=require(_0x6995('0x4'))['db'];var integrations=require(_0x6995('0x5'));function respondWithResult(_0x525f31,_0x362c14){_0x362c14=_0x362c14||0xc8;return function(_0x5637cd){if(_0x5637cd){return _0x525f31[_0x6995('0x6')](_0x362c14)['json'](_0x5637cd);}};}function respondWithFilteredResult(_0x521a48,_0x2a74a8){return function(_0x505870){if(_0x505870){var _0x488f9e=typeof _0x2a74a8[_0x6995('0x7')]==='undefined'&&typeof _0x2a74a8['limit']===_0x6995('0x8');var _0x44f906=_0x505870[_0x6995('0x9')];var _0x1e59c5=_0x488f9e?0x0:_0x2a74a8['offset'];var _0x1c7587=_0x488f9e?_0x505870[_0x6995('0x9')]:_0x2a74a8['offset']+_0x2a74a8['limit'];var _0xffb2da;if(_0x1c7587>=_0x44f906){_0x1c7587=_0x44f906;_0xffb2da=0xc8;}else{_0xffb2da=0xce;}_0x521a48[_0x6995('0x6')](_0xffb2da);return _0x521a48['set'](_0x6995('0xa'),_0x1e59c5+'-'+_0x1c7587+'/'+_0x44f906)['json'](_0x505870);}return null;};}function saveUpdates(_0x265980){return function(_0x2d3807){if(_0x2d3807){return _0x2d3807[_0x6995('0xb')](_0x265980)['then'](function(_0x8797b0){return _0x8797b0;});}return null;};}function removeEntity(_0x595d0d){return function(_0x2ad985){if(_0x2ad985){return _0x2ad985['destroy']()['then'](function(){_0x595d0d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x235584){return function(_0x31059e){if(!_0x31059e){_0x235584[_0x6995('0xc')](0x194);}return _0x31059e;};}function handleError(_0x54cac1,_0x384ef2){_0x384ef2=_0x384ef2||0x1f4;return function(_0xd9b98c){logger[_0x6995('0xd')](_0xd9b98c[_0x6995('0xe')]);if(_0xd9b98c[_0x6995('0xf')]){delete _0xd9b98c[_0x6995('0xf')];}_0x54cac1[_0x6995('0x6')](_0x384ef2)['send'](_0xd9b98c);};}exports[_0x6995('0x10')]=function(_0x1859fe,_0x2e4d55){var _0x2f8c95={},_0x4f3cd1={},_0x3b1bbe={'count':0x0,'rows':[]};var _0x2bf012=_[_0x6995('0x11')](db[_0x6995('0x12')][_0x6995('0x13')],function(_0x2c3bd8){return{'name':_0x2c3bd8['fieldName'],'type':_0x2c3bd8['type'][_0x6995('0x14')]};});_0x4f3cd1[_0x6995('0x15')]=_[_0x6995('0x11')](_0x2bf012,_0x6995('0xf'));_0x4f3cd1[_0x6995('0x16')]=_[_0x6995('0x17')](_0x1859fe[_0x6995('0x16')]);_0x4f3cd1[_0x6995('0x18')]=_[_0x6995('0x19')](_0x4f3cd1[_0x6995('0x15')],_0x4f3cd1[_0x6995('0x16')]);_0x2f8c95[_0x6995('0x1a')]=_[_0x6995('0x19')](_0x4f3cd1[_0x6995('0x15')],qs[_0x6995('0x1b')](_0x1859fe[_0x6995('0x16')][_0x6995('0x1b')]));_0x2f8c95[_0x6995('0x1a')]=_0x2f8c95['attributes'][_0x6995('0x1c')]?_0x2f8c95['attributes']:_0x4f3cd1[_0x6995('0x15')];if(!_0x1859fe[_0x6995('0x16')][_0x6995('0x1d')](_0x6995('0x1e'))){_0x2f8c95[_0x6995('0x1f')]=qs['limit'](_0x1859fe[_0x6995('0x16')][_0x6995('0x1f')]);_0x2f8c95['offset']=qs['offset'](_0x1859fe[_0x6995('0x16')]['offset']);}_0x2f8c95[_0x6995('0x20')]=qs[_0x6995('0x21')](_0x1859fe[_0x6995('0x16')][_0x6995('0x21')]);_0x2f8c95[_0x6995('0x22')]=qs[_0x6995('0x18')](_[_0x6995('0x23')](_0x1859fe[_0x6995('0x16')],_0x4f3cd1[_0x6995('0x18')]),_0x2bf012);if(_0x1859fe[_0x6995('0x16')][_0x6995('0x24')]){_0x2f8c95[_0x6995('0x22')]=_[_0x6995('0x25')](_0x2f8c95[_0x6995('0x22')],{'$or':_['map'](_0x2bf012,function(_0x307580){if(_0x307580['type']!==_0x6995('0x26')){var _0x27e82a={};_0x27e82a[_0x307580['name']]={'$like':'%'+_0x1859fe[_0x6995('0x16')][_0x6995('0x24')]+'%'};return _0x27e82a;}})});}_0x2f8c95=_[_0x6995('0x25')]({},_0x2f8c95,_0x1859fe['options']);var _0x331375={'where':_0x2f8c95[_0x6995('0x22')]};return db[_0x6995('0x12')]['count'](_0x331375)[_0x6995('0x27')](function(_0x533349){_0x3b1bbe['count']=_0x533349;if(_0x1859fe[_0x6995('0x16')][_0x6995('0x28')]){_0x2f8c95[_0x6995('0x29')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x2f8c95);})['then'](function(_0x54dc48){_0x3b1bbe[_0x6995('0x2a')]=_0x54dc48;return _0x3b1bbe;})[_0x6995('0x27')](respondWithFilteredResult(_0x2e4d55,_0x2f8c95))[_0x6995('0x2b')](handleError(_0x2e4d55,null));};exports[_0x6995('0x2c')]=function(_0xfac74b,_0x5cec7c){var _0xc49bf3={'raw':![],'where':{'id':_0xfac74b[_0x6995('0x2d')]['id']}},_0x27efe8={};_0x27efe8[_0x6995('0x15')]=_['keys'](db['Dynamics365Account'][_0x6995('0x13')]);_0x27efe8[_0x6995('0x16')]=_[_0x6995('0x17')](_0xfac74b['query']);_0x27efe8[_0x6995('0x18')]=_[_0x6995('0x19')](_0x27efe8[_0x6995('0x15')],_0x27efe8[_0x6995('0x16')]);_0xc49bf3[_0x6995('0x1a')]=_[_0x6995('0x19')](_0x27efe8[_0x6995('0x15')],qs[_0x6995('0x1b')](_0xfac74b[_0x6995('0x16')][_0x6995('0x1b')]));_0xc49bf3['attributes']=_0xc49bf3[_0x6995('0x1a')][_0x6995('0x1c')]?_0xc49bf3['attributes']:_0x27efe8['model'];if(_0xfac74b[_0x6995('0x16')][_0x6995('0x28')]){_0xc49bf3['include']=[{'all':!![]}];}_0xc49bf3=_['merge']({},_0xc49bf3,_0xfac74b[_0x6995('0x2e')]);return db[_0x6995('0x12')][_0x6995('0x2f')](_0xc49bf3)[_0x6995('0x27')](handleEntityNotFound(_0x5cec7c,null))[_0x6995('0x27')](respondWithResult(_0x5cec7c,null))[_0x6995('0x2b')](handleError(_0x5cec7c,null));};exports[_0x6995('0x30')]=function(_0x903fb8,_0x4cf7b9){return db[_0x6995('0x12')][_0x6995('0x30')](_0x903fb8['body'],{})['then'](respondWithResult(_0x4cf7b9,0xc9))[_0x6995('0x2b')](handleError(_0x4cf7b9,null));};exports[_0x6995('0xb')]=function(_0x4e3989,_0x3992a5){if(_0x4e3989[_0x6995('0x31')]['id']){delete _0x4e3989[_0x6995('0x31')]['id'];}return db[_0x6995('0x12')]['find']({'where':{'id':_0x4e3989['params']['id']}})['then'](handleEntityNotFound(_0x3992a5,null))[_0x6995('0x27')](saveUpdates(_0x4e3989[_0x6995('0x31')],null))[_0x6995('0x27')](respondWithResult(_0x3992a5,null))[_0x6995('0x2b')](handleError(_0x3992a5,null));};exports['destroy']=function(_0x4e52b0,_0x17ee42){return db[_0x6995('0x12')][_0x6995('0x2f')]({'where':{'id':_0x4e52b0['params']['id']}})[_0x6995('0x27')](handleEntityNotFound(_0x17ee42,null))[_0x6995('0x27')](removeEntity(_0x17ee42,null))[_0x6995('0x2b')](handleError(_0x17ee42,null));};exports['getConfigurations']=function(_0x3e00b5,_0x3b5d7a){var _0x1352e3={};var _0x466fe3={};var _0xa6831c;var _0x27bb1c;return db[_0x6995('0x12')][_0x6995('0x32')]({'where':{'id':_0x3e00b5[_0x6995('0x2d')]['id']}})[_0x6995('0x27')](handleEntityNotFound(_0x3b5d7a,null))[_0x6995('0x27')](function(_0x2ce335){if(_0x2ce335){_0xa6831c=_0x2ce335;_0x466fe3[_0x6995('0x15')]=_[_0x6995('0x17')](db[_0x6995('0x33')][_0x6995('0x13')]);_0x466fe3['query']=_['keys'](_0x3e00b5[_0x6995('0x16')]);_0x466fe3[_0x6995('0x18')]=_[_0x6995('0x19')](_0x466fe3['model'],_0x466fe3[_0x6995('0x16')]);_0x1352e3[_0x6995('0x1a')]=_['intersection'](_0x466fe3[_0x6995('0x15')],qs['fields'](_0x3e00b5[_0x6995('0x16')][_0x6995('0x1b')]));_0x1352e3[_0x6995('0x1a')]=_0x1352e3[_0x6995('0x1a')][_0x6995('0x1c')]?_0x1352e3[_0x6995('0x1a')]:_0x466fe3['model'];_0x1352e3[_0x6995('0x20')]=qs[_0x6995('0x21')](_0x3e00b5[_0x6995('0x16')][_0x6995('0x21')]);_0x1352e3[_0x6995('0x22')]=qs[_0x6995('0x18')](_[_0x6995('0x23')](_0x3e00b5[_0x6995('0x16')],_0x466fe3[_0x6995('0x18')]));if(_0x3e00b5[_0x6995('0x16')][_0x6995('0x24')]){_0x1352e3['where']=_[_0x6995('0x25')](_0x1352e3['where'],{'$or':_[_0x6995('0x11')](_0x1352e3['attributes'],function(_0x3e7cff){var _0x494b85={};_0x494b85[_0x3e7cff]={'$like':'%'+_0x3e00b5[_0x6995('0x16')][_0x6995('0x24')]+'%'};return _0x494b85;})});}_0x1352e3=_['merge']({},_0x1352e3,_0x3e00b5['options']);return _0xa6831c['getConfigurations'](_0x1352e3);}})['then'](function(_0x50d791){if(_0x50d791){_0x27bb1c=_0x50d791['length'];if(!_0x3e00b5[_0x6995('0x16')][_0x6995('0x1d')]('nolimit')){_0x1352e3[_0x6995('0x1f')]=qs['limit'](_0x3e00b5['query']['limit']);_0x1352e3[_0x6995('0x7')]=qs[_0x6995('0x7')](_0x3e00b5[_0x6995('0x16')][_0x6995('0x7')]);}return _0xa6831c[_0x6995('0x34')](_0x1352e3);}})[_0x6995('0x27')](function(_0x24d57b){if(_0x24d57b){return _0x24d57b?{'count':_0x27bb1c,'rows':_0x24d57b}:null;}})['then'](respondWithResult(_0x3b5d7a,null))['catch'](handleError(_0x3b5d7a,null));};exports[_0x6995('0x35')]=function(_0x320123,_0x3dde94){if(_0x320123[_0x6995('0x31')]['id']){delete _0x320123[_0x6995('0x31')]['id'];}return db[_0x6995('0x12')]['findOne']({'where':{'id':_0x320123[_0x6995('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3dde94,null))[_0x6995('0x27')](function(_0x37b44c){if(_0x37b44c){_0x320123[_0x6995('0x31')][_0x6995('0x36')]=_0x37b44c['id'];_0x320123[_0x6995('0x31')]['Subjects']=integrations[_0x6995('0x37')](_0x320123[_0x6995('0x31')][_0x6995('0x38')],_0x320123[_0x6995('0x31')][_0x6995('0x39')]);_0x320123[_0x6995('0x31')][_0x6995('0x3a')]=integrations[_0x6995('0x3b')](_0x320123['body'][_0x6995('0x38')],_0x320123['body'][_0x6995('0x39')]);return db[_0x6995('0x33')][_0x6995('0x30')](_0x320123['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x6995('0x3c')},{'model':db[_0x6995('0x3d')],'as':'Descriptions'}]});}return null;})[_0x6995('0x27')](respondWithResult(_0x3dde94,null))[_0x6995('0x2b')](handleError(_0x3dde94,null));};function sanitizeRemoteUri(_0x555d81){var _0x25e2b0=_0x555d81[_0x6995('0x3e')](-0x1);if(_0x25e2b0==='/')return _0x555d81['substring'](0x0,_0x555d81['lastIndexOf'](_0x25e2b0));return _0x555d81;}function getWebApiUrl(_0x365446){return util[_0x6995('0x3f')](_0x6995('0x40'),_0x365446);}exports['getFields']=function(_0xe955d3,_0x56885d){var _0x46b82c=_0xe955d3['query'][_0x6995('0x41')];var _0x472c91=_0x46b82c===_0x6995('0x42')?'Incident':_0x6995('0x43');var _0x3a3bc9='';var _0x59b14f='';var _0x4bda2a='';var _0x4a0865='';var _0x1a0ef4='';var _0x4dec95='';var _0x452e9c='';var _0x5256fa='';var _0x5630fc=['title',_0x6995('0x44'),_0x6995('0x45'),_0x6995('0x46'),_0x6995('0x47'),_0x6995('0x48'),_0x6995('0x49'),_0x6995('0x4a'),_0x6995('0x4b'),_0x6995('0x4c')];var _0x17fbc2=['accountidname',_0x6995('0x4d'),_0x6995('0x4e'),'billedserviceunits',_0x6995('0x4f'),_0x6995('0x50'),'contractdetailidname',_0x6995('0x51'),_0x6995('0x52'),_0x6995('0x53'),_0x6995('0x54'),_0x6995('0x55'),'createdon',_0x6995('0x56'),'createdonbehalfbyyominame','customeridname',_0x6995('0x57'),_0x6995('0x58'),_0x6995('0x59'),_0x6995('0x5a'),'entityimage_timestamp',_0x6995('0x5b'),_0x6995('0x5c'),_0x6995('0x5d'),'firstresponsebykpiidname',_0x6995('0x5e'),_0x6995('0x5f'),'influencescore',_0x6995('0x60'),'lastonholdtime',_0x6995('0x61'),_0x6995('0x62'),_0x6995('0x63'),_0x6995('0x64'),_0x6995('0x65'),_0x6995('0x66'),'modifiedonbehalfbyname',_0x6995('0x67'),_0x6995('0x68'),_0x6995('0x69'),_0x6995('0x6a'),'onholdtime',_0x6995('0x6b'),_0x6995('0x6c'),_0x6995('0x6d'),_0x6995('0x6e'),'parentcaseidname','primarycontactidname',_0x6995('0x6f'),'prioritycodename',_0x6995('0x70'),_0x6995('0x71'),_0x6995('0x72'),_0x6995('0x73'),_0x6995('0x74'),_0x6995('0x75'),_0x6995('0x76'),_0x6995('0x77'),_0x6995('0x78'),_0x6995('0x79'),_0x6995('0x7a'),_0x6995('0x7b'),_0x6995('0x7c'),_0x6995('0x7d'),_0x6995('0x7e'),_0x6995('0x7f'),_0x6995('0x80'),_0x6995('0x81'),_0x6995('0x82'),_0x6995('0x83')];var _0xfbc90d=_0x5630fc[_0x6995('0x84')](_0x17fbc2);return db[_0x6995('0x12')]['findOne']({'where':{'id':_0xe955d3['params']['id']},'attributes':['id',_0x6995('0x85'),_0x6995('0x86'),_0x6995('0x87'),_0x6995('0x88'),_0x6995('0x89'),_0x6995('0x8a'),'modernAuthentication'],'include':[{'model':db[_0x6995('0x8b')],'as':_0x6995('0x8b'),'attributes':['id',_0x6995('0x8c'),_0x6995('0x8d')]}]})[_0x6995('0x27')](handleEntityNotFound(_0x56885d,null))['then'](function(_0x38dd69){if(_0x38dd69){if(_0x38dd69[_0x6995('0x8e')]){_0x38dd69[_0x6995('0x8f')]=_0x38dd69[_0x6995('0x8b')][_0x6995('0x8c')];_0x5256fa=sanitizeRemoteUri(_0x38dd69['CloudProvider'][_0x6995('0x8d')]);_0x452e9c=getWebApiUrl(_0x5256fa);return _0x38dd69;}_0x5256fa=sanitizeRemoteUri(_0x38dd69[_0x6995('0x87')]);_0x452e9c=getWebApiUrl(_0x5256fa);var _0x51e521={'method':_0x6995('0x90'),'uri':'https://login.microsoftonline.com/'+_0x38dd69[_0x6995('0x88')]+_0x6995('0x91'),'form':{'client_id':_0x38dd69[_0x6995('0x89')],'resource':_0x5256fa,'username':_0x38dd69[_0x6995('0x85')],'password':_0x38dd69[_0x6995('0x86')],'grant_type':_0x6995('0x86'),'client_secret':_0x38dd69['clientSecret']},'json':!![]};return rp(_0x51e521);}})['then'](function(_0x21434e){_0x4dec95=_0x21434e[_0x6995('0x8f')];var _0x1627c2={'method':_0x6995('0x92'),'uri':encodeURI(_0x452e9c+_0x6995('0x93')+_0x472c91+'\x27'),'headers':{'Authorization':_0x6995('0x94')+_0x4dec95,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1627c2);})['then'](function(_0x1a84c1){var _0x624ce7=_0x1a84c1[_0x6995('0x95')][0x0];var _0x443b08=_0x624ce7[_0x6995('0x96')];var _0x3316a3={'method':_0x6995('0x92'),'uri':_0x452e9c+_0x6995('0x97')+_0x443b08+_0x6995('0x98'),'headers':{'Authorization':_0x6995('0x94')+_0x4dec95,'If-None-Match':null,'OData-Version':_0x6995('0x99')},'json':!![]};return rp(_0x3316a3);})[_0x6995('0x27')](function(_0x23b5da){_0x3a3bc9=_0x23b5da;_0x59b14f=_0x3a3bc9[_0x6995('0x9a')];_0x59b14f=_[_0x6995('0x9b')](_0x59b14f,function(_0x581af5){return!_0xfbc90d[_0x6995('0x9c')](_0x581af5[_0x6995('0x9d')]);});var _0x41e40c=[];var _0x209961=[];_0x59b14f[_0x6995('0x9e')](function(_0x26b4d7){if(_0x26b4d7['@odata.type']){var _0x236a70=_0x26b4d7[_0x6995('0x9f')][_0x6995('0xa0')](_0x26b4d7[_0x6995('0x9f')][_0x6995('0xa1')]('.')+0x1);if(_0x236a70===_0x6995('0xa2')){_0x41e40c[_0x6995('0xa3')](getSelectList(_0x452e9c,_0x46b82c,_0x209961,_0x3a3bc9[_0x6995('0x96')],_0x26b4d7[_0x6995('0x96')],_0x4dec95));}}});return Promise[_0x6995('0xa4')](_0x41e40c);})[_0x6995('0x27')](function(_0x456882){_0x4bda2a=_0x456882[0x0];var _0x378d9d=[];var _0x4d545c=[];_0x59b14f[_0x6995('0x9e')](function(_0x4470fc){if(!_[_0x6995('0xa5')](_0x4470fc[_0x6995('0x9f')])){var _0x51a444=_0x4470fc['@odata.type'][_0x6995('0xa0')](_0x4470fc['@odata.type'][_0x6995('0xa1')]('.')+0x1);if(_0x51a444===_0x6995('0xa6')){_0x378d9d[_0x6995('0xa3')](getBooleanList(_0x452e9c,_0x46b82c,_0x4d545c,_0x3a3bc9[_0x6995('0x96')],_0x4470fc[_0x6995('0x96')],_0x4dec95));}}});return Promise[_0x6995('0xa4')](_0x378d9d);})[_0x6995('0x27')](function(_0x551bc7){_0x4a0865=_0x551bc7[0x0];var _0x132cf4=[];var _0xb456bf=[];_0x59b14f['forEach'](function(_0x8bc64b){if(_0x8bc64b['@odata.type']){var _0x1cd8f7=_0x8bc64b[_0x6995('0x9f')][_0x6995('0xa0')](_0x8bc64b[_0x6995('0x9f')]['lastIndexOf']('.')+0x1);if(_0x1cd8f7===_0x6995('0xa7')||_0x1cd8f7===_0x6995('0xa8')||_0x1cd8f7==='BigIntAttributeMetadata'||_0x1cd8f7==='IntegerAttributeMetadata'||_0x1cd8f7==='MemoAttributeMetadata'||_0x1cd8f7===_0x6995('0xa9')||_0x1cd8f7===_0x6995('0xaa')||_0x1cd8f7===_0x6995('0xab')||_0x1cd8f7===_0x6995('0xac')||_0x1cd8f7===_0x6995('0xad')){_0x132cf4['push'](getInputList(_0x452e9c,_0x46b82c,_0x1cd8f7,_0xb456bf,_0x3a3bc9['MetadataId'],_0x8bc64b[_0x6995('0x96')],_0x4dec95));}}});return Promise['all'](_0x132cf4);})[_0x6995('0x27')](function(_0x776b3a){_0x1a0ef4=_0x776b3a[0x0];var _0x4ecb77=_0x4bda2a[_0x6995('0x84')](_0x4a0865)[_0x6995('0x84')](_0x1a0ef4);var _0x49f73b={'count':_0x4ecb77[_0x6995('0x1c')],'rows':_0x4ecb77};return _0x49f73b;})['then'](respondWithResult(_0x56885d,null))[_0x6995('0x2b')](function(_0x1c9b11){var _0x308b17=_0xe955d3[_0x6995('0x16')]['test']?0x1f4:_0x1c9b11['statusCode']||0x1f4;logger[_0x6995('0xd')](_0x1c9b11[_0x6995('0xe')]);delete _0x1c9b11[_0x6995('0xf')];if(_0x308b17===0x191){_0x308b17=0x190;}_0x56885d[_0x6995('0x6')](_0x308b17)['send'](_0xe955d3[_0x6995('0x16')][_0x6995('0xae')]?{'message':'Wrong\x20credentials','statusCode':_0x1c9b11[_0x6995('0xaf')]}:_0x1c9b11);});};function getSelectList(_0x3a0e68,_0x4e1cee,_0x116536,_0x370659,_0x5a8a67,_0x1a41cc){var _0x455c3a={'method':_0x6995('0x92'),'uri':_0x3a0e68+_0x6995('0x97')+_0x370659+')/Attributes('+_0x5a8a67+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x6995('0xb0'),'headers':{'Authorization':_0x6995('0x94')+_0x1a41cc,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x455c3a)[_0x6995('0x27')](function(_0x5db077){var _0x35cdba=[];var _0x3e39d5=_0x5db077[_0x6995('0xb1')][_0x6995('0xb2')];_0x3e39d5[_0x6995('0x9e')](function(_0x54e745){_0x35cdba[_0x6995('0xa3')]({'name':_0x54e745[_0x6995('0xb3')][_0x6995('0xb4')]['Label'],'value':String(_0x54e745[_0x6995('0xb5')])});});var _0x168218={'id':_0x4e1cee+'_'+_0x5db077['LogicalName'],'name':_0x5db077['DisplayName'][_0x6995('0xb4')][_0x6995('0xb3')],'custom':![],'options':_0x35cdba};_0x116536[_0x6995('0xa3')](_0x168218);return _0x116536;});}function getBooleanList(_0x6314b5,_0x3cbcff,_0x4fc638,_0x109668,_0x2267e9,_0x2f4dc4){var _0x3bdc3e={'method':'GET','uri':_0x6314b5+_0x6995('0x97')+_0x109668+_0x6995('0xb6')+_0x2267e9+_0x6995('0xb7'),'headers':{'Authorization':_0x6995('0x94')+_0x2f4dc4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3bdc3e)[_0x6995('0x27')](function(_0x3b09b9){var _0x30ed64=[];_0x30ed64['push']({'name':_0x3b09b9[_0x6995('0xb1')][_0x6995('0xb8')][_0x6995('0xb3')][_0x6995('0xb4')][_0x6995('0xb3')],'value':_0x6995('0xb9')},{'name':_0x3b09b9['OptionSet'][_0x6995('0xba')][_0x6995('0xb3')][_0x6995('0xb4')][_0x6995('0xb3')],'value':_0x6995('0xbb')});var _0x2c8961={'id':_0x3cbcff+'_'+_0x3b09b9[_0x6995('0x9d')],'name':_0x3b09b9['DisplayName'][_0x6995('0xb4')][_0x6995('0xb3')],'custom':![],'options':_0x30ed64};_0x4fc638[_0x6995('0xa3')](_0x2c8961);return _0x4fc638;});}function getInputList(_0x2d0de1,_0x3e41bb,_0x540664,_0x8cb589,_0x487bd9,_0x14da53,_0x18dca8){var _0x1ae399={'method':_0x6995('0x92'),'uri':_0x2d0de1+'EntityDefinitions('+_0x487bd9+_0x6995('0xb6')+_0x14da53+_0x6995('0xbc')+_0x540664+_0x6995('0xbd'),'headers':{'Authorization':_0x6995('0x94')+_0x18dca8,'If-None-Match':null,'OData-Version':_0x6995('0x99')},'json':!![]};return rp(_0x1ae399)[_0x6995('0x27')](function(_0x55219d){var _0x4b3552={'id':_0x3e41bb+'_'+_0x55219d['LogicalName'],'name':_0x55219d[_0x6995('0xbe')]['UserLocalizedLabel']?_0x55219d['DisplayName']['UserLocalizedLabel'][_0x6995('0xb3')]:_0x55219d[_0x6995('0x9d')],'custom':![],'options':[]};_0x8cb589[_0x6995('0xa3')](_0x4b3552);return _0x8cb589;});}
\ No newline at end of file
+var _0x8fa1=['Dynamics365Account','type','model','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','getConfigurations','findOne','Dynamics365Configuration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statuscode','subjectidname','ticketnumber','traversedpath','utcconversiontimezonecode','username','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','POST','https://login.microsoftonline.com/','password','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','substring','PicklistAttributeMetadata','push','MetadataId','all','isNil','lastIndexOf','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','stack','Wrong\x20credentials','GET','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','LogicalName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','undefined','limit','offset','count','status','set','Content-Range','update','then','destroy','end','sendStatus','error','name','send','index'];(function(_0x49203b,_0x1274cd){var _0x20a438=function(_0x1fc4b8){while(--_0x1fc4b8){_0x49203b['push'](_0x49203b['shift']());}};_0x20a438(++_0x1274cd);}(_0x8fa1,0x15e));var _0x18fa=function(_0x3f42a9,_0x523c84){_0x3f42a9=_0x3f42a9-0x0;var _0x325141=_0x8fa1[_0x3f42a9];return _0x325141;};'use strict';var rp=require(_0x18fa('0x0'));var util=require('util');var _=require(_0x18fa('0x1'));var qs=require(_0x18fa('0x2'));var logger=require(_0x18fa('0x3'))(_0x18fa('0x4'));var db=require(_0x18fa('0x5'))['db'];var integrations=require(_0x18fa('0x6'));function respondWithResult(_0x279050,_0x23dd93){_0x23dd93=_0x23dd93||0xc8;return function(_0x487b7e){if(_0x487b7e){return _0x279050['status'](_0x23dd93)[_0x18fa('0x7')](_0x487b7e);}};}function respondWithFilteredResult(_0x403ed1,_0x229dc8){return function(_0x47b80e){if(_0x47b80e){var _0x3fcfe9=typeof _0x229dc8['offset']===_0x18fa('0x8')&&typeof _0x229dc8[_0x18fa('0x9')]===_0x18fa('0x8');var _0x5a5f20=_0x47b80e['count'];var _0x2cb908=_0x3fcfe9?0x0:_0x229dc8[_0x18fa('0xa')];var _0xcfb968=_0x3fcfe9?_0x47b80e[_0x18fa('0xb')]:_0x229dc8[_0x18fa('0xa')]+_0x229dc8[_0x18fa('0x9')];var _0x181868;if(_0xcfb968>=_0x5a5f20){_0xcfb968=_0x5a5f20;_0x181868=0xc8;}else{_0x181868=0xce;}_0x403ed1[_0x18fa('0xc')](_0x181868);return _0x403ed1[_0x18fa('0xd')](_0x18fa('0xe'),_0x2cb908+'-'+_0xcfb968+'/'+_0x5a5f20)[_0x18fa('0x7')](_0x47b80e);}return null;};}function saveUpdates(_0x1a8f54){return function(_0x3ec50a){if(_0x3ec50a){return _0x3ec50a[_0x18fa('0xf')](_0x1a8f54)[_0x18fa('0x10')](function(_0x48ebf9){return _0x48ebf9;});}return null;};}function removeEntity(_0x1b1381){return function(_0x511370){if(_0x511370){return _0x511370[_0x18fa('0x11')]()[_0x18fa('0x10')](function(){_0x1b1381[_0x18fa('0xc')](0xcc)[_0x18fa('0x12')]();});}};}function handleEntityNotFound(_0x1eb2f6){return function(_0x14b503){if(!_0x14b503){_0x1eb2f6[_0x18fa('0x13')](0x194);}return _0x14b503;};}function handleError(_0xdf4ed3,_0x18dbdf){_0x18dbdf=_0x18dbdf||0x1f4;return function(_0x5d9a8e){logger[_0x18fa('0x14')](_0x5d9a8e['stack']);if(_0x5d9a8e['name']){delete _0x5d9a8e[_0x18fa('0x15')];}_0xdf4ed3[_0x18fa('0xc')](_0x18dbdf)[_0x18fa('0x16')](_0x5d9a8e);};}exports[_0x18fa('0x17')]=function(_0x32cd13,_0x1f5d96){var _0x4ed0a3={},_0x359454={},_0x2cab1f={'count':0x0,'rows':[]};var _0x2be1ab=_['map'](db[_0x18fa('0x18')]['rawAttributes'],function(_0x588e26){return{'name':_0x588e26['fieldName'],'type':_0x588e26[_0x18fa('0x19')]['key']};});_0x359454[_0x18fa('0x1a')]=_['map'](_0x2be1ab,_0x18fa('0x15'));_0x359454['query']=_['keys'](_0x32cd13['query']);_0x359454[_0x18fa('0x1b')]=_[_0x18fa('0x1c')](_0x359454[_0x18fa('0x1a')],_0x359454['query']);_0x4ed0a3['attributes']=_[_0x18fa('0x1c')](_0x359454[_0x18fa('0x1a')],qs[_0x18fa('0x1d')](_0x32cd13[_0x18fa('0x1e')][_0x18fa('0x1d')]));_0x4ed0a3['attributes']=_0x4ed0a3[_0x18fa('0x1f')][_0x18fa('0x20')]?_0x4ed0a3[_0x18fa('0x1f')]:_0x359454['model'];if(!_0x32cd13[_0x18fa('0x1e')][_0x18fa('0x21')](_0x18fa('0x22'))){_0x4ed0a3[_0x18fa('0x9')]=qs['limit'](_0x32cd13[_0x18fa('0x1e')][_0x18fa('0x9')]);_0x4ed0a3[_0x18fa('0xa')]=qs[_0x18fa('0xa')](_0x32cd13['query']['offset']);}_0x4ed0a3[_0x18fa('0x23')]=qs[_0x18fa('0x24')](_0x32cd13[_0x18fa('0x1e')][_0x18fa('0x24')]);_0x4ed0a3[_0x18fa('0x25')]=qs['filters'](_[_0x18fa('0x26')](_0x32cd13[_0x18fa('0x1e')],_0x359454[_0x18fa('0x1b')]),_0x2be1ab);if(_0x32cd13[_0x18fa('0x1e')][_0x18fa('0x27')]){_0x4ed0a3[_0x18fa('0x25')]=_[_0x18fa('0x28')](_0x4ed0a3[_0x18fa('0x25')],{'$or':_[_0x18fa('0x29')](_0x2be1ab,function(_0x115892){if(_0x115892['type']!==_0x18fa('0x2a')){var _0x5b5577={};_0x5b5577[_0x115892[_0x18fa('0x15')]]={'$like':'%'+_0x32cd13[_0x18fa('0x1e')]['filter']+'%'};return _0x5b5577;}})});}_0x4ed0a3=_[_0x18fa('0x28')]({},_0x4ed0a3,_0x32cd13[_0x18fa('0x2b')]);var _0x3f29c6={'where':_0x4ed0a3[_0x18fa('0x25')]};return db['Dynamics365Account']['count'](_0x3f29c6)[_0x18fa('0x10')](function(_0x259bbf){_0x2cab1f[_0x18fa('0xb')]=_0x259bbf;if(_0x32cd13[_0x18fa('0x1e')][_0x18fa('0x2c')]){_0x4ed0a3[_0x18fa('0x2d')]=[{'all':!![]}];}return db[_0x18fa('0x18')]['findAll'](_0x4ed0a3);})['then'](function(_0x30f4b4){_0x2cab1f[_0x18fa('0x2e')]=_0x30f4b4;return _0x2cab1f;})['then'](respondWithFilteredResult(_0x1f5d96,_0x4ed0a3))[_0x18fa('0x2f')](handleError(_0x1f5d96,null));};exports[_0x18fa('0x30')]=function(_0x57d745,_0x25f80b){var _0x5c36fd={'raw':![],'where':{'id':_0x57d745[_0x18fa('0x31')]['id']}},_0x1d0e70={};_0x1d0e70['model']=_[_0x18fa('0x32')](db[_0x18fa('0x18')][_0x18fa('0x33')]);_0x1d0e70['query']=_[_0x18fa('0x32')](_0x57d745[_0x18fa('0x1e')]);_0x1d0e70[_0x18fa('0x1b')]=_['intersection'](_0x1d0e70[_0x18fa('0x1a')],_0x1d0e70['query']);_0x5c36fd['attributes']=_[_0x18fa('0x1c')](_0x1d0e70[_0x18fa('0x1a')],qs[_0x18fa('0x1d')](_0x57d745[_0x18fa('0x1e')][_0x18fa('0x1d')]));_0x5c36fd['attributes']=_0x5c36fd[_0x18fa('0x1f')][_0x18fa('0x20')]?_0x5c36fd[_0x18fa('0x1f')]:_0x1d0e70[_0x18fa('0x1a')];if(_0x57d745[_0x18fa('0x1e')][_0x18fa('0x2c')]){_0x5c36fd[_0x18fa('0x2d')]=[{'all':!![]}];}_0x5c36fd=_[_0x18fa('0x28')]({},_0x5c36fd,_0x57d745[_0x18fa('0x2b')]);return db['Dynamics365Account']['find'](_0x5c36fd)['then'](handleEntityNotFound(_0x25f80b,null))['then'](respondWithResult(_0x25f80b,null))['catch'](handleError(_0x25f80b,null));};exports[_0x18fa('0x34')]=function(_0x397067,_0x5d541d){return db[_0x18fa('0x18')][_0x18fa('0x34')](_0x397067[_0x18fa('0x35')],{})[_0x18fa('0x10')](respondWithResult(_0x5d541d,0xc9))[_0x18fa('0x2f')](handleError(_0x5d541d,null));};exports[_0x18fa('0xf')]=function(_0x5d2de1,_0x459208){if(_0x5d2de1[_0x18fa('0x35')]['id']){delete _0x5d2de1[_0x18fa('0x35')]['id'];}return db[_0x18fa('0x18')][_0x18fa('0x36')]({'where':{'id':_0x5d2de1[_0x18fa('0x31')]['id']}})[_0x18fa('0x10')](handleEntityNotFound(_0x459208,null))[_0x18fa('0x10')](saveUpdates(_0x5d2de1[_0x18fa('0x35')],null))[_0x18fa('0x10')](respondWithResult(_0x459208,null))[_0x18fa('0x2f')](handleError(_0x459208,null));};exports[_0x18fa('0x11')]=function(_0x52c58b,_0xe7f1fc){return db[_0x18fa('0x18')][_0x18fa('0x36')]({'where':{'id':_0x52c58b[_0x18fa('0x31')]['id']}})[_0x18fa('0x10')](handleEntityNotFound(_0xe7f1fc,null))[_0x18fa('0x10')](removeEntity(_0xe7f1fc,null))[_0x18fa('0x2f')](handleError(_0xe7f1fc,null));};exports[_0x18fa('0x37')]=function(_0x5e0f9c,_0x4ce1dc){var _0x550663={};var _0x3b2b58={};var _0x510e4e;var _0x19827f;return db[_0x18fa('0x18')][_0x18fa('0x38')]({'where':{'id':_0x5e0f9c[_0x18fa('0x31')]['id']}})[_0x18fa('0x10')](handleEntityNotFound(_0x4ce1dc,null))[_0x18fa('0x10')](function(_0x33b451){if(_0x33b451){_0x510e4e=_0x33b451;_0x3b2b58['model']=_[_0x18fa('0x32')](db[_0x18fa('0x39')][_0x18fa('0x33')]);_0x3b2b58[_0x18fa('0x1e')]=_['keys'](_0x5e0f9c[_0x18fa('0x1e')]);_0x3b2b58[_0x18fa('0x1b')]=_['intersection'](_0x3b2b58['model'],_0x3b2b58[_0x18fa('0x1e')]);_0x550663[_0x18fa('0x1f')]=_[_0x18fa('0x1c')](_0x3b2b58[_0x18fa('0x1a')],qs[_0x18fa('0x1d')](_0x5e0f9c[_0x18fa('0x1e')][_0x18fa('0x1d')]));_0x550663[_0x18fa('0x1f')]=_0x550663[_0x18fa('0x1f')]['length']?_0x550663[_0x18fa('0x1f')]:_0x3b2b58[_0x18fa('0x1a')];_0x550663[_0x18fa('0x23')]=qs[_0x18fa('0x24')](_0x5e0f9c[_0x18fa('0x1e')][_0x18fa('0x24')]);_0x550663['where']=qs[_0x18fa('0x1b')](_['pick'](_0x5e0f9c[_0x18fa('0x1e')],_0x3b2b58[_0x18fa('0x1b')]));if(_0x5e0f9c[_0x18fa('0x1e')]['filter']){_0x550663['where']=_[_0x18fa('0x28')](_0x550663['where'],{'$or':_['map'](_0x550663[_0x18fa('0x1f')],function(_0xc3f048){var _0x10bcd0={};_0x10bcd0[_0xc3f048]={'$like':'%'+_0x5e0f9c['query'][_0x18fa('0x27')]+'%'};return _0x10bcd0;})});}_0x550663=_[_0x18fa('0x28')]({},_0x550663,_0x5e0f9c[_0x18fa('0x2b')]);return _0x510e4e[_0x18fa('0x37')](_0x550663);}})[_0x18fa('0x10')](function(_0x49895e){if(_0x49895e){_0x19827f=_0x49895e['length'];if(!_0x5e0f9c[_0x18fa('0x1e')][_0x18fa('0x21')](_0x18fa('0x22'))){_0x550663['limit']=qs[_0x18fa('0x9')](_0x5e0f9c['query'][_0x18fa('0x9')]);_0x550663[_0x18fa('0xa')]=qs['offset'](_0x5e0f9c['query'][_0x18fa('0xa')]);}return _0x510e4e[_0x18fa('0x37')](_0x550663);}})[_0x18fa('0x10')](function(_0x466473){if(_0x466473){return _0x466473?{'count':_0x19827f,'rows':_0x466473}:null;}})[_0x18fa('0x10')](respondWithResult(_0x4ce1dc,null))['catch'](handleError(_0x4ce1dc,null));};exports['addConfiguration']=function(_0x2f5d39,_0x194a87){if(_0x2f5d39['body']['id']){delete _0x2f5d39['body']['id'];}return db[_0x18fa('0x18')][_0x18fa('0x38')]({'where':{'id':_0x2f5d39[_0x18fa('0x31')]['id']}})[_0x18fa('0x10')](handleEntityNotFound(_0x194a87,null))['then'](function(_0x1602d6){if(_0x1602d6){_0x2f5d39['body']['AccountId']=_0x1602d6['id'];_0x2f5d39[_0x18fa('0x35')][_0x18fa('0x3a')]=integrations[_0x18fa('0x3b')](_0x2f5d39[_0x18fa('0x35')][_0x18fa('0x3c')],_0x2f5d39[_0x18fa('0x35')][_0x18fa('0x19')]);_0x2f5d39['body'][_0x18fa('0x3d')]=integrations[_0x18fa('0x3e')](_0x2f5d39['body'][_0x18fa('0x3c')],_0x2f5d39[_0x18fa('0x35')][_0x18fa('0x19')]);return db['Dynamics365Configuration']['create'](_0x2f5d39[_0x18fa('0x35')],{'include':[{'model':db[_0x18fa('0x3f')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x18fa('0x3d')}]});}return null;})[_0x18fa('0x10')](respondWithResult(_0x194a87,null))['catch'](handleError(_0x194a87,null));};function sanitizeRemoteUri(_0x4254a3){var _0x46a00b=_0x4254a3['slice'](-0x1);if(_0x46a00b==='/')return _0x4254a3['substring'](0x0,_0x4254a3['lastIndexOf'](_0x46a00b));return _0x4254a3;}function getWebApiUrl(_0x98d9b4){return util['format'](_0x18fa('0x40'),_0x98d9b4);}exports[_0x18fa('0x41')]=function(_0xbc8c78,_0x4cccef){var _0x25eceb=_0xbc8c78['query'][_0x18fa('0x42')];var _0x4118e1=_0x25eceb===_0x18fa('0x43')?_0x18fa('0x44'):_0x18fa('0x45');var _0x148a00='';var _0x5e40bb='';var _0x23f6cc='';var _0x15b506='';var _0x17c9d8='';var _0x44b81b='';var _0x4c803f='';var _0x4580f2='';var _0x5ae3cc=[_0x18fa('0x46'),_0x18fa('0x47'),'customerid','ownerid',_0x18fa('0x48'),_0x18fa('0x49'),_0x18fa('0x4a'),_0x18fa('0x4b'),_0x18fa('0x4c'),'phonecall_activity_parties'];var _0x297c1b=[_0x18fa('0x4d'),_0x18fa('0x4e'),_0x18fa('0x4f'),'billedserviceunits',_0x18fa('0x50'),_0x18fa('0x51'),_0x18fa('0x52'),_0x18fa('0x53'),_0x18fa('0x54'),_0x18fa('0x55'),_0x18fa('0x56'),_0x18fa('0x57'),'createdon',_0x18fa('0x58'),_0x18fa('0x59'),_0x18fa('0x5a'),'customeridtype',_0x18fa('0x5b'),_0x18fa('0x5c'),_0x18fa('0x5d'),_0x18fa('0x5e'),_0x18fa('0x5f'),_0x18fa('0x60'),_0x18fa('0x61'),_0x18fa('0x62'),_0x18fa('0x63'),'importsequencenumber',_0x18fa('0x64'),_0x18fa('0x65'),_0x18fa('0x66'),_0x18fa('0x67'),'modifiedbyexternalpartyname',_0x18fa('0x68'),_0x18fa('0x69'),'modifiedbyyominame',_0x18fa('0x6a'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x18fa('0x6b'),_0x18fa('0x6c'),_0x18fa('0x6d'),_0x18fa('0x6e'),_0x18fa('0x6f'),_0x18fa('0x70'),_0x18fa('0x71'),'parentcaseidname','primarycontactidname',_0x18fa('0x72'),'prioritycodename','productidname','productserialnumber',_0x18fa('0x73'),_0x18fa('0x74'),_0x18fa('0x75'),_0x18fa('0x76'),_0x18fa('0x77'),_0x18fa('0x78'),_0x18fa('0x79'),_0x18fa('0x7a'),'socialprofileidname','statecode',_0x18fa('0x7b'),_0x18fa('0x7c'),_0x18fa('0x7d'),'timezoneruleversionnumber','transactioncurrencyidname',_0x18fa('0x7e'),_0x18fa('0x7f'),'versionnumber'];var _0x24644c=_0x5ae3cc['concat'](_0x297c1b);return db[_0x18fa('0x18')][_0x18fa('0x38')]({'where':{'id':_0xbc8c78[_0x18fa('0x31')]['id']},'attributes':['id',_0x18fa('0x80'),'password',_0x18fa('0x81'),_0x18fa('0x82'),_0x18fa('0x83'),_0x18fa('0x84'),_0x18fa('0x85')],'include':[{'model':db[_0x18fa('0x86')],'as':_0x18fa('0x86'),'attributes':['id',_0x18fa('0x87'),'data7']}]})[_0x18fa('0x10')](handleEntityNotFound(_0x4cccef,null))[_0x18fa('0x10')](function(_0x2aa5f7){if(_0x2aa5f7){if(_0x2aa5f7[_0x18fa('0x85')]){_0x2aa5f7['access_token']=_0x2aa5f7['CloudProvider'][_0x18fa('0x87')];_0x4580f2=sanitizeRemoteUri(_0x2aa5f7[_0x18fa('0x86')]['data7']);_0x4c803f=getWebApiUrl(_0x4580f2);return _0x2aa5f7;}_0x4580f2=sanitizeRemoteUri(_0x2aa5f7['remoteUri']);_0x4c803f=getWebApiUrl(_0x4580f2);var _0x4cc560={'method':_0x18fa('0x88'),'uri':_0x18fa('0x89')+_0x2aa5f7[_0x18fa('0x82')]+'/oauth2/token','form':{'client_id':_0x2aa5f7['clientId'],'resource':_0x4580f2,'username':_0x2aa5f7[_0x18fa('0x80')],'password':_0x2aa5f7['password'],'grant_type':_0x18fa('0x8a'),'client_secret':_0x2aa5f7[_0x18fa('0x84')]},'json':!![]};return rp(_0x4cc560);}})[_0x18fa('0x10')](function(_0x43a193){_0x44b81b=_0x43a193[_0x18fa('0x8b')];var _0x33a110={'method':'GET','uri':encodeURI(_0x4c803f+_0x18fa('0x8c')+_0x4118e1+'\x27'),'headers':{'Authorization':_0x18fa('0x8d')+_0x44b81b,'If-None-Match':null,'OData-Version':_0x18fa('0x8e')},'json':!![]};return rp(_0x33a110);})[_0x18fa('0x10')](function(_0x3298c4){var _0x4a075e=_0x3298c4[_0x18fa('0x8f')][0x0];var _0xcdfe2=_0x4a075e['MetadataId'];var _0x188bdf={'method':'GET','uri':_0x4c803f+'EntityDefinitions('+_0xcdfe2+_0x18fa('0x90'),'headers':{'Authorization':_0x18fa('0x8d')+_0x44b81b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x188bdf);})[_0x18fa('0x10')](function(_0x3f6e0f){_0x148a00=_0x3f6e0f;_0x5e40bb=_0x148a00[_0x18fa('0x91')];_0x5e40bb=_[_0x18fa('0x92')](_0x5e40bb,function(_0x157731){return!_0x24644c[_0x18fa('0x93')](_0x157731['LogicalName']);});var _0x18b834=[];var _0x163785=[];_0x5e40bb[_0x18fa('0x94')](function(_0x17c2bd){if(_0x17c2bd[_0x18fa('0x95')]){var _0x4a8200=_0x17c2bd[_0x18fa('0x95')][_0x18fa('0x96')](_0x17c2bd[_0x18fa('0x95')]['lastIndexOf']('.')+0x1);if(_0x4a8200===_0x18fa('0x97')){_0x18b834[_0x18fa('0x98')](getSelectList(_0x4c803f,_0x25eceb,_0x163785,_0x148a00[_0x18fa('0x99')],_0x17c2bd[_0x18fa('0x99')],_0x44b81b));}}});return Promise[_0x18fa('0x9a')](_0x18b834);})['then'](function(_0x269373){_0x23f6cc=_0x269373[0x0];var _0x54627b=[];var _0x4306eb=[];_0x5e40bb[_0x18fa('0x94')](function(_0x358a13){if(!_[_0x18fa('0x9b')](_0x358a13[_0x18fa('0x95')])){var _0x50ffb9=_0x358a13[_0x18fa('0x95')][_0x18fa('0x96')](_0x358a13['@odata.type'][_0x18fa('0x9c')]('.')+0x1);if(_0x50ffb9===_0x18fa('0x9d')){_0x54627b[_0x18fa('0x98')](getBooleanList(_0x4c803f,_0x25eceb,_0x4306eb,_0x148a00[_0x18fa('0x99')],_0x358a13[_0x18fa('0x99')],_0x44b81b));}}});return Promise[_0x18fa('0x9a')](_0x54627b);})['then'](function(_0xdee31d){_0x15b506=_0xdee31d[0x0];var _0xc45018=[];var _0x38ba54=[];_0x5e40bb[_0x18fa('0x94')](function(_0x3d740e){if(_0x3d740e[_0x18fa('0x95')]){var _0x2d3c46=_0x3d740e[_0x18fa('0x95')]['substring'](_0x3d740e[_0x18fa('0x95')]['lastIndexOf']('.')+0x1);if(_0x2d3c46===_0x18fa('0x9e')||_0x2d3c46===_0x18fa('0x9f')||_0x2d3c46===_0x18fa('0xa0')||_0x2d3c46==='IntegerAttributeMetadata'||_0x2d3c46===_0x18fa('0xa1')||_0x2d3c46===_0x18fa('0xa2')||_0x2d3c46===_0x18fa('0xa3')||_0x2d3c46===_0x18fa('0xa4')||_0x2d3c46===_0x18fa('0xa5')||_0x2d3c46===_0x18fa('0xa6')){_0xc45018['push'](getInputList(_0x4c803f,_0x25eceb,_0x2d3c46,_0x38ba54,_0x148a00['MetadataId'],_0x3d740e[_0x18fa('0x99')],_0x44b81b));}}});return Promise[_0x18fa('0x9a')](_0xc45018);})['then'](function(_0x883b43){_0x17c9d8=_0x883b43[0x0];var _0x33a36f=_0x23f6cc['concat'](_0x15b506)[_0x18fa('0xa7')](_0x17c9d8);var _0x5a5137={'count':_0x33a36f[_0x18fa('0x20')],'rows':_0x33a36f};return _0x5a5137;})[_0x18fa('0x10')](respondWithResult(_0x4cccef,null))[_0x18fa('0x2f')](function(_0xd8fbe9){var _0x5caaf2=_0xbc8c78['query'][_0x18fa('0xa8')]?0x1f4:_0xd8fbe9['statusCode']||0x1f4;logger['error'](_0xd8fbe9[_0x18fa('0xa9')]);delete _0xd8fbe9['name'];if(_0x5caaf2===0x191){_0x5caaf2=0x190;}_0x4cccef[_0x18fa('0xc')](_0x5caaf2)['send'](_0xbc8c78[_0x18fa('0x1e')]['test']?{'message':_0x18fa('0xaa'),'statusCode':_0xd8fbe9['statusCode']}:_0xd8fbe9);});};function getSelectList(_0x2297bf,_0xa26ceb,_0x38c329,_0x1eddc7,_0x14b6cb,_0x4b3eab){var _0x15e0f1={'method':_0x18fa('0xab'),'uri':_0x2297bf+_0x18fa('0xac')+_0x1eddc7+_0x18fa('0xad')+_0x14b6cb+_0x18fa('0xae')+_0x18fa('0xaf'),'headers':{'Authorization':_0x18fa('0x8d')+_0x4b3eab,'If-None-Match':null,'OData-Version':_0x18fa('0x8e')},'json':!![]};return rp(_0x15e0f1)['then'](function(_0x909a9e){var _0x1604b5=[];var _0xf20768=_0x909a9e[_0x18fa('0xb0')][_0x18fa('0xb1')];_0xf20768[_0x18fa('0x94')](function(_0x1c9a47){_0x1604b5[_0x18fa('0x98')]({'name':_0x1c9a47['Label'][_0x18fa('0xb2')][_0x18fa('0xb3')],'value':String(_0x1c9a47['Value'])});});var _0x4043fe={'id':_0xa26ceb+'_'+_0x909a9e[_0x18fa('0xb4')],'name':_0x909a9e['DisplayName'][_0x18fa('0xb2')][_0x18fa('0xb3')],'custom':![],'options':_0x1604b5};_0x38c329[_0x18fa('0x98')](_0x4043fe);return _0x38c329;});}function getBooleanList(_0x48c720,_0x1b14b2,_0xed6d51,_0x4814a2,_0x3b97aa,_0x4f109c){var _0x28a27b={'method':_0x18fa('0xab'),'uri':_0x48c720+'EntityDefinitions('+_0x4814a2+_0x18fa('0xad')+_0x3b97aa+_0x18fa('0xb5'),'headers':{'Authorization':_0x18fa('0x8d')+_0x4f109c,'If-None-Match':null,'OData-Version':_0x18fa('0x8e')},'json':!![]};return rp(_0x28a27b)['then'](function(_0x4655cd){var _0xfe7886=[];_0xfe7886['push']({'name':_0x4655cd[_0x18fa('0xb0')]['TrueOption'][_0x18fa('0xb3')][_0x18fa('0xb2')][_0x18fa('0xb3')],'value':_0x18fa('0xb6')},{'name':_0x4655cd['OptionSet'][_0x18fa('0xb7')][_0x18fa('0xb3')][_0x18fa('0xb2')]['Label'],'value':_0x18fa('0xb8')});var _0x42c236={'id':_0x1b14b2+'_'+_0x4655cd[_0x18fa('0xb4')],'name':_0x4655cd[_0x18fa('0xb9')][_0x18fa('0xb2')][_0x18fa('0xb3')],'custom':![],'options':_0xfe7886};_0xed6d51['push'](_0x42c236);return _0xed6d51;});}function getInputList(_0x3fb849,_0x5d07e3,_0x4bba5f,_0x1c2345,_0xfabd0a,_0x1d9544,_0x2dd29c){var _0x29c4e2={'method':_0x18fa('0xab'),'uri':_0x3fb849+_0x18fa('0xac')+_0xfabd0a+_0x18fa('0xad')+_0x1d9544+_0x18fa('0xba')+_0x4bba5f+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x2dd29c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x29c4e2)[_0x18fa('0x10')](function(_0x437eb6){var _0x25f427={'id':_0x5d07e3+'_'+_0x437eb6[_0x18fa('0xb4')],'name':_0x437eb6[_0x18fa('0xb9')]['UserLocalizedLabel']?_0x437eb6[_0x18fa('0xb9')][_0x18fa('0xb2')][_0x18fa('0xb3')]:_0x437eb6[_0x18fa('0xb4')],'custom':![],'options':[]};_0x1c2345[_0x18fa('0x98')](_0x25f427);return _0x1c2345;});}
\ No newline at end of file
index 68ce73c..9837ff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x3b0e8a,_0x886d93){var _0xb84537=function(_0x30ef1d){while(--_0x30ef1d){_0x3b0e8a['push'](_0x3b0e8a['shift']());}};_0xb84537(++_0x886d93);}(_0x757a,0xde));var _0xa757=function(_0x540684,_0xc89b20){_0x540684=_0x540684-0x0;var _0x14d1c3=_0x757a[_0x540684];return _0x14d1c3;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x4a76aa,_0x14b6fc){var _0x1e05c5=function(_0x2254fc){while(--_0x2254fc){_0x4a76aa['push'](_0x4a76aa['shift']());}};_0x1e05c5(++_0x14b6fc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xb7e7[_0x5037ab];return _0x512adb;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5335822..b4a8ac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe491=['lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','options','raw','map','include','model','attributes','catch','ShowDynamics365Account','find','where'];(function(_0x3310c1,_0x986959){var _0x243459=function(_0x41f84c){while(--_0x41f84c){_0x3310c1['push'](_0x3310c1['shift']());}};_0x243459(++_0x986959);}(_0xe491,0x18c));var _0x1e49=function(_0x27f6d3,_0x320e3f){_0x27f6d3=_0x27f6d3-0x0;var _0x3d1108=_0xe491[_0x27f6d3];return _0x3d1108;};'use strict';var _=require(_0x1e49('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1e49('0x1'));var rs=require(_0x1e49('0x2'));var fs=require('fs');var Redis=require(_0x1e49('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1e49('0x4'))(_0x1e49('0x5'));var config=require(_0x1e49('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1e49('0x7')][_0x1e49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x454c44,_0x32accb,_0x1b4083){return new BPromise(function(_0x324688,_0x14c748){return client[_0x1e49('0x9')](_0x454c44,_0x1b4083)[_0x1e49('0xa')](function(_0x54b911){logger[_0x1e49('0xb')](_0x1e49('0xc'),_0x32accb,_0x1e49('0xd'));logger[_0x1e49('0xe')](_0x1e49('0xf'),_0x32accb,_0x1e49('0xd'),JSON[_0x1e49('0x10')](_0x54b911));if(_0x54b911[_0x1e49('0x11')]){if(_0x54b911[_0x1e49('0x11')][_0x1e49('0x12')]===0x1f4){logger[_0x1e49('0x11')](_0x1e49('0xc'),_0x32accb,_0x54b911[_0x1e49('0x11')][_0x1e49('0x13')]);return _0x14c748(_0x54b911['error']['message']);}logger[_0x1e49('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x32accb,_0x54b911['error'][_0x1e49('0x13')]);return _0x324688(_0x54b911[_0x1e49('0x11')]['message']);}else{logger['info'](_0x1e49('0xc'),_0x32accb,_0x1e49('0xd'));_0x324688(_0x54b911[_0x1e49('0x14')][_0x1e49('0x13')]);}})['catch'](function(_0x3aaa97){logger[_0x1e49('0x11')](_0x1e49('0xc'),_0x32accb,_0x3aaa97);_0x14c748(_0x3aaa97);});});}exports[_0x1e49('0x15')]=function(_0x248b4b){var _0x3a6b51=this;return new Promise(function(_0x5abd7e,_0x487bb2){return db[_0x1e49('0x16')]['findAll']({'raw':_0x248b4b[_0x1e49('0x17')]?_0x248b4b[_0x1e49('0x17')][_0x1e49('0x18')]===undefined?!![]:![]:!![],'where':_0x248b4b[_0x1e49('0x17')]?_0x248b4b[_0x1e49('0x17')]['where']||null:null,'attributes':_0x248b4b[_0x1e49('0x17')]?_0x248b4b['options']['attributes']||null:null,'limit':_0x248b4b['options']?_0x248b4b[_0x1e49('0x17')]['limit']||null:null,'include':_0x248b4b[_0x1e49('0x17')]?_0x248b4b[_0x1e49('0x17')]['include']?_[_0x1e49('0x19')](_0x248b4b['options'][_0x1e49('0x1a')],function(_0x2f18de){return{'model':db[_0x2f18de[_0x1e49('0x1b')]],'as':_0x2f18de['as'],'attributes':_0x2f18de[_0x1e49('0x1c')],'include':_0x2f18de[_0x1e49('0x1a')]?_[_0x1e49('0x19')](_0x2f18de[_0x1e49('0x1a')],function(_0x2c9768){return{'model':db[_0x2c9768[_0x1e49('0x1b')]],'as':_0x2c9768['as'],'attributes':_0x2c9768['attributes'],'include':_0x2c9768[_0x1e49('0x1a')]?_[_0x1e49('0x19')](_0x2c9768[_0x1e49('0x1a')],function(_0x432ca5){return{'model':db[_0x432ca5['model']],'as':_0x432ca5['as'],'attributes':_0x432ca5[_0x1e49('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1e49('0xa')](function(_0x14b780){logger[_0x1e49('0xb')]('GetDynamics365Account',_0x248b4b);logger[_0x1e49('0xe')]('GetDynamics365Account',_0x248b4b,JSON[_0x1e49('0x10')](_0x14b780));_0x5abd7e(_0x14b780);})[_0x1e49('0x1d')](function(_0x317300){logger['error']('GetDynamics365Account',_0x317300[_0x1e49('0x13')],_0x248b4b);_0x487bb2(_0x3a6b51[_0x1e49('0x11')](0x1f4,_0x317300[_0x1e49('0x13')]));});});};exports[_0x1e49('0x1e')]=function(_0x4c4466){var _0x33f540=this;return new Promise(function(_0x2913ea,_0x4ed79b){return db['Dynamics365Account'][_0x1e49('0x1f')]({'raw':_0x4c4466[_0x1e49('0x17')]?_0x4c4466[_0x1e49('0x17')][_0x1e49('0x18')]===undefined?!![]:![]:!![],'where':_0x4c4466[_0x1e49('0x17')]?_0x4c4466['options'][_0x1e49('0x20')]||null:null,'attributes':_0x4c4466[_0x1e49('0x17')]?_0x4c4466[_0x1e49('0x17')][_0x1e49('0x1c')]||null:null,'include':_0x4c4466['options']?_0x4c4466[_0x1e49('0x17')][_0x1e49('0x1a')]?_['map'](_0x4c4466['options'][_0x1e49('0x1a')],function(_0x570408){return{'model':db[_0x570408['model']],'as':_0x570408['as'],'attributes':_0x570408[_0x1e49('0x1c')],'include':_0x570408[_0x1e49('0x1a')]?_[_0x1e49('0x19')](_0x570408['include'],function(_0x3bd44a){return{'model':db[_0x3bd44a[_0x1e49('0x1b')]],'as':_0x3bd44a['as'],'attributes':_0x3bd44a[_0x1e49('0x1c')],'include':_0x3bd44a[_0x1e49('0x1a')]?_['map'](_0x3bd44a[_0x1e49('0x1a')],function(_0x3a2317){return{'model':db[_0x3a2317['model']],'as':_0x3a2317['as'],'attributes':_0x3a2317[_0x1e49('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x273c72){logger['info'](_0x1e49('0x1e'),_0x4c4466);logger[_0x1e49('0xe')]('ShowDynamics365Account',_0x4c4466,JSON[_0x1e49('0x10')](_0x273c72));_0x2913ea(_0x273c72);})['catch'](function(_0x1e0d32){logger['error']('ShowDynamics365Account',_0x1e0d32[_0x1e49('0x13')],_0x4c4466);_0x4ed79b(_0x33f540[_0x1e49('0x11')](0x1f4,_0x1e0d32[_0x1e49('0x13')]));});});};
\ No newline at end of file
+var _0x8b95=['request\x20sent','debug','code','error','message','catch','findAll','options','raw','where','limit','include','model','attributes','map','GetDynamics365Account','ShowDynamics365Account','Dynamics365Account','find','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0x327868,_0x317e1e){var _0x336c3e=function(_0x20a10b){while(--_0x20a10b){_0x327868['push'](_0x327868['shift']());}};_0x336c3e(++_0x317e1e);}(_0x8b95,0x102));var _0x58b9=function(_0x4cccf8,_0x410a79){_0x4cccf8=_0x4cccf8-0x0;var _0x388bba=_0x8b95[_0x4cccf8];return _0x388bba;};'use strict';var _=require(_0x58b9('0x0'));var util=require(_0x58b9('0x1'));var moment=require(_0x58b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x58b9('0x3'));var fs=require('fs');var Redis=require(_0x58b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x58b9('0x5'));var logger=require(_0x58b9('0x6'))(_0x58b9('0x7'));var config=require('../../config/environment');var jayson=require(_0x58b9('0x8'));var client=jayson[_0x58b9('0x9')][_0x58b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf2c782,_0x50f3d3,_0x38e973){return new BPromise(function(_0x5356c4,_0x2fd51e){return client['request'](_0xf2c782,_0x38e973)[_0x58b9('0xb')](function(_0x3e9a81){logger[_0x58b9('0xc')](_0x58b9('0xd'),_0x50f3d3,_0x58b9('0xe'));logger[_0x58b9('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x50f3d3,'request\x20sent',JSON['stringify'](_0x3e9a81));if(_0x3e9a81['error']){if(_0x3e9a81['error'][_0x58b9('0x10')]===0x1f4){logger[_0x58b9('0x11')](_0x58b9('0xd'),_0x50f3d3,_0x3e9a81[_0x58b9('0x11')][_0x58b9('0x12')]);return _0x2fd51e(_0x3e9a81[_0x58b9('0x11')][_0x58b9('0x12')]);}logger[_0x58b9('0x11')](_0x58b9('0xd'),_0x50f3d3,_0x3e9a81[_0x58b9('0x11')][_0x58b9('0x12')]);return _0x5356c4(_0x3e9a81['error'][_0x58b9('0x12')]);}else{logger[_0x58b9('0xc')](_0x58b9('0xd'),_0x50f3d3,_0x58b9('0xe'));_0x5356c4(_0x3e9a81['result'][_0x58b9('0x12')]);}})[_0x58b9('0x13')](function(_0x59d90f){logger[_0x58b9('0x11')](_0x58b9('0xd'),_0x50f3d3,_0x59d90f);_0x2fd51e(_0x59d90f);});});}exports['GetDynamics365Account']=function(_0x3c3ea8){var _0x3b2187=this;return new Promise(function(_0x5ee195,_0x22fe37){return db['Dynamics365Account'][_0x58b9('0x14')]({'raw':_0x3c3ea8[_0x58b9('0x15')]?_0x3c3ea8[_0x58b9('0x15')][_0x58b9('0x16')]===undefined?!![]:![]:!![],'where':_0x3c3ea8[_0x58b9('0x15')]?_0x3c3ea8[_0x58b9('0x15')][_0x58b9('0x17')]||null:null,'attributes':_0x3c3ea8[_0x58b9('0x15')]?_0x3c3ea8[_0x58b9('0x15')]['attributes']||null:null,'limit':_0x3c3ea8[_0x58b9('0x15')]?_0x3c3ea8[_0x58b9('0x15')][_0x58b9('0x18')]||null:null,'include':_0x3c3ea8['options']?_0x3c3ea8[_0x58b9('0x15')][_0x58b9('0x19')]?_['map'](_0x3c3ea8[_0x58b9('0x15')][_0x58b9('0x19')],function(_0x287693){return{'model':db[_0x287693[_0x58b9('0x1a')]],'as':_0x287693['as'],'attributes':_0x287693[_0x58b9('0x1b')],'include':_0x287693[_0x58b9('0x19')]?_[_0x58b9('0x1c')](_0x287693[_0x58b9('0x19')],function(_0x58d76b){return{'model':db[_0x58d76b[_0x58b9('0x1a')]],'as':_0x58d76b['as'],'attributes':_0x58d76b[_0x58b9('0x1b')],'include':_0x58d76b[_0x58b9('0x19')]?_[_0x58b9('0x1c')](_0x58d76b[_0x58b9('0x19')],function(_0x4e0ca5){return{'model':db[_0x4e0ca5['model']],'as':_0x4e0ca5['as'],'attributes':_0x4e0ca5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bdfe6){logger[_0x58b9('0xc')](_0x58b9('0x1d'),_0x3c3ea8);logger[_0x58b9('0xf')](_0x58b9('0x1d'),_0x3c3ea8,JSON['stringify'](_0x4bdfe6));_0x5ee195(_0x4bdfe6);})[_0x58b9('0x13')](function(_0x23f97f){logger[_0x58b9('0x11')]('GetDynamics365Account',_0x23f97f['message'],_0x3c3ea8);_0x22fe37(_0x3b2187['error'](0x1f4,_0x23f97f['message']));});});};exports[_0x58b9('0x1e')]=function(_0x39fc8e){var _0xa1c2de=this;return new Promise(function(_0x451f71,_0x2587ff){return db[_0x58b9('0x1f')][_0x58b9('0x20')]({'raw':_0x39fc8e[_0x58b9('0x15')]?_0x39fc8e['options'][_0x58b9('0x16')]===undefined?!![]:![]:!![],'where':_0x39fc8e[_0x58b9('0x15')]?_0x39fc8e[_0x58b9('0x15')][_0x58b9('0x17')]||null:null,'attributes':_0x39fc8e[_0x58b9('0x15')]?_0x39fc8e['options'][_0x58b9('0x1b')]||null:null,'include':_0x39fc8e[_0x58b9('0x15')]?_0x39fc8e['options'][_0x58b9('0x19')]?_[_0x58b9('0x1c')](_0x39fc8e[_0x58b9('0x15')][_0x58b9('0x19')],function(_0x42e7c2){return{'model':db[_0x42e7c2['model']],'as':_0x42e7c2['as'],'attributes':_0x42e7c2['attributes'],'include':_0x42e7c2[_0x58b9('0x19')]?_[_0x58b9('0x1c')](_0x42e7c2[_0x58b9('0x19')],function(_0xccfb57){return{'model':db[_0xccfb57[_0x58b9('0x1a')]],'as':_0xccfb57['as'],'attributes':_0xccfb57[_0x58b9('0x1b')],'include':_0xccfb57[_0x58b9('0x19')]?_[_0x58b9('0x1c')](_0xccfb57[_0x58b9('0x19')],function(_0x385c0a){return{'model':db[_0x385c0a[_0x58b9('0x1a')]],'as':_0x385c0a['as'],'attributes':_0x385c0a[_0x58b9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x58b9('0xb')](function(_0x2c989e){logger['info']('ShowDynamics365Account',_0x39fc8e);logger[_0x58b9('0xf')](_0x58b9('0x1e'),_0x39fc8e,JSON[_0x58b9('0x21')](_0x2c989e));_0x451f71(_0x2c989e);})['catch'](function(_0x3a9325){logger[_0x58b9('0x11')]('ShowDynamics365Account',_0x3a9325[_0x58b9('0x12')],_0x39fc8e);_0x2587ff(_0xa1c2de['error'](0x1f4,_0x3a9325[_0x58b9('0x12')]));});});};
\ No newline at end of file
index 3314e94..0643fe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c07=['/:id/subjects','getSubjects','/:id/descriptions','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','isAuthenticated','show','/:id/fields','getFields'];(function(_0x472730,_0x4c9b36){var _0x1a9cc7=function(_0x34c9e9){while(--_0x34c9e9){_0x472730['push'](_0x472730['shift']());}};_0x1a9cc7(++_0x4c9b36);}(_0x0c07,0x8b));var _0x70c0=function(_0x157dca,_0x4f74f1){_0x157dca=_0x157dca-0x0;var _0x3908ae=_0x0c07[_0x157dca];return _0x3908ae;};'use strict';var multer=require(_0x70c0('0x0'));var util=require(_0x70c0('0x1'));var path=require(_0x70c0('0x2'));var timeout=require(_0x70c0('0x3'));var express=require(_0x70c0('0x4'));var router=express[_0x70c0('0x5')]();var fs_extra=require(_0x70c0('0x6'));var auth=require(_0x70c0('0x7'));var interaction=require(_0x70c0('0x8'));var config=require(_0x70c0('0x9'));var controller=require(_0x70c0('0xa'));router[_0x70c0('0xb')]('/',auth['isAuthenticated'](),controller[_0x70c0('0xc')]);router['get']('/:id',auth[_0x70c0('0xd')](),controller[_0x70c0('0xe')]);router[_0x70c0('0xb')](_0x70c0('0xf'),auth['isAuthenticated'](),controller[_0x70c0('0x10')]);router['get'](_0x70c0('0x11'),auth['isAuthenticated'](),controller[_0x70c0('0x12')]);router['get'](_0x70c0('0x13'),auth[_0x70c0('0xd')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x70c0('0x14')]);router[_0x70c0('0x15')](_0x70c0('0x16'),auth['isAuthenticated'](),controller[_0x70c0('0x17')]);router['delete'](_0x70c0('0x16'),auth[_0x70c0('0xd')](),controller[_0x70c0('0x18')]);module[_0x70c0('0x19')]=router;
\ No newline at end of file
+var _0x6722=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x6722,0x134));var _0x2672=function(_0x10445a,_0x3c5001){_0x10445a=_0x10445a-0x0;var _0x1f4e61=_0x6722[_0x10445a];return _0x1f4e61;};'use strict';var multer=require(_0x2672('0x0'));var util=require(_0x2672('0x1'));var path=require(_0x2672('0x2'));var timeout=require(_0x2672('0x3'));var express=require('express');var router=express[_0x2672('0x4')]();var fs_extra=require(_0x2672('0x5'));var auth=require(_0x2672('0x6'));var interaction=require(_0x2672('0x7'));var config=require(_0x2672('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0x2672('0x9')]('/',auth[_0x2672('0xa')](),controller['index']);router[_0x2672('0x9')](_0x2672('0xb'),auth[_0x2672('0xa')](),controller[_0x2672('0xc')]);router['get']('/:id/fields',auth[_0x2672('0xa')](),controller[_0x2672('0xd')]);router['get'](_0x2672('0xe'),auth[_0x2672('0xa')](),controller[_0x2672('0xf')]);router[_0x2672('0x9')](_0x2672('0x10'),auth[_0x2672('0xa')](),controller[_0x2672('0x11')]);router[_0x2672('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2672('0x13')](_0x2672('0xb'),auth['isAuthenticated'](),controller[_0x2672('0x14')]);router[_0x2672('0x15')](_0x2672('0xb'),auth[_0x2672('0xa')](),controller[_0x2672('0x16')]);module[_0x2672('0x17')]=router;
\ No newline at end of file
index c8f4128..ffe1dd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde33=['exports','STRING','ENUM','contact','nothing','sequelize'];(function(_0x4ccbe2,_0x11eacf){var _0x134525=function(_0x5c9da9){while(--_0x5c9da9){_0x4ccbe2['push'](_0x4ccbe2['shift']());}};_0x134525(++_0x11eacf);}(_0xde33,0x149));var _0x3de3=function(_0xc23aea,_0x5dd865){_0xc23aea=_0xc23aea-0x0;var _0x21a9e3=_0xde33[_0xc23aea];return _0x21a9e3;};'use strict';var Sequelize=require(_0x3de3('0x0'));module[_0x3de3('0x1')]={'name':{'type':Sequelize[_0x3de3('0x2')]},'description':{'type':Sequelize[_0x3de3('0x2')]},'ticketType':{'type':Sequelize[_0x3de3('0x3')]('incident','phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM'](_0x3de3('0x4'),_0x3de3('0x5')),'defaultValue':_0x3de3('0x4'),'allowNull':![]}};
\ No newline at end of file
+var _0x0af1=['contact','nothing','STRING','ENUM','incident','phonecall'];(function(_0xddfd80,_0x5771b6){var _0x1b8508=function(_0x4550cf){while(--_0x4550cf){_0xddfd80['push'](_0xddfd80['shift']());}};_0x1b8508(++_0x5771b6);}(_0x0af1,0x116));var _0x10af=function(_0x27da3a,_0x88c968){_0x27da3a=_0x27da3a-0x0;var _0x5eb880=_0x0af1[_0x27da3a];return _0x5eb880;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x10af('0x0')]},'description':{'type':Sequelize[_0x10af('0x0')]},'ticketType':{'type':Sequelize[_0x10af('0x1')](_0x10af('0x2'),_0x10af('0x3')),'defaultValue':_0x10af('0x2')},'moduleCreate':{'type':Sequelize['ENUM'](_0x10af('0x4'),_0x10af('0x5')),'defaultValue':'contact','allowNull':![]}};
\ No newline at end of file
index 5c33fc8..9271a0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x237a=['options','includeAll','findAll','rows','catch','params','keys','find','create','body','destroy','getFields','findOne','Dynamics365Field','rawAttributes','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','apply','reject','save','update','then','stack','name','send','index','map','Dynamics365Configuration','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0xff64c2,_0x1329ef){var _0x52b483=function(_0x2f9e32){while(--_0x2f9e32){_0xff64c2['push'](_0xff64c2['shift']());}};_0x52b483(++_0x1329ef);}(_0x237a,0x197));var _0xa237=function(_0x530be6,_0x32fc34){_0x530be6=_0x530be6-0x0;var _0x24ca63=_0x237a[_0x530be6];return _0x24ca63;};'use strict';var emlformat=require(_0xa237('0x0'));var rimraf=require(_0xa237('0x1'));var zipdir=require(_0xa237('0x2'));var jsonpatch=require(_0xa237('0x3'));var rp=require(_0xa237('0x4'));var moment=require(_0xa237('0x5'));var BPromise=require(_0xa237('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa237('0x7'));var sox=require(_0xa237('0x8'));var csv=require(_0xa237('0x9'));var ejs=require(_0xa237('0xa'));var fs=require('fs');var fs_extra=require(_0xa237('0xb'));var _=require(_0xa237('0xc'));var squel=require(_0xa237('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa237('0x9'));var querystring=require(_0xa237('0xe'));var Papa=require(_0xa237('0xf'));var Redis=require(_0xa237('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa237('0x11'));var hardwareService=require(_0xa237('0x12'));var logger=require(_0xa237('0x13'))(_0xa237('0x14'));var utils=require(_0xa237('0x15'));var config=require(_0xa237('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa237('0x17'))['db'];function respondWithStatusCode(_0xd4088a,_0x2fea58){_0x2fea58=_0x2fea58||0xcc;return function(_0x1e74c7){if(_0x1e74c7){return _0xd4088a[_0xa237('0x18')](_0x2fea58);}return _0xd4088a[_0xa237('0x19')](_0x2fea58)[_0xa237('0x1a')]();};}function respondWithResult(_0x29cde3,_0x5a5617){_0x5a5617=_0x5a5617||0xc8;return function(_0x1700ee){if(_0x1700ee){return _0x29cde3[_0xa237('0x19')](_0x5a5617)[_0xa237('0x1b')](_0x1700ee);}};}function respondWithFilteredResult(_0x46bf39,_0xb56d2a){return function(_0x55309e){if(_0x55309e){var _0x2adf27=typeof _0xb56d2a[_0xa237('0x1c')]==='undefined'&&typeof _0xb56d2a['limit']==='undefined';var _0x2250ef=_0x55309e['count'];var _0x3c24ce=_0x2adf27?0x0:_0xb56d2a['offset'];var _0x3d7141=_0x2adf27?_0x55309e[_0xa237('0x1d')]:_0xb56d2a[_0xa237('0x1c')]+_0xb56d2a[_0xa237('0x1e')];var _0x4a8a3f;if(_0x3d7141>=_0x2250ef){_0x3d7141=_0x2250ef;_0x4a8a3f=0xc8;}else{_0x4a8a3f=0xce;}_0x46bf39['status'](_0x4a8a3f);return _0x46bf39['set']('Content-Range',_0x3c24ce+'-'+_0x3d7141+'/'+_0x2250ef)[_0xa237('0x1b')](_0x55309e);}return null;};}function patchUpdates(_0x34424a){return function(_0xc70301){try{jsonpatch[_0xa237('0x1f')](_0xc70301,_0x34424a,!![]);}catch(_0x521a61){return BPromise[_0xa237('0x20')](_0x521a61);}return _0xc70301[_0xa237('0x21')]();};}function saveUpdates(_0x186205,_0x2ef9c4){return function(_0x2cf5bb){if(_0x2cf5bb){return _0x2cf5bb[_0xa237('0x22')](_0x186205)[_0xa237('0x23')](function(_0xcab265){return _0xcab265;});}return null;};}function removeEntity(_0x5cf441,_0x24de58){return function(_0x3b664d){if(_0x3b664d){return _0x3b664d['destroy']()[_0xa237('0x23')](function(){_0x5cf441[_0xa237('0x19')](0xcc)[_0xa237('0x1a')]();});}};}function handleEntityNotFound(_0x800187,_0x27017b){return function(_0x12ec1e){if(!_0x12ec1e){_0x800187['sendStatus'](0x194);}return _0x12ec1e;};}function handleError(_0x40ed82,_0x57dd5a){_0x57dd5a=_0x57dd5a||0x1f4;return function(_0x5a6d31){logger['error'](_0x5a6d31[_0xa237('0x24')]);if(_0x5a6d31[_0xa237('0x25')]){delete _0x5a6d31['name'];}_0x40ed82[_0xa237('0x19')](_0x57dd5a)[_0xa237('0x26')](_0x5a6d31);};}exports[_0xa237('0x27')]=function(_0x208075,_0x62745){var _0x194169={},_0x59cf2d={},_0x290dba={'count':0x0,'rows':[]};var _0x6e9b7=_[_0xa237('0x28')](db[_0xa237('0x29')]['rawAttributes'],function(_0x26cf49){return{'name':_0x26cf49[_0xa237('0x2a')],'type':_0x26cf49[_0xa237('0x2b')][_0xa237('0x2c')]};});_0x59cf2d[_0xa237('0x2d')]=_[_0xa237('0x28')](_0x6e9b7,'name');_0x59cf2d[_0xa237('0x2e')]=_['keys'](_0x208075[_0xa237('0x2e')]);_0x59cf2d[_0xa237('0x2f')]=_['intersection'](_0x59cf2d[_0xa237('0x2d')],_0x59cf2d[_0xa237('0x2e')]);_0x194169[_0xa237('0x30')]=_[_0xa237('0x31')](_0x59cf2d['model'],qs[_0xa237('0x32')](_0x208075['query'][_0xa237('0x32')]));_0x194169[_0xa237('0x30')]=_0x194169[_0xa237('0x30')][_0xa237('0x33')]?_0x194169[_0xa237('0x30')]:_0x59cf2d['model'];if(!_0x208075[_0xa237('0x2e')][_0xa237('0x34')](_0xa237('0x35'))){_0x194169[_0xa237('0x1e')]=qs['limit'](_0x208075[_0xa237('0x2e')]['limit']);_0x194169[_0xa237('0x1c')]=qs[_0xa237('0x1c')](_0x208075['query'][_0xa237('0x1c')]);}_0x194169[_0xa237('0x36')]=qs[_0xa237('0x37')](_0x208075[_0xa237('0x2e')][_0xa237('0x37')]);_0x194169['where']=qs['filters'](_[_0xa237('0x38')](_0x208075['query'],_0x59cf2d[_0xa237('0x2f')]),_0x6e9b7);if(_0x208075[_0xa237('0x2e')][_0xa237('0x39')]){_0x194169[_0xa237('0x3a')]=_[_0xa237('0x3b')](_0x194169[_0xa237('0x3a')],{'$or':_['map'](_0x6e9b7,function(_0x5a847c){if(_0x5a847c[_0xa237('0x2b')]!==_0xa237('0x3c')){var _0xa309d9={};_0xa309d9[_0x5a847c[_0xa237('0x25')]]={'$like':'%'+_0x208075['query'][_0xa237('0x39')]+'%'};return _0xa309d9;}})});}_0x194169=_['merge']({},_0x194169,_0x208075[_0xa237('0x3d')]);var _0x3cc8cb={'where':_0x194169[_0xa237('0x3a')]};return db[_0xa237('0x29')][_0xa237('0x1d')](_0x3cc8cb)[_0xa237('0x23')](function(_0x3bcdb4){_0x290dba[_0xa237('0x1d')]=_0x3bcdb4;if(_0x208075[_0xa237('0x2e')][_0xa237('0x3e')]){_0x194169['include']=[{'all':!![]}];}return db[_0xa237('0x29')][_0xa237('0x3f')](_0x194169);})[_0xa237('0x23')](function(_0x4017a6){_0x290dba[_0xa237('0x40')]=_0x4017a6;return _0x290dba;})['then'](respondWithFilteredResult(_0x62745,_0x194169))[_0xa237('0x41')](handleError(_0x62745,null));};exports['show']=function(_0x3ac017,_0x4eba2a){var _0x4a7088={'raw':![],'where':{'id':_0x3ac017[_0xa237('0x42')]['id']}},_0x1899bd={};_0x1899bd['model']=_[_0xa237('0x43')](db[_0xa237('0x29')]['rawAttributes']);_0x1899bd[_0xa237('0x2e')]=_[_0xa237('0x43')](_0x3ac017[_0xa237('0x2e')]);_0x1899bd[_0xa237('0x2f')]=_[_0xa237('0x31')](_0x1899bd[_0xa237('0x2d')],_0x1899bd[_0xa237('0x2e')]);_0x4a7088[_0xa237('0x30')]=_[_0xa237('0x31')](_0x1899bd[_0xa237('0x2d')],qs[_0xa237('0x32')](_0x3ac017[_0xa237('0x2e')][_0xa237('0x32')]));_0x4a7088[_0xa237('0x30')]=_0x4a7088[_0xa237('0x30')]['length']?_0x4a7088['attributes']:_0x1899bd[_0xa237('0x2d')];if(_0x3ac017[_0xa237('0x2e')][_0xa237('0x3e')]){_0x4a7088['include']=[{'all':!![]}];}_0x4a7088=_['merge']({},_0x4a7088,_0x3ac017[_0xa237('0x3d')]);return db[_0xa237('0x29')][_0xa237('0x44')](_0x4a7088)[_0xa237('0x23')](handleEntityNotFound(_0x4eba2a,null))[_0xa237('0x23')](respondWithResult(_0x4eba2a,null))[_0xa237('0x41')](handleError(_0x4eba2a,null));};exports[_0xa237('0x45')]=function(_0x49c5b7,_0x3cbfea){return db[_0xa237('0x29')][_0xa237('0x45')](_0x49c5b7['body'],{})['then'](respondWithResult(_0x3cbfea,0xc9))['catch'](handleError(_0x3cbfea,null));};exports['update']=function(_0x1ccaa5,_0x55b0c4){if(_0x1ccaa5[_0xa237('0x46')]['id']){delete _0x1ccaa5[_0xa237('0x46')]['id'];}return db[_0xa237('0x29')][_0xa237('0x44')]({'where':{'id':_0x1ccaa5['params']['id']}})[_0xa237('0x23')](handleEntityNotFound(_0x55b0c4,null))[_0xa237('0x23')](saveUpdates(_0x1ccaa5[_0xa237('0x46')],null))[_0xa237('0x23')](respondWithResult(_0x55b0c4,null))[_0xa237('0x41')](handleError(_0x55b0c4,null));};exports[_0xa237('0x47')]=function(_0xe37612,_0x5b6e62){return db[_0xa237('0x29')]['find']({'where':{'id':_0xe37612[_0xa237('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b6e62,null))[_0xa237('0x23')](removeEntity(_0x5b6e62,null))[_0xa237('0x41')](handleError(_0x5b6e62,null));};exports[_0xa237('0x48')]=function(_0x3408e5,_0x11858c,_0x4812dc){var _0x1ccc75={};var _0x2c7893={};var _0x4e4ba6;var _0x78a985;return db[_0xa237('0x29')][_0xa237('0x49')]({'where':{'id':_0x3408e5[_0xa237('0x42')]['id']}})['then'](handleEntityNotFound(_0x11858c,null))[_0xa237('0x23')](function(_0x328a07){if(_0x328a07){_0x4e4ba6=_0x328a07;_0x2c7893[_0xa237('0x2d')]=_[_0xa237('0x43')](db[_0xa237('0x4a')][_0xa237('0x4b')]);_0x2c7893['query']=_[_0xa237('0x43')](_0x3408e5['query']);_0x2c7893[_0xa237('0x2f')]=_['intersection'](_0x2c7893[_0xa237('0x2d')],_0x2c7893[_0xa237('0x2e')]);_0x1ccc75[_0xa237('0x30')]=_[_0xa237('0x31')](_0x2c7893[_0xa237('0x2d')],qs[_0xa237('0x32')](_0x3408e5['query'][_0xa237('0x32')]));_0x1ccc75[_0xa237('0x30')]=_0x1ccc75['attributes'][_0xa237('0x33')]?_0x1ccc75[_0xa237('0x30')]:_0x2c7893[_0xa237('0x2d')];_0x1ccc75[_0xa237('0x36')]=qs['sort'](_0x3408e5[_0xa237('0x2e')][_0xa237('0x37')]);_0x1ccc75[_0xa237('0x3a')]=qs[_0xa237('0x2f')](_['pick'](_0x3408e5['query'],_0x2c7893[_0xa237('0x2f')]));if(_0x3408e5[_0xa237('0x2e')]['filter']){_0x1ccc75[_0xa237('0x3a')]=_[_0xa237('0x3b')](_0x1ccc75[_0xa237('0x3a')],{'$or':_[_0xa237('0x28')](_0x1ccc75[_0xa237('0x30')],function(_0x4a3bf5){var _0x540dd5={};_0x540dd5[_0x4a3bf5]={'$like':'%'+_0x3408e5[_0xa237('0x2e')][_0xa237('0x39')]+'%'};return _0x540dd5;})});}_0x1ccc75=_[_0xa237('0x3b')]({},_0x1ccc75,_0x3408e5[_0xa237('0x3d')]);return _0x4e4ba6['getFields'](_0x1ccc75);}})[_0xa237('0x23')](function(_0x4216e4){if(_0x4216e4){_0x78a985=_0x4216e4[_0xa237('0x33')];if(!_0x3408e5['query'][_0xa237('0x34')](_0xa237('0x35'))){_0x1ccc75[_0xa237('0x1e')]=qs['limit'](_0x3408e5[_0xa237('0x2e')]['limit']);_0x1ccc75[_0xa237('0x1c')]=qs['offset'](_0x3408e5['query']['offset']);}return _0x4e4ba6['getFields'](_0x1ccc75);}})['then'](function(_0x5eaf6d){if(_0x5eaf6d){return _0x5eaf6d?{'count':_0x78a985,'rows':_0x5eaf6d}:null;}})[_0xa237('0x23')](respondWithResult(_0x11858c,null))[_0xa237('0x41')](handleError(_0x11858c,null));};exports[_0xa237('0x4c')]=function(_0x3f4acb,_0x3496e9,_0x5d2929){var _0x6cddc={};var _0x1fa799={};var _0x5ebf19;var _0x4cf85a;return db[_0xa237('0x29')][_0xa237('0x49')]({'where':{'id':_0x3f4acb[_0xa237('0x42')]['id']}})[_0xa237('0x23')](handleEntityNotFound(_0x3496e9,null))[_0xa237('0x23')](function(_0xdb12de){if(_0xdb12de){_0x5ebf19=_0xdb12de;_0x1fa799[_0xa237('0x2d')]=_['keys'](db[_0xa237('0x4a')]['rawAttributes']);_0x1fa799[_0xa237('0x2e')]=_[_0xa237('0x43')](_0x3f4acb[_0xa237('0x2e')]);_0x1fa799[_0xa237('0x2f')]=_[_0xa237('0x31')](_0x1fa799[_0xa237('0x2d')],_0x1fa799['query']);_0x6cddc['attributes']=_[_0xa237('0x31')](_0x1fa799[_0xa237('0x2d')],qs[_0xa237('0x32')](_0x3f4acb[_0xa237('0x2e')][_0xa237('0x32')]));_0x6cddc[_0xa237('0x30')]=_0x6cddc[_0xa237('0x30')][_0xa237('0x33')]?_0x6cddc[_0xa237('0x30')]:_0x1fa799[_0xa237('0x2d')];_0x6cddc['order']=qs[_0xa237('0x37')](_0x3f4acb[_0xa237('0x2e')][_0xa237('0x37')]);_0x6cddc['where']=qs[_0xa237('0x2f')](_['pick'](_0x3f4acb[_0xa237('0x2e')],_0x1fa799[_0xa237('0x2f')]));if(_0x3f4acb['query'][_0xa237('0x39')]){_0x6cddc[_0xa237('0x3a')]=_[_0xa237('0x3b')](_0x6cddc[_0xa237('0x3a')],{'$or':_[_0xa237('0x28')](_0x6cddc['attributes'],function(_0x361b28){var _0x15aaab={};_0x15aaab[_0x361b28]={'$like':'%'+_0x3f4acb[_0xa237('0x2e')][_0xa237('0x39')]+'%'};return _0x15aaab;})});}_0x6cddc=_['merge']({},_0x6cddc,_0x3f4acb[_0xa237('0x3d')]);return _0x5ebf19[_0xa237('0x4c')](_0x6cddc);}})['then'](function(_0x10161a){if(_0x10161a){_0x4cf85a=_0x10161a[_0xa237('0x33')];if(!_0x3f4acb[_0xa237('0x2e')][_0xa237('0x34')](_0xa237('0x35'))){_0x6cddc['limit']=qs[_0xa237('0x1e')](_0x3f4acb['query'][_0xa237('0x1e')]);_0x6cddc['offset']=qs[_0xa237('0x1c')](_0x3f4acb['query']['offset']);}return _0x5ebf19[_0xa237('0x4c')](_0x6cddc);}})['then'](function(_0xe5c8f2){if(_0xe5c8f2){return _0xe5c8f2?{'count':_0x4cf85a,'rows':_0xe5c8f2}:null;}})[_0xa237('0x23')](respondWithResult(_0x3496e9,null))[_0xa237('0x41')](handleError(_0x3496e9,null));};exports[_0xa237('0x4d')]=function(_0x22015b,_0x54776a,_0x18d185){var _0x3db60f={};var _0x167edc={};var _0x364e48;var _0x1bbfde;return db[_0xa237('0x29')]['findOne']({'where':{'id':_0x22015b[_0xa237('0x42')]['id']}})[_0xa237('0x23')](handleEntityNotFound(_0x54776a,null))[_0xa237('0x23')](function(_0x4cf531){if(_0x4cf531){_0x364e48=_0x4cf531;_0x167edc[_0xa237('0x2d')]=_['keys'](db[_0xa237('0x4a')]['rawAttributes']);_0x167edc['query']=_[_0xa237('0x43')](_0x22015b['query']);_0x167edc[_0xa237('0x2f')]=_[_0xa237('0x31')](_0x167edc['model'],_0x167edc[_0xa237('0x2e')]);_0x3db60f['attributes']=_[_0xa237('0x31')](_0x167edc['model'],qs[_0xa237('0x32')](_0x22015b[_0xa237('0x2e')][_0xa237('0x32')]));_0x3db60f[_0xa237('0x30')]=_0x3db60f[_0xa237('0x30')][_0xa237('0x33')]?_0x3db60f['attributes']:_0x167edc['model'];_0x3db60f[_0xa237('0x36')]=qs[_0xa237('0x37')](_0x22015b[_0xa237('0x2e')]['sort']);_0x3db60f[_0xa237('0x3a')]=qs['filters'](_[_0xa237('0x38')](_0x22015b[_0xa237('0x2e')],_0x167edc[_0xa237('0x2f')]));if(_0x22015b[_0xa237('0x2e')]['filter']){_0x3db60f['where']=_[_0xa237('0x3b')](_0x3db60f[_0xa237('0x3a')],{'$or':_['map'](_0x3db60f[_0xa237('0x30')],function(_0x4a922f){var _0x4a597e={};_0x4a597e[_0x4a922f]={'$like':'%'+_0x22015b[_0xa237('0x2e')][_0xa237('0x39')]+'%'};return _0x4a597e;})});}_0x3db60f=_['merge']({},_0x3db60f,_0x22015b['options']);return _0x364e48[_0xa237('0x4d')](_0x3db60f);}})[_0xa237('0x23')](function(_0x17d7b5){if(_0x17d7b5){_0x1bbfde=_0x17d7b5[_0xa237('0x33')];if(!_0x22015b[_0xa237('0x2e')][_0xa237('0x34')](_0xa237('0x35'))){_0x3db60f[_0xa237('0x1e')]=qs[_0xa237('0x1e')](_0x22015b['query'][_0xa237('0x1e')]);_0x3db60f[_0xa237('0x1c')]=qs['offset'](_0x22015b[_0xa237('0x2e')]['offset']);}return _0x364e48[_0xa237('0x4d')](_0x3db60f);}})[_0xa237('0x23')](function(_0x41cdfe){if(_0x41cdfe){return _0x41cdfe?{'count':_0x1bbfde,'rows':_0x41cdfe}:null;}})['then'](respondWithResult(_0x54776a,null))['catch'](handleError(_0x54776a,null));};
\ No newline at end of file
+var _0x4f29=['options','getFields','getSubjects','pick','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','offset','Content-Range','apply','reject','then','destroy','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','Dynamics365Field'];(function(_0x28019c,_0x67743){var _0x48ca39=function(_0x4c161e){while(--_0x4c161e){_0x28019c['push'](_0x28019c['shift']());}};_0x48ca39(++_0x67743);}(_0x4f29,0x145));var _0x94f2=function(_0x3585f9,_0xd4e8b){_0x3585f9=_0x3585f9-0x0;var _0x4eeed0=_0x4f29[_0x3585f9];return _0x4eeed0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94f2('0x0'));var zipdir=require(_0x94f2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x94f2('0x2'));var moment=require(_0x94f2('0x3'));var BPromise=require(_0x94f2('0x4'));var Mustache=require('mustache');var util=require(_0x94f2('0x5'));var path=require('path');var sox=require(_0x94f2('0x6'));var csv=require('to-csv');var ejs=require(_0x94f2('0x7'));var fs=require('fs');var fs_extra=require(_0x94f2('0x8'));var _=require('lodash');var squel=require(_0x94f2('0x9'));var crypto=require(_0x94f2('0xa'));var jsforce=require(_0x94f2('0xb'));var deskjs=require(_0x94f2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x94f2('0xd'));var Redis=require(_0x94f2('0xe'));var authService=require(_0x94f2('0xf'));var qs=require(_0x94f2('0x10'));var as=require(_0x94f2('0x11'));var hardwareService=require(_0x94f2('0x12'));var logger=require(_0x94f2('0x13'))(_0x94f2('0x14'));var utils=require(_0x94f2('0x15'));var config=require(_0x94f2('0x16'));var licenseUtil=require(_0x94f2('0x17'));var db=require(_0x94f2('0x18'))['db'];function respondWithStatusCode(_0x4cb51d,_0x81369d){_0x81369d=_0x81369d||0xcc;return function(_0x5dabd3){if(_0x5dabd3){return _0x4cb51d[_0x94f2('0x19')](_0x81369d);}return _0x4cb51d['status'](_0x81369d)[_0x94f2('0x1a')]();};}function respondWithResult(_0x346952,_0x1b8d05){_0x1b8d05=_0x1b8d05||0xc8;return function(_0x4ae2ab){if(_0x4ae2ab){return _0x346952[_0x94f2('0x1b')](_0x1b8d05)[_0x94f2('0x1c')](_0x4ae2ab);}};}function respondWithFilteredResult(_0x226ab2,_0x90a110){return function(_0x3ef0da){if(_0x3ef0da){var _0x43e976=typeof _0x90a110['offset']==='undefined'&&typeof _0x90a110[_0x94f2('0x1d')]===_0x94f2('0x1e');var _0x2e1b2f=_0x3ef0da['count'];var _0x55cb03=_0x43e976?0x0:_0x90a110[_0x94f2('0x1f')];var _0xdbe766=_0x43e976?_0x3ef0da['count']:_0x90a110[_0x94f2('0x1f')]+_0x90a110[_0x94f2('0x1d')];var _0x162eca;if(_0xdbe766>=_0x2e1b2f){_0xdbe766=_0x2e1b2f;_0x162eca=0xc8;}else{_0x162eca=0xce;}_0x226ab2[_0x94f2('0x1b')](_0x162eca);return _0x226ab2['set'](_0x94f2('0x20'),_0x55cb03+'-'+_0xdbe766+'/'+_0x2e1b2f)['json'](_0x3ef0da);}return null;};}function patchUpdates(_0x5632db){return function(_0x1fc6c8){try{jsonpatch[_0x94f2('0x21')](_0x1fc6c8,_0x5632db,!![]);}catch(_0x12850b){return BPromise[_0x94f2('0x22')](_0x12850b);}return _0x1fc6c8['save']();};}function saveUpdates(_0x350b20,_0x5bb54b){return function(_0x4d46b1){if(_0x4d46b1){return _0x4d46b1['update'](_0x350b20)[_0x94f2('0x23')](function(_0x14ab8f){return _0x14ab8f;});}return null;};}function removeEntity(_0x17aea0,_0x2b22ea){return function(_0x51d3ed){if(_0x51d3ed){return _0x51d3ed[_0x94f2('0x24')]()['then'](function(){_0x17aea0['status'](0xcc)[_0x94f2('0x1a')]();});}};}function handleEntityNotFound(_0x5cf221,_0x3a5c8a){return function(_0x31c91c){if(!_0x31c91c){_0x5cf221[_0x94f2('0x19')](0x194);}return _0x31c91c;};}function handleError(_0xfcf740,_0x4d9071){_0x4d9071=_0x4d9071||0x1f4;return function(_0x51999d){logger[_0x94f2('0x25')](_0x51999d[_0x94f2('0x26')]);if(_0x51999d[_0x94f2('0x27')]){delete _0x51999d[_0x94f2('0x27')];}_0xfcf740[_0x94f2('0x1b')](_0x4d9071)[_0x94f2('0x28')](_0x51999d);};}exports['index']=function(_0x103679,_0x40719c){var _0xcca490={},_0x298948={},_0x47d5d2={'count':0x0,'rows':[]};var _0x171c32=_[_0x94f2('0x29')](db[_0x94f2('0x2a')][_0x94f2('0x2b')],function(_0x3f53d3){return{'name':_0x3f53d3['fieldName'],'type':_0x3f53d3[_0x94f2('0x2c')][_0x94f2('0x2d')]};});_0x298948['model']=_[_0x94f2('0x29')](_0x171c32,'name');_0x298948['query']=_[_0x94f2('0x2e')](_0x103679[_0x94f2('0x2f')]);_0x298948[_0x94f2('0x30')]=_[_0x94f2('0x31')](_0x298948[_0x94f2('0x32')],_0x298948['query']);_0xcca490[_0x94f2('0x33')]=_['intersection'](_0x298948['model'],qs['fields'](_0x103679[_0x94f2('0x2f')][_0x94f2('0x34')]));_0xcca490[_0x94f2('0x33')]=_0xcca490[_0x94f2('0x33')][_0x94f2('0x35')]?_0xcca490[_0x94f2('0x33')]:_0x298948[_0x94f2('0x32')];if(!_0x103679[_0x94f2('0x2f')][_0x94f2('0x36')](_0x94f2('0x37'))){_0xcca490[_0x94f2('0x1d')]=qs[_0x94f2('0x1d')](_0x103679['query'][_0x94f2('0x1d')]);_0xcca490[_0x94f2('0x1f')]=qs[_0x94f2('0x1f')](_0x103679['query']['offset']);}_0xcca490[_0x94f2('0x38')]=qs[_0x94f2('0x39')](_0x103679[_0x94f2('0x2f')][_0x94f2('0x39')]);_0xcca490[_0x94f2('0x3a')]=qs[_0x94f2('0x30')](_['pick'](_0x103679[_0x94f2('0x2f')],_0x298948['filters']),_0x171c32);if(_0x103679['query'][_0x94f2('0x3b')]){_0xcca490['where']=_[_0x94f2('0x3c')](_0xcca490[_0x94f2('0x3a')],{'$or':_[_0x94f2('0x29')](_0x171c32,function(_0x107ccc){if(_0x107ccc['type']!==_0x94f2('0x3d')){var _0x51df2c={};_0x51df2c[_0x107ccc[_0x94f2('0x27')]]={'$like':'%'+_0x103679[_0x94f2('0x2f')][_0x94f2('0x3b')]+'%'};return _0x51df2c;}})});}_0xcca490=_[_0x94f2('0x3c')]({},_0xcca490,_0x103679['options']);var _0x4af66b={'where':_0xcca490[_0x94f2('0x3a')]};return db['Dynamics365Configuration'][_0x94f2('0x3e')](_0x4af66b)[_0x94f2('0x23')](function(_0x2119db){_0x47d5d2[_0x94f2('0x3e')]=_0x2119db;if(_0x103679[_0x94f2('0x2f')][_0x94f2('0x3f')]){_0xcca490[_0x94f2('0x40')]=[{'all':!![]}];}return db[_0x94f2('0x2a')][_0x94f2('0x41')](_0xcca490);})[_0x94f2('0x23')](function(_0x1e2a35){_0x47d5d2[_0x94f2('0x42')]=_0x1e2a35;return _0x47d5d2;})[_0x94f2('0x23')](respondWithFilteredResult(_0x40719c,_0xcca490))[_0x94f2('0x43')](handleError(_0x40719c,null));};exports[_0x94f2('0x44')]=function(_0x2a39bc,_0x224145){var _0x5838e1={'raw':![],'where':{'id':_0x2a39bc[_0x94f2('0x45')]['id']}},_0x5a00cf={};_0x5a00cf[_0x94f2('0x32')]=_[_0x94f2('0x2e')](db[_0x94f2('0x2a')][_0x94f2('0x2b')]);_0x5a00cf[_0x94f2('0x2f')]=_[_0x94f2('0x2e')](_0x2a39bc[_0x94f2('0x2f')]);_0x5a00cf[_0x94f2('0x30')]=_['intersection'](_0x5a00cf[_0x94f2('0x32')],_0x5a00cf[_0x94f2('0x2f')]);_0x5838e1[_0x94f2('0x33')]=_[_0x94f2('0x31')](_0x5a00cf[_0x94f2('0x32')],qs[_0x94f2('0x34')](_0x2a39bc[_0x94f2('0x2f')]['fields']));_0x5838e1[_0x94f2('0x33')]=_0x5838e1[_0x94f2('0x33')][_0x94f2('0x35')]?_0x5838e1[_0x94f2('0x33')]:_0x5a00cf[_0x94f2('0x32')];if(_0x2a39bc['query'][_0x94f2('0x3f')]){_0x5838e1['include']=[{'all':!![]}];}_0x5838e1=_[_0x94f2('0x3c')]({},_0x5838e1,_0x2a39bc['options']);return db['Dynamics365Configuration'][_0x94f2('0x46')](_0x5838e1)[_0x94f2('0x23')](handleEntityNotFound(_0x224145,null))['then'](respondWithResult(_0x224145,null))[_0x94f2('0x43')](handleError(_0x224145,null));};exports[_0x94f2('0x47')]=function(_0xa4204b,_0x2c5b7d){return db[_0x94f2('0x2a')][_0x94f2('0x47')](_0xa4204b[_0x94f2('0x48')],{})[_0x94f2('0x23')](respondWithResult(_0x2c5b7d,0xc9))[_0x94f2('0x43')](handleError(_0x2c5b7d,null));};exports['update']=function(_0x1927ac,_0x106687){if(_0x1927ac[_0x94f2('0x48')]['id']){delete _0x1927ac[_0x94f2('0x48')]['id'];}return db[_0x94f2('0x2a')]['find']({'where':{'id':_0x1927ac[_0x94f2('0x45')]['id']}})[_0x94f2('0x23')](handleEntityNotFound(_0x106687,null))['then'](saveUpdates(_0x1927ac[_0x94f2('0x48')],null))['then'](respondWithResult(_0x106687,null))[_0x94f2('0x43')](handleError(_0x106687,null));};exports['destroy']=function(_0x2a018e,_0x41b141){return db['Dynamics365Configuration'][_0x94f2('0x46')]({'where':{'id':_0x2a018e['params']['id']}})['then'](handleEntityNotFound(_0x41b141,null))[_0x94f2('0x23')](removeEntity(_0x41b141,null))[_0x94f2('0x43')](handleError(_0x41b141,null));};exports['getFields']=function(_0x12855d,_0x186e5b,_0x4adcd6){var _0x33e3a0={};var _0x112e21={};var _0x3dd14d;var _0x1aad53;return db[_0x94f2('0x2a')][_0x94f2('0x49')]({'where':{'id':_0x12855d[_0x94f2('0x45')]['id']}})['then'](handleEntityNotFound(_0x186e5b,null))[_0x94f2('0x23')](function(_0x5e79e0){if(_0x5e79e0){_0x3dd14d=_0x5e79e0;_0x112e21['model']=_['keys'](db[_0x94f2('0x4a')][_0x94f2('0x2b')]);_0x112e21[_0x94f2('0x2f')]=_['keys'](_0x12855d[_0x94f2('0x2f')]);_0x112e21[_0x94f2('0x30')]=_[_0x94f2('0x31')](_0x112e21[_0x94f2('0x32')],_0x112e21[_0x94f2('0x2f')]);_0x33e3a0['attributes']=_[_0x94f2('0x31')](_0x112e21['model'],qs[_0x94f2('0x34')](_0x12855d[_0x94f2('0x2f')][_0x94f2('0x34')]));_0x33e3a0['attributes']=_0x33e3a0[_0x94f2('0x33')][_0x94f2('0x35')]?_0x33e3a0[_0x94f2('0x33')]:_0x112e21['model'];_0x33e3a0[_0x94f2('0x38')]=qs['sort'](_0x12855d[_0x94f2('0x2f')]['sort']);_0x33e3a0[_0x94f2('0x3a')]=qs[_0x94f2('0x30')](_['pick'](_0x12855d[_0x94f2('0x2f')],_0x112e21[_0x94f2('0x30')]));if(_0x12855d['query']['filter']){_0x33e3a0[_0x94f2('0x3a')]=_[_0x94f2('0x3c')](_0x33e3a0[_0x94f2('0x3a')],{'$or':_[_0x94f2('0x29')](_0x33e3a0[_0x94f2('0x33')],function(_0x34637e){var _0x23035a={};_0x23035a[_0x34637e]={'$like':'%'+_0x12855d['query'][_0x94f2('0x3b')]+'%'};return _0x23035a;})});}_0x33e3a0=_['merge']({},_0x33e3a0,_0x12855d[_0x94f2('0x4b')]);return _0x3dd14d[_0x94f2('0x4c')](_0x33e3a0);}})[_0x94f2('0x23')](function(_0x3d7b66){if(_0x3d7b66){_0x1aad53=_0x3d7b66[_0x94f2('0x35')];if(!_0x12855d[_0x94f2('0x2f')]['hasOwnProperty']('nolimit')){_0x33e3a0[_0x94f2('0x1d')]=qs[_0x94f2('0x1d')](_0x12855d['query']['limit']);_0x33e3a0[_0x94f2('0x1f')]=qs['offset'](_0x12855d['query'][_0x94f2('0x1f')]);}return _0x3dd14d[_0x94f2('0x4c')](_0x33e3a0);}})['then'](function(_0x46dd6d){if(_0x46dd6d){return _0x46dd6d?{'count':_0x1aad53,'rows':_0x46dd6d}:null;}})[_0x94f2('0x23')](respondWithResult(_0x186e5b,null))[_0x94f2('0x43')](handleError(_0x186e5b,null));};exports[_0x94f2('0x4d')]=function(_0x3c2294,_0x3c2aff,_0x28d415){var _0x5b1faa={};var _0x497e79={};var _0x41c5bf;var _0x1915a8;return db['Dynamics365Configuration'][_0x94f2('0x49')]({'where':{'id':_0x3c2294[_0x94f2('0x45')]['id']}})[_0x94f2('0x23')](handleEntityNotFound(_0x3c2aff,null))[_0x94f2('0x23')](function(_0x3574e9){if(_0x3574e9){_0x41c5bf=_0x3574e9;_0x497e79[_0x94f2('0x32')]=_['keys'](db[_0x94f2('0x4a')][_0x94f2('0x2b')]);_0x497e79[_0x94f2('0x2f')]=_[_0x94f2('0x2e')](_0x3c2294[_0x94f2('0x2f')]);_0x497e79['filters']=_[_0x94f2('0x31')](_0x497e79[_0x94f2('0x32')],_0x497e79[_0x94f2('0x2f')]);_0x5b1faa[_0x94f2('0x33')]=_[_0x94f2('0x31')](_0x497e79[_0x94f2('0x32')],qs['fields'](_0x3c2294['query'][_0x94f2('0x34')]));_0x5b1faa['attributes']=_0x5b1faa[_0x94f2('0x33')]['length']?_0x5b1faa[_0x94f2('0x33')]:_0x497e79[_0x94f2('0x32')];_0x5b1faa['order']=qs['sort'](_0x3c2294[_0x94f2('0x2f')]['sort']);_0x5b1faa['where']=qs[_0x94f2('0x30')](_[_0x94f2('0x4e')](_0x3c2294[_0x94f2('0x2f')],_0x497e79[_0x94f2('0x30')]));if(_0x3c2294['query']['filter']){_0x5b1faa['where']=_[_0x94f2('0x3c')](_0x5b1faa[_0x94f2('0x3a')],{'$or':_[_0x94f2('0x29')](_0x5b1faa['attributes'],function(_0x820fde){var _0x4f7edf={};_0x4f7edf[_0x820fde]={'$like':'%'+_0x3c2294[_0x94f2('0x2f')]['filter']+'%'};return _0x4f7edf;})});}_0x5b1faa=_[_0x94f2('0x3c')]({},_0x5b1faa,_0x3c2294[_0x94f2('0x4b')]);return _0x41c5bf['getSubjects'](_0x5b1faa);}})['then'](function(_0x5ca274){if(_0x5ca274){_0x1915a8=_0x5ca274[_0x94f2('0x35')];if(!_0x3c2294[_0x94f2('0x2f')]['hasOwnProperty'](_0x94f2('0x37'))){_0x5b1faa[_0x94f2('0x1d')]=qs['limit'](_0x3c2294[_0x94f2('0x2f')][_0x94f2('0x1d')]);_0x5b1faa['offset']=qs[_0x94f2('0x1f')](_0x3c2294[_0x94f2('0x2f')][_0x94f2('0x1f')]);}return _0x41c5bf[_0x94f2('0x4d')](_0x5b1faa);}})['then'](function(_0x274103){if(_0x274103){return _0x274103?{'count':_0x1915a8,'rows':_0x274103}:null;}})[_0x94f2('0x23')](respondWithResult(_0x3c2aff,null))['catch'](handleError(_0x3c2aff,null));};exports[_0x94f2('0x4f')]=function(_0x3fd50b,_0x171c85,_0x2da362){var _0x584b9f={};var _0x46798b={};var _0x4df35c;var _0x1eac46;return db[_0x94f2('0x2a')]['findOne']({'where':{'id':_0x3fd50b[_0x94f2('0x45')]['id']}})['then'](handleEntityNotFound(_0x171c85,null))[_0x94f2('0x23')](function(_0x1f87b9){if(_0x1f87b9){_0x4df35c=_0x1f87b9;_0x46798b['model']=_[_0x94f2('0x2e')](db[_0x94f2('0x4a')][_0x94f2('0x2b')]);_0x46798b['query']=_[_0x94f2('0x2e')](_0x3fd50b[_0x94f2('0x2f')]);_0x46798b[_0x94f2('0x30')]=_['intersection'](_0x46798b['model'],_0x46798b[_0x94f2('0x2f')]);_0x584b9f['attributes']=_[_0x94f2('0x31')](_0x46798b[_0x94f2('0x32')],qs[_0x94f2('0x34')](_0x3fd50b[_0x94f2('0x2f')][_0x94f2('0x34')]));_0x584b9f[_0x94f2('0x33')]=_0x584b9f[_0x94f2('0x33')][_0x94f2('0x35')]?_0x584b9f[_0x94f2('0x33')]:_0x46798b[_0x94f2('0x32')];_0x584b9f[_0x94f2('0x38')]=qs[_0x94f2('0x39')](_0x3fd50b[_0x94f2('0x2f')][_0x94f2('0x39')]);_0x584b9f[_0x94f2('0x3a')]=qs[_0x94f2('0x30')](_[_0x94f2('0x4e')](_0x3fd50b[_0x94f2('0x2f')],_0x46798b['filters']));if(_0x3fd50b[_0x94f2('0x2f')][_0x94f2('0x3b')]){_0x584b9f[_0x94f2('0x3a')]=_['merge'](_0x584b9f[_0x94f2('0x3a')],{'$or':_[_0x94f2('0x29')](_0x584b9f[_0x94f2('0x33')],function(_0x361f1f){var _0x43c8bb={};_0x43c8bb[_0x361f1f]={'$like':'%'+_0x3fd50b[_0x94f2('0x2f')][_0x94f2('0x3b')]+'%'};return _0x43c8bb;})});}_0x584b9f=_[_0x94f2('0x3c')]({},_0x584b9f,_0x3fd50b['options']);return _0x4df35c[_0x94f2('0x4f')](_0x584b9f);}})['then'](function(_0x19a25e){if(_0x19a25e){_0x1eac46=_0x19a25e[_0x94f2('0x35')];if(!_0x3fd50b['query'][_0x94f2('0x36')](_0x94f2('0x37'))){_0x584b9f[_0x94f2('0x1d')]=qs[_0x94f2('0x1d')](_0x3fd50b[_0x94f2('0x2f')]['limit']);_0x584b9f[_0x94f2('0x1f')]=qs['offset'](_0x3fd50b[_0x94f2('0x2f')][_0x94f2('0x1f')]);}return _0x4df35c[_0x94f2('0x4f')](_0x584b9f);}})[_0x94f2('0x23')](function(_0x442d39){if(_0x442d39){return _0x442d39?{'count':_0x1eac46,'rows':_0x442d39}:null;}})[_0x94f2('0x23')](respondWithResult(_0x171c85,null))[_0x94f2('0x43')](handleError(_0x171c85,null));};
\ No newline at end of file
index e0164f7..dec59a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb821=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','bluebird'];(function(_0x57830e,_0x8c078b){var _0x10cfe7=function(_0x4770c7){while(--_0x4770c7){_0x57830e['push'](_0x57830e['shift']());}};_0x10cfe7(++_0x8c078b);}(_0xb821,0xa7));var _0x1b82=function(_0x457ffe,_0x49a494){_0x457ffe=_0x457ffe-0x0;var _0x4fcc45=_0xb821[_0x457ffe];return _0x4fcc45;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x4b84[_0x382c73];return _0x1dd0bf;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9364ecc..6ce787a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb75e=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x221332,_0x5c0307){var _0x281621=function(_0xd004fa){while(--_0xd004fa){_0x221332['push'](_0x221332['shift']());}};_0x281621(++_0x5c0307);}(_0xb75e,0xc6));var _0xeb75=function(_0x152c97,_0x2a6fd3){_0x152c97=_0x152c97-0x0;var _0x192ba8=_0xb75e[_0x152c97];return _0x192ba8;};'use strict';var _=require(_0xeb75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xeb75('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb75('0x2'));var db=require(_0xeb75('0x3'))['db'];var utils=require(_0xeb75('0x4'));var logger=require(_0xeb75('0x5'))(_0xeb75('0x6'));var config=require(_0xeb75('0x7'));var jayson=require(_0xeb75('0x8'));var client=jayson[_0xeb75('0x9')][_0xeb75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x533dfe,_0x44b67a,_0xf1ba02){return new BPromise(function(_0x31372b,_0x315a71){return client[_0xeb75('0xb')](_0x533dfe,_0xf1ba02)[_0xeb75('0xc')](function(_0x3fd19d){logger[_0xeb75('0xd')](_0xeb75('0xe'),_0x44b67a,_0xeb75('0xf'));logger[_0xeb75('0x10')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x44b67a,_0xeb75('0xf'),JSON[_0xeb75('0x11')](_0x3fd19d));if(_0x3fd19d[_0xeb75('0x12')]){if(_0x3fd19d[_0xeb75('0x12')][_0xeb75('0x13')]===0x1f4){logger[_0xeb75('0x12')](_0xeb75('0xe'),_0x44b67a,_0x3fd19d[_0xeb75('0x12')][_0xeb75('0x14')]);return _0x315a71(_0x3fd19d[_0xeb75('0x12')][_0xeb75('0x14')]);}logger[_0xeb75('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x44b67a,_0x3fd19d[_0xeb75('0x12')][_0xeb75('0x14')]);return _0x31372b(_0x3fd19d[_0xeb75('0x12')][_0xeb75('0x14')]);}else{logger[_0xeb75('0xd')](_0xeb75('0xe'),_0x44b67a,_0xeb75('0xf'));_0x31372b(_0x3fd19d['result'][_0xeb75('0x14')]);}})['catch'](function(_0x564de5){logger[_0xeb75('0x12')](_0xeb75('0xe'),_0x44b67a,_0x564de5);_0x315a71(_0x564de5);});});}
\ No newline at end of file
+var _0xfecb=['Dynamics365Configuration,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','then','info'];(function(_0x5549aa,_0x7d839){var _0x3352e7=function(_0x41b1b7){while(--_0x41b1b7){_0x5549aa['push'](_0x5549aa['shift']());}};_0x3352e7(++_0x7d839);}(_0xfecb,0x138));var _0xbfec=function(_0x44ab31,_0xdeeb80){_0x44ab31=_0x44ab31-0x0;var _0x12f68e=_0xfecb[_0x44ab31];return _0x12f68e;};'use strict';var _=require('lodash');var util=require(_0xbfec('0x0'));var moment=require(_0xbfec('0x1'));var BPromise=require(_0xbfec('0x2'));var rs=require(_0xbfec('0x3'));var fs=require('fs');var Redis=require(_0xbfec('0x4'));var db=require(_0xbfec('0x5'))['db'];var utils=require(_0xbfec('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbfec('0x7'));var client=jayson[_0xbfec('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2764db,_0x2f61e2,_0x412db4){return new BPromise(function(_0x5832a0,_0x3a0733){return client['request'](_0x2764db,_0x412db4)[_0xbfec('0x9')](function(_0x573552){logger[_0xbfec('0xa')](_0xbfec('0xb'),_0x2f61e2,'request\x20sent');logger[_0xbfec('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2f61e2,'request\x20sent',JSON[_0xbfec('0xd')](_0x573552));if(_0x573552[_0xbfec('0xe')]){if(_0x573552['error']['code']===0x1f4){logger[_0xbfec('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2f61e2,_0x573552[_0xbfec('0xe')][_0xbfec('0xf')]);return _0x3a0733(_0x573552[_0xbfec('0xe')][_0xbfec('0xf')]);}logger['error'](_0xbfec('0xb'),_0x2f61e2,_0x573552['error'][_0xbfec('0xf')]);return _0x5832a0(_0x573552[_0xbfec('0xe')][_0xbfec('0xf')]);}else{logger[_0xbfec('0xa')](_0xbfec('0xb'),_0x2f61e2,_0xbfec('0x10'));_0x5832a0(_0x573552[_0xbfec('0x11')][_0xbfec('0xf')]);}})[_0xbfec('0x12')](function(_0x5e6f25){logger[_0xbfec('0xe')](_0xbfec('0xb'),_0x2f61e2,_0x5e6f25);_0x3a0733(_0x5e6f25);});});}
\ No newline at end of file
index c69af28..3b10f4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5557=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','update','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x5557,0x1e4));var _0x7555=function(_0x5ea1a6,_0x36ce42){_0x5ea1a6=_0x5ea1a6-0x0;var _0xa38b8=_0x5557[_0x5ea1a6];return _0xa38b8;};'use strict';var multer=require(_0x7555('0x0'));var util=require(_0x7555('0x1'));var path=require(_0x7555('0x2'));var timeout=require('connect-timeout');var express=require(_0x7555('0x3'));var router=express[_0x7555('0x4')]();var fs_extra=require(_0x7555('0x5'));var auth=require(_0x7555('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7555('0x7'));var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0x7555('0x8')](),controller[_0x7555('0x9')]);router[_0x7555('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7555('0xb'),auth[_0x7555('0x8')](),controller[_0x7555('0xc')]);router['delete'](_0x7555('0xb'),auth[_0x7555('0x8')](),controller[_0x7555('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xfe9a=['../../config/environment','./intDynamics365Field.controller','get','/:id','isAuthenticated','show','create','put','update','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x15bbf1,_0x40ef96){var _0x5c4b47=function(_0x303b4f){while(--_0x303b4f){_0x15bbf1['push'](_0x15bbf1['shift']());}};_0x5c4b47(++_0x40ef96);}(_0xfe9a,0x7a));var _0xafe9=function(_0x5570e7,_0xcd0f58){_0x5570e7=_0x5570e7-0x0;var _0x5e4251=_0xfe9a[_0x5570e7];return _0x5e4251;};'use strict';var multer=require('multer');var util=require(_0xafe9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xafe9('0x1'));var router=express[_0xafe9('0x2')]();var fs_extra=require(_0xafe9('0x3'));var auth=require(_0xafe9('0x4'));var interaction=require(_0xafe9('0x5'));var config=require(_0xafe9('0x6'));var controller=require(_0xafe9('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xafe9('0x8')](_0xafe9('0x9'),auth[_0xafe9('0xa')](),controller[_0xafe9('0xb')]);router['post']('/',auth[_0xafe9('0xa')](),controller[_0xafe9('0xc')]);router[_0xafe9('0xd')](_0xafe9('0x9'),auth['isAuthenticated'](),controller[_0xafe9('0xe')]);router['delete'](_0xafe9('0x9'),auth[_0xafe9('0xa')](),controller['destroy']);module[_0xafe9('0xf')]=router;
\ No newline at end of file
index 91b6dde..9c4e6a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa520=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','exports','ENUM','variable'];(function(_0x2b611a,_0x573fdd){var _0x3d3f9d=function(_0x4c45e0){while(--_0x4c45e0){_0x2b611a['push'](_0x2b611a['shift']());}};_0x3d3f9d(++_0x573fdd);}(_0xa520,0xcc));var _0x0a52=function(_0x45f767,_0x4ea17c){_0x45f767=_0x45f767-0x0;var _0x183634=_0xa520[_0x45f767];return _0x183634;};'use strict';var Sequelize=require('sequelize');module[_0x0a52('0x0')]={'type':{'type':Sequelize[_0x0a52('0x1')]('string',_0x0a52('0x2'),_0x0a52('0x3'),_0x0a52('0x4'),_0x0a52('0x5')),'defaultValue':_0x0a52('0x6')},'content':{'type':Sequelize[_0x0a52('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0a52('0x1')](_0x0a52('0x6'),_0x0a52('0x2'),_0x0a52('0x3'))},'keyContent':{'type':Sequelize[_0x0a52('0x7')]},'idField':{'type':Sequelize[_0x0a52('0x7')]},'nameField':{'type':Sequelize[_0x0a52('0x7')]},'customField':{'type':Sequelize[_0x0a52('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0a52('0x7')]}};
\ No newline at end of file
+var _0x1ab4=['customVariable','picklist','STRING','ENUM','variable','sequelize','exports','string'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x1ab4,0x10d));var _0x41ab=function(_0x3af7d4,_0x2f817b){_0x3af7d4=_0x3af7d4-0x0;var _0x4c8da4=_0x1ab4[_0x3af7d4];return _0x4c8da4;};'use strict';var Sequelize=require(_0x41ab('0x0'));module[_0x41ab('0x1')]={'type':{'type':Sequelize['ENUM'](_0x41ab('0x2'),'variable',_0x41ab('0x3'),'keyValue',_0x41ab('0x4')),'defaultValue':_0x41ab('0x2')},'content':{'type':Sequelize[_0x41ab('0x5')]},'key':{'type':Sequelize[_0x41ab('0x5')]},'keyType':{'type':Sequelize[_0x41ab('0x6')](_0x41ab('0x2'),_0x41ab('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x41ab('0x5')]},'idField':{'type':Sequelize[_0x41ab('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x41ab('0x5')]}};
\ No newline at end of file
index a6f6535..4ed568d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04dc=['../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x131deb,_0x454073){var _0x195343=function(_0x141a77){while(--_0x141a77){_0x131deb['push'](_0x131deb['shift']());}};_0x195343(++_0x454073);}(_0x04dc,0xbe));var _0xc04d=function(_0x334564,_0x4a14ca){_0x334564=_0x334564-0x0;var _0x35f756=_0x04dc[_0x334564];return _0x35f756;};'use strict';var emlformat=require(_0xc04d('0x0'));var rimraf=require(_0xc04d('0x1'));var zipdir=require(_0xc04d('0x2'));var jsonpatch=require(_0xc04d('0x3'));var rp=require(_0xc04d('0x4'));var moment=require(_0xc04d('0x5'));var BPromise=require(_0xc04d('0x6'));var Mustache=require('mustache');var util=require(_0xc04d('0x7'));var path=require(_0xc04d('0x8'));var sox=require('sox');var csv=require(_0xc04d('0x9'));var ejs=require(_0xc04d('0xa'));var fs=require('fs');var fs_extra=require(_0xc04d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc04d('0xc'));var jsforce=require(_0xc04d('0xd'));var deskjs=require(_0xc04d('0xe'));var toCsv=require(_0xc04d('0x9'));var querystring=require(_0xc04d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc04d('0x10'));var qs=require(_0xc04d('0x11'));var as=require(_0xc04d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc04d('0x13'));var utils=require(_0xc04d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc04d('0x15'))['db'];function respondWithStatusCode(_0x162a28,_0x2398f5){_0x2398f5=_0x2398f5||0xcc;return function(_0x3b4e9b){if(_0x3b4e9b){return _0x162a28[_0xc04d('0x16')](_0x2398f5);}return _0x162a28['status'](_0x2398f5)['end']();};}function respondWithResult(_0x2582c8,_0x34e9db){_0x34e9db=_0x34e9db||0xc8;return function(_0x5deb4f){if(_0x5deb4f){return _0x2582c8[_0xc04d('0x17')](_0x34e9db)[_0xc04d('0x18')](_0x5deb4f);}};}function respondWithFilteredResult(_0x33cc1b,_0x4fca3c){return function(_0x1a8697){if(_0x1a8697){var _0x3a40d9=typeof _0x4fca3c[_0xc04d('0x19')]===_0xc04d('0x1a')&&typeof _0x4fca3c['limit']===_0xc04d('0x1a');var _0x32a30b=_0x1a8697[_0xc04d('0x1b')];var _0xa17b3b=_0x3a40d9?0x0:_0x4fca3c[_0xc04d('0x19')];var _0x14272c=_0x3a40d9?_0x1a8697[_0xc04d('0x1b')]:_0x4fca3c[_0xc04d('0x19')]+_0x4fca3c[_0xc04d('0x1c')];var _0x40b59f;if(_0x14272c>=_0x32a30b){_0x14272c=_0x32a30b;_0x40b59f=0xc8;}else{_0x40b59f=0xce;}_0x33cc1b['status'](_0x40b59f);return _0x33cc1b['set'](_0xc04d('0x1d'),_0xa17b3b+'-'+_0x14272c+'/'+_0x32a30b)['json'](_0x1a8697);}return null;};}function patchUpdates(_0x51de6c){return function(_0x54ecaf){try{jsonpatch['apply'](_0x54ecaf,_0x51de6c,!![]);}catch(_0x5ea01a){return BPromise[_0xc04d('0x1e')](_0x5ea01a);}return _0x54ecaf[_0xc04d('0x1f')]();};}function saveUpdates(_0x4453a9,_0x35a1c2){return function(_0x5309c4){if(_0x5309c4){return _0x5309c4[_0xc04d('0x20')](_0x4453a9)[_0xc04d('0x21')](function(_0x59ce68){return _0x59ce68;});}return null;};}function removeEntity(_0x2a6236,_0x29a223){return function(_0x17513e){if(_0x17513e){return _0x17513e[_0xc04d('0x22')]()[_0xc04d('0x21')](function(){_0x2a6236[_0xc04d('0x17')](0xcc)[_0xc04d('0x23')]();});}};}function handleEntityNotFound(_0x587b99,_0x21e1b0){return function(_0x173309){if(!_0x173309){_0x587b99[_0xc04d('0x16')](0x194);}return _0x173309;};}function handleError(_0x5dec3d,_0x5839a7){_0x5839a7=_0x5839a7||0x1f4;return function(_0x58b107){logger[_0xc04d('0x24')](_0x58b107[_0xc04d('0x25')]);if(_0x58b107[_0xc04d('0x26')]){delete _0x58b107[_0xc04d('0x26')];}_0x5dec3d[_0xc04d('0x17')](_0x5839a7)[_0xc04d('0x27')](_0x58b107);};}exports[_0xc04d('0x28')]=function(_0x4d7eb3,_0x2fa918){var _0x248466={},_0x3ea1a4={},_0x10f28e={'count':0x0,'rows':[]};var _0x20f718=_[_0xc04d('0x29')](db[_0xc04d('0x2a')][_0xc04d('0x2b')],function(_0xd6a1f4){return{'name':_0xd6a1f4[_0xc04d('0x2c')],'type':_0xd6a1f4[_0xc04d('0x2d')][_0xc04d('0x2e')]};});_0x3ea1a4[_0xc04d('0x2f')]=_[_0xc04d('0x29')](_0x20f718,_0xc04d('0x26'));_0x3ea1a4[_0xc04d('0x30')]=_[_0xc04d('0x31')](_0x4d7eb3[_0xc04d('0x30')]);_0x3ea1a4[_0xc04d('0x32')]=_[_0xc04d('0x33')](_0x3ea1a4[_0xc04d('0x2f')],_0x3ea1a4[_0xc04d('0x30')]);_0x248466['attributes']=_[_0xc04d('0x33')](_0x3ea1a4[_0xc04d('0x2f')],qs[_0xc04d('0x34')](_0x4d7eb3[_0xc04d('0x30')][_0xc04d('0x34')]));_0x248466[_0xc04d('0x35')]=_0x248466[_0xc04d('0x35')][_0xc04d('0x36')]?_0x248466[_0xc04d('0x35')]:_0x3ea1a4[_0xc04d('0x2f')];if(!_0x4d7eb3[_0xc04d('0x30')][_0xc04d('0x37')](_0xc04d('0x38'))){_0x248466[_0xc04d('0x1c')]=qs[_0xc04d('0x1c')](_0x4d7eb3['query'][_0xc04d('0x1c')]);_0x248466[_0xc04d('0x19')]=qs[_0xc04d('0x19')](_0x4d7eb3[_0xc04d('0x30')]['offset']);}_0x248466[_0xc04d('0x39')]=qs[_0xc04d('0x3a')](_0x4d7eb3['query'][_0xc04d('0x3a')]);_0x248466[_0xc04d('0x3b')]=qs['filters'](_[_0xc04d('0x3c')](_0x4d7eb3['query'],_0x3ea1a4[_0xc04d('0x32')]),_0x20f718);if(_0x4d7eb3[_0xc04d('0x30')]['filter']){_0x248466[_0xc04d('0x3b')]=_[_0xc04d('0x3d')](_0x248466[_0xc04d('0x3b')],{'$or':_[_0xc04d('0x29')](_0x20f718,function(_0x5c9b03){if(_0x5c9b03['type']!=='VIRTUAL'){var _0x32c85c={};_0x32c85c[_0x5c9b03[_0xc04d('0x26')]]={'$like':'%'+_0x4d7eb3[_0xc04d('0x30')]['filter']+'%'};return _0x32c85c;}})});}_0x248466=_['merge']({},_0x248466,_0x4d7eb3['options']);var _0x309786={'where':_0x248466[_0xc04d('0x3b')]};return db[_0xc04d('0x2a')][_0xc04d('0x1b')](_0x309786)[_0xc04d('0x21')](function(_0x381ff7){_0x10f28e[_0xc04d('0x1b')]=_0x381ff7;if(_0x4d7eb3[_0xc04d('0x30')][_0xc04d('0x3e')]){_0x248466['include']=[{'all':!![]}];}return db[_0xc04d('0x2a')][_0xc04d('0x3f')](_0x248466);})['then'](function(_0xbde12){_0x10f28e['rows']=_0xbde12;return _0x10f28e;})['then'](respondWithFilteredResult(_0x2fa918,_0x248466))[_0xc04d('0x40')](handleError(_0x2fa918,null));};exports[_0xc04d('0x41')]=function(_0x21793e,_0x4b2f84){var _0xe4def4={'raw':!![],'where':{'id':_0x21793e[_0xc04d('0x42')]['id']}},_0xe75bf4={};_0xe75bf4[_0xc04d('0x2f')]=_['keys'](db[_0xc04d('0x2a')][_0xc04d('0x2b')]);_0xe75bf4[_0xc04d('0x30')]=_[_0xc04d('0x31')](_0x21793e['query']);_0xe75bf4[_0xc04d('0x32')]=_[_0xc04d('0x33')](_0xe75bf4['model'],_0xe75bf4['query']);_0xe4def4['attributes']=_[_0xc04d('0x33')](_0xe75bf4[_0xc04d('0x2f')],qs[_0xc04d('0x34')](_0x21793e['query']['fields']));_0xe4def4[_0xc04d('0x35')]=_0xe4def4[_0xc04d('0x35')][_0xc04d('0x36')]?_0xe4def4[_0xc04d('0x35')]:_0xe75bf4['model'];if(_0x21793e[_0xc04d('0x30')]['includeAll']){_0xe4def4['include']=[{'all':!![]}];}_0xe4def4=_['merge']({},_0xe4def4,_0x21793e['options']);return db[_0xc04d('0x2a')][_0xc04d('0x43')](_0xe4def4)[_0xc04d('0x21')](handleEntityNotFound(_0x4b2f84,null))['then'](respondWithResult(_0x4b2f84,null))['catch'](handleError(_0x4b2f84,null));};exports[_0xc04d('0x44')]=function(_0x22e6c3,_0x5588ba){return db['Dynamics365Field'][_0xc04d('0x44')](_0x22e6c3[_0xc04d('0x45')],{})['then'](respondWithResult(_0x5588ba,0xc9))[_0xc04d('0x40')](handleError(_0x5588ba,null));};exports[_0xc04d('0x20')]=function(_0xd99203,_0x2109c4){if(_0xd99203[_0xc04d('0x45')]['id']){delete _0xd99203[_0xc04d('0x45')]['id'];}return db[_0xc04d('0x2a')][_0xc04d('0x43')]({'where':{'id':_0xd99203['params']['id']}})[_0xc04d('0x21')](handleEntityNotFound(_0x2109c4,null))[_0xc04d('0x21')](saveUpdates(_0xd99203[_0xc04d('0x45')],null))[_0xc04d('0x21')](respondWithResult(_0x2109c4,null))[_0xc04d('0x40')](handleError(_0x2109c4,null));};exports[_0xc04d('0x22')]=function(_0x4a1c39,_0x213fa3){return db[_0xc04d('0x2a')]['find']({'where':{'id':_0x4a1c39[_0xc04d('0x42')]['id']}})[_0xc04d('0x21')](handleEntityNotFound(_0x213fa3,null))[_0xc04d('0x21')](removeEntity(_0x213fa3,null))[_0xc04d('0x40')](handleError(_0x213fa3,null));};
\ No newline at end of file
+var _0xa37f=['params','rawAttributes','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','sort','where','pick','filter','merge','options','Dynamics365Field','includeAll','include','rows','catch','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa37f,0xe1));var _0xfa37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa37f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa37('0x0'));var zipdir=require(_0xfa37('0x1'));var jsonpatch=require(_0xfa37('0x2'));var rp=require(_0xfa37('0x3'));var moment=require(_0xfa37('0x4'));var BPromise=require(_0xfa37('0x5'));var Mustache=require(_0xfa37('0x6'));var util=require(_0xfa37('0x7'));var path=require(_0xfa37('0x8'));var sox=require('sox');var csv=require(_0xfa37('0x9'));var ejs=require(_0xfa37('0xa'));var fs=require('fs');var fs_extra=require(_0xfa37('0xb'));var _=require(_0xfa37('0xc'));var squel=require(_0xfa37('0xd'));var crypto=require(_0xfa37('0xe'));var jsforce=require(_0xfa37('0xf'));var deskjs=require(_0xfa37('0x10'));var toCsv=require(_0xfa37('0x9'));var querystring=require('querystring');var Papa=require(_0xfa37('0x11'));var Redis=require(_0xfa37('0x12'));var authService=require(_0xfa37('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfa37('0x14'));var hardwareService=require(_0xfa37('0x15'));var logger=require('../../config/logger')(_0xfa37('0x16'));var utils=require(_0xfa37('0x17'));var config=require(_0xfa37('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa37('0x19'))['db'];function respondWithStatusCode(_0x2ea762,_0xce5634){_0xce5634=_0xce5634||0xcc;return function(_0x710335){if(_0x710335){return _0x2ea762[_0xfa37('0x1a')](_0xce5634);}return _0x2ea762[_0xfa37('0x1b')](_0xce5634)[_0xfa37('0x1c')]();};}function respondWithResult(_0x251f72,_0xd5e4ef){_0xd5e4ef=_0xd5e4ef||0xc8;return function(_0x4786d0){if(_0x4786d0){return _0x251f72[_0xfa37('0x1b')](_0xd5e4ef)[_0xfa37('0x1d')](_0x4786d0);}};}function respondWithFilteredResult(_0x4be785,_0x1a8f4b){return function(_0x2d16a4){if(_0x2d16a4){var _0x6a40a8=typeof _0x1a8f4b[_0xfa37('0x1e')]===_0xfa37('0x1f')&&typeof _0x1a8f4b[_0xfa37('0x20')]===_0xfa37('0x1f');var _0x18c8ca=_0x2d16a4[_0xfa37('0x21')];var _0x31f6dd=_0x6a40a8?0x0:_0x1a8f4b[_0xfa37('0x1e')];var _0x59a62c=_0x6a40a8?_0x2d16a4[_0xfa37('0x21')]:_0x1a8f4b[_0xfa37('0x1e')]+_0x1a8f4b[_0xfa37('0x20')];var _0x5ed29c;if(_0x59a62c>=_0x18c8ca){_0x59a62c=_0x18c8ca;_0x5ed29c=0xc8;}else{_0x5ed29c=0xce;}_0x4be785[_0xfa37('0x1b')](_0x5ed29c);return _0x4be785[_0xfa37('0x22')]('Content-Range',_0x31f6dd+'-'+_0x59a62c+'/'+_0x18c8ca)['json'](_0x2d16a4);}return null;};}function patchUpdates(_0x452c11){return function(_0x2189e2){try{jsonpatch[_0xfa37('0x23')](_0x2189e2,_0x452c11,!![]);}catch(_0x31f74f){return BPromise['reject'](_0x31f74f);}return _0x2189e2['save']();};}function saveUpdates(_0x146a30,_0x38ee81){return function(_0x52de1c){if(_0x52de1c){return _0x52de1c[_0xfa37('0x24')](_0x146a30)[_0xfa37('0x25')](function(_0x1448d0){return _0x1448d0;});}return null;};}function removeEntity(_0x297175,_0x507372){return function(_0x5ee678){if(_0x5ee678){return _0x5ee678[_0xfa37('0x26')]()['then'](function(){_0x297175['status'](0xcc)[_0xfa37('0x1c')]();});}};}function handleEntityNotFound(_0x4f5637,_0x1f3267){return function(_0x2c792a){if(!_0x2c792a){_0x4f5637[_0xfa37('0x1a')](0x194);}return _0x2c792a;};}function handleError(_0x22dee5,_0x4f2284){_0x4f2284=_0x4f2284||0x1f4;return function(_0x1b8e97){logger[_0xfa37('0x27')](_0x1b8e97[_0xfa37('0x28')]);if(_0x1b8e97[_0xfa37('0x29')]){delete _0x1b8e97[_0xfa37('0x29')];}_0x22dee5[_0xfa37('0x1b')](_0x4f2284)[_0xfa37('0x2a')](_0x1b8e97);};}exports[_0xfa37('0x2b')]=function(_0x46117f,_0xf64229){var _0x2bb54f={},_0x1f6676={},_0xc10bc={'count':0x0,'rows':[]};var _0x25802c=_[_0xfa37('0x2c')](db['Dynamics365Field']['rawAttributes'],function(_0x8d1e56){return{'name':_0x8d1e56[_0xfa37('0x2d')],'type':_0x8d1e56[_0xfa37('0x2e')][_0xfa37('0x2f')]};});_0x1f6676[_0xfa37('0x30')]=_[_0xfa37('0x2c')](_0x25802c,_0xfa37('0x29'));_0x1f6676['query']=_[_0xfa37('0x31')](_0x46117f['query']);_0x1f6676[_0xfa37('0x32')]=_[_0xfa37('0x33')](_0x1f6676[_0xfa37('0x30')],_0x1f6676[_0xfa37('0x34')]);_0x2bb54f[_0xfa37('0x35')]=_[_0xfa37('0x33')](_0x1f6676[_0xfa37('0x30')],qs[_0xfa37('0x36')](_0x46117f[_0xfa37('0x34')]['fields']));_0x2bb54f[_0xfa37('0x35')]=_0x2bb54f[_0xfa37('0x35')]['length']?_0x2bb54f[_0xfa37('0x35')]:_0x1f6676['model'];if(!_0x46117f[_0xfa37('0x34')]['hasOwnProperty']('nolimit')){_0x2bb54f[_0xfa37('0x20')]=qs['limit'](_0x46117f[_0xfa37('0x34')][_0xfa37('0x20')]);_0x2bb54f[_0xfa37('0x1e')]=qs['offset'](_0x46117f[_0xfa37('0x34')][_0xfa37('0x1e')]);}_0x2bb54f['order']=qs[_0xfa37('0x37')](_0x46117f[_0xfa37('0x34')]['sort']);_0x2bb54f[_0xfa37('0x38')]=qs['filters'](_[_0xfa37('0x39')](_0x46117f[_0xfa37('0x34')],_0x1f6676[_0xfa37('0x32')]),_0x25802c);if(_0x46117f['query'][_0xfa37('0x3a')]){_0x2bb54f['where']=_[_0xfa37('0x3b')](_0x2bb54f[_0xfa37('0x38')],{'$or':_[_0xfa37('0x2c')](_0x25802c,function(_0x243cbe){if(_0x243cbe[_0xfa37('0x2e')]!=='VIRTUAL'){var _0x4441ee={};_0x4441ee[_0x243cbe[_0xfa37('0x29')]]={'$like':'%'+_0x46117f[_0xfa37('0x34')][_0xfa37('0x3a')]+'%'};return _0x4441ee;}})});}_0x2bb54f=_['merge']({},_0x2bb54f,_0x46117f[_0xfa37('0x3c')]);var _0x8b4383={'where':_0x2bb54f[_0xfa37('0x38')]};return db[_0xfa37('0x3d')]['count'](_0x8b4383)[_0xfa37('0x25')](function(_0xdc2b96){_0xc10bc['count']=_0xdc2b96;if(_0x46117f[_0xfa37('0x34')][_0xfa37('0x3e')]){_0x2bb54f[_0xfa37('0x3f')]=[{'all':!![]}];}return db[_0xfa37('0x3d')]['findAll'](_0x2bb54f);})[_0xfa37('0x25')](function(_0x15104c){_0xc10bc[_0xfa37('0x40')]=_0x15104c;return _0xc10bc;})['then'](respondWithFilteredResult(_0xf64229,_0x2bb54f))[_0xfa37('0x41')](handleError(_0xf64229,null));};exports[_0xfa37('0x42')]=function(_0x1b1d0b,_0xcbc873){var _0x362947={'raw':!![],'where':{'id':_0x1b1d0b[_0xfa37('0x43')]['id']}},_0x30e848={};_0x30e848[_0xfa37('0x30')]=_[_0xfa37('0x31')](db['Dynamics365Field'][_0xfa37('0x44')]);_0x30e848[_0xfa37('0x34')]=_[_0xfa37('0x31')](_0x1b1d0b[_0xfa37('0x34')]);_0x30e848[_0xfa37('0x32')]=_[_0xfa37('0x33')](_0x30e848['model'],_0x30e848[_0xfa37('0x34')]);_0x362947[_0xfa37('0x35')]=_[_0xfa37('0x33')](_0x30e848['model'],qs[_0xfa37('0x36')](_0x1b1d0b[_0xfa37('0x34')][_0xfa37('0x36')]));_0x362947[_0xfa37('0x35')]=_0x362947['attributes'][_0xfa37('0x45')]?_0x362947[_0xfa37('0x35')]:_0x30e848['model'];if(_0x1b1d0b[_0xfa37('0x34')][_0xfa37('0x3e')]){_0x362947[_0xfa37('0x3f')]=[{'all':!![]}];}_0x362947=_['merge']({},_0x362947,_0x1b1d0b[_0xfa37('0x3c')]);return db['Dynamics365Field'][_0xfa37('0x46')](_0x362947)['then'](handleEntityNotFound(_0xcbc873,null))[_0xfa37('0x25')](respondWithResult(_0xcbc873,null))[_0xfa37('0x41')](handleError(_0xcbc873,null));};exports[_0xfa37('0x47')]=function(_0x4b65ea,_0x51b800){return db['Dynamics365Field'][_0xfa37('0x47')](_0x4b65ea['body'],{})[_0xfa37('0x25')](respondWithResult(_0x51b800,0xc9))[_0xfa37('0x41')](handleError(_0x51b800,null));};exports[_0xfa37('0x24')]=function(_0x5d1eb8,_0x314932){if(_0x5d1eb8['body']['id']){delete _0x5d1eb8[_0xfa37('0x48')]['id'];}return db['Dynamics365Field'][_0xfa37('0x46')]({'where':{'id':_0x5d1eb8['params']['id']}})[_0xfa37('0x25')](handleEntityNotFound(_0x314932,null))['then'](saveUpdates(_0x5d1eb8[_0xfa37('0x48')],null))['then'](respondWithResult(_0x314932,null))[_0xfa37('0x41')](handleError(_0x314932,null));};exports[_0xfa37('0x26')]=function(_0x4c0551,_0x5d574a){return db['Dynamics365Field'][_0xfa37('0x46')]({'where':{'id':_0x4c0551[_0xfa37('0x43')]['id']}})[_0xfa37('0x25')](handleEntityNotFound(_0x5d574a,null))[_0xfa37('0x25')](removeEntity(_0x5d574a,null))['catch'](handleError(_0x5d574a,null));};
\ No newline at end of file
index 132be97..effe1af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e43=['lodash','api','moment','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField'];(function(_0x56fea1,_0xca8400){var _0xe07336=function(_0x57648b){while(--_0x57648b){_0x56fea1['push'](_0x56fea1['shift']());}};_0xe07336(++_0xca8400);}(_0x0e43,0x84));var _0x30e4=function(_0x56250d,_0x295cbc){_0x56250d=_0x56250d-0x0;var _0x5865e3=_0x0e43[_0x56250d];return _0x5865e3;};'use strict';var _=require(_0x30e4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x30e4('0x1'));var moment=require(_0x30e4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x30e4('0x3'));var config=require(_0x30e4('0x4'));var attributes=require(_0x30e4('0x5'));module[_0x30e4('0x6')]=function(_0x1a2783,_0x5e177c){return _0x1a2783[_0x30e4('0x7')](_0x30e4('0x8'),attributes,{'tableName':_0x30e4('0x9'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x30e4('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x18d8=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x3f0d06,_0x1a82e0){var _0x4b1312=function(_0x3e2a29){while(--_0x3e2a29){_0x3f0d06['push'](_0x3f0d06['shift']());}};_0x4b1312(++_0x1a82e0);}(_0x18d8,0x69));var _0x818d=function(_0x46c524,_0x13490b){_0x46c524=_0x46c524-0x0;var _0x3e8987=_0x18d8[_0x46c524];return _0x3e8987;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x818d('0x0'));var moment=require('moment');var BPromise=require(_0x818d('0x1'));var rp=require(_0x818d('0x2'));var fs=require('fs');var path=require(_0x818d('0x3'));var rimraf=require(_0x818d('0x4'));var config=require(_0x818d('0x5'));var attributes=require(_0x818d('0x6'));module[_0x818d('0x7')]=function(_0x1d114d,_0x336e3c){return _0x1d114d[_0x818d('0x8')](_0x818d('0x9'),attributes,{'tableName':_0x818d('0xa'),'paranoid':![],'indexes':[{'name':_0x818d('0xb'),'fields':[_0x818d('0xc'),_0x818d('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 490891b..e9361d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52bb=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x52bb,0xb0));var _0xb52b=function(_0x25fc35,_0x5028b5){_0x25fc35=_0x25fc35-0x0;var _0x33a33c=_0x52bb[_0x25fc35];return _0x33a33c;};'use strict';var _=require('lodash');var util=require(_0xb52b('0x0'));var moment=require(_0xb52b('0x1'));var BPromise=require(_0xb52b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb52b('0x3'));var db=require(_0xb52b('0x4'))['db'];var utils=require(_0xb52b('0x5'));var logger=require(_0xb52b('0x6'))(_0xb52b('0x7'));var config=require(_0xb52b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb52b('0x9')][_0xb52b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d8284,_0x528524,_0x51223c){return new BPromise(function(_0x3a6855,_0x46d468){return client[_0xb52b('0xb')](_0x2d8284,_0x51223c)[_0xb52b('0xc')](function(_0x3e525a){logger[_0xb52b('0xd')](_0xb52b('0xe'),_0x528524,_0xb52b('0xf'));logger[_0xb52b('0x10')](_0xb52b('0x11'),_0x528524,_0xb52b('0xf'),JSON[_0xb52b('0x12')](_0x3e525a));if(_0x3e525a[_0xb52b('0x13')]){if(_0x3e525a['error']['code']===0x1f4){logger['error'](_0xb52b('0xe'),_0x528524,_0x3e525a[_0xb52b('0x13')][_0xb52b('0x14')]);return _0x46d468(_0x3e525a[_0xb52b('0x13')][_0xb52b('0x14')]);}logger[_0xb52b('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x528524,_0x3e525a[_0xb52b('0x13')][_0xb52b('0x14')]);return _0x3a6855(_0x3e525a[_0xb52b('0x13')]['message']);}else{logger[_0xb52b('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x528524,_0xb52b('0xf'));_0x3a6855(_0x3e525a[_0xb52b('0x15')][_0xb52b('0x14')]);}})['catch'](function(_0x3540d7){logger[_0xb52b('0x13')](_0xb52b('0xe'),_0x528524,_0x3540d7);_0x46d468(_0x3540d7);});});}
\ No newline at end of file
+var _0xb641=['stringify','error','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0xb641,0x132));var _0x1b64=function(_0x2c5d3c,_0xadc5c3){_0x2c5d3c=_0x2c5d3c-0x0;var _0x42237e=_0xb641[_0x2c5d3c];return _0x42237e;};'use strict';var _=require(_0x1b64('0x0'));var util=require(_0x1b64('0x1'));var moment=require(_0x1b64('0x2'));var BPromise=require(_0x1b64('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b64('0x4'));var db=require(_0x1b64('0x5'))['db'];var utils=require(_0x1b64('0x6'));var logger=require(_0x1b64('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1b64('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59a989,_0x2ca0e0,_0x402217){return new BPromise(function(_0x10e7b1,_0x224365){return client[_0x1b64('0x9')](_0x59a989,_0x402217)[_0x1b64('0xa')](function(_0x2a2f66){logger[_0x1b64('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x2ca0e0,_0x1b64('0xc'));logger['debug'](_0x1b64('0xd'),_0x2ca0e0,_0x1b64('0xc'),JSON[_0x1b64('0xe')](_0x2a2f66));if(_0x2a2f66[_0x1b64('0xf')]){if(_0x2a2f66[_0x1b64('0xf')]['code']===0x1f4){logger[_0x1b64('0xf')](_0x1b64('0x10'),_0x2ca0e0,_0x2a2f66['error'][_0x1b64('0x11')]);return _0x224365(_0x2a2f66[_0x1b64('0xf')][_0x1b64('0x11')]);}logger['error'](_0x1b64('0x10'),_0x2ca0e0,_0x2a2f66['error'][_0x1b64('0x11')]);return _0x10e7b1(_0x2a2f66['error'][_0x1b64('0x11')]);}else{logger[_0x1b64('0xb')](_0x1b64('0x10'),_0x2ca0e0,_0x1b64('0xc'));_0x10e7b1(_0x2a2f66[_0x1b64('0x12')][_0x1b64('0x11')]);}})[_0x1b64('0x13')](function(_0x191a6e){logger['error'](_0x1b64('0x10'),_0x2ca0e0,_0x191a6e);_0x224365(_0x191a6e);});});}
\ No newline at end of file
index da6e432..686b62b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x623e=['/:id/configurations','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','getConfigurations','getFields','post','create'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x623e,0x1a8));var _0xe623=function(_0x2fe6fa,_0x4f2c02){_0x2fe6fa=_0x2fe6fa-0x0;var _0x4fce31=_0x623e[_0x2fe6fa];return _0x4fce31;};'use strict';var multer=require(_0xe623('0x0'));var util=require('util');var path=require(_0xe623('0x1'));var timeout=require(_0xe623('0x2'));var express=require('express');var router=express[_0xe623('0x3')]();var fs_extra=require(_0xe623('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe623('0x5'));var config=require(_0xe623('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0xe623('0x7')]('/',auth['isAuthenticated'](),controller[_0xe623('0x8')]);router[_0xe623('0x7')](_0xe623('0x9'),auth[_0xe623('0xa')](),controller[_0xe623('0xb')]);router[_0xe623('0x7')]('/:id/configurations',auth[_0xe623('0xa')](),controller[_0xe623('0xc')]);router[_0xe623('0x7')]('/:id/fields',auth[_0xe623('0xa')](),controller[_0xe623('0xd')]);router[_0xe623('0xe')]('/',auth[_0xe623('0xa')](),controller[_0xe623('0xf')]);router[_0xe623('0xe')](_0xe623('0x10'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xe623('0x11')]('/:id',auth[_0xe623('0xa')](),controller[_0xe623('0x12')]);router[_0xe623('0x13')](_0xe623('0x9'),auth['isAuthenticated'](),controller[_0xe623('0x14')]);module[_0xe623('0x15')]=router;
\ No newline at end of file
+var _0xce19=['getFields','post','create','/:id/configurations','update','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields'];(function(_0x3df004,_0x29f225){var _0x1591e0=function(_0x54cefe){while(--_0x54cefe){_0x3df004['push'](_0x3df004['shift']());}};_0x1591e0(++_0x29f225);}(_0xce19,0x15a));var _0x9ce1=function(_0x38eba3,_0xd5db83){_0x38eba3=_0x38eba3-0x0;var _0x12546f=_0xce19[_0x38eba3];return _0x12546f;};'use strict';var multer=require(_0x9ce1('0x0'));var util=require('util');var path=require(_0x9ce1('0x1'));var timeout=require(_0x9ce1('0x2'));var express=require('express');var router=express[_0x9ce1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9ce1('0x4'));var interaction=require(_0x9ce1('0x5'));var config=require(_0x9ce1('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0x9ce1('0x7')]('/',auth[_0x9ce1('0x8')](),controller[_0x9ce1('0x9')]);router[_0x9ce1('0x7')](_0x9ce1('0xa'),auth[_0x9ce1('0x8')](),controller[_0x9ce1('0xb')]);router[_0x9ce1('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9ce1('0xc')]);router[_0x9ce1('0x7')](_0x9ce1('0xd'),auth['isAuthenticated'](),controller[_0x9ce1('0xe')]);router[_0x9ce1('0xf')]('/',auth[_0x9ce1('0x8')](),controller[_0x9ce1('0x10')]);router[_0x9ce1('0xf')](_0x9ce1('0x11'),auth[_0x9ce1('0x8')](),controller['addConfiguration']);router['put'](_0x9ce1('0xa'),auth[_0x9ce1('0x8')](),controller[_0x9ce1('0x12')]);router['delete'](_0x9ce1('0xa'),auth[_0x9ce1('0x8')](),controller[_0x9ce1('0x13')]);module['exports']=router;
\ No newline at end of file
index 7b4eba1..e5d8278 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1893=['STRING','username','remoteUri'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x1893,0xa2));var _0x3189=function(_0x459baf,_0x332707){_0x459baf=_0x459baf-0x0;var _0x4a5970=_0x1893[_0x459baf];return _0x4a5970;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3189('0x0')]},'description':{'type':Sequelize[_0x3189('0x0')]},'username':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x1')},'apiKey':{'type':Sequelize[_0x3189('0x0')]},'remoteUri':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x236c=['remoteUri','sequelize','STRING','username'];(function(_0x39006a,_0x15ce01){var _0x5e320f=function(_0x2e0bb9){while(--_0x2e0bb9){_0x39006a['push'](_0x39006a['shift']());}};_0x5e320f(++_0x15ce01);}(_0x236c,0x155));var _0xc236=function(_0x3fb5e9,_0x21ffa2){_0x3fb5e9=_0x3fb5e9-0x0;var _0x2801dc=_0x236c[_0x3fb5e9];return _0x2801dc;};'use strict';var Sequelize=require(_0xc236('0x0'));module['exports']={'name':{'type':Sequelize[_0xc236('0x1')]},'description':{'type':Sequelize[_0xc236('0x1')]},'username':{'type':Sequelize[_0xc236('0x1')],'unique':_0xc236('0x2')},'apiKey':{'type':Sequelize[_0xc236('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xc236('0x3')},'serverUrl':{'type':Sequelize[_0xc236('0x1')],'allowNull':![]}};
\ No newline at end of file
index ef3d4ad..89636fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x851a=['send','index','map','FreshdeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','catch','create','body','find','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','lastIndexOf','format','Basic\x20%s','%s:X','toString','base64','subject','agent','group','source','ticket_type','company','remove','includes','default','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name'];(function(_0xfcbf57,_0x4b05fd){var _0x1078fa=function(_0xb65856){while(--_0xb65856){_0xfcbf57['push'](_0xfcbf57['shift']());}};_0x1078fa(++_0x4b05fd);}(_0x851a,0x19b));var _0xa851=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x851a[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0xa851('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa851('0x1'));var jsonpatch=require(_0xa851('0x2'));var rp=require(_0xa851('0x3'));var moment=require(_0xa851('0x4'));var BPromise=require(_0xa851('0x5'));var Mustache=require(_0xa851('0x6'));var util=require(_0xa851('0x7'));var path=require(_0xa851('0x8'));var sox=require('sox');var csv=require(_0xa851('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa851('0xa'));var _=require(_0xa851('0xb'));var squel=require(_0xa851('0xc'));var crypto=require('crypto');var jsforce=require(_0xa851('0xd'));var deskjs=require(_0xa851('0xe'));var toCsv=require(_0xa851('0x9'));var querystring=require(_0xa851('0xf'));var Papa=require('papaparse');var Redis=require(_0xa851('0x10'));var authService=require(_0xa851('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa851('0x12'));var hardwareService=require(_0xa851('0x13'));var logger=require(_0xa851('0x14'))(_0xa851('0x15'));var utils=require(_0xa851('0x16'));var config=require(_0xa851('0x17'));var licenseUtil=require(_0xa851('0x18'));var db=require(_0xa851('0x19'))['db'];var integrations=require(_0xa851('0x1a'));function respondWithStatusCode(_0x184d51,_0x349d2d){_0x349d2d=_0x349d2d||0xcc;return function(_0x25efd8){if(_0x25efd8){return _0x184d51[_0xa851('0x1b')](_0x349d2d);}return _0x184d51[_0xa851('0x1c')](_0x349d2d)[_0xa851('0x1d')]();};}function respondWithResult(_0x2ad4b2,_0x290272){_0x290272=_0x290272||0xc8;return function(_0x22dfc4){if(_0x22dfc4){return _0x2ad4b2['status'](_0x290272)[_0xa851('0x1e')](_0x22dfc4);}};}function respondWithFilteredResult(_0x335947,_0xfb70b5){return function(_0x3d4dd6){if(_0x3d4dd6){var _0x5be85d=typeof _0xfb70b5[_0xa851('0x1f')]===_0xa851('0x20')&&typeof _0xfb70b5[_0xa851('0x21')]===_0xa851('0x20');var _0x4e6ad0=_0x3d4dd6['count'];var _0x3bfd42=_0x5be85d?0x0:_0xfb70b5['offset'];var _0x23d32d=_0x5be85d?_0x3d4dd6[_0xa851('0x22')]:_0xfb70b5[_0xa851('0x1f')]+_0xfb70b5[_0xa851('0x21')];var _0x128226;if(_0x23d32d>=_0x4e6ad0){_0x23d32d=_0x4e6ad0;_0x128226=0xc8;}else{_0x128226=0xce;}_0x335947[_0xa851('0x1c')](_0x128226);return _0x335947[_0xa851('0x23')](_0xa851('0x24'),_0x3bfd42+'-'+_0x23d32d+'/'+_0x4e6ad0)[_0xa851('0x1e')](_0x3d4dd6);}return null;};}function patchUpdates(_0x5bfe0e){return function(_0x394f7d){try{jsonpatch[_0xa851('0x25')](_0x394f7d,_0x5bfe0e,!![]);}catch(_0x521f57){return BPromise[_0xa851('0x26')](_0x521f57);}return _0x394f7d[_0xa851('0x27')]();};}function saveUpdates(_0x59cad2,_0x1ed43b){return function(_0x163b23){if(_0x163b23){return _0x163b23[_0xa851('0x28')](_0x59cad2)[_0xa851('0x29')](function(_0x304afd){return _0x304afd;});}return null;};}function removeEntity(_0x233cb7,_0x3d956d){return function(_0x19c9aa){if(_0x19c9aa){return _0x19c9aa[_0xa851('0x2a')]()[_0xa851('0x29')](function(){_0x233cb7[_0xa851('0x1c')](0xcc)[_0xa851('0x1d')]();});}};}function handleEntityNotFound(_0x4f728c,_0x43671d){return function(_0x172434){if(!_0x172434){_0x4f728c[_0xa851('0x1b')](0x194);}return _0x172434;};}function handleError(_0x47cd5a,_0x22e674){_0x22e674=_0x22e674||0x1f4;return function(_0x491c26){logger[_0xa851('0x2b')](_0x491c26['stack']);if(_0x491c26[_0xa851('0x2c')]){delete _0x491c26[_0xa851('0x2c')];}_0x47cd5a['status'](_0x22e674)[_0xa851('0x2d')](_0x491c26);};}exports[_0xa851('0x2e')]=function(_0xa06c66,_0xae32a0){var _0x2ae215={},_0x2ad510={},_0x5312a7={'count':0x0,'rows':[]};var _0x356bc2=_[_0xa851('0x2f')](db[_0xa851('0x30')]['rawAttributes'],function(_0x1788a6){return{'name':_0x1788a6[_0xa851('0x31')],'type':_0x1788a6[_0xa851('0x32')][_0xa851('0x33')]};});_0x2ad510[_0xa851('0x34')]=_[_0xa851('0x2f')](_0x356bc2,_0xa851('0x2c'));_0x2ad510[_0xa851('0x35')]=_[_0xa851('0x36')](_0xa06c66[_0xa851('0x35')]);_0x2ad510[_0xa851('0x37')]=_[_0xa851('0x38')](_0x2ad510['model'],_0x2ad510[_0xa851('0x35')]);_0x2ae215[_0xa851('0x39')]=_[_0xa851('0x38')](_0x2ad510[_0xa851('0x34')],qs[_0xa851('0x3a')](_0xa06c66[_0xa851('0x35')]['fields']));_0x2ae215['attributes']=_0x2ae215[_0xa851('0x39')][_0xa851('0x3b')]?_0x2ae215['attributes']:_0x2ad510[_0xa851('0x34')];if(!_0xa06c66[_0xa851('0x35')][_0xa851('0x3c')](_0xa851('0x3d'))){_0x2ae215[_0xa851('0x21')]=qs[_0xa851('0x21')](_0xa06c66[_0xa851('0x35')][_0xa851('0x21')]);_0x2ae215[_0xa851('0x1f')]=qs['offset'](_0xa06c66[_0xa851('0x35')][_0xa851('0x1f')]);}_0x2ae215[_0xa851('0x3e')]=qs[_0xa851('0x3f')](_0xa06c66[_0xa851('0x35')][_0xa851('0x3f')]);_0x2ae215['where']=qs[_0xa851('0x37')](_[_0xa851('0x40')](_0xa06c66['query'],_0x2ad510[_0xa851('0x37')]),_0x356bc2);if(_0xa06c66['query'][_0xa851('0x41')]){_0x2ae215[_0xa851('0x42')]=_[_0xa851('0x43')](_0x2ae215['where'],{'$or':_[_0xa851('0x2f')](_0x356bc2,function(_0x4c6066){if(_0x4c6066[_0xa851('0x32')]!==_0xa851('0x44')){var _0x291642={};_0x291642[_0x4c6066[_0xa851('0x2c')]]={'$like':'%'+_0xa06c66[_0xa851('0x35')][_0xa851('0x41')]+'%'};return _0x291642;}})});}_0x2ae215=_[_0xa851('0x43')]({},_0x2ae215,_0xa06c66[_0xa851('0x45')]);var _0x272568={'where':_0x2ae215[_0xa851('0x42')]};return db[_0xa851('0x30')][_0xa851('0x22')](_0x272568)[_0xa851('0x29')](function(_0x3597e1){_0x5312a7[_0xa851('0x22')]=_0x3597e1;if(_0xa06c66[_0xa851('0x35')][_0xa851('0x46')]){_0x2ae215[_0xa851('0x47')]=[{'all':!![]}];}return db[_0xa851('0x30')]['findAll'](_0x2ae215);})[_0xa851('0x29')](function(_0x8c2fa2){_0x5312a7[_0xa851('0x48')]=_0x8c2fa2;return _0x5312a7;})['then'](respondWithFilteredResult(_0xae32a0,_0x2ae215))['catch'](handleError(_0xae32a0,null));};exports[_0xa851('0x49')]=function(_0x42690c,_0x585930){var _0x1609a8={'raw':![],'where':{'id':_0x42690c[_0xa851('0x4a')]['id']}},_0x46440d={};_0x46440d[_0xa851('0x34')]=_[_0xa851('0x36')](db[_0xa851('0x30')][_0xa851('0x4b')]);_0x46440d[_0xa851('0x35')]=_['keys'](_0x42690c[_0xa851('0x35')]);_0x46440d['filters']=_[_0xa851('0x38')](_0x46440d[_0xa851('0x34')],_0x46440d['query']);_0x1609a8[_0xa851('0x39')]=_[_0xa851('0x38')](_0x46440d[_0xa851('0x34')],qs[_0xa851('0x3a')](_0x42690c[_0xa851('0x35')][_0xa851('0x3a')]));_0x1609a8['attributes']=_0x1609a8[_0xa851('0x39')][_0xa851('0x3b')]?_0x1609a8[_0xa851('0x39')]:_0x46440d[_0xa851('0x34')];if(_0x42690c[_0xa851('0x35')][_0xa851('0x46')]){_0x1609a8[_0xa851('0x47')]=[{'all':!![]}];}_0x1609a8=_['merge']({},_0x1609a8,_0x42690c[_0xa851('0x45')]);return db[_0xa851('0x30')]['find'](_0x1609a8)[_0xa851('0x29')](handleEntityNotFound(_0x585930,null))[_0xa851('0x29')](respondWithResult(_0x585930,null))[_0xa851('0x4c')](handleError(_0x585930,null));};exports[_0xa851('0x4d')]=function(_0x1947b8,_0x53c35e){return db[_0xa851('0x30')][_0xa851('0x4d')](_0x1947b8[_0xa851('0x4e')],{})[_0xa851('0x29')](respondWithResult(_0x53c35e,0xc9))[_0xa851('0x4c')](handleError(_0x53c35e,null));};exports[_0xa851('0x28')]=function(_0x578e31,_0x327250){if(_0x578e31[_0xa851('0x4e')]['id']){delete _0x578e31['body']['id'];}return db[_0xa851('0x30')][_0xa851('0x4f')]({'where':{'id':_0x578e31['params']['id']}})[_0xa851('0x29')](handleEntityNotFound(_0x327250,null))[_0xa851('0x29')](saveUpdates(_0x578e31[_0xa851('0x4e')],null))[_0xa851('0x29')](respondWithResult(_0x327250,null))[_0xa851('0x4c')](handleError(_0x327250,null));};exports[_0xa851('0x2a')]=function(_0x57df78,_0xbf7350){return db[_0xa851('0x30')][_0xa851('0x4f')]({'where':{'id':_0x57df78[_0xa851('0x4a')]['id']}})[_0xa851('0x29')](handleEntityNotFound(_0xbf7350,null))[_0xa851('0x29')](removeEntity(_0xbf7350,null))[_0xa851('0x4c')](handleError(_0xbf7350,null));};exports[_0xa851('0x50')]=function(_0x229b74,_0x2fdce9,_0x2af4de){var _0xe31eb4={};var _0x36513a={};var _0x26e0da;var _0x492b9a;return db[_0xa851('0x30')][_0xa851('0x51')]({'where':{'id':_0x229b74[_0xa851('0x4a')]['id']}})[_0xa851('0x29')](handleEntityNotFound(_0x2fdce9,null))[_0xa851('0x29')](function(_0x32130e){if(_0x32130e){_0x26e0da=_0x32130e;_0x36513a[_0xa851('0x34')]=_[_0xa851('0x36')](db['FreshdeskConfiguration'][_0xa851('0x4b')]);_0x36513a[_0xa851('0x35')]=_['keys'](_0x229b74['query']);_0x36513a[_0xa851('0x37')]=_[_0xa851('0x38')](_0x36513a[_0xa851('0x34')],_0x36513a[_0xa851('0x35')]);_0xe31eb4[_0xa851('0x39')]=_[_0xa851('0x38')](_0x36513a[_0xa851('0x34')],qs[_0xa851('0x3a')](_0x229b74[_0xa851('0x35')][_0xa851('0x3a')]));_0xe31eb4[_0xa851('0x39')]=_0xe31eb4['attributes'][_0xa851('0x3b')]?_0xe31eb4[_0xa851('0x39')]:_0x36513a[_0xa851('0x34')];_0xe31eb4[_0xa851('0x3e')]=qs[_0xa851('0x3f')](_0x229b74[_0xa851('0x35')][_0xa851('0x3f')]);_0xe31eb4[_0xa851('0x42')]=qs['filters'](_[_0xa851('0x40')](_0x229b74['query'],_0x36513a[_0xa851('0x37')]));if(_0x229b74['query'][_0xa851('0x41')]){_0xe31eb4[_0xa851('0x42')]=_[_0xa851('0x43')](_0xe31eb4['where'],{'$or':_[_0xa851('0x2f')](_0xe31eb4['attributes'],function(_0x4d4817){var _0x5783d6={};_0x5783d6[_0x4d4817]={'$like':'%'+_0x229b74['query'][_0xa851('0x41')]+'%'};return _0x5783d6;})});}_0xe31eb4=_[_0xa851('0x43')]({},_0xe31eb4,_0x229b74[_0xa851('0x45')]);return _0x26e0da[_0xa851('0x50')](_0xe31eb4);}})[_0xa851('0x29')](function(_0x37d804){if(_0x37d804){_0x492b9a=_0x37d804['length'];if(!_0x229b74[_0xa851('0x35')]['hasOwnProperty']('nolimit')){_0xe31eb4[_0xa851('0x21')]=qs[_0xa851('0x21')](_0x229b74[_0xa851('0x35')][_0xa851('0x21')]);_0xe31eb4[_0xa851('0x1f')]=qs[_0xa851('0x1f')](_0x229b74[_0xa851('0x35')][_0xa851('0x1f')]);}return _0x26e0da[_0xa851('0x50')](_0xe31eb4);}})[_0xa851('0x29')](function(_0xde2813){if(_0xde2813){return _0xde2813?{'count':_0x492b9a,'rows':_0xde2813}:null;}})[_0xa851('0x29')](respondWithResult(_0x2fdce9,null))['catch'](handleError(_0x2fdce9,null));};exports[_0xa851('0x52')]=function(_0x1aabbf,_0x5e0273,_0x58f912){if(_0x1aabbf[_0xa851('0x4e')]['id']){delete _0x1aabbf[_0xa851('0x4e')]['id'];}return db[_0xa851('0x30')][_0xa851('0x51')]({'where':{'id':_0x1aabbf[_0xa851('0x4a')]['id']}})[_0xa851('0x29')](handleEntityNotFound(_0x5e0273,null))['then'](function(_0x303990){if(_0x303990){_0x1aabbf['body'][_0xa851('0x53')]=_0x303990['id'];_0x1aabbf[_0xa851('0x4e')][_0xa851('0x54')]=integrations[_0xa851('0x55')](_0x1aabbf[_0xa851('0x4e')][_0xa851('0x56')],_0x1aabbf[_0xa851('0x4e')][_0xa851('0x32')]);_0x1aabbf['body'][_0xa851('0x57')]=integrations['getDescriptions'](_0x1aabbf[_0xa851('0x4e')][_0xa851('0x56')],_0x1aabbf[_0xa851('0x4e')]['type']);return db['FreshdeskConfiguration'][_0xa851('0x4d')](_0x1aabbf['body'],{'include':[{'model':db['FreshdeskField'],'as':_0xa851('0x54')},{'model':db[_0xa851('0x58')],'as':_0xa851('0x57')}]});}return null;})[_0xa851('0x29')](respondWithResult(_0x5e0273,null))[_0xa851('0x4c')](handleError(_0x5e0273,null));};exports[_0xa851('0x59')]=function(_0x25c6f4,_0x3adebe,_0x3ed29e){var _0x5261d1='';return db[_0xa851('0x30')]['findOne']({'where':{'id':_0x25c6f4[_0xa851('0x4a')]['id']},'attributes':['id','remoteUri',_0xa851('0x5a')]})[_0xa851('0x29')](handleEntityNotFound(_0x3adebe,null))[_0xa851('0x29')](function(_0x13d7b9){if(_0x13d7b9){_0x5261d1=_0x13d7b9[_0xa851('0x5b')];var _0x1151fc=_0x5261d1[_0xa851('0x5c')](-0x1);if(_0x1151fc==='/'){_0x5261d1=_0x5261d1['substring'](0x0,_0x5261d1[_0xa851('0x5d')](_0x1151fc));}return rp({'method':'GET','uri':util['format']('%s/%s',_0x5261d1,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xa851('0x5e')](_0xa851('0x5f'),new Buffer(util[_0xa851('0x5e')](_0xa851('0x60'),_0x13d7b9[_0xa851('0x5a')]))[_0xa851('0x61')](_0xa851('0x62')))},'json':!![]});}})[_0xa851('0x29')](function(_0x165b20){if(_0x165b20){var _0x9fd044=['requester',_0xa851('0x63'),_0xa851('0x64'),'description',_0xa851('0x1c'),'priority',_0xa851('0x65'),_0xa851('0x66'),_0xa851('0x67'),_0xa851('0x65'),_0xa851('0x68')];_[_0xa851('0x69')](_0x165b20,function(_0x4d253d){return _0x9fd044[_0xa851('0x6a')](_0x4d253d[_0xa851('0x2c')])||!_0x4d253d[_0xa851('0x6b')]&&_0x4d253d[_0xa851('0x32')]!=='custom_text'&&_0x4d253d['type']!=='custom_dropdown';});return{'count':_0x165b20[_0xa851('0x3b')],'rows':_['map'](_0x165b20,function(_0x34de23){return{'id':_0x34de23[_0xa851('0x2c')],'name':_0x34de23[_0xa851('0x6c')],'custom':!_0x34de23[_0xa851('0x6b')],'options':_0x34de23['choices']?_[_0xa851('0x2f')](_0x34de23[_0xa851('0x6d')],function(_0x3d563e){return{'name':_['capitalize'](_0x3d563e),'value':_0x3d563e};}):[]};})};}})[_0xa851('0x29')](respondWithResult(_0x3adebe,null))[_0xa851('0x4c')](function(_0x50b179){var _0x93202b=_0x25c6f4[_0xa851('0x35')]['test']?0x1f4:_0x50b179[_0xa851('0x6e')]||0x1f4;logger[_0xa851('0x2b')](_0xa851('0x6f'),'getFields',_0x93202b,JSON['stringify'](_0x50b179));delete _0x50b179[_0xa851('0x2c')];if(_0x93202b===0x191){_0x93202b=0x190;}_0x3adebe['status'](_0x93202b)[_0xa851('0x2d')](_0x25c6f4['query'][_0xa851('0x70')]?{'message':_0xa851('0x71'),'statusCode':_0x50b179[_0xa851('0x6e')]}:_0x50b179);});};
\ No newline at end of file
+var _0x9649=['pick','type','VIRTUAL','filter','merge','options','includeAll','include','FreshdeskAccount','findAll','catch','show','length','find','create','body','params','getConfigurations','FreshdeskConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','substring','GET','%s/%s','api/v2/ticket_fields','format','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0xc2a314,_0x5b6fdf){var _0x296a4d=function(_0x203837){while(--_0x203837){_0xc2a314['push'](_0xc2a314['shift']());}};_0x296a4d(++_0x5b6fdf);}(_0x9649,0x118));var _0x9964=function(_0x36cc1a,_0x41eec8){_0x36cc1a=_0x36cc1a-0x0;var _0x54ee80=_0x9649[_0x36cc1a];return _0x54ee80;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9964('0x2'));var rp=require(_0x9964('0x3'));var moment=require(_0x9964('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9964('0x5'));var util=require(_0x9964('0x6'));var path=require(_0x9964('0x7'));var sox=require(_0x9964('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9964('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9964('0xa'));var jsforce=require(_0x9964('0xb'));var deskjs=require(_0x9964('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9964('0xd'));var Papa=require(_0x9964('0xe'));var Redis=require(_0x9964('0xf'));var authService=require(_0x9964('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9964('0x12'))(_0x9964('0x13'));var utils=require('../../config/utils');var config=require(_0x9964('0x14'));var licenseUtil=require(_0x9964('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9964('0x16'));function respondWithStatusCode(_0x4ef5c5,_0x1b8afa){_0x1b8afa=_0x1b8afa||0xcc;return function(_0x262961){if(_0x262961){return _0x4ef5c5[_0x9964('0x17')](_0x1b8afa);}return _0x4ef5c5[_0x9964('0x18')](_0x1b8afa)[_0x9964('0x19')]();};}function respondWithResult(_0x360a02,_0x44ce20){_0x44ce20=_0x44ce20||0xc8;return function(_0x59efc7){if(_0x59efc7){return _0x360a02['status'](_0x44ce20)[_0x9964('0x1a')](_0x59efc7);}};}function respondWithFilteredResult(_0x2be683,_0x561571){return function(_0x416340){if(_0x416340){var _0x2b0aba=typeof _0x561571[_0x9964('0x1b')]===_0x9964('0x1c')&&typeof _0x561571[_0x9964('0x1d')]===_0x9964('0x1c');var _0x51ecc5=_0x416340[_0x9964('0x1e')];var _0x21766f=_0x2b0aba?0x0:_0x561571['offset'];var _0x5bf270=_0x2b0aba?_0x416340['count']:_0x561571[_0x9964('0x1b')]+_0x561571[_0x9964('0x1d')];var _0x2a2648;if(_0x5bf270>=_0x51ecc5){_0x5bf270=_0x51ecc5;_0x2a2648=0xc8;}else{_0x2a2648=0xce;}_0x2be683[_0x9964('0x18')](_0x2a2648);return _0x2be683['set'](_0x9964('0x1f'),_0x21766f+'-'+_0x5bf270+'/'+_0x51ecc5)['json'](_0x416340);}return null;};}function patchUpdates(_0x470a8d){return function(_0x2d2f07){try{jsonpatch[_0x9964('0x20')](_0x2d2f07,_0x470a8d,!![]);}catch(_0x3d14b7){return BPromise[_0x9964('0x21')](_0x3d14b7);}return _0x2d2f07[_0x9964('0x22')]();};}function saveUpdates(_0x4053ad,_0x341c56){return function(_0x5c52af){if(_0x5c52af){return _0x5c52af[_0x9964('0x23')](_0x4053ad)[_0x9964('0x24')](function(_0x1629f9){return _0x1629f9;});}return null;};}function removeEntity(_0x30ccf7,_0x5b2689){return function(_0x20c522){if(_0x20c522){return _0x20c522[_0x9964('0x25')]()[_0x9964('0x24')](function(){_0x30ccf7[_0x9964('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d4a5e,_0x3911e0){return function(_0x35211b){if(!_0x35211b){_0x5d4a5e[_0x9964('0x17')](0x194);}return _0x35211b;};}function handleError(_0x96bee0,_0xd48c01){_0xd48c01=_0xd48c01||0x1f4;return function(_0xcc5362){logger[_0x9964('0x26')](_0xcc5362['stack']);if(_0xcc5362['name']){delete _0xcc5362[_0x9964('0x27')];}_0x96bee0[_0x9964('0x18')](_0xd48c01)[_0x9964('0x28')](_0xcc5362);};}exports[_0x9964('0x29')]=function(_0x47d0d4,_0x201656){var _0x3a59df={},_0x396054={},_0x34d835={'count':0x0,'rows':[]};var _0x178089=_['map'](db['FreshdeskAccount'][_0x9964('0x2a')],function(_0x34ae09){return{'name':_0x34ae09['fieldName'],'type':_0x34ae09['type']['key']};});_0x396054[_0x9964('0x2b')]=_[_0x9964('0x2c')](_0x178089,_0x9964('0x27'));_0x396054['query']=_[_0x9964('0x2d')](_0x47d0d4[_0x9964('0x2e')]);_0x396054[_0x9964('0x2f')]=_[_0x9964('0x30')](_0x396054[_0x9964('0x2b')],_0x396054[_0x9964('0x2e')]);_0x3a59df['attributes']=_[_0x9964('0x30')](_0x396054[_0x9964('0x2b')],qs[_0x9964('0x31')](_0x47d0d4['query'][_0x9964('0x31')]));_0x3a59df[_0x9964('0x32')]=_0x3a59df[_0x9964('0x32')]['length']?_0x3a59df[_0x9964('0x32')]:_0x396054[_0x9964('0x2b')];if(!_0x47d0d4[_0x9964('0x2e')][_0x9964('0x33')](_0x9964('0x34'))){_0x3a59df[_0x9964('0x1d')]=qs[_0x9964('0x1d')](_0x47d0d4[_0x9964('0x2e')][_0x9964('0x1d')]);_0x3a59df[_0x9964('0x1b')]=qs[_0x9964('0x1b')](_0x47d0d4[_0x9964('0x2e')][_0x9964('0x1b')]);}_0x3a59df[_0x9964('0x35')]=qs[_0x9964('0x36')](_0x47d0d4[_0x9964('0x2e')][_0x9964('0x36')]);_0x3a59df[_0x9964('0x37')]=qs['filters'](_[_0x9964('0x38')](_0x47d0d4['query'],_0x396054[_0x9964('0x2f')]),_0x178089);if(_0x47d0d4[_0x9964('0x2e')]['filter']){_0x3a59df[_0x9964('0x37')]=_['merge'](_0x3a59df[_0x9964('0x37')],{'$or':_[_0x9964('0x2c')](_0x178089,function(_0x219797){if(_0x219797[_0x9964('0x39')]!==_0x9964('0x3a')){var _0x26b332={};_0x26b332[_0x219797['name']]={'$like':'%'+_0x47d0d4[_0x9964('0x2e')][_0x9964('0x3b')]+'%'};return _0x26b332;}})});}_0x3a59df=_[_0x9964('0x3c')]({},_0x3a59df,_0x47d0d4[_0x9964('0x3d')]);var _0x52d919={'where':_0x3a59df[_0x9964('0x37')]};return db['FreshdeskAccount'][_0x9964('0x1e')](_0x52d919)[_0x9964('0x24')](function(_0x4678ea){_0x34d835[_0x9964('0x1e')]=_0x4678ea;if(_0x47d0d4[_0x9964('0x2e')][_0x9964('0x3e')]){_0x3a59df[_0x9964('0x3f')]=[{'all':!![]}];}return db[_0x9964('0x40')][_0x9964('0x41')](_0x3a59df);})[_0x9964('0x24')](function(_0x14ca4c){_0x34d835['rows']=_0x14ca4c;return _0x34d835;})[_0x9964('0x24')](respondWithFilteredResult(_0x201656,_0x3a59df))[_0x9964('0x42')](handleError(_0x201656,null));};exports[_0x9964('0x43')]=function(_0x23d729,_0x492c09){var _0x138a3a={'raw':![],'where':{'id':_0x23d729['params']['id']}},_0x5e7bfe={};_0x5e7bfe[_0x9964('0x2b')]=_['keys'](db[_0x9964('0x40')]['rawAttributes']);_0x5e7bfe[_0x9964('0x2e')]=_[_0x9964('0x2d')](_0x23d729[_0x9964('0x2e')]);_0x5e7bfe['filters']=_['intersection'](_0x5e7bfe['model'],_0x5e7bfe[_0x9964('0x2e')]);_0x138a3a[_0x9964('0x32')]=_['intersection'](_0x5e7bfe[_0x9964('0x2b')],qs[_0x9964('0x31')](_0x23d729[_0x9964('0x2e')]['fields']));_0x138a3a[_0x9964('0x32')]=_0x138a3a[_0x9964('0x32')][_0x9964('0x44')]?_0x138a3a[_0x9964('0x32')]:_0x5e7bfe['model'];if(_0x23d729[_0x9964('0x2e')][_0x9964('0x3e')]){_0x138a3a[_0x9964('0x3f')]=[{'all':!![]}];}_0x138a3a=_[_0x9964('0x3c')]({},_0x138a3a,_0x23d729[_0x9964('0x3d')]);return db['FreshdeskAccount'][_0x9964('0x45')](_0x138a3a)[_0x9964('0x24')](handleEntityNotFound(_0x492c09,null))['then'](respondWithResult(_0x492c09,null))[_0x9964('0x42')](handleError(_0x492c09,null));};exports[_0x9964('0x46')]=function(_0x568141,_0x49f746){return db[_0x9964('0x40')][_0x9964('0x46')](_0x568141[_0x9964('0x47')],{})[_0x9964('0x24')](respondWithResult(_0x49f746,0xc9))['catch'](handleError(_0x49f746,null));};exports[_0x9964('0x23')]=function(_0x139a9e,_0x373209){if(_0x139a9e[_0x9964('0x47')]['id']){delete _0x139a9e['body']['id'];}return db[_0x9964('0x40')][_0x9964('0x45')]({'where':{'id':_0x139a9e[_0x9964('0x48')]['id']}})[_0x9964('0x24')](handleEntityNotFound(_0x373209,null))[_0x9964('0x24')](saveUpdates(_0x139a9e['body'],null))[_0x9964('0x24')](respondWithResult(_0x373209,null))[_0x9964('0x42')](handleError(_0x373209,null));};exports[_0x9964('0x25')]=function(_0x1580bf,_0x9e5962){return db[_0x9964('0x40')][_0x9964('0x45')]({'where':{'id':_0x1580bf[_0x9964('0x48')]['id']}})['then'](handleEntityNotFound(_0x9e5962,null))[_0x9964('0x24')](removeEntity(_0x9e5962,null))[_0x9964('0x42')](handleError(_0x9e5962,null));};exports[_0x9964('0x49')]=function(_0x1942b3,_0x557851,_0x3532b0){var _0x1ed5b5={};var _0x7641c5={};var _0x559e56;var _0x25faa5;return db[_0x9964('0x40')]['findOne']({'where':{'id':_0x1942b3[_0x9964('0x48')]['id']}})[_0x9964('0x24')](handleEntityNotFound(_0x557851,null))['then'](function(_0x2b2535){if(_0x2b2535){_0x559e56=_0x2b2535;_0x7641c5['model']=_['keys'](db[_0x9964('0x4a')][_0x9964('0x2a')]);_0x7641c5[_0x9964('0x2e')]=_[_0x9964('0x2d')](_0x1942b3[_0x9964('0x2e')]);_0x7641c5[_0x9964('0x2f')]=_[_0x9964('0x30')](_0x7641c5[_0x9964('0x2b')],_0x7641c5[_0x9964('0x2e')]);_0x1ed5b5['attributes']=_[_0x9964('0x30')](_0x7641c5[_0x9964('0x2b')],qs[_0x9964('0x31')](_0x1942b3[_0x9964('0x2e')][_0x9964('0x31')]));_0x1ed5b5[_0x9964('0x32')]=_0x1ed5b5['attributes'][_0x9964('0x44')]?_0x1ed5b5[_0x9964('0x32')]:_0x7641c5[_0x9964('0x2b')];_0x1ed5b5['order']=qs['sort'](_0x1942b3[_0x9964('0x2e')]['sort']);_0x1ed5b5[_0x9964('0x37')]=qs['filters'](_[_0x9964('0x38')](_0x1942b3['query'],_0x7641c5[_0x9964('0x2f')]));if(_0x1942b3[_0x9964('0x2e')][_0x9964('0x3b')]){_0x1ed5b5[_0x9964('0x37')]=_['merge'](_0x1ed5b5['where'],{'$or':_[_0x9964('0x2c')](_0x1ed5b5[_0x9964('0x32')],function(_0x59ae76){var _0xe90ec0={};_0xe90ec0[_0x59ae76]={'$like':'%'+_0x1942b3['query'][_0x9964('0x3b')]+'%'};return _0xe90ec0;})});}_0x1ed5b5=_[_0x9964('0x3c')]({},_0x1ed5b5,_0x1942b3[_0x9964('0x3d')]);return _0x559e56[_0x9964('0x49')](_0x1ed5b5);}})[_0x9964('0x24')](function(_0x57dcc9){if(_0x57dcc9){_0x25faa5=_0x57dcc9[_0x9964('0x44')];if(!_0x1942b3[_0x9964('0x2e')][_0x9964('0x33')]('nolimit')){_0x1ed5b5[_0x9964('0x1d')]=qs[_0x9964('0x1d')](_0x1942b3['query'][_0x9964('0x1d')]);_0x1ed5b5[_0x9964('0x1b')]=qs[_0x9964('0x1b')](_0x1942b3[_0x9964('0x2e')][_0x9964('0x1b')]);}return _0x559e56['getConfigurations'](_0x1ed5b5);}})[_0x9964('0x24')](function(_0x2ea3dd){if(_0x2ea3dd){return _0x2ea3dd?{'count':_0x25faa5,'rows':_0x2ea3dd}:null;}})[_0x9964('0x24')](respondWithResult(_0x557851,null))[_0x9964('0x42')](handleError(_0x557851,null));};exports['addConfiguration']=function(_0x28c724,_0x32377e,_0x1913af){if(_0x28c724['body']['id']){delete _0x28c724[_0x9964('0x47')]['id'];}return db[_0x9964('0x40')][_0x9964('0x4b')]({'where':{'id':_0x28c724[_0x9964('0x48')]['id']}})[_0x9964('0x24')](handleEntityNotFound(_0x32377e,null))[_0x9964('0x24')](function(_0x5829c2){if(_0x5829c2){_0x28c724[_0x9964('0x47')][_0x9964('0x4c')]=_0x5829c2['id'];_0x28c724['body']['Subjects']=integrations[_0x9964('0x4d')](_0x28c724[_0x9964('0x47')][_0x9964('0x4e')],_0x28c724['body']['type']);_0x28c724[_0x9964('0x47')][_0x9964('0x4f')]=integrations[_0x9964('0x50')](_0x28c724['body'][_0x9964('0x4e')],_0x28c724[_0x9964('0x47')][_0x9964('0x39')]);return db[_0x9964('0x4a')][_0x9964('0x46')](_0x28c724[_0x9964('0x47')],{'include':[{'model':db[_0x9964('0x51')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x9964('0x4f')}]});}return null;})[_0x9964('0x24')](respondWithResult(_0x32377e,null))[_0x9964('0x42')](handleError(_0x32377e,null));};exports[_0x9964('0x52')]=function(_0x5e0a8a,_0x5290aa,_0x4a31a5){var _0x36c907='';return db['FreshdeskAccount'][_0x9964('0x4b')]({'where':{'id':_0x5e0a8a[_0x9964('0x48')]['id']},'attributes':['id','remoteUri',_0x9964('0x53')]})[_0x9964('0x24')](handleEntityNotFound(_0x5290aa,null))[_0x9964('0x24')](function(_0x243fce){if(_0x243fce){_0x36c907=_0x243fce[_0x9964('0x54')];var _0x179371=_0x36c907['slice'](-0x1);if(_0x179371==='/'){_0x36c907=_0x36c907[_0x9964('0x55')](0x0,_0x36c907['lastIndexOf'](_0x179371));}return rp({'method':_0x9964('0x56'),'uri':util['format'](_0x9964('0x57'),_0x36c907,_0x9964('0x58')),'headers':{'Authorization':util[_0x9964('0x59')]('Basic\x20%s',new Buffer(util[_0x9964('0x59')]('%s:X',_0x243fce[_0x9964('0x53')]))['toString'](_0x9964('0x5a')))},'json':!![]});}})[_0x9964('0x24')](function(_0x443dad){if(_0x443dad){var _0x426823=[_0x9964('0x5b'),_0x9964('0x5c'),_0x9964('0x5d'),_0x9964('0x5e'),_0x9964('0x18'),_0x9964('0x5f'),_0x9964('0x60'),_0x9964('0x61'),_0x9964('0x62'),_0x9964('0x60'),_0x9964('0x63')];_[_0x9964('0x64')](_0x443dad,function(_0x4c4678){return _0x426823[_0x9964('0x65')](_0x4c4678[_0x9964('0x27')])||!_0x4c4678['default']&&_0x4c4678[_0x9964('0x39')]!==_0x9964('0x66')&&_0x4c4678[_0x9964('0x39')]!==_0x9964('0x67');});return{'count':_0x443dad[_0x9964('0x44')],'rows':_[_0x9964('0x2c')](_0x443dad,function(_0x3f0637){return{'id':_0x3f0637[_0x9964('0x27')],'name':_0x3f0637[_0x9964('0x68')],'custom':!_0x3f0637['default'],'options':_0x3f0637['choices']?_[_0x9964('0x2c')](_0x3f0637[_0x9964('0x69')],function(_0x222f0f){return{'name':_[_0x9964('0x6a')](_0x222f0f),'value':_0x222f0f};}):[]};})};}})['then'](respondWithResult(_0x5290aa,null))['catch'](function(_0x11d370){var _0xbbb02e=_0x5e0a8a[_0x9964('0x2e')][_0x9964('0x6b')]?0x1f4:_0x11d370[_0x9964('0x6c')]||0x1f4;logger['error'](_0x9964('0x6d'),_0x9964('0x52'),_0xbbb02e,JSON[_0x9964('0x6e')](_0x11d370));delete _0x11d370[_0x9964('0x27')];if(_0xbbb02e===0x191){_0xbbb02e=0x190;}_0x5290aa[_0x9964('0x18')](_0xbbb02e)[_0x9964('0x28')](_0x5e0a8a[_0x9964('0x2e')][_0x9964('0x6b')]?{'message':_0x9964('0x6f'),'statusCode':_0x11d370['statusCode']}:_0x11d370);});};
\ No newline at end of file
index a447d5c..c2793c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1bd=['../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes'];(function(_0x2b7ba8,_0x33283b){var _0x470b36=function(_0x2d99f9){while(--_0x2d99f9){_0x2b7ba8['push'](_0x2b7ba8['shift']());}};_0x470b36(++_0x33283b);}(_0xf1bd,0x184));var _0xdf1b=function(_0x2dc48b,_0xb65c21){_0x2dc48b=_0x2dc48b-0x0;var _0xf2cdbe=_0xf1bd[_0x2dc48b];return _0xf2cdbe;};'use strict';var _=require(_0xdf1b('0x0'));var util=require('util');var logger=require(_0xdf1b('0x1'))(_0xdf1b('0x2'));var moment=require('moment');var BPromise=require(_0xdf1b('0x3'));var rp=require(_0xdf1b('0x4'));var fs=require('fs');var path=require(_0xdf1b('0x5'));var rimraf=require(_0xdf1b('0x6'));var config=require('../../config/environment');var attributes=require(_0xdf1b('0x7'));var integrations=require(_0xdf1b('0x8'));module['exports']=function(_0x87363,_0x46cb21){return _0x87363[_0xdf1b('0x9')](_0xdf1b('0xa'),attributes,{'tableName':_0xdf1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb634=['bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','FreshdeskAccount','util','api'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0xb634,0x193));var _0x4b63=function(_0x5d2e1a,_0x1c017c){_0x5d2e1a=_0x5d2e1a-0x0;var _0x46f09e=_0xb634[_0x5d2e1a];return _0x46f09e;};'use strict';var _=require('lodash');var util=require(_0x4b63('0x0'));var logger=require('../../config/logger')(_0x4b63('0x1'));var moment=require('moment');var BPromise=require(_0x4b63('0x2'));var rp=require(_0x4b63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b63('0x4'));var config=require(_0x4b63('0x5'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x4b63('0x6'));module[_0x4b63('0x7')]=function(_0x160be0,_0x5e21a5){return _0x160be0['define'](_0x4b63('0x8'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ade798f..c22f215 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83c8=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshdeskAccount','FreshdeskAccount','options','attributes','limit','include','info','catch','ShowFreshdeskAccount','find','map','model','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x83c8,0x8a));var _0x883c=function(_0x584229,_0x11c7c9){_0x584229=_0x584229-0x0;var _0x334eae=_0x83c8[_0x584229];return _0x334eae;};'use strict';var _=require(_0x883c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x883c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x883c('0x2'));var db=require(_0x883c('0x3'))['db'];var utils=require(_0x883c('0x4'));var logger=require(_0x883c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x883c('0x6')][_0x883c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e6007,_0x5e36ec,_0x4ac11a){return new BPromise(function(_0x41858a,_0x550574){return client[_0x883c('0x8')](_0x4e6007,_0x4ac11a)[_0x883c('0x9')](function(_0x3c53dd){logger['info'](_0x883c('0xa'),_0x5e36ec,_0x883c('0xb'));logger[_0x883c('0xc')](_0x883c('0xd'),_0x5e36ec,'request\x20sent',JSON[_0x883c('0xe')](_0x3c53dd));if(_0x3c53dd[_0x883c('0xf')]){if(_0x3c53dd[_0x883c('0xf')]['code']===0x1f4){logger[_0x883c('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x5e36ec,_0x3c53dd[_0x883c('0xf')][_0x883c('0x10')]);return _0x550574(_0x3c53dd[_0x883c('0xf')][_0x883c('0x10')]);}logger[_0x883c('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x5e36ec,_0x3c53dd[_0x883c('0xf')][_0x883c('0x10')]);return _0x41858a(_0x3c53dd[_0x883c('0xf')][_0x883c('0x10')]);}else{logger['info'](_0x883c('0xa'),_0x5e36ec,'request\x20sent');_0x41858a(_0x3c53dd[_0x883c('0x11')]['message']);}})['catch'](function(_0x320f51){logger[_0x883c('0xf')](_0x883c('0xa'),_0x5e36ec,_0x320f51);_0x550574(_0x320f51);});});}exports[_0x883c('0x12')]=function(_0x2620cc){var _0x5e3706=this;return new Promise(function(_0x43bdaf,_0x3995c7){return db[_0x883c('0x13')]['findAll']({'raw':_0x2620cc[_0x883c('0x14')]?_0x2620cc[_0x883c('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2620cc[_0x883c('0x14')]?_0x2620cc[_0x883c('0x14')]['where']||null:null,'attributes':_0x2620cc['options']?_0x2620cc[_0x883c('0x14')][_0x883c('0x15')]||null:null,'limit':_0x2620cc[_0x883c('0x14')]?_0x2620cc[_0x883c('0x14')][_0x883c('0x16')]||null:null,'include':_0x2620cc['options']?_0x2620cc[_0x883c('0x14')]['include']?_['map'](_0x2620cc[_0x883c('0x14')]['include'],function(_0x13ead7){return{'model':db[_0x13ead7['model']],'as':_0x13ead7['as'],'attributes':_0x13ead7['attributes'],'include':_0x13ead7['include']?_['map'](_0x13ead7[_0x883c('0x17')],function(_0x464ffb){return{'model':db[_0x464ffb['model']],'as':_0x464ffb['as'],'attributes':_0x464ffb[_0x883c('0x15')],'include':_0x464ffb['include']?_['map'](_0x464ffb[_0x883c('0x17')],function(_0x38864c){return{'model':db[_0x38864c['model']],'as':_0x38864c['as'],'attributes':_0x38864c[_0x883c('0x15')]};}):[]};}):[]};}):[]:[]})[_0x883c('0x9')](function(_0x42ed9f){logger[_0x883c('0x18')](_0x883c('0x12'),_0x2620cc);logger[_0x883c('0xc')](_0x883c('0x12'),_0x2620cc,JSON['stringify'](_0x42ed9f));_0x43bdaf(_0x42ed9f);})[_0x883c('0x19')](function(_0x5d1cc7){logger['error']('GetFreshdeskAccount',_0x5d1cc7[_0x883c('0x10')],_0x2620cc);_0x3995c7(_0x5e3706['error'](0x1f4,_0x5d1cc7[_0x883c('0x10')]));});});};exports[_0x883c('0x1a')]=function(_0x5f3445){var _0xcb97b7=this;return new Promise(function(_0x20af59,_0x1940bd){return db[_0x883c('0x13')][_0x883c('0x1b')]({'raw':_0x5f3445[_0x883c('0x14')]?_0x5f3445['options']['raw']===undefined?!![]:![]:!![],'where':_0x5f3445[_0x883c('0x14')]?_0x5f3445[_0x883c('0x14')]['where']||null:null,'attributes':_0x5f3445['options']?_0x5f3445['options'][_0x883c('0x15')]||null:null,'include':_0x5f3445[_0x883c('0x14')]?_0x5f3445['options']['include']?_[_0x883c('0x1c')](_0x5f3445[_0x883c('0x14')][_0x883c('0x17')],function(_0x599295){return{'model':db[_0x599295[_0x883c('0x1d')]],'as':_0x599295['as'],'attributes':_0x599295[_0x883c('0x15')],'include':_0x599295[_0x883c('0x17')]?_[_0x883c('0x1c')](_0x599295[_0x883c('0x17')],function(_0x47256a){return{'model':db[_0x47256a[_0x883c('0x1d')]],'as':_0x47256a['as'],'attributes':_0x47256a[_0x883c('0x15')],'include':_0x47256a[_0x883c('0x17')]?_[_0x883c('0x1c')](_0x47256a[_0x883c('0x17')],function(_0x5c134d){return{'model':db[_0x5c134d['model']],'as':_0x5c134d['as'],'attributes':_0x5c134d[_0x883c('0x15')]};}):[]};}):[]};}):[]:[]})[_0x883c('0x9')](function(_0x556126){logger[_0x883c('0x18')](_0x883c('0x1a'),_0x5f3445);logger['debug'](_0x883c('0x1a'),_0x5f3445,JSON[_0x883c('0xe')](_0x556126));_0x20af59(_0x556126);})[_0x883c('0x19')](function(_0x5bc89a){logger[_0x883c('0xf')](_0x883c('0x1a'),_0x5bc89a[_0x883c('0x10')],_0x5f3445);_0x1940bd(_0xcb97b7[_0x883c('0xf')](0x1f4,_0x5bc89a[_0x883c('0x10')]));});});};
\ No newline at end of file
+var _0x6b5d=['jayson/promise','http','request','then','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5d1d85,_0x9e41ff){var _0x16992c=function(_0x1c1590){while(--_0x1c1590){_0x5d1d85['push'](_0x5d1d85['shift']());}};_0x16992c(++_0x9e41ff);}(_0x6b5d,0xd4));var _0xd6b5=function(_0x37cfd5,_0x24060e){_0x37cfd5=_0x37cfd5-0x0;var _0x18e819=_0x6b5d[_0x37cfd5];return _0x18e819;};'use strict';var _=require(_0xd6b5('0x0'));var util=require(_0xd6b5('0x1'));var moment=require(_0xd6b5('0x2'));var BPromise=require(_0xd6b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6b5('0x4'));var db=require(_0xd6b5('0x5'))['db'];var utils=require(_0xd6b5('0x6'));var logger=require(_0xd6b5('0x7'))(_0xd6b5('0x8'));var config=require(_0xd6b5('0x9'));var jayson=require(_0xd6b5('0xa'));var client=jayson['client'][_0xd6b5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4790aa,_0x3f1621,_0x5312a9){return new BPromise(function(_0x2ca31e,_0x3e1b0d){return client[_0xd6b5('0xc')](_0x4790aa,_0x5312a9)[_0xd6b5('0xd')](function(_0x25fcff){logger[_0xd6b5('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x3f1621,'request\x20sent');logger[_0xd6b5('0xf')](_0xd6b5('0x10'),_0x3f1621,_0xd6b5('0x11'),JSON[_0xd6b5('0x12')](_0x25fcff));if(_0x25fcff[_0xd6b5('0x13')]){if(_0x25fcff['error'][_0xd6b5('0x14')]===0x1f4){logger[_0xd6b5('0x13')](_0xd6b5('0x15'),_0x3f1621,_0x25fcff[_0xd6b5('0x13')]['message']);return _0x3e1b0d(_0x25fcff[_0xd6b5('0x13')][_0xd6b5('0x16')]);}logger[_0xd6b5('0x13')](_0xd6b5('0x15'),_0x3f1621,_0x25fcff[_0xd6b5('0x13')][_0xd6b5('0x16')]);return _0x2ca31e(_0x25fcff['error'][_0xd6b5('0x16')]);}else{logger['info'](_0xd6b5('0x15'),_0x3f1621,_0xd6b5('0x11'));_0x2ca31e(_0x25fcff[_0xd6b5('0x17')][_0xd6b5('0x16')]);}})[_0xd6b5('0x18')](function(_0x30fddf){logger[_0xd6b5('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x3f1621,_0x30fddf);_0x3e1b0d(_0x30fddf);});});}exports[_0xd6b5('0x19')]=function(_0x733f21){var _0x30fc53=this;return new Promise(function(_0x301a11,_0x1c9a4b){return db[_0xd6b5('0x1a')][_0xd6b5('0x1b')]({'raw':_0x733f21[_0xd6b5('0x1c')]?_0x733f21[_0xd6b5('0x1c')][_0xd6b5('0x1d')]===undefined?!![]:![]:!![],'where':_0x733f21[_0xd6b5('0x1c')]?_0x733f21[_0xd6b5('0x1c')]['where']||null:null,'attributes':_0x733f21[_0xd6b5('0x1c')]?_0x733f21[_0xd6b5('0x1c')][_0xd6b5('0x1e')]||null:null,'limit':_0x733f21[_0xd6b5('0x1c')]?_0x733f21['options'][_0xd6b5('0x1f')]||null:null,'include':_0x733f21[_0xd6b5('0x1c')]?_0x733f21['options'][_0xd6b5('0x20')]?_[_0xd6b5('0x21')](_0x733f21[_0xd6b5('0x1c')][_0xd6b5('0x20')],function(_0x448767){return{'model':db[_0x448767[_0xd6b5('0x22')]],'as':_0x448767['as'],'attributes':_0x448767[_0xd6b5('0x1e')],'include':_0x448767['include']?_[_0xd6b5('0x21')](_0x448767[_0xd6b5('0x20')],function(_0x509137){return{'model':db[_0x509137['model']],'as':_0x509137['as'],'attributes':_0x509137['attributes'],'include':_0x509137[_0xd6b5('0x20')]?_['map'](_0x509137[_0xd6b5('0x20')],function(_0x1aa35d){return{'model':db[_0x1aa35d[_0xd6b5('0x22')]],'as':_0x1aa35d['as'],'attributes':_0x1aa35d[_0xd6b5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd6b5('0xd')](function(_0x567236){logger[_0xd6b5('0xe')](_0xd6b5('0x19'),_0x733f21);logger[_0xd6b5('0xf')](_0xd6b5('0x19'),_0x733f21,JSON['stringify'](_0x567236));_0x301a11(_0x567236);})['catch'](function(_0x46466f){logger[_0xd6b5('0x13')](_0xd6b5('0x19'),_0x46466f[_0xd6b5('0x16')],_0x733f21);_0x1c9a4b(_0x30fc53[_0xd6b5('0x13')](0x1f4,_0x46466f[_0xd6b5('0x16')]));});});};exports[_0xd6b5('0x23')]=function(_0x983d63){var _0x313747=this;return new Promise(function(_0xdba5d7,_0x52a03b){return db[_0xd6b5('0x1a')][_0xd6b5('0x24')]({'raw':_0x983d63[_0xd6b5('0x1c')]?_0x983d63[_0xd6b5('0x1c')][_0xd6b5('0x1d')]===undefined?!![]:![]:!![],'where':_0x983d63[_0xd6b5('0x1c')]?_0x983d63[_0xd6b5('0x1c')]['where']||null:null,'attributes':_0x983d63[_0xd6b5('0x1c')]?_0x983d63[_0xd6b5('0x1c')]['attributes']||null:null,'include':_0x983d63[_0xd6b5('0x1c')]?_0x983d63[_0xd6b5('0x1c')][_0xd6b5('0x20')]?_['map'](_0x983d63[_0xd6b5('0x1c')]['include'],function(_0x1f0537){return{'model':db[_0x1f0537[_0xd6b5('0x22')]],'as':_0x1f0537['as'],'attributes':_0x1f0537[_0xd6b5('0x1e')],'include':_0x1f0537[_0xd6b5('0x20')]?_[_0xd6b5('0x21')](_0x1f0537[_0xd6b5('0x20')],function(_0x4d9c77){return{'model':db[_0x4d9c77[_0xd6b5('0x22')]],'as':_0x4d9c77['as'],'attributes':_0x4d9c77[_0xd6b5('0x1e')],'include':_0x4d9c77[_0xd6b5('0x20')]?_[_0xd6b5('0x21')](_0x4d9c77['include'],function(_0x5cc557){return{'model':db[_0x5cc557[_0xd6b5('0x22')]],'as':_0x5cc557['as'],'attributes':_0x5cc557[_0xd6b5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd6b5('0xd')](function(_0x5e8f50){logger[_0xd6b5('0xe')]('ShowFreshdeskAccount',_0x983d63);logger[_0xd6b5('0xf')](_0xd6b5('0x23'),_0x983d63,JSON[_0xd6b5('0x12')](_0x5e8f50));_0xdba5d7(_0x5e8f50);})[_0xd6b5('0x18')](function(_0x1fb4b9){logger[_0xd6b5('0x13')]('ShowFreshdeskAccount',_0x1fb4b9[_0xd6b5('0x16')],_0x983d63);_0x52a03b(_0x313747['error'](0x1f4,_0x1fb4b9[_0xd6b5('0x16')]));});});};
\ No newline at end of file
index 608e60b..2edb6a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea4c=['../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0xea4c,0x1e7));var _0xcea4=function(_0x57217d,_0x1ce236){_0x57217d=_0x57217d-0x0;var _0x34c2d8=_0xea4c[_0x57217d];return _0x34c2d8;};'use strict';var multer=require(_0xcea4('0x0'));var util=require(_0xcea4('0x1'));var path=require(_0xcea4('0x2'));var timeout=require(_0xcea4('0x3'));var express=require(_0xcea4('0x4'));var router=express['Router']();var fs_extra=require(_0xcea4('0x5'));var auth=require(_0xcea4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcea4('0x7'));var controller=require(_0xcea4('0x8'));router[_0xcea4('0x9')]('/',auth[_0xcea4('0xa')](),controller['index']);router[_0xcea4('0x9')](_0xcea4('0xb'),auth[_0xcea4('0xa')](),controller[_0xcea4('0xc')]);router[_0xcea4('0x9')](_0xcea4('0xd'),auth[_0xcea4('0xa')](),controller[_0xcea4('0xe')]);router[_0xcea4('0x9')](_0xcea4('0xf'),auth[_0xcea4('0xa')](),controller[_0xcea4('0x10')]);router[_0xcea4('0x9')]('/:id/descriptions',auth[_0xcea4('0xa')](),controller['getDescriptions']);router[_0xcea4('0x9')](_0xcea4('0x11'),auth[_0xcea4('0xa')](),controller[_0xcea4('0x12')]);router[_0xcea4('0x13')]('/',auth[_0xcea4('0xa')](),controller[_0xcea4('0x14')]);router[_0xcea4('0x13')](_0xcea4('0x11'),auth['isAuthenticated'](),controller[_0xcea4('0x15')]);router[_0xcea4('0x16')](_0xcea4('0xb'),auth['isAuthenticated'](),controller[_0xcea4('0x17')]);router['delete'](_0xcea4('0xb'),auth[_0xcea4('0xa')](),controller[_0xcea4('0x18')]);module[_0xcea4('0x19')]=router;
\ No newline at end of file
+var _0xcd5e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','/:id','show','/:id/fields','getFields','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','delete','destroy','multer','util','path'];(function(_0x15f6f7,_0x305040){var _0x37c435=function(_0x51929b){while(--_0x51929b){_0x15f6f7['push'](_0x15f6f7['shift']());}};_0x37c435(++_0x305040);}(_0xcd5e,0x1ea));var _0xecd5=function(_0x3db3d8,_0x4fae40){_0x3db3d8=_0x3db3d8-0x0;var _0x41f827=_0xcd5e[_0x3db3d8];return _0x41f827;};'use strict';var multer=require(_0xecd5('0x0'));var util=require(_0xecd5('0x1'));var path=require(_0xecd5('0x2'));var timeout=require(_0xecd5('0x3'));var express=require(_0xecd5('0x4'));var router=express[_0xecd5('0x5')]();var fs_extra=require(_0xecd5('0x6'));var auth=require(_0xecd5('0x7'));var interaction=require(_0xecd5('0x8'));var config=require(_0xecd5('0x9'));var controller=require(_0xecd5('0xa'));router['get']('/',auth[_0xecd5('0xb')](),controller[_0xecd5('0xc')]);router['get'](_0xecd5('0xd'),auth[_0xecd5('0xb')](),controller[_0xecd5('0xe')]);router['get'](_0xecd5('0xf'),auth[_0xecd5('0xb')](),controller[_0xecd5('0x10')]);router[_0xecd5('0x11')](_0xecd5('0x12'),auth[_0xecd5('0xb')](),controller[_0xecd5('0x13')]);router['get'](_0xecd5('0x14'),auth[_0xecd5('0xb')](),controller[_0xecd5('0x15')]);router[_0xecd5('0x11')](_0xecd5('0x16'),auth[_0xecd5('0xb')](),controller[_0xecd5('0x17')]);router[_0xecd5('0x18')]('/',auth[_0xecd5('0xb')](),controller[_0xecd5('0x19')]);router['post'](_0xecd5('0x16'),auth[_0xecd5('0xb')](),controller['setTags']);router[_0xecd5('0x1a')]('/:id',auth[_0xecd5('0xb')](),controller['update']);router[_0xecd5('0x1b')](_0xecd5('0xd'),auth[_0xecd5('0xb')](),controller[_0xecd5('0x1c')]);module['exports']=router;
\ No newline at end of file
index 2c20216..5fd1c2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa982=['exports','STRING','sequelize'];(function(_0x5baa6b,_0x517531){var _0x4f294d=function(_0x2651db){while(--_0x2651db){_0x5baa6b['push'](_0x5baa6b['shift']());}};_0x4f294d(++_0x517531);}(_0xa982,0x8f));var _0x2a98=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0xa982[_0x2a55f8];return _0x245efd;};'use strict';var Sequelize=require(_0x2a98('0x0'));module[_0x2a98('0x1')]={'name':{'type':Sequelize[_0x2a98('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x27f4=['STRING','exports'];(function(_0x1de164,_0x1ccf5f){var _0x5613b4=function(_0x22dca9){while(--_0x22dca9){_0x1de164['push'](_0x1de164['shift']());}};_0x5613b4(++_0x1ccf5f);}(_0x27f4,0x9d));var _0x427f=function(_0x331298,_0x12341a){_0x331298=_0x331298-0x0;var _0x3824bc=_0x27f4[_0x331298];return _0x3824bc;};'use strict';var Sequelize=require('sequelize');module[_0x427f('0x0')]={'name':{'type':Sequelize[_0x427f('0x1')]},'description':{'type':Sequelize[_0x427f('0x1')]}};
\ No newline at end of file
index 750ea78..82b4bd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e45=['error','stack','name','send','FreshdeskConfiguration','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','map','VIRTUAL','filter','options','rows','catch','show','fields','includeAll','include','find','create','body','params','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x0e45,0x1c1));var _0x50e4=function(_0x540936,_0x58f0d5){_0x540936=_0x540936-0x0;var _0xbf7978=_0x0e45[_0x540936];return _0xbf7978;};'use strict';var emlformat=require(_0x50e4('0x0'));var rimraf=require(_0x50e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e4('0x2'));var rp=require(_0x50e4('0x3'));var moment=require(_0x50e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x50e4('0x5'));var util=require(_0x50e4('0x6'));var path=require('path');var sox=require(_0x50e4('0x7'));var csv=require(_0x50e4('0x8'));var ejs=require(_0x50e4('0x9'));var fs=require('fs');var fs_extra=require(_0x50e4('0xa'));var _=require(_0x50e4('0xb'));var squel=require('squel');var crypto=require(_0x50e4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x50e4('0xd'));var toCsv=require(_0x50e4('0x8'));var querystring=require(_0x50e4('0xe'));var Papa=require(_0x50e4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x50e4('0x10'));var as=require(_0x50e4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x50e4('0x12'))(_0x50e4('0x13'));var utils=require('../../config/utils');var config=require(_0x50e4('0x14'));var licenseUtil=require(_0x50e4('0x15'));var db=require(_0x50e4('0x16'))['db'];function respondWithStatusCode(_0x3f6d3a,_0xbf25c9){_0xbf25c9=_0xbf25c9||0xcc;return function(_0x5c310b){if(_0x5c310b){return _0x3f6d3a[_0x50e4('0x17')](_0xbf25c9);}return _0x3f6d3a[_0x50e4('0x18')](_0xbf25c9)[_0x50e4('0x19')]();};}function respondWithResult(_0x5d4269,_0x2c2115){_0x2c2115=_0x2c2115||0xc8;return function(_0x28afed){if(_0x28afed){return _0x5d4269[_0x50e4('0x18')](_0x2c2115)[_0x50e4('0x1a')](_0x28afed);}};}function respondWithFilteredResult(_0x25bdb1,_0x7c823d){return function(_0x2babf3){if(_0x2babf3){var _0xecfebe=typeof _0x7c823d[_0x50e4('0x1b')]===_0x50e4('0x1c')&&typeof _0x7c823d[_0x50e4('0x1d')]===_0x50e4('0x1c');var _0x5c9c04=_0x2babf3[_0x50e4('0x1e')];var _0x3258ba=_0xecfebe?0x0:_0x7c823d[_0x50e4('0x1b')];var _0x3933d5=_0xecfebe?_0x2babf3[_0x50e4('0x1e')]:_0x7c823d[_0x50e4('0x1b')]+_0x7c823d[_0x50e4('0x1d')];var _0x1a2924;if(_0x3933d5>=_0x5c9c04){_0x3933d5=_0x5c9c04;_0x1a2924=0xc8;}else{_0x1a2924=0xce;}_0x25bdb1[_0x50e4('0x18')](_0x1a2924);return _0x25bdb1[_0x50e4('0x1f')](_0x50e4('0x20'),_0x3258ba+'-'+_0x3933d5+'/'+_0x5c9c04)[_0x50e4('0x1a')](_0x2babf3);}return null;};}function patchUpdates(_0x31a571){return function(_0x578b3e){try{jsonpatch[_0x50e4('0x21')](_0x578b3e,_0x31a571,!![]);}catch(_0x5dddc1){return BPromise['reject'](_0x5dddc1);}return _0x578b3e[_0x50e4('0x22')]();};}function saveUpdates(_0x5606f5,_0x5360d7){return function(_0x56deb9){if(_0x56deb9){return _0x56deb9[_0x50e4('0x23')](_0x5606f5)[_0x50e4('0x24')](function(_0x26dc7e){return _0x26dc7e;});}return null;};}function removeEntity(_0x53d244,_0x387a65){return function(_0xbdf68a){if(_0xbdf68a){return _0xbdf68a['destroy']()[_0x50e4('0x24')](function(){_0x53d244[_0x50e4('0x18')](0xcc)[_0x50e4('0x19')]();});}};}function handleEntityNotFound(_0x2e1545,_0x58d39){return function(_0x3c751f){if(!_0x3c751f){_0x2e1545[_0x50e4('0x17')](0x194);}return _0x3c751f;};}function handleError(_0x598337,_0x54c2de){_0x54c2de=_0x54c2de||0x1f4;return function(_0x27939f){logger[_0x50e4('0x25')](_0x27939f[_0x50e4('0x26')]);if(_0x27939f[_0x50e4('0x27')]){delete _0x27939f[_0x50e4('0x27')];}_0x598337[_0x50e4('0x18')](_0x54c2de)[_0x50e4('0x28')](_0x27939f);};}exports['index']=function(_0x3a49ab,_0xe25eda){var _0x45e9db={},_0x311566={},_0x56a7b8={'count':0x0,'rows':[]};var _0x190ec8=_['map'](db[_0x50e4('0x29')][_0x50e4('0x2a')],function(_0x591c23){return{'name':_0x591c23[_0x50e4('0x2b')],'type':_0x591c23[_0x50e4('0x2c')]['key']};});_0x311566[_0x50e4('0x2d')]=_['map'](_0x190ec8,_0x50e4('0x27'));_0x311566['query']=_[_0x50e4('0x2e')](_0x3a49ab[_0x50e4('0x2f')]);_0x311566['filters']=_[_0x50e4('0x30')](_0x311566[_0x50e4('0x2d')],_0x311566[_0x50e4('0x2f')]);_0x45e9db[_0x50e4('0x31')]=_[_0x50e4('0x30')](_0x311566[_0x50e4('0x2d')],qs['fields'](_0x3a49ab[_0x50e4('0x2f')]['fields']));_0x45e9db['attributes']=_0x45e9db[_0x50e4('0x31')][_0x50e4('0x32')]?_0x45e9db[_0x50e4('0x31')]:_0x311566[_0x50e4('0x2d')];if(!_0x3a49ab[_0x50e4('0x2f')][_0x50e4('0x33')](_0x50e4('0x34'))){_0x45e9db[_0x50e4('0x1d')]=qs[_0x50e4('0x1d')](_0x3a49ab[_0x50e4('0x2f')][_0x50e4('0x1d')]);_0x45e9db[_0x50e4('0x1b')]=qs[_0x50e4('0x1b')](_0x3a49ab[_0x50e4('0x2f')][_0x50e4('0x1b')]);}_0x45e9db[_0x50e4('0x35')]=qs[_0x50e4('0x36')](_0x3a49ab[_0x50e4('0x2f')][_0x50e4('0x36')]);_0x45e9db['where']=qs['filters'](_[_0x50e4('0x37')](_0x3a49ab[_0x50e4('0x2f')],_0x311566[_0x50e4('0x38')]),_0x190ec8);if(_0x3a49ab['query']['filter']){_0x45e9db[_0x50e4('0x39')]=_[_0x50e4('0x3a')](_0x45e9db['where'],{'$or':_[_0x50e4('0x3b')](_0x190ec8,function(_0x37b6e9){if(_0x37b6e9[_0x50e4('0x2c')]!==_0x50e4('0x3c')){var _0x1d0a3f={};_0x1d0a3f[_0x37b6e9[_0x50e4('0x27')]]={'$like':'%'+_0x3a49ab[_0x50e4('0x2f')][_0x50e4('0x3d')]+'%'};return _0x1d0a3f;}})});}_0x45e9db=_[_0x50e4('0x3a')]({},_0x45e9db,_0x3a49ab[_0x50e4('0x3e')]);var _0x209e2b={'where':_0x45e9db[_0x50e4('0x39')]};return db[_0x50e4('0x29')][_0x50e4('0x1e')](_0x209e2b)[_0x50e4('0x24')](function(_0x4dd87a){_0x56a7b8['count']=_0x4dd87a;if(_0x3a49ab['query']['includeAll']){_0x45e9db['include']=[{'all':!![]}];}return db[_0x50e4('0x29')]['findAll'](_0x45e9db);})[_0x50e4('0x24')](function(_0x631f84){_0x56a7b8[_0x50e4('0x3f')]=_0x631f84;return _0x56a7b8;})[_0x50e4('0x24')](respondWithFilteredResult(_0xe25eda,_0x45e9db))[_0x50e4('0x40')](handleError(_0xe25eda,null));};exports[_0x50e4('0x41')]=function(_0xa1c031,_0x314bab){var _0x5bdc26={'raw':![],'where':{'id':_0xa1c031['params']['id']}},_0x25bc0a={};_0x25bc0a[_0x50e4('0x2d')]=_[_0x50e4('0x2e')](db[_0x50e4('0x29')][_0x50e4('0x2a')]);_0x25bc0a[_0x50e4('0x2f')]=_[_0x50e4('0x2e')](_0xa1c031[_0x50e4('0x2f')]);_0x25bc0a[_0x50e4('0x38')]=_[_0x50e4('0x30')](_0x25bc0a[_0x50e4('0x2d')],_0x25bc0a['query']);_0x5bdc26[_0x50e4('0x31')]=_['intersection'](_0x25bc0a[_0x50e4('0x2d')],qs[_0x50e4('0x42')](_0xa1c031[_0x50e4('0x2f')]['fields']));_0x5bdc26[_0x50e4('0x31')]=_0x5bdc26[_0x50e4('0x31')][_0x50e4('0x32')]?_0x5bdc26[_0x50e4('0x31')]:_0x25bc0a[_0x50e4('0x2d')];if(_0xa1c031[_0x50e4('0x2f')][_0x50e4('0x43')]){_0x5bdc26[_0x50e4('0x44')]=[{'all':!![]}];}_0x5bdc26=_['merge']({},_0x5bdc26,_0xa1c031['options']);return db[_0x50e4('0x29')][_0x50e4('0x45')](_0x5bdc26)[_0x50e4('0x24')](handleEntityNotFound(_0x314bab,null))[_0x50e4('0x24')](respondWithResult(_0x314bab,null))['catch'](handleError(_0x314bab,null));};exports[_0x50e4('0x46')]=function(_0x420d84,_0x338371){return db[_0x50e4('0x29')][_0x50e4('0x46')](_0x420d84[_0x50e4('0x47')],{})['then'](respondWithResult(_0x338371,0xc9))['catch'](handleError(_0x338371,null));};exports[_0x50e4('0x23')]=function(_0x13d484,_0x4386ea){if(_0x13d484[_0x50e4('0x47')]['id']){delete _0x13d484[_0x50e4('0x47')]['id'];}return db[_0x50e4('0x29')]['find']({'where':{'id':_0x13d484['params']['id']}})[_0x50e4('0x24')](handleEntityNotFound(_0x4386ea,null))[_0x50e4('0x24')](saveUpdates(_0x13d484[_0x50e4('0x47')],null))[_0x50e4('0x24')](respondWithResult(_0x4386ea,null))[_0x50e4('0x40')](handleError(_0x4386ea,null));};exports['destroy']=function(_0x1b5097,_0x544749){return db[_0x50e4('0x29')][_0x50e4('0x45')]({'where':{'id':_0x1b5097[_0x50e4('0x48')]['id']}})[_0x50e4('0x24')](handleEntityNotFound(_0x544749,null))[_0x50e4('0x24')](removeEntity(_0x544749,null))[_0x50e4('0x40')](handleError(_0x544749,null));};exports[_0x50e4('0x49')]=function(_0x47002d,_0x27efcd,_0x389bcf){var _0x2e3c6f={};var _0xaac5c0={};var _0x5504c9;var _0x4c8dff;return db[_0x50e4('0x29')][_0x50e4('0x4a')]({'where':{'id':_0x47002d['params']['id']}})['then'](handleEntityNotFound(_0x27efcd,null))[_0x50e4('0x24')](function(_0x5694b5){if(_0x5694b5){_0x5504c9=_0x5694b5;_0xaac5c0[_0x50e4('0x2d')]=_[_0x50e4('0x2e')](db[_0x50e4('0x4b')]['rawAttributes']);_0xaac5c0['query']=_[_0x50e4('0x2e')](_0x47002d[_0x50e4('0x2f')]);_0xaac5c0[_0x50e4('0x38')]=_[_0x50e4('0x30')](_0xaac5c0[_0x50e4('0x2d')],_0xaac5c0[_0x50e4('0x2f')]);_0x2e3c6f['attributes']=_[_0x50e4('0x30')](_0xaac5c0[_0x50e4('0x2d')],qs[_0x50e4('0x42')](_0x47002d['query'][_0x50e4('0x42')]));_0x2e3c6f[_0x50e4('0x31')]=_0x2e3c6f[_0x50e4('0x31')][_0x50e4('0x32')]?_0x2e3c6f[_0x50e4('0x31')]:_0xaac5c0[_0x50e4('0x2d')];_0x2e3c6f['order']=qs[_0x50e4('0x36')](_0x47002d[_0x50e4('0x2f')][_0x50e4('0x36')]);_0x2e3c6f['where']=qs[_0x50e4('0x38')](_['pick'](_0x47002d['query'],_0xaac5c0[_0x50e4('0x38')]));if(_0x47002d[_0x50e4('0x2f')]['filter']){_0x2e3c6f[_0x50e4('0x39')]=_[_0x50e4('0x3a')](_0x2e3c6f[_0x50e4('0x39')],{'$or':_[_0x50e4('0x3b')](_0x2e3c6f[_0x50e4('0x31')],function(_0x17c25c){var _0x1f0b64={};_0x1f0b64[_0x17c25c]={'$like':'%'+_0x47002d[_0x50e4('0x2f')]['filter']+'%'};return _0x1f0b64;})});}_0x2e3c6f=_[_0x50e4('0x3a')]({},_0x2e3c6f,_0x47002d['options']);return _0x5504c9['getFields'](_0x2e3c6f);}})[_0x50e4('0x24')](function(_0x48d855){if(_0x48d855){_0x4c8dff=_0x48d855[_0x50e4('0x32')];if(!_0x47002d[_0x50e4('0x2f')]['hasOwnProperty'](_0x50e4('0x34'))){_0x2e3c6f[_0x50e4('0x1d')]=qs[_0x50e4('0x1d')](_0x47002d[_0x50e4('0x2f')][_0x50e4('0x1d')]);_0x2e3c6f[_0x50e4('0x1b')]=qs[_0x50e4('0x1b')](_0x47002d[_0x50e4('0x2f')][_0x50e4('0x1b')]);}return _0x5504c9[_0x50e4('0x49')](_0x2e3c6f);}})[_0x50e4('0x24')](function(_0x4befeb){if(_0x4befeb){return _0x4befeb?{'count':_0x4c8dff,'rows':_0x4befeb}:null;}})['then'](respondWithResult(_0x27efcd,null))[_0x50e4('0x40')](handleError(_0x27efcd,null));};exports[_0x50e4('0x4c')]=function(_0x3e71ec,_0x30ead4,_0x2cbe47){var _0x2d6848={};var _0x28f89f={};var _0x243fe7;var _0x340c58;return db[_0x50e4('0x29')]['findOne']({'where':{'id':_0x3e71ec[_0x50e4('0x48')]['id']}})[_0x50e4('0x24')](handleEntityNotFound(_0x30ead4,null))[_0x50e4('0x24')](function(_0x485fc6){if(_0x485fc6){_0x243fe7=_0x485fc6;_0x28f89f[_0x50e4('0x2d')]=_[_0x50e4('0x2e')](db[_0x50e4('0x4b')][_0x50e4('0x2a')]);_0x28f89f['query']=_[_0x50e4('0x2e')](_0x3e71ec['query']);_0x28f89f[_0x50e4('0x38')]=_[_0x50e4('0x30')](_0x28f89f[_0x50e4('0x2d')],_0x28f89f['query']);_0x2d6848[_0x50e4('0x31')]=_[_0x50e4('0x30')](_0x28f89f[_0x50e4('0x2d')],qs[_0x50e4('0x42')](_0x3e71ec[_0x50e4('0x2f')]['fields']));_0x2d6848[_0x50e4('0x31')]=_0x2d6848[_0x50e4('0x31')][_0x50e4('0x32')]?_0x2d6848[_0x50e4('0x31')]:_0x28f89f[_0x50e4('0x2d')];_0x2d6848['order']=qs['sort'](_0x3e71ec[_0x50e4('0x2f')][_0x50e4('0x36')]);_0x2d6848['where']=qs[_0x50e4('0x38')](_[_0x50e4('0x37')](_0x3e71ec['query'],_0x28f89f['filters']));if(_0x3e71ec[_0x50e4('0x2f')][_0x50e4('0x3d')]){_0x2d6848[_0x50e4('0x39')]=_[_0x50e4('0x3a')](_0x2d6848[_0x50e4('0x39')],{'$or':_['map'](_0x2d6848[_0x50e4('0x31')],function(_0x51cbb2){var _0x27ee24={};_0x27ee24[_0x51cbb2]={'$like':'%'+_0x3e71ec[_0x50e4('0x2f')][_0x50e4('0x3d')]+'%'};return _0x27ee24;})});}_0x2d6848=_['merge']({},_0x2d6848,_0x3e71ec[_0x50e4('0x3e')]);return _0x243fe7[_0x50e4('0x4c')](_0x2d6848);}})[_0x50e4('0x24')](function(_0x1ea443){if(_0x1ea443){_0x340c58=_0x1ea443[_0x50e4('0x32')];if(!_0x3e71ec['query'][_0x50e4('0x33')](_0x50e4('0x34'))){_0x2d6848[_0x50e4('0x1d')]=qs[_0x50e4('0x1d')](_0x3e71ec[_0x50e4('0x2f')][_0x50e4('0x1d')]);_0x2d6848[_0x50e4('0x1b')]=qs[_0x50e4('0x1b')](_0x3e71ec[_0x50e4('0x2f')]['offset']);}return _0x243fe7[_0x50e4('0x4c')](_0x2d6848);}})['then'](function(_0x3165bf){if(_0x3165bf){return _0x3165bf?{'count':_0x340c58,'rows':_0x3165bf}:null;}})[_0x50e4('0x24')](respondWithResult(_0x30ead4,null))[_0x50e4('0x40')](handleError(_0x30ead4,null));};exports[_0x50e4('0x4d')]=function(_0x251e1e,_0x43e0ad,_0x21d76f){var _0x5e6f4f={};var _0x25ac2e={};var _0x1d9393;var _0x2e0497;return db[_0x50e4('0x29')][_0x50e4('0x4a')]({'where':{'id':_0x251e1e[_0x50e4('0x48')]['id']}})[_0x50e4('0x24')](handleEntityNotFound(_0x43e0ad,null))[_0x50e4('0x24')](function(_0x1db332){if(_0x1db332){_0x1d9393=_0x1db332;_0x25ac2e[_0x50e4('0x2d')]=_[_0x50e4('0x2e')](db['FreshdeskField'][_0x50e4('0x2a')]);_0x25ac2e[_0x50e4('0x2f')]=_[_0x50e4('0x2e')](_0x251e1e[_0x50e4('0x2f')]);_0x25ac2e[_0x50e4('0x38')]=_[_0x50e4('0x30')](_0x25ac2e['model'],_0x25ac2e['query']);_0x5e6f4f[_0x50e4('0x31')]=_[_0x50e4('0x30')](_0x25ac2e[_0x50e4('0x2d')],qs[_0x50e4('0x42')](_0x251e1e['query']['fields']));_0x5e6f4f['attributes']=_0x5e6f4f[_0x50e4('0x31')][_0x50e4('0x32')]?_0x5e6f4f[_0x50e4('0x31')]:_0x25ac2e['model'];_0x5e6f4f[_0x50e4('0x35')]=qs[_0x50e4('0x36')](_0x251e1e[_0x50e4('0x2f')][_0x50e4('0x36')]);_0x5e6f4f[_0x50e4('0x39')]=qs[_0x50e4('0x38')](_[_0x50e4('0x37')](_0x251e1e['query'],_0x25ac2e[_0x50e4('0x38')]));if(_0x251e1e['query']['filter']){_0x5e6f4f[_0x50e4('0x39')]=_[_0x50e4('0x3a')](_0x5e6f4f[_0x50e4('0x39')],{'$or':_[_0x50e4('0x3b')](_0x5e6f4f[_0x50e4('0x31')],function(_0x56bc0f){var _0x154772={};_0x154772[_0x56bc0f]={'$like':'%'+_0x251e1e[_0x50e4('0x2f')][_0x50e4('0x3d')]+'%'};return _0x154772;})});}_0x5e6f4f=_['merge']({},_0x5e6f4f,_0x251e1e['options']);return _0x1d9393['getDescriptions'](_0x5e6f4f);}})[_0x50e4('0x24')](function(_0x19c19b){if(_0x19c19b){_0x2e0497=_0x19c19b[_0x50e4('0x32')];if(!_0x251e1e[_0x50e4('0x2f')][_0x50e4('0x33')](_0x50e4('0x34'))){_0x5e6f4f['limit']=qs[_0x50e4('0x1d')](_0x251e1e['query'][_0x50e4('0x1d')]);_0x5e6f4f['offset']=qs[_0x50e4('0x1b')](_0x251e1e[_0x50e4('0x2f')][_0x50e4('0x1b')]);}return _0x1d9393[_0x50e4('0x4d')](_0x5e6f4f);}})[_0x50e4('0x24')](function(_0x174aa7){if(_0x174aa7){return _0x174aa7?{'count':_0x2e0497,'rows':_0x174aa7}:null;}})[_0x50e4('0x24')](respondWithResult(_0x43e0ad,null))[_0x50e4('0x40')](handleError(_0x43e0ad,null));};exports[_0x50e4('0x4e')]=function(_0x2b8d70,_0x941126,_0x43d5ee){var _0xbc9bfc={};var _0x5c17ba={};var _0x16c371;var _0x4dd716;return db[_0x50e4('0x29')][_0x50e4('0x4a')]({'where':{'id':_0x2b8d70[_0x50e4('0x48')]['id']}})[_0x50e4('0x24')](handleEntityNotFound(_0x941126,null))[_0x50e4('0x24')](function(_0x315ee3){if(_0x315ee3){_0x16c371=_0x315ee3;_0x5c17ba[_0x50e4('0x2d')]=_[_0x50e4('0x2e')](db[_0x50e4('0x4f')][_0x50e4('0x2a')]);_0x5c17ba[_0x50e4('0x2f')]=_['keys'](_0x2b8d70[_0x50e4('0x2f')]);_0x5c17ba[_0x50e4('0x38')]=_[_0x50e4('0x30')](_0x5c17ba[_0x50e4('0x2d')],_0x5c17ba['query']);_0xbc9bfc[_0x50e4('0x31')]=_['intersection'](_0x5c17ba[_0x50e4('0x2d')],qs[_0x50e4('0x42')](_0x2b8d70['query'][_0x50e4('0x42')]));_0xbc9bfc['attributes']=_0xbc9bfc['attributes'][_0x50e4('0x32')]?_0xbc9bfc[_0x50e4('0x31')]:_0x5c17ba['model'];_0xbc9bfc[_0x50e4('0x35')]=qs[_0x50e4('0x36')](_0x2b8d70[_0x50e4('0x2f')]['sort']);_0xbc9bfc['where']=qs[_0x50e4('0x38')](_[_0x50e4('0x37')](_0x2b8d70['query'],_0x5c17ba[_0x50e4('0x38')]));if(_0x2b8d70[_0x50e4('0x2f')][_0x50e4('0x3d')]){_0xbc9bfc[_0x50e4('0x39')]=_[_0x50e4('0x3a')](_0xbc9bfc[_0x50e4('0x39')],{'$or':_['map'](_0xbc9bfc[_0x50e4('0x31')],function(_0xeb55a1){var _0x3e1c27={};_0x3e1c27[_0xeb55a1]={'$like':'%'+_0x2b8d70[_0x50e4('0x2f')]['filter']+'%'};return _0x3e1c27;})});}_0xbc9bfc=_[_0x50e4('0x3a')]({},_0xbc9bfc,_0x2b8d70[_0x50e4('0x3e')]);return _0x16c371['getTags'](_0xbc9bfc);}})[_0x50e4('0x24')](function(_0x931670){if(_0x931670){_0x4dd716=_0x931670[_0x50e4('0x32')];if(!_0x2b8d70[_0x50e4('0x2f')][_0x50e4('0x33')]('nolimit')){_0xbc9bfc[_0x50e4('0x1d')]=qs[_0x50e4('0x1d')](_0x2b8d70[_0x50e4('0x2f')][_0x50e4('0x1d')]);_0xbc9bfc[_0x50e4('0x1b')]=qs[_0x50e4('0x1b')](_0x2b8d70['query'][_0x50e4('0x1b')]);}return _0x16c371[_0x50e4('0x4e')](_0xbc9bfc);}})['then'](function(_0x3b10d7){if(_0x3b10d7){return _0x3b10d7?{'count':_0x4dd716,'rows':_0x3b10d7}:null;}})[_0x50e4('0x24')](respondWithResult(_0x941126,null))[_0x50e4('0x40')](handleError(_0x941126,null));};exports['setTags']=function(_0xd80beb,_0x5df392,_0xd4adb5){if(_0xd80beb[_0x50e4('0x47')]['id']){delete _0xd80beb[_0x50e4('0x47')]['id'];}return db['FreshdeskConfiguration'][_0x50e4('0x4a')]({'where':{'id':_0xd80beb[_0x50e4('0x48')]['id']}})[_0x50e4('0x24')](handleEntityNotFound(_0x5df392,null))['then'](function(_0x331aa0){if(_0x331aa0){return _0x331aa0['setTags'](_0xd80beb['body'][_0x50e4('0x50')]||[]);}return null;})[_0x50e4('0x24')](respondWithResult(_0x5df392,null))[_0x50e4('0x40')](handleError(_0x5df392,null));};
\ No newline at end of file
+var _0x5407=['name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','find','create','catch','body','findOne','FreshdeskField','getFields','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','end','stack'];(function(_0x52411e,_0x58a360){var _0x56a3b7=function(_0x445037){while(--_0x445037){_0x52411e['push'](_0x52411e['shift']());}};_0x56a3b7(++_0x58a360);}(_0x5407,0x1c1));var _0x7540=function(_0x538bf6,_0x316aff){_0x538bf6=_0x538bf6-0x0;var _0x3a49dc=_0x5407[_0x538bf6];return _0x3a49dc;};'use strict';var emlformat=require(_0x7540('0x0'));var rimraf=require(_0x7540('0x1'));var zipdir=require(_0x7540('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7540('0x3'));var Mustache=require(_0x7540('0x4'));var util=require('util');var path=require(_0x7540('0x5'));var sox=require(_0x7540('0x6'));var csv=require(_0x7540('0x7'));var ejs=require(_0x7540('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7540('0x9'));var crypto=require(_0x7540('0xa'));var jsforce=require(_0x7540('0xb'));var deskjs=require(_0x7540('0xc'));var toCsv=require(_0x7540('0x7'));var querystring=require(_0x7540('0xd'));var Papa=require('papaparse');var Redis=require(_0x7540('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7540('0xf'));var as=require(_0x7540('0x10'));var hardwareService=require(_0x7540('0x11'));var logger=require(_0x7540('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7540('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7540('0x14'))['db'];function respondWithStatusCode(_0x3f3f06,_0x535722){_0x535722=_0x535722||0xcc;return function(_0x135a44){if(_0x135a44){return _0x3f3f06[_0x7540('0x15')](_0x535722);}return _0x3f3f06[_0x7540('0x16')](_0x535722)['end']();};}function respondWithResult(_0x48fe1e,_0x30deff){_0x30deff=_0x30deff||0xc8;return function(_0x20d595){if(_0x20d595){return _0x48fe1e[_0x7540('0x16')](_0x30deff)[_0x7540('0x17')](_0x20d595);}};}function respondWithFilteredResult(_0x4e525a,_0x572edd){return function(_0x6f91dd){if(_0x6f91dd){var _0x2256f5=typeof _0x572edd[_0x7540('0x18')]===_0x7540('0x19')&&typeof _0x572edd['limit']===_0x7540('0x19');var _0x300657=_0x6f91dd['count'];var _0x304e3=_0x2256f5?0x0:_0x572edd[_0x7540('0x18')];var _0x338407=_0x2256f5?_0x6f91dd[_0x7540('0x1a')]:_0x572edd['offset']+_0x572edd[_0x7540('0x1b')];var _0x242836;if(_0x338407>=_0x300657){_0x338407=_0x300657;_0x242836=0xc8;}else{_0x242836=0xce;}_0x4e525a[_0x7540('0x16')](_0x242836);return _0x4e525a[_0x7540('0x1c')](_0x7540('0x1d'),_0x304e3+'-'+_0x338407+'/'+_0x300657)[_0x7540('0x17')](_0x6f91dd);}return null;};}function patchUpdates(_0x4fe611){return function(_0x28d412){try{jsonpatch[_0x7540('0x1e')](_0x28d412,_0x4fe611,!![]);}catch(_0x395aea){return BPromise['reject'](_0x395aea);}return _0x28d412[_0x7540('0x1f')]();};}function saveUpdates(_0x4d9c64,_0x542cdc){return function(_0x2eeec1){if(_0x2eeec1){return _0x2eeec1[_0x7540('0x20')](_0x4d9c64)['then'](function(_0x318adf){return _0x318adf;});}return null;};}function removeEntity(_0x1cb70a,_0x1c7d5f){return function(_0x313cc5){if(_0x313cc5){return _0x313cc5[_0x7540('0x21')]()[_0x7540('0x22')](function(){_0x1cb70a[_0x7540('0x16')](0xcc)[_0x7540('0x23')]();});}};}function handleEntityNotFound(_0x70c611,_0x1012c2){return function(_0x385587){if(!_0x385587){_0x70c611['sendStatus'](0x194);}return _0x385587;};}function handleError(_0x1b2405,_0x5e6bf4){_0x5e6bf4=_0x5e6bf4||0x1f4;return function(_0x15a8f1){logger['error'](_0x15a8f1[_0x7540('0x24')]);if(_0x15a8f1['name']){delete _0x15a8f1[_0x7540('0x25')];}_0x1b2405[_0x7540('0x16')](_0x5e6bf4)[_0x7540('0x26')](_0x15a8f1);};}exports[_0x7540('0x27')]=function(_0x31984d,_0x3dc3c0){var _0x39ed38={},_0x5e3a5b={},_0x2c70ba={'count':0x0,'rows':[]};var _0x2b3452=_['map'](db[_0x7540('0x28')][_0x7540('0x29')],function(_0x500440){return{'name':_0x500440[_0x7540('0x2a')],'type':_0x500440[_0x7540('0x2b')]['key']};});_0x5e3a5b[_0x7540('0x2c')]=_[_0x7540('0x2d')](_0x2b3452,'name');_0x5e3a5b[_0x7540('0x2e')]=_[_0x7540('0x2f')](_0x31984d[_0x7540('0x2e')]);_0x5e3a5b[_0x7540('0x30')]=_[_0x7540('0x31')](_0x5e3a5b[_0x7540('0x2c')],_0x5e3a5b[_0x7540('0x2e')]);_0x39ed38[_0x7540('0x32')]=_['intersection'](_0x5e3a5b[_0x7540('0x2c')],qs[_0x7540('0x33')](_0x31984d[_0x7540('0x2e')][_0x7540('0x33')]));_0x39ed38['attributes']=_0x39ed38[_0x7540('0x32')][_0x7540('0x34')]?_0x39ed38[_0x7540('0x32')]:_0x5e3a5b[_0x7540('0x2c')];if(!_0x31984d[_0x7540('0x2e')][_0x7540('0x35')]('nolimit')){_0x39ed38[_0x7540('0x1b')]=qs[_0x7540('0x1b')](_0x31984d[_0x7540('0x2e')][_0x7540('0x1b')]);_0x39ed38['offset']=qs['offset'](_0x31984d[_0x7540('0x2e')][_0x7540('0x18')]);}_0x39ed38[_0x7540('0x36')]=qs[_0x7540('0x37')](_0x31984d['query'][_0x7540('0x37')]);_0x39ed38['where']=qs[_0x7540('0x30')](_[_0x7540('0x38')](_0x31984d[_0x7540('0x2e')],_0x5e3a5b[_0x7540('0x30')]),_0x2b3452);if(_0x31984d[_0x7540('0x2e')][_0x7540('0x39')]){_0x39ed38[_0x7540('0x3a')]=_[_0x7540('0x3b')](_0x39ed38['where'],{'$or':_['map'](_0x2b3452,function(_0x363777){if(_0x363777[_0x7540('0x2b')]!==_0x7540('0x3c')){var _0x4baa22={};_0x4baa22[_0x363777[_0x7540('0x25')]]={'$like':'%'+_0x31984d[_0x7540('0x2e')][_0x7540('0x39')]+'%'};return _0x4baa22;}})});}_0x39ed38=_['merge']({},_0x39ed38,_0x31984d[_0x7540('0x3d')]);var _0x3af5ce={'where':_0x39ed38['where']};return db[_0x7540('0x28')]['count'](_0x3af5ce)[_0x7540('0x22')](function(_0x10dd75){_0x2c70ba[_0x7540('0x1a')]=_0x10dd75;if(_0x31984d[_0x7540('0x2e')]['includeAll']){_0x39ed38[_0x7540('0x3e')]=[{'all':!![]}];}return db[_0x7540('0x28')][_0x7540('0x3f')](_0x39ed38);})[_0x7540('0x22')](function(_0x48c9bb){_0x2c70ba[_0x7540('0x40')]=_0x48c9bb;return _0x2c70ba;})['then'](respondWithFilteredResult(_0x3dc3c0,_0x39ed38))['catch'](handleError(_0x3dc3c0,null));};exports[_0x7540('0x41')]=function(_0x22750e,_0x457031){var _0x45dca8={'raw':![],'where':{'id':_0x22750e[_0x7540('0x42')]['id']}},_0x1150fd={};_0x1150fd['model']=_['keys'](db[_0x7540('0x28')][_0x7540('0x29')]);_0x1150fd['query']=_['keys'](_0x22750e[_0x7540('0x2e')]);_0x1150fd[_0x7540('0x30')]=_[_0x7540('0x31')](_0x1150fd[_0x7540('0x2c')],_0x1150fd[_0x7540('0x2e')]);_0x45dca8[_0x7540('0x32')]=_[_0x7540('0x31')](_0x1150fd['model'],qs['fields'](_0x22750e[_0x7540('0x2e')]['fields']));_0x45dca8[_0x7540('0x32')]=_0x45dca8[_0x7540('0x32')][_0x7540('0x34')]?_0x45dca8[_0x7540('0x32')]:_0x1150fd[_0x7540('0x2c')];if(_0x22750e['query']['includeAll']){_0x45dca8[_0x7540('0x3e')]=[{'all':!![]}];}_0x45dca8=_[_0x7540('0x3b')]({},_0x45dca8,_0x22750e[_0x7540('0x3d')]);return db[_0x7540('0x28')][_0x7540('0x43')](_0x45dca8)[_0x7540('0x22')](handleEntityNotFound(_0x457031,null))[_0x7540('0x22')](respondWithResult(_0x457031,null))['catch'](handleError(_0x457031,null));};exports[_0x7540('0x44')]=function(_0x4f20b7,_0x1ef632){return db[_0x7540('0x28')]['create'](_0x4f20b7['body'],{})[_0x7540('0x22')](respondWithResult(_0x1ef632,0xc9))[_0x7540('0x45')](handleError(_0x1ef632,null));};exports['update']=function(_0x34018a,_0x3dd001){if(_0x34018a[_0x7540('0x46')]['id']){delete _0x34018a[_0x7540('0x46')]['id'];}return db[_0x7540('0x28')][_0x7540('0x43')]({'where':{'id':_0x34018a['params']['id']}})[_0x7540('0x22')](handleEntityNotFound(_0x3dd001,null))[_0x7540('0x22')](saveUpdates(_0x34018a[_0x7540('0x46')],null))[_0x7540('0x22')](respondWithResult(_0x3dd001,null))[_0x7540('0x45')](handleError(_0x3dd001,null));};exports[_0x7540('0x21')]=function(_0x5810b9,_0x2acc57){return db[_0x7540('0x28')][_0x7540('0x43')]({'where':{'id':_0x5810b9[_0x7540('0x42')]['id']}})[_0x7540('0x22')](handleEntityNotFound(_0x2acc57,null))[_0x7540('0x22')](removeEntity(_0x2acc57,null))[_0x7540('0x45')](handleError(_0x2acc57,null));};exports['getFields']=function(_0x14035f,_0x3c8699,_0x55a6c9){var _0xe0557d={};var _0x573ae0={};var _0xdeca85;var _0x28eaf5;return db[_0x7540('0x28')][_0x7540('0x47')]({'where':{'id':_0x14035f[_0x7540('0x42')]['id']}})[_0x7540('0x22')](handleEntityNotFound(_0x3c8699,null))[_0x7540('0x22')](function(_0x540d18){if(_0x540d18){_0xdeca85=_0x540d18;_0x573ae0['model']=_['keys'](db[_0x7540('0x48')][_0x7540('0x29')]);_0x573ae0[_0x7540('0x2e')]=_[_0x7540('0x2f')](_0x14035f[_0x7540('0x2e')]);_0x573ae0[_0x7540('0x30')]=_['intersection'](_0x573ae0['model'],_0x573ae0['query']);_0xe0557d['attributes']=_['intersection'](_0x573ae0['model'],qs[_0x7540('0x33')](_0x14035f[_0x7540('0x2e')][_0x7540('0x33')]));_0xe0557d[_0x7540('0x32')]=_0xe0557d[_0x7540('0x32')][_0x7540('0x34')]?_0xe0557d[_0x7540('0x32')]:_0x573ae0[_0x7540('0x2c')];_0xe0557d[_0x7540('0x36')]=qs[_0x7540('0x37')](_0x14035f['query']['sort']);_0xe0557d[_0x7540('0x3a')]=qs[_0x7540('0x30')](_[_0x7540('0x38')](_0x14035f[_0x7540('0x2e')],_0x573ae0[_0x7540('0x30')]));if(_0x14035f['query'][_0x7540('0x39')]){_0xe0557d[_0x7540('0x3a')]=_[_0x7540('0x3b')](_0xe0557d[_0x7540('0x3a')],{'$or':_[_0x7540('0x2d')](_0xe0557d['attributes'],function(_0x78ec6d){var _0xbafc04={};_0xbafc04[_0x78ec6d]={'$like':'%'+_0x14035f[_0x7540('0x2e')][_0x7540('0x39')]+'%'};return _0xbafc04;})});}_0xe0557d=_['merge']({},_0xe0557d,_0x14035f['options']);return _0xdeca85[_0x7540('0x49')](_0xe0557d);}})[_0x7540('0x22')](function(_0x115961){if(_0x115961){_0x28eaf5=_0x115961['length'];if(!_0x14035f[_0x7540('0x2e')]['hasOwnProperty'](_0x7540('0x4a'))){_0xe0557d[_0x7540('0x1b')]=qs[_0x7540('0x1b')](_0x14035f[_0x7540('0x2e')][_0x7540('0x1b')]);_0xe0557d[_0x7540('0x18')]=qs[_0x7540('0x18')](_0x14035f['query'][_0x7540('0x18')]);}return _0xdeca85[_0x7540('0x49')](_0xe0557d);}})[_0x7540('0x22')](function(_0x4f2575){if(_0x4f2575){return _0x4f2575?{'count':_0x28eaf5,'rows':_0x4f2575}:null;}})['then'](respondWithResult(_0x3c8699,null))[_0x7540('0x45')](handleError(_0x3c8699,null));};exports[_0x7540('0x4b')]=function(_0x554bd8,_0x492b7e,_0x51b569){var _0x3348dc={};var _0x10571f={};var _0x156474;var _0x8321c;return db['FreshdeskConfiguration'][_0x7540('0x47')]({'where':{'id':_0x554bd8['params']['id']}})[_0x7540('0x22')](handleEntityNotFound(_0x492b7e,null))[_0x7540('0x22')](function(_0xee2af){if(_0xee2af){_0x156474=_0xee2af;_0x10571f[_0x7540('0x2c')]=_['keys'](db[_0x7540('0x48')]['rawAttributes']);_0x10571f['query']=_[_0x7540('0x2f')](_0x554bd8['query']);_0x10571f[_0x7540('0x30')]=_[_0x7540('0x31')](_0x10571f[_0x7540('0x2c')],_0x10571f[_0x7540('0x2e')]);_0x3348dc[_0x7540('0x32')]=_[_0x7540('0x31')](_0x10571f[_0x7540('0x2c')],qs[_0x7540('0x33')](_0x554bd8[_0x7540('0x2e')][_0x7540('0x33')]));_0x3348dc[_0x7540('0x32')]=_0x3348dc[_0x7540('0x32')]['length']?_0x3348dc[_0x7540('0x32')]:_0x10571f[_0x7540('0x2c')];_0x3348dc[_0x7540('0x36')]=qs[_0x7540('0x37')](_0x554bd8[_0x7540('0x2e')][_0x7540('0x37')]);_0x3348dc['where']=qs[_0x7540('0x30')](_[_0x7540('0x38')](_0x554bd8[_0x7540('0x2e')],_0x10571f[_0x7540('0x30')]));if(_0x554bd8['query'][_0x7540('0x39')]){_0x3348dc[_0x7540('0x3a')]=_['merge'](_0x3348dc[_0x7540('0x3a')],{'$or':_[_0x7540('0x2d')](_0x3348dc[_0x7540('0x32')],function(_0x52225c){var _0x463d57={};_0x463d57[_0x52225c]={'$like':'%'+_0x554bd8[_0x7540('0x2e')][_0x7540('0x39')]+'%'};return _0x463d57;})});}_0x3348dc=_[_0x7540('0x3b')]({},_0x3348dc,_0x554bd8['options']);return _0x156474[_0x7540('0x4b')](_0x3348dc);}})['then'](function(_0x46b451){if(_0x46b451){_0x8321c=_0x46b451['length'];if(!_0x554bd8[_0x7540('0x2e')][_0x7540('0x35')](_0x7540('0x4a'))){_0x3348dc[_0x7540('0x1b')]=qs[_0x7540('0x1b')](_0x554bd8[_0x7540('0x2e')]['limit']);_0x3348dc['offset']=qs['offset'](_0x554bd8['query'][_0x7540('0x18')]);}return _0x156474[_0x7540('0x4b')](_0x3348dc);}})['then'](function(_0x52e075){if(_0x52e075){return _0x52e075?{'count':_0x8321c,'rows':_0x52e075}:null;}})[_0x7540('0x22')](respondWithResult(_0x492b7e,null))['catch'](handleError(_0x492b7e,null));};exports[_0x7540('0x4c')]=function(_0x511eca,_0x33e489,_0x166c29){var _0x49f873={};var _0x490cc9={};var _0x5f0562;var _0x2173bb;return db[_0x7540('0x28')]['findOne']({'where':{'id':_0x511eca['params']['id']}})['then'](handleEntityNotFound(_0x33e489,null))[_0x7540('0x22')](function(_0x45e15d){if(_0x45e15d){_0x5f0562=_0x45e15d;_0x490cc9[_0x7540('0x2c')]=_[_0x7540('0x2f')](db['FreshdeskField'][_0x7540('0x29')]);_0x490cc9[_0x7540('0x2e')]=_[_0x7540('0x2f')](_0x511eca[_0x7540('0x2e')]);_0x490cc9[_0x7540('0x30')]=_[_0x7540('0x31')](_0x490cc9[_0x7540('0x2c')],_0x490cc9[_0x7540('0x2e')]);_0x49f873[_0x7540('0x32')]=_[_0x7540('0x31')](_0x490cc9[_0x7540('0x2c')],qs[_0x7540('0x33')](_0x511eca[_0x7540('0x2e')][_0x7540('0x33')]));_0x49f873[_0x7540('0x32')]=_0x49f873['attributes'][_0x7540('0x34')]?_0x49f873[_0x7540('0x32')]:_0x490cc9[_0x7540('0x2c')];_0x49f873[_0x7540('0x36')]=qs[_0x7540('0x37')](_0x511eca[_0x7540('0x2e')][_0x7540('0x37')]);_0x49f873[_0x7540('0x3a')]=qs[_0x7540('0x30')](_[_0x7540('0x38')](_0x511eca[_0x7540('0x2e')],_0x490cc9[_0x7540('0x30')]));if(_0x511eca[_0x7540('0x2e')][_0x7540('0x39')]){_0x49f873[_0x7540('0x3a')]=_[_0x7540('0x3b')](_0x49f873[_0x7540('0x3a')],{'$or':_[_0x7540('0x2d')](_0x49f873[_0x7540('0x32')],function(_0x1d7961){var _0x255f82={};_0x255f82[_0x1d7961]={'$like':'%'+_0x511eca['query'][_0x7540('0x39')]+'%'};return _0x255f82;})});}_0x49f873=_[_0x7540('0x3b')]({},_0x49f873,_0x511eca['options']);return _0x5f0562[_0x7540('0x4c')](_0x49f873);}})[_0x7540('0x22')](function(_0xea2a36){if(_0xea2a36){_0x2173bb=_0xea2a36[_0x7540('0x34')];if(!_0x511eca[_0x7540('0x2e')][_0x7540('0x35')](_0x7540('0x4a'))){_0x49f873[_0x7540('0x1b')]=qs[_0x7540('0x1b')](_0x511eca['query']['limit']);_0x49f873[_0x7540('0x18')]=qs[_0x7540('0x18')](_0x511eca[_0x7540('0x2e')]['offset']);}return _0x5f0562['getDescriptions'](_0x49f873);}})['then'](function(_0x496ea6){if(_0x496ea6){return _0x496ea6?{'count':_0x2173bb,'rows':_0x496ea6}:null;}})['then'](respondWithResult(_0x33e489,null))['catch'](handleError(_0x33e489,null));};exports[_0x7540('0x4d')]=function(_0x18f3ec,_0x2e3bbc,_0x42de8b){var _0x570458={};var _0x1ef4ee={};var _0x4a4412;var _0x3ca637;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x18f3ec[_0x7540('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e3bbc,null))['then'](function(_0x4911a1){if(_0x4911a1){_0x4a4412=_0x4911a1;_0x1ef4ee['model']=_[_0x7540('0x2f')](db[_0x7540('0x4e')][_0x7540('0x29')]);_0x1ef4ee[_0x7540('0x2e')]=_['keys'](_0x18f3ec[_0x7540('0x2e')]);_0x1ef4ee['filters']=_[_0x7540('0x31')](_0x1ef4ee[_0x7540('0x2c')],_0x1ef4ee[_0x7540('0x2e')]);_0x570458[_0x7540('0x32')]=_[_0x7540('0x31')](_0x1ef4ee[_0x7540('0x2c')],qs['fields'](_0x18f3ec[_0x7540('0x2e')][_0x7540('0x33')]));_0x570458[_0x7540('0x32')]=_0x570458[_0x7540('0x32')][_0x7540('0x34')]?_0x570458[_0x7540('0x32')]:_0x1ef4ee[_0x7540('0x2c')];_0x570458['order']=qs['sort'](_0x18f3ec[_0x7540('0x2e')][_0x7540('0x37')]);_0x570458['where']=qs[_0x7540('0x30')](_[_0x7540('0x38')](_0x18f3ec[_0x7540('0x2e')],_0x1ef4ee[_0x7540('0x30')]));if(_0x18f3ec[_0x7540('0x2e')]['filter']){_0x570458[_0x7540('0x3a')]=_[_0x7540('0x3b')](_0x570458[_0x7540('0x3a')],{'$or':_[_0x7540('0x2d')](_0x570458[_0x7540('0x32')],function(_0x490a8a){var _0x356fd1={};_0x356fd1[_0x490a8a]={'$like':'%'+_0x18f3ec[_0x7540('0x2e')][_0x7540('0x39')]+'%'};return _0x356fd1;})});}_0x570458=_['merge']({},_0x570458,_0x18f3ec['options']);return _0x4a4412[_0x7540('0x4d')](_0x570458);}})['then'](function(_0x9b112a){if(_0x9b112a){_0x3ca637=_0x9b112a[_0x7540('0x34')];if(!_0x18f3ec[_0x7540('0x2e')][_0x7540('0x35')](_0x7540('0x4a'))){_0x570458[_0x7540('0x1b')]=qs['limit'](_0x18f3ec[_0x7540('0x2e')][_0x7540('0x1b')]);_0x570458[_0x7540('0x18')]=qs[_0x7540('0x18')](_0x18f3ec[_0x7540('0x2e')]['offset']);}return _0x4a4412[_0x7540('0x4d')](_0x570458);}})['then'](function(_0x287580){if(_0x287580){return _0x287580?{'count':_0x3ca637,'rows':_0x287580}:null;}})[_0x7540('0x22')](respondWithResult(_0x2e3bbc,null))['catch'](handleError(_0x2e3bbc,null));};exports[_0x7540('0x4f')]=function(_0x59534a,_0x151fbc,_0xac464f){if(_0x59534a[_0x7540('0x46')]['id']){delete _0x59534a[_0x7540('0x46')]['id'];}return db['FreshdeskConfiguration'][_0x7540('0x47')]({'where':{'id':_0x59534a[_0x7540('0x42')]['id']}})[_0x7540('0x22')](handleEntityNotFound(_0x151fbc,null))[_0x7540('0x22')](function(_0xdc5974){if(_0xdc5974){return _0xdc5974[_0x7540('0x4f')](_0x59534a[_0x7540('0x46')][_0x7540('0x50')]||[]);}return null;})[_0x7540('0x22')](respondWithResult(_0x151fbc,null))[_0x7540('0x45')](handleError(_0x151fbc,null));};
\ No newline at end of file
index 6e56d4e..d6b19d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['api','moment','bluebird','request-promise','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0xbd51,0x8e));var _0x1bd5=function(_0x5809a4,_0x3e0d68){_0x5809a4=_0x5809a4-0x0;var _0x50022b=_0xbd51[_0x5809a4];return _0x50022b;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1bd5('0x1'));var moment=require(_0x1bd5('0x2'));var BPromise=require(_0x1bd5('0x3'));var rp=require(_0x1bd5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1bd5('0x5'));var config=require('../../config/environment');var attributes=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x1b7b4a,_0x204f75){return _0x1b7b4a[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x27c8=['./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1f415f,_0x2c81d5){var _0x191375=function(_0xedaa94){while(--_0xedaa94){_0x1f415f['push'](_0x1f415f['shift']());}};_0x191375(++_0x2c81d5);}(_0x27c8,0x1b1));var _0x827c=function(_0x2d061b,_0x2665bd){_0x2d061b=_0x2d061b-0x0;var _0x1c4069=_0x27c8[_0x2d061b];return _0x1c4069;};'use strict';var _=require(_0x827c('0x0'));var util=require(_0x827c('0x1'));var logger=require(_0x827c('0x2'))(_0x827c('0x3'));var moment=require('moment');var BPromise=require(_0x827c('0x4'));var rp=require(_0x827c('0x5'));var fs=require('fs');var path=require(_0x827c('0x6'));var rimraf=require(_0x827c('0x7'));var config=require(_0x827c('0x8'));var attributes=require(_0x827c('0x9'));module[_0x827c('0xa')]=function(_0x4c7bea,_0x39426a){return _0x4c7bea['define'](_0x827c('0xb'),attributes,{'tableName':_0x827c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index be6bb2c..1c943c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e53=['info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x431480,_0x40c7a7){var _0x139af7=function(_0x58eb96){while(--_0x58eb96){_0x431480['push'](_0x431480['shift']());}};_0x139af7(++_0x40c7a7);}(_0x0e53,0xdc));var _0x30e5=function(_0xb995d2,_0x2c3f68){_0xb995d2=_0xb995d2-0x0;var _0x5cc40f=_0x0e53[_0xb995d2];return _0x5cc40f;};'use strict';var _=require('lodash');var util=require(_0x30e5('0x0'));var moment=require(_0x30e5('0x1'));var BPromise=require('bluebird');var rs=require(_0x30e5('0x2'));var fs=require('fs');var Redis=require(_0x30e5('0x3'));var db=require(_0x30e5('0x4'))['db'];var utils=require(_0x30e5('0x5'));var logger=require('../../config/logger')(_0x30e5('0x6'));var config=require(_0x30e5('0x7'));var jayson=require(_0x30e5('0x8'));var client=jayson['client'][_0x30e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x458833,_0x34983c,_0xdd3efb){return new BPromise(function(_0x2a2350,_0x1ed529){return client['request'](_0x458833,_0xdd3efb)[_0x30e5('0xa')](function(_0x5c2703){logger[_0x30e5('0xb')](_0x30e5('0xc'),_0x34983c,_0x30e5('0xd'));logger[_0x30e5('0xe')](_0x30e5('0xf'),_0x34983c,_0x30e5('0xd'),JSON[_0x30e5('0x10')](_0x5c2703));if(_0x5c2703[_0x30e5('0x11')]){if(_0x5c2703[_0x30e5('0x11')][_0x30e5('0x12')]===0x1f4){logger[_0x30e5('0x11')](_0x30e5('0xc'),_0x34983c,_0x5c2703[_0x30e5('0x11')]['message']);return _0x1ed529(_0x5c2703[_0x30e5('0x11')][_0x30e5('0x13')]);}logger[_0x30e5('0x11')](_0x30e5('0xc'),_0x34983c,_0x5c2703[_0x30e5('0x11')]['message']);return _0x2a2350(_0x5c2703[_0x30e5('0x11')][_0x30e5('0x13')]);}else{logger[_0x30e5('0xb')](_0x30e5('0xc'),_0x34983c,_0x30e5('0xd'));_0x2a2350(_0x5c2703[_0x30e5('0x14')][_0x30e5('0x13')]);}})['catch'](function(_0x29571c){logger[_0x30e5('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x34983c,_0x29571c);_0x1ed529(_0x29571c);});});}
\ No newline at end of file
+var _0x7fe9=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7fe9,0xad));var _0x97fe=function(_0x413520,_0x457d8b){_0x413520=_0x413520-0x0;var _0x248495=_0x7fe9[_0x413520];return _0x248495;};'use strict';var _=require(_0x97fe('0x0'));var util=require(_0x97fe('0x1'));var moment=require(_0x97fe('0x2'));var BPromise=require(_0x97fe('0x3'));var rs=require(_0x97fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97fe('0x5'))['db'];var utils=require(_0x97fe('0x6'));var logger=require(_0x97fe('0x7'))('rpc');var config=require(_0x97fe('0x8'));var jayson=require(_0x97fe('0x9'));var client=jayson[_0x97fe('0xa')][_0x97fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x464994,_0x5a855b,_0x33ca84){return new BPromise(function(_0x15ec6c,_0x1fe033){return client[_0x97fe('0xc')](_0x464994,_0x33ca84)[_0x97fe('0xd')](function(_0x25c696){logger[_0x97fe('0xe')](_0x97fe('0xf'),_0x5a855b,_0x97fe('0x10'));logger[_0x97fe('0x11')](_0x97fe('0x12'),_0x5a855b,'request\x20sent',JSON[_0x97fe('0x13')](_0x25c696));if(_0x25c696[_0x97fe('0x14')]){if(_0x25c696['error'][_0x97fe('0x15')]===0x1f4){logger[_0x97fe('0x14')](_0x97fe('0xf'),_0x5a855b,_0x25c696[_0x97fe('0x14')][_0x97fe('0x16')]);return _0x1fe033(_0x25c696[_0x97fe('0x14')]['message']);}logger[_0x97fe('0x14')](_0x97fe('0xf'),_0x5a855b,_0x25c696['error'][_0x97fe('0x16')]);return _0x15ec6c(_0x25c696[_0x97fe('0x14')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5a855b,'request\x20sent');_0x15ec6c(_0x25c696[_0x97fe('0x17')]['message']);}})[_0x97fe('0x18')](function(_0x86eb4d){logger[_0x97fe('0x14')](_0x97fe('0xf'),_0x5a855b,_0x86eb4d);_0x1fe033(_0x86eb4d);});});}
\ No newline at end of file
index 7a33324..6891f08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc74c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','exports','multer','util','path','express'];(function(_0xc77c92,_0x8a9f1){var _0x51319b=function(_0x45b041){while(--_0x45b041){_0xc77c92['push'](_0xc77c92['shift']());}};_0x51319b(++_0x8a9f1);}(_0xc74c,0xb0));var _0xcc74=function(_0x540f0c,_0x5a5e98){_0x540f0c=_0x540f0c-0x0;var _0x1342eb=_0xc74c[_0x540f0c];return _0x1342eb;};'use strict';var multer=require(_0xcc74('0x0'));var util=require(_0xcc74('0x1'));var path=require(_0xcc74('0x2'));var timeout=require('connect-timeout');var express=require(_0xcc74('0x3'));var router=express[_0xcc74('0x4')]();var fs_extra=require(_0xcc74('0x5'));var auth=require(_0xcc74('0x6'));var interaction=require(_0xcc74('0x7'));var config=require(_0xcc74('0x8'));var controller=require(_0xcc74('0x9'));router[_0xcc74('0xa')]('/',auth[_0xcc74('0xb')](),controller[_0xcc74('0xc')]);router[_0xcc74('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xcc74('0xd')]);router[_0xcc74('0xe')]('/',auth[_0xcc74('0xb')](),controller['create']);router[_0xcc74('0xf')](_0xcc74('0x10'),auth[_0xcc74('0xb')](),controller[_0xcc74('0x11')]);router[_0xcc74('0x12')](_0xcc74('0x10'),auth[_0xcc74('0xb')](),controller['destroy']);module[_0xcc74('0x13')]=router;
\ No newline at end of file
+var _0xdf2c=['Router','fs-extra','./intFreshdeskField.controller','get','isAuthenticated','/:id','post','create','put','multer','util','path'];(function(_0x1e5354,_0x3b0903){var _0x47be56=function(_0x50d211){while(--_0x50d211){_0x1e5354['push'](_0x1e5354['shift']());}};_0x47be56(++_0x3b0903);}(_0xdf2c,0x1a1));var _0xcdf2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdf2c[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xcdf2('0x0'));var util=require(_0xcdf2('0x1'));var path=require(_0xcdf2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcdf2('0x3')]();var fs_extra=require(_0xcdf2('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcdf2('0x5'));router[_0xcdf2('0x6')]('/',auth[_0xcdf2('0x7')](),controller['index']);router[_0xcdf2('0x6')](_0xcdf2('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xcdf2('0x9')]('/',auth[_0xcdf2('0x7')](),controller[_0xcdf2('0xa')]);router[_0xcdf2('0xb')]('/:id',auth[_0xcdf2('0x7')](),controller['update']);router['delete'](_0xcdf2('0x8'),auth[_0xcdf2('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 9c94f57..197f417 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4971=['customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN','sequelize','exports','string'];(function(_0x29d6d4,_0x595ee4){var _0x30ea16=function(_0x49ca3e){while(--_0x49ca3e){_0x29d6d4['push'](_0x29d6d4['shift']());}};_0x30ea16(++_0x595ee4);}(_0x4971,0x129));var _0x1497=function(_0x46d3e5,_0x2cc6c0){_0x46d3e5=_0x46d3e5-0x0;var _0x30d237=_0x4971[_0x46d3e5];return _0x30d237;};'use strict';var Sequelize=require(_0x1497('0x0'));module[_0x1497('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1497('0x2'),'variable',_0x1497('0x3'),_0x1497('0x4'),_0x1497('0x5')),'defaultValue':_0x1497('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1497('0x6')]},'keyType':{'type':Sequelize[_0x1497('0x7')](_0x1497('0x2'),_0x1497('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x1497('0x6')]},'idField':{'type':Sequelize[_0x1497('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1497('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfa51=['STRING','exports','ENUM','string','customVariable','keyValue','BOOLEAN'];(function(_0x135a0d,_0x31e3fe){var _0x57dfef=function(_0xc5fdd0){while(--_0xc5fdd0){_0x135a0d['push'](_0x135a0d['shift']());}};_0x57dfef(++_0x31e3fe);}(_0xfa51,0x1b3));var _0x1fa5=function(_0x473f61,_0x1b92bd){_0x473f61=_0x473f61-0x0;var _0x30053d=_0xfa51[_0x473f61];return _0x30053d;};'use strict';var Sequelize=require('sequelize');module[_0x1fa5('0x0')]={'type':{'type':Sequelize[_0x1fa5('0x1')](_0x1fa5('0x2'),'variable',_0x1fa5('0x3'),_0x1fa5('0x4'),'picklist'),'defaultValue':_0x1fa5('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1fa5('0x1')](_0x1fa5('0x2'),'variable',_0x1fa5('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1fa5('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1fa5('0x6')]}};
\ No newline at end of file
index 828fc6b..7cf271e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f3a=['status','end','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','name','index','FreshdeskField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','length','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x3357b2,_0x2b5af1){_0x3357b2=_0x3357b2-0x0;var _0x371712=_0x2f3a[_0x3357b2];return _0x371712;};'use strict';var emlformat=require(_0xa2f3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2f3('0x1'));var rp=require(_0xa2f3('0x2'));var moment=require(_0xa2f3('0x3'));var BPromise=require(_0xa2f3('0x4'));var Mustache=require(_0xa2f3('0x5'));var util=require(_0xa2f3('0x6'));var path=require('path');var sox=require(_0xa2f3('0x7'));var csv=require('to-csv');var ejs=require(_0xa2f3('0x8'));var fs=require('fs');var fs_extra=require(_0xa2f3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2f3('0xa'));var jsforce=require(_0xa2f3('0xb'));var deskjs=require(_0xa2f3('0xc'));var toCsv=require(_0xa2f3('0xd'));var querystring=require('querystring');var Papa=require(_0xa2f3('0xe'));var Redis=require(_0xa2f3('0xf'));var authService=require(_0xa2f3('0x10'));var qs=require(_0xa2f3('0x11'));var as=require(_0xa2f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2f3('0x13'))(_0xa2f3('0x14'));var utils=require('../../config/utils');var config=require(_0xa2f3('0x15'));var licenseUtil=require(_0xa2f3('0x16'));var db=require(_0xa2f3('0x17'))['db'];function respondWithStatusCode(_0x58f6df,_0x6aa8f2){_0x6aa8f2=_0x6aa8f2||0xcc;return function(_0x194281){if(_0x194281){return _0x58f6df[_0xa2f3('0x18')](_0x6aa8f2);}return _0x58f6df[_0xa2f3('0x19')](_0x6aa8f2)[_0xa2f3('0x1a')]();};}function respondWithResult(_0xd4f9db,_0x3907fe){_0x3907fe=_0x3907fe||0xc8;return function(_0x4544d4){if(_0x4544d4){return _0xd4f9db[_0xa2f3('0x19')](_0x3907fe)['json'](_0x4544d4);}};}function respondWithFilteredResult(_0xdc3967,_0x33bf10){return function(_0x74fb58){if(_0x74fb58){var _0x51d297=typeof _0x33bf10[_0xa2f3('0x1b')]===_0xa2f3('0x1c')&&typeof _0x33bf10['limit']==='undefined';var _0xb1fe06=_0x74fb58[_0xa2f3('0x1d')];var _0x2db0d2=_0x51d297?0x0:_0x33bf10[_0xa2f3('0x1b')];var _0x205578=_0x51d297?_0x74fb58[_0xa2f3('0x1d')]:_0x33bf10[_0xa2f3('0x1b')]+_0x33bf10[_0xa2f3('0x1e')];var _0x550d68;if(_0x205578>=_0xb1fe06){_0x205578=_0xb1fe06;_0x550d68=0xc8;}else{_0x550d68=0xce;}_0xdc3967[_0xa2f3('0x19')](_0x550d68);return _0xdc3967[_0xa2f3('0x1f')]('Content-Range',_0x2db0d2+'-'+_0x205578+'/'+_0xb1fe06)['json'](_0x74fb58);}return null;};}function patchUpdates(_0x2f74a0){return function(_0x53af81){try{jsonpatch[_0xa2f3('0x20')](_0x53af81,_0x2f74a0,!![]);}catch(_0x147fb7){return BPromise['reject'](_0x147fb7);}return _0x53af81[_0xa2f3('0x21')]();};}function saveUpdates(_0x3e055d,_0x14d989){return function(_0x2685bb){if(_0x2685bb){return _0x2685bb[_0xa2f3('0x22')](_0x3e055d)[_0xa2f3('0x23')](function(_0x37f8c2){return _0x37f8c2;});}return null;};}function removeEntity(_0xa02908,_0x49a589){return function(_0x81af9b){if(_0x81af9b){return _0x81af9b[_0xa2f3('0x24')]()[_0xa2f3('0x23')](function(){_0xa02908[_0xa2f3('0x19')](0xcc)[_0xa2f3('0x1a')]();});}};}function handleEntityNotFound(_0x2e6332,_0x1be0c1){return function(_0x5347de){if(!_0x5347de){_0x2e6332['sendStatus'](0x194);}return _0x5347de;};}function handleError(_0x2f4248,_0x4319f3){_0x4319f3=_0x4319f3||0x1f4;return function(_0x1dd4ec){logger[_0xa2f3('0x25')](_0x1dd4ec['stack']);if(_0x1dd4ec[_0xa2f3('0x26')]){delete _0x1dd4ec[_0xa2f3('0x26')];}_0x2f4248[_0xa2f3('0x19')](_0x4319f3)['send'](_0x1dd4ec);};}exports[_0xa2f3('0x27')]=function(_0x4ec4ab,_0x1ceea4){var _0x5b868c={},_0x452142={},_0x52f211={'count':0x0,'rows':[]};var _0x46f5c4=_['map'](db[_0xa2f3('0x28')][_0xa2f3('0x29')],function(_0x2e8291){return{'name':_0x2e8291[_0xa2f3('0x2a')],'type':_0x2e8291[_0xa2f3('0x2b')]['key']};});_0x452142[_0xa2f3('0x2c')]=_[_0xa2f3('0x2d')](_0x46f5c4,_0xa2f3('0x26'));_0x452142[_0xa2f3('0x2e')]=_[_0xa2f3('0x2f')](_0x4ec4ab[_0xa2f3('0x2e')]);_0x452142[_0xa2f3('0x30')]=_[_0xa2f3('0x31')](_0x452142[_0xa2f3('0x2c')],_0x452142['query']);_0x5b868c[_0xa2f3('0x32')]=_[_0xa2f3('0x31')](_0x452142[_0xa2f3('0x2c')],qs[_0xa2f3('0x33')](_0x4ec4ab[_0xa2f3('0x2e')]['fields']));_0x5b868c[_0xa2f3('0x32')]=_0x5b868c['attributes']['length']?_0x5b868c[_0xa2f3('0x32')]:_0x452142[_0xa2f3('0x2c')];if(!_0x4ec4ab['query'][_0xa2f3('0x34')](_0xa2f3('0x35'))){_0x5b868c['limit']=qs[_0xa2f3('0x1e')](_0x4ec4ab[_0xa2f3('0x2e')]['limit']);_0x5b868c['offset']=qs[_0xa2f3('0x1b')](_0x4ec4ab[_0xa2f3('0x2e')][_0xa2f3('0x1b')]);}_0x5b868c[_0xa2f3('0x36')]=qs['sort'](_0x4ec4ab[_0xa2f3('0x2e')]['sort']);_0x5b868c[_0xa2f3('0x37')]=qs['filters'](_['pick'](_0x4ec4ab[_0xa2f3('0x2e')],_0x452142[_0xa2f3('0x30')]),_0x46f5c4);if(_0x4ec4ab['query'][_0xa2f3('0x38')]){_0x5b868c['where']=_[_0xa2f3('0x39')](_0x5b868c[_0xa2f3('0x37')],{'$or':_[_0xa2f3('0x2d')](_0x46f5c4,function(_0x11dade){if(_0x11dade[_0xa2f3('0x2b')]!==_0xa2f3('0x3a')){var _0x55d45f={};_0x55d45f[_0x11dade[_0xa2f3('0x26')]]={'$like':'%'+_0x4ec4ab[_0xa2f3('0x2e')][_0xa2f3('0x38')]+'%'};return _0x55d45f;}})});}_0x5b868c=_[_0xa2f3('0x39')]({},_0x5b868c,_0x4ec4ab[_0xa2f3('0x3b')]);var _0x3a7010={'where':_0x5b868c[_0xa2f3('0x37')]};return db[_0xa2f3('0x28')]['count'](_0x3a7010)[_0xa2f3('0x23')](function(_0x1ce533){_0x52f211[_0xa2f3('0x1d')]=_0x1ce533;if(_0x4ec4ab[_0xa2f3('0x2e')][_0xa2f3('0x3c')]){_0x5b868c['include']=[{'all':!![]}];}return db[_0xa2f3('0x28')][_0xa2f3('0x3d')](_0x5b868c);})['then'](function(_0x3c5b86){_0x52f211[_0xa2f3('0x3e')]=_0x3c5b86;return _0x52f211;})[_0xa2f3('0x23')](respondWithFilteredResult(_0x1ceea4,_0x5b868c))[_0xa2f3('0x3f')](handleError(_0x1ceea4,null));};exports['show']=function(_0x3d3458,_0x266a68){var _0x10e6e0={'raw':!![],'where':{'id':_0x3d3458[_0xa2f3('0x40')]['id']}},_0x2edc0b={};_0x2edc0b[_0xa2f3('0x2c')]=_[_0xa2f3('0x2f')](db[_0xa2f3('0x28')][_0xa2f3('0x29')]);_0x2edc0b[_0xa2f3('0x2e')]=_[_0xa2f3('0x2f')](_0x3d3458[_0xa2f3('0x2e')]);_0x2edc0b['filters']=_[_0xa2f3('0x31')](_0x2edc0b['model'],_0x2edc0b[_0xa2f3('0x2e')]);_0x10e6e0[_0xa2f3('0x32')]=_[_0xa2f3('0x31')](_0x2edc0b[_0xa2f3('0x2c')],qs['fields'](_0x3d3458[_0xa2f3('0x2e')][_0xa2f3('0x33')]));_0x10e6e0['attributes']=_0x10e6e0['attributes'][_0xa2f3('0x41')]?_0x10e6e0[_0xa2f3('0x32')]:_0x2edc0b[_0xa2f3('0x2c')];if(_0x3d3458[_0xa2f3('0x2e')][_0xa2f3('0x3c')]){_0x10e6e0['include']=[{'all':!![]}];}_0x10e6e0=_['merge']({},_0x10e6e0,_0x3d3458['options']);return db[_0xa2f3('0x28')][_0xa2f3('0x42')](_0x10e6e0)[_0xa2f3('0x23')](handleEntityNotFound(_0x266a68,null))[_0xa2f3('0x23')](respondWithResult(_0x266a68,null))['catch'](handleError(_0x266a68,null));};exports[_0xa2f3('0x43')]=function(_0x4d5ed0,_0x2c275a){return db[_0xa2f3('0x28')]['create'](_0x4d5ed0['body'],{})[_0xa2f3('0x23')](respondWithResult(_0x2c275a,0xc9))[_0xa2f3('0x3f')](handleError(_0x2c275a,null));};exports[_0xa2f3('0x22')]=function(_0x5b8403,_0xe2ad3){if(_0x5b8403['body']['id']){delete _0x5b8403[_0xa2f3('0x44')]['id'];}return db['FreshdeskField'][_0xa2f3('0x42')]({'where':{'id':_0x5b8403[_0xa2f3('0x40')]['id']}})[_0xa2f3('0x23')](handleEntityNotFound(_0xe2ad3,null))[_0xa2f3('0x23')](saveUpdates(_0x5b8403[_0xa2f3('0x44')],null))[_0xa2f3('0x23')](respondWithResult(_0xe2ad3,null))[_0xa2f3('0x3f')](handleError(_0xe2ad3,null));};exports['destroy']=function(_0x5c634c,_0x11b2e4){return db[_0xa2f3('0x28')][_0xa2f3('0x42')]({'where':{'id':_0x5c634c[_0xa2f3('0x40')]['id']}})[_0xa2f3('0x23')](handleEntityNotFound(_0x11b2e4,null))[_0xa2f3('0x23')](removeEntity(_0x11b2e4,null))['catch'](handleError(_0x11b2e4,null));};
\ No newline at end of file
+var _0xaaa2=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','FreshdeskField','type','key'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xaaa2,0xac));var _0x2aaa=function(_0x308c5e,_0x5a0cd2){_0x308c5e=_0x308c5e-0x0;var _0x5e1c20=_0xaaa2[_0x308c5e];return _0x5e1c20;};'use strict';var emlformat=require(_0x2aaa('0x0'));var rimraf=require(_0x2aaa('0x1'));var zipdir=require(_0x2aaa('0x2'));var jsonpatch=require(_0x2aaa('0x3'));var rp=require(_0x2aaa('0x4'));var moment=require(_0x2aaa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2aaa('0x6'));var util=require('util');var path=require(_0x2aaa('0x7'));var sox=require(_0x2aaa('0x8'));var csv=require(_0x2aaa('0x9'));var ejs=require(_0x2aaa('0xa'));var fs=require('fs');var fs_extra=require(_0x2aaa('0xb'));var _=require(_0x2aaa('0xc'));var squel=require('squel');var crypto=require(_0x2aaa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2aaa('0x9'));var querystring=require('querystring');var Papa=require(_0x2aaa('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2aaa('0xf'));var as=require(_0x2aaa('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2aaa('0x11'))(_0x2aaa('0x12'));var utils=require(_0x2aaa('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2aaa('0x14'));var db=require(_0x2aaa('0x15'))['db'];function respondWithStatusCode(_0x8a5be3,_0x2b51f0){_0x2b51f0=_0x2b51f0||0xcc;return function(_0xd38d6d){if(_0xd38d6d){return _0x8a5be3[_0x2aaa('0x16')](_0x2b51f0);}return _0x8a5be3[_0x2aaa('0x17')](_0x2b51f0)[_0x2aaa('0x18')]();};}function respondWithResult(_0x32dfbf,_0xe22151){_0xe22151=_0xe22151||0xc8;return function(_0x314366){if(_0x314366){return _0x32dfbf[_0x2aaa('0x17')](_0xe22151)['json'](_0x314366);}};}function respondWithFilteredResult(_0x166321,_0x4df56b){return function(_0x35fbc1){if(_0x35fbc1){var _0x1a5573=typeof _0x4df56b['offset']==='undefined'&&typeof _0x4df56b['limit']===_0x2aaa('0x19');var _0x1dc0ba=_0x35fbc1[_0x2aaa('0x1a')];var _0x3b94bf=_0x1a5573?0x0:_0x4df56b[_0x2aaa('0x1b')];var _0xdaa445=_0x1a5573?_0x35fbc1[_0x2aaa('0x1a')]:_0x4df56b['offset']+_0x4df56b[_0x2aaa('0x1c')];var _0x30951c;if(_0xdaa445>=_0x1dc0ba){_0xdaa445=_0x1dc0ba;_0x30951c=0xc8;}else{_0x30951c=0xce;}_0x166321['status'](_0x30951c);return _0x166321[_0x2aaa('0x1d')]('Content-Range',_0x3b94bf+'-'+_0xdaa445+'/'+_0x1dc0ba)['json'](_0x35fbc1);}return null;};}function patchUpdates(_0x1ec32e){return function(_0x5052eb){try{jsonpatch[_0x2aaa('0x1e')](_0x5052eb,_0x1ec32e,!![]);}catch(_0x3e7649){return BPromise[_0x2aaa('0x1f')](_0x3e7649);}return _0x5052eb[_0x2aaa('0x20')]();};}function saveUpdates(_0x2c255f,_0x24da1e){return function(_0x4f581f){if(_0x4f581f){return _0x4f581f[_0x2aaa('0x21')](_0x2c255f)[_0x2aaa('0x22')](function(_0x4836b2){return _0x4836b2;});}return null;};}function removeEntity(_0x4d35aa,_0x19153e){return function(_0x4d7151){if(_0x4d7151){return _0x4d7151[_0x2aaa('0x23')]()[_0x2aaa('0x22')](function(){_0x4d35aa['status'](0xcc)[_0x2aaa('0x18')]();});}};}function handleEntityNotFound(_0x3b99d8,_0x4e1c0f){return function(_0x2ab888){if(!_0x2ab888){_0x3b99d8[_0x2aaa('0x16')](0x194);}return _0x2ab888;};}function handleError(_0x41253c,_0x5371cd){_0x5371cd=_0x5371cd||0x1f4;return function(_0x1f626b){logger[_0x2aaa('0x24')](_0x1f626b['stack']);if(_0x1f626b['name']){delete _0x1f626b[_0x2aaa('0x25')];}_0x41253c[_0x2aaa('0x17')](_0x5371cd)[_0x2aaa('0x26')](_0x1f626b);};}exports[_0x2aaa('0x27')]=function(_0x3a6a63,_0x292297){var _0x2f8305={},_0x166dc0={},_0x12cd47={'count':0x0,'rows':[]};var _0x19472b=_[_0x2aaa('0x28')](db[_0x2aaa('0x29')]['rawAttributes'],function(_0x101b6e){return{'name':_0x101b6e['fieldName'],'type':_0x101b6e[_0x2aaa('0x2a')][_0x2aaa('0x2b')]};});_0x166dc0[_0x2aaa('0x2c')]=_[_0x2aaa('0x28')](_0x19472b,_0x2aaa('0x25'));_0x166dc0[_0x2aaa('0x2d')]=_[_0x2aaa('0x2e')](_0x3a6a63[_0x2aaa('0x2d')]);_0x166dc0[_0x2aaa('0x2f')]=_[_0x2aaa('0x30')](_0x166dc0['model'],_0x166dc0['query']);_0x2f8305['attributes']=_['intersection'](_0x166dc0['model'],qs[_0x2aaa('0x31')](_0x3a6a63[_0x2aaa('0x2d')][_0x2aaa('0x31')]));_0x2f8305[_0x2aaa('0x32')]=_0x2f8305[_0x2aaa('0x32')][_0x2aaa('0x33')]?_0x2f8305[_0x2aaa('0x32')]:_0x166dc0[_0x2aaa('0x2c')];if(!_0x3a6a63['query'][_0x2aaa('0x34')](_0x2aaa('0x35'))){_0x2f8305['limit']=qs[_0x2aaa('0x1c')](_0x3a6a63[_0x2aaa('0x2d')]['limit']);_0x2f8305[_0x2aaa('0x1b')]=qs[_0x2aaa('0x1b')](_0x3a6a63[_0x2aaa('0x2d')][_0x2aaa('0x1b')]);}_0x2f8305[_0x2aaa('0x36')]=qs[_0x2aaa('0x37')](_0x3a6a63[_0x2aaa('0x2d')]['sort']);_0x2f8305['where']=qs[_0x2aaa('0x2f')](_['pick'](_0x3a6a63[_0x2aaa('0x2d')],_0x166dc0[_0x2aaa('0x2f')]),_0x19472b);if(_0x3a6a63['query'][_0x2aaa('0x38')]){_0x2f8305[_0x2aaa('0x39')]=_[_0x2aaa('0x3a')](_0x2f8305['where'],{'$or':_[_0x2aaa('0x28')](_0x19472b,function(_0x337ae8){if(_0x337ae8[_0x2aaa('0x2a')]!==_0x2aaa('0x3b')){var _0x5023d2={};_0x5023d2[_0x337ae8[_0x2aaa('0x25')]]={'$like':'%'+_0x3a6a63[_0x2aaa('0x2d')][_0x2aaa('0x38')]+'%'};return _0x5023d2;}})});}_0x2f8305=_[_0x2aaa('0x3a')]({},_0x2f8305,_0x3a6a63[_0x2aaa('0x3c')]);var _0x362060={'where':_0x2f8305[_0x2aaa('0x39')]};return db[_0x2aaa('0x29')][_0x2aaa('0x1a')](_0x362060)[_0x2aaa('0x22')](function(_0x127f7e){_0x12cd47[_0x2aaa('0x1a')]=_0x127f7e;if(_0x3a6a63[_0x2aaa('0x2d')]['includeAll']){_0x2f8305[_0x2aaa('0x3d')]=[{'all':!![]}];}return db[_0x2aaa('0x29')][_0x2aaa('0x3e')](_0x2f8305);})['then'](function(_0x17042f){_0x12cd47[_0x2aaa('0x3f')]=_0x17042f;return _0x12cd47;})[_0x2aaa('0x22')](respondWithFilteredResult(_0x292297,_0x2f8305))['catch'](handleError(_0x292297,null));};exports[_0x2aaa('0x40')]=function(_0x1bb225,_0x25b932){var _0x4ad537={'raw':!![],'where':{'id':_0x1bb225[_0x2aaa('0x41')]['id']}},_0x57554e={};_0x57554e[_0x2aaa('0x2c')]=_[_0x2aaa('0x2e')](db['FreshdeskField'][_0x2aaa('0x42')]);_0x57554e[_0x2aaa('0x2d')]=_[_0x2aaa('0x2e')](_0x1bb225[_0x2aaa('0x2d')]);_0x57554e[_0x2aaa('0x2f')]=_[_0x2aaa('0x30')](_0x57554e[_0x2aaa('0x2c')],_0x57554e[_0x2aaa('0x2d')]);_0x4ad537['attributes']=_['intersection'](_0x57554e[_0x2aaa('0x2c')],qs['fields'](_0x1bb225[_0x2aaa('0x2d')]['fields']));_0x4ad537['attributes']=_0x4ad537['attributes'][_0x2aaa('0x33')]?_0x4ad537[_0x2aaa('0x32')]:_0x57554e['model'];if(_0x1bb225[_0x2aaa('0x2d')][_0x2aaa('0x43')]){_0x4ad537['include']=[{'all':!![]}];}_0x4ad537=_[_0x2aaa('0x3a')]({},_0x4ad537,_0x1bb225['options']);return db[_0x2aaa('0x29')][_0x2aaa('0x44')](_0x4ad537)['then'](handleEntityNotFound(_0x25b932,null))[_0x2aaa('0x22')](respondWithResult(_0x25b932,null))[_0x2aaa('0x45')](handleError(_0x25b932,null));};exports[_0x2aaa('0x46')]=function(_0x367a63,_0x745414){return db['FreshdeskField']['create'](_0x367a63['body'],{})[_0x2aaa('0x22')](respondWithResult(_0x745414,0xc9))[_0x2aaa('0x45')](handleError(_0x745414,null));};exports[_0x2aaa('0x21')]=function(_0x393073,_0x23290d){if(_0x393073[_0x2aaa('0x47')]['id']){delete _0x393073[_0x2aaa('0x47')]['id'];}return db[_0x2aaa('0x29')][_0x2aaa('0x44')]({'where':{'id':_0x393073['params']['id']}})[_0x2aaa('0x22')](handleEntityNotFound(_0x23290d,null))[_0x2aaa('0x22')](saveUpdates(_0x393073[_0x2aaa('0x47')],null))[_0x2aaa('0x22')](respondWithResult(_0x23290d,null))['catch'](handleError(_0x23290d,null));};exports[_0x2aaa('0x23')]=function(_0xe935c3,_0x3906f8){return db['FreshdeskField']['find']({'where':{'id':_0xe935c3[_0x2aaa('0x41')]['id']}})[_0x2aaa('0x22')](handleEntityNotFound(_0x3906f8,null))[_0x2aaa('0x22')](removeEntity(_0x3906f8,null))[_0x2aaa('0x45')](handleError(_0x3906f8,null));};
\ No newline at end of file
index dcaea1a..7ae56e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd334=['./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x288325,_0x26e4ff){var _0x3b9fd7=function(_0x1f2816){while(--_0x1f2816){_0x288325['push'](_0x288325['shift']());}};_0x3b9fd7(++_0x26e4ff);}(_0xd334,0xf6));var _0x4d33=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xd334[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x4d33('0x0'));var util=require(_0x4d33('0x1'));var logger=require(_0x4d33('0x2'))(_0x4d33('0x3'));var moment=require('moment');var BPromise=require(_0x4d33('0x4'));var rp=require(_0x4d33('0x5'));var fs=require('fs');var path=require(_0x4d33('0x6'));var rimraf=require(_0x4d33('0x7'));var config=require(_0x4d33('0x8'));var attributes=require(_0x4d33('0x9'));module[_0x4d33('0xa')]=function(_0x2128f6,_0x29b465){return _0x2128f6[_0x4d33('0xb')](_0x4d33('0xc'),attributes,{'tableName':_0x4d33('0xd'),'paranoid':![],'indexes':[{'name':_0x4d33('0xe'),'fields':[_0x4d33('0xf'),_0x4d33('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x686d=['api','moment','rimraf','../../config/environment','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util'];(function(_0x546d05,_0x351eac){var _0x2e26b4=function(_0x3835e1){while(--_0x3835e1){_0x546d05['push'](_0x546d05['shift']());}};_0x2e26b4(++_0x351eac);}(_0x686d,0x172));var _0xd686=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x686d[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0xd686('0x0'));var util=require(_0xd686('0x1'));var logger=require('../../config/logger')(_0xd686('0x2'));var moment=require(_0xd686('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd686('0x4'));var config=require(_0xd686('0x5'));var attributes=require('./intFreshdeskField.attributes');module[_0xd686('0x6')]=function(_0x5cc0b3,_0x144020){return _0x5cc0b3[_0xd686('0x7')](_0xd686('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xd686('0x9'),'fields':[_0xd686('0xa'),_0xd686('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7863ac7..84dfa23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c0d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x44d9e8,_0x2f0bc2){var _0x64816e=function(_0x3e9a6d){while(--_0x3e9a6d){_0x44d9e8['push'](_0x44d9e8['shift']());}};_0x64816e(++_0x2f0bc2);}(_0x3c0d,0x10b));var _0xd3c0=function(_0x22ba54,_0x3c105b){_0x22ba54=_0x22ba54-0x0;var _0x17af5b=_0x3c0d[_0x22ba54];return _0x17af5b;};'use strict';var _=require(_0xd3c0('0x0'));var util=require(_0xd3c0('0x1'));var moment=require(_0xd3c0('0x2'));var BPromise=require(_0xd3c0('0x3'));var rs=require(_0xd3c0('0x4'));var fs=require('fs');var Redis=require(_0xd3c0('0x5'));var db=require(_0xd3c0('0x6'))['db'];var utils=require(_0xd3c0('0x7'));var logger=require(_0xd3c0('0x8'))(_0xd3c0('0x9'));var config=require(_0xd3c0('0xa'));var jayson=require(_0xd3c0('0xb'));var client=jayson[_0xd3c0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x279f84,_0x419e33,_0x311c22){return new BPromise(function(_0x9fad7b,_0x2e0d13){return client[_0xd3c0('0xd')](_0x279f84,_0x311c22)[_0xd3c0('0xe')](function(_0x28f93a){logger[_0xd3c0('0xf')](_0xd3c0('0x10'),_0x419e33,'request\x20sent');logger[_0xd3c0('0x11')](_0xd3c0('0x12'),_0x419e33,_0xd3c0('0x13'),JSON[_0xd3c0('0x14')](_0x28f93a));if(_0x28f93a['error']){if(_0x28f93a[_0xd3c0('0x15')][_0xd3c0('0x16')]===0x1f4){logger[_0xd3c0('0x15')](_0xd3c0('0x10'),_0x419e33,_0x28f93a[_0xd3c0('0x15')]['message']);return _0x2e0d13(_0x28f93a[_0xd3c0('0x15')][_0xd3c0('0x17')]);}logger[_0xd3c0('0x15')]('FreshdeskField,\x20%s,\x20%s',_0x419e33,_0x28f93a[_0xd3c0('0x15')]['message']);return _0x9fad7b(_0x28f93a[_0xd3c0('0x15')][_0xd3c0('0x17')]);}else{logger[_0xd3c0('0xf')](_0xd3c0('0x10'),_0x419e33,'request\x20sent');_0x9fad7b(_0x28f93a[_0xd3c0('0x18')][_0xd3c0('0x17')]);}})['catch'](function(_0x1c5b3d){logger[_0xd3c0('0x15')](_0xd3c0('0x10'),_0x419e33,_0x1c5b3d);_0x2e0d13(_0x1c5b3d);});});}
\ No newline at end of file
+var _0x767e=['request\x20sent','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../config/utils','../../config/logger','jayson/promise','client','then','info','debug','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x4d561b,_0x146139){var _0x55f941=function(_0x49190b){while(--_0x49190b){_0x4d561b['push'](_0x4d561b['shift']());}};_0x55f941(++_0x146139);}(_0x767e,0x1dc));var _0xe767=function(_0x302ed4,_0x2f8a09){_0x302ed4=_0x302ed4-0x0;var _0x306f14=_0x767e[_0x302ed4];return _0x306f14;};'use strict';var _=require(_0xe767('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe767('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe767('0x2'));var logger=require(_0xe767('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe767('0x4'));var client=jayson[_0xe767('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x453a42,_0x3cfbbd,_0x5c9284){return new BPromise(function(_0x785e98,_0x48c994){return client['request'](_0x453a42,_0x5c9284)[_0xe767('0x6')](function(_0x563382){logger[_0xe767('0x7')]('FreshdeskField,\x20%s,\x20%s',_0x3cfbbd,'request\x20sent');logger[_0xe767('0x8')](_0xe767('0x9'),_0x3cfbbd,_0xe767('0xa'),JSON[_0xe767('0xb')](_0x563382));if(_0x563382[_0xe767('0xc')]){if(_0x563382[_0xe767('0xc')][_0xe767('0xd')]===0x1f4){logger['error'](_0xe767('0xe'),_0x3cfbbd,_0x563382['error']['message']);return _0x48c994(_0x563382[_0xe767('0xc')][_0xe767('0xf')]);}logger[_0xe767('0xc')](_0xe767('0xe'),_0x3cfbbd,_0x563382[_0xe767('0xc')][_0xe767('0xf')]);return _0x785e98(_0x563382['error'][_0xe767('0xf')]);}else{logger[_0xe767('0x7')]('FreshdeskField,\x20%s,\x20%s',_0x3cfbbd,_0xe767('0xa'));_0x785e98(_0x563382[_0xe767('0x10')][_0xe767('0xf')]);}})[_0xe767('0x11')](function(_0x3fdbf1){logger['error'](_0xe767('0xe'),_0x3cfbbd,_0x3fdbf1);_0x48c994(_0x3fdbf1);});});}
\ No newline at end of file
index 234db36..015e010 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97c1=['delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','index','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var path=require('path');var timeout=require(_0x197c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x197c('0x3'));var auth=require(_0x197c('0x4'));var interaction=require(_0x197c('0x5'));var config=require(_0x197c('0x6'));var controller=require(_0x197c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x197c('0x8')]);router[_0x197c('0x9')](_0x197c('0xa'),auth[_0x197c('0xb')](),controller['show']);router['get'](_0x197c('0xc'),auth['isAuthenticated'](),controller[_0x197c('0xd')]);router[_0x197c('0x9')](_0x197c('0xe'),auth[_0x197c('0xb')](),controller['getFields']);router[_0x197c('0xf')]('/',auth[_0x197c('0xb')](),controller[_0x197c('0x10')]);router[_0x197c('0xf')](_0x197c('0xc'),auth['isAuthenticated'](),controller[_0x197c('0x11')]);router[_0x197c('0x12')](_0x197c('0xa'),auth[_0x197c('0xb')](),controller['update']);router[_0x197c('0x13')](_0x197c('0xa'),auth[_0x197c('0xb')](),controller[_0x197c('0x14')]);module[_0x197c('0x15')]=router;
\ No newline at end of file
+var _0x4cf8=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','create','addConfiguration'];(function(_0x352937,_0x50888c){var _0x13e59f=function(_0x47cf55){while(--_0x47cf55){_0x352937['push'](_0x352937['shift']());}};_0x13e59f(++_0x50888c);}(_0x4cf8,0x1e1));var _0x84cf=function(_0xfcfc24,_0x48ca53){_0xfcfc24=_0xfcfc24-0x0;var _0x58f773=_0x4cf8[_0xfcfc24];return _0x58f773;};'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['get'](_0x84cf('0xe'),auth[_0x84cf('0xc')](),controller['getConfigurations']);router[_0x84cf('0xb')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0x11')]);router['post']('/:id/configurations',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')](_0x84cf('0x14'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x15')]);router[_0x84cf('0x16')](_0x84cf('0x14'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x17')]);module[_0x84cf('0x18')]=router;
\ No newline at end of file
index a00c5a4..6149ae4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e3f=['STRING','username','remoteUri','sequelize','exports'];(function(_0xc82e5a,_0x44ee4a){var _0x2d23ad=function(_0x291720){while(--_0x291720){_0xc82e5a['push'](_0xc82e5a['shift']());}};_0x2d23ad(++_0x44ee4a);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xf8e3('0x0'));module[_0xf8e3('0x1')]={'name':{'type':Sequelize[_0xf8e3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf8e3('0x2')],'unique':_0xf8e3('0x3')},'apiKey':{'type':Sequelize[_0xf8e3('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xf8e3('0x4')},'serverUrl':{'type':Sequelize[_0xf8e3('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xda2d=['exports','STRING','username'];(function(_0x19ee4c,_0x32ed1c){var _0xb2fe43=function(_0x515544){while(--_0x515544){_0x19ee4c['push'](_0x19ee4c['shift']());}};_0xb2fe43(++_0x32ed1c);}(_0xda2d,0x102));var _0xdda2=function(_0x2e49d8,_0x1e6823){_0x2e49d8=_0x2e49d8-0x0;var _0x31168c=_0xda2d[_0x2e49d8];return _0x31168c;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')]},'description':{'type':Sequelize[_0xdda2('0x1')]},'username':{'type':Sequelize[_0xdda2('0x1')],'unique':_0xdda2('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xdda2('0x1')],'allowNull':![]}};
\ No newline at end of file
index 3de969b..36ace77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a2=['params','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','email','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','find','create','body'];(function(_0xc48082,_0x4288b1){var _0x8199d1=function(_0x46e0f0){while(--_0x46e0f0){_0xc48082['push'](_0xc48082['shift']());}};_0x8199d1(++_0x4288b1);}(_0x73a2,0x87));var _0x273a=function(_0x23d973,_0x20c6b7){_0x23d973=_0x23d973-0x0;var _0x27188d=_0x73a2[_0x23d973];return _0x27188d;};'use strict';var emlformat=require(_0x273a('0x0'));var rimraf=require(_0x273a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x273a('0x2'));var rp=require('request-promise');var moment=require(_0x273a('0x3'));var BPromise=require(_0x273a('0x4'));var Mustache=require('mustache');var util=require(_0x273a('0x5'));var path=require(_0x273a('0x6'));var sox=require(_0x273a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x273a('0x8'));var _=require(_0x273a('0x9'));var squel=require(_0x273a('0xa'));var crypto=require('crypto');var jsforce=require(_0x273a('0xb'));var deskjs=require(_0x273a('0xc'));var toCsv=require(_0x273a('0xd'));var querystring=require(_0x273a('0xe'));var Papa=require(_0x273a('0xf'));var Redis=require(_0x273a('0x10'));var authService=require(_0x273a('0x11'));var qs=require(_0x273a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x273a('0x13'));var logger=require(_0x273a('0x14'))(_0x273a('0x15'));var utils=require(_0x273a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x273a('0x17'));var db=require(_0x273a('0x18'))['db'];var integrations=require(_0x273a('0x19'));function respondWithStatusCode(_0x2a2870,_0xedbce9){_0xedbce9=_0xedbce9||0xcc;return function(_0x4beb4e){if(_0x4beb4e){return _0x2a2870['sendStatus'](_0xedbce9);}return _0x2a2870[_0x273a('0x1a')](_0xedbce9)[_0x273a('0x1b')]();};}function respondWithResult(_0x1cbda6,_0x442c0b){_0x442c0b=_0x442c0b||0xc8;return function(_0x3ed0d7){if(_0x3ed0d7){return _0x1cbda6[_0x273a('0x1a')](_0x442c0b)[_0x273a('0x1c')](_0x3ed0d7);}};}function respondWithFilteredResult(_0x3b93b6,_0x2df476){return function(_0x5f0a7a){if(_0x5f0a7a){var _0x1b1972=typeof _0x2df476[_0x273a('0x1d')]===_0x273a('0x1e')&&typeof _0x2df476[_0x273a('0x1f')]===_0x273a('0x1e');var _0x5b99fb=_0x5f0a7a[_0x273a('0x20')];var _0xaa57ce=_0x1b1972?0x0:_0x2df476[_0x273a('0x1d')];var _0x5be8d1=_0x1b1972?_0x5f0a7a[_0x273a('0x20')]:_0x2df476[_0x273a('0x1d')]+_0x2df476[_0x273a('0x1f')];var _0x569a20;if(_0x5be8d1>=_0x5b99fb){_0x5be8d1=_0x5b99fb;_0x569a20=0xc8;}else{_0x569a20=0xce;}_0x3b93b6['status'](_0x569a20);return _0x3b93b6[_0x273a('0x21')](_0x273a('0x22'),_0xaa57ce+'-'+_0x5be8d1+'/'+_0x5b99fb)[_0x273a('0x1c')](_0x5f0a7a);}return null;};}function patchUpdates(_0x576fda){return function(_0x4fe137){try{jsonpatch[_0x273a('0x23')](_0x4fe137,_0x576fda,!![]);}catch(_0xc848ea){return BPromise[_0x273a('0x24')](_0xc848ea);}return _0x4fe137[_0x273a('0x25')]();};}function saveUpdates(_0x55b50f,_0x3134ae){return function(_0x44582b){if(_0x44582b){return _0x44582b[_0x273a('0x26')](_0x55b50f)['then'](function(_0xda6f84){return _0xda6f84;});}return null;};}function removeEntity(_0x1442c0,_0x3ef9b5){return function(_0x5bd169){if(_0x5bd169){return _0x5bd169[_0x273a('0x27')]()['then'](function(){_0x1442c0[_0x273a('0x1a')](0xcc)[_0x273a('0x1b')]();});}};}function handleEntityNotFound(_0x2a2548,_0x2a6724){return function(_0x5b2c05){if(!_0x5b2c05){_0x2a2548['sendStatus'](0x194);}return _0x5b2c05;};}function handleError(_0xc1af3d,_0x27ce79){_0x27ce79=_0x27ce79||0x1f4;return function(_0x5eba1c){logger[_0x273a('0x28')](_0x5eba1c[_0x273a('0x29')]);if(_0x5eba1c['name']){delete _0x5eba1c[_0x273a('0x2a')];}_0xc1af3d[_0x273a('0x1a')](_0x27ce79)[_0x273a('0x2b')](_0x5eba1c);};}exports[_0x273a('0x2c')]=function(_0x390c9c,_0x47453b){var _0x12b8b0={},_0x3a0272={},_0x4cc963={'count':0x0,'rows':[]};var _0x594538=_[_0x273a('0x2d')](db[_0x273a('0x2e')][_0x273a('0x2f')],function(_0x2e2be6){return{'name':_0x2e2be6[_0x273a('0x30')],'type':_0x2e2be6[_0x273a('0x31')][_0x273a('0x32')]};});_0x3a0272[_0x273a('0x33')]=_[_0x273a('0x2d')](_0x594538,_0x273a('0x2a'));_0x3a0272['query']=_[_0x273a('0x34')](_0x390c9c[_0x273a('0x35')]);_0x3a0272[_0x273a('0x36')]=_[_0x273a('0x37')](_0x3a0272['model'],_0x3a0272[_0x273a('0x35')]);_0x12b8b0[_0x273a('0x38')]=_[_0x273a('0x37')](_0x3a0272['model'],qs['fields'](_0x390c9c[_0x273a('0x35')][_0x273a('0x39')]));_0x12b8b0[_0x273a('0x38')]=_0x12b8b0[_0x273a('0x38')][_0x273a('0x3a')]?_0x12b8b0[_0x273a('0x38')]:_0x3a0272[_0x273a('0x33')];if(!_0x390c9c[_0x273a('0x35')][_0x273a('0x3b')](_0x273a('0x3c'))){_0x12b8b0[_0x273a('0x1f')]=qs[_0x273a('0x1f')](_0x390c9c['query'][_0x273a('0x1f')]);_0x12b8b0[_0x273a('0x1d')]=qs[_0x273a('0x1d')](_0x390c9c[_0x273a('0x35')]['offset']);}_0x12b8b0[_0x273a('0x3d')]=qs['sort'](_0x390c9c['query'][_0x273a('0x3e')]);_0x12b8b0[_0x273a('0x3f')]=qs[_0x273a('0x36')](_[_0x273a('0x40')](_0x390c9c[_0x273a('0x35')],_0x3a0272[_0x273a('0x36')]),_0x594538);if(_0x390c9c[_0x273a('0x35')][_0x273a('0x41')]){_0x12b8b0[_0x273a('0x3f')]=_[_0x273a('0x42')](_0x12b8b0['where'],{'$or':_[_0x273a('0x2d')](_0x594538,function(_0x4c6dbd){if(_0x4c6dbd[_0x273a('0x31')]!==_0x273a('0x43')){var _0x35cf2c={};_0x35cf2c[_0x4c6dbd[_0x273a('0x2a')]]={'$like':'%'+_0x390c9c['query'][_0x273a('0x41')]+'%'};return _0x35cf2c;}})});}_0x12b8b0=_[_0x273a('0x42')]({},_0x12b8b0,_0x390c9c[_0x273a('0x44')]);var _0x2b53f6={'where':_0x12b8b0[_0x273a('0x3f')]};return db[_0x273a('0x2e')][_0x273a('0x20')](_0x2b53f6)['then'](function(_0x37ac8f){_0x4cc963[_0x273a('0x20')]=_0x37ac8f;if(_0x390c9c[_0x273a('0x35')][_0x273a('0x45')]){_0x12b8b0[_0x273a('0x46')]=[{'all':!![]}];}return db[_0x273a('0x2e')][_0x273a('0x47')](_0x12b8b0);})[_0x273a('0x48')](function(_0xf39d04){_0x4cc963[_0x273a('0x49')]=_0xf39d04;return _0x4cc963;})[_0x273a('0x48')](respondWithFilteredResult(_0x47453b,_0x12b8b0))[_0x273a('0x4a')](handleError(_0x47453b,null));};exports[_0x273a('0x4b')]=function(_0x14c887,_0xc414f8){var _0x54d271={'raw':![],'where':{'id':_0x14c887['params']['id']}},_0x4cc0f3={};_0x4cc0f3[_0x273a('0x33')]=_[_0x273a('0x34')](db[_0x273a('0x2e')][_0x273a('0x2f')]);_0x4cc0f3[_0x273a('0x35')]=_[_0x273a('0x34')](_0x14c887['query']);_0x4cc0f3[_0x273a('0x36')]=_['intersection'](_0x4cc0f3[_0x273a('0x33')],_0x4cc0f3[_0x273a('0x35')]);_0x54d271[_0x273a('0x38')]=_[_0x273a('0x37')](_0x4cc0f3[_0x273a('0x33')],qs['fields'](_0x14c887['query'][_0x273a('0x39')]));_0x54d271[_0x273a('0x38')]=_0x54d271[_0x273a('0x38')][_0x273a('0x3a')]?_0x54d271[_0x273a('0x38')]:_0x4cc0f3[_0x273a('0x33')];if(_0x14c887[_0x273a('0x35')][_0x273a('0x45')]){_0x54d271[_0x273a('0x46')]=[{'all':!![]}];}_0x54d271=_[_0x273a('0x42')]({},_0x54d271,_0x14c887[_0x273a('0x44')]);return db[_0x273a('0x2e')][_0x273a('0x4c')](_0x54d271)[_0x273a('0x48')](handleEntityNotFound(_0xc414f8,null))[_0x273a('0x48')](respondWithResult(_0xc414f8,null))['catch'](handleError(_0xc414f8,null));};exports[_0x273a('0x4d')]=function(_0x2041cc,_0x369ff7){return db[_0x273a('0x2e')][_0x273a('0x4d')](_0x2041cc[_0x273a('0x4e')],{})[_0x273a('0x48')](respondWithResult(_0x369ff7,0xc9))['catch'](handleError(_0x369ff7,null));};exports[_0x273a('0x26')]=function(_0x1ef9d6,_0x47ef3b){if(_0x1ef9d6[_0x273a('0x4e')]['id']){delete _0x1ef9d6[_0x273a('0x4e')]['id'];}return db[_0x273a('0x2e')][_0x273a('0x4c')]({'where':{'id':_0x1ef9d6[_0x273a('0x4f')]['id']}})[_0x273a('0x48')](handleEntityNotFound(_0x47ef3b,null))[_0x273a('0x48')](saveUpdates(_0x1ef9d6[_0x273a('0x4e')],null))[_0x273a('0x48')](respondWithResult(_0x47ef3b,null))[_0x273a('0x4a')](handleError(_0x47ef3b,null));};exports[_0x273a('0x27')]=function(_0x3e7761,_0x2c5dd5){return db[_0x273a('0x2e')][_0x273a('0x4c')]({'where':{'id':_0x3e7761[_0x273a('0x4f')]['id']}})[_0x273a('0x48')](handleEntityNotFound(_0x2c5dd5,null))[_0x273a('0x48')](removeEntity(_0x2c5dd5,null))[_0x273a('0x4a')](handleError(_0x2c5dd5,null));};exports[_0x273a('0x50')]=function(_0x2c414a,_0x5786be,_0x305575){var _0x3a4460={};var _0x56e05b={};var _0x20d8f4;var _0x3631d4;return db['FreshsalesAccount'][_0x273a('0x51')]({'where':{'id':_0x2c414a[_0x273a('0x4f')]['id']}})[_0x273a('0x48')](handleEntityNotFound(_0x5786be,null))[_0x273a('0x48')](function(_0x247d29){if(_0x247d29){_0x20d8f4=_0x247d29;_0x56e05b[_0x273a('0x33')]=_[_0x273a('0x34')](db[_0x273a('0x52')][_0x273a('0x2f')]);_0x56e05b[_0x273a('0x35')]=_[_0x273a('0x34')](_0x2c414a['query']);_0x56e05b[_0x273a('0x36')]=_[_0x273a('0x37')](_0x56e05b[_0x273a('0x33')],_0x56e05b[_0x273a('0x35')]);_0x3a4460['attributes']=_[_0x273a('0x37')](_0x56e05b[_0x273a('0x33')],qs[_0x273a('0x39')](_0x2c414a['query'][_0x273a('0x39')]));_0x3a4460[_0x273a('0x38')]=_0x3a4460[_0x273a('0x38')]['length']?_0x3a4460[_0x273a('0x38')]:_0x56e05b[_0x273a('0x33')];_0x3a4460[_0x273a('0x3d')]=qs[_0x273a('0x3e')](_0x2c414a[_0x273a('0x35')]['sort']);_0x3a4460['where']=qs[_0x273a('0x36')](_[_0x273a('0x40')](_0x2c414a['query'],_0x56e05b[_0x273a('0x36')]));if(_0x2c414a[_0x273a('0x35')][_0x273a('0x41')]){_0x3a4460[_0x273a('0x3f')]=_['merge'](_0x3a4460[_0x273a('0x3f')],{'$or':_[_0x273a('0x2d')](_0x3a4460['attributes'],function(_0x2fb56d){var _0x4490a7={};_0x4490a7[_0x2fb56d]={'$like':'%'+_0x2c414a[_0x273a('0x35')]['filter']+'%'};return _0x4490a7;})});}_0x3a4460=_[_0x273a('0x42')]({},_0x3a4460,_0x2c414a[_0x273a('0x44')]);return _0x20d8f4['getConfigurations'](_0x3a4460);}})['then'](function(_0x2b145e){if(_0x2b145e){_0x3631d4=_0x2b145e[_0x273a('0x3a')];if(!_0x2c414a[_0x273a('0x35')][_0x273a('0x3b')]('nolimit')){_0x3a4460[_0x273a('0x1f')]=qs[_0x273a('0x1f')](_0x2c414a[_0x273a('0x35')][_0x273a('0x1f')]);_0x3a4460[_0x273a('0x1d')]=qs['offset'](_0x2c414a[_0x273a('0x35')]['offset']);}return _0x20d8f4[_0x273a('0x50')](_0x3a4460);}})[_0x273a('0x48')](function(_0x234489){if(_0x234489){return _0x234489?{'count':_0x3631d4,'rows':_0x234489}:null;}})[_0x273a('0x48')](respondWithResult(_0x5786be,null))[_0x273a('0x4a')](handleError(_0x5786be,null));};exports[_0x273a('0x53')]=function(_0x128572,_0x42f9af,_0x463b3c){if(_0x128572[_0x273a('0x4e')]['id']){delete _0x128572[_0x273a('0x4e')]['id'];}return db[_0x273a('0x2e')][_0x273a('0x51')]({'where':{'id':_0x128572['params']['id']}})['then'](handleEntityNotFound(_0x42f9af,null))[_0x273a('0x48')](function(_0x338167){if(_0x338167){_0x128572[_0x273a('0x4e')][_0x273a('0x54')]=_0x338167['id'];_0x128572[_0x273a('0x4e')][_0x273a('0x55')]=integrations[_0x273a('0x56')](_0x128572[_0x273a('0x4e')][_0x273a('0x57')],_0x128572['body'][_0x273a('0x31')]);_0x128572[_0x273a('0x4e')][_0x273a('0x58')]=integrations[_0x273a('0x59')](_0x128572[_0x273a('0x4e')]['channel'],_0x128572[_0x273a('0x4e')][_0x273a('0x31')]);return db[_0x273a('0x52')][_0x273a('0x4d')](_0x128572['body'],{'include':[{'model':db[_0x273a('0x5a')],'as':_0x273a('0x55')},{'model':db[_0x273a('0x5a')],'as':_0x273a('0x58')}]});}return null;})['then'](respondWithResult(_0x42f9af,null))[_0x273a('0x4a')](handleError(_0x42f9af,null));};exports[_0x273a('0x5b')]=function(_0x381592,_0x59af59,_0x52147e){var _0x354d84='';var _0x48675b='';return db[_0x273a('0x2e')]['findOne']({'where':{'id':_0x381592[_0x273a('0x4f')]['id']},'attributes':['id',_0x273a('0x5c'),_0x273a('0x5d'),_0x273a('0x5e')]})[_0x273a('0x48')](handleEntityNotFound(_0x59af59,null))[_0x273a('0x48')](function(_0x3450d1){if(_0x3450d1){_0x48675b=_0x3450d1[_0x273a('0x5c')];_0x354d84=_0x3450d1[_0x273a('0x5d')];var _0x24ccdd=_0x3450d1[_0x273a('0x5d')][_0x273a('0x5f')](-0x1);if(_0x24ccdd==='/'){_0x354d84=_0x354d84[_0x273a('0x60')](0x0,_0x354d84[_0x273a('0x61')](_0x24ccdd));}return rp({'method':_0x273a('0x62'),'uri':util[_0x273a('0x63')](_0x273a('0x64'),_0x354d84,_0x273a('0x65')),'headers':{'Authorization':'Token\x20token='+_0x3450d1[_0x273a('0x5e')]},'json':!![]});}})[_0x273a('0x48')](function(_0x541aea){if(_0x541aea){var _0x54e075=_0x541aea['users'];var _0x1262cf=![];var _0x512ef4=null;for(_0x512ef4=0x0;_0x512ef4<_0x54e075['length'];_0x512ef4++){if(_0x54e075[_0x512ef4][_0x273a('0x66')]===_0x48675b){_0x1262cf=!![];}}if(_0x1262cf){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x273a('0x48')](respondWithResult(_0x59af59,null))[_0x273a('0x4a')](function(_0x4ae3c7){var _0x45a2db=_0x381592[_0x273a('0x35')][_0x273a('0x67')]?0x1f4:_0x4ae3c7[_0x273a('0x68')]||0x1f4;logger[_0x273a('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x45a2db,JSON[_0x273a('0x69')](_0x4ae3c7));delete _0x4ae3c7[_0x273a('0x2a')];if(_0x45a2db===0x191){_0x45a2db=0x190;}_0x59af59[_0x273a('0x1a')](_0x45a2db)[_0x273a('0x2b')](_0x381592[_0x273a('0x35')][_0x273a('0x67')]?{'message':_0x273a('0x6a'),'statusCode':_0x4ae3c7[_0x273a('0x68')]}:_0x4ae3c7);});};
\ No newline at end of file
+var _0x7211=['apply','reject','save','update','then','error','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','count','limit','status'];(function(_0x22aaf9,_0x3b642a){var _0x322f1c=function(_0x2f0401){while(--_0x2f0401){_0x22aaf9['push'](_0x22aaf9['shift']());}};_0x322f1c(++_0x3b642a);}(_0x7211,0x10f));var _0x1721=function(_0x1706ac,_0x46a5e9){_0x1706ac=_0x1706ac-0x0;var _0x4aa8e7=_0x7211[_0x1706ac];return _0x4aa8e7;};'use strict';var emlformat=require(_0x1721('0x0'));var rimraf=require(_0x1721('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1721('0x2'));var rp=require(_0x1721('0x3'));var moment=require(_0x1721('0x4'));var BPromise=require(_0x1721('0x5'));var Mustache=require(_0x1721('0x6'));var util=require(_0x1721('0x7'));var path=require(_0x1721('0x8'));var sox=require(_0x1721('0x9'));var csv=require(_0x1721('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1721('0xb'));var _=require('lodash');var squel=require(_0x1721('0xc'));var crypto=require(_0x1721('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1721('0xe'));var toCsv=require(_0x1721('0xa'));var querystring=require(_0x1721('0xf'));var Papa=require('papaparse');var Redis=require(_0x1721('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1721('0x11'));var as=require(_0x1721('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1721('0x13'));var utils=require('../../config/utils');var config=require(_0x1721('0x14'));var licenseUtil=require(_0x1721('0x15'));var db=require(_0x1721('0x16'))['db'];var integrations=require(_0x1721('0x17'));function respondWithStatusCode(_0x5c4a5c,_0x403e9c){_0x403e9c=_0x403e9c||0xcc;return function(_0x1c3cd7){if(_0x1c3cd7){return _0x5c4a5c[_0x1721('0x18')](_0x403e9c);}return _0x5c4a5c['status'](_0x403e9c)[_0x1721('0x19')]();};}function respondWithResult(_0x4e23f1,_0x3e6616){_0x3e6616=_0x3e6616||0xc8;return function(_0x398f49){if(_0x398f49){return _0x4e23f1['status'](_0x3e6616)[_0x1721('0x1a')](_0x398f49);}};}function respondWithFilteredResult(_0x1b2448,_0xf21169){return function(_0x1008dc){if(_0x1008dc){var _0x3829d2=typeof _0xf21169[_0x1721('0x1b')]===_0x1721('0x1c')&&typeof _0xf21169['limit']===_0x1721('0x1c');var _0xf0f2d4=_0x1008dc[_0x1721('0x1d')];var _0xb54b80=_0x3829d2?0x0:_0xf21169[_0x1721('0x1b')];var _0xc7647a=_0x3829d2?_0x1008dc[_0x1721('0x1d')]:_0xf21169[_0x1721('0x1b')]+_0xf21169[_0x1721('0x1e')];var _0x4da3b2;if(_0xc7647a>=_0xf0f2d4){_0xc7647a=_0xf0f2d4;_0x4da3b2=0xc8;}else{_0x4da3b2=0xce;}_0x1b2448[_0x1721('0x1f')](_0x4da3b2);return _0x1b2448['set']('Content-Range',_0xb54b80+'-'+_0xc7647a+'/'+_0xf0f2d4)[_0x1721('0x1a')](_0x1008dc);}return null;};}function patchUpdates(_0x4eb319){return function(_0x45ff6c){try{jsonpatch[_0x1721('0x20')](_0x45ff6c,_0x4eb319,!![]);}catch(_0x1ac8a6){return BPromise[_0x1721('0x21')](_0x1ac8a6);}return _0x45ff6c[_0x1721('0x22')]();};}function saveUpdates(_0x171399,_0x19bda6){return function(_0x183723){if(_0x183723){return _0x183723[_0x1721('0x23')](_0x171399)[_0x1721('0x24')](function(_0x3c5448){return _0x3c5448;});}return null;};}function removeEntity(_0x30e0e6,_0x1f30e5){return function(_0x429f0f){if(_0x429f0f){return _0x429f0f['destroy']()[_0x1721('0x24')](function(){_0x30e0e6[_0x1721('0x1f')](0xcc)[_0x1721('0x19')]();});}};}function handleEntityNotFound(_0x5aed5b,_0x143faf){return function(_0x2524dd){if(!_0x2524dd){_0x5aed5b['sendStatus'](0x194);}return _0x2524dd;};}function handleError(_0x1db389,_0x9ac12f){_0x9ac12f=_0x9ac12f||0x1f4;return function(_0x36f0df){logger[_0x1721('0x25')](_0x36f0df['stack']);if(_0x36f0df['name']){delete _0x36f0df[_0x1721('0x26')];}_0x1db389[_0x1721('0x1f')](_0x9ac12f)[_0x1721('0x27')](_0x36f0df);};}exports[_0x1721('0x28')]=function(_0x55812c,_0x558a57){var _0x498004={},_0x1d538a={},_0x50c9aa={'count':0x0,'rows':[]};var _0x45695a=_[_0x1721('0x29')](db[_0x1721('0x2a')][_0x1721('0x2b')],function(_0x5f51b8){return{'name':_0x5f51b8[_0x1721('0x2c')],'type':_0x5f51b8[_0x1721('0x2d')][_0x1721('0x2e')]};});_0x1d538a[_0x1721('0x2f')]=_[_0x1721('0x29')](_0x45695a,_0x1721('0x26'));_0x1d538a[_0x1721('0x30')]=_[_0x1721('0x31')](_0x55812c[_0x1721('0x30')]);_0x1d538a[_0x1721('0x32')]=_['intersection'](_0x1d538a['model'],_0x1d538a[_0x1721('0x30')]);_0x498004[_0x1721('0x33')]=_[_0x1721('0x34')](_0x1d538a[_0x1721('0x2f')],qs['fields'](_0x55812c['query'][_0x1721('0x35')]));_0x498004[_0x1721('0x33')]=_0x498004[_0x1721('0x33')][_0x1721('0x36')]?_0x498004[_0x1721('0x33')]:_0x1d538a[_0x1721('0x2f')];if(!_0x55812c[_0x1721('0x30')][_0x1721('0x37')](_0x1721('0x38'))){_0x498004[_0x1721('0x1e')]=qs['limit'](_0x55812c[_0x1721('0x30')][_0x1721('0x1e')]);_0x498004[_0x1721('0x1b')]=qs[_0x1721('0x1b')](_0x55812c['query'][_0x1721('0x1b')]);}_0x498004[_0x1721('0x39')]=qs[_0x1721('0x3a')](_0x55812c[_0x1721('0x30')]['sort']);_0x498004[_0x1721('0x3b')]=qs['filters'](_[_0x1721('0x3c')](_0x55812c[_0x1721('0x30')],_0x1d538a[_0x1721('0x32')]),_0x45695a);if(_0x55812c[_0x1721('0x30')][_0x1721('0x3d')]){_0x498004[_0x1721('0x3b')]=_[_0x1721('0x3e')](_0x498004[_0x1721('0x3b')],{'$or':_[_0x1721('0x29')](_0x45695a,function(_0x45b71b){if(_0x45b71b[_0x1721('0x2d')]!==_0x1721('0x3f')){var _0x1a9b48={};_0x1a9b48[_0x45b71b[_0x1721('0x26')]]={'$like':'%'+_0x55812c[_0x1721('0x30')][_0x1721('0x3d')]+'%'};return _0x1a9b48;}})});}_0x498004=_['merge']({},_0x498004,_0x55812c[_0x1721('0x40')]);var _0x476370={'where':_0x498004[_0x1721('0x3b')]};return db[_0x1721('0x2a')][_0x1721('0x1d')](_0x476370)['then'](function(_0x27e7d1){_0x50c9aa[_0x1721('0x1d')]=_0x27e7d1;if(_0x55812c[_0x1721('0x30')][_0x1721('0x41')]){_0x498004['include']=[{'all':!![]}];}return db[_0x1721('0x2a')][_0x1721('0x42')](_0x498004);})[_0x1721('0x24')](function(_0xa7080f){_0x50c9aa['rows']=_0xa7080f;return _0x50c9aa;})[_0x1721('0x24')](respondWithFilteredResult(_0x558a57,_0x498004))[_0x1721('0x43')](handleError(_0x558a57,null));};exports[_0x1721('0x44')]=function(_0x518cd0,_0x7fc154){var _0x118da9={'raw':![],'where':{'id':_0x518cd0[_0x1721('0x45')]['id']}},_0x11d461={};_0x11d461['model']=_[_0x1721('0x31')](db['FreshsalesAccount']['rawAttributes']);_0x11d461[_0x1721('0x30')]=_['keys'](_0x518cd0[_0x1721('0x30')]);_0x11d461['filters']=_[_0x1721('0x34')](_0x11d461['model'],_0x11d461[_0x1721('0x30')]);_0x118da9[_0x1721('0x33')]=_[_0x1721('0x34')](_0x11d461[_0x1721('0x2f')],qs['fields'](_0x518cd0['query'][_0x1721('0x35')]));_0x118da9['attributes']=_0x118da9[_0x1721('0x33')][_0x1721('0x36')]?_0x118da9[_0x1721('0x33')]:_0x11d461[_0x1721('0x2f')];if(_0x518cd0[_0x1721('0x30')][_0x1721('0x41')]){_0x118da9[_0x1721('0x46')]=[{'all':!![]}];}_0x118da9=_['merge']({},_0x118da9,_0x518cd0[_0x1721('0x40')]);return db[_0x1721('0x2a')][_0x1721('0x47')](_0x118da9)['then'](handleEntityNotFound(_0x7fc154,null))[_0x1721('0x24')](respondWithResult(_0x7fc154,null))[_0x1721('0x43')](handleError(_0x7fc154,null));};exports[_0x1721('0x48')]=function(_0x48dfac,_0x4cb025){return db['FreshsalesAccount'][_0x1721('0x48')](_0x48dfac[_0x1721('0x49')],{})[_0x1721('0x24')](respondWithResult(_0x4cb025,0xc9))[_0x1721('0x43')](handleError(_0x4cb025,null));};exports[_0x1721('0x23')]=function(_0x2095ae,_0x303f9b){if(_0x2095ae['body']['id']){delete _0x2095ae[_0x1721('0x49')]['id'];}return db[_0x1721('0x2a')][_0x1721('0x47')]({'where':{'id':_0x2095ae[_0x1721('0x45')]['id']}})[_0x1721('0x24')](handleEntityNotFound(_0x303f9b,null))[_0x1721('0x24')](saveUpdates(_0x2095ae['body'],null))[_0x1721('0x24')](respondWithResult(_0x303f9b,null))[_0x1721('0x43')](handleError(_0x303f9b,null));};exports[_0x1721('0x4a')]=function(_0x3e54b6,_0x5c2468){return db[_0x1721('0x2a')]['find']({'where':{'id':_0x3e54b6['params']['id']}})[_0x1721('0x24')](handleEntityNotFound(_0x5c2468,null))[_0x1721('0x24')](removeEntity(_0x5c2468,null))['catch'](handleError(_0x5c2468,null));};exports[_0x1721('0x4b')]=function(_0x4db2fd,_0x4e2533,_0x408241){var _0x43cda3={};var _0x801f4e={};var _0x1b43cd;var _0x21105e;return db[_0x1721('0x2a')][_0x1721('0x4c')]({'where':{'id':_0x4db2fd[_0x1721('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e2533,null))[_0x1721('0x24')](function(_0x42422f){if(_0x42422f){_0x1b43cd=_0x42422f;_0x801f4e[_0x1721('0x2f')]=_[_0x1721('0x31')](db[_0x1721('0x4d')][_0x1721('0x2b')]);_0x801f4e['query']=_[_0x1721('0x31')](_0x4db2fd[_0x1721('0x30')]);_0x801f4e[_0x1721('0x32')]=_[_0x1721('0x34')](_0x801f4e['model'],_0x801f4e['query']);_0x43cda3['attributes']=_[_0x1721('0x34')](_0x801f4e['model'],qs[_0x1721('0x35')](_0x4db2fd['query'][_0x1721('0x35')]));_0x43cda3[_0x1721('0x33')]=_0x43cda3[_0x1721('0x33')]['length']?_0x43cda3[_0x1721('0x33')]:_0x801f4e[_0x1721('0x2f')];_0x43cda3[_0x1721('0x39')]=qs[_0x1721('0x3a')](_0x4db2fd[_0x1721('0x30')][_0x1721('0x3a')]);_0x43cda3[_0x1721('0x3b')]=qs[_0x1721('0x32')](_['pick'](_0x4db2fd['query'],_0x801f4e[_0x1721('0x32')]));if(_0x4db2fd['query'][_0x1721('0x3d')]){_0x43cda3[_0x1721('0x3b')]=_[_0x1721('0x3e')](_0x43cda3[_0x1721('0x3b')],{'$or':_[_0x1721('0x29')](_0x43cda3[_0x1721('0x33')],function(_0x5495e8){var _0x24c085={};_0x24c085[_0x5495e8]={'$like':'%'+_0x4db2fd[_0x1721('0x30')][_0x1721('0x3d')]+'%'};return _0x24c085;})});}_0x43cda3=_[_0x1721('0x3e')]({},_0x43cda3,_0x4db2fd['options']);return _0x1b43cd[_0x1721('0x4b')](_0x43cda3);}})[_0x1721('0x24')](function(_0x39b89c){if(_0x39b89c){_0x21105e=_0x39b89c[_0x1721('0x36')];if(!_0x4db2fd[_0x1721('0x30')][_0x1721('0x37')]('nolimit')){_0x43cda3[_0x1721('0x1e')]=qs[_0x1721('0x1e')](_0x4db2fd[_0x1721('0x30')]['limit']);_0x43cda3[_0x1721('0x1b')]=qs[_0x1721('0x1b')](_0x4db2fd['query'][_0x1721('0x1b')]);}return _0x1b43cd['getConfigurations'](_0x43cda3);}})[_0x1721('0x24')](function(_0x4d1cfe){if(_0x4d1cfe){return _0x4d1cfe?{'count':_0x21105e,'rows':_0x4d1cfe}:null;}})['then'](respondWithResult(_0x4e2533,null))[_0x1721('0x43')](handleError(_0x4e2533,null));};exports[_0x1721('0x4e')]=function(_0x19e40d,_0x420fcd,_0x4bc20c){if(_0x19e40d[_0x1721('0x49')]['id']){delete _0x19e40d[_0x1721('0x49')]['id'];}return db[_0x1721('0x2a')][_0x1721('0x4c')]({'where':{'id':_0x19e40d[_0x1721('0x45')]['id']}})['then'](handleEntityNotFound(_0x420fcd,null))[_0x1721('0x24')](function(_0x12b6c8){if(_0x12b6c8){_0x19e40d[_0x1721('0x49')][_0x1721('0x4f')]=_0x12b6c8['id'];_0x19e40d[_0x1721('0x49')]['Subjects']=integrations[_0x1721('0x50')](_0x19e40d[_0x1721('0x49')][_0x1721('0x51')],_0x19e40d[_0x1721('0x49')]['type']);_0x19e40d[_0x1721('0x49')][_0x1721('0x52')]=integrations[_0x1721('0x53')](_0x19e40d[_0x1721('0x49')]['channel'],_0x19e40d[_0x1721('0x49')]['type']);return db['FreshsalesConfiguration'][_0x1721('0x48')](_0x19e40d[_0x1721('0x49')],{'include':[{'model':db['FreshsalesField'],'as':_0x1721('0x54')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0x1721('0x24')](respondWithResult(_0x420fcd,null))['catch'](handleError(_0x420fcd,null));};exports[_0x1721('0x55')]=function(_0x46b20c,_0x3b82e0,_0xfadc61){var _0x41a5f0='';var _0x3430c0='';return db[_0x1721('0x2a')][_0x1721('0x4c')]({'where':{'id':_0x46b20c[_0x1721('0x45')]['id']},'attributes':['id',_0x1721('0x56'),_0x1721('0x57'),_0x1721('0x58')]})[_0x1721('0x24')](handleEntityNotFound(_0x3b82e0,null))['then'](function(_0x221818){if(_0x221818){_0x3430c0=_0x221818['username'];_0x41a5f0=_0x221818[_0x1721('0x57')];var _0x3b7f4d=_0x221818[_0x1721('0x57')][_0x1721('0x59')](-0x1);if(_0x3b7f4d==='/'){_0x41a5f0=_0x41a5f0[_0x1721('0x5a')](0x0,_0x41a5f0[_0x1721('0x5b')](_0x3b7f4d));}return rp({'method':'GET','uri':util[_0x1721('0x5c')](_0x1721('0x5d'),_0x41a5f0,_0x1721('0x5e')),'headers':{'Authorization':'Token\x20token='+_0x221818[_0x1721('0x58')]},'json':!![]});}})['then'](function(_0x75e0d6){if(_0x75e0d6){var _0x17f38a=_0x75e0d6[_0x1721('0x5f')];var _0x4a79dd=![];var _0x3adae0=null;for(_0x3adae0=0x0;_0x3adae0<_0x17f38a[_0x1721('0x36')];_0x3adae0++){if(_0x17f38a[_0x3adae0][_0x1721('0x60')]===_0x3430c0){_0x4a79dd=!![];}}if(_0x4a79dd){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x1721('0x24')](respondWithResult(_0x3b82e0,null))[_0x1721('0x43')](function(_0x3d48e9){var _0x445b30=_0x46b20c[_0x1721('0x30')][_0x1721('0x61')]?0x1f4:_0x3d48e9[_0x1721('0x62')]||0x1f4;logger[_0x1721('0x25')](_0x1721('0x63'),_0x1721('0x55'),_0x445b30,JSON['stringify'](_0x3d48e9));delete _0x3d48e9['name'];if(_0x445b30===0x191){_0x445b30=0x190;}_0x3b82e0[_0x1721('0x1f')](_0x445b30)[_0x1721('0x27')](_0x46b20c[_0x1721('0x30')][_0x1721('0x61')]?{'message':_0x1721('0x64'),'statusCode':_0x3d48e9[_0x1721('0x62')]}:_0x3d48e9);});};
\ No newline at end of file
index faf3aa1..ec27815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['path','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x39e436,_0x4b083d){var _0x335e7e=function(_0x4f1c53){while(--_0x4f1c53){_0x39e436['push'](_0x39e436['shift']());}};_0x335e7e(++_0x4b083d);}(_0xafc4,0x69));var _0x4afc=function(_0x11cf44,_0x351dd2){_0x11cf44=_0x11cf44-0x0;var _0x4701f0=_0xafc4[_0x11cf44];return _0x4701f0;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x4afc('0x6'));module[_0x4afc('0x7')]=function(_0x16953b,_0x1bb281){return _0x16953b[_0x4afc('0x8')](_0x4afc('0x9'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x5fab,0x177));var _0xb5fa=function(_0x1d2e88,_0x410d1d){_0x1d2e88=_0x1d2e88-0x0;var _0x42794b=_0x5fab[_0x1d2e88];return _0x42794b;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));var integrations=require(_0xb5fa('0xa'));module[_0xb5fa('0xb')]=function(_0x4a0249,_0x5d70f6){return _0x4a0249[_0xb5fa('0xc')](_0xb5fa('0xd'),attributes,{'tableName':_0xb5fa('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9192e81..5827d71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','FreshsalesAccount','lodash','util'];(function(_0xe27b97,_0x4f9c9c){var _0x1acbda=function(_0x3fe38f){while(--_0x3fe38f){_0xe27b97['push'](_0xe27b97['shift']());}};_0x1acbda(++_0x4f9c9c);}(_0xdb28,0x106));var _0x8db2=function(_0x485f4a,_0x10924e){_0x485f4a=_0x485f4a-0x0;var _0x48af03=_0xdb28[_0x485f4a];return _0x48af03;};'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')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['FreshsalesAccount'][_0x8db2('0x17')]({'raw':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1a')]||null:null,'attributes':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1b')]||null:null,'limit':_0x3fddc2['options']?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1c')]||null:null,'include':_0x3fddc2[_0x8db2('0x18')]?_0x3fddc2[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x3fddc2[_0x8db2('0x18')]['include'],function(_0x256202){return{'model':db[_0x256202['model']],'as':_0x256202['as'],'attributes':_0x256202['attributes'],'include':_0x256202['include']?_['map'](_0x256202[_0x8db2('0x1d')],function(_0x29b5cd){return{'model':db[_0x29b5cd[_0x8db2('0x1f')]],'as':_0x29b5cd['as'],'attributes':_0x29b5cd[_0x8db2('0x1b')],'include':_0x29b5cd[_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x29b5cd['include'],function(_0x3544ba){return{'model':db[_0x3544ba[_0x8db2('0x1f')]],'as':_0x3544ba['as'],'attributes':_0x3544ba[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x483aee){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')](_0x8db2('0x16'),_0x3fddc2,JSON[_0x8db2('0x10')](_0x483aee));_0x46ce14(_0x483aee);})[_0x8db2('0x15')](function(_0xa54ea3){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0xa54ea3['message'],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0xa54ea3['message']));});});};exports['ShowFreshsalesAccount']=function(_0x302188){var _0x25ed2c=this;return new Promise(function(_0xcc8a66,_0x49b2b3){return db[_0x8db2('0x20')]['find']({'raw':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x19')]===undefined?!![]:![]:!![],'where':_0x302188['options']?_0x302188['options'][_0x8db2('0x1a')]||null:null,'attributes':_0x302188[_0x8db2('0x18')]?_0x302188['options']['attributes']||null:null,'include':_0x302188[_0x8db2('0x18')]?_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')]?_[_0x8db2('0x1e')](_0x302188[_0x8db2('0x18')][_0x8db2('0x1d')],function(_0x101711){return{'model':db[_0x101711[_0x8db2('0x1f')]],'as':_0x101711['as'],'attributes':_0x101711[_0x8db2('0x1b')],'include':_0x101711[_0x8db2('0x1d')]?_['map'](_0x101711[_0x8db2('0x1d')],function(_0x304a72){return{'model':db[_0x304a72['model']],'as':_0x304a72['as'],'attributes':_0x304a72[_0x8db2('0x1b')],'include':_0x304a72[_0x8db2('0x1d')]?_['map'](_0x304a72['include'],function(_0x3c1983){return{'model':db[_0x3c1983['model']],'as':_0x3c1983['as'],'attributes':_0x3c1983[_0x8db2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8db2('0xc')](function(_0x26717d){logger[_0x8db2('0x14')]('ShowFreshsalesAccount',_0x302188);logger[_0x8db2('0xf')]('ShowFreshsalesAccount',_0x302188,JSON[_0x8db2('0x10')](_0x26717d));_0xcc8a66(_0x26717d);})[_0x8db2('0x15')](function(_0x2c8bc9){logger[_0x8db2('0x11')]('ShowFreshsalesAccount',_0x2c8bc9['message'],_0x302188);_0x49b2b3(_0x25ed2c[_0x8db2('0x11')](0x1f4,_0x2c8bc9[_0x8db2('0x13')]));});});};
\ No newline at end of file
+var _0x33af=['include','map','model','ShowFreshsalesAccount','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x33af,0xec));var _0xf33a=function(_0x30e141,_0x450f41){_0x30e141=_0x30e141-0x0;var _0x1d25ab=_0x33af[_0x30e141];return _0x1d25ab;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['findAll']({'raw':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x18')]===undefined?!![]:![]:!![],'where':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x19')]||null:null,'attributes':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x1a')]||null:null,'limit':_0x524109[_0xf33a('0x17')]?_0x524109['options'][_0xf33a('0x1b')]||null:null,'include':_0x524109[_0xf33a('0x17')]?_0x524109[_0xf33a('0x17')][_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x524109['options'][_0xf33a('0x1c')],function(_0x5882ba){return{'model':db[_0x5882ba[_0xf33a('0x1e')]],'as':_0x5882ba['as'],'attributes':_0x5882ba[_0xf33a('0x1a')],'include':_0x5882ba[_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x5882ba[_0xf33a('0x1c')],function(_0x4b9801){return{'model':db[_0x4b9801[_0xf33a('0x1e')]],'as':_0x4b9801['as'],'attributes':_0x4b9801[_0xf33a('0x1a')],'include':_0x4b9801['include']?_['map'](_0x4b9801[_0xf33a('0x1c')],function(_0x5f0a53){return{'model':db[_0x5f0a53['model']],'as':_0x5f0a53['as'],'attributes':_0x5f0a53[_0xf33a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x79d653){logger['info'](_0xf33a('0x15'),_0x524109);logger[_0xf33a('0xe')](_0xf33a('0x15'),_0x524109,JSON[_0xf33a('0xf')](_0x79d653));_0x23d9e2(_0x79d653);})[_0xf33a('0x14')](function(_0x3068a9){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x3068a9[_0xf33a('0x12')],_0x524109);_0x38d69a(_0x2946ef[_0xf33a('0x10')](0x1f4,_0x3068a9[_0xf33a('0x12')]));});});};exports[_0xf33a('0x1f')]=function(_0x22c9f2){var _0x3f714e=this;return new Promise(function(_0x2fd098,_0x5eb14a){return db[_0xf33a('0x16')][_0xf33a('0x20')]({'raw':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x19')]||null:null,'attributes':_0x22c9f2[_0xf33a('0x17')]?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1a')]||null:null,'include':_0x22c9f2['options']?_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1c')]?_[_0xf33a('0x1d')](_0x22c9f2[_0xf33a('0x17')][_0xf33a('0x1c')],function(_0x57e7be){return{'model':db[_0x57e7be['model']],'as':_0x57e7be['as'],'attributes':_0x57e7be[_0xf33a('0x1a')],'include':_0x57e7be['include']?_['map'](_0x57e7be['include'],function(_0x2c4840){return{'model':db[_0x2c4840[_0xf33a('0x1e')]],'as':_0x2c4840['as'],'attributes':_0x2c4840['attributes'],'include':_0x2c4840[_0xf33a('0x1c')]?_['map'](_0x2c4840[_0xf33a('0x1c')],function(_0x1f11b3){return{'model':db[_0x1f11b3[_0xf33a('0x1e')]],'as':_0x1f11b3['as'],'attributes':_0x1f11b3[_0xf33a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf33a('0xa')](function(_0x23c92b){logger['info'](_0xf33a('0x1f'),_0x22c9f2);logger[_0xf33a('0xe')]('ShowFreshsalesAccount',_0x22c9f2,JSON[_0xf33a('0xf')](_0x23c92b));_0x2fd098(_0x23c92b);})[_0xf33a('0x14')](function(_0x3e0a98){logger['error'](_0xf33a('0x1f'),_0x3e0a98[_0xf33a('0x12')],_0x22c9f2);_0x5eb14a(_0x3f714e[_0xf33a('0x10')](0x1f4,_0x3e0a98[_0xf33a('0x12')]));});});};
\ No newline at end of file
index 7120a5f..2c0ba0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe922=['put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','create'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0xe922,0x9a));var _0x2e92=function(_0x318054,_0x516efd){_0x318054=_0x318054-0x0;var _0x19a6ae=_0xe922[_0x318054];return _0x19a6ae;};'use strict';var multer=require(_0x2e92('0x0'));var util=require('util');var path=require(_0x2e92('0x1'));var timeout=require(_0x2e92('0x2'));var express=require(_0x2e92('0x3'));var router=express[_0x2e92('0x4')]();var fs_extra=require(_0x2e92('0x5'));var auth=require(_0x2e92('0x6'));var interaction=require(_0x2e92('0x7'));var config=require(_0x2e92('0x8'));var controller=require(_0x2e92('0x9'));router[_0x2e92('0xa')]('/',auth[_0x2e92('0xb')](),controller[_0x2e92('0xc')]);router[_0x2e92('0xa')](_0x2e92('0xd'),auth['isAuthenticated'](),controller[_0x2e92('0xe')]);router['get']('/:id/subjects',auth[_0x2e92('0xb')](),controller[_0x2e92('0xf')]);router[_0x2e92('0xa')](_0x2e92('0x10'),auth[_0x2e92('0xb')](),controller[_0x2e92('0x11')]);router[_0x2e92('0xa')](_0x2e92('0x12'),auth[_0x2e92('0xb')](),controller['getFields']);router[_0x2e92('0x13')]('/',auth[_0x2e92('0xb')](),controller[_0x2e92('0x14')]);router[_0x2e92('0x15')](_0x2e92('0xd'),auth[_0x2e92('0xb')](),controller[_0x2e92('0x16')]);router['delete'](_0x2e92('0xd'),auth[_0x2e92('0xb')](),controller[_0x2e92('0x17')]);module[_0x2e92('0x18')]=router;
\ No newline at end of file
+var _0x2e10=['getSubjects','/:id/fields','getFields','create','put','/:id','destroy','exports','multer','path','connect-timeout','Router','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','show','/:id/subjects'];(function(_0xff0642,_0x4b2e82){var _0x1f8de7=function(_0x9091f5){while(--_0x9091f5){_0xff0642['push'](_0xff0642['shift']());}};_0x1f8de7(++_0x4b2e82);}(_0x2e10,0xb3));var _0x02e1=function(_0xc7c5df,_0x6860b){_0xc7c5df=_0xc7c5df-0x0;var _0x31bd86=_0x2e10[_0xc7c5df];return _0x31bd86;};'use strict';var multer=require(_0x02e1('0x0'));var util=require('util');var path=require(_0x02e1('0x1'));var timeout=require(_0x02e1('0x2'));var express=require('express');var router=express[_0x02e1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x02e1('0x4'));var controller=require(_0x02e1('0x5'));router['get']('/',auth[_0x02e1('0x6')](),controller[_0x02e1('0x7')]);router[_0x02e1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x02e1('0x9')]);router[_0x02e1('0x8')](_0x02e1('0xa'),auth[_0x02e1('0x6')](),controller[_0x02e1('0xb')]);router[_0x02e1('0x8')]('/:id/descriptions',auth[_0x02e1('0x6')](),controller['getDescriptions']);router[_0x02e1('0x8')](_0x02e1('0xc'),auth['isAuthenticated'](),controller[_0x02e1('0xd')]);router['post']('/',auth[_0x02e1('0x6')](),controller[_0x02e1('0xe')]);router[_0x02e1('0xf')](_0x02e1('0x10'),auth[_0x02e1('0x6')](),controller['update']);router['delete'](_0x02e1('0x10'),auth['isAuthenticated'](),controller[_0x02e1('0x11')]);module[_0x02e1('0x12')]=router;
\ No newline at end of file
index 96e6100..ca7e23d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b5d=['STRING','sequelize'];(function(_0x3c3128,_0x117d7d){var _0x26b55e=function(_0x350250){while(--_0x350250){_0x3c3128['push'](_0x3c3128['shift']());}};_0x26b55e(++_0x117d7d);}(_0x8b5d,0x149));var _0xd8b5=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x8b5d[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0xd8b5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd8b5('0x1')]}};
\ No newline at end of file
+var _0xdf7c=['sequelize','exports','STRING'];(function(_0x32e33c,_0x2c4cf7){var _0x1805a2=function(_0x34ec7e){while(--_0x34ec7e){_0x32e33c['push'](_0x32e33c['shift']());}};_0x1805a2(++_0x2c4cf7);}(_0xdf7c,0x10e));var _0xcdf7=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0xdf7c[_0x1bf809];return _0x1caa4e;};'use strict';var Sequelize=require(_0xcdf7('0x0'));module[_0xcdf7('0x1')]={'name':{'type':Sequelize[_0xcdf7('0x2')]},'description':{'type':Sequelize[_0xcdf7('0x2')]}};
\ No newline at end of file
index 1580b25..380158d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9245=['../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','merge','VIRTUAL','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','hasOwnProperty','getFields','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9245,0x12d));var _0x5924=function(_0x2c0d27,_0x55aad0){_0x2c0d27=_0x2c0d27-0x0;var _0x41ea9a=_0x9245[_0x2c0d27];return _0x41ea9a;};'use strict';var emlformat=require(_0x5924('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5924('0x1'));var jsonpatch=require(_0x5924('0x2'));var rp=require(_0x5924('0x3'));var moment=require(_0x5924('0x4'));var BPromise=require(_0x5924('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5924('0x6'));var sox=require(_0x5924('0x7'));var csv=require('to-csv');var ejs=require(_0x5924('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5924('0x9'));var squel=require('squel');var crypto=require(_0x5924('0xa'));var jsforce=require(_0x5924('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5924('0xc'));var querystring=require(_0x5924('0xd'));var Papa=require(_0x5924('0xe'));var Redis=require(_0x5924('0xf'));var authService=require(_0x5924('0x10'));var qs=require(_0x5924('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5924('0x12'));var logger=require(_0x5924('0x13'))(_0x5924('0x14'));var utils=require(_0x5924('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x942b24,_0x17e060){_0x17e060=_0x17e060||0xcc;return function(_0x47aced){if(_0x47aced){return _0x942b24[_0x5924('0x16')](_0x17e060);}return _0x942b24[_0x5924('0x17')](_0x17e060)[_0x5924('0x18')]();};}function respondWithResult(_0x38d508,_0x5c40d8){_0x5c40d8=_0x5c40d8||0xc8;return function(_0x559b20){if(_0x559b20){return _0x38d508['status'](_0x5c40d8)[_0x5924('0x19')](_0x559b20);}};}function respondWithFilteredResult(_0x518caf,_0x3c5248){return function(_0xd8f196){if(_0xd8f196){var _0x356fd4=typeof _0x3c5248[_0x5924('0x1a')]===_0x5924('0x1b')&&typeof _0x3c5248[_0x5924('0x1c')]===_0x5924('0x1b');var _0x5e0b45=_0xd8f196['count'];var _0x488aa1=_0x356fd4?0x0:_0x3c5248[_0x5924('0x1a')];var _0x52f78d=_0x356fd4?_0xd8f196[_0x5924('0x1d')]:_0x3c5248[_0x5924('0x1a')]+_0x3c5248[_0x5924('0x1c')];var _0x1b681d;if(_0x52f78d>=_0x5e0b45){_0x52f78d=_0x5e0b45;_0x1b681d=0xc8;}else{_0x1b681d=0xce;}_0x518caf[_0x5924('0x17')](_0x1b681d);return _0x518caf[_0x5924('0x1e')](_0x5924('0x1f'),_0x488aa1+'-'+_0x52f78d+'/'+_0x5e0b45)[_0x5924('0x19')](_0xd8f196);}return null;};}function patchUpdates(_0x47d828){return function(_0x52155e){try{jsonpatch['apply'](_0x52155e,_0x47d828,!![]);}catch(_0x3717b5){return BPromise[_0x5924('0x20')](_0x3717b5);}return _0x52155e[_0x5924('0x21')]();};}function saveUpdates(_0x31fa0c,_0x12f04b){return function(_0x51ca1f){if(_0x51ca1f){return _0x51ca1f[_0x5924('0x22')](_0x31fa0c)['then'](function(_0xd68b15){return _0xd68b15;});}return null;};}function removeEntity(_0x5a4deb,_0xe051e1){return function(_0x15e62a){if(_0x15e62a){return _0x15e62a[_0x5924('0x23')]()[_0x5924('0x24')](function(){_0x5a4deb[_0x5924('0x17')](0xcc)[_0x5924('0x18')]();});}};}function handleEntityNotFound(_0xc22b92,_0x17beae){return function(_0x58f4ac){if(!_0x58f4ac){_0xc22b92[_0x5924('0x16')](0x194);}return _0x58f4ac;};}function handleError(_0x598200,_0x4d80b9){_0x4d80b9=_0x4d80b9||0x1f4;return function(_0x46165d){logger[_0x5924('0x25')](_0x46165d[_0x5924('0x26')]);if(_0x46165d[_0x5924('0x27')]){delete _0x46165d[_0x5924('0x27')];}_0x598200['status'](_0x4d80b9)[_0x5924('0x28')](_0x46165d);};}exports[_0x5924('0x29')]=function(_0x35e101,_0x2518f9){var _0x1f0f71={},_0xba5bd={},_0xacdf4c={'count':0x0,'rows':[]};var _0x244150=_[_0x5924('0x2a')](db['FreshsalesConfiguration'][_0x5924('0x2b')],function(_0x269865){return{'name':_0x269865[_0x5924('0x2c')],'type':_0x269865[_0x5924('0x2d')]['key']};});_0xba5bd[_0x5924('0x2e')]=_[_0x5924('0x2a')](_0x244150,_0x5924('0x27'));_0xba5bd['query']=_[_0x5924('0x2f')](_0x35e101[_0x5924('0x30')]);_0xba5bd['filters']=_[_0x5924('0x31')](_0xba5bd[_0x5924('0x2e')],_0xba5bd[_0x5924('0x30')]);_0x1f0f71[_0x5924('0x32')]=_['intersection'](_0xba5bd[_0x5924('0x2e')],qs[_0x5924('0x33')](_0x35e101[_0x5924('0x30')][_0x5924('0x33')]));_0x1f0f71[_0x5924('0x32')]=_0x1f0f71[_0x5924('0x32')][_0x5924('0x34')]?_0x1f0f71['attributes']:_0xba5bd[_0x5924('0x2e')];if(!_0x35e101[_0x5924('0x30')]['hasOwnProperty']('nolimit')){_0x1f0f71['limit']=qs['limit'](_0x35e101[_0x5924('0x30')][_0x5924('0x1c')]);_0x1f0f71[_0x5924('0x1a')]=qs[_0x5924('0x1a')](_0x35e101[_0x5924('0x30')][_0x5924('0x1a')]);}_0x1f0f71[_0x5924('0x35')]=qs[_0x5924('0x36')](_0x35e101[_0x5924('0x30')][_0x5924('0x36')]);_0x1f0f71[_0x5924('0x37')]=qs['filters'](_[_0x5924('0x38')](_0x35e101['query'],_0xba5bd[_0x5924('0x39')]),_0x244150);if(_0x35e101[_0x5924('0x30')][_0x5924('0x3a')]){_0x1f0f71[_0x5924('0x37')]=_[_0x5924('0x3b')](_0x1f0f71['where'],{'$or':_['map'](_0x244150,function(_0xed8155){if(_0xed8155[_0x5924('0x2d')]!==_0x5924('0x3c')){var _0x5701c4={};_0x5701c4[_0xed8155[_0x5924('0x27')]]={'$like':'%'+_0x35e101[_0x5924('0x30')]['filter']+'%'};return _0x5701c4;}})});}_0x1f0f71=_[_0x5924('0x3b')]({},_0x1f0f71,_0x35e101['options']);var _0x43f713={'where':_0x1f0f71[_0x5924('0x37')]};return db[_0x5924('0x3d')][_0x5924('0x1d')](_0x43f713)[_0x5924('0x24')](function(_0x4bdbef){_0xacdf4c[_0x5924('0x1d')]=_0x4bdbef;if(_0x35e101[_0x5924('0x30')][_0x5924('0x3e')]){_0x1f0f71[_0x5924('0x3f')]=[{'all':!![]}];}return db[_0x5924('0x3d')][_0x5924('0x40')](_0x1f0f71);})[_0x5924('0x24')](function(_0x39a8ea){_0xacdf4c[_0x5924('0x41')]=_0x39a8ea;return _0xacdf4c;})['then'](respondWithFilteredResult(_0x2518f9,_0x1f0f71))[_0x5924('0x42')](handleError(_0x2518f9,null));};exports[_0x5924('0x43')]=function(_0x211ebf,_0x71d5f6){var _0x9ac7ca={'raw':![],'where':{'id':_0x211ebf[_0x5924('0x44')]['id']}},_0x2fe878={};_0x2fe878['model']=_['keys'](db[_0x5924('0x3d')][_0x5924('0x2b')]);_0x2fe878['query']=_['keys'](_0x211ebf[_0x5924('0x30')]);_0x2fe878[_0x5924('0x39')]=_[_0x5924('0x31')](_0x2fe878['model'],_0x2fe878[_0x5924('0x30')]);_0x9ac7ca[_0x5924('0x32')]=_[_0x5924('0x31')](_0x2fe878[_0x5924('0x2e')],qs['fields'](_0x211ebf[_0x5924('0x30')][_0x5924('0x33')]));_0x9ac7ca['attributes']=_0x9ac7ca[_0x5924('0x32')][_0x5924('0x34')]?_0x9ac7ca[_0x5924('0x32')]:_0x2fe878[_0x5924('0x2e')];if(_0x211ebf[_0x5924('0x30')][_0x5924('0x3e')]){_0x9ac7ca[_0x5924('0x3f')]=[{'all':!![]}];}_0x9ac7ca=_[_0x5924('0x3b')]({},_0x9ac7ca,_0x211ebf[_0x5924('0x45')]);return db['FreshsalesConfiguration'][_0x5924('0x46')](_0x9ac7ca)[_0x5924('0x24')](handleEntityNotFound(_0x71d5f6,null))[_0x5924('0x24')](respondWithResult(_0x71d5f6,null))['catch'](handleError(_0x71d5f6,null));};exports[_0x5924('0x47')]=function(_0x1e7c2e,_0x2112fd){return db[_0x5924('0x3d')][_0x5924('0x47')](_0x1e7c2e[_0x5924('0x48')],{})[_0x5924('0x24')](respondWithResult(_0x2112fd,0xc9))[_0x5924('0x42')](handleError(_0x2112fd,null));};exports[_0x5924('0x22')]=function(_0x3c47ff,_0x1b9e43){if(_0x3c47ff[_0x5924('0x48')]['id']){delete _0x3c47ff[_0x5924('0x48')]['id'];}return db['FreshsalesConfiguration'][_0x5924('0x46')]({'where':{'id':_0x3c47ff[_0x5924('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b9e43,null))[_0x5924('0x24')](saveUpdates(_0x3c47ff[_0x5924('0x48')],null))[_0x5924('0x24')](respondWithResult(_0x1b9e43,null))[_0x5924('0x42')](handleError(_0x1b9e43,null));};exports[_0x5924('0x23')]=function(_0xa91283,_0x13d50e){return db['FreshsalesConfiguration']['find']({'where':{'id':_0xa91283[_0x5924('0x44')]['id']}})[_0x5924('0x24')](handleEntityNotFound(_0x13d50e,null))['then'](removeEntity(_0x13d50e,null))[_0x5924('0x42')](handleError(_0x13d50e,null));};exports[_0x5924('0x49')]=function(_0x4efb7b,_0x43d2a5,_0x3d7abb){var _0x1796d0={};var _0x1243d8={};var _0x2085fc;var _0x2c2f2b;return db[_0x5924('0x3d')][_0x5924('0x4a')]({'where':{'id':_0x4efb7b[_0x5924('0x44')]['id']}})[_0x5924('0x24')](handleEntityNotFound(_0x43d2a5,null))[_0x5924('0x24')](function(_0xb37f6e){if(_0xb37f6e){_0x2085fc=_0xb37f6e;_0x1243d8[_0x5924('0x2e')]=_['keys'](db[_0x5924('0x4b')][_0x5924('0x2b')]);_0x1243d8['query']=_[_0x5924('0x2f')](_0x4efb7b['query']);_0x1243d8[_0x5924('0x39')]=_['intersection'](_0x1243d8[_0x5924('0x2e')],_0x1243d8[_0x5924('0x30')]);_0x1796d0[_0x5924('0x32')]=_[_0x5924('0x31')](_0x1243d8[_0x5924('0x2e')],qs[_0x5924('0x33')](_0x4efb7b[_0x5924('0x30')][_0x5924('0x33')]));_0x1796d0[_0x5924('0x32')]=_0x1796d0[_0x5924('0x32')][_0x5924('0x34')]?_0x1796d0['attributes']:_0x1243d8['model'];_0x1796d0['order']=qs[_0x5924('0x36')](_0x4efb7b['query'][_0x5924('0x36')]);_0x1796d0[_0x5924('0x37')]=qs[_0x5924('0x39')](_[_0x5924('0x38')](_0x4efb7b[_0x5924('0x30')],_0x1243d8[_0x5924('0x39')]));if(_0x4efb7b['query']['filter']){_0x1796d0[_0x5924('0x37')]=_[_0x5924('0x3b')](_0x1796d0[_0x5924('0x37')],{'$or':_[_0x5924('0x2a')](_0x1796d0[_0x5924('0x32')],function(_0x4c5de6){var _0xe692d6={};_0xe692d6[_0x4c5de6]={'$like':'%'+_0x4efb7b[_0x5924('0x30')]['filter']+'%'};return _0xe692d6;})});}_0x1796d0=_[_0x5924('0x3b')]({},_0x1796d0,_0x4efb7b[_0x5924('0x45')]);return _0x2085fc[_0x5924('0x49')](_0x1796d0);}})[_0x5924('0x24')](function(_0x3ece40){if(_0x3ece40){_0x2c2f2b=_0x3ece40[_0x5924('0x34')];if(!_0x4efb7b[_0x5924('0x30')]['hasOwnProperty']('nolimit')){_0x1796d0[_0x5924('0x1c')]=qs[_0x5924('0x1c')](_0x4efb7b[_0x5924('0x30')][_0x5924('0x1c')]);_0x1796d0['offset']=qs[_0x5924('0x1a')](_0x4efb7b['query'][_0x5924('0x1a')]);}return _0x2085fc[_0x5924('0x49')](_0x1796d0);}})[_0x5924('0x24')](function(_0x11a9a1){if(_0x11a9a1){return _0x11a9a1?{'count':_0x2c2f2b,'rows':_0x11a9a1}:null;}})[_0x5924('0x24')](respondWithResult(_0x43d2a5,null))[_0x5924('0x42')](handleError(_0x43d2a5,null));};exports[_0x5924('0x4c')]=function(_0x5b2a72,_0x2c1583,_0x427403){var _0xc2973c={};var _0x2ab948={};var _0x39052b;var _0x279ed6;return db[_0x5924('0x3d')][_0x5924('0x4a')]({'where':{'id':_0x5b2a72[_0x5924('0x44')]['id']}})['then'](handleEntityNotFound(_0x2c1583,null))['then'](function(_0x3ca732){if(_0x3ca732){_0x39052b=_0x3ca732;_0x2ab948[_0x5924('0x2e')]=_[_0x5924('0x2f')](db['FreshsalesField'][_0x5924('0x2b')]);_0x2ab948[_0x5924('0x30')]=_['keys'](_0x5b2a72[_0x5924('0x30')]);_0x2ab948[_0x5924('0x39')]=_[_0x5924('0x31')](_0x2ab948['model'],_0x2ab948[_0x5924('0x30')]);_0xc2973c[_0x5924('0x32')]=_[_0x5924('0x31')](_0x2ab948[_0x5924('0x2e')],qs[_0x5924('0x33')](_0x5b2a72[_0x5924('0x30')]['fields']));_0xc2973c[_0x5924('0x32')]=_0xc2973c[_0x5924('0x32')]['length']?_0xc2973c[_0x5924('0x32')]:_0x2ab948[_0x5924('0x2e')];_0xc2973c['order']=qs[_0x5924('0x36')](_0x5b2a72[_0x5924('0x30')][_0x5924('0x36')]);_0xc2973c[_0x5924('0x37')]=qs[_0x5924('0x39')](_[_0x5924('0x38')](_0x5b2a72[_0x5924('0x30')],_0x2ab948[_0x5924('0x39')]));if(_0x5b2a72['query']['filter']){_0xc2973c[_0x5924('0x37')]=_[_0x5924('0x3b')](_0xc2973c['where'],{'$or':_['map'](_0xc2973c['attributes'],function(_0x3bfb4b){var _0x11664a={};_0x11664a[_0x3bfb4b]={'$like':'%'+_0x5b2a72['query'][_0x5924('0x3a')]+'%'};return _0x11664a;})});}_0xc2973c=_[_0x5924('0x3b')]({},_0xc2973c,_0x5b2a72[_0x5924('0x45')]);return _0x39052b[_0x5924('0x4c')](_0xc2973c);}})[_0x5924('0x24')](function(_0x12f1ea){if(_0x12f1ea){_0x279ed6=_0x12f1ea['length'];if(!_0x5b2a72['query'][_0x5924('0x4d')]('nolimit')){_0xc2973c[_0x5924('0x1c')]=qs[_0x5924('0x1c')](_0x5b2a72[_0x5924('0x30')]['limit']);_0xc2973c[_0x5924('0x1a')]=qs[_0x5924('0x1a')](_0x5b2a72[_0x5924('0x30')]['offset']);}return _0x39052b[_0x5924('0x4c')](_0xc2973c);}})[_0x5924('0x24')](function(_0x3d5450){if(_0x3d5450){return _0x3d5450?{'count':_0x279ed6,'rows':_0x3d5450}:null;}})[_0x5924('0x24')](respondWithResult(_0x2c1583,null))[_0x5924('0x42')](handleError(_0x2c1583,null));};exports[_0x5924('0x4e')]=function(_0x3246c7,_0xfa0b62,_0x4a7e2d){var _0x3a3854={};var _0x1e4e4e={};var _0x30aae8;var _0x5196c0;return db[_0x5924('0x3d')]['findOne']({'where':{'id':_0x3246c7[_0x5924('0x44')]['id']}})[_0x5924('0x24')](handleEntityNotFound(_0xfa0b62,null))['then'](function(_0x1e256f){if(_0x1e256f){_0x30aae8=_0x1e256f;_0x1e4e4e[_0x5924('0x2e')]=_[_0x5924('0x2f')](db['FreshsalesField'][_0x5924('0x2b')]);_0x1e4e4e[_0x5924('0x30')]=_[_0x5924('0x2f')](_0x3246c7[_0x5924('0x30')]);_0x1e4e4e[_0x5924('0x39')]=_[_0x5924('0x31')](_0x1e4e4e['model'],_0x1e4e4e[_0x5924('0x30')]);_0x3a3854[_0x5924('0x32')]=_[_0x5924('0x31')](_0x1e4e4e[_0x5924('0x2e')],qs[_0x5924('0x33')](_0x3246c7[_0x5924('0x30')][_0x5924('0x33')]));_0x3a3854[_0x5924('0x32')]=_0x3a3854[_0x5924('0x32')]['length']?_0x3a3854['attributes']:_0x1e4e4e[_0x5924('0x2e')];_0x3a3854[_0x5924('0x35')]=qs[_0x5924('0x36')](_0x3246c7[_0x5924('0x30')][_0x5924('0x36')]);_0x3a3854[_0x5924('0x37')]=qs[_0x5924('0x39')](_['pick'](_0x3246c7[_0x5924('0x30')],_0x1e4e4e[_0x5924('0x39')]));if(_0x3246c7[_0x5924('0x30')]['filter']){_0x3a3854[_0x5924('0x37')]=_[_0x5924('0x3b')](_0x3a3854[_0x5924('0x37')],{'$or':_[_0x5924('0x2a')](_0x3a3854[_0x5924('0x32')],function(_0x243e32){var _0x1eed65={};_0x1eed65[_0x243e32]={'$like':'%'+_0x3246c7[_0x5924('0x30')]['filter']+'%'};return _0x1eed65;})});}_0x3a3854=_[_0x5924('0x3b')]({},_0x3a3854,_0x3246c7[_0x5924('0x45')]);return _0x30aae8[_0x5924('0x4e')](_0x3a3854);}})[_0x5924('0x24')](function(_0xe38fea){if(_0xe38fea){_0x5196c0=_0xe38fea[_0x5924('0x34')];if(!_0x3246c7[_0x5924('0x30')][_0x5924('0x4d')](_0x5924('0x4f'))){_0x3a3854[_0x5924('0x1c')]=qs[_0x5924('0x1c')](_0x3246c7['query'][_0x5924('0x1c')]);_0x3a3854['offset']=qs[_0x5924('0x1a')](_0x3246c7[_0x5924('0x30')][_0x5924('0x1a')]);}return _0x30aae8['getFields'](_0x3a3854);}})[_0x5924('0x24')](function(_0x42cab4){if(_0x42cab4){return _0x42cab4?{'count':_0x5196c0,'rows':_0x42cab4}:null;}})[_0x5924('0x24')](respondWithResult(_0xfa0b62,null))[_0x5924('0x42')](handleError(_0xfa0b62,null));};
\ No newline at end of file
+var _0x6079=['getSubjects','getDescriptions','FreshsalesField','nolimit','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','FreshsalesConfiguration','create','params','body','destroy','find','pick'];(function(_0x1b7908,_0x1b8c1f){var _0x123061=function(_0x5b81c9){while(--_0x5b81c9){_0x1b7908['push'](_0x1b7908['shift']());}};_0x123061(++_0x1b8c1f);}(_0x6079,0x130));var _0x9607=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x6079[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0x9607('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9607('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9607('0x2'));var moment=require(_0x9607('0x3'));var BPromise=require(_0x9607('0x4'));var Mustache=require('mustache');var util=require(_0x9607('0x5'));var path=require(_0x9607('0x6'));var sox=require(_0x9607('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9607('0x8'));var _=require(_0x9607('0x9'));var squel=require(_0x9607('0xa'));var crypto=require(_0x9607('0xb'));var jsforce=require(_0x9607('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9607('0xd'));var querystring=require('querystring');var Papa=require(_0x9607('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9607('0xf'));var as=require(_0x9607('0x10'));var hardwareService=require(_0x9607('0x11'));var logger=require(_0x9607('0x12'))('api');var utils=require(_0x9607('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9607('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1679fe,_0x21bd0c){_0x21bd0c=_0x21bd0c||0xcc;return function(_0x5a0a0f){if(_0x5a0a0f){return _0x1679fe['sendStatus'](_0x21bd0c);}return _0x1679fe[_0x9607('0x15')](_0x21bd0c)[_0x9607('0x16')]();};}function respondWithResult(_0x24aceb,_0x2e600a){_0x2e600a=_0x2e600a||0xc8;return function(_0x1f8a1f){if(_0x1f8a1f){return _0x24aceb[_0x9607('0x15')](_0x2e600a)[_0x9607('0x17')](_0x1f8a1f);}};}function respondWithFilteredResult(_0x8efda5,_0x2b5a4c){return function(_0x56b2e6){if(_0x56b2e6){var _0x599df8=typeof _0x2b5a4c[_0x9607('0x18')]===_0x9607('0x19')&&typeof _0x2b5a4c['limit']===_0x9607('0x19');var _0x15b918=_0x56b2e6['count'];var _0x1c9166=_0x599df8?0x0:_0x2b5a4c[_0x9607('0x18')];var _0x1f6a4d=_0x599df8?_0x56b2e6[_0x9607('0x1a')]:_0x2b5a4c[_0x9607('0x18')]+_0x2b5a4c[_0x9607('0x1b')];var _0x59aab3;if(_0x1f6a4d>=_0x15b918){_0x1f6a4d=_0x15b918;_0x59aab3=0xc8;}else{_0x59aab3=0xce;}_0x8efda5['status'](_0x59aab3);return _0x8efda5['set'](_0x9607('0x1c'),_0x1c9166+'-'+_0x1f6a4d+'/'+_0x15b918)[_0x9607('0x17')](_0x56b2e6);}return null;};}function patchUpdates(_0x51b049){return function(_0x31e11f){try{jsonpatch[_0x9607('0x1d')](_0x31e11f,_0x51b049,!![]);}catch(_0x14e2c4){return BPromise['reject'](_0x14e2c4);}return _0x31e11f['save']();};}function saveUpdates(_0x18048c,_0x34e557){return function(_0x4e70f9){if(_0x4e70f9){return _0x4e70f9[_0x9607('0x1e')](_0x18048c)['then'](function(_0x1e349f){return _0x1e349f;});}return null;};}function removeEntity(_0x4b4a70,_0x1ec9e2){return function(_0x3d6121){if(_0x3d6121){return _0x3d6121['destroy']()['then'](function(){_0x4b4a70['status'](0xcc)[_0x9607('0x16')]();});}};}function handleEntityNotFound(_0x381e10,_0x5b0274){return function(_0x5b5a9d){if(!_0x5b5a9d){_0x381e10[_0x9607('0x1f')](0x194);}return _0x5b5a9d;};}function handleError(_0x1e5e58,_0x2dcea3){_0x2dcea3=_0x2dcea3||0x1f4;return function(_0x363639){logger['error'](_0x363639[_0x9607('0x20')]);if(_0x363639[_0x9607('0x21')]){delete _0x363639['name'];}_0x1e5e58[_0x9607('0x15')](_0x2dcea3)[_0x9607('0x22')](_0x363639);};}exports[_0x9607('0x23')]=function(_0x2b803a,_0x4c6bb3){var _0x516a4f={},_0x38e1d4={},_0x3f3488={'count':0x0,'rows':[]};var _0x4dd6bb=_[_0x9607('0x24')](db['FreshsalesConfiguration'][_0x9607('0x25')],function(_0x3f5e03){return{'name':_0x3f5e03[_0x9607('0x26')],'type':_0x3f5e03['type'][_0x9607('0x27')]};});_0x38e1d4[_0x9607('0x28')]=_[_0x9607('0x24')](_0x4dd6bb,_0x9607('0x21'));_0x38e1d4[_0x9607('0x29')]=_[_0x9607('0x2a')](_0x2b803a['query']);_0x38e1d4[_0x9607('0x2b')]=_[_0x9607('0x2c')](_0x38e1d4['model'],_0x38e1d4['query']);_0x516a4f['attributes']=_[_0x9607('0x2c')](_0x38e1d4[_0x9607('0x28')],qs[_0x9607('0x2d')](_0x2b803a['query'][_0x9607('0x2d')]));_0x516a4f['attributes']=_0x516a4f['attributes'][_0x9607('0x2e')]?_0x516a4f[_0x9607('0x2f')]:_0x38e1d4[_0x9607('0x28')];if(!_0x2b803a[_0x9607('0x29')][_0x9607('0x30')]('nolimit')){_0x516a4f[_0x9607('0x1b')]=qs[_0x9607('0x1b')](_0x2b803a[_0x9607('0x29')][_0x9607('0x1b')]);_0x516a4f['offset']=qs['offset'](_0x2b803a[_0x9607('0x29')][_0x9607('0x18')]);}_0x516a4f[_0x9607('0x31')]=qs['sort'](_0x2b803a['query'][_0x9607('0x32')]);_0x516a4f[_0x9607('0x33')]=qs[_0x9607('0x2b')](_['pick'](_0x2b803a['query'],_0x38e1d4['filters']),_0x4dd6bb);if(_0x2b803a['query'][_0x9607('0x34')]){_0x516a4f[_0x9607('0x33')]=_[_0x9607('0x35')](_0x516a4f[_0x9607('0x33')],{'$or':_['map'](_0x4dd6bb,function(_0x5ba2d0){if(_0x5ba2d0[_0x9607('0x36')]!==_0x9607('0x37')){var _0x5dab06={};_0x5dab06[_0x5ba2d0[_0x9607('0x21')]]={'$like':'%'+_0x2b803a[_0x9607('0x29')][_0x9607('0x34')]+'%'};return _0x5dab06;}})});}_0x516a4f=_['merge']({},_0x516a4f,_0x2b803a[_0x9607('0x38')]);var _0x5c945f={'where':_0x516a4f[_0x9607('0x33')]};return db['FreshsalesConfiguration'][_0x9607('0x1a')](_0x5c945f)[_0x9607('0x39')](function(_0xab9f28){_0x3f3488[_0x9607('0x1a')]=_0xab9f28;if(_0x2b803a['query'][_0x9607('0x3a')]){_0x516a4f[_0x9607('0x3b')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x9607('0x3c')](_0x516a4f);})['then'](function(_0x1e5a8a){_0x3f3488[_0x9607('0x3d')]=_0x1e5a8a;return _0x3f3488;})[_0x9607('0x39')](respondWithFilteredResult(_0x4c6bb3,_0x516a4f))[_0x9607('0x3e')](handleError(_0x4c6bb3,null));};exports[_0x9607('0x3f')]=function(_0x5911f7,_0x36a45b){var _0x1479f1={'raw':![],'where':{'id':_0x5911f7['params']['id']}},_0x3f2c2f={};_0x3f2c2f[_0x9607('0x28')]=_['keys'](db['FreshsalesConfiguration'][_0x9607('0x25')]);_0x3f2c2f['query']=_['keys'](_0x5911f7[_0x9607('0x29')]);_0x3f2c2f[_0x9607('0x2b')]=_[_0x9607('0x2c')](_0x3f2c2f['model'],_0x3f2c2f['query']);_0x1479f1[_0x9607('0x2f')]=_[_0x9607('0x2c')](_0x3f2c2f[_0x9607('0x28')],qs[_0x9607('0x2d')](_0x5911f7[_0x9607('0x29')][_0x9607('0x2d')]));_0x1479f1['attributes']=_0x1479f1[_0x9607('0x2f')][_0x9607('0x2e')]?_0x1479f1[_0x9607('0x2f')]:_0x3f2c2f[_0x9607('0x28')];if(_0x5911f7[_0x9607('0x29')][_0x9607('0x3a')]){_0x1479f1['include']=[{'all':!![]}];}_0x1479f1=_[_0x9607('0x35')]({},_0x1479f1,_0x5911f7[_0x9607('0x38')]);return db[_0x9607('0x40')]['find'](_0x1479f1)[_0x9607('0x39')](handleEntityNotFound(_0x36a45b,null))[_0x9607('0x39')](respondWithResult(_0x36a45b,null))[_0x9607('0x3e')](handleError(_0x36a45b,null));};exports[_0x9607('0x41')]=function(_0x20f0fe,_0x55cf5c){return db[_0x9607('0x40')][_0x9607('0x41')](_0x20f0fe['body'],{})[_0x9607('0x39')](respondWithResult(_0x55cf5c,0xc9))['catch'](handleError(_0x55cf5c,null));};exports[_0x9607('0x1e')]=function(_0x3a4554,_0x5060b9){if(_0x3a4554['body']['id']){delete _0x3a4554['body']['id'];}return db[_0x9607('0x40')]['find']({'where':{'id':_0x3a4554[_0x9607('0x42')]['id']}})['then'](handleEntityNotFound(_0x5060b9,null))['then'](saveUpdates(_0x3a4554[_0x9607('0x43')],null))['then'](respondWithResult(_0x5060b9,null))[_0x9607('0x3e')](handleError(_0x5060b9,null));};exports[_0x9607('0x44')]=function(_0x5b0b98,_0x697122){return db['FreshsalesConfiguration'][_0x9607('0x45')]({'where':{'id':_0x5b0b98[_0x9607('0x42')]['id']}})[_0x9607('0x39')](handleEntityNotFound(_0x697122,null))[_0x9607('0x39')](removeEntity(_0x697122,null))[_0x9607('0x3e')](handleError(_0x697122,null));};exports['getSubjects']=function(_0x59c710,_0x2f433d,_0x3cd1f6){var _0x3c78c0={};var _0x4a9f2d={};var _0x8bdd0;var _0x574709;return db[_0x9607('0x40')]['findOne']({'where':{'id':_0x59c710['params']['id']}})[_0x9607('0x39')](handleEntityNotFound(_0x2f433d,null))[_0x9607('0x39')](function(_0xcf885b){if(_0xcf885b){_0x8bdd0=_0xcf885b;_0x4a9f2d[_0x9607('0x28')]=_['keys'](db['FreshsalesField'][_0x9607('0x25')]);_0x4a9f2d['query']=_[_0x9607('0x2a')](_0x59c710[_0x9607('0x29')]);_0x4a9f2d[_0x9607('0x2b')]=_[_0x9607('0x2c')](_0x4a9f2d[_0x9607('0x28')],_0x4a9f2d[_0x9607('0x29')]);_0x3c78c0[_0x9607('0x2f')]=_[_0x9607('0x2c')](_0x4a9f2d['model'],qs[_0x9607('0x2d')](_0x59c710[_0x9607('0x29')][_0x9607('0x2d')]));_0x3c78c0[_0x9607('0x2f')]=_0x3c78c0[_0x9607('0x2f')]['length']?_0x3c78c0[_0x9607('0x2f')]:_0x4a9f2d[_0x9607('0x28')];_0x3c78c0[_0x9607('0x31')]=qs[_0x9607('0x32')](_0x59c710[_0x9607('0x29')][_0x9607('0x32')]);_0x3c78c0[_0x9607('0x33')]=qs[_0x9607('0x2b')](_[_0x9607('0x46')](_0x59c710[_0x9607('0x29')],_0x4a9f2d[_0x9607('0x2b')]));if(_0x59c710[_0x9607('0x29')][_0x9607('0x34')]){_0x3c78c0['where']=_['merge'](_0x3c78c0[_0x9607('0x33')],{'$or':_['map'](_0x3c78c0[_0x9607('0x2f')],function(_0x3a6425){var _0x38f751={};_0x38f751[_0x3a6425]={'$like':'%'+_0x59c710[_0x9607('0x29')][_0x9607('0x34')]+'%'};return _0x38f751;})});}_0x3c78c0=_[_0x9607('0x35')]({},_0x3c78c0,_0x59c710[_0x9607('0x38')]);return _0x8bdd0[_0x9607('0x47')](_0x3c78c0);}})[_0x9607('0x39')](function(_0x25e0ad){if(_0x25e0ad){_0x574709=_0x25e0ad[_0x9607('0x2e')];if(!_0x59c710['query'][_0x9607('0x30')]('nolimit')){_0x3c78c0[_0x9607('0x1b')]=qs[_0x9607('0x1b')](_0x59c710[_0x9607('0x29')][_0x9607('0x1b')]);_0x3c78c0[_0x9607('0x18')]=qs[_0x9607('0x18')](_0x59c710[_0x9607('0x29')]['offset']);}return _0x8bdd0[_0x9607('0x47')](_0x3c78c0);}})[_0x9607('0x39')](function(_0x45918e){if(_0x45918e){return _0x45918e?{'count':_0x574709,'rows':_0x45918e}:null;}})[_0x9607('0x39')](respondWithResult(_0x2f433d,null))['catch'](handleError(_0x2f433d,null));};exports[_0x9607('0x48')]=function(_0x23b8a0,_0x3be6e0,_0x2129cf){var _0x4b0f38={};var _0x4eddd9={};var _0x3501d8;var _0x54d38b;return db[_0x9607('0x40')]['findOne']({'where':{'id':_0x23b8a0[_0x9607('0x42')]['id']}})[_0x9607('0x39')](handleEntityNotFound(_0x3be6e0,null))[_0x9607('0x39')](function(_0x546a61){if(_0x546a61){_0x3501d8=_0x546a61;_0x4eddd9[_0x9607('0x28')]=_[_0x9607('0x2a')](db[_0x9607('0x49')][_0x9607('0x25')]);_0x4eddd9['query']=_['keys'](_0x23b8a0[_0x9607('0x29')]);_0x4eddd9[_0x9607('0x2b')]=_['intersection'](_0x4eddd9['model'],_0x4eddd9[_0x9607('0x29')]);_0x4b0f38[_0x9607('0x2f')]=_[_0x9607('0x2c')](_0x4eddd9['model'],qs[_0x9607('0x2d')](_0x23b8a0[_0x9607('0x29')][_0x9607('0x2d')]));_0x4b0f38[_0x9607('0x2f')]=_0x4b0f38[_0x9607('0x2f')][_0x9607('0x2e')]?_0x4b0f38[_0x9607('0x2f')]:_0x4eddd9[_0x9607('0x28')];_0x4b0f38[_0x9607('0x31')]=qs[_0x9607('0x32')](_0x23b8a0[_0x9607('0x29')]['sort']);_0x4b0f38[_0x9607('0x33')]=qs['filters'](_[_0x9607('0x46')](_0x23b8a0[_0x9607('0x29')],_0x4eddd9[_0x9607('0x2b')]));if(_0x23b8a0[_0x9607('0x29')][_0x9607('0x34')]){_0x4b0f38[_0x9607('0x33')]=_[_0x9607('0x35')](_0x4b0f38[_0x9607('0x33')],{'$or':_[_0x9607('0x24')](_0x4b0f38['attributes'],function(_0x2d40f9){var _0x10243={};_0x10243[_0x2d40f9]={'$like':'%'+_0x23b8a0['query'][_0x9607('0x34')]+'%'};return _0x10243;})});}_0x4b0f38=_[_0x9607('0x35')]({},_0x4b0f38,_0x23b8a0[_0x9607('0x38')]);return _0x3501d8['getDescriptions'](_0x4b0f38);}})[_0x9607('0x39')](function(_0xccd54){if(_0xccd54){_0x54d38b=_0xccd54[_0x9607('0x2e')];if(!_0x23b8a0['query'][_0x9607('0x30')](_0x9607('0x4a'))){_0x4b0f38[_0x9607('0x1b')]=qs['limit'](_0x23b8a0[_0x9607('0x29')][_0x9607('0x1b')]);_0x4b0f38['offset']=qs[_0x9607('0x18')](_0x23b8a0['query'][_0x9607('0x18')]);}return _0x3501d8['getDescriptions'](_0x4b0f38);}})[_0x9607('0x39')](function(_0x548983){if(_0x548983){return _0x548983?{'count':_0x54d38b,'rows':_0x548983}:null;}})[_0x9607('0x39')](respondWithResult(_0x3be6e0,null))[_0x9607('0x3e')](handleError(_0x3be6e0,null));};exports['getFields']=function(_0x66e692,_0x20ab87,_0x1703e7){var _0x5dadff={};var _0x59ccd0={};var _0x255274;var _0x4a3a18;return db[_0x9607('0x40')]['findOne']({'where':{'id':_0x66e692[_0x9607('0x42')]['id']}})[_0x9607('0x39')](handleEntityNotFound(_0x20ab87,null))['then'](function(_0x20e8ee){if(_0x20e8ee){_0x255274=_0x20e8ee;_0x59ccd0[_0x9607('0x28')]=_[_0x9607('0x2a')](db[_0x9607('0x49')]['rawAttributes']);_0x59ccd0['query']=_['keys'](_0x66e692['query']);_0x59ccd0['filters']=_[_0x9607('0x2c')](_0x59ccd0[_0x9607('0x28')],_0x59ccd0[_0x9607('0x29')]);_0x5dadff[_0x9607('0x2f')]=_['intersection'](_0x59ccd0[_0x9607('0x28')],qs[_0x9607('0x2d')](_0x66e692[_0x9607('0x29')][_0x9607('0x2d')]));_0x5dadff[_0x9607('0x2f')]=_0x5dadff[_0x9607('0x2f')]['length']?_0x5dadff[_0x9607('0x2f')]:_0x59ccd0['model'];_0x5dadff['order']=qs[_0x9607('0x32')](_0x66e692[_0x9607('0x29')]['sort']);_0x5dadff[_0x9607('0x33')]=qs[_0x9607('0x2b')](_[_0x9607('0x46')](_0x66e692['query'],_0x59ccd0[_0x9607('0x2b')]));if(_0x66e692[_0x9607('0x29')][_0x9607('0x34')]){_0x5dadff['where']=_[_0x9607('0x35')](_0x5dadff[_0x9607('0x33')],{'$or':_[_0x9607('0x24')](_0x5dadff['attributes'],function(_0x4d16c7){var _0x41713d={};_0x41713d[_0x4d16c7]={'$like':'%'+_0x66e692[_0x9607('0x29')][_0x9607('0x34')]+'%'};return _0x41713d;})});}_0x5dadff=_[_0x9607('0x35')]({},_0x5dadff,_0x66e692['options']);return _0x255274['getFields'](_0x5dadff);}})[_0x9607('0x39')](function(_0x5961d9){if(_0x5961d9){_0x4a3a18=_0x5961d9['length'];if(!_0x66e692[_0x9607('0x29')]['hasOwnProperty'](_0x9607('0x4a'))){_0x5dadff[_0x9607('0x1b')]=qs[_0x9607('0x1b')](_0x66e692[_0x9607('0x29')][_0x9607('0x1b')]);_0x5dadff[_0x9607('0x18')]=qs[_0x9607('0x18')](_0x66e692[_0x9607('0x29')][_0x9607('0x18')]);}return _0x255274['getFields'](_0x5dadff);}})[_0x9607('0x39')](function(_0x1ecaf9){if(_0x1ecaf9){return _0x1ecaf9?{'count':_0x4a3a18,'rows':_0x1ecaf9}:null;}})[_0x9607('0x39')](respondWithResult(_0x20ab87,null))[_0x9607('0x3e')](handleError(_0x20ab87,null));};
\ No newline at end of file
index 12a49a2..025c7b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x975c=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x21001b,_0x3ff1a8){var _0x665a00=function(_0x98d912){while(--_0x98d912){_0x21001b['push'](_0x21001b['shift']());}};_0x665a00(++_0x3ff1a8);}(_0x975c,0x6e));var _0xc975=function(_0x1b31a1,_0x2a8b9a){_0x1b31a1=_0x1b31a1-0x0;var _0x26c40e=_0x975c[_0x1b31a1];return _0x26c40e;};'use strict';var _=require('lodash');var util=require(_0xc975('0x0'));var logger=require(_0xc975('0x1'))(_0xc975('0x2'));var moment=require('moment');var BPromise=require(_0xc975('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc975('0x4'));var rimraf=require(_0xc975('0x5'));var config=require(_0xc975('0x6'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xc975('0x7')]=function(_0x1b834c,_0x37d7f8){return _0x1b834c[_0xc975('0x8')](_0xc975('0x9'),attributes,{'tableName':_0xc975('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f80=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x39630b,_0x104727){var _0x4b4324=function(_0x43845e){while(--_0x43845e){_0x39630b['push'](_0x39630b['shift']());}};_0x4b4324(++_0x104727);}(_0x0f80,0x124));var _0x00f8=function(_0x4de833,_0xb5f88f){_0x4de833=_0x4de833-0x0;var _0x311453=_0x0f80[_0x4de833];return _0x311453;};'use strict';var _=require(_0x00f8('0x0'));var util=require(_0x00f8('0x1'));var logger=require('../../config/logger')(_0x00f8('0x2'));var moment=require(_0x00f8('0x3'));var BPromise=require('bluebird');var rp=require(_0x00f8('0x4'));var fs=require('fs');var path=require(_0x00f8('0x5'));var rimraf=require('rimraf');var config=require(_0x00f8('0x6'));var attributes=require(_0x00f8('0x7'));module[_0x00f8('0x8')]=function(_0x3a0670,_0x5b3a51){return _0x3a0670[_0x00f8('0x9')](_0x00f8('0xa'),attributes,{'tableName':_0x00f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5fbf907..1709a08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1196=['request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x293742,_0x42d41a){var _0x35852c=function(_0x131d27){while(--_0x131d27){_0x293742['push'](_0x293742['shift']());}};_0x35852c(++_0x42d41a);}(_0x1196,0x1e8));var _0x6119=function(_0x5d6b4b,_0x330bf5){_0x5d6b4b=_0x5d6b4b-0x0;var _0x52d504=_0x1196[_0x5d6b4b];return _0x52d504;};'use strict';var _=require(_0x6119('0x0'));var util=require(_0x6119('0x1'));var moment=require(_0x6119('0x2'));var BPromise=require(_0x6119('0x3'));var rs=require(_0x6119('0x4'));var fs=require('fs');var Redis=require(_0x6119('0x5'));var db=require(_0x6119('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6119('0x7'));var jayson=require(_0x6119('0x8'));var client=jayson[_0x6119('0x9')][_0x6119('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e636d,_0x2b8cd3,_0x25fa05){return new BPromise(function(_0xa6ffed,_0x4c1165){return client['request'](_0x3e636d,_0x25fa05)[_0x6119('0xb')](function(_0x1b1468){logger[_0x6119('0xc')](_0x6119('0xd'),_0x2b8cd3,'request\x20sent');logger[_0x6119('0xe')](_0x6119('0xf'),_0x2b8cd3,_0x6119('0x10'),JSON['stringify'](_0x1b1468));if(_0x1b1468['error']){if(_0x1b1468[_0x6119('0x11')][_0x6119('0x12')]===0x1f4){logger['error'](_0x6119('0xd'),_0x2b8cd3,_0x1b1468[_0x6119('0x11')][_0x6119('0x13')]);return _0x4c1165(_0x1b1468[_0x6119('0x11')][_0x6119('0x13')]);}logger['error'](_0x6119('0xd'),_0x2b8cd3,_0x1b1468[_0x6119('0x11')][_0x6119('0x13')]);return _0xa6ffed(_0x1b1468['error'][_0x6119('0x13')]);}else{logger[_0x6119('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2b8cd3,'request\x20sent');_0xa6ffed(_0x1b1468[_0x6119('0x14')][_0x6119('0x13')]);}})['catch'](function(_0x321596){logger[_0x6119('0x11')](_0x6119('0xd'),_0x2b8cd3,_0x321596);_0x4c1165(_0x321596);});});}
\ No newline at end of file
+var _0xa11d=['error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xa11d,0x8e));var _0xda11=function(_0x36e766,_0x4416eb){_0x36e766=_0x36e766-0x0;var _0x8bd1ea=_0xa11d[_0x36e766];return _0x8bd1ea;};'use strict';var _=require('lodash');var util=require(_0xda11('0x0'));var moment=require(_0xda11('0x1'));var BPromise=require(_0xda11('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda11('0x3'));var db=require(_0xda11('0x4'))['db'];var utils=require(_0xda11('0x5'));var logger=require(_0xda11('0x6'))(_0xda11('0x7'));var config=require(_0xda11('0x8'));var jayson=require(_0xda11('0x9'));var client=jayson[_0xda11('0xa')][_0xda11('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x262418,_0x303829,_0x5a25a6){return new BPromise(function(_0x5935e4,_0x343397){return client[_0xda11('0xc')](_0x262418,_0x5a25a6)[_0xda11('0xd')](function(_0x4eb4d8){logger[_0xda11('0xe')](_0xda11('0xf'),_0x303829,_0xda11('0x10'));logger[_0xda11('0x11')](_0xda11('0x12'),_0x303829,_0xda11('0x10'),JSON['stringify'](_0x4eb4d8));if(_0x4eb4d8[_0xda11('0x13')]){if(_0x4eb4d8[_0xda11('0x13')][_0xda11('0x14')]===0x1f4){logger[_0xda11('0x13')](_0xda11('0xf'),_0x303829,_0x4eb4d8[_0xda11('0x13')][_0xda11('0x15')]);return _0x343397(_0x4eb4d8[_0xda11('0x13')][_0xda11('0x15')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x303829,_0x4eb4d8[_0xda11('0x13')][_0xda11('0x15')]);return _0x5935e4(_0x4eb4d8[_0xda11('0x13')][_0xda11('0x15')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x303829,_0xda11('0x10'));_0x5935e4(_0x4eb4d8['result'][_0xda11('0x15')]);}})[_0xda11('0x16')](function(_0xed0aec){logger[_0xda11('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x303829,_0xed0aec);_0x343397(_0xed0aec);});});}
\ No newline at end of file
index e61db22..c3d53a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c6d=['index','get','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated'];(function(_0x563b5a,_0x41b996){var _0x13e490=function(_0x333242){while(--_0x333242){_0x563b5a['push'](_0x563b5a['shift']());}};_0x13e490(++_0x41b996);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x454732,_0x151a8f){_0x454732=_0x454732-0x0;var _0x130839=_0x0c6d[_0x454732];return _0x130839;};'use strict';var multer=require('multer');var util=require(_0xd0c6('0x0'));var path=require(_0xd0c6('0x1'));var timeout=require(_0xd0c6('0x2'));var express=require(_0xd0c6('0x3'));var router=express[_0xd0c6('0x4')]();var fs_extra=require(_0xd0c6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0c6('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0xd0c6('0x7')](),controller[_0xd0c6('0x8')]);router[_0xd0c6('0x9')]('/:id',auth[_0xd0c6('0x7')](),controller['show']);router[_0xd0c6('0xa')]('/',auth[_0xd0c6('0x7')](),controller[_0xd0c6('0xb')]);router[_0xd0c6('0xc')](_0xd0c6('0xd'),auth[_0xd0c6('0x7')](),controller[_0xd0c6('0xe')]);router[_0xd0c6('0xf')](_0xd0c6('0xd'),auth['isAuthenticated'](),controller[_0xd0c6('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x9a19=['./intFreshsalesField.controller','get','isAuthenticated','index','post','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57fc30,_0x3b317c){var _0x109be1=function(_0x44598f){while(--_0x44598f){_0x57fc30['push'](_0x57fc30['shift']());}};_0x109be1(++_0x3b317c);}(_0x9a19,0x114));var _0x99a1=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x9a19[_0x114b7c];return _0x47185f;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var fs_extra=require(_0x99a1('0x5'));var auth=require(_0x99a1('0x6'));var interaction=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var controller=require(_0x99a1('0x9'));router[_0x99a1('0xa')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xc')]);router[_0x99a1('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x99a1('0xd')]('/',auth[_0x99a1('0xb')](),controller['create']);router['put'](_0x99a1('0xe'),auth[_0x99a1('0xb')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x10')](_0x99a1('0xe'),auth['isAuthenticated'](),controller[_0x99a1('0x11')]);module[_0x99a1('0x12')]=router;
\ No newline at end of file
index f1f4d0a..ff9d2b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ed0=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x29e608,_0x1a6ccc){var _0x5d1d75=function(_0x15a6e4){while(--_0x15a6e4){_0x29e608['push'](_0x29e608['shift']());}};_0x5d1d75(++_0x1a6ccc);}(_0x1ed0,0x94));var _0x01ed=function(_0xf01579,_0x914885){_0xf01579=_0xf01579-0x0;var _0x146774=_0x1ed0[_0xf01579];return _0x146774;};'use strict';var Sequelize=require(_0x01ed('0x0'));module[_0x01ed('0x1')]={'type':{'type':Sequelize[_0x01ed('0x2')](_0x01ed('0x3'),_0x01ed('0x4'),_0x01ed('0x5'),_0x01ed('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x01ed('0x7')]},'key':{'type':Sequelize[_0x01ed('0x7')]},'keyType':{'type':Sequelize[_0x01ed('0x2')]('string',_0x01ed('0x4'),_0x01ed('0x5'))},'keyContent':{'type':Sequelize[_0x01ed('0x7')]},'idField':{'type':Sequelize[_0x01ed('0x7')]},'nameField':{'type':Sequelize[_0x01ed('0x7')]},'customField':{'type':Sequelize[_0x01ed('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3b33=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x37d0bc,_0x109b96){var _0x170e60=function(_0xae2ad){while(--_0xae2ad){_0x37d0bc['push'](_0x37d0bc['shift']());}};_0x170e60(++_0x109b96);}(_0x3b33,0x179));var _0x33b3=function(_0x3c680d,_0x134f87){_0x3c680d=_0x3c680d-0x0;var _0x4d1db9=_0x3b33[_0x3c680d];return _0x4d1db9;};'use strict';var Sequelize=require(_0x33b3('0x0'));module[_0x33b3('0x1')]={'type':{'type':Sequelize[_0x33b3('0x2')](_0x33b3('0x3'),_0x33b3('0x4'),_0x33b3('0x5'),_0x33b3('0x6'),_0x33b3('0x7')),'defaultValue':_0x33b3('0x3')},'content':{'type':Sequelize[_0x33b3('0x8')]},'key':{'type':Sequelize[_0x33b3('0x8')]},'keyType':{'type':Sequelize[_0x33b3('0x2')](_0x33b3('0x3'),_0x33b3('0x4'),_0x33b3('0x5'))},'keyContent':{'type':Sequelize[_0x33b3('0x8')]},'idField':{'type':Sequelize[_0x33b3('0x8')]},'nameField':{'type':Sequelize[_0x33b3('0x8')]},'customField':{'type':Sequelize[_0x33b3('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x33b3('0x8')]}};
\ No newline at end of file
index 1bec073..879f104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca74=['squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xca74,0x17e));var _0x4ca7=function(_0x3dedad,_0x435b1f){_0x3dedad=_0x3dedad-0x0;var _0x5470ba=_0xca74[_0x3dedad];return _0x5470ba;};'use strict';var emlformat=require(_0x4ca7('0x0'));var rimraf=require(_0x4ca7('0x1'));var zipdir=require(_0x4ca7('0x2'));var jsonpatch=require(_0x4ca7('0x3'));var rp=require(_0x4ca7('0x4'));var moment=require(_0x4ca7('0x5'));var BPromise=require(_0x4ca7('0x6'));var Mustache=require(_0x4ca7('0x7'));var util=require(_0x4ca7('0x8'));var path=require('path');var sox=require(_0x4ca7('0x9'));var csv=require(_0x4ca7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ca7('0xb'));var _=require(_0x4ca7('0xc'));var squel=require(_0x4ca7('0xd'));var crypto=require(_0x4ca7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4ca7('0xf'));var toCsv=require(_0x4ca7('0xa'));var querystring=require('querystring');var Papa=require(_0x4ca7('0x10'));var Redis=require(_0x4ca7('0x11'));var authService=require(_0x4ca7('0x12'));var qs=require(_0x4ca7('0x13'));var as=require(_0x4ca7('0x14'));var hardwareService=require(_0x4ca7('0x15'));var logger=require('../../config/logger')(_0x4ca7('0x16'));var utils=require(_0x4ca7('0x17'));var config=require(_0x4ca7('0x18'));var licenseUtil=require(_0x4ca7('0x19'));var db=require(_0x4ca7('0x1a'))['db'];function respondWithStatusCode(_0x242561,_0x3981f9){_0x3981f9=_0x3981f9||0xcc;return function(_0x3f9206){if(_0x3f9206){return _0x242561[_0x4ca7('0x1b')](_0x3981f9);}return _0x242561[_0x4ca7('0x1c')](_0x3981f9)[_0x4ca7('0x1d')]();};}function respondWithResult(_0x3afae1,_0x3a101a){_0x3a101a=_0x3a101a||0xc8;return function(_0x5c82c2){if(_0x5c82c2){return _0x3afae1[_0x4ca7('0x1c')](_0x3a101a)[_0x4ca7('0x1e')](_0x5c82c2);}};}function respondWithFilteredResult(_0x5b47bf,_0x521780){return function(_0x45f7ab){if(_0x45f7ab){var _0x3667e4=typeof _0x521780[_0x4ca7('0x1f')]===_0x4ca7('0x20')&&typeof _0x521780['limit']===_0x4ca7('0x20');var _0x50a691=_0x45f7ab[_0x4ca7('0x21')];var _0x2bc2e3=_0x3667e4?0x0:_0x521780[_0x4ca7('0x1f')];var _0x196a92=_0x3667e4?_0x45f7ab[_0x4ca7('0x21')]:_0x521780[_0x4ca7('0x1f')]+_0x521780[_0x4ca7('0x22')];var _0x408911;if(_0x196a92>=_0x50a691){_0x196a92=_0x50a691;_0x408911=0xc8;}else{_0x408911=0xce;}_0x5b47bf[_0x4ca7('0x1c')](_0x408911);return _0x5b47bf[_0x4ca7('0x23')](_0x4ca7('0x24'),_0x2bc2e3+'-'+_0x196a92+'/'+_0x50a691)[_0x4ca7('0x1e')](_0x45f7ab);}return null;};}function patchUpdates(_0x3abf10){return function(_0x198a1f){try{jsonpatch[_0x4ca7('0x25')](_0x198a1f,_0x3abf10,!![]);}catch(_0x3a94d4){return BPromise[_0x4ca7('0x26')](_0x3a94d4);}return _0x198a1f[_0x4ca7('0x27')]();};}function saveUpdates(_0x4a9018,_0x1b97d4){return function(_0x2d7f9a){if(_0x2d7f9a){return _0x2d7f9a[_0x4ca7('0x28')](_0x4a9018)['then'](function(_0x2d3802){return _0x2d3802;});}return null;};}function removeEntity(_0x8bdf84,_0x4dc1e6){return function(_0x1fcb57){if(_0x1fcb57){return _0x1fcb57[_0x4ca7('0x29')]()[_0x4ca7('0x2a')](function(){_0x8bdf84[_0x4ca7('0x1c')](0xcc)[_0x4ca7('0x1d')]();});}};}function handleEntityNotFound(_0x495090,_0x7628c7){return function(_0x3258ed){if(!_0x3258ed){_0x495090[_0x4ca7('0x1b')](0x194);}return _0x3258ed;};}function handleError(_0x1d5dee,_0x468bb6){_0x468bb6=_0x468bb6||0x1f4;return function(_0x2b644b){logger[_0x4ca7('0x2b')](_0x2b644b[_0x4ca7('0x2c')]);if(_0x2b644b[_0x4ca7('0x2d')]){delete _0x2b644b[_0x4ca7('0x2d')];}_0x1d5dee['status'](_0x468bb6)[_0x4ca7('0x2e')](_0x2b644b);};}exports[_0x4ca7('0x2f')]=function(_0x9016f7,_0x4ad697){var _0x185f01={},_0x973253={},_0x16d7d8={'count':0x0,'rows':[]};var _0x5a0ae7=_[_0x4ca7('0x30')](db[_0x4ca7('0x31')][_0x4ca7('0x32')],function(_0x34a037){return{'name':_0x34a037[_0x4ca7('0x33')],'type':_0x34a037[_0x4ca7('0x34')]['key']};});_0x973253[_0x4ca7('0x35')]=_[_0x4ca7('0x30')](_0x5a0ae7,_0x4ca7('0x2d'));_0x973253[_0x4ca7('0x36')]=_[_0x4ca7('0x37')](_0x9016f7['query']);_0x973253[_0x4ca7('0x38')]=_[_0x4ca7('0x39')](_0x973253[_0x4ca7('0x35')],_0x973253[_0x4ca7('0x36')]);_0x185f01[_0x4ca7('0x3a')]=_[_0x4ca7('0x39')](_0x973253[_0x4ca7('0x35')],qs[_0x4ca7('0x3b')](_0x9016f7['query'][_0x4ca7('0x3b')]));_0x185f01['attributes']=_0x185f01[_0x4ca7('0x3a')][_0x4ca7('0x3c')]?_0x185f01[_0x4ca7('0x3a')]:_0x973253['model'];if(!_0x9016f7[_0x4ca7('0x36')][_0x4ca7('0x3d')](_0x4ca7('0x3e'))){_0x185f01[_0x4ca7('0x22')]=qs['limit'](_0x9016f7[_0x4ca7('0x36')][_0x4ca7('0x22')]);_0x185f01[_0x4ca7('0x1f')]=qs[_0x4ca7('0x1f')](_0x9016f7[_0x4ca7('0x36')][_0x4ca7('0x1f')]);}_0x185f01[_0x4ca7('0x3f')]=qs['sort'](_0x9016f7[_0x4ca7('0x36')]['sort']);_0x185f01[_0x4ca7('0x40')]=qs['filters'](_[_0x4ca7('0x41')](_0x9016f7[_0x4ca7('0x36')],_0x973253[_0x4ca7('0x38')]),_0x5a0ae7);if(_0x9016f7[_0x4ca7('0x36')][_0x4ca7('0x42')]){_0x185f01['where']=_['merge'](_0x185f01[_0x4ca7('0x40')],{'$or':_[_0x4ca7('0x30')](_0x5a0ae7,function(_0x32242d){if(_0x32242d[_0x4ca7('0x34')]!==_0x4ca7('0x43')){var _0x453bdd={};_0x453bdd[_0x32242d['name']]={'$like':'%'+_0x9016f7[_0x4ca7('0x36')][_0x4ca7('0x42')]+'%'};return _0x453bdd;}})});}_0x185f01=_['merge']({},_0x185f01,_0x9016f7[_0x4ca7('0x44')]);var _0x2c300c={'where':_0x185f01[_0x4ca7('0x40')]};return db[_0x4ca7('0x31')][_0x4ca7('0x21')](_0x2c300c)[_0x4ca7('0x2a')](function(_0x24d17a){_0x16d7d8[_0x4ca7('0x21')]=_0x24d17a;if(_0x9016f7[_0x4ca7('0x36')][_0x4ca7('0x45')]){_0x185f01[_0x4ca7('0x46')]=[{'all':!![]}];}return db['FreshsalesField'][_0x4ca7('0x47')](_0x185f01);})[_0x4ca7('0x2a')](function(_0x1f8d8c){_0x16d7d8[_0x4ca7('0x48')]=_0x1f8d8c;return _0x16d7d8;})['then'](respondWithFilteredResult(_0x4ad697,_0x185f01))[_0x4ca7('0x49')](handleError(_0x4ad697,null));};exports[_0x4ca7('0x4a')]=function(_0x1db457,_0x47a4a8){var _0x222e96={'raw':!![],'where':{'id':_0x1db457[_0x4ca7('0x4b')]['id']}},_0x47532e={};_0x47532e[_0x4ca7('0x35')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x47532e[_0x4ca7('0x36')]=_['keys'](_0x1db457[_0x4ca7('0x36')]);_0x47532e[_0x4ca7('0x38')]=_[_0x4ca7('0x39')](_0x47532e[_0x4ca7('0x35')],_0x47532e[_0x4ca7('0x36')]);_0x222e96[_0x4ca7('0x3a')]=_['intersection'](_0x47532e[_0x4ca7('0x35')],qs['fields'](_0x1db457[_0x4ca7('0x36')][_0x4ca7('0x3b')]));_0x222e96['attributes']=_0x222e96[_0x4ca7('0x3a')]['length']?_0x222e96[_0x4ca7('0x3a')]:_0x47532e[_0x4ca7('0x35')];if(_0x1db457[_0x4ca7('0x36')][_0x4ca7('0x45')]){_0x222e96[_0x4ca7('0x46')]=[{'all':!![]}];}_0x222e96=_[_0x4ca7('0x4c')]({},_0x222e96,_0x1db457[_0x4ca7('0x44')]);return db[_0x4ca7('0x31')][_0x4ca7('0x4d')](_0x222e96)[_0x4ca7('0x2a')](handleEntityNotFound(_0x47a4a8,null))[_0x4ca7('0x2a')](respondWithResult(_0x47a4a8,null))[_0x4ca7('0x49')](handleError(_0x47a4a8,null));};exports['create']=function(_0x5b0572,_0x5a6e1d){return db['FreshsalesField']['create'](_0x5b0572[_0x4ca7('0x4e')],{})[_0x4ca7('0x2a')](respondWithResult(_0x5a6e1d,0xc9))['catch'](handleError(_0x5a6e1d,null));};exports['update']=function(_0x237825,_0x6e48b6){if(_0x237825[_0x4ca7('0x4e')]['id']){delete _0x237825[_0x4ca7('0x4e')]['id'];}return db[_0x4ca7('0x31')]['find']({'where':{'id':_0x237825[_0x4ca7('0x4b')]['id']}})[_0x4ca7('0x2a')](handleEntityNotFound(_0x6e48b6,null))['then'](saveUpdates(_0x237825[_0x4ca7('0x4e')],null))[_0x4ca7('0x2a')](respondWithResult(_0x6e48b6,null))[_0x4ca7('0x49')](handleError(_0x6e48b6,null));};exports[_0x4ca7('0x29')]=function(_0x339716,_0x5d384a){return db['FreshsalesField'][_0x4ca7('0x4d')]({'where':{'id':_0x339716[_0x4ca7('0x4b')]['id']}})[_0x4ca7('0x2a')](handleEntityNotFound(_0x5d384a,null))['then'](removeEntity(_0x5d384a,null))[_0x4ca7('0x49')](handleError(_0x5d384a,null));};
\ No newline at end of file
+var _0x56bd=['jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','stack','name','index','map','FreshsalesField','query','keys','filters','model','fields','attributes','length','sort','where','type','filter','merge','options','include','findAll','rows','params','rawAttributes','intersection','includeAll','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56bd,0x1d0));var _0xd56b=function(_0x4da58f,_0x397157){_0x4da58f=_0x4da58f-0x0;var _0x30beb9=_0x56bd[_0x4da58f];return _0x30beb9;};'use strict';var emlformat=require(_0xd56b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd56b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd56b('0x2'));var moment=require(_0xd56b('0x3'));var BPromise=require(_0xd56b('0x4'));var Mustache=require(_0xd56b('0x5'));var util=require(_0xd56b('0x6'));var path=require(_0xd56b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd56b('0x8'));var fs=require('fs');var fs_extra=require(_0xd56b('0x9'));var _=require('lodash');var squel=require(_0xd56b('0xa'));var crypto=require(_0xd56b('0xb'));var jsforce=require(_0xd56b('0xc'));var deskjs=require(_0xd56b('0xd'));var toCsv=require(_0xd56b('0xe'));var querystring=require('querystring');var Papa=require(_0xd56b('0xf'));var Redis=require('ioredis');var authService=require(_0xd56b('0x10'));var qs=require(_0xd56b('0x11'));var as=require(_0xd56b('0x12'));var hardwareService=require(_0xd56b('0x13'));var logger=require(_0xd56b('0x14'))('api');var utils=require(_0xd56b('0x15'));var config=require(_0xd56b('0x16'));var licenseUtil=require(_0xd56b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21018a,_0x4dc2de){_0x4dc2de=_0x4dc2de||0xcc;return function(_0x56bf72){if(_0x56bf72){return _0x21018a[_0xd56b('0x18')](_0x4dc2de);}return _0x21018a[_0xd56b('0x19')](_0x4dc2de)['end']();};}function respondWithResult(_0x33d7d2,_0x6f0393){_0x6f0393=_0x6f0393||0xc8;return function(_0x237c5d){if(_0x237c5d){return _0x33d7d2[_0xd56b('0x19')](_0x6f0393)[_0xd56b('0x1a')](_0x237c5d);}};}function respondWithFilteredResult(_0x3b0ff7,_0x3ccdb0){return function(_0x3efb30){if(_0x3efb30){var _0x18cdee=typeof _0x3ccdb0[_0xd56b('0x1b')]===_0xd56b('0x1c')&&typeof _0x3ccdb0[_0xd56b('0x1d')]==='undefined';var _0xda6e03=_0x3efb30[_0xd56b('0x1e')];var _0x13ac32=_0x18cdee?0x0:_0x3ccdb0[_0xd56b('0x1b')];var _0x4314c2=_0x18cdee?_0x3efb30[_0xd56b('0x1e')]:_0x3ccdb0['offset']+_0x3ccdb0['limit'];var _0x34465b;if(_0x4314c2>=_0xda6e03){_0x4314c2=_0xda6e03;_0x34465b=0xc8;}else{_0x34465b=0xce;}_0x3b0ff7[_0xd56b('0x19')](_0x34465b);return _0x3b0ff7[_0xd56b('0x1f')]('Content-Range',_0x13ac32+'-'+_0x4314c2+'/'+_0xda6e03)[_0xd56b('0x1a')](_0x3efb30);}return null;};}function patchUpdates(_0x5307ba){return function(_0x591caa){try{jsonpatch[_0xd56b('0x20')](_0x591caa,_0x5307ba,!![]);}catch(_0x57f0d2){return BPromise[_0xd56b('0x21')](_0x57f0d2);}return _0x591caa[_0xd56b('0x22')]();};}function saveUpdates(_0xcfce78,_0x5dda28){return function(_0x4199f3){if(_0x4199f3){return _0x4199f3['update'](_0xcfce78)[_0xd56b('0x23')](function(_0xe919e8){return _0xe919e8;});}return null;};}function removeEntity(_0x597a69,_0x209bbd){return function(_0x54de02){if(_0x54de02){return _0x54de02[_0xd56b('0x24')]()[_0xd56b('0x23')](function(){_0x597a69[_0xd56b('0x19')](0xcc)[_0xd56b('0x25')]();});}};}function handleEntityNotFound(_0x50f029,_0x53f142){return function(_0x27e31d){if(!_0x27e31d){_0x50f029[_0xd56b('0x18')](0x194);}return _0x27e31d;};}function handleError(_0x16477d,_0x5f0b6b){_0x5f0b6b=_0x5f0b6b||0x1f4;return function(_0x205600){logger[_0xd56b('0x26')](_0x205600[_0xd56b('0x27')]);if(_0x205600[_0xd56b('0x28')]){delete _0x205600[_0xd56b('0x28')];}_0x16477d[_0xd56b('0x19')](_0x5f0b6b)['send'](_0x205600);};}exports[_0xd56b('0x29')]=function(_0x3f876f,_0x4a768b){var _0x2f3f39={},_0x3f1089={},_0x147b41={'count':0x0,'rows':[]};var _0x108ec0=_[_0xd56b('0x2a')](db[_0xd56b('0x2b')]['rawAttributes'],function(_0x539df8){return{'name':_0x539df8['fieldName'],'type':_0x539df8['type']['key']};});_0x3f1089['model']=_[_0xd56b('0x2a')](_0x108ec0,'name');_0x3f1089[_0xd56b('0x2c')]=_[_0xd56b('0x2d')](_0x3f876f[_0xd56b('0x2c')]);_0x3f1089[_0xd56b('0x2e')]=_['intersection'](_0x3f1089['model'],_0x3f1089[_0xd56b('0x2c')]);_0x2f3f39['attributes']=_['intersection'](_0x3f1089[_0xd56b('0x2f')],qs['fields'](_0x3f876f[_0xd56b('0x2c')][_0xd56b('0x30')]));_0x2f3f39[_0xd56b('0x31')]=_0x2f3f39[_0xd56b('0x31')][_0xd56b('0x32')]?_0x2f3f39['attributes']:_0x3f1089[_0xd56b('0x2f')];if(!_0x3f876f[_0xd56b('0x2c')]['hasOwnProperty']('nolimit')){_0x2f3f39['limit']=qs[_0xd56b('0x1d')](_0x3f876f[_0xd56b('0x2c')][_0xd56b('0x1d')]);_0x2f3f39[_0xd56b('0x1b')]=qs[_0xd56b('0x1b')](_0x3f876f[_0xd56b('0x2c')][_0xd56b('0x1b')]);}_0x2f3f39['order']=qs[_0xd56b('0x33')](_0x3f876f[_0xd56b('0x2c')][_0xd56b('0x33')]);_0x2f3f39['where']=qs[_0xd56b('0x2e')](_['pick'](_0x3f876f[_0xd56b('0x2c')],_0x3f1089[_0xd56b('0x2e')]),_0x108ec0);if(_0x3f876f[_0xd56b('0x2c')]['filter']){_0x2f3f39['where']=_['merge'](_0x2f3f39[_0xd56b('0x34')],{'$or':_[_0xd56b('0x2a')](_0x108ec0,function(_0x23adc3){if(_0x23adc3[_0xd56b('0x35')]!=='VIRTUAL'){var _0x57b661={};_0x57b661[_0x23adc3['name']]={'$like':'%'+_0x3f876f['query'][_0xd56b('0x36')]+'%'};return _0x57b661;}})});}_0x2f3f39=_[_0xd56b('0x37')]({},_0x2f3f39,_0x3f876f[_0xd56b('0x38')]);var _0x123dbd={'where':_0x2f3f39[_0xd56b('0x34')]};return db[_0xd56b('0x2b')]['count'](_0x123dbd)['then'](function(_0x5ce991){_0x147b41[_0xd56b('0x1e')]=_0x5ce991;if(_0x3f876f['query']['includeAll']){_0x2f3f39[_0xd56b('0x39')]=[{'all':!![]}];}return db[_0xd56b('0x2b')][_0xd56b('0x3a')](_0x2f3f39);})[_0xd56b('0x23')](function(_0x546197){_0x147b41[_0xd56b('0x3b')]=_0x546197;return _0x147b41;})['then'](respondWithFilteredResult(_0x4a768b,_0x2f3f39))['catch'](handleError(_0x4a768b,null));};exports['show']=function(_0x411745,_0x1d27de){var _0x7057be={'raw':!![],'where':{'id':_0x411745[_0xd56b('0x3c')]['id']}},_0xe99c5f={};_0xe99c5f[_0xd56b('0x2f')]=_[_0xd56b('0x2d')](db[_0xd56b('0x2b')][_0xd56b('0x3d')]);_0xe99c5f[_0xd56b('0x2c')]=_[_0xd56b('0x2d')](_0x411745[_0xd56b('0x2c')]);_0xe99c5f[_0xd56b('0x2e')]=_[_0xd56b('0x3e')](_0xe99c5f[_0xd56b('0x2f')],_0xe99c5f[_0xd56b('0x2c')]);_0x7057be[_0xd56b('0x31')]=_[_0xd56b('0x3e')](_0xe99c5f[_0xd56b('0x2f')],qs[_0xd56b('0x30')](_0x411745[_0xd56b('0x2c')][_0xd56b('0x30')]));_0x7057be[_0xd56b('0x31')]=_0x7057be[_0xd56b('0x31')]['length']?_0x7057be[_0xd56b('0x31')]:_0xe99c5f[_0xd56b('0x2f')];if(_0x411745['query'][_0xd56b('0x3f')]){_0x7057be['include']=[{'all':!![]}];}_0x7057be=_[_0xd56b('0x37')]({},_0x7057be,_0x411745['options']);return db[_0xd56b('0x2b')][_0xd56b('0x40')](_0x7057be)[_0xd56b('0x23')](handleEntityNotFound(_0x1d27de,null))[_0xd56b('0x23')](respondWithResult(_0x1d27de,null))[_0xd56b('0x41')](handleError(_0x1d27de,null));};exports[_0xd56b('0x42')]=function(_0x1c6826,_0x1d6fb5){return db[_0xd56b('0x2b')]['create'](_0x1c6826[_0xd56b('0x43')],{})[_0xd56b('0x23')](respondWithResult(_0x1d6fb5,0xc9))[_0xd56b('0x41')](handleError(_0x1d6fb5,null));};exports['update']=function(_0x1af5e3,_0x52042a){if(_0x1af5e3[_0xd56b('0x43')]['id']){delete _0x1af5e3[_0xd56b('0x43')]['id'];}return db['FreshsalesField'][_0xd56b('0x40')]({'where':{'id':_0x1af5e3[_0xd56b('0x3c')]['id']}})[_0xd56b('0x23')](handleEntityNotFound(_0x52042a,null))[_0xd56b('0x23')](saveUpdates(_0x1af5e3[_0xd56b('0x43')],null))[_0xd56b('0x23')](respondWithResult(_0x52042a,null))[_0xd56b('0x41')](handleError(_0x52042a,null));};exports[_0xd56b('0x24')]=function(_0x230034,_0x4a7c80){return db[_0xd56b('0x2b')][_0xd56b('0x40')]({'where':{'id':_0x230034['params']['id']}})[_0xd56b('0x23')](handleEntityNotFound(_0x4a7c80,null))[_0xd56b('0x23')](removeEntity(_0x4a7c80,null))['catch'](handleError(_0x4a7c80,null));};
\ No newline at end of file
index f2b43bf..28ec411 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x084b=['define','FreshsalesField','idField','FieldId','lodash','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x5e6fe1,_0x8f80ad){var _0x5a6018=function(_0x1f1225){while(--_0x1f1225){_0x5e6fe1['push'](_0x5e6fe1['shift']());}};_0x5a6018(++_0x8f80ad);}(_0x084b,0xd5));var _0xb084=function(_0x449166,_0x35d5c7){_0x449166=_0x449166-0x0;var _0x37916d=_0x084b[_0x449166];return _0x37916d;};'use strict';var _=require(_0xb084('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb084('0x1'));var BPromise=require(_0xb084('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb084('0x3'));var rimraf=require(_0xb084('0x4'));var config=require(_0xb084('0x5'));var attributes=require('./intFreshsalesField.attributes');module[_0xb084('0x6')]=function(_0x50f465,_0x33728d){return _0x50f465[_0xb084('0x7')](_0xb084('0x8'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xb084('0x9'),_0xb084('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6da9=['freshsales_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intFreshsalesField.attributes','exports','define','int_freshsales_fields'];(function(_0x9a29db,_0x1b45fc){var _0x1391a2=function(_0x481228){while(--_0x481228){_0x9a29db['push'](_0x9a29db['shift']());}};_0x1391a2(++_0x1b45fc);}(_0x6da9,0x161));var _0x96da=function(_0x5432f7,_0x13b645){_0x5432f7=_0x5432f7-0x0;var _0x29f35c=_0x6da9[_0x5432f7];return _0x29f35c;};'use strict';var _=require(_0x96da('0x0'));var util=require(_0x96da('0x1'));var logger=require(_0x96da('0x2'))(_0x96da('0x3'));var moment=require(_0x96da('0x4'));var BPromise=require(_0x96da('0x5'));var rp=require(_0x96da('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x96da('0x7'));module[_0x96da('0x8')]=function(_0x26fdbb,_0x5c4924){return _0x26fdbb[_0x96da('0x9')]('FreshsalesField',attributes,{'tableName':_0x96da('0xa'),'paranoid':![],'indexes':[{'name':_0x96da('0xb'),'fields':[_0x96da('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 37f9320..53015a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x46ed,0x168));var _0xd46e=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x46ed[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var moment=require('moment');var BPromise=require(_0xd46e('0x2'));var rs=require(_0xd46e('0x3'));var fs=require('fs');var Redis=require(_0xd46e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd46e('0x5'));var logger=require(_0xd46e('0x6'))('rpc');var config=require(_0xd46e('0x7'));var jayson=require(_0xd46e('0x8'));var client=jayson[_0xd46e('0x9')][_0xd46e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){return client[_0xd46e('0xb')](_0x45e680,_0x437ea0)[_0xd46e('0xc')](function(_0x59c88d){logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,'request\x20sent');logger[_0xd46e('0xf')](_0xd46e('0x10'),_0x855f24,_0xd46e('0x11'),JSON[_0xd46e('0x12')](_0x59c88d));if(_0x59c88d[_0xd46e('0x13')]){if(_0x59c88d[_0xd46e('0x13')]['code']===0x1f4){logger[_0xd46e('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x855f24,_0x59c88d['error'][_0xd46e('0x14')]);return _0x31259b(_0x59c88d[_0xd46e('0x13')]['message']);}logger['error'](_0xd46e('0xe'),_0x855f24,_0x59c88d[_0xd46e('0x13')][_0xd46e('0x14')]);return _0x144687(_0x59c88d[_0xd46e('0x13')]['message']);}else{logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,_0xd46e('0x11'));_0x144687(_0x59c88d[_0xd46e('0x15')][_0xd46e('0x14')]);}})['catch'](function(_0x1d50a5){logger[_0xd46e('0x13')](_0xd46e('0xe'),_0x855f24,_0x1d50a5);_0x31259b(_0x1d50a5);});});}
\ No newline at end of file
+var _0xe2fe=['then','info','FreshsalesField,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x50baa9,_0x13b62f){var _0x45b4ad=function(_0x28410a){while(--_0x28410a){_0x50baa9['push'](_0x50baa9['shift']());}};_0x45b4ad(++_0x13b62f);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}
\ No newline at end of file
index 997514b..2041413 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x546e07,_0x383502){var _0x2463e2=function(_0x1e0701){while(--_0x1e0701){_0x546e07['push'](_0x546e07['shift']());}};_0x2463e2(++_0x383502);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x72d656,_0x85ae0d){var _0x1f44d4=function(_0x3b8c55){while(--_0x3b8c55){_0x72d656['push'](_0x72d656['shift']());}};_0x1f44d4(++_0x85ae0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 36a6a0c..5c942b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5aa=['ENUM','integrationTab','sequelize','exports','STRING','username'];(function(_0x3eb830,_0x10581e){var _0x4addb9=function(_0x130607){while(--_0x130607){_0x3eb830['push'](_0x3eb830['shift']());}};_0x4addb9(++_0x10581e);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x43eda8,_0x535405){_0x43eda8=_0x43eda8-0x0;var _0x3228c9=_0xa5aa[_0x43eda8];return _0x3228c9;};'use strict';var Sequelize=require(_0xaa5a('0x0'));module[_0xaa5a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaa5a('0x2')]},'username':{'type':Sequelize[_0xaa5a('0x2')],'unique':_0xaa5a('0x3')},'remoteUri':{'type':Sequelize[_0xaa5a('0x2')]},'password':{'type':Sequelize[_0xaa5a('0x2')]},'clientId':{'type':Sequelize[_0xaa5a('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xaa5a('0x2')]},'serverUrl':{'type':Sequelize[_0xaa5a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaa5a('0x4')]('integrationTab','newTab'),'defaultValue':_0xaa5a('0x5')}};
\ No newline at end of file
+var _0x652a=['STRING','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x2f36d2,_0x24285c){var _0x147f7f=function(_0x41db50){while(--_0x41db50){_0x2f36d2['push'](_0x2f36d2['shift']());}};_0x147f7f(++_0x24285c);}(_0x652a,0x1ae));var _0xa652=function(_0x279d96,_0x46e655){_0x279d96=_0x279d96-0x0;var _0x5c3441=_0x652a[_0x279d96];return _0x5c3441;};'use strict';var Sequelize=require(_0xa652('0x0'));module[_0xa652('0x1')]={'name':{'type':Sequelize[_0xa652('0x2')]},'description':{'type':Sequelize[_0xa652('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xa652('0x2')]},'password':{'type':Sequelize[_0xa652('0x2')]},'clientId':{'type':Sequelize[_0xa652('0x2')]},'clientSecret':{'type':Sequelize[_0xa652('0x2')]},'securityToken':{'type':Sequelize[_0xa652('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa652('0x3')](_0xa652('0x4'),_0xa652('0x5')),'defaultValue':_0xa652('0x4')}};
\ No newline at end of file
index 91adab7..e598708 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x442a=['../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','destroy','error','name','send','map','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','SalesforceAccount','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','findOne','order','getConfigurations','AccountId','Subjects','channel','type','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','Connection','login','password','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','boolean','phone','remove','includes','label','custom','picklistValues','value','True','true','test','stringify','statusCode','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x442a,0x13b));var _0xa442=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x442a[_0x43d16c];return _0x208cce;};'use strict';var emlformat=require(_0xa442('0x0'));var rimraf=require(_0xa442('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa442('0x2'));var rp=require('request-promise');var moment=require(_0xa442('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa442('0x4'));var util=require('util');var path=require(_0xa442('0x5'));var sox=require(_0xa442('0x6'));var csv=require(_0xa442('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa442('0x8'));var _=require(_0xa442('0x9'));var squel=require(_0xa442('0xa'));var crypto=require(_0xa442('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa442('0xc'));var Papa=require(_0xa442('0xd'));var Redis=require(_0xa442('0xe'));var authService=require(_0xa442('0xf'));var qs=require(_0xa442('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa442('0x11'));var logger=require(_0xa442('0x12'))(_0xa442('0x13'));var utils=require(_0xa442('0x14'));var config=require(_0xa442('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa442('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x42f2dc,_0x3c909c){_0x3c909c=_0x3c909c||0xcc;return function(_0x118ffc){if(_0x118ffc){return _0x42f2dc[_0xa442('0x17')](_0x3c909c);}return _0x42f2dc[_0xa442('0x18')](_0x3c909c)['end']();};}function respondWithResult(_0x1f82fa,_0x405278){_0x405278=_0x405278||0xc8;return function(_0xe86785){if(_0xe86785){return _0x1f82fa[_0xa442('0x18')](_0x405278)['json'](_0xe86785);}};}function respondWithFilteredResult(_0x710986,_0x411f03){return function(_0x595f8d){if(_0x595f8d){var _0x57ac97=typeof _0x411f03[_0xa442('0x19')]===_0xa442('0x1a')&&typeof _0x411f03['limit']===_0xa442('0x1a');var _0x1e5511=_0x595f8d[_0xa442('0x1b')];var _0x4ecaa6=_0x57ac97?0x0:_0x411f03[_0xa442('0x19')];var _0x2e7e61=_0x57ac97?_0x595f8d[_0xa442('0x1b')]:_0x411f03['offset']+_0x411f03[_0xa442('0x1c')];var _0x545783;if(_0x2e7e61>=_0x1e5511){_0x2e7e61=_0x1e5511;_0x545783=0xc8;}else{_0x545783=0xce;}_0x710986[_0xa442('0x18')](_0x545783);return _0x710986['set'](_0xa442('0x1d'),_0x4ecaa6+'-'+_0x2e7e61+'/'+_0x1e5511)[_0xa442('0x1e')](_0x595f8d);}return null;};}function patchUpdates(_0x209fc7){return function(_0x4fc995){try{jsonpatch[_0xa442('0x1f')](_0x4fc995,_0x209fc7,!![]);}catch(_0x4c8af5){return BPromise[_0xa442('0x20')](_0x4c8af5);}return _0x4fc995[_0xa442('0x21')]();};}function saveUpdates(_0xaf2173,_0x59f909){return function(_0x19ce36){if(_0x19ce36){return _0x19ce36['update'](_0xaf2173)[_0xa442('0x22')](function(_0x36ed6f){return _0x36ed6f;});}return null;};}function removeEntity(_0x57f9b2,_0x54d68f){return function(_0x1d4691){if(_0x1d4691){return _0x1d4691[_0xa442('0x23')]()[_0xa442('0x22')](function(){_0x57f9b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14e4f6,_0x47f3df){return function(_0x5e6105){if(!_0x5e6105){_0x14e4f6[_0xa442('0x17')](0x194);}return _0x5e6105;};}function handleError(_0x59dd7e,_0x1a1d88){_0x1a1d88=_0x1a1d88||0x1f4;return function(_0x1e450a){logger[_0xa442('0x24')](_0x1e450a['stack']);if(_0x1e450a['name']){delete _0x1e450a[_0xa442('0x25')];}_0x59dd7e['status'](_0x1a1d88)[_0xa442('0x26')](_0x1e450a);};}exports['index']=function(_0x2eae3d,_0x2101ba){var _0x5d535f={},_0x42af28={},_0x43bbc6={'count':0x0,'rows':[]};var _0x327de0=_[_0xa442('0x27')](db['SalesforceAccount']['rawAttributes'],function(_0x826211){return{'name':_0x826211[_0xa442('0x28')],'type':_0x826211['type']['key']};});_0x42af28[_0xa442('0x29')]=_[_0xa442('0x27')](_0x327de0,_0xa442('0x25'));_0x42af28['query']=_['keys'](_0x2eae3d[_0xa442('0x2a')]);_0x42af28[_0xa442('0x2b')]=_[_0xa442('0x2c')](_0x42af28['model'],_0x42af28[_0xa442('0x2a')]);_0x5d535f[_0xa442('0x2d')]=_['intersection'](_0x42af28[_0xa442('0x29')],qs[_0xa442('0x2e')](_0x2eae3d['query'][_0xa442('0x2e')]));_0x5d535f[_0xa442('0x2d')]=_0x5d535f[_0xa442('0x2d')][_0xa442('0x2f')]?_0x5d535f[_0xa442('0x2d')]:_0x42af28['model'];if(!_0x2eae3d[_0xa442('0x2a')][_0xa442('0x30')](_0xa442('0x31'))){_0x5d535f['limit']=qs[_0xa442('0x1c')](_0x2eae3d['query'][_0xa442('0x1c')]);_0x5d535f[_0xa442('0x19')]=qs[_0xa442('0x19')](_0x2eae3d[_0xa442('0x2a')][_0xa442('0x19')]);}_0x5d535f['order']=qs['sort'](_0x2eae3d[_0xa442('0x2a')][_0xa442('0x32')]);_0x5d535f[_0xa442('0x33')]=qs[_0xa442('0x2b')](_[_0xa442('0x34')](_0x2eae3d['query'],_0x42af28[_0xa442('0x2b')]),_0x327de0);if(_0x2eae3d['query']['filter']){_0x5d535f[_0xa442('0x33')]=_[_0xa442('0x35')](_0x5d535f[_0xa442('0x33')],{'$or':_[_0xa442('0x27')](_0x327de0,function(_0x5f333f){if(_0x5f333f['type']!=='VIRTUAL'){var _0x1dd9e1={};_0x1dd9e1[_0x5f333f[_0xa442('0x25')]]={'$like':'%'+_0x2eae3d['query'][_0xa442('0x36')]+'%'};return _0x1dd9e1;}})});}_0x5d535f=_[_0xa442('0x35')]({},_0x5d535f,_0x2eae3d[_0xa442('0x37')]);var _0x5ab4a7={'where':_0x5d535f[_0xa442('0x33')]};return db[_0xa442('0x38')][_0xa442('0x1b')](_0x5ab4a7)[_0xa442('0x22')](function(_0xb1ec33){_0x43bbc6[_0xa442('0x1b')]=_0xb1ec33;if(_0x2eae3d['query'][_0xa442('0x39')]){_0x5d535f[_0xa442('0x3a')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xa442('0x3b')](_0x5d535f);})[_0xa442('0x22')](function(_0x548861){_0x43bbc6['rows']=_0x548861;return _0x43bbc6;})['then'](respondWithFilteredResult(_0x2101ba,_0x5d535f))['catch'](handleError(_0x2101ba,null));};exports[_0xa442('0x3c')]=function(_0x23ff66,_0x27f8f6){var _0x20e886={'raw':![],'where':{'id':_0x23ff66[_0xa442('0x3d')]['id']}},_0x3f02a5={};_0x3f02a5[_0xa442('0x29')]=_[_0xa442('0x3e')](db[_0xa442('0x38')][_0xa442('0x3f')]);_0x3f02a5[_0xa442('0x2a')]=_[_0xa442('0x3e')](_0x23ff66[_0xa442('0x2a')]);_0x3f02a5[_0xa442('0x2b')]=_[_0xa442('0x2c')](_0x3f02a5[_0xa442('0x29')],_0x3f02a5[_0xa442('0x2a')]);_0x20e886[_0xa442('0x2d')]=_[_0xa442('0x2c')](_0x3f02a5[_0xa442('0x29')],qs[_0xa442('0x2e')](_0x23ff66[_0xa442('0x2a')][_0xa442('0x2e')]));_0x20e886['attributes']=_0x20e886[_0xa442('0x2d')][_0xa442('0x2f')]?_0x20e886['attributes']:_0x3f02a5['model'];if(_0x23ff66[_0xa442('0x2a')][_0xa442('0x39')]){_0x20e886[_0xa442('0x3a')]=[{'all':!![]}];}_0x20e886=_[_0xa442('0x35')]({},_0x20e886,_0x23ff66[_0xa442('0x37')]);return db[_0xa442('0x38')][_0xa442('0x40')](_0x20e886)[_0xa442('0x22')](handleEntityNotFound(_0x27f8f6,null))[_0xa442('0x22')](respondWithResult(_0x27f8f6,null))[_0xa442('0x41')](handleError(_0x27f8f6,null));};exports['create']=function(_0x1afa74,_0x1aa11f){return db[_0xa442('0x38')][_0xa442('0x42')](_0x1afa74[_0xa442('0x43')],{})[_0xa442('0x22')](respondWithResult(_0x1aa11f,0xc9))[_0xa442('0x41')](handleError(_0x1aa11f,null));};exports['update']=function(_0x2017f1,_0x145081){if(_0x2017f1[_0xa442('0x43')]['id']){delete _0x2017f1[_0xa442('0x43')]['id'];}return db[_0xa442('0x38')]['find']({'where':{'id':_0x2017f1[_0xa442('0x3d')]['id']}})[_0xa442('0x22')](handleEntityNotFound(_0x145081,null))['then'](saveUpdates(_0x2017f1[_0xa442('0x43')],null))['then'](respondWithResult(_0x145081,null))[_0xa442('0x41')](handleError(_0x145081,null));};exports['destroy']=function(_0x417f56,_0x16a5b0){return db[_0xa442('0x38')][_0xa442('0x40')]({'where':{'id':_0x417f56[_0xa442('0x3d')]['id']}})['then'](handleEntityNotFound(_0x16a5b0,null))['then'](removeEntity(_0x16a5b0,null))['catch'](handleError(_0x16a5b0,null));};exports['getConfigurations']=function(_0x254d65,_0x354db1,_0x581670){var _0x2bf632={};var _0x13b929={};var _0x3ce964;var _0x2c6e94;return db[_0xa442('0x38')][_0xa442('0x44')]({'where':{'id':_0x254d65[_0xa442('0x3d')]['id']}})[_0xa442('0x22')](handleEntityNotFound(_0x354db1,null))['then'](function(_0x410bcd){if(_0x410bcd){_0x3ce964=_0x410bcd;_0x13b929['model']=_[_0xa442('0x3e')](db['SalesforceConfiguration']['rawAttributes']);_0x13b929[_0xa442('0x2a')]=_[_0xa442('0x3e')](_0x254d65[_0xa442('0x2a')]);_0x13b929['filters']=_['intersection'](_0x13b929[_0xa442('0x29')],_0x13b929[_0xa442('0x2a')]);_0x2bf632[_0xa442('0x2d')]=_[_0xa442('0x2c')](_0x13b929[_0xa442('0x29')],qs[_0xa442('0x2e')](_0x254d65['query']['fields']));_0x2bf632[_0xa442('0x2d')]=_0x2bf632[_0xa442('0x2d')][_0xa442('0x2f')]?_0x2bf632[_0xa442('0x2d')]:_0x13b929['model'];_0x2bf632[_0xa442('0x45')]=qs[_0xa442('0x32')](_0x254d65[_0xa442('0x2a')]['sort']);_0x2bf632[_0xa442('0x33')]=qs[_0xa442('0x2b')](_[_0xa442('0x34')](_0x254d65[_0xa442('0x2a')],_0x13b929[_0xa442('0x2b')]));if(_0x254d65[_0xa442('0x2a')][_0xa442('0x36')]){_0x2bf632[_0xa442('0x33')]=_['merge'](_0x2bf632['where'],{'$or':_[_0xa442('0x27')](_0x2bf632[_0xa442('0x2d')],function(_0x6a5811){var _0x4597a8={};_0x4597a8[_0x6a5811]={'$like':'%'+_0x254d65[_0xa442('0x2a')][_0xa442('0x36')]+'%'};return _0x4597a8;})});}_0x2bf632=_[_0xa442('0x35')]({},_0x2bf632,_0x254d65[_0xa442('0x37')]);return _0x3ce964[_0xa442('0x46')](_0x2bf632);}})[_0xa442('0x22')](function(_0x355168){if(_0x355168){_0x2c6e94=_0x355168['length'];if(!_0x254d65[_0xa442('0x2a')][_0xa442('0x30')]('nolimit')){_0x2bf632[_0xa442('0x1c')]=qs[_0xa442('0x1c')](_0x254d65[_0xa442('0x2a')]['limit']);_0x2bf632['offset']=qs[_0xa442('0x19')](_0x254d65[_0xa442('0x2a')][_0xa442('0x19')]);}return _0x3ce964[_0xa442('0x46')](_0x2bf632);}})[_0xa442('0x22')](function(_0xca1fc7){if(_0xca1fc7){return _0xca1fc7?{'count':_0x2c6e94,'rows':_0xca1fc7}:null;}})[_0xa442('0x22')](respondWithResult(_0x354db1,null))[_0xa442('0x41')](handleError(_0x354db1,null));};exports['addConfiguration']=function(_0x113635,_0x17f3cc,_0x480954){if(_0x113635[_0xa442('0x43')]['id']){delete _0x113635[_0xa442('0x43')]['id'];}return db[_0xa442('0x38')][_0xa442('0x44')]({'where':{'id':_0x113635[_0xa442('0x3d')]['id']}})['then'](handleEntityNotFound(_0x17f3cc,null))['then'](function(_0x33118c){if(_0x33118c){_0x113635[_0xa442('0x43')][_0xa442('0x47')]=_0x33118c['id'];_0x113635[_0xa442('0x43')][_0xa442('0x48')]=integrations['getSubjects'](_0x113635[_0xa442('0x43')][_0xa442('0x49')],_0x113635[_0xa442('0x43')][_0xa442('0x4a')]);_0x113635['body'][_0xa442('0x4b')]=integrations[_0xa442('0x4c')](_0x113635[_0xa442('0x43')][_0xa442('0x49')],_0x113635[_0xa442('0x43')]['type']);return db['SalesforceConfiguration'][_0xa442('0x42')](_0x113635['body'],{'include':[{'model':db[_0xa442('0x4d')],'as':'Subjects'},{'model':db[_0xa442('0x4d')],'as':_0xa442('0x4b')}]});}return null;})['then'](respondWithResult(_0x17f3cc,null))[_0xa442('0x41')](handleError(_0x17f3cc,null));};exports[_0xa442('0x4e')]=function(_0x39bc42,_0x200072,_0x4f4f01){var _0xa690f2;var _0x509a8f='';var _0x149ac6=_0xa442('0x4f');return db['SalesforceAccount'][_0xa442('0x44')]({'where':{'id':_0x39bc42[_0xa442('0x3d')]['id']},'attributes':['id',_0xa442('0x50'),_0xa442('0x51'),_0xa442('0x52'),_0xa442('0x53'),'password',_0xa442('0x54')]})['then'](handleEntityNotFound(_0x200072,null))[_0xa442('0x22')](function(_0x2fa129){if(_0x2fa129){_0x509a8f=_0x2fa129[_0xa442('0x50')];var _0x35c5bc=_0x509a8f[_0xa442('0x55')](-0x1);if(_0x35c5bc==='/'){_0x509a8f=_0x509a8f['substring'](0x0,_0x509a8f['lastIndexOf'](_0x35c5bc));}_0xa690f2=new jsforce[(_0xa442('0x56'))]({'oauth2':{'loginUrl':_0x509a8f,'clientId':_0x2fa129[_0xa442('0x51')],'clientSecret':_0x2fa129[_0xa442('0x52')]}});return _0xa690f2[_0xa442('0x57')](_0x2fa129['username'],_0x2fa129[_0xa442('0x58')]['concat'](_0x2fa129[_0xa442('0x54')]));}})[_0xa442('0x22')](function(_0x4560bc){if(_0x4560bc){if(!_[_0xa442('0x59')](_0x39bc42['query'][_0xa442('0x5a')])){_0x149ac6=_0x39bc42[_0xa442('0x2a')]['ticketType'];}return _0xa690f2[_0xa442('0x5b')](_0x149ac6)[_0xa442('0x5c')]();}})[_0xa442('0x22')](function(_0x42a44a){var _0x45f969=[_0xa442('0x5d'),_0xa442('0x5e'),_0xa442('0x5f'),_0xa442('0x60'),_0xa442('0x61'),_0xa442('0x62')];var _0x35d635=['string','int','picklist',_0xa442('0x63'),'email','textarea',_0xa442('0x64')];if(_0x42a44a){_[_0xa442('0x65')](_0x42a44a[_0xa442('0x2e')],function(_0xdc8511){return _0x45f969[_0xa442('0x66')](_0xdc8511[_0xa442('0x25')])||!_0x35d635[_0xa442('0x66')](_0xdc8511[_0xa442('0x4a')]);});return{'count':_0x42a44a[_0xa442('0x2e')]['length'],'rows':_[_0xa442('0x27')](_0x42a44a[_0xa442('0x2e')],function(_0x3282dc){return{'id':_0x3282dc['name'],'name':_0x3282dc[_0xa442('0x67')],'custom':_0x3282dc[_0xa442('0x68')],'options':_0x3282dc[_0xa442('0x69')]['length']>0x0?_[_0xa442('0x27')](_0x3282dc[_0xa442('0x69')],function(_0x75d5a3){return{'name':_0x75d5a3[_0xa442('0x67')],'value':_0x75d5a3[_0xa442('0x6a')]};}):_0x3282dc['type']==_0xa442('0x63')?[{'name':_0xa442('0x6b'),'value':_0xa442('0x6c')},{'name':'False','value':'false'}]:[]};})};}})[_0xa442('0x22')](respondWithResult(_0x200072,null))[_0xa442('0x41')](function(_0x994443){var _0x3dbb68=_0x39bc42[_0xa442('0x2a')][_0xa442('0x6d')]?0x1f4:_0x994443['statusCode']||0x1f4;logger[_0xa442('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xa442('0x4e'),_0x3dbb68,JSON[_0xa442('0x6e')](_0x994443));delete _0x994443['name'];if(_0x3dbb68===0x191){_0x3dbb68=0x190;}_0x200072[_0xa442('0x18')](_0x3dbb68)[_0xa442('0x26')](_0x39bc42['query'][_0xa442('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x994443[_0xa442('0x6f')]}:_0x994443);});};
\ No newline at end of file
+var _0xb512=['create','getConfigurations','SalesforceConfiguration','order','addConfiguration','body','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','clientId','clientSecret','password','securityToken','remoteUri','substring','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','includes','picklistValues','label','true','False','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','stack','send','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','then','rows','catch','show','params','options','find'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xb512,0xb0));var _0x2b51=function(_0x50cadc,_0x5b04c6){_0x50cadc=_0x50cadc-0x0;var _0x46cd41=_0xb512[_0x50cadc];return _0x46cd41;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2b51('0x0'));var rp=require(_0x2b51('0x1'));var moment=require(_0x2b51('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2b51('0x3'));var util=require(_0x2b51('0x4'));var path=require(_0x2b51('0x5'));var sox=require(_0x2b51('0x6'));var csv=require(_0x2b51('0x7'));var ejs=require(_0x2b51('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b51('0x9'));var squel=require(_0x2b51('0xa'));var crypto=require(_0x2b51('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2b51('0xc'));var toCsv=require(_0x2b51('0x7'));var querystring=require(_0x2b51('0xd'));var Papa=require(_0x2b51('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2b51('0xf'));var as=require(_0x2b51('0x10'));var hardwareService=require(_0x2b51('0x11'));var logger=require('../../config/logger')(_0x2b51('0x12'));var utils=require(_0x2b51('0x13'));var config=require(_0x2b51('0x14'));var licenseUtil=require(_0x2b51('0x15'));var db=require(_0x2b51('0x16'))['db'];var integrations=require(_0x2b51('0x17'));function respondWithStatusCode(_0x5d6743,_0x482ee9){_0x482ee9=_0x482ee9||0xcc;return function(_0x20cdbf){if(_0x20cdbf){return _0x5d6743[_0x2b51('0x18')](_0x482ee9);}return _0x5d6743[_0x2b51('0x19')](_0x482ee9)[_0x2b51('0x1a')]();};}function respondWithResult(_0x878fb0,_0x41f45c){_0x41f45c=_0x41f45c||0xc8;return function(_0x3ddb1b){if(_0x3ddb1b){return _0x878fb0[_0x2b51('0x19')](_0x41f45c)[_0x2b51('0x1b')](_0x3ddb1b);}};}function respondWithFilteredResult(_0x44a711,_0x5df827){return function(_0x211dd0){if(_0x211dd0){var _0x8b814c=typeof _0x5df827['offset']===_0x2b51('0x1c')&&typeof _0x5df827[_0x2b51('0x1d')]===_0x2b51('0x1c');var _0x150ce4=_0x211dd0[_0x2b51('0x1e')];var _0x338f5b=_0x8b814c?0x0:_0x5df827[_0x2b51('0x1f')];var _0x597842=_0x8b814c?_0x211dd0['count']:_0x5df827[_0x2b51('0x1f')]+_0x5df827['limit'];var _0x558c7e;if(_0x597842>=_0x150ce4){_0x597842=_0x150ce4;_0x558c7e=0xc8;}else{_0x558c7e=0xce;}_0x44a711[_0x2b51('0x19')](_0x558c7e);return _0x44a711[_0x2b51('0x20')](_0x2b51('0x21'),_0x338f5b+'-'+_0x597842+'/'+_0x150ce4)[_0x2b51('0x1b')](_0x211dd0);}return null;};}function patchUpdates(_0x3f9b11){return function(_0x4881f4){try{jsonpatch['apply'](_0x4881f4,_0x3f9b11,!![]);}catch(_0x13b43d){return BPromise[_0x2b51('0x22')](_0x13b43d);}return _0x4881f4[_0x2b51('0x23')]();};}function saveUpdates(_0x40d61d,_0x220f06){return function(_0x4a016c){if(_0x4a016c){return _0x4a016c[_0x2b51('0x24')](_0x40d61d)['then'](function(_0x2e0637){return _0x2e0637;});}return null;};}function removeEntity(_0x1f9f2f,_0xeb9fbb){return function(_0xbf86ef){if(_0xbf86ef){return _0xbf86ef[_0x2b51('0x25')]()['then'](function(){_0x1f9f2f['status'](0xcc)[_0x2b51('0x1a')]();});}};}function handleEntityNotFound(_0x36e0ea,_0x497310){return function(_0x4e7c2c){if(!_0x4e7c2c){_0x36e0ea[_0x2b51('0x18')](0x194);}return _0x4e7c2c;};}function handleError(_0x11435e,_0xce4cd6){_0xce4cd6=_0xce4cd6||0x1f4;return function(_0x204b3f){logger['error'](_0x204b3f[_0x2b51('0x26')]);if(_0x204b3f['name']){delete _0x204b3f['name'];}_0x11435e[_0x2b51('0x19')](_0xce4cd6)[_0x2b51('0x27')](_0x204b3f);};}exports['index']=function(_0x2fe014,_0x1abd42){var _0x16267e={},_0x4280ee={},_0xbe8b0e={'count':0x0,'rows':[]};var _0xb47112=_[_0x2b51('0x28')](db[_0x2b51('0x29')][_0x2b51('0x2a')],function(_0x1aa98a){return{'name':_0x1aa98a[_0x2b51('0x2b')],'type':_0x1aa98a[_0x2b51('0x2c')][_0x2b51('0x2d')]};});_0x4280ee[_0x2b51('0x2e')]=_[_0x2b51('0x28')](_0xb47112,_0x2b51('0x2f'));_0x4280ee[_0x2b51('0x30')]=_[_0x2b51('0x31')](_0x2fe014[_0x2b51('0x30')]);_0x4280ee['filters']=_[_0x2b51('0x32')](_0x4280ee[_0x2b51('0x2e')],_0x4280ee[_0x2b51('0x30')]);_0x16267e[_0x2b51('0x33')]=_['intersection'](_0x4280ee[_0x2b51('0x2e')],qs[_0x2b51('0x34')](_0x2fe014['query'][_0x2b51('0x34')]));_0x16267e['attributes']=_0x16267e[_0x2b51('0x33')][_0x2b51('0x35')]?_0x16267e[_0x2b51('0x33')]:_0x4280ee[_0x2b51('0x2e')];if(!_0x2fe014[_0x2b51('0x30')][_0x2b51('0x36')]('nolimit')){_0x16267e[_0x2b51('0x1d')]=qs[_0x2b51('0x1d')](_0x2fe014[_0x2b51('0x30')]['limit']);_0x16267e[_0x2b51('0x1f')]=qs[_0x2b51('0x1f')](_0x2fe014[_0x2b51('0x30')][_0x2b51('0x1f')]);}_0x16267e['order']=qs[_0x2b51('0x37')](_0x2fe014['query']['sort']);_0x16267e[_0x2b51('0x38')]=qs[_0x2b51('0x39')](_[_0x2b51('0x3a')](_0x2fe014['query'],_0x4280ee[_0x2b51('0x39')]),_0xb47112);if(_0x2fe014[_0x2b51('0x30')][_0x2b51('0x3b')]){_0x16267e[_0x2b51('0x38')]=_[_0x2b51('0x3c')](_0x16267e[_0x2b51('0x38')],{'$or':_[_0x2b51('0x28')](_0xb47112,function(_0x17faa1){if(_0x17faa1[_0x2b51('0x2c')]!==_0x2b51('0x3d')){var _0x24bb86={};_0x24bb86[_0x17faa1['name']]={'$like':'%'+_0x2fe014['query'][_0x2b51('0x3b')]+'%'};return _0x24bb86;}})});}_0x16267e=_['merge']({},_0x16267e,_0x2fe014['options']);var _0x5cca56={'where':_0x16267e['where']};return db[_0x2b51('0x29')][_0x2b51('0x1e')](_0x5cca56)['then'](function(_0x30fa9b){_0xbe8b0e[_0x2b51('0x1e')]=_0x30fa9b;if(_0x2fe014[_0x2b51('0x30')][_0x2b51('0x3e')]){_0x16267e[_0x2b51('0x3f')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x2b51('0x40')](_0x16267e);})[_0x2b51('0x41')](function(_0x3d42b1){_0xbe8b0e[_0x2b51('0x42')]=_0x3d42b1;return _0xbe8b0e;})[_0x2b51('0x41')](respondWithFilteredResult(_0x1abd42,_0x16267e))[_0x2b51('0x43')](handleError(_0x1abd42,null));};exports[_0x2b51('0x44')]=function(_0x3c6f4b,_0x20c5e1){var _0x5dd41f={'raw':![],'where':{'id':_0x3c6f4b[_0x2b51('0x45')]['id']}},_0x1ca8d9={};_0x1ca8d9[_0x2b51('0x2e')]=_[_0x2b51('0x31')](db['SalesforceAccount']['rawAttributes']);_0x1ca8d9[_0x2b51('0x30')]=_[_0x2b51('0x31')](_0x3c6f4b[_0x2b51('0x30')]);_0x1ca8d9[_0x2b51('0x39')]=_[_0x2b51('0x32')](_0x1ca8d9['model'],_0x1ca8d9['query']);_0x5dd41f[_0x2b51('0x33')]=_[_0x2b51('0x32')](_0x1ca8d9[_0x2b51('0x2e')],qs[_0x2b51('0x34')](_0x3c6f4b['query'][_0x2b51('0x34')]));_0x5dd41f[_0x2b51('0x33')]=_0x5dd41f[_0x2b51('0x33')][_0x2b51('0x35')]?_0x5dd41f[_0x2b51('0x33')]:_0x1ca8d9[_0x2b51('0x2e')];if(_0x3c6f4b[_0x2b51('0x30')][_0x2b51('0x3e')]){_0x5dd41f['include']=[{'all':!![]}];}_0x5dd41f=_[_0x2b51('0x3c')]({},_0x5dd41f,_0x3c6f4b[_0x2b51('0x46')]);return db[_0x2b51('0x29')][_0x2b51('0x47')](_0x5dd41f)[_0x2b51('0x41')](handleEntityNotFound(_0x20c5e1,null))[_0x2b51('0x41')](respondWithResult(_0x20c5e1,null))[_0x2b51('0x43')](handleError(_0x20c5e1,null));};exports[_0x2b51('0x48')]=function(_0x2360e8,_0x2c888f){return db[_0x2b51('0x29')][_0x2b51('0x48')](_0x2360e8['body'],{})[_0x2b51('0x41')](respondWithResult(_0x2c888f,0xc9))[_0x2b51('0x43')](handleError(_0x2c888f,null));};exports['update']=function(_0x266ef8,_0x2b6fcb){if(_0x266ef8['body']['id']){delete _0x266ef8['body']['id'];}return db[_0x2b51('0x29')][_0x2b51('0x47')]({'where':{'id':_0x266ef8[_0x2b51('0x45')]['id']}})[_0x2b51('0x41')](handleEntityNotFound(_0x2b6fcb,null))[_0x2b51('0x41')](saveUpdates(_0x266ef8['body'],null))['then'](respondWithResult(_0x2b6fcb,null))[_0x2b51('0x43')](handleError(_0x2b6fcb,null));};exports[_0x2b51('0x25')]=function(_0x5c9af4,_0x2c765c){return db[_0x2b51('0x29')]['find']({'where':{'id':_0x5c9af4[_0x2b51('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c765c,null))[_0x2b51('0x41')](removeEntity(_0x2c765c,null))[_0x2b51('0x43')](handleError(_0x2c765c,null));};exports[_0x2b51('0x49')]=function(_0x13f76c,_0x255c9f,_0x5e8a96){var _0x1c1e47={};var _0x5b8ac2={};var _0xab1ecd;var _0x56ff98;return db[_0x2b51('0x29')]['findOne']({'where':{'id':_0x13f76c[_0x2b51('0x45')]['id']}})['then'](handleEntityNotFound(_0x255c9f,null))[_0x2b51('0x41')](function(_0x4677a0){if(_0x4677a0){_0xab1ecd=_0x4677a0;_0x5b8ac2[_0x2b51('0x2e')]=_['keys'](db[_0x2b51('0x4a')][_0x2b51('0x2a')]);_0x5b8ac2[_0x2b51('0x30')]=_[_0x2b51('0x31')](_0x13f76c[_0x2b51('0x30')]);_0x5b8ac2[_0x2b51('0x39')]=_['intersection'](_0x5b8ac2[_0x2b51('0x2e')],_0x5b8ac2[_0x2b51('0x30')]);_0x1c1e47[_0x2b51('0x33')]=_[_0x2b51('0x32')](_0x5b8ac2[_0x2b51('0x2e')],qs[_0x2b51('0x34')](_0x13f76c[_0x2b51('0x30')][_0x2b51('0x34')]));_0x1c1e47[_0x2b51('0x33')]=_0x1c1e47[_0x2b51('0x33')][_0x2b51('0x35')]?_0x1c1e47[_0x2b51('0x33')]:_0x5b8ac2[_0x2b51('0x2e')];_0x1c1e47[_0x2b51('0x4b')]=qs[_0x2b51('0x37')](_0x13f76c[_0x2b51('0x30')]['sort']);_0x1c1e47[_0x2b51('0x38')]=qs['filters'](_['pick'](_0x13f76c[_0x2b51('0x30')],_0x5b8ac2[_0x2b51('0x39')]));if(_0x13f76c[_0x2b51('0x30')]['filter']){_0x1c1e47[_0x2b51('0x38')]=_[_0x2b51('0x3c')](_0x1c1e47['where'],{'$or':_['map'](_0x1c1e47[_0x2b51('0x33')],function(_0x5dc9cd){var _0x1d5fed={};_0x1d5fed[_0x5dc9cd]={'$like':'%'+_0x13f76c['query'][_0x2b51('0x3b')]+'%'};return _0x1d5fed;})});}_0x1c1e47=_['merge']({},_0x1c1e47,_0x13f76c[_0x2b51('0x46')]);return _0xab1ecd[_0x2b51('0x49')](_0x1c1e47);}})[_0x2b51('0x41')](function(_0x10ce3e){if(_0x10ce3e){_0x56ff98=_0x10ce3e[_0x2b51('0x35')];if(!_0x13f76c[_0x2b51('0x30')][_0x2b51('0x36')]('nolimit')){_0x1c1e47['limit']=qs['limit'](_0x13f76c['query'][_0x2b51('0x1d')]);_0x1c1e47['offset']=qs['offset'](_0x13f76c[_0x2b51('0x30')][_0x2b51('0x1f')]);}return _0xab1ecd['getConfigurations'](_0x1c1e47);}})[_0x2b51('0x41')](function(_0x3886fc){if(_0x3886fc){return _0x3886fc?{'count':_0x56ff98,'rows':_0x3886fc}:null;}})[_0x2b51('0x41')](respondWithResult(_0x255c9f,null))[_0x2b51('0x43')](handleError(_0x255c9f,null));};exports[_0x2b51('0x4c')]=function(_0x7a81b8,_0x7ad0ef,_0x3a40e1){if(_0x7a81b8[_0x2b51('0x4d')]['id']){delete _0x7a81b8[_0x2b51('0x4d')]['id'];}return db[_0x2b51('0x29')][_0x2b51('0x4e')]({'where':{'id':_0x7a81b8[_0x2b51('0x45')]['id']}})[_0x2b51('0x41')](handleEntityNotFound(_0x7ad0ef,null))[_0x2b51('0x41')](function(_0x1f5d65){if(_0x1f5d65){_0x7a81b8[_0x2b51('0x4d')][_0x2b51('0x4f')]=_0x1f5d65['id'];_0x7a81b8['body'][_0x2b51('0x50')]=integrations[_0x2b51('0x51')](_0x7a81b8[_0x2b51('0x4d')][_0x2b51('0x52')],_0x7a81b8[_0x2b51('0x4d')][_0x2b51('0x2c')]);_0x7a81b8['body'][_0x2b51('0x53')]=integrations[_0x2b51('0x54')](_0x7a81b8[_0x2b51('0x4d')][_0x2b51('0x52')],_0x7a81b8[_0x2b51('0x4d')][_0x2b51('0x2c')]);return db[_0x2b51('0x4a')][_0x2b51('0x48')](_0x7a81b8['body'],{'include':[{'model':db[_0x2b51('0x55')],'as':_0x2b51('0x50')},{'model':db[_0x2b51('0x55')],'as':_0x2b51('0x53')}]});}return null;})[_0x2b51('0x41')](respondWithResult(_0x7ad0ef,null))[_0x2b51('0x43')](handleError(_0x7ad0ef,null));};exports[_0x2b51('0x56')]=function(_0x3fac91,_0x5b4bbd,_0x2dfcc2){var _0x4c159c;var _0x4c277='';var _0x567ae1=_0x2b51('0x57');return db[_0x2b51('0x29')][_0x2b51('0x4e')]({'where':{'id':_0x3fac91[_0x2b51('0x45')]['id']},'attributes':['id','remoteUri',_0x2b51('0x58'),_0x2b51('0x59'),'username',_0x2b51('0x5a'),_0x2b51('0x5b')]})['then'](handleEntityNotFound(_0x5b4bbd,null))[_0x2b51('0x41')](function(_0x54709d){if(_0x54709d){_0x4c277=_0x54709d[_0x2b51('0x5c')];var _0x35bd80=_0x4c277['slice'](-0x1);if(_0x35bd80==='/'){_0x4c277=_0x4c277[_0x2b51('0x5d')](0x0,_0x4c277['lastIndexOf'](_0x35bd80));}_0x4c159c=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4c277,'clientId':_0x54709d[_0x2b51('0x58')],'clientSecret':_0x54709d[_0x2b51('0x59')]}});return _0x4c159c[_0x2b51('0x5e')](_0x54709d['username'],_0x54709d[_0x2b51('0x5a')][_0x2b51('0x5f')](_0x54709d[_0x2b51('0x5b')]));}})['then'](function(_0xfc1a88){if(_0xfc1a88){if(!_[_0x2b51('0x60')](_0x3fac91['query'][_0x2b51('0x61')])){_0x567ae1=_0x3fac91['query'][_0x2b51('0x61')];}return _0x4c159c['sobject'](_0x567ae1)[_0x2b51('0x62')]();}})[_0x2b51('0x41')](function(_0x57b033){var _0x2e1f2c=[_0x2b51('0x63'),_0x2b51('0x64'),_0x2b51('0x65'),_0x2b51('0x66'),_0x2b51('0x67'),_0x2b51('0x68')];var _0x244971=[_0x2b51('0x69'),_0x2b51('0x6a'),_0x2b51('0x6b'),_0x2b51('0x6c'),_0x2b51('0x6d'),_0x2b51('0x6e'),_0x2b51('0x6f')];if(_0x57b033){_['remove'](_0x57b033[_0x2b51('0x34')],function(_0x238ddd){return _0x2e1f2c['includes'](_0x238ddd[_0x2b51('0x2f')])||!_0x244971[_0x2b51('0x70')](_0x238ddd[_0x2b51('0x2c')]);});return{'count':_0x57b033[_0x2b51('0x34')]['length'],'rows':_[_0x2b51('0x28')](_0x57b033[_0x2b51('0x34')],function(_0xb431ed){return{'id':_0xb431ed[_0x2b51('0x2f')],'name':_0xb431ed['label'],'custom':_0xb431ed['custom'],'options':_0xb431ed[_0x2b51('0x71')]['length']>0x0?_[_0x2b51('0x28')](_0xb431ed[_0x2b51('0x71')],function(_0x58077b){return{'name':_0x58077b[_0x2b51('0x72')],'value':_0x58077b['value']};}):_0xb431ed[_0x2b51('0x2c')]==_0x2b51('0x6c')?[{'name':'True','value':_0x2b51('0x73')},{'name':_0x2b51('0x74'),'value':_0x2b51('0x75')}]:[]};})};}})['then'](respondWithResult(_0x5b4bbd,null))[_0x2b51('0x43')](function(_0x425bdd){var _0x1e0e88=_0x3fac91[_0x2b51('0x30')][_0x2b51('0x76')]?0x1f4:_0x425bdd[_0x2b51('0x77')]||0x1f4;logger[_0x2b51('0x78')](_0x2b51('0x79'),_0x2b51('0x56'),_0x1e0e88,JSON[_0x2b51('0x7a')](_0x425bdd));delete _0x425bdd[_0x2b51('0x2f')];if(_0x1e0e88===0x191){_0x1e0e88=0x190;}_0x5b4bbd['status'](_0x1e0e88)[_0x2b51('0x27')](_0x3fac91['query'][_0x2b51('0x76')]?{'message':_0x2b51('0x7b'),'statusCode':_0x425bdd[_0x2b51('0x77')]}:_0x425bdd);});};
\ No newline at end of file
index 8c1fa72..d3dc720 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc411=['exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','request-promise','path','../../config/environment','../../components/integrations/configuration'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0xc411,0x1b4));var _0x1c41=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0xc411[_0x4bb145];return _0x4db596;};'use strict';var _=require('lodash');var util=require(_0x1c41('0x0'));var logger=require(_0x1c41('0x1'))(_0x1c41('0x2'));var moment=require(_0x1c41('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c41('0x4'));var fs=require('fs');var path=require(_0x1c41('0x5'));var rimraf=require('rimraf');var config=require(_0x1c41('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x1c41('0x7'));module[_0x1c41('0x8')]=function(_0x41c7fb,_0xa59e39){return _0x41c7fb[_0x1c41('0x9')](_0x1c41('0xa'),attributes,{'tableName':_0x1c41('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x99e9=['./intSalesforceAccount.attributes','exports','define','int_salesforce_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x18d719,_0x5da4dc){var _0x29e0fc=function(_0x21f5bc){while(--_0x21f5bc){_0x18d719['push'](_0x18d719['shift']());}};_0x29e0fc(++_0x5da4dc);}(_0x99e9,0xb4));var _0x999e=function(_0x188945,_0x2aafa5){_0x188945=_0x188945-0x0;var _0x4959c2=_0x99e9[_0x188945];return _0x4959c2;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x999e('0x8')]=function(_0x1bda0a,_0x100330){return _0x1bda0a[_0x999e('0x9')]('SalesforceAccount',attributes,{'tableName':_0x999e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dda5c4d..f00478f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59d5=['limit','map','include','model','then','ShowSalesforceAccount','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes'];(function(_0x1edce7,_0x1bdd0a){var _0x115073=function(_0x9f36b0){while(--_0x9f36b0){_0x1edce7['push'](_0x1edce7['shift']());}};_0x115073(++_0x1bdd0a);}(_0x59d5,0x130));var _0x559d=function(_0x3de79f,_0x32b799){_0x3de79f=_0x3de79f-0x0;var _0x14ae3d=_0x59d5[_0x3de79f];return _0x14ae3d;};'use strict';var _=require('lodash');var util=require(_0x559d('0x0'));var moment=require(_0x559d('0x1'));var BPromise=require(_0x559d('0x2'));var rs=require(_0x559d('0x3'));var fs=require('fs');var Redis=require(_0x559d('0x4'));var db=require(_0x559d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x559d('0x6'));var config=require(_0x559d('0x7'));var jayson=require(_0x559d('0x8'));var client=jayson[_0x559d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5284d3,_0x1576fc,_0x55b4d0){return new BPromise(function(_0x497722,_0x3f10de){return client[_0x559d('0xa')](_0x5284d3,_0x55b4d0)['then'](function(_0x3b6d0f){logger[_0x559d('0xb')](_0x559d('0xc'),_0x1576fc,_0x559d('0xd'));logger[_0x559d('0xe')](_0x559d('0xf'),_0x1576fc,_0x559d('0xd'),JSON[_0x559d('0x10')](_0x3b6d0f));if(_0x3b6d0f['error']){if(_0x3b6d0f[_0x559d('0x11')]['code']===0x1f4){logger[_0x559d('0x11')](_0x559d('0xc'),_0x1576fc,_0x3b6d0f[_0x559d('0x11')][_0x559d('0x12')]);return _0x3f10de(_0x3b6d0f[_0x559d('0x11')][_0x559d('0x12')]);}logger[_0x559d('0x11')](_0x559d('0xc'),_0x1576fc,_0x3b6d0f[_0x559d('0x11')][_0x559d('0x12')]);return _0x497722(_0x3b6d0f[_0x559d('0x11')][_0x559d('0x12')]);}else{logger[_0x559d('0xb')](_0x559d('0xc'),_0x1576fc,_0x559d('0xd'));_0x497722(_0x3b6d0f['result']['message']);}})[_0x559d('0x13')](function(_0x5ca53b){logger[_0x559d('0x11')](_0x559d('0xc'),_0x1576fc,_0x5ca53b);_0x3f10de(_0x5ca53b);});});}exports[_0x559d('0x14')]=function(_0x5c614d){var _0x5079a8=this;return new Promise(function(_0x2d0280,_0xd244b8){return db[_0x559d('0x15')][_0x559d('0x16')]({'raw':_0x5c614d[_0x559d('0x17')]?_0x5c614d['options']['raw']===undefined?!![]:![]:!![],'where':_0x5c614d['options']?_0x5c614d[_0x559d('0x17')][_0x559d('0x18')]||null:null,'attributes':_0x5c614d[_0x559d('0x17')]?_0x5c614d[_0x559d('0x17')][_0x559d('0x19')]||null:null,'limit':_0x5c614d[_0x559d('0x17')]?_0x5c614d['options'][_0x559d('0x1a')]||null:null,'include':_0x5c614d[_0x559d('0x17')]?_0x5c614d[_0x559d('0x17')]['include']?_[_0x559d('0x1b')](_0x5c614d[_0x559d('0x17')][_0x559d('0x1c')],function(_0x38ffc4){return{'model':db[_0x38ffc4[_0x559d('0x1d')]],'as':_0x38ffc4['as'],'attributes':_0x38ffc4[_0x559d('0x19')],'include':_0x38ffc4[_0x559d('0x1c')]?_[_0x559d('0x1b')](_0x38ffc4[_0x559d('0x1c')],function(_0x10c3b5){return{'model':db[_0x10c3b5[_0x559d('0x1d')]],'as':_0x10c3b5['as'],'attributes':_0x10c3b5[_0x559d('0x19')],'include':_0x10c3b5['include']?_[_0x559d('0x1b')](_0x10c3b5[_0x559d('0x1c')],function(_0x4f759b){return{'model':db[_0x4f759b['model']],'as':_0x4f759b['as'],'attributes':_0x4f759b[_0x559d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x559d('0x1e')](function(_0x28e273){logger[_0x559d('0xb')](_0x559d('0x14'),_0x5c614d);logger['debug'](_0x559d('0x14'),_0x5c614d,JSON[_0x559d('0x10')](_0x28e273));_0x2d0280(_0x28e273);})['catch'](function(_0x304724){logger[_0x559d('0x11')]('GetSalesforceAccount',_0x304724['message'],_0x5c614d);_0xd244b8(_0x5079a8['error'](0x1f4,_0x304724[_0x559d('0x12')]));});});};exports[_0x559d('0x1f')]=function(_0x1f59cc){var _0x131afc=this;return new Promise(function(_0x5980e6,_0x2bee53){return db[_0x559d('0x15')]['find']({'raw':_0x1f59cc['options']?_0x1f59cc[_0x559d('0x17')][_0x559d('0x20')]===undefined?!![]:![]:!![],'where':_0x1f59cc[_0x559d('0x17')]?_0x1f59cc['options'][_0x559d('0x18')]||null:null,'attributes':_0x1f59cc[_0x559d('0x17')]?_0x1f59cc[_0x559d('0x17')]['attributes']||null:null,'include':_0x1f59cc[_0x559d('0x17')]?_0x1f59cc['options'][_0x559d('0x1c')]?_[_0x559d('0x1b')](_0x1f59cc[_0x559d('0x17')][_0x559d('0x1c')],function(_0x42b8be){return{'model':db[_0x42b8be[_0x559d('0x1d')]],'as':_0x42b8be['as'],'attributes':_0x42b8be['attributes'],'include':_0x42b8be[_0x559d('0x1c')]?_['map'](_0x42b8be[_0x559d('0x1c')],function(_0x5dac4f){return{'model':db[_0x5dac4f[_0x559d('0x1d')]],'as':_0x5dac4f['as'],'attributes':_0x5dac4f[_0x559d('0x19')],'include':_0x5dac4f[_0x559d('0x1c')]?_['map'](_0x5dac4f[_0x559d('0x1c')],function(_0x5cf51e){return{'model':db[_0x5cf51e[_0x559d('0x1d')]],'as':_0x5cf51e['as'],'attributes':_0x5cf51e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x55dadf){logger[_0x559d('0xb')](_0x559d('0x1f'),_0x1f59cc);logger[_0x559d('0xe')](_0x559d('0x1f'),_0x1f59cc,JSON[_0x559d('0x10')](_0x55dadf));_0x5980e6(_0x55dadf);})[_0x559d('0x13')](function(_0x49825c){logger[_0x559d('0x11')]('ShowSalesforceAccount',_0x49825c[_0x559d('0x12')],_0x1f59cc);_0x2bee53(_0x131afc[_0x559d('0x11')](0x1f4,_0x49825c[_0x559d('0x12')]));});});};
\ No newline at end of file
+var _0xefa0=['../../config/logger','rpc','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSalesforceAccount','options','raw','where','attributes','include','map','model','ShowSalesforceAccount','SalesforceAccount','find','lodash','moment','ioredis','../../mysqldb'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0xefa0,0xb0));var _0x0efa=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xefa0[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x0efa('0x0'));var util=require('util');var moment=require(_0x0efa('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0efa('0x2'));var db=require(_0x0efa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0efa('0x4'))(_0x0efa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0efa('0x6')][_0x0efa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a5518,_0x121618,_0x2b05ad){return new BPromise(function(_0x24a7f9,_0x128d01){return client[_0x0efa('0x8')](_0x4a5518,_0x2b05ad)[_0x0efa('0x9')](function(_0x446cf7){logger[_0x0efa('0xa')](_0x0efa('0xb'),_0x121618,'request\x20sent');logger[_0x0efa('0xc')](_0x0efa('0xd'),_0x121618,'request\x20sent',JSON[_0x0efa('0xe')](_0x446cf7));if(_0x446cf7[_0x0efa('0xf')]){if(_0x446cf7[_0x0efa('0xf')]['code']===0x1f4){logger['error'](_0x0efa('0xb'),_0x121618,_0x446cf7[_0x0efa('0xf')][_0x0efa('0x10')]);return _0x128d01(_0x446cf7[_0x0efa('0xf')][_0x0efa('0x10')]);}logger[_0x0efa('0xf')](_0x0efa('0xb'),_0x121618,_0x446cf7['error'][_0x0efa('0x10')]);return _0x24a7f9(_0x446cf7['error'][_0x0efa('0x10')]);}else{logger[_0x0efa('0xa')](_0x0efa('0xb'),_0x121618,'request\x20sent');_0x24a7f9(_0x446cf7[_0x0efa('0x11')][_0x0efa('0x10')]);}})[_0x0efa('0x12')](function(_0xcc21ad){logger[_0x0efa('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x121618,_0xcc21ad);_0x128d01(_0xcc21ad);});});}exports[_0x0efa('0x13')]=function(_0x533128){var _0x35ba5a=this;return new Promise(function(_0x480d47,_0x2dbe7f){return db['SalesforceAccount']['findAll']({'raw':_0x533128[_0x0efa('0x14')]?_0x533128[_0x0efa('0x14')][_0x0efa('0x15')]===undefined?!![]:![]:!![],'where':_0x533128[_0x0efa('0x14')]?_0x533128[_0x0efa('0x14')][_0x0efa('0x16')]||null:null,'attributes':_0x533128[_0x0efa('0x14')]?_0x533128[_0x0efa('0x14')][_0x0efa('0x17')]||null:null,'limit':_0x533128['options']?_0x533128['options']['limit']||null:null,'include':_0x533128[_0x0efa('0x14')]?_0x533128['options'][_0x0efa('0x18')]?_[_0x0efa('0x19')](_0x533128['options'][_0x0efa('0x18')],function(_0xf109a8){return{'model':db[_0xf109a8[_0x0efa('0x1a')]],'as':_0xf109a8['as'],'attributes':_0xf109a8[_0x0efa('0x17')],'include':_0xf109a8[_0x0efa('0x18')]?_['map'](_0xf109a8[_0x0efa('0x18')],function(_0x44aeb2){return{'model':db[_0x44aeb2['model']],'as':_0x44aeb2['as'],'attributes':_0x44aeb2[_0x0efa('0x17')],'include':_0x44aeb2[_0x0efa('0x18')]?_[_0x0efa('0x19')](_0x44aeb2[_0x0efa('0x18')],function(_0x5ca164){return{'model':db[_0x5ca164[_0x0efa('0x1a')]],'as':_0x5ca164['as'],'attributes':_0x5ca164[_0x0efa('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0efa('0x9')](function(_0x3a7e3f){logger['info']('GetSalesforceAccount',_0x533128);logger[_0x0efa('0xc')](_0x0efa('0x13'),_0x533128,JSON[_0x0efa('0xe')](_0x3a7e3f));_0x480d47(_0x3a7e3f);})[_0x0efa('0x12')](function(_0x335a76){logger[_0x0efa('0xf')](_0x0efa('0x13'),_0x335a76[_0x0efa('0x10')],_0x533128);_0x2dbe7f(_0x35ba5a['error'](0x1f4,_0x335a76[_0x0efa('0x10')]));});});};exports[_0x0efa('0x1b')]=function(_0x4b6631){var _0x4c973a=this;return new Promise(function(_0x15c3ec,_0x4e0245){return db[_0x0efa('0x1c')][_0x0efa('0x1d')]({'raw':_0x4b6631['options']?_0x4b6631[_0x0efa('0x14')][_0x0efa('0x15')]===undefined?!![]:![]:!![],'where':_0x4b6631[_0x0efa('0x14')]?_0x4b6631[_0x0efa('0x14')]['where']||null:null,'attributes':_0x4b6631[_0x0efa('0x14')]?_0x4b6631[_0x0efa('0x14')]['attributes']||null:null,'include':_0x4b6631[_0x0efa('0x14')]?_0x4b6631[_0x0efa('0x14')][_0x0efa('0x18')]?_[_0x0efa('0x19')](_0x4b6631['options'][_0x0efa('0x18')],function(_0x20156e){return{'model':db[_0x20156e[_0x0efa('0x1a')]],'as':_0x20156e['as'],'attributes':_0x20156e[_0x0efa('0x17')],'include':_0x20156e[_0x0efa('0x18')]?_[_0x0efa('0x19')](_0x20156e[_0x0efa('0x18')],function(_0x1c7536){return{'model':db[_0x1c7536[_0x0efa('0x1a')]],'as':_0x1c7536['as'],'attributes':_0x1c7536[_0x0efa('0x17')],'include':_0x1c7536['include']?_[_0x0efa('0x19')](_0x1c7536[_0x0efa('0x18')],function(_0x5bfa6b){return{'model':db[_0x5bfa6b[_0x0efa('0x1a')]],'as':_0x5bfa6b['as'],'attributes':_0x5bfa6b[_0x0efa('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x108816){logger[_0x0efa('0xa')]('ShowSalesforceAccount',_0x4b6631);logger[_0x0efa('0xc')](_0x0efa('0x1b'),_0x4b6631,JSON[_0x0efa('0xe')](_0x108816));_0x15c3ec(_0x108816);})[_0x0efa('0x12')](function(_0x1ff371){logger[_0x0efa('0xf')](_0x0efa('0x1b'),_0x1ff371[_0x0efa('0x10')],_0x4b6631);_0x4e0245(_0x4c973a['error'](0x1f4,_0x1ff371[_0x0efa('0x10')]));});});};
\ No newline at end of file
index de1d5e4..40eb6c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2032,0xd9));var _0x2203=function(_0xb3f5ce,_0x851fe5){_0xb3f5ce=_0xb3f5ce-0x0;var _0x3eca32=_0x2032[_0xb3f5ce];return _0x3eca32;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router;
\ No newline at end of file
+var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x50c9d5,_0x1d915a){var _0x37704f=function(_0x26420f){while(--_0x26420f){_0x50c9d5['push'](_0x50c9d5['shift']());}};_0x37704f(++_0x1d915a);}(_0x2ef3,0xba));var _0x32ef=function(_0x534544,_0x30a8ae){_0x534544=_0x534544-0x0;var _0x265b5b=_0x2ef3[_0x534544];return _0x265b5b;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router;
\ No newline at end of file
index 1d29ee3..3892794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c4a=['STRING','Task','Case','contact_lead','contact','lead','account','ENUM','exports'];(function(_0x290a61,_0x25f5b6){var _0x558bae=function(_0x16c56e){while(--_0x16c56e){_0x290a61['push'](_0x290a61['shift']());}};_0x558bae(++_0x25f5b6);}(_0x0c4a,0xbc));var _0xa0c4=function(_0x303ce9,_0x7efb4a){_0x303ce9=_0x303ce9-0x0;var _0x5625a6=_0x0c4a[_0x303ce9];return _0x5625a6;};'use strict';var Sequelize=require('sequelize');module[_0xa0c4('0x0')]={'name':{'type':Sequelize[_0xa0c4('0x1')]},'description':{'type':Sequelize[_0xa0c4('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xa0c4('0x2'),_0xa0c4('0x3')),'defaultValue':_0xa0c4('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xa0c4('0x4'),_0xa0c4('0x5'),_0xa0c4('0x6'),'account_contact_lead',_0xa0c4('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xa0c4('0x8')]('nothing','contact',_0xa0c4('0x6'),_0xa0c4('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xa0c4('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xa0c4('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xa0c4('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xa0c4('0x1')]}};
\ No newline at end of file
+var _0xf923=['sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0x204eb7,_0x4974c3){var _0x37e444=function(_0x390613){while(--_0x390613){_0x204eb7['push'](_0x204eb7['shift']());}};_0x37e444(++_0x4974c3);}(_0xf923,0x1a4));var _0x3f92=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xf923[_0x352e09];return _0x1b7094;};'use strict';var Sequelize=require(_0x3f92('0x0'));module[_0x3f92('0x1')]={'name':{'type':Sequelize[_0x3f92('0x2')]},'description':{'type':Sequelize[_0x3f92('0x2')]},'ticketType':{'type':Sequelize[_0x3f92('0x3')](_0x3f92('0x4'),_0x3f92('0x5')),'defaultValue':_0x3f92('0x4')},'moduleSearch':{'type':Sequelize[_0x3f92('0x3')](_0x3f92('0x6'),_0x3f92('0x7'),_0x3f92('0x8'),_0x3f92('0x9'),_0x3f92('0xa')),'defaultValue':_0x3f92('0x6')},'moduleCreate':{'type':Sequelize[_0x3f92('0x3')](_0x3f92('0xb'),_0x3f92('0x7'),'lead',_0x3f92('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x3f92('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x3f92('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x3f92('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x3f92('0x2')]}};
\ No newline at end of file
index 063c093..125d12f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2865=['limit','count','offset','Content-Range','reject','save','update','then','error','stack','name','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','destroy','SalesforceField','pick','filter','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x2865,0x1b0));var _0x5286=function(_0x274b82,_0x3bf294){_0x274b82=_0x274b82-0x0;var _0x47250c=_0x2865[_0x274b82];return _0x47250c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5286('0x0'));var zipdir=require(_0x5286('0x1'));var jsonpatch=require(_0x5286('0x2'));var rp=require(_0x5286('0x3'));var moment=require(_0x5286('0x4'));var BPromise=require(_0x5286('0x5'));var Mustache=require(_0x5286('0x6'));var util=require(_0x5286('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5286('0x8'));var ejs=require(_0x5286('0x9'));var fs=require('fs');var fs_extra=require(_0x5286('0xa'));var _=require(_0x5286('0xb'));var squel=require('squel');var crypto=require(_0x5286('0xc'));var jsforce=require(_0x5286('0xd'));var deskjs=require(_0x5286('0xe'));var toCsv=require(_0x5286('0x8'));var querystring=require(_0x5286('0xf'));var Papa=require(_0x5286('0x10'));var Redis=require('ioredis');var authService=require(_0x5286('0x11'));var qs=require(_0x5286('0x12'));var as=require(_0x5286('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5286('0x14'))(_0x5286('0x15'));var utils=require('../../config/utils');var config=require(_0x5286('0x16'));var licenseUtil=require(_0x5286('0x17'));var db=require(_0x5286('0x18'))['db'];function respondWithStatusCode(_0x340c0b,_0x5841d9){_0x5841d9=_0x5841d9||0xcc;return function(_0xe3a061){if(_0xe3a061){return _0x340c0b[_0x5286('0x19')](_0x5841d9);}return _0x340c0b[_0x5286('0x1a')](_0x5841d9)[_0x5286('0x1b')]();};}function respondWithResult(_0x388e29,_0x331c97){_0x331c97=_0x331c97||0xc8;return function(_0x3d81e6){if(_0x3d81e6){return _0x388e29['status'](_0x331c97)[_0x5286('0x1c')](_0x3d81e6);}};}function respondWithFilteredResult(_0x142885,_0x3a9442){return function(_0x36096c){if(_0x36096c){var _0x4f4916=typeof _0x3a9442['offset']===_0x5286('0x1d')&&typeof _0x3a9442[_0x5286('0x1e')]===_0x5286('0x1d');var _0x34662b=_0x36096c[_0x5286('0x1f')];var _0x3498e7=_0x4f4916?0x0:_0x3a9442[_0x5286('0x20')];var _0x617864=_0x4f4916?_0x36096c[_0x5286('0x1f')]:_0x3a9442[_0x5286('0x20')]+_0x3a9442[_0x5286('0x1e')];var _0x3602b7;if(_0x617864>=_0x34662b){_0x617864=_0x34662b;_0x3602b7=0xc8;}else{_0x3602b7=0xce;}_0x142885[_0x5286('0x1a')](_0x3602b7);return _0x142885['set'](_0x5286('0x21'),_0x3498e7+'-'+_0x617864+'/'+_0x34662b)['json'](_0x36096c);}return null;};}function patchUpdates(_0x3a1329){return function(_0x1f3d66){try{jsonpatch['apply'](_0x1f3d66,_0x3a1329,!![]);}catch(_0x1f7d44){return BPromise[_0x5286('0x22')](_0x1f7d44);}return _0x1f3d66[_0x5286('0x23')]();};}function saveUpdates(_0x2a90b8,_0xd6c66b){return function(_0x1ae21b){if(_0x1ae21b){return _0x1ae21b[_0x5286('0x24')](_0x2a90b8)['then'](function(_0x1d99a9){return _0x1d99a9;});}return null;};}function removeEntity(_0x174ded,_0x1e5dac){return function(_0x144bd3){if(_0x144bd3){return _0x144bd3['destroy']()[_0x5286('0x25')](function(){_0x174ded[_0x5286('0x1a')](0xcc)[_0x5286('0x1b')]();});}};}function handleEntityNotFound(_0x404ed2,_0x3b30af){return function(_0x57b201){if(!_0x57b201){_0x404ed2[_0x5286('0x19')](0x194);}return _0x57b201;};}function handleError(_0x1432f6,_0x4b2b45){_0x4b2b45=_0x4b2b45||0x1f4;return function(_0xf3ec5b){logger[_0x5286('0x26')](_0xf3ec5b[_0x5286('0x27')]);if(_0xf3ec5b['name']){delete _0xf3ec5b[_0x5286('0x28')];}_0x1432f6['status'](_0x4b2b45)['send'](_0xf3ec5b);};}exports['index']=function(_0x532c5b,_0x542fd4){var _0x1760d9={},_0x2cbcdf={},_0x1b9f9e={'count':0x0,'rows':[]};var _0x2f8d74=_[_0x5286('0x29')](db[_0x5286('0x2a')][_0x5286('0x2b')],function(_0xcb11d4){return{'name':_0xcb11d4[_0x5286('0x2c')],'type':_0xcb11d4[_0x5286('0x2d')][_0x5286('0x2e')]};});_0x2cbcdf[_0x5286('0x2f')]=_['map'](_0x2f8d74,_0x5286('0x28'));_0x2cbcdf[_0x5286('0x30')]=_[_0x5286('0x31')](_0x532c5b[_0x5286('0x30')]);_0x2cbcdf[_0x5286('0x32')]=_[_0x5286('0x33')](_0x2cbcdf[_0x5286('0x2f')],_0x2cbcdf[_0x5286('0x30')]);_0x1760d9[_0x5286('0x34')]=_[_0x5286('0x33')](_0x2cbcdf[_0x5286('0x2f')],qs[_0x5286('0x35')](_0x532c5b[_0x5286('0x30')][_0x5286('0x35')]));_0x1760d9[_0x5286('0x34')]=_0x1760d9[_0x5286('0x34')]['length']?_0x1760d9['attributes']:_0x2cbcdf[_0x5286('0x2f')];if(!_0x532c5b[_0x5286('0x30')][_0x5286('0x36')]('nolimit')){_0x1760d9[_0x5286('0x1e')]=qs[_0x5286('0x1e')](_0x532c5b['query'][_0x5286('0x1e')]);_0x1760d9[_0x5286('0x20')]=qs[_0x5286('0x20')](_0x532c5b[_0x5286('0x30')][_0x5286('0x20')]);}_0x1760d9[_0x5286('0x37')]=qs[_0x5286('0x38')](_0x532c5b[_0x5286('0x30')][_0x5286('0x38')]);_0x1760d9['where']=qs['filters'](_['pick'](_0x532c5b[_0x5286('0x30')],_0x2cbcdf['filters']),_0x2f8d74);if(_0x532c5b[_0x5286('0x30')]['filter']){_0x1760d9[_0x5286('0x39')]=_[_0x5286('0x3a')](_0x1760d9[_0x5286('0x39')],{'$or':_['map'](_0x2f8d74,function(_0x2f320b){if(_0x2f320b['type']!=='VIRTUAL'){var _0x3ac06a={};_0x3ac06a[_0x2f320b['name']]={'$like':'%'+_0x532c5b[_0x5286('0x30')]['filter']+'%'};return _0x3ac06a;}})});}_0x1760d9=_[_0x5286('0x3a')]({},_0x1760d9,_0x532c5b[_0x5286('0x3b')]);var _0x3e64d1={'where':_0x1760d9[_0x5286('0x39')]};return db['SalesforceConfiguration'][_0x5286('0x1f')](_0x3e64d1)[_0x5286('0x25')](function(_0x4b4ca4){_0x1b9f9e[_0x5286('0x1f')]=_0x4b4ca4;if(_0x532c5b[_0x5286('0x30')][_0x5286('0x3c')]){_0x1760d9[_0x5286('0x3d')]=[{'all':!![]}];}return db[_0x5286('0x2a')][_0x5286('0x3e')](_0x1760d9);})[_0x5286('0x25')](function(_0x28ab8b){_0x1b9f9e[_0x5286('0x3f')]=_0x28ab8b;return _0x1b9f9e;})[_0x5286('0x25')](respondWithFilteredResult(_0x542fd4,_0x1760d9))[_0x5286('0x40')](handleError(_0x542fd4,null));};exports['show']=function(_0x587722,_0x14ad51){var _0x489deb={'raw':![],'where':{'id':_0x587722[_0x5286('0x41')]['id']}},_0x54fb9d={};_0x54fb9d['model']=_[_0x5286('0x31')](db[_0x5286('0x2a')][_0x5286('0x2b')]);_0x54fb9d[_0x5286('0x30')]=_[_0x5286('0x31')](_0x587722[_0x5286('0x30')]);_0x54fb9d[_0x5286('0x32')]=_['intersection'](_0x54fb9d[_0x5286('0x2f')],_0x54fb9d[_0x5286('0x30')]);_0x489deb[_0x5286('0x34')]=_[_0x5286('0x33')](_0x54fb9d['model'],qs[_0x5286('0x35')](_0x587722[_0x5286('0x30')][_0x5286('0x35')]));_0x489deb[_0x5286('0x34')]=_0x489deb[_0x5286('0x34')][_0x5286('0x42')]?_0x489deb[_0x5286('0x34')]:_0x54fb9d[_0x5286('0x2f')];if(_0x587722['query'][_0x5286('0x3c')]){_0x489deb[_0x5286('0x3d')]=[{'all':!![]}];}_0x489deb=_['merge']({},_0x489deb,_0x587722[_0x5286('0x3b')]);return db['SalesforceConfiguration'][_0x5286('0x43')](_0x489deb)[_0x5286('0x25')](handleEntityNotFound(_0x14ad51,null))['then'](respondWithResult(_0x14ad51,null))[_0x5286('0x40')](handleError(_0x14ad51,null));};exports[_0x5286('0x44')]=function(_0x22c831,_0x254986){return db['SalesforceConfiguration']['create'](_0x22c831[_0x5286('0x45')],{})[_0x5286('0x25')](respondWithResult(_0x254986,0xc9))['catch'](handleError(_0x254986,null));};exports[_0x5286('0x24')]=function(_0x344e76,_0x18f703){if(_0x344e76[_0x5286('0x45')]['id']){delete _0x344e76['body']['id'];}return db[_0x5286('0x2a')]['find']({'where':{'id':_0x344e76[_0x5286('0x41')]['id']}})[_0x5286('0x25')](handleEntityNotFound(_0x18f703,null))['then'](saveUpdates(_0x344e76[_0x5286('0x45')],null))[_0x5286('0x25')](respondWithResult(_0x18f703,null))[_0x5286('0x40')](handleError(_0x18f703,null));};exports[_0x5286('0x46')]=function(_0x471970,_0x2d74c3){return db[_0x5286('0x2a')][_0x5286('0x43')]({'where':{'id':_0x471970['params']['id']}})[_0x5286('0x25')](handleEntityNotFound(_0x2d74c3,null))[_0x5286('0x25')](removeEntity(_0x2d74c3,null))['catch'](handleError(_0x2d74c3,null));};exports['getFields']=function(_0x55449b,_0x1ae80c,_0x5be5b4){var _0x284c0e={};var _0x1ef95a={};var _0x1c54c3;var _0x5736ed;return db[_0x5286('0x2a')]['findOne']({'where':{'id':_0x55449b['params']['id']}})[_0x5286('0x25')](handleEntityNotFound(_0x1ae80c,null))[_0x5286('0x25')](function(_0x411bdc){if(_0x411bdc){_0x1c54c3=_0x411bdc;_0x1ef95a[_0x5286('0x2f')]=_[_0x5286('0x31')](db[_0x5286('0x47')][_0x5286('0x2b')]);_0x1ef95a[_0x5286('0x30')]=_[_0x5286('0x31')](_0x55449b[_0x5286('0x30')]);_0x1ef95a[_0x5286('0x32')]=_[_0x5286('0x33')](_0x1ef95a[_0x5286('0x2f')],_0x1ef95a[_0x5286('0x30')]);_0x284c0e['attributes']=_[_0x5286('0x33')](_0x1ef95a[_0x5286('0x2f')],qs[_0x5286('0x35')](_0x55449b[_0x5286('0x30')][_0x5286('0x35')]));_0x284c0e[_0x5286('0x34')]=_0x284c0e[_0x5286('0x34')][_0x5286('0x42')]?_0x284c0e[_0x5286('0x34')]:_0x1ef95a[_0x5286('0x2f')];_0x284c0e['order']=qs['sort'](_0x55449b[_0x5286('0x30')]['sort']);_0x284c0e[_0x5286('0x39')]=qs[_0x5286('0x32')](_[_0x5286('0x48')](_0x55449b['query'],_0x1ef95a[_0x5286('0x32')]));if(_0x55449b[_0x5286('0x30')][_0x5286('0x49')]){_0x284c0e[_0x5286('0x39')]=_[_0x5286('0x3a')](_0x284c0e['where'],{'$or':_[_0x5286('0x29')](_0x284c0e[_0x5286('0x34')],function(_0x270266){var _0x575788={};_0x575788[_0x270266]={'$like':'%'+_0x55449b[_0x5286('0x30')][_0x5286('0x49')]+'%'};return _0x575788;})});}_0x284c0e=_[_0x5286('0x3a')]({},_0x284c0e,_0x55449b[_0x5286('0x3b')]);return _0x1c54c3['getFields'](_0x284c0e);}})['then'](function(_0x5667c3){if(_0x5667c3){_0x5736ed=_0x5667c3[_0x5286('0x42')];if(!_0x55449b['query'][_0x5286('0x36')](_0x5286('0x4a'))){_0x284c0e[_0x5286('0x1e')]=qs['limit'](_0x55449b['query'][_0x5286('0x1e')]);_0x284c0e['offset']=qs['offset'](_0x55449b[_0x5286('0x30')][_0x5286('0x20')]);}return _0x1c54c3['getFields'](_0x284c0e);}})[_0x5286('0x25')](function(_0x17d3d7){if(_0x17d3d7){return _0x17d3d7?{'count':_0x5736ed,'rows':_0x17d3d7}:null;}})[_0x5286('0x25')](respondWithResult(_0x1ae80c,null))[_0x5286('0x40')](handleError(_0x1ae80c,null));};exports[_0x5286('0x4b')]=function(_0x2b4933,_0x4395a6,_0x1f37f2){var _0x76021d={};var _0x4fdce0={};var _0x501277;var _0x2897e6;return db[_0x5286('0x2a')]['findOne']({'where':{'id':_0x2b4933[_0x5286('0x41')]['id']}})[_0x5286('0x25')](handleEntityNotFound(_0x4395a6,null))[_0x5286('0x25')](function(_0x3e036f){if(_0x3e036f){_0x501277=_0x3e036f;_0x4fdce0[_0x5286('0x2f')]=_['keys'](db[_0x5286('0x47')]['rawAttributes']);_0x4fdce0[_0x5286('0x30')]=_[_0x5286('0x31')](_0x2b4933[_0x5286('0x30')]);_0x4fdce0[_0x5286('0x32')]=_[_0x5286('0x33')](_0x4fdce0['model'],_0x4fdce0[_0x5286('0x30')]);_0x76021d['attributes']=_[_0x5286('0x33')](_0x4fdce0['model'],qs[_0x5286('0x35')](_0x2b4933[_0x5286('0x30')][_0x5286('0x35')]));_0x76021d[_0x5286('0x34')]=_0x76021d[_0x5286('0x34')][_0x5286('0x42')]?_0x76021d['attributes']:_0x4fdce0[_0x5286('0x2f')];_0x76021d[_0x5286('0x37')]=qs['sort'](_0x2b4933['query'][_0x5286('0x38')]);_0x76021d['where']=qs[_0x5286('0x32')](_[_0x5286('0x48')](_0x2b4933[_0x5286('0x30')],_0x4fdce0[_0x5286('0x32')]));if(_0x2b4933['query'][_0x5286('0x49')]){_0x76021d[_0x5286('0x39')]=_['merge'](_0x76021d[_0x5286('0x39')],{'$or':_[_0x5286('0x29')](_0x76021d[_0x5286('0x34')],function(_0x51eeab){var _0x255fc3={};_0x255fc3[_0x51eeab]={'$like':'%'+_0x2b4933[_0x5286('0x30')][_0x5286('0x49')]+'%'};return _0x255fc3;})});}_0x76021d=_[_0x5286('0x3a')]({},_0x76021d,_0x2b4933[_0x5286('0x3b')]);return _0x501277[_0x5286('0x4b')](_0x76021d);}})[_0x5286('0x25')](function(_0x520da3){if(_0x520da3){_0x2897e6=_0x520da3[_0x5286('0x42')];if(!_0x2b4933[_0x5286('0x30')][_0x5286('0x36')](_0x5286('0x4a'))){_0x76021d['limit']=qs['limit'](_0x2b4933[_0x5286('0x30')][_0x5286('0x1e')]);_0x76021d[_0x5286('0x20')]=qs['offset'](_0x2b4933[_0x5286('0x30')][_0x5286('0x20')]);}return _0x501277['getSubjects'](_0x76021d);}})[_0x5286('0x25')](function(_0xca5eb){if(_0xca5eb){return _0xca5eb?{'count':_0x2897e6,'rows':_0xca5eb}:null;}})[_0x5286('0x25')](respondWithResult(_0x4395a6,null))['catch'](handleError(_0x4395a6,null));};exports[_0x5286('0x4c')]=function(_0x56fb29,_0x5ba9c0,_0x4ef66e){var _0x5dc96f={};var _0x4ca970={};var _0x47eb73;var _0x439f12;return db[_0x5286('0x2a')]['findOne']({'where':{'id':_0x56fb29['params']['id']}})[_0x5286('0x25')](handleEntityNotFound(_0x5ba9c0,null))['then'](function(_0x25ba4d){if(_0x25ba4d){_0x47eb73=_0x25ba4d;_0x4ca970[_0x5286('0x2f')]=_[_0x5286('0x31')](db[_0x5286('0x47')][_0x5286('0x2b')]);_0x4ca970[_0x5286('0x30')]=_[_0x5286('0x31')](_0x56fb29[_0x5286('0x30')]);_0x4ca970['filters']=_[_0x5286('0x33')](_0x4ca970[_0x5286('0x2f')],_0x4ca970[_0x5286('0x30')]);_0x5dc96f[_0x5286('0x34')]=_[_0x5286('0x33')](_0x4ca970[_0x5286('0x2f')],qs[_0x5286('0x35')](_0x56fb29[_0x5286('0x30')]['fields']));_0x5dc96f[_0x5286('0x34')]=_0x5dc96f['attributes']['length']?_0x5dc96f[_0x5286('0x34')]:_0x4ca970[_0x5286('0x2f')];_0x5dc96f[_0x5286('0x37')]=qs['sort'](_0x56fb29[_0x5286('0x30')]['sort']);_0x5dc96f[_0x5286('0x39')]=qs[_0x5286('0x32')](_[_0x5286('0x48')](_0x56fb29[_0x5286('0x30')],_0x4ca970[_0x5286('0x32')]));if(_0x56fb29['query']['filter']){_0x5dc96f['where']=_[_0x5286('0x3a')](_0x5dc96f[_0x5286('0x39')],{'$or':_[_0x5286('0x29')](_0x5dc96f[_0x5286('0x34')],function(_0x21f638){var _0x59fa9f={};_0x59fa9f[_0x21f638]={'$like':'%'+_0x56fb29[_0x5286('0x30')][_0x5286('0x49')]+'%'};return _0x59fa9f;})});}_0x5dc96f=_['merge']({},_0x5dc96f,_0x56fb29['options']);return _0x47eb73[_0x5286('0x4c')](_0x5dc96f);}})[_0x5286('0x25')](function(_0x162a6a){if(_0x162a6a){_0x439f12=_0x162a6a['length'];if(!_0x56fb29['query'][_0x5286('0x36')](_0x5286('0x4a'))){_0x5dc96f[_0x5286('0x1e')]=qs['limit'](_0x56fb29[_0x5286('0x30')]['limit']);_0x5dc96f['offset']=qs[_0x5286('0x20')](_0x56fb29['query'][_0x5286('0x20')]);}return _0x47eb73[_0x5286('0x4c')](_0x5dc96f);}})[_0x5286('0x25')](function(_0x131be5){if(_0x131be5){return _0x131be5?{'count':_0x439f12,'rows':_0x131be5}:null;}})[_0x5286('0x25')](respondWithResult(_0x5ba9c0,null))[_0x5286('0x40')](handleError(_0x5ba9c0,null));};
\ No newline at end of file
+var _0xacea=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','order','pick','getFields','SalesforceField','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x6b2793,_0x25b54d){var _0x4f0744=function(_0x50ade4){while(--_0x50ade4){_0x6b2793['push'](_0x6b2793['shift']());}};_0x4f0744(++_0x25b54d);}(_0xacea,0x138));var _0xaace=function(_0x521dbe,_0x1da55b){_0x521dbe=_0x521dbe-0x0;var _0x22f0b6=_0xacea[_0x521dbe];return _0x22f0b6;};'use strict';var emlformat=require(_0xaace('0x0'));var rimraf=require(_0xaace('0x1'));var zipdir=require(_0xaace('0x2'));var jsonpatch=require(_0xaace('0x3'));var rp=require('request-promise');var moment=require(_0xaace('0x4'));var BPromise=require(_0xaace('0x5'));var Mustache=require('mustache');var util=require(_0xaace('0x6'));var path=require(_0xaace('0x7'));var sox=require(_0xaace('0x8'));var csv=require(_0xaace('0x9'));var ejs=require(_0xaace('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaace('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xaace('0xc'));var toCsv=require(_0xaace('0x9'));var querystring=require(_0xaace('0xd'));var Papa=require(_0xaace('0xe'));var Redis=require(_0xaace('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaace('0x10'));var as=require(_0xaace('0x11'));var hardwareService=require(_0xaace('0x12'));var logger=require(_0xaace('0x13'))(_0xaace('0x14'));var utils=require(_0xaace('0x15'));var config=require(_0xaace('0x16'));var licenseUtil=require(_0xaace('0x17'));var db=require(_0xaace('0x18'))['db'];function respondWithStatusCode(_0x21e5cc,_0x11cdf8){_0x11cdf8=_0x11cdf8||0xcc;return function(_0x1dbb05){if(_0x1dbb05){return _0x21e5cc['sendStatus'](_0x11cdf8);}return _0x21e5cc['status'](_0x11cdf8)[_0xaace('0x19')]();};}function respondWithResult(_0x18a112,_0x39177f){_0x39177f=_0x39177f||0xc8;return function(_0x4c6ff3){if(_0x4c6ff3){return _0x18a112[_0xaace('0x1a')](_0x39177f)[_0xaace('0x1b')](_0x4c6ff3);}};}function respondWithFilteredResult(_0x5ec584,_0xbb27b3){return function(_0x211f90){if(_0x211f90){var _0x538a9a=typeof _0xbb27b3[_0xaace('0x1c')]===_0xaace('0x1d')&&typeof _0xbb27b3[_0xaace('0x1e')]===_0xaace('0x1d');var _0x1a1067=_0x211f90[_0xaace('0x1f')];var _0x5a8a4a=_0x538a9a?0x0:_0xbb27b3[_0xaace('0x1c')];var _0x8f045=_0x538a9a?_0x211f90[_0xaace('0x1f')]:_0xbb27b3[_0xaace('0x1c')]+_0xbb27b3[_0xaace('0x1e')];var _0x250bf9;if(_0x8f045>=_0x1a1067){_0x8f045=_0x1a1067;_0x250bf9=0xc8;}else{_0x250bf9=0xce;}_0x5ec584[_0xaace('0x1a')](_0x250bf9);return _0x5ec584[_0xaace('0x20')](_0xaace('0x21'),_0x5a8a4a+'-'+_0x8f045+'/'+_0x1a1067)[_0xaace('0x1b')](_0x211f90);}return null;};}function patchUpdates(_0x344b14){return function(_0xcc07ac){try{jsonpatch[_0xaace('0x22')](_0xcc07ac,_0x344b14,!![]);}catch(_0x1f54c3){return BPromise['reject'](_0x1f54c3);}return _0xcc07ac[_0xaace('0x23')]();};}function saveUpdates(_0x555382,_0x11846a){return function(_0x284d23){if(_0x284d23){return _0x284d23[_0xaace('0x24')](_0x555382)['then'](function(_0x14c986){return _0x14c986;});}return null;};}function removeEntity(_0x4cc064,_0xe677ff){return function(_0xf3d32d){if(_0xf3d32d){return _0xf3d32d[_0xaace('0x25')]()[_0xaace('0x26')](function(){_0x4cc064['status'](0xcc)[_0xaace('0x19')]();});}};}function handleEntityNotFound(_0x40a3ab,_0x35931e){return function(_0x41577a){if(!_0x41577a){_0x40a3ab[_0xaace('0x27')](0x194);}return _0x41577a;};}function handleError(_0x37ca18,_0x12eea8){_0x12eea8=_0x12eea8||0x1f4;return function(_0x1d206c){logger['error'](_0x1d206c[_0xaace('0x28')]);if(_0x1d206c[_0xaace('0x29')]){delete _0x1d206c['name'];}_0x37ca18['status'](_0x12eea8)[_0xaace('0x2a')](_0x1d206c);};}exports[_0xaace('0x2b')]=function(_0x125727,_0x12a84e){var _0x18809c={},_0x9fa29b={},_0x31eb8c={'count':0x0,'rows':[]};var _0xa6c92d=_[_0xaace('0x2c')](db[_0xaace('0x2d')][_0xaace('0x2e')],function(_0x3eba81){return{'name':_0x3eba81[_0xaace('0x2f')],'type':_0x3eba81[_0xaace('0x30')][_0xaace('0x31')]};});_0x9fa29b['model']=_[_0xaace('0x2c')](_0xa6c92d,_0xaace('0x29'));_0x9fa29b[_0xaace('0x32')]=_[_0xaace('0x33')](_0x125727[_0xaace('0x32')]);_0x9fa29b[_0xaace('0x34')]=_[_0xaace('0x35')](_0x9fa29b[_0xaace('0x36')],_0x9fa29b[_0xaace('0x32')]);_0x18809c[_0xaace('0x37')]=_[_0xaace('0x35')](_0x9fa29b[_0xaace('0x36')],qs[_0xaace('0x38')](_0x125727[_0xaace('0x32')]['fields']));_0x18809c[_0xaace('0x37')]=_0x18809c[_0xaace('0x37')][_0xaace('0x39')]?_0x18809c['attributes']:_0x9fa29b[_0xaace('0x36')];if(!_0x125727['query'][_0xaace('0x3a')](_0xaace('0x3b'))){_0x18809c[_0xaace('0x1e')]=qs[_0xaace('0x1e')](_0x125727[_0xaace('0x32')][_0xaace('0x1e')]);_0x18809c['offset']=qs[_0xaace('0x1c')](_0x125727[_0xaace('0x32')][_0xaace('0x1c')]);}_0x18809c['order']=qs['sort'](_0x125727[_0xaace('0x32')][_0xaace('0x3c')]);_0x18809c['where']=qs[_0xaace('0x34')](_['pick'](_0x125727[_0xaace('0x32')],_0x9fa29b['filters']),_0xa6c92d);if(_0x125727['query'][_0xaace('0x3d')]){_0x18809c[_0xaace('0x3e')]=_[_0xaace('0x3f')](_0x18809c[_0xaace('0x3e')],{'$or':_[_0xaace('0x2c')](_0xa6c92d,function(_0x11ff46){if(_0x11ff46[_0xaace('0x30')]!==_0xaace('0x40')){var _0x3f9442={};_0x3f9442[_0x11ff46[_0xaace('0x29')]]={'$like':'%'+_0x125727['query'][_0xaace('0x3d')]+'%'};return _0x3f9442;}})});}_0x18809c=_[_0xaace('0x3f')]({},_0x18809c,_0x125727[_0xaace('0x41')]);var _0x23bdc3={'where':_0x18809c[_0xaace('0x3e')]};return db['SalesforceConfiguration']['count'](_0x23bdc3)[_0xaace('0x26')](function(_0x5007aa){_0x31eb8c['count']=_0x5007aa;if(_0x125727[_0xaace('0x32')][_0xaace('0x42')]){_0x18809c[_0xaace('0x43')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xaace('0x44')](_0x18809c);})['then'](function(_0x399198){_0x31eb8c[_0xaace('0x45')]=_0x399198;return _0x31eb8c;})[_0xaace('0x26')](respondWithFilteredResult(_0x12a84e,_0x18809c))['catch'](handleError(_0x12a84e,null));};exports[_0xaace('0x46')]=function(_0x3299e7,_0x13a4a7){var _0x18aafd={'raw':![],'where':{'id':_0x3299e7[_0xaace('0x47')]['id']}},_0xc3bd4d={};_0xc3bd4d[_0xaace('0x36')]=_[_0xaace('0x33')](db[_0xaace('0x2d')][_0xaace('0x2e')]);_0xc3bd4d[_0xaace('0x32')]=_[_0xaace('0x33')](_0x3299e7[_0xaace('0x32')]);_0xc3bd4d[_0xaace('0x34')]=_[_0xaace('0x35')](_0xc3bd4d[_0xaace('0x36')],_0xc3bd4d[_0xaace('0x32')]);_0x18aafd[_0xaace('0x37')]=_[_0xaace('0x35')](_0xc3bd4d[_0xaace('0x36')],qs[_0xaace('0x38')](_0x3299e7[_0xaace('0x32')][_0xaace('0x38')]));_0x18aafd['attributes']=_0x18aafd[_0xaace('0x37')][_0xaace('0x39')]?_0x18aafd[_0xaace('0x37')]:_0xc3bd4d[_0xaace('0x36')];if(_0x3299e7[_0xaace('0x32')][_0xaace('0x42')]){_0x18aafd[_0xaace('0x43')]=[{'all':!![]}];}_0x18aafd=_[_0xaace('0x3f')]({},_0x18aafd,_0x3299e7[_0xaace('0x41')]);return db['SalesforceConfiguration'][_0xaace('0x48')](_0x18aafd)['then'](handleEntityNotFound(_0x13a4a7,null))['then'](respondWithResult(_0x13a4a7,null))[_0xaace('0x49')](handleError(_0x13a4a7,null));};exports[_0xaace('0x4a')]=function(_0x13d55d,_0x39eaeb){return db[_0xaace('0x2d')][_0xaace('0x4a')](_0x13d55d[_0xaace('0x4b')],{})[_0xaace('0x26')](respondWithResult(_0x39eaeb,0xc9))[_0xaace('0x49')](handleError(_0x39eaeb,null));};exports[_0xaace('0x24')]=function(_0x1ddca9,_0x3c8468){if(_0x1ddca9[_0xaace('0x4b')]['id']){delete _0x1ddca9[_0xaace('0x4b')]['id'];}return db['SalesforceConfiguration'][_0xaace('0x48')]({'where':{'id':_0x1ddca9[_0xaace('0x47')]['id']}})[_0xaace('0x26')](handleEntityNotFound(_0x3c8468,null))['then'](saveUpdates(_0x1ddca9[_0xaace('0x4b')],null))['then'](respondWithResult(_0x3c8468,null))['catch'](handleError(_0x3c8468,null));};exports[_0xaace('0x25')]=function(_0x3e7932,_0x11c37f){return db[_0xaace('0x2d')][_0xaace('0x48')]({'where':{'id':_0x3e7932[_0xaace('0x47')]['id']}})['then'](handleEntityNotFound(_0x11c37f,null))[_0xaace('0x26')](removeEntity(_0x11c37f,null))[_0xaace('0x49')](handleError(_0x11c37f,null));};exports['getFields']=function(_0xb68fb7,_0x236c7d,_0x1d4b6c){var _0x1829d3={};var _0x56810b={};var _0x4ef1f6;var _0x45bc40;return db[_0xaace('0x2d')]['findOne']({'where':{'id':_0xb68fb7[_0xaace('0x47')]['id']}})[_0xaace('0x26')](handleEntityNotFound(_0x236c7d,null))[_0xaace('0x26')](function(_0x605e9e){if(_0x605e9e){_0x4ef1f6=_0x605e9e;_0x56810b['model']=_[_0xaace('0x33')](db['SalesforceField'][_0xaace('0x2e')]);_0x56810b['query']=_[_0xaace('0x33')](_0xb68fb7[_0xaace('0x32')]);_0x56810b[_0xaace('0x34')]=_[_0xaace('0x35')](_0x56810b[_0xaace('0x36')],_0x56810b['query']);_0x1829d3[_0xaace('0x37')]=_[_0xaace('0x35')](_0x56810b[_0xaace('0x36')],qs[_0xaace('0x38')](_0xb68fb7[_0xaace('0x32')][_0xaace('0x38')]));_0x1829d3[_0xaace('0x37')]=_0x1829d3['attributes']['length']?_0x1829d3[_0xaace('0x37')]:_0x56810b['model'];_0x1829d3[_0xaace('0x4c')]=qs[_0xaace('0x3c')](_0xb68fb7[_0xaace('0x32')][_0xaace('0x3c')]);_0x1829d3[_0xaace('0x3e')]=qs[_0xaace('0x34')](_[_0xaace('0x4d')](_0xb68fb7[_0xaace('0x32')],_0x56810b[_0xaace('0x34')]));if(_0xb68fb7['query'][_0xaace('0x3d')]){_0x1829d3['where']=_[_0xaace('0x3f')](_0x1829d3[_0xaace('0x3e')],{'$or':_[_0xaace('0x2c')](_0x1829d3['attributes'],function(_0x374ff2){var _0x3a1e4c={};_0x3a1e4c[_0x374ff2]={'$like':'%'+_0xb68fb7[_0xaace('0x32')][_0xaace('0x3d')]+'%'};return _0x3a1e4c;})});}_0x1829d3=_[_0xaace('0x3f')]({},_0x1829d3,_0xb68fb7['options']);return _0x4ef1f6[_0xaace('0x4e')](_0x1829d3);}})[_0xaace('0x26')](function(_0x302d03){if(_0x302d03){_0x45bc40=_0x302d03[_0xaace('0x39')];if(!_0xb68fb7[_0xaace('0x32')][_0xaace('0x3a')](_0xaace('0x3b'))){_0x1829d3['limit']=qs[_0xaace('0x1e')](_0xb68fb7['query']['limit']);_0x1829d3[_0xaace('0x1c')]=qs[_0xaace('0x1c')](_0xb68fb7[_0xaace('0x32')][_0xaace('0x1c')]);}return _0x4ef1f6[_0xaace('0x4e')](_0x1829d3);}})[_0xaace('0x26')](function(_0x27216b){if(_0x27216b){return _0x27216b?{'count':_0x45bc40,'rows':_0x27216b}:null;}})['then'](respondWithResult(_0x236c7d,null))['catch'](handleError(_0x236c7d,null));};exports['getSubjects']=function(_0x4662a7,_0x2ef7a7,_0x24c0db){var _0x44e082={};var _0x2f1697={};var _0x4e130d;var _0x13ba8d;return db[_0xaace('0x2d')]['findOne']({'where':{'id':_0x4662a7[_0xaace('0x47')]['id']}})[_0xaace('0x26')](handleEntityNotFound(_0x2ef7a7,null))[_0xaace('0x26')](function(_0x129139){if(_0x129139){_0x4e130d=_0x129139;_0x2f1697['model']=_[_0xaace('0x33')](db[_0xaace('0x4f')][_0xaace('0x2e')]);_0x2f1697[_0xaace('0x32')]=_['keys'](_0x4662a7['query']);_0x2f1697[_0xaace('0x34')]=_[_0xaace('0x35')](_0x2f1697[_0xaace('0x36')],_0x2f1697[_0xaace('0x32')]);_0x44e082[_0xaace('0x37')]=_[_0xaace('0x35')](_0x2f1697[_0xaace('0x36')],qs[_0xaace('0x38')](_0x4662a7[_0xaace('0x32')][_0xaace('0x38')]));_0x44e082['attributes']=_0x44e082[_0xaace('0x37')][_0xaace('0x39')]?_0x44e082[_0xaace('0x37')]:_0x2f1697[_0xaace('0x36')];_0x44e082['order']=qs[_0xaace('0x3c')](_0x4662a7[_0xaace('0x32')][_0xaace('0x3c')]);_0x44e082['where']=qs['filters'](_[_0xaace('0x4d')](_0x4662a7[_0xaace('0x32')],_0x2f1697[_0xaace('0x34')]));if(_0x4662a7[_0xaace('0x32')][_0xaace('0x3d')]){_0x44e082[_0xaace('0x3e')]=_[_0xaace('0x3f')](_0x44e082['where'],{'$or':_['map'](_0x44e082[_0xaace('0x37')],function(_0x378c1a){var _0x56b254={};_0x56b254[_0x378c1a]={'$like':'%'+_0x4662a7[_0xaace('0x32')][_0xaace('0x3d')]+'%'};return _0x56b254;})});}_0x44e082=_[_0xaace('0x3f')]({},_0x44e082,_0x4662a7[_0xaace('0x41')]);return _0x4e130d['getSubjects'](_0x44e082);}})[_0xaace('0x26')](function(_0x5ba332){if(_0x5ba332){_0x13ba8d=_0x5ba332[_0xaace('0x39')];if(!_0x4662a7[_0xaace('0x32')][_0xaace('0x3a')](_0xaace('0x3b'))){_0x44e082['limit']=qs[_0xaace('0x1e')](_0x4662a7[_0xaace('0x32')]['limit']);_0x44e082[_0xaace('0x1c')]=qs[_0xaace('0x1c')](_0x4662a7['query'][_0xaace('0x1c')]);}return _0x4e130d['getSubjects'](_0x44e082);}})[_0xaace('0x26')](function(_0x1ac3f6){if(_0x1ac3f6){return _0x1ac3f6?{'count':_0x13ba8d,'rows':_0x1ac3f6}:null;}})[_0xaace('0x26')](respondWithResult(_0x2ef7a7,null))[_0xaace('0x49')](handleError(_0x2ef7a7,null));};exports[_0xaace('0x50')]=function(_0x1e663d,_0x281919,_0x542858){var _0x1dca67={};var _0x3fc667={};var _0x3f170c;var _0x1d7862;return db[_0xaace('0x2d')][_0xaace('0x51')]({'where':{'id':_0x1e663d[_0xaace('0x47')]['id']}})['then'](handleEntityNotFound(_0x281919,null))[_0xaace('0x26')](function(_0x1cc9ec){if(_0x1cc9ec){_0x3f170c=_0x1cc9ec;_0x3fc667['model']=_[_0xaace('0x33')](db[_0xaace('0x4f')][_0xaace('0x2e')]);_0x3fc667['query']=_['keys'](_0x1e663d[_0xaace('0x32')]);_0x3fc667['filters']=_[_0xaace('0x35')](_0x3fc667[_0xaace('0x36')],_0x3fc667['query']);_0x1dca67[_0xaace('0x37')]=_[_0xaace('0x35')](_0x3fc667[_0xaace('0x36')],qs[_0xaace('0x38')](_0x1e663d[_0xaace('0x32')][_0xaace('0x38')]));_0x1dca67[_0xaace('0x37')]=_0x1dca67[_0xaace('0x37')]['length']?_0x1dca67[_0xaace('0x37')]:_0x3fc667[_0xaace('0x36')];_0x1dca67[_0xaace('0x4c')]=qs[_0xaace('0x3c')](_0x1e663d[_0xaace('0x32')][_0xaace('0x3c')]);_0x1dca67[_0xaace('0x3e')]=qs[_0xaace('0x34')](_[_0xaace('0x4d')](_0x1e663d[_0xaace('0x32')],_0x3fc667['filters']));if(_0x1e663d[_0xaace('0x32')][_0xaace('0x3d')]){_0x1dca67[_0xaace('0x3e')]=_['merge'](_0x1dca67[_0xaace('0x3e')],{'$or':_[_0xaace('0x2c')](_0x1dca67[_0xaace('0x37')],function(_0x2de9ae){var _0xa789b8={};_0xa789b8[_0x2de9ae]={'$like':'%'+_0x1e663d[_0xaace('0x32')]['filter']+'%'};return _0xa789b8;})});}_0x1dca67=_[_0xaace('0x3f')]({},_0x1dca67,_0x1e663d[_0xaace('0x41')]);return _0x3f170c[_0xaace('0x50')](_0x1dca67);}})[_0xaace('0x26')](function(_0x1dc8c0){if(_0x1dc8c0){_0x1d7862=_0x1dc8c0[_0xaace('0x39')];if(!_0x1e663d['query'][_0xaace('0x3a')](_0xaace('0x3b'))){_0x1dca67[_0xaace('0x1e')]=qs['limit'](_0x1e663d[_0xaace('0x32')]['limit']);_0x1dca67[_0xaace('0x1c')]=qs[_0xaace('0x1c')](_0x1e663d[_0xaace('0x32')]['offset']);}return _0x3f170c[_0xaace('0x50')](_0x1dca67);}})[_0xaace('0x26')](function(_0x24d906){if(_0x24d906){return _0x24d906?{'count':_0x1d7862,'rows':_0x24d906}:null;}})[_0xaace('0x26')](respondWithResult(_0x281919,null))[_0xaace('0x49')](handleError(_0x281919,null));};
\ No newline at end of file
index 9bad5e0..a6612ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1823=['./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x1823,0x111));var _0x3182=function(_0x308a1d,_0x3d379d){_0x308a1d=_0x308a1d-0x0;var _0x5eb875=_0x1823[_0x308a1d];return _0x5eb875;};'use strict';var _=require(_0x3182('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3182('0x1'));var moment=require(_0x3182('0x2'));var BPromise=require(_0x3182('0x3'));var rp=require(_0x3182('0x4'));var fs=require('fs');var path=require(_0x3182('0x5'));var rimraf=require(_0x3182('0x6'));var config=require('../../config/environment');var attributes=require(_0x3182('0x7'));module['exports']=function(_0xb0234b,_0x82facc){return _0xb0234b[_0x3182('0x8')](_0x3182('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x77e0=['int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','SalesforceConfiguration'];(function(_0x37de50,_0x27f82a){var _0x2c37dc=function(_0x325186){while(--_0x325186){_0x37de50['push'](_0x37de50['shift']());}};_0x2c37dc(++_0x27f82a);}(_0x77e0,0xcd));var _0x077e=function(_0x4a0587,_0x2e0a05){_0x4a0587=_0x4a0587-0x0;var _0x33177c=_0x77e0[_0x4a0587];return _0x33177c;};'use strict';var _=require(_0x077e('0x0'));var util=require(_0x077e('0x1'));var logger=require(_0x077e('0x2'))(_0x077e('0x3'));var moment=require(_0x077e('0x4'));var BPromise=require(_0x077e('0x5'));var rp=require(_0x077e('0x6'));var fs=require('fs');var path=require(_0x077e('0x7'));var rimraf=require(_0x077e('0x8'));var config=require(_0x077e('0x9'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x2ab8a1,_0x3cd827){return _0x2ab8a1['define'](_0x077e('0xa'),attributes,{'tableName':_0x077e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9ba8b87..fc76921 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35fd=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x10b52b,_0x1c449b){var _0x7478d4=function(_0xa0cb42){while(--_0xa0cb42){_0x10b52b['push'](_0x10b52b['shift']());}};_0x7478d4(++_0x1c449b);}(_0x35fd,0xbc));var _0xd35f=function(_0x35540f,_0x22d126){_0x35540f=_0x35540f-0x0;var _0x5a2978=_0x35fd[_0x35540f];return _0x5a2978;};'use strict';var _=require(_0xd35f('0x0'));var util=require(_0xd35f('0x1'));var moment=require(_0xd35f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd35f('0x3'));var db=require(_0xd35f('0x4'))['db'];var utils=require(_0xd35f('0x5'));var logger=require(_0xd35f('0x6'))('rpc');var config=require(_0xd35f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a5144,_0xc24ce4,_0x279203){return new BPromise(function(_0x6a4ae8,_0x19d0da){return client[_0xd35f('0x8')](_0x1a5144,_0x279203)[_0xd35f('0x9')](function(_0x137989){logger[_0xd35f('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0xc24ce4,_0xd35f('0xb'));logger[_0xd35f('0xc')](_0xd35f('0xd'),_0xc24ce4,'request\x20sent',JSON[_0xd35f('0xe')](_0x137989));if(_0x137989[_0xd35f('0xf')]){if(_0x137989[_0xd35f('0xf')][_0xd35f('0x10')]===0x1f4){logger[_0xd35f('0xf')](_0xd35f('0x11'),_0xc24ce4,_0x137989['error'][_0xd35f('0x12')]);return _0x19d0da(_0x137989['error'][_0xd35f('0x12')]);}logger['error'](_0xd35f('0x11'),_0xc24ce4,_0x137989[_0xd35f('0xf')][_0xd35f('0x12')]);return _0x6a4ae8(_0x137989[_0xd35f('0xf')]['message']);}else{logger[_0xd35f('0xa')](_0xd35f('0x11'),_0xc24ce4,'request\x20sent');_0x6a4ae8(_0x137989[_0xd35f('0x13')][_0xd35f('0x12')]);}})[_0xd35f('0x14')](function(_0x47a88b){logger[_0xd35f('0xf')](_0xd35f('0x11'),_0xc24ce4,_0x47a88b);_0x19d0da(_0x47a88b);});});}
\ No newline at end of file
+var _0x5a07=['request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x46f98b,_0x3b6206){var _0x1ed6fe=function(_0x1fb58b){while(--_0x1fb58b){_0x46f98b['push'](_0x46f98b['shift']());}};_0x1ed6fe(++_0x3b6206);}(_0x5a07,0x8f));var _0x75a0=function(_0x123cb9,_0x3e2992){_0x123cb9=_0x123cb9-0x0;var _0x3caa80=_0x5a07[_0x123cb9];return _0x3caa80;};'use strict';var _=require('lodash');var util=require(_0x75a0('0x0'));var moment=require('moment');var BPromise=require(_0x75a0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75a0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x75a0('0x3'));var logger=require(_0x75a0('0x4'))(_0x75a0('0x5'));var config=require(_0x75a0('0x6'));var jayson=require(_0x75a0('0x7'));var client=jayson[_0x75a0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd1c7ce,_0x11dee1,_0x2dbd1a){return new BPromise(function(_0x3f4eef,_0x18223e){return client['request'](_0xd1c7ce,_0x2dbd1a)['then'](function(_0x7a8685){logger['info'](_0x75a0('0x9'),_0x11dee1,_0x75a0('0xa'));logger['debug'](_0x75a0('0xb'),_0x11dee1,'request\x20sent',JSON[_0x75a0('0xc')](_0x7a8685));if(_0x7a8685[_0x75a0('0xd')]){if(_0x7a8685[_0x75a0('0xd')]['code']===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x11dee1,_0x7a8685[_0x75a0('0xd')]['message']);return _0x18223e(_0x7a8685[_0x75a0('0xd')][_0x75a0('0xe')]);}logger[_0x75a0('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x11dee1,_0x7a8685[_0x75a0('0xd')]['message']);return _0x3f4eef(_0x7a8685[_0x75a0('0xd')]['message']);}else{logger[_0x75a0('0xf')](_0x75a0('0x9'),_0x11dee1,'request\x20sent');_0x3f4eef(_0x7a8685['result']['message']);}})[_0x75a0('0x10')](function(_0x3af7c9){logger[_0x75a0('0xd')](_0x75a0('0x9'),_0x11dee1,_0x3af7c9);_0x18223e(_0x3af7c9);});});}
\ No newline at end of file
index 2440441..d04a6bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00d8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x00d8,0xa5));var _0x800d=function(_0x4c92de,_0x57513b){_0x4c92de=_0x4c92de-0x0;var _0x5ebdf8=_0x00d8[_0x4c92de];return _0x5ebdf8;};'use strict';var multer=require(_0x800d('0x0'));var util=require(_0x800d('0x1'));var path=require(_0x800d('0x2'));var timeout=require('connect-timeout');var express=require(_0x800d('0x3'));var router=express[_0x800d('0x4')]();var fs_extra=require(_0x800d('0x5'));var auth=require(_0x800d('0x6'));var interaction=require(_0x800d('0x7'));var config=require(_0x800d('0x8'));var controller=require(_0x800d('0x9'));router[_0x800d('0xa')]('/',auth[_0x800d('0xb')](),controller[_0x800d('0xc')]);router[_0x800d('0xa')](_0x800d('0xd'),auth['isAuthenticated'](),controller[_0x800d('0xe')]);router['post']('/',auth[_0x800d('0xb')](),controller[_0x800d('0xf')]);router[_0x800d('0x10')]('/:id',auth[_0x800d('0xb')](),controller[_0x800d('0x11')]);router['delete']('/:id',auth[_0x800d('0xb')](),controller[_0x800d('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xd813=['update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','get','show','put','/:id'];(function(_0x400096,_0x101dc3){var _0x31755a=function(_0x2d29b4){while(--_0x2d29b4){_0x400096['push'](_0x400096['shift']());}};_0x31755a(++_0x101dc3);}(_0xd813,0x135));var _0x3d81=function(_0x49372d,_0x21e0bf){_0x49372d=_0x49372d-0x0;var _0x4cccf9=_0xd813[_0x49372d];return _0x4cccf9;};'use strict';var multer=require(_0x3d81('0x0'));var util=require(_0x3d81('0x1'));var path=require('path');var timeout=require(_0x3d81('0x2'));var express=require(_0x3d81('0x3'));var router=express[_0x3d81('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3d81('0x5'));var interaction=require(_0x3d81('0x6'));var config=require('../../config/environment');var controller=require(_0x3d81('0x7'));router['get']('/',auth[_0x3d81('0x8')](),controller[_0x3d81('0x9')]);router[_0x3d81('0xa')]('/:id',auth[_0x3d81('0x8')](),controller[_0x3d81('0xb')]);router['post']('/',auth[_0x3d81('0x8')](),controller['create']);router[_0x3d81('0xc')](_0x3d81('0xd'),auth[_0x3d81('0x8')](),controller[_0x3d81('0xe')]);router['delete'](_0x3d81('0xd'),auth['isAuthenticated'](),controller[_0x3d81('0xf')]);module[_0x3d81('0x10')]=router;
\ No newline at end of file
index 93a9c11..be64178 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2781=['picklist','STRING','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x2781,0xda));var _0x1278=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x2781[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require('sequelize');module[_0x1278('0x0')]={'type':{'type':Sequelize[_0x1278('0x1')](_0x1278('0x2'),_0x1278('0x3'),_0x1278('0x4'),_0x1278('0x5'),_0x1278('0x6')),'defaultValue':_0x1278('0x2')},'content':{'type':Sequelize[_0x1278('0x7')]},'key':{'type':Sequelize[_0x1278('0x7')]},'keyType':{'type':Sequelize[_0x1278('0x1')](_0x1278('0x2'),_0x1278('0x3'),_0x1278('0x4'))},'keyContent':{'type':Sequelize[_0x1278('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x1278('0x7')]}};
\ No newline at end of file
+var _0x8844=['ENUM','string','variable','customVariable','picklist','STRING','sequelize','exports'];(function(_0x7418ab,_0x3773b4){var _0x262ca9=function(_0x2d3356){while(--_0x2d3356){_0x7418ab['push'](_0x7418ab['shift']());}};_0x262ca9(++_0x3773b4);}(_0x8844,0x8e));var _0x4884=function(_0x3ad1aa,_0x1e5418){_0x3ad1aa=_0x3ad1aa-0x0;var _0x535c08=_0x8844[_0x3ad1aa];return _0x535c08;};'use strict';var Sequelize=require(_0x4884('0x0'));module[_0x4884('0x1')]={'type':{'type':Sequelize[_0x4884('0x2')](_0x4884('0x3'),_0x4884('0x4'),_0x4884('0x5'),'keyValue',_0x4884('0x6')),'defaultValue':_0x4884('0x3')},'content':{'type':Sequelize[_0x4884('0x7')]},'key':{'type':Sequelize[_0x4884('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x4884('0x3'),_0x4884('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x4884('0x7')]},'idField':{'type':Sequelize[_0x4884('0x7')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d8b3ccf..6e8cd42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a00=['reject','save','update','then','destroy','error','stack','name','send','SalesforceField','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','catch','show','params','keys','include','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x5890a6,_0x8b11f4){var _0x47ca23=function(_0x1adf9a){while(--_0x1adf9a){_0x5890a6['push'](_0x5890a6['shift']());}};_0x47ca23(++_0x8b11f4);}(_0x3a00,0x74));var _0x03a0=function(_0x2b31a8,_0x28b862){_0x2b31a8=_0x2b31a8-0x0;var _0x1175a5=_0x3a00[_0x2b31a8];return _0x1175a5;};'use strict';var emlformat=require(_0x03a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03a0('0x1'));var jsonpatch=require(_0x03a0('0x2'));var rp=require('request-promise');var moment=require(_0x03a0('0x3'));var BPromise=require(_0x03a0('0x4'));var Mustache=require(_0x03a0('0x5'));var util=require(_0x03a0('0x6'));var path=require(_0x03a0('0x7'));var sox=require(_0x03a0('0x8'));var csv=require('to-csv');var ejs=require(_0x03a0('0x9'));var fs=require('fs');var fs_extra=require(_0x03a0('0xa'));var _=require(_0x03a0('0xb'));var squel=require(_0x03a0('0xc'));var crypto=require(_0x03a0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x03a0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x03a0('0xf'));var Papa=require(_0x03a0('0x10'));var Redis=require(_0x03a0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x03a0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03a0('0x13'));var logger=require(_0x03a0('0x14'))('api');var utils=require(_0x03a0('0x15'));var config=require(_0x03a0('0x16'));var licenseUtil=require(_0x03a0('0x17'));var db=require(_0x03a0('0x18'))['db'];function respondWithStatusCode(_0xdd010d,_0xfa8d4a){_0xfa8d4a=_0xfa8d4a||0xcc;return function(_0x581b9f){if(_0x581b9f){return _0xdd010d[_0x03a0('0x19')](_0xfa8d4a);}return _0xdd010d[_0x03a0('0x1a')](_0xfa8d4a)[_0x03a0('0x1b')]();};}function respondWithResult(_0x10e5ea,_0x4530a0){_0x4530a0=_0x4530a0||0xc8;return function(_0x1bfcda){if(_0x1bfcda){return _0x10e5ea['status'](_0x4530a0)[_0x03a0('0x1c')](_0x1bfcda);}};}function respondWithFilteredResult(_0xbf6037,_0x440280){return function(_0x55d027){if(_0x55d027){var _0x54a42f=typeof _0x440280['offset']===_0x03a0('0x1d')&&typeof _0x440280[_0x03a0('0x1e')]===_0x03a0('0x1d');var _0x36307b=_0x55d027[_0x03a0('0x1f')];var _0x20304c=_0x54a42f?0x0:_0x440280[_0x03a0('0x20')];var _0x1c45fe=_0x54a42f?_0x55d027[_0x03a0('0x1f')]:_0x440280[_0x03a0('0x20')]+_0x440280[_0x03a0('0x1e')];var _0x2018c1;if(_0x1c45fe>=_0x36307b){_0x1c45fe=_0x36307b;_0x2018c1=0xc8;}else{_0x2018c1=0xce;}_0xbf6037[_0x03a0('0x1a')](_0x2018c1);return _0xbf6037[_0x03a0('0x21')](_0x03a0('0x22'),_0x20304c+'-'+_0x1c45fe+'/'+_0x36307b)['json'](_0x55d027);}return null;};}function patchUpdates(_0x430336){return function(_0x18229d){try{jsonpatch[_0x03a0('0x23')](_0x18229d,_0x430336,!![]);}catch(_0x33ff69){return BPromise[_0x03a0('0x24')](_0x33ff69);}return _0x18229d[_0x03a0('0x25')]();};}function saveUpdates(_0x1a8e17,_0x1a2336){return function(_0x221d98){if(_0x221d98){return _0x221d98[_0x03a0('0x26')](_0x1a8e17)[_0x03a0('0x27')](function(_0x3fb0ba){return _0x3fb0ba;});}return null;};}function removeEntity(_0x524f52,_0x2532e4){return function(_0x4d7cbd){if(_0x4d7cbd){return _0x4d7cbd[_0x03a0('0x28')]()[_0x03a0('0x27')](function(){_0x524f52[_0x03a0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bf469,_0x542e0c){return function(_0xd815e2){if(!_0xd815e2){_0x4bf469[_0x03a0('0x19')](0x194);}return _0xd815e2;};}function handleError(_0x20bc7e,_0x4695d8){_0x4695d8=_0x4695d8||0x1f4;return function(_0x5a9a02){logger[_0x03a0('0x29')](_0x5a9a02[_0x03a0('0x2a')]);if(_0x5a9a02[_0x03a0('0x2b')]){delete _0x5a9a02[_0x03a0('0x2b')];}_0x20bc7e['status'](_0x4695d8)[_0x03a0('0x2c')](_0x5a9a02);};}exports['index']=function(_0x98b1cb,_0x4f2280){var _0x327406={},_0x512baa={},_0x58203b={'count':0x0,'rows':[]};var _0x279c67=_['map'](db[_0x03a0('0x2d')][_0x03a0('0x2e')],function(_0x45d95b){return{'name':_0x45d95b['fieldName'],'type':_0x45d95b[_0x03a0('0x2f')][_0x03a0('0x30')]};});_0x512baa[_0x03a0('0x31')]=_[_0x03a0('0x32')](_0x279c67,_0x03a0('0x2b'));_0x512baa[_0x03a0('0x33')]=_['keys'](_0x98b1cb[_0x03a0('0x33')]);_0x512baa[_0x03a0('0x34')]=_[_0x03a0('0x35')](_0x512baa['model'],_0x512baa['query']);_0x327406[_0x03a0('0x36')]=_[_0x03a0('0x35')](_0x512baa[_0x03a0('0x31')],qs[_0x03a0('0x37')](_0x98b1cb[_0x03a0('0x33')][_0x03a0('0x37')]));_0x327406[_0x03a0('0x36')]=_0x327406['attributes'][_0x03a0('0x38')]?_0x327406[_0x03a0('0x36')]:_0x512baa[_0x03a0('0x31')];if(!_0x98b1cb[_0x03a0('0x33')][_0x03a0('0x39')](_0x03a0('0x3a'))){_0x327406[_0x03a0('0x1e')]=qs[_0x03a0('0x1e')](_0x98b1cb['query'][_0x03a0('0x1e')]);_0x327406[_0x03a0('0x20')]=qs['offset'](_0x98b1cb[_0x03a0('0x33')][_0x03a0('0x20')]);}_0x327406[_0x03a0('0x3b')]=qs[_0x03a0('0x3c')](_0x98b1cb['query'][_0x03a0('0x3c')]);_0x327406[_0x03a0('0x3d')]=qs[_0x03a0('0x34')](_[_0x03a0('0x3e')](_0x98b1cb[_0x03a0('0x33')],_0x512baa[_0x03a0('0x34')]),_0x279c67);if(_0x98b1cb[_0x03a0('0x33')]['filter']){_0x327406['where']=_[_0x03a0('0x3f')](_0x327406['where'],{'$or':_[_0x03a0('0x32')](_0x279c67,function(_0x3aea72){if(_0x3aea72[_0x03a0('0x2f')]!==_0x03a0('0x40')){var _0x4bf5ec={};_0x4bf5ec[_0x3aea72[_0x03a0('0x2b')]]={'$like':'%'+_0x98b1cb[_0x03a0('0x33')][_0x03a0('0x41')]+'%'};return _0x4bf5ec;}})});}_0x327406=_[_0x03a0('0x3f')]({},_0x327406,_0x98b1cb[_0x03a0('0x42')]);var _0x16d75b={'where':_0x327406[_0x03a0('0x3d')]};return db['SalesforceField'][_0x03a0('0x1f')](_0x16d75b)[_0x03a0('0x27')](function(_0x22d90b){_0x58203b[_0x03a0('0x1f')]=_0x22d90b;if(_0x98b1cb[_0x03a0('0x33')][_0x03a0('0x43')]){_0x327406['include']=[{'all':!![]}];}return db[_0x03a0('0x2d')]['findAll'](_0x327406);})[_0x03a0('0x27')](function(_0x4a716a){_0x58203b['rows']=_0x4a716a;return _0x58203b;})[_0x03a0('0x27')](respondWithFilteredResult(_0x4f2280,_0x327406))[_0x03a0('0x44')](handleError(_0x4f2280,null));};exports[_0x03a0('0x45')]=function(_0x44cbc8,_0x33bbf1){var _0x3f1853={'raw':!![],'where':{'id':_0x44cbc8[_0x03a0('0x46')]['id']}},_0x45ac7f={};_0x45ac7f[_0x03a0('0x31')]=_[_0x03a0('0x47')](db[_0x03a0('0x2d')][_0x03a0('0x2e')]);_0x45ac7f[_0x03a0('0x33')]=_[_0x03a0('0x47')](_0x44cbc8[_0x03a0('0x33')]);_0x45ac7f[_0x03a0('0x34')]=_['intersection'](_0x45ac7f['model'],_0x45ac7f['query']);_0x3f1853['attributes']=_[_0x03a0('0x35')](_0x45ac7f['model'],qs[_0x03a0('0x37')](_0x44cbc8['query'][_0x03a0('0x37')]));_0x3f1853['attributes']=_0x3f1853[_0x03a0('0x36')][_0x03a0('0x38')]?_0x3f1853['attributes']:_0x45ac7f[_0x03a0('0x31')];if(_0x44cbc8[_0x03a0('0x33')][_0x03a0('0x43')]){_0x3f1853[_0x03a0('0x48')]=[{'all':!![]}];}_0x3f1853=_[_0x03a0('0x3f')]({},_0x3f1853,_0x44cbc8[_0x03a0('0x42')]);return db[_0x03a0('0x2d')][_0x03a0('0x49')](_0x3f1853)[_0x03a0('0x27')](handleEntityNotFound(_0x33bbf1,null))[_0x03a0('0x27')](respondWithResult(_0x33bbf1,null))[_0x03a0('0x44')](handleError(_0x33bbf1,null));};exports[_0x03a0('0x4a')]=function(_0x499d0a,_0x47b00f){return db[_0x03a0('0x2d')]['create'](_0x499d0a[_0x03a0('0x4b')],{})[_0x03a0('0x27')](respondWithResult(_0x47b00f,0xc9))[_0x03a0('0x44')](handleError(_0x47b00f,null));};exports['update']=function(_0x1cff27,_0x2c3c85){if(_0x1cff27[_0x03a0('0x4b')]['id']){delete _0x1cff27[_0x03a0('0x4b')]['id'];}return db[_0x03a0('0x2d')][_0x03a0('0x49')]({'where':{'id':_0x1cff27[_0x03a0('0x46')]['id']}})[_0x03a0('0x27')](handleEntityNotFound(_0x2c3c85,null))['then'](saveUpdates(_0x1cff27[_0x03a0('0x4b')],null))[_0x03a0('0x27')](respondWithResult(_0x2c3c85,null))['catch'](handleError(_0x2c3c85,null));};exports['destroy']=function(_0x3e49e2,_0x424ac1){return db['SalesforceField'][_0x03a0('0x49')]({'where':{'id':_0x3e49e2[_0x03a0('0x46')]['id']}})[_0x03a0('0x27')](handleEntityNotFound(_0x424ac1,null))[_0x03a0('0x27')](removeEntity(_0x424ac1,null))[_0x03a0('0x44')](handleError(_0x424ac1,null));};
\ No newline at end of file
+var _0x91ef=['json','undefined','count','offset','limit','reject','update','destroy','then','error','name','send','index','map','fieldName','key','model','query','keys','filters','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceField','includeAll','findAll','catch','show','params','rawAttributes','intersection','include','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x530ec8,_0x3b402d){var _0xdd83a5=function(_0x55b080){while(--_0x55b080){_0x530ec8['push'](_0x530ec8['shift']());}};_0xdd83a5(++_0x3b402d);}(_0x91ef,0xf9));var _0xf91e=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0x91ef[_0x30bd4d];return _0x306915;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf91e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf91e('0x1'));var rp=require(_0xf91e('0x2'));var moment=require(_0xf91e('0x3'));var BPromise=require(_0xf91e('0x4'));var Mustache=require(_0xf91e('0x5'));var util=require(_0xf91e('0x6'));var path=require('path');var sox=require(_0xf91e('0x7'));var csv=require(_0xf91e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf91e('0x9'));var _=require(_0xf91e('0xa'));var squel=require(_0xf91e('0xb'));var crypto=require('crypto');var jsforce=require(_0xf91e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf91e('0x8'));var querystring=require(_0xf91e('0xd'));var Papa=require(_0xf91e('0xe'));var Redis=require(_0xf91e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf91e('0x10'));var as=require(_0xf91e('0x11'));var hardwareService=require(_0xf91e('0x12'));var logger=require(_0xf91e('0x13'))(_0xf91e('0x14'));var utils=require(_0xf91e('0x15'));var config=require(_0xf91e('0x16'));var licenseUtil=require(_0xf91e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501360,_0x4c8490){_0x4c8490=_0x4c8490||0xcc;return function(_0x4700f0){if(_0x4700f0){return _0x501360[_0xf91e('0x18')](_0x4c8490);}return _0x501360[_0xf91e('0x19')](_0x4c8490)[_0xf91e('0x1a')]();};}function respondWithResult(_0x5a7ccb,_0x37c339){_0x37c339=_0x37c339||0xc8;return function(_0x3d6c01){if(_0x3d6c01){return _0x5a7ccb[_0xf91e('0x19')](_0x37c339)[_0xf91e('0x1b')](_0x3d6c01);}};}function respondWithFilteredResult(_0x108316,_0x112223){return function(_0x411763){if(_0x411763){var _0x3f5058=typeof _0x112223['offset']===_0xf91e('0x1c')&&typeof _0x112223['limit']==='undefined';var _0x3eab84=_0x411763[_0xf91e('0x1d')];var _0x19706f=_0x3f5058?0x0:_0x112223['offset'];var _0x217c1a=_0x3f5058?_0x411763[_0xf91e('0x1d')]:_0x112223[_0xf91e('0x1e')]+_0x112223[_0xf91e('0x1f')];var _0x4acae5;if(_0x217c1a>=_0x3eab84){_0x217c1a=_0x3eab84;_0x4acae5=0xc8;}else{_0x4acae5=0xce;}_0x108316[_0xf91e('0x19')](_0x4acae5);return _0x108316['set']('Content-Range',_0x19706f+'-'+_0x217c1a+'/'+_0x3eab84)['json'](_0x411763);}return null;};}function patchUpdates(_0x2ce419){return function(_0x295e20){try{jsonpatch['apply'](_0x295e20,_0x2ce419,!![]);}catch(_0x5940ab){return BPromise[_0xf91e('0x20')](_0x5940ab);}return _0x295e20['save']();};}function saveUpdates(_0x50d80d,_0x145ace){return function(_0x4d8519){if(_0x4d8519){return _0x4d8519[_0xf91e('0x21')](_0x50d80d)['then'](function(_0x22b336){return _0x22b336;});}return null;};}function removeEntity(_0x5dacc9,_0x3dbcc8){return function(_0x455953){if(_0x455953){return _0x455953[_0xf91e('0x22')]()[_0xf91e('0x23')](function(){_0x5dacc9['status'](0xcc)[_0xf91e('0x1a')]();});}};}function handleEntityNotFound(_0x20f0f2,_0x1cea2c){return function(_0x1d8ccb){if(!_0x1d8ccb){_0x20f0f2[_0xf91e('0x18')](0x194);}return _0x1d8ccb;};}function handleError(_0x2a1bdc,_0x13ce35){_0x13ce35=_0x13ce35||0x1f4;return function(_0x585258){logger[_0xf91e('0x24')](_0x585258['stack']);if(_0x585258[_0xf91e('0x25')]){delete _0x585258[_0xf91e('0x25')];}_0x2a1bdc[_0xf91e('0x19')](_0x13ce35)[_0xf91e('0x26')](_0x585258);};}exports[_0xf91e('0x27')]=function(_0x1ce726,_0x5c366e){var _0xb45c5={},_0x3b0a20={},_0x393599={'count':0x0,'rows':[]};var _0x2e79c9=_[_0xf91e('0x28')](db['SalesforceField']['rawAttributes'],function(_0xa3b0b9){return{'name':_0xa3b0b9[_0xf91e('0x29')],'type':_0xa3b0b9['type'][_0xf91e('0x2a')]};});_0x3b0a20[_0xf91e('0x2b')]=_[_0xf91e('0x28')](_0x2e79c9,_0xf91e('0x25'));_0x3b0a20[_0xf91e('0x2c')]=_[_0xf91e('0x2d')](_0x1ce726[_0xf91e('0x2c')]);_0x3b0a20[_0xf91e('0x2e')]=_['intersection'](_0x3b0a20[_0xf91e('0x2b')],_0x3b0a20[_0xf91e('0x2c')]);_0xb45c5[_0xf91e('0x2f')]=_['intersection'](_0x3b0a20[_0xf91e('0x2b')],qs[_0xf91e('0x30')](_0x1ce726[_0xf91e('0x2c')][_0xf91e('0x30')]));_0xb45c5[_0xf91e('0x2f')]=_0xb45c5['attributes']['length']?_0xb45c5[_0xf91e('0x2f')]:_0x3b0a20[_0xf91e('0x2b')];if(!_0x1ce726[_0xf91e('0x2c')]['hasOwnProperty']('nolimit')){_0xb45c5[_0xf91e('0x1f')]=qs['limit'](_0x1ce726['query'][_0xf91e('0x1f')]);_0xb45c5[_0xf91e('0x1e')]=qs['offset'](_0x1ce726[_0xf91e('0x2c')][_0xf91e('0x1e')]);}_0xb45c5[_0xf91e('0x31')]=qs['sort'](_0x1ce726['query'][_0xf91e('0x32')]);_0xb45c5[_0xf91e('0x33')]=qs[_0xf91e('0x2e')](_[_0xf91e('0x34')](_0x1ce726[_0xf91e('0x2c')],_0x3b0a20[_0xf91e('0x2e')]),_0x2e79c9);if(_0x1ce726['query'][_0xf91e('0x35')]){_0xb45c5['where']=_[_0xf91e('0x36')](_0xb45c5['where'],{'$or':_[_0xf91e('0x28')](_0x2e79c9,function(_0x5687fa){if(_0x5687fa['type']!==_0xf91e('0x37')){var _0x13dfd7={};_0x13dfd7[_0x5687fa['name']]={'$like':'%'+_0x1ce726[_0xf91e('0x2c')][_0xf91e('0x35')]+'%'};return _0x13dfd7;}})});}_0xb45c5=_[_0xf91e('0x36')]({},_0xb45c5,_0x1ce726[_0xf91e('0x38')]);var _0x187c29={'where':_0xb45c5[_0xf91e('0x33')]};return db[_0xf91e('0x39')][_0xf91e('0x1d')](_0x187c29)[_0xf91e('0x23')](function(_0x17772a){_0x393599['count']=_0x17772a;if(_0x1ce726[_0xf91e('0x2c')][_0xf91e('0x3a')]){_0xb45c5['include']=[{'all':!![]}];}return db[_0xf91e('0x39')][_0xf91e('0x3b')](_0xb45c5);})[_0xf91e('0x23')](function(_0x26bb4f){_0x393599['rows']=_0x26bb4f;return _0x393599;})[_0xf91e('0x23')](respondWithFilteredResult(_0x5c366e,_0xb45c5))[_0xf91e('0x3c')](handleError(_0x5c366e,null));};exports[_0xf91e('0x3d')]=function(_0x419027,_0x2f465c){var _0x5e4739={'raw':!![],'where':{'id':_0x419027[_0xf91e('0x3e')]['id']}},_0x1a0bed={};_0x1a0bed[_0xf91e('0x2b')]=_['keys'](db[_0xf91e('0x39')][_0xf91e('0x3f')]);_0x1a0bed[_0xf91e('0x2c')]=_[_0xf91e('0x2d')](_0x419027[_0xf91e('0x2c')]);_0x1a0bed[_0xf91e('0x2e')]=_[_0xf91e('0x40')](_0x1a0bed[_0xf91e('0x2b')],_0x1a0bed[_0xf91e('0x2c')]);_0x5e4739[_0xf91e('0x2f')]=_['intersection'](_0x1a0bed[_0xf91e('0x2b')],qs['fields'](_0x419027['query']['fields']));_0x5e4739[_0xf91e('0x2f')]=_0x5e4739[_0xf91e('0x2f')]['length']?_0x5e4739[_0xf91e('0x2f')]:_0x1a0bed['model'];if(_0x419027[_0xf91e('0x2c')][_0xf91e('0x3a')]){_0x5e4739[_0xf91e('0x41')]=[{'all':!![]}];}_0x5e4739=_['merge']({},_0x5e4739,_0x419027['options']);return db[_0xf91e('0x39')][_0xf91e('0x42')](_0x5e4739)[_0xf91e('0x23')](handleEntityNotFound(_0x2f465c,null))[_0xf91e('0x23')](respondWithResult(_0x2f465c,null))[_0xf91e('0x3c')](handleError(_0x2f465c,null));};exports[_0xf91e('0x43')]=function(_0x41ef86,_0x2e20d2){return db['SalesforceField'][_0xf91e('0x43')](_0x41ef86[_0xf91e('0x44')],{})[_0xf91e('0x23')](respondWithResult(_0x2e20d2,0xc9))[_0xf91e('0x3c')](handleError(_0x2e20d2,null));};exports['update']=function(_0x509a78,_0x5ce307){if(_0x509a78[_0xf91e('0x44')]['id']){delete _0x509a78[_0xf91e('0x44')]['id'];}return db[_0xf91e('0x39')][_0xf91e('0x42')]({'where':{'id':_0x509a78[_0xf91e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5ce307,null))[_0xf91e('0x23')](saveUpdates(_0x509a78[_0xf91e('0x44')],null))[_0xf91e('0x23')](respondWithResult(_0x5ce307,null))[_0xf91e('0x3c')](handleError(_0x5ce307,null));};exports[_0xf91e('0x22')]=function(_0x54a8d0,_0x2dfd57){return db[_0xf91e('0x39')][_0xf91e('0x42')]({'where':{'id':_0x54a8d0['params']['id']}})['then'](handleEntityNotFound(_0x2dfd57,null))[_0xf91e('0x23')](removeEntity(_0x2dfd57,null))[_0xf91e('0x3c')](handleError(_0x2dfd57,null));};
\ No newline at end of file
index 8b9f7bb..353ad51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6485=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash'];(function(_0x2b7a16,_0x3593cb){var _0xb3436f=function(_0x3a4e27){while(--_0x3a4e27){_0x2b7a16['push'](_0x2b7a16['shift']());}};_0xb3436f(++_0x3593cb);}(_0x6485,0x176));var _0x5648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6485[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5648('0x0'));var util=require(_0x5648('0x1'));var logger=require(_0x5648('0x2'))(_0x5648('0x3'));var moment=require(_0x5648('0x4'));var BPromise=require(_0x5648('0x5'));var rp=require(_0x5648('0x6'));var fs=require('fs');var path=require(_0x5648('0x7'));var rimraf=require(_0x5648('0x8'));var config=require('../../config/environment');var attributes=require(_0x5648('0x9'));module[_0x5648('0xa')]=function(_0x4ff484,_0x8b4f03){return _0x4ff484['define'](_0x5648('0xb'),attributes,{'tableName':_0x5648('0xc'),'paranoid':![],'indexes':[{'name':_0x5648('0xd'),'fields':['idField',_0x5648('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1e1e=['../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x1e1e,0x1bb));var _0xe1e1=function(_0x1e9d62,_0x25bb8e){_0x1e9d62=_0x1e9d62-0x0;var _0x56c490=_0x1e1e[_0x1e9d62];return _0x56c490;};'use strict';var _=require('lodash');var util=require(_0xe1e1('0x0'));var logger=require(_0xe1e1('0x1'))(_0xe1e1('0x2'));var moment=require(_0xe1e1('0x3'));var BPromise=require(_0xe1e1('0x4'));var rp=require(_0xe1e1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1e1('0x6'));var config=require(_0xe1e1('0x7'));var attributes=require(_0xe1e1('0x8'));module['exports']=function(_0x4fee9d,_0x134c10){return _0x4fee9d[_0xe1e1('0x9')](_0xe1e1('0xa'),attributes,{'tableName':_0xe1e1('0xb'),'paranoid':![],'indexes':[{'name':_0xe1e1('0xc'),'fields':[_0xe1e1('0xd'),_0xe1e1('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ba357b2..ed20d6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd460=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xd460,0xa8));var _0x0d46=function(_0x1eee6e,_0x12f7a3){_0x1eee6e=_0x1eee6e-0x0;var _0x3caf1d=_0xd460[_0x1eee6e];return _0x3caf1d;};'use strict';var _=require(_0x0d46('0x0'));var util=require(_0x0d46('0x1'));var moment=require(_0x0d46('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d46('0x3'))['db'];var utils=require(_0x0d46('0x4'));var logger=require(_0x0d46('0x5'))(_0x0d46('0x6'));var config=require('../../config/environment');var jayson=require(_0x0d46('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31b543,_0x11ba4e,_0x2f2e6b){return new BPromise(function(_0x3197a2,_0x47aee3){return client[_0x0d46('0x8')](_0x31b543,_0x2f2e6b)['then'](function(_0x43bc1e){logger[_0x0d46('0x9')]('SalesforceField,\x20%s,\x20%s',_0x11ba4e,'request\x20sent');logger[_0x0d46('0xa')](_0x0d46('0xb'),_0x11ba4e,'request\x20sent',JSON[_0x0d46('0xc')](_0x43bc1e));if(_0x43bc1e['error']){if(_0x43bc1e[_0x0d46('0xd')][_0x0d46('0xe')]===0x1f4){logger[_0x0d46('0xd')](_0x0d46('0xf'),_0x11ba4e,_0x43bc1e[_0x0d46('0xd')]['message']);return _0x47aee3(_0x43bc1e[_0x0d46('0xd')][_0x0d46('0x10')]);}logger[_0x0d46('0xd')]('SalesforceField,\x20%s,\x20%s',_0x11ba4e,_0x43bc1e[_0x0d46('0xd')]['message']);return _0x3197a2(_0x43bc1e['error']['message']);}else{logger[_0x0d46('0x9')](_0x0d46('0xf'),_0x11ba4e,_0x0d46('0x11'));_0x3197a2(_0x43bc1e['result']['message']);}})[_0x0d46('0x12')](function(_0x1c220a){logger[_0x0d46('0xd')](_0x0d46('0xf'),_0x11ba4e,_0x1c220a);_0x47aee3(_0x1c220a);});});}
\ No newline at end of file
+var _0xe9d3=['bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment'];(function(_0x2c2218,_0x3dedbb){var _0x1d7c00=function(_0x3662af){while(--_0x3662af){_0x2c2218['push'](_0x2c2218['shift']());}};_0x1d7c00(++_0x3dedbb);}(_0xe9d3,0x1c9));var _0x3e9d=function(_0x426197,_0x25dc71){_0x426197=_0x426197-0x0;var _0x3e2575=_0xe9d3[_0x426197];return _0x3e2575;};'use strict';var _=require(_0x3e9d('0x0'));var util=require(_0x3e9d('0x1'));var moment=require(_0x3e9d('0x2'));var BPromise=require(_0x3e9d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e9d('0x4'));var db=require(_0x3e9d('0x5'))['db'];var utils=require(_0x3e9d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3e9d('0x7'));var client=jayson[_0x3e9d('0x8')][_0x3e9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43d438,_0x13275e,_0xd6c804){return new BPromise(function(_0x3722d2,_0x4510a9){return client[_0x3e9d('0xa')](_0x43d438,_0xd6c804)[_0x3e9d('0xb')](function(_0x2abf2b){logger[_0x3e9d('0xc')](_0x3e9d('0xd'),_0x13275e,_0x3e9d('0xe'));logger['debug'](_0x3e9d('0xf'),_0x13275e,_0x3e9d('0xe'),JSON[_0x3e9d('0x10')](_0x2abf2b));if(_0x2abf2b[_0x3e9d('0x11')]){if(_0x2abf2b['error']['code']===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x13275e,_0x2abf2b[_0x3e9d('0x11')][_0x3e9d('0x12')]);return _0x4510a9(_0x2abf2b[_0x3e9d('0x11')][_0x3e9d('0x12')]);}logger[_0x3e9d('0x11')]('SalesforceField,\x20%s,\x20%s',_0x13275e,_0x2abf2b[_0x3e9d('0x11')][_0x3e9d('0x12')]);return _0x3722d2(_0x2abf2b[_0x3e9d('0x11')][_0x3e9d('0x12')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x13275e,'request\x20sent');_0x3722d2(_0x2abf2b['result']['message']);}})[_0x3e9d('0x13')](function(_0x2b4a45){logger[_0x3e9d('0x11')](_0x3e9d('0xd'),_0x13275e,_0x2b4a45);_0x4510a9(_0x2b4a45);});});}
\ No newline at end of file
index 82269e3..9f65764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb384=['put','/:id','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intServicenowAccount.controller','isAuthenticated','index','get','show','/:id/configurations','/:id/fields','post','create','addConfiguration'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xb384,0x154));var _0x4b38=function(_0x131b7d,_0x3c9b27){_0x131b7d=_0x131b7d-0x0;var _0x3ff867=_0xb384[_0x131b7d];return _0x3ff867;};'use strict';var multer=require(_0x4b38('0x0'));var util=require(_0x4b38('0x1'));var path=require(_0x4b38('0x2'));var timeout=require(_0x4b38('0x3'));var express=require('express');var router=express[_0x4b38('0x4')]();var fs_extra=require(_0x4b38('0x5'));var auth=require(_0x4b38('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4b38('0x7'));router['get']('/',auth[_0x4b38('0x8')](),controller[_0x4b38('0x9')]);router[_0x4b38('0xa')]('/:id',auth[_0x4b38('0x8')](),controller[_0x4b38('0xb')]);router['get'](_0x4b38('0xc'),auth[_0x4b38('0x8')](),controller['getConfigurations']);router['get'](_0x4b38('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x4b38('0xe')]('/',auth[_0x4b38('0x8')](),controller[_0x4b38('0xf')]);router[_0x4b38('0xe')](_0x4b38('0xc'),auth[_0x4b38('0x8')](),controller[_0x4b38('0x10')]);router[_0x4b38('0x11')](_0x4b38('0x12'),auth[_0x4b38('0x8')](),controller[_0x4b38('0x13')]);router['delete']('/:id',auth[_0x4b38('0x8')](),controller['destroy']);module[_0x4b38('0x14')]=router;
\ No newline at end of file
+var _0xc5ba=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xc5ba,0xb9));var _0xac5b=function(_0xa03344,_0x581292){_0xa03344=_0xa03344-0x0;var _0x38acfd=_0xc5ba[_0xa03344];return _0x38acfd;};'use strict';var multer=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var path=require(_0xac5b('0x2'));var timeout=require(_0xac5b('0x3'));var express=require(_0xac5b('0x4'));var router=express[_0xac5b('0x5')]();var fs_extra=require(_0xac5b('0x6'));var auth=require(_0xac5b('0x7'));var interaction=require(_0xac5b('0x8'));var config=require(_0xac5b('0x9'));var controller=require(_0xac5b('0xa'));router[_0xac5b('0xb')]('/',auth[_0xac5b('0xc')](),controller[_0xac5b('0xd')]);router[_0xac5b('0xb')](_0xac5b('0xe'),auth[_0xac5b('0xc')](),controller['show']);router['get'](_0xac5b('0xf'),auth['isAuthenticated'](),controller[_0xac5b('0x10')]);router[_0xac5b('0xb')](_0xac5b('0x11'),auth[_0xac5b('0xc')](),controller[_0xac5b('0x12')]);router[_0xac5b('0x13')]('/',auth[_0xac5b('0xc')](),controller[_0xac5b('0x14')]);router[_0xac5b('0x13')]('/:id/configurations',auth[_0xac5b('0xc')](),controller[_0xac5b('0x15')]);router[_0xac5b('0x16')](_0xac5b('0xe'),auth[_0xac5b('0xc')](),controller[_0xac5b('0x17')]);router[_0xac5b('0x18')](_0xac5b('0xe'),auth[_0xac5b('0xc')](),controller[_0xac5b('0x19')]);module[_0xac5b('0x1a')]=router;
\ No newline at end of file
index 687aebf..590f3a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5ac=['username','remoteUri','exports','STRING'];(function(_0x3ff59d,_0x209599){var _0x221f59=function(_0x121af2){while(--_0x121af2){_0x3ff59d['push'](_0x3ff59d['shift']());}};_0x221f59(++_0x209599);}(_0xf5ac,0x1ee));var _0xcf5a=function(_0x39bcbd,_0x2ab35d){_0x39bcbd=_0x39bcbd-0x0;var _0x285760=_0xf5ac[_0x39bcbd];return _0x285760;};'use strict';var Sequelize=require('sequelize');module[_0xcf5a('0x0')]={'name':{'type':Sequelize[_0xcf5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xcf5a('0x1')],'unique':_0xcf5a('0x2')},'password':{'type':Sequelize[_0xcf5a('0x1')]},'email':{'type':Sequelize[_0xcf5a('0x1')]},'remoteUri':{'type':Sequelize[_0xcf5a('0x1')],'unique':_0xcf5a('0x3')},'serverUrl':{'type':Sequelize[_0xcf5a('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x70be=['remoteUri','exports','STRING'];(function(_0x3d1de3,_0x28f082){var _0x3d5ad3=function(_0x3a9921){while(--_0x3a9921){_0x3d1de3['push'](_0x3d1de3['shift']());}};_0x3d5ad3(++_0x28f082);}(_0x70be,0x1a8));var _0xe70b=function(_0x1f27ba,_0x2b1309){_0x1f27ba=_0x1f27ba-0x0;var _0x39a03d=_0x70be[_0x1f27ba];return _0x39a03d;};'use strict';var Sequelize=require('sequelize');module[_0xe70b('0x0')]={'name':{'type':Sequelize[_0xe70b('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe70b('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xe70b('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe70b('0x1')],'unique':_0xe70b('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index ca0c99c..25b5d7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39ee=['fields','length','nolimit','sort','filter','where','merge','includeAll','findAll','catch','show','params','include','options','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','resolved_at','caller_id','work_notes','short_description','assignment_group','business_stc','description','calendar_duration','close_notes','follow_up','sys_id','contact_type','urgency','problem_id','reassignment_count','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident\x20table\x20objects','assign','remove','includes','forEach','label','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','push','all','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','result','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model'];(function(_0x330ca3,_0x490f0a){var _0x3ff596=function(_0x3758c8){while(--_0x3758c8){_0x330ca3['push'](_0x330ca3['shift']());}};_0x3ff596(++_0x490f0a);}(_0x39ee,0x13a));var _0xe39e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x39ee[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe39e('0x0'));var zipdir=require(_0xe39e('0x1'));var jsonpatch=require(_0xe39e('0x2'));var rp=require(_0xe39e('0x3'));var moment=require(_0xe39e('0x4'));var BPromise=require(_0xe39e('0x5'));var Mustache=require(_0xe39e('0x6'));var util=require(_0xe39e('0x7'));var path=require(_0xe39e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe39e('0x9'));var fs=require('fs');var fs_extra=require(_0xe39e('0xa'));var _=require('lodash');var squel=require(_0xe39e('0xb'));var crypto=require(_0xe39e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe39e('0xd'));var toCsv=require(_0xe39e('0xe'));var querystring=require(_0xe39e('0xf'));var Papa=require(_0xe39e('0x10'));var Redis=require(_0xe39e('0x11'));var authService=require(_0xe39e('0x12'));var qs=require(_0xe39e('0x13'));var as=require(_0xe39e('0x14'));var hardwareService=require(_0xe39e('0x15'));var logger=require(_0xe39e('0x16'))(_0xe39e('0x17'));var utils=require(_0xe39e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe39e('0x19'));var db=require(_0xe39e('0x1a'))['db'];var integrations=require(_0xe39e('0x1b'));function respondWithStatusCode(_0x3e2b67,_0x3ffa4f){_0x3ffa4f=_0x3ffa4f||0xcc;return function(_0x2aa486){if(_0x2aa486){return _0x3e2b67['sendStatus'](_0x3ffa4f);}return _0x3e2b67['status'](_0x3ffa4f)[_0xe39e('0x1c')]();};}function respondWithResult(_0x371114,_0x3c4086){_0x3c4086=_0x3c4086||0xc8;return function(_0x29544f){if(_0x29544f){return _0x371114[_0xe39e('0x1d')](_0x3c4086)[_0xe39e('0x1e')](_0x29544f);}};}function respondWithFilteredResult(_0x1317b2,_0x4c99f9){return function(_0x24ae7c){if(_0x24ae7c){var _0x407732=typeof _0x4c99f9[_0xe39e('0x1f')]===_0xe39e('0x20')&&typeof _0x4c99f9[_0xe39e('0x21')]===_0xe39e('0x20');var _0x33840c=_0x24ae7c[_0xe39e('0x22')];var _0x192b58=_0x407732?0x0:_0x4c99f9[_0xe39e('0x1f')];var _0x127d87=_0x407732?_0x24ae7c[_0xe39e('0x22')]:_0x4c99f9[_0xe39e('0x1f')]+_0x4c99f9[_0xe39e('0x21')];var _0x298119;if(_0x127d87>=_0x33840c){_0x127d87=_0x33840c;_0x298119=0xc8;}else{_0x298119=0xce;}_0x1317b2[_0xe39e('0x1d')](_0x298119);return _0x1317b2[_0xe39e('0x23')](_0xe39e('0x24'),_0x192b58+'-'+_0x127d87+'/'+_0x33840c)[_0xe39e('0x1e')](_0x24ae7c);}return null;};}function patchUpdates(_0x492d78){return function(_0x242afd){try{jsonpatch['apply'](_0x242afd,_0x492d78,!![]);}catch(_0x1faba8){return BPromise[_0xe39e('0x25')](_0x1faba8);}return _0x242afd[_0xe39e('0x26')]();};}function saveUpdates(_0x588e15,_0x7a9756){return function(_0x40d979){if(_0x40d979){return _0x40d979['update'](_0x588e15)[_0xe39e('0x27')](function(_0x1dbd08){return _0x1dbd08;});}return null;};}function removeEntity(_0x50fda3,_0x597e03){return function(_0x5c51d9){if(_0x5c51d9){return _0x5c51d9[_0xe39e('0x28')]()['then'](function(){_0x50fda3[_0xe39e('0x1d')](0xcc)[_0xe39e('0x1c')]();});}};}function handleEntityNotFound(_0x2c7de9,_0x2410c9){return function(_0x296869){if(!_0x296869){_0x2c7de9[_0xe39e('0x29')](0x194);}return _0x296869;};}function handleError(_0x2571ed,_0x4737ed){_0x4737ed=_0x4737ed||0x1f4;return function(_0x41e011){logger[_0xe39e('0x2a')](_0x41e011[_0xe39e('0x2b')]);if(_0x41e011[_0xe39e('0x2c')]){delete _0x41e011['name'];}_0x2571ed[_0xe39e('0x1d')](_0x4737ed)[_0xe39e('0x2d')](_0x41e011);};}exports[_0xe39e('0x2e')]=function(_0x295e07,_0x97395c){var _0x131ca7={},_0x370fb1={},_0x2a26ae={'count':0x0,'rows':[]};var _0x4adc25=_[_0xe39e('0x2f')](db[_0xe39e('0x30')][_0xe39e('0x31')],function(_0x1af359){return{'name':_0x1af359[_0xe39e('0x32')],'type':_0x1af359[_0xe39e('0x33')]['key']};});_0x370fb1['model']=_[_0xe39e('0x2f')](_0x4adc25,_0xe39e('0x2c'));_0x370fb1[_0xe39e('0x34')]=_[_0xe39e('0x35')](_0x295e07[_0xe39e('0x34')]);_0x370fb1[_0xe39e('0x36')]=_[_0xe39e('0x37')](_0x370fb1['model'],_0x370fb1['query']);_0x131ca7[_0xe39e('0x38')]=_['intersection'](_0x370fb1[_0xe39e('0x39')],qs['fields'](_0x295e07[_0xe39e('0x34')][_0xe39e('0x3a')]));_0x131ca7[_0xe39e('0x38')]=_0x131ca7['attributes'][_0xe39e('0x3b')]?_0x131ca7[_0xe39e('0x38')]:_0x370fb1[_0xe39e('0x39')];if(!_0x295e07['query']['hasOwnProperty'](_0xe39e('0x3c'))){_0x131ca7['limit']=qs[_0xe39e('0x21')](_0x295e07[_0xe39e('0x34')][_0xe39e('0x21')]);_0x131ca7['offset']=qs[_0xe39e('0x1f')](_0x295e07[_0xe39e('0x34')][_0xe39e('0x1f')]);}_0x131ca7['order']=qs[_0xe39e('0x3d')](_0x295e07['query'][_0xe39e('0x3d')]);_0x131ca7['where']=qs[_0xe39e('0x36')](_['pick'](_0x295e07[_0xe39e('0x34')],_0x370fb1['filters']),_0x4adc25);if(_0x295e07[_0xe39e('0x34')][_0xe39e('0x3e')]){_0x131ca7[_0xe39e('0x3f')]=_['merge'](_0x131ca7[_0xe39e('0x3f')],{'$or':_[_0xe39e('0x2f')](_0x4adc25,function(_0x41e8f5){if(_0x41e8f5[_0xe39e('0x33')]!=='VIRTUAL'){var _0xdf8455={};_0xdf8455[_0x41e8f5['name']]={'$like':'%'+_0x295e07[_0xe39e('0x34')][_0xe39e('0x3e')]+'%'};return _0xdf8455;}})});}_0x131ca7=_[_0xe39e('0x40')]({},_0x131ca7,_0x295e07['options']);var _0x548d83={'where':_0x131ca7[_0xe39e('0x3f')]};return db[_0xe39e('0x30')][_0xe39e('0x22')](_0x548d83)[_0xe39e('0x27')](function(_0x145627){_0x2a26ae[_0xe39e('0x22')]=_0x145627;if(_0x295e07[_0xe39e('0x34')][_0xe39e('0x41')]){_0x131ca7['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0xe39e('0x42')](_0x131ca7);})[_0xe39e('0x27')](function(_0x2eacb5){_0x2a26ae['rows']=_0x2eacb5;return _0x2a26ae;})[_0xe39e('0x27')](respondWithFilteredResult(_0x97395c,_0x131ca7))[_0xe39e('0x43')](handleError(_0x97395c,null));};exports[_0xe39e('0x44')]=function(_0x4d0fb4,_0x685566){var _0x44b746={'raw':![],'where':{'id':_0x4d0fb4[_0xe39e('0x45')]['id']}},_0x171c46={};_0x171c46[_0xe39e('0x39')]=_[_0xe39e('0x35')](db[_0xe39e('0x30')][_0xe39e('0x31')]);_0x171c46[_0xe39e('0x34')]=_[_0xe39e('0x35')](_0x4d0fb4[_0xe39e('0x34')]);_0x171c46[_0xe39e('0x36')]=_[_0xe39e('0x37')](_0x171c46['model'],_0x171c46[_0xe39e('0x34')]);_0x44b746['attributes']=_[_0xe39e('0x37')](_0x171c46[_0xe39e('0x39')],qs[_0xe39e('0x3a')](_0x4d0fb4[_0xe39e('0x34')][_0xe39e('0x3a')]));_0x44b746['attributes']=_0x44b746[_0xe39e('0x38')][_0xe39e('0x3b')]?_0x44b746['attributes']:_0x171c46[_0xe39e('0x39')];if(_0x4d0fb4[_0xe39e('0x34')]['includeAll']){_0x44b746[_0xe39e('0x46')]=[{'all':!![]}];}_0x44b746=_[_0xe39e('0x40')]({},_0x44b746,_0x4d0fb4[_0xe39e('0x47')]);return db[_0xe39e('0x30')][_0xe39e('0x48')](_0x44b746)['then'](handleEntityNotFound(_0x685566,null))[_0xe39e('0x27')](respondWithResult(_0x685566,null))[_0xe39e('0x43')](handleError(_0x685566,null));};exports[_0xe39e('0x49')]=function(_0x49a9b8,_0xd9db22){return db[_0xe39e('0x30')]['create'](_0x49a9b8[_0xe39e('0x4a')],{})['then'](respondWithResult(_0xd9db22,0xc9))[_0xe39e('0x43')](handleError(_0xd9db22,null));};exports[_0xe39e('0x4b')]=function(_0xcb24cd,_0x21196c){if(_0xcb24cd['body']['id']){delete _0xcb24cd[_0xe39e('0x4a')]['id'];}return db[_0xe39e('0x30')]['find']({'where':{'id':_0xcb24cd[_0xe39e('0x45')]['id']}})[_0xe39e('0x27')](handleEntityNotFound(_0x21196c,null))[_0xe39e('0x27')](saveUpdates(_0xcb24cd['body'],null))[_0xe39e('0x27')](respondWithResult(_0x21196c,null))[_0xe39e('0x43')](handleError(_0x21196c,null));};exports[_0xe39e('0x28')]=function(_0x50ea9f,_0x27f4ed){return db[_0xe39e('0x30')]['find']({'where':{'id':_0x50ea9f[_0xe39e('0x45')]['id']}})[_0xe39e('0x27')](handleEntityNotFound(_0x27f4ed,null))[_0xe39e('0x27')](removeEntity(_0x27f4ed,null))[_0xe39e('0x43')](handleError(_0x27f4ed,null));};exports[_0xe39e('0x4c')]=function(_0x2a991c,_0x348809,_0x327048){var _0x1f4c07={};var _0x3c9a44={};var _0x537fc3;var _0x37b5bd;return db[_0xe39e('0x30')][_0xe39e('0x4d')]({'where':{'id':_0x2a991c[_0xe39e('0x45')]['id']}})['then'](handleEntityNotFound(_0x348809,null))['then'](function(_0x4203f4){if(_0x4203f4){_0x537fc3=_0x4203f4;_0x3c9a44['model']=_[_0xe39e('0x35')](db[_0xe39e('0x4e')][_0xe39e('0x31')]);_0x3c9a44[_0xe39e('0x34')]=_[_0xe39e('0x35')](_0x2a991c['query']);_0x3c9a44[_0xe39e('0x36')]=_['intersection'](_0x3c9a44['model'],_0x3c9a44[_0xe39e('0x34')]);_0x1f4c07[_0xe39e('0x38')]=_['intersection'](_0x3c9a44[_0xe39e('0x39')],qs['fields'](_0x2a991c['query'][_0xe39e('0x3a')]));_0x1f4c07[_0xe39e('0x38')]=_0x1f4c07[_0xe39e('0x38')][_0xe39e('0x3b')]?_0x1f4c07['attributes']:_0x3c9a44[_0xe39e('0x39')];_0x1f4c07[_0xe39e('0x4f')]=qs[_0xe39e('0x3d')](_0x2a991c['query'][_0xe39e('0x3d')]);_0x1f4c07[_0xe39e('0x3f')]=qs[_0xe39e('0x36')](_['pick'](_0x2a991c[_0xe39e('0x34')],_0x3c9a44[_0xe39e('0x36')]));if(_0x2a991c['query'][_0xe39e('0x3e')]){_0x1f4c07['where']=_[_0xe39e('0x40')](_0x1f4c07[_0xe39e('0x3f')],{'$or':_['map'](_0x1f4c07[_0xe39e('0x38')],function(_0x5842a0){var _0x508945={};_0x508945[_0x5842a0]={'$like':'%'+_0x2a991c[_0xe39e('0x34')][_0xe39e('0x3e')]+'%'};return _0x508945;})});}_0x1f4c07=_['merge']({},_0x1f4c07,_0x2a991c[_0xe39e('0x47')]);return _0x537fc3[_0xe39e('0x4c')](_0x1f4c07);}})['then'](function(_0x10392b){if(_0x10392b){_0x37b5bd=_0x10392b['length'];if(!_0x2a991c[_0xe39e('0x34')]['hasOwnProperty'](_0xe39e('0x3c'))){_0x1f4c07['limit']=qs['limit'](_0x2a991c['query'][_0xe39e('0x21')]);_0x1f4c07['offset']=qs[_0xe39e('0x1f')](_0x2a991c['query'][_0xe39e('0x1f')]);}return _0x537fc3[_0xe39e('0x4c')](_0x1f4c07);}})['then'](function(_0x578b01){if(_0x578b01){return _0x578b01?{'count':_0x37b5bd,'rows':_0x578b01}:null;}})[_0xe39e('0x27')](respondWithResult(_0x348809,null))[_0xe39e('0x43')](handleError(_0x348809,null));};exports[_0xe39e('0x50')]=function(_0xcda724,_0x357079,_0x47360d){if(_0xcda724[_0xe39e('0x4a')]['id']){delete _0xcda724[_0xe39e('0x4a')]['id'];}return db[_0xe39e('0x30')]['findOne']({'where':{'id':_0xcda724[_0xe39e('0x45')]['id']}})[_0xe39e('0x27')](handleEntityNotFound(_0x357079,null))[_0xe39e('0x27')](function(_0x53ba13){if(_0x53ba13){_0xcda724[_0xe39e('0x4a')][_0xe39e('0x51')]=_0x53ba13['id'];_0xcda724['body'][_0xe39e('0x52')]=integrations[_0xe39e('0x53')](_0xcda724['body'][_0xe39e('0x54')],_0xcda724['body'][_0xe39e('0x33')]);_0xcda724[_0xe39e('0x4a')][_0xe39e('0x55')]=integrations[_0xe39e('0x56')](_0xcda724[_0xe39e('0x4a')][_0xe39e('0x54')],_0xcda724['body'][_0xe39e('0x33')]);return db[_0xe39e('0x4e')][_0xe39e('0x49')](_0xcda724[_0xe39e('0x4a')],{'include':[{'model':db[_0xe39e('0x57')],'as':_0xe39e('0x52')},{'model':db[_0xe39e('0x57')],'as':'Descriptions'}]});}return null;})[_0xe39e('0x27')](respondWithResult(_0x357079,null))[_0xe39e('0x43')](handleError(_0x357079,null));};exports[_0xe39e('0x58')]=function(_0x239b67,_0x27c830,_0x321512){var _0x251709=['made_sla','hold_reason',_0xe39e('0x59'),_0xe39e('0x5a'),_0xe39e('0x5b'),_0xe39e('0x5c'),_0xe39e('0x5d'),_0xe39e('0x5e'),_0xe39e('0x5f')];var _0x13deb4=[_0xe39e('0x60'),_0xe39e('0x61'),_0xe39e('0x62'),_0xe39e('0x63'),_0xe39e('0x64'),_0xe39e('0x65'),'child_incidents',_0xe39e('0x66'),_0xe39e('0x67'),_0xe39e('0x68'),_0xe39e('0x69'),_0xe39e('0x6a'),_0xe39e('0x6b'),_0xe39e('0x6c'),'sys_created_on',_0xe39e('0x6d'),'state',_0xe39e('0x6e'),'knowledge',_0xe39e('0x4f'),_0xe39e('0x6f'),_0xe39e('0x70'),_0xe39e('0x71'),_0xe39e('0x72'),_0xe39e('0x73'),_0xe39e('0x74'),'work_notes_list','business_service',_0xe39e('0x75'),_0xe39e('0x76'),_0xe39e('0x77'),_0xe39e('0x78'),_0xe39e('0x79'),_0xe39e('0x7a'),_0xe39e('0x7b'),_0xe39e('0x7c'),'work_end','reopened_time',_0xe39e('0x7d'),_0xe39e('0x7e'),'approval_set','subcategory',_0xe39e('0x7f'),_0xe39e('0x80'),_0xe39e('0x5b'),'correlation_display','delivery_task','work_start',_0xe39e('0x81'),_0xe39e('0x82'),'additional_assignee_list',_0xe39e('0x83'),_0xe39e('0x84'),_0xe39e('0x5c'),'sys_class_name',_0xe39e('0x85'),'closed_by',_0xe39e('0x86'),'parent_incident',_0xe39e('0x87'),_0xe39e('0x88'),'reopened_by',_0xe39e('0x5d'),_0xe39e('0x89'),_0xe39e('0x8a'),'company',_0xe39e('0x8b'),'activity_due',_0xe39e('0x8c'),'severity',_0xe39e('0x8d'),_0xe39e('0x8e'),'approval',_0xe39e('0x8f'),_0xe39e('0x90'),'sys_mod_count','reopen_count',_0xe39e('0x91'),_0xe39e('0x92'),_0xe39e('0x93'),_0xe39e('0x94'),_0xe39e('0x95'),'category'];var _0x5eea58='';var _0x2c6b81='';var _0x68d2cd=[];var _0x2b476a='';var _0x31f956='';var _0x290348=[];var _0x544102='';var _0x4ca456='';var _0x2f6e76={};var _0x392dcc='';return db[_0xe39e('0x30')][_0xe39e('0x4d')]({'where':{'id':_0x239b67[_0xe39e('0x45')]['id']},'attributes':['id',_0xe39e('0x96'),_0xe39e('0x97'),_0xe39e('0x98'),_0xe39e('0x99'),_0xe39e('0x9a')]})[_0xe39e('0x27')](handleEntityNotFound(_0x27c830,null))[_0xe39e('0x27')](function(_0x14a08f){if(_0x14a08f){_0x392dcc=_0x14a08f[_0xe39e('0x99')];var _0x35cb4e=_0x392dcc[_0xe39e('0x9b')](-0x1);if(_0x35cb4e==='/'){_0x392dcc=_0x392dcc[_0xe39e('0x9c')](0x0,_0x392dcc[_0xe39e('0x9d')](_0x35cb4e));}_0x4ca456=util[_0xe39e('0x9e')](_0xe39e('0x9f'),_0x392dcc);_0x544102=util[_0xe39e('0x9e')]('%s/api/now/table/',_0x392dcc);_0x2f6e76={'user':_0x14a08f[_0xe39e('0x96')],'pass':_0x14a08f[_0xe39e('0x97')]};var _0x56667a={'method':_0xe39e('0xa0'),'uri':_0x4ca456+'incident?sysparm_display_value=all','auth':_0x2f6e76,'json':!![]};return rp(_0x56667a);}})[_0xe39e('0x27')](function(_0x424062){if(_0x424062['result']['length']>0x0){_0x5eea58=_0x424062['result'];}console['log'](_0xe39e('0xa1'),_0x5eea58);_0x290348=[];_0x2c6b81=Object[_0xe39e('0xa2')]([],_0x5eea58);_[_0xe39e('0xa3')](_0x2c6b81,function(_0xe75279){return!_0x251709[_0xe39e('0xa4')](_0xe75279[_0xe39e('0x2c')]);});_0x2c6b81[_0xe39e('0xa5')](function(_0x31540b){var _0x4d718f=createFieldObject(_0x544102,_0x2f6e76,_0x31540b['internalType'],_0x31540b[_0xe39e('0x2c')],_0x31540b[_0xe39e('0xa6')],![]);_0x290348['push'](_0x4d718f);});return Promise['all'](_0x290348);})[_0xe39e('0x27')](function(_0x3b53aa){_0x68d2cd=_0x3b53aa;_0x2b476a=Object[_0xe39e('0xa2')]([],_0x5eea58);console[_0xe39e('0xa7')](_0xe39e('0xa8'),_0x5eea58);_[_0xe39e('0xa3')](_0x2b476a,function(_0x2c976c){return _0x13deb4['includes'](_0x2c976c[_0xe39e('0x2c')]);});console[_0xe39e('0xa7')](_0xe39e('0xa9'),_0x2b476a);_0x290348=[];_0x2b476a['forEach'](function(_0x539f42){var _0x5eb29e=createFieldObject(_0x544102,_0x2f6e76,_0x539f42[_0xe39e('0xaa')],_0x539f42[_0xe39e('0x2c')],_0x539f42['label'],!![]);_0x290348[_0xe39e('0xab')](_0x5eb29e);});return Promise[_0xe39e('0xac')](_0x290348);})[_0xe39e('0x27')](function(_0x34e80f){_0x31f956=_0x34e80f;var _0x37d887=_0x68d2cd[_0xe39e('0xad')](_0x31f956);return{'count':_0x37d887[_0xe39e('0x3b')],'rows':_0x37d887};})[_0xe39e('0x27')](respondWithResult(_0x27c830,null))[_0xe39e('0x43')](function(_0x52e61b){console['log'](_0xe39e('0xae')+_0x52e61b);var _0x2352d2=_0x239b67[_0xe39e('0x34')][_0xe39e('0xaf')]?0x1f4:_0x52e61b[_0xe39e('0xb0')]||0x1f4;logger['error'](_0x52e61b[_0xe39e('0x2b')]);delete _0x52e61b[_0xe39e('0x2c')];if(_0x2352d2===0x191){_0x2352d2=0x190;}_0x27c830[_0xe39e('0x1d')](_0x2352d2)['send'](_0x239b67[_0xe39e('0x34')]['test']?{'message':_0xe39e('0xb1'),'statusCode':_0x52e61b[_0xe39e('0xb0')]}:_0x52e61b);});};function createFieldObject(_0x4cdd5b,_0x321704,_0x130383,_0x3b08c6,_0x317fb6,_0x2db79f){return new Promise(function(_0x29cad9,_0x5b5629){var _0x3ff8ed={'id':_0x3b08c6,'name':_0x317fb6,'custom':_0x2db79f};if(_0x130383===_0xe39e('0xb2')){_0x3ff8ed['options']=[{'name':_0xe39e('0xb3'),'value':_0xe39e('0xb4')},{'name':'False','value':_0xe39e('0xb5')}];_0x29cad9(_0x3ff8ed);}else{var _0x2d15dc={'method':_0xe39e('0xa0'),'uri':_0x4cdd5b+_0xe39e('0xb6')+_0x3b08c6,'auth':_0x321704,'json':!![]};return rp(_0x2d15dc)[_0xe39e('0x27')](function(_0xac76fe){var _0x49f973=[];if(_0xac76fe[_0xe39e('0xb7')]['length']>0x0){_0xac76fe[_0xe39e('0xb7')][_0xe39e('0xa5')](function(_0x2022db){if(_0x2022db[_0xe39e('0xb8')]===_0xe39e('0xb5')){var _0x57cee3={'name':_0x2022db[_0xe39e('0xa6')],'value':_0x2022db[_0xe39e('0xb9')]};_0x49f973['push'](_0x57cee3);}});}_0x3ff8ed[_0xe39e('0x47')]=_0x49f973;if(_0x3ff8ed[_0xe39e('0x47')][_0xe39e('0x3b')]>0x0){_0x29cad9(_0x3ff8ed);}else{if(_0x2db79f==![]){_0x29cad9();}else{_0x29cad9(_0x3ff8ed);}}});}});}
\ No newline at end of file
+var _0x7f79=['destroy','end','error','stack','name','index','ServicenowAccount','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','sort','filters','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','find','getConfigurations','findOne','ServicenowConfiguration','length','order','pick','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','Subjects','ServicenowField','getFields','hold_reason','knowledge','close_code','incident_state','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','group_list','work_end','resolved_at','caller_id','approval_set','subcategory','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','description','notify','sys_class_name','close_notes','closed_by','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','includes','internalType','push','all','assign','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','true','false','GET','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then'];(function(_0x352fc1,_0x1e3a10){var _0x3d14eb=function(_0x3a3bba){while(--_0x3a3bba){_0x352fc1['push'](_0x352fc1['shift']());}};_0x3d14eb(++_0x1e3a10);}(_0x7f79,0x14b));var _0x97f7=function(_0x361349,_0x23b4cb){_0x361349=_0x361349-0x0;var _0x442a3c=_0x7f79[_0x361349];return _0x442a3c;};'use strict';var emlformat=require(_0x97f7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x97f7('0x1'));var jsonpatch=require(_0x97f7('0x2'));var rp=require(_0x97f7('0x3'));var moment=require(_0x97f7('0x4'));var BPromise=require(_0x97f7('0x5'));var Mustache=require('mustache');var util=require(_0x97f7('0x6'));var path=require(_0x97f7('0x7'));var sox=require(_0x97f7('0x8'));var csv=require('to-csv');var ejs=require(_0x97f7('0x9'));var fs=require('fs');var fs_extra=require(_0x97f7('0xa'));var _=require(_0x97f7('0xb'));var squel=require(_0x97f7('0xc'));var crypto=require(_0x97f7('0xd'));var jsforce=require(_0x97f7('0xe'));var deskjs=require(_0x97f7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x97f7('0x10'));var Papa=require(_0x97f7('0x11'));var Redis=require(_0x97f7('0x12'));var authService=require(_0x97f7('0x13'));var qs=require(_0x97f7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97f7('0x15'));var logger=require(_0x97f7('0x16'))(_0x97f7('0x17'));var utils=require(_0x97f7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x97f7('0x19'));var db=require(_0x97f7('0x1a'))['db'];var integrations=require(_0x97f7('0x1b'));function respondWithStatusCode(_0x124b7a,_0x2a77b6){_0x2a77b6=_0x2a77b6||0xcc;return function(_0x339bac){if(_0x339bac){return _0x124b7a[_0x97f7('0x1c')](_0x2a77b6);}return _0x124b7a[_0x97f7('0x1d')](_0x2a77b6)['end']();};}function respondWithResult(_0x5f5739,_0x557065){_0x557065=_0x557065||0xc8;return function(_0x2e3cf5){if(_0x2e3cf5){return _0x5f5739['status'](_0x557065)['json'](_0x2e3cf5);}};}function respondWithFilteredResult(_0x32020f,_0x199df6){return function(_0x3d1187){if(_0x3d1187){var _0x1e6654=typeof _0x199df6[_0x97f7('0x1e')]===_0x97f7('0x1f')&&typeof _0x199df6[_0x97f7('0x20')]==='undefined';var _0x414334=_0x3d1187['count'];var _0x2ed68c=_0x1e6654?0x0:_0x199df6[_0x97f7('0x1e')];var _0x53e4bd=_0x1e6654?_0x3d1187[_0x97f7('0x21')]:_0x199df6[_0x97f7('0x1e')]+_0x199df6[_0x97f7('0x20')];var _0x27d873;if(_0x53e4bd>=_0x414334){_0x53e4bd=_0x414334;_0x27d873=0xc8;}else{_0x27d873=0xce;}_0x32020f['status'](_0x27d873);return _0x32020f[_0x97f7('0x22')](_0x97f7('0x23'),_0x2ed68c+'-'+_0x53e4bd+'/'+_0x414334)[_0x97f7('0x24')](_0x3d1187);}return null;};}function patchUpdates(_0x205543){return function(_0x4ac5d2){try{jsonpatch[_0x97f7('0x25')](_0x4ac5d2,_0x205543,!![]);}catch(_0x4db1e2){return BPromise['reject'](_0x4db1e2);}return _0x4ac5d2[_0x97f7('0x26')]();};}function saveUpdates(_0xd04982,_0x599137){return function(_0xa4e2d1){if(_0xa4e2d1){return _0xa4e2d1[_0x97f7('0x27')](_0xd04982)[_0x97f7('0x28')](function(_0x15941d){return _0x15941d;});}return null;};}function removeEntity(_0x507265,_0x4873a5){return function(_0x3b6009){if(_0x3b6009){return _0x3b6009[_0x97f7('0x29')]()[_0x97f7('0x28')](function(){_0x507265[_0x97f7('0x1d')](0xcc)[_0x97f7('0x2a')]();});}};}function handleEntityNotFound(_0x38bff3,_0x2aaa7d){return function(_0x1f9431){if(!_0x1f9431){_0x38bff3['sendStatus'](0x194);}return _0x1f9431;};}function handleError(_0x5e540e,_0x5436ff){_0x5436ff=_0x5436ff||0x1f4;return function(_0x1b9e87){logger[_0x97f7('0x2b')](_0x1b9e87[_0x97f7('0x2c')]);if(_0x1b9e87[_0x97f7('0x2d')]){delete _0x1b9e87[_0x97f7('0x2d')];}_0x5e540e[_0x97f7('0x1d')](_0x5436ff)['send'](_0x1b9e87);};}exports[_0x97f7('0x2e')]=function(_0x20cc7a,_0x2d34cf){var _0x3a2e17={},_0x36d023={},_0x154caa={'count':0x0,'rows':[]};var _0x294819=_['map'](db[_0x97f7('0x2f')]['rawAttributes'],function(_0x286732){return{'name':_0x286732[_0x97f7('0x30')],'type':_0x286732[_0x97f7('0x31')][_0x97f7('0x32')]};});_0x36d023[_0x97f7('0x33')]=_[_0x97f7('0x34')](_0x294819,_0x97f7('0x2d'));_0x36d023[_0x97f7('0x35')]=_[_0x97f7('0x36')](_0x20cc7a[_0x97f7('0x35')]);_0x36d023['filters']=_[_0x97f7('0x37')](_0x36d023[_0x97f7('0x33')],_0x36d023[_0x97f7('0x35')]);_0x3a2e17[_0x97f7('0x38')]=_[_0x97f7('0x37')](_0x36d023['model'],qs[_0x97f7('0x39')](_0x20cc7a[_0x97f7('0x35')][_0x97f7('0x39')]));_0x3a2e17['attributes']=_0x3a2e17[_0x97f7('0x38')]['length']?_0x3a2e17[_0x97f7('0x38')]:_0x36d023[_0x97f7('0x33')];if(!_0x20cc7a[_0x97f7('0x35')]['hasOwnProperty'](_0x97f7('0x3a'))){_0x3a2e17[_0x97f7('0x20')]=qs[_0x97f7('0x20')](_0x20cc7a[_0x97f7('0x35')][_0x97f7('0x20')]);_0x3a2e17[_0x97f7('0x1e')]=qs['offset'](_0x20cc7a[_0x97f7('0x35')]['offset']);}_0x3a2e17['order']=qs[_0x97f7('0x3b')](_0x20cc7a[_0x97f7('0x35')][_0x97f7('0x3b')]);_0x3a2e17['where']=qs[_0x97f7('0x3c')](_['pick'](_0x20cc7a[_0x97f7('0x35')],_0x36d023[_0x97f7('0x3c')]),_0x294819);if(_0x20cc7a[_0x97f7('0x35')]['filter']){_0x3a2e17[_0x97f7('0x3d')]=_['merge'](_0x3a2e17[_0x97f7('0x3d')],{'$or':_[_0x97f7('0x34')](_0x294819,function(_0x9735a0){if(_0x9735a0[_0x97f7('0x31')]!==_0x97f7('0x3e')){var _0x5d3332={};_0x5d3332[_0x9735a0[_0x97f7('0x2d')]]={'$like':'%'+_0x20cc7a[_0x97f7('0x35')][_0x97f7('0x3f')]+'%'};return _0x5d3332;}})});}_0x3a2e17=_[_0x97f7('0x40')]({},_0x3a2e17,_0x20cc7a[_0x97f7('0x41')]);var _0x5e2fb2={'where':_0x3a2e17[_0x97f7('0x3d')]};return db[_0x97f7('0x2f')][_0x97f7('0x21')](_0x5e2fb2)['then'](function(_0x101c1b){_0x154caa[_0x97f7('0x21')]=_0x101c1b;if(_0x20cc7a['query'][_0x97f7('0x42')]){_0x3a2e17['include']=[{'all':!![]}];}return db[_0x97f7('0x2f')][_0x97f7('0x43')](_0x3a2e17);})[_0x97f7('0x28')](function(_0x55dd97){_0x154caa[_0x97f7('0x44')]=_0x55dd97;return _0x154caa;})[_0x97f7('0x28')](respondWithFilteredResult(_0x2d34cf,_0x3a2e17))[_0x97f7('0x45')](handleError(_0x2d34cf,null));};exports[_0x97f7('0x46')]=function(_0x51eca2,_0x1b84f2){var _0x4164eb={'raw':![],'where':{'id':_0x51eca2[_0x97f7('0x47')]['id']}},_0x5a6b03={};_0x5a6b03[_0x97f7('0x33')]=_[_0x97f7('0x36')](db['ServicenowAccount'][_0x97f7('0x48')]);_0x5a6b03['query']=_[_0x97f7('0x36')](_0x51eca2[_0x97f7('0x35')]);_0x5a6b03['filters']=_[_0x97f7('0x37')](_0x5a6b03[_0x97f7('0x33')],_0x5a6b03[_0x97f7('0x35')]);_0x4164eb[_0x97f7('0x38')]=_[_0x97f7('0x37')](_0x5a6b03['model'],qs['fields'](_0x51eca2[_0x97f7('0x35')][_0x97f7('0x39')]));_0x4164eb[_0x97f7('0x38')]=_0x4164eb['attributes']['length']?_0x4164eb[_0x97f7('0x38')]:_0x5a6b03[_0x97f7('0x33')];if(_0x51eca2['query']['includeAll']){_0x4164eb['include']=[{'all':!![]}];}_0x4164eb=_[_0x97f7('0x40')]({},_0x4164eb,_0x51eca2[_0x97f7('0x41')]);return db['ServicenowAccount']['find'](_0x4164eb)[_0x97f7('0x28')](handleEntityNotFound(_0x1b84f2,null))[_0x97f7('0x28')](respondWithResult(_0x1b84f2,null))[_0x97f7('0x45')](handleError(_0x1b84f2,null));};exports[_0x97f7('0x49')]=function(_0x582c16,_0x2d21d5){return db[_0x97f7('0x2f')]['create'](_0x582c16['body'],{})['then'](respondWithResult(_0x2d21d5,0xc9))[_0x97f7('0x45')](handleError(_0x2d21d5,null));};exports[_0x97f7('0x27')]=function(_0x425b9e,_0x54a017){if(_0x425b9e['body']['id']){delete _0x425b9e[_0x97f7('0x4a')]['id'];}return db[_0x97f7('0x2f')][_0x97f7('0x4b')]({'where':{'id':_0x425b9e[_0x97f7('0x47')]['id']}})[_0x97f7('0x28')](handleEntityNotFound(_0x54a017,null))['then'](saveUpdates(_0x425b9e[_0x97f7('0x4a')],null))[_0x97f7('0x28')](respondWithResult(_0x54a017,null))['catch'](handleError(_0x54a017,null));};exports[_0x97f7('0x29')]=function(_0x55d5d0,_0x474c65){return db[_0x97f7('0x2f')]['find']({'where':{'id':_0x55d5d0[_0x97f7('0x47')]['id']}})['then'](handleEntityNotFound(_0x474c65,null))[_0x97f7('0x28')](removeEntity(_0x474c65,null))[_0x97f7('0x45')](handleError(_0x474c65,null));};exports[_0x97f7('0x4c')]=function(_0xbd375e,_0x1d65d8,_0x155648){var _0xa514bf={};var _0x469118={};var _0x30b391;var _0x4aa87a;return db[_0x97f7('0x2f')][_0x97f7('0x4d')]({'where':{'id':_0xbd375e[_0x97f7('0x47')]['id']}})[_0x97f7('0x28')](handleEntityNotFound(_0x1d65d8,null))[_0x97f7('0x28')](function(_0x45867f){if(_0x45867f){_0x30b391=_0x45867f;_0x469118[_0x97f7('0x33')]=_['keys'](db[_0x97f7('0x4e')][_0x97f7('0x48')]);_0x469118[_0x97f7('0x35')]=_[_0x97f7('0x36')](_0xbd375e[_0x97f7('0x35')]);_0x469118['filters']=_[_0x97f7('0x37')](_0x469118['model'],_0x469118[_0x97f7('0x35')]);_0xa514bf['attributes']=_[_0x97f7('0x37')](_0x469118['model'],qs['fields'](_0xbd375e[_0x97f7('0x35')][_0x97f7('0x39')]));_0xa514bf['attributes']=_0xa514bf[_0x97f7('0x38')][_0x97f7('0x4f')]?_0xa514bf['attributes']:_0x469118[_0x97f7('0x33')];_0xa514bf[_0x97f7('0x50')]=qs['sort'](_0xbd375e['query'][_0x97f7('0x3b')]);_0xa514bf['where']=qs[_0x97f7('0x3c')](_[_0x97f7('0x51')](_0xbd375e[_0x97f7('0x35')],_0x469118[_0x97f7('0x3c')]));if(_0xbd375e[_0x97f7('0x35')]['filter']){_0xa514bf[_0x97f7('0x3d')]=_[_0x97f7('0x40')](_0xa514bf['where'],{'$or':_[_0x97f7('0x34')](_0xa514bf[_0x97f7('0x38')],function(_0x218fa9){var _0x3375aa={};_0x3375aa[_0x218fa9]={'$like':'%'+_0xbd375e[_0x97f7('0x35')][_0x97f7('0x3f')]+'%'};return _0x3375aa;})});}_0xa514bf=_[_0x97f7('0x40')]({},_0xa514bf,_0xbd375e[_0x97f7('0x41')]);return _0x30b391[_0x97f7('0x4c')](_0xa514bf);}})[_0x97f7('0x28')](function(_0x1d7b65){if(_0x1d7b65){_0x4aa87a=_0x1d7b65[_0x97f7('0x4f')];if(!_0xbd375e[_0x97f7('0x35')]['hasOwnProperty'](_0x97f7('0x3a'))){_0xa514bf['limit']=qs[_0x97f7('0x20')](_0xbd375e[_0x97f7('0x35')][_0x97f7('0x20')]);_0xa514bf[_0x97f7('0x1e')]=qs[_0x97f7('0x1e')](_0xbd375e[_0x97f7('0x35')]['offset']);}return _0x30b391['getConfigurations'](_0xa514bf);}})['then'](function(_0x3fc81a){if(_0x3fc81a){return _0x3fc81a?{'count':_0x4aa87a,'rows':_0x3fc81a}:null;}})['then'](respondWithResult(_0x1d65d8,null))[_0x97f7('0x45')](handleError(_0x1d65d8,null));};exports[_0x97f7('0x52')]=function(_0x37f7c7,_0x434292,_0xcd9951){if(_0x37f7c7[_0x97f7('0x4a')]['id']){delete _0x37f7c7[_0x97f7('0x4a')]['id'];}return db[_0x97f7('0x2f')][_0x97f7('0x4d')]({'where':{'id':_0x37f7c7[_0x97f7('0x47')]['id']}})[_0x97f7('0x28')](handleEntityNotFound(_0x434292,null))[_0x97f7('0x28')](function(_0x1f05cc){if(_0x1f05cc){_0x37f7c7[_0x97f7('0x4a')]['AccountId']=_0x1f05cc['id'];_0x37f7c7[_0x97f7('0x4a')]['Subjects']=integrations[_0x97f7('0x53')](_0x37f7c7[_0x97f7('0x4a')][_0x97f7('0x54')],_0x37f7c7['body']['type']);_0x37f7c7[_0x97f7('0x4a')][_0x97f7('0x55')]=integrations[_0x97f7('0x56')](_0x37f7c7['body'][_0x97f7('0x54')],_0x37f7c7[_0x97f7('0x4a')][_0x97f7('0x31')]);return db[_0x97f7('0x4e')][_0x97f7('0x49')](_0x37f7c7[_0x97f7('0x4a')],{'include':[{'model':db['ServicenowField'],'as':_0x97f7('0x57')},{'model':db[_0x97f7('0x58')],'as':_0x97f7('0x55')}]});}return null;})[_0x97f7('0x28')](respondWithResult(_0x434292,null))['catch'](handleError(_0x434292,null));};exports[_0x97f7('0x59')]=function(_0x39d5b1,_0x3c8c69,_0x3a7deb){var _0x5babd6=['made_sla',_0x97f7('0x5a'),_0x97f7('0x5b'),'subcategory',_0x97f7('0x5c'),'notify',_0x97f7('0x5d'),_0x97f7('0x5e'),'category'];var _0x220914=[_0x97f7('0x5f'),'made_sla',_0x97f7('0x60'),_0x97f7('0x61'),_0x97f7('0x62'),_0x97f7('0x63'),_0x97f7('0x64'),_0x97f7('0x5a'),'approval_history',_0x97f7('0x65'),_0x97f7('0x66'),_0x97f7('0x67'),_0x97f7('0x68'),'user_input',_0x97f7('0x69'),_0x97f7('0x6a'),_0x97f7('0x6b'),'sys_created_by',_0x97f7('0x5b'),_0x97f7('0x50'),_0x97f7('0x6c'),'closed_at',_0x97f7('0x6d'),_0x97f7('0x6e'),_0x97f7('0x6f'),_0x97f7('0x70'),_0x97f7('0x71'),'business_service',_0x97f7('0x72'),_0x97f7('0x73'),_0x97f7('0x74'),_0x97f7('0x75'),_0x97f7('0x76'),'opened_at','business_duration',_0x97f7('0x77'),_0x97f7('0x78'),'reopened_time',_0x97f7('0x79'),_0x97f7('0x7a'),_0x97f7('0x7b'),_0x97f7('0x7c'),_0x97f7('0x7d'),'short_description',_0x97f7('0x5c'),_0x97f7('0x7e'),_0x97f7('0x7f'),_0x97f7('0x80'),_0x97f7('0x81'),_0x97f7('0x82'),'additional_assignee_list',_0x97f7('0x83'),'calendar_duration',_0x97f7('0x84'),_0x97f7('0x85'),_0x97f7('0x86'),_0x97f7('0x87'),'follow_up','parent_incident',_0x97f7('0x88'),_0x97f7('0x89'),_0x97f7('0x8a'),_0x97f7('0x5d'),_0x97f7('0x8b'),_0x97f7('0x8c'),_0x97f7('0x8d'),_0x97f7('0x8e'),_0x97f7('0x8f'),_0x97f7('0x90'),_0x97f7('0x5e'),_0x97f7('0x91'),_0x97f7('0x92'),_0x97f7('0x93'),_0x97f7('0x94'),_0x97f7('0x95'),_0x97f7('0x96'),_0x97f7('0x97'),_0x97f7('0x98'),_0x97f7('0x99'),_0x97f7('0x9a'),_0x97f7('0x9b'),'location','category'];var _0x4db186='';var _0x3bffd0='';var _0x590928=[];var _0x979fd9='';var _0x197562='';var _0x318529=[];var _0x331a5d='';var _0x272a84='';var _0x34772d={};var _0x1535c1='';return db[_0x97f7('0x2f')][_0x97f7('0x4d')]({'where':{'id':_0x39d5b1['params']['id']},'attributes':['id',_0x97f7('0x9c'),_0x97f7('0x9d'),'email',_0x97f7('0x9e'),_0x97f7('0x9f')]})[_0x97f7('0x28')](handleEntityNotFound(_0x3c8c69,null))[_0x97f7('0x28')](function(_0x27ed6d){if(_0x27ed6d){_0x1535c1=_0x27ed6d[_0x97f7('0x9e')];var _0xdb1b90=_0x1535c1[_0x97f7('0xa0')](-0x1);if(_0xdb1b90==='/'){_0x1535c1=_0x1535c1[_0x97f7('0xa1')](0x0,_0x1535c1[_0x97f7('0xa2')](_0xdb1b90));}_0x272a84=util['format']('%s/api/now/doc/table/schema/',_0x1535c1);_0x331a5d=util['format']('%s/api/now/table/',_0x1535c1);_0x34772d={'user':_0x27ed6d[_0x97f7('0x9c')],'pass':_0x27ed6d[_0x97f7('0x9d')]};var _0x47199c={'method':'GET','uri':_0x272a84+_0x97f7('0xa3'),'auth':_0x34772d,'json':!![]};return rp(_0x47199c);}})[_0x97f7('0x28')](function(_0x2d5246){if(_0x2d5246['result'][_0x97f7('0x4f')]>0x0){_0x4db186=_0x2d5246[_0x97f7('0xa4')];}console[_0x97f7('0xa5')](_0x97f7('0xa6'),_0x4db186);_0x318529=[];_0x3bffd0=Object['assign']([],_0x4db186);_['remove'](_0x3bffd0,function(_0x27a19e){return!_0x5babd6[_0x97f7('0xa7')](_0x27a19e[_0x97f7('0x2d')]);});_0x3bffd0['forEach'](function(_0x2531f3){var _0x21d990=createFieldObject(_0x331a5d,_0x34772d,_0x2531f3[_0x97f7('0xa8')],_0x2531f3[_0x97f7('0x2d')],_0x2531f3['label'],![]);_0x318529[_0x97f7('0xa9')](_0x21d990);});return Promise[_0x97f7('0xaa')](_0x318529);})[_0x97f7('0x28')](function(_0x5c1879){_0x590928=_0x5c1879;_0x979fd9=Object[_0x97f7('0xab')]([],_0x4db186);console['log']('TCL:\x20_object',_0x4db186);_[_0x97f7('0xac')](_0x979fd9,function(_0x4049ee){return _0x220914[_0x97f7('0xa7')](_0x4049ee[_0x97f7('0x2d')]);});console[_0x97f7('0xa5')](_0x97f7('0xad'),_0x979fd9);_0x318529=[];_0x979fd9[_0x97f7('0xae')](function(_0x465d8f){var _0xbdecf6=createFieldObject(_0x331a5d,_0x34772d,_0x465d8f[_0x97f7('0xa8')],_0x465d8f[_0x97f7('0x2d')],_0x465d8f[_0x97f7('0xaf')],!![]);_0x318529['push'](_0xbdecf6);});return Promise['all'](_0x318529);})[_0x97f7('0x28')](function(_0x5bf57f){_0x197562=_0x5bf57f;var _0x4626bc=_0x590928[_0x97f7('0xb0')](_0x197562);return{'count':_0x4626bc['length'],'rows':_0x4626bc};})[_0x97f7('0x28')](respondWithResult(_0x3c8c69,null))[_0x97f7('0x45')](function(_0x16e8b3){console[_0x97f7('0xa5')](_0x97f7('0xb1')+_0x16e8b3);var _0xba6002=_0x39d5b1[_0x97f7('0x35')][_0x97f7('0xb2')]?0x1f4:_0x16e8b3[_0x97f7('0xb3')]||0x1f4;logger['error'](_0x16e8b3[_0x97f7('0x2c')]);delete _0x16e8b3[_0x97f7('0x2d')];if(_0xba6002===0x191){_0xba6002=0x190;}_0x3c8c69[_0x97f7('0x1d')](_0xba6002)['send'](_0x39d5b1['query'][_0x97f7('0xb2')]?{'message':_0x97f7('0xb4'),'statusCode':_0x16e8b3[_0x97f7('0xb3')]}:_0x16e8b3);});};function createFieldObject(_0x235d66,_0x1ccbf1,_0x4a5afd,_0x2f23ff,_0x942695,_0x4c7e83){return new Promise(function(_0x5a5d19,_0x5986de){var _0xc89772={'id':_0x2f23ff,'name':_0x942695,'custom':_0x4c7e83};if(_0x4a5afd==='boolean'){_0xc89772[_0x97f7('0x41')]=[{'name':_0x97f7('0xb5'),'value':_0x97f7('0xb6')},{'name':'False','value':_0x97f7('0xb7')}];_0x5a5d19(_0xc89772);}else{var _0x21f6ec={'method':_0x97f7('0xb8'),'uri':_0x235d66+'sys_choice?sysparm_query=name=incident^element='+_0x2f23ff,'auth':_0x1ccbf1,'json':!![]};return rp(_0x21f6ec)['then'](function(_0x30dc9c){var _0x30877c=[];if(_0x30dc9c[_0x97f7('0xa4')][_0x97f7('0x4f')]>0x0){_0x30dc9c['result'][_0x97f7('0xae')](function(_0x212247){if(_0x212247['inactive']==='false'){var _0x43da25={'name':_0x212247[_0x97f7('0xaf')],'value':_0x212247[_0x97f7('0xb9')]};_0x30877c[_0x97f7('0xa9')](_0x43da25);}});}_0xc89772[_0x97f7('0x41')]=_0x30877c;if(_0xc89772['options'][_0x97f7('0x4f')]>0x0){_0x5a5d19(_0xc89772);}else{if(_0x4c7e83==![]){_0x5a5d19();}else{_0x5a5d19(_0xc89772);}}});}});}
\ No newline at end of file
index e27901f..9425fd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['bluebird','path','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','moment'];(function(_0x97c0d5,_0x14c5ee){var _0x35b916=function(_0x290734){while(--_0x290734){_0x97c0d5['push'](_0x97c0d5['shift']());}};_0x35b916(++_0x14c5ee);}(_0xe14b,0x93));var _0xbe14=function(_0x4a0158,_0x1ce3ae){_0x4a0158=_0x4a0158-0x0;var _0x7cdda7=_0xe14b[_0x4a0158];return _0x7cdda7;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));var integrations=require(_0xbe14('0x6'));module[_0xbe14('0x7')]=function(_0x1ff100,_0x1d9ade){return _0x1ff100[_0xbe14('0x8')](_0xbe14('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x1641f6,_0x58ed14){var _0x5387f4=function(_0x647ffa){while(--_0x647ffa){_0x1641f6['push'](_0x1641f6['shift']());}};_0x5387f4(++_0x58ed14);}(_0x5075,0x73));var _0x5507=function(_0x2b36f5,_0x5732dc){_0x2b36f5=_0x2b36f5-0x0;var _0x5f06b6=_0x5075[_0x2b36f5];return _0x5f06b6;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2cd9ee,_0x773559){return _0x2cd9ee['define'](_0x5507('0xa'),attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 730c820..b2034ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bef=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','where','attributes','limit','include','map','model','then','ShowServicenowAccount','raw'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x7bef,0xd2));var _0xf7be=function(_0x1a3d07,_0x105a71){_0x1a3d07=_0x1a3d07-0x0;var _0xd0058a=_0x7bef[_0x1a3d07];return _0xd0058a;};'use strict';var _=require(_0xf7be('0x0'));var util=require(_0xf7be('0x1'));var moment=require(_0xf7be('0x2'));var BPromise=require(_0xf7be('0x3'));var rs=require(_0xf7be('0x4'));var fs=require('fs');var Redis=require(_0xf7be('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7be('0x6'));var logger=require(_0xf7be('0x7'))(_0xf7be('0x8'));var config=require('../../config/environment');var jayson=require(_0xf7be('0x9'));var client=jayson['client'][_0xf7be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a1626,_0x4e7273,_0xd0d907){return new BPromise(function(_0x9879b1,_0x3691f5){return client[_0xf7be('0xb')](_0x2a1626,_0xd0d907)['then'](function(_0x4ae91e){logger[_0xf7be('0xc')](_0xf7be('0xd'),_0x4e7273,_0xf7be('0xe'));logger[_0xf7be('0xf')](_0xf7be('0x10'),_0x4e7273,_0xf7be('0xe'),JSON[_0xf7be('0x11')](_0x4ae91e));if(_0x4ae91e[_0xf7be('0x12')]){if(_0x4ae91e[_0xf7be('0x12')][_0xf7be('0x13')]===0x1f4){logger[_0xf7be('0x12')](_0xf7be('0xd'),_0x4e7273,_0x4ae91e[_0xf7be('0x12')][_0xf7be('0x14')]);return _0x3691f5(_0x4ae91e[_0xf7be('0x12')][_0xf7be('0x14')]);}logger[_0xf7be('0x12')](_0xf7be('0xd'),_0x4e7273,_0x4ae91e[_0xf7be('0x12')][_0xf7be('0x14')]);return _0x9879b1(_0x4ae91e[_0xf7be('0x12')][_0xf7be('0x14')]);}else{logger[_0xf7be('0xc')](_0xf7be('0xd'),_0x4e7273,_0xf7be('0xe'));_0x9879b1(_0x4ae91e[_0xf7be('0x15')]['message']);}})[_0xf7be('0x16')](function(_0x42c9c0){logger['error'](_0xf7be('0xd'),_0x4e7273,_0x42c9c0);_0x3691f5(_0x42c9c0);});});}exports[_0xf7be('0x17')]=function(_0x133b83){var _0x15b1f1=this;return new Promise(function(_0xce71db,_0x2dddf5){return db[_0xf7be('0x18')]['findAll']({'raw':_0x133b83[_0xf7be('0x19')]?_0x133b83['options']['raw']===undefined?!![]:![]:!![],'where':_0x133b83[_0xf7be('0x19')]?_0x133b83[_0xf7be('0x19')][_0xf7be('0x1a')]||null:null,'attributes':_0x133b83[_0xf7be('0x19')]?_0x133b83[_0xf7be('0x19')][_0xf7be('0x1b')]||null:null,'limit':_0x133b83[_0xf7be('0x19')]?_0x133b83['options'][_0xf7be('0x1c')]||null:null,'include':_0x133b83[_0xf7be('0x19')]?_0x133b83[_0xf7be('0x19')][_0xf7be('0x1d')]?_['map'](_0x133b83[_0xf7be('0x19')][_0xf7be('0x1d')],function(_0x3b2cd9){return{'model':db[_0x3b2cd9['model']],'as':_0x3b2cd9['as'],'attributes':_0x3b2cd9[_0xf7be('0x1b')],'include':_0x3b2cd9[_0xf7be('0x1d')]?_['map'](_0x3b2cd9[_0xf7be('0x1d')],function(_0x360af9){return{'model':db[_0x360af9['model']],'as':_0x360af9['as'],'attributes':_0x360af9[_0xf7be('0x1b')],'include':_0x360af9[_0xf7be('0x1d')]?_[_0xf7be('0x1e')](_0x360af9[_0xf7be('0x1d')],function(_0x3bfd45){return{'model':db[_0x3bfd45[_0xf7be('0x1f')]],'as':_0x3bfd45['as'],'attributes':_0x3bfd45['attributes']};}):[]};}):[]};}):[]:[]})[_0xf7be('0x20')](function(_0x28d3c2){logger['info']('GetServicenowAccount',_0x133b83);logger[_0xf7be('0xf')](_0xf7be('0x17'),_0x133b83,JSON[_0xf7be('0x11')](_0x28d3c2));_0xce71db(_0x28d3c2);})[_0xf7be('0x16')](function(_0x5a2318){logger[_0xf7be('0x12')]('GetServicenowAccount',_0x5a2318['message'],_0x133b83);_0x2dddf5(_0x15b1f1[_0xf7be('0x12')](0x1f4,_0x5a2318[_0xf7be('0x14')]));});});};exports[_0xf7be('0x21')]=function(_0x138831){var _0x3e80b4=this;return new Promise(function(_0x425367,_0x3ed675){return db[_0xf7be('0x18')]['find']({'raw':_0x138831[_0xf7be('0x19')]?_0x138831['options'][_0xf7be('0x22')]===undefined?!![]:![]:!![],'where':_0x138831[_0xf7be('0x19')]?_0x138831[_0xf7be('0x19')]['where']||null:null,'attributes':_0x138831[_0xf7be('0x19')]?_0x138831[_0xf7be('0x19')][_0xf7be('0x1b')]||null:null,'include':_0x138831[_0xf7be('0x19')]?_0x138831[_0xf7be('0x19')]['include']?_[_0xf7be('0x1e')](_0x138831[_0xf7be('0x19')]['include'],function(_0x21abdf){return{'model':db[_0x21abdf[_0xf7be('0x1f')]],'as':_0x21abdf['as'],'attributes':_0x21abdf[_0xf7be('0x1b')],'include':_0x21abdf[_0xf7be('0x1d')]?_[_0xf7be('0x1e')](_0x21abdf['include'],function(_0xc2c6bb){return{'model':db[_0xc2c6bb[_0xf7be('0x1f')]],'as':_0xc2c6bb['as'],'attributes':_0xc2c6bb[_0xf7be('0x1b')],'include':_0xc2c6bb[_0xf7be('0x1d')]?_['map'](_0xc2c6bb[_0xf7be('0x1d')],function(_0x38ebfc){return{'model':db[_0x38ebfc[_0xf7be('0x1f')]],'as':_0x38ebfc['as'],'attributes':_0x38ebfc[_0xf7be('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf7be('0x20')](function(_0x67962e){logger[_0xf7be('0xc')](_0xf7be('0x21'),_0x138831);logger['debug'](_0xf7be('0x21'),_0x138831,JSON[_0xf7be('0x11')](_0x67962e));_0x425367(_0x67962e);})[_0xf7be('0x16')](function(_0xb5058e){logger['error']('ShowServicenowAccount',_0xb5058e[_0xf7be('0x14')],_0x138831);_0x3ed675(_0x3e80b4[_0xf7be('0x12')](0x1f4,_0xb5058e[_0xf7be('0x14')]));});});};
\ No newline at end of file
+var _0xb60b=['options','raw','where','attributes','limit','map','include','model','then','GetServicenowAccount','debug','ShowServicenowAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','catch','ServicenowAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb60b,0x78));var _0xbb60=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xb60b[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xbb60('0x0'));var util=require(_0xbb60('0x1'));var moment=require(_0xbb60('0x2'));var BPromise=require('bluebird');var rs=require(_0xbb60('0x3'));var fs=require('fs');var Redis=require(_0xbb60('0x4'));var db=require(_0xbb60('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb60('0x6'))(_0xbb60('0x7'));var config=require(_0xbb60('0x8'));var jayson=require(_0xbb60('0x9'));var client=jayson[_0xbb60('0xa')][_0xbb60('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cba69,_0x551ec5,_0x4ae7bf){return new BPromise(function(_0x374525,_0x5917b1){return client[_0xbb60('0xc')](_0x3cba69,_0x4ae7bf)['then'](function(_0x27df73){logger[_0xbb60('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x551ec5,_0xbb60('0xe'));logger['debug'](_0xbb60('0xf'),_0x551ec5,_0xbb60('0xe'),JSON[_0xbb60('0x10')](_0x27df73));if(_0x27df73[_0xbb60('0x11')]){if(_0x27df73[_0xbb60('0x11')][_0xbb60('0x12')]===0x1f4){logger[_0xbb60('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x551ec5,_0x27df73['error'][_0xbb60('0x13')]);return _0x5917b1(_0x27df73[_0xbb60('0x11')]['message']);}logger[_0xbb60('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x551ec5,_0x27df73[_0xbb60('0x11')][_0xbb60('0x13')]);return _0x374525(_0x27df73[_0xbb60('0x11')]['message']);}else{logger[_0xbb60('0xd')](_0xbb60('0x14'),_0x551ec5,'request\x20sent');_0x374525(_0x27df73[_0xbb60('0x15')]['message']);}})[_0xbb60('0x16')](function(_0x1c6d42){logger[_0xbb60('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x551ec5,_0x1c6d42);_0x5917b1(_0x1c6d42);});});}exports['GetServicenowAccount']=function(_0x4e5256){var _0x3fc296=this;return new Promise(function(_0x4c96a6,_0x37898d){return db[_0xbb60('0x17')]['findAll']({'raw':_0x4e5256[_0xbb60('0x18')]?_0x4e5256['options'][_0xbb60('0x19')]===undefined?!![]:![]:!![],'where':_0x4e5256[_0xbb60('0x18')]?_0x4e5256['options'][_0xbb60('0x1a')]||null:null,'attributes':_0x4e5256[_0xbb60('0x18')]?_0x4e5256['options'][_0xbb60('0x1b')]||null:null,'limit':_0x4e5256[_0xbb60('0x18')]?_0x4e5256[_0xbb60('0x18')][_0xbb60('0x1c')]||null:null,'include':_0x4e5256[_0xbb60('0x18')]?_0x4e5256[_0xbb60('0x18')]['include']?_[_0xbb60('0x1d')](_0x4e5256[_0xbb60('0x18')][_0xbb60('0x1e')],function(_0x50c69c){return{'model':db[_0x50c69c[_0xbb60('0x1f')]],'as':_0x50c69c['as'],'attributes':_0x50c69c['attributes'],'include':_0x50c69c['include']?_[_0xbb60('0x1d')](_0x50c69c[_0xbb60('0x1e')],function(_0x45e6f2){return{'model':db[_0x45e6f2[_0xbb60('0x1f')]],'as':_0x45e6f2['as'],'attributes':_0x45e6f2[_0xbb60('0x1b')],'include':_0x45e6f2['include']?_[_0xbb60('0x1d')](_0x45e6f2[_0xbb60('0x1e')],function(_0x35dc6a){return{'model':db[_0x35dc6a[_0xbb60('0x1f')]],'as':_0x35dc6a['as'],'attributes':_0x35dc6a['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb60('0x20')](function(_0x49ba05){logger['info'](_0xbb60('0x21'),_0x4e5256);logger[_0xbb60('0x22')]('GetServicenowAccount',_0x4e5256,JSON['stringify'](_0x49ba05));_0x4c96a6(_0x49ba05);})[_0xbb60('0x16')](function(_0x4ec043){logger[_0xbb60('0x11')](_0xbb60('0x21'),_0x4ec043[_0xbb60('0x13')],_0x4e5256);_0x37898d(_0x3fc296[_0xbb60('0x11')](0x1f4,_0x4ec043[_0xbb60('0x13')]));});});};exports[_0xbb60('0x23')]=function(_0x15377b){var _0x1785c3=this;return new Promise(function(_0x513f51,_0xf57ffb){return db[_0xbb60('0x17')]['find']({'raw':_0x15377b[_0xbb60('0x18')]?_0x15377b[_0xbb60('0x18')][_0xbb60('0x19')]===undefined?!![]:![]:!![],'where':_0x15377b[_0xbb60('0x18')]?_0x15377b[_0xbb60('0x18')][_0xbb60('0x1a')]||null:null,'attributes':_0x15377b['options']?_0x15377b[_0xbb60('0x18')][_0xbb60('0x1b')]||null:null,'include':_0x15377b[_0xbb60('0x18')]?_0x15377b[_0xbb60('0x18')][_0xbb60('0x1e')]?_[_0xbb60('0x1d')](_0x15377b['options'][_0xbb60('0x1e')],function(_0x538447){return{'model':db[_0x538447[_0xbb60('0x1f')]],'as':_0x538447['as'],'attributes':_0x538447['attributes'],'include':_0x538447[_0xbb60('0x1e')]?_['map'](_0x538447[_0xbb60('0x1e')],function(_0x463211){return{'model':db[_0x463211['model']],'as':_0x463211['as'],'attributes':_0x463211[_0xbb60('0x1b')],'include':_0x463211[_0xbb60('0x1e')]?_[_0xbb60('0x1d')](_0x463211[_0xbb60('0x1e')],function(_0x14b91b){return{'model':db[_0x14b91b[_0xbb60('0x1f')]],'as':_0x14b91b['as'],'attributes':_0x14b91b[_0xbb60('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c9d02){logger[_0xbb60('0xd')]('ShowServicenowAccount',_0x15377b);logger[_0xbb60('0x22')](_0xbb60('0x23'),_0x15377b,JSON[_0xbb60('0x10')](_0x4c9d02));_0x513f51(_0x4c9d02);})[_0xbb60('0x16')](function(_0x19afec){logger['error'](_0xbb60('0x23'),_0x19afec[_0xbb60('0x13')],_0x15377b);_0xf57ffb(_0x1785c3[_0xbb60('0x11')](0x1f4,_0x19afec['message']));});});};
\ No newline at end of file
index 0cbf191..8189939 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba8e=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0xba8e,0x163));var _0xeba8=function(_0x2b3478,_0x58afd7){_0x2b3478=_0x2b3478-0x0;var _0x1c106f=_0xba8e[_0x2b3478];return _0x1c106f;};'use strict';var multer=require('multer');var util=require(_0xeba8('0x0'));var path=require(_0xeba8('0x1'));var timeout=require('connect-timeout');var express=require(_0xeba8('0x2'));var router=express[_0xeba8('0x3')]();var fs_extra=require(_0xeba8('0x4'));var auth=require(_0xeba8('0x5'));var interaction=require(_0xeba8('0x6'));var config=require(_0xeba8('0x7'));var controller=require(_0xeba8('0x8'));router[_0xeba8('0x9')]('/',auth[_0xeba8('0xa')](),controller[_0xeba8('0xb')]);router['get'](_0xeba8('0xc'),auth[_0xeba8('0xa')](),controller[_0xeba8('0xd')]);router[_0xeba8('0x9')](_0xeba8('0xe'),auth['isAuthenticated'](),controller[_0xeba8('0xf')]);router[_0xeba8('0x9')](_0xeba8('0x10'),auth[_0xeba8('0xa')](),controller[_0xeba8('0x11')]);router['get'](_0xeba8('0x12'),auth[_0xeba8('0xa')](),controller[_0xeba8('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xeba8('0x14')]);router[_0xeba8('0x15')](_0xeba8('0xc'),auth[_0xeba8('0xa')](),controller[_0xeba8('0x16')]);router[_0xeba8('0x17')](_0xeba8('0xc'),auth[_0xeba8('0xa')](),controller[_0xeba8('0x18')]);module[_0xeba8('0x19')]=router;
\ No newline at end of file
+var _0x67e0=['create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','post'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x67e0,0x130));var _0x067e=function(_0x3fb150,_0x5e32ed){_0x3fb150=_0x3fb150-0x0;var _0x56f4a8=_0x67e0[_0x3fb150];return _0x56f4a8;};'use strict';var multer=require(_0x067e('0x0'));var util=require('util');var path=require(_0x067e('0x1'));var timeout=require(_0x067e('0x2'));var express=require(_0x067e('0x3'));var router=express[_0x067e('0x4')]();var fs_extra=require(_0x067e('0x5'));var auth=require(_0x067e('0x6'));var interaction=require(_0x067e('0x7'));var config=require(_0x067e('0x8'));var controller=require('./intServicenowConfiguration.controller');router[_0x067e('0x9')]('/',auth['isAuthenticated'](),controller[_0x067e('0xa')]);router[_0x067e('0x9')](_0x067e('0xb'),auth[_0x067e('0xc')](),controller['show']);router['get'](_0x067e('0xd'),auth[_0x067e('0xc')](),controller[_0x067e('0xe')]);router['get'](_0x067e('0xf'),auth[_0x067e('0xc')](),controller[_0x067e('0x10')]);router[_0x067e('0x9')]('/:id/descriptions',auth[_0x067e('0xc')](),controller['getDescriptions']);router[_0x067e('0x11')]('/',auth[_0x067e('0xc')](),controller[_0x067e('0x12')]);router[_0x067e('0x13')](_0x067e('0xb'),auth[_0x067e('0xc')](),controller['update']);router[_0x067e('0x14')](_0x067e('0xb'),auth[_0x067e('0xc')](),controller[_0x067e('0x15')]);module[_0x067e('0x16')]=router;
\ No newline at end of file
index ecec025..2df117d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf584=['STRING','sequelize'];(function(_0x3b239f,_0x2fe763){var _0x238f18=function(_0x1b6a8c){while(--_0x1b6a8c){_0x3b239f['push'](_0x3b239f['shift']());}};_0x238f18(++_0x2fe763);}(_0xf584,0x16f));var _0x4f58=function(_0x964fd3,_0x5a8b54){_0x964fd3=_0x964fd3-0x0;var _0x4d09f4=_0xf584[_0x964fd3];return _0x4d09f4;};'use strict';var Sequelize=require(_0x4f58('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f58('0x1')]},'description':{'type':Sequelize[_0x4f58('0x1')]}};
\ No newline at end of file
+var _0x97c2=['sequelize','exports','STRING'];(function(_0x409f7d,_0x2c1bbb){var _0x22ce44=function(_0x4e5d03){while(--_0x4e5d03){_0x409f7d['push'](_0x409f7d['shift']());}};_0x22ce44(++_0x2c1bbb);}(_0x97c2,0xcf));var _0x297c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x97c2[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x297c('0x0'));module[_0x297c('0x1')]={'name':{'type':Sequelize[_0x297c('0x2')]},'description':{'type':Sequelize[_0x297c('0x2')]}};
\ No newline at end of file
index e216b09..3d91b19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61c2=['save','update','destroy','then','sendStatus','error','stack','name','index','map','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','ServicenowConfiguration','find','catch','create','body','getFields','findOne','getSubjects','nolimit','getDescriptions','ServicenowField','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','fs-extra','crypto','jsforce','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','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x5dfa77,_0x14a235){var _0x4a54ea=function(_0x5a0007){while(--_0x5a0007){_0x5dfa77['push'](_0x5dfa77['shift']());}};_0x4a54ea(++_0x14a235);}(_0x61c2,0x11f));var _0x261c=function(_0x4a17f7,_0x50e32c){_0x4a17f7=_0x4a17f7-0x0;var _0x58a045=_0x61c2[_0x4a17f7];return _0x58a045;};'use strict';var emlformat=require(_0x261c('0x0'));var rimraf=require(_0x261c('0x1'));var zipdir=require(_0x261c('0x2'));var jsonpatch=require(_0x261c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x261c('0x4'));var Mustache=require(_0x261c('0x5'));var util=require(_0x261c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x261c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x261c('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x261c('0x9'));var jsforce=require(_0x261c('0xa'));var deskjs=require(_0x261c('0xb'));var toCsv=require(_0x261c('0x7'));var querystring=require(_0x261c('0xc'));var Papa=require(_0x261c('0xd'));var Redis=require(_0x261c('0xe'));var authService=require(_0x261c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x261c('0x10'));var hardwareService=require(_0x261c('0x11'));var logger=require(_0x261c('0x12'))('api');var utils=require(_0x261c('0x13'));var config=require(_0x261c('0x14'));var licenseUtil=require(_0x261c('0x15'));var db=require(_0x261c('0x16'))['db'];function respondWithStatusCode(_0x56e550,_0x3caf40){_0x3caf40=_0x3caf40||0xcc;return function(_0x2f232e){if(_0x2f232e){return _0x56e550['sendStatus'](_0x3caf40);}return _0x56e550[_0x261c('0x17')](_0x3caf40)[_0x261c('0x18')]();};}function respondWithResult(_0x4da031,_0x1c5a24){_0x1c5a24=_0x1c5a24||0xc8;return function(_0x2132df){if(_0x2132df){return _0x4da031[_0x261c('0x17')](_0x1c5a24)[_0x261c('0x19')](_0x2132df);}};}function respondWithFilteredResult(_0x48fd51,_0x3a6ad9){return function(_0x27a3c9){if(_0x27a3c9){var _0x234a12=typeof _0x3a6ad9['offset']===_0x261c('0x1a')&&typeof _0x3a6ad9[_0x261c('0x1b')]===_0x261c('0x1a');var _0x26dad1=_0x27a3c9[_0x261c('0x1c')];var _0x2dd3b6=_0x234a12?0x0:_0x3a6ad9[_0x261c('0x1d')];var _0x5786f0=_0x234a12?_0x27a3c9[_0x261c('0x1c')]:_0x3a6ad9[_0x261c('0x1d')]+_0x3a6ad9[_0x261c('0x1b')];var _0x127202;if(_0x5786f0>=_0x26dad1){_0x5786f0=_0x26dad1;_0x127202=0xc8;}else{_0x127202=0xce;}_0x48fd51['status'](_0x127202);return _0x48fd51[_0x261c('0x1e')](_0x261c('0x1f'),_0x2dd3b6+'-'+_0x5786f0+'/'+_0x26dad1)[_0x261c('0x19')](_0x27a3c9);}return null;};}function patchUpdates(_0x5f3288){return function(_0x4cd1e0){try{jsonpatch[_0x261c('0x20')](_0x4cd1e0,_0x5f3288,!![]);}catch(_0x35bd3f){return BPromise['reject'](_0x35bd3f);}return _0x4cd1e0[_0x261c('0x21')]();};}function saveUpdates(_0x13a947,_0x8fea){return function(_0x5a45da){if(_0x5a45da){return _0x5a45da[_0x261c('0x22')](_0x13a947)['then'](function(_0x513bc3){return _0x513bc3;});}return null;};}function removeEntity(_0x56e7cd,_0x173cbc){return function(_0x398b2c){if(_0x398b2c){return _0x398b2c[_0x261c('0x23')]()[_0x261c('0x24')](function(){_0x56e7cd[_0x261c('0x17')](0xcc)[_0x261c('0x18')]();});}};}function handleEntityNotFound(_0x10a041,_0x5131c9){return function(_0x9cb234){if(!_0x9cb234){_0x10a041[_0x261c('0x25')](0x194);}return _0x9cb234;};}function handleError(_0x1ad2fd,_0x91bdd0){_0x91bdd0=_0x91bdd0||0x1f4;return function(_0x295a25){logger[_0x261c('0x26')](_0x295a25[_0x261c('0x27')]);if(_0x295a25[_0x261c('0x28')]){delete _0x295a25[_0x261c('0x28')];}_0x1ad2fd[_0x261c('0x17')](_0x91bdd0)['send'](_0x295a25);};}exports[_0x261c('0x29')]=function(_0x21147d,_0xbeb7f4){var _0xd8f8a5={},_0x2d66cc={},_0x20a385={'count':0x0,'rows':[]};var _0x28ff6d=_[_0x261c('0x2a')](db['ServicenowConfiguration']['rawAttributes'],function(_0x1fd691){return{'name':_0x1fd691[_0x261c('0x2b')],'type':_0x1fd691[_0x261c('0x2c')]['key']};});_0x2d66cc['model']=_[_0x261c('0x2a')](_0x28ff6d,_0x261c('0x28'));_0x2d66cc[_0x261c('0x2d')]=_[_0x261c('0x2e')](_0x21147d['query']);_0x2d66cc[_0x261c('0x2f')]=_[_0x261c('0x30')](_0x2d66cc[_0x261c('0x31')],_0x2d66cc[_0x261c('0x2d')]);_0xd8f8a5['attributes']=_['intersection'](_0x2d66cc[_0x261c('0x31')],qs[_0x261c('0x32')](_0x21147d[_0x261c('0x2d')][_0x261c('0x32')]));_0xd8f8a5['attributes']=_0xd8f8a5[_0x261c('0x33')][_0x261c('0x34')]?_0xd8f8a5[_0x261c('0x33')]:_0x2d66cc['model'];if(!_0x21147d[_0x261c('0x2d')][_0x261c('0x35')]('nolimit')){_0xd8f8a5[_0x261c('0x1b')]=qs[_0x261c('0x1b')](_0x21147d[_0x261c('0x2d')][_0x261c('0x1b')]);_0xd8f8a5['offset']=qs['offset'](_0x21147d['query'][_0x261c('0x1d')]);}_0xd8f8a5[_0x261c('0x36')]=qs[_0x261c('0x37')](_0x21147d[_0x261c('0x2d')][_0x261c('0x37')]);_0xd8f8a5['where']=qs['filters'](_[_0x261c('0x38')](_0x21147d[_0x261c('0x2d')],_0x2d66cc[_0x261c('0x2f')]),_0x28ff6d);if(_0x21147d['query'][_0x261c('0x39')]){_0xd8f8a5[_0x261c('0x3a')]=_[_0x261c('0x3b')](_0xd8f8a5[_0x261c('0x3a')],{'$or':_[_0x261c('0x2a')](_0x28ff6d,function(_0x1d8d14){if(_0x1d8d14[_0x261c('0x2c')]!==_0x261c('0x3c')){var _0x27ecf7={};_0x27ecf7[_0x1d8d14[_0x261c('0x28')]]={'$like':'%'+_0x21147d[_0x261c('0x2d')]['filter']+'%'};return _0x27ecf7;}})});}_0xd8f8a5=_[_0x261c('0x3b')]({},_0xd8f8a5,_0x21147d[_0x261c('0x3d')]);var _0x18c626={'where':_0xd8f8a5['where']};return db['ServicenowConfiguration']['count'](_0x18c626)['then'](function(_0x314085){_0x20a385[_0x261c('0x1c')]=_0x314085;if(_0x21147d[_0x261c('0x2d')][_0x261c('0x3e')]){_0xd8f8a5['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x261c('0x3f')](_0xd8f8a5);})[_0x261c('0x24')](function(_0x5580fd){_0x20a385[_0x261c('0x40')]=_0x5580fd;return _0x20a385;})['then'](respondWithFilteredResult(_0xbeb7f4,_0xd8f8a5))['catch'](handleError(_0xbeb7f4,null));};exports[_0x261c('0x41')]=function(_0x27a9ba,_0x5b9e6a){var _0x570d92={'raw':![],'where':{'id':_0x27a9ba[_0x261c('0x42')]['id']}},_0x29364d={};_0x29364d[_0x261c('0x31')]=_[_0x261c('0x2e')](db['ServicenowConfiguration'][_0x261c('0x43')]);_0x29364d[_0x261c('0x2d')]=_[_0x261c('0x2e')](_0x27a9ba[_0x261c('0x2d')]);_0x29364d[_0x261c('0x2f')]=_['intersection'](_0x29364d[_0x261c('0x31')],_0x29364d['query']);_0x570d92[_0x261c('0x33')]=_['intersection'](_0x29364d[_0x261c('0x31')],qs[_0x261c('0x32')](_0x27a9ba[_0x261c('0x2d')]['fields']));_0x570d92[_0x261c('0x33')]=_0x570d92['attributes'][_0x261c('0x34')]?_0x570d92['attributes']:_0x29364d[_0x261c('0x31')];if(_0x27a9ba[_0x261c('0x2d')]['includeAll']){_0x570d92[_0x261c('0x44')]=[{'all':!![]}];}_0x570d92=_[_0x261c('0x3b')]({},_0x570d92,_0x27a9ba['options']);return db[_0x261c('0x45')][_0x261c('0x46')](_0x570d92)[_0x261c('0x24')](handleEntityNotFound(_0x5b9e6a,null))[_0x261c('0x24')](respondWithResult(_0x5b9e6a,null))[_0x261c('0x47')](handleError(_0x5b9e6a,null));};exports['create']=function(_0x37a768,_0x3a80dc){return db['ServicenowConfiguration'][_0x261c('0x48')](_0x37a768[_0x261c('0x49')],{})[_0x261c('0x24')](respondWithResult(_0x3a80dc,0xc9))[_0x261c('0x47')](handleError(_0x3a80dc,null));};exports[_0x261c('0x22')]=function(_0x23de42,_0x4f09f6){if(_0x23de42[_0x261c('0x49')]['id']){delete _0x23de42[_0x261c('0x49')]['id'];}return db['ServicenowConfiguration'][_0x261c('0x46')]({'where':{'id':_0x23de42[_0x261c('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f09f6,null))[_0x261c('0x24')](saveUpdates(_0x23de42[_0x261c('0x49')],null))[_0x261c('0x24')](respondWithResult(_0x4f09f6,null))[_0x261c('0x47')](handleError(_0x4f09f6,null));};exports[_0x261c('0x23')]=function(_0x5780ab,_0x3f3fa4){return db[_0x261c('0x45')][_0x261c('0x46')]({'where':{'id':_0x5780ab[_0x261c('0x42')]['id']}})[_0x261c('0x24')](handleEntityNotFound(_0x3f3fa4,null))['then'](removeEntity(_0x3f3fa4,null))['catch'](handleError(_0x3f3fa4,null));};exports[_0x261c('0x4a')]=function(_0x4e7b09,_0x13879e,_0xe55f89){var _0x519c5b={};var _0x12305f={};var _0x12ad89;var _0x585c7e;return db[_0x261c('0x45')][_0x261c('0x4b')]({'where':{'id':_0x4e7b09['params']['id']}})[_0x261c('0x24')](handleEntityNotFound(_0x13879e,null))[_0x261c('0x24')](function(_0x2ca9a5){if(_0x2ca9a5){_0x12ad89=_0x2ca9a5;_0x12305f[_0x261c('0x31')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x12305f['query']=_[_0x261c('0x2e')](_0x4e7b09[_0x261c('0x2d')]);_0x12305f['filters']=_[_0x261c('0x30')](_0x12305f[_0x261c('0x31')],_0x12305f[_0x261c('0x2d')]);_0x519c5b[_0x261c('0x33')]=_[_0x261c('0x30')](_0x12305f[_0x261c('0x31')],qs[_0x261c('0x32')](_0x4e7b09[_0x261c('0x2d')][_0x261c('0x32')]));_0x519c5b['attributes']=_0x519c5b['attributes'][_0x261c('0x34')]?_0x519c5b[_0x261c('0x33')]:_0x12305f['model'];_0x519c5b['order']=qs['sort'](_0x4e7b09[_0x261c('0x2d')][_0x261c('0x37')]);_0x519c5b[_0x261c('0x3a')]=qs[_0x261c('0x2f')](_[_0x261c('0x38')](_0x4e7b09[_0x261c('0x2d')],_0x12305f[_0x261c('0x2f')]));if(_0x4e7b09[_0x261c('0x2d')][_0x261c('0x39')]){_0x519c5b[_0x261c('0x3a')]=_[_0x261c('0x3b')](_0x519c5b[_0x261c('0x3a')],{'$or':_[_0x261c('0x2a')](_0x519c5b[_0x261c('0x33')],function(_0x4a4e7d){var _0x473cb5={};_0x473cb5[_0x4a4e7d]={'$like':'%'+_0x4e7b09[_0x261c('0x2d')]['filter']+'%'};return _0x473cb5;})});}_0x519c5b=_[_0x261c('0x3b')]({},_0x519c5b,_0x4e7b09[_0x261c('0x3d')]);return _0x12ad89[_0x261c('0x4a')](_0x519c5b);}})[_0x261c('0x24')](function(_0x46c339){if(_0x46c339){_0x585c7e=_0x46c339[_0x261c('0x34')];if(!_0x4e7b09[_0x261c('0x2d')][_0x261c('0x35')]('nolimit')){_0x519c5b[_0x261c('0x1b')]=qs[_0x261c('0x1b')](_0x4e7b09['query']['limit']);_0x519c5b[_0x261c('0x1d')]=qs['offset'](_0x4e7b09['query'][_0x261c('0x1d')]);}return _0x12ad89[_0x261c('0x4a')](_0x519c5b);}})['then'](function(_0x2713d5){if(_0x2713d5){return _0x2713d5?{'count':_0x585c7e,'rows':_0x2713d5}:null;}})[_0x261c('0x24')](respondWithResult(_0x13879e,null))[_0x261c('0x47')](handleError(_0x13879e,null));};exports[_0x261c('0x4c')]=function(_0x29a6e4,_0x17bf1f,_0x335a83){var _0x51200c={};var _0x2b3658={};var _0x560564;var _0x4fd01e;return db['ServicenowConfiguration'][_0x261c('0x4b')]({'where':{'id':_0x29a6e4[_0x261c('0x42')]['id']}})[_0x261c('0x24')](handleEntityNotFound(_0x17bf1f,null))[_0x261c('0x24')](function(_0x5a77f3){if(_0x5a77f3){_0x560564=_0x5a77f3;_0x2b3658[_0x261c('0x31')]=_['keys'](db['ServicenowField'][_0x261c('0x43')]);_0x2b3658[_0x261c('0x2d')]=_[_0x261c('0x2e')](_0x29a6e4[_0x261c('0x2d')]);_0x2b3658[_0x261c('0x2f')]=_[_0x261c('0x30')](_0x2b3658['model'],_0x2b3658[_0x261c('0x2d')]);_0x51200c[_0x261c('0x33')]=_[_0x261c('0x30')](_0x2b3658[_0x261c('0x31')],qs[_0x261c('0x32')](_0x29a6e4[_0x261c('0x2d')][_0x261c('0x32')]));_0x51200c[_0x261c('0x33')]=_0x51200c['attributes']['length']?_0x51200c[_0x261c('0x33')]:_0x2b3658[_0x261c('0x31')];_0x51200c[_0x261c('0x36')]=qs['sort'](_0x29a6e4['query']['sort']);_0x51200c[_0x261c('0x3a')]=qs['filters'](_[_0x261c('0x38')](_0x29a6e4[_0x261c('0x2d')],_0x2b3658[_0x261c('0x2f')]));if(_0x29a6e4['query'][_0x261c('0x39')]){_0x51200c[_0x261c('0x3a')]=_[_0x261c('0x3b')](_0x51200c[_0x261c('0x3a')],{'$or':_['map'](_0x51200c[_0x261c('0x33')],function(_0x2724f1){var _0x16a7bf={};_0x16a7bf[_0x2724f1]={'$like':'%'+_0x29a6e4[_0x261c('0x2d')][_0x261c('0x39')]+'%'};return _0x16a7bf;})});}_0x51200c=_[_0x261c('0x3b')]({},_0x51200c,_0x29a6e4[_0x261c('0x3d')]);return _0x560564[_0x261c('0x4c')](_0x51200c);}})[_0x261c('0x24')](function(_0x2537ac){if(_0x2537ac){_0x4fd01e=_0x2537ac[_0x261c('0x34')];if(!_0x29a6e4['query']['hasOwnProperty'](_0x261c('0x4d'))){_0x51200c[_0x261c('0x1b')]=qs['limit'](_0x29a6e4[_0x261c('0x2d')]['limit']);_0x51200c[_0x261c('0x1d')]=qs[_0x261c('0x1d')](_0x29a6e4[_0x261c('0x2d')]['offset']);}return _0x560564[_0x261c('0x4c')](_0x51200c);}})['then'](function(_0x49e955){if(_0x49e955){return _0x49e955?{'count':_0x4fd01e,'rows':_0x49e955}:null;}})[_0x261c('0x24')](respondWithResult(_0x17bf1f,null))[_0x261c('0x47')](handleError(_0x17bf1f,null));};exports[_0x261c('0x4e')]=function(_0x544bca,_0x4add2f,_0x597dfb){var _0x13be32={};var _0x52e3f5={};var _0xd7ee5c;var _0x450156;return db[_0x261c('0x45')][_0x261c('0x4b')]({'where':{'id':_0x544bca['params']['id']}})[_0x261c('0x24')](handleEntityNotFound(_0x4add2f,null))[_0x261c('0x24')](function(_0x26485d){if(_0x26485d){_0xd7ee5c=_0x26485d;_0x52e3f5[_0x261c('0x31')]=_['keys'](db[_0x261c('0x4f')][_0x261c('0x43')]);_0x52e3f5[_0x261c('0x2d')]=_['keys'](_0x544bca[_0x261c('0x2d')]);_0x52e3f5[_0x261c('0x2f')]=_['intersection'](_0x52e3f5[_0x261c('0x31')],_0x52e3f5[_0x261c('0x2d')]);_0x13be32[_0x261c('0x33')]=_[_0x261c('0x30')](_0x52e3f5[_0x261c('0x31')],qs[_0x261c('0x32')](_0x544bca[_0x261c('0x2d')]['fields']));_0x13be32[_0x261c('0x33')]=_0x13be32['attributes'][_0x261c('0x34')]?_0x13be32['attributes']:_0x52e3f5['model'];_0x13be32[_0x261c('0x36')]=qs[_0x261c('0x37')](_0x544bca[_0x261c('0x2d')][_0x261c('0x37')]);_0x13be32[_0x261c('0x3a')]=qs['filters'](_[_0x261c('0x38')](_0x544bca['query'],_0x52e3f5[_0x261c('0x2f')]));if(_0x544bca[_0x261c('0x2d')][_0x261c('0x39')]){_0x13be32[_0x261c('0x3a')]=_[_0x261c('0x3b')](_0x13be32[_0x261c('0x3a')],{'$or':_[_0x261c('0x2a')](_0x13be32[_0x261c('0x33')],function(_0xbce02e){var _0x2659f1={};_0x2659f1[_0xbce02e]={'$like':'%'+_0x544bca['query']['filter']+'%'};return _0x2659f1;})});}_0x13be32=_[_0x261c('0x3b')]({},_0x13be32,_0x544bca[_0x261c('0x3d')]);return _0xd7ee5c['getDescriptions'](_0x13be32);}})[_0x261c('0x24')](function(_0x47bbe5){if(_0x47bbe5){_0x450156=_0x47bbe5['length'];if(!_0x544bca[_0x261c('0x2d')]['hasOwnProperty'](_0x261c('0x4d'))){_0x13be32[_0x261c('0x1b')]=qs[_0x261c('0x1b')](_0x544bca[_0x261c('0x2d')]['limit']);_0x13be32[_0x261c('0x1d')]=qs[_0x261c('0x1d')](_0x544bca[_0x261c('0x2d')][_0x261c('0x1d')]);}return _0xd7ee5c[_0x261c('0x4e')](_0x13be32);}})['then'](function(_0x21379a){if(_0x21379a){return _0x21379a?{'count':_0x450156,'rows':_0x21379a}:null;}})['then'](respondWithResult(_0x4add2f,null))['catch'](handleError(_0x4add2f,null));};
\ No newline at end of file
+var _0x6c93=['options','count','includeAll','include','findAll','rows','catch','show','create','body','find','params','destroy','findOne','getFields','nolimit','getSubjects','ServicenowField','getDescriptions','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','filter','merge'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6c93,0x157));var _0x36c9=function(_0xa40210,_0x51c664){_0xa40210=_0xa40210-0x0;var _0xae0140=_0x6c93[_0xa40210];return _0xae0140;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36c9('0x0'));var zipdir=require(_0x36c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36c9('0x2'));var moment=require(_0x36c9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x36c9('0x4'));var util=require(_0x36c9('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x36c9('0x6'));var ejs=require(_0x36c9('0x7'));var fs=require('fs');var fs_extra=require(_0x36c9('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x36c9('0x9'));var jsforce=require(_0x36c9('0xa'));var deskjs=require(_0x36c9('0xb'));var toCsv=require(_0x36c9('0x6'));var querystring=require(_0x36c9('0xc'));var Papa=require('papaparse');var Redis=require(_0x36c9('0xd'));var authService=require(_0x36c9('0xe'));var qs=require(_0x36c9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x36c9('0x10'));var logger=require(_0x36c9('0x11'))(_0x36c9('0x12'));var utils=require(_0x36c9('0x13'));var config=require(_0x36c9('0x14'));var licenseUtil=require(_0x36c9('0x15'));var db=require(_0x36c9('0x16'))['db'];function respondWithStatusCode(_0x4fed5a,_0x1ec007){_0x1ec007=_0x1ec007||0xcc;return function(_0x3743b9){if(_0x3743b9){return _0x4fed5a[_0x36c9('0x17')](_0x1ec007);}return _0x4fed5a['status'](_0x1ec007)[_0x36c9('0x18')]();};}function respondWithResult(_0x1085ce,_0x39b694){_0x39b694=_0x39b694||0xc8;return function(_0x53b9e7){if(_0x53b9e7){return _0x1085ce[_0x36c9('0x19')](_0x39b694)[_0x36c9('0x1a')](_0x53b9e7);}};}function respondWithFilteredResult(_0x93ba7d,_0x5b4ccc){return function(_0x5df98f){if(_0x5df98f){var _0x327ab6=typeof _0x5b4ccc[_0x36c9('0x1b')]==='undefined'&&typeof _0x5b4ccc[_0x36c9('0x1c')]===_0x36c9('0x1d');var _0x341ad3=_0x5df98f['count'];var _0x570f8b=_0x327ab6?0x0:_0x5b4ccc[_0x36c9('0x1b')];var _0xc4a993=_0x327ab6?_0x5df98f['count']:_0x5b4ccc[_0x36c9('0x1b')]+_0x5b4ccc[_0x36c9('0x1c')];var _0x38ab9e;if(_0xc4a993>=_0x341ad3){_0xc4a993=_0x341ad3;_0x38ab9e=0xc8;}else{_0x38ab9e=0xce;}_0x93ba7d[_0x36c9('0x19')](_0x38ab9e);return _0x93ba7d[_0x36c9('0x1e')](_0x36c9('0x1f'),_0x570f8b+'-'+_0xc4a993+'/'+_0x341ad3)[_0x36c9('0x1a')](_0x5df98f);}return null;};}function patchUpdates(_0x49484b){return function(_0x54912f){try{jsonpatch[_0x36c9('0x20')](_0x54912f,_0x49484b,!![]);}catch(_0x170322){return BPromise[_0x36c9('0x21')](_0x170322);}return _0x54912f[_0x36c9('0x22')]();};}function saveUpdates(_0x31c327,_0x19cc20){return function(_0x5a1343){if(_0x5a1343){return _0x5a1343[_0x36c9('0x23')](_0x31c327)[_0x36c9('0x24')](function(_0xc6002d){return _0xc6002d;});}return null;};}function removeEntity(_0x537cd3,_0x38a914){return function(_0x588ef5){if(_0x588ef5){return _0x588ef5['destroy']()[_0x36c9('0x24')](function(){_0x537cd3['status'](0xcc)[_0x36c9('0x18')]();});}};}function handleEntityNotFound(_0x493fb2,_0x163ce2){return function(_0x45ec90){if(!_0x45ec90){_0x493fb2[_0x36c9('0x17')](0x194);}return _0x45ec90;};}function handleError(_0x2d460e,_0x167572){_0x167572=_0x167572||0x1f4;return function(_0x280258){logger[_0x36c9('0x25')](_0x280258[_0x36c9('0x26')]);if(_0x280258[_0x36c9('0x27')]){delete _0x280258['name'];}_0x2d460e['status'](_0x167572)[_0x36c9('0x28')](_0x280258);};}exports['index']=function(_0x122ae5,_0x49050f){var _0x50b0d7={},_0x5b3e5c={},_0xc5b9a={'count':0x0,'rows':[]};var _0x218161=_[_0x36c9('0x29')](db[_0x36c9('0x2a')][_0x36c9('0x2b')],function(_0x3dface){return{'name':_0x3dface[_0x36c9('0x2c')],'type':_0x3dface[_0x36c9('0x2d')][_0x36c9('0x2e')]};});_0x5b3e5c[_0x36c9('0x2f')]=_[_0x36c9('0x29')](_0x218161,_0x36c9('0x27'));_0x5b3e5c[_0x36c9('0x30')]=_[_0x36c9('0x31')](_0x122ae5[_0x36c9('0x30')]);_0x5b3e5c[_0x36c9('0x32')]=_[_0x36c9('0x33')](_0x5b3e5c['model'],_0x5b3e5c[_0x36c9('0x30')]);_0x50b0d7[_0x36c9('0x34')]=_[_0x36c9('0x33')](_0x5b3e5c[_0x36c9('0x2f')],qs[_0x36c9('0x35')](_0x122ae5[_0x36c9('0x30')][_0x36c9('0x35')]));_0x50b0d7['attributes']=_0x50b0d7[_0x36c9('0x34')][_0x36c9('0x36')]?_0x50b0d7[_0x36c9('0x34')]:_0x5b3e5c[_0x36c9('0x2f')];if(!_0x122ae5[_0x36c9('0x30')][_0x36c9('0x37')]('nolimit')){_0x50b0d7[_0x36c9('0x1c')]=qs['limit'](_0x122ae5[_0x36c9('0x30')][_0x36c9('0x1c')]);_0x50b0d7[_0x36c9('0x1b')]=qs['offset'](_0x122ae5[_0x36c9('0x30')][_0x36c9('0x1b')]);}_0x50b0d7[_0x36c9('0x38')]=qs[_0x36c9('0x39')](_0x122ae5['query']['sort']);_0x50b0d7['where']=qs[_0x36c9('0x32')](_[_0x36c9('0x3a')](_0x122ae5['query'],_0x5b3e5c[_0x36c9('0x32')]),_0x218161);if(_0x122ae5[_0x36c9('0x30')]['filter']){_0x50b0d7[_0x36c9('0x3b')]=_['merge'](_0x50b0d7[_0x36c9('0x3b')],{'$or':_[_0x36c9('0x29')](_0x218161,function(_0x192727){if(_0x192727[_0x36c9('0x2d')]!=='VIRTUAL'){var _0x2dc28c={};_0x2dc28c[_0x192727['name']]={'$like':'%'+_0x122ae5[_0x36c9('0x30')][_0x36c9('0x3c')]+'%'};return _0x2dc28c;}})});}_0x50b0d7=_[_0x36c9('0x3d')]({},_0x50b0d7,_0x122ae5[_0x36c9('0x3e')]);var _0x228d9c={'where':_0x50b0d7['where']};return db[_0x36c9('0x2a')][_0x36c9('0x3f')](_0x228d9c)[_0x36c9('0x24')](function(_0x2d8d49){_0xc5b9a[_0x36c9('0x3f')]=_0x2d8d49;if(_0x122ae5[_0x36c9('0x30')][_0x36c9('0x40')]){_0x50b0d7[_0x36c9('0x41')]=[{'all':!![]}];}return db[_0x36c9('0x2a')][_0x36c9('0x42')](_0x50b0d7);})['then'](function(_0x341554){_0xc5b9a[_0x36c9('0x43')]=_0x341554;return _0xc5b9a;})[_0x36c9('0x24')](respondWithFilteredResult(_0x49050f,_0x50b0d7))[_0x36c9('0x44')](handleError(_0x49050f,null));};exports[_0x36c9('0x45')]=function(_0x12ee44,_0x54c34d){var _0x9bacd9={'raw':![],'where':{'id':_0x12ee44['params']['id']}},_0xa81d16={};_0xa81d16[_0x36c9('0x2f')]=_['keys'](db[_0x36c9('0x2a')]['rawAttributes']);_0xa81d16[_0x36c9('0x30')]=_[_0x36c9('0x31')](_0x12ee44[_0x36c9('0x30')]);_0xa81d16[_0x36c9('0x32')]=_[_0x36c9('0x33')](_0xa81d16[_0x36c9('0x2f')],_0xa81d16['query']);_0x9bacd9[_0x36c9('0x34')]=_[_0x36c9('0x33')](_0xa81d16[_0x36c9('0x2f')],qs[_0x36c9('0x35')](_0x12ee44[_0x36c9('0x30')][_0x36c9('0x35')]));_0x9bacd9['attributes']=_0x9bacd9[_0x36c9('0x34')][_0x36c9('0x36')]?_0x9bacd9[_0x36c9('0x34')]:_0xa81d16['model'];if(_0x12ee44['query'][_0x36c9('0x40')]){_0x9bacd9[_0x36c9('0x41')]=[{'all':!![]}];}_0x9bacd9=_[_0x36c9('0x3d')]({},_0x9bacd9,_0x12ee44[_0x36c9('0x3e')]);return db[_0x36c9('0x2a')]['find'](_0x9bacd9)[_0x36c9('0x24')](handleEntityNotFound(_0x54c34d,null))['then'](respondWithResult(_0x54c34d,null))['catch'](handleError(_0x54c34d,null));};exports[_0x36c9('0x46')]=function(_0x4b687b,_0x4c9f16){return db[_0x36c9('0x2a')][_0x36c9('0x46')](_0x4b687b[_0x36c9('0x47')],{})[_0x36c9('0x24')](respondWithResult(_0x4c9f16,0xc9))[_0x36c9('0x44')](handleError(_0x4c9f16,null));};exports['update']=function(_0x5f2e10,_0x494a64){if(_0x5f2e10[_0x36c9('0x47')]['id']){delete _0x5f2e10[_0x36c9('0x47')]['id'];}return db[_0x36c9('0x2a')][_0x36c9('0x48')]({'where':{'id':_0x5f2e10[_0x36c9('0x49')]['id']}})[_0x36c9('0x24')](handleEntityNotFound(_0x494a64,null))[_0x36c9('0x24')](saveUpdates(_0x5f2e10[_0x36c9('0x47')],null))['then'](respondWithResult(_0x494a64,null))[_0x36c9('0x44')](handleError(_0x494a64,null));};exports[_0x36c9('0x4a')]=function(_0x1ddaa9,_0x598fbb){return db[_0x36c9('0x2a')][_0x36c9('0x48')]({'where':{'id':_0x1ddaa9[_0x36c9('0x49')]['id']}})[_0x36c9('0x24')](handleEntityNotFound(_0x598fbb,null))[_0x36c9('0x24')](removeEntity(_0x598fbb,null))[_0x36c9('0x44')](handleError(_0x598fbb,null));};exports['getFields']=function(_0x2d2606,_0x5b7d3e,_0x2d96b2){var _0x5d5791={};var _0x52e353={};var _0x163171;var _0xa5d324;return db[_0x36c9('0x2a')][_0x36c9('0x4b')]({'where':{'id':_0x2d2606[_0x36c9('0x49')]['id']}})[_0x36c9('0x24')](handleEntityNotFound(_0x5b7d3e,null))['then'](function(_0x111be9){if(_0x111be9){_0x163171=_0x111be9;_0x52e353[_0x36c9('0x2f')]=_[_0x36c9('0x31')](db['ServicenowField'][_0x36c9('0x2b')]);_0x52e353['query']=_[_0x36c9('0x31')](_0x2d2606['query']);_0x52e353[_0x36c9('0x32')]=_['intersection'](_0x52e353[_0x36c9('0x2f')],_0x52e353['query']);_0x5d5791[_0x36c9('0x34')]=_['intersection'](_0x52e353[_0x36c9('0x2f')],qs['fields'](_0x2d2606[_0x36c9('0x30')][_0x36c9('0x35')]));_0x5d5791[_0x36c9('0x34')]=_0x5d5791['attributes'][_0x36c9('0x36')]?_0x5d5791[_0x36c9('0x34')]:_0x52e353['model'];_0x5d5791[_0x36c9('0x38')]=qs[_0x36c9('0x39')](_0x2d2606[_0x36c9('0x30')][_0x36c9('0x39')]);_0x5d5791[_0x36c9('0x3b')]=qs['filters'](_[_0x36c9('0x3a')](_0x2d2606[_0x36c9('0x30')],_0x52e353['filters']));if(_0x2d2606[_0x36c9('0x30')][_0x36c9('0x3c')]){_0x5d5791[_0x36c9('0x3b')]=_['merge'](_0x5d5791[_0x36c9('0x3b')],{'$or':_['map'](_0x5d5791[_0x36c9('0x34')],function(_0x568f19){var _0x1ff7ec={};_0x1ff7ec[_0x568f19]={'$like':'%'+_0x2d2606[_0x36c9('0x30')][_0x36c9('0x3c')]+'%'};return _0x1ff7ec;})});}_0x5d5791=_[_0x36c9('0x3d')]({},_0x5d5791,_0x2d2606[_0x36c9('0x3e')]);return _0x163171[_0x36c9('0x4c')](_0x5d5791);}})[_0x36c9('0x24')](function(_0x2eeeeb){if(_0x2eeeeb){_0xa5d324=_0x2eeeeb['length'];if(!_0x2d2606[_0x36c9('0x30')][_0x36c9('0x37')](_0x36c9('0x4d'))){_0x5d5791[_0x36c9('0x1c')]=qs['limit'](_0x2d2606[_0x36c9('0x30')][_0x36c9('0x1c')]);_0x5d5791[_0x36c9('0x1b')]=qs[_0x36c9('0x1b')](_0x2d2606[_0x36c9('0x30')][_0x36c9('0x1b')]);}return _0x163171[_0x36c9('0x4c')](_0x5d5791);}})[_0x36c9('0x24')](function(_0x367564){if(_0x367564){return _0x367564?{'count':_0xa5d324,'rows':_0x367564}:null;}})[_0x36c9('0x24')](respondWithResult(_0x5b7d3e,null))[_0x36c9('0x44')](handleError(_0x5b7d3e,null));};exports[_0x36c9('0x4e')]=function(_0x6dab31,_0x28da37,_0x29513c){var _0x312d1a={};var _0x4118d0={};var _0x2e3639;var _0x2a64b7;return db[_0x36c9('0x2a')][_0x36c9('0x4b')]({'where':{'id':_0x6dab31[_0x36c9('0x49')]['id']}})[_0x36c9('0x24')](handleEntityNotFound(_0x28da37,null))['then'](function(_0x58ba70){if(_0x58ba70){_0x2e3639=_0x58ba70;_0x4118d0[_0x36c9('0x2f')]=_[_0x36c9('0x31')](db[_0x36c9('0x4f')][_0x36c9('0x2b')]);_0x4118d0[_0x36c9('0x30')]=_[_0x36c9('0x31')](_0x6dab31[_0x36c9('0x30')]);_0x4118d0['filters']=_[_0x36c9('0x33')](_0x4118d0[_0x36c9('0x2f')],_0x4118d0[_0x36c9('0x30')]);_0x312d1a[_0x36c9('0x34')]=_[_0x36c9('0x33')](_0x4118d0[_0x36c9('0x2f')],qs['fields'](_0x6dab31[_0x36c9('0x30')][_0x36c9('0x35')]));_0x312d1a[_0x36c9('0x34')]=_0x312d1a['attributes'][_0x36c9('0x36')]?_0x312d1a['attributes']:_0x4118d0[_0x36c9('0x2f')];_0x312d1a['order']=qs[_0x36c9('0x39')](_0x6dab31[_0x36c9('0x30')][_0x36c9('0x39')]);_0x312d1a[_0x36c9('0x3b')]=qs[_0x36c9('0x32')](_['pick'](_0x6dab31[_0x36c9('0x30')],_0x4118d0[_0x36c9('0x32')]));if(_0x6dab31[_0x36c9('0x30')]['filter']){_0x312d1a[_0x36c9('0x3b')]=_[_0x36c9('0x3d')](_0x312d1a[_0x36c9('0x3b')],{'$or':_[_0x36c9('0x29')](_0x312d1a[_0x36c9('0x34')],function(_0x509cbd){var _0x24f8b5={};_0x24f8b5[_0x509cbd]={'$like':'%'+_0x6dab31['query'][_0x36c9('0x3c')]+'%'};return _0x24f8b5;})});}_0x312d1a=_[_0x36c9('0x3d')]({},_0x312d1a,_0x6dab31['options']);return _0x2e3639['getSubjects'](_0x312d1a);}})[_0x36c9('0x24')](function(_0x180530){if(_0x180530){_0x2a64b7=_0x180530[_0x36c9('0x36')];if(!_0x6dab31[_0x36c9('0x30')]['hasOwnProperty'](_0x36c9('0x4d'))){_0x312d1a['limit']=qs[_0x36c9('0x1c')](_0x6dab31['query']['limit']);_0x312d1a[_0x36c9('0x1b')]=qs[_0x36c9('0x1b')](_0x6dab31[_0x36c9('0x30')][_0x36c9('0x1b')]);}return _0x2e3639[_0x36c9('0x4e')](_0x312d1a);}})[_0x36c9('0x24')](function(_0x2ad0a3){if(_0x2ad0a3){return _0x2ad0a3?{'count':_0x2a64b7,'rows':_0x2ad0a3}:null;}})['then'](respondWithResult(_0x28da37,null))[_0x36c9('0x44')](handleError(_0x28da37,null));};exports[_0x36c9('0x50')]=function(_0x36ca15,_0x399269,_0x4eda8b){var _0x4d995b={};var _0x383664={};var _0x1d0997;var _0x16359a;return db[_0x36c9('0x2a')][_0x36c9('0x4b')]({'where':{'id':_0x36ca15[_0x36c9('0x49')]['id']}})[_0x36c9('0x24')](handleEntityNotFound(_0x399269,null))[_0x36c9('0x24')](function(_0x346b7d){if(_0x346b7d){_0x1d0997=_0x346b7d;_0x383664[_0x36c9('0x2f')]=_[_0x36c9('0x31')](db[_0x36c9('0x4f')]['rawAttributes']);_0x383664[_0x36c9('0x30')]=_['keys'](_0x36ca15['query']);_0x383664[_0x36c9('0x32')]=_[_0x36c9('0x33')](_0x383664[_0x36c9('0x2f')],_0x383664['query']);_0x4d995b[_0x36c9('0x34')]=_[_0x36c9('0x33')](_0x383664['model'],qs[_0x36c9('0x35')](_0x36ca15[_0x36c9('0x30')]['fields']));_0x4d995b['attributes']=_0x4d995b['attributes'][_0x36c9('0x36')]?_0x4d995b['attributes']:_0x383664['model'];_0x4d995b[_0x36c9('0x38')]=qs['sort'](_0x36ca15[_0x36c9('0x30')][_0x36c9('0x39')]);_0x4d995b['where']=qs[_0x36c9('0x32')](_[_0x36c9('0x3a')](_0x36ca15[_0x36c9('0x30')],_0x383664[_0x36c9('0x32')]));if(_0x36ca15[_0x36c9('0x30')][_0x36c9('0x3c')]){_0x4d995b[_0x36c9('0x3b')]=_['merge'](_0x4d995b[_0x36c9('0x3b')],{'$or':_[_0x36c9('0x29')](_0x4d995b[_0x36c9('0x34')],function(_0x2fa9f9){var _0x356337={};_0x356337[_0x2fa9f9]={'$like':'%'+_0x36ca15[_0x36c9('0x30')][_0x36c9('0x3c')]+'%'};return _0x356337;})});}_0x4d995b=_[_0x36c9('0x3d')]({},_0x4d995b,_0x36ca15[_0x36c9('0x3e')]);return _0x1d0997['getDescriptions'](_0x4d995b);}})[_0x36c9('0x24')](function(_0x1a7240){if(_0x1a7240){_0x16359a=_0x1a7240['length'];if(!_0x36ca15[_0x36c9('0x30')][_0x36c9('0x37')](_0x36c9('0x4d'))){_0x4d995b[_0x36c9('0x1c')]=qs[_0x36c9('0x1c')](_0x36ca15[_0x36c9('0x30')]['limit']);_0x4d995b[_0x36c9('0x1b')]=qs[_0x36c9('0x1b')](_0x36ca15[_0x36c9('0x30')]['offset']);}return _0x1d0997[_0x36c9('0x50')](_0x4d995b);}})[_0x36c9('0x24')](function(_0x3f3931){if(_0x3f3931){return _0x3f3931?{'count':_0x16359a,'rows':_0x3f3931}:null;}})['then'](respondWithResult(_0x399269,null))['catch'](handleError(_0x399269,null));};
\ No newline at end of file
index e02f5f9..1a306fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5867=['int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration'];(function(_0x66fcd3,_0x289ce9){var _0x22f7ca=function(_0x581e57){while(--_0x581e57){_0x66fcd3['push'](_0x66fcd3['shift']());}};_0x22f7ca(++_0x289ce9);}(_0x5867,0x1e2));var _0x7586=function(_0x169980,_0x161462){_0x169980=_0x169980-0x0;var _0x5acceb=_0x5867[_0x169980];return _0x5acceb;};'use strict';var _=require(_0x7586('0x0'));var util=require(_0x7586('0x1'));var logger=require(_0x7586('0x2'))(_0x7586('0x3'));var moment=require(_0x7586('0x4'));var BPromise=require(_0x7586('0x5'));var rp=require(_0x7586('0x6'));var fs=require('fs');var path=require(_0x7586('0x7'));var rimraf=require(_0x7586('0x8'));var config=require('../../config/environment');var attributes=require(_0x7586('0x9'));module[_0x7586('0xa')]=function(_0x2b0ce9,_0xac832a){return _0x2b0ce9['define'](_0x7586('0xb'),attributes,{'tableName':_0x7586('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b20=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration'];(function(_0x821b36,_0x5ac062){var _0x466071=function(_0x5b8f49){while(--_0x5b8f49){_0x821b36['push'](_0x821b36['shift']());}};_0x466071(++_0x5ac062);}(_0x6b20,0xd1));var _0x06b2=function(_0x342c19,_0x425ec6){_0x342c19=_0x342c19-0x0;var _0x33c0b3=_0x6b20[_0x342c19];return _0x33c0b3;};'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_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c5d1787..ad34374 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','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x10ad,0xf4));var _0xd10a=function(_0x59f02c,_0xdf391a){_0x59f02c=_0x59f02c-0x0;var _0x19f54c=_0x10ad[_0x59f02c];return _0x19f54c;};'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')]('ServicenowConfiguration,\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 _0x912e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment'];(function(_0x2da4da,_0x1a5a83){var _0x5be65b=function(_0xc52ba){while(--_0xc52ba){_0x2da4da['push'](_0x2da4da['shift']());}};_0x5be65b(++_0x1a5a83);}(_0x912e,0xe5));var _0xe912=function(_0x435395,_0x6e2d2b){_0x435395=_0x435395-0x0;var _0x4902e5=_0x912e[_0x435395];return _0x4902e5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe912('0x0'));var BPromise=require(_0xe912('0x1'));var rs=require(_0xe912('0x2'));var fs=require('fs');var Redis=require(_0xe912('0x3'));var db=require(_0xe912('0x4'))['db'];var utils=require(_0xe912('0x5'));var logger=require(_0xe912('0x6'))(_0xe912('0x7'));var config=require('../../config/environment');var jayson=require(_0xe912('0x8'));var client=jayson[_0xe912('0x9')][_0xe912('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c5ba3,_0x40caf1,_0x290839){return new BPromise(function(_0x55f750,_0xa7c8d9){return client[_0xe912('0xb')](_0x1c5ba3,_0x290839)[_0xe912('0xc')](function(_0x2295a4){logger['info'](_0xe912('0xd'),_0x40caf1,_0xe912('0xe'));logger[_0xe912('0xf')](_0xe912('0x10'),_0x40caf1,_0xe912('0xe'),JSON[_0xe912('0x11')](_0x2295a4));if(_0x2295a4[_0xe912('0x12')]){if(_0x2295a4['error'][_0xe912('0x13')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x40caf1,_0x2295a4['error'][_0xe912('0x14')]);return _0xa7c8d9(_0x2295a4[_0xe912('0x12')][_0xe912('0x14')]);}logger[_0xe912('0x12')](_0xe912('0xd'),_0x40caf1,_0x2295a4['error'][_0xe912('0x14')]);return _0x55f750(_0x2295a4[_0xe912('0x12')]['message']);}else{logger[_0xe912('0x15')](_0xe912('0xd'),_0x40caf1,_0xe912('0xe'));_0x55f750(_0x2295a4['result'][_0xe912('0x14')]);}})[_0xe912('0x16')](function(_0x260589){logger[_0xe912('0x12')](_0xe912('0xd'),_0x40caf1,_0x260589);_0xa7c8d9(_0x260589);});});}
\ No newline at end of file
index b03c84c..cbee33c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa355=['./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0xa355,0xff));var _0x5a35=function(_0x1e028c,_0x2bd5b0){_0x1e028c=_0x1e028c-0x0;var _0x336831=_0xa355[_0x1e028c];return _0x336831;};'use strict';var multer=require(_0x5a35('0x0'));var util=require('util');var path=require(_0x5a35('0x1'));var timeout=require(_0x5a35('0x2'));var express=require(_0x5a35('0x3'));var router=express[_0x5a35('0x4')]();var fs_extra=require(_0x5a35('0x5'));var auth=require(_0x5a35('0x6'));var interaction=require(_0x5a35('0x7'));var config=require(_0x5a35('0x8'));var controller=require(_0x5a35('0x9'));router[_0x5a35('0xa')]('/',auth[_0x5a35('0xb')](),controller[_0x5a35('0xc')]);router[_0x5a35('0xa')](_0x5a35('0xd'),auth[_0x5a35('0xb')](),controller[_0x5a35('0xe')]);router[_0x5a35('0xf')]('/',auth[_0x5a35('0xb')](),controller[_0x5a35('0x10')]);router[_0x5a35('0x11')](_0x5a35('0xd'),auth[_0x5a35('0xb')](),controller[_0x5a35('0x12')]);router[_0x5a35('0x13')]('/:id',auth[_0x5a35('0xb')](),controller[_0x5a35('0x14')]);module[_0x5a35('0x15')]=router;
\ No newline at end of file
+var _0xfbe2=['post','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x558b88,_0x1b2940){var _0x2032b2=function(_0x43cb47){while(--_0x43cb47){_0x558b88['push'](_0x558b88['shift']());}};_0x2032b2(++_0x1b2940);}(_0xfbe2,0x1f2));var _0x2fbe=function(_0x3e4ccf,_0x263017){_0x3e4ccf=_0x3e4ccf-0x0;var _0x25d931=_0xfbe2[_0x3e4ccf];return _0x25d931;};'use strict';var multer=require(_0x2fbe('0x0'));var util=require(_0x2fbe('0x1'));var path=require('path');var timeout=require(_0x2fbe('0x2'));var express=require(_0x2fbe('0x3'));var router=express['Router']();var fs_extra=require(_0x2fbe('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2fbe('0x5'));var config=require('../../config/environment');var controller=require(_0x2fbe('0x6'));router[_0x2fbe('0x7')]('/',auth[_0x2fbe('0x8')](),controller[_0x2fbe('0x9')]);router[_0x2fbe('0x7')](_0x2fbe('0xa'),auth[_0x2fbe('0x8')](),controller[_0x2fbe('0xb')]);router[_0x2fbe('0xc')]('/',auth[_0x2fbe('0x8')](),controller['create']);router['put'](_0x2fbe('0xa'),auth[_0x2fbe('0x8')](),controller[_0x2fbe('0xd')]);router[_0x2fbe('0xe')](_0x2fbe('0xa'),auth[_0x2fbe('0x8')](),controller[_0x2fbe('0xf')]);module[_0x2fbe('0x10')]=router;
\ No newline at end of file
index eb9b844..b589fa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85d2=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x25726e,_0x3b13f6){var _0x29d818=function(_0x4de2dc){while(--_0x4de2dc){_0x25726e['push'](_0x25726e['shift']());}};_0x29d818(++_0x3b13f6);}(_0x85d2,0x110));var _0x285d=function(_0x415d66,_0x822d9f){_0x415d66=_0x415d66-0x0;var _0x19580d=_0x85d2[_0x415d66];return _0x19580d;};'use strict';var Sequelize=require('sequelize');module[_0x285d('0x0')]={'type':{'type':Sequelize[_0x285d('0x1')](_0x285d('0x2'),_0x285d('0x3'),_0x285d('0x4'),_0x285d('0x5'),'picklist'),'defaultValue':_0x285d('0x2')},'content':{'type':Sequelize[_0x285d('0x6')]},'key':{'type':Sequelize[_0x285d('0x6')]},'keyType':{'type':Sequelize[_0x285d('0x1')]('string',_0x285d('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x285d('0x6')]},'idField':{'type':Sequelize[_0x285d('0x6')]},'nameField':{'type':Sequelize[_0x285d('0x6')]},'customField':{'type':Sequelize[_0x285d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x285d('0x6')]}};
\ No newline at end of file
+var _0x2880=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x5d89ef,_0x25ba92){var _0x24c2fe=function(_0x17e551){while(--_0x17e551){_0x5d89ef['push'](_0x5d89ef['shift']());}};_0x24c2fe(++_0x25ba92);}(_0x2880,0xc7));var _0x0288=function(_0x3c6a93,_0x408ed6){_0x3c6a93=_0x3c6a93-0x0;var _0x396500=_0x2880[_0x3c6a93];return _0x396500;};'use strict';var Sequelize=require(_0x0288('0x0'));module[_0x0288('0x1')]={'type':{'type':Sequelize[_0x0288('0x2')](_0x0288('0x3'),_0x0288('0x4'),_0x0288('0x5'),_0x0288('0x6'),_0x0288('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0288('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x0288('0x3'),'variable',_0x0288('0x5'))},'keyContent':{'type':Sequelize[_0x0288('0x8')]},'idField':{'type':Sequelize[_0x0288('0x8')]},'nameField':{'type':Sequelize[_0x0288('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0288('0x8')]}};
\ No newline at end of file
index 70a9419..c286001 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b65=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','send','index','ServicenowField','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','catch','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox'];(function(_0x272812,_0x49861b){var _0x5cce9d=function(_0x13f934){while(--_0x13f934){_0x272812['push'](_0x272812['shift']());}};_0x5cce9d(++_0x49861b);}(_0x8b65,0x161));var _0x58b6=function(_0x5b1393,_0x3cc0b8){_0x5b1393=_0x5b1393-0x0;var _0x55d7d6=_0x8b65[_0x5b1393];return _0x55d7d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58b6('0x0'));var zipdir=require(_0x58b6('0x1'));var jsonpatch=require(_0x58b6('0x2'));var rp=require(_0x58b6('0x3'));var moment=require('moment');var BPromise=require(_0x58b6('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x58b6('0x5'));var sox=require(_0x58b6('0x6'));var csv=require(_0x58b6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58b6('0x8'));var _=require(_0x58b6('0x9'));var squel=require(_0x58b6('0xa'));var crypto=require(_0x58b6('0xb'));var jsforce=require(_0x58b6('0xc'));var deskjs=require(_0x58b6('0xd'));var toCsv=require(_0x58b6('0x7'));var querystring=require(_0x58b6('0xe'));var Papa=require('papaparse');var Redis=require(_0x58b6('0xf'));var authService=require(_0x58b6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x58b6('0x11'));var hardwareService=require(_0x58b6('0x12'));var logger=require(_0x58b6('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x58b6('0x14'));var licenseUtil=require(_0x58b6('0x15'));var db=require(_0x58b6('0x16'))['db'];function respondWithStatusCode(_0x4e3a83,_0xcd245e){_0xcd245e=_0xcd245e||0xcc;return function(_0x3c09ad){if(_0x3c09ad){return _0x4e3a83[_0x58b6('0x17')](_0xcd245e);}return _0x4e3a83[_0x58b6('0x18')](_0xcd245e)[_0x58b6('0x19')]();};}function respondWithResult(_0x5694bb,_0x502458){_0x502458=_0x502458||0xc8;return function(_0x19efca){if(_0x19efca){return _0x5694bb[_0x58b6('0x18')](_0x502458)[_0x58b6('0x1a')](_0x19efca);}};}function respondWithFilteredResult(_0x1ee0ae,_0x42e754){return function(_0x5b31c8){if(_0x5b31c8){var _0x55cbbb=typeof _0x42e754[_0x58b6('0x1b')]===_0x58b6('0x1c')&&typeof _0x42e754[_0x58b6('0x1d')]===_0x58b6('0x1c');var _0x1f72fa=_0x5b31c8[_0x58b6('0x1e')];var _0xa2c281=_0x55cbbb?0x0:_0x42e754['offset'];var _0x49e66c=_0x55cbbb?_0x5b31c8[_0x58b6('0x1e')]:_0x42e754[_0x58b6('0x1b')]+_0x42e754['limit'];var _0x4f9b6e;if(_0x49e66c>=_0x1f72fa){_0x49e66c=_0x1f72fa;_0x4f9b6e=0xc8;}else{_0x4f9b6e=0xce;}_0x1ee0ae[_0x58b6('0x18')](_0x4f9b6e);return _0x1ee0ae[_0x58b6('0x1f')]('Content-Range',_0xa2c281+'-'+_0x49e66c+'/'+_0x1f72fa)[_0x58b6('0x1a')](_0x5b31c8);}return null;};}function patchUpdates(_0x4e616a){return function(_0x3a54c2){try{jsonpatch[_0x58b6('0x20')](_0x3a54c2,_0x4e616a,!![]);}catch(_0x210882){return BPromise[_0x58b6('0x21')](_0x210882);}return _0x3a54c2['save']();};}function saveUpdates(_0x38f5d8,_0x350e52){return function(_0x20ad38){if(_0x20ad38){return _0x20ad38[_0x58b6('0x22')](_0x38f5d8)[_0x58b6('0x23')](function(_0x115263){return _0x115263;});}return null;};}function removeEntity(_0x4d95c4,_0x25d92a){return function(_0x35a3c1){if(_0x35a3c1){return _0x35a3c1[_0x58b6('0x24')]()[_0x58b6('0x23')](function(){_0x4d95c4[_0x58b6('0x18')](0xcc)[_0x58b6('0x19')]();});}};}function handleEntityNotFound(_0x3507fe,_0x3bb219){return function(_0x338e60){if(!_0x338e60){_0x3507fe[_0x58b6('0x17')](0x194);}return _0x338e60;};}function handleError(_0x182f68,_0xc116ea){_0xc116ea=_0xc116ea||0x1f4;return function(_0x15a6e4){logger[_0x58b6('0x25')](_0x15a6e4['stack']);if(_0x15a6e4[_0x58b6('0x26')]){delete _0x15a6e4[_0x58b6('0x26')];}_0x182f68[_0x58b6('0x18')](_0xc116ea)[_0x58b6('0x27')](_0x15a6e4);};}exports[_0x58b6('0x28')]=function(_0x5f12ab,_0x455637){var _0x52a7b2={},_0x3cfe24={},_0x26084f={'count':0x0,'rows':[]};var _0x3cbfb0=_['map'](db[_0x58b6('0x29')][_0x58b6('0x2a')],function(_0xba6c38){return{'name':_0xba6c38[_0x58b6('0x2b')],'type':_0xba6c38[_0x58b6('0x2c')][_0x58b6('0x2d')]};});_0x3cfe24['model']=_['map'](_0x3cbfb0,_0x58b6('0x26'));_0x3cfe24[_0x58b6('0x2e')]=_[_0x58b6('0x2f')](_0x5f12ab[_0x58b6('0x2e')]);_0x3cfe24['filters']=_[_0x58b6('0x30')](_0x3cfe24[_0x58b6('0x31')],_0x3cfe24['query']);_0x52a7b2['attributes']=_['intersection'](_0x3cfe24[_0x58b6('0x31')],qs[_0x58b6('0x32')](_0x5f12ab[_0x58b6('0x2e')][_0x58b6('0x32')]));_0x52a7b2[_0x58b6('0x33')]=_0x52a7b2[_0x58b6('0x33')][_0x58b6('0x34')]?_0x52a7b2[_0x58b6('0x33')]:_0x3cfe24[_0x58b6('0x31')];if(!_0x5f12ab[_0x58b6('0x2e')]['hasOwnProperty'](_0x58b6('0x35'))){_0x52a7b2[_0x58b6('0x1d')]=qs[_0x58b6('0x1d')](_0x5f12ab[_0x58b6('0x2e')]['limit']);_0x52a7b2['offset']=qs[_0x58b6('0x1b')](_0x5f12ab[_0x58b6('0x2e')]['offset']);}_0x52a7b2[_0x58b6('0x36')]=qs['sort'](_0x5f12ab['query'][_0x58b6('0x37')]);_0x52a7b2[_0x58b6('0x38')]=qs[_0x58b6('0x39')](_['pick'](_0x5f12ab[_0x58b6('0x2e')],_0x3cfe24[_0x58b6('0x39')]),_0x3cbfb0);if(_0x5f12ab[_0x58b6('0x2e')][_0x58b6('0x3a')]){_0x52a7b2['where']=_[_0x58b6('0x3b')](_0x52a7b2['where'],{'$or':_['map'](_0x3cbfb0,function(_0x39db77){if(_0x39db77[_0x58b6('0x2c')]!==_0x58b6('0x3c')){var _0x3f7593={};_0x3f7593[_0x39db77[_0x58b6('0x26')]]={'$like':'%'+_0x5f12ab['query']['filter']+'%'};return _0x3f7593;}})});}_0x52a7b2=_[_0x58b6('0x3b')]({},_0x52a7b2,_0x5f12ab[_0x58b6('0x3d')]);var _0x3ea770={'where':_0x52a7b2[_0x58b6('0x38')]};return db[_0x58b6('0x29')][_0x58b6('0x1e')](_0x3ea770)[_0x58b6('0x23')](function(_0x1f1b9e){_0x26084f[_0x58b6('0x1e')]=_0x1f1b9e;if(_0x5f12ab['query'][_0x58b6('0x3e')]){_0x52a7b2['include']=[{'all':!![]}];}return db[_0x58b6('0x29')][_0x58b6('0x3f')](_0x52a7b2);})[_0x58b6('0x23')](function(_0x1c10a9){_0x26084f[_0x58b6('0x40')]=_0x1c10a9;return _0x26084f;})[_0x58b6('0x23')](respondWithFilteredResult(_0x455637,_0x52a7b2))['catch'](handleError(_0x455637,null));};exports[_0x58b6('0x41')]=function(_0x3665b4,_0x35832c){var _0x364f1d={'raw':!![],'where':{'id':_0x3665b4['params']['id']}},_0x3ee3f3={};_0x3ee3f3[_0x58b6('0x31')]=_[_0x58b6('0x2f')](db[_0x58b6('0x29')][_0x58b6('0x2a')]);_0x3ee3f3[_0x58b6('0x2e')]=_[_0x58b6('0x2f')](_0x3665b4[_0x58b6('0x2e')]);_0x3ee3f3[_0x58b6('0x39')]=_[_0x58b6('0x30')](_0x3ee3f3[_0x58b6('0x31')],_0x3ee3f3[_0x58b6('0x2e')]);_0x364f1d[_0x58b6('0x33')]=_[_0x58b6('0x30')](_0x3ee3f3[_0x58b6('0x31')],qs[_0x58b6('0x32')](_0x3665b4[_0x58b6('0x2e')]['fields']));_0x364f1d[_0x58b6('0x33')]=_0x364f1d['attributes'][_0x58b6('0x34')]?_0x364f1d[_0x58b6('0x33')]:_0x3ee3f3['model'];if(_0x3665b4[_0x58b6('0x2e')][_0x58b6('0x3e')]){_0x364f1d[_0x58b6('0x42')]=[{'all':!![]}];}_0x364f1d=_[_0x58b6('0x3b')]({},_0x364f1d,_0x3665b4['options']);return db[_0x58b6('0x29')]['find'](_0x364f1d)[_0x58b6('0x23')](handleEntityNotFound(_0x35832c,null))[_0x58b6('0x23')](respondWithResult(_0x35832c,null))[_0x58b6('0x43')](handleError(_0x35832c,null));};exports[_0x58b6('0x44')]=function(_0xae7199,_0x2bee46){return db[_0x58b6('0x29')][_0x58b6('0x44')](_0xae7199[_0x58b6('0x45')],{})[_0x58b6('0x23')](respondWithResult(_0x2bee46,0xc9))[_0x58b6('0x43')](handleError(_0x2bee46,null));};exports['update']=function(_0x2c37b3,_0x38c233){if(_0x2c37b3[_0x58b6('0x45')]['id']){delete _0x2c37b3['body']['id'];}return db['ServicenowField'][_0x58b6('0x46')]({'where':{'id':_0x2c37b3[_0x58b6('0x47')]['id']}})[_0x58b6('0x23')](handleEntityNotFound(_0x38c233,null))[_0x58b6('0x23')](saveUpdates(_0x2c37b3[_0x58b6('0x45')],null))['then'](respondWithResult(_0x38c233,null))[_0x58b6('0x43')](handleError(_0x38c233,null));};exports[_0x58b6('0x24')]=function(_0x501db9,_0x4b20ec){return db[_0x58b6('0x29')][_0x58b6('0x46')]({'where':{'id':_0x501db9[_0x58b6('0x47')]['id']}})[_0x58b6('0x23')](handleEntityNotFound(_0x4b20ec,null))[_0x58b6('0x23')](removeEntity(_0x4b20ec,null))[_0x58b6('0x43')](handleError(_0x4b20ec,null));};
\ No newline at end of file
+var _0x2ed5=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','json','apply','reject','save','update','then','destroy','stack','name','send','map','ServicenowField','rawAttributes','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','limit','sort','filter','merge','where','options','include','findAll','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2ed5,0x1bd));var _0x52ed=function(_0x3bfe56,_0x25bbd4){_0x3bfe56=_0x3bfe56-0x0;var _0x43f429=_0x2ed5[_0x3bfe56];return _0x43f429;};'use strict';var emlformat=require(_0x52ed('0x0'));var rimraf=require(_0x52ed('0x1'));var zipdir=require(_0x52ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52ed('0x3'));var moment=require(_0x52ed('0x4'));var BPromise=require(_0x52ed('0x5'));var Mustache=require(_0x52ed('0x6'));var util=require(_0x52ed('0x7'));var path=require(_0x52ed('0x8'));var sox=require(_0x52ed('0x9'));var csv=require(_0x52ed('0xa'));var ejs=require(_0x52ed('0xb'));var fs=require('fs');var fs_extra=require(_0x52ed('0xc'));var _=require(_0x52ed('0xd'));var squel=require(_0x52ed('0xe'));var crypto=require(_0x52ed('0xf'));var jsforce=require(_0x52ed('0x10'));var deskjs=require(_0x52ed('0x11'));var toCsv=require(_0x52ed('0xa'));var querystring=require(_0x52ed('0x12'));var Papa=require(_0x52ed('0x13'));var Redis=require(_0x52ed('0x14'));var authService=require(_0x52ed('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x52ed('0x16'));var hardwareService=require(_0x52ed('0x17'));var logger=require(_0x52ed('0x18'))('api');var utils=require(_0x52ed('0x19'));var config=require(_0x52ed('0x1a'));var licenseUtil=require(_0x52ed('0x1b'));var db=require(_0x52ed('0x1c'))['db'];function respondWithStatusCode(_0x4da8b6,_0x4cdf96){_0x4cdf96=_0x4cdf96||0xcc;return function(_0x39bcae){if(_0x39bcae){return _0x4da8b6[_0x52ed('0x1d')](_0x4cdf96);}return _0x4da8b6[_0x52ed('0x1e')](_0x4cdf96)[_0x52ed('0x1f')]();};}function respondWithResult(_0x45cbd3,_0x23005c){_0x23005c=_0x23005c||0xc8;return function(_0x137ff4){if(_0x137ff4){return _0x45cbd3[_0x52ed('0x1e')](_0x23005c)['json'](_0x137ff4);}};}function respondWithFilteredResult(_0x4225be,_0x3edab1){return function(_0x1effe1){if(_0x1effe1){var _0xa342fc=typeof _0x3edab1[_0x52ed('0x20')]===_0x52ed('0x21')&&typeof _0x3edab1['limit']===_0x52ed('0x21');var _0xf60818=_0x1effe1[_0x52ed('0x22')];var _0x2cf3c2=_0xa342fc?0x0:_0x3edab1[_0x52ed('0x20')];var _0x4e3a2f=_0xa342fc?_0x1effe1[_0x52ed('0x22')]:_0x3edab1[_0x52ed('0x20')]+_0x3edab1['limit'];var _0x23d927;if(_0x4e3a2f>=_0xf60818){_0x4e3a2f=_0xf60818;_0x23d927=0xc8;}else{_0x23d927=0xce;}_0x4225be[_0x52ed('0x1e')](_0x23d927);return _0x4225be[_0x52ed('0x23')]('Content-Range',_0x2cf3c2+'-'+_0x4e3a2f+'/'+_0xf60818)[_0x52ed('0x24')](_0x1effe1);}return null;};}function patchUpdates(_0x52483a){return function(_0x48c242){try{jsonpatch[_0x52ed('0x25')](_0x48c242,_0x52483a,!![]);}catch(_0x2bcc2e){return BPromise[_0x52ed('0x26')](_0x2bcc2e);}return _0x48c242[_0x52ed('0x27')]();};}function saveUpdates(_0x4c9e64,_0xd9e978){return function(_0x5a36e7){if(_0x5a36e7){return _0x5a36e7[_0x52ed('0x28')](_0x4c9e64)[_0x52ed('0x29')](function(_0x63238c){return _0x63238c;});}return null;};}function removeEntity(_0x14e300,_0x11837a){return function(_0x143e3e){if(_0x143e3e){return _0x143e3e[_0x52ed('0x2a')]()['then'](function(){_0x14e300[_0x52ed('0x1e')](0xcc)[_0x52ed('0x1f')]();});}};}function handleEntityNotFound(_0x2be16e,_0x59d050){return function(_0x5467d1){if(!_0x5467d1){_0x2be16e['sendStatus'](0x194);}return _0x5467d1;};}function handleError(_0x4ea1e0,_0x3478d0){_0x3478d0=_0x3478d0||0x1f4;return function(_0x421045){logger['error'](_0x421045[_0x52ed('0x2b')]);if(_0x421045['name']){delete _0x421045[_0x52ed('0x2c')];}_0x4ea1e0[_0x52ed('0x1e')](_0x3478d0)[_0x52ed('0x2d')](_0x421045);};}exports['index']=function(_0x26b5ae,_0x4810aa){var _0xbc4e2a={},_0xb9093c={},_0x1eab9e={'count':0x0,'rows':[]};var _0x2d158a=_[_0x52ed('0x2e')](db[_0x52ed('0x2f')][_0x52ed('0x30')],function(_0x9abb92){return{'name':_0x9abb92[_0x52ed('0x31')],'type':_0x9abb92[_0x52ed('0x32')][_0x52ed('0x33')]};});_0xb9093c['model']=_['map'](_0x2d158a,_0x52ed('0x2c'));_0xb9093c['query']=_[_0x52ed('0x34')](_0x26b5ae[_0x52ed('0x35')]);_0xb9093c[_0x52ed('0x36')]=_['intersection'](_0xb9093c[_0x52ed('0x37')],_0xb9093c[_0x52ed('0x35')]);_0xbc4e2a['attributes']=_[_0x52ed('0x38')](_0xb9093c[_0x52ed('0x37')],qs['fields'](_0x26b5ae[_0x52ed('0x35')][_0x52ed('0x39')]));_0xbc4e2a[_0x52ed('0x3a')]=_0xbc4e2a[_0x52ed('0x3a')][_0x52ed('0x3b')]?_0xbc4e2a['attributes']:_0xb9093c[_0x52ed('0x37')];if(!_0x26b5ae[_0x52ed('0x35')][_0x52ed('0x3c')]('nolimit')){_0xbc4e2a[_0x52ed('0x3d')]=qs[_0x52ed('0x3d')](_0x26b5ae[_0x52ed('0x35')]['limit']);_0xbc4e2a[_0x52ed('0x20')]=qs[_0x52ed('0x20')](_0x26b5ae[_0x52ed('0x35')][_0x52ed('0x20')]);}_0xbc4e2a['order']=qs['sort'](_0x26b5ae[_0x52ed('0x35')][_0x52ed('0x3e')]);_0xbc4e2a['where']=qs[_0x52ed('0x36')](_['pick'](_0x26b5ae[_0x52ed('0x35')],_0xb9093c[_0x52ed('0x36')]),_0x2d158a);if(_0x26b5ae[_0x52ed('0x35')][_0x52ed('0x3f')]){_0xbc4e2a['where']=_[_0x52ed('0x40')](_0xbc4e2a[_0x52ed('0x41')],{'$or':_[_0x52ed('0x2e')](_0x2d158a,function(_0x5a3f82){if(_0x5a3f82[_0x52ed('0x32')]!=='VIRTUAL'){var _0x1c492f={};_0x1c492f[_0x5a3f82[_0x52ed('0x2c')]]={'$like':'%'+_0x26b5ae[_0x52ed('0x35')]['filter']+'%'};return _0x1c492f;}})});}_0xbc4e2a=_[_0x52ed('0x40')]({},_0xbc4e2a,_0x26b5ae[_0x52ed('0x42')]);var _0x4a1beb={'where':_0xbc4e2a[_0x52ed('0x41')]};return db['ServicenowField'][_0x52ed('0x22')](_0x4a1beb)[_0x52ed('0x29')](function(_0x451d4e){_0x1eab9e[_0x52ed('0x22')]=_0x451d4e;if(_0x26b5ae[_0x52ed('0x35')]['includeAll']){_0xbc4e2a[_0x52ed('0x43')]=[{'all':!![]}];}return db[_0x52ed('0x2f')][_0x52ed('0x44')](_0xbc4e2a);})[_0x52ed('0x29')](function(_0x354773){_0x1eab9e['rows']=_0x354773;return _0x1eab9e;})[_0x52ed('0x29')](respondWithFilteredResult(_0x4810aa,_0xbc4e2a))[_0x52ed('0x45')](handleError(_0x4810aa,null));};exports[_0x52ed('0x46')]=function(_0x3aef9d,_0x58d4fb){var _0xebd67f={'raw':!![],'where':{'id':_0x3aef9d[_0x52ed('0x47')]['id']}},_0x54ae9f={};_0x54ae9f[_0x52ed('0x37')]=_[_0x52ed('0x34')](db[_0x52ed('0x2f')][_0x52ed('0x30')]);_0x54ae9f[_0x52ed('0x35')]=_[_0x52ed('0x34')](_0x3aef9d['query']);_0x54ae9f['filters']=_[_0x52ed('0x38')](_0x54ae9f[_0x52ed('0x37')],_0x54ae9f[_0x52ed('0x35')]);_0xebd67f['attributes']=_[_0x52ed('0x38')](_0x54ae9f[_0x52ed('0x37')],qs[_0x52ed('0x39')](_0x3aef9d[_0x52ed('0x35')][_0x52ed('0x39')]));_0xebd67f[_0x52ed('0x3a')]=_0xebd67f[_0x52ed('0x3a')][_0x52ed('0x3b')]?_0xebd67f[_0x52ed('0x3a')]:_0x54ae9f[_0x52ed('0x37')];if(_0x3aef9d[_0x52ed('0x35')][_0x52ed('0x48')]){_0xebd67f[_0x52ed('0x43')]=[{'all':!![]}];}_0xebd67f=_['merge']({},_0xebd67f,_0x3aef9d['options']);return db['ServicenowField'][_0x52ed('0x49')](_0xebd67f)[_0x52ed('0x29')](handleEntityNotFound(_0x58d4fb,null))[_0x52ed('0x29')](respondWithResult(_0x58d4fb,null))[_0x52ed('0x45')](handleError(_0x58d4fb,null));};exports[_0x52ed('0x4a')]=function(_0x4350ab,_0x4815cd){return db[_0x52ed('0x2f')][_0x52ed('0x4a')](_0x4350ab[_0x52ed('0x4b')],{})[_0x52ed('0x29')](respondWithResult(_0x4815cd,0xc9))[_0x52ed('0x45')](handleError(_0x4815cd,null));};exports[_0x52ed('0x28')]=function(_0x58d1c0,_0x4bbca4){if(_0x58d1c0[_0x52ed('0x4b')]['id']){delete _0x58d1c0[_0x52ed('0x4b')]['id'];}return db[_0x52ed('0x2f')]['find']({'where':{'id':_0x58d1c0['params']['id']}})['then'](handleEntityNotFound(_0x4bbca4,null))[_0x52ed('0x29')](saveUpdates(_0x58d1c0[_0x52ed('0x4b')],null))[_0x52ed('0x29')](respondWithResult(_0x4bbca4,null))['catch'](handleError(_0x4bbca4,null));};exports[_0x52ed('0x2a')]=function(_0x2bfd9c,_0x245838){return db[_0x52ed('0x2f')][_0x52ed('0x49')]({'where':{'id':_0x2bfd9c[_0x52ed('0x47')]['id']}})[_0x52ed('0x29')](handleEntityNotFound(_0x245838,null))[_0x52ed('0x29')](removeEntity(_0x245838,null))[_0x52ed('0x45')](handleError(_0x245838,null));};
\ No newline at end of file
index 2c20973..d7d6eb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1268=['moment','path','rimraf','../../config/environment','exports','ServicenowField','lodash','util','api'];(function(_0x27c476,_0x3b3117){var _0x5356fb=function(_0x3848e6){while(--_0x3848e6){_0x27c476['push'](_0x27c476['shift']());}};_0x5356fb(++_0x3b3117);}(_0x1268,0x16e));var _0x8126=function(_0x3cfbc5,_0x3bc846){_0x3cfbc5=_0x3cfbc5-0x0;var _0x12cfbe=_0x1268[_0x3cfbc5];return _0x12cfbe;};'use strict';var _=require(_0x8126('0x0'));var util=require(_0x8126('0x1'));var logger=require('../../config/logger')(_0x8126('0x2'));var moment=require(_0x8126('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8126('0x4'));var rimraf=require(_0x8126('0x5'));var config=require(_0x8126('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x8126('0x7')]=function(_0x4a44c4,_0x15472b){return _0x4a44c4['define'](_0x8126('0x8'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5763=['request-promise','rimraf','../../config/environment','define','int_servicenow_fields','idField','util','../../config/logger','moment'];(function(_0x17cb62,_0x448fc0){var _0x15ccff=function(_0x751e44){while(--_0x751e44){_0x17cb62['push'](_0x17cb62['shift']());}};_0x15ccff(++_0x448fc0);}(_0x5763,0x153));var _0x3576=function(_0x530065,_0x50adbf){_0x530065=_0x530065-0x0;var _0x15107c=_0x5763[_0x530065];return _0x15107c;};'use strict';var _=require('lodash');var util=require(_0x3576('0x0'));var logger=require(_0x3576('0x1'))('api');var moment=require(_0x3576('0x2'));var BPromise=require('bluebird');var rp=require(_0x3576('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3576('0x4'));var config=require(_0x3576('0x5'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x4ae586,_0x4a251f){return _0x4ae586[_0x3576('0x6')]('ServicenowField',attributes,{'tableName':_0x3576('0x7'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x3576('0x8'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index a255ff5..f94b5dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x497d84,_0x4fad8d){var _0x28b334=function(_0xf9fa69){while(--_0xf9fa69){_0x497d84['push'](_0x497d84['shift']());}};_0x28b334(++_0x4fad8d);}(_0xaa88,0x137));var _0x8aa8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xaa88[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}
\ No newline at end of file
+var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x3a4d09,_0x26acaf){var _0x209541=function(_0x4f5e11){while(--_0x4f5e11){_0x3a4d09['push'](_0x3a4d09['shift']());}};_0x209541(++_0x26acaf);}(_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')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
index 66dc8b1..11903c7 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(_0x5918e6,_0x534b4d){var _0x59d078=function(_0xb6489){while(--_0xb6489){_0x5918e6['push'](_0x5918e6['shift']());}};_0x59d078(++_0x534b4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x1498f6,_0x2ca18f){var _0x133c6d=function(_0x2d6155){while(--_0x2d6155){_0x1498f6['push'](_0x1498f6['shift']());}};_0x133c6d(++_0x2ca18f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 5fce475..e41647e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x523a89,_0x59590c){var _0x45133c=function(_0x54b974){while(--_0x54b974){_0x523a89['push'](_0x523a89['shift']());}};_0x45133c(++_0x59590c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x3da5ff,_0x437341){var _0x31e0a1=function(_0x5b8825){while(--_0x5b8825){_0x3da5ff['push'](_0x3da5ff['shift']());}};_0x31e0a1(++_0x437341);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 5468543..110067d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91ce=['SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','assigned_user_id','description','date_start','parent_type','parent_name','direction','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','values','module_fields','remove','includes','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','SugarcrmAccount','include','findAll','catch','show','params','includeAll','create','body','update','find','getConfigurations','findOne'];(function(_0x187a89,_0x3fc8b6){var _0x1249fa=function(_0x3a5502){while(--_0x3a5502){_0x187a89['push'](_0x187a89['shift']());}};_0x1249fa(++_0x3fc8b6);}(_0x91ce,0x9f));var _0xe91c=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x91ce[_0x550d12];return _0x12103d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe91c('0x0'));var zipdir=require(_0xe91c('0x1'));var jsonpatch=require(_0xe91c('0x2'));var rp=require(_0xe91c('0x3'));var moment=require('moment');var BPromise=require(_0xe91c('0x4'));var Mustache=require(_0xe91c('0x5'));var util=require(_0xe91c('0x6'));var path=require(_0xe91c('0x7'));var sox=require(_0xe91c('0x8'));var csv=require(_0xe91c('0x9'));var ejs=require(_0xe91c('0xa'));var fs=require('fs');var fs_extra=require(_0xe91c('0xb'));var _=require(_0xe91c('0xc'));var squel=require(_0xe91c('0xd'));var crypto=require(_0xe91c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe91c('0xf'));var toCsv=require(_0xe91c('0x9'));var querystring=require(_0xe91c('0x10'));var Papa=require(_0xe91c('0x11'));var Redis=require(_0xe91c('0x12'));var authService=require(_0xe91c('0x13'));var qs=require(_0xe91c('0x14'));var as=require(_0xe91c('0x15'));var hardwareService=require(_0xe91c('0x16'));var logger=require('../../config/logger')(_0xe91c('0x17'));var utils=require(_0xe91c('0x18'));var config=require(_0xe91c('0x19'));var licenseUtil=require(_0xe91c('0x1a'));var db=require(_0xe91c('0x1b'))['db'];var integrations=require(_0xe91c('0x1c'));function respondWithStatusCode(_0x4f6361,_0x5617c3){_0x5617c3=_0x5617c3||0xcc;return function(_0x514ac4){if(_0x514ac4){return _0x4f6361[_0xe91c('0x1d')](_0x5617c3);}return _0x4f6361[_0xe91c('0x1e')](_0x5617c3)[_0xe91c('0x1f')]();};}function respondWithResult(_0x5cae6d,_0x30f87e){_0x30f87e=_0x30f87e||0xc8;return function(_0x19eb68){if(_0x19eb68){return _0x5cae6d[_0xe91c('0x1e')](_0x30f87e)[_0xe91c('0x20')](_0x19eb68);}};}function respondWithFilteredResult(_0x49548c,_0x3650d9){return function(_0x24a4b1){if(_0x24a4b1){var _0x3e9b52=typeof _0x3650d9['offset']===_0xe91c('0x21')&&typeof _0x3650d9['limit']===_0xe91c('0x21');var _0x16c5fa=_0x24a4b1[_0xe91c('0x22')];var _0x1e5c39=_0x3e9b52?0x0:_0x3650d9[_0xe91c('0x23')];var _0x4c2a12=_0x3e9b52?_0x24a4b1[_0xe91c('0x22')]:_0x3650d9[_0xe91c('0x23')]+_0x3650d9[_0xe91c('0x24')];var _0x2eba45;if(_0x4c2a12>=_0x16c5fa){_0x4c2a12=_0x16c5fa;_0x2eba45=0xc8;}else{_0x2eba45=0xce;}_0x49548c[_0xe91c('0x1e')](_0x2eba45);return _0x49548c['set'](_0xe91c('0x25'),_0x1e5c39+'-'+_0x4c2a12+'/'+_0x16c5fa)[_0xe91c('0x20')](_0x24a4b1);}return null;};}function patchUpdates(_0x4bcca0){return function(_0x4c8aa7){try{jsonpatch[_0xe91c('0x26')](_0x4c8aa7,_0x4bcca0,!![]);}catch(_0x56b113){return BPromise[_0xe91c('0x27')](_0x56b113);}return _0x4c8aa7[_0xe91c('0x28')]();};}function saveUpdates(_0x2cc530,_0x46cc23){return function(_0x161776){if(_0x161776){return _0x161776['update'](_0x2cc530)['then'](function(_0x30cce3){return _0x30cce3;});}return null;};}function removeEntity(_0x58d2ac,_0x52f08d){return function(_0x413f5d){if(_0x413f5d){return _0x413f5d[_0xe91c('0x29')]()[_0xe91c('0x2a')](function(){_0x58d2ac['status'](0xcc)[_0xe91c('0x1f')]();});}};}function handleEntityNotFound(_0x511d78,_0x4fba15){return function(_0x37dd10){if(!_0x37dd10){_0x511d78[_0xe91c('0x1d')](0x194);}return _0x37dd10;};}function handleError(_0x2d4fe9,_0x49c45d){_0x49c45d=_0x49c45d||0x1f4;return function(_0x454ec7){logger[_0xe91c('0x2b')](_0x454ec7['stack']);if(_0x454ec7['name']){delete _0x454ec7[_0xe91c('0x2c')];}_0x2d4fe9[_0xe91c('0x1e')](_0x49c45d)[_0xe91c('0x2d')](_0x454ec7);};}exports[_0xe91c('0x2e')]=function(_0x1efc89,_0x439719){var _0x3c7d23={},_0x56fb00={},_0x4e9de7={'count':0x0,'rows':[]};var _0x5d1f78=_[_0xe91c('0x2f')](db['SugarcrmAccount'][_0xe91c('0x30')],function(_0x280f21){return{'name':_0x280f21['fieldName'],'type':_0x280f21[_0xe91c('0x31')][_0xe91c('0x32')]};});_0x56fb00[_0xe91c('0x33')]=_[_0xe91c('0x2f')](_0x5d1f78,_0xe91c('0x2c'));_0x56fb00[_0xe91c('0x34')]=_[_0xe91c('0x35')](_0x1efc89[_0xe91c('0x34')]);_0x56fb00['filters']=_[_0xe91c('0x36')](_0x56fb00[_0xe91c('0x33')],_0x56fb00['query']);_0x3c7d23[_0xe91c('0x37')]=_[_0xe91c('0x36')](_0x56fb00[_0xe91c('0x33')],qs[_0xe91c('0x38')](_0x1efc89['query'][_0xe91c('0x38')]));_0x3c7d23[_0xe91c('0x37')]=_0x3c7d23[_0xe91c('0x37')][_0xe91c('0x39')]?_0x3c7d23[_0xe91c('0x37')]:_0x56fb00[_0xe91c('0x33')];if(!_0x1efc89[_0xe91c('0x34')][_0xe91c('0x3a')](_0xe91c('0x3b'))){_0x3c7d23[_0xe91c('0x24')]=qs[_0xe91c('0x24')](_0x1efc89[_0xe91c('0x34')][_0xe91c('0x24')]);_0x3c7d23[_0xe91c('0x23')]=qs['offset'](_0x1efc89[_0xe91c('0x34')]['offset']);}_0x3c7d23[_0xe91c('0x3c')]=qs['sort'](_0x1efc89[_0xe91c('0x34')][_0xe91c('0x3d')]);_0x3c7d23[_0xe91c('0x3e')]=qs[_0xe91c('0x3f')](_[_0xe91c('0x40')](_0x1efc89[_0xe91c('0x34')],_0x56fb00[_0xe91c('0x3f')]),_0x5d1f78);if(_0x1efc89[_0xe91c('0x34')][_0xe91c('0x41')]){_0x3c7d23[_0xe91c('0x3e')]=_[_0xe91c('0x42')](_0x3c7d23[_0xe91c('0x3e')],{'$or':_['map'](_0x5d1f78,function(_0x558a12){if(_0x558a12[_0xe91c('0x31')]!=='VIRTUAL'){var _0xff7065={};_0xff7065[_0x558a12[_0xe91c('0x2c')]]={'$like':'%'+_0x1efc89[_0xe91c('0x34')][_0xe91c('0x41')]+'%'};return _0xff7065;}})});}_0x3c7d23=_['merge']({},_0x3c7d23,_0x1efc89[_0xe91c('0x43')]);var _0x7c563e={'where':_0x3c7d23[_0xe91c('0x3e')]};return db[_0xe91c('0x44')][_0xe91c('0x22')](_0x7c563e)[_0xe91c('0x2a')](function(_0x3e384a){_0x4e9de7[_0xe91c('0x22')]=_0x3e384a;if(_0x1efc89[_0xe91c('0x34')]['includeAll']){_0x3c7d23[_0xe91c('0x45')]=[{'all':!![]}];}return db[_0xe91c('0x44')][_0xe91c('0x46')](_0x3c7d23);})[_0xe91c('0x2a')](function(_0x3e3e0c){_0x4e9de7['rows']=_0x3e3e0c;return _0x4e9de7;})[_0xe91c('0x2a')](respondWithFilteredResult(_0x439719,_0x3c7d23))[_0xe91c('0x47')](handleError(_0x439719,null));};exports[_0xe91c('0x48')]=function(_0x5a6ced,_0x4f2354){var _0x115dbf={'raw':![],'where':{'id':_0x5a6ced[_0xe91c('0x49')]['id']}},_0x3e23bc={};_0x3e23bc['model']=_[_0xe91c('0x35')](db[_0xe91c('0x44')][_0xe91c('0x30')]);_0x3e23bc[_0xe91c('0x34')]=_[_0xe91c('0x35')](_0x5a6ced['query']);_0x3e23bc['filters']=_[_0xe91c('0x36')](_0x3e23bc[_0xe91c('0x33')],_0x3e23bc[_0xe91c('0x34')]);_0x115dbf[_0xe91c('0x37')]=_[_0xe91c('0x36')](_0x3e23bc[_0xe91c('0x33')],qs[_0xe91c('0x38')](_0x5a6ced[_0xe91c('0x34')]['fields']));_0x115dbf[_0xe91c('0x37')]=_0x115dbf['attributes']['length']?_0x115dbf['attributes']:_0x3e23bc[_0xe91c('0x33')];if(_0x5a6ced[_0xe91c('0x34')][_0xe91c('0x4a')]){_0x115dbf[_0xe91c('0x45')]=[{'all':!![]}];}_0x115dbf=_[_0xe91c('0x42')]({},_0x115dbf,_0x5a6ced[_0xe91c('0x43')]);return db[_0xe91c('0x44')]['find'](_0x115dbf)[_0xe91c('0x2a')](handleEntityNotFound(_0x4f2354,null))[_0xe91c('0x2a')](respondWithResult(_0x4f2354,null))[_0xe91c('0x47')](handleError(_0x4f2354,null));};exports[_0xe91c('0x4b')]=function(_0x29937d,_0x26cbd8){return db[_0xe91c('0x44')][_0xe91c('0x4b')](_0x29937d[_0xe91c('0x4c')],{})[_0xe91c('0x2a')](respondWithResult(_0x26cbd8,0xc9))[_0xe91c('0x47')](handleError(_0x26cbd8,null));};exports[_0xe91c('0x4d')]=function(_0x3fdc20,_0x5b606c){if(_0x3fdc20[_0xe91c('0x4c')]['id']){delete _0x3fdc20[_0xe91c('0x4c')]['id'];}return db[_0xe91c('0x44')][_0xe91c('0x4e')]({'where':{'id':_0x3fdc20[_0xe91c('0x49')]['id']}})[_0xe91c('0x2a')](handleEntityNotFound(_0x5b606c,null))['then'](saveUpdates(_0x3fdc20[_0xe91c('0x4c')],null))[_0xe91c('0x2a')](respondWithResult(_0x5b606c,null))['catch'](handleError(_0x5b606c,null));};exports[_0xe91c('0x29')]=function(_0x57e659,_0x167690){return db[_0xe91c('0x44')]['find']({'where':{'id':_0x57e659[_0xe91c('0x49')]['id']}})[_0xe91c('0x2a')](handleEntityNotFound(_0x167690,null))['then'](removeEntity(_0x167690,null))[_0xe91c('0x47')](handleError(_0x167690,null));};exports[_0xe91c('0x4f')]=function(_0xe8643a,_0x26299c,_0x5b45d1){var _0x559a44={};var _0x1690cf={};var _0xacfd40;var _0x268f7f;return db[_0xe91c('0x44')][_0xe91c('0x50')]({'where':{'id':_0xe8643a[_0xe91c('0x49')]['id']}})[_0xe91c('0x2a')](handleEntityNotFound(_0x26299c,null))[_0xe91c('0x2a')](function(_0x4c88c2){if(_0x4c88c2){_0xacfd40=_0x4c88c2;_0x1690cf['model']=_[_0xe91c('0x35')](db[_0xe91c('0x51')][_0xe91c('0x30')]);_0x1690cf[_0xe91c('0x34')]=_['keys'](_0xe8643a[_0xe91c('0x34')]);_0x1690cf[_0xe91c('0x3f')]=_['intersection'](_0x1690cf[_0xe91c('0x33')],_0x1690cf[_0xe91c('0x34')]);_0x559a44[_0xe91c('0x37')]=_[_0xe91c('0x36')](_0x1690cf['model'],qs[_0xe91c('0x38')](_0xe8643a['query'][_0xe91c('0x38')]));_0x559a44['attributes']=_0x559a44[_0xe91c('0x37')][_0xe91c('0x39')]?_0x559a44['attributes']:_0x1690cf['model'];_0x559a44[_0xe91c('0x3c')]=qs[_0xe91c('0x3d')](_0xe8643a[_0xe91c('0x34')][_0xe91c('0x3d')]);_0x559a44['where']=qs[_0xe91c('0x3f')](_[_0xe91c('0x40')](_0xe8643a[_0xe91c('0x34')],_0x1690cf['filters']));if(_0xe8643a[_0xe91c('0x34')][_0xe91c('0x41')]){_0x559a44[_0xe91c('0x3e')]=_[_0xe91c('0x42')](_0x559a44[_0xe91c('0x3e')],{'$or':_[_0xe91c('0x2f')](_0x559a44[_0xe91c('0x37')],function(_0x97bdd5){var _0x181ea5={};_0x181ea5[_0x97bdd5]={'$like':'%'+_0xe8643a[_0xe91c('0x34')][_0xe91c('0x41')]+'%'};return _0x181ea5;})});}_0x559a44=_[_0xe91c('0x42')]({},_0x559a44,_0xe8643a[_0xe91c('0x43')]);return _0xacfd40[_0xe91c('0x4f')](_0x559a44);}})[_0xe91c('0x2a')](function(_0xe896ab){if(_0xe896ab){_0x268f7f=_0xe896ab[_0xe91c('0x39')];if(!_0xe8643a[_0xe91c('0x34')]['hasOwnProperty'](_0xe91c('0x3b'))){_0x559a44['limit']=qs[_0xe91c('0x24')](_0xe8643a[_0xe91c('0x34')][_0xe91c('0x24')]);_0x559a44[_0xe91c('0x23')]=qs[_0xe91c('0x23')](_0xe8643a['query']['offset']);}return _0xacfd40[_0xe91c('0x4f')](_0x559a44);}})[_0xe91c('0x2a')](function(_0x46662d){if(_0x46662d){return _0x46662d?{'count':_0x268f7f,'rows':_0x46662d}:null;}})[_0xe91c('0x2a')](respondWithResult(_0x26299c,null))[_0xe91c('0x47')](handleError(_0x26299c,null));};exports[_0xe91c('0x52')]=function(_0x406d6a,_0x5222e0,_0x43851b){if(_0x406d6a[_0xe91c('0x4c')]['id']){delete _0x406d6a['body']['id'];}return db['SugarcrmAccount'][_0xe91c('0x50')]({'where':{'id':_0x406d6a[_0xe91c('0x49')]['id']}})[_0xe91c('0x2a')](handleEntityNotFound(_0x5222e0,null))[_0xe91c('0x2a')](function(_0xfd06dd){if(_0xfd06dd){_0x406d6a[_0xe91c('0x4c')][_0xe91c('0x53')]=_0xfd06dd['id'];_0x406d6a[_0xe91c('0x4c')][_0xe91c('0x54')]=integrations[_0xe91c('0x55')](_0x406d6a[_0xe91c('0x4c')][_0xe91c('0x56')],_0x406d6a[_0xe91c('0x4c')][_0xe91c('0x31')]);_0x406d6a['body'][_0xe91c('0x57')]=integrations['getDescriptions'](_0x406d6a[_0xe91c('0x4c')][_0xe91c('0x56')],_0x406d6a[_0xe91c('0x4c')][_0xe91c('0x31')]);return db['SugarcrmConfiguration'][_0xe91c('0x4b')](_0x406d6a[_0xe91c('0x4c')],{'include':[{'model':db[_0xe91c('0x58')],'as':_0xe91c('0x54')},{'model':db[_0xe91c('0x58')],'as':_0xe91c('0x57')}]});}return null;})[_0xe91c('0x2a')](respondWithResult(_0x5222e0,null))['catch'](handleError(_0x5222e0,null));};exports['getFields']=function(_0x4d1a14,_0x1928ef,_0x542ba1){var _0x1b98c5='';var _0x1addfa=['id',_0xe91c('0x2c'),_0xe91c('0x59'),'created_by',_0xe91c('0x5a'),_0xe91c('0x5b'),'duration_hours','duration_minutes','parent_id',_0xe91c('0x5c'),_0xe91c('0x5d'),_0xe91c('0x5e')];return db[_0xe91c('0x44')][_0xe91c('0x50')]({'where':{'id':_0x4d1a14['params']['id']},'attributes':['id','username',_0xe91c('0x5f'),_0xe91c('0x60')]})[_0xe91c('0x2a')](handleEntityNotFound(_0x1928ef,null))[_0xe91c('0x2a')](function(_0x243116){if(_0x243116){_0x1b98c5=_0x243116[_0xe91c('0x60')];var _0x3f2025=_0x1b98c5[_0xe91c('0x61')](-0x1);if(_0x3f2025==='/'){_0x1b98c5=_0x1b98c5['substring'](0x0,_0x1b98c5[_0xe91c('0x62')](_0x3f2025));}return rp({'method':_0xe91c('0x63'),'uri':util[_0xe91c('0x64')](_0xe91c('0x65'),_0x1b98c5,_0xe91c('0x66')),'json':!![],'form':{'method':_0xe91c('0x67'),'input_type':_0xe91c('0x68'),'response_type':_0xe91c('0x68'),'rest_data':JSON[_0xe91c('0x69')]({'user_auth':{'user_name':_0x243116['username'],'password':_0x243116['password'],'encryption':_0xe91c('0x6a')},'application':_0xe91c('0x6b')})}});}})[_0xe91c('0x2a')](function(_0x1f910c){if(_0x1f910c&&_0x1f910c[_0xe91c('0x2c')]!==_0xe91c('0x6c')&&_0x1f910c[_0xe91c('0x2c')]!==_0xe91c('0x6d')){return rp({'method':_0xe91c('0x63'),'uri':util[_0xe91c('0x64')](_0xe91c('0x65'),_0x1b98c5,_0xe91c('0x66')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xe91c('0x68'),'response_type':_0xe91c('0x68'),'rest_data':JSON[_0xe91c('0x69')]({'session':_0x1f910c['id'],'module_name':'Calls'})}})[_0xe91c('0x2a')](function(_0x4202b9){if(_0x4202b9){var _0x57a013=_[_0xe91c('0x6e')](_0x4202b9[_0xe91c('0x6f')]);_[_0xe91c('0x70')](_0x57a013,function(_0x575236){return _0x1addfa[_0xe91c('0x71')](_0x575236['name']);});return{'count':_0x57a013[_0xe91c('0x39')],'rows':_[_0xe91c('0x2f')](_0x57a013,function(_0x5d3a1f){return{'id':_0x5d3a1f[_0xe91c('0x2c')],'name':_0x5d3a1f[_0xe91c('0x72')],'custom':_['endsWith'](_0x5d3a1f['name'],'_c')?!![]:![],'options':_0x5d3a1f['options']?_[_0xe91c('0x2f')](_[_0xe91c('0x6e')](_0x5d3a1f[_0xe91c('0x43')]),function(_0x475a60){return{'name':_0x475a60['value'],'value':_0x475a60[_0xe91c('0x2c')]};}):[]};})};}})[_0xe91c('0x2a')](respondWithResult(_0x1928ef,null))[_0xe91c('0x47')](function(_0x448339){var _0x3b10f5=_0x4d1a14[_0xe91c('0x34')][_0xe91c('0x73')]?0x1f4:_0x448339[_0xe91c('0x74')]||0x1f4;logger[_0xe91c('0x2b')](_0xe91c('0x75'),_0xe91c('0x76'),_0x3b10f5,JSON[_0xe91c('0x69')](_0x448339));delete _0x448339[_0xe91c('0x2c')];if(_0x3b10f5===0x191){_0x3b10f5=0x190;}_0x1928ef[_0xe91c('0x1e')](_0x3b10f5)[_0xe91c('0x2d')](_0x4d1a14[_0xe91c('0x34')]['test']?{'message':_0xe91c('0x77'),'statusCode':_0x448339['statusCode']}:_0x448339);});}else{var _0x16c9d3=0x1f4;_0x1928ef[_0xe91c('0x1e')](_0x16c9d3)['send']({'message':_0xe91c('0x77'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xc9fe=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','SugarcrmAccount','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','catch','create','body','findOne','SugarcrmConfiguration','options','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','format','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','%s%s','/service/v4_1/rest.php','get_module_fields','Calls','module_fields','includes','label','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0xc9fe,0x1d6));var _0xec9f=function(_0x108bd1,_0x24f78f){_0x108bd1=_0x108bd1-0x0;var _0x3375c5=_0xc9fe[_0x108bd1];return _0x3375c5;};'use strict';var emlformat=require(_0xec9f('0x0'));var rimraf=require(_0xec9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xec9f('0x2'));var moment=require(_0xec9f('0x3'));var BPromise=require(_0xec9f('0x4'));var Mustache=require(_0xec9f('0x5'));var util=require(_0xec9f('0x6'));var path=require(_0xec9f('0x7'));var sox=require(_0xec9f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec9f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xec9f('0xa'));var jsforce=require(_0xec9f('0xb'));var deskjs=require(_0xec9f('0xc'));var toCsv=require(_0xec9f('0xd'));var querystring=require(_0xec9f('0xe'));var Papa=require(_0xec9f('0xf'));var Redis=require(_0xec9f('0x10'));var authService=require(_0xec9f('0x11'));var qs=require(_0xec9f('0x12'));var as=require(_0xec9f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec9f('0x14'))(_0xec9f('0x15'));var utils=require(_0xec9f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xec9f('0x17'));var db=require(_0xec9f('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xf7be1c,_0x5035e2){_0x5035e2=_0x5035e2||0xcc;return function(_0x14e8f2){if(_0x14e8f2){return _0xf7be1c[_0xec9f('0x19')](_0x5035e2);}return _0xf7be1c[_0xec9f('0x1a')](_0x5035e2)[_0xec9f('0x1b')]();};}function respondWithResult(_0x1dc199,_0x5e819f){_0x5e819f=_0x5e819f||0xc8;return function(_0x21080d){if(_0x21080d){return _0x1dc199[_0xec9f('0x1a')](_0x5e819f)[_0xec9f('0x1c')](_0x21080d);}};}function respondWithFilteredResult(_0xa82197,_0x31bf5c){return function(_0x52c79b){if(_0x52c79b){var _0x1c119c=typeof _0x31bf5c[_0xec9f('0x1d')]===_0xec9f('0x1e')&&typeof _0x31bf5c[_0xec9f('0x1f')]==='undefined';var _0x3fe356=_0x52c79b[_0xec9f('0x20')];var _0x109aa6=_0x1c119c?0x0:_0x31bf5c['offset'];var _0x48b5ea=_0x1c119c?_0x52c79b[_0xec9f('0x20')]:_0x31bf5c['offset']+_0x31bf5c[_0xec9f('0x1f')];var _0x4f5ce1;if(_0x48b5ea>=_0x3fe356){_0x48b5ea=_0x3fe356;_0x4f5ce1=0xc8;}else{_0x4f5ce1=0xce;}_0xa82197[_0xec9f('0x1a')](_0x4f5ce1);return _0xa82197[_0xec9f('0x21')](_0xec9f('0x22'),_0x109aa6+'-'+_0x48b5ea+'/'+_0x3fe356)[_0xec9f('0x1c')](_0x52c79b);}return null;};}function patchUpdates(_0x30eaea){return function(_0x1e9720){try{jsonpatch[_0xec9f('0x23')](_0x1e9720,_0x30eaea,!![]);}catch(_0x563cb2){return BPromise[_0xec9f('0x24')](_0x563cb2);}return _0x1e9720[_0xec9f('0x25')]();};}function saveUpdates(_0x4241bf,_0x4f7444){return function(_0x3dfa2d){if(_0x3dfa2d){return _0x3dfa2d[_0xec9f('0x26')](_0x4241bf)[_0xec9f('0x27')](function(_0x6c61ed){return _0x6c61ed;});}return null;};}function removeEntity(_0x4189eb,_0x2db47b){return function(_0x58012f){if(_0x58012f){return _0x58012f[_0xec9f('0x28')]()[_0xec9f('0x27')](function(){_0x4189eb[_0xec9f('0x1a')](0xcc)[_0xec9f('0x1b')]();});}};}function handleEntityNotFound(_0x2b8421,_0x1a6596){return function(_0x31ce47){if(!_0x31ce47){_0x2b8421[_0xec9f('0x19')](0x194);}return _0x31ce47;};}function handleError(_0x2da7b1,_0x37ea09){_0x37ea09=_0x37ea09||0x1f4;return function(_0x2a4540){logger[_0xec9f('0x29')](_0x2a4540[_0xec9f('0x2a')]);if(_0x2a4540[_0xec9f('0x2b')]){delete _0x2a4540['name'];}_0x2da7b1['status'](_0x37ea09)[_0xec9f('0x2c')](_0x2a4540);};}exports['index']=function(_0x116a95,_0xae254f){var _0x254dbd={},_0x72fa93={},_0x4d409f={'count':0x0,'rows':[]};var _0x49a574=_[_0xec9f('0x2d')](db['SugarcrmAccount']['rawAttributes'],function(_0x45a0b7){return{'name':_0x45a0b7[_0xec9f('0x2e')],'type':_0x45a0b7['type'][_0xec9f('0x2f')]};});_0x72fa93[_0xec9f('0x30')]=_[_0xec9f('0x2d')](_0x49a574,_0xec9f('0x2b'));_0x72fa93[_0xec9f('0x31')]=_[_0xec9f('0x32')](_0x116a95['query']);_0x72fa93[_0xec9f('0x33')]=_['intersection'](_0x72fa93[_0xec9f('0x30')],_0x72fa93[_0xec9f('0x31')]);_0x254dbd[_0xec9f('0x34')]=_['intersection'](_0x72fa93[_0xec9f('0x30')],qs[_0xec9f('0x35')](_0x116a95[_0xec9f('0x31')][_0xec9f('0x35')]));_0x254dbd[_0xec9f('0x34')]=_0x254dbd['attributes'][_0xec9f('0x36')]?_0x254dbd['attributes']:_0x72fa93['model'];if(!_0x116a95[_0xec9f('0x31')][_0xec9f('0x37')]('nolimit')){_0x254dbd[_0xec9f('0x1f')]=qs[_0xec9f('0x1f')](_0x116a95[_0xec9f('0x31')][_0xec9f('0x1f')]);_0x254dbd[_0xec9f('0x1d')]=qs['offset'](_0x116a95[_0xec9f('0x31')][_0xec9f('0x1d')]);}_0x254dbd['order']=qs[_0xec9f('0x38')](_0x116a95['query']['sort']);_0x254dbd[_0xec9f('0x39')]=qs[_0xec9f('0x33')](_[_0xec9f('0x3a')](_0x116a95[_0xec9f('0x31')],_0x72fa93[_0xec9f('0x33')]),_0x49a574);if(_0x116a95[_0xec9f('0x31')][_0xec9f('0x3b')]){_0x254dbd[_0xec9f('0x39')]=_[_0xec9f('0x3c')](_0x254dbd[_0xec9f('0x39')],{'$or':_[_0xec9f('0x2d')](_0x49a574,function(_0x44f67b){if(_0x44f67b[_0xec9f('0x3d')]!==_0xec9f('0x3e')){var _0x44ffb9={};_0x44ffb9[_0x44f67b[_0xec9f('0x2b')]]={'$like':'%'+_0x116a95[_0xec9f('0x31')][_0xec9f('0x3b')]+'%'};return _0x44ffb9;}})});}_0x254dbd=_['merge']({},_0x254dbd,_0x116a95['options']);var _0x3a3b91={'where':_0x254dbd['where']};return db[_0xec9f('0x3f')][_0xec9f('0x20')](_0x3a3b91)[_0xec9f('0x27')](function(_0x480087){_0x4d409f['count']=_0x480087;if(_0x116a95[_0xec9f('0x31')][_0xec9f('0x40')]){_0x254dbd[_0xec9f('0x41')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xec9f('0x42')](_0x254dbd);})[_0xec9f('0x27')](function(_0x470a4a){_0x4d409f[_0xec9f('0x43')]=_0x470a4a;return _0x4d409f;})[_0xec9f('0x27')](respondWithFilteredResult(_0xae254f,_0x254dbd))['catch'](handleError(_0xae254f,null));};exports[_0xec9f('0x44')]=function(_0x10f582,_0x598fb8){var _0x60f896={'raw':![],'where':{'id':_0x10f582[_0xec9f('0x45')]['id']}},_0x1e1be8={};_0x1e1be8[_0xec9f('0x30')]=_[_0xec9f('0x32')](db[_0xec9f('0x3f')][_0xec9f('0x46')]);_0x1e1be8[_0xec9f('0x31')]=_[_0xec9f('0x32')](_0x10f582['query']);_0x1e1be8['filters']=_[_0xec9f('0x47')](_0x1e1be8['model'],_0x1e1be8['query']);_0x60f896[_0xec9f('0x34')]=_[_0xec9f('0x47')](_0x1e1be8['model'],qs[_0xec9f('0x35')](_0x10f582[_0xec9f('0x31')]['fields']));_0x60f896[_0xec9f('0x34')]=_0x60f896['attributes'][_0xec9f('0x36')]?_0x60f896['attributes']:_0x1e1be8['model'];if(_0x10f582[_0xec9f('0x31')][_0xec9f('0x40')]){_0x60f896['include']=[{'all':!![]}];}_0x60f896=_[_0xec9f('0x3c')]({},_0x60f896,_0x10f582['options']);return db[_0xec9f('0x3f')]['find'](_0x60f896)['then'](handleEntityNotFound(_0x598fb8,null))[_0xec9f('0x27')](respondWithResult(_0x598fb8,null))[_0xec9f('0x48')](handleError(_0x598fb8,null));};exports[_0xec9f('0x49')]=function(_0x534370,_0x109556){return db[_0xec9f('0x3f')][_0xec9f('0x49')](_0x534370['body'],{})[_0xec9f('0x27')](respondWithResult(_0x109556,0xc9))[_0xec9f('0x48')](handleError(_0x109556,null));};exports[_0xec9f('0x26')]=function(_0x3c8900,_0x265094){if(_0x3c8900[_0xec9f('0x4a')]['id']){delete _0x3c8900[_0xec9f('0x4a')]['id'];}return db[_0xec9f('0x3f')]['find']({'where':{'id':_0x3c8900[_0xec9f('0x45')]['id']}})[_0xec9f('0x27')](handleEntityNotFound(_0x265094,null))[_0xec9f('0x27')](saveUpdates(_0x3c8900['body'],null))[_0xec9f('0x27')](respondWithResult(_0x265094,null))[_0xec9f('0x48')](handleError(_0x265094,null));};exports[_0xec9f('0x28')]=function(_0xa121dc,_0x208bc0){return db[_0xec9f('0x3f')]['find']({'where':{'id':_0xa121dc['params']['id']}})[_0xec9f('0x27')](handleEntityNotFound(_0x208bc0,null))[_0xec9f('0x27')](removeEntity(_0x208bc0,null))[_0xec9f('0x48')](handleError(_0x208bc0,null));};exports['getConfigurations']=function(_0x5d9bb0,_0x132657,_0x1c9053){var _0xe96e0b={};var _0x4b75ba={};var _0x124071;var _0x1b5d88;return db[_0xec9f('0x3f')][_0xec9f('0x4b')]({'where':{'id':_0x5d9bb0[_0xec9f('0x45')]['id']}})[_0xec9f('0x27')](handleEntityNotFound(_0x132657,null))[_0xec9f('0x27')](function(_0x465b83){if(_0x465b83){_0x124071=_0x465b83;_0x4b75ba['model']=_[_0xec9f('0x32')](db[_0xec9f('0x4c')][_0xec9f('0x46')]);_0x4b75ba[_0xec9f('0x31')]=_[_0xec9f('0x32')](_0x5d9bb0[_0xec9f('0x31')]);_0x4b75ba[_0xec9f('0x33')]=_[_0xec9f('0x47')](_0x4b75ba[_0xec9f('0x30')],_0x4b75ba[_0xec9f('0x31')]);_0xe96e0b['attributes']=_[_0xec9f('0x47')](_0x4b75ba[_0xec9f('0x30')],qs['fields'](_0x5d9bb0[_0xec9f('0x31')][_0xec9f('0x35')]));_0xe96e0b['attributes']=_0xe96e0b['attributes']['length']?_0xe96e0b['attributes']:_0x4b75ba[_0xec9f('0x30')];_0xe96e0b['order']=qs[_0xec9f('0x38')](_0x5d9bb0['query'][_0xec9f('0x38')]);_0xe96e0b['where']=qs['filters'](_[_0xec9f('0x3a')](_0x5d9bb0[_0xec9f('0x31')],_0x4b75ba[_0xec9f('0x33')]));if(_0x5d9bb0[_0xec9f('0x31')]['filter']){_0xe96e0b[_0xec9f('0x39')]=_[_0xec9f('0x3c')](_0xe96e0b[_0xec9f('0x39')],{'$or':_[_0xec9f('0x2d')](_0xe96e0b[_0xec9f('0x34')],function(_0x2e5b42){var _0x401c1f={};_0x401c1f[_0x2e5b42]={'$like':'%'+_0x5d9bb0[_0xec9f('0x31')][_0xec9f('0x3b')]+'%'};return _0x401c1f;})});}_0xe96e0b=_[_0xec9f('0x3c')]({},_0xe96e0b,_0x5d9bb0[_0xec9f('0x4d')]);return _0x124071[_0xec9f('0x4e')](_0xe96e0b);}})['then'](function(_0x5d873c){if(_0x5d873c){_0x1b5d88=_0x5d873c[_0xec9f('0x36')];if(!_0x5d9bb0[_0xec9f('0x31')][_0xec9f('0x37')](_0xec9f('0x4f'))){_0xe96e0b['limit']=qs['limit'](_0x5d9bb0[_0xec9f('0x31')][_0xec9f('0x1f')]);_0xe96e0b[_0xec9f('0x1d')]=qs[_0xec9f('0x1d')](_0x5d9bb0[_0xec9f('0x31')][_0xec9f('0x1d')]);}return _0x124071['getConfigurations'](_0xe96e0b);}})[_0xec9f('0x27')](function(_0x317512){if(_0x317512){return _0x317512?{'count':_0x1b5d88,'rows':_0x317512}:null;}})[_0xec9f('0x27')](respondWithResult(_0x132657,null))[_0xec9f('0x48')](handleError(_0x132657,null));};exports[_0xec9f('0x50')]=function(_0x9be448,_0x40d9c4,_0x328d05){if(_0x9be448[_0xec9f('0x4a')]['id']){delete _0x9be448['body']['id'];}return db[_0xec9f('0x3f')][_0xec9f('0x4b')]({'where':{'id':_0x9be448[_0xec9f('0x45')]['id']}})[_0xec9f('0x27')](handleEntityNotFound(_0x40d9c4,null))[_0xec9f('0x27')](function(_0x57f4ed){if(_0x57f4ed){_0x9be448['body'][_0xec9f('0x51')]=_0x57f4ed['id'];_0x9be448[_0xec9f('0x4a')][_0xec9f('0x52')]=integrations[_0xec9f('0x53')](_0x9be448['body'][_0xec9f('0x54')],_0x9be448[_0xec9f('0x4a')][_0xec9f('0x3d')]);_0x9be448['body'][_0xec9f('0x55')]=integrations[_0xec9f('0x56')](_0x9be448[_0xec9f('0x4a')][_0xec9f('0x54')],_0x9be448[_0xec9f('0x4a')][_0xec9f('0x3d')]);return db[_0xec9f('0x4c')][_0xec9f('0x49')](_0x9be448[_0xec9f('0x4a')],{'include':[{'model':db[_0xec9f('0x57')],'as':_0xec9f('0x52')},{'model':db[_0xec9f('0x57')],'as':_0xec9f('0x55')}]});}return null;})[_0xec9f('0x27')](respondWithResult(_0x40d9c4,null))[_0xec9f('0x48')](handleError(_0x40d9c4,null));};exports['getFields']=function(_0x57564a,_0x508eb8,_0xceb7f8){var _0x314405='';var _0x32f9cc=['id',_0xec9f('0x2b'),_0xec9f('0x58'),_0xec9f('0x59'),_0xec9f('0x5a'),_0xec9f('0x5b'),_0xec9f('0x5c'),'duration_minutes',_0xec9f('0x5d'),_0xec9f('0x5e'),_0xec9f('0x5f'),_0xec9f('0x60')];return db[_0xec9f('0x3f')][_0xec9f('0x4b')]({'where':{'id':_0x57564a['params']['id']},'attributes':['id',_0xec9f('0x61'),_0xec9f('0x62'),_0xec9f('0x63')]})['then'](handleEntityNotFound(_0x508eb8,null))['then'](function(_0x435b4c){if(_0x435b4c){_0x314405=_0x435b4c['remoteUri'];var _0x562e83=_0x314405[_0xec9f('0x64')](-0x1);if(_0x562e83==='/'){_0x314405=_0x314405[_0xec9f('0x65')](0x0,_0x314405['lastIndexOf'](_0x562e83));}return rp({'method':'POST','uri':util[_0xec9f('0x66')]('%s%s',_0x314405,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xec9f('0x67'),'input_type':_0xec9f('0x68'),'response_type':_0xec9f('0x68'),'rest_data':JSON[_0xec9f('0x69')]({'user_auth':{'user_name':_0x435b4c['username'],'password':_0x435b4c[_0xec9f('0x62')],'encryption':'PLAIN'},'application':_0xec9f('0x6a')})}});}})['then'](function(_0x5cf272){if(_0x5cf272&&_0x5cf272['name']!=='Invalid\x20Login'&&_0x5cf272[_0xec9f('0x2b')]!==_0xec9f('0x6b')){return rp({'method':_0xec9f('0x6c'),'uri':util[_0xec9f('0x66')](_0xec9f('0x6d'),_0x314405,_0xec9f('0x6e')),'json':!![],'form':{'method':_0xec9f('0x6f'),'input_type':_0xec9f('0x68'),'response_type':_0xec9f('0x68'),'rest_data':JSON[_0xec9f('0x69')]({'session':_0x5cf272['id'],'module_name':_0xec9f('0x70')})}})['then'](function(_0x56c3ac){if(_0x56c3ac){var _0x5d67ba=_['values'](_0x56c3ac[_0xec9f('0x71')]);_['remove'](_0x5d67ba,function(_0x1ae73d){return _0x32f9cc[_0xec9f('0x72')](_0x1ae73d[_0xec9f('0x2b')]);});return{'count':_0x5d67ba[_0xec9f('0x36')],'rows':_['map'](_0x5d67ba,function(_0x38b733){return{'id':_0x38b733[_0xec9f('0x2b')],'name':_0x38b733[_0xec9f('0x73')],'custom':_[_0xec9f('0x74')](_0x38b733[_0xec9f('0x2b')],'_c')?!![]:![],'options':_0x38b733['options']?_[_0xec9f('0x2d')](_[_0xec9f('0x75')](_0x38b733[_0xec9f('0x4d')]),function(_0x12a5c9){return{'name':_0x12a5c9[_0xec9f('0x76')],'value':_0x12a5c9[_0xec9f('0x2b')]};}):[]};})};}})['then'](respondWithResult(_0x508eb8,null))[_0xec9f('0x48')](function(_0x191721){var _0x51a449=_0x57564a[_0xec9f('0x31')][_0xec9f('0x77')]?0x1f4:_0x191721[_0xec9f('0x78')]||0x1f4;logger['error'](_0xec9f('0x79'),_0xec9f('0x7a'),_0x51a449,JSON['stringify'](_0x191721));delete _0x191721[_0xec9f('0x2b')];if(_0x51a449===0x191){_0x51a449=0x190;}_0x508eb8[_0xec9f('0x1a')](_0x51a449)['send'](_0x57564a[_0xec9f('0x31')][_0xec9f('0x77')]?{'message':_0xec9f('0x7b'),'statusCode':_0x191721['statusCode']}:_0x191721);});}else{var _0x24bbf0=0x1f4;_0x508eb8[_0xec9f('0x1a')](_0x24bbf0)[_0xec9f('0x2c')]({'message':_0xec9f('0x7b'),'statusCode':0x190});}});};
\ No newline at end of file
index d592e5f..c5ce3a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe495=['int_sugarcrm_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x587051,_0x49e278){var _0x9a295d=function(_0x38c41f){while(--_0x38c41f){_0x587051['push'](_0x587051['shift']());}};_0x9a295d(++_0x49e278);}(_0xe495,0xfe));var _0x5e49=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xe495[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x5e49('0x0'));var util=require('util');var logger=require(_0x5e49('0x1'))(_0x5e49('0x2'));var moment=require('moment');var BPromise=require(_0x5e49('0x3'));var rp=require(_0x5e49('0x4'));var fs=require('fs');var path=require(_0x5e49('0x5'));var rimraf=require('rimraf');var config=require(_0x5e49('0x6'));var attributes=require(_0x5e49('0x7'));var integrations=require(_0x5e49('0x8'));module[_0x5e49('0x9')]=function(_0x2e695a,_0xae637a){return _0x2e695a['define']('SugarcrmAccount',attributes,{'tableName':_0x5e49('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1856=['../../config/environment','./intSugarcrmAccount.attributes','define','SugarcrmAccount','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x372433,_0xb55d02){var _0x375ac3=function(_0x1c1d22){while(--_0x1c1d22){_0x372433['push'](_0x372433['shift']());}};_0x375ac3(++_0xb55d02);}(_0x1856,0x185));var _0x6185=function(_0x31402e,_0x24e105){_0x31402e=_0x31402e-0x0;var _0x3af516=_0x1856[_0x31402e];return _0x3af516;};'use strict';var _=require(_0x6185('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6185('0x1'));var moment=require(_0x6185('0x2'));var BPromise=require(_0x6185('0x3'));var rp=require(_0x6185('0x4'));var fs=require('fs');var path=require(_0x6185('0x5'));var rimraf=require(_0x6185('0x6'));var config=require(_0x6185('0x7'));var attributes=require(_0x6185('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3a0676,_0x1ff3e6){return _0x3a0676[_0x6185('0x9')](_0x6185('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 948d3ea..9c2602f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6868=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','limit','map','include','model','ShowSugarcrmAccount','find','attributes','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x5c66f0,_0x565f87){var _0x1802fa=function(_0x4e430b){while(--_0x4e430b){_0x5c66f0['push'](_0x5c66f0['shift']());}};_0x1802fa(++_0x565f87);}(_0x6868,0x136));var _0x8686=function(_0x5418bb,_0x82fc62){_0x5418bb=_0x5418bb-0x0;var _0x444615=_0x6868[_0x5418bb];return _0x444615;};'use strict';var _=require(_0x8686('0x0'));var util=require('util');var moment=require(_0x8686('0x1'));var BPromise=require(_0x8686('0x2'));var rs=require(_0x8686('0x3'));var fs=require('fs');var Redis=require(_0x8686('0x4'));var db=require(_0x8686('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8686('0x6'))(_0x8686('0x7'));var config=require('../../config/environment');var jayson=require(_0x8686('0x8'));var client=jayson[_0x8686('0x9')][_0x8686('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ecbea,_0x339d4a,_0x29ff4f){return new BPromise(function(_0x1bd0ed,_0x3ce943){return client[_0x8686('0xb')](_0x1ecbea,_0x29ff4f)[_0x8686('0xc')](function(_0x4aa8fa){logger[_0x8686('0xd')](_0x8686('0xe'),_0x339d4a,'request\x20sent');logger[_0x8686('0xf')](_0x8686('0x10'),_0x339d4a,_0x8686('0x11'),JSON[_0x8686('0x12')](_0x4aa8fa));if(_0x4aa8fa[_0x8686('0x13')]){if(_0x4aa8fa['error'][_0x8686('0x14')]===0x1f4){logger[_0x8686('0x13')](_0x8686('0xe'),_0x339d4a,_0x4aa8fa['error']['message']);return _0x3ce943(_0x4aa8fa[_0x8686('0x13')][_0x8686('0x15')]);}logger['error'](_0x8686('0xe'),_0x339d4a,_0x4aa8fa[_0x8686('0x13')][_0x8686('0x15')]);return _0x1bd0ed(_0x4aa8fa[_0x8686('0x13')]['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x339d4a,_0x8686('0x11'));_0x1bd0ed(_0x4aa8fa['result'][_0x8686('0x15')]);}})[_0x8686('0x16')](function(_0xc27787){logger[_0x8686('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x339d4a,_0xc27787);_0x3ce943(_0xc27787);});});}exports[_0x8686('0x17')]=function(_0x5cd275){var _0x431101=this;return new Promise(function(_0x2d2fb7,_0x320b55){return db[_0x8686('0x18')]['findAll']({'raw':_0x5cd275['options']?_0x5cd275[_0x8686('0x19')][_0x8686('0x1a')]===undefined?!![]:![]:!![],'where':_0x5cd275[_0x8686('0x19')]?_0x5cd275['options'][_0x8686('0x1b')]||null:null,'attributes':_0x5cd275[_0x8686('0x19')]?_0x5cd275[_0x8686('0x19')]['attributes']||null:null,'limit':_0x5cd275[_0x8686('0x19')]?_0x5cd275[_0x8686('0x19')][_0x8686('0x1c')]||null:null,'include':_0x5cd275[_0x8686('0x19')]?_0x5cd275['options']['include']?_[_0x8686('0x1d')](_0x5cd275[_0x8686('0x19')][_0x8686('0x1e')],function(_0x14678e){return{'model':db[_0x14678e[_0x8686('0x1f')]],'as':_0x14678e['as'],'attributes':_0x14678e['attributes'],'include':_0x14678e[_0x8686('0x1e')]?_[_0x8686('0x1d')](_0x14678e[_0x8686('0x1e')],function(_0x4c3715){return{'model':db[_0x4c3715[_0x8686('0x1f')]],'as':_0x4c3715['as'],'attributes':_0x4c3715['attributes'],'include':_0x4c3715['include']?_['map'](_0x4c3715[_0x8686('0x1e')],function(_0x75b3c4){return{'model':db[_0x75b3c4[_0x8686('0x1f')]],'as':_0x75b3c4['as'],'attributes':_0x75b3c4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ffd5c){logger[_0x8686('0xd')](_0x8686('0x17'),_0x5cd275);logger[_0x8686('0xf')](_0x8686('0x17'),_0x5cd275,JSON['stringify'](_0x2ffd5c));_0x2d2fb7(_0x2ffd5c);})[_0x8686('0x16')](function(_0x1bad65){logger['error'](_0x8686('0x17'),_0x1bad65[_0x8686('0x15')],_0x5cd275);_0x320b55(_0x431101['error'](0x1f4,_0x1bad65['message']));});});};exports[_0x8686('0x20')]=function(_0x530314){var _0x40eba7=this;return new Promise(function(_0x1afc3e,_0x2c3205){return db[_0x8686('0x18')][_0x8686('0x21')]({'raw':_0x530314[_0x8686('0x19')]?_0x530314[_0x8686('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x530314[_0x8686('0x19')]?_0x530314[_0x8686('0x19')][_0x8686('0x1b')]||null:null,'attributes':_0x530314['options']?_0x530314[_0x8686('0x19')][_0x8686('0x22')]||null:null,'include':_0x530314[_0x8686('0x19')]?_0x530314[_0x8686('0x19')]['include']?_[_0x8686('0x1d')](_0x530314[_0x8686('0x19')]['include'],function(_0x19718c){return{'model':db[_0x19718c[_0x8686('0x1f')]],'as':_0x19718c['as'],'attributes':_0x19718c[_0x8686('0x22')],'include':_0x19718c['include']?_[_0x8686('0x1d')](_0x19718c[_0x8686('0x1e')],function(_0x264adc){return{'model':db[_0x264adc['model']],'as':_0x264adc['as'],'attributes':_0x264adc[_0x8686('0x22')],'include':_0x264adc['include']?_[_0x8686('0x1d')](_0x264adc[_0x8686('0x1e')],function(_0x3f6f4c){return{'model':db[_0x3f6f4c[_0x8686('0x1f')]],'as':_0x3f6f4c['as'],'attributes':_0x3f6f4c['attributes']};}):[]};}):[]};}):[]:[]})[_0x8686('0xc')](function(_0x19a6bf){logger[_0x8686('0xd')](_0x8686('0x20'),_0x530314);logger[_0x8686('0xf')](_0x8686('0x20'),_0x530314,JSON[_0x8686('0x12')](_0x19a6bf));_0x1afc3e(_0x19a6bf);})[_0x8686('0x16')](function(_0x406f58){logger[_0x8686('0x13')]('ShowSugarcrmAccount',_0x406f58[_0x8686('0x15')],_0x530314);_0x2c3205(_0x40eba7['error'](0x1f4,_0x406f58['message']));});});};
\ No newline at end of file
+var _0xdbee=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','options','raw','where','attributes','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdbee,0xc5));var _0xedbe=function(_0x1dad08,_0x306709){_0x1dad08=_0x1dad08-0x0;var _0xab33f1=_0xdbee[_0x1dad08];return _0xab33f1;};'use strict';var _=require(_0xedbe('0x0'));var util=require(_0xedbe('0x1'));var moment=require(_0xedbe('0x2'));var BPromise=require(_0xedbe('0x3'));var rs=require(_0xedbe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedbe('0x5'))['db'];var utils=require(_0xedbe('0x6'));var logger=require(_0xedbe('0x7'))('rpc');var config=require(_0xedbe('0x8'));var jayson=require(_0xedbe('0x9'));var client=jayson[_0xedbe('0xa')][_0xedbe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42834a,_0x121d31,_0x2dde2b){return new BPromise(function(_0x40d781,_0x3490ff){return client[_0xedbe('0xc')](_0x42834a,_0x2dde2b)[_0xedbe('0xd')](function(_0x344991){logger[_0xedbe('0xe')](_0xedbe('0xf'),_0x121d31,_0xedbe('0x10'));logger[_0xedbe('0x11')](_0xedbe('0x12'),_0x121d31,_0xedbe('0x10'),JSON[_0xedbe('0x13')](_0x344991));if(_0x344991['error']){if(_0x344991['error']['code']===0x1f4){logger['error'](_0xedbe('0xf'),_0x121d31,_0x344991[_0xedbe('0x14')][_0xedbe('0x15')]);return _0x3490ff(_0x344991[_0xedbe('0x14')]['message']);}logger['error'](_0xedbe('0xf'),_0x121d31,_0x344991[_0xedbe('0x14')]['message']);return _0x40d781(_0x344991[_0xedbe('0x14')]['message']);}else{logger[_0xedbe('0xe')](_0xedbe('0xf'),_0x121d31,_0xedbe('0x10'));_0x40d781(_0x344991['result']['message']);}})[_0xedbe('0x16')](function(_0x377418){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x121d31,_0x377418);_0x3490ff(_0x377418);});});}exports['GetSugarcrmAccount']=function(_0x118d6a){var _0x55dd00=this;return new Promise(function(_0x542fc1,_0x12d5c3){return db['SugarcrmAccount']['findAll']({'raw':_0x118d6a['options']?_0x118d6a[_0xedbe('0x17')][_0xedbe('0x18')]===undefined?!![]:![]:!![],'where':_0x118d6a['options']?_0x118d6a['options'][_0xedbe('0x19')]||null:null,'attributes':_0x118d6a[_0xedbe('0x17')]?_0x118d6a['options'][_0xedbe('0x1a')]||null:null,'limit':_0x118d6a['options']?_0x118d6a[_0xedbe('0x17')]['limit']||null:null,'include':_0x118d6a[_0xedbe('0x17')]?_0x118d6a[_0xedbe('0x17')][_0xedbe('0x1b')]?_[_0xedbe('0x1c')](_0x118d6a[_0xedbe('0x17')][_0xedbe('0x1b')],function(_0x186ef3){return{'model':db[_0x186ef3['model']],'as':_0x186ef3['as'],'attributes':_0x186ef3[_0xedbe('0x1a')],'include':_0x186ef3[_0xedbe('0x1b')]?_['map'](_0x186ef3[_0xedbe('0x1b')],function(_0x5cfcbf){return{'model':db[_0x5cfcbf[_0xedbe('0x1d')]],'as':_0x5cfcbf['as'],'attributes':_0x5cfcbf[_0xedbe('0x1a')],'include':_0x5cfcbf[_0xedbe('0x1b')]?_[_0xedbe('0x1c')](_0x5cfcbf[_0xedbe('0x1b')],function(_0x5afe8c){return{'model':db[_0x5afe8c[_0xedbe('0x1d')]],'as':_0x5afe8c['as'],'attributes':_0x5afe8c['attributes']};}):[]};}):[]};}):[]:[]})[_0xedbe('0xd')](function(_0x4b3813){logger[_0xedbe('0xe')](_0xedbe('0x1e'),_0x118d6a);logger[_0xedbe('0x11')](_0xedbe('0x1e'),_0x118d6a,JSON['stringify'](_0x4b3813));_0x542fc1(_0x4b3813);})[_0xedbe('0x16')](function(_0x3b825f){logger[_0xedbe('0x14')]('GetSugarcrmAccount',_0x3b825f[_0xedbe('0x15')],_0x118d6a);_0x12d5c3(_0x55dd00[_0xedbe('0x14')](0x1f4,_0x3b825f[_0xedbe('0x15')]));});});};exports[_0xedbe('0x1f')]=function(_0x51a8e0){var _0xfc87dd=this;return new Promise(function(_0x5116ce,_0x3337a3){return db['SugarcrmAccount'][_0xedbe('0x20')]({'raw':_0x51a8e0['options']?_0x51a8e0['options'][_0xedbe('0x18')]===undefined?!![]:![]:!![],'where':_0x51a8e0[_0xedbe('0x17')]?_0x51a8e0[_0xedbe('0x17')]['where']||null:null,'attributes':_0x51a8e0[_0xedbe('0x17')]?_0x51a8e0[_0xedbe('0x17')][_0xedbe('0x1a')]||null:null,'include':_0x51a8e0['options']?_0x51a8e0[_0xedbe('0x17')][_0xedbe('0x1b')]?_[_0xedbe('0x1c')](_0x51a8e0[_0xedbe('0x17')][_0xedbe('0x1b')],function(_0x455ea7){return{'model':db[_0x455ea7['model']],'as':_0x455ea7['as'],'attributes':_0x455ea7[_0xedbe('0x1a')],'include':_0x455ea7[_0xedbe('0x1b')]?_[_0xedbe('0x1c')](_0x455ea7[_0xedbe('0x1b')],function(_0x373c91){return{'model':db[_0x373c91[_0xedbe('0x1d')]],'as':_0x373c91['as'],'attributes':_0x373c91[_0xedbe('0x1a')],'include':_0x373c91[_0xedbe('0x1b')]?_[_0xedbe('0x1c')](_0x373c91[_0xedbe('0x1b')],function(_0x55194e){return{'model':db[_0x55194e[_0xedbe('0x1d')]],'as':_0x55194e['as'],'attributes':_0x55194e[_0xedbe('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xedbe('0xd')](function(_0x142402){logger[_0xedbe('0xe')](_0xedbe('0x1f'),_0x51a8e0);logger[_0xedbe('0x11')](_0xedbe('0x1f'),_0x51a8e0,JSON[_0xedbe('0x13')](_0x142402));_0x5116ce(_0x142402);})['catch'](function(_0x59aa9f){logger[_0xedbe('0x14')]('ShowSugarcrmAccount',_0x59aa9f[_0xedbe('0x15')],_0x51a8e0);_0x3337a3(_0xfc87dd[_0xedbe('0x14')](0x1f4,_0x59aa9f['message']));});});};
\ No newline at end of file
index 26ab493..4b46200 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x438b=['destroy','util','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put'];(function(_0x2f7f6f,_0xc9e54d){var _0x52aca6=function(_0x1ec821){while(--_0x1ec821){_0x2f7f6f['push'](_0x2f7f6f['shift']());}};_0x52aca6(++_0xc9e54d);}(_0x438b,0x67));var _0xb438=function(_0x111ac0,_0xb80a1d){_0x111ac0=_0x111ac0-0x0;var _0x1c3ffd=_0x438b[_0x111ac0];return _0x1c3ffd;};'use strict';var multer=require('multer');var util=require(_0xb438('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb438('0x1')]();var fs_extra=require(_0xb438('0x2'));var auth=require(_0xb438('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb438('0x4'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xb438('0x5')]('/',auth[_0xb438('0x6')](),controller[_0xb438('0x7')]);router[_0xb438('0x5')](_0xb438('0x8'),auth[_0xb438('0x6')](),controller[_0xb438('0x9')]);router[_0xb438('0x5')]('/:id/fields',auth[_0xb438('0x6')](),controller['getFields']);router[_0xb438('0x5')](_0xb438('0xa'),auth[_0xb438('0x6')](),controller[_0xb438('0xb')]);router['get'](_0xb438('0xc'),auth['isAuthenticated'](),controller[_0xb438('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb438('0xe')]);router[_0xb438('0xf')](_0xb438('0x8'),auth[_0xb438('0x6')](),controller['update']);router['delete'](_0xb438('0x8'),auth[_0xb438('0x6')](),controller[_0xb438('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x72ca=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','/:id/subjects','post','create','put','destroy','multer'];(function(_0x5c0513,_0x37bcab){var _0x5343db=function(_0x480c10){while(--_0x480c10){_0x5c0513['push'](_0x5c0513['shift']());}};_0x5343db(++_0x37bcab);}(_0x72ca,0x10d));var _0xa72c=function(_0xe8bcf7,_0x28dffd){_0xe8bcf7=_0xe8bcf7-0x0;var _0x133af2=_0x72ca[_0xe8bcf7];return _0x133af2;};'use strict';var multer=require(_0xa72c('0x0'));var util=require(_0xa72c('0x1'));var path=require(_0xa72c('0x2'));var timeout=require('connect-timeout');var express=require(_0xa72c('0x3'));var router=express[_0xa72c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa72c('0x5'));var interaction=require(_0xa72c('0x6'));var config=require(_0xa72c('0x7'));var controller=require(_0xa72c('0x8'));router['get']('/',auth[_0xa72c('0x9')](),controller[_0xa72c('0xa')]);router[_0xa72c('0xb')](_0xa72c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa72c('0xb')]('/:id/fields',auth[_0xa72c('0x9')](),controller['getFields']);router[_0xa72c('0xb')](_0xa72c('0xd'),auth[_0xa72c('0x9')](),controller['getSubjects']);router[_0xa72c('0xb')]('/:id/descriptions',auth[_0xa72c('0x9')](),controller['getDescriptions']);router[_0xa72c('0xe')]('/',auth[_0xa72c('0x9')](),controller[_0xa72c('0xf')]);router[_0xa72c('0x10')](_0xa72c('0xc'),auth[_0xa72c('0x9')](),controller['update']);router['delete'](_0xa72c('0xc'),auth[_0xa72c('0x9')](),controller[_0xa72c('0x11')]);module['exports']=router;
\ No newline at end of file
index 981e871..fca0db3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa348=['sequelize','STRING'];(function(_0x4e201b,_0xcc1bf7){var _0x4f658b=function(_0xe8b14d){while(--_0xe8b14d){_0x4e201b['push'](_0x4e201b['shift']());}};_0x4f658b(++_0xcc1bf7);}(_0xa348,0x66));var _0x8a34=function(_0x558020,_0x1538b4){_0x558020=_0x558020-0x0;var _0x2da2f0=_0xa348[_0x558020];return _0x2da2f0;};'use strict';var Sequelize=require(_0x8a34('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a34('0x1')]},'description':{'type':Sequelize[_0x8a34('0x1')]}};
\ No newline at end of file
+var _0x6f18=['STRING','sequelize','exports'];(function(_0x33125d,_0x196a0c){var _0x47f52c=function(_0x3f159f){while(--_0x3f159f){_0x33125d['push'](_0x33125d['shift']());}};_0x47f52c(++_0x196a0c);}(_0x6f18,0x19f));var _0x86f1=function(_0x1e5ff1,_0x3e69db){_0x1e5ff1=_0x1e5ff1-0x0;var _0x1d35f7=_0x6f18[_0x1e5ff1];return _0x1d35f7;};'use strict';var Sequelize=require(_0x86f1('0x0'));module[_0x86f1('0x1')]={'name':{'type':Sequelize[_0x86f1('0x2')]},'description':{'type':Sequelize[_0x86f1('0x2')]}};
\ No newline at end of file
index 69848e8..c408f86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0e0=['mustache','path','sox','to-csv','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','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','length','include','find','catch','create','body','getFields','findOne','SugarcrmField','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf0e0,0x1c6));var _0x0f0e=function(_0x5801b3,_0x1986db){_0x5801b3=_0x5801b3-0x0;var _0x5015c4=_0xf0e0[_0x5801b3];return _0x5015c4;};'use strict';var emlformat=require(_0x0f0e('0x0'));var rimraf=require(_0x0f0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0f0e('0x2'));var util=require('util');var path=require(_0x0f0e('0x3'));var sox=require(_0x0f0e('0x4'));var csv=require(_0x0f0e('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f0e('0x6'));var squel=require(_0x0f0e('0x7'));var crypto=require(_0x0f0e('0x8'));var jsforce=require(_0x0f0e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0f0e('0x5'));var querystring=require(_0x0f0e('0xa'));var Papa=require('papaparse');var Redis=require(_0x0f0e('0xb'));var authService=require(_0x0f0e('0xc'));var qs=require(_0x0f0e('0xd'));var as=require(_0x0f0e('0xe'));var hardwareService=require(_0x0f0e('0xf'));var logger=require(_0x0f0e('0x10'))(_0x0f0e('0x11'));var utils=require(_0x0f0e('0x12'));var config=require(_0x0f0e('0x13'));var licenseUtil=require(_0x0f0e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x317505,_0x1ce90e){_0x1ce90e=_0x1ce90e||0xcc;return function(_0x956243){if(_0x956243){return _0x317505[_0x0f0e('0x15')](_0x1ce90e);}return _0x317505[_0x0f0e('0x16')](_0x1ce90e)['end']();};}function respondWithResult(_0x44267d,_0x5bc6fc){_0x5bc6fc=_0x5bc6fc||0xc8;return function(_0x4f33b3){if(_0x4f33b3){return _0x44267d[_0x0f0e('0x16')](_0x5bc6fc)[_0x0f0e('0x17')](_0x4f33b3);}};}function respondWithFilteredResult(_0x56d93a,_0x417143){return function(_0x360394){if(_0x360394){var _0x440ff9=typeof _0x417143[_0x0f0e('0x18')]===_0x0f0e('0x19')&&typeof _0x417143['limit']===_0x0f0e('0x19');var _0x13c72b=_0x360394[_0x0f0e('0x1a')];var _0x4232d6=_0x440ff9?0x0:_0x417143[_0x0f0e('0x18')];var _0x2d97b6=_0x440ff9?_0x360394[_0x0f0e('0x1a')]:_0x417143['offset']+_0x417143[_0x0f0e('0x1b')];var _0x51b0fb;if(_0x2d97b6>=_0x13c72b){_0x2d97b6=_0x13c72b;_0x51b0fb=0xc8;}else{_0x51b0fb=0xce;}_0x56d93a['status'](_0x51b0fb);return _0x56d93a['set'](_0x0f0e('0x1c'),_0x4232d6+'-'+_0x2d97b6+'/'+_0x13c72b)[_0x0f0e('0x17')](_0x360394);}return null;};}function patchUpdates(_0x40c2b2){return function(_0x34766f){try{jsonpatch[_0x0f0e('0x1d')](_0x34766f,_0x40c2b2,!![]);}catch(_0x220f24){return BPromise[_0x0f0e('0x1e')](_0x220f24);}return _0x34766f[_0x0f0e('0x1f')]();};}function saveUpdates(_0x4f98fe,_0x4a91e7){return function(_0x17ff7d){if(_0x17ff7d){return _0x17ff7d[_0x0f0e('0x20')](_0x4f98fe)[_0x0f0e('0x21')](function(_0xc3bd83){return _0xc3bd83;});}return null;};}function removeEntity(_0x57119f,_0x21cab2){return function(_0x44aa92){if(_0x44aa92){return _0x44aa92[_0x0f0e('0x22')]()[_0x0f0e('0x21')](function(){_0x57119f[_0x0f0e('0x16')](0xcc)[_0x0f0e('0x23')]();});}};}function handleEntityNotFound(_0x67dbd,_0x31f181){return function(_0x183a6b){if(!_0x183a6b){_0x67dbd[_0x0f0e('0x15')](0x194);}return _0x183a6b;};}function handleError(_0x5f1cdb,_0x17b3d0){_0x17b3d0=_0x17b3d0||0x1f4;return function(_0x38fd5a){logger[_0x0f0e('0x24')](_0x38fd5a['stack']);if(_0x38fd5a[_0x0f0e('0x25')]){delete _0x38fd5a[_0x0f0e('0x25')];}_0x5f1cdb['status'](_0x17b3d0)[_0x0f0e('0x26')](_0x38fd5a);};}exports['index']=function(_0x4fc701,_0x2ed061){var _0xe0fd60={},_0x44f06e={},_0x4c74cc={'count':0x0,'rows':[]};var _0x5ca72c=_[_0x0f0e('0x27')](db[_0x0f0e('0x28')][_0x0f0e('0x29')],function(_0x500960){return{'name':_0x500960[_0x0f0e('0x2a')],'type':_0x500960[_0x0f0e('0x2b')]['key']};});_0x44f06e[_0x0f0e('0x2c')]=_[_0x0f0e('0x27')](_0x5ca72c,_0x0f0e('0x25'));_0x44f06e[_0x0f0e('0x2d')]=_[_0x0f0e('0x2e')](_0x4fc701['query']);_0x44f06e[_0x0f0e('0x2f')]=_[_0x0f0e('0x30')](_0x44f06e['model'],_0x44f06e['query']);_0xe0fd60[_0x0f0e('0x31')]=_['intersection'](_0x44f06e[_0x0f0e('0x2c')],qs[_0x0f0e('0x32')](_0x4fc701[_0x0f0e('0x2d')][_0x0f0e('0x32')]));_0xe0fd60['attributes']=_0xe0fd60[_0x0f0e('0x31')]['length']?_0xe0fd60[_0x0f0e('0x31')]:_0x44f06e['model'];if(!_0x4fc701['query']['hasOwnProperty']('nolimit')){_0xe0fd60['limit']=qs[_0x0f0e('0x1b')](_0x4fc701['query'][_0x0f0e('0x1b')]);_0xe0fd60[_0x0f0e('0x18')]=qs[_0x0f0e('0x18')](_0x4fc701['query'][_0x0f0e('0x18')]);}_0xe0fd60[_0x0f0e('0x33')]=qs['sort'](_0x4fc701[_0x0f0e('0x2d')][_0x0f0e('0x34')]);_0xe0fd60[_0x0f0e('0x35')]=qs[_0x0f0e('0x2f')](_[_0x0f0e('0x36')](_0x4fc701[_0x0f0e('0x2d')],_0x44f06e[_0x0f0e('0x2f')]),_0x5ca72c);if(_0x4fc701[_0x0f0e('0x2d')][_0x0f0e('0x37')]){_0xe0fd60['where']=_[_0x0f0e('0x38')](_0xe0fd60[_0x0f0e('0x35')],{'$or':_[_0x0f0e('0x27')](_0x5ca72c,function(_0x2586d7){if(_0x2586d7[_0x0f0e('0x2b')]!==_0x0f0e('0x39')){var _0x1e508f={};_0x1e508f[_0x2586d7['name']]={'$like':'%'+_0x4fc701[_0x0f0e('0x2d')][_0x0f0e('0x37')]+'%'};return _0x1e508f;}})});}_0xe0fd60=_['merge']({},_0xe0fd60,_0x4fc701[_0x0f0e('0x3a')]);var _0x307551={'where':_0xe0fd60[_0x0f0e('0x35')]};return db['SugarcrmConfiguration'][_0x0f0e('0x1a')](_0x307551)[_0x0f0e('0x21')](function(_0x3c460a){_0x4c74cc[_0x0f0e('0x1a')]=_0x3c460a;if(_0x4fc701[_0x0f0e('0x2d')][_0x0f0e('0x3b')]){_0xe0fd60['include']=[{'all':!![]}];}return db[_0x0f0e('0x28')][_0x0f0e('0x3c')](_0xe0fd60);})[_0x0f0e('0x21')](function(_0x2a6592){_0x4c74cc['rows']=_0x2a6592;return _0x4c74cc;})[_0x0f0e('0x21')](respondWithFilteredResult(_0x2ed061,_0xe0fd60))['catch'](handleError(_0x2ed061,null));};exports[_0x0f0e('0x3d')]=function(_0x22e443,_0x4eee97){var _0x409025={'raw':![],'where':{'id':_0x22e443[_0x0f0e('0x3e')]['id']}},_0x4bbf6f={};_0x4bbf6f[_0x0f0e('0x2c')]=_[_0x0f0e('0x2e')](db['SugarcrmConfiguration'][_0x0f0e('0x29')]);_0x4bbf6f[_0x0f0e('0x2d')]=_[_0x0f0e('0x2e')](_0x22e443[_0x0f0e('0x2d')]);_0x4bbf6f[_0x0f0e('0x2f')]=_[_0x0f0e('0x30')](_0x4bbf6f[_0x0f0e('0x2c')],_0x4bbf6f[_0x0f0e('0x2d')]);_0x409025[_0x0f0e('0x31')]=_[_0x0f0e('0x30')](_0x4bbf6f[_0x0f0e('0x2c')],qs[_0x0f0e('0x32')](_0x22e443['query'][_0x0f0e('0x32')]));_0x409025[_0x0f0e('0x31')]=_0x409025['attributes'][_0x0f0e('0x3f')]?_0x409025[_0x0f0e('0x31')]:_0x4bbf6f[_0x0f0e('0x2c')];if(_0x22e443['query'][_0x0f0e('0x3b')]){_0x409025[_0x0f0e('0x40')]=[{'all':!![]}];}_0x409025=_['merge']({},_0x409025,_0x22e443[_0x0f0e('0x3a')]);return db[_0x0f0e('0x28')][_0x0f0e('0x41')](_0x409025)[_0x0f0e('0x21')](handleEntityNotFound(_0x4eee97,null))['then'](respondWithResult(_0x4eee97,null))[_0x0f0e('0x42')](handleError(_0x4eee97,null));};exports['create']=function(_0x43f8b9,_0x5070a9){return db[_0x0f0e('0x28')][_0x0f0e('0x43')](_0x43f8b9[_0x0f0e('0x44')],{})['then'](respondWithResult(_0x5070a9,0xc9))['catch'](handleError(_0x5070a9,null));};exports['update']=function(_0x1109df,_0x5de527){if(_0x1109df[_0x0f0e('0x44')]['id']){delete _0x1109df[_0x0f0e('0x44')]['id'];}return db[_0x0f0e('0x28')]['find']({'where':{'id':_0x1109df[_0x0f0e('0x3e')]['id']}})[_0x0f0e('0x21')](handleEntityNotFound(_0x5de527,null))['then'](saveUpdates(_0x1109df[_0x0f0e('0x44')],null))[_0x0f0e('0x21')](respondWithResult(_0x5de527,null))[_0x0f0e('0x42')](handleError(_0x5de527,null));};exports[_0x0f0e('0x22')]=function(_0x4b5e2e,_0x17ac9c){return db[_0x0f0e('0x28')]['find']({'where':{'id':_0x4b5e2e[_0x0f0e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x17ac9c,null))['then'](removeEntity(_0x17ac9c,null))[_0x0f0e('0x42')](handleError(_0x17ac9c,null));};exports[_0x0f0e('0x45')]=function(_0x101538,_0x4e0837,_0x2da728){var _0x5cc647={};var _0x53af4a={};var _0x4938ec;var _0x15fffb;return db['SugarcrmConfiguration'][_0x0f0e('0x46')]({'where':{'id':_0x101538[_0x0f0e('0x3e')]['id']}})[_0x0f0e('0x21')](handleEntityNotFound(_0x4e0837,null))['then'](function(_0x58751e){if(_0x58751e){_0x4938ec=_0x58751e;_0x53af4a['model']=_[_0x0f0e('0x2e')](db[_0x0f0e('0x47')][_0x0f0e('0x29')]);_0x53af4a[_0x0f0e('0x2d')]=_[_0x0f0e('0x2e')](_0x101538[_0x0f0e('0x2d')]);_0x53af4a[_0x0f0e('0x2f')]=_[_0x0f0e('0x30')](_0x53af4a[_0x0f0e('0x2c')],_0x53af4a[_0x0f0e('0x2d')]);_0x5cc647[_0x0f0e('0x31')]=_[_0x0f0e('0x30')](_0x53af4a['model'],qs['fields'](_0x101538[_0x0f0e('0x2d')][_0x0f0e('0x32')]));_0x5cc647[_0x0f0e('0x31')]=_0x5cc647[_0x0f0e('0x31')][_0x0f0e('0x3f')]?_0x5cc647[_0x0f0e('0x31')]:_0x53af4a['model'];_0x5cc647['order']=qs[_0x0f0e('0x34')](_0x101538[_0x0f0e('0x2d')][_0x0f0e('0x34')]);_0x5cc647[_0x0f0e('0x35')]=qs[_0x0f0e('0x2f')](_[_0x0f0e('0x36')](_0x101538[_0x0f0e('0x2d')],_0x53af4a[_0x0f0e('0x2f')]));if(_0x101538[_0x0f0e('0x2d')]['filter']){_0x5cc647[_0x0f0e('0x35')]=_[_0x0f0e('0x38')](_0x5cc647['where'],{'$or':_[_0x0f0e('0x27')](_0x5cc647[_0x0f0e('0x31')],function(_0x2c55ed){var _0x25466f={};_0x25466f[_0x2c55ed]={'$like':'%'+_0x101538[_0x0f0e('0x2d')]['filter']+'%'};return _0x25466f;})});}_0x5cc647=_[_0x0f0e('0x38')]({},_0x5cc647,_0x101538[_0x0f0e('0x3a')]);return _0x4938ec[_0x0f0e('0x45')](_0x5cc647);}})[_0x0f0e('0x21')](function(_0x2f0357){if(_0x2f0357){_0x15fffb=_0x2f0357['length'];if(!_0x101538[_0x0f0e('0x2d')][_0x0f0e('0x48')](_0x0f0e('0x49'))){_0x5cc647[_0x0f0e('0x1b')]=qs['limit'](_0x101538[_0x0f0e('0x2d')][_0x0f0e('0x1b')]);_0x5cc647[_0x0f0e('0x18')]=qs[_0x0f0e('0x18')](_0x101538[_0x0f0e('0x2d')][_0x0f0e('0x18')]);}return _0x4938ec[_0x0f0e('0x45')](_0x5cc647);}})[_0x0f0e('0x21')](function(_0x1a0125){if(_0x1a0125){return _0x1a0125?{'count':_0x15fffb,'rows':_0x1a0125}:null;}})[_0x0f0e('0x21')](respondWithResult(_0x4e0837,null))[_0x0f0e('0x42')](handleError(_0x4e0837,null));};exports[_0x0f0e('0x4a')]=function(_0x55633b,_0x4fee56,_0x4da646){var _0x7f5c27={};var _0x5e75ef={};var _0x53dd24;var _0x879cf3;return db[_0x0f0e('0x28')][_0x0f0e('0x46')]({'where':{'id':_0x55633b[_0x0f0e('0x3e')]['id']}})[_0x0f0e('0x21')](handleEntityNotFound(_0x4fee56,null))[_0x0f0e('0x21')](function(_0x53dfbd){if(_0x53dfbd){_0x53dd24=_0x53dfbd;_0x5e75ef[_0x0f0e('0x2c')]=_[_0x0f0e('0x2e')](db[_0x0f0e('0x47')][_0x0f0e('0x29')]);_0x5e75ef[_0x0f0e('0x2d')]=_[_0x0f0e('0x2e')](_0x55633b[_0x0f0e('0x2d')]);_0x5e75ef['filters']=_['intersection'](_0x5e75ef[_0x0f0e('0x2c')],_0x5e75ef[_0x0f0e('0x2d')]);_0x7f5c27['attributes']=_[_0x0f0e('0x30')](_0x5e75ef[_0x0f0e('0x2c')],qs[_0x0f0e('0x32')](_0x55633b[_0x0f0e('0x2d')][_0x0f0e('0x32')]));_0x7f5c27[_0x0f0e('0x31')]=_0x7f5c27[_0x0f0e('0x31')]['length']?_0x7f5c27[_0x0f0e('0x31')]:_0x5e75ef[_0x0f0e('0x2c')];_0x7f5c27['order']=qs[_0x0f0e('0x34')](_0x55633b[_0x0f0e('0x2d')][_0x0f0e('0x34')]);_0x7f5c27[_0x0f0e('0x35')]=qs[_0x0f0e('0x2f')](_[_0x0f0e('0x36')](_0x55633b['query'],_0x5e75ef['filters']));if(_0x55633b['query'][_0x0f0e('0x37')]){_0x7f5c27['where']=_['merge'](_0x7f5c27[_0x0f0e('0x35')],{'$or':_[_0x0f0e('0x27')](_0x7f5c27[_0x0f0e('0x31')],function(_0x4985f7){var _0x3243f4={};_0x3243f4[_0x4985f7]={'$like':'%'+_0x55633b[_0x0f0e('0x2d')]['filter']+'%'};return _0x3243f4;})});}_0x7f5c27=_[_0x0f0e('0x38')]({},_0x7f5c27,_0x55633b[_0x0f0e('0x3a')]);return _0x53dd24[_0x0f0e('0x4a')](_0x7f5c27);}})[_0x0f0e('0x21')](function(_0x1b05d8){if(_0x1b05d8){_0x879cf3=_0x1b05d8['length'];if(!_0x55633b['query'][_0x0f0e('0x48')](_0x0f0e('0x49'))){_0x7f5c27[_0x0f0e('0x1b')]=qs[_0x0f0e('0x1b')](_0x55633b['query'][_0x0f0e('0x1b')]);_0x7f5c27[_0x0f0e('0x18')]=qs[_0x0f0e('0x18')](_0x55633b[_0x0f0e('0x2d')]['offset']);}return _0x53dd24[_0x0f0e('0x4a')](_0x7f5c27);}})['then'](function(_0xb4cd82){if(_0xb4cd82){return _0xb4cd82?{'count':_0x879cf3,'rows':_0xb4cd82}:null;}})[_0x0f0e('0x21')](respondWithResult(_0x4fee56,null))['catch'](handleError(_0x4fee56,null));};exports[_0x0f0e('0x4b')]=function(_0xdfe88c,_0x5046b2,_0x4bcd25){var _0x1fb028={};var _0x2d001a={};var _0x14775a;var _0x39d91d;return db[_0x0f0e('0x28')][_0x0f0e('0x46')]({'where':{'id':_0xdfe88c[_0x0f0e('0x3e')]['id']}})[_0x0f0e('0x21')](handleEntityNotFound(_0x5046b2,null))[_0x0f0e('0x21')](function(_0x337799){if(_0x337799){_0x14775a=_0x337799;_0x2d001a[_0x0f0e('0x2c')]=_[_0x0f0e('0x2e')](db[_0x0f0e('0x47')][_0x0f0e('0x29')]);_0x2d001a[_0x0f0e('0x2d')]=_[_0x0f0e('0x2e')](_0xdfe88c[_0x0f0e('0x2d')]);_0x2d001a[_0x0f0e('0x2f')]=_[_0x0f0e('0x30')](_0x2d001a[_0x0f0e('0x2c')],_0x2d001a[_0x0f0e('0x2d')]);_0x1fb028[_0x0f0e('0x31')]=_['intersection'](_0x2d001a[_0x0f0e('0x2c')],qs['fields'](_0xdfe88c[_0x0f0e('0x2d')][_0x0f0e('0x32')]));_0x1fb028[_0x0f0e('0x31')]=_0x1fb028['attributes'][_0x0f0e('0x3f')]?_0x1fb028['attributes']:_0x2d001a['model'];_0x1fb028['order']=qs[_0x0f0e('0x34')](_0xdfe88c[_0x0f0e('0x2d')][_0x0f0e('0x34')]);_0x1fb028[_0x0f0e('0x35')]=qs['filters'](_[_0x0f0e('0x36')](_0xdfe88c['query'],_0x2d001a['filters']));if(_0xdfe88c[_0x0f0e('0x2d')][_0x0f0e('0x37')]){_0x1fb028[_0x0f0e('0x35')]=_['merge'](_0x1fb028[_0x0f0e('0x35')],{'$or':_[_0x0f0e('0x27')](_0x1fb028[_0x0f0e('0x31')],function(_0x1ebf86){var _0x17e900={};_0x17e900[_0x1ebf86]={'$like':'%'+_0xdfe88c['query'][_0x0f0e('0x37')]+'%'};return _0x17e900;})});}_0x1fb028=_[_0x0f0e('0x38')]({},_0x1fb028,_0xdfe88c[_0x0f0e('0x3a')]);return _0x14775a['getDescriptions'](_0x1fb028);}})[_0x0f0e('0x21')](function(_0x275e1f){if(_0x275e1f){_0x39d91d=_0x275e1f[_0x0f0e('0x3f')];if(!_0xdfe88c['query']['hasOwnProperty'](_0x0f0e('0x49'))){_0x1fb028[_0x0f0e('0x1b')]=qs[_0x0f0e('0x1b')](_0xdfe88c[_0x0f0e('0x2d')][_0x0f0e('0x1b')]);_0x1fb028['offset']=qs[_0x0f0e('0x18')](_0xdfe88c[_0x0f0e('0x2d')][_0x0f0e('0x18')]);}return _0x14775a['getDescriptions'](_0x1fb028);}})[_0x0f0e('0x21')](function(_0xe92d54){if(_0xe92d54){return _0xe92d54?{'count':_0x39d91d,'rows':_0xe92d54}:null;}})[_0x0f0e('0x21')](respondWithResult(_0x5046b2,null))['catch'](handleError(_0x5046b2,null));};
\ No newline at end of file
+var _0x3c27=['show','params','rawAttributes','include','find','create','body','getFields','findOne','SugarcrmField','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','rows','catch'];(function(_0x456551,_0x4c9050){var _0x1af692=function(_0x2dabdd){while(--_0x2dabdd){_0x456551['push'](_0x456551['shift']());}};_0x1af692(++_0x4c9050);}(_0x3c27,0x1ac));var _0x73c2=function(_0x21f70b,_0x47501e){_0x21f70b=_0x21f70b-0x0;var _0x153b64=_0x3c27[_0x21f70b];return _0x153b64;};'use strict';var emlformat=require(_0x73c2('0x0'));var rimraf=require(_0x73c2('0x1'));var zipdir=require(_0x73c2('0x2'));var jsonpatch=require(_0x73c2('0x3'));var rp=require(_0x73c2('0x4'));var moment=require(_0x73c2('0x5'));var BPromise=require(_0x73c2('0x6'));var Mustache=require(_0x73c2('0x7'));var util=require('util');var path=require(_0x73c2('0x8'));var sox=require(_0x73c2('0x9'));var csv=require(_0x73c2('0xa'));var ejs=require(_0x73c2('0xb'));var fs=require('fs');var fs_extra=require(_0x73c2('0xc'));var _=require(_0x73c2('0xd'));var squel=require(_0x73c2('0xe'));var crypto=require(_0x73c2('0xf'));var jsforce=require(_0x73c2('0x10'));var deskjs=require(_0x73c2('0x11'));var toCsv=require(_0x73c2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x73c2('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x73c2('0x13'));var hardwareService=require(_0x73c2('0x14'));var logger=require(_0x73c2('0x15'))('api');var utils=require(_0x73c2('0x16'));var config=require(_0x73c2('0x17'));var licenseUtil=require(_0x73c2('0x18'));var db=require(_0x73c2('0x19'))['db'];function respondWithStatusCode(_0x382796,_0x148f28){_0x148f28=_0x148f28||0xcc;return function(_0x255d36){if(_0x255d36){return _0x382796['sendStatus'](_0x148f28);}return _0x382796[_0x73c2('0x1a')](_0x148f28)['end']();};}function respondWithResult(_0x41745e,_0xb92355){_0xb92355=_0xb92355||0xc8;return function(_0x442e69){if(_0x442e69){return _0x41745e[_0x73c2('0x1a')](_0xb92355)[_0x73c2('0x1b')](_0x442e69);}};}function respondWithFilteredResult(_0xb9c432,_0x3f207e){return function(_0xff2f15){if(_0xff2f15){var _0x44a44a=typeof _0x3f207e[_0x73c2('0x1c')]===_0x73c2('0x1d')&&typeof _0x3f207e[_0x73c2('0x1e')]==='undefined';var _0x2765b9=_0xff2f15[_0x73c2('0x1f')];var _0x2a0aa2=_0x44a44a?0x0:_0x3f207e[_0x73c2('0x1c')];var _0x2976b4=_0x44a44a?_0xff2f15[_0x73c2('0x1f')]:_0x3f207e[_0x73c2('0x1c')]+_0x3f207e[_0x73c2('0x1e')];var _0x532039;if(_0x2976b4>=_0x2765b9){_0x2976b4=_0x2765b9;_0x532039=0xc8;}else{_0x532039=0xce;}_0xb9c432[_0x73c2('0x1a')](_0x532039);return _0xb9c432[_0x73c2('0x20')](_0x73c2('0x21'),_0x2a0aa2+'-'+_0x2976b4+'/'+_0x2765b9)[_0x73c2('0x1b')](_0xff2f15);}return null;};}function patchUpdates(_0x122250){return function(_0x33adae){try{jsonpatch[_0x73c2('0x22')](_0x33adae,_0x122250,!![]);}catch(_0x458ffd){return BPromise[_0x73c2('0x23')](_0x458ffd);}return _0x33adae['save']();};}function saveUpdates(_0x30d39d,_0x1f6f62){return function(_0x58bc36){if(_0x58bc36){return _0x58bc36[_0x73c2('0x24')](_0x30d39d)[_0x73c2('0x25')](function(_0x37bd34){return _0x37bd34;});}return null;};}function removeEntity(_0x177fea,_0x571a2b){return function(_0x294fa9){if(_0x294fa9){return _0x294fa9[_0x73c2('0x26')]()[_0x73c2('0x25')](function(){_0x177fea[_0x73c2('0x1a')](0xcc)[_0x73c2('0x27')]();});}};}function handleEntityNotFound(_0x2f6ee0,_0x97de40){return function(_0x52987b){if(!_0x52987b){_0x2f6ee0['sendStatus'](0x194);}return _0x52987b;};}function handleError(_0x3b8e30,_0xb3bb9c){_0xb3bb9c=_0xb3bb9c||0x1f4;return function(_0x540db7){logger[_0x73c2('0x28')](_0x540db7[_0x73c2('0x29')]);if(_0x540db7['name']){delete _0x540db7[_0x73c2('0x2a')];}_0x3b8e30['status'](_0xb3bb9c)[_0x73c2('0x2b')](_0x540db7);};}exports[_0x73c2('0x2c')]=function(_0xde79,_0x55289b){var _0x44086c={},_0x5be56e={},_0x41cff8={'count':0x0,'rows':[]};var _0x5af1b3=_[_0x73c2('0x2d')](db[_0x73c2('0x2e')]['rawAttributes'],function(_0x13b1bd){return{'name':_0x13b1bd[_0x73c2('0x2f')],'type':_0x13b1bd['type'][_0x73c2('0x30')]};});_0x5be56e[_0x73c2('0x31')]=_[_0x73c2('0x2d')](_0x5af1b3,'name');_0x5be56e[_0x73c2('0x32')]=_[_0x73c2('0x33')](_0xde79['query']);_0x5be56e[_0x73c2('0x34')]=_['intersection'](_0x5be56e[_0x73c2('0x31')],_0x5be56e[_0x73c2('0x32')]);_0x44086c[_0x73c2('0x35')]=_[_0x73c2('0x36')](_0x5be56e[_0x73c2('0x31')],qs[_0x73c2('0x37')](_0xde79[_0x73c2('0x32')][_0x73c2('0x37')]));_0x44086c[_0x73c2('0x35')]=_0x44086c[_0x73c2('0x35')][_0x73c2('0x38')]?_0x44086c[_0x73c2('0x35')]:_0x5be56e[_0x73c2('0x31')];if(!_0xde79[_0x73c2('0x32')][_0x73c2('0x39')](_0x73c2('0x3a'))){_0x44086c[_0x73c2('0x1e')]=qs[_0x73c2('0x1e')](_0xde79[_0x73c2('0x32')][_0x73c2('0x1e')]);_0x44086c['offset']=qs['offset'](_0xde79[_0x73c2('0x32')][_0x73c2('0x1c')]);}_0x44086c[_0x73c2('0x3b')]=qs[_0x73c2('0x3c')](_0xde79[_0x73c2('0x32')]['sort']);_0x44086c[_0x73c2('0x3d')]=qs['filters'](_['pick'](_0xde79[_0x73c2('0x32')],_0x5be56e['filters']),_0x5af1b3);if(_0xde79['query']['filter']){_0x44086c['where']=_['merge'](_0x44086c[_0x73c2('0x3d')],{'$or':_[_0x73c2('0x2d')](_0x5af1b3,function(_0x4186cf){if(_0x4186cf[_0x73c2('0x3e')]!==_0x73c2('0x3f')){var _0x2c77d5={};_0x2c77d5[_0x4186cf[_0x73c2('0x2a')]]={'$like':'%'+_0xde79[_0x73c2('0x32')][_0x73c2('0x40')]+'%'};return _0x2c77d5;}})});}_0x44086c=_[_0x73c2('0x41')]({},_0x44086c,_0xde79[_0x73c2('0x42')]);var _0x48883e={'where':_0x44086c[_0x73c2('0x3d')]};return db['SugarcrmConfiguration'][_0x73c2('0x1f')](_0x48883e)[_0x73c2('0x25')](function(_0xa5d22d){_0x41cff8[_0x73c2('0x1f')]=_0xa5d22d;if(_0xde79[_0x73c2('0x32')][_0x73c2('0x43')]){_0x44086c['include']=[{'all':!![]}];}return db[_0x73c2('0x2e')]['findAll'](_0x44086c);})[_0x73c2('0x25')](function(_0x142c08){_0x41cff8[_0x73c2('0x44')]=_0x142c08;return _0x41cff8;})['then'](respondWithFilteredResult(_0x55289b,_0x44086c))[_0x73c2('0x45')](handleError(_0x55289b,null));};exports[_0x73c2('0x46')]=function(_0x1d2c37,_0x1c9b6d){var _0x26e901={'raw':![],'where':{'id':_0x1d2c37[_0x73c2('0x47')]['id']}},_0x88e9c9={};_0x88e9c9['model']=_['keys'](db[_0x73c2('0x2e')][_0x73c2('0x48')]);_0x88e9c9[_0x73c2('0x32')]=_[_0x73c2('0x33')](_0x1d2c37[_0x73c2('0x32')]);_0x88e9c9['filters']=_['intersection'](_0x88e9c9['model'],_0x88e9c9['query']);_0x26e901['attributes']=_[_0x73c2('0x36')](_0x88e9c9[_0x73c2('0x31')],qs[_0x73c2('0x37')](_0x1d2c37[_0x73c2('0x32')]['fields']));_0x26e901[_0x73c2('0x35')]=_0x26e901[_0x73c2('0x35')][_0x73c2('0x38')]?_0x26e901[_0x73c2('0x35')]:_0x88e9c9[_0x73c2('0x31')];if(_0x1d2c37['query'][_0x73c2('0x43')]){_0x26e901[_0x73c2('0x49')]=[{'all':!![]}];}_0x26e901=_['merge']({},_0x26e901,_0x1d2c37[_0x73c2('0x42')]);return db[_0x73c2('0x2e')][_0x73c2('0x4a')](_0x26e901)[_0x73c2('0x25')](handleEntityNotFound(_0x1c9b6d,null))[_0x73c2('0x25')](respondWithResult(_0x1c9b6d,null))[_0x73c2('0x45')](handleError(_0x1c9b6d,null));};exports[_0x73c2('0x4b')]=function(_0x30f813,_0x3d8945){return db[_0x73c2('0x2e')][_0x73c2('0x4b')](_0x30f813['body'],{})['then'](respondWithResult(_0x3d8945,0xc9))[_0x73c2('0x45')](handleError(_0x3d8945,null));};exports[_0x73c2('0x24')]=function(_0x54c8b1,_0x581e01){if(_0x54c8b1[_0x73c2('0x4c')]['id']){delete _0x54c8b1[_0x73c2('0x4c')]['id'];}return db['SugarcrmConfiguration'][_0x73c2('0x4a')]({'where':{'id':_0x54c8b1[_0x73c2('0x47')]['id']}})[_0x73c2('0x25')](handleEntityNotFound(_0x581e01,null))[_0x73c2('0x25')](saveUpdates(_0x54c8b1[_0x73c2('0x4c')],null))[_0x73c2('0x25')](respondWithResult(_0x581e01,null))[_0x73c2('0x45')](handleError(_0x581e01,null));};exports[_0x73c2('0x26')]=function(_0x2863df,_0x15acdf){return db[_0x73c2('0x2e')][_0x73c2('0x4a')]({'where':{'id':_0x2863df[_0x73c2('0x47')]['id']}})[_0x73c2('0x25')](handleEntityNotFound(_0x15acdf,null))[_0x73c2('0x25')](removeEntity(_0x15acdf,null))[_0x73c2('0x45')](handleError(_0x15acdf,null));};exports[_0x73c2('0x4d')]=function(_0x54b922,_0x1b41d4,_0x1650dd){var _0x2d162e={};var _0x184110={};var _0x2993fa;var _0xb3980f;return db[_0x73c2('0x2e')][_0x73c2('0x4e')]({'where':{'id':_0x54b922[_0x73c2('0x47')]['id']}})[_0x73c2('0x25')](handleEntityNotFound(_0x1b41d4,null))[_0x73c2('0x25')](function(_0x5ddca9){if(_0x5ddca9){_0x2993fa=_0x5ddca9;_0x184110[_0x73c2('0x31')]=_[_0x73c2('0x33')](db[_0x73c2('0x4f')][_0x73c2('0x48')]);_0x184110[_0x73c2('0x32')]=_['keys'](_0x54b922[_0x73c2('0x32')]);_0x184110['filters']=_[_0x73c2('0x36')](_0x184110[_0x73c2('0x31')],_0x184110[_0x73c2('0x32')]);_0x2d162e[_0x73c2('0x35')]=_[_0x73c2('0x36')](_0x184110[_0x73c2('0x31')],qs[_0x73c2('0x37')](_0x54b922[_0x73c2('0x32')]['fields']));_0x2d162e[_0x73c2('0x35')]=_0x2d162e['attributes'][_0x73c2('0x38')]?_0x2d162e[_0x73c2('0x35')]:_0x184110[_0x73c2('0x31')];_0x2d162e[_0x73c2('0x3b')]=qs['sort'](_0x54b922[_0x73c2('0x32')]['sort']);_0x2d162e[_0x73c2('0x3d')]=qs[_0x73c2('0x34')](_['pick'](_0x54b922[_0x73c2('0x32')],_0x184110[_0x73c2('0x34')]));if(_0x54b922[_0x73c2('0x32')][_0x73c2('0x40')]){_0x2d162e['where']=_[_0x73c2('0x41')](_0x2d162e['where'],{'$or':_[_0x73c2('0x2d')](_0x2d162e[_0x73c2('0x35')],function(_0x3c67f9){var _0x3b7270={};_0x3b7270[_0x3c67f9]={'$like':'%'+_0x54b922[_0x73c2('0x32')]['filter']+'%'};return _0x3b7270;})});}_0x2d162e=_['merge']({},_0x2d162e,_0x54b922[_0x73c2('0x42')]);return _0x2993fa['getFields'](_0x2d162e);}})[_0x73c2('0x25')](function(_0x42357a){if(_0x42357a){_0xb3980f=_0x42357a[_0x73c2('0x38')];if(!_0x54b922['query'][_0x73c2('0x39')]('nolimit')){_0x2d162e[_0x73c2('0x1e')]=qs[_0x73c2('0x1e')](_0x54b922[_0x73c2('0x32')][_0x73c2('0x1e')]);_0x2d162e['offset']=qs[_0x73c2('0x1c')](_0x54b922[_0x73c2('0x32')]['offset']);}return _0x2993fa['getFields'](_0x2d162e);}})[_0x73c2('0x25')](function(_0x873b3b){if(_0x873b3b){return _0x873b3b?{'count':_0xb3980f,'rows':_0x873b3b}:null;}})[_0x73c2('0x25')](respondWithResult(_0x1b41d4,null))[_0x73c2('0x45')](handleError(_0x1b41d4,null));};exports[_0x73c2('0x50')]=function(_0x2d04d2,_0x4e5ac4,_0x3fe0e0){var _0x58dc88={};var _0x2970c7={};var _0x54674b;var _0x38b80e;return db[_0x73c2('0x2e')][_0x73c2('0x4e')]({'where':{'id':_0x2d04d2[_0x73c2('0x47')]['id']}})['then'](handleEntityNotFound(_0x4e5ac4,null))[_0x73c2('0x25')](function(_0x3bd9da){if(_0x3bd9da){_0x54674b=_0x3bd9da;_0x2970c7[_0x73c2('0x31')]=_[_0x73c2('0x33')](db['SugarcrmField'][_0x73c2('0x48')]);_0x2970c7[_0x73c2('0x32')]=_[_0x73c2('0x33')](_0x2d04d2[_0x73c2('0x32')]);_0x2970c7[_0x73c2('0x34')]=_[_0x73c2('0x36')](_0x2970c7[_0x73c2('0x31')],_0x2970c7[_0x73c2('0x32')]);_0x58dc88[_0x73c2('0x35')]=_[_0x73c2('0x36')](_0x2970c7['model'],qs[_0x73c2('0x37')](_0x2d04d2['query']['fields']));_0x58dc88['attributes']=_0x58dc88[_0x73c2('0x35')][_0x73c2('0x38')]?_0x58dc88[_0x73c2('0x35')]:_0x2970c7[_0x73c2('0x31')];_0x58dc88[_0x73c2('0x3b')]=qs['sort'](_0x2d04d2['query'][_0x73c2('0x3c')]);_0x58dc88[_0x73c2('0x3d')]=qs['filters'](_[_0x73c2('0x51')](_0x2d04d2[_0x73c2('0x32')],_0x2970c7[_0x73c2('0x34')]));if(_0x2d04d2[_0x73c2('0x32')][_0x73c2('0x40')]){_0x58dc88[_0x73c2('0x3d')]=_[_0x73c2('0x41')](_0x58dc88[_0x73c2('0x3d')],{'$or':_[_0x73c2('0x2d')](_0x58dc88[_0x73c2('0x35')],function(_0x27333f){var _0x516584={};_0x516584[_0x27333f]={'$like':'%'+_0x2d04d2[_0x73c2('0x32')]['filter']+'%'};return _0x516584;})});}_0x58dc88=_[_0x73c2('0x41')]({},_0x58dc88,_0x2d04d2['options']);return _0x54674b[_0x73c2('0x50')](_0x58dc88);}})[_0x73c2('0x25')](function(_0x17582d){if(_0x17582d){_0x38b80e=_0x17582d[_0x73c2('0x38')];if(!_0x2d04d2[_0x73c2('0x32')]['hasOwnProperty'](_0x73c2('0x3a'))){_0x58dc88[_0x73c2('0x1e')]=qs[_0x73c2('0x1e')](_0x2d04d2[_0x73c2('0x32')][_0x73c2('0x1e')]);_0x58dc88['offset']=qs[_0x73c2('0x1c')](_0x2d04d2[_0x73c2('0x32')]['offset']);}return _0x54674b[_0x73c2('0x50')](_0x58dc88);}})[_0x73c2('0x25')](function(_0x47dff9){if(_0x47dff9){return _0x47dff9?{'count':_0x38b80e,'rows':_0x47dff9}:null;}})[_0x73c2('0x25')](respondWithResult(_0x4e5ac4,null))[_0x73c2('0x45')](handleError(_0x4e5ac4,null));};exports[_0x73c2('0x52')]=function(_0x5c2aca,_0xdf0e0a,_0x4749bf){var _0x5b3542={};var _0x38d819={};var _0x44ace3;var _0x273e6a;return db['SugarcrmConfiguration'][_0x73c2('0x4e')]({'where':{'id':_0x5c2aca[_0x73c2('0x47')]['id']}})[_0x73c2('0x25')](handleEntityNotFound(_0xdf0e0a,null))[_0x73c2('0x25')](function(_0xd02459){if(_0xd02459){_0x44ace3=_0xd02459;_0x38d819[_0x73c2('0x31')]=_[_0x73c2('0x33')](db[_0x73c2('0x4f')][_0x73c2('0x48')]);_0x38d819[_0x73c2('0x32')]=_['keys'](_0x5c2aca[_0x73c2('0x32')]);_0x38d819[_0x73c2('0x34')]=_[_0x73c2('0x36')](_0x38d819[_0x73c2('0x31')],_0x38d819[_0x73c2('0x32')]);_0x5b3542['attributes']=_['intersection'](_0x38d819[_0x73c2('0x31')],qs['fields'](_0x5c2aca[_0x73c2('0x32')][_0x73c2('0x37')]));_0x5b3542['attributes']=_0x5b3542[_0x73c2('0x35')][_0x73c2('0x38')]?_0x5b3542[_0x73c2('0x35')]:_0x38d819[_0x73c2('0x31')];_0x5b3542['order']=qs[_0x73c2('0x3c')](_0x5c2aca[_0x73c2('0x32')]['sort']);_0x5b3542[_0x73c2('0x3d')]=qs[_0x73c2('0x34')](_['pick'](_0x5c2aca[_0x73c2('0x32')],_0x38d819[_0x73c2('0x34')]));if(_0x5c2aca['query']['filter']){_0x5b3542[_0x73c2('0x3d')]=_[_0x73c2('0x41')](_0x5b3542[_0x73c2('0x3d')],{'$or':_['map'](_0x5b3542[_0x73c2('0x35')],function(_0x84d82c){var _0x134ee7={};_0x134ee7[_0x84d82c]={'$like':'%'+_0x5c2aca[_0x73c2('0x32')][_0x73c2('0x40')]+'%'};return _0x134ee7;})});}_0x5b3542=_[_0x73c2('0x41')]({},_0x5b3542,_0x5c2aca['options']);return _0x44ace3[_0x73c2('0x52')](_0x5b3542);}})['then'](function(_0x28b8ee){if(_0x28b8ee){_0x273e6a=_0x28b8ee[_0x73c2('0x38')];if(!_0x5c2aca[_0x73c2('0x32')][_0x73c2('0x39')](_0x73c2('0x3a'))){_0x5b3542['limit']=qs[_0x73c2('0x1e')](_0x5c2aca[_0x73c2('0x32')][_0x73c2('0x1e')]);_0x5b3542[_0x73c2('0x1c')]=qs['offset'](_0x5c2aca['query'][_0x73c2('0x1c')]);}return _0x44ace3['getDescriptions'](_0x5b3542);}})[_0x73c2('0x25')](function(_0xbd7d38){if(_0xbd7d38){return _0xbd7d38?{'count':_0x273e6a,'rows':_0xbd7d38}:null;}})[_0x73c2('0x25')](respondWithResult(_0xdf0e0a,null))[_0x73c2('0x45')](handleError(_0xdf0e0a,null));};
\ No newline at end of file
index b163e7c..82b50bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb75b=['api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','util','../../config/logger'];(function(_0x176963,_0x32d927){var _0x2dad59=function(_0x4ca528){while(--_0x4ca528){_0x176963['push'](_0x176963['shift']());}};_0x2dad59(++_0x32d927);}(_0xb75b,0x1ab));var _0xbb75=function(_0x54c62e,_0x565a68){_0x54c62e=_0x54c62e-0x0;var _0x46c704=_0xb75b[_0x54c62e];return _0x46c704;};'use strict';var _=require('lodash');var util=require(_0xbb75('0x0'));var logger=require(_0xbb75('0x1'))(_0xbb75('0x2'));var moment=require(_0xbb75('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb75('0x4'));var fs=require('fs');var path=require(_0xbb75('0x5'));var rimraf=require(_0xbb75('0x6'));var config=require(_0xbb75('0x7'));var attributes=require(_0xbb75('0x8'));module[_0xbb75('0x9')]=function(_0x193a29,_0x18a8e0){return _0x193a29[_0xbb75('0xa')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe806=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','int_sugarcrm_configurations','lodash','util','../../config/logger','api'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe806,0xf3));var _0x6e80=function(_0xda7e5,_0x124f5d){_0xda7e5=_0xda7e5-0x0;var _0x51c46f=_0xe806[_0xda7e5];return _0x51c46f;};'use strict';var _=require(_0x6e80('0x0'));var util=require(_0x6e80('0x1'));var logger=require(_0x6e80('0x2'))(_0x6e80('0x3'));var moment=require(_0x6e80('0x4'));var BPromise=require(_0x6e80('0x5'));var rp=require(_0x6e80('0x6'));var fs=require('fs');var path=require(_0x6e80('0x7'));var rimraf=require(_0x6e80('0x8'));var config=require(_0x6e80('0x9'));var attributes=require(_0x6e80('0xa'));module[_0x6e80('0xb')]=function(_0x4265f4,_0x47d7b9){return _0x4265f4['define']('SugarcrmConfiguration',attributes,{'tableName':_0x6e80('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aecbd37..0a5ab1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea7e=['debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','SugarcrmConfiguration,\x20%s,\x20%s','message','info','result','lodash','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xea7e,0x1e8));var _0xeea7=function(_0x27466b,_0x4105b8){_0x27466b=_0x27466b-0x0;var _0x22c724=_0xea7e[_0x27466b];return _0x22c724;};'use strict';var _=require(_0xeea7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeea7('0x1'));var logger=require('../../config/logger')(_0xeea7('0x2'));var config=require(_0xeea7('0x3'));var jayson=require(_0xeea7('0x4'));var client=jayson[_0xeea7('0x5')][_0xeea7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x42a799,_0x31c205,_0x2fe17a){return new BPromise(function(_0x2b900d,_0x3fe20d){return client['request'](_0x42a799,_0x2fe17a)[_0xeea7('0x7')](function(_0xcd0882){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x31c205,'request\x20sent');logger[_0xeea7('0x8')](_0xeea7('0x9'),_0x31c205,_0xeea7('0xa'),JSON['stringify'](_0xcd0882));if(_0xcd0882[_0xeea7('0xb')]){if(_0xcd0882[_0xeea7('0xb')]['code']===0x1f4){logger[_0xeea7('0xb')](_0xeea7('0xc'),_0x31c205,_0xcd0882[_0xeea7('0xb')][_0xeea7('0xd')]);return _0x3fe20d(_0xcd0882[_0xeea7('0xb')][_0xeea7('0xd')]);}logger[_0xeea7('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x31c205,_0xcd0882[_0xeea7('0xb')][_0xeea7('0xd')]);return _0x2b900d(_0xcd0882['error'][_0xeea7('0xd')]);}else{logger[_0xeea7('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x31c205,_0xeea7('0xa'));_0x2b900d(_0xcd0882[_0xeea7('0xf')][_0xeea7('0xd')]);}})['catch'](function(_0x4fd234){logger[_0xeea7('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x31c205,_0x4fd234);_0x3fe20d(_0x4fd234);});});}
\ No newline at end of file
+var _0xef5f=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x173336,_0x3f98c4){var _0x12dc79=function(_0xae7bf5){while(--_0xae7bf5){_0x173336['push'](_0x173336['shift']());}};_0x12dc79(++_0x3f98c4);}(_0xef5f,0x183));var _0xfef5=function(_0x1748eb,_0x238867){_0x1748eb=_0x1748eb-0x0;var _0x3038f6=_0xef5f[_0x1748eb];return _0x3038f6;};'use strict';var _=require('lodash');var util=require(_0xfef5('0x0'));var moment=require(_0xfef5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfef5('0x2'));var db=require(_0xfef5('0x3'))['db'];var utils=require(_0xfef5('0x4'));var logger=require(_0xfef5('0x5'))(_0xfef5('0x6'));var config=require(_0xfef5('0x7'));var jayson=require(_0xfef5('0x8'));var client=jayson[_0xfef5('0x9')][_0xfef5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42a962,_0xd5609d,_0xb825ca){return new BPromise(function(_0x2618d3,_0x66bb34){return client[_0xfef5('0xb')](_0x42a962,_0xb825ca)['then'](function(_0x21a8cc){logger[_0xfef5('0xc')](_0xfef5('0xd'),_0xd5609d,_0xfef5('0xe'));logger[_0xfef5('0xf')](_0xfef5('0x10'),_0xd5609d,_0xfef5('0xe'),JSON[_0xfef5('0x11')](_0x21a8cc));if(_0x21a8cc[_0xfef5('0x12')]){if(_0x21a8cc[_0xfef5('0x12')]['code']===0x1f4){logger[_0xfef5('0x12')](_0xfef5('0xd'),_0xd5609d,_0x21a8cc[_0xfef5('0x12')][_0xfef5('0x13')]);return _0x66bb34(_0x21a8cc[_0xfef5('0x12')][_0xfef5('0x13')]);}logger['error'](_0xfef5('0xd'),_0xd5609d,_0x21a8cc[_0xfef5('0x12')][_0xfef5('0x13')]);return _0x2618d3(_0x21a8cc[_0xfef5('0x12')][_0xfef5('0x13')]);}else{logger['info'](_0xfef5('0xd'),_0xd5609d,_0xfef5('0xe'));_0x2618d3(_0x21a8cc['result'][_0xfef5('0x13')]);}})[_0xfef5('0x14')](function(_0x22025a){logger[_0xfef5('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xd5609d,_0x22025a);_0x66bb34(_0x22025a);});});}
\ No newline at end of file
index a1e3c35..804ce4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d4b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0x8d4b,0x9b));var _0xb8d4=function(_0x423e97,_0x239d19){_0x423e97=_0x423e97-0x0;var _0x16628b=_0x8d4b[_0x423e97];return _0x16628b;};'use strict';var multer=require(_0xb8d4('0x0'));var util=require('util');var path=require(_0xb8d4('0x1'));var timeout=require(_0xb8d4('0x2'));var express=require(_0xb8d4('0x3'));var router=express['Router']();var fs_extra=require(_0xb8d4('0x4'));var auth=require(_0xb8d4('0x5'));var interaction=require(_0xb8d4('0x6'));var config=require(_0xb8d4('0x7'));var controller=require(_0xb8d4('0x8'));router[_0xb8d4('0x9')]('/',auth[_0xb8d4('0xa')](),controller[_0xb8d4('0xb')]);router[_0xb8d4('0x9')]('/:id',auth[_0xb8d4('0xa')](),controller[_0xb8d4('0xc')]);router[_0xb8d4('0xd')]('/',auth[_0xb8d4('0xa')](),controller[_0xb8d4('0xe')]);router[_0xb8d4('0xf')](_0xb8d4('0x10'),auth[_0xb8d4('0xa')](),controller[_0xb8d4('0x11')]);router['delete'](_0xb8d4('0x10'),auth['isAuthenticated'](),controller[_0xb8d4('0x12')]);module[_0xb8d4('0x13')]=router;
\ No newline at end of file
+var _0xdfda=['update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5dfb47,_0x5b158c){var _0x48c85a=function(_0x5d9ccf){while(--_0x5d9ccf){_0x5dfb47['push'](_0x5dfb47['shift']());}};_0x48c85a(++_0x5b158c);}(_0xdfda,0x6e));var _0xadfd=function(_0x4af078,_0x4366d3){_0x4af078=_0x4af078-0x0;var _0x2e6f60=_0xdfda[_0x4af078];return _0x2e6f60;};'use strict';var multer=require('multer');var util=require(_0xadfd('0x0'));var path=require(_0xadfd('0x1'));var timeout=require(_0xadfd('0x2'));var express=require(_0xadfd('0x3'));var router=express[_0xadfd('0x4')]();var fs_extra=require(_0xadfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xadfd('0x6'));var config=require(_0xadfd('0x7'));var controller=require(_0xadfd('0x8'));router[_0xadfd('0x9')]('/',auth[_0xadfd('0xa')](),controller[_0xadfd('0xb')]);router['get'](_0xadfd('0xc'),auth[_0xadfd('0xa')](),controller[_0xadfd('0xd')]);router[_0xadfd('0xe')]('/',auth[_0xadfd('0xa')](),controller[_0xadfd('0xf')]);router['put'](_0xadfd('0xc'),auth['isAuthenticated'](),controller[_0xadfd('0x10')]);router['delete'](_0xadfd('0xc'),auth[_0xadfd('0xa')](),controller['destroy']);module[_0xadfd('0x11')]=router;
\ No newline at end of file
index 99c7032..3be9c6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32d3=['keyValue','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0xfeeba7,_0x38bf7b){var _0x4c90f7=function(_0x268afc){while(--_0x268afc){_0xfeeba7['push'](_0xfeeba7['shift']());}};_0x4c90f7(++_0x38bf7b);}(_0x32d3,0x6a));var _0x332d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x32d3[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x332d('0x0'));module[_0x332d('0x1')]={'type':{'type':Sequelize[_0x332d('0x2')](_0x332d('0x3'),_0x332d('0x4'),_0x332d('0x5'),_0x332d('0x6'),'picklist'),'defaultValue':_0x332d('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x332d('0x7')]},'keyType':{'type':Sequelize[_0x332d('0x2')](_0x332d('0x3'),_0x332d('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x332d('0x7')]},'idField':{'type':Sequelize[_0x332d('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x332d('0x7')]}};
\ No newline at end of file
+var _0x83c7=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x302e35,_0x197af1){var _0x31d5f9=function(_0x140029){while(--_0x140029){_0x302e35['push'](_0x302e35['shift']());}};_0x31d5f9(++_0x197af1);}(_0x83c7,0x17c));var _0x783c=function(_0x5ba58c,_0x17713e){_0x5ba58c=_0x5ba58c-0x0;var _0x3af2e9=_0x83c7[_0x5ba58c];return _0x3af2e9;};'use strict';var Sequelize=require(_0x783c('0x0'));module['exports']={'type':{'type':Sequelize[_0x783c('0x1')](_0x783c('0x2'),_0x783c('0x3'),_0x783c('0x4'),_0x783c('0x5'),_0x783c('0x6')),'defaultValue':_0x783c('0x2')},'content':{'type':Sequelize[_0x783c('0x7')]},'key':{'type':Sequelize[_0x783c('0x7')]},'keyType':{'type':Sequelize[_0x783c('0x1')]('string',_0x783c('0x3'),_0x783c('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x783c('0x7')]},'nameField':{'type':Sequelize[_0x783c('0x7')]},'customField':{'type':Sequelize[_0x783c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 11a206d..c36504c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8207=['params','keys','rawAttributes','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','index','map','SugarcrmField','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show'];(function(_0x57ed04,_0x70446f){var _0x3b5607=function(_0x84e775){while(--_0x84e775){_0x57ed04['push'](_0x57ed04['shift']());}};_0x3b5607(++_0x70446f);}(_0x8207,0x1ac));var _0x7820=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8207[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7820('0x0'));var rimraf=require(_0x7820('0x1'));var zipdir=require(_0x7820('0x2'));var jsonpatch=require(_0x7820('0x3'));var rp=require(_0x7820('0x4'));var moment=require(_0x7820('0x5'));var BPromise=require(_0x7820('0x6'));var Mustache=require(_0x7820('0x7'));var util=require(_0x7820('0x8'));var path=require(_0x7820('0x9'));var sox=require(_0x7820('0xa'));var csv=require(_0x7820('0xb'));var ejs=require(_0x7820('0xc'));var fs=require('fs');var fs_extra=require(_0x7820('0xd'));var _=require(_0x7820('0xe'));var squel=require(_0x7820('0xf'));var crypto=require(_0x7820('0x10'));var jsforce=require(_0x7820('0x11'));var deskjs=require(_0x7820('0x12'));var toCsv=require(_0x7820('0xb'));var querystring=require(_0x7820('0x13'));var Papa=require(_0x7820('0x14'));var Redis=require(_0x7820('0x15'));var authService=require(_0x7820('0x16'));var qs=require(_0x7820('0x17'));var as=require(_0x7820('0x18'));var hardwareService=require(_0x7820('0x19'));var logger=require(_0x7820('0x1a'))(_0x7820('0x1b'));var utils=require(_0x7820('0x1c'));var config=require(_0x7820('0x1d'));var licenseUtil=require(_0x7820('0x1e'));var db=require(_0x7820('0x1f'))['db'];function respondWithStatusCode(_0x58cb00,_0x3ae9fc){_0x3ae9fc=_0x3ae9fc||0xcc;return function(_0x3c72d6){if(_0x3c72d6){return _0x58cb00['sendStatus'](_0x3ae9fc);}return _0x58cb00[_0x7820('0x20')](_0x3ae9fc)[_0x7820('0x21')]();};}function respondWithResult(_0x5de5cc,_0x3621a3){_0x3621a3=_0x3621a3||0xc8;return function(_0x4805b4){if(_0x4805b4){return _0x5de5cc[_0x7820('0x20')](_0x3621a3)[_0x7820('0x22')](_0x4805b4);}};}function respondWithFilteredResult(_0x2fbd6f,_0x33a717){return function(_0x2647d5){if(_0x2647d5){var _0x25b38e=typeof _0x33a717[_0x7820('0x23')]===_0x7820('0x24')&&typeof _0x33a717[_0x7820('0x25')]==='undefined';var _0x40b13f=_0x2647d5[_0x7820('0x26')];var _0x55ec95=_0x25b38e?0x0:_0x33a717[_0x7820('0x23')];var _0x4f9093=_0x25b38e?_0x2647d5[_0x7820('0x26')]:_0x33a717[_0x7820('0x23')]+_0x33a717[_0x7820('0x25')];var _0x3c8aae;if(_0x4f9093>=_0x40b13f){_0x4f9093=_0x40b13f;_0x3c8aae=0xc8;}else{_0x3c8aae=0xce;}_0x2fbd6f[_0x7820('0x20')](_0x3c8aae);return _0x2fbd6f[_0x7820('0x27')](_0x7820('0x28'),_0x55ec95+'-'+_0x4f9093+'/'+_0x40b13f)['json'](_0x2647d5);}return null;};}function patchUpdates(_0x464e39){return function(_0x280647){try{jsonpatch['apply'](_0x280647,_0x464e39,!![]);}catch(_0x5db2b9){return BPromise[_0x7820('0x29')](_0x5db2b9);}return _0x280647[_0x7820('0x2a')]();};}function saveUpdates(_0x59bc90,_0x46ff0a){return function(_0x2ae4af){if(_0x2ae4af){return _0x2ae4af['update'](_0x59bc90)[_0x7820('0x2b')](function(_0x360dc8){return _0x360dc8;});}return null;};}function removeEntity(_0x57f308,_0x1d3ce2){return function(_0x2636b3){if(_0x2636b3){return _0x2636b3[_0x7820('0x2c')]()[_0x7820('0x2b')](function(){_0x57f308[_0x7820('0x20')](0xcc)[_0x7820('0x21')]();});}};}function handleEntityNotFound(_0x2f931a,_0x4db1b6){return function(_0x5c74b9){if(!_0x5c74b9){_0x2f931a[_0x7820('0x2d')](0x194);}return _0x5c74b9;};}function handleError(_0xbd8490,_0x1f057e){_0x1f057e=_0x1f057e||0x1f4;return function(_0x3e9715){logger[_0x7820('0x2e')](_0x3e9715[_0x7820('0x2f')]);if(_0x3e9715[_0x7820('0x30')]){delete _0x3e9715['name'];}_0xbd8490[_0x7820('0x20')](_0x1f057e)['send'](_0x3e9715);};}exports[_0x7820('0x31')]=function(_0xe11f13,_0x2552b1){var _0xa82aeb={},_0x4dfc3d={},_0x3b2ff7={'count':0x0,'rows':[]};var _0x1b7276=_[_0x7820('0x32')](db[_0x7820('0x33')]['rawAttributes'],function(_0x25f7e6){return{'name':_0x25f7e6['fieldName'],'type':_0x25f7e6[_0x7820('0x34')][_0x7820('0x35')]};});_0x4dfc3d[_0x7820('0x36')]=_[_0x7820('0x32')](_0x1b7276,_0x7820('0x30'));_0x4dfc3d[_0x7820('0x37')]=_['keys'](_0xe11f13[_0x7820('0x37')]);_0x4dfc3d[_0x7820('0x38')]=_[_0x7820('0x39')](_0x4dfc3d[_0x7820('0x36')],_0x4dfc3d['query']);_0xa82aeb[_0x7820('0x3a')]=_[_0x7820('0x39')](_0x4dfc3d[_0x7820('0x36')],qs[_0x7820('0x3b')](_0xe11f13[_0x7820('0x37')][_0x7820('0x3b')]));_0xa82aeb[_0x7820('0x3a')]=_0xa82aeb[_0x7820('0x3a')][_0x7820('0x3c')]?_0xa82aeb[_0x7820('0x3a')]:_0x4dfc3d['model'];if(!_0xe11f13['query'][_0x7820('0x3d')](_0x7820('0x3e'))){_0xa82aeb['limit']=qs['limit'](_0xe11f13[_0x7820('0x37')][_0x7820('0x25')]);_0xa82aeb[_0x7820('0x23')]=qs[_0x7820('0x23')](_0xe11f13[_0x7820('0x37')][_0x7820('0x23')]);}_0xa82aeb[_0x7820('0x3f')]=qs[_0x7820('0x40')](_0xe11f13[_0x7820('0x37')][_0x7820('0x40')]);_0xa82aeb[_0x7820('0x41')]=qs[_0x7820('0x38')](_[_0x7820('0x42')](_0xe11f13[_0x7820('0x37')],_0x4dfc3d['filters']),_0x1b7276);if(_0xe11f13['query'][_0x7820('0x43')]){_0xa82aeb[_0x7820('0x41')]=_[_0x7820('0x44')](_0xa82aeb['where'],{'$or':_['map'](_0x1b7276,function(_0x39ce16){if(_0x39ce16[_0x7820('0x34')]!==_0x7820('0x45')){var _0xa58adb={};_0xa58adb[_0x39ce16['name']]={'$like':'%'+_0xe11f13['query'][_0x7820('0x43')]+'%'};return _0xa58adb;}})});}_0xa82aeb=_[_0x7820('0x44')]({},_0xa82aeb,_0xe11f13[_0x7820('0x46')]);var _0x4cf2fb={'where':_0xa82aeb[_0x7820('0x41')]};return db[_0x7820('0x33')][_0x7820('0x26')](_0x4cf2fb)[_0x7820('0x2b')](function(_0x41eaf5){_0x3b2ff7[_0x7820('0x26')]=_0x41eaf5;if(_0xe11f13['query'][_0x7820('0x47')]){_0xa82aeb[_0x7820('0x48')]=[{'all':!![]}];}return db['SugarcrmField'][_0x7820('0x49')](_0xa82aeb);})[_0x7820('0x2b')](function(_0x57a012){_0x3b2ff7[_0x7820('0x4a')]=_0x57a012;return _0x3b2ff7;})[_0x7820('0x2b')](respondWithFilteredResult(_0x2552b1,_0xa82aeb))['catch'](handleError(_0x2552b1,null));};exports[_0x7820('0x4b')]=function(_0x2ca553,_0x4095ea){var _0x58293e={'raw':!![],'where':{'id':_0x2ca553[_0x7820('0x4c')]['id']}},_0x7bbd56={};_0x7bbd56[_0x7820('0x36')]=_[_0x7820('0x4d')](db[_0x7820('0x33')][_0x7820('0x4e')]);_0x7bbd56['query']=_[_0x7820('0x4d')](_0x2ca553[_0x7820('0x37')]);_0x7bbd56[_0x7820('0x38')]=_[_0x7820('0x39')](_0x7bbd56['model'],_0x7bbd56['query']);_0x58293e[_0x7820('0x3a')]=_[_0x7820('0x39')](_0x7bbd56[_0x7820('0x36')],qs[_0x7820('0x3b')](_0x2ca553[_0x7820('0x37')]['fields']));_0x58293e['attributes']=_0x58293e[_0x7820('0x3a')]['length']?_0x58293e[_0x7820('0x3a')]:_0x7bbd56[_0x7820('0x36')];if(_0x2ca553[_0x7820('0x37')][_0x7820('0x47')]){_0x58293e[_0x7820('0x48')]=[{'all':!![]}];}_0x58293e=_[_0x7820('0x44')]({},_0x58293e,_0x2ca553['options']);return db[_0x7820('0x33')][_0x7820('0x4f')](_0x58293e)[_0x7820('0x2b')](handleEntityNotFound(_0x4095ea,null))['then'](respondWithResult(_0x4095ea,null))[_0x7820('0x50')](handleError(_0x4095ea,null));};exports[_0x7820('0x51')]=function(_0x447fe0,_0x2da108){return db[_0x7820('0x33')]['create'](_0x447fe0[_0x7820('0x52')],{})[_0x7820('0x2b')](respondWithResult(_0x2da108,0xc9))[_0x7820('0x50')](handleError(_0x2da108,null));};exports[_0x7820('0x53')]=function(_0x42a291,_0x4e705d){if(_0x42a291[_0x7820('0x52')]['id']){delete _0x42a291[_0x7820('0x52')]['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x42a291[_0x7820('0x4c')]['id']}})[_0x7820('0x2b')](handleEntityNotFound(_0x4e705d,null))[_0x7820('0x2b')](saveUpdates(_0x42a291[_0x7820('0x52')],null))['then'](respondWithResult(_0x4e705d,null))[_0x7820('0x50')](handleError(_0x4e705d,null));};exports[_0x7820('0x2c')]=function(_0x2e37d2,_0x1b9220){return db[_0x7820('0x33')][_0x7820('0x4f')]({'where':{'id':_0x2e37d2[_0x7820('0x4c')]['id']}})[_0x7820('0x2b')](handleEntityNotFound(_0x1b9220,null))[_0x7820('0x2b')](removeEntity(_0x1b9220,null))[_0x7820('0x50')](handleError(_0x1b9220,null));};
\ No newline at end of file
+var _0x9e02=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','request-promise','moment','mustache','util'];(function(_0x1378ae,_0x456dbe){var _0x37cdfc=function(_0x1d4004){while(--_0x1d4004){_0x1378ae['push'](_0x1378ae['shift']());}};_0x37cdfc(++_0x456dbe);}(_0x9e02,0x1eb));var _0x29e0=function(_0x3a9eb1,_0xcb21e9){_0x3a9eb1=_0x3a9eb1-0x0;var _0x36c0e1=_0x9e02[_0x3a9eb1];return _0x36c0e1;};'use strict';var emlformat=require(_0x29e0('0x0'));var rimraf=require(_0x29e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x29e0('0x2'));var moment=require(_0x29e0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x29e0('0x4'));var util=require(_0x29e0('0x5'));var path=require(_0x29e0('0x6'));var sox=require('sox');var csv=require(_0x29e0('0x7'));var ejs=require(_0x29e0('0x8'));var fs=require('fs');var fs_extra=require(_0x29e0('0x9'));var _=require(_0x29e0('0xa'));var squel=require(_0x29e0('0xb'));var crypto=require(_0x29e0('0xc'));var jsforce=require(_0x29e0('0xd'));var deskjs=require(_0x29e0('0xe'));var toCsv=require(_0x29e0('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29e0('0xf'));var authService=require(_0x29e0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x29e0('0x11'));var hardwareService=require(_0x29e0('0x12'));var logger=require(_0x29e0('0x13'))(_0x29e0('0x14'));var utils=require(_0x29e0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x29e0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb8b33,_0x579f6c){_0x579f6c=_0x579f6c||0xcc;return function(_0x2656be){if(_0x2656be){return _0xb8b33['sendStatus'](_0x579f6c);}return _0xb8b33['status'](_0x579f6c)[_0x29e0('0x17')]();};}function respondWithResult(_0x2ff134,_0x5cc626){_0x5cc626=_0x5cc626||0xc8;return function(_0x39dac7){if(_0x39dac7){return _0x2ff134[_0x29e0('0x18')](_0x5cc626)[_0x29e0('0x19')](_0x39dac7);}};}function respondWithFilteredResult(_0x34cfc6,_0xe1906a){return function(_0xa3246b){if(_0xa3246b){var _0x495cb2=typeof _0xe1906a[_0x29e0('0x1a')]===_0x29e0('0x1b')&&typeof _0xe1906a[_0x29e0('0x1c')]==='undefined';var _0x32e7c0=_0xa3246b[_0x29e0('0x1d')];var _0x5f4898=_0x495cb2?0x0:_0xe1906a['offset'];var _0xbaafc9=_0x495cb2?_0xa3246b[_0x29e0('0x1d')]:_0xe1906a[_0x29e0('0x1a')]+_0xe1906a[_0x29e0('0x1c')];var _0x3f6635;if(_0xbaafc9>=_0x32e7c0){_0xbaafc9=_0x32e7c0;_0x3f6635=0xc8;}else{_0x3f6635=0xce;}_0x34cfc6[_0x29e0('0x18')](_0x3f6635);return _0x34cfc6[_0x29e0('0x1e')]('Content-Range',_0x5f4898+'-'+_0xbaafc9+'/'+_0x32e7c0)[_0x29e0('0x19')](_0xa3246b);}return null;};}function patchUpdates(_0x528583){return function(_0x1c5a32){try{jsonpatch['apply'](_0x1c5a32,_0x528583,!![]);}catch(_0x27183d){return BPromise[_0x29e0('0x1f')](_0x27183d);}return _0x1c5a32[_0x29e0('0x20')]();};}function saveUpdates(_0x146e4d,_0x18d1d7){return function(_0x4f36a6){if(_0x4f36a6){return _0x4f36a6[_0x29e0('0x21')](_0x146e4d)[_0x29e0('0x22')](function(_0x16b1ff){return _0x16b1ff;});}return null;};}function removeEntity(_0x592cc5,_0x2c825d){return function(_0x4bc2f){if(_0x4bc2f){return _0x4bc2f[_0x29e0('0x23')]()[_0x29e0('0x22')](function(){_0x592cc5[_0x29e0('0x18')](0xcc)[_0x29e0('0x17')]();});}};}function handleEntityNotFound(_0x435783,_0xa59f86){return function(_0x117faa){if(!_0x117faa){_0x435783['sendStatus'](0x194);}return _0x117faa;};}function handleError(_0x4aa4c6,_0x3894b4){_0x3894b4=_0x3894b4||0x1f4;return function(_0x2e57d5){logger[_0x29e0('0x24')](_0x2e57d5[_0x29e0('0x25')]);if(_0x2e57d5[_0x29e0('0x26')]){delete _0x2e57d5[_0x29e0('0x26')];}_0x4aa4c6[_0x29e0('0x18')](_0x3894b4)['send'](_0x2e57d5);};}exports[_0x29e0('0x27')]=function(_0x2ad3f4,_0x4a20c3){var _0x290173={},_0x609fcc={},_0xb03f38={'count':0x0,'rows':[]};var _0x56cf46=_[_0x29e0('0x28')](db[_0x29e0('0x29')][_0x29e0('0x2a')],function(_0x5b81a2){return{'name':_0x5b81a2[_0x29e0('0x2b')],'type':_0x5b81a2[_0x29e0('0x2c')]['key']};});_0x609fcc['model']=_[_0x29e0('0x28')](_0x56cf46,_0x29e0('0x26'));_0x609fcc[_0x29e0('0x2d')]=_[_0x29e0('0x2e')](_0x2ad3f4['query']);_0x609fcc['filters']=_[_0x29e0('0x2f')](_0x609fcc[_0x29e0('0x30')],_0x609fcc[_0x29e0('0x2d')]);_0x290173[_0x29e0('0x31')]=_[_0x29e0('0x2f')](_0x609fcc[_0x29e0('0x30')],qs['fields'](_0x2ad3f4['query'][_0x29e0('0x32')]));_0x290173[_0x29e0('0x31')]=_0x290173[_0x29e0('0x31')][_0x29e0('0x33')]?_0x290173[_0x29e0('0x31')]:_0x609fcc[_0x29e0('0x30')];if(!_0x2ad3f4['query']['hasOwnProperty'](_0x29e0('0x34'))){_0x290173[_0x29e0('0x1c')]=qs['limit'](_0x2ad3f4[_0x29e0('0x2d')][_0x29e0('0x1c')]);_0x290173[_0x29e0('0x1a')]=qs[_0x29e0('0x1a')](_0x2ad3f4[_0x29e0('0x2d')][_0x29e0('0x1a')]);}_0x290173[_0x29e0('0x35')]=qs[_0x29e0('0x36')](_0x2ad3f4[_0x29e0('0x2d')][_0x29e0('0x36')]);_0x290173['where']=qs['filters'](_[_0x29e0('0x37')](_0x2ad3f4[_0x29e0('0x2d')],_0x609fcc[_0x29e0('0x38')]),_0x56cf46);if(_0x2ad3f4[_0x29e0('0x2d')][_0x29e0('0x39')]){_0x290173[_0x29e0('0x3a')]=_['merge'](_0x290173[_0x29e0('0x3a')],{'$or':_[_0x29e0('0x28')](_0x56cf46,function(_0x402a8f){if(_0x402a8f[_0x29e0('0x2c')]!==_0x29e0('0x3b')){var _0x1854a9={};_0x1854a9[_0x402a8f[_0x29e0('0x26')]]={'$like':'%'+_0x2ad3f4[_0x29e0('0x2d')][_0x29e0('0x39')]+'%'};return _0x1854a9;}})});}_0x290173=_[_0x29e0('0x3c')]({},_0x290173,_0x2ad3f4[_0x29e0('0x3d')]);var _0x5f174e={'where':_0x290173[_0x29e0('0x3a')]};return db['SugarcrmField'][_0x29e0('0x1d')](_0x5f174e)[_0x29e0('0x22')](function(_0x11eaff){_0xb03f38[_0x29e0('0x1d')]=_0x11eaff;if(_0x2ad3f4['query'][_0x29e0('0x3e')]){_0x290173[_0x29e0('0x3f')]=[{'all':!![]}];}return db[_0x29e0('0x29')][_0x29e0('0x40')](_0x290173);})['then'](function(_0x27bcfa){_0xb03f38[_0x29e0('0x41')]=_0x27bcfa;return _0xb03f38;})['then'](respondWithFilteredResult(_0x4a20c3,_0x290173))[_0x29e0('0x42')](handleError(_0x4a20c3,null));};exports['show']=function(_0x33aa1d,_0x2298a8){var _0x708234={'raw':!![],'where':{'id':_0x33aa1d[_0x29e0('0x43')]['id']}},_0x114b99={};_0x114b99['model']=_[_0x29e0('0x2e')](db[_0x29e0('0x29')]['rawAttributes']);_0x114b99[_0x29e0('0x2d')]=_[_0x29e0('0x2e')](_0x33aa1d[_0x29e0('0x2d')]);_0x114b99[_0x29e0('0x38')]=_[_0x29e0('0x2f')](_0x114b99['model'],_0x114b99[_0x29e0('0x2d')]);_0x708234['attributes']=_['intersection'](_0x114b99[_0x29e0('0x30')],qs['fields'](_0x33aa1d[_0x29e0('0x2d')][_0x29e0('0x32')]));_0x708234['attributes']=_0x708234[_0x29e0('0x31')][_0x29e0('0x33')]?_0x708234[_0x29e0('0x31')]:_0x114b99[_0x29e0('0x30')];if(_0x33aa1d[_0x29e0('0x2d')][_0x29e0('0x3e')]){_0x708234['include']=[{'all':!![]}];}_0x708234=_[_0x29e0('0x3c')]({},_0x708234,_0x33aa1d[_0x29e0('0x3d')]);return db[_0x29e0('0x29')][_0x29e0('0x44')](_0x708234)[_0x29e0('0x22')](handleEntityNotFound(_0x2298a8,null))[_0x29e0('0x22')](respondWithResult(_0x2298a8,null))['catch'](handleError(_0x2298a8,null));};exports['create']=function(_0x499233,_0x378d59){return db[_0x29e0('0x29')][_0x29e0('0x45')](_0x499233[_0x29e0('0x46')],{})[_0x29e0('0x22')](respondWithResult(_0x378d59,0xc9))[_0x29e0('0x42')](handleError(_0x378d59,null));};exports[_0x29e0('0x21')]=function(_0x2e19fb,_0x234a40){if(_0x2e19fb['body']['id']){delete _0x2e19fb[_0x29e0('0x46')]['id'];}return db[_0x29e0('0x29')][_0x29e0('0x44')]({'where':{'id':_0x2e19fb[_0x29e0('0x43')]['id']}})[_0x29e0('0x22')](handleEntityNotFound(_0x234a40,null))[_0x29e0('0x22')](saveUpdates(_0x2e19fb['body'],null))[_0x29e0('0x22')](respondWithResult(_0x234a40,null))['catch'](handleError(_0x234a40,null));};exports[_0x29e0('0x23')]=function(_0x124b6d,_0x4cc6e3){return db[_0x29e0('0x29')]['find']({'where':{'id':_0x124b6d[_0x29e0('0x43')]['id']}})[_0x29e0('0x22')](handleEntityNotFound(_0x4cc6e3,null))[_0x29e0('0x22')](removeEntity(_0x4cc6e3,null))[_0x29e0('0x42')](handleError(_0x4cc6e3,null));};
\ No newline at end of file
index dcb2d75..a4235da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cf1=['sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x6fb239,_0x13003e){var _0x4c68b5=function(_0x39da81){while(--_0x39da81){_0x6fb239['push'](_0x6fb239['shift']());}};_0x4c68b5(++_0x13003e);}(_0x2cf1,0x1a7));var _0x12cf=function(_0x13d294,_0x550bef){_0x13d294=_0x13d294-0x0;var _0x10ec9c=_0x2cf1[_0x13d294];return _0x10ec9c;};'use strict';var _=require(_0x12cf('0x0'));var util=require(_0x12cf('0x1'));var logger=require(_0x12cf('0x2'))(_0x12cf('0x3'));var moment=require(_0x12cf('0x4'));var BPromise=require(_0x12cf('0x5'));var rp=require(_0x12cf('0x6'));var fs=require('fs');var path=require(_0x12cf('0x7'));var rimraf=require('rimraf');var config=require(_0x12cf('0x8'));var attributes=require(_0x12cf('0x9'));module[_0x12cf('0xa')]=function(_0x1d5d6f,_0xdb205a){return _0x1d5d6f['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x12cf('0xb'),'fields':[_0x12cf('0xc'),_0x12cf('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xab11=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0xfb39cc,_0x5df50f){var _0x484077=function(_0x420ab4){while(--_0x420ab4){_0xfb39cc['push'](_0xfb39cc['shift']());}};_0x484077(++_0x5df50f);}(_0xab11,0x11a));var _0x1ab1=function(_0x307789,_0x4b2e74){_0x307789=_0x307789-0x0;var _0x1d0491=_0xab11[_0x307789];return _0x1d0491;};'use strict';var _=require(_0x1ab1('0x0'));var util=require(_0x1ab1('0x1'));var logger=require('../../config/logger')(_0x1ab1('0x2'));var moment=require(_0x1ab1('0x3'));var BPromise=require(_0x1ab1('0x4'));var rp=require(_0x1ab1('0x5'));var fs=require('fs');var path=require(_0x1ab1('0x6'));var rimraf=require(_0x1ab1('0x7'));var config=require(_0x1ab1('0x8'));var attributes=require(_0x1ab1('0x9'));module[_0x1ab1('0xa')]=function(_0x4866f0,_0x1fc2a5){return _0x4866f0[_0x1ab1('0xb')](_0x1ab1('0xc'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x1ab1('0xd'),'fields':[_0x1ab1('0xe'),_0x1ab1('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 59687be..8948bb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4750=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x302640,_0x1b9bc7){var _0x1d3f3e=function(_0xfe832){while(--_0xfe832){_0x302640['push'](_0x302640['shift']());}};_0x1d3f3e(++_0x1b9bc7);}(_0x4750,0x109));var _0x0475=function(_0x3fb949,_0x25fa88){_0x3fb949=_0x3fb949-0x0;var _0x5ef8b8=_0x4750[_0x3fb949];return _0x5ef8b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0475('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0475('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x0475('0x2'));var logger=require('../../config/logger')(_0x0475('0x3'));var config=require(_0x0475('0x4'));var jayson=require(_0x0475('0x5'));var client=jayson[_0x0475('0x6')][_0x0475('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40d312,_0x25f393,_0x154e03){return new BPromise(function(_0xcffb5e,_0x3c926d){return client[_0x0475('0x8')](_0x40d312,_0x154e03)[_0x0475('0x9')](function(_0x179967){logger[_0x0475('0xa')](_0x0475('0xb'),_0x25f393,_0x0475('0xc'));logger[_0x0475('0xd')](_0x0475('0xe'),_0x25f393,_0x0475('0xc'),JSON[_0x0475('0xf')](_0x179967));if(_0x179967['error']){if(_0x179967[_0x0475('0x10')][_0x0475('0x11')]===0x1f4){logger['error'](_0x0475('0xb'),_0x25f393,_0x179967[_0x0475('0x10')]['message']);return _0x3c926d(_0x179967[_0x0475('0x10')][_0x0475('0x12')]);}logger[_0x0475('0x10')](_0x0475('0xb'),_0x25f393,_0x179967['error']['message']);return _0xcffb5e(_0x179967[_0x0475('0x10')][_0x0475('0x12')]);}else{logger[_0x0475('0xa')](_0x0475('0xb'),_0x25f393,_0x0475('0xc'));_0xcffb5e(_0x179967[_0x0475('0x13')][_0x0475('0x12')]);}})[_0x0475('0x14')](function(_0x4e4180){logger[_0x0475('0x10')](_0x0475('0xb'),_0x25f393,_0x4e4180);_0x3c926d(_0x4e4180);});});}
\ No newline at end of file
+var _0x3eb1=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4e0a03,_0x5eb6b0){var _0x2478fc=function(_0x59afcc){while(--_0x59afcc){_0x4e0a03['push'](_0x4e0a03['shift']());}};_0x2478fc(++_0x5eb6b0);}(_0x3eb1,0x7e));var _0x13eb=function(_0x1667df,_0x266940){_0x1667df=_0x1667df-0x0;var _0x341abf=_0x3eb1[_0x1667df];return _0x341abf;};'use strict';var _=require(_0x13eb('0x0'));var util=require(_0x13eb('0x1'));var moment=require('moment');var BPromise=require(_0x13eb('0x2'));var rs=require(_0x13eb('0x3'));var fs=require('fs');var Redis=require(_0x13eb('0x4'));var db=require(_0x13eb('0x5'))['db'];var utils=require(_0x13eb('0x6'));var logger=require('../../config/logger')(_0x13eb('0x7'));var config=require(_0x13eb('0x8'));var jayson=require(_0x13eb('0x9'));var client=jayson[_0x13eb('0xa')][_0x13eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x75a873,_0x4a530f,_0x18d4cf){return new BPromise(function(_0x4210c9,_0x26af4b){return client[_0x13eb('0xc')](_0x75a873,_0x18d4cf)['then'](function(_0x8a1974){logger[_0x13eb('0xd')](_0x13eb('0xe'),_0x4a530f,'request\x20sent');logger[_0x13eb('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x4a530f,'request\x20sent',JSON[_0x13eb('0x10')](_0x8a1974));if(_0x8a1974['error']){if(_0x8a1974[_0x13eb('0x11')][_0x13eb('0x12')]===0x1f4){logger[_0x13eb('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x4a530f,_0x8a1974[_0x13eb('0x11')][_0x13eb('0x13')]);return _0x26af4b(_0x8a1974[_0x13eb('0x11')][_0x13eb('0x13')]);}logger[_0x13eb('0x11')](_0x13eb('0xe'),_0x4a530f,_0x8a1974[_0x13eb('0x11')][_0x13eb('0x13')]);return _0x4210c9(_0x8a1974[_0x13eb('0x11')][_0x13eb('0x13')]);}else{logger['info'](_0x13eb('0xe'),_0x4a530f,_0x13eb('0x14'));_0x4210c9(_0x8a1974[_0x13eb('0x15')][_0x13eb('0x13')]);}})['catch'](function(_0x312caf){logger[_0x13eb('0x11')](_0x13eb('0xe'),_0x4a530f,_0x312caf);_0x26af4b(_0x312caf);});});}
\ No newline at end of file
index 1a0221a..155fb4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3379=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','destroy'];(function(_0x2500ac,_0x27dd55){var _0x483f6d=function(_0xd7be38){while(--_0xd7be38){_0x2500ac['push'](_0x2500ac['shift']());}};_0x483f6d(++_0x27dd55);}(_0x3379,0x115));var _0x9337=function(_0x4333ff,_0x54d7e0){_0x4333ff=_0x4333ff-0x0;var _0x13e41a=_0x3379[_0x4333ff];return _0x13e41a;};'use strict';var multer=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var path=require(_0x9337('0x2'));var timeout=require(_0x9337('0x3'));var express=require('express');var router=express[_0x9337('0x4')]();var fs_extra=require(_0x9337('0x5'));var auth=require(_0x9337('0x6'));var interaction=require(_0x9337('0x7'));var config=require('../../config/environment');var controller=require(_0x9337('0x8'));router[_0x9337('0x9')]('/',auth[_0x9337('0xa')](),controller[_0x9337('0xb')]);router['get'](_0x9337('0xc'),auth['isAuthenticated'](),controller[_0x9337('0xd')]);router[_0x9337('0x9')](_0x9337('0xe'),auth[_0x9337('0xa')](),controller[_0x9337('0xf')]);router['get'](_0x9337('0x10'),auth[_0x9337('0xa')](),controller[_0x9337('0x11')]);router[_0x9337('0x12')]('/',auth[_0x9337('0xa')](),controller['create']);router[_0x9337('0x12')](_0x9337('0xe'),auth[_0x9337('0xa')](),controller[_0x9337('0x13')]);router[_0x9337('0x14')](_0x9337('0xc'),auth[_0x9337('0xa')](),controller['update']);router['delete'](_0x9337('0xc'),auth[_0x9337('0xa')](),controller[_0x9337('0x15')]);module[_0x9337('0x16')]=router;
\ No newline at end of file
+var _0xc694=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get'];(function(_0x451727,_0x4efe49){var _0x3ce3b6=function(_0x139a58){while(--_0x139a58){_0x451727['push'](_0x451727['shift']());}};_0x3ce3b6(++_0x4efe49);}(_0xc694,0x11e));var _0x4c69=function(_0x4dd063,_0x386d0c){_0x4dd063=_0x4dd063-0x0;var _0x2b8747=_0xc694[_0x4dd063];return _0x2b8747;};'use strict';var multer=require(_0x4c69('0x0'));var util=require(_0x4c69('0x1'));var path=require(_0x4c69('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c69('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4c69('0x4'));var interaction=require(_0x4c69('0x5'));var config=require('../../config/environment');var controller=require(_0x4c69('0x6'));router[_0x4c69('0x7')]('/',auth[_0x4c69('0x8')](),controller[_0x4c69('0x9')]);router[_0x4c69('0x7')](_0x4c69('0xa'),auth[_0x4c69('0x8')](),controller[_0x4c69('0xb')]);router[_0x4c69('0x7')](_0x4c69('0xc'),auth[_0x4c69('0x8')](),controller[_0x4c69('0xd')]);router[_0x4c69('0x7')](_0x4c69('0xe'),auth['isAuthenticated'](),controller[_0x4c69('0xf')]);router[_0x4c69('0x10')]('/',auth[_0x4c69('0x8')](),controller[_0x4c69('0x11')]);router['post'](_0x4c69('0xc'),auth[_0x4c69('0x8')](),controller['addConfiguration']);router[_0x4c69('0x12')](_0x4c69('0xa'),auth[_0x4c69('0x8')](),controller['update']);router[_0x4c69('0x13')](_0x4c69('0xa'),auth[_0x4c69('0x8')](),controller['destroy']);module[_0x4c69('0x14')]=router;
\ No newline at end of file
index 476dfe8..e648804 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39ed=['exports','STRING','HelpDesk','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x39ed,0x183));var _0xd39e=function(_0x5a0ba4,_0x468168){_0x5a0ba4=_0x5a0ba4-0x0;var _0x157c77=_0x39ed[_0x5a0ba4];return _0x157c77;};'use strict';var Sequelize=require(_0xd39e('0x0'));module[_0xd39e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd39e('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd39e('0x3')},'remoteUri':{'type':Sequelize[_0xd39e('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd39e('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x92a8=['HelpDesk','sequelize','exports','STRING'];(function(_0x58950e,_0x482a2f){var _0x460249=function(_0x40d271){while(--_0x40d271){_0x58950e['push'](_0x58950e['shift']());}};_0x460249(++_0x482a2f);}(_0x92a8,0x1b5));var _0x892a=function(_0x49ca6b,_0x3ba842){_0x49ca6b=_0x49ca6b-0x0;var _0x1d957f=_0x92a8[_0x49ca6b];return _0x1d957f;};'use strict';var Sequelize=require(_0x892a('0x0'));module[_0x892a('0x1')]={'name':{'type':Sequelize[_0x892a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x892a('0x2')]},'username':{'type':Sequelize[_0x892a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x892a('0x3')},'remoteUri':{'type':Sequelize[_0x892a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x892a('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x892a('0x2')],'allowNull':![]}};
\ No newline at end of file
index d09a0d9..e6d3cbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaba=['AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','autogenerated','reference','remove','includes','result','editable','false','label','startsWith','cf_','picklistValues','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','type','key','query','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfaba,0x19a));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xafab('0x0'));var rp=require(_0xafab('0x1'));var moment=require(_0xafab('0x2'));var BPromise=require(_0xafab('0x3'));var Mustache=require(_0xafab('0x4'));var util=require(_0xafab('0x5'));var path=require(_0xafab('0x6'));var sox=require('sox');var csv=require(_0xafab('0x7'));var ejs=require(_0xafab('0x8'));var fs=require('fs');var fs_extra=require(_0xafab('0x9'));var _=require(_0xafab('0xa'));var squel=require(_0xafab('0xb'));var crypto=require(_0xafab('0xc'));var jsforce=require(_0xafab('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xafab('0x7'));var querystring=require(_0xafab('0xe'));var Papa=require(_0xafab('0xf'));var Redis=require(_0xafab('0x10'));var authService=require(_0xafab('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xafab('0x12'));var hardwareService=require(_0xafab('0x13'));var logger=require(_0xafab('0x14'))(_0xafab('0x15'));var utils=require(_0xafab('0x16'));var config=require(_0xafab('0x17'));var licenseUtil=require(_0xafab('0x18'));var db=require(_0xafab('0x19'))['db'];var integrations=require(_0xafab('0x1a'));function respondWithStatusCode(_0x3d0e8f,_0x43ab0d){_0x43ab0d=_0x43ab0d||0xcc;return function(_0x5718f9){if(_0x5718f9){return _0x3d0e8f[_0xafab('0x1b')](_0x43ab0d);}return _0x3d0e8f[_0xafab('0x1c')](_0x43ab0d)[_0xafab('0x1d')]();};}function respondWithResult(_0x42b5e7,_0x293084){_0x293084=_0x293084||0xc8;return function(_0x1a94a4){if(_0x1a94a4){return _0x42b5e7[_0xafab('0x1c')](_0x293084)[_0xafab('0x1e')](_0x1a94a4);}};}function respondWithFilteredResult(_0x4a166b,_0x56be60){return function(_0x42256f){if(_0x42256f){var _0xc6856c=typeof _0x56be60[_0xafab('0x1f')]===_0xafab('0x20')&&typeof _0x56be60['limit']===_0xafab('0x20');var _0x4d122d=_0x42256f['count'];var _0x1e89bd=_0xc6856c?0x0:_0x56be60[_0xafab('0x1f')];var _0x5ae29c=_0xc6856c?_0x42256f[_0xafab('0x21')]:_0x56be60[_0xafab('0x1f')]+_0x56be60[_0xafab('0x22')];var _0x10e8b6;if(_0x5ae29c>=_0x4d122d){_0x5ae29c=_0x4d122d;_0x10e8b6=0xc8;}else{_0x10e8b6=0xce;}_0x4a166b[_0xafab('0x1c')](_0x10e8b6);return _0x4a166b['set'](_0xafab('0x23'),_0x1e89bd+'-'+_0x5ae29c+'/'+_0x4d122d)['json'](_0x42256f);}return null;};}function patchUpdates(_0x3fab2a){return function(_0x490d46){try{jsonpatch[_0xafab('0x24')](_0x490d46,_0x3fab2a,!![]);}catch(_0x55a69d){return BPromise['reject'](_0x55a69d);}return _0x490d46['save']();};}function saveUpdates(_0x36c6c2,_0x5c4383){return function(_0x19fe7b){if(_0x19fe7b){return _0x19fe7b[_0xafab('0x25')](_0x36c6c2)['then'](function(_0x339924){return _0x339924;});}return null;};}function removeEntity(_0x1b6822,_0x2d660f){return function(_0x2ee4bc){if(_0x2ee4bc){return _0x2ee4bc[_0xafab('0x26')]()[_0xafab('0x27')](function(){_0x1b6822[_0xafab('0x1c')](0xcc)[_0xafab('0x1d')]();});}};}function handleEntityNotFound(_0x174b26,_0x433ee3){return function(_0x35a8b9){if(!_0x35a8b9){_0x174b26[_0xafab('0x1b')](0x194);}return _0x35a8b9;};}function handleError(_0x20a871,_0x3f9b12){_0x3f9b12=_0x3f9b12||0x1f4;return function(_0x171e5a){logger[_0xafab('0x28')](_0x171e5a[_0xafab('0x29')]);if(_0x171e5a[_0xafab('0x2a')]){delete _0x171e5a['name'];}_0x20a871['status'](_0x3f9b12)[_0xafab('0x2b')](_0x171e5a);};}exports[_0xafab('0x2c')]=function(_0x2991de,_0x567675){var _0x1b8b9d={},_0x51c131={},_0x30ac6={'count':0x0,'rows':[]};var _0x1e1458=_[_0xafab('0x2d')](db[_0xafab('0x2e')][_0xafab('0x2f')],function(_0x22ae34){return{'name':_0x22ae34['fieldName'],'type':_0x22ae34[_0xafab('0x30')][_0xafab('0x31')]};});_0x51c131['model']=_[_0xafab('0x2d')](_0x1e1458,_0xafab('0x2a'));_0x51c131[_0xafab('0x32')]=_['keys'](_0x2991de['query']);_0x51c131['filters']=_[_0xafab('0x33')](_0x51c131[_0xafab('0x34')],_0x51c131[_0xafab('0x32')]);_0x1b8b9d[_0xafab('0x35')]=_[_0xafab('0x33')](_0x51c131[_0xafab('0x34')],qs[_0xafab('0x36')](_0x2991de[_0xafab('0x32')][_0xafab('0x36')]));_0x1b8b9d[_0xafab('0x35')]=_0x1b8b9d[_0xafab('0x35')][_0xafab('0x37')]?_0x1b8b9d[_0xafab('0x35')]:_0x51c131['model'];if(!_0x2991de['query']['hasOwnProperty'](_0xafab('0x38'))){_0x1b8b9d[_0xafab('0x22')]=qs['limit'](_0x2991de[_0xafab('0x32')][_0xafab('0x22')]);_0x1b8b9d[_0xafab('0x1f')]=qs[_0xafab('0x1f')](_0x2991de[_0xafab('0x32')][_0xafab('0x1f')]);}_0x1b8b9d[_0xafab('0x39')]=qs[_0xafab('0x3a')](_0x2991de[_0xafab('0x32')]['sort']);_0x1b8b9d['where']=qs[_0xafab('0x3b')](_[_0xafab('0x3c')](_0x2991de['query'],_0x51c131['filters']),_0x1e1458);if(_0x2991de[_0xafab('0x32')][_0xafab('0x3d')]){_0x1b8b9d[_0xafab('0x3e')]=_[_0xafab('0x3f')](_0x1b8b9d['where'],{'$or':_[_0xafab('0x2d')](_0x1e1458,function(_0x49f9a0){if(_0x49f9a0[_0xafab('0x30')]!==_0xafab('0x40')){var _0xa61e96={};_0xa61e96[_0x49f9a0[_0xafab('0x2a')]]={'$like':'%'+_0x2991de[_0xafab('0x32')][_0xafab('0x3d')]+'%'};return _0xa61e96;}})});}_0x1b8b9d=_[_0xafab('0x3f')]({},_0x1b8b9d,_0x2991de[_0xafab('0x41')]);var _0xeceea4={'where':_0x1b8b9d[_0xafab('0x3e')]};return db[_0xafab('0x2e')]['count'](_0xeceea4)['then'](function(_0x18f58f){_0x30ac6[_0xafab('0x21')]=_0x18f58f;if(_0x2991de[_0xafab('0x32')]['includeAll']){_0x1b8b9d[_0xafab('0x42')]=[{'all':!![]}];}return db[_0xafab('0x2e')][_0xafab('0x43')](_0x1b8b9d);})[_0xafab('0x27')](function(_0x2e1bfc){_0x30ac6[_0xafab('0x44')]=_0x2e1bfc;return _0x30ac6;})['then'](respondWithFilteredResult(_0x567675,_0x1b8b9d))[_0xafab('0x45')](handleError(_0x567675,null));};exports[_0xafab('0x46')]=function(_0x20da75,_0x4cb49e){var _0x3a3fae={'raw':![],'where':{'id':_0x20da75[_0xafab('0x47')]['id']}},_0x3b03de={};_0x3b03de[_0xafab('0x34')]=_['keys'](db[_0xafab('0x2e')][_0xafab('0x2f')]);_0x3b03de[_0xafab('0x32')]=_[_0xafab('0x48')](_0x20da75[_0xafab('0x32')]);_0x3b03de[_0xafab('0x3b')]=_['intersection'](_0x3b03de[_0xafab('0x34')],_0x3b03de[_0xafab('0x32')]);_0x3a3fae[_0xafab('0x35')]=_['intersection'](_0x3b03de[_0xafab('0x34')],qs[_0xafab('0x36')](_0x20da75[_0xafab('0x32')][_0xafab('0x36')]));_0x3a3fae[_0xafab('0x35')]=_0x3a3fae[_0xafab('0x35')][_0xafab('0x37')]?_0x3a3fae[_0xafab('0x35')]:_0x3b03de[_0xafab('0x34')];if(_0x20da75[_0xafab('0x32')][_0xafab('0x49')]){_0x3a3fae[_0xafab('0x42')]=[{'all':!![]}];}_0x3a3fae=_[_0xafab('0x3f')]({},_0x3a3fae,_0x20da75[_0xafab('0x41')]);return db[_0xafab('0x2e')][_0xafab('0x4a')](_0x3a3fae)['then'](handleEntityNotFound(_0x4cb49e,null))[_0xafab('0x27')](respondWithResult(_0x4cb49e,null))[_0xafab('0x45')](handleError(_0x4cb49e,null));};exports[_0xafab('0x4b')]=function(_0x4ed2a3,_0x565bb9){return db[_0xafab('0x2e')][_0xafab('0x4b')](_0x4ed2a3[_0xafab('0x4c')],{})['then'](respondWithResult(_0x565bb9,0xc9))[_0xafab('0x45')](handleError(_0x565bb9,null));};exports[_0xafab('0x25')]=function(_0x39bae9,_0x365b93){if(_0x39bae9[_0xafab('0x4c')]['id']){delete _0x39bae9[_0xafab('0x4c')]['id'];}return db[_0xafab('0x2e')][_0xafab('0x4a')]({'where':{'id':_0x39bae9['params']['id']}})[_0xafab('0x27')](handleEntityNotFound(_0x365b93,null))[_0xafab('0x27')](saveUpdates(_0x39bae9['body'],null))[_0xafab('0x27')](respondWithResult(_0x365b93,null))['catch'](handleError(_0x365b93,null));};exports[_0xafab('0x26')]=function(_0x242dbd,_0x1d8b35){return db[_0xafab('0x2e')][_0xafab('0x4a')]({'where':{'id':_0x242dbd[_0xafab('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d8b35,null))[_0xafab('0x27')](removeEntity(_0x1d8b35,null))[_0xafab('0x45')](handleError(_0x1d8b35,null));};exports[_0xafab('0x4d')]=function(_0x360eae,_0x3091cb,_0x53df83){var _0x2a9513={};var _0x3b6a7b={};var _0x1c7fb0;var _0x15220c;return db[_0xafab('0x2e')][_0xafab('0x4e')]({'where':{'id':_0x360eae[_0xafab('0x47')]['id']}})[_0xafab('0x27')](handleEntityNotFound(_0x3091cb,null))['then'](function(_0x3f4f92){if(_0x3f4f92){_0x1c7fb0=_0x3f4f92;_0x3b6a7b[_0xafab('0x34')]=_[_0xafab('0x48')](db[_0xafab('0x4f')]['rawAttributes']);_0x3b6a7b[_0xafab('0x32')]=_[_0xafab('0x48')](_0x360eae[_0xafab('0x32')]);_0x3b6a7b[_0xafab('0x3b')]=_['intersection'](_0x3b6a7b[_0xafab('0x34')],_0x3b6a7b[_0xafab('0x32')]);_0x2a9513['attributes']=_['intersection'](_0x3b6a7b[_0xafab('0x34')],qs[_0xafab('0x36')](_0x360eae[_0xafab('0x32')][_0xafab('0x36')]));_0x2a9513['attributes']=_0x2a9513[_0xafab('0x35')][_0xafab('0x37')]?_0x2a9513[_0xafab('0x35')]:_0x3b6a7b[_0xafab('0x34')];_0x2a9513[_0xafab('0x39')]=qs[_0xafab('0x3a')](_0x360eae[_0xafab('0x32')][_0xafab('0x3a')]);_0x2a9513[_0xafab('0x3e')]=qs[_0xafab('0x3b')](_[_0xafab('0x3c')](_0x360eae[_0xafab('0x32')],_0x3b6a7b[_0xafab('0x3b')]));if(_0x360eae[_0xafab('0x32')][_0xafab('0x3d')]){_0x2a9513['where']=_['merge'](_0x2a9513[_0xafab('0x3e')],{'$or':_[_0xafab('0x2d')](_0x2a9513[_0xafab('0x35')],function(_0x389802){var _0x2bfe7e={};_0x2bfe7e[_0x389802]={'$like':'%'+_0x360eae[_0xafab('0x32')]['filter']+'%'};return _0x2bfe7e;})});}_0x2a9513=_['merge']({},_0x2a9513,_0x360eae[_0xafab('0x41')]);return _0x1c7fb0[_0xafab('0x4d')](_0x2a9513);}})[_0xafab('0x27')](function(_0x80916){if(_0x80916){_0x15220c=_0x80916[_0xafab('0x37')];if(!_0x360eae[_0xafab('0x32')][_0xafab('0x50')](_0xafab('0x38'))){_0x2a9513[_0xafab('0x22')]=qs[_0xafab('0x22')](_0x360eae[_0xafab('0x32')]['limit']);_0x2a9513['offset']=qs['offset'](_0x360eae[_0xafab('0x32')]['offset']);}return _0x1c7fb0[_0xafab('0x4d')](_0x2a9513);}})['then'](function(_0x565943){if(_0x565943){return _0x565943?{'count':_0x15220c,'rows':_0x565943}:null;}})['then'](respondWithResult(_0x3091cb,null))[_0xafab('0x45')](handleError(_0x3091cb,null));};exports[_0xafab('0x51')]=function(_0x1cac39,_0x3cb83e,_0x181b56){if(_0x1cac39[_0xafab('0x4c')]['id']){delete _0x1cac39[_0xafab('0x4c')]['id'];}return db[_0xafab('0x2e')][_0xafab('0x4e')]({'where':{'id':_0x1cac39['params']['id']}})[_0xafab('0x27')](handleEntityNotFound(_0x3cb83e,null))[_0xafab('0x27')](function(_0x25c437){if(_0x25c437){_0x1cac39[_0xafab('0x4c')][_0xafab('0x52')]=_0x25c437['id'];_0x1cac39[_0xafab('0x4c')][_0xafab('0x53')]=integrations[_0xafab('0x54')](_0x1cac39[_0xafab('0x4c')][_0xafab('0x55')],_0x1cac39[_0xafab('0x4c')][_0xafab('0x30')]);_0x1cac39[_0xafab('0x4c')][_0xafab('0x56')]=integrations[_0xafab('0x57')](_0x1cac39['body'][_0xafab('0x55')],_0x1cac39[_0xafab('0x4c')][_0xafab('0x30')]);return db[_0xafab('0x4f')][_0xafab('0x4b')](_0x1cac39[_0xafab('0x4c')],{'include':[{'model':db['VtigerField'],'as':_0xafab('0x53')},{'model':db[_0xafab('0x58')],'as':_0xafab('0x56')}]});}return null;})[_0xafab('0x27')](respondWithResult(_0x3cb83e,null))[_0xafab('0x45')](handleError(_0x3cb83e,null));};var md5=require(_0xafab('0x59'));exports[_0xafab('0x5a')]=function(_0x38e122,_0x309be7,_0x7686b9){var _0x2bd512=null;var _0x1ca3cd=null;var _0x1e8e82=null;var _0x26490f=null;var _0x1e1e64='';return db[_0xafab('0x2e')][_0xafab('0x4e')]({'where':{'id':_0x38e122[_0xafab('0x47')]['id']},'attributes':['id','name',_0xafab('0x5b'),_0xafab('0x5c'),_0xafab('0x5d'),_0xafab('0x5e'),'serverUrl',_0xafab('0x5f')]})[_0xafab('0x27')](handleEntityNotFound(_0x309be7,null))[_0xafab('0x27')](function(_0x15b9fa){if(_0x15b9fa){_0x2bd512=_0x15b9fa[_0xafab('0x5b')];_0x1ca3cd=_0x15b9fa[_0xafab('0x5f')];_0x1e8e82=_0x15b9fa[_0xafab('0x5d')];_0x1e1e64=_0x15b9fa[_0xafab('0x5e')];var _0x3b91f0=_0x1e1e64['slice'](-0x1);if(_0x3b91f0==='/'){_0x1e1e64=_0x1e1e64[_0xafab('0x60')](0x0,_0x1e1e64[_0xafab('0x61')](_0x3b91f0));}_0x26490f=util[_0xafab('0x62')](_0xafab('0x63'),_0x1e1e64);var _0x4b2f47={'method':_0xafab('0x64'),'uri':_0x26490f,'qs':{'operation':_0xafab('0x65'),'username':_0x15b9fa[_0xafab('0x5b')]},'json':!![]};return rp(_0x4b2f47);}})[_0xafab('0x27')](function(_0x517aa5){if(_0x517aa5[_0xafab('0x66')]){var _0x4d0ceb={'method':_0xafab('0x67'),'uri':_0x26490f,'form':{'operation':_0xafab('0x68'),'username':_0x2bd512,'accessKey':md5(_0x517aa5['result'][_0xafab('0x69')]+_0x1ca3cd)},'json':!![]};return rp(_0x4d0ceb);}})[_0xafab('0x27')](function(_0x5b4e61){if(_0x5b4e61[_0xafab('0x66')]){var _0x2779b6={'method':'GET','uri':_0x26490f,'qs':{'operation':'describe','username':_0x2bd512,'sessionName':_0x5b4e61['result']['sessionName'],'elementType':_0x1e8e82},'json':!![]};return rp(_0x2779b6);}})['then'](function(_0x428451){if(_0x428451[_0xafab('0x66')]){var _0x132f57=[_0xafab('0x6a'),_0xafab('0x6b'),'owner'];_[_0xafab('0x6c')](_0x428451['result'][_0xafab('0x36')],function(_0x1fe753){return _0x132f57[_0xafab('0x6d')](_0x1fe753[_0xafab('0x30')][_0xafab('0x2a')]);});_[_0xafab('0x6c')](_0x428451[_0xafab('0x6e')][_0xafab('0x36')],function(_0x4ec0c8){return _0x4ec0c8[_0xafab('0x6f')]===_0xafab('0x70');});return{'count':_0x428451[_0xafab('0x6e')][_0xafab('0x36')]['length'],'rows':_[_0xafab('0x2d')](_0x428451[_0xafab('0x6e')][_0xafab('0x36')],function(_0x3014c8){return{'id':_0x3014c8['name'],'name':_0x3014c8[_0xafab('0x71')],'custom':_[_0xafab('0x72')](_0x3014c8['name'],_0xafab('0x73'))?!![]:![],'options':_0x3014c8['type'][_0xafab('0x2a')]==='picklist'&&_0x3014c8[_0xafab('0x30')][_0xafab('0x74')][_0xafab('0x37')]>0x0?_[_0xafab('0x2d')](_0x3014c8[_0xafab('0x30')][_0xafab('0x74')],function(_0x2964c3){return{'name':_0x2964c3[_0xafab('0x71')],'value':_0x2964c3['value']};}):[]};})};}})[_0xafab('0x27')](respondWithResult(_0x309be7,null))[_0xafab('0x45')](function(_0x178c0f){console[_0xafab('0x75')]('vTiger\x20error:\x20'+_0x178c0f);var _0x433546=_0x38e122[_0xafab('0x32')][_0xafab('0x76')]?0x1f4:_0x178c0f[_0xafab('0x77')]||0x1f4;logger[_0xafab('0x28')](_0xafab('0x78'),_0xafab('0x5a'),_0x433546,JSON[_0xafab('0x79')](_0x178c0f));delete _0x178c0f[_0xafab('0x2a')];if(_0x433546===0x191){_0x433546=0x190;}_0x309be7[_0xafab('0x1c')](_0x433546)['send'](_0x38e122[_0xafab('0x32')][_0xafab('0x76')]?{'message':_0xafab('0x7a'),'statusCode':_0x178c0f[_0xafab('0x77')]}:_0x178c0f);});};
\ No newline at end of file
+var _0xd9fd=['VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','include','findAll','rows','params','fields','options','find','catch','create','body','getConfigurations','findOne','VtigerConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','description','remoteUri','accessKey','username','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','success','POST','login','result','GET','describe','autogenerated','owner','includes','remove','editable','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x2e902b,_0x30f6c6){var _0x5408a3=function(_0x406463){while(--_0x406463){_0x2e902b['push'](_0x2e902b['shift']());}};_0x5408a3(++_0x30f6c6);}(_0xd9fd,0x141));var _0xdd9f=function(_0x1fa512,_0x58d968){_0x1fa512=_0x1fa512-0x0;var _0x3ca707=_0xd9fd[_0x1fa512];return _0x3ca707;};'use strict';var emlformat=require(_0xdd9f('0x0'));var rimraf=require(_0xdd9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd9f('0x2'));var rp=require(_0xdd9f('0x3'));var moment=require('moment');var BPromise=require(_0xdd9f('0x4'));var Mustache=require(_0xdd9f('0x5'));var util=require('util');var path=require(_0xdd9f('0x6'));var sox=require('sox');var csv=require(_0xdd9f('0x7'));var ejs=require(_0xdd9f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd9f('0x9'));var squel=require('squel');var crypto=require(_0xdd9f('0xa'));var jsforce=require(_0xdd9f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdd9f('0xc'));var Papa=require(_0xdd9f('0xd'));var Redis=require(_0xdd9f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdd9f('0xf'));var as=require(_0xdd9f('0x10'));var hardwareService=require(_0xdd9f('0x11'));var logger=require(_0xdd9f('0x12'))(_0xdd9f('0x13'));var utils=require(_0xdd9f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdd9f('0x15'));var db=require(_0xdd9f('0x16'))['db'];var integrations=require(_0xdd9f('0x17'));function respondWithStatusCode(_0x40f625,_0x33201b){_0x33201b=_0x33201b||0xcc;return function(_0x3b4606){if(_0x3b4606){return _0x40f625[_0xdd9f('0x18')](_0x33201b);}return _0x40f625[_0xdd9f('0x19')](_0x33201b)[_0xdd9f('0x1a')]();};}function respondWithResult(_0x1d517c,_0x47d68d){_0x47d68d=_0x47d68d||0xc8;return function(_0x44cdaf){if(_0x44cdaf){return _0x1d517c['status'](_0x47d68d)['json'](_0x44cdaf);}};}function respondWithFilteredResult(_0xa915ff,_0x29d65c){return function(_0x58cad7){if(_0x58cad7){var _0x2bc290=typeof _0x29d65c[_0xdd9f('0x1b')]===_0xdd9f('0x1c')&&typeof _0x29d65c[_0xdd9f('0x1d')]==='undefined';var _0x425b15=_0x58cad7[_0xdd9f('0x1e')];var _0x2cbf08=_0x2bc290?0x0:_0x29d65c['offset'];var _0x1ed4c6=_0x2bc290?_0x58cad7['count']:_0x29d65c['offset']+_0x29d65c['limit'];var _0x36d075;if(_0x1ed4c6>=_0x425b15){_0x1ed4c6=_0x425b15;_0x36d075=0xc8;}else{_0x36d075=0xce;}_0xa915ff[_0xdd9f('0x19')](_0x36d075);return _0xa915ff['set'](_0xdd9f('0x1f'),_0x2cbf08+'-'+_0x1ed4c6+'/'+_0x425b15)[_0xdd9f('0x20')](_0x58cad7);}return null;};}function patchUpdates(_0xe2c684){return function(_0x5aeb5d){try{jsonpatch[_0xdd9f('0x21')](_0x5aeb5d,_0xe2c684,!![]);}catch(_0x5f2bcb){return BPromise[_0xdd9f('0x22')](_0x5f2bcb);}return _0x5aeb5d[_0xdd9f('0x23')]();};}function saveUpdates(_0x3b1ce3,_0x2f8060){return function(_0x2316b8){if(_0x2316b8){return _0x2316b8[_0xdd9f('0x24')](_0x3b1ce3)[_0xdd9f('0x25')](function(_0x5b7642){return _0x5b7642;});}return null;};}function removeEntity(_0x64acdf,_0x3dc6bb){return function(_0x2c165f){if(_0x2c165f){return _0x2c165f[_0xdd9f('0x26')]()['then'](function(){_0x64acdf[_0xdd9f('0x19')](0xcc)[_0xdd9f('0x1a')]();});}};}function handleEntityNotFound(_0x1051c9,_0x430066){return function(_0x4c9332){if(!_0x4c9332){_0x1051c9[_0xdd9f('0x18')](0x194);}return _0x4c9332;};}function handleError(_0x242737,_0x3033a5){_0x3033a5=_0x3033a5||0x1f4;return function(_0x1a4e26){logger[_0xdd9f('0x27')](_0x1a4e26[_0xdd9f('0x28')]);if(_0x1a4e26[_0xdd9f('0x29')]){delete _0x1a4e26[_0xdd9f('0x29')];}_0x242737[_0xdd9f('0x19')](_0x3033a5)[_0xdd9f('0x2a')](_0x1a4e26);};}exports[_0xdd9f('0x2b')]=function(_0x47240c,_0x2eed6a){var _0x2e598d={},_0x30140b={},_0xc8ec00={'count':0x0,'rows':[]};var _0x1e3387=_[_0xdd9f('0x2c')](db[_0xdd9f('0x2d')][_0xdd9f('0x2e')],function(_0x1d540c){return{'name':_0x1d540c[_0xdd9f('0x2f')],'type':_0x1d540c['type'][_0xdd9f('0x30')]};});_0x30140b[_0xdd9f('0x31')]=_[_0xdd9f('0x2c')](_0x1e3387,'name');_0x30140b[_0xdd9f('0x32')]=_[_0xdd9f('0x33')](_0x47240c[_0xdd9f('0x32')]);_0x30140b[_0xdd9f('0x34')]=_['intersection'](_0x30140b[_0xdd9f('0x31')],_0x30140b[_0xdd9f('0x32')]);_0x2e598d[_0xdd9f('0x35')]=_[_0xdd9f('0x36')](_0x30140b[_0xdd9f('0x31')],qs['fields'](_0x47240c['query']['fields']));_0x2e598d['attributes']=_0x2e598d[_0xdd9f('0x35')][_0xdd9f('0x37')]?_0x2e598d[_0xdd9f('0x35')]:_0x30140b['model'];if(!_0x47240c[_0xdd9f('0x32')][_0xdd9f('0x38')](_0xdd9f('0x39'))){_0x2e598d['limit']=qs[_0xdd9f('0x1d')](_0x47240c[_0xdd9f('0x32')][_0xdd9f('0x1d')]);_0x2e598d[_0xdd9f('0x1b')]=qs[_0xdd9f('0x1b')](_0x47240c[_0xdd9f('0x32')][_0xdd9f('0x1b')]);}_0x2e598d['order']=qs[_0xdd9f('0x3a')](_0x47240c[_0xdd9f('0x32')]['sort']);_0x2e598d['where']=qs[_0xdd9f('0x34')](_[_0xdd9f('0x3b')](_0x47240c[_0xdd9f('0x32')],_0x30140b['filters']),_0x1e3387);if(_0x47240c[_0xdd9f('0x32')][_0xdd9f('0x3c')]){_0x2e598d[_0xdd9f('0x3d')]=_[_0xdd9f('0x3e')](_0x2e598d[_0xdd9f('0x3d')],{'$or':_[_0xdd9f('0x2c')](_0x1e3387,function(_0x307c46){if(_0x307c46[_0xdd9f('0x3f')]!=='VIRTUAL'){var _0xcda4a8={};_0xcda4a8[_0x307c46['name']]={'$like':'%'+_0x47240c[_0xdd9f('0x32')][_0xdd9f('0x3c')]+'%'};return _0xcda4a8;}})});}_0x2e598d=_['merge']({},_0x2e598d,_0x47240c['options']);var _0x4fcb90={'where':_0x2e598d[_0xdd9f('0x3d')]};return db[_0xdd9f('0x2d')]['count'](_0x4fcb90)[_0xdd9f('0x25')](function(_0x4321e9){_0xc8ec00['count']=_0x4321e9;if(_0x47240c[_0xdd9f('0x32')]['includeAll']){_0x2e598d[_0xdd9f('0x40')]=[{'all':!![]}];}return db[_0xdd9f('0x2d')][_0xdd9f('0x41')](_0x2e598d);})[_0xdd9f('0x25')](function(_0x374920){_0xc8ec00[_0xdd9f('0x42')]=_0x374920;return _0xc8ec00;})[_0xdd9f('0x25')](respondWithFilteredResult(_0x2eed6a,_0x2e598d))['catch'](handleError(_0x2eed6a,null));};exports['show']=function(_0x1972e6,_0x1e0d1f){var _0xb2bf2d={'raw':![],'where':{'id':_0x1972e6[_0xdd9f('0x43')]['id']}},_0x325c86={};_0x325c86[_0xdd9f('0x31')]=_[_0xdd9f('0x33')](db['VtigerAccount']['rawAttributes']);_0x325c86[_0xdd9f('0x32')]=_['keys'](_0x1972e6[_0xdd9f('0x32')]);_0x325c86['filters']=_[_0xdd9f('0x36')](_0x325c86[_0xdd9f('0x31')],_0x325c86[_0xdd9f('0x32')]);_0xb2bf2d[_0xdd9f('0x35')]=_['intersection'](_0x325c86[_0xdd9f('0x31')],qs[_0xdd9f('0x44')](_0x1972e6[_0xdd9f('0x32')][_0xdd9f('0x44')]));_0xb2bf2d[_0xdd9f('0x35')]=_0xb2bf2d[_0xdd9f('0x35')][_0xdd9f('0x37')]?_0xb2bf2d[_0xdd9f('0x35')]:_0x325c86[_0xdd9f('0x31')];if(_0x1972e6[_0xdd9f('0x32')]['includeAll']){_0xb2bf2d[_0xdd9f('0x40')]=[{'all':!![]}];}_0xb2bf2d=_['merge']({},_0xb2bf2d,_0x1972e6[_0xdd9f('0x45')]);return db[_0xdd9f('0x2d')][_0xdd9f('0x46')](_0xb2bf2d)[_0xdd9f('0x25')](handleEntityNotFound(_0x1e0d1f,null))[_0xdd9f('0x25')](respondWithResult(_0x1e0d1f,null))[_0xdd9f('0x47')](handleError(_0x1e0d1f,null));};exports[_0xdd9f('0x48')]=function(_0x1b92b4,_0x19cc01){return db[_0xdd9f('0x2d')]['create'](_0x1b92b4[_0xdd9f('0x49')],{})['then'](respondWithResult(_0x19cc01,0xc9))[_0xdd9f('0x47')](handleError(_0x19cc01,null));};exports[_0xdd9f('0x24')]=function(_0x1a6e76,_0x2d66f2){if(_0x1a6e76['body']['id']){delete _0x1a6e76['body']['id'];}return db['VtigerAccount'][_0xdd9f('0x46')]({'where':{'id':_0x1a6e76[_0xdd9f('0x43')]['id']}})[_0xdd9f('0x25')](handleEntityNotFound(_0x2d66f2,null))[_0xdd9f('0x25')](saveUpdates(_0x1a6e76[_0xdd9f('0x49')],null))[_0xdd9f('0x25')](respondWithResult(_0x2d66f2,null))[_0xdd9f('0x47')](handleError(_0x2d66f2,null));};exports[_0xdd9f('0x26')]=function(_0x357731,_0x42b376){return db[_0xdd9f('0x2d')][_0xdd9f('0x46')]({'where':{'id':_0x357731[_0xdd9f('0x43')]['id']}})['then'](handleEntityNotFound(_0x42b376,null))['then'](removeEntity(_0x42b376,null))[_0xdd9f('0x47')](handleError(_0x42b376,null));};exports[_0xdd9f('0x4a')]=function(_0x54a42b,_0x2e736f,_0x497757){var _0x1e057c={};var _0x514b26={};var _0x5943a3;var _0x927e37;return db['VtigerAccount'][_0xdd9f('0x4b')]({'where':{'id':_0x54a42b[_0xdd9f('0x43')]['id']}})[_0xdd9f('0x25')](handleEntityNotFound(_0x2e736f,null))[_0xdd9f('0x25')](function(_0x431a38){if(_0x431a38){_0x5943a3=_0x431a38;_0x514b26[_0xdd9f('0x31')]=_[_0xdd9f('0x33')](db[_0xdd9f('0x4c')][_0xdd9f('0x2e')]);_0x514b26[_0xdd9f('0x32')]=_[_0xdd9f('0x33')](_0x54a42b[_0xdd9f('0x32')]);_0x514b26[_0xdd9f('0x34')]=_['intersection'](_0x514b26[_0xdd9f('0x31')],_0x514b26[_0xdd9f('0x32')]);_0x1e057c[_0xdd9f('0x35')]=_['intersection'](_0x514b26[_0xdd9f('0x31')],qs[_0xdd9f('0x44')](_0x54a42b['query'][_0xdd9f('0x44')]));_0x1e057c[_0xdd9f('0x35')]=_0x1e057c[_0xdd9f('0x35')][_0xdd9f('0x37')]?_0x1e057c['attributes']:_0x514b26[_0xdd9f('0x31')];_0x1e057c[_0xdd9f('0x4d')]=qs[_0xdd9f('0x3a')](_0x54a42b[_0xdd9f('0x32')][_0xdd9f('0x3a')]);_0x1e057c[_0xdd9f('0x3d')]=qs[_0xdd9f('0x34')](_[_0xdd9f('0x3b')](_0x54a42b[_0xdd9f('0x32')],_0x514b26['filters']));if(_0x54a42b['query'][_0xdd9f('0x3c')]){_0x1e057c['where']=_['merge'](_0x1e057c[_0xdd9f('0x3d')],{'$or':_[_0xdd9f('0x2c')](_0x1e057c['attributes'],function(_0x22c6af){var _0x563c48={};_0x563c48[_0x22c6af]={'$like':'%'+_0x54a42b[_0xdd9f('0x32')][_0xdd9f('0x3c')]+'%'};return _0x563c48;})});}_0x1e057c=_[_0xdd9f('0x3e')]({},_0x1e057c,_0x54a42b[_0xdd9f('0x45')]);return _0x5943a3[_0xdd9f('0x4a')](_0x1e057c);}})[_0xdd9f('0x25')](function(_0x4dca32){if(_0x4dca32){_0x927e37=_0x4dca32[_0xdd9f('0x37')];if(!_0x54a42b[_0xdd9f('0x32')]['hasOwnProperty'](_0xdd9f('0x39'))){_0x1e057c[_0xdd9f('0x1d')]=qs['limit'](_0x54a42b[_0xdd9f('0x32')][_0xdd9f('0x1d')]);_0x1e057c[_0xdd9f('0x1b')]=qs[_0xdd9f('0x1b')](_0x54a42b[_0xdd9f('0x32')][_0xdd9f('0x1b')]);}return _0x5943a3['getConfigurations'](_0x1e057c);}})[_0xdd9f('0x25')](function(_0x56bc62){if(_0x56bc62){return _0x56bc62?{'count':_0x927e37,'rows':_0x56bc62}:null;}})[_0xdd9f('0x25')](respondWithResult(_0x2e736f,null))['catch'](handleError(_0x2e736f,null));};exports[_0xdd9f('0x4e')]=function(_0x15a357,_0x2d191a,_0x409f2e){if(_0x15a357[_0xdd9f('0x49')]['id']){delete _0x15a357['body']['id'];}return db['VtigerAccount'][_0xdd9f('0x4b')]({'where':{'id':_0x15a357['params']['id']}})[_0xdd9f('0x25')](handleEntityNotFound(_0x2d191a,null))[_0xdd9f('0x25')](function(_0x855204){if(_0x855204){_0x15a357[_0xdd9f('0x49')][_0xdd9f('0x4f')]=_0x855204['id'];_0x15a357[_0xdd9f('0x49')][_0xdd9f('0x50')]=integrations[_0xdd9f('0x51')](_0x15a357['body']['channel'],_0x15a357[_0xdd9f('0x49')][_0xdd9f('0x3f')]);_0x15a357[_0xdd9f('0x49')][_0xdd9f('0x52')]=integrations[_0xdd9f('0x53')](_0x15a357[_0xdd9f('0x49')][_0xdd9f('0x54')],_0x15a357[_0xdd9f('0x49')][_0xdd9f('0x3f')]);return db[_0xdd9f('0x4c')][_0xdd9f('0x48')](_0x15a357[_0xdd9f('0x49')],{'include':[{'model':db['VtigerField'],'as':_0xdd9f('0x50')},{'model':db[_0xdd9f('0x55')],'as':_0xdd9f('0x52')}]});}return null;})['then'](respondWithResult(_0x2d191a,null))[_0xdd9f('0x47')](handleError(_0x2d191a,null));};var md5=require(_0xdd9f('0x56'));exports[_0xdd9f('0x57')]=function(_0x5875f8,_0x51d614,_0x3934a3){var _0x279487=null;var _0x4a9162=null;var _0x46a15c=null;var _0x278c0b=null;var _0xf6875b='';return db['VtigerAccount'][_0xdd9f('0x4b')]({'where':{'id':_0x5875f8['params']['id']},'attributes':['id',_0xdd9f('0x29'),'username',_0xdd9f('0x58'),'moduleName',_0xdd9f('0x59'),'serverUrl',_0xdd9f('0x5a')]})[_0xdd9f('0x25')](handleEntityNotFound(_0x51d614,null))[_0xdd9f('0x25')](function(_0x3d6d78){if(_0x3d6d78){_0x279487=_0x3d6d78[_0xdd9f('0x5b')];_0x4a9162=_0x3d6d78['accessKey'];_0x46a15c=_0x3d6d78[_0xdd9f('0x5c')];_0xf6875b=_0x3d6d78[_0xdd9f('0x59')];var _0x3434f3=_0xf6875b[_0xdd9f('0x5d')](-0x1);if(_0x3434f3==='/'){_0xf6875b=_0xf6875b[_0xdd9f('0x5e')](0x0,_0xf6875b[_0xdd9f('0x5f')](_0x3434f3));}_0x278c0b=util[_0xdd9f('0x60')](_0xdd9f('0x61'),_0xf6875b);var _0x4d773a={'method':'GET','uri':_0x278c0b,'qs':{'operation':'getchallenge','username':_0x3d6d78[_0xdd9f('0x5b')]},'json':!![]};return rp(_0x4d773a);}})['then'](function(_0x30c639){if(_0x30c639[_0xdd9f('0x62')]){var _0x1db5ca={'method':_0xdd9f('0x63'),'uri':_0x278c0b,'form':{'operation':_0xdd9f('0x64'),'username':_0x279487,'accessKey':md5(_0x30c639[_0xdd9f('0x65')]['token']+_0x4a9162)},'json':!![]};return rp(_0x1db5ca);}})[_0xdd9f('0x25')](function(_0x3593ee){if(_0x3593ee[_0xdd9f('0x62')]){var _0x4c9520={'method':_0xdd9f('0x66'),'uri':_0x278c0b,'qs':{'operation':_0xdd9f('0x67'),'username':_0x279487,'sessionName':_0x3593ee[_0xdd9f('0x65')]['sessionName'],'elementType':_0x46a15c},'json':!![]};return rp(_0x4c9520);}})[_0xdd9f('0x25')](function(_0x1435bf){if(_0x1435bf[_0xdd9f('0x62')]){var _0x1394b5=[_0xdd9f('0x68'),'reference',_0xdd9f('0x69')];_['remove'](_0x1435bf['result'][_0xdd9f('0x44')],function(_0x2b18af){return _0x1394b5[_0xdd9f('0x6a')](_0x2b18af[_0xdd9f('0x3f')][_0xdd9f('0x29')]);});_[_0xdd9f('0x6b')](_0x1435bf['result']['fields'],function(_0x5792d1){return _0x5792d1[_0xdd9f('0x6c')]==='false';});return{'count':_0x1435bf[_0xdd9f('0x65')][_0xdd9f('0x44')][_0xdd9f('0x37')],'rows':_[_0xdd9f('0x2c')](_0x1435bf[_0xdd9f('0x65')][_0xdd9f('0x44')],function(_0x13a78d){return{'id':_0x13a78d[_0xdd9f('0x29')],'name':_0x13a78d[_0xdd9f('0x6d')],'custom':_[_0xdd9f('0x6e')](_0x13a78d['name'],_0xdd9f('0x6f'))?!![]:![],'options':_0x13a78d[_0xdd9f('0x3f')]['name']===_0xdd9f('0x70')&&_0x13a78d[_0xdd9f('0x3f')][_0xdd9f('0x71')][_0xdd9f('0x37')]>0x0?_[_0xdd9f('0x2c')](_0x13a78d[_0xdd9f('0x3f')]['picklistValues'],function(_0x366898){return{'name':_0x366898[_0xdd9f('0x6d')],'value':_0x366898[_0xdd9f('0x72')]};}):[]};})};}})[_0xdd9f('0x25')](respondWithResult(_0x51d614,null))[_0xdd9f('0x47')](function(_0x236b1c){console[_0xdd9f('0x73')](_0xdd9f('0x74')+_0x236b1c);var _0x174228=_0x5875f8[_0xdd9f('0x32')][_0xdd9f('0x75')]?0x1f4:_0x236b1c[_0xdd9f('0x76')]||0x1f4;logger[_0xdd9f('0x27')](_0xdd9f('0x77'),_0xdd9f('0x57'),_0x174228,JSON[_0xdd9f('0x78')](_0x236b1c));delete _0x236b1c[_0xdd9f('0x29')];if(_0x174228===0x191){_0x174228=0x190;}_0x51d614[_0xdd9f('0x19')](_0x174228)[_0xdd9f('0x2a')](_0x5875f8[_0xdd9f('0x32')][_0xdd9f('0x75')]?{'message':_0xdd9f('0x79'),'statusCode':_0x236b1c[_0xdd9f('0x76')]}:_0x236b1c);});};
\ No newline at end of file
index 8edbed3..c354cd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c49=['VtigerAccount','int_vtiger_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x2c49,0x18a));var _0x92c4=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0x2c49[_0x2f54b6];return _0x169f21;};'use strict';var _=require(_0x92c4('0x0'));var util=require(_0x92c4('0x1'));var logger=require('../../config/logger')(_0x92c4('0x2'));var moment=require(_0x92c4('0x3'));var BPromise=require(_0x92c4('0x4'));var rp=require(_0x92c4('0x5'));var fs=require('fs');var path=require(_0x92c4('0x6'));var rimraf=require(_0x92c4('0x7'));var config=require(_0x92c4('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x92c4('0x9'));module[_0x92c4('0xa')]=function(_0x53085d,_0x173249){return _0x53085d[_0x92c4('0xb')](_0x92c4('0xc'),attributes,{'tableName':_0x92c4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ade=['VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0x9ade,0x8e));var _0xe9ad=function(_0xca04ff,_0xcb449f){_0xca04ff=_0xca04ff-0x0;var _0x6b547=_0x9ade[_0xca04ff];return _0x6b547;};'use strict';var _=require(_0xe9ad('0x0'));var util=require(_0xe9ad('0x1'));var logger=require(_0xe9ad('0x2'))(_0xe9ad('0x3'));var moment=require(_0xe9ad('0x4'));var BPromise=require(_0xe9ad('0x5'));var rp=require(_0xe9ad('0x6'));var fs=require('fs');var path=require(_0xe9ad('0x7'));var rimraf=require(_0xe9ad('0x8'));var config=require(_0xe9ad('0x9'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xe9ad('0xa'));module['exports']=function(_0x5cf047,_0x382206){return _0x5cf047[_0xe9ad('0xb')](_0xe9ad('0xc'),attributes,{'tableName':_0xe9ad('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ede66c0..9f50fd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfcc=['findAll','options','raw','where','attributes','limit','map','model','include','then','GetVtigerAccount','catch','ShowVtigerAccount','VtigerAccount','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0xbfcc[_0x31b5b2];return _0x364f13;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});}exports['GetVtigerAccount']=function(_0x5b078f){var _0x33f731=this;return new Promise(function(_0x99b59d,_0x344510){return db['VtigerAccount'][_0xcbfc('0x12')]({'raw':_0x5b078f['options']?_0x5b078f[_0xcbfc('0x13')][_0xcbfc('0x14')]===undefined?!![]:![]:!![],'where':_0x5b078f[_0xcbfc('0x13')]?_0x5b078f[_0xcbfc('0x13')][_0xcbfc('0x15')]||null:null,'attributes':_0x5b078f[_0xcbfc('0x13')]?_0x5b078f['options'][_0xcbfc('0x16')]||null:null,'limit':_0x5b078f[_0xcbfc('0x13')]?_0x5b078f['options'][_0xcbfc('0x17')]||null:null,'include':_0x5b078f['options']?_0x5b078f['options']['include']?_[_0xcbfc('0x18')](_0x5b078f['options']['include'],function(_0x1b3e42){return{'model':db[_0x1b3e42[_0xcbfc('0x19')]],'as':_0x1b3e42['as'],'attributes':_0x1b3e42[_0xcbfc('0x16')],'include':_0x1b3e42[_0xcbfc('0x1a')]?_['map'](_0x1b3e42[_0xcbfc('0x1a')],function(_0x51284a){return{'model':db[_0x51284a[_0xcbfc('0x19')]],'as':_0x51284a['as'],'attributes':_0x51284a[_0xcbfc('0x16')],'include':_0x51284a['include']?_[_0xcbfc('0x18')](_0x51284a[_0xcbfc('0x1a')],function(_0x4ab48e){return{'model':db[_0x4ab48e[_0xcbfc('0x19')]],'as':_0x4ab48e['as'],'attributes':_0x4ab48e[_0xcbfc('0x16')]};}):[]};}):[]};}):[]:[]})[_0xcbfc('0x1b')](function(_0x41f3b8){logger['info'](_0xcbfc('0x1c'),_0x5b078f);logger[_0xcbfc('0xb')]('GetVtigerAccount',_0x5b078f,JSON[_0xcbfc('0xd')](_0x41f3b8));_0x99b59d(_0x41f3b8);})[_0xcbfc('0x1d')](function(_0x7cbdfa){logger[_0xcbfc('0xe')](_0xcbfc('0x1c'),_0x7cbdfa[_0xcbfc('0x10')],_0x5b078f);_0x344510(_0x33f731[_0xcbfc('0xe')](0x1f4,_0x7cbdfa['message']));});});};exports[_0xcbfc('0x1e')]=function(_0x433300){var _0x3f9d20=this;return new Promise(function(_0x20a378,_0x500a0b){return db[_0xcbfc('0x1f')][_0xcbfc('0x20')]({'raw':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')][_0xcbfc('0x14')]===undefined?!![]:![]:!![],'where':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')]['where']||null:null,'attributes':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')]['attributes']||null:null,'include':_0x433300[_0xcbfc('0x13')]?_0x433300[_0xcbfc('0x13')][_0xcbfc('0x1a')]?_['map'](_0x433300['options']['include'],function(_0x3c6d04){return{'model':db[_0x3c6d04[_0xcbfc('0x19')]],'as':_0x3c6d04['as'],'attributes':_0x3c6d04[_0xcbfc('0x16')],'include':_0x3c6d04[_0xcbfc('0x1a')]?_[_0xcbfc('0x18')](_0x3c6d04[_0xcbfc('0x1a')],function(_0x856e83){return{'model':db[_0x856e83[_0xcbfc('0x19')]],'as':_0x856e83['as'],'attributes':_0x856e83['attributes'],'include':_0x856e83[_0xcbfc('0x1a')]?_[_0xcbfc('0x18')](_0x856e83['include'],function(_0x3093b5){return{'model':db[_0x3093b5['model']],'as':_0x3093b5['as'],'attributes':_0x3093b5[_0xcbfc('0x16')]};}):[]};}):[]};}):[]:[]})[_0xcbfc('0x1b')](function(_0x43121e){logger['info'](_0xcbfc('0x1e'),_0x433300);logger['debug']('ShowVtigerAccount',_0x433300,JSON[_0xcbfc('0xd')](_0x43121e));_0x20a378(_0x43121e);})[_0xcbfc('0x1d')](function(_0x382d8b){logger[_0xcbfc('0xe')](_0xcbfc('0x1e'),_0x382d8b[_0xcbfc('0x10')],_0x433300);_0x500a0b(_0x3f9d20[_0xcbfc('0xe')](0x1f4,_0x382d8b[_0xcbfc('0x10')]));});});};
\ No newline at end of file
+var _0x9ffd=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','info','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','include','map','model','attributes','where','ShowVtigerAccount'];(function(_0xb34c1d,_0x1d9db1){var _0x345909=function(_0x133858){while(--_0x133858){_0xb34c1d['push'](_0xb34c1d['shift']());}};_0x345909(++_0x1d9db1);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x29491f,_0x3e19f8){_0x29491f=_0x29491f-0x0;var _0x24e908=_0x9ffd[_0x29491f];return _0x24e908;};'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']('VtigerAccount,\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')]('VtigerAccount,\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')]('VtigerAccount,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}exports[_0xd9ff('0x17')]=function(_0x3afd19){var _0x5f45c4=this;return new Promise(function(_0x2d4df1,_0x3ccf15){return db[_0xd9ff('0x18')][_0xd9ff('0x19')]({'raw':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19[_0xd9ff('0x1a')][_0xd9ff('0x1b')]===undefined?!![]:![]:!![],'where':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19['options']['where']||null:null,'attributes':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19[_0xd9ff('0x1a')]['attributes']||null:null,'limit':_0x3afd19['options']?_0x3afd19['options']['limit']||null:null,'include':_0x3afd19[_0xd9ff('0x1a')]?_0x3afd19['options'][_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0x3afd19[_0xd9ff('0x1a')][_0xd9ff('0x1c')],function(_0x278b66){return{'model':db[_0x278b66[_0xd9ff('0x1e')]],'as':_0x278b66['as'],'attributes':_0x278b66['attributes'],'include':_0x278b66['include']?_[_0xd9ff('0x1d')](_0x278b66['include'],function(_0x3ca906){return{'model':db[_0x3ca906['model']],'as':_0x3ca906['as'],'attributes':_0x3ca906[_0xd9ff('0x1f')],'include':_0x3ca906['include']?_[_0xd9ff('0x1d')](_0x3ca906[_0xd9ff('0x1c')],function(_0x2138b4){return{'model':db[_0x2138b4[_0xd9ff('0x1e')]],'as':_0x2138b4['as'],'attributes':_0x2138b4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9ff('0xc')](function(_0xe11f88){logger[_0xd9ff('0x15')](_0xd9ff('0x17'),_0x3afd19);logger['debug'](_0xd9ff('0x17'),_0x3afd19,JSON[_0xd9ff('0x10')](_0xe11f88));_0x2d4df1(_0xe11f88);})[_0xd9ff('0x16')](function(_0x45fb63){logger[_0xd9ff('0x11')](_0xd9ff('0x17'),_0x45fb63[_0xd9ff('0x13')],_0x3afd19);_0x3ccf15(_0x5f45c4[_0xd9ff('0x11')](0x1f4,_0x45fb63[_0xd9ff('0x13')]));});});};exports['ShowVtigerAccount']=function(_0xcea5db){var _0x4ba2be=this;return new Promise(function(_0x1d55fd,_0x29c532){return db[_0xd9ff('0x18')]['find']({'raw':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1b')]===undefined?!![]:![]:!![],'where':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db['options'][_0xd9ff('0x20')]||null:null,'attributes':_0xcea5db['options']?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1f')]||null:null,'include':_0xcea5db[_0xd9ff('0x1a')]?_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0xcea5db[_0xd9ff('0x1a')][_0xd9ff('0x1c')],function(_0x36749c){return{'model':db[_0x36749c[_0xd9ff('0x1e')]],'as':_0x36749c['as'],'attributes':_0x36749c[_0xd9ff('0x1f')],'include':_0x36749c[_0xd9ff('0x1c')]?_[_0xd9ff('0x1d')](_0x36749c[_0xd9ff('0x1c')],function(_0x498025){return{'model':db[_0x498025[_0xd9ff('0x1e')]],'as':_0x498025['as'],'attributes':_0x498025[_0xd9ff('0x1f')],'include':_0x498025[_0xd9ff('0x1c')]?_['map'](_0x498025[_0xd9ff('0x1c')],function(_0x5e3ff9){return{'model':db[_0x5e3ff9[_0xd9ff('0x1e')]],'as':_0x5e3ff9['as'],'attributes':_0x5e3ff9['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9ff('0xc')](function(_0x5db498){logger[_0xd9ff('0x15')](_0xd9ff('0x21'),_0xcea5db);logger[_0xd9ff('0xd')]('ShowVtigerAccount',_0xcea5db,JSON['stringify'](_0x5db498));_0x1d55fd(_0x5db498);})['catch'](function(_0x7ac3d1){logger[_0xd9ff('0x11')](_0xd9ff('0x21'),_0x7ac3d1[_0xd9ff('0x13')],_0xcea5db);_0x29c532(_0x4ba2be[_0xd9ff('0x11')](0x1f4,_0x7ac3d1[_0xd9ff('0x13')]));});});};
\ No newline at end of file
index ac42c68..7a84d90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d2d=['get','isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller'];(function(_0x56b69b,_0x2ddf61){var _0x585f9f=function(_0x33d47f){while(--_0x33d47f){_0x56b69b['push'](_0x56b69b['shift']());}};_0x585f9f(++_0x2ddf61);}(_0x0d2d,0x17c));var _0xd0d2=function(_0x5bad44,_0x2b076a){_0x5bad44=_0x5bad44-0x0;var _0x534fb4=_0x0d2d[_0x5bad44];return _0x534fb4;};'use strict';var multer=require(_0xd0d2('0x0'));var util=require(_0xd0d2('0x1'));var path=require(_0xd0d2('0x2'));var timeout=require(_0xd0d2('0x3'));var express=require(_0xd0d2('0x4'));var router=express[_0xd0d2('0x5')]();var fs_extra=require(_0xd0d2('0x6'));var auth=require(_0xd0d2('0x7'));var interaction=require(_0xd0d2('0x8'));var config=require(_0xd0d2('0x9'));var controller=require(_0xd0d2('0xa'));router[_0xd0d2('0xb')]('/',auth[_0xd0d2('0xc')](),controller[_0xd0d2('0xd')]);router[_0xd0d2('0xb')](_0xd0d2('0xe'),auth[_0xd0d2('0xc')](),controller[_0xd0d2('0xf')]);router[_0xd0d2('0xb')]('/:id/fields',auth[_0xd0d2('0xc')](),controller[_0xd0d2('0x10')]);router[_0xd0d2('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xd0d2('0x11')]);router['get'](_0xd0d2('0x12'),auth[_0xd0d2('0xc')](),controller[_0xd0d2('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd0d2('0x14')](_0xd0d2('0xe'),auth[_0xd0d2('0xc')](),controller['update']);router['delete'](_0xd0d2('0xe'),auth[_0xd0d2('0xc')](),controller[_0xd0d2('0x15')]);module[_0xd0d2('0x16')]=router;
\ No newline at end of file
+var _0x5deb=['delete','/:id','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','update'];(function(_0x4601ad,_0x7c1bab){var _0x544915=function(_0x2ec866){while(--_0x2ec866){_0x4601ad['push'](_0x4601ad['shift']());}};_0x544915(++_0x7c1bab);}(_0x5deb,0x130));var _0xb5de=function(_0x1afa5a,_0x28194f){_0x1afa5a=_0x1afa5a-0x0;var _0x86f759=_0x5deb[_0x1afa5a];return _0x86f759;};'use strict';var multer=require(_0xb5de('0x0'));var util=require('util');var path=require(_0xb5de('0x1'));var timeout=require(_0xb5de('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb5de('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb5de('0x4'));var config=require(_0xb5de('0x5'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb5de('0x6')]);router[_0xb5de('0x7')]('/:id',auth[_0xb5de('0x8')](),controller['show']);router[_0xb5de('0x7')](_0xb5de('0x9'),auth['isAuthenticated'](),controller[_0xb5de('0xa')]);router['get'](_0xb5de('0xb'),auth[_0xb5de('0x8')](),controller['getSubjects']);router['get'](_0xb5de('0xc'),auth['isAuthenticated'](),controller[_0xb5de('0xd')]);router['post']('/',auth[_0xb5de('0x8')](),controller[_0xb5de('0xe')]);router['put']('/:id',auth[_0xb5de('0x8')](),controller[_0xb5de('0xf')]);router[_0xb5de('0x10')](_0xb5de('0x11'),auth['isAuthenticated'](),controller[_0xb5de('0x12')]);module[_0xb5de('0x13')]=router;
\ No newline at end of file
index f2f1e6f..4d1ff05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02e0=['sequelize','STRING'];(function(_0x47d5e3,_0x19fe4c){var _0x4023b9=function(_0x84d5c4){while(--_0x84d5c4){_0x47d5e3['push'](_0x47d5e3['shift']());}};_0x4023b9(++_0x19fe4c);}(_0x02e0,0xda));var _0x002e=function(_0x28fe57,_0x17a0b0){_0x28fe57=_0x28fe57-0x0;var _0x24b5cf=_0x02e0[_0x28fe57];return _0x24b5cf;};'use strict';var Sequelize=require(_0x002e('0x0'));module['exports']={'name':{'type':Sequelize[_0x002e('0x1')]},'description':{'type':Sequelize[_0x002e('0x1')]}};
\ No newline at end of file
+var _0xa08e=['exports','STRING'];(function(_0x2c19ac,_0x1e1ca9){var _0x7295bb=function(_0x5c194d){while(--_0x5c194d){_0x2c19ac['push'](_0x2c19ac['shift']());}};_0x7295bb(++_0x1e1ca9);}(_0xa08e,0x94));var _0xea08=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xa08e[_0x261e29];return _0x25ef43;};'use strict';var Sequelize=require('sequelize');module[_0xea08('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xea08('0x1')]}};
\ No newline at end of file
index acb0efc..bb94c3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08af=['catch','create','body','VtigerField','sort','getFields','findOne','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','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','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','intersection','find'];(function(_0x5be40e,_0x12997e){var _0x3db6e1=function(_0x3fa7c8){while(--_0x3fa7c8){_0x5be40e['push'](_0x5be40e['shift']());}};_0x3db6e1(++_0x12997e);}(_0x08af,0xff));var _0xf08a=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0x08af[_0x15a634];return _0xf4f7a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf08a('0x0'));var zipdir=require(_0xf08a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf08a('0x2'));var moment=require(_0xf08a('0x3'));var BPromise=require(_0xf08a('0x4'));var Mustache=require(_0xf08a('0x5'));var util=require(_0xf08a('0x6'));var path=require(_0xf08a('0x7'));var sox=require('sox');var csv=require(_0xf08a('0x8'));var ejs=require(_0xf08a('0x9'));var fs=require('fs');var fs_extra=require(_0xf08a('0xa'));var _=require(_0xf08a('0xb'));var squel=require(_0xf08a('0xc'));var crypto=require('crypto');var jsforce=require(_0xf08a('0xd'));var deskjs=require(_0xf08a('0xe'));var toCsv=require(_0xf08a('0x8'));var querystring=require('querystring');var Papa=require(_0xf08a('0xf'));var Redis=require(_0xf08a('0x10'));var authService=require(_0xf08a('0x11'));var qs=require(_0xf08a('0x12'));var as=require(_0xf08a('0x13'));var hardwareService=require(_0xf08a('0x14'));var logger=require(_0xf08a('0x15'))(_0xf08a('0x16'));var utils=require(_0xf08a('0x17'));var config=require(_0xf08a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf08a('0x19'))['db'];function respondWithStatusCode(_0x35acf6,_0x5a5ade){_0x5a5ade=_0x5a5ade||0xcc;return function(_0x40b032){if(_0x40b032){return _0x35acf6['sendStatus'](_0x5a5ade);}return _0x35acf6['status'](_0x5a5ade)[_0xf08a('0x1a')]();};}function respondWithResult(_0x106005,_0x2c886b){_0x2c886b=_0x2c886b||0xc8;return function(_0x324e8b){if(_0x324e8b){return _0x106005[_0xf08a('0x1b')](_0x2c886b)[_0xf08a('0x1c')](_0x324e8b);}};}function respondWithFilteredResult(_0x51678f,_0x13d47f){return function(_0x2bef1d){if(_0x2bef1d){var _0x396678=typeof _0x13d47f[_0xf08a('0x1d')]==='undefined'&&typeof _0x13d47f['limit']===_0xf08a('0x1e');var _0x439b78=_0x2bef1d['count'];var _0x1c412b=_0x396678?0x0:_0x13d47f[_0xf08a('0x1d')];var _0x5b0c81=_0x396678?_0x2bef1d[_0xf08a('0x1f')]:_0x13d47f['offset']+_0x13d47f[_0xf08a('0x20')];var _0x4c075e;if(_0x5b0c81>=_0x439b78){_0x5b0c81=_0x439b78;_0x4c075e=0xc8;}else{_0x4c075e=0xce;}_0x51678f[_0xf08a('0x1b')](_0x4c075e);return _0x51678f[_0xf08a('0x21')]('Content-Range',_0x1c412b+'-'+_0x5b0c81+'/'+_0x439b78)[_0xf08a('0x1c')](_0x2bef1d);}return null;};}function patchUpdates(_0x4384a7){return function(_0x21017f){try{jsonpatch[_0xf08a('0x22')](_0x21017f,_0x4384a7,!![]);}catch(_0x528bfd){return BPromise[_0xf08a('0x23')](_0x528bfd);}return _0x21017f[_0xf08a('0x24')]();};}function saveUpdates(_0x34dbd0,_0xcb134){return function(_0x588c2b){if(_0x588c2b){return _0x588c2b[_0xf08a('0x25')](_0x34dbd0)[_0xf08a('0x26')](function(_0x4f1e0a){return _0x4f1e0a;});}return null;};}function removeEntity(_0x438a35,_0x31a8cf){return function(_0x571d56){if(_0x571d56){return _0x571d56[_0xf08a('0x27')]()[_0xf08a('0x26')](function(){_0x438a35[_0xf08a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20fc3e,_0x20ec51){return function(_0x1adc15){if(!_0x1adc15){_0x20fc3e['sendStatus'](0x194);}return _0x1adc15;};}function handleError(_0x587d43,_0x3cac84){_0x3cac84=_0x3cac84||0x1f4;return function(_0x25f1d0){logger[_0xf08a('0x28')](_0x25f1d0[_0xf08a('0x29')]);if(_0x25f1d0['name']){delete _0x25f1d0[_0xf08a('0x2a')];}_0x587d43[_0xf08a('0x1b')](_0x3cac84)[_0xf08a('0x2b')](_0x25f1d0);};}exports[_0xf08a('0x2c')]=function(_0xe1ee2c,_0x25719c){var _0x432411={},_0xbbdb06={},_0x49273c={'count':0x0,'rows':[]};var _0x2eb75c=_[_0xf08a('0x2d')](db[_0xf08a('0x2e')][_0xf08a('0x2f')],function(_0x32d261){return{'name':_0x32d261['fieldName'],'type':_0x32d261['type'][_0xf08a('0x30')]};});_0xbbdb06['model']=_[_0xf08a('0x2d')](_0x2eb75c,'name');_0xbbdb06[_0xf08a('0x31')]=_[_0xf08a('0x32')](_0xe1ee2c[_0xf08a('0x31')]);_0xbbdb06[_0xf08a('0x33')]=_['intersection'](_0xbbdb06[_0xf08a('0x34')],_0xbbdb06[_0xf08a('0x31')]);_0x432411['attributes']=_['intersection'](_0xbbdb06[_0xf08a('0x34')],qs[_0xf08a('0x35')](_0xe1ee2c[_0xf08a('0x31')][_0xf08a('0x35')]));_0x432411['attributes']=_0x432411[_0xf08a('0x36')][_0xf08a('0x37')]?_0x432411[_0xf08a('0x36')]:_0xbbdb06[_0xf08a('0x34')];if(!_0xe1ee2c[_0xf08a('0x31')][_0xf08a('0x38')](_0xf08a('0x39'))){_0x432411['limit']=qs[_0xf08a('0x20')](_0xe1ee2c[_0xf08a('0x31')][_0xf08a('0x20')]);_0x432411[_0xf08a('0x1d')]=qs[_0xf08a('0x1d')](_0xe1ee2c['query'][_0xf08a('0x1d')]);}_0x432411[_0xf08a('0x3a')]=qs['sort'](_0xe1ee2c[_0xf08a('0x31')]['sort']);_0x432411[_0xf08a('0x3b')]=qs[_0xf08a('0x33')](_[_0xf08a('0x3c')](_0xe1ee2c[_0xf08a('0x31')],_0xbbdb06['filters']),_0x2eb75c);if(_0xe1ee2c[_0xf08a('0x31')][_0xf08a('0x3d')]){_0x432411[_0xf08a('0x3b')]=_[_0xf08a('0x3e')](_0x432411['where'],{'$or':_[_0xf08a('0x2d')](_0x2eb75c,function(_0xd28adc){if(_0xd28adc[_0xf08a('0x3f')]!==_0xf08a('0x40')){var _0x555aea={};_0x555aea[_0xd28adc[_0xf08a('0x2a')]]={'$like':'%'+_0xe1ee2c['query'][_0xf08a('0x3d')]+'%'};return _0x555aea;}})});}_0x432411=_[_0xf08a('0x3e')]({},_0x432411,_0xe1ee2c[_0xf08a('0x41')]);var _0xadaa={'where':_0x432411[_0xf08a('0x3b')]};return db[_0xf08a('0x2e')][_0xf08a('0x1f')](_0xadaa)[_0xf08a('0x26')](function(_0x5d6481){_0x49273c[_0xf08a('0x1f')]=_0x5d6481;if(_0xe1ee2c[_0xf08a('0x31')][_0xf08a('0x42')]){_0x432411[_0xf08a('0x43')]=[{'all':!![]}];}return db[_0xf08a('0x2e')][_0xf08a('0x44')](_0x432411);})[_0xf08a('0x26')](function(_0x26cb62){_0x49273c['rows']=_0x26cb62;return _0x49273c;})[_0xf08a('0x26')](respondWithFilteredResult(_0x25719c,_0x432411))['catch'](handleError(_0x25719c,null));};exports[_0xf08a('0x45')]=function(_0x5d3ce8,_0x5e59){var _0x27078a={'raw':![],'where':{'id':_0x5d3ce8[_0xf08a('0x46')]['id']}},_0x4cbae1={};_0x4cbae1[_0xf08a('0x34')]=_[_0xf08a('0x32')](db['VtigerConfiguration'][_0xf08a('0x2f')]);_0x4cbae1[_0xf08a('0x31')]=_[_0xf08a('0x32')](_0x5d3ce8[_0xf08a('0x31')]);_0x4cbae1[_0xf08a('0x33')]=_['intersection'](_0x4cbae1[_0xf08a('0x34')],_0x4cbae1['query']);_0x27078a[_0xf08a('0x36')]=_[_0xf08a('0x47')](_0x4cbae1[_0xf08a('0x34')],qs[_0xf08a('0x35')](_0x5d3ce8[_0xf08a('0x31')][_0xf08a('0x35')]));_0x27078a[_0xf08a('0x36')]=_0x27078a[_0xf08a('0x36')][_0xf08a('0x37')]?_0x27078a['attributes']:_0x4cbae1[_0xf08a('0x34')];if(_0x5d3ce8[_0xf08a('0x31')]['includeAll']){_0x27078a[_0xf08a('0x43')]=[{'all':!![]}];}_0x27078a=_[_0xf08a('0x3e')]({},_0x27078a,_0x5d3ce8[_0xf08a('0x41')]);return db[_0xf08a('0x2e')][_0xf08a('0x48')](_0x27078a)[_0xf08a('0x26')](handleEntityNotFound(_0x5e59,null))[_0xf08a('0x26')](respondWithResult(_0x5e59,null))[_0xf08a('0x49')](handleError(_0x5e59,null));};exports[_0xf08a('0x4a')]=function(_0x5b99b1,_0x463e82){return db['VtigerConfiguration']['create'](_0x5b99b1['body'],{})[_0xf08a('0x26')](respondWithResult(_0x463e82,0xc9))['catch'](handleError(_0x463e82,null));};exports['update']=function(_0x2649db,_0x48d015){if(_0x2649db[_0xf08a('0x4b')]['id']){delete _0x2649db['body']['id'];}return db[_0xf08a('0x2e')][_0xf08a('0x48')]({'where':{'id':_0x2649db['params']['id']}})[_0xf08a('0x26')](handleEntityNotFound(_0x48d015,null))['then'](saveUpdates(_0x2649db[_0xf08a('0x4b')],null))[_0xf08a('0x26')](respondWithResult(_0x48d015,null))[_0xf08a('0x49')](handleError(_0x48d015,null));};exports[_0xf08a('0x27')]=function(_0x635d7d,_0x570bf6){return db['VtigerConfiguration'][_0xf08a('0x48')]({'where':{'id':_0x635d7d[_0xf08a('0x46')]['id']}})[_0xf08a('0x26')](handleEntityNotFound(_0x570bf6,null))['then'](removeEntity(_0x570bf6,null))[_0xf08a('0x49')](handleError(_0x570bf6,null));};exports['getFields']=function(_0x3b9757,_0x25c7bb,_0x19a3b0){var _0x120f83={};var _0x144616={};var _0x218129;var _0x463a04;return db[_0xf08a('0x2e')]['findOne']({'where':{'id':_0x3b9757[_0xf08a('0x46')]['id']}})['then'](handleEntityNotFound(_0x25c7bb,null))[_0xf08a('0x26')](function(_0xe80b2f){if(_0xe80b2f){_0x218129=_0xe80b2f;_0x144616['model']=_[_0xf08a('0x32')](db[_0xf08a('0x4c')][_0xf08a('0x2f')]);_0x144616[_0xf08a('0x31')]=_[_0xf08a('0x32')](_0x3b9757['query']);_0x144616[_0xf08a('0x33')]=_[_0xf08a('0x47')](_0x144616[_0xf08a('0x34')],_0x144616[_0xf08a('0x31')]);_0x120f83[_0xf08a('0x36')]=_[_0xf08a('0x47')](_0x144616[_0xf08a('0x34')],qs['fields'](_0x3b9757[_0xf08a('0x31')]['fields']));_0x120f83[_0xf08a('0x36')]=_0x120f83[_0xf08a('0x36')][_0xf08a('0x37')]?_0x120f83[_0xf08a('0x36')]:_0x144616[_0xf08a('0x34')];_0x120f83[_0xf08a('0x3a')]=qs[_0xf08a('0x4d')](_0x3b9757[_0xf08a('0x31')]['sort']);_0x120f83['where']=qs[_0xf08a('0x33')](_['pick'](_0x3b9757[_0xf08a('0x31')],_0x144616[_0xf08a('0x33')]));if(_0x3b9757[_0xf08a('0x31')][_0xf08a('0x3d')]){_0x120f83[_0xf08a('0x3b')]=_[_0xf08a('0x3e')](_0x120f83[_0xf08a('0x3b')],{'$or':_[_0xf08a('0x2d')](_0x120f83[_0xf08a('0x36')],function(_0x215eec){var _0x4f3093={};_0x4f3093[_0x215eec]={'$like':'%'+_0x3b9757['query'][_0xf08a('0x3d')]+'%'};return _0x4f3093;})});}_0x120f83=_[_0xf08a('0x3e')]({},_0x120f83,_0x3b9757['options']);return _0x218129[_0xf08a('0x4e')](_0x120f83);}})[_0xf08a('0x26')](function(_0x46337a){if(_0x46337a){_0x463a04=_0x46337a[_0xf08a('0x37')];if(!_0x3b9757[_0xf08a('0x31')][_0xf08a('0x38')](_0xf08a('0x39'))){_0x120f83[_0xf08a('0x20')]=qs[_0xf08a('0x20')](_0x3b9757[_0xf08a('0x31')][_0xf08a('0x20')]);_0x120f83[_0xf08a('0x1d')]=qs[_0xf08a('0x1d')](_0x3b9757[_0xf08a('0x31')][_0xf08a('0x1d')]);}return _0x218129['getFields'](_0x120f83);}})['then'](function(_0x24448e){if(_0x24448e){return _0x24448e?{'count':_0x463a04,'rows':_0x24448e}:null;}})[_0xf08a('0x26')](respondWithResult(_0x25c7bb,null))['catch'](handleError(_0x25c7bb,null));};exports['getSubjects']=function(_0x4da3ab,_0x16704f,_0x573191){var _0x6cdf13={};var _0x3b4d0e={};var _0x541d57;var _0x768736;return db['VtigerConfiguration'][_0xf08a('0x4f')]({'where':{'id':_0x4da3ab[_0xf08a('0x46')]['id']}})[_0xf08a('0x26')](handleEntityNotFound(_0x16704f,null))[_0xf08a('0x26')](function(_0x1950fc){if(_0x1950fc){_0x541d57=_0x1950fc;_0x3b4d0e['model']=_[_0xf08a('0x32')](db['VtigerField'][_0xf08a('0x2f')]);_0x3b4d0e['query']=_['keys'](_0x4da3ab[_0xf08a('0x31')]);_0x3b4d0e[_0xf08a('0x33')]=_[_0xf08a('0x47')](_0x3b4d0e[_0xf08a('0x34')],_0x3b4d0e[_0xf08a('0x31')]);_0x6cdf13['attributes']=_['intersection'](_0x3b4d0e[_0xf08a('0x34')],qs[_0xf08a('0x35')](_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x35')]));_0x6cdf13[_0xf08a('0x36')]=_0x6cdf13[_0xf08a('0x36')][_0xf08a('0x37')]?_0x6cdf13[_0xf08a('0x36')]:_0x3b4d0e['model'];_0x6cdf13['order']=qs[_0xf08a('0x4d')](_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x4d')]);_0x6cdf13[_0xf08a('0x3b')]=qs['filters'](_['pick'](_0x4da3ab[_0xf08a('0x31')],_0x3b4d0e['filters']));if(_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x3d')]){_0x6cdf13[_0xf08a('0x3b')]=_[_0xf08a('0x3e')](_0x6cdf13[_0xf08a('0x3b')],{'$or':_[_0xf08a('0x2d')](_0x6cdf13[_0xf08a('0x36')],function(_0x57c73e){var _0xbf9edb={};_0xbf9edb[_0x57c73e]={'$like':'%'+_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x3d')]+'%'};return _0xbf9edb;})});}_0x6cdf13=_['merge']({},_0x6cdf13,_0x4da3ab[_0xf08a('0x41')]);return _0x541d57['getSubjects'](_0x6cdf13);}})[_0xf08a('0x26')](function(_0x3b3a59){if(_0x3b3a59){_0x768736=_0x3b3a59[_0xf08a('0x37')];if(!_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x38')]('nolimit')){_0x6cdf13[_0xf08a('0x20')]=qs[_0xf08a('0x20')](_0x4da3ab[_0xf08a('0x31')][_0xf08a('0x20')]);_0x6cdf13[_0xf08a('0x1d')]=qs[_0xf08a('0x1d')](_0x4da3ab['query']['offset']);}return _0x541d57[_0xf08a('0x50')](_0x6cdf13);}})['then'](function(_0x445f4c){if(_0x445f4c){return _0x445f4c?{'count':_0x768736,'rows':_0x445f4c}:null;}})[_0xf08a('0x26')](respondWithResult(_0x16704f,null))[_0xf08a('0x49')](handleError(_0x16704f,null));};exports[_0xf08a('0x51')]=function(_0x6bc146,_0x1c362c,_0xb78938){var _0x4e39ed={};var _0x35c6ac={};var _0x54cb1b;var _0x518aca;return db[_0xf08a('0x2e')][_0xf08a('0x4f')]({'where':{'id':_0x6bc146[_0xf08a('0x46')]['id']}})[_0xf08a('0x26')](handleEntityNotFound(_0x1c362c,null))[_0xf08a('0x26')](function(_0x282b0b){if(_0x282b0b){_0x54cb1b=_0x282b0b;_0x35c6ac[_0xf08a('0x34')]=_[_0xf08a('0x32')](db['VtigerField'][_0xf08a('0x2f')]);_0x35c6ac[_0xf08a('0x31')]=_[_0xf08a('0x32')](_0x6bc146[_0xf08a('0x31')]);_0x35c6ac['filters']=_[_0xf08a('0x47')](_0x35c6ac[_0xf08a('0x34')],_0x35c6ac[_0xf08a('0x31')]);_0x4e39ed[_0xf08a('0x36')]=_[_0xf08a('0x47')](_0x35c6ac[_0xf08a('0x34')],qs[_0xf08a('0x35')](_0x6bc146[_0xf08a('0x31')][_0xf08a('0x35')]));_0x4e39ed[_0xf08a('0x36')]=_0x4e39ed[_0xf08a('0x36')][_0xf08a('0x37')]?_0x4e39ed[_0xf08a('0x36')]:_0x35c6ac[_0xf08a('0x34')];_0x4e39ed[_0xf08a('0x3a')]=qs[_0xf08a('0x4d')](_0x6bc146[_0xf08a('0x31')][_0xf08a('0x4d')]);_0x4e39ed[_0xf08a('0x3b')]=qs[_0xf08a('0x33')](_[_0xf08a('0x3c')](_0x6bc146[_0xf08a('0x31')],_0x35c6ac[_0xf08a('0x33')]));if(_0x6bc146[_0xf08a('0x31')][_0xf08a('0x3d')]){_0x4e39ed[_0xf08a('0x3b')]=_['merge'](_0x4e39ed[_0xf08a('0x3b')],{'$or':_[_0xf08a('0x2d')](_0x4e39ed['attributes'],function(_0x12d169){var _0x3d1fe1={};_0x3d1fe1[_0x12d169]={'$like':'%'+_0x6bc146[_0xf08a('0x31')][_0xf08a('0x3d')]+'%'};return _0x3d1fe1;})});}_0x4e39ed=_[_0xf08a('0x3e')]({},_0x4e39ed,_0x6bc146['options']);return _0x54cb1b['getDescriptions'](_0x4e39ed);}})[_0xf08a('0x26')](function(_0x44cee5){if(_0x44cee5){_0x518aca=_0x44cee5[_0xf08a('0x37')];if(!_0x6bc146[_0xf08a('0x31')][_0xf08a('0x38')](_0xf08a('0x39'))){_0x4e39ed[_0xf08a('0x20')]=qs['limit'](_0x6bc146[_0xf08a('0x31')][_0xf08a('0x20')]);_0x4e39ed[_0xf08a('0x1d')]=qs['offset'](_0x6bc146[_0xf08a('0x31')][_0xf08a('0x1d')]);}return _0x54cb1b['getDescriptions'](_0x4e39ed);}})['then'](function(_0x27e47d){if(_0x27e47d){return _0x27e47d?{'count':_0x518aca,'rows':_0x27e47d}:null;}})[_0xf08a('0x26')](respondWithResult(_0x1c362c,null))[_0xf08a('0x49')](handleError(_0x1c362c,null));};
\ No newline at end of file
+var _0x4071=['crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','getFields','VtigerField','hasOwnProperty','getSubjects','findOne','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1600a8,_0x44d8d5){var _0x394fdd=function(_0xa92bc){while(--_0xa92bc){_0x1600a8['push'](_0x1600a8['shift']());}};_0x394fdd(++_0x44d8d5);}(_0x4071,0x1c0));var _0x1407=function(_0xd6c375,_0x49885e){_0xd6c375=_0xd6c375-0x0;var _0x166580=_0x4071[_0xd6c375];return _0x166580;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1407('0x0'));var zipdir=require(_0x1407('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1407('0x2'));var moment=require(_0x1407('0x3'));var BPromise=require(_0x1407('0x4'));var Mustache=require(_0x1407('0x5'));var util=require(_0x1407('0x6'));var path=require(_0x1407('0x7'));var sox=require(_0x1407('0x8'));var csv=require(_0x1407('0x9'));var ejs=require(_0x1407('0xa'));var fs=require('fs');var fs_extra=require(_0x1407('0xb'));var _=require(_0x1407('0xc'));var squel=require(_0x1407('0xd'));var crypto=require(_0x1407('0xe'));var jsforce=require(_0x1407('0xf'));var deskjs=require(_0x1407('0x10'));var toCsv=require(_0x1407('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1407('0x11'));var as=require(_0x1407('0x12'));var hardwareService=require(_0x1407('0x13'));var logger=require('../../config/logger')(_0x1407('0x14'));var utils=require(_0x1407('0x15'));var config=require(_0x1407('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x332e78,_0x19d84c){_0x19d84c=_0x19d84c||0xcc;return function(_0x3057fb){if(_0x3057fb){return _0x332e78[_0x1407('0x17')](_0x19d84c);}return _0x332e78[_0x1407('0x18')](_0x19d84c)[_0x1407('0x19')]();};}function respondWithResult(_0x6b6c6e,_0x12693d){_0x12693d=_0x12693d||0xc8;return function(_0x4803d6){if(_0x4803d6){return _0x6b6c6e['status'](_0x12693d)[_0x1407('0x1a')](_0x4803d6);}};}function respondWithFilteredResult(_0x47a2be,_0x4b279c){return function(_0x552136){if(_0x552136){var _0x57ab28=typeof _0x4b279c[_0x1407('0x1b')]===_0x1407('0x1c')&&typeof _0x4b279c[_0x1407('0x1d')]==='undefined';var _0x3f9b09=_0x552136[_0x1407('0x1e')];var _0xb89478=_0x57ab28?0x0:_0x4b279c[_0x1407('0x1b')];var _0x819c11=_0x57ab28?_0x552136[_0x1407('0x1e')]:_0x4b279c['offset']+_0x4b279c[_0x1407('0x1d')];var _0x324575;if(_0x819c11>=_0x3f9b09){_0x819c11=_0x3f9b09;_0x324575=0xc8;}else{_0x324575=0xce;}_0x47a2be[_0x1407('0x18')](_0x324575);return _0x47a2be[_0x1407('0x1f')]('Content-Range',_0xb89478+'-'+_0x819c11+'/'+_0x3f9b09)[_0x1407('0x1a')](_0x552136);}return null;};}function patchUpdates(_0x57a0e0){return function(_0x254d04){try{jsonpatch[_0x1407('0x20')](_0x254d04,_0x57a0e0,!![]);}catch(_0x3f41d6){return BPromise[_0x1407('0x21')](_0x3f41d6);}return _0x254d04['save']();};}function saveUpdates(_0x3fb34d,_0x5323f1){return function(_0x4ef9dc){if(_0x4ef9dc){return _0x4ef9dc[_0x1407('0x22')](_0x3fb34d)[_0x1407('0x23')](function(_0x44a543){return _0x44a543;});}return null;};}function removeEntity(_0x30cb46,_0x3280a1){return function(_0x52847b){if(_0x52847b){return _0x52847b[_0x1407('0x24')]()[_0x1407('0x23')](function(){_0x30cb46[_0x1407('0x18')](0xcc)[_0x1407('0x19')]();});}};}function handleEntityNotFound(_0x4ebdeb,_0x2345df){return function(_0x38c797){if(!_0x38c797){_0x4ebdeb['sendStatus'](0x194);}return _0x38c797;};}function handleError(_0x3ab275,_0x5443fe){_0x5443fe=_0x5443fe||0x1f4;return function(_0x596ab8){logger['error'](_0x596ab8[_0x1407('0x25')]);if(_0x596ab8[_0x1407('0x26')]){delete _0x596ab8[_0x1407('0x26')];}_0x3ab275[_0x1407('0x18')](_0x5443fe)[_0x1407('0x27')](_0x596ab8);};}exports[_0x1407('0x28')]=function(_0x3cba92,_0x370afb){var _0x478ac0={},_0x44f2df={},_0x51959e={'count':0x0,'rows':[]};var _0x59f0c6=_[_0x1407('0x29')](db[_0x1407('0x2a')][_0x1407('0x2b')],function(_0x2a8d95){return{'name':_0x2a8d95[_0x1407('0x2c')],'type':_0x2a8d95[_0x1407('0x2d')]['key']};});_0x44f2df['model']=_[_0x1407('0x29')](_0x59f0c6,_0x1407('0x26'));_0x44f2df[_0x1407('0x2e')]=_['keys'](_0x3cba92[_0x1407('0x2e')]);_0x44f2df[_0x1407('0x2f')]=_[_0x1407('0x30')](_0x44f2df[_0x1407('0x31')],_0x44f2df[_0x1407('0x2e')]);_0x478ac0['attributes']=_[_0x1407('0x30')](_0x44f2df['model'],qs[_0x1407('0x32')](_0x3cba92['query']['fields']));_0x478ac0[_0x1407('0x33')]=_0x478ac0['attributes'][_0x1407('0x34')]?_0x478ac0[_0x1407('0x33')]:_0x44f2df[_0x1407('0x31')];if(!_0x3cba92['query']['hasOwnProperty'](_0x1407('0x35'))){_0x478ac0[_0x1407('0x1d')]=qs[_0x1407('0x1d')](_0x3cba92['query'][_0x1407('0x1d')]);_0x478ac0[_0x1407('0x1b')]=qs[_0x1407('0x1b')](_0x3cba92[_0x1407('0x2e')]['offset']);}_0x478ac0[_0x1407('0x36')]=qs[_0x1407('0x37')](_0x3cba92[_0x1407('0x2e')][_0x1407('0x37')]);_0x478ac0[_0x1407('0x38')]=qs[_0x1407('0x2f')](_[_0x1407('0x39')](_0x3cba92[_0x1407('0x2e')],_0x44f2df[_0x1407('0x2f')]),_0x59f0c6);if(_0x3cba92[_0x1407('0x2e')][_0x1407('0x3a')]){_0x478ac0[_0x1407('0x38')]=_[_0x1407('0x3b')](_0x478ac0[_0x1407('0x38')],{'$or':_['map'](_0x59f0c6,function(_0x4fe59a){if(_0x4fe59a[_0x1407('0x2d')]!=='VIRTUAL'){var _0x49b8fd={};_0x49b8fd[_0x4fe59a['name']]={'$like':'%'+_0x3cba92[_0x1407('0x2e')][_0x1407('0x3a')]+'%'};return _0x49b8fd;}})});}_0x478ac0=_[_0x1407('0x3b')]({},_0x478ac0,_0x3cba92[_0x1407('0x3c')]);var _0x114ef6={'where':_0x478ac0[_0x1407('0x38')]};return db[_0x1407('0x2a')][_0x1407('0x1e')](_0x114ef6)[_0x1407('0x23')](function(_0x7c625a){_0x51959e['count']=_0x7c625a;if(_0x3cba92['query'][_0x1407('0x3d')]){_0x478ac0[_0x1407('0x3e')]=[{'all':!![]}];}return db[_0x1407('0x2a')][_0x1407('0x3f')](_0x478ac0);})[_0x1407('0x23')](function(_0x11305d){_0x51959e[_0x1407('0x40')]=_0x11305d;return _0x51959e;})[_0x1407('0x23')](respondWithFilteredResult(_0x370afb,_0x478ac0))['catch'](handleError(_0x370afb,null));};exports['show']=function(_0x42918d,_0x5d5ab3){var _0x86f4a0={'raw':![],'where':{'id':_0x42918d[_0x1407('0x41')]['id']}},_0x8c047a={};_0x8c047a[_0x1407('0x31')]=_[_0x1407('0x42')](db[_0x1407('0x2a')]['rawAttributes']);_0x8c047a[_0x1407('0x2e')]=_[_0x1407('0x42')](_0x42918d[_0x1407('0x2e')]);_0x8c047a[_0x1407('0x2f')]=_['intersection'](_0x8c047a[_0x1407('0x31')],_0x8c047a[_0x1407('0x2e')]);_0x86f4a0[_0x1407('0x33')]=_['intersection'](_0x8c047a[_0x1407('0x31')],qs['fields'](_0x42918d[_0x1407('0x2e')][_0x1407('0x32')]));_0x86f4a0[_0x1407('0x33')]=_0x86f4a0['attributes'][_0x1407('0x34')]?_0x86f4a0[_0x1407('0x33')]:_0x8c047a[_0x1407('0x31')];if(_0x42918d['query']['includeAll']){_0x86f4a0[_0x1407('0x3e')]=[{'all':!![]}];}_0x86f4a0=_[_0x1407('0x3b')]({},_0x86f4a0,_0x42918d[_0x1407('0x3c')]);return db[_0x1407('0x2a')][_0x1407('0x43')](_0x86f4a0)['then'](handleEntityNotFound(_0x5d5ab3,null))[_0x1407('0x23')](respondWithResult(_0x5d5ab3,null))[_0x1407('0x44')](handleError(_0x5d5ab3,null));};exports[_0x1407('0x45')]=function(_0x61e927,_0x2dffc9){return db[_0x1407('0x2a')]['create'](_0x61e927[_0x1407('0x46')],{})['then'](respondWithResult(_0x2dffc9,0xc9))['catch'](handleError(_0x2dffc9,null));};exports[_0x1407('0x22')]=function(_0xaebb7c,_0x1220ff){if(_0xaebb7c[_0x1407('0x46')]['id']){delete _0xaebb7c['body']['id'];}return db['VtigerConfiguration'][_0x1407('0x43')]({'where':{'id':_0xaebb7c['params']['id']}})['then'](handleEntityNotFound(_0x1220ff,null))[_0x1407('0x23')](saveUpdates(_0xaebb7c[_0x1407('0x46')],null))[_0x1407('0x23')](respondWithResult(_0x1220ff,null))[_0x1407('0x44')](handleError(_0x1220ff,null));};exports[_0x1407('0x24')]=function(_0x47182a,_0x4cfd16){return db[_0x1407('0x2a')][_0x1407('0x43')]({'where':{'id':_0x47182a[_0x1407('0x41')]['id']}})[_0x1407('0x23')](handleEntityNotFound(_0x4cfd16,null))[_0x1407('0x23')](removeEntity(_0x4cfd16,null))[_0x1407('0x44')](handleError(_0x4cfd16,null));};exports[_0x1407('0x47')]=function(_0x303984,_0x33f093,_0x17760d){var _0x3a4617={};var _0x2a74b5={};var _0x422bfa;var _0x420968;return db[_0x1407('0x2a')]['findOne']({'where':{'id':_0x303984[_0x1407('0x41')]['id']}})[_0x1407('0x23')](handleEntityNotFound(_0x33f093,null))[_0x1407('0x23')](function(_0x6b59b4){if(_0x6b59b4){_0x422bfa=_0x6b59b4;_0x2a74b5['model']=_[_0x1407('0x42')](db[_0x1407('0x48')][_0x1407('0x2b')]);_0x2a74b5[_0x1407('0x2e')]=_['keys'](_0x303984[_0x1407('0x2e')]);_0x2a74b5['filters']=_[_0x1407('0x30')](_0x2a74b5['model'],_0x2a74b5['query']);_0x3a4617['attributes']=_[_0x1407('0x30')](_0x2a74b5[_0x1407('0x31')],qs[_0x1407('0x32')](_0x303984[_0x1407('0x2e')]['fields']));_0x3a4617['attributes']=_0x3a4617[_0x1407('0x33')][_0x1407('0x34')]?_0x3a4617[_0x1407('0x33')]:_0x2a74b5[_0x1407('0x31')];_0x3a4617[_0x1407('0x36')]=qs['sort'](_0x303984[_0x1407('0x2e')][_0x1407('0x37')]);_0x3a4617[_0x1407('0x38')]=qs[_0x1407('0x2f')](_['pick'](_0x303984[_0x1407('0x2e')],_0x2a74b5[_0x1407('0x2f')]));if(_0x303984[_0x1407('0x2e')][_0x1407('0x3a')]){_0x3a4617[_0x1407('0x38')]=_['merge'](_0x3a4617[_0x1407('0x38')],{'$or':_[_0x1407('0x29')](_0x3a4617['attributes'],function(_0x1d5eeb){var _0x234a82={};_0x234a82[_0x1d5eeb]={'$like':'%'+_0x303984[_0x1407('0x2e')]['filter']+'%'};return _0x234a82;})});}_0x3a4617=_[_0x1407('0x3b')]({},_0x3a4617,_0x303984[_0x1407('0x3c')]);return _0x422bfa[_0x1407('0x47')](_0x3a4617);}})[_0x1407('0x23')](function(_0x3077e0){if(_0x3077e0){_0x420968=_0x3077e0[_0x1407('0x34')];if(!_0x303984[_0x1407('0x2e')][_0x1407('0x49')](_0x1407('0x35'))){_0x3a4617[_0x1407('0x1d')]=qs['limit'](_0x303984['query'][_0x1407('0x1d')]);_0x3a4617[_0x1407('0x1b')]=qs[_0x1407('0x1b')](_0x303984[_0x1407('0x2e')][_0x1407('0x1b')]);}return _0x422bfa[_0x1407('0x47')](_0x3a4617);}})[_0x1407('0x23')](function(_0x412cfc){if(_0x412cfc){return _0x412cfc?{'count':_0x420968,'rows':_0x412cfc}:null;}})['then'](respondWithResult(_0x33f093,null))[_0x1407('0x44')](handleError(_0x33f093,null));};exports[_0x1407('0x4a')]=function(_0x1751d7,_0x5f3d39,_0x41d334){var _0x440bc0={};var _0x118cec={};var _0x43f551;var _0x781e3e;return db['VtigerConfiguration'][_0x1407('0x4b')]({'where':{'id':_0x1751d7[_0x1407('0x41')]['id']}})[_0x1407('0x23')](handleEntityNotFound(_0x5f3d39,null))[_0x1407('0x23')](function(_0x5c56e1){if(_0x5c56e1){_0x43f551=_0x5c56e1;_0x118cec[_0x1407('0x31')]=_[_0x1407('0x42')](db[_0x1407('0x48')]['rawAttributes']);_0x118cec['query']=_['keys'](_0x1751d7[_0x1407('0x2e')]);_0x118cec[_0x1407('0x2f')]=_[_0x1407('0x30')](_0x118cec[_0x1407('0x31')],_0x118cec[_0x1407('0x2e')]);_0x440bc0[_0x1407('0x33')]=_[_0x1407('0x30')](_0x118cec['model'],qs[_0x1407('0x32')](_0x1751d7[_0x1407('0x2e')][_0x1407('0x32')]));_0x440bc0['attributes']=_0x440bc0['attributes'][_0x1407('0x34')]?_0x440bc0[_0x1407('0x33')]:_0x118cec[_0x1407('0x31')];_0x440bc0[_0x1407('0x36')]=qs[_0x1407('0x37')](_0x1751d7[_0x1407('0x2e')][_0x1407('0x37')]);_0x440bc0[_0x1407('0x38')]=qs[_0x1407('0x2f')](_[_0x1407('0x39')](_0x1751d7[_0x1407('0x2e')],_0x118cec[_0x1407('0x2f')]));if(_0x1751d7['query'][_0x1407('0x3a')]){_0x440bc0[_0x1407('0x38')]=_[_0x1407('0x3b')](_0x440bc0[_0x1407('0x38')],{'$or':_[_0x1407('0x29')](_0x440bc0[_0x1407('0x33')],function(_0x33b54c){var _0x472be5={};_0x472be5[_0x33b54c]={'$like':'%'+_0x1751d7[_0x1407('0x2e')][_0x1407('0x3a')]+'%'};return _0x472be5;})});}_0x440bc0=_['merge']({},_0x440bc0,_0x1751d7[_0x1407('0x3c')]);return _0x43f551['getSubjects'](_0x440bc0);}})[_0x1407('0x23')](function(_0x23dfe0){if(_0x23dfe0){_0x781e3e=_0x23dfe0['length'];if(!_0x1751d7[_0x1407('0x2e')][_0x1407('0x49')](_0x1407('0x35'))){_0x440bc0[_0x1407('0x1d')]=qs[_0x1407('0x1d')](_0x1751d7[_0x1407('0x2e')]['limit']);_0x440bc0[_0x1407('0x1b')]=qs[_0x1407('0x1b')](_0x1751d7[_0x1407('0x2e')][_0x1407('0x1b')]);}return _0x43f551[_0x1407('0x4a')](_0x440bc0);}})['then'](function(_0x2cb8b8){if(_0x2cb8b8){return _0x2cb8b8?{'count':_0x781e3e,'rows':_0x2cb8b8}:null;}})['then'](respondWithResult(_0x5f3d39,null))[_0x1407('0x44')](handleError(_0x5f3d39,null));};exports['getDescriptions']=function(_0x14a810,_0x5c5b0e,_0xcd5b32){var _0x160cad={};var _0x92d66c={};var _0x10d8ac;var _0x502469;return db[_0x1407('0x2a')][_0x1407('0x4b')]({'where':{'id':_0x14a810[_0x1407('0x41')]['id']}})[_0x1407('0x23')](handleEntityNotFound(_0x5c5b0e,null))[_0x1407('0x23')](function(_0x251011){if(_0x251011){_0x10d8ac=_0x251011;_0x92d66c[_0x1407('0x31')]=_[_0x1407('0x42')](db[_0x1407('0x48')][_0x1407('0x2b')]);_0x92d66c['query']=_[_0x1407('0x42')](_0x14a810[_0x1407('0x2e')]);_0x92d66c[_0x1407('0x2f')]=_[_0x1407('0x30')](_0x92d66c[_0x1407('0x31')],_0x92d66c[_0x1407('0x2e')]);_0x160cad[_0x1407('0x33')]=_[_0x1407('0x30')](_0x92d66c['model'],qs[_0x1407('0x32')](_0x14a810[_0x1407('0x2e')][_0x1407('0x32')]));_0x160cad['attributes']=_0x160cad['attributes'][_0x1407('0x34')]?_0x160cad[_0x1407('0x33')]:_0x92d66c[_0x1407('0x31')];_0x160cad['order']=qs['sort'](_0x14a810[_0x1407('0x2e')][_0x1407('0x37')]);_0x160cad[_0x1407('0x38')]=qs[_0x1407('0x2f')](_[_0x1407('0x39')](_0x14a810[_0x1407('0x2e')],_0x92d66c[_0x1407('0x2f')]));if(_0x14a810[_0x1407('0x2e')]['filter']){_0x160cad[_0x1407('0x38')]=_['merge'](_0x160cad[_0x1407('0x38')],{'$or':_[_0x1407('0x29')](_0x160cad[_0x1407('0x33')],function(_0x143320){var _0x580b86={};_0x580b86[_0x143320]={'$like':'%'+_0x14a810[_0x1407('0x2e')]['filter']+'%'};return _0x580b86;})});}_0x160cad=_[_0x1407('0x3b')]({},_0x160cad,_0x14a810['options']);return _0x10d8ac[_0x1407('0x4c')](_0x160cad);}})['then'](function(_0x213176){if(_0x213176){_0x502469=_0x213176[_0x1407('0x34')];if(!_0x14a810[_0x1407('0x2e')][_0x1407('0x49')](_0x1407('0x35'))){_0x160cad['limit']=qs['limit'](_0x14a810['query']['limit']);_0x160cad[_0x1407('0x1b')]=qs[_0x1407('0x1b')](_0x14a810[_0x1407('0x2e')][_0x1407('0x1b')]);}return _0x10d8ac[_0x1407('0x4c')](_0x160cad);}})['then'](function(_0x4cb641){if(_0x4cb641){return _0x4cb641?{'count':_0x502469,'rows':_0x4cb641}:null;}})['then'](respondWithResult(_0x5c5b0e,null))[_0x1407('0x44')](handleError(_0x5c5b0e,null));};
\ No newline at end of file
index 8e3651a..40c503d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4952=['../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x9bbe5b,_0x3fb975){var _0xd850c1=function(_0x453493){while(--_0x453493){_0x9bbe5b['push'](_0x9bbe5b['shift']());}};_0xd850c1(++_0x3fb975);}(_0x4952,0x155));var _0x2495=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x4952[_0x20cf8a];return _0x54e165;};'use strict';var _=require(_0x2495('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2495('0x1'));var moment=require(_0x2495('0x2'));var BPromise=require(_0x2495('0x3'));var rp=require(_0x2495('0x4'));var fs=require('fs');var path=require(_0x2495('0x5'));var rimraf=require(_0x2495('0x6'));var config=require(_0x2495('0x7'));var attributes=require(_0x2495('0x8'));module['exports']=function(_0x857515,_0x171dbb){return _0x857515[_0x2495('0x9')](_0x2495('0xa'),attributes,{'tableName':_0x2495('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a62=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger'];(function(_0x4ed9a2,_0x17dcb6){var _0x41a4b2=function(_0x5eb1d2){while(--_0x5eb1d2){_0x4ed9a2['push'](_0x4ed9a2['shift']());}};_0x41a4b2(++_0x17dcb6);}(_0x5a62,0x189));var _0x25a6=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0x5a62[_0x2a5099];return _0x2802f1;};'use strict';var _=require(_0x25a6('0x0'));var util=require(_0x25a6('0x1'));var logger=require(_0x25a6('0x2'))('api');var moment=require(_0x25a6('0x3'));var BPromise=require(_0x25a6('0x4'));var rp=require(_0x25a6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25a6('0x6'));var config=require(_0x25a6('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x25a6('0x8')]=function(_0x235ae5,_0x432552){return _0x235ae5[_0x25a6('0x9')](_0x25a6('0xa'),attributes,{'tableName':_0x25a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 95e87ad..73bf0fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe809=['result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x19baf5,_0x24ff76){var _0x418b0d=function(_0x11f1c2){while(--_0x11f1c2){_0x19baf5['push'](_0x19baf5['shift']());}};_0x418b0d(++_0x24ff76);}(_0xe809,0x18d));var _0x9e80=function(_0x15f90a,_0x355695){_0x15f90a=_0x15f90a-0x0;var _0x22b756=_0xe809[_0x15f90a];return _0x22b756;};'use strict';var _=require(_0x9e80('0x0'));var util=require('util');var moment=require(_0x9e80('0x1'));var BPromise=require(_0x9e80('0x2'));var rs=require(_0x9e80('0x3'));var fs=require('fs');var Redis=require(_0x9e80('0x4'));var db=require(_0x9e80('0x5'))['db'];var utils=require(_0x9e80('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9e80('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9e80('0x8')][_0x9e80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49e9f1,_0x559779,_0x212e30){return new BPromise(function(_0x4c6799,_0x7c553c){return client[_0x9e80('0xa')](_0x49e9f1,_0x212e30)[_0x9e80('0xb')](function(_0x2379b4){logger[_0x9e80('0xc')](_0x9e80('0xd'),_0x559779,_0x9e80('0xe'));logger[_0x9e80('0xf')](_0x9e80('0x10'),_0x559779,'request\x20sent',JSON[_0x9e80('0x11')](_0x2379b4));if(_0x2379b4[_0x9e80('0x12')]){if(_0x2379b4['error'][_0x9e80('0x13')]===0x1f4){logger[_0x9e80('0x12')](_0x9e80('0xd'),_0x559779,_0x2379b4['error'][_0x9e80('0x14')]);return _0x7c553c(_0x2379b4[_0x9e80('0x12')]['message']);}logger[_0x9e80('0x12')](_0x9e80('0xd'),_0x559779,_0x2379b4[_0x9e80('0x12')][_0x9e80('0x14')]);return _0x4c6799(_0x2379b4[_0x9e80('0x12')][_0x9e80('0x14')]);}else{logger[_0x9e80('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x559779,_0x9e80('0xe'));_0x4c6799(_0x2379b4[_0x9e80('0x15')][_0x9e80('0x14')]);}})['catch'](function(_0x673b96){logger[_0x9e80('0x12')](_0x9e80('0xd'),_0x559779,_0x673b96);_0x7c553c(_0x673b96);});});}
\ No newline at end of file
+var _0x4a7f=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x1bdc58,_0x459b5e){var _0x4fd894=function(_0x1cf56b){while(--_0x1cf56b){_0x1bdc58['push'](_0x1bdc58['shift']());}};_0x4fd894(++_0x459b5e);}(_0x4a7f,0xba));var _0xf4a7=function(_0x4f3fa5,_0x244033){_0x4f3fa5=_0x4f3fa5-0x0;var _0x15f710=_0x4a7f[_0x4f3fa5];return _0x15f710;};'use strict';var _=require(_0xf4a7('0x0'));var util=require(_0xf4a7('0x1'));var moment=require(_0xf4a7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4a7('0x3'));var db=require(_0xf4a7('0x4'))['db'];var utils=require(_0xf4a7('0x5'));var logger=require(_0xf4a7('0x6'))('rpc');var config=require(_0xf4a7('0x7'));var jayson=require(_0xf4a7('0x8'));var client=jayson[_0xf4a7('0x9')][_0xf4a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5814ce,_0x5afbcb,_0xd2b4b0){return new BPromise(function(_0x49c753,_0x2c9f40){return client['request'](_0x5814ce,_0xd2b4b0)[_0xf4a7('0xb')](function(_0x4a9b56){logger['info'](_0xf4a7('0xc'),_0x5afbcb,_0xf4a7('0xd'));logger[_0xf4a7('0xe')](_0xf4a7('0xf'),_0x5afbcb,'request\x20sent',JSON['stringify'](_0x4a9b56));if(_0x4a9b56[_0xf4a7('0x10')]){if(_0x4a9b56[_0xf4a7('0x10')][_0xf4a7('0x11')]===0x1f4){logger['error'](_0xf4a7('0xc'),_0x5afbcb,_0x4a9b56['error']['message']);return _0x2c9f40(_0x4a9b56['error'][_0xf4a7('0x12')]);}logger[_0xf4a7('0x10')](_0xf4a7('0xc'),_0x5afbcb,_0x4a9b56[_0xf4a7('0x10')][_0xf4a7('0x12')]);return _0x49c753(_0x4a9b56[_0xf4a7('0x10')][_0xf4a7('0x12')]);}else{logger[_0xf4a7('0x13')](_0xf4a7('0xc'),_0x5afbcb,_0xf4a7('0xd'));_0x49c753(_0x4a9b56[_0xf4a7('0x14')][_0xf4a7('0x12')]);}})[_0xf4a7('0x15')](function(_0x1112bd){logger['error'](_0xf4a7('0xc'),_0x5afbcb,_0x1112bd);_0x2c9f40(_0x1112bd);});});}
\ No newline at end of file
index f850fcf..e15b5d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa793=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x45fa5e,_0x3a5bb4){var _0x4dbf6b=function(_0x5d8fd0){while(--_0x5d8fd0){_0x45fa5e['push'](_0x45fa5e['shift']());}};_0x4dbf6b(++_0x3a5bb4);}(_0xa793,0x144));var _0x3a79=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0xa793[_0x45313f];return _0x402910;};'use strict';var multer=require(_0x3a79('0x0'));var util=require('util');var path=require(_0x3a79('0x1'));var timeout=require(_0x3a79('0x2'));var express=require(_0x3a79('0x3'));var router=express[_0x3a79('0x4')]();var fs_extra=require(_0x3a79('0x5'));var auth=require(_0x3a79('0x6'));var interaction=require(_0x3a79('0x7'));var config=require(_0x3a79('0x8'));var controller=require(_0x3a79('0x9'));router[_0x3a79('0xa')]('/',auth[_0x3a79('0xb')](),controller[_0x3a79('0xc')]);router[_0x3a79('0xa')](_0x3a79('0xd'),auth['isAuthenticated'](),controller[_0x3a79('0xe')]);router['post']('/',auth[_0x3a79('0xb')](),controller[_0x3a79('0xf')]);router['put'](_0x3a79('0xd'),auth['isAuthenticated'](),controller[_0x3a79('0x10')]);router[_0x3a79('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3a79('0x12')]);module[_0x3a79('0x13')]=router;
\ No newline at end of file
+var _0x4f97=['post','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x2df320,_0x31f3b2){var _0x53f24c=function(_0x14ce67){while(--_0x14ce67){_0x2df320['push'](_0x2df320['shift']());}};_0x53f24c(++_0x31f3b2);}(_0x4f97,0x115));var _0x74f9=function(_0x4be309,_0x54058b){_0x4be309=_0x4be309-0x0;var _0x2951c5=_0x4f97[_0x4be309];return _0x2951c5;};'use strict';var multer=require(_0x74f9('0x0'));var util=require(_0x74f9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x74f9('0x2'));var router=express[_0x74f9('0x3')]();var fs_extra=require(_0x74f9('0x4'));var auth=require(_0x74f9('0x5'));var interaction=require(_0x74f9('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0x74f9('0x7')]('/',auth[_0x74f9('0x8')](),controller[_0x74f9('0x9')]);router['get'](_0x74f9('0xa'),auth['isAuthenticated'](),controller[_0x74f9('0xb')]);router[_0x74f9('0xc')]('/',auth[_0x74f9('0x8')](),controller['create']);router[_0x74f9('0xd')]('/:id',auth[_0x74f9('0x8')](),controller[_0x74f9('0xe')]);router['delete']('/:id',auth[_0x74f9('0x8')](),controller[_0x74f9('0xf')]);module[_0x74f9('0x10')]=router;
\ No newline at end of file
index 4204909..41a7dab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fa=['picklist','STRING','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x1a70e5,_0x57397c){var _0x4030d0=function(_0x52469d){while(--_0x52469d){_0x1a70e5['push'](_0x1a70e5['shift']());}};_0x4030d0(++_0x57397c);}(_0xe2fa,0x7a));var _0xae2f=function(_0x3241dc,_0x1cb62e){_0x3241dc=_0x3241dc-0x0;var _0x2060a7=_0xe2fa[_0x3241dc];return _0x2060a7;};'use strict';var Sequelize=require(_0xae2f('0x0'));module[_0xae2f('0x1')]={'type':{'type':Sequelize['ENUM'](_0xae2f('0x2'),_0xae2f('0x3'),_0xae2f('0x4'),_0xae2f('0x5'),_0xae2f('0x6')),'defaultValue':_0xae2f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xae2f('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xae2f('0x2'),'variable',_0xae2f('0x4'))},'keyContent':{'type':Sequelize[_0xae2f('0x7')]},'idField':{'type':Sequelize[_0xae2f('0x7')]},'nameField':{'type':Sequelize[_0xae2f('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xae2f('0x7')]}};
\ No newline at end of file
+var _0x5ffe=['exports','ENUM','string','variable','customVariable','STRING','BOOLEAN'];(function(_0x225157,_0x3eaac2){var _0x84bb49=function(_0x13af44){while(--_0x13af44){_0x225157['push'](_0x225157['shift']());}};_0x84bb49(++_0x3eaac2);}(_0x5ffe,0x1c7));var _0xe5ff=function(_0x4e6cec,_0x1640c8){_0x4e6cec=_0x4e6cec-0x0;var _0x49f9e3=_0x5ffe[_0x4e6cec];return _0x49f9e3;};'use strict';var Sequelize=require('sequelize');module[_0xe5ff('0x0')]={'type':{'type':Sequelize[_0xe5ff('0x1')](_0xe5ff('0x2'),_0xe5ff('0x3'),_0xe5ff('0x4'),'keyValue','picklist'),'defaultValue':_0xe5ff('0x2')},'content':{'type':Sequelize[_0xe5ff('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe5ff('0x1')](_0xe5ff('0x2'),_0xe5ff('0x3'),_0xe5ff('0x4'))},'keyContent':{'type':Sequelize[_0xe5ff('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe5ff('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe5ff('0x5')]}};
\ No newline at end of file
index 5748a29..0431862 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cec=['hasOwnProperty','nolimit','order','sort','where','filter','options','VtigerField','includeAll','rows','catch','params','merge','find','create','body','destroy','zip-dir','fast-json-patch','moment','mustache','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','apply','reject','update','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x4455cb,_0x5a92a0){var _0x44339b=function(_0xc8f52b){while(--_0xc8f52b){_0x4455cb['push'](_0x4455cb['shift']());}};_0x44339b(++_0x5a92a0);}(_0x0cec,0x1c1));var _0xc0ce=function(_0xe92d78,_0x3faed8){_0xe92d78=_0xe92d78-0x0;var _0x433b0c=_0x0cec[_0xe92d78];return _0x433b0c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc0ce('0x0'));var jsonpatch=require(_0xc0ce('0x1'));var rp=require('request-promise');var moment=require(_0xc0ce('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc0ce('0x3'));var util=require(_0xc0ce('0x4'));var path=require(_0xc0ce('0x5'));var sox=require(_0xc0ce('0x6'));var csv=require(_0xc0ce('0x7'));var ejs=require(_0xc0ce('0x8'));var fs=require('fs');var fs_extra=require(_0xc0ce('0x9'));var _=require(_0xc0ce('0xa'));var squel=require(_0xc0ce('0xb'));var crypto=require('crypto');var jsforce=require(_0xc0ce('0xc'));var deskjs=require(_0xc0ce('0xd'));var toCsv=require(_0xc0ce('0x7'));var querystring=require(_0xc0ce('0xe'));var Papa=require(_0xc0ce('0xf'));var Redis=require(_0xc0ce('0x10'));var authService=require(_0xc0ce('0x11'));var qs=require(_0xc0ce('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0ce('0x13'));var logger=require(_0xc0ce('0x14'))(_0xc0ce('0x15'));var utils=require(_0xc0ce('0x16'));var config=require(_0xc0ce('0x17'));var licenseUtil=require(_0xc0ce('0x18'));var db=require(_0xc0ce('0x19'))['db'];function respondWithStatusCode(_0x1afa42,_0x5d1556){_0x5d1556=_0x5d1556||0xcc;return function(_0x453c25){if(_0x453c25){return _0x1afa42[_0xc0ce('0x1a')](_0x5d1556);}return _0x1afa42['status'](_0x5d1556)[_0xc0ce('0x1b')]();};}function respondWithResult(_0x4d185c,_0x135d1f){_0x135d1f=_0x135d1f||0xc8;return function(_0x4a35d8){if(_0x4a35d8){return _0x4d185c[_0xc0ce('0x1c')](_0x135d1f)[_0xc0ce('0x1d')](_0x4a35d8);}};}function respondWithFilteredResult(_0x1ec836,_0x2b5712){return function(_0x2ac08a){if(_0x2ac08a){var _0x1bda65=typeof _0x2b5712['offset']==='undefined'&&typeof _0x2b5712[_0xc0ce('0x1e')]===_0xc0ce('0x1f');var _0x33987c=_0x2ac08a['count'];var _0x8f8ebb=_0x1bda65?0x0:_0x2b5712['offset'];var _0x227381=_0x1bda65?_0x2ac08a[_0xc0ce('0x20')]:_0x2b5712[_0xc0ce('0x21')]+_0x2b5712[_0xc0ce('0x1e')];var _0x17a310;if(_0x227381>=_0x33987c){_0x227381=_0x33987c;_0x17a310=0xc8;}else{_0x17a310=0xce;}_0x1ec836[_0xc0ce('0x1c')](_0x17a310);return _0x1ec836[_0xc0ce('0x22')]('Content-Range',_0x8f8ebb+'-'+_0x227381+'/'+_0x33987c)['json'](_0x2ac08a);}return null;};}function patchUpdates(_0x40efdc){return function(_0x26214e){try{jsonpatch[_0xc0ce('0x23')](_0x26214e,_0x40efdc,!![]);}catch(_0x4ecde9){return BPromise[_0xc0ce('0x24')](_0x4ecde9);}return _0x26214e['save']();};}function saveUpdates(_0x74b2e5,_0xdd89c3){return function(_0x4de982){if(_0x4de982){return _0x4de982[_0xc0ce('0x25')](_0x74b2e5)[_0xc0ce('0x26')](function(_0xc2f35){return _0xc2f35;});}return null;};}function removeEntity(_0x5e07cb,_0x39fc36){return function(_0x21dad2){if(_0x21dad2){return _0x21dad2['destroy']()[_0xc0ce('0x26')](function(){_0x5e07cb[_0xc0ce('0x1c')](0xcc)[_0xc0ce('0x1b')]();});}};}function handleEntityNotFound(_0x20e513,_0x10fcf2){return function(_0x162106){if(!_0x162106){_0x20e513[_0xc0ce('0x1a')](0x194);}return _0x162106;};}function handleError(_0x16553d,_0x10c710){_0x10c710=_0x10c710||0x1f4;return function(_0x9c4dfd){logger['error'](_0x9c4dfd[_0xc0ce('0x27')]);if(_0x9c4dfd[_0xc0ce('0x28')]){delete _0x9c4dfd[_0xc0ce('0x28')];}_0x16553d['status'](_0x10c710)[_0xc0ce('0x29')](_0x9c4dfd);};}exports[_0xc0ce('0x2a')]=function(_0x5612ef,_0x24b812){var _0x5a32ae={},_0x156c29={},_0x10738c={'count':0x0,'rows':[]};var _0x47b613=_[_0xc0ce('0x2b')](db['VtigerField']['rawAttributes'],function(_0x83f2e0){return{'name':_0x83f2e0[_0xc0ce('0x2c')],'type':_0x83f2e0[_0xc0ce('0x2d')][_0xc0ce('0x2e')]};});_0x156c29[_0xc0ce('0x2f')]=_[_0xc0ce('0x2b')](_0x47b613,'name');_0x156c29[_0xc0ce('0x30')]=_[_0xc0ce('0x31')](_0x5612ef[_0xc0ce('0x30')]);_0x156c29[_0xc0ce('0x32')]=_[_0xc0ce('0x33')](_0x156c29['model'],_0x156c29[_0xc0ce('0x30')]);_0x5a32ae[_0xc0ce('0x34')]=_[_0xc0ce('0x33')](_0x156c29[_0xc0ce('0x2f')],qs[_0xc0ce('0x35')](_0x5612ef['query'][_0xc0ce('0x35')]));_0x5a32ae['attributes']=_0x5a32ae[_0xc0ce('0x34')][_0xc0ce('0x36')]?_0x5a32ae[_0xc0ce('0x34')]:_0x156c29['model'];if(!_0x5612ef['query'][_0xc0ce('0x37')](_0xc0ce('0x38'))){_0x5a32ae[_0xc0ce('0x1e')]=qs[_0xc0ce('0x1e')](_0x5612ef[_0xc0ce('0x30')][_0xc0ce('0x1e')]);_0x5a32ae['offset']=qs['offset'](_0x5612ef[_0xc0ce('0x30')][_0xc0ce('0x21')]);}_0x5a32ae[_0xc0ce('0x39')]=qs[_0xc0ce('0x3a')](_0x5612ef[_0xc0ce('0x30')]['sort']);_0x5a32ae[_0xc0ce('0x3b')]=qs[_0xc0ce('0x32')](_['pick'](_0x5612ef[_0xc0ce('0x30')],_0x156c29['filters']),_0x47b613);if(_0x5612ef['query'][_0xc0ce('0x3c')]){_0x5a32ae['where']=_['merge'](_0x5a32ae[_0xc0ce('0x3b')],{'$or':_[_0xc0ce('0x2b')](_0x47b613,function(_0x521e3b){if(_0x521e3b[_0xc0ce('0x2d')]!=='VIRTUAL'){var _0x4b5e2c={};_0x4b5e2c[_0x521e3b[_0xc0ce('0x28')]]={'$like':'%'+_0x5612ef['query'][_0xc0ce('0x3c')]+'%'};return _0x4b5e2c;}})});}_0x5a32ae=_['merge']({},_0x5a32ae,_0x5612ef[_0xc0ce('0x3d')]);var _0x1b1fab={'where':_0x5a32ae[_0xc0ce('0x3b')]};return db[_0xc0ce('0x3e')][_0xc0ce('0x20')](_0x1b1fab)[_0xc0ce('0x26')](function(_0x30403e){_0x10738c[_0xc0ce('0x20')]=_0x30403e;if(_0x5612ef[_0xc0ce('0x30')][_0xc0ce('0x3f')]){_0x5a32ae['include']=[{'all':!![]}];}return db[_0xc0ce('0x3e')]['findAll'](_0x5a32ae);})[_0xc0ce('0x26')](function(_0x326a13){_0x10738c[_0xc0ce('0x40')]=_0x326a13;return _0x10738c;})[_0xc0ce('0x26')](respondWithFilteredResult(_0x24b812,_0x5a32ae))[_0xc0ce('0x41')](handleError(_0x24b812,null));};exports['show']=function(_0x3dab89,_0x2d95d6){var _0x29b3bd={'raw':!![],'where':{'id':_0x3dab89[_0xc0ce('0x42')]['id']}},_0x2d52a8={};_0x2d52a8[_0xc0ce('0x2f')]=_['keys'](db[_0xc0ce('0x3e')]['rawAttributes']);_0x2d52a8[_0xc0ce('0x30')]=_[_0xc0ce('0x31')](_0x3dab89[_0xc0ce('0x30')]);_0x2d52a8[_0xc0ce('0x32')]=_['intersection'](_0x2d52a8['model'],_0x2d52a8[_0xc0ce('0x30')]);_0x29b3bd[_0xc0ce('0x34')]=_[_0xc0ce('0x33')](_0x2d52a8[_0xc0ce('0x2f')],qs[_0xc0ce('0x35')](_0x3dab89['query'][_0xc0ce('0x35')]));_0x29b3bd[_0xc0ce('0x34')]=_0x29b3bd[_0xc0ce('0x34')][_0xc0ce('0x36')]?_0x29b3bd[_0xc0ce('0x34')]:_0x2d52a8['model'];if(_0x3dab89['query'][_0xc0ce('0x3f')]){_0x29b3bd['include']=[{'all':!![]}];}_0x29b3bd=_[_0xc0ce('0x43')]({},_0x29b3bd,_0x3dab89['options']);return db['VtigerField'][_0xc0ce('0x44')](_0x29b3bd)[_0xc0ce('0x26')](handleEntityNotFound(_0x2d95d6,null))[_0xc0ce('0x26')](respondWithResult(_0x2d95d6,null))[_0xc0ce('0x41')](handleError(_0x2d95d6,null));};exports[_0xc0ce('0x45')]=function(_0x57444f,_0x30fa53){return db[_0xc0ce('0x3e')]['create'](_0x57444f[_0xc0ce('0x46')],{})[_0xc0ce('0x26')](respondWithResult(_0x30fa53,0xc9))['catch'](handleError(_0x30fa53,null));};exports['update']=function(_0x34a1b8,_0x5b5261){if(_0x34a1b8[_0xc0ce('0x46')]['id']){delete _0x34a1b8[_0xc0ce('0x46')]['id'];}return db[_0xc0ce('0x3e')][_0xc0ce('0x44')]({'where':{'id':_0x34a1b8[_0xc0ce('0x42')]['id']}})[_0xc0ce('0x26')](handleEntityNotFound(_0x5b5261,null))[_0xc0ce('0x26')](saveUpdates(_0x34a1b8['body'],null))[_0xc0ce('0x26')](respondWithResult(_0x5b5261,null))[_0xc0ce('0x41')](handleError(_0x5b5261,null));};exports[_0xc0ce('0x47')]=function(_0x515b72,_0x435ce8){return db['VtigerField'][_0xc0ce('0x44')]({'where':{'id':_0x515b72[_0xc0ce('0x42')]['id']}})['then'](handleEntityNotFound(_0x435ce8,null))['then'](removeEntity(_0x435ce8,null))['catch'](handleError(_0x435ce8,null));};
\ No newline at end of file
+var _0x2361=['destroy','error','name','send','index','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','VtigerField','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x2499e1,_0x46cedd){var _0x26cf27=function(_0x16ab10){while(--_0x16ab10){_0x2499e1['push'](_0x2499e1['shift']());}};_0x26cf27(++_0x46cedd);}(_0x2361,0x102));var _0x1236=function(_0x35fa2a,_0x2a0b4a){_0x35fa2a=_0x35fa2a-0x0;var _0x1be582=_0x2361[_0x35fa2a];return _0x1be582;};'use strict';var emlformat=require(_0x1236('0x0'));var rimraf=require(_0x1236('0x1'));var zipdir=require(_0x1236('0x2'));var jsonpatch=require(_0x1236('0x3'));var rp=require(_0x1236('0x4'));var moment=require(_0x1236('0x5'));var BPromise=require(_0x1236('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1236('0x7'));var csv=require(_0x1236('0x8'));var ejs=require(_0x1236('0x9'));var fs=require('fs');var fs_extra=require(_0x1236('0xa'));var _=require(_0x1236('0xb'));var squel=require(_0x1236('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1236('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1236('0xe'));var Papa=require(_0x1236('0xf'));var Redis=require(_0x1236('0x10'));var authService=require(_0x1236('0x11'));var qs=require(_0x1236('0x12'));var as=require(_0x1236('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1236('0x14'))('api');var utils=require(_0x1236('0x15'));var config=require(_0x1236('0x16'));var licenseUtil=require(_0x1236('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d9eda,_0x5e1daf){_0x5e1daf=_0x5e1daf||0xcc;return function(_0x31cfbd){if(_0x31cfbd){return _0x5d9eda[_0x1236('0x18')](_0x5e1daf);}return _0x5d9eda[_0x1236('0x19')](_0x5e1daf)['end']();};}function respondWithResult(_0x36c8ce,_0x51d0ad){_0x51d0ad=_0x51d0ad||0xc8;return function(_0x114af4){if(_0x114af4){return _0x36c8ce['status'](_0x51d0ad)[_0x1236('0x1a')](_0x114af4);}};}function respondWithFilteredResult(_0x4cb094,_0x1a7557){return function(_0x429be4){if(_0x429be4){var _0x58c0d5=typeof _0x1a7557[_0x1236('0x1b')]===_0x1236('0x1c')&&typeof _0x1a7557[_0x1236('0x1d')]===_0x1236('0x1c');var _0x33cd54=_0x429be4[_0x1236('0x1e')];var _0x2708bf=_0x58c0d5?0x0:_0x1a7557[_0x1236('0x1b')];var _0x3d86f5=_0x58c0d5?_0x429be4[_0x1236('0x1e')]:_0x1a7557['offset']+_0x1a7557[_0x1236('0x1d')];var _0x5e8cc5;if(_0x3d86f5>=_0x33cd54){_0x3d86f5=_0x33cd54;_0x5e8cc5=0xc8;}else{_0x5e8cc5=0xce;}_0x4cb094[_0x1236('0x19')](_0x5e8cc5);return _0x4cb094[_0x1236('0x1f')](_0x1236('0x20'),_0x2708bf+'-'+_0x3d86f5+'/'+_0x33cd54)[_0x1236('0x1a')](_0x429be4);}return null;};}function patchUpdates(_0x2116ba){return function(_0x5c7d66){try{jsonpatch[_0x1236('0x21')](_0x5c7d66,_0x2116ba,!![]);}catch(_0x2148bd){return BPromise[_0x1236('0x22')](_0x2148bd);}return _0x5c7d66[_0x1236('0x23')]();};}function saveUpdates(_0x7552f6,_0x1ae667){return function(_0x1277b2){if(_0x1277b2){return _0x1277b2[_0x1236('0x24')](_0x7552f6)[_0x1236('0x25')](function(_0x2d9980){return _0x2d9980;});}return null;};}function removeEntity(_0x50d2b6,_0x215540){return function(_0x2b372c){if(_0x2b372c){return _0x2b372c[_0x1236('0x26')]()[_0x1236('0x25')](function(){_0x50d2b6[_0x1236('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3054e2,_0x308f99){return function(_0x3427b5){if(!_0x3427b5){_0x3054e2['sendStatus'](0x194);}return _0x3427b5;};}function handleError(_0x42000e,_0x3de8db){_0x3de8db=_0x3de8db||0x1f4;return function(_0xc8ed){logger[_0x1236('0x27')](_0xc8ed['stack']);if(_0xc8ed[_0x1236('0x28')]){delete _0xc8ed[_0x1236('0x28')];}_0x42000e[_0x1236('0x19')](_0x3de8db)[_0x1236('0x29')](_0xc8ed);};}exports[_0x1236('0x2a')]=function(_0x16fd4d,_0x43bb5b){var _0x1be250={},_0xcb6107={},_0x4d7e41={'count':0x0,'rows':[]};var _0x246423=_['map'](db['VtigerField']['rawAttributes'],function(_0x6eb44e){return{'name':_0x6eb44e['fieldName'],'type':_0x6eb44e['type'][_0x1236('0x2b')]};});_0xcb6107[_0x1236('0x2c')]=_[_0x1236('0x2d')](_0x246423,'name');_0xcb6107['query']=_[_0x1236('0x2e')](_0x16fd4d[_0x1236('0x2f')]);_0xcb6107[_0x1236('0x30')]=_[_0x1236('0x31')](_0xcb6107['model'],_0xcb6107['query']);_0x1be250[_0x1236('0x32')]=_[_0x1236('0x31')](_0xcb6107['model'],qs[_0x1236('0x33')](_0x16fd4d[_0x1236('0x2f')][_0x1236('0x33')]));_0x1be250[_0x1236('0x32')]=_0x1be250[_0x1236('0x32')][_0x1236('0x34')]?_0x1be250['attributes']:_0xcb6107[_0x1236('0x2c')];if(!_0x16fd4d[_0x1236('0x2f')][_0x1236('0x35')](_0x1236('0x36'))){_0x1be250['limit']=qs[_0x1236('0x1d')](_0x16fd4d[_0x1236('0x2f')][_0x1236('0x1d')]);_0x1be250[_0x1236('0x1b')]=qs[_0x1236('0x1b')](_0x16fd4d[_0x1236('0x2f')][_0x1236('0x1b')]);}_0x1be250[_0x1236('0x37')]=qs[_0x1236('0x38')](_0x16fd4d[_0x1236('0x2f')][_0x1236('0x38')]);_0x1be250[_0x1236('0x39')]=qs[_0x1236('0x30')](_[_0x1236('0x3a')](_0x16fd4d['query'],_0xcb6107['filters']),_0x246423);if(_0x16fd4d['query'][_0x1236('0x3b')]){_0x1be250[_0x1236('0x39')]=_[_0x1236('0x3c')](_0x1be250[_0x1236('0x39')],{'$or':_[_0x1236('0x2d')](_0x246423,function(_0x2f3aa6){if(_0x2f3aa6[_0x1236('0x3d')]!==_0x1236('0x3e')){var _0x3c2387={};_0x3c2387[_0x2f3aa6[_0x1236('0x28')]]={'$like':'%'+_0x16fd4d[_0x1236('0x2f')][_0x1236('0x3b')]+'%'};return _0x3c2387;}})});}_0x1be250=_[_0x1236('0x3c')]({},_0x1be250,_0x16fd4d['options']);var _0x35a3b4={'where':_0x1be250[_0x1236('0x39')]};return db[_0x1236('0x3f')]['count'](_0x35a3b4)[_0x1236('0x25')](function(_0x542ab3){_0x4d7e41[_0x1236('0x1e')]=_0x542ab3;if(_0x16fd4d[_0x1236('0x2f')][_0x1236('0x40')]){_0x1be250[_0x1236('0x41')]=[{'all':!![]}];}return db['VtigerField'][_0x1236('0x42')](_0x1be250);})[_0x1236('0x25')](function(_0x24277b){_0x4d7e41[_0x1236('0x43')]=_0x24277b;return _0x4d7e41;})[_0x1236('0x25')](respondWithFilteredResult(_0x43bb5b,_0x1be250))[_0x1236('0x44')](handleError(_0x43bb5b,null));};exports['show']=function(_0x512f2e,_0x1c6f09){var _0x394862={'raw':!![],'where':{'id':_0x512f2e[_0x1236('0x45')]['id']}},_0x5d5dda={};_0x5d5dda[_0x1236('0x2c')]=_[_0x1236('0x2e')](db[_0x1236('0x3f')][_0x1236('0x46')]);_0x5d5dda['query']=_[_0x1236('0x2e')](_0x512f2e[_0x1236('0x2f')]);_0x5d5dda['filters']=_['intersection'](_0x5d5dda[_0x1236('0x2c')],_0x5d5dda[_0x1236('0x2f')]);_0x394862['attributes']=_['intersection'](_0x5d5dda[_0x1236('0x2c')],qs[_0x1236('0x33')](_0x512f2e['query']['fields']));_0x394862[_0x1236('0x32')]=_0x394862[_0x1236('0x32')][_0x1236('0x34')]?_0x394862['attributes']:_0x5d5dda['model'];if(_0x512f2e['query'][_0x1236('0x40')]){_0x394862[_0x1236('0x41')]=[{'all':!![]}];}_0x394862=_['merge']({},_0x394862,_0x512f2e['options']);return db['VtigerField'][_0x1236('0x47')](_0x394862)[_0x1236('0x25')](handleEntityNotFound(_0x1c6f09,null))[_0x1236('0x25')](respondWithResult(_0x1c6f09,null))[_0x1236('0x44')](handleError(_0x1c6f09,null));};exports[_0x1236('0x48')]=function(_0x4856ae,_0x1e856b){return db[_0x1236('0x3f')]['create'](_0x4856ae[_0x1236('0x49')],{})[_0x1236('0x25')](respondWithResult(_0x1e856b,0xc9))[_0x1236('0x44')](handleError(_0x1e856b,null));};exports[_0x1236('0x24')]=function(_0xfc4fc,_0x14c8f8){if(_0xfc4fc['body']['id']){delete _0xfc4fc[_0x1236('0x49')]['id'];}return db[_0x1236('0x3f')][_0x1236('0x47')]({'where':{'id':_0xfc4fc['params']['id']}})[_0x1236('0x25')](handleEntityNotFound(_0x14c8f8,null))[_0x1236('0x25')](saveUpdates(_0xfc4fc[_0x1236('0x49')],null))[_0x1236('0x25')](respondWithResult(_0x14c8f8,null))[_0x1236('0x44')](handleError(_0x14c8f8,null));};exports[_0x1236('0x26')]=function(_0x4780fb,_0x3f2421){return db[_0x1236('0x3f')][_0x1236('0x47')]({'where':{'id':_0x4780fb[_0x1236('0x45')]['id']}})[_0x1236('0x25')](handleEntityNotFound(_0x3f2421,null))['then'](removeEntity(_0x3f2421,null))[_0x1236('0x44')](handleError(_0x3f2421,null));};
\ No newline at end of file
index d1707d5..7655f55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fa5=['define','VtigerField','vtiger_unique_index','FieldId','lodash','util','../../config/logger','moment','path','rimraf','./intVtigerField.attributes','exports'];(function(_0x48849a,_0xe1251e){var _0x43143e=function(_0x370707){while(--_0x370707){_0x48849a['push'](_0x48849a['shift']());}};_0x43143e(++_0xe1251e);}(_0x3fa5,0x16c));var _0x53fa=function(_0x5ce3cb,_0x328dce){_0x5ce3cb=_0x5ce3cb-0x0;var _0x2efbd6=_0x3fa5[_0x5ce3cb];return _0x2efbd6;};'use strict';var _=require(_0x53fa('0x0'));var util=require(_0x53fa('0x1'));var logger=require(_0x53fa('0x2'))('api');var moment=require(_0x53fa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x53fa('0x4'));var rimraf=require(_0x53fa('0x5'));var config=require('../../config/environment');var attributes=require(_0x53fa('0x6'));module[_0x53fa('0x7')]=function(_0x544b07,_0xb24d6b){return _0x544b07[_0x53fa('0x8')](_0x53fa('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x53fa('0xa'),'fields':['idField',_0x53fa('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x704f=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x4afbae,_0x5ddd1a){var _0x42820d=function(_0x4b7aa4){while(--_0x4b7aa4){_0x4afbae['push'](_0x4afbae['shift']());}};_0x42820d(++_0x5ddd1a);}(_0x704f,0x147));var _0xf704=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0x704f[_0x1fb1c1];return _0x1622df;};'use strict';var _=require(_0xf704('0x0'));var util=require(_0xf704('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf704('0x2'));var rp=require(_0xf704('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf704('0x4'));var config=require(_0xf704('0x5'));var attributes=require(_0xf704('0x6'));module[_0xf704('0x7')]=function(_0xfa76d2,_0x135200){return _0xfa76d2[_0xf704('0x8')](_0xf704('0x9'),attributes,{'tableName':_0xf704('0xa'),'paranoid':![],'indexes':[{'name':_0xf704('0xb'),'fields':[_0xf704('0xc'),_0xf704('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 63d79c9..9947615 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a13=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5f1725,_0x5df870){var _0x53fc9c=function(_0x1965b4){while(--_0x1965b4){_0x5f1725['push'](_0x5f1725['shift']());}};_0x53fc9c(++_0x5df870);}(_0x8a13,0xd6));var _0x38a1=function(_0x2b18c9,_0x49659f){_0x2b18c9=_0x2b18c9-0x0;var _0x8b913c=_0x8a13[_0x2b18c9];return _0x8b913c;};'use strict';var _=require(_0x38a1('0x0'));var util=require(_0x38a1('0x1'));var moment=require(_0x38a1('0x2'));var BPromise=require(_0x38a1('0x3'));var rs=require(_0x38a1('0x4'));var fs=require('fs');var Redis=require(_0x38a1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x38a1('0x6'));var logger=require(_0x38a1('0x7'))(_0x38a1('0x8'));var config=require(_0x38a1('0x9'));var jayson=require(_0x38a1('0xa'));var client=jayson[_0x38a1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d957b,_0x43c43e,_0x2ae3fe){return new BPromise(function(_0x2974f7,_0x2a41ac){return client['request'](_0x4d957b,_0x2ae3fe)['then'](function(_0x12a4eb){logger['info'](_0x38a1('0xc'),_0x43c43e,_0x38a1('0xd'));logger[_0x38a1('0xe')](_0x38a1('0xf'),_0x43c43e,_0x38a1('0xd'),JSON[_0x38a1('0x10')](_0x12a4eb));if(_0x12a4eb[_0x38a1('0x11')]){if(_0x12a4eb['error']['code']===0x1f4){logger[_0x38a1('0x11')](_0x38a1('0xc'),_0x43c43e,_0x12a4eb[_0x38a1('0x11')][_0x38a1('0x12')]);return _0x2a41ac(_0x12a4eb[_0x38a1('0x11')][_0x38a1('0x12')]);}logger[_0x38a1('0x11')](_0x38a1('0xc'),_0x43c43e,_0x12a4eb['error'][_0x38a1('0x12')]);return _0x2974f7(_0x12a4eb[_0x38a1('0x11')][_0x38a1('0x12')]);}else{logger[_0x38a1('0x13')](_0x38a1('0xc'),_0x43c43e,_0x38a1('0xd'));_0x2974f7(_0x12a4eb[_0x38a1('0x14')]['message']);}})[_0x38a1('0x15')](function(_0x19c8b7){logger[_0x38a1('0x11')](_0x38a1('0xc'),_0x43c43e,_0x19c8b7);_0x2a41ac(_0x19c8b7);});});}
\ No newline at end of file
+var _0xb113=['VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4dc835,_0x15831a){var _0x3fae67=function(_0x3b1065){while(--_0x3b1065){_0x4dc835['push'](_0x4dc835['shift']());}};_0x3fae67(++_0x15831a);}(_0xb113,0xa1));var _0x3b11=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0xb113[_0x25cd2c];return _0x1e364c;};'use strict';var _=require(_0x3b11('0x0'));var util=require(_0x3b11('0x1'));var moment=require(_0x3b11('0x2'));var BPromise=require(_0x3b11('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b11('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b11('0x5'));var logger=require(_0x3b11('0x6'))(_0x3b11('0x7'));var config=require(_0x3b11('0x8'));var jayson=require(_0x3b11('0x9'));var client=jayson[_0x3b11('0xa')][_0x3b11('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36f788,_0x3f99ae,_0xa0e389){return new BPromise(function(_0x1f91a5,_0x4da067){return client[_0x3b11('0xc')](_0x36f788,_0xa0e389)[_0x3b11('0xd')](function(_0x10930e){logger[_0x3b11('0xe')](_0x3b11('0xf'),_0x3f99ae,'request\x20sent');logger['debug'](_0x3b11('0x10'),_0x3f99ae,_0x3b11('0x11'),JSON[_0x3b11('0x12')](_0x10930e));if(_0x10930e[_0x3b11('0x13')]){if(_0x10930e['error']['code']===0x1f4){logger[_0x3b11('0x13')](_0x3b11('0xf'),_0x3f99ae,_0x10930e[_0x3b11('0x13')][_0x3b11('0x14')]);return _0x4da067(_0x10930e[_0x3b11('0x13')][_0x3b11('0x14')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x3f99ae,_0x10930e[_0x3b11('0x13')][_0x3b11('0x14')]);return _0x1f91a5(_0x10930e['error'][_0x3b11('0x14')]);}else{logger[_0x3b11('0xe')](_0x3b11('0xf'),_0x3f99ae,'request\x20sent');_0x1f91a5(_0x10930e[_0x3b11('0x15')][_0x3b11('0x14')]);}})['catch'](function(_0xe70a48){logger[_0x3b11('0x13')](_0x3b11('0xf'),_0x3f99ae,_0xe70a48);_0x4da067(_0xe70a48);});});}
\ No newline at end of file
index 73476c9..4e03dc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f23=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','delete'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0x3f23,0x189));var _0x33f2=function(_0x198da8,_0x3d3ec8){_0x198da8=_0x198da8-0x0;var _0x522395=_0x3f23[_0x198da8];return _0x522395;};'use strict';var multer=require(_0x33f2('0x0'));var util=require('util');var path=require(_0x33f2('0x1'));var timeout=require(_0x33f2('0x2'));var express=require(_0x33f2('0x3'));var router=express[_0x33f2('0x4')]();var fs_extra=require(_0x33f2('0x5'));var auth=require(_0x33f2('0x6'));var interaction=require(_0x33f2('0x7'));var config=require(_0x33f2('0x8'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x33f2('0x9')](),controller[_0x33f2('0xa')]);router[_0x33f2('0xb')](_0x33f2('0xc'),auth[_0x33f2('0x9')](),controller[_0x33f2('0xd')]);router[_0x33f2('0xb')](_0x33f2('0xe'),auth['isAuthenticated'](),controller[_0x33f2('0xf')]);router[_0x33f2('0xb')](_0x33f2('0x10'),auth[_0x33f2('0x9')](),controller[_0x33f2('0x11')]);router[_0x33f2('0x12')]('/',auth[_0x33f2('0x9')](),controller['create']);router[_0x33f2('0x12')](_0x33f2('0xe'),auth[_0x33f2('0x9')](),controller[_0x33f2('0x13')]);router['put']('/:id',auth[_0x33f2('0x9')](),controller['update']);router[_0x33f2('0x14')]('/:id',auth[_0x33f2('0x9')](),controller[_0x33f2('0x15')]);module[_0x33f2('0x16')]=router;
\ No newline at end of file
+var _0x3fac=['get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0x45942a,_0x591360){var _0x3f7c6e=function(_0x3398ed){while(--_0x3398ed){_0x45942a['push'](_0x45942a['shift']());}};_0x3f7c6e(++_0x591360);}(_0x3fac,0x194));var _0xc3fa=function(_0x435635,_0x4bf107){_0x435635=_0x435635-0x0;var _0x32e911=_0x3fac[_0x435635];return _0x32e911;};'use strict';var multer=require(_0xc3fa('0x0'));var util=require(_0xc3fa('0x1'));var path=require('path');var timeout=require(_0xc3fa('0x2'));var express=require(_0xc3fa('0x3'));var router=express[_0xc3fa('0x4')]();var fs_extra=require(_0xc3fa('0x5'));var auth=require(_0xc3fa('0x6'));var interaction=require(_0xc3fa('0x7'));var config=require(_0xc3fa('0x8'));var controller=require(_0xc3fa('0x9'));router[_0xc3fa('0xa')]('/',auth[_0xc3fa('0xb')](),controller[_0xc3fa('0xc')]);router[_0xc3fa('0xa')]('/:id',auth[_0xc3fa('0xb')](),controller[_0xc3fa('0xd')]);router['get'](_0xc3fa('0xe'),auth[_0xc3fa('0xb')](),controller[_0xc3fa('0xf')]);router['get']('/:id/fields',auth[_0xc3fa('0xb')](),controller[_0xc3fa('0x10')]);router[_0xc3fa('0x11')]('/',auth[_0xc3fa('0xb')](),controller[_0xc3fa('0x12')]);router['post'](_0xc3fa('0xe'),auth['isAuthenticated'](),controller[_0xc3fa('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xc3fa('0x14'),auth[_0xc3fa('0xb')](),controller[_0xc3fa('0x15')]);module[_0xc3fa('0x16')]=router;
\ No newline at end of file
index 62aa563..ce82017 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d11=['token','integrationTab','sequelize','exports','STRING','ENUM','password'];(function(_0x160e37,_0xb06240){var _0x25e66b=function(_0x5ce2d3){while(--_0x5ce2d3){_0x160e37['push'](_0x160e37['shift']());}};_0x25e66b(++_0xb06240);}(_0x6d11,0xbf));var _0x16d1=function(_0xf3e355,_0xc7b1b6){_0xf3e355=_0xf3e355-0x0;var _0x20614a=_0x6d11[_0xf3e355];return _0x20614a;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'name':{'type':Sequelize[_0x16d1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x16d1('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x16d1('0x2')]},'token':{'type':Sequelize[_0x16d1('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x16d1('0x3')](_0x16d1('0x4'),_0x16d1('0x5')),'defaultValue':_0x16d1('0x4')},'serverUrl':{'type':Sequelize[_0x16d1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x16d1('0x3')](_0x16d1('0x6'),'newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0xe3b3=['password','token','ENUM','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri'];(function(_0x1b872a,_0x35d522){var _0x36b285=function(_0x48dd27){while(--_0x48dd27){_0x1b872a['push'](_0x1b872a['shift']());}};_0x36b285(++_0x35d522);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0xa465d7,_0x50ef87){_0xa465d7=_0xa465d7-0x0;var _0x5ad124=_0xe3b3[_0xa465d7];return _0x5ad124;};'use strict';var Sequelize=require(_0x3e3b('0x0'));module[_0x3e3b('0x1')]={'name':{'type':Sequelize[_0x3e3b('0x2')]},'description':{'type':Sequelize[_0x3e3b('0x2')]},'username':{'type':Sequelize[_0x3e3b('0x2')],'unique':_0x3e3b('0x3')},'password':{'type':Sequelize[_0x3e3b('0x2')]},'token':{'type':Sequelize[_0x3e3b('0x2')]},'remoteUri':{'type':Sequelize[_0x3e3b('0x2')],'unique':_0x3e3b('0x4')},'authType':{'type':Sequelize['ENUM'](_0x3e3b('0x5'),_0x3e3b('0x6')),'defaultValue':_0x3e3b('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3e3b('0x7')](_0x3e3b('0x8'),_0x3e3b('0x9')),'defaultValue':_0x3e3b('0x8')}};
\ No newline at end of file
index c13e411..8fc0614 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1e3=['assignee','remove','includes','position','title','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','end','json','undefined','count','offset','status','set','apply','save','then','destroy','name','send','ZendeskAccount','type','map','query','keys','attributes','intersection','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','update','ZendeskConfiguration','length','getConfigurations','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','findOne','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','username','base64','headers','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','group'];(function(_0x3040e8,_0x169244){var _0x15dd32=function(_0x19698b){while(--_0x19698b){_0x3040e8['push'](_0x3040e8['shift']());}};_0x15dd32(++_0x169244);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x510ea3,_0x4c946f){_0x510ea3=_0x510ea3-0x0;var _0x40d0cf=_0xe1e3[_0x510ea3];return _0x40d0cf;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x536129,_0x5c09a2){_0x5c09a2=_0x5c09a2||0xcc;return function(_0x14ad58){if(_0x14ad58){return _0x536129['sendStatus'](_0x5c09a2);}return _0x536129['status'](_0x5c09a2)[_0x3e1e('0x14')]();};}function respondWithResult(_0x8bd4cd,_0x78ee54){_0x78ee54=_0x78ee54||0xc8;return function(_0x50f221){if(_0x50f221){return _0x8bd4cd['status'](_0x78ee54)[_0x3e1e('0x15')](_0x50f221);}};}function respondWithFilteredResult(_0x1b62e6,_0x4dca60){return function(_0x26cb35){if(_0x26cb35){var _0x1f0af9=typeof _0x4dca60['offset']===_0x3e1e('0x16')&&typeof _0x4dca60['limit']===_0x3e1e('0x16');var _0x247daa=_0x26cb35[_0x3e1e('0x17')];var _0x39eaa7=_0x1f0af9?0x0:_0x4dca60[_0x3e1e('0x18')];var _0x1c181b=_0x1f0af9?_0x26cb35['count']:_0x4dca60['offset']+_0x4dca60['limit'];var _0x428e4e;if(_0x1c181b>=_0x247daa){_0x1c181b=_0x247daa;_0x428e4e=0xc8;}else{_0x428e4e=0xce;}_0x1b62e6[_0x3e1e('0x19')](_0x428e4e);return _0x1b62e6[_0x3e1e('0x1a')]('Content-Range',_0x39eaa7+'-'+_0x1c181b+'/'+_0x247daa)[_0x3e1e('0x15')](_0x26cb35);}return null;};}function patchUpdates(_0x530815){return function(_0x228991){try{jsonpatch[_0x3e1e('0x1b')](_0x228991,_0x530815,!![]);}catch(_0x474085){return BPromise['reject'](_0x474085);}return _0x228991[_0x3e1e('0x1c')]();};}function saveUpdates(_0x96396,_0xefa098){return function(_0x55dc62){if(_0x55dc62){return _0x55dc62['update'](_0x96396)[_0x3e1e('0x1d')](function(_0x1b5097){return _0x1b5097;});}return null;};}function removeEntity(_0x488f9f,_0x60e6bc){return function(_0x56ae51){if(_0x56ae51){return _0x56ae51[_0x3e1e('0x1e')]()[_0x3e1e('0x1d')](function(){_0x488f9f[_0x3e1e('0x19')](0xcc)[_0x3e1e('0x14')]();});}};}function handleEntityNotFound(_0x43d583,_0x21c898){return function(_0x4ee2b5){if(!_0x4ee2b5){_0x43d583['sendStatus'](0x194);}return _0x4ee2b5;};}function handleError(_0x44e419,_0x541ef1){_0x541ef1=_0x541ef1||0x1f4;return function(_0x55db8f){logger['error'](_0x55db8f['stack']);if(_0x55db8f[_0x3e1e('0x1f')]){delete _0x55db8f[_0x3e1e('0x1f')];}_0x44e419['status'](_0x541ef1)[_0x3e1e('0x20')](_0x55db8f);};}exports['index']=function(_0xdfcd93,_0x176bb4){var _0x53a6ff={},_0x43e029={},_0x210a84={'count':0x0,'rows':[]};var _0x45ed0e=_['map'](db[_0x3e1e('0x21')]['rawAttributes'],function(_0x591c36){return{'name':_0x591c36['fieldName'],'type':_0x591c36[_0x3e1e('0x22')]['key']};});_0x43e029['model']=_[_0x3e1e('0x23')](_0x45ed0e,_0x3e1e('0x1f'));_0x43e029[_0x3e1e('0x24')]=_[_0x3e1e('0x25')](_0xdfcd93[_0x3e1e('0x24')]);_0x43e029['filters']=_['intersection'](_0x43e029['model'],_0x43e029['query']);_0x53a6ff[_0x3e1e('0x26')]=_[_0x3e1e('0x27')](_0x43e029[_0x3e1e('0x28')],qs[_0x3e1e('0x29')](_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x29')]));_0x53a6ff[_0x3e1e('0x26')]=_0x53a6ff[_0x3e1e('0x26')]['length']?_0x53a6ff[_0x3e1e('0x26')]:_0x43e029[_0x3e1e('0x28')];if(!_0xdfcd93['query'][_0x3e1e('0x2a')](_0x3e1e('0x2b'))){_0x53a6ff[_0x3e1e('0x2c')]=qs[_0x3e1e('0x2c')](_0xdfcd93['query']['limit']);_0x53a6ff[_0x3e1e('0x18')]=qs[_0x3e1e('0x18')](_0xdfcd93['query'][_0x3e1e('0x18')]);}_0x53a6ff[_0x3e1e('0x2d')]=qs['sort'](_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x2e')]);_0x53a6ff[_0x3e1e('0x2f')]=qs[_0x3e1e('0x30')](_[_0x3e1e('0x31')](_0xdfcd93['query'],_0x43e029[_0x3e1e('0x30')]),_0x45ed0e);if(_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x32')]){_0x53a6ff[_0x3e1e('0x2f')]=_['merge'](_0x53a6ff[_0x3e1e('0x2f')],{'$or':_[_0x3e1e('0x23')](_0x45ed0e,function(_0x111da4){if(_0x111da4[_0x3e1e('0x22')]!==_0x3e1e('0x33')){var _0x25a95b={};_0x25a95b[_0x111da4[_0x3e1e('0x1f')]]={'$like':'%'+_0xdfcd93['query'][_0x3e1e('0x32')]+'%'};return _0x25a95b;}})});}_0x53a6ff=_['merge']({},_0x53a6ff,_0xdfcd93['options']);var _0x4f598e={'where':_0x53a6ff[_0x3e1e('0x2f')]};return db[_0x3e1e('0x21')]['count'](_0x4f598e)[_0x3e1e('0x1d')](function(_0xb030eb){_0x210a84['count']=_0xb030eb;if(_0xdfcd93[_0x3e1e('0x24')][_0x3e1e('0x34')]){_0x53a6ff['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x3e1e('0x35')](_0x53a6ff);})['then'](function(_0x4ff868){_0x210a84[_0x3e1e('0x36')]=_0x4ff868;return _0x210a84;})[_0x3e1e('0x1d')](respondWithFilteredResult(_0x176bb4,_0x53a6ff))[_0x3e1e('0x37')](handleError(_0x176bb4,null));};exports[_0x3e1e('0x38')]=function(_0x377a06,_0x55ea1d){var _0x5b32ad={'raw':![],'where':{'id':_0x377a06[_0x3e1e('0x39')]['id']}},_0x24b2ad={};_0x24b2ad[_0x3e1e('0x28')]=_['keys'](db[_0x3e1e('0x21')][_0x3e1e('0x3a')]);_0x24b2ad[_0x3e1e('0x24')]=_['keys'](_0x377a06[_0x3e1e('0x24')]);_0x24b2ad['filters']=_['intersection'](_0x24b2ad[_0x3e1e('0x28')],_0x24b2ad[_0x3e1e('0x24')]);_0x5b32ad[_0x3e1e('0x26')]=_[_0x3e1e('0x27')](_0x24b2ad['model'],qs['fields'](_0x377a06['query']['fields']));_0x5b32ad[_0x3e1e('0x26')]=_0x5b32ad[_0x3e1e('0x26')]['length']?_0x5b32ad['attributes']:_0x24b2ad[_0x3e1e('0x28')];if(_0x377a06[_0x3e1e('0x24')][_0x3e1e('0x34')]){_0x5b32ad['include']=[{'all':!![]}];}_0x5b32ad=_[_0x3e1e('0x3b')]({},_0x5b32ad,_0x377a06['options']);return db[_0x3e1e('0x21')][_0x3e1e('0x3c')](_0x5b32ad)[_0x3e1e('0x1d')](handleEntityNotFound(_0x55ea1d,null))[_0x3e1e('0x1d')](respondWithResult(_0x55ea1d,null))[_0x3e1e('0x37')](handleError(_0x55ea1d,null));};exports[_0x3e1e('0x3d')]=function(_0x53d32b,_0x2f14b3){return db[_0x3e1e('0x21')]['create'](_0x53d32b[_0x3e1e('0x3e')],{})[_0x3e1e('0x1d')](respondWithResult(_0x2f14b3,0xc9))['catch'](handleError(_0x2f14b3,null));};exports[_0x3e1e('0x3f')]=function(_0x347b3f,_0x2e286f){if(_0x347b3f[_0x3e1e('0x3e')]['id']){delete _0x347b3f['body']['id'];}return db[_0x3e1e('0x21')][_0x3e1e('0x3c')]({'where':{'id':_0x347b3f[_0x3e1e('0x39')]['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x2e286f,null))['then'](saveUpdates(_0x347b3f[_0x3e1e('0x3e')],null))[_0x3e1e('0x1d')](respondWithResult(_0x2e286f,null))[_0x3e1e('0x37')](handleError(_0x2e286f,null));};exports[_0x3e1e('0x1e')]=function(_0xe2516c,_0x1df5a8){return db[_0x3e1e('0x21')][_0x3e1e('0x3c')]({'where':{'id':_0xe2516c['params']['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x1df5a8,null))['then'](removeEntity(_0x1df5a8,null))['catch'](handleError(_0x1df5a8,null));};exports['getConfigurations']=function(_0x1c4269,_0x17641c,_0x5147a2){var _0x13b076={};var _0x592733={};var _0x5b2416;var _0x3eaf76;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1c4269['params']['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x17641c,null))[_0x3e1e('0x1d')](function(_0x1334c8){if(_0x1334c8){_0x5b2416=_0x1334c8;_0x592733[_0x3e1e('0x28')]=_[_0x3e1e('0x25')](db[_0x3e1e('0x40')][_0x3e1e('0x3a')]);_0x592733['query']=_[_0x3e1e('0x25')](_0x1c4269['query']);_0x592733[_0x3e1e('0x30')]=_[_0x3e1e('0x27')](_0x592733[_0x3e1e('0x28')],_0x592733['query']);_0x13b076['attributes']=_[_0x3e1e('0x27')](_0x592733[_0x3e1e('0x28')],qs['fields'](_0x1c4269[_0x3e1e('0x24')]['fields']));_0x13b076['attributes']=_0x13b076[_0x3e1e('0x26')][_0x3e1e('0x41')]?_0x13b076['attributes']:_0x592733[_0x3e1e('0x28')];_0x13b076['order']=qs['sort'](_0x1c4269[_0x3e1e('0x24')]['sort']);_0x13b076[_0x3e1e('0x2f')]=qs['filters'](_[_0x3e1e('0x31')](_0x1c4269['query'],_0x592733[_0x3e1e('0x30')]));if(_0x1c4269[_0x3e1e('0x24')]['filter']){_0x13b076['where']=_['merge'](_0x13b076[_0x3e1e('0x2f')],{'$or':_[_0x3e1e('0x23')](_0x13b076[_0x3e1e('0x26')],function(_0x588189){var _0x1b04ce={};_0x1b04ce[_0x588189]={'$like':'%'+_0x1c4269[_0x3e1e('0x24')][_0x3e1e('0x32')]+'%'};return _0x1b04ce;})});}_0x13b076=_['merge']({},_0x13b076,_0x1c4269['options']);return _0x5b2416[_0x3e1e('0x42')](_0x13b076);}})['then'](function(_0x3b97a2){if(_0x3b97a2){_0x3eaf76=_0x3b97a2[_0x3e1e('0x41')];if(!_0x1c4269[_0x3e1e('0x24')]['hasOwnProperty'](_0x3e1e('0x2b'))){_0x13b076['limit']=qs[_0x3e1e('0x2c')](_0x1c4269[_0x3e1e('0x24')]['limit']);_0x13b076[_0x3e1e('0x18')]=qs['offset'](_0x1c4269[_0x3e1e('0x24')]['offset']);}return _0x5b2416[_0x3e1e('0x42')](_0x13b076);}})['then'](function(_0x31062e){if(_0x31062e){return _0x31062e?{'count':_0x3eaf76,'rows':_0x31062e}:null;}})[_0x3e1e('0x1d')](respondWithResult(_0x17641c,null))[_0x3e1e('0x37')](handleError(_0x17641c,null));};exports['addConfiguration']=function(_0x11cab1,_0x1fbcfc,_0x4e6957){if(_0x11cab1[_0x3e1e('0x3e')]['id']){delete _0x11cab1['body']['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0x11cab1[_0x3e1e('0x39')]['id']}})[_0x3e1e('0x1d')](handleEntityNotFound(_0x1fbcfc,null))[_0x3e1e('0x1d')](function(_0x4b0944){if(_0x4b0944){_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x43')]=_0x4b0944['id'];_0x11cab1[_0x3e1e('0x3e')]['Subjects']=integrations[_0x3e1e('0x44')](_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x45')],_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x22')]);_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x46')]=integrations[_0x3e1e('0x47')](_0x11cab1['body']['channel'],_0x11cab1[_0x3e1e('0x3e')][_0x3e1e('0x22')]);return db[_0x3e1e('0x40')][_0x3e1e('0x3d')](_0x11cab1[_0x3e1e('0x3e')],{'include':[{'model':db[_0x3e1e('0x48')],'as':_0x3e1e('0x49')},{'model':db[_0x3e1e('0x48')],'as':_0x3e1e('0x46')}]});}return null;})[_0x3e1e('0x1d')](respondWithResult(_0x1fbcfc,null))[_0x3e1e('0x37')](handleError(_0x1fbcfc,null));};exports[_0x3e1e('0x4a')]=function(_0x5e148e,_0x5581ee,_0x20bc4d){var _0x29ddc4='';return db[_0x3e1e('0x21')][_0x3e1e('0x4b')]({'where':{'id':_0x5e148e[_0x3e1e('0x39')]['id']},'attributes':['id','username',_0x3e1e('0x4c'),_0x3e1e('0x4d'),_0x3e1e('0x4e'),_0x3e1e('0x4f')]})[_0x3e1e('0x1d')](handleEntityNotFound(_0x5581ee,null))['then'](function(_0x8b6b28){if(_0x8b6b28){_0x29ddc4=_0x8b6b28[_0x3e1e('0x4f')];var _0xc60340=_0x29ddc4[_0x3e1e('0x50')](-0x1);if(_0xc60340==='/'){_0x29ddc4=_0x29ddc4[_0x3e1e('0x51')](0x0,_0x29ddc4[_0x3e1e('0x52')](_0xc60340));}var _0x4d0854={'method':_0x3e1e('0x53'),'uri':util[_0x3e1e('0x54')](_0x3e1e('0x55'),_0x29ddc4,_0x3e1e('0x56')),'json':!![]};switch(_0x8b6b28[_0x3e1e('0x4e')]){case _0x3e1e('0x4c'):_0x4d0854['headers']={'Authorization':util[_0x3e1e('0x54')](_0x3e1e('0x57'),new Buffer(util[_0x3e1e('0x54')](_0x3e1e('0x58'),_0x8b6b28[_0x3e1e('0x59')],_0x8b6b28[_0x3e1e('0x4c')]))['toString'](_0x3e1e('0x5a')))};break;case'token':_0x4d0854[_0x3e1e('0x5b')]={'Authorization':util[_0x3e1e('0x54')]('Basic\x20%s',new Buffer(util[_0x3e1e('0x54')](_0x3e1e('0x5c'),_0x8b6b28[_0x3e1e('0x59')],_0x8b6b28[_0x3e1e('0x4d')]))['toString'](_0x3e1e('0x5a')))};break;default:throw new db['Sequelize'][(_0x3e1e('0x5d'))](_0x3e1e('0x5e'));}return rp(_0x4d0854);}})[_0x3e1e('0x1d')](function(_0x632f99){if(_0x632f99){var _0x2ef476=[_0x3e1e('0x5f'),'description',_0x3e1e('0x60'),_0x3e1e('0x61')];_[_0x3e1e('0x62')](_0x632f99[_0x3e1e('0x56')],function(_0x4b4fd4){return _0x2ef476[_0x3e1e('0x63')](_0x4b4fd4[_0x3e1e('0x22')]);});return{'count':_0x632f99[_0x3e1e('0x56')][_0x3e1e('0x41')],'rows':_['map'](_0x632f99[_0x3e1e('0x56')],function(_0x41d98f){return{'id':_0x41d98f['id'],'name':_0x41d98f[_0x3e1e('0x64')]>0x7?_0x41d98f[_0x3e1e('0x65')]:_0x41d98f[_0x3e1e('0x22')],'custom':_0x41d98f[_0x3e1e('0x64')]>0x7?!![]:![],'options':_0x41d98f['system_field_options']?_0x41d98f['system_field_options']:_0x41d98f['custom_field_options']?_0x41d98f[_0x3e1e('0x66')]:[]};})};}})['then'](respondWithResult(_0x5581ee,null))[_0x3e1e('0x37')](function(_0x5f436f){var _0x32b5ef=_0x5e148e[_0x3e1e('0x24')][_0x3e1e('0x67')]?0x1f4:_0x5f436f[_0x3e1e('0x68')]||0x1f4;logger['error'](_0x3e1e('0x69'),'getFields',_0x32b5ef,JSON[_0x3e1e('0x6a')](_0x5f436f));delete _0x5f436f['name'];if(_0x32b5ef===0x191){_0x32b5ef=0x190;}_0x5581ee[_0x3e1e('0x19')](_0x32b5ef)[_0x3e1e('0x20')](_0x5e148e['query'][_0x3e1e('0x67')]?{'message':_0x3e1e('0x6b'),'statusCode':_0x5f436f[_0x3e1e('0x68')]}:_0x5f436f);});};
\ No newline at end of file
+var _0xb7e7=['channel','getDescriptions','ZendeskField','Subjects','Descriptions','password','token','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','authType','headers','format','Basic\x20%s','%s:%s','username','base64','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','bluebird','util','path','sox','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','ZendeskAccount','findAll','rows','show','params','length','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','options','AccountId','getSubjects'];(function(_0x39c82b,_0x30735d){var _0x1e1f7e=function(_0x1cd7e3){while(--_0x1cd7e3){_0x39c82b['push'](_0x39c82b['shift']());}};_0x1e1f7e(++_0x30735d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xb7e7[_0x4ea69d];return _0x5318e0;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];var integrations=require(_0x7b7e('0x19'));function respondWithStatusCode(_0x54d8ce,_0x267446){_0x267446=_0x267446||0xcc;return function(_0x430eab){if(_0x430eab){return _0x54d8ce['sendStatus'](_0x267446);}return _0x54d8ce[_0x7b7e('0x1a')](_0x267446)['end']();};}function respondWithResult(_0x4c6011,_0x2889ed){_0x2889ed=_0x2889ed||0xc8;return function(_0xd304f5){if(_0xd304f5){return _0x4c6011[_0x7b7e('0x1a')](_0x2889ed)[_0x7b7e('0x1b')](_0xd304f5);}};}function respondWithFilteredResult(_0x3d2fb2,_0x5703fd){return function(_0x51baf6){if(_0x51baf6){var _0xc7f087=typeof _0x5703fd[_0x7b7e('0x1c')]===_0x7b7e('0x1d')&&typeof _0x5703fd[_0x7b7e('0x1e')]===_0x7b7e('0x1d');var _0x3bf2f0=_0x51baf6[_0x7b7e('0x1f')];var _0x200ef7=_0xc7f087?0x0:_0x5703fd[_0x7b7e('0x1c')];var _0x429a0e=_0xc7f087?_0x51baf6[_0x7b7e('0x1f')]:_0x5703fd[_0x7b7e('0x1c')]+_0x5703fd[_0x7b7e('0x1e')];var _0x3bec7d;if(_0x429a0e>=_0x3bf2f0){_0x429a0e=_0x3bf2f0;_0x3bec7d=0xc8;}else{_0x3bec7d=0xce;}_0x3d2fb2[_0x7b7e('0x1a')](_0x3bec7d);return _0x3d2fb2[_0x7b7e('0x20')](_0x7b7e('0x21'),_0x200ef7+'-'+_0x429a0e+'/'+_0x3bf2f0)['json'](_0x51baf6);}return null;};}function patchUpdates(_0x69262b){return function(_0x43db4f){try{jsonpatch[_0x7b7e('0x22')](_0x43db4f,_0x69262b,!![]);}catch(_0x4c0647){return BPromise[_0x7b7e('0x23')](_0x4c0647);}return _0x43db4f[_0x7b7e('0x24')]();};}function saveUpdates(_0x14243b,_0x200156){return function(_0x2b7211){if(_0x2b7211){return _0x2b7211[_0x7b7e('0x25')](_0x14243b)[_0x7b7e('0x26')](function(_0x10a66a){return _0x10a66a;});}return null;};}function removeEntity(_0x53bbb3,_0x5d6215){return function(_0x4a836a){if(_0x4a836a){return _0x4a836a[_0x7b7e('0x27')]()[_0x7b7e('0x26')](function(){_0x53bbb3[_0x7b7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d3b1,_0x5dadbb){return function(_0x182245){if(!_0x182245){_0x51d3b1[_0x7b7e('0x28')](0x194);}return _0x182245;};}function handleError(_0x16a3c7,_0x7aa71){_0x7aa71=_0x7aa71||0x1f4;return function(_0x3ceaf5){logger['error'](_0x3ceaf5[_0x7b7e('0x29')]);if(_0x3ceaf5[_0x7b7e('0x2a')]){delete _0x3ceaf5['name'];}_0x16a3c7['status'](_0x7aa71)['send'](_0x3ceaf5);};}exports[_0x7b7e('0x2b')]=function(_0x423832,_0x503625){var _0x3db8c4={},_0x51d4b5={},_0x1b4341={'count':0x0,'rows':[]};var _0xb9b6bf=_[_0x7b7e('0x2c')](db['ZendeskAccount'][_0x7b7e('0x2d')],function(_0xe31336){return{'name':_0xe31336[_0x7b7e('0x2e')],'type':_0xe31336[_0x7b7e('0x2f')][_0x7b7e('0x30')]};});_0x51d4b5['model']=_[_0x7b7e('0x2c')](_0xb9b6bf,'name');_0x51d4b5[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x423832[_0x7b7e('0x31')]);_0x51d4b5[_0x7b7e('0x33')]=_[_0x7b7e('0x34')](_0x51d4b5[_0x7b7e('0x35')],_0x51d4b5[_0x7b7e('0x31')]);_0x3db8c4['attributes']=_['intersection'](_0x51d4b5[_0x7b7e('0x35')],qs[_0x7b7e('0x36')](_0x423832['query'][_0x7b7e('0x36')]));_0x3db8c4[_0x7b7e('0x37')]=_0x3db8c4[_0x7b7e('0x37')]['length']?_0x3db8c4[_0x7b7e('0x37')]:_0x51d4b5[_0x7b7e('0x35')];if(!_0x423832[_0x7b7e('0x31')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0x3db8c4[_0x7b7e('0x1e')]=qs[_0x7b7e('0x1e')](_0x423832[_0x7b7e('0x31')][_0x7b7e('0x1e')]);_0x3db8c4[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x423832[_0x7b7e('0x31')][_0x7b7e('0x1c')]);}_0x3db8c4[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x423832[_0x7b7e('0x31')]['sort']);_0x3db8c4[_0x7b7e('0x3c')]=qs[_0x7b7e('0x33')](_[_0x7b7e('0x3d')](_0x423832[_0x7b7e('0x31')],_0x51d4b5[_0x7b7e('0x33')]),_0xb9b6bf);if(_0x423832[_0x7b7e('0x31')][_0x7b7e('0x3e')]){_0x3db8c4[_0x7b7e('0x3c')]=_[_0x7b7e('0x3f')](_0x3db8c4[_0x7b7e('0x3c')],{'$or':_['map'](_0xb9b6bf,function(_0x3d6571){if(_0x3d6571[_0x7b7e('0x2f')]!==_0x7b7e('0x40')){var _0x1d43da={};_0x1d43da[_0x3d6571['name']]={'$like':'%'+_0x423832[_0x7b7e('0x31')][_0x7b7e('0x3e')]+'%'};return _0x1d43da;}})});}_0x3db8c4=_[_0x7b7e('0x3f')]({},_0x3db8c4,_0x423832['options']);var _0x4a2888={'where':_0x3db8c4[_0x7b7e('0x3c')]};return db['ZendeskAccount'][_0x7b7e('0x1f')](_0x4a2888)[_0x7b7e('0x26')](function(_0x4de331){_0x1b4341[_0x7b7e('0x1f')]=_0x4de331;if(_0x423832[_0x7b7e('0x31')][_0x7b7e('0x41')]){_0x3db8c4[_0x7b7e('0x42')]=[{'all':!![]}];}return db[_0x7b7e('0x43')][_0x7b7e('0x44')](_0x3db8c4);})[_0x7b7e('0x26')](function(_0x1d9bb9){_0x1b4341[_0x7b7e('0x45')]=_0x1d9bb9;return _0x1b4341;})['then'](respondWithFilteredResult(_0x503625,_0x3db8c4))['catch'](handleError(_0x503625,null));};exports[_0x7b7e('0x46')]=function(_0x550ea6,_0x41c8a6){var _0x5e8b5d={'raw':![],'where':{'id':_0x550ea6[_0x7b7e('0x47')]['id']}},_0x48dd74={};_0x48dd74['model']=_[_0x7b7e('0x32')](db['ZendeskAccount'][_0x7b7e('0x2d')]);_0x48dd74[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x550ea6[_0x7b7e('0x31')]);_0x48dd74['filters']=_[_0x7b7e('0x34')](_0x48dd74[_0x7b7e('0x35')],_0x48dd74[_0x7b7e('0x31')]);_0x5e8b5d[_0x7b7e('0x37')]=_[_0x7b7e('0x34')](_0x48dd74[_0x7b7e('0x35')],qs['fields'](_0x550ea6['query']['fields']));_0x5e8b5d[_0x7b7e('0x37')]=_0x5e8b5d[_0x7b7e('0x37')][_0x7b7e('0x48')]?_0x5e8b5d[_0x7b7e('0x37')]:_0x48dd74[_0x7b7e('0x35')];if(_0x550ea6[_0x7b7e('0x31')]['includeAll']){_0x5e8b5d[_0x7b7e('0x42')]=[{'all':!![]}];}_0x5e8b5d=_[_0x7b7e('0x3f')]({},_0x5e8b5d,_0x550ea6['options']);return db['ZendeskAccount'][_0x7b7e('0x49')](_0x5e8b5d)[_0x7b7e('0x26')](handleEntityNotFound(_0x41c8a6,null))[_0x7b7e('0x26')](respondWithResult(_0x41c8a6,null))[_0x7b7e('0x4a')](handleError(_0x41c8a6,null));};exports[_0x7b7e('0x4b')]=function(_0xb46776,_0x590154){return db[_0x7b7e('0x43')]['create'](_0xb46776[_0x7b7e('0x4c')],{})[_0x7b7e('0x26')](respondWithResult(_0x590154,0xc9))[_0x7b7e('0x4a')](handleError(_0x590154,null));};exports[_0x7b7e('0x25')]=function(_0x58e4e6,_0x3b649e){if(_0x58e4e6[_0x7b7e('0x4c')]['id']){delete _0x58e4e6[_0x7b7e('0x4c')]['id'];}return db[_0x7b7e('0x43')][_0x7b7e('0x49')]({'where':{'id':_0x58e4e6['params']['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x3b649e,null))[_0x7b7e('0x26')](saveUpdates(_0x58e4e6[_0x7b7e('0x4c')],null))[_0x7b7e('0x26')](respondWithResult(_0x3b649e,null))[_0x7b7e('0x4a')](handleError(_0x3b649e,null));};exports['destroy']=function(_0x1d6d18,_0x29024e){return db[_0x7b7e('0x43')][_0x7b7e('0x49')]({'where':{'id':_0x1d6d18[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x29024e,null))[_0x7b7e('0x26')](removeEntity(_0x29024e,null))['catch'](handleError(_0x29024e,null));};exports[_0x7b7e('0x4d')]=function(_0x5d7c89,_0x16730c,_0x766a54){var _0x570303={};var _0x36f1be={};var _0x44e3a0;var _0x16c81d;return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x5d7c89[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x16730c,null))['then'](function(_0xbf044d){if(_0xbf044d){_0x44e3a0=_0xbf044d;_0x36f1be[_0x7b7e('0x35')]=_[_0x7b7e('0x32')](db[_0x7b7e('0x4f')]['rawAttributes']);_0x36f1be['query']=_['keys'](_0x5d7c89[_0x7b7e('0x31')]);_0x36f1be[_0x7b7e('0x33')]=_[_0x7b7e('0x34')](_0x36f1be['model'],_0x36f1be['query']);_0x570303[_0x7b7e('0x37')]=_[_0x7b7e('0x34')](_0x36f1be['model'],qs[_0x7b7e('0x36')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x36')]));_0x570303['attributes']=_0x570303[_0x7b7e('0x37')][_0x7b7e('0x48')]?_0x570303['attributes']:_0x36f1be[_0x7b7e('0x35')];_0x570303[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3b')]);_0x570303[_0x7b7e('0x3c')]=qs[_0x7b7e('0x33')](_[_0x7b7e('0x3d')](_0x5d7c89[_0x7b7e('0x31')],_0x36f1be['filters']));if(_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3e')]){_0x570303['where']=_[_0x7b7e('0x3f')](_0x570303[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x2c')](_0x570303['attributes'],function(_0x1729e0){var _0x4fc349={};_0x4fc349[_0x1729e0]={'$like':'%'+_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3e')]+'%'};return _0x4fc349;})});}_0x570303=_['merge']({},_0x570303,_0x5d7c89[_0x7b7e('0x50')]);return _0x44e3a0[_0x7b7e('0x4d')](_0x570303);}})['then'](function(_0x2dcb35){if(_0x2dcb35){_0x16c81d=_0x2dcb35[_0x7b7e('0x48')];if(!_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x38')]('nolimit')){_0x570303[_0x7b7e('0x1e')]=qs[_0x7b7e('0x1e')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x1e')]);_0x570303[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x1c')]);}return _0x44e3a0[_0x7b7e('0x4d')](_0x570303);}})[_0x7b7e('0x26')](function(_0x5b9010){if(_0x5b9010){return _0x5b9010?{'count':_0x16c81d,'rows':_0x5b9010}:null;}})[_0x7b7e('0x26')](respondWithResult(_0x16730c,null))['catch'](handleError(_0x16730c,null));};exports['addConfiguration']=function(_0x2b105a,_0x7cbe6c,_0x1eb4b1){if(_0x2b105a[_0x7b7e('0x4c')]['id']){delete _0x2b105a['body']['id'];}return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x2b105a[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x7cbe6c,null))[_0x7b7e('0x26')](function(_0x2b2afd){if(_0x2b2afd){_0x2b105a['body'][_0x7b7e('0x51')]=_0x2b2afd['id'];_0x2b105a['body']['Subjects']=integrations[_0x7b7e('0x52')](_0x2b105a['body'][_0x7b7e('0x53')],_0x2b105a['body'][_0x7b7e('0x2f')]);_0x2b105a[_0x7b7e('0x4c')]['Descriptions']=integrations[_0x7b7e('0x54')](_0x2b105a[_0x7b7e('0x4c')]['channel'],_0x2b105a[_0x7b7e('0x4c')][_0x7b7e('0x2f')]);return db[_0x7b7e('0x4f')][_0x7b7e('0x4b')](_0x2b105a[_0x7b7e('0x4c')],{'include':[{'model':db[_0x7b7e('0x55')],'as':_0x7b7e('0x56')},{'model':db[_0x7b7e('0x55')],'as':_0x7b7e('0x57')}]});}return null;})[_0x7b7e('0x26')](respondWithResult(_0x7cbe6c,null))['catch'](handleError(_0x7cbe6c,null));};exports['getFields']=function(_0x34e7df,_0x46ac1f,_0x2c6e3a){var _0x348c77='';return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x34e7df[_0x7b7e('0x47')]['id']},'attributes':['id','username',_0x7b7e('0x58'),_0x7b7e('0x59'),'authType',_0x7b7e('0x5a')]})[_0x7b7e('0x26')](handleEntityNotFound(_0x46ac1f,null))[_0x7b7e('0x26')](function(_0x271318){if(_0x271318){_0x348c77=_0x271318[_0x7b7e('0x5a')];var _0x40f65e=_0x348c77[_0x7b7e('0x5b')](-0x1);if(_0x40f65e==='/'){_0x348c77=_0x348c77[_0x7b7e('0x5c')](0x0,_0x348c77[_0x7b7e('0x5d')](_0x40f65e));}var _0x3b6bc6={'method':_0x7b7e('0x5e'),'uri':util['format'](_0x7b7e('0x5f'),_0x348c77,_0x7b7e('0x60')),'json':!![]};switch(_0x271318[_0x7b7e('0x61')]){case _0x7b7e('0x58'):_0x3b6bc6[_0x7b7e('0x62')]={'Authorization':util[_0x7b7e('0x63')](_0x7b7e('0x64'),new Buffer(util['format'](_0x7b7e('0x65'),_0x271318[_0x7b7e('0x66')],_0x271318[_0x7b7e('0x58')]))['toString'](_0x7b7e('0x67')))};break;case _0x7b7e('0x59'):_0x3b6bc6[_0x7b7e('0x62')]={'Authorization':util[_0x7b7e('0x63')](_0x7b7e('0x64'),new Buffer(util['format']('%s/token:%s',_0x271318['username'],_0x271318[_0x7b7e('0x59')]))[_0x7b7e('0x68')](_0x7b7e('0x67')))};break;default:throw new db['Sequelize'][(_0x7b7e('0x69'))](_0x7b7e('0x6a'));}return rp(_0x3b6bc6);}})[_0x7b7e('0x26')](function(_0x5bf4d1){if(_0x5bf4d1){var _0x2983bf=[_0x7b7e('0x6b'),_0x7b7e('0x6c'),_0x7b7e('0x6d'),'assignee'];_[_0x7b7e('0x6e')](_0x5bf4d1[_0x7b7e('0x60')],function(_0xa52b93){return _0x2983bf[_0x7b7e('0x6f')](_0xa52b93['type']);});return{'count':_0x5bf4d1['ticket_fields'][_0x7b7e('0x48')],'rows':_['map'](_0x5bf4d1[_0x7b7e('0x60')],function(_0x4215b5){return{'id':_0x4215b5['id'],'name':_0x4215b5[_0x7b7e('0x70')]>0x7?_0x4215b5[_0x7b7e('0x71')]:_0x4215b5['type'],'custom':_0x4215b5[_0x7b7e('0x70')]>0x7?!![]:![],'options':_0x4215b5[_0x7b7e('0x72')]?_0x4215b5[_0x7b7e('0x72')]:_0x4215b5[_0x7b7e('0x73')]?_0x4215b5[_0x7b7e('0x73')]:[]};})};}})[_0x7b7e('0x26')](respondWithResult(_0x46ac1f,null))[_0x7b7e('0x4a')](function(_0x372478){var _0x44d8c4=_0x34e7df[_0x7b7e('0x31')][_0x7b7e('0x74')]?0x1f4:_0x372478[_0x7b7e('0x75')]||0x1f4;logger[_0x7b7e('0x76')](_0x7b7e('0x77'),_0x7b7e('0x78'),_0x44d8c4,JSON[_0x7b7e('0x79')](_0x372478));delete _0x372478['name'];if(_0x44d8c4===0x191){_0x44d8c4=0x190;}_0x46ac1f[_0x7b7e('0x1a')](_0x44d8c4)[_0x7b7e('0x7a')](_0x34e7df[_0x7b7e('0x31')][_0x7b7e('0x74')]?{'message':_0x7b7e('0x7b'),'statusCode':_0x372478[_0x7b7e('0x75')]}:_0x372478);});};
\ No newline at end of file
index 9830e57..568eabf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6600=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash'];(function(_0x278236,_0x3a7184){var _0x500892=function(_0x2ac822){while(--_0x2ac822){_0x278236['push'](_0x278236['shift']());}};_0x500892(++_0x3a7184);}(_0x6600,0x179));var _0x0660=function(_0x502b09,_0x17d7e9){_0x502b09=_0x502b09-0x0;var _0x1d211b=_0x6600[_0x502b09];return _0x1d211b;};'use strict';var _=require(_0x0660('0x0'));var util=require(_0x0660('0x1'));var logger=require(_0x0660('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0660('0x3'));var rp=require(_0x0660('0x4'));var fs=require('fs');var path=require(_0x0660('0x5'));var rimraf=require(_0x0660('0x6'));var config=require(_0x0660('0x7'));var attributes=require(_0x0660('0x8'));var integrations=require(_0x0660('0x9'));module[_0x0660('0xa')]=function(_0x271d76,_0x1fabda){return _0x271d76[_0x0660('0xb')](_0x0660('0xc'),attributes,{'tableName':_0x0660('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2052=['moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts','util','../../config/logger','api'];(function(_0x49d1aa,_0x36f845){var _0x2c3e8f=function(_0x5ba417){while(--_0x5ba417){_0x49d1aa['push'](_0x49d1aa['shift']());}};_0x2c3e8f(++_0x36f845);}(_0x2052,0x75));var _0x2205=function(_0x246b2a,_0x260418){_0x246b2a=_0x246b2a-0x0;var _0x63dd43=_0x2052[_0x246b2a];return _0x63dd43;};'use strict';var _=require('lodash');var util=require(_0x2205('0x0'));var logger=require(_0x2205('0x1'))(_0x2205('0x2'));var moment=require(_0x2205('0x3'));var BPromise=require(_0x2205('0x4'));var rp=require(_0x2205('0x5'));var fs=require('fs');var path=require(_0x2205('0x6'));var rimraf=require('rimraf');var config=require(_0x2205('0x7'));var attributes=require(_0x2205('0x8'));var integrations=require(_0x2205('0x9'));module[_0x2205('0xa')]=function(_0x8417a2,_0x34b4a3){return _0x8417a2['define']('ZendeskAccount',attributes,{'tableName':_0x2205('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5474d33..175070c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc075=['ShowZendeskAccount','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','limit','include','map','model','then','stringify'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xc075,0x1a6));var _0x5c07=function(_0x17bb3c,_0x1c3f0d){_0x17bb3c=_0x17bb3c-0x0;var _0x3b177b=_0xc075[_0x17bb3c];return _0x3b177b;};'use strict';var _=require(_0x5c07('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5c07('0x1'));var rs=require(_0x5c07('0x2'));var fs=require('fs');var Redis=require(_0x5c07('0x3'));var db=require(_0x5c07('0x4'))['db'];var utils=require(_0x5c07('0x5'));var logger=require(_0x5c07('0x6'))('rpc');var config=require(_0x5c07('0x7'));var jayson=require(_0x5c07('0x8'));var client=jayson[_0x5c07('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ca99f,_0x42cf1b,_0x3a5c45){return new BPromise(function(_0x16121f,_0x462705){return client[_0x5c07('0xa')](_0x1ca99f,_0x3a5c45)['then'](function(_0x276985){logger[_0x5c07('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x42cf1b,_0x5c07('0xc'));logger[_0x5c07('0xd')](_0x5c07('0xe'),_0x42cf1b,'request\x20sent',JSON['stringify'](_0x276985));if(_0x276985[_0x5c07('0xf')]){if(_0x276985[_0x5c07('0xf')][_0x5c07('0x10')]===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x42cf1b,_0x276985['error']['message']);return _0x462705(_0x276985[_0x5c07('0xf')]['message']);}logger[_0x5c07('0xf')](_0x5c07('0x11'),_0x42cf1b,_0x276985['error'][_0x5c07('0x12')]);return _0x16121f(_0x276985[_0x5c07('0xf')][_0x5c07('0x12')]);}else{logger[_0x5c07('0xb')](_0x5c07('0x11'),_0x42cf1b,_0x5c07('0xc'));_0x16121f(_0x276985[_0x5c07('0x13')][_0x5c07('0x12')]);}})[_0x5c07('0x14')](function(_0x41a9c7){logger[_0x5c07('0xf')](_0x5c07('0x11'),_0x42cf1b,_0x41a9c7);_0x462705(_0x41a9c7);});});}exports[_0x5c07('0x15')]=function(_0x356782){var _0x4a4904=this;return new Promise(function(_0x5308b9,_0x22da15){return db[_0x5c07('0x16')]['findAll']({'raw':_0x356782[_0x5c07('0x17')]?_0x356782['options'][_0x5c07('0x18')]===undefined?!![]:![]:!![],'where':_0x356782[_0x5c07('0x17')]?_0x356782[_0x5c07('0x17')][_0x5c07('0x19')]||null:null,'attributes':_0x356782[_0x5c07('0x17')]?_0x356782[_0x5c07('0x17')][_0x5c07('0x1a')]||null:null,'limit':_0x356782[_0x5c07('0x17')]?_0x356782[_0x5c07('0x17')][_0x5c07('0x1b')]||null:null,'include':_0x356782[_0x5c07('0x17')]?_0x356782['options'][_0x5c07('0x1c')]?_[_0x5c07('0x1d')](_0x356782[_0x5c07('0x17')]['include'],function(_0x517417){return{'model':db[_0x517417[_0x5c07('0x1e')]],'as':_0x517417['as'],'attributes':_0x517417[_0x5c07('0x1a')],'include':_0x517417[_0x5c07('0x1c')]?_['map'](_0x517417[_0x5c07('0x1c')],function(_0x44e818){return{'model':db[_0x44e818[_0x5c07('0x1e')]],'as':_0x44e818['as'],'attributes':_0x44e818[_0x5c07('0x1a')],'include':_0x44e818[_0x5c07('0x1c')]?_[_0x5c07('0x1d')](_0x44e818[_0x5c07('0x1c')],function(_0x1cc7e7){return{'model':db[_0x1cc7e7[_0x5c07('0x1e')]],'as':_0x1cc7e7['as'],'attributes':_0x1cc7e7[_0x5c07('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5c07('0x1f')](function(_0x4f7d17){logger[_0x5c07('0xb')](_0x5c07('0x15'),_0x356782);logger[_0x5c07('0xd')]('GetZendeskAccount',_0x356782,JSON[_0x5c07('0x20')](_0x4f7d17));_0x5308b9(_0x4f7d17);})[_0x5c07('0x14')](function(_0x91a90c){logger[_0x5c07('0xf')](_0x5c07('0x15'),_0x91a90c['message'],_0x356782);_0x22da15(_0x4a4904[_0x5c07('0xf')](0x1f4,_0x91a90c['message']));});});};exports[_0x5c07('0x21')]=function(_0xec7035){var _0x1933a7=this;return new Promise(function(_0x290593,_0x37899e){return db[_0x5c07('0x16')][_0x5c07('0x22')]({'raw':_0xec7035['options']?_0xec7035[_0x5c07('0x17')][_0x5c07('0x18')]===undefined?!![]:![]:!![],'where':_0xec7035[_0x5c07('0x17')]?_0xec7035[_0x5c07('0x17')]['where']||null:null,'attributes':_0xec7035[_0x5c07('0x17')]?_0xec7035[_0x5c07('0x17')][_0x5c07('0x1a')]||null:null,'include':_0xec7035['options']?_0xec7035[_0x5c07('0x17')][_0x5c07('0x1c')]?_[_0x5c07('0x1d')](_0xec7035[_0x5c07('0x17')]['include'],function(_0x2b2228){return{'model':db[_0x2b2228[_0x5c07('0x1e')]],'as':_0x2b2228['as'],'attributes':_0x2b2228[_0x5c07('0x1a')],'include':_0x2b2228[_0x5c07('0x1c')]?_[_0x5c07('0x1d')](_0x2b2228['include'],function(_0x3e31c9){return{'model':db[_0x3e31c9[_0x5c07('0x1e')]],'as':_0x3e31c9['as'],'attributes':_0x3e31c9[_0x5c07('0x1a')],'include':_0x3e31c9[_0x5c07('0x1c')]?_[_0x5c07('0x1d')](_0x3e31c9['include'],function(_0x4b385e){return{'model':db[_0x4b385e['model']],'as':_0x4b385e['as'],'attributes':_0x4b385e[_0x5c07('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5c07('0x1f')](function(_0x50cec5){logger[_0x5c07('0xb')](_0x5c07('0x21'),_0xec7035);logger[_0x5c07('0xd')]('ShowZendeskAccount',_0xec7035,JSON[_0x5c07('0x20')](_0x50cec5));_0x290593(_0x50cec5);})['catch'](function(_0x3e3ed7){logger[_0x5c07('0xf')]('ShowZendeskAccount',_0x3e3ed7[_0x5c07('0x12')],_0xec7035);_0x37899e(_0x1933a7[_0x5c07('0xf')](0x1f4,_0x3e3ed7[_0x5c07('0x12')]));});});};
\ No newline at end of file
+var _0xd74b=['info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3d556c,_0x594821){var _0x3147bf=function(_0x2838ea){while(--_0x2838ea){_0x3d556c['push'](_0x3d556c['shift']());}};_0x3147bf(++_0x594821);}(_0xd74b,0x1e0));var _0xbd74=function(_0x2ccf20,_0x3a3291){_0x2ccf20=_0x2ccf20-0x0;var _0x1d5ba5=_0xd74b[_0x2ccf20];return _0x1d5ba5;};'use strict';var _=require(_0xbd74('0x0'));var util=require(_0xbd74('0x1'));var moment=require(_0xbd74('0x2'));var BPromise=require(_0xbd74('0x3'));var rs=require(_0xbd74('0x4'));var fs=require('fs');var Redis=require(_0xbd74('0x5'));var db=require(_0xbd74('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd74('0x7'))(_0xbd74('0x8'));var config=require(_0xbd74('0x9'));var jayson=require(_0xbd74('0xa'));var client=jayson[_0xbd74('0xb')][_0xbd74('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x242047,_0x4ea9f4,_0xf72262){return new BPromise(function(_0x518a11,_0x1c97c3){return client['request'](_0x242047,_0xf72262)[_0xbd74('0xd')](function(_0x460c8c){logger[_0xbd74('0xe')](_0xbd74('0xf'),_0x4ea9f4,_0xbd74('0x10'));logger[_0xbd74('0x11')](_0xbd74('0x12'),_0x4ea9f4,'request\x20sent',JSON[_0xbd74('0x13')](_0x460c8c));if(_0x460c8c[_0xbd74('0x14')]){if(_0x460c8c[_0xbd74('0x14')][_0xbd74('0x15')]===0x1f4){logger[_0xbd74('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0x4ea9f4,_0x460c8c[_0xbd74('0x14')][_0xbd74('0x16')]);return _0x1c97c3(_0x460c8c['error']['message']);}logger[_0xbd74('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0x4ea9f4,_0x460c8c[_0xbd74('0x14')][_0xbd74('0x16')]);return _0x518a11(_0x460c8c[_0xbd74('0x14')]['message']);}else{logger[_0xbd74('0xe')](_0xbd74('0xf'),_0x4ea9f4,_0xbd74('0x10'));_0x518a11(_0x460c8c[_0xbd74('0x17')]['message']);}})[_0xbd74('0x18')](function(_0xcc299d){logger[_0xbd74('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0x4ea9f4,_0xcc299d);_0x1c97c3(_0xcc299d);});});}exports[_0xbd74('0x19')]=function(_0x407b54){var _0x53e890=this;return new Promise(function(_0x4fed4b,_0x537660){return db[_0xbd74('0x1a')][_0xbd74('0x1b')]({'raw':_0x407b54['options']?_0x407b54[_0xbd74('0x1c')][_0xbd74('0x1d')]===undefined?!![]:![]:!![],'where':_0x407b54[_0xbd74('0x1c')]?_0x407b54[_0xbd74('0x1c')][_0xbd74('0x1e')]||null:null,'attributes':_0x407b54[_0xbd74('0x1c')]?_0x407b54['options'][_0xbd74('0x1f')]||null:null,'limit':_0x407b54[_0xbd74('0x1c')]?_0x407b54[_0xbd74('0x1c')][_0xbd74('0x20')]||null:null,'include':_0x407b54[_0xbd74('0x1c')]?_0x407b54[_0xbd74('0x1c')][_0xbd74('0x21')]?_[_0xbd74('0x22')](_0x407b54[_0xbd74('0x1c')][_0xbd74('0x21')],function(_0x2c1163){return{'model':db[_0x2c1163[_0xbd74('0x23')]],'as':_0x2c1163['as'],'attributes':_0x2c1163[_0xbd74('0x1f')],'include':_0x2c1163[_0xbd74('0x21')]?_[_0xbd74('0x22')](_0x2c1163[_0xbd74('0x21')],function(_0x58e0de){return{'model':db[_0x58e0de[_0xbd74('0x23')]],'as':_0x58e0de['as'],'attributes':_0x58e0de['attributes'],'include':_0x58e0de[_0xbd74('0x21')]?_[_0xbd74('0x22')](_0x58e0de[_0xbd74('0x21')],function(_0xf74f54){return{'model':db[_0xf74f54[_0xbd74('0x23')]],'as':_0xf74f54['as'],'attributes':_0xf74f54['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd74('0xd')](function(_0x1ce07f){logger[_0xbd74('0xe')]('GetZendeskAccount',_0x407b54);logger['debug'](_0xbd74('0x19'),_0x407b54,JSON['stringify'](_0x1ce07f));_0x4fed4b(_0x1ce07f);})[_0xbd74('0x18')](function(_0x29717e){logger[_0xbd74('0x14')]('GetZendeskAccount',_0x29717e[_0xbd74('0x16')],_0x407b54);_0x537660(_0x53e890[_0xbd74('0x14')](0x1f4,_0x29717e['message']));});});};exports[_0xbd74('0x24')]=function(_0x11649a){var _0x1658a0=this;return new Promise(function(_0x275168,_0x14c0b2){return db[_0xbd74('0x1a')][_0xbd74('0x25')]({'raw':_0x11649a[_0xbd74('0x1c')]?_0x11649a[_0xbd74('0x1c')][_0xbd74('0x1d')]===undefined?!![]:![]:!![],'where':_0x11649a[_0xbd74('0x1c')]?_0x11649a[_0xbd74('0x1c')][_0xbd74('0x1e')]||null:null,'attributes':_0x11649a[_0xbd74('0x1c')]?_0x11649a[_0xbd74('0x1c')]['attributes']||null:null,'include':_0x11649a[_0xbd74('0x1c')]?_0x11649a['options'][_0xbd74('0x21')]?_[_0xbd74('0x22')](_0x11649a[_0xbd74('0x1c')]['include'],function(_0x5a3e87){return{'model':db[_0x5a3e87[_0xbd74('0x23')]],'as':_0x5a3e87['as'],'attributes':_0x5a3e87[_0xbd74('0x1f')],'include':_0x5a3e87[_0xbd74('0x21')]?_['map'](_0x5a3e87[_0xbd74('0x21')],function(_0x37c20d){return{'model':db[_0x37c20d[_0xbd74('0x23')]],'as':_0x37c20d['as'],'attributes':_0x37c20d[_0xbd74('0x1f')],'include':_0x37c20d[_0xbd74('0x21')]?_['map'](_0x37c20d[_0xbd74('0x21')],function(_0x5ed01f){return{'model':db[_0x5ed01f[_0xbd74('0x23')]],'as':_0x5ed01f['as'],'attributes':_0x5ed01f['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd74('0xd')](function(_0x1716ef){logger['info'](_0xbd74('0x24'),_0x11649a);logger[_0xbd74('0x11')](_0xbd74('0x24'),_0x11649a,JSON[_0xbd74('0x13')](_0x1716ef));_0x275168(_0x1716ef);})[_0xbd74('0x18')](function(_0x3e3151){logger[_0xbd74('0x14')](_0xbd74('0x24'),_0x3e3151[_0xbd74('0x16')],_0x11649a);_0x14c0b2(_0x1658a0['error'](0x1f4,_0x3e3151[_0xbd74('0x16')]));});});};
\ No newline at end of file
index 37140b9..d4a93fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x170994,_0x5adc66){var _0x3c89a3=function(_0x53e7e1){while(--_0x53e7e1){_0x170994['push'](_0x170994['shift']());}};_0x3c89a3(++_0x5adc66);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router;
\ No newline at end of file
+var _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x8c86ad,_0x17ad17){var _0x90bce3=function(_0x30d395){while(--_0x30d395){_0x8c86ad['push'](_0x8c86ad['shift']());}};_0x90bce3(++_0x17ad17);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4a9e9b,_0x2328e5){_0x4a9e9b=_0x4a9e9b-0x0;var _0x143bc5=_0xf4eb[_0x4a9e9b];return _0x143bc5;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router;
\ No newline at end of file
index 4bb785c..0edd67d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaff2=['sequelize','exports','STRING'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xaff2,0x16e));var _0x2aff=function(_0x4a563b,_0x36f42d){_0x4a563b=_0x4a563b-0x0;var _0x2935ef=_0xaff2[_0x4a563b];return _0x2935ef;};'use strict';var Sequelize=require(_0x2aff('0x0'));module[_0x2aff('0x1')]={'name':{'type':Sequelize[_0x2aff('0x2')]},'description':{'type':Sequelize[_0x2aff('0x2')]}};
\ No newline at end of file
+var _0x6d4d=['sequelize','exports','STRING'];(function(_0x143e43,_0x5e2676){var _0x5cccbf=function(_0x292caa){while(--_0x292caa){_0x143e43['push'](_0x143e43['shift']());}};_0x5cccbf(++_0x5e2676);}(_0x6d4d,0xab));var _0xd6d4=function(_0x20006a,_0x30e3a9){_0x20006a=_0x20006a-0x0;var _0x5e26ac=_0x6d4d[_0x20006a];return _0x5e26ac;};'use strict';var Sequelize=require(_0xd6d4('0x0'));module[_0xd6d4('0x1')]={'name':{'type':Sequelize[_0xd6d4('0x2')]},'description':{'type':Sequelize[_0xd6d4('0x2')]}};
\ No newline at end of file
index b89206d..b8c232a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ae5=['update','then','destroy','end','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','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','limit','count','set','Content-Range','apply','reject','save'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x3ae5,0x13b));var _0x53ae=function(_0x3edc9c,_0x148d23){_0x3edc9c=_0x3edc9c-0x0;var _0x2725ae=_0x3ae5[_0x3edc9c];return _0x2725ae;};'use strict';var emlformat=require(_0x53ae('0x0'));var rimraf=require(_0x53ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53ae('0x2'));var rp=require(_0x53ae('0x3'));var moment=require(_0x53ae('0x4'));var BPromise=require(_0x53ae('0x5'));var Mustache=require(_0x53ae('0x6'));var util=require(_0x53ae('0x7'));var path=require(_0x53ae('0x8'));var sox=require(_0x53ae('0x9'));var csv=require('to-csv');var ejs=require(_0x53ae('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53ae('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x53ae('0xc'));var deskjs=require(_0x53ae('0xd'));var toCsv=require(_0x53ae('0xe'));var querystring=require(_0x53ae('0xf'));var Papa=require(_0x53ae('0x10'));var Redis=require('ioredis');var authService=require(_0x53ae('0x11'));var qs=require(_0x53ae('0x12'));var as=require(_0x53ae('0x13'));var hardwareService=require(_0x53ae('0x14'));var logger=require('../../config/logger')(_0x53ae('0x15'));var utils=require(_0x53ae('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x53ae('0x17'));var db=require(_0x53ae('0x18'))['db'];function respondWithStatusCode(_0x16b002,_0x3afa12){_0x3afa12=_0x3afa12||0xcc;return function(_0x2276ba){if(_0x2276ba){return _0x16b002[_0x53ae('0x19')](_0x3afa12);}return _0x16b002[_0x53ae('0x1a')](_0x3afa12)['end']();};}function respondWithResult(_0x3fbad3,_0x630f1){_0x630f1=_0x630f1||0xc8;return function(_0x22875d){if(_0x22875d){return _0x3fbad3[_0x53ae('0x1a')](_0x630f1)[_0x53ae('0x1b')](_0x22875d);}};}function respondWithFilteredResult(_0x4e01dc,_0x362635){return function(_0x5900b0){if(_0x5900b0){var _0xe758af=typeof _0x362635[_0x53ae('0x1c')]===_0x53ae('0x1d')&&typeof _0x362635[_0x53ae('0x1e')]===_0x53ae('0x1d');var _0x2063e5=_0x5900b0[_0x53ae('0x1f')];var _0x115431=_0xe758af?0x0:_0x362635[_0x53ae('0x1c')];var _0x1b0049=_0xe758af?_0x5900b0[_0x53ae('0x1f')]:_0x362635[_0x53ae('0x1c')]+_0x362635['limit'];var _0x2a7c82;if(_0x1b0049>=_0x2063e5){_0x1b0049=_0x2063e5;_0x2a7c82=0xc8;}else{_0x2a7c82=0xce;}_0x4e01dc[_0x53ae('0x1a')](_0x2a7c82);return _0x4e01dc[_0x53ae('0x20')](_0x53ae('0x21'),_0x115431+'-'+_0x1b0049+'/'+_0x2063e5)[_0x53ae('0x1b')](_0x5900b0);}return null;};}function patchUpdates(_0x133f60){return function(_0x3d9499){try{jsonpatch[_0x53ae('0x22')](_0x3d9499,_0x133f60,!![]);}catch(_0x355685){return BPromise[_0x53ae('0x23')](_0x355685);}return _0x3d9499[_0x53ae('0x24')]();};}function saveUpdates(_0x135dd3,_0x2a6ce0){return function(_0x4caadd){if(_0x4caadd){return _0x4caadd[_0x53ae('0x25')](_0x135dd3)[_0x53ae('0x26')](function(_0x3a4b55){return _0x3a4b55;});}return null;};}function removeEntity(_0x5dff89,_0x1ea8fe){return function(_0x6d656e){if(_0x6d656e){return _0x6d656e[_0x53ae('0x27')]()[_0x53ae('0x26')](function(){_0x5dff89[_0x53ae('0x1a')](0xcc)[_0x53ae('0x28')]();});}};}function handleEntityNotFound(_0x2e6ad3,_0x657920){return function(_0x4a3470){if(!_0x4a3470){_0x2e6ad3[_0x53ae('0x19')](0x194);}return _0x4a3470;};}function handleError(_0x287592,_0x73e3bb){_0x73e3bb=_0x73e3bb||0x1f4;return function(_0x254297){logger[_0x53ae('0x29')](_0x254297[_0x53ae('0x2a')]);if(_0x254297[_0x53ae('0x2b')]){delete _0x254297[_0x53ae('0x2b')];}_0x287592[_0x53ae('0x1a')](_0x73e3bb)[_0x53ae('0x2c')](_0x254297);};}exports[_0x53ae('0x2d')]=function(_0x48214d,_0x317d27){var _0x55c2c7={},_0x5c8f0f={},_0xc462e2={'count':0x0,'rows':[]};var _0x570fc2=_[_0x53ae('0x2e')](db[_0x53ae('0x2f')][_0x53ae('0x30')],function(_0x4c822b){return{'name':_0x4c822b[_0x53ae('0x31')],'type':_0x4c822b['type'][_0x53ae('0x32')]};});_0x5c8f0f[_0x53ae('0x33')]=_[_0x53ae('0x2e')](_0x570fc2,_0x53ae('0x2b'));_0x5c8f0f[_0x53ae('0x34')]=_[_0x53ae('0x35')](_0x48214d[_0x53ae('0x34')]);_0x5c8f0f[_0x53ae('0x36')]=_[_0x53ae('0x37')](_0x5c8f0f[_0x53ae('0x33')],_0x5c8f0f[_0x53ae('0x34')]);_0x55c2c7[_0x53ae('0x38')]=_['intersection'](_0x5c8f0f['model'],qs[_0x53ae('0x39')](_0x48214d[_0x53ae('0x34')][_0x53ae('0x39')]));_0x55c2c7[_0x53ae('0x38')]=_0x55c2c7[_0x53ae('0x38')][_0x53ae('0x3a')]?_0x55c2c7['attributes']:_0x5c8f0f['model'];if(!_0x48214d[_0x53ae('0x34')][_0x53ae('0x3b')](_0x53ae('0x3c'))){_0x55c2c7['limit']=qs[_0x53ae('0x1e')](_0x48214d['query'][_0x53ae('0x1e')]);_0x55c2c7['offset']=qs['offset'](_0x48214d[_0x53ae('0x34')][_0x53ae('0x1c')]);}_0x55c2c7[_0x53ae('0x3d')]=qs[_0x53ae('0x3e')](_0x48214d[_0x53ae('0x34')][_0x53ae('0x3e')]);_0x55c2c7[_0x53ae('0x3f')]=qs[_0x53ae('0x36')](_[_0x53ae('0x40')](_0x48214d[_0x53ae('0x34')],_0x5c8f0f[_0x53ae('0x36')]),_0x570fc2);if(_0x48214d[_0x53ae('0x34')][_0x53ae('0x41')]){_0x55c2c7[_0x53ae('0x3f')]=_[_0x53ae('0x42')](_0x55c2c7[_0x53ae('0x3f')],{'$or':_[_0x53ae('0x2e')](_0x570fc2,function(_0x3e71ff){if(_0x3e71ff[_0x53ae('0x43')]!==_0x53ae('0x44')){var _0x3f1914={};_0x3f1914[_0x3e71ff[_0x53ae('0x2b')]]={'$like':'%'+_0x48214d[_0x53ae('0x34')][_0x53ae('0x41')]+'%'};return _0x3f1914;}})});}_0x55c2c7=_[_0x53ae('0x42')]({},_0x55c2c7,_0x48214d['options']);var _0x25faec={'where':_0x55c2c7[_0x53ae('0x3f')]};return db[_0x53ae('0x2f')][_0x53ae('0x1f')](_0x25faec)[_0x53ae('0x26')](function(_0x16d555){_0xc462e2[_0x53ae('0x1f')]=_0x16d555;if(_0x48214d[_0x53ae('0x34')][_0x53ae('0x45')]){_0x55c2c7['include']=[{'all':!![]}];}return db[_0x53ae('0x2f')][_0x53ae('0x46')](_0x55c2c7);})[_0x53ae('0x26')](function(_0x1eb57b){_0xc462e2[_0x53ae('0x47')]=_0x1eb57b;return _0xc462e2;})['then'](respondWithFilteredResult(_0x317d27,_0x55c2c7))[_0x53ae('0x48')](handleError(_0x317d27,null));};exports[_0x53ae('0x49')]=function(_0x20a5f2,_0x2cd02f){var _0x1aa430={'raw':![],'where':{'id':_0x20a5f2[_0x53ae('0x4a')]['id']}},_0x39e46a={};_0x39e46a[_0x53ae('0x33')]=_[_0x53ae('0x35')](db[_0x53ae('0x2f')][_0x53ae('0x30')]);_0x39e46a['query']=_[_0x53ae('0x35')](_0x20a5f2['query']);_0x39e46a['filters']=_[_0x53ae('0x37')](_0x39e46a[_0x53ae('0x33')],_0x39e46a[_0x53ae('0x34')]);_0x1aa430[_0x53ae('0x38')]=_[_0x53ae('0x37')](_0x39e46a[_0x53ae('0x33')],qs[_0x53ae('0x39')](_0x20a5f2[_0x53ae('0x34')][_0x53ae('0x39')]));_0x1aa430[_0x53ae('0x38')]=_0x1aa430[_0x53ae('0x38')]['length']?_0x1aa430[_0x53ae('0x38')]:_0x39e46a[_0x53ae('0x33')];if(_0x20a5f2[_0x53ae('0x34')][_0x53ae('0x45')]){_0x1aa430[_0x53ae('0x4b')]=[{'all':!![]}];}_0x1aa430=_[_0x53ae('0x42')]({},_0x1aa430,_0x20a5f2[_0x53ae('0x4c')]);return db[_0x53ae('0x2f')][_0x53ae('0x4d')](_0x1aa430)[_0x53ae('0x26')](handleEntityNotFound(_0x2cd02f,null))[_0x53ae('0x26')](respondWithResult(_0x2cd02f,null))[_0x53ae('0x48')](handleError(_0x2cd02f,null));};exports['create']=function(_0x41040c,_0x4b7a99){return db[_0x53ae('0x2f')][_0x53ae('0x4e')](_0x41040c[_0x53ae('0x4f')],{})[_0x53ae('0x26')](respondWithResult(_0x4b7a99,0xc9))['catch'](handleError(_0x4b7a99,null));};exports['update']=function(_0x5221be,_0x7da797){if(_0x5221be[_0x53ae('0x4f')]['id']){delete _0x5221be[_0x53ae('0x4f')]['id'];}return db[_0x53ae('0x2f')][_0x53ae('0x4d')]({'where':{'id':_0x5221be[_0x53ae('0x4a')]['id']}})[_0x53ae('0x26')](handleEntityNotFound(_0x7da797,null))['then'](saveUpdates(_0x5221be['body'],null))[_0x53ae('0x26')](respondWithResult(_0x7da797,null))[_0x53ae('0x48')](handleError(_0x7da797,null));};exports['destroy']=function(_0xfc76,_0x2728cc){return db[_0x53ae('0x2f')]['find']({'where':{'id':_0xfc76[_0x53ae('0x4a')]['id']}})[_0x53ae('0x26')](handleEntityNotFound(_0x2728cc,null))['then'](removeEntity(_0x2728cc,null))[_0x53ae('0x48')](handleError(_0x2728cc,null));};exports[_0x53ae('0x50')]=function(_0x4b7ac7,_0xc49b33,_0x7fb91d){var _0x5432b7={};var _0x5c5a78={};var _0x307a01;var _0x6d69c9;return db[_0x53ae('0x2f')][_0x53ae('0x51')]({'where':{'id':_0x4b7ac7[_0x53ae('0x4a')]['id']}})['then'](handleEntityNotFound(_0xc49b33,null))[_0x53ae('0x26')](function(_0x90cc26){if(_0x90cc26){_0x307a01=_0x90cc26;_0x5c5a78[_0x53ae('0x33')]=_[_0x53ae('0x35')](db[_0x53ae('0x52')][_0x53ae('0x30')]);_0x5c5a78[_0x53ae('0x34')]=_['keys'](_0x4b7ac7['query']);_0x5c5a78[_0x53ae('0x36')]=_['intersection'](_0x5c5a78['model'],_0x5c5a78[_0x53ae('0x34')]);_0x5432b7[_0x53ae('0x38')]=_[_0x53ae('0x37')](_0x5c5a78[_0x53ae('0x33')],qs[_0x53ae('0x39')](_0x4b7ac7[_0x53ae('0x34')][_0x53ae('0x39')]));_0x5432b7[_0x53ae('0x38')]=_0x5432b7[_0x53ae('0x38')]['length']?_0x5432b7['attributes']:_0x5c5a78[_0x53ae('0x33')];_0x5432b7[_0x53ae('0x3d')]=qs[_0x53ae('0x3e')](_0x4b7ac7[_0x53ae('0x34')]['sort']);_0x5432b7[_0x53ae('0x3f')]=qs[_0x53ae('0x36')](_[_0x53ae('0x40')](_0x4b7ac7[_0x53ae('0x34')],_0x5c5a78[_0x53ae('0x36')]));if(_0x4b7ac7['query']['filter']){_0x5432b7['where']=_[_0x53ae('0x42')](_0x5432b7['where'],{'$or':_[_0x53ae('0x2e')](_0x5432b7['attributes'],function(_0x108500){var _0xbe9887={};_0xbe9887[_0x108500]={'$like':'%'+_0x4b7ac7['query']['filter']+'%'};return _0xbe9887;})});}_0x5432b7=_['merge']({},_0x5432b7,_0x4b7ac7[_0x53ae('0x4c')]);return _0x307a01[_0x53ae('0x50')](_0x5432b7);}})[_0x53ae('0x26')](function(_0x47c2b9){if(_0x47c2b9){_0x6d69c9=_0x47c2b9['length'];if(!_0x4b7ac7[_0x53ae('0x34')][_0x53ae('0x3b')](_0x53ae('0x3c'))){_0x5432b7[_0x53ae('0x1e')]=qs[_0x53ae('0x1e')](_0x4b7ac7[_0x53ae('0x34')][_0x53ae('0x1e')]);_0x5432b7[_0x53ae('0x1c')]=qs[_0x53ae('0x1c')](_0x4b7ac7[_0x53ae('0x34')][_0x53ae('0x1c')]);}return _0x307a01[_0x53ae('0x50')](_0x5432b7);}})['then'](function(_0xd83965){if(_0xd83965){return _0xd83965?{'count':_0x6d69c9,'rows':_0xd83965}:null;}})[_0x53ae('0x26')](respondWithResult(_0xc49b33,null))['catch'](handleError(_0xc49b33,null));};exports[_0x53ae('0x53')]=function(_0x194cce,_0x1944e4,_0x1cd7af){var _0x2d9038={};var _0x1866cf={};var _0x24ee6c;var _0x18808e;return db[_0x53ae('0x2f')]['findOne']({'where':{'id':_0x194cce[_0x53ae('0x4a')]['id']}})[_0x53ae('0x26')](handleEntityNotFound(_0x1944e4,null))[_0x53ae('0x26')](function(_0x57354e){if(_0x57354e){_0x24ee6c=_0x57354e;_0x1866cf[_0x53ae('0x33')]=_[_0x53ae('0x35')](db['ZendeskField'][_0x53ae('0x30')]);_0x1866cf['query']=_[_0x53ae('0x35')](_0x194cce[_0x53ae('0x34')]);_0x1866cf[_0x53ae('0x36')]=_['intersection'](_0x1866cf[_0x53ae('0x33')],_0x1866cf[_0x53ae('0x34')]);_0x2d9038[_0x53ae('0x38')]=_[_0x53ae('0x37')](_0x1866cf[_0x53ae('0x33')],qs[_0x53ae('0x39')](_0x194cce['query'][_0x53ae('0x39')]));_0x2d9038[_0x53ae('0x38')]=_0x2d9038[_0x53ae('0x38')][_0x53ae('0x3a')]?_0x2d9038[_0x53ae('0x38')]:_0x1866cf[_0x53ae('0x33')];_0x2d9038['order']=qs[_0x53ae('0x3e')](_0x194cce[_0x53ae('0x34')]['sort']);_0x2d9038[_0x53ae('0x3f')]=qs[_0x53ae('0x36')](_['pick'](_0x194cce['query'],_0x1866cf[_0x53ae('0x36')]));if(_0x194cce[_0x53ae('0x34')][_0x53ae('0x41')]){_0x2d9038[_0x53ae('0x3f')]=_['merge'](_0x2d9038[_0x53ae('0x3f')],{'$or':_['map'](_0x2d9038[_0x53ae('0x38')],function(_0x30f154){var _0x51cfed={};_0x51cfed[_0x30f154]={'$like':'%'+_0x194cce[_0x53ae('0x34')][_0x53ae('0x41')]+'%'};return _0x51cfed;})});}_0x2d9038=_['merge']({},_0x2d9038,_0x194cce[_0x53ae('0x4c')]);return _0x24ee6c[_0x53ae('0x53')](_0x2d9038);}})[_0x53ae('0x26')](function(_0x10baf3){if(_0x10baf3){_0x18808e=_0x10baf3[_0x53ae('0x3a')];if(!_0x194cce[_0x53ae('0x34')]['hasOwnProperty'](_0x53ae('0x3c'))){_0x2d9038[_0x53ae('0x1e')]=qs[_0x53ae('0x1e')](_0x194cce['query'][_0x53ae('0x1e')]);_0x2d9038[_0x53ae('0x1c')]=qs[_0x53ae('0x1c')](_0x194cce[_0x53ae('0x34')][_0x53ae('0x1c')]);}return _0x24ee6c[_0x53ae('0x53')](_0x2d9038);}})[_0x53ae('0x26')](function(_0xf41955){if(_0xf41955){return _0xf41955?{'count':_0x18808e,'rows':_0xf41955}:null;}})[_0x53ae('0x26')](respondWithResult(_0x1944e4,null))[_0x53ae('0x48')](handleError(_0x1944e4,null));};exports['getDescriptions']=function(_0x2325f4,_0x4f1c80,_0x1e9905){var _0x2b1aeb={};var _0x32bf6f={};var _0x27804e;var _0x44ce2f;return db[_0x53ae('0x2f')][_0x53ae('0x51')]({'where':{'id':_0x2325f4['params']['id']}})[_0x53ae('0x26')](handleEntityNotFound(_0x4f1c80,null))[_0x53ae('0x26')](function(_0x2cf002){if(_0x2cf002){_0x27804e=_0x2cf002;_0x32bf6f[_0x53ae('0x33')]=_[_0x53ae('0x35')](db['ZendeskField'][_0x53ae('0x30')]);_0x32bf6f[_0x53ae('0x34')]=_[_0x53ae('0x35')](_0x2325f4['query']);_0x32bf6f['filters']=_[_0x53ae('0x37')](_0x32bf6f[_0x53ae('0x33')],_0x32bf6f['query']);_0x2b1aeb['attributes']=_[_0x53ae('0x37')](_0x32bf6f[_0x53ae('0x33')],qs['fields'](_0x2325f4[_0x53ae('0x34')][_0x53ae('0x39')]));_0x2b1aeb[_0x53ae('0x38')]=_0x2b1aeb[_0x53ae('0x38')][_0x53ae('0x3a')]?_0x2b1aeb[_0x53ae('0x38')]:_0x32bf6f['model'];_0x2b1aeb['order']=qs[_0x53ae('0x3e')](_0x2325f4[_0x53ae('0x34')][_0x53ae('0x3e')]);_0x2b1aeb[_0x53ae('0x3f')]=qs[_0x53ae('0x36')](_[_0x53ae('0x40')](_0x2325f4[_0x53ae('0x34')],_0x32bf6f[_0x53ae('0x36')]));if(_0x2325f4[_0x53ae('0x34')][_0x53ae('0x41')]){_0x2b1aeb[_0x53ae('0x3f')]=_[_0x53ae('0x42')](_0x2b1aeb[_0x53ae('0x3f')],{'$or':_[_0x53ae('0x2e')](_0x2b1aeb[_0x53ae('0x38')],function(_0x659b03){var _0x26957c={};_0x26957c[_0x659b03]={'$like':'%'+_0x2325f4['query'][_0x53ae('0x41')]+'%'};return _0x26957c;})});}_0x2b1aeb=_[_0x53ae('0x42')]({},_0x2b1aeb,_0x2325f4['options']);return _0x27804e['getDescriptions'](_0x2b1aeb);}})[_0x53ae('0x26')](function(_0x1225ef){if(_0x1225ef){_0x44ce2f=_0x1225ef[_0x53ae('0x3a')];if(!_0x2325f4[_0x53ae('0x34')][_0x53ae('0x3b')](_0x53ae('0x3c'))){_0x2b1aeb['limit']=qs[_0x53ae('0x1e')](_0x2325f4['query'][_0x53ae('0x1e')]);_0x2b1aeb[_0x53ae('0x1c')]=qs[_0x53ae('0x1c')](_0x2325f4['query'][_0x53ae('0x1c')]);}return _0x27804e[_0x53ae('0x54')](_0x2b1aeb);}})[_0x53ae('0x26')](function(_0x4550db){if(_0x4550db){return _0x4550db?{'count':_0x44ce2f,'rows':_0x4550db}:null;}})[_0x53ae('0x26')](respondWithResult(_0x4f1c80,null))[_0x53ae('0x48')](handleError(_0x4f1c80,null));};exports['getTags']=function(_0x49828f,_0x5e38f6,_0x2e68ef){var _0x4455f5={};var _0x389f9c={};var _0x59e19c;var _0x4ff83c;return db['ZendeskConfiguration'][_0x53ae('0x51')]({'where':{'id':_0x49828f[_0x53ae('0x4a')]['id']}})[_0x53ae('0x26')](handleEntityNotFound(_0x5e38f6,null))[_0x53ae('0x26')](function(_0x50f7a1){if(_0x50f7a1){_0x59e19c=_0x50f7a1;_0x389f9c[_0x53ae('0x33')]=_[_0x53ae('0x35')](db[_0x53ae('0x55')][_0x53ae('0x30')]);_0x389f9c[_0x53ae('0x34')]=_[_0x53ae('0x35')](_0x49828f[_0x53ae('0x34')]);_0x389f9c['filters']=_['intersection'](_0x389f9c[_0x53ae('0x33')],_0x389f9c['query']);_0x4455f5[_0x53ae('0x38')]=_[_0x53ae('0x37')](_0x389f9c[_0x53ae('0x33')],qs[_0x53ae('0x39')](_0x49828f[_0x53ae('0x34')][_0x53ae('0x39')]));_0x4455f5['attributes']=_0x4455f5[_0x53ae('0x38')][_0x53ae('0x3a')]?_0x4455f5[_0x53ae('0x38')]:_0x389f9c[_0x53ae('0x33')];_0x4455f5[_0x53ae('0x3d')]=qs[_0x53ae('0x3e')](_0x49828f[_0x53ae('0x34')]['sort']);_0x4455f5[_0x53ae('0x3f')]=qs[_0x53ae('0x36')](_[_0x53ae('0x40')](_0x49828f[_0x53ae('0x34')],_0x389f9c[_0x53ae('0x36')]));if(_0x49828f[_0x53ae('0x34')]['filter']){_0x4455f5[_0x53ae('0x3f')]=_[_0x53ae('0x42')](_0x4455f5[_0x53ae('0x3f')],{'$or':_[_0x53ae('0x2e')](_0x4455f5[_0x53ae('0x38')],function(_0x287dc2){var _0x13692f={};_0x13692f[_0x287dc2]={'$like':'%'+_0x49828f['query'][_0x53ae('0x41')]+'%'};return _0x13692f;})});}_0x4455f5=_[_0x53ae('0x42')]({},_0x4455f5,_0x49828f[_0x53ae('0x4c')]);return _0x59e19c['getTags'](_0x4455f5);}})[_0x53ae('0x26')](function(_0x2b4637){if(_0x2b4637){_0x4ff83c=_0x2b4637[_0x53ae('0x3a')];if(!_0x49828f['query'][_0x53ae('0x3b')](_0x53ae('0x3c'))){_0x4455f5[_0x53ae('0x1e')]=qs[_0x53ae('0x1e')](_0x49828f[_0x53ae('0x34')][_0x53ae('0x1e')]);_0x4455f5[_0x53ae('0x1c')]=qs[_0x53ae('0x1c')](_0x49828f[_0x53ae('0x34')][_0x53ae('0x1c')]);}return _0x59e19c['getTags'](_0x4455f5);}})[_0x53ae('0x26')](function(_0x3f31cb){if(_0x3f31cb){return _0x3f31cb?{'count':_0x4ff83c,'rows':_0x3f31cb}:null;}})[_0x53ae('0x26')](respondWithResult(_0x5e38f6,null))[_0x53ae('0x48')](handleError(_0x5e38f6,null));};exports[_0x53ae('0x56')]=function(_0x2f3233,_0x298a64,_0x47af11){if(_0x2f3233[_0x53ae('0x4f')]['id']){delete _0x2f3233[_0x53ae('0x4f')]['id'];}return db[_0x53ae('0x2f')][_0x53ae('0x51')]({'where':{'id':_0x2f3233['params']['id']}})[_0x53ae('0x26')](handleEntityNotFound(_0x298a64,null))['then'](function(_0x4164f3){if(_0x4164f3){return _0x4164f3[_0x53ae('0x56')](_0x2f3233['body'][_0x53ae('0x57')]||[]);}return null;})['then'](respondWithResult(_0x298a64,null))['catch'](handleError(_0x298a64,null));};
\ No newline at end of file
+var _0xf891=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','ZendeskConfiguration','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','find','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x5ae03f,_0x1b5a9f){var _0x5885cb=function(_0x4cfc71){while(--_0x4cfc71){_0x5ae03f['push'](_0x5ae03f['shift']());}};_0x5885cb(++_0x1b5a9f);}(_0xf891,0x184));var _0x1f89=function(_0x541d5b,_0x558a3e){_0x541d5b=_0x541d5b-0x0;var _0x31d16e=_0xf891[_0x541d5b];return _0x31d16e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1f89('0x0'));var jsonpatch=require(_0x1f89('0x1'));var rp=require(_0x1f89('0x2'));var moment=require(_0x1f89('0x3'));var BPromise=require(_0x1f89('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1f89('0x5'));var csv=require(_0x1f89('0x6'));var ejs=require(_0x1f89('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1f89('0x8'));var jsforce=require(_0x1f89('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x1f89('0x6'));var querystring=require(_0x1f89('0xa'));var Papa=require(_0x1f89('0xb'));var Redis=require('ioredis');var authService=require(_0x1f89('0xc'));var qs=require(_0x1f89('0xd'));var as=require(_0x1f89('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1f89('0xf'));var utils=require(_0x1f89('0x10'));var config=require(_0x1f89('0x11'));var licenseUtil=require(_0x1f89('0x12'));var db=require(_0x1f89('0x13'))['db'];function respondWithStatusCode(_0x50af45,_0x539ada){_0x539ada=_0x539ada||0xcc;return function(_0x32c826){if(_0x32c826){return _0x50af45[_0x1f89('0x14')](_0x539ada);}return _0x50af45['status'](_0x539ada)[_0x1f89('0x15')]();};}function respondWithResult(_0x502f2a,_0x1edaac){_0x1edaac=_0x1edaac||0xc8;return function(_0x1d3902){if(_0x1d3902){return _0x502f2a['status'](_0x1edaac)['json'](_0x1d3902);}};}function respondWithFilteredResult(_0x3239bf,_0x2f0a16){return function(_0x2c0c32){if(_0x2c0c32){var _0x57f589=typeof _0x2f0a16[_0x1f89('0x16')]===_0x1f89('0x17')&&typeof _0x2f0a16[_0x1f89('0x18')]==='undefined';var _0x20c552=_0x2c0c32[_0x1f89('0x19')];var _0x18a593=_0x57f589?0x0:_0x2f0a16[_0x1f89('0x16')];var _0x59e6c4=_0x57f589?_0x2c0c32[_0x1f89('0x19')]:_0x2f0a16[_0x1f89('0x16')]+_0x2f0a16[_0x1f89('0x18')];var _0x4d1a61;if(_0x59e6c4>=_0x20c552){_0x59e6c4=_0x20c552;_0x4d1a61=0xc8;}else{_0x4d1a61=0xce;}_0x3239bf[_0x1f89('0x1a')](_0x4d1a61);return _0x3239bf['set'](_0x1f89('0x1b'),_0x18a593+'-'+_0x59e6c4+'/'+_0x20c552)[_0x1f89('0x1c')](_0x2c0c32);}return null;};}function patchUpdates(_0x3318fb){return function(_0x107262){try{jsonpatch[_0x1f89('0x1d')](_0x107262,_0x3318fb,!![]);}catch(_0x58795d){return BPromise[_0x1f89('0x1e')](_0x58795d);}return _0x107262[_0x1f89('0x1f')]();};}function saveUpdates(_0x46054f,_0x49b92e){return function(_0x48cf5c){if(_0x48cf5c){return _0x48cf5c[_0x1f89('0x20')](_0x46054f)[_0x1f89('0x21')](function(_0x55c582){return _0x55c582;});}return null;};}function removeEntity(_0x48170b,_0x88d3b0){return function(_0x4c91d0){if(_0x4c91d0){return _0x4c91d0[_0x1f89('0x22')]()[_0x1f89('0x21')](function(){_0x48170b[_0x1f89('0x1a')](0xcc)[_0x1f89('0x15')]();});}};}function handleEntityNotFound(_0x3d6a48,_0x32289f){return function(_0x153fe4){if(!_0x153fe4){_0x3d6a48[_0x1f89('0x14')](0x194);}return _0x153fe4;};}function handleError(_0x1a0c09,_0x177999){_0x177999=_0x177999||0x1f4;return function(_0x285442){logger[_0x1f89('0x23')](_0x285442[_0x1f89('0x24')]);if(_0x285442['name']){delete _0x285442[_0x1f89('0x25')];}_0x1a0c09[_0x1f89('0x1a')](_0x177999)[_0x1f89('0x26')](_0x285442);};}exports['index']=function(_0x5ae774,_0x48ab91){var _0x559bab={},_0x3e4157={},_0x203bf2={'count':0x0,'rows':[]};var _0x574026=_['map'](db[_0x1f89('0x27')]['rawAttributes'],function(_0x14e845){return{'name':_0x14e845['fieldName'],'type':_0x14e845[_0x1f89('0x28')][_0x1f89('0x29')]};});_0x3e4157[_0x1f89('0x2a')]=_[_0x1f89('0x2b')](_0x574026,_0x1f89('0x25'));_0x3e4157['query']=_['keys'](_0x5ae774[_0x1f89('0x2c')]);_0x3e4157[_0x1f89('0x2d')]=_[_0x1f89('0x2e')](_0x3e4157[_0x1f89('0x2a')],_0x3e4157[_0x1f89('0x2c')]);_0x559bab[_0x1f89('0x2f')]=_[_0x1f89('0x2e')](_0x3e4157['model'],qs[_0x1f89('0x30')](_0x5ae774[_0x1f89('0x2c')][_0x1f89('0x30')]));_0x559bab[_0x1f89('0x2f')]=_0x559bab[_0x1f89('0x2f')][_0x1f89('0x31')]?_0x559bab['attributes']:_0x3e4157[_0x1f89('0x2a')];if(!_0x5ae774[_0x1f89('0x2c')][_0x1f89('0x32')](_0x1f89('0x33'))){_0x559bab[_0x1f89('0x18')]=qs[_0x1f89('0x18')](_0x5ae774[_0x1f89('0x2c')][_0x1f89('0x18')]);_0x559bab[_0x1f89('0x16')]=qs[_0x1f89('0x16')](_0x5ae774['query']['offset']);}_0x559bab[_0x1f89('0x34')]=qs[_0x1f89('0x35')](_0x5ae774[_0x1f89('0x2c')]['sort']);_0x559bab[_0x1f89('0x36')]=qs['filters'](_['pick'](_0x5ae774[_0x1f89('0x2c')],_0x3e4157['filters']),_0x574026);if(_0x5ae774[_0x1f89('0x2c')][_0x1f89('0x37')]){_0x559bab['where']=_[_0x1f89('0x38')](_0x559bab[_0x1f89('0x36')],{'$or':_[_0x1f89('0x2b')](_0x574026,function(_0x9995ba){if(_0x9995ba['type']!==_0x1f89('0x39')){var _0x3c14ee={};_0x3c14ee[_0x9995ba[_0x1f89('0x25')]]={'$like':'%'+_0x5ae774['query']['filter']+'%'};return _0x3c14ee;}})});}_0x559bab=_[_0x1f89('0x38')]({},_0x559bab,_0x5ae774[_0x1f89('0x3a')]);var _0x5609db={'where':_0x559bab[_0x1f89('0x36')]};return db[_0x1f89('0x27')][_0x1f89('0x19')](_0x5609db)[_0x1f89('0x21')](function(_0x2a002d){_0x203bf2['count']=_0x2a002d;if(_0x5ae774[_0x1f89('0x2c')][_0x1f89('0x3b')]){_0x559bab[_0x1f89('0x3c')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x1f89('0x3d')](_0x559bab);})[_0x1f89('0x21')](function(_0x4a667d){_0x203bf2[_0x1f89('0x3e')]=_0x4a667d;return _0x203bf2;})[_0x1f89('0x21')](respondWithFilteredResult(_0x48ab91,_0x559bab))[_0x1f89('0x3f')](handleError(_0x48ab91,null));};exports[_0x1f89('0x40')]=function(_0x3eea21,_0x1da710){var _0x3a7136={'raw':![],'where':{'id':_0x3eea21[_0x1f89('0x41')]['id']}},_0x37d5c6={};_0x37d5c6['model']=_[_0x1f89('0x42')](db['ZendeskConfiguration'][_0x1f89('0x43')]);_0x37d5c6[_0x1f89('0x2c')]=_[_0x1f89('0x42')](_0x3eea21[_0x1f89('0x2c')]);_0x37d5c6['filters']=_[_0x1f89('0x2e')](_0x37d5c6[_0x1f89('0x2a')],_0x37d5c6[_0x1f89('0x2c')]);_0x3a7136[_0x1f89('0x2f')]=_[_0x1f89('0x2e')](_0x37d5c6[_0x1f89('0x2a')],qs[_0x1f89('0x30')](_0x3eea21[_0x1f89('0x2c')][_0x1f89('0x30')]));_0x3a7136[_0x1f89('0x2f')]=_0x3a7136[_0x1f89('0x2f')][_0x1f89('0x31')]?_0x3a7136[_0x1f89('0x2f')]:_0x37d5c6[_0x1f89('0x2a')];if(_0x3eea21[_0x1f89('0x2c')][_0x1f89('0x3b')]){_0x3a7136['include']=[{'all':!![]}];}_0x3a7136=_[_0x1f89('0x38')]({},_0x3a7136,_0x3eea21[_0x1f89('0x3a')]);return db[_0x1f89('0x27')]['find'](_0x3a7136)[_0x1f89('0x21')](handleEntityNotFound(_0x1da710,null))[_0x1f89('0x21')](respondWithResult(_0x1da710,null))[_0x1f89('0x3f')](handleError(_0x1da710,null));};exports[_0x1f89('0x44')]=function(_0x22ab18,_0x3e1d2a){return db['ZendeskConfiguration'][_0x1f89('0x44')](_0x22ab18[_0x1f89('0x45')],{})[_0x1f89('0x21')](respondWithResult(_0x3e1d2a,0xc9))[_0x1f89('0x3f')](handleError(_0x3e1d2a,null));};exports[_0x1f89('0x20')]=function(_0x588e3e,_0x33f2d0){if(_0x588e3e[_0x1f89('0x45')]['id']){delete _0x588e3e[_0x1f89('0x45')]['id'];}return db[_0x1f89('0x27')][_0x1f89('0x46')]({'where':{'id':_0x588e3e[_0x1f89('0x41')]['id']}})[_0x1f89('0x21')](handleEntityNotFound(_0x33f2d0,null))[_0x1f89('0x21')](saveUpdates(_0x588e3e[_0x1f89('0x45')],null))[_0x1f89('0x21')](respondWithResult(_0x33f2d0,null))[_0x1f89('0x3f')](handleError(_0x33f2d0,null));};exports[_0x1f89('0x22')]=function(_0x1a7a5c,_0x55ca19){return db['ZendeskConfiguration'][_0x1f89('0x46')]({'where':{'id':_0x1a7a5c['params']['id']}})['then'](handleEntityNotFound(_0x55ca19,null))['then'](removeEntity(_0x55ca19,null))[_0x1f89('0x3f')](handleError(_0x55ca19,null));};exports[_0x1f89('0x47')]=function(_0x21cdd8,_0x4007c8,_0x432904){var _0x4909ec={};var _0x5f129f={};var _0x22c308;var _0x23b927;return db[_0x1f89('0x27')][_0x1f89('0x48')]({'where':{'id':_0x21cdd8['params']['id']}})[_0x1f89('0x21')](handleEntityNotFound(_0x4007c8,null))[_0x1f89('0x21')](function(_0x5a8441){if(_0x5a8441){_0x22c308=_0x5a8441;_0x5f129f[_0x1f89('0x2a')]=_[_0x1f89('0x42')](db[_0x1f89('0x49')][_0x1f89('0x43')]);_0x5f129f[_0x1f89('0x2c')]=_['keys'](_0x21cdd8['query']);_0x5f129f[_0x1f89('0x2d')]=_[_0x1f89('0x2e')](_0x5f129f[_0x1f89('0x2a')],_0x5f129f[_0x1f89('0x2c')]);_0x4909ec[_0x1f89('0x2f')]=_[_0x1f89('0x2e')](_0x5f129f[_0x1f89('0x2a')],qs[_0x1f89('0x30')](_0x21cdd8[_0x1f89('0x2c')]['fields']));_0x4909ec[_0x1f89('0x2f')]=_0x4909ec['attributes'][_0x1f89('0x31')]?_0x4909ec[_0x1f89('0x2f')]:_0x5f129f[_0x1f89('0x2a')];_0x4909ec[_0x1f89('0x34')]=qs['sort'](_0x21cdd8[_0x1f89('0x2c')][_0x1f89('0x35')]);_0x4909ec[_0x1f89('0x36')]=qs[_0x1f89('0x2d')](_[_0x1f89('0x4a')](_0x21cdd8['query'],_0x5f129f['filters']));if(_0x21cdd8['query'][_0x1f89('0x37')]){_0x4909ec[_0x1f89('0x36')]=_['merge'](_0x4909ec['where'],{'$or':_[_0x1f89('0x2b')](_0x4909ec[_0x1f89('0x2f')],function(_0x5aaf32){var _0x319280={};_0x319280[_0x5aaf32]={'$like':'%'+_0x21cdd8['query'][_0x1f89('0x37')]+'%'};return _0x319280;})});}_0x4909ec=_[_0x1f89('0x38')]({},_0x4909ec,_0x21cdd8[_0x1f89('0x3a')]);return _0x22c308['getFields'](_0x4909ec);}})[_0x1f89('0x21')](function(_0x19ab89){if(_0x19ab89){_0x23b927=_0x19ab89[_0x1f89('0x31')];if(!_0x21cdd8[_0x1f89('0x2c')][_0x1f89('0x32')](_0x1f89('0x33'))){_0x4909ec[_0x1f89('0x18')]=qs[_0x1f89('0x18')](_0x21cdd8[_0x1f89('0x2c')][_0x1f89('0x18')]);_0x4909ec[_0x1f89('0x16')]=qs['offset'](_0x21cdd8['query'][_0x1f89('0x16')]);}return _0x22c308['getFields'](_0x4909ec);}})['then'](function(_0x373fd4){if(_0x373fd4){return _0x373fd4?{'count':_0x23b927,'rows':_0x373fd4}:null;}})[_0x1f89('0x21')](respondWithResult(_0x4007c8,null))['catch'](handleError(_0x4007c8,null));};exports[_0x1f89('0x4b')]=function(_0x34960c,_0x2f7384,_0x2e3ea5){var _0x42afc1={};var _0x419e24={};var _0x1e8437;var _0x540550;return db[_0x1f89('0x27')]['findOne']({'where':{'id':_0x34960c['params']['id']}})[_0x1f89('0x21')](handleEntityNotFound(_0x2f7384,null))[_0x1f89('0x21')](function(_0x43a14e){if(_0x43a14e){_0x1e8437=_0x43a14e;_0x419e24[_0x1f89('0x2a')]=_['keys'](db[_0x1f89('0x49')][_0x1f89('0x43')]);_0x419e24[_0x1f89('0x2c')]=_[_0x1f89('0x42')](_0x34960c[_0x1f89('0x2c')]);_0x419e24[_0x1f89('0x2d')]=_['intersection'](_0x419e24[_0x1f89('0x2a')],_0x419e24[_0x1f89('0x2c')]);_0x42afc1['attributes']=_[_0x1f89('0x2e')](_0x419e24['model'],qs[_0x1f89('0x30')](_0x34960c['query'][_0x1f89('0x30')]));_0x42afc1[_0x1f89('0x2f')]=_0x42afc1[_0x1f89('0x2f')][_0x1f89('0x31')]?_0x42afc1[_0x1f89('0x2f')]:_0x419e24[_0x1f89('0x2a')];_0x42afc1[_0x1f89('0x34')]=qs[_0x1f89('0x35')](_0x34960c[_0x1f89('0x2c')][_0x1f89('0x35')]);_0x42afc1[_0x1f89('0x36')]=qs[_0x1f89('0x2d')](_[_0x1f89('0x4a')](_0x34960c[_0x1f89('0x2c')],_0x419e24['filters']));if(_0x34960c[_0x1f89('0x2c')]['filter']){_0x42afc1[_0x1f89('0x36')]=_['merge'](_0x42afc1[_0x1f89('0x36')],{'$or':_[_0x1f89('0x2b')](_0x42afc1[_0x1f89('0x2f')],function(_0x5df021){var _0x5f1923={};_0x5f1923[_0x5df021]={'$like':'%'+_0x34960c[_0x1f89('0x2c')][_0x1f89('0x37')]+'%'};return _0x5f1923;})});}_0x42afc1=_[_0x1f89('0x38')]({},_0x42afc1,_0x34960c[_0x1f89('0x3a')]);return _0x1e8437[_0x1f89('0x4b')](_0x42afc1);}})[_0x1f89('0x21')](function(_0x2cc9d2){if(_0x2cc9d2){_0x540550=_0x2cc9d2['length'];if(!_0x34960c[_0x1f89('0x2c')]['hasOwnProperty'](_0x1f89('0x33'))){_0x42afc1[_0x1f89('0x18')]=qs[_0x1f89('0x18')](_0x34960c[_0x1f89('0x2c')][_0x1f89('0x18')]);_0x42afc1['offset']=qs[_0x1f89('0x16')](_0x34960c[_0x1f89('0x2c')][_0x1f89('0x16')]);}return _0x1e8437[_0x1f89('0x4b')](_0x42afc1);}})['then'](function(_0x15c5ec){if(_0x15c5ec){return _0x15c5ec?{'count':_0x540550,'rows':_0x15c5ec}:null;}})[_0x1f89('0x21')](respondWithResult(_0x2f7384,null))[_0x1f89('0x3f')](handleError(_0x2f7384,null));};exports[_0x1f89('0x4c')]=function(_0x5b5e59,_0x39d073,_0x9a6690){var _0x1fb37f={};var _0x4da3db={};var _0x42f33e;var _0x26732c;return db[_0x1f89('0x27')][_0x1f89('0x48')]({'where':{'id':_0x5b5e59[_0x1f89('0x41')]['id']}})[_0x1f89('0x21')](handleEntityNotFound(_0x39d073,null))[_0x1f89('0x21')](function(_0x3206ee){if(_0x3206ee){_0x42f33e=_0x3206ee;_0x4da3db[_0x1f89('0x2a')]=_[_0x1f89('0x42')](db['ZendeskField']['rawAttributes']);_0x4da3db[_0x1f89('0x2c')]=_[_0x1f89('0x42')](_0x5b5e59[_0x1f89('0x2c')]);_0x4da3db[_0x1f89('0x2d')]=_[_0x1f89('0x2e')](_0x4da3db[_0x1f89('0x2a')],_0x4da3db[_0x1f89('0x2c')]);_0x1fb37f[_0x1f89('0x2f')]=_[_0x1f89('0x2e')](_0x4da3db[_0x1f89('0x2a')],qs[_0x1f89('0x30')](_0x5b5e59[_0x1f89('0x2c')]['fields']));_0x1fb37f[_0x1f89('0x2f')]=_0x1fb37f['attributes'][_0x1f89('0x31')]?_0x1fb37f[_0x1f89('0x2f')]:_0x4da3db[_0x1f89('0x2a')];_0x1fb37f[_0x1f89('0x34')]=qs[_0x1f89('0x35')](_0x5b5e59[_0x1f89('0x2c')][_0x1f89('0x35')]);_0x1fb37f['where']=qs[_0x1f89('0x2d')](_[_0x1f89('0x4a')](_0x5b5e59[_0x1f89('0x2c')],_0x4da3db[_0x1f89('0x2d')]));if(_0x5b5e59[_0x1f89('0x2c')]['filter']){_0x1fb37f[_0x1f89('0x36')]=_['merge'](_0x1fb37f[_0x1f89('0x36')],{'$or':_[_0x1f89('0x2b')](_0x1fb37f['attributes'],function(_0x5a734f){var _0x1f2d39={};_0x1f2d39[_0x5a734f]={'$like':'%'+_0x5b5e59[_0x1f89('0x2c')][_0x1f89('0x37')]+'%'};return _0x1f2d39;})});}_0x1fb37f=_['merge']({},_0x1fb37f,_0x5b5e59[_0x1f89('0x3a')]);return _0x42f33e[_0x1f89('0x4c')](_0x1fb37f);}})[_0x1f89('0x21')](function(_0x2fc6aa){if(_0x2fc6aa){_0x26732c=_0x2fc6aa[_0x1f89('0x31')];if(!_0x5b5e59['query'][_0x1f89('0x32')](_0x1f89('0x33'))){_0x1fb37f['limit']=qs[_0x1f89('0x18')](_0x5b5e59[_0x1f89('0x2c')]['limit']);_0x1fb37f[_0x1f89('0x16')]=qs[_0x1f89('0x16')](_0x5b5e59[_0x1f89('0x2c')][_0x1f89('0x16')]);}return _0x42f33e[_0x1f89('0x4c')](_0x1fb37f);}})[_0x1f89('0x21')](function(_0x298ba3){if(_0x298ba3){return _0x298ba3?{'count':_0x26732c,'rows':_0x298ba3}:null;}})['then'](respondWithResult(_0x39d073,null))['catch'](handleError(_0x39d073,null));};exports[_0x1f89('0x4d')]=function(_0x3df5a1,_0x47dc0e,_0x21af69){var _0x50922b={};var _0x8ba2f1={};var _0xbd01c;var _0x5c986a;return db[_0x1f89('0x27')][_0x1f89('0x48')]({'where':{'id':_0x3df5a1[_0x1f89('0x41')]['id']}})['then'](handleEntityNotFound(_0x47dc0e,null))[_0x1f89('0x21')](function(_0x44cfb7){if(_0x44cfb7){_0xbd01c=_0x44cfb7;_0x8ba2f1['model']=_[_0x1f89('0x42')](db[_0x1f89('0x4e')][_0x1f89('0x43')]);_0x8ba2f1[_0x1f89('0x2c')]=_[_0x1f89('0x42')](_0x3df5a1['query']);_0x8ba2f1['filters']=_['intersection'](_0x8ba2f1['model'],_0x8ba2f1[_0x1f89('0x2c')]);_0x50922b[_0x1f89('0x2f')]=_[_0x1f89('0x2e')](_0x8ba2f1[_0x1f89('0x2a')],qs[_0x1f89('0x30')](_0x3df5a1[_0x1f89('0x2c')][_0x1f89('0x30')]));_0x50922b[_0x1f89('0x2f')]=_0x50922b[_0x1f89('0x2f')]['length']?_0x50922b[_0x1f89('0x2f')]:_0x8ba2f1['model'];_0x50922b[_0x1f89('0x34')]=qs['sort'](_0x3df5a1[_0x1f89('0x2c')]['sort']);_0x50922b[_0x1f89('0x36')]=qs[_0x1f89('0x2d')](_[_0x1f89('0x4a')](_0x3df5a1[_0x1f89('0x2c')],_0x8ba2f1[_0x1f89('0x2d')]));if(_0x3df5a1[_0x1f89('0x2c')][_0x1f89('0x37')]){_0x50922b[_0x1f89('0x36')]=_[_0x1f89('0x38')](_0x50922b[_0x1f89('0x36')],{'$or':_[_0x1f89('0x2b')](_0x50922b['attributes'],function(_0x5870ff){var _0x5ba42d={};_0x5ba42d[_0x5870ff]={'$like':'%'+_0x3df5a1[_0x1f89('0x2c')][_0x1f89('0x37')]+'%'};return _0x5ba42d;})});}_0x50922b=_[_0x1f89('0x38')]({},_0x50922b,_0x3df5a1[_0x1f89('0x3a')]);return _0xbd01c['getTags'](_0x50922b);}})['then'](function(_0x8578b5){if(_0x8578b5){_0x5c986a=_0x8578b5[_0x1f89('0x31')];if(!_0x3df5a1[_0x1f89('0x2c')][_0x1f89('0x32')](_0x1f89('0x33'))){_0x50922b[_0x1f89('0x18')]=qs['limit'](_0x3df5a1[_0x1f89('0x2c')][_0x1f89('0x18')]);_0x50922b[_0x1f89('0x16')]=qs[_0x1f89('0x16')](_0x3df5a1[_0x1f89('0x2c')][_0x1f89('0x16')]);}return _0xbd01c[_0x1f89('0x4d')](_0x50922b);}})[_0x1f89('0x21')](function(_0x42ace0){if(_0x42ace0){return _0x42ace0?{'count':_0x5c986a,'rows':_0x42ace0}:null;}})[_0x1f89('0x21')](respondWithResult(_0x47dc0e,null))['catch'](handleError(_0x47dc0e,null));};exports['setTags']=function(_0x2b4bd0,_0x487a3a,_0x2840bc){if(_0x2b4bd0[_0x1f89('0x45')]['id']){delete _0x2b4bd0[_0x1f89('0x45')]['id'];}return db[_0x1f89('0x27')]['findOne']({'where':{'id':_0x2b4bd0[_0x1f89('0x41')]['id']}})[_0x1f89('0x21')](handleEntityNotFound(_0x487a3a,null))['then'](function(_0x155727){if(_0x155727){return _0x155727[_0x1f89('0x4f')](_0x2b4bd0['body'][_0x1f89('0x50')]||[]);}return null;})['then'](respondWithResult(_0x487a3a,null))[_0x1f89('0x3f')](handleError(_0x487a3a,null));};
\ No newline at end of file
index 9460363..f8c620d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30a=['path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var logger=require(_0xaa30('0x2'))('api');var moment=require(_0xaa30('0x3'));var BPromise=require(_0xaa30('0x4'));var rp=require(_0xaa30('0x5'));var fs=require('fs');var path=require(_0xaa30('0x6'));var rimraf=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var attributes=require(_0xaa30('0x9'));module['exports']=function(_0x347cd5,_0x4efe89){return _0x347cd5[_0xaa30('0xa')](_0xaa30('0xb'),attributes,{'tableName':_0xaa30('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae60=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x5045e5,_0x5ccec2){var _0x58cf65=function(_0x5f0b95){while(--_0x5f0b95){_0x5045e5['push'](_0x5045e5['shift']());}};_0x58cf65(++_0x5ccec2);}(_0xae60,0x1c7));var _0x0ae6=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xae60[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var logger=require(_0x0ae6('0x2'))('api');var moment=require(_0x0ae6('0x3'));var BPromise=require(_0x0ae6('0x4'));var rp=require(_0x0ae6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x0ae6('0x8')]=function(_0x25ac7c,_0x30e000){return _0x25ac7c[_0x0ae6('0x9')](_0x0ae6('0xa'),attributes,{'tableName':_0x0ae6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ff480e2..99ec2af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb331=['http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x580e93,_0x29748d){var _0x3303f0=function(_0x237cf7){while(--_0x237cf7){_0x580e93['push'](_0x580e93['shift']());}};_0x3303f0(++_0x29748d);}(_0xb331,0xbb));var _0x1b33=function(_0x48eea1,_0x2e1c2a){_0x48eea1=_0x48eea1-0x0;var _0x1e0373=_0xb331[_0x48eea1];return _0x1e0373;};'use strict';var _=require(_0x1b33('0x0'));var util=require(_0x1b33('0x1'));var moment=require(_0x1b33('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b33('0x3'));var fs=require('fs');var Redis=require(_0x1b33('0x4'));var db=require(_0x1b33('0x5'))['db'];var utils=require(_0x1b33('0x6'));var logger=require('../../config/logger')(_0x1b33('0x7'));var config=require(_0x1b33('0x8'));var jayson=require(_0x1b33('0x9'));var client=jayson[_0x1b33('0xa')][_0x1b33('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x258173,_0x11274b,_0x5c46fa){return new BPromise(function(_0x453c1f,_0x4c72c0){return client[_0x1b33('0xc')](_0x258173,_0x5c46fa)[_0x1b33('0xd')](function(_0x57d4d7){logger[_0x1b33('0xe')](_0x1b33('0xf'),_0x11274b,_0x1b33('0x10'));logger[_0x1b33('0x11')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x11274b,_0x1b33('0x10'),JSON[_0x1b33('0x12')](_0x57d4d7));if(_0x57d4d7[_0x1b33('0x13')]){if(_0x57d4d7['error']['code']===0x1f4){logger[_0x1b33('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x11274b,_0x57d4d7[_0x1b33('0x13')][_0x1b33('0x14')]);return _0x4c72c0(_0x57d4d7[_0x1b33('0x13')]['message']);}logger[_0x1b33('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x11274b,_0x57d4d7[_0x1b33('0x13')][_0x1b33('0x14')]);return _0x453c1f(_0x57d4d7[_0x1b33('0x13')][_0x1b33('0x14')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x11274b,_0x1b33('0x10'));_0x453c1f(_0x57d4d7['result'][_0x1b33('0x14')]);}})[_0x1b33('0x15')](function(_0x1b858b){logger[_0x1b33('0x13')](_0x1b33('0xf'),_0x11274b,_0x1b858b);_0x4c72c0(_0x1b858b);});});}
\ No newline at end of file
+var _0x6d8d=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x320800,_0x1ddb58){var _0x1cbdf3=function(_0x49a114){while(--_0x49a114){_0x320800['push'](_0x320800['shift']());}};_0x1cbdf3(++_0x1ddb58);}(_0x6d8d,0xf8));var _0xd6d8=function(_0x333a33,_0x393768){_0x333a33=_0x333a33-0x0;var _0x401940=_0x6d8d[_0x333a33];return _0x401940;};'use strict';var _=require(_0xd6d8('0x0'));var util=require(_0xd6d8('0x1'));var moment=require(_0xd6d8('0x2'));var BPromise=require('bluebird');var rs=require(_0xd6d8('0x3'));var fs=require('fs');var Redis=require(_0xd6d8('0x4'));var db=require(_0xd6d8('0x5'))['db'];var utils=require(_0xd6d8('0x6'));var logger=require('../../config/logger')(_0xd6d8('0x7'));var config=require(_0xd6d8('0x8'));var jayson=require(_0xd6d8('0x9'));var client=jayson['client'][_0xd6d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fcb94,_0x23bb1c,_0x21ab9e){return new BPromise(function(_0x5d8b5a,_0x21e533){return client[_0xd6d8('0xb')](_0x1fcb94,_0x21ab9e)[_0xd6d8('0xc')](function(_0x3b35e0){logger[_0xd6d8('0xd')](_0xd6d8('0xe'),_0x23bb1c,'request\x20sent');logger[_0xd6d8('0xf')](_0xd6d8('0x10'),_0x23bb1c,_0xd6d8('0x11'),JSON[_0xd6d8('0x12')](_0x3b35e0));if(_0x3b35e0[_0xd6d8('0x13')]){if(_0x3b35e0[_0xd6d8('0x13')][_0xd6d8('0x14')]===0x1f4){logger[_0xd6d8('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x23bb1c,_0x3b35e0[_0xd6d8('0x13')]['message']);return _0x21e533(_0x3b35e0[_0xd6d8('0x13')][_0xd6d8('0x15')]);}logger[_0xd6d8('0x13')](_0xd6d8('0xe'),_0x23bb1c,_0x3b35e0['error'][_0xd6d8('0x15')]);return _0x5d8b5a(_0x3b35e0[_0xd6d8('0x13')][_0xd6d8('0x15')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x23bb1c,_0xd6d8('0x11'));_0x5d8b5a(_0x3b35e0[_0xd6d8('0x16')][_0xd6d8('0x15')]);}})['catch'](function(_0x3bdd1f){logger[_0xd6d8('0x13')](_0xd6d8('0xe'),_0x23bb1c,_0x3bdd1f);_0x21e533(_0x3bdd1f);});});}
\ No newline at end of file
index 8a42522..05e9e15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec35=['fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update','exports','multer','path','express','Router'];(function(_0x36860e,_0x5a6a0c){var _0x2663fc=function(_0x42baf8){while(--_0x42baf8){_0x36860e['push'](_0x36860e['shift']());}};_0x2663fc(++_0x5a6a0c);}(_0xec35,0x10c));var _0x5ec3=function(_0x31f355,_0x36960e){_0x31f355=_0x31f355-0x0;var _0x4d3531=_0xec35[_0x31f355];return _0x4d3531;};'use strict';var multer=require(_0x5ec3('0x0'));var util=require('util');var path=require(_0x5ec3('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ec3('0x2'));var router=express[_0x5ec3('0x3')]();var fs_extra=require(_0x5ec3('0x4'));var auth=require(_0x5ec3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5ec3('0x6'));var controller=require(_0x5ec3('0x7'));router[_0x5ec3('0x8')]('/',auth[_0x5ec3('0x9')](),controller[_0x5ec3('0xa')]);router[_0x5ec3('0x8')](_0x5ec3('0xb'),auth[_0x5ec3('0x9')](),controller['show']);router[_0x5ec3('0xc')]('/',auth[_0x5ec3('0x9')](),controller[_0x5ec3('0xd')]);router[_0x5ec3('0xe')](_0x5ec3('0xb'),auth[_0x5ec3('0x9')](),controller[_0x5ec3('0xf')]);router['delete'](_0x5ec3('0xb'),auth[_0x5ec3('0x9')](),controller['destroy']);module[_0x5ec3('0x10')]=router;
\ No newline at end of file
+var _0x09cb=['../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x24817f,_0x2a1aae){var _0x56bf59=function(_0x26321a){while(--_0x26321a){_0x24817f['push'](_0x24817f['shift']());}};_0x56bf59(++_0x2a1aae);}(_0x09cb,0x129));var _0xb09c=function(_0x558cf9,_0xec1847){_0x558cf9=_0x558cf9-0x0;var _0x222e0a=_0x09cb[_0x558cf9];return _0x222e0a;};'use strict';var multer=require(_0xb09c('0x0'));var util=require(_0xb09c('0x1'));var path=require(_0xb09c('0x2'));var timeout=require('connect-timeout');var express=require(_0xb09c('0x3'));var router=express[_0xb09c('0x4')]();var fs_extra=require(_0xb09c('0x5'));var auth=require(_0xb09c('0x6'));var interaction=require(_0xb09c('0x7'));var config=require('../../config/environment');var controller=require(_0xb09c('0x8'));router[_0xb09c('0x9')]('/',auth[_0xb09c('0xa')](),controller[_0xb09c('0xb')]);router[_0xb09c('0x9')](_0xb09c('0xc'),auth[_0xb09c('0xa')](),controller['show']);router[_0xb09c('0xd')]('/',auth[_0xb09c('0xa')](),controller[_0xb09c('0xe')]);router[_0xb09c('0xf')](_0xb09c('0xc'),auth['isAuthenticated'](),controller[_0xb09c('0x10')]);router['delete'](_0xb09c('0xc'),auth[_0xb09c('0xa')](),controller[_0xb09c('0x11')]);module[_0xb09c('0x12')]=router;
\ No newline at end of file
index b0a488e..337b5fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35be=['STRING','ENUM','variable','BOOLEAN','sequelize','exports','customVariable','keyValue','picklist','string'];(function(_0x1bb6c3,_0x778fa5){var _0x50801b=function(_0x5ac0d1){while(--_0x5ac0d1){_0x1bb6c3['push'](_0x1bb6c3['shift']());}};_0x50801b(++_0x778fa5);}(_0x35be,0x1d0));var _0xe35b=function(_0x8b635c,_0x5c53b1){_0x8b635c=_0x8b635c-0x0;var _0x47f539=_0x35be[_0x8b635c];return _0x47f539;};'use strict';var Sequelize=require(_0xe35b('0x0'));module[_0xe35b('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xe35b('0x2'),_0xe35b('0x3'),_0xe35b('0x4')),'defaultValue':_0xe35b('0x5')},'content':{'type':Sequelize[_0xe35b('0x6')]},'key':{'type':Sequelize[_0xe35b('0x6')]},'keyType':{'type':Sequelize[_0xe35b('0x7')](_0xe35b('0x5'),_0xe35b('0x8'),_0xe35b('0x2'))},'keyContent':{'type':Sequelize[_0xe35b('0x6')]},'idField':{'type':Sequelize[_0xe35b('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe35b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe35b('0x6')]}};
\ No newline at end of file
+var _0x026c=['STRING','ENUM','variable','exports','string','customVariable','keyValue','picklist'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x026c,0xc3));var _0xc026=function(_0x208961,_0x5e6cf6){_0x208961=_0x208961-0x0;var _0x4236f5=_0x026c[_0x208961];return _0x4236f5;};'use strict';var Sequelize=require('sequelize');module[_0xc026('0x0')]={'type':{'type':Sequelize['ENUM'](_0xc026('0x1'),'variable',_0xc026('0x2'),_0xc026('0x3'),_0xc026('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc026('0x5')]},'key':{'type':Sequelize[_0xc026('0x5')]},'keyType':{'type':Sequelize[_0xc026('0x6')](_0xc026('0x1'),_0xc026('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xc026('0x5')]},'idField':{'type':Sequelize[_0xc026('0x5')]},'nameField':{'type':Sequelize[_0xc026('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc026('0x5')]}};
\ No newline at end of file
index 529ca65..8a09956 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc0f=['where','pick','filter','merge','map','options','ZendeskField','includeAll','include','findAll','rows','catch','intersection','length','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x4b281a,_0x1733de){var _0x3149a7=function(_0x3a6b40){while(--_0x3a6b40){_0x4b281a['push'](_0x4b281a['shift']());}};_0x3149a7(++_0x1733de);}(_0xbc0f,0x175));var _0xfbc0=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xbc0f[_0x5a3cf0];return _0x5a64ee;};'use strict';var emlformat=require(_0xfbc0('0x0'));var rimraf=require(_0xfbc0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfbc0('0x2'));var rp=require(_0xfbc0('0x3'));var moment=require(_0xfbc0('0x4'));var BPromise=require(_0xfbc0('0x5'));var Mustache=require(_0xfbc0('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfbc0('0x7'));var ejs=require(_0xfbc0('0x8'));var fs=require('fs');var fs_extra=require(_0xfbc0('0x9'));var _=require(_0xfbc0('0xa'));var squel=require('squel');var crypto=require(_0xfbc0('0xb'));var jsforce=require(_0xfbc0('0xc'));var deskjs=require(_0xfbc0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfbc0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfbc0('0xf'));var as=require(_0xfbc0('0x10'));var hardwareService=require(_0xfbc0('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xfbc0('0x12'));var config=require(_0xfbc0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfbc0('0x14'))['db'];function respondWithStatusCode(_0x4ce27c,_0x23a94e){_0x23a94e=_0x23a94e||0xcc;return function(_0x1e9f84){if(_0x1e9f84){return _0x4ce27c[_0xfbc0('0x15')](_0x23a94e);}return _0x4ce27c[_0xfbc0('0x16')](_0x23a94e)[_0xfbc0('0x17')]();};}function respondWithResult(_0x25802b,_0x557b00){_0x557b00=_0x557b00||0xc8;return function(_0x4fe7a9){if(_0x4fe7a9){return _0x25802b['status'](_0x557b00)['json'](_0x4fe7a9);}};}function respondWithFilteredResult(_0x19bfc3,_0x372008){return function(_0x2bf5c3){if(_0x2bf5c3){var _0x523ba2=typeof _0x372008[_0xfbc0('0x18')]===_0xfbc0('0x19')&&typeof _0x372008[_0xfbc0('0x1a')]===_0xfbc0('0x19');var _0x267d37=_0x2bf5c3[_0xfbc0('0x1b')];var _0x22fb2d=_0x523ba2?0x0:_0x372008[_0xfbc0('0x18')];var _0x463e2a=_0x523ba2?_0x2bf5c3[_0xfbc0('0x1b')]:_0x372008[_0xfbc0('0x18')]+_0x372008[_0xfbc0('0x1a')];var _0x5b2920;if(_0x463e2a>=_0x267d37){_0x463e2a=_0x267d37;_0x5b2920=0xc8;}else{_0x5b2920=0xce;}_0x19bfc3[_0xfbc0('0x16')](_0x5b2920);return _0x19bfc3[_0xfbc0('0x1c')](_0xfbc0('0x1d'),_0x22fb2d+'-'+_0x463e2a+'/'+_0x267d37)[_0xfbc0('0x1e')](_0x2bf5c3);}return null;};}function patchUpdates(_0x4f1e4e){return function(_0xb4fe0b){try{jsonpatch[_0xfbc0('0x1f')](_0xb4fe0b,_0x4f1e4e,!![]);}catch(_0xf56d67){return BPromise[_0xfbc0('0x20')](_0xf56d67);}return _0xb4fe0b[_0xfbc0('0x21')]();};}function saveUpdates(_0x1a46fd,_0x432bce){return function(_0x2d4f29){if(_0x2d4f29){return _0x2d4f29[_0xfbc0('0x22')](_0x1a46fd)['then'](function(_0x3d6b39){return _0x3d6b39;});}return null;};}function removeEntity(_0x268056,_0x46da19){return function(_0x14cdad){if(_0x14cdad){return _0x14cdad[_0xfbc0('0x23')]()[_0xfbc0('0x24')](function(){_0x268056[_0xfbc0('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c5843,_0x29bbca){return function(_0x2e9f0a){if(!_0x2e9f0a){_0x2c5843['sendStatus'](0x194);}return _0x2e9f0a;};}function handleError(_0x647058,_0x2c1625){_0x2c1625=_0x2c1625||0x1f4;return function(_0x13f99e){logger[_0xfbc0('0x25')](_0x13f99e['stack']);if(_0x13f99e[_0xfbc0('0x26')]){delete _0x13f99e[_0xfbc0('0x26')];}_0x647058['status'](_0x2c1625)[_0xfbc0('0x27')](_0x13f99e);};}exports['index']=function(_0x2f8446,_0xcd2df2){var _0x179717={},_0xee6bf5={},_0xbd67d1={'count':0x0,'rows':[]};var _0x2efb45=_['map'](db['ZendeskField'][_0xfbc0('0x28')],function(_0x140d4a){return{'name':_0x140d4a[_0xfbc0('0x29')],'type':_0x140d4a[_0xfbc0('0x2a')]['key']};});_0xee6bf5[_0xfbc0('0x2b')]=_['map'](_0x2efb45,'name');_0xee6bf5[_0xfbc0('0x2c')]=_[_0xfbc0('0x2d')](_0x2f8446['query']);_0xee6bf5[_0xfbc0('0x2e')]=_['intersection'](_0xee6bf5[_0xfbc0('0x2b')],_0xee6bf5[_0xfbc0('0x2c')]);_0x179717[_0xfbc0('0x2f')]=_['intersection'](_0xee6bf5['model'],qs[_0xfbc0('0x30')](_0x2f8446[_0xfbc0('0x2c')][_0xfbc0('0x30')]));_0x179717[_0xfbc0('0x2f')]=_0x179717[_0xfbc0('0x2f')]['length']?_0x179717[_0xfbc0('0x2f')]:_0xee6bf5[_0xfbc0('0x2b')];if(!_0x2f8446['query'][_0xfbc0('0x31')](_0xfbc0('0x32'))){_0x179717['limit']=qs[_0xfbc0('0x1a')](_0x2f8446['query'][_0xfbc0('0x1a')]);_0x179717['offset']=qs[_0xfbc0('0x18')](_0x2f8446[_0xfbc0('0x2c')][_0xfbc0('0x18')]);}_0x179717[_0xfbc0('0x33')]=qs[_0xfbc0('0x34')](_0x2f8446[_0xfbc0('0x2c')][_0xfbc0('0x34')]);_0x179717[_0xfbc0('0x35')]=qs[_0xfbc0('0x2e')](_[_0xfbc0('0x36')](_0x2f8446[_0xfbc0('0x2c')],_0xee6bf5[_0xfbc0('0x2e')]),_0x2efb45);if(_0x2f8446[_0xfbc0('0x2c')][_0xfbc0('0x37')]){_0x179717[_0xfbc0('0x35')]=_[_0xfbc0('0x38')](_0x179717[_0xfbc0('0x35')],{'$or':_[_0xfbc0('0x39')](_0x2efb45,function(_0x20a382){if(_0x20a382['type']!=='VIRTUAL'){var _0x2bae22={};_0x2bae22[_0x20a382[_0xfbc0('0x26')]]={'$like':'%'+_0x2f8446[_0xfbc0('0x2c')]['filter']+'%'};return _0x2bae22;}})});}_0x179717=_[_0xfbc0('0x38')]({},_0x179717,_0x2f8446[_0xfbc0('0x3a')]);var _0x1faacd={'where':_0x179717[_0xfbc0('0x35')]};return db[_0xfbc0('0x3b')][_0xfbc0('0x1b')](_0x1faacd)[_0xfbc0('0x24')](function(_0x2a97d7){_0xbd67d1[_0xfbc0('0x1b')]=_0x2a97d7;if(_0x2f8446[_0xfbc0('0x2c')][_0xfbc0('0x3c')]){_0x179717[_0xfbc0('0x3d')]=[{'all':!![]}];}return db[_0xfbc0('0x3b')][_0xfbc0('0x3e')](_0x179717);})[_0xfbc0('0x24')](function(_0x1cc1d6){_0xbd67d1[_0xfbc0('0x3f')]=_0x1cc1d6;return _0xbd67d1;})[_0xfbc0('0x24')](respondWithFilteredResult(_0xcd2df2,_0x179717))[_0xfbc0('0x40')](handleError(_0xcd2df2,null));};exports['show']=function(_0x4da179,_0x263b97){var _0xeda136={'raw':!![],'where':{'id':_0x4da179['params']['id']}},_0x34c884={};_0x34c884['model']=_[_0xfbc0('0x2d')](db[_0xfbc0('0x3b')][_0xfbc0('0x28')]);_0x34c884[_0xfbc0('0x2c')]=_[_0xfbc0('0x2d')](_0x4da179['query']);_0x34c884['filters']=_[_0xfbc0('0x41')](_0x34c884[_0xfbc0('0x2b')],_0x34c884[_0xfbc0('0x2c')]);_0xeda136[_0xfbc0('0x2f')]=_[_0xfbc0('0x41')](_0x34c884['model'],qs[_0xfbc0('0x30')](_0x4da179[_0xfbc0('0x2c')][_0xfbc0('0x30')]));_0xeda136['attributes']=_0xeda136[_0xfbc0('0x2f')][_0xfbc0('0x42')]?_0xeda136['attributes']:_0x34c884[_0xfbc0('0x2b')];if(_0x4da179[_0xfbc0('0x2c')]['includeAll']){_0xeda136['include']=[{'all':!![]}];}_0xeda136=_[_0xfbc0('0x38')]({},_0xeda136,_0x4da179[_0xfbc0('0x3a')]);return db[_0xfbc0('0x3b')]['find'](_0xeda136)['then'](handleEntityNotFound(_0x263b97,null))[_0xfbc0('0x24')](respondWithResult(_0x263b97,null))[_0xfbc0('0x40')](handleError(_0x263b97,null));};exports['create']=function(_0x582d26,_0x5a9f87){return db[_0xfbc0('0x3b')][_0xfbc0('0x43')](_0x582d26[_0xfbc0('0x44')],{})[_0xfbc0('0x24')](respondWithResult(_0x5a9f87,0xc9))[_0xfbc0('0x40')](handleError(_0x5a9f87,null));};exports[_0xfbc0('0x22')]=function(_0x4ffd74,_0x507cac){if(_0x4ffd74[_0xfbc0('0x44')]['id']){delete _0x4ffd74[_0xfbc0('0x44')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x4ffd74['params']['id']}})[_0xfbc0('0x24')](handleEntityNotFound(_0x507cac,null))[_0xfbc0('0x24')](saveUpdates(_0x4ffd74[_0xfbc0('0x44')],null))[_0xfbc0('0x24')](respondWithResult(_0x507cac,null))[_0xfbc0('0x40')](handleError(_0x507cac,null));};exports['destroy']=function(_0x5c6029,_0xa7b281){return db[_0xfbc0('0x3b')][_0xfbc0('0x45')]({'where':{'id':_0x5c6029[_0xfbc0('0x46')]['id']}})[_0xfbc0('0x24')](handleEntityNotFound(_0xa7b281,null))[_0xfbc0('0x24')](removeEntity(_0xa7b281,null))[_0xfbc0('0x40')](handleError(_0xa7b281,null));};
\ No newline at end of file
+var _0x9831=['index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','include','params','includeAll','find','catch','create','body','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send'];(function(_0x23d64e,_0x584d97){var _0x1628f3=function(_0x5e4521){while(--_0x5e4521){_0x23d64e['push'](_0x23d64e['shift']());}};_0x1628f3(++_0x584d97);}(_0x9831,0xfc));var _0x1983=function(_0x1455c8,_0x24ec2a){_0x1455c8=_0x1455c8-0x0;var _0x26842a=_0x9831[_0x1455c8];return _0x26842a;};'use strict';var emlformat=require(_0x1983('0x0'));var rimraf=require(_0x1983('0x1'));var zipdir=require(_0x1983('0x2'));var jsonpatch=require(_0x1983('0x3'));var rp=require(_0x1983('0x4'));var moment=require('moment');var BPromise=require(_0x1983('0x5'));var Mustache=require(_0x1983('0x6'));var util=require(_0x1983('0x7'));var path=require(_0x1983('0x8'));var sox=require('sox');var csv=require(_0x1983('0x9'));var ejs=require(_0x1983('0xa'));var fs=require('fs');var fs_extra=require(_0x1983('0xb'));var _=require(_0x1983('0xc'));var squel=require(_0x1983('0xd'));var crypto=require(_0x1983('0xe'));var jsforce=require(_0x1983('0xf'));var deskjs=require(_0x1983('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1983('0x11'));var Papa=require(_0x1983('0x12'));var Redis=require(_0x1983('0x13'));var authService=require(_0x1983('0x14'));var qs=require(_0x1983('0x15'));var as=require(_0x1983('0x16'));var hardwareService=require(_0x1983('0x17'));var logger=require(_0x1983('0x18'))(_0x1983('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1983('0x1a'))['db'];function respondWithStatusCode(_0x4b2560,_0x33d755){_0x33d755=_0x33d755||0xcc;return function(_0x3fedff){if(_0x3fedff){return _0x4b2560['sendStatus'](_0x33d755);}return _0x4b2560['status'](_0x33d755)[_0x1983('0x1b')]();};}function respondWithResult(_0x482eb5,_0x4ccb94){_0x4ccb94=_0x4ccb94||0xc8;return function(_0x1416df){if(_0x1416df){return _0x482eb5[_0x1983('0x1c')](_0x4ccb94)[_0x1983('0x1d')](_0x1416df);}};}function respondWithFilteredResult(_0xca2b96,_0x3226ae){return function(_0x86737){if(_0x86737){var _0x30063f=typeof _0x3226ae[_0x1983('0x1e')]===_0x1983('0x1f')&&typeof _0x3226ae['limit']==='undefined';var _0x4670d7=_0x86737[_0x1983('0x20')];var _0x1e5b21=_0x30063f?0x0:_0x3226ae[_0x1983('0x1e')];var _0x56d1b2=_0x30063f?_0x86737['count']:_0x3226ae['offset']+_0x3226ae[_0x1983('0x21')];var _0x3deb00;if(_0x56d1b2>=_0x4670d7){_0x56d1b2=_0x4670d7;_0x3deb00=0xc8;}else{_0x3deb00=0xce;}_0xca2b96['status'](_0x3deb00);return _0xca2b96[_0x1983('0x22')](_0x1983('0x23'),_0x1e5b21+'-'+_0x56d1b2+'/'+_0x4670d7)[_0x1983('0x1d')](_0x86737);}return null;};}function patchUpdates(_0x2e55b3){return function(_0x296e9b){try{jsonpatch['apply'](_0x296e9b,_0x2e55b3,!![]);}catch(_0x4c0847){return BPromise[_0x1983('0x24')](_0x4c0847);}return _0x296e9b[_0x1983('0x25')]();};}function saveUpdates(_0x39c0ff,_0x52032f){return function(_0x1f4b97){if(_0x1f4b97){return _0x1f4b97[_0x1983('0x26')](_0x39c0ff)[_0x1983('0x27')](function(_0x166175){return _0x166175;});}return null;};}function removeEntity(_0x20d949,_0x1e5666){return function(_0xabc456){if(_0xabc456){return _0xabc456[_0x1983('0x28')]()['then'](function(){_0x20d949['status'](0xcc)[_0x1983('0x1b')]();});}};}function handleEntityNotFound(_0x11d067,_0x23e985){return function(_0x24e8ed){if(!_0x24e8ed){_0x11d067['sendStatus'](0x194);}return _0x24e8ed;};}function handleError(_0x488c5e,_0x141a85){_0x141a85=_0x141a85||0x1f4;return function(_0x34a132){logger[_0x1983('0x29')](_0x34a132['stack']);if(_0x34a132[_0x1983('0x2a')]){delete _0x34a132[_0x1983('0x2a')];}_0x488c5e[_0x1983('0x1c')](_0x141a85)[_0x1983('0x2b')](_0x34a132);};}exports[_0x1983('0x2c')]=function(_0x212520,_0x157f89){var _0xa9c382={},_0x5053b3={},_0xeb1dcd={'count':0x0,'rows':[]};var _0x53a656=_[_0x1983('0x2d')](db[_0x1983('0x2e')][_0x1983('0x2f')],function(_0x58bebb){return{'name':_0x58bebb[_0x1983('0x30')],'type':_0x58bebb[_0x1983('0x31')][_0x1983('0x32')]};});_0x5053b3[_0x1983('0x33')]=_[_0x1983('0x2d')](_0x53a656,_0x1983('0x2a'));_0x5053b3[_0x1983('0x34')]=_[_0x1983('0x35')](_0x212520['query']);_0x5053b3['filters']=_[_0x1983('0x36')](_0x5053b3['model'],_0x5053b3[_0x1983('0x34')]);_0xa9c382['attributes']=_[_0x1983('0x36')](_0x5053b3[_0x1983('0x33')],qs[_0x1983('0x37')](_0x212520[_0x1983('0x34')][_0x1983('0x37')]));_0xa9c382[_0x1983('0x38')]=_0xa9c382[_0x1983('0x38')][_0x1983('0x39')]?_0xa9c382[_0x1983('0x38')]:_0x5053b3[_0x1983('0x33')];if(!_0x212520[_0x1983('0x34')]['hasOwnProperty'](_0x1983('0x3a'))){_0xa9c382['limit']=qs[_0x1983('0x21')](_0x212520[_0x1983('0x34')][_0x1983('0x21')]);_0xa9c382[_0x1983('0x1e')]=qs[_0x1983('0x1e')](_0x212520[_0x1983('0x34')][_0x1983('0x1e')]);}_0xa9c382[_0x1983('0x3b')]=qs[_0x1983('0x3c')](_0x212520[_0x1983('0x34')][_0x1983('0x3c')]);_0xa9c382[_0x1983('0x3d')]=qs[_0x1983('0x3e')](_[_0x1983('0x3f')](_0x212520['query'],_0x5053b3[_0x1983('0x3e')]),_0x53a656);if(_0x212520[_0x1983('0x34')]['filter']){_0xa9c382[_0x1983('0x3d')]=_[_0x1983('0x40')](_0xa9c382[_0x1983('0x3d')],{'$or':_[_0x1983('0x2d')](_0x53a656,function(_0x2938b5){if(_0x2938b5[_0x1983('0x31')]!==_0x1983('0x41')){var _0x2609fa={};_0x2609fa[_0x2938b5[_0x1983('0x2a')]]={'$like':'%'+_0x212520[_0x1983('0x34')]['filter']+'%'};return _0x2609fa;}})});}_0xa9c382=_[_0x1983('0x40')]({},_0xa9c382,_0x212520[_0x1983('0x42')]);var _0x438bde={'where':_0xa9c382[_0x1983('0x3d')]};return db['ZendeskField'][_0x1983('0x20')](_0x438bde)['then'](function(_0x580ef5){_0xeb1dcd[_0x1983('0x20')]=_0x580ef5;if(_0x212520[_0x1983('0x34')]['includeAll']){_0xa9c382[_0x1983('0x43')]=[{'all':!![]}];}return db[_0x1983('0x2e')]['findAll'](_0xa9c382);})[_0x1983('0x27')](function(_0x498ec5){_0xeb1dcd['rows']=_0x498ec5;return _0xeb1dcd;})['then'](respondWithFilteredResult(_0x157f89,_0xa9c382))['catch'](handleError(_0x157f89,null));};exports['show']=function(_0x1ae459,_0x6e55e4){var _0x342f84={'raw':!![],'where':{'id':_0x1ae459[_0x1983('0x44')]['id']}},_0x48458d={};_0x48458d[_0x1983('0x33')]=_['keys'](db[_0x1983('0x2e')][_0x1983('0x2f')]);_0x48458d['query']=_['keys'](_0x1ae459[_0x1983('0x34')]);_0x48458d[_0x1983('0x3e')]=_[_0x1983('0x36')](_0x48458d[_0x1983('0x33')],_0x48458d[_0x1983('0x34')]);_0x342f84[_0x1983('0x38')]=_[_0x1983('0x36')](_0x48458d['model'],qs[_0x1983('0x37')](_0x1ae459[_0x1983('0x34')][_0x1983('0x37')]));_0x342f84[_0x1983('0x38')]=_0x342f84['attributes'][_0x1983('0x39')]?_0x342f84[_0x1983('0x38')]:_0x48458d[_0x1983('0x33')];if(_0x1ae459[_0x1983('0x34')][_0x1983('0x45')]){_0x342f84['include']=[{'all':!![]}];}_0x342f84=_[_0x1983('0x40')]({},_0x342f84,_0x1ae459[_0x1983('0x42')]);return db[_0x1983('0x2e')][_0x1983('0x46')](_0x342f84)['then'](handleEntityNotFound(_0x6e55e4,null))[_0x1983('0x27')](respondWithResult(_0x6e55e4,null))[_0x1983('0x47')](handleError(_0x6e55e4,null));};exports[_0x1983('0x48')]=function(_0x29ec29,_0x5edbab){return db[_0x1983('0x2e')]['create'](_0x29ec29['body'],{})['then'](respondWithResult(_0x5edbab,0xc9))['catch'](handleError(_0x5edbab,null));};exports[_0x1983('0x26')]=function(_0x39096d,_0x1ede6f){if(_0x39096d['body']['id']){delete _0x39096d['body']['id'];}return db['ZendeskField'][_0x1983('0x46')]({'where':{'id':_0x39096d['params']['id']}})[_0x1983('0x27')](handleEntityNotFound(_0x1ede6f,null))[_0x1983('0x27')](saveUpdates(_0x39096d[_0x1983('0x49')],null))[_0x1983('0x27')](respondWithResult(_0x1ede6f,null))['catch'](handleError(_0x1ede6f,null));};exports[_0x1983('0x28')]=function(_0x3a46da,_0x5a7435){return db[_0x1983('0x2e')]['find']({'where':{'id':_0x3a46da[_0x1983('0x44')]['id']}})[_0x1983('0x27')](handleEntityNotFound(_0x5a7435,null))[_0x1983('0x27')](removeEntity(_0x5a7435,null))[_0x1983('0x47')](handleError(_0x5a7435,null));};
\ No newline at end of file
index f71c9d9..db0d9d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeea1=['./intZendeskField.attributes','exports','define','ZendeskField','FieldId','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x59a401,_0x32188c){var _0x23e97a=function(_0x4159b7){while(--_0x4159b7){_0x59a401['push'](_0x59a401['shift']());}};_0x23e97a(++_0x32188c);}(_0xeea1,0x149));var _0x1eea=function(_0x1cc42a,_0x28d934){_0x1cc42a=_0x1cc42a-0x0;var _0x4f71f5=_0xeea1[_0x1cc42a];return _0x4f71f5;};'use strict';var _=require(_0x1eea('0x0'));var util=require('util');var logger=require(_0x1eea('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1eea('0x2'));var rp=require(_0x1eea('0x3'));var fs=require('fs');var path=require(_0x1eea('0x4'));var rimraf=require(_0x1eea('0x5'));var config=require(_0x1eea('0x6'));var attributes=require(_0x1eea('0x7'));module[_0x1eea('0x8')]=function(_0x3c447f,_0x568ba0){return _0x3c447f[_0x1eea('0x9')](_0x1eea('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x1eea('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a08=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x4d8a1f,_0x164d7e){var _0x4feb41=function(_0x2a0da1){while(--_0x2a0da1){_0x4d8a1f['push'](_0x4d8a1f['shift']());}};_0x4feb41(++_0x164d7e);}(_0x9a08,0x165));var _0x89a0=function(_0xbd201,_0x2d26d0){_0xbd201=_0xbd201-0x0;var _0x103c69=_0x9a08[_0xbd201];return _0x103c69;};'use strict';var _=require('lodash');var util=require(_0x89a0('0x0'));var logger=require(_0x89a0('0x1'))(_0x89a0('0x2'));var moment=require(_0x89a0('0x3'));var BPromise=require(_0x89a0('0x4'));var rp=require(_0x89a0('0x5'));var fs=require('fs');var path=require(_0x89a0('0x6'));var rimraf=require(_0x89a0('0x7'));var config=require(_0x89a0('0x8'));var attributes=require('./intZendeskField.attributes');module[_0x89a0('0x9')]=function(_0x32fbdb,_0x167c3b){return _0x32fbdb[_0x89a0('0xa')](_0x89a0('0xb'),attributes,{'tableName':_0x89a0('0xc'),'paranoid':![],'indexes':[{'name':_0x89a0('0xd'),'fields':[_0x89a0('0xe'),_0x89a0('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index caf6dff..e7ccde7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c21=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskField,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','../../config/logger'];(function(_0x4d247c,_0x3dff9e){var _0x42c60c=function(_0x399acd){while(--_0x399acd){_0x4d247c['push'](_0x4d247c['shift']());}};_0x42c60c(++_0x3dff9e);}(_0x9c21,0x1ca));var _0x19c2=function(_0x5306e7,_0xbc89ad){_0x5306e7=_0x5306e7-0x0;var _0x460d20=_0x9c21[_0x5306e7];return _0x460d20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x19c2('0x0'));var BPromise=require(_0x19c2('0x1'));var rs=require(_0x19c2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x19c2('0x3'))(_0x19c2('0x4'));var config=require(_0x19c2('0x5'));var jayson=require(_0x19c2('0x6'));var client=jayson[_0x19c2('0x7')][_0x19c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2986fb,_0x5eb2d8,_0x1a016f){return new BPromise(function(_0x526f7b,_0x8413e3){return client[_0x19c2('0x9')](_0x2986fb,_0x1a016f)['then'](function(_0x4a4a99){logger[_0x19c2('0xa')]('ZendeskField,\x20%s,\x20%s',_0x5eb2d8,_0x19c2('0xb'));logger[_0x19c2('0xc')](_0x19c2('0xd'),_0x5eb2d8,_0x19c2('0xb'),JSON[_0x19c2('0xe')](_0x4a4a99));if(_0x4a4a99[_0x19c2('0xf')]){if(_0x4a4a99['error'][_0x19c2('0x10')]===0x1f4){logger[_0x19c2('0xf')]('ZendeskField,\x20%s,\x20%s',_0x5eb2d8,_0x4a4a99[_0x19c2('0xf')][_0x19c2('0x11')]);return _0x8413e3(_0x4a4a99[_0x19c2('0xf')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x5eb2d8,_0x4a4a99[_0x19c2('0xf')][_0x19c2('0x11')]);return _0x526f7b(_0x4a4a99[_0x19c2('0xf')][_0x19c2('0x11')]);}else{logger[_0x19c2('0xa')](_0x19c2('0x12'),_0x5eb2d8,'request\x20sent');_0x526f7b(_0x4a4a99[_0x19c2('0x13')][_0x19c2('0x11')]);}})[_0x19c2('0x14')](function(_0x3d6237){logger['error'](_0x19c2('0x12'),_0x5eb2d8,_0x3d6237);_0x8413e3(_0x3d6237);});});}
\ No newline at end of file
+var _0xd0ac=['code','ZendeskField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1c8877,_0x524691){var _0x180eda=function(_0x1881e5){while(--_0x1881e5){_0x1c8877['push'](_0x1c8877['shift']());}};_0x180eda(++_0x524691);}(_0xd0ac,0x16c));var _0xcd0a=function(_0xc19100,_0x160b6c){_0xc19100=_0xc19100-0x0;var _0x23ef64=_0xd0ac[_0xc19100];return _0x23ef64;};'use strict';var _=require(_0xcd0a('0x0'));var util=require(_0xcd0a('0x1'));var moment=require(_0xcd0a('0x2'));var BPromise=require(_0xcd0a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd0a('0x4'))['db'];var utils=require(_0xcd0a('0x5'));var logger=require(_0xcd0a('0x6'))(_0xcd0a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcd0a('0x8')][_0xcd0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b1ef9,_0x3f060b,_0x159fb9){return new BPromise(function(_0x3750e0,_0x534a4e){return client['request'](_0x2b1ef9,_0x159fb9)[_0xcd0a('0xa')](function(_0xa0bf13){logger[_0xcd0a('0xb')]('ZendeskField,\x20%s,\x20%s',_0x3f060b,'request\x20sent');logger['debug'](_0xcd0a('0xc'),_0x3f060b,_0xcd0a('0xd'),JSON[_0xcd0a('0xe')](_0xa0bf13));if(_0xa0bf13[_0xcd0a('0xf')]){if(_0xa0bf13[_0xcd0a('0xf')][_0xcd0a('0x10')]===0x1f4){logger[_0xcd0a('0xf')](_0xcd0a('0x11'),_0x3f060b,_0xa0bf13[_0xcd0a('0xf')][_0xcd0a('0x12')]);return _0x534a4e(_0xa0bf13[_0xcd0a('0xf')][_0xcd0a('0x12')]);}logger[_0xcd0a('0xf')](_0xcd0a('0x11'),_0x3f060b,_0xa0bf13[_0xcd0a('0xf')]['message']);return _0x3750e0(_0xa0bf13[_0xcd0a('0xf')][_0xcd0a('0x12')]);}else{logger[_0xcd0a('0xb')](_0xcd0a('0x11'),_0x3f060b,_0xcd0a('0xd'));_0x3750e0(_0xa0bf13['result'][_0xcd0a('0x12')]);}})[_0xcd0a('0x13')](function(_0x565861){logger[_0xcd0a('0xf')]('ZendeskField,\x20%s,\x20%s',_0x3f060b,_0x565861);_0x534a4e(_0x565861);});});}
\ No newline at end of file
index 2e9ba07..89739de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83ec=['create','addConfiguration','put','update','delete','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','post'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x83ec,0x8a));var _0xc83e=function(_0x3a329f,_0x4d6784){_0x3a329f=_0x3a329f-0x0;var _0x468cf9=_0x83ec[_0x3a329f];return _0x468cf9;};'use strict';var multer=require(_0xc83e('0x0'));var util=require('util');var path=require(_0xc83e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc83e('0x2')]();var fs_extra=require(_0xc83e('0x3'));var auth=require(_0xc83e('0x4'));var interaction=require(_0xc83e('0x5'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xc83e('0x6')](),controller[_0xc83e('0x7')]);router[_0xc83e('0x8')](_0xc83e('0x9'),auth['isAuthenticated'](),controller[_0xc83e('0xa')]);router[_0xc83e('0x8')](_0xc83e('0xb'),auth[_0xc83e('0x6')](),controller['getConfigurations']);router[_0xc83e('0x8')](_0xc83e('0xc'),auth[_0xc83e('0x6')](),controller['getFields']);router[_0xc83e('0xd')]('/',auth[_0xc83e('0x6')](),controller[_0xc83e('0xe')]);router[_0xc83e('0xd')](_0xc83e('0xb'),auth[_0xc83e('0x6')](),controller[_0xc83e('0xf')]);router[_0xc83e('0x10')](_0xc83e('0x9'),auth[_0xc83e('0x6')](),controller[_0xc83e('0x11')]);router[_0xc83e('0x12')](_0xc83e('0x9'),auth[_0xc83e('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xab76=['index','/:id','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x337bf5,_0x178494){var _0x243817=function(_0x7a52da){while(--_0x7a52da){_0x337bf5['push'](_0x337bf5['shift']());}};_0x243817(++_0x178494);}(_0xab76,0x96));var _0x6ab7=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xab76[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x6ab7('0x0'));var util=require(_0x6ab7('0x1'));var path=require(_0x6ab7('0x2'));var timeout=require(_0x6ab7('0x3'));var express=require('express');var router=express[_0x6ab7('0x4')]();var fs_extra=require(_0x6ab7('0x5'));var auth=require(_0x6ab7('0x6'));var interaction=require(_0x6ab7('0x7'));var config=require(_0x6ab7('0x8'));var controller=require('./intZohoAccount.controller');router[_0x6ab7('0x9')]('/',auth[_0x6ab7('0xa')](),controller[_0x6ab7('0xb')]);router[_0x6ab7('0x9')](_0x6ab7('0xc'),auth[_0x6ab7('0xa')](),controller['show']);router[_0x6ab7('0x9')]('/:id/configurations',auth[_0x6ab7('0xa')](),controller['getConfigurations']);router[_0x6ab7('0x9')](_0x6ab7('0xd'),auth['isAuthenticated'](),controller[_0x6ab7('0xe')]);router[_0x6ab7('0xf')]('/',auth[_0x6ab7('0xa')](),controller[_0x6ab7('0x10')]);router['post'](_0x6ab7('0x11'),auth[_0x6ab7('0xa')](),controller['addConfiguration']);router[_0x6ab7('0x12')]('/:id',auth[_0x6ab7('0xa')](),controller[_0x6ab7('0x13')]);router[_0x6ab7('0x14')]('/:id',auth[_0x6ab7('0xa')](),controller[_0x6ab7('0x15')]);module[_0x6ab7('0x16')]=router;
\ No newline at end of file
index cf81725..6a233d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['STRING','exports'];(function(_0x4373be,_0x368b98){var _0x5d7e60=function(_0x34b146){while(--_0x34b146){_0x4373be['push'](_0x4373be['shift']());}};_0x5d7e60(++_0x368b98);}(_0xe5b3,0x133));var _0x3e5b=function(_0x4b9cb4,_0x1f18a8){_0x4b9cb4=_0x4b9cb4-0x0;var _0x335d39=_0xe5b3[_0x4b9cb4];return _0x335d39;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'name':{'type':Sequelize[_0x3e5b('0x1')]},'description':{'type':Sequelize[_0x3e5b('0x1')]},'host':{'type':Sequelize[_0x3e5b('0x1')]},'zone':{'type':Sequelize[_0x3e5b('0x1')]},'clientId':{'type':Sequelize[_0x3e5b('0x1')]},'clientSecret':{'type':Sequelize[_0x3e5b('0x1')]},'serverUrl':{'type':Sequelize[_0x3e5b('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x3e5b('0x1')]},'refreshToken':{'type':Sequelize[_0x3e5b('0x1')]}};
\ No newline at end of file
+var _0xb903=['exports','STRING','sequelize'];(function(_0x243aca,_0x272cb3){var _0x4a586d=function(_0x388d8b){while(--_0x388d8b){_0x243aca['push'](_0x243aca['shift']());}};_0x4a586d(++_0x272cb3);}(_0xb903,0x185));var _0x3b90=function(_0x13896b,_0x36388b){_0x13896b=_0x13896b-0x0;var _0x4cef58=_0xb903[_0x13896b];return _0x4cef58;};'use strict';var Sequelize=require(_0x3b90('0x0'));module[_0x3b90('0x1')]={'name':{'type':Sequelize[_0x3b90('0x2')]},'description':{'type':Sequelize[_0x3b90('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x3b90('0x2')]},'clientId':{'type':Sequelize[_0x3b90('0x2')]},'clientSecret':{'type':Sequelize[_0x3b90('0x2')]},'serverUrl':{'type':Sequelize[_0x3b90('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x3b90('0x2')]},'refreshToken':{'type':Sequelize[_0x3b90('0x2')]}};
\ No newline at end of file
index bab4987..9fc8a71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x412f=['clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','com','slice','lastIndexOf','format','Zoho-oauthtoken\x20','response','message','Owner','Subject','WhoId','Call_Duration','Call_Start_Time','remove','includes','system_mandatory','display_label','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','statusCode','eml-format','rimraf','request-promise','moment','bluebird','util','path','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','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','rawAttributes','key','map','query','intersection','model','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','update','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','type','ZohoField','zone','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken'];(function(_0x340756,_0xad31ae){var _0x2ef745=function(_0x59ffde){while(--_0x59ffde){_0x340756['push'](_0x340756['shift']());}};_0x2ef745(++_0xad31ae);}(_0x412f,0x10d));var _0xf412=function(_0x3308e1,_0x3a318d){_0x3308e1=_0x3308e1-0x0;var _0x368941=_0x412f[_0x3308e1];return _0x368941;};'use strict';var emlformat=require(_0xf412('0x0'));var rimraf=require(_0xf412('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf412('0x2'));var moment=require(_0xf412('0x3'));var BPromise=require(_0xf412('0x4'));var Mustache=require('mustache');var util=require(_0xf412('0x5'));var path=require(_0xf412('0x6'));var sox=require('sox');var csv=require(_0xf412('0x7'));var ejs=require(_0xf412('0x8'));var fs=require('fs');var fs_extra=require(_0xf412('0x9'));var _=require(_0xf412('0xa'));var squel=require(_0xf412('0xb'));var crypto=require(_0xf412('0xc'));var jsforce=require(_0xf412('0xd'));var deskjs=require(_0xf412('0xe'));var toCsv=require(_0xf412('0x7'));var querystring=require(_0xf412('0xf'));var Papa=require(_0xf412('0x10'));var Redis=require(_0xf412('0x11'));var authService=require(_0xf412('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf412('0x13'));var hardwareService=require(_0xf412('0x14'));var logger=require(_0xf412('0x15'))(_0xf412('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf412('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x459dfb,_0x8f5cc2){_0x8f5cc2=_0x8f5cc2||0xcc;return function(_0x36fff7){if(_0x36fff7){return _0x459dfb[_0xf412('0x18')](_0x8f5cc2);}return _0x459dfb[_0xf412('0x19')](_0x8f5cc2)[_0xf412('0x1a')]();};}function respondWithResult(_0x4ae33a,_0xbbbac8){_0xbbbac8=_0xbbbac8||0xc8;return function(_0x1fa629){if(_0x1fa629){return _0x4ae33a[_0xf412('0x19')](_0xbbbac8)['json'](_0x1fa629);}};}function respondWithFilteredResult(_0x5360af,_0x35a5b4){return function(_0x422312){if(_0x422312){var _0xe63c9d=typeof _0x35a5b4[_0xf412('0x1b')]==='undefined'&&typeof _0x35a5b4[_0xf412('0x1c')]===_0xf412('0x1d');var _0x3f46d6=_0x422312[_0xf412('0x1e')];var _0x5e56cc=_0xe63c9d?0x0:_0x35a5b4['offset'];var _0x5b872a=_0xe63c9d?_0x422312[_0xf412('0x1e')]:_0x35a5b4['offset']+_0x35a5b4[_0xf412('0x1c')];var _0x4e12cb;if(_0x5b872a>=_0x3f46d6){_0x5b872a=_0x3f46d6;_0x4e12cb=0xc8;}else{_0x4e12cb=0xce;}_0x5360af['status'](_0x4e12cb);return _0x5360af['set'](_0xf412('0x1f'),_0x5e56cc+'-'+_0x5b872a+'/'+_0x3f46d6)['json'](_0x422312);}return null;};}function patchUpdates(_0x3c1bd9){return function(_0x5c8e34){try{jsonpatch[_0xf412('0x20')](_0x5c8e34,_0x3c1bd9,!![]);}catch(_0x3c5c3c){return BPromise[_0xf412('0x21')](_0x3c5c3c);}return _0x5c8e34[_0xf412('0x22')]();};}function saveUpdates(_0x6c9fd,_0x1d2a7e){return function(_0x26679f){if(_0x26679f){return _0x26679f['update'](_0x6c9fd)[_0xf412('0x23')](function(_0x23dfca){return _0x23dfca;});}return null;};}function removeEntity(_0x2f3f44,_0x15ea6b){return function(_0x4d97c8){if(_0x4d97c8){return _0x4d97c8[_0xf412('0x24')]()['then'](function(){_0x2f3f44[_0xf412('0x19')](0xcc)[_0xf412('0x1a')]();});}};}function handleEntityNotFound(_0x2daf32,_0x22c0e7){return function(_0x22e83c){if(!_0x22e83c){_0x2daf32[_0xf412('0x18')](0x194);}return _0x22e83c;};}function handleError(_0x3b917e,_0x3965df){_0x3965df=_0x3965df||0x1f4;return function(_0x4d7635){logger[_0xf412('0x25')](_0x4d7635[_0xf412('0x26')]);if(_0x4d7635[_0xf412('0x27')]){delete _0x4d7635[_0xf412('0x27')];}_0x3b917e[_0xf412('0x19')](_0x3965df)[_0xf412('0x28')](_0x4d7635);};}exports['index']=function(_0x1f7a39,_0x35569b){var _0x38a65e={},_0x1ddd81={},_0x4d511a={'count':0x0,'rows':[]};var _0x5d9701=_['map'](db['ZohoAccount'][_0xf412('0x29')],function(_0x2cea5c){return{'name':_0x2cea5c['fieldName'],'type':_0x2cea5c['type'][_0xf412('0x2a')]};});_0x1ddd81['model']=_[_0xf412('0x2b')](_0x5d9701,_0xf412('0x27'));_0x1ddd81['query']=_['keys'](_0x1f7a39[_0xf412('0x2c')]);_0x1ddd81['filters']=_[_0xf412('0x2d')](_0x1ddd81[_0xf412('0x2e')],_0x1ddd81[_0xf412('0x2c')]);_0x38a65e['attributes']=_[_0xf412('0x2d')](_0x1ddd81['model'],qs[_0xf412('0x2f')](_0x1f7a39[_0xf412('0x2c')][_0xf412('0x2f')]));_0x38a65e[_0xf412('0x30')]=_0x38a65e[_0xf412('0x30')]['length']?_0x38a65e[_0xf412('0x30')]:_0x1ddd81[_0xf412('0x2e')];if(!_0x1f7a39[_0xf412('0x2c')]['hasOwnProperty'](_0xf412('0x31'))){_0x38a65e[_0xf412('0x1c')]=qs['limit'](_0x1f7a39[_0xf412('0x2c')][_0xf412('0x1c')]);_0x38a65e[_0xf412('0x1b')]=qs[_0xf412('0x1b')](_0x1f7a39[_0xf412('0x2c')]['offset']);}_0x38a65e[_0xf412('0x32')]=qs[_0xf412('0x33')](_0x1f7a39[_0xf412('0x2c')][_0xf412('0x33')]);_0x38a65e[_0xf412('0x34')]=qs[_0xf412('0x35')](_[_0xf412('0x36')](_0x1f7a39['query'],_0x1ddd81[_0xf412('0x35')]),_0x5d9701);if(_0x1f7a39[_0xf412('0x2c')][_0xf412('0x37')]){_0x38a65e[_0xf412('0x34')]=_[_0xf412('0x38')](_0x38a65e[_0xf412('0x34')],{'$or':_['map'](_0x5d9701,function(_0x3f871a){if(_0x3f871a['type']!==_0xf412('0x39')){var _0x3b0d88={};_0x3b0d88[_0x3f871a['name']]={'$like':'%'+_0x1f7a39[_0xf412('0x2c')][_0xf412('0x37')]+'%'};return _0x3b0d88;}})});}_0x38a65e=_[_0xf412('0x38')]({},_0x38a65e,_0x1f7a39[_0xf412('0x3a')]);var _0x17dcaa={'where':_0x38a65e['where']};return db[_0xf412('0x3b')]['count'](_0x17dcaa)['then'](function(_0x268520){_0x4d511a[_0xf412('0x1e')]=_0x268520;if(_0x1f7a39[_0xf412('0x2c')][_0xf412('0x3c')]){_0x38a65e[_0xf412('0x3d')]=[{'all':!![]}];}return db[_0xf412('0x3b')][_0xf412('0x3e')](_0x38a65e);})['then'](function(_0x3ca530){_0x4d511a['rows']=_0x3ca530;return _0x4d511a;})[_0xf412('0x23')](respondWithFilteredResult(_0x35569b,_0x38a65e))[_0xf412('0x3f')](handleError(_0x35569b,null));};exports[_0xf412('0x40')]=function(_0x1a6d15,_0x5f3c33){var _0x1726ae={'raw':![],'where':{'id':_0x1a6d15[_0xf412('0x41')]['id']}},_0x510afa={};_0x510afa[_0xf412('0x2e')]=_[_0xf412('0x42')](db['ZohoAccount'][_0xf412('0x29')]);_0x510afa[_0xf412('0x2c')]=_[_0xf412('0x42')](_0x1a6d15[_0xf412('0x2c')]);_0x510afa[_0xf412('0x35')]=_[_0xf412('0x2d')](_0x510afa['model'],_0x510afa[_0xf412('0x2c')]);_0x1726ae[_0xf412('0x30')]=_[_0xf412('0x2d')](_0x510afa[_0xf412('0x2e')],qs[_0xf412('0x2f')](_0x1a6d15[_0xf412('0x2c')][_0xf412('0x2f')]));_0x1726ae[_0xf412('0x30')]=_0x1726ae[_0xf412('0x30')][_0xf412('0x43')]?_0x1726ae[_0xf412('0x30')]:_0x510afa[_0xf412('0x2e')];if(_0x1a6d15[_0xf412('0x2c')][_0xf412('0x3c')]){_0x1726ae[_0xf412('0x3d')]=[{'all':!![]}];}_0x1726ae=_[_0xf412('0x38')]({},_0x1726ae,_0x1a6d15[_0xf412('0x3a')]);return db[_0xf412('0x3b')][_0xf412('0x44')](_0x1726ae)[_0xf412('0x23')](handleEntityNotFound(_0x5f3c33,null))[_0xf412('0x23')](respondWithResult(_0x5f3c33,null))[_0xf412('0x3f')](handleError(_0x5f3c33,null));};exports[_0xf412('0x45')]=function(_0x566fc3,_0x11436f){return db[_0xf412('0x3b')]['create'](_0x566fc3[_0xf412('0x46')],{})[_0xf412('0x23')](respondWithResult(_0x11436f,0xc9))[_0xf412('0x3f')](handleError(_0x11436f,null));};exports[_0xf412('0x47')]=function(_0x47c758,_0x2cc517){if(_0x47c758[_0xf412('0x46')]['id']){delete _0x47c758['body']['id'];}return db[_0xf412('0x3b')][_0xf412('0x44')]({'where':{'id':_0x47c758[_0xf412('0x41')]['id']}})[_0xf412('0x23')](handleEntityNotFound(_0x2cc517,null))['then'](saveUpdates(_0x47c758[_0xf412('0x46')],null))[_0xf412('0x23')](respondWithResult(_0x2cc517,null))[_0xf412('0x3f')](handleError(_0x2cc517,null));};exports[_0xf412('0x24')]=function(_0x300af1,_0x24c874){return db['ZohoAccount']['find']({'where':{'id':_0x300af1['params']['id']}})[_0xf412('0x23')](handleEntityNotFound(_0x24c874,null))[_0xf412('0x23')](removeEntity(_0x24c874,null))[_0xf412('0x3f')](handleError(_0x24c874,null));};exports[_0xf412('0x48')]=function(_0x494bb6,_0x5aa8e8,_0x544c72){var _0x2e5d39={};var _0x2c199a={};var _0x429fdb;var _0x3eae1d;return db[_0xf412('0x3b')][_0xf412('0x49')]({'where':{'id':_0x494bb6['params']['id']}})[_0xf412('0x23')](handleEntityNotFound(_0x5aa8e8,null))[_0xf412('0x23')](function(_0x3625bf){if(_0x3625bf){_0x429fdb=_0x3625bf;_0x2c199a[_0xf412('0x2e')]=_[_0xf412('0x42')](db[_0xf412('0x4a')][_0xf412('0x29')]);_0x2c199a[_0xf412('0x2c')]=_[_0xf412('0x42')](_0x494bb6['query']);_0x2c199a[_0xf412('0x35')]=_['intersection'](_0x2c199a[_0xf412('0x2e')],_0x2c199a[_0xf412('0x2c')]);_0x2e5d39[_0xf412('0x30')]=_[_0xf412('0x2d')](_0x2c199a[_0xf412('0x2e')],qs[_0xf412('0x2f')](_0x494bb6[_0xf412('0x2c')]['fields']));_0x2e5d39[_0xf412('0x30')]=_0x2e5d39['attributes'][_0xf412('0x43')]?_0x2e5d39['attributes']:_0x2c199a['model'];_0x2e5d39[_0xf412('0x32')]=qs['sort'](_0x494bb6[_0xf412('0x2c')][_0xf412('0x33')]);_0x2e5d39[_0xf412('0x34')]=qs[_0xf412('0x35')](_['pick'](_0x494bb6[_0xf412('0x2c')],_0x2c199a[_0xf412('0x35')]));if(_0x494bb6[_0xf412('0x2c')][_0xf412('0x37')]){_0x2e5d39[_0xf412('0x34')]=_['merge'](_0x2e5d39[_0xf412('0x34')],{'$or':_[_0xf412('0x2b')](_0x2e5d39['attributes'],function(_0x62f895){var _0x50bb79={};_0x50bb79[_0x62f895]={'$like':'%'+_0x494bb6[_0xf412('0x2c')][_0xf412('0x37')]+'%'};return _0x50bb79;})});}_0x2e5d39=_['merge']({},_0x2e5d39,_0x494bb6[_0xf412('0x3a')]);return _0x429fdb[_0xf412('0x48')](_0x2e5d39);}})[_0xf412('0x23')](function(_0x4486b4){if(_0x4486b4){_0x3eae1d=_0x4486b4['length'];if(!_0x494bb6[_0xf412('0x2c')][_0xf412('0x4b')](_0xf412('0x31'))){_0x2e5d39[_0xf412('0x1c')]=qs[_0xf412('0x1c')](_0x494bb6[_0xf412('0x2c')][_0xf412('0x1c')]);_0x2e5d39[_0xf412('0x1b')]=qs[_0xf412('0x1b')](_0x494bb6[_0xf412('0x2c')][_0xf412('0x1b')]);}return _0x429fdb[_0xf412('0x48')](_0x2e5d39);}})['then'](function(_0x1de8a2){if(_0x1de8a2){return _0x1de8a2?{'count':_0x3eae1d,'rows':_0x1de8a2}:null;}})['then'](respondWithResult(_0x5aa8e8,null))[_0xf412('0x3f')](handleError(_0x5aa8e8,null));};exports[_0xf412('0x4c')]=function(_0x1ee50e,_0x147508,_0x5c2e28){if(_0x1ee50e['body']['id']){delete _0x1ee50e['body']['id'];}return db['ZohoAccount'][_0xf412('0x49')]({'where':{'id':_0x1ee50e[_0xf412('0x41')]['id']}})['then'](handleEntityNotFound(_0x147508,null))[_0xf412('0x23')](function(_0x31eae2){if(_0x31eae2){_0x1ee50e['body']['AccountId']=_0x31eae2['id'];_0x1ee50e[_0xf412('0x46')][_0xf412('0x4d')]=integrations[_0xf412('0x4e')](_0x1ee50e['body'][_0xf412('0x4f')],_0x1ee50e[_0xf412('0x46')]['type']);_0x1ee50e[_0xf412('0x46')][_0xf412('0x50')]=integrations['getDescriptions'](_0x1ee50e[_0xf412('0x46')][_0xf412('0x4f')],_0x1ee50e['body'][_0xf412('0x51')]);return db[_0xf412('0x4a')]['create'](_0x1ee50e['body'],{'include':[{'model':db['ZohoField'],'as':_0xf412('0x4d')},{'model':db[_0xf412('0x52')],'as':_0xf412('0x50')}]});}return null;})[_0xf412('0x23')](respondWithResult(_0x147508,null))[_0xf412('0x3f')](handleError(_0x147508,null));};function getAccessToken(_0x300fe6){return new Promise(function(_0x219798,_0x2dc848){var _0x82912a;switch(_0x300fe6[_0xf412('0x53')]){case'US':_0x82912a='https://accounts.zoho.com';break;case'AU':_0x82912a='https://accounts.zoho.com.au';break;case'EU':_0x82912a=_0xf412('0x54');break;case'IN':_0x82912a='https://accounts.zoho.in';break;case'CN':_0x82912a=_0xf412('0x55');break;default:_0x82912a=_0xf412('0x54');break;}var _0x5b6150={'method':_0xf412('0x56'),'uri':_0x82912a+'/oauth/v2/token','qs':{'refresh_token':_0x300fe6[_0xf412('0x57')],'client_id':_0x300fe6[_0xf412('0x58')],'client_secret':_0x300fe6[_0xf412('0x59')],'grant_type':_0xf412('0x5a')},'json':!![]};return rp(_0x5b6150)[_0xf412('0x23')](function(_0x5ad503){if(_0x5ad503[_0xf412('0x5b')]){_0x219798(_0x5ad503[_0xf412('0x5b')]);}else{_0x2dc848(_0xf412('0x5c'));}})[_0xf412('0x3f')](function(_0x10442e){_0x2dc848(_0x10442e);});});}exports['getFields']=function(_0x334eb1,_0x843e91,_0x33a49b){var _0x395fdb,_0x4743c2,_0x5d1e29,_0x15959e,_0x527b76;return db['ZohoAccount'][_0xf412('0x49')]({'where':{'id':_0x334eb1[_0xf412('0x41')]['id']},'attributes':['id',_0xf412('0x5d'),_0xf412('0x53'),_0xf412('0x58'),_0xf412('0x59'),_0xf412('0x5e'),_0xf412('0x5f'),_0xf412('0x57')]})[_0xf412('0x23')](handleEntityNotFound(_0x843e91,null))[_0xf412('0x23')](function(_0x16a93f){_0x527b76=_0x16a93f;_0x395fdb=_0x527b76[_0xf412('0x5d')];_0x4743c2=_0x395fdb==='zoho.eu'?'eu':_0xf412('0x60');_0x5d1e29=_0x527b76[_0xf412('0x5e')];var _0x321ca0=_0x5d1e29[_0xf412('0x61')](-0x1);if(_0x321ca0==='/'||_0x321ca0==='\x5c'||_0x321ca0===':'){_0x5d1e29=_0x5d1e29['substring'](0x0,_0x5d1e29[_0xf412('0x62')](_0x321ca0));}if(!_0x527b76[_0xf412('0x57')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x527b76);})[_0xf412('0x23')](function(_0x5bedf4){if(_0x5bedf4){return rp({'method':'GET','uri':util[_0xf412('0x63')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x4743c2),'qs':{'module':'Calls'},'headers':{'Authorization':_0xf412('0x64')+_0x5bedf4},'json':!![]});}})[_0xf412('0x23')](function(_0x14f503){if(_0x14f503){if(_0x14f503['response']&&_0x14f503['response'][_0xf412('0x25')]){throw new Error(_0x14f503[_0xf412('0x65')]['error'][_0xf412('0x66')]);}var _0x43161f=[];var _0x27a2e6=[];var _0x38c81d=[_0xf412('0x67'),_0xf412('0x68'),'Description',_0xf412('0x69'),_0xf412('0x6a'),'Call_Result',_0xf412('0x6b'),'Call_Type'];_0x27a2e6=_[_0xf412('0x6c')](_0x14f503[_0xf412('0x2f')],function(_0x2411f2){return _0x38c81d[_0xf412('0x6d')](_0x2411f2['api_name']);});for(var _0x38b446=0x0;_0x38b446<_0x27a2e6[_0xf412('0x43')];_0x38b446++){if(_0x27a2e6[_0x38b446][_0xf412('0x6e')]===![]){_0x43161f['push']({'id':_0x27a2e6[_0x38b446]['id'],'name':_0x27a2e6[_0x38b446][_0xf412('0x6f')],'custom':_0x27a2e6[_0x38b446]['custom_field'],'options':_0x27a2e6[_0x38b446][_0xf412('0x70')]===_0xf412('0x71')&&_0x27a2e6[_0x38b446][_0xf412('0x72')][_0xf412('0x43')]>-0x1?_[_0xf412('0x2b')](_0x27a2e6[_0x38b446]['pick_list_values'],function(_0x2aff5f){return{'name':_0x2aff5f,'value':_0x2aff5f};}):[]});}}return{'count':_0x43161f['length'],'rows':_0x43161f};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x843e91,null))['catch'](function(_0x2b1a34){var _0x18515b=_0x334eb1[_0xf412('0x2c')][_0xf412('0x73')]?0x1f4:_0x2b1a34['statusCode']||0x1f4;logger[_0xf412('0x25')](_0xf412('0x74'),_0xf412('0x75'),_0x18515b,JSON['stringify'](_0x2b1a34));delete _0x2b1a34[_0xf412('0x27')];if(_0x18515b===0x191){_0x18515b=0x190;}_0x843e91[_0xf412('0x19')](_0x18515b)['send'](_0x334eb1['query'][_0xf412('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x2b1a34[_0xf412('0x76')]}:_0x2b1a34);});};
\ No newline at end of file
+var _0xe924=['merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','getConfigurations','ZohoConfiguration','addConfiguration','findOne','getSubjects','channel','ZohoField','Subjects','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','Zoho-oauthtoken\x20','response','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','data_type','picklist','pick_list_values','statusCode','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','VIRTUAL'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe924,0x141));var _0x4e92=function(_0x2b3fa9,_0x5dddc1){_0x2b3fa9=_0x2b3fa9-0x0;var _0x3e1047=_0xe924[_0x2b3fa9];return _0x3e1047;};'use strict';var emlformat=require(_0x4e92('0x0'));var rimraf=require(_0x4e92('0x1'));var zipdir=require(_0x4e92('0x2'));var jsonpatch=require(_0x4e92('0x3'));var rp=require(_0x4e92('0x4'));var moment=require(_0x4e92('0x5'));var BPromise=require(_0x4e92('0x6'));var Mustache=require(_0x4e92('0x7'));var util=require(_0x4e92('0x8'));var path=require(_0x4e92('0x9'));var sox=require(_0x4e92('0xa'));var csv=require('to-csv');var ejs=require(_0x4e92('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e92('0xc'));var squel=require(_0x4e92('0xd'));var crypto=require(_0x4e92('0xe'));var jsforce=require(_0x4e92('0xf'));var deskjs=require(_0x4e92('0x10'));var toCsv=require(_0x4e92('0x11'));var querystring=require(_0x4e92('0x12'));var Papa=require(_0x4e92('0x13'));var Redis=require(_0x4e92('0x14'));var authService=require(_0x4e92('0x15'));var qs=require(_0x4e92('0x16'));var as=require(_0x4e92('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e92('0x18'))(_0x4e92('0x19'));var utils=require(_0x4e92('0x1a'));var config=require(_0x4e92('0x1b'));var licenseUtil=require(_0x4e92('0x1c'));var db=require(_0x4e92('0x1d'))['db'];var integrations=require(_0x4e92('0x1e'));function respondWithStatusCode(_0x1b4fd3,_0x231db7){_0x231db7=_0x231db7||0xcc;return function(_0xaa97c){if(_0xaa97c){return _0x1b4fd3[_0x4e92('0x1f')](_0x231db7);}return _0x1b4fd3[_0x4e92('0x20')](_0x231db7)[_0x4e92('0x21')]();};}function respondWithResult(_0x38b369,_0x20a489){_0x20a489=_0x20a489||0xc8;return function(_0x1ba5ab){if(_0x1ba5ab){return _0x38b369[_0x4e92('0x20')](_0x20a489)[_0x4e92('0x22')](_0x1ba5ab);}};}function respondWithFilteredResult(_0x42d74f,_0xcbe9ef){return function(_0x2ee304){if(_0x2ee304){var _0x46ffdd=typeof _0xcbe9ef['offset']==='undefined'&&typeof _0xcbe9ef[_0x4e92('0x23')]===_0x4e92('0x24');var _0xa37ac5=_0x2ee304[_0x4e92('0x25')];var _0x3d8d19=_0x46ffdd?0x0:_0xcbe9ef['offset'];var _0x2502e3=_0x46ffdd?_0x2ee304[_0x4e92('0x25')]:_0xcbe9ef['offset']+_0xcbe9ef['limit'];var _0x954906;if(_0x2502e3>=_0xa37ac5){_0x2502e3=_0xa37ac5;_0x954906=0xc8;}else{_0x954906=0xce;}_0x42d74f['status'](_0x954906);return _0x42d74f['set'](_0x4e92('0x26'),_0x3d8d19+'-'+_0x2502e3+'/'+_0xa37ac5)[_0x4e92('0x22')](_0x2ee304);}return null;};}function patchUpdates(_0x3a565e){return function(_0x29e7ef){try{jsonpatch[_0x4e92('0x27')](_0x29e7ef,_0x3a565e,!![]);}catch(_0x30bac4){return BPromise[_0x4e92('0x28')](_0x30bac4);}return _0x29e7ef[_0x4e92('0x29')]();};}function saveUpdates(_0x3e905e,_0x400835){return function(_0x40f9fd){if(_0x40f9fd){return _0x40f9fd[_0x4e92('0x2a')](_0x3e905e)[_0x4e92('0x2b')](function(_0xd05434){return _0xd05434;});}return null;};}function removeEntity(_0x3e8cdb,_0x33f0ef){return function(_0x477c66){if(_0x477c66){return _0x477c66[_0x4e92('0x2c')]()[_0x4e92('0x2b')](function(){_0x3e8cdb[_0x4e92('0x20')](0xcc)[_0x4e92('0x21')]();});}};}function handleEntityNotFound(_0x294299,_0x26240e){return function(_0x59ddeb){if(!_0x59ddeb){_0x294299[_0x4e92('0x1f')](0x194);}return _0x59ddeb;};}function handleError(_0x25cf3f,_0x40e9bd){_0x40e9bd=_0x40e9bd||0x1f4;return function(_0x5f0666){logger[_0x4e92('0x2d')](_0x5f0666[_0x4e92('0x2e')]);if(_0x5f0666[_0x4e92('0x2f')]){delete _0x5f0666[_0x4e92('0x2f')];}_0x25cf3f[_0x4e92('0x20')](_0x40e9bd)[_0x4e92('0x30')](_0x5f0666);};}exports[_0x4e92('0x31')]=function(_0x508b8e,_0x58b9ee){var _0x3bccba={},_0x335ad0={},_0x26bbc7={'count':0x0,'rows':[]};var _0x5b85d9=_[_0x4e92('0x32')](db[_0x4e92('0x33')][_0x4e92('0x34')],function(_0x2e4e3b){return{'name':_0x2e4e3b[_0x4e92('0x35')],'type':_0x2e4e3b[_0x4e92('0x36')]['key']};});_0x335ad0[_0x4e92('0x37')]=_[_0x4e92('0x32')](_0x5b85d9,_0x4e92('0x2f'));_0x335ad0[_0x4e92('0x38')]=_[_0x4e92('0x39')](_0x508b8e[_0x4e92('0x38')]);_0x335ad0['filters']=_[_0x4e92('0x3a')](_0x335ad0[_0x4e92('0x37')],_0x335ad0[_0x4e92('0x38')]);_0x3bccba['attributes']=_[_0x4e92('0x3a')](_0x335ad0[_0x4e92('0x37')],qs[_0x4e92('0x3b')](_0x508b8e[_0x4e92('0x38')]['fields']));_0x3bccba['attributes']=_0x3bccba['attributes'][_0x4e92('0x3c')]?_0x3bccba[_0x4e92('0x3d')]:_0x335ad0['model'];if(!_0x508b8e[_0x4e92('0x38')][_0x4e92('0x3e')](_0x4e92('0x3f'))){_0x3bccba['limit']=qs['limit'](_0x508b8e[_0x4e92('0x38')]['limit']);_0x3bccba[_0x4e92('0x40')]=qs[_0x4e92('0x40')](_0x508b8e[_0x4e92('0x38')][_0x4e92('0x40')]);}_0x3bccba[_0x4e92('0x41')]=qs[_0x4e92('0x42')](_0x508b8e[_0x4e92('0x38')][_0x4e92('0x42')]);_0x3bccba[_0x4e92('0x43')]=qs[_0x4e92('0x44')](_[_0x4e92('0x45')](_0x508b8e[_0x4e92('0x38')],_0x335ad0[_0x4e92('0x44')]),_0x5b85d9);if(_0x508b8e[_0x4e92('0x38')][_0x4e92('0x46')]){_0x3bccba['where']=_['merge'](_0x3bccba['where'],{'$or':_[_0x4e92('0x32')](_0x5b85d9,function(_0x4c8cd9){if(_0x4c8cd9[_0x4e92('0x36')]!==_0x4e92('0x47')){var _0x346b87={};_0x346b87[_0x4c8cd9[_0x4e92('0x2f')]]={'$like':'%'+_0x508b8e[_0x4e92('0x38')]['filter']+'%'};return _0x346b87;}})});}_0x3bccba=_[_0x4e92('0x48')]({},_0x3bccba,_0x508b8e['options']);var _0xcc77e0={'where':_0x3bccba[_0x4e92('0x43')]};return db[_0x4e92('0x33')][_0x4e92('0x25')](_0xcc77e0)['then'](function(_0xde34e4){_0x26bbc7[_0x4e92('0x25')]=_0xde34e4;if(_0x508b8e[_0x4e92('0x38')]['includeAll']){_0x3bccba[_0x4e92('0x49')]=[{'all':!![]}];}return db[_0x4e92('0x33')][_0x4e92('0x4a')](_0x3bccba);})[_0x4e92('0x2b')](function(_0x2d7ac5){_0x26bbc7[_0x4e92('0x4b')]=_0x2d7ac5;return _0x26bbc7;})[_0x4e92('0x2b')](respondWithFilteredResult(_0x58b9ee,_0x3bccba))[_0x4e92('0x4c')](handleError(_0x58b9ee,null));};exports['show']=function(_0x3a96eb,_0x553b5e){var _0x3b50da={'raw':![],'where':{'id':_0x3a96eb[_0x4e92('0x4d')]['id']}},_0x3ac9e7={};_0x3ac9e7[_0x4e92('0x37')]=_[_0x4e92('0x39')](db[_0x4e92('0x33')]['rawAttributes']);_0x3ac9e7['query']=_['keys'](_0x3a96eb[_0x4e92('0x38')]);_0x3ac9e7['filters']=_[_0x4e92('0x3a')](_0x3ac9e7['model'],_0x3ac9e7['query']);_0x3b50da[_0x4e92('0x3d')]=_['intersection'](_0x3ac9e7[_0x4e92('0x37')],qs[_0x4e92('0x3b')](_0x3a96eb['query'][_0x4e92('0x3b')]));_0x3b50da['attributes']=_0x3b50da[_0x4e92('0x3d')][_0x4e92('0x3c')]?_0x3b50da[_0x4e92('0x3d')]:_0x3ac9e7[_0x4e92('0x37')];if(_0x3a96eb[_0x4e92('0x38')][_0x4e92('0x4e')]){_0x3b50da[_0x4e92('0x49')]=[{'all':!![]}];}_0x3b50da=_[_0x4e92('0x48')]({},_0x3b50da,_0x3a96eb[_0x4e92('0x4f')]);return db['ZohoAccount'][_0x4e92('0x50')](_0x3b50da)[_0x4e92('0x2b')](handleEntityNotFound(_0x553b5e,null))[_0x4e92('0x2b')](respondWithResult(_0x553b5e,null))['catch'](handleError(_0x553b5e,null));};exports[_0x4e92('0x51')]=function(_0x4a64a2,_0x3ca2dd){return db[_0x4e92('0x33')][_0x4e92('0x51')](_0x4a64a2[_0x4e92('0x52')],{})[_0x4e92('0x2b')](respondWithResult(_0x3ca2dd,0xc9))[_0x4e92('0x4c')](handleError(_0x3ca2dd,null));};exports[_0x4e92('0x2a')]=function(_0xcf73eb,_0x289a14){if(_0xcf73eb[_0x4e92('0x52')]['id']){delete _0xcf73eb[_0x4e92('0x52')]['id'];}return db['ZohoAccount'][_0x4e92('0x50')]({'where':{'id':_0xcf73eb['params']['id']}})[_0x4e92('0x2b')](handleEntityNotFound(_0x289a14,null))[_0x4e92('0x2b')](saveUpdates(_0xcf73eb['body'],null))[_0x4e92('0x2b')](respondWithResult(_0x289a14,null))[_0x4e92('0x4c')](handleError(_0x289a14,null));};exports[_0x4e92('0x2c')]=function(_0x4f019c,_0x2b18){return db[_0x4e92('0x33')][_0x4e92('0x50')]({'where':{'id':_0x4f019c[_0x4e92('0x4d')]['id']}})[_0x4e92('0x2b')](handleEntityNotFound(_0x2b18,null))[_0x4e92('0x2b')](removeEntity(_0x2b18,null))[_0x4e92('0x4c')](handleError(_0x2b18,null));};exports[_0x4e92('0x53')]=function(_0x3ad1af,_0x187e63,_0x407615){var _0x14e75b={};var _0x4ca82f={};var _0x3c0472;var _0x4fe523;return db[_0x4e92('0x33')]['findOne']({'where':{'id':_0x3ad1af[_0x4e92('0x4d')]['id']}})[_0x4e92('0x2b')](handleEntityNotFound(_0x187e63,null))[_0x4e92('0x2b')](function(_0x17ea42){if(_0x17ea42){_0x3c0472=_0x17ea42;_0x4ca82f[_0x4e92('0x37')]=_[_0x4e92('0x39')](db[_0x4e92('0x54')][_0x4e92('0x34')]);_0x4ca82f[_0x4e92('0x38')]=_['keys'](_0x3ad1af[_0x4e92('0x38')]);_0x4ca82f[_0x4e92('0x44')]=_[_0x4e92('0x3a')](_0x4ca82f['model'],_0x4ca82f['query']);_0x14e75b[_0x4e92('0x3d')]=_[_0x4e92('0x3a')](_0x4ca82f[_0x4e92('0x37')],qs[_0x4e92('0x3b')](_0x3ad1af[_0x4e92('0x38')]['fields']));_0x14e75b[_0x4e92('0x3d')]=_0x14e75b[_0x4e92('0x3d')]['length']?_0x14e75b[_0x4e92('0x3d')]:_0x4ca82f[_0x4e92('0x37')];_0x14e75b[_0x4e92('0x41')]=qs[_0x4e92('0x42')](_0x3ad1af[_0x4e92('0x38')][_0x4e92('0x42')]);_0x14e75b[_0x4e92('0x43')]=qs[_0x4e92('0x44')](_[_0x4e92('0x45')](_0x3ad1af[_0x4e92('0x38')],_0x4ca82f[_0x4e92('0x44')]));if(_0x3ad1af['query'][_0x4e92('0x46')]){_0x14e75b[_0x4e92('0x43')]=_[_0x4e92('0x48')](_0x14e75b[_0x4e92('0x43')],{'$or':_[_0x4e92('0x32')](_0x14e75b['attributes'],function(_0x42d874){var _0x3ed37b={};_0x3ed37b[_0x42d874]={'$like':'%'+_0x3ad1af['query']['filter']+'%'};return _0x3ed37b;})});}_0x14e75b=_[_0x4e92('0x48')]({},_0x14e75b,_0x3ad1af[_0x4e92('0x4f')]);return _0x3c0472[_0x4e92('0x53')](_0x14e75b);}})[_0x4e92('0x2b')](function(_0x19c132){if(_0x19c132){_0x4fe523=_0x19c132['length'];if(!_0x3ad1af['query'][_0x4e92('0x3e')](_0x4e92('0x3f'))){_0x14e75b[_0x4e92('0x23')]=qs['limit'](_0x3ad1af[_0x4e92('0x38')][_0x4e92('0x23')]);_0x14e75b[_0x4e92('0x40')]=qs['offset'](_0x3ad1af[_0x4e92('0x38')][_0x4e92('0x40')]);}return _0x3c0472[_0x4e92('0x53')](_0x14e75b);}})[_0x4e92('0x2b')](function(_0x29fd2c){if(_0x29fd2c){return _0x29fd2c?{'count':_0x4fe523,'rows':_0x29fd2c}:null;}})[_0x4e92('0x2b')](respondWithResult(_0x187e63,null))[_0x4e92('0x4c')](handleError(_0x187e63,null));};exports[_0x4e92('0x55')]=function(_0x1bb0db,_0x21dc71,_0x47cc9b){if(_0x1bb0db[_0x4e92('0x52')]['id']){delete _0x1bb0db[_0x4e92('0x52')]['id'];}return db[_0x4e92('0x33')][_0x4e92('0x56')]({'where':{'id':_0x1bb0db[_0x4e92('0x4d')]['id']}})[_0x4e92('0x2b')](handleEntityNotFound(_0x21dc71,null))['then'](function(_0x505cce){if(_0x505cce){_0x1bb0db[_0x4e92('0x52')]['AccountId']=_0x505cce['id'];_0x1bb0db[_0x4e92('0x52')]['Subjects']=integrations[_0x4e92('0x57')](_0x1bb0db['body'][_0x4e92('0x58')],_0x1bb0db[_0x4e92('0x52')]['type']);_0x1bb0db[_0x4e92('0x52')]['Descriptions']=integrations['getDescriptions'](_0x1bb0db[_0x4e92('0x52')][_0x4e92('0x58')],_0x1bb0db[_0x4e92('0x52')][_0x4e92('0x36')]);return db['ZohoConfiguration'][_0x4e92('0x51')](_0x1bb0db['body'],{'include':[{'model':db[_0x4e92('0x59')],'as':_0x4e92('0x5a')},{'model':db[_0x4e92('0x59')],'as':_0x4e92('0x5b')}]});}return null;})['then'](respondWithResult(_0x21dc71,null))[_0x4e92('0x4c')](handleError(_0x21dc71,null));};function getAccessToken(_0x253784){return new Promise(function(_0x16f414,_0xa65d39){var _0x168f35;switch(_0x253784[_0x4e92('0x5c')]){case'US':_0x168f35=_0x4e92('0x5d');break;case'AU':_0x168f35=_0x4e92('0x5e');break;case'EU':_0x168f35=_0x4e92('0x5f');break;case'IN':_0x168f35='https://accounts.zoho.in';break;case'CN':_0x168f35='https://accounts.zoho.com.cn';break;default:_0x168f35=_0x4e92('0x5f');break;}var _0x2b8761={'method':_0x4e92('0x60'),'uri':_0x168f35+_0x4e92('0x61'),'qs':{'refresh_token':_0x253784['refreshToken'],'client_id':_0x253784[_0x4e92('0x62')],'client_secret':_0x253784[_0x4e92('0x63')],'grant_type':_0x4e92('0x64')},'json':!![]};return rp(_0x2b8761)['then'](function(_0x55861f){if(_0x55861f[_0x4e92('0x65')]){_0x16f414(_0x55861f[_0x4e92('0x65')]);}else{_0xa65d39(_0x4e92('0x66'));}})[_0x4e92('0x4c')](function(_0x4c3707){_0xa65d39(_0x4c3707);});});}exports[_0x4e92('0x67')]=function(_0x365f59,_0xe63887,_0x578123){var _0x1ff39d,_0x23c6b5,_0x3c8716,_0x288764,_0x35e0e9;return db[_0x4e92('0x33')][_0x4e92('0x56')]({'where':{'id':_0x365f59[_0x4e92('0x4d')]['id']},'attributes':['id',_0x4e92('0x68'),'zone',_0x4e92('0x62'),'clientSecret',_0x4e92('0x69'),'code',_0x4e92('0x6a')]})[_0x4e92('0x2b')](handleEntityNotFound(_0xe63887,null))[_0x4e92('0x2b')](function(_0x33ca6f){_0x35e0e9=_0x33ca6f;_0x1ff39d=_0x35e0e9[_0x4e92('0x68')];_0x23c6b5=_0x1ff39d===_0x4e92('0x6b')?'eu':_0x4e92('0x6c');_0x3c8716=_0x35e0e9[_0x4e92('0x69')];var _0x1829bd=_0x3c8716[_0x4e92('0x6d')](-0x1);if(_0x1829bd==='/'||_0x1829bd==='\x5c'||_0x1829bd===':'){_0x3c8716=_0x3c8716[_0x4e92('0x6e')](0x0,_0x3c8716[_0x4e92('0x6f')](_0x1829bd));}if(!_0x35e0e9[_0x4e92('0x6a')]){throw new Error(_0x4e92('0x70'));}return getAccessToken(_0x35e0e9);})[_0x4e92('0x2b')](function(_0x5dc31c){if(_0x5dc31c){return rp({'method':_0x4e92('0x71'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x23c6b5),'qs':{'module':'Calls'},'headers':{'Authorization':_0x4e92('0x72')+_0x5dc31c},'json':!![]});}})[_0x4e92('0x2b')](function(_0x101993){if(_0x101993){if(_0x101993[_0x4e92('0x73')]&&_0x101993['response']['error']){throw new Error(_0x101993['response'][_0x4e92('0x2d')]['message']);}var _0x2fe593=[];var _0x9a065=[];var _0x416cdf=['Owner','Subject','Description',_0x4e92('0x74'),_0x4e92('0x75'),_0x4e92('0x76'),_0x4e92('0x77'),_0x4e92('0x78')];_0x9a065=_[_0x4e92('0x79')](_0x101993[_0x4e92('0x3b')],function(_0x475a77){return _0x416cdf[_0x4e92('0x7a')](_0x475a77[_0x4e92('0x7b')]);});for(var _0x584d23=0x0;_0x584d23<_0x9a065['length'];_0x584d23++){if(_0x9a065[_0x584d23]['system_mandatory']===![]){_0x2fe593[_0x4e92('0x7c')]({'id':_0x9a065[_0x584d23]['id'],'name':_0x9a065[_0x584d23]['display_label'],'custom':_0x9a065[_0x584d23]['custom_field'],'options':_0x9a065[_0x584d23][_0x4e92('0x7d')]===_0x4e92('0x7e')&&_0x9a065[_0x584d23][_0x4e92('0x7f')][_0x4e92('0x3c')]>-0x1?_['map'](_0x9a065[_0x584d23]['pick_list_values'],function(_0x1fb8da){return{'name':_0x1fb8da,'value':_0x1fb8da};}):[]});}}return{'count':_0x2fe593['length'],'rows':_0x2fe593};}else{return{'count':0x0,'rows':[]};}})[_0x4e92('0x2b')](respondWithResult(_0xe63887,null))[_0x4e92('0x4c')](function(_0x15bcf9){var _0x1e9a64=_0x365f59[_0x4e92('0x38')]['test']?0x1f4:_0x15bcf9[_0x4e92('0x80')]||0x1f4;logger[_0x4e92('0x2d')]('getFields,\x20%s,\x20%s,\x20%s',_0x4e92('0x67'),_0x1e9a64,JSON[_0x4e92('0x81')](_0x15bcf9));delete _0x15bcf9['name'];if(_0x1e9a64===0x191){_0x1e9a64=0x190;}_0xe63887['status'](_0x1e9a64)[_0x4e92('0x30')](_0x365f59[_0x4e92('0x38')][_0x4e92('0x82')]?{'message':'Wrong\x20credentials','statusCode':_0x15bcf9[_0x4e92('0x80')]}:_0x15bcf9);});};
\ No newline at end of file
index f61694b..b022b58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b4c=['inspect','catch','host','lastIndexOf','https://accounts.zoho.com.au','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','changed','zone','serverUrl','clientId','clientSecret','slice','substring','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','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(_0x187364,_0x15afed){var _0x499623=function(_0x38ee53){while(--_0x38ee53){_0x187364['push'](_0x187364['shift']());}};_0x499623(++_0x15afed);}(_0x9b4c,0x1a9));var _0xc9b4=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0x9b4c[_0x4ac60a];return _0x4b22e8;};'use strict';var _=require(_0xc9b4('0x0'));var util=require(_0xc9b4('0x1'));var logger=require(_0xc9b4('0x2'))(_0xc9b4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc9b4('0x4'));var fs=require('fs');var path=require(_0xc9b4('0x5'));var rimraf=require(_0xc9b4('0x6'));var config=require(_0xc9b4('0x7'));var attributes=require(_0xc9b4('0x8'));var integrations=require(_0xc9b4('0x9'));module[_0xc9b4('0xa')]=function(_0x108fc0,_0x275415){return _0x108fc0['define']('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5cf549,_0x1c1a18,_0x42be57){if(_0x5cf549[_0xc9b4('0xb')](_0xc9b4('0xc'))||_0x5cf549[_0xc9b4('0xb')](_0xc9b4('0xd'))||_0x5cf549[_0xc9b4('0xb')](_0xc9b4('0xe'))||_0x5cf549[_0xc9b4('0xb')](_0xc9b4('0xf'))||_0x5cf549['changed']('code')||_0x5cf549[_0xc9b4('0xb')]('host')){var _0x416d15,_0x2a48dd;_0x416d15=_0x5cf549[_0xc9b4('0xd')];var _0x17c4d2=_0x416d15[_0xc9b4('0x10')](-0x1);if(_0x17c4d2==='/'||_0x17c4d2==='\x5c'||_0x17c4d2===':'){_0x416d15=_0x416d15[_0xc9b4('0x11')](0x0,_0x416d15['lastIndexOf'](_0x17c4d2));}switch(_0x5cf549[_0xc9b4('0xc')]){case'US':_0x2a48dd=_0xc9b4('0x12');break;case'AU':_0x2a48dd='https://accounts.zoho.com.au';break;case'IN':_0x2a48dd=_0xc9b4('0x13');break;case'CN':_0x2a48dd=_0xc9b4('0x14');break;default:_0x2a48dd=_0xc9b4('0x15');break;}var _0x2d1f28={'method':_0xc9b4('0x16'),'uri':_0x2a48dd+_0xc9b4('0x17'),'form':{'grant_type':_0xc9b4('0x18'),'client_id':_0x5cf549[_0xc9b4('0xe')],'client_secret':_0x5cf549[_0xc9b4('0xf')],'redirect_uri':_0x5cf549[_0xc9b4('0xd')],'code':_0x5cf549[_0xc9b4('0x19')]},'headers':{'Content-Type':_0xc9b4('0x1a')}};return rp(_0x2d1f28)[_0xc9b4('0x1b')](function(_0x5e6c25){var _0x8218bd=JSON[_0xc9b4('0x1c')](_0x5e6c25);if(_0x8218bd[_0xc9b4('0x1d')]){_0x5cf549[_0xc9b4('0x1e')]=_0x8218bd[_0xc9b4('0x1d')];logger[_0xc9b4('0x1f')](util[_0xc9b4('0x20')](_0xc9b4('0x21'),_0x5cf549[_0xc9b4('0x22')],_0x5cf549['id']));}else{logger[_0xc9b4('0x23')](util['format'](_0xc9b4('0x24'),_0x5cf549['name'],_0x5cf549['id']),util[_0xc9b4('0x25')](_0x8218bd,{'showHidden':![],'depth':null}));}return _0x42be57(null,_0x1c1a18);})[_0xc9b4('0x26')](function(_0x5dfa14){logger[_0xc9b4('0x23')](util[_0xc9b4('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5cf549[_0xc9b4('0x22')],_0x5cf549['id']),util[_0xc9b4('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x42be57(_0x5dfa14);});}else{return _0x42be57(null,_0x1c1a18);}},'beforeUpdate':function(_0x107ba2,_0x16d24d,_0x4e152e){if(_0x107ba2['changed'](_0xc9b4('0xc'))||_0x107ba2[_0xc9b4('0xb')](_0xc9b4('0xd'))||_0x107ba2['changed'](_0xc9b4('0xe'))||_0x107ba2[_0xc9b4('0xb')](_0xc9b4('0xf'))||_0x107ba2[_0xc9b4('0xb')](_0xc9b4('0x19'))||_0x107ba2[_0xc9b4('0xb')](_0xc9b4('0x27'))){var _0x5582dd,_0x4c796e;_0x5582dd=_0x107ba2[_0xc9b4('0xd')];var _0x32c300=_0x5582dd[_0xc9b4('0x10')](-0x1);if(_0x32c300==='/'||_0x32c300==='\x5c'||_0x32c300===':'){_0x5582dd=_0x5582dd['substring'](0x0,_0x5582dd[_0xc9b4('0x28')](_0x32c300));}switch(_0x107ba2[_0xc9b4('0xc')]){case'US':_0x4c796e=_0xc9b4('0x12');break;case'AU':_0x4c796e=_0xc9b4('0x29');break;case'IN':_0x4c796e='https://accounts.zoho.in';break;case'CN':_0x4c796e=_0xc9b4('0x14');break;default:_0x4c796e=_0xc9b4('0x15');break;}var _0x59bf94={'method':_0xc9b4('0x16'),'uri':_0x4c796e+_0xc9b4('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x107ba2['clientId'],'client_secret':_0x107ba2[_0xc9b4('0xf')],'redirect_uri':_0x107ba2[_0xc9b4('0xd')],'code':_0x107ba2[_0xc9b4('0x19')]},'headers':{'Content-Type':_0xc9b4('0x1a')}};return rp(_0x59bf94)[_0xc9b4('0x1b')](function(_0x55131e){var _0x224c95=JSON[_0xc9b4('0x1c')](_0x55131e);if(_0x224c95[_0xc9b4('0x1d')]){_0x107ba2[_0xc9b4('0x1e')]=_0x224c95[_0xc9b4('0x1d')];logger['info'](util[_0xc9b4('0x20')](_0xc9b4('0x21'),_0x107ba2['name'],_0x107ba2['id']));}else{logger[_0xc9b4('0x23')](util[_0xc9b4('0x20')](_0xc9b4('0x24'),_0x107ba2[_0xc9b4('0x22')],_0x107ba2['id']),util[_0xc9b4('0x25')](_0x224c95,{'showHidden':![],'depth':null}));}return _0x4e152e(null,_0x16d24d);})[_0xc9b4('0x26')](function(_0x329371){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x107ba2[_0xc9b4('0x22')],_0x107ba2['id']),util[_0xc9b4('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4e152e(_0x329371);});}else{return _0x4e152e(null,_0x16d24d);}}}});};
\ No newline at end of file
+var _0x2dbb=['substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','clientId','host','https://accounts.zoho.com','POST','refreshToken','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','slice'];(function(_0x1b6117,_0x39f1e5){var _0x8fa76c=function(_0x48a464){while(--_0x48a464){_0x1b6117['push'](_0x1b6117['shift']());}};_0x8fa76c(++_0x39f1e5);}(_0x2dbb,0x170));var _0xb2db=function(_0x3dc341,_0x20e830){_0x3dc341=_0x3dc341-0x0;var _0x2bb254=_0x2dbb[_0x3dc341];return _0x2bb254;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb2db('0x0'));var moment=require(_0xb2db('0x1'));var BPromise=require(_0xb2db('0x2'));var rp=require(_0xb2db('0x3'));var fs=require('fs');var path=require(_0xb2db('0x4'));var rimraf=require(_0xb2db('0x5'));var config=require(_0xb2db('0x6'));var attributes=require(_0xb2db('0x7'));var integrations=require(_0xb2db('0x8'));module[_0xb2db('0x9')]=function(_0xf4ea2,_0x358735){return _0xf4ea2[_0xb2db('0xa')](_0xb2db('0xb'),attributes,{'tableName':_0xb2db('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2f0d99,_0x127bfa,_0x2a401e){if(_0x2f0d99[_0xb2db('0xd')](_0xb2db('0xe'))||_0x2f0d99[_0xb2db('0xd')](_0xb2db('0xf'))||_0x2f0d99[_0xb2db('0xd')]('clientId')||_0x2f0d99[_0xb2db('0xd')](_0xb2db('0x10'))||_0x2f0d99[_0xb2db('0xd')](_0xb2db('0x11'))||_0x2f0d99[_0xb2db('0xd')]('host')){var _0x212cef,_0x2fa457;_0x212cef=_0x2f0d99['serverUrl'];var _0x38ed61=_0x212cef[_0xb2db('0x12')](-0x1);if(_0x38ed61==='/'||_0x38ed61==='\x5c'||_0x38ed61===':'){_0x212cef=_0x212cef[_0xb2db('0x13')](0x0,_0x212cef[_0xb2db('0x14')](_0x38ed61));}switch(_0x2f0d99[_0xb2db('0xe')]){case'US':_0x2fa457='https://accounts.zoho.com';break;case'AU':_0x2fa457=_0xb2db('0x15');break;case'IN':_0x2fa457=_0xb2db('0x16');break;case'CN':_0x2fa457=_0xb2db('0x17');break;default:_0x2fa457=_0xb2db('0x18');break;}var _0x1135b4={'method':'POST','uri':_0x2fa457+_0xb2db('0x19'),'form':{'grant_type':_0xb2db('0x1a'),'client_id':_0x2f0d99['clientId'],'client_secret':_0x2f0d99[_0xb2db('0x10')],'redirect_uri':_0x2f0d99[_0xb2db('0xf')],'code':_0x2f0d99[_0xb2db('0x11')]},'headers':{'Content-Type':_0xb2db('0x1b')}};return rp(_0x1135b4)[_0xb2db('0x1c')](function(_0xa8fe43){var _0x5c3605=JSON[_0xb2db('0x1d')](_0xa8fe43);if(_0x5c3605[_0xb2db('0x1e')]){_0x2f0d99['refreshToken']=_0x5c3605['refresh_token'];logger[_0xb2db('0x1f')](util[_0xb2db('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2f0d99[_0xb2db('0x21')],_0x2f0d99['id']));}else{logger[_0xb2db('0x22')](util[_0xb2db('0x20')](_0xb2db('0x23'),_0x2f0d99[_0xb2db('0x21')],_0x2f0d99['id']),util['inspect'](_0x5c3605,{'showHidden':![],'depth':null}));}return _0x2a401e(null,_0x127bfa);})[_0xb2db('0x24')](function(_0x1826b9){logger[_0xb2db('0x22')](util['format'](_0xb2db('0x23'),_0x2f0d99['name'],_0x2f0d99['id']),util[_0xb2db('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x2a401e(_0x1826b9);});}else{return _0x2a401e(null,_0x127bfa);}},'beforeUpdate':function(_0x1d325b,_0x52bc27,_0x166b06){if(_0x1d325b['changed'](_0xb2db('0xe'))||_0x1d325b[_0xb2db('0xd')](_0xb2db('0xf'))||_0x1d325b[_0xb2db('0xd')](_0xb2db('0x26'))||_0x1d325b['changed'](_0xb2db('0x10'))||_0x1d325b['changed']('code')||_0x1d325b[_0xb2db('0xd')](_0xb2db('0x27'))){var _0x578cd6,_0x28f9f6;_0x578cd6=_0x1d325b[_0xb2db('0xf')];var _0x5886f1=_0x578cd6[_0xb2db('0x12')](-0x1);if(_0x5886f1==='/'||_0x5886f1==='\x5c'||_0x5886f1===':'){_0x578cd6=_0x578cd6[_0xb2db('0x13')](0x0,_0x578cd6['lastIndexOf'](_0x5886f1));}switch(_0x1d325b['zone']){case'US':_0x28f9f6=_0xb2db('0x28');break;case'AU':_0x28f9f6=_0xb2db('0x15');break;case'IN':_0x28f9f6='https://accounts.zoho.in';break;case'CN':_0x28f9f6=_0xb2db('0x17');break;default:_0x28f9f6=_0xb2db('0x18');break;}var _0x147be5={'method':_0xb2db('0x29'),'uri':_0x28f9f6+_0xb2db('0x19'),'form':{'grant_type':_0xb2db('0x1a'),'client_id':_0x1d325b[_0xb2db('0x26')],'client_secret':_0x1d325b[_0xb2db('0x10')],'redirect_uri':_0x1d325b[_0xb2db('0xf')],'code':_0x1d325b[_0xb2db('0x11')]},'headers':{'Content-Type':_0xb2db('0x1b')}};return rp(_0x147be5)[_0xb2db('0x1c')](function(_0x2c5aa2){var _0x52d867=JSON[_0xb2db('0x1d')](_0x2c5aa2);if(_0x52d867[_0xb2db('0x1e')]){_0x1d325b[_0xb2db('0x2a')]=_0x52d867[_0xb2db('0x1e')];logger[_0xb2db('0x1f')](util[_0xb2db('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1d325b['name'],_0x1d325b['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1d325b['name'],_0x1d325b['id']),util[_0xb2db('0x25')](_0x52d867,{'showHidden':![],'depth':null}));}return _0x166b06(null,_0x52bc27);})[_0xb2db('0x24')](function(_0x5bc4eb){logger['error'](util[_0xb2db('0x20')](_0xb2db('0x23'),_0x1d325b[_0xb2db('0x21')],_0x1d325b['id']),util[_0xb2db('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x166b06(_0x5bc4eb);});}else{return _0x166b06(null,_0x52bc27);}}}});};
\ No newline at end of file
index 60565ed..1c4ed51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5226=['request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetZohoAccount','ShowZohoAccount','ZohoAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','ZohoAccount,\x20%s,\x20%s'];(function(_0x4090cd,_0x55a2f0){var _0x522fbe=function(_0x2e1c6c){while(--_0x2e1c6c){_0x4090cd['push'](_0x4090cd['shift']());}};_0x522fbe(++_0x55a2f0);}(_0x5226,0x137));var _0x6522=function(_0x387887,_0x49711f){_0x387887=_0x387887-0x0;var _0x428428=_0x5226[_0x387887];return _0x428428;};'use strict';var _=require(_0x6522('0x0'));var util=require(_0x6522('0x1'));var moment=require(_0x6522('0x2'));var BPromise=require(_0x6522('0x3'));var rs=require(_0x6522('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6522('0x5'))['db'];var utils=require(_0x6522('0x6'));var logger=require(_0x6522('0x7'))('rpc');var config=require(_0x6522('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6522('0x9')][_0x6522('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x183be8,_0x17c139,_0x6efdb7){return new BPromise(function(_0x2dbe49,_0x318dc1){return client['request'](_0x183be8,_0x6efdb7)['then'](function(_0x2ff0e0){logger[_0x6522('0xb')](_0x6522('0xc'),_0x17c139,_0x6522('0xd'));logger[_0x6522('0xe')](_0x6522('0xf'),_0x17c139,_0x6522('0xd'),JSON[_0x6522('0x10')](_0x2ff0e0));if(_0x2ff0e0[_0x6522('0x11')]){if(_0x2ff0e0[_0x6522('0x11')][_0x6522('0x12')]===0x1f4){logger[_0x6522('0x11')](_0x6522('0xc'),_0x17c139,_0x2ff0e0['error'][_0x6522('0x13')]);return _0x318dc1(_0x2ff0e0[_0x6522('0x11')][_0x6522('0x13')]);}logger[_0x6522('0x11')](_0x6522('0xc'),_0x17c139,_0x2ff0e0['error'][_0x6522('0x13')]);return _0x2dbe49(_0x2ff0e0[_0x6522('0x11')][_0x6522('0x13')]);}else{logger[_0x6522('0xb')](_0x6522('0xc'),_0x17c139,_0x6522('0xd'));_0x2dbe49(_0x2ff0e0[_0x6522('0x14')][_0x6522('0x13')]);}})[_0x6522('0x15')](function(_0x2de2e5){logger[_0x6522('0x11')](_0x6522('0xc'),_0x17c139,_0x2de2e5);_0x318dc1(_0x2de2e5);});});}exports['GetZohoAccount']=function(_0x6f0909){var _0x1edcb6=this;return new Promise(function(_0x2bb08c,_0x368dd1){return db['ZohoAccount'][_0x6522('0x16')]({'raw':_0x6f0909[_0x6522('0x17')]?_0x6f0909['options'][_0x6522('0x18')]===undefined?!![]:![]:!![],'where':_0x6f0909['options']?_0x6f0909[_0x6522('0x17')][_0x6522('0x19')]||null:null,'attributes':_0x6f0909[_0x6522('0x17')]?_0x6f0909[_0x6522('0x17')][_0x6522('0x1a')]||null:null,'limit':_0x6f0909[_0x6522('0x17')]?_0x6f0909['options'][_0x6522('0x1b')]||null:null,'include':_0x6f0909[_0x6522('0x17')]?_0x6f0909[_0x6522('0x17')][_0x6522('0x1c')]?_[_0x6522('0x1d')](_0x6f0909[_0x6522('0x17')]['include'],function(_0x11ed35){return{'model':db[_0x11ed35[_0x6522('0x1e')]],'as':_0x11ed35['as'],'attributes':_0x11ed35[_0x6522('0x1a')],'include':_0x11ed35[_0x6522('0x1c')]?_['map'](_0x11ed35['include'],function(_0x263d7d){return{'model':db[_0x263d7d[_0x6522('0x1e')]],'as':_0x263d7d['as'],'attributes':_0x263d7d[_0x6522('0x1a')],'include':_0x263d7d[_0x6522('0x1c')]?_['map'](_0x263d7d[_0x6522('0x1c')],function(_0x1af303){return{'model':db[_0x1af303['model']],'as':_0x1af303['as'],'attributes':_0x1af303[_0x6522('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6522('0x1f')](function(_0x23dc77){logger[_0x6522('0xb')]('GetZohoAccount',_0x6f0909);logger[_0x6522('0xe')](_0x6522('0x20'),_0x6f0909,JSON[_0x6522('0x10')](_0x23dc77));_0x2bb08c(_0x23dc77);})[_0x6522('0x15')](function(_0x13a851){logger[_0x6522('0x11')](_0x6522('0x20'),_0x13a851[_0x6522('0x13')],_0x6f0909);_0x368dd1(_0x1edcb6[_0x6522('0x11')](0x1f4,_0x13a851[_0x6522('0x13')]));});});};exports[_0x6522('0x21')]=function(_0x2c2e97){var _0x4c4d29=this;return new Promise(function(_0x1cb044,_0x1164a4){return db[_0x6522('0x22')][_0x6522('0x23')]({'raw':_0x2c2e97[_0x6522('0x17')]?_0x2c2e97[_0x6522('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2c2e97[_0x6522('0x17')]?_0x2c2e97[_0x6522('0x17')][_0x6522('0x19')]||null:null,'attributes':_0x2c2e97[_0x6522('0x17')]?_0x2c2e97[_0x6522('0x17')][_0x6522('0x1a')]||null:null,'include':_0x2c2e97[_0x6522('0x17')]?_0x2c2e97[_0x6522('0x17')][_0x6522('0x1c')]?_[_0x6522('0x1d')](_0x2c2e97[_0x6522('0x17')][_0x6522('0x1c')],function(_0xb0b612){return{'model':db[_0xb0b612['model']],'as':_0xb0b612['as'],'attributes':_0xb0b612['attributes'],'include':_0xb0b612['include']?_[_0x6522('0x1d')](_0xb0b612[_0x6522('0x1c')],function(_0x28cafc){return{'model':db[_0x28cafc[_0x6522('0x1e')]],'as':_0x28cafc['as'],'attributes':_0x28cafc[_0x6522('0x1a')],'include':_0x28cafc[_0x6522('0x1c')]?_['map'](_0x28cafc[_0x6522('0x1c')],function(_0x409d32){return{'model':db[_0x409d32[_0x6522('0x1e')]],'as':_0x409d32['as'],'attributes':_0x409d32[_0x6522('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6522('0x1f')](function(_0x4ec7ab){logger['info']('ShowZohoAccount',_0x2c2e97);logger[_0x6522('0xe')](_0x6522('0x21'),_0x2c2e97,JSON['stringify'](_0x4ec7ab));_0x1cb044(_0x4ec7ab);})['catch'](function(_0xed4641){logger['error']('ShowZohoAccount',_0xed4641[_0x6522('0x13')],_0x2c2e97);_0x1164a4(_0x4c4d29[_0x6522('0x11')](0x1f4,_0xed4641[_0x6522('0x13')]));});});};
\ No newline at end of file
+var _0xb7e2=['catch','ZohoAccount','findAll','options','raw','include','map','model','attributes','GetZohoAccount','debug','ShowZohoAccount','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x50573d,_0xa927e4){var _0x3577a3=function(_0x249af2){while(--_0x249af2){_0x50573d['push'](_0x50573d['shift']());}};_0x3577a3(++_0xa927e4);}(_0xb7e2,0x103));var _0x2b7e=function(_0x23014b,_0x1db263){_0x23014b=_0x23014b-0x0;var _0x2aca87=_0xb7e2[_0x23014b];return _0x2aca87;};'use strict';var _=require(_0x2b7e('0x0'));var util=require('util');var moment=require(_0x2b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b7e('0x4'))(_0x2b7e('0x5'));var config=require(_0x2b7e('0x6'));var jayson=require(_0x2b7e('0x7'));var client=jayson[_0x2b7e('0x8')][_0x2b7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7a0b,_0xc23ec4,_0x45dc9f){return new BPromise(function(_0x10a31d,_0x49491c){return client[_0x2b7e('0xa')](_0x4d7a0b,_0x45dc9f)[_0x2b7e('0xb')](function(_0x2f5991){logger[_0x2b7e('0xc')](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');logger['debug'](_0x2b7e('0xe'),_0xc23ec4,_0x2b7e('0xf'),JSON[_0x2b7e('0x10')](_0x2f5991));if(_0x2f5991[_0x2b7e('0x11')]){if(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x12')]===0x1f4){logger[_0x2b7e('0x11')]('ZohoAccount,\x20%s,\x20%s',_0xc23ec4,_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);return _0x49491c(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0xc23ec4,_0x2f5991['error'][_0x2b7e('0x13')]);return _0x10a31d(_0x2f5991['error'][_0x2b7e('0x13')]);}else{logger['info'](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');_0x10a31d(_0x2f5991[_0x2b7e('0x14')][_0x2b7e('0x13')]);}})[_0x2b7e('0x15')](function(_0x4d85c3){logger[_0x2b7e('0x11')](_0x2b7e('0xd'),_0xc23ec4,_0x4d85c3);_0x49491c(_0x4d85c3);});});}exports['GetZohoAccount']=function(_0x16d389){var _0x33b038=this;return new Promise(function(_0x726509,_0x56d349){return db[_0x2b7e('0x16')][_0x2b7e('0x17')]({'raw':_0x16d389[_0x2b7e('0x18')]?_0x16d389[_0x2b7e('0x18')][_0x2b7e('0x19')]===undefined?!![]:![]:!![],'where':_0x16d389['options']?_0x16d389[_0x2b7e('0x18')]['where']||null:null,'attributes':_0x16d389['options']?_0x16d389[_0x2b7e('0x18')]['attributes']||null:null,'limit':_0x16d389[_0x2b7e('0x18')]?_0x16d389[_0x2b7e('0x18')]['limit']||null:null,'include':_0x16d389[_0x2b7e('0x18')]?_0x16d389['options'][_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x16d389['options']['include'],function(_0x3548e3){return{'model':db[_0x3548e3[_0x2b7e('0x1c')]],'as':_0x3548e3['as'],'attributes':_0x3548e3[_0x2b7e('0x1d')],'include':_0x3548e3[_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x3548e3[_0x2b7e('0x1a')],function(_0x41b68b){return{'model':db[_0x41b68b[_0x2b7e('0x1c')]],'as':_0x41b68b['as'],'attributes':_0x41b68b[_0x2b7e('0x1d')],'include':_0x41b68b[_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x41b68b[_0x2b7e('0x1a')],function(_0x19824e){return{'model':db[_0x19824e[_0x2b7e('0x1c')]],'as':_0x19824e['as'],'attributes':_0x19824e['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b7e('0xb')](function(_0x18dd64){logger[_0x2b7e('0xc')](_0x2b7e('0x1e'),_0x16d389);logger[_0x2b7e('0x1f')]('GetZohoAccount',_0x16d389,JSON[_0x2b7e('0x10')](_0x18dd64));_0x726509(_0x18dd64);})[_0x2b7e('0x15')](function(_0x5871ac){logger[_0x2b7e('0x11')]('GetZohoAccount',_0x5871ac[_0x2b7e('0x13')],_0x16d389);_0x56d349(_0x33b038['error'](0x1f4,_0x5871ac[_0x2b7e('0x13')]));});});};exports[_0x2b7e('0x20')]=function(_0x1f6c89){var _0xfbac54=this;return new Promise(function(_0x54adce,_0xa78818){return db[_0x2b7e('0x16')][_0x2b7e('0x21')]({'raw':_0x1f6c89[_0x2b7e('0x18')]?_0x1f6c89[_0x2b7e('0x18')][_0x2b7e('0x19')]===undefined?!![]:![]:!![],'where':_0x1f6c89[_0x2b7e('0x18')]?_0x1f6c89['options'][_0x2b7e('0x22')]||null:null,'attributes':_0x1f6c89[_0x2b7e('0x18')]?_0x1f6c89[_0x2b7e('0x18')]['attributes']||null:null,'include':_0x1f6c89['options']?_0x1f6c89[_0x2b7e('0x18')][_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x1f6c89[_0x2b7e('0x18')][_0x2b7e('0x1a')],function(_0x1ce9d4){return{'model':db[_0x1ce9d4[_0x2b7e('0x1c')]],'as':_0x1ce9d4['as'],'attributes':_0x1ce9d4['attributes'],'include':_0x1ce9d4[_0x2b7e('0x1a')]?_[_0x2b7e('0x1b')](_0x1ce9d4[_0x2b7e('0x1a')],function(_0xd97f2a){return{'model':db[_0xd97f2a[_0x2b7e('0x1c')]],'as':_0xd97f2a['as'],'attributes':_0xd97f2a['attributes'],'include':_0xd97f2a[_0x2b7e('0x1a')]?_['map'](_0xd97f2a['include'],function(_0x2b11f2){return{'model':db[_0x2b11f2['model']],'as':_0x2b11f2['as'],'attributes':_0x2b11f2[_0x2b7e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3793c1){logger['info'](_0x2b7e('0x20'),_0x1f6c89);logger[_0x2b7e('0x1f')](_0x2b7e('0x20'),_0x1f6c89,JSON['stringify'](_0x3793c1));_0x54adce(_0x3793c1);})[_0x2b7e('0x15')](function(_0x2b6f0d){logger[_0x2b7e('0x11')]('ShowZohoAccount',_0x2b6f0d['message'],_0x1f6c89);_0xa78818(_0xfbac54['error'](0x1f4,_0x2b6f0d[_0x2b7e('0x13')]));});});};
\ No newline at end of file
index f7a2bd5..5e628d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4322=['getSubjects','/:id/descriptions','getDescriptions','create','put','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0x4322,0x148));var _0x2432=function(_0x38cb4c,_0x5964d1){_0x38cb4c=_0x38cb4c-0x0;var _0x228e90=_0x4322[_0x38cb4c];return _0x228e90;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2432('0x0'));var express=require(_0x2432('0x1'));var router=express[_0x2432('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2432('0x3'));var interaction=require(_0x2432('0x4'));var config=require(_0x2432('0x5'));var controller=require('./intZohoConfiguration.controller');router[_0x2432('0x6')]('/',auth[_0x2432('0x7')](),controller['index']);router[_0x2432('0x6')](_0x2432('0x8'),auth[_0x2432('0x7')](),controller['show']);router[_0x2432('0x6')](_0x2432('0x9'),auth[_0x2432('0x7')](),controller[_0x2432('0xa')]);router[_0x2432('0x6')](_0x2432('0xb'),auth[_0x2432('0x7')](),controller[_0x2432('0xc')]);router['get'](_0x2432('0xd'),auth[_0x2432('0x7')](),controller[_0x2432('0xe')]);router['post']('/',auth[_0x2432('0x7')](),controller[_0x2432('0xf')]);router[_0x2432('0x10')]('/:id',auth[_0x2432('0x7')](),controller['update']);router[_0x2432('0x11')]('/:id',auth[_0x2432('0x7')](),controller[_0x2432('0x12')]);module[_0x2432('0x13')]=router;
\ No newline at end of file
+var _0xee42=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller'];(function(_0x2b0bf3,_0x70a88a){var _0x264f52=function(_0x1a355c){while(--_0x1a355c){_0x2b0bf3['push'](_0x2b0bf3['shift']());}};_0x264f52(++_0x70a88a);}(_0xee42,0x123));var _0x2ee4=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xee42[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0x2ee4('0x0'));var util=require(_0x2ee4('0x1'));var path=require(_0x2ee4('0x2'));var timeout=require(_0x2ee4('0x3'));var express=require('express');var router=express[_0x2ee4('0x4')]();var fs_extra=require(_0x2ee4('0x5'));var auth=require(_0x2ee4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ee4('0x7'));var controller=require(_0x2ee4('0x8'));router[_0x2ee4('0x9')]('/',auth[_0x2ee4('0xa')](),controller[_0x2ee4('0xb')]);router[_0x2ee4('0x9')](_0x2ee4('0xc'),auth[_0x2ee4('0xa')](),controller[_0x2ee4('0xd')]);router['get'](_0x2ee4('0xe'),auth['isAuthenticated'](),controller[_0x2ee4('0xf')]);router[_0x2ee4('0x9')](_0x2ee4('0x10'),auth[_0x2ee4('0xa')](),controller[_0x2ee4('0x11')]);router[_0x2ee4('0x9')]('/:id/descriptions',auth[_0x2ee4('0xa')](),controller[_0x2ee4('0x12')]);router['post']('/',auth[_0x2ee4('0xa')](),controller[_0x2ee4('0x13')]);router[_0x2ee4('0x14')](_0x2ee4('0xc'),auth[_0x2ee4('0xa')](),controller[_0x2ee4('0x15')]);router[_0x2ee4('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x2ee4('0x17')]);module[_0x2ee4('0x18')]=router;
\ No newline at end of file
index 8c63fab..5a11967 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a1=['ENUM','lead','contact','nothing','contact_lead','sequelize','exports','STRING'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0x98a1,0x10d));var _0x198a=function(_0x25d151,_0x5955d9){_0x25d151=_0x25d151-0x0;var _0xb90d8a=_0x98a1[_0x25d151];return _0xb90d8a;};'use strict';var Sequelize=require(_0x198a('0x0'));module[_0x198a('0x1')]={'name':{'type':Sequelize[_0x198a('0x2')]},'moduleCreate':{'type':Sequelize[_0x198a('0x3')](_0x198a('0x4'),_0x198a('0x5'),_0x198a('0x6')),'defaultValue':_0x198a('0x4')},'moduleSearch':{'type':Sequelize[_0x198a('0x3')]('contact_lead','contact',_0x198a('0x4')),'defaultValue':_0x198a('0x7')},'description':{'type':Sequelize[_0x198a('0x2')]}};
\ No newline at end of file
+var _0x28c8=['exports','contact','nothing','lead','contact_lead'];(function(_0x3ec6b0,_0x16fc5f){var _0x3efe36=function(_0x49b871){while(--_0x49b871){_0x3ec6b0['push'](_0x3ec6b0['shift']());}};_0x3efe36(++_0x16fc5f);}(_0x28c8,0x127));var _0x828c=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x28c8[_0x238671];return _0x474844;};'use strict';var Sequelize=require('sequelize');module[_0x828c('0x0')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x828c('0x1'),_0x828c('0x2')),'defaultValue':_0x828c('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x828c('0x4'),_0x828c('0x1'),'lead'),'defaultValue':_0x828c('0x4')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 8d2c841..845eb4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9978=['catch','params','rawAttributes','find','create','body','getFields','ZohoField','pick','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','then','destroy','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','ZohoConfiguration','findAll','rows'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x9978,0x154));var _0x8997=function(_0x28d8bd,_0x2a9333){_0x28d8bd=_0x28d8bd-0x0;var _0x4eacd4=_0x9978[_0x28d8bd];return _0x4eacd4;};'use strict';var emlformat=require(_0x8997('0x0'));var rimraf=require(_0x8997('0x1'));var zipdir=require(_0x8997('0x2'));var jsonpatch=require(_0x8997('0x3'));var rp=require(_0x8997('0x4'));var moment=require(_0x8997('0x5'));var BPromise=require(_0x8997('0x6'));var Mustache=require(_0x8997('0x7'));var util=require('util');var path=require(_0x8997('0x8'));var sox=require(_0x8997('0x9'));var csv=require(_0x8997('0xa'));var ejs=require(_0x8997('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8997('0xc'));var squel=require(_0x8997('0xd'));var crypto=require(_0x8997('0xe'));var jsforce=require(_0x8997('0xf'));var deskjs=require(_0x8997('0x10'));var toCsv=require(_0x8997('0xa'));var querystring=require(_0x8997('0x11'));var Papa=require(_0x8997('0x12'));var Redis=require(_0x8997('0x13'));var authService=require(_0x8997('0x14'));var qs=require(_0x8997('0x15'));var as=require(_0x8997('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8997('0x17'))(_0x8997('0x18'));var utils=require(_0x8997('0x19'));var config=require(_0x8997('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x8997('0x1b'))['db'];function respondWithStatusCode(_0x2385a7,_0xd96227){_0xd96227=_0xd96227||0xcc;return function(_0x1bd486){if(_0x1bd486){return _0x2385a7[_0x8997('0x1c')](_0xd96227);}return _0x2385a7[_0x8997('0x1d')](_0xd96227)[_0x8997('0x1e')]();};}function respondWithResult(_0x2155a0,_0x58bbdd){_0x58bbdd=_0x58bbdd||0xc8;return function(_0x432d58){if(_0x432d58){return _0x2155a0[_0x8997('0x1d')](_0x58bbdd)[_0x8997('0x1f')](_0x432d58);}};}function respondWithFilteredResult(_0x28c391,_0x3aba5d){return function(_0x165cae){if(_0x165cae){var _0x236fa1=typeof _0x3aba5d[_0x8997('0x20')]===_0x8997('0x21')&&typeof _0x3aba5d['limit']===_0x8997('0x21');var _0x2ddde4=_0x165cae[_0x8997('0x22')];var _0x5aff76=_0x236fa1?0x0:_0x3aba5d[_0x8997('0x20')];var _0xd4acd7=_0x236fa1?_0x165cae['count']:_0x3aba5d[_0x8997('0x20')]+_0x3aba5d[_0x8997('0x23')];var _0x4aff08;if(_0xd4acd7>=_0x2ddde4){_0xd4acd7=_0x2ddde4;_0x4aff08=0xc8;}else{_0x4aff08=0xce;}_0x28c391[_0x8997('0x1d')](_0x4aff08);return _0x28c391[_0x8997('0x24')]('Content-Range',_0x5aff76+'-'+_0xd4acd7+'/'+_0x2ddde4)['json'](_0x165cae);}return null;};}function patchUpdates(_0x9178c6){return function(_0x1e5f68){try{jsonpatch[_0x8997('0x25')](_0x1e5f68,_0x9178c6,!![]);}catch(_0x2c01d3){return BPromise['reject'](_0x2c01d3);}return _0x1e5f68['save']();};}function saveUpdates(_0xf3b9a7,_0x44bc21){return function(_0x49d819){if(_0x49d819){return _0x49d819[_0x8997('0x26')](_0xf3b9a7)[_0x8997('0x27')](function(_0x5d8265){return _0x5d8265;});}return null;};}function removeEntity(_0x3d1639,_0x435981){return function(_0x4c2888){if(_0x4c2888){return _0x4c2888[_0x8997('0x28')]()[_0x8997('0x27')](function(){_0x3d1639[_0x8997('0x1d')](0xcc)[_0x8997('0x1e')]();});}};}function handleEntityNotFound(_0x733bec,_0x425b1d){return function(_0x2e7c34){if(!_0x2e7c34){_0x733bec[_0x8997('0x1c')](0x194);}return _0x2e7c34;};}function handleError(_0x407a3d,_0x3f802f){_0x3f802f=_0x3f802f||0x1f4;return function(_0x20b4e8){logger['error'](_0x20b4e8[_0x8997('0x29')]);if(_0x20b4e8[_0x8997('0x2a')]){delete _0x20b4e8['name'];}_0x407a3d[_0x8997('0x1d')](_0x3f802f)[_0x8997('0x2b')](_0x20b4e8);};}exports['index']=function(_0x3e8632,_0x2708b6){var _0x4673ef={},_0x179b2c={},_0x39615e={'count':0x0,'rows':[]};var _0xdee1db=_[_0x8997('0x2c')](db['ZohoConfiguration']['rawAttributes'],function(_0x5f45ca){return{'name':_0x5f45ca[_0x8997('0x2d')],'type':_0x5f45ca[_0x8997('0x2e')][_0x8997('0x2f')]};});_0x179b2c[_0x8997('0x30')]=_['map'](_0xdee1db,'name');_0x179b2c[_0x8997('0x31')]=_[_0x8997('0x32')](_0x3e8632['query']);_0x179b2c[_0x8997('0x33')]=_[_0x8997('0x34')](_0x179b2c[_0x8997('0x30')],_0x179b2c[_0x8997('0x31')]);_0x4673ef[_0x8997('0x35')]=_[_0x8997('0x34')](_0x179b2c['model'],qs[_0x8997('0x36')](_0x3e8632[_0x8997('0x31')][_0x8997('0x36')]));_0x4673ef[_0x8997('0x35')]=_0x4673ef[_0x8997('0x35')][_0x8997('0x37')]?_0x4673ef[_0x8997('0x35')]:_0x179b2c['model'];if(!_0x3e8632[_0x8997('0x31')][_0x8997('0x38')](_0x8997('0x39'))){_0x4673ef[_0x8997('0x23')]=qs[_0x8997('0x23')](_0x3e8632['query']['limit']);_0x4673ef[_0x8997('0x20')]=qs[_0x8997('0x20')](_0x3e8632[_0x8997('0x31')]['offset']);}_0x4673ef[_0x8997('0x3a')]=qs[_0x8997('0x3b')](_0x3e8632['query'][_0x8997('0x3b')]);_0x4673ef[_0x8997('0x3c')]=qs[_0x8997('0x33')](_['pick'](_0x3e8632['query'],_0x179b2c['filters']),_0xdee1db);if(_0x3e8632[_0x8997('0x31')]['filter']){_0x4673ef[_0x8997('0x3c')]=_['merge'](_0x4673ef['where'],{'$or':_['map'](_0xdee1db,function(_0x5c044f){if(_0x5c044f[_0x8997('0x2e')]!==_0x8997('0x3d')){var _0x30b1cc={};_0x30b1cc[_0x5c044f[_0x8997('0x2a')]]={'$like':'%'+_0x3e8632[_0x8997('0x31')][_0x8997('0x3e')]+'%'};return _0x30b1cc;}})});}_0x4673ef=_[_0x8997('0x3f')]({},_0x4673ef,_0x3e8632[_0x8997('0x40')]);var _0x571525={'where':_0x4673ef[_0x8997('0x3c')]};return db['ZohoConfiguration'][_0x8997('0x22')](_0x571525)[_0x8997('0x27')](function(_0x78b99a){_0x39615e[_0x8997('0x22')]=_0x78b99a;if(_0x3e8632['query'][_0x8997('0x41')]){_0x4673ef[_0x8997('0x42')]=[{'all':!![]}];}return db[_0x8997('0x43')][_0x8997('0x44')](_0x4673ef);})[_0x8997('0x27')](function(_0x29bcd0){_0x39615e[_0x8997('0x45')]=_0x29bcd0;return _0x39615e;})[_0x8997('0x27')](respondWithFilteredResult(_0x2708b6,_0x4673ef))[_0x8997('0x46')](handleError(_0x2708b6,null));};exports['show']=function(_0x220c7d,_0x38833b){var _0x892761={'raw':![],'where':{'id':_0x220c7d[_0x8997('0x47')]['id']}},_0x5a5939={};_0x5a5939[_0x8997('0x30')]=_[_0x8997('0x32')](db[_0x8997('0x43')][_0x8997('0x48')]);_0x5a5939[_0x8997('0x31')]=_[_0x8997('0x32')](_0x220c7d[_0x8997('0x31')]);_0x5a5939[_0x8997('0x33')]=_['intersection'](_0x5a5939['model'],_0x5a5939[_0x8997('0x31')]);_0x892761[_0x8997('0x35')]=_[_0x8997('0x34')](_0x5a5939[_0x8997('0x30')],qs['fields'](_0x220c7d[_0x8997('0x31')]['fields']));_0x892761[_0x8997('0x35')]=_0x892761[_0x8997('0x35')][_0x8997('0x37')]?_0x892761[_0x8997('0x35')]:_0x5a5939['model'];if(_0x220c7d['query'][_0x8997('0x41')]){_0x892761['include']=[{'all':!![]}];}_0x892761=_[_0x8997('0x3f')]({},_0x892761,_0x220c7d[_0x8997('0x40')]);return db[_0x8997('0x43')][_0x8997('0x49')](_0x892761)['then'](handleEntityNotFound(_0x38833b,null))['then'](respondWithResult(_0x38833b,null))['catch'](handleError(_0x38833b,null));};exports[_0x8997('0x4a')]=function(_0x327ddd,_0x47de2b){return db['ZohoConfiguration'][_0x8997('0x4a')](_0x327ddd['body'],{})[_0x8997('0x27')](respondWithResult(_0x47de2b,0xc9))[_0x8997('0x46')](handleError(_0x47de2b,null));};exports[_0x8997('0x26')]=function(_0x9e8143,_0xafb306){if(_0x9e8143[_0x8997('0x4b')]['id']){delete _0x9e8143[_0x8997('0x4b')]['id'];}return db[_0x8997('0x43')][_0x8997('0x49')]({'where':{'id':_0x9e8143[_0x8997('0x47')]['id']}})[_0x8997('0x27')](handleEntityNotFound(_0xafb306,null))['then'](saveUpdates(_0x9e8143['body'],null))[_0x8997('0x27')](respondWithResult(_0xafb306,null))[_0x8997('0x46')](handleError(_0xafb306,null));};exports['destroy']=function(_0x273ed3,_0x177e9a){return db[_0x8997('0x43')][_0x8997('0x49')]({'where':{'id':_0x273ed3[_0x8997('0x47')]['id']}})[_0x8997('0x27')](handleEntityNotFound(_0x177e9a,null))[_0x8997('0x27')](removeEntity(_0x177e9a,null))['catch'](handleError(_0x177e9a,null));};exports[_0x8997('0x4c')]=function(_0x1225e6,_0x21c612,_0x3be3de){var _0x45a78d={};var _0x172341={};var _0x1b5c8b;var _0x4bab67;return db[_0x8997('0x43')]['findOne']({'where':{'id':_0x1225e6[_0x8997('0x47')]['id']}})[_0x8997('0x27')](handleEntityNotFound(_0x21c612,null))['then'](function(_0x371623){if(_0x371623){_0x1b5c8b=_0x371623;_0x172341['model']=_[_0x8997('0x32')](db[_0x8997('0x4d')][_0x8997('0x48')]);_0x172341[_0x8997('0x31')]=_[_0x8997('0x32')](_0x1225e6['query']);_0x172341['filters']=_[_0x8997('0x34')](_0x172341[_0x8997('0x30')],_0x172341['query']);_0x45a78d['attributes']=_[_0x8997('0x34')](_0x172341[_0x8997('0x30')],qs['fields'](_0x1225e6[_0x8997('0x31')][_0x8997('0x36')]));_0x45a78d[_0x8997('0x35')]=_0x45a78d[_0x8997('0x35')]['length']?_0x45a78d[_0x8997('0x35')]:_0x172341['model'];_0x45a78d['order']=qs[_0x8997('0x3b')](_0x1225e6[_0x8997('0x31')][_0x8997('0x3b')]);_0x45a78d[_0x8997('0x3c')]=qs['filters'](_[_0x8997('0x4e')](_0x1225e6['query'],_0x172341[_0x8997('0x33')]));if(_0x1225e6['query'][_0x8997('0x3e')]){_0x45a78d[_0x8997('0x3c')]=_[_0x8997('0x3f')](_0x45a78d['where'],{'$or':_[_0x8997('0x2c')](_0x45a78d[_0x8997('0x35')],function(_0x6633ff){var _0x301a42={};_0x301a42[_0x6633ff]={'$like':'%'+_0x1225e6[_0x8997('0x31')]['filter']+'%'};return _0x301a42;})});}_0x45a78d=_[_0x8997('0x3f')]({},_0x45a78d,_0x1225e6[_0x8997('0x40')]);return _0x1b5c8b['getFields'](_0x45a78d);}})[_0x8997('0x27')](function(_0x58dbef){if(_0x58dbef){_0x4bab67=_0x58dbef[_0x8997('0x37')];if(!_0x1225e6['query'][_0x8997('0x38')]('nolimit')){_0x45a78d[_0x8997('0x23')]=qs[_0x8997('0x23')](_0x1225e6['query'][_0x8997('0x23')]);_0x45a78d['offset']=qs[_0x8997('0x20')](_0x1225e6['query']['offset']);}return _0x1b5c8b[_0x8997('0x4c')](_0x45a78d);}})['then'](function(_0x2cf088){if(_0x2cf088){return _0x2cf088?{'count':_0x4bab67,'rows':_0x2cf088}:null;}})[_0x8997('0x27')](respondWithResult(_0x21c612,null))['catch'](handleError(_0x21c612,null));};exports[_0x8997('0x4f')]=function(_0x18a5d0,_0xd237c4,_0x4efc20){var _0x217ccb={};var _0x32c1ef={};var _0x224ae3;var _0x4025c0;return db['ZohoConfiguration'][_0x8997('0x50')]({'where':{'id':_0x18a5d0['params']['id']}})[_0x8997('0x27')](handleEntityNotFound(_0xd237c4,null))[_0x8997('0x27')](function(_0x36fc32){if(_0x36fc32){_0x224ae3=_0x36fc32;_0x32c1ef[_0x8997('0x30')]=_[_0x8997('0x32')](db['ZohoField'][_0x8997('0x48')]);_0x32c1ef[_0x8997('0x31')]=_[_0x8997('0x32')](_0x18a5d0[_0x8997('0x31')]);_0x32c1ef[_0x8997('0x33')]=_[_0x8997('0x34')](_0x32c1ef[_0x8997('0x30')],_0x32c1ef[_0x8997('0x31')]);_0x217ccb['attributes']=_[_0x8997('0x34')](_0x32c1ef[_0x8997('0x30')],qs[_0x8997('0x36')](_0x18a5d0['query']['fields']));_0x217ccb[_0x8997('0x35')]=_0x217ccb[_0x8997('0x35')][_0x8997('0x37')]?_0x217ccb[_0x8997('0x35')]:_0x32c1ef[_0x8997('0x30')];_0x217ccb[_0x8997('0x3a')]=qs[_0x8997('0x3b')](_0x18a5d0[_0x8997('0x31')][_0x8997('0x3b')]);_0x217ccb[_0x8997('0x3c')]=qs[_0x8997('0x33')](_[_0x8997('0x4e')](_0x18a5d0['query'],_0x32c1ef[_0x8997('0x33')]));if(_0x18a5d0['query']['filter']){_0x217ccb['where']=_['merge'](_0x217ccb[_0x8997('0x3c')],{'$or':_['map'](_0x217ccb[_0x8997('0x35')],function(_0x5adf60){var _0x3535c7={};_0x3535c7[_0x5adf60]={'$like':'%'+_0x18a5d0['query']['filter']+'%'};return _0x3535c7;})});}_0x217ccb=_[_0x8997('0x3f')]({},_0x217ccb,_0x18a5d0['options']);return _0x224ae3[_0x8997('0x4f')](_0x217ccb);}})[_0x8997('0x27')](function(_0x2724d6){if(_0x2724d6){_0x4025c0=_0x2724d6[_0x8997('0x37')];if(!_0x18a5d0['query']['hasOwnProperty'](_0x8997('0x39'))){_0x217ccb[_0x8997('0x23')]=qs[_0x8997('0x23')](_0x18a5d0[_0x8997('0x31')][_0x8997('0x23')]);_0x217ccb['offset']=qs[_0x8997('0x20')](_0x18a5d0['query'][_0x8997('0x20')]);}return _0x224ae3['getSubjects'](_0x217ccb);}})[_0x8997('0x27')](function(_0x463a29){if(_0x463a29){return _0x463a29?{'count':_0x4025c0,'rows':_0x463a29}:null;}})[_0x8997('0x27')](respondWithResult(_0xd237c4,null))[_0x8997('0x46')](handleError(_0xd237c4,null));};exports[_0x8997('0x51')]=function(_0x27b580,_0x15703e,_0x3f1f72){var _0x3be8a8={};var _0x3f2222={};var _0x4fae97;var _0x94591;return db[_0x8997('0x43')][_0x8997('0x50')]({'where':{'id':_0x27b580[_0x8997('0x47')]['id']}})['then'](handleEntityNotFound(_0x15703e,null))[_0x8997('0x27')](function(_0x3a24ff){if(_0x3a24ff){_0x4fae97=_0x3a24ff;_0x3f2222[_0x8997('0x30')]=_[_0x8997('0x32')](db[_0x8997('0x4d')][_0x8997('0x48')]);_0x3f2222[_0x8997('0x31')]=_[_0x8997('0x32')](_0x27b580[_0x8997('0x31')]);_0x3f2222[_0x8997('0x33')]=_[_0x8997('0x34')](_0x3f2222[_0x8997('0x30')],_0x3f2222[_0x8997('0x31')]);_0x3be8a8['attributes']=_[_0x8997('0x34')](_0x3f2222[_0x8997('0x30')],qs[_0x8997('0x36')](_0x27b580[_0x8997('0x31')]['fields']));_0x3be8a8[_0x8997('0x35')]=_0x3be8a8['attributes'][_0x8997('0x37')]?_0x3be8a8[_0x8997('0x35')]:_0x3f2222[_0x8997('0x30')];_0x3be8a8[_0x8997('0x3a')]=qs[_0x8997('0x3b')](_0x27b580[_0x8997('0x31')]['sort']);_0x3be8a8['where']=qs[_0x8997('0x33')](_[_0x8997('0x4e')](_0x27b580['query'],_0x3f2222[_0x8997('0x33')]));if(_0x27b580[_0x8997('0x31')][_0x8997('0x3e')]){_0x3be8a8[_0x8997('0x3c')]=_['merge'](_0x3be8a8['where'],{'$or':_[_0x8997('0x2c')](_0x3be8a8[_0x8997('0x35')],function(_0x1b8071){var _0x2d2595={};_0x2d2595[_0x1b8071]={'$like':'%'+_0x27b580[_0x8997('0x31')][_0x8997('0x3e')]+'%'};return _0x2d2595;})});}_0x3be8a8=_['merge']({},_0x3be8a8,_0x27b580[_0x8997('0x40')]);return _0x4fae97['getDescriptions'](_0x3be8a8);}})['then'](function(_0x331f77){if(_0x331f77){_0x94591=_0x331f77['length'];if(!_0x27b580[_0x8997('0x31')][_0x8997('0x38')]('nolimit')){_0x3be8a8[_0x8997('0x23')]=qs[_0x8997('0x23')](_0x27b580[_0x8997('0x31')][_0x8997('0x23')]);_0x3be8a8[_0x8997('0x20')]=qs[_0x8997('0x20')](_0x27b580[_0x8997('0x31')][_0x8997('0x20')]);}return _0x4fae97[_0x8997('0x51')](_0x3be8a8);}})[_0x8997('0x27')](function(_0x515f8c){if(_0x515f8c){return _0x515f8c?{'count':_0x94591,'rows':_0x515f8c}:null;}})[_0x8997('0x27')](respondWithResult(_0x15703e,null))[_0x8997('0x46')](handleError(_0x15703e,null));};
\ No newline at end of file
+var _0x7420=['send','index','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','rawAttributes','length','include','find','create','body','params','findOne','ZohoField','order','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0x7420,0x1d7));var _0x0742=function(_0x1da9b1,_0x1c3e67){_0x1da9b1=_0x1da9b1-0x0;var _0x5c9b07=_0x7420[_0x1da9b1];return _0x5c9b07;};'use strict';var emlformat=require(_0x0742('0x0'));var rimraf=require(_0x0742('0x1'));var zipdir=require(_0x0742('0x2'));var jsonpatch=require(_0x0742('0x3'));var rp=require(_0x0742('0x4'));var moment=require(_0x0742('0x5'));var BPromise=require(_0x0742('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0742('0x7'));var sox=require(_0x0742('0x8'));var csv=require(_0x0742('0x9'));var ejs=require(_0x0742('0xa'));var fs=require('fs');var fs_extra=require(_0x0742('0xb'));var _=require(_0x0742('0xc'));var squel=require(_0x0742('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0742('0xe'));var toCsv=require(_0x0742('0x9'));var querystring=require(_0x0742('0xf'));var Papa=require(_0x0742('0x10'));var Redis=require(_0x0742('0x11'));var authService=require(_0x0742('0x12'));var qs=require(_0x0742('0x13'));var as=require(_0x0742('0x14'));var hardwareService=require(_0x0742('0x15'));var logger=require(_0x0742('0x16'))(_0x0742('0x17'));var utils=require('../../config/utils');var config=require(_0x0742('0x18'));var licenseUtil=require(_0x0742('0x19'));var db=require(_0x0742('0x1a'))['db'];function respondWithStatusCode(_0xff2f6,_0x16d973){_0x16d973=_0x16d973||0xcc;return function(_0x2cadb4){if(_0x2cadb4){return _0xff2f6[_0x0742('0x1b')](_0x16d973);}return _0xff2f6[_0x0742('0x1c')](_0x16d973)['end']();};}function respondWithResult(_0x2d08b5,_0x5282cb){_0x5282cb=_0x5282cb||0xc8;return function(_0x392488){if(_0x392488){return _0x2d08b5[_0x0742('0x1c')](_0x5282cb)[_0x0742('0x1d')](_0x392488);}};}function respondWithFilteredResult(_0x140335,_0x341ebc){return function(_0x25b64e){if(_0x25b64e){var _0x16e2e3=typeof _0x341ebc['offset']===_0x0742('0x1e')&&typeof _0x341ebc[_0x0742('0x1f')]===_0x0742('0x1e');var _0x1d4653=_0x25b64e[_0x0742('0x20')];var _0x1739de=_0x16e2e3?0x0:_0x341ebc[_0x0742('0x21')];var _0x4b9631=_0x16e2e3?_0x25b64e[_0x0742('0x20')]:_0x341ebc[_0x0742('0x21')]+_0x341ebc[_0x0742('0x1f')];var _0x33da02;if(_0x4b9631>=_0x1d4653){_0x4b9631=_0x1d4653;_0x33da02=0xc8;}else{_0x33da02=0xce;}_0x140335[_0x0742('0x1c')](_0x33da02);return _0x140335[_0x0742('0x22')](_0x0742('0x23'),_0x1739de+'-'+_0x4b9631+'/'+_0x1d4653)[_0x0742('0x1d')](_0x25b64e);}return null;};}function patchUpdates(_0x5a1898){return function(_0x50ffb7){try{jsonpatch[_0x0742('0x24')](_0x50ffb7,_0x5a1898,!![]);}catch(_0x3d303a){return BPromise['reject'](_0x3d303a);}return _0x50ffb7[_0x0742('0x25')]();};}function saveUpdates(_0x5f4f59,_0x25a797){return function(_0x23c348){if(_0x23c348){return _0x23c348[_0x0742('0x26')](_0x5f4f59)['then'](function(_0x1f5b69){return _0x1f5b69;});}return null;};}function removeEntity(_0x39ba33,_0x463d2d){return function(_0x1acca4){if(_0x1acca4){return _0x1acca4[_0x0742('0x27')]()[_0x0742('0x28')](function(){_0x39ba33[_0x0742('0x1c')](0xcc)[_0x0742('0x29')]();});}};}function handleEntityNotFound(_0x39c547,_0xadf066){return function(_0x1cc827){if(!_0x1cc827){_0x39c547[_0x0742('0x1b')](0x194);}return _0x1cc827;};}function handleError(_0x1f9b55,_0x309fb1){_0x309fb1=_0x309fb1||0x1f4;return function(_0x2a4001){logger[_0x0742('0x2a')](_0x2a4001[_0x0742('0x2b')]);if(_0x2a4001[_0x0742('0x2c')]){delete _0x2a4001[_0x0742('0x2c')];}_0x1f9b55[_0x0742('0x1c')](_0x309fb1)[_0x0742('0x2d')](_0x2a4001);};}exports[_0x0742('0x2e')]=function(_0x436d74,_0x2d9688){var _0x27c822={},_0x4ac41a={},_0x3cc70b={'count':0x0,'rows':[]};var _0x16cfcd=_[_0x0742('0x2f')](db[_0x0742('0x30')]['rawAttributes'],function(_0x55ac90){return{'name':_0x55ac90[_0x0742('0x31')],'type':_0x55ac90[_0x0742('0x32')][_0x0742('0x33')]};});_0x4ac41a[_0x0742('0x34')]=_[_0x0742('0x2f')](_0x16cfcd,_0x0742('0x2c'));_0x4ac41a[_0x0742('0x35')]=_[_0x0742('0x36')](_0x436d74[_0x0742('0x35')]);_0x4ac41a[_0x0742('0x37')]=_['intersection'](_0x4ac41a[_0x0742('0x34')],_0x4ac41a['query']);_0x27c822['attributes']=_[_0x0742('0x38')](_0x4ac41a[_0x0742('0x34')],qs['fields'](_0x436d74[_0x0742('0x35')][_0x0742('0x39')]));_0x27c822[_0x0742('0x3a')]=_0x27c822[_0x0742('0x3a')]['length']?_0x27c822[_0x0742('0x3a')]:_0x4ac41a[_0x0742('0x34')];if(!_0x436d74[_0x0742('0x35')][_0x0742('0x3b')](_0x0742('0x3c'))){_0x27c822[_0x0742('0x1f')]=qs[_0x0742('0x1f')](_0x436d74[_0x0742('0x35')][_0x0742('0x1f')]);_0x27c822[_0x0742('0x21')]=qs[_0x0742('0x21')](_0x436d74[_0x0742('0x35')]['offset']);}_0x27c822['order']=qs[_0x0742('0x3d')](_0x436d74[_0x0742('0x35')][_0x0742('0x3d')]);_0x27c822[_0x0742('0x3e')]=qs[_0x0742('0x37')](_[_0x0742('0x3f')](_0x436d74[_0x0742('0x35')],_0x4ac41a[_0x0742('0x37')]),_0x16cfcd);if(_0x436d74[_0x0742('0x35')]['filter']){_0x27c822['where']=_[_0x0742('0x40')](_0x27c822['where'],{'$or':_[_0x0742('0x2f')](_0x16cfcd,function(_0x54cd09){if(_0x54cd09['type']!==_0x0742('0x41')){var _0x19b75a={};_0x19b75a[_0x54cd09[_0x0742('0x2c')]]={'$like':'%'+_0x436d74[_0x0742('0x35')][_0x0742('0x42')]+'%'};return _0x19b75a;}})});}_0x27c822=_[_0x0742('0x40')]({},_0x27c822,_0x436d74[_0x0742('0x43')]);var _0x3d6020={'where':_0x27c822[_0x0742('0x3e')]};return db[_0x0742('0x30')][_0x0742('0x20')](_0x3d6020)['then'](function(_0x527c14){_0x3cc70b[_0x0742('0x20')]=_0x527c14;if(_0x436d74[_0x0742('0x35')][_0x0742('0x44')]){_0x27c822['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x0742('0x45')](_0x27c822);})[_0x0742('0x28')](function(_0x45bcb8){_0x3cc70b[_0x0742('0x46')]=_0x45bcb8;return _0x3cc70b;})[_0x0742('0x28')](respondWithFilteredResult(_0x2d9688,_0x27c822))[_0x0742('0x47')](handleError(_0x2d9688,null));};exports[_0x0742('0x48')]=function(_0x30e9f4,_0x49a1c8){var _0x133f17={'raw':![],'where':{'id':_0x30e9f4['params']['id']}},_0x113442={};_0x113442['model']=_[_0x0742('0x36')](db[_0x0742('0x30')][_0x0742('0x49')]);_0x113442[_0x0742('0x35')]=_[_0x0742('0x36')](_0x30e9f4[_0x0742('0x35')]);_0x113442['filters']=_[_0x0742('0x38')](_0x113442['model'],_0x113442[_0x0742('0x35')]);_0x133f17[_0x0742('0x3a')]=_['intersection'](_0x113442[_0x0742('0x34')],qs[_0x0742('0x39')](_0x30e9f4['query'][_0x0742('0x39')]));_0x133f17[_0x0742('0x3a')]=_0x133f17['attributes'][_0x0742('0x4a')]?_0x133f17[_0x0742('0x3a')]:_0x113442[_0x0742('0x34')];if(_0x30e9f4[_0x0742('0x35')][_0x0742('0x44')]){_0x133f17[_0x0742('0x4b')]=[{'all':!![]}];}_0x133f17=_[_0x0742('0x40')]({},_0x133f17,_0x30e9f4['options']);return db[_0x0742('0x30')][_0x0742('0x4c')](_0x133f17)[_0x0742('0x28')](handleEntityNotFound(_0x49a1c8,null))[_0x0742('0x28')](respondWithResult(_0x49a1c8,null))['catch'](handleError(_0x49a1c8,null));};exports[_0x0742('0x4d')]=function(_0xfacc47,_0x1fe758){return db[_0x0742('0x30')][_0x0742('0x4d')](_0xfacc47[_0x0742('0x4e')],{})['then'](respondWithResult(_0x1fe758,0xc9))['catch'](handleError(_0x1fe758,null));};exports['update']=function(_0x59ac67,_0x1cc20f){if(_0x59ac67['body']['id']){delete _0x59ac67[_0x0742('0x4e')]['id'];}return db[_0x0742('0x30')][_0x0742('0x4c')]({'where':{'id':_0x59ac67[_0x0742('0x4f')]['id']}})[_0x0742('0x28')](handleEntityNotFound(_0x1cc20f,null))[_0x0742('0x28')](saveUpdates(_0x59ac67[_0x0742('0x4e')],null))[_0x0742('0x28')](respondWithResult(_0x1cc20f,null))[_0x0742('0x47')](handleError(_0x1cc20f,null));};exports[_0x0742('0x27')]=function(_0x4b44ec,_0x32b18b){return db[_0x0742('0x30')][_0x0742('0x4c')]({'where':{'id':_0x4b44ec[_0x0742('0x4f')]['id']}})[_0x0742('0x28')](handleEntityNotFound(_0x32b18b,null))[_0x0742('0x28')](removeEntity(_0x32b18b,null))[_0x0742('0x47')](handleError(_0x32b18b,null));};exports['getFields']=function(_0x1e0d4c,_0x3f7b80,_0x476d6a){var _0x3ca9e6={};var _0x1107d0={};var _0x1bc9b5;var _0x326922;return db[_0x0742('0x30')][_0x0742('0x50')]({'where':{'id':_0x1e0d4c[_0x0742('0x4f')]['id']}})[_0x0742('0x28')](handleEntityNotFound(_0x3f7b80,null))[_0x0742('0x28')](function(_0x1704a0){if(_0x1704a0){_0x1bc9b5=_0x1704a0;_0x1107d0[_0x0742('0x34')]=_[_0x0742('0x36')](db[_0x0742('0x51')][_0x0742('0x49')]);_0x1107d0[_0x0742('0x35')]=_[_0x0742('0x36')](_0x1e0d4c[_0x0742('0x35')]);_0x1107d0[_0x0742('0x37')]=_['intersection'](_0x1107d0['model'],_0x1107d0[_0x0742('0x35')]);_0x3ca9e6[_0x0742('0x3a')]=_[_0x0742('0x38')](_0x1107d0[_0x0742('0x34')],qs[_0x0742('0x39')](_0x1e0d4c['query']['fields']));_0x3ca9e6['attributes']=_0x3ca9e6[_0x0742('0x3a')][_0x0742('0x4a')]?_0x3ca9e6[_0x0742('0x3a')]:_0x1107d0[_0x0742('0x34')];_0x3ca9e6[_0x0742('0x52')]=qs[_0x0742('0x3d')](_0x1e0d4c[_0x0742('0x35')][_0x0742('0x3d')]);_0x3ca9e6[_0x0742('0x3e')]=qs['filters'](_[_0x0742('0x3f')](_0x1e0d4c['query'],_0x1107d0[_0x0742('0x37')]));if(_0x1e0d4c[_0x0742('0x35')]['filter']){_0x3ca9e6[_0x0742('0x3e')]=_[_0x0742('0x40')](_0x3ca9e6[_0x0742('0x3e')],{'$or':_[_0x0742('0x2f')](_0x3ca9e6[_0x0742('0x3a')],function(_0x4c638d){var _0x1655e6={};_0x1655e6[_0x4c638d]={'$like':'%'+_0x1e0d4c['query'][_0x0742('0x42')]+'%'};return _0x1655e6;})});}_0x3ca9e6=_[_0x0742('0x40')]({},_0x3ca9e6,_0x1e0d4c['options']);return _0x1bc9b5[_0x0742('0x53')](_0x3ca9e6);}})['then'](function(_0x156ff7){if(_0x156ff7){_0x326922=_0x156ff7[_0x0742('0x4a')];if(!_0x1e0d4c[_0x0742('0x35')][_0x0742('0x3b')]('nolimit')){_0x3ca9e6['limit']=qs[_0x0742('0x1f')](_0x1e0d4c[_0x0742('0x35')][_0x0742('0x1f')]);_0x3ca9e6[_0x0742('0x21')]=qs['offset'](_0x1e0d4c[_0x0742('0x35')][_0x0742('0x21')]);}return _0x1bc9b5[_0x0742('0x53')](_0x3ca9e6);}})[_0x0742('0x28')](function(_0x51f098){if(_0x51f098){return _0x51f098?{'count':_0x326922,'rows':_0x51f098}:null;}})['then'](respondWithResult(_0x3f7b80,null))['catch'](handleError(_0x3f7b80,null));};exports[_0x0742('0x54')]=function(_0x43fcc9,_0xf44bd2,_0x20dfe1){var _0x8ec6bd={};var _0x3ade7a={};var _0x267589;var _0x3c5946;return db['ZohoConfiguration'][_0x0742('0x50')]({'where':{'id':_0x43fcc9['params']['id']}})[_0x0742('0x28')](handleEntityNotFound(_0xf44bd2,null))['then'](function(_0x576c1){if(_0x576c1){_0x267589=_0x576c1;_0x3ade7a[_0x0742('0x34')]=_[_0x0742('0x36')](db[_0x0742('0x51')][_0x0742('0x49')]);_0x3ade7a[_0x0742('0x35')]=_['keys'](_0x43fcc9[_0x0742('0x35')]);_0x3ade7a[_0x0742('0x37')]=_['intersection'](_0x3ade7a[_0x0742('0x34')],_0x3ade7a['query']);_0x8ec6bd['attributes']=_['intersection'](_0x3ade7a[_0x0742('0x34')],qs[_0x0742('0x39')](_0x43fcc9['query'][_0x0742('0x39')]));_0x8ec6bd[_0x0742('0x3a')]=_0x8ec6bd['attributes'][_0x0742('0x4a')]?_0x8ec6bd[_0x0742('0x3a')]:_0x3ade7a[_0x0742('0x34')];_0x8ec6bd[_0x0742('0x52')]=qs[_0x0742('0x3d')](_0x43fcc9['query'][_0x0742('0x3d')]);_0x8ec6bd['where']=qs[_0x0742('0x37')](_[_0x0742('0x3f')](_0x43fcc9[_0x0742('0x35')],_0x3ade7a[_0x0742('0x37')]));if(_0x43fcc9[_0x0742('0x35')]['filter']){_0x8ec6bd[_0x0742('0x3e')]=_[_0x0742('0x40')](_0x8ec6bd['where'],{'$or':_[_0x0742('0x2f')](_0x8ec6bd[_0x0742('0x3a')],function(_0x243f0d){var _0x550a63={};_0x550a63[_0x243f0d]={'$like':'%'+_0x43fcc9[_0x0742('0x35')][_0x0742('0x42')]+'%'};return _0x550a63;})});}_0x8ec6bd=_[_0x0742('0x40')]({},_0x8ec6bd,_0x43fcc9[_0x0742('0x43')]);return _0x267589[_0x0742('0x54')](_0x8ec6bd);}})[_0x0742('0x28')](function(_0x1f247d){if(_0x1f247d){_0x3c5946=_0x1f247d[_0x0742('0x4a')];if(!_0x43fcc9[_0x0742('0x35')][_0x0742('0x3b')](_0x0742('0x3c'))){_0x8ec6bd['limit']=qs[_0x0742('0x1f')](_0x43fcc9['query'][_0x0742('0x1f')]);_0x8ec6bd[_0x0742('0x21')]=qs[_0x0742('0x21')](_0x43fcc9[_0x0742('0x35')]['offset']);}return _0x267589[_0x0742('0x54')](_0x8ec6bd);}})[_0x0742('0x28')](function(_0x3bb55d){if(_0x3bb55d){return _0x3bb55d?{'count':_0x3c5946,'rows':_0x3bb55d}:null;}})[_0x0742('0x28')](respondWithResult(_0xf44bd2,null))[_0x0742('0x47')](handleError(_0xf44bd2,null));};exports[_0x0742('0x55')]=function(_0x2b5beb,_0x580f87,_0x22b2f4){var _0x44cb03={};var _0xda1dc2={};var _0x550903;var _0x1fec58;return db[_0x0742('0x30')][_0x0742('0x50')]({'where':{'id':_0x2b5beb[_0x0742('0x4f')]['id']}})[_0x0742('0x28')](handleEntityNotFound(_0x580f87,null))['then'](function(_0x5bdd3c){if(_0x5bdd3c){_0x550903=_0x5bdd3c;_0xda1dc2[_0x0742('0x34')]=_['keys'](db[_0x0742('0x51')][_0x0742('0x49')]);_0xda1dc2[_0x0742('0x35')]=_[_0x0742('0x36')](_0x2b5beb[_0x0742('0x35')]);_0xda1dc2[_0x0742('0x37')]=_['intersection'](_0xda1dc2[_0x0742('0x34')],_0xda1dc2[_0x0742('0x35')]);_0x44cb03[_0x0742('0x3a')]=_[_0x0742('0x38')](_0xda1dc2[_0x0742('0x34')],qs[_0x0742('0x39')](_0x2b5beb['query'][_0x0742('0x39')]));_0x44cb03['attributes']=_0x44cb03[_0x0742('0x3a')][_0x0742('0x4a')]?_0x44cb03[_0x0742('0x3a')]:_0xda1dc2[_0x0742('0x34')];_0x44cb03[_0x0742('0x52')]=qs[_0x0742('0x3d')](_0x2b5beb['query'][_0x0742('0x3d')]);_0x44cb03['where']=qs['filters'](_['pick'](_0x2b5beb['query'],_0xda1dc2[_0x0742('0x37')]));if(_0x2b5beb[_0x0742('0x35')]['filter']){_0x44cb03[_0x0742('0x3e')]=_[_0x0742('0x40')](_0x44cb03[_0x0742('0x3e')],{'$or':_[_0x0742('0x2f')](_0x44cb03['attributes'],function(_0x5e03f4){var _0x3b6233={};_0x3b6233[_0x5e03f4]={'$like':'%'+_0x2b5beb[_0x0742('0x35')][_0x0742('0x42')]+'%'};return _0x3b6233;})});}_0x44cb03=_['merge']({},_0x44cb03,_0x2b5beb[_0x0742('0x43')]);return _0x550903[_0x0742('0x55')](_0x44cb03);}})[_0x0742('0x28')](function(_0x4a02c){if(_0x4a02c){_0x1fec58=_0x4a02c[_0x0742('0x4a')];if(!_0x2b5beb[_0x0742('0x35')][_0x0742('0x3b')](_0x0742('0x3c'))){_0x44cb03[_0x0742('0x1f')]=qs[_0x0742('0x1f')](_0x2b5beb[_0x0742('0x35')]['limit']);_0x44cb03[_0x0742('0x21')]=qs[_0x0742('0x21')](_0x2b5beb[_0x0742('0x35')][_0x0742('0x21')]);}return _0x550903[_0x0742('0x55')](_0x44cb03);}})['then'](function(_0x175118){if(_0x175118){return _0x175118?{'count':_0x1fec58,'rows':_0x175118}:null;}})['then'](respondWithResult(_0x580f87,null))[_0x0742('0x47')](handleError(_0x580f87,null));};
\ No newline at end of file
index fb48e16..2684222 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27fa=['./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5b7670,_0x5e6357){var _0x15f840=function(_0x507d92){while(--_0x507d92){_0x5b7670['push'](_0x5b7670['shift']());}};_0x15f840(++_0x5e6357);}(_0x27fa,0x17a));var _0xa27f=function(_0x4213ca,_0x4966ed){_0x4213ca=_0x4213ca-0x0;var _0x2d3740=_0x27fa[_0x4213ca];return _0x2d3740;};'use strict';var _=require(_0xa27f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa27f('0x1'));var moment=require(_0xa27f('0x2'));var BPromise=require('bluebird');var rp=require(_0xa27f('0x3'));var fs=require('fs');var path=require(_0xa27f('0x4'));var rimraf=require(_0xa27f('0x5'));var config=require(_0xa27f('0x6'));var attributes=require(_0xa27f('0x7'));module[_0xa27f('0x8')]=function(_0xac574d,_0x14d4c1){return _0xac574d['define'](_0xa27f('0x9'),attributes,{'tableName':_0xa27f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x73ec=['lodash','../../config/logger','moment','bluebird','rimraf','./intZohoConfiguration.attributes','ZohoConfiguration'];(function(_0x3e1603,_0x16c2b9){var _0x2bb6d3=function(_0x318369){while(--_0x318369){_0x3e1603['push'](_0x3e1603['shift']());}};_0x2bb6d3(++_0x16c2b9);}(_0x73ec,0x70));var _0xc73e=function(_0x5c04f9,_0x33d6c6){_0x5c04f9=_0x5c04f9-0x0;var _0x5a6bc7=_0x73ec[_0x5c04f9];return _0x5a6bc7;};'use strict';var _=require(_0xc73e('0x0'));var util=require('util');var logger=require(_0xc73e('0x1'))('api');var moment=require(_0xc73e('0x2'));var BPromise=require(_0xc73e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc73e('0x4'));var config=require('../../config/environment');var attributes=require(_0xc73e('0x5'));module['exports']=function(_0xf478fe,_0x4e5909){return _0xf478fe['define'](_0xc73e('0x6'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fc496cb..495c29e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x305c=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x466f52,_0x24d99f){var _0x5796bf=function(_0x59dd12){while(--_0x59dd12){_0x466f52['push'](_0x466f52['shift']());}};_0x5796bf(++_0x24d99f);}(_0x305c,0xc5));var _0xc305=function(_0x30b159,_0x3fbb50){_0x30b159=_0x30b159-0x0;var _0x23c3f9=_0x305c[_0x30b159];return _0x23c3f9;};'use strict';var _=require(_0xc305('0x0'));var util=require('util');var moment=require(_0xc305('0x1'));var BPromise=require('bluebird');var rs=require(_0xc305('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc305('0x3'))['db'];var utils=require(_0xc305('0x4'));var logger=require(_0xc305('0x5'))(_0xc305('0x6'));var config=require(_0xc305('0x7'));var jayson=require(_0xc305('0x8'));var client=jayson[_0xc305('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x392d9c,_0x26063b,_0x32565c){return new BPromise(function(_0x4585c7,_0x488cd3){return client[_0xc305('0xa')](_0x392d9c,_0x32565c)[_0xc305('0xb')](function(_0x347101){logger[_0xc305('0xc')](_0xc305('0xd'),_0x26063b,_0xc305('0xe'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x26063b,_0xc305('0xe'),JSON[_0xc305('0xf')](_0x347101));if(_0x347101[_0xc305('0x10')]){if(_0x347101[_0xc305('0x10')][_0xc305('0x11')]===0x1f4){logger[_0xc305('0x10')](_0xc305('0xd'),_0x26063b,_0x347101['error']['message']);return _0x488cd3(_0x347101[_0xc305('0x10')]['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x26063b,_0x347101['error'][_0xc305('0x12')]);return _0x4585c7(_0x347101[_0xc305('0x10')][_0xc305('0x12')]);}else{logger[_0xc305('0xc')](_0xc305('0xd'),_0x26063b,_0xc305('0xe'));_0x4585c7(_0x347101[_0xc305('0x13')][_0xc305('0x12')]);}})[_0xc305('0x14')](function(_0x5432ca){logger[_0xc305('0x10')](_0xc305('0xd'),_0x26063b,_0x5432ca);_0x488cd3(_0x5432ca);});});}
\ No newline at end of file
+var _0x8e00=['request\x20sent','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x39e177,_0x1f09d9){var _0x441aa0=function(_0x533eef){while(--_0x533eef){_0x39e177['push'](_0x39e177['shift']());}};_0x441aa0(++_0x1f09d9);}(_0x8e00,0x149));var _0x08e0=function(_0x32324d,_0x4e8520){_0x32324d=_0x32324d-0x0;var _0x5f0590=_0x8e00[_0x32324d];return _0x5f0590;};'use strict';var _=require('lodash');var util=require(_0x08e0('0x0'));var moment=require('moment');var BPromise=require(_0x08e0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x08e0('0x2'));var db=require(_0x08e0('0x3'))['db'];var utils=require(_0x08e0('0x4'));var logger=require(_0x08e0('0x5'))(_0x08e0('0x6'));var config=require(_0x08e0('0x7'));var jayson=require(_0x08e0('0x8'));var client=jayson[_0x08e0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4206a1,_0x16219d,_0x21ea7d){return new BPromise(function(_0x8c698e,_0x2deefb){return client[_0x08e0('0xa')](_0x4206a1,_0x21ea7d)[_0x08e0('0xb')](function(_0x4cbd6c){logger[_0x08e0('0xc')](_0x08e0('0xd'),_0x16219d,'request\x20sent');logger[_0x08e0('0xe')](_0x08e0('0xf'),_0x16219d,_0x08e0('0x10'),JSON[_0x08e0('0x11')](_0x4cbd6c));if(_0x4cbd6c[_0x08e0('0x12')]){if(_0x4cbd6c[_0x08e0('0x12')][_0x08e0('0x13')]===0x1f4){logger[_0x08e0('0x12')](_0x08e0('0xd'),_0x16219d,_0x4cbd6c['error'][_0x08e0('0x14')]);return _0x2deefb(_0x4cbd6c[_0x08e0('0x12')][_0x08e0('0x14')]);}logger[_0x08e0('0x12')](_0x08e0('0xd'),_0x16219d,_0x4cbd6c[_0x08e0('0x12')][_0x08e0('0x14')]);return _0x8c698e(_0x4cbd6c[_0x08e0('0x12')][_0x08e0('0x14')]);}else{logger[_0x08e0('0xc')](_0x08e0('0xd'),_0x16219d,_0x08e0('0x10'));_0x8c698e(_0x4cbd6c[_0x08e0('0x15')][_0x08e0('0x14')]);}})[_0x08e0('0x16')](function(_0x48b6c6){logger[_0x08e0('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x16219d,_0x48b6c6);_0x2deefb(_0x48b6c6);});});}
\ No newline at end of file
index d23660f..9430eff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f71=['../../config/environment','./intZohoField.controller','index','/:id','post','isAuthenticated','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3a636b,_0x350889){var _0x2ce14d=function(_0x16b468){while(--_0x16b468){_0x3a636b['push'](_0x3a636b['shift']());}};_0x2ce14d(++_0x350889);}(_0x4f71,0x107));var _0x14f7=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x4f71[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require(_0x14f7('0x0'));var path=require('path');var timeout=require(_0x14f7('0x1'));var express=require(_0x14f7('0x2'));var router=express[_0x14f7('0x3')]();var fs_extra=require(_0x14f7('0x4'));var auth=require(_0x14f7('0x5'));var interaction=require(_0x14f7('0x6'));var config=require(_0x14f7('0x7'));var controller=require(_0x14f7('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x14f7('0x9')]);router['get'](_0x14f7('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x14f7('0xb')]('/',auth[_0x14f7('0xc')](),controller[_0x14f7('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x14f7('0xe')]);router[_0x14f7('0xf')](_0x14f7('0xa'),auth[_0x14f7('0xc')](),controller[_0x14f7('0x10')]);module[_0x14f7('0x11')]=router;
\ No newline at end of file
+var _0x7f7a=['Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','show','create','put','/:id','delete','destroy','multer','util','path','express'];(function(_0x4a3233,_0x2343f7){var _0x1c29db=function(_0x406db4){while(--_0x406db4){_0x4a3233['push'](_0x4a3233['shift']());}};_0x1c29db(++_0x2343f7);}(_0x7f7a,0x183));var _0xa7f7=function(_0x1cd4ef,_0x1b65fa){_0x1cd4ef=_0x1cd4ef-0x0;var _0xa89fba=_0x7f7a[_0x1cd4ef];return _0xa89fba;};'use strict';var multer=require(_0xa7f7('0x0'));var util=require(_0xa7f7('0x1'));var path=require(_0xa7f7('0x2'));var timeout=require('connect-timeout');var express=require(_0xa7f7('0x3'));var router=express[_0xa7f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa7f7('0x5'));var interaction=require(_0xa7f7('0x6'));var config=require('../../config/environment');var controller=require(_0xa7f7('0x7'));router[_0xa7f7('0x8')]('/',auth[_0xa7f7('0x9')](),controller[_0xa7f7('0xa')]);router[_0xa7f7('0x8')]('/:id',auth[_0xa7f7('0x9')](),controller[_0xa7f7('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa7f7('0xc')]);router[_0xa7f7('0xd')](_0xa7f7('0xe'),auth[_0xa7f7('0x9')](),controller['update']);router[_0xa7f7('0xf')]('/:id',auth[_0xa7f7('0x9')](),controller[_0xa7f7('0x10')]);module['exports']=router;
\ No newline at end of file
index f0992c0..8c1114c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c7a=['ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8c7a,0x1c0));var _0xa8c7=function(_0x520add,_0x2ab2bd){_0x520add=_0x520add-0x0;var _0x47160b=_0x8c7a[_0x520add];return _0x47160b;};'use strict';var Sequelize=require(_0xa8c7('0x0'));module[_0xa8c7('0x1')]={'type':{'type':Sequelize[_0xa8c7('0x2')](_0xa8c7('0x3'),_0xa8c7('0x4'),'customVariable','keyValue',_0xa8c7('0x5')),'defaultValue':_0xa8c7('0x3')},'content':{'type':Sequelize[_0xa8c7('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa8c7('0x2')]('string','variable',_0xa8c7('0x7'))},'keyContent':{'type':Sequelize[_0xa8c7('0x6')]},'idField':{'type':Sequelize[_0xa8c7('0x6')]},'nameField':{'type':Sequelize[_0xa8c7('0x6')]},'customField':{'type':Sequelize[_0xa8c7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa8c7('0x6')]}};
\ No newline at end of file
+var _0xeed8=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x26e2c9,_0x46a845){var _0x15a6c0=function(_0x24c4d3){while(--_0x24c4d3){_0x26e2c9['push'](_0x26e2c9['shift']());}};_0x15a6c0(++_0x46a845);}(_0xeed8,0xf5));var _0x8eed=function(_0x331f6b,_0x248a74){_0x331f6b=_0x331f6b-0x0;var _0xee95db=_0xeed8[_0x331f6b];return _0xee95db;};'use strict';var Sequelize=require(_0x8eed('0x0'));module[_0x8eed('0x1')]={'type':{'type':Sequelize[_0x8eed('0x2')](_0x8eed('0x3'),_0x8eed('0x4'),_0x8eed('0x5'),_0x8eed('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x8eed('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x8eed('0x4'),_0x8eed('0x5'))},'keyContent':{'type':Sequelize[_0x8eed('0x7')]},'idField':{'type':Sequelize[_0x8eed('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8eed('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8eed('0x7')]}};
\ No newline at end of file
index 4530b7e..8076d43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc08a=['end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','map','ZohoField','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x45a376,_0x57e27a){var _0x5a9da3=function(_0x3fbca7){while(--_0x3fbca7){_0x45a376['push'](_0x45a376['shift']());}};_0x5a9da3(++_0x57e27a);}(_0xc08a,0x167));var _0xac08=function(_0x3c563a,_0x5ab244){_0x3c563a=_0x3c563a-0x0;var _0x3677d5=_0xc08a[_0x3c563a];return _0x3677d5;};'use strict';var emlformat=require(_0xac08('0x0'));var rimraf=require(_0xac08('0x1'));var zipdir=require(_0xac08('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac08('0x3'));var moment=require(_0xac08('0x4'));var BPromise=require(_0xac08('0x5'));var Mustache=require(_0xac08('0x6'));var util=require(_0xac08('0x7'));var path=require(_0xac08('0x8'));var sox=require(_0xac08('0x9'));var csv=require(_0xac08('0xa'));var ejs=require(_0xac08('0xb'));var fs=require('fs');var fs_extra=require(_0xac08('0xc'));var _=require(_0xac08('0xd'));var squel=require(_0xac08('0xe'));var crypto=require(_0xac08('0xf'));var jsforce=require(_0xac08('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xac08('0xa'));var querystring=require(_0xac08('0x11'));var Papa=require(_0xac08('0x12'));var Redis=require(_0xac08('0x13'));var authService=require(_0xac08('0x14'));var qs=require(_0xac08('0x15'));var as=require(_0xac08('0x16'));var hardwareService=require(_0xac08('0x17'));var logger=require(_0xac08('0x18'))(_0xac08('0x19'));var utils=require(_0xac08('0x1a'));var config=require(_0xac08('0x1b'));var licenseUtil=require(_0xac08('0x1c'));var db=require(_0xac08('0x1d'))['db'];function respondWithStatusCode(_0x4fe1a2,_0x61d0f7){_0x61d0f7=_0x61d0f7||0xcc;return function(_0x36b81a){if(_0x36b81a){return _0x4fe1a2[_0xac08('0x1e')](_0x61d0f7);}return _0x4fe1a2['status'](_0x61d0f7)[_0xac08('0x1f')]();};}function respondWithResult(_0x319b3b,_0x15bf10){_0x15bf10=_0x15bf10||0xc8;return function(_0x194768){if(_0x194768){return _0x319b3b[_0xac08('0x20')](_0x15bf10)[_0xac08('0x21')](_0x194768);}};}function respondWithFilteredResult(_0x349a6a,_0x4867ec){return function(_0xdcd026){if(_0xdcd026){var _0x1e213b=typeof _0x4867ec[_0xac08('0x22')]===_0xac08('0x23')&&typeof _0x4867ec[_0xac08('0x24')]===_0xac08('0x23');var _0x37036f=_0xdcd026['count'];var _0x480336=_0x1e213b?0x0:_0x4867ec[_0xac08('0x22')];var _0x321869=_0x1e213b?_0xdcd026[_0xac08('0x25')]:_0x4867ec[_0xac08('0x22')]+_0x4867ec[_0xac08('0x24')];var _0x340bfa;if(_0x321869>=_0x37036f){_0x321869=_0x37036f;_0x340bfa=0xc8;}else{_0x340bfa=0xce;}_0x349a6a[_0xac08('0x20')](_0x340bfa);return _0x349a6a[_0xac08('0x26')](_0xac08('0x27'),_0x480336+'-'+_0x321869+'/'+_0x37036f)[_0xac08('0x21')](_0xdcd026);}return null;};}function patchUpdates(_0x11cf36){return function(_0x4e2510){try{jsonpatch[_0xac08('0x28')](_0x4e2510,_0x11cf36,!![]);}catch(_0x4af9f7){return BPromise[_0xac08('0x29')](_0x4af9f7);}return _0x4e2510[_0xac08('0x2a')]();};}function saveUpdates(_0xdcf2b7,_0x48de6f){return function(_0x441ed2){if(_0x441ed2){return _0x441ed2['update'](_0xdcf2b7)[_0xac08('0x2b')](function(_0xb14658){return _0xb14658;});}return null;};}function removeEntity(_0x57e5dc,_0x278187){return function(_0x2cdbab){if(_0x2cdbab){return _0x2cdbab[_0xac08('0x2c')]()['then'](function(){_0x57e5dc[_0xac08('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38682a,_0x570169){return function(_0x558706){if(!_0x558706){_0x38682a[_0xac08('0x1e')](0x194);}return _0x558706;};}function handleError(_0x2e416e,_0x27cdcd){_0x27cdcd=_0x27cdcd||0x1f4;return function(_0x455093){logger['error'](_0x455093[_0xac08('0x2d')]);if(_0x455093[_0xac08('0x2e')]){delete _0x455093[_0xac08('0x2e')];}_0x2e416e[_0xac08('0x20')](_0x27cdcd)['send'](_0x455093);};}exports['index']=function(_0x415cfc,_0xcb3f8){var _0x325c43={},_0x5c1f68={},_0xcda08f={'count':0x0,'rows':[]};var _0x383057=_[_0xac08('0x2f')](db[_0xac08('0x30')][_0xac08('0x31')],function(_0x293356){return{'name':_0x293356[_0xac08('0x32')],'type':_0x293356[_0xac08('0x33')][_0xac08('0x34')]};});_0x5c1f68['model']=_[_0xac08('0x2f')](_0x383057,_0xac08('0x2e'));_0x5c1f68[_0xac08('0x35')]=_['keys'](_0x415cfc[_0xac08('0x35')]);_0x5c1f68[_0xac08('0x36')]=_[_0xac08('0x37')](_0x5c1f68[_0xac08('0x38')],_0x5c1f68[_0xac08('0x35')]);_0x325c43['attributes']=_['intersection'](_0x5c1f68[_0xac08('0x38')],qs[_0xac08('0x39')](_0x415cfc[_0xac08('0x35')][_0xac08('0x39')]));_0x325c43[_0xac08('0x3a')]=_0x325c43['attributes'][_0xac08('0x3b')]?_0x325c43['attributes']:_0x5c1f68[_0xac08('0x38')];if(!_0x415cfc[_0xac08('0x35')][_0xac08('0x3c')](_0xac08('0x3d'))){_0x325c43['limit']=qs[_0xac08('0x24')](_0x415cfc[_0xac08('0x35')][_0xac08('0x24')]);_0x325c43[_0xac08('0x22')]=qs[_0xac08('0x22')](_0x415cfc['query']['offset']);}_0x325c43['order']=qs['sort'](_0x415cfc[_0xac08('0x35')]['sort']);_0x325c43[_0xac08('0x3e')]=qs[_0xac08('0x36')](_[_0xac08('0x3f')](_0x415cfc[_0xac08('0x35')],_0x5c1f68[_0xac08('0x36')]),_0x383057);if(_0x415cfc[_0xac08('0x35')][_0xac08('0x40')]){_0x325c43['where']=_[_0xac08('0x41')](_0x325c43[_0xac08('0x3e')],{'$or':_[_0xac08('0x2f')](_0x383057,function(_0xd2ae1a){if(_0xd2ae1a['type']!==_0xac08('0x42')){var _0x377360={};_0x377360[_0xd2ae1a[_0xac08('0x2e')]]={'$like':'%'+_0x415cfc[_0xac08('0x35')][_0xac08('0x40')]+'%'};return _0x377360;}})});}_0x325c43=_[_0xac08('0x41')]({},_0x325c43,_0x415cfc[_0xac08('0x43')]);var _0x46a69e={'where':_0x325c43[_0xac08('0x3e')]};return db[_0xac08('0x30')][_0xac08('0x25')](_0x46a69e)[_0xac08('0x2b')](function(_0x72d8bf){_0xcda08f['count']=_0x72d8bf;if(_0x415cfc[_0xac08('0x35')][_0xac08('0x44')]){_0x325c43[_0xac08('0x45')]=[{'all':!![]}];}return db[_0xac08('0x30')]['findAll'](_0x325c43);})[_0xac08('0x2b')](function(_0x1b7470){_0xcda08f[_0xac08('0x46')]=_0x1b7470;return _0xcda08f;})[_0xac08('0x2b')](respondWithFilteredResult(_0xcb3f8,_0x325c43))[_0xac08('0x47')](handleError(_0xcb3f8,null));};exports[_0xac08('0x48')]=function(_0x240dd3,_0x1a46cc){var _0x506ea1={'raw':!![],'where':{'id':_0x240dd3[_0xac08('0x49')]['id']}},_0x164d14={};_0x164d14[_0xac08('0x38')]=_['keys'](db[_0xac08('0x30')][_0xac08('0x31')]);_0x164d14['query']=_[_0xac08('0x4a')](_0x240dd3[_0xac08('0x35')]);_0x164d14[_0xac08('0x36')]=_[_0xac08('0x37')](_0x164d14[_0xac08('0x38')],_0x164d14[_0xac08('0x35')]);_0x506ea1[_0xac08('0x3a')]=_[_0xac08('0x37')](_0x164d14[_0xac08('0x38')],qs[_0xac08('0x39')](_0x240dd3[_0xac08('0x35')][_0xac08('0x39')]));_0x506ea1[_0xac08('0x3a')]=_0x506ea1['attributes'][_0xac08('0x3b')]?_0x506ea1[_0xac08('0x3a')]:_0x164d14['model'];if(_0x240dd3['query']['includeAll']){_0x506ea1[_0xac08('0x45')]=[{'all':!![]}];}_0x506ea1=_['merge']({},_0x506ea1,_0x240dd3['options']);return db[_0xac08('0x30')][_0xac08('0x4b')](_0x506ea1)[_0xac08('0x2b')](handleEntityNotFound(_0x1a46cc,null))[_0xac08('0x2b')](respondWithResult(_0x1a46cc,null))[_0xac08('0x47')](handleError(_0x1a46cc,null));};exports[_0xac08('0x4c')]=function(_0x4b3719,_0x42fbf0){return db['ZohoField']['create'](_0x4b3719[_0xac08('0x4d')],{})[_0xac08('0x2b')](respondWithResult(_0x42fbf0,0xc9))[_0xac08('0x47')](handleError(_0x42fbf0,null));};exports['update']=function(_0xe2ab3d,_0x40007b){if(_0xe2ab3d['body']['id']){delete _0xe2ab3d[_0xac08('0x4d')]['id'];}return db['ZohoField'][_0xac08('0x4b')]({'where':{'id':_0xe2ab3d[_0xac08('0x49')]['id']}})[_0xac08('0x2b')](handleEntityNotFound(_0x40007b,null))[_0xac08('0x2b')](saveUpdates(_0xe2ab3d[_0xac08('0x4d')],null))[_0xac08('0x2b')](respondWithResult(_0x40007b,null))[_0xac08('0x47')](handleError(_0x40007b,null));};exports[_0xac08('0x2c')]=function(_0x3e6167,_0x2442a9){return db['ZohoField'][_0xac08('0x4b')]({'where':{'id':_0x3e6167[_0xac08('0x49')]['id']}})['then'](handleEntityNotFound(_0x2442a9,null))['then'](removeEntity(_0x2442a9,null))[_0xac08('0x47')](handleError(_0x2442a9,null));};
\ No newline at end of file
+var _0x1afc=['undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','rawAttributes','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','name','options','ZohoField','includeAll','include','findAll','rows','catch','show','find','create','body','params','rimraf','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x285fc5,_0x4ebfb9){var _0x3f4a87=function(_0x32023d){while(--_0x32023d){_0x285fc5['push'](_0x285fc5['shift']());}};_0x3f4a87(++_0x4ebfb9);}(_0x1afc,0xce));var _0xc1af=function(_0x50c003,_0xc6cce8){_0x50c003=_0x50c003-0x0;var _0x460453=_0x1afc[_0x50c003];return _0x460453;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1af('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1af('0x1'));var rp=require(_0xc1af('0x2'));var moment=require(_0xc1af('0x3'));var BPromise=require(_0xc1af('0x4'));var Mustache=require('mustache');var util=require(_0xc1af('0x5'));var path=require(_0xc1af('0x6'));var sox=require(_0xc1af('0x7'));var csv=require(_0xc1af('0x8'));var ejs=require(_0xc1af('0x9'));var fs=require('fs');var fs_extra=require(_0xc1af('0xa'));var _=require(_0xc1af('0xb'));var squel=require(_0xc1af('0xc'));var crypto=require(_0xc1af('0xd'));var jsforce=require(_0xc1af('0xe'));var deskjs=require(_0xc1af('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc1af('0x10'));var Papa=require('papaparse');var Redis=require(_0xc1af('0x11'));var authService=require(_0xc1af('0x12'));var qs=require(_0xc1af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1af('0x14'));var logger=require(_0xc1af('0x15'))(_0xc1af('0x16'));var utils=require(_0xc1af('0x17'));var config=require(_0xc1af('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1af('0x19'))['db'];function respondWithStatusCode(_0x261058,_0x5197b2){_0x5197b2=_0x5197b2||0xcc;return function(_0x33866a){if(_0x33866a){return _0x261058[_0xc1af('0x1a')](_0x5197b2);}return _0x261058[_0xc1af('0x1b')](_0x5197b2)['end']();};}function respondWithResult(_0x5093ab,_0x2e5c53){_0x2e5c53=_0x2e5c53||0xc8;return function(_0x44159d){if(_0x44159d){return _0x5093ab[_0xc1af('0x1b')](_0x2e5c53)['json'](_0x44159d);}};}function respondWithFilteredResult(_0x4797b5,_0x3bccbf){return function(_0x277183){if(_0x277183){var _0x2d3da6=typeof _0x3bccbf['offset']===_0xc1af('0x1c')&&typeof _0x3bccbf[_0xc1af('0x1d')]===_0xc1af('0x1c');var _0x63ac1f=_0x277183[_0xc1af('0x1e')];var _0x425ffc=_0x2d3da6?0x0:_0x3bccbf[_0xc1af('0x1f')];var _0xe0c8aa=_0x2d3da6?_0x277183[_0xc1af('0x1e')]:_0x3bccbf[_0xc1af('0x1f')]+_0x3bccbf[_0xc1af('0x1d')];var _0x340ebf;if(_0xe0c8aa>=_0x63ac1f){_0xe0c8aa=_0x63ac1f;_0x340ebf=0xc8;}else{_0x340ebf=0xce;}_0x4797b5[_0xc1af('0x1b')](_0x340ebf);return _0x4797b5[_0xc1af('0x20')](_0xc1af('0x21'),_0x425ffc+'-'+_0xe0c8aa+'/'+_0x63ac1f)[_0xc1af('0x22')](_0x277183);}return null;};}function patchUpdates(_0x236ffd){return function(_0x4ff7c6){try{jsonpatch[_0xc1af('0x23')](_0x4ff7c6,_0x236ffd,!![]);}catch(_0x4f73d9){return BPromise[_0xc1af('0x24')](_0x4f73d9);}return _0x4ff7c6[_0xc1af('0x25')]();};}function saveUpdates(_0xed491d,_0x5144fe){return function(_0x570539){if(_0x570539){return _0x570539[_0xc1af('0x26')](_0xed491d)[_0xc1af('0x27')](function(_0xc6b9a1){return _0xc6b9a1;});}return null;};}function removeEntity(_0x55fb1d,_0x96e3ba){return function(_0x299f9d){if(_0x299f9d){return _0x299f9d[_0xc1af('0x28')]()[_0xc1af('0x27')](function(){_0x55fb1d[_0xc1af('0x1b')](0xcc)[_0xc1af('0x29')]();});}};}function handleEntityNotFound(_0x19f79e,_0x4b2057){return function(_0x2c1a08){if(!_0x2c1a08){_0x19f79e[_0xc1af('0x1a')](0x194);}return _0x2c1a08;};}function handleError(_0xb36bc9,_0x115a12){_0x115a12=_0x115a12||0x1f4;return function(_0x56d1d4){logger[_0xc1af('0x2a')](_0x56d1d4[_0xc1af('0x2b')]);if(_0x56d1d4['name']){delete _0x56d1d4['name'];}_0xb36bc9[_0xc1af('0x1b')](_0x115a12)[_0xc1af('0x2c')](_0x56d1d4);};}exports[_0xc1af('0x2d')]=function(_0x4d0cb1,_0x536349){var _0x2ecb02={},_0x5323e9={},_0x509aa7={'count':0x0,'rows':[]};var _0x5774f6=_[_0xc1af('0x2e')](db['ZohoField'][_0xc1af('0x2f')],function(_0x26d647){return{'name':_0x26d647['fieldName'],'type':_0x26d647['type'][_0xc1af('0x30')]};});_0x5323e9['model']=_[_0xc1af('0x2e')](_0x5774f6,'name');_0x5323e9['query']=_[_0xc1af('0x31')](_0x4d0cb1[_0xc1af('0x32')]);_0x5323e9[_0xc1af('0x33')]=_[_0xc1af('0x34')](_0x5323e9[_0xc1af('0x35')],_0x5323e9[_0xc1af('0x32')]);_0x2ecb02['attributes']=_[_0xc1af('0x34')](_0x5323e9[_0xc1af('0x35')],qs[_0xc1af('0x36')](_0x4d0cb1[_0xc1af('0x32')][_0xc1af('0x36')]));_0x2ecb02[_0xc1af('0x37')]=_0x2ecb02[_0xc1af('0x37')][_0xc1af('0x38')]?_0x2ecb02[_0xc1af('0x37')]:_0x5323e9['model'];if(!_0x4d0cb1[_0xc1af('0x32')][_0xc1af('0x39')](_0xc1af('0x3a'))){_0x2ecb02['limit']=qs[_0xc1af('0x1d')](_0x4d0cb1[_0xc1af('0x32')][_0xc1af('0x1d')]);_0x2ecb02[_0xc1af('0x1f')]=qs[_0xc1af('0x1f')](_0x4d0cb1[_0xc1af('0x32')][_0xc1af('0x1f')]);}_0x2ecb02[_0xc1af('0x3b')]=qs[_0xc1af('0x3c')](_0x4d0cb1['query'][_0xc1af('0x3c')]);_0x2ecb02[_0xc1af('0x3d')]=qs[_0xc1af('0x33')](_[_0xc1af('0x3e')](_0x4d0cb1[_0xc1af('0x32')],_0x5323e9[_0xc1af('0x33')]),_0x5774f6);if(_0x4d0cb1[_0xc1af('0x32')][_0xc1af('0x3f')]){_0x2ecb02[_0xc1af('0x3d')]=_[_0xc1af('0x40')](_0x2ecb02['where'],{'$or':_[_0xc1af('0x2e')](_0x5774f6,function(_0x596285){if(_0x596285['type']!=='VIRTUAL'){var _0x1a1337={};_0x1a1337[_0x596285[_0xc1af('0x41')]]={'$like':'%'+_0x4d0cb1['query']['filter']+'%'};return _0x1a1337;}})});}_0x2ecb02=_[_0xc1af('0x40')]({},_0x2ecb02,_0x4d0cb1[_0xc1af('0x42')]);var _0x20e0c4={'where':_0x2ecb02['where']};return db[_0xc1af('0x43')][_0xc1af('0x1e')](_0x20e0c4)[_0xc1af('0x27')](function(_0x2c657a){_0x509aa7[_0xc1af('0x1e')]=_0x2c657a;if(_0x4d0cb1[_0xc1af('0x32')][_0xc1af('0x44')]){_0x2ecb02[_0xc1af('0x45')]=[{'all':!![]}];}return db[_0xc1af('0x43')][_0xc1af('0x46')](_0x2ecb02);})[_0xc1af('0x27')](function(_0x23bc99){_0x509aa7[_0xc1af('0x47')]=_0x23bc99;return _0x509aa7;})['then'](respondWithFilteredResult(_0x536349,_0x2ecb02))[_0xc1af('0x48')](handleError(_0x536349,null));};exports[_0xc1af('0x49')]=function(_0x2b78b2,_0x4bc9d4){var _0x45693c={'raw':!![],'where':{'id':_0x2b78b2['params']['id']}},_0x57b014={};_0x57b014['model']=_['keys'](db[_0xc1af('0x43')]['rawAttributes']);_0x57b014[_0xc1af('0x32')]=_['keys'](_0x2b78b2[_0xc1af('0x32')]);_0x57b014['filters']=_[_0xc1af('0x34')](_0x57b014[_0xc1af('0x35')],_0x57b014[_0xc1af('0x32')]);_0x45693c[_0xc1af('0x37')]=_[_0xc1af('0x34')](_0x57b014[_0xc1af('0x35')],qs[_0xc1af('0x36')](_0x2b78b2['query'][_0xc1af('0x36')]));_0x45693c[_0xc1af('0x37')]=_0x45693c['attributes'][_0xc1af('0x38')]?_0x45693c[_0xc1af('0x37')]:_0x57b014[_0xc1af('0x35')];if(_0x2b78b2[_0xc1af('0x32')][_0xc1af('0x44')]){_0x45693c[_0xc1af('0x45')]=[{'all':!![]}];}_0x45693c=_[_0xc1af('0x40')]({},_0x45693c,_0x2b78b2[_0xc1af('0x42')]);return db[_0xc1af('0x43')][_0xc1af('0x4a')](_0x45693c)['then'](handleEntityNotFound(_0x4bc9d4,null))[_0xc1af('0x27')](respondWithResult(_0x4bc9d4,null))[_0xc1af('0x48')](handleError(_0x4bc9d4,null));};exports[_0xc1af('0x4b')]=function(_0x4e554b,_0xe0b3d9){return db[_0xc1af('0x43')][_0xc1af('0x4b')](_0x4e554b['body'],{})[_0xc1af('0x27')](respondWithResult(_0xe0b3d9,0xc9))['catch'](handleError(_0xe0b3d9,null));};exports['update']=function(_0x51974c,_0x54ca46){if(_0x51974c['body']['id']){delete _0x51974c[_0xc1af('0x4c')]['id'];}return db[_0xc1af('0x43')][_0xc1af('0x4a')]({'where':{'id':_0x51974c[_0xc1af('0x4d')]['id']}})[_0xc1af('0x27')](handleEntityNotFound(_0x54ca46,null))[_0xc1af('0x27')](saveUpdates(_0x51974c[_0xc1af('0x4c')],null))['then'](respondWithResult(_0x54ca46,null))[_0xc1af('0x48')](handleError(_0x54ca46,null));};exports['destroy']=function(_0x4c5bae,_0x177db){return db['ZohoField'][_0xc1af('0x4a')]({'where':{'id':_0x4c5bae[_0xc1af('0x4d')]['id']}})[_0xc1af('0x27')](handleEntityNotFound(_0x177db,null))[_0xc1af('0x27')](removeEntity(_0x177db,null))[_0xc1af('0x48')](handleError(_0x177db,null));};
\ No newline at end of file
index bcbcc30..81fd122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c60=['FieldId','lodash','util','../../config/logger','api','bluebird','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField'];(function(_0x5eec7d,_0x230bc9){var _0x124c18=function(_0x266934){while(--_0x266934){_0x5eec7d['push'](_0x5eec7d['shift']());}};_0x124c18(++_0x230bc9);}(_0x4c60,0xc1));var _0x04c6=function(_0x2703ed,_0x2dc517){_0x2703ed=_0x2703ed-0x0;var _0x2267be=_0x4c60[_0x2703ed];return _0x2267be;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x04c6('0x5'));module[_0x04c6('0x6')]=function(_0x2054da,_0x12bd5d){return _0x2054da[_0x04c6('0x7')](_0x04c6('0x8'),attributes,{'tableName':_0x04c6('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x04c6('0xa'),_0x04c6('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x47c5=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intZohoField.attributes','exports','define'];(function(_0x1f92ed,_0x5dcd67){var _0x576816=function(_0x4d5d81){while(--_0x4d5d81){_0x1f92ed['push'](_0x1f92ed['shift']());}};_0x576816(++_0x5dcd67);}(_0x47c5,0x165));var _0x547c=function(_0x50e703,_0x127370){_0x50e703=_0x50e703-0x0;var _0xf1840c=_0x47c5[_0x50e703];return _0xf1840c;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var logger=require(_0x547c('0x2'))(_0x547c('0x3'));var moment=require(_0x547c('0x4'));var BPromise=require(_0x547c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x547c('0x6'));var rimraf=require(_0x547c('0x7'));var config=require('../../config/environment');var attributes=require(_0x547c('0x8'));module[_0x547c('0x9')]=function(_0x51ab7f,_0x2e5b57){return _0x51ab7f[_0x547c('0xa')](_0x547c('0xb'),attributes,{'tableName':_0x547c('0xc'),'paranoid':![],'indexes':[{'name':_0x547c('0xd'),'fields':[_0x547c('0xe'),_0x547c('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 6ce80ec..6a82a24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x832e=['ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x522a38,_0x18e5f0){var _0x5e4c28=function(_0x1b6281){while(--_0x1b6281){_0x522a38['push'](_0x522a38['shift']());}};_0x5e4c28(++_0x18e5f0);}(_0x832e,0xca));var _0xe832=function(_0x35b899,_0x3ef88f){_0x35b899=_0x35b899-0x0;var _0x404183=_0x832e[_0x35b899];return _0x404183;};'use strict';var _=require(_0xe832('0x0'));var util=require(_0xe832('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe832('0x2'));var fs=require('fs');var Redis=require(_0xe832('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe832('0x4'));var logger=require(_0xe832('0x5'))(_0xe832('0x6'));var config=require(_0xe832('0x7'));var jayson=require(_0xe832('0x8'));var client=jayson['client'][_0xe832('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x585478,_0x55f136,_0x250d6f){return new BPromise(function(_0x4eb49e,_0x4cafde){return client[_0xe832('0xa')](_0x585478,_0x250d6f)[_0xe832('0xb')](function(_0x7e0977){logger[_0xe832('0xc')]('ZohoField,\x20%s,\x20%s',_0x55f136,_0xe832('0xd'));logger[_0xe832('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x55f136,_0xe832('0xd'),JSON[_0xe832('0xf')](_0x7e0977));if(_0x7e0977['error']){if(_0x7e0977[_0xe832('0x10')][_0xe832('0x11')]===0x1f4){logger[_0xe832('0x10')](_0xe832('0x12'),_0x55f136,_0x7e0977[_0xe832('0x10')]['message']);return _0x4cafde(_0x7e0977['error']['message']);}logger[_0xe832('0x10')](_0xe832('0x12'),_0x55f136,_0x7e0977[_0xe832('0x10')][_0xe832('0x13')]);return _0x4eb49e(_0x7e0977[_0xe832('0x10')][_0xe832('0x13')]);}else{logger[_0xe832('0xc')](_0xe832('0x12'),_0x55f136,_0xe832('0xd'));_0x4eb49e(_0x7e0977[_0xe832('0x14')]['message']);}})[_0xe832('0x15')](function(_0x3ecb88){logger['error']('ZohoField,\x20%s,\x20%s',_0x55f136,_0x3ecb88);_0x4cafde(_0x3ecb88);});});}
\ No newline at end of file
+var _0x824a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','stringify','error','ZohoField,\x20%s,\x20%s','message','result','catch','util','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x824a,0x64));var _0xa824=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x824a[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xa824('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa824('0x1'));var db=require(_0xa824('0x2'))['db'];var utils=require(_0xa824('0x3'));var logger=require(_0xa824('0x4'))(_0xa824('0x5'));var config=require(_0xa824('0x6'));var jayson=require(_0xa824('0x7'));var client=jayson[_0xa824('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39fedf,_0x3d8be0,_0x558eb9){return new BPromise(function(_0x1dc1df,_0x235a2f){return client['request'](_0x39fedf,_0x558eb9)['then'](function(_0x2aa3cf){logger[_0xa824('0x9')]('ZohoField,\x20%s,\x20%s',_0x3d8be0,'request\x20sent');logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x3d8be0,_0xa824('0xa'),JSON[_0xa824('0xb')](_0x2aa3cf));if(_0x2aa3cf['error']){if(_0x2aa3cf[_0xa824('0xc')]['code']===0x1f4){logger[_0xa824('0xc')](_0xa824('0xd'),_0x3d8be0,_0x2aa3cf['error'][_0xa824('0xe')]);return _0x235a2f(_0x2aa3cf[_0xa824('0xc')][_0xa824('0xe')]);}logger[_0xa824('0xc')](_0xa824('0xd'),_0x3d8be0,_0x2aa3cf[_0xa824('0xc')][_0xa824('0xe')]);return _0x1dc1df(_0x2aa3cf[_0xa824('0xc')]['message']);}else{logger[_0xa824('0x9')](_0xa824('0xd'),_0x3d8be0,_0xa824('0xa'));_0x1dc1df(_0x2aa3cf[_0xa824('0xf')][_0xa824('0xe')]);}})[_0xa824('0x10')](function(_0x3c5629){logger[_0xa824('0xc')]('ZohoField,\x20%s,\x20%s',_0x3d8be0,_0x3c5629);_0x235a2f(_0x3c5629);});});}
\ No newline at end of file
index f34b06d..dcc0bab 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(_0x560d2a,_0x4a9f54){var _0x3df62d=function(_0x1ce1ec){while(--_0x1ce1ec){_0x560d2a['push'](_0x560d2a['shift']());}};_0x3df62d(++_0x4a9f54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5597d3,_0x3e224e){var _0x43c0a1=function(_0x12137d){while(--_0x12137d){_0x5597d3['push'](_0x5597d3['shift']());}};_0x43c0a1(++_0x3e224e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xcb91[_0x5d9867];return _0x7d2118;};'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 cb4587f..eed88f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f75=['exports','unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN','state','sequelize'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x5f75,0x1af));var _0x55f7=function(_0x2f8c05,_0x551e3d){_0x2f8c05=_0x2f8c05-0x0;var _0x14cfde=_0x5f75[_0x2f8c05];return _0x14cfde;};'use strict';var Sequelize=require(_0x55f7('0x0'));module[_0x55f7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x55f7('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x55f7('0x2')},'main':{'type':Sequelize[_0x55f7('0x3')],'defaultValue':_0x55f7('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x55f7('0x3')]},'type':{'type':Sequelize[_0x55f7('0x3')]},'size':{'type':Sequelize[_0x55f7('0x5')]},'active':{'type':Sequelize[_0x55f7('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x55f7('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x55f7('0x3')],'unique':_0x55f7('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x55f7('0x3')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x55f7('0x3')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xeb74=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xeb74,0xe3));var _0x4eb7=function(_0x426843,_0x4305b5){_0x426843=_0x426843-0x0;var _0x15a61e=_0xeb74[_0x426843];return _0x15a61e;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'name':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![],'unique':_0x4eb7('0x3')},'version':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![],'unique':_0x4eb7('0x3')},'main':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x4eb7('0x2')]},'path':{'type':Sequelize[_0x4eb7('0x2')]},'type':{'type':Sequelize[_0x4eb7('0x2')]},'size':{'type':Sequelize[_0x4eb7('0x4')]},'active':{'type':Sequelize[_0x4eb7('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x4eb7('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x4eb7('0x6')},'description':{'type':Sequelize[_0x4eb7('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index 482073c..e026eae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['stack','name','send','index','map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x1a37,0xb4));var _0x71a3=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x1a37[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));};
\ No newline at end of file
+var _0xc6ac=['type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','eml-format','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/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','Integration','rawAttributes','fieldName'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x26db2e,_0x28b050){_0x26db2e=_0x26db2e-0x0;var _0x5c46cb=_0xc6ac[_0x26db2e];return _0x5c46cb;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['Integration'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));};
\ No newline at end of file
index 401666e..16cfafa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a6=['moment','bluebird','path','rimraf','./integration.attributes','define','Integration','lodash','../../config/logger','api'];(function(_0x5206ed,_0x431a54){var _0x36d262=function(_0x17ec7f){while(--_0x17ec7f){_0x5206ed['push'](_0x5206ed['shift']());}};_0x36d262(++_0x431a54);}(_0xd3a6,0x179));var _0x6d3a=function(_0x4e2310,_0x3ff4f7){_0x4e2310=_0x4e2310-0x0;var _0x20867c=_0xd3a6[_0x4e2310];return _0x20867c;};'use strict';var _=require(_0x6d3a('0x0'));var util=require('util');var logger=require(_0x6d3a('0x1'))(_0x6d3a('0x2'));var moment=require(_0x6d3a('0x3'));var BPromise=require(_0x6d3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d3a('0x5'));var rimraf=require(_0x6d3a('0x6'));var config=require('../../config/environment');var attributes=require(_0x6d3a('0x7'));module['exports']=function(_0x35cb45,_0x330b11){return _0x35cb45[_0x6d3a('0x8')](_0x6d3a('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4c3=['moment','bluebird','request-promise','path','../../config/environment','exports','define','Integration','integrations','lodash','util','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf4c3,0xf9));var _0x3f4c=function(_0x4c577b,_0x6f3228){_0x4c577b=_0x4c577b-0x0;var _0x29d6b4=_0xf4c3[_0x4c577b];return _0x29d6b4;};'use strict';var _=require(_0x3f4c('0x0'));var util=require(_0x3f4c('0x1'));var logger=require('../../config/logger')(_0x3f4c('0x2'));var moment=require(_0x3f4c('0x3'));var BPromise=require(_0x3f4c('0x4'));var rp=require(_0x3f4c('0x5'));var fs=require('fs');var path=require(_0x3f4c('0x6'));var rimraf=require('rimraf');var config=require(_0x3f4c('0x7'));var attributes=require('./integration.attributes');module[_0x3f4c('0x8')]=function(_0x4c06ad,_0x47fdfd){return _0x4c06ad[_0x3f4c('0x9')](_0x3f4c('0xa'),attributes,{'tableName':_0x3f4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 105b162..a050288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3252eb,_0x840a11){var _0x4fd2eb=function(_0x2fc67b){while(--_0x2fc67b){_0x3252eb['push'](_0x3252eb['shift']());}};_0x4fd2eb(++_0x840a11);}(_0xef0f,0x168));var _0xfef0=function(_0x541560,_0x22797b){_0x541560=_0x541560-0x0;var _0x3d4841=_0xef0f[_0x541560];return _0x3d4841;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('Integration,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('Integration,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});}
\ No newline at end of file
+var _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x18fe42,_0x2e1b9b){var _0x419017=function(_0x42f111){while(--_0x42f111){_0x18fe42['push'](_0x18fe42['shift']());}};_0x419017(++_0x2e1b9b);}(_0xd943,0x15d));var _0x3d94=function(_0x2ae1e8,_0x1a11b7){_0x2ae1e8=_0x2ae1e8-0x0;var _0x55ad72=_0xd943[_0x2ae1e8];return _0x55ad72;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}
\ No newline at end of file
index 7a92dab..3e3f491 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['create','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x5952e7,_0x20ea9e){var _0x58ffb6=function(_0x547aa1){while(--_0x547aa1){_0x5952e7['push'](_0x5952e7['shift']());}};_0x58ffb6(++_0x20ea9e);}(_0x57ca,0x108));var _0xa57c=function(_0x34a6cf,_0xdc76d7){_0x34a6cf=_0x34a6cf-0x0;var _0x35369c=_0x57ca[_0x34a6cf];return _0x35369c;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/',auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['put'](_0xa57c('0xd'),auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x11')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);module[_0xa57c('0x13')]=router;
\ No newline at end of file
+var _0x896e=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x896e,0x1e9));var _0xe896=function(_0x5eacae,_0x5d37ab){_0x5eacae=_0x5eacae-0x0;var _0x1d6293=_0x896e[_0x5eacae];return _0x1d6293;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['post']('/',auth[_0xe896('0xe')](),controller['create']);router[_0xe896('0x12')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router;
\ No newline at end of file
index 1cc0afe..be37f21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2098=['BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED','exports','STRING','INTEGER','DATE'];(function(_0x2a1466,_0x5a6dc3){var _0x29258c=function(_0xe6dfb1){while(--_0xe6dfb1){_0x2a1466['push'](_0x2a1466['shift']());}};_0x29258c(++_0x5a6dc3);}(_0x2098,0x146));var _0x8209=function(_0x59c966,_0x1eaa8a){_0x59c966=_0x59c966-0x0;var _0x237282=_0x2098[_0x59c966];return _0x237282;};'use strict';var Sequelize=require('sequelize');module[_0x8209('0x0')]={'integration':{'type':Sequelize[_0x8209('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x8209('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x8209('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8209('0x1')]},'calleridnum':{'type':Sequelize[_0x8209('0x1')]},'calleridname':{'type':Sequelize[_0x8209('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x8209('0x1')]},'membername':{'type':Sequelize[_0x8209('0x1')]},'agentcalledAt':{'type':Sequelize[_0x8209('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8209('0x3')]},'holdtime':{'type':Sequelize[_0x8209('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8209('0x3')]},'talktime':{'type':Sequelize[_0x8209('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8209('0x2')]},'reason':{'type':Sequelize[_0x8209('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8209('0x3')]},'agentdump':{'type':Sequelize[_0x8209('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8209('0x1')]},'channelstate':{'type':Sequelize[_0x8209('0x2')]},'channelstatedesc':{'type':Sequelize[_0x8209('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8209('0x1')]},'accountcode':{'type':Sequelize[_0x8209('0x1')]},'context':{'type':Sequelize[_0x8209('0x1')]},'exten':{'type':Sequelize[_0x8209('0x1')]},'priority':{'type':Sequelize[_0x8209('0x1')]},'destchannel':{'type':Sequelize[_0x8209('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8209('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8209('0x1')]},'destcalleridname':{'type':Sequelize[_0x8209('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x8209('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x8209('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x8209('0x1')]},'destcontext':{'type':Sequelize[_0x8209('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x8209('0x1')]},'destuniqueid':{'type':Sequelize[_0x8209('0x1')]},'messageId':{'type':Sequelize[_0x8209('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x8209('0x1')]},'from':{'type':Sequelize[_0x8209('0x1')]},'to':{'type':Sequelize[_0x8209('0x1')]},'cc':{'type':Sequelize[_0x8209('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x8209('0x5')]},'text':{'type':Sequelize[_0x8209('0x5')]},'status':{'type':Sequelize[_0x8209('0x6')]('SENT',_0x8209('0x7'),_0x8209('0x8'),_0x8209('0x9'))},'url':{'type':Sequelize[_0x8209('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x8209('0x1')]},'projectId':{'type':Sequelize[_0x8209('0x2')]}};
\ No newline at end of file
+var _0xe0ad=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','STRING'];(function(_0x2e2f17,_0x15f099){var _0x2ef958=function(_0x49cab7){while(--_0x49cab7){_0x2e2f17['push'](_0x2e2f17['shift']());}};_0x2ef958(++_0x15f099);}(_0xe0ad,0x1a3));var _0xde0a=function(_0x2c1908,_0x31a153){_0x2c1908=_0x2c1908-0x0;var _0x29394a=_0xe0ad[_0x2c1908];return _0x29394a;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xde0a('0x0')]},'exitStatus':{'type':Sequelize[_0xde0a('0x0')]},'ticketId':{'type':Sequelize[_0xde0a('0x0')]},'integrationId':{'type':Sequelize[_0xde0a('0x1')]},'contacts':{'type':Sequelize[_0xde0a('0x0')]},'uniqueid':{'type':Sequelize[_0xde0a('0x0')]},'calleridnum':{'type':Sequelize[_0xde0a('0x0')]},'calleridname':{'type':Sequelize[_0xde0a('0x0')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xde0a('0x0')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xde0a('0x2')]},'agentconnectAt':{'type':Sequelize[_0xde0a('0x2')]},'holdtime':{'type':Sequelize[_0xde0a('0x1')]},'agentcomplete':{'type':Sequelize[_0xde0a('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xde0a('0x0')]},'agentringnoanswer':{'type':Sequelize[_0xde0a('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xde0a('0x2')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xde0a('0x2')]},'lastevent':{'type':Sequelize[_0xde0a('0x0')]},'channel':{'type':Sequelize[_0xde0a('0x0')]},'channelstate':{'type':Sequelize[_0xde0a('0x1')]},'channelstatedesc':{'type':Sequelize[_0xde0a('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xde0a('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xde0a('0x0')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xde0a('0x0')]},'destchannel':{'type':Sequelize[_0xde0a('0x0')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xde0a('0x0')]},'destcalleridnum':{'type':Sequelize[_0xde0a('0x0')]},'destcalleridname':{'type':Sequelize[_0xde0a('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xde0a('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xde0a('0x0')]},'destexten':{'type':Sequelize[_0xde0a('0x0')]},'destpriority':{'type':Sequelize[_0xde0a('0x0')]},'destuniqueid':{'type':Sequelize[_0xde0a('0x0')]},'messageId':{'type':Sequelize[_0xde0a('0x0')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xde0a('0x0')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xde0a('0x0')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xde0a('0x4')]},'text':{'type':Sequelize[_0xde0a('0x4')]},'status':{'type':Sequelize[_0xde0a('0x5')](_0xde0a('0x6'),_0xde0a('0x7'),_0xde0a('0x8'),_0xde0a('0x9'))},'url':{'type':Sequelize[_0xde0a('0x0')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xde0a('0x1')]}};
\ No newline at end of file
index 211cfd5..7498ace 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf50f=['describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','type','count','includeAll','include','rows','catch','show','find','create','body','params','destroy'];(function(_0x366b32,_0x4148d0){var _0x35479c=function(_0x1c7520){while(--_0x1c7520){_0x366b32['push'](_0x366b32['shift']());}};_0x35479c(++_0x4148d0);}(_0xf50f,0x164));var _0xff50=function(_0x1b270b,_0xfe0c26){_0x1b270b=_0x1b270b-0x0;var _0x2304de=_0xf50f[_0x1b270b];return _0x2304de;};'use strict';var emlformat=require(_0xff50('0x0'));var rimraf=require(_0xff50('0x1'));var zipdir=require(_0xff50('0x2'));var jsonpatch=require(_0xff50('0x3'));var rp=require('request-promise');var moment=require(_0xff50('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff50('0x5'));var util=require(_0xff50('0x6'));var path=require(_0xff50('0x7'));var sox=require('sox');var csv=require(_0xff50('0x8'));var ejs=require(_0xff50('0x9'));var fs=require('fs');var fs_extra=require(_0xff50('0xa'));var _=require(_0xff50('0xb'));var squel=require(_0xff50('0xc'));var crypto=require(_0xff50('0xd'));var jsforce=require(_0xff50('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xff50('0x8'));var querystring=require('querystring');var Papa=require(_0xff50('0xf'));var Redis=require(_0xff50('0x10'));var authService=require(_0xff50('0x11'));var qs=require(_0xff50('0x12'));var as=require(_0xff50('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xff50('0x14'));var utils=require('../../config/utils');var config=require(_0xff50('0x15'));var licenseUtil=require(_0xff50('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12d7bd,_0x5dc90e){_0x5dc90e=_0x5dc90e||0xcc;return function(_0x2c139f){if(_0x2c139f){return _0x12d7bd[_0xff50('0x17')](_0x5dc90e);}return _0x12d7bd[_0xff50('0x18')](_0x5dc90e)['end']();};}function respondWithResult(_0x17c1b4,_0x19bae7){_0x19bae7=_0x19bae7||0xc8;return function(_0x438c5b){if(_0x438c5b){return _0x17c1b4[_0xff50('0x18')](_0x19bae7)['json'](_0x438c5b);}};}function respondWithFilteredResult(_0x497d7d,_0x567f2a){return function(_0x1cf52c){if(_0x1cf52c){var _0x64f3a7=typeof _0x567f2a[_0xff50('0x19')]==='undefined'&&typeof _0x567f2a[_0xff50('0x1a')]===_0xff50('0x1b');var _0x184ba9=_0x1cf52c['count'];var _0x479991=_0x64f3a7?0x0:_0x567f2a[_0xff50('0x19')];var _0x157003=_0x64f3a7?_0x1cf52c['count']:_0x567f2a['offset']+_0x567f2a[_0xff50('0x1a')];var _0x43dd8a;if(_0x157003>=_0x184ba9){_0x157003=_0x184ba9;_0x43dd8a=0xc8;}else{_0x43dd8a=0xce;}_0x497d7d[_0xff50('0x18')](_0x43dd8a);return _0x497d7d[_0xff50('0x1c')](_0xff50('0x1d'),_0x479991+'-'+_0x157003+'/'+_0x184ba9)[_0xff50('0x1e')](_0x1cf52c);}return null;};}function patchUpdates(_0x5382ab){return function(_0x36b534){try{jsonpatch[_0xff50('0x1f')](_0x36b534,_0x5382ab,!![]);}catch(_0x25ef22){return BPromise[_0xff50('0x20')](_0x25ef22);}return _0x36b534[_0xff50('0x21')]();};}function saveUpdates(_0xfc1fc3,_0x5b3e3a){return function(_0xef289f){if(_0xef289f){return _0xef289f[_0xff50('0x22')](_0xfc1fc3)[_0xff50('0x23')](function(_0x451235){return _0x451235;});}return null;};}function removeEntity(_0x2ea0d9,_0x1444e0){return function(_0x4e3370){if(_0x4e3370){return _0x4e3370['destroy']()[_0xff50('0x23')](function(){_0x2ea0d9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36678d,_0x474355){return function(_0x338792){if(!_0x338792){_0x36678d[_0xff50('0x17')](0x194);}return _0x338792;};}function handleError(_0xb025c7,_0x5ec04e){_0x5ec04e=_0x5ec04e||0x1f4;return function(_0x653717){logger['error'](_0x653717[_0xff50('0x24')]);if(_0x653717[_0xff50('0x25')]){delete _0x653717[_0xff50('0x25')];}_0xb025c7[_0xff50('0x18')](_0x5ec04e)[_0xff50('0x26')](_0x653717);};}exports['index']=function(_0x58349a,_0x4f2ebb){var _0x4b0298={},_0xfa7e95={},_0x94704f={'count':0x0,'rows':[]};var _0x4a717d=_[_0xff50('0x27')](db[_0xff50('0x28')][_0xff50('0x29')],function(_0x3289e2){return{'name':_0x3289e2[_0xff50('0x2a')],'type':_0x3289e2['type'][_0xff50('0x2b')]};});_0xfa7e95[_0xff50('0x2c')]=_['map'](_0x4a717d,_0xff50('0x25'));_0xfa7e95[_0xff50('0x2d')]=_[_0xff50('0x2e')](_0x58349a[_0xff50('0x2d')]);_0xfa7e95['filters']=_[_0xff50('0x2f')](_0xfa7e95['model'],_0xfa7e95['query']);_0x4b0298[_0xff50('0x30')]=_['intersection'](_0xfa7e95[_0xff50('0x2c')],qs[_0xff50('0x31')](_0x58349a[_0xff50('0x2d')][_0xff50('0x31')]));_0x4b0298[_0xff50('0x30')]=_0x4b0298['attributes'][_0xff50('0x32')]?_0x4b0298[_0xff50('0x30')]:_0xfa7e95[_0xff50('0x2c')];if(!_0x58349a[_0xff50('0x2d')]['hasOwnProperty'](_0xff50('0x33'))){_0x4b0298[_0xff50('0x1a')]=qs[_0xff50('0x1a')](_0x58349a[_0xff50('0x2d')][_0xff50('0x1a')]);_0x4b0298['offset']=qs[_0xff50('0x19')](_0x58349a[_0xff50('0x2d')]['offset']);}_0x4b0298['order']=qs[_0xff50('0x34')](_0x58349a[_0xff50('0x2d')][_0xff50('0x34')]);_0x4b0298[_0xff50('0x35')]=qs[_0xff50('0x36')](_[_0xff50('0x37')](_0x58349a[_0xff50('0x2d')],_0xfa7e95[_0xff50('0x36')]),_0x4a717d);if(_0x58349a[_0xff50('0x2d')][_0xff50('0x38')]){_0x4b0298[_0xff50('0x35')]=_[_0xff50('0x39')](_0x4b0298[_0xff50('0x35')],{'$or':_[_0xff50('0x27')](_0x4a717d,function(_0x53d52c){if(_0x53d52c[_0xff50('0x3a')]!=='VIRTUAL'){var _0x193ad5={};_0x193ad5[_0x53d52c['name']]={'$like':'%'+_0x58349a[_0xff50('0x2d')][_0xff50('0x38')]+'%'};return _0x193ad5;}})});}_0x4b0298=_[_0xff50('0x39')]({},_0x4b0298,_0x58349a['options']);var _0x5e36e1={'where':_0x4b0298[_0xff50('0x35')]};return db[_0xff50('0x28')]['count'](_0x5e36e1)['then'](function(_0x14b7b4){_0x94704f[_0xff50('0x3b')]=_0x14b7b4;if(_0x58349a[_0xff50('0x2d')][_0xff50('0x3c')]){_0x4b0298[_0xff50('0x3d')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x4b0298);})[_0xff50('0x23')](function(_0x261c0a){_0x94704f[_0xff50('0x3e')]=_0x261c0a;return _0x94704f;})['then'](respondWithFilteredResult(_0x4f2ebb,_0x4b0298))[_0xff50('0x3f')](handleError(_0x4f2ebb,null));};exports[_0xff50('0x40')]=function(_0x5af68,_0x1c26dd){var _0x36242a={'raw':![],'where':{'id':_0x5af68['params']['id']}},_0xe95cee={};_0xe95cee[_0xff50('0x2c')]=_[_0xff50('0x2e')](db['IntegrationReport']['rawAttributes']);_0xe95cee[_0xff50('0x2d')]=_[_0xff50('0x2e')](_0x5af68[_0xff50('0x2d')]);_0xe95cee[_0xff50('0x36')]=_['intersection'](_0xe95cee['model'],_0xe95cee['query']);_0x36242a[_0xff50('0x30')]=_[_0xff50('0x2f')](_0xe95cee[_0xff50('0x2c')],qs[_0xff50('0x31')](_0x5af68[_0xff50('0x2d')]['fields']));_0x36242a['attributes']=_0x36242a[_0xff50('0x30')][_0xff50('0x32')]?_0x36242a[_0xff50('0x30')]:_0xe95cee[_0xff50('0x2c')];if(_0x5af68['query'][_0xff50('0x3c')]){_0x36242a[_0xff50('0x3d')]=[{'all':!![]}];}_0x36242a=_['merge']({},_0x36242a,_0x5af68['options']);return db[_0xff50('0x28')][_0xff50('0x41')](_0x36242a)[_0xff50('0x23')](handleEntityNotFound(_0x1c26dd,null))[_0xff50('0x23')](respondWithResult(_0x1c26dd,null))['catch'](handleError(_0x1c26dd,null));};exports['create']=function(_0x51b97b,_0x1ab33d){return db['IntegrationReport'][_0xff50('0x42')](_0x51b97b[_0xff50('0x43')],{})[_0xff50('0x23')](respondWithResult(_0x1ab33d,0xc9))[_0xff50('0x3f')](handleError(_0x1ab33d,null));};exports[_0xff50('0x22')]=function(_0x174c95,_0x4e4f08){if(_0x174c95[_0xff50('0x43')]['id']){delete _0x174c95[_0xff50('0x43')]['id'];}return db['IntegrationReport'][_0xff50('0x41')]({'where':{'id':_0x174c95[_0xff50('0x44')]['id']}})[_0xff50('0x23')](handleEntityNotFound(_0x4e4f08,null))[_0xff50('0x23')](saveUpdates(_0x174c95['body'],null))[_0xff50('0x23')](respondWithResult(_0x4e4f08,null))['catch'](handleError(_0x4e4f08,null));};exports[_0xff50('0x45')]=function(_0x1464cd,_0x52720d){return db[_0xff50('0x28')]['find']({'where':{'id':_0x1464cd[_0xff50('0x44')]['id']}})[_0xff50('0x23')](handleEntityNotFound(_0x52720d,null))[_0xff50('0x23')](removeEntity(_0x52720d,null))[_0xff50('0x3f')](handleError(_0x52720d,null));};exports[_0xff50('0x46')]=function(_0x410f07,_0x516ebd){return db['IntegrationReport'][_0xff50('0x46')]()[_0xff50('0x23')](respondWithResult(_0x516ebd,null))['catch'](handleError(_0x516ebd,null));};
\ No newline at end of file
+var _0xf25c=['model','name','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','include','catch','show','params','length','includeAll','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','error','stack','send','index','IntegrationReport','rawAttributes','fieldName','type'];(function(_0x201472,_0x5c91b3){var _0x219763=function(_0x1f906b){while(--_0x1f906b){_0x201472['push'](_0x201472['shift']());}};_0x219763(++_0x5c91b3);}(_0xf25c,0x142));var _0xcf25=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0xf25c[_0x595604];return _0x1466f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf25('0x0'));var zipdir=require(_0xcf25('0x1'));var jsonpatch=require(_0xcf25('0x2'));var rp=require(_0xcf25('0x3'));var moment=require(_0xcf25('0x4'));var BPromise=require(_0xcf25('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcf25('0x6'));var sox=require('sox');var csv=require(_0xcf25('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf25('0x8'));var squel=require(_0xcf25('0x9'));var crypto=require('crypto');var jsforce=require(_0xcf25('0xa'));var deskjs=require(_0xcf25('0xb'));var toCsv=require(_0xcf25('0x7'));var querystring=require(_0xcf25('0xc'));var Papa=require(_0xcf25('0xd'));var Redis=require(_0xcf25('0xe'));var authService=require(_0xcf25('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xcf25('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcf25('0x11'));var utils=require(_0xcf25('0x12'));var config=require(_0xcf25('0x13'));var licenseUtil=require(_0xcf25('0x14'));var db=require(_0xcf25('0x15'))['db'];function respondWithStatusCode(_0x327789,_0x3edd9a){_0x3edd9a=_0x3edd9a||0xcc;return function(_0x18b5e2){if(_0x18b5e2){return _0x327789[_0xcf25('0x16')](_0x3edd9a);}return _0x327789[_0xcf25('0x17')](_0x3edd9a)[_0xcf25('0x18')]();};}function respondWithResult(_0x49c945,_0x578f36){_0x578f36=_0x578f36||0xc8;return function(_0x3a54df){if(_0x3a54df){return _0x49c945[_0xcf25('0x17')](_0x578f36)[_0xcf25('0x19')](_0x3a54df);}};}function respondWithFilteredResult(_0x5048b8,_0x4fe53c){return function(_0x3bd26f){if(_0x3bd26f){var _0xa1564f=typeof _0x4fe53c['offset']==='undefined'&&typeof _0x4fe53c[_0xcf25('0x1a')]===_0xcf25('0x1b');var _0x2971ee=_0x3bd26f[_0xcf25('0x1c')];var _0x540689=_0xa1564f?0x0:_0x4fe53c[_0xcf25('0x1d')];var _0x23703e=_0xa1564f?_0x3bd26f['count']:_0x4fe53c[_0xcf25('0x1d')]+_0x4fe53c[_0xcf25('0x1a')];var _0x49171a;if(_0x23703e>=_0x2971ee){_0x23703e=_0x2971ee;_0x49171a=0xc8;}else{_0x49171a=0xce;}_0x5048b8[_0xcf25('0x17')](_0x49171a);return _0x5048b8[_0xcf25('0x1e')](_0xcf25('0x1f'),_0x540689+'-'+_0x23703e+'/'+_0x2971ee)[_0xcf25('0x19')](_0x3bd26f);}return null;};}function patchUpdates(_0x351aed){return function(_0x173815){try{jsonpatch[_0xcf25('0x20')](_0x173815,_0x351aed,!![]);}catch(_0x59b5ba){return BPromise[_0xcf25('0x21')](_0x59b5ba);}return _0x173815['save']();};}function saveUpdates(_0x117ecc,_0xe3ba3c){return function(_0x2910a5){if(_0x2910a5){return _0x2910a5['update'](_0x117ecc)[_0xcf25('0x22')](function(_0x340f68){return _0x340f68;});}return null;};}function removeEntity(_0x4edc32,_0x330183){return function(_0x5d330e){if(_0x5d330e){return _0x5d330e['destroy']()[_0xcf25('0x22')](function(){_0x4edc32['status'](0xcc)[_0xcf25('0x18')]();});}};}function handleEntityNotFound(_0x5638aa,_0x1b23aa){return function(_0x5b1efc){if(!_0x5b1efc){_0x5638aa[_0xcf25('0x16')](0x194);}return _0x5b1efc;};}function handleError(_0x2b8103,_0x4d1ddc){_0x4d1ddc=_0x4d1ddc||0x1f4;return function(_0x285369){logger[_0xcf25('0x23')](_0x285369[_0xcf25('0x24')]);if(_0x285369['name']){delete _0x285369['name'];}_0x2b8103['status'](_0x4d1ddc)[_0xcf25('0x25')](_0x285369);};}exports[_0xcf25('0x26')]=function(_0x22445b,_0x4b2932){var _0x861e22={},_0x317ee1={},_0x183813={'count':0x0,'rows':[]};var _0xa04e58=_['map'](db[_0xcf25('0x27')][_0xcf25('0x28')],function(_0x2aa247){return{'name':_0x2aa247[_0xcf25('0x29')],'type':_0x2aa247[_0xcf25('0x2a')]['key']};});_0x317ee1[_0xcf25('0x2b')]=_['map'](_0xa04e58,_0xcf25('0x2c'));_0x317ee1[_0xcf25('0x2d')]=_[_0xcf25('0x2e')](_0x22445b[_0xcf25('0x2d')]);_0x317ee1['filters']=_[_0xcf25('0x2f')](_0x317ee1['model'],_0x317ee1[_0xcf25('0x2d')]);_0x861e22[_0xcf25('0x30')]=_[_0xcf25('0x2f')](_0x317ee1[_0xcf25('0x2b')],qs[_0xcf25('0x31')](_0x22445b[_0xcf25('0x2d')]['fields']));_0x861e22[_0xcf25('0x30')]=_0x861e22['attributes']['length']?_0x861e22[_0xcf25('0x30')]:_0x317ee1[_0xcf25('0x2b')];if(!_0x22445b[_0xcf25('0x2d')]['hasOwnProperty'](_0xcf25('0x32'))){_0x861e22[_0xcf25('0x1a')]=qs[_0xcf25('0x1a')](_0x22445b[_0xcf25('0x2d')][_0xcf25('0x1a')]);_0x861e22['offset']=qs[_0xcf25('0x1d')](_0x22445b['query'][_0xcf25('0x1d')]);}_0x861e22[_0xcf25('0x33')]=qs[_0xcf25('0x34')](_0x22445b[_0xcf25('0x2d')]['sort']);_0x861e22[_0xcf25('0x35')]=qs[_0xcf25('0x36')](_[_0xcf25('0x37')](_0x22445b['query'],_0x317ee1['filters']),_0xa04e58);if(_0x22445b[_0xcf25('0x2d')]['filter']){_0x861e22['where']=_[_0xcf25('0x38')](_0x861e22[_0xcf25('0x35')],{'$or':_[_0xcf25('0x39')](_0xa04e58,function(_0x595d5d){if(_0x595d5d[_0xcf25('0x2a')]!==_0xcf25('0x3a')){var _0xf2d771={};_0xf2d771[_0x595d5d['name']]={'$like':'%'+_0x22445b[_0xcf25('0x2d')][_0xcf25('0x3b')]+'%'};return _0xf2d771;}})});}_0x861e22=_[_0xcf25('0x38')]({},_0x861e22,_0x22445b[_0xcf25('0x3c')]);var _0x46bc50={'where':_0x861e22[_0xcf25('0x35')]};return db[_0xcf25('0x27')][_0xcf25('0x1c')](_0x46bc50)[_0xcf25('0x22')](function(_0x28e014){_0x183813['count']=_0x28e014;if(_0x22445b['query']['includeAll']){_0x861e22[_0xcf25('0x3d')]=[{'all':!![]}];}return db[_0xcf25('0x27')]['findAll'](_0x861e22);})[_0xcf25('0x22')](function(_0xb429eb){_0x183813['rows']=_0xb429eb;return _0x183813;})[_0xcf25('0x22')](respondWithFilteredResult(_0x4b2932,_0x861e22))[_0xcf25('0x3e')](handleError(_0x4b2932,null));};exports[_0xcf25('0x3f')]=function(_0x18f121,_0x121371){var _0x148f84={'raw':![],'where':{'id':_0x18f121[_0xcf25('0x40')]['id']}},_0x25cc8f={};_0x25cc8f[_0xcf25('0x2b')]=_[_0xcf25('0x2e')](db[_0xcf25('0x27')]['rawAttributes']);_0x25cc8f[_0xcf25('0x2d')]=_['keys'](_0x18f121[_0xcf25('0x2d')]);_0x25cc8f[_0xcf25('0x36')]=_[_0xcf25('0x2f')](_0x25cc8f[_0xcf25('0x2b')],_0x25cc8f['query']);_0x148f84[_0xcf25('0x30')]=_[_0xcf25('0x2f')](_0x25cc8f[_0xcf25('0x2b')],qs[_0xcf25('0x31')](_0x18f121[_0xcf25('0x2d')][_0xcf25('0x31')]));_0x148f84[_0xcf25('0x30')]=_0x148f84[_0xcf25('0x30')][_0xcf25('0x41')]?_0x148f84[_0xcf25('0x30')]:_0x25cc8f[_0xcf25('0x2b')];if(_0x18f121[_0xcf25('0x2d')][_0xcf25('0x42')]){_0x148f84['include']=[{'all':!![]}];}_0x148f84=_[_0xcf25('0x38')]({},_0x148f84,_0x18f121[_0xcf25('0x3c')]);return db['IntegrationReport'][_0xcf25('0x43')](_0x148f84)[_0xcf25('0x22')](handleEntityNotFound(_0x121371,null))[_0xcf25('0x22')](respondWithResult(_0x121371,null))[_0xcf25('0x3e')](handleError(_0x121371,null));};exports[_0xcf25('0x44')]=function(_0x59cf49,_0x3448e2){return db[_0xcf25('0x27')][_0xcf25('0x44')](_0x59cf49[_0xcf25('0x45')],{})['then'](respondWithResult(_0x3448e2,0xc9))[_0xcf25('0x3e')](handleError(_0x3448e2,null));};exports[_0xcf25('0x46')]=function(_0x2aa872,_0x2510b5){if(_0x2aa872[_0xcf25('0x45')]['id']){delete _0x2aa872[_0xcf25('0x45')]['id'];}return db['IntegrationReport'][_0xcf25('0x43')]({'where':{'id':_0x2aa872[_0xcf25('0x40')]['id']}})[_0xcf25('0x22')](handleEntityNotFound(_0x2510b5,null))['then'](saveUpdates(_0x2aa872[_0xcf25('0x45')],null))[_0xcf25('0x22')](respondWithResult(_0x2510b5,null))[_0xcf25('0x3e')](handleError(_0x2510b5,null));};exports[_0xcf25('0x47')]=function(_0xd64482,_0x45cbdc){return db[_0xcf25('0x27')]['find']({'where':{'id':_0xd64482[_0xcf25('0x40')]['id']}})[_0xcf25('0x22')](handleEntityNotFound(_0x45cbdc,null))[_0xcf25('0x22')](removeEntity(_0x45cbdc,null))[_0xcf25('0x3e')](handleError(_0x45cbdc,null));};exports[_0xcf25('0x48')]=function(_0xc833c3,_0x3bce33){return db[_0xcf25('0x27')][_0xcf25('0x48')]()[_0xcf25('0x22')](respondWithResult(_0x3bce33,null))['catch'](handleError(_0x3bce33,null));};
\ No newline at end of file
index 859689a..c6e03b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19ff=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','util'];(function(_0x29d5a2,_0x4ac599){var _0xbd6f7d=function(_0x337678){while(--_0x337678){_0x29d5a2['push'](_0x29d5a2['shift']());}};_0xbd6f7d(++_0x4ac599);}(_0x19ff,0x129));var _0xf19f=function(_0x3d1493,_0x440c17){_0x3d1493=_0x3d1493-0x0;var _0x30b29b=_0x19ff[_0x3d1493];return _0x30b29b;};'use strict';var _=require(_0xf19f('0x0'));var util=require(_0xf19f('0x1'));var logger=require(_0xf19f('0x2'))(_0xf19f('0x3'));var moment=require(_0xf19f('0x4'));var BPromise=require('bluebird');var rp=require(_0xf19f('0x5'));var fs=require('fs');var path=require(_0xf19f('0x6'));var rimraf=require(_0xf19f('0x7'));var config=require(_0xf19f('0x8'));var attributes=require(_0xf19f('0x9'));module[_0xf19f('0xa')]=function(_0x783409,_0x1990f0){return _0x783409[_0xf19f('0xb')](_0xf19f('0xc'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0739=['moment','rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','util'];(function(_0x40493f,_0x3869e0){var _0x2aa333=function(_0x4fd289){while(--_0x4fd289){_0x40493f['push'](_0x40493f['shift']());}};_0x2aa333(++_0x3869e0);}(_0x0739,0x1b7));var _0x9073=function(_0x190c92,_0x46a8df){_0x190c92=_0x190c92-0x0;var _0x473dc8=_0x0739[_0x190c92];return _0x473dc8;};'use strict';var _=require(_0x9073('0x0'));var util=require(_0x9073('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9073('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9073('0x3'));var config=require(_0x9073('0x4'));var attributes=require('./integrationReport.attributes');module[_0x9073('0x5')]=function(_0x1a0f53,_0x32be39){return _0x1a0f53[_0x9073('0x6')](_0x9073('0x7'),attributes,{'tableName':_0x9073('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f7f656..50b0dd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1abd8d,_0x3a8b31){_0x1abd8d=_0x1abd8d-0x0;var _0x3f5250=_0xc2c7[_0x1abd8d];return _0x3f5250;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});}
\ No newline at end of file
+var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x45d8b0,_0x42b4ea){_0x45d8b0=_0x45d8b0-0x0;var _0x4b04c8=_0x3f8a[_0x45d8b0];return _0x4b04c8;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('IntegrationReport,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});}
\ No newline at end of file
index dda1889..d1779d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa014=['update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','/:id','/:id/sub_intervals','getIntervals','post','create','isAuthenticated','addInterval','/:id/sub_intervals/create_many','addIntervals'];(function(_0x3d9b4d,_0x581243){var _0x2b579c=function(_0x271a7a){while(--_0x271a7a){_0x3d9b4d['push'](_0x3d9b4d['shift']());}};_0x2b579c(++_0x581243);}(_0xa014,0xeb));var _0x4a01=function(_0x57a629,_0x302070){_0x57a629=_0x57a629-0x0;var _0x4963d7=_0xa014[_0x57a629];return _0x4963d7;};'use strict';var multer=require(_0x4a01('0x0'));var util=require(_0x4a01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4a01('0x2')]();var fs_extra=require(_0x4a01('0x3'));var auth=require(_0x4a01('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4a01('0x5'));var controller=require(_0x4a01('0x6'));router[_0x4a01('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4a01('0x7')](_0x4a01('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x4a01('0x7')](_0x4a01('0x9'),auth['isAuthenticated'](),controller[_0x4a01('0xa')]);router[_0x4a01('0xb')]('/',auth['isAuthenticated'](),controller[_0x4a01('0xc')]);router[_0x4a01('0xb')](_0x4a01('0x9'),auth[_0x4a01('0xd')](),controller[_0x4a01('0xe')]);router[_0x4a01('0xb')](_0x4a01('0xf'),auth[_0x4a01('0xd')](),controller[_0x4a01('0x10')]);router['put'](_0x4a01('0x8'),auth['isAuthenticated'](),controller[_0x4a01('0x11')]);router[_0x4a01('0x12')](_0x4a01('0x8'),auth[_0x4a01('0xd')](),controller[_0x4a01('0x13')]);module[_0x4a01('0x14')]=router;
\ No newline at end of file
+var _0xbc1c=['../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addIntervals','put','update','exports','util','connect-timeout','Router','fs-extra'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0xbc1c,0xd8));var _0xcbc1=function(_0x185334,_0x4630ac){_0x185334=_0x185334-0x0;var _0xf2e59a=_0xbc1c[_0x185334];return _0xf2e59a;};'use strict';var multer=require('multer');var util=require(_0xcbc1('0x0'));var path=require('path');var timeout=require(_0xcbc1('0x1'));var express=require('express');var router=express[_0xcbc1('0x2')]();var fs_extra=require(_0xcbc1('0x3'));var auth=require(_0xcbc1('0x4'));var interaction=require(_0xcbc1('0x5'));var config=require('../../config/environment');var controller=require(_0xcbc1('0x6'));router[_0xcbc1('0x7')]('/',auth[_0xcbc1('0x8')](),controller[_0xcbc1('0x9')]);router[_0xcbc1('0x7')](_0xcbc1('0xa'),auth['isAuthenticated'](),controller[_0xcbc1('0xb')]);router[_0xcbc1('0x7')](_0xcbc1('0xc'),auth[_0xcbc1('0x8')](),controller[_0xcbc1('0xd')]);router[_0xcbc1('0xe')]('/',auth['isAuthenticated'](),controller[_0xcbc1('0xf')]);router['post'](_0xcbc1('0xc'),auth[_0xcbc1('0x8')](),controller['addInterval']);router[_0xcbc1('0xe')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0xcbc1('0x10')]);router[_0xcbc1('0x11')]('/:id',auth[_0xcbc1('0x8')](),controller[_0xcbc1('0x12')]);router['delete']('/:id',auth[_0xcbc1('0x8')](),controller['destroy']);module[_0xcbc1('0x13')]=router;
\ No newline at end of file
index d18688f..7de4ad5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe5e=['STRING','sequelize','exports'];(function(_0x4d0102,_0x1f0542){var _0x572417=function(_0x714591){while(--_0x714591){_0x4d0102['push'](_0x4d0102['shift']());}};_0x572417(++_0x1f0542);}(_0xfe5e,0x187));var _0xefe5=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xfe5e[_0xffa198];return _0x1e4b50;};'use strict';var Sequelize=require(_0xefe5('0x0'));module[_0xefe5('0x1')]={'name':{'type':Sequelize[_0xefe5('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x5ccd=['STRING','sequelize','exports'];(function(_0x5b50c2,_0xf53915){var _0x1f2378=function(_0x3edfd1){while(--_0x3edfd1){_0x5b50c2['push'](_0x5b50c2['shift']());}};_0x1f2378(++_0xf53915);}(_0x5ccd,0xa0));var _0xd5cc=function(_0x1d1f80,_0x2c87c0){_0x1d1f80=_0x1d1f80-0x0;var _0x380d8b=_0x5ccd[_0x1d1f80];return _0x380d8b;};'use strict';var Sequelize=require(_0xd5cc('0x0'));module[_0xd5cc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd5cc('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 5e9ffba..a886a2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1519=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','offset','limit','undefined','count','set','apply','save','then','get','destroy','stack','name','fieldName','type','key','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Interval','includeAll','include','rows','catch','params','model','find','create','role','user','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','IntervalId','findOne','rawAttributes','getIntervals','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x1c03f3,_0x5ab547){var _0xe95af7=function(_0x4b32f6){while(--_0x4b32f6){_0x1c03f3['push'](_0x1c03f3['shift']());}};_0xe95af7(++_0x5ab547);}(_0x1519,0x1ef));var _0x9151=function(_0x105d88,_0x429afe){_0x105d88=_0x105d88-0x0;var _0x40cac4=_0x1519[_0x105d88];return _0x40cac4;};'use strict';var emlformat=require(_0x9151('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9151('0x1'));var jsonpatch=require(_0x9151('0x2'));var rp=require(_0x9151('0x3'));var moment=require(_0x9151('0x4'));var BPromise=require(_0x9151('0x5'));var Mustache=require(_0x9151('0x6'));var util=require(_0x9151('0x7'));var path=require('path');var sox=require(_0x9151('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9151('0x9'));var _=require('lodash');var squel=require(_0x9151('0xa'));var crypto=require(_0x9151('0xb'));var jsforce=require(_0x9151('0xc'));var deskjs=require(_0x9151('0xd'));var toCsv=require(_0x9151('0xe'));var querystring=require(_0x9151('0xf'));var Papa=require(_0x9151('0x10'));var Redis=require(_0x9151('0x11'));var authService=require(_0x9151('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9151('0x13'));var logger=require(_0x9151('0x14'))(_0x9151('0x15'));var utils=require('../../config/utils');var config=require(_0x9151('0x16'));var licenseUtil=require(_0x9151('0x17'));var db=require(_0x9151('0x18'))['db'];var extensions=require(_0x9151('0x19'));function respondWithStatusCode(_0x17a17d,_0x7878d3){_0x7878d3=_0x7878d3||0xcc;return function(_0x2e3f9b){if(_0x2e3f9b){return _0x17a17d[_0x9151('0x1a')](_0x7878d3);}return _0x17a17d[_0x9151('0x1b')](_0x7878d3)[_0x9151('0x1c')]();};}function respondWithResult(_0x29595d,_0x1e7f1b){_0x1e7f1b=_0x1e7f1b||0xc8;return function(_0xd11f4d){if(_0xd11f4d){return _0x29595d[_0x9151('0x1b')](_0x1e7f1b)['json'](_0xd11f4d);}};}function respondWithFilteredResult(_0x3644bf,_0x4dc0d3){return function(_0x31a7fb){if(_0x31a7fb){var _0x19d0e0=typeof _0x4dc0d3[_0x9151('0x1d')]==='undefined'&&typeof _0x4dc0d3[_0x9151('0x1e')]===_0x9151('0x1f');var _0x4f7f02=_0x31a7fb[_0x9151('0x20')];var _0x21b545=_0x19d0e0?0x0:_0x4dc0d3['offset'];var _0x26f4fe=_0x19d0e0?_0x31a7fb[_0x9151('0x20')]:_0x4dc0d3[_0x9151('0x1d')]+_0x4dc0d3[_0x9151('0x1e')];var _0x1306a9;if(_0x26f4fe>=_0x4f7f02){_0x26f4fe=_0x4f7f02;_0x1306a9=0xc8;}else{_0x1306a9=0xce;}_0x3644bf[_0x9151('0x1b')](_0x1306a9);return _0x3644bf[_0x9151('0x21')]('Content-Range',_0x21b545+'-'+_0x26f4fe+'/'+_0x4f7f02)['json'](_0x31a7fb);}return null;};}function patchUpdates(_0x30a077){return function(_0x1fe22d){try{jsonpatch[_0x9151('0x22')](_0x1fe22d,_0x30a077,!![]);}catch(_0x26d7c0){return BPromise['reject'](_0x26d7c0);}return _0x1fe22d[_0x9151('0x23')]();};}function saveUpdates(_0x531bca,_0xa13797){return function(_0x255478){if(_0x255478){return _0x255478['update'](_0x531bca)[_0x9151('0x24')](function(_0xd49908){return _0xd49908;});}return null;};}function removeEntity(_0x10c6f1,_0x43ae16){return function(_0xaa38a8){if(_0xaa38a8){return _0xaa38a8['destroy']()['then'](function(){var _0x2f4e9c=_0xaa38a8[_0x9151('0x25')]({'plain':!![]});var _0x1e2a43='Intervals';return db['UserProfileResource'][_0x9151('0x26')]({'where':{'type':_0x1e2a43,'resourceId':_0x2f4e9c['id']}})[_0x9151('0x24')](function(){return _0xaa38a8;});})[_0x9151('0x24')](function(){_0x10c6f1[_0x9151('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b554d,_0x259996){return function(_0x31eb78){if(!_0x31eb78){_0x4b554d[_0x9151('0x1a')](0x194);}return _0x31eb78;};}function handleError(_0x5bb360,_0x43bf3c){_0x43bf3c=_0x43bf3c||0x1f4;return function(_0x467363){logger['error'](_0x467363[_0x9151('0x27')]);if(_0x467363[_0x9151('0x28')]){delete _0x467363[_0x9151('0x28')];}_0x5bb360[_0x9151('0x1b')](_0x43bf3c)['send'](_0x467363);};}exports['index']=function(_0x30f43b,_0x148882){var _0xfd8f64={},_0x522a0f={},_0x27b50b={'count':0x0,'rows':[]};var _0x1344b7=_['map'](db['Interval']['rawAttributes'],function(_0xff52f0){return{'name':_0xff52f0[_0x9151('0x29')],'type':_0xff52f0[_0x9151('0x2a')][_0x9151('0x2b')]};});_0x522a0f['model']=_[_0x9151('0x2c')](_0x1344b7,_0x9151('0x28'));_0x522a0f[_0x9151('0x2d')]=_[_0x9151('0x2e')](_0x30f43b[_0x9151('0x2d')]);_0x522a0f[_0x9151('0x2f')]=_[_0x9151('0x30')](_0x522a0f['model'],_0x522a0f[_0x9151('0x2d')]);_0xfd8f64[_0x9151('0x31')]=_[_0x9151('0x30')](_0x522a0f['model'],qs[_0x9151('0x32')](_0x30f43b[_0x9151('0x2d')][_0x9151('0x32')]));_0xfd8f64['attributes']=_0xfd8f64[_0x9151('0x31')][_0x9151('0x33')]?_0xfd8f64['attributes']:_0x522a0f['model'];if(!_0x30f43b[_0x9151('0x2d')][_0x9151('0x34')](_0x9151('0x35'))){_0xfd8f64[_0x9151('0x1e')]=qs[_0x9151('0x1e')](_0x30f43b[_0x9151('0x2d')][_0x9151('0x1e')]);_0xfd8f64[_0x9151('0x1d')]=qs[_0x9151('0x1d')](_0x30f43b[_0x9151('0x2d')][_0x9151('0x1d')]);}_0xfd8f64[_0x9151('0x36')]=qs['sort'](_0x30f43b[_0x9151('0x2d')][_0x9151('0x37')]);_0xfd8f64[_0x9151('0x38')]=qs[_0x9151('0x2f')](_[_0x9151('0x39')](_0x30f43b['query'],_0x522a0f[_0x9151('0x2f')]),_0x1344b7);if(_0x30f43b[_0x9151('0x2d')][_0x9151('0x3a')]){_0xfd8f64['where']=_[_0x9151('0x3b')](_0xfd8f64['where'],{'$or':_['map'](_0x1344b7,function(_0x1ed2d9){if(_0x1ed2d9[_0x9151('0x2a')]!=='VIRTUAL'){var _0x7efe67={};_0x7efe67[_0x1ed2d9[_0x9151('0x28')]]={'$like':'%'+_0x30f43b[_0x9151('0x2d')]['filter']+'%'};return _0x7efe67;}})});}_0xfd8f64=_[_0x9151('0x3b')]({},_0xfd8f64,_0x30f43b[_0x9151('0x3c')]);var _0x192160={'where':_0xfd8f64[_0x9151('0x38')]};return db[_0x9151('0x3d')][_0x9151('0x20')](_0x192160)[_0x9151('0x24')](function(_0x5d5347){_0x27b50b['count']=_0x5d5347;if(_0x30f43b[_0x9151('0x2d')][_0x9151('0x3e')]){_0xfd8f64[_0x9151('0x3f')]=[{'all':!![]}];}return db['Interval']['findAll'](_0xfd8f64);})['then'](function(_0x183a1a){_0x27b50b[_0x9151('0x40')]=_0x183a1a;return _0x27b50b;})['then'](respondWithFilteredResult(_0x148882,_0xfd8f64))[_0x9151('0x41')](handleError(_0x148882,null));};exports['show']=function(_0xc39aef,_0x751605){var _0x161c26={'raw':!![],'where':{'id':_0xc39aef[_0x9151('0x42')]['id']}},_0x193480={};_0x193480[_0x9151('0x43')]=_[_0x9151('0x2e')](db['Interval']['rawAttributes']);_0x193480['query']=_[_0x9151('0x2e')](_0xc39aef['query']);_0x193480[_0x9151('0x2f')]=_[_0x9151('0x30')](_0x193480['model'],_0x193480['query']);_0x161c26['attributes']=_['intersection'](_0x193480[_0x9151('0x43')],qs[_0x9151('0x32')](_0xc39aef[_0x9151('0x2d')]['fields']));_0x161c26[_0x9151('0x31')]=_0x161c26[_0x9151('0x31')][_0x9151('0x33')]?_0x161c26['attributes']:_0x193480['model'];if(_0xc39aef[_0x9151('0x2d')][_0x9151('0x3e')]){_0x161c26[_0x9151('0x3f')]=[{'all':!![]}];}_0x161c26=_[_0x9151('0x3b')]({},_0x161c26,_0xc39aef['options']);return db[_0x9151('0x3d')][_0x9151('0x44')](_0x161c26)[_0x9151('0x24')](handleEntityNotFound(_0x751605,null))[_0x9151('0x24')](respondWithResult(_0x751605,null))[_0x9151('0x41')](handleError(_0x751605,null));};exports['create']=function(_0x39c1b6,_0x3b48f6){return db[_0x9151('0x3d')][_0x9151('0x45')](_0x39c1b6['body'],{})[_0x9151('0x24')](function(_0x32bc5e){var _0x54fc22=_0x39c1b6['user'][_0x9151('0x25')]({'plain':!![]});if(!_0x54fc22)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54fc22[_0x9151('0x46')]===_0x9151('0x47')){var _0x26e666=_0x32bc5e[_0x9151('0x25')]({'plain':!![]});var _0xddb463='Intervals';return db[_0x9151('0x48')]['find']({'where':{'name':_0xddb463,'userProfileId':_0x54fc22[_0x9151('0x49')]},'raw':!![]})['then'](function(_0x31d906){if(_0x31d906&&_0x31d906['autoAssociation']===0x0){return db[_0x9151('0x4a')]['create']({'name':_0x26e666['name'],'resourceId':_0x26e666['id'],'type':_0x31d906[_0x9151('0x28')],'sectionId':_0x31d906['id']},{})[_0x9151('0x24')](function(){return _0x32bc5e;});}else{return _0x32bc5e;}})[_0x9151('0x41')](function(_0x3692ea){logger[_0x9151('0x4b')](_0x9151('0x4c'),_0x3692ea);throw _0x3692ea;});}return _0x32bc5e;})[_0x9151('0x24')](respondWithResult(_0x3b48f6,0xc9))[_0x9151('0x41')](handleError(_0x3b48f6,null));};exports[_0x9151('0x4d')]=function(_0x35abb4,_0x385dd6){if(_0x35abb4[_0x9151('0x4e')]['id']){delete _0x35abb4[_0x9151('0x4e')]['id'];}return db[_0x9151('0x3d')][_0x9151('0x44')]({'where':{'id':_0x35abb4['params']['id']}})[_0x9151('0x24')](handleEntityNotFound(_0x385dd6,null))[_0x9151('0x24')](saveUpdates(_0x35abb4['body'],null))[_0x9151('0x24')](respondWithResult(_0x385dd6,null))['catch'](handleError(_0x385dd6,null));};exports[_0x9151('0x26')]=function(_0x38ff51,_0x2eefbc){return db[_0x9151('0x3d')][_0x9151('0x44')]({'where':{'id':_0x38ff51['params']['id']}})[_0x9151('0x24')](handleEntityNotFound(_0x2eefbc,null))[_0x9151('0x24')](removeEntity(_0x2eefbc,null))['catch'](handleError(_0x2eefbc,null));};exports[_0x9151('0x4f')]=function(_0x48301c,_0x1b78e2,_0x52d85a){if(_0x48301c[_0x9151('0x4e')]['id']){delete _0x48301c[_0x9151('0x4e')]['id'];}return db[_0x9151('0x3d')]['find']({'where':{'id':_0x48301c[_0x9151('0x42')]['id']}})['then'](handleEntityNotFound(_0x1b78e2,null))[_0x9151('0x24')](function(_0x16ab82){if(_0x16ab82){_0x48301c[_0x9151('0x4e')][_0x9151('0x50')]=_0x16ab82['id'];return db['Interval'][_0x9151('0x45')](_0x48301c['body']);}})[_0x9151('0x24')](respondWithResult(_0x1b78e2,null))[_0x9151('0x41')](handleError(_0x1b78e2,null));};exports['getIntervals']=function(_0x20eceb,_0x2c2f62,_0x581f27){var _0x36f79f={};var _0x12c0e2={};var _0x2f5f7f;var _0x25cc2f;return db[_0x9151('0x3d')][_0x9151('0x51')]({'where':{'id':_0x20eceb[_0x9151('0x42')]['id']}})[_0x9151('0x24')](handleEntityNotFound(_0x2c2f62,null))[_0x9151('0x24')](function(_0x46e3f8){if(_0x46e3f8){_0x2f5f7f=_0x46e3f8;_0x12c0e2[_0x9151('0x43')]=_[_0x9151('0x2e')](db[_0x9151('0x3d')][_0x9151('0x52')]);_0x12c0e2[_0x9151('0x2d')]=_['keys'](_0x20eceb[_0x9151('0x2d')]);_0x12c0e2['filters']=_[_0x9151('0x30')](_0x12c0e2[_0x9151('0x43')],_0x12c0e2[_0x9151('0x2d')]);_0x36f79f[_0x9151('0x31')]=_[_0x9151('0x30')](_0x12c0e2[_0x9151('0x43')],qs['fields'](_0x20eceb['query'][_0x9151('0x32')]));_0x36f79f[_0x9151('0x31')]=_0x36f79f[_0x9151('0x31')][_0x9151('0x33')]?_0x36f79f[_0x9151('0x31')]:_0x12c0e2[_0x9151('0x43')];_0x36f79f[_0x9151('0x36')]=qs['sort'](_0x20eceb[_0x9151('0x2d')]['sort']);_0x36f79f[_0x9151('0x38')]=qs['filters'](_[_0x9151('0x39')](_0x20eceb[_0x9151('0x2d')],_0x12c0e2['filters']));if(_0x20eceb[_0x9151('0x2d')][_0x9151('0x3a')]){_0x36f79f[_0x9151('0x38')]=_[_0x9151('0x3b')](_0x36f79f['where'],{'$or':_[_0x9151('0x2c')](_0x36f79f[_0x9151('0x31')],function(_0x2bf48f){var _0x5d1739={};_0x5d1739[_0x2bf48f]={'$like':'%'+_0x20eceb[_0x9151('0x2d')][_0x9151('0x3a')]+'%'};return _0x5d1739;})});}_0x36f79f=_[_0x9151('0x3b')]({},_0x36f79f,_0x20eceb[_0x9151('0x3c')]);return _0x2f5f7f['getIntervals'](_0x36f79f);}})[_0x9151('0x24')](function(_0x134a23){if(_0x134a23){_0x25cc2f=_0x134a23['length'];if(!_0x20eceb['query'][_0x9151('0x34')](_0x9151('0x35'))){_0x36f79f[_0x9151('0x1e')]=qs[_0x9151('0x1e')](_0x20eceb[_0x9151('0x2d')]['limit']);_0x36f79f['offset']=qs[_0x9151('0x1d')](_0x20eceb[_0x9151('0x2d')][_0x9151('0x1d')]);}return _0x2f5f7f[_0x9151('0x53')](_0x36f79f);}})[_0x9151('0x24')](function(_0x4ead6e){if(_0x4ead6e){return _0x4ead6e?{'count':_0x25cc2f,'rows':_0x4ead6e}:null;}})['then'](respondWithResult(_0x2c2f62,null))[_0x9151('0x41')](handleError(_0x2c2f62,null));};exports['addIntervals']=function(_0xb3395,_0x3d57fe,_0x3ee069){return db[_0x9151('0x3d')]['findOne']({'where':{'id':_0xb3395[_0x9151('0x42')]['id']}})[_0x9151('0x24')](handleEntityNotFound(_0x3d57fe,null))[_0x9151('0x24')](function(_0x4a6cc3){if(_0x4a6cc3){return db['sequelize']['transaction'](function(_0x64d78e){return db[_0x9151('0x3d')][_0x9151('0x26')]({'where':{'IntervalId':_0xb3395[_0x9151('0x42')]['id']},'transaction':_0x64d78e})[_0x9151('0x24')](function(_0x20d780){var _0x19d30a=_[_0x9151('0x2c')](_0xb3395[_0x9151('0x4e')],function(_0x483e2c){delete _0x483e2c['id'];_0x483e2c['IntervalId']=_0xb3395[_0x9151('0x42')]['id'];return _0x483e2c;});return db[_0x9151('0x3d')]['bulkCreate'](_0x19d30a,{'transaction':_0x64d78e});});})[_0x9151('0x24')](function(){return db[_0x9151('0x3d')][_0x9151('0x54')]({'where':{'IntervalId':_0xb3395[_0x9151('0x42')]['id']}});});}})[_0x9151('0x24')](respondWithResult(_0x3d57fe,null))['catch'](handleError(_0x3d57fe,null));};
\ No newline at end of file
+var _0x1fa6=['update','getIntervals','findOne','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','Intervals','destroy','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1fa4b7,_0x44b5e1){var _0x2ef5b4=function(_0x451f59){while(--_0x451f59){_0x1fa4b7['push'](_0x1fa4b7['shift']());}};_0x2ef5b4(++_0x44b5e1);}(_0x1fa6,0x1ed));var _0x61fa=function(_0x960cec,_0xcec0cb){_0x960cec=_0x960cec-0x0;var _0x4190b4=_0x1fa6[_0x960cec];return _0x4190b4;};'use strict';var emlformat=require(_0x61fa('0x0'));var rimraf=require(_0x61fa('0x1'));var zipdir=require(_0x61fa('0x2'));var jsonpatch=require(_0x61fa('0x3'));var rp=require('request-promise');var moment=require(_0x61fa('0x4'));var BPromise=require(_0x61fa('0x5'));var Mustache=require(_0x61fa('0x6'));var util=require(_0x61fa('0x7'));var path=require(_0x61fa('0x8'));var sox=require(_0x61fa('0x9'));var csv=require(_0x61fa('0xa'));var ejs=require(_0x61fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61fa('0xc'));var squel=require(_0x61fa('0xd'));var crypto=require(_0x61fa('0xe'));var jsforce=require(_0x61fa('0xf'));var deskjs=require(_0x61fa('0x10'));var toCsv=require(_0x61fa('0xa'));var querystring=require(_0x61fa('0x11'));var Papa=require('papaparse');var Redis=require(_0x61fa('0x12'));var authService=require(_0x61fa('0x13'));var qs=require(_0x61fa('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x61fa('0x15'));var logger=require(_0x61fa('0x16'))(_0x61fa('0x17'));var utils=require(_0x61fa('0x18'));var config=require(_0x61fa('0x19'));var licenseUtil=require(_0x61fa('0x1a'));var db=require(_0x61fa('0x1b'))['db'];var extensions=require(_0x61fa('0x1c'));function respondWithStatusCode(_0x68fecb,_0x2c84db){_0x2c84db=_0x2c84db||0xcc;return function(_0x1d4f43){if(_0x1d4f43){return _0x68fecb[_0x61fa('0x1d')](_0x2c84db);}return _0x68fecb[_0x61fa('0x1e')](_0x2c84db)[_0x61fa('0x1f')]();};}function respondWithResult(_0x48e5de,_0x4f06c1){_0x4f06c1=_0x4f06c1||0xc8;return function(_0x2c3ada){if(_0x2c3ada){return _0x48e5de[_0x61fa('0x1e')](_0x4f06c1)[_0x61fa('0x20')](_0x2c3ada);}};}function respondWithFilteredResult(_0x2f4f48,_0x2f44a4){return function(_0x31806d){if(_0x31806d){var _0x43e82e=typeof _0x2f44a4[_0x61fa('0x21')]===_0x61fa('0x22')&&typeof _0x2f44a4[_0x61fa('0x23')]===_0x61fa('0x22');var _0x1b6c84=_0x31806d[_0x61fa('0x24')];var _0x31c24e=_0x43e82e?0x0:_0x2f44a4['offset'];var _0x4d418d=_0x43e82e?_0x31806d['count']:_0x2f44a4['offset']+_0x2f44a4['limit'];var _0x430814;if(_0x4d418d>=_0x1b6c84){_0x4d418d=_0x1b6c84;_0x430814=0xc8;}else{_0x430814=0xce;}_0x2f4f48[_0x61fa('0x1e')](_0x430814);return _0x2f4f48['set'](_0x61fa('0x25'),_0x31c24e+'-'+_0x4d418d+'/'+_0x1b6c84)[_0x61fa('0x20')](_0x31806d);}return null;};}function patchUpdates(_0x3ac9b7){return function(_0xf87204){try{jsonpatch[_0x61fa('0x26')](_0xf87204,_0x3ac9b7,!![]);}catch(_0x403051){return BPromise[_0x61fa('0x27')](_0x403051);}return _0xf87204[_0x61fa('0x28')]();};}function saveUpdates(_0x319bce,_0x1b8b53){return function(_0x1a3a52){if(_0x1a3a52){return _0x1a3a52['update'](_0x319bce)[_0x61fa('0x29')](function(_0x543b52){return _0x543b52;});}return null;};}function removeEntity(_0x4bf993,_0x16d41f){return function(_0x2cc4a9){if(_0x2cc4a9){return _0x2cc4a9['destroy']()[_0x61fa('0x29')](function(){var _0x46a725=_0x2cc4a9['get']({'plain':!![]});var _0x557719=_0x61fa('0x2a');return db['UserProfileResource'][_0x61fa('0x2b')]({'where':{'type':_0x557719,'resourceId':_0x46a725['id']}})[_0x61fa('0x29')](function(){return _0x2cc4a9;});})[_0x61fa('0x29')](function(){_0x4bf993[_0x61fa('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20bf36,_0x5c99ec){return function(_0x2ca782){if(!_0x2ca782){_0x20bf36[_0x61fa('0x1d')](0x194);}return _0x2ca782;};}function handleError(_0x371de3,_0xf60ecb){_0xf60ecb=_0xf60ecb||0x1f4;return function(_0x2fc2e8){logger['error'](_0x2fc2e8[_0x61fa('0x2c')]);if(_0x2fc2e8['name']){delete _0x2fc2e8[_0x61fa('0x2d')];}_0x371de3[_0x61fa('0x1e')](_0xf60ecb)[_0x61fa('0x2e')](_0x2fc2e8);};}exports[_0x61fa('0x2f')]=function(_0x4bea4c,_0x590705){var _0x8a8967={},_0x1dcdfc={},_0x513573={'count':0x0,'rows':[]};var _0x209815=_[_0x61fa('0x30')](db[_0x61fa('0x31')][_0x61fa('0x32')],function(_0x4c9a24){return{'name':_0x4c9a24[_0x61fa('0x33')],'type':_0x4c9a24[_0x61fa('0x34')][_0x61fa('0x35')]};});_0x1dcdfc[_0x61fa('0x36')]=_['map'](_0x209815,_0x61fa('0x2d'));_0x1dcdfc[_0x61fa('0x37')]=_[_0x61fa('0x38')](_0x4bea4c[_0x61fa('0x37')]);_0x1dcdfc[_0x61fa('0x39')]=_[_0x61fa('0x3a')](_0x1dcdfc[_0x61fa('0x36')],_0x1dcdfc[_0x61fa('0x37')]);_0x8a8967[_0x61fa('0x3b')]=_[_0x61fa('0x3a')](_0x1dcdfc['model'],qs[_0x61fa('0x3c')](_0x4bea4c['query'][_0x61fa('0x3c')]));_0x8a8967[_0x61fa('0x3b')]=_0x8a8967[_0x61fa('0x3b')][_0x61fa('0x3d')]?_0x8a8967[_0x61fa('0x3b')]:_0x1dcdfc[_0x61fa('0x36')];if(!_0x4bea4c[_0x61fa('0x37')][_0x61fa('0x3e')](_0x61fa('0x3f'))){_0x8a8967['limit']=qs[_0x61fa('0x23')](_0x4bea4c[_0x61fa('0x37')]['limit']);_0x8a8967[_0x61fa('0x21')]=qs['offset'](_0x4bea4c['query']['offset']);}_0x8a8967[_0x61fa('0x40')]=qs[_0x61fa('0x41')](_0x4bea4c['query'][_0x61fa('0x41')]);_0x8a8967[_0x61fa('0x42')]=qs[_0x61fa('0x39')](_[_0x61fa('0x43')](_0x4bea4c[_0x61fa('0x37')],_0x1dcdfc[_0x61fa('0x39')]),_0x209815);if(_0x4bea4c[_0x61fa('0x37')][_0x61fa('0x44')]){_0x8a8967[_0x61fa('0x42')]=_['merge'](_0x8a8967[_0x61fa('0x42')],{'$or':_[_0x61fa('0x30')](_0x209815,function(_0x59fa5b){if(_0x59fa5b[_0x61fa('0x34')]!=='VIRTUAL'){var _0x424500={};_0x424500[_0x59fa5b[_0x61fa('0x2d')]]={'$like':'%'+_0x4bea4c[_0x61fa('0x37')][_0x61fa('0x44')]+'%'};return _0x424500;}})});}_0x8a8967=_[_0x61fa('0x45')]({},_0x8a8967,_0x4bea4c[_0x61fa('0x46')]);var _0x3ca03f={'where':_0x8a8967[_0x61fa('0x42')]};return db[_0x61fa('0x31')][_0x61fa('0x24')](_0x3ca03f)['then'](function(_0x3a270d){_0x513573[_0x61fa('0x24')]=_0x3a270d;if(_0x4bea4c[_0x61fa('0x37')][_0x61fa('0x47')]){_0x8a8967[_0x61fa('0x48')]=[{'all':!![]}];}return db[_0x61fa('0x31')][_0x61fa('0x49')](_0x8a8967);})[_0x61fa('0x29')](function(_0x29c56e){_0x513573[_0x61fa('0x4a')]=_0x29c56e;return _0x513573;})[_0x61fa('0x29')](respondWithFilteredResult(_0x590705,_0x8a8967))[_0x61fa('0x4b')](handleError(_0x590705,null));};exports['show']=function(_0x56be97,_0x30f1a7){var _0x2228da={'raw':!![],'where':{'id':_0x56be97[_0x61fa('0x4c')]['id']}},_0x19f2f5={};_0x19f2f5[_0x61fa('0x36')]=_['keys'](db[_0x61fa('0x31')][_0x61fa('0x32')]);_0x19f2f5['query']=_['keys'](_0x56be97[_0x61fa('0x37')]);_0x19f2f5[_0x61fa('0x39')]=_[_0x61fa('0x3a')](_0x19f2f5['model'],_0x19f2f5[_0x61fa('0x37')]);_0x2228da['attributes']=_[_0x61fa('0x3a')](_0x19f2f5[_0x61fa('0x36')],qs['fields'](_0x56be97['query'][_0x61fa('0x3c')]));_0x2228da['attributes']=_0x2228da[_0x61fa('0x3b')]['length']?_0x2228da[_0x61fa('0x3b')]:_0x19f2f5['model'];if(_0x56be97[_0x61fa('0x37')][_0x61fa('0x47')]){_0x2228da[_0x61fa('0x48')]=[{'all':!![]}];}_0x2228da=_['merge']({},_0x2228da,_0x56be97[_0x61fa('0x46')]);return db[_0x61fa('0x31')][_0x61fa('0x4d')](_0x2228da)[_0x61fa('0x29')](handleEntityNotFound(_0x30f1a7,null))[_0x61fa('0x29')](respondWithResult(_0x30f1a7,null))[_0x61fa('0x4b')](handleError(_0x30f1a7,null));};exports[_0x61fa('0x4e')]=function(_0x3ca05e,_0x24ecd0){return db[_0x61fa('0x31')][_0x61fa('0x4e')](_0x3ca05e[_0x61fa('0x4f')],{})['then'](function(_0xa32d94){var _0x3c7da3=_0x3ca05e[_0x61fa('0x50')][_0x61fa('0x51')]({'plain':!![]});if(!_0x3c7da3)throw new Error(_0x61fa('0x52'));if(_0x3c7da3[_0x61fa('0x53')]===_0x61fa('0x50')){var _0xbba3da=_0xa32d94[_0x61fa('0x51')]({'plain':!![]});var _0x2ffbbe='Intervals';return db['UserProfileSection'][_0x61fa('0x4d')]({'where':{'name':_0x2ffbbe,'userProfileId':_0x3c7da3[_0x61fa('0x54')]},'raw':!![]})[_0x61fa('0x29')](function(_0x5c52a1){if(_0x5c52a1&&_0x5c52a1[_0x61fa('0x55')]===0x0){return db[_0x61fa('0x56')]['create']({'name':_0xbba3da[_0x61fa('0x2d')],'resourceId':_0xbba3da['id'],'type':_0x5c52a1[_0x61fa('0x2d')],'sectionId':_0x5c52a1['id']},{})['then'](function(){return _0xa32d94;});}else{return _0xa32d94;}})[_0x61fa('0x4b')](function(_0x11576d){logger[_0x61fa('0x57')](_0x61fa('0x58'),_0x11576d);throw _0x11576d;});}return _0xa32d94;})['then'](respondWithResult(_0x24ecd0,0xc9))['catch'](handleError(_0x24ecd0,null));};exports[_0x61fa('0x59')]=function(_0x14af90,_0x354a28){if(_0x14af90[_0x61fa('0x4f')]['id']){delete _0x14af90['body']['id'];}return db[_0x61fa('0x31')][_0x61fa('0x4d')]({'where':{'id':_0x14af90['params']['id']}})[_0x61fa('0x29')](handleEntityNotFound(_0x354a28,null))[_0x61fa('0x29')](saveUpdates(_0x14af90[_0x61fa('0x4f')],null))[_0x61fa('0x29')](respondWithResult(_0x354a28,null))[_0x61fa('0x4b')](handleError(_0x354a28,null));};exports[_0x61fa('0x2b')]=function(_0x26d886,_0xcc2109){return db[_0x61fa('0x31')][_0x61fa('0x4d')]({'where':{'id':_0x26d886[_0x61fa('0x4c')]['id']}})[_0x61fa('0x29')](handleEntityNotFound(_0xcc2109,null))[_0x61fa('0x29')](removeEntity(_0xcc2109,null))[_0x61fa('0x4b')](handleError(_0xcc2109,null));};exports['addInterval']=function(_0x154c21,_0x290899,_0x2a0f5c){if(_0x154c21['body']['id']){delete _0x154c21[_0x61fa('0x4f')]['id'];}return db[_0x61fa('0x31')][_0x61fa('0x4d')]({'where':{'id':_0x154c21['params']['id']}})[_0x61fa('0x29')](handleEntityNotFound(_0x290899,null))['then'](function(_0x2e9af9){if(_0x2e9af9){_0x154c21[_0x61fa('0x4f')]['IntervalId']=_0x2e9af9['id'];return db[_0x61fa('0x31')][_0x61fa('0x4e')](_0x154c21['body']);}})[_0x61fa('0x29')](respondWithResult(_0x290899,null))['catch'](handleError(_0x290899,null));};exports[_0x61fa('0x5a')]=function(_0x38bc26,_0x4f744b,_0x953f78){var _0x11b1a8={};var _0x4c5f79={};var _0x3ad6c7;var _0x79cc8;return db[_0x61fa('0x31')][_0x61fa('0x5b')]({'where':{'id':_0x38bc26[_0x61fa('0x4c')]['id']}})[_0x61fa('0x29')](handleEntityNotFound(_0x4f744b,null))[_0x61fa('0x29')](function(_0x4366f7){if(_0x4366f7){_0x3ad6c7=_0x4366f7;_0x4c5f79[_0x61fa('0x36')]=_[_0x61fa('0x38')](db[_0x61fa('0x31')][_0x61fa('0x32')]);_0x4c5f79[_0x61fa('0x37')]=_[_0x61fa('0x38')](_0x38bc26[_0x61fa('0x37')]);_0x4c5f79[_0x61fa('0x39')]=_[_0x61fa('0x3a')](_0x4c5f79[_0x61fa('0x36')],_0x4c5f79[_0x61fa('0x37')]);_0x11b1a8[_0x61fa('0x3b')]=_[_0x61fa('0x3a')](_0x4c5f79[_0x61fa('0x36')],qs['fields'](_0x38bc26[_0x61fa('0x37')]['fields']));_0x11b1a8[_0x61fa('0x3b')]=_0x11b1a8['attributes'][_0x61fa('0x3d')]?_0x11b1a8['attributes']:_0x4c5f79['model'];_0x11b1a8[_0x61fa('0x40')]=qs[_0x61fa('0x41')](_0x38bc26[_0x61fa('0x37')][_0x61fa('0x41')]);_0x11b1a8[_0x61fa('0x42')]=qs[_0x61fa('0x39')](_[_0x61fa('0x43')](_0x38bc26[_0x61fa('0x37')],_0x4c5f79[_0x61fa('0x39')]));if(_0x38bc26[_0x61fa('0x37')]['filter']){_0x11b1a8[_0x61fa('0x42')]=_[_0x61fa('0x45')](_0x11b1a8[_0x61fa('0x42')],{'$or':_[_0x61fa('0x30')](_0x11b1a8[_0x61fa('0x3b')],function(_0x4a7ed9){var _0x5b939a={};_0x5b939a[_0x4a7ed9]={'$like':'%'+_0x38bc26[_0x61fa('0x37')]['filter']+'%'};return _0x5b939a;})});}_0x11b1a8=_[_0x61fa('0x45')]({},_0x11b1a8,_0x38bc26[_0x61fa('0x46')]);return _0x3ad6c7[_0x61fa('0x5a')](_0x11b1a8);}})[_0x61fa('0x29')](function(_0x30bebe){if(_0x30bebe){_0x79cc8=_0x30bebe[_0x61fa('0x3d')];if(!_0x38bc26[_0x61fa('0x37')][_0x61fa('0x3e')](_0x61fa('0x3f'))){_0x11b1a8[_0x61fa('0x23')]=qs['limit'](_0x38bc26['query']['limit']);_0x11b1a8['offset']=qs[_0x61fa('0x21')](_0x38bc26[_0x61fa('0x37')]['offset']);}return _0x3ad6c7[_0x61fa('0x5a')](_0x11b1a8);}})['then'](function(_0x1bb506){if(_0x1bb506){return _0x1bb506?{'count':_0x79cc8,'rows':_0x1bb506}:null;}})['then'](respondWithResult(_0x4f744b,null))[_0x61fa('0x4b')](handleError(_0x4f744b,null));};exports[_0x61fa('0x5c')]=function(_0x45b056,_0x1cae0a,_0x20cf68){return db['Interval'][_0x61fa('0x5b')]({'where':{'id':_0x45b056[_0x61fa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1cae0a,null))[_0x61fa('0x29')](function(_0x482387){if(_0x482387){return db[_0x61fa('0x5d')][_0x61fa('0x5e')](function(_0x1898be){return db[_0x61fa('0x31')][_0x61fa('0x2b')]({'where':{'IntervalId':_0x45b056[_0x61fa('0x4c')]['id']},'transaction':_0x1898be})[_0x61fa('0x29')](function(_0x39acaf){var _0xb1fac1=_['map'](_0x45b056[_0x61fa('0x4f')],function(_0x17c169){delete _0x17c169['id'];_0x17c169[_0x61fa('0x5f')]=_0x45b056[_0x61fa('0x4c')]['id'];return _0x17c169;});return db[_0x61fa('0x31')][_0x61fa('0x60')](_0xb1fac1,{'transaction':_0x1898be});});})[_0x61fa('0x29')](function(){return db['Interval'][_0x61fa('0x49')]({'where':{'IntervalId':_0x45b056['params']['id']}});});}})[_0x61fa('0x29')](respondWithResult(_0x1cae0a,null))['catch'](handleError(_0x1cae0a,null));};
\ No newline at end of file
index 4577eca..76dd374 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3759=['./interval.attributes','../../components/extensions/rewrite','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x518573,_0x1db486){var _0x5cb1ce=function(_0xfd5bc1){while(--_0xfd5bc1){_0x518573['push'](_0x518573['shift']());}};_0x5cb1ce(++_0x1db486);}(_0x3759,0x131));var _0x9375=function(_0x12ebb9,_0x2c04c5){_0x12ebb9=_0x12ebb9-0x0;var _0x504b27=_0x3759[_0x12ebb9];return _0x504b27;};'use strict';var _=require(_0x9375('0x0'));var util=require(_0x9375('0x1'));var logger=require(_0x9375('0x2'))(_0x9375('0x3'));var moment=require(_0x9375('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9375('0x5'));var rimraf=require(_0x9375('0x6'));var config=require('../../config/environment');var attributes=require(_0x9375('0x7'));var extensions=require(_0x9375('0x8'));module['exports']=function(_0xe89323,_0x2e5a30){return _0xe89323[_0x9375('0x9')](_0x9375('0xa'),attributes,{'tableName':_0x9375('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xc8cade,_0x3d8bc8){extensions[_0x9375('0xc')](_0xe89323,_0xc8cade);},'afterBulkCreate':function(_0x5798fe,_0x5f4cea,_0x54e381){_0x54e381();extensions[_0x9375('0xc')](_0xe89323,_0x5798fe[0x0]);},'afterUpdate':function(_0x14c75c,_0x37183c){extensions['rewrite'](_0xe89323,_0x14c75c);},'afterDestroy':function(_0x2be560,_0x3bfbed){extensions[_0x9375('0xc')](_0xe89323,_0x2be560);}}});};
\ No newline at end of file
+var _0xc9cc=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xc9cc,0x91));var _0xcc9c=function(_0x43139e,_0x762629){_0x43139e=_0x43139e-0x0;var _0x2bc838=_0xc9cc[_0x43139e];return _0x2bc838;};'use strict';var _=require(_0xcc9c('0x0'));var util=require(_0xcc9c('0x1'));var logger=require(_0xcc9c('0x2'))(_0xcc9c('0x3'));var moment=require(_0xcc9c('0x4'));var BPromise=require(_0xcc9c('0x5'));var rp=require(_0xcc9c('0x6'));var fs=require('fs');var path=require(_0xcc9c('0x7'));var rimraf=require(_0xcc9c('0x8'));var config=require(_0xcc9c('0x9'));var attributes=require('./interval.attributes');var extensions=require(_0xcc9c('0xa'));module[_0xcc9c('0xb')]=function(_0x444fd1,_0x495473){return _0x444fd1[_0xcc9c('0xc')](_0xcc9c('0xd'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1faea8,_0x3d6866){extensions['rewrite'](_0x444fd1,_0x1faea8);},'afterBulkCreate':function(_0x4b4870,_0x53e511,_0x2b07be){_0x2b07be();extensions[_0xcc9c('0xe')](_0x444fd1,_0x4b4870[0x0]);},'afterUpdate':function(_0x337eff,_0x28b9a3){extensions['rewrite'](_0x444fd1,_0x337eff);},'afterDestroy':function(_0x2be4c0,_0x3a0649){extensions[_0xcc9c('0xe')](_0x444fd1,_0x2be4c0);}}});};
\ No newline at end of file
index 876df10..83744c3 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(_0x4695ba,_0x5a7f2a){var _0x524b7d=function(_0xfc9707){while(--_0xfc9707){_0x4695ba['push'](_0x4695ba['shift']());}};_0x524b7d(++_0x5a7f2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 aea89b5..ba6aaf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x593ae7,_0x437f05){var _0x8317b4=function(_0x4c6c76){while(--_0x4c6c76){_0x593ae7['push'](_0x593ae7['shift']());}};_0x8317b4(++_0x437f05);}(_0x2ef3,0xba));var _0x32ef=function(_0x217f24,_0x570f78){_0x217f24=_0x217f24-0x0;var _0x3ac864=_0x2ef3[_0x217f24];return _0x3ac864;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router;
\ No newline at end of file
+var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x113a6c,_0x10df30){var _0x1ac632=function(_0xbd4fb9){while(--_0xbd4fb9){_0x113a6c['push'](_0x113a6c['shift']());}};_0x1ac632(++_0x10df30);}(_0x5f2f,0x73));var _0xf5f2=function(_0xc2b88d,_0x3b58b3){_0xc2b88d=_0xc2b88d-0x0;var _0x1933d3=_0x5f2f[_0xc2b88d];return _0x1933d3;};'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 385d021..3bc6290 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80f8=['stringify','request','utf8','data','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','support','key','summary','\x20from\x20','Bug','customfield_11500','fields','customfield_11501','customfield_11502','customfield_11503','name','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString'];(function(_0x598acd,_0x21354a){var _0x241ce4=function(_0x4af88a){while(--_0x4af88a){_0x598acd['push'](_0x598acd['shift']());}};_0x241ce4(++_0x21354a);}(_0x80f8,0xaa));var _0x880f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x80f8[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require(_0x880f('0x0'));var https=require(_0x880f('0x1'));var logger=require(_0x880f('0x2'))('api');var USERNAME=_0x880f('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x3e4ac3,_0x4a4a0f){var _0x48c928={'fields':{'project':{'key':_0x3e4ac3[_0x880f('0x4')]||'MOTGUI'},'summary':(_0x3e4ac3[_0x880f('0x5')]||'Report')+_0x880f('0x6')+_0x3e4ac3['ip'],'description':_0x3e4ac3['description']||JSON['stringify'](_0x3e4ac3),'issuetype':{'name':_0x3e4ac3['issuetype']||_0x880f('0x7')}}};_0x48c928['fields'][_0x880f('0x8')]=_0x3e4ac3['email'];_0x48c928[_0x880f('0x9')][_0x880f('0xa')]=_0x3e4ac3['oldToken'];_0x48c928[_0x880f('0x9')][_0x880f('0xb')]=_0x3e4ac3['newToken'];_0x48c928[_0x880f('0x9')][_0x880f('0xc')]=_0x3e4ac3[_0x880f('0xd')];_0x48c928['fields']['customfield_11504']=_0x3e4ac3['reason'];_0x48c928[_0x880f('0x9')][_0x880f('0xe')]=_0x3e4ac3['ip'];var _0x546fc2={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x880f('0xf'),'method':_0x880f('0x10'),'timeout':0x4e20,'headers':{'Content-Type':_0x880f('0x11'),'Authorization':_0x880f('0x12')+new Buffer(USERNAME+':'+PASSWORD)[_0x880f('0x13')]('base64')}};var _0x302223=JSON[_0x880f('0x14')](_0x48c928);var _0x578ebc=https[_0x880f('0x15')](_0x546fc2,function(_0x5d3c94){_0x5d3c94['setEncoding'](_0x880f('0x16'));var _0xdec5d4='';_0x5d3c94['on'](_0x880f('0x17'),function(_0x4b9557){_0xdec5d4+=_0x4b9557;});_0x5d3c94['on']('end',function(){if(_0x4a4a0f){return _0x4a4a0f[_0x880f('0x18')](_0x5d3c94[_0x880f('0x19')])[_0x880f('0x1a')](JSON['parse'](_0xdec5d4));}});});_0x578ebc['on']('error',function(_0x4ebc00){if(_0x4a4a0f){return _0x4a4a0f[_0x880f('0x18')](0x1f4)[_0x880f('0x1a')]({'errors':[{'message':_0x880f('0x1b'),'type':_0x880f('0x1c')}]});}});_0x578ebc[_0x880f('0x1d')](_0x302223);_0x578ebc[_0x880f('0x1e')]();}exports[_0x880f('0x1f')]=openIssue;exports['send']=function(_0x15aadb,_0x24a02b){_0x15aadb[_0x880f('0x20')]['ip']=_0x15aadb[_0x880f('0x21')][_0x880f('0x22')]||_0x15aadb[_0x880f('0x23')][_0x880f('0x24')]||_0x15aadb[_0x880f('0x25')][_0x880f('0x24')]||_0x15aadb[_0x880f('0x23')]['socket'][_0x880f('0x24')];return openIssue(_0x15aadb[_0x880f('0x20')],_0x24a02b);};
\ No newline at end of file
+var _0x8bee=['body','headers','x-forwarded-for','connection','remoteAddress','socket','api','support','MOTGUI','\x20from\x20','description','stringify','Bug','fields','email','customfield_11501','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','POST','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue'];(function(_0x1185fa,_0x4e6516){var _0x5bcc5d=function(_0xfdfaa){while(--_0xfdfaa){_0x1185fa['push'](_0x1185fa['shift']());}};_0x5bcc5d(++_0x4e6516);}(_0x8bee,0xf0));var _0xe8be=function(_0x42b865,_0x196bd7){_0x42b865=_0x42b865-0x0;var _0x103c6d=_0x8bee[_0x42b865];return _0x103c6d;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require('../../config/logger')(_0xe8be('0x0'));var USERNAME=_0xe8be('0x1');var PASSWORD='3eAmWpBVP0';function openIssue(_0x208e5e,_0x10ca72){var _0x5abbdd={'fields':{'project':{'key':_0x208e5e['key']||_0xe8be('0x2')},'summary':(_0x208e5e['summary']||'Report')+_0xe8be('0x3')+_0x208e5e['ip'],'description':_0x208e5e[_0xe8be('0x4')]||JSON[_0xe8be('0x5')](_0x208e5e),'issuetype':{'name':_0x208e5e['issuetype']||_0xe8be('0x6')}}};_0x5abbdd[_0xe8be('0x7')]['customfield_11500']=_0x208e5e[_0xe8be('0x8')];_0x5abbdd[_0xe8be('0x7')][_0xe8be('0x9')]=_0x208e5e['oldToken'];_0x5abbdd[_0xe8be('0x7')][_0xe8be('0xa')]=_0x208e5e[_0xe8be('0xb')];_0x5abbdd[_0xe8be('0x7')]['customfield_11503']=_0x208e5e[_0xe8be('0xc')];_0x5abbdd['fields'][_0xe8be('0xd')]=_0x208e5e[_0xe8be('0xe')];_0x5abbdd['fields'][_0xe8be('0xf')]=_0x208e5e['ip'];var _0x5d0d08={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0xe8be('0x10'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xe8be('0x11')+new Buffer(USERNAME+':'+PASSWORD)[_0xe8be('0x12')](_0xe8be('0x13'))}};var _0x369f6a=JSON[_0xe8be('0x5')](_0x5abbdd);var _0x21c138=https[_0xe8be('0x14')](_0x5d0d08,function(_0x118a29){_0x118a29[_0xe8be('0x15')](_0xe8be('0x16'));var _0xd2e98f='';_0x118a29['on'](_0xe8be('0x17'),function(_0x20d6d1){_0xd2e98f+=_0x20d6d1;});_0x118a29['on'](_0xe8be('0x18'),function(){if(_0x10ca72){return _0x10ca72[_0xe8be('0x19')](_0x118a29['statusCode'])[_0xe8be('0x1a')](JSON[_0xe8be('0x1b')](_0xd2e98f));}});});_0x21c138['on'](_0xe8be('0x1c'),function(_0x1ff0e2){if(_0x10ca72){return _0x10ca72[_0xe8be('0x19')](0x1f4)[_0xe8be('0x1a')]({'errors':[{'message':_0xe8be('0x1d'),'type':_0xe8be('0x1e')}]});}});_0x21c138[_0xe8be('0x1f')](_0x369f6a);_0x21c138[_0xe8be('0x18')]();}exports[_0xe8be('0x20')]=openIssue;exports['send']=function(_0x1703e8,_0x536a9a){_0x1703e8[_0xe8be('0x21')]['ip']=_0x1703e8[_0xe8be('0x22')][_0xe8be('0x23')]||_0x1703e8[_0xe8be('0x24')][_0xe8be('0x25')]||_0x1703e8[_0xe8be('0x26')][_0xe8be('0x25')]||_0x1703e8['connection'][_0xe8be('0x26')][_0xe8be('0x25')];return openIssue(_0x1703e8['body'],_0x536a9a);};
\ No newline at end of file
index 39a511a..ec8b037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22fb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2722a9,_0xca04ca){var _0x4dd8e2=function(_0x5a466){while(--_0x5a466){_0x2722a9['push'](_0x2722a9['shift']());}};_0x4dd8e2(++_0xca04ca);}(_0x22fb,0x192));var _0xb22f=function(_0x4d6c41,_0x1a0a2){_0x4d6c41=_0x4d6c41-0x0;var _0x58a012=_0x22fb[_0x4d6c41];return _0x58a012;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var fs_extra=require(_0xb22f('0x3'));var auth=require(_0xb22f('0x4'));var interaction=require(_0xb22f('0x5'));var config=require('../../config/environment');var controller=require(_0xb22f('0x6'));router[_0xb22f('0x7')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0x9')]);router[_0xb22f('0x7')](_0xb22f('0xa'),auth['isAuthenticated'](),controller[_0xb22f('0xb')]);router[_0xb22f('0x7')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xd')]);router[_0xb22f('0xe')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0xf')]);router[_0xb22f('0x10')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller['update']);router['delete']('/:id',auth[_0xb22f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb43b=['../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x435dbb,_0x13b360){var _0x5149f4=function(_0x5ce415){while(--_0x5ce415){_0x435dbb['push'](_0x435dbb['shift']());}};_0x5149f4(++_0x13b360);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3c87cf,_0x2c2efd){_0x3c87cf=_0x3c87cf-0x0;var _0x395ec7=_0xb43b[_0x3c87cf];return _0x395ec7;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')](_0xbb43('0xe'),auth['isAuthenticated'](),controller[_0xbb43('0xf')]);router[_0xbb43('0x10')]('/',auth['isAuthenticated'](),controller[_0xbb43('0x11')]);router[_0xbb43('0x12')](_0xbb43('0xe'),auth[_0xbb43('0xb')](),controller[_0xbb43('0x13')]);router[_0xbb43('0x14')]('/:id',auth[_0xbb43('0xb')](),controller[_0xbb43('0x15')]);module['exports']=router;
\ No newline at end of file
index 3e5f463..b99e3c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7a54,0x106));var _0x47a5=function(_0x29264d,_0x1a3edb){_0x29264d=_0x29264d-0x0;var _0x388dc2=_0x7a54[_0x29264d];return _0x388dc2;};'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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x162ba5,_0x467168){_0x162ba5=_0x162ba5-0x0;var _0x415f22=_0x7a54[_0x162ba5];return _0x415f22;};'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 59e0bc2..ba84726 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x379e=['key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','JscriptyAnswerReport','rows','show','find','create','body','update','catch','params','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x379e,0x104));var _0xe379=function(_0x1097d2,_0x53ad38){_0x1097d2=_0x1097d2-0x0;var _0x4d972c=_0x379e[_0x1097d2];return _0x4d972c;};'use strict';var emlformat=require(_0xe379('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe379('0x1'));var moment=require(_0xe379('0x2'));var BPromise=require(_0xe379('0x3'));var Mustache=require(_0xe379('0x4'));var util=require(_0xe379('0x5'));var path=require(_0xe379('0x6'));var sox=require(_0xe379('0x7'));var csv=require('to-csv');var ejs=require(_0xe379('0x8'));var fs=require('fs');var fs_extra=require(_0xe379('0x9'));var _=require(_0xe379('0xa'));var squel=require(_0xe379('0xb'));var crypto=require(_0xe379('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe379('0xd'));var toCsv=require(_0xe379('0xe'));var querystring=require(_0xe379('0xf'));var Papa=require(_0xe379('0x10'));var Redis=require(_0xe379('0x11'));var authService=require(_0xe379('0x12'));var qs=require(_0xe379('0x13'));var as=require(_0xe379('0x14'));var hardwareService=require(_0xe379('0x15'));var logger=require('../../config/logger')(_0xe379('0x16'));var utils=require(_0xe379('0x17'));var config=require(_0xe379('0x18'));var licenseUtil=require(_0xe379('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6562,_0x2642a8){_0x2642a8=_0x2642a8||0xcc;return function(_0x45cf1a){if(_0x45cf1a){return _0x4c6562[_0xe379('0x1a')](_0x2642a8);}return _0x4c6562[_0xe379('0x1b')](_0x2642a8)[_0xe379('0x1c')]();};}function respondWithResult(_0x1ee8e0,_0x2a5b60){_0x2a5b60=_0x2a5b60||0xc8;return function(_0x70d82){if(_0x70d82){return _0x1ee8e0['status'](_0x2a5b60)[_0xe379('0x1d')](_0x70d82);}};}function respondWithFilteredResult(_0xab59c7,_0x20eaaf){return function(_0x105d7f){if(_0x105d7f){var _0x3d9351=typeof _0x20eaaf[_0xe379('0x1e')]==='undefined'&&typeof _0x20eaaf[_0xe379('0x1f')]==='undefined';var _0x2c2bd9=_0x105d7f['count'];var _0x150d92=_0x3d9351?0x0:_0x20eaaf[_0xe379('0x1e')];var _0xe4f3d1=_0x3d9351?_0x105d7f[_0xe379('0x20')]:_0x20eaaf['offset']+_0x20eaaf[_0xe379('0x1f')];var _0x260b2e;if(_0xe4f3d1>=_0x2c2bd9){_0xe4f3d1=_0x2c2bd9;_0x260b2e=0xc8;}else{_0x260b2e=0xce;}_0xab59c7[_0xe379('0x1b')](_0x260b2e);return _0xab59c7[_0xe379('0x21')](_0xe379('0x22'),_0x150d92+'-'+_0xe4f3d1+'/'+_0x2c2bd9)['json'](_0x105d7f);}return null;};}function patchUpdates(_0x2c749e){return function(_0x3a8d17){try{jsonpatch['apply'](_0x3a8d17,_0x2c749e,!![]);}catch(_0x39ec4d){return BPromise[_0xe379('0x23')](_0x39ec4d);}return _0x3a8d17[_0xe379('0x24')]();};}function saveUpdates(_0x2e946f,_0x32f43e){return function(_0x10b3c3){if(_0x10b3c3){return _0x10b3c3['update'](_0x2e946f)[_0xe379('0x25')](function(_0x32e16e){return _0x32e16e;});}return null;};}function removeEntity(_0x21e31b,_0x48b543){return function(_0x38236b){if(_0x38236b){return _0x38236b[_0xe379('0x26')]()['then'](function(){_0x21e31b[_0xe379('0x1b')](0xcc)[_0xe379('0x1c')]();});}};}function handleEntityNotFound(_0x4da256,_0x544bf3){return function(_0x22f596){if(!_0x22f596){_0x4da256[_0xe379('0x1a')](0x194);}return _0x22f596;};}function handleError(_0x26ba82,_0x4aa041){_0x4aa041=_0x4aa041||0x1f4;return function(_0x17ba51){logger[_0xe379('0x27')](_0x17ba51[_0xe379('0x28')]);if(_0x17ba51[_0xe379('0x29')]){delete _0x17ba51['name'];}_0x26ba82[_0xe379('0x1b')](_0x4aa041)[_0xe379('0x2a')](_0x17ba51);};}exports[_0xe379('0x2b')]=function(_0x50b0aa,_0x33037d){var _0x120239={},_0x5d9ca1={},_0x24c85d={'count':0x0,'rows':[]};var _0x528a44=_[_0xe379('0x2c')](db['JscriptyAnswerReport'][_0xe379('0x2d')],function(_0x214a0c){return{'name':_0x214a0c[_0xe379('0x2e')],'type':_0x214a0c[_0xe379('0x2f')][_0xe379('0x30')]};});_0x5d9ca1[_0xe379('0x31')]=_[_0xe379('0x2c')](_0x528a44,'name');_0x5d9ca1[_0xe379('0x32')]=_[_0xe379('0x33')](_0x50b0aa[_0xe379('0x32')]);_0x5d9ca1['filters']=_[_0xe379('0x34')](_0x5d9ca1['model'],_0x5d9ca1['query']);_0x120239[_0xe379('0x35')]=_[_0xe379('0x34')](_0x5d9ca1[_0xe379('0x31')],qs[_0xe379('0x36')](_0x50b0aa['query'][_0xe379('0x36')]));_0x120239[_0xe379('0x35')]=_0x120239['attributes'][_0xe379('0x37')]?_0x120239[_0xe379('0x35')]:_0x5d9ca1[_0xe379('0x31')];if(!_0x50b0aa[_0xe379('0x32')]['hasOwnProperty'](_0xe379('0x38'))){_0x120239['limit']=qs[_0xe379('0x1f')](_0x50b0aa[_0xe379('0x32')][_0xe379('0x1f')]);_0x120239[_0xe379('0x1e')]=qs[_0xe379('0x1e')](_0x50b0aa['query'][_0xe379('0x1e')]);}_0x120239['order']=qs[_0xe379('0x39')](_0x50b0aa[_0xe379('0x32')][_0xe379('0x39')]);_0x120239['where']=qs[_0xe379('0x3a')](_[_0xe379('0x3b')](_0x50b0aa[_0xe379('0x32')],_0x5d9ca1[_0xe379('0x3a')]),_0x528a44);if(_0x50b0aa['query'][_0xe379('0x3c')]){_0x120239['where']=_[_0xe379('0x3d')](_0x120239[_0xe379('0x3e')],{'$or':_[_0xe379('0x2c')](_0x528a44,function(_0x12e67e){if(_0x12e67e[_0xe379('0x2f')]!==_0xe379('0x3f')){var _0x56ebb7={};_0x56ebb7[_0x12e67e[_0xe379('0x29')]]={'$like':'%'+_0x50b0aa['query'][_0xe379('0x3c')]+'%'};return _0x56ebb7;}})});}_0x120239=_[_0xe379('0x3d')]({},_0x120239,_0x50b0aa[_0xe379('0x40')]);var _0x2e3eef={'where':_0x120239[_0xe379('0x3e')]};return db['JscriptyAnswerReport'][_0xe379('0x20')](_0x2e3eef)[_0xe379('0x25')](function(_0x59ba54){_0x24c85d['count']=_0x59ba54;if(_0x50b0aa['query'][_0xe379('0x41')]){_0x120239[_0xe379('0x42')]=[{'all':!![]}];}return db[_0xe379('0x43')]['findAll'](_0x120239);})[_0xe379('0x25')](function(_0x3089df){_0x24c85d[_0xe379('0x44')]=_0x3089df;return _0x24c85d;})[_0xe379('0x25')](respondWithFilteredResult(_0x33037d,_0x120239))['catch'](handleError(_0x33037d,null));};exports[_0xe379('0x45')]=function(_0x36ce8e,_0x3c6f5d){var _0x32ecbe={'raw':!![],'where':{'id':_0x36ce8e['params']['id']}},_0x48f0cc={};_0x48f0cc[_0xe379('0x31')]=_[_0xe379('0x33')](db[_0xe379('0x43')][_0xe379('0x2d')]);_0x48f0cc[_0xe379('0x32')]=_[_0xe379('0x33')](_0x36ce8e['query']);_0x48f0cc[_0xe379('0x3a')]=_['intersection'](_0x48f0cc[_0xe379('0x31')],_0x48f0cc[_0xe379('0x32')]);_0x32ecbe[_0xe379('0x35')]=_[_0xe379('0x34')](_0x48f0cc[_0xe379('0x31')],qs[_0xe379('0x36')](_0x36ce8e[_0xe379('0x32')][_0xe379('0x36')]));_0x32ecbe[_0xe379('0x35')]=_0x32ecbe[_0xe379('0x35')][_0xe379('0x37')]?_0x32ecbe[_0xe379('0x35')]:_0x48f0cc[_0xe379('0x31')];if(_0x36ce8e[_0xe379('0x32')][_0xe379('0x41')]){_0x32ecbe[_0xe379('0x42')]=[{'all':!![]}];}_0x32ecbe=_[_0xe379('0x3d')]({},_0x32ecbe,_0x36ce8e[_0xe379('0x40')]);return db[_0xe379('0x43')][_0xe379('0x46')](_0x32ecbe)[_0xe379('0x25')](handleEntityNotFound(_0x3c6f5d,null))[_0xe379('0x25')](respondWithResult(_0x3c6f5d,null))['catch'](handleError(_0x3c6f5d,null));};exports[_0xe379('0x47')]=function(_0x266bfe,_0x42a378){return db[_0xe379('0x43')][_0xe379('0x47')](_0x266bfe[_0xe379('0x48')],{})['then'](respondWithResult(_0x42a378,0xc9))['catch'](handleError(_0x42a378,null));};exports[_0xe379('0x49')]=function(_0x5db39f,_0x55b27b){if(_0x5db39f[_0xe379('0x48')]['id']){delete _0x5db39f[_0xe379('0x48')]['id'];}return db[_0xe379('0x43')][_0xe379('0x46')]({'where':{'id':_0x5db39f['params']['id']}})[_0xe379('0x25')](handleEntityNotFound(_0x55b27b,null))[_0xe379('0x25')](saveUpdates(_0x5db39f['body'],null))[_0xe379('0x25')](respondWithResult(_0x55b27b,null))[_0xe379('0x4a')](handleError(_0x55b27b,null));};exports['destroy']=function(_0x4ac3eb,_0x3af1be){return db[_0xe379('0x43')]['find']({'where':{'id':_0x4ac3eb[_0xe379('0x4b')]['id']}})[_0xe379('0x25')](handleEntityNotFound(_0x3af1be,null))[_0xe379('0x25')](removeEntity(_0x3af1be,null))[_0xe379('0x4a')](handleError(_0x3af1be,null));};exports[_0xe379('0x4c')]=function(_0x4a9c86,_0x337775){return db['JscriptyAnswerReport']['describe']()[_0xe379('0x25')](respondWithResult(_0x337775,null))[_0xe379('0x4a')](handleError(_0x337775,null));};
\ No newline at end of file
+var _0xe7de=['limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','JscriptyAnswerReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','rows','catch','show','params','include','merge','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe7de,0x165));var _0xee7d=function(_0x25758d,_0x6aa312){_0x25758d=_0x25758d-0x0;var _0x5a98ce=_0xe7de[_0x25758d];return _0x5a98ce;};'use strict';var emlformat=require(_0xee7d('0x0'));var rimraf=require(_0xee7d('0x1'));var zipdir=require(_0xee7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xee7d('0x3'));var BPromise=require(_0xee7d('0x4'));var Mustache=require(_0xee7d('0x5'));var util=require(_0xee7d('0x6'));var path=require(_0xee7d('0x7'));var sox=require(_0xee7d('0x8'));var csv=require(_0xee7d('0x9'));var ejs=require(_0xee7d('0xa'));var fs=require('fs');var fs_extra=require(_0xee7d('0xb'));var _=require(_0xee7d('0xc'));var squel=require(_0xee7d('0xd'));var crypto=require(_0xee7d('0xe'));var jsforce=require(_0xee7d('0xf'));var deskjs=require(_0xee7d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xee7d('0x11'));var Papa=require(_0xee7d('0x12'));var Redis=require(_0xee7d('0x13'));var authService=require(_0xee7d('0x14'));var qs=require(_0xee7d('0x15'));var as=require(_0xee7d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee7d('0x17'))('api');var utils=require(_0xee7d('0x18'));var config=require(_0xee7d('0x19'));var licenseUtil=require(_0xee7d('0x1a'));var db=require(_0xee7d('0x1b'))['db'];function respondWithStatusCode(_0xdfb04b,_0xb4c933){_0xb4c933=_0xb4c933||0xcc;return function(_0x3e9daa){if(_0x3e9daa){return _0xdfb04b[_0xee7d('0x1c')](_0xb4c933);}return _0xdfb04b[_0xee7d('0x1d')](_0xb4c933)[_0xee7d('0x1e')]();};}function respondWithResult(_0x41ca24,_0x47eb16){_0x47eb16=_0x47eb16||0xc8;return function(_0x4bfdab){if(_0x4bfdab){return _0x41ca24[_0xee7d('0x1d')](_0x47eb16)[_0xee7d('0x1f')](_0x4bfdab);}};}function respondWithFilteredResult(_0x4ab8a6,_0x1211a1){return function(_0x1a2976){if(_0x1a2976){var _0x1dc47c=typeof _0x1211a1['offset']===_0xee7d('0x20')&&typeof _0x1211a1[_0xee7d('0x21')]===_0xee7d('0x20');var _0x62d1ec=_0x1a2976[_0xee7d('0x22')];var _0x25f3e0=_0x1dc47c?0x0:_0x1211a1['offset'];var _0x152dd6=_0x1dc47c?_0x1a2976[_0xee7d('0x22')]:_0x1211a1[_0xee7d('0x23')]+_0x1211a1['limit'];var _0x277738;if(_0x152dd6>=_0x62d1ec){_0x152dd6=_0x62d1ec;_0x277738=0xc8;}else{_0x277738=0xce;}_0x4ab8a6['status'](_0x277738);return _0x4ab8a6[_0xee7d('0x24')](_0xee7d('0x25'),_0x25f3e0+'-'+_0x152dd6+'/'+_0x62d1ec)[_0xee7d('0x1f')](_0x1a2976);}return null;};}function patchUpdates(_0x4f6445){return function(_0x113a05){try{jsonpatch['apply'](_0x113a05,_0x4f6445,!![]);}catch(_0x20aeaa){return BPromise[_0xee7d('0x26')](_0x20aeaa);}return _0x113a05[_0xee7d('0x27')]();};}function saveUpdates(_0xed4f9f,_0x52eaf4){return function(_0x32ad6e){if(_0x32ad6e){return _0x32ad6e[_0xee7d('0x28')](_0xed4f9f)[_0xee7d('0x29')](function(_0x136a7b){return _0x136a7b;});}return null;};}function removeEntity(_0x33613a,_0x4d0efb){return function(_0x172850){if(_0x172850){return _0x172850[_0xee7d('0x2a')]()[_0xee7d('0x29')](function(){_0x33613a['status'](0xcc)[_0xee7d('0x1e')]();});}};}function handleEntityNotFound(_0x293382,_0x379de9){return function(_0x576d56){if(!_0x576d56){_0x293382[_0xee7d('0x1c')](0x194);}return _0x576d56;};}function handleError(_0x38e6a6,_0x4532cb){_0x4532cb=_0x4532cb||0x1f4;return function(_0x2b9482){logger[_0xee7d('0x2b')](_0x2b9482[_0xee7d('0x2c')]);if(_0x2b9482[_0xee7d('0x2d')]){delete _0x2b9482[_0xee7d('0x2d')];}_0x38e6a6[_0xee7d('0x1d')](_0x4532cb)['send'](_0x2b9482);};}exports[_0xee7d('0x2e')]=function(_0x4e1bf5,_0x5ca947){var _0x2a5b06={},_0x4d4ff0={},_0x151094={'count':0x0,'rows':[]};var _0xc2e2c1=_['map'](db[_0xee7d('0x2f')][_0xee7d('0x30')],function(_0xac47ec){return{'name':_0xac47ec[_0xee7d('0x31')],'type':_0xac47ec[_0xee7d('0x32')]['key']};});_0x4d4ff0[_0xee7d('0x33')]=_[_0xee7d('0x34')](_0xc2e2c1,_0xee7d('0x2d'));_0x4d4ff0[_0xee7d('0x35')]=_[_0xee7d('0x36')](_0x4e1bf5[_0xee7d('0x35')]);_0x4d4ff0[_0xee7d('0x37')]=_[_0xee7d('0x38')](_0x4d4ff0['model'],_0x4d4ff0[_0xee7d('0x35')]);_0x2a5b06[_0xee7d('0x39')]=_[_0xee7d('0x38')](_0x4d4ff0['model'],qs[_0xee7d('0x3a')](_0x4e1bf5['query'][_0xee7d('0x3a')]));_0x2a5b06[_0xee7d('0x39')]=_0x2a5b06['attributes']['length']?_0x2a5b06[_0xee7d('0x39')]:_0x4d4ff0['model'];if(!_0x4e1bf5[_0xee7d('0x35')][_0xee7d('0x3b')](_0xee7d('0x3c'))){_0x2a5b06[_0xee7d('0x21')]=qs[_0xee7d('0x21')](_0x4e1bf5['query']['limit']);_0x2a5b06[_0xee7d('0x23')]=qs['offset'](_0x4e1bf5[_0xee7d('0x35')][_0xee7d('0x23')]);}_0x2a5b06[_0xee7d('0x3d')]=qs[_0xee7d('0x3e')](_0x4e1bf5[_0xee7d('0x35')][_0xee7d('0x3e')]);_0x2a5b06[_0xee7d('0x3f')]=qs[_0xee7d('0x37')](_[_0xee7d('0x40')](_0x4e1bf5[_0xee7d('0x35')],_0x4d4ff0[_0xee7d('0x37')]),_0xc2e2c1);if(_0x4e1bf5[_0xee7d('0x35')]['filter']){_0x2a5b06[_0xee7d('0x3f')]=_['merge'](_0x2a5b06[_0xee7d('0x3f')],{'$or':_[_0xee7d('0x34')](_0xc2e2c1,function(_0x13f7d2){if(_0x13f7d2['type']!==_0xee7d('0x41')){var _0x2944ac={};_0x2944ac[_0x13f7d2[_0xee7d('0x2d')]]={'$like':'%'+_0x4e1bf5['query'][_0xee7d('0x42')]+'%'};return _0x2944ac;}})});}_0x2a5b06=_['merge']({},_0x2a5b06,_0x4e1bf5[_0xee7d('0x43')]);var _0x4a1c11={'where':_0x2a5b06['where']};return db[_0xee7d('0x2f')][_0xee7d('0x22')](_0x4a1c11)[_0xee7d('0x29')](function(_0x281d7d){_0x151094['count']=_0x281d7d;if(_0x4e1bf5[_0xee7d('0x35')]['includeAll']){_0x2a5b06['include']=[{'all':!![]}];}return db[_0xee7d('0x2f')]['findAll'](_0x2a5b06);})[_0xee7d('0x29')](function(_0x527339){_0x151094[_0xee7d('0x44')]=_0x527339;return _0x151094;})[_0xee7d('0x29')](respondWithFilteredResult(_0x5ca947,_0x2a5b06))[_0xee7d('0x45')](handleError(_0x5ca947,null));};exports[_0xee7d('0x46')]=function(_0x55775d,_0x203ec5){var _0x33643d={'raw':!![],'where':{'id':_0x55775d[_0xee7d('0x47')]['id']}},_0x24bb87={};_0x24bb87[_0xee7d('0x33')]=_[_0xee7d('0x36')](db['JscriptyAnswerReport'][_0xee7d('0x30')]);_0x24bb87[_0xee7d('0x35')]=_[_0xee7d('0x36')](_0x55775d[_0xee7d('0x35')]);_0x24bb87['filters']=_[_0xee7d('0x38')](_0x24bb87['model'],_0x24bb87[_0xee7d('0x35')]);_0x33643d['attributes']=_[_0xee7d('0x38')](_0x24bb87[_0xee7d('0x33')],qs[_0xee7d('0x3a')](_0x55775d['query'][_0xee7d('0x3a')]));_0x33643d['attributes']=_0x33643d[_0xee7d('0x39')]['length']?_0x33643d[_0xee7d('0x39')]:_0x24bb87[_0xee7d('0x33')];if(_0x55775d[_0xee7d('0x35')]['includeAll']){_0x33643d[_0xee7d('0x48')]=[{'all':!![]}];}_0x33643d=_[_0xee7d('0x49')]({},_0x33643d,_0x55775d['options']);return db['JscriptyAnswerReport'][_0xee7d('0x4a')](_0x33643d)[_0xee7d('0x29')](handleEntityNotFound(_0x203ec5,null))['then'](respondWithResult(_0x203ec5,null))[_0xee7d('0x45')](handleError(_0x203ec5,null));};exports[_0xee7d('0x4b')]=function(_0x238fbb,_0x48470e){return db['JscriptyAnswerReport'][_0xee7d('0x4b')](_0x238fbb[_0xee7d('0x4c')],{})[_0xee7d('0x29')](respondWithResult(_0x48470e,0xc9))[_0xee7d('0x45')](handleError(_0x48470e,null));};exports[_0xee7d('0x28')]=function(_0xd13c3a,_0x486cfc){if(_0xd13c3a[_0xee7d('0x4c')]['id']){delete _0xd13c3a[_0xee7d('0x4c')]['id'];}return db[_0xee7d('0x2f')][_0xee7d('0x4a')]({'where':{'id':_0xd13c3a[_0xee7d('0x47')]['id']}})[_0xee7d('0x29')](handleEntityNotFound(_0x486cfc,null))[_0xee7d('0x29')](saveUpdates(_0xd13c3a[_0xee7d('0x4c')],null))[_0xee7d('0x29')](respondWithResult(_0x486cfc,null))[_0xee7d('0x45')](handleError(_0x486cfc,null));};exports['destroy']=function(_0x56bc0c,_0x336a1c){return db[_0xee7d('0x2f')][_0xee7d('0x4a')]({'where':{'id':_0x56bc0c[_0xee7d('0x47')]['id']}})[_0xee7d('0x29')](handleEntityNotFound(_0x336a1c,null))[_0xee7d('0x29')](removeEntity(_0x336a1c,null))[_0xee7d('0x45')](handleError(_0x336a1c,null));};exports['describe']=function(_0x1544e7,_0x52c85c){return db[_0xee7d('0x2f')][_0xee7d('0x4d')]()['then'](respondWithResult(_0x52c85c,null))['catch'](handleError(_0x52c85c,null));};
\ No newline at end of file
index 880fef0..a726016 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x387c=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x5975d6,_0x36c521){var _0x16d3a2=function(_0x481d2d){while(--_0x481d2d){_0x5975d6['push'](_0x5975d6['shift']());}};_0x16d3a2(++_0x36c521);}(_0x387c,0x195));var _0xc387=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0x387c[_0x263a2f];return _0x8020e8;};'use strict';var _=require(_0xc387('0x0'));var util=require(_0xc387('0x1'));var logger=require(_0xc387('0x2'))(_0xc387('0x3'));var moment=require('moment');var BPromise=require(_0xc387('0x4'));var rp=require(_0xc387('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc387('0x6'));var config=require(_0xc387('0x7'));var attributes=require(_0xc387('0x8'));module[_0xc387('0x9')]=function(_0x4de217,_0x40870d){return _0x4de217[_0xc387('0xa')](_0xc387('0xb'),attributes,{'tableName':_0xc387('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2100=['../../config/environment','exports','define','report_jscripty_answers','api','moment','rimraf'];(function(_0x1c80b2,_0x52b046){var _0x229a94=function(_0x10178e){while(--_0x10178e){_0x1c80b2['push'](_0x1c80b2['shift']());}};_0x229a94(++_0x52b046);}(_0x2100,0x15b));var _0x0210=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0x2100[_0x57fa7e];return _0x320671;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0210('0x0'));var moment=require(_0x0210('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0210('0x2'));var config=require(_0x0210('0x3'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x0210('0x4')]=function(_0x378158,_0x148df6){return _0x378158[_0x0210('0x5')]('JscriptyAnswerReport',attributes,{'tableName':_0x0210('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e992f7a..fcd2134 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1b4=['../../config/environment','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1d481b,_0x4c41c8){var _0x5cb923=function(_0x1e9d93){while(--_0x1e9d93){_0x1d481b['push'](_0x1d481b['shift']());}};_0x5cb923(++_0x4c41c8);}(_0xc1b4,0x10a));var _0x4c1b=function(_0x250423,_0x3a8f90){_0x250423=_0x250423-0x0;var _0x569c6a=_0xc1b4[_0x250423];return _0x569c6a;};'use strict';var _=require(_0x4c1b('0x0'));var util=require(_0x4c1b('0x1'));var moment=require('moment');var BPromise=require(_0x4c1b('0x2'));var rs=require(_0x4c1b('0x3'));var fs=require('fs');var Redis=require(_0x4c1b('0x4'));var db=require(_0x4c1b('0x5'))['db'];var utils=require(_0x4c1b('0x6'));var logger=require(_0x4c1b('0x7'))(_0x4c1b('0x8'));var config=require(_0x4c1b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4c1b('0xa')][_0x4c1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c6484,_0x4d2fe6,_0x11782e){return new BPromise(function(_0x2d1afb,_0x575af5){return client[_0x4c1b('0xc')](_0x4c6484,_0x11782e)[_0x4c1b('0xd')](function(_0x3ddabf){logger[_0x4c1b('0xe')](_0x4c1b('0xf'),_0x4d2fe6,_0x4c1b('0x10'));logger[_0x4c1b('0x11')](_0x4c1b('0x12'),_0x4d2fe6,'request\x20sent',JSON[_0x4c1b('0x13')](_0x3ddabf));if(_0x3ddabf['error']){if(_0x3ddabf[_0x4c1b('0x14')][_0x4c1b('0x15')]===0x1f4){logger[_0x4c1b('0x14')](_0x4c1b('0xf'),_0x4d2fe6,_0x3ddabf['error'][_0x4c1b('0x16')]);return _0x575af5(_0x3ddabf[_0x4c1b('0x14')][_0x4c1b('0x16')]);}logger[_0x4c1b('0x14')](_0x4c1b('0xf'),_0x4d2fe6,_0x3ddabf[_0x4c1b('0x14')][_0x4c1b('0x16')]);return _0x2d1afb(_0x3ddabf['error'][_0x4c1b('0x16')]);}else{logger[_0x4c1b('0xe')](_0x4c1b('0xf'),_0x4d2fe6,_0x4c1b('0x10'));_0x2d1afb(_0x3ddabf[_0x4c1b('0x17')][_0x4c1b('0x16')]);}})[_0x4c1b('0x18')](function(_0x562a78){logger[_0x4c1b('0x14')](_0x4c1b('0xf'),_0x4d2fe6,_0x562a78);_0x575af5(_0x562a78);});});}
\ No newline at end of file
+var _0xc053=['stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x1c936d,_0x5979f3){var _0x320835=function(_0x12615c){while(--_0x12615c){_0x1c936d['push'](_0x1c936d['shift']());}};_0x320835(++_0x5979f3);}(_0xc053,0x13f));var _0x3c05=function(_0x514bca,_0x164471){_0x514bca=_0x514bca-0x0;var _0x1c2c6e=_0xc053[_0x514bca];return _0x1c2c6e;};'use strict';var _=require(_0x3c05('0x0'));var util=require(_0x3c05('0x1'));var moment=require(_0x3c05('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c05('0x3'));var fs=require('fs');var Redis=require(_0x3c05('0x4'));var db=require(_0x3c05('0x5'))['db'];var utils=require(_0x3c05('0x6'));var logger=require(_0x3c05('0x7'))(_0x3c05('0x8'));var config=require(_0x3c05('0x9'));var jayson=require(_0x3c05('0xa'));var client=jayson[_0x3c05('0xb')][_0x3c05('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2796f6,_0x155b2a,_0x2ac8c7){return new BPromise(function(_0x2f44db,_0x2b5cb1){return client[_0x3c05('0xd')](_0x2796f6,_0x2ac8c7)['then'](function(_0x2ec34e){logger['info'](_0x3c05('0xe'),_0x155b2a,_0x3c05('0xf'));logger['debug'](_0x3c05('0x10'),_0x155b2a,_0x3c05('0xf'),JSON[_0x3c05('0x11')](_0x2ec34e));if(_0x2ec34e[_0x3c05('0x12')]){if(_0x2ec34e[_0x3c05('0x12')][_0x3c05('0x13')]===0x1f4){logger[_0x3c05('0x12')](_0x3c05('0xe'),_0x155b2a,_0x2ec34e[_0x3c05('0x12')][_0x3c05('0x14')]);return _0x2b5cb1(_0x2ec34e[_0x3c05('0x12')][_0x3c05('0x14')]);}logger[_0x3c05('0x12')](_0x3c05('0xe'),_0x155b2a,_0x2ec34e[_0x3c05('0x12')][_0x3c05('0x14')]);return _0x2f44db(_0x2ec34e[_0x3c05('0x12')]['message']);}else{logger[_0x3c05('0x15')](_0x3c05('0xe'),_0x155b2a,_0x3c05('0xf'));_0x2f44db(_0x2ec34e[_0x3c05('0x16')][_0x3c05('0x14')]);}})[_0x3c05('0x17')](function(_0x3b16e2){logger[_0x3c05('0x12')](_0x3c05('0xe'),_0x155b2a,_0x3b16e2);_0x2b5cb1(_0x3b16e2);});});}
\ No newline at end of file
index 262ad34..eb33459 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58bd=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id/sessions','isAuthenticated','getAnswers','30s','getSummary','post','create','/:id/clone','clone','/:id','update','delete','destroy','exports'];(function(_0x3bc7f9,_0x518524){var _0x956085=function(_0x53ec1d){while(--_0x53ec1d){_0x3bc7f9['push'](_0x3bc7f9['shift']());}};_0x956085(++_0x518524);}(_0x58bd,0x1a0));var _0xd58b=function(_0x34e817,_0x437324){_0x34e817=_0x34e817-0x0;var _0x5471af=_0x58bd[_0x34e817];return _0x5471af;};'use strict';var multer=require(_0xd58b('0x0'));var util=require(_0xd58b('0x1'));var path=require(_0xd58b('0x2'));var timeout=require(_0xd58b('0x3'));var express=require(_0xd58b('0x4'));var router=express[_0xd58b('0x5')]();var fs_extra=require(_0xd58b('0x6'));var auth=require(_0xd58b('0x7'));var interaction=require(_0xd58b('0x8'));var config=require(_0xd58b('0x9'));var controller=require('./jscriptyProject.controller');router[_0xd58b('0xa')]('/',auth['isAuthenticated'](),controller[_0xd58b('0xb')]);router[_0xd58b('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd58b('0xa')](_0xd58b('0xc'),auth[_0xd58b('0xd')](),controller['getSessions']);router[_0xd58b('0xa')]('/:id/answers',auth['isAuthenticated'](),controller[_0xd58b('0xe')]);router[_0xd58b('0xa')]('/:id/summary',auth[_0xd58b('0xd')](),timeout(_0xd58b('0xf')),controller[_0xd58b('0x10')]);router[_0xd58b('0x11')]('/',auth[_0xd58b('0xd')](),controller[_0xd58b('0x12')]);router[_0xd58b('0x11')](_0xd58b('0x13'),auth['isAuthenticated'](),controller[_0xd58b('0x14')]);router['put'](_0xd58b('0x15'),auth[_0xd58b('0xd')](),controller[_0xd58b('0x16')]);router[_0xd58b('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xd58b('0x18')]);module[_0xd58b('0x19')]=router;
\ No newline at end of file
+var _0xb129=['put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','getSessions','/:id/answers','getAnswers','30s','getSummary','post','create','/:id/clone','clone'];(function(_0x5d36d0,_0x2aacd4){var _0xc8bba0=function(_0x48adf5){while(--_0x48adf5){_0x5d36d0['push'](_0x5d36d0['shift']());}};_0xc8bba0(++_0x2aacd4);}(_0xb129,0xbb));var _0x9b12=function(_0x1bbe8f,_0x54cb21){_0x1bbe8f=_0x1bbe8f-0x0;var _0x250f8e=_0xb129[_0x1bbe8f];return _0x250f8e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9b12('0x0'));var timeout=require(_0x9b12('0x1'));var express=require(_0x9b12('0x2'));var router=express[_0x9b12('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9b12('0x4'));var interaction=require(_0x9b12('0x5'));var config=require(_0x9b12('0x6'));var controller=require(_0x9b12('0x7'));router[_0x9b12('0x8')]('/',auth[_0x9b12('0x9')](),controller[_0x9b12('0xa')]);router[_0x9b12('0x8')](_0x9b12('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9b12('0x8')]('/:id/sessions',auth[_0x9b12('0x9')](),controller[_0x9b12('0xc')]);router[_0x9b12('0x8')](_0x9b12('0xd'),auth[_0x9b12('0x9')](),controller[_0x9b12('0xe')]);router[_0x9b12('0x8')]('/:id/summary',auth[_0x9b12('0x9')](),timeout(_0x9b12('0xf')),controller[_0x9b12('0x10')]);router[_0x9b12('0x11')]('/',auth[_0x9b12('0x9')](),controller[_0x9b12('0x12')]);router[_0x9b12('0x11')](_0x9b12('0x13'),auth['isAuthenticated'](),controller[_0x9b12('0x14')]);router[_0x9b12('0x15')]('/:id',auth[_0x9b12('0x9')](),controller[_0x9b12('0x16')]);router[_0x9b12('0x17')](_0x9b12('0xb'),auth[_0x9b12('0x9')](),controller[_0x9b12('0x18')]);module[_0x9b12('0x19')]=router;
\ No newline at end of file
index 423d018..e14b9b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd424=['util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','sequelize'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xd424,0x11d));var _0x4d42=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xd424[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require(_0x4d42('0x0'));var _=require('lodash');var util=require(_0x4d42('0x1'));module[_0x4d42('0x2')]={'name':{'type':Sequelize[_0x4d42('0x3')],'unique':_0x4d42('0x4')},'description':{'type':Sequelize[_0x4d42('0x3')]},'formData':{'type':Sequelize[_0x4d42('0x5')](_0x4d42('0x6')),'set':function(_0x1e16dd){if(_[_0x4d42('0x7')](_0x1e16dd)){this[_0x4d42('0x8')]('formData',JSON['stringify'](_0x1e16dd));}else if(_['isString'](_0x1e16dd)){this[_0x4d42('0x8')](_0x4d42('0x9'),_0x1e16dd);}else{this[_0x4d42('0x8')](_0x4d42('0x9'),util[_0x4d42('0xa')](_0x4d42('0xb'),this[_0x4d42('0xc')]('name')||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xf4a5=['setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','name','STRING','isObjectLike'];(function(_0x1bf417,_0x5a5e0b){var _0x428d95=function(_0x44a99e){while(--_0x44a99e){_0x1bf417['push'](_0x1bf417['shift']());}};_0x428d95(++_0x5a5e0b);}(_0xf4a5,0x1da));var _0x5f4a=function(_0x3d9319,_0x390e90){_0x3d9319=_0x3d9319-0x0;var _0x52bc3a=_0xf4a5[_0x3d9319];return _0x52bc3a;};'use strict';var Sequelize=require(_0x5f4a('0x0'));var _=require(_0x5f4a('0x1'));var util=require(_0x5f4a('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5f4a('0x3')},'description':{'type':Sequelize[_0x5f4a('0x4')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x3928c6){if(_[_0x5f4a('0x5')](_0x3928c6)){this[_0x5f4a('0x6')](_0x5f4a('0x7'),JSON[_0x5f4a('0x8')](_0x3928c6));}else if(_[_0x5f4a('0x9')](_0x3928c6)){this[_0x5f4a('0x6')]('formData',_0x3928c6);}else{this[_0x5f4a('0x6')](_0x5f4a('0x7'),util[_0x5f4a('0xa')](_0x5f4a('0xb'),this[_0x5f4a('0xc')](_0x5f4a('0x3'))||'',this[_0x5f4a('0xc')](_0x5f4a('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x5f4a('0xe')],'defaultValue':![]}};
\ No newline at end of file
index 5516043..37f343a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa45b=['fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','pick','ProjectId','getAnswers','JscriptyAnswerReport','toString','indexOf','replace','startTime','starttime','-createdAt','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','questionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','end','error','name','index','map','JscriptyProject','rawAttributes'];(function(_0x3d0c55,_0x5c7c9f){var _0x5893f7=function(_0x71b977){while(--_0x71b977){_0x3d0c55['push'](_0x3d0c55['shift']());}};_0x5893f7(++_0x5c7c9f);}(_0xa45b,0x199));var _0xba45=function(_0x11d52a,_0x11ae3a){_0x11d52a=_0x11d52a-0x0;var _0x2cbfa0=_0xa45b[_0x11d52a];return _0x2cbfa0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba45('0x0'));var zipdir=require(_0xba45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xba45('0x2'));var Mustache=require(_0xba45('0x3'));var util=require(_0xba45('0x4'));var path=require(_0xba45('0x5'));var sox=require('sox');var csv=require(_0xba45('0x6'));var ejs=require(_0xba45('0x7'));var fs=require('fs');var fs_extra=require(_0xba45('0x8'));var _=require(_0xba45('0x9'));var squel=require(_0xba45('0xa'));var crypto=require(_0xba45('0xb'));var jsforce=require(_0xba45('0xc'));var deskjs=require(_0xba45('0xd'));var toCsv=require('to-csv');var querystring=require(_0xba45('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xba45('0xf'));var hardwareService=require(_0xba45('0x10'));var logger=require('../../config/logger')(_0xba45('0x11'));var utils=require(_0xba45('0x12'));var config=require(_0xba45('0x13'));var licenseUtil=require(_0xba45('0x14'));var db=require(_0xba45('0x15'))['db'];function respondWithStatusCode(_0x5b878e,_0x2d8063){_0x2d8063=_0x2d8063||0xcc;return function(_0x33ed14){if(_0x33ed14){return _0x5b878e[_0xba45('0x16')](_0x2d8063);}return _0x5b878e[_0xba45('0x17')](_0x2d8063)['end']();};}function respondWithResult(_0x4d78c8,_0x4d2ec5){_0x4d2ec5=_0x4d2ec5||0xc8;return function(_0x1972d7){if(_0x1972d7){return _0x4d78c8[_0xba45('0x17')](_0x4d2ec5)[_0xba45('0x18')](_0x1972d7);}};}function respondWithFilteredResult(_0x253db1,_0x734d93){return function(_0x13f291){if(_0x13f291){var _0x298d62=typeof _0x734d93[_0xba45('0x19')]===_0xba45('0x1a')&&typeof _0x734d93[_0xba45('0x1b')]==='undefined';var _0x35d1f8=_0x13f291[_0xba45('0x1c')];var _0x2d523c=_0x298d62?0x0:_0x734d93[_0xba45('0x19')];var _0x5df222=_0x298d62?_0x13f291[_0xba45('0x1c')]:_0x734d93['offset']+_0x734d93[_0xba45('0x1b')];var _0x187b2a;if(_0x5df222>=_0x35d1f8){_0x5df222=_0x35d1f8;_0x187b2a=0xc8;}else{_0x187b2a=0xce;}_0x253db1[_0xba45('0x17')](_0x187b2a);return _0x253db1[_0xba45('0x1d')](_0xba45('0x1e'),_0x2d523c+'-'+_0x5df222+'/'+_0x35d1f8)[_0xba45('0x18')](_0x13f291);}return null;};}function patchUpdates(_0x47fa7c){return function(_0x1f5979){try{jsonpatch[_0xba45('0x1f')](_0x1f5979,_0x47fa7c,!![]);}catch(_0x5b558a){return BPromise[_0xba45('0x20')](_0x5b558a);}return _0x1f5979[_0xba45('0x21')]();};}function saveUpdates(_0x252fdb,_0x3e31b9){return function(_0x11894d){if(_0x11894d){return _0x11894d[_0xba45('0x22')](_0x252fdb)[_0xba45('0x23')](function(_0x3988df){return _0x3988df;});}return null;};}function removeEntity(_0x35185e,_0x274f1b){return function(_0x5e840e){if(_0x5e840e){return _0x5e840e['destroy']()['then'](function(){var _0xcddf3f=_0x5e840e[_0xba45('0x24')]({'plain':!![]});var _0x346ef0=_0xba45('0x25');return db[_0xba45('0x26')][_0xba45('0x27')]({'where':{'type':_0x346ef0,'resourceId':_0xcddf3f['id']}})['then'](function(){return _0x5e840e;});})[_0xba45('0x23')](function(){_0x35185e[_0xba45('0x17')](0xcc)[_0xba45('0x28')]();});}};}function handleEntityNotFound(_0x508fcd,_0x52e9e7){return function(_0x541db4){if(!_0x541db4){_0x508fcd['sendStatus'](0x194);}return _0x541db4;};}function handleError(_0x1e5a50,_0x300a0b){_0x300a0b=_0x300a0b||0x1f4;return function(_0x7b5735){logger[_0xba45('0x29')](_0x7b5735['stack']);if(_0x7b5735[_0xba45('0x2a')]){delete _0x7b5735[_0xba45('0x2a')];}_0x1e5a50['status'](_0x300a0b)['send'](_0x7b5735);};}exports[_0xba45('0x2b')]=function(_0x44b4e0,_0x9d7bd3){var _0x18a04e={},_0x3bc8e3={},_0x4a5a19={'count':0x0,'rows':[]};var _0x7e284a=_[_0xba45('0x2c')](db[_0xba45('0x2d')][_0xba45('0x2e')],function(_0x145236){return{'name':_0x145236[_0xba45('0x2f')],'type':_0x145236[_0xba45('0x30')][_0xba45('0x31')]};});_0x3bc8e3['model']=_[_0xba45('0x2c')](_0x7e284a,_0xba45('0x2a'));_0x3bc8e3[_0xba45('0x32')]=_[_0xba45('0x33')](_0x44b4e0['query']);_0x3bc8e3[_0xba45('0x34')]=_['intersection'](_0x3bc8e3[_0xba45('0x35')],_0x3bc8e3[_0xba45('0x32')]);_0x18a04e[_0xba45('0x36')]=_[_0xba45('0x37')](_0x3bc8e3['model'],qs[_0xba45('0x38')](_0x44b4e0[_0xba45('0x32')]['fields']));_0x18a04e[_0xba45('0x36')]=_0x18a04e['attributes'][_0xba45('0x39')]?_0x18a04e[_0xba45('0x36')]:_0x3bc8e3['model'];if(!_0x44b4e0[_0xba45('0x32')][_0xba45('0x3a')](_0xba45('0x3b'))){_0x18a04e['limit']=qs[_0xba45('0x1b')](_0x44b4e0[_0xba45('0x32')]['limit']);_0x18a04e[_0xba45('0x19')]=qs[_0xba45('0x19')](_0x44b4e0[_0xba45('0x32')][_0xba45('0x19')]);}_0x18a04e[_0xba45('0x3c')]=qs[_0xba45('0x3d')](_0x44b4e0[_0xba45('0x32')][_0xba45('0x3d')]);_0x18a04e[_0xba45('0x3e')]=qs[_0xba45('0x34')](_['pick'](_0x44b4e0[_0xba45('0x32')],_0x3bc8e3['filters']),_0x7e284a);if(_0x44b4e0[_0xba45('0x32')][_0xba45('0x3f')]){_0x18a04e[_0xba45('0x3e')]=_[_0xba45('0x40')](_0x18a04e[_0xba45('0x3e')],{'$or':_[_0xba45('0x2c')](_0x7e284a,function(_0x5eb36b){if(_0x5eb36b[_0xba45('0x30')]!=='VIRTUAL'){var _0x3a3981={};_0x3a3981[_0x5eb36b[_0xba45('0x2a')]]={'$like':'%'+_0x44b4e0[_0xba45('0x32')][_0xba45('0x3f')]+'%'};return _0x3a3981;}})});}_0x18a04e=_[_0xba45('0x40')]({},_0x18a04e,_0x44b4e0[_0xba45('0x41')]);var _0x186ab0={'where':_0x18a04e['where']};return db[_0xba45('0x2d')][_0xba45('0x1c')](_0x186ab0)[_0xba45('0x23')](function(_0x5781d6){_0x4a5a19[_0xba45('0x1c')]=_0x5781d6;if(_0x44b4e0[_0xba45('0x32')][_0xba45('0x42')]){_0x18a04e[_0xba45('0x43')]=[{'all':!![]}];}return db['JscriptyProject'][_0xba45('0x44')](_0x18a04e);})[_0xba45('0x23')](function(_0x969ca7){_0x4a5a19[_0xba45('0x45')]=_0x969ca7;return _0x4a5a19;})[_0xba45('0x23')](respondWithFilteredResult(_0x9d7bd3,_0x18a04e))[_0xba45('0x46')](handleError(_0x9d7bd3,null));};exports[_0xba45('0x47')]=function(_0x20a65f,_0x24c935){var _0x4da222={'raw':![],'where':{'id':_0x20a65f[_0xba45('0x48')]['id']}},_0x41574b={};_0x41574b[_0xba45('0x35')]=_[_0xba45('0x33')](db[_0xba45('0x2d')][_0xba45('0x2e')]);_0x41574b[_0xba45('0x32')]=_[_0xba45('0x33')](_0x20a65f[_0xba45('0x32')]);_0x41574b[_0xba45('0x34')]=_['intersection'](_0x41574b['model'],_0x41574b[_0xba45('0x32')]);_0x4da222[_0xba45('0x36')]=_[_0xba45('0x37')](_0x41574b[_0xba45('0x35')],qs[_0xba45('0x38')](_0x20a65f['query'][_0xba45('0x38')]));_0x4da222['attributes']=_0x4da222[_0xba45('0x36')][_0xba45('0x39')]?_0x4da222[_0xba45('0x36')]:_0x41574b[_0xba45('0x35')];if(_0x20a65f[_0xba45('0x32')][_0xba45('0x42')]){_0x4da222['include']=[{'all':!![]}];}_0x4da222=_[_0xba45('0x40')]({},_0x4da222,_0x20a65f[_0xba45('0x41')]);return db[_0xba45('0x2d')][_0xba45('0x49')](_0x4da222)[_0xba45('0x23')](handleEntityNotFound(_0x24c935,null))[_0xba45('0x23')](respondWithResult(_0x24c935,null))[_0xba45('0x46')](handleError(_0x24c935,null));};exports['create']=function(_0x302ff8,_0x185cad){return db['JscriptyProject'][_0xba45('0x4a')](_0x302ff8[_0xba45('0x4b')],{})[_0xba45('0x23')](function(_0x55b508){var _0x29024c=_0x302ff8['user'][_0xba45('0x24')]({'plain':!![]});if(!_0x29024c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29024c[_0xba45('0x4c')]===_0xba45('0x4d')){var _0x5f19a0=_0x55b508['get']({'plain':!![]});var _0x2e82dc=_0xba45('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x2e82dc,'userProfileId':_0x29024c[_0xba45('0x4e')]},'raw':!![]})[_0xba45('0x23')](function(_0x19e76e){if(_0x19e76e&&_0x19e76e[_0xba45('0x4f')]===0x0){return db[_0xba45('0x26')][_0xba45('0x4a')]({'name':_0x5f19a0[_0xba45('0x2a')],'resourceId':_0x5f19a0['id'],'type':_0x19e76e[_0xba45('0x2a')],'sectionId':_0x19e76e['id']},{})[_0xba45('0x23')](function(){return _0x55b508;});}else{return _0x55b508;}})[_0xba45('0x46')](function(_0x14fa7d){logger[_0xba45('0x29')](_0xba45('0x50'),_0x14fa7d);throw _0x14fa7d;});}return _0x55b508;})[_0xba45('0x23')](respondWithResult(_0x185cad,0xc9))[_0xba45('0x46')](handleError(_0x185cad,null));};exports[_0xba45('0x51')]=function(_0x3f33fe,_0x54ac64){var _0x184889={'where':{'id':_0x3f33fe[_0xba45('0x48')]['id']}},_0x32c727={};_0x32c727[_0xba45('0x35')]=_['keys'](db[_0xba45('0x2d')][_0xba45('0x2e')]);_0x184889[_0xba45('0x36')]=_[_0xba45('0x37')](_0x32c727[_0xba45('0x35')],qs[_0xba45('0x38')](_0x3f33fe[_0xba45('0x32')][_0xba45('0x38')]));_0x184889[_0xba45('0x36')]=_0x184889[_0xba45('0x36')]['length']?_0x184889[_0xba45('0x36')]:_0x32c727[_0xba45('0x35')];if(_0x3f33fe['query']['includeAll']){_0x184889[_0xba45('0x43')]=[{'all':!![]}];}_0x184889=_[_0xba45('0x40')]({},_0x184889,_0x3f33fe[_0xba45('0x41')]);return db[_0xba45('0x2d')][_0xba45('0x49')](_0x184889)[_0xba45('0x23')](handleEntityNotFound(_0x54ac64,null))[_0xba45('0x23')](function(_0x4475b9){if(_0x4475b9){var _0x5e8c37=_0x4475b9[_0xba45('0x24')]({'plain':!![]});_0x5e8c37=qs[_0xba45('0x52')](_0x5e8c37,['id',_0xba45('0x53'),_0xba45('0x54')]);_0x3f33fe[_0xba45('0x4b')]=_[_0xba45('0x52')](_0x3f33fe['body'],['id',_0xba45('0x53'),_0xba45('0x54')]);return db[_0xba45('0x2d')][_0xba45('0x4a')](_[_0xba45('0x40')](_0x5e8c37,_0x3f33fe[_0xba45('0x4b')]),{'include':_0x3f33fe[_0xba45('0x32')][_0xba45('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x5b2dea){var _0x32f4e8=_0x3f33fe[_0xba45('0x4d')][_0xba45('0x24')]({'plain':!![]});if(!_0x32f4e8)throw new Error(_0xba45('0x55'));if(_0x32f4e8[_0xba45('0x4c')]===_0xba45('0x4d')){var _0x5cdc50=_0x5b2dea[_0xba45('0x24')]({'plain':!![]});var _0xae56b8=_0xba45('0x25');return db['UserProfileSection'][_0xba45('0x49')]({'where':{'name':_0xae56b8,'userProfileId':_0x32f4e8['userProfileId']},'raw':!![]})[_0xba45('0x23')](function(_0x228376){if(_0x228376&&_0x228376[_0xba45('0x4f')]===0x0){return db['UserProfileResource'][_0xba45('0x4a')]({'name':_0x5cdc50['name'],'resourceId':_0x5cdc50['id'],'type':_0x228376[_0xba45('0x2a')],'sectionId':_0x228376['id']},{})['then'](function(){return _0x5b2dea;});}else{return _0x5b2dea;}})[_0xba45('0x46')](function(_0x3f1571){logger[_0xba45('0x29')](_0xba45('0x50'),_0x3f1571);throw _0x3f1571;});}return _0x5b2dea;});}})[_0xba45('0x23')](respondWithResult(_0x54ac64,0xc9))[_0xba45('0x46')](handleError(_0x54ac64,null));};exports[_0xba45('0x22')]=function(_0xd9e844,_0x48a516){if(_0xd9e844[_0xba45('0x4b')]['id']){delete _0xd9e844[_0xba45('0x4b')]['id'];}return db[_0xba45('0x2d')][_0xba45('0x49')]({'where':{'id':_0xd9e844[_0xba45('0x48')]['id']}})[_0xba45('0x23')](handleEntityNotFound(_0x48a516,null))[_0xba45('0x23')](saveUpdates(_0xd9e844['body'],null))[_0xba45('0x23')](respondWithResult(_0x48a516,null))[_0xba45('0x46')](handleError(_0x48a516,null));};exports[_0xba45('0x27')]=function(_0x3613ca,_0x599cd4){return db[_0xba45('0x2d')]['find']({'where':{'id':_0x3613ca['params']['id']}})[_0xba45('0x23')](handleEntityNotFound(_0x599cd4,null))[_0xba45('0x23')](removeEntity(_0x599cd4,null))[_0xba45('0x46')](handleError(_0x599cd4,null));};exports[_0xba45('0x56')]=function(_0x3b97eb,_0x11ff78,_0x986d50){var _0x5dc3e9={'raw':!![],'where':{}};var _0x158f84={};var _0x29049f={'count':0x0,'rows':[]};return db[_0xba45('0x2d')][_0xba45('0x57')]({'where':{'id':_0x3b97eb[_0xba45('0x48')]['id']}})['then'](handleEntityNotFound(_0x11ff78,null))[_0xba45('0x23')](function(_0x50f481){if(_0x50f481){_0x158f84['model']=_['keys'](db[_0xba45('0x58')][_0xba45('0x2e')]);_0x158f84['query']=_[_0xba45('0x33')](_0x3b97eb[_0xba45('0x32')]);_0x158f84[_0xba45('0x34')]=_[_0xba45('0x37')](_0x158f84['model'],_0x158f84['query']);_0x5dc3e9[_0xba45('0x36')]=_['intersection'](_0x158f84[_0xba45('0x35')],qs[_0xba45('0x38')](_0x3b97eb['query'][_0xba45('0x38')]));_0x5dc3e9[_0xba45('0x36')]=_0x5dc3e9['attributes'][_0xba45('0x39')]?_0x5dc3e9[_0xba45('0x36')]:_0x158f84[_0xba45('0x35')];if(!_0x3b97eb[_0xba45('0x32')]['hasOwnProperty']('nolimit')){_0x5dc3e9[_0xba45('0x1b')]=qs[_0xba45('0x1b')](_0x3b97eb[_0xba45('0x32')][_0xba45('0x1b')]);_0x5dc3e9['offset']=qs['offset'](_0x3b97eb[_0xba45('0x32')]['offset']);}_0x5dc3e9[_0xba45('0x3c')]=qs[_0xba45('0x3d')](_0x3b97eb[_0xba45('0x32')][_0xba45('0x3d')]);_0x5dc3e9['where']=qs[_0xba45('0x34')](_[_0xba45('0x59')](_0x3b97eb['query'],_0x158f84[_0xba45('0x34')]));_0x5dc3e9[_0xba45('0x3e')][_0xba45('0x5a')]=_0x50f481['id'];if(_0x3b97eb[_0xba45('0x32')][_0xba45('0x3f')]){_0x5dc3e9[_0xba45('0x3e')]=_['merge'](_0x5dc3e9[_0xba45('0x3e')],{'$or':_['map'](_0x5dc3e9['attributes'],function(_0x58b69f){var _0x32fa6e={};_0x32fa6e[_0x58b69f]={'$like':'%'+_0x3b97eb[_0xba45('0x32')][_0xba45('0x3f')]+'%'};return _0x32fa6e;})});}_0x5dc3e9=_[_0xba45('0x40')]({},_0x5dc3e9,_0x3b97eb[_0xba45('0x41')]);return db[_0xba45('0x58')][_0xba45('0x1c')]({'where':_0x5dc3e9['where']})['then'](function(_0x2ae1e5){_0x29049f[_0xba45('0x1c')]=_0x2ae1e5;if(_0x3b97eb[_0xba45('0x32')][_0xba45('0x42')]){_0x5dc3e9[_0xba45('0x43')]=[{'all':!![]}];}return db[_0xba45('0x58')]['findAll'](_0x5dc3e9);})[_0xba45('0x23')](function(_0x3a5411){_0x29049f[_0xba45('0x45')]=_0x3a5411;return _0x29049f;});}})['then'](respondWithFilteredResult(_0x11ff78,_0x5dc3e9))[_0xba45('0x46')](handleError(_0x11ff78,null));};exports[_0xba45('0x5b')]=function(_0x189250,_0x4030eb,_0x38d130){var _0x23a26d={'raw':!![],'where':{}};var _0x2e1fb5={};var _0x660d54={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xba45('0x57')]({'where':{'id':_0x189250[_0xba45('0x48')]['id']}})[_0xba45('0x23')](handleEntityNotFound(_0x4030eb,null))[_0xba45('0x23')](function(_0x347a70){if(_0x347a70){_0x2e1fb5[_0xba45('0x35')]=_[_0xba45('0x33')](db[_0xba45('0x5c')][_0xba45('0x2e')]);_0x2e1fb5[_0xba45('0x32')]=_[_0xba45('0x33')](_0x189250[_0xba45('0x32')]);_0x2e1fb5[_0xba45('0x34')]=_[_0xba45('0x37')](_0x2e1fb5[_0xba45('0x35')],_0x2e1fb5['query']);_0x23a26d[_0xba45('0x36')]=_[_0xba45('0x37')](_0x2e1fb5[_0xba45('0x35')],qs[_0xba45('0x38')](_0x189250[_0xba45('0x32')][_0xba45('0x38')]));_0x23a26d['attributes']=_0x23a26d[_0xba45('0x36')][_0xba45('0x39')]?_0x23a26d['attributes']:_0x2e1fb5[_0xba45('0x35')];if(!_0x189250['query'][_0xba45('0x3a')](_0xba45('0x3b'))){_0x23a26d[_0xba45('0x1b')]=qs['limit'](_0x189250[_0xba45('0x32')]['limit']);_0x23a26d['offset']=qs['offset'](_0x189250['query']['offset']);}_0x23a26d[_0xba45('0x3c')]=qs[_0xba45('0x3d')](_0x189250[_0xba45('0x32')][_0xba45('0x3d')]);_0x23a26d[_0xba45('0x3e')]=qs['filters'](_[_0xba45('0x59')](_0x189250[_0xba45('0x32')],_0x2e1fb5[_0xba45('0x34')]));_0x23a26d[_0xba45('0x3e')][_0xba45('0x5a')]=_0x347a70['id'];if(_0x189250[_0xba45('0x32')]['filter']){_0x23a26d[_0xba45('0x3e')]=_[_0xba45('0x40')](_0x23a26d[_0xba45('0x3e')],{'$or':_['map'](_0x23a26d['attributes'],function(_0x21b3f8){var _0x4258d4={};_0x4258d4[_0x21b3f8]={'$like':'%'+_0x189250['query'][_0xba45('0x3f')]+'%'};return _0x4258d4;})});}_0x23a26d=_[_0xba45('0x40')]({},_0x23a26d,_0x189250[_0xba45('0x41')]);return db[_0xba45('0x5c')][_0xba45('0x1c')]({'where':_0x23a26d[_0xba45('0x3e')]})[_0xba45('0x23')](function(_0x34ae41){_0x660d54[_0xba45('0x1c')]=_0x34ae41;if(_0x189250[_0xba45('0x32')]['includeAll']){_0x23a26d[_0xba45('0x43')]=[{'all':!![]}];}return db[_0xba45('0x5c')]['findAll'](_0x23a26d);})['then'](function(_0x5beefb){_0x660d54['rows']=_0x5beefb;return _0x660d54;});}})[_0xba45('0x23')](respondWithFilteredResult(_0x4030eb,_0x23a26d))[_0xba45('0x46')](handleError(_0x4030eb,null));};function char(_0x51a756){return'number'===typeof _0x51a756?String['fromCharCode'][_0xba45('0x1f')](null,arguments):_0x51a756;}function needsEncapsulation(_0x2cd129){return!!_0x2cd129&&(_0x2cd129[_0xba45('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x2cd129[_0xba45('0x5d')]()['indexOf'](char(0xa))>=0x0||_0x2cd129['toString']()[_0xba45('0x5e')](char(0x2c))>=0x0||_0x2cd129[_0xba45('0x5d')]()[_0xba45('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x230c19){var _0x4677f9=char(0x22),_0x118337='\x5c'+char(0x22),_0x1a7e83=_0x230c19[_0xba45('0x5d')]()[_0xba45('0x5f')](new RegExp(_0x4677f9,'g'),_0x118337);return _0x4677f9+_0x1a7e83+_0x4677f9;}exports['getSummary']=function(_0x13f9db,_0x58a99e,_0x59bee8){var _0x380a6e,_0x29b0e5;var _0xa57d57={'where':{'ProjectId':_0x13f9db[_0xba45('0x48')]['id']}};if(_0x13f9db['query'][_0xba45('0x60')]){_0xa57d57['where'][_0xba45('0x61')]=JSON['parse'](_0x13f9db[_0xba45('0x32')][_0xba45('0x60')]);}return db['JscriptySessionReport'][_0xba45('0x44')](_0xa57d57)[_0xba45('0x23')](handleEntityNotFound(_0x58a99e,null))[_0xba45('0x23')](function(_0x1ff407){if(_0x1ff407){_0x380a6e=_0x1ff407;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0xba45('0x2c')](_0x380a6e,'id')},'ProjectId':_0x13f9db[_0xba45('0x48')]['id']},'order':_0xba45('0x62')});}})[_0xba45('0x23')](handleEntityNotFound(_0x58a99e,null))[_0xba45('0x23')](function(_0x16a801){if(_0x16a801){_0x29b0e5=_0x16a801;var _0x5f39e8={};for(var _0x48fddc=0x0,_0x75c0bd=_0x29b0e5['length'];_0x48fddc<_0x75c0bd;_0x48fddc++){if(!_0x5f39e8[_0xba45('0x3a')](_0x29b0e5[_0x48fddc]['questionId'])){_0x5f39e8[_0x29b0e5[_0x48fddc]['questionId']]=needsEncapsulation(_0x29b0e5[_0x48fddc]['question'])?encapsulate(_0x29b0e5[_0x48fddc]['question']):_0x29b0e5[_0x48fddc]['question'];}}var _0x5561f0=[],_0x564a45={};for(var _0x396ea7=0x0,_0x43ec08=_0x380a6e[_0xba45('0x39')];_0x396ea7<_0x43ec08;_0x396ea7++){_0x564a45={'ProjectId':_0x13f9db['params']['id'],'SessionId':_0x380a6e[_0x396ea7]['id'],'StartTime':moment(_0x380a6e[_0x396ea7][_0xba45('0x61')])[_0xba45('0x63')](_0xba45('0x64'))};for(var _0x4689b3=0x0,_0x453a45=_0x29b0e5[_0xba45('0x39')];_0x4689b3<_0x453a45;_0x4689b3++){if(_0x29b0e5[_0x4689b3][_0xba45('0x65')]==_0x380a6e[_0x396ea7]['id']&&_0x5f39e8['hasOwnProperty'](_0x29b0e5[_0x4689b3][_0xba45('0x66')])){_0x564a45[_0x5f39e8[_0x29b0e5[_0x4689b3][_0xba45('0x66')]]]=_0x29b0e5[_0x4689b3][_0xba45('0x67')];}}for(var _0xe0576 in _0x5f39e8){if(!_0x564a45[_0xba45('0x3a')](_0x5f39e8[_0xe0576])){_0x564a45[_0x5f39e8[_0xe0576]]=null;}}_0x5561f0['push'](_0x564a45);}return _0x5561f0;}})['then'](function(_0x24fa7a){if(!_[_0xba45('0x68')](_0x24fa7a)){var _0x551049=toCsv(_0x24fa7a);var _0x20180c=Date[_0xba45('0x69')]();fs[_0xba45('0x6a')](util[_0xba45('0x63')](_0xba45('0x6b'),_0x13f9db[_0xba45('0x48')]['id'],_0x20180c),_0x551049);_0x58a99e[_0xba45('0x6c')](_0xba45('0x6d'),_0xba45('0x6e')+util[_0xba45('0x63')](_0xba45('0x6f'),_0x13f9db[_0xba45('0x48')]['id'],_0x20180c));_0x58a99e[_0xba45('0x6c')]('Content-type',_0xba45('0x70'));return _0x58a99e[_0xba45('0x71')](util[_0xba45('0x63')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x13f9db['params']['id'],_0x20180c));}else{return _0x58a99e[_0xba45('0x16')](0xcc);}})['catch'](handleError(_0x58a99e,null));};
\ No newline at end of file
+var _0x28cd=['JscriptyAnswerReport','pick','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','sendStatus','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','JscriptyProject','includeAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','include','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','order','ProjectId','JscriptySessionReport','findAll','getAnswers','findOne'];(function(_0x33f36e,_0x163451){var _0x39abbb=function(_0xbd3490){while(--_0xbd3490){_0x33f36e['push'](_0x33f36e['shift']());}};_0x39abbb(++_0x163451);}(_0x28cd,0x177));var _0xd28c=function(_0x42d7f9,_0x2b75df){_0x42d7f9=_0x42d7f9-0x0;var _0xf48ff8=_0x28cd[_0x42d7f9];return _0xf48ff8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd28c('0x0'));var jsonpatch=require(_0xd28c('0x1'));var rp=require(_0xd28c('0x2'));var moment=require(_0xd28c('0x3'));var BPromise=require(_0xd28c('0x4'));var Mustache=require(_0xd28c('0x5'));var util=require(_0xd28c('0x6'));var path=require(_0xd28c('0x7'));var sox=require(_0xd28c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd28c('0x9'));var squel=require(_0xd28c('0xa'));var crypto=require(_0xd28c('0xb'));var jsforce=require(_0xd28c('0xc'));var deskjs=require(_0xd28c('0xd'));var toCsv=require(_0xd28c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd28c('0xf'));var authService=require(_0xd28c('0x10'));var qs=require(_0xd28c('0x11'));var as=require(_0xd28c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd28c('0x13'))(_0xd28c('0x14'));var utils=require(_0xd28c('0x15'));var config=require(_0xd28c('0x16'));var licenseUtil=require(_0xd28c('0x17'));var db=require(_0xd28c('0x18'))['db'];function respondWithStatusCode(_0x5f0638,_0x28f21a){_0x28f21a=_0x28f21a||0xcc;return function(_0x25e6ff){if(_0x25e6ff){return _0x5f0638['sendStatus'](_0x28f21a);}return _0x5f0638['status'](_0x28f21a)[_0xd28c('0x19')]();};}function respondWithResult(_0x5c1a6f,_0x1c317e){_0x1c317e=_0x1c317e||0xc8;return function(_0x1eb24e){if(_0x1eb24e){return _0x5c1a6f[_0xd28c('0x1a')](_0x1c317e)[_0xd28c('0x1b')](_0x1eb24e);}};}function respondWithFilteredResult(_0x3bd1de,_0x48529a){return function(_0x41565){if(_0x41565){var _0x6cf0cf=typeof _0x48529a[_0xd28c('0x1c')]===_0xd28c('0x1d')&&typeof _0x48529a[_0xd28c('0x1e')]===_0xd28c('0x1d');var _0xa336a9=_0x41565[_0xd28c('0x1f')];var _0x1fd335=_0x6cf0cf?0x0:_0x48529a[_0xd28c('0x1c')];var _0x350348=_0x6cf0cf?_0x41565[_0xd28c('0x1f')]:_0x48529a[_0xd28c('0x1c')]+_0x48529a[_0xd28c('0x1e')];var _0x23a673;if(_0x350348>=_0xa336a9){_0x350348=_0xa336a9;_0x23a673=0xc8;}else{_0x23a673=0xce;}_0x3bd1de[_0xd28c('0x1a')](_0x23a673);return _0x3bd1de[_0xd28c('0x20')]('Content-Range',_0x1fd335+'-'+_0x350348+'/'+_0xa336a9)[_0xd28c('0x1b')](_0x41565);}return null;};}function patchUpdates(_0x3b6c19){return function(_0x5541ae){try{jsonpatch[_0xd28c('0x21')](_0x5541ae,_0x3b6c19,!![]);}catch(_0x149d7c){return BPromise[_0xd28c('0x22')](_0x149d7c);}return _0x5541ae[_0xd28c('0x23')]();};}function saveUpdates(_0x368248,_0x1c6e56){return function(_0x441f86){if(_0x441f86){return _0x441f86[_0xd28c('0x24')](_0x368248)[_0xd28c('0x25')](function(_0x5b56c2){return _0x5b56c2;});}return null;};}function removeEntity(_0x2b9dae,_0x42d3c7){return function(_0x2149c8){if(_0x2149c8){return _0x2149c8[_0xd28c('0x26')]()['then'](function(){var _0x5a9fbb=_0x2149c8['get']({'plain':!![]});var _0xc4b0a1=_0xd28c('0x27');return db[_0xd28c('0x28')]['destroy']({'where':{'type':_0xc4b0a1,'resourceId':_0x5a9fbb['id']}})[_0xd28c('0x25')](function(){return _0x2149c8;});})['then'](function(){_0x2b9dae[_0xd28c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x417f32,_0x40f907){return function(_0x29f764){if(!_0x29f764){_0x417f32['sendStatus'](0x194);}return _0x29f764;};}function handleError(_0x335bff,_0x141a77){_0x141a77=_0x141a77||0x1f4;return function(_0x51d60e){logger[_0xd28c('0x29')](_0x51d60e[_0xd28c('0x2a')]);if(_0x51d60e[_0xd28c('0x2b')]){delete _0x51d60e[_0xd28c('0x2b')];}_0x335bff[_0xd28c('0x1a')](_0x141a77)[_0xd28c('0x2c')](_0x51d60e);};}exports[_0xd28c('0x2d')]=function(_0x2f2c77,_0x2915fd){var _0x286af6={},_0x18e4ec={},_0x131723={'count':0x0,'rows':[]};var _0x5b1dc6=_[_0xd28c('0x2e')](db['JscriptyProject'][_0xd28c('0x2f')],function(_0xa1fc99){return{'name':_0xa1fc99['fieldName'],'type':_0xa1fc99[_0xd28c('0x30')][_0xd28c('0x31')]};});_0x18e4ec[_0xd28c('0x32')]=_[_0xd28c('0x2e')](_0x5b1dc6,_0xd28c('0x2b'));_0x18e4ec[_0xd28c('0x33')]=_[_0xd28c('0x34')](_0x2f2c77['query']);_0x18e4ec[_0xd28c('0x35')]=_[_0xd28c('0x36')](_0x18e4ec['model'],_0x18e4ec[_0xd28c('0x33')]);_0x286af6[_0xd28c('0x37')]=_[_0xd28c('0x36')](_0x18e4ec[_0xd28c('0x32')],qs['fields'](_0x2f2c77[_0xd28c('0x33')][_0xd28c('0x38')]));_0x286af6[_0xd28c('0x37')]=_0x286af6['attributes'][_0xd28c('0x39')]?_0x286af6[_0xd28c('0x37')]:_0x18e4ec[_0xd28c('0x32')];if(!_0x2f2c77[_0xd28c('0x33')][_0xd28c('0x3a')](_0xd28c('0x3b'))){_0x286af6[_0xd28c('0x1e')]=qs[_0xd28c('0x1e')](_0x2f2c77[_0xd28c('0x33')][_0xd28c('0x1e')]);_0x286af6[_0xd28c('0x1c')]=qs[_0xd28c('0x1c')](_0x2f2c77[_0xd28c('0x33')]['offset']);}_0x286af6['order']=qs['sort'](_0x2f2c77[_0xd28c('0x33')][_0xd28c('0x3c')]);_0x286af6['where']=qs[_0xd28c('0x35')](_['pick'](_0x2f2c77[_0xd28c('0x33')],_0x18e4ec['filters']),_0x5b1dc6);if(_0x2f2c77[_0xd28c('0x33')][_0xd28c('0x3d')]){_0x286af6['where']=_[_0xd28c('0x3e')](_0x286af6[_0xd28c('0x3f')],{'$or':_[_0xd28c('0x2e')](_0x5b1dc6,function(_0x279e98){if(_0x279e98[_0xd28c('0x30')]!==_0xd28c('0x40')){var _0xd53644={};_0xd53644[_0x279e98[_0xd28c('0x2b')]]={'$like':'%'+_0x2f2c77[_0xd28c('0x33')][_0xd28c('0x3d')]+'%'};return _0xd53644;}})});}_0x286af6=_[_0xd28c('0x3e')]({},_0x286af6,_0x2f2c77[_0xd28c('0x41')]);var _0x340946={'where':_0x286af6[_0xd28c('0x3f')]};return db[_0xd28c('0x42')]['count'](_0x340946)[_0xd28c('0x25')](function(_0x14d414){_0x131723[_0xd28c('0x1f')]=_0x14d414;if(_0x2f2c77[_0xd28c('0x33')][_0xd28c('0x43')]){_0x286af6['include']=[{'all':!![]}];}return db[_0xd28c('0x42')]['findAll'](_0x286af6);})[_0xd28c('0x25')](function(_0x19967f){_0x131723[_0xd28c('0x44')]=_0x19967f;return _0x131723;})[_0xd28c('0x25')](respondWithFilteredResult(_0x2915fd,_0x286af6))[_0xd28c('0x45')](handleError(_0x2915fd,null));};exports['show']=function(_0x11d569,_0x14b5d9){var _0x299c6a={'raw':![],'where':{'id':_0x11d569[_0xd28c('0x46')]['id']}},_0x4d4779={};_0x4d4779[_0xd28c('0x32')]=_['keys'](db[_0xd28c('0x42')][_0xd28c('0x2f')]);_0x4d4779[_0xd28c('0x33')]=_['keys'](_0x11d569['query']);_0x4d4779[_0xd28c('0x35')]=_['intersection'](_0x4d4779[_0xd28c('0x32')],_0x4d4779['query']);_0x299c6a[_0xd28c('0x37')]=_[_0xd28c('0x36')](_0x4d4779[_0xd28c('0x32')],qs[_0xd28c('0x38')](_0x11d569[_0xd28c('0x33')][_0xd28c('0x38')]));_0x299c6a[_0xd28c('0x37')]=_0x299c6a['attributes']['length']?_0x299c6a[_0xd28c('0x37')]:_0x4d4779['model'];if(_0x11d569['query'][_0xd28c('0x43')]){_0x299c6a['include']=[{'all':!![]}];}_0x299c6a=_['merge']({},_0x299c6a,_0x11d569['options']);return db[_0xd28c('0x42')][_0xd28c('0x47')](_0x299c6a)[_0xd28c('0x25')](handleEntityNotFound(_0x14b5d9,null))['then'](respondWithResult(_0x14b5d9,null))['catch'](handleError(_0x14b5d9,null));};exports[_0xd28c('0x48')]=function(_0x27d2c1,_0x315a79){return db[_0xd28c('0x42')][_0xd28c('0x48')](_0x27d2c1[_0xd28c('0x49')],{})['then'](function(_0x25c3f6){var _0x507db4=_0x27d2c1[_0xd28c('0x4a')][_0xd28c('0x4b')]({'plain':!![]});if(!_0x507db4)throw new Error(_0xd28c('0x4c'));if(_0x507db4[_0xd28c('0x4d')]===_0xd28c('0x4a')){var _0x269c51=_0x25c3f6[_0xd28c('0x4b')]({'plain':!![]});var _0x3abe4b=_0xd28c('0x27');return db[_0xd28c('0x4e')][_0xd28c('0x47')]({'where':{'name':_0x3abe4b,'userProfileId':_0x507db4[_0xd28c('0x4f')]},'raw':!![]})['then'](function(_0x15a779){if(_0x15a779&&_0x15a779[_0xd28c('0x50')]===0x0){return db[_0xd28c('0x28')][_0xd28c('0x48')]({'name':_0x269c51[_0xd28c('0x2b')],'resourceId':_0x269c51['id'],'type':_0x15a779[_0xd28c('0x2b')],'sectionId':_0x15a779['id']},{})[_0xd28c('0x25')](function(){return _0x25c3f6;});}else{return _0x25c3f6;}})[_0xd28c('0x45')](function(_0x5ca4f7){logger[_0xd28c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ca4f7);throw _0x5ca4f7;});}return _0x25c3f6;})['then'](respondWithResult(_0x315a79,0xc9))[_0xd28c('0x45')](handleError(_0x315a79,null));};exports[_0xd28c('0x51')]=function(_0x370943,_0x3a24ef){var _0x3b7525={'where':{'id':_0x370943[_0xd28c('0x46')]['id']}},_0xf88292={};_0xf88292['model']=_['keys'](db[_0xd28c('0x42')][_0xd28c('0x2f')]);_0x3b7525[_0xd28c('0x37')]=_[_0xd28c('0x36')](_0xf88292[_0xd28c('0x32')],qs[_0xd28c('0x38')](_0x370943[_0xd28c('0x33')][_0xd28c('0x38')]));_0x3b7525[_0xd28c('0x37')]=_0x3b7525['attributes']['length']?_0x3b7525[_0xd28c('0x37')]:_0xf88292[_0xd28c('0x32')];if(_0x370943[_0xd28c('0x33')][_0xd28c('0x43')]){_0x3b7525[_0xd28c('0x52')]=[{'all':!![]}];}_0x3b7525=_[_0xd28c('0x3e')]({},_0x3b7525,_0x370943[_0xd28c('0x41')]);return db[_0xd28c('0x42')][_0xd28c('0x47')](_0x3b7525)['then'](handleEntityNotFound(_0x3a24ef,null))[_0xd28c('0x25')](function(_0xa0ad1f){if(_0xa0ad1f){var _0x233656=_0xa0ad1f['get']({'plain':!![]});_0x233656=qs[_0xd28c('0x53')](_0x233656,['id',_0xd28c('0x54'),_0xd28c('0x55')]);_0x370943[_0xd28c('0x49')]=_[_0xd28c('0x53')](_0x370943[_0xd28c('0x49')],['id',_0xd28c('0x54'),'updatedAt']);return db[_0xd28c('0x42')][_0xd28c('0x48')](_[_0xd28c('0x3e')](_0x233656,_0x370943[_0xd28c('0x49')]),{'include':_0x370943[_0xd28c('0x33')][_0xd28c('0x43')]?[{'all':!![]}]:undefined})[_0xd28c('0x25')](function(_0x59fa53){var _0x53b6d7=_0x370943[_0xd28c('0x4a')][_0xd28c('0x4b')]({'plain':!![]});if(!_0x53b6d7)throw new Error(_0xd28c('0x4c'));if(_0x53b6d7[_0xd28c('0x4d')]==='user'){var _0x1149c9=_0x59fa53[_0xd28c('0x4b')]({'plain':!![]});var _0x30dfff=_0xd28c('0x27');return db[_0xd28c('0x4e')][_0xd28c('0x47')]({'where':{'name':_0x30dfff,'userProfileId':_0x53b6d7['userProfileId']},'raw':!![]})[_0xd28c('0x25')](function(_0xd32478){if(_0xd32478&&_0xd32478['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1149c9[_0xd28c('0x2b')],'resourceId':_0x1149c9['id'],'type':_0xd32478[_0xd28c('0x2b')],'sectionId':_0xd32478['id']},{})['then'](function(){return _0x59fa53;});}else{return _0x59fa53;}})[_0xd28c('0x45')](function(_0x18acb7){logger[_0xd28c('0x29')](_0xd28c('0x56'),_0x18acb7);throw _0x18acb7;});}return _0x59fa53;});}})['then'](respondWithResult(_0x3a24ef,0xc9))[_0xd28c('0x45')](handleError(_0x3a24ef,null));};exports[_0xd28c('0x24')]=function(_0x4730b7,_0x315a36){if(_0x4730b7[_0xd28c('0x49')]['id']){delete _0x4730b7[_0xd28c('0x49')]['id'];}return db[_0xd28c('0x42')]['find']({'where':{'id':_0x4730b7[_0xd28c('0x46')]['id']}})[_0xd28c('0x25')](handleEntityNotFound(_0x315a36,null))['then'](saveUpdates(_0x4730b7['body'],null))[_0xd28c('0x25')](respondWithResult(_0x315a36,null))[_0xd28c('0x45')](handleError(_0x315a36,null));};exports[_0xd28c('0x26')]=function(_0x51732d,_0x4eb2c9){return db[_0xd28c('0x42')][_0xd28c('0x47')]({'where':{'id':_0x51732d['params']['id']}})[_0xd28c('0x25')](handleEntityNotFound(_0x4eb2c9,null))[_0xd28c('0x25')](removeEntity(_0x4eb2c9,null))['catch'](handleError(_0x4eb2c9,null));};exports['getSessions']=function(_0x599678,_0x331f61,_0x3a8ca8){var _0x41b09f={'raw':!![],'where':{}};var _0x1a60fb={};var _0x213157={'count':0x0,'rows':[]};return db[_0xd28c('0x42')]['findOne']({'where':{'id':_0x599678[_0xd28c('0x46')]['id']}})['then'](handleEntityNotFound(_0x331f61,null))['then'](function(_0x3f841e){if(_0x3f841e){_0x1a60fb['model']=_[_0xd28c('0x34')](db['JscriptySessionReport'][_0xd28c('0x2f')]);_0x1a60fb['query']=_[_0xd28c('0x34')](_0x599678['query']);_0x1a60fb[_0xd28c('0x35')]=_[_0xd28c('0x36')](_0x1a60fb[_0xd28c('0x32')],_0x1a60fb[_0xd28c('0x33')]);_0x41b09f[_0xd28c('0x37')]=_[_0xd28c('0x36')](_0x1a60fb[_0xd28c('0x32')],qs[_0xd28c('0x38')](_0x599678[_0xd28c('0x33')][_0xd28c('0x38')]));_0x41b09f[_0xd28c('0x37')]=_0x41b09f[_0xd28c('0x37')][_0xd28c('0x39')]?_0x41b09f[_0xd28c('0x37')]:_0x1a60fb[_0xd28c('0x32')];if(!_0x599678[_0xd28c('0x33')][_0xd28c('0x3a')](_0xd28c('0x3b'))){_0x41b09f['limit']=qs[_0xd28c('0x1e')](_0x599678['query']['limit']);_0x41b09f[_0xd28c('0x1c')]=qs['offset'](_0x599678[_0xd28c('0x33')][_0xd28c('0x1c')]);}_0x41b09f[_0xd28c('0x57')]=qs[_0xd28c('0x3c')](_0x599678[_0xd28c('0x33')]['sort']);_0x41b09f[_0xd28c('0x3f')]=qs['filters'](_['pick'](_0x599678[_0xd28c('0x33')],_0x1a60fb[_0xd28c('0x35')]));_0x41b09f[_0xd28c('0x3f')][_0xd28c('0x58')]=_0x3f841e['id'];if(_0x599678[_0xd28c('0x33')]['filter']){_0x41b09f[_0xd28c('0x3f')]=_[_0xd28c('0x3e')](_0x41b09f[_0xd28c('0x3f')],{'$or':_[_0xd28c('0x2e')](_0x41b09f['attributes'],function(_0x1e6101){var _0x5919a2={};_0x5919a2[_0x1e6101]={'$like':'%'+_0x599678[_0xd28c('0x33')][_0xd28c('0x3d')]+'%'};return _0x5919a2;})});}_0x41b09f=_['merge']({},_0x41b09f,_0x599678[_0xd28c('0x41')]);return db['JscriptySessionReport'][_0xd28c('0x1f')]({'where':_0x41b09f[_0xd28c('0x3f')]})[_0xd28c('0x25')](function(_0x3ed39d){_0x213157['count']=_0x3ed39d;if(_0x599678['query']['includeAll']){_0x41b09f['include']=[{'all':!![]}];}return db[_0xd28c('0x59')][_0xd28c('0x5a')](_0x41b09f);})[_0xd28c('0x25')](function(_0x34d27d){_0x213157[_0xd28c('0x44')]=_0x34d27d;return _0x213157;});}})[_0xd28c('0x25')](respondWithFilteredResult(_0x331f61,_0x41b09f))['catch'](handleError(_0x331f61,null));};exports[_0xd28c('0x5b')]=function(_0x585a58,_0x3c07f8,_0x23c2b8){var _0x60fe98={'raw':!![],'where':{}};var _0x5863e5={};var _0x55052f={'count':0x0,'rows':[]};return db[_0xd28c('0x42')][_0xd28c('0x5c')]({'where':{'id':_0x585a58[_0xd28c('0x46')]['id']}})[_0xd28c('0x25')](handleEntityNotFound(_0x3c07f8,null))['then'](function(_0x2c9bd5){if(_0x2c9bd5){_0x5863e5[_0xd28c('0x32')]=_[_0xd28c('0x34')](db[_0xd28c('0x5d')][_0xd28c('0x2f')]);_0x5863e5[_0xd28c('0x33')]=_[_0xd28c('0x34')](_0x585a58['query']);_0x5863e5[_0xd28c('0x35')]=_[_0xd28c('0x36')](_0x5863e5[_0xd28c('0x32')],_0x5863e5[_0xd28c('0x33')]);_0x60fe98[_0xd28c('0x37')]=_['intersection'](_0x5863e5['model'],qs['fields'](_0x585a58[_0xd28c('0x33')][_0xd28c('0x38')]));_0x60fe98[_0xd28c('0x37')]=_0x60fe98[_0xd28c('0x37')][_0xd28c('0x39')]?_0x60fe98[_0xd28c('0x37')]:_0x5863e5['model'];if(!_0x585a58[_0xd28c('0x33')][_0xd28c('0x3a')](_0xd28c('0x3b'))){_0x60fe98[_0xd28c('0x1e')]=qs[_0xd28c('0x1e')](_0x585a58['query'][_0xd28c('0x1e')]);_0x60fe98[_0xd28c('0x1c')]=qs[_0xd28c('0x1c')](_0x585a58[_0xd28c('0x33')][_0xd28c('0x1c')]);}_0x60fe98[_0xd28c('0x57')]=qs[_0xd28c('0x3c')](_0x585a58[_0xd28c('0x33')]['sort']);_0x60fe98[_0xd28c('0x3f')]=qs[_0xd28c('0x35')](_[_0xd28c('0x5e')](_0x585a58[_0xd28c('0x33')],_0x5863e5[_0xd28c('0x35')]));_0x60fe98['where'][_0xd28c('0x58')]=_0x2c9bd5['id'];if(_0x585a58[_0xd28c('0x33')]['filter']){_0x60fe98[_0xd28c('0x3f')]=_[_0xd28c('0x3e')](_0x60fe98[_0xd28c('0x3f')],{'$or':_[_0xd28c('0x2e')](_0x60fe98[_0xd28c('0x37')],function(_0x545898){var _0x10c436={};_0x10c436[_0x545898]={'$like':'%'+_0x585a58[_0xd28c('0x33')][_0xd28c('0x3d')]+'%'};return _0x10c436;})});}_0x60fe98=_[_0xd28c('0x3e')]({},_0x60fe98,_0x585a58['options']);return db[_0xd28c('0x5d')]['count']({'where':_0x60fe98[_0xd28c('0x3f')]})[_0xd28c('0x25')](function(_0x3b019c){_0x55052f[_0xd28c('0x1f')]=_0x3b019c;if(_0x585a58[_0xd28c('0x33')][_0xd28c('0x43')]){_0x60fe98[_0xd28c('0x52')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xd28c('0x5a')](_0x60fe98);})[_0xd28c('0x25')](function(_0x14af19){_0x55052f[_0xd28c('0x44')]=_0x14af19;return _0x55052f;});}})[_0xd28c('0x25')](respondWithFilteredResult(_0x3c07f8,_0x60fe98))[_0xd28c('0x45')](handleError(_0x3c07f8,null));};function char(_0x47e9c4){return'number'===typeof _0x47e9c4?String['fromCharCode'][_0xd28c('0x21')](null,arguments):_0x47e9c4;}function needsEncapsulation(_0x2bbce6){return!!_0x2bbce6&&(_0x2bbce6[_0xd28c('0x5f')]()[_0xd28c('0x60')](char(0xd))>=0x0||_0x2bbce6['toString']()['indexOf'](char(0xa))>=0x0||_0x2bbce6['toString']()[_0xd28c('0x60')](char(0x2c))>=0x0||_0x2bbce6['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x2fb0f2){var _0x100674=char(0x22),_0x1784de='\x5c'+char(0x22),_0x464817=_0x2fb0f2[_0xd28c('0x5f')]()[_0xd28c('0x61')](new RegExp(_0x100674,'g'),_0x1784de);return _0x100674+_0x464817+_0x100674;}exports['getSummary']=function(_0x1a46c2,_0x4459ad,_0x5ce9ce){var _0x5e6492,_0x3da67b;var _0x177f5f={'where':{'ProjectId':_0x1a46c2[_0xd28c('0x46')]['id']}};if(_0x1a46c2[_0xd28c('0x33')][_0xd28c('0x62')]){_0x177f5f['where'][_0xd28c('0x63')]=JSON[_0xd28c('0x64')](_0x1a46c2[_0xd28c('0x33')][_0xd28c('0x62')]);}return db[_0xd28c('0x59')][_0xd28c('0x5a')](_0x177f5f)[_0xd28c('0x25')](handleEntityNotFound(_0x4459ad,null))[_0xd28c('0x25')](function(_0x3d3566){if(_0x3d3566){_0x5e6492=_0x3d3566;return db[_0xd28c('0x65')][_0xd28c('0x5a')]({'where':{'SessionId':{'$in':_['map'](_0x5e6492,'id')},'ProjectId':_0x1a46c2['params']['id']},'order':_0xd28c('0x66')});}})[_0xd28c('0x25')](handleEntityNotFound(_0x4459ad,null))[_0xd28c('0x25')](function(_0x42f3f2){if(_0x42f3f2){_0x3da67b=_0x42f3f2;var _0x1b6fe1={};for(var _0xed1943=0x0,_0x2d46b1=_0x3da67b[_0xd28c('0x39')];_0xed1943<_0x2d46b1;_0xed1943++){if(!_0x1b6fe1['hasOwnProperty'](_0x3da67b[_0xed1943][_0xd28c('0x67')])){_0x1b6fe1[_0x3da67b[_0xed1943][_0xd28c('0x67')]]=needsEncapsulation(_0x3da67b[_0xed1943][_0xd28c('0x68')])?encapsulate(_0x3da67b[_0xed1943][_0xd28c('0x68')]):_0x3da67b[_0xed1943][_0xd28c('0x68')];}}var _0x210020=[],_0xcb67a3={};for(var _0x39b9dc=0x0,_0x4b21d5=_0x5e6492[_0xd28c('0x39')];_0x39b9dc<_0x4b21d5;_0x39b9dc++){_0xcb67a3={'ProjectId':_0x1a46c2[_0xd28c('0x46')]['id'],'SessionId':_0x5e6492[_0x39b9dc]['id'],'StartTime':moment(_0x5e6492[_0x39b9dc][_0xd28c('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x499049=0x0,_0x27b70b=_0x3da67b[_0xd28c('0x39')];_0x499049<_0x27b70b;_0x499049++){if(_0x3da67b[_0x499049][_0xd28c('0x69')]==_0x5e6492[_0x39b9dc]['id']&&_0x1b6fe1[_0xd28c('0x3a')](_0x3da67b[_0x499049][_0xd28c('0x67')])){_0xcb67a3[_0x1b6fe1[_0x3da67b[_0x499049][_0xd28c('0x67')]]]=_0x3da67b[_0x499049][_0xd28c('0x6a')];}}for(var _0x3c4379 in _0x1b6fe1){if(!_0xcb67a3[_0xd28c('0x3a')](_0x1b6fe1[_0x3c4379])){_0xcb67a3[_0x1b6fe1[_0x3c4379]]=null;}}_0x210020[_0xd28c('0x6b')](_0xcb67a3);}return _0x210020;}})[_0xd28c('0x25')](function(_0x43d1cf){if(!_['isEmpty'](_0x43d1cf)){var _0x4bcde9=toCsv(_0x43d1cf);var _0x52ccdc=Date[_0xd28c('0x6c')]();fs[_0xd28c('0x6d')](util['format'](_0xd28c('0x6e'),_0x1a46c2[_0xd28c('0x46')]['id'],_0x52ccdc),_0x4bcde9);_0x4459ad['setHeader']('Content-disposition','attachment;\x20filename='+util[_0xd28c('0x6f')](_0xd28c('0x70'),_0x1a46c2['params']['id'],_0x52ccdc));_0x4459ad['setHeader'](_0xd28c('0x71'),_0xd28c('0x72'));return _0x4459ad[_0xd28c('0x73')](util[_0xd28c('0x6f')](_0xd28c('0x6e'),_0x1a46c2[_0xd28c('0x46')]['id'],_0x52ccdc));}else{return _0x4459ad[_0xd28c('0x74')](0xcc);}})[_0xd28c('0x45')](handleError(_0x4459ad,null));};
\ No newline at end of file
index fac4284..f03526d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09f4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects'];(function(_0x5b45da,_0x52bb87){var _0x2327f7=function(_0x35c430){while(--_0x35c430){_0x5b45da['push'](_0x5b45da['shift']());}};_0x2327f7(++_0x52bb87);}(_0x09f4,0xe4));var _0x409f=function(_0x117754,_0x571d45){_0x117754=_0x117754-0x0;var _0x65cc4b=_0x09f4[_0x117754];return _0x65cc4b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x409f('0x0'))(_0x409f('0x1'));var moment=require(_0x409f('0x2'));var BPromise=require(_0x409f('0x3'));var rp=require(_0x409f('0x4'));var fs=require('fs');var path=require(_0x409f('0x5'));var rimraf=require(_0x409f('0x6'));var config=require(_0x409f('0x7'));var attributes=require(_0x409f('0x8'));module[_0x409f('0x9')]=function(_0x2ca9ed,_0x4a17e8){return _0x2ca9ed['define'](_0x409f('0xa'),attributes,{'tableName':_0x409f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x891b=['request-promise','path','rimraf','./jscriptyProject.attributes','exports','../../config/logger','api','bluebird'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x891b,0xc5));var _0xb891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x891b[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb891('0x0'))(_0xb891('0x1'));var moment=require('moment');var BPromise=require(_0xb891('0x2'));var rp=require(_0xb891('0x3'));var fs=require('fs');var path=require(_0xb891('0x4'));var rimraf=require(_0xb891('0x5'));var config=require('../../config/environment');var attributes=require(_0xb891('0x6'));module[_0xb891('0x7')]=function(_0x542400,_0x3635be){return _0x542400['define']('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3cef5e7..440a35c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x369cf2,_0x47e28c){_0x369cf2=_0x369cf2-0x0;var _0x5c7d3e=_0xbdb7[_0x369cf2];return _0x5c7d3e;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}
\ No newline at end of file
+var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x9b163,_0x5d8c8f){var _0x824910=function(_0xe93c8){while(--_0xe93c8){_0x9b163['push'](_0x9b163['shift']());}};_0x824910(++_0x5d8c8f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}
\ No newline at end of file
index 511fda2..c9ec76e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6b1=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','post','create','put','update','destroy','exports'];(function(_0x3eaaf5,_0x12482e){var _0x2feada=function(_0x2c7c91){while(--_0x2c7c91){_0x3eaaf5['push'](_0x3eaaf5['shift']());}};_0x2feada(++_0x12482e);}(_0xf6b1,0x7e));var _0x1f6b=function(_0x37ad44,_0x49af26){_0x37ad44=_0x37ad44-0x0;var _0x14eb0c=_0xf6b1[_0x37ad44];return _0x14eb0c;};'use strict';var multer=require(_0x1f6b('0x0'));var util=require(_0x1f6b('0x1'));var path=require(_0x1f6b('0x2'));var timeout=require(_0x1f6b('0x3'));var express=require('express');var router=express[_0x1f6b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1f6b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1f6b('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x1f6b('0x7')]('/',auth['isAuthenticated'](),controller[_0x1f6b('0x8')]);router[_0x1f6b('0x7')](_0x1f6b('0x9'),auth[_0x1f6b('0xa')](),controller['describe']);router['get'](_0x1f6b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1f6b('0xc')]('/',auth[_0x1f6b('0xa')](),controller[_0x1f6b('0xd')]);router[_0x1f6b('0xe')]('/:id',auth[_0x1f6b('0xa')](),controller[_0x1f6b('0xf')]);router['delete'](_0x1f6b('0xb'),auth[_0x1f6b('0xa')](),controller[_0x1f6b('0x10')]);module[_0x1f6b('0x11')]=router;
\ No newline at end of file
+var _0xe1f9=['delete','destroy','exports','multer','util','connect-timeout','express','Router','./jscriptyQuestionReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe1f9,0x143));var _0x9e1f=function(_0x9b0599,_0x3bf23d){_0x9b0599=_0x9b0599-0x0;var _0x561925=_0xe1f9[_0x9b0599];return _0x561925;};'use strict';var multer=require(_0x9e1f('0x0'));var util=require(_0x9e1f('0x1'));var path=require('path');var timeout=require(_0x9e1f('0x2'));var express=require(_0x9e1f('0x3'));var router=express[_0x9e1f('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(_0x9e1f('0x5'));router['get']('/',auth[_0x9e1f('0x6')](),controller[_0x9e1f('0x7')]);router['get'](_0x9e1f('0x8'),auth[_0x9e1f('0x6')](),controller[_0x9e1f('0x9')]);router[_0x9e1f('0xa')](_0x9e1f('0xb'),auth[_0x9e1f('0x6')](),controller[_0x9e1f('0xc')]);router[_0x9e1f('0xd')]('/',auth[_0x9e1f('0x6')](),controller[_0x9e1f('0xe')]);router[_0x9e1f('0xf')](_0x9e1f('0xb'),auth[_0x9e1f('0x6')](),controller[_0x9e1f('0x10')]);router[_0x9e1f('0x11')](_0x9e1f('0xb'),auth[_0x9e1f('0x6')](),controller[_0x9e1f('0x12')]);module[_0x9e1f('0x13')]=router;
\ No newline at end of file
index 3ad6a4b..56505a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0x3327bd,_0x3e111f){_0x3327bd=_0x3327bd-0x0;var _0x4eb072=_0x7a54[_0x3327bd];return _0x4eb072;};'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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x57f301,_0x523fb4){_0x57f301=_0x57f301-0x0;var _0x32f6be=_0x7a54[_0x57f301];return _0x32f6be;};'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 be3cb5e..9c5bab6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ed9=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','end','sendStatus','error','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','options','includeAll','include','JscriptyQuestionReport','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x2ed9,0x1e8));var _0x92ed=function(_0x3d51e4,_0x4f9794){_0x3d51e4=_0x3d51e4-0x0;var _0x2cb84a=_0x2ed9[_0x3d51e4];return _0x2cb84a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x92ed('0x0'));var zipdir=require(_0x92ed('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92ed('0x2'));var moment=require(_0x92ed('0x3'));var BPromise=require(_0x92ed('0x4'));var Mustache=require(_0x92ed('0x5'));var util=require(_0x92ed('0x6'));var path=require(_0x92ed('0x7'));var sox=require(_0x92ed('0x8'));var csv=require(_0x92ed('0x9'));var ejs=require(_0x92ed('0xa'));var fs=require('fs');var fs_extra=require(_0x92ed('0xb'));var _=require(_0x92ed('0xc'));var squel=require(_0x92ed('0xd'));var crypto=require(_0x92ed('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x92ed('0xf'));var toCsv=require(_0x92ed('0x9'));var querystring=require(_0x92ed('0x10'));var Papa=require(_0x92ed('0x11'));var Redis=require(_0x92ed('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x92ed('0x13'));var as=require(_0x92ed('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x92ed('0x15'));var utils=require('../../config/utils');var config=require(_0x92ed('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x92ed('0x17'))['db'];function respondWithStatusCode(_0x1bd70f,_0x494a53){_0x494a53=_0x494a53||0xcc;return function(_0x36754c){if(_0x36754c){return _0x1bd70f['sendStatus'](_0x494a53);}return _0x1bd70f[_0x92ed('0x18')](_0x494a53)['end']();};}function respondWithResult(_0x4b9fb5,_0x61b03c){_0x61b03c=_0x61b03c||0xc8;return function(_0x5ecdd9){if(_0x5ecdd9){return _0x4b9fb5[_0x92ed('0x18')](_0x61b03c)[_0x92ed('0x19')](_0x5ecdd9);}};}function respondWithFilteredResult(_0x505e6b,_0x3cc637){return function(_0x34dd86){if(_0x34dd86){var _0x52cabe=typeof _0x3cc637[_0x92ed('0x1a')]===_0x92ed('0x1b')&&typeof _0x3cc637[_0x92ed('0x1c')]===_0x92ed('0x1b');var _0x26241e=_0x34dd86[_0x92ed('0x1d')];var _0x3bff90=_0x52cabe?0x0:_0x3cc637['offset'];var _0x1722e4=_0x52cabe?_0x34dd86[_0x92ed('0x1d')]:_0x3cc637[_0x92ed('0x1a')]+_0x3cc637[_0x92ed('0x1c')];var _0x3ddf15;if(_0x1722e4>=_0x26241e){_0x1722e4=_0x26241e;_0x3ddf15=0xc8;}else{_0x3ddf15=0xce;}_0x505e6b['status'](_0x3ddf15);return _0x505e6b['set'](_0x92ed('0x1e'),_0x3bff90+'-'+_0x1722e4+'/'+_0x26241e)[_0x92ed('0x19')](_0x34dd86);}return null;};}function patchUpdates(_0x33129d){return function(_0x2f2ec9){try{jsonpatch[_0x92ed('0x1f')](_0x2f2ec9,_0x33129d,!![]);}catch(_0x393628){return BPromise[_0x92ed('0x20')](_0x393628);}return _0x2f2ec9[_0x92ed('0x21')]();};}function saveUpdates(_0x56db6f,_0x59daab){return function(_0x7990be){if(_0x7990be){return _0x7990be['update'](_0x56db6f)[_0x92ed('0x22')](function(_0x27530c){return _0x27530c;});}return null;};}function removeEntity(_0x42642c,_0xb9b725){return function(_0x33cbdc){if(_0x33cbdc){return _0x33cbdc['destroy']()[_0x92ed('0x22')](function(){_0x42642c['status'](0xcc)[_0x92ed('0x23')]();});}};}function handleEntityNotFound(_0x3b55c8,_0x5b02dc){return function(_0x125f03){if(!_0x125f03){_0x3b55c8[_0x92ed('0x24')](0x194);}return _0x125f03;};}function handleError(_0x58adac,_0x349187){_0x349187=_0x349187||0x1f4;return function(_0xd099b3){logger[_0x92ed('0x25')](_0xd099b3['stack']);if(_0xd099b3[_0x92ed('0x26')]){delete _0xd099b3[_0x92ed('0x26')];}_0x58adac['status'](_0x349187)[_0x92ed('0x27')](_0xd099b3);};}exports['index']=function(_0x33f020,_0x5578cd){var _0x4af660={},_0x501e19={},_0x4109be={'count':0x0,'rows':[]};var _0x2ff5bd=_[_0x92ed('0x28')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x54c73e){return{'name':_0x54c73e[_0x92ed('0x29')],'type':_0x54c73e[_0x92ed('0x2a')][_0x92ed('0x2b')]};});_0x501e19[_0x92ed('0x2c')]=_[_0x92ed('0x28')](_0x2ff5bd,_0x92ed('0x26'));_0x501e19[_0x92ed('0x2d')]=_[_0x92ed('0x2e')](_0x33f020[_0x92ed('0x2d')]);_0x501e19[_0x92ed('0x2f')]=_[_0x92ed('0x30')](_0x501e19[_0x92ed('0x2c')],_0x501e19[_0x92ed('0x2d')]);_0x4af660[_0x92ed('0x31')]=_[_0x92ed('0x30')](_0x501e19[_0x92ed('0x2c')],qs[_0x92ed('0x32')](_0x33f020[_0x92ed('0x2d')][_0x92ed('0x32')]));_0x4af660[_0x92ed('0x31')]=_0x4af660[_0x92ed('0x31')][_0x92ed('0x33')]?_0x4af660['attributes']:_0x501e19[_0x92ed('0x2c')];if(!_0x33f020[_0x92ed('0x2d')]['hasOwnProperty']('nolimit')){_0x4af660[_0x92ed('0x1c')]=qs[_0x92ed('0x1c')](_0x33f020[_0x92ed('0x2d')]['limit']);_0x4af660[_0x92ed('0x1a')]=qs['offset'](_0x33f020[_0x92ed('0x2d')][_0x92ed('0x1a')]);}_0x4af660['order']=qs['sort'](_0x33f020[_0x92ed('0x2d')][_0x92ed('0x34')]);_0x4af660[_0x92ed('0x35')]=qs[_0x92ed('0x2f')](_[_0x92ed('0x36')](_0x33f020[_0x92ed('0x2d')],_0x501e19['filters']),_0x2ff5bd);if(_0x33f020[_0x92ed('0x2d')][_0x92ed('0x37')]){_0x4af660[_0x92ed('0x35')]=_['merge'](_0x4af660[_0x92ed('0x35')],{'$or':_['map'](_0x2ff5bd,function(_0x342dbd){if(_0x342dbd[_0x92ed('0x2a')]!=='VIRTUAL'){var _0x29981f={};_0x29981f[_0x342dbd[_0x92ed('0x26')]]={'$like':'%'+_0x33f020[_0x92ed('0x2d')][_0x92ed('0x37')]+'%'};return _0x29981f;}})});}_0x4af660=_[_0x92ed('0x38')]({},_0x4af660,_0x33f020[_0x92ed('0x39')]);var _0x103f6c={'where':_0x4af660[_0x92ed('0x35')]};return db['JscriptyQuestionReport'][_0x92ed('0x1d')](_0x103f6c)['then'](function(_0x5d7812){_0x4109be[_0x92ed('0x1d')]=_0x5d7812;if(_0x33f020[_0x92ed('0x2d')][_0x92ed('0x3a')]){_0x4af660[_0x92ed('0x3b')]=[{'all':!![]}];}return db[_0x92ed('0x3c')][_0x92ed('0x3d')](_0x4af660);})[_0x92ed('0x22')](function(_0x63b369){_0x4109be[_0x92ed('0x3e')]=_0x63b369;return _0x4109be;})[_0x92ed('0x22')](respondWithFilteredResult(_0x5578cd,_0x4af660))[_0x92ed('0x3f')](handleError(_0x5578cd,null));};exports[_0x92ed('0x40')]=function(_0x49d518,_0x1d4a6e){var _0x1fb5d9={'raw':!![],'where':{'id':_0x49d518[_0x92ed('0x41')]['id']}},_0x153375={};_0x153375[_0x92ed('0x2c')]=_[_0x92ed('0x2e')](db[_0x92ed('0x3c')][_0x92ed('0x42')]);_0x153375[_0x92ed('0x2d')]=_[_0x92ed('0x2e')](_0x49d518[_0x92ed('0x2d')]);_0x153375[_0x92ed('0x2f')]=_[_0x92ed('0x30')](_0x153375[_0x92ed('0x2c')],_0x153375['query']);_0x1fb5d9[_0x92ed('0x31')]=_[_0x92ed('0x30')](_0x153375[_0x92ed('0x2c')],qs[_0x92ed('0x32')](_0x49d518[_0x92ed('0x2d')][_0x92ed('0x32')]));_0x1fb5d9['attributes']=_0x1fb5d9['attributes'][_0x92ed('0x33')]?_0x1fb5d9['attributes']:_0x153375[_0x92ed('0x2c')];if(_0x49d518[_0x92ed('0x2d')][_0x92ed('0x3a')]){_0x1fb5d9[_0x92ed('0x3b')]=[{'all':!![]}];}_0x1fb5d9=_['merge']({},_0x1fb5d9,_0x49d518[_0x92ed('0x39')]);return db[_0x92ed('0x3c')][_0x92ed('0x43')](_0x1fb5d9)[_0x92ed('0x22')](handleEntityNotFound(_0x1d4a6e,null))[_0x92ed('0x22')](respondWithResult(_0x1d4a6e,null))[_0x92ed('0x3f')](handleError(_0x1d4a6e,null));};exports[_0x92ed('0x44')]=function(_0x289086,_0x359687){return db[_0x92ed('0x3c')]['create'](_0x289086[_0x92ed('0x45')],{})[_0x92ed('0x22')](respondWithResult(_0x359687,0xc9))[_0x92ed('0x3f')](handleError(_0x359687,null));};exports[_0x92ed('0x46')]=function(_0x2384c0,_0x1f5a94){if(_0x2384c0[_0x92ed('0x45')]['id']){delete _0x2384c0[_0x92ed('0x45')]['id'];}return db[_0x92ed('0x3c')][_0x92ed('0x43')]({'where':{'id':_0x2384c0[_0x92ed('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f5a94,null))[_0x92ed('0x22')](saveUpdates(_0x2384c0[_0x92ed('0x45')],null))['then'](respondWithResult(_0x1f5a94,null))[_0x92ed('0x3f')](handleError(_0x1f5a94,null));};exports['destroy']=function(_0x291939,_0x191203){return db[_0x92ed('0x3c')][_0x92ed('0x43')]({'where':{'id':_0x291939['params']['id']}})[_0x92ed('0x22')](handleEntityNotFound(_0x191203,null))[_0x92ed('0x22')](removeEntity(_0x191203,null))[_0x92ed('0x3f')](handleError(_0x191203,null));};exports[_0x92ed('0x47')]=function(_0x546d86,_0x4d5c4f){return db['JscriptyQuestionReport'][_0x92ed('0x47')]()['then'](respondWithResult(_0x4d5c4f,null))[_0x92ed('0x3f')](handleError(_0x4d5c4f,null));};
\ No newline at end of file
+var _0x68d6=['options','JscriptyQuestionReport','count','findAll','rows','catch','show','keys','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','offset','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','limit','order','sort','where','filter','VIRTUAL'];(function(_0x4693af,_0x22f90f){var _0x304939=function(_0x485886){while(--_0x485886){_0x4693af['push'](_0x4693af['shift']());}};_0x304939(++_0x22f90f);}(_0x68d6,0xa6));var _0x668d=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x68d6[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0x668d('0x0'));var rimraf=require(_0x668d('0x1'));var zipdir=require(_0x668d('0x2'));var jsonpatch=require(_0x668d('0x3'));var rp=require(_0x668d('0x4'));var moment=require(_0x668d('0x5'));var BPromise=require(_0x668d('0x6'));var Mustache=require(_0x668d('0x7'));var util=require(_0x668d('0x8'));var path=require(_0x668d('0x9'));var sox=require(_0x668d('0xa'));var csv=require('to-csv');var ejs=require(_0x668d('0xb'));var fs=require('fs');var fs_extra=require(_0x668d('0xc'));var _=require(_0x668d('0xd'));var squel=require(_0x668d('0xe'));var crypto=require(_0x668d('0xf'));var jsforce=require(_0x668d('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x668d('0x11'));var Papa=require(_0x668d('0x12'));var Redis=require(_0x668d('0x13'));var authService=require(_0x668d('0x14'));var qs=require(_0x668d('0x15'));var as=require(_0x668d('0x16'));var hardwareService=require(_0x668d('0x17'));var logger=require('../../config/logger')(_0x668d('0x18'));var utils=require(_0x668d('0x19'));var config=require(_0x668d('0x1a'));var licenseUtil=require(_0x668d('0x1b'));var db=require(_0x668d('0x1c'))['db'];function respondWithStatusCode(_0x476179,_0x20307f){_0x20307f=_0x20307f||0xcc;return function(_0x4cc7af){if(_0x4cc7af){return _0x476179['sendStatus'](_0x20307f);}return _0x476179[_0x668d('0x1d')](_0x20307f)['end']();};}function respondWithResult(_0x4ed2cc,_0x1ade1d){_0x1ade1d=_0x1ade1d||0xc8;return function(_0x503000){if(_0x503000){return _0x4ed2cc['status'](_0x1ade1d)[_0x668d('0x1e')](_0x503000);}};}function respondWithFilteredResult(_0x1f1a21,_0xf3322d){return function(_0x134cf9){if(_0x134cf9){var _0x48fc7e=typeof _0xf3322d['offset']===_0x668d('0x1f')&&typeof _0xf3322d['limit']===_0x668d('0x1f');var _0x4d9b79=_0x134cf9['count'];var _0x2f7da7=_0x48fc7e?0x0:_0xf3322d[_0x668d('0x20')];var _0x7d7490=_0x48fc7e?_0x134cf9['count']:_0xf3322d[_0x668d('0x20')]+_0xf3322d['limit'];var _0x3d8e05;if(_0x7d7490>=_0x4d9b79){_0x7d7490=_0x4d9b79;_0x3d8e05=0xc8;}else{_0x3d8e05=0xce;}_0x1f1a21[_0x668d('0x1d')](_0x3d8e05);return _0x1f1a21[_0x668d('0x21')](_0x668d('0x22'),_0x2f7da7+'-'+_0x7d7490+'/'+_0x4d9b79)[_0x668d('0x1e')](_0x134cf9);}return null;};}function patchUpdates(_0x51b42f){return function(_0x43c13b){try{jsonpatch[_0x668d('0x23')](_0x43c13b,_0x51b42f,!![]);}catch(_0xfd8de1){return BPromise['reject'](_0xfd8de1);}return _0x43c13b[_0x668d('0x24')]();};}function saveUpdates(_0x17801e,_0x2c7d69){return function(_0x24092b){if(_0x24092b){return _0x24092b[_0x668d('0x25')](_0x17801e)[_0x668d('0x26')](function(_0x46fb94){return _0x46fb94;});}return null;};}function removeEntity(_0x5694a6,_0xc398c6){return function(_0xd9fc9a){if(_0xd9fc9a){return _0xd9fc9a[_0x668d('0x27')]()[_0x668d('0x26')](function(){_0x5694a6[_0x668d('0x1d')](0xcc)[_0x668d('0x28')]();});}};}function handleEntityNotFound(_0x1aa882,_0x4815c0){return function(_0x1bbd8f){if(!_0x1bbd8f){_0x1aa882['sendStatus'](0x194);}return _0x1bbd8f;};}function handleError(_0x26468c,_0x33082a){_0x33082a=_0x33082a||0x1f4;return function(_0x4bce32){logger[_0x668d('0x29')](_0x4bce32[_0x668d('0x2a')]);if(_0x4bce32[_0x668d('0x2b')]){delete _0x4bce32[_0x668d('0x2b')];}_0x26468c[_0x668d('0x1d')](_0x33082a)['send'](_0x4bce32);};}exports['index']=function(_0x17837c,_0x5ac473){var _0xebdb02={},_0x3ec1e3={},_0xb809a8={'count':0x0,'rows':[]};var _0x550992=_[_0x668d('0x2c')](db['JscriptyQuestionReport'][_0x668d('0x2d')],function(_0xb21ef3){return{'name':_0xb21ef3[_0x668d('0x2e')],'type':_0xb21ef3[_0x668d('0x2f')][_0x668d('0x30')]};});_0x3ec1e3[_0x668d('0x31')]=_[_0x668d('0x2c')](_0x550992,_0x668d('0x2b'));_0x3ec1e3[_0x668d('0x32')]=_['keys'](_0x17837c['query']);_0x3ec1e3[_0x668d('0x33')]=_[_0x668d('0x34')](_0x3ec1e3['model'],_0x3ec1e3['query']);_0xebdb02[_0x668d('0x35')]=_[_0x668d('0x34')](_0x3ec1e3[_0x668d('0x31')],qs[_0x668d('0x36')](_0x17837c[_0x668d('0x32')][_0x668d('0x36')]));_0xebdb02['attributes']=_0xebdb02[_0x668d('0x35')][_0x668d('0x37')]?_0xebdb02['attributes']:_0x3ec1e3['model'];if(!_0x17837c['query']['hasOwnProperty']('nolimit')){_0xebdb02['limit']=qs[_0x668d('0x38')](_0x17837c['query'][_0x668d('0x38')]);_0xebdb02[_0x668d('0x20')]=qs[_0x668d('0x20')](_0x17837c[_0x668d('0x32')][_0x668d('0x20')]);}_0xebdb02[_0x668d('0x39')]=qs['sort'](_0x17837c[_0x668d('0x32')][_0x668d('0x3a')]);_0xebdb02[_0x668d('0x3b')]=qs[_0x668d('0x33')](_['pick'](_0x17837c[_0x668d('0x32')],_0x3ec1e3[_0x668d('0x33')]),_0x550992);if(_0x17837c['query'][_0x668d('0x3c')]){_0xebdb02['where']=_['merge'](_0xebdb02[_0x668d('0x3b')],{'$or':_['map'](_0x550992,function(_0x122fca){if(_0x122fca[_0x668d('0x2f')]!==_0x668d('0x3d')){var _0x465671={};_0x465671[_0x122fca['name']]={'$like':'%'+_0x17837c[_0x668d('0x32')][_0x668d('0x3c')]+'%'};return _0x465671;}})});}_0xebdb02=_['merge']({},_0xebdb02,_0x17837c[_0x668d('0x3e')]);var _0x5ac002={'where':_0xebdb02[_0x668d('0x3b')]};return db[_0x668d('0x3f')][_0x668d('0x40')](_0x5ac002)[_0x668d('0x26')](function(_0x243187){_0xb809a8['count']=_0x243187;if(_0x17837c[_0x668d('0x32')]['includeAll']){_0xebdb02['include']=[{'all':!![]}];}return db[_0x668d('0x3f')][_0x668d('0x41')](_0xebdb02);})[_0x668d('0x26')](function(_0x57bcac){_0xb809a8[_0x668d('0x42')]=_0x57bcac;return _0xb809a8;})['then'](respondWithFilteredResult(_0x5ac473,_0xebdb02))[_0x668d('0x43')](handleError(_0x5ac473,null));};exports[_0x668d('0x44')]=function(_0x427c42,_0x4f27a0){var _0x712293={'raw':!![],'where':{'id':_0x427c42['params']['id']}},_0x328702={};_0x328702[_0x668d('0x31')]=_[_0x668d('0x45')](db[_0x668d('0x3f')][_0x668d('0x2d')]);_0x328702['query']=_['keys'](_0x427c42[_0x668d('0x32')]);_0x328702[_0x668d('0x33')]=_[_0x668d('0x34')](_0x328702['model'],_0x328702['query']);_0x712293['attributes']=_[_0x668d('0x34')](_0x328702[_0x668d('0x31')],qs[_0x668d('0x36')](_0x427c42['query']['fields']));_0x712293[_0x668d('0x35')]=_0x712293[_0x668d('0x35')][_0x668d('0x37')]?_0x712293['attributes']:_0x328702[_0x668d('0x31')];if(_0x427c42['query']['includeAll']){_0x712293[_0x668d('0x46')]=[{'all':!![]}];}_0x712293=_['merge']({},_0x712293,_0x427c42[_0x668d('0x3e')]);return db[_0x668d('0x3f')][_0x668d('0x47')](_0x712293)[_0x668d('0x26')](handleEntityNotFound(_0x4f27a0,null))[_0x668d('0x26')](respondWithResult(_0x4f27a0,null))[_0x668d('0x43')](handleError(_0x4f27a0,null));};exports[_0x668d('0x48')]=function(_0x5316bb,_0x13e6d2){return db[_0x668d('0x3f')][_0x668d('0x48')](_0x5316bb[_0x668d('0x49')],{})[_0x668d('0x26')](respondWithResult(_0x13e6d2,0xc9))[_0x668d('0x43')](handleError(_0x13e6d2,null));};exports[_0x668d('0x25')]=function(_0x3f809c,_0x2c5e76){if(_0x3f809c[_0x668d('0x49')]['id']){delete _0x3f809c[_0x668d('0x49')]['id'];}return db[_0x668d('0x3f')][_0x668d('0x47')]({'where':{'id':_0x3f809c[_0x668d('0x4a')]['id']}})[_0x668d('0x26')](handleEntityNotFound(_0x2c5e76,null))['then'](saveUpdates(_0x3f809c[_0x668d('0x49')],null))[_0x668d('0x26')](respondWithResult(_0x2c5e76,null))[_0x668d('0x43')](handleError(_0x2c5e76,null));};exports[_0x668d('0x27')]=function(_0x28427e,_0x17ae8c){return db[_0x668d('0x3f')]['find']({'where':{'id':_0x28427e['params']['id']}})[_0x668d('0x26')](handleEntityNotFound(_0x17ae8c,null))['then'](removeEntity(_0x17ae8c,null))['catch'](handleError(_0x17ae8c,null));};exports[_0x668d('0x4b')]=function(_0x3f6ecf,_0x35fc8d){return db[_0x668d('0x3f')][_0x668d('0x4b')]()['then'](respondWithResult(_0x35fc8d,null))[_0x668d('0x43')](handleError(_0x35fc8d,null));};
\ No newline at end of file
index eb449ad..d0f55ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b5a=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x81cac7,_0x5dd0ef){var _0xcee7c8=function(_0x2602de){while(--_0x2602de){_0x81cac7['push'](_0x81cac7['shift']());}};_0xcee7c8(++_0x5dd0ef);}(_0x4b5a,0x157));var _0xa4b5=function(_0x3cc300,_0x1ddbe4){_0x3cc300=_0x3cc300-0x0;var _0x3f4053=_0x4b5a[_0x3cc300];return _0x3f4053;};'use strict';var _=require(_0xa4b5('0x0'));var util=require(_0xa4b5('0x1'));var logger=require(_0xa4b5('0x2'))(_0xa4b5('0x3'));var moment=require(_0xa4b5('0x4'));var BPromise=require(_0xa4b5('0x5'));var rp=require(_0xa4b5('0x6'));var fs=require('fs');var path=require(_0xa4b5('0x7'));var rimraf=require(_0xa4b5('0x8'));var config=require(_0xa4b5('0x9'));var attributes=require(_0xa4b5('0xa'));module[_0xa4b5('0xb')]=function(_0x400821,_0x30235d){return _0x400821[_0xa4b5('0xc')]('JscriptyQuestionReport',attributes,{'tableName':_0xa4b5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe1c9=['request-promise','path','rimraf','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','bluebird'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xe1c9,0x18e));var _0x9e1c=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0xe1c9[_0x3b96cf];return _0x2e315a;};'use strict';var _=require(_0x9e1c('0x0'));var util=require(_0x9e1c('0x1'));var logger=require('../../config/logger')(_0x9e1c('0x2'));var moment=require(_0x9e1c('0x3'));var BPromise=require(_0x9e1c('0x4'));var rp=require(_0x9e1c('0x5'));var fs=require('fs');var path=require(_0x9e1c('0x6'));var rimraf=require(_0x9e1c('0x7'));var config=require(_0x9e1c('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x9e1c('0x9')]=function(_0x39832e,_0x6f42a1){return _0x39832e[_0x9e1c('0xa')](_0x9e1c('0xb'),attributes,{'tableName':_0x9e1c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1013268..bcbf105 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa539=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','message','JscriptyQuestionReport,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x1551af,_0x5223c3){var _0xd8eb82=function(_0x4b133a){while(--_0x4b133a){_0x1551af['push'](_0x1551af['shift']());}};_0xd8eb82(++_0x5223c3);}(_0xa539,0x184));var _0x9a53=function(_0x56840f,_0x117776){_0x56840f=_0x56840f-0x0;var _0x205f6=_0xa539[_0x56840f];return _0x205f6;};'use strict';var _=require(_0x9a53('0x0'));var util=require(_0x9a53('0x1'));var moment=require(_0x9a53('0x2'));var BPromise=require(_0x9a53('0x3'));var rs=require(_0x9a53('0x4'));var fs=require('fs');var Redis=require(_0x9a53('0x5'));var db=require(_0x9a53('0x6'))['db'];var utils=require(_0x9a53('0x7'));var logger=require(_0x9a53('0x8'))(_0x9a53('0x9'));var config=require(_0x9a53('0xa'));var jayson=require(_0x9a53('0xb'));var client=jayson['client'][_0x9a53('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x303d5c,_0x4db49f,_0x3bf114){return new BPromise(function(_0x461307,_0x390b93){return client[_0x9a53('0xd')](_0x303d5c,_0x3bf114)[_0x9a53('0xe')](function(_0x2eec47){logger[_0x9a53('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4db49f,_0x9a53('0x10'));logger[_0x9a53('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x4db49f,_0x9a53('0x10'),JSON['stringify'](_0x2eec47));if(_0x2eec47[_0x9a53('0x12')]){if(_0x2eec47['error']['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4db49f,_0x2eec47[_0x9a53('0x12')][_0x9a53('0x13')]);return _0x390b93(_0x2eec47[_0x9a53('0x12')][_0x9a53('0x13')]);}logger[_0x9a53('0x12')](_0x9a53('0x14'),_0x4db49f,_0x2eec47[_0x9a53('0x12')][_0x9a53('0x13')]);return _0x461307(_0x2eec47['error'][_0x9a53('0x13')]);}else{logger[_0x9a53('0xf')](_0x9a53('0x14'),_0x4db49f,'request\x20sent');_0x461307(_0x2eec47[_0x9a53('0x15')][_0x9a53('0x13')]);}})[_0x9a53('0x16')](function(_0x15cb0e){logger['error'](_0x9a53('0x14'),_0x4db49f,_0x15cb0e);_0x390b93(_0x15cb0e);});});}
\ No newline at end of file
+var _0x56be=['http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x24d4e8,_0x50dff6){var _0x5e1fd5=function(_0x231de6){while(--_0x231de6){_0x24d4e8['push'](_0x24d4e8['shift']());}};_0x5e1fd5(++_0x50dff6);}(_0x56be,0x110));var _0xe56b=function(_0x2ae5c9,_0x1bda1c){_0x2ae5c9=_0x2ae5c9-0x0;var _0x475138=_0x56be[_0x2ae5c9];return _0x475138;};'use strict';var _=require(_0xe56b('0x0'));var util=require('util');var moment=require(_0xe56b('0x1'));var BPromise=require(_0xe56b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe56b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe56b('0x4'));var logger=require('../../config/logger')(_0xe56b('0x5'));var config=require('../../config/environment');var jayson=require(_0xe56b('0x6'));var client=jayson[_0xe56b('0x7')][_0xe56b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14e565,_0x14e8df,_0x59b3f7){return new BPromise(function(_0x10d55c,_0x5287a2){return client[_0xe56b('0x9')](_0x14e565,_0x59b3f7)[_0xe56b('0xa')](function(_0x314753){logger[_0xe56b('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x14e8df,'request\x20sent');logger['debug'](_0xe56b('0xc'),_0x14e8df,_0xe56b('0xd'),JSON[_0xe56b('0xe')](_0x314753));if(_0x314753[_0xe56b('0xf')]){if(_0x314753[_0xe56b('0xf')]['code']===0x1f4){logger['error'](_0xe56b('0x10'),_0x14e8df,_0x314753['error'][_0xe56b('0x11')]);return _0x5287a2(_0x314753[_0xe56b('0xf')][_0xe56b('0x11')]);}logger[_0xe56b('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x14e8df,_0x314753[_0xe56b('0xf')]['message']);return _0x10d55c(_0x314753[_0xe56b('0xf')][_0xe56b('0x11')]);}else{logger['info'](_0xe56b('0x10'),_0x14e8df,_0xe56b('0xd'));_0x10d55c(_0x314753[_0xe56b('0x12')][_0xe56b('0x11')]);}})[_0xe56b('0x13')](function(_0x361032){logger[_0xe56b('0xf')](_0xe56b('0x10'),_0x14e8df,_0x361032);_0x5287a2(_0x361032);});});}
\ No newline at end of file
index d36840d..f298d09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14ec=['create','put','/:id','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','getQuestions'];(function(_0xc96daa,_0x278e6b){var _0x5eeae5=function(_0x264d11){while(--_0x264d11){_0xc96daa['push'](_0xc96daa['shift']());}};_0x5eeae5(++_0x278e6b);}(_0x14ec,0x15c));var _0xc14e=function(_0xf60a59,_0x210627){_0xf60a59=_0xf60a59-0x0;var _0x216a3e=_0x14ec[_0xf60a59];return _0x216a3e;};'use strict';var multer=require(_0xc14e('0x0'));var util=require('util');var path=require(_0xc14e('0x1'));var timeout=require(_0xc14e('0x2'));var express=require('express');var router=express[_0xc14e('0x3')]();var fs_extra=require(_0xc14e('0x4'));var auth=require(_0xc14e('0x5'));var interaction=require(_0xc14e('0x6'));var config=require(_0xc14e('0x7'));var controller=require(_0xc14e('0x8'));router[_0xc14e('0x9')]('/',auth[_0xc14e('0xa')](),controller[_0xc14e('0xb')]);router[_0xc14e('0x9')]('/describe',auth[_0xc14e('0xa')](),controller['describe']);router[_0xc14e('0x9')]('/:id',auth[_0xc14e('0xa')](),controller['show']);router[_0xc14e('0x9')]('/:id/questions',auth[_0xc14e('0xa')](),controller[_0xc14e('0xc')]);router['post']('/',auth[_0xc14e('0xa')](),controller[_0xc14e('0xd')]);router[_0xc14e('0xe')](_0xc14e('0xf'),auth['isAuthenticated'](),controller[_0xc14e('0x10')]);router['delete'](_0xc14e('0xf'),auth['isAuthenticated'](),controller[_0xc14e('0x11')]);module[_0xc14e('0x12')]=router;
\ No newline at end of file
+var _0x446d=['/:id','/:id/questions','getQuestions','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe'];(function(_0x4e33dc,_0x9da02d){var _0x282f62=function(_0x530a1f){while(--_0x530a1f){_0x4e33dc['push'](_0x4e33dc['shift']());}};_0x282f62(++_0x9da02d);}(_0x446d,0x121));var _0xd446=function(_0x1801e6,_0x3814c2){_0x1801e6=_0x1801e6-0x0;var _0x465eaa=_0x446d[_0x1801e6];return _0x465eaa;};'use strict';var multer=require(_0xd446('0x0'));var util=require(_0xd446('0x1'));var path=require('path');var timeout=require(_0xd446('0x2'));var express=require(_0xd446('0x3'));var router=express[_0xd446('0x4')]();var fs_extra=require(_0xd446('0x5'));var auth=require(_0xd446('0x6'));var interaction=require(_0xd446('0x7'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0xd446('0x8')]('/',auth[_0xd446('0x9')](),controller['index']);router['get'](_0xd446('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xd446('0xb'),auth[_0xd446('0x9')](),controller['show']);router[_0xd446('0x8')](_0xd446('0xc'),auth[_0xd446('0x9')](),controller[_0xd446('0xd')]);router[_0xd446('0xe')]('/',auth[_0xd446('0x9')](),controller[_0xd446('0xf')]);router[_0xd446('0x10')](_0xd446('0xb'),auth[_0xd446('0x9')](),controller['update']);router[_0xd446('0x11')](_0xd446('0xb'),auth[_0xd446('0x9')](),controller[_0xd446('0x12')]);module[_0xd446('0x13')]=router;
\ No newline at end of file
index 0104379..c468ba8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeaa0=['starttime','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x40dd0c,_0x58d0a7){var _0x3beb2f=function(_0x2a14a9){while(--_0x2a14a9){_0x40dd0c['push'](_0x40dd0c['shift']());}};_0x3beb2f(++_0x58d0a7);}(_0xeaa0,0x16e));var _0x0eaa=function(_0x28ee9c,_0x1ae563){_0x28ee9c=_0x28ee9c-0x0;var _0x36f796=_0xeaa0[_0x28ee9c];return _0x36f796;};'use strict';var moment=require(_0x0eaa('0x0'));var Sequelize=require(_0x0eaa('0x1'));module[_0x0eaa('0x2')]={'starttime':{'type':Sequelize[_0x0eaa('0x3')],'set':function(_0x1f1ce0){this['setDataValue'](_0x0eaa('0x4'),_0x1f1ce0);this[_0x0eaa('0x5')]('endtime',moment()[_0x0eaa('0x6')](_0x0eaa('0x7')));}},'endtime':{'type':Sequelize[_0x0eaa('0x3')]},'membername':{'type':Sequelize[_0x0eaa('0x8')]},'projectname':{'type':Sequelize[_0x0eaa('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0eaa('0x8')]},'calleridname':{'type':Sequelize[_0x0eaa('0x8')]},'calleridnum':{'type':Sequelize[_0x0eaa('0x8')]},'completed':{'type':Sequelize[_0x0eaa('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa6db=['exports','DATE','starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment'];(function(_0x6f5598,_0xabeb74){var _0x1e1325=function(_0x1da246){while(--_0x1da246){_0x6f5598['push'](_0x6f5598['shift']());}};_0x1e1325(++_0xabeb74);}(_0xa6db,0x135));var _0xba6d=function(_0x3fb041,_0x559f76){_0x3fb041=_0x3fb041-0x0;var _0x17b10e=_0xa6db[_0x3fb041];return _0x17b10e;};'use strict';var moment=require(_0xba6d('0x0'));var Sequelize=require('sequelize');module[_0xba6d('0x1')]={'starttime':{'type':Sequelize[_0xba6d('0x2')],'set':function(_0x3cae27){this['setDataValue'](_0xba6d('0x3'),_0x3cae27);this[_0xba6d('0x4')](_0xba6d('0x5'),moment()[_0xba6d('0x6')](_0xba6d('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xba6d('0x8')]},'projectname':{'type':Sequelize[_0xba6d('0x8')]},'queue':{'type':Sequelize[_0xba6d('0x8')]},'uniqueid':{'type':Sequelize[_0xba6d('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xba6d('0x9')],'defaultValue':![]}};
\ No newline at end of file
index ed25bfd..2c858e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7875=['crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','then','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','sort','pick','filter','merge','where','VIRTUAL','options','include','catch','show','keys','includeAll','find','create','body','update','params','describe','findOne','hasOwnProperty','nolimit','order','SessionId','JscriptyQuestionReport','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0x7875,0x183));var _0x5787=function(_0x111692,_0x19f8a9){_0x111692=_0x111692-0x0;var _0x11836f=_0x7875[_0x111692];return _0x11836f;};'use strict';var emlformat=require(_0x5787('0x0'));var rimraf=require(_0x5787('0x1'));var zipdir=require(_0x5787('0x2'));var jsonpatch=require(_0x5787('0x3'));var rp=require('request-promise');var moment=require(_0x5787('0x4'));var BPromise=require(_0x5787('0x5'));var Mustache=require(_0x5787('0x6'));var util=require(_0x5787('0x7'));var path=require('path');var sox=require(_0x5787('0x8'));var csv=require('to-csv');var ejs=require(_0x5787('0x9'));var fs=require('fs');var fs_extra=require(_0x5787('0xa'));var _=require(_0x5787('0xb'));var squel=require(_0x5787('0xc'));var crypto=require(_0x5787('0xd'));var jsforce=require(_0x5787('0xe'));var deskjs=require(_0x5787('0xf'));var toCsv=require(_0x5787('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5787('0x11'));var authService=require(_0x5787('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5787('0x13'));var hardwareService=require(_0x5787('0x14'));var logger=require('../../config/logger')(_0x5787('0x15'));var utils=require(_0x5787('0x16'));var config=require(_0x5787('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5787('0x18'))['db'];function respondWithStatusCode(_0x57ed41,_0x14086f){_0x14086f=_0x14086f||0xcc;return function(_0x519fb9){if(_0x519fb9){return _0x57ed41['sendStatus'](_0x14086f);}return _0x57ed41[_0x5787('0x19')](_0x14086f)[_0x5787('0x1a')]();};}function respondWithResult(_0x14371f,_0x52d623){_0x52d623=_0x52d623||0xc8;return function(_0x525667){if(_0x525667){return _0x14371f['status'](_0x52d623)['json'](_0x525667);}};}function respondWithFilteredResult(_0x1c0503,_0x14c7d9){return function(_0x46a043){if(_0x46a043){var _0x56e742=typeof _0x14c7d9[_0x5787('0x1b')]===_0x5787('0x1c')&&typeof _0x14c7d9['limit']===_0x5787('0x1c');var _0x415ae9=_0x46a043[_0x5787('0x1d')];var _0x19a893=_0x56e742?0x0:_0x14c7d9[_0x5787('0x1b')];var _0xd4ca70=_0x56e742?_0x46a043[_0x5787('0x1d')]:_0x14c7d9[_0x5787('0x1b')]+_0x14c7d9[_0x5787('0x1e')];var _0x58cd20;if(_0xd4ca70>=_0x415ae9){_0xd4ca70=_0x415ae9;_0x58cd20=0xc8;}else{_0x58cd20=0xce;}_0x1c0503[_0x5787('0x19')](_0x58cd20);return _0x1c0503[_0x5787('0x1f')](_0x5787('0x20'),_0x19a893+'-'+_0xd4ca70+'/'+_0x415ae9)['json'](_0x46a043);}return null;};}function patchUpdates(_0x5da47f){return function(_0x22fc3c){try{jsonpatch['apply'](_0x22fc3c,_0x5da47f,!![]);}catch(_0x312871){return BPromise[_0x5787('0x21')](_0x312871);}return _0x22fc3c[_0x5787('0x22')]();};}function saveUpdates(_0x8ac046,_0x2e8d4){return function(_0x5a907c){if(_0x5a907c){return _0x5a907c['update'](_0x8ac046)[_0x5787('0x23')](function(_0x38b590){return _0x38b590;});}return null;};}function removeEntity(_0x49e76a,_0x129591){return function(_0x1cc4f5){if(_0x1cc4f5){return _0x1cc4f5['destroy']()[_0x5787('0x23')](function(){_0x49e76a[_0x5787('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x275180,_0x268e36){return function(_0x4c6f87){if(!_0x4c6f87){_0x275180[_0x5787('0x24')](0x194);}return _0x4c6f87;};}function handleError(_0x49271f,_0x557ee7){_0x557ee7=_0x557ee7||0x1f4;return function(_0xdbfe64){logger[_0x5787('0x25')](_0xdbfe64[_0x5787('0x26')]);if(_0xdbfe64['name']){delete _0xdbfe64[_0x5787('0x27')];}_0x49271f[_0x5787('0x19')](_0x557ee7)[_0x5787('0x28')](_0xdbfe64);};}exports[_0x5787('0x29')]=function(_0x3393a0,_0x1d7e2e){var _0x4187c4={},_0x11dab5={},_0x9f29ec={'count':0x0,'rows':[]};var _0x5d0834=_[_0x5787('0x2a')](db[_0x5787('0x2b')][_0x5787('0x2c')],function(_0x460d40){return{'name':_0x460d40['fieldName'],'type':_0x460d40[_0x5787('0x2d')][_0x5787('0x2e')]};});_0x11dab5[_0x5787('0x2f')]=_[_0x5787('0x2a')](_0x5d0834,_0x5787('0x27'));_0x11dab5[_0x5787('0x30')]=_['keys'](_0x3393a0['query']);_0x11dab5[_0x5787('0x31')]=_[_0x5787('0x32')](_0x11dab5['model'],_0x11dab5[_0x5787('0x30')]);_0x4187c4[_0x5787('0x33')]=_[_0x5787('0x32')](_0x11dab5[_0x5787('0x2f')],qs['fields'](_0x3393a0[_0x5787('0x30')][_0x5787('0x34')]));_0x4187c4[_0x5787('0x33')]=_0x4187c4[_0x5787('0x33')][_0x5787('0x35')]?_0x4187c4['attributes']:_0x11dab5[_0x5787('0x2f')];if(!_0x3393a0['query']['hasOwnProperty']('nolimit')){_0x4187c4[_0x5787('0x1e')]=qs[_0x5787('0x1e')](_0x3393a0[_0x5787('0x30')][_0x5787('0x1e')]);_0x4187c4[_0x5787('0x1b')]=qs[_0x5787('0x1b')](_0x3393a0[_0x5787('0x30')][_0x5787('0x1b')]);}_0x4187c4['order']=qs[_0x5787('0x36')](_0x3393a0[_0x5787('0x30')][_0x5787('0x36')]);_0x4187c4['where']=qs[_0x5787('0x31')](_[_0x5787('0x37')](_0x3393a0[_0x5787('0x30')],_0x11dab5['filters']),_0x5d0834);if(_0x3393a0[_0x5787('0x30')][_0x5787('0x38')]){_0x4187c4['where']=_[_0x5787('0x39')](_0x4187c4[_0x5787('0x3a')],{'$or':_[_0x5787('0x2a')](_0x5d0834,function(_0x329745){if(_0x329745[_0x5787('0x2d')]!==_0x5787('0x3b')){var _0x39c23e={};_0x39c23e[_0x329745[_0x5787('0x27')]]={'$like':'%'+_0x3393a0[_0x5787('0x30')][_0x5787('0x38')]+'%'};return _0x39c23e;}})});}_0x4187c4=_[_0x5787('0x39')]({},_0x4187c4,_0x3393a0[_0x5787('0x3c')]);var _0x3000b7={'where':_0x4187c4[_0x5787('0x3a')]};return db[_0x5787('0x2b')]['count'](_0x3000b7)[_0x5787('0x23')](function(_0x3ec0fb){_0x9f29ec[_0x5787('0x1d')]=_0x3ec0fb;if(_0x3393a0[_0x5787('0x30')]['includeAll']){_0x4187c4[_0x5787('0x3d')]=[{'all':!![]}];}return db[_0x5787('0x2b')]['findAll'](_0x4187c4);})[_0x5787('0x23')](function(_0x4f109c){_0x9f29ec['rows']=_0x4f109c;return _0x9f29ec;})[_0x5787('0x23')](respondWithFilteredResult(_0x1d7e2e,_0x4187c4))[_0x5787('0x3e')](handleError(_0x1d7e2e,null));};exports[_0x5787('0x3f')]=function(_0x4219ce,_0x3636b2){var _0x6cdc82={'raw':!![],'where':{'id':_0x4219ce['params']['id']}},_0x5268b2={};_0x5268b2[_0x5787('0x2f')]=_['keys'](db[_0x5787('0x2b')][_0x5787('0x2c')]);_0x5268b2['query']=_[_0x5787('0x40')](_0x4219ce[_0x5787('0x30')]);_0x5268b2[_0x5787('0x31')]=_[_0x5787('0x32')](_0x5268b2['model'],_0x5268b2[_0x5787('0x30')]);_0x6cdc82[_0x5787('0x33')]=_[_0x5787('0x32')](_0x5268b2[_0x5787('0x2f')],qs[_0x5787('0x34')](_0x4219ce[_0x5787('0x30')]['fields']));_0x6cdc82['attributes']=_0x6cdc82[_0x5787('0x33')][_0x5787('0x35')]?_0x6cdc82['attributes']:_0x5268b2['model'];if(_0x4219ce['query'][_0x5787('0x41')]){_0x6cdc82[_0x5787('0x3d')]=[{'all':!![]}];}_0x6cdc82=_['merge']({},_0x6cdc82,_0x4219ce['options']);return db[_0x5787('0x2b')][_0x5787('0x42')](_0x6cdc82)[_0x5787('0x23')](handleEntityNotFound(_0x3636b2,null))['then'](respondWithResult(_0x3636b2,null))[_0x5787('0x3e')](handleError(_0x3636b2,null));};exports[_0x5787('0x43')]=function(_0x203347,_0x599476){return db[_0x5787('0x2b')][_0x5787('0x43')](_0x203347[_0x5787('0x44')],{})['then'](respondWithResult(_0x599476,0xc9))[_0x5787('0x3e')](handleError(_0x599476,null));};exports[_0x5787('0x45')]=function(_0x12340b,_0xe3a0de){if(_0x12340b[_0x5787('0x44')]['id']){delete _0x12340b['body']['id'];}return db['JscriptySessionReport'][_0x5787('0x42')]({'where':{'id':_0x12340b['params']['id']}})[_0x5787('0x23')](handleEntityNotFound(_0xe3a0de,null))['then'](saveUpdates(_0x12340b[_0x5787('0x44')],null))[_0x5787('0x23')](respondWithResult(_0xe3a0de,null))['catch'](handleError(_0xe3a0de,null));};exports['destroy']=function(_0x64f8cb,_0x1c1dc5){return db[_0x5787('0x2b')]['find']({'where':{'id':_0x64f8cb[_0x5787('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c1dc5,null))[_0x5787('0x23')](removeEntity(_0x1c1dc5,null))[_0x5787('0x3e')](handleError(_0x1c1dc5,null));};exports[_0x5787('0x47')]=function(_0x803214,_0x36519c){return db[_0x5787('0x2b')]['describe']()['then'](respondWithResult(_0x36519c,null))[_0x5787('0x3e')](handleError(_0x36519c,null));};exports['getQuestions']=function(_0x581b7f,_0x3ba952,_0x2db954){var _0x12e054={'raw':!![],'where':{}};var _0x2d623a={};var _0x4e28dc={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x5787('0x48')]({'where':{'id':_0x581b7f[_0x5787('0x46')]['id']}})[_0x5787('0x23')](handleEntityNotFound(_0x3ba952,null))[_0x5787('0x23')](function(_0x29cd6a){if(_0x29cd6a){_0x2d623a['model']=_[_0x5787('0x40')](db['JscriptyQuestionReport'][_0x5787('0x2c')]);_0x2d623a[_0x5787('0x30')]=_['keys'](_0x581b7f[_0x5787('0x30')]);_0x2d623a[_0x5787('0x31')]=_['intersection'](_0x2d623a[_0x5787('0x2f')],_0x2d623a[_0x5787('0x30')]);_0x12e054['attributes']=_[_0x5787('0x32')](_0x2d623a['model'],qs[_0x5787('0x34')](_0x581b7f['query']['fields']));_0x12e054[_0x5787('0x33')]=_0x12e054[_0x5787('0x33')][_0x5787('0x35')]?_0x12e054[_0x5787('0x33')]:_0x2d623a[_0x5787('0x2f')];if(!_0x581b7f[_0x5787('0x30')][_0x5787('0x49')](_0x5787('0x4a'))){_0x12e054['limit']=qs[_0x5787('0x1e')](_0x581b7f[_0x5787('0x30')][_0x5787('0x1e')]);_0x12e054[_0x5787('0x1b')]=qs[_0x5787('0x1b')](_0x581b7f[_0x5787('0x30')]['offset']);}_0x12e054[_0x5787('0x4b')]=qs[_0x5787('0x36')](_0x581b7f[_0x5787('0x30')][_0x5787('0x36')]);_0x12e054[_0x5787('0x3a')]=qs[_0x5787('0x31')](_[_0x5787('0x37')](_0x581b7f[_0x5787('0x30')],_0x2d623a['filters']));_0x12e054[_0x5787('0x3a')][_0x5787('0x4c')]=_0x29cd6a['id'];if(_0x581b7f[_0x5787('0x30')]['filter']){_0x12e054['where']=_[_0x5787('0x39')](_0x12e054[_0x5787('0x3a')],{'$or':_[_0x5787('0x2a')](_0x12e054[_0x5787('0x33')],function(_0x4c8be6){var _0x206381={};_0x206381[_0x4c8be6]={'$like':'%'+_0x581b7f['query']['filter']+'%'};return _0x206381;})});}_0x12e054=_['merge']({},_0x12e054,_0x581b7f[_0x5787('0x3c')]);return db[_0x5787('0x4d')]['count']({'where':_0x12e054[_0x5787('0x3a')]})[_0x5787('0x23')](function(_0x257ee4){_0x4e28dc[_0x5787('0x1d')]=_0x257ee4;if(_0x581b7f[_0x5787('0x30')][_0x5787('0x41')]){_0x12e054[_0x5787('0x3d')]=[{'all':!![]}];}return db[_0x5787('0x4d')][_0x5787('0x4e')](_0x12e054);})[_0x5787('0x23')](function(_0x5c8526){_0x4e28dc[_0x5787('0x4f')]=_0x5c8526;return _0x4e28dc;});}})[_0x5787('0x23')](respondWithFilteredResult(_0x3ba952,_0x12e054))[_0x5787('0x3e')](handleError(_0x3ba952,null));};
\ No newline at end of file
+var _0x34f0=['options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','pick','eml-format','rimraf','zip-dir','moment','bluebird','util','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/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','merge'];(function(_0x3e7b71,_0x3ea9ee){var _0x16dfd0=function(_0x346357){while(--_0x346357){_0x3e7b71['push'](_0x3e7b71['shift']());}};_0x16dfd0(++_0x3ea9ee);}(_0x34f0,0x152));var _0x034f=function(_0x34075e,_0x337d70){_0x34075e=_0x34075e-0x0;var _0x1f079b=_0x34f0[_0x34075e];return _0x1f079b;};'use strict';var emlformat=require(_0x034f('0x0'));var rimraf=require(_0x034f('0x1'));var zipdir=require(_0x034f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x034f('0x3'));var BPromise=require(_0x034f('0x4'));var Mustache=require('mustache');var util=require(_0x034f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x034f('0x6'));var ejs=require(_0x034f('0x7'));var fs=require('fs');var fs_extra=require(_0x034f('0x8'));var _=require(_0x034f('0x9'));var squel=require(_0x034f('0xa'));var crypto=require(_0x034f('0xb'));var jsforce=require(_0x034f('0xc'));var deskjs=require(_0x034f('0xd'));var toCsv=require(_0x034f('0x6'));var querystring=require(_0x034f('0xe'));var Papa=require('papaparse');var Redis=require(_0x034f('0xf'));var authService=require(_0x034f('0x10'));var qs=require(_0x034f('0x11'));var as=require(_0x034f('0x12'));var hardwareService=require(_0x034f('0x13'));var logger=require(_0x034f('0x14'))(_0x034f('0x15'));var utils=require(_0x034f('0x16'));var config=require(_0x034f('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ca68e,_0x3c4aa0){_0x3c4aa0=_0x3c4aa0||0xcc;return function(_0x241bf5){if(_0x241bf5){return _0x5ca68e[_0x034f('0x18')](_0x3c4aa0);}return _0x5ca68e[_0x034f('0x19')](_0x3c4aa0)[_0x034f('0x1a')]();};}function respondWithResult(_0x2e68ab,_0x5a004e){_0x5a004e=_0x5a004e||0xc8;return function(_0x227d4f){if(_0x227d4f){return _0x2e68ab['status'](_0x5a004e)[_0x034f('0x1b')](_0x227d4f);}};}function respondWithFilteredResult(_0x29cca2,_0x19f3c2){return function(_0x21c03c){if(_0x21c03c){var _0x28a51e=typeof _0x19f3c2[_0x034f('0x1c')]===_0x034f('0x1d')&&typeof _0x19f3c2[_0x034f('0x1e')]===_0x034f('0x1d');var _0x1131ff=_0x21c03c['count'];var _0x34c817=_0x28a51e?0x0:_0x19f3c2[_0x034f('0x1c')];var _0x56d83a=_0x28a51e?_0x21c03c['count']:_0x19f3c2[_0x034f('0x1c')]+_0x19f3c2[_0x034f('0x1e')];var _0x55ebad;if(_0x56d83a>=_0x1131ff){_0x56d83a=_0x1131ff;_0x55ebad=0xc8;}else{_0x55ebad=0xce;}_0x29cca2['status'](_0x55ebad);return _0x29cca2[_0x034f('0x1f')]('Content-Range',_0x34c817+'-'+_0x56d83a+'/'+_0x1131ff)[_0x034f('0x1b')](_0x21c03c);}return null;};}function patchUpdates(_0x59d148){return function(_0x327852){try{jsonpatch[_0x034f('0x20')](_0x327852,_0x59d148,!![]);}catch(_0x1a666d){return BPromise[_0x034f('0x21')](_0x1a666d);}return _0x327852[_0x034f('0x22')]();};}function saveUpdates(_0xc609c8,_0x5743e0){return function(_0x221602){if(_0x221602){return _0x221602[_0x034f('0x23')](_0xc609c8)[_0x034f('0x24')](function(_0xf1467b){return _0xf1467b;});}return null;};}function removeEntity(_0x3b147c,_0x30ea4b){return function(_0x345363){if(_0x345363){return _0x345363[_0x034f('0x25')]()[_0x034f('0x24')](function(){_0x3b147c[_0x034f('0x19')](0xcc)[_0x034f('0x1a')]();});}};}function handleEntityNotFound(_0x239479,_0x2aefe7){return function(_0x528927){if(!_0x528927){_0x239479[_0x034f('0x18')](0x194);}return _0x528927;};}function handleError(_0x27e6b6,_0x26b8f5){_0x26b8f5=_0x26b8f5||0x1f4;return function(_0x43c3d2){logger[_0x034f('0x26')](_0x43c3d2[_0x034f('0x27')]);if(_0x43c3d2[_0x034f('0x28')]){delete _0x43c3d2[_0x034f('0x28')];}_0x27e6b6[_0x034f('0x19')](_0x26b8f5)[_0x034f('0x29')](_0x43c3d2);};}exports[_0x034f('0x2a')]=function(_0x122b00,_0x25867c){var _0x1ab61c={},_0x548ffd={},_0x215cce={'count':0x0,'rows':[]};var _0x30dd68=_[_0x034f('0x2b')](db[_0x034f('0x2c')][_0x034f('0x2d')],function(_0x5adbf3){return{'name':_0x5adbf3[_0x034f('0x2e')],'type':_0x5adbf3[_0x034f('0x2f')][_0x034f('0x30')]};});_0x548ffd[_0x034f('0x31')]=_[_0x034f('0x2b')](_0x30dd68,_0x034f('0x28'));_0x548ffd[_0x034f('0x32')]=_[_0x034f('0x33')](_0x122b00[_0x034f('0x32')]);_0x548ffd['filters']=_[_0x034f('0x34')](_0x548ffd[_0x034f('0x31')],_0x548ffd[_0x034f('0x32')]);_0x1ab61c[_0x034f('0x35')]=_[_0x034f('0x34')](_0x548ffd[_0x034f('0x31')],qs[_0x034f('0x36')](_0x122b00['query'][_0x034f('0x36')]));_0x1ab61c[_0x034f('0x35')]=_0x1ab61c['attributes'][_0x034f('0x37')]?_0x1ab61c['attributes']:_0x548ffd[_0x034f('0x31')];if(!_0x122b00[_0x034f('0x32')][_0x034f('0x38')]('nolimit')){_0x1ab61c[_0x034f('0x1e')]=qs[_0x034f('0x1e')](_0x122b00['query'][_0x034f('0x1e')]);_0x1ab61c[_0x034f('0x1c')]=qs[_0x034f('0x1c')](_0x122b00['query'][_0x034f('0x1c')]);}_0x1ab61c[_0x034f('0x39')]=qs[_0x034f('0x3a')](_0x122b00['query'][_0x034f('0x3a')]);_0x1ab61c[_0x034f('0x3b')]=qs[_0x034f('0x3c')](_['pick'](_0x122b00[_0x034f('0x32')],_0x548ffd[_0x034f('0x3c')]),_0x30dd68);if(_0x122b00[_0x034f('0x32')][_0x034f('0x3d')]){_0x1ab61c[_0x034f('0x3b')]=_['merge'](_0x1ab61c['where'],{'$or':_[_0x034f('0x2b')](_0x30dd68,function(_0x986f90){if(_0x986f90[_0x034f('0x2f')]!==_0x034f('0x3e')){var _0x1a72ae={};_0x1a72ae[_0x986f90[_0x034f('0x28')]]={'$like':'%'+_0x122b00[_0x034f('0x32')][_0x034f('0x3d')]+'%'};return _0x1a72ae;}})});}_0x1ab61c=_['merge']({},_0x1ab61c,_0x122b00['options']);var _0x5918aa={'where':_0x1ab61c['where']};return db['JscriptySessionReport'][_0x034f('0x3f')](_0x5918aa)[_0x034f('0x24')](function(_0xac7d2d){_0x215cce['count']=_0xac7d2d;if(_0x122b00['query'][_0x034f('0x40')]){_0x1ab61c[_0x034f('0x41')]=[{'all':!![]}];}return db[_0x034f('0x2c')][_0x034f('0x42')](_0x1ab61c);})[_0x034f('0x24')](function(_0x57733b){_0x215cce[_0x034f('0x43')]=_0x57733b;return _0x215cce;})[_0x034f('0x24')](respondWithFilteredResult(_0x25867c,_0x1ab61c))[_0x034f('0x44')](handleError(_0x25867c,null));};exports[_0x034f('0x45')]=function(_0x284b91,_0x1f6009){var _0x4d2eb0={'raw':!![],'where':{'id':_0x284b91[_0x034f('0x46')]['id']}},_0x3421e8={};_0x3421e8[_0x034f('0x31')]=_['keys'](db[_0x034f('0x2c')][_0x034f('0x2d')]);_0x3421e8[_0x034f('0x32')]=_[_0x034f('0x33')](_0x284b91[_0x034f('0x32')]);_0x3421e8['filters']=_[_0x034f('0x34')](_0x3421e8[_0x034f('0x31')],_0x3421e8[_0x034f('0x32')]);_0x4d2eb0[_0x034f('0x35')]=_[_0x034f('0x34')](_0x3421e8[_0x034f('0x31')],qs['fields'](_0x284b91['query'][_0x034f('0x36')]));_0x4d2eb0[_0x034f('0x35')]=_0x4d2eb0[_0x034f('0x35')]['length']?_0x4d2eb0[_0x034f('0x35')]:_0x3421e8[_0x034f('0x31')];if(_0x284b91[_0x034f('0x32')][_0x034f('0x40')]){_0x4d2eb0[_0x034f('0x41')]=[{'all':!![]}];}_0x4d2eb0=_[_0x034f('0x47')]({},_0x4d2eb0,_0x284b91[_0x034f('0x48')]);return db[_0x034f('0x2c')][_0x034f('0x49')](_0x4d2eb0)['then'](handleEntityNotFound(_0x1f6009,null))[_0x034f('0x24')](respondWithResult(_0x1f6009,null))[_0x034f('0x44')](handleError(_0x1f6009,null));};exports['create']=function(_0x11dfb9,_0x189965){return db[_0x034f('0x2c')][_0x034f('0x4a')](_0x11dfb9['body'],{})[_0x034f('0x24')](respondWithResult(_0x189965,0xc9))[_0x034f('0x44')](handleError(_0x189965,null));};exports[_0x034f('0x23')]=function(_0x302a70,_0x1ecbeb){if(_0x302a70[_0x034f('0x4b')]['id']){delete _0x302a70[_0x034f('0x4b')]['id'];}return db[_0x034f('0x2c')][_0x034f('0x49')]({'where':{'id':_0x302a70[_0x034f('0x46')]['id']}})[_0x034f('0x24')](handleEntityNotFound(_0x1ecbeb,null))[_0x034f('0x24')](saveUpdates(_0x302a70['body'],null))['then'](respondWithResult(_0x1ecbeb,null))['catch'](handleError(_0x1ecbeb,null));};exports[_0x034f('0x25')]=function(_0x323f88,_0x11e2c4){return db['JscriptySessionReport'][_0x034f('0x49')]({'where':{'id':_0x323f88[_0x034f('0x46')]['id']}})['then'](handleEntityNotFound(_0x11e2c4,null))[_0x034f('0x24')](removeEntity(_0x11e2c4,null))['catch'](handleError(_0x11e2c4,null));};exports[_0x034f('0x4c')]=function(_0x2a45dd,_0x2a9ee0){return db[_0x034f('0x2c')]['describe']()[_0x034f('0x24')](respondWithResult(_0x2a9ee0,null))[_0x034f('0x44')](handleError(_0x2a9ee0,null));};exports[_0x034f('0x4d')]=function(_0x596a4e,_0xc8f12f,_0x4becdf){var _0x322554={'raw':!![],'where':{}};var _0x5e121c={};var _0xa79270={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x034f('0x4e')]({'where':{'id':_0x596a4e[_0x034f('0x46')]['id']}})[_0x034f('0x24')](handleEntityNotFound(_0xc8f12f,null))[_0x034f('0x24')](function(_0x481a2a){if(_0x481a2a){_0x5e121c[_0x034f('0x31')]=_[_0x034f('0x33')](db[_0x034f('0x4f')][_0x034f('0x2d')]);_0x5e121c[_0x034f('0x32')]=_[_0x034f('0x33')](_0x596a4e['query']);_0x5e121c[_0x034f('0x3c')]=_[_0x034f('0x34')](_0x5e121c[_0x034f('0x31')],_0x5e121c['query']);_0x322554[_0x034f('0x35')]=_[_0x034f('0x34')](_0x5e121c['model'],qs[_0x034f('0x36')](_0x596a4e[_0x034f('0x32')]['fields']));_0x322554[_0x034f('0x35')]=_0x322554[_0x034f('0x35')]['length']?_0x322554[_0x034f('0x35')]:_0x5e121c[_0x034f('0x31')];if(!_0x596a4e['query'][_0x034f('0x38')](_0x034f('0x50'))){_0x322554[_0x034f('0x1e')]=qs[_0x034f('0x1e')](_0x596a4e[_0x034f('0x32')][_0x034f('0x1e')]);_0x322554[_0x034f('0x1c')]=qs[_0x034f('0x1c')](_0x596a4e['query'][_0x034f('0x1c')]);}_0x322554[_0x034f('0x39')]=qs[_0x034f('0x3a')](_0x596a4e['query'][_0x034f('0x3a')]);_0x322554[_0x034f('0x3b')]=qs[_0x034f('0x3c')](_[_0x034f('0x51')](_0x596a4e[_0x034f('0x32')],_0x5e121c['filters']));_0x322554['where']['SessionId']=_0x481a2a['id'];if(_0x596a4e[_0x034f('0x32')][_0x034f('0x3d')]){_0x322554['where']=_['merge'](_0x322554['where'],{'$or':_[_0x034f('0x2b')](_0x322554[_0x034f('0x35')],function(_0x3ae055){var _0x5cf6c3={};_0x5cf6c3[_0x3ae055]={'$like':'%'+_0x596a4e[_0x034f('0x32')][_0x034f('0x3d')]+'%'};return _0x5cf6c3;})});}_0x322554=_[_0x034f('0x47')]({},_0x322554,_0x596a4e[_0x034f('0x48')]);return db[_0x034f('0x4f')][_0x034f('0x3f')]({'where':_0x322554[_0x034f('0x3b')]})[_0x034f('0x24')](function(_0x33cb08){_0xa79270[_0x034f('0x3f')]=_0x33cb08;if(_0x596a4e[_0x034f('0x32')]['includeAll']){_0x322554[_0x034f('0x41')]=[{'all':!![]}];}return db[_0x034f('0x4f')][_0x034f('0x42')](_0x322554);})[_0x034f('0x24')](function(_0xab8fed){_0xa79270[_0x034f('0x43')]=_0xab8fed;return _0xa79270;});}})[_0x034f('0x24')](respondWithFilteredResult(_0xc8f12f,_0x322554))[_0x034f('0x44')](handleError(_0xc8f12f,null));};
\ No newline at end of file
index 055c3e2..6a45b00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef17=['./jscriptySessionReport.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0xef17,0x136));var _0x7ef1=function(_0x554e47,_0x47f5c1){_0x554e47=_0x554e47-0x0;var _0x4f5a61=_0xef17[_0x554e47];return _0x4f5a61;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var logger=require(_0x7ef1('0x2'))(_0x7ef1('0x3'));var moment=require(_0x7ef1('0x4'));var BPromise=require(_0x7ef1('0x5'));var rp=require(_0x7ef1('0x6'));var fs=require('fs');var path=require(_0x7ef1('0x7'));var rimraf=require(_0x7ef1('0x8'));var config=require('../../config/environment');var attributes=require(_0x7ef1('0x9'));module['exports']=function(_0x138ed1,_0x498596){return _0x138ed1[_0x7ef1('0xa')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x56a4=['./jscriptySessionReport.attributes','exports','report_jscripty_sessions','lodash','util','api','moment','path','rimraf','../../config/environment'];(function(_0x59f660,_0x10d8b4){var _0x1740e6=function(_0x371ab0){while(--_0x371ab0){_0x59f660['push'](_0x59f660['shift']());}};_0x1740e6(++_0x10d8b4);}(_0x56a4,0x11b));var _0x456a=function(_0x5390a3,_0x4d60f7){_0x5390a3=_0x5390a3-0x0;var _0x45d220=_0x56a4[_0x5390a3];return _0x45d220;};'use strict';var _=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var logger=require('../../config/logger')(_0x456a('0x2'));var moment=require(_0x456a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x456a('0x4'));var rimraf=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var attributes=require(_0x456a('0x7'));module[_0x456a('0x8')]=function(_0x4b8eec,_0x3b0145){return _0x4b8eec['define']('JscriptySessionReport',attributes,{'tableName':_0x456a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5190b73..a3e47ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1406d1,_0x1a265e){_0x1406d1=_0x1406d1-0x0;var _0x28caea=_0xc2c7[_0x1406d1];return _0x28caea;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});}
\ No newline at end of file
+var _0xbff5=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbff5,0x1bc));var _0x5bff=function(_0x9d4e69,_0x10dfdc){_0x9d4e69=_0x9d4e69-0x0;var _0x4aeb2d=_0xbff5[_0x9d4e69];return _0x4aeb2d;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa54c57,_0x43605a,_0xd4b9dc){return new BPromise(function(_0x1acb49,_0x139c99){return client[_0x5bff('0xb')](_0xa54c57,_0xd4b9dc)['then'](function(_0x20e26f){logger['info'](_0x5bff('0xc'),_0x43605a,_0x5bff('0xd'));logger['debug'](_0x5bff('0xe'),_0x43605a,'request\x20sent',JSON[_0x5bff('0xf')](_0x20e26f));if(_0x20e26f['error']){if(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x11')]===0x1f4){logger['error'](_0x5bff('0xc'),_0x43605a,_0x20e26f['error'][_0x5bff('0x12')]);return _0x139c99(_0x20e26f[_0x5bff('0x10')]['message']);}logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x20e26f['error']['message']);return _0x1acb49(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x12')]);}else{logger[_0x5bff('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x43605a,_0x5bff('0xd'));_0x1acb49(_0x20e26f[_0x5bff('0x14')][_0x5bff('0x12')]);}})['catch'](function(_0x3ffbbc){logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x3ffbbc);_0x139c99(_0x3ffbbc);});});}
\ No newline at end of file
index f1df4b6..449ee22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a4a=['fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','/download_log_file','downloadLogFile','multer','path','connect-timeout','express','Router'];(function(_0x5311a1,_0x304912){var _0x2acb9f=function(_0x4803e7){while(--_0x4803e7){_0x5311a1['push'](_0x5311a1['shift']());}};_0x2acb9f(++_0x304912);}(_0x0a4a,0x1db));var _0xa0a4=function(_0x14e40c,_0x484fe1){_0x14e40c=_0x14e40c-0x0;var _0x520447=_0x0a4a[_0x14e40c];return _0x520447;};'use strict';var multer=require(_0xa0a4('0x0'));var util=require('util');var path=require(_0xa0a4('0x1'));var timeout=require(_0xa0a4('0x2'));var express=require(_0xa0a4('0x3'));var router=express[_0xa0a4('0x4')]();var fs_extra=require(_0xa0a4('0x5'));var auth=require(_0xa0a4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa0a4('0x7'));var controller=require(_0xa0a4('0x8'));router[_0xa0a4('0x9')]('/',controller[_0xa0a4('0xa')]);router[_0xa0a4('0xb')](_0xa0a4('0xc'),auth[_0xa0a4('0xd')](),controller['update']);router['get'](_0xa0a4('0xe'),auth[_0xa0a4('0xd')](),controller[_0xa0a4('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xa1fe=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','isAuthenticated','update','downloadLogFile','multer','util','connect-timeout','express'];(function(_0x4e62ca,_0xe85442){var _0x16007a=function(_0x52329b){while(--_0x52329b){_0x4e62ca['push'](_0x4e62ca['shift']());}};_0x16007a(++_0xe85442);}(_0xa1fe,0x130));var _0xea1f=function(_0x4eb30f,_0x2bfad8){_0x4eb30f=_0x4eb30f-0x0;var _0xc26a9a=_0xa1fe[_0x4eb30f];return _0xc26a9a;};'use strict';var multer=require(_0xea1f('0x0'));var util=require(_0xea1f('0x1'));var path=require('path');var timeout=require(_0xea1f('0x2'));var express=require(_0xea1f('0x3'));var router=express[_0xea1f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea1f('0x5'));var interaction=require(_0xea1f('0x6'));var config=require(_0xea1f('0x7'));var controller=require(_0xea1f('0x8'));router[_0xea1f('0x9')]('/',controller['index']);router[_0xea1f('0xa')]('/:id',auth[_0xea1f('0xb')](),controller[_0xea1f('0xc')]);router[_0xea1f('0x9')]('/download_log_file',auth[_0xea1f('0xb')](),controller[_0xea1f('0xd')]);module['exports']=router;
\ No newline at end of file
index 4eb4d27..f0d4496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea46=['exports','STRING','INTEGER','sequelize'];(function(_0x4020e6,_0x49089d){var _0x1f8d57=function(_0x3cdb0a){while(--_0x3cdb0a){_0x4020e6['push'](_0x4020e6['shift']());}};_0x1f8d57(++_0x49089d);}(_0xea46,0x167));var _0x6ea4=function(_0xabb9b8,_0x58647f){_0xabb9b8=_0xabb9b8-0x0;var _0x5371cd=_0xea46[_0xabb9b8];return _0x5371cd;};'use strict';var Sequelize=require(_0x6ea4('0x0'));module[_0x6ea4('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x6ea4('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x6ea4('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9122=['STRING','exports','TEXT'];(function(_0x351509,_0x54725c){var _0x4e9861=function(_0x54f92c){while(--_0x54f92c){_0x351509['push'](_0x351509['shift']());}};_0x4e9861(++_0x54725c);}(_0x9122,0x73));var _0x2912=function(_0x1033a5,_0x4b8902){_0x1033a5=_0x1033a5-0x0;var _0x3d8525=_0x9122[_0x1033a5];return _0x3d8525;};'use strict';var Sequelize=require('sequelize');module[_0x2912('0x0')]={'license':{'type':Sequelize[_0x2912('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x2912('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 703025d..f80b164 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0786=['update','then','destroy','sendStatus','stack','name','send','index','License','query','keys','filters','intersection','model','attributes','fields','length','merge','getLicense','body','params','key','demo','catch','downloadLogFile','license-info.log','/var','log','xcally','Content-disposition','set','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','Content-Range','apply','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0786,0xe7));var _0x6078=function(_0x1de0b9,_0xc6f046){_0x1de0b9=_0x1de0b9-0x0;var _0x18edae=_0x0786[_0x1de0b9];return _0x18edae;};'use strict';var emlformat=require(_0x6078('0x0'));var rimraf=require(_0x6078('0x1'));var zipdir=require(_0x6078('0x2'));var jsonpatch=require(_0x6078('0x3'));var rp=require(_0x6078('0x4'));var moment=require(_0x6078('0x5'));var BPromise=require(_0x6078('0x6'));var Mustache=require(_0x6078('0x7'));var util=require(_0x6078('0x8'));var path=require(_0x6078('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6078('0xa'));var fs=require('fs');var fs_extra=require(_0x6078('0xb'));var _=require('lodash');var squel=require(_0x6078('0xc'));var crypto=require('crypto');var jsforce=require(_0x6078('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6078('0xe'));var querystring=require(_0x6078('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6078('0x10'));var hardwareService=require(_0x6078('0x11'));var logger=require(_0x6078('0x12'))(_0x6078('0x13'));var utils=require(_0x6078('0x14'));var config=require(_0x6078('0x15'));var licenseUtil=require(_0x6078('0x16'));var db=require(_0x6078('0x17'))['db'];function respondWithStatusCode(_0x40693e,_0x33c090){_0x33c090=_0x33c090||0xcc;return function(_0x30ec8e){if(_0x30ec8e){return _0x40693e['sendStatus'](_0x33c090);}return _0x40693e['status'](_0x33c090)[_0x6078('0x18')]();};}function respondWithResult(_0x4dec3f,_0x10cd68){_0x10cd68=_0x10cd68||0xc8;return function(_0x235591){if(_0x235591){return _0x4dec3f[_0x6078('0x19')](_0x10cd68)[_0x6078('0x1a')](_0x235591);}};}function respondWithFilteredResult(_0x2af274,_0x21d00e){return function(_0x327466){if(_0x327466){var _0x3f5578=typeof _0x21d00e[_0x6078('0x1b')]===_0x6078('0x1c')&&typeof _0x21d00e['limit']===_0x6078('0x1c');var _0x4ed813=_0x327466[_0x6078('0x1d')];var _0x24f68e=_0x3f5578?0x0:_0x21d00e['offset'];var _0x189fa5=_0x3f5578?_0x327466[_0x6078('0x1d')]:_0x21d00e[_0x6078('0x1b')]+_0x21d00e['limit'];var _0x3e7d47;if(_0x189fa5>=_0x4ed813){_0x189fa5=_0x4ed813;_0x3e7d47=0xc8;}else{_0x3e7d47=0xce;}_0x2af274[_0x6078('0x19')](_0x3e7d47);return _0x2af274['set'](_0x6078('0x1e'),_0x24f68e+'-'+_0x189fa5+'/'+_0x4ed813)[_0x6078('0x1a')](_0x327466);}return null;};}function patchUpdates(_0x3c5699){return function(_0x319f54){try{jsonpatch[_0x6078('0x1f')](_0x319f54,_0x3c5699,!![]);}catch(_0x9e722){return BPromise['reject'](_0x9e722);}return _0x319f54[_0x6078('0x20')]();};}function saveUpdates(_0x29d11c,_0x4936d4){return function(_0x195701){if(_0x195701){return _0x195701[_0x6078('0x21')](_0x29d11c)[_0x6078('0x22')](function(_0x229870){return _0x229870;});}return null;};}function removeEntity(_0x536b16,_0x9109c3){return function(_0x2553f8){if(_0x2553f8){return _0x2553f8[_0x6078('0x23')]()[_0x6078('0x22')](function(){_0x536b16[_0x6078('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f71a,_0x2a2ab4){return function(_0x2be8d6){if(!_0x2be8d6){_0x47f71a[_0x6078('0x24')](0x194);}return _0x2be8d6;};}function handleError(_0x13fca8,_0x20030c){_0x20030c=_0x20030c||0x1f4;return function(_0x36cc05){logger['error'](_0x36cc05[_0x6078('0x25')]);if(_0x36cc05[_0x6078('0x26')]){delete _0x36cc05[_0x6078('0x26')];}_0x13fca8[_0x6078('0x19')](_0x20030c)[_0x6078('0x27')](_0x36cc05);};}var utilLicense=require('../../config/license/util');exports[_0x6078('0x28')]=function(_0x3e0948,_0x4051ab){var _0x4782cd={'raw':!![],'where':{'id':0x1}},_0x27c82b={};_0x27c82b['model']=_['keys'](db[_0x6078('0x29')]['rawAttributes']);_0x27c82b[_0x6078('0x2a')]=_[_0x6078('0x2b')](_0x3e0948[_0x6078('0x2a')]);_0x27c82b[_0x6078('0x2c')]=_[_0x6078('0x2d')](_0x27c82b[_0x6078('0x2e')],_0x27c82b[_0x6078('0x2a')]);_0x4782cd[_0x6078('0x2f')]=_['intersection'](_0x27c82b['model'],qs[_0x6078('0x30')](_0x3e0948[_0x6078('0x2a')][_0x6078('0x30')]));_0x4782cd[_0x6078('0x2f')]=_0x4782cd[_0x6078('0x2f')][_0x6078('0x31')]?_0x4782cd[_0x6078('0x2f')]:_0x27c82b[_0x6078('0x2e')];_0x4782cd=_[_0x6078('0x32')]({},_0x4782cd,_0x3e0948['options']);return utilLicense[_0x6078('0x33')](_0x4782cd)['then'](respondWithResult(_0x4051ab,null))['catch'](handleError(_0x4051ab,null));};exports[_0x6078('0x21')]=function(_0x46b563,_0x214fff){if(_0x46b563[_0x6078('0x34')]['id']){delete _0x46b563[_0x6078('0x34')]['id'];}return db[_0x6078('0x29')]['find']({'where':{'id':_0x46b563[_0x6078('0x35')]['id']}})[_0x6078('0x22')](handleEntityNotFound(_0x214fff,null))['then'](function(_0x1cb86d){var _0x51cab6=_0x1cb86d['get']({'plain':!![]});return utilLicense['checkLicense'](_0x51cab6,_0x46b563[_0x6078('0x34')][_0x6078('0x36')]);})[_0x6078('0x22')](function(_0x2eca92){if(!_0x2eca92[_0x6078('0x37')]){return saveUpdates(_0x46b563[_0x6078('0x34')],null);}return _0x2eca92;})[_0x6078('0x22')](respondWithResult(_0x214fff,null))[_0x6078('0x38')](handleError(_0x214fff,null));};exports[_0x6078('0x39')]=function(_0x5d0245,_0x42efe9){var _0x40aa0a=_0x6078('0x3a');var _0x1f8a00=path['join'](_0x6078('0x3b'),_0x6078('0x3c'),_0x6078('0x3d'),_0x40aa0a);_0x42efe9['setHeader'](_0x6078('0x3e'),'attachment;\x20filename='+_0x40aa0a);_0x42efe9[_0x6078('0x3f')]('Content-Type',_0x6078('0x40'));_0x42efe9[_0x6078('0x41')](_0x1f8a00);};
\ No newline at end of file
+var _0x91a7=['end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','model','License','query','intersection','attributes','length','options','catch','body','find','params','get','key','downloadLogFile','join','/var','xcally','setHeader','Content-disposition','Content-Type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x53e6a7,_0x2bbde8){var _0x149125=function(_0x238b71){while(--_0x238b71){_0x53e6a7['push'](_0x53e6a7['shift']());}};_0x149125(++_0x2bbde8);}(_0x91a7,0x129));var _0x791a=function(_0x2ba9ef,_0x32c749){_0x2ba9ef=_0x2ba9ef-0x0;var _0x20defb=_0x91a7[_0x2ba9ef];return _0x20defb;};'use strict';var emlformat=require(_0x791a('0x0'));var rimraf=require(_0x791a('0x1'));var zipdir=require(_0x791a('0x2'));var jsonpatch=require(_0x791a('0x3'));var rp=require(_0x791a('0x4'));var moment=require(_0x791a('0x5'));var BPromise=require(_0x791a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x791a('0x7'));var sox=require(_0x791a('0x8'));var csv=require(_0x791a('0x9'));var ejs=require(_0x791a('0xa'));var fs=require('fs');var fs_extra=require(_0x791a('0xb'));var _=require(_0x791a('0xc'));var squel=require('squel');var crypto=require(_0x791a('0xd'));var jsforce=require(_0x791a('0xe'));var deskjs=require(_0x791a('0xf'));var toCsv=require(_0x791a('0x9'));var querystring=require(_0x791a('0x10'));var Papa=require(_0x791a('0x11'));var Redis=require(_0x791a('0x12'));var authService=require(_0x791a('0x13'));var qs=require(_0x791a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x15'))(_0x791a('0x16'));var utils=require(_0x791a('0x17'));var config=require(_0x791a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x791a('0x19'))['db'];function respondWithStatusCode(_0x35d2f3,_0x7207aa){_0x7207aa=_0x7207aa||0xcc;return function(_0x4bcb56){if(_0x4bcb56){return _0x35d2f3[_0x791a('0x1a')](_0x7207aa);}return _0x35d2f3[_0x791a('0x1b')](_0x7207aa)[_0x791a('0x1c')]();};}function respondWithResult(_0x31fabc,_0x588bcc){_0x588bcc=_0x588bcc||0xc8;return function(_0x3fadf0){if(_0x3fadf0){return _0x31fabc[_0x791a('0x1b')](_0x588bcc)[_0x791a('0x1d')](_0x3fadf0);}};}function respondWithFilteredResult(_0x5f1025,_0x34923e){return function(_0x1c5f44){if(_0x1c5f44){var _0x56bec0=typeof _0x34923e['offset']===_0x791a('0x1e')&&typeof _0x34923e[_0x791a('0x1f')]===_0x791a('0x1e');var _0x1542f4=_0x1c5f44['count'];var _0x5dd6bc=_0x56bec0?0x0:_0x34923e[_0x791a('0x20')];var _0x15b997=_0x56bec0?_0x1c5f44[_0x791a('0x21')]:_0x34923e['offset']+_0x34923e[_0x791a('0x1f')];var _0x171d57;if(_0x15b997>=_0x1542f4){_0x15b997=_0x1542f4;_0x171d57=0xc8;}else{_0x171d57=0xce;}_0x5f1025[_0x791a('0x1b')](_0x171d57);return _0x5f1025[_0x791a('0x22')](_0x791a('0x23'),_0x5dd6bc+'-'+_0x15b997+'/'+_0x1542f4)['json'](_0x1c5f44);}return null;};}function patchUpdates(_0x2d95a7){return function(_0x1e1d08){try{jsonpatch[_0x791a('0x24')](_0x1e1d08,_0x2d95a7,!![]);}catch(_0x117378){return BPromise['reject'](_0x117378);}return _0x1e1d08[_0x791a('0x25')]();};}function saveUpdates(_0x31c7bd,_0x40f591){return function(_0x520d28){if(_0x520d28){return _0x520d28[_0x791a('0x26')](_0x31c7bd)[_0x791a('0x27')](function(_0x18f128){return _0x18f128;});}return null;};}function removeEntity(_0x273512,_0x26c3a8){return function(_0x2dd188){if(_0x2dd188){return _0x2dd188['destroy']()[_0x791a('0x27')](function(){_0x273512[_0x791a('0x1b')](0xcc)[_0x791a('0x1c')]();});}};}function handleEntityNotFound(_0x16f77b,_0x2f094a){return function(_0x22a07a){if(!_0x22a07a){_0x16f77b[_0x791a('0x1a')](0x194);}return _0x22a07a;};}function handleError(_0x423d1e,_0x24b3ca){_0x24b3ca=_0x24b3ca||0x1f4;return function(_0x4157d0){logger[_0x791a('0x28')](_0x4157d0[_0x791a('0x29')]);if(_0x4157d0[_0x791a('0x2a')]){delete _0x4157d0[_0x791a('0x2a')];}_0x423d1e[_0x791a('0x1b')](_0x24b3ca)[_0x791a('0x2b')](_0x4157d0);};}var utilLicense=require('../../config/license/util');exports[_0x791a('0x2c')]=function(_0x1732b8,_0x162e26){var _0x2112e5={'raw':!![],'where':{'id':0x1}},_0x377543={};_0x377543[_0x791a('0x2d')]=_['keys'](db[_0x791a('0x2e')]['rawAttributes']);_0x377543[_0x791a('0x2f')]=_['keys'](_0x1732b8[_0x791a('0x2f')]);_0x377543['filters']=_[_0x791a('0x30')](_0x377543[_0x791a('0x2d')],_0x377543['query']);_0x2112e5[_0x791a('0x31')]=_[_0x791a('0x30')](_0x377543[_0x791a('0x2d')],qs['fields'](_0x1732b8[_0x791a('0x2f')]['fields']));_0x2112e5[_0x791a('0x31')]=_0x2112e5[_0x791a('0x31')][_0x791a('0x32')]?_0x2112e5['attributes']:_0x377543[_0x791a('0x2d')];_0x2112e5=_['merge']({},_0x2112e5,_0x1732b8[_0x791a('0x33')]);return utilLicense['getLicense'](_0x2112e5)[_0x791a('0x27')](respondWithResult(_0x162e26,null))[_0x791a('0x34')](handleError(_0x162e26,null));};exports[_0x791a('0x26')]=function(_0x304ad6,_0x549f8a){if(_0x304ad6['body']['id']){delete _0x304ad6[_0x791a('0x35')]['id'];}return db[_0x791a('0x2e')][_0x791a('0x36')]({'where':{'id':_0x304ad6[_0x791a('0x37')]['id']}})[_0x791a('0x27')](handleEntityNotFound(_0x549f8a,null))['then'](function(_0x1b58af){var _0xee3751=_0x1b58af[_0x791a('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0xee3751,_0x304ad6[_0x791a('0x35')][_0x791a('0x39')]);})[_0x791a('0x27')](function(_0x371224){if(!_0x371224['demo']){return saveUpdates(_0x304ad6[_0x791a('0x35')],null);}return _0x371224;})[_0x791a('0x27')](respondWithResult(_0x549f8a,null))[_0x791a('0x34')](handleError(_0x549f8a,null));};exports[_0x791a('0x3a')]=function(_0x55851f,_0x2384e4){var _0x4619b0='license-info.log';var _0x40227c=path[_0x791a('0x3b')](_0x791a('0x3c'),'log',_0x791a('0x3d'),_0x4619b0);_0x2384e4[_0x791a('0x3e')](_0x791a('0x3f'),'attachment;\x20filename='+_0x4619b0);_0x2384e4['set'](_0x791a('0x40'),'text/plain');_0x2384e4['download'](_0x40227c);};
\ No newline at end of file
index bc50b67..2b81b68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe649=['License','license','lodash','../../config/logger','api','moment','path','rimraf','./license.attributes','exports'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0xe649,0x17e));var _0x9e64=function(_0x2bea0c,_0x9d2212){_0x2bea0c=_0x2bea0c-0x0;var _0x124b8f=_0xe649[_0x2bea0c];return _0x124b8f;};'use strict';var _=require(_0x9e64('0x0'));var util=require('util');var logger=require(_0x9e64('0x1'))(_0x9e64('0x2'));var moment=require(_0x9e64('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e64('0x4'));var rimraf=require(_0x9e64('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e64('0x6'));module[_0x9e64('0x7')]=function(_0x790175,_0x358288){return _0x790175['define'](_0x9e64('0x8'),attributes,{'tableName':_0x9e64('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ae2=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','define','License','license'];(function(_0x2ebbdb,_0x5979e3){var _0x49018d=function(_0x54347e){while(--_0x54347e){_0x2ebbdb['push'](_0x2ebbdb['shift']());}};_0x49018d(++_0x5979e3);}(_0x8ae2,0x140));var _0x28ae=function(_0x38c2d6,_0x55f32d){_0x38c2d6=_0x38c2d6-0x0;var _0x1929da=_0x8ae2[_0x38c2d6];return _0x1929da;};'use strict';var _=require(_0x28ae('0x0'));var util=require(_0x28ae('0x1'));var logger=require(_0x28ae('0x2'))(_0x28ae('0x3'));var moment=require('moment');var BPromise=require(_0x28ae('0x4'));var rp=require(_0x28ae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28ae('0x6'));var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x3ea80d,_0x2ea573){return _0x3ea80d[_0x28ae('0x7')](_0x28ae('0x8'),attributes,{'tableName':_0x28ae('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index da30423..4353acd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa5a=['info','request\x20sent','debug','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x2b6b83,_0x4ae6a2){var _0x4448f5=function(_0x2da1a7){while(--_0x2da1a7){_0x2b6b83['push'](_0x2b6b83['shift']());}};_0x4448f5(++_0x4ae6a2);}(_0xfa5a,0x154));var _0xafa5=function(_0x3c332f,_0x2f6802){_0x3c332f=_0x3c332f-0x0;var _0x33cf1a=_0xfa5a[_0x3c332f];return _0x33cf1a;};'use strict';var _=require(_0xafa5('0x0'));var util=require(_0xafa5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xafa5('0x2'));var fs=require('fs');var Redis=require(_0xafa5('0x3'));var db=require(_0xafa5('0x4'))['db'];var utils=require(_0xafa5('0x5'));var logger=require('../../config/logger')(_0xafa5('0x6'));var config=require('../../config/environment');var jayson=require(_0xafa5('0x7'));var client=jayson[_0xafa5('0x8')][_0xafa5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27c848,_0xda9aed,_0x1e93ce){return new BPromise(function(_0x362ac8,_0x448897){return client[_0xafa5('0xa')](_0x27c848,_0x1e93ce)[_0xafa5('0xb')](function(_0x323712){logger[_0xafa5('0xc')]('License,\x20%s,\x20%s',_0xda9aed,_0xafa5('0xd'));logger[_0xafa5('0xe')]('License,\x20%s,\x20%s,\x20%s',_0xda9aed,_0xafa5('0xd'),JSON[_0xafa5('0xf')](_0x323712));if(_0x323712[_0xafa5('0x10')]){if(_0x323712['error'][_0xafa5('0x11')]===0x1f4){logger[_0xafa5('0x10')](_0xafa5('0x12'),_0xda9aed,_0x323712[_0xafa5('0x10')][_0xafa5('0x13')]);return _0x448897(_0x323712[_0xafa5('0x10')][_0xafa5('0x13')]);}logger['error']('License,\x20%s,\x20%s',_0xda9aed,_0x323712[_0xafa5('0x10')][_0xafa5('0x13')]);return _0x362ac8(_0x323712['error']['message']);}else{logger[_0xafa5('0xc')](_0xafa5('0x12'),_0xda9aed,_0xafa5('0xd'));_0x362ac8(_0x323712[_0xafa5('0x14')][_0xafa5('0x13')]);}})[_0xafa5('0x15')](function(_0x281958){logger[_0xafa5('0x10')](_0xafa5('0x12'),_0xda9aed,_0x281958);_0x448897(_0x281958);});});}
\ No newline at end of file
+var _0x0069=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','License,\x20%s,\x20%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0069,0x1d4));var _0x9006=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x0069[_0xba1760];return _0x1f3143;};'use strict';var _=require(_0x9006('0x0'));var util=require('util');var moment=require(_0x9006('0x1'));var BPromise=require(_0x9006('0x2'));var rs=require(_0x9006('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9006('0x4'));var logger=require(_0x9006('0x5'))(_0x9006('0x6'));var config=require(_0x9006('0x7'));var jayson=require(_0x9006('0x8'));var client=jayson[_0x9006('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xff0150,_0x2bac70,_0x409141){return new BPromise(function(_0x9b3a4,_0x367150){return client['request'](_0xff0150,_0x409141)['then'](function(_0xf492b){logger[_0x9006('0xa')](_0x9006('0xb'),_0x2bac70,_0x9006('0xc'));logger[_0x9006('0xd')]('License,\x20%s,\x20%s,\x20%s',_0x2bac70,_0x9006('0xc'),JSON[_0x9006('0xe')](_0xf492b));if(_0xf492b[_0x9006('0xf')]){if(_0xf492b[_0x9006('0xf')][_0x9006('0x10')]===0x1f4){logger['error'](_0x9006('0xb'),_0x2bac70,_0xf492b[_0x9006('0xf')][_0x9006('0x11')]);return _0x367150(_0xf492b[_0x9006('0xf')][_0x9006('0x11')]);}logger[_0x9006('0xf')](_0x9006('0xb'),_0x2bac70,_0xf492b[_0x9006('0xf')][_0x9006('0x11')]);return _0x9b3a4(_0xf492b[_0x9006('0xf')][_0x9006('0x11')]);}else{logger[_0x9006('0xa')](_0x9006('0xb'),_0x2bac70,_0x9006('0xc'));_0x9b3a4(_0xf492b[_0x9006('0x12')]['message']);}})[_0x9006('0x13')](function(_0x2032df){logger[_0x9006('0xf')](_0x9006('0xb'),_0x2bac70,_0x2032df);_0x367150(_0x2032df);});});}
\ No newline at end of file
index cacffca..ec84ad1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d0b=['post','create','/:id/in_servers','addImap','addSmtp','addApplications','addAgents','put','update','delete','removeAnswers','removeImap','removeSmtp','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents'];(function(_0x82b73d,_0x17a49b){var _0x250450=function(_0x361a7b){while(--_0x361a7b){_0x82b73d['push'](_0x82b73d['shift']());}};_0x250450(++_0x17a49b);}(_0x2d0b,0x1e7));var _0xb2d0=function(_0x35d507,_0x5b326a){_0x35d507=_0x35d507-0x0;var _0x699ab1=_0x2d0b[_0x35d507];return _0x699ab1;};'use strict';var multer=require(_0xb2d0('0x0'));var util=require(_0xb2d0('0x1'));var path=require('path');var timeout=require(_0xb2d0('0x2'));var express=require(_0xb2d0('0x3'));var router=express[_0xb2d0('0x4')]();var fs_extra=require(_0xb2d0('0x5'));var auth=require(_0xb2d0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb2d0('0x7'));router[_0xb2d0('0x8')]('/',auth[_0xb2d0('0x9')](),controller['index']);router[_0xb2d0('0x8')](_0xb2d0('0xa'),auth[_0xb2d0('0x9')](),controller[_0xb2d0('0xb')]);router[_0xb2d0('0x8')](_0xb2d0('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb2d0('0xd'),auth['isAuthenticated'](),controller[_0xb2d0('0xe')]);router[_0xb2d0('0x8')](_0xb2d0('0xf'),auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x10')]);router[_0xb2d0('0x8')]('/:id/in_servers',auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x11')]);router['get'](_0xb2d0('0x12'),auth['isAuthenticated'](),controller[_0xb2d0('0x13')]);router[_0xb2d0('0x8')]('/:id/interactions',auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x14')]);router[_0xb2d0('0x8')](_0xb2d0('0x15'),auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x16')]);router['get'](_0xb2d0('0x17'),auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x18')]);router[_0xb2d0('0x8')](_0xb2d0('0x19'),auth['isAuthenticated'](),controller[_0xb2d0('0x1a')]);router['get'](_0xb2d0('0x1b'),auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x1c')]);router[_0xb2d0('0x1d')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xb2d0('0xf'),auth[_0xb2d0('0x9')](),controller['addAnswer']);router[_0xb2d0('0x1d')]('/',auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x1e')]);router[_0xb2d0('0x1d')](_0xb2d0('0x1f'),auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x20')]);router[_0xb2d0('0x1d')](_0xb2d0('0x12'),auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x21')]);router[_0xb2d0('0x1d')]('/:id/interactions',auth[_0xb2d0('0x9')](),controller['addInteraction']);router[_0xb2d0('0x1d')]('/:id/applications',auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x22')]);router[_0xb2d0('0x1d')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0xb2d0('0x1d')]('/:id/users',auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x23')]);router[_0xb2d0('0x24')](_0xb2d0('0xc'),auth['isAuthenticated'](),controller[_0xb2d0('0x25')]);router['delete'](_0xb2d0('0xd'),auth[_0xb2d0('0x9')](),controller['removeDispositions']);router[_0xb2d0('0x26')](_0xb2d0('0xf'),auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x27')]);router['delete'](_0xb2d0('0x1f'),auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x28')]);router[_0xb2d0('0x26')]('/:id/out_servers',auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x29')]);router[_0xb2d0('0x26')](_0xb2d0('0xc'),auth[_0xb2d0('0x9')](),controller['destroy']);router[_0xb2d0('0x26')](_0xb2d0('0x1b'),auth[_0xb2d0('0x9')](),controller[_0xb2d0('0x2a')]);module['exports']=router;
\ No newline at end of file
+var _0x995c=['update','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','/:id/send','send','addAgents','put'];(function(_0x36055a,_0x55613a){var _0x1eb71f=function(_0x489fc4){while(--_0x489fc4){_0x36055a['push'](_0x36055a['shift']());}};_0x1eb71f(++_0x55613a);}(_0x995c,0x6a));var _0xc995=function(_0x3cc9d3,_0xcd7f61){_0x3cc9d3=_0x3cc9d3-0x0;var _0x2b2256=_0x995c[_0x3cc9d3];return _0x2b2256;};'use strict';var multer=require(_0xc995('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc995('0x1'));var express=require(_0xc995('0x2'));var router=express[_0xc995('0x3')]();var fs_extra=require(_0xc995('0x4'));var auth=require(_0xc995('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc995('0x6'));var controller=require('./mailAccount.controller');router[_0xc995('0x7')]('/',auth[_0xc995('0x8')](),controller[_0xc995('0x9')]);router[_0xc995('0x7')](_0xc995('0xa'),auth[_0xc995('0x8')](),controller[_0xc995('0xb')]);router['get'](_0xc995('0xc'),auth['isAuthenticated'](),controller[_0xc995('0xd')]);router[_0xc995('0x7')](_0xc995('0xe'),auth[_0xc995('0x8')](),controller[_0xc995('0xf')]);router[_0xc995('0x7')](_0xc995('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xc995('0x11'),auth[_0xc995('0x8')](),controller[_0xc995('0x12')]);router['get'](_0xc995('0x13'),auth[_0xc995('0x8')](),controller[_0xc995('0x14')]);router[_0xc995('0x7')](_0xc995('0x15'),auth[_0xc995('0x8')](),controller[_0xc995('0x16')]);router[_0xc995('0x7')](_0xc995('0x17'),auth['isAuthenticated'](),controller[_0xc995('0x18')]);router['get'](_0xc995('0x19'),auth['isAuthenticated'](),controller[_0xc995('0x1a')]);router[_0xc995('0x7')]('/:id/verify',auth[_0xc995('0x8')](),controller[_0xc995('0x1b')]);router[_0xc995('0x7')](_0xc995('0x1c'),auth['isAuthenticated'](),controller[_0xc995('0x1d')]);router[_0xc995('0x1e')](_0xc995('0xe'),auth[_0xc995('0x8')](),controller[_0xc995('0x1f')]);router[_0xc995('0x1e')](_0xc995('0x10'),auth['isAuthenticated'](),controller[_0xc995('0x20')]);router[_0xc995('0x1e')]('/',auth[_0xc995('0x8')](),controller[_0xc995('0x21')]);router[_0xc995('0x1e')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xc995('0x22')]);router[_0xc995('0x1e')](_0xc995('0x13'),auth[_0xc995('0x8')](),controller[_0xc995('0x23')]);router[_0xc995('0x1e')](_0xc995('0x15'),auth[_0xc995('0x8')](),controller[_0xc995('0x24')]);router['post'](_0xc995('0x17'),auth[_0xc995('0x8')](),controller['addApplications']);router[_0xc995('0x1e')](_0xc995('0x25'),auth[_0xc995('0x8')](),controller[_0xc995('0x26')]);router[_0xc995('0x1e')]('/:id/users',auth[_0xc995('0x8')](),controller[_0xc995('0x27')]);router[_0xc995('0x28')]('/:id',auth[_0xc995('0x8')](),controller[_0xc995('0x29')]);router[_0xc995('0x2a')](_0xc995('0xe'),auth[_0xc995('0x8')](),controller['removeDispositions']);router[_0xc995('0x2a')](_0xc995('0x10'),auth['isAuthenticated'](),controller[_0xc995('0x2b')]);router[_0xc995('0x2a')](_0xc995('0x11'),auth[_0xc995('0x8')](),controller[_0xc995('0x2c')]);router['delete'](_0xc995('0x13'),auth['isAuthenticated'](),controller[_0xc995('0x2d')]);router[_0xc995('0x2a')](_0xc995('0xc'),auth[_0xc995('0x8')](),controller[_0xc995('0x2e')]);router[_0xc995('0x2a')](_0xc995('0x1c'),auth[_0xc995('0x8')](),controller[_0xc995('0x2f')]);module[_0xc995('0x30')]=router;
\ No newline at end of file
index 485d802..5b3d44e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x471a=['getDataValue','custom','provider','sequelize','exports','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','gmail','yahoo'];(function(_0x42d529,_0x14ca61){var _0x435200=function(_0x263bf4){while(--_0x263bf4){_0x42d529['push'](_0x42d529['shift']());}};_0x435200(++_0x14ca61);}(_0x471a,0x113));var _0xa471=function(_0x934e9f,_0x35ee3c){_0x934e9f=_0x934e9f-0x0;var _0x395d31=_0x471a[_0x934e9f];return _0x395d31;};'use strict';var Sequelize=require(_0xa471('0x0'));module[_0xa471('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xa471('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa471('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xa471('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa471('0x3')},'fontSize':{'type':Sequelize[_0xa471('0x4')](0x2)[_0xa471('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa471('0x6')],'defaultValue':function(){return _0xa471('0x7');}},'notificationSound':{'type':Sequelize[_0xa471('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa471('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa471('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa471('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa471('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa471('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xa471('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xa471('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x220913){if(!_0x220913)this['setDataValue'](_0xa471('0x9'),null);this[_0xa471('0xa')](_0xa471('0xb'),_0x220913);}},'provider':{'type':Sequelize['ENUM'](_0xa471('0xc'),'hotmail',_0xa471('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0xa471('0xe')]('provider'))return _0xa471('0xf');return this[_0xa471('0xe')](_0xa471('0x10'));},'set':function(_0x24918d){if(_0x24918d===_0xa471('0xf'))_0x24918d=null;return this[_0xa471('0xa')](_0xa471('0x10'),_0x24918d);}}};
\ No newline at end of file
+var _0x6764=['STRING','BOOLEAN','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','sequelize','exports'];(function(_0x2b4f9d,_0x1ea9e3){var _0x3dc481=function(_0x1ca8fd){while(--_0x1ca8fd){_0x2b4f9d['push'](_0x2b4f9d['shift']());}};_0x3dc481(++_0x1ea9e3);}(_0x6764,0x11b));var _0x4676=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x6764[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x4676('0x0'));module[_0x4676('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x4676('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x4676('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x4676('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4676('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x4676('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x4676('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x4676('0x4')](0x2)[_0x4676('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4676('0x6')],'defaultValue':function(){return _0x4676('0x7');}},'notificationSound':{'type':Sequelize[_0x4676('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4676('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4676('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4676('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4676('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4676('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4676('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x4676('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x4676('0x3')],'defaultValue':![],'comment':_0x4676('0x9'),'set':function(_0x156457){if(!_0x156457)this[_0x4676('0xa')](_0x4676('0xb'),null);this[_0x4676('0xa')](_0x4676('0xc'),_0x156457);}},'provider':{'type':Sequelize[_0x4676('0xd')](_0x4676('0xe'),_0x4676('0xf'),'yahoo',_0x4676('0x10')),'defaultValue':null,'get':function(){if(!this[_0x4676('0x11')](_0x4676('0x12')))return'custom';return this[_0x4676('0x11')]('provider');},'set':function(_0x33d864){if(_0x33d864==='custom')_0x33d864=null;return this[_0x4676('0xa')](_0x4676('0x12'),_0x33d864);}}};
\ No newline at end of file
index 53844a8..2384697 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b0c=['priority','finally','json','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','isNil','%s\x20<%s>','attachments','server/files/attachments','authentication','auth','secure','sendMail','List\x20not\x20found','messageId','from','subject','out','Interaction','Messages','verifySmtp','CloudProvider','OAuth2','data5','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','path','lodash','juice','ioredis','api','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','offset','undefined','limit','count','set','Content-Range','then','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','MailServerIn','find','update','body','CloudProviderId','describe','addDisposition','create','getDispositions','findOne','hasOwnProperty','nolimit','MailAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','custom','provider','email','ListId','active','description','user','username','pass','modernAuthentication','password','service','host','port','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','getImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','MailApplication','findAndCountAll'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x9b0c,0xde));var _0xc9b0=function(_0x2024e5,_0xbd4728){_0x2024e5=_0x2024e5-0x0;var _0x25a679=_0x9b0c[_0x2024e5];return _0x25a679;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0xc9b0('0x0'));var _=require(_0xc9b0('0x1'));var juice=require(_0xc9b0('0x2'));var Redis=require(_0xc9b0('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc9b0('0x4'));var config=require('../../config/environment');var db=require(_0xc9b0('0x5'))['db'];config[_0xc9b0('0x6')]=_[_0xc9b0('0x7')](config[_0xc9b0('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xc9b0('0x8'))(new Redis(config['redis']));require(_0xc9b0('0x9'))['register'](socket);var jayson=require(_0xc9b0('0xa'));var client=jayson[_0xc9b0('0xb')][_0xc9b0('0xc')]({'port':0x232b});function respondWithRpcPromise(_0x926f66,_0x39ef9b,_0x58f7da,_0x44cadc){return new BPromise(function(_0x17293d,_0x458aa0){var _0x27cce7=_0x44cadc||client;return _0x27cce7['request'](_0x926f66,_0x58f7da)['then'](function(_0x18de02){logger[_0xc9b0('0xd')](_0xc9b0('0xe'),_0x39ef9b,_0xc9b0('0xf'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x39ef9b,_0xc9b0('0xf'),JSON[_0xc9b0('0x10')](_0x18de02));if(_0x18de02[_0xc9b0('0x11')]){if(_0x18de02[_0xc9b0('0x11')][_0xc9b0('0x12')]===0x1f4){logger[_0xc9b0('0x11')](_0xc9b0('0xe'),_0x39ef9b,_0x18de02['error'][_0xc9b0('0x13')]);return _0x458aa0(_0x18de02[_0xc9b0('0x11')][_0xc9b0('0x13')]);}logger[_0xc9b0('0x11')](_0xc9b0('0xe'),_0x39ef9b,_0x18de02[_0xc9b0('0x11')][_0xc9b0('0x13')]);return _0x17293d(_0x18de02[_0xc9b0('0x11')][_0xc9b0('0x13')]);}else{logger['info'](_0xc9b0('0xe'),_0x39ef9b,_0xc9b0('0xf'));_0x17293d(_0x18de02[_0xc9b0('0x14')][_0xc9b0('0x13')]);}})['catch'](function(_0xe14df7){logger[_0xc9b0('0x11')](_0xc9b0('0xe'),_0x39ef9b,_0xe14df7);_0x458aa0(_0xe14df7);});});}function respondWithStatusCode(_0x444170,_0x2ee6d0){_0x2ee6d0=_0x2ee6d0||0xcc;return function(_0x845083){if(_0x845083){return _0x444170[_0xc9b0('0x15')](_0x2ee6d0);}return _0x444170[_0xc9b0('0x16')](_0x2ee6d0)['end']();};}function respondWithResult(_0x21c8e2,_0x5666f5){_0x5666f5=_0x5666f5||0xc8;return function(_0x397b78){if(_0x397b78){return _0x21c8e2['status'](_0x5666f5)['json'](_0x397b78);}};}function respondWithFilteredResult(_0x19db80,_0x27e4ef){return function(_0x2c3582){if(_0x2c3582){var _0x39fe67=typeof _0x27e4ef[_0xc9b0('0x17')]===_0xc9b0('0x18')&&typeof _0x27e4ef[_0xc9b0('0x19')]==='undefined';var _0x14aac5=_0x2c3582['count'];var _0x16802e=_0x39fe67?0x0:_0x27e4ef[_0xc9b0('0x17')];var _0x1339f=_0x39fe67?_0x2c3582[_0xc9b0('0x1a')]:_0x27e4ef['offset']+_0x27e4ef['limit'];var _0x5d5022;if(_0x1339f>=_0x14aac5){_0x1339f=_0x14aac5;_0x5d5022=0xc8;}else{_0x5d5022=0xce;}_0x19db80['status'](_0x5d5022);return _0x19db80[_0xc9b0('0x1b')](_0xc9b0('0x1c'),_0x16802e+'-'+_0x1339f+'/'+_0x14aac5)['json'](_0x2c3582);}return null;};}function saveUpdates(_0x6e0c2f){return function(_0x207e26){if(_0x207e26){return _0x207e26['update'](_0x6e0c2f)[_0xc9b0('0x1d')](function(_0x5ac1df){return _0x5ac1df;});}return null;};}function removeEntity(_0x4d2f6a){return function(_0x4db08b){if(_0x4db08b){return _0x4db08b[_0xc9b0('0x1e')]()['then'](function(){var _0x3494d8=_0x4db08b[_0xc9b0('0x1f')]({'plain':!![]});var _0x1251fc=_0xc9b0('0x20');return db[_0xc9b0('0x21')][_0xc9b0('0x1e')]({'where':{'type':_0x1251fc,'resourceId':_0x3494d8['id']}})[_0xc9b0('0x1d')](function(){return _0x4db08b;});})[_0xc9b0('0x1d')](function(){_0x4d2f6a[_0xc9b0('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f5481){return function(_0x5d5d3c){if(!_0x5d5d3c){_0x3f5481[_0xc9b0('0x15')](0x194);}return _0x5d5d3c;};}function handleError(_0x1a1a00,_0x2c569b){_0x2c569b=_0x2c569b||0x1f4;return function(_0x1a0411){logger[_0xc9b0('0x11')](_0x1a0411[_0xc9b0('0x22')]);if(_0x1a0411[_0xc9b0('0x23')]){delete _0x1a0411[_0xc9b0('0x23')];}_0x1a1a00[_0xc9b0('0x16')](_0x2c569b)[_0xc9b0('0x24')](_0x1a0411);};}exports[_0xc9b0('0x25')]=function(_0xb3b3e0,_0x37d674){var _0x1923b2={'include':[{'model':db['MailServerIn'],'as':_0xc9b0('0x26')},{'model':db[_0xc9b0('0x27')],'as':_0xc9b0('0x28')},{'model':db[_0xc9b0('0x29')],'as':_0xc9b0('0x2a')}]},_0x1a8756={},_0x41cce2={'count':0x0,'rows':[]};var _0x50b60f=_['map'](db[_0xc9b0('0x2b')][_0xc9b0('0x2c')],function(_0x4faf27){return{'name':_0x4faf27[_0xc9b0('0x2d')],'type':_0x4faf27[_0xc9b0('0x2e')][_0xc9b0('0x2f')]};});_0x1a8756['model']=_[_0xc9b0('0x30')](_0x50b60f,_0xc9b0('0x23'));_0x1a8756[_0xc9b0('0x31')]=_[_0xc9b0('0x32')](_0xb3b3e0[_0xc9b0('0x31')]);_0x1a8756[_0xc9b0('0x33')]=_[_0xc9b0('0x34')](_0x1a8756[_0xc9b0('0x35')],_0x1a8756['query']);_0x1923b2['attributes']=_['intersection'](_0x1a8756[_0xc9b0('0x35')],qs['fields'](_0xb3b3e0[_0xc9b0('0x31')][_0xc9b0('0x36')]));_0x1923b2[_0xc9b0('0x37')]=_0x1923b2['attributes'][_0xc9b0('0x38')]?_0x1923b2['attributes']:_0x1a8756['model'];if(!_0xb3b3e0[_0xc9b0('0x31')]['hasOwnProperty']('nolimit')){_0x1923b2[_0xc9b0('0x19')]=qs['limit'](_0xb3b3e0[_0xc9b0('0x31')]['limit']);_0x1923b2['offset']=qs[_0xc9b0('0x17')](_0xb3b3e0['query']['offset']);}_0x1923b2[_0xc9b0('0x39')]=qs[_0xc9b0('0x3a')](_0xb3b3e0[_0xc9b0('0x31')][_0xc9b0('0x3a')]);_0x1923b2[_0xc9b0('0x3b')]=qs[_0xc9b0('0x33')](_[_0xc9b0('0x3c')](_0xb3b3e0['query'],_0x1a8756[_0xc9b0('0x33')]),_0x50b60f);if(_0xb3b3e0[_0xc9b0('0x31')][_0xc9b0('0x3d')]){_0x1923b2[_0xc9b0('0x3b')]=_['merge'](_0x1923b2[_0xc9b0('0x3b')],{'$or':_[_0xc9b0('0x30')](_0x50b60f,function(_0x222cfb){if(_0x222cfb[_0xc9b0('0x2e')]!==_0xc9b0('0x3e')){var _0x12fe5b={};_0x12fe5b[_0x222cfb['name']]={'$like':'%'+_0xb3b3e0['query'][_0xc9b0('0x3d')]+'%'};return _0x12fe5b;}})});}_0x1923b2=_[_0xc9b0('0x3f')]({},_0x1923b2,_0xb3b3e0[_0xc9b0('0x40')]);var _0x5a7449={'where':_0x1923b2['where']};return db[_0xc9b0('0x2b')][_0xc9b0('0x1a')](_0x5a7449)[_0xc9b0('0x1d')](function(_0x3f3957){_0x41cce2[_0xc9b0('0x1a')]=_0x3f3957;if(_0xb3b3e0[_0xc9b0('0x31')][_0xc9b0('0x41')]){_0x1923b2[_0xc9b0('0x42')]=[{'all':!![]}];}return db[_0xc9b0('0x2b')][_0xc9b0('0x43')](_0x1923b2);})[_0xc9b0('0x1d')](function(_0x27603f){_0x41cce2[_0xc9b0('0x44')]=_0x27603f;return _0x41cce2;})['then'](respondWithFilteredResult(_0x37d674,_0x1923b2))[_0xc9b0('0x45')](handleError(_0x37d674,null));};exports[_0xc9b0('0x46')]=function(_0x1e0a9e,_0x3da217){var _0x356573={'raw':![],'where':{'id':_0x1e0a9e[_0xc9b0('0x47')]['id']},'include':[{'model':db[_0xc9b0('0x48')],'as':_0xc9b0('0x26')},{'model':db['MailServerOut'],'as':_0xc9b0('0x28')},{'model':db[_0xc9b0('0x29')],'as':_0xc9b0('0x2a')}]},_0x2fe772={};_0x2fe772['model']=_['keys'](db['MailAccount']['rawAttributes']);_0x2fe772[_0xc9b0('0x31')]=_[_0xc9b0('0x32')](_0x1e0a9e[_0xc9b0('0x31')]);_0x2fe772['filters']=_[_0xc9b0('0x34')](_0x2fe772[_0xc9b0('0x35')],_0x2fe772[_0xc9b0('0x31')]);_0x356573[_0xc9b0('0x37')]=_[_0xc9b0('0x34')](_0x2fe772[_0xc9b0('0x35')],qs[_0xc9b0('0x36')](_0x1e0a9e[_0xc9b0('0x31')][_0xc9b0('0x36')]));_0x356573[_0xc9b0('0x37')]=_0x356573[_0xc9b0('0x37')][_0xc9b0('0x38')]?_0x356573[_0xc9b0('0x37')]:_0x2fe772[_0xc9b0('0x35')];if(_0x1e0a9e[_0xc9b0('0x31')]['includeAll']){_0x356573[_0xc9b0('0x42')]=[{'all':!![]}];}_0x356573=_[_0xc9b0('0x3f')]({},_0x356573,_0x1e0a9e['options']);return db[_0xc9b0('0x2b')][_0xc9b0('0x49')](_0x356573)[_0xc9b0('0x1d')](handleEntityNotFound(_0x3da217,null))[_0xc9b0('0x1d')](respondWithResult(_0x3da217,null))[_0xc9b0('0x45')](handleError(_0x3da217,null));};exports[_0xc9b0('0x4a')]=function(_0xe47ea3,_0x1a3ffb){if(_0xe47ea3[_0xc9b0('0x4b')]['id']){delete _0xe47ea3[_0xc9b0('0x4b')]['id'];}if(_0xe47ea3[_0xc9b0('0x4b')][_0xc9b0('0x26')]){if(!_0xe47ea3['body']['Imap']['modernAuthentication']){_0xe47ea3[_0xc9b0('0x4b')][_0xc9b0('0x26')]['CloudProviderId']=null;}}if(_0xe47ea3[_0xc9b0('0x4b')][_0xc9b0('0x28')]){if(!_0xe47ea3['body']['Smtp']['modernAuthentication']){_0xe47ea3['body'][_0xc9b0('0x28')][_0xc9b0('0x4c')]=null;}}return db[_0xc9b0('0x2b')][_0xc9b0('0x49')]({'where':{'id':_0xe47ea3[_0xc9b0('0x47')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xc9b0('0x26')},{'model':db[_0xc9b0('0x27')],'as':_0xc9b0('0x28')},{'model':db[_0xc9b0('0x29')],'as':_0xc9b0('0x2a')}]})['then'](handleEntityNotFound(_0x1a3ffb,null))[_0xc9b0('0x1d')](saveUpdates(_0xe47ea3[_0xc9b0('0x4b')],null))[_0xc9b0('0x1d')](function(_0x26440b){if(_0x26440b&&_0xe47ea3['body'][_0xc9b0('0x26')]){return db[_0xc9b0('0x48')]['update'](_0xe47ea3[_0xc9b0('0x4b')][_0xc9b0('0x26')],{'where':{'MailAccountId':_0x26440b['id']}})[_0xc9b0('0x1d')](function(){return _0x26440b;});}return _0x26440b;})[_0xc9b0('0x1d')](function(_0x93605a){if(_0x93605a&&_0xe47ea3[_0xc9b0('0x4b')][_0xc9b0('0x28')]){return db[_0xc9b0('0x27')][_0xc9b0('0x4a')](_0xe47ea3[_0xc9b0('0x4b')][_0xc9b0('0x28')],{'where':{'MailAccountId':_0x93605a['id']}})[_0xc9b0('0x1d')](function(){return _0x93605a;});}return _0x93605a;})['then'](respondWithResult(_0x1a3ffb,null))[_0xc9b0('0x45')](handleError(_0x1a3ffb,null));};exports[_0xc9b0('0x4d')]=function(_0x3c807c,_0x5c63f0){return db[_0xc9b0('0x2b')][_0xc9b0('0x4d')]()['then'](respondWithResult(_0x5c63f0,null))[_0xc9b0('0x45')](handleError(_0x5c63f0,null));};exports[_0xc9b0('0x4e')]=function(_0x4c6b59,_0x69823e){if(_0x4c6b59[_0xc9b0('0x4b')]['id']){delete _0x4c6b59[_0xc9b0('0x4b')]['id'];}return db[_0xc9b0('0x2b')][_0xc9b0('0x49')]({'where':{'id':_0x4c6b59[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x69823e,null))[_0xc9b0('0x1d')](function(_0x3fb41c){if(_0x3fb41c){_0x4c6b59[_0xc9b0('0x4b')]['MailAccountId']=_0x3fb41c['id'];return db['Disposition'][_0xc9b0('0x4f')](_0x4c6b59['body']);}})[_0xc9b0('0x1d')](respondWithResult(_0x69823e,null))[_0xc9b0('0x45')](handleError(_0x69823e,null));};exports[_0xc9b0('0x50')]=function(_0x44267f,_0x201e99){var _0x2fb4a7={'raw':![],'where':{}};var _0x11c052={};var _0x97ae38={'count':0x0,'rows':[]};return db['MailAccount'][_0xc9b0('0x51')]({'where':{'id':_0x44267f[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x201e99,null))[_0xc9b0('0x1d')](function(_0x529c20){if(_0x529c20){_0x11c052[_0xc9b0('0x35')]=_[_0xc9b0('0x32')](db['Disposition'][_0xc9b0('0x2c')]);_0x11c052[_0xc9b0('0x31')]=_[_0xc9b0('0x32')](_0x44267f[_0xc9b0('0x31')]);_0x11c052[_0xc9b0('0x33')]=_[_0xc9b0('0x34')](_0x11c052['model'],_0x11c052[_0xc9b0('0x31')]);_0x2fb4a7[_0xc9b0('0x37')]=_['intersection'](_0x11c052[_0xc9b0('0x35')],qs[_0xc9b0('0x36')](_0x44267f[_0xc9b0('0x31')][_0xc9b0('0x36')]));_0x2fb4a7['attributes']=_0x2fb4a7[_0xc9b0('0x37')]['length']?_0x2fb4a7[_0xc9b0('0x37')]:_0x11c052['model'];if(!_0x44267f[_0xc9b0('0x31')][_0xc9b0('0x52')](_0xc9b0('0x53'))){_0x2fb4a7[_0xc9b0('0x19')]=qs[_0xc9b0('0x19')](_0x44267f[_0xc9b0('0x31')][_0xc9b0('0x19')]);_0x2fb4a7[_0xc9b0('0x17')]=qs[_0xc9b0('0x17')](_0x44267f[_0xc9b0('0x31')]['offset']);}_0x2fb4a7['order']=qs[_0xc9b0('0x3a')](_0x44267f[_0xc9b0('0x31')][_0xc9b0('0x3a')]);_0x2fb4a7[_0xc9b0('0x3b')]=qs['filters'](_['pick'](_0x44267f[_0xc9b0('0x31')],_0x11c052[_0xc9b0('0x33')]));_0x2fb4a7[_0xc9b0('0x3b')][_0xc9b0('0x54')]=_0x529c20['id'];if(_0x44267f[_0xc9b0('0x31')][_0xc9b0('0x3d')]){_0x2fb4a7[_0xc9b0('0x3b')]=_[_0xc9b0('0x3f')](_0x2fb4a7[_0xc9b0('0x3b')],{'$or':_[_0xc9b0('0x30')](_0x2fb4a7[_0xc9b0('0x37')],function(_0x3ee75f){var _0x5849eb={};_0x5849eb[_0x3ee75f]={'$like':'%'+_0x44267f[_0xc9b0('0x31')][_0xc9b0('0x3d')]+'%'};return _0x5849eb;})});}_0x2fb4a7=_[_0xc9b0('0x3f')]({},_0x2fb4a7,_0x44267f['options']);return db[_0xc9b0('0x55')][_0xc9b0('0x1a')]({'where':_0x2fb4a7[_0xc9b0('0x3b')]})[_0xc9b0('0x1d')](function(_0x3c24f8){_0x97ae38[_0xc9b0('0x1a')]=_0x3c24f8;if(_0x44267f[_0xc9b0('0x31')][_0xc9b0('0x41')]){_0x2fb4a7[_0xc9b0('0x42')]=[{'all':!![]}];}return db[_0xc9b0('0x55')]['findAll'](_0x2fb4a7);})['then'](function(_0x115367){_0x97ae38[_0xc9b0('0x44')]=_0x115367;return _0x97ae38;});}})['then'](respondWithFilteredResult(_0x201e99,_0x2fb4a7))['catch'](handleError(_0x201e99,null));};exports[_0xc9b0('0x56')]=function(_0x536e48,_0x4dd3d4){return db[_0xc9b0('0x2b')][_0xc9b0('0x49')]({'where':{'id':_0x536e48[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x4dd3d4,null))['then'](function(_0x4a2c6d){if(_0x4a2c6d){return _0x4a2c6d[_0xc9b0('0x56')](_0x536e48['query'][_0xc9b0('0x57')]);}})[_0xc9b0('0x1d')](respondWithStatusCode(_0x4dd3d4,null))[_0xc9b0('0x45')](handleError(_0x4dd3d4,null));};exports[_0xc9b0('0x58')]=function(_0x5a66da,_0x2fce1e){if(_0x5a66da['body']['id']){delete _0x5a66da[_0xc9b0('0x4b')]['id'];}return db[_0xc9b0('0x2b')][_0xc9b0('0x49')]({'where':{'id':_0x5a66da[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x2fce1e,null))[_0xc9b0('0x1d')](function(_0x28972a){if(_0x28972a){_0x5a66da[_0xc9b0('0x4b')][_0xc9b0('0x54')]=_0x28972a['id'];return db[_0xc9b0('0x59')][_0xc9b0('0x4f')](_0x5a66da[_0xc9b0('0x4b')]);}})[_0xc9b0('0x1d')](respondWithResult(_0x2fce1e,null))['catch'](handleError(_0x2fce1e,null));};exports[_0xc9b0('0x5a')]=function(_0x2a7859,_0x1aa5e0){var _0x2871ff={'raw':![],'where':{}};var _0x313002={};var _0x57a69d={'count':0x0,'rows':[]};return db[_0xc9b0('0x2b')]['findOne']({'where':{'id':_0x2a7859['params']['id']}})['then'](handleEntityNotFound(_0x1aa5e0,null))[_0xc9b0('0x1d')](function(_0x379256){if(_0x379256){_0x313002[_0xc9b0('0x35')]=_[_0xc9b0('0x32')](db[_0xc9b0('0x59')][_0xc9b0('0x2c')]);_0x313002['query']=_['keys'](_0x2a7859['query']);_0x313002['filters']=_[_0xc9b0('0x34')](_0x313002[_0xc9b0('0x35')],_0x313002[_0xc9b0('0x31')]);_0x2871ff[_0xc9b0('0x37')]=_['intersection'](_0x313002['model'],qs[_0xc9b0('0x36')](_0x2a7859[_0xc9b0('0x31')]['fields']));_0x2871ff[_0xc9b0('0x37')]=_0x2871ff[_0xc9b0('0x37')][_0xc9b0('0x38')]?_0x2871ff[_0xc9b0('0x37')]:_0x313002[_0xc9b0('0x35')];if(!_0x2a7859[_0xc9b0('0x31')][_0xc9b0('0x52')](_0xc9b0('0x53'))){_0x2871ff[_0xc9b0('0x19')]=qs[_0xc9b0('0x19')](_0x2a7859['query'][_0xc9b0('0x19')]);_0x2871ff[_0xc9b0('0x17')]=qs[_0xc9b0('0x17')](_0x2a7859[_0xc9b0('0x31')]['offset']);}_0x2871ff[_0xc9b0('0x39')]=qs[_0xc9b0('0x3a')](_0x2a7859[_0xc9b0('0x31')][_0xc9b0('0x3a')]);_0x2871ff[_0xc9b0('0x3b')]=qs[_0xc9b0('0x33')](_['pick'](_0x2a7859['query'],_0x313002[_0xc9b0('0x33')]));_0x2871ff[_0xc9b0('0x3b')][_0xc9b0('0x54')]=_0x379256['id'];if(_0x2a7859[_0xc9b0('0x31')][_0xc9b0('0x3d')]){_0x2871ff['where']=_['merge'](_0x2871ff[_0xc9b0('0x3b')],{'$or':_['map'](_0x2871ff['attributes'],function(_0x1d388e){var _0x49507e={};_0x49507e[_0x1d388e]={'$like':'%'+_0x2a7859[_0xc9b0('0x31')][_0xc9b0('0x3d')]+'%'};return _0x49507e;})});}_0x2871ff=_[_0xc9b0('0x3f')]({},_0x2871ff,_0x2a7859[_0xc9b0('0x40')]);return db[_0xc9b0('0x59')][_0xc9b0('0x1a')]({'where':_0x2871ff[_0xc9b0('0x3b')]})[_0xc9b0('0x1d')](function(_0x17f44a){_0x57a69d[_0xc9b0('0x1a')]=_0x17f44a;if(_0x2a7859[_0xc9b0('0x31')][_0xc9b0('0x41')]){_0x2871ff[_0xc9b0('0x42')]=[{'all':!![]}];}return db[_0xc9b0('0x59')][_0xc9b0('0x43')](_0x2871ff);})[_0xc9b0('0x1d')](function(_0x1d9604){_0x57a69d[_0xc9b0('0x44')]=_0x1d9604;return _0x57a69d;});}})[_0xc9b0('0x1d')](respondWithFilteredResult(_0x1aa5e0,_0x2871ff))[_0xc9b0('0x45')](handleError(_0x1aa5e0,null));};exports[_0xc9b0('0x5b')]=function(_0x157f6c,_0x33a66e){return db[_0xc9b0('0x2b')][_0xc9b0('0x49')]({'where':{'id':_0x157f6c[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x33a66e,null))[_0xc9b0('0x1d')](function(_0x38c386){if(_0x38c386){return _0x38c386[_0xc9b0('0x5b')](_0x157f6c[_0xc9b0('0x31')][_0xc9b0('0x57')]);}})[_0xc9b0('0x1d')](respondWithStatusCode(_0x33a66e,null))[_0xc9b0('0x45')](handleError(_0x33a66e,null));};exports[_0xc9b0('0x4f')]=function(_0x473f18,_0x1283b5){var _0x139d94={'name':_0x473f18[_0xc9b0('0x4b')][_0xc9b0('0x23')],'key':_0x473f18[_0xc9b0('0x4b')][_0xc9b0('0x2f')],'provider':_0x473f18[_0xc9b0('0x4b')]['provider']===_0xc9b0('0x5c')?null:_0x473f18[_0xc9b0('0x4b')][_0xc9b0('0x5d')],'email':_0x473f18[_0xc9b0('0x4b')][_0xc9b0('0x5e')],'ListId':_0x473f18[_0xc9b0('0x4b')][_0xc9b0('0x5f')],'active':!_['isNil'](_0x473f18[_0xc9b0('0x4b')]['active'])?_0x473f18['body'][_0xc9b0('0x60')]:!![],'description':_0x473f18[_0xc9b0('0x4b')][_0xc9b0('0x61')]||null,'Imap':{},'Smtp':{}};if(_0x139d94[_0xc9b0('0x5d')]){_0x139d94['Imap']['user']=_0x139d94[_0xc9b0('0x28')][_0xc9b0('0x62')]=_0x473f18['body'][_0xc9b0('0x63')];_0x139d94[_0xc9b0('0x26')]['password']=_0x139d94['Smtp'][_0xc9b0('0x64')]=_0x473f18['body']['password'];if(_0x473f18['body'][_0xc9b0('0x65')]){_0x139d94[_0xc9b0('0x26')][_0xc9b0('0x65')]=_0x139d94['Smtp'][_0xc9b0('0x65')]=!![];_0x139d94['Imap'][_0xc9b0('0x4c')]=_0x139d94[_0xc9b0('0x28')][_0xc9b0('0x4c')]=_0x473f18[_0xc9b0('0x4b')][_0xc9b0('0x4c')];_0x139d94[_0xc9b0('0x26')][_0xc9b0('0x66')]=_0x139d94[_0xc9b0('0x28')][_0xc9b0('0x64')]=null;}else{_0x139d94[_0xc9b0('0x26')]['CloudProviderId']=_0x139d94[_0xc9b0('0x28')][_0xc9b0('0x4c')]=null;}_0x139d94[_0xc9b0('0x26')][_0xc9b0('0x67')]=_0x139d94['Smtp'][_0xc9b0('0x67')]=null;_0x139d94['Imap'][_0xc9b0('0x68')]=_0x139d94[_0xc9b0('0x28')][_0xc9b0('0x68')]=null;_0x139d94[_0xc9b0('0x26')][_0xc9b0('0x69')]=_0x139d94['Smtp'][_0xc9b0('0x69')]=null;}else{if(_0x473f18[_0xc9b0('0x4b')]['authentication']){_0x139d94['Imap']['user']=_0x139d94['Smtp'][_0xc9b0('0x62')]=_0x473f18[_0xc9b0('0x4b')][_0xc9b0('0x63')];_0x139d94[_0xc9b0('0x26')][_0xc9b0('0x66')]=_0x139d94[_0xc9b0('0x28')][_0xc9b0('0x64')]=_0x473f18[_0xc9b0('0x4b')]['password'];}else{_0x139d94[_0xc9b0('0x26')]['authentication']=_0x139d94['Smtp']['authentication']=![];_0x139d94[_0xc9b0('0x26')][_0xc9b0('0x62')]=_0x139d94[_0xc9b0('0x28')]['user']=null;_0x139d94[_0xc9b0('0x26')][_0xc9b0('0x66')]=_0x139d94['Smtp']['pass']=null;}_0x139d94['Imap'][_0xc9b0('0x68')]=_0x473f18['body'][_0xc9b0('0x26')]['host'];_0x139d94[_0xc9b0('0x26')][_0xc9b0('0x69')]=_0x473f18[_0xc9b0('0x4b')][_0xc9b0('0x26')]['port'];_0x139d94['Smtp'][_0xc9b0('0x68')]=_0x473f18[_0xc9b0('0x4b')][_0xc9b0('0x28')][_0xc9b0('0x68')];_0x139d94[_0xc9b0('0x28')]['port']=_0x473f18['body']['Smtp'][_0xc9b0('0x69')];}return db[_0xc9b0('0x2b')][_0xc9b0('0x4f')](_0x139d94,{'include':[{'model':db[_0xc9b0('0x27')],'as':'Smtp'},{'model':db[_0xc9b0('0x48')],'as':_0xc9b0('0x26')}]})[_0xc9b0('0x1d')](function(_0x5e004d){var _0xee0875=_0x473f18[_0xc9b0('0x62')][_0xc9b0('0x1f')]({'plain':!![]});if(!_0xee0875)throw new Error(_0xc9b0('0x6a'));if(_0xee0875[_0xc9b0('0x6b')]===_0xc9b0('0x62')){var _0x29dee8=_0x5e004d[_0xc9b0('0x1f')]({'plain':!![]});return db[_0xc9b0('0x6c')]['find']({'where':{'name':_0xc9b0('0x20'),'userProfileId':_0xee0875['userProfileId']},'raw':!![]})[_0xc9b0('0x1d')](function(_0xcd765){if(_0xcd765&&_0xcd765[_0xc9b0('0x6d')]===0x0){return db[_0xc9b0('0x21')][_0xc9b0('0x4f')]({'name':_0x29dee8[_0xc9b0('0x23')],'resourceId':_0x29dee8['id'],'type':_0xcd765[_0xc9b0('0x23')],'sectionId':_0xcd765['id']},{})[_0xc9b0('0x1d')](function(){return _0x5e004d;});}else{return _0x5e004d;}})[_0xc9b0('0x45')](function(_0xf72ceb){logger[_0xc9b0('0x11')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf72ceb);throw _0xf72ceb;});}return _0x5e004d;})[_0xc9b0('0x1d')](respondWithResult(_0x1283b5,0xc9))['catch'](handleError(_0x1283b5,null));};exports[_0xc9b0('0x6e')]=function(_0x419004,_0x50a944){return db[_0xc9b0('0x2b')][_0xc9b0('0x51')]({'where':{'id':_0x419004[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x50a944,null))[_0xc9b0('0x1d')](function(_0xa739a3){if(_0xa739a3){return _0xa739a3[_0xc9b0('0x6e')]();}return null;})[_0xc9b0('0x1d')](respondWithResult(_0x50a944,null))['catch'](handleError(_0x50a944,null));};exports['addImap']=function(_0x1a856d,_0x4223da){if(_0x1a856d[_0xc9b0('0x4b')]['id']){delete _0x1a856d[_0xc9b0('0x4b')]['id'];}return db[_0xc9b0('0x2b')]['find']({'where':{'id':_0x1a856d['params']['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x4223da,null))['then'](function(_0x292aea){if(_0x292aea){_0x1a856d[_0xc9b0('0x4b')][_0xc9b0('0x54')]=_0x292aea['id'];return db[_0xc9b0('0x48')][_0xc9b0('0x4f')](_0x1a856d[_0xc9b0('0x4b')]);}})[_0xc9b0('0x1d')](respondWithResult(_0x4223da,null))['catch'](handleError(_0x4223da,null));};exports[_0xc9b0('0x6f')]=function(_0x2ea85d,_0x165776){return db['MailAccount']['findOne']({'where':{'id':_0x2ea85d[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x165776,null))[_0xc9b0('0x1d')](function(_0x1470c0){if(_0x1470c0){return _0x1470c0[_0xc9b0('0x70')](null);}return null;})['then'](respondWithStatusCode(_0x165776,null))[_0xc9b0('0x45')](handleError(_0x165776,null));};exports[_0xc9b0('0x71')]=function(_0x3c0f23,_0x277f7f){return db[_0xc9b0('0x2b')][_0xc9b0('0x51')]({'where':{'id':_0x3c0f23[_0xc9b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x277f7f,null))[_0xc9b0('0x1d')](function(_0x1d7e2d){if(_0x1d7e2d){return _0x1d7e2d['getSmtp']();}return null;})[_0xc9b0('0x1d')](respondWithResult(_0x277f7f,null))[_0xc9b0('0x45')](handleError(_0x277f7f,null));};exports[_0xc9b0('0x72')]=function(_0xb0a38c,_0x13fa6f){if(_0xb0a38c['body']['id']){delete _0xb0a38c[_0xc9b0('0x4b')]['id'];}return db[_0xc9b0('0x2b')][_0xc9b0('0x49')]({'where':{'id':_0xb0a38c['params']['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x13fa6f,null))['then'](function(_0x984a78){if(_0x984a78){_0xb0a38c[_0xc9b0('0x4b')][_0xc9b0('0x54')]=_0x984a78['id'];return db['MailServerOut'][_0xc9b0('0x4f')](_0xb0a38c['body']);}})[_0xc9b0('0x1d')](respondWithResult(_0x13fa6f,null))[_0xc9b0('0x45')](handleError(_0x13fa6f,null));};exports['removeSmtp']=function(_0x265bd5,_0x1594ed){return db[_0xc9b0('0x2b')][_0xc9b0('0x51')]({'where':{'id':_0x265bd5[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x1594ed,null))['then'](function(_0x268423){if(_0x268423){return _0x268423[_0xc9b0('0x73')](null);}return null;})[_0xc9b0('0x1d')](respondWithStatusCode(_0x1594ed,null))[_0xc9b0('0x45')](handleError(_0x1594ed,null));};exports[_0xc9b0('0x74')]=function(_0x3520b6,_0x114371){return db[_0xc9b0('0x75')][_0xc9b0('0x49')]({'where':{'id':_0x3520b6['params']['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x114371,null))[_0xc9b0('0x1d')](function(_0x177d69){if(_0x177d69){return _0x177d69[_0xc9b0('0x74')](_0x3520b6[_0xc9b0('0x4b')][_0xc9b0('0x57')],_[_0xc9b0('0x76')](_0x3520b6[_0xc9b0('0x4b')],['ids','id'])||{});}})[_0xc9b0('0x1d')](respondWithResult(_0x114371,null))['catch'](handleError(_0x114371,null));};exports[_0xc9b0('0x77')]=function(_0x4c64e9,_0x14bd8e){var _0x7a2a74={'raw':![],'where':{}};var _0x5eb1c8={};var _0x6c86e={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x4c64e9[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x14bd8e,null))[_0xc9b0('0x1d')](function(_0x347e65){if(_0x347e65){_0x5eb1c8[_0xc9b0('0x35')]=_['keys'](db[_0xc9b0('0x75')][_0xc9b0('0x2c')]);_0x5eb1c8[_0xc9b0('0x31')]=_[_0xc9b0('0x32')](_0x4c64e9[_0xc9b0('0x31')]);_0x5eb1c8[_0xc9b0('0x33')]=_['intersection'](_0x5eb1c8[_0xc9b0('0x35')],_0x5eb1c8[_0xc9b0('0x31')]);_0x7a2a74['attributes']=_['intersection'](_0x5eb1c8[_0xc9b0('0x35')],qs[_0xc9b0('0x36')](_0x4c64e9[_0xc9b0('0x31')][_0xc9b0('0x36')]));_0x7a2a74[_0xc9b0('0x37')]=_0x7a2a74[_0xc9b0('0x37')][_0xc9b0('0x38')]?_0x7a2a74[_0xc9b0('0x37')]:_0x5eb1c8[_0xc9b0('0x35')];if(!_0x4c64e9[_0xc9b0('0x31')][_0xc9b0('0x52')]('nolimit')){_0x7a2a74[_0xc9b0('0x19')]=qs[_0xc9b0('0x19')](_0x4c64e9[_0xc9b0('0x31')][_0xc9b0('0x19')]);_0x7a2a74[_0xc9b0('0x17')]=qs[_0xc9b0('0x17')](_0x4c64e9[_0xc9b0('0x31')][_0xc9b0('0x17')]);}_0x7a2a74['order']=qs[_0xc9b0('0x3a')](_0x4c64e9['query'][_0xc9b0('0x3a')]);_0x7a2a74[_0xc9b0('0x3b')]=qs[_0xc9b0('0x33')](_['pick'](_0x4c64e9[_0xc9b0('0x31')],_0x5eb1c8[_0xc9b0('0x33')]));_0x7a2a74[_0xc9b0('0x3b')]['MailAccountId']=_0x347e65['id'];if(_0x4c64e9[_0xc9b0('0x31')][_0xc9b0('0x3d')]){_0x7a2a74[_0xc9b0('0x3b')]=_[_0xc9b0('0x3f')](_0x7a2a74['where'],{'$or':_['map'](_0x7a2a74[_0xc9b0('0x37')],function(_0x39ce81){var _0xe6c0ce={};_0xe6c0ce[_0x39ce81]={'$like':'%'+_0x4c64e9['query'][_0xc9b0('0x3d')]+'%'};return _0xe6c0ce;})});}_0x7a2a74=_[_0xc9b0('0x3f')]({},_0x7a2a74,_0x4c64e9[_0xc9b0('0x40')]);return db['MailInteraction']['count']({'where':_0x7a2a74[_0xc9b0('0x3b')]})['then'](function(_0x56923c){_0x6c86e[_0xc9b0('0x1a')]=_0x56923c;if(_0x4c64e9[_0xc9b0('0x31')][_0xc9b0('0x41')]){_0x7a2a74[_0xc9b0('0x42')]=[{'model':db[_0xc9b0('0x78')],'as':_0xc9b0('0x79'),'required':![]},{'model':db[_0xc9b0('0x7a')],'as':_0xc9b0('0x7b'),'attributes':[_0xc9b0('0x23'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xc9b0('0x23'),'color'],'where':_0x4c64e9[_0xc9b0('0x31')][_0xc9b0('0x7c')]?{'id':_0x4c64e9['query']['tag']}:undefined,'required':_0x4c64e9[_0xc9b0('0x31')]['tag']?!![]:![]}];}return db[_0xc9b0('0x75')][_0xc9b0('0x43')](_0x7a2a74);})[_0xc9b0('0x1d')](function(_0x595c49){_0x6c86e[_0xc9b0('0x44')]=_0x595c49;return _0x6c86e;});}})[_0xc9b0('0x1d')](respondWithFilteredResult(_0x14bd8e,_0x7a2a74))['catch'](handleError(_0x14bd8e,null));};exports[_0xc9b0('0x7d')]=function addApplications(_0x1988ea,_0x51210e){var _0x288c51=_0x1988ea[_0xc9b0('0x47')]['id'];var _0x292d8c=_0x1988ea[_0xc9b0('0x4b')];var _0x3089df=0xc8;var _0x2dc9ef=null;return db[_0xc9b0('0x7e')][_0xc9b0('0x7f')]({'isolationLevel':db[_0xc9b0('0x7e')][_0xc9b0('0x80')][_0xc9b0('0x81')][_0xc9b0('0x82')]},function(_0x26ee31){return db[_0xc9b0('0x2b')][_0xc9b0('0x51')]({'where':{'id':_0x288c51},'transaction':_0x26ee31})['then'](function(_0x80e2d6){if(_0x80e2d6){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x288c51},'transaction':_0x26ee31})[_0xc9b0('0x1d')](function(){var _0x2a4daf=_[_0xc9b0('0x30')](_0x292d8c,function(_0xf706f0){_0xf706f0['MailAccountId']=_0x288c51;return _0xf706f0;});return db['MailApplication'][_0xc9b0('0x83')](_0x2a4daf,{'transaction':_0x26ee31});});}else{_0x3089df=0x194;_0x2dc9ef=[];}});})[_0xc9b0('0x1d')](function(){if(_0x3089df!==0x194){return db[_0xc9b0('0x84')][_0xc9b0('0x85')]({'where':{'MailAccountId':_0x288c51},'order':_0xc9b0('0x86')})['then'](function(_0x4dbcec){_0x2dc9ef=_0x4dbcec;});}})[_0xc9b0('0x45')](function(_0x13e074){_0x3089df=0x1f4;logger['error'](_0x13e074[_0xc9b0('0x22')]);if(_0x13e074['name']){delete _0x13e074['name'];}_0x2dc9ef=_0x13e074;})[_0xc9b0('0x87')](function(){if(_0x2dc9ef===null){_0x51210e[_0xc9b0('0x15')](_0x3089df);}else{if(_0x3089df===0x1f4){_0x51210e['status'](_0x3089df)[_0xc9b0('0x24')](_0x2dc9ef);}else{_0x51210e[_0xc9b0('0x16')](_0x3089df)[_0xc9b0('0x88')](_0x2dc9ef);}}});};exports[_0xc9b0('0x89')]=function(_0x1f9df1,_0x1f1c2d){var _0x1cff79={};var _0x39f5ab={};var _0x5e77f8;var _0x39156d;return db['MailAccount'][_0xc9b0('0x51')]({'where':{'id':_0x1f9df1[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x1f1c2d,null))[_0xc9b0('0x1d')](function(_0x593a9e){if(_0x593a9e){_0x5e77f8=_0x593a9e;_0x39f5ab[_0xc9b0('0x35')]=_['keys'](db[_0xc9b0('0x84')]['rawAttributes']);_0x39f5ab[_0xc9b0('0x31')]=_[_0xc9b0('0x32')](_0x1f9df1[_0xc9b0('0x31')]);_0x39f5ab[_0xc9b0('0x33')]=_['intersection'](_0x39f5ab[_0xc9b0('0x35')],_0x39f5ab[_0xc9b0('0x31')]);_0x1cff79[_0xc9b0('0x37')]=_['intersection'](_0x39f5ab[_0xc9b0('0x35')],qs[_0xc9b0('0x36')](_0x1f9df1['query']['fields']));_0x1cff79[_0xc9b0('0x37')]=_0x1cff79['attributes']['length']?_0x1cff79[_0xc9b0('0x37')]:_0x39f5ab[_0xc9b0('0x35')];_0x1cff79[_0xc9b0('0x39')]=qs[_0xc9b0('0x3a')](_0x1f9df1[_0xc9b0('0x31')][_0xc9b0('0x3a')]);_0x1cff79[_0xc9b0('0x3b')]=qs[_0xc9b0('0x33')](_['pick'](_0x1f9df1['query'],_0x39f5ab['filters']));if(_0x1f9df1[_0xc9b0('0x31')][_0xc9b0('0x3d')]){_0x1cff79[_0xc9b0('0x3b')]=_[_0xc9b0('0x3f')](_0x1cff79[_0xc9b0('0x3b')],{'$or':_[_0xc9b0('0x30')](_0x1cff79['attributes'],function(_0x2a310b){var _0x411d67={};_0x411d67[_0x2a310b]={'$like':'%'+_0x1f9df1[_0xc9b0('0x31')][_0xc9b0('0x3d')]+'%'};return _0x411d67;})});}_0x1cff79=_[_0xc9b0('0x3f')]({},_0x1cff79,_0x1f9df1[_0xc9b0('0x40')]);return _0x5e77f8['getApplications'](_0x1cff79);}})[_0xc9b0('0x1d')](function(_0x313d57){if(_0x313d57){_0x39156d=_0x313d57[_0xc9b0('0x38')];if(!_0x1f9df1[_0xc9b0('0x31')][_0xc9b0('0x52')](_0xc9b0('0x53'))){_0x1cff79[_0xc9b0('0x19')]=qs[_0xc9b0('0x19')](_0x1f9df1['query']['limit']);_0x1cff79[_0xc9b0('0x17')]=qs[_0xc9b0('0x17')](_0x1f9df1[_0xc9b0('0x31')][_0xc9b0('0x17')]);}return _0x5e77f8['getApplications'](_0x1cff79);}})[_0xc9b0('0x1d')](function(_0x237a9f){if(_0x237a9f){return _0x237a9f?{'count':_0x39156d,'rows':_0x237a9f}:null;}})['then'](respondWithResult(_0x1f1c2d,null))[_0xc9b0('0x45')](handleError(_0x1f1c2d,null));};exports[_0xc9b0('0x8a')]=function(_0x26a186,_0x3e018b){var _0x1a37d4={'raw':!![],'where':{}};var _0x442270={};var _0x2001cb={'count':0x0,'rows':[]};return db[_0xc9b0('0x2b')]['findOne']({'where':{'id':_0x26a186[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x3e018b,null))['then'](function(_0x5aba5f){if(_0x5aba5f){_0x442270[_0xc9b0('0x35')]=_[_0xc9b0('0x32')](db[_0xc9b0('0x8b')][_0xc9b0('0x2c')]);_0x442270[_0xc9b0('0x31')]=_[_0xc9b0('0x32')](_0x26a186[_0xc9b0('0x31')]);_0x442270['filters']=_[_0xc9b0('0x34')](_0x442270[_0xc9b0('0x35')],_0x442270[_0xc9b0('0x31')]);_0x1a37d4[_0xc9b0('0x37')]=_[_0xc9b0('0x34')](_0x442270['model'],qs[_0xc9b0('0x36')](_0x26a186[_0xc9b0('0x31')][_0xc9b0('0x36')]));_0x1a37d4[_0xc9b0('0x37')]=_0x1a37d4[_0xc9b0('0x37')]['length']?_0x1a37d4[_0xc9b0('0x37')]:_0x442270[_0xc9b0('0x35')];if(!_0x26a186[_0xc9b0('0x31')][_0xc9b0('0x52')](_0xc9b0('0x53'))){_0x1a37d4[_0xc9b0('0x19')]=qs[_0xc9b0('0x19')](_0x26a186[_0xc9b0('0x31')][_0xc9b0('0x19')]);_0x1a37d4[_0xc9b0('0x17')]=qs[_0xc9b0('0x17')](_0x26a186[_0xc9b0('0x31')][_0xc9b0('0x17')]);}_0x1a37d4[_0xc9b0('0x39')]=qs[_0xc9b0('0x3a')](_0x26a186['query'][_0xc9b0('0x3a')]);_0x1a37d4[_0xc9b0('0x3b')]=qs[_0xc9b0('0x33')](_[_0xc9b0('0x3c')](_0x26a186[_0xc9b0('0x31')],_0x442270[_0xc9b0('0x33')]));_0x1a37d4['where'][_0xc9b0('0x54')]=_0x5aba5f['id'];if(_0x26a186[_0xc9b0('0x31')][_0xc9b0('0x3d')]){_0x1a37d4[_0xc9b0('0x3b')]=_[_0xc9b0('0x3f')](_0x1a37d4[_0xc9b0('0x3b')],{'$or':_[_0xc9b0('0x30')](_0x1a37d4[_0xc9b0('0x37')],function(_0x283f5e){var _0x4c4d78={};_0x4c4d78[_0x283f5e]={'$like':'%'+_0x26a186[_0xc9b0('0x31')][_0xc9b0('0x3d')]+'%'};return _0x4c4d78;})});}if(_0x26a186[_0xc9b0('0x31')]['$gte']){var _0x560070=_0x26a186[_0xc9b0('0x31')][_0xc9b0('0x8c')][_0xc9b0('0x8d')](',');var _0x1c9f0e={};_0x1c9f0e[_0x560070[0x0]]={'$gte':moment(_0x560070[0x1])[_0xc9b0('0x8e')](_0xc9b0('0x8f'))};_0x1a37d4['where']=_[_0xc9b0('0x3f')](_0x1a37d4[_0xc9b0('0x3b')],_0x1c9f0e);}_0x1a37d4=_[_0xc9b0('0x3f')]({},_0x1a37d4,_0x26a186[_0xc9b0('0x40')]);return db[_0xc9b0('0x8b')][_0xc9b0('0x1a')]({'where':_0x1a37d4[_0xc9b0('0x3b')]})[_0xc9b0('0x1d')](function(_0x3799b5){_0x2001cb[_0xc9b0('0x1a')]=_0x3799b5;if(_0x26a186[_0xc9b0('0x31')]['includeAll']){_0x1a37d4[_0xc9b0('0x42')]=[{'all':!![]}];}return db[_0xc9b0('0x8b')][_0xc9b0('0x43')](_0x1a37d4);})[_0xc9b0('0x1d')](function(_0x5088de){if(_0x26a186[_0xc9b0('0x31')]['inlineCss']===_0xc9b0('0x90')){for(var _0x514df6=0x0;_0x514df6<_0x5088de[_0xc9b0('0x38')];_0x514df6++){_0x5088de[_0x514df6][_0xc9b0('0x4b')]=juice(_0x5088de[_0x514df6][_0xc9b0('0x4b')]);}}_0x2001cb[_0xc9b0('0x44')]=_0x5088de;return _0x2001cb;});}})['then'](respondWithFilteredResult(_0x3e018b,_0x1a37d4))[_0xc9b0('0x45')](handleError(_0x3e018b,null));};exports[_0xc9b0('0x24')]=function(_0x3efafd,_0x284e5f){var _0x1bf215,_0x4f95f5={},_0x1464fc;if(_0x3efafd[_0xc9b0('0x4b')]['to']){_0x1464fc=_0x3efafd[_0xc9b0('0x4b')]['to'][_0xc9b0('0x8d')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x3efafd[_0xc9b0('0x47')]['id']},'include':[{'model':db[_0xc9b0('0x91')],'as':_0xc9b0('0x92'),'include':[{'model':db['CmContact'],'as':_0xc9b0('0x93'),'where':{'email':_0x1464fc},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xc9b0('0x27')],'as':_0xc9b0('0x28'),'raw':!![]}]})[_0xc9b0('0x1d')](handleEntityNotFound(_0x284e5f,null))[_0xc9b0('0x1d')](function(_0x2209dd){if(_0x2209dd){_0x1bf215=_0x2209dd;if(_0x2209dd[_0xc9b0('0x28')]){if(_[_0xc9b0('0x94')](_0x3efafd[_0xc9b0('0x4b')]['from'])){_0x3efafd[_0xc9b0('0x4b')]['from']=util[_0xc9b0('0x8e')](_0xc9b0('0x95'),_0x2209dd['name'],_0x2209dd[_0xc9b0('0x5e')]||_0x2209dd[_0xc9b0('0x28')][_0xc9b0('0x62')]);}if(_0x3efafd['body']['attachments']&&_0x3efafd[_0xc9b0('0x4b')][_0xc9b0('0x96')]['length']){for(var _0x2b17cb=0x0;_0x2b17cb<_0x3efafd[_0xc9b0('0x4b')]['attachments'][_0xc9b0('0x38')];_0x2b17cb+=0x1){_0x3efafd[_0xc9b0('0x4b')][_0xc9b0('0x96')][_0x2b17cb]={'filename':_0x3efafd[_0xc9b0('0x4b')]['attachments'][_0x2b17cb][_0xc9b0('0x23')],'path':path['join'](config['root'],_0xc9b0('0x97'),_0x3efafd[_0xc9b0('0x4b')][_0xc9b0('0x96')][_0x2b17cb]['basename'])};}}var _0x364bb2={'tls':{'rejectUnauthorized':![]}};if(_[_0xc9b0('0x94')](_0x2209dd[_0xc9b0('0x28')][_0xc9b0('0x67')])){if(_0x2209dd['Smtp'][_0xc9b0('0x98')]){_0x364bb2[_0xc9b0('0x99')]={'user':_0x2209dd['Smtp']['user'],'pass':_0x2209dd[_0xc9b0('0x28')]['pass']};}_0x364bb2['host']=_0x2209dd['Smtp'][_0xc9b0('0x68')];_0x364bb2[_0xc9b0('0x69')]=_0x2209dd['Smtp'][_0xc9b0('0x69')];_0x364bb2[_0xc9b0('0x9a')]=_0x2209dd[_0xc9b0('0x28')][_0xc9b0('0x9a')];}else{_0x364bb2[_0xc9b0('0x67')]=_0x2209dd['Smtp'][_0xc9b0('0x67')];_0x364bb2[_0xc9b0('0x99')]={'user':_0x2209dd[_0xc9b0('0x28')][_0xc9b0('0x62')],'pass':_0x2209dd[_0xc9b0('0x28')][_0xc9b0('0x64')]};}return respondWithRpcPromise('SendMail',_0xc9b0('0x9b'),{'account':_0x364bb2,'message':_0x3efafd['body']});}else{throw new Error(_0xc9b0('0x9c'));}}})[_0xc9b0('0x1d')](function(_0x1a39b8){if(_0x1a39b8){_0x4f95f5=_0x1a39b8;if(_0x1bf215[_0xc9b0('0x92')]){if(_0x1bf215[_0xc9b0('0x92')][_0xc9b0('0x93')][_0xc9b0('0x38')]){return _0x1bf215[_0xc9b0('0x92')]['Contacts'][0x0];}else{return db[_0xc9b0('0x78')][_0xc9b0('0x4f')](_[_0xc9b0('0x7')](_0x3efafd[_0xc9b0('0x4b')],{'firstName':_0x3efafd['body']['to'],'email':_0x3efafd[_0xc9b0('0x4b')]['to'],'phone':_0x3efafd[_0xc9b0('0x4b')]['to'],'ListId':_0x1bf215[_0xc9b0('0x5f')]}));}}else{throw new Error(_0xc9b0('0x9c'));}}})[_0xc9b0('0x1d')](function(_0x30e79f){if(_0x30e79f){var _0x4cf1e4={'UserId':_0x3efafd[_0xc9b0('0x62')]['id'],'ContactId':_0x30e79f['id'],'MailAccountId':_0x1bf215['id'],'inReplyTo':_0x4f95f5[_0xc9b0('0x9d')],'to':_0x3efafd['body'][_0xc9b0('0x9e')],'cc':_0x3efafd['body']['cc'],'subject':_0x3efafd[_0xc9b0('0x4b')][_0xc9b0('0x9f')],'attach':_0x3efafd[_0xc9b0('0x4b')]['attach'],'firstMsgDirection':_0xc9b0('0xa0'),'lastMsgAt':moment()[_0xc9b0('0x8e')](_0xc9b0('0x8f')),'lastMsgDirection':_0xc9b0('0xa0'),'Messages':[_[_0xc9b0('0x3f')](_0x3efafd[_0xc9b0('0x4b')],{'messageId':_0x4f95f5[_0xc9b0('0x9d')],'sentAt':moment()[_0xc9b0('0x8e')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x1bf215['id'],'UserId':_0x3efafd[_0xc9b0('0x62')]['id'],'ContactId':_0x30e79f['id']})]};if(_0x3efafd[_0xc9b0('0x4b')][_0xc9b0('0xa1')]){_0x4cf1e4=_[_0xc9b0('0x3f')](_0x4cf1e4,_0x3efafd[_0xc9b0('0x4b')][_0xc9b0('0xa1')]);}return db[_0xc9b0('0x75')][_0xc9b0('0x4f')](_0x4cf1e4,{'include':[{'model':db[_0xc9b0('0x8b')],'as':_0xc9b0('0xa2')}]});}})[_0xc9b0('0x1d')](respondWithResult(_0x284e5f,null))[_0xc9b0('0x45')](handleError(_0x284e5f,null));};exports[_0xc9b0('0xa3')]=function(_0x3d3cb3,_0x4a3181){return db[_0xc9b0('0x2b')][_0xc9b0('0x49')]({'where':{'id':_0x3d3cb3[_0xc9b0('0x47')]['id']},'include':[{'model':db[_0xc9b0('0x27')],'as':_0xc9b0('0x28'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc9b0('0xa4'),'raw':!![]}]}]})[_0xc9b0('0x1d')](handleEntityNotFound(_0x4a3181,null))[_0xc9b0('0x1d')](function(_0x1e5b80){if(!_0x1e5b80[_0xc9b0('0x28')])return;var _0x593d64={'id':_0x1e5b80['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1e5b80['provider']!==_0xc9b0('0x5c')){_0x593d64['service']=_0x1e5b80[_0xc9b0('0x5d')];}else{_0x593d64['host']=_0x1e5b80['Smtp'][_0xc9b0('0x68')];_0x593d64[_0xc9b0('0x69')]=_0x1e5b80[_0xc9b0('0x28')][_0xc9b0('0x69')];_0x593d64[_0xc9b0('0x9a')]=_0x1e5b80[_0xc9b0('0x28')]['secure'];}if(_0x1e5b80['Smtp'][_0xc9b0('0x98')]){if(_0x1e5b80['Smtp'][_0xc9b0('0x65')]){_0x593d64['auth']={'type':_0xc9b0('0xa5'),'user':_0x1e5b80[_0xc9b0('0x28')][_0xc9b0('0x62')],'accessToken':_0x1e5b80[_0xc9b0('0x28')]['CloudProvider'][_0xc9b0('0xa6')]};}else{_0x593d64[_0xc9b0('0x99')]={'user':_0x1e5b80[_0xc9b0('0x28')][_0xc9b0('0x62')],'pass':_0x1e5b80[_0xc9b0('0x28')][_0xc9b0('0x64')]};}}return respondWithRpcPromise(_0xc9b0('0xa7'),'verifySmtp',{'account':_0x593d64});})[_0xc9b0('0x1d')](respondWithResult(_0x4a3181,null))['catch'](handleError(_0x4a3181,null));};exports[_0xc9b0('0x1e')]=function(_0xd723bb,_0x39a41d){return db['MailAccount'][_0xc9b0('0x49')]({'where':{'id':_0xd723bb[_0xc9b0('0x47')]['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x39a41d,null))[_0xc9b0('0x1d')](function(_0x398556){if(_0x398556&&_0x398556['service']){throw new db[(_0xc9b0('0xa8'))][(_0xc9b0('0xa9'))](_0xc9b0('0xaa'));}return _0x398556;})[_0xc9b0('0x1d')](removeEntity(_0x39a41d,null))[_0xc9b0('0x45')](handleError(_0x39a41d,null));};exports[_0xc9b0('0xab')]=function(_0x55e541,_0x912847){return db[_0xc9b0('0x2b')][_0xc9b0('0x49')]({'where':{'id':_0x55e541['params']['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0x912847,null))[_0xc9b0('0x1d')](function(_0x42a806){if(_0x42a806){return _0x42a806[_0xc9b0('0xab')](_0x55e541[_0xc9b0('0x4b')][_0xc9b0('0x57')],_[_0xc9b0('0x76')](_0x55e541[_0xc9b0('0x4b')],[_0xc9b0('0x57'),'id'])||{})[_0xc9b0('0xac')](function(_0x91ea57){for(var _0x5146f3=0x0;_0x5146f3<_0x55e541[_0xc9b0('0x4b')][_0xc9b0('0x57')][_0xc9b0('0x38')];_0x5146f3+=0x1){socket[_0xc9b0('0xad')]('userMailAccount:save',{'UserId':Number(_0x55e541[_0xc9b0('0x4b')][_0xc9b0('0x57')][_0x5146f3]),'MailAccountId':Number(_0x55e541[_0xc9b0('0x47')]['id'])});}return _0x91ea57;});}})['then'](respondWithResult(_0x912847,null))[_0xc9b0('0x45')](handleError(_0x912847,null));};exports[_0xc9b0('0xae')]=function(_0x462743,_0x3a6fcb){return db['MailAccount']['find']({'where':{'id':_0x462743['params']['id']}})['then'](handleEntityNotFound(_0x3a6fcb,null))['then'](function(_0x5d7686){if(_0x5d7686){return _0x5d7686[_0xc9b0('0xae')](_0x462743['query'][_0xc9b0('0x57')])[_0xc9b0('0x1d')](function(){if(_[_0xc9b0('0xaf')](_0x462743[_0xc9b0('0x31')][_0xc9b0('0x57')])){for(var _0x54b303=0x0;_0x54b303<_0x462743['query'][_0xc9b0('0x57')]['length'];_0x54b303+=0x1){socket[_0xc9b0('0xad')](_0xc9b0('0xb0'),{'UserId':Number(_0x462743['query'][_0xc9b0('0x57')][_0x54b303]),'MailAccountId':Number(_0x462743[_0xc9b0('0x47')]['id'])});}}else{socket[_0xc9b0('0xad')]('userMailAccount:remove',{'UserId':Number(_0x462743[_0xc9b0('0x31')][_0xc9b0('0x57')]),'MailAccountId':Number(_0x462743[_0xc9b0('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x3a6fcb,null))[_0xc9b0('0x45')](handleError(_0x3a6fcb,null));};exports[_0xc9b0('0xb1')]=function(_0x48f8e3,_0xfc1053){var _0x3279b4={};var _0x3f2dc9={};var _0x48206b;var _0x554a05;return db[_0xc9b0('0x2b')][_0xc9b0('0x51')]({'where':{'id':_0x48f8e3['params']['id']}})[_0xc9b0('0x1d')](handleEntityNotFound(_0xfc1053,null))[_0xc9b0('0x1d')](function(_0x170284){if(_0x170284){_0x48206b=_0x170284;_0x3f2dc9[_0xc9b0('0x35')]=_[_0xc9b0('0x32')](db[_0xc9b0('0x7a')][_0xc9b0('0x2c')]);_0x3f2dc9[_0xc9b0('0x31')]=_[_0xc9b0('0x32')](_0x48f8e3['query']);_0x3f2dc9[_0xc9b0('0x33')]=_[_0xc9b0('0x34')](_0x3f2dc9['model'],_0x3f2dc9[_0xc9b0('0x31')]);_0x3279b4['attributes']=_[_0xc9b0('0x34')](_0x3f2dc9[_0xc9b0('0x35')],qs[_0xc9b0('0x36')](_0x48f8e3[_0xc9b0('0x31')][_0xc9b0('0x36')]));_0x3279b4[_0xc9b0('0x37')]=_0x3279b4[_0xc9b0('0x37')]['length']?_0x3279b4[_0xc9b0('0x37')]:_0x3f2dc9[_0xc9b0('0x35')];_0x3279b4[_0xc9b0('0x39')]=qs[_0xc9b0('0x3a')](_0x48f8e3[_0xc9b0('0x31')]['sort']);_0x3279b4[_0xc9b0('0x3b')]=qs[_0xc9b0('0x33')](_[_0xc9b0('0x3c')](_0x48f8e3[_0xc9b0('0x31')],_0x3f2dc9[_0xc9b0('0x33')]));if(_0x48f8e3[_0xc9b0('0x31')][_0xc9b0('0x3d')]){_0x3279b4[_0xc9b0('0x3b')]=_[_0xc9b0('0x3f')](_0x3279b4[_0xc9b0('0x3b')],{'$or':_[_0xc9b0('0x30')](_0x3279b4[_0xc9b0('0x37')],function(_0x4162be){var _0x41767b={};_0x41767b[_0x4162be]={'$like':'%'+_0x48f8e3[_0xc9b0('0x31')][_0xc9b0('0x3d')]+'%'};return _0x41767b;})});}_0x3279b4=_['merge']({},_0x3279b4,_0x48f8e3[_0xc9b0('0x40')]);return _0x48206b[_0xc9b0('0xb1')](_0x3279b4);}})[_0xc9b0('0x1d')](function(_0x51b3d7){if(_0x51b3d7){_0x554a05=_0x51b3d7[_0xc9b0('0x38')];if(!_0x48f8e3['query'][_0xc9b0('0x52')](_0xc9b0('0x53'))){_0x3279b4['limit']=qs[_0xc9b0('0x19')](_0x48f8e3[_0xc9b0('0x31')][_0xc9b0('0x19')]);_0x3279b4[_0xc9b0('0x17')]=qs['offset'](_0x48f8e3['query'][_0xc9b0('0x17')]);}return _0x48206b[_0xc9b0('0xb1')](_0x3279b4);}})['then'](function(_0x570ab1){if(_0x570ab1){return _0x570ab1?{'count':_0x554a05,'rows':_0x570ab1}:null;}})['then'](respondWithResult(_0xfc1053,null))['catch'](handleError(_0xfc1053,null));};
\ No newline at end of file
+var _0xaae7=['where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','Imap','keys','find','body','CloudProviderId','describe','MailAccountId','create','findOne','Disposition','rawAttributes','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','provider','custom','ListId','isNil','active','user','username','password','modernAuthentication','pass','service','host','port','authentication','get','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','send','List','CmContact','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','root','basename','auth','secure','sendMail','List\x20not\x20found','messageId','attach','out','Interaction','Messages','verifySmtp','CloudProvider','OAuth2','data5','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','getAgents','moment','util','path','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','MailAccounts','UserProfileResource','name','index','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2fe1f1,_0x49bd47){var _0x1f987b=function(_0x2bad00){while(--_0x2bad00){_0x2fe1f1['push'](_0x2fe1f1['shift']());}};_0x1f987b(++_0x49bd47);}(_0xaae7,0x1f0));var _0x7aae=function(_0x1c1ecf,_0x392c6b){_0x1c1ecf=_0x1c1ecf-0x0;var _0x5ae5d8=_0xaae7[_0x1c1ecf];return _0x5ae5d8;};'use strict';var moment=require(_0x7aae('0x0'));var BPromise=require('bluebird');var util=require(_0x7aae('0x1'));var path=require(_0x7aae('0x2'));var _=require(_0x7aae('0x3'));var juice=require(_0x7aae('0x4'));var Redis=require('ioredis');var qs=require(_0x7aae('0x5'));var logger=require(_0x7aae('0x6'))(_0x7aae('0x7'));var config=require('../../config/environment');var db=require(_0x7aae('0x8'))['db'];config[_0x7aae('0x9')]=_[_0x7aae('0xa')](config[_0x7aae('0x9')],{'host':_0x7aae('0xb'),'port':0x18eb});var socket=require(_0x7aae('0xc'))(new Redis(config[_0x7aae('0x9')]));require(_0x7aae('0xd'))[_0x7aae('0xe')](socket);var jayson=require(_0x7aae('0xf'));var client=jayson[_0x7aae('0x10')][_0x7aae('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x5a0017,_0x2df356,_0x2141b7,_0x43c4d2){return new BPromise(function(_0x544272,_0x5dd2c5){var _0x556394=_0x43c4d2||client;return _0x556394[_0x7aae('0x12')](_0x5a0017,_0x2141b7)[_0x7aae('0x13')](function(_0x49d877){logger['info'](_0x7aae('0x14'),_0x2df356,_0x7aae('0x15'));logger[_0x7aae('0x16')](_0x7aae('0x17'),_0x2df356,_0x7aae('0x15'),JSON[_0x7aae('0x18')](_0x49d877));if(_0x49d877[_0x7aae('0x19')]){if(_0x49d877[_0x7aae('0x19')]['code']===0x1f4){logger['error'](_0x7aae('0x14'),_0x2df356,_0x49d877[_0x7aae('0x19')][_0x7aae('0x1a')]);return _0x5dd2c5(_0x49d877[_0x7aae('0x19')][_0x7aae('0x1a')]);}logger[_0x7aae('0x19')](_0x7aae('0x14'),_0x2df356,_0x49d877[_0x7aae('0x19')][_0x7aae('0x1a')]);return _0x544272(_0x49d877[_0x7aae('0x19')][_0x7aae('0x1a')]);}else{logger[_0x7aae('0x1b')](_0x7aae('0x14'),_0x2df356,_0x7aae('0x15'));_0x544272(_0x49d877[_0x7aae('0x1c')]['message']);}})[_0x7aae('0x1d')](function(_0x49bfac){logger[_0x7aae('0x19')]('MailAccount,\x20%s,\x20%s',_0x2df356,_0x49bfac);_0x5dd2c5(_0x49bfac);});});}function respondWithStatusCode(_0x11bda3,_0x3b97e4){_0x3b97e4=_0x3b97e4||0xcc;return function(_0x43befc){if(_0x43befc){return _0x11bda3[_0x7aae('0x1e')](_0x3b97e4);}return _0x11bda3[_0x7aae('0x1f')](_0x3b97e4)['end']();};}function respondWithResult(_0x5ed847,_0x1d0de1){_0x1d0de1=_0x1d0de1||0xc8;return function(_0x2fcc5c){if(_0x2fcc5c){return _0x5ed847[_0x7aae('0x1f')](_0x1d0de1)[_0x7aae('0x20')](_0x2fcc5c);}};}function respondWithFilteredResult(_0x28a7b9,_0x4f5c5c){return function(_0x43aa57){if(_0x43aa57){var _0x3cc851=typeof _0x4f5c5c[_0x7aae('0x21')]===_0x7aae('0x22')&&typeof _0x4f5c5c[_0x7aae('0x23')]===_0x7aae('0x22');var _0x5d87d0=_0x43aa57['count'];var _0x16bb07=_0x3cc851?0x0:_0x4f5c5c[_0x7aae('0x21')];var _0x2af940=_0x3cc851?_0x43aa57[_0x7aae('0x24')]:_0x4f5c5c[_0x7aae('0x21')]+_0x4f5c5c['limit'];var _0x4a9794;if(_0x2af940>=_0x5d87d0){_0x2af940=_0x5d87d0;_0x4a9794=0xc8;}else{_0x4a9794=0xce;}_0x28a7b9[_0x7aae('0x1f')](_0x4a9794);return _0x28a7b9[_0x7aae('0x25')](_0x7aae('0x26'),_0x16bb07+'-'+_0x2af940+'/'+_0x5d87d0)['json'](_0x43aa57);}return null;};}function saveUpdates(_0x464684){return function(_0x1fda75){if(_0x1fda75){return _0x1fda75[_0x7aae('0x27')](_0x464684)[_0x7aae('0x13')](function(_0x4619f3){return _0x4619f3;});}return null;};}function removeEntity(_0x3e76b1){return function(_0xbb5ed5){if(_0xbb5ed5){return _0xbb5ed5['destroy']()[_0x7aae('0x13')](function(){var _0x47b8e1=_0xbb5ed5['get']({'plain':!![]});var _0x3962f3=_0x7aae('0x28');return db[_0x7aae('0x29')]['destroy']({'where':{'type':_0x3962f3,'resourceId':_0x47b8e1['id']}})['then'](function(){return _0xbb5ed5;});})[_0x7aae('0x13')](function(){_0x3e76b1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5974e9){return function(_0x4377b6){if(!_0x4377b6){_0x5974e9[_0x7aae('0x1e')](0x194);}return _0x4377b6;};}function handleError(_0x30ea9b,_0x41bd01){_0x41bd01=_0x41bd01||0x1f4;return function(_0x107d7b){logger['error'](_0x107d7b['stack']);if(_0x107d7b['name']){delete _0x107d7b[_0x7aae('0x2a')];}_0x30ea9b[_0x7aae('0x1f')](_0x41bd01)['send'](_0x107d7b);};}exports[_0x7aae('0x2b')]=function(_0x369006,_0x41304b){var _0x558bbf={'include':[{'model':db[_0x7aae('0x2c')],'as':'Imap'},{'model':db[_0x7aae('0x2d')],'as':_0x7aae('0x2e')},{'model':db[_0x7aae('0x2f')],'as':_0x7aae('0x30')}]},_0x1ebac0={},_0xdfa014={'count':0x0,'rows':[]};var _0x580e41=_[_0x7aae('0x31')](db[_0x7aae('0x32')]['rawAttributes'],function(_0x225051){return{'name':_0x225051[_0x7aae('0x33')],'type':_0x225051[_0x7aae('0x34')][_0x7aae('0x35')]};});_0x1ebac0[_0x7aae('0x36')]=_[_0x7aae('0x31')](_0x580e41,_0x7aae('0x2a'));_0x1ebac0[_0x7aae('0x37')]=_['keys'](_0x369006[_0x7aae('0x37')]);_0x1ebac0[_0x7aae('0x38')]=_[_0x7aae('0x39')](_0x1ebac0[_0x7aae('0x36')],_0x1ebac0[_0x7aae('0x37')]);_0x558bbf[_0x7aae('0x3a')]=_['intersection'](_0x1ebac0['model'],qs[_0x7aae('0x3b')](_0x369006['query']['fields']));_0x558bbf[_0x7aae('0x3a')]=_0x558bbf[_0x7aae('0x3a')][_0x7aae('0x3c')]?_0x558bbf[_0x7aae('0x3a')]:_0x1ebac0['model'];if(!_0x369006[_0x7aae('0x37')][_0x7aae('0x3d')](_0x7aae('0x3e'))){_0x558bbf[_0x7aae('0x23')]=qs['limit'](_0x369006[_0x7aae('0x37')][_0x7aae('0x23')]);_0x558bbf[_0x7aae('0x21')]=qs[_0x7aae('0x21')](_0x369006['query'][_0x7aae('0x21')]);}_0x558bbf[_0x7aae('0x3f')]=qs[_0x7aae('0x40')](_0x369006[_0x7aae('0x37')]['sort']);_0x558bbf[_0x7aae('0x41')]=qs[_0x7aae('0x38')](_[_0x7aae('0x42')](_0x369006[_0x7aae('0x37')],_0x1ebac0[_0x7aae('0x38')]),_0x580e41);if(_0x369006[_0x7aae('0x37')][_0x7aae('0x43')]){_0x558bbf[_0x7aae('0x41')]=_['merge'](_0x558bbf[_0x7aae('0x41')],{'$or':_[_0x7aae('0x31')](_0x580e41,function(_0xc4ff2b){if(_0xc4ff2b[_0x7aae('0x34')]!==_0x7aae('0x44')){var _0xc1daed={};_0xc1daed[_0xc4ff2b['name']]={'$like':'%'+_0x369006[_0x7aae('0x37')]['filter']+'%'};return _0xc1daed;}})});}_0x558bbf=_[_0x7aae('0x45')]({},_0x558bbf,_0x369006[_0x7aae('0x46')]);var _0x59ae87={'where':_0x558bbf['where']};return db['MailAccount'][_0x7aae('0x24')](_0x59ae87)['then'](function(_0x4ca230){_0xdfa014[_0x7aae('0x24')]=_0x4ca230;if(_0x369006[_0x7aae('0x37')][_0x7aae('0x47')]){_0x558bbf[_0x7aae('0x48')]=[{'all':!![]}];}return db['MailAccount'][_0x7aae('0x49')](_0x558bbf);})[_0x7aae('0x13')](function(_0x137db4){_0xdfa014[_0x7aae('0x4a')]=_0x137db4;return _0xdfa014;})[_0x7aae('0x13')](respondWithFilteredResult(_0x41304b,_0x558bbf))[_0x7aae('0x1d')](handleError(_0x41304b,null));};exports[_0x7aae('0x4b')]=function(_0xd3ea1b,_0x297d31){var _0x86a278={'raw':![],'where':{'id':_0xd3ea1b[_0x7aae('0x4c')]['id']},'include':[{'model':db[_0x7aae('0x2c')],'as':_0x7aae('0x4d')},{'model':db[_0x7aae('0x2d')],'as':'Smtp'},{'model':db['Pause'],'as':_0x7aae('0x30')}]},_0x57e625={};_0x57e625['model']=_[_0x7aae('0x4e')](db['MailAccount']['rawAttributes']);_0x57e625[_0x7aae('0x37')]=_['keys'](_0xd3ea1b[_0x7aae('0x37')]);_0x57e625[_0x7aae('0x38')]=_['intersection'](_0x57e625[_0x7aae('0x36')],_0x57e625[_0x7aae('0x37')]);_0x86a278[_0x7aae('0x3a')]=_[_0x7aae('0x39')](_0x57e625[_0x7aae('0x36')],qs['fields'](_0xd3ea1b[_0x7aae('0x37')][_0x7aae('0x3b')]));_0x86a278[_0x7aae('0x3a')]=_0x86a278['attributes']['length']?_0x86a278[_0x7aae('0x3a')]:_0x57e625[_0x7aae('0x36')];if(_0xd3ea1b['query'][_0x7aae('0x47')]){_0x86a278[_0x7aae('0x48')]=[{'all':!![]}];}_0x86a278=_[_0x7aae('0x45')]({},_0x86a278,_0xd3ea1b['options']);return db['MailAccount'][_0x7aae('0x4f')](_0x86a278)[_0x7aae('0x13')](handleEntityNotFound(_0x297d31,null))[_0x7aae('0x13')](respondWithResult(_0x297d31,null))[_0x7aae('0x1d')](handleError(_0x297d31,null));};exports[_0x7aae('0x27')]=function(_0xd647fa,_0x5081f6){if(_0xd647fa['body']['id']){delete _0xd647fa[_0x7aae('0x50')]['id'];}if(_0xd647fa[_0x7aae('0x50')][_0x7aae('0x4d')]){if(!_0xd647fa[_0x7aae('0x50')][_0x7aae('0x4d')]['modernAuthentication']){_0xd647fa['body'][_0x7aae('0x4d')][_0x7aae('0x51')]=null;}}if(_0xd647fa[_0x7aae('0x50')][_0x7aae('0x2e')]){if(!_0xd647fa['body'][_0x7aae('0x2e')]['modernAuthentication']){_0xd647fa[_0x7aae('0x50')]['Smtp'][_0x7aae('0x51')]=null;}}return db['MailAccount']['find']({'where':{'id':_0xd647fa[_0x7aae('0x4c')]['id']},'include':[{'model':db[_0x7aae('0x2c')],'as':_0x7aae('0x4d')},{'model':db[_0x7aae('0x2d')],'as':_0x7aae('0x2e')},{'model':db['Pause'],'as':_0x7aae('0x30')}]})[_0x7aae('0x13')](handleEntityNotFound(_0x5081f6,null))[_0x7aae('0x13')](saveUpdates(_0xd647fa[_0x7aae('0x50')],null))[_0x7aae('0x13')](function(_0x5b7d66){if(_0x5b7d66&&_0xd647fa['body'][_0x7aae('0x4d')]){return db['MailServerIn'][_0x7aae('0x27')](_0xd647fa[_0x7aae('0x50')][_0x7aae('0x4d')],{'where':{'MailAccountId':_0x5b7d66['id']}})[_0x7aae('0x13')](function(){return _0x5b7d66;});}return _0x5b7d66;})['then'](function(_0xf852fe){if(_0xf852fe&&_0xd647fa[_0x7aae('0x50')][_0x7aae('0x2e')]){return db['MailServerOut'][_0x7aae('0x27')](_0xd647fa[_0x7aae('0x50')][_0x7aae('0x2e')],{'where':{'MailAccountId':_0xf852fe['id']}})[_0x7aae('0x13')](function(){return _0xf852fe;});}return _0xf852fe;})[_0x7aae('0x13')](respondWithResult(_0x5081f6,null))['catch'](handleError(_0x5081f6,null));};exports['describe']=function(_0x363bba,_0x38bd7d){return db[_0x7aae('0x32')][_0x7aae('0x52')]()[_0x7aae('0x13')](respondWithResult(_0x38bd7d,null))[_0x7aae('0x1d')](handleError(_0x38bd7d,null));};exports['addDisposition']=function(_0x4a3e5d,_0x132aac){if(_0x4a3e5d[_0x7aae('0x50')]['id']){delete _0x4a3e5d[_0x7aae('0x50')]['id'];}return db[_0x7aae('0x32')][_0x7aae('0x4f')]({'where':{'id':_0x4a3e5d[_0x7aae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x132aac,null))['then'](function(_0x5f509d){if(_0x5f509d){_0x4a3e5d[_0x7aae('0x50')][_0x7aae('0x53')]=_0x5f509d['id'];return db['Disposition'][_0x7aae('0x54')](_0x4a3e5d[_0x7aae('0x50')]);}})['then'](respondWithResult(_0x132aac,null))[_0x7aae('0x1d')](handleError(_0x132aac,null));};exports['getDispositions']=function(_0xb8d8a1,_0xc28083){var _0x1b21c5={'raw':![],'where':{}};var _0xad4484={};var _0x35ff35={'count':0x0,'rows':[]};return db[_0x7aae('0x32')][_0x7aae('0x55')]({'where':{'id':_0xb8d8a1['params']['id']}})['then'](handleEntityNotFound(_0xc28083,null))['then'](function(_0x1f8f63){if(_0x1f8f63){_0xad4484['model']=_[_0x7aae('0x4e')](db[_0x7aae('0x56')][_0x7aae('0x57')]);_0xad4484[_0x7aae('0x37')]=_[_0x7aae('0x4e')](_0xb8d8a1[_0x7aae('0x37')]);_0xad4484['filters']=_[_0x7aae('0x39')](_0xad4484[_0x7aae('0x36')],_0xad4484[_0x7aae('0x37')]);_0x1b21c5[_0x7aae('0x3a')]=_[_0x7aae('0x39')](_0xad4484[_0x7aae('0x36')],qs[_0x7aae('0x3b')](_0xb8d8a1['query']['fields']));_0x1b21c5['attributes']=_0x1b21c5[_0x7aae('0x3a')][_0x7aae('0x3c')]?_0x1b21c5[_0x7aae('0x3a')]:_0xad4484[_0x7aae('0x36')];if(!_0xb8d8a1['query'][_0x7aae('0x3d')](_0x7aae('0x3e'))){_0x1b21c5[_0x7aae('0x23')]=qs[_0x7aae('0x23')](_0xb8d8a1[_0x7aae('0x37')][_0x7aae('0x23')]);_0x1b21c5[_0x7aae('0x21')]=qs['offset'](_0xb8d8a1['query'][_0x7aae('0x21')]);}_0x1b21c5[_0x7aae('0x3f')]=qs[_0x7aae('0x40')](_0xb8d8a1[_0x7aae('0x37')][_0x7aae('0x40')]);_0x1b21c5['where']=qs['filters'](_[_0x7aae('0x42')](_0xb8d8a1[_0x7aae('0x37')],_0xad4484['filters']));_0x1b21c5['where'][_0x7aae('0x53')]=_0x1f8f63['id'];if(_0xb8d8a1[_0x7aae('0x37')]['filter']){_0x1b21c5['where']=_[_0x7aae('0x45')](_0x1b21c5[_0x7aae('0x41')],{'$or':_[_0x7aae('0x31')](_0x1b21c5[_0x7aae('0x3a')],function(_0x3deee6){var _0x2065ca={};_0x2065ca[_0x3deee6]={'$like':'%'+_0xb8d8a1[_0x7aae('0x37')][_0x7aae('0x43')]+'%'};return _0x2065ca;})});}_0x1b21c5=_[_0x7aae('0x45')]({},_0x1b21c5,_0xb8d8a1[_0x7aae('0x46')]);return db['Disposition'][_0x7aae('0x24')]({'where':_0x1b21c5[_0x7aae('0x41')]})[_0x7aae('0x13')](function(_0x4397bf){_0x35ff35['count']=_0x4397bf;if(_0xb8d8a1[_0x7aae('0x37')][_0x7aae('0x47')]){_0x1b21c5[_0x7aae('0x48')]=[{'all':!![]}];}return db[_0x7aae('0x56')][_0x7aae('0x49')](_0x1b21c5);})[_0x7aae('0x13')](function(_0x7fce0f){_0x35ff35[_0x7aae('0x4a')]=_0x7fce0f;return _0x35ff35;});}})['then'](respondWithFilteredResult(_0xc28083,_0x1b21c5))['catch'](handleError(_0xc28083,null));};exports[_0x7aae('0x58')]=function(_0x1530ea,_0x42b340){return db[_0x7aae('0x32')][_0x7aae('0x4f')]({'where':{'id':_0x1530ea[_0x7aae('0x4c')]['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x42b340,null))[_0x7aae('0x13')](function(_0x406ce4){if(_0x406ce4){return _0x406ce4[_0x7aae('0x58')](_0x1530ea['query']['ids']);}})[_0x7aae('0x13')](respondWithStatusCode(_0x42b340,null))[_0x7aae('0x1d')](handleError(_0x42b340,null));};exports[_0x7aae('0x59')]=function(_0x254b5e,_0x50b639){if(_0x254b5e[_0x7aae('0x50')]['id']){delete _0x254b5e['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x254b5e['params']['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x50b639,null))[_0x7aae('0x13')](function(_0x13730b){if(_0x13730b){_0x254b5e[_0x7aae('0x50')]['MailAccountId']=_0x13730b['id'];return db[_0x7aae('0x5a')]['create'](_0x254b5e[_0x7aae('0x50')]);}})['then'](respondWithResult(_0x50b639,null))[_0x7aae('0x1d')](handleError(_0x50b639,null));};exports[_0x7aae('0x5b')]=function(_0x25b0c7,_0x49a393){var _0x49e5b6={'raw':![],'where':{}};var _0x4101eb={};var _0x516350={'count':0x0,'rows':[]};return db[_0x7aae('0x32')][_0x7aae('0x55')]({'where':{'id':_0x25b0c7[_0x7aae('0x4c')]['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x49a393,null))[_0x7aae('0x13')](function(_0x5f2604){if(_0x5f2604){_0x4101eb[_0x7aae('0x36')]=_[_0x7aae('0x4e')](db[_0x7aae('0x5a')][_0x7aae('0x57')]);_0x4101eb[_0x7aae('0x37')]=_[_0x7aae('0x4e')](_0x25b0c7['query']);_0x4101eb[_0x7aae('0x38')]=_[_0x7aae('0x39')](_0x4101eb[_0x7aae('0x36')],_0x4101eb[_0x7aae('0x37')]);_0x49e5b6['attributes']=_[_0x7aae('0x39')](_0x4101eb[_0x7aae('0x36')],qs[_0x7aae('0x3b')](_0x25b0c7[_0x7aae('0x37')][_0x7aae('0x3b')]));_0x49e5b6[_0x7aae('0x3a')]=_0x49e5b6[_0x7aae('0x3a')]['length']?_0x49e5b6[_0x7aae('0x3a')]:_0x4101eb[_0x7aae('0x36')];if(!_0x25b0c7[_0x7aae('0x37')][_0x7aae('0x3d')]('nolimit')){_0x49e5b6[_0x7aae('0x23')]=qs[_0x7aae('0x23')](_0x25b0c7['query'][_0x7aae('0x23')]);_0x49e5b6[_0x7aae('0x21')]=qs[_0x7aae('0x21')](_0x25b0c7[_0x7aae('0x37')][_0x7aae('0x21')]);}_0x49e5b6[_0x7aae('0x3f')]=qs[_0x7aae('0x40')](_0x25b0c7['query'][_0x7aae('0x40')]);_0x49e5b6[_0x7aae('0x41')]=qs[_0x7aae('0x38')](_[_0x7aae('0x42')](_0x25b0c7['query'],_0x4101eb[_0x7aae('0x38')]));_0x49e5b6[_0x7aae('0x41')][_0x7aae('0x53')]=_0x5f2604['id'];if(_0x25b0c7[_0x7aae('0x37')][_0x7aae('0x43')]){_0x49e5b6[_0x7aae('0x41')]=_[_0x7aae('0x45')](_0x49e5b6['where'],{'$or':_[_0x7aae('0x31')](_0x49e5b6[_0x7aae('0x3a')],function(_0x595cb6){var _0x1946a2={};_0x1946a2[_0x595cb6]={'$like':'%'+_0x25b0c7[_0x7aae('0x37')]['filter']+'%'};return _0x1946a2;})});}_0x49e5b6=_[_0x7aae('0x45')]({},_0x49e5b6,_0x25b0c7[_0x7aae('0x46')]);return db['CannedAnswer'][_0x7aae('0x24')]({'where':_0x49e5b6[_0x7aae('0x41')]})[_0x7aae('0x13')](function(_0x35a16d){_0x516350['count']=_0x35a16d;if(_0x25b0c7[_0x7aae('0x37')]['includeAll']){_0x49e5b6['include']=[{'all':!![]}];}return db[_0x7aae('0x5a')][_0x7aae('0x49')](_0x49e5b6);})[_0x7aae('0x13')](function(_0x36c01f){_0x516350[_0x7aae('0x4a')]=_0x36c01f;return _0x516350;});}})[_0x7aae('0x13')](respondWithFilteredResult(_0x49a393,_0x49e5b6))['catch'](handleError(_0x49a393,null));};exports[_0x7aae('0x5c')]=function(_0x2f98e9,_0x3fc3a1){return db['MailAccount'][_0x7aae('0x4f')]({'where':{'id':_0x2f98e9[_0x7aae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3fc3a1,null))[_0x7aae('0x13')](function(_0x597722){if(_0x597722){return _0x597722[_0x7aae('0x5c')](_0x2f98e9[_0x7aae('0x37')][_0x7aae('0x5d')]);}})['then'](respondWithStatusCode(_0x3fc3a1,null))[_0x7aae('0x1d')](handleError(_0x3fc3a1,null));};exports[_0x7aae('0x54')]=function(_0x498ff4,_0x3c7c70){var _0x14d772={'name':_0x498ff4['body'][_0x7aae('0x2a')],'key':_0x498ff4[_0x7aae('0x50')][_0x7aae('0x35')],'provider':_0x498ff4[_0x7aae('0x50')][_0x7aae('0x5e')]===_0x7aae('0x5f')?null:_0x498ff4['body'][_0x7aae('0x5e')],'email':_0x498ff4[_0x7aae('0x50')]['email'],'ListId':_0x498ff4[_0x7aae('0x50')][_0x7aae('0x60')],'active':!_[_0x7aae('0x61')](_0x498ff4[_0x7aae('0x50')][_0x7aae('0x62')])?_0x498ff4['body'][_0x7aae('0x62')]:!![],'description':_0x498ff4[_0x7aae('0x50')]['description']||null,'Imap':{},'Smtp':{}};if(_0x14d772[_0x7aae('0x5e')]){_0x14d772[_0x7aae('0x4d')][_0x7aae('0x63')]=_0x14d772[_0x7aae('0x2e')][_0x7aae('0x63')]=_0x498ff4['body'][_0x7aae('0x64')];_0x14d772[_0x7aae('0x4d')]['password']=_0x14d772[_0x7aae('0x2e')]['pass']=_0x498ff4[_0x7aae('0x50')][_0x7aae('0x65')];if(_0x498ff4[_0x7aae('0x50')][_0x7aae('0x66')]){_0x14d772[_0x7aae('0x4d')][_0x7aae('0x66')]=_0x14d772['Smtp'][_0x7aae('0x66')]=!![];_0x14d772[_0x7aae('0x4d')][_0x7aae('0x51')]=_0x14d772[_0x7aae('0x2e')]['CloudProviderId']=_0x498ff4['body'][_0x7aae('0x51')];_0x14d772[_0x7aae('0x4d')][_0x7aae('0x65')]=_0x14d772['Smtp'][_0x7aae('0x67')]=null;}else{_0x14d772[_0x7aae('0x4d')]['CloudProviderId']=_0x14d772[_0x7aae('0x2e')][_0x7aae('0x51')]=null;}_0x14d772[_0x7aae('0x4d')][_0x7aae('0x68')]=_0x14d772['Smtp'][_0x7aae('0x68')]=null;_0x14d772[_0x7aae('0x4d')][_0x7aae('0x69')]=_0x14d772[_0x7aae('0x2e')]['host']=null;_0x14d772[_0x7aae('0x4d')][_0x7aae('0x6a')]=_0x14d772[_0x7aae('0x2e')][_0x7aae('0x6a')]=null;}else{if(_0x498ff4[_0x7aae('0x50')][_0x7aae('0x6b')]){_0x14d772['Imap'][_0x7aae('0x63')]=_0x14d772[_0x7aae('0x2e')][_0x7aae('0x63')]=_0x498ff4[_0x7aae('0x50')][_0x7aae('0x64')];_0x14d772['Imap'][_0x7aae('0x65')]=_0x14d772[_0x7aae('0x2e')][_0x7aae('0x67')]=_0x498ff4[_0x7aae('0x50')]['password'];}else{_0x14d772[_0x7aae('0x4d')][_0x7aae('0x6b')]=_0x14d772['Smtp'][_0x7aae('0x6b')]=![];_0x14d772[_0x7aae('0x4d')][_0x7aae('0x63')]=_0x14d772[_0x7aae('0x2e')][_0x7aae('0x63')]=null;_0x14d772[_0x7aae('0x4d')][_0x7aae('0x65')]=_0x14d772[_0x7aae('0x2e')][_0x7aae('0x67')]=null;}_0x14d772['Imap'][_0x7aae('0x69')]=_0x498ff4[_0x7aae('0x50')][_0x7aae('0x4d')]['host'];_0x14d772[_0x7aae('0x4d')][_0x7aae('0x6a')]=_0x498ff4[_0x7aae('0x50')][_0x7aae('0x4d')]['port'];_0x14d772['Smtp'][_0x7aae('0x69')]=_0x498ff4['body'][_0x7aae('0x2e')][_0x7aae('0x69')];_0x14d772[_0x7aae('0x2e')][_0x7aae('0x6a')]=_0x498ff4['body'][_0x7aae('0x2e')][_0x7aae('0x6a')];}return db[_0x7aae('0x32')][_0x7aae('0x54')](_0x14d772,{'include':[{'model':db['MailServerOut'],'as':_0x7aae('0x2e')},{'model':db['MailServerIn'],'as':_0x7aae('0x4d')}]})[_0x7aae('0x13')](function(_0x29cefc){var _0x13fe4f=_0x498ff4['user'][_0x7aae('0x6c')]({'plain':!![]});if(!_0x13fe4f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13fe4f[_0x7aae('0x6d')]===_0x7aae('0x63')){var _0x16b88f=_0x29cefc['get']({'plain':!![]});return db['UserProfileSection'][_0x7aae('0x4f')]({'where':{'name':_0x7aae('0x28'),'userProfileId':_0x13fe4f[_0x7aae('0x6e')]},'raw':!![]})[_0x7aae('0x13')](function(_0x5f1ecf){if(_0x5f1ecf&&_0x5f1ecf['autoAssociation']===0x0){return db[_0x7aae('0x29')][_0x7aae('0x54')]({'name':_0x16b88f[_0x7aae('0x2a')],'resourceId':_0x16b88f['id'],'type':_0x5f1ecf[_0x7aae('0x2a')],'sectionId':_0x5f1ecf['id']},{})[_0x7aae('0x13')](function(){return _0x29cefc;});}else{return _0x29cefc;}})['catch'](function(_0x390fab){logger[_0x7aae('0x19')](_0x7aae('0x6f'),_0x390fab);throw _0x390fab;});}return _0x29cefc;})[_0x7aae('0x13')](respondWithResult(_0x3c7c70,0xc9))['catch'](handleError(_0x3c7c70,null));};exports['getImap']=function(_0x209fab,_0x25dd20){return db[_0x7aae('0x32')][_0x7aae('0x55')]({'where':{'id':_0x209fab[_0x7aae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x25dd20,null))[_0x7aae('0x13')](function(_0xbc7317){if(_0xbc7317){return _0xbc7317[_0x7aae('0x70')]();}return null;})[_0x7aae('0x13')](respondWithResult(_0x25dd20,null))['catch'](handleError(_0x25dd20,null));};exports[_0x7aae('0x71')]=function(_0x586e48,_0x1084f8){if(_0x586e48[_0x7aae('0x50')]['id']){delete _0x586e48[_0x7aae('0x50')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x586e48['params']['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x1084f8,null))['then'](function(_0x38edc7){if(_0x38edc7){_0x586e48[_0x7aae('0x50')][_0x7aae('0x53')]=_0x38edc7['id'];return db[_0x7aae('0x2c')][_0x7aae('0x54')](_0x586e48[_0x7aae('0x50')]);}})[_0x7aae('0x13')](respondWithResult(_0x1084f8,null))['catch'](handleError(_0x1084f8,null));};exports[_0x7aae('0x72')]=function(_0x535989,_0x4487c3){return db[_0x7aae('0x32')]['findOne']({'where':{'id':_0x535989[_0x7aae('0x4c')]['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x4487c3,null))[_0x7aae('0x13')](function(_0x57060a){if(_0x57060a){return _0x57060a[_0x7aae('0x73')](null);}return null;})[_0x7aae('0x13')](respondWithStatusCode(_0x4487c3,null))[_0x7aae('0x1d')](handleError(_0x4487c3,null));};exports[_0x7aae('0x74')]=function(_0x2313df,_0x3c58c6){return db['MailAccount']['findOne']({'where':{'id':_0x2313df[_0x7aae('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3c58c6,null))[_0x7aae('0x13')](function(_0x3539b8){if(_0x3539b8){return _0x3539b8[_0x7aae('0x74')]();}return null;})[_0x7aae('0x13')](respondWithResult(_0x3c58c6,null))[_0x7aae('0x1d')](handleError(_0x3c58c6,null));};exports[_0x7aae('0x75')]=function(_0x5104fd,_0x131ebf){if(_0x5104fd[_0x7aae('0x50')]['id']){delete _0x5104fd['body']['id'];}return db[_0x7aae('0x32')][_0x7aae('0x4f')]({'where':{'id':_0x5104fd[_0x7aae('0x4c')]['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x131ebf,null))[_0x7aae('0x13')](function(_0x392601){if(_0x392601){_0x5104fd[_0x7aae('0x50')][_0x7aae('0x53')]=_0x392601['id'];return db['MailServerOut']['create'](_0x5104fd[_0x7aae('0x50')]);}})['then'](respondWithResult(_0x131ebf,null))[_0x7aae('0x1d')](handleError(_0x131ebf,null));};exports[_0x7aae('0x76')]=function(_0x4ab925,_0x49818d){return db[_0x7aae('0x32')]['findOne']({'where':{'id':_0x4ab925[_0x7aae('0x4c')]['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x49818d,null))[_0x7aae('0x13')](function(_0x4f4387){if(_0x4f4387){return _0x4f4387[_0x7aae('0x77')](null);}return null;})[_0x7aae('0x13')](respondWithStatusCode(_0x49818d,null))[_0x7aae('0x1d')](handleError(_0x49818d,null));};exports[_0x7aae('0x78')]=function(_0x4f472f,_0x300ee0){return db[_0x7aae('0x79')][_0x7aae('0x4f')]({'where':{'id':_0x4f472f['params']['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x300ee0,null))[_0x7aae('0x13')](function(_0x41ad1d){if(_0x41ad1d){return _0x41ad1d[_0x7aae('0x78')](_0x4f472f[_0x7aae('0x50')][_0x7aae('0x5d')],_[_0x7aae('0x7a')](_0x4f472f[_0x7aae('0x50')],['ids','id'])||{});}})['then'](respondWithResult(_0x300ee0,null))[_0x7aae('0x1d')](handleError(_0x300ee0,null));};exports[_0x7aae('0x7b')]=function(_0xcc3e1a,_0x476e32){var _0x896e3f={'raw':![],'where':{}};var _0x349924={};var _0x57abdc={'count':0x0,'rows':[]};return db[_0x7aae('0x32')][_0x7aae('0x55')]({'where':{'id':_0xcc3e1a[_0x7aae('0x4c')]['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x476e32,null))['then'](function(_0x19f3b9){if(_0x19f3b9){_0x349924[_0x7aae('0x36')]=_[_0x7aae('0x4e')](db[_0x7aae('0x79')][_0x7aae('0x57')]);_0x349924[_0x7aae('0x37')]=_[_0x7aae('0x4e')](_0xcc3e1a[_0x7aae('0x37')]);_0x349924[_0x7aae('0x38')]=_[_0x7aae('0x39')](_0x349924[_0x7aae('0x36')],_0x349924[_0x7aae('0x37')]);_0x896e3f[_0x7aae('0x3a')]=_['intersection'](_0x349924['model'],qs[_0x7aae('0x3b')](_0xcc3e1a[_0x7aae('0x37')][_0x7aae('0x3b')]));_0x896e3f['attributes']=_0x896e3f[_0x7aae('0x3a')][_0x7aae('0x3c')]?_0x896e3f[_0x7aae('0x3a')]:_0x349924['model'];if(!_0xcc3e1a['query'][_0x7aae('0x3d')](_0x7aae('0x3e'))){_0x896e3f['limit']=qs['limit'](_0xcc3e1a['query'][_0x7aae('0x23')]);_0x896e3f['offset']=qs[_0x7aae('0x21')](_0xcc3e1a[_0x7aae('0x37')][_0x7aae('0x21')]);}_0x896e3f[_0x7aae('0x3f')]=qs['sort'](_0xcc3e1a[_0x7aae('0x37')][_0x7aae('0x40')]);_0x896e3f[_0x7aae('0x41')]=qs['filters'](_[_0x7aae('0x42')](_0xcc3e1a[_0x7aae('0x37')],_0x349924[_0x7aae('0x38')]));_0x896e3f[_0x7aae('0x41')][_0x7aae('0x53')]=_0x19f3b9['id'];if(_0xcc3e1a[_0x7aae('0x37')][_0x7aae('0x43')]){_0x896e3f[_0x7aae('0x41')]=_[_0x7aae('0x45')](_0x896e3f[_0x7aae('0x41')],{'$or':_[_0x7aae('0x31')](_0x896e3f[_0x7aae('0x3a')],function(_0x48789c){var _0x2b21cb={};_0x2b21cb[_0x48789c]={'$like':'%'+_0xcc3e1a[_0x7aae('0x37')][_0x7aae('0x43')]+'%'};return _0x2b21cb;})});}_0x896e3f=_[_0x7aae('0x45')]({},_0x896e3f,_0xcc3e1a[_0x7aae('0x46')]);return db[_0x7aae('0x79')][_0x7aae('0x24')]({'where':_0x896e3f[_0x7aae('0x41')]})['then'](function(_0x7a1944){_0x57abdc[_0x7aae('0x24')]=_0x7a1944;if(_0xcc3e1a[_0x7aae('0x37')]['includeAll']){_0x896e3f[_0x7aae('0x48')]=[{'model':db['CmContact'],'as':_0x7aae('0x7c'),'required':![]},{'model':db[_0x7aae('0x7d')],'as':_0x7aae('0x7e'),'attributes':[_0x7aae('0x2a'),_0x7aae('0x7f'),_0x7aae('0x80')],'required':![]},{'model':db[_0x7aae('0x81')],'as':_0x7aae('0x82'),'attributes':['id',_0x7aae('0x2a'),_0x7aae('0x83')],'where':_0xcc3e1a['query'][_0x7aae('0x84')]?{'id':_0xcc3e1a[_0x7aae('0x37')]['tag']}:undefined,'required':_0xcc3e1a['query'][_0x7aae('0x84')]?!![]:![]}];}return db[_0x7aae('0x79')]['findAll'](_0x896e3f);})['then'](function(_0x4e8323){_0x57abdc[_0x7aae('0x4a')]=_0x4e8323;return _0x57abdc;});}})['then'](respondWithFilteredResult(_0x476e32,_0x896e3f))['catch'](handleError(_0x476e32,null));};exports[_0x7aae('0x85')]=function addApplications(_0x17b058,_0x4f182d){var _0x1c31ea=_0x17b058['params']['id'];var _0x2ee720=_0x17b058[_0x7aae('0x50')];var _0x31deaa=0xc8;var _0xa008ff=null;return db[_0x7aae('0x86')][_0x7aae('0x87')]({'isolationLevel':db[_0x7aae('0x86')][_0x7aae('0x88')][_0x7aae('0x89')][_0x7aae('0x8a')]},function(_0x29da37){return db[_0x7aae('0x32')][_0x7aae('0x55')]({'where':{'id':_0x1c31ea},'transaction':_0x29da37})[_0x7aae('0x13')](function(_0x978b91){if(_0x978b91){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x1c31ea},'transaction':_0x29da37})['then'](function(){var _0x117c08=_[_0x7aae('0x31')](_0x2ee720,function(_0x1a219c){_0x1a219c[_0x7aae('0x53')]=_0x1c31ea;return _0x1a219c;});return db[_0x7aae('0x8b')]['bulkCreate'](_0x117c08,{'transaction':_0x29da37});});}else{_0x31deaa=0x194;_0xa008ff=[];}});})['then'](function(){if(_0x31deaa!==0x194){return db['MailApplication'][_0x7aae('0x8c')]({'where':{'MailAccountId':_0x1c31ea},'order':_0x7aae('0x8d')})['then'](function(_0x41c13e){_0xa008ff=_0x41c13e;});}})['catch'](function(_0x4460a0){_0x31deaa=0x1f4;logger[_0x7aae('0x19')](_0x4460a0['stack']);if(_0x4460a0[_0x7aae('0x2a')]){delete _0x4460a0['name'];}_0xa008ff=_0x4460a0;})[_0x7aae('0x8e')](function(){if(_0xa008ff===null){_0x4f182d[_0x7aae('0x1e')](_0x31deaa);}else{if(_0x31deaa===0x1f4){_0x4f182d[_0x7aae('0x1f')](_0x31deaa)['send'](_0xa008ff);}else{_0x4f182d[_0x7aae('0x1f')](_0x31deaa)[_0x7aae('0x20')](_0xa008ff);}}});};exports[_0x7aae('0x8f')]=function(_0x2bde31,_0xbe32e5){var _0x1c74ad={};var _0x164aa7={};var _0x287033;var _0x4b3596;return db[_0x7aae('0x32')][_0x7aae('0x55')]({'where':{'id':_0x2bde31['params']['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0xbe32e5,null))['then'](function(_0x201224){if(_0x201224){_0x287033=_0x201224;_0x164aa7[_0x7aae('0x36')]=_[_0x7aae('0x4e')](db[_0x7aae('0x8b')][_0x7aae('0x57')]);_0x164aa7['query']=_[_0x7aae('0x4e')](_0x2bde31[_0x7aae('0x37')]);_0x164aa7[_0x7aae('0x38')]=_[_0x7aae('0x39')](_0x164aa7['model'],_0x164aa7['query']);_0x1c74ad[_0x7aae('0x3a')]=_[_0x7aae('0x39')](_0x164aa7[_0x7aae('0x36')],qs[_0x7aae('0x3b')](_0x2bde31[_0x7aae('0x37')]['fields']));_0x1c74ad[_0x7aae('0x3a')]=_0x1c74ad[_0x7aae('0x3a')][_0x7aae('0x3c')]?_0x1c74ad[_0x7aae('0x3a')]:_0x164aa7['model'];_0x1c74ad[_0x7aae('0x3f')]=qs[_0x7aae('0x40')](_0x2bde31[_0x7aae('0x37')][_0x7aae('0x40')]);_0x1c74ad[_0x7aae('0x41')]=qs[_0x7aae('0x38')](_[_0x7aae('0x42')](_0x2bde31['query'],_0x164aa7['filters']));if(_0x2bde31[_0x7aae('0x37')]['filter']){_0x1c74ad[_0x7aae('0x41')]=_[_0x7aae('0x45')](_0x1c74ad[_0x7aae('0x41')],{'$or':_[_0x7aae('0x31')](_0x1c74ad[_0x7aae('0x3a')],function(_0x3aa757){var _0x48a6f7={};_0x48a6f7[_0x3aa757]={'$like':'%'+_0x2bde31[_0x7aae('0x37')][_0x7aae('0x43')]+'%'};return _0x48a6f7;})});}_0x1c74ad=_['merge']({},_0x1c74ad,_0x2bde31[_0x7aae('0x46')]);return _0x287033[_0x7aae('0x8f')](_0x1c74ad);}})[_0x7aae('0x13')](function(_0x5b6213){if(_0x5b6213){_0x4b3596=_0x5b6213['length'];if(!_0x2bde31[_0x7aae('0x37')][_0x7aae('0x3d')](_0x7aae('0x3e'))){_0x1c74ad['limit']=qs[_0x7aae('0x23')](_0x2bde31['query'][_0x7aae('0x23')]);_0x1c74ad['offset']=qs['offset'](_0x2bde31['query'][_0x7aae('0x21')]);}return _0x287033[_0x7aae('0x8f')](_0x1c74ad);}})[_0x7aae('0x13')](function(_0xdb7b3c){if(_0xdb7b3c){return _0xdb7b3c?{'count':_0x4b3596,'rows':_0xdb7b3c}:null;}})['then'](respondWithResult(_0xbe32e5,null))[_0x7aae('0x1d')](handleError(_0xbe32e5,null));};exports[_0x7aae('0x90')]=function(_0x482ef7,_0xd9660){var _0x4f7341={'raw':!![],'where':{}};var _0x228aa3={};var _0x49f70f={'count':0x0,'rows':[]};return db['MailAccount'][_0x7aae('0x55')]({'where':{'id':_0x482ef7[_0x7aae('0x4c')]['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0xd9660,null))[_0x7aae('0x13')](function(_0x36398b){if(_0x36398b){_0x228aa3['model']=_[_0x7aae('0x4e')](db['MailMessage'][_0x7aae('0x57')]);_0x228aa3[_0x7aae('0x37')]=_[_0x7aae('0x4e')](_0x482ef7[_0x7aae('0x37')]);_0x228aa3[_0x7aae('0x38')]=_[_0x7aae('0x39')](_0x228aa3['model'],_0x228aa3[_0x7aae('0x37')]);_0x4f7341[_0x7aae('0x3a')]=_['intersection'](_0x228aa3[_0x7aae('0x36')],qs[_0x7aae('0x3b')](_0x482ef7[_0x7aae('0x37')][_0x7aae('0x3b')]));_0x4f7341[_0x7aae('0x3a')]=_0x4f7341[_0x7aae('0x3a')]['length']?_0x4f7341[_0x7aae('0x3a')]:_0x228aa3[_0x7aae('0x36')];if(!_0x482ef7[_0x7aae('0x37')]['hasOwnProperty'](_0x7aae('0x3e'))){_0x4f7341[_0x7aae('0x23')]=qs['limit'](_0x482ef7[_0x7aae('0x37')][_0x7aae('0x23')]);_0x4f7341['offset']=qs[_0x7aae('0x21')](_0x482ef7[_0x7aae('0x37')][_0x7aae('0x21')]);}_0x4f7341[_0x7aae('0x3f')]=qs['sort'](_0x482ef7[_0x7aae('0x37')][_0x7aae('0x40')]);_0x4f7341[_0x7aae('0x41')]=qs['filters'](_[_0x7aae('0x42')](_0x482ef7[_0x7aae('0x37')],_0x228aa3['filters']));_0x4f7341['where'][_0x7aae('0x53')]=_0x36398b['id'];if(_0x482ef7['query']['filter']){_0x4f7341[_0x7aae('0x41')]=_[_0x7aae('0x45')](_0x4f7341[_0x7aae('0x41')],{'$or':_[_0x7aae('0x31')](_0x4f7341[_0x7aae('0x3a')],function(_0x166e41){var _0x53970c={};_0x53970c[_0x166e41]={'$like':'%'+_0x482ef7[_0x7aae('0x37')][_0x7aae('0x43')]+'%'};return _0x53970c;})});}if(_0x482ef7[_0x7aae('0x37')][_0x7aae('0x91')]){var _0x10569c=_0x482ef7['query'][_0x7aae('0x91')][_0x7aae('0x92')](',');var _0x15253f={};_0x15253f[_0x10569c[0x0]]={'$gte':moment(_0x10569c[0x1])[_0x7aae('0x93')](_0x7aae('0x94'))};_0x4f7341[_0x7aae('0x41')]=_['merge'](_0x4f7341['where'],_0x15253f);}_0x4f7341=_[_0x7aae('0x45')]({},_0x4f7341,_0x482ef7[_0x7aae('0x46')]);return db[_0x7aae('0x95')][_0x7aae('0x24')]({'where':_0x4f7341[_0x7aae('0x41')]})[_0x7aae('0x13')](function(_0x56ac04){_0x49f70f[_0x7aae('0x24')]=_0x56ac04;if(_0x482ef7['query']['includeAll']){_0x4f7341['include']=[{'all':!![]}];}return db[_0x7aae('0x95')][_0x7aae('0x49')](_0x4f7341);})['then'](function(_0x1876c4){if(_0x482ef7[_0x7aae('0x37')][_0x7aae('0x96')]===_0x7aae('0x97')){for(var _0x3da52e=0x0;_0x3da52e<_0x1876c4[_0x7aae('0x3c')];_0x3da52e++){_0x1876c4[_0x3da52e][_0x7aae('0x50')]=juice(_0x1876c4[_0x3da52e]['body']);}}_0x49f70f[_0x7aae('0x4a')]=_0x1876c4;return _0x49f70f;});}})[_0x7aae('0x13')](respondWithFilteredResult(_0xd9660,_0x4f7341))['catch'](handleError(_0xd9660,null));};exports[_0x7aae('0x98')]=function(_0x411abf,_0x575c56){var _0x4e40d1,_0x8f44d5={},_0x593618;if(_0x411abf[_0x7aae('0x50')]['to']){_0x593618=_0x411abf[_0x7aae('0x50')]['to'][_0x7aae('0x92')](',')[0x0];}return db['MailAccount'][_0x7aae('0x4f')]({'where':{'id':_0x411abf['params']['id']},'include':[{'model':db['CmList'],'as':_0x7aae('0x99'),'include':[{'model':db[_0x7aae('0x9a')],'as':_0x7aae('0x9b'),'where':{'email':_0x593618},'limit':0x1,'order':[[_0x7aae('0x9c'),_0x7aae('0x9d')]]}]},{'model':db[_0x7aae('0x2d')],'as':_0x7aae('0x2e'),'raw':!![]}]})[_0x7aae('0x13')](handleEntityNotFound(_0x575c56,null))[_0x7aae('0x13')](function(_0x857257){if(_0x857257){_0x4e40d1=_0x857257;if(_0x857257[_0x7aae('0x2e')]){if(_[_0x7aae('0x61')](_0x411abf['body'][_0x7aae('0x9e')])){_0x411abf[_0x7aae('0x50')][_0x7aae('0x9e')]=util[_0x7aae('0x93')](_0x7aae('0x9f'),_0x857257[_0x7aae('0x2a')],_0x857257[_0x7aae('0xa0')]||_0x857257[_0x7aae('0x2e')][_0x7aae('0x63')]);}if(_0x411abf[_0x7aae('0x50')][_0x7aae('0xa1')]&&_0x411abf[_0x7aae('0x50')][_0x7aae('0xa1')][_0x7aae('0x3c')]){for(var _0x287fc0=0x0;_0x287fc0<_0x411abf[_0x7aae('0x50')][_0x7aae('0xa1')][_0x7aae('0x3c')];_0x287fc0+=0x1){_0x411abf[_0x7aae('0x50')]['attachments'][_0x287fc0]={'filename':_0x411abf[_0x7aae('0x50')][_0x7aae('0xa1')][_0x287fc0][_0x7aae('0x2a')],'path':path['join'](config[_0x7aae('0xa2')],'server/files/attachments',_0x411abf['body'][_0x7aae('0xa1')][_0x287fc0][_0x7aae('0xa3')])};}}var _0x232731={'tls':{'rejectUnauthorized':![]}};if(_[_0x7aae('0x61')](_0x857257[_0x7aae('0x2e')][_0x7aae('0x68')])){if(_0x857257[_0x7aae('0x2e')]['authentication']){_0x232731[_0x7aae('0xa4')]={'user':_0x857257['Smtp'][_0x7aae('0x63')],'pass':_0x857257['Smtp'][_0x7aae('0x67')]};}_0x232731[_0x7aae('0x69')]=_0x857257[_0x7aae('0x2e')]['host'];_0x232731['port']=_0x857257[_0x7aae('0x2e')]['port'];_0x232731[_0x7aae('0xa5')]=_0x857257[_0x7aae('0x2e')][_0x7aae('0xa5')];}else{_0x232731[_0x7aae('0x68')]=_0x857257[_0x7aae('0x2e')][_0x7aae('0x68')];_0x232731['auth']={'user':_0x857257[_0x7aae('0x2e')]['user'],'pass':_0x857257[_0x7aae('0x2e')][_0x7aae('0x67')]};}return respondWithRpcPromise('SendMail',_0x7aae('0xa6'),{'account':_0x232731,'message':_0x411abf[_0x7aae('0x50')]});}else{throw new Error(_0x7aae('0xa7'));}}})['then'](function(_0x166e2b){if(_0x166e2b){_0x8f44d5=_0x166e2b;if(_0x4e40d1[_0x7aae('0x99')]){if(_0x4e40d1[_0x7aae('0x99')][_0x7aae('0x9b')][_0x7aae('0x3c')]){return _0x4e40d1['List']['Contacts'][0x0];}else{return db[_0x7aae('0x9a')][_0x7aae('0x54')](_[_0x7aae('0xa')](_0x411abf[_0x7aae('0x50')],{'firstName':_0x411abf[_0x7aae('0x50')]['to'],'email':_0x411abf[_0x7aae('0x50')]['to'],'phone':_0x411abf[_0x7aae('0x50')]['to'],'ListId':_0x4e40d1[_0x7aae('0x60')]}));}}else{throw new Error(_0x7aae('0xa7'));}}})[_0x7aae('0x13')](function(_0x512210){if(_0x512210){var _0x1172b2={'UserId':_0x411abf['user']['id'],'ContactId':_0x512210['id'],'MailAccountId':_0x4e40d1['id'],'inReplyTo':_0x8f44d5[_0x7aae('0xa8')],'to':_0x411abf[_0x7aae('0x50')]['from'],'cc':_0x411abf['body']['cc'],'subject':_0x411abf['body']['subject'],'attach':_0x411abf['body'][_0x7aae('0xa9')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x7aae('0x93')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x7aae('0xaa'),'Messages':[_['merge'](_0x411abf[_0x7aae('0x50')],{'messageId':_0x8f44d5[_0x7aae('0xa8')],'sentAt':moment()[_0x7aae('0x93')](_0x7aae('0x94')),'read':!![],'MailAccountId':_0x4e40d1['id'],'UserId':_0x411abf[_0x7aae('0x63')]['id'],'ContactId':_0x512210['id']})]};if(_0x411abf[_0x7aae('0x50')]['Interaction']){_0x1172b2=_[_0x7aae('0x45')](_0x1172b2,_0x411abf[_0x7aae('0x50')][_0x7aae('0xab')]);}return db['MailInteraction']['create'](_0x1172b2,{'include':[{'model':db['MailMessage'],'as':_0x7aae('0xac')}]});}})[_0x7aae('0x13')](respondWithResult(_0x575c56,null))['catch'](handleError(_0x575c56,null));};exports[_0x7aae('0xad')]=function(_0x2e3c60,_0x25b60a){return db[_0x7aae('0x32')][_0x7aae('0x4f')]({'where':{'id':_0x2e3c60[_0x7aae('0x4c')]['id']},'include':[{'model':db[_0x7aae('0x2d')],'as':_0x7aae('0x2e'),'raw':!![],'include':[{'model':db[_0x7aae('0xae')],'as':_0x7aae('0xae'),'raw':!![]}]}]})[_0x7aae('0x13')](handleEntityNotFound(_0x25b60a,null))[_0x7aae('0x13')](function(_0x3d931c){if(!_0x3d931c[_0x7aae('0x2e')])return;var _0x59e708={'id':_0x3d931c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3d931c[_0x7aae('0x5e')]!==_0x7aae('0x5f')){_0x59e708[_0x7aae('0x68')]=_0x3d931c[_0x7aae('0x5e')];}else{_0x59e708[_0x7aae('0x69')]=_0x3d931c[_0x7aae('0x2e')][_0x7aae('0x69')];_0x59e708['port']=_0x3d931c[_0x7aae('0x2e')][_0x7aae('0x6a')];_0x59e708[_0x7aae('0xa5')]=_0x3d931c['Smtp'][_0x7aae('0xa5')];}if(_0x3d931c[_0x7aae('0x2e')]['authentication']){if(_0x3d931c['Smtp'][_0x7aae('0x66')]){_0x59e708['auth']={'type':_0x7aae('0xaf'),'user':_0x3d931c['Smtp'][_0x7aae('0x63')],'accessToken':_0x3d931c[_0x7aae('0x2e')][_0x7aae('0xae')][_0x7aae('0xb0')]};}else{_0x59e708['auth']={'user':_0x3d931c[_0x7aae('0x2e')][_0x7aae('0x63')],'pass':_0x3d931c[_0x7aae('0x2e')][_0x7aae('0x67')]};}}return respondWithRpcPromise(_0x7aae('0xb1'),'verifySmtp',{'account':_0x59e708});})['then'](respondWithResult(_0x25b60a,null))[_0x7aae('0x1d')](handleError(_0x25b60a,null));};exports['destroy']=function(_0x1fc256,_0x3a1a49){return db[_0x7aae('0x32')]['find']({'where':{'id':_0x1fc256['params']['id']}})['then'](handleEntityNotFound(_0x3a1a49,null))[_0x7aae('0x13')](function(_0x2e6d32){if(_0x2e6d32&&_0x2e6d32[_0x7aae('0x68')]){throw new db[(_0x7aae('0xb2'))][(_0x7aae('0xb3'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x2e6d32;})[_0x7aae('0x13')](removeEntity(_0x3a1a49,null))['catch'](handleError(_0x3a1a49,null));};exports['addAgents']=function(_0x31b276,_0x2563d4){return db[_0x7aae('0x32')][_0x7aae('0x4f')]({'where':{'id':_0x31b276[_0x7aae('0x4c')]['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x2563d4,null))[_0x7aae('0x13')](function(_0x58084c){if(_0x58084c){return _0x58084c[_0x7aae('0xb4')](_0x31b276[_0x7aae('0x50')][_0x7aae('0x5d')],_[_0x7aae('0x7a')](_0x31b276[_0x7aae('0x50')],[_0x7aae('0x5d'),'id'])||{})[_0x7aae('0xb5')](function(_0x55605f){for(var _0x4eaea5=0x0;_0x4eaea5<_0x31b276['body'][_0x7aae('0x5d')][_0x7aae('0x3c')];_0x4eaea5+=0x1){socket[_0x7aae('0xb6')](_0x7aae('0xb7'),{'UserId':Number(_0x31b276[_0x7aae('0x50')][_0x7aae('0x5d')][_0x4eaea5]),'MailAccountId':Number(_0x31b276['params']['id'])});}return _0x55605f;});}})[_0x7aae('0x13')](respondWithResult(_0x2563d4,null))[_0x7aae('0x1d')](handleError(_0x2563d4,null));};exports['removeAgents']=function(_0x5c3d6b,_0x2fa328){return db[_0x7aae('0x32')][_0x7aae('0x4f')]({'where':{'id':_0x5c3d6b[_0x7aae('0x4c')]['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x2fa328,null))['then'](function(_0x20f6c8){if(_0x20f6c8){return _0x20f6c8[_0x7aae('0xb8')](_0x5c3d6b[_0x7aae('0x37')][_0x7aae('0x5d')])[_0x7aae('0x13')](function(){if(_[_0x7aae('0xb9')](_0x5c3d6b[_0x7aae('0x37')]['ids'])){for(var _0x5cde04=0x0;_0x5cde04<_0x5c3d6b[_0x7aae('0x37')]['ids'][_0x7aae('0x3c')];_0x5cde04+=0x1){socket[_0x7aae('0xb6')]('userMailAccount:remove',{'UserId':Number(_0x5c3d6b[_0x7aae('0x37')][_0x7aae('0x5d')][_0x5cde04]),'MailAccountId':Number(_0x5c3d6b[_0x7aae('0x4c')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x5c3d6b['query']['ids']),'MailAccountId':Number(_0x5c3d6b[_0x7aae('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2fa328,null))[_0x7aae('0x1d')](handleError(_0x2fa328,null));};exports[_0x7aae('0xba')]=function(_0x11f248,_0x3ab1c3){var _0x204483={};var _0x22c126={};var _0x3bc36b;var _0x23b506;return db[_0x7aae('0x32')]['findOne']({'where':{'id':_0x11f248[_0x7aae('0x4c')]['id']}})[_0x7aae('0x13')](handleEntityNotFound(_0x3ab1c3,null))['then'](function(_0x188aaa){if(_0x188aaa){_0x3bc36b=_0x188aaa;_0x22c126['model']=_['keys'](db['User'][_0x7aae('0x57')]);_0x22c126[_0x7aae('0x37')]=_[_0x7aae('0x4e')](_0x11f248['query']);_0x22c126[_0x7aae('0x38')]=_[_0x7aae('0x39')](_0x22c126[_0x7aae('0x36')],_0x22c126[_0x7aae('0x37')]);_0x204483[_0x7aae('0x3a')]=_['intersection'](_0x22c126[_0x7aae('0x36')],qs[_0x7aae('0x3b')](_0x11f248[_0x7aae('0x37')][_0x7aae('0x3b')]));_0x204483[_0x7aae('0x3a')]=_0x204483[_0x7aae('0x3a')]['length']?_0x204483[_0x7aae('0x3a')]:_0x22c126[_0x7aae('0x36')];_0x204483[_0x7aae('0x3f')]=qs['sort'](_0x11f248[_0x7aae('0x37')]['sort']);_0x204483['where']=qs[_0x7aae('0x38')](_[_0x7aae('0x42')](_0x11f248[_0x7aae('0x37')],_0x22c126[_0x7aae('0x38')]));if(_0x11f248['query'][_0x7aae('0x43')]){_0x204483[_0x7aae('0x41')]=_[_0x7aae('0x45')](_0x204483[_0x7aae('0x41')],{'$or':_['map'](_0x204483['attributes'],function(_0x5cb5a2){var _0x4bfbf9={};_0x4bfbf9[_0x5cb5a2]={'$like':'%'+_0x11f248[_0x7aae('0x37')]['filter']+'%'};return _0x4bfbf9;})});}_0x204483=_[_0x7aae('0x45')]({},_0x204483,_0x11f248[_0x7aae('0x46')]);return _0x3bc36b[_0x7aae('0xba')](_0x204483);}})[_0x7aae('0x13')](function(_0x1f2494){if(_0x1f2494){_0x23b506=_0x1f2494[_0x7aae('0x3c')];if(!_0x11f248[_0x7aae('0x37')]['hasOwnProperty']('nolimit')){_0x204483[_0x7aae('0x23')]=qs[_0x7aae('0x23')](_0x11f248['query'][_0x7aae('0x23')]);_0x204483[_0x7aae('0x21')]=qs['offset'](_0x11f248['query'][_0x7aae('0x21')]);}return _0x3bc36b[_0x7aae('0xba')](_0x204483);}})[_0x7aae('0x13')](function(_0x593c7f){if(_0x593c7f){return _0x593c7f?{'count':_0x23b506,'rows':_0x593c7f}:null;}})[_0x7aae('0x13')](respondWithResult(_0x3ab1c3,null))[_0x7aae('0x1d')](handleError(_0x3ab1c3,null));};
\ No newline at end of file
index 327c606..76c08a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7ee=['exports','events','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0xa7ee,0x159));var _0xea7e=function(_0x455893,_0x909838){_0x455893=_0x455893-0x0;var _0x3851e8=_0xa7ee[_0x455893];return _0x3851e8;};'use strict';var EventEmitter=require(_0xea7e('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xea7e('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xea7e('0x2')](0x0);var events={'afterCreate':_0xea7e('0x3'),'afterUpdate':_0xea7e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x547937){return function(_0x1a88ef,_0x5ef5bd,_0x2439f9){MailAccountEvents[_0xea7e('0x5')](_0x547937+':'+_0x1a88ef['id'],_0x1a88ef);MailAccountEvents[_0xea7e('0x5')](_0x547937,_0x1a88ef);_0x2439f9(null);};}for(var e in events){if(events[_0xea7e('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xea7e('0x7')]=MailAccountEvents;
\ No newline at end of file
+var _0xf11e=['hasOwnProperty','hook','exports','events','MailAccount','setMaxListeners','save','emit'];(function(_0x20940a,_0x526e37){var _0x2cf196=function(_0x5ab6fd){while(--_0x5ab6fd){_0x20940a['push'](_0x20940a['shift']());}};_0x2cf196(++_0x526e37);}(_0xf11e,0x11b));var _0xef11=function(_0x2e798a,_0x3f030c){_0x2e798a=_0x2e798a-0x0;var _0x158701=_0xf11e[_0x2e798a];return _0x158701;};'use strict';var EventEmitter=require(_0xef11('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xef11('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xef11('0x2')](0x0);var events={'afterCreate':_0xef11('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3368fd){return function(_0x5cea87,_0x594a7c,_0x23dbcb){MailAccountEvents[_0xef11('0x4')](_0x3368fd+':'+_0x5cea87['id'],_0x5cea87);MailAccountEvents[_0xef11('0x4')](_0x3368fd,_0x5cea87);_0x23dbcb(null);};}for(var e in events){if(events[_0xef11('0x5')](e)){var event=events[e];MailAccount[_0xef11('0x6')](e,emitEvent(event));}}module[_0xef11('0x7')]=MailAccountEvents;
\ No newline at end of file
index ba111bd..2d095b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8001=['mail_accounts','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','MailAccount'];(function(_0x1d1963,_0x32cc0e){var _0x3f58bb=function(_0x514823){while(--_0x514823){_0x1d1963['push'](_0x1d1963['shift']());}};_0x3f58bb(++_0x32cc0e);}(_0x8001,0x173));var _0x1800=function(_0x58f8cf,_0x25fc18){_0x58f8cf=_0x58f8cf-0x0;var _0x48d4dc=_0x8001[_0x58f8cf];return _0x48d4dc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1800('0x0'))(_0x1800('0x1'));var moment=require(_0x1800('0x2'));var BPromise=require(_0x1800('0x3'));var rp=require(_0x1800('0x4'));var fs=require('fs');var path=require(_0x1800('0x5'));var rimraf=require('rimraf');var config=require(_0x1800('0x6'));var attributes=require('./mailAccount.attributes');module['exports']=function(_0x1aa060,_0x17eb5f){return _0x1aa060[_0x1800('0x7')](_0x1800('0x8'),attributes,{'tableName':_0x1800('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x50cc=['request-promise','path','rimraf','../../config/environment','exports','define','MailAccount','mail_accounts','lodash','../../config/logger','api'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x50cc,0x1ec));var _0xc50c=function(_0x47b501,_0x505649){_0x47b501=_0x47b501-0x0;var _0x4d0b1b=_0x50cc[_0x47b501];return _0x4d0b1b;};'use strict';var _=require(_0xc50c('0x0'));var util=require('util');var logger=require(_0xc50c('0x1'))(_0xc50c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc50c('0x3'));var fs=require('fs');var path=require(_0xc50c('0x4'));var rimraf=require(_0xc50c('0x5'));var config=require(_0xc50c('0x6'));var attributes=require('./mailAccount.attributes');module[_0xc50c('0x7')]=function(_0x245c50,_0x5e7b63){return _0x245c50[_0xc50c('0x8')](_0xc50c('0x9'),attributes,{'tableName':_0xc50c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 922aea1..71c11f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba44=['Smtp','get','omit','applications','list','orderBy','priority','asc','autoclose','push','length','close','Contacts','defaults','create','List\x20not\x20found','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','GetMailAccount','findAll','options','where','attributes','limit','include','map','model','ShowMailAccount','MailAccount','find','raw','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','List','DESC','Applications','MailServerOut'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0xba44,0x1f3));var _0x4ba4=function(_0x12d5ce,_0x3eae31){_0x12d5ce=_0x12d5ce-0x0;var _0x165191=_0xba44[_0x12d5ce];return _0x165191;};'use strict';var _=require(_0x4ba4('0x0'));var util=require(_0x4ba4('0x1'));var moment=require(_0x4ba4('0x2'));var BPromise=require(_0x4ba4('0x3'));var rs=require(_0x4ba4('0x4'));var fs=require('fs');var Redis=require(_0x4ba4('0x5'));var db=require(_0x4ba4('0x6'))['db'];var utils=require(_0x4ba4('0x7'));var logger=require(_0x4ba4('0x8'))(_0x4ba4('0x9'));var config=require(_0x4ba4('0xa'));var jayson=require(_0x4ba4('0xb'));var client=jayson[_0x4ba4('0xc')][_0x4ba4('0xd')]({'port':0x232c});config[_0x4ba4('0xe')]=_['defaults'](config[_0x4ba4('0xe')],{'host':_0x4ba4('0xf'),'port':0x18eb});var socket=require(_0x4ba4('0x10'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x4ba4('0x11')](socket);function respondWithRpcPromise(_0x42e2a8,_0x2a4503,_0x95eee0){return new BPromise(function(_0x4f8119,_0x51bf7d){return client[_0x4ba4('0x12')](_0x42e2a8,_0x95eee0)[_0x4ba4('0x13')](function(_0x105652){logger['info'](_0x4ba4('0x14'),_0x2a4503,_0x4ba4('0x15'));logger[_0x4ba4('0x16')](_0x4ba4('0x17'),_0x2a4503,_0x4ba4('0x15'),JSON[_0x4ba4('0x18')](_0x105652));if(_0x105652['error']){if(_0x105652['error'][_0x4ba4('0x19')]===0x1f4){logger[_0x4ba4('0x1a')](_0x4ba4('0x14'),_0x2a4503,_0x105652[_0x4ba4('0x1a')]['message']);return _0x51bf7d(_0x105652['error'][_0x4ba4('0x1b')]);}logger[_0x4ba4('0x1a')]('MailAccount,\x20%s,\x20%s',_0x2a4503,_0x105652[_0x4ba4('0x1a')]['message']);return _0x4f8119(_0x105652[_0x4ba4('0x1a')][_0x4ba4('0x1b')]);}else{logger[_0x4ba4('0x1c')](_0x4ba4('0x14'),_0x2a4503,_0x4ba4('0x15'));_0x4f8119(_0x105652[_0x4ba4('0x1d')][_0x4ba4('0x1b')]);}})[_0x4ba4('0x1e')](function(_0x5d7ef6){logger[_0x4ba4('0x1a')]('MailAccount,\x20%s,\x20%s',_0x2a4503,_0x5d7ef6);_0x51bf7d(_0x5d7ef6);});});}exports[_0x4ba4('0x1f')]=function(_0x85c5d0){var _0x361778=this;return new Promise(function(_0x1ea7ac,_0x1ac3fd){return db['MailAccount'][_0x4ba4('0x20')]({'raw':_0x85c5d0[_0x4ba4('0x21')]?_0x85c5d0[_0x4ba4('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x85c5d0['options']?_0x85c5d0['options'][_0x4ba4('0x22')]||null:null,'attributes':_0x85c5d0['options']?_0x85c5d0['options'][_0x4ba4('0x23')]||null:null,'limit':_0x85c5d0['options']?_0x85c5d0[_0x4ba4('0x21')][_0x4ba4('0x24')]||null:null,'include':_0x85c5d0[_0x4ba4('0x21')]?_0x85c5d0['options'][_0x4ba4('0x25')]?_[_0x4ba4('0x26')](_0x85c5d0[_0x4ba4('0x21')][_0x4ba4('0x25')],function(_0x5f20cd){return{'model':db[_0x5f20cd['model']],'as':_0x5f20cd['as'],'attributes':_0x5f20cd[_0x4ba4('0x23')],'include':_0x5f20cd[_0x4ba4('0x25')]?_[_0x4ba4('0x26')](_0x5f20cd[_0x4ba4('0x25')],function(_0x2beb16){return{'model':db[_0x2beb16[_0x4ba4('0x27')]],'as':_0x2beb16['as'],'attributes':_0x2beb16[_0x4ba4('0x23')],'include':_0x2beb16[_0x4ba4('0x25')]?_[_0x4ba4('0x26')](_0x2beb16['include'],function(_0xd69f42){return{'model':db[_0xd69f42['model']],'as':_0xd69f42['as'],'attributes':_0xd69f42['attributes']};}):[]};}):[]};}):[]:[]})[_0x4ba4('0x13')](function(_0x33f29){logger[_0x4ba4('0x1c')](_0x4ba4('0x1f'),_0x85c5d0);logger[_0x4ba4('0x16')](_0x4ba4('0x1f'),_0x85c5d0,JSON['stringify'](_0x33f29));_0x1ea7ac(_0x33f29);})[_0x4ba4('0x1e')](function(_0x19adbe){logger[_0x4ba4('0x1a')](_0x4ba4('0x1f'),_0x19adbe[_0x4ba4('0x1b')],_0x85c5d0);_0x1ac3fd(_0x361778[_0x4ba4('0x1a')](0x1f4,_0x19adbe[_0x4ba4('0x1b')]));});});};exports[_0x4ba4('0x28')]=function(_0x54f839){var _0x28f34e=this;return new Promise(function(_0x110a89,_0x221726){return db[_0x4ba4('0x29')][_0x4ba4('0x2a')]({'raw':_0x54f839[_0x4ba4('0x21')]?_0x54f839[_0x4ba4('0x21')][_0x4ba4('0x2b')]===undefined?!![]:![]:!![],'where':_0x54f839[_0x4ba4('0x21')]?_0x54f839['options'][_0x4ba4('0x22')]||null:null,'attributes':_0x54f839['options']?_0x54f839[_0x4ba4('0x21')]['attributes']||null:null,'include':_0x54f839[_0x4ba4('0x21')]?_0x54f839['options'][_0x4ba4('0x25')]?_['map'](_0x54f839[_0x4ba4('0x21')]['include'],function(_0x3d7002){return{'model':db[_0x3d7002[_0x4ba4('0x27')]],'as':_0x3d7002['as'],'attributes':_0x3d7002[_0x4ba4('0x23')],'include':_0x3d7002['include']?_[_0x4ba4('0x26')](_0x3d7002[_0x4ba4('0x25')],function(_0x940f9f){return{'model':db[_0x940f9f[_0x4ba4('0x27')]],'as':_0x940f9f['as'],'attributes':_0x940f9f[_0x4ba4('0x23')],'include':_0x940f9f[_0x4ba4('0x25')]?_[_0x4ba4('0x26')](_0x940f9f[_0x4ba4('0x25')],function(_0x1f2e51){return{'model':db[_0x1f2e51['model']],'as':_0x1f2e51['as'],'attributes':_0x1f2e51[_0x4ba4('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4ba4('0x13')](function(_0x15bae4){logger[_0x4ba4('0x1c')]('ShowMailAccount',_0x54f839);logger[_0x4ba4('0x16')](_0x4ba4('0x28'),_0x54f839,JSON[_0x4ba4('0x18')](_0x15bae4));_0x110a89(_0x15bae4);})[_0x4ba4('0x1e')](function(_0x4e901e){logger['error'](_0x4ba4('0x28'),_0x4e901e[_0x4ba4('0x1b')],_0x54f839);_0x221726(_0x28f34e[_0x4ba4('0x1a')](0x1f4,_0x4e901e['message']));});});};exports[_0x4ba4('0x2c')]=function(_0x2ef754){var _0x552fe3=this;return new Promise(function(_0x5e5db3,_0x19b92b){var _0x395116={'body':_0x2ef754[_0x4ba4('0x2d')],'channel':_0x4ba4('0x2e')};var _0x5bfa17=_[_0x4ba4('0x2f')](_[_0x4ba4('0x30')](db[_0x4ba4('0x31')][_0x4ba4('0x32')]),[_0x4ba4('0x33'),_0x4ba4('0x34'),_0x4ba4('0x35'),_0x4ba4('0x36')]);var _0x4fb49c=![];if(_0x2ef754[_0x4ba4('0x2d')]['id']){delete _0x2ef754['body']['id'];}if(_['isNil'](_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x37')])){return _0x19b92b(_0x552fe3[_0x4ba4('0x1a')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x4ba4('0x38')](_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x2d')])||_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x2d')]===''){return _0x19b92b(_0x552fe3[_0x4ba4('0x1a')](0x1f4,_0x4ba4('0x39')));}if(_[_0x4ba4('0x38')](_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x3a')])){return _0x19b92b(_0x552fe3[_0x4ba4('0x1a')](0x1f4,_0x4ba4('0x3b')+_0x5bfa17));}if(!_[_0x4ba4('0x3c')](_0x5bfa17,_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x3a')])){return _0x19b92b(_0x552fe3[_0x4ba4('0x1a')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5bfa17));}var _0x5fc6f={};_0x5fc6f[_0x2ef754[_0x4ba4('0x2d')]['mapKey']]=_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x37')];return db[_0x4ba4('0x29')][_0x4ba4('0x2a')]({'where':{'id':_0x2ef754[_0x4ba4('0x3d')]['id']},'include':[{'model':db['CmList'],'as':_0x4ba4('0x3e'),'include':[{'model':db[_0x4ba4('0x31')],'as':'Contacts','where':_0x5fc6f,'limit':0x1,'order':[[_0x4ba4('0x34'),_0x4ba4('0x3f')]]}]},{'model':db['MailApplication'],'as':_0x4ba4('0x40')},{'model':db[_0x4ba4('0x41')],'as':_0x4ba4('0x42')}]})['then'](function(_0x560c1a){if(_0x560c1a&&_0x560c1a['List']){var _0x16cdff=_0x560c1a[_0x4ba4('0x43')]({'plain':!![]});_0x395116[_0x4ba4('0x3d')]=_[_0x4ba4('0x44')](_0x16cdff,['Applications',_0x4ba4('0x3e')]);_0x395116[_0x4ba4('0x45')]=_0x16cdff['Applications'];_0x395116[_0x4ba4('0x46')]=_0x16cdff[_0x4ba4('0x3e')];_0x395116[_0x4ba4('0x45')]=_[_0x4ba4('0x47')](_0x395116[_0x4ba4('0x45')],[_0x4ba4('0x48')],[_0x4ba4('0x49')]);if(_0x395116[_0x4ba4('0x3d')]&&_0x395116[_0x4ba4('0x3d')][_0x4ba4('0x4a')]){_0x395116[_0x4ba4('0x45')][_0x4ba4('0x4b')]({'id':0x0,'priority':_0x395116['applications'][_0x4ba4('0x4c')]+0x1,'app':_0x4ba4('0x4d'),'appdata':_0x4ba4('0x4a'),'interval':'*,*,*,*'});}if(_0x395116[_0x4ba4('0x3d')][_0x4ba4('0x40')]){delete _0x395116['account'][_0x4ba4('0x40')];}if(_0x395116[_0x4ba4('0x3d')][_0x4ba4('0x3e')]){delete _0x395116[_0x4ba4('0x3d')][_0x4ba4('0x3e')];}if(_0x16cdff['List'][_0x4ba4('0x4e')]['length']){return _0x16cdff[_0x4ba4('0x3e')]['Contacts'][0x0];}var _0x1b5609=_[_0x4ba4('0x4f')](_0x2ef754['body'],{'firstName':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x37')],'ListId':_0x16cdff[_0x4ba4('0x36')]});_0x1b5609[_0x2ef754[_0x4ba4('0x2d')]['mapKey']]=_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x37')];return db[_0x4ba4('0x31')][_0x4ba4('0x50')](_0x1b5609);}else{throw new Error(_0x4ba4('0x51'));}})[_0x4ba4('0x13')](function(_0x569e7c){_0x395116[_0x4ba4('0x52')]=_0x569e7c;if(_0x569e7c){if(!_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x53')]){_0x2ef754[_0x4ba4('0x2d')]['message']['messageId']=rs['generate']()+'\x20'+_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x37')];}var _0x1a6588={'ContactId':_0x569e7c['id'],'MailAccountId':_0x2ef754[_0x4ba4('0x3d')]['id'],'inReplyTo':_0x2ef754['body']['message'][_0x4ba4('0x53')],'to':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x37')],'cc':_0x2ef754[_0x4ba4('0x2d')]['message']['cc'],'subject':_0x2ef754['body'][_0x4ba4('0x1b')][_0x4ba4('0x54')],'attach':_0x2ef754['body'][_0x4ba4('0x1b')]['attach'],'lastMsgAt':moment()[_0x4ba4('0x55')](_0x4ba4('0x56')),'lastMsgDirection':'in'};return db[_0x4ba4('0x57')]['find']({'where':{'closed':![],'MailAccountId':_0x2ef754['account']['id']},'include':[{'model':db[_0x4ba4('0x58')],'as':_0x4ba4('0x59'),'attributes':[_0x4ba4('0x53')],'where':{'messageId':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x5a')]}}]})[_0x4ba4('0x13')](function(_0x44b148){if(_0x44b148){return[_0x44b148,![]];}return db[_0x4ba4('0x57')][_0x4ba4('0x50')](_0x1a6588)[_0x4ba4('0x13')](function(_0x3f8421){return[_0x3f8421,!![]];});});}else{throw new Error(_0x4ba4('0x5b'));}})[_0x4ba4('0x5c')](function(_0x232dc3,_0x24daec){if(_0x232dc3){_0x4fb49c=_0x24daec;if(!_0x24daec){return _0x232dc3[_0x4ba4('0x5d')]({'inReplyTo':_0x2ef754['body']['message'][_0x4ba4('0x53')],'to':_0x2ef754[_0x4ba4('0x2d')]['message'][_0x4ba4('0x37')],'cc':_0x2ef754['body']['message']['cc'],'subject':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x54')],'attach':_0x232dc3[_0x4ba4('0x5e')]?_0x232dc3['attach']:_0x2ef754['body'][_0x4ba4('0x1b')][_0x4ba4('0x5e')],'substatus':null,'substatusAt':moment()[_0x4ba4('0x55')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x232dc3;}}})['then'](function(_0x5f45a){_0x395116[_0x4ba4('0x5f')]=_0x5f45a[_0x4ba4('0x43')]({'plain':!![]});_0x395116[_0x4ba4('0x5f')][_0x4ba4('0x60')]=_0x4fb49c;return db['MailMessage'][_0x4ba4('0x50')]({'body':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x2d')],'MailAccountId':_0x2ef754[_0x4ba4('0x3d')]['id'],'MailInteractionId':_0x5f45a['id'],'direction':'in','ContactId':_0x395116[_0x4ba4('0x52')]['id'],'messageId':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x53')],'from':_0x2ef754['body']['message'][_0x4ba4('0x37')],'to':_0x2ef754[_0x4ba4('0x2d')]['message']['to'],'cc':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')]['cc'],'subject':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x54')],'attach':_0x2ef754['body'][_0x4ba4('0x1b')]['attach'],'Attachments':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x61')],'originTo':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x62')],'originCc':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x63')],'bcc':_0x2ef754['body'][_0x4ba4('0x1b')][_0x4ba4('0x64')],'ChatWebsiteId':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x65')]||null,'originChannel':_0x2ef754[_0x4ba4('0x2d')][_0x4ba4('0x1b')][_0x4ba4('0x66')]||'Email','ChatOfflineMessageId':_0x2ef754[_0x4ba4('0x2d')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x4ba4('0x67')],'as':'Attachments'}]});})['then'](function(_0x490df4){_0x395116[_0x4ba4('0x1b')]=_0x490df4;if(_0x395116[_0x4ba4('0x5f')][_0x4ba4('0x68')]){return db[_0x4ba4('0x69')][_0x4ba4('0x2a')]({'attributes':['id',_0x4ba4('0x6a')],'where':{'id':_0x395116[_0x4ba4('0x5f')][_0x4ba4('0x68')]}})[_0x4ba4('0x13')](function(_0x161489){if(_0x161489){_0x395116[_0x4ba4('0x45')][_0x4ba4('0x6b')]({'id':0x0,'priority':0x0,'app':_0x4ba4('0x6c'),'appdata':_0x161489[_0x4ba4('0x6a')]+','+(_0x395116['account'][_0x4ba4('0x6d')]||0xa),'interval':_0x4ba4('0x6e')});}return respondWithRpcPromise(_0x4ba4('0x6f'),_0x4ba4('0x70'),_0x395116);});}return respondWithRpcPromise(_0x4ba4('0x6f'),_0x4ba4('0x70'),_0x395116);})['then'](function(_0x5600c9){_0x5e5db3(_0x5600c9);})[_0x4ba4('0x1e')](function(_0x3a0605){_0x19b92b(_0x552fe3['error'](0x1f4,_0x3a0605[_0x4ba4('0x1b')]));});});};
\ No newline at end of file
+var _0x77cf=['body','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','priority','autoclose','length','close','*,*,*,*','create','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Contact\x20not\x20found','update','interaction','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailAccount','findAll','options','raw','where','limit','map','include','model','attributes','MailAccount','find','ShowMailAccount','debug','NotifyMailAccount','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0x77cf,0x110));var _0xf77c=function(_0x45a4b6,_0x67397){_0x45a4b6=_0x45a4b6-0x0;var _0x3f763b=_0x77cf[_0x45a4b6];return _0x3f763b;};'use strict';var _=require('lodash');var util=require(_0xf77c('0x0'));var moment=require(_0xf77c('0x1'));var BPromise=require(_0xf77c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf77c('0x3'));var db=require(_0xf77c('0x4'))['db'];var utils=require(_0xf77c('0x5'));var logger=require(_0xf77c('0x6'))(_0xf77c('0x7'));var config=require(_0xf77c('0x8'));var jayson=require(_0xf77c('0x9'));var client=jayson[_0xf77c('0xa')][_0xf77c('0xb')]({'port':0x232c});config[_0xf77c('0xc')]=_[_0xf77c('0xd')](config['redis'],{'host':_0xf77c('0xe'),'port':0x18eb});var socket=require(_0xf77c('0xf'))(new Redis(config[_0xf77c('0xc')]));require(_0xf77c('0x10'))[_0xf77c('0x11')](socket);function respondWithRpcPromise(_0x4d9313,_0x5c61bc,_0x154849){return new BPromise(function(_0x393eda,_0x759464){return client[_0xf77c('0x12')](_0x4d9313,_0x154849)[_0xf77c('0x13')](function(_0x29906f){logger[_0xf77c('0x14')](_0xf77c('0x15'),_0x5c61bc,'request\x20sent');logger['debug'](_0xf77c('0x16'),_0x5c61bc,_0xf77c('0x17'),JSON[_0xf77c('0x18')](_0x29906f));if(_0x29906f['error']){if(_0x29906f['error']['code']===0x1f4){logger[_0xf77c('0x19')]('MailAccount,\x20%s,\x20%s',_0x5c61bc,_0x29906f[_0xf77c('0x19')]['message']);return _0x759464(_0x29906f[_0xf77c('0x19')][_0xf77c('0x1a')]);}logger[_0xf77c('0x19')](_0xf77c('0x15'),_0x5c61bc,_0x29906f['error'][_0xf77c('0x1a')]);return _0x393eda(_0x29906f[_0xf77c('0x19')][_0xf77c('0x1a')]);}else{logger['info'](_0xf77c('0x15'),_0x5c61bc,_0xf77c('0x17'));_0x393eda(_0x29906f[_0xf77c('0x1b')]['message']);}})[_0xf77c('0x1c')](function(_0x243bbe){logger[_0xf77c('0x19')](_0xf77c('0x15'),_0x5c61bc,_0x243bbe);_0x759464(_0x243bbe);});});}exports[_0xf77c('0x1d')]=function(_0x64cc89){var _0x227db7=this;return new Promise(function(_0x1c14b6,_0x3c1553){return db['MailAccount'][_0xf77c('0x1e')]({'raw':_0x64cc89[_0xf77c('0x1f')]?_0x64cc89[_0xf77c('0x1f')][_0xf77c('0x20')]===undefined?!![]:![]:!![],'where':_0x64cc89[_0xf77c('0x1f')]?_0x64cc89['options'][_0xf77c('0x21')]||null:null,'attributes':_0x64cc89[_0xf77c('0x1f')]?_0x64cc89[_0xf77c('0x1f')]['attributes']||null:null,'limit':_0x64cc89[_0xf77c('0x1f')]?_0x64cc89[_0xf77c('0x1f')][_0xf77c('0x22')]||null:null,'include':_0x64cc89[_0xf77c('0x1f')]?_0x64cc89[_0xf77c('0x1f')]['include']?_[_0xf77c('0x23')](_0x64cc89[_0xf77c('0x1f')][_0xf77c('0x24')],function(_0x5b5ada){return{'model':db[_0x5b5ada[_0xf77c('0x25')]],'as':_0x5b5ada['as'],'attributes':_0x5b5ada[_0xf77c('0x26')],'include':_0x5b5ada[_0xf77c('0x24')]?_['map'](_0x5b5ada[_0xf77c('0x24')],function(_0x896b06){return{'model':db[_0x896b06['model']],'as':_0x896b06['as'],'attributes':_0x896b06[_0xf77c('0x26')],'include':_0x896b06[_0xf77c('0x24')]?_[_0xf77c('0x23')](_0x896b06[_0xf77c('0x24')],function(_0x5d7b67){return{'model':db[_0x5d7b67[_0xf77c('0x25')]],'as':_0x5d7b67['as'],'attributes':_0x5d7b67[_0xf77c('0x26')]};}):[]};}):[]};}):[]:[]})[_0xf77c('0x13')](function(_0x427581){logger[_0xf77c('0x14')](_0xf77c('0x1d'),_0x64cc89);logger['debug'](_0xf77c('0x1d'),_0x64cc89,JSON[_0xf77c('0x18')](_0x427581));_0x1c14b6(_0x427581);})[_0xf77c('0x1c')](function(_0x106d3a){logger[_0xf77c('0x19')]('GetMailAccount',_0x106d3a[_0xf77c('0x1a')],_0x64cc89);_0x3c1553(_0x227db7[_0xf77c('0x19')](0x1f4,_0x106d3a['message']));});});};exports['ShowMailAccount']=function(_0x1da572){var _0x4eb006=this;return new Promise(function(_0x44f62c,_0x2acc67){return db[_0xf77c('0x27')][_0xf77c('0x28')]({'raw':_0x1da572[_0xf77c('0x1f')]?_0x1da572['options'][_0xf77c('0x20')]===undefined?!![]:![]:!![],'where':_0x1da572[_0xf77c('0x1f')]?_0x1da572['options'][_0xf77c('0x21')]||null:null,'attributes':_0x1da572[_0xf77c('0x1f')]?_0x1da572[_0xf77c('0x1f')]['attributes']||null:null,'include':_0x1da572[_0xf77c('0x1f')]?_0x1da572['options'][_0xf77c('0x24')]?_[_0xf77c('0x23')](_0x1da572[_0xf77c('0x1f')][_0xf77c('0x24')],function(_0x370e3f){return{'model':db[_0x370e3f[_0xf77c('0x25')]],'as':_0x370e3f['as'],'attributes':_0x370e3f[_0xf77c('0x26')],'include':_0x370e3f[_0xf77c('0x24')]?_[_0xf77c('0x23')](_0x370e3f[_0xf77c('0x24')],function(_0x22d2ee){return{'model':db[_0x22d2ee[_0xf77c('0x25')]],'as':_0x22d2ee['as'],'attributes':_0x22d2ee[_0xf77c('0x26')],'include':_0x22d2ee[_0xf77c('0x24')]?_[_0xf77c('0x23')](_0x22d2ee[_0xf77c('0x24')],function(_0x30de14){return{'model':db[_0x30de14['model']],'as':_0x30de14['as'],'attributes':_0x30de14[_0xf77c('0x26')]};}):[]};}):[]};}):[]:[]})[_0xf77c('0x13')](function(_0x2d5d0d){logger['info'](_0xf77c('0x29'),_0x1da572);logger[_0xf77c('0x2a')]('ShowMailAccount',_0x1da572,JSON['stringify'](_0x2d5d0d));_0x44f62c(_0x2d5d0d);})[_0xf77c('0x1c')](function(_0x26c79f){logger[_0xf77c('0x19')](_0xf77c('0x29'),_0x26c79f[_0xf77c('0x1a')],_0x1da572);_0x2acc67(_0x4eb006['error'](0x1f4,_0x26c79f[_0xf77c('0x1a')]));});});};exports[_0xf77c('0x2b')]=function(_0x3447bf){var _0x4dd807=this;return new Promise(function(_0x31bf91,_0x41242b){var _0x57908f={'body':_0x3447bf['body'],'channel':'mail'};var _0x88ea1a=_[_0xf77c('0x2c')](_[_0xf77c('0x2d')](db[_0xf77c('0x2e')][_0xf77c('0x2f')]),[_0xf77c('0x30'),_0xf77c('0x31'),_0xf77c('0x32'),_0xf77c('0x33')]);var _0x3e9de2=![];if(_0x3447bf[_0xf77c('0x34')]['id']){delete _0x3447bf[_0xf77c('0x34')]['id'];}if(_['isNil'](_0x3447bf[_0xf77c('0x34')][_0xf77c('0x35')])){return _0x41242b(_0x4dd807['error'](0x1f4,_0xf77c('0x36')));}if(_['isNil'](_0x3447bf[_0xf77c('0x34')][_0xf77c('0x34')])||_0x3447bf[_0xf77c('0x34')][_0xf77c('0x34')]===''){return _0x41242b(_0x4dd807[_0xf77c('0x19')](0x1f4,_0xf77c('0x37')));}if(_['isNil'](_0x3447bf[_0xf77c('0x34')][_0xf77c('0x38')])){return _0x41242b(_0x4dd807[_0xf77c('0x19')](0x1f4,_0xf77c('0x39')+_0x88ea1a));}if(!_[_0xf77c('0x3a')](_0x88ea1a,_0x3447bf[_0xf77c('0x34')][_0xf77c('0x38')])){return _0x41242b(_0x4dd807[_0xf77c('0x19')](0x1f4,_0xf77c('0x3b')+_0x88ea1a));}var _0xa2583b={};_0xa2583b[_0x3447bf[_0xf77c('0x34')][_0xf77c('0x38')]]=_0x3447bf[_0xf77c('0x34')][_0xf77c('0x35')];return db['MailAccount']['find']({'where':{'id':_0x3447bf[_0xf77c('0x3c')]['id']},'include':[{'model':db[_0xf77c('0x3d')],'as':_0xf77c('0x3e'),'include':[{'model':db[_0xf77c('0x2e')],'as':_0xf77c('0x3f'),'where':_0xa2583b,'limit':0x1,'order':[[_0xf77c('0x31'),_0xf77c('0x40')]]}]},{'model':db['MailApplication'],'as':_0xf77c('0x41')},{'model':db[_0xf77c('0x42')],'as':_0xf77c('0x43')}]})['then'](function(_0x53be59){if(_0x53be59&&_0x53be59['List']){var _0x98dac9=_0x53be59[_0xf77c('0x44')]({'plain':!![]});_0x57908f[_0xf77c('0x3c')]=_[_0xf77c('0x45')](_0x98dac9,[_0xf77c('0x41'),_0xf77c('0x3e')]);_0x57908f[_0xf77c('0x46')]=_0x98dac9[_0xf77c('0x41')];_0x57908f[_0xf77c('0x47')]=_0x98dac9[_0xf77c('0x3e')];_0x57908f[_0xf77c('0x46')]=_[_0xf77c('0x48')](_0x57908f[_0xf77c('0x46')],[_0xf77c('0x49')],['asc']);if(_0x57908f[_0xf77c('0x3c')]&&_0x57908f['account'][_0xf77c('0x4a')]){_0x57908f[_0xf77c('0x46')]['push']({'id':0x0,'priority':_0x57908f['applications'][_0xf77c('0x4b')]+0x1,'app':_0xf77c('0x4c'),'appdata':_0xf77c('0x4a'),'interval':_0xf77c('0x4d')});}if(_0x57908f[_0xf77c('0x3c')][_0xf77c('0x41')]){delete _0x57908f[_0xf77c('0x3c')][_0xf77c('0x41')];}if(_0x57908f[_0xf77c('0x3c')]['List']){delete _0x57908f[_0xf77c('0x3c')][_0xf77c('0x3e')];}if(_0x98dac9[_0xf77c('0x3e')][_0xf77c('0x3f')]['length']){return _0x98dac9[_0xf77c('0x3e')][_0xf77c('0x3f')][0x0];}var _0x2dc7af=_[_0xf77c('0xd')](_0x3447bf[_0xf77c('0x34')],{'firstName':_0x3447bf['body'][_0xf77c('0x35')],'ListId':_0x98dac9['ListId']});_0x2dc7af[_0x3447bf['body']['mapKey']]=_0x3447bf[_0xf77c('0x34')]['from'];return db[_0xf77c('0x2e')][_0xf77c('0x4e')](_0x2dc7af);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x112e57){_0x57908f[_0xf77c('0x4f')]=_0x112e57;if(_0x112e57){if(!_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')][_0xf77c('0x50')]){_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')][_0xf77c('0x50')]=rs[_0xf77c('0x51')]()+'\x20'+_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')][_0xf77c('0x35')];}var _0x4bda40={'ContactId':_0x112e57['id'],'MailAccountId':_0x3447bf[_0xf77c('0x3c')]['id'],'inReplyTo':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')]['messageId'],'to':_0x3447bf['body'][_0xf77c('0x1a')][_0xf77c('0x35')],'cc':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')]['cc'],'subject':_0x3447bf[_0xf77c('0x34')]['message'][_0xf77c('0x52')],'attach':_0x3447bf['body'][_0xf77c('0x1a')][_0xf77c('0x53')],'lastMsgAt':moment()[_0xf77c('0x54')](_0xf77c('0x55')),'lastMsgDirection':'in'};return db[_0xf77c('0x56')][_0xf77c('0x28')]({'where':{'closed':![],'MailAccountId':_0x3447bf[_0xf77c('0x3c')]['id']},'include':[{'model':db[_0xf77c('0x57')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')]['inReplyTo']}}]})[_0xf77c('0x13')](function(_0x2661ad){if(_0x2661ad){return[_0x2661ad,![]];}return db[_0xf77c('0x56')][_0xf77c('0x4e')](_0x4bda40)[_0xf77c('0x13')](function(_0x2f6667){return[_0x2f6667,!![]];});});}else{throw new Error(_0xf77c('0x58'));}})['spread'](function(_0x2f4f69,_0x177cd3){if(_0x2f4f69){_0x3e9de2=_0x177cd3;if(!_0x177cd3){return _0x2f4f69[_0xf77c('0x59')]({'inReplyTo':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')][_0xf77c('0x50')],'to':_0x3447bf[_0xf77c('0x34')]['message'][_0xf77c('0x35')],'cc':_0x3447bf['body']['message']['cc'],'subject':_0x3447bf[_0xf77c('0x34')]['message'][_0xf77c('0x52')],'attach':_0x2f4f69['attach']?_0x2f4f69[_0xf77c('0x53')]:_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')][_0xf77c('0x53')],'substatus':null,'substatusAt':moment()[_0xf77c('0x54')](_0xf77c('0x55')),'lastMsgAt':moment()['format'](_0xf77c('0x55')),'lastMsgDirection':'in'});}else{return _0x2f4f69;}}})[_0xf77c('0x13')](function(_0x43cde8){_0x57908f[_0xf77c('0x5a')]=_0x43cde8[_0xf77c('0x44')]({'plain':!![]});_0x57908f[_0xf77c('0x5a')][_0xf77c('0x5b')]=_0x3e9de2;return db[_0xf77c('0x57')][_0xf77c('0x4e')]({'body':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x34')],'MailAccountId':_0x3447bf['account']['id'],'MailInteractionId':_0x43cde8['id'],'direction':'in','ContactId':_0x57908f[_0xf77c('0x4f')]['id'],'messageId':_0x3447bf['body'][_0xf77c('0x1a')][_0xf77c('0x50')],'from':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')][_0xf77c('0x35')],'to':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')]['to'],'cc':_0x3447bf['body']['message']['cc'],'subject':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')]['subject'],'attach':_0x3447bf['body']['message'][_0xf77c('0x53')],'Attachments':_0x3447bf['body'][_0xf77c('0x1a')][_0xf77c('0x5c')],'originTo':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')][_0xf77c('0x5d')],'originCc':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')]['originCc'],'bcc':_0x3447bf['body'][_0xf77c('0x1a')][_0xf77c('0x5e')],'ChatWebsiteId':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')][_0xf77c('0x5f')]||null,'originChannel':_0x3447bf[_0xf77c('0x34')][_0xf77c('0x1a')][_0xf77c('0x60')]||_0xf77c('0x61'),'ChatOfflineMessageId':_0x3447bf[_0xf77c('0x34')]['message'][_0xf77c('0x62')]||null},{'include':[{'model':db['Attachment'],'as':_0xf77c('0x63')}]});})['then'](function(_0x136e8c){_0x57908f[_0xf77c('0x1a')]=_0x136e8c;if(_0x57908f['interaction'][_0xf77c('0x64')]){return db[_0xf77c('0x65')]['find']({'attributes':['id','name'],'where':{'id':_0x57908f['interaction'][_0xf77c('0x64')]}})[_0xf77c('0x13')](function(_0x20ec1b){if(_0x20ec1b){_0x57908f[_0xf77c('0x46')][_0xf77c('0x66')]({'id':0x0,'priority':0x0,'app':_0xf77c('0x67'),'appdata':_0x20ec1b[_0xf77c('0x68')]+','+(_0x57908f['account'][_0xf77c('0x69')]||0xa),'interval':_0xf77c('0x4d')});}return respondWithRpcPromise('Start','startRouting',_0x57908f);});}return respondWithRpcPromise(_0xf77c('0x6a'),_0xf77c('0x6b'),_0x57908f);})[_0xf77c('0x13')](function(_0x2dddfd){_0x31bf91(_0x2dddfd);})['catch'](function(_0x3a6520){_0x41242b(_0x4dd807[_0xf77c('0x19')](0x1f4,_0x3a6520[_0xf77c('0x1a')]));});});};
\ No newline at end of file
index c060205..dfa59d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d8a=['length','mailAccount:','./mailAccount.events','save','remove','emit','removeListener'];(function(_0x47f16a,_0x430ce8){var _0x2867b5=function(_0x29df00){while(--_0x29df00){_0x47f16a['push'](_0x47f16a['shift']());}};_0x2867b5(++_0x430ce8);}(_0x7d8a,0xbf));var _0xa7d8=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0x7d8a[_0x946518];return _0x909b69;};'use strict';var MailAccountEvents=require(_0xa7d8('0x0'));var events=[_0xa7d8('0x1'),_0xa7d8('0x2'),'update'];function createListener(_0x163119,_0x5d6da2){return function(_0x31db03){_0x5d6da2[_0xa7d8('0x3')](_0x163119,_0x31db03);};}function removeListener(_0x2d81c0,_0x3c1153){return function(){MailAccountEvents[_0xa7d8('0x4')](_0x2d81c0,_0x3c1153);};}exports['register']=function(_0x2ae5d9){for(var _0x7437e6=0x0,_0xbbbbbc=events[_0xa7d8('0x5')];_0x7437e6<_0xbbbbbc;_0x7437e6++){var _0x574e12=events[_0x7437e6];var _0x445b9c=createListener(_0xa7d8('0x6')+_0x574e12,_0x2ae5d9);MailAccountEvents['on'](_0x574e12,_0x445b9c);}};
\ No newline at end of file
+var _0x95ef=['remove','emit','register','length','mailAccount:','./mailAccount.events'];(function(_0x3fe20d,_0x45faee){var _0x257d1a=function(_0x2f6a9b){while(--_0x2f6a9b){_0x3fe20d['push'](_0x3fe20d['shift']());}};_0x257d1a(++_0x45faee);}(_0x95ef,0x119));var _0xf95e=function(_0x52dc57,_0x27dd89){_0x52dc57=_0x52dc57-0x0;var _0x33542a=_0x95ef[_0x52dc57];return _0x33542a;};'use strict';var MailAccountEvents=require(_0xf95e('0x0'));var events=['save',_0xf95e('0x1'),'update'];function createListener(_0x21d376,_0x44b0c7){return function(_0x2061a1){_0x44b0c7[_0xf95e('0x2')](_0x21d376,_0x2061a1);};}function removeListener(_0x11bb2c,_0x3c04ad){return function(){MailAccountEvents['removeListener'](_0x11bb2c,_0x3c04ad);};}exports[_0xf95e('0x3')]=function(_0x210873){for(var _0x5148d9=0x0,_0x4ae6dc=events[_0xf95e('0x4')];_0x5148d9<_0x4ae6dc;_0x5148d9++){var _0x4d0ce7=events[_0x5148d9];var _0xe1af0b=createListener(_0xf95e('0x5')+_0x4d0ce7,_0x210873);MailAccountEvents['on'](_0x4d0ce7,_0xe1af0b);}};
\ No newline at end of file
index ec3f408..267a32b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b25=['../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','update','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8b25,0xb1));var _0x58b2=function(_0xb5d990,_0x35a913){_0xb5d990=_0xb5d990-0x0;var _0x16cb5e=_0x8b25[_0xb5d990];return _0x16cb5e;};'use strict';var multer=require('multer');var util=require(_0x58b2('0x0'));var path=require(_0x58b2('0x1'));var timeout=require(_0x58b2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x58b2('0x3'));var interaction=require(_0x58b2('0x4'));var config=require(_0x58b2('0x5'));var controller=require(_0x58b2('0x6'));router[_0x58b2('0x7')](_0x58b2('0x8'),auth[_0x58b2('0x9')](),controller[_0x58b2('0xa')]);router['put']('/:id',auth[_0x58b2('0x9')](),controller[_0x58b2('0xb')]);router['delete'](_0x58b2('0x8'),auth[_0x58b2('0x9')](),controller[_0x58b2('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0xcaf8=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','put','update','destroy','exports','multer'];(function(_0x4d7798,_0x4f50ed){var _0x4a7711=function(_0x33cfcc){while(--_0x33cfcc){_0x4d7798['push'](_0x4d7798['shift']());}};_0x4a7711(++_0x4f50ed);}(_0xcaf8,0x158));var _0x8caf=function(_0x34ff42,_0x1d6350){_0x34ff42=_0x34ff42-0x0;var _0x16db67=_0xcaf8[_0x34ff42];return _0x16db67;};'use strict';var multer=require(_0x8caf('0x0'));var util=require('util');var path=require(_0x8caf('0x1'));var timeout=require(_0x8caf('0x2'));var express=require(_0x8caf('0x3'));var router=express[_0x8caf('0x4')]();var fs_extra=require(_0x8caf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8caf('0x6'));var config=require(_0x8caf('0x7'));var controller=require('./mailApplication.controller');router[_0x8caf('0x8')](_0x8caf('0x9'),auth[_0x8caf('0xa')](),controller['show']);router[_0x8caf('0xb')](_0x8caf('0x9'),auth['isAuthenticated'](),controller[_0x8caf('0xc')]);router['delete'](_0x8caf('0x9'),auth[_0x8caf('0xa')](),controller[_0x8caf('0xd')]);module[_0x8caf('0xe')]=router;
\ No newline at end of file
index 6313625..241c708 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2858=['TEXT','STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x2858,0x116));var _0x8285=function(_0x1b5ca8,_0x3e12e8){_0x1b5ca8=_0x1b5ca8-0x0;var _0x23a236=_0x2858[_0x1b5ca8];return _0x23a236;};'use strict';var Sequelize=require(_0x8285('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8285('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8285('0x2')]()},'description':{'type':Sequelize[_0x8285('0x3')]},'interval':{'type':Sequelize[_0x8285('0x3')],'defaultValue':_0x8285('0x4')}};
\ No newline at end of file
+var _0x02ef=['sequelize','exports','STRING','TEXT'];(function(_0x2cbde2,_0x94a41b){var _0x59b340=function(_0x4a7ec5){while(--_0x4a7ec5){_0x2cbde2['push'](_0x2cbde2['shift']());}};_0x59b340(++_0x94a41b);}(_0x02ef,0x11c));var _0xf02e=function(_0x35ebae,_0x4f86c4){_0x35ebae=_0x35ebae-0x0;var _0x1924cf=_0x02ef[_0x35ebae];return _0x1924cf;};'use strict';var Sequelize=require(_0xf02e('0x0'));module[_0xf02e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf02e('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf02e('0x3')]()},'description':{'type':Sequelize[_0xf02e('0x2')]},'interval':{'type':Sequelize[_0xf02e('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 20615ac..f9d82d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x570016,_0x111cb9){var _0x3b4176=function(_0x147f5b){while(--_0x147f5b){_0x570016['push'](_0x570016['shift']());}};_0x3b4176(++_0x111cb9);}(_0x54ef,0x112));var _0xf54e=function(_0x426bb3,_0x263c67){_0x426bb3=_0x426bb3-0x0;var _0x1232ca=_0x54ef[_0x426bb3];return _0x1232ca;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));};
\ No newline at end of file
+var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','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/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x4f2a73,_0x1da17d){var _0x4f1466=function(_0x21f84b){while(--_0x21f84b){_0x4f2a73['push'](_0x4f2a73['shift']());}};_0x4f1466(++_0x1da17d);}(_0xb43b,0x1b2));var _0xbb43=function(_0x47ee5b,_0x1b1840){_0x47ee5b=_0x47ee5b-0x0;var _0x2389cb=_0xb43b[_0x47ee5b];return _0x2389cb;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));};
\ No newline at end of file
index 6926eaf..63feec3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e05=['moment','bluebird','path','./mailApplication.attributes','exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0xc152b3,_0x51395e){var _0x4ada56=function(_0x15a8c5){while(--_0x15a8c5){_0xc152b3['push'](_0xc152b3['shift']());}};_0x4ada56(++_0x51395e);}(_0x3e05,0x141));var _0x53e0=function(_0x49bda0,_0x4cd89f){_0x49bda0=_0x49bda0-0x0;var _0x17f2ee=_0x3e05[_0x49bda0];return _0x17f2ee;};'use strict';var _=require(_0x53e0('0x0'));var util=require(_0x53e0('0x1'));var logger=require(_0x53e0('0x2'))(_0x53e0('0x3'));var moment=require(_0x53e0('0x4'));var BPromise=require(_0x53e0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53e0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x53e0('0x7'));module[_0x53e0('0x8')]=function(_0x3c1e6,_0x34fdfc){return _0x3c1e6[_0x53e0('0x9')](_0x53e0('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x53e0('0xb'),'collate':_0x53e0('0xc')});};
\ No newline at end of file
+var _0xcbd6=['util','api','moment','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','lodash'];(function(_0x52bb45,_0x406330){var _0x2b5d6b=function(_0x1016da){while(--_0x1016da){_0x52bb45['push'](_0x52bb45['shift']());}};_0x2b5d6b(++_0x406330);}(_0xcbd6,0x167));var _0x6cbd=function(_0x216197,_0x163dd2){_0x216197=_0x216197-0x0;var _0x5deb14=_0xcbd6[_0x216197];return _0x5deb14;};'use strict';var _=require(_0x6cbd('0x0'));var util=require(_0x6cbd('0x1'));var logger=require('../../config/logger')(_0x6cbd('0x2'));var moment=require(_0x6cbd('0x3'));var BPromise=require('bluebird');var rp=require(_0x6cbd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6cbd('0x5'));var config=require(_0x6cbd('0x6'));var attributes=require(_0x6cbd('0x7'));module[_0x6cbd('0x8')]=function(_0x57e5dc,_0x4efe78){return _0x57e5dc[_0x6cbd('0x9')]('MailApplication',attributes,{'tableName':_0x6cbd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6cbd('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index be8b407..5199c21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe50c=['MailApplication','update','body','options','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','message','MailApplication,\x20%s,\x20%s','info','catch','UpdateMailApplication'];(function(_0x570764,_0x2e9f9){var _0x3d2439=function(_0x20e3b6){while(--_0x20e3b6){_0x570764['push'](_0x570764['shift']());}};_0x3d2439(++_0x2e9f9);}(_0xe50c,0x6b));var _0xce50=function(_0x644954,_0x5754e3){_0x644954=_0x644954-0x0;var _0x5191d1=_0xe50c[_0x644954];return _0x5191d1;};'use strict';var _=require(_0xce50('0x0'));var util=require(_0xce50('0x1'));var moment=require(_0xce50('0x2'));var BPromise=require(_0xce50('0x3'));var rs=require(_0xce50('0x4'));var fs=require('fs');var Redis=require(_0xce50('0x5'));var db=require(_0xce50('0x6'))['db'];var utils=require(_0xce50('0x7'));var logger=require(_0xce50('0x8'))(_0xce50('0x9'));var config=require(_0xce50('0xa'));var jayson=require(_0xce50('0xb'));var client=jayson[_0xce50('0xc')][_0xce50('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x89c4aa,_0x544ed,_0x4d0eba){return new BPromise(function(_0x309075,_0x53ba3e){return client[_0xce50('0xe')](_0x89c4aa,_0x4d0eba)[_0xce50('0xf')](function(_0xb470ad){logger['info']('MailApplication,\x20%s,\x20%s',_0x544ed,_0xce50('0x10'));logger[_0xce50('0x11')](_0xce50('0x12'),_0x544ed,_0xce50('0x10'),JSON['stringify'](_0xb470ad));if(_0xb470ad[_0xce50('0x13')]){if(_0xb470ad[_0xce50('0x13')]['code']===0x1f4){logger[_0xce50('0x13')]('MailApplication,\x20%s,\x20%s',_0x544ed,_0xb470ad[_0xce50('0x13')]['message']);return _0x53ba3e(_0xb470ad[_0xce50('0x13')][_0xce50('0x14')]);}logger[_0xce50('0x13')](_0xce50('0x15'),_0x544ed,_0xb470ad['error']['message']);return _0x309075(_0xb470ad['error'][_0xce50('0x14')]);}else{logger[_0xce50('0x16')]('MailApplication,\x20%s,\x20%s',_0x544ed,_0xce50('0x10'));_0x309075(_0xb470ad['result'][_0xce50('0x14')]);}})[_0xce50('0x17')](function(_0x2129c5){logger[_0xce50('0x13')](_0xce50('0x15'),_0x544ed,_0x2129c5);_0x53ba3e(_0x2129c5);});});}exports[_0xce50('0x18')]=function(_0x470f66){var _0x519fa0=this;return new Promise(function(_0xc3834d,_0x2f9ce9){return db[_0xce50('0x19')][_0xce50('0x1a')](_0x470f66[_0xce50('0x1b')],{'raw':_0x470f66[_0xce50('0x1c')]?_0x470f66[_0xce50('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x470f66[_0xce50('0x1c')]?_0x470f66[_0xce50('0x1c')][_0xce50('0x1d')]||null:null,'attributes':_0x470f66[_0xce50('0x1c')]?_0x470f66['options'][_0xce50('0x1e')]||null:null,'limit':_0x470f66[_0xce50('0x1c')]?_0x470f66['options'][_0xce50('0x1f')]||null:null})['then'](function(_0x19e202){logger[_0xce50('0x16')](_0xce50('0x18'),_0x470f66);logger[_0xce50('0x11')](_0xce50('0x18'),_0x470f66,JSON[_0xce50('0x20')](_0x19e202));_0xc3834d(_0x19e202);})[_0xce50('0x17')](function(_0x567a06){logger[_0xce50('0x13')]('UpdateMailApplication',_0x567a06[_0xce50('0x14')],_0x470f66);_0x2f9ce9(_0x519fa0[_0xce50('0x13')](0x1f4,_0x567a06[_0xce50('0x14')]));});});};
\ No newline at end of file
+var _0x9312=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','lodash'];(function(_0x2ee917,_0x2e773f){var _0x20e9fc=function(_0x342d5c){while(--_0x342d5c){_0x2ee917['push'](_0x2ee917['shift']());}};_0x20e9fc(++_0x2e773f);}(_0x9312,0x65));var _0x2931=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x9312[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x2931('0x0'));var util=require(_0x2931('0x1'));var moment=require(_0x2931('0x2'));var BPromise=require(_0x2931('0x3'));var rs=require(_0x2931('0x4'));var fs=require('fs');var Redis=require(_0x2931('0x5'));var db=require(_0x2931('0x6'))['db'];var utils=require(_0x2931('0x7'));var logger=require(_0x2931('0x8'))(_0x2931('0x9'));var config=require('../../config/environment');var jayson=require(_0x2931('0xa'));var client=jayson[_0x2931('0xb')][_0x2931('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x331109,_0x1d2024,_0x4a5f1e){return new BPromise(function(_0x3415f9,_0x1c68d9){return client[_0x2931('0xd')](_0x331109,_0x4a5f1e)[_0x2931('0xe')](function(_0x11bf7e){logger[_0x2931('0xf')]('MailApplication,\x20%s,\x20%s',_0x1d2024,_0x2931('0x10'));logger[_0x2931('0x11')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x1d2024,_0x2931('0x10'),JSON[_0x2931('0x12')](_0x11bf7e));if(_0x11bf7e[_0x2931('0x13')]){if(_0x11bf7e[_0x2931('0x13')][_0x2931('0x14')]===0x1f4){logger[_0x2931('0x13')](_0x2931('0x15'),_0x1d2024,_0x11bf7e['error'][_0x2931('0x16')]);return _0x1c68d9(_0x11bf7e[_0x2931('0x13')]['message']);}logger['error']('MailApplication,\x20%s,\x20%s',_0x1d2024,_0x11bf7e[_0x2931('0x13')][_0x2931('0x16')]);return _0x3415f9(_0x11bf7e[_0x2931('0x13')]['message']);}else{logger[_0x2931('0xf')]('MailApplication,\x20%s,\x20%s',_0x1d2024,'request\x20sent');_0x3415f9(_0x11bf7e[_0x2931('0x17')][_0x2931('0x16')]);}})[_0x2931('0x18')](function(_0x16c803){logger[_0x2931('0x13')](_0x2931('0x15'),_0x1d2024,_0x16c803);_0x1c68d9(_0x16c803);});});}exports[_0x2931('0x19')]=function(_0x48690a){var _0x57fd76=this;return new Promise(function(_0x69b032,_0x542690){return db[_0x2931('0x1a')][_0x2931('0x1b')](_0x48690a[_0x2931('0x1c')],{'raw':_0x48690a[_0x2931('0x1d')]?_0x48690a[_0x2931('0x1d')][_0x2931('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48690a[_0x2931('0x1d')]?_0x48690a[_0x2931('0x1d')][_0x2931('0x1f')]||null:null,'attributes':_0x48690a[_0x2931('0x1d')]?_0x48690a['options'][_0x2931('0x20')]||null:null,'limit':_0x48690a[_0x2931('0x1d')]?_0x48690a[_0x2931('0x1d')][_0x2931('0x21')]||null:null})['then'](function(_0x47ab96){logger['info'](_0x2931('0x19'),_0x48690a);logger[_0x2931('0x11')](_0x2931('0x19'),_0x48690a,JSON[_0x2931('0x12')](_0x47ab96));_0x69b032(_0x47ab96);})[_0x2931('0x18')](function(_0x24a4d4){logger[_0x2931('0x13')](_0x2931('0x19'),_0x24a4d4[_0x2931('0x16')],_0x48690a);_0x542690(_0x57fd76['error'](0x1f4,_0x24a4d4['message']));});});};
\ No newline at end of file
index 9ef0fc0..77af84e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a74=['show','/:id/messages','getMessages','/:id/download','post','addMessage','tracked','mailinteraction:addtags','addTags','mailinteraction:update','update','delete','mail','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id'];(function(_0x4e8d08,_0x33cb5b){var _0x18dda3=function(_0x2820e9){while(--_0x2820e9){_0x4e8d08['push'](_0x4e8d08['shift']());}};_0x18dda3(++_0x33cb5b);}(_0x3a74,0x198));var _0x43a7=function(_0x32084f,_0x28fc38){_0x32084f=_0x32084f-0x0;var _0x187302=_0x3a74[_0x32084f];return _0x187302;};'use strict';var express=require(_0x43a7('0x0'));var router=express[_0x43a7('0x1')]();var auth=require(_0x43a7('0x2'));var interaction=require(_0x43a7('0x3'));var controller=require('./mailInteraction.controller');router[_0x43a7('0x4')]('/',auth[_0x43a7('0x5')](),controller['index']);router[_0x43a7('0x4')](_0x43a7('0x6'),auth[_0x43a7('0x5')](),controller['describe']);router[_0x43a7('0x4')](_0x43a7('0x7'),auth[_0x43a7('0x5')](),controller[_0x43a7('0x8')]);router['get'](_0x43a7('0x9'),auth[_0x43a7('0x5')](),controller[_0x43a7('0xa')]);router[_0x43a7('0x4')](_0x43a7('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x43a7('0xc')]('/',auth[_0x43a7('0x5')](),controller['create']);router[_0x43a7('0xc')](_0x43a7('0x9'),auth[_0x43a7('0x5')](),controller[_0x43a7('0xd')]);router['post']('/:id/tags',auth[_0x43a7('0x5')](),interaction[_0x43a7('0xe')]('mail',_0x43a7('0xf')),controller[_0x43a7('0x10')]);router['put'](_0x43a7('0x7'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x43a7('0x11')),controller[_0x43a7('0x12')]);router[_0x43a7('0x13')](_0x43a7('0x7'),auth[_0x43a7('0x5')](),interaction[_0x43a7('0xe')](_0x43a7('0x14'),_0x43a7('0x15')),controller[_0x43a7('0x16')]);router[_0x43a7('0x13')](_0x43a7('0x17'),auth['isAuthenticated'](),controller[_0x43a7('0x18')]);module[_0x43a7('0x19')]=router;
\ No newline at end of file
+var _0x11e9=['tracked','mailinteraction:addtags','addTags','put','mail','mailinteraction:update','update','delete','destroy','removeTags','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/messages','create','post','addMessage','/:id/tags'];(function(_0x8f0f2c,_0x3b7304){var _0x114143=function(_0x89aea3){while(--_0x89aea3){_0x8f0f2c['push'](_0x8f0f2c['shift']());}};_0x114143(++_0x3b7304);}(_0x11e9,0x1cc));var _0x911e=function(_0x52bef1,_0x44a335){_0x52bef1=_0x52bef1-0x0;var _0x46be1d=_0x11e9[_0x52bef1];return _0x46be1d;};'use strict';var express=require('express');var router=express[_0x911e('0x0')]();var auth=require(_0x911e('0x1'));var interaction=require(_0x911e('0x2'));var controller=require(_0x911e('0x3'));router[_0x911e('0x4')]('/',auth['isAuthenticated'](),controller[_0x911e('0x5')]);router[_0x911e('0x4')](_0x911e('0x6'),auth[_0x911e('0x7')](),controller[_0x911e('0x8')]);router['get'](_0x911e('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x911e('0xa'),auth[_0x911e('0x7')](),controller['getMessages']);router[_0x911e('0x4')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x911e('0x7')](),controller[_0x911e('0xb')]);router[_0x911e('0xc')](_0x911e('0xa'),auth[_0x911e('0x7')](),controller[_0x911e('0xd')]);router[_0x911e('0xc')](_0x911e('0xe'),auth[_0x911e('0x7')](),interaction[_0x911e('0xf')]('mail',_0x911e('0x10')),controller[_0x911e('0x11')]);router[_0x911e('0x12')](_0x911e('0x9'),auth['isAuthenticated'](),interaction[_0x911e('0xf')](_0x911e('0x13'),_0x911e('0x14')),controller[_0x911e('0x15')]);router[_0x911e('0x16')](_0x911e('0x9'),auth[_0x911e('0x7')](),interaction[_0x911e('0xf')](_0x911e('0x13'),'mailinteraction:destroy'),controller[_0x911e('0x17')]);router['delete'](_0x911e('0xe'),auth['isAuthenticated'](),controller[_0x911e('0x18')]);module['exports']=router;
\ No newline at end of file
index 95f051f..ed9a376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04bc=['iconv','exports','BOOLEAN','STRING','TEXT','DATE','ENUM','out'];(function(_0x347326,_0x51b68e){var _0x469db7=function(_0x2722d5){while(--_0x2722d5){_0x347326['push'](_0x347326['shift']());}};_0x469db7(++_0x51b68e);}(_0x04bc,0x188));var _0xc04b=function(_0x422925,_0x4b563c){_0x422925=_0x422925-0x0;var _0xe0fbc3=_0x04bc[_0x422925];return _0xe0fbc3;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xc04b('0x0'));module[_0xc04b('0x1')]={'closed':{'type':Sequelize[_0xc04b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc04b('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc04b('0x3')]},'note':{'type':Sequelize[_0xc04b('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xc04b('0x3')]},'cc':{'type':Sequelize[_0xc04b('0x4')]('long')},'subject':{'type':Sequelize[_0xc04b('0x4')]()},'attach':{'type':Sequelize[_0xc04b('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xc04b('0x5')]},'substatus':{'type':Sequelize[_0xc04b('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xc04b('0x6')]('in',_0xc04b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc04b('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xc04b('0x6')]('in',_0xc04b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc04b('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7dc5=['iconv','BOOLEAN','DATE','STRING','TEXT','long','ENUM','sequelize'];(function(_0x4bceb0,_0x18f49d){var _0x29bebd=function(_0x3dd22e){while(--_0x3dd22e){_0x4bceb0['push'](_0x4bceb0['shift']());}};_0x29bebd(++_0x18f49d);}(_0x7dc5,0xe7));var _0x57dc=function(_0x27a9cc,_0x3bae61){_0x27a9cc=_0x27a9cc-0x0;var _0x37d740=_0x7dc5[_0x27a9cc];return _0x37d740;};'use strict';var Sequelize=require(_0x57dc('0x0'));var iconv=require(_0x57dc('0x1'));module['exports']={'closed':{'type':Sequelize[_0x57dc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x57dc('0x3')]},'disposition':{'type':Sequelize[_0x57dc('0x4')]},'secondDisposition':{'type':Sequelize[_0x57dc('0x4')]},'thirdDisposition':{'type':Sequelize[_0x57dc('0x4')]},'note':{'type':Sequelize[_0x57dc('0x4')]},'inReplyTo':{'type':Sequelize[_0x57dc('0x4')](0x1fe)},'to':{'type':Sequelize[_0x57dc('0x4')]},'cc':{'type':Sequelize[_0x57dc('0x5')](_0x57dc('0x6'))},'subject':{'type':Sequelize[_0x57dc('0x5')]()},'attach':{'type':Sequelize[_0x57dc('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x57dc('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x57dc('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x57dc('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 783e6a4..120e9a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7412=['Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','keys','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','parse','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','i.MailAccountId\x20IS\x20NULL','user','toString','sequelize','keyBy','MailInteraction','Account.key','Account.mandatoryDisposition','contactName','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Setting','all','rows','includeAll','include','merge','options','create','body','params','destroy','describe','addMessage','ids','omit','getMessages','rawAttributes','nolimit','format','findAll','inlineCss','setTags','spread','removeTags','unix','join','server','files','tmp','transcript-%d-%s.zip','attachments','Attachments','Messages','bcc','mkdirSync','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','readFileSync','download','unlinkSync','eml-format','moment','util','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','stack','name','send','map','fullname','TagIds','Tags','split','push','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','answered','unmanaged','total','closed','UserId','talking','waiting','index','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','select','field','color','tools_tags','u.id','ui.MailInteractionId','from','users','u.id\x20=\x20ui.UserId','mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200'];(function(_0x399f27,_0xe8d862){var _0x352e13=function(_0x4f9301){while(--_0x4f9301){_0x399f27['push'](_0x399f27['shift']());}};_0x352e13(++_0xe8d862);}(_0x7412,0x161));var _0x2741=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x7412[_0x486f4a];return _0x135d99;};'use strict';var emlformat=require(_0x2741('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x2741('0x1'));var BPromise=require('bluebird');var util=require(_0x2741('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require('squel');var juice=require('juice');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x2741('0x3'));var logger=require(_0x2741('0x4'))(_0x2741('0x5'));var config=require('../../config/environment');var db=require(_0x2741('0x6'))['db'];var htmlEntities=require(_0x2741('0x7'));config[_0x2741('0x8')]=_[_0x2741('0x9')](config['redis'],{'host':_0x2741('0xa'),'port':0x18eb});var socket=require(_0x2741('0xb'))(new Redis(config[_0x2741('0x8')]));require(_0x2741('0xc'))[_0x2741('0xd')](socket);function respondWithStatusCode(_0x4eb13b,_0xf230d6){_0xf230d6=_0xf230d6||0xcc;return function(_0x105c01){if(_0x105c01){return _0x4eb13b[_0x2741('0xe')](_0xf230d6);}return _0x4eb13b[_0x2741('0xf')](_0xf230d6)[_0x2741('0x10')]();};}function respondWithResult(_0x3736f4,_0x1f70d6){_0x1f70d6=_0x1f70d6||0xc8;return function(_0x431309){if(_0x431309){return _0x3736f4['status'](_0x1f70d6)[_0x2741('0x11')](_0x431309);}};}function respondWithFilteredResult(_0xecf933,_0xc75fb5){return function(_0x4347d5){if(_0x4347d5){var _0x494073=typeof _0xc75fb5[_0x2741('0x12')]===_0x2741('0x13')&&typeof _0xc75fb5[_0x2741('0x14')]===_0x2741('0x13');var _0x56a04c=_0x4347d5[_0x2741('0x15')];var _0x27eacd=_0x494073?0x0:_0xc75fb5['offset'];var _0x22f12c=_0x494073?_0x4347d5[_0x2741('0x15')]:_0xc75fb5['offset']+_0xc75fb5['limit'];var _0x2b4f91;if(_0x22f12c>=_0x56a04c){_0x22f12c=_0x56a04c;_0x2b4f91=0xc8;}else{_0x2b4f91=0xce;}_0xecf933[_0x2741('0xf')](_0x2b4f91);return _0xecf933[_0x2741('0x16')](_0x2741('0x17'),_0x27eacd+'-'+_0x22f12c+'/'+_0x56a04c)[_0x2741('0x11')](_0x4347d5);}return null;};}function saveUpdates(_0x1d8b8e){return function(_0x1d3720){if(_0x1d3720){return _0x1d3720[_0x2741('0x18')](_0x1d8b8e)['then'](function(_0x3bfdfa){return _0x3bfdfa;});}return null;};}function removeEntity(_0x4be467){return function(_0x66a9df){if(_0x66a9df){return _0x66a9df['destroy']()['then'](function(){_0x4be467[_0x2741('0xf')](0xcc)[_0x2741('0x10')]();});}};}function handleEntityNotFound(_0x33acb2){return function(_0x5b4b49){if(!_0x5b4b49){_0x33acb2[_0x2741('0xe')](0x194);}return _0x5b4b49;};}function handleError(_0xf6861e,_0x462c1e){_0x462c1e=_0x462c1e||0x1f4;return function(_0x7da79c){logger['error'](_0x7da79c[_0x2741('0x19')]);if(_0x7da79c[_0x2741('0x1a')]){delete _0x7da79c['name'];}_0xf6861e['status'](_0x462c1e)[_0x2741('0x1b')](_0x7da79c);};}function getInteractionUsers(_0x59b18d,_0x5a5706){return new BPromise(function(_0x303d6e,_0x4d09c9){try{if(_0x5a5706[_0x59b18d['id']]){_0x59b18d['Users']=_[_0x2741('0x1c')](_0x5a5706[_0x59b18d['id']],function(_0x3ff705){return{'id':_0x3ff705['id'],'fullname':_0x3ff705[_0x2741('0x1d')]};});}}catch(_0x40bfd5){_0x4d09c9(_0x40bfd5);}_0x303d6e(_0x59b18d);});}function getInteractionTags(_0x53aab8,_0x14a9ab){return new BPromise(function(_0x41cb7b,_0x584cbf){try{if(_0x53aab8[_0x2741('0x1e')]){_0x53aab8[_0x2741('0x1f')]=[];_0x53aab8['TagIds'][_0x2741('0x20')](',')['forEach'](function(_0x1ed9ac){_0x53aab8['Tags'][_0x2741('0x21')](_0x14a9ab[_0x1ed9ac]);});}delete _0x53aab8['TagIds'];}catch(_0x358d06){_0x584cbf(_0x358d06);}_0x41cb7b(_0x53aab8);});}function getLastMessageText(_0x2f12d8){return new BPromise(function(_0x1b4484,_0x55c39d){return db[_0x2741('0x22')][_0x2741('0x23')]({'where':{'$and':[{'MailInteractionId':_0x2f12d8['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2741('0x24')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2741('0x25')],'order':_0x2741('0x26'),'raw':!![]})[_0x2741('0x27')](function(_0x587993){if(_0x587993&&_0x587993['plainBody']){_0x2f12d8[_0x2741('0x28')]=_[_0x2741('0x29')](_0x587993[_0x2741('0x25')]);}_0x1b4484(_0x2f12d8);})[_0x2741('0x2a')](function(_0x13c809){_0x55c39d(_0x13c809);});});}function updateMailInteraction(_0x47512d,_0x593e57,_0x3c2559,_0x5700db){return new BPromise(function(_0x4ab122,_0x652e6a){return getInteractionUsers(_0x47512d,_0x3c2559)['then'](function(_0x36758b){return getInteractionTags(_0x36758b,_0x593e57);})[_0x2741('0x27')](function(_0x1c4bb1){return getStateInteraction(_0x1c4bb1);})['then'](function(_0x21fec9){if(_0x5700db){_0x4ab122(getLastMessageText(_0x21fec9));}else{_0x4ab122(_0x21fec9);}})['catch'](function(_0x222dbc){_0x652e6a(_0x222dbc);});});}function getStateInteraction(_0x4530ca){return new BPromise(function(_0x3795e3){_0x4530ca['waiting']=0x0;_0x4530ca['talking']=0x0;_0x4530ca[_0x2741('0x2b')]=0x0;_0x4530ca[_0x2741('0x2c')]=0x0;_0x4530ca[_0x2741('0x2d')]=0x0;if(!_0x4530ca[_0x2741('0x2e')]&&!_0x4530ca[_0x2741('0x2f')]){_0x4530ca['waiting']+=0x1;}if(!_0x4530ca[_0x2741('0x2e')]&&_0x4530ca['UserId']){_0x4530ca[_0x2741('0x30')]+=0x1;if(_0x4530ca[_0x2741('0x31')]){_0x4530ca[_0x2741('0x31')]-=0x1;}}if(_0x4530ca[_0x2741('0x2e')]&&_0x4530ca['UserId']){_0x4530ca[_0x2741('0x2b')]+=0x1;if(_0x4530ca[_0x2741('0x30')]){_0x4530ca[_0x2741('0x30')]-=0x1;}}if(_0x4530ca[_0x2741('0x2e')]&&!_0x4530ca[_0x2741('0x2f')]){_0x4530ca['unmanaged']+=0x1;if(_0x4530ca[_0x2741('0x31')]){_0x4530ca[_0x2741('0x31')]-=0x1;}}_0x4530ca[_0x2741('0x2d')]+=0x1;_0x3795e3(_0x4530ca);});}exports[_0x2741('0x32')]=function(_0x57b3e0,_0x1a4ab9){var _0x3b6d2c={},_0x2eb065={},_0x45e33b={'count':0x0,'rows':[]};var _0x3722ab=_['map'](db['MailInteraction']['rawAttributes'],function(_0x5642f4){return{'name':_0x5642f4[_0x2741('0x33')],'type':_0x5642f4[_0x2741('0x34')][_0x2741('0x35')]};});_0x2eb065[_0x2741('0x36')]=_[_0x2741('0x1c')](_0x3722ab,_0x2741('0x1a'));_0x2eb065[_0x2741('0x37')]=_['keys'](_0x57b3e0[_0x2741('0x37')]);_0x2eb065[_0x2741('0x38')]=_['intersection'](_0x2eb065[_0x2741('0x36')],_0x2eb065[_0x2741('0x37')]);_0x3b6d2c[_0x2741('0x39')]=_[_0x2741('0x3a')](_0x2eb065[_0x2741('0x36')],qs[_0x2741('0x3b')](_0x57b3e0[_0x2741('0x37')][_0x2741('0x3b')]));_0x3b6d2c['attributes']=_0x3b6d2c[_0x2741('0x39')][_0x2741('0x3c')]?_0x3b6d2c['attributes']:_0x2eb065[_0x2741('0x36')];if(!_0x57b3e0['query'][_0x2741('0x3d')]('nolimit')){_0x3b6d2c[_0x2741('0x14')]=qs['limit'](_0x57b3e0[_0x2741('0x37')][_0x2741('0x14')]);_0x3b6d2c[_0x2741('0x12')]=qs[_0x2741('0x12')](_0x57b3e0[_0x2741('0x37')][_0x2741('0x12')]);}_0x3b6d2c[_0x2741('0x3e')]=qs['sort'](_0x57b3e0[_0x2741('0x37')][_0x2741('0x3f')]);_0x3b6d2c[_0x2741('0x40')]=qs[_0x2741('0x38')](_[_0x2741('0x41')](_0x57b3e0[_0x2741('0x37')],_0x2eb065[_0x2741('0x38')]),_0x3722ab);var _0x1a5082=[];var _0x2382a5=squel[_0x2741('0x42')]()[_0x2741('0x43')]('id')[_0x2741('0x43')](_0x2741('0x1a'))['field'](_0x2741('0x44'))['from'](_0x2741('0x45'));var _0x317b94=squel['select']()[_0x2741('0x43')](_0x2741('0x46'))[_0x2741('0x43')]('u.fullname')[_0x2741('0x43')](_0x2741('0x47'))[_0x2741('0x48')]('user_has_mail_interactions','ui')['left_join'](_0x2741('0x49'),'u',_0x2741('0x4a'));var _0x5ee807=squel[_0x2741('0x42')]()['from'](_0x2741('0x4b'),'i')[_0x2741('0x4c')](_0x2741('0x4d'),'c',_0x2741('0x4e'))[_0x2741('0x4c')](_0x2741('0x49'),'o',_0x2741('0x4f'))[_0x2741('0x4c')](_0x2741('0x50'),'a',_0x2741('0x51'))[_0x2741('0x4c')](_0x2741('0x52'),'me',_0x2741('0x53'))['left_join'](_0x2741('0x54'),'it',_0x2741('0x55'))[_0x2741('0x4c')](_0x2741('0x45'),'t',_0x2741('0x56'));var _0x56da9b=squel[_0x2741('0x57')]();var _0x534bf9=[];var _0x571d17=squel[_0x2741('0x57')]();var _0x3f074a;if(_0x57b3e0['query'][_0x2741('0x58')]){_0x3f074a=as[_0x2741('0x59')](_0x57b3e0[_0x2741('0x37')][_0x2741('0x58')]);var _0x1635e5=_0x3f074a[_0x2741('0x5a')];for(var _0x35a420=0x0;_0x35a420<_0x3f074a[_0x2741('0x5b')][_0x2741('0x3c')];_0x35a420++){var _0x2fb31d=_0x3f074a['conditions'][_0x35a420];var _0x315acb='i';var _0x2ecc35=_[_0x2741('0x5c')](_0x3722ab,[_0x2741('0x1a'),_0x2fb31d[_0x2741('0x43')]]);if(!_0x2ecc35){switch(_0x2fb31d[_0x2741('0x43')]){case _0x2741('0x5d'):if(_0x2fb31d['value']==0x1){_0x5ee807[_0x2741('0x5e')]('`'+_0x2fb31d[_0x2741('0x43')]+_0x2741('0x5f'));}else{_0x5ee807[_0x2741('0x5e')]('`'+_0x2fb31d['field']+_0x2741('0x60'));}break;case _0x2741('0x61'):if(_0x2fb31d[_0x2741('0x62')]===_0x2741('0x63')){if(_0x2fb31d['value'][_0x2741('0x20')]('\x20')[_0x2741('0x3c')]>0x1){_0x56da9b[_0x1635e5](_0x2741('0x64'),qs[_0x2741('0x65')](_0x2fb31d['value']),null);}else{var _0x1643c3='%'+_0x2fb31d[_0x2741('0x66')]+'%';_0x56da9b[_0x1635e5]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1643c3,_0x1643c3,_0x1643c3);}}else{_0x2ecc35=_[_0x2741('0x5c')](_0x3722ab,[_0x2741('0x1a'),_0x2741('0x67')]);_0x2fb31d[_0x2741('0x43')]='ContactId';_0x452d0d=as['buildExpression'](_0x315acb,_0x2ecc35[_0x2741('0x34')],_0x2fb31d);_0x56da9b[_0x1635e5](_0x452d0d[_0x2741('0x68')],_0x452d0d['value']['start'],_0x452d0d[_0x2741('0x66')]['end']);}break;case _0x2741('0x69'):var _0x222d47=_0x2fb31d[_0x2741('0x66')]['split'](',')[_0x2741('0x1c')](function(_0xf4923){return Number(_0xf4923);});_0x222d47[_0x2741('0x6a')](function(_0x1a6259){_0x571d17['or'](_0x2741('0x6b'),'%,'+_0x1a6259+',%');});_0x534bf9=_[_0x2741('0x6c')](_0x534bf9,_0x222d47);break;case _0x2741('0x6d'):if(_0x2fb31d[_0x2741('0x62')]===_0x2741('0x63')){_0x56da9b[_0x1635e5](_0x2741('0x6e'),'%'+_0x2fb31d[_0x2741('0x66')]+'%',null);}else{_0x2ecc35=_['find'](_0x3722ab,['name',_0x2741('0x2f')]);_0x2fb31d[_0x2741('0x43')]=_0x2741('0x2f');_0x452d0d=as[_0x2741('0x6f')](_0x315acb,_0x2ecc35[_0x2741('0x34')],_0x2fb31d);_0x56da9b[_0x1635e5](_0x452d0d['text'],_0x452d0d[_0x2741('0x66')]['start'],_0x452d0d[_0x2741('0x66')]['end']);}break;case _0x2741('0x25'):_0x452d0d=as[_0x2741('0x6f')]('me',null,_0x2fb31d);_0x56da9b[_0x1635e5](_0x452d0d[_0x2741('0x68')],_0x452d0d['value']['start'],_0x452d0d['value'][_0x2741('0x10')]);break;}}else{var _0x452d0d=as[_0x2741('0x6f')](_0x315acb,_0x2ecc35[_0x2741('0x34')],_0x2fb31d);_0x56da9b[_0x1635e5](_0x452d0d[_0x2741('0x68')],_0x452d0d[_0x2741('0x66')]['start'],_0x452d0d[_0x2741('0x66')][_0x2741('0x10')]);}}}else{var _0x719fed=_(_0x57b3e0['query'])[_0x2741('0x70')]()[_0x2741('0x1c')](function(_0x4313a9){return _[_0x2741('0x71')](_0x3722ab,['name',_0x4313a9])?_0x4313a9:undefined;})[_0x2741('0x72')]()[_0x2741('0x66')]();if(!_[_0x2741('0x73')](_0x719fed)){_0x719fed[_0x2741('0x6a')](function(_0x320a67){if(_0x320a67===_0x2741('0x74')){_0x5ee807[_0x2741('0x40')](_0x2741('0x75'),[][_0x2741('0x76')](_0x57b3e0[_0x2741('0x37')][_0x320a67]));}else if(_0x320a67===_0x2741('0x77')){var _0x182c0e=JSON['parse'](_0x57b3e0[_0x2741('0x37')][_0x320a67])[_0x2741('0x78')];var _0x2bd841=JSON[_0x2741('0x79')](_0x57b3e0[_0x2741('0x37')][_0x320a67])['$lte'];_0x5ee807[_0x2741('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x182c0e,_0x2bd841);}else{if(_0x57b3e0[_0x2741('0x37')][_0x320a67]==='null'){_0x5ee807[_0x2741('0x40')]('i.'+_0x320a67+_0x2741('0x7a'));}else{_0x5ee807[_0x2741('0x40')]('i.'+_0x320a67+'\x20=\x20?',_0x57b3e0[_0x2741('0x37')][_0x320a67]);}}});}if(_0x57b3e0[_0x2741('0x37')]['read']){if(_0x57b3e0[_0x2741('0x37')][_0x2741('0x7b')]==0x1){_0x5ee807[_0x2741('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x5ee807[_0x2741('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x57b3e0['query'][_0x2741('0x7c')]){_0x534bf9=_[_0x2741('0x7d')](_0x57b3e0[_0x2741('0x37')][_0x2741('0x7c')])?_0x57b3e0['query'][_0x2741('0x7c')]:new Array(_0x57b3e0[_0x2741('0x37')][_0x2741('0x7c')]);_0x534bf9[_0x2741('0x6a')](function(_0x32364e){_0x571d17['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x32364e+',%');});}if(_0x57b3e0['query'][_0x2741('0x7e')]){var _0x2ef8f4=_0x57b3e0[_0x2741('0x37')][_0x2741('0x7e')][_0x2741('0x7f')]('\x5c','\x5c\x5c')[_0x2741('0x7f')](/'/g,'\x27\x27');if(qs[_0x2741('0x80')](_0x2ef8f4)){_0x56da9b['or'](_0x2741('0x81'),_0x2ef8f4+'%');}else if(qs[_0x2741('0x82')](_0x2ef8f4)){_0x56da9b['or'](_0x2741('0x83'),_0x2ef8f4+'%');}else{_0x56da9b['or'](_0x2741('0x84'),qs['getFullTextValue'](_0x2ef8f4))['or'](_0x2741('0x85'),qs['getFullTextValue'](_0x2ef8f4));}}}_0x5ee807['where'](_0x56da9b);_0x5ee807[_0x2741('0x86')](_0x2741('0x87'));var _0x1b3509={'type':db[_0x2741('0x88')]['QueryTypes']['SELECT'],'raw':!![]};var _0xd3c27=_0x5ee807[_0x2741('0x89')]();_0xd3c27[_0x2741('0x43')](_0x2741('0x87'));_0xd3c27[_0x2741('0x43')](_0x2741('0x8a'),'unreadMessages');if(_0x3b6d2c[_0x2741('0x3e')]){_0x3b6d2c[_0x2741('0x3e')][_0x2741('0x6a')](function(_0x1aba19){var _0x2964e6=_0x1aba19[0x0]==='contactName'?_0x1aba19[0x0]:'i.'+_0x1aba19[0x0];_0x5ee807['order'](_0x2964e6,_0x1aba19[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2741('0x73')](_0x534bf9)){_0x5ee807[_0x2741('0x5e')](_0x571d17);_0xd3c27[_0x2741('0x40')](_0x2741('0x8b'),_0x534bf9);}BPromise[_0x2741('0x8c')]()[_0x2741('0x27')](function(){if(!_0x3f074a){if(_0x57b3e0['query'][_0x2741('0x74')])return;_0xd3c27[_0x2741('0x40')](_0x2741('0x8d'));_0x5ee807[_0x2741('0x40')](_0x2741('0x8d'));return;}if(_0x57b3e0['user'][_0x2741('0x8e')]!==_0x2741('0x8f'))return;return _0x57b3e0['user']['getMailAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x2a7ccb){if(_[_0x2741('0x73')](_0x2a7ccb)){_0xd3c27['where'](_0x2741('0x90'));_0x5ee807[_0x2741('0x40')](_0x2741('0x90'));}else{_0xd3c27['where']('i.MailAccountId\x20IN\x20?',_[_0x2741('0x1c')](_0x2a7ccb,'id'));_0x5ee807[_0x2741('0x40')](_0x2741('0x75'),_[_0x2741('0x1c')](_0x2a7ccb,'id'));}});})['then'](function(){if(_0x57b3e0[_0x2741('0x91')][_0x2741('0x8e')]===_0x2741('0x8f')&&!_0x3f074a&&!_0x57b3e0[_0x2741('0x37')][_0x2741('0x74')])return[];return db['sequelize'][_0x2741('0x37')](_0xd3c27[_0x2741('0x92')](),_0x1b3509);})[_0x2741('0x27')](function(_0xb5e263){_0x45e33b[_0x2741('0x15')]=_0xb5e263[_0x2741('0x3c')];if(_0x45e33b[_0x2741('0x15')]===0x0)return[];return db[_0x2741('0x93')][_0x2741('0x37')](_0x2382a5[_0x2741('0x92')](),_0x1b3509)[_0x2741('0x27')](function(_0x1195cf){_0x1a5082=_[_0x2741('0x94')](_0x1195cf,'id');_0x1b3509=_['merge'](_0x1b3509,{'model':db[_0x2741('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x57b3e0[_0x2741('0x37')]['fields']){_0x3b6d2c[_0x2741('0x39')][_0x2741('0x6a')](function(_0x4666bb){_0x5ee807[_0x2741('0x43')]('i.'+_0x4666bb);});}else{_0x5ee807[_0x2741('0x43')](_0x2741('0x8a'),_0x2741('0x5d'));_0x5ee807[_0x2741('0x43')]('a.key',_0x2741('0x96'));_0x5ee807[_0x2741('0x43')]('a.mandatoryDisposition',_0x2741('0x97'));_0x5ee807[_0x2741('0x43')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x2741('0x98'));_0x5ee807[_0x2741('0x43')]('i.id');_0x5ee807[_0x2741('0x43')](_0x2741('0x99'));_0x5ee807[_0x2741('0x43')]('i.updatedAt');_0x5ee807[_0x2741('0x43')](_0x2741('0x9a'));_0x5ee807['field'](_0x2741('0x9b'));_0x5ee807[_0x2741('0x43')](_0x2741('0x9c'));_0x5ee807['field'](_0x2741('0x9d'));_0x5ee807[_0x2741('0x43')](_0x2741('0x9e'));_0x5ee807[_0x2741('0x43')](_0x2741('0x9f'));_0x5ee807[_0x2741('0x43')](_0x2741('0xa0'));_0x5ee807[_0x2741('0x43')](_0x2741('0xa1'));_0x5ee807[_0x2741('0x43')](_0x2741('0xa2'));_0x5ee807['field'](_0x2741('0xa3'));_0x5ee807[_0x2741('0x43')]('i.to');_0x5ee807[_0x2741('0x43')](_0x2741('0xa4'));_0x5ee807[_0x2741('0x43')](_0x2741('0xa5'));_0x5ee807[_0x2741('0x43')](_0x2741('0xa6'));_0x5ee807[_0x2741('0x43')](_0x2741('0xa7'),_0x2741('0xa8'));_0x5ee807[_0x2741('0x43')]('c.lastName',_0x2741('0xa9'));_0x5ee807[_0x2741('0x43')](_0x2741('0xaa'),'Contact.email');_0x5ee807[_0x2741('0x43')](_0x2741('0xab'),_0x2741('0xac'));_0x5ee807['field'](_0x2741('0xad'),_0x2741('0xae'));_0x5ee807[_0x2741('0x43')]('c.fax',_0x2741('0xaf'));_0x5ee807[_0x2741('0x43')](_0x2741('0xb0'),_0x2741('0xb1'));_0x5ee807[_0x2741('0x43')]('o.internal',_0x2741('0xb2'));_0x5ee807[_0x2741('0x43')](_0x2741('0xb3'),_0x2741('0x1e'));}if(_0x3b6d2c[_0x2741('0x14')])_0x5ee807[_0x2741('0x14')](_0x3b6d2c['limit']);if(_0x3b6d2c['offset'])_0x5ee807[_0x2741('0x12')](_0x3b6d2c[_0x2741('0x12')]);return db['sequelize']['query'](_0x5ee807['toString'](),_0x1b3509);})[_0x2741('0x27')](function(_0x156544){if(_0x156544[_0x2741('0x3c')]>0x0)_0x317b94[_0x2741('0x40')]('ui.MailInteractionId\x20IN\x20?',_[_0x2741('0x1c')](_0x156544,'id'));return db[_0x2741('0x93')][_0x2741('0x37')](_0x317b94[_0x2741('0x92')](),_0x1b3509)[_0x2741('0x27')](function(_0x365e3a){var _0xdbfc15=_[_0x2741('0xb4')](_0x365e3a,_0x2741('0xb5'));var _0x210223=[];return db[_0x2741('0xb6')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]})[_0x2741('0x27')](function(_0x4be794){var _0x3497cb=_0x4be794['enableEmailPreview'];_0x156544[_0x2741('0x6a')](function(_0x4b25dd){_0x210223[_0x2741('0x21')](updateMailInteraction(_0x4b25dd,_0x1a5082,_0xdbfc15,_0x3497cb));});return BPromise[_0x2741('0xb7')](_0x210223);});});});})[_0x2741('0x27')](function(_0x274c01){_0x45e33b[_0x2741('0xb8')]=_0x274c01;return _0x45e33b;})['then'](respondWithFilteredResult(_0x1a4ab9,_0x3b6d2c))[_0x2741('0x2a')](handleError(_0x1a4ab9,null));};exports['show']=function(_0x3cef10,_0x110626){var _0xde4853={'raw':![],'where':{'id':_0x3cef10['params']['id']}},_0x1744f0={};_0x1744f0[_0x2741('0x36')]=_[_0x2741('0x70')](db[_0x2741('0x95')]['rawAttributes']);_0x1744f0[_0x2741('0x37')]=_['keys'](_0x3cef10['query']);_0x1744f0[_0x2741('0x38')]=_[_0x2741('0x3a')](_0x1744f0[_0x2741('0x36')],_0x1744f0[_0x2741('0x37')]);_0xde4853[_0x2741('0x39')]=_['intersection'](_0x1744f0[_0x2741('0x36')],qs[_0x2741('0x3b')](_0x3cef10[_0x2741('0x37')][_0x2741('0x3b')]));_0xde4853['attributes']=_0xde4853[_0x2741('0x39')][_0x2741('0x3c')]?_0xde4853['attributes']:_0x1744f0[_0x2741('0x36')];if(_0x3cef10['query'][_0x2741('0xb9')]){_0xde4853[_0x2741('0xba')]=[{'all':!![]}];}_0xde4853=_[_0x2741('0xbb')]({},_0xde4853,_0x3cef10[_0x2741('0xbc')]);return db['MailInteraction'][_0x2741('0x5c')](_0xde4853)[_0x2741('0x27')](handleEntityNotFound(_0x110626,null))['then'](respondWithResult(_0x110626,null))[_0x2741('0x2a')](handleError(_0x110626,null));};exports['create']=function(_0x1dd529,_0x5d7d8d){return db[_0x2741('0x95')][_0x2741('0xbd')](_0x1dd529[_0x2741('0xbe')],{})['then'](respondWithResult(_0x5d7d8d,0xc9))[_0x2741('0x2a')](handleError(_0x5d7d8d,null));};exports['update']=function(_0x23bedd,_0x822317){if(_0x23bedd['body']['id']){delete _0x23bedd[_0x2741('0xbe')]['id'];}return db[_0x2741('0x95')]['find']({'where':{'id':_0x23bedd[_0x2741('0xbf')]['id']}})[_0x2741('0x27')](handleEntityNotFound(_0x822317,null))[_0x2741('0x27')](saveUpdates(_0x23bedd[_0x2741('0xbe')],null))[_0x2741('0x27')](respondWithResult(_0x822317,null))[_0x2741('0x2a')](handleError(_0x822317,null));};exports[_0x2741('0xc0')]=function(_0x258088,_0x2e885c){return db['MailInteraction'][_0x2741('0x5c')]({'where':{'id':_0x258088[_0x2741('0xbf')]['id']}})[_0x2741('0x27')](handleEntityNotFound(_0x2e885c,null))[_0x2741('0x27')](removeEntity(_0x2e885c,null))[_0x2741('0x2a')](handleError(_0x2e885c,null));};exports['describe']=function(_0x2bc26b,_0x15dd25){return db['MailInteraction'][_0x2741('0xc1')]()[_0x2741('0x27')](respondWithResult(_0x15dd25,null))[_0x2741('0x2a')](handleError(_0x15dd25,null));};exports[_0x2741('0xc2')]=function(_0x541ac5,_0x87689a){return db[_0x2741('0x22')]['find']({'where':{'id':_0x541ac5[_0x2741('0xbf')]['id']}})[_0x2741('0x27')](handleEntityNotFound(_0x87689a,null))['then'](function(_0x4ef70f){if(_0x4ef70f){return _0x4ef70f['addMessage'](_0x541ac5[_0x2741('0xbe')][_0x2741('0xc3')],_[_0x2741('0xc4')](_0x541ac5[_0x2741('0xbe')],[_0x2741('0xc3'),'id'])||{});}})[_0x2741('0x27')](respondWithResult(_0x87689a,null))[_0x2741('0x2a')](handleError(_0x87689a,null));};exports[_0x2741('0xc5')]=function(_0x33dd50,_0x3986bc){var _0x51d913={'raw':![],'where':{}};var _0x14ebf7={};var _0x48fa42={'count':0x0,'rows':[]};return db['MailInteraction'][_0x2741('0x23')]({'where':{'id':_0x33dd50['params']['id']}})[_0x2741('0x27')](handleEntityNotFound(_0x3986bc,null))[_0x2741('0x27')](function(_0x38d7d7){if(_0x38d7d7){_0x14ebf7['model']=_['keys'](db['MailMessage'][_0x2741('0xc6')]);_0x14ebf7[_0x2741('0x37')]=_[_0x2741('0x70')](_0x33dd50[_0x2741('0x37')]);_0x14ebf7[_0x2741('0x38')]=_[_0x2741('0x3a')](_0x14ebf7[_0x2741('0x36')],_0x14ebf7[_0x2741('0x37')]);_0x51d913[_0x2741('0x39')]=_[_0x2741('0x3a')](_0x14ebf7[_0x2741('0x36')],qs[_0x2741('0x3b')](_0x33dd50[_0x2741('0x37')]['fields']));_0x51d913['attributes']=_0x51d913[_0x2741('0x39')][_0x2741('0x3c')]?_0x51d913[_0x2741('0x39')]:_0x14ebf7['model'];if(!_0x33dd50[_0x2741('0x37')][_0x2741('0x3d')](_0x2741('0xc7'))){_0x51d913[_0x2741('0x14')]=qs[_0x2741('0x14')](_0x33dd50[_0x2741('0x37')][_0x2741('0x14')]);_0x51d913[_0x2741('0x12')]=qs[_0x2741('0x12')](_0x33dd50[_0x2741('0x37')][_0x2741('0x12')]);}_0x51d913[_0x2741('0x3e')]=qs[_0x2741('0x3f')](_0x33dd50[_0x2741('0x37')][_0x2741('0x3f')]);_0x51d913[_0x2741('0x40')]=qs[_0x2741('0x38')](_[_0x2741('0x41')](_0x33dd50[_0x2741('0x37')],_0x14ebf7[_0x2741('0x38')]));_0x51d913[_0x2741('0x40')][_0x2741('0xb5')]=_0x38d7d7['id'];if(_0x33dd50['query'][_0x2741('0x7e')]){_0x51d913[_0x2741('0x40')]=_['merge'](_0x51d913[_0x2741('0x40')],{'$or':_['map'](_0x51d913[_0x2741('0x39')],function(_0x183b0a){var _0x1fc82a={};_0x1fc82a[_0x183b0a]={'$like':'%'+_0x33dd50[_0x2741('0x37')][_0x2741('0x7e')]+'%'};return _0x1fc82a;})});}if(_0x33dd50[_0x2741('0x37')][_0x2741('0x78')]){var _0x25542e=_0x33dd50[_0x2741('0x37')][_0x2741('0x78')][_0x2741('0x20')](',');var _0x3a0927={};_0x3a0927[_0x25542e[0x0]]={'$gte':moment(_0x25542e[0x1])[_0x2741('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x51d913['where']=_['merge'](_0x51d913[_0x2741('0x40')],_0x3a0927);}_0x51d913=_[_0x2741('0xbb')]({},_0x51d913,_0x33dd50[_0x2741('0xbc')]);return db['MailMessage'][_0x2741('0x15')]({'where':_0x51d913['where']})[_0x2741('0x27')](function(_0x500018){_0x48fa42[_0x2741('0x15')]=_0x500018;if(_0x33dd50[_0x2741('0x37')][_0x2741('0xb9')]){_0x51d913[_0x2741('0xba')]=[{'all':!![]}];}return db[_0x2741('0x22')][_0x2741('0xc9')](_0x51d913);})[_0x2741('0x27')](function(_0x366457){if(_0x33dd50[_0x2741('0x37')][_0x2741('0xca')]==='true'){for(var _0x2618da=0x0;_0x2618da<_0x366457[_0x2741('0x3c')];_0x2618da++){_0x366457[_0x2618da][_0x2741('0xbe')]=juice(_0x366457[_0x2618da][_0x2741('0xbe')]);}}_0x48fa42['rows']=_0x366457;return _0x48fa42;});}})[_0x2741('0x27')](respondWithFilteredResult(_0x3986bc,_0x51d913))['catch'](handleError(_0x3986bc,null));};exports['addTags']=function(_0x614679,_0x44fb3f){return db['MailInteraction']['find']({'where':{'id':_0x614679[_0x2741('0xbf')]['id']}})['then'](handleEntityNotFound(_0x44fb3f,null))[_0x2741('0x27')](function(_0x4c8f6a){if(_0x4c8f6a){return _0x4c8f6a[_0x2741('0xcb')](_0x614679['body'][_0x2741('0xc3')],_['omit'](_0x614679[_0x2741('0xbe')],[_0x2741('0xc3'),'id'])||{})[_0x2741('0xcc')](function(){return db[_0x2741('0x69')][_0x2741('0xc9')]({'attributes':['id',_0x2741('0x1a'),'color'],'where':{'id':_0x614679[_0x2741('0xbe')]['ids']}});})[_0x2741('0x27')](function(_0x39a594){socket['emit']('mailInteractionTags:save',{'id':Number(_0x614679['params']['id']),'tags':_0x39a594||[]});return{'id':Number(_0x614679['params']['id']),'tags':_0x39a594||[]};});}})['then'](respondWithResult(_0x44fb3f,null))[_0x2741('0x2a')](handleError(_0x44fb3f,null));};exports[_0x2741('0xcd')]=function(_0x1985f1,_0x454d7e){return db[_0x2741('0x95')][_0x2741('0x5c')]({'where':{'id':_0x1985f1[_0x2741('0xbf')]['id']}})['then'](handleEntityNotFound(_0x454d7e,null))['then'](function(_0xee098f){if(_0xee098f){return _0xee098f[_0x2741('0xcd')](_0x1985f1['query']['ids']);}})[_0x2741('0x27')](respondWithStatusCode(_0x454d7e,null))[_0x2741('0x2a')](handleError(_0x454d7e,null));};exports['download']=function(_0x30e10d,_0x355ed9){var _0x2a0cdd=moment()[_0x2741('0xce')]()[_0x2741('0x92')]();var _0x54bb8d=path[_0x2741('0xcf')](config['root'],_0x2741('0xd0'),_0x2741('0xd1'),_0x2741('0xd2'));var _0x4768a3=path[_0x2741('0xcf')](config['root'],_0x2741('0xd0'),_0x2741('0xd1'),'attachments');var _0x22d3aa=path[_0x2741('0xcf')](_0x54bb8d,_0x2a0cdd);var _0xa60914=util[_0x2741('0xc8')](_0x2741('0xd3'),_0x30e10d[_0x2741('0xbf')]['id'],_0x2a0cdd);var _0x5f2a99=path[_0x2741('0xcf')](_0x54bb8d,_0xa60914);var _0x5c458a=[];if(_0x30e10d[_0x2741('0x37')][_0x2741('0xd4')]){_0x5c458a[_0x2741('0x21')]({'model':db['Attachment'],'as':_0x2741('0xd5'),'raw':!![]});}var _0x27794d=[{'model':db[_0x2741('0x22')],'as':_0x2741('0xd6'),'attributes':['id','body',_0x2741('0x48'),'to','cc',_0x2741('0xd7'),'subject',_0x2741('0x77')],'where':{'secret':![]},'order':qs[_0x2741('0x3f')]('id'),'include':_0x5c458a}];return db[_0x2741('0x95')][_0x2741('0x5c')]({'where':{'id':_0x30e10d[_0x2741('0xbf')]['id']},'include':_0x27794d})['then'](handleEntityNotFound(_0x355ed9,null))[_0x2741('0x27')](function(_0x1a355e){if(_0x1a355e&&_0x1a355e[_0x2741('0xd6')]){var _0xc613bc=_0x1a355e['get']({'plain':!![]});fs[_0x2741('0xd8')](_0x22d3aa);return BPromise['each'](_0xc613bc['Messages'],function(_0x3a17ac,_0x216071){var _0x122ec0={'from':_0x3a17ac['from'],'to':_0x3a17ac['to'],'subject':_0x3a17ac[_0x2741('0xd9')],'html':htmlEntities[_0x2741('0xda')](_0x3a17ac['body']),'headers':{'Date':moment(_0x3a17ac[_0x2741('0x77')])[_0x2741('0xc8')](_0x2741('0xdb'))},'attachments':[]};if(_0x3a17ac['cc']){_0x122ec0[_0x2741('0xdc')]['Cc']=_0x3a17ac['cc'];}if(_0x3a17ac[_0x2741('0xd7')]){_0x122ec0['headers']['Bcc']=_0x3a17ac[_0x2741('0xd7')];}return new BPromise(function(_0x458bbd,_0x5bf695){if(_0x3a17ac['Attachments']){for(var _0x351ad6=0x0;_0x351ad6<_0x3a17ac[_0x2741('0xd5')][_0x2741('0x3c')];_0x351ad6++){var _0x58abc6=_0x3a17ac['Attachments'][_0x351ad6];var _0x48e8b3=path[_0x2741('0xcf')](_0x4768a3,_0x58abc6['basename']);if(fs[_0x2741('0xdd')](_0x48e8b3)){_0x122ec0['attachments'][_0x2741('0x21')]({'name':_0x58abc6[_0x2741('0x1a')],'contentType':_0x58abc6[_0x2741('0x34')],'data':fs[_0x2741('0xde')](_0x48e8b3)});}}}emlformat['build'](_0x122ec0,function(_0x10aae4,_0x2c2ad5){if(_0x10aae4)return _0x5bf695(_0x10aae4);fs['writeFileSync'](path[_0x2741('0xcf')](_0x22d3aa,util['format']('message%d.eml',_0x216071)),_0x2c2ad5);return _0x458bbd(_0x2c2ad5);});});})[_0x2741('0x27')](function(){return new BPromise(function(_0x35edac,_0x123e79){zipdir(_0x22d3aa,{'saveTo':_0x5f2a99},function(_0x5bbf36,_0x540a07){if(_0x5bbf36)return _0x123e79(_0x5bbf36);return _0x35edac(_0x540a07);});})['then'](function(){return new BPromise(function(_0x2448a9,_0x389a32){rimraf(_0x22d3aa,function(_0x2f75ed){if(_0x2f75ed)_0x389a32(_0x2f75ed);return _0x2448a9();});});})[_0x2741('0x27')](function(){return _0x355ed9[_0x2741('0xdf')](_0x5f2a99,_0xa60914,function(_0x622c87){if(!_0x622c87)fs[_0x2741('0xe0')](_0x5f2a99);});});});}else{return _0x355ed9[_0x2741('0xe')](0xc8);}})[_0x2741('0x2a')](handleError(_0x355ed9,null));};
\ No newline at end of file
+var _0xf072=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','waiting','unmanaged','total','closed','talking','UserId','index','MailInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','end','start','text','some','compact','isEmpty','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','agent','sequelize','toString','keyBy','merge','unreadMessages','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','includeAll','options','create','body','params','addMessage','ids','omit','getMessages','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','setTags','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','Bcc','readFileSync','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','bluebird','path','lodash','squel','ioredis','../../components/parsers/qs'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xf072,0x1cf));var _0x2f07=function(_0x3e5821,_0x4a3bac){_0x3e5821=_0x3e5821-0x0;var _0x3a30e3=_0xf072[_0x3e5821];return _0x3a30e3;};'use strict';var emlformat=require(_0x2f07('0x0'));var rimraf=require(_0x2f07('0x1'));var zipdir=require(_0x2f07('0x2'));var moment=require('moment');var BPromise=require(_0x2f07('0x3'));var util=require('util');var path=require(_0x2f07('0x4'));var fs=require('fs');var _=require(_0x2f07('0x5'));var squel=require(_0x2f07('0x6'));var juice=require('juice');var Redis=require(_0x2f07('0x7'));var qs=require(_0x2f07('0x8'));var as=require(_0x2f07('0x9'));var logger=require(_0x2f07('0xa'))(_0x2f07('0xb'));var config=require(_0x2f07('0xc'));var db=require(_0x2f07('0xd'))['db'];var htmlEntities=require(_0x2f07('0xe'));config[_0x2f07('0xf')]=_[_0x2f07('0x10')](config[_0x2f07('0xf')],{'host':_0x2f07('0x11'),'port':0x18eb});var socket=require(_0x2f07('0x12'))(new Redis(config[_0x2f07('0xf')]));require(_0x2f07('0x13'))['register'](socket);function respondWithStatusCode(_0xdb2783,_0x2f464b){_0x2f464b=_0x2f464b||0xcc;return function(_0x1d0812){if(_0x1d0812){return _0xdb2783[_0x2f07('0x14')](_0x2f464b);}return _0xdb2783['status'](_0x2f464b)['end']();};}function respondWithResult(_0x3dd0cf,_0x1e291d){_0x1e291d=_0x1e291d||0xc8;return function(_0x58549c){if(_0x58549c){return _0x3dd0cf[_0x2f07('0x15')](_0x1e291d)[_0x2f07('0x16')](_0x58549c);}};}function respondWithFilteredResult(_0x26edfa,_0x4dceb1){return function(_0x211514){if(_0x211514){var _0x443fdc=typeof _0x4dceb1[_0x2f07('0x17')]===_0x2f07('0x18')&&typeof _0x4dceb1[_0x2f07('0x19')]===_0x2f07('0x18');var _0x5d32d6=_0x211514[_0x2f07('0x1a')];var _0x5a7b5c=_0x443fdc?0x0:_0x4dceb1[_0x2f07('0x17')];var _0xe8cf4d=_0x443fdc?_0x211514[_0x2f07('0x1a')]:_0x4dceb1[_0x2f07('0x17')]+_0x4dceb1[_0x2f07('0x19')];var _0x46c9b4;if(_0xe8cf4d>=_0x5d32d6){_0xe8cf4d=_0x5d32d6;_0x46c9b4=0xc8;}else{_0x46c9b4=0xce;}_0x26edfa[_0x2f07('0x15')](_0x46c9b4);return _0x26edfa[_0x2f07('0x1b')]('Content-Range',_0x5a7b5c+'-'+_0xe8cf4d+'/'+_0x5d32d6)[_0x2f07('0x16')](_0x211514);}return null;};}function saveUpdates(_0x4e35fd){return function(_0x3cd3c0){if(_0x3cd3c0){return _0x3cd3c0[_0x2f07('0x1c')](_0x4e35fd)[_0x2f07('0x1d')](function(_0xd944d6){return _0xd944d6;});}return null;};}function removeEntity(_0x2ef47d){return function(_0x5267e1){if(_0x5267e1){return _0x5267e1[_0x2f07('0x1e')]()['then'](function(){_0x2ef47d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d93c2){return function(_0x51c285){if(!_0x51c285){_0x1d93c2[_0x2f07('0x14')](0x194);}return _0x51c285;};}function handleError(_0x5e6ac6,_0x354ee2){_0x354ee2=_0x354ee2||0x1f4;return function(_0x2c495f){logger[_0x2f07('0x1f')](_0x2c495f[_0x2f07('0x20')]);if(_0x2c495f['name']){delete _0x2c495f[_0x2f07('0x21')];}_0x5e6ac6[_0x2f07('0x15')](_0x354ee2)[_0x2f07('0x22')](_0x2c495f);};}function getInteractionUsers(_0x5cfa32,_0x111376){return new BPromise(function(_0x113916,_0x522006){try{if(_0x111376[_0x5cfa32['id']]){_0x5cfa32[_0x2f07('0x23')]=_[_0x2f07('0x24')](_0x111376[_0x5cfa32['id']],function(_0x5d5898){return{'id':_0x5d5898['id'],'fullname':_0x5d5898[_0x2f07('0x25')]};});}}catch(_0x562335){_0x522006(_0x562335);}_0x113916(_0x5cfa32);});}function getInteractionTags(_0x894cd4,_0x17a43a){return new BPromise(function(_0x27bd72,_0x18f599){try{if(_0x894cd4[_0x2f07('0x26')]){_0x894cd4[_0x2f07('0x27')]=[];_0x894cd4[_0x2f07('0x26')][_0x2f07('0x28')](',')[_0x2f07('0x29')](function(_0x468cd8){_0x894cd4[_0x2f07('0x27')][_0x2f07('0x2a')](_0x17a43a[_0x468cd8]);});}delete _0x894cd4['TagIds'];}catch(_0x1accef){_0x18f599(_0x1accef);}_0x27bd72(_0x894cd4);});}function getLastMessageText(_0x2b806a){return new BPromise(function(_0xada137,_0x571839){return db[_0x2f07('0x2b')][_0x2f07('0x2c')]({'where':{'$and':[{'MailInteractionId':_0x2b806a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2f07('0x2d')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x2f07('0x2e'),'raw':!![]})[_0x2f07('0x1d')](function(_0xee6a27){if(_0xee6a27&&_0xee6a27[_0x2f07('0x2f')]){_0x2b806a[_0x2f07('0x30')]=_[_0x2f07('0x31')](_0xee6a27[_0x2f07('0x2f')]);}_0xada137(_0x2b806a);})['catch'](function(_0x1decd1){_0x571839(_0x1decd1);});});}function updateMailInteraction(_0x5b0407,_0x3496eb,_0x5fd540,_0x2ee193){return new BPromise(function(_0x3f28f,_0x1d4c0f){return getInteractionUsers(_0x5b0407,_0x5fd540)[_0x2f07('0x1d')](function(_0x153792){return getInteractionTags(_0x153792,_0x3496eb);})[_0x2f07('0x1d')](function(_0xafaa66){return getStateInteraction(_0xafaa66);})[_0x2f07('0x1d')](function(_0x2fafba){if(_0x2ee193){_0x3f28f(getLastMessageText(_0x2fafba));}else{_0x3f28f(_0x2fafba);}})[_0x2f07('0x32')](function(_0xa74d2c){_0x1d4c0f(_0xa74d2c);});});}function getStateInteraction(_0x2cadb1){return new BPromise(function(_0x461155){_0x2cadb1[_0x2f07('0x33')]=0x0;_0x2cadb1['talking']=0x0;_0x2cadb1['answered']=0x0;_0x2cadb1[_0x2f07('0x34')]=0x0;_0x2cadb1[_0x2f07('0x35')]=0x0;if(!_0x2cadb1[_0x2f07('0x36')]&&!_0x2cadb1['UserId']){_0x2cadb1['waiting']+=0x1;}if(!_0x2cadb1[_0x2f07('0x36')]&&_0x2cadb1['UserId']){_0x2cadb1[_0x2f07('0x37')]+=0x1;if(_0x2cadb1[_0x2f07('0x33')]){_0x2cadb1[_0x2f07('0x33')]-=0x1;}}if(_0x2cadb1[_0x2f07('0x36')]&&_0x2cadb1[_0x2f07('0x38')]){_0x2cadb1['answered']+=0x1;if(_0x2cadb1[_0x2f07('0x37')]){_0x2cadb1['talking']-=0x1;}}if(_0x2cadb1[_0x2f07('0x36')]&&!_0x2cadb1['UserId']){_0x2cadb1[_0x2f07('0x34')]+=0x1;if(_0x2cadb1['waiting']){_0x2cadb1['waiting']-=0x1;}}_0x2cadb1[_0x2f07('0x35')]+=0x1;_0x461155(_0x2cadb1);});}exports[_0x2f07('0x39')]=function(_0x5e96b5,_0x3e4e48){var _0x52b0ba={},_0x429ae1={},_0x4e4997={'count':0x0,'rows':[]};var _0x17b88f=_[_0x2f07('0x24')](db[_0x2f07('0x3a')][_0x2f07('0x3b')],function(_0x25b1a9){return{'name':_0x25b1a9[_0x2f07('0x3c')],'type':_0x25b1a9[_0x2f07('0x3d')][_0x2f07('0x3e')]};});_0x429ae1['model']=_[_0x2f07('0x24')](_0x17b88f,_0x2f07('0x21'));_0x429ae1[_0x2f07('0x3f')]=_[_0x2f07('0x40')](_0x5e96b5[_0x2f07('0x3f')]);_0x429ae1[_0x2f07('0x41')]=_[_0x2f07('0x42')](_0x429ae1['model'],_0x429ae1[_0x2f07('0x3f')]);_0x52b0ba[_0x2f07('0x43')]=_[_0x2f07('0x42')](_0x429ae1[_0x2f07('0x44')],qs[_0x2f07('0x45')](_0x5e96b5[_0x2f07('0x3f')]['fields']));_0x52b0ba[_0x2f07('0x43')]=_0x52b0ba[_0x2f07('0x43')][_0x2f07('0x46')]?_0x52b0ba[_0x2f07('0x43')]:_0x429ae1['model'];if(!_0x5e96b5['query'][_0x2f07('0x47')](_0x2f07('0x48'))){_0x52b0ba[_0x2f07('0x19')]=qs[_0x2f07('0x19')](_0x5e96b5['query'][_0x2f07('0x19')]);_0x52b0ba[_0x2f07('0x17')]=qs[_0x2f07('0x17')](_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x17')]);}_0x52b0ba[_0x2f07('0x49')]=qs[_0x2f07('0x4a')](_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x4a')]);_0x52b0ba[_0x2f07('0x4b')]=qs['filters'](_['pick'](_0x5e96b5['query'],_0x429ae1[_0x2f07('0x41')]),_0x17b88f);var _0x320ad1=[];var _0x5a4963=squel[_0x2f07('0x4c')]()['field']('id')[_0x2f07('0x4d')](_0x2f07('0x21'))[_0x2f07('0x4d')]('color')[_0x2f07('0x4e')](_0x2f07('0x4f'));var _0x47b17f=squel['select']()[_0x2f07('0x4d')](_0x2f07('0x50'))[_0x2f07('0x4d')](_0x2f07('0x51'))[_0x2f07('0x4d')](_0x2f07('0x52'))[_0x2f07('0x4e')](_0x2f07('0x53'),'ui')[_0x2f07('0x54')](_0x2f07('0x55'),'u',_0x2f07('0x56'));var _0x9a94c8=squel[_0x2f07('0x4c')]()[_0x2f07('0x4e')](_0x2f07('0x57'),'i')[_0x2f07('0x54')]('cm_contacts','c',_0x2f07('0x58'))[_0x2f07('0x54')](_0x2f07('0x55'),'o',_0x2f07('0x59'))[_0x2f07('0x54')](_0x2f07('0x5a'),'a',_0x2f07('0x5b'))[_0x2f07('0x54')](_0x2f07('0x5c'),'me','me.MailInteractionId\x20=\x20i.id')[_0x2f07('0x54')](_0x2f07('0x5d'),'it',_0x2f07('0x5e'))[_0x2f07('0x54')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x2044e8=squel[_0x2f07('0x5f')]();var _0x54225b=[];var _0x510b35=squel[_0x2f07('0x5f')]();var _0x4fe585;if(_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x60')]){_0x4fe585=as[_0x2f07('0x61')](_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x60')]);var _0x261e22=_0x4fe585[_0x2f07('0x62')];for(var _0x3a87a6=0x0;_0x3a87a6<_0x4fe585[_0x2f07('0x63')][_0x2f07('0x46')];_0x3a87a6++){var _0x49dfeb=_0x4fe585[_0x2f07('0x63')][_0x3a87a6];var _0x399072='i';var _0x380159=_[_0x2f07('0x64')](_0x17b88f,['name',_0x49dfeb[_0x2f07('0x4d')]]);if(!_0x380159){switch(_0x49dfeb['field']){case'unreadMessages':if(_0x49dfeb['value']==0x1){_0x9a94c8[_0x2f07('0x65')]('`'+_0x49dfeb[_0x2f07('0x4d')]+_0x2f07('0x66'));}else{_0x9a94c8[_0x2f07('0x65')]('`'+_0x49dfeb[_0x2f07('0x4d')]+'`\x20>\x200');}break;case _0x2f07('0x67'):if(_0x49dfeb[_0x2f07('0x68')]===_0x2f07('0x69')){if(_0x49dfeb['value'][_0x2f07('0x28')]('\x20')['length']>0x1){_0x2044e8[_0x261e22](_0x2f07('0x6a'),qs['getFullTextValue'](_0x49dfeb[_0x2f07('0x6b')]),null);}else{var _0x3e7224='%'+_0x49dfeb[_0x2f07('0x6b')]+'%';_0x2044e8[_0x261e22](_0x2f07('0x6c'),_0x3e7224,_0x3e7224,_0x3e7224);}}else{_0x380159=_[_0x2f07('0x64')](_0x17b88f,[_0x2f07('0x21'),_0x2f07('0x6d')]);_0x49dfeb[_0x2f07('0x4d')]=_0x2f07('0x6d');_0x1c49f3=as[_0x2f07('0x6e')](_0x399072,_0x380159['type'],_0x49dfeb);_0x2044e8[_0x261e22](_0x1c49f3['text'],_0x1c49f3[_0x2f07('0x6b')]['start'],_0x1c49f3['value']['end']);}break;case'Tag':var _0x295959=_0x49dfeb['value'][_0x2f07('0x28')](',')[_0x2f07('0x24')](function(_0x183d56){return Number(_0x183d56);});_0x295959[_0x2f07('0x29')](function(_0x48caed){_0x510b35['or'](_0x2f07('0x6f'),'%,'+_0x48caed+',%');});_0x54225b=_[_0x2f07('0x70')](_0x54225b,_0x295959);break;case _0x2f07('0x71'):if(_0x49dfeb[_0x2f07('0x68')]==='$substring'){_0x2044e8[_0x261e22](_0x2f07('0x72'),'%'+_0x49dfeb[_0x2f07('0x6b')]+'%',null);}else{_0x380159=_[_0x2f07('0x64')](_0x17b88f,[_0x2f07('0x21'),'UserId']);_0x49dfeb[_0x2f07('0x4d')]=_0x2f07('0x38');_0x1c49f3=as[_0x2f07('0x6e')](_0x399072,_0x380159[_0x2f07('0x3d')],_0x49dfeb);_0x2044e8[_0x261e22](_0x1c49f3['text'],_0x1c49f3[_0x2f07('0x6b')]['start'],_0x1c49f3[_0x2f07('0x6b')][_0x2f07('0x73')]);}break;case _0x2f07('0x2f'):_0x1c49f3=as[_0x2f07('0x6e')]('me',null,_0x49dfeb);_0x2044e8[_0x261e22](_0x1c49f3['text'],_0x1c49f3[_0x2f07('0x6b')][_0x2f07('0x74')],_0x1c49f3['value'][_0x2f07('0x73')]);break;}}else{var _0x1c49f3=as['buildExpression'](_0x399072,_0x380159[_0x2f07('0x3d')],_0x49dfeb);_0x2044e8[_0x261e22](_0x1c49f3[_0x2f07('0x75')],_0x1c49f3[_0x2f07('0x6b')]['start'],_0x1c49f3['value'][_0x2f07('0x73')]);}}}else{var _0x1e0625=_(_0x5e96b5['query'])[_0x2f07('0x40')]()[_0x2f07('0x24')](function(_0x176cd3){return _[_0x2f07('0x76')](_0x17b88f,[_0x2f07('0x21'),_0x176cd3])?_0x176cd3:undefined;})[_0x2f07('0x77')]()[_0x2f07('0x6b')]();if(!_[_0x2f07('0x78')](_0x1e0625)){_0x1e0625['forEach'](function(_0x5cc8f8){if(_0x5cc8f8==='MailAccountId'){_0x9a94c8['where']('i.MailAccountId\x20IN\x20?',[]['concat'](_0x5e96b5['query'][_0x5cc8f8]));}else if(_0x5cc8f8===_0x2f07('0x79')){var _0x46f607=JSON[_0x2f07('0x7a')](_0x5e96b5[_0x2f07('0x3f')][_0x5cc8f8])['$gte'];var _0x2fb109=JSON[_0x2f07('0x7a')](_0x5e96b5[_0x2f07('0x3f')][_0x5cc8f8])[_0x2f07('0x7b')];_0x9a94c8['where'](_0x2f07('0x7c'),_0x46f607,_0x2fb109);}else{if(_0x5e96b5[_0x2f07('0x3f')][_0x5cc8f8]==='null'){_0x9a94c8['where']('i.'+_0x5cc8f8+'\x20IS\x20NULL');}else{_0x9a94c8['where']('i.'+_0x5cc8f8+_0x2f07('0x7d'),_0x5e96b5[_0x2f07('0x3f')][_0x5cc8f8]);}}});}if(_0x5e96b5[_0x2f07('0x3f')]['read']){if(_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x7e')]==0x1){_0x9a94c8[_0x2f07('0x65')](_0x2f07('0x7f'));}else{_0x9a94c8[_0x2f07('0x65')](_0x2f07('0x80'));}}if(_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x81')]){_0x54225b=_['isArray'](_0x5e96b5['query'][_0x2f07('0x81')])?_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x81')]:new Array(_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x81')]);_0x54225b[_0x2f07('0x29')](function(_0xc4c1c6){_0x510b35['or'](_0x2f07('0x6f'),'%,'+_0xc4c1c6+',%');});}if(_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x82')]){var _0xfae3d=_0x5e96b5['query'][_0x2f07('0x82')][_0x2f07('0x83')]('\x5c','\x5c\x5c')[_0x2f07('0x83')](/'/g,'\x27\x27');if(qs[_0x2f07('0x84')](_0xfae3d)){_0x2044e8['or'](_0x2f07('0x85'),_0xfae3d+'%');}else if(qs['isEmail'](_0xfae3d)){_0x2044e8['or'](_0x2f07('0x86'),_0xfae3d+'%');}else{_0x2044e8['or'](_0x2f07('0x87'),qs[_0x2f07('0x88')](_0xfae3d))['or'](_0x2f07('0x89'),qs[_0x2f07('0x88')](_0xfae3d));}}}_0x9a94c8[_0x2f07('0x4b')](_0x2044e8);_0x9a94c8['group'](_0x2f07('0x8a'));var _0x33d20b={'type':db['Sequelize'][_0x2f07('0x8b')][_0x2f07('0x8c')],'raw':!![]};var _0x277eae=_0x9a94c8['clone']();_0x277eae[_0x2f07('0x4d')](_0x2f07('0x8a'));_0x277eae['field'](_0x2f07('0x8d'),'unreadMessages');if(_0x52b0ba[_0x2f07('0x49')]){_0x52b0ba[_0x2f07('0x49')][_0x2f07('0x29')](function(_0x3c795f){var _0x3377cf=_0x3c795f[0x0]===_0x2f07('0x8e')?_0x3c795f[0x0]:'i.'+_0x3c795f[0x0];_0x9a94c8[_0x2f07('0x49')](_0x3377cf,_0x3c795f[0x1]===_0x2f07('0x8f')?![]:!![]);});}if(!_[_0x2f07('0x78')](_0x54225b)){_0x9a94c8['having'](_0x510b35);_0x277eae[_0x2f07('0x4b')](_0x2f07('0x90'),_0x54225b);}BPromise[_0x2f07('0x91')]()[_0x2f07('0x1d')](function(){if(!_0x4fe585){if(_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x92')])return;_0x277eae['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x9a94c8[_0x2f07('0x4b')](_0x2f07('0x93'));return;}if(_0x5e96b5[_0x2f07('0x94')][_0x2f07('0x95')]!=='agent')return;return _0x5e96b5[_0x2f07('0x94')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x2f07('0x1d')](function(_0x5dfc86){if(_[_0x2f07('0x78')](_0x5dfc86)){_0x277eae[_0x2f07('0x4b')](_0x2f07('0x96'));_0x9a94c8[_0x2f07('0x4b')](_0x2f07('0x96'));}else{_0x277eae[_0x2f07('0x4b')](_0x2f07('0x97'),_[_0x2f07('0x24')](_0x5dfc86,'id'));_0x9a94c8[_0x2f07('0x4b')](_0x2f07('0x97'),_['map'](_0x5dfc86,'id'));}});})[_0x2f07('0x1d')](function(){if(_0x5e96b5['user'][_0x2f07('0x95')]===_0x2f07('0x98')&&!_0x4fe585&&!_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x92')])return[];return db[_0x2f07('0x99')]['query'](_0x277eae[_0x2f07('0x9a')](),_0x33d20b);})[_0x2f07('0x1d')](function(_0xd4675){_0x4e4997['count']=_0xd4675['length'];if(_0x4e4997['count']===0x0)return[];return db['sequelize'][_0x2f07('0x3f')](_0x5a4963[_0x2f07('0x9a')](),_0x33d20b)[_0x2f07('0x1d')](function(_0x5d1fca){_0x320ad1=_[_0x2f07('0x9b')](_0x5d1fca,'id');_0x33d20b=_[_0x2f07('0x9c')](_0x33d20b,{'model':db[_0x2f07('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5e96b5[_0x2f07('0x3f')][_0x2f07('0x45')]){_0x52b0ba[_0x2f07('0x43')][_0x2f07('0x29')](function(_0x5f57ba){_0x9a94c8[_0x2f07('0x4d')]('i.'+_0x5f57ba);});}else{_0x9a94c8['field'](_0x2f07('0x8d'),_0x2f07('0x9d'));_0x9a94c8['field']('a.key',_0x2f07('0x9e'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0x9f'),_0x2f07('0xa0'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xa1'),_0x2f07('0x8e'));_0x9a94c8['field'](_0x2f07('0x8a'));_0x9a94c8[_0x2f07('0x4d')]('i.createdAt');_0x9a94c8['field'](_0x2f07('0xa2'));_0x9a94c8['field']('i.closed');_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xa3'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xa4'));_0x9a94c8['field'](_0x2f07('0xa5'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xa6'));_0x9a94c8['field'](_0x2f07('0xa7'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xa8'));_0x9a94c8['field']('i.secondDisposition');_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xa9'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xaa'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xab'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xac'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xad'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xae'));_0x9a94c8['field'](_0x2f07('0xaf'),_0x2f07('0xb0'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xb1'),_0x2f07('0xb2'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xb3'),'Contact.email');_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xb4'),_0x2f07('0xb5'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xb6'),'Contact.mobile');_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xb7'),_0x2f07('0xb8'));_0x9a94c8[_0x2f07('0x4d')](_0x2f07('0xb9'),_0x2f07('0xba'));_0x9a94c8[_0x2f07('0x4d')]('o.internal',_0x2f07('0xbb'));_0x9a94c8[_0x2f07('0x4d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2f07('0x26'));}if(_0x52b0ba['limit'])_0x9a94c8[_0x2f07('0x19')](_0x52b0ba['limit']);if(_0x52b0ba[_0x2f07('0x17')])_0x9a94c8[_0x2f07('0x17')](_0x52b0ba[_0x2f07('0x17')]);return db[_0x2f07('0x99')][_0x2f07('0x3f')](_0x9a94c8['toString'](),_0x33d20b);})[_0x2f07('0x1d')](function(_0x357f3a){if(_0x357f3a[_0x2f07('0x46')]>0x0)_0x47b17f[_0x2f07('0x4b')](_0x2f07('0xbc'),_[_0x2f07('0x24')](_0x357f3a,'id'));return db[_0x2f07('0x99')]['query'](_0x47b17f[_0x2f07('0x9a')](),_0x33d20b)[_0x2f07('0x1d')](function(_0x400cf0){var _0xea5218=_[_0x2f07('0xbd')](_0x400cf0,_0x2f07('0xbe'));var _0x4ebfc3=[];return db[_0x2f07('0xbf')][_0x2f07('0x2c')]({'attributes':[_0x2f07('0xc0')],'raw':!![]})[_0x2f07('0x1d')](function(_0x270083){var _0x493ff6=_0x270083[_0x2f07('0xc0')];_0x357f3a['forEach'](function(_0x1f853b){_0x4ebfc3[_0x2f07('0x2a')](updateMailInteraction(_0x1f853b,_0x320ad1,_0xea5218,_0x493ff6));});return BPromise['all'](_0x4ebfc3);});});});})[_0x2f07('0x1d')](function(_0x2a6ef7){_0x4e4997['rows']=_0x2a6ef7;return _0x4e4997;})[_0x2f07('0x1d')](respondWithFilteredResult(_0x3e4e48,_0x52b0ba))[_0x2f07('0x32')](handleError(_0x3e4e48,null));};exports['show']=function(_0x3817e3,_0x167a0f){var _0x29b6ff={'raw':![],'where':{'id':_0x3817e3['params']['id']}},_0x19d84a={};_0x19d84a[_0x2f07('0x44')]=_['keys'](db[_0x2f07('0x3a')][_0x2f07('0x3b')]);_0x19d84a[_0x2f07('0x3f')]=_['keys'](_0x3817e3[_0x2f07('0x3f')]);_0x19d84a[_0x2f07('0x41')]=_[_0x2f07('0x42')](_0x19d84a[_0x2f07('0x44')],_0x19d84a['query']);_0x29b6ff[_0x2f07('0x43')]=_['intersection'](_0x19d84a[_0x2f07('0x44')],qs['fields'](_0x3817e3[_0x2f07('0x3f')]['fields']));_0x29b6ff[_0x2f07('0x43')]=_0x29b6ff[_0x2f07('0x43')][_0x2f07('0x46')]?_0x29b6ff[_0x2f07('0x43')]:_0x19d84a['model'];if(_0x3817e3[_0x2f07('0x3f')][_0x2f07('0xc1')]){_0x29b6ff['include']=[{'all':!![]}];}_0x29b6ff=_['merge']({},_0x29b6ff,_0x3817e3[_0x2f07('0xc2')]);return db[_0x2f07('0x3a')][_0x2f07('0x64')](_0x29b6ff)[_0x2f07('0x1d')](handleEntityNotFound(_0x167a0f,null))[_0x2f07('0x1d')](respondWithResult(_0x167a0f,null))[_0x2f07('0x32')](handleError(_0x167a0f,null));};exports[_0x2f07('0xc3')]=function(_0x383302,_0xe5e7f4){return db['MailInteraction'][_0x2f07('0xc3')](_0x383302['body'],{})['then'](respondWithResult(_0xe5e7f4,0xc9))['catch'](handleError(_0xe5e7f4,null));};exports['update']=function(_0x4b45d5,_0x41aa60){if(_0x4b45d5[_0x2f07('0xc4')]['id']){delete _0x4b45d5['body']['id'];}return db[_0x2f07('0x3a')][_0x2f07('0x64')]({'where':{'id':_0x4b45d5[_0x2f07('0xc5')]['id']}})['then'](handleEntityNotFound(_0x41aa60,null))['then'](saveUpdates(_0x4b45d5[_0x2f07('0xc4')],null))[_0x2f07('0x1d')](respondWithResult(_0x41aa60,null))[_0x2f07('0x32')](handleError(_0x41aa60,null));};exports[_0x2f07('0x1e')]=function(_0x537c77,_0x3da09f){return db['MailInteraction'][_0x2f07('0x64')]({'where':{'id':_0x537c77[_0x2f07('0xc5')]['id']}})['then'](handleEntityNotFound(_0x3da09f,null))[_0x2f07('0x1d')](removeEntity(_0x3da09f,null))['catch'](handleError(_0x3da09f,null));};exports['describe']=function(_0x2d73f6,_0x331a9e){return db[_0x2f07('0x3a')]['describe']()[_0x2f07('0x1d')](respondWithResult(_0x331a9e,null))[_0x2f07('0x32')](handleError(_0x331a9e,null));};exports['addMessage']=function(_0x436390,_0x27c873){return db[_0x2f07('0x2b')]['find']({'where':{'id':_0x436390[_0x2f07('0xc5')]['id']}})[_0x2f07('0x1d')](handleEntityNotFound(_0x27c873,null))[_0x2f07('0x1d')](function(_0x59a4fb){if(_0x59a4fb){return _0x59a4fb[_0x2f07('0xc6')](_0x436390[_0x2f07('0xc4')][_0x2f07('0xc7')],_[_0x2f07('0xc8')](_0x436390[_0x2f07('0xc4')],[_0x2f07('0xc7'),'id'])||{});}})[_0x2f07('0x1d')](respondWithResult(_0x27c873,null))[_0x2f07('0x32')](handleError(_0x27c873,null));};exports[_0x2f07('0xc9')]=function(_0x418f84,_0x452982){var _0x3c7d02={'raw':![],'where':{}};var _0xea6c54={};var _0x5993a5={'count':0x0,'rows':[]};return db[_0x2f07('0x3a')][_0x2f07('0x2c')]({'where':{'id':_0x418f84[_0x2f07('0xc5')]['id']}})[_0x2f07('0x1d')](handleEntityNotFound(_0x452982,null))[_0x2f07('0x1d')](function(_0x29b18d){if(_0x29b18d){_0xea6c54[_0x2f07('0x44')]=_['keys'](db[_0x2f07('0x2b')]['rawAttributes']);_0xea6c54['query']=_[_0x2f07('0x40')](_0x418f84[_0x2f07('0x3f')]);_0xea6c54[_0x2f07('0x41')]=_[_0x2f07('0x42')](_0xea6c54[_0x2f07('0x44')],_0xea6c54[_0x2f07('0x3f')]);_0x3c7d02['attributes']=_[_0x2f07('0x42')](_0xea6c54[_0x2f07('0x44')],qs[_0x2f07('0x45')](_0x418f84[_0x2f07('0x3f')][_0x2f07('0x45')]));_0x3c7d02[_0x2f07('0x43')]=_0x3c7d02[_0x2f07('0x43')]['length']?_0x3c7d02[_0x2f07('0x43')]:_0xea6c54['model'];if(!_0x418f84[_0x2f07('0x3f')]['hasOwnProperty'](_0x2f07('0x48'))){_0x3c7d02[_0x2f07('0x19')]=qs[_0x2f07('0x19')](_0x418f84['query'][_0x2f07('0x19')]);_0x3c7d02[_0x2f07('0x17')]=qs['offset'](_0x418f84[_0x2f07('0x3f')][_0x2f07('0x17')]);}_0x3c7d02[_0x2f07('0x49')]=qs[_0x2f07('0x4a')](_0x418f84[_0x2f07('0x3f')][_0x2f07('0x4a')]);_0x3c7d02['where']=qs[_0x2f07('0x41')](_[_0x2f07('0xca')](_0x418f84[_0x2f07('0x3f')],_0xea6c54[_0x2f07('0x41')]));_0x3c7d02[_0x2f07('0x4b')]['MailInteractionId']=_0x29b18d['id'];if(_0x418f84[_0x2f07('0x3f')][_0x2f07('0x82')]){_0x3c7d02[_0x2f07('0x4b')]=_[_0x2f07('0x9c')](_0x3c7d02[_0x2f07('0x4b')],{'$or':_[_0x2f07('0x24')](_0x3c7d02['attributes'],function(_0x5633f9){var _0x7d67dc={};_0x7d67dc[_0x5633f9]={'$like':'%'+_0x418f84[_0x2f07('0x3f')]['filter']+'%'};return _0x7d67dc;})});}if(_0x418f84[_0x2f07('0x3f')][_0x2f07('0xcb')]){var _0x3daa25=_0x418f84[_0x2f07('0x3f')][_0x2f07('0xcb')][_0x2f07('0x28')](',');var _0x4e1f40={};_0x4e1f40[_0x3daa25[0x0]]={'$gte':moment(_0x3daa25[0x1])[_0x2f07('0xcc')](_0x2f07('0xcd'))};_0x3c7d02[_0x2f07('0x4b')]=_['merge'](_0x3c7d02[_0x2f07('0x4b')],_0x4e1f40);}_0x3c7d02=_['merge']({},_0x3c7d02,_0x418f84[_0x2f07('0xc2')]);return db['MailMessage'][_0x2f07('0x1a')]({'where':_0x3c7d02['where']})[_0x2f07('0x1d')](function(_0x4d9657){_0x5993a5[_0x2f07('0x1a')]=_0x4d9657;if(_0x418f84[_0x2f07('0x3f')]['includeAll']){_0x3c7d02[_0x2f07('0xce')]=[{'all':!![]}];}return db['MailMessage'][_0x2f07('0xcf')](_0x3c7d02);})[_0x2f07('0x1d')](function(_0x58aade){if(_0x418f84['query']['inlineCss']==='true'){for(var _0x281411=0x0;_0x281411<_0x58aade['length'];_0x281411++){_0x58aade[_0x281411]['body']=juice(_0x58aade[_0x281411]['body']);}}_0x5993a5[_0x2f07('0xd0')]=_0x58aade;return _0x5993a5;});}})[_0x2f07('0x1d')](respondWithFilteredResult(_0x452982,_0x3c7d02))['catch'](handleError(_0x452982,null));};exports[_0x2f07('0xd1')]=function(_0x1a2e4f,_0x51b334){return db[_0x2f07('0x3a')][_0x2f07('0x64')]({'where':{'id':_0x1a2e4f[_0x2f07('0xc5')]['id']}})[_0x2f07('0x1d')](handleEntityNotFound(_0x51b334,null))['then'](function(_0x51d928){if(_0x51d928){return _0x51d928[_0x2f07('0xd2')](_0x1a2e4f['body'][_0x2f07('0xc7')],_[_0x2f07('0xc8')](_0x1a2e4f[_0x2f07('0xc4')],[_0x2f07('0xc7'),'id'])||{})['spread'](function(){return db[_0x2f07('0xd3')]['findAll']({'attributes':['id',_0x2f07('0x21'),_0x2f07('0xd4')],'where':{'id':_0x1a2e4f[_0x2f07('0xc4')]['ids']}});})[_0x2f07('0x1d')](function(_0x53d692){socket[_0x2f07('0xd5')](_0x2f07('0xd6'),{'id':Number(_0x1a2e4f[_0x2f07('0xc5')]['id']),'tags':_0x53d692||[]});return{'id':Number(_0x1a2e4f[_0x2f07('0xc5')]['id']),'tags':_0x53d692||[]};});}})[_0x2f07('0x1d')](respondWithResult(_0x51b334,null))[_0x2f07('0x32')](handleError(_0x51b334,null));};exports[_0x2f07('0xd7')]=function(_0x503dfb,_0x3fc941){return db[_0x2f07('0x3a')][_0x2f07('0x64')]({'where':{'id':_0x503dfb[_0x2f07('0xc5')]['id']}})[_0x2f07('0x1d')](handleEntityNotFound(_0x3fc941,null))['then'](function(_0x5db072){if(_0x5db072){return _0x5db072[_0x2f07('0xd7')](_0x503dfb[_0x2f07('0x3f')][_0x2f07('0xc7')]);}})['then'](respondWithStatusCode(_0x3fc941,null))['catch'](handleError(_0x3fc941,null));};exports[_0x2f07('0xd8')]=function(_0x5997e7,_0x19560e){var _0x246e0e=moment()[_0x2f07('0xd9')]()[_0x2f07('0x9a')]();var _0x57bb55=path[_0x2f07('0xda')](config[_0x2f07('0xdb')],_0x2f07('0xdc'),_0x2f07('0xdd'),'tmp');var _0x8a036a=path[_0x2f07('0xda')](config[_0x2f07('0xdb')],_0x2f07('0xdc'),_0x2f07('0xdd'),_0x2f07('0xde'));var _0x1cc4a7=path[_0x2f07('0xda')](_0x57bb55,_0x246e0e);var _0x47f351=util[_0x2f07('0xcc')](_0x2f07('0xdf'),_0x5997e7[_0x2f07('0xc5')]['id'],_0x246e0e);var _0xe44515=path['join'](_0x57bb55,_0x47f351);var _0x5d11eb=[];if(_0x5997e7[_0x2f07('0x3f')][_0x2f07('0xde')]){_0x5d11eb['push']({'model':db[_0x2f07('0xe0')],'as':_0x2f07('0xe1'),'raw':!![]});}var _0x229857=[{'model':db[_0x2f07('0x2b')],'as':_0x2f07('0xe2'),'attributes':['id',_0x2f07('0xc4'),_0x2f07('0x4e'),'to','cc',_0x2f07('0xe3'),_0x2f07('0xe4'),'createdAt'],'where':{'secret':![]},'order':qs[_0x2f07('0x4a')]('id'),'include':_0x5d11eb}];return db[_0x2f07('0x3a')][_0x2f07('0x64')]({'where':{'id':_0x5997e7[_0x2f07('0xc5')]['id']},'include':_0x229857})[_0x2f07('0x1d')](handleEntityNotFound(_0x19560e,null))['then'](function(_0x1df272){if(_0x1df272&&_0x1df272[_0x2f07('0xe2')]){var _0x1ee4bc=_0x1df272[_0x2f07('0xe5')]({'plain':!![]});fs[_0x2f07('0xe6')](_0x1cc4a7);return BPromise['each'](_0x1ee4bc[_0x2f07('0xe2')],function(_0x2ec246,_0x231979){var _0xb58d6e={'from':_0x2ec246[_0x2f07('0x4e')],'to':_0x2ec246['to'],'subject':_0x2ec246[_0x2f07('0xe4')],'html':htmlEntities['decode'](_0x2ec246[_0x2f07('0xc4')]),'headers':{'Date':moment(_0x2ec246[_0x2f07('0x79')])[_0x2f07('0xcc')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2ec246['cc']){_0xb58d6e['headers']['Cc']=_0x2ec246['cc'];}if(_0x2ec246[_0x2f07('0xe3')]){_0xb58d6e['headers'][_0x2f07('0xe7')]=_0x2ec246['bcc'];}return new BPromise(function(_0xbdbf95,_0x11a6ae){if(_0x2ec246[_0x2f07('0xe1')]){for(var _0x4d9c52=0x0;_0x4d9c52<_0x2ec246[_0x2f07('0xe1')][_0x2f07('0x46')];_0x4d9c52++){var _0x594172=_0x2ec246[_0x2f07('0xe1')][_0x4d9c52];var _0x3a94fc=path['join'](_0x8a036a,_0x594172['basename']);if(fs['existsSync'](_0x3a94fc)){_0xb58d6e[_0x2f07('0xde')]['push']({'name':_0x594172[_0x2f07('0x21')],'contentType':_0x594172['type'],'data':fs[_0x2f07('0xe8')](_0x3a94fc)});}}}emlformat[_0x2f07('0xe9')](_0xb58d6e,function(_0x47290b,_0x5e5136){if(_0x47290b)return _0x11a6ae(_0x47290b);fs[_0x2f07('0xea')](path[_0x2f07('0xda')](_0x1cc4a7,util[_0x2f07('0xcc')]('message%d.eml',_0x231979)),_0x5e5136);return _0xbdbf95(_0x5e5136);});});})[_0x2f07('0x1d')](function(){return new BPromise(function(_0x5c2a4d,_0xd6f65a){zipdir(_0x1cc4a7,{'saveTo':_0xe44515},function(_0x22a93a,_0x44a55c){if(_0x22a93a)return _0xd6f65a(_0x22a93a);return _0x5c2a4d(_0x44a55c);});})[_0x2f07('0x1d')](function(){return new BPromise(function(_0x132e7f,_0x444217){rimraf(_0x1cc4a7,function(_0x2eea15){if(_0x2eea15)_0x444217(_0x2eea15);return _0x132e7f();});});})[_0x2f07('0x1d')](function(){return _0x19560e[_0x2f07('0xd8')](_0xe44515,_0x47f351,function(_0x35b8a6){if(!_0x35b8a6)fs[_0x2f07('0xeb')](_0xe44515);});});});}else{return _0x19560e['sendStatus'](0xc8);}})[_0x2f07('0x32')](handleError(_0x19560e,null));};
\ No newline at end of file
index c3bc7a9..131e44f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddd7=['map','setDataValue','length','emit','catch','hasOwnProperty','exports','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','then'];(function(_0x20f8e0,_0xb9e6f4){var _0x2c2719=function(_0x3df71b){while(--_0x3df71b){_0x20f8e0['push'](_0x20f8e0['shift']());}};_0x2c2719(++_0xb9e6f4);}(_0xddd7,0x16f));var _0x7ddd=function(_0x19da7e,_0x180593){_0x19da7e=_0x19da7e-0x0;var _0x36b05e=_0xddd7[_0x19da7e];return _0x36b05e;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x7ddd('0x0'))['db'][_0x7ddd('0x1')];var MailMessage=require(_0x7ddd('0x0'))['db'][_0x7ddd('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7ddd('0x3'),'afterUpdate':_0x7ddd('0x4'),'afterDestroy':_0x7ddd('0x5')};function emitEvent(_0x414495){return function(_0x1f68cd,_0xe9ec40,_0x5a9894){_0x1f68cd[_0x7ddd('0x6')]({'attributes':['id'],'raw':!![]})[_0x7ddd('0x7')](function(_0x16bd38){_0x1f68cd['setDataValue']('Users',_0x16bd38[_0x7ddd('0x8')](function(_0xbf347e){return{'id':_0xbf347e['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1f68cd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7ddd('0x7')](function(_0x3bfb35){_0x1f68cd[_0x7ddd('0x9')]('unreadMessages',_0x3bfb35[_0x7ddd('0xa')]);MailInteractionEvents[_0x7ddd('0xb')](_0x414495+':'+_0x1f68cd['id'],_0x1f68cd);MailInteractionEvents[_0x7ddd('0xb')](_0x414495,_0x1f68cd);_0x5a9894(null);})[_0x7ddd('0xc')](_0x5a9894(null));};}for(var e in events){if(events[_0x7ddd('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x7ddd('0xe')]=MailInteractionEvents;
\ No newline at end of file
+var _0x4cb0=['exports','events','../../mysqldb','MailInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch'];(function(_0x1ebdfc,_0x30be16){var _0x236e88=function(_0x3c7635){while(--_0x3c7635){_0x1ebdfc['push'](_0x1ebdfc['shift']());}};_0x236e88(++_0x30be16);}(_0x4cb0,0xde));var _0x04cb=function(_0x5843c3,_0x4eca61){_0x5843c3=_0x5843c3-0x0;var _0x36388f=_0x4cb0[_0x5843c3];return _0x36388f;};'use strict';var EventEmitter=require(_0x04cb('0x0'));var MailInteraction=require(_0x04cb('0x1'))['db'][_0x04cb('0x2')];var MailMessage=require(_0x04cb('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x04cb('0x3')](0x0);var events={'afterCreate':_0x04cb('0x4'),'afterUpdate':_0x04cb('0x5'),'afterDestroy':_0x04cb('0x6')};function emitEvent(_0x5ec2d1){return function(_0x45baba,_0x44dfe9,_0x346813){_0x45baba[_0x04cb('0x7')]({'attributes':['id'],'raw':!![]})[_0x04cb('0x8')](function(_0x295824){_0x45baba[_0x04cb('0x9')](_0x04cb('0xa'),_0x295824[_0x04cb('0xb')](function(_0x416a24){return{'id':_0x416a24['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x45baba['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2ef76b){_0x45baba[_0x04cb('0x9')](_0x04cb('0xc'),_0x2ef76b[_0x04cb('0xd')]);MailInteractionEvents[_0x04cb('0xe')](_0x5ec2d1+':'+_0x45baba['id'],_0x45baba);MailInteractionEvents[_0x04cb('0xe')](_0x5ec2d1,_0x45baba);_0x346813(null);})[_0x04cb('0xf')](_0x346813(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x04cb('0x10')]=MailInteractionEvents;
\ No newline at end of file
index 00477af..87728db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe33e=['closed','changed','substatus','closedAt','models','get','MailMessage','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1056c0,_0x115343){var _0x5a00d2=function(_0x4b5c0f){while(--_0x4b5c0f){_0x1056c0['push'](_0x1056c0['shift']());}};_0x5a00d2(++_0x115343);}(_0xe33e,0x1db));var _0xee33=function(_0x3925a0,_0x39e38b){_0x3925a0=_0x3925a0-0x0;var _0x21d0f8=_0xe33e[_0x3925a0];return _0x21d0f8;};'use strict';var _=require(_0xee33('0x0'));var util=require('util');var logger=require(_0xee33('0x1'))(_0xee33('0x2'));var moment=require(_0xee33('0x3'));var BPromise=require(_0xee33('0x4'));var rp=require(_0xee33('0x5'));var fs=require('fs');var path=require(_0xee33('0x6'));var rimraf=require(_0xee33('0x7'));var config=require(_0xee33('0x8'));var attributes=require(_0xee33('0x9'));module[_0xee33('0xa')]=function(_0x1cb1ad,_0x466f70){return _0x1cb1ad[_0xee33('0xb')](_0xee33('0xc'),attributes,{'tableName':_0xee33('0xd'),'paranoid':![],'indexes':[{'name':_0xee33('0xe'),'fields':['subject','to'],'type':_0xee33('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x49c6e1,_0x252f2a,_0x19bfd1){if(_0x49c6e1['substatus']){_0x49c6e1[_0xee33('0x10')]=moment()[_0xee33('0x11')](_0xee33('0x12'));}if(_0x49c6e1[_0xee33('0x13')]){_0x49c6e1['closedAt']=moment()['format'](_0xee33('0x12'));}_0x19bfd1(null,_0x252f2a);},'beforeUpdate':function(_0x1d8381,_0x1d5c38,_0x20422b){if(_0x1d8381[_0xee33('0x14')](_0xee33('0x15'))){_0x1d8381['substatusAt']=_0x1d8381[_0xee33('0x15')]?moment()[_0xee33('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x1d8381[_0xee33('0x14')](_0xee33('0x13'))){_0x1d8381[_0xee33('0x16')]=moment()[_0xee33('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d8381[_0xee33('0x15')]=null;_0x1d8381['substatusAt']=null;}_0x20422b(null,_0x1d8381);},'afterUpdate':function(_0x41393e,_0x41ed00,_0x663ce2){var _0x5d3aed=_0x1cb1ad[_0xee33('0x17')];var _0x2422e6=_0x41393e[_0xee33('0x18')]({'plain':!![]});if(_0x2422e6['closed']){return _0x5d3aed[_0xee33('0x19')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x2422e6['id']}})['then'](function(){_0x663ce2();})['catch'](function(_0x1b2cf8){_0x663ce2(_0x1b2cf8);});}else{_0x663ce2();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xf670=['YYYY-MM-DD\x20HH:mm:ss','changed','substatus','closedAt','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','define','mail_interactions','subject','FULLTEXT','substatusAt','format','closed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf670,0x184));var _0x0f67=function(_0x3fc5d8,_0x3eb153){_0x3fc5d8=_0x3fc5d8-0x0;var _0x25307a=_0xf670[_0x3fc5d8];return _0x25307a;};'use strict';var _=require(_0x0f67('0x0'));var util=require(_0x0f67('0x1'));var logger=require(_0x0f67('0x2'))(_0x0f67('0x3'));var moment=require(_0x0f67('0x4'));var BPromise=require(_0x0f67('0x5'));var rp=require(_0x0f67('0x6'));var fs=require('fs');var path=require(_0x0f67('0x7'));var rimraf=require(_0x0f67('0x8'));var config=require('../../config/environment');var attributes=require(_0x0f67('0x9'));module['exports']=function(_0x128deb,_0xceb2ba){return _0x128deb[_0x0f67('0xa')]('MailInteraction',attributes,{'tableName':_0x0f67('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x0f67('0xc'),'to'],'type':_0x0f67('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3a44dc,_0x2b66f0,_0xd9a547){if(_0x3a44dc['substatus']){_0x3a44dc[_0x0f67('0xe')]=moment()[_0x0f67('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3a44dc[_0x0f67('0x10')]){_0x3a44dc['closedAt']=moment()[_0x0f67('0xf')](_0x0f67('0x11'));}_0xd9a547(null,_0x2b66f0);},'beforeUpdate':function(_0x3e6544,_0x39b962,_0x28c7ea){if(_0x3e6544[_0x0f67('0x12')](_0x0f67('0x13'))){_0x3e6544['substatusAt']=_0x3e6544[_0x0f67('0x13')]?moment()[_0x0f67('0xf')](_0x0f67('0x11')):null;}if(_0x3e6544['changed'](_0x0f67('0x10'))){_0x3e6544[_0x0f67('0x14')]=moment()[_0x0f67('0xf')](_0x0f67('0x11'));_0x3e6544[_0x0f67('0x13')]=null;_0x3e6544['substatusAt']=null;}_0x28c7ea(null,_0x3e6544);},'afterUpdate':function(_0x28e285,_0x1bec94,_0x17ecc6){var _0x3ae9ff=_0x128deb['models'];var _0x314ea8=_0x28e285[_0x0f67('0x15')]({'plain':!![]});if(_0x314ea8[_0x0f67('0x10')]){return _0x3ae9ff[_0x0f67('0x16')][_0x0f67('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x314ea8['id']}})['then'](function(){_0x17ecc6();})[_0x0f67('0x18')](function(_0x2ce296){_0x17ecc6(_0x2ce296);});}else{_0x17ecc6();}}},'charset':_0x0f67('0x19'),'collate':_0x0f67('0x1a')});};
\ No newline at end of file
index 2f72aa7..6a32022 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49d6=['catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','limit','debug','AddTagsToMailInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x143d04,_0x5ab29c){var _0x25681a=function(_0x23dc6a){while(--_0x23dc6a){_0x143d04['push'](_0x143d04['shift']());}};_0x25681a(++_0x5ab29c);}(_0x49d6,0x1bf));var _0x649d=function(_0x2d01c3,_0x3a38d5){_0x2d01c3=_0x2d01c3-0x0;var _0x373efe=_0x49d6[_0x2d01c3];return _0x373efe;};'use strict';var _=require(_0x649d('0x0'));var util=require('util');var moment=require(_0x649d('0x1'));var BPromise=require(_0x649d('0x2'));var rs=require(_0x649d('0x3'));var fs=require('fs');var Redis=require(_0x649d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x649d('0x5'))(_0x649d('0x6'));var config=require(_0x649d('0x7'));var jayson=require(_0x649d('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x649d('0x9')](config[_0x649d('0xa')],{'host':_0x649d('0xb'),'port':0x18eb});var socket=require(_0x649d('0xc'))(new Redis(config[_0x649d('0xa')]));require(_0x649d('0xd'))[_0x649d('0xe')](socket);function respondWithRpcPromise(_0x1828c0,_0x57acc3,_0x27fa77){return new BPromise(function(_0x158445,_0x194b2a){return client[_0x649d('0xf')](_0x1828c0,_0x27fa77)[_0x649d('0x10')](function(_0x42db1e){logger[_0x649d('0x11')](_0x649d('0x12'),_0x57acc3,'request\x20sent');logger['debug'](_0x649d('0x13'),_0x57acc3,'request\x20sent',JSON[_0x649d('0x14')](_0x42db1e));if(_0x42db1e[_0x649d('0x15')]){if(_0x42db1e[_0x649d('0x15')][_0x649d('0x16')]===0x1f4){logger[_0x649d('0x15')](_0x649d('0x12'),_0x57acc3,_0x42db1e['error'][_0x649d('0x17')]);return _0x194b2a(_0x42db1e[_0x649d('0x15')][_0x649d('0x17')]);}logger[_0x649d('0x15')](_0x649d('0x12'),_0x57acc3,_0x42db1e[_0x649d('0x15')][_0x649d('0x17')]);return _0x158445(_0x42db1e[_0x649d('0x15')][_0x649d('0x17')]);}else{logger['info'](_0x649d('0x12'),_0x57acc3,_0x649d('0x18'));_0x158445(_0x42db1e[_0x649d('0x19')][_0x649d('0x17')]);}})[_0x649d('0x1a')](function(_0x38bde5){logger[_0x649d('0x15')](_0x649d('0x12'),_0x57acc3,_0x38bde5);_0x194b2a(_0x38bde5);});});}exports[_0x649d('0x1b')]=function(_0x21c048){var _0x47c87b=this;return new Promise(function(_0x320553,_0x588c83){return db[_0x649d('0x1c')][_0x649d('0x1d')](_0x21c048[_0x649d('0x1e')],{'raw':_0x21c048[_0x649d('0x1f')]?_0x21c048['options'][_0x649d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21c048[_0x649d('0x1f')]?_0x21c048['options']['where']||null:null,'attributes':_0x21c048['options']?_0x21c048[_0x649d('0x1f')]['attributes']||null:null,'limit':_0x21c048[_0x649d('0x1f')]?_0x21c048[_0x649d('0x1f')][_0x649d('0x21')]||null:null})[_0x649d('0x10')](function(_0x127c98){logger[_0x649d('0x11')](_0x649d('0x1b'),_0x21c048);logger[_0x649d('0x22')]('UpdateMailInteraction',_0x21c048,JSON[_0x649d('0x14')](_0x127c98));_0x320553(_0x127c98);})[_0x649d('0x1a')](function(_0x35f648){logger['error'](_0x649d('0x1b'),_0x35f648['message'],_0x21c048);_0x588c83(_0x47c87b[_0x649d('0x15')](0x1f4,_0x35f648[_0x649d('0x17')]));});});};exports[_0x649d('0x23')]=function(_0x4dae2a){return new Promise(function(_0x49ad72,_0x3e3c96){return db[_0x649d('0x1c')][_0x649d('0x24')]({'where':_0x4dae2a[_0x649d('0x1f')]?_0x4dae2a[_0x649d('0x1f')][_0x649d('0x25')]||null:null})[_0x649d('0x10')](function(_0x1cc09d){if(_0x1cc09d){return _0x1cc09d[_0x649d('0x26')](_0x4dae2a[_0x649d('0x1e')][_0x649d('0x27')],_[_0x649d('0x28')](_0x4dae2a['body'],['ids','id'])||{});}})[_0x649d('0x29')](function(_0x1bdc19){logger[_0x649d('0x11')](_0x649d('0x2a'),_0x4dae2a);logger[_0x649d('0x22')](_0x649d('0x2a'),_0x4dae2a,JSON['stringify'](_0x1bdc19));_0x49ad72(_0x1bdc19);})[_0x649d('0x1a')](function(_0x30563f){logger[_0x649d('0x15')](_0x649d('0x2a'),_0x30563f[_0x649d('0x17')],_0x4dae2a);_0x3e3c96(_this[_0x649d('0x15')](0x1f4,_0x30563f[_0x649d('0x17')]));});});};
\ No newline at end of file
+var _0x2f3d=['request','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','where','attributes','limit','then','debug','AddTagsToMailInteraction','find','ids','info','catch','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register'];(function(_0x405bc4,_0x16f46d){var _0x2db7be=function(_0x27ed33){while(--_0x27ed33){_0x405bc4['push'](_0x405bc4['shift']());}};_0x2db7be(++_0x16f46d);}(_0x2f3d,0x1a8));var _0xd2f3=function(_0x30dc3a,_0x58ec5a){_0x30dc3a=_0x30dc3a-0x0;var _0x261bf1=_0x2f3d[_0x30dc3a];return _0x261bf1;};'use strict';var _=require('lodash');var util=require(_0xd2f3('0x0'));var moment=require(_0xd2f3('0x1'));var BPromise=require(_0xd2f3('0x2'));var rs=require(_0xd2f3('0x3'));var fs=require('fs');var Redis=require(_0xd2f3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd2f3('0x5'))(_0xd2f3('0x6'));var config=require(_0xd2f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd2f3('0x8')][_0xd2f3('0x9')]({'port':0x232a});config[_0xd2f3('0xa')]=_[_0xd2f3('0xb')](config[_0xd2f3('0xa')],{'host':_0xd2f3('0xc'),'port':0x18eb});var socket=require(_0xd2f3('0xd'))(new Redis(config['redis']));require(_0xd2f3('0xe'))[_0xd2f3('0xf')](socket);function respondWithRpcPromise(_0x5eacaa,_0x367ef8,_0x52091){return new BPromise(function(_0x20c555,_0x4ef9d1){return client[_0xd2f3('0x10')](_0x5eacaa,_0x52091)['then'](function(_0x5d66e0){logger['info'](_0xd2f3('0x11'),_0x367ef8,_0xd2f3('0x12'));logger['debug'](_0xd2f3('0x13'),_0x367ef8,'request\x20sent',JSON['stringify'](_0x5d66e0));if(_0x5d66e0[_0xd2f3('0x14')]){if(_0x5d66e0[_0xd2f3('0x14')][_0xd2f3('0x15')]===0x1f4){logger[_0xd2f3('0x14')](_0xd2f3('0x11'),_0x367ef8,_0x5d66e0[_0xd2f3('0x14')][_0xd2f3('0x16')]);return _0x4ef9d1(_0x5d66e0[_0xd2f3('0x14')][_0xd2f3('0x16')]);}logger[_0xd2f3('0x14')](_0xd2f3('0x11'),_0x367ef8,_0x5d66e0['error'][_0xd2f3('0x16')]);return _0x20c555(_0x5d66e0[_0xd2f3('0x14')][_0xd2f3('0x16')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x367ef8,'request\x20sent');_0x20c555(_0x5d66e0[_0xd2f3('0x17')]['message']);}})['catch'](function(_0xf33a18){logger[_0xd2f3('0x14')](_0xd2f3('0x11'),_0x367ef8,_0xf33a18);_0x4ef9d1(_0xf33a18);});});}exports[_0xd2f3('0x18')]=function(_0x4c0b39){var _0x571ca8=this;return new Promise(function(_0x25950f,_0x5a2472){return db[_0xd2f3('0x19')][_0xd2f3('0x1a')](_0x4c0b39[_0xd2f3('0x1b')],{'raw':_0x4c0b39[_0xd2f3('0x1c')]?_0x4c0b39[_0xd2f3('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c0b39[_0xd2f3('0x1c')]?_0x4c0b39[_0xd2f3('0x1c')][_0xd2f3('0x1d')]||null:null,'attributes':_0x4c0b39[_0xd2f3('0x1c')]?_0x4c0b39[_0xd2f3('0x1c')][_0xd2f3('0x1e')]||null:null,'limit':_0x4c0b39[_0xd2f3('0x1c')]?_0x4c0b39['options'][_0xd2f3('0x1f')]||null:null})[_0xd2f3('0x20')](function(_0x7c97b9){logger['info'](_0xd2f3('0x18'),_0x4c0b39);logger[_0xd2f3('0x21')](_0xd2f3('0x18'),_0x4c0b39,JSON['stringify'](_0x7c97b9));_0x25950f(_0x7c97b9);})['catch'](function(_0x5cdd84){logger['error'](_0xd2f3('0x18'),_0x5cdd84[_0xd2f3('0x16')],_0x4c0b39);_0x5a2472(_0x571ca8[_0xd2f3('0x14')](0x1f4,_0x5cdd84[_0xd2f3('0x16')]));});});};exports[_0xd2f3('0x22')]=function(_0x12a96f){return new Promise(function(_0x26bfca,_0x4b18b0){return db['MailInteraction'][_0xd2f3('0x23')]({'where':_0x12a96f[_0xd2f3('0x1c')]?_0x12a96f[_0xd2f3('0x1c')]['where']||null:null})[_0xd2f3('0x20')](function(_0x36ac8b){if(_0x36ac8b){return _0x36ac8b['addTags'](_0x12a96f[_0xd2f3('0x1b')][_0xd2f3('0x24')],_['omit'](_0x12a96f[_0xd2f3('0x1b')],[_0xd2f3('0x24'),'id'])||{});}})['spread'](function(_0x397559){logger[_0xd2f3('0x25')]('AddTags',_0x12a96f);logger[_0xd2f3('0x21')]('AddTags',_0x12a96f,JSON['stringify'](_0x397559));_0x26bfca(_0x397559);})[_0xd2f3('0x26')](function(_0x315d03){logger[_0xd2f3('0x14')](_0xd2f3('0x27'),_0x315d03['message'],_0x12a96f);_0x4b18b0(_this[_0xd2f3('0x14')](0x1f4,_0x315d03[_0xd2f3('0x16')]));});});};
\ No newline at end of file
index 06b042b..7cac875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf865=['./mailInteraction.events','save','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0xb24fad,_0xd58756){var _0x173226=function(_0x33b4d6){while(--_0x33b4d6){_0xb24fad['push'](_0xb24fad['shift']());}};_0x173226(++_0xd58756);}(_0xf865,0x18c));var _0x5f86=function(_0x30bd66,_0x36a93d){_0x30bd66=_0x30bd66-0x0;var _0x74c9dd=_0xf865[_0x30bd66];return _0x74c9dd;};'use strict';var MailInteractionEvents=require(_0x5f86('0x0'));var events=[_0x5f86('0x1'),_0x5f86('0x2'),_0x5f86('0x3')];function createListener(_0x2badca,_0x33c552){return function(_0x37d5db){_0x33c552[_0x5f86('0x4')](_0x2badca,_0x37d5db);};}function removeListener(_0x41dfaa,_0x1bd7fa){return function(){MailInteractionEvents[_0x5f86('0x5')](_0x41dfaa,_0x1bd7fa);};}exports[_0x5f86('0x6')]=function(_0x28bd1a){for(var _0x41c99a=0x0,_0x2ef38b=events[_0x5f86('0x7')];_0x41c99a<_0x2ef38b;_0x41c99a++){var _0x689ced=events[_0x41c99a];var _0x3f0dfc=createListener(_0x5f86('0x8')+_0x689ced,_0x28bd1a);MailInteractionEvents['on'](_0x689ced,_0x3f0dfc);}};
\ No newline at end of file
+var _0xbdfd=['removeListener','register','mailInteraction:','./mailInteraction.events','save','remove','update'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0xbdfd,0xb2));var _0xdbdf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbdfd[_0x321bb2];return _0x9c12ed;};'use strict';var MailInteractionEvents=require(_0xdbdf('0x0'));var events=[_0xdbdf('0x1'),_0xdbdf('0x2'),_0xdbdf('0x3')];function createListener(_0x389039,_0x51b8b2){return function(_0x4bc598){_0x51b8b2['emit'](_0x389039,_0x4bc598);};}function removeListener(_0x3e5bb0,_0x108162){return function(){MailInteractionEvents[_0xdbdf('0x4')](_0x3e5bb0,_0x108162);};}exports[_0xdbdf('0x5')]=function(_0x54cd98){for(var _0x2641f1=0x0,_0x206812=events['length'];_0x2641f1<_0x206812;_0x2641f1++){var _0x5ddcd1=events[_0x2641f1];var _0x71958d=createListener(_0xdbdf('0x6')+_0x5ddcd1,_0x54cd98);MailInteractionEvents['on'](_0x5ddcd1,_0x71958d);}};
\ No newline at end of file
index 360f87f..342f396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8535=['./mailMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/download','download','post','tracked','mail','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x251436,_0x24b1b3){var _0x37da8=function(_0x366b97){while(--_0x366b97){_0x251436['push'](_0x251436['shift']());}};_0x37da8(++_0x24b1b3);}(_0x8535,0x66));var _0x5853=function(_0x36f324,_0x21f22b){_0x36f324=_0x36f324-0x0;var _0x244639=_0x8535[_0x36f324];return _0x244639;};'use strict';var multer=require('multer');var util=require(_0x5853('0x0'));var path=require('path');var timeout=require(_0x5853('0x1'));var express=require(_0x5853('0x2'));var router=express[_0x5853('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5853('0x4'));var interaction=require(_0x5853('0x5'));var config=require('../../config/environment');var controller=require(_0x5853('0x6'));router['get']('/',auth[_0x5853('0x7')](),controller[_0x5853('0x8')]);router['get'](_0x5853('0x9'),auth[_0x5853('0x7')](),controller[_0x5853('0xa')]);router[_0x5853('0xb')](_0x5853('0xc'),auth[_0x5853('0x7')](),controller[_0x5853('0xd')]);router[_0x5853('0xb')](_0x5853('0xe'),auth[_0x5853('0x7')](),controller[_0x5853('0xf')]);router[_0x5853('0x10')]('/',auth[_0x5853('0x7')](),interaction[_0x5853('0x11')](_0x5853('0x12'),'mailmessage:create'),controller[_0x5853('0x13')]);router[_0x5853('0x14')](_0x5853('0xc'),auth[_0x5853('0x7')](),controller[_0x5853('0x15')]);router[_0x5853('0x14')](_0x5853('0x16'),auth[_0x5853('0x7')](),controller[_0x5853('0x17')]);router[_0x5853('0x14')](_0x5853('0x18'),auth[_0x5853('0x7')](),controller[_0x5853('0x19')]);router[_0x5853('0x1a')](_0x5853('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x6c50=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','mailmessage:create','put','/:id/accept','accept','reject','delete','destroy','multer','util','path','connect-timeout'];(function(_0x2711a7,_0x385387){var _0x2e8818=function(_0x2b4c72){while(--_0x2b4c72){_0x2711a7['push'](_0x2711a7['shift']());}};_0x2e8818(++_0x385387);}(_0x6c50,0xa4));var _0x06c5=function(_0x44488f,_0x56502e){_0x44488f=_0x44488f-0x0;var _0x4f3c7f=_0x6c50[_0x44488f];return _0x4f3c7f;};'use strict';var multer=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var path=require(_0x06c5('0x2'));var timeout=require(_0x06c5('0x3'));var express=require('express');var router=express[_0x06c5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x06c5('0x5'));var interaction=require(_0x06c5('0x6'));var config=require(_0x06c5('0x7'));var controller=require(_0x06c5('0x8'));router[_0x06c5('0x9')]('/',auth[_0x06c5('0xa')](),controller[_0x06c5('0xb')]);router[_0x06c5('0x9')](_0x06c5('0xc'),auth[_0x06c5('0xa')](),controller[_0x06c5('0xd')]);router['get'](_0x06c5('0xe'),auth[_0x06c5('0xa')](),controller[_0x06c5('0xf')]);router[_0x06c5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x06c5('0x10')]('/',auth['isAuthenticated'](),interaction['tracked']('mail',_0x06c5('0x11')),controller['create']);router[_0x06c5('0x12')](_0x06c5('0xe'),auth[_0x06c5('0xa')](),controller['update']);router[_0x06c5('0x12')](_0x06c5('0x13'),auth[_0x06c5('0xa')](),controller[_0x06c5('0x14')]);router['put']('/:id/reject',auth[_0x06c5('0xa')](),controller[_0x06c5('0x15')]);router[_0x06c5('0x16')]('/:id',auth[_0x06c5('0xa')](),controller[_0x06c5('0x17')]);module['exports']=router;
\ No newline at end of file
index 2ca1e0f..b6dd144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5577=['ENUM','out','STRING','DATE','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN'];(function(_0x2a0d2c,_0x202267){var _0x460dd8=function(_0x518579){while(--_0x518579){_0x2a0d2c['push'](_0x2a0d2c['shift']());}};_0x460dd8(++_0x202267);}(_0x5577,0xe3));var _0x7557=function(_0x2218d5,_0x3669be){_0x2218d5=_0x2218d5-0x0;var _0x52b0e7=_0x5577[_0x2218d5];return _0x52b0e7;};'use strict';var Sequelize=require(_0x7557('0x0'));var _=require(_0x7557('0x1'));module[_0x7557('0x2')]={'body':{'type':Sequelize[_0x7557('0x3')](_0x7557('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x7557('0x5'))},'read':{'type':Sequelize[_0x7557('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7557('0x7')]('in',_0x7557('0x8')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x7557('0x9')](0x1fe)},'from':{'type':Sequelize[_0x7557('0x9')]},'to':{'type':Sequelize['TEXT'](_0x7557('0x4'))},'cc':{'type':Sequelize[_0x7557('0x3')]('long')},'bcc':{'type':Sequelize['TEXT'](_0x7557('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x7557('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7557('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x7557('0x3')](_0x7557('0x4'))},'originCc':{'type':Sequelize[_0x7557('0x3')](_0x7557('0x4'))},'originChannel':{'type':Sequelize[_0x7557('0x7')](_0x7557('0xb'),_0x7557('0xc')),'defaultValue':_0x7557('0xb'),'allowNull':![]}};
\ No newline at end of file
+var _0xd99e=['exports','TEXT','long','medium','out','STRING','DATE','BOOLEAN','Email','Chat','sequelize','lodash'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0xd99e,0xbe));var _0xed99=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xd99e[_0x2c1114];return _0x2b877c;};'use strict';var Sequelize=require(_0xed99('0x0'));var _=require(_0xed99('0x1'));module[_0xed99('0x2')]={'body':{'type':Sequelize[_0xed99('0x3')](_0xed99('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xed99('0x3')](_0xed99('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xed99('0x6')),'defaultValue':_0xed99('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xed99('0x7')](0x1fe)},'from':{'type':Sequelize[_0xed99('0x7')]},'to':{'type':Sequelize[_0xed99('0x3')](_0xed99('0x4'))},'cc':{'type':Sequelize[_0xed99('0x3')](_0xed99('0x4'))},'bcc':{'type':Sequelize[_0xed99('0x3')](_0xed99('0x4'))},'subject':{'type':Sequelize[_0xed99('0x3')]},'sentAt':{'type':Sequelize[_0xed99('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xed99('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0xed99('0x4'))},'originCc':{'type':Sequelize[_0xed99('0x3')]('long')},'originChannel':{'type':Sequelize['ENUM'](_0xed99('0xa'),_0xed99('0xb')),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
index da9307c..67d874e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a8=['Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','UserId','agent','get','MailInteraction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','email','internal','SIP/%s','motionChannel','channel','event','EventManager','reject','mail','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','QueryTypes','User','fullname','fromString','download','unix','join','tmp','files','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','type','readFileSync','build','writeFileSync','unlinkSync','bluebird','util','path','lodash','ioredis','html-to-text','api','mail-interactions','../../config/environment','defaults','redis','html-entities','./mailMessage.socket','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','count','limit','Content-Range','update','stack','name','index','rawAttributes','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','MailMessage','includeAll','include','show','options','find','body','params','describe','create','out','secret','split','MailAccount','MailAccountId','List','CmContact','updatedAt','DESC','MailServerOut'];(function(_0xdfd253,_0x31e9ac){var _0xe6dc6e=function(_0x318f16){while(--_0x318f16){_0xdfd253['push'](_0xdfd253['shift']());}};_0xe6dc6e(++_0x31e9ac);}(_0x14a8,0xe0));var _0x814a=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x14a8[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x814a('0x0'));var util=require(_0x814a('0x1'));var path=require(_0x814a('0x2'));var fs=require('fs');var _=require(_0x814a('0x3'));var Redis=require(_0x814a('0x4'));var htmlToText=require(_0x814a('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x814a('0x6'));var interaction_log=require('../../config/logger')(_0x814a('0x7'));var config=require(_0x814a('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x814a('0x9')](config[_0x814a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x814a('0xa')]));var htmlEntities=require(_0x814a('0xb'));require(_0x814a('0xc'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x814a('0xd')][_0x814a('0xe')]({'port':0x232c});var client9003=jayson[_0x814a('0xd')]['http']({'port':0x232b});var client9002=jayson[_0x814a('0xd')][_0x814a('0xe')]({'port':0x232a});function respondWithRpcPromise(_0x24d6a6,_0x4e2ff8,_0xcac341,_0x5065b9){return new BPromise(function(_0x2f321f,_0x13517b){var _0x2a3c4b=_0x5065b9||client;return _0x2a3c4b[_0x814a('0xf')](_0x24d6a6,_0xcac341)[_0x814a('0x10')](function(_0x336d32){logger[_0x814a('0x11')](_0x814a('0x12'),_0x4e2ff8,_0x814a('0x13'));logger[_0x814a('0x14')](_0x814a('0x15'),_0x4e2ff8,'request\x20sent',JSON[_0x814a('0x16')](_0x336d32));if(_0x336d32[_0x814a('0x17')]){if(_0x336d32['error'][_0x814a('0x18')]===0x1f4){logger[_0x814a('0x17')](_0x814a('0x12'),_0x4e2ff8,_0x336d32[_0x814a('0x17')][_0x814a('0x19')]);return _0x13517b(_0x336d32['error']['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x4e2ff8,_0x336d32['error'][_0x814a('0x19')]);return _0x2f321f(_0x336d32[_0x814a('0x17')][_0x814a('0x19')]);}else{logger[_0x814a('0x11')](_0x814a('0x12'),_0x4e2ff8,'request\x20sent');_0x2f321f(_0x336d32[_0x814a('0x1a')]['message']);}})[_0x814a('0x1b')](function(_0xcaf001){logger[_0x814a('0x17')](_0x814a('0x12'),_0x4e2ff8,_0xcaf001);_0x13517b(_0xcaf001);});});}function respondWithResult(_0x459f23,_0x2e857e){_0x2e857e=_0x2e857e||0xc8;return function(_0x1ea69f){if(_0x1ea69f){return _0x459f23[_0x814a('0x1c')](_0x2e857e)[_0x814a('0x1d')](_0x1ea69f);}};}function respondWithFilteredResult(_0x265413,_0x4ccf79){return function(_0x4c6286){if(_0x4c6286){var _0x4488da=typeof _0x4ccf79[_0x814a('0x1e')]===_0x814a('0x1f')&&typeof _0x4ccf79['limit']===_0x814a('0x1f');var _0x37ae20=_0x4c6286[_0x814a('0x20')];var _0x44555b=_0x4488da?0x0:_0x4ccf79[_0x814a('0x1e')];var _0x1d4b14=_0x4488da?_0x4c6286['count']:_0x4ccf79[_0x814a('0x1e')]+_0x4ccf79[_0x814a('0x21')];var _0x50c446;if(_0x1d4b14>=_0x37ae20){_0x1d4b14=_0x37ae20;_0x50c446=0xc8;}else{_0x50c446=0xce;}_0x265413['status'](_0x50c446);return _0x265413['set'](_0x814a('0x22'),_0x44555b+'-'+_0x1d4b14+'/'+_0x37ae20)[_0x814a('0x1d')](_0x4c6286);}return null;};}function saveUpdates(_0x48fc4e){return function(_0x45563f){if(_0x45563f){return _0x45563f[_0x814a('0x23')](_0x48fc4e)[_0x814a('0x10')](function(_0x2aa9f9){return _0x2aa9f9;});}return null;};}function removeEntity(_0xa5cd0){return function(_0x534d97){if(_0x534d97){return _0x534d97['destroy']()[_0x814a('0x10')](function(){_0xa5cd0[_0x814a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33af1d){return function(_0x28abe5){if(!_0x28abe5){_0x33af1d['sendStatus'](0x194);}return _0x28abe5;};}function handleError(_0x1d0355,_0x3cac71){_0x3cac71=_0x3cac71||0x1f4;return function(_0x535e1a){logger['error'](_0x535e1a[_0x814a('0x24')]);if(_0x535e1a[_0x814a('0x25')]){delete _0x535e1a[_0x814a('0x25')];}_0x1d0355[_0x814a('0x1c')](_0x3cac71)['send'](_0x535e1a);};}exports[_0x814a('0x26')]=function(_0x48e2f5,_0x2fc460){var _0x1ce4cd={},_0x2b7469={},_0x187081={'count':0x0,'rows':[]};var _0x4bdd7e=_['map'](db['MailMessage'][_0x814a('0x27')],function(_0x495865){return{'name':_0x495865['fieldName'],'type':_0x495865['type'][_0x814a('0x28')]};});_0x2b7469[_0x814a('0x29')]=_[_0x814a('0x2a')](_0x4bdd7e,_0x814a('0x25'));_0x2b7469[_0x814a('0x2b')]=_[_0x814a('0x2c')](_0x48e2f5[_0x814a('0x2b')]);_0x2b7469['filters']=_[_0x814a('0x2d')](_0x2b7469[_0x814a('0x29')],_0x2b7469[_0x814a('0x2b')]);_0x1ce4cd['attributes']=_[_0x814a('0x2d')](_0x2b7469['model'],qs[_0x814a('0x2e')](_0x48e2f5[_0x814a('0x2b')][_0x814a('0x2e')]));_0x1ce4cd[_0x814a('0x2f')]=_0x1ce4cd[_0x814a('0x2f')][_0x814a('0x30')]?_0x1ce4cd[_0x814a('0x2f')]:_0x2b7469[_0x814a('0x29')];if(!_0x48e2f5[_0x814a('0x2b')][_0x814a('0x31')](_0x814a('0x32'))){_0x1ce4cd[_0x814a('0x21')]=qs['limit'](_0x48e2f5[_0x814a('0x2b')][_0x814a('0x21')]);_0x1ce4cd[_0x814a('0x1e')]=qs[_0x814a('0x1e')](_0x48e2f5[_0x814a('0x2b')][_0x814a('0x1e')]);}_0x1ce4cd[_0x814a('0x33')]=qs[_0x814a('0x34')](_0x48e2f5[_0x814a('0x2b')][_0x814a('0x34')]);_0x1ce4cd[_0x814a('0x35')]=qs[_0x814a('0x36')](_['pick'](_0x48e2f5[_0x814a('0x2b')],_0x2b7469[_0x814a('0x36')]),_0x4bdd7e);if(_0x48e2f5[_0x814a('0x2b')][_0x814a('0x37')]){_0x1ce4cd[_0x814a('0x35')]=_[_0x814a('0x38')](_0x1ce4cd[_0x814a('0x35')],{'$or':_['map'](_0x4bdd7e,function(_0x5688a1){if(_0x5688a1['type']!==_0x814a('0x39')){var _0x4a84a9={};_0x4a84a9[_0x5688a1[_0x814a('0x25')]]={'$like':'%'+_0x48e2f5[_0x814a('0x2b')][_0x814a('0x37')]+'%'};return _0x4a84a9;}})});}_0x1ce4cd=_[_0x814a('0x38')]({},_0x1ce4cd,_0x48e2f5['options']);var _0x356cef={'where':_0x1ce4cd[_0x814a('0x35')]};return db[_0x814a('0x3a')][_0x814a('0x20')](_0x356cef)['then'](function(_0x5cfd22){_0x187081[_0x814a('0x20')]=_0x5cfd22;if(_0x48e2f5[_0x814a('0x2b')][_0x814a('0x3b')]){_0x1ce4cd[_0x814a('0x3c')]=[{'all':!![]}];}return db[_0x814a('0x3a')]['findAll'](_0x1ce4cd);})[_0x814a('0x10')](function(_0x2de839){_0x187081['rows']=_0x2de839;return _0x187081;})[_0x814a('0x10')](respondWithFilteredResult(_0x2fc460,_0x1ce4cd))[_0x814a('0x1b')](handleError(_0x2fc460,null));};exports[_0x814a('0x3d')]=function(_0x19f8b5,_0x597267){var _0x470d17={'raw':!![],'where':{'id':_0x19f8b5['params']['id']}},_0x3be358={};_0x3be358['model']=_[_0x814a('0x2c')](db[_0x814a('0x3a')][_0x814a('0x27')]);_0x3be358[_0x814a('0x2b')]=_['keys'](_0x19f8b5[_0x814a('0x2b')]);_0x3be358[_0x814a('0x36')]=_[_0x814a('0x2d')](_0x3be358[_0x814a('0x29')],_0x3be358[_0x814a('0x2b')]);_0x470d17[_0x814a('0x2f')]=_[_0x814a('0x2d')](_0x3be358[_0x814a('0x29')],qs['fields'](_0x19f8b5[_0x814a('0x2b')]['fields']));_0x470d17['attributes']=_0x470d17['attributes'][_0x814a('0x30')]?_0x470d17['attributes']:_0x3be358[_0x814a('0x29')];if(_0x19f8b5[_0x814a('0x2b')][_0x814a('0x3b')]){_0x470d17['include']=[{'all':!![]}];}_0x470d17=_['merge']({},_0x470d17,_0x19f8b5[_0x814a('0x3e')]);return db[_0x814a('0x3a')][_0x814a('0x3f')](_0x470d17)['then'](handleEntityNotFound(_0x597267,null))['then'](respondWithResult(_0x597267,null))['catch'](handleError(_0x597267,null));};exports[_0x814a('0x23')]=function(_0x54e9aa,_0x303f4a){if(_0x54e9aa[_0x814a('0x40')]['id']){delete _0x54e9aa[_0x814a('0x40')]['id'];}return db[_0x814a('0x3a')][_0x814a('0x3f')]({'where':{'id':_0x54e9aa['params']['id']}})[_0x814a('0x10')](handleEntityNotFound(_0x303f4a,null))['then'](saveUpdates(_0x54e9aa[_0x814a('0x40')],null))[_0x814a('0x10')](respondWithResult(_0x303f4a,null))[_0x814a('0x1b')](handleError(_0x303f4a,null));};exports['destroy']=function(_0x214ce4,_0x1d3db8){return db[_0x814a('0x3a')][_0x814a('0x3f')]({'where':{'id':_0x214ce4[_0x814a('0x41')]['id']}})[_0x814a('0x10')](handleEntityNotFound(_0x1d3db8,null))[_0x814a('0x10')](removeEntity(_0x1d3db8,null))[_0x814a('0x1b')](handleError(_0x1d3db8,null));};exports['describe']=function(_0xaa94f0,_0x260359){return db[_0x814a('0x3a')][_0x814a('0x42')]()[_0x814a('0x10')](respondWithResult(_0x260359,null))[_0x814a('0x1b')](handleError(_0x260359,null));};exports[_0x814a('0x43')]=function(_0x26cef1,_0x542b2d){return db[_0x814a('0x3a')][_0x814a('0x43')](_0x26cef1['body'])[_0x814a('0x10')](function(_0x5a5d47){if(_0x5a5d47){if(_0x5a5d47['direction']===_0x814a('0x44')&&!_0x5a5d47[_0x814a('0x45')]){var _0x2b4a52,_0x3f7f92,_0x14874d;if(_0x26cef1['body']['to']){_0x3f7f92=_0x26cef1[_0x814a('0x40')]['to'][_0x814a('0x46')](',')[0x0];}return db[_0x814a('0x47')]['findOne']({'where':{'id':_0x5a5d47[_0x814a('0x48')]},'include':[{'model':db['CmList'],'as':_0x814a('0x49'),'include':[{'model':db[_0x814a('0x4a')],'as':'Contacts','where':{'email':_0x3f7f92},'limit':0x1,'order':[[_0x814a('0x4b'),_0x814a('0x4c')]]}]},{'model':db[_0x814a('0x4d')],'as':'Smtp','raw':!![]}]})[_0x814a('0x10')](function(_0x263fc3){_0x2b4a52=_0x263fc3;if(_0x2b4a52&&_0x2b4a52[_0x814a('0x4e')]){var _0x1f16cc={'tls':{'rejectUnauthorized':![]}};if(_[_0x814a('0x4f')](_0x2b4a52[_0x814a('0x4e')][_0x814a('0x50')])){_0x1f16cc[_0x814a('0x51')]=_0x2b4a52['Smtp'][_0x814a('0x51')];_0x1f16cc[_0x814a('0x52')]=_0x2b4a52[_0x814a('0x4e')][_0x814a('0x52')];_0x1f16cc[_0x814a('0x53')]=_0x2b4a52['Smtp'][_0x814a('0x53')];if(_0x2b4a52[_0x814a('0x4e')][_0x814a('0x54')]){_0x1f16cc[_0x814a('0x55')]={'user':_0x2b4a52['Smtp'][_0x814a('0x56')],'pass':_0x2b4a52['Smtp'][_0x814a('0x57')]};}}else{_0x1f16cc['service']=_0x2b4a52[_0x814a('0x4e')][_0x814a('0x50')];_0x1f16cc['auth']={'user':_0x2b4a52[_0x814a('0x4e')][_0x814a('0x56')],'pass':_0x2b4a52[_0x814a('0x4e')][_0x814a('0x57')]};_0x1f16cc[_0x814a('0x53')]=_0x2b4a52[_0x814a('0x4e')]['secure'];}if(_0x26cef1[_0x814a('0x40')][_0x814a('0x58')]&&_0x26cef1[_0x814a('0x40')]['attachments']['length']){for(var _0x3ef9d7=0x0;_0x3ef9d7<_0x26cef1[_0x814a('0x40')][_0x814a('0x58')][_0x814a('0x30')];_0x3ef9d7+=0x1){_0x26cef1[_0x814a('0x40')][_0x814a('0x58')][_0x3ef9d7]={'filename':_0x26cef1[_0x814a('0x40')][_0x814a('0x58')][_0x3ef9d7][_0x814a('0x25')],'path':path['join'](config[_0x814a('0x59')],_0x814a('0x5a'),_0x26cef1[_0x814a('0x40')][_0x814a('0x58')][_0x3ef9d7][_0x814a('0x5b')])};}}_0x14874d={'account':_0x1f16cc,'message':_0x26cef1[_0x814a('0x40')]};return;}})['then'](function(){if(_0x2b4a52[_0x814a('0x49')]){if(_0x2b4a52[_0x814a('0x49')][_0x814a('0x5c')][_0x814a('0x30')]){return _0x2b4a52[_0x814a('0x49')]['Contacts'][0x0];}else{return db[_0x814a('0x4a')]['create'](_['defaults'](_0x26cef1[_0x814a('0x40')],{'firstName':_0x26cef1['body']['to'],'email':_0x26cef1['body']['to'],'phone':_0x26cef1[_0x814a('0x40')]['to'],'ListId':_0x2b4a52[_0x814a('0x5d')]}));}}else{throw new Error(_0x814a('0x5e'));}})['then'](function(){if(_0x14874d){return respondWithRpcPromise(_0x814a('0x5f'),'sendMail',_0x14874d,client9003)[_0x814a('0x10')](function(_0x3ac6a3){return _0x5a5d47[_0x814a('0x23')]({'read':!![],'messageId':_0x3ac6a3[_0x814a('0x60')],'sentAt':moment()[_0x814a('0x61')](_0x814a('0x62'))});})['catch'](function(_0x45a074){logger[_0x814a('0x17')]('%s',JSON[_0x814a('0x16')](_0x45a074));return _0x5a5d47;});}return _0x5a5d47;});}return _0x5a5d47;}})['then'](respondWithResult(_0x542b2d,0xc9))[_0x814a('0x1b')](handleError(_0x542b2d,null));};exports[_0x814a('0x63')]=function(_0x5f2cc2,_0x2e6238){var _0x3cc460={'agent':{},'channel':'mail'};if(_0x5f2cc2[_0x814a('0x40')]['id']){delete _0x5f2cc2[_0x814a('0x40')]['id'];}_0x5f2cc2[_0x814a('0x40')]['read']=!![];_0x5f2cc2[_0x814a('0x40')]['readAt']=moment()['format'](_0x814a('0x62'));_0x5f2cc2[_0x814a('0x40')][_0x814a('0x64')]=_0x5f2cc2[_0x814a('0x40')]['UserId']||_0x5f2cc2[_0x814a('0x56')]['id'];_0x3cc460[_0x814a('0x65')]['id']=_0x5f2cc2[_0x814a('0x40')]['UserId'];return db[_0x814a('0x3a')][_0x814a('0x3f')]({'where':{'id':_0x5f2cc2[_0x814a('0x41')]['id'],'UserId':null}})[_0x814a('0x10')](handleEntityNotFound(_0x2e6238,null))[_0x814a('0x10')](saveUpdates(_0x5f2cc2[_0x814a('0x40')],null))[_0x814a('0x10')](function(_0x314ce9){if(_0x314ce9){_0x3cc460[_0x814a('0x19')]=_0x314ce9[_0x814a('0x66')]({'plain':!![]});return db[_0x814a('0x67')][_0x814a('0x3f')]({'where':{'id':_0x314ce9['MailInteractionId']}});}return null;})[_0x814a('0x10')](handleEntityNotFound(_0x2e6238,null))[_0x814a('0x10')](function(_0x5696f6){if(_0x5696f6){return _0x5696f6[_0x814a('0x23')]({'UserId':_0x5f2cc2[_0x814a('0x40')][_0x814a('0x64')],'read1stAt':_['isNil'](_0x5696f6['read1stAt'])?moment()[_0x814a('0x61')](_0x814a('0x62')):undefined});}return null;})['then'](function(_0x131ff4){if(_0x131ff4){_0x3cc460['interaction']=_0x131ff4[_0x814a('0x66')]({'plain':!![]});interaction_log[_0x814a('0x11')](_0x814a('0x68'),_0x5f2cc2[_0x814a('0x56')]['id'],_0x5f2cc2[_0x814a('0x56')][_0x814a('0x25')],_0x5f2cc2[_0x814a('0x56')][_0x814a('0x69')],_0x3cc460[_0x814a('0x6a')]['id'],_0x5f2cc2['body']?JSON[_0x814a('0x16')](_0x5f2cc2[_0x814a('0x40')]):_0x814a('0x6b'));return respondWithRpcPromise(_0x814a('0x6c'),'acceptMessage',_0x3cc460);}return null;})[_0x814a('0x10')](function(_0x25146e){var _0x52909a=_0x814a('0x6d')+_0x25146e[_0x814a('0x19')][_0x814a('0x6e')];return db['sequelize'][_0x814a('0x2b')](_0x52909a,{'type':db[_0x814a('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x814a('0x10')](function(_0x40c37c){return _0x40c37c;});})[_0x814a('0x10')](function(_0x576569){if(_0x576569){_0x3cc460[_0x814a('0x19')][_0x814a('0x70')]=_0x576569[0x0];if(!_0x5f2cc2[_0x814a('0x40')][_0x814a('0x64')])return;return db['User'][_0x814a('0x3f')]({'where':{'id':_0x5f2cc2[_0x814a('0x40')][_0x814a('0x64')],'role':'agent'},'attributes':['id',_0x814a('0x25'),'fullname',_0x814a('0x71'),_0x814a('0x72')],'raw':!![]});}return null;})[_0x814a('0x10')](function(_0xbd13a8){if(!_0xbd13a8)return null;_0x3cc460[_0x814a('0x19')][_0x814a('0x65')]=_0xbd13a8;return _0x3cc460;})[_0x814a('0x10')](function(_0x458af1){if(_0x458af1){if(_0x5f2cc2[_0x814a('0x40')]['manual']){_0x3cc460[_0x814a('0x19')]['interface']=util[_0x814a('0x61')](_0x814a('0x73'),_0x5f2cc2[_0x814a('0x56')]['name']);_0x3cc460[_0x814a('0x19')]['channel']=_0x3cc460['channel'];_0x3cc460[_0x814a('0x19')][_0x814a('0x74')]=_0x3cc460[_0x814a('0x75')];_0x3cc460[_0x814a('0x19')][_0x814a('0x76')]=_0x814a('0x63');_0x3cc460[_0x814a('0x19')][_0x814a('0x40')]=htmlToText['fromString'](_0x3cc460[_0x814a('0x19')]['body']);return respondWithRpcPromise(_0x814a('0x77'),_0x814a('0x77'),{'event':'acceptmessage','message':_0x3cc460[_0x814a('0x19')]},client9002)[_0x814a('0x10')](function(){return _0x3cc460;});}return _0x3cc460;}return null;})[_0x814a('0x10')](respondWithResult(_0x2e6238,null))[_0x814a('0x1b')](handleError(_0x2e6238,null));};exports[_0x814a('0x78')]=function(_0x2a412e,_0x7cfc5f){var _0x41c36e={'agent':{},'channel':_0x814a('0x79')};if(_0x2a412e['body']['id']){delete _0x2a412e[_0x814a('0x40')]['id'];}_0x2a412e[_0x814a('0x40')][_0x814a('0x64')]=_0x2a412e['body'][_0x814a('0x64')]||_0x2a412e[_0x814a('0x56')]['id'];_0x41c36e[_0x814a('0x65')]['id']=_0x2a412e[_0x814a('0x40')]['UserId'];return db[_0x814a('0x3a')][_0x814a('0x3f')]({'where':{'id':_0x2a412e[_0x814a('0x41')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7cfc5f,null))[_0x814a('0x10')](function(_0x21caf4){if(_0x21caf4){_0x41c36e[_0x814a('0x19')]=_0x21caf4[_0x814a('0x66')]({'plain':!![]});return db[_0x814a('0x67')][_0x814a('0x3f')]({'where':{'id':_0x21caf4[_0x814a('0x7a')]}});}return null;})[_0x814a('0x10')](handleEntityNotFound(_0x7cfc5f,null))['then'](function(_0x22288d){if(_0x22288d){_0x41c36e[_0x814a('0x6a')]=_0x22288d['get']({'plain':!![]});interaction_log[_0x814a('0x11')](_0x814a('0x7b'),_0x2a412e[_0x814a('0x56')]['id'],_0x2a412e[_0x814a('0x56')]['name'],_0x2a412e[_0x814a('0x56')]['role'],_0x41c36e['interaction']['id'],_0x2a412e[_0x814a('0x40')]?JSON['stringify'](_0x2a412e[_0x814a('0x40')]):_0x814a('0x6b'));return respondWithRpcPromise(_0x814a('0x7c'),_0x814a('0x7d'),_0x41c36e);}return null;})[_0x814a('0x10')](function(_0x536a2d){var _0x30f6e9=_0x814a('0x6d')+_0x536a2d['message'][_0x814a('0x6e')];return db[_0x814a('0x7e')][_0x814a('0x2b')](_0x30f6e9,{'type':db[_0x814a('0x6f')][_0x814a('0x7f')]['SELECT'],'raw':!![]})[_0x814a('0x10')](function(_0x1c9ae1){return _0x1c9ae1;});})[_0x814a('0x10')](function(_0x2d7ce0){if(_0x2d7ce0){_0x41c36e[_0x814a('0x19')]['contact']=_0x2d7ce0[0x0];if(!_0x2a412e[_0x814a('0x40')][_0x814a('0x64')])return;return db[_0x814a('0x80')][_0x814a('0x3f')]({'where':{'id':_0x2a412e[_0x814a('0x40')]['UserId'],'role':_0x814a('0x65')},'attributes':['id',_0x814a('0x25'),_0x814a('0x81'),_0x814a('0x71'),_0x814a('0x72')],'raw':!![]});}return null;})[_0x814a('0x10')](function(_0x34aca6){if(!_0x34aca6)return null;_0x41c36e['message'][_0x814a('0x65')]=_0x34aca6;return _0x41c36e;})[_0x814a('0x10')](function(_0x4d636b){if(_0x4d636b){_0x4d636b[_0x814a('0x19')]['interface']=util[_0x814a('0x61')](_0x814a('0x73'),_0x2a412e[_0x814a('0x56')][_0x814a('0x25')]);_0x4d636b['message'][_0x814a('0x75')]=_0x41c36e[_0x814a('0x75')];_0x4d636b['message'][_0x814a('0x74')]=_0x41c36e[_0x814a('0x75')];_0x4d636b['message']['event']=_0x814a('0x78');_0x4d636b[_0x814a('0x19')][_0x814a('0x40')]=htmlToText[_0x814a('0x82')](_0x41c36e[_0x814a('0x19')][_0x814a('0x40')]);respondWithRpcPromise(_0x814a('0x77'),_0x814a('0x77'),{'event':'rejectmessage','message':_0x4d636b[_0x814a('0x19')]},client9002);return _0x41c36e;}return null;})['then'](respondWithResult(_0x7cfc5f,null))[_0x814a('0x1b')](handleError(_0x7cfc5f,null));};exports[_0x814a('0x83')]=function(_0x397bbc,_0x42724c){var _0x3141e3=moment()[_0x814a('0x84')]()['toString']();var _0x58e29=path[_0x814a('0x85')](config[_0x814a('0x59')],'server','files',_0x814a('0x86'));var _0x4fa59f=path[_0x814a('0x85')](config[_0x814a('0x59')],'server',_0x814a('0x87'),'attachments');var _0x4cf52f=util['format'](_0x814a('0x88'),_0x3141e3);return db[_0x814a('0x3a')][_0x814a('0x3f')]({'where':{'id':_0x397bbc[_0x814a('0x41')]['id']},'attributes':['id',_0x814a('0x40'),'from','to','cc',_0x814a('0x89'),_0x814a('0x8a'),_0x814a('0x8b')],'include':_0x397bbc[_0x814a('0x2b')][_0x814a('0x58')]?[{'model':db[_0x814a('0x8c')],'as':_0x814a('0x8d')}]:undefined})['then'](handleEntityNotFound(_0x42724c,null))[_0x814a('0x10')](function(_0x48b1dd){if(_0x48b1dd){var _0x5c14b8=_0x48b1dd;var _0x29cd44={'from':_0x5c14b8['from'],'to':_0x5c14b8['to'],'subject':_0x5c14b8[_0x814a('0x8a')],'html':htmlEntities['decode'](_0x5c14b8[_0x814a('0x40')]),'headers':{'Date':moment(_0x5c14b8['createdAt'])[_0x814a('0x61')](_0x814a('0x8e'))},'attachments':[]};if(_0x48b1dd['cc']){_0x29cd44[_0x814a('0x8f')]['Cc']=_0x48b1dd['cc'];}if(_0x48b1dd[_0x814a('0x89')]){_0x29cd44[_0x814a('0x8f')][_0x814a('0x90')]=_0x48b1dd['bcc'];}return new BPromise(function(_0x157962,_0x2419f1){if(_0x48b1dd['Attachments']){for(var _0x3938b2=0x0;_0x3938b2<_0x48b1dd['Attachments'][_0x814a('0x30')];_0x3938b2++){var _0x508fbd=_0x48b1dd['Attachments'][_0x3938b2];var _0x230425=path['join'](_0x4fa59f,_0x508fbd[_0x814a('0x5b')]);if(fs[_0x814a('0x91')](_0x230425)){_0x29cd44[_0x814a('0x58')]['push']({'name':_0x508fbd[_0x814a('0x25')],'contentType':_0x508fbd[_0x814a('0x92')],'data':fs[_0x814a('0x93')](_0x230425)});}}}emlformat[_0x814a('0x94')](_0x29cd44,function(_0x177d98,_0x26bd1d){if(_0x177d98)return _0x2419f1(_0x177d98);fs[_0x814a('0x95')](path['join'](_0x58e29,_0x4cf52f),_0x26bd1d);return _0x157962(_0x26bd1d);});});}})[_0x814a('0x10')](function(_0x1127c9){if(_0x1127c9){return _0x42724c[_0x814a('0x83')](path[_0x814a('0x85')](_0x58e29,_0x4cf52f),_0x4cf52f,function(_0x201d48){if(!_0x201d48)fs[_0x814a('0x96')](path[_0x814a('0x85')](_0x58e29,_0x4cf52f));});}})['catch'](handleError(_0x42724c,null));};
\ No newline at end of file
+var _0xb770=['offset','limit','status','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','keys','include','find','body','params','create','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','server/files/attachments','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','mail','readAt','UserId','agent','get','MailInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','email','manual','interface','channel','event','fromString','EventManager','acceptmessage','reject','MailInteractionId','RejectMessage','rejectMessage','QueryTypes','User','fullname','internal','SIP/%s','motionChannel','unix','server','tmp','root','files','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','writeFileSync','download','unlinkSync','eml-format','bluebird','path','lodash','html-to-text','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','json','undefined','count'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xb770,0x83));var _0x0b77=function(_0x437885,_0x445a01){_0x437885=_0x437885-0x0;var _0x540e19=_0xb770[_0x437885];return _0x540e19;};'use strict';var emlformat=require(_0x0b77('0x0'));var moment=require('moment');var BPromise=require(_0x0b77('0x1'));var util=require('util');var path=require(_0x0b77('0x2'));var fs=require('fs');var _=require(_0x0b77('0x3'));var Redis=require('ioredis');var htmlToText=require(_0x0b77('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x0b77('0x5'));var interaction_log=require(_0x0b77('0x6'))(_0x0b77('0x7'));var config=require(_0x0b77('0x8'));var db=require(_0x0b77('0x9'))['db'];config[_0x0b77('0xa')]=_[_0x0b77('0xb')](config['redis'],{'host':_0x0b77('0xc'),'port':0x18eb});var socket=require(_0x0b77('0xd'))(new Redis(config[_0x0b77('0xa')]));var htmlEntities=require(_0x0b77('0xe'));require(_0x0b77('0xf'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0b77('0x10')][_0x0b77('0x11')]({'port':0x232c});var client9003=jayson[_0x0b77('0x10')][_0x0b77('0x11')]({'port':0x232b});var client9002=jayson['client'][_0x0b77('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x33ceeb,_0x26904f,_0x5c8664,_0x45d4f4){return new BPromise(function(_0x5ea8,_0x1ac916){var _0x55020f=_0x45d4f4||client;return _0x55020f[_0x0b77('0x12')](_0x33ceeb,_0x5c8664)[_0x0b77('0x13')](function(_0x15b381){logger[_0x0b77('0x14')](_0x0b77('0x15'),_0x26904f,_0x0b77('0x16'));logger[_0x0b77('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x26904f,_0x0b77('0x16'),JSON[_0x0b77('0x18')](_0x15b381));if(_0x15b381[_0x0b77('0x19')]){if(_0x15b381[_0x0b77('0x19')]['code']===0x1f4){logger[_0x0b77('0x19')](_0x0b77('0x15'),_0x26904f,_0x15b381[_0x0b77('0x19')][_0x0b77('0x1a')]);return _0x1ac916(_0x15b381[_0x0b77('0x19')][_0x0b77('0x1a')]);}logger[_0x0b77('0x19')](_0x0b77('0x15'),_0x26904f,_0x15b381[_0x0b77('0x19')]['message']);return _0x5ea8(_0x15b381[_0x0b77('0x19')]['message']);}else{logger[_0x0b77('0x14')]('MailMessage,\x20%s,\x20%s',_0x26904f,_0x0b77('0x16'));_0x5ea8(_0x15b381[_0x0b77('0x1b')][_0x0b77('0x1a')]);}})[_0x0b77('0x1c')](function(_0x30be21){logger[_0x0b77('0x19')](_0x0b77('0x15'),_0x26904f,_0x30be21);_0x1ac916(_0x30be21);});});}function respondWithResult(_0x1e2f00,_0x44b9d5){_0x44b9d5=_0x44b9d5||0xc8;return function(_0xc35a02){if(_0xc35a02){return _0x1e2f00['status'](_0x44b9d5)[_0x0b77('0x1d')](_0xc35a02);}};}function respondWithFilteredResult(_0x22314d,_0x272132){return function(_0x3172e9){if(_0x3172e9){var _0x3cb670=typeof _0x272132['offset']===_0x0b77('0x1e')&&typeof _0x272132['limit']==='undefined';var _0x4a069f=_0x3172e9[_0x0b77('0x1f')];var _0x135e83=_0x3cb670?0x0:_0x272132[_0x0b77('0x20')];var _0x1d9137=_0x3cb670?_0x3172e9['count']:_0x272132[_0x0b77('0x20')]+_0x272132[_0x0b77('0x21')];var _0x20373b;if(_0x1d9137>=_0x4a069f){_0x1d9137=_0x4a069f;_0x20373b=0xc8;}else{_0x20373b=0xce;}_0x22314d[_0x0b77('0x22')](_0x20373b);return _0x22314d['set'](_0x0b77('0x23'),_0x135e83+'-'+_0x1d9137+'/'+_0x4a069f)[_0x0b77('0x1d')](_0x3172e9);}return null;};}function saveUpdates(_0x24471e){return function(_0x139500){if(_0x139500){return _0x139500[_0x0b77('0x24')](_0x24471e)[_0x0b77('0x13')](function(_0x73b3a1){return _0x73b3a1;});}return null;};}function removeEntity(_0x54e32f){return function(_0x5e1d77){if(_0x5e1d77){return _0x5e1d77[_0x0b77('0x25')]()[_0x0b77('0x13')](function(){_0x54e32f['status'](0xcc)[_0x0b77('0x26')]();});}};}function handleEntityNotFound(_0x407e5b){return function(_0x4bf342){if(!_0x4bf342){_0x407e5b[_0x0b77('0x27')](0x194);}return _0x4bf342;};}function handleError(_0x4f6f08,_0x48142e){_0x48142e=_0x48142e||0x1f4;return function(_0x38ba51){logger[_0x0b77('0x19')](_0x38ba51[_0x0b77('0x28')]);if(_0x38ba51[_0x0b77('0x29')]){delete _0x38ba51['name'];}_0x4f6f08[_0x0b77('0x22')](_0x48142e)[_0x0b77('0x2a')](_0x38ba51);};}exports[_0x0b77('0x2b')]=function(_0x2ef701,_0x4db66a){var _0x743143={},_0x41907a={},_0x2ce34f={'count':0x0,'rows':[]};var _0x3321c1=_[_0x0b77('0x2c')](db[_0x0b77('0x2d')][_0x0b77('0x2e')],function(_0x8da82e){return{'name':_0x8da82e[_0x0b77('0x2f')],'type':_0x8da82e['type'][_0x0b77('0x30')]};});_0x41907a[_0x0b77('0x31')]=_[_0x0b77('0x2c')](_0x3321c1,_0x0b77('0x29'));_0x41907a[_0x0b77('0x32')]=_['keys'](_0x2ef701[_0x0b77('0x32')]);_0x41907a[_0x0b77('0x33')]=_[_0x0b77('0x34')](_0x41907a[_0x0b77('0x31')],_0x41907a[_0x0b77('0x32')]);_0x743143[_0x0b77('0x35')]=_[_0x0b77('0x34')](_0x41907a[_0x0b77('0x31')],qs[_0x0b77('0x36')](_0x2ef701[_0x0b77('0x32')][_0x0b77('0x36')]));_0x743143[_0x0b77('0x35')]=_0x743143[_0x0b77('0x35')][_0x0b77('0x37')]?_0x743143[_0x0b77('0x35')]:_0x41907a[_0x0b77('0x31')];if(!_0x2ef701[_0x0b77('0x32')][_0x0b77('0x38')](_0x0b77('0x39'))){_0x743143[_0x0b77('0x21')]=qs[_0x0b77('0x21')](_0x2ef701['query']['limit']);_0x743143[_0x0b77('0x20')]=qs[_0x0b77('0x20')](_0x2ef701[_0x0b77('0x32')]['offset']);}_0x743143[_0x0b77('0x3a')]=qs['sort'](_0x2ef701[_0x0b77('0x32')][_0x0b77('0x3b')]);_0x743143[_0x0b77('0x3c')]=qs[_0x0b77('0x33')](_[_0x0b77('0x3d')](_0x2ef701[_0x0b77('0x32')],_0x41907a[_0x0b77('0x33')]),_0x3321c1);if(_0x2ef701[_0x0b77('0x32')][_0x0b77('0x3e')]){_0x743143[_0x0b77('0x3c')]=_[_0x0b77('0x3f')](_0x743143[_0x0b77('0x3c')],{'$or':_[_0x0b77('0x2c')](_0x3321c1,function(_0x53aef8){if(_0x53aef8[_0x0b77('0x40')]!==_0x0b77('0x41')){var _0x48d103={};_0x48d103[_0x53aef8['name']]={'$like':'%'+_0x2ef701[_0x0b77('0x32')][_0x0b77('0x3e')]+'%'};return _0x48d103;}})});}_0x743143=_[_0x0b77('0x3f')]({},_0x743143,_0x2ef701[_0x0b77('0x42')]);var _0x10190d={'where':_0x743143['where']};return db['MailMessage'][_0x0b77('0x1f')](_0x10190d)[_0x0b77('0x13')](function(_0x53b4e7){_0x2ce34f[_0x0b77('0x1f')]=_0x53b4e7;if(_0x2ef701[_0x0b77('0x32')][_0x0b77('0x43')]){_0x743143['include']=[{'all':!![]}];}return db[_0x0b77('0x2d')][_0x0b77('0x44')](_0x743143);})[_0x0b77('0x13')](function(_0x6f07a8){_0x2ce34f[_0x0b77('0x45')]=_0x6f07a8;return _0x2ce34f;})['then'](respondWithFilteredResult(_0x4db66a,_0x743143))['catch'](handleError(_0x4db66a,null));};exports['show']=function(_0x42bb3d,_0x4154cc){var _0x11a12c={'raw':!![],'where':{'id':_0x42bb3d['params']['id']}},_0x228c0a={};_0x228c0a[_0x0b77('0x31')]=_[_0x0b77('0x46')](db[_0x0b77('0x2d')][_0x0b77('0x2e')]);_0x228c0a['query']=_['keys'](_0x42bb3d[_0x0b77('0x32')]);_0x228c0a[_0x0b77('0x33')]=_[_0x0b77('0x34')](_0x228c0a[_0x0b77('0x31')],_0x228c0a['query']);_0x11a12c[_0x0b77('0x35')]=_[_0x0b77('0x34')](_0x228c0a['model'],qs[_0x0b77('0x36')](_0x42bb3d[_0x0b77('0x32')]['fields']));_0x11a12c[_0x0b77('0x35')]=_0x11a12c[_0x0b77('0x35')][_0x0b77('0x37')]?_0x11a12c[_0x0b77('0x35')]:_0x228c0a[_0x0b77('0x31')];if(_0x42bb3d['query'][_0x0b77('0x43')]){_0x11a12c[_0x0b77('0x47')]=[{'all':!![]}];}_0x11a12c=_[_0x0b77('0x3f')]({},_0x11a12c,_0x42bb3d[_0x0b77('0x42')]);return db[_0x0b77('0x2d')][_0x0b77('0x48')](_0x11a12c)[_0x0b77('0x13')](handleEntityNotFound(_0x4154cc,null))[_0x0b77('0x13')](respondWithResult(_0x4154cc,null))[_0x0b77('0x1c')](handleError(_0x4154cc,null));};exports[_0x0b77('0x24')]=function(_0x8b6f30,_0x5bcfad){if(_0x8b6f30['body']['id']){delete _0x8b6f30[_0x0b77('0x49')]['id'];}return db[_0x0b77('0x2d')][_0x0b77('0x48')]({'where':{'id':_0x8b6f30['params']['id']}})[_0x0b77('0x13')](handleEntityNotFound(_0x5bcfad,null))[_0x0b77('0x13')](saveUpdates(_0x8b6f30[_0x0b77('0x49')],null))[_0x0b77('0x13')](respondWithResult(_0x5bcfad,null))[_0x0b77('0x1c')](handleError(_0x5bcfad,null));};exports['destroy']=function(_0x31bb79,_0x374f1c){return db[_0x0b77('0x2d')]['find']({'where':{'id':_0x31bb79[_0x0b77('0x4a')]['id']}})[_0x0b77('0x13')](handleEntityNotFound(_0x374f1c,null))[_0x0b77('0x13')](removeEntity(_0x374f1c,null))[_0x0b77('0x1c')](handleError(_0x374f1c,null));};exports['describe']=function(_0x27ace0,_0x11c185){return db[_0x0b77('0x2d')]['describe']()['then'](respondWithResult(_0x11c185,null))[_0x0b77('0x1c')](handleError(_0x11c185,null));};exports['create']=function(_0x5a6089,_0x105a66){return db[_0x0b77('0x2d')][_0x0b77('0x4b')](_0x5a6089[_0x0b77('0x49')])['then'](function(_0x1f59ab){if(_0x1f59ab){if(_0x1f59ab['direction']===_0x0b77('0x4c')&&!_0x1f59ab[_0x0b77('0x4d')]){var _0x2e68b4,_0x30b37b,_0x4ebe99;if(_0x5a6089['body']['to']){_0x30b37b=_0x5a6089[_0x0b77('0x49')]['to'][_0x0b77('0x4e')](',')[0x0];}return db[_0x0b77('0x4f')][_0x0b77('0x50')]({'where':{'id':_0x1f59ab[_0x0b77('0x51')]},'include':[{'model':db[_0x0b77('0x52')],'as':_0x0b77('0x53'),'include':[{'model':db[_0x0b77('0x54')],'as':_0x0b77('0x55'),'where':{'email':_0x30b37b},'limit':0x1,'order':[['updatedAt',_0x0b77('0x56')]]}]},{'model':db['MailServerOut'],'as':_0x0b77('0x57'),'raw':!![]}]})[_0x0b77('0x13')](function(_0x58614f){_0x2e68b4=_0x58614f;if(_0x2e68b4&&_0x2e68b4['Smtp']){var _0x42a35c={'tls':{'rejectUnauthorized':![]}};if(_[_0x0b77('0x58')](_0x2e68b4['Smtp'][_0x0b77('0x59')])){_0x42a35c['host']=_0x2e68b4[_0x0b77('0x57')][_0x0b77('0x5a')];_0x42a35c[_0x0b77('0x5b')]=_0x2e68b4[_0x0b77('0x57')][_0x0b77('0x5b')];_0x42a35c[_0x0b77('0x5c')]=_0x2e68b4[_0x0b77('0x57')]['secure'];if(_0x2e68b4['Smtp']['authentication']){_0x42a35c[_0x0b77('0x5d')]={'user':_0x2e68b4[_0x0b77('0x57')][_0x0b77('0x5e')],'pass':_0x2e68b4[_0x0b77('0x57')][_0x0b77('0x5f')]};}}else{_0x42a35c[_0x0b77('0x59')]=_0x2e68b4[_0x0b77('0x57')]['service'];_0x42a35c[_0x0b77('0x5d')]={'user':_0x2e68b4[_0x0b77('0x57')][_0x0b77('0x5e')],'pass':_0x2e68b4['Smtp'][_0x0b77('0x5f')]};_0x42a35c[_0x0b77('0x5c')]=_0x2e68b4[_0x0b77('0x57')][_0x0b77('0x5c')];}if(_0x5a6089[_0x0b77('0x49')]['attachments']&&_0x5a6089[_0x0b77('0x49')][_0x0b77('0x60')][_0x0b77('0x37')]){for(var _0x11c568=0x0;_0x11c568<_0x5a6089[_0x0b77('0x49')]['attachments'][_0x0b77('0x37')];_0x11c568+=0x1){_0x5a6089['body'][_0x0b77('0x60')][_0x11c568]={'filename':_0x5a6089['body']['attachments'][_0x11c568][_0x0b77('0x29')],'path':path[_0x0b77('0x61')](config['root'],_0x0b77('0x62'),_0x5a6089[_0x0b77('0x49')]['attachments'][_0x11c568]['basename'])};}}_0x4ebe99={'account':_0x42a35c,'message':_0x5a6089['body']};return;}})[_0x0b77('0x13')](function(){if(_0x2e68b4['List']){if(_0x2e68b4['List'][_0x0b77('0x55')][_0x0b77('0x37')]){return _0x2e68b4[_0x0b77('0x53')][_0x0b77('0x55')][0x0];}else{return db[_0x0b77('0x54')][_0x0b77('0x4b')](_[_0x0b77('0xb')](_0x5a6089[_0x0b77('0x49')],{'firstName':_0x5a6089['body']['to'],'email':_0x5a6089['body']['to'],'phone':_0x5a6089[_0x0b77('0x49')]['to'],'ListId':_0x2e68b4['ListId']}));}}else{throw new Error(_0x0b77('0x63'));}})[_0x0b77('0x13')](function(){if(_0x4ebe99){return respondWithRpcPromise(_0x0b77('0x64'),_0x0b77('0x65'),_0x4ebe99,client9003)[_0x0b77('0x13')](function(_0x23f4cb){return _0x1f59ab[_0x0b77('0x24')]({'read':!![],'messageId':_0x23f4cb[_0x0b77('0x66')],'sentAt':moment()[_0x0b77('0x67')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x0b77('0x1c')](function(_0x2ae71b){logger[_0x0b77('0x19')]('%s',JSON[_0x0b77('0x18')](_0x2ae71b));return _0x1f59ab;});}return _0x1f59ab;});}return _0x1f59ab;}})[_0x0b77('0x13')](respondWithResult(_0x105a66,0xc9))[_0x0b77('0x1c')](handleError(_0x105a66,null));};exports[_0x0b77('0x68')]=function(_0x3a2942,_0x58e912){var _0x312103={'agent':{},'channel':_0x0b77('0x69')};if(_0x3a2942['body']['id']){delete _0x3a2942[_0x0b77('0x49')]['id'];}_0x3a2942[_0x0b77('0x49')]['read']=!![];_0x3a2942[_0x0b77('0x49')][_0x0b77('0x6a')]=moment()[_0x0b77('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a2942[_0x0b77('0x49')]['UserId']=_0x3a2942[_0x0b77('0x49')][_0x0b77('0x6b')]||_0x3a2942[_0x0b77('0x5e')]['id'];_0x312103[_0x0b77('0x6c')]['id']=_0x3a2942[_0x0b77('0x49')][_0x0b77('0x6b')];return db['MailMessage'][_0x0b77('0x48')]({'where':{'id':_0x3a2942['params']['id'],'UserId':null}})[_0x0b77('0x13')](handleEntityNotFound(_0x58e912,null))['then'](saveUpdates(_0x3a2942[_0x0b77('0x49')],null))[_0x0b77('0x13')](function(_0x558941){if(_0x558941){_0x312103['message']=_0x558941[_0x0b77('0x6d')]({'plain':!![]});return db[_0x0b77('0x6e')][_0x0b77('0x48')]({'where':{'id':_0x558941['MailInteractionId']}});}return null;})[_0x0b77('0x13')](handleEntityNotFound(_0x58e912,null))[_0x0b77('0x13')](function(_0x4cbde3){if(_0x4cbde3){return _0x4cbde3[_0x0b77('0x24')]({'UserId':_0x3a2942['body'][_0x0b77('0x6b')],'read1stAt':_['isNil'](_0x4cbde3[_0x0b77('0x6f')])?moment()[_0x0b77('0x67')](_0x0b77('0x70')):undefined});}return null;})['then'](function(_0x1f59ea){if(_0x1f59ea){_0x312103[_0x0b77('0x71')]=_0x1f59ea['get']({'plain':!![]});interaction_log[_0x0b77('0x14')](_0x0b77('0x72'),_0x3a2942['user']['id'],_0x3a2942[_0x0b77('0x5e')][_0x0b77('0x29')],_0x3a2942[_0x0b77('0x5e')][_0x0b77('0x73')],_0x312103['interaction']['id'],_0x3a2942['body']?JSON['stringify'](_0x3a2942[_0x0b77('0x49')]):_0x0b77('0x74'));return respondWithRpcPromise(_0x0b77('0x75'),_0x0b77('0x76'),_0x312103);}return null;})['then'](function(_0x3ff655){var _0x5b83f4=_0x0b77('0x77')+_0x3ff655[_0x0b77('0x1a')][_0x0b77('0x78')];return db[_0x0b77('0x79')]['query'](_0x5b83f4,{'type':db[_0x0b77('0x7a')]['QueryTypes']['SELECT'],'raw':!![]})[_0x0b77('0x13')](function(_0x22ae58){return _0x22ae58;});})['then'](function(_0x4ac55b){if(_0x4ac55b){_0x312103[_0x0b77('0x1a')][_0x0b77('0x7b')]=_0x4ac55b[0x0];if(!_0x3a2942[_0x0b77('0x49')][_0x0b77('0x6b')])return;return db['User'][_0x0b77('0x48')]({'where':{'id':_0x3a2942[_0x0b77('0x49')]['UserId'],'role':_0x0b77('0x6c')},'attributes':['id',_0x0b77('0x29'),'fullname',_0x0b77('0x7c'),'internal'],'raw':!![]});}return null;})[_0x0b77('0x13')](function(_0x45c8d0){if(!_0x45c8d0)return null;_0x312103['message']['agent']=_0x45c8d0;return _0x312103;})[_0x0b77('0x13')](function(_0x277f9a){if(_0x277f9a){if(_0x3a2942[_0x0b77('0x49')][_0x0b77('0x7d')]){_0x312103[_0x0b77('0x1a')][_0x0b77('0x7e')]=util[_0x0b77('0x67')]('SIP/%s',_0x3a2942['user'][_0x0b77('0x29')]);_0x312103['message'][_0x0b77('0x7f')]=_0x312103['channel'];_0x312103[_0x0b77('0x1a')]['motionChannel']=_0x312103[_0x0b77('0x7f')];_0x312103[_0x0b77('0x1a')][_0x0b77('0x80')]=_0x0b77('0x68');_0x312103[_0x0b77('0x1a')][_0x0b77('0x49')]=htmlToText[_0x0b77('0x81')](_0x312103['message'][_0x0b77('0x49')]);return respondWithRpcPromise(_0x0b77('0x82'),'EventManager',{'event':_0x0b77('0x83'),'message':_0x312103[_0x0b77('0x1a')]},client9002)[_0x0b77('0x13')](function(){return _0x312103;});}return _0x312103;}return null;})[_0x0b77('0x13')](respondWithResult(_0x58e912,null))[_0x0b77('0x1c')](handleError(_0x58e912,null));};exports[_0x0b77('0x84')]=function(_0x5c70a7,_0x2dd689){var _0x5353e6={'agent':{},'channel':_0x0b77('0x69')};if(_0x5c70a7['body']['id']){delete _0x5c70a7[_0x0b77('0x49')]['id'];}_0x5c70a7[_0x0b77('0x49')]['UserId']=_0x5c70a7[_0x0b77('0x49')][_0x0b77('0x6b')]||_0x5c70a7[_0x0b77('0x5e')]['id'];_0x5353e6[_0x0b77('0x6c')]['id']=_0x5c70a7[_0x0b77('0x49')]['UserId'];return db[_0x0b77('0x2d')][_0x0b77('0x48')]({'where':{'id':_0x5c70a7['params']['id'],'UserId':null}})[_0x0b77('0x13')](handleEntityNotFound(_0x2dd689,null))['then'](function(_0x4f9bd4){if(_0x4f9bd4){_0x5353e6[_0x0b77('0x1a')]=_0x4f9bd4[_0x0b77('0x6d')]({'plain':!![]});return db['MailInteraction'][_0x0b77('0x48')]({'where':{'id':_0x4f9bd4[_0x0b77('0x85')]}});}return null;})[_0x0b77('0x13')](handleEntityNotFound(_0x2dd689,null))[_0x0b77('0x13')](function(_0x5e5d62){if(_0x5e5d62){_0x5353e6[_0x0b77('0x71')]=_0x5e5d62[_0x0b77('0x6d')]({'plain':!![]});interaction_log[_0x0b77('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5c70a7['user']['id'],_0x5c70a7['user'][_0x0b77('0x29')],_0x5c70a7['user'][_0x0b77('0x73')],_0x5353e6[_0x0b77('0x71')]['id'],_0x5c70a7[_0x0b77('0x49')]?JSON[_0x0b77('0x18')](_0x5c70a7[_0x0b77('0x49')]):'null');return respondWithRpcPromise(_0x0b77('0x86'),_0x0b77('0x87'),_0x5353e6);}return null;})['then'](function(_0x34ae4b){var _0x1a224a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x34ae4b[_0x0b77('0x1a')][_0x0b77('0x78')];return db[_0x0b77('0x79')]['query'](_0x1a224a,{'type':db[_0x0b77('0x7a')][_0x0b77('0x88')]['SELECT'],'raw':!![]})[_0x0b77('0x13')](function(_0x1aae19){return _0x1aae19;});})['then'](function(_0x5918f0){if(_0x5918f0){_0x5353e6[_0x0b77('0x1a')][_0x0b77('0x7b')]=_0x5918f0[0x0];if(!_0x5c70a7['body'][_0x0b77('0x6b')])return;return db[_0x0b77('0x89')]['find']({'where':{'id':_0x5c70a7[_0x0b77('0x49')][_0x0b77('0x6b')],'role':_0x0b77('0x6c')},'attributes':['id',_0x0b77('0x29'),_0x0b77('0x8a'),_0x0b77('0x7c'),_0x0b77('0x8b')],'raw':!![]});}return null;})['then'](function(_0x4f4b2e){if(!_0x4f4b2e)return null;_0x5353e6[_0x0b77('0x1a')][_0x0b77('0x6c')]=_0x4f4b2e;return _0x5353e6;})[_0x0b77('0x13')](function(_0xebbd49){if(_0xebbd49){_0xebbd49['message']['interface']=util[_0x0b77('0x67')](_0x0b77('0x8c'),_0x5c70a7[_0x0b77('0x5e')][_0x0b77('0x29')]);_0xebbd49[_0x0b77('0x1a')][_0x0b77('0x7f')]=_0x5353e6['channel'];_0xebbd49['message'][_0x0b77('0x8d')]=_0x5353e6[_0x0b77('0x7f')];_0xebbd49[_0x0b77('0x1a')][_0x0b77('0x80')]=_0x0b77('0x84');_0xebbd49[_0x0b77('0x1a')]['body']=htmlToText[_0x0b77('0x81')](_0x5353e6[_0x0b77('0x1a')][_0x0b77('0x49')]);respondWithRpcPromise(_0x0b77('0x82'),_0x0b77('0x82'),{'event':'rejectmessage','message':_0xebbd49[_0x0b77('0x1a')]},client9002);return _0x5353e6;}return null;})[_0x0b77('0x13')](respondWithResult(_0x2dd689,null))[_0x0b77('0x1c')](handleError(_0x2dd689,null));};exports['download']=function(_0x51db21,_0x52141c){var _0x11bf5f=moment()[_0x0b77('0x8e')]()['toString']();var _0x16b42a=path[_0x0b77('0x61')](config['root'],_0x0b77('0x8f'),'files',_0x0b77('0x90'));var _0x3c2d18=path[_0x0b77('0x61')](config[_0x0b77('0x91')],_0x0b77('0x8f'),_0x0b77('0x92'),_0x0b77('0x60'));var _0x2ce055=util[_0x0b77('0x67')]('message-%s.eml',_0x11bf5f);return db[_0x0b77('0x2d')]['find']({'where':{'id':_0x51db21['params']['id']},'attributes':['id',_0x0b77('0x49'),_0x0b77('0x93'),'to','cc',_0x0b77('0x94'),_0x0b77('0x95'),_0x0b77('0x96')],'include':_0x51db21[_0x0b77('0x32')][_0x0b77('0x60')]?[{'model':db[_0x0b77('0x97')],'as':_0x0b77('0x98')}]:undefined})[_0x0b77('0x13')](handleEntityNotFound(_0x52141c,null))['then'](function(_0x588610){if(_0x588610){var _0x361a4e=_0x588610;var _0x573b54={'from':_0x361a4e[_0x0b77('0x93')],'to':_0x361a4e['to'],'subject':_0x361a4e[_0x0b77('0x95')],'html':htmlEntities[_0x0b77('0x99')](_0x361a4e['body']),'headers':{'Date':moment(_0x361a4e[_0x0b77('0x96')])[_0x0b77('0x67')](_0x0b77('0x9a'))},'attachments':[]};if(_0x588610['cc']){_0x573b54[_0x0b77('0x9b')]['Cc']=_0x588610['cc'];}if(_0x588610[_0x0b77('0x94')]){_0x573b54['headers'][_0x0b77('0x9c')]=_0x588610[_0x0b77('0x94')];}return new BPromise(function(_0x42fd41,_0x4dcf3b){if(_0x588610[_0x0b77('0x98')]){for(var _0x11c5a2=0x0;_0x11c5a2<_0x588610[_0x0b77('0x98')][_0x0b77('0x37')];_0x11c5a2++){var _0x47017f=_0x588610[_0x0b77('0x98')][_0x11c5a2];var _0x1f2400=path[_0x0b77('0x61')](_0x3c2d18,_0x47017f['basename']);if(fs[_0x0b77('0x9d')](_0x1f2400)){_0x573b54[_0x0b77('0x60')][_0x0b77('0x9e')]({'name':_0x47017f[_0x0b77('0x29')],'contentType':_0x47017f[_0x0b77('0x40')],'data':fs[_0x0b77('0x9f')](_0x1f2400)});}}}emlformat['build'](_0x573b54,function(_0x131813,_0x53ce64){if(_0x131813)return _0x4dcf3b(_0x131813);fs[_0x0b77('0xa0')](path[_0x0b77('0x61')](_0x16b42a,_0x2ce055),_0x53ce64);return _0x42fd41(_0x53ce64);});});}})['then'](function(_0x3dc592){if(_0x3dc592){return _0x52141c[_0x0b77('0xa1')](path['join'](_0x16b42a,_0x2ce055),_0x2ce055,function(_0x412f1b){if(!_0x412f1b)fs[_0x0b77('0xa2')](path[_0x0b77('0x61')](_0x16b42a,_0x2ce055));});}})[_0x0b77('0x1c')](handleError(_0x52141c,null));};
\ No newline at end of file
index f2103d9..2ec6400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5919=['../../mysqldb','MailMessage','save','hasOwnProperty','hook','exports'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x5919,0x120));var _0x9591=function(_0x3c4274,_0x858023){_0x3c4274=_0x3c4274-0x0;var _0x36a214=_0x5919[_0x3c4274];return _0x36a214;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x9591('0x0'))['db'][_0x9591('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9591('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x58551f){return function(_0x357152,_0xd1ef6b,_0x42b8be){MailMessageEvents['emit'](_0x58551f+':'+_0x357152['id'],_0x357152);MailMessageEvents['emit'](_0x58551f,_0x357152);_0x42b8be(null);};}for(var e in events){if(events[_0x9591('0x3')](e)){var event=events[e];MailMessage[_0x9591('0x4')](e,emitEvent(event));}}module[_0x9591('0x5')]=MailMessageEvents;
\ No newline at end of file
+var _0x87d8=['events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87d8,0xc8));var _0x887d=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x87d8[_0x5948dd];return _0xb1f8be;};'use strict';var EventEmitter=require(_0x887d('0x0'));var MailMessage=require(_0x887d('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x887d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x887d('0x3')};function emitEvent(_0x18e23a){return function(_0x313386,_0xe97298,_0x41994e){MailMessageEvents[_0x887d('0x4')](_0x18e23a+':'+_0x313386['id'],_0x313386);MailMessageEvents['emit'](_0x18e23a,_0x313386);_0x41994e(null);};}for(var e in events){if(events[_0x887d('0x5')](e)){var event=events[e];MailMessage[_0x887d('0x6')](e,emitEvent(event));}}module[_0x887d('0x7')]=MailMessageEvents;
\ No newline at end of file
index 8cb8a14..f687b91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccd2=['plainBody','subject','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xccd2,0x122));var _0x2ccd=function(_0x454586,_0x47b13b){_0x454586=_0x454586-0x0;var _0x2d10cd=_0xccd2[_0x454586];return _0x2d10cd;};'use strict';var _=require('lodash');var util=require(_0x2ccd('0x0'));var logger=require(_0x2ccd('0x1'))(_0x2ccd('0x2'));var moment=require(_0x2ccd('0x3'));var BPromise=require(_0x2ccd('0x4'));var rp=require(_0x2ccd('0x5'));var htmlToText=require(_0x2ccd('0x6'));var fs=require('fs');var path=require(_0x2ccd('0x7'));var rimraf=require(_0x2ccd('0x8'));var config=require(_0x2ccd('0x9'));var attributes=require(_0x2ccd('0xa'));module[_0x2ccd('0xb')]=function(_0x1060d3,_0x4a27b0){return _0x1060d3[_0x2ccd('0xc')](_0x2ccd('0xd'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x2ccd('0xe'),'fields':[_0x2ccd('0xe')]},{'name':_0x2ccd('0xf'),'fields':[_0x2ccd('0x10'),_0x2ccd('0x11')],'type':_0x2ccd('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b0776,_0x26cdfa,_0x3162b9){if(_0x4b0776[_0x2ccd('0x13')]){_0x4b0776['plainBody']=htmlToText['fromString'](_0x4b0776[_0x2ccd('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3162b9(null,_0x26cdfa);},'afterCreate':function(_0x4dd400,_0x80def4,_0x177fd0){var _0x4d1aa3=_0x1060d3[_0x2ccd('0x14')];var _0x191a38=_0x4dd400[_0x2ccd('0x15')]({'plain':!![]});if(_0x191a38[_0x2ccd('0x16')][_0x2ccd('0x17')]()==='in'||_0x191a38['direction']['toLowerCase']()===_0x2ccd('0x18')&&!_0x191a38[_0x2ccd('0x19')]&&!_['isNil'](_0x191a38['UserId'])){_0x4d1aa3[_0x2ccd('0x1a')]['findOne']({'where':{'id':_0x191a38[_0x2ccd('0x1b')]}})[_0x2ccd('0x1c')](function(_0x30b73d){if(_0x30b73d){_0x30b73d[_0x2ccd('0x1d')]({'lastMsgAt':_0x191a38[_0x2ccd('0x1e')],'lastMsgDirection':_0x191a38[_0x2ccd('0x16')][_0x2ccd('0x17')]()});}})[_0x2ccd('0x1f')](function(_0x7b4135){console[_0x2ccd('0x20')](_0x7b4135);});}_0x177fd0();}},'charset':_0x2ccd('0x21'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xf37a=['update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','toLowerCase','direction','out','isNil','MailInteraction','findOne','MailInteractionId','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf37a,0x11c));var _0xaf37=function(_0x3f255e,_0x20c7be){_0x3f255e=_0x3f255e-0x0;var _0x2a58bf=_0xf37a[_0x3f255e];return _0x2a58bf;};'use strict';var _=require(_0xaf37('0x0'));var util=require('util');var logger=require(_0xaf37('0x1'))(_0xaf37('0x2'));var moment=require(_0xaf37('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xaf37('0x4'));var rimraf=require(_0xaf37('0x5'));var config=require(_0xaf37('0x6'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x19926f,_0x3d8f7e){return _0x19926f[_0xaf37('0x7')](_0xaf37('0x8'),attributes,{'tableName':_0xaf37('0x9'),'paranoid':![],'indexes':[{'name':_0xaf37('0xa'),'fields':[_0xaf37('0xa')]},{'name':_0xaf37('0xb'),'fields':[_0xaf37('0xc'),_0xaf37('0xd')],'type':_0xaf37('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x573aa6,_0x2489c6,_0x9cb52f){if(_0x573aa6[_0xaf37('0xf')]){_0x573aa6[_0xaf37('0xc')]=htmlToText['fromString'](_0x573aa6[_0xaf37('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x9cb52f(null,_0x2489c6);},'afterCreate':function(_0x537a19,_0x130e4b,_0x5e6c54){var _0x3c2ac1=_0x19926f['models'];var _0x267f53=_0x537a19['get']({'plain':!![]});if(_0x267f53['direction'][_0xaf37('0x10')]()==='in'||_0x267f53[_0xaf37('0x11')][_0xaf37('0x10')]()===_0xaf37('0x12')&&!_0x267f53['secret']&&!_[_0xaf37('0x13')](_0x267f53['UserId'])){_0x3c2ac1[_0xaf37('0x14')][_0xaf37('0x15')]({'where':{'id':_0x267f53[_0xaf37('0x16')]}})[_0xaf37('0x17')](function(_0x2959e9){if(_0x2959e9){_0x2959e9[_0xaf37('0x18')]({'lastMsgAt':_0x267f53['createdAt'],'lastMsgDirection':_0x267f53[_0xaf37('0x11')][_0xaf37('0x10')]()});}})[_0xaf37('0x19')](function(_0x8d051){console['error'](_0x8d051);});}_0x5e6c54();}},'charset':_0xaf37('0x1a'),'collate':_0xaf37('0x1b')});};
\ No newline at end of file
index 9aac3ff..dd0cd14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x955f=['../../mysqldb','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x4dfb81,_0x4fe561){var _0x409982=function(_0x291f8e){while(--_0x291f8e){_0x4dfb81['push'](_0x4dfb81['shift']());}};_0x409982(++_0x4fe561);}(_0x955f,0x1eb));var _0xf955=function(_0x387dbd,_0x105849){_0x387dbd=_0x387dbd-0x0;var _0x5d0e17=_0x955f[_0x387dbd];return _0x5d0e17;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});config['redis']=_[_0xf955('0xa')](config[_0xf955('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf955('0xc'))(new Redis(config[_0xf955('0xb')]));require(_0xf955('0xd'))[_0xf955('0xe')](socket);function respondWithRpcPromise(_0x134c1b,_0x421e4a,_0x186719){return new BPromise(function(_0x4d213a,_0xf7e3e){return client['request'](_0x134c1b,_0x186719)[_0xf955('0xf')](function(_0x5d6211){logger[_0xf955('0x10')]('MailMessage,\x20%s,\x20%s',_0x421e4a,_0xf955('0x11'));logger['debug'](_0xf955('0x12'),_0x421e4a,'request\x20sent',JSON[_0xf955('0x13')](_0x5d6211));if(_0x5d6211[_0xf955('0x14')]){if(_0x5d6211[_0xf955('0x14')][_0xf955('0x15')]===0x1f4){logger[_0xf955('0x14')](_0xf955('0x16'),_0x421e4a,_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);return _0xf7e3e(_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);}logger['error'](_0xf955('0x16'),_0x421e4a,_0x5d6211['error'][_0xf955('0x17')]);return _0x4d213a(_0x5d6211[_0xf955('0x14')][_0xf955('0x17')]);}else{logger[_0xf955('0x10')]('MailMessage,\x20%s,\x20%s',_0x421e4a,'request\x20sent');_0x4d213a(_0x5d6211[_0xf955('0x18')][_0xf955('0x17')]);}})[_0xf955('0x19')](function(_0x4d7b5b){logger[_0xf955('0x14')](_0xf955('0x16'),_0x421e4a,_0x4d7b5b);_0xf7e3e(_0x4d7b5b);});});}exports[_0xf955('0x1a')]=function(_0x3f960e){var _0x3ae4fb=this;return new Promise(function(_0x5f4d9a,_0x17d86a){return db[_0xf955('0x1b')][_0xf955('0x1c')](_0x3f960e['body'],{'raw':_0x3f960e[_0xf955('0x1d')]?_0x3f960e['options'][_0xf955('0x1e')]===undefined?!![]:![]:!![]})[_0xf955('0xf')](function(_0x37143d){logger[_0xf955('0x10')](_0xf955('0x1a'),_0x3f960e);logger['debug'](_0xf955('0x1a'),_0x3f960e,JSON[_0xf955('0x13')](_0x37143d));_0x5f4d9a(_0x37143d);})[_0xf955('0x19')](function(_0x13a1a7){logger[_0xf955('0x14')](_0xf955('0x1a'),_0x13a1a7[_0xf955('0x17')],_0x3f960e);_0x17d86a(_0x3ae4fb['error'](0x1f4,_0x13a1a7[_0xf955('0x17')]));});});};
\ No newline at end of file
+var _0x7d25=['client','redis','defaults','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateMailMessage','create','body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x395174,_0x1fc178){var _0x155a75=function(_0xe6466){while(--_0xe6466){_0x395174['push'](_0x395174['shift']());}};_0x155a75(++_0x1fc178);}(_0x7d25,0x8a));var _0x57d2=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x7d25[_0x2db12b];return _0x20990b;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var moment=require(_0x57d2('0x1'));var BPromise=require(_0x57d2('0x2'));var rs=require(_0x57d2('0x3'));var fs=require('fs');var Redis=require(_0x57d2('0x4'));var db=require(_0x57d2('0x5'))['db'];var utils=require(_0x57d2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57d2('0x7')]['http']({'port':0x232a});config[_0x57d2('0x8')]=_[_0x57d2('0x9')](config[_0x57d2('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57d2('0x8')]));require('./mailMessage.socket')[_0x57d2('0xa')](socket);function respondWithRpcPromise(_0x5153c2,_0xa04872,_0x485438){return new BPromise(function(_0x429301,_0x1a86db){return client[_0x57d2('0xb')](_0x5153c2,_0x485438)[_0x57d2('0xc')](function(_0x2e8e12){logger[_0x57d2('0xd')](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));logger[_0x57d2('0x10')](_0x57d2('0x11'),_0xa04872,_0x57d2('0xf'),JSON[_0x57d2('0x12')](_0x2e8e12));if(_0x2e8e12[_0x57d2('0x13')]){if(_0x2e8e12[_0x57d2('0x13')][_0x57d2('0x14')]===0x1f4){logger[_0x57d2('0x13')]('MailMessage,\x20%s,\x20%s',_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x1a86db(_0x2e8e12[_0x57d2('0x13')]['message']);}logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0x2e8e12['error'][_0x57d2('0x15')]);return _0x429301(_0x2e8e12['error'][_0x57d2('0x15')]);}else{logger['info'](_0x57d2('0xe'),_0xa04872,_0x57d2('0xf'));_0x429301(_0x2e8e12[_0x57d2('0x16')]['message']);}})['catch'](function(_0xbaeda8){logger[_0x57d2('0x13')](_0x57d2('0xe'),_0xa04872,_0xbaeda8);_0x1a86db(_0xbaeda8);});});}exports[_0x57d2('0x17')]=function(_0x5b1b9d){var _0x1cbe4a=this;return new Promise(function(_0xcf924f,_0x55191e){return db['MailMessage'][_0x57d2('0x18')](_0x5b1b9d[_0x57d2('0x19')],{'raw':_0x5b1b9d[_0x57d2('0x1a')]?_0x5b1b9d[_0x57d2('0x1a')][_0x57d2('0x1b')]===undefined?!![]:![]:!![]})[_0x57d2('0xc')](function(_0x32c7c8){logger[_0x57d2('0xd')](_0x57d2('0x17'),_0x5b1b9d);logger[_0x57d2('0x10')](_0x57d2('0x17'),_0x5b1b9d,JSON[_0x57d2('0x12')](_0x32c7c8));_0xcf924f(_0x32c7c8);})[_0x57d2('0x1c')](function(_0x473df2){logger['error'](_0x57d2('0x17'),_0x473df2[_0x57d2('0x15')],_0x5b1b9d);_0x55191e(_0x1cbe4a[_0x57d2('0x13')](0x1f4,_0x473df2[_0x57d2('0x15')]));});});};
\ No newline at end of file
index 71af303..8fae80b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6654=['register','./mailMessage.events','save','update','emit','removeListener'];(function(_0x1d561f,_0x24cc20){var _0x242b87=function(_0x3d064f){while(--_0x3d064f){_0x1d561f['push'](_0x1d561f['shift']());}};_0x242b87(++_0x24cc20);}(_0x6654,0x145));var _0x4665=function(_0x2b733f,_0x1559bb){_0x2b733f=_0x2b733f-0x0;var _0x2ecebe=_0x6654[_0x2b733f];return _0x2ecebe;};'use strict';var MailMessageEvents=require(_0x4665('0x0'));var events=[_0x4665('0x1'),'remove',_0x4665('0x2')];function createListener(_0x5aa2a6,_0x58dc0e){return function(_0x486c82){_0x58dc0e[_0x4665('0x3')](_0x5aa2a6,_0x486c82);};}function removeListener(_0x6dea51,_0x2e9cf2){return function(){MailMessageEvents[_0x4665('0x4')](_0x6dea51,_0x2e9cf2);};}exports[_0x4665('0x5')]=function(_0x5557f3){for(var _0x14815e=0x0,_0x25030e=events['length'];_0x14815e<_0x25030e;_0x14815e++){var _0x472e4e=events[_0x14815e];var _0x2b56c9=createListener('mailMessage:'+_0x472e4e,_0x5557f3);MailMessageEvents['on'](_0x472e4e,_0x2b56c9);}};
\ No newline at end of file
+var _0x1de4=['emit','removeListener','length','mailMessage:','./mailMessage.events','save','remove','update'];(function(_0x40fa6d,_0x52caf0){var _0x1d57ef=function(_0xe757dd){while(--_0xe757dd){_0x40fa6d['push'](_0x40fa6d['shift']());}};_0x1d57ef(++_0x52caf0);}(_0x1de4,0x94));var _0x41de=function(_0x22fd11,_0x32d376){_0x22fd11=_0x22fd11-0x0;var _0x46b770=_0x1de4[_0x22fd11];return _0x46b770;};'use strict';var MailMessageEvents=require(_0x41de('0x0'));var events=[_0x41de('0x1'),_0x41de('0x2'),_0x41de('0x3')];function createListener(_0x4aafae,_0x35b505){return function(_0x43c48c){_0x35b505[_0x41de('0x4')](_0x4aafae,_0x43c48c);};}function removeListener(_0x5dd1cb,_0x378cbe){return function(){MailMessageEvents[_0x41de('0x5')](_0x5dd1cb,_0x378cbe);};}exports['register']=function(_0x2e7196){for(var _0x122565=0x0,_0x2f1078=events[_0x41de('0x6')];_0x122565<_0x2f1078;_0x122565++){var _0x50f716=events[_0x122565];var _0x4c292c=createListener(_0x41de('0x7')+_0x50f716,_0x2e7196);MailMessageEvents['on'](_0x50f716,_0x4c292c);}};
\ No newline at end of file
index 1ecc553..5eac8be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['/describe','isAuthenticated','describe','/:id','show','/:id/teams','/:id/users','getAgents','post','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34e8,0xa2));var _0x834e=function(_0x50b92e,_0x23b10e){_0x50b92e=_0x50b92e-0x0;var _0x7eacdd=_0x34e8[_0x50b92e];return _0x7eacdd;};'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(_0x834e('0x4'));var router=express[_0x834e('0x5')]();var fs_extra=require('fs-extra');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[_0x834e('0xa')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router['get'](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router['get']('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller['getTeams']);router[_0x834e('0xa')](_0x834e('0x12'),auth['isAuthenticated'](),controller[_0x834e('0x13')]);router[_0x834e('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x834e('0x14')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller['addTeams']);router[_0x834e('0x14')](_0x834e('0x12'),auth['isAuthenticated'](),controller[_0x834e('0x15')]);router[_0x834e('0x16')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x17')]);router[_0x834e('0x18')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x19')]);router[_0x834e('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router[_0x834e('0x18')](_0x834e('0x12'),auth[_0x834e('0xd')](),controller[_0x834e('0x1b')]);module[_0x834e('0x1c')]=router;
\ No newline at end of file
+var _0xc23f=['../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','put','update','delete','removeAgents','exports','util','path','express','Router','../../components/auth/service'];(function(_0x2c1ee7,_0x3443b8){var _0x2f9e25=function(_0xee88bf){while(--_0xee88bf){_0x2c1ee7['push'](_0x2c1ee7['shift']());}};_0x2f9e25(++_0x3443b8);}(_0xc23f,0x97));var _0xfc23=function(_0x7353e4,_0x12ba69){_0x7353e4=_0x7353e4-0x0;var _0x4cd4ec=_0xc23f[_0x7353e4];return _0x4cd4ec;};'use strict';var multer=require('multer');var util=require(_0xfc23('0x0'));var path=require(_0xfc23('0x1'));var timeout=require('connect-timeout');var express=require(_0xfc23('0x2'));var router=express[_0xfc23('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfc23('0x4'));var interaction=require(_0xfc23('0x5'));var config=require('../../config/environment');var controller=require(_0xfc23('0x6'));router['get']('/',auth[_0xfc23('0x7')](),controller[_0xfc23('0x8')]);router[_0xfc23('0x9')](_0xfc23('0xa'),auth[_0xfc23('0x7')](),controller[_0xfc23('0xb')]);router[_0xfc23('0x9')](_0xfc23('0xc'),auth[_0xfc23('0x7')](),controller['show']);router['get'](_0xfc23('0xd'),auth['isAuthenticated'](),controller[_0xfc23('0xe')]);router[_0xfc23('0x9')](_0xfc23('0xf'),auth[_0xfc23('0x7')](),controller['getTeams']);router[_0xfc23('0x9')](_0xfc23('0x10'),auth[_0xfc23('0x7')](),controller['getAgents']);router[_0xfc23('0x11')]('/',auth[_0xfc23('0x7')](),controller[_0xfc23('0x12')]);router[_0xfc23('0x11')](_0xfc23('0xf'),auth[_0xfc23('0x7')](),controller[_0xfc23('0x13')]);router['post'](_0xfc23('0x10'),auth[_0xfc23('0x7')](),controller[_0xfc23('0x14')]);router[_0xfc23('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xfc23('0x16')]);router[_0xfc23('0x17')](_0xfc23('0xc'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xfc23('0x17')](_0xfc23('0x10'),auth[_0xfc23('0x7')](),controller[_0xfc23('0x18')]);module[_0xfc23('0x19')]=router;
\ No newline at end of file
index 1bb1e24..586a286 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52b2=['roundrobin','sequelize','name','STRING','INTEGER'];(function(_0x4c30d,_0x558027){var _0x3221a6=function(_0x1a7eeb){while(--_0x1a7eeb){_0x4c30d['push'](_0x4c30d['shift']());}};_0x3221a6(++_0x558027);}(_0x52b2,0x141));var _0x252b=function(_0x4d4969,_0x3eef64){_0x4d4969=_0x4d4969-0x0;var _0x3cf867=_0x52b2[_0x4d4969];return _0x3cf867;};'use strict';var Sequelize=require(_0x252b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x252b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x252b('0x2')]},'timeout':{'type':Sequelize[_0x252b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x252b('0x4'))}};
\ No newline at end of file
+var _0xa579=['STRING','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x357bfc,_0x4dd3ce){var _0x3fc97a=function(_0x3caed4){while(--_0x3caed4){_0x357bfc['push'](_0x357bfc['shift']());}};_0x3fc97a(++_0x4dd3ce);}(_0xa579,0x1a2));var _0x9a57=function(_0x72df7f,_0x4ed9f1){_0x72df7f=_0x72df7f-0x0;var _0x1045af=_0xa579[_0x72df7f];return _0x1045af;};'use strict';var Sequelize=require(_0x9a57('0x0'));module[_0x9a57('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9a57('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9a57('0x3')](_0x9a57('0x4'),'beepall',_0x9a57('0x5'))}};
\ No newline at end of file
index 3302d55..d71b64f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6345=['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','TeamId','all','union','compact','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','name','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','create','body','user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','format','%s/%s','SIP','getTeams','findOne','Team','nolimit','addTeams','Agents','online','voicePause','flatMap','sequelize','findOrCreate','emit','userMailQueue:save','ids','select','field'];(function(_0x2435af,_0xbc259f){var _0x3b2804=function(_0xbbd18a){while(--_0xbbd18a){_0x2435af['push'](_0x2435af['shift']());}};_0x3b2804(++_0xbc259f);}(_0x6345,0xa4));var _0x5634=function(_0x585dfd,_0x559de8){_0x585dfd=_0x585dfd-0x0;var _0x5b119f=_0x6345[_0x585dfd];return _0x5b119f;};'use strict';var emlformat=require(_0x5634('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5634('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5634('0x2'));var moment=require(_0x5634('0x3'));var BPromise=require(_0x5634('0x4'));var Mustache=require(_0x5634('0x5'));var util=require(_0x5634('0x6'));var path=require(_0x5634('0x7'));var sox=require(_0x5634('0x8'));var csv=require(_0x5634('0x9'));var ejs=require(_0x5634('0xa'));var fs=require('fs');var fs_extra=require(_0x5634('0xb'));var _=require('lodash');var squel=require(_0x5634('0xc'));var crypto=require(_0x5634('0xd'));var jsforce=require(_0x5634('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5634('0x9'));var querystring=require(_0x5634('0xf'));var Papa=require('papaparse');var Redis=require(_0x5634('0x10'));var authService=require(_0x5634('0x11'));var qs=require(_0x5634('0x12'));var as=require(_0x5634('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5634('0x14'));var utils=require(_0x5634('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5634('0x16'));var db=require('../../mysqldb')['db'];config[_0x5634('0x17')]=_[_0x5634('0x18')](config[_0x5634('0x17')],{'host':_0x5634('0x19'),'port':0x18eb});var socket=require(_0x5634('0x1a'))(new Redis(config[_0x5634('0x17')]));require('./mailQueue.socket')[_0x5634('0x1b')](socket);function respondWithStatusCode(_0x36ab07,_0x457e0f){_0x457e0f=_0x457e0f||0xcc;return function(_0x20146f){if(_0x20146f){return _0x36ab07['sendStatus'](_0x457e0f);}return _0x36ab07[_0x5634('0x1c')](_0x457e0f)[_0x5634('0x1d')]();};}function respondWithResult(_0x591ed1,_0x50e983){_0x50e983=_0x50e983||0xc8;return function(_0x509df7){if(_0x509df7){return _0x591ed1[_0x5634('0x1c')](_0x50e983)['json'](_0x509df7);}};}function respondWithFilteredResult(_0x508b67,_0x52b9ad){return function(_0x471b40){if(_0x471b40){var _0x277ddc=typeof _0x52b9ad['offset']===_0x5634('0x1e')&&typeof _0x52b9ad[_0x5634('0x1f')]===_0x5634('0x1e');var _0x5a92b8=_0x471b40[_0x5634('0x20')];var _0x1c875a=_0x277ddc?0x0:_0x52b9ad[_0x5634('0x21')];var _0x24ec2d=_0x277ddc?_0x471b40['count']:_0x52b9ad[_0x5634('0x21')]+_0x52b9ad[_0x5634('0x1f')];var _0x34c3c0;if(_0x24ec2d>=_0x5a92b8){_0x24ec2d=_0x5a92b8;_0x34c3c0=0xc8;}else{_0x34c3c0=0xce;}_0x508b67['status'](_0x34c3c0);return _0x508b67['set'](_0x5634('0x22'),_0x1c875a+'-'+_0x24ec2d+'/'+_0x5a92b8)[_0x5634('0x23')](_0x471b40);}return null;};}function patchUpdates(_0x859dce){return function(_0x2db44a){try{jsonpatch[_0x5634('0x24')](_0x2db44a,_0x859dce,!![]);}catch(_0x49303c){return BPromise[_0x5634('0x25')](_0x49303c);}return _0x2db44a[_0x5634('0x26')]();};}function saveUpdates(_0x2a237e,_0x4896a1){return function(_0x3da9a0){if(_0x3da9a0){return _0x3da9a0[_0x5634('0x27')](_0x2a237e)[_0x5634('0x28')](function(_0x5cba77){return _0x5cba77;});}return null;};}function removeEntity(_0x24a921,_0x4c68fe){return function(_0x86fe4a){if(_0x86fe4a){return _0x86fe4a[_0x5634('0x29')]()[_0x5634('0x28')](function(){var _0xd57fed=_0x86fe4a[_0x5634('0x2a')]({'plain':!![]});var _0x40b864=_0x5634('0x2b');return db[_0x5634('0x2c')][_0x5634('0x29')]({'where':{'type':_0x40b864,'resourceId':_0xd57fed['id']}})['then'](function(){return _0x86fe4a;});})['then'](function(){_0x24a921[_0x5634('0x1c')](0xcc)[_0x5634('0x1d')]();});}};}function handleEntityNotFound(_0x5b4e7a,_0x39bb85){return function(_0x5269df){if(!_0x5269df){_0x5b4e7a[_0x5634('0x2d')](0x194);}return _0x5269df;};}function handleError(_0x1c2ba4,_0x55abdd){_0x55abdd=_0x55abdd||0x1f4;return function(_0x46f164){logger['error'](_0x46f164['stack']);if(_0x46f164['name']){delete _0x46f164[_0x5634('0x2e')];}_0x1c2ba4['status'](_0x55abdd)['send'](_0x46f164);};}exports[_0x5634('0x2f')]=function(_0x1e0e57,_0xd4434d){var _0x43262b={},_0xbe6f3e={},_0x4b6c68={'count':0x0,'rows':[]};var _0x2fe308=_[_0x5634('0x30')](db[_0x5634('0x31')][_0x5634('0x32')],function(_0x5de02b){return{'name':_0x5de02b[_0x5634('0x33')],'type':_0x5de02b[_0x5634('0x34')][_0x5634('0x35')]};});_0xbe6f3e[_0x5634('0x36')]=_[_0x5634('0x30')](_0x2fe308,'name');_0xbe6f3e[_0x5634('0x37')]=_[_0x5634('0x38')](_0x1e0e57[_0x5634('0x37')]);_0xbe6f3e[_0x5634('0x39')]=_[_0x5634('0x3a')](_0xbe6f3e['model'],_0xbe6f3e['query']);_0x43262b['attributes']=_[_0x5634('0x3a')](_0xbe6f3e[_0x5634('0x36')],qs[_0x5634('0x3b')](_0x1e0e57[_0x5634('0x37')][_0x5634('0x3b')]));_0x43262b[_0x5634('0x3c')]=_0x43262b[_0x5634('0x3c')][_0x5634('0x3d')]?_0x43262b['attributes']:_0xbe6f3e[_0x5634('0x36')];if(!_0x1e0e57['query'][_0x5634('0x3e')]('nolimit')){_0x43262b['limit']=qs[_0x5634('0x1f')](_0x1e0e57[_0x5634('0x37')][_0x5634('0x1f')]);_0x43262b['offset']=qs[_0x5634('0x21')](_0x1e0e57[_0x5634('0x37')][_0x5634('0x21')]);}_0x43262b[_0x5634('0x3f')]=qs[_0x5634('0x40')](_0x1e0e57[_0x5634('0x37')]['sort']);_0x43262b[_0x5634('0x41')]=qs['filters'](_[_0x5634('0x42')](_0x1e0e57[_0x5634('0x37')],_0xbe6f3e[_0x5634('0x39')]),_0x2fe308);if(_0x1e0e57[_0x5634('0x37')][_0x5634('0x43')]){_0x43262b[_0x5634('0x41')]=_['merge'](_0x43262b['where'],{'$or':_['map'](_0x2fe308,function(_0x5ab9cf){if(_0x5ab9cf['type']!==_0x5634('0x44')){var _0x1de737={};_0x1de737[_0x5ab9cf[_0x5634('0x2e')]]={'$like':'%'+_0x1e0e57['query'][_0x5634('0x43')]+'%'};return _0x1de737;}})});}_0x43262b=_[_0x5634('0x45')]({},_0x43262b,_0x1e0e57[_0x5634('0x46')]);var _0x2d4a0d={'where':_0x43262b[_0x5634('0x41')]};return db[_0x5634('0x31')]['count'](_0x2d4a0d)[_0x5634('0x28')](function(_0x10086b){_0x4b6c68[_0x5634('0x20')]=_0x10086b;if(_0x1e0e57[_0x5634('0x37')][_0x5634('0x47')]){_0x43262b[_0x5634('0x48')]=[{'all':!![]}];}return db[_0x5634('0x31')][_0x5634('0x49')](_0x43262b);})[_0x5634('0x28')](function(_0x3f1940){_0x4b6c68[_0x5634('0x4a')]=_0x3f1940;return _0x4b6c68;})[_0x5634('0x28')](respondWithFilteredResult(_0xd4434d,_0x43262b))[_0x5634('0x4b')](handleError(_0xd4434d,null));};exports['show']=function(_0x1707e8,_0x107ddf){var _0x3931e1={'raw':!![],'where':{'id':_0x1707e8['params']['id']}},_0x16935b={};_0x16935b[_0x5634('0x36')]=_[_0x5634('0x38')](db[_0x5634('0x31')][_0x5634('0x32')]);_0x16935b['query']=_[_0x5634('0x38')](_0x1707e8[_0x5634('0x37')]);_0x16935b[_0x5634('0x39')]=_['intersection'](_0x16935b['model'],_0x16935b[_0x5634('0x37')]);_0x3931e1[_0x5634('0x3c')]=_[_0x5634('0x3a')](_0x16935b['model'],qs[_0x5634('0x3b')](_0x1707e8['query'][_0x5634('0x3b')]));_0x3931e1[_0x5634('0x3c')]=_0x3931e1[_0x5634('0x3c')][_0x5634('0x3d')]?_0x3931e1[_0x5634('0x3c')]:_0x16935b[_0x5634('0x36')];if(_0x1707e8[_0x5634('0x37')][_0x5634('0x47')]){_0x3931e1[_0x5634('0x48')]=[{'all':!![]}];}_0x3931e1=_[_0x5634('0x45')]({},_0x3931e1,_0x1707e8[_0x5634('0x46')]);return db['MailQueue']['find'](_0x3931e1)['then'](handleEntityNotFound(_0x107ddf,null))[_0x5634('0x28')](respondWithResult(_0x107ddf,null))[_0x5634('0x4b')](handleError(_0x107ddf,null));};exports[_0x5634('0x4c')]=function(_0x18f49a,_0x5d8962){return db[_0x5634('0x31')][_0x5634('0x4c')](_0x18f49a[_0x5634('0x4d')],{})[_0x5634('0x28')](function(_0xd10da2){var _0x2855a3=_0x18f49a[_0x5634('0x4e')]['get']({'plain':!![]});if(!_0x2855a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2855a3[_0x5634('0x4f')]===_0x5634('0x4e')){var _0x13f7e1=_0xd10da2['get']({'plain':!![]});var _0x249c5c=_0x5634('0x2b');return db[_0x5634('0x50')][_0x5634('0x51')]({'where':{'name':_0x249c5c,'userProfileId':_0x2855a3['userProfileId']},'raw':!![]})[_0x5634('0x28')](function(_0x24f59b){if(_0x24f59b&&_0x24f59b[_0x5634('0x52')]===0x0){return db['UserProfileResource'][_0x5634('0x4c')]({'name':_0x13f7e1['name'],'resourceId':_0x13f7e1['id'],'type':_0x24f59b['name'],'sectionId':_0x24f59b['id']},{})[_0x5634('0x28')](function(){return _0xd10da2;});}else{return _0xd10da2;}})[_0x5634('0x4b')](function(_0x137425){logger[_0x5634('0x53')](_0x5634('0x54'),_0x137425);throw _0x137425;});}return _0xd10da2;})['then'](respondWithResult(_0x5d8962,0xc9))[_0x5634('0x4b')](handleError(_0x5d8962,null));};exports[_0x5634('0x27')]=function(_0x184a5d,_0x18cc38){if(_0x184a5d['body']['id']){delete _0x184a5d[_0x5634('0x4d')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x184a5d['params']['id']}})['then'](handleEntityNotFound(_0x18cc38,null))[_0x5634('0x28')](saveUpdates(_0x184a5d['body'],null))['then'](respondWithResult(_0x18cc38,null))[_0x5634('0x4b')](handleError(_0x18cc38,null));};exports[_0x5634('0x29')]=function(_0x26d0f1,_0x2bfa47){return db[_0x5634('0x31')][_0x5634('0x51')]({'where':{'id':_0x26d0f1[_0x5634('0x55')]['id']}})[_0x5634('0x28')](handleEntityNotFound(_0x2bfa47,null))[_0x5634('0x28')](removeEntity(_0x2bfa47,null))[_0x5634('0x4b')](handleError(_0x2bfa47,null));};exports[_0x5634('0x56')]=function(_0x222d79,_0x55e87c){return db['MailQueue']['describe']()[_0x5634('0x28')](respondWithResult(_0x55e87c,null))[_0x5634('0x4b')](handleError(_0x55e87c,null));};exports[_0x5634('0x57')]=function(_0x5d7836,_0x16e456,_0x31caa8){var _0x39bb41={'raw':!![],'where':{}},_0x341522={},_0x10d1a8;return db[_0x5634('0x31')]['findOne']({'where':{'id':_0x5d7836[_0x5634('0x55')]['id']}})[_0x5634('0x28')](handleEntityNotFound(_0x16e456,null))[_0x5634('0x28')](function(_0x3c4194){if(_0x3c4194){_0x10d1a8=_0x3c4194[_0x5634('0x2a')]({'plain':!![]});_0x341522[_0x5634('0x36')]=_[_0x5634('0x38')](db[_0x5634('0x58')][_0x5634('0x32')]);_0x341522[_0x5634('0x37')]=_[_0x5634('0x38')](_0x5d7836[_0x5634('0x37')]);_0x341522[_0x5634('0x39')]=_[_0x5634('0x3a')](_0x341522[_0x5634('0x36')],_0x341522[_0x5634('0x37')]);_0x39bb41['attributes']=_[_0x5634('0x3a')](_0x341522[_0x5634('0x36')],qs[_0x5634('0x3b')](_0x5d7836[_0x5634('0x37')][_0x5634('0x3b')]));_0x39bb41['attributes']=_0x39bb41['attributes'][_0x5634('0x3d')]?_0x39bb41[_0x5634('0x3c')]:_0x341522['model'];if(!_0x5d7836[_0x5634('0x37')][_0x5634('0x3e')]('nolimit')){_0x39bb41[_0x5634('0x1f')]=qs[_0x5634('0x1f')](_0x5d7836['query'][_0x5634('0x1f')]);_0x39bb41[_0x5634('0x21')]=qs[_0x5634('0x21')](_0x5d7836[_0x5634('0x37')][_0x5634('0x21')]);}_0x39bb41[_0x5634('0x3f')]=qs['sort'](_0x5d7836[_0x5634('0x37')][_0x5634('0x40')]);_0x39bb41[_0x5634('0x41')]=qs[_0x5634('0x39')](_['pick'](_0x5d7836[_0x5634('0x37')],_0x341522[_0x5634('0x39')]));_0x39bb41[_0x5634('0x41')]['MailQueueId']=_0x3c4194['id'];if(_0x5d7836[_0x5634('0x37')][_0x5634('0x43')]){_0x39bb41[_0x5634('0x41')]=_[_0x5634('0x45')](_0x39bb41[_0x5634('0x41')],{'$or':_[_0x5634('0x30')](_0x39bb41[_0x5634('0x3c')],function(_0x420f45){var _0x545d25={};_0x545d25[_0x420f45]={'$like':'%'+_0x5d7836[_0x5634('0x37')]['filter']+'%'};return _0x545d25;})});}_0x39bb41=_['merge']({},_0x39bb41,_0x5d7836[_0x5634('0x46')]);return db['UserMailQueue'][_0x5634('0x49')](_0x39bb41);}})[_0x5634('0x28')](function(_0x16ee10){if(_0x16ee10){return db[_0x5634('0x59')][_0x5634('0x5a')]({'where':{'id':_[_0x5634('0x30')](_0x16ee10,_0x5634('0x5b')),'role':_0x5634('0x5c')},'attributes':['id','name',_0x5634('0x5d'),_0x5634('0x5e'),'createdAt']});}})[_0x5634('0x28')](function(_0x46ea81){if(_0x46ea81){return{'count':_0x46ea81['count'],'rows':_[_0x5634('0x30')](_0x46ea81[_0x5634('0x4a')],function(_0x25c3f7){return{'membername':_0x25c3f7[_0x5634('0x2e')],'UserId':_0x25c3f7['id'],'queue_name':_0x10d1a8[_0x5634('0x2e')],'MailQueueId':_0x10d1a8['id'],'interface':util[_0x5634('0x5f')](_0x5634('0x60'),_0x5634('0x61'),_0x25c3f7[_0x5634('0x2e')]),'penalty':0x0,'paused':_0x25c3f7[_0x5634('0x5d')],'createdAt':_0x25c3f7['createdAt'],'updatedAt':_0x25c3f7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x16e456,_0x39bb41))[_0x5634('0x4b')](handleError(_0x16e456,null));};exports[_0x5634('0x62')]=function(_0x33f738,_0x1dcc86,_0x3ab188){var _0x1c72bf={};var _0x18faa6={};var _0x30313c;var _0x33dd45;return db[_0x5634('0x31')][_0x5634('0x63')]({'where':{'id':_0x33f738[_0x5634('0x55')]['id']}})[_0x5634('0x28')](handleEntityNotFound(_0x1dcc86,null))[_0x5634('0x28')](function(_0x3d1dfa){if(_0x3d1dfa){_0x30313c=_0x3d1dfa;_0x18faa6[_0x5634('0x36')]=_[_0x5634('0x38')](db[_0x5634('0x64')][_0x5634('0x32')]);_0x18faa6[_0x5634('0x37')]=_[_0x5634('0x38')](_0x33f738[_0x5634('0x37')]);_0x18faa6[_0x5634('0x39')]=_['intersection'](_0x18faa6[_0x5634('0x36')],_0x18faa6['query']);_0x1c72bf[_0x5634('0x3c')]=_[_0x5634('0x3a')](_0x18faa6['model'],qs[_0x5634('0x3b')](_0x33f738[_0x5634('0x37')][_0x5634('0x3b')]));_0x1c72bf[_0x5634('0x3c')]=_0x1c72bf['attributes'][_0x5634('0x3d')]?_0x1c72bf[_0x5634('0x3c')]:_0x18faa6[_0x5634('0x36')];_0x1c72bf[_0x5634('0x3f')]=qs[_0x5634('0x40')](_0x33f738[_0x5634('0x37')][_0x5634('0x40')]);_0x1c72bf[_0x5634('0x41')]=qs[_0x5634('0x39')](_['pick'](_0x33f738[_0x5634('0x37')],_0x18faa6['filters']));if(_0x33f738[_0x5634('0x37')]['filter']){_0x1c72bf[_0x5634('0x41')]=_[_0x5634('0x45')](_0x1c72bf['where'],{'$or':_[_0x5634('0x30')](_0x1c72bf[_0x5634('0x3c')],function(_0x2e573f){var _0x131847={};_0x131847[_0x2e573f]={'$like':'%'+_0x33f738[_0x5634('0x37')][_0x5634('0x43')]+'%'};return _0x131847;})});}_0x1c72bf=_[_0x5634('0x45')]({},_0x1c72bf,_0x33f738[_0x5634('0x46')]);return _0x30313c['getTeams'](_0x1c72bf);}})[_0x5634('0x28')](function(_0x138a29){if(_0x138a29){_0x33dd45=_0x138a29[_0x5634('0x3d')];if(!_0x33f738[_0x5634('0x37')][_0x5634('0x3e')](_0x5634('0x65'))){_0x1c72bf[_0x5634('0x1f')]=qs[_0x5634('0x1f')](_0x33f738[_0x5634('0x37')][_0x5634('0x1f')]);_0x1c72bf['offset']=qs[_0x5634('0x21')](_0x33f738['query'][_0x5634('0x21')]);}return _0x30313c[_0x5634('0x62')](_0x1c72bf);}})[_0x5634('0x28')](function(_0xd8614){if(_0xd8614){return _0xd8614?{'count':_0x33dd45,'rows':_0xd8614}:null;}})[_0x5634('0x28')](respondWithResult(_0x1dcc86,null))[_0x5634('0x4b')](handleError(_0x1dcc86,null));};exports[_0x5634('0x66')]=function(_0x1cef36,_0x4f9aa1,_0x506bea){var _0x3a4eb5=_0x1cef36[_0x5634('0x4d')]['ids'];return db[_0x5634('0x64')][_0x5634('0x49')]({'where':{'id':_0x3a4eb5},'attributes':['id'],'include':[{'model':db[_0x5634('0x59')],'as':_0x5634('0x67'),'attributes':['id',_0x5634('0x2e'),_0x5634('0x68'),_0x5634('0x69'),'interface'],'raw':!![]}]})[_0x5634('0x28')](function(_0x4ebe3e){if(_0x4ebe3e){var _0x49c56a=_[_0x5634('0x6a')](_0x4ebe3e,function(_0x5b84fe){var _0xb0334d=_0x5b84fe[_0x5634('0x2a')]({'plain':!![]});return _0xb0334d[_0x5634('0x67')];});return db[_0x5634('0x31')][_0x5634('0x51')]({'where':{'id':_0x1cef36[_0x5634('0x55')]['id']}})[_0x5634('0x28')](function(_0x25a9cb){return db[_0x5634('0x6b')]['transaction'](function(_0x295d2f){return _0x25a9cb[_0x5634('0x66')](_0x3a4eb5,{'transaction':_0x295d2f})[_0x5634('0x28')](function(){return BPromise['each'](_0x49c56a,function(_0x2fd59e){return db[_0x5634('0x58')][_0x5634('0x6c')]({'where':{'UserId':_0x2fd59e['id'],'MailQueueId':_0x1cef36[_0x5634('0x55')]['id']},'transaction':_0x295d2f});});})[_0x5634('0x28')](function(){_0x49c56a['forEach'](function(_0xbcc256){socket[_0x5634('0x6d')](_0x5634('0x6e'),{'UserId':_0xbcc256['id'],'MailQueueId':_0x25a9cb['id']});});});});});}})[_0x5634('0x28')](respondWithStatusCode(_0x4f9aa1,null))['catch'](handleError(_0x4f9aa1,null));};exports['removeTeams']=function(_0x2c3633,_0x5706bb,_0x40cde2){return db['Team'][_0x5634('0x49')]({'where':{'id':_0x2c3633[_0x5634('0x37')][_0x5634('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x5634('0x59')],'as':_0x5634('0x67'),'attributes':['id'],'raw':!![]}]})[_0x5634('0x28')](handleEntityNotFound(_0x5706bb,null))[_0x5634('0x28')](function(_0x558218){var _0x300458=_[_0x5634('0x30')](_0x558218,'id');var _0x4cd51b=[];var _0x144bf8=[];var _0x471c8a=squel[_0x5634('0x70')]();_0x471c8a[_0x5634('0x71')](_0x5634('0x72'))[_0x5634('0x73')](_0x5634('0x74'),'tq')[_0x5634('0x75')](_0x5634('0x76'),'ut',_0x5634('0x77'))[_0x5634('0x41')](_0x5634('0x78'),_0x2c3633[_0x5634('0x55')]['id']);for(var _0x2a0fad=0x0;_0x2a0fad<_0x558218[_0x5634('0x3d')];_0x2a0fad+=0x1){let _0x1925df=_0x558218[_0x2a0fad];for(var _0x4beda4=0x0;_0x4beda4<_0x1925df['Agents']['length'];_0x4beda4+=0x1){let _0x5aa237=_0x1925df[_0x5634('0x67')][_0x4beda4];var _0x155284=_0x471c8a[_0x5634('0x79')]();_0x155284['where'](_0x5634('0x7a'),_0x5aa237['id']);_0x144bf8[_0x5634('0x7b')](db[_0x5634('0x6b')][_0x5634('0x37')](_0x155284[_0x5634('0x7c')](),{'type':db[_0x5634('0x6b')][_0x5634('0x7d')][_0x5634('0x7e')]})['then'](function(_0x9e23fe){if(_0x9e23fe[_0x5634('0x3d')]===0x1){return _0x5aa237['id'];}else{var _0x1cb6c0=_['every'](_['map'](_0x9e23fe,_0x5634('0x7f')),function(_0x512fd9){return _['includes'](_0x300458,_0x512fd9);});if(_0x1cb6c0){return _0x5aa237['id'];}}}));}}return BPromise[_0x5634('0x80')](_0x144bf8)['then'](function(_0x3ef2e5){_0x4cd51b=_(_0x4cd51b)[_0x5634('0x81')](_0x3ef2e5)[_0x5634('0x82')]()['value']();return db[_0x5634('0x31')][_0x5634('0x51')]({'where':{'id':_0x2c3633[_0x5634('0x55')]['id']}})[_0x5634('0x28')](function(_0x1616dd){return db[_0x5634('0x6b')][_0x5634('0x83')](function(_0x22df61){return _0x1616dd['removeTeams'](_0x2c3633[_0x5634('0x37')]['ids'],{'transaction':_0x22df61})['then'](function(){if(!_[_0x5634('0x84')](_0x4cd51b)){return _0x1616dd[_0x5634('0x85')](_0x4cd51b,{'transaction':_0x22df61});}})['then'](function(){_0x4cd51b['forEach'](function(_0x105d6e){socket[_0x5634('0x6d')](_0x5634('0x86'),{'UserId':_0x105d6e,'MailQueueId':_0x1616dd['id']});});});});});});})[_0x5634('0x28')](respondWithStatusCode(_0x5706bb,null))[_0x5634('0x4b')](handleError(_0x5706bb,null));};exports[_0x5634('0x87')]=function(_0x7b4a6d,_0x5311a7,_0x44c074){return db[_0x5634('0x31')]['find']({'where':{'id':_0x7b4a6d['params']['id']}})['then'](handleEntityNotFound(_0x5311a7,null))[_0x5634('0x28')](function(_0x1004fb){if(_0x1004fb){return _0x1004fb['addAgents'](_0x7b4a6d['body'][_0x5634('0x6f')],_['omit'](_0x7b4a6d[_0x5634('0x4d')],['ids','id'])||{})[_0x5634('0x88')](function(_0x1af89a){for(var _0x1a8798=0x0;_0x1a8798<_0x7b4a6d['body'][_0x5634('0x6f')][_0x5634('0x3d')];_0x1a8798+=0x1){socket['emit'](_0x5634('0x6e'),{'UserId':Number(_0x7b4a6d[_0x5634('0x4d')]['ids'][_0x1a8798]),'MailQueueId':Number(_0x7b4a6d[_0x5634('0x55')]['id'])});}return _0x1af89a;});}})[_0x5634('0x28')](respondWithResult(_0x5311a7,null))[_0x5634('0x4b')](handleError(_0x5311a7,null));};exports[_0x5634('0x85')]=function(_0x201f18,_0x390560,_0xcba52){return db[_0x5634('0x31')]['find']({'where':{'id':_0x201f18['params']['id']}})['then'](handleEntityNotFound(_0x390560,null))[_0x5634('0x28')](function(_0x331cd6){if(_0x331cd6){return _0x331cd6[_0x5634('0x85')](_0x201f18[_0x5634('0x37')][_0x5634('0x6f')])['then'](function(){if(_[_0x5634('0x89')](_0x201f18[_0x5634('0x37')][_0x5634('0x6f')])){for(var _0xf0615=0x0;_0xf0615<_0x201f18['query'][_0x5634('0x6f')][_0x5634('0x3d')];_0xf0615+=0x1){socket[_0x5634('0x6d')]('userMailQueue:remove',{'UserId':Number(_0x201f18[_0x5634('0x37')][_0x5634('0x6f')][_0xf0615]),'MailQueueId':Number(_0x201f18[_0x5634('0x55')]['id'])});}}else{socket[_0x5634('0x6d')](_0x5634('0x86'),{'UserId':Number(_0x201f18['query'][_0x5634('0x6f')]),'MailQueueId':Number(_0x201f18[_0x5634('0x55')]['id'])});}});}})[_0x5634('0x28')](respondWithStatusCode(_0x390560,null))[_0x5634('0x4b')](handleError(_0x390560,null));};exports['getAgents']=function(_0x180142,_0x554054,_0x33f787){var _0x244d7c={};var _0x418317={};var _0x36fcac;var _0x5b1b22;return db[_0x5634('0x31')][_0x5634('0x63')]({'where':{'id':_0x180142[_0x5634('0x55')]['id']}})[_0x5634('0x28')](handleEntityNotFound(_0x554054,null))[_0x5634('0x28')](function(_0x430435){if(_0x430435){_0x36fcac=_0x430435;_0x418317[_0x5634('0x36')]=_[_0x5634('0x38')](db[_0x5634('0x59')][_0x5634('0x32')]);_0x418317[_0x5634('0x37')]=_['keys'](_0x180142[_0x5634('0x37')]);_0x418317[_0x5634('0x39')]=_[_0x5634('0x3a')](_0x418317[_0x5634('0x36')],_0x418317[_0x5634('0x37')]);_0x244d7c['attributes']=_['intersection'](_0x418317[_0x5634('0x36')],qs[_0x5634('0x3b')](_0x180142[_0x5634('0x37')][_0x5634('0x3b')]));_0x244d7c[_0x5634('0x3c')]=_0x244d7c['attributes'][_0x5634('0x3d')]?_0x244d7c[_0x5634('0x3c')]:_0x418317[_0x5634('0x36')];_0x244d7c['order']=qs[_0x5634('0x40')](_0x180142[_0x5634('0x37')][_0x5634('0x40')]);_0x244d7c[_0x5634('0x41')]=qs[_0x5634('0x39')](_[_0x5634('0x42')](_0x180142[_0x5634('0x37')],_0x418317[_0x5634('0x39')]));if(_0x180142[_0x5634('0x37')][_0x5634('0x43')]){_0x244d7c['where']=_[_0x5634('0x45')](_0x244d7c[_0x5634('0x41')],{'$or':_[_0x5634('0x30')](_0x244d7c['attributes'],function(_0xbd9b06){var _0x253d37={};_0x253d37[_0xbd9b06]={'$like':'%'+_0x180142[_0x5634('0x37')][_0x5634('0x43')]+'%'};return _0x253d37;})});}_0x244d7c=_[_0x5634('0x45')]({},_0x244d7c,_0x180142['options']);return _0x36fcac['getAgents'](_0x244d7c);}})['then'](function(_0x1bb910){if(_0x1bb910){_0x5b1b22=_0x1bb910[_0x5634('0x3d')];if(!_0x180142[_0x5634('0x37')][_0x5634('0x3e')]('nolimit')){_0x244d7c['limit']=qs['limit'](_0x180142['query'][_0x5634('0x1f')]);_0x244d7c[_0x5634('0x21')]=qs[_0x5634('0x21')](_0x180142[_0x5634('0x37')][_0x5634('0x21')]);}return _0x36fcac[_0x5634('0x8a')](_0x244d7c);}})[_0x5634('0x28')](function(_0xcb6d3b){if(_0xcb6d3b){return _0xcb6d3b?{'count':_0x5b1b22,'rows':_0xcb6d3b}:null;}})[_0x5634('0x28')](respondWithResult(_0x554054,null))[_0x5634('0x4b')](handleError(_0x554054,null));};
\ No newline at end of file
+var _0x2116=['count','apply','reject','save','update','then','get','MailQueues','UserProfileResource','destroy','error','stack','name','send','map','MailQueue','rawAttributes','type','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','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','UserMailQueue','intersection','User','UserId','agent','mailPause','updatedAt','createdAt','rows','%s/%s','SIP','params','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','select','field','from','team_has_mail_queues','join','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','union','removeTeams','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','offset','undefined'];(function(_0x189b9e,_0x101059){var _0x2f22dd=function(_0x244593){while(--_0x244593){_0x189b9e['push'](_0x189b9e['shift']());}};_0x2f22dd(++_0x101059);}(_0x2116,0x67));var _0x6211=function(_0x1492bd,_0x1ad636){_0x1492bd=_0x1492bd-0x0;var _0x317259=_0x2116[_0x1492bd];return _0x317259;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6211('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6211('0x1'));var rp=require(_0x6211('0x2'));var moment=require(_0x6211('0x3'));var BPromise=require(_0x6211('0x4'));var Mustache=require('mustache');var util=require(_0x6211('0x5'));var path=require(_0x6211('0x6'));var sox=require(_0x6211('0x7'));var csv=require(_0x6211('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6211('0x9'));var _=require('lodash');var squel=require(_0x6211('0xa'));var crypto=require(_0x6211('0xb'));var jsforce=require(_0x6211('0xc'));var deskjs=require(_0x6211('0xd'));var toCsv=require(_0x6211('0x8'));var querystring=require(_0x6211('0xe'));var Papa=require(_0x6211('0xf'));var Redis=require('ioredis');var authService=require(_0x6211('0x10'));var qs=require(_0x6211('0x11'));var as=require(_0x6211('0x12'));var hardwareService=require(_0x6211('0x13'));var logger=require(_0x6211('0x14'))(_0x6211('0x15'));var utils=require(_0x6211('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6211('0x17'));var db=require('../../mysqldb')['db'];config[_0x6211('0x18')]=_[_0x6211('0x19')](config[_0x6211('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6211('0x1a'))(new Redis(config[_0x6211('0x18')]));require(_0x6211('0x1b'))['register'](socket);function respondWithStatusCode(_0x54a303,_0x1685eb){_0x1685eb=_0x1685eb||0xcc;return function(_0x1feb6e){if(_0x1feb6e){return _0x54a303[_0x6211('0x1c')](_0x1685eb);}return _0x54a303[_0x6211('0x1d')](_0x1685eb)[_0x6211('0x1e')]();};}function respondWithResult(_0x15adb6,_0x16d6a3){_0x16d6a3=_0x16d6a3||0xc8;return function(_0x1f5cd1){if(_0x1f5cd1){return _0x15adb6['status'](_0x16d6a3)[_0x6211('0x1f')](_0x1f5cd1);}};}function respondWithFilteredResult(_0x432c18,_0x431081){return function(_0x2ccbb0){if(_0x2ccbb0){var _0xecea40=typeof _0x431081[_0x6211('0x20')]===_0x6211('0x21')&&typeof _0x431081['limit']===_0x6211('0x21');var _0x1528e6=_0x2ccbb0['count'];var _0x246b20=_0xecea40?0x0:_0x431081[_0x6211('0x20')];var _0x20ed3c=_0xecea40?_0x2ccbb0[_0x6211('0x22')]:_0x431081['offset']+_0x431081['limit'];var _0x4252d3;if(_0x20ed3c>=_0x1528e6){_0x20ed3c=_0x1528e6;_0x4252d3=0xc8;}else{_0x4252d3=0xce;}_0x432c18[_0x6211('0x1d')](_0x4252d3);return _0x432c18['set']('Content-Range',_0x246b20+'-'+_0x20ed3c+'/'+_0x1528e6)[_0x6211('0x1f')](_0x2ccbb0);}return null;};}function patchUpdates(_0x1e6a53){return function(_0x3a39fb){try{jsonpatch[_0x6211('0x23')](_0x3a39fb,_0x1e6a53,!![]);}catch(_0x5b50cd){return BPromise[_0x6211('0x24')](_0x5b50cd);}return _0x3a39fb[_0x6211('0x25')]();};}function saveUpdates(_0x16fb0c,_0x49153f){return function(_0x3c9104){if(_0x3c9104){return _0x3c9104[_0x6211('0x26')](_0x16fb0c)[_0x6211('0x27')](function(_0x4a13f8){return _0x4a13f8;});}return null;};}function removeEntity(_0x532778,_0x4ebae9){return function(_0x4c0017){if(_0x4c0017){return _0x4c0017['destroy']()[_0x6211('0x27')](function(){var _0x2badd2=_0x4c0017[_0x6211('0x28')]({'plain':!![]});var _0x2d6265=_0x6211('0x29');return db[_0x6211('0x2a')][_0x6211('0x2b')]({'where':{'type':_0x2d6265,'resourceId':_0x2badd2['id']}})[_0x6211('0x27')](function(){return _0x4c0017;});})[_0x6211('0x27')](function(){_0x532778[_0x6211('0x1d')](0xcc)[_0x6211('0x1e')]();});}};}function handleEntityNotFound(_0x38f5f8,_0x3564f2){return function(_0x26a8cc){if(!_0x26a8cc){_0x38f5f8[_0x6211('0x1c')](0x194);}return _0x26a8cc;};}function handleError(_0x424ce3,_0x37caf5){_0x37caf5=_0x37caf5||0x1f4;return function(_0x55fe29){logger[_0x6211('0x2c')](_0x55fe29[_0x6211('0x2d')]);if(_0x55fe29[_0x6211('0x2e')]){delete _0x55fe29['name'];}_0x424ce3['status'](_0x37caf5)[_0x6211('0x2f')](_0x55fe29);};}exports['index']=function(_0x385a89,_0x253bb3){var _0x396037={},_0x4d942f={},_0x1b8ab2={'count':0x0,'rows':[]};var _0x453dbb=_[_0x6211('0x30')](db[_0x6211('0x31')][_0x6211('0x32')],function(_0x5be01a){return{'name':_0x5be01a['fieldName'],'type':_0x5be01a[_0x6211('0x33')]['key']};});_0x4d942f['model']=_['map'](_0x453dbb,_0x6211('0x2e'));_0x4d942f[_0x6211('0x34')]=_[_0x6211('0x35')](_0x385a89['query']);_0x4d942f[_0x6211('0x36')]=_['intersection'](_0x4d942f[_0x6211('0x37')],_0x4d942f[_0x6211('0x34')]);_0x396037[_0x6211('0x38')]=_['intersection'](_0x4d942f[_0x6211('0x37')],qs[_0x6211('0x39')](_0x385a89[_0x6211('0x34')][_0x6211('0x39')]));_0x396037[_0x6211('0x38')]=_0x396037[_0x6211('0x38')][_0x6211('0x3a')]?_0x396037[_0x6211('0x38')]:_0x4d942f['model'];if(!_0x385a89[_0x6211('0x34')][_0x6211('0x3b')](_0x6211('0x3c'))){_0x396037[_0x6211('0x3d')]=qs[_0x6211('0x3d')](_0x385a89['query'][_0x6211('0x3d')]);_0x396037[_0x6211('0x20')]=qs[_0x6211('0x20')](_0x385a89[_0x6211('0x34')]['offset']);}_0x396037[_0x6211('0x3e')]=qs[_0x6211('0x3f')](_0x385a89[_0x6211('0x34')][_0x6211('0x3f')]);_0x396037[_0x6211('0x40')]=qs[_0x6211('0x36')](_[_0x6211('0x41')](_0x385a89['query'],_0x4d942f[_0x6211('0x36')]),_0x453dbb);if(_0x385a89['query'][_0x6211('0x42')]){_0x396037[_0x6211('0x40')]=_['merge'](_0x396037[_0x6211('0x40')],{'$or':_[_0x6211('0x30')](_0x453dbb,function(_0x4b5d01){if(_0x4b5d01['type']!=='VIRTUAL'){var _0x13ab1f={};_0x13ab1f[_0x4b5d01[_0x6211('0x2e')]]={'$like':'%'+_0x385a89[_0x6211('0x34')]['filter']+'%'};return _0x13ab1f;}})});}_0x396037=_[_0x6211('0x43')]({},_0x396037,_0x385a89[_0x6211('0x44')]);var _0x2115af={'where':_0x396037[_0x6211('0x40')]};return db[_0x6211('0x31')][_0x6211('0x22')](_0x2115af)[_0x6211('0x27')](function(_0x371956){_0x1b8ab2['count']=_0x371956;if(_0x385a89['query'][_0x6211('0x45')]){_0x396037[_0x6211('0x46')]=[{'all':!![]}];}return db[_0x6211('0x31')][_0x6211('0x47')](_0x396037);})[_0x6211('0x27')](function(_0x2c7ffb){_0x1b8ab2['rows']=_0x2c7ffb;return _0x1b8ab2;})[_0x6211('0x27')](respondWithFilteredResult(_0x253bb3,_0x396037))[_0x6211('0x48')](handleError(_0x253bb3,null));};exports[_0x6211('0x49')]=function(_0x341bbd,_0x1aac02){var _0x59f9b0={'raw':!![],'where':{'id':_0x341bbd['params']['id']}},_0x32cd07={};_0x32cd07[_0x6211('0x37')]=_['keys'](db[_0x6211('0x31')][_0x6211('0x32')]);_0x32cd07['query']=_[_0x6211('0x35')](_0x341bbd[_0x6211('0x34')]);_0x32cd07[_0x6211('0x36')]=_['intersection'](_0x32cd07[_0x6211('0x37')],_0x32cd07['query']);_0x59f9b0[_0x6211('0x38')]=_['intersection'](_0x32cd07[_0x6211('0x37')],qs['fields'](_0x341bbd[_0x6211('0x34')][_0x6211('0x39')]));_0x59f9b0[_0x6211('0x38')]=_0x59f9b0[_0x6211('0x38')][_0x6211('0x3a')]?_0x59f9b0[_0x6211('0x38')]:_0x32cd07[_0x6211('0x37')];if(_0x341bbd[_0x6211('0x34')][_0x6211('0x45')]){_0x59f9b0[_0x6211('0x46')]=[{'all':!![]}];}_0x59f9b0=_['merge']({},_0x59f9b0,_0x341bbd[_0x6211('0x44')]);return db[_0x6211('0x31')][_0x6211('0x4a')](_0x59f9b0)[_0x6211('0x27')](handleEntityNotFound(_0x1aac02,null))['then'](respondWithResult(_0x1aac02,null))[_0x6211('0x48')](handleError(_0x1aac02,null));};exports[_0x6211('0x4b')]=function(_0x53d2ee,_0x3537f2){return db['MailQueue']['create'](_0x53d2ee[_0x6211('0x4c')],{})[_0x6211('0x27')](function(_0x5aae45){var _0xa0485a=_0x53d2ee[_0x6211('0x4d')][_0x6211('0x28')]({'plain':!![]});if(!_0xa0485a)throw new Error(_0x6211('0x4e'));if(_0xa0485a[_0x6211('0x4f')]==='user'){var _0x92aa60=_0x5aae45[_0x6211('0x28')]({'plain':!![]});var _0x1901d7='MailQueues';return db[_0x6211('0x50')]['find']({'where':{'name':_0x1901d7,'userProfileId':_0xa0485a[_0x6211('0x51')]},'raw':!![]})[_0x6211('0x27')](function(_0x4b1d8e){if(_0x4b1d8e&&_0x4b1d8e[_0x6211('0x52')]===0x0){return db[_0x6211('0x2a')]['create']({'name':_0x92aa60[_0x6211('0x2e')],'resourceId':_0x92aa60['id'],'type':_0x4b1d8e[_0x6211('0x2e')],'sectionId':_0x4b1d8e['id']},{})[_0x6211('0x27')](function(){return _0x5aae45;});}else{return _0x5aae45;}})[_0x6211('0x48')](function(_0x4c59ad){logger[_0x6211('0x2c')](_0x6211('0x53'),_0x4c59ad);throw _0x4c59ad;});}return _0x5aae45;})[_0x6211('0x27')](respondWithResult(_0x3537f2,0xc9))[_0x6211('0x48')](handleError(_0x3537f2,null));};exports[_0x6211('0x26')]=function(_0x1694f5,_0x315098){if(_0x1694f5[_0x6211('0x4c')]['id']){delete _0x1694f5['body']['id'];}return db[_0x6211('0x31')][_0x6211('0x4a')]({'where':{'id':_0x1694f5['params']['id']}})['then'](handleEntityNotFound(_0x315098,null))[_0x6211('0x27')](saveUpdates(_0x1694f5[_0x6211('0x4c')],null))[_0x6211('0x27')](respondWithResult(_0x315098,null))['catch'](handleError(_0x315098,null));};exports[_0x6211('0x2b')]=function(_0x5a567e,_0x3c1bf1){return db[_0x6211('0x31')]['find']({'where':{'id':_0x5a567e['params']['id']}})[_0x6211('0x27')](handleEntityNotFound(_0x3c1bf1,null))[_0x6211('0x27')](removeEntity(_0x3c1bf1,null))[_0x6211('0x48')](handleError(_0x3c1bf1,null));};exports[_0x6211('0x54')]=function(_0x37b0da,_0x4d89e4){return db[_0x6211('0x31')][_0x6211('0x54')]()['then'](respondWithResult(_0x4d89e4,null))[_0x6211('0x48')](handleError(_0x4d89e4,null));};exports[_0x6211('0x55')]=function(_0x17f9ce,_0x3a09c2,_0x18f08a){var _0x509302={'raw':!![],'where':{}},_0x43c69f={},_0xbd3ae9;return db[_0x6211('0x31')][_0x6211('0x56')]({'where':{'id':_0x17f9ce['params']['id']}})[_0x6211('0x27')](handleEntityNotFound(_0x3a09c2,null))['then'](function(_0x1dc29e){if(_0x1dc29e){_0xbd3ae9=_0x1dc29e[_0x6211('0x28')]({'plain':!![]});_0x43c69f[_0x6211('0x37')]=_['keys'](db[_0x6211('0x57')]['rawAttributes']);_0x43c69f[_0x6211('0x34')]=_[_0x6211('0x35')](_0x17f9ce['query']);_0x43c69f[_0x6211('0x36')]=_['intersection'](_0x43c69f[_0x6211('0x37')],_0x43c69f[_0x6211('0x34')]);_0x509302[_0x6211('0x38')]=_[_0x6211('0x58')](_0x43c69f['model'],qs[_0x6211('0x39')](_0x17f9ce[_0x6211('0x34')][_0x6211('0x39')]));_0x509302[_0x6211('0x38')]=_0x509302['attributes'][_0x6211('0x3a')]?_0x509302[_0x6211('0x38')]:_0x43c69f['model'];if(!_0x17f9ce[_0x6211('0x34')][_0x6211('0x3b')](_0x6211('0x3c'))){_0x509302[_0x6211('0x3d')]=qs[_0x6211('0x3d')](_0x17f9ce[_0x6211('0x34')][_0x6211('0x3d')]);_0x509302[_0x6211('0x20')]=qs['offset'](_0x17f9ce[_0x6211('0x34')][_0x6211('0x20')]);}_0x509302[_0x6211('0x3e')]=qs[_0x6211('0x3f')](_0x17f9ce[_0x6211('0x34')][_0x6211('0x3f')]);_0x509302[_0x6211('0x40')]=qs[_0x6211('0x36')](_[_0x6211('0x41')](_0x17f9ce[_0x6211('0x34')],_0x43c69f['filters']));_0x509302['where']['MailQueueId']=_0x1dc29e['id'];if(_0x17f9ce[_0x6211('0x34')]['filter']){_0x509302[_0x6211('0x40')]=_['merge'](_0x509302[_0x6211('0x40')],{'$or':_[_0x6211('0x30')](_0x509302[_0x6211('0x38')],function(_0x5e15d4){var _0x102956={};_0x102956[_0x5e15d4]={'$like':'%'+_0x17f9ce[_0x6211('0x34')][_0x6211('0x42')]+'%'};return _0x102956;})});}_0x509302=_[_0x6211('0x43')]({},_0x509302,_0x17f9ce[_0x6211('0x44')]);return db[_0x6211('0x57')]['findAll'](_0x509302);}})[_0x6211('0x27')](function(_0x4f446e){if(_0x4f446e){return db[_0x6211('0x59')]['findAndCountAll']({'where':{'id':_[_0x6211('0x30')](_0x4f446e,_0x6211('0x5a')),'role':_0x6211('0x5b')},'attributes':['id',_0x6211('0x2e'),_0x6211('0x5c'),_0x6211('0x5d'),_0x6211('0x5e')]});}})[_0x6211('0x27')](function(_0x2604e5){if(_0x2604e5){return{'count':_0x2604e5[_0x6211('0x22')],'rows':_[_0x6211('0x30')](_0x2604e5[_0x6211('0x5f')],function(_0x4e2d77){return{'membername':_0x4e2d77[_0x6211('0x2e')],'UserId':_0x4e2d77['id'],'queue_name':_0xbd3ae9[_0x6211('0x2e')],'MailQueueId':_0xbd3ae9['id'],'interface':util['format'](_0x6211('0x60'),_0x6211('0x61'),_0x4e2d77[_0x6211('0x2e')]),'penalty':0x0,'paused':_0x4e2d77[_0x6211('0x5c')],'createdAt':_0x4e2d77[_0x6211('0x5e')],'updatedAt':_0x4e2d77[_0x6211('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6211('0x27')](respondWithFilteredResult(_0x3a09c2,_0x509302))[_0x6211('0x48')](handleError(_0x3a09c2,null));};exports['getTeams']=function(_0x15e8c9,_0x2faba9,_0x1e8695){var _0x489d30={};var _0x56b39f={};var _0x105d0b;var _0x43dba8;return db[_0x6211('0x31')]['findOne']({'where':{'id':_0x15e8c9[_0x6211('0x62')]['id']}})[_0x6211('0x27')](handleEntityNotFound(_0x2faba9,null))[_0x6211('0x27')](function(_0x29e0aa){if(_0x29e0aa){_0x105d0b=_0x29e0aa;_0x56b39f[_0x6211('0x37')]=_['keys'](db[_0x6211('0x63')][_0x6211('0x32')]);_0x56b39f['query']=_[_0x6211('0x35')](_0x15e8c9['query']);_0x56b39f[_0x6211('0x36')]=_['intersection'](_0x56b39f[_0x6211('0x37')],_0x56b39f[_0x6211('0x34')]);_0x489d30[_0x6211('0x38')]=_[_0x6211('0x58')](_0x56b39f[_0x6211('0x37')],qs['fields'](_0x15e8c9[_0x6211('0x34')][_0x6211('0x39')]));_0x489d30['attributes']=_0x489d30[_0x6211('0x38')][_0x6211('0x3a')]?_0x489d30[_0x6211('0x38')]:_0x56b39f[_0x6211('0x37')];_0x489d30[_0x6211('0x3e')]=qs[_0x6211('0x3f')](_0x15e8c9[_0x6211('0x34')]['sort']);_0x489d30[_0x6211('0x40')]=qs[_0x6211('0x36')](_[_0x6211('0x41')](_0x15e8c9[_0x6211('0x34')],_0x56b39f['filters']));if(_0x15e8c9[_0x6211('0x34')][_0x6211('0x42')]){_0x489d30['where']=_[_0x6211('0x43')](_0x489d30[_0x6211('0x40')],{'$or':_['map'](_0x489d30['attributes'],function(_0x2ce8d9){var _0x591681={};_0x591681[_0x2ce8d9]={'$like':'%'+_0x15e8c9[_0x6211('0x34')][_0x6211('0x42')]+'%'};return _0x591681;})});}_0x489d30=_[_0x6211('0x43')]({},_0x489d30,_0x15e8c9[_0x6211('0x44')]);return _0x105d0b['getTeams'](_0x489d30);}})[_0x6211('0x27')](function(_0x23f947){if(_0x23f947){_0x43dba8=_0x23f947['length'];if(!_0x15e8c9['query'][_0x6211('0x3b')](_0x6211('0x3c'))){_0x489d30[_0x6211('0x3d')]=qs['limit'](_0x15e8c9['query'][_0x6211('0x3d')]);_0x489d30['offset']=qs[_0x6211('0x20')](_0x15e8c9[_0x6211('0x34')][_0x6211('0x20')]);}return _0x105d0b[_0x6211('0x64')](_0x489d30);}})[_0x6211('0x27')](function(_0x3387dc){if(_0x3387dc){return _0x3387dc?{'count':_0x43dba8,'rows':_0x3387dc}:null;}})[_0x6211('0x27')](respondWithResult(_0x2faba9,null))['catch'](handleError(_0x2faba9,null));};exports[_0x6211('0x65')]=function(_0x55d32a,_0xf721a3,_0x296d46){var _0x935362=_0x55d32a[_0x6211('0x4c')][_0x6211('0x66')];return db[_0x6211('0x63')][_0x6211('0x47')]({'where':{'id':_0x935362},'attributes':['id'],'include':[{'model':db[_0x6211('0x59')],'as':_0x6211('0x67'),'attributes':['id','name',_0x6211('0x68'),_0x6211('0x69'),_0x6211('0x6a')],'raw':!![]}]})[_0x6211('0x27')](function(_0x21d6cc){if(_0x21d6cc){var _0x4c4694=_[_0x6211('0x6b')](_0x21d6cc,function(_0x1c816b){var _0x1d6436=_0x1c816b[_0x6211('0x28')]({'plain':!![]});return _0x1d6436[_0x6211('0x67')];});return db['MailQueue'][_0x6211('0x4a')]({'where':{'id':_0x55d32a[_0x6211('0x62')]['id']}})[_0x6211('0x27')](function(_0x12f8a6){return db[_0x6211('0x6c')][_0x6211('0x6d')](function(_0x532991){return _0x12f8a6['addTeams'](_0x935362,{'transaction':_0x532991})[_0x6211('0x27')](function(){return BPromise[_0x6211('0x6e')](_0x4c4694,function(_0xb6ad64){return db[_0x6211('0x57')][_0x6211('0x6f')]({'where':{'UserId':_0xb6ad64['id'],'MailQueueId':_0x55d32a[_0x6211('0x62')]['id']},'transaction':_0x532991});});})[_0x6211('0x27')](function(){_0x4c4694['forEach'](function(_0x4bcee8){socket[_0x6211('0x70')]('userMailQueue:save',{'UserId':_0x4bcee8['id'],'MailQueueId':_0x12f8a6['id']});});});});});}})[_0x6211('0x27')](respondWithStatusCode(_0xf721a3,null))[_0x6211('0x48')](handleError(_0xf721a3,null));};exports['removeTeams']=function(_0x4d874f,_0x53784e,_0x189967){return db['Team']['findAll']({'where':{'id':_0x4d874f[_0x6211('0x34')][_0x6211('0x66')]},'attributes':['id'],'include':[{'model':db[_0x6211('0x59')],'as':_0x6211('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x53784e,null))[_0x6211('0x27')](function(_0x3b3665){var _0x387a74=_[_0x6211('0x30')](_0x3b3665,'id');var _0x117ce9=[];var _0x443358=[];var _0x10b7dc=squel[_0x6211('0x71')]();_0x10b7dc[_0x6211('0x72')]('tq.TeamId')[_0x6211('0x73')](_0x6211('0x74'),'tq')[_0x6211('0x75')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6211('0x40')](_0x6211('0x76'),_0x4d874f[_0x6211('0x62')]['id']);for(var _0x29a812=0x0;_0x29a812<_0x3b3665[_0x6211('0x3a')];_0x29a812+=0x1){let _0x498a22=_0x3b3665[_0x29a812];for(var _0x60e745=0x0;_0x60e745<_0x498a22['Agents'][_0x6211('0x3a')];_0x60e745+=0x1){let _0x48922e=_0x498a22[_0x6211('0x67')][_0x60e745];var _0x274266=_0x10b7dc[_0x6211('0x77')]();_0x274266[_0x6211('0x40')](_0x6211('0x78'),_0x48922e['id']);_0x443358[_0x6211('0x79')](db[_0x6211('0x6c')]['query'](_0x274266['toString'](),{'type':db['sequelize'][_0x6211('0x7a')][_0x6211('0x7b')]})[_0x6211('0x27')](function(_0x570a16){if(_0x570a16['length']===0x1){return _0x48922e['id'];}else{var _0x27a80e=_[_0x6211('0x7c')](_[_0x6211('0x30')](_0x570a16,_0x6211('0x7d')),function(_0x2fcc22){return _['includes'](_0x387a74,_0x2fcc22);});if(_0x27a80e){return _0x48922e['id'];}}}));}}return BPromise['all'](_0x443358)[_0x6211('0x27')](function(_0x4e8f70){_0x117ce9=_(_0x117ce9)[_0x6211('0x7e')](_0x4e8f70)['compact']()['value']();return db[_0x6211('0x31')]['find']({'where':{'id':_0x4d874f[_0x6211('0x62')]['id']}})[_0x6211('0x27')](function(_0x230768){return db[_0x6211('0x6c')]['transaction'](function(_0x5934b5){return _0x230768[_0x6211('0x7f')](_0x4d874f[_0x6211('0x34')][_0x6211('0x66')],{'transaction':_0x5934b5})[_0x6211('0x27')](function(){if(!_[_0x6211('0x80')](_0x117ce9)){return _0x230768[_0x6211('0x81')](_0x117ce9,{'transaction':_0x5934b5});}})[_0x6211('0x27')](function(){_0x117ce9[_0x6211('0x82')](function(_0x545489){socket[_0x6211('0x70')](_0x6211('0x83'),{'UserId':_0x545489,'MailQueueId':_0x230768['id']});});});});});});})['then'](respondWithStatusCode(_0x53784e,null))[_0x6211('0x48')](handleError(_0x53784e,null));};exports[_0x6211('0x84')]=function(_0x13cea7,_0x172ff4,_0x1d5dbb){return db[_0x6211('0x31')][_0x6211('0x4a')]({'where':{'id':_0x13cea7['params']['id']}})[_0x6211('0x27')](handleEntityNotFound(_0x172ff4,null))[_0x6211('0x27')](function(_0x3a9d3e){if(_0x3a9d3e){return _0x3a9d3e[_0x6211('0x84')](_0x13cea7['body']['ids'],_[_0x6211('0x85')](_0x13cea7[_0x6211('0x4c')],[_0x6211('0x66'),'id'])||{})[_0x6211('0x86')](function(_0x4c4c70){for(var _0x48313c=0x0;_0x48313c<_0x13cea7['body'][_0x6211('0x66')][_0x6211('0x3a')];_0x48313c+=0x1){socket[_0x6211('0x70')]('userMailQueue:save',{'UserId':Number(_0x13cea7[_0x6211('0x4c')][_0x6211('0x66')][_0x48313c]),'MailQueueId':Number(_0x13cea7['params']['id'])});}return _0x4c4c70;});}})[_0x6211('0x27')](respondWithResult(_0x172ff4,null))[_0x6211('0x48')](handleError(_0x172ff4,null));};exports[_0x6211('0x81')]=function(_0x392b19,_0x58499b,_0x3dabca){return db['MailQueue'][_0x6211('0x4a')]({'where':{'id':_0x392b19[_0x6211('0x62')]['id']}})[_0x6211('0x27')](handleEntityNotFound(_0x58499b,null))[_0x6211('0x27')](function(_0x1ff49c){if(_0x1ff49c){return _0x1ff49c[_0x6211('0x81')](_0x392b19['query'][_0x6211('0x66')])[_0x6211('0x27')](function(){if(_[_0x6211('0x87')](_0x392b19['query'][_0x6211('0x66')])){for(var _0x43d8b2=0x0;_0x43d8b2<_0x392b19[_0x6211('0x34')][_0x6211('0x66')][_0x6211('0x3a')];_0x43d8b2+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x392b19[_0x6211('0x34')][_0x6211('0x66')][_0x43d8b2]),'MailQueueId':Number(_0x392b19[_0x6211('0x62')]['id'])});}}else{socket[_0x6211('0x70')](_0x6211('0x83'),{'UserId':Number(_0x392b19['query']['ids']),'MailQueueId':Number(_0x392b19[_0x6211('0x62')]['id'])});}});}})[_0x6211('0x27')](respondWithStatusCode(_0x58499b,null))[_0x6211('0x48')](handleError(_0x58499b,null));};exports[_0x6211('0x88')]=function(_0x4f97d6,_0x320517,_0x519d8b){var _0x2539de={};var _0x50808a={};var _0xa4c03e;var _0x23191c;return db[_0x6211('0x31')][_0x6211('0x56')]({'where':{'id':_0x4f97d6['params']['id']}})[_0x6211('0x27')](handleEntityNotFound(_0x320517,null))[_0x6211('0x27')](function(_0x33120c){if(_0x33120c){_0xa4c03e=_0x33120c;_0x50808a[_0x6211('0x37')]=_['keys'](db[_0x6211('0x59')][_0x6211('0x32')]);_0x50808a['query']=_[_0x6211('0x35')](_0x4f97d6[_0x6211('0x34')]);_0x50808a[_0x6211('0x36')]=_[_0x6211('0x58')](_0x50808a[_0x6211('0x37')],_0x50808a[_0x6211('0x34')]);_0x2539de[_0x6211('0x38')]=_[_0x6211('0x58')](_0x50808a[_0x6211('0x37')],qs[_0x6211('0x39')](_0x4f97d6[_0x6211('0x34')][_0x6211('0x39')]));_0x2539de[_0x6211('0x38')]=_0x2539de[_0x6211('0x38')][_0x6211('0x3a')]?_0x2539de['attributes']:_0x50808a[_0x6211('0x37')];_0x2539de[_0x6211('0x3e')]=qs[_0x6211('0x3f')](_0x4f97d6['query'][_0x6211('0x3f')]);_0x2539de['where']=qs[_0x6211('0x36')](_['pick'](_0x4f97d6[_0x6211('0x34')],_0x50808a[_0x6211('0x36')]));if(_0x4f97d6['query'][_0x6211('0x42')]){_0x2539de['where']=_[_0x6211('0x43')](_0x2539de[_0x6211('0x40')],{'$or':_['map'](_0x2539de[_0x6211('0x38')],function(_0x189a7a){var _0x2b944b={};_0x2b944b[_0x189a7a]={'$like':'%'+_0x4f97d6['query'][_0x6211('0x42')]+'%'};return _0x2b944b;})});}_0x2539de=_[_0x6211('0x43')]({},_0x2539de,_0x4f97d6[_0x6211('0x44')]);return _0xa4c03e[_0x6211('0x88')](_0x2539de);}})[_0x6211('0x27')](function(_0x37c4c0){if(_0x37c4c0){_0x23191c=_0x37c4c0[_0x6211('0x3a')];if(!_0x4f97d6['query'][_0x6211('0x3b')](_0x6211('0x3c'))){_0x2539de[_0x6211('0x3d')]=qs[_0x6211('0x3d')](_0x4f97d6['query']['limit']);_0x2539de[_0x6211('0x20')]=qs[_0x6211('0x20')](_0x4f97d6['query'][_0x6211('0x20')]);}return _0xa4c03e['getAgents'](_0x2539de);}})['then'](function(_0x297996){if(_0x297996){return _0x297996?{'count':_0x23191c,'rows':_0x297996}:null;}})[_0x6211('0x27')](respondWithResult(_0x320517,null))['catch'](handleError(_0x320517,null));};
\ No newline at end of file
index 0ce37e3..3ce5e3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x608f=['exports','events','../../mysqldb','MailQueue','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x29057b,_0x4a0ab3){var _0x3ada3f=function(_0x3ffd9e){while(--_0x3ffd9e){_0x29057b['push'](_0x29057b['shift']());}};_0x3ada3f(++_0x4a0ab3);}(_0x608f,0x91));var _0xf608=function(_0x3a290a,_0xd9dac5){_0x3a290a=_0x3a290a-0x0;var _0x12448f=_0x608f[_0x3a290a];return _0x12448f;};'use strict';var EventEmitter=require(_0xf608('0x0'));var MailQueue=require(_0xf608('0x1'))['db'][_0xf608('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf608('0x3')](0x0);var events={'afterCreate':_0xf608('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x52df8b){return function(_0x371d1a,_0x34412b,_0x3cf1b7){MailQueueEvents[_0xf608('0x5')](_0x52df8b+':'+_0x371d1a['id'],_0x371d1a);MailQueueEvents['emit'](_0x52df8b,_0x371d1a);_0x3cf1b7(null);};}for(var e in events){if(events[_0xf608('0x6')](e)){var event=events[e];MailQueue[_0xf608('0x7')](e,emitEvent(event));}}module[_0xf608('0x8')]=MailQueueEvents;
\ No newline at end of file
+var _0x1b9e=['hasOwnProperty','hook','events','MailQueue','save','update','remove','emit'];(function(_0x281cf2,_0x2627a4){var _0x5284ec=function(_0x239c36){while(--_0x239c36){_0x281cf2['push'](_0x281cf2['shift']());}};_0x5284ec(++_0x2627a4);}(_0x1b9e,0x1c2));var _0xe1b9=function(_0x1b8ff2,_0x38d817){_0x1b8ff2=_0x1b8ff2-0x0;var _0x663d1e=_0x1b9e[_0x1b8ff2];return _0x663d1e;};'use strict';var EventEmitter=require(_0xe1b9('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xe1b9('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe1b9('0x2'),'afterUpdate':_0xe1b9('0x3'),'afterDestroy':_0xe1b9('0x4')};function emitEvent(_0x205875){return function(_0x2afae1,_0x36cd82,_0x5a1676){MailQueueEvents[_0xe1b9('0x5')](_0x205875+':'+_0x2afae1['id'],_0x2afae1);MailQueueEvents[_0xe1b9('0x5')](_0x205875,_0x2afae1);_0x5a1676(null);};}for(var e in events){if(events[_0xe1b9('0x6')](e)){var event=events[e];MailQueue[_0xe1b9('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
index 0700d41..a48dfcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e6f=['path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','lodash','util','../../config/logger','moment','bluebird'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0x8e6f,0x124));var _0xf8e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf8e6('0x0'));var util=require(_0xf8e6('0x1'));var logger=require(_0xf8e6('0x2'))('api');var moment=require(_0xf8e6('0x3'));var BPromise=require(_0xf8e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8e6('0x5'));var rimraf=require(_0xf8e6('0x6'));var config=require(_0xf8e6('0x7'));var attributes=require(_0xf8e6('0x8'));module['exports']=function(_0x23c04d,_0x2d2d44){return _0x23c04d[_0xf8e6('0x9')](_0xf8e6('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec71=['path','rimraf','./mailQueue.attributes','exports','mail_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xec71,0xeb));var _0x1ec7=function(_0x48b66e,_0x461edb){_0x48b66e=_0x48b66e-0x0;var _0x151723=_0xec71[_0x48b66e];return _0x151723;};'use strict';var _=require(_0x1ec7('0x0'));var util=require(_0x1ec7('0x1'));var logger=require(_0x1ec7('0x2'))('api');var moment=require(_0x1ec7('0x3'));var BPromise=require(_0x1ec7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ec7('0x5'));var rimraf=require(_0x1ec7('0x6'));var config=require('../../config/environment');var attributes=require(_0x1ec7('0x7'));module[_0x1ec7('0x8')]=function(_0x341d77,_0x5b3255){return _0x341d77['define']('MailQueue',attributes,{'tableName':_0x1ec7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6100885..5bbf44c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3306=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','GetMailQueue','MailQueue','findAll','options','where','limit','include','model','map','attributes','catch','ShowMailQueue','find','lodash','bluebird'];(function(_0x5206cf,_0x4cb9a4){var _0x3f1028=function(_0x30bf61){while(--_0x30bf61){_0x5206cf['push'](_0x5206cf['shift']());}};_0x3f1028(++_0x4cb9a4);}(_0x3306,0x1ec));var _0x6330=function(_0x25bb2a,_0x180787){_0x25bb2a=_0x25bb2a-0x0;var _0x405561=_0x3306[_0x25bb2a];return _0x405561;};'use strict';var _=require(_0x6330('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6330('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6330('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6330('0x3'));var logger=require(_0x6330('0x4'))('rpc');var config=require(_0x6330('0x5'));var jayson=require(_0x6330('0x6'));var client=jayson[_0x6330('0x7')][_0x6330('0x8')]({'port':0x232a});config[_0x6330('0x9')]=_[_0x6330('0xa')](config[_0x6330('0x9')],{'host':_0x6330('0xb'),'port':0x18eb});var socket=require(_0x6330('0xc'))(new Redis(config['redis']));require(_0x6330('0xd'))['register'](socket);function respondWithRpcPromise(_0x25e825,_0xf8d2c7,_0x53011b){return new BPromise(function(_0x46d5e2,_0x4446e2){return client[_0x6330('0xe')](_0x25e825,_0x53011b)[_0x6330('0xf')](function(_0x34f899){logger[_0x6330('0x10')](_0x6330('0x11'),_0xf8d2c7,'request\x20sent');logger[_0x6330('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0xf8d2c7,'request\x20sent',JSON[_0x6330('0x13')](_0x34f899));if(_0x34f899[_0x6330('0x14')]){if(_0x34f899['error'][_0x6330('0x15')]===0x1f4){logger[_0x6330('0x14')]('MailQueue,\x20%s,\x20%s',_0xf8d2c7,_0x34f899[_0x6330('0x14')][_0x6330('0x16')]);return _0x4446e2(_0x34f899[_0x6330('0x14')][_0x6330('0x16')]);}logger[_0x6330('0x14')](_0x6330('0x11'),_0xf8d2c7,_0x34f899[_0x6330('0x14')][_0x6330('0x16')]);return _0x46d5e2(_0x34f899[_0x6330('0x14')][_0x6330('0x16')]);}else{logger[_0x6330('0x10')](_0x6330('0x11'),_0xf8d2c7,_0x6330('0x17'));_0x46d5e2(_0x34f899[_0x6330('0x18')][_0x6330('0x16')]);}})['catch'](function(_0x43a354){logger[_0x6330('0x14')]('MailQueue,\x20%s,\x20%s',_0xf8d2c7,_0x43a354);_0x4446e2(_0x43a354);});});}exports[_0x6330('0x19')]=function(_0x1172d0){var _0x3d9bfb=this;return new Promise(function(_0x4e9949,_0x1bf579){return db[_0x6330('0x1a')][_0x6330('0x1b')]({'raw':_0x1172d0[_0x6330('0x1c')]?_0x1172d0['options']['raw']===undefined?!![]:![]:!![],'where':_0x1172d0['options']?_0x1172d0[_0x6330('0x1c')][_0x6330('0x1d')]||null:null,'attributes':_0x1172d0['options']?_0x1172d0[_0x6330('0x1c')]['attributes']||null:null,'limit':_0x1172d0[_0x6330('0x1c')]?_0x1172d0['options'][_0x6330('0x1e')]||null:null,'include':_0x1172d0[_0x6330('0x1c')]?_0x1172d0[_0x6330('0x1c')]['include']?_['map'](_0x1172d0[_0x6330('0x1c')][_0x6330('0x1f')],function(_0x5bcd2c){return{'model':db[_0x5bcd2c[_0x6330('0x20')]],'as':_0x5bcd2c['as'],'attributes':_0x5bcd2c['attributes'],'include':_0x5bcd2c[_0x6330('0x1f')]?_[_0x6330('0x21')](_0x5bcd2c[_0x6330('0x1f')],function(_0x276e29){return{'model':db[_0x276e29[_0x6330('0x20')]],'as':_0x276e29['as'],'attributes':_0x276e29['attributes'],'include':_0x276e29[_0x6330('0x1f')]?_[_0x6330('0x21')](_0x276e29[_0x6330('0x1f')],function(_0x207bf5){return{'model':db[_0x207bf5[_0x6330('0x20')]],'as':_0x207bf5['as'],'attributes':_0x207bf5[_0x6330('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6330('0xf')](function(_0x39c205){logger['info'](_0x6330('0x19'),_0x1172d0);logger[_0x6330('0x12')](_0x6330('0x19'),_0x1172d0,JSON[_0x6330('0x13')](_0x39c205));_0x4e9949(_0x39c205);})[_0x6330('0x23')](function(_0x55360f){logger[_0x6330('0x14')]('GetMailQueue',_0x55360f['message'],_0x1172d0);_0x1bf579(_0x3d9bfb[_0x6330('0x14')](0x1f4,_0x55360f[_0x6330('0x16')]));});});};exports[_0x6330('0x24')]=function(_0x3517a5){var _0x3c5af8=this;return new Promise(function(_0x284062,_0x37d62c){return db['MailQueue'][_0x6330('0x25')]({'raw':_0x3517a5[_0x6330('0x1c')]?_0x3517a5[_0x6330('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3517a5[_0x6330('0x1c')]?_0x3517a5[_0x6330('0x1c')][_0x6330('0x1d')]||null:null,'attributes':_0x3517a5[_0x6330('0x1c')]?_0x3517a5['options'][_0x6330('0x22')]||null:null,'include':_0x3517a5[_0x6330('0x1c')]?_0x3517a5[_0x6330('0x1c')][_0x6330('0x1f')]?_[_0x6330('0x21')](_0x3517a5[_0x6330('0x1c')][_0x6330('0x1f')],function(_0x2f7072){return{'model':db[_0x2f7072[_0x6330('0x20')]],'as':_0x2f7072['as'],'attributes':_0x2f7072[_0x6330('0x22')],'include':_0x2f7072['include']?_[_0x6330('0x21')](_0x2f7072[_0x6330('0x1f')],function(_0x464f5b){return{'model':db[_0x464f5b[_0x6330('0x20')]],'as':_0x464f5b['as'],'attributes':_0x464f5b['attributes'],'include':_0x464f5b[_0x6330('0x1f')]?_[_0x6330('0x21')](_0x464f5b['include'],function(_0x4ccd84){return{'model':db[_0x4ccd84[_0x6330('0x20')]],'as':_0x4ccd84['as'],'attributes':_0x4ccd84[_0x6330('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6330('0xf')](function(_0x2f6ec4){logger[_0x6330('0x10')]('ShowMailQueue',_0x3517a5);logger[_0x6330('0x12')]('ShowMailQueue',_0x3517a5,JSON[_0x6330('0x13')](_0x2f6ec4));_0x284062(_0x2f6ec4);})[_0x6330('0x23')](function(_0x49ff34){logger[_0x6330('0x14')](_0x6330('0x24'),_0x49ff34['message'],_0x3517a5);_0x37d62c(_0x3c5af8['error'](0x1f4,_0x49ff34[_0x6330('0x16')]));});});};
\ No newline at end of file
+var _0x4c6b=['options','raw','where','limit','include','map','attributes','model','GetMailQueue','debug','ShowMailQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MailQueue'];(function(_0x5edac2,_0x351579){var _0x24c07a=function(_0x47488c){while(--_0x47488c){_0x5edac2['push'](_0x5edac2['shift']());}};_0x24c07a(++_0x351579);}(_0x4c6b,0x87));var _0xb4c6=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x4c6b[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xb4c6('0x0'));var util=require('util');var moment=require(_0xb4c6('0x1'));var BPromise=require(_0xb4c6('0x2'));var rs=require(_0xb4c6('0x3'));var fs=require('fs');var Redis=require(_0xb4c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4c6('0x5'));var logger=require(_0xb4c6('0x6'))(_0xb4c6('0x7'));var config=require(_0xb4c6('0x8'));var jayson=require(_0xb4c6('0x9'));var client=jayson['client'][_0xb4c6('0xa')]({'port':0x232a});config[_0xb4c6('0xb')]=_[_0xb4c6('0xc')](config[_0xb4c6('0xb')],{'host':_0xb4c6('0xd'),'port':0x18eb});var socket=require(_0xb4c6('0xe'))(new Redis(config[_0xb4c6('0xb')]));require(_0xb4c6('0xf'))['register'](socket);function respondWithRpcPromise(_0x4574d5,_0x370a24,_0xb91ca9){return new BPromise(function(_0x5dafab,_0x22d46f){return client[_0xb4c6('0x10')](_0x4574d5,_0xb91ca9)[_0xb4c6('0x11')](function(_0x3611bb){logger['info'](_0xb4c6('0x12'),_0x370a24,_0xb4c6('0x13'));logger['debug'](_0xb4c6('0x14'),_0x370a24,'request\x20sent',JSON[_0xb4c6('0x15')](_0x3611bb));if(_0x3611bb['error']){if(_0x3611bb[_0xb4c6('0x16')][_0xb4c6('0x17')]===0x1f4){logger[_0xb4c6('0x16')](_0xb4c6('0x12'),_0x370a24,_0x3611bb[_0xb4c6('0x16')]['message']);return _0x22d46f(_0x3611bb[_0xb4c6('0x16')][_0xb4c6('0x18')]);}logger[_0xb4c6('0x16')](_0xb4c6('0x12'),_0x370a24,_0x3611bb[_0xb4c6('0x16')][_0xb4c6('0x18')]);return _0x5dafab(_0x3611bb[_0xb4c6('0x16')][_0xb4c6('0x18')]);}else{logger[_0xb4c6('0x19')](_0xb4c6('0x12'),_0x370a24,_0xb4c6('0x13'));_0x5dafab(_0x3611bb[_0xb4c6('0x1a')][_0xb4c6('0x18')]);}})[_0xb4c6('0x1b')](function(_0x4b8914){logger[_0xb4c6('0x16')]('MailQueue,\x20%s,\x20%s',_0x370a24,_0x4b8914);_0x22d46f(_0x4b8914);});});}exports['GetMailQueue']=function(_0x1e7738){var _0xf4c7e3=this;return new Promise(function(_0x49526a,_0x2fcd93){return db[_0xb4c6('0x1c')]['findAll']({'raw':_0x1e7738[_0xb4c6('0x1d')]?_0x1e7738[_0xb4c6('0x1d')][_0xb4c6('0x1e')]===undefined?!![]:![]:!![],'where':_0x1e7738[_0xb4c6('0x1d')]?_0x1e7738[_0xb4c6('0x1d')][_0xb4c6('0x1f')]||null:null,'attributes':_0x1e7738[_0xb4c6('0x1d')]?_0x1e7738['options']['attributes']||null:null,'limit':_0x1e7738[_0xb4c6('0x1d')]?_0x1e7738['options'][_0xb4c6('0x20')]||null:null,'include':_0x1e7738[_0xb4c6('0x1d')]?_0x1e7738[_0xb4c6('0x1d')][_0xb4c6('0x21')]?_[_0xb4c6('0x22')](_0x1e7738[_0xb4c6('0x1d')][_0xb4c6('0x21')],function(_0x8cfeeb){return{'model':db[_0x8cfeeb['model']],'as':_0x8cfeeb['as'],'attributes':_0x8cfeeb[_0xb4c6('0x23')],'include':_0x8cfeeb['include']?_[_0xb4c6('0x22')](_0x8cfeeb['include'],function(_0x2a9524){return{'model':db[_0x2a9524['model']],'as':_0x2a9524['as'],'attributes':_0x2a9524[_0xb4c6('0x23')],'include':_0x2a9524[_0xb4c6('0x21')]?_['map'](_0x2a9524['include'],function(_0xf3d794){return{'model':db[_0xf3d794[_0xb4c6('0x24')]],'as':_0xf3d794['as'],'attributes':_0xf3d794[_0xb4c6('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9abc11){logger[_0xb4c6('0x19')](_0xb4c6('0x25'),_0x1e7738);logger[_0xb4c6('0x26')](_0xb4c6('0x25'),_0x1e7738,JSON[_0xb4c6('0x15')](_0x9abc11));_0x49526a(_0x9abc11);})[_0xb4c6('0x1b')](function(_0x3a398e){logger[_0xb4c6('0x16')](_0xb4c6('0x25'),_0x3a398e['message'],_0x1e7738);_0x2fcd93(_0xf4c7e3['error'](0x1f4,_0x3a398e[_0xb4c6('0x18')]));});});};exports[_0xb4c6('0x27')]=function(_0x342952){var _0x2500b9=this;return new Promise(function(_0x53a0db,_0x161549){return db[_0xb4c6('0x1c')][_0xb4c6('0x28')]({'raw':_0x342952['options']?_0x342952[_0xb4c6('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x342952['options']?_0x342952[_0xb4c6('0x1d')][_0xb4c6('0x1f')]||null:null,'attributes':_0x342952[_0xb4c6('0x1d')]?_0x342952[_0xb4c6('0x1d')][_0xb4c6('0x23')]||null:null,'include':_0x342952[_0xb4c6('0x1d')]?_0x342952[_0xb4c6('0x1d')]['include']?_[_0xb4c6('0x22')](_0x342952['options'][_0xb4c6('0x21')],function(_0x212971){return{'model':db[_0x212971[_0xb4c6('0x24')]],'as':_0x212971['as'],'attributes':_0x212971[_0xb4c6('0x23')],'include':_0x212971[_0xb4c6('0x21')]?_[_0xb4c6('0x22')](_0x212971['include'],function(_0x5cda35){return{'model':db[_0x5cda35[_0xb4c6('0x24')]],'as':_0x5cda35['as'],'attributes':_0x5cda35['attributes'],'include':_0x5cda35[_0xb4c6('0x21')]?_[_0xb4c6('0x22')](_0x5cda35[_0xb4c6('0x21')],function(_0x52a64e){return{'model':db[_0x52a64e[_0xb4c6('0x24')]],'as':_0x52a64e['as'],'attributes':_0x52a64e['attributes']};}):[]};}):[]};}):[]:[]})[_0xb4c6('0x11')](function(_0x54cd63){logger[_0xb4c6('0x19')](_0xb4c6('0x27'),_0x342952);logger['debug']('ShowMailQueue',_0x342952,JSON['stringify'](_0x54cd63));_0x53a0db(_0x54cd63);})['catch'](function(_0xb2df61){logger[_0xb4c6('0x16')]('ShowMailQueue',_0xb2df61[_0xb4c6('0x18')],_0x342952);_0x161549(_0x2500b9[_0xb4c6('0x16')](0x1f4,_0xb2df61[_0xb4c6('0x18')]));});});};
\ No newline at end of file
index 4b02849..a6b878c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd37=['remove','update','emit','register','save'];(function(_0x32fa23,_0x5558e1){var _0x1e4058=function(_0x2488e2){while(--_0x2488e2){_0x32fa23['push'](_0x32fa23['shift']());}};_0x1e4058(++_0x5558e1);}(_0xbd37,0x13a));var _0x7bd3=function(_0x5b4e71,_0x342268){_0x5b4e71=_0x5b4e71-0x0;var _0x1693ee=_0xbd37[_0x5b4e71];return _0x1693ee;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x7bd3('0x0'),_0x7bd3('0x1'),_0x7bd3('0x2')];function createListener(_0x19d627,_0x44e5a1){return function(_0x182175){_0x44e5a1[_0x7bd3('0x3')](_0x19d627,_0x182175);};}function removeListener(_0x52f67f,_0x2e843c){return function(){MailQueueEvents['removeListener'](_0x52f67f,_0x2e843c);};}exports[_0x7bd3('0x4')]=function(_0x4e86fa){for(var _0xa8ee64=0x0,_0x10193a=events['length'];_0xa8ee64<_0x10193a;_0xa8ee64++){var _0xc3112b=events[_0xa8ee64];var _0x46060f=createListener('mailQueue:'+_0xc3112b,_0x4e86fa);MailQueueEvents['on'](_0xc3112b,_0x46060f);}};
\ No newline at end of file
+var _0x12a7=['length','mailQueue:','./mailQueue.events','save','update','emit','removeListener'];(function(_0x5309ed,_0x3fb9ba){var _0x590497=function(_0x1dc540){while(--_0x1dc540){_0x5309ed['push'](_0x5309ed['shift']());}};_0x590497(++_0x3fb9ba);}(_0x12a7,0x198));var _0x712a=function(_0x26d73a,_0x165268){_0x26d73a=_0x26d73a-0x0;var _0x1a5131=_0x12a7[_0x26d73a];return _0x1a5131;};'use strict';var MailQueueEvents=require(_0x712a('0x0'));var events=[_0x712a('0x1'),'remove',_0x712a('0x2')];function createListener(_0xaaf6a0,_0xee6b87){return function(_0x5d6faa){_0xee6b87[_0x712a('0x3')](_0xaaf6a0,_0x5d6faa);};}function removeListener(_0x124b5f,_0x2dabb5){return function(){MailQueueEvents[_0x712a('0x4')](_0x124b5f,_0x2dabb5);};}exports['register']=function(_0x3c5cd1){for(var _0x305dba=0x0,_0x2f7bb8=events[_0x712a('0x5')];_0x305dba<_0x2f7bb8;_0x305dba++){var _0x29021e=events[_0x305dba];var _0x27b816=createListener(_0x712a('0x6')+_0x29021e,_0x3c5cd1);MailQueueEvents['on'](_0x29021e,_0x27b816);}};
\ No newline at end of file
index ac9db7d..11d2d38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaee6=['isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index'];(function(_0xebcfcb,_0xea44c1){var _0xa027ac=function(_0xa6cf29){while(--_0xa6cf29){_0xebcfcb['push'](_0xebcfcb['shift']());}};_0xa027ac(++_0xea44c1);}(_0xaee6,0x119));var _0x6aee=function(_0x4666ad,_0x3f427e){_0x4666ad=_0x4666ad-0x0;var _0x48182e=_0xaee6[_0x4666ad];return _0x48182e;};'use strict';var multer=require(_0x6aee('0x0'));var util=require(_0x6aee('0x1'));var path=require(_0x6aee('0x2'));var timeout=require(_0x6aee('0x3'));var express=require(_0x6aee('0x4'));var router=express[_0x6aee('0x5')]();var fs_extra=require(_0x6aee('0x6'));var auth=require(_0x6aee('0x7'));var interaction=require(_0x6aee('0x8'));var config=require(_0x6aee('0x9'));var controller=require(_0x6aee('0xa'));router[_0x6aee('0xb')]('/',auth['isAuthenticated'](),controller[_0x6aee('0xc')]);router[_0x6aee('0xb')]('/describe',auth[_0x6aee('0xd')](),controller['describe']);router['get']('/:id',auth[_0x6aee('0xd')](),controller['show']);router[_0x6aee('0xe')]('/',auth[_0x6aee('0xd')](),controller[_0x6aee('0xf')]);router[_0x6aee('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6aee('0x11')]);router[_0x6aee('0x12')]('/:id',auth[_0x6aee('0xd')](),controller[_0x6aee('0x13')]);module[_0x6aee('0x14')]=router;
\ No newline at end of file
+var _0xbe16=['../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','/describe','describe','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xbe16,0x173));var _0x6be1=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xbe16[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require(_0x6be1('0x0'));var util=require('util');var path=require(_0x6be1('0x1'));var timeout=require(_0x6be1('0x2'));var express=require(_0x6be1('0x3'));var router=express[_0x6be1('0x4')]();var fs_extra=require(_0x6be1('0x5'));var auth=require(_0x6be1('0x6'));var interaction=require(_0x6be1('0x7'));var config=require(_0x6be1('0x8'));var controller=require(_0x6be1('0x9'));router[_0x6be1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6be1('0xa')](_0x6be1('0xb'),auth['isAuthenticated'](),controller[_0x6be1('0xc')]);router[_0x6be1('0xa')](_0x6be1('0xd'),auth[_0x6be1('0xe')](),controller[_0x6be1('0xf')]);router['post']('/',auth[_0x6be1('0xe')](),controller[_0x6be1('0x10')]);router[_0x6be1('0x11')](_0x6be1('0xd'),auth['isAuthenticated'](),controller[_0x6be1('0x12')]);router[_0x6be1('0x13')](_0x6be1('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x6be1('0x14')]=router;
\ No newline at end of file
index 81b4939..0dc8a79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2cd=['moment','sequelize','exports','STRING','DATE'];(function(_0x50dacb,_0x370eb0){var _0x4ffbc9=function(_0x543fc5){while(--_0x543fc5){_0x50dacb['push'](_0x50dacb['shift']());}};_0x4ffbc9(++_0x370eb0);}(_0xe2cd,0x64));var _0xde2c=function(_0x16cc28,_0x2e82a9){_0x16cc28=_0x16cc28-0x0;var _0x4b0a7e=_0xe2cd[_0x16cc28];return _0x4b0a7e;};'use strict';var moment=require(_0xde2c('0x0'));var Sequelize=require(_0xde2c('0x1'));module[_0xde2c('0x2')]={'uniqueid':{'type':Sequelize[_0xde2c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xde2c('0x3')]},'joinAt':{'type':Sequelize[_0xde2c('0x4')]},'leaveAt':{'type':Sequelize[_0xde2c('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xde2c('0x4')]},'reason':{'type':Sequelize[_0xde2c('0x3')]}};
\ No newline at end of file
+var _0xdbbe=['STRING','DATE','moment','sequelize','exports'];(function(_0x5001a9,_0x3091c1){var _0x1dfa17=function(_0x3beeb5){while(--_0x3beeb5){_0x5001a9['push'](_0x5001a9['shift']());}};_0x1dfa17(++_0x3091c1);}(_0xdbbe,0x1f1));var _0xedbb=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0xdbbe[_0x2d8d69];return _0x39ae22;};'use strict';var moment=require(_0xedbb('0x0'));var Sequelize=require(_0xedbb('0x1'));module[_0xedbb('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xedbb('0x3')]},'joinAt':{'type':Sequelize[_0xedbb('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xedbb('0x4')]},'exitAt':{'type':Sequelize[_0xedbb('0x4')]},'reason':{'type':Sequelize[_0xedbb('0x3')]}};
\ No newline at end of file
index 7272df1..fe7c22a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7708=['map','MailQueueReport','rawAttributes','key','model','keys','intersection','query','attributes','fields','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','apply','save','update','then','destroy','error','stack','name','send','index'];(function(_0x5e28e4,_0x4f03e5){var _0x5986c5=function(_0x11684f){while(--_0x11684f){_0x5e28e4['push'](_0x5e28e4['shift']());}};_0x5986c5(++_0x4f03e5);}(_0x7708,0x188));var _0x8770=function(_0x152136,_0x4f14f1){_0x152136=_0x152136-0x0;var _0x20df44=_0x7708[_0x152136];return _0x20df44;};'use strict';var emlformat=require(_0x8770('0x0'));var rimraf=require(_0x8770('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8770('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8770('0x3'));var path=require(_0x8770('0x4'));var sox=require('sox');var csv=require(_0x8770('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8770('0x6'));var _=require(_0x8770('0x7'));var squel=require(_0x8770('0x8'));var crypto=require(_0x8770('0x9'));var jsforce=require(_0x8770('0xa'));var deskjs=require(_0x8770('0xb'));var toCsv=require(_0x8770('0x5'));var querystring=require('querystring');var Papa=require(_0x8770('0xc'));var Redis=require(_0x8770('0xd'));var authService=require(_0x8770('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8770('0xf'));var hardwareService=require(_0x8770('0x10'));var logger=require(_0x8770('0x11'))(_0x8770('0x12'));var utils=require('../../config/utils');var config=require(_0x8770('0x13'));var licenseUtil=require(_0x8770('0x14'));var db=require(_0x8770('0x15'))['db'];function respondWithStatusCode(_0x51efbc,_0xb52d60){_0xb52d60=_0xb52d60||0xcc;return function(_0x455a65){if(_0x455a65){return _0x51efbc[_0x8770('0x16')](_0xb52d60);}return _0x51efbc[_0x8770('0x17')](_0xb52d60)[_0x8770('0x18')]();};}function respondWithResult(_0x12a06f,_0x1ce41d){_0x1ce41d=_0x1ce41d||0xc8;return function(_0x12439f){if(_0x12439f){return _0x12a06f['status'](_0x1ce41d)[_0x8770('0x19')](_0x12439f);}};}function respondWithFilteredResult(_0x106a20,_0x5dd4e7){return function(_0x2f7918){if(_0x2f7918){var _0x52254f=typeof _0x5dd4e7[_0x8770('0x1a')]==='undefined'&&typeof _0x5dd4e7['limit']==='undefined';var _0x155e83=_0x2f7918[_0x8770('0x1b')];var _0x17b634=_0x52254f?0x0:_0x5dd4e7[_0x8770('0x1a')];var _0x4b0691=_0x52254f?_0x2f7918['count']:_0x5dd4e7[_0x8770('0x1a')]+_0x5dd4e7[_0x8770('0x1c')];var _0x26cbcd;if(_0x4b0691>=_0x155e83){_0x4b0691=_0x155e83;_0x26cbcd=0xc8;}else{_0x26cbcd=0xce;}_0x106a20[_0x8770('0x17')](_0x26cbcd);return _0x106a20[_0x8770('0x1d')]('Content-Range',_0x17b634+'-'+_0x4b0691+'/'+_0x155e83)[_0x8770('0x19')](_0x2f7918);}return null;};}function patchUpdates(_0x1234dd){return function(_0x384b1e){try{jsonpatch[_0x8770('0x1e')](_0x384b1e,_0x1234dd,!![]);}catch(_0x582048){return BPromise['reject'](_0x582048);}return _0x384b1e[_0x8770('0x1f')]();};}function saveUpdates(_0x348e2f,_0x443716){return function(_0x2918a7){if(_0x2918a7){return _0x2918a7[_0x8770('0x20')](_0x348e2f)[_0x8770('0x21')](function(_0x5819dc){return _0x5819dc;});}return null;};}function removeEntity(_0x468fc0,_0x23ad66){return function(_0x4274dd){if(_0x4274dd){return _0x4274dd[_0x8770('0x22')]()['then'](function(){_0x468fc0[_0x8770('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7b4755,_0x453804){return function(_0x473d31){if(!_0x473d31){_0x7b4755[_0x8770('0x16')](0x194);}return _0x473d31;};}function handleError(_0x1538b2,_0x2cd084){_0x2cd084=_0x2cd084||0x1f4;return function(_0x293f53){logger[_0x8770('0x23')](_0x293f53[_0x8770('0x24')]);if(_0x293f53[_0x8770('0x25')]){delete _0x293f53['name'];}_0x1538b2[_0x8770('0x17')](_0x2cd084)[_0x8770('0x26')](_0x293f53);};}exports[_0x8770('0x27')]=function(_0x5c7bd,_0x246128){var _0x200a82={},_0x5ae7b8={},_0x4b284b={'count':0x0,'rows':[]};var _0x37974d=_[_0x8770('0x28')](db[_0x8770('0x29')][_0x8770('0x2a')],function(_0x23f4b0){return{'name':_0x23f4b0['fieldName'],'type':_0x23f4b0['type'][_0x8770('0x2b')]};});_0x5ae7b8[_0x8770('0x2c')]=_[_0x8770('0x28')](_0x37974d,_0x8770('0x25'));_0x5ae7b8['query']=_[_0x8770('0x2d')](_0x5c7bd['query']);_0x5ae7b8['filters']=_[_0x8770('0x2e')](_0x5ae7b8['model'],_0x5ae7b8[_0x8770('0x2f')]);_0x200a82[_0x8770('0x30')]=_[_0x8770('0x2e')](_0x5ae7b8[_0x8770('0x2c')],qs[_0x8770('0x31')](_0x5c7bd[_0x8770('0x2f')][_0x8770('0x31')]));_0x200a82[_0x8770('0x30')]=_0x200a82[_0x8770('0x30')]['length']?_0x200a82[_0x8770('0x30')]:_0x5ae7b8[_0x8770('0x2c')];if(!_0x5c7bd[_0x8770('0x2f')]['hasOwnProperty']('nolimit')){_0x200a82[_0x8770('0x1c')]=qs[_0x8770('0x1c')](_0x5c7bd[_0x8770('0x2f')]['limit']);_0x200a82[_0x8770('0x1a')]=qs['offset'](_0x5c7bd[_0x8770('0x2f')][_0x8770('0x1a')]);}_0x200a82[_0x8770('0x32')]=qs[_0x8770('0x33')](_0x5c7bd[_0x8770('0x2f')][_0x8770('0x33')]);_0x200a82[_0x8770('0x34')]=qs[_0x8770('0x35')](_[_0x8770('0x36')](_0x5c7bd[_0x8770('0x2f')],_0x5ae7b8['filters']),_0x37974d);if(_0x5c7bd[_0x8770('0x2f')][_0x8770('0x37')]){_0x200a82[_0x8770('0x34')]=_['merge'](_0x200a82[_0x8770('0x34')],{'$or':_[_0x8770('0x28')](_0x37974d,function(_0x27f91c){if(_0x27f91c[_0x8770('0x38')]!==_0x8770('0x39')){var _0x3a50db={};_0x3a50db[_0x27f91c['name']]={'$like':'%'+_0x5c7bd[_0x8770('0x2f')]['filter']+'%'};return _0x3a50db;}})});}_0x200a82=_[_0x8770('0x3a')]({},_0x200a82,_0x5c7bd['options']);var _0x41134a={'where':_0x200a82[_0x8770('0x34')]};return db[_0x8770('0x29')]['count'](_0x41134a)[_0x8770('0x21')](function(_0x3f35ac){_0x4b284b[_0x8770('0x1b')]=_0x3f35ac;if(_0x5c7bd[_0x8770('0x2f')][_0x8770('0x3b')]){_0x200a82[_0x8770('0x3c')]=[{'all':!![]}];}return db['MailQueueReport'][_0x8770('0x3d')](_0x200a82);})['then'](function(_0x4bcfc7){_0x4b284b[_0x8770('0x3e')]=_0x4bcfc7;return _0x4b284b;})[_0x8770('0x21')](respondWithFilteredResult(_0x246128,_0x200a82))[_0x8770('0x3f')](handleError(_0x246128,null));};exports[_0x8770('0x40')]=function(_0x3a51b5,_0x4b4477){var _0x35b182={'raw':!![],'where':{'id':_0x3a51b5['params']['id']}},_0x26ae1b={};_0x26ae1b[_0x8770('0x2c')]=_['keys'](db[_0x8770('0x29')][_0x8770('0x2a')]);_0x26ae1b[_0x8770('0x2f')]=_[_0x8770('0x2d')](_0x3a51b5[_0x8770('0x2f')]);_0x26ae1b[_0x8770('0x35')]=_[_0x8770('0x2e')](_0x26ae1b[_0x8770('0x2c')],_0x26ae1b[_0x8770('0x2f')]);_0x35b182[_0x8770('0x30')]=_[_0x8770('0x2e')](_0x26ae1b['model'],qs[_0x8770('0x31')](_0x3a51b5[_0x8770('0x2f')][_0x8770('0x31')]));_0x35b182[_0x8770('0x30')]=_0x35b182[_0x8770('0x30')][_0x8770('0x41')]?_0x35b182['attributes']:_0x26ae1b[_0x8770('0x2c')];if(_0x3a51b5[_0x8770('0x2f')][_0x8770('0x3b')]){_0x35b182[_0x8770('0x3c')]=[{'all':!![]}];}_0x35b182=_[_0x8770('0x3a')]({},_0x35b182,_0x3a51b5[_0x8770('0x42')]);return db[_0x8770('0x29')][_0x8770('0x43')](_0x35b182)['then'](handleEntityNotFound(_0x4b4477,null))[_0x8770('0x21')](respondWithResult(_0x4b4477,null))[_0x8770('0x3f')](handleError(_0x4b4477,null));};exports[_0x8770('0x44')]=function(_0xaeaf3b,_0x454496){return db['MailQueueReport']['create'](_0xaeaf3b[_0x8770('0x45')],{})['then'](respondWithResult(_0x454496,0xc9))[_0x8770('0x3f')](handleError(_0x454496,null));};exports['update']=function(_0x4f9e0b,_0x3805d8){if(_0x4f9e0b[_0x8770('0x45')]['id']){delete _0x4f9e0b[_0x8770('0x45')]['id'];}return db[_0x8770('0x29')]['find']({'where':{'id':_0x4f9e0b[_0x8770('0x46')]['id']}})[_0x8770('0x21')](handleEntityNotFound(_0x3805d8,null))['then'](saveUpdates(_0x4f9e0b['body'],null))[_0x8770('0x21')](respondWithResult(_0x3805d8,null))[_0x8770('0x3f')](handleError(_0x3805d8,null));};exports[_0x8770('0x22')]=function(_0x4f5cb8,_0x1584dc){return db['MailQueueReport'][_0x8770('0x43')]({'where':{'id':_0x4f5cb8[_0x8770('0x46')]['id']}})[_0x8770('0x21')](handleEntityNotFound(_0x1584dc,null))['then'](removeEntity(_0x1584dc,null))[_0x8770('0x3f')](handleError(_0x1584dc,null));};exports['describe']=function(_0x5aae53,_0x4cfacb){return db[_0x8770('0x29')][_0x8770('0x47')]()[_0x8770('0x21')](respondWithResult(_0x4cfacb,null))[_0x8770('0x3f')](handleError(_0x4cfacb,null));};
\ No newline at end of file
+var _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','MailQueueReport','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x4fa959,_0x478ce0){var _0x5a564d=function(_0x1bccf2){while(--_0x1bccf2){_0x4fa959['push'](_0x4fa959['shift']());}};_0x5a564d(++_0x478ce0);}(_0x57ca,0x108));var _0xa57c=function(_0x2d6881,_0x2f5fe2){_0x2d6881=_0x2d6881-0x0;var _0x24a044=_0x57ca[_0x2d6881];return _0x24a044;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':!![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['MailQueueReport']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['MailQueueReport'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['MailQueueReport'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));};
\ No newline at end of file
index 5535f6b..589ed35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd89d=['moment','bluebird','path','../../config/environment','./mailQueueReport.attributes','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0xd89d,0xce));var _0xdd89=function(_0xf62eb1,_0x4beba1){_0xf62eb1=_0xf62eb1-0x0;var _0x5be9e7=_0xd89d[_0xf62eb1];return _0x5be9e7;};'use strict';var _=require(_0xdd89('0x0'));var util=require('util');var logger=require(_0xdd89('0x1'))(_0xdd89('0x2'));var moment=require(_0xdd89('0x3'));var BPromise=require(_0xdd89('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd89('0x5'));var rimraf=require('rimraf');var config=require(_0xdd89('0x6'));var attributes=require(_0xdd89('0x7'));module['exports']=function(_0x5f628,_0x3c9435){return _0x5f628['define'](_0xdd89('0x8'),attributes,{'tableName':_0xdd89('0x9'),'paranoid':![],'indexes':[{'name':_0xdd89('0xa'),'fields':[_0xdd89('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3249=['rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3249,0xdf));var _0x9324=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x3249[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0x9324('0x0'));var util=require(_0x9324('0x1'));var logger=require(_0x9324('0x2'))('api');var moment=require(_0x9324('0x3'));var BPromise=require('bluebird');var rp=require(_0x9324('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9324('0x5'));var config=require(_0x9324('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0x9324('0x7')]=function(_0x3bb701,_0x2fea77){return _0x3bb701[_0x9324('0x8')](_0x9324('0x9'),attributes,{'tableName':_0x9324('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9324('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 186975b..f2dacd0 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(_0x1ff6d1,_0x52f903){var _0x1554cd=function(_0x233f9d){while(--_0x233f9d){_0x1ff6d1['push'](_0x1ff6d1['shift']());}};_0x1554cd(++_0x52f903);}(_0x2ef3,0xba));var _0x32ef=function(_0x1a4467,_0x27b829){_0x1a4467=_0x1a4467-0x0;var _0x492858=_0x2ef3[_0x1a4467];return _0x492858;};'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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x59b939,_0x327ae0){var _0x273fc8=function(_0x55c434){while(--_0x55c434){_0x59b939['push'](_0x59b939['shift']());}};_0x273fc8(++_0x327ae0);}(_0xadb5,0xad));var _0x5adb=function(_0x256cf0,_0x29a8fd){_0x256cf0=_0x256cf0-0x0;var _0x55fa30=_0xadb5[_0x256cf0];return _0x55fa30;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});};
\ No newline at end of file
index d2a0fc7..501d547 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(_0x22d667,_0x4ab6f6){var _0xc8eba0=function(_0x217df2){while(--_0x217df2){_0x22d667['push'](_0x22d667['shift']());}};_0xc8eba0(++_0x4ab6f6);}(_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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4ca662,_0x3109b5){var _0x364bd5=function(_0x43406c){while(--_0x43406c){_0x4ca662['push'](_0x4ca662['shift']());}};_0x364bd5(++_0x3109b5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0xcb91[_0x4996d5];return _0x4793f9;};'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 23d3a33..bfe5970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52ac=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x2aefff,_0x26a24b){var _0x4e4534=function(_0x592416){while(--_0x592416){_0x2aefff['push'](_0x2aefff['shift']());}};_0x4e4534(++_0x26a24b);}(_0x52ac,0xcd));var _0xc52a=function(_0x3c6bfe,_0x170147){_0x3c6bfe=_0x3c6bfe-0x0;var _0x1c7769=_0x52ac[_0x3c6bfe];return _0x1c7769;};'use strict';var Sequelize=require(_0xc52a('0x0'));module[_0xc52a('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xc52a('0x2')]},'authentication':{'type':Sequelize[_0xc52a('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xc52a('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xc52a('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc52a('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xc52a('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc52a('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xc52a('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x965d=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x5d068a,_0x9a41f2){var _0x4b84d4=function(_0x160abe){while(--_0x160abe){_0x5d068a['push'](_0x5d068a['shift']());}};_0x4b84d4(++_0x9a41f2);}(_0x965d,0x1be));var _0xd965=function(_0x454279,_0x2644c1){_0x454279=_0x454279-0x0;var _0x4b7753=_0x965d[_0x454279];return _0x4b7753;};'use strict';var Sequelize=require(_0xd965('0x0'));module[_0xd965('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd965('0x2')]},'authentication':{'type':Sequelize[_0xd965('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xd965('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd965('0x4')]},'tls':{'type':Sequelize[_0xd965('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd965('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xd965('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 8015646..43c2ce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe318=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','api','request-promise','path'];(function(_0x3a449f,_0x111f42){var _0x4a12c4=function(_0x1497f0){while(--_0x1497f0){_0x3a449f['push'](_0x3a449f['shift']());}};_0x4a12c4(++_0x111f42);}(_0xe318,0x127));var _0x8e31=function(_0x317244,_0x17bdb7){_0x317244=_0x317244-0x0;var _0x1ac445=_0xe318[_0x317244];return _0x1ac445;};'use strict';var _=require(_0x8e31('0x0'));var util=require('util');var logger=require(_0x8e31('0x1'))(_0x8e31('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8e31('0x3'));var fs=require('fs');var path=require(_0x8e31('0x4'));var rimraf=require(_0x8e31('0x5'));var config=require(_0x8e31('0x6'));var attributes=require(_0x8e31('0x7'));module[_0x8e31('0x8')]=function(_0x110aa5,_0x3d9d2d){return _0x110aa5[_0x8e31('0x9')](_0x8e31('0xa'),attributes,{'tableName':_0x8e31('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc76b=['api','moment','bluebird','path','rimraf','./mailServerIn.attributes','exports','MailServerIn','lodash','util'];(function(_0x5f5c89,_0x2047ef){var _0x3084ed=function(_0x40f4fa){while(--_0x40f4fa){_0x5f5c89['push'](_0x5f5c89['shift']());}};_0x3084ed(++_0x2047ef);}(_0xc76b,0x170));var _0xbc76=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc76b[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xbc76('0x0'));var util=require(_0xbc76('0x1'));var logger=require('../../config/logger')(_0xbc76('0x2'));var moment=require(_0xbc76('0x3'));var BPromise=require(_0xbc76('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc76('0x5'));var rimraf=require(_0xbc76('0x6'));var config=require('../../config/environment');var attributes=require(_0xbc76('0x7'));module[_0xbc76('0x8')]=function(_0x508813,_0x471974){return _0x508813['define'](_0xbc76('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 25ecb70..5cb5159 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x167e=['request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','findAll','options','raw','where','attributes','limit','model','map','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0x167e,0xa3));var _0xe167=function(_0x4d0cdf,_0x238771){_0x4d0cdf=_0x4d0cdf-0x0;var _0x4efd06=_0x167e[_0x4d0cdf];return _0x4efd06;};'use strict';var _=require(_0xe167('0x0'));var util=require(_0xe167('0x1'));var moment=require(_0xe167('0x2'));var BPromise=require(_0xe167('0x3'));var rs=require(_0xe167('0x4'));var fs=require('fs');var Redis=require(_0xe167('0x5'));var db=require(_0xe167('0x6'))['db'];var utils=require(_0xe167('0x7'));var logger=require('../../config/logger')(_0xe167('0x8'));var config=require('../../config/environment');var jayson=require(_0xe167('0x9'));var client=jayson[_0xe167('0xa')][_0xe167('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bad0c,_0x1426ae,_0x56cf9b){return new BPromise(function(_0x3a00d5,_0x5c6694){return client[_0xe167('0xc')](_0x3bad0c,_0x56cf9b)[_0xe167('0xd')](function(_0x26a191){logger[_0xe167('0xe')](_0xe167('0xf'),_0x1426ae,_0xe167('0x10'));logger[_0xe167('0x11')](_0xe167('0x12'),_0x1426ae,'request\x20sent',JSON[_0xe167('0x13')](_0x26a191));if(_0x26a191[_0xe167('0x14')]){if(_0x26a191['error'][_0xe167('0x15')]===0x1f4){logger[_0xe167('0x14')](_0xe167('0xf'),_0x1426ae,_0x26a191[_0xe167('0x14')][_0xe167('0x16')]);return _0x5c6694(_0x26a191[_0xe167('0x14')][_0xe167('0x16')]);}logger[_0xe167('0x14')](_0xe167('0xf'),_0x1426ae,_0x26a191['error'][_0xe167('0x16')]);return _0x3a00d5(_0x26a191[_0xe167('0x14')][_0xe167('0x16')]);}else{logger[_0xe167('0xe')]('MailServerIn,\x20%s,\x20%s',_0x1426ae,_0xe167('0x10'));_0x3a00d5(_0x26a191[_0xe167('0x17')][_0xe167('0x16')]);}})[_0xe167('0x18')](function(_0x1244d4){logger['error'](_0xe167('0xf'),_0x1426ae,_0x1244d4);_0x5c6694(_0x1244d4);});});}exports[_0xe167('0x19')]=function(_0x369d39){var _0x5e7aa3=this;return new Promise(function(_0x469f2a,_0x9a91b){return db['MailServerIn'][_0xe167('0x1a')]({'raw':_0x369d39[_0xe167('0x1b')]?_0x369d39[_0xe167('0x1b')][_0xe167('0x1c')]===undefined?!![]:![]:!![],'where':_0x369d39[_0xe167('0x1b')]?_0x369d39['options'][_0xe167('0x1d')]||null:null,'attributes':_0x369d39[_0xe167('0x1b')]?_0x369d39[_0xe167('0x1b')][_0xe167('0x1e')]||null:null,'limit':_0x369d39[_0xe167('0x1b')]?_0x369d39['options'][_0xe167('0x1f')]||null:null,'include':_0x369d39[_0xe167('0x1b')]?_0x369d39[_0xe167('0x1b')]['include']?_['map'](_0x369d39['options']['include'],function(_0x44b611){return{'model':db[_0x44b611[_0xe167('0x20')]],'as':_0x44b611['as'],'attributes':_0x44b611[_0xe167('0x1e')],'include':_0x44b611['include']?_[_0xe167('0x21')](_0x44b611[_0xe167('0x22')],function(_0x28a706){return{'model':db[_0x28a706[_0xe167('0x20')]],'as':_0x28a706['as'],'attributes':_0x28a706['attributes'],'include':_0x28a706[_0xe167('0x22')]?_['map'](_0x28a706[_0xe167('0x22')],function(_0x4d32b8){return{'model':db[_0x4d32b8['model']],'as':_0x4d32b8['as'],'attributes':_0x4d32b8[_0xe167('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe167('0xd')](function(_0x35dff0){logger[_0xe167('0xe')]('GetMailServerIn',_0x369d39);logger[_0xe167('0x11')]('GetMailServerIn',_0x369d39,JSON['stringify'](_0x35dff0));_0x469f2a(_0x35dff0);})[_0xe167('0x18')](function(_0x3ce8c3){logger[_0xe167('0x14')]('GetMailServerIn',_0x3ce8c3['message'],_0x369d39);_0x9a91b(_0x5e7aa3[_0xe167('0x14')](0x1f4,_0x3ce8c3[_0xe167('0x16')]));});});};
\ No newline at end of file
+var _0xde9d=['info','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x1c8725,_0x2b5bae){var _0x59c013=function(_0x3b562b){while(--_0x3b562b){_0x1c8725['push'](_0x1c8725['shift']());}};_0x59c013(++_0x2b5bae);}(_0xde9d,0x156));var _0xdde9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde9d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdde9('0x0'));var util=require(_0xdde9('0x1'));var moment=require(_0xdde9('0x2'));var BPromise=require(_0xdde9('0x3'));var rs=require(_0xdde9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdde9('0x5'))['db'];var utils=require(_0xdde9('0x6'));var logger=require(_0xdde9('0x7'))('rpc');var config=require(_0xdde9('0x8'));var jayson=require(_0xdde9('0x9'));var client=jayson[_0xdde9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x289ccb,_0x1431f0,_0x229168){return new BPromise(function(_0x3be8c1,_0x35268e){return client['request'](_0x289ccb,_0x229168)[_0xdde9('0xb')](function(_0x4fe44d){logger['info'](_0xdde9('0xc'),_0x1431f0,_0xdde9('0xd'));logger[_0xdde9('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x1431f0,_0xdde9('0xd'),JSON['stringify'](_0x4fe44d));if(_0x4fe44d['error']){if(_0x4fe44d[_0xdde9('0xf')][_0xdde9('0x10')]===0x1f4){logger[_0xdde9('0xf')]('MailServerIn,\x20%s,\x20%s',_0x1431f0,_0x4fe44d['error'][_0xdde9('0x11')]);return _0x35268e(_0x4fe44d[_0xdde9('0xf')]['message']);}logger['error'](_0xdde9('0xc'),_0x1431f0,_0x4fe44d[_0xdde9('0xf')]['message']);return _0x3be8c1(_0x4fe44d[_0xdde9('0xf')][_0xdde9('0x11')]);}else{logger[_0xdde9('0x12')]('MailServerIn,\x20%s,\x20%s',_0x1431f0,_0xdde9('0xd'));_0x3be8c1(_0x4fe44d['result']['message']);}})[_0xdde9('0x13')](function(_0x5c319d){logger['error']('MailServerIn,\x20%s,\x20%s',_0x1431f0,_0x5c319d);_0x35268e(_0x5c319d);});});}exports[_0xdde9('0x14')]=function(_0x2e0ed9){var _0x34259e=this;return new Promise(function(_0x2e4b89,_0x23dc91){return db[_0xdde9('0x15')][_0xdde9('0x16')]({'raw':_0x2e0ed9[_0xdde9('0x17')]?_0x2e0ed9[_0xdde9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2e0ed9['options']?_0x2e0ed9[_0xdde9('0x17')][_0xdde9('0x18')]||null:null,'attributes':_0x2e0ed9[_0xdde9('0x17')]?_0x2e0ed9[_0xdde9('0x17')][_0xdde9('0x19')]||null:null,'limit':_0x2e0ed9[_0xdde9('0x17')]?_0x2e0ed9[_0xdde9('0x17')]['limit']||null:null,'include':_0x2e0ed9[_0xdde9('0x17')]?_0x2e0ed9[_0xdde9('0x17')][_0xdde9('0x1a')]?_['map'](_0x2e0ed9['options'][_0xdde9('0x1a')],function(_0x22a8af){return{'model':db[_0x22a8af[_0xdde9('0x1b')]],'as':_0x22a8af['as'],'attributes':_0x22a8af['attributes'],'include':_0x22a8af[_0xdde9('0x1a')]?_[_0xdde9('0x1c')](_0x22a8af[_0xdde9('0x1a')],function(_0xfe0286){return{'model':db[_0xfe0286['model']],'as':_0xfe0286['as'],'attributes':_0xfe0286['attributes'],'include':_0xfe0286['include']?_[_0xdde9('0x1c')](_0xfe0286['include'],function(_0x2c10c1){return{'model':db[_0x2c10c1[_0xdde9('0x1b')]],'as':_0x2c10c1['as'],'attributes':_0x2c10c1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f549){logger[_0xdde9('0x12')](_0xdde9('0x14'),_0x2e0ed9);logger['debug'](_0xdde9('0x14'),_0x2e0ed9,JSON[_0xdde9('0x1d')](_0x2f549));_0x2e4b89(_0x2f549);})[_0xdde9('0x13')](function(_0x42f3bd){logger[_0xdde9('0xf')](_0xdde9('0x14'),_0x42f3bd[_0xdde9('0x11')],_0x2e0ed9);_0x23dc91(_0x34259e[_0xdde9('0xf')](0x1f4,_0x42f3bd[_0xdde9('0x11')]));});});};
\ No newline at end of file
index de13434..7877a36 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(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
+var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7a54,0x106));var _0x47a5=function(_0x40b968,_0x5f0c03){_0x40b968=_0x40b968-0x0;var _0x5144df=_0x7a54[_0x40b968];return _0x5144df;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
index 31cfb83..9639495 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0xbcbd76,_0x25722b){var _0x503680=function(_0x163649){while(--_0x163649){_0xbcbd76['push'](_0xbcbd76['shift']());}};_0x503680(++_0x25722b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x0d8b('0x2')]},'port':{'type':Sequelize[_0x0d8b('0x3')]},'secure':{'type':Sequelize[_0x0d8b('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x0d8b('0x2')]},'authentication':{'type':Sequelize[_0x0d8b('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe706=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x4d0a20,_0x26c58c){var _0x9f5964=function(_0x5d4b85){while(--_0x5d4b85){_0x4d0a20['push'](_0x4d0a20['shift']());}};_0x9f5964(++_0x26c58c);}(_0xe706,0xa3));var _0x6e70=function(_0x39b5bd,_0x398098){_0x39b5bd=_0x39b5bd-0x0;var _0x3791cb=_0xe706[_0x39b5bd];return _0x3791cb;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'description':{'type':Sequelize[_0x6e70('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x6e70('0x2')]},'pass':{'type':Sequelize[_0x6e70('0x2')]},'port':{'type':Sequelize[_0x6e70('0x3')]},'secure':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x6e70('0x2')]},'authentication':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 73257a0..5a1d4f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x816b=['attributes','model','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','stack','name','MailServerOut','rawAttributes','fieldName','key','map','query','keys','filters','intersection','fields'];(function(_0x10c6c9,_0x4ed72a){var _0x2a0648=function(_0x3bd0f7){while(--_0x3bd0f7){_0x10c6c9['push'](_0x10c6c9['shift']());}};_0x2a0648(++_0x4ed72a);}(_0x816b,0x17c));var _0xb816=function(_0x5ca5ec,_0x2f5092){_0x5ca5ec=_0x5ca5ec-0x0;var _0x385d05=_0x816b[_0x5ca5ec];return _0x385d05;};'use strict';var emlformat=require(_0xb816('0x0'));var rimraf=require(_0xb816('0x1'));var zipdir=require(_0xb816('0x2'));var jsonpatch=require(_0xb816('0x3'));var rp=require('request-promise');var moment=require(_0xb816('0x4'));var BPromise=require(_0xb816('0x5'));var Mustache=require(_0xb816('0x6'));var util=require(_0xb816('0x7'));var path=require(_0xb816('0x8'));var sox=require(_0xb816('0x9'));var csv=require('to-csv');var ejs=require(_0xb816('0xa'));var fs=require('fs');var fs_extra=require(_0xb816('0xb'));var _=require(_0xb816('0xc'));var squel=require(_0xb816('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb816('0xe'));var toCsv=require(_0xb816('0xf'));var querystring=require(_0xb816('0x10'));var Papa=require(_0xb816('0x11'));var Redis=require(_0xb816('0x12'));var authService=require(_0xb816('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb816('0x14'));var logger=require(_0xb816('0x15'))(_0xb816('0x16'));var utils=require('../../config/utils');var config=require(_0xb816('0x17'));var licenseUtil=require(_0xb816('0x18'));var db=require(_0xb816('0x19'))['db'];function respondWithStatusCode(_0x36dc3f,_0x12bf7b){_0x12bf7b=_0x12bf7b||0xcc;return function(_0x179a13){if(_0x179a13){return _0x36dc3f[_0xb816('0x1a')](_0x12bf7b);}return _0x36dc3f[_0xb816('0x1b')](_0x12bf7b)[_0xb816('0x1c')]();};}function respondWithResult(_0x552519,_0x219a76){_0x219a76=_0x219a76||0xc8;return function(_0xf0bc36){if(_0xf0bc36){return _0x552519['status'](_0x219a76)[_0xb816('0x1d')](_0xf0bc36);}};}function respondWithFilteredResult(_0x11d094,_0x173a50){return function(_0x102edf){if(_0x102edf){var _0x324a86=typeof _0x173a50[_0xb816('0x1e')]===_0xb816('0x1f')&&typeof _0x173a50[_0xb816('0x20')]===_0xb816('0x1f');var _0x396c73=_0x102edf['count'];var _0x3c11a6=_0x324a86?0x0:_0x173a50[_0xb816('0x1e')];var _0x4f779e=_0x324a86?_0x102edf['count']:_0x173a50[_0xb816('0x1e')]+_0x173a50[_0xb816('0x20')];var _0x3ef60b;if(_0x4f779e>=_0x396c73){_0x4f779e=_0x396c73;_0x3ef60b=0xc8;}else{_0x3ef60b=0xce;}_0x11d094['status'](_0x3ef60b);return _0x11d094[_0xb816('0x21')]('Content-Range',_0x3c11a6+'-'+_0x4f779e+'/'+_0x396c73)['json'](_0x102edf);}return null;};}function patchUpdates(_0x541bdc){return function(_0xeb935){try{jsonpatch[_0xb816('0x22')](_0xeb935,_0x541bdc,!![]);}catch(_0x279195){return BPromise[_0xb816('0x23')](_0x279195);}return _0xeb935[_0xb816('0x24')]();};}function saveUpdates(_0x2176c8,_0x2a9029){return function(_0x4b02a2){if(_0x4b02a2){return _0x4b02a2[_0xb816('0x25')](_0x2176c8)[_0xb816('0x26')](function(_0x2aff0c){return _0x2aff0c;});}return null;};}function removeEntity(_0x2419a9,_0x2fed26){return function(_0x48dcd3){if(_0x48dcd3){return _0x48dcd3[_0xb816('0x27')]()[_0xb816('0x26')](function(){_0x2419a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x500dad,_0x83b96c){return function(_0x30e65d){if(!_0x30e65d){_0x500dad[_0xb816('0x1a')](0x194);}return _0x30e65d;};}function handleError(_0x54d572,_0x41d189){_0x41d189=_0x41d189||0x1f4;return function(_0x5e5602){logger['error'](_0x5e5602[_0xb816('0x28')]);if(_0x5e5602[_0xb816('0x29')]){delete _0x5e5602['name'];}_0x54d572['status'](_0x41d189)['send'](_0x5e5602);};}exports['index']=function(_0x13306b,_0x406cbb){var _0x422062={},_0x1d9118={},_0x36d518={'count':0x0,'rows':[]};var _0x5a86e3=_['map'](db[_0xb816('0x2a')][_0xb816('0x2b')],function(_0x2bd5d4){return{'name':_0x2bd5d4[_0xb816('0x2c')],'type':_0x2bd5d4['type'][_0xb816('0x2d')]};});_0x1d9118['model']=_[_0xb816('0x2e')](_0x5a86e3,'name');_0x1d9118[_0xb816('0x2f')]=_[_0xb816('0x30')](_0x13306b[_0xb816('0x2f')]);_0x1d9118[_0xb816('0x31')]=_[_0xb816('0x32')](_0x1d9118['model'],_0x1d9118['query']);_0x422062['attributes']=_[_0xb816('0x32')](_0x1d9118['model'],qs['fields'](_0x13306b['query'][_0xb816('0x33')]));_0x422062[_0xb816('0x34')]=_0x422062[_0xb816('0x34')]['length']?_0x422062[_0xb816('0x34')]:_0x1d9118[_0xb816('0x35')];if(!_0x13306b[_0xb816('0x2f')][_0xb816('0x36')](_0xb816('0x37'))){_0x422062[_0xb816('0x20')]=qs[_0xb816('0x20')](_0x13306b[_0xb816('0x2f')]['limit']);_0x422062[_0xb816('0x1e')]=qs[_0xb816('0x1e')](_0x13306b[_0xb816('0x2f')]['offset']);}_0x422062['order']=qs[_0xb816('0x38')](_0x13306b[_0xb816('0x2f')][_0xb816('0x38')]);_0x422062[_0xb816('0x39')]=qs[_0xb816('0x31')](_[_0xb816('0x3a')](_0x13306b[_0xb816('0x2f')],_0x1d9118[_0xb816('0x31')]),_0x5a86e3);if(_0x13306b[_0xb816('0x2f')]['filter']){_0x422062[_0xb816('0x39')]=_['merge'](_0x422062[_0xb816('0x39')],{'$or':_['map'](_0x5a86e3,function(_0x13b635){if(_0x13b635['type']!==_0xb816('0x3b')){var _0x48c070={};_0x48c070[_0x13b635[_0xb816('0x29')]]={'$like':'%'+_0x13306b[_0xb816('0x2f')]['filter']+'%'};return _0x48c070;}})});}_0x422062=_[_0xb816('0x3c')]({},_0x422062,_0x13306b[_0xb816('0x3d')]);var _0x28fec6={'where':_0x422062['where']};return db['MailServerOut']['count'](_0x28fec6)[_0xb816('0x26')](function(_0x53c811){_0x36d518['count']=_0x53c811;if(_0x13306b[_0xb816('0x2f')][_0xb816('0x3e')]){_0x422062[_0xb816('0x3f')]=[{'all':!![]}];}return db[_0xb816('0x2a')][_0xb816('0x40')](_0x422062);})[_0xb816('0x26')](function(_0x206858){_0x36d518['rows']=_0x206858;return _0x36d518;})[_0xb816('0x26')](respondWithFilteredResult(_0x406cbb,_0x422062))[_0xb816('0x41')](handleError(_0x406cbb,null));};exports[_0xb816('0x42')]=function(_0x295e84,_0x1354c3){var _0x110662={'raw':!![],'where':{'id':_0x295e84[_0xb816('0x43')]['id']}},_0x21f6b0={};_0x21f6b0[_0xb816('0x35')]=_[_0xb816('0x30')](db[_0xb816('0x2a')]['rawAttributes']);_0x21f6b0[_0xb816('0x2f')]=_[_0xb816('0x30')](_0x295e84[_0xb816('0x2f')]);_0x21f6b0['filters']=_[_0xb816('0x32')](_0x21f6b0['model'],_0x21f6b0['query']);_0x110662['attributes']=_[_0xb816('0x32')](_0x21f6b0[_0xb816('0x35')],qs['fields'](_0x295e84['query'][_0xb816('0x33')]));_0x110662['attributes']=_0x110662[_0xb816('0x34')][_0xb816('0x44')]?_0x110662[_0xb816('0x34')]:_0x21f6b0['model'];if(_0x295e84[_0xb816('0x2f')][_0xb816('0x3e')]){_0x110662[_0xb816('0x3f')]=[{'all':!![]}];}_0x110662=_[_0xb816('0x3c')]({},_0x110662,_0x295e84[_0xb816('0x3d')]);return db[_0xb816('0x2a')][_0xb816('0x45')](_0x110662)['then'](handleEntityNotFound(_0x1354c3,null))[_0xb816('0x26')](respondWithResult(_0x1354c3,null))[_0xb816('0x41')](handleError(_0x1354c3,null));};exports[_0xb816('0x46')]=function(_0x44a850,_0x3b6863){return db[_0xb816('0x2a')]['create'](_0x44a850[_0xb816('0x47')],{})['then'](respondWithResult(_0x3b6863,0xc9))[_0xb816('0x41')](handleError(_0x3b6863,null));};exports[_0xb816('0x25')]=function(_0x143366,_0x1d694c){if(_0x143366[_0xb816('0x47')]['id']){delete _0x143366[_0xb816('0x47')]['id'];}return db[_0xb816('0x2a')][_0xb816('0x45')]({'where':{'id':_0x143366[_0xb816('0x43')]['id']}})[_0xb816('0x26')](handleEntityNotFound(_0x1d694c,null))[_0xb816('0x26')](saveUpdates(_0x143366[_0xb816('0x47')],null))[_0xb816('0x26')](respondWithResult(_0x1d694c,null))[_0xb816('0x41')](handleError(_0x1d694c,null));};exports[_0xb816('0x27')]=function(_0x75c6f0,_0x29baa3){return db[_0xb816('0x2a')]['find']({'where':{'id':_0x75c6f0[_0xb816('0x43')]['id']}})[_0xb816('0x26')](handleEntityNotFound(_0x29baa3,null))[_0xb816('0x26')](removeEntity(_0x29baa3,null))[_0xb816('0x41')](handleError(_0x29baa3,null));};
\ No newline at end of file
+var _0x89c2=['destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','MailServerOut','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x89c2,0x1a5));var _0x289c=function(_0x355d06,_0x3c9512){_0x355d06=_0x355d06-0x0;var _0x13b6d0=_0x89c2[_0x355d06];return _0x13b6d0;};'use strict';var emlformat=require(_0x289c('0x0'));var rimraf=require(_0x289c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x289c('0x2'));var rp=require(_0x289c('0x3'));var moment=require(_0x289c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x289c('0x5'));var util=require('util');var path=require(_0x289c('0x6'));var sox=require(_0x289c('0x7'));var csv=require('to-csv');var ejs=require(_0x289c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x289c('0x9'));var squel=require('squel');var crypto=require(_0x289c('0xa'));var jsforce=require(_0x289c('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x289c('0xc'));var Papa=require('papaparse');var Redis=require(_0x289c('0xd'));var authService=require(_0x289c('0xe'));var qs=require(_0x289c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x289c('0x10'));var utils=require('../../config/utils');var config=require(_0x289c('0x11'));var licenseUtil=require(_0x289c('0x12'));var db=require(_0x289c('0x13'))['db'];function respondWithStatusCode(_0x3878dd,_0x13c09d){_0x13c09d=_0x13c09d||0xcc;return function(_0x387f1c){if(_0x387f1c){return _0x3878dd[_0x289c('0x14')](_0x13c09d);}return _0x3878dd[_0x289c('0x15')](_0x13c09d)[_0x289c('0x16')]();};}function respondWithResult(_0x39263d,_0x326d98){_0x326d98=_0x326d98||0xc8;return function(_0x565249){if(_0x565249){return _0x39263d[_0x289c('0x15')](_0x326d98)['json'](_0x565249);}};}function respondWithFilteredResult(_0x28f6ed,_0x1a4d48){return function(_0x3f394f){if(_0x3f394f){var _0x4b156d=typeof _0x1a4d48[_0x289c('0x17')]==='undefined'&&typeof _0x1a4d48[_0x289c('0x18')]===_0x289c('0x19');var _0x299c10=_0x3f394f['count'];var _0x32e62e=_0x4b156d?0x0:_0x1a4d48[_0x289c('0x17')];var _0x3a2c02=_0x4b156d?_0x3f394f[_0x289c('0x1a')]:_0x1a4d48[_0x289c('0x17')]+_0x1a4d48[_0x289c('0x18')];var _0x24f75f;if(_0x3a2c02>=_0x299c10){_0x3a2c02=_0x299c10;_0x24f75f=0xc8;}else{_0x24f75f=0xce;}_0x28f6ed[_0x289c('0x15')](_0x24f75f);return _0x28f6ed[_0x289c('0x1b')](_0x289c('0x1c'),_0x32e62e+'-'+_0x3a2c02+'/'+_0x299c10)['json'](_0x3f394f);}return null;};}function patchUpdates(_0x29868d){return function(_0x550549){try{jsonpatch[_0x289c('0x1d')](_0x550549,_0x29868d,!![]);}catch(_0x3952f7){return BPromise[_0x289c('0x1e')](_0x3952f7);}return _0x550549[_0x289c('0x1f')]();};}function saveUpdates(_0x56bee3,_0x174e9b){return function(_0x54b7e0){if(_0x54b7e0){return _0x54b7e0[_0x289c('0x20')](_0x56bee3)['then'](function(_0x31de6a){return _0x31de6a;});}return null;};}function removeEntity(_0x15c525,_0x3d9be9){return function(_0x381d8b){if(_0x381d8b){return _0x381d8b['destroy']()[_0x289c('0x21')](function(){_0x15c525[_0x289c('0x15')](0xcc)[_0x289c('0x16')]();});}};}function handleEntityNotFound(_0x1d0c11,_0x46cb37){return function(_0x1dc882){if(!_0x1dc882){_0x1d0c11['sendStatus'](0x194);}return _0x1dc882;};}function handleError(_0x4003c7,_0x534434){_0x534434=_0x534434||0x1f4;return function(_0x4b21d8){logger[_0x289c('0x22')](_0x4b21d8['stack']);if(_0x4b21d8[_0x289c('0x23')]){delete _0x4b21d8['name'];}_0x4003c7[_0x289c('0x15')](_0x534434)[_0x289c('0x24')](_0x4b21d8);};}exports[_0x289c('0x25')]=function(_0x56752f,_0x1247d8){var _0x1f9a8b={},_0x4c5acf={},_0x2797ad={'count':0x0,'rows':[]};var _0x46e418=_[_0x289c('0x26')](db[_0x289c('0x27')][_0x289c('0x28')],function(_0x560a02){return{'name':_0x560a02['fieldName'],'type':_0x560a02['type'][_0x289c('0x29')]};});_0x4c5acf[_0x289c('0x2a')]=_[_0x289c('0x26')](_0x46e418,_0x289c('0x23'));_0x4c5acf[_0x289c('0x2b')]=_[_0x289c('0x2c')](_0x56752f[_0x289c('0x2b')]);_0x4c5acf['filters']=_[_0x289c('0x2d')](_0x4c5acf[_0x289c('0x2a')],_0x4c5acf[_0x289c('0x2b')]);_0x1f9a8b[_0x289c('0x2e')]=_[_0x289c('0x2d')](_0x4c5acf[_0x289c('0x2a')],qs[_0x289c('0x2f')](_0x56752f['query'][_0x289c('0x2f')]));_0x1f9a8b[_0x289c('0x2e')]=_0x1f9a8b[_0x289c('0x2e')][_0x289c('0x30')]?_0x1f9a8b[_0x289c('0x2e')]:_0x4c5acf[_0x289c('0x2a')];if(!_0x56752f[_0x289c('0x2b')][_0x289c('0x31')](_0x289c('0x32'))){_0x1f9a8b[_0x289c('0x18')]=qs[_0x289c('0x18')](_0x56752f['query'][_0x289c('0x18')]);_0x1f9a8b['offset']=qs[_0x289c('0x17')](_0x56752f[_0x289c('0x2b')][_0x289c('0x17')]);}_0x1f9a8b[_0x289c('0x33')]=qs['sort'](_0x56752f[_0x289c('0x2b')]['sort']);_0x1f9a8b[_0x289c('0x34')]=qs[_0x289c('0x35')](_[_0x289c('0x36')](_0x56752f[_0x289c('0x2b')],_0x4c5acf['filters']),_0x46e418);if(_0x56752f[_0x289c('0x2b')][_0x289c('0x37')]){_0x1f9a8b['where']=_[_0x289c('0x38')](_0x1f9a8b[_0x289c('0x34')],{'$or':_['map'](_0x46e418,function(_0x22090e){if(_0x22090e[_0x289c('0x39')]!==_0x289c('0x3a')){var _0x3857f9={};_0x3857f9[_0x22090e[_0x289c('0x23')]]={'$like':'%'+_0x56752f[_0x289c('0x2b')][_0x289c('0x37')]+'%'};return _0x3857f9;}})});}_0x1f9a8b=_[_0x289c('0x38')]({},_0x1f9a8b,_0x56752f[_0x289c('0x3b')]);var _0x2e0a10={'where':_0x1f9a8b['where']};return db[_0x289c('0x27')][_0x289c('0x1a')](_0x2e0a10)[_0x289c('0x21')](function(_0x392ace){_0x2797ad[_0x289c('0x1a')]=_0x392ace;if(_0x56752f['query'][_0x289c('0x3c')]){_0x1f9a8b['include']=[{'all':!![]}];}return db[_0x289c('0x27')][_0x289c('0x3d')](_0x1f9a8b);})[_0x289c('0x21')](function(_0x5de1d3){_0x2797ad[_0x289c('0x3e')]=_0x5de1d3;return _0x2797ad;})[_0x289c('0x21')](respondWithFilteredResult(_0x1247d8,_0x1f9a8b))[_0x289c('0x3f')](handleError(_0x1247d8,null));};exports['show']=function(_0x3df9d6,_0x3694e8){var _0x336d61={'raw':!![],'where':{'id':_0x3df9d6[_0x289c('0x40')]['id']}},_0x149e35={};_0x149e35['model']=_[_0x289c('0x2c')](db['MailServerOut'][_0x289c('0x28')]);_0x149e35[_0x289c('0x2b')]=_[_0x289c('0x2c')](_0x3df9d6[_0x289c('0x2b')]);_0x149e35['filters']=_[_0x289c('0x2d')](_0x149e35[_0x289c('0x2a')],_0x149e35[_0x289c('0x2b')]);_0x336d61['attributes']=_[_0x289c('0x2d')](_0x149e35['model'],qs[_0x289c('0x2f')](_0x3df9d6[_0x289c('0x2b')][_0x289c('0x2f')]));_0x336d61[_0x289c('0x2e')]=_0x336d61['attributes'][_0x289c('0x30')]?_0x336d61['attributes']:_0x149e35[_0x289c('0x2a')];if(_0x3df9d6[_0x289c('0x2b')][_0x289c('0x3c')]){_0x336d61[_0x289c('0x41')]=[{'all':!![]}];}_0x336d61=_[_0x289c('0x38')]({},_0x336d61,_0x3df9d6[_0x289c('0x3b')]);return db[_0x289c('0x27')][_0x289c('0x42')](_0x336d61)[_0x289c('0x21')](handleEntityNotFound(_0x3694e8,null))[_0x289c('0x21')](respondWithResult(_0x3694e8,null))[_0x289c('0x3f')](handleError(_0x3694e8,null));};exports[_0x289c('0x43')]=function(_0x311c68,_0x2a2a99){return db[_0x289c('0x27')][_0x289c('0x43')](_0x311c68[_0x289c('0x44')],{})[_0x289c('0x21')](respondWithResult(_0x2a2a99,0xc9))[_0x289c('0x3f')](handleError(_0x2a2a99,null));};exports[_0x289c('0x20')]=function(_0x1a957e,_0x33cc7d){if(_0x1a957e[_0x289c('0x44')]['id']){delete _0x1a957e[_0x289c('0x44')]['id'];}return db[_0x289c('0x27')][_0x289c('0x42')]({'where':{'id':_0x1a957e[_0x289c('0x40')]['id']}})[_0x289c('0x21')](handleEntityNotFound(_0x33cc7d,null))[_0x289c('0x21')](saveUpdates(_0x1a957e[_0x289c('0x44')],null))[_0x289c('0x21')](respondWithResult(_0x33cc7d,null))[_0x289c('0x3f')](handleError(_0x33cc7d,null));};exports[_0x289c('0x45')]=function(_0x4fc907,_0x358274){return db[_0x289c('0x27')]['find']({'where':{'id':_0x4fc907[_0x289c('0x40')]['id']}})[_0x289c('0x21')](handleEntityNotFound(_0x358274,null))[_0x289c('0x21')](removeEntity(_0x358274,null))[_0x289c('0x3f')](handleError(_0x358274,null));};
\ No newline at end of file
index 59bfa18..70b71b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaee=['request-promise','path','./mailServerOut.attributes','exports','MailServerOut','lodash','../../config/logger','api','bluebird'];(function(_0x21ba3c,_0x36dd17){var _0x53c629=function(_0x49ce09){while(--_0x49ce09){_0x21ba3c['push'](_0x21ba3c['shift']());}};_0x53c629(++_0x36dd17);}(_0xaaee,0xd4));var _0xeaae=function(_0x59056c,_0x14f6a9){_0x59056c=_0x59056c-0x0;var _0x1086c3=_0xaaee[_0x59056c];return _0x1086c3;};'use strict';var _=require(_0xeaae('0x0'));var util=require('util');var logger=require(_0xeaae('0x1'))(_0xeaae('0x2'));var moment=require('moment');var BPromise=require(_0xeaae('0x3'));var rp=require(_0xeaae('0x4'));var fs=require('fs');var path=require(_0xeaae('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeaae('0x6'));module[_0xeaae('0x7')]=function(_0x4058e9,_0x3284cf){return _0x4058e9['define'](_0xeaae('0x8'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa90f=['moment','bluebird','request-promise','path','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','util','../../config/logger','api'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa90f,0x14d));var _0xfa90=function(_0x1f1837,_0x4b304e){_0x1f1837=_0x1f1837-0x0;var _0x25ab57=_0xa90f[_0x1f1837];return _0x25ab57;};'use strict';var _=require('lodash');var util=require(_0xfa90('0x0'));var logger=require(_0xfa90('0x1'))(_0xfa90('0x2'));var moment=require(_0xfa90('0x3'));var BPromise=require(_0xfa90('0x4'));var rp=require(_0xfa90('0x5'));var fs=require('fs');var path=require(_0xfa90('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfa90('0x7'));module[_0xfa90('0x8')]=function(_0x12fcd9,_0x39c955){return _0x12fcd9[_0xfa90('0x9')](_0xfa90('0xa'),attributes,{'tableName':_0xfa90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 259bbcb..c5d3046 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x88f8ca,_0x1e419a){var _0x46f4b1=function(_0x5a21a1){while(--_0x5a21a1){_0x88f8ca['push'](_0x88f8ca['shift']());}};_0x46f4b1(++_0x1e419a);}(_0xadb5,0xad));var _0x5adb=function(_0x1399d9,_0x58e6fc){_0x1399d9=_0x1399d9-0x0;var _0x5329f7=_0xadb5[_0x1399d9];return _0x5329f7;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x24c5dc,_0x135b35){_0x24c5dc=_0x24c5dc-0x0;var _0x2bb3db=_0x7a54[_0x24c5dc];return _0x2bb3db;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
index 71ce8e5..b15be1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd23=['get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./mailSubstatus.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbd23,0x188));var _0x3bd2=function(_0x42f6c6,_0x3bb2fc){_0x42f6c6=_0x42f6c6-0x0;var _0x45103c=_0xbd23[_0x42f6c6];return _0x45103c;};'use strict';var multer=require(_0x3bd2('0x0'));var util=require(_0x3bd2('0x1'));var path=require(_0x3bd2('0x2'));var timeout=require(_0x3bd2('0x3'));var express=require(_0x3bd2('0x4'));var router=express[_0x3bd2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3bd2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3bd2('0x7'));router[_0x3bd2('0x8')]('/',auth[_0x3bd2('0x9')](),controller['index']);router['get'](_0x3bd2('0xa'),auth[_0x3bd2('0x9')](),controller[_0x3bd2('0xb')]);router[_0x3bd2('0x8')](_0x3bd2('0xc'),auth[_0x3bd2('0x9')](),controller[_0x3bd2('0xd')]);router[_0x3bd2('0xe')]('/',auth['isAuthenticated'](),controller[_0x3bd2('0xf')]);router[_0x3bd2('0x10')](_0x3bd2('0xc'),auth[_0x3bd2('0x9')](),controller[_0x3bd2('0x11')]);router[_0x3bd2('0x12')](_0x3bd2('0xc'),auth[_0x3bd2('0x9')](),controller[_0x3bd2('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x22ab=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x4c5f38,_0x5d08ef){var _0x55d303=function(_0x522eaa){while(--_0x522eaa){_0x4c5f38['push'](_0x4c5f38['shift']());}};_0x55d303(++_0x5d08ef);}(_0x22ab,0x129));var _0xb22a=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0x22ab[_0x1db831];return _0x39ba56;};'use strict';var multer=require('multer');var util=require(_0xb22a('0x0'));var path=require('path');var timeout=require(_0xb22a('0x1'));var express=require(_0xb22a('0x2'));var router=express[_0xb22a('0x3')]();var fs_extra=require(_0xb22a('0x4'));var auth=require(_0xb22a('0x5'));var interaction=require(_0xb22a('0x6'));var config=require('../../config/environment');var controller=require(_0xb22a('0x7'));router[_0xb22a('0x8')]('/',auth[_0xb22a('0x9')](),controller[_0xb22a('0xa')]);router['get'](_0xb22a('0xb'),auth[_0xb22a('0x9')](),controller['describe']);router['get'](_0xb22a('0xc'),auth[_0xb22a('0x9')](),controller[_0xb22a('0xd')]);router['post']('/',auth[_0xb22a('0x9')](),controller[_0xb22a('0xe')]);router[_0xb22a('0xf')](_0xb22a('0xc'),auth[_0xb22a('0x9')](),controller[_0xb22a('0x10')]);router[_0xb22a('0x11')](_0xb22a('0xc'),auth[_0xb22a('0x9')](),controller[_0xb22a('0x12')]);module[_0xb22a('0x13')]=router;
\ No newline at end of file
index 34132cc..0b16e72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7278=['name','sequelize','exports','STRING'];(function(_0x373ba3,_0x265ccc){var _0x151f21=function(_0x35f419){while(--_0x35f419){_0x373ba3['push'](_0x373ba3['shift']());}};_0x151f21(++_0x265ccc);}(_0x7278,0x161));var _0x8727=function(_0x413491,_0x38af20){_0x413491=_0x413491-0x0;var _0x5ab810=_0x7278[_0x413491];return _0x5ab810;};'use strict';var Sequelize=require(_0x8727('0x0'));module[_0x8727('0x1')]={'name':{'type':Sequelize[_0x8727('0x2')],'unique':_0x8727('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8727('0x2')]}};
\ No newline at end of file
+var _0xb4c7=['STRING','name','sequelize','exports'];(function(_0x5bb86c,_0x3ff793){var _0x4be99f=function(_0xfc0387){while(--_0xfc0387){_0x5bb86c['push'](_0x5bb86c['shift']());}};_0x4be99f(++_0x3ff793);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x53e08f,_0x2d7eb1){_0x53e08f=_0x53e08f-0x0;var _0x1d8106=_0xb4c7[_0x53e08f];return _0x1d8106;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'unique':_0x7b4c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7b4c('0x2')]}};
\ No newline at end of file
index 5404b5e..ba1bf8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99b4=['../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','stack','name','send','index','map','MailSubstatus','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','type','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5aa1f6,_0x1c4805){var _0x36fc64=function(_0x2b88f3){while(--_0x2b88f3){_0x5aa1f6['push'](_0x5aa1f6['shift']());}};_0x36fc64(++_0x1c4805);}(_0x99b4,0x1da));var _0x499b=function(_0x219d11,_0x37765f){_0x219d11=_0x219d11-0x0;var _0x18e019=_0x99b4[_0x219d11];return _0x18e019;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x499b('0x0'));var jsonpatch=require(_0x499b('0x1'));var rp=require(_0x499b('0x2'));var moment=require(_0x499b('0x3'));var BPromise=require(_0x499b('0x4'));var Mustache=require(_0x499b('0x5'));var util=require(_0x499b('0x6'));var path=require('path');var sox=require(_0x499b('0x7'));var csv=require(_0x499b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x499b('0x9'));var squel=require('squel');var crypto=require(_0x499b('0xa'));var jsforce=require(_0x499b('0xb'));var deskjs=require(_0x499b('0xc'));var toCsv=require(_0x499b('0x8'));var querystring=require('querystring');var Papa=require(_0x499b('0xd'));var Redis=require('ioredis');var authService=require(_0x499b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x499b('0xf'));var hardwareService=require(_0x499b('0x10'));var logger=require(_0x499b('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x499b('0x12'));var licenseUtil=require(_0x499b('0x13'));var db=require(_0x499b('0x14'))['db'];function respondWithStatusCode(_0x3650ed,_0x50175d){_0x50175d=_0x50175d||0xcc;return function(_0x128c0c){if(_0x128c0c){return _0x3650ed[_0x499b('0x15')](_0x50175d);}return _0x3650ed[_0x499b('0x16')](_0x50175d)[_0x499b('0x17')]();};}function respondWithResult(_0x2a8499,_0x33a4cb){_0x33a4cb=_0x33a4cb||0xc8;return function(_0xb5246a){if(_0xb5246a){return _0x2a8499['status'](_0x33a4cb)[_0x499b('0x18')](_0xb5246a);}};}function respondWithFilteredResult(_0x38ce00,_0x3e8ea3){return function(_0x3a731b){if(_0x3a731b){var _0x15182e=typeof _0x3e8ea3[_0x499b('0x19')]===_0x499b('0x1a')&&typeof _0x3e8ea3['limit']===_0x499b('0x1a');var _0x2c5f51=_0x3a731b[_0x499b('0x1b')];var _0x21a398=_0x15182e?0x0:_0x3e8ea3['offset'];var _0x5207ff=_0x15182e?_0x3a731b[_0x499b('0x1b')]:_0x3e8ea3[_0x499b('0x19')]+_0x3e8ea3[_0x499b('0x1c')];var _0x823523;if(_0x5207ff>=_0x2c5f51){_0x5207ff=_0x2c5f51;_0x823523=0xc8;}else{_0x823523=0xce;}_0x38ce00['status'](_0x823523);return _0x38ce00[_0x499b('0x1d')]('Content-Range',_0x21a398+'-'+_0x5207ff+'/'+_0x2c5f51)[_0x499b('0x18')](_0x3a731b);}return null;};}function patchUpdates(_0x3233be){return function(_0x2c7aa1){try{jsonpatch[_0x499b('0x1e')](_0x2c7aa1,_0x3233be,!![]);}catch(_0xd4917){return BPromise[_0x499b('0x1f')](_0xd4917);}return _0x2c7aa1['save']();};}function saveUpdates(_0x5831d3,_0x188451){return function(_0x408019){if(_0x408019){return _0x408019[_0x499b('0x20')](_0x5831d3)[_0x499b('0x21')](function(_0x3b0ce1){return _0x3b0ce1;});}return null;};}function removeEntity(_0x81bc6d,_0x1950d3){return function(_0x3a9011){if(_0x3a9011){return _0x3a9011['destroy']()[_0x499b('0x21')](function(){_0x81bc6d['status'](0xcc)[_0x499b('0x17')]();});}};}function handleEntityNotFound(_0x5d7353,_0x51d772){return function(_0x24dd31){if(!_0x24dd31){_0x5d7353[_0x499b('0x15')](0x194);}return _0x24dd31;};}function handleError(_0x20a905,_0x1ad88e){_0x1ad88e=_0x1ad88e||0x1f4;return function(_0x57a6f3){logger['error'](_0x57a6f3[_0x499b('0x22')]);if(_0x57a6f3[_0x499b('0x23')]){delete _0x57a6f3[_0x499b('0x23')];}_0x20a905[_0x499b('0x16')](_0x1ad88e)[_0x499b('0x24')](_0x57a6f3);};}exports[_0x499b('0x25')]=function(_0x46c7b8,_0x3f5765){var _0x3591b4={},_0x397ad0={},_0x5e6427={'count':0x0,'rows':[]};var _0x37bfc6=_[_0x499b('0x26')](db[_0x499b('0x27')]['rawAttributes'],function(_0x19626c){return{'name':_0x19626c[_0x499b('0x28')],'type':_0x19626c['type'][_0x499b('0x29')]};});_0x397ad0[_0x499b('0x2a')]=_[_0x499b('0x26')](_0x37bfc6,_0x499b('0x23'));_0x397ad0[_0x499b('0x2b')]=_['keys'](_0x46c7b8[_0x499b('0x2b')]);_0x397ad0[_0x499b('0x2c')]=_[_0x499b('0x2d')](_0x397ad0[_0x499b('0x2a')],_0x397ad0[_0x499b('0x2b')]);_0x3591b4[_0x499b('0x2e')]=_[_0x499b('0x2d')](_0x397ad0['model'],qs[_0x499b('0x2f')](_0x46c7b8[_0x499b('0x2b')][_0x499b('0x2f')]));_0x3591b4['attributes']=_0x3591b4['attributes'][_0x499b('0x30')]?_0x3591b4['attributes']:_0x397ad0[_0x499b('0x2a')];if(!_0x46c7b8[_0x499b('0x2b')][_0x499b('0x31')]('nolimit')){_0x3591b4[_0x499b('0x1c')]=qs[_0x499b('0x1c')](_0x46c7b8[_0x499b('0x2b')][_0x499b('0x1c')]);_0x3591b4[_0x499b('0x19')]=qs['offset'](_0x46c7b8[_0x499b('0x2b')][_0x499b('0x19')]);}_0x3591b4[_0x499b('0x32')]=qs[_0x499b('0x33')](_0x46c7b8[_0x499b('0x2b')][_0x499b('0x33')]);_0x3591b4['where']=qs[_0x499b('0x2c')](_['pick'](_0x46c7b8[_0x499b('0x2b')],_0x397ad0[_0x499b('0x2c')]),_0x37bfc6);if(_0x46c7b8['query'][_0x499b('0x34')]){_0x3591b4[_0x499b('0x35')]=_['merge'](_0x3591b4[_0x499b('0x35')],{'$or':_[_0x499b('0x26')](_0x37bfc6,function(_0x49b07f){if(_0x49b07f[_0x499b('0x36')]!=='VIRTUAL'){var _0x41cc57={};_0x41cc57[_0x49b07f[_0x499b('0x23')]]={'$like':'%'+_0x46c7b8[_0x499b('0x2b')]['filter']+'%'};return _0x41cc57;}})});}_0x3591b4=_[_0x499b('0x37')]({},_0x3591b4,_0x46c7b8[_0x499b('0x38')]);var _0x5ce8f0={'where':_0x3591b4[_0x499b('0x35')]};return db['MailSubstatus'][_0x499b('0x1b')](_0x5ce8f0)['then'](function(_0x235db9){_0x5e6427[_0x499b('0x1b')]=_0x235db9;if(_0x46c7b8['query'][_0x499b('0x39')]){_0x3591b4[_0x499b('0x3a')]=[{'all':!![]}];}return db[_0x499b('0x27')][_0x499b('0x3b')](_0x3591b4);})[_0x499b('0x21')](function(_0x19e95f){_0x5e6427[_0x499b('0x3c')]=_0x19e95f;return _0x5e6427;})[_0x499b('0x21')](respondWithFilteredResult(_0x3f5765,_0x3591b4))[_0x499b('0x3d')](handleError(_0x3f5765,null));};exports[_0x499b('0x3e')]=function(_0x185ea1,_0x1358d5){var _0x412b55={'raw':!![],'where':{'id':_0x185ea1[_0x499b('0x3f')]['id']}},_0x41850a={};_0x41850a[_0x499b('0x2a')]=_[_0x499b('0x40')](db['MailSubstatus'][_0x499b('0x41')]);_0x41850a[_0x499b('0x2b')]=_[_0x499b('0x40')](_0x185ea1[_0x499b('0x2b')]);_0x41850a[_0x499b('0x2c')]=_[_0x499b('0x2d')](_0x41850a[_0x499b('0x2a')],_0x41850a[_0x499b('0x2b')]);_0x412b55[_0x499b('0x2e')]=_[_0x499b('0x2d')](_0x41850a[_0x499b('0x2a')],qs['fields'](_0x185ea1['query'][_0x499b('0x2f')]));_0x412b55['attributes']=_0x412b55[_0x499b('0x2e')][_0x499b('0x30')]?_0x412b55[_0x499b('0x2e')]:_0x41850a[_0x499b('0x2a')];if(_0x185ea1[_0x499b('0x2b')]['includeAll']){_0x412b55[_0x499b('0x3a')]=[{'all':!![]}];}_0x412b55=_[_0x499b('0x37')]({},_0x412b55,_0x185ea1[_0x499b('0x38')]);return db[_0x499b('0x27')][_0x499b('0x42')](_0x412b55)[_0x499b('0x21')](handleEntityNotFound(_0x1358d5,null))[_0x499b('0x21')](respondWithResult(_0x1358d5,null))['catch'](handleError(_0x1358d5,null));};exports['create']=function(_0x203566,_0x175c04){return db[_0x499b('0x27')][_0x499b('0x43')](_0x203566['body'],{})[_0x499b('0x21')](respondWithResult(_0x175c04,0xc9))[_0x499b('0x3d')](handleError(_0x175c04,null));};exports[_0x499b('0x20')]=function(_0x2f1c72,_0x44c895){if(_0x2f1c72[_0x499b('0x44')]['id']){delete _0x2f1c72[_0x499b('0x44')]['id'];}return db[_0x499b('0x27')][_0x499b('0x42')]({'where':{'id':_0x2f1c72[_0x499b('0x3f')]['id']}})[_0x499b('0x21')](handleEntityNotFound(_0x44c895,null))[_0x499b('0x21')](saveUpdates(_0x2f1c72[_0x499b('0x44')],null))['then'](respondWithResult(_0x44c895,null))[_0x499b('0x3d')](handleError(_0x44c895,null));};exports['destroy']=function(_0x23e20a,_0x54b504){return db['MailSubstatus']['find']({'where':{'id':_0x23e20a[_0x499b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x54b504,null))[_0x499b('0x21')](removeEntity(_0x54b504,null))[_0x499b('0x3d')](handleError(_0x54b504,null));};exports[_0x499b('0x45')]=function(_0x5a7711,_0x5b7c37){return db[_0x499b('0x27')][_0x499b('0x45')]()[_0x499b('0x21')](respondWithResult(_0x5b7c37,null))[_0x499b('0x3d')](handleError(_0x5b7c37,null));};
\ No newline at end of file
+var _0xdff2=['sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','hasOwnProperty','order'];(function(_0x304b67,_0x31cb39){var _0x493afb=function(_0x21dce3){while(--_0x21dce3){_0x304b67['push'](_0x304b67['shift']());}};_0x493afb(++_0x31cb39);}(_0xdff2,0x1e7));var _0x2dff=function(_0x2fe4eb,_0x3b0290){_0x2fe4eb=_0x2fe4eb-0x0;var _0x4fca9a=_0xdff2[_0x2fe4eb];return _0x4fca9a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2dff('0x0'));var zipdir=require(_0x2dff('0x1'));var jsonpatch=require(_0x2dff('0x2'));var rp=require(_0x2dff('0x3'));var moment=require(_0x2dff('0x4'));var BPromise=require(_0x2dff('0x5'));var Mustache=require(_0x2dff('0x6'));var util=require('util');var path=require(_0x2dff('0x7'));var sox=require(_0x2dff('0x8'));var csv=require(_0x2dff('0x9'));var ejs=require(_0x2dff('0xa'));var fs=require('fs');var fs_extra=require(_0x2dff('0xb'));var _=require(_0x2dff('0xc'));var squel=require(_0x2dff('0xd'));var crypto=require(_0x2dff('0xe'));var jsforce=require(_0x2dff('0xf'));var deskjs=require(_0x2dff('0x10'));var toCsv=require(_0x2dff('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2dff('0x11'));var authService=require(_0x2dff('0x12'));var qs=require(_0x2dff('0x13'));var as=require(_0x2dff('0x14'));var hardwareService=require(_0x2dff('0x15'));var logger=require(_0x2dff('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x2dff('0x17'));var licenseUtil=require(_0x2dff('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30de97,_0x13fe09){_0x13fe09=_0x13fe09||0xcc;return function(_0x3f034f){if(_0x3f034f){return _0x30de97['sendStatus'](_0x13fe09);}return _0x30de97['status'](_0x13fe09)['end']();};}function respondWithResult(_0x2e3641,_0x1ce504){_0x1ce504=_0x1ce504||0xc8;return function(_0x2ef302){if(_0x2ef302){return _0x2e3641[_0x2dff('0x19')](_0x1ce504)[_0x2dff('0x1a')](_0x2ef302);}};}function respondWithFilteredResult(_0x531851,_0x53fcd7){return function(_0x302dcf){if(_0x302dcf){var _0xb6486e=typeof _0x53fcd7['offset']===_0x2dff('0x1b')&&typeof _0x53fcd7[_0x2dff('0x1c')]===_0x2dff('0x1b');var _0x3195b1=_0x302dcf[_0x2dff('0x1d')];var _0x56228e=_0xb6486e?0x0:_0x53fcd7[_0x2dff('0x1e')];var _0xbee7b9=_0xb6486e?_0x302dcf[_0x2dff('0x1d')]:_0x53fcd7['offset']+_0x53fcd7[_0x2dff('0x1c')];var _0x2aecac;if(_0xbee7b9>=_0x3195b1){_0xbee7b9=_0x3195b1;_0x2aecac=0xc8;}else{_0x2aecac=0xce;}_0x531851[_0x2dff('0x19')](_0x2aecac);return _0x531851[_0x2dff('0x1f')](_0x2dff('0x20'),_0x56228e+'-'+_0xbee7b9+'/'+_0x3195b1)[_0x2dff('0x1a')](_0x302dcf);}return null;};}function patchUpdates(_0x423de3){return function(_0x39b0bf){try{jsonpatch[_0x2dff('0x21')](_0x39b0bf,_0x423de3,!![]);}catch(_0x3862a1){return BPromise[_0x2dff('0x22')](_0x3862a1);}return _0x39b0bf[_0x2dff('0x23')]();};}function saveUpdates(_0x2d0095,_0x3b5716){return function(_0x29b752){if(_0x29b752){return _0x29b752[_0x2dff('0x24')](_0x2d0095)[_0x2dff('0x25')](function(_0x53687b){return _0x53687b;});}return null;};}function removeEntity(_0xff2190,_0x459d59){return function(_0x18f06a){if(_0x18f06a){return _0x18f06a['destroy']()[_0x2dff('0x25')](function(){_0xff2190[_0x2dff('0x19')](0xcc)[_0x2dff('0x26')]();});}};}function handleEntityNotFound(_0x3873f8,_0x25d95f){return function(_0x43e717){if(!_0x43e717){_0x3873f8[_0x2dff('0x27')](0x194);}return _0x43e717;};}function handleError(_0x3da93b,_0x497d1d){_0x497d1d=_0x497d1d||0x1f4;return function(_0x235f4e){logger[_0x2dff('0x28')](_0x235f4e[_0x2dff('0x29')]);if(_0x235f4e['name']){delete _0x235f4e[_0x2dff('0x2a')];}_0x3da93b[_0x2dff('0x19')](_0x497d1d)[_0x2dff('0x2b')](_0x235f4e);};}exports[_0x2dff('0x2c')]=function(_0x246640,_0x1ff5f4){var _0x16ec53={},_0x110aad={},_0x576bdb={'count':0x0,'rows':[]};var _0x28c4e5=_[_0x2dff('0x2d')](db[_0x2dff('0x2e')][_0x2dff('0x2f')],function(_0x406669){return{'name':_0x406669[_0x2dff('0x30')],'type':_0x406669[_0x2dff('0x31')][_0x2dff('0x32')]};});_0x110aad[_0x2dff('0x33')]=_[_0x2dff('0x2d')](_0x28c4e5,_0x2dff('0x2a'));_0x110aad['query']=_[_0x2dff('0x34')](_0x246640[_0x2dff('0x35')]);_0x110aad[_0x2dff('0x36')]=_['intersection'](_0x110aad['model'],_0x110aad[_0x2dff('0x35')]);_0x16ec53['attributes']=_['intersection'](_0x110aad[_0x2dff('0x33')],qs['fields'](_0x246640[_0x2dff('0x35')][_0x2dff('0x37')]));_0x16ec53['attributes']=_0x16ec53[_0x2dff('0x38')]['length']?_0x16ec53[_0x2dff('0x38')]:_0x110aad[_0x2dff('0x33')];if(!_0x246640[_0x2dff('0x35')][_0x2dff('0x39')]('nolimit')){_0x16ec53[_0x2dff('0x1c')]=qs[_0x2dff('0x1c')](_0x246640['query'][_0x2dff('0x1c')]);_0x16ec53[_0x2dff('0x1e')]=qs[_0x2dff('0x1e')](_0x246640[_0x2dff('0x35')][_0x2dff('0x1e')]);}_0x16ec53[_0x2dff('0x3a')]=qs[_0x2dff('0x3b')](_0x246640['query'][_0x2dff('0x3b')]);_0x16ec53[_0x2dff('0x3c')]=qs[_0x2dff('0x36')](_[_0x2dff('0x3d')](_0x246640[_0x2dff('0x35')],_0x110aad['filters']),_0x28c4e5);if(_0x246640[_0x2dff('0x35')]['filter']){_0x16ec53[_0x2dff('0x3c')]=_[_0x2dff('0x3e')](_0x16ec53[_0x2dff('0x3c')],{'$or':_[_0x2dff('0x2d')](_0x28c4e5,function(_0x5f1634){if(_0x5f1634[_0x2dff('0x31')]!==_0x2dff('0x3f')){var _0x15fc9c={};_0x15fc9c[_0x5f1634[_0x2dff('0x2a')]]={'$like':'%'+_0x246640['query'][_0x2dff('0x40')]+'%'};return _0x15fc9c;}})});}_0x16ec53=_['merge']({},_0x16ec53,_0x246640[_0x2dff('0x41')]);var _0x5da40f={'where':_0x16ec53[_0x2dff('0x3c')]};return db[_0x2dff('0x2e')]['count'](_0x5da40f)[_0x2dff('0x25')](function(_0xde2b0d){_0x576bdb['count']=_0xde2b0d;if(_0x246640[_0x2dff('0x35')][_0x2dff('0x42')]){_0x16ec53[_0x2dff('0x43')]=[{'all':!![]}];}return db[_0x2dff('0x2e')][_0x2dff('0x44')](_0x16ec53);})['then'](function(_0x348ec3){_0x576bdb['rows']=_0x348ec3;return _0x576bdb;})['then'](respondWithFilteredResult(_0x1ff5f4,_0x16ec53))[_0x2dff('0x45')](handleError(_0x1ff5f4,null));};exports[_0x2dff('0x46')]=function(_0x4b6c09,_0x2ce415){var _0xa013b8={'raw':!![],'where':{'id':_0x4b6c09[_0x2dff('0x47')]['id']}},_0x33243e={};_0x33243e['model']=_[_0x2dff('0x34')](db[_0x2dff('0x2e')][_0x2dff('0x2f')]);_0x33243e[_0x2dff('0x35')]=_[_0x2dff('0x34')](_0x4b6c09[_0x2dff('0x35')]);_0x33243e[_0x2dff('0x36')]=_[_0x2dff('0x48')](_0x33243e[_0x2dff('0x33')],_0x33243e[_0x2dff('0x35')]);_0xa013b8[_0x2dff('0x38')]=_[_0x2dff('0x48')](_0x33243e['model'],qs[_0x2dff('0x37')](_0x4b6c09[_0x2dff('0x35')][_0x2dff('0x37')]));_0xa013b8[_0x2dff('0x38')]=_0xa013b8['attributes']['length']?_0xa013b8[_0x2dff('0x38')]:_0x33243e['model'];if(_0x4b6c09[_0x2dff('0x35')]['includeAll']){_0xa013b8[_0x2dff('0x43')]=[{'all':!![]}];}_0xa013b8=_[_0x2dff('0x3e')]({},_0xa013b8,_0x4b6c09[_0x2dff('0x41')]);return db[_0x2dff('0x2e')][_0x2dff('0x49')](_0xa013b8)['then'](handleEntityNotFound(_0x2ce415,null))['then'](respondWithResult(_0x2ce415,null))['catch'](handleError(_0x2ce415,null));};exports['create']=function(_0x3bd214,_0x37e61f){return db[_0x2dff('0x2e')][_0x2dff('0x4a')](_0x3bd214[_0x2dff('0x4b')],{})['then'](respondWithResult(_0x37e61f,0xc9))[_0x2dff('0x45')](handleError(_0x37e61f,null));};exports['update']=function(_0x489554,_0x5a4744){if(_0x489554[_0x2dff('0x4b')]['id']){delete _0x489554[_0x2dff('0x4b')]['id'];}return db[_0x2dff('0x2e')][_0x2dff('0x49')]({'where':{'id':_0x489554[_0x2dff('0x47')]['id']}})[_0x2dff('0x25')](handleEntityNotFound(_0x5a4744,null))[_0x2dff('0x25')](saveUpdates(_0x489554[_0x2dff('0x4b')],null))[_0x2dff('0x25')](respondWithResult(_0x5a4744,null))[_0x2dff('0x45')](handleError(_0x5a4744,null));};exports[_0x2dff('0x4c')]=function(_0x4f1048,_0xe17ebb){return db[_0x2dff('0x2e')][_0x2dff('0x49')]({'where':{'id':_0x4f1048[_0x2dff('0x47')]['id']}})[_0x2dff('0x25')](handleEntityNotFound(_0xe17ebb,null))[_0x2dff('0x25')](removeEntity(_0xe17ebb,null))[_0x2dff('0x45')](handleError(_0xe17ebb,null));};exports[_0x2dff('0x4d')]=function(_0x17b976,_0x5a3314){return db[_0x2dff('0x2e')][_0x2dff('0x4d')]()[_0x2dff('0x25')](respondWithResult(_0x5a3314,null))[_0x2dff('0x45')](handleError(_0x5a3314,null));};
\ No newline at end of file
index f9b4218..b3d7350 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe394=['hook','exports','MailSubstatus','emit','hasOwnProperty'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xe394,0x151));var _0x4e39=function(_0x2f2377,_0x11cc21){_0x2f2377=_0x2f2377-0x0;var _0x441e6b=_0xe394[_0x2f2377];return _0x441e6b;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0x4e39('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x2ab696){return function(_0x32166a,_0x30cc20,_0x20bec2){MailSubstatusEvents[_0x4e39('0x1')](_0x2ab696+':'+_0x32166a['id'],_0x32166a);MailSubstatusEvents[_0x4e39('0x1')](_0x2ab696,_0x32166a);_0x20bec2(null);};}for(var e in events){if(events[_0x4e39('0x2')](e)){var event=events[e];MailSubstatus[_0x4e39('0x3')](e,emitEvent(event));}}module[_0x4e39('0x4')]=MailSubstatusEvents;
\ No newline at end of file
+var _0x8a25=['../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x8a25,0x19f));var _0x58a2=function(_0x5cf852,_0x27b54e){_0x5cf852=_0x5cf852-0x0;var _0x2d4a8e=_0x8a25[_0x5cf852];return _0x2d4a8e;};'use strict';var EventEmitter=require(_0x58a2('0x0'));var MailSubstatus=require(_0x58a2('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x58a2('0x2')](0x0);var events={'afterUpdate':_0x58a2('0x3')};function emitEvent(_0x2af7a7){return function(_0x29b911,_0x35d25e,_0x3b130d){MailSubstatusEvents[_0x58a2('0x4')](_0x2af7a7+':'+_0x29b911['id'],_0x29b911);MailSubstatusEvents['emit'](_0x2af7a7,_0x29b911);_0x3b130d(null);};}for(var e in events){if(events[_0x58a2('0x5')](e)){var event=events[e];MailSubstatus[_0x58a2('0x6')](e,emitEvent(event));}}module[_0x58a2('0x7')]=MailSubstatusEvents;
\ No newline at end of file
index f9b26e8..8aa564f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e65=['mail_substatuses','update','mailSubstatus','then','catch','exports'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x7e65,0x185));var _0x57e6=function(_0x1bc41f,_0x2e6cd7){_0x1bc41f=_0x1bc41f-0x0;var _0x1f7025=_0x7e65[_0x1bc41f];return _0x1f7025;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x57e6('0x0')]=function(_0x147467){var _0x59d64a=_0x147467['models'];return _0x147467['define']('MailSubstatus',attributes,{'tableName':_0x57e6('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x14c1bb,_0x5a9f9,_0x5173c2){return _0x59d64a['Condition'][_0x57e6('0x2')]({'value':_0x14c1bb['name']},{'where':{'field':_0x57e6('0x3'),'value':_0x14c1bb['_previousDataValues']['name']}})[_0x57e6('0x4')](function(){_0x5173c2();})[_0x57e6('0x5')](function(_0x2af389){_0x5173c2(_0x2af389);});}}});};
\ No newline at end of file
+var _0xd22f=['Condition','update','name','_previousDataValues','then','./mailSubstatus.attributes','exports','models','define'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xd22f,0x1f4));var _0xfd22=function(_0x52baa9,_0x2b08c0){_0x52baa9=_0x52baa9-0x0;var _0x1d4ff7=_0xd22f[_0x52baa9];return _0x1d4ff7;};'use strict';var attributes=require(_0xfd22('0x0'));module[_0xfd22('0x1')]=function(_0x51ec69){var _0x2561fd=_0x51ec69[_0xfd22('0x2')];return _0x51ec69[_0xfd22('0x3')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x48038d,_0x10a0d6,_0x5d5d35){return _0x2561fd[_0xfd22('0x4')][_0xfd22('0x5')]({'value':_0x48038d[_0xfd22('0x6')]},{'where':{'field':'mailSubstatus','value':_0x48038d[_0xfd22('0x7')]['name']}})[_0xfd22('0x8')](function(){_0x5d5d35();})['catch'](function(_0x59662c){_0x5d5d35(_0x59662c);});}}});};
\ No newline at end of file
index 65ec8f0..00536e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe508=['request\x20sent','debug','error','code','message','result','catch','lodash','util','../../config/logger','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x1c4379,_0xe87ea){var _0x1db29d=function(_0x591224){while(--_0x591224){_0x1c4379['push'](_0x1c4379['shift']());}};_0x1db29d(++_0xe87ea);}(_0xe508,0x67));var _0x8e50=function(_0x12a530,_0x19a689){_0x12a530=_0x12a530-0x0;var _0x74d3e6=_0xe508[_0x12a530];return _0x74d3e6;};'use strict';var _=require(_0x8e50('0x0'));var util=require(_0x8e50('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e50('0x2'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8e50('0x3')][_0x8e50('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x2073b4,_0x5afa5f,_0x340c44){return new BPromise(function(_0x27c735,_0x12ebf6){return client[_0x8e50('0x5')](_0x2073b4,_0x340c44)[_0x8e50('0x6')](function(_0x4e819d){logger[_0x8e50('0x7')](_0x8e50('0x8'),_0x5afa5f,_0x8e50('0x9'));logger[_0x8e50('0xa')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x5afa5f,_0x8e50('0x9'),JSON['stringify'](_0x4e819d));if(_0x4e819d[_0x8e50('0xb')]){if(_0x4e819d[_0x8e50('0xb')][_0x8e50('0xc')]===0x1f4){logger[_0x8e50('0xb')](_0x8e50('0x8'),_0x5afa5f,_0x4e819d[_0x8e50('0xb')][_0x8e50('0xd')]);return _0x12ebf6(_0x4e819d['error'][_0x8e50('0xd')]);}logger[_0x8e50('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x5afa5f,_0x4e819d['error'][_0x8e50('0xd')]);return _0x27c735(_0x4e819d[_0x8e50('0xb')][_0x8e50('0xd')]);}else{logger[_0x8e50('0x7')]('MailSubstatus,\x20%s,\x20%s',_0x5afa5f,_0x8e50('0x9'));_0x27c735(_0x4e819d[_0x8e50('0xe')][_0x8e50('0xd')]);}})[_0x8e50('0xf')](function(_0x5849ba){logger[_0x8e50('0xb')](_0x8e50('0x8'),_0x5afa5f,_0x5849ba);_0x12ebf6(_0x5849ba);});});}
\ No newline at end of file
+var _0x3c06=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x23d388,_0x55e91a){var _0x5f5cd4=function(_0x901985){while(--_0x901985){_0x23d388['push'](_0x23d388['shift']());}};_0x5f5cd4(++_0x55e91a);}(_0x3c06,0xf7));var _0x63c0=function(_0x45c6bb,_0x2cacae){_0x45c6bb=_0x45c6bb-0x0;var _0x3d6a3f=_0x3c06[_0x45c6bb];return _0x3d6a3f;};'use strict';var _=require(_0x63c0('0x0'));var util=require(_0x63c0('0x1'));var moment=require(_0x63c0('0x2'));var BPromise=require(_0x63c0('0x3'));var rs=require(_0x63c0('0x4'));var fs=require('fs');var Redis=require(_0x63c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x63c0('0x6'));var logger=require(_0x63c0('0x7'))(_0x63c0('0x8'));var config=require(_0x63c0('0x9'));var jayson=require(_0x63c0('0xa'));var client=jayson[_0x63c0('0xb')][_0x63c0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e1f3f,_0x5929e9,_0x10fe3a){return new BPromise(function(_0x349be4,_0x1bfdda){return client[_0x63c0('0xd')](_0x4e1f3f,_0x10fe3a)[_0x63c0('0xe')](function(_0x5ed566){logger['info'](_0x63c0('0xf'),_0x5929e9,_0x63c0('0x10'));logger[_0x63c0('0x11')](_0x63c0('0x12'),_0x5929e9,_0x63c0('0x10'),JSON['stringify'](_0x5ed566));if(_0x5ed566[_0x63c0('0x13')]){if(_0x5ed566['error']['code']===0x1f4){logger[_0x63c0('0x13')](_0x63c0('0xf'),_0x5929e9,_0x5ed566['error'][_0x63c0('0x14')]);return _0x1bfdda(_0x5ed566[_0x63c0('0x13')]['message']);}logger[_0x63c0('0x13')](_0x63c0('0xf'),_0x5929e9,_0x5ed566['error']['message']);return _0x349be4(_0x5ed566[_0x63c0('0x13')][_0x63c0('0x14')]);}else{logger[_0x63c0('0x15')](_0x63c0('0xf'),_0x5929e9,_0x63c0('0x10'));_0x349be4(_0x5ed566[_0x63c0('0x16')][_0x63c0('0x14')]);}})[_0x63c0('0x17')](function(_0x35112e){logger[_0x63c0('0x13')](_0x63c0('0xf'),_0x5929e9,_0x35112e);_0x1bfdda(_0x35112e);});});}
\ No newline at end of file
index dc8933b..f2a4925 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x417b=['./mailTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x31db02,_0x330986){var _0x1b2e55=function(_0x121a87){while(--_0x121a87){_0x31db02['push'](_0x31db02['shift']());}};_0x1b2e55(++_0x330986);}(_0x417b,0x160));var _0xb417=function(_0x5e916c,_0x141f03){_0x5e916c=_0x5e916c-0x0;var _0x597767=_0x417b[_0x5e916c];return _0x597767;};'use strict';var multer=require('multer');var util=require(_0xb417('0x0'));var path=require(_0xb417('0x1'));var timeout=require(_0xb417('0x2'));var express=require(_0xb417('0x3'));var router=express[_0xb417('0x4')]();var fs_extra=require(_0xb417('0x5'));var auth=require(_0xb417('0x6'));var interaction=require(_0xb417('0x7'));var config=require('../../config/environment');var controller=require(_0xb417('0x8'));router[_0xb417('0x9')]('/',auth[_0xb417('0xa')](),controller['index']);router[_0xb417('0x9')](_0xb417('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb417('0x9')](_0xb417('0xc'),auth['isAuthenticated'](),controller[_0xb417('0xd')]);router[_0xb417('0xe')]('/',auth[_0xb417('0xa')](),controller[_0xb417('0xf')]);router[_0xb417('0x10')](_0xb417('0xc'),auth['isAuthenticated'](),controller[_0xb417('0x11')]);router[_0xb417('0x12')](_0xb417('0xc'),auth[_0xb417('0xa')](),controller['destroy']);module[_0xb417('0x13')]=router;
\ No newline at end of file
+var _0x618a=['../../components/auth/service','./mailTransferReport.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','express','Router','fs-extra'];(function(_0x5b57f8,_0x2b05c2){var _0x582158=function(_0x574c01){while(--_0x574c01){_0x5b57f8['push'](_0x5b57f8['shift']());}};_0x582158(++_0x2b05c2);}(_0x618a,0x1ec));var _0xa618=function(_0x14691c,_0xe1c878){_0x14691c=_0x14691c-0x0;var _0xbec98=_0x618a[_0x14691c];return _0xbec98;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa618('0x0'));var router=express[_0xa618('0x1')]();var fs_extra=require(_0xa618('0x2'));var auth=require(_0xa618('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa618('0x4'));router[_0xa618('0x5')]('/',auth[_0xa618('0x6')](),controller['index']);router[_0xa618('0x5')]('/describe',auth[_0xa618('0x6')](),controller['describe']);router['get'](_0xa618('0x7'),auth[_0xa618('0x6')](),controller[_0xa618('0x8')]);router[_0xa618('0x9')]('/',auth[_0xa618('0x6')](),controller[_0xa618('0xa')]);router['put'](_0xa618('0x7'),auth[_0xa618('0x6')](),controller[_0xa618('0xb')]);router[_0xa618('0xc')](_0xa618('0x7'),auth[_0xa618('0x6')](),controller[_0xa618('0xd')]);module[_0xa618('0xe')]=router;
\ No newline at end of file
index ee48354..144d1be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x9bde,0xe1));var _0xe9bd=function(_0x130dff,_0x5ec736){_0x130dff=_0x130dff-0x0;var _0x1d2f95=_0x9bde[_0x130dff];return _0x1d2f95;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0xb43b,0x1b2));var _0xbb43=function(_0x585cb4,_0x2f88e7){_0x585cb4=_0x585cb4-0x0;var _0x4f4113=_0xb43b[_0x585cb4];return _0x4f4113;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
index 74cbbc6..781705c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf767=['where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','model','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','MailTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x1467f1,_0x427b4c){var _0x279a6a=function(_0x54a137){while(--_0x54a137){_0x1467f1['push'](_0x1467f1['shift']());}};_0x279a6a(++_0x427b4c);}(_0xf767,0x1c6));var _0x7f76=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0xf767[_0xaf29da];return _0x295c51;};'use strict';var emlformat=require(_0x7f76('0x0'));var rimraf=require(_0x7f76('0x1'));var zipdir=require(_0x7f76('0x2'));var jsonpatch=require(_0x7f76('0x3'));var rp=require('request-promise');var moment=require(_0x7f76('0x4'));var BPromise=require(_0x7f76('0x5'));var Mustache=require('mustache');var util=require(_0x7f76('0x6'));var path=require(_0x7f76('0x7'));var sox=require(_0x7f76('0x8'));var csv=require(_0x7f76('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f76('0xa'));var _=require(_0x7f76('0xb'));var squel=require(_0x7f76('0xc'));var crypto=require('crypto');var jsforce=require(_0x7f76('0xd'));var deskjs=require(_0x7f76('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7f76('0xf'));var Papa=require(_0x7f76('0x10'));var Redis=require(_0x7f76('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f76('0x12'));var as=require(_0x7f76('0x13'));var hardwareService=require(_0x7f76('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7f76('0x15'));var licenseUtil=require(_0x7f76('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x440a7d,_0x27e3a1){_0x27e3a1=_0x27e3a1||0xcc;return function(_0x447b89){if(_0x447b89){return _0x440a7d[_0x7f76('0x17')](_0x27e3a1);}return _0x440a7d[_0x7f76('0x18')](_0x27e3a1)[_0x7f76('0x19')]();};}function respondWithResult(_0x1a8158,_0x3747bc){_0x3747bc=_0x3747bc||0xc8;return function(_0x424a7d){if(_0x424a7d){return _0x1a8158[_0x7f76('0x18')](_0x3747bc)[_0x7f76('0x1a')](_0x424a7d);}};}function respondWithFilteredResult(_0x5de9a6,_0x2342d4){return function(_0x122c38){if(_0x122c38){var _0x6fe525=typeof _0x2342d4[_0x7f76('0x1b')]==='undefined'&&typeof _0x2342d4[_0x7f76('0x1c')]===_0x7f76('0x1d');var _0x5522bb=_0x122c38[_0x7f76('0x1e')];var _0x2fd72d=_0x6fe525?0x0:_0x2342d4[_0x7f76('0x1b')];var _0x5d5bf3=_0x6fe525?_0x122c38[_0x7f76('0x1e')]:_0x2342d4['offset']+_0x2342d4['limit'];var _0x1c1bba;if(_0x5d5bf3>=_0x5522bb){_0x5d5bf3=_0x5522bb;_0x1c1bba=0xc8;}else{_0x1c1bba=0xce;}_0x5de9a6[_0x7f76('0x18')](_0x1c1bba);return _0x5de9a6[_0x7f76('0x1f')](_0x7f76('0x20'),_0x2fd72d+'-'+_0x5d5bf3+'/'+_0x5522bb)['json'](_0x122c38);}return null;};}function patchUpdates(_0x4e3daf){return function(_0x56ecf9){try{jsonpatch[_0x7f76('0x21')](_0x56ecf9,_0x4e3daf,!![]);}catch(_0x96f80e){return BPromise[_0x7f76('0x22')](_0x96f80e);}return _0x56ecf9[_0x7f76('0x23')]();};}function saveUpdates(_0x349ad0,_0x2bb821){return function(_0x2568bf){if(_0x2568bf){return _0x2568bf[_0x7f76('0x24')](_0x349ad0)[_0x7f76('0x25')](function(_0x6a146c){return _0x6a146c;});}return null;};}function removeEntity(_0x35b0e7,_0x58dfeb){return function(_0x1992ea){if(_0x1992ea){return _0x1992ea[_0x7f76('0x26')]()[_0x7f76('0x25')](function(){_0x35b0e7[_0x7f76('0x18')](0xcc)[_0x7f76('0x19')]();});}};}function handleEntityNotFound(_0x164a13,_0x1d958b){return function(_0xdf7762){if(!_0xdf7762){_0x164a13[_0x7f76('0x17')](0x194);}return _0xdf7762;};}function handleError(_0x484091,_0x309922){_0x309922=_0x309922||0x1f4;return function(_0x5c18de){logger[_0x7f76('0x27')](_0x5c18de[_0x7f76('0x28')]);if(_0x5c18de['name']){delete _0x5c18de[_0x7f76('0x29')];}_0x484091[_0x7f76('0x18')](_0x309922)['send'](_0x5c18de);};}exports['index']=function(_0xd3eda6,_0x38568b){var _0x3379f0={},_0x15ef3a={},_0x4ebf94={'count':0x0,'rows':[]};var _0x463125=_[_0x7f76('0x2a')](db[_0x7f76('0x2b')][_0x7f76('0x2c')],function(_0x1af3ef){return{'name':_0x1af3ef[_0x7f76('0x2d')],'type':_0x1af3ef[_0x7f76('0x2e')]['key']};});_0x15ef3a['model']=_['map'](_0x463125,_0x7f76('0x29'));_0x15ef3a[_0x7f76('0x2f')]=_[_0x7f76('0x30')](_0xd3eda6['query']);_0x15ef3a[_0x7f76('0x31')]=_[_0x7f76('0x32')](_0x15ef3a['model'],_0x15ef3a[_0x7f76('0x2f')]);_0x3379f0[_0x7f76('0x33')]=_[_0x7f76('0x32')](_0x15ef3a['model'],qs[_0x7f76('0x34')](_0xd3eda6[_0x7f76('0x2f')][_0x7f76('0x34')]));_0x3379f0['attributes']=_0x3379f0[_0x7f76('0x33')][_0x7f76('0x35')]?_0x3379f0[_0x7f76('0x33')]:_0x15ef3a['model'];if(!_0xd3eda6['query'][_0x7f76('0x36')](_0x7f76('0x37'))){_0x3379f0[_0x7f76('0x1c')]=qs['limit'](_0xd3eda6[_0x7f76('0x2f')][_0x7f76('0x1c')]);_0x3379f0[_0x7f76('0x1b')]=qs[_0x7f76('0x1b')](_0xd3eda6[_0x7f76('0x2f')][_0x7f76('0x1b')]);}_0x3379f0['order']=qs[_0x7f76('0x38')](_0xd3eda6[_0x7f76('0x2f')][_0x7f76('0x38')]);_0x3379f0[_0x7f76('0x39')]=qs['filters'](_[_0x7f76('0x3a')](_0xd3eda6[_0x7f76('0x2f')],_0x15ef3a[_0x7f76('0x31')]),_0x463125);if(_0xd3eda6[_0x7f76('0x2f')][_0x7f76('0x3b')]){_0x3379f0['where']=_[_0x7f76('0x3c')](_0x3379f0[_0x7f76('0x39')],{'$or':_[_0x7f76('0x2a')](_0x463125,function(_0x15a355){if(_0x15a355['type']!==_0x7f76('0x3d')){var _0xd43d60={};_0xd43d60[_0x15a355[_0x7f76('0x29')]]={'$like':'%'+_0xd3eda6['query'][_0x7f76('0x3b')]+'%'};return _0xd43d60;}})});}_0x3379f0=_[_0x7f76('0x3c')]({},_0x3379f0,_0xd3eda6['options']);var _0x1d13ea={'where':_0x3379f0['where']};return db[_0x7f76('0x2b')][_0x7f76('0x1e')](_0x1d13ea)[_0x7f76('0x25')](function(_0x5e9d35){_0x4ebf94[_0x7f76('0x1e')]=_0x5e9d35;if(_0xd3eda6['query'][_0x7f76('0x3e')]){_0x3379f0[_0x7f76('0x3f')]=[{'all':!![]}];}return db[_0x7f76('0x2b')][_0x7f76('0x40')](_0x3379f0);})[_0x7f76('0x25')](function(_0x567c05){_0x4ebf94['rows']=_0x567c05;return _0x4ebf94;})[_0x7f76('0x25')](respondWithFilteredResult(_0x38568b,_0x3379f0))[_0x7f76('0x41')](handleError(_0x38568b,null));};exports['show']=function(_0x56baf2,_0x36360b){var _0x28c292={'raw':!![],'where':{'id':_0x56baf2[_0x7f76('0x42')]['id']}},_0x32f7a7={};_0x32f7a7[_0x7f76('0x43')]=_[_0x7f76('0x30')](db[_0x7f76('0x2b')][_0x7f76('0x2c')]);_0x32f7a7[_0x7f76('0x2f')]=_[_0x7f76('0x30')](_0x56baf2['query']);_0x32f7a7[_0x7f76('0x31')]=_[_0x7f76('0x32')](_0x32f7a7[_0x7f76('0x43')],_0x32f7a7[_0x7f76('0x2f')]);_0x28c292[_0x7f76('0x33')]=_[_0x7f76('0x32')](_0x32f7a7['model'],qs[_0x7f76('0x34')](_0x56baf2['query'][_0x7f76('0x34')]));_0x28c292[_0x7f76('0x33')]=_0x28c292['attributes']['length']?_0x28c292['attributes']:_0x32f7a7[_0x7f76('0x43')];if(_0x56baf2[_0x7f76('0x2f')][_0x7f76('0x3e')]){_0x28c292[_0x7f76('0x3f')]=[{'all':!![]}];}_0x28c292=_[_0x7f76('0x3c')]({},_0x28c292,_0x56baf2[_0x7f76('0x44')]);return db[_0x7f76('0x2b')][_0x7f76('0x45')](_0x28c292)[_0x7f76('0x25')](handleEntityNotFound(_0x36360b,null))[_0x7f76('0x25')](respondWithResult(_0x36360b,null))[_0x7f76('0x41')](handleError(_0x36360b,null));};exports[_0x7f76('0x46')]=function(_0x1dc851,_0x3e7f6e){return db[_0x7f76('0x2b')][_0x7f76('0x46')](_0x1dc851[_0x7f76('0x47')],{})['then'](respondWithResult(_0x3e7f6e,0xc9))[_0x7f76('0x41')](handleError(_0x3e7f6e,null));};exports['update']=function(_0x1b2b55,_0x3671ae){if(_0x1b2b55[_0x7f76('0x47')]['id']){delete _0x1b2b55[_0x7f76('0x47')]['id'];}return db[_0x7f76('0x2b')][_0x7f76('0x45')]({'where':{'id':_0x1b2b55[_0x7f76('0x42')]['id']}})[_0x7f76('0x25')](handleEntityNotFound(_0x3671ae,null))[_0x7f76('0x25')](saveUpdates(_0x1b2b55[_0x7f76('0x47')],null))[_0x7f76('0x25')](respondWithResult(_0x3671ae,null))[_0x7f76('0x41')](handleError(_0x3671ae,null));};exports['destroy']=function(_0x4dc003,_0x588bad){return db[_0x7f76('0x2b')][_0x7f76('0x45')]({'where':{'id':_0x4dc003[_0x7f76('0x42')]['id']}})[_0x7f76('0x25')](handleEntityNotFound(_0x588bad,null))['then'](removeEntity(_0x588bad,null))[_0x7f76('0x41')](handleError(_0x588bad,null));};exports[_0x7f76('0x48')]=function(_0x1f2cc2,_0x8ddcb0){return db['MailTransferReport'][_0x7f76('0x48')]()[_0x7f76('0x25')](respondWithResult(_0x8ddcb0,null))[_0x7f76('0x41')](handleError(_0x8ddcb0,null));};
\ No newline at end of file
+var _0xde2c=['undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','index','map','MailTransferReport','rawAttributes','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','keys','length','options','create','body','find','describe','eml-format','rimraf','zip-dir','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x16ef3f,_0x10c2a8){var _0x454333=function(_0x48df5f){while(--_0x48df5f){_0x16ef3f['push'](_0x16ef3f['shift']());}};_0x454333(++_0x10c2a8);}(_0xde2c,0x7a));var _0xcde2=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0xde2c[_0x22663b];return _0x310d0a;};'use strict';var emlformat=require(_0xcde2('0x0'));var rimraf=require(_0xcde2('0x1'));var zipdir=require(_0xcde2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcde2('0x3'));var moment=require('moment');var BPromise=require(_0xcde2('0x4'));var Mustache=require('mustache');var util=require(_0xcde2('0x5'));var path=require(_0xcde2('0x6'));var sox=require(_0xcde2('0x7'));var csv=require(_0xcde2('0x8'));var ejs=require(_0xcde2('0x9'));var fs=require('fs');var fs_extra=require(_0xcde2('0xa'));var _=require(_0xcde2('0xb'));var squel=require(_0xcde2('0xc'));var crypto=require(_0xcde2('0xd'));var jsforce=require(_0xcde2('0xe'));var deskjs=require(_0xcde2('0xf'));var toCsv=require(_0xcde2('0x8'));var querystring=require(_0xcde2('0x10'));var Papa=require('papaparse');var Redis=require(_0xcde2('0x11'));var authService=require(_0xcde2('0x12'));var qs=require(_0xcde2('0x13'));var as=require(_0xcde2('0x14'));var hardwareService=require(_0xcde2('0x15'));var logger=require(_0xcde2('0x16'))('api');var utils=require(_0xcde2('0x17'));var config=require(_0xcde2('0x18'));var licenseUtil=require(_0xcde2('0x19'));var db=require(_0xcde2('0x1a'))['db'];function respondWithStatusCode(_0x49814d,_0x594f6a){_0x594f6a=_0x594f6a||0xcc;return function(_0x4a2a68){if(_0x4a2a68){return _0x49814d[_0xcde2('0x1b')](_0x594f6a);}return _0x49814d[_0xcde2('0x1c')](_0x594f6a)[_0xcde2('0x1d')]();};}function respondWithResult(_0x594dc6,_0x1d338f){_0x1d338f=_0x1d338f||0xc8;return function(_0x4d1ff0){if(_0x4d1ff0){return _0x594dc6['status'](_0x1d338f)[_0xcde2('0x1e')](_0x4d1ff0);}};}function respondWithFilteredResult(_0x338520,_0x2462fe){return function(_0x51a757){if(_0x51a757){var _0x39dfcd=typeof _0x2462fe[_0xcde2('0x1f')]===_0xcde2('0x20')&&typeof _0x2462fe[_0xcde2('0x21')]===_0xcde2('0x20');var _0x2862f4=_0x51a757['count'];var _0x2d8b89=_0x39dfcd?0x0:_0x2462fe[_0xcde2('0x1f')];var _0x11ca36=_0x39dfcd?_0x51a757[_0xcde2('0x22')]:_0x2462fe[_0xcde2('0x1f')]+_0x2462fe[_0xcde2('0x21')];var _0x2d3848;if(_0x11ca36>=_0x2862f4){_0x11ca36=_0x2862f4;_0x2d3848=0xc8;}else{_0x2d3848=0xce;}_0x338520['status'](_0x2d3848);return _0x338520[_0xcde2('0x23')]('Content-Range',_0x2d8b89+'-'+_0x11ca36+'/'+_0x2862f4)[_0xcde2('0x1e')](_0x51a757);}return null;};}function patchUpdates(_0x2dff65){return function(_0xcee4e9){try{jsonpatch[_0xcde2('0x24')](_0xcee4e9,_0x2dff65,!![]);}catch(_0x1686fd){return BPromise[_0xcde2('0x25')](_0x1686fd);}return _0xcee4e9[_0xcde2('0x26')]();};}function saveUpdates(_0x3d3bd1,_0x42268c){return function(_0x54463b){if(_0x54463b){return _0x54463b[_0xcde2('0x27')](_0x3d3bd1)['then'](function(_0x45549e){return _0x45549e;});}return null;};}function removeEntity(_0x20ef12,_0x59b576){return function(_0x53dd26){if(_0x53dd26){return _0x53dd26[_0xcde2('0x28')]()[_0xcde2('0x29')](function(){_0x20ef12['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16058e,_0x4eaa26){return function(_0x2fe49c){if(!_0x2fe49c){_0x16058e[_0xcde2('0x1b')](0x194);}return _0x2fe49c;};}function handleError(_0x5e3a09,_0x50771a){_0x50771a=_0x50771a||0x1f4;return function(_0x3065d1){logger[_0xcde2('0x2a')](_0x3065d1[_0xcde2('0x2b')]);if(_0x3065d1[_0xcde2('0x2c')]){delete _0x3065d1[_0xcde2('0x2c')];}_0x5e3a09[_0xcde2('0x1c')](_0x50771a)['send'](_0x3065d1);};}exports[_0xcde2('0x2d')]=function(_0x4ab2e0,_0x701250){var _0x18f42a={},_0x50905e={},_0x238659={'count':0x0,'rows':[]};var _0x56737b=_[_0xcde2('0x2e')](db[_0xcde2('0x2f')][_0xcde2('0x30')],function(_0x52879d){return{'name':_0x52879d['fieldName'],'type':_0x52879d[_0xcde2('0x31')]['key']};});_0x50905e['model']=_['map'](_0x56737b,_0xcde2('0x2c'));_0x50905e[_0xcde2('0x32')]=_['keys'](_0x4ab2e0[_0xcde2('0x32')]);_0x50905e[_0xcde2('0x33')]=_[_0xcde2('0x34')](_0x50905e['model'],_0x50905e[_0xcde2('0x32')]);_0x18f42a[_0xcde2('0x35')]=_['intersection'](_0x50905e[_0xcde2('0x36')],qs[_0xcde2('0x37')](_0x4ab2e0['query']['fields']));_0x18f42a[_0xcde2('0x35')]=_0x18f42a[_0xcde2('0x35')]['length']?_0x18f42a[_0xcde2('0x35')]:_0x50905e[_0xcde2('0x36')];if(!_0x4ab2e0[_0xcde2('0x32')][_0xcde2('0x38')](_0xcde2('0x39'))){_0x18f42a[_0xcde2('0x21')]=qs[_0xcde2('0x21')](_0x4ab2e0[_0xcde2('0x32')][_0xcde2('0x21')]);_0x18f42a[_0xcde2('0x1f')]=qs['offset'](_0x4ab2e0['query']['offset']);}_0x18f42a['order']=qs[_0xcde2('0x3a')](_0x4ab2e0['query'][_0xcde2('0x3a')]);_0x18f42a[_0xcde2('0x3b')]=qs['filters'](_[_0xcde2('0x3c')](_0x4ab2e0[_0xcde2('0x32')],_0x50905e['filters']),_0x56737b);if(_0x4ab2e0[_0xcde2('0x32')][_0xcde2('0x3d')]){_0x18f42a[_0xcde2('0x3b')]=_['merge'](_0x18f42a[_0xcde2('0x3b')],{'$or':_[_0xcde2('0x2e')](_0x56737b,function(_0x4258a4){if(_0x4258a4[_0xcde2('0x31')]!==_0xcde2('0x3e')){var _0x18124c={};_0x18124c[_0x4258a4[_0xcde2('0x2c')]]={'$like':'%'+_0x4ab2e0[_0xcde2('0x32')][_0xcde2('0x3d')]+'%'};return _0x18124c;}})});}_0x18f42a=_[_0xcde2('0x3f')]({},_0x18f42a,_0x4ab2e0['options']);var _0x402c9f={'where':_0x18f42a[_0xcde2('0x3b')]};return db[_0xcde2('0x2f')][_0xcde2('0x22')](_0x402c9f)['then'](function(_0x5a0e46){_0x238659[_0xcde2('0x22')]=_0x5a0e46;if(_0x4ab2e0[_0xcde2('0x32')][_0xcde2('0x40')]){_0x18f42a[_0xcde2('0x41')]=[{'all':!![]}];}return db[_0xcde2('0x2f')][_0xcde2('0x42')](_0x18f42a);})[_0xcde2('0x29')](function(_0x1e2633){_0x238659['rows']=_0x1e2633;return _0x238659;})[_0xcde2('0x29')](respondWithFilteredResult(_0x701250,_0x18f42a))[_0xcde2('0x43')](handleError(_0x701250,null));};exports[_0xcde2('0x44')]=function(_0x1edcc7,_0x31947f){var _0x2075f5={'raw':!![],'where':{'id':_0x1edcc7[_0xcde2('0x45')]['id']}},_0x51cc66={};_0x51cc66[_0xcde2('0x36')]=_[_0xcde2('0x46')](db[_0xcde2('0x2f')][_0xcde2('0x30')]);_0x51cc66[_0xcde2('0x32')]=_[_0xcde2('0x46')](_0x1edcc7[_0xcde2('0x32')]);_0x51cc66[_0xcde2('0x33')]=_['intersection'](_0x51cc66[_0xcde2('0x36')],_0x51cc66['query']);_0x2075f5[_0xcde2('0x35')]=_[_0xcde2('0x34')](_0x51cc66[_0xcde2('0x36')],qs[_0xcde2('0x37')](_0x1edcc7[_0xcde2('0x32')][_0xcde2('0x37')]));_0x2075f5['attributes']=_0x2075f5[_0xcde2('0x35')][_0xcde2('0x47')]?_0x2075f5[_0xcde2('0x35')]:_0x51cc66[_0xcde2('0x36')];if(_0x1edcc7[_0xcde2('0x32')]['includeAll']){_0x2075f5[_0xcde2('0x41')]=[{'all':!![]}];}_0x2075f5=_[_0xcde2('0x3f')]({},_0x2075f5,_0x1edcc7[_0xcde2('0x48')]);return db[_0xcde2('0x2f')]['find'](_0x2075f5)[_0xcde2('0x29')](handleEntityNotFound(_0x31947f,null))['then'](respondWithResult(_0x31947f,null))[_0xcde2('0x43')](handleError(_0x31947f,null));};exports[_0xcde2('0x49')]=function(_0x572e22,_0x2baa0b){return db[_0xcde2('0x2f')][_0xcde2('0x49')](_0x572e22[_0xcde2('0x4a')],{})[_0xcde2('0x29')](respondWithResult(_0x2baa0b,0xc9))[_0xcde2('0x43')](handleError(_0x2baa0b,null));};exports[_0xcde2('0x27')]=function(_0x4a6a58,_0x7a59bd){if(_0x4a6a58[_0xcde2('0x4a')]['id']){delete _0x4a6a58[_0xcde2('0x4a')]['id'];}return db[_0xcde2('0x2f')][_0xcde2('0x4b')]({'where':{'id':_0x4a6a58[_0xcde2('0x45')]['id']}})[_0xcde2('0x29')](handleEntityNotFound(_0x7a59bd,null))[_0xcde2('0x29')](saveUpdates(_0x4a6a58[_0xcde2('0x4a')],null))['then'](respondWithResult(_0x7a59bd,null))[_0xcde2('0x43')](handleError(_0x7a59bd,null));};exports[_0xcde2('0x28')]=function(_0x42fd66,_0x12b889){return db[_0xcde2('0x2f')][_0xcde2('0x4b')]({'where':{'id':_0x42fd66[_0xcde2('0x45')]['id']}})[_0xcde2('0x29')](handleEntityNotFound(_0x12b889,null))[_0xcde2('0x29')](removeEntity(_0x12b889,null))[_0xcde2('0x43')](handleError(_0x12b889,null));};exports[_0xcde2('0x4c')]=function(_0x3dd9f3,_0x4ca45a){return db[_0xcde2('0x2f')][_0xcde2('0x4c')]()[_0xcde2('0x29')](respondWithResult(_0x4ca45a,null))[_0xcde2('0x43')](handleError(_0x4ca45a,null));};
\ No newline at end of file
index 310ff8a..241c28f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ede=['path','rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util','api','moment','bluebird','request-promise'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x6ede,0x140));var _0xe6ed=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0x6ede[_0x553150];return _0x18193d;};'use strict';var _=require('lodash');var util=require(_0xe6ed('0x0'));var logger=require('../../config/logger')(_0xe6ed('0x1'));var moment=require(_0xe6ed('0x2'));var BPromise=require(_0xe6ed('0x3'));var rp=require(_0xe6ed('0x4'));var fs=require('fs');var path=require(_0xe6ed('0x5'));var rimraf=require(_0xe6ed('0x6'));var config=require(_0xe6ed('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xe6ed('0x8')]=function(_0x1b1eb7,_0x144aeb){return _0x1b1eb7[_0xe6ed('0x9')](_0xe6ed('0xa'),attributes,{'tableName':_0xe6ed('0xb'),'paranoid':![],'indexes':[{'name':_0xe6ed('0xc'),'fields':[_0xe6ed('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x710b=['request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','api','moment','bluebird'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x710b,0x110));var _0xb710=function(_0x25bbd6,_0x18f6d3){_0x25bbd6=_0x25bbd6-0x0;var _0x3a4c78=_0x710b[_0x25bbd6];return _0x3a4c78;};'use strict';var _=require(_0xb710('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb710('0x1'));var moment=require(_0xb710('0x2'));var BPromise=require(_0xb710('0x3'));var rp=require(_0xb710('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb710('0x5'));var config=require(_0xb710('0x6'));var attributes=require(_0xb710('0x7'));module[_0xb710('0x8')]=function(_0x16de17,_0x4abace){return _0x16de17[_0xb710('0x9')](_0xb710('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xb710('0xb'),'fields':[_0xb710('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index bb38c7d..d6fea0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc237=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result'];(function(_0x297f25,_0x594be0){var _0x4b16e8=function(_0x5cccb9){while(--_0x5cccb9){_0x297f25['push'](_0x297f25['shift']());}};_0x4b16e8(++_0x594be0);}(_0xc237,0x180));var _0x7c23=function(_0x36c0d8,_0xdbe53a){_0x36c0d8=_0x36c0d8-0x0;var _0x448c8c=_0xc237[_0x36c0d8];return _0x448c8c;};'use strict';var _=require(_0x7c23('0x0'));var util=require(_0x7c23('0x1'));var moment=require(_0x7c23('0x2'));var BPromise=require(_0x7c23('0x3'));var rs=require(_0x7c23('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c23('0x5'))['db'];var utils=require(_0x7c23('0x6'));var logger=require(_0x7c23('0x7'))(_0x7c23('0x8'));var config=require(_0x7c23('0x9'));var jayson=require(_0x7c23('0xa'));var client=jayson[_0x7c23('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51711d,_0x2e82ec,_0xa17d24){return new BPromise(function(_0x7864aa,_0x4e5f58){return client[_0x7c23('0xc')](_0x51711d,_0xa17d24)[_0x7c23('0xd')](function(_0x1edff9){logger[_0x7c23('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x2e82ec,'request\x20sent');logger[_0x7c23('0xf')](_0x7c23('0x10'),_0x2e82ec,_0x7c23('0x11'),JSON[_0x7c23('0x12')](_0x1edff9));if(_0x1edff9[_0x7c23('0x13')]){if(_0x1edff9[_0x7c23('0x13')][_0x7c23('0x14')]===0x1f4){logger[_0x7c23('0x13')](_0x7c23('0x15'),_0x2e82ec,_0x1edff9['error'][_0x7c23('0x16')]);return _0x4e5f58(_0x1edff9['error'][_0x7c23('0x16')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2e82ec,_0x1edff9['error'][_0x7c23('0x16')]);return _0x7864aa(_0x1edff9[_0x7c23('0x13')][_0x7c23('0x16')]);}else{logger[_0x7c23('0xe')](_0x7c23('0x15'),_0x2e82ec,_0x7c23('0x11'));_0x7864aa(_0x1edff9[_0x7c23('0x17')][_0x7c23('0x16')]);}})['catch'](function(_0xaafbf3){logger[_0x7c23('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x2e82ec,_0xaafbf3);_0x4e5f58(_0xaafbf3);});});}
\ No newline at end of file
+var _0xa347=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x266de1,_0x42509b){var _0x5cd98e=function(_0x228e7e){while(--_0x228e7e){_0x266de1['push'](_0x266de1['shift']());}};_0x5cd98e(++_0x42509b);}(_0xa347,0x1a1));var _0x7a34=function(_0x2f2ed0,_0x1c6435){_0x2f2ed0=_0x2f2ed0-0x0;var _0x250b0d=_0xa347[_0x2f2ed0];return _0x250b0d;};'use strict';var _=require(_0x7a34('0x0'));var util=require(_0x7a34('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7a34('0x2'));var fs=require('fs');var Redis=require(_0x7a34('0x3'));var db=require(_0x7a34('0x4'))['db'];var utils=require(_0x7a34('0x5'));var logger=require(_0x7a34('0x6'))(_0x7a34('0x7'));var config=require(_0x7a34('0x8'));var jayson=require(_0x7a34('0x9'));var client=jayson[_0x7a34('0xa')][_0x7a34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd5055a,_0x4d5287,_0x3455c4){return new BPromise(function(_0x23db69,_0x1eefac){return client[_0x7a34('0xc')](_0xd5055a,_0x3455c4)[_0x7a34('0xd')](function(_0x13d2eb){logger['info'](_0x7a34('0xe'),_0x4d5287,'request\x20sent');logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4d5287,_0x7a34('0xf'),JSON[_0x7a34('0x10')](_0x13d2eb));if(_0x13d2eb['error']){if(_0x13d2eb[_0x7a34('0x11')][_0x7a34('0x12')]===0x1f4){logger[_0x7a34('0x11')](_0x7a34('0xe'),_0x4d5287,_0x13d2eb[_0x7a34('0x11')]['message']);return _0x1eefac(_0x13d2eb['error'][_0x7a34('0x13')]);}logger[_0x7a34('0x11')](_0x7a34('0xe'),_0x4d5287,_0x13d2eb[_0x7a34('0x11')][_0x7a34('0x13')]);return _0x23db69(_0x13d2eb[_0x7a34('0x11')][_0x7a34('0x13')]);}else{logger['info'](_0x7a34('0xe'),_0x4d5287,_0x7a34('0xf'));_0x23db69(_0x13d2eb[_0x7a34('0x14')][_0x7a34('0x13')]);}})[_0x7a34('0x15')](function(_0xdb5be6){logger[_0x7a34('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x4d5287,_0xdb5be6);_0x1eefac(_0xdb5be6);});});}
\ No newline at end of file
index f2ac82b..08534c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x127a=['update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','/describe','isAuthenticated','/:id','show','post','create'];(function(_0x469ed8,_0x4f4030){var _0x406759=function(_0x4cf1b3){while(--_0x4cf1b3){_0x469ed8['push'](_0x469ed8['shift']());}};_0x406759(++_0x4f4030);}(_0x127a,0xca));var _0xa127=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x127a[_0x166d93];return _0xba708;};'use strict';var multer=require(_0xa127('0x0'));var util=require(_0xa127('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa127('0x2'));var router=express[_0xa127('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa127('0x4'));var interaction=require(_0xa127('0x5'));var config=require('../../config/environment');var controller=require(_0xa127('0x6'));router[_0xa127('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa127('0x7')](_0xa127('0x8'),auth[_0xa127('0x9')](),controller['describe']);router[_0xa127('0x7')](_0xa127('0xa'),auth[_0xa127('0x9')](),controller[_0xa127('0xb')]);router[_0xa127('0xc')]('/',auth['isAuthenticated'](),controller[_0xa127('0xd')]);router['put'](_0xa127('0xa'),auth[_0xa127('0x9')](),controller[_0xa127('0xe')]);router[_0xa127('0xf')]('/:id',auth[_0xa127('0x9')](),controller[_0xa127('0x10')]);module[_0xa127('0x11')]=router;
\ No newline at end of file
+var _0xf95b=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0xf95b,0xf3));var _0xbf95=function(_0x525445,_0x4f8f42){_0x525445=_0x525445-0x0;var _0x48b600=_0xf95b[_0x525445];return _0x48b600;};'use strict';var multer=require(_0xbf95('0x0'));var util=require(_0xbf95('0x1'));var path=require(_0xbf95('0x2'));var timeout=require(_0xbf95('0x3'));var express=require('express');var router=express[_0xbf95('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf95('0x5'));var interaction=require(_0xbf95('0x6'));var config=require(_0xbf95('0x7'));var controller=require(_0xbf95('0x8'));router[_0xbf95('0x9')]('/',auth[_0xbf95('0xa')](),controller[_0xbf95('0xb')]);router[_0xbf95('0x9')](_0xbf95('0xc'),auth[_0xbf95('0xa')](),controller[_0xbf95('0xd')]);router['get'](_0xbf95('0xe'),auth['isAuthenticated'](),controller[_0xbf95('0xf')]);router[_0xbf95('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbf95('0x11')](_0xbf95('0xe'),auth[_0xbf95('0xa')](),controller[_0xbf95('0x12')]);router[_0xbf95('0x13')]('/:id',auth[_0xbf95('0xa')](),controller[_0xbf95('0x14')]);module['exports']=router;
\ No newline at end of file
index c8db78c..8a493c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x591b=['DATE','getDataValue','enterAt','diff','exitAt','duration','talk:[destination]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0x591b,0x166));var _0xb591=function(_0xbd72b1,_0x1ea25f){_0xbd72b1=_0xbd72b1-0x0;var _0x47c8e3=_0x591b[_0xbd72b1];return _0x47c8e3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb591('0x0'));module[_0xb591('0x1')]={'channel':{'type':Sequelize[_0xb591('0x2')]},'membername':{'type':Sequelize[_0xb591('0x2')]},'interface':{'type':Sequelize[_0xb591('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xb591('0x3'),'comment':_0xb591('0x4')},'duration':{'type':Sequelize[_0xb591('0x5')]},'enterAt':{'type':Sequelize[_0xb591('0x6')]},'exitAt':{'type':Sequelize[_0xb591('0x6')],'set':function(_0x382b95){var _0x24a44e=moment(_0x382b95);var _0x561846=moment(this[_0xb591('0x7')](_0xb591('0x8')));var _0x51d186=_0x24a44e[_0xb591('0x9')](_0x561846,'seconds');this['setDataValue'](_0xb591('0xa'),_0x382b95);this['setDataValue'](_0xb591('0xb'),_0x51d186>=0x0?_0x51d186:null);}},'data1':{'type':Sequelize[_0xb591('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xb591('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xb591('0x2')],'comment':_0xb591('0xc')},'data4':{'type':Sequelize[_0xb591('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xb591('0x2')],'comment':_0xb591('0xd')},'role':{'type':Sequelize[_0xb591('0x2')]},'internal':{'type':Sequelize[_0xb591('0x5')]},'uniqueid':{'type':Sequelize[_0xb591('0x2')]}};
\ No newline at end of file
+var _0xfdb6=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x1fc3fb,_0x7bd93e){var _0x49878d=function(_0xbe2212){while(--_0xbe2212){_0x1fc3fb['push'](_0x1fc3fb['shift']());}};_0x49878d(++_0x7bd93e);}(_0xfdb6,0x168));var _0x6fdb=function(_0x483b4a,_0x22a742){_0x483b4a=_0x483b4a-0x0;var _0x249301=_0xfdb6[_0x483b4a];return _0x249301;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6fdb('0x0'));module[_0x6fdb('0x1')]={'channel':{'type':Sequelize[_0x6fdb('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6fdb('0x2')],'defaultValue':_0x6fdb('0x3'),'comment':_0x6fdb('0x4')},'duration':{'type':Sequelize[_0x6fdb('0x5')]},'enterAt':{'type':Sequelize[_0x6fdb('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x2448cb){var _0x2716df=moment(_0x2448cb);var _0x39f499=moment(this[_0x6fdb('0x7')](_0x6fdb('0x8')));var _0x56b860=_0x2716df[_0x6fdb('0x9')](_0x39f499,_0x6fdb('0xa'));this[_0x6fdb('0xb')]('exitAt',_0x2448cb);this['setDataValue']('duration',_0x56b860>=0x0?_0x56b860:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x6fdb('0xc')},'data2':{'type':Sequelize[_0x6fdb('0x2')],'comment':_0x6fdb('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x6fdb('0xe')},'data4':{'type':Sequelize[_0x6fdb('0x2')],'comment':_0x6fdb('0xf')},'data5':{'type':Sequelize[_0x6fdb('0x2')],'comment':_0x6fdb('0x10')},'role':{'type':Sequelize[_0x6fdb('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x6fdb('0x2')]}};
\ No newline at end of file
index 634e5a5..62d03cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0xf61c79,_0x43c6fa){var _0x127d26=function(_0x598bf6){while(--_0x598bf6){_0xf61c79['push'](_0xf61c79['shift']());}};_0x127d26(++_0x43c6fa);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));};
\ No newline at end of file
+var _0x3e74=['show','params','options','find','catch','create','body','describe','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','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x3093a0,_0x204b65){var _0x343721=function(_0x19dbb5){while(--_0x19dbb5){_0x3093a0['push'](_0x3093a0['shift']());}};_0x343721(++_0x204b65);}(_0x3e74,0x175));var _0x43e7=function(_0x58988a,_0x46549f){_0x58988a=_0x58988a-0x0;var _0x588b41=_0x3e74[_0x58988a];return _0x588b41;};'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(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));};
\ No newline at end of file
index ad4236b..2d38e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xede0=['bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api'];(function(_0x3d4961,_0x39bb61){var _0x5df582=function(_0x5cfab9){while(--_0x5cfab9){_0x3d4961['push'](_0x3d4961['shift']());}};_0x5df582(++_0x39bb61);}(_0xede0,0x1ca));var _0x0ede=function(_0x57f1db,_0x4b0090){_0x57f1db=_0x57f1db-0x0;var _0x46daa7=_0xede0[_0x57f1db];return _0x46daa7;};'use strict';var _=require(_0x0ede('0x0'));var util=require(_0x0ede('0x1'));var logger=require(_0x0ede('0x2'))(_0x0ede('0x3'));var moment=require('moment');var BPromise=require(_0x0ede('0x4'));var rp=require(_0x0ede('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ede('0x6'));var config=require(_0x0ede('0x7'));var attributes=require(_0x0ede('0x8'));module[_0x0ede('0x9')]=function(_0x43e130,_0x4a7219){return _0x43e130['define']('MemberReport',attributes,{'tableName':_0x0ede('0xa'),'paranoid':![],'indexes':[{'name':_0x0ede('0xb'),'fields':[_0x0ede('0xc'),_0x0ede('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7177=['api','moment','bluebird','request-promise','path','rimraf','./memberReport.attributes','exports','MemberReport','report_member','membername','interface','lodash','util','../../config/logger'];(function(_0x664fad,_0x268bf2){var _0xaa5fca=function(_0x4976b6){while(--_0x4976b6){_0x664fad['push'](_0x664fad['shift']());}};_0xaa5fca(++_0x268bf2);}(_0x7177,0x174));var _0x7717=function(_0x9b9c46,_0x3997a8){_0x9b9c46=_0x9b9c46-0x0;var _0x47ee52=_0x7177[_0x9b9c46];return _0x47ee52;};'use strict';var _=require(_0x7717('0x0'));var util=require(_0x7717('0x1'));var logger=require(_0x7717('0x2'))(_0x7717('0x3'));var moment=require(_0x7717('0x4'));var BPromise=require(_0x7717('0x5'));var rp=require(_0x7717('0x6'));var fs=require('fs');var path=require(_0x7717('0x7'));var rimraf=require(_0x7717('0x8'));var config=require('../../config/environment');var attributes=require(_0x7717('0x9'));module[_0x7717('0xa')]=function(_0x1b3203,_0x77c463){return _0x1b3203['define'](_0x7717('0xb'),attributes,{'tableName':_0x7717('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x7717('0xd'),_0x7717('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index d093c96..3187ec0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba0d=['info','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','attributes','limit','include','map','model','then','debug','create','body','raw','CreateMemberReport','UpdateMemberReport','update','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x1ee990,_0x27c34c){var _0x305327=function(_0x47f16b){while(--_0x47f16b){_0x1ee990['push'](_0x1ee990['shift']());}};_0x305327(++_0x27c34c);}(_0xba0d,0x8e));var _0xdba0=function(_0x50cb8e,_0x13eb4b){_0x50cb8e=_0x50cb8e-0x0;var _0x3688b4=_0xba0d[_0x50cb8e];return _0x3688b4;};'use strict';var _=require(_0xdba0('0x0'));var util=require('util');var moment=require(_0xdba0('0x1'));var BPromise=require(_0xdba0('0x2'));var rs=require(_0xdba0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdba0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdba0('0x5'))(_0xdba0('0x6'));var config=require(_0xdba0('0x7'));var jayson=require(_0xdba0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x220299,_0x3ab016,_0x423097){return new BPromise(function(_0x2c20c4,_0x5aeceb){return client[_0xdba0('0x9')](_0x220299,_0x423097)['then'](function(_0x4ff5f5){logger[_0xdba0('0xa')]('MemberReport,\x20%s,\x20%s',_0x3ab016,_0xdba0('0xb'));logger['debug'](_0xdba0('0xc'),_0x3ab016,_0xdba0('0xb'),JSON[_0xdba0('0xd')](_0x4ff5f5));if(_0x4ff5f5[_0xdba0('0xe')]){if(_0x4ff5f5[_0xdba0('0xe')][_0xdba0('0xf')]===0x1f4){logger[_0xdba0('0xe')](_0xdba0('0x10'),_0x3ab016,_0x4ff5f5['error']['message']);return _0x5aeceb(_0x4ff5f5[_0xdba0('0xe')][_0xdba0('0x11')]);}logger[_0xdba0('0xe')](_0xdba0('0x10'),_0x3ab016,_0x4ff5f5[_0xdba0('0xe')][_0xdba0('0x11')]);return _0x2c20c4(_0x4ff5f5[_0xdba0('0xe')]['message']);}else{logger[_0xdba0('0xa')](_0xdba0('0x10'),_0x3ab016,_0xdba0('0xb'));_0x2c20c4(_0x4ff5f5[_0xdba0('0x12')][_0xdba0('0x11')]);}})[_0xdba0('0x13')](function(_0x316a23){logger[_0xdba0('0xe')](_0xdba0('0x10'),_0x3ab016,_0x316a23);_0x5aeceb(_0x316a23);});});}exports[_0xdba0('0x14')]=function(_0x479a46){var _0x2b75e7=this;return new Promise(function(_0x5e954c,_0x1cdf6c){return db[_0xdba0('0x15')][_0xdba0('0x16')]({'raw':_0x479a46[_0xdba0('0x17')]?_0x479a46['options']['raw']===undefined?!![]:![]:!![],'where':_0x479a46[_0xdba0('0x17')]?_0x479a46[_0xdba0('0x17')]['where']||null:null,'attributes':_0x479a46[_0xdba0('0x17')]?_0x479a46[_0xdba0('0x17')][_0xdba0('0x18')]||null:null,'limit':_0x479a46['options']?_0x479a46[_0xdba0('0x17')][_0xdba0('0x19')]||null:null,'include':_0x479a46[_0xdba0('0x17')]?_0x479a46[_0xdba0('0x17')][_0xdba0('0x1a')]?_[_0xdba0('0x1b')](_0x479a46[_0xdba0('0x17')][_0xdba0('0x1a')],function(_0x21932d){return{'model':db[_0x21932d[_0xdba0('0x1c')]],'as':_0x21932d['as'],'attributes':_0x21932d[_0xdba0('0x18')],'include':_0x21932d['include']?_[_0xdba0('0x1b')](_0x21932d[_0xdba0('0x1a')],function(_0x4873de){return{'model':db[_0x4873de[_0xdba0('0x1c')]],'as':_0x4873de['as'],'attributes':_0x4873de['attributes'],'include':_0x4873de[_0xdba0('0x1a')]?_[_0xdba0('0x1b')](_0x4873de['include'],function(_0x4ad40f){return{'model':db[_0x4ad40f[_0xdba0('0x1c')]],'as':_0x4ad40f['as'],'attributes':_0x4ad40f[_0xdba0('0x18')]};}):[]};}):[]};}):[]:[]})[_0xdba0('0x1d')](function(_0x3c7f03){logger[_0xdba0('0xa')](_0xdba0('0x14'),_0x479a46);logger[_0xdba0('0x1e')]('GetMemberReport',_0x479a46,JSON['stringify'](_0x3c7f03));_0x5e954c(_0x3c7f03);})[_0xdba0('0x13')](function(_0x1d91a3){logger[_0xdba0('0xe')](_0xdba0('0x14'),_0x1d91a3['message'],_0x479a46);_0x1cdf6c(_0x2b75e7['error'](0x1f4,_0x1d91a3[_0xdba0('0x11')]));});});};exports['CreateMemberReport']=function(_0x3cb358){var _0x5b89af=this;return new Promise(function(_0x26bb2b,_0x3fe90e){return db['MemberReport'][_0xdba0('0x1f')](_0x3cb358[_0xdba0('0x20')],{'raw':_0x3cb358[_0xdba0('0x17')]?_0x3cb358[_0xdba0('0x17')][_0xdba0('0x21')]===undefined?!![]:![]:!![]})[_0xdba0('0x1d')](function(_0x2665bc){logger['info']('CreateMemberReport',_0x3cb358);logger[_0xdba0('0x1e')](_0xdba0('0x22'),_0x3cb358,JSON[_0xdba0('0xd')](_0x2665bc));_0x26bb2b(_0x2665bc);})[_0xdba0('0x13')](function(_0x1f98cf){logger['error']('CreateMemberReport',_0x1f98cf[_0xdba0('0x11')],_0x3cb358);_0x3fe90e(_0x5b89af[_0xdba0('0xe')](0x1f4,_0x1f98cf['message']));});});};exports[_0xdba0('0x23')]=function(_0x4b7734){var _0x266ff2=this;return new Promise(function(_0x9a2340,_0x398f51){return db[_0xdba0('0x15')][_0xdba0('0x24')](_0x4b7734[_0xdba0('0x20')],{'raw':_0x4b7734[_0xdba0('0x17')]?_0x4b7734['options'][_0xdba0('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b7734['options']?_0x4b7734['options'][_0xdba0('0x25')]||null:null,'attributes':_0x4b7734[_0xdba0('0x17')]?_0x4b7734['options'][_0xdba0('0x18')]||null:null,'limit':_0x4b7734[_0xdba0('0x17')]?_0x4b7734['options']['limit']||null:null})['then'](function(_0x4feb14){logger[_0xdba0('0xa')]('UpdateMemberReport',_0x4b7734);logger['debug'](_0xdba0('0x23'),_0x4b7734,JSON['stringify'](_0x4feb14));_0x9a2340(_0x4feb14);})[_0xdba0('0x13')](function(_0x21c6fb){logger[_0xdba0('0xe')](_0xdba0('0x23'),_0x21c6fb[_0xdba0('0x11')],_0x4b7734);_0x398f51(_0x266ff2[_0xdba0('0xe')](0x1f4,_0x21c6fb[_0xdba0('0x11')]));});});};
\ No newline at end of file
+var _0x2eb2=['error','MemberReport,\x20%s,\x20%s','message','MemberReport','options','raw','attributes','limit','include','map','model','GetMemberReport','stringify','catch','CreateMemberReport','body','debug','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x25f404,_0x485a38){var _0x2c0e38=function(_0x4dcbf2){while(--_0x4dcbf2){_0x25f404['push'](_0x25f404['shift']());}};_0x2c0e38(++_0x485a38);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x2eb2[_0x3b5250];return _0xc844a1;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){return client[_0x22eb('0xa')](_0x2a9850,_0x396806)[_0x22eb('0xb')](function(_0xb9c8a4){logger[_0x22eb('0xc')]('MemberReport,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'),JSON['stringify'](_0xb9c8a4));if(_0xb9c8a4[_0x22eb('0xe')]){if(_0xb9c8a4[_0x22eb('0xe')]['code']===0x1f4){logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);return _0x3375d6(_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);}logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4['error'][_0x22eb('0x10')]);return _0x33ddef(_0xb9c8a4['error'][_0x22eb('0x10')]);}else{logger[_0x22eb('0xc')]('MemberReport,\x20%s,\x20%s',_0x4539d0,'request\x20sent');_0x33ddef(_0xb9c8a4['result'][_0x22eb('0x10')]);}})['catch'](function(_0x50176d){logger[_0x22eb('0xe')]('MemberReport,\x20%s,\x20%s',_0x4539d0,_0x50176d);_0x3375d6(_0x50176d);});});}exports['GetMemberReport']=function(_0xb7a73a){var _0x2a55e4=this;return new Promise(function(_0x385bcb,_0x1ff041){return db[_0x22eb('0x11')]['findAll']({'raw':_0xb7a73a[_0x22eb('0x12')]?_0xb7a73a[_0x22eb('0x12')][_0x22eb('0x13')]===undefined?!![]:![]:!![],'where':_0xb7a73a[_0x22eb('0x12')]?_0xb7a73a[_0x22eb('0x12')]['where']||null:null,'attributes':_0xb7a73a[_0x22eb('0x12')]?_0xb7a73a[_0x22eb('0x12')][_0x22eb('0x14')]||null:null,'limit':_0xb7a73a['options']?_0xb7a73a['options'][_0x22eb('0x15')]||null:null,'include':_0xb7a73a[_0x22eb('0x12')]?_0xb7a73a[_0x22eb('0x12')][_0x22eb('0x16')]?_[_0x22eb('0x17')](_0xb7a73a[_0x22eb('0x12')][_0x22eb('0x16')],function(_0x4e7e69){return{'model':db[_0x4e7e69[_0x22eb('0x18')]],'as':_0x4e7e69['as'],'attributes':_0x4e7e69[_0x22eb('0x14')],'include':_0x4e7e69[_0x22eb('0x16')]?_[_0x22eb('0x17')](_0x4e7e69[_0x22eb('0x16')],function(_0x4da252){return{'model':db[_0x4da252[_0x22eb('0x18')]],'as':_0x4da252['as'],'attributes':_0x4da252[_0x22eb('0x14')],'include':_0x4da252[_0x22eb('0x16')]?_['map'](_0x4da252[_0x22eb('0x16')],function(_0x259847){return{'model':db[_0x259847['model']],'as':_0x259847['as'],'attributes':_0x259847[_0x22eb('0x14')]};}):[]};}):[]};}):[]:[]})[_0x22eb('0xb')](function(_0x1e3015){logger[_0x22eb('0xc')](_0x22eb('0x19'),_0xb7a73a);logger['debug']('GetMemberReport',_0xb7a73a,JSON[_0x22eb('0x1a')](_0x1e3015));_0x385bcb(_0x1e3015);})[_0x22eb('0x1b')](function(_0x44cf91){logger[_0x22eb('0xe')](_0x22eb('0x19'),_0x44cf91[_0x22eb('0x10')],_0xb7a73a);_0x1ff041(_0x2a55e4[_0x22eb('0xe')](0x1f4,_0x44cf91[_0x22eb('0x10')]));});});};exports[_0x22eb('0x1c')]=function(_0x39cec1){var _0x24e9dc=this;return new Promise(function(_0x5a37f8,_0x54f401){return db[_0x22eb('0x11')]['create'](_0x39cec1[_0x22eb('0x1d')],{'raw':_0x39cec1[_0x22eb('0x12')]?_0x39cec1[_0x22eb('0x12')][_0x22eb('0x13')]===undefined?!![]:![]:!![]})[_0x22eb('0xb')](function(_0x158cfa){logger[_0x22eb('0xc')](_0x22eb('0x1c'),_0x39cec1);logger[_0x22eb('0x1e')](_0x22eb('0x1c'),_0x39cec1,JSON['stringify'](_0x158cfa));_0x5a37f8(_0x158cfa);})['catch'](function(_0x239a41){logger['error']('CreateMemberReport',_0x239a41[_0x22eb('0x10')],_0x39cec1);_0x54f401(_0x24e9dc[_0x22eb('0xe')](0x1f4,_0x239a41[_0x22eb('0x10')]));});});};exports[_0x22eb('0x1f')]=function(_0x45c53e){var _0x332e9a=this;return new Promise(function(_0x3855df,_0x42a6d6){return db[_0x22eb('0x11')][_0x22eb('0x20')](_0x45c53e['body'],{'raw':_0x45c53e[_0x22eb('0x12')]?_0x45c53e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45c53e[_0x22eb('0x12')]?_0x45c53e[_0x22eb('0x12')]['where']||null:null,'attributes':_0x45c53e[_0x22eb('0x12')]?_0x45c53e[_0x22eb('0x12')][_0x22eb('0x14')]||null:null,'limit':_0x45c53e[_0x22eb('0x12')]?_0x45c53e[_0x22eb('0x12')]['limit']||null:null})[_0x22eb('0xb')](function(_0x1aea5f){logger['info'](_0x22eb('0x1f'),_0x45c53e);logger[_0x22eb('0x1e')](_0x22eb('0x1f'),_0x45c53e,JSON[_0x22eb('0x1a')](_0x1aea5f));_0x3855df(_0x1aea5f);})[_0x22eb('0x1b')](function(_0x5382eb){logger['error'](_0x22eb('0x1f'),_0x5382eb[_0x22eb('0x10')],_0x45c53e);_0x42a6d6(_0x332e9a['error'](0x1f4,_0x5382eb[_0x22eb('0x10')]));});});};
\ No newline at end of file
index b56271c..021a7a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ca9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','get','index','exports','multer','path','connect-timeout'];(function(_0x1b1e76,_0x31695b){var _0x3d743a=function(_0x4ae27b){while(--_0x4ae27b){_0x1b1e76['push'](_0x1b1e76['shift']());}};_0x3d743a(++_0x31695b);}(_0x3ca9,0xce));var _0x93ca=function(_0x554903,_0x1c31d7){_0x554903=_0x554903-0x0;var _0x280ac6=_0x3ca9[_0x554903];return _0x280ac6;};'use strict';var multer=require(_0x93ca('0x0'));var util=require('util');var path=require(_0x93ca('0x1'));var timeout=require(_0x93ca('0x2'));var express=require('express');var router=express[_0x93ca('0x3')]();var fs_extra=require(_0x93ca('0x4'));var auth=require(_0x93ca('0x5'));var interaction=require(_0x93ca('0x6'));var config=require('../../config/environment');var controller=require(_0x93ca('0x7'));router[_0x93ca('0x8')]('/',controller[_0x93ca('0x9')]);module[_0x93ca('0xa')]=router;
\ No newline at end of file
+var _0x8f05=['../../components/auth/service','../../config/environment','./migration.controller','multer','util','path','express','fs-extra'];(function(_0x6eb833,_0x2bb5e5){var _0xdfc38c=function(_0x13c4a4){while(--_0x13c4a4){_0x6eb833['push'](_0x6eb833['shift']());}};_0xdfc38c(++_0x2bb5e5);}(_0x8f05,0x1cb));var _0x58f0=function(_0x274285,_0x5b3b6f){_0x274285=_0x274285-0x0;var _0x3aa2b3=_0x8f05[_0x274285];return _0x3aa2b3;};'use strict';var multer=require(_0x58f0('0x0'));var util=require(_0x58f0('0x1'));var path=require(_0x58f0('0x2'));var timeout=require('connect-timeout');var express=require(_0x58f0('0x3'));var router=express['Router']();var fs_extra=require(_0x58f0('0x4'));var auth=require(_0x58f0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x58f0('0x6'));var controller=require(_0x58f0('0x7'));router['get']('/',controller['index']);module['exports']=router;
\ No newline at end of file
index f45aa78..3260bb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbc4=['sequelize','STRING','version'];(function(_0x48fa01,_0x261143){var _0x8c57f0=function(_0x1c8040){while(--_0x1c8040){_0x48fa01['push'](_0x48fa01['shift']());}};_0x8c57f0(++_0x261143);}(_0xbbc4,0x1bf));var _0x4bbc=function(_0x2bf326,_0x5a08ef){_0x2bf326=_0x2bf326-0x0;var _0x276e2f=_0xbbc4[_0x2bf326];return _0x276e2f;};'use strict';var Sequelize=require(_0x4bbc('0x0'));module['exports']={'version':{'type':Sequelize[_0x4bbc('0x1')],'unique':_0x4bbc('0x2')}};
\ No newline at end of file
+var _0x53a5=['STRING','version','exports'];(function(_0x21f86b,_0x72a47d){var _0x4e53c1=function(_0x45df74){while(--_0x45df74){_0x21f86b['push'](_0x21f86b['shift']());}};_0x4e53c1(++_0x72a47d);}(_0x53a5,0xf2));var _0x553a=function(_0x331831,_0x43e038){_0x331831=_0x331831-0x0;var _0x2a9423=_0x53a5[_0x331831];return _0x2a9423;};'use strict';var Sequelize=require('sequelize');module[_0x553a('0x0')]={'version':{'type':Sequelize[_0x553a('0x1')],'unique':_0x553a('0x2')}};
\ No newline at end of file
index e5a55d5..3737ecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1922=['../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Migration','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0xc0921a,_0x1f107f){var _0x3f6189=function(_0x5cd2fe){while(--_0x5cd2fe){_0xc0921a['push'](_0xc0921a['shift']());}};_0x3f6189(++_0x1f107f);}(_0x1922,0x6e));var _0x2192=function(_0x52900d,_0x2d8f9c){_0x52900d=_0x52900d-0x0;var _0x3b0d3f=_0x1922[_0x52900d];return _0x3b0d3f;};'use strict';var emlformat=require(_0x2192('0x0'));var rimraf=require(_0x2192('0x1'));var zipdir=require(_0x2192('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2192('0x3'));var moment=require('moment');var BPromise=require(_0x2192('0x4'));var Mustache=require(_0x2192('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2192('0x6'));var csv=require(_0x2192('0x7'));var ejs=require(_0x2192('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2192('0x9'));var squel=require(_0x2192('0xa'));var crypto=require('crypto');var jsforce=require(_0x2192('0xb'));var deskjs=require(_0x2192('0xc'));var toCsv=require(_0x2192('0x7'));var querystring=require('querystring');var Papa=require(_0x2192('0xd'));var Redis=require(_0x2192('0xe'));var authService=require(_0x2192('0xf'));var qs=require(_0x2192('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2192('0x11'));var logger=require('../../config/logger')(_0x2192('0x12'));var utils=require(_0x2192('0x13'));var config=require(_0x2192('0x14'));var licenseUtil=require(_0x2192('0x15'));var db=require(_0x2192('0x16'))['db'];function respondWithStatusCode(_0x2ff3f5,_0xed32){_0xed32=_0xed32||0xcc;return function(_0x17490f){if(_0x17490f){return _0x2ff3f5['sendStatus'](_0xed32);}return _0x2ff3f5[_0x2192('0x17')](_0xed32)['end']();};}function respondWithResult(_0x496801,_0x31408f){_0x31408f=_0x31408f||0xc8;return function(_0x81dcbb){if(_0x81dcbb){return _0x496801[_0x2192('0x17')](_0x31408f)['json'](_0x81dcbb);}};}function respondWithFilteredResult(_0x50e4f6,_0x3dc408){return function(_0x21fc1c){if(_0x21fc1c){var _0x3dfc35=typeof _0x3dc408[_0x2192('0x18')]===_0x2192('0x19')&&typeof _0x3dc408[_0x2192('0x1a')]==='undefined';var _0x595282=_0x21fc1c['count'];var _0x579469=_0x3dfc35?0x0:_0x3dc408[_0x2192('0x18')];var _0xa07b71=_0x3dfc35?_0x21fc1c[_0x2192('0x1b')]:_0x3dc408[_0x2192('0x18')]+_0x3dc408[_0x2192('0x1a')];var _0xd89863;if(_0xa07b71>=_0x595282){_0xa07b71=_0x595282;_0xd89863=0xc8;}else{_0xd89863=0xce;}_0x50e4f6[_0x2192('0x17')](_0xd89863);return _0x50e4f6[_0x2192('0x1c')]('Content-Range',_0x579469+'-'+_0xa07b71+'/'+_0x595282)['json'](_0x21fc1c);}return null;};}function patchUpdates(_0x1a26da){return function(_0x1c0971){try{jsonpatch[_0x2192('0x1d')](_0x1c0971,_0x1a26da,!![]);}catch(_0x57c780){return BPromise['reject'](_0x57c780);}return _0x1c0971[_0x2192('0x1e')]();};}function saveUpdates(_0x37da97,_0x5af76d){return function(_0x4e9c38){if(_0x4e9c38){return _0x4e9c38[_0x2192('0x1f')](_0x37da97)[_0x2192('0x20')](function(_0x577810){return _0x577810;});}return null;};}function removeEntity(_0x4768ff,_0xd97481){return function(_0x46de56){if(_0x46de56){return _0x46de56[_0x2192('0x21')]()['then'](function(){_0x4768ff[_0x2192('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x200dd5,_0x5a485f){return function(_0x32360a){if(!_0x32360a){_0x200dd5[_0x2192('0x22')](0x194);}return _0x32360a;};}function handleError(_0x35387c,_0x3edd22){_0x3edd22=_0x3edd22||0x1f4;return function(_0x3ea7b6){logger[_0x2192('0x23')](_0x3ea7b6[_0x2192('0x24')]);if(_0x3ea7b6['name']){delete _0x3ea7b6[_0x2192('0x25')];}_0x35387c[_0x2192('0x17')](_0x3edd22)[_0x2192('0x26')](_0x3ea7b6);};}exports[_0x2192('0x27')]=function(_0x4bbe2b,_0x38145d){var _0x1dda5d={},_0x46a800={},_0x3ce807={'count':0x0,'rows':[]};var _0x5e5012=_[_0x2192('0x28')](db[_0x2192('0x29')]['rawAttributes'],function(_0x3b0b0b){return{'name':_0x3b0b0b[_0x2192('0x2a')],'type':_0x3b0b0b[_0x2192('0x2b')]['key']};});_0x46a800[_0x2192('0x2c')]=_[_0x2192('0x28')](_0x5e5012,_0x2192('0x25'));_0x46a800[_0x2192('0x2d')]=_['keys'](_0x4bbe2b['query']);_0x46a800['filters']=_[_0x2192('0x2e')](_0x46a800[_0x2192('0x2c')],_0x46a800[_0x2192('0x2d')]);_0x1dda5d[_0x2192('0x2f')]=_[_0x2192('0x2e')](_0x46a800[_0x2192('0x2c')],qs[_0x2192('0x30')](_0x4bbe2b['query'][_0x2192('0x30')]));_0x1dda5d[_0x2192('0x2f')]=_0x1dda5d[_0x2192('0x2f')][_0x2192('0x31')]?_0x1dda5d['attributes']:_0x46a800[_0x2192('0x2c')];if(!_0x4bbe2b[_0x2192('0x2d')][_0x2192('0x32')](_0x2192('0x33'))){_0x1dda5d[_0x2192('0x1a')]=qs[_0x2192('0x1a')](_0x4bbe2b[_0x2192('0x2d')][_0x2192('0x1a')]);_0x1dda5d['offset']=qs[_0x2192('0x18')](_0x4bbe2b['query'][_0x2192('0x18')]);}_0x1dda5d['order']=qs[_0x2192('0x34')](_0x4bbe2b[_0x2192('0x2d')][_0x2192('0x34')]);_0x1dda5d[_0x2192('0x35')]=qs['filters'](_[_0x2192('0x36')](_0x4bbe2b[_0x2192('0x2d')],_0x46a800[_0x2192('0x37')]),_0x5e5012);if(_0x4bbe2b[_0x2192('0x2d')][_0x2192('0x38')]){_0x1dda5d['where']=_[_0x2192('0x39')](_0x1dda5d['where'],{'$or':_[_0x2192('0x28')](_0x5e5012,function(_0x1dd434){if(_0x1dd434[_0x2192('0x2b')]!==_0x2192('0x3a')){var _0x5400ad={};_0x5400ad[_0x1dd434['name']]={'$like':'%'+_0x4bbe2b[_0x2192('0x2d')][_0x2192('0x38')]+'%'};return _0x5400ad;}})});}_0x1dda5d=_[_0x2192('0x39')]({},_0x1dda5d,_0x4bbe2b[_0x2192('0x3b')]);var _0x1341d2={'where':_0x1dda5d[_0x2192('0x35')]};return db[_0x2192('0x29')][_0x2192('0x1b')](_0x1341d2)[_0x2192('0x20')](function(_0x3a6b4c){_0x3ce807[_0x2192('0x1b')]=_0x3a6b4c;if(_0x4bbe2b['query'][_0x2192('0x3c')]){_0x1dda5d[_0x2192('0x3d')]=[{'all':!![]}];}return db[_0x2192('0x29')][_0x2192('0x3e')](_0x1dda5d);})[_0x2192('0x20')](function(_0x5db03e){_0x3ce807[_0x2192('0x3f')]=_0x5db03e;return _0x3ce807;})['then'](respondWithFilteredResult(_0x38145d,_0x1dda5d))[_0x2192('0x40')](handleError(_0x38145d,null));};
\ No newline at end of file
+var _0x587d=['findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include'];(function(_0x3c9d67,_0x3f3739){var _0x4e4e02=function(_0x2c9597){while(--_0x2c9597){_0x3c9d67['push'](_0x3c9d67['shift']());}};_0x4e4e02(++_0x3f3739);}(_0x587d,0x199));var _0xd587=function(_0x5de821,_0x434ac5){_0x5de821=_0x5de821-0x0;var _0x4f1152=_0x587d[_0x5de821];return _0x4f1152;};'use strict';var emlformat=require(_0xd587('0x0'));var rimraf=require(_0xd587('0x1'));var zipdir=require(_0xd587('0x2'));var jsonpatch=require(_0xd587('0x3'));var rp=require(_0xd587('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd587('0x5'));var util=require(_0xd587('0x6'));var path=require(_0xd587('0x7'));var sox=require(_0xd587('0x8'));var csv=require('to-csv');var ejs=require(_0xd587('0x9'));var fs=require('fs');var fs_extra=require(_0xd587('0xa'));var _=require('lodash');var squel=require(_0xd587('0xb'));var crypto=require(_0xd587('0xc'));var jsforce=require(_0xd587('0xd'));var deskjs=require(_0xd587('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd587('0xf'));var Papa=require(_0xd587('0x10'));var Redis=require(_0xd587('0x11'));var authService=require(_0xd587('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd587('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd587('0x14'))(_0xd587('0x15'));var utils=require(_0xd587('0x16'));var config=require(_0xd587('0x17'));var licenseUtil=require(_0xd587('0x18'));var db=require(_0xd587('0x19'))['db'];function respondWithStatusCode(_0x253465,_0x96995e){_0x96995e=_0x96995e||0xcc;return function(_0x2bf417){if(_0x2bf417){return _0x253465[_0xd587('0x1a')](_0x96995e);}return _0x253465[_0xd587('0x1b')](_0x96995e)[_0xd587('0x1c')]();};}function respondWithResult(_0x2309c9,_0x620dcc){_0x620dcc=_0x620dcc||0xc8;return function(_0x58d213){if(_0x58d213){return _0x2309c9[_0xd587('0x1b')](_0x620dcc)['json'](_0x58d213);}};}function respondWithFilteredResult(_0x5808fa,_0x30c4ea){return function(_0x433687){if(_0x433687){var _0x22e575=typeof _0x30c4ea[_0xd587('0x1d')]===_0xd587('0x1e')&&typeof _0x30c4ea[_0xd587('0x1f')]===_0xd587('0x1e');var _0x77bb1d=_0x433687[_0xd587('0x20')];var _0x53fd28=_0x22e575?0x0:_0x30c4ea[_0xd587('0x1d')];var _0x52296c=_0x22e575?_0x433687['count']:_0x30c4ea[_0xd587('0x1d')]+_0x30c4ea[_0xd587('0x1f')];var _0x4a2574;if(_0x52296c>=_0x77bb1d){_0x52296c=_0x77bb1d;_0x4a2574=0xc8;}else{_0x4a2574=0xce;}_0x5808fa['status'](_0x4a2574);return _0x5808fa[_0xd587('0x21')](_0xd587('0x22'),_0x53fd28+'-'+_0x52296c+'/'+_0x77bb1d)[_0xd587('0x23')](_0x433687);}return null;};}function patchUpdates(_0x21f349){return function(_0x26059d){try{jsonpatch[_0xd587('0x24')](_0x26059d,_0x21f349,!![]);}catch(_0x1cf2b1){return BPromise[_0xd587('0x25')](_0x1cf2b1);}return _0x26059d['save']();};}function saveUpdates(_0x54b4b,_0x3b2240){return function(_0x23b977){if(_0x23b977){return _0x23b977['update'](_0x54b4b)[_0xd587('0x26')](function(_0x1440d9){return _0x1440d9;});}return null;};}function removeEntity(_0x3b5139,_0x36b107){return function(_0x216fa6){if(_0x216fa6){return _0x216fa6[_0xd587('0x27')]()[_0xd587('0x26')](function(){_0x3b5139['status'](0xcc)[_0xd587('0x1c')]();});}};}function handleEntityNotFound(_0xf02bd,_0x3bf455){return function(_0x5c68e6){if(!_0x5c68e6){_0xf02bd[_0xd587('0x1a')](0x194);}return _0x5c68e6;};}function handleError(_0x37d7bf,_0x41155d){_0x41155d=_0x41155d||0x1f4;return function(_0x5d54cd){logger[_0xd587('0x28')](_0x5d54cd[_0xd587('0x29')]);if(_0x5d54cd['name']){delete _0x5d54cd[_0xd587('0x2a')];}_0x37d7bf[_0xd587('0x1b')](_0x41155d)[_0xd587('0x2b')](_0x5d54cd);};}exports[_0xd587('0x2c')]=function(_0x4aedcd,_0x228fb9){var _0x4f446c={},_0x4df65b={},_0x1414a4={'count':0x0,'rows':[]};var _0x47b048=_[_0xd587('0x2d')](db[_0xd587('0x2e')][_0xd587('0x2f')],function(_0xa41fa8){return{'name':_0xa41fa8[_0xd587('0x30')],'type':_0xa41fa8[_0xd587('0x31')][_0xd587('0x32')]};});_0x4df65b['model']=_[_0xd587('0x2d')](_0x47b048,_0xd587('0x2a'));_0x4df65b['query']=_['keys'](_0x4aedcd['query']);_0x4df65b[_0xd587('0x33')]=_[_0xd587('0x34')](_0x4df65b[_0xd587('0x35')],_0x4df65b[_0xd587('0x36')]);_0x4f446c[_0xd587('0x37')]=_['intersection'](_0x4df65b[_0xd587('0x35')],qs[_0xd587('0x38')](_0x4aedcd[_0xd587('0x36')][_0xd587('0x38')]));_0x4f446c['attributes']=_0x4f446c['attributes'][_0xd587('0x39')]?_0x4f446c['attributes']:_0x4df65b[_0xd587('0x35')];if(!_0x4aedcd['query'][_0xd587('0x3a')](_0xd587('0x3b'))){_0x4f446c['limit']=qs[_0xd587('0x1f')](_0x4aedcd[_0xd587('0x36')][_0xd587('0x1f')]);_0x4f446c[_0xd587('0x1d')]=qs['offset'](_0x4aedcd[_0xd587('0x36')]['offset']);}_0x4f446c[_0xd587('0x3c')]=qs[_0xd587('0x3d')](_0x4aedcd[_0xd587('0x36')][_0xd587('0x3d')]);_0x4f446c[_0xd587('0x3e')]=qs[_0xd587('0x33')](_[_0xd587('0x3f')](_0x4aedcd[_0xd587('0x36')],_0x4df65b[_0xd587('0x33')]),_0x47b048);if(_0x4aedcd['query']['filter']){_0x4f446c[_0xd587('0x3e')]=_['merge'](_0x4f446c['where'],{'$or':_[_0xd587('0x2d')](_0x47b048,function(_0xb62550){if(_0xb62550[_0xd587('0x31')]!=='VIRTUAL'){var _0x594b22={};_0x594b22[_0xb62550[_0xd587('0x2a')]]={'$like':'%'+_0x4aedcd['query'][_0xd587('0x40')]+'%'};return _0x594b22;}})});}_0x4f446c=_['merge']({},_0x4f446c,_0x4aedcd[_0xd587('0x41')]);var _0x4f5607={'where':_0x4f446c[_0xd587('0x3e')]};return db[_0xd587('0x2e')][_0xd587('0x20')](_0x4f5607)[_0xd587('0x26')](function(_0x8d47f6){_0x1414a4['count']=_0x8d47f6;if(_0x4aedcd[_0xd587('0x36')]['includeAll']){_0x4f446c[_0xd587('0x42')]=[{'all':!![]}];}return db['Migration'][_0xd587('0x43')](_0x4f446c);})[_0xd587('0x26')](function(_0xdac37b){_0x1414a4['rows']=_0xdac37b;return _0x1414a4;})[_0xd587('0x26')](respondWithFilteredResult(_0x228fb9,_0x4f446c))['catch'](handleError(_0x228fb9,null));};
\ No newline at end of file
index 02ac366..e7124a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bba=['../../config/environment','./migration.attributes','exports','define','migrations','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x170602,_0x3387eb){var _0x20d749=function(_0x1e5dc3){while(--_0x1e5dc3){_0x170602['push'](_0x170602['shift']());}};_0x20d749(++_0x3387eb);}(_0x3bba,0x10d));var _0xa3bb=function(_0x2aba6e,_0x23c5f5){_0x2aba6e=_0x2aba6e-0x0;var _0x125f65=_0x3bba[_0x2aba6e];return _0x125f65;};'use strict';var _=require(_0xa3bb('0x0'));var util=require(_0xa3bb('0x1'));var logger=require(_0xa3bb('0x2'))(_0xa3bb('0x3'));var moment=require(_0xa3bb('0x4'));var BPromise=require(_0xa3bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa3bb('0x6'));var config=require(_0xa3bb('0x7'));var attributes=require(_0xa3bb('0x8'));module[_0xa3bb('0x9')]=function(_0x189a74,_0x3f92ca){return _0x189a74[_0xa3bb('0xa')]('Migration',attributes,{'tableName':_0xa3bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x049e=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','Migration','lodash','util'];(function(_0x45a813,_0x13e302){var _0x41e082=function(_0x9488b5){while(--_0x9488b5){_0x45a813['push'](_0x45a813['shift']());}};_0x41e082(++_0x13e302);}(_0x049e,0xf0));var _0xe049=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x049e[_0xbeb808];return _0x5d6909;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var logger=require(_0xe049('0x2'))(_0xe049('0x3'));var moment=require(_0xe049('0x4'));var BPromise=require(_0xe049('0x5'));var rp=require(_0xe049('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe049('0x7'));var config=require(_0xe049('0x8'));var attributes=require('./migration.attributes');module['exports']=function(_0x349f64,_0x330ffc){return _0x349f64[_0xe049('0x9')](_0xe049('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e92650b..7819a47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84e1=['Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x10d69a,_0x361e24){var _0x200bf4=function(_0xfc469e){while(--_0xfc469e){_0x10d69a['push'](_0x10d69a['shift']());}};_0x200bf4(++_0x361e24);}(_0x84e1,0x1dc));var _0x184e=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x84e1[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x184e('0x0'));var util=require(_0x184e('0x1'));var moment=require(_0x184e('0x2'));var BPromise=require(_0x184e('0x3'));var rs=require(_0x184e('0x4'));var fs=require('fs');var Redis=require(_0x184e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x184e('0x6'));var logger=require(_0x184e('0x7'))(_0x184e('0x8'));var config=require(_0x184e('0x9'));var jayson=require(_0x184e('0xa'));var client=jayson[_0x184e('0xb')][_0x184e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ad2c3,_0x3f24d3,_0xa32654){return new BPromise(function(_0x1e79b2,_0x4b6204){return client[_0x184e('0xd')](_0x4ad2c3,_0xa32654)[_0x184e('0xe')](function(_0x22af83){logger[_0x184e('0xf')]('Migration,\x20%s,\x20%s',_0x3f24d3,_0x184e('0x10'));logger[_0x184e('0x11')](_0x184e('0x12'),_0x3f24d3,_0x184e('0x10'),JSON[_0x184e('0x13')](_0x22af83));if(_0x22af83[_0x184e('0x14')]){if(_0x22af83[_0x184e('0x14')][_0x184e('0x15')]===0x1f4){logger[_0x184e('0x14')](_0x184e('0x16'),_0x3f24d3,_0x22af83[_0x184e('0x14')][_0x184e('0x17')]);return _0x4b6204(_0x22af83['error'][_0x184e('0x17')]);}logger['error'](_0x184e('0x16'),_0x3f24d3,_0x22af83[_0x184e('0x14')][_0x184e('0x17')]);return _0x1e79b2(_0x22af83[_0x184e('0x14')][_0x184e('0x17')]);}else{logger[_0x184e('0xf')](_0x184e('0x16'),_0x3f24d3,_0x184e('0x10'));_0x1e79b2(_0x22af83[_0x184e('0x18')]['message']);}})[_0x184e('0x19')](function(_0x5d3a36){logger[_0x184e('0x14')]('Migration,\x20%s,\x20%s',_0x3f24d3,_0x5d3a36);_0x4b6204(_0x5d3a36);});});}
\ No newline at end of file
+var _0x63eb=['client','http','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0x63eb,0x90));var _0xb63e=function(_0x31f004,_0x105612){_0x31f004=_0x31f004-0x0;var _0x2ba90e=_0x63eb[_0x31f004];return _0x2ba90e;};'use strict';var _=require(_0xb63e('0x0'));var util=require(_0xb63e('0x1'));var moment=require(_0xb63e('0x2'));var BPromise=require(_0xb63e('0x3'));var rs=require(_0xb63e('0x4'));var fs=require('fs');var Redis=require(_0xb63e('0x5'));var db=require(_0xb63e('0x6'))['db'];var utils=require(_0xb63e('0x7'));var logger=require(_0xb63e('0x8'))(_0xb63e('0x9'));var config=require(_0xb63e('0xa'));var jayson=require(_0xb63e('0xb'));var client=jayson[_0xb63e('0xc')][_0xb63e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x456ca3,_0xeb9650,_0x2f1729){return new BPromise(function(_0xe4f423,_0x199b7b){return client[_0xb63e('0xe')](_0x456ca3,_0x2f1729)[_0xb63e('0xf')](function(_0x4c22a2){logger[_0xb63e('0x10')]('Migration,\x20%s,\x20%s',_0xeb9650,_0xb63e('0x11'));logger[_0xb63e('0x12')](_0xb63e('0x13'),_0xeb9650,'request\x20sent',JSON[_0xb63e('0x14')](_0x4c22a2));if(_0x4c22a2[_0xb63e('0x15')]){if(_0x4c22a2[_0xb63e('0x15')][_0xb63e('0x16')]===0x1f4){logger['error'](_0xb63e('0x17'),_0xeb9650,_0x4c22a2[_0xb63e('0x15')][_0xb63e('0x18')]);return _0x199b7b(_0x4c22a2['error'][_0xb63e('0x18')]);}logger[_0xb63e('0x15')](_0xb63e('0x17'),_0xeb9650,_0x4c22a2[_0xb63e('0x15')]['message']);return _0xe4f423(_0x4c22a2[_0xb63e('0x15')][_0xb63e('0x18')]);}else{logger[_0xb63e('0x10')](_0xb63e('0x17'),_0xeb9650,_0xb63e('0x11'));_0xe4f423(_0x4c22a2['result'][_0xb63e('0x18')]);}})[_0xb63e('0x19')](function(_0x2221d9){logger[_0xb63e('0x15')](_0xb63e('0x17'),_0xeb9650,_0x2221d9);_0x199b7b(_0x2221d9);});});}
\ No newline at end of file
index 6a49a32..2332d66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x605a=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id'];(function(_0x20dcf8,_0x4eb77d){var _0x15ef5d=function(_0x1c4c67){while(--_0x1c4c67){_0x20dcf8['push'](_0x20dcf8['shift']());}};_0x15ef5d(++_0x4eb77d);}(_0x605a,0x126));var _0xa605=function(_0x213ad6,_0x464dfb){_0x213ad6=_0x213ad6-0x0;var _0x2b40b1=_0x605a[_0x213ad6];return _0x2b40b1;};'use strict';var multer=require(_0xa605('0x0'));var util=require(_0xa605('0x1'));var path=require(_0xa605('0x2'));var timeout=require(_0xa605('0x3'));var express=require(_0xa605('0x4'));var router=express[_0xa605('0x5')]();var fs_extra=require(_0xa605('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa605('0x7'));var config=require(_0xa605('0x8'));var controller=require(_0xa605('0x9'));router[_0xa605('0xa')]('/',auth[_0xa605('0xb')](),controller[_0xa605('0xc')]);router[_0xa605('0xa')](_0xa605('0xd'),auth['isAuthenticated'](),controller[_0xa605('0xe')]);router[_0xa605('0xf')]('/',auth[_0xa605('0xb')](),controller[_0xa605('0x10')]);router[_0xa605('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa605('0x12')]);router[_0xa605('0x13')](_0xa605('0xd'),auth[_0xa605('0xb')](),controller[_0xa605('0x14')]);module[_0xa605('0x15')]=router;
\ No newline at end of file
+var _0xe528=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0xe528,0x167));var _0x8e52=function(_0x1dba36,_0x4f07bf){_0x1dba36=_0x1dba36-0x0;var _0x253285=_0xe528[_0x1dba36];return _0x253285;};'use strict';var multer=require(_0x8e52('0x0'));var util=require(_0x8e52('0x1'));var path=require(_0x8e52('0x2'));var timeout=require(_0x8e52('0x3'));var express=require('express');var router=express[_0x8e52('0x4')]();var fs_extra=require(_0x8e52('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8e52('0x6'));var config=require(_0x8e52('0x7'));var controller=require(_0x8e52('0x8'));router[_0x8e52('0x9')]('/',auth[_0x8e52('0xa')](),controller[_0x8e52('0xb')]);router[_0x8e52('0x9')](_0x8e52('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8e52('0xd')]('/',auth[_0x8e52('0xa')](),controller[_0x8e52('0xe')]);router[_0x8e52('0xf')](_0x8e52('0xc'),auth[_0x8e52('0xa')](),controller[_0x8e52('0x10')]);router[_0x8e52('0x11')](_0x8e52('0xc'),auth[_0x8e52('0xa')](),controller['destroy']);module[_0x8e52('0x12')]=router;
\ No newline at end of file
index 8f198be..4bb8e81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c3c=['STRING','ENUM','localnet','stun','turn'];(function(_0x28efc1,_0x3d8148){var _0x589475=function(_0x49d52c){while(--_0x49d52c){_0x28efc1['push'](_0x28efc1['shift']());}};_0x589475(++_0x3d8148);}(_0x9c3c,0x1a0));var _0xc9c3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9c3c[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc9c3('0x0')](_0xc9c3('0x1'),'externip',_0xc9c3('0x2'),_0xc9c3('0x3'))},'value':{'type':Sequelize[_0xc9c3('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x425a=['STRING','sequelize','ENUM','externip'];(function(_0x1aa1ca,_0x551370){var _0x14af10=function(_0x219841){while(--_0x219841){_0x1aa1ca['push'](_0x1aa1ca['shift']());}};_0x14af10(++_0x551370);}(_0x425a,0x7d));var _0xa425=function(_0x1d4923,_0x4e222f){_0x1d4923=_0x1d4923-0x0;var _0x14ea9a=_0x425a[_0x1d4923];return _0x14ea9a;};'use strict';var Sequelize=require(_0xa425('0x0'));module['exports']={'type':{'type':Sequelize[_0xa425('0x1')]('localnet',_0xa425('0x2'),'stun','turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa425('0x3')]},'password':{'type':Sequelize[_0xa425('0x3')]}};
\ No newline at end of file
index d00ace1..887ee24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd22=['VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','transaction','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','TURN','join','res_stun_monitor.so','server/files/templates/network.ejs','toLowerCase','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','Network','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xbd22,0x1dd));var _0x2bd2=function(_0x40435c,_0x51ebf8){_0x40435c=_0x40435c-0x0;var _0x4c8947=_0xbd22[_0x40435c];return _0x4c8947;};'use strict';var emlformat=require(_0x2bd2('0x0'));var rimraf=require(_0x2bd2('0x1'));var zipdir=require(_0x2bd2('0x2'));var jsonpatch=require(_0x2bd2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2bd2('0x4'));var Mustache=require(_0x2bd2('0x5'));var util=require(_0x2bd2('0x6'));var path=require(_0x2bd2('0x7'));var sox=require(_0x2bd2('0x8'));var csv=require(_0x2bd2('0x9'));var ejs=require(_0x2bd2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bd2('0xb'));var squel=require(_0x2bd2('0xc'));var crypto=require(_0x2bd2('0xd'));var jsforce=require(_0x2bd2('0xe'));var deskjs=require(_0x2bd2('0xf'));var toCsv=require(_0x2bd2('0x9'));var querystring=require(_0x2bd2('0x10'));var Papa=require(_0x2bd2('0x11'));var Redis=require(_0x2bd2('0x12'));var authService=require(_0x2bd2('0x13'));var qs=require(_0x2bd2('0x14'));var as=require(_0x2bd2('0x15'));var hardwareService=require(_0x2bd2('0x16'));var logger=require(_0x2bd2('0x17'))('api');var utils=require(_0x2bd2('0x18'));var config=require(_0x2bd2('0x19'));var licenseUtil=require(_0x2bd2('0x1a'));var db=require(_0x2bd2('0x1b'))['db'];var jayson=require(_0x2bd2('0x1c'));var client=jayson[_0x2bd2('0x1d')][_0x2bd2('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5a7724,_0x5b494f,_0x461918,_0x3efbf4){return new BPromise(function(_0x2565b3,_0x577421){var _0x14a0bd=_0x3efbf4||client;return _0x14a0bd[_0x2bd2('0x1f')](_0x5a7724,_0x461918)[_0x2bd2('0x20')](function(_0x2d934b){logger[_0x2bd2('0x21')](_0x2bd2('0x22'),_0x5b494f,'request\x20sent');logger[_0x2bd2('0x23')](_0x2bd2('0x24'),_0x5b494f,_0x2bd2('0x25'),JSON[_0x2bd2('0x26')](_0x2d934b));if(_0x2d934b['error']){if(_0x2d934b['error'][_0x2bd2('0x27')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x5b494f,_0x2d934b[_0x2bd2('0x28')][_0x2bd2('0x29')]);return _0x577421(_0x2d934b['error']['message']);}logger[_0x2bd2('0x28')]('Network,\x20%s,\x20%s',_0x5b494f,_0x2d934b[_0x2bd2('0x28')][_0x2bd2('0x29')]);return _0x2565b3(_0x2d934b[_0x2bd2('0x28')][_0x2bd2('0x29')]);}else{logger[_0x2bd2('0x21')]('Network,\x20%s,\x20%s',_0x5b494f,_0x2bd2('0x25'));_0x2565b3(_0x2d934b['result'][_0x2bd2('0x29')]);}})['catch'](function(_0x1119e3){logger[_0x2bd2('0x28')](_0x2bd2('0x22'),_0x5b494f,_0x1119e3);_0x577421(_0x1119e3);});});}function respondWithStatusCode(_0x469c67,_0x1880a1){_0x1880a1=_0x1880a1||0xcc;return function(_0x59c574){if(_0x59c574){return _0x469c67[_0x2bd2('0x2a')](_0x1880a1);}return _0x469c67[_0x2bd2('0x2b')](_0x1880a1)[_0x2bd2('0x2c')]();};}function respondWithResult(_0x534587,_0x275ed6){_0x275ed6=_0x275ed6||0xc8;return function(_0x322321){if(_0x322321){return _0x534587[_0x2bd2('0x2b')](_0x275ed6)[_0x2bd2('0x2d')](_0x322321);}};}function respondWithFilteredResult(_0x4913fd,_0x19947d){return function(_0x2af999){if(_0x2af999){var _0x4e8ff7=typeof _0x19947d[_0x2bd2('0x2e')]===_0x2bd2('0x2f')&&typeof _0x19947d[_0x2bd2('0x30')]===_0x2bd2('0x2f');var _0xc74a7=_0x2af999[_0x2bd2('0x31')];var _0x355331=_0x4e8ff7?0x0:_0x19947d['offset'];var _0xf5b3d9=_0x4e8ff7?_0x2af999[_0x2bd2('0x31')]:_0x19947d['offset']+_0x19947d[_0x2bd2('0x30')];var _0x230eb5;if(_0xf5b3d9>=_0xc74a7){_0xf5b3d9=_0xc74a7;_0x230eb5=0xc8;}else{_0x230eb5=0xce;}_0x4913fd['status'](_0x230eb5);return _0x4913fd['set'](_0x2bd2('0x32'),_0x355331+'-'+_0xf5b3d9+'/'+_0xc74a7)[_0x2bd2('0x2d')](_0x2af999);}return null;};}function patchUpdates(_0x3d6c82){return function(_0x3f132d){try{jsonpatch[_0x2bd2('0x33')](_0x3f132d,_0x3d6c82,!![]);}catch(_0x4757c1){return BPromise[_0x2bd2('0x34')](_0x4757c1);}return _0x3f132d[_0x2bd2('0x35')]();};}function saveUpdates(_0x4ccb62,_0x3d735a){return function(_0x55412a){if(_0x55412a){return _0x55412a[_0x2bd2('0x36')](_0x4ccb62)[_0x2bd2('0x20')](function(_0x2472d3){return _0x2472d3;});}return null;};}function removeEntity(_0x322f95,_0x30dbcf){return function(_0x24267b){if(_0x24267b){return _0x24267b[_0x2bd2('0x37')]()[_0x2bd2('0x20')](function(){_0x322f95['status'](0xcc)[_0x2bd2('0x2c')]();});}};}function handleEntityNotFound(_0x3a36d9,_0x311d3e){return function(_0x461442){if(!_0x461442){_0x3a36d9['sendStatus'](0x194);}return _0x461442;};}function handleError(_0x15632a,_0x2146cf){_0x2146cf=_0x2146cf||0x1f4;return function(_0x44eb3d){logger['error'](_0x44eb3d[_0x2bd2('0x38')]);if(_0x44eb3d[_0x2bd2('0x39')]){delete _0x44eb3d[_0x2bd2('0x39')];}_0x15632a[_0x2bd2('0x2b')](_0x2146cf)[_0x2bd2('0x3a')](_0x44eb3d);};}exports['index']=function(_0x1997f9,_0x28d779){var _0x42d48b={},_0x5e2ad6={},_0x1e2fd4={'count':0x0,'rows':[]};var _0x1325ae=_[_0x2bd2('0x3b')](db[_0x2bd2('0x3c')][_0x2bd2('0x3d')],function(_0x4a97c3){return{'name':_0x4a97c3[_0x2bd2('0x3e')],'type':_0x4a97c3['type'][_0x2bd2('0x3f')]};});_0x5e2ad6[_0x2bd2('0x40')]=_[_0x2bd2('0x3b')](_0x1325ae,'name');_0x5e2ad6[_0x2bd2('0x41')]=_[_0x2bd2('0x42')](_0x1997f9[_0x2bd2('0x41')]);_0x5e2ad6[_0x2bd2('0x43')]=_[_0x2bd2('0x44')](_0x5e2ad6[_0x2bd2('0x40')],_0x5e2ad6['query']);_0x42d48b[_0x2bd2('0x45')]=_[_0x2bd2('0x44')](_0x5e2ad6['model'],qs[_0x2bd2('0x46')](_0x1997f9['query'][_0x2bd2('0x46')]));_0x42d48b[_0x2bd2('0x45')]=_0x42d48b[_0x2bd2('0x45')][_0x2bd2('0x47')]?_0x42d48b[_0x2bd2('0x45')]:_0x5e2ad6[_0x2bd2('0x40')];if(!_0x1997f9['query'][_0x2bd2('0x48')]('nolimit')){_0x42d48b['limit']=qs[_0x2bd2('0x30')](_0x1997f9[_0x2bd2('0x41')][_0x2bd2('0x30')]);_0x42d48b[_0x2bd2('0x2e')]=qs['offset'](_0x1997f9['query']['offset']);}_0x42d48b[_0x2bd2('0x49')]=qs['sort'](_0x1997f9[_0x2bd2('0x41')][_0x2bd2('0x4a')]);_0x42d48b['where']=qs[_0x2bd2('0x43')](_['pick'](_0x1997f9['query'],_0x5e2ad6[_0x2bd2('0x43')]),_0x1325ae);if(_0x1997f9[_0x2bd2('0x41')]['filter']){_0x42d48b[_0x2bd2('0x4b')]=_[_0x2bd2('0x4c')](_0x42d48b[_0x2bd2('0x4b')],{'$or':_[_0x2bd2('0x3b')](_0x1325ae,function(_0x4399b8){if(_0x4399b8[_0x2bd2('0x4d')]!==_0x2bd2('0x4e')){var _0x4ef456={};_0x4ef456[_0x4399b8[_0x2bd2('0x39')]]={'$like':'%'+_0x1997f9[_0x2bd2('0x41')]['filter']+'%'};return _0x4ef456;}})});}_0x42d48b=_[_0x2bd2('0x4c')]({},_0x42d48b,_0x1997f9[_0x2bd2('0x4f')]);var _0x39a12a={'where':_0x42d48b[_0x2bd2('0x4b')]};return db[_0x2bd2('0x3c')]['count'](_0x39a12a)[_0x2bd2('0x20')](function(_0x56033c){_0x1e2fd4[_0x2bd2('0x31')]=_0x56033c;if(_0x1997f9[_0x2bd2('0x41')][_0x2bd2('0x50')]){_0x42d48b['include']=[{'all':!![]}];}return db[_0x2bd2('0x3c')][_0x2bd2('0x51')](_0x42d48b);})[_0x2bd2('0x20')](function(_0x5e5e5a){_0x1e2fd4[_0x2bd2('0x52')]=_0x5e5e5a;return _0x1e2fd4;})[_0x2bd2('0x20')](respondWithFilteredResult(_0x28d779,_0x42d48b))['catch'](handleError(_0x28d779,null));};exports[_0x2bd2('0x53')]=function(_0x2ed83f,_0x3790c6){var _0x45a3d4={'raw':!![],'where':{'id':_0x2ed83f[_0x2bd2('0x54')]['id']}},_0x3de143={};_0x3de143[_0x2bd2('0x40')]=_['keys'](db[_0x2bd2('0x3c')][_0x2bd2('0x3d')]);_0x3de143['query']=_[_0x2bd2('0x42')](_0x2ed83f[_0x2bd2('0x41')]);_0x3de143[_0x2bd2('0x43')]=_[_0x2bd2('0x44')](_0x3de143[_0x2bd2('0x40')],_0x3de143[_0x2bd2('0x41')]);_0x45a3d4['attributes']=_['intersection'](_0x3de143['model'],qs['fields'](_0x2ed83f['query'][_0x2bd2('0x46')]));_0x45a3d4['attributes']=_0x45a3d4[_0x2bd2('0x45')][_0x2bd2('0x47')]?_0x45a3d4[_0x2bd2('0x45')]:_0x3de143['model'];if(_0x2ed83f[_0x2bd2('0x41')][_0x2bd2('0x50')]){_0x45a3d4[_0x2bd2('0x55')]=[{'all':!![]}];}_0x45a3d4=_['merge']({},_0x45a3d4,_0x2ed83f[_0x2bd2('0x4f')]);return db[_0x2bd2('0x3c')][_0x2bd2('0x56')](_0x45a3d4)[_0x2bd2('0x20')](handleEntityNotFound(_0x3790c6,null))[_0x2bd2('0x20')](respondWithResult(_0x3790c6,null))[_0x2bd2('0x57')](handleError(_0x3790c6,null));};exports[_0x2bd2('0x58')]=function(_0x1e3779,_0x5981ef,_0x28d952){var _0x587aed;return db['sequelize'][_0x2bd2('0x59')](function(_0x5b157f){return db[_0x2bd2('0x3c')]['create'](_0x1e3779[_0x2bd2('0x5a')],{'raw':!![]})[_0x2bd2('0x20')](function(_0xeb25dc){_0x587aed=_0xeb25dc;return db['Network'][_0x2bd2('0x51')]({'where':{'type':_0x1e3779[_0x2bd2('0x5a')][_0x2bd2('0x4d')]},'raw':!![]});})[_0x2bd2('0x20')](function(_0x1e1b36){if(_0x587aed[_0x2bd2('0x4d')][_0x2bd2('0x5b')]()==_0x2bd2('0x5c')){var _0xfe547d=fs[_0x2bd2('0x5d')](path['join'](config[_0x2bd2('0x5e')],_0x2bd2('0x5f')),_0x2bd2('0x60'));var _0x33c93f=ejs[_0x2bd2('0x61')](_0xfe547d,{'networks':_0x1e1b36||[]});fs[_0x2bd2('0x62')]('/etc/asterisk/stun_xcally.conf',_0x33c93f);return respondWithRpcPromise(_0x2bd2('0x63'),'create',{'module':'res_stun_monitor.so'});}else if(_0x587aed[_0x2bd2('0x4d')][_0x2bd2('0x5b')]()==_0x2bd2('0x64')){var _0x2580d0=fs[_0x2bd2('0x5d')](path[_0x2bd2('0x65')](config[_0x2bd2('0x5e')],'server/files/templates/turn_multiple.ejs'),_0x2bd2('0x60'));var _0x118a65=ejs['render'](_0x2580d0,{'networks':_0x1e1b36||[]});fs[_0x2bd2('0x62')]('/etc/asterisk/turn_xcally.conf',_0x118a65);return respondWithRpcPromise(_0x2bd2('0x63'),_0x2bd2('0x58'),{'module':_0x2bd2('0x66')});}else{var _0x40592a=fs[_0x2bd2('0x5d')](path['join'](config[_0x2bd2('0x5e')],_0x2bd2('0x67')),_0x2bd2('0x60'));var _0x41839d=ejs[_0x2bd2('0x61')](_0x40592a,{'networks':_0x1e1b36||[]});fs[_0x2bd2('0x62')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x1e3779[_0x2bd2('0x5a')][_0x2bd2('0x4d')][_0x2bd2('0x68')]()),_0x41839d);return respondWithRpcPromise(_0x2bd2('0x63'),_0x2bd2('0x58'),{'module':'chan_sip.so'});}return null;})[_0x2bd2('0x20')](function(){return _0x587aed;});})[_0x2bd2('0x20')](respondWithResult(_0x5981ef,0xc9))[_0x2bd2('0x57')](handleError(_0x5981ef,null));};exports['update']=function(_0x321093,_0x547a1e,_0xdb9afa){var _0x432b66;return db['sequelize'][_0x2bd2('0x59')](function(_0x2ea6f0){return db[_0x2bd2('0x3c')][_0x2bd2('0x56')]({'where':{'id':_0x321093[_0x2bd2('0x54')]['id']}})[_0x2bd2('0x20')](handleEntityNotFound(_0x547a1e,null))[_0x2bd2('0x20')](saveUpdates(_0x321093[_0x2bd2('0x5a')],null))[_0x2bd2('0x20')](function(_0x3640f8){if(_0x3640f8){_0x432b66=_0x3640f8;return db[_0x2bd2('0x3c')]['findAll']({'where':{'type':_0x432b66['type']},'raw':!![]});}return null;})[_0x2bd2('0x20')](function(_0x54f505){if(_0x432b66[_0x2bd2('0x4d')][_0x2bd2('0x5b')]()=='STUN'){var _0x4b9a9a=fs['readFileSync'](path[_0x2bd2('0x65')](config[_0x2bd2('0x5e')],_0x2bd2('0x5f')),_0x2bd2('0x60'));var _0x8eb1eb=ejs[_0x2bd2('0x61')](_0x4b9a9a,{'networks':_0x54f505||[]});fs[_0x2bd2('0x62')](_0x2bd2('0x69'),_0x8eb1eb);return respondWithRpcPromise(_0x2bd2('0x63'),_0x2bd2('0x36'),{'module':'res_stun_monitor.so'});}else if(_0x432b66[_0x2bd2('0x4d')]['toUpperCase']()==_0x2bd2('0x64')){var _0xa4b3a8=fs[_0x2bd2('0x5d')](path[_0x2bd2('0x65')](config[_0x2bd2('0x5e')],_0x2bd2('0x6a')),_0x2bd2('0x60'));var _0x4975b5=ejs[_0x2bd2('0x61')](_0xa4b3a8,{'networks':_0x54f505||[]});fs[_0x2bd2('0x62')](_0x2bd2('0x6b'),_0x4975b5);return respondWithRpcPromise('Reload',_0x2bd2('0x36'),{'module':_0x2bd2('0x66')});}else{var _0x54b74f=fs[_0x2bd2('0x5d')](path[_0x2bd2('0x65')](config['root'],_0x2bd2('0x67')),_0x2bd2('0x60'));var _0x2beca3=ejs['render'](_0x54b74f,{'networks':_0x54f505||[]});fs[_0x2bd2('0x62')](util[_0x2bd2('0x6c')](_0x2bd2('0x6d'),_0x321093[_0x2bd2('0x5a')][_0x2bd2('0x4d')][_0x2bd2('0x68')]()),_0x2beca3);return respondWithRpcPromise('Reload','update',{'module':_0x2bd2('0x6e')});}return null;})['then'](function(_0x5d1dca){if(_0x5d1dca){return _0x432b66;}return null;});})['then'](respondWithResult(_0x547a1e,null))[_0x2bd2('0x57')](handleError(_0x547a1e,null));};exports[_0x2bd2('0x37')]=function(_0x2b6b07,_0x49bc18,_0x5ecb9c){var _0xea6c16;return db[_0x2bd2('0x3c')][_0x2bd2('0x56')]({'where':{'id':_0x2b6b07[_0x2bd2('0x54')]['id']}})[_0x2bd2('0x20')](function(_0x41cb4f){_0xea6c16=_0x41cb4f;return _0x41cb4f;})[_0x2bd2('0x20')](handleEntityNotFound(_0x49bc18,null))[_0x2bd2('0x20')](removeEntity(_0x49bc18,null))[_0x2bd2('0x20')](function(){if(_0xea6c16){return db[_0x2bd2('0x3c')][_0x2bd2('0x51')]({'where':{'type':_0xea6c16[_0x2bd2('0x4d')]},'raw':!![]});}})[_0x2bd2('0x20')](function(_0x5b9cae){if(_0xea6c16[_0x2bd2('0x4d')]['toUpperCase']()==_0x2bd2('0x5c')){var _0x957dbb=fs[_0x2bd2('0x5d')](path['join'](config[_0x2bd2('0x5e')],_0x2bd2('0x5f')),_0x2bd2('0x60'));var _0x274508=ejs[_0x2bd2('0x61')](_0x957dbb,{'networks':_0x5b9cae||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x274508);return respondWithRpcPromise(_0x2bd2('0x63'),'destroy',{'module':_0x2bd2('0x66')});}else if(_0xea6c16[_0x2bd2('0x4d')]['toUpperCase']()==_0x2bd2('0x64')){var _0x45e3c2=fs[_0x2bd2('0x5d')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x2bd2('0x60'));var _0x2eab48=ejs[_0x2bd2('0x61')](_0x45e3c2,{'networks':_0x5b9cae||[]});fs[_0x2bd2('0x62')]('/etc/asterisk/turn_xcally.conf',_0x2eab48);return respondWithRpcPromise('Reload',_0x2bd2('0x37'),{'module':_0x2bd2('0x66')});}else{var _0x3154c5=fs[_0x2bd2('0x5d')](path[_0x2bd2('0x65')](config['root'],_0x2bd2('0x67')),_0x2bd2('0x60'));var _0x1f9c7d=ejs['render'](_0x3154c5,{'networks':_0x5b9cae||[]});fs[_0x2bd2('0x62')](util[_0x2bd2('0x6c')](_0x2bd2('0x6d'),_0x2b6b07['body'][_0x2bd2('0x4d')]['toLowerCase']()),_0x1f9c7d);return respondWithRpcPromise(_0x2bd2('0x63'),_0x2bd2('0x37'),{'module':_0x2bd2('0x6e')});}return null;})[_0x2bd2('0x57')](handleError(_0x49bc18,null));};
\ No newline at end of file
+var _0xc734=['find','catch','sequelize','transaction','create','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','utf8','render','/etc/asterisk/turn_xcally.conf','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','server/files/templates/network.ejs','STUN','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','Network','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params'];(function(_0x49937e,_0x4af84a){var _0x216e77=function(_0x1b48a7){while(--_0x1b48a7){_0x49937e['push'](_0x49937e['shift']());}};_0x216e77(++_0x4af84a);}(_0xc734,0x1ca));var _0x4c73=function(_0x3eb713,_0x437874){_0x3eb713=_0x3eb713-0x0;var _0x1d7128=_0xc734[_0x3eb713];return _0x1d7128;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c73('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c73('0x1'));var rp=require(_0x4c73('0x2'));var moment=require(_0x4c73('0x3'));var BPromise=require(_0x4c73('0x4'));var Mustache=require(_0x4c73('0x5'));var util=require(_0x4c73('0x6'));var path=require(_0x4c73('0x7'));var sox=require(_0x4c73('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c73('0x9'));var _=require('lodash');var squel=require(_0x4c73('0xa'));var crypto=require(_0x4c73('0xb'));var jsforce=require(_0x4c73('0xc'));var deskjs=require(_0x4c73('0xd'));var toCsv=require(_0x4c73('0xe'));var querystring=require('querystring');var Papa=require(_0x4c73('0xf'));var Redis=require(_0x4c73('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4c73('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c73('0x12'))('api');var utils=require(_0x4c73('0x13'));var config=require(_0x4c73('0x14'));var licenseUtil=require(_0x4c73('0x15'));var db=require(_0x4c73('0x16'))['db'];var jayson=require(_0x4c73('0x17'));var client=jayson[_0x4c73('0x18')][_0x4c73('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2ce2c7,_0x448aa3,_0x24623d,_0x1477e5){return new BPromise(function(_0x2f5b24,_0x4f0229){var _0x4afe4b=_0x1477e5||client;return _0x4afe4b[_0x4c73('0x1a')](_0x2ce2c7,_0x24623d)['then'](function(_0x39e3e1){logger[_0x4c73('0x1b')](_0x4c73('0x1c'),_0x448aa3,_0x4c73('0x1d'));logger['debug'](_0x4c73('0x1e'),_0x448aa3,_0x4c73('0x1d'),JSON[_0x4c73('0x1f')](_0x39e3e1));if(_0x39e3e1[_0x4c73('0x20')]){if(_0x39e3e1['error'][_0x4c73('0x21')]===0x1f4){logger[_0x4c73('0x20')]('Network,\x20%s,\x20%s',_0x448aa3,_0x39e3e1['error']['message']);return _0x4f0229(_0x39e3e1[_0x4c73('0x20')]['message']);}logger[_0x4c73('0x20')](_0x4c73('0x1c'),_0x448aa3,_0x39e3e1[_0x4c73('0x20')][_0x4c73('0x22')]);return _0x2f5b24(_0x39e3e1['error'][_0x4c73('0x22')]);}else{logger[_0x4c73('0x1b')](_0x4c73('0x1c'),_0x448aa3,_0x4c73('0x1d'));_0x2f5b24(_0x39e3e1['result'][_0x4c73('0x22')]);}})['catch'](function(_0x390dcf){logger[_0x4c73('0x20')](_0x4c73('0x1c'),_0x448aa3,_0x390dcf);_0x4f0229(_0x390dcf);});});}function respondWithStatusCode(_0x462c0a,_0x9764b1){_0x9764b1=_0x9764b1||0xcc;return function(_0x3d68f9){if(_0x3d68f9){return _0x462c0a[_0x4c73('0x23')](_0x9764b1);}return _0x462c0a[_0x4c73('0x24')](_0x9764b1)[_0x4c73('0x25')]();};}function respondWithResult(_0x46362d,_0x34e464){_0x34e464=_0x34e464||0xc8;return function(_0xf4ef96){if(_0xf4ef96){return _0x46362d[_0x4c73('0x24')](_0x34e464)[_0x4c73('0x26')](_0xf4ef96);}};}function respondWithFilteredResult(_0x39f962,_0x1b73e1){return function(_0x4eef5f){if(_0x4eef5f){var _0x358389=typeof _0x1b73e1[_0x4c73('0x27')]===_0x4c73('0x28')&&typeof _0x1b73e1[_0x4c73('0x29')]===_0x4c73('0x28');var _0x3c8de1=_0x4eef5f[_0x4c73('0x2a')];var _0x5b689d=_0x358389?0x0:_0x1b73e1['offset'];var _0x2efd17=_0x358389?_0x4eef5f[_0x4c73('0x2a')]:_0x1b73e1[_0x4c73('0x27')]+_0x1b73e1[_0x4c73('0x29')];var _0xe6bd46;if(_0x2efd17>=_0x3c8de1){_0x2efd17=_0x3c8de1;_0xe6bd46=0xc8;}else{_0xe6bd46=0xce;}_0x39f962[_0x4c73('0x24')](_0xe6bd46);return _0x39f962[_0x4c73('0x2b')](_0x4c73('0x2c'),_0x5b689d+'-'+_0x2efd17+'/'+_0x3c8de1)[_0x4c73('0x26')](_0x4eef5f);}return null;};}function patchUpdates(_0x19fa48){return function(_0x54063b){try{jsonpatch[_0x4c73('0x2d')](_0x54063b,_0x19fa48,!![]);}catch(_0x30e964){return BPromise['reject'](_0x30e964);}return _0x54063b[_0x4c73('0x2e')]();};}function saveUpdates(_0x511597,_0x1979aa){return function(_0x5d20e8){if(_0x5d20e8){return _0x5d20e8[_0x4c73('0x2f')](_0x511597)[_0x4c73('0x30')](function(_0x2c11f1){return _0x2c11f1;});}return null;};}function removeEntity(_0x5745a9,_0x4d1115){return function(_0x175ee7){if(_0x175ee7){return _0x175ee7[_0x4c73('0x31')]()[_0x4c73('0x30')](function(){_0x5745a9[_0x4c73('0x24')](0xcc)[_0x4c73('0x25')]();});}};}function handleEntityNotFound(_0x4d13ed,_0x34d39f){return function(_0x4bd79f){if(!_0x4bd79f){_0x4d13ed[_0x4c73('0x23')](0x194);}return _0x4bd79f;};}function handleError(_0x4c6c61,_0x1d7fa5){_0x1d7fa5=_0x1d7fa5||0x1f4;return function(_0x3047be){logger[_0x4c73('0x20')](_0x3047be[_0x4c73('0x32')]);if(_0x3047be[_0x4c73('0x33')]){delete _0x3047be[_0x4c73('0x33')];}_0x4c6c61[_0x4c73('0x24')](_0x1d7fa5)[_0x4c73('0x34')](_0x3047be);};}exports[_0x4c73('0x35')]=function(_0x5b076a,_0x430732){var _0x147f96={},_0x2a8244={},_0x2780c3={'count':0x0,'rows':[]};var _0x295147=_['map'](db[_0x4c73('0x36')][_0x4c73('0x37')],function(_0x431f6c){return{'name':_0x431f6c[_0x4c73('0x38')],'type':_0x431f6c[_0x4c73('0x39')][_0x4c73('0x3a')]};});_0x2a8244['model']=_[_0x4c73('0x3b')](_0x295147,'name');_0x2a8244[_0x4c73('0x3c')]=_[_0x4c73('0x3d')](_0x5b076a[_0x4c73('0x3c')]);_0x2a8244[_0x4c73('0x3e')]=_['intersection'](_0x2a8244[_0x4c73('0x3f')],_0x2a8244[_0x4c73('0x3c')]);_0x147f96[_0x4c73('0x40')]=_[_0x4c73('0x41')](_0x2a8244[_0x4c73('0x3f')],qs['fields'](_0x5b076a[_0x4c73('0x3c')][_0x4c73('0x42')]));_0x147f96[_0x4c73('0x40')]=_0x147f96[_0x4c73('0x40')][_0x4c73('0x43')]?_0x147f96[_0x4c73('0x40')]:_0x2a8244[_0x4c73('0x3f')];if(!_0x5b076a[_0x4c73('0x3c')][_0x4c73('0x44')](_0x4c73('0x45'))){_0x147f96[_0x4c73('0x29')]=qs['limit'](_0x5b076a[_0x4c73('0x3c')][_0x4c73('0x29')]);_0x147f96[_0x4c73('0x27')]=qs[_0x4c73('0x27')](_0x5b076a[_0x4c73('0x3c')][_0x4c73('0x27')]);}_0x147f96['order']=qs[_0x4c73('0x46')](_0x5b076a[_0x4c73('0x3c')][_0x4c73('0x46')]);_0x147f96['where']=qs['filters'](_[_0x4c73('0x47')](_0x5b076a[_0x4c73('0x3c')],_0x2a8244[_0x4c73('0x3e')]),_0x295147);if(_0x5b076a[_0x4c73('0x3c')][_0x4c73('0x48')]){_0x147f96[_0x4c73('0x49')]=_['merge'](_0x147f96['where'],{'$or':_['map'](_0x295147,function(_0x3ac911){if(_0x3ac911[_0x4c73('0x39')]!==_0x4c73('0x4a')){var _0x3803d7={};_0x3803d7[_0x3ac911[_0x4c73('0x33')]]={'$like':'%'+_0x5b076a[_0x4c73('0x3c')]['filter']+'%'};return _0x3803d7;}})});}_0x147f96=_[_0x4c73('0x4b')]({},_0x147f96,_0x5b076a['options']);var _0x377b8e={'where':_0x147f96[_0x4c73('0x49')]};return db[_0x4c73('0x36')][_0x4c73('0x2a')](_0x377b8e)[_0x4c73('0x30')](function(_0x42a1f4){_0x2780c3[_0x4c73('0x2a')]=_0x42a1f4;if(_0x5b076a[_0x4c73('0x3c')][_0x4c73('0x4c')]){_0x147f96[_0x4c73('0x4d')]=[{'all':!![]}];}return db['Network'][_0x4c73('0x4e')](_0x147f96);})[_0x4c73('0x30')](function(_0x18121e){_0x2780c3[_0x4c73('0x4f')]=_0x18121e;return _0x2780c3;})[_0x4c73('0x30')](respondWithFilteredResult(_0x430732,_0x147f96))['catch'](handleError(_0x430732,null));};exports[_0x4c73('0x50')]=function(_0x4d62b4,_0x46f829){var _0x12e5c4={'raw':!![],'where':{'id':_0x4d62b4[_0x4c73('0x51')]['id']}},_0x284c04={};_0x284c04[_0x4c73('0x3f')]=_['keys'](db['Network']['rawAttributes']);_0x284c04[_0x4c73('0x3c')]=_[_0x4c73('0x3d')](_0x4d62b4[_0x4c73('0x3c')]);_0x284c04['filters']=_[_0x4c73('0x41')](_0x284c04[_0x4c73('0x3f')],_0x284c04['query']);_0x12e5c4[_0x4c73('0x40')]=_[_0x4c73('0x41')](_0x284c04[_0x4c73('0x3f')],qs[_0x4c73('0x42')](_0x4d62b4[_0x4c73('0x3c')][_0x4c73('0x42')]));_0x12e5c4[_0x4c73('0x40')]=_0x12e5c4[_0x4c73('0x40')][_0x4c73('0x43')]?_0x12e5c4['attributes']:_0x284c04[_0x4c73('0x3f')];if(_0x4d62b4[_0x4c73('0x3c')][_0x4c73('0x4c')]){_0x12e5c4[_0x4c73('0x4d')]=[{'all':!![]}];}_0x12e5c4=_['merge']({},_0x12e5c4,_0x4d62b4['options']);return db[_0x4c73('0x36')][_0x4c73('0x52')](_0x12e5c4)[_0x4c73('0x30')](handleEntityNotFound(_0x46f829,null))[_0x4c73('0x30')](respondWithResult(_0x46f829,null))[_0x4c73('0x53')](handleError(_0x46f829,null));};exports['create']=function(_0x39956d,_0x50354b,_0x4daa98){var _0x525c58;return db[_0x4c73('0x54')][_0x4c73('0x55')](function(_0x1786d0){return db[_0x4c73('0x36')][_0x4c73('0x56')](_0x39956d[_0x4c73('0x57')],{'raw':!![]})['then'](function(_0x297f0d){_0x525c58=_0x297f0d;return db[_0x4c73('0x36')][_0x4c73('0x4e')]({'where':{'type':_0x39956d[_0x4c73('0x57')][_0x4c73('0x39')]},'raw':!![]});})[_0x4c73('0x30')](function(_0xcd9880){if(_0x525c58[_0x4c73('0x39')][_0x4c73('0x58')]()=='STUN'){var _0x8ce961=fs[_0x4c73('0x59')](path[_0x4c73('0x5a')](config[_0x4c73('0x5b')],_0x4c73('0x5c')),'utf8');var _0x59446d=ejs['render'](_0x8ce961,{'networks':_0xcd9880||[]});fs['writeFileSync'](_0x4c73('0x5d'),_0x59446d);return respondWithRpcPromise(_0x4c73('0x5e'),_0x4c73('0x56'),{'module':_0x4c73('0x5f')});}else if(_0x525c58[_0x4c73('0x39')][_0x4c73('0x58')]()==_0x4c73('0x60')){var _0x271e7a=fs['readFileSync'](path[_0x4c73('0x5a')](config['root'],_0x4c73('0x61')),_0x4c73('0x62'));var _0x5b3028=ejs[_0x4c73('0x63')](_0x271e7a,{'networks':_0xcd9880||[]});fs['writeFileSync'](_0x4c73('0x64'),_0x5b3028);return respondWithRpcPromise(_0x4c73('0x5e'),_0x4c73('0x56'),{'module':_0x4c73('0x5f')});}else{var _0x505247=fs[_0x4c73('0x59')](path[_0x4c73('0x5a')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x45632e=ejs[_0x4c73('0x63')](_0x505247,{'networks':_0xcd9880||[]});fs[_0x4c73('0x65')](util[_0x4c73('0x66')](_0x4c73('0x67'),_0x39956d['body'][_0x4c73('0x39')][_0x4c73('0x68')]()),_0x45632e);return respondWithRpcPromise(_0x4c73('0x5e'),'create',{'module':_0x4c73('0x69')});}return null;})[_0x4c73('0x30')](function(){return _0x525c58;});})['then'](respondWithResult(_0x50354b,0xc9))[_0x4c73('0x53')](handleError(_0x50354b,null));};exports[_0x4c73('0x2f')]=function(_0x23f1c6,_0xfacc1d,_0x4160a4){var _0x1486d3;return db['sequelize']['transaction'](function(_0x2c5975){return db['Network'][_0x4c73('0x52')]({'where':{'id':_0x23f1c6[_0x4c73('0x51')]['id']}})[_0x4c73('0x30')](handleEntityNotFound(_0xfacc1d,null))[_0x4c73('0x30')](saveUpdates(_0x23f1c6[_0x4c73('0x57')],null))[_0x4c73('0x30')](function(_0x7393ec){if(_0x7393ec){_0x1486d3=_0x7393ec;return db[_0x4c73('0x36')][_0x4c73('0x4e')]({'where':{'type':_0x1486d3['type']},'raw':!![]});}return null;})[_0x4c73('0x30')](function(_0x9f4fae){if(_0x1486d3[_0x4c73('0x39')][_0x4c73('0x58')]()=='STUN'){var _0x5b5a59=fs[_0x4c73('0x59')](path[_0x4c73('0x5a')](config['root'],_0x4c73('0x5c')),_0x4c73('0x62'));var _0x436d4e=ejs[_0x4c73('0x63')](_0x5b5a59,{'networks':_0x9f4fae||[]});fs[_0x4c73('0x65')](_0x4c73('0x5d'),_0x436d4e);return respondWithRpcPromise(_0x4c73('0x5e'),_0x4c73('0x2f'),{'module':_0x4c73('0x5f')});}else if(_0x1486d3['type'][_0x4c73('0x58')]()==_0x4c73('0x60')){var _0xbf9ef3=fs[_0x4c73('0x59')](path[_0x4c73('0x5a')](config[_0x4c73('0x5b')],_0x4c73('0x61')),_0x4c73('0x62'));var _0x3d01b8=ejs['render'](_0xbf9ef3,{'networks':_0x9f4fae||[]});fs[_0x4c73('0x65')]('/etc/asterisk/turn_xcally.conf',_0x3d01b8);return respondWithRpcPromise(_0x4c73('0x5e'),_0x4c73('0x2f'),{'module':_0x4c73('0x5f')});}else{var _0x3b6fc5=fs['readFileSync'](path[_0x4c73('0x5a')](config[_0x4c73('0x5b')],_0x4c73('0x6a')),_0x4c73('0x62'));var _0x3f3175=ejs[_0x4c73('0x63')](_0x3b6fc5,{'networks':_0x9f4fae||[]});fs[_0x4c73('0x65')](util[_0x4c73('0x66')](_0x4c73('0x67'),_0x23f1c6[_0x4c73('0x57')][_0x4c73('0x39')][_0x4c73('0x68')]()),_0x3f3175);return respondWithRpcPromise('Reload',_0x4c73('0x2f'),{'module':_0x4c73('0x69')});}return null;})[_0x4c73('0x30')](function(_0x49fde6){if(_0x49fde6){return _0x1486d3;}return null;});})['then'](respondWithResult(_0xfacc1d,null))[_0x4c73('0x53')](handleError(_0xfacc1d,null));};exports['destroy']=function(_0xc30cb6,_0x262c55,_0x5b5c52){var _0x2bd709;return db[_0x4c73('0x36')][_0x4c73('0x52')]({'where':{'id':_0xc30cb6['params']['id']}})['then'](function(_0x41ebd6){_0x2bd709=_0x41ebd6;return _0x41ebd6;})['then'](handleEntityNotFound(_0x262c55,null))['then'](removeEntity(_0x262c55,null))[_0x4c73('0x30')](function(){if(_0x2bd709){return db[_0x4c73('0x36')][_0x4c73('0x4e')]({'where':{'type':_0x2bd709[_0x4c73('0x39')]},'raw':!![]});}})[_0x4c73('0x30')](function(_0x496566){if(_0x2bd709[_0x4c73('0x39')][_0x4c73('0x58')]()==_0x4c73('0x6b')){var _0x3b9dba=fs['readFileSync'](path[_0x4c73('0x5a')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x4c73('0x62'));var _0x4b9f02=ejs[_0x4c73('0x63')](_0x3b9dba,{'networks':_0x496566||[]});fs[_0x4c73('0x65')]('/etc/asterisk/stun_xcally.conf',_0x4b9f02);return respondWithRpcPromise(_0x4c73('0x5e'),_0x4c73('0x31'),{'module':_0x4c73('0x5f')});}else if(_0x2bd709[_0x4c73('0x39')]['toUpperCase']()=='TURN'){var _0x19ea25=fs[_0x4c73('0x59')](path[_0x4c73('0x5a')](config[_0x4c73('0x5b')],_0x4c73('0x61')),_0x4c73('0x62'));var _0x441b3a=ejs[_0x4c73('0x63')](_0x19ea25,{'networks':_0x496566||[]});fs['writeFileSync'](_0x4c73('0x64'),_0x441b3a);return respondWithRpcPromise(_0x4c73('0x5e'),_0x4c73('0x31'),{'module':'res_stun_monitor.so'});}else{var _0x2d5827=fs['readFileSync'](path[_0x4c73('0x5a')](config[_0x4c73('0x5b')],'server/files/templates/network.ejs'),_0x4c73('0x62'));var _0x5c2951=ejs[_0x4c73('0x63')](_0x2d5827,{'networks':_0x496566||[]});fs[_0x4c73('0x65')](util[_0x4c73('0x66')](_0x4c73('0x67'),_0xc30cb6[_0x4c73('0x57')][_0x4c73('0x39')][_0x4c73('0x68')]()),_0x5c2951);return respondWithRpcPromise(_0x4c73('0x5e'),'destroy',{'module':_0x4c73('0x69')});}return null;})[_0x4c73('0x53')](handleError(_0x262c55,null));};
\ No newline at end of file
index 834c2eb..3c50c2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb49a=['util','../../config/logger','api','moment','request-promise','path','./network.attributes','exports','define','Network','network','lodash'];(function(_0x30eaf0,_0x141930){var _0x301155=function(_0x309c61){while(--_0x309c61){_0x30eaf0['push'](_0x30eaf0['shift']());}};_0x301155(++_0x141930);}(_0xb49a,0xfb));var _0xab49=function(_0x22a3f0,_0x513d0e){_0x22a3f0=_0x22a3f0-0x0;var _0x2d8a9c=_0xb49a[_0x22a3f0];return _0x2d8a9c;};'use strict';var _=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var logger=require(_0xab49('0x2'))(_0xab49('0x3'));var moment=require(_0xab49('0x4'));var BPromise=require('bluebird');var rp=require(_0xab49('0x5'));var fs=require('fs');var path=require(_0xab49('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab49('0x7'));module[_0xab49('0x8')]=function(_0x1cae1d,_0x3703cb){return _0x1cae1d[_0xab49('0x9')](_0xab49('0xa'),attributes,{'tableName':_0xab49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fd9=['./network.attributes','exports','Network','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x3ea3c6,_0x2833a9){var _0x35bd5c=function(_0x1063bf){while(--_0x1063bf){_0x3ea3c6['push'](_0x3ea3c6['shift']());}};_0x35bd5c(++_0x2833a9);}(_0x0fd9,0xa3));var _0x90fd=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0x0fd9[_0x51ec61];return _0x223200;};'use strict';var _=require('lodash');var util=require(_0x90fd('0x0'));var logger=require(_0x90fd('0x1'))(_0x90fd('0x2'));var moment=require(_0x90fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x90fd('0x4'));var rimraf=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var attributes=require(_0x90fd('0x7'));module[_0x90fd('0x8')]=function(_0x23e11b,_0x5e2107){return _0x23e11b['define'](_0x90fd('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 57dee29..db4560d 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x8cdcba,_0x56f657){_0x8cdcba=_0x8cdcba-0x0;var _0x550592=_0x7a54[_0x8cdcba];return _0x550592;};'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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x1264a5,_0x23dcd6){_0x1264a5=_0x1264a5-0x0;var _0x16ff26=_0x7a54[_0x1264a5];return _0x16ff26;};'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 c2fb94d..65ce022 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0625=['notify','addApplications','addAgents','/:id/send','send','put','/:id','update','destroy','delete','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','post','create','/:id/notify'];(function(_0x475919,_0x5dbed3){var _0x5633e6=function(_0x4e9e4b){while(--_0x4e9e4b){_0x475919['push'](_0x475919['shift']());}};_0x5633e6(++_0x5dbed3);}(_0x0625,0x1d2));var _0x5062=function(_0x34ec86,_0x4539f5){_0x34ec86=_0x34ec86-0x0;var _0x59c760=_0x0625[_0x34ec86];return _0x59c760;};'use strict';var multer=require(_0x5062('0x0'));var util=require(_0x5062('0x1'));var path=require(_0x5062('0x2'));var timeout=require(_0x5062('0x3'));var express=require(_0x5062('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5062('0x5'));var interaction=require(_0x5062('0x6'));var config=require(_0x5062('0x7'));var controller=require(_0x5062('0x8'));router[_0x5062('0x9')]('/',auth[_0x5062('0xa')](),controller[_0x5062('0xb')]);router[_0x5062('0x9')](_0x5062('0xc'),auth[_0x5062('0xa')](),controller[_0x5062('0xd')]);router[_0x5062('0x9')]('/:id',auth[_0x5062('0xa')](),controller[_0x5062('0xe')]);router[_0x5062('0x9')](_0x5062('0xf'),auth[_0x5062('0xa')](),controller[_0x5062('0x10')]);router['get'](_0x5062('0x11'),auth[_0x5062('0xa')](),controller[_0x5062('0x12')]);router[_0x5062('0x9')]('/:id/applications',auth[_0x5062('0xa')](),controller['getApplications']);router[_0x5062('0x9')]('/:id/interactions',auth[_0x5062('0xa')](),controller['getInteractions']);router[_0x5062('0x9')](_0x5062('0x13'),auth[_0x5062('0xa')](),controller[_0x5062('0x14')]);router[_0x5062('0x15')]('/',auth[_0x5062('0xa')](),controller[_0x5062('0x16')]);router[_0x5062('0x15')]('/:id/dispositions',auth[_0x5062('0xa')](),controller['addDisposition']);router['post'](_0x5062('0x11'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0x5062('0x17'),controller[_0x5062('0x18')]);router[_0x5062('0x15')]('/:id/applications',auth['isAuthenticated'](),controller[_0x5062('0x19')]);router[_0x5062('0x15')]('/:id/users',auth[_0x5062('0xa')](),controller[_0x5062('0x1a')]);router[_0x5062('0x15')](_0x5062('0x1b'),auth[_0x5062('0xa')](),controller[_0x5062('0x1c')]);router[_0x5062('0x1d')](_0x5062('0x1e'),auth['isAuthenticated'](),controller[_0x5062('0x1f')]);router['delete'](_0x5062('0x1e'),auth[_0x5062('0xa')](),controller[_0x5062('0x20')]);router[_0x5062('0x21')](_0x5062('0xf'),auth[_0x5062('0xa')](),controller['removeDispositions']);router[_0x5062('0x21')](_0x5062('0x11'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x5062('0x13'),auth[_0x5062('0xa')](),controller[_0x5062('0x22')]);module['exports']=router;
\ No newline at end of file
+var _0xd301=['/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','create','post','addDisposition','/:id/canned_answers','/:id/notify','addApplications','/:id/users','/:id/send','send','put','update','delete','destroy','removeAnswers','exports','multer','util','path','Router','fs-extra','../../components/auth/service','isAuthenticated','index','describe','get'];(function(_0x4dd198,_0x5e7f00){var _0x432874=function(_0x5c2f65){while(--_0x5c2f65){_0x4dd198['push'](_0x4dd198['shift']());}};_0x432874(++_0x5e7f00);}(_0xd301,0x161));var _0x1d30=function(_0x1c2aeb,_0x48433c){_0x1c2aeb=_0x1c2aeb-0x0;var _0x783379=_0xd301[_0x1c2aeb];return _0x783379;};'use strict';var multer=require(_0x1d30('0x0'));var util=require(_0x1d30('0x1'));var path=require(_0x1d30('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1d30('0x3')]();var fs_extra=require(_0x1d30('0x4'));var auth=require(_0x1d30('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x1d30('0x6')](),controller[_0x1d30('0x7')]);router['get']('/describe',auth[_0x1d30('0x6')](),controller[_0x1d30('0x8')]);router[_0x1d30('0x9')](_0x1d30('0xa'),auth['isAuthenticated'](),controller[_0x1d30('0xb')]);router[_0x1d30('0x9')](_0x1d30('0xc'),auth['isAuthenticated'](),controller[_0x1d30('0xd')]);router[_0x1d30('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1d30('0xe')]);router[_0x1d30('0x9')](_0x1d30('0xf'),auth['isAuthenticated'](),controller[_0x1d30('0x10')]);router[_0x1d30('0x9')](_0x1d30('0x11'),auth[_0x1d30('0x6')](),controller['getInteractions']);router['get']('/:id/users',auth[_0x1d30('0x6')](),controller['getAgents']);router['post']('/',auth[_0x1d30('0x6')](),controller[_0x1d30('0x12')]);router[_0x1d30('0x13')](_0x1d30('0xc'),auth['isAuthenticated'](),controller[_0x1d30('0x14')]);router['post'](_0x1d30('0x15'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0x1d30('0x16'),controller['notify']);router[_0x1d30('0x13')](_0x1d30('0xf'),auth[_0x1d30('0x6')](),controller[_0x1d30('0x17')]);router['post'](_0x1d30('0x18'),auth[_0x1d30('0x6')](),controller['addAgents']);router[_0x1d30('0x13')](_0x1d30('0x19'),auth[_0x1d30('0x6')](),controller[_0x1d30('0x1a')]);router[_0x1d30('0x1b')](_0x1d30('0xa'),auth['isAuthenticated'](),controller[_0x1d30('0x1c')]);router[_0x1d30('0x1d')](_0x1d30('0xa'),auth[_0x1d30('0x6')](),controller[_0x1d30('0x1e')]);router[_0x1d30('0x1d')](_0x1d30('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x1d30('0x1d')](_0x1d30('0x15'),auth[_0x1d30('0x6')](),controller[_0x1d30('0x1f')]);router[_0x1d30('0x1d')]('/:id/users',auth[_0x1d30('0x6')](),controller['removeAgents']);module[_0x1d30('0x20')]=router;
\ No newline at end of file
index 04d862c..35faf54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3362=['mandatoryDisposition','sequelize','randomstring','exports','STRING','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'];(function(_0x17e2ac,_0x51a8c5){var _0x44d3e9=function(_0x26ebd8){while(--_0x26ebd8){_0x17e2ac['push'](_0x17e2ac['shift']());}};_0x44d3e9(++_0x51a8c5);}(_0x3362,0x189));var _0x2336=function(_0x16e51f,_0xc90977){_0x16e51f=_0x16e51f-0x0;var _0xbb8e8f=_0x3362[_0x16e51f];return _0xbb8e8f;};'use strict';var Sequelize=require(_0x2336('0x0'));var rs=require(_0x2336('0x1'));module[_0x2336('0x2')]={'name':{'type':Sequelize[_0x2336('0x3')],'unique':_0x2336('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x2336('0x3')],'defaultValue':function(){return rs[_0x2336('0x5')]();}},'replyUri':{'type':Sequelize[_0x2336('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2336('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2336('0x6')],'defaultValue':function(){return _0x2336('0x7');}},'notificationSound':{'type':Sequelize[_0x2336('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2336('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2336('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2336('0x3')]},'queueTransfer':{'type':Sequelize[_0x2336('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2336('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2336('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2336('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2336('0x9')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2336('0x8')],'defaultValue':![],'comment':_0x2336('0xa'),'set':function(_0x44e1c5){if(!_0x44e1c5)this[_0x2336('0xb')](_0x2336('0xc'),null);this['setDataValue'](_0x2336('0xd'),_0x44e1c5);}}};
\ No newline at end of file
+var _0x529d=['setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x504f59,_0x13fb4d){var _0x4993b5=function(_0x10ccd0){while(--_0x10ccd0){_0x504f59['push'](_0x504f59['shift']());}};_0x4993b5(++_0x13fb4d);}(_0x529d,0x91));var _0xd529=function(_0x3719b0,_0x433fc4){_0x3719b0=_0x3719b0-0x0;var _0x537d39=_0x529d[_0x3719b0];return _0x537d39;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd529('0x0'));module[_0xd529('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd529('0x2')]},'token':{'type':Sequelize[_0xd529('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xd529('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd529('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd529('0x3')],'defaultValue':function(){return _0xd529('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd529('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd529('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd529('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd529('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd529('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd529('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xd529('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xd529('0x5')],'defaultValue':![],'comment':_0xd529('0x8'),'set':function(_0x54c83c){if(!_0x54c83c)this[_0xd529('0x9')](_0xd529('0xa'),null);this[_0xd529('0x9')]('mandatoryDisposition',_0x54c83c);}}};
\ No newline at end of file
index f446c08..824b1a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb3b=['options','includeAll','include','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','Pause','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','removeDispositions','ids','CannedAnswer','getAnswers','findAll','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','Contacts','from','ListId','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','getInteractions','internal','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','dataValues','Messages','rimraf','zip-dir','request-promise','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../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','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','update','get','OpenchannelAccounts','UserProfileResource','destroy','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x22b95b,_0x2c695e){var _0x32728b=function(_0x434be1){while(--_0x434be1){_0x22b95b['push'](_0x22b95b['shift']());}};_0x32728b(++_0x2c695e);}(_0xbb3b,0x6b));var _0xbbb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb3b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbb3('0x0'));var zipdir=require(_0xbbb3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbb3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbbb3('0x3'));var csv=require('to-csv');var ejs=require(_0xbbb3('0x4'));var fs=require('fs');var fs_extra=require(_0xbbb3('0x5'));var _=require('lodash');var squel=require(_0xbbb3('0x6'));var crypto=require(_0xbbb3('0x7'));var jsforce=require(_0xbbb3('0x8'));var deskjs=require(_0xbbb3('0x9'));var toCsv=require(_0xbbb3('0xa'));var querystring=require('querystring');var Papa=require(_0xbbb3('0xb'));var Redis=require('ioredis');var authService=require(_0xbbb3('0xc'));var qs=require(_0xbbb3('0xd'));var as=require(_0xbbb3('0xe'));var hardwareService=require(_0xbbb3('0xf'));var logger=require(_0xbbb3('0x10'))('api');var utils=require(_0xbbb3('0x11'));var config=require(_0xbbb3('0x12'));var licenseUtil=require(_0xbbb3('0x13'));var db=require(_0xbbb3('0x14'))['db'];config['redis']=_[_0xbbb3('0x15')](config[_0xbbb3('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xbbb3('0x17'))(new Redis(config[_0xbbb3('0x16')]));require('./openchannelAccount.socket')[_0xbbb3('0x18')](socket);var jayson=require(_0xbbb3('0x19'));var client=jayson[_0xbbb3('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0xbbb3('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x133aac,_0x378863,_0x47048c,_0x29c98f){return new BPromise(function(_0x34253a,_0x57d268){var _0x379f5d=_0x29c98f||client;return _0x379f5d[_0xbbb3('0x1c')](_0x133aac,_0x47048c)[_0xbbb3('0x1d')](function(_0x5b530a){logger[_0xbbb3('0x1e')](_0xbbb3('0x1f'),_0x378863,_0xbbb3('0x20'));logger[_0xbbb3('0x21')](_0xbbb3('0x22'),_0x378863,_0xbbb3('0x20'),JSON['stringify'](_0x5b530a));if(_0x5b530a[_0xbbb3('0x23')]){if(_0x5b530a['error']['code']===0x1f4){logger[_0xbbb3('0x23')](_0xbbb3('0x1f'),_0x378863,_0x5b530a[_0xbbb3('0x23')][_0xbbb3('0x24')]);return _0x57d268(_0x5b530a[_0xbbb3('0x23')]['message']);}logger[_0xbbb3('0x23')](_0xbbb3('0x1f'),_0x378863,_0x5b530a[_0xbbb3('0x23')][_0xbbb3('0x24')]);return _0x34253a(_0x5b530a[_0xbbb3('0x23')]['message']);}else{logger[_0xbbb3('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x378863,_0xbbb3('0x20'));_0x34253a(_0x5b530a[_0xbbb3('0x25')][_0xbbb3('0x24')]);}})[_0xbbb3('0x26')](function(_0x266fc0){logger[_0xbbb3('0x23')](_0xbbb3('0x1f'),_0x378863,_0x266fc0);_0x57d268(_0x266fc0);});});}function respondWithStatusCode(_0x5c78c3,_0xf42728){_0xf42728=_0xf42728||0xcc;return function(_0x290dcd){if(_0x290dcd){return _0x5c78c3[_0xbbb3('0x27')](_0xf42728);}return _0x5c78c3[_0xbbb3('0x28')](_0xf42728)[_0xbbb3('0x29')]();};}function respondWithResult(_0x15978d,_0x5c962e){_0x5c962e=_0x5c962e||0xc8;return function(_0x3f8615){if(_0x3f8615){return _0x15978d[_0xbbb3('0x28')](_0x5c962e)[_0xbbb3('0x2a')](_0x3f8615);}};}function respondWithFilteredResult(_0x3c0ca2,_0x5a81ac){return function(_0x9d4b89){if(_0x9d4b89){var _0x239baa=typeof _0x5a81ac['offset']===_0xbbb3('0x2b')&&typeof _0x5a81ac[_0xbbb3('0x2c')]===_0xbbb3('0x2b');var _0x569f68=_0x9d4b89[_0xbbb3('0x2d')];var _0x119792=_0x239baa?0x0:_0x5a81ac['offset'];var _0x2611df=_0x239baa?_0x9d4b89['count']:_0x5a81ac[_0xbbb3('0x2e')]+_0x5a81ac['limit'];var _0x2baae5;if(_0x2611df>=_0x569f68){_0x2611df=_0x569f68;_0x2baae5=0xc8;}else{_0x2baae5=0xce;}_0x3c0ca2[_0xbbb3('0x28')](_0x2baae5);return _0x3c0ca2[_0xbbb3('0x2f')]('Content-Range',_0x119792+'-'+_0x2611df+'/'+_0x569f68)[_0xbbb3('0x2a')](_0x9d4b89);}return null;};}function patchUpdates(_0x57e21d){return function(_0x146e48){try{jsonpatch['apply'](_0x146e48,_0x57e21d,!![]);}catch(_0x4b2693){return BPromise[_0xbbb3('0x30')](_0x4b2693);}return _0x146e48['save']();};}function saveUpdates(_0x3ca083,_0x208962){return function(_0x4f4d2b){if(_0x4f4d2b){return _0x4f4d2b[_0xbbb3('0x31')](_0x3ca083)['then'](function(_0x1bd596){return _0x1bd596;});}return null;};}function removeEntity(_0x534a05,_0x4ae275){return function(_0x51ec90){if(_0x51ec90){return _0x51ec90['destroy']()[_0xbbb3('0x1d')](function(){var _0x4f9d35=_0x51ec90[_0xbbb3('0x32')]({'plain':!![]});var _0x5cce82=_0xbbb3('0x33');return db[_0xbbb3('0x34')][_0xbbb3('0x35')]({'where':{'type':_0x5cce82,'resourceId':_0x4f9d35['id']}})[_0xbbb3('0x1d')](function(){return _0x51ec90;});})[_0xbbb3('0x1d')](function(){_0x534a05[_0xbbb3('0x28')](0xcc)[_0xbbb3('0x29')]();});}};}function handleEntityNotFound(_0xebcfd2,_0x17177a){return function(_0x339b8){if(!_0x339b8){_0xebcfd2['sendStatus'](0x194);}return _0x339b8;};}function handleError(_0x412509,_0x32c194){_0x32c194=_0x32c194||0x1f4;return function(_0x353fd2){logger['error'](_0x353fd2['stack']);if(_0x353fd2[_0xbbb3('0x36')]){delete _0x353fd2[_0xbbb3('0x36')];}_0x412509[_0xbbb3('0x28')](_0x32c194)[_0xbbb3('0x37')](_0x353fd2);};}exports[_0xbbb3('0x38')]=function(_0xe4426d,_0x4d1c36){var _0x55d88e={'include':[{'model':db['Pause'],'as':_0xbbb3('0x39')}]},_0x348506={},_0x5738a1={'count':0x0,'rows':[]};var _0x5d455a=_[_0xbbb3('0x3a')](db[_0xbbb3('0x3b')][_0xbbb3('0x3c')],function(_0x5d5095){return{'name':_0x5d5095[_0xbbb3('0x3d')],'type':_0x5d5095[_0xbbb3('0x3e')]['key']};});_0x348506[_0xbbb3('0x3f')]=_[_0xbbb3('0x3a')](_0x5d455a,_0xbbb3('0x36'));_0x348506[_0xbbb3('0x40')]=_[_0xbbb3('0x41')](_0xe4426d[_0xbbb3('0x40')]);_0x348506[_0xbbb3('0x42')]=_[_0xbbb3('0x43')](_0x348506[_0xbbb3('0x3f')],_0x348506[_0xbbb3('0x40')]);_0x55d88e[_0xbbb3('0x44')]=_[_0xbbb3('0x43')](_0x348506['model'],qs[_0xbbb3('0x45')](_0xe4426d[_0xbbb3('0x40')][_0xbbb3('0x45')]));_0x55d88e['attributes']=_0x55d88e[_0xbbb3('0x44')][_0xbbb3('0x46')]?_0x55d88e['attributes']:_0x348506['model'];if(!_0xe4426d[_0xbbb3('0x40')][_0xbbb3('0x47')](_0xbbb3('0x48'))){_0x55d88e[_0xbbb3('0x2c')]=qs['limit'](_0xe4426d[_0xbbb3('0x40')]['limit']);_0x55d88e['offset']=qs[_0xbbb3('0x2e')](_0xe4426d[_0xbbb3('0x40')][_0xbbb3('0x2e')]);}_0x55d88e[_0xbbb3('0x49')]=qs[_0xbbb3('0x4a')](_0xe4426d[_0xbbb3('0x40')][_0xbbb3('0x4a')]);_0x55d88e[_0xbbb3('0x4b')]=qs[_0xbbb3('0x42')](_[_0xbbb3('0x4c')](_0xe4426d['query'],_0x348506[_0xbbb3('0x42')]),_0x5d455a);if(_0xe4426d[_0xbbb3('0x40')][_0xbbb3('0x4d')]){_0x55d88e[_0xbbb3('0x4b')]=_[_0xbbb3('0x4e')](_0x55d88e[_0xbbb3('0x4b')],{'$or':_['map'](_0x5d455a,function(_0x3c18ed){if(_0x3c18ed[_0xbbb3('0x3e')]!==_0xbbb3('0x4f')){var _0x3c0940={};_0x3c0940[_0x3c18ed[_0xbbb3('0x36')]]={'$like':'%'+_0xe4426d['query'][_0xbbb3('0x4d')]+'%'};return _0x3c0940;}})});}_0x55d88e=_[_0xbbb3('0x4e')]({},_0x55d88e,_0xe4426d[_0xbbb3('0x50')]);var _0x38f6d2={'where':_0x55d88e['where']};return db[_0xbbb3('0x3b')]['count'](_0x38f6d2)[_0xbbb3('0x1d')](function(_0x3ef637){_0x5738a1[_0xbbb3('0x2d')]=_0x3ef637;if(_0xe4426d[_0xbbb3('0x40')][_0xbbb3('0x51')]){_0x55d88e[_0xbbb3('0x52')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x55d88e);})[_0xbbb3('0x1d')](function(_0x255a60){_0x5738a1['rows']=_0x255a60;return _0x5738a1;})['then'](respondWithFilteredResult(_0x4d1c36,_0x55d88e))[_0xbbb3('0x26')](handleError(_0x4d1c36,null));};exports[_0xbbb3('0x53')]=function(_0x51f991,_0x5cc1a1){var _0x180d32={'raw':![],'where':{'id':_0x51f991[_0xbbb3('0x54')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3ffef0={};_0x3ffef0['model']=_['keys'](db[_0xbbb3('0x3b')][_0xbbb3('0x3c')]);_0x3ffef0[_0xbbb3('0x40')]=_[_0xbbb3('0x41')](_0x51f991[_0xbbb3('0x40')]);_0x3ffef0[_0xbbb3('0x42')]=_[_0xbbb3('0x43')](_0x3ffef0[_0xbbb3('0x3f')],_0x3ffef0[_0xbbb3('0x40')]);_0x180d32[_0xbbb3('0x44')]=_[_0xbbb3('0x43')](_0x3ffef0[_0xbbb3('0x3f')],qs[_0xbbb3('0x45')](_0x51f991[_0xbbb3('0x40')][_0xbbb3('0x45')]));_0x180d32['attributes']=_0x180d32[_0xbbb3('0x44')][_0xbbb3('0x46')]?_0x180d32[_0xbbb3('0x44')]:_0x3ffef0[_0xbbb3('0x3f')];if(_0x51f991[_0xbbb3('0x40')][_0xbbb3('0x51')]){_0x180d32[_0xbbb3('0x52')]=[{'all':!![]}];}_0x180d32=_[_0xbbb3('0x4e')]({},_0x180d32,_0x51f991[_0xbbb3('0x50')]);return db[_0xbbb3('0x3b')][_0xbbb3('0x55')](_0x180d32)[_0xbbb3('0x1d')](handleEntityNotFound(_0x5cc1a1,null))[_0xbbb3('0x1d')](respondWithResult(_0x5cc1a1,null))['catch'](handleError(_0x5cc1a1,null));};exports[_0xbbb3('0x56')]=function(_0x50ab35,_0x5dc3f5){return db[_0xbbb3('0x3b')][_0xbbb3('0x56')](_0x50ab35[_0xbbb3('0x57')],{})[_0xbbb3('0x1d')](function(_0x104d56){var _0x4618d6=_0x50ab35['user'][_0xbbb3('0x32')]({'plain':!![]});if(!_0x4618d6)throw new Error(_0xbbb3('0x58'));if(_0x4618d6[_0xbbb3('0x59')]===_0xbbb3('0x5a')){var _0x1acede=_0x104d56['get']({'plain':!![]});var _0xc7e4d3=_0xbbb3('0x33');return db[_0xbbb3('0x5b')]['find']({'where':{'name':_0xc7e4d3,'userProfileId':_0x4618d6[_0xbbb3('0x5c')]},'raw':!![]})[_0xbbb3('0x1d')](function(_0x9402ec){if(_0x9402ec&&_0x9402ec[_0xbbb3('0x5d')]===0x0){return db[_0xbbb3('0x34')][_0xbbb3('0x56')]({'name':_0x1acede[_0xbbb3('0x36')],'resourceId':_0x1acede['id'],'type':_0x9402ec[_0xbbb3('0x36')],'sectionId':_0x9402ec['id']},{})[_0xbbb3('0x1d')](function(){return _0x104d56;});}else{return _0x104d56;}})['catch'](function(_0x1832bb){logger['error'](_0xbbb3('0x5e'),_0x1832bb);throw _0x1832bb;});}return _0x104d56;})[_0xbbb3('0x1d')](respondWithResult(_0x5dc3f5,0xc9))[_0xbbb3('0x26')](handleError(_0x5dc3f5,null));};exports['update']=function(_0x4afc4e,_0x2b04c9){if(_0x4afc4e[_0xbbb3('0x57')]['id']){delete _0x4afc4e[_0xbbb3('0x57')]['id'];}return db[_0xbbb3('0x3b')]['find']({'where':{'id':_0x4afc4e[_0xbbb3('0x54')]['id']},'include':[{'model':db[_0xbbb3('0x5f')],'as':_0xbbb3('0x39')}]})[_0xbbb3('0x1d')](handleEntityNotFound(_0x2b04c9,null))[_0xbbb3('0x1d')](saveUpdates(_0x4afc4e[_0xbbb3('0x57')],null))[_0xbbb3('0x1d')](respondWithResult(_0x2b04c9,null))[_0xbbb3('0x26')](handleError(_0x2b04c9,null));};exports[_0xbbb3('0x35')]=function(_0x47b044,_0x21eea4){return db['OpenchannelAccount']['find']({'where':{'id':_0x47b044[_0xbbb3('0x54')]['id']}})['then'](handleEntityNotFound(_0x21eea4,null))[_0xbbb3('0x1d')](removeEntity(_0x21eea4,null))[_0xbbb3('0x26')](handleError(_0x21eea4,null));};exports[_0xbbb3('0x60')]=function(_0x43c54b,_0x2ce038){return db['OpenchannelAccount']['describe']()[_0xbbb3('0x1d')](respondWithResult(_0x2ce038,null))[_0xbbb3('0x26')](handleError(_0x2ce038,null));};exports[_0xbbb3('0x61')]=function(_0x13ab22,_0x3453c1,_0x5844f8){if(_0x13ab22['body']['id']){delete _0x13ab22[_0xbbb3('0x57')]['id'];}return db[_0xbbb3('0x3b')][_0xbbb3('0x55')]({'where':{'id':_0x13ab22[_0xbbb3('0x54')]['id']}})[_0xbbb3('0x1d')](handleEntityNotFound(_0x3453c1,null))[_0xbbb3('0x1d')](function(_0x30e691){if(_0x30e691){_0x13ab22[_0xbbb3('0x57')][_0xbbb3('0x62')]=_0x30e691['id'];return db[_0xbbb3('0x63')][_0xbbb3('0x56')](_0x13ab22['body']);}})[_0xbbb3('0x1d')](respondWithResult(_0x3453c1,null))[_0xbbb3('0x26')](handleError(_0x3453c1,null));};exports['getDispositions']=function(_0x289b89,_0x4368c5,_0x1e01b7){var _0x39a9e7={'raw':![],'where':{}};var _0x5b5d45={};var _0xd86aa1={'count':0x0,'rows':[]};return db[_0xbbb3('0x3b')][_0xbbb3('0x64')]({'where':{'id':_0x289b89[_0xbbb3('0x54')]['id']}})[_0xbbb3('0x1d')](handleEntityNotFound(_0x4368c5,null))[_0xbbb3('0x1d')](function(_0x18af8e){if(_0x18af8e){_0x5b5d45[_0xbbb3('0x3f')]=_[_0xbbb3('0x41')](db[_0xbbb3('0x63')][_0xbbb3('0x3c')]);_0x5b5d45['query']=_['keys'](_0x289b89[_0xbbb3('0x40')]);_0x5b5d45['filters']=_[_0xbbb3('0x43')](_0x5b5d45[_0xbbb3('0x3f')],_0x5b5d45[_0xbbb3('0x40')]);_0x39a9e7[_0xbbb3('0x44')]=_[_0xbbb3('0x43')](_0x5b5d45['model'],qs[_0xbbb3('0x45')](_0x289b89[_0xbbb3('0x40')][_0xbbb3('0x45')]));_0x39a9e7[_0xbbb3('0x44')]=_0x39a9e7['attributes'][_0xbbb3('0x46')]?_0x39a9e7[_0xbbb3('0x44')]:_0x5b5d45[_0xbbb3('0x3f')];if(!_0x289b89['query'][_0xbbb3('0x47')](_0xbbb3('0x48'))){_0x39a9e7['limit']=qs[_0xbbb3('0x2c')](_0x289b89[_0xbbb3('0x40')]['limit']);_0x39a9e7[_0xbbb3('0x2e')]=qs[_0xbbb3('0x2e')](_0x289b89[_0xbbb3('0x40')][_0xbbb3('0x2e')]);}_0x39a9e7['order']=qs['sort'](_0x289b89[_0xbbb3('0x40')]['sort']);_0x39a9e7[_0xbbb3('0x4b')]=qs[_0xbbb3('0x42')](_[_0xbbb3('0x4c')](_0x289b89[_0xbbb3('0x40')],_0x5b5d45[_0xbbb3('0x42')]));_0x39a9e7['where'][_0xbbb3('0x62')]=_0x18af8e['id'];if(_0x289b89['query'][_0xbbb3('0x4d')]){_0x39a9e7[_0xbbb3('0x4b')]=_['merge'](_0x39a9e7[_0xbbb3('0x4b')],{'$or':_[_0xbbb3('0x3a')](_0x39a9e7[_0xbbb3('0x44')],function(_0x5d8f13){var _0x578d58={};_0x578d58[_0x5d8f13]={'$like':'%'+_0x289b89[_0xbbb3('0x40')][_0xbbb3('0x4d')]+'%'};return _0x578d58;})});}_0x39a9e7=_['merge']({},_0x39a9e7,_0x289b89[_0xbbb3('0x50')]);return db[_0xbbb3('0x63')][_0xbbb3('0x2d')]({'where':_0x39a9e7[_0xbbb3('0x4b')]})[_0xbbb3('0x1d')](function(_0x53f677){_0xd86aa1[_0xbbb3('0x2d')]=_0x53f677;if(_0x289b89[_0xbbb3('0x40')][_0xbbb3('0x51')]){_0x39a9e7['include']=[{'all':!![]}];}return db[_0xbbb3('0x63')]['findAll'](_0x39a9e7);})['then'](function(_0x3a4bae){_0xd86aa1['rows']=_0x3a4bae;return _0xd86aa1;});}})[_0xbbb3('0x1d')](respondWithFilteredResult(_0x4368c5,_0x39a9e7))[_0xbbb3('0x26')](handleError(_0x4368c5,null));};exports[_0xbbb3('0x65')]=function(_0x5417a5,_0x33ba04,_0x2b0745){return db[_0xbbb3('0x3b')][_0xbbb3('0x55')]({'where':{'id':_0x5417a5['params']['id']}})['then'](handleEntityNotFound(_0x33ba04,null))['then'](function(_0x280041){if(_0x280041){return _0x280041[_0xbbb3('0x65')](_0x5417a5[_0xbbb3('0x40')][_0xbbb3('0x66')]);}})[_0xbbb3('0x1d')](respondWithStatusCode(_0x33ba04,null))[_0xbbb3('0x26')](handleError(_0x33ba04,null));};exports['addAnswer']=function(_0x2dd84a,_0xaacc9,_0x3124f4){if(_0x2dd84a['body']['id']){delete _0x2dd84a[_0xbbb3('0x57')]['id'];}return db['OpenchannelAccount'][_0xbbb3('0x55')]({'where':{'id':_0x2dd84a[_0xbbb3('0x54')]['id']}})[_0xbbb3('0x1d')](handleEntityNotFound(_0xaacc9,null))[_0xbbb3('0x1d')](function(_0x31e829){if(_0x31e829){_0x2dd84a['body']['OpenchannelAccountId']=_0x31e829['id'];return db[_0xbbb3('0x67')][_0xbbb3('0x56')](_0x2dd84a[_0xbbb3('0x57')]);}})[_0xbbb3('0x1d')](respondWithResult(_0xaacc9,null))[_0xbbb3('0x26')](handleError(_0xaacc9,null));};exports[_0xbbb3('0x68')]=function(_0x460202,_0x57af56,_0x3790a8){var _0x17d912={'raw':![],'where':{}};var _0x5bc54a={};var _0x4e663b={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x460202[_0xbbb3('0x54')]['id']}})[_0xbbb3('0x1d')](handleEntityNotFound(_0x57af56,null))[_0xbbb3('0x1d')](function(_0x7a163b){if(_0x7a163b){_0x5bc54a[_0xbbb3('0x3f')]=_[_0xbbb3('0x41')](db[_0xbbb3('0x67')][_0xbbb3('0x3c')]);_0x5bc54a['query']=_['keys'](_0x460202[_0xbbb3('0x40')]);_0x5bc54a[_0xbbb3('0x42')]=_['intersection'](_0x5bc54a[_0xbbb3('0x3f')],_0x5bc54a[_0xbbb3('0x40')]);_0x17d912['attributes']=_[_0xbbb3('0x43')](_0x5bc54a['model'],qs[_0xbbb3('0x45')](_0x460202[_0xbbb3('0x40')][_0xbbb3('0x45')]));_0x17d912[_0xbbb3('0x44')]=_0x17d912[_0xbbb3('0x44')]['length']?_0x17d912[_0xbbb3('0x44')]:_0x5bc54a['model'];if(!_0x460202[_0xbbb3('0x40')][_0xbbb3('0x47')]('nolimit')){_0x17d912[_0xbbb3('0x2c')]=qs[_0xbbb3('0x2c')](_0x460202[_0xbbb3('0x40')][_0xbbb3('0x2c')]);_0x17d912[_0xbbb3('0x2e')]=qs['offset'](_0x460202[_0xbbb3('0x40')][_0xbbb3('0x2e')]);}_0x17d912[_0xbbb3('0x49')]=qs[_0xbbb3('0x4a')](_0x460202[_0xbbb3('0x40')][_0xbbb3('0x4a')]);_0x17d912[_0xbbb3('0x4b')]=qs[_0xbbb3('0x42')](_[_0xbbb3('0x4c')](_0x460202[_0xbbb3('0x40')],_0x5bc54a[_0xbbb3('0x42')]));_0x17d912[_0xbbb3('0x4b')][_0xbbb3('0x62')]=_0x7a163b['id'];if(_0x460202[_0xbbb3('0x40')]['filter']){_0x17d912['where']=_[_0xbbb3('0x4e')](_0x17d912[_0xbbb3('0x4b')],{'$or':_[_0xbbb3('0x3a')](_0x17d912[_0xbbb3('0x44')],function(_0x43053d){var _0x33d98b={};_0x33d98b[_0x43053d]={'$like':'%'+_0x460202[_0xbbb3('0x40')][_0xbbb3('0x4d')]+'%'};return _0x33d98b;})});}_0x17d912=_[_0xbbb3('0x4e')]({},_0x17d912,_0x460202[_0xbbb3('0x50')]);return db[_0xbbb3('0x67')]['count']({'where':_0x17d912[_0xbbb3('0x4b')]})[_0xbbb3('0x1d')](function(_0x8518cb){_0x4e663b[_0xbbb3('0x2d')]=_0x8518cb;if(_0x460202[_0xbbb3('0x40')]['includeAll']){_0x17d912[_0xbbb3('0x52')]=[{'all':!![]}];}return db[_0xbbb3('0x67')][_0xbbb3('0x69')](_0x17d912);})[_0xbbb3('0x1d')](function(_0x54f27a){_0x4e663b['rows']=_0x54f27a;return _0x4e663b;});}})[_0xbbb3('0x1d')](respondWithFilteredResult(_0x57af56,_0x17d912))[_0xbbb3('0x26')](handleError(_0x57af56,null));};exports['removeAnswers']=function(_0x50ae13,_0xa1028,_0x35aa0b){return db[_0xbbb3('0x3b')][_0xbbb3('0x55')]({'where':{'id':_0x50ae13[_0xbbb3('0x54')]['id']}})['then'](handleEntityNotFound(_0xa1028,null))[_0xbbb3('0x1d')](function(_0x322233){if(_0x322233){return _0x322233[_0xbbb3('0x6a')](_0x50ae13[_0xbbb3('0x40')][_0xbbb3('0x66')]);}})[_0xbbb3('0x1d')](respondWithStatusCode(_0xa1028,null))[_0xbbb3('0x26')](handleError(_0xa1028,null));};exports[_0xbbb3('0x6b')]=function(_0x31c98d,_0x288065,_0x2a0b8b){var _0x500887={'body':_0x31c98d['body'],'channel':_0xbbb3('0x6c')};var _0x402a4a=[];var _0x1021dc=[];var _0x16f053={};var _0x54588b=![];return db[_0xbbb3('0x6d')][_0xbbb3('0x60')]()[_0xbbb3('0x1d')](function(_0x142196){if(!_0x142196){throw new db[(_0xbbb3('0x6e'))][(_0xbbb3('0x6f'))]('no\x20available\x20attributes');}_0x402a4a=_['difference'](_['keys'](_0x142196),[_0xbbb3('0x70'),_0xbbb3('0x71')]);_0x1021dc=_[_0xbbb3('0x72')](_[_0xbbb3('0x41')](_0x142196),[_0xbbb3('0x70'),'updatedAt',_0xbbb3('0x73'),'ListId']);if(_0x31c98d[_0xbbb3('0x57')]['id']){delete _0x31c98d['body']['id'];}if(_[_0xbbb3('0x74')](_0x31c98d['body']['from'])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x57')])||_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x57')]===''){throw new db[(_0xbbb3('0x6e'))][(_0xbbb3('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x31c98d['body']['mapKey'])){throw new db[(_0xbbb3('0x6e'))][(_0xbbb3('0x6f'))](_0xbbb3('0x75')+_0x1021dc);}if(!_['includes'](_0x1021dc,_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x76')])){throw new db[(_0xbbb3('0x6e'))]['ValidationError'](_0xbbb3('0x77')+_0x1021dc);}_0x16f053[_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x76')]]=_0x31c98d[_0xbbb3('0x57')]['from'];})[_0xbbb3('0x1d')](function(){return db[_0xbbb3('0x3b')]['find']({'where':{'id':_0x31c98d['params']['id']},'include':[{'model':db[_0xbbb3('0x78')],'as':_0xbbb3('0x79'),'include':[{'model':db[_0xbbb3('0x6d')],'as':'Contacts','where':_0x16f053,'limit':0x1,'order':[['updatedAt',_0xbbb3('0x7a')]]}]},{'model':db[_0xbbb3('0x7b')],'as':_0xbbb3('0x7c')}]});})[_0xbbb3('0x1d')](handleEntityNotFound(_0x288065,null))['then'](function(_0x54604d){if(_0x54604d&&_0x54604d[_0xbbb3('0x79')]){_0x500887[_0xbbb3('0x7d')]=_0x54604d;_0x500887['applications']=_0x54604d['Applications'];_0x500887[_0xbbb3('0x7e')]=_0x54604d['List'];_0x500887[_0xbbb3('0x7f')]=_[_0xbbb3('0x80')](_0x500887['applications'],[_0xbbb3('0x81')],[_0xbbb3('0x82')]);if(_0x500887[_0xbbb3('0x7d')]['Applications']){delete _0x500887['account'][_0xbbb3('0x7c')];}if(_0x500887[_0xbbb3('0x7d')][_0xbbb3('0x79')]&&_0x500887['account'][_0xbbb3('0x79')][_0xbbb3('0x83')][_0xbbb3('0x46')]){return _0x500887[_0xbbb3('0x7d')][_0xbbb3('0x79')]['Contacts'][0x0];}var _0x1d66c1=_[_0xbbb3('0x15')](_0x31c98d['body'],{'firstName':_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x84')],'ListId':_0x54604d[_0xbbb3('0x85')]});_0x1d66c1[_0x31c98d[_0xbbb3('0x57')]['mapKey']]=_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x84')];return db['CmContact'][_0xbbb3('0x56')](_0x1d66c1,{'fields':_0x402a4a,'raw':!![]});}})[_0xbbb3('0x1d')](handleEntityNotFound(_0x288065,null))[_0xbbb3('0x1d')](function(_0x287ca6){_0x500887['contact']=_0x287ca6;if(_0x287ca6){var _0x19865b={'ContactId':_0x287ca6['id'],'OpenchannelAccountId':_0x31c98d[_0xbbb3('0x54')]['id'],'from':(_0x287ca6[_0xbbb3('0x86')]||'')+'\x20'+(_0x287ca6[_0xbbb3('0x87')]||'')};var _0x4a76af={'OpenchannelAccountId':_0x31c98d['params']['id'],'closed':![]};if(_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x88')]){_0x4a76af[_0xbbb3('0x88')]=_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x88')];return db['OpenchannelInteraction']['find']({'where':_0x4a76af})['then'](function(_0x28332b){if(_0x28332b){return[_0x28332b,![]];}_0x19865b[_0xbbb3('0x88')]=_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x88')];_0x19865b['externalUrl']=_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x89')];return db[_0xbbb3('0x8a')][_0xbbb3('0x56')](_0x19865b)[_0xbbb3('0x1d')](function(_0x373b9a){return[_0x373b9a,!![]];});});}else{_0x4a76af[_0xbbb3('0x88')]=null;}_0x4a76af[_0xbbb3('0x8b')]=_0x287ca6['id'];return db[_0xbbb3('0x8a')]['find']({'where':_0x4a76af})[_0xbbb3('0x1d')](function(_0xcec1bf){if(_0xcec1bf){return[_0xcec1bf,![]];}return db['OpenchannelInteraction'][_0xbbb3('0x56')](_0x19865b)[_0xbbb3('0x1d')](function(_0x54f375){return[_0x54f375,!![]];});});}})[_0xbbb3('0x8c')](function(_0x1e777b,_0x4232ef){if(_0x1e777b){_0x54588b=_0x4232ef;if(!_0x4232ef){var _0x5bdfd5={'from':(_0x500887[_0xbbb3('0x8d')]['firstName']||'')+'\x20'+(_0x500887[_0xbbb3('0x8d')][_0xbbb3('0x87')]||'')};if(_0x31c98d[_0xbbb3('0x57')]['threadId']&&_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x8e')]&&_0x31c98d['body']['threadId']!=_0x31c98d['body']['messageId']){_0x5bdfd5[_0xbbb3('0x88')]=_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x8e')];}return _0x1e777b[_0xbbb3('0x31')](_0x5bdfd5);}else{return _0x1e777b;}}})[_0xbbb3('0x1d')](function(_0x2f7091){_0x500887['interaction']=_0x2f7091[_0xbbb3('0x32')]({'plain':!![]});_0x500887[_0xbbb3('0x8f')][_0xbbb3('0x90')]=_0x54588b;if(_0x500887['interaction'][_0xbbb3('0x90')]){if(_0x500887[_0xbbb3('0x7d')][_0xbbb3('0x91')]){_0x500887[_0xbbb3('0x7f')][_0xbbb3('0x92')]({'id':0x0,'priority':_0x500887[_0xbbb3('0x7f')][_0xbbb3('0x46')]+0x1,'app':_0xbbb3('0x93'),'appdata':_0xbbb3('0x94'),'interval':_0xbbb3('0x95')});}}return db[_0xbbb3('0x96')][_0xbbb3('0x56')]({'body':_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x57')],'OpenchannelAccountId':_0x31c98d[_0xbbb3('0x54')]['id'],'OpenchannelInteractionId':_0x2f7091['id'],'direction':'in','ContactId':_0x500887[_0xbbb3('0x8d')]['id'],'AttachmentId':_0x31c98d[_0xbbb3('0x57')][_0xbbb3('0x97')]});})[_0xbbb3('0x1d')](function(_0x19cc8d){_0x500887[_0xbbb3('0x24')]=_0x19cc8d;if(_0x500887[_0xbbb3('0x8f')][_0xbbb3('0x98')]){return db[_0xbbb3('0x99')][_0xbbb3('0x55')]({'attributes':['id',_0xbbb3('0x36')],'where':{'id':_0x500887[_0xbbb3('0x8f')][_0xbbb3('0x98')]}})[_0xbbb3('0x1d')](function(_0x565c5a){if(_0x565c5a){_0x500887['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xbbb3('0x9a'),'appdata':_0x565c5a['name']+','+(_0x500887['account'][_0xbbb3('0x9b')]||0xa),'interval':_0xbbb3('0x95')});_0x500887[_0xbbb3('0x9c')]=![];}return respondWithRpcPromise(_0xbbb3('0x9d'),'startRouting',_0x500887);});}return respondWithRpcPromise(_0xbbb3('0x9d'),_0xbbb3('0x9e'),_0x500887);})[_0xbbb3('0x1d')](function(_0x221282){respondWithRpcPromise(_0xbbb3('0x9f'),_0xbbb3('0x9f'),{'event':_0xbbb3('0x6b'),'message':_0x221282},client9002);return _0x221282;})[_0xbbb3('0x1d')](respondWithResult(_0x288065,null))[_0xbbb3('0x26')](handleError(_0x288065,null));};exports[_0xbbb3('0xa0')]=function(_0x5e644a,_0x2ffd80){var _0x49b19b=_0x5e644a['params']['id'];var _0x4cd686=_0x5e644a[_0xbbb3('0x57')];var _0x1a7f32=0xc8;var _0x493a5a=null;return db[_0xbbb3('0xa1')][_0xbbb3('0xa2')]({'isolationLevel':db[_0xbbb3('0xa1')][_0xbbb3('0xa3')][_0xbbb3('0xa4')][_0xbbb3('0xa5')]},function(_0x330e63){return db[_0xbbb3('0x3b')][_0xbbb3('0x64')]({'where':{'id':_0x49b19b},'transaction':_0x330e63})[_0xbbb3('0x1d')](function(_0x5fc249){if(_0x5fc249){return db['OpenchannelApplication'][_0xbbb3('0x35')]({'where':{'OpenchannelAccountId':_0x49b19b},'transaction':_0x330e63})[_0xbbb3('0x1d')](function(){var _0x1135a6=_['map'](_0x4cd686,function(_0x363cef){_0x363cef[_0xbbb3('0x62')]=_0x49b19b;return _0x363cef;});return db['OpenchannelApplication']['bulkCreate'](_0x1135a6,{'transaction':_0x330e63});});}else{_0x1a7f32=0x194;_0x493a5a=[];}});})[_0xbbb3('0x1d')](function(){if(_0x1a7f32!==0x194){return db[_0xbbb3('0x7b')][_0xbbb3('0xa6')]({'where':{'OpenchannelAccountId':_0x49b19b},'order':_0xbbb3('0x81')})['then'](function(_0x13e1c9){_0x493a5a=_0x13e1c9;});}})[_0xbbb3('0x26')](function(_0x1fe0dd){_0x1a7f32=0x1f4;logger[_0xbbb3('0x23')](_0x1fe0dd[_0xbbb3('0xa7')]);if(_0x1fe0dd['name']){delete _0x1fe0dd[_0xbbb3('0x36')];}_0x493a5a=_0x1fe0dd;})[_0xbbb3('0xa8')](function(){if(_0x493a5a===null){_0x2ffd80[_0xbbb3('0x27')](_0x1a7f32);}else{if(_0x1a7f32===0x1f4){_0x2ffd80[_0xbbb3('0x28')](_0x1a7f32)['send'](_0x493a5a);}else{_0x2ffd80['status'](_0x1a7f32)[_0xbbb3('0x2a')](_0x493a5a);}}});};exports[_0xbbb3('0xa9')]=function(_0x5c5cc,_0x3603e4,_0x500e78){var _0x33e588={};var _0x1706cb={};var _0x473fc8;var _0x5b660d;return db[_0xbbb3('0x3b')][_0xbbb3('0x64')]({'where':{'id':_0x5c5cc[_0xbbb3('0x54')]['id']}})[_0xbbb3('0x1d')](handleEntityNotFound(_0x3603e4,null))['then'](function(_0x3e54a4){if(_0x3e54a4){_0x473fc8=_0x3e54a4;_0x1706cb[_0xbbb3('0x3f')]=_[_0xbbb3('0x41')](db['OpenchannelApplication'][_0xbbb3('0x3c')]);_0x1706cb[_0xbbb3('0x40')]=_[_0xbbb3('0x41')](_0x5c5cc[_0xbbb3('0x40')]);_0x1706cb['filters']=_['intersection'](_0x1706cb['model'],_0x1706cb['query']);_0x33e588[_0xbbb3('0x44')]=_[_0xbbb3('0x43')](_0x1706cb[_0xbbb3('0x3f')],qs['fields'](_0x5c5cc[_0xbbb3('0x40')][_0xbbb3('0x45')]));_0x33e588['attributes']=_0x33e588['attributes']['length']?_0x33e588[_0xbbb3('0x44')]:_0x1706cb[_0xbbb3('0x3f')];_0x33e588[_0xbbb3('0x49')]=qs['sort'](_0x5c5cc['query'][_0xbbb3('0x4a')]);_0x33e588[_0xbbb3('0x4b')]=qs[_0xbbb3('0x42')](_[_0xbbb3('0x4c')](_0x5c5cc['query'],_0x1706cb[_0xbbb3('0x42')]));if(_0x5c5cc[_0xbbb3('0x40')][_0xbbb3('0x4d')]){_0x33e588['where']=_[_0xbbb3('0x4e')](_0x33e588['where'],{'$or':_[_0xbbb3('0x3a')](_0x33e588[_0xbbb3('0x44')],function(_0x384d50){var _0x249c7b={};_0x249c7b[_0x384d50]={'$like':'%'+_0x5c5cc[_0xbbb3('0x40')][_0xbbb3('0x4d')]+'%'};return _0x249c7b;})});}_0x33e588=_[_0xbbb3('0x4e')]({},_0x33e588,_0x5c5cc[_0xbbb3('0x50')]);return _0x473fc8[_0xbbb3('0xa9')](_0x33e588);}})[_0xbbb3('0x1d')](function(_0x440cbd){if(_0x440cbd){_0x5b660d=_0x440cbd[_0xbbb3('0x46')];if(!_0x5c5cc[_0xbbb3('0x40')][_0xbbb3('0x47')](_0xbbb3('0x48'))){_0x33e588[_0xbbb3('0x2c')]=qs['limit'](_0x5c5cc['query'][_0xbbb3('0x2c')]);_0x33e588[_0xbbb3('0x2e')]=qs[_0xbbb3('0x2e')](_0x5c5cc[_0xbbb3('0x40')][_0xbbb3('0x2e')]);}return _0x473fc8[_0xbbb3('0xa9')](_0x33e588);}})[_0xbbb3('0x1d')](function(_0x294f92){if(_0x294f92){return _0x294f92?{'count':_0x5b660d,'rows':_0x294f92}:null;}})[_0xbbb3('0x1d')](respondWithResult(_0x3603e4,null))[_0xbbb3('0x26')](handleError(_0x3603e4,null));};exports[_0xbbb3('0xaa')]=function(_0x3d6356,_0x47ef46,_0x299a77){var _0x2fe746={'raw':![],'where':{}};var _0x3db5d9={};var _0x2d4976={'count':0x0,'rows':[]};return db[_0xbbb3('0x3b')]['findOne']({'where':{'id':_0x3d6356[_0xbbb3('0x54')]['id']}})[_0xbbb3('0x1d')](handleEntityNotFound(_0x47ef46,null))[_0xbbb3('0x1d')](function(_0x2192da){if(_0x2192da){_0x3db5d9['model']=_[_0xbbb3('0x41')](db['OpenchannelInteraction'][_0xbbb3('0x3c')]);_0x3db5d9[_0xbbb3('0x40')]=_[_0xbbb3('0x41')](_0x3d6356[_0xbbb3('0x40')]);_0x3db5d9[_0xbbb3('0x42')]=_[_0xbbb3('0x43')](_0x3db5d9[_0xbbb3('0x3f')],_0x3db5d9[_0xbbb3('0x40')]);_0x2fe746[_0xbbb3('0x44')]=_[_0xbbb3('0x43')](_0x3db5d9[_0xbbb3('0x3f')],qs[_0xbbb3('0x45')](_0x3d6356['query'][_0xbbb3('0x45')]));_0x2fe746[_0xbbb3('0x44')]=_0x2fe746[_0xbbb3('0x44')]['length']?_0x2fe746['attributes']:_0x3db5d9[_0xbbb3('0x3f')];if(!_0x3d6356[_0xbbb3('0x40')][_0xbbb3('0x47')](_0xbbb3('0x48'))){_0x2fe746[_0xbbb3('0x2c')]=qs[_0xbbb3('0x2c')](_0x3d6356[_0xbbb3('0x40')]['limit']);_0x2fe746[_0xbbb3('0x2e')]=qs[_0xbbb3('0x2e')](_0x3d6356['query'][_0xbbb3('0x2e')]);}_0x2fe746[_0xbbb3('0x49')]=qs[_0xbbb3('0x4a')](_0x3d6356[_0xbbb3('0x40')][_0xbbb3('0x4a')]);_0x2fe746[_0xbbb3('0x4b')]=qs[_0xbbb3('0x42')](_[_0xbbb3('0x4c')](_0x3d6356[_0xbbb3('0x40')],_0x3db5d9[_0xbbb3('0x42')]));_0x2fe746[_0xbbb3('0x4b')][_0xbbb3('0x62')]=_0x2192da['id'];if(_0x3d6356[_0xbbb3('0x40')]['filter']){_0x2fe746[_0xbbb3('0x4b')]=_[_0xbbb3('0x4e')](_0x2fe746[_0xbbb3('0x4b')],{'$or':_[_0xbbb3('0x3a')](_0x2fe746[_0xbbb3('0x44')],function(_0x2aabc1){var _0x3ef054={};_0x3ef054[_0x2aabc1]={'$like':'%'+_0x3d6356[_0xbbb3('0x40')][_0xbbb3('0x4d')]+'%'};return _0x3ef054;})});}_0x2fe746=_[_0xbbb3('0x4e')]({},_0x2fe746,_0x3d6356[_0xbbb3('0x50')]);return db[_0xbbb3('0x8a')]['count']({'where':_0x2fe746[_0xbbb3('0x4b')]})[_0xbbb3('0x1d')](function(_0x2834d0){_0x2d4976['count']=_0x2834d0;if(_0x3d6356[_0xbbb3('0x40')][_0xbbb3('0x51')]){_0x2fe746[_0xbbb3('0x52')]=[{'model':db[_0xbbb3('0x6d')],'as':'Contact','required':![]},{'model':db[_0xbbb3('0x99')],'as':'Owner','attributes':[_0xbbb3('0x36'),'fullname',_0xbbb3('0xab')],'required':![]},{'model':db[_0xbbb3('0xac')],'as':_0xbbb3('0xad'),'attributes':['id',_0xbbb3('0x36'),'color'],'where':_0x3d6356[_0xbbb3('0x40')][_0xbbb3('0xae')]?{'id':_0x3d6356['query'][_0xbbb3('0xae')]}:undefined,'required':_0x3d6356['query'][_0xbbb3('0xae')]?!![]:![]}];}return db[_0xbbb3('0x8a')][_0xbbb3('0x69')](_0x2fe746);})['then'](function(_0x271bf2){_0x2d4976['rows']=_0x271bf2;return _0x2d4976;});}})[_0xbbb3('0x1d')](respondWithFilteredResult(_0x47ef46,_0x2fe746))[_0xbbb3('0x26')](handleError(_0x47ef46,null));};exports['addAgents']=function(_0x43a810,_0x2b6fd5,_0x150aa8){return db[_0xbbb3('0x3b')]['find']({'where':{'id':_0x43a810[_0xbbb3('0x54')]['id']}})['then'](handleEntityNotFound(_0x2b6fd5,null))[_0xbbb3('0x1d')](function(_0x34ffaf){if(_0x34ffaf){return _0x34ffaf[_0xbbb3('0xaf')](_0x43a810[_0xbbb3('0x57')]['ids'],_[_0xbbb3('0xb0')](_0x43a810[_0xbbb3('0x57')],[_0xbbb3('0x66'),'id'])||{})[_0xbbb3('0x8c')](function(_0x2cacd8){for(var _0x27c64a=0x0;_0x27c64a<_0x43a810['body'][_0xbbb3('0x66')][_0xbbb3('0x46')];_0x27c64a+=0x1){socket[_0xbbb3('0xb1')](_0xbbb3('0xb2'),{'UserId':Number(_0x43a810['body']['ids'][_0x27c64a]),'OpenchannelAccountId':Number(_0x43a810[_0xbbb3('0x54')]['id'])});}return _0x2cacd8;});}})[_0xbbb3('0x1d')](respondWithResult(_0x2b6fd5,null))[_0xbbb3('0x26')](handleError(_0x2b6fd5,null));};exports[_0xbbb3('0xb3')]=function(_0x4c7e7f,_0x1783fd,_0x45873c){return db['OpenchannelAccount'][_0xbbb3('0x55')]({'where':{'id':_0x4c7e7f[_0xbbb3('0x54')]['id']}})[_0xbbb3('0x1d')](handleEntityNotFound(_0x1783fd,null))[_0xbbb3('0x1d')](function(_0x5767c0){if(_0x5767c0){return _0x5767c0['removeAgents'](_0x4c7e7f['query'][_0xbbb3('0x66')])[_0xbbb3('0x1d')](function(){if(_[_0xbbb3('0xb4')](_0x4c7e7f['query'][_0xbbb3('0x66')])){for(var _0x5ea4ff=0x0;_0x5ea4ff<_0x4c7e7f[_0xbbb3('0x40')][_0xbbb3('0x66')]['length'];_0x5ea4ff+=0x1){socket[_0xbbb3('0xb1')](_0xbbb3('0xb5'),{'UserId':Number(_0x4c7e7f[_0xbbb3('0x40')][_0xbbb3('0x66')][_0x5ea4ff]),'OpenchannelAccountId':Number(_0x4c7e7f[_0xbbb3('0x54')]['id'])});}}else{socket[_0xbbb3('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4c7e7f[_0xbbb3('0x40')][_0xbbb3('0x66')]),'OpenchannelAccountId':Number(_0x4c7e7f[_0xbbb3('0x54')]['id'])});}});}})[_0xbbb3('0x1d')](respondWithStatusCode(_0x1783fd,null))['catch'](handleError(_0x1783fd,null));};exports[_0xbbb3('0xb6')]=function(_0x2bfacb,_0x379344,_0x208be8){var _0xeef1f5={};var _0x48b9a3={};var _0x27db3f;var _0x161922;return db[_0xbbb3('0x3b')][_0xbbb3('0x64')]({'where':{'id':_0x2bfacb[_0xbbb3('0x54')]['id']}})[_0xbbb3('0x1d')](handleEntityNotFound(_0x379344,null))['then'](function(_0x4cf114){if(_0x4cf114){_0x27db3f=_0x4cf114;_0x48b9a3[_0xbbb3('0x3f')]=_[_0xbbb3('0x41')](db['User'][_0xbbb3('0x3c')]);_0x48b9a3[_0xbbb3('0x40')]=_['keys'](_0x2bfacb[_0xbbb3('0x40')]);_0x48b9a3[_0xbbb3('0x42')]=_[_0xbbb3('0x43')](_0x48b9a3[_0xbbb3('0x3f')],_0x48b9a3['query']);_0xeef1f5[_0xbbb3('0x44')]=_[_0xbbb3('0x43')](_0x48b9a3[_0xbbb3('0x3f')],qs['fields'](_0x2bfacb[_0xbbb3('0x40')][_0xbbb3('0x45')]));_0xeef1f5['attributes']=_0xeef1f5[_0xbbb3('0x44')][_0xbbb3('0x46')]?_0xeef1f5[_0xbbb3('0x44')]:_0x48b9a3['model'];_0xeef1f5[_0xbbb3('0x49')]=qs[_0xbbb3('0x4a')](_0x2bfacb['query'][_0xbbb3('0x4a')]);_0xeef1f5['where']=qs[_0xbbb3('0x42')](_[_0xbbb3('0x4c')](_0x2bfacb['query'],_0x48b9a3['filters']));if(_0x2bfacb[_0xbbb3('0x40')][_0xbbb3('0x4d')]){_0xeef1f5[_0xbbb3('0x4b')]=_[_0xbbb3('0x4e')](_0xeef1f5['where'],{'$or':_[_0xbbb3('0x3a')](_0xeef1f5[_0xbbb3('0x44')],function(_0x1203fe){var _0x21948b={};_0x21948b[_0x1203fe]={'$like':'%'+_0x2bfacb[_0xbbb3('0x40')][_0xbbb3('0x4d')]+'%'};return _0x21948b;})});}_0xeef1f5=_['merge']({},_0xeef1f5,_0x2bfacb[_0xbbb3('0x50')]);return _0x27db3f[_0xbbb3('0xb6')](_0xeef1f5);}})['then'](function(_0x584219){if(_0x584219){_0x161922=_0x584219[_0xbbb3('0x46')];if(!_0x2bfacb[_0xbbb3('0x40')][_0xbbb3('0x47')](_0xbbb3('0x48'))){_0xeef1f5[_0xbbb3('0x2c')]=qs['limit'](_0x2bfacb[_0xbbb3('0x40')][_0xbbb3('0x2c')]);_0xeef1f5['offset']=qs['offset'](_0x2bfacb[_0xbbb3('0x40')][_0xbbb3('0x2e')]);}return _0x27db3f[_0xbbb3('0xb6')](_0xeef1f5);}})[_0xbbb3('0x1d')](function(_0x3f5afb){if(_0x3f5afb){return _0x3f5afb?{'count':_0x161922,'rows':_0x3f5afb}:null;}})[_0xbbb3('0x1d')](respondWithResult(_0x379344,null))[_0xbbb3('0x26')](handleError(_0x379344,null));};exports[_0xbbb3('0x37')]=function(_0x133844,_0x283eb4,_0x23993c){var _0x52eb4a,_0x306bb2,_0x402830;if(_[_0xbbb3('0x74')](_0x133844[_0xbbb3('0x57')][_0xbbb3('0x57')])||_0x133844[_0xbbb3('0x57')][_0xbbb3('0x57')]===''){throw new db[(_0xbbb3('0x6e'))][(_0xbbb3('0x6f'))](_0xbbb3('0xb7'));}if(_[_0xbbb3('0x74')](_0x133844[_0xbbb3('0x57')]['to'])){}_0x52eb4a=_0x133844[_0xbbb3('0x57')]['to'];return db[_0xbbb3('0x3b')][_0xbbb3('0x64')]({'where':{'id':_0x133844['params']['id']}})['then'](handleEntityNotFound(_0x283eb4,null))['then'](function(_0x3bccd0){if(_0x3bccd0){return db[_0xbbb3('0x3b')]['find']({'where':{'id':_0x3bccd0['id']},'include':[{'model':db[_0xbbb3('0x78')],'as':'List','include':[{'model':db[_0xbbb3('0x6d')],'as':'Contacts','where':{[_0x3bccd0[_0xbbb3('0x76')]]:_0x52eb4a},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x283eb4,null))[_0xbbb3('0x1d')](function(_0x5e3509){if(_0x5e3509&&_0x5e3509[_0xbbb3('0x79')]){_0x306bb2=_0x5e3509[_0xbbb3('0x32')]({'plain':!![]});if(_0x306bb2[_0xbbb3('0x79')]&&_0x306bb2['List'][_0xbbb3('0x83')]['length']){return _0x306bb2[_0xbbb3('0x79')][_0xbbb3('0x83')][0x0];}return db[_0xbbb3('0x6d')][_0xbbb3('0x56')](_[_0xbbb3('0x15')](_0x133844[_0xbbb3('0x57')],{'firstName':_0x52eb4a,[_0x5e3509[_0xbbb3('0x76')]]:_0x52eb4a,'phone':_0x52eb4a,'ListId':_0x306bb2[_0xbbb3('0x85')]}));}})[_0xbbb3('0x1d')](handleEntityNotFound(_0x283eb4,null))[_0xbbb3('0x1d')](function(_0x49cbc4){if(_0x49cbc4){_0x402830=_0x49cbc4;return db[_0xbbb3('0x8a')][_0xbbb3('0x55')]({'where':{'ContactId':_0x402830['id'],'closed':![],'OpenchannelAccountId':_0x306bb2['id']}})[_0xbbb3('0x1d')](function(_0x36d6ed){if(_0x36d6ed){return[_0x36d6ed,![]];}return db['OpenchannelInteraction'][_0xbbb3('0x56')]({'UserId':_0x133844[_0xbbb3('0x5a')]['id'],'ContactId':_0x402830['id'],'OpenchannelAccountId':_0x306bb2['id'],'lastMsgDirection':_0xbbb3('0xb8'),'Messages':[_[_0xbbb3('0x4e')](_0x133844[_0xbbb3('0x57')],{'read':![],'body':_0x133844[_0xbbb3('0x57')][_0xbbb3('0x57')],'OpenchannelAccountId':_0x306bb2['id'],'UserId':_0x133844[_0xbbb3('0x5a')]['id'],'ContactId':_0x402830['id']})]},{'include':[{'model':db[_0xbbb3('0x96')],'as':'Messages'}]})[_0xbbb3('0x1d')](function(_0xf8749c){return[_0xf8749c,!![]];});});}})[_0xbbb3('0x8c')](function(_0x5e5bab,_0x5e8e7e){if(_0x5e8e7e){return _0x5e5bab;}return db[_0xbbb3('0x96')]['create'](_[_0xbbb3('0x4e')](_0x133844[_0xbbb3('0x57')],{'read':![],'body':_0x133844[_0xbbb3('0x57')][_0xbbb3('0x57')],'OpenchannelAccountId':_0x306bb2['id'],'OpenchannelInteractionId':_0x5e5bab['id'],'UserId':_0x133844[_0xbbb3('0x5a')]['id'],'ContactId':_0x402830['id']}))[_0xbbb3('0x1d')](function(_0x475190){_0x5e5bab[_0xbbb3('0xb9')]['Messages']=[];_0x5e5bab[_0xbbb3('0xb9')][_0xbbb3('0xba')]['push'](_0x475190[_0xbbb3('0xb9')]);return _0x5e5bab;});});}})[_0xbbb3('0x1d')](respondWithResult(_0x283eb4,null))[_0xbbb3('0x26')](handleError(_0x283eb4,null));};
\ No newline at end of file
+var _0x9fff=['contact','firstName','threadId','externalUrl','OpenchannelInteraction','ContactId','lastName','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','Transaction','bulkCreate','finally','getApplications','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','Messages','spread','dataValues','push','eml-format','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','Pause','map','OpenchannelAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','mandatoryDispositionPause','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelAccounts','UserProfileSection','userProfileId','body','params','describe','addDisposition','getDispositions','findOne','Disposition','hasOwnProperty','nolimit','OpenchannelAccountId','ids','addAnswer','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','account','applications','Applications','orderBy','priority','asc','Contacts','defaults'];(function(_0x1da146,_0x103042){var _0x37be8e=function(_0x1f9a65){while(--_0x1f9a65){_0x1da146['push'](_0x1da146['shift']());}};_0x37be8e(++_0x103042);}(_0x9fff,0x1a5));var _0xf9ff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fff[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf9ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf9ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf9ff('0x2'));var BPromise=require(_0xf9ff('0x3'));var Mustache=require(_0xf9ff('0x4'));var util=require(_0xf9ff('0x5'));var path=require('path');var sox=require(_0xf9ff('0x6'));var csv=require('to-csv');var ejs=require(_0xf9ff('0x7'));var fs=require('fs');var fs_extra=require(_0xf9ff('0x8'));var _=require(_0xf9ff('0x9'));var squel=require(_0xf9ff('0xa'));var crypto=require('crypto');var jsforce=require(_0xf9ff('0xb'));var deskjs=require(_0xf9ff('0xc'));var toCsv=require(_0xf9ff('0xd'));var querystring=require(_0xf9ff('0xe'));var Papa=require(_0xf9ff('0xf'));var Redis=require(_0xf9ff('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf9ff('0x11'));var as=require(_0xf9ff('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9ff('0x13'))(_0xf9ff('0x14'));var utils=require(_0xf9ff('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf9ff('0x16'));var db=require('../../mysqldb')['db'];config[_0xf9ff('0x17')]=_['defaults'](config[_0xf9ff('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf9ff('0x18'))[_0xf9ff('0x19')](socket);var jayson=require(_0xf9ff('0x1a'));var client=jayson[_0xf9ff('0x1b')][_0xf9ff('0x1c')]({'port':0x232c});var client9002=jayson[_0xf9ff('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2792f0,_0x55bc81,_0x7ab089,_0x2dd2a6){return new BPromise(function(_0x2d8102,_0x2a4dc5){var _0x5570ff=_0x2dd2a6||client;return _0x5570ff[_0xf9ff('0x1d')](_0x2792f0,_0x7ab089)[_0xf9ff('0x1e')](function(_0x379900){logger['info'](_0xf9ff('0x1f'),_0x55bc81,_0xf9ff('0x20'));logger[_0xf9ff('0x21')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x55bc81,_0xf9ff('0x20'),JSON['stringify'](_0x379900));if(_0x379900['error']){if(_0x379900[_0xf9ff('0x22')][_0xf9ff('0x23')]===0x1f4){logger[_0xf9ff('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x55bc81,_0x379900['error'][_0xf9ff('0x24')]);return _0x2a4dc5(_0x379900[_0xf9ff('0x22')][_0xf9ff('0x24')]);}logger[_0xf9ff('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x55bc81,_0x379900[_0xf9ff('0x22')][_0xf9ff('0x24')]);return _0x2d8102(_0x379900[_0xf9ff('0x22')][_0xf9ff('0x24')]);}else{logger['info'](_0xf9ff('0x1f'),_0x55bc81,'request\x20sent');_0x2d8102(_0x379900[_0xf9ff('0x25')]['message']);}})[_0xf9ff('0x26')](function(_0x123ed0){logger[_0xf9ff('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x55bc81,_0x123ed0);_0x2a4dc5(_0x123ed0);});});}function respondWithStatusCode(_0x320638,_0x9f6c6){_0x9f6c6=_0x9f6c6||0xcc;return function(_0x1bf6b2){if(_0x1bf6b2){return _0x320638[_0xf9ff('0x27')](_0x9f6c6);}return _0x320638[_0xf9ff('0x28')](_0x9f6c6)[_0xf9ff('0x29')]();};}function respondWithResult(_0x835355,_0x38ed89){_0x38ed89=_0x38ed89||0xc8;return function(_0x51e485){if(_0x51e485){return _0x835355[_0xf9ff('0x28')](_0x38ed89)[_0xf9ff('0x2a')](_0x51e485);}};}function respondWithFilteredResult(_0x3502cc,_0xd8fa0e){return function(_0x40dac8){if(_0x40dac8){var _0x52f3bc=typeof _0xd8fa0e[_0xf9ff('0x2b')]===_0xf9ff('0x2c')&&typeof _0xd8fa0e[_0xf9ff('0x2d')]===_0xf9ff('0x2c');var _0x99b18c=_0x40dac8['count'];var _0x5c19d8=_0x52f3bc?0x0:_0xd8fa0e[_0xf9ff('0x2b')];var _0x546179=_0x52f3bc?_0x40dac8['count']:_0xd8fa0e['offset']+_0xd8fa0e[_0xf9ff('0x2d')];var _0x30ec6d;if(_0x546179>=_0x99b18c){_0x546179=_0x99b18c;_0x30ec6d=0xc8;}else{_0x30ec6d=0xce;}_0x3502cc[_0xf9ff('0x28')](_0x30ec6d);return _0x3502cc[_0xf9ff('0x2e')](_0xf9ff('0x2f'),_0x5c19d8+'-'+_0x546179+'/'+_0x99b18c)[_0xf9ff('0x2a')](_0x40dac8);}return null;};}function patchUpdates(_0x212141){return function(_0x550524){try{jsonpatch[_0xf9ff('0x30')](_0x550524,_0x212141,!![]);}catch(_0x580fbc){return BPromise[_0xf9ff('0x31')](_0x580fbc);}return _0x550524[_0xf9ff('0x32')]();};}function saveUpdates(_0x5a65ba,_0x2311ed){return function(_0x24465e){if(_0x24465e){return _0x24465e[_0xf9ff('0x33')](_0x5a65ba)[_0xf9ff('0x1e')](function(_0x3927b5){return _0x3927b5;});}return null;};}function removeEntity(_0x604ba9,_0x4a79f1){return function(_0x56d8de){if(_0x56d8de){return _0x56d8de[_0xf9ff('0x34')]()[_0xf9ff('0x1e')](function(){var _0x139b05=_0x56d8de[_0xf9ff('0x35')]({'plain':!![]});var _0x4acaf0='OpenchannelAccounts';return db[_0xf9ff('0x36')]['destroy']({'where':{'type':_0x4acaf0,'resourceId':_0x139b05['id']}})[_0xf9ff('0x1e')](function(){return _0x56d8de;});})[_0xf9ff('0x1e')](function(){_0x604ba9[_0xf9ff('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3874c1,_0x14b657){return function(_0x3bd8ab){if(!_0x3bd8ab){_0x3874c1[_0xf9ff('0x27')](0x194);}return _0x3bd8ab;};}function handleError(_0x5ae5be,_0x12b0fb){_0x12b0fb=_0x12b0fb||0x1f4;return function(_0xb89b71){logger[_0xf9ff('0x22')](_0xb89b71[_0xf9ff('0x37')]);if(_0xb89b71[_0xf9ff('0x38')]){delete _0xb89b71[_0xf9ff('0x38')];}_0x5ae5be['status'](_0x12b0fb)[_0xf9ff('0x39')](_0xb89b71);};}exports['index']=function(_0x325904,_0x29bfd7){var _0x5d1482={'include':[{'model':db[_0xf9ff('0x3a')],'as':'mandatoryDispositionPause'}]},_0x201f8c={},_0x4b2d1a={'count':0x0,'rows':[]};var _0x4b7130=_[_0xf9ff('0x3b')](db[_0xf9ff('0x3c')][_0xf9ff('0x3d')],function(_0x3b6a0e){return{'name':_0x3b6a0e['fieldName'],'type':_0x3b6a0e[_0xf9ff('0x3e')][_0xf9ff('0x3f')]};});_0x201f8c[_0xf9ff('0x40')]=_[_0xf9ff('0x3b')](_0x4b7130,_0xf9ff('0x38'));_0x201f8c[_0xf9ff('0x41')]=_[_0xf9ff('0x42')](_0x325904[_0xf9ff('0x41')]);_0x201f8c[_0xf9ff('0x43')]=_[_0xf9ff('0x44')](_0x201f8c[_0xf9ff('0x40')],_0x201f8c['query']);_0x5d1482[_0xf9ff('0x45')]=_[_0xf9ff('0x44')](_0x201f8c[_0xf9ff('0x40')],qs[_0xf9ff('0x46')](_0x325904[_0xf9ff('0x41')][_0xf9ff('0x46')]));_0x5d1482[_0xf9ff('0x45')]=_0x5d1482['attributes'][_0xf9ff('0x47')]?_0x5d1482[_0xf9ff('0x45')]:_0x201f8c['model'];if(!_0x325904[_0xf9ff('0x41')]['hasOwnProperty']('nolimit')){_0x5d1482[_0xf9ff('0x2d')]=qs[_0xf9ff('0x2d')](_0x325904[_0xf9ff('0x41')][_0xf9ff('0x2d')]);_0x5d1482[_0xf9ff('0x2b')]=qs[_0xf9ff('0x2b')](_0x325904[_0xf9ff('0x41')][_0xf9ff('0x2b')]);}_0x5d1482[_0xf9ff('0x48')]=qs[_0xf9ff('0x49')](_0x325904[_0xf9ff('0x41')]['sort']);_0x5d1482['where']=qs[_0xf9ff('0x43')](_[_0xf9ff('0x4a')](_0x325904['query'],_0x201f8c[_0xf9ff('0x43')]),_0x4b7130);if(_0x325904['query'][_0xf9ff('0x4b')]){_0x5d1482['where']=_['merge'](_0x5d1482[_0xf9ff('0x4c')],{'$or':_[_0xf9ff('0x3b')](_0x4b7130,function(_0x2b4e41){if(_0x2b4e41[_0xf9ff('0x3e')]!==_0xf9ff('0x4d')){var _0xfef0ff={};_0xfef0ff[_0x2b4e41[_0xf9ff('0x38')]]={'$like':'%'+_0x325904[_0xf9ff('0x41')][_0xf9ff('0x4b')]+'%'};return _0xfef0ff;}})});}_0x5d1482=_[_0xf9ff('0x4e')]({},_0x5d1482,_0x325904[_0xf9ff('0x4f')]);var _0x822b8c={'where':_0x5d1482['where']};return db[_0xf9ff('0x3c')][_0xf9ff('0x50')](_0x822b8c)[_0xf9ff('0x1e')](function(_0x11d5c2){_0x4b2d1a[_0xf9ff('0x50')]=_0x11d5c2;if(_0x325904[_0xf9ff('0x41')][_0xf9ff('0x51')]){_0x5d1482[_0xf9ff('0x52')]=[{'all':!![]}];}return db[_0xf9ff('0x3c')][_0xf9ff('0x53')](_0x5d1482);})[_0xf9ff('0x1e')](function(_0x33404a){_0x4b2d1a[_0xf9ff('0x54')]=_0x33404a;return _0x4b2d1a;})[_0xf9ff('0x1e')](respondWithFilteredResult(_0x29bfd7,_0x5d1482))[_0xf9ff('0x26')](handleError(_0x29bfd7,null));};exports[_0xf9ff('0x55')]=function(_0x1f843f,_0x4e5ead){var _0x42bbe6={'raw':![],'where':{'id':_0x1f843f['params']['id']},'include':[{'model':db[_0xf9ff('0x3a')],'as':_0xf9ff('0x56')}]},_0x4576de={};_0x4576de[_0xf9ff('0x40')]=_['keys'](db['OpenchannelAccount']['rawAttributes']);_0x4576de[_0xf9ff('0x41')]=_[_0xf9ff('0x42')](_0x1f843f[_0xf9ff('0x41')]);_0x4576de[_0xf9ff('0x43')]=_[_0xf9ff('0x44')](_0x4576de['model'],_0x4576de[_0xf9ff('0x41')]);_0x42bbe6[_0xf9ff('0x45')]=_['intersection'](_0x4576de[_0xf9ff('0x40')],qs[_0xf9ff('0x46')](_0x1f843f['query']['fields']));_0x42bbe6[_0xf9ff('0x45')]=_0x42bbe6[_0xf9ff('0x45')][_0xf9ff('0x47')]?_0x42bbe6[_0xf9ff('0x45')]:_0x4576de[_0xf9ff('0x40')];if(_0x1f843f['query'][_0xf9ff('0x51')]){_0x42bbe6[_0xf9ff('0x52')]=[{'all':!![]}];}_0x42bbe6=_['merge']({},_0x42bbe6,_0x1f843f['options']);return db[_0xf9ff('0x3c')][_0xf9ff('0x57')](_0x42bbe6)[_0xf9ff('0x1e')](handleEntityNotFound(_0x4e5ead,null))['then'](respondWithResult(_0x4e5ead,null))[_0xf9ff('0x26')](handleError(_0x4e5ead,null));};exports[_0xf9ff('0x58')]=function(_0x5a6622,_0x230c9a){return db[_0xf9ff('0x3c')][_0xf9ff('0x58')](_0x5a6622['body'],{})[_0xf9ff('0x1e')](function(_0x36cd0b){var _0x25a53f=_0x5a6622['user'][_0xf9ff('0x35')]({'plain':!![]});if(!_0x25a53f)throw new Error(_0xf9ff('0x59'));if(_0x25a53f[_0xf9ff('0x5a')]===_0xf9ff('0x5b')){var _0x522bdb=_0x36cd0b[_0xf9ff('0x35')]({'plain':!![]});var _0x3d3317=_0xf9ff('0x5c');return db[_0xf9ff('0x5d')][_0xf9ff('0x57')]({'where':{'name':_0x3d3317,'userProfileId':_0x25a53f[_0xf9ff('0x5e')]},'raw':!![]})[_0xf9ff('0x1e')](function(_0x44354a){if(_0x44354a&&_0x44354a['autoAssociation']===0x0){return db['UserProfileResource'][_0xf9ff('0x58')]({'name':_0x522bdb[_0xf9ff('0x38')],'resourceId':_0x522bdb['id'],'type':_0x44354a[_0xf9ff('0x38')],'sectionId':_0x44354a['id']},{})['then'](function(){return _0x36cd0b;});}else{return _0x36cd0b;}})[_0xf9ff('0x26')](function(_0x41f6fd){logger[_0xf9ff('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41f6fd);throw _0x41f6fd;});}return _0x36cd0b;})[_0xf9ff('0x1e')](respondWithResult(_0x230c9a,0xc9))[_0xf9ff('0x26')](handleError(_0x230c9a,null));};exports[_0xf9ff('0x33')]=function(_0x86d0b7,_0x4769ab){if(_0x86d0b7['body']['id']){delete _0x86d0b7[_0xf9ff('0x5f')]['id'];}return db['OpenchannelAccount'][_0xf9ff('0x57')]({'where':{'id':_0x86d0b7[_0xf9ff('0x60')]['id']},'include':[{'model':db[_0xf9ff('0x3a')],'as':'mandatoryDispositionPause'}]})[_0xf9ff('0x1e')](handleEntityNotFound(_0x4769ab,null))[_0xf9ff('0x1e')](saveUpdates(_0x86d0b7[_0xf9ff('0x5f')],null))[_0xf9ff('0x1e')](respondWithResult(_0x4769ab,null))['catch'](handleError(_0x4769ab,null));};exports[_0xf9ff('0x34')]=function(_0x1b18bf,_0x1f80a5){return db['OpenchannelAccount']['find']({'where':{'id':_0x1b18bf[_0xf9ff('0x60')]['id']}})['then'](handleEntityNotFound(_0x1f80a5,null))[_0xf9ff('0x1e')](removeEntity(_0x1f80a5,null))[_0xf9ff('0x26')](handleError(_0x1f80a5,null));};exports[_0xf9ff('0x61')]=function(_0x133ce5,_0x4d053c){return db[_0xf9ff('0x3c')]['describe']()['then'](respondWithResult(_0x4d053c,null))[_0xf9ff('0x26')](handleError(_0x4d053c,null));};exports[_0xf9ff('0x62')]=function(_0x28da64,_0x18f56f,_0x22255b){if(_0x28da64[_0xf9ff('0x5f')]['id']){delete _0x28da64[_0xf9ff('0x5f')]['id'];}return db[_0xf9ff('0x3c')][_0xf9ff('0x57')]({'where':{'id':_0x28da64['params']['id']}})['then'](handleEntityNotFound(_0x18f56f,null))[_0xf9ff('0x1e')](function(_0x53e67b){if(_0x53e67b){_0x28da64[_0xf9ff('0x5f')]['OpenchannelAccountId']=_0x53e67b['id'];return db['Disposition']['create'](_0x28da64['body']);}})[_0xf9ff('0x1e')](respondWithResult(_0x18f56f,null))[_0xf9ff('0x26')](handleError(_0x18f56f,null));};exports[_0xf9ff('0x63')]=function(_0x502482,_0x472b2c,_0x231c89){var _0x26bff4={'raw':![],'where':{}};var _0x5f132c={};var _0x1d9a02={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf9ff('0x64')]({'where':{'id':_0x502482[_0xf9ff('0x60')]['id']}})[_0xf9ff('0x1e')](handleEntityNotFound(_0x472b2c,null))['then'](function(_0x12dafa){if(_0x12dafa){_0x5f132c[_0xf9ff('0x40')]=_[_0xf9ff('0x42')](db[_0xf9ff('0x65')][_0xf9ff('0x3d')]);_0x5f132c[_0xf9ff('0x41')]=_['keys'](_0x502482[_0xf9ff('0x41')]);_0x5f132c[_0xf9ff('0x43')]=_[_0xf9ff('0x44')](_0x5f132c[_0xf9ff('0x40')],_0x5f132c[_0xf9ff('0x41')]);_0x26bff4[_0xf9ff('0x45')]=_[_0xf9ff('0x44')](_0x5f132c[_0xf9ff('0x40')],qs['fields'](_0x502482['query'][_0xf9ff('0x46')]));_0x26bff4[_0xf9ff('0x45')]=_0x26bff4[_0xf9ff('0x45')][_0xf9ff('0x47')]?_0x26bff4[_0xf9ff('0x45')]:_0x5f132c[_0xf9ff('0x40')];if(!_0x502482['query'][_0xf9ff('0x66')](_0xf9ff('0x67'))){_0x26bff4[_0xf9ff('0x2d')]=qs[_0xf9ff('0x2d')](_0x502482[_0xf9ff('0x41')][_0xf9ff('0x2d')]);_0x26bff4['offset']=qs[_0xf9ff('0x2b')](_0x502482[_0xf9ff('0x41')][_0xf9ff('0x2b')]);}_0x26bff4[_0xf9ff('0x48')]=qs['sort'](_0x502482[_0xf9ff('0x41')][_0xf9ff('0x49')]);_0x26bff4[_0xf9ff('0x4c')]=qs[_0xf9ff('0x43')](_[_0xf9ff('0x4a')](_0x502482[_0xf9ff('0x41')],_0x5f132c[_0xf9ff('0x43')]));_0x26bff4[_0xf9ff('0x4c')][_0xf9ff('0x68')]=_0x12dafa['id'];if(_0x502482[_0xf9ff('0x41')]['filter']){_0x26bff4[_0xf9ff('0x4c')]=_['merge'](_0x26bff4['where'],{'$or':_['map'](_0x26bff4[_0xf9ff('0x45')],function(_0x2528bd){var _0x3c6784={};_0x3c6784[_0x2528bd]={'$like':'%'+_0x502482[_0xf9ff('0x41')]['filter']+'%'};return _0x3c6784;})});}_0x26bff4=_[_0xf9ff('0x4e')]({},_0x26bff4,_0x502482[_0xf9ff('0x4f')]);return db[_0xf9ff('0x65')][_0xf9ff('0x50')]({'where':_0x26bff4[_0xf9ff('0x4c')]})[_0xf9ff('0x1e')](function(_0x23c39a){_0x1d9a02[_0xf9ff('0x50')]=_0x23c39a;if(_0x502482[_0xf9ff('0x41')][_0xf9ff('0x51')]){_0x26bff4['include']=[{'all':!![]}];}return db[_0xf9ff('0x65')][_0xf9ff('0x53')](_0x26bff4);})[_0xf9ff('0x1e')](function(_0x3d4c0a){_0x1d9a02[_0xf9ff('0x54')]=_0x3d4c0a;return _0x1d9a02;});}})[_0xf9ff('0x1e')](respondWithFilteredResult(_0x472b2c,_0x26bff4))['catch'](handleError(_0x472b2c,null));};exports['removeDispositions']=function(_0x4c7dcd,_0x5cc6fd,_0x4d9928){return db[_0xf9ff('0x3c')][_0xf9ff('0x57')]({'where':{'id':_0x4c7dcd[_0xf9ff('0x60')]['id']}})['then'](handleEntityNotFound(_0x5cc6fd,null))[_0xf9ff('0x1e')](function(_0x45196e){if(_0x45196e){return _0x45196e['removeDispositions'](_0x4c7dcd[_0xf9ff('0x41')][_0xf9ff('0x69')]);}})[_0xf9ff('0x1e')](respondWithStatusCode(_0x5cc6fd,null))[_0xf9ff('0x26')](handleError(_0x5cc6fd,null));};exports[_0xf9ff('0x6a')]=function(_0x87da31,_0x35a98b,_0x20d581){if(_0x87da31[_0xf9ff('0x5f')]['id']){delete _0x87da31[_0xf9ff('0x5f')]['id'];}return db[_0xf9ff('0x3c')][_0xf9ff('0x57')]({'where':{'id':_0x87da31[_0xf9ff('0x60')]['id']}})[_0xf9ff('0x1e')](handleEntityNotFound(_0x35a98b,null))[_0xf9ff('0x1e')](function(_0x2b3d74){if(_0x2b3d74){_0x87da31[_0xf9ff('0x5f')][_0xf9ff('0x68')]=_0x2b3d74['id'];return db[_0xf9ff('0x6b')]['create'](_0x87da31['body']);}})['then'](respondWithResult(_0x35a98b,null))[_0xf9ff('0x26')](handleError(_0x35a98b,null));};exports['getAnswers']=function(_0x102c65,_0x4e050d,_0x17a0b5){var _0x50e699={'raw':![],'where':{}};var _0x5333a7={};var _0x5afdac={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf9ff('0x64')]({'where':{'id':_0x102c65[_0xf9ff('0x60')]['id']}})['then'](handleEntityNotFound(_0x4e050d,null))[_0xf9ff('0x1e')](function(_0x1bc0cd){if(_0x1bc0cd){_0x5333a7['model']=_['keys'](db[_0xf9ff('0x6b')]['rawAttributes']);_0x5333a7[_0xf9ff('0x41')]=_[_0xf9ff('0x42')](_0x102c65['query']);_0x5333a7[_0xf9ff('0x43')]=_[_0xf9ff('0x44')](_0x5333a7[_0xf9ff('0x40')],_0x5333a7['query']);_0x50e699[_0xf9ff('0x45')]=_[_0xf9ff('0x44')](_0x5333a7[_0xf9ff('0x40')],qs[_0xf9ff('0x46')](_0x102c65[_0xf9ff('0x41')][_0xf9ff('0x46')]));_0x50e699[_0xf9ff('0x45')]=_0x50e699['attributes'][_0xf9ff('0x47')]?_0x50e699[_0xf9ff('0x45')]:_0x5333a7[_0xf9ff('0x40')];if(!_0x102c65[_0xf9ff('0x41')][_0xf9ff('0x66')](_0xf9ff('0x67'))){_0x50e699[_0xf9ff('0x2d')]=qs[_0xf9ff('0x2d')](_0x102c65[_0xf9ff('0x41')][_0xf9ff('0x2d')]);_0x50e699['offset']=qs[_0xf9ff('0x2b')](_0x102c65[_0xf9ff('0x41')][_0xf9ff('0x2b')]);}_0x50e699['order']=qs[_0xf9ff('0x49')](_0x102c65[_0xf9ff('0x41')][_0xf9ff('0x49')]);_0x50e699[_0xf9ff('0x4c')]=qs[_0xf9ff('0x43')](_[_0xf9ff('0x4a')](_0x102c65[_0xf9ff('0x41')],_0x5333a7[_0xf9ff('0x43')]));_0x50e699['where'][_0xf9ff('0x68')]=_0x1bc0cd['id'];if(_0x102c65[_0xf9ff('0x41')][_0xf9ff('0x4b')]){_0x50e699[_0xf9ff('0x4c')]=_[_0xf9ff('0x4e')](_0x50e699[_0xf9ff('0x4c')],{'$or':_[_0xf9ff('0x3b')](_0x50e699[_0xf9ff('0x45')],function(_0x5bf4a9){var _0x118b55={};_0x118b55[_0x5bf4a9]={'$like':'%'+_0x102c65[_0xf9ff('0x41')]['filter']+'%'};return _0x118b55;})});}_0x50e699=_[_0xf9ff('0x4e')]({},_0x50e699,_0x102c65[_0xf9ff('0x4f')]);return db['CannedAnswer']['count']({'where':_0x50e699['where']})['then'](function(_0x124457){_0x5afdac[_0xf9ff('0x50')]=_0x124457;if(_0x102c65[_0xf9ff('0x41')][_0xf9ff('0x51')]){_0x50e699[_0xf9ff('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf9ff('0x53')](_0x50e699);})[_0xf9ff('0x1e')](function(_0x30f661){_0x5afdac['rows']=_0x30f661;return _0x5afdac;});}})[_0xf9ff('0x1e')](respondWithFilteredResult(_0x4e050d,_0x50e699))[_0xf9ff('0x26')](handleError(_0x4e050d,null));};exports[_0xf9ff('0x6c')]=function(_0x2f9672,_0x1ea920,_0xd5f23a){return db['OpenchannelAccount'][_0xf9ff('0x57')]({'where':{'id':_0x2f9672['params']['id']}})[_0xf9ff('0x1e')](handleEntityNotFound(_0x1ea920,null))[_0xf9ff('0x1e')](function(_0x3472c1){if(_0x3472c1){return _0x3472c1['removeAnswers'](_0x2f9672[_0xf9ff('0x41')][_0xf9ff('0x69')]);}})[_0xf9ff('0x1e')](respondWithStatusCode(_0x1ea920,null))[_0xf9ff('0x26')](handleError(_0x1ea920,null));};exports[_0xf9ff('0x6d')]=function(_0x5e9476,_0x37f33f,_0x508782){var _0x5c2ec0={'body':_0x5e9476[_0xf9ff('0x5f')],'channel':_0xf9ff('0x6e')};var _0x4f1451=[];var _0x5b2347=[];var _0x2743a0={};var _0x3163dc=![];return db[_0xf9ff('0x6f')][_0xf9ff('0x61')]()['then'](function(_0x19b9c9){if(!_0x19b9c9){throw new db[(_0xf9ff('0x70'))][(_0xf9ff('0x71'))]('no\x20available\x20attributes');}_0x4f1451=_[_0xf9ff('0x72')](_[_0xf9ff('0x42')](_0x19b9c9),[_0xf9ff('0x73'),_0xf9ff('0x74')]);_0x5b2347=_[_0xf9ff('0x72')](_[_0xf9ff('0x42')](_0x19b9c9),[_0xf9ff('0x73'),_0xf9ff('0x74'),'CompanyId',_0xf9ff('0x75')]);if(_0x5e9476['body']['id']){delete _0x5e9476['body']['id'];}if(_[_0xf9ff('0x76')](_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x77')])){throw new db[(_0xf9ff('0x70'))][(_0xf9ff('0x71'))](_0xf9ff('0x78'));}if(_['isNil'](_0x5e9476[_0xf9ff('0x5f')]['body'])||_0x5e9476['body'][_0xf9ff('0x5f')]===''){throw new db[(_0xf9ff('0x70'))][(_0xf9ff('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf9ff('0x76')](_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x79')])){throw new db['Sequelize']['ValidationError'](_0xf9ff('0x7a')+_0x5b2347);}if(!_[_0xf9ff('0x7b')](_0x5b2347,_0x5e9476[_0xf9ff('0x5f')]['mapKey'])){throw new db[(_0xf9ff('0x70'))][(_0xf9ff('0x71'))](_0xf9ff('0x7c')+_0x5b2347);}_0x2743a0[_0x5e9476['body'][_0xf9ff('0x79')]]=_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x77')];})['then'](function(){return db[_0xf9ff('0x3c')]['find']({'where':{'id':_0x5e9476[_0xf9ff('0x60')]['id']},'include':[{'model':db[_0xf9ff('0x7d')],'as':_0xf9ff('0x7e'),'include':[{'model':db[_0xf9ff('0x6f')],'as':'Contacts','where':_0x2743a0,'limit':0x1,'order':[[_0xf9ff('0x74'),_0xf9ff('0x7f')]]}]},{'model':db[_0xf9ff('0x80')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x37f33f,null))[_0xf9ff('0x1e')](function(_0x461b61){if(_0x461b61&&_0x461b61[_0xf9ff('0x7e')]){_0x5c2ec0[_0xf9ff('0x81')]=_0x461b61;_0x5c2ec0[_0xf9ff('0x82')]=_0x461b61[_0xf9ff('0x83')];_0x5c2ec0['list']=_0x461b61['List'];_0x5c2ec0['applications']=_[_0xf9ff('0x84')](_0x5c2ec0[_0xf9ff('0x82')],[_0xf9ff('0x85')],[_0xf9ff('0x86')]);if(_0x5c2ec0['account'][_0xf9ff('0x83')]){delete _0x5c2ec0['account'][_0xf9ff('0x83')];}if(_0x5c2ec0['account'][_0xf9ff('0x7e')]&&_0x5c2ec0[_0xf9ff('0x81')][_0xf9ff('0x7e')][_0xf9ff('0x87')][_0xf9ff('0x47')]){return _0x5c2ec0[_0xf9ff('0x81')][_0xf9ff('0x7e')][_0xf9ff('0x87')][0x0];}var _0x2813ee=_[_0xf9ff('0x88')](_0x5e9476[_0xf9ff('0x5f')],{'firstName':_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x77')],'ListId':_0x461b61[_0xf9ff('0x75')]});_0x2813ee[_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x79')]]=_0x5e9476['body'][_0xf9ff('0x77')];return db[_0xf9ff('0x6f')][_0xf9ff('0x58')](_0x2813ee,{'fields':_0x4f1451,'raw':!![]});}})[_0xf9ff('0x1e')](handleEntityNotFound(_0x37f33f,null))[_0xf9ff('0x1e')](function(_0x2e3848){_0x5c2ec0[_0xf9ff('0x89')]=_0x2e3848;if(_0x2e3848){var _0x4888bd={'ContactId':_0x2e3848['id'],'OpenchannelAccountId':_0x5e9476[_0xf9ff('0x60')]['id'],'from':(_0x2e3848[_0xf9ff('0x8a')]||'')+'\x20'+(_0x2e3848['lastName']||'')};var _0x1576e9={'OpenchannelAccountId':_0x5e9476[_0xf9ff('0x60')]['id'],'closed':![]};if(_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x8b')]){_0x1576e9[_0xf9ff('0x8b')]=_0x5e9476['body'][_0xf9ff('0x8b')];return db['OpenchannelInteraction']['find']({'where':_0x1576e9})['then'](function(_0x3fb804){if(_0x3fb804){return[_0x3fb804,![]];}_0x4888bd[_0xf9ff('0x8b')]=_0x5e9476['body'][_0xf9ff('0x8b')];_0x4888bd['externalUrl']=_0x5e9476['body'][_0xf9ff('0x8c')];return db[_0xf9ff('0x8d')][_0xf9ff('0x58')](_0x4888bd)[_0xf9ff('0x1e')](function(_0x24136e){return[_0x24136e,!![]];});});}else{_0x1576e9[_0xf9ff('0x8b')]=null;}_0x1576e9[_0xf9ff('0x8e')]=_0x2e3848['id'];return db[_0xf9ff('0x8d')]['find']({'where':_0x1576e9})['then'](function(_0x510c54){if(_0x510c54){return[_0x510c54,![]];}return db['OpenchannelInteraction'][_0xf9ff('0x58')](_0x4888bd)[_0xf9ff('0x1e')](function(_0x246c23){return[_0x246c23,!![]];});});}})['spread'](function(_0x2c4e63,_0x423820){if(_0x2c4e63){_0x3163dc=_0x423820;if(!_0x423820){var _0x2b6300={'from':(_0x5c2ec0['contact'][_0xf9ff('0x8a')]||'')+'\x20'+(_0x5c2ec0[_0xf9ff('0x89')][_0xf9ff('0x8f')]||'')};if(_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x8b')]&&_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x90')]&&_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x8b')]!=_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x90')]){_0x2b6300['threadId']=_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x90')];}return _0x2c4e63[_0xf9ff('0x33')](_0x2b6300);}else{return _0x2c4e63;}}})['then'](function(_0x1a4c78){_0x5c2ec0['interaction']=_0x1a4c78[_0xf9ff('0x35')]({'plain':!![]});_0x5c2ec0[_0xf9ff('0x91')][_0xf9ff('0x92')]=_0x3163dc;if(_0x5c2ec0[_0xf9ff('0x91')][_0xf9ff('0x92')]){if(_0x5c2ec0['account'][_0xf9ff('0x93')]){_0x5c2ec0[_0xf9ff('0x82')]['push']({'id':0x0,'priority':_0x5c2ec0[_0xf9ff('0x82')]['length']+0x1,'app':_0xf9ff('0x94'),'appdata':'unmanaged','interval':_0xf9ff('0x95')});}}return db[_0xf9ff('0x96')][_0xf9ff('0x58')]({'body':_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x5f')],'OpenchannelAccountId':_0x5e9476['params']['id'],'OpenchannelInteractionId':_0x1a4c78['id'],'direction':'in','ContactId':_0x5c2ec0[_0xf9ff('0x89')]['id'],'AttachmentId':_0x5e9476[_0xf9ff('0x5f')][_0xf9ff('0x97')]});})[_0xf9ff('0x1e')](function(_0x9a1782){_0x5c2ec0[_0xf9ff('0x24')]=_0x9a1782;if(_0x5c2ec0[_0xf9ff('0x91')]['UserId']){return db['User'][_0xf9ff('0x57')]({'attributes':['id','name'],'where':{'id':_0x5c2ec0[_0xf9ff('0x91')][_0xf9ff('0x98')]}})[_0xf9ff('0x1e')](function(_0xd40581){if(_0xd40581){_0x5c2ec0[_0xf9ff('0x82')][_0xf9ff('0x99')]({'id':0x0,'priority':0x0,'app':_0xf9ff('0x9a'),'appdata':_0xd40581[_0xf9ff('0x38')]+','+(_0x5c2ec0['account']['waitForTheAssignedAgent']||0xa),'interval':_0xf9ff('0x95')});_0x5c2ec0[_0xf9ff('0x9b')]=![];}return respondWithRpcPromise(_0xf9ff('0x9c'),_0xf9ff('0x9d'),_0x5c2ec0);});}return respondWithRpcPromise(_0xf9ff('0x9c'),_0xf9ff('0x9d'),_0x5c2ec0);})[_0xf9ff('0x1e')](function(_0x14d2ce){respondWithRpcPromise(_0xf9ff('0x9e'),'EventManager',{'event':_0xf9ff('0x6d'),'message':_0x14d2ce},client9002);return _0x14d2ce;})[_0xf9ff('0x1e')](respondWithResult(_0x37f33f,null))['catch'](handleError(_0x37f33f,null));};exports[_0xf9ff('0x9f')]=function(_0x5bc096,_0x5b0132){var _0x8513a3=_0x5bc096[_0xf9ff('0x60')]['id'];var _0x10ac9c=_0x5bc096[_0xf9ff('0x5f')];var _0xda168e=0xc8;var _0x31c66a=null;return db[_0xf9ff('0xa0')]['transaction']({'isolationLevel':db[_0xf9ff('0xa0')][_0xf9ff('0xa1')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x1c2da0){return db['OpenchannelAccount'][_0xf9ff('0x64')]({'where':{'id':_0x8513a3},'transaction':_0x1c2da0})[_0xf9ff('0x1e')](function(_0x252cb9){if(_0x252cb9){return db[_0xf9ff('0x80')][_0xf9ff('0x34')]({'where':{'OpenchannelAccountId':_0x8513a3},'transaction':_0x1c2da0})[_0xf9ff('0x1e')](function(){var _0x419b28=_[_0xf9ff('0x3b')](_0x10ac9c,function(_0x59cb39){_0x59cb39[_0xf9ff('0x68')]=_0x8513a3;return _0x59cb39;});return db[_0xf9ff('0x80')][_0xf9ff('0xa2')](_0x419b28,{'transaction':_0x1c2da0});});}else{_0xda168e=0x194;_0x31c66a=[];}});})[_0xf9ff('0x1e')](function(){if(_0xda168e!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x8513a3},'order':'priority'})['then'](function(_0x4c1d5d){_0x31c66a=_0x4c1d5d;});}})[_0xf9ff('0x26')](function(_0x691abf){_0xda168e=0x1f4;logger[_0xf9ff('0x22')](_0x691abf[_0xf9ff('0x37')]);if(_0x691abf[_0xf9ff('0x38')]){delete _0x691abf[_0xf9ff('0x38')];}_0x31c66a=_0x691abf;})[_0xf9ff('0xa3')](function(){if(_0x31c66a===null){_0x5b0132[_0xf9ff('0x27')](_0xda168e);}else{if(_0xda168e===0x1f4){_0x5b0132['status'](_0xda168e)[_0xf9ff('0x39')](_0x31c66a);}else{_0x5b0132['status'](_0xda168e)[_0xf9ff('0x2a')](_0x31c66a);}}});};exports['getApplications']=function(_0x4d30ab,_0xd57bb5,_0x5782d4){var _0x12bd7e={};var _0x47c66e={};var _0x23297e;var _0x465894;return db[_0xf9ff('0x3c')][_0xf9ff('0x64')]({'where':{'id':_0x4d30ab['params']['id']}})[_0xf9ff('0x1e')](handleEntityNotFound(_0xd57bb5,null))[_0xf9ff('0x1e')](function(_0x303eb2){if(_0x303eb2){_0x23297e=_0x303eb2;_0x47c66e['model']=_[_0xf9ff('0x42')](db['OpenchannelApplication']['rawAttributes']);_0x47c66e[_0xf9ff('0x41')]=_[_0xf9ff('0x42')](_0x4d30ab[_0xf9ff('0x41')]);_0x47c66e[_0xf9ff('0x43')]=_[_0xf9ff('0x44')](_0x47c66e[_0xf9ff('0x40')],_0x47c66e[_0xf9ff('0x41')]);_0x12bd7e[_0xf9ff('0x45')]=_[_0xf9ff('0x44')](_0x47c66e[_0xf9ff('0x40')],qs['fields'](_0x4d30ab[_0xf9ff('0x41')][_0xf9ff('0x46')]));_0x12bd7e[_0xf9ff('0x45')]=_0x12bd7e[_0xf9ff('0x45')][_0xf9ff('0x47')]?_0x12bd7e[_0xf9ff('0x45')]:_0x47c66e['model'];_0x12bd7e[_0xf9ff('0x48')]=qs[_0xf9ff('0x49')](_0x4d30ab[_0xf9ff('0x41')][_0xf9ff('0x49')]);_0x12bd7e[_0xf9ff('0x4c')]=qs['filters'](_['pick'](_0x4d30ab['query'],_0x47c66e[_0xf9ff('0x43')]));if(_0x4d30ab['query']['filter']){_0x12bd7e[_0xf9ff('0x4c')]=_[_0xf9ff('0x4e')](_0x12bd7e[_0xf9ff('0x4c')],{'$or':_[_0xf9ff('0x3b')](_0x12bd7e[_0xf9ff('0x45')],function(_0x407e73){var _0x29a616={};_0x29a616[_0x407e73]={'$like':'%'+_0x4d30ab[_0xf9ff('0x41')][_0xf9ff('0x4b')]+'%'};return _0x29a616;})});}_0x12bd7e=_[_0xf9ff('0x4e')]({},_0x12bd7e,_0x4d30ab[_0xf9ff('0x4f')]);return _0x23297e[_0xf9ff('0xa4')](_0x12bd7e);}})['then'](function(_0x5dd037){if(_0x5dd037){_0x465894=_0x5dd037[_0xf9ff('0x47')];if(!_0x4d30ab[_0xf9ff('0x41')][_0xf9ff('0x66')](_0xf9ff('0x67'))){_0x12bd7e[_0xf9ff('0x2d')]=qs[_0xf9ff('0x2d')](_0x4d30ab[_0xf9ff('0x41')][_0xf9ff('0x2d')]);_0x12bd7e['offset']=qs['offset'](_0x4d30ab[_0xf9ff('0x41')][_0xf9ff('0x2b')]);}return _0x23297e[_0xf9ff('0xa4')](_0x12bd7e);}})[_0xf9ff('0x1e')](function(_0x566113){if(_0x566113){return _0x566113?{'count':_0x465894,'rows':_0x566113}:null;}})[_0xf9ff('0x1e')](respondWithResult(_0xd57bb5,null))[_0xf9ff('0x26')](handleError(_0xd57bb5,null));};exports['getInteractions']=function(_0x2c985a,_0x2e9c2f,_0x2e7681){var _0x1f97e4={'raw':![],'where':{}};var _0x10319a={};var _0x4825a0={'count':0x0,'rows':[]};return db[_0xf9ff('0x3c')][_0xf9ff('0x64')]({'where':{'id':_0x2c985a['params']['id']}})[_0xf9ff('0x1e')](handleEntityNotFound(_0x2e9c2f,null))[_0xf9ff('0x1e')](function(_0x248cd6){if(_0x248cd6){_0x10319a['model']=_[_0xf9ff('0x42')](db[_0xf9ff('0x8d')]['rawAttributes']);_0x10319a['query']=_[_0xf9ff('0x42')](_0x2c985a[_0xf9ff('0x41')]);_0x10319a[_0xf9ff('0x43')]=_[_0xf9ff('0x44')](_0x10319a[_0xf9ff('0x40')],_0x10319a[_0xf9ff('0x41')]);_0x1f97e4[_0xf9ff('0x45')]=_[_0xf9ff('0x44')](_0x10319a[_0xf9ff('0x40')],qs[_0xf9ff('0x46')](_0x2c985a[_0xf9ff('0x41')][_0xf9ff('0x46')]));_0x1f97e4[_0xf9ff('0x45')]=_0x1f97e4['attributes'][_0xf9ff('0x47')]?_0x1f97e4[_0xf9ff('0x45')]:_0x10319a[_0xf9ff('0x40')];if(!_0x2c985a['query'][_0xf9ff('0x66')](_0xf9ff('0x67'))){_0x1f97e4['limit']=qs[_0xf9ff('0x2d')](_0x2c985a[_0xf9ff('0x41')][_0xf9ff('0x2d')]);_0x1f97e4[_0xf9ff('0x2b')]=qs[_0xf9ff('0x2b')](_0x2c985a['query'][_0xf9ff('0x2b')]);}_0x1f97e4[_0xf9ff('0x48')]=qs[_0xf9ff('0x49')](_0x2c985a[_0xf9ff('0x41')][_0xf9ff('0x49')]);_0x1f97e4['where']=qs[_0xf9ff('0x43')](_['pick'](_0x2c985a['query'],_0x10319a[_0xf9ff('0x43')]));_0x1f97e4[_0xf9ff('0x4c')][_0xf9ff('0x68')]=_0x248cd6['id'];if(_0x2c985a[_0xf9ff('0x41')][_0xf9ff('0x4b')]){_0x1f97e4['where']=_[_0xf9ff('0x4e')](_0x1f97e4[_0xf9ff('0x4c')],{'$or':_['map'](_0x1f97e4[_0xf9ff('0x45')],function(_0x2dcf59){var _0x38f782={};_0x38f782[_0x2dcf59]={'$like':'%'+_0x2c985a[_0xf9ff('0x41')][_0xf9ff('0x4b')]+'%'};return _0x38f782;})});}_0x1f97e4=_['merge']({},_0x1f97e4,_0x2c985a[_0xf9ff('0x4f')]);return db[_0xf9ff('0x8d')][_0xf9ff('0x50')]({'where':_0x1f97e4[_0xf9ff('0x4c')]})['then'](function(_0x5c8376){_0x4825a0[_0xf9ff('0x50')]=_0x5c8376;if(_0x2c985a[_0xf9ff('0x41')]['includeAll']){_0x1f97e4[_0xf9ff('0x52')]=[{'model':db['CmContact'],'as':_0xf9ff('0xa5'),'required':![]},{'model':db[_0xf9ff('0xa6')],'as':_0xf9ff('0xa7'),'attributes':[_0xf9ff('0x38'),_0xf9ff('0xa8'),_0xf9ff('0xa9')],'required':![]},{'model':db[_0xf9ff('0xaa')],'as':_0xf9ff('0xab'),'attributes':['id',_0xf9ff('0x38'),'color'],'where':_0x2c985a[_0xf9ff('0x41')][_0xf9ff('0xac')]?{'id':_0x2c985a[_0xf9ff('0x41')][_0xf9ff('0xac')]}:undefined,'required':_0x2c985a[_0xf9ff('0x41')][_0xf9ff('0xac')]?!![]:![]}];}return db[_0xf9ff('0x8d')][_0xf9ff('0x53')](_0x1f97e4);})[_0xf9ff('0x1e')](function(_0x571a5b){_0x4825a0[_0xf9ff('0x54')]=_0x571a5b;return _0x4825a0;});}})['then'](respondWithFilteredResult(_0x2e9c2f,_0x1f97e4))[_0xf9ff('0x26')](handleError(_0x2e9c2f,null));};exports['addAgents']=function(_0x3ccd8f,_0xaf276,_0x16c42e){return db[_0xf9ff('0x3c')][_0xf9ff('0x57')]({'where':{'id':_0x3ccd8f[_0xf9ff('0x60')]['id']}})['then'](handleEntityNotFound(_0xaf276,null))[_0xf9ff('0x1e')](function(_0x9b74f8){if(_0x9b74f8){return _0x9b74f8[_0xf9ff('0xad')](_0x3ccd8f[_0xf9ff('0x5f')][_0xf9ff('0x69')],_[_0xf9ff('0xae')](_0x3ccd8f['body'],[_0xf9ff('0x69'),'id'])||{})['spread'](function(_0x48fafa){for(var _0x5b0fc9=0x0;_0x5b0fc9<_0x3ccd8f[_0xf9ff('0x5f')][_0xf9ff('0x69')]['length'];_0x5b0fc9+=0x1){socket[_0xf9ff('0xaf')](_0xf9ff('0xb0'),{'UserId':Number(_0x3ccd8f[_0xf9ff('0x5f')][_0xf9ff('0x69')][_0x5b0fc9]),'OpenchannelAccountId':Number(_0x3ccd8f[_0xf9ff('0x60')]['id'])});}return _0x48fafa;});}})[_0xf9ff('0x1e')](respondWithResult(_0xaf276,null))[_0xf9ff('0x26')](handleError(_0xaf276,null));};exports['removeAgents']=function(_0x42bba9,_0x28f616,_0x121f50){return db[_0xf9ff('0x3c')][_0xf9ff('0x57')]({'where':{'id':_0x42bba9[_0xf9ff('0x60')]['id']}})[_0xf9ff('0x1e')](handleEntityNotFound(_0x28f616,null))[_0xf9ff('0x1e')](function(_0xc2593a){if(_0xc2593a){return _0xc2593a[_0xf9ff('0xb1')](_0x42bba9[_0xf9ff('0x41')][_0xf9ff('0x69')])[_0xf9ff('0x1e')](function(){if(_[_0xf9ff('0xb2')](_0x42bba9[_0xf9ff('0x41')][_0xf9ff('0x69')])){for(var _0x48af10=0x0;_0x48af10<_0x42bba9[_0xf9ff('0x41')][_0xf9ff('0x69')][_0xf9ff('0x47')];_0x48af10+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x42bba9[_0xf9ff('0x41')]['ids'][_0x48af10]),'OpenchannelAccountId':Number(_0x42bba9[_0xf9ff('0x60')]['id'])});}}else{socket[_0xf9ff('0xaf')](_0xf9ff('0xb3'),{'UserId':Number(_0x42bba9[_0xf9ff('0x41')]['ids']),'OpenchannelAccountId':Number(_0x42bba9[_0xf9ff('0x60')]['id'])});}});}})[_0xf9ff('0x1e')](respondWithStatusCode(_0x28f616,null))[_0xf9ff('0x26')](handleError(_0x28f616,null));};exports[_0xf9ff('0xb4')]=function(_0x466b93,_0x49d559,_0x1286a0){var _0x3fe78b={};var _0x3009be={};var _0x53dcd2;var _0x35dd10;return db[_0xf9ff('0x3c')][_0xf9ff('0x64')]({'where':{'id':_0x466b93[_0xf9ff('0x60')]['id']}})['then'](handleEntityNotFound(_0x49d559,null))[_0xf9ff('0x1e')](function(_0x1ae52a){if(_0x1ae52a){_0x53dcd2=_0x1ae52a;_0x3009be['model']=_['keys'](db['User']['rawAttributes']);_0x3009be[_0xf9ff('0x41')]=_[_0xf9ff('0x42')](_0x466b93[_0xf9ff('0x41')]);_0x3009be[_0xf9ff('0x43')]=_[_0xf9ff('0x44')](_0x3009be[_0xf9ff('0x40')],_0x3009be[_0xf9ff('0x41')]);_0x3fe78b['attributes']=_[_0xf9ff('0x44')](_0x3009be[_0xf9ff('0x40')],qs[_0xf9ff('0x46')](_0x466b93[_0xf9ff('0x41')][_0xf9ff('0x46')]));_0x3fe78b[_0xf9ff('0x45')]=_0x3fe78b['attributes']['length']?_0x3fe78b[_0xf9ff('0x45')]:_0x3009be[_0xf9ff('0x40')];_0x3fe78b[_0xf9ff('0x48')]=qs[_0xf9ff('0x49')](_0x466b93['query'][_0xf9ff('0x49')]);_0x3fe78b[_0xf9ff('0x4c')]=qs['filters'](_[_0xf9ff('0x4a')](_0x466b93['query'],_0x3009be[_0xf9ff('0x43')]));if(_0x466b93[_0xf9ff('0x41')][_0xf9ff('0x4b')]){_0x3fe78b[_0xf9ff('0x4c')]=_[_0xf9ff('0x4e')](_0x3fe78b[_0xf9ff('0x4c')],{'$or':_[_0xf9ff('0x3b')](_0x3fe78b[_0xf9ff('0x45')],function(_0x50cc0c){var _0x5d5e24={};_0x5d5e24[_0x50cc0c]={'$like':'%'+_0x466b93[_0xf9ff('0x41')][_0xf9ff('0x4b')]+'%'};return _0x5d5e24;})});}_0x3fe78b=_['merge']({},_0x3fe78b,_0x466b93[_0xf9ff('0x4f')]);return _0x53dcd2['getAgents'](_0x3fe78b);}})[_0xf9ff('0x1e')](function(_0x5f240a){if(_0x5f240a){_0x35dd10=_0x5f240a['length'];if(!_0x466b93[_0xf9ff('0x41')][_0xf9ff('0x66')](_0xf9ff('0x67'))){_0x3fe78b[_0xf9ff('0x2d')]=qs[_0xf9ff('0x2d')](_0x466b93[_0xf9ff('0x41')][_0xf9ff('0x2d')]);_0x3fe78b[_0xf9ff('0x2b')]=qs[_0xf9ff('0x2b')](_0x466b93[_0xf9ff('0x41')][_0xf9ff('0x2b')]);}return _0x53dcd2[_0xf9ff('0xb4')](_0x3fe78b);}})[_0xf9ff('0x1e')](function(_0x31357b){if(_0x31357b){return _0x31357b?{'count':_0x35dd10,'rows':_0x31357b}:null;}})['then'](respondWithResult(_0x49d559,null))[_0xf9ff('0x26')](handleError(_0x49d559,null));};exports[_0xf9ff('0x39')]=function(_0x11f524,_0x2a3e5b,_0x3214c1){var _0x42ca03,_0x5a8b26,_0x412484;if(_[_0xf9ff('0x76')](_0x11f524[_0xf9ff('0x5f')][_0xf9ff('0x5f')])||_0x11f524[_0xf9ff('0x5f')][_0xf9ff('0x5f')]===''){throw new db[(_0xf9ff('0x70'))][(_0xf9ff('0x71'))](_0xf9ff('0xb5'));}if(_[_0xf9ff('0x76')](_0x11f524[_0xf9ff('0x5f')]['to'])){}_0x42ca03=_0x11f524[_0xf9ff('0x5f')]['to'];return db[_0xf9ff('0x3c')][_0xf9ff('0x64')]({'where':{'id':_0x11f524[_0xf9ff('0x60')]['id']}})['then'](handleEntityNotFound(_0x2a3e5b,null))[_0xf9ff('0x1e')](function(_0x46b829){if(_0x46b829){return db[_0xf9ff('0x3c')][_0xf9ff('0x57')]({'where':{'id':_0x46b829['id']},'include':[{'model':db[_0xf9ff('0x7d')],'as':'List','include':[{'model':db[_0xf9ff('0x6f')],'as':'Contacts','where':{[_0x46b829[_0xf9ff('0x79')]]:_0x42ca03},'limit':0x1,'order':[[_0xf9ff('0x74'),_0xf9ff('0x7f')]]}]}]})['then'](handleEntityNotFound(_0x2a3e5b,null))[_0xf9ff('0x1e')](function(_0x1b78d8){if(_0x1b78d8&&_0x1b78d8['List']){_0x5a8b26=_0x1b78d8[_0xf9ff('0x35')]({'plain':!![]});if(_0x5a8b26[_0xf9ff('0x7e')]&&_0x5a8b26[_0xf9ff('0x7e')][_0xf9ff('0x87')][_0xf9ff('0x47')]){return _0x5a8b26[_0xf9ff('0x7e')][_0xf9ff('0x87')][0x0];}return db[_0xf9ff('0x6f')][_0xf9ff('0x58')](_[_0xf9ff('0x88')](_0x11f524[_0xf9ff('0x5f')],{'firstName':_0x42ca03,[_0x1b78d8['mapKey']]:_0x42ca03,'phone':_0x42ca03,'ListId':_0x5a8b26[_0xf9ff('0x75')]}));}})[_0xf9ff('0x1e')](handleEntityNotFound(_0x2a3e5b,null))[_0xf9ff('0x1e')](function(_0x3dc8a3){if(_0x3dc8a3){_0x412484=_0x3dc8a3;return db[_0xf9ff('0x8d')][_0xf9ff('0x57')]({'where':{'ContactId':_0x412484['id'],'closed':![],'OpenchannelAccountId':_0x5a8b26['id']}})['then'](function(_0x3cc954){if(_0x3cc954){return[_0x3cc954,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x11f524[_0xf9ff('0x5b')]['id'],'ContactId':_0x412484['id'],'OpenchannelAccountId':_0x5a8b26['id'],'lastMsgDirection':'out','Messages':[_[_0xf9ff('0x4e')](_0x11f524[_0xf9ff('0x5f')],{'read':![],'body':_0x11f524[_0xf9ff('0x5f')][_0xf9ff('0x5f')],'OpenchannelAccountId':_0x5a8b26['id'],'UserId':_0x11f524[_0xf9ff('0x5b')]['id'],'ContactId':_0x412484['id']})]},{'include':[{'model':db[_0xf9ff('0x96')],'as':_0xf9ff('0xb6')}]})[_0xf9ff('0x1e')](function(_0x259665){return[_0x259665,!![]];});});}})[_0xf9ff('0xb7')](function(_0x1a75be,_0x3eccc4){if(_0x3eccc4){return _0x1a75be;}return db[_0xf9ff('0x96')][_0xf9ff('0x58')](_[_0xf9ff('0x4e')](_0x11f524[_0xf9ff('0x5f')],{'read':![],'body':_0x11f524[_0xf9ff('0x5f')][_0xf9ff('0x5f')],'OpenchannelAccountId':_0x5a8b26['id'],'OpenchannelInteractionId':_0x1a75be['id'],'UserId':_0x11f524[_0xf9ff('0x5b')]['id'],'ContactId':_0x412484['id']}))[_0xf9ff('0x1e')](function(_0xebd29b){_0x1a75be[_0xf9ff('0xb8')][_0xf9ff('0xb6')]=[];_0x1a75be[_0xf9ff('0xb8')][_0xf9ff('0xb6')][_0xf9ff('0xb9')](_0xebd29b[_0xf9ff('0xb8')]);return _0x1a75be;});});}})['then'](respondWithResult(_0x2a3e5b,null))[_0xf9ff('0x26')](handleError(_0x2a3e5b,null));};
\ No newline at end of file
index d4a9179..45b36d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','hasOwnProperty','exports','events'];(function(_0x3cc71e,_0x3b498b){var _0x574a4e=function(_0x1ada92){while(--_0x1ada92){_0x3cc71e['push'](_0x3cc71e['shift']());}};_0x574a4e(++_0x3b498b);}(_0xaa88,0x137));var _0x8aa8=function(_0x363b81,_0x81e6ca){_0x363b81=_0x363b81-0x0;var _0x1d92fb=_0xaa88[_0x363b81];return _0x1d92fb;};'use strict';var EventEmitter=require(_0x8aa8('0x0'));var OpenchannelAccount=require(_0x8aa8('0x1'))['db'][_0x8aa8('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8aa8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8aa8('0x4'),'afterDestroy':_0x8aa8('0x5')};function emitEvent(_0x43f7e4){return function(_0x3b2c88,_0x3e3b70,_0x350e8b){OpenchannelAccountEvents['emit'](_0x43f7e4+':'+_0x3b2c88['id'],_0x3b2c88);OpenchannelAccountEvents['emit'](_0x43f7e4,_0x3b2c88);_0x350e8b(null);};}for(var e in events){if(events[_0x8aa8('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8aa8('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x22bcdc,_0x5e01fa){var _0x439547=function(_0x3ca99d){while(--_0x3ca99d){_0x22bcdc['push'](_0x22bcdc['shift']());}};_0x439547(++_0x5e01fa);}(_0xee5b,0x1f4));var _0xbee5=function(_0x5bc6c1,_0x2faeaf){_0x5bc6c1=_0x5bc6c1-0x0;var _0x42675d=_0xee5b[_0x5bc6c1];return _0x42675d;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
index e059a21..a9728a9 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(_0x788980,_0x3dd1c6){var _0x507c98=function(_0x4cbcc9){while(--_0x4cbcc9){_0x788980['push'](_0x788980['shift']());}};_0x507c98(++_0x3dd1c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0xd0c7c7,_0x368baa){var _0x2b1b5c=function(_0x32e376){while(--_0x32e376){_0xd0c7c7['push'](_0xd0c7c7['shift']());}};_0x2b1b5c(++_0x368baa);}(_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 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 2ed7c6a..a935cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9e8=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1278c6,_0x192ac6){var _0x31a3be=function(_0x13bb97){while(--_0x13bb97){_0x1278c6['push'](_0x1278c6['shift']());}};_0x31a3be(++_0x192ac6);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x54d71b,_0x5407b3){_0x54d71b=_0x54d71b-0x0;var _0x57751b=_0xe9e8[_0x54d71b];return _0x57751b;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))(_0x8e9e('0x8'));var config=require(_0x8e9e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8e9e('0xa')][_0x8e9e('0xb')]({'port':0x232a});config[_0x8e9e('0xc')]=_[_0x8e9e('0xd')](config['redis'],{'host':_0x8e9e('0xe'),'port':0x18eb});var socket=require(_0x8e9e('0xf'))(new Redis(config[_0x8e9e('0xc')]));require('./openchannelAccount.socket')[_0x8e9e('0x10')](socket);function respondWithRpcPromise(_0x29edcb,_0x449f72,_0x57ffc0){return new BPromise(function(_0xbcfd72,_0x303402){return client[_0x8e9e('0x11')](_0x29edcb,_0x57ffc0)[_0x8e9e('0x12')](function(_0x35f014){logger[_0x8e9e('0x13')](_0x8e9e('0x14'),_0x449f72,'request\x20sent');logger[_0x8e9e('0x15')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x449f72,_0x8e9e('0x16'),JSON[_0x8e9e('0x17')](_0x35f014));if(_0x35f014[_0x8e9e('0x18')]){if(_0x35f014[_0x8e9e('0x18')][_0x8e9e('0x19')]===0x1f4){logger[_0x8e9e('0x18')](_0x8e9e('0x14'),_0x449f72,_0x35f014['error']['message']);return _0x303402(_0x35f014[_0x8e9e('0x18')][_0x8e9e('0x1a')]);}logger['error'](_0x8e9e('0x14'),_0x449f72,_0x35f014[_0x8e9e('0x18')][_0x8e9e('0x1a')]);return _0xbcfd72(_0x35f014[_0x8e9e('0x18')][_0x8e9e('0x1a')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x449f72,_0x8e9e('0x16'));_0xbcfd72(_0x35f014[_0x8e9e('0x1b')][_0x8e9e('0x1a')]);}})[_0x8e9e('0x1c')](function(_0xa079b5){logger[_0x8e9e('0x18')](_0x8e9e('0x14'),_0x449f72,_0xa079b5);_0x303402(_0xa079b5);});});}
\ No newline at end of file
+var _0xdb94=['randomstring','../../mysqldb','../../config/utils','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','request','info','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x3b3d4c,_0x49f1bf){var _0x34b52f=function(_0x527a60){while(--_0x527a60){_0x3b3d4c['push'](_0x3b3d4c['shift']());}};_0x34b52f(++_0x49f1bf);}(_0xdb94,0xab));var _0x4db9=function(_0x1cd274,_0x23015a){_0x1cd274=_0x1cd274-0x0;var _0x4bbc0f=_0xdb94[_0x1cd274];return _0x4bbc0f;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});config['redis']=_[_0x4db9('0x9')](config['redis'],{'host':_0x4db9('0xa'),'port':0x18eb});var socket=require(_0x4db9('0xb'))(new Redis(config[_0x4db9('0xc')]));require(_0x4db9('0xd'))[_0x4db9('0xe')](socket);function respondWithRpcPromise(_0x242116,_0x45c0e4,_0xeb2168){return new BPromise(function(_0x26f3ae,_0x2bf991){return client[_0x4db9('0xf')](_0x242116,_0xeb2168)['then'](function(_0x451970){logger[_0x4db9('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x45c0e4,'request\x20sent');logger[_0x4db9('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x45c0e4,'request\x20sent',JSON[_0x4db9('0x12')](_0x451970));if(_0x451970[_0x4db9('0x13')]){if(_0x451970['error'][_0x4db9('0x14')]===0x1f4){logger[_0x4db9('0x13')](_0x4db9('0x15'),_0x45c0e4,_0x451970[_0x4db9('0x13')]['message']);return _0x2bf991(_0x451970['error'][_0x4db9('0x16')]);}logger[_0x4db9('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x45c0e4,_0x451970[_0x4db9('0x13')][_0x4db9('0x16')]);return _0x26f3ae(_0x451970['error']['message']);}else{logger[_0x4db9('0x10')](_0x4db9('0x15'),_0x45c0e4,_0x4db9('0x17'));_0x26f3ae(_0x451970[_0x4db9('0x18')][_0x4db9('0x16')]);}})['catch'](function(_0x3b1f87){logger[_0x4db9('0x13')](_0x4db9('0x15'),_0x45c0e4,_0x3b1f87);_0x2bf991(_0x3b1f87);});});}
\ No newline at end of file
index a0135bb..d48a250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x823c=['length','./openchannelAccount.events','remove','update','emit','removeListener','register'];(function(_0x52bcac,_0xb309cb){var _0x29e404=function(_0x1f7284){while(--_0x1f7284){_0x52bcac['push'](_0x52bcac['shift']());}};_0x29e404(++_0xb309cb);}(_0x823c,0x143));var _0xc823=function(_0x15a662,_0x221536){_0x15a662=_0x15a662-0x0;var _0x58949e=_0x823c[_0x15a662];return _0x58949e;};'use strict';var OpenchannelAccountEvents=require(_0xc823('0x0'));var events=['save',_0xc823('0x1'),_0xc823('0x2')];function createListener(_0x28a645,_0x448609){return function(_0x306879){_0x448609[_0xc823('0x3')](_0x28a645,_0x306879);};}function removeListener(_0x49f2d2,_0x3309cc){return function(){OpenchannelAccountEvents[_0xc823('0x4')](_0x49f2d2,_0x3309cc);};}exports[_0xc823('0x5')]=function(_0x42e0c0){for(var _0x380607=0x0,_0x49e861=events[_0xc823('0x6')];_0x380607<_0x49e861;_0x380607++){var _0x472007=events[_0x380607];var _0x5daab9=createListener('openchannelAccount:'+_0x472007,_0x42e0c0);OpenchannelAccountEvents['on'](_0x472007,_0x5daab9);}};
\ No newline at end of file
+var _0xb49a=['save','remove','update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x52a6f0,_0xf9d22){var _0x4926dc=function(_0x10acf2){while(--_0x10acf2){_0x52a6f0['push'](_0x52a6f0['shift']());}};_0x4926dc(++_0xf9d22);}(_0xb49a,0xfb));var _0xab49=function(_0x4cd685,_0x472697){_0x4cd685=_0x4cd685-0x0;var _0x37743e=_0xb49a[_0x4cd685];return _0x37743e;};'use strict';var OpenchannelAccountEvents=require(_0xab49('0x0'));var events=[_0xab49('0x1'),_0xab49('0x2'),_0xab49('0x3')];function createListener(_0x8db649,_0x55d01b){return function(_0x4387a5){_0x55d01b[_0xab49('0x4')](_0x8db649,_0x4387a5);};}function removeListener(_0x5554fe,_0x543eb0){return function(){OpenchannelAccountEvents[_0xab49('0x5')](_0x5554fe,_0x543eb0);};}exports[_0xab49('0x6')]=function(_0x1cae1d){for(var _0x3703cb=0x0,_0x57ea72=events[_0xab49('0x7')];_0x3703cb<_0x57ea72;_0x3703cb++){var _0xd86a5=events[_0x3703cb];var _0x4d4d00=createListener(_0xab49('0x8')+_0xd86a5,_0x1cae1d);OpenchannelAccountEvents['on'](_0xd86a5,_0x4d4d00);}};
\ No newline at end of file
index 191ad61..b7f306c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4701=['../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x320184,_0x3f1593){var _0x46d5cb=function(_0x59836a){while(--_0x59836a){_0x320184['push'](_0x320184['shift']());}};_0x46d5cb(++_0x3f1593);}(_0x4701,0xdd));var _0x1470=function(_0x437c83,_0x8851eb){_0x437c83=_0x437c83-0x0;var _0x2e83f8=_0x4701[_0x437c83];return _0x2e83f8;};'use strict';var multer=require(_0x1470('0x0'));var util=require(_0x1470('0x1'));var path=require(_0x1470('0x2'));var timeout=require(_0x1470('0x3'));var express=require(_0x1470('0x4'));var router=express['Router']();var fs_extra=require(_0x1470('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1470('0x6'));var config=require(_0x1470('0x7'));var controller=require(_0x1470('0x8'));router[_0x1470('0x9')]('/',auth[_0x1470('0xa')](),controller[_0x1470('0xb')]);router[_0x1470('0x9')](_0x1470('0xc'),auth[_0x1470('0xa')](),controller[_0x1470('0xd')]);router[_0x1470('0xe')]('/',auth['isAuthenticated'](),controller[_0x1470('0xf')]);router[_0x1470('0x10')](_0x1470('0xc'),auth['isAuthenticated'](),controller[_0x1470('0x11')]);router['delete']('/:id',auth[_0x1470('0xa')](),controller[_0x1470('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x40ce=['post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','/:id','show'];(function(_0x2e6c70,_0x589880){var _0x425436=function(_0x18d6df){while(--_0x18d6df){_0x2e6c70['push'](_0x2e6c70['shift']());}};_0x425436(++_0x589880);}(_0x40ce,0x122));var _0xe40c=function(_0x5f58c2,_0x20129d){_0x5f58c2=_0x5f58c2-0x0;var _0x15c13c=_0x40ce[_0x5f58c2];return _0x15c13c;};'use strict';var multer=require(_0xe40c('0x0'));var util=require(_0xe40c('0x1'));var path=require(_0xe40c('0x2'));var timeout=require(_0xe40c('0x3'));var express=require(_0xe40c('0x4'));var router=express[_0xe40c('0x5')]();var fs_extra=require(_0xe40c('0x6'));var auth=require(_0xe40c('0x7'));var interaction=require(_0xe40c('0x8'));var config=require(_0xe40c('0x9'));var controller=require(_0xe40c('0xa'));router['get']('/',auth[_0xe40c('0xb')](),controller['index']);router['get'](_0xe40c('0xc'),auth[_0xe40c('0xb')](),controller[_0xe40c('0xd')]);router[_0xe40c('0xe')]('/',auth[_0xe40c('0xb')](),controller[_0xe40c('0xf')]);router[_0xe40c('0x10')](_0xe40c('0xc'),auth['isAuthenticated'](),controller[_0xe40c('0x11')]);router['delete']('/:id',auth[_0xe40c('0xb')](),controller[_0xe40c('0x12')]);module['exports']=router;
\ No newline at end of file
index 29f060b..cce5950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00ea=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x1cc2b3,_0x39945d){var _0x1d6847=function(_0x4a338c){while(--_0x4a338c){_0x1cc2b3['push'](_0x1cc2b3['shift']());}};_0x1d6847(++_0x39945d);}(_0x00ea,0x132));var _0xa00e=function(_0x4c3da0,_0xadab0b){_0x4c3da0=_0x4c3da0-0x0;var _0x50b02f=_0x00ea[_0x4c3da0];return _0x50b02f;};'use strict';var Sequelize=require(_0xa00e('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa00e('0x1')],'allowNull':![],'defaultValue':_0xa00e('0x2')},'appdata':{'type':Sequelize[_0xa00e('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa00e('0x1')],'defaultValue':_0xa00e('0x4')}};
\ No newline at end of file
+var _0x13ac=['TEXT','sequelize','exports','STRING','noop'];(function(_0x41beb0,_0x2298de){var _0x77cc6f=function(_0x2f2cce){while(--_0x2f2cce){_0x41beb0['push'](_0x41beb0['shift']());}};_0x77cc6f(++_0x2298de);}(_0x13ac,0x14b));var _0xc13a=function(_0x1bf020,_0x3195eb){_0x1bf020=_0x1bf020-0x0;var _0x105a3f=_0x13ac[_0x1bf020];return _0x105a3f;};'use strict';var Sequelize=require(_0xc13a('0x0'));module[_0xc13a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc13a('0x2')],'allowNull':![],'defaultValue':_0xc13a('0x3')},'appdata':{'type':Sequelize[_0xc13a('0x4')]()},'description':{'type':Sequelize[_0xc13a('0x2')]},'interval':{'type':Sequelize[_0xc13a('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 8d7717c..7ba8936 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1857=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','rawAttributes','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','OpenchannelApplication','includeAll','include','rows','catch','show','intersection','length','options','find','create','body','params','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x9f9ed5,_0x56f438){var _0xbc71e3=function(_0x1de828){while(--_0x1de828){_0x9f9ed5['push'](_0x9f9ed5['shift']());}};_0xbc71e3(++_0x56f438);}(_0x1857,0x199));var _0x7185=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1857[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7185('0x0'));var rp=require(_0x7185('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7185('0x2'));var util=require(_0x7185('0x3'));var path=require(_0x7185('0x4'));var sox=require(_0x7185('0x5'));var csv=require('to-csv');var ejs=require(_0x7185('0x6'));var fs=require('fs');var fs_extra=require(_0x7185('0x7'));var _=require('lodash');var squel=require(_0x7185('0x8'));var crypto=require('crypto');var jsforce=require(_0x7185('0x9'));var deskjs=require(_0x7185('0xa'));var toCsv=require(_0x7185('0xb'));var querystring=require(_0x7185('0xc'));var Papa=require(_0x7185('0xd'));var Redis=require('ioredis');var authService=require(_0x7185('0xe'));var qs=require(_0x7185('0xf'));var as=require(_0x7185('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7185('0x11'))(_0x7185('0x12'));var utils=require('../../config/utils');var config=require(_0x7185('0x13'));var licenseUtil=require(_0x7185('0x14'));var db=require(_0x7185('0x15'))['db'];function respondWithStatusCode(_0x392d06,_0x3b7355){_0x3b7355=_0x3b7355||0xcc;return function(_0x59d9b3){if(_0x59d9b3){return _0x392d06[_0x7185('0x16')](_0x3b7355);}return _0x392d06[_0x7185('0x17')](_0x3b7355)[_0x7185('0x18')]();};}function respondWithResult(_0x5d3b9c,_0x5c6159){_0x5c6159=_0x5c6159||0xc8;return function(_0x321132){if(_0x321132){return _0x5d3b9c[_0x7185('0x17')](_0x5c6159)[_0x7185('0x19')](_0x321132);}};}function respondWithFilteredResult(_0x237809,_0x40ae5b){return function(_0x332c69){if(_0x332c69){var _0x3f9adf=typeof _0x40ae5b[_0x7185('0x1a')]==='undefined'&&typeof _0x40ae5b[_0x7185('0x1b')]===_0x7185('0x1c');var _0x436d89=_0x332c69[_0x7185('0x1d')];var _0x36e417=_0x3f9adf?0x0:_0x40ae5b['offset'];var _0xfe64c5=_0x3f9adf?_0x332c69['count']:_0x40ae5b[_0x7185('0x1a')]+_0x40ae5b['limit'];var _0x32459e;if(_0xfe64c5>=_0x436d89){_0xfe64c5=_0x436d89;_0x32459e=0xc8;}else{_0x32459e=0xce;}_0x237809[_0x7185('0x17')](_0x32459e);return _0x237809[_0x7185('0x1e')](_0x7185('0x1f'),_0x36e417+'-'+_0xfe64c5+'/'+_0x436d89)[_0x7185('0x19')](_0x332c69);}return null;};}function patchUpdates(_0x25745b){return function(_0x23b225){try{jsonpatch[_0x7185('0x20')](_0x23b225,_0x25745b,!![]);}catch(_0xead9df){return BPromise['reject'](_0xead9df);}return _0x23b225[_0x7185('0x21')]();};}function saveUpdates(_0x59dc26,_0x5031af){return function(_0x1510ee){if(_0x1510ee){return _0x1510ee[_0x7185('0x22')](_0x59dc26)[_0x7185('0x23')](function(_0x38952b){return _0x38952b;});}return null;};}function removeEntity(_0x5962f5,_0x138042){return function(_0x4440fc){if(_0x4440fc){return _0x4440fc['destroy']()[_0x7185('0x23')](function(){_0x5962f5[_0x7185('0x17')](0xcc)[_0x7185('0x18')]();});}};}function handleEntityNotFound(_0x4241ca,_0x13b379){return function(_0x31ec3a){if(!_0x31ec3a){_0x4241ca['sendStatus'](0x194);}return _0x31ec3a;};}function handleError(_0x44aed4,_0x19b49d){_0x19b49d=_0x19b49d||0x1f4;return function(_0x59046b){logger[_0x7185('0x24')](_0x59046b['stack']);if(_0x59046b[_0x7185('0x25')]){delete _0x59046b[_0x7185('0x25')];}_0x44aed4['status'](_0x19b49d)[_0x7185('0x26')](_0x59046b);};}exports[_0x7185('0x27')]=function(_0x205c86,_0xb86c0a){var _0x5abda9={},_0x239f08={},_0x47ffbc={'count':0x0,'rows':[]};var _0x360337=_[_0x7185('0x28')](db['OpenchannelApplication'][_0x7185('0x29')],function(_0x3d46cb){return{'name':_0x3d46cb['fieldName'],'type':_0x3d46cb[_0x7185('0x2a')][_0x7185('0x2b')]};});_0x239f08['model']=_['map'](_0x360337,'name');_0x239f08[_0x7185('0x2c')]=_[_0x7185('0x2d')](_0x205c86[_0x7185('0x2c')]);_0x239f08[_0x7185('0x2e')]=_['intersection'](_0x239f08[_0x7185('0x2f')],_0x239f08[_0x7185('0x2c')]);_0x5abda9[_0x7185('0x30')]=_['intersection'](_0x239f08[_0x7185('0x2f')],qs['fields'](_0x205c86['query'][_0x7185('0x31')]));_0x5abda9[_0x7185('0x30')]=_0x5abda9[_0x7185('0x30')]['length']?_0x5abda9[_0x7185('0x30')]:_0x239f08['model'];if(!_0x205c86[_0x7185('0x2c')][_0x7185('0x32')](_0x7185('0x33'))){_0x5abda9[_0x7185('0x1b')]=qs[_0x7185('0x1b')](_0x205c86[_0x7185('0x2c')][_0x7185('0x1b')]);_0x5abda9[_0x7185('0x1a')]=qs[_0x7185('0x1a')](_0x205c86[_0x7185('0x2c')][_0x7185('0x1a')]);}_0x5abda9[_0x7185('0x34')]=qs[_0x7185('0x35')](_0x205c86[_0x7185('0x2c')]['sort']);_0x5abda9[_0x7185('0x36')]=qs['filters'](_['pick'](_0x205c86[_0x7185('0x2c')],_0x239f08[_0x7185('0x2e')]),_0x360337);if(_0x205c86[_0x7185('0x2c')]['filter']){_0x5abda9[_0x7185('0x36')]=_[_0x7185('0x37')](_0x5abda9[_0x7185('0x36')],{'$or':_[_0x7185('0x28')](_0x360337,function(_0x5e7e78){if(_0x5e7e78[_0x7185('0x2a')]!==_0x7185('0x38')){var _0x74b848={};_0x74b848[_0x5e7e78[_0x7185('0x25')]]={'$like':'%'+_0x205c86['query'][_0x7185('0x39')]+'%'};return _0x74b848;}})});}_0x5abda9=_[_0x7185('0x37')]({},_0x5abda9,_0x205c86['options']);var _0x88a4e7={'where':_0x5abda9[_0x7185('0x36')]};return db[_0x7185('0x3a')][_0x7185('0x1d')](_0x88a4e7)['then'](function(_0x1b7cab){_0x47ffbc[_0x7185('0x1d')]=_0x1b7cab;if(_0x205c86[_0x7185('0x2c')][_0x7185('0x3b')]){_0x5abda9[_0x7185('0x3c')]=[{'all':!![]}];}return db[_0x7185('0x3a')]['findAll'](_0x5abda9);})['then'](function(_0x29f265){_0x47ffbc[_0x7185('0x3d')]=_0x29f265;return _0x47ffbc;})[_0x7185('0x23')](respondWithFilteredResult(_0xb86c0a,_0x5abda9))[_0x7185('0x3e')](handleError(_0xb86c0a,null));};exports[_0x7185('0x3f')]=function(_0x5aacd4,_0x2f07f8){var _0x3d84a6={'raw':!![],'where':{'id':_0x5aacd4['params']['id']}},_0x32f224={};_0x32f224[_0x7185('0x2f')]=_[_0x7185('0x2d')](db[_0x7185('0x3a')][_0x7185('0x29')]);_0x32f224[_0x7185('0x2c')]=_[_0x7185('0x2d')](_0x5aacd4[_0x7185('0x2c')]);_0x32f224[_0x7185('0x2e')]=_[_0x7185('0x40')](_0x32f224['model'],_0x32f224[_0x7185('0x2c')]);_0x3d84a6[_0x7185('0x30')]=_['intersection'](_0x32f224['model'],qs[_0x7185('0x31')](_0x5aacd4['query']['fields']));_0x3d84a6[_0x7185('0x30')]=_0x3d84a6[_0x7185('0x30')][_0x7185('0x41')]?_0x3d84a6[_0x7185('0x30')]:_0x32f224[_0x7185('0x2f')];if(_0x5aacd4['query'][_0x7185('0x3b')]){_0x3d84a6['include']=[{'all':!![]}];}_0x3d84a6=_[_0x7185('0x37')]({},_0x3d84a6,_0x5aacd4[_0x7185('0x42')]);return db[_0x7185('0x3a')][_0x7185('0x43')](_0x3d84a6)[_0x7185('0x23')](handleEntityNotFound(_0x2f07f8,null))[_0x7185('0x23')](respondWithResult(_0x2f07f8,null))[_0x7185('0x3e')](handleError(_0x2f07f8,null));};exports[_0x7185('0x44')]=function(_0x3716d6,_0x5c9f23){return db[_0x7185('0x3a')]['create'](_0x3716d6[_0x7185('0x45')],{})[_0x7185('0x23')](respondWithResult(_0x5c9f23,0xc9))['catch'](handleError(_0x5c9f23,null));};exports[_0x7185('0x22')]=function(_0x34e6b7,_0x3e563f){if(_0x34e6b7[_0x7185('0x45')]['id']){delete _0x34e6b7['body']['id'];}return db[_0x7185('0x3a')]['find']({'where':{'id':_0x34e6b7[_0x7185('0x46')]['id']}})[_0x7185('0x23')](handleEntityNotFound(_0x3e563f,null))[_0x7185('0x23')](saveUpdates(_0x34e6b7[_0x7185('0x45')],null))['then'](respondWithResult(_0x3e563f,null))[_0x7185('0x3e')](handleError(_0x3e563f,null));};exports['destroy']=function(_0x34406e,_0x2c2215){return db[_0x7185('0x3a')][_0x7185('0x43')]({'where':{'id':_0x34406e[_0x7185('0x46')]['id']}})[_0x7185('0x23')](handleEntityNotFound(_0x2c2215,null))[_0x7185('0x23')](removeEntity(_0x2c2215,null))['catch'](handleError(_0x2c2215,null));};
\ No newline at end of file
+var _0xd489=['find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','save','update','then','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','include','rows','catch','show','params','includeAll'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xd489,0x15c));var _0x9d48=function(_0x37a241,_0x149148){_0x37a241=_0x37a241-0x0;var _0x159898=_0xd489[_0x37a241];return _0x159898;};'use strict';var emlformat=require(_0x9d48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d48('0x1'));var jsonpatch=require(_0x9d48('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9d48('0x3'));var Mustache=require(_0x9d48('0x4'));var util=require(_0x9d48('0x5'));var path=require(_0x9d48('0x6'));var sox=require('sox');var csv=require(_0x9d48('0x7'));var ejs=require(_0x9d48('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d48('0x9'));var squel=require(_0x9d48('0xa'));var crypto=require('crypto');var jsforce=require(_0x9d48('0xb'));var deskjs=require(_0x9d48('0xc'));var toCsv=require(_0x9d48('0x7'));var querystring=require('querystring');var Papa=require(_0x9d48('0xd'));var Redis=require(_0x9d48('0xe'));var authService=require(_0x9d48('0xf'));var qs=require(_0x9d48('0x10'));var as=require(_0x9d48('0x11'));var hardwareService=require(_0x9d48('0x12'));var logger=require(_0x9d48('0x13'))(_0x9d48('0x14'));var utils=require(_0x9d48('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9d48('0x16'));var db=require(_0x9d48('0x17'))['db'];function respondWithStatusCode(_0x1455c3,_0x23a4ce){_0x23a4ce=_0x23a4ce||0xcc;return function(_0x3ee176){if(_0x3ee176){return _0x1455c3[_0x9d48('0x18')](_0x23a4ce);}return _0x1455c3[_0x9d48('0x19')](_0x23a4ce)[_0x9d48('0x1a')]();};}function respondWithResult(_0x5e45e5,_0x46e1a1){_0x46e1a1=_0x46e1a1||0xc8;return function(_0xa03d86){if(_0xa03d86){return _0x5e45e5[_0x9d48('0x19')](_0x46e1a1)[_0x9d48('0x1b')](_0xa03d86);}};}function respondWithFilteredResult(_0x5e250d,_0x11a596){return function(_0x12a6d5){if(_0x12a6d5){var _0x2330ea=typeof _0x11a596['offset']===_0x9d48('0x1c')&&typeof _0x11a596['limit']===_0x9d48('0x1c');var _0x1ac2ca=_0x12a6d5[_0x9d48('0x1d')];var _0x22bba4=_0x2330ea?0x0:_0x11a596[_0x9d48('0x1e')];var _0x41ffa4=_0x2330ea?_0x12a6d5[_0x9d48('0x1d')]:_0x11a596[_0x9d48('0x1e')]+_0x11a596[_0x9d48('0x1f')];var _0x57c9fc;if(_0x41ffa4>=_0x1ac2ca){_0x41ffa4=_0x1ac2ca;_0x57c9fc=0xc8;}else{_0x57c9fc=0xce;}_0x5e250d[_0x9d48('0x19')](_0x57c9fc);return _0x5e250d['set'](_0x9d48('0x20'),_0x22bba4+'-'+_0x41ffa4+'/'+_0x1ac2ca)['json'](_0x12a6d5);}return null;};}function patchUpdates(_0x25ac71){return function(_0x14991f){try{jsonpatch['apply'](_0x14991f,_0x25ac71,!![]);}catch(_0x1a7201){return BPromise['reject'](_0x1a7201);}return _0x14991f[_0x9d48('0x21')]();};}function saveUpdates(_0x1809f4,_0x5a79a9){return function(_0x5f2e37){if(_0x5f2e37){return _0x5f2e37[_0x9d48('0x22')](_0x1809f4)[_0x9d48('0x23')](function(_0x26fe5b){return _0x26fe5b;});}return null;};}function removeEntity(_0x54d6c8,_0x17acd8){return function(_0x13ff65){if(_0x13ff65){return _0x13ff65['destroy']()['then'](function(){_0x54d6c8['status'](0xcc)[_0x9d48('0x1a')]();});}};}function handleEntityNotFound(_0x48844c,_0x295a33){return function(_0x465d83){if(!_0x465d83){_0x48844c['sendStatus'](0x194);}return _0x465d83;};}function handleError(_0x5405bd,_0x5c3746){_0x5c3746=_0x5c3746||0x1f4;return function(_0xda924b){logger['error'](_0xda924b[_0x9d48('0x24')]);if(_0xda924b[_0x9d48('0x25')]){delete _0xda924b[_0x9d48('0x25')];}_0x5405bd[_0x9d48('0x19')](_0x5c3746)['send'](_0xda924b);};}exports[_0x9d48('0x26')]=function(_0x3b7376,_0x5b3c6b){var _0x1a8194={},_0x27f6d4={},_0x153871={'count':0x0,'rows':[]};var _0x1a4147=_[_0x9d48('0x27')](db[_0x9d48('0x28')][_0x9d48('0x29')],function(_0x4ed165){return{'name':_0x4ed165[_0x9d48('0x2a')],'type':_0x4ed165['type'][_0x9d48('0x2b')]};});_0x27f6d4[_0x9d48('0x2c')]=_[_0x9d48('0x27')](_0x1a4147,_0x9d48('0x25'));_0x27f6d4[_0x9d48('0x2d')]=_[_0x9d48('0x2e')](_0x3b7376[_0x9d48('0x2d')]);_0x27f6d4[_0x9d48('0x2f')]=_[_0x9d48('0x30')](_0x27f6d4[_0x9d48('0x2c')],_0x27f6d4[_0x9d48('0x2d')]);_0x1a8194[_0x9d48('0x31')]=_[_0x9d48('0x30')](_0x27f6d4['model'],qs[_0x9d48('0x32')](_0x3b7376['query']['fields']));_0x1a8194[_0x9d48('0x31')]=_0x1a8194[_0x9d48('0x31')][_0x9d48('0x33')]?_0x1a8194[_0x9d48('0x31')]:_0x27f6d4[_0x9d48('0x2c')];if(!_0x3b7376['query'][_0x9d48('0x34')]('nolimit')){_0x1a8194[_0x9d48('0x1f')]=qs[_0x9d48('0x1f')](_0x3b7376[_0x9d48('0x2d')]['limit']);_0x1a8194[_0x9d48('0x1e')]=qs[_0x9d48('0x1e')](_0x3b7376[_0x9d48('0x2d')][_0x9d48('0x1e')]);}_0x1a8194[_0x9d48('0x35')]=qs['sort'](_0x3b7376[_0x9d48('0x2d')][_0x9d48('0x36')]);_0x1a8194['where']=qs[_0x9d48('0x2f')](_['pick'](_0x3b7376['query'],_0x27f6d4[_0x9d48('0x2f')]),_0x1a4147);if(_0x3b7376['query'][_0x9d48('0x37')]){_0x1a8194[_0x9d48('0x38')]=_[_0x9d48('0x39')](_0x1a8194[_0x9d48('0x38')],{'$or':_[_0x9d48('0x27')](_0x1a4147,function(_0x351733){if(_0x351733[_0x9d48('0x3a')]!==_0x9d48('0x3b')){var _0x1a2dc1={};_0x1a2dc1[_0x351733['name']]={'$like':'%'+_0x3b7376[_0x9d48('0x2d')][_0x9d48('0x37')]+'%'};return _0x1a2dc1;}})});}_0x1a8194=_[_0x9d48('0x39')]({},_0x1a8194,_0x3b7376['options']);var _0x24e803={'where':_0x1a8194[_0x9d48('0x38')]};return db[_0x9d48('0x28')][_0x9d48('0x1d')](_0x24e803)[_0x9d48('0x23')](function(_0x2f98cc){_0x153871[_0x9d48('0x1d')]=_0x2f98cc;if(_0x3b7376['query']['includeAll']){_0x1a8194[_0x9d48('0x3c')]=[{'all':!![]}];}return db[_0x9d48('0x28')]['findAll'](_0x1a8194);})['then'](function(_0x495a77){_0x153871[_0x9d48('0x3d')]=_0x495a77;return _0x153871;})[_0x9d48('0x23')](respondWithFilteredResult(_0x5b3c6b,_0x1a8194))[_0x9d48('0x3e')](handleError(_0x5b3c6b,null));};exports[_0x9d48('0x3f')]=function(_0x321248,_0x2705ee){var _0x3242e7={'raw':!![],'where':{'id':_0x321248[_0x9d48('0x40')]['id']}},_0x8717ab={};_0x8717ab[_0x9d48('0x2c')]=_['keys'](db[_0x9d48('0x28')][_0x9d48('0x29')]);_0x8717ab[_0x9d48('0x2d')]=_[_0x9d48('0x2e')](_0x321248['query']);_0x8717ab[_0x9d48('0x2f')]=_[_0x9d48('0x30')](_0x8717ab[_0x9d48('0x2c')],_0x8717ab[_0x9d48('0x2d')]);_0x3242e7[_0x9d48('0x31')]=_[_0x9d48('0x30')](_0x8717ab[_0x9d48('0x2c')],qs[_0x9d48('0x32')](_0x321248[_0x9d48('0x2d')][_0x9d48('0x32')]));_0x3242e7['attributes']=_0x3242e7['attributes']['length']?_0x3242e7['attributes']:_0x8717ab[_0x9d48('0x2c')];if(_0x321248[_0x9d48('0x2d')][_0x9d48('0x41')]){_0x3242e7[_0x9d48('0x3c')]=[{'all':!![]}];}_0x3242e7=_[_0x9d48('0x39')]({},_0x3242e7,_0x321248['options']);return db['OpenchannelApplication'][_0x9d48('0x42')](_0x3242e7)[_0x9d48('0x23')](handleEntityNotFound(_0x2705ee,null))[_0x9d48('0x23')](respondWithResult(_0x2705ee,null))[_0x9d48('0x3e')](handleError(_0x2705ee,null));};exports[_0x9d48('0x43')]=function(_0x274575,_0x45139b){return db['OpenchannelApplication'][_0x9d48('0x43')](_0x274575['body'],{})[_0x9d48('0x23')](respondWithResult(_0x45139b,0xc9))['catch'](handleError(_0x45139b,null));};exports[_0x9d48('0x22')]=function(_0x5f90c3,_0x224a18){if(_0x5f90c3[_0x9d48('0x44')]['id']){delete _0x5f90c3[_0x9d48('0x44')]['id'];}return db[_0x9d48('0x28')]['find']({'where':{'id':_0x5f90c3[_0x9d48('0x40')]['id']}})[_0x9d48('0x23')](handleEntityNotFound(_0x224a18,null))[_0x9d48('0x23')](saveUpdates(_0x5f90c3['body'],null))[_0x9d48('0x23')](respondWithResult(_0x224a18,null))['catch'](handleError(_0x224a18,null));};exports['destroy']=function(_0x48994c,_0x4808bd){return db[_0x9d48('0x28')][_0x9d48('0x42')]({'where':{'id':_0x48994c['params']['id']}})[_0x9d48('0x23')](handleEntityNotFound(_0x4808bd,null))[_0x9d48('0x23')](removeEntity(_0x4808bd,null))['catch'](handleError(_0x4808bd,null));};
\ No newline at end of file
index 9b463ff..1e6dbff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9a8=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','../../config/environment','OpenchannelApplication'];(function(_0x2f8487,_0x3a6365){var _0x1d9bcc=function(_0x272bdb){while(--_0x272bdb){_0x2f8487['push'](_0x2f8487['shift']());}};_0x1d9bcc(++_0x3a6365);}(_0xf9a8,0x172));var _0x8f9a=function(_0x45f82e,_0x487acb){_0x45f82e=_0x45f82e-0x0;var _0x43474e=_0xf9a8[_0x45f82e];return _0x43474e;};'use strict';var _=require(_0x8f9a('0x0'));var util=require(_0x8f9a('0x1'));var logger=require('../../config/logger')(_0x8f9a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8f9a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8f9a('0x4'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x5ab5cf,_0x4860cc){return _0x5ab5cf['define'](_0x8f9a('0x5'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8f9a('0x6'),'collate':_0x8f9a('0x7')});};
\ No newline at end of file
+var _0x553f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x45c191,_0x37cba2){var _0x2e2dee=function(_0x5bee97){while(--_0x5bee97){_0x45c191['push'](_0x45c191['shift']());}};_0x2e2dee(++_0x37cba2);}(_0x553f,0x16c));var _0xf553=function(_0x1005e5,_0x3672ae){_0x1005e5=_0x1005e5-0x0;var _0x1c9e25=_0x553f[_0x1005e5];return _0x1c9e25;};'use strict';var _=require('lodash');var util=require(_0xf553('0x0'));var logger=require(_0xf553('0x1'))(_0xf553('0x2'));var moment=require(_0xf553('0x3'));var BPromise=require(_0xf553('0x4'));var rp=require(_0xf553('0x5'));var fs=require('fs');var path=require(_0xf553('0x6'));var rimraf=require(_0xf553('0x7'));var config=require('../../config/environment');var attributes=require(_0xf553('0x8'));module[_0xf553('0x9')]=function(_0x218c67,_0x5d42fa){return _0x218c67[_0xf553('0xa')](_0xf553('0xb'),attributes,{'tableName':_0xf553('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf553('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index d0629b8..b3f696f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x816a=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x269c1a,_0x1e4741){var _0x1d9ba3=function(_0x38e00b){while(--_0x38e00b){_0x269c1a['push'](_0x269c1a['shift']());}};_0x1d9ba3(++_0x1e4741);}(_0x816a,0x80));var _0xa816=function(_0x281428,_0x5e1790){_0x281428=_0x281428-0x0;var _0x65a8f7=_0x816a[_0x281428];return _0x65a8f7;};'use strict';var _=require(_0xa816('0x0'));var util=require(_0xa816('0x1'));var moment=require(_0xa816('0x2'));var BPromise=require(_0xa816('0x3'));var rs=require(_0xa816('0x4'));var fs=require('fs');var Redis=require(_0xa816('0x5'));var db=require(_0xa816('0x6'))['db'];var utils=require(_0xa816('0x7'));var logger=require(_0xa816('0x8'))(_0xa816('0x9'));var config=require(_0xa816('0xa'));var jayson=require(_0xa816('0xb'));var client=jayson['client'][_0xa816('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x19d531,_0x55c0ad,_0x5eaf8f){return new BPromise(function(_0xa9731a,_0x41122c){return client['request'](_0x19d531,_0x5eaf8f)[_0xa816('0xd')](function(_0x25f3c4){logger['info'](_0xa816('0xe'),_0x55c0ad,_0xa816('0xf'));logger[_0xa816('0x10')](_0xa816('0x11'),_0x55c0ad,'request\x20sent',JSON[_0xa816('0x12')](_0x25f3c4));if(_0x25f3c4[_0xa816('0x13')]){if(_0x25f3c4[_0xa816('0x13')][_0xa816('0x14')]===0x1f4){logger[_0xa816('0x13')](_0xa816('0xe'),_0x55c0ad,_0x25f3c4[_0xa816('0x13')][_0xa816('0x15')]);return _0x41122c(_0x25f3c4[_0xa816('0x13')][_0xa816('0x15')]);}logger['error'](_0xa816('0xe'),_0x55c0ad,_0x25f3c4[_0xa816('0x13')][_0xa816('0x15')]);return _0xa9731a(_0x25f3c4[_0xa816('0x13')][_0xa816('0x15')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x55c0ad,_0xa816('0xf'));_0xa9731a(_0x25f3c4[_0xa816('0x16')][_0xa816('0x15')]);}})[_0xa816('0x17')](function(_0x43e5c3){logger[_0xa816('0x13')](_0xa816('0xe'),_0x55c0ad,_0x43e5c3);_0x41122c(_0x43e5c3);});});}exports[_0xa816('0x18')]=function(_0x6c240c){var _0x41f890=this;return new Promise(function(_0xfca74,_0x3ced09){return db[_0xa816('0x19')][_0xa816('0x1a')](_0x6c240c[_0xa816('0x1b')],{'raw':_0x6c240c[_0xa816('0x1c')]?_0x6c240c['options'][_0xa816('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6c240c[_0xa816('0x1c')]?_0x6c240c[_0xa816('0x1c')][_0xa816('0x1e')]||null:null,'attributes':_0x6c240c[_0xa816('0x1c')]?_0x6c240c[_0xa816('0x1c')][_0xa816('0x1f')]||null:null,'limit':_0x6c240c[_0xa816('0x1c')]?_0x6c240c[_0xa816('0x1c')][_0xa816('0x20')]||null:null})[_0xa816('0xd')](function(_0x114e73){logger[_0xa816('0x21')](_0xa816('0x18'),_0x6c240c);logger[_0xa816('0x10')]('UpdateOpenchannelApplication',_0x6c240c,JSON[_0xa816('0x12')](_0x114e73));_0xfca74(_0x114e73);})[_0xa816('0x17')](function(_0x4b8d79){logger['error'](_0xa816('0x18'),_0x4b8d79['message'],_0x6c240c);_0x3ced09(_0x41f890[_0xa816('0x13')](0x1f4,_0x4b8d79[_0xa816('0x15')]));});});};
\ No newline at end of file
+var _0x9cf1=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','where','attributes'];(function(_0x451f9a,_0x22042f){var _0x562fd9=function(_0x480a3a){while(--_0x480a3a){_0x451f9a['push'](_0x451f9a['shift']());}};_0x562fd9(++_0x22042f);}(_0x9cf1,0x144));var _0x19cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9cf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x19cf('0x0'));var BPromise=require(_0x19cf('0x1'));var rs=require(_0x19cf('0x2'));var fs=require('fs');var Redis=require(_0x19cf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x19cf('0x4'));var logger=require(_0x19cf('0x5'))(_0x19cf('0x6'));var config=require(_0x19cf('0x7'));var jayson=require(_0x19cf('0x8'));var client=jayson[_0x19cf('0x9')][_0x19cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x552e78,_0x27419c,_0x25987d){return new BPromise(function(_0x57378e,_0x567510){return client['request'](_0x552e78,_0x25987d)[_0x19cf('0xb')](function(_0x2a16af){logger[_0x19cf('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x27419c,_0x19cf('0xd'));logger['debug'](_0x19cf('0xe'),_0x27419c,_0x19cf('0xd'),JSON[_0x19cf('0xf')](_0x2a16af));if(_0x2a16af[_0x19cf('0x10')]){if(_0x2a16af[_0x19cf('0x10')]['code']===0x1f4){logger[_0x19cf('0x10')](_0x19cf('0x11'),_0x27419c,_0x2a16af[_0x19cf('0x10')]['message']);return _0x567510(_0x2a16af[_0x19cf('0x10')][_0x19cf('0x12')]);}logger[_0x19cf('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x27419c,_0x2a16af[_0x19cf('0x10')]['message']);return _0x57378e(_0x2a16af[_0x19cf('0x10')][_0x19cf('0x12')]);}else{logger[_0x19cf('0xc')](_0x19cf('0x11'),_0x27419c,_0x19cf('0xd'));_0x57378e(_0x2a16af[_0x19cf('0x13')][_0x19cf('0x12')]);}})[_0x19cf('0x14')](function(_0x212bf6){logger[_0x19cf('0x10')](_0x19cf('0x11'),_0x27419c,_0x212bf6);_0x567510(_0x212bf6);});});}exports[_0x19cf('0x15')]=function(_0x232e8d){var _0x22b8c1=this;return new Promise(function(_0x53cf3f,_0x37867a){return db[_0x19cf('0x16')][_0x19cf('0x17')](_0x232e8d['body'],{'raw':_0x232e8d['options']?_0x232e8d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x232e8d[_0x19cf('0x18')]?_0x232e8d[_0x19cf('0x18')][_0x19cf('0x19')]||null:null,'attributes':_0x232e8d[_0x19cf('0x18')]?_0x232e8d[_0x19cf('0x18')][_0x19cf('0x1a')]||null:null,'limit':_0x232e8d[_0x19cf('0x18')]?_0x232e8d[_0x19cf('0x18')]['limit']||null:null})['then'](function(_0x2d08f4){logger['info'](_0x19cf('0x15'),_0x232e8d);logger['debug']('UpdateOpenchannelApplication',_0x232e8d,JSON[_0x19cf('0xf')](_0x2d08f4));_0x53cf3f(_0x2d08f4);})[_0x19cf('0x14')](function(_0x1a2816){logger[_0x19cf('0x10')](_0x19cf('0x15'),_0x1a2816[_0x19cf('0x12')],_0x232e8d);_0x37867a(_0x22b8c1['error'](0x1f4,_0x1a2816[_0x19cf('0x12')]));});});};
\ No newline at end of file
index 064b40e..8fffbd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcff=['describe','/:id','show','getMessages','/:id/download','download','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','destroy','delete','removeTags','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdcff,0x145));var _0xfdcf=function(_0x384a05,_0x111a38){_0x384a05=_0x384a05-0x0;var _0x240be9=_0xdcff[_0x384a05];return _0x240be9;};'use strict';var multer=require(_0xfdcf('0x0'));var util=require(_0xfdcf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdcf('0x2'));var router=express[_0xfdcf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfdcf('0x4'));var interaction=require(_0xfdcf('0x5'));var config=require(_0xfdcf('0x6'));var controller=require(_0xfdcf('0x7'));router['get']('/',auth[_0xfdcf('0x8')](),controller[_0xfdcf('0x9')]);router[_0xfdcf('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xfdcf('0xb')]);router[_0xfdcf('0xa')](_0xfdcf('0xc'),auth[_0xfdcf('0x8')](),controller[_0xfdcf('0xd')]);router[_0xfdcf('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xfdcf('0xe')]);router[_0xfdcf('0xa')](_0xfdcf('0xf'),auth['isAuthenticated'](),controller[_0xfdcf('0x10')]);router[_0xfdcf('0x11')]('/',auth[_0xfdcf('0x8')](),controller['create']);router['post']('/:id/messages',auth[_0xfdcf('0x8')](),controller['addMessage']);router[_0xfdcf('0x11')](_0xfdcf('0x12'),auth[_0xfdcf('0x8')](),interaction[_0xfdcf('0x13')](_0xfdcf('0x14'),_0xfdcf('0x15')),controller[_0xfdcf('0x16')]);router[_0xfdcf('0x17')]('/:id',auth[_0xfdcf('0x8')](),interaction[_0xfdcf('0x13')](_0xfdcf('0x14'),_0xfdcf('0x18')),controller['update']);router['delete'](_0xfdcf('0xc'),auth[_0xfdcf('0x8')](),interaction[_0xfdcf('0x13')]('openchannel','openchannelinteraction:destroy'),controller[_0xfdcf('0x19')]);router[_0xfdcf('0x1a')]('/:id/tags',auth[_0xfdcf('0x8')](),controller[_0xfdcf('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0xd918=['openchannel','addTags','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage','/:id/tags','tracked'];(function(_0x3ae048,_0x228235){var _0x42e5cf=function(_0x5c9e47){while(--_0x5c9e47){_0x3ae048['push'](_0x3ae048['shift']());}};_0x42e5cf(++_0x228235);}(_0xd918,0x1f3));var _0x8d91=function(_0x18000d,_0x468002){_0x18000d=_0x18000d-0x0;var _0xd06ac0=_0xd918[_0x18000d];return _0xd06ac0;};'use strict';var multer=require(_0x8d91('0x0'));var util=require(_0x8d91('0x1'));var path=require('path');var timeout=require(_0x8d91('0x2'));var express=require(_0x8d91('0x3'));var router=express[_0x8d91('0x4')]();var fs_extra=require(_0x8d91('0x5'));var auth=require(_0x8d91('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8d91('0x7'));router[_0x8d91('0x8')]('/',auth[_0x8d91('0x9')](),controller[_0x8d91('0xa')]);router['get'](_0x8d91('0xb'),auth[_0x8d91('0x9')](),controller[_0x8d91('0xc')]);router[_0x8d91('0x8')](_0x8d91('0xd'),auth[_0x8d91('0x9')](),controller[_0x8d91('0xe')]);router[_0x8d91('0x8')](_0x8d91('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x8d91('0x10'),auth['isAuthenticated'](),controller[_0x8d91('0x11')]);router['post']('/',auth[_0x8d91('0x9')](),controller[_0x8d91('0x12')]);router[_0x8d91('0x13')](_0x8d91('0xf'),auth[_0x8d91('0x9')](),controller[_0x8d91('0x14')]);router[_0x8d91('0x13')](_0x8d91('0x15'),auth[_0x8d91('0x9')](),interaction[_0x8d91('0x16')](_0x8d91('0x17'),'openchannelinteraction:addtags'),controller[_0x8d91('0x18')]);router['put']('/:id',auth[_0x8d91('0x9')](),interaction[_0x8d91('0x16')](_0x8d91('0x17'),'openchannelinteraction:update'),controller['update']);router[_0x8d91('0x19')](_0x8d91('0xd'),auth[_0x8d91('0x9')](),interaction[_0x8d91('0x16')](_0x8d91('0x17'),_0x8d91('0x1a')),controller['destroy']);router[_0x8d91('0x19')](_0x8d91('0x15'),auth[_0x8d91('0x9')](),controller[_0x8d91('0x1b')]);module[_0x8d91('0x1c')]=router;
\ No newline at end of file
index 00632af..9901f9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf883=['STRING','ENUM','out','sequelize','exports','DATE'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf883,0x177));var _0x3f88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf883[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3f88('0x0'));module[_0x3f88('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3f88('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3f88('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3f88('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3f88('0x2')]},'threadId':{'type':Sequelize[_0x3f88('0x3')]},'externalUrl':{'type':Sequelize[_0x3f88('0x3')]},'lastMsgAt':{'type':Sequelize[_0x3f88('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3f88('0x4')]('in',_0x3f88('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3f88('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xb258=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb258,0x12b));var _0x8b25=function(_0x5ba736,_0x37dc9f){_0x5ba736=_0x5ba736-0x0;var _0x4f9d0a=_0xb258[_0x5ba736];return _0x4f9d0a;};'use strict';var Sequelize=require(_0x8b25('0x0'));module['exports']={'closed':{'type':Sequelize[_0x8b25('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8b25('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8b25('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8b25('0x3')]},'note':{'type':Sequelize[_0x8b25('0x3')]},'read1stAt':{'type':Sequelize[_0x8b25('0x2')]},'threadId':{'type':Sequelize[_0x8b25('0x3')]},'externalUrl':{'type':Sequelize[_0x8b25('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8b25('0x4')]('in',_0x8b25('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x8b25('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x8b25('0x1')],'defaultValue':![]}};
\ No newline at end of file
index 9d2614a..9b5b342 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc183=['then','destroy','sendStatus','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','OpenchannelInteraction','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','agent','i.OpenchannelAccountId\x20IS\x20NULL','user','role','sequelize','toString','count','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','show','params','rawAttributes','includeAll','create','body','update','addMessage','ids','getMessages','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','options','OpenchannelMessage','include','findAll','rows','addTags','setTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','attachments','Attachment','direction','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','disposition','threadId','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','lastName','out','secret','renderFile','downloadInteraction.ejs','.pdf','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','offset','undefined','limit','set','Content-Range','json','reject','save'];(function(_0x32dfbe,_0xa375c8){var _0x5406bc=function(_0x2e19c7){while(--_0x2e19c7){_0x32dfbe['push'](_0x32dfbe['shift']());}};_0x5406bc(++_0xa375c8);}(_0xc183,0xcd));var _0x3c18=function(_0x46ed5e,_0x26cb2a){_0x46ed5e=_0x46ed5e-0x0;var _0x50a299=_0xc183[_0x46ed5e];return _0x50a299;};'use strict';var emlformat=require(_0x3c18('0x0'));var rimraf=require(_0x3c18('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c18('0x2'));var rp=require('request-promise');var moment=require(_0x3c18('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3c18('0x4'));var util=require(_0x3c18('0x5'));var path=require('path');var sox=require(_0x3c18('0x6'));var csv=require(_0x3c18('0x7'));var ejs=require(_0x3c18('0x8'));var fs=require('fs');var fs_extra=require(_0x3c18('0x9'));var _=require(_0x3c18('0xa'));var squel=require(_0x3c18('0xb'));var crypto=require('crypto');var jsforce=require(_0x3c18('0xc'));var deskjs=require(_0x3c18('0xd'));var toCsv=require(_0x3c18('0x7'));var querystring=require('querystring');var Papa=require(_0x3c18('0xe'));var Redis=require('ioredis');var authService=require(_0x3c18('0xf'));var qs=require(_0x3c18('0x10'));var as=require(_0x3c18('0x11'));var pdf=require(_0x3c18('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c18('0x13'))(_0x3c18('0x14'));var utils=require(_0x3c18('0x15'));var config=require(_0x3c18('0x16'));var licenseUtil=require(_0x3c18('0x17'));var db=require(_0x3c18('0x18'))['db'];config[_0x3c18('0x19')]=_['defaults'](config['redis'],{'host':_0x3c18('0x1a'),'port':0x18eb});var socket=require(_0x3c18('0x1b'))(new Redis(config[_0x3c18('0x19')]));require(_0x3c18('0x1c'))[_0x3c18('0x1d')](socket);function respondWithStatusCode(_0x3a2697,_0xe44c6d){_0xe44c6d=_0xe44c6d||0xcc;return function(_0x2e689e){if(_0x2e689e){return _0x3a2697['sendStatus'](_0xe44c6d);}return _0x3a2697[_0x3c18('0x1e')](_0xe44c6d)[_0x3c18('0x1f')]();};}function respondWithResult(_0x4c0ee3,_0x5b1587){_0x5b1587=_0x5b1587||0xc8;return function(_0x3b253e){if(_0x3b253e){return _0x4c0ee3['status'](_0x5b1587)['json'](_0x3b253e);}};}function respondWithFilteredResult(_0x1793d0,_0x49c224){return function(_0x5598ee){if(_0x5598ee){var _0x5661fe=typeof _0x49c224[_0x3c18('0x20')]===_0x3c18('0x21')&&typeof _0x49c224[_0x3c18('0x22')]==='undefined';var _0x3e990b=_0x5598ee['count'];var _0x2df01c=_0x5661fe?0x0:_0x49c224['offset'];var _0x4ad2d1=_0x5661fe?_0x5598ee['count']:_0x49c224[_0x3c18('0x20')]+_0x49c224[_0x3c18('0x22')];var _0x3e7f9e;if(_0x4ad2d1>=_0x3e990b){_0x4ad2d1=_0x3e990b;_0x3e7f9e=0xc8;}else{_0x3e7f9e=0xce;}_0x1793d0[_0x3c18('0x1e')](_0x3e7f9e);return _0x1793d0[_0x3c18('0x23')](_0x3c18('0x24'),_0x2df01c+'-'+_0x4ad2d1+'/'+_0x3e990b)[_0x3c18('0x25')](_0x5598ee);}return null;};}function patchUpdates(_0x53b524){return function(_0x1c87c5){try{jsonpatch['apply'](_0x1c87c5,_0x53b524,!![]);}catch(_0x258eec){return BPromise[_0x3c18('0x26')](_0x258eec);}return _0x1c87c5[_0x3c18('0x27')]();};}function saveUpdates(_0x35c5c0,_0x29d6af){return function(_0x648ac0){if(_0x648ac0){return _0x648ac0['update'](_0x35c5c0)[_0x3c18('0x28')](function(_0x528267){return _0x528267;});}return null;};}function removeEntity(_0x14883f,_0x3e326e){return function(_0x4629f0){if(_0x4629f0){return _0x4629f0[_0x3c18('0x29')]()[_0x3c18('0x28')](function(){_0x14883f[_0x3c18('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bde31,_0xb31cc5){return function(_0xa82fb2){if(!_0xa82fb2){_0x2bde31[_0x3c18('0x2a')](0x194);}return _0xa82fb2;};}function handleError(_0x479636,_0x20aafa){_0x20aafa=_0x20aafa||0x1f4;return function(_0x258eb1){logger[_0x3c18('0x2b')](_0x258eb1[_0x3c18('0x2c')]);if(_0x258eb1[_0x3c18('0x2d')]){delete _0x258eb1['name'];}_0x479636[_0x3c18('0x1e')](_0x20aafa)['send'](_0x258eb1);};}function getInteractionUsers(_0x2acbb6,_0x5e77e0){return new BPromise(function(_0x2699b3,_0x245ad9){try{if(_0x5e77e0[_0x2acbb6['id']]){_0x2acbb6[_0x3c18('0x2e')]=_[_0x3c18('0x2f')](_0x5e77e0[_0x2acbb6['id']],function(_0x11f6ed){return{'id':_0x11f6ed['id'],'fullname':_0x11f6ed[_0x3c18('0x30')]};});}}catch(_0x29da4e){_0x245ad9(_0x29da4e);}_0x2699b3(_0x2acbb6);});}function getInteractionTags(_0x35a07a,_0x3cf896){return new BPromise(function(_0x4236a1,_0x2c47b0){try{if(_0x35a07a[_0x3c18('0x31')]){_0x35a07a[_0x3c18('0x32')]=[];_0x35a07a[_0x3c18('0x31')][_0x3c18('0x33')](',')[_0x3c18('0x34')](function(_0x2ec17b){_0x35a07a['Tags'][_0x3c18('0x35')](_0x3cf896[_0x2ec17b]);});}delete _0x35a07a[_0x3c18('0x31')];}catch(_0xa0d304){_0x2c47b0(_0xa0d304);}_0x4236a1(_0x35a07a);});}function updateOpenchannelInteraction(_0xf9060b,_0x3b8caa,_0x3fa516){return new BPromise(function(_0x2205cf,_0x4a1758){return getInteractionUsers(_0xf9060b,_0x3fa516)[_0x3c18('0x28')](function(_0x491b6b){return getInteractionTags(_0x491b6b,_0x3b8caa);})[_0x3c18('0x28')](function(_0x3da9d0){return getStateInteraction(_0x3da9d0);})[_0x3c18('0x28')](function(_0x1f3ce8){_0x2205cf(_0x1f3ce8);})[_0x3c18('0x36')](function(_0x3ccbd3){_0x4a1758(_0x3ccbd3);});});}function getStateInteraction(_0x46adb3){return new BPromise(function(_0x2eab3a){_0x46adb3[_0x3c18('0x37')]=0x0;_0x46adb3[_0x3c18('0x38')]=0x0;_0x46adb3[_0x3c18('0x39')]=0x0;_0x46adb3[_0x3c18('0x3a')]=0x0;_0x46adb3[_0x3c18('0x3b')]=0x0;if(!_0x46adb3[_0x3c18('0x3c')]&&!_0x46adb3['UserId']){_0x46adb3[_0x3c18('0x37')]+=0x1;}if(!_0x46adb3['closed']&&_0x46adb3[_0x3c18('0x3d')]){_0x46adb3[_0x3c18('0x38')]+=0x1;if(_0x46adb3[_0x3c18('0x37')]){_0x46adb3['waiting']-=0x1;}}if(_0x46adb3['closed']&&_0x46adb3[_0x3c18('0x3d')]){_0x46adb3[_0x3c18('0x39')]+=0x1;if(_0x46adb3[_0x3c18('0x38')]){_0x46adb3[_0x3c18('0x38')]-=0x1;}}if(_0x46adb3[_0x3c18('0x3c')]&&!_0x46adb3['UserId']){_0x46adb3[_0x3c18('0x3a')]+=0x1;if(_0x46adb3[_0x3c18('0x37')]){_0x46adb3['waiting']-=0x1;}}_0x46adb3[_0x3c18('0x3b')]+=0x1;_0x2eab3a(_0x46adb3);});}exports[_0x3c18('0x3e')]=function(_0x4185a8,_0x3432b6){var _0x22feb7={},_0x5ecb8b={},_0x311aee={'count':0x0,'rows':[]};var _0x3d3537=_[_0x3c18('0x2f')](db[_0x3c18('0x3f')]['rawAttributes'],function(_0x290b09){return{'name':_0x290b09[_0x3c18('0x40')],'type':_0x290b09[_0x3c18('0x41')][_0x3c18('0x42')]};});_0x5ecb8b[_0x3c18('0x43')]=_['map'](_0x3d3537,_0x3c18('0x2d'));_0x5ecb8b[_0x3c18('0x44')]=_[_0x3c18('0x45')](_0x4185a8[_0x3c18('0x44')]);_0x5ecb8b[_0x3c18('0x46')]=_[_0x3c18('0x47')](_0x5ecb8b[_0x3c18('0x43')],_0x5ecb8b[_0x3c18('0x44')]);_0x22feb7['attributes']=_[_0x3c18('0x47')](_0x5ecb8b[_0x3c18('0x43')],qs[_0x3c18('0x48')](_0x4185a8[_0x3c18('0x44')]['fields']));_0x22feb7[_0x3c18('0x49')]=_0x22feb7[_0x3c18('0x49')][_0x3c18('0x4a')]?_0x22feb7[_0x3c18('0x49')]:_0x5ecb8b['model'];if(!_0x4185a8['query']['hasOwnProperty'](_0x3c18('0x4b'))){_0x22feb7[_0x3c18('0x22')]=qs[_0x3c18('0x22')](_0x4185a8['query'][_0x3c18('0x22')]);_0x22feb7[_0x3c18('0x20')]=qs[_0x3c18('0x20')](_0x4185a8[_0x3c18('0x44')][_0x3c18('0x20')]);}_0x22feb7['order']=qs[_0x3c18('0x4c')](_0x4185a8['query'][_0x3c18('0x4c')]);_0x22feb7[_0x3c18('0x4d')]=qs[_0x3c18('0x46')](_[_0x3c18('0x4e')](_0x4185a8[_0x3c18('0x44')],_0x5ecb8b[_0x3c18('0x46')]),_0x3d3537);var _0x536a47=[];var _0x2eef3b=squel['select']()[_0x3c18('0x4f')]('id')['field'](_0x3c18('0x2d'))[_0x3c18('0x4f')](_0x3c18('0x50'))[_0x3c18('0x51')](_0x3c18('0x52'));var _0x2b32ce=squel[_0x3c18('0x53')]()['field'](_0x3c18('0x54'))[_0x3c18('0x4f')](_0x3c18('0x55'))[_0x3c18('0x4f')](_0x3c18('0x56'))['from'](_0x3c18('0x57'),'ui')['left_join'](_0x3c18('0x58'),'u','u.id\x20=\x20ui.UserId');var _0xa23eb9=squel['select']()['from']('openchannel_interactions','i')['left_join'](_0x3c18('0x59'),'c',_0x3c18('0x5a'))['left_join'](_0x3c18('0x58'),'o','o.id\x20=\x20i.UserId')[_0x3c18('0x5b')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0x3c18('0x5c'),'me',_0x3c18('0x5d'))[_0x3c18('0x5b')](_0x3c18('0x5e'),'it',_0x3c18('0x5f'))[_0x3c18('0x5b')]('tools_tags','t',_0x3c18('0x60'));var _0x392ae3=squel[_0x3c18('0x61')]();var _0x191459=[];var _0x53cbf5=squel[_0x3c18('0x61')]();var _0x451e23;if(_0x4185a8[_0x3c18('0x44')][_0x3c18('0x62')]){_0x451e23=as[_0x3c18('0x63')](_0x4185a8[_0x3c18('0x44')][_0x3c18('0x62')]);var _0xfa6317=_0x451e23[_0x3c18('0x64')];for(var _0x435b59=0x0;_0x435b59<_0x451e23[_0x3c18('0x65')][_0x3c18('0x4a')];_0x435b59++){var _0x115211=_0x451e23['conditions'][_0x435b59];var _0x3fb9b9='i';var _0x42f485=_[_0x3c18('0x66')](_0x3d3537,[_0x3c18('0x2d'),_0x115211[_0x3c18('0x4f')]]);if(!_0x42f485){switch(_0x115211[_0x3c18('0x4f')]){case _0x3c18('0x67'):if(_0x115211[_0x3c18('0x68')]==0x1){_0xa23eb9[_0x3c18('0x69')]('`'+_0x115211['field']+_0x3c18('0x6a'));}else{_0xa23eb9[_0x3c18('0x69')]('`'+_0x115211['field']+_0x3c18('0x6b'));}break;case _0x3c18('0x6c'):if(_0x115211['operator']==='$substring'){if(_0x115211[_0x3c18('0x68')][_0x3c18('0x33')]('\x20')[_0x3c18('0x4a')]>0x1){_0x392ae3[_0xfa6317](_0x3c18('0x6d'),qs[_0x3c18('0x6e')](_0x115211[_0x3c18('0x68')]),null);}else{var _0x2e8ddf='%'+_0x115211[_0x3c18('0x68')]+'%';_0x392ae3[_0xfa6317](_0x3c18('0x6f'),_0x2e8ddf,_0x2e8ddf,_0x2e8ddf);}}else{_0x42f485=_[_0x3c18('0x66')](_0x3d3537,[_0x3c18('0x2d'),_0x3c18('0x70')]);_0x115211[_0x3c18('0x4f')]=_0x3c18('0x70');_0x2f882e=as[_0x3c18('0x71')](_0x3fb9b9,_0x42f485[_0x3c18('0x41')],_0x115211);_0x392ae3[_0xfa6317](_0x2f882e[_0x3c18('0x72')],_0x2f882e[_0x3c18('0x68')][_0x3c18('0x73')],_0x2f882e[_0x3c18('0x68')]['end']);}break;case _0x3c18('0x74'):var _0x2671ae=_0x115211['value'][_0x3c18('0x33')](',')['map'](function(_0x575dd6){return Number(_0x575dd6);});_0x2671ae[_0x3c18('0x34')](function(_0xd9cc86){_0x53cbf5['or'](_0x3c18('0x75'),'%,'+_0xd9cc86+',%');});_0x191459=_['union'](_0x191459,_0x2671ae);break;case _0x3c18('0x76'):if(_0x115211['operator']===_0x3c18('0x77')){_0x392ae3[_0xfa6317]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x115211[_0x3c18('0x68')]+'%',null);}else{_0x42f485=_['find'](_0x3d3537,[_0x3c18('0x2d'),_0x3c18('0x3d')]);_0x115211[_0x3c18('0x4f')]=_0x3c18('0x3d');_0x2f882e=as[_0x3c18('0x71')](_0x3fb9b9,_0x42f485[_0x3c18('0x41')],_0x115211);_0x392ae3[_0xfa6317](_0x2f882e['text'],_0x2f882e[_0x3c18('0x68')]['start'],_0x2f882e[_0x3c18('0x68')][_0x3c18('0x1f')]);}break;case'body':_0x2f882e=as[_0x3c18('0x71')]('me',null,_0x115211);_0x392ae3[_0xfa6317](_0x2f882e[_0x3c18('0x72')],_0x2f882e[_0x3c18('0x68')][_0x3c18('0x73')],_0x2f882e['value']['end']);break;}}else{var _0x2f882e=as[_0x3c18('0x71')](_0x3fb9b9,_0x42f485[_0x3c18('0x41')],_0x115211);_0x392ae3[_0xfa6317](_0x2f882e[_0x3c18('0x72')],_0x2f882e[_0x3c18('0x68')][_0x3c18('0x73')],_0x2f882e[_0x3c18('0x68')][_0x3c18('0x1f')]);}}}else{var _0x5c9438=_(_0x4185a8[_0x3c18('0x44')])[_0x3c18('0x45')]()[_0x3c18('0x2f')](function(_0x5e9add){return _['some'](_0x3d3537,[_0x3c18('0x2d'),_0x5e9add])?_0x5e9add:undefined;})[_0x3c18('0x78')]()[_0x3c18('0x68')]();if(!_['isEmpty'](_0x5c9438)){_0x5c9438[_0x3c18('0x34')](function(_0x3def94){if(_0x3def94===_0x3c18('0x79')){_0xa23eb9['where'](_0x3c18('0x7a'),[]['concat'](_0x4185a8[_0x3c18('0x44')][_0x3def94]));}else if(_0x3def94===_0x3c18('0x7b')){var _0x58bd1f=JSON[_0x3c18('0x7c')](_0x4185a8['query'][_0x3def94])[_0x3c18('0x7d')];var _0x465837=JSON[_0x3c18('0x7c')](_0x4185a8['query'][_0x3def94])[_0x3c18('0x7e')];_0xa23eb9[_0x3c18('0x4d')](_0x3c18('0x7f'),_0x58bd1f,_0x465837);}else{if(_0x4185a8[_0x3c18('0x44')][_0x3def94]===_0x3c18('0x80')){_0xa23eb9[_0x3c18('0x4d')]('i.'+_0x3def94+_0x3c18('0x81'));}else{_0xa23eb9['where']('i.'+_0x3def94+_0x3c18('0x82'),_0x4185a8[_0x3c18('0x44')][_0x3def94]);}}});}if(_0x4185a8['query'][_0x3c18('0x83')]){if(_0x4185a8[_0x3c18('0x44')][_0x3c18('0x83')]==0x1){_0xa23eb9[_0x3c18('0x69')](_0x3c18('0x84'));}else{_0xa23eb9[_0x3c18('0x69')](_0x3c18('0x85'));}}if(_0x4185a8[_0x3c18('0x44')][_0x3c18('0x86')]){_0x191459=_[_0x3c18('0x87')](_0x4185a8[_0x3c18('0x44')]['tag'])?_0x4185a8[_0x3c18('0x44')]['tag']:new Array(_0x4185a8[_0x3c18('0x44')][_0x3c18('0x86')]);_0x191459[_0x3c18('0x34')](function(_0x3493c4){_0x53cbf5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3493c4+',%');});}if(_0x4185a8[_0x3c18('0x44')][_0x3c18('0x88')]){var _0x158ec5=_0x4185a8[_0x3c18('0x44')][_0x3c18('0x88')][_0x3c18('0x89')]('\x5c','\x5c\x5c')[_0x3c18('0x89')](/'/g,'\x27\x27');if(qs[_0x3c18('0x8a')](_0x158ec5)){_0x392ae3['or']('i.id\x20LIKE\x20?',_0x158ec5+'%');}else{_0x392ae3['or'](_0x3c18('0x8b'),qs[_0x3c18('0x6e')](_0x158ec5))['or'](_0x3c18('0x8c'),_0x158ec5+'%')['or'](_0x3c18('0x8d'),_0x158ec5+'%');}}}_0xa23eb9[_0x3c18('0x4d')](_0x392ae3);_0xa23eb9['group'](_0x3c18('0x8e'));var _0x2b9348={'type':db['Sequelize'][_0x3c18('0x8f')][_0x3c18('0x90')],'raw':!![]};var _0x444244=_0xa23eb9[_0x3c18('0x91')]();_0x444244[_0x3c18('0x4f')](_0x3c18('0x8e'));_0x444244[_0x3c18('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3c18('0x67'));if(_0x22feb7[_0x3c18('0x92')]){_0x22feb7[_0x3c18('0x92')]['forEach'](function(_0x1e23a6){var _0x151ca3=_0x1e23a6[0x0]===_0x3c18('0x93')?_0x1e23a6[0x0]:'i.'+_0x1e23a6[0x0];_0xa23eb9['order'](_0x151ca3,_0x1e23a6[0x1]===_0x3c18('0x94')?![]:!![]);});}if(!_[_0x3c18('0x95')](_0x191459)){_0xa23eb9['having'](_0x53cbf5);_0x444244[_0x3c18('0x4d')](_0x3c18('0x96'),_0x191459);}BPromise['resolve']()[_0x3c18('0x28')](function(){if(!_0x451e23){if(_0x4185a8[_0x3c18('0x44')][_0x3c18('0x79')])return;_0x444244[_0x3c18('0x4d')](_0x3c18('0x97'));_0xa23eb9[_0x3c18('0x4d')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4185a8['user']['role']!==_0x3c18('0x98'))return;return _0x4185a8['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0xae4842){if(_[_0x3c18('0x95')](_0xae4842)){_0x444244[_0x3c18('0x4d')](_0x3c18('0x99'));_0xa23eb9[_0x3c18('0x4d')](_0x3c18('0x99'));}else{_0x444244[_0x3c18('0x4d')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x3c18('0x2f')](_0xae4842,'id'));_0xa23eb9[_0x3c18('0x4d')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0xae4842,'id'));}});})[_0x3c18('0x28')](function(){if(_0x4185a8[_0x3c18('0x9a')][_0x3c18('0x9b')]===_0x3c18('0x98')&&!_0x451e23&&!_0x4185a8['query']['OpenchannelAccountId'])return[];return db[_0x3c18('0x9c')][_0x3c18('0x44')](_0x444244[_0x3c18('0x9d')](),_0x2b9348);})[_0x3c18('0x28')](function(_0x4b3421){_0x311aee[_0x3c18('0x9e')]=_0x4b3421[_0x3c18('0x4a')];if(_0x311aee[_0x3c18('0x9e')]===0x0)return[];return db[_0x3c18('0x9c')][_0x3c18('0x44')](_0x2eef3b['toString'](),_0x2b9348)[_0x3c18('0x28')](function(_0x228040){_0x536a47=_[_0x3c18('0x9f')](_0x228040,'id');_0x2b9348=_[_0x3c18('0xa0')](_0x2b9348,{'model':db[_0x3c18('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4185a8[_0x3c18('0x44')]['fields']){_0x22feb7['attributes'][_0x3c18('0x34')](function(_0x42f019){_0xa23eb9[_0x3c18('0x4f')]('i.'+_0x42f019);});}else{_0xa23eb9[_0x3c18('0x4f')](_0x3c18('0xa1'),_0x3c18('0x67'));_0xa23eb9[_0x3c18('0x4f')](_0x3c18('0xa2'),'Account.key');_0xa23eb9['field'](_0x3c18('0xa3'),'Account.mandatoryDisposition');_0xa23eb9[_0x3c18('0x4f')]('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',_0x3c18('0x93'));_0xa23eb9[_0x3c18('0x4f')](_0x3c18('0xa4'));_0xa23eb9[_0x3c18('0x4f')](_0x3c18('0xa5'),_0x3c18('0xa6'));_0xa23eb9[_0x3c18('0x4f')](_0x3c18('0xa7'),_0x3c18('0xa8'));_0xa23eb9[_0x3c18('0x4f')](_0x3c18('0xa9'),_0x3c18('0xaa'));_0xa23eb9[_0x3c18('0x4f')](_0x3c18('0xab'),_0x3c18('0xac'));_0xa23eb9[_0x3c18('0x4f')](_0x3c18('0xad'),_0x3c18('0xae'));_0xa23eb9['field'](_0x3c18('0xaf'),_0x3c18('0xb0'));_0xa23eb9[_0x3c18('0x4f')](_0x3c18('0xb1'),'Owner.fullname');_0xa23eb9[_0x3c18('0x4f')](_0x3c18('0xb2'),_0x3c18('0xb3'));_0xa23eb9['field'](_0x3c18('0xb4'),_0x3c18('0x31'));}if(_0x22feb7[_0x3c18('0x22')])_0xa23eb9[_0x3c18('0x22')](_0x22feb7[_0x3c18('0x22')]);if(_0x22feb7[_0x3c18('0x20')])_0xa23eb9[_0x3c18('0x20')](_0x22feb7[_0x3c18('0x20')]);return db[_0x3c18('0x9c')][_0x3c18('0x44')](_0xa23eb9[_0x3c18('0x9d')](),_0x2b9348);})[_0x3c18('0x28')](function(_0x5d736f){if(_0x5d736f[_0x3c18('0x4a')]>0x0)_0x2b32ce[_0x3c18('0x4d')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x3c18('0x2f')](_0x5d736f,'id'));return db[_0x3c18('0x9c')][_0x3c18('0x44')](_0x2b32ce[_0x3c18('0x9d')](),_0x2b9348)[_0x3c18('0x28')](function(_0x248fea){var _0x42cc3b=_[_0x3c18('0xb5')](_0x248fea,_0x3c18('0xb6'));var _0x3d9a5d=[];_0x5d736f[_0x3c18('0x34')](function(_0x44ebbd){_0x3d9a5d[_0x3c18('0x35')](updateOpenchannelInteraction(_0x44ebbd,_0x536a47,_0x42cc3b));});return BPromise['all'](_0x3d9a5d);});});})[_0x3c18('0x28')](function(_0x19ce99){_0x311aee['rows']=_0x19ce99;return _0x311aee;})[_0x3c18('0x28')](respondWithFilteredResult(_0x3432b6,_0x22feb7))[_0x3c18('0x36')](handleError(_0x3432b6,null));};exports[_0x3c18('0xb7')]=function(_0x59d501,_0xc618a7){var _0x1c324f={};if(_0x59d501[_0x3c18('0x44')][_0x3c18('0x41')]&&_0x59d501[_0x3c18('0x44')][_0x3c18('0x41')]===_0x3c18('0x51')){_0x1c324f[_0x3c18('0x51')]=_0x59d501['params']['id'];}else{_0x1c324f['id']=_0x59d501[_0x3c18('0xb8')]['id'];}var _0x2b5935={'raw':![],'where':_0x1c324f},_0x326544={};_0x326544[_0x3c18('0x43')]=_[_0x3c18('0x45')](db[_0x3c18('0x3f')][_0x3c18('0xb9')]);_0x326544[_0x3c18('0x44')]=_['keys'](_0x59d501['query']);_0x326544[_0x3c18('0x46')]=_[_0x3c18('0x47')](_0x326544[_0x3c18('0x43')],_0x326544[_0x3c18('0x44')]);_0x2b5935[_0x3c18('0x49')]=_[_0x3c18('0x47')](_0x326544[_0x3c18('0x43')],qs[_0x3c18('0x48')](_0x59d501[_0x3c18('0x44')]['fields']));_0x2b5935[_0x3c18('0x49')]=_0x2b5935[_0x3c18('0x49')][_0x3c18('0x4a')]?_0x2b5935['attributes']:_0x326544[_0x3c18('0x43')];if(_0x59d501[_0x3c18('0x44')][_0x3c18('0xba')]){_0x2b5935['include']=[{'all':!![]}];}_0x2b5935=_[_0x3c18('0xa0')]({},_0x2b5935,_0x59d501['options']);return db[_0x3c18('0x3f')][_0x3c18('0x66')](_0x2b5935)[_0x3c18('0x28')](handleEntityNotFound(_0xc618a7,null))['then'](respondWithResult(_0xc618a7,null))[_0x3c18('0x36')](handleError(_0xc618a7,null));};exports[_0x3c18('0xbb')]=function(_0x474a90,_0x38619d){return db[_0x3c18('0x3f')]['create'](_0x474a90[_0x3c18('0xbc')],{})[_0x3c18('0x28')](respondWithResult(_0x38619d,0xc9))['catch'](handleError(_0x38619d,null));};exports[_0x3c18('0xbd')]=function(_0x2c8ac6,_0x5f5b0){if(_0x2c8ac6[_0x3c18('0xbc')]['id']){delete _0x2c8ac6[_0x3c18('0xbc')]['id'];}return db[_0x3c18('0x3f')][_0x3c18('0x66')]({'where':{'id':_0x2c8ac6[_0x3c18('0xb8')]['id']}})[_0x3c18('0x28')](handleEntityNotFound(_0x5f5b0,null))[_0x3c18('0x28')](saveUpdates(_0x2c8ac6[_0x3c18('0xbc')],null))[_0x3c18('0x28')](respondWithResult(_0x5f5b0,null))[_0x3c18('0x36')](handleError(_0x5f5b0,null));};exports['destroy']=function(_0x33053a,_0x10d9d0){return db['OpenchannelInteraction']['find']({'where':{'id':_0x33053a['params']['id']}})[_0x3c18('0x28')](handleEntityNotFound(_0x10d9d0,null))[_0x3c18('0x28')](removeEntity(_0x10d9d0,null))[_0x3c18('0x36')](handleError(_0x10d9d0,null));};exports['describe']=function(_0x46d118,_0x276999){return db[_0x3c18('0x3f')]['describe']()[_0x3c18('0x28')](respondWithResult(_0x276999,null))[_0x3c18('0x36')](handleError(_0x276999,null));};exports[_0x3c18('0xbe')]=function(_0x4cd4ad,_0x4a85d2,_0x20d9b4){return db['OpenchannelMessage'][_0x3c18('0x66')]({'where':{'id':_0x4cd4ad['params']['id']}})['then'](handleEntityNotFound(_0x4a85d2,null))[_0x3c18('0x28')](function(_0x114f86){if(_0x114f86){return _0x114f86[_0x3c18('0xbe')](_0x4cd4ad[_0x3c18('0xbc')]['ids'],_['omit'](_0x4cd4ad['body'],[_0x3c18('0xbf'),'id'])||{});}})[_0x3c18('0x28')](respondWithResult(_0x4a85d2,null))['catch'](handleError(_0x4a85d2,null));};exports[_0x3c18('0xc0')]=function(_0x9ec217,_0x5ce904,_0x2c9a81){var _0x15456f={'raw':![],'where':{}};var _0x5df7f8={};var _0x430145={'count':0x0,'rows':[]};return db[_0x3c18('0x3f')][_0x3c18('0xc1')]({'where':{'id':_0x9ec217['params']['id']}})['then'](handleEntityNotFound(_0x5ce904,null))[_0x3c18('0x28')](function(_0x481b20){if(_0x481b20){_0x5df7f8[_0x3c18('0x43')]=_['keys'](db['OpenchannelMessage'][_0x3c18('0xb9')]);_0x5df7f8[_0x3c18('0x44')]=_[_0x3c18('0x45')](_0x9ec217[_0x3c18('0x44')]);_0x5df7f8[_0x3c18('0x46')]=_[_0x3c18('0x47')](_0x5df7f8[_0x3c18('0x43')],_0x5df7f8[_0x3c18('0x44')]);_0x15456f[_0x3c18('0x49')]=_[_0x3c18('0x47')](_0x5df7f8[_0x3c18('0x43')],qs[_0x3c18('0x48')](_0x9ec217[_0x3c18('0x44')][_0x3c18('0x48')]));_0x15456f[_0x3c18('0x49')]=_0x15456f[_0x3c18('0x49')][_0x3c18('0x4a')]?_0x15456f[_0x3c18('0x49')]:_0x5df7f8[_0x3c18('0x43')];if(!_0x9ec217['query'][_0x3c18('0xc2')](_0x3c18('0x4b'))){_0x15456f[_0x3c18('0x22')]=qs[_0x3c18('0x22')](_0x9ec217[_0x3c18('0x44')]['limit']);_0x15456f[_0x3c18('0x20')]=qs[_0x3c18('0x20')](_0x9ec217['query'][_0x3c18('0x20')]);}_0x15456f[_0x3c18('0x92')]=qs[_0x3c18('0x4c')](_0x9ec217[_0x3c18('0x44')][_0x3c18('0x4c')]);_0x15456f[_0x3c18('0x4d')]=qs[_0x3c18('0x46')](_[_0x3c18('0x4e')](_0x9ec217[_0x3c18('0x44')],_0x5df7f8[_0x3c18('0x46')]));_0x15456f[_0x3c18('0x4d')][_0x3c18('0xb6')]=_0x481b20['id'];if(_0x9ec217[_0x3c18('0x44')][_0x3c18('0x88')]){_0x15456f[_0x3c18('0x4d')]=_[_0x3c18('0xa0')](_0x15456f[_0x3c18('0x4d')],{'$or':_['map'](_0x15456f[_0x3c18('0x49')],function(_0x5eba9c){var _0x461720={};_0x461720[_0x5eba9c]={'$like':'%'+_0x9ec217[_0x3c18('0x44')][_0x3c18('0x88')]+'%'};return _0x461720;})});}if(_0x9ec217[_0x3c18('0x44')][_0x3c18('0x7d')]){var _0x123161=_0x9ec217[_0x3c18('0x44')][_0x3c18('0x7d')][_0x3c18('0x33')](',');var _0x105ee4={};_0x105ee4[_0x123161[0x0]]={'$gte':moment(_0x123161[0x1])[_0x3c18('0xc3')](_0x3c18('0xc4'))};_0x15456f[_0x3c18('0x4d')]=_[_0x3c18('0xa0')](_0x15456f[_0x3c18('0x4d')],_0x105ee4);}_0x15456f=_['merge']({},_0x15456f,_0x9ec217[_0x3c18('0xc5')]);return db[_0x3c18('0xc6')]['count']({'where':_0x15456f[_0x3c18('0x4d')]})[_0x3c18('0x28')](function(_0x11651c){_0x430145[_0x3c18('0x9e')]=_0x11651c;if(_0x9ec217[_0x3c18('0x44')]['includeAll']){_0x15456f[_0x3c18('0xc7')]=[{'all':!![]}];}return db[_0x3c18('0xc6')][_0x3c18('0xc8')](_0x15456f);})[_0x3c18('0x28')](function(_0x16c1c0){_0x430145[_0x3c18('0xc9')]=_0x16c1c0;return _0x430145;});}})[_0x3c18('0x28')](respondWithFilteredResult(_0x5ce904,_0x15456f))[_0x3c18('0x36')](handleError(_0x5ce904,null));};exports[_0x3c18('0xca')]=function(_0xa974c7,_0x503fce,_0x349803){return db['OpenchannelInteraction'][_0x3c18('0x66')]({'where':{'id':_0xa974c7[_0x3c18('0xb8')]['id']}})[_0x3c18('0x28')](handleEntityNotFound(_0x503fce,null))[_0x3c18('0x28')](function(_0x2f41a6){if(_0x2f41a6){return _0x2f41a6[_0x3c18('0xcb')](_0xa974c7[_0x3c18('0xbc')]['ids'],_[_0x3c18('0xcc')](_0xa974c7[_0x3c18('0xbc')],['ids','id'])||{})[_0x3c18('0xcd')](function(){return db[_0x3c18('0x74')][_0x3c18('0xc8')]({'attributes':['id',_0x3c18('0x2d'),_0x3c18('0x50')],'where':{'id':_0xa974c7[_0x3c18('0xbc')]['ids']}});})[_0x3c18('0x28')](function(_0x7c63e7){socket[_0x3c18('0xce')](_0x3c18('0xcf'),{'id':Number(_0xa974c7[_0x3c18('0xb8')]['id']),'tags':_0x7c63e7||[]});return{'id':Number(_0xa974c7[_0x3c18('0xb8')]['id']),'tags':_0x7c63e7||[]};});}})[_0x3c18('0x28')](respondWithResult(_0x503fce,null))['catch'](handleError(_0x503fce,null));};exports[_0x3c18('0xd0')]=function(_0x43458f,_0x34fe67,_0x201c59){return db[_0x3c18('0x3f')][_0x3c18('0x66')]({'where':{'id':_0x43458f['params']['id']}})[_0x3c18('0x28')](handleEntityNotFound(_0x34fe67,null))[_0x3c18('0x28')](function(_0x23ea2a){if(_0x23ea2a){return _0x23ea2a[_0x3c18('0xd0')](_0x43458f['query'][_0x3c18('0xbf')]);}})[_0x3c18('0x28')](respondWithStatusCode(_0x34fe67,null))[_0x3c18('0x36')](handleError(_0x34fe67,null));};exports['download']=function(_0x1208d1,_0x59f0ec){var _0x424f84=moment()[_0x3c18('0xd1')]()[_0x3c18('0x9d')]();var _0x29b15e=path[_0x3c18('0xd2')](config[_0x3c18('0xd3')],_0x3c18('0xd4'),_0x3c18('0xd5'),_0x3c18('0xd6'));var _0x1779b5=path[_0x3c18('0xd2')](config[_0x3c18('0xd3')],_0x3c18('0xd4'),_0x3c18('0xd5'),'attachments');var _0x3067e2=path[_0x3c18('0xd2')](_0x29b15e,_0x424f84);var _0x28d616=util[_0x3c18('0xc3')](_0x3c18('0xd7'),_0x1208d1[_0x3c18('0xb8')]['id'],_0x424f84);var _0x45a3b8=path[_0x3c18('0xd2')](_0x29b15e,_0x28d616);var _0x28a12f=[];_0x28a12f[_0x3c18('0x35')]({'model':db['User'],'as':_0x3c18('0x76'),'attributes':['id',_0x3c18('0x30')],'raw':!![]});_0x28a12f[_0x3c18('0x35')]({'model':db[_0x3c18('0xd8')],'as':_0x3c18('0x6c'),'attributes':['id',_0x3c18('0xd9'),'lastName'],'raw':!![]});if(_0x1208d1['query'][_0x3c18('0xda')]){_0x28a12f[_0x3c18('0x35')]({'model':db[_0x3c18('0xdb')],'as':_0x3c18('0xdb'),'raw':!![]});}var _0x38f09a=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id','body',_0x3c18('0x7b'),_0x3c18('0xdc'),'secret','read'],'include':_0x28a12f}];_0x38f09a[_0x3c18('0x35')]({'model':db[_0x3c18('0xdd')],'as':_0x3c18('0xde'),'attributes':['id',_0x3c18('0x2d')]});_0x38f09a[_0x3c18('0x35')]({'model':db[_0x3c18('0x76')],'as':_0x3c18('0xdf'),'attributes':['id',_0x3c18('0x30')]});return db[_0x3c18('0x3f')][_0x3c18('0x66')]({'where':{'id':_0x1208d1[_0x3c18('0xb8')]['id']},'include':_0x38f09a})[_0x3c18('0x28')](handleEntityNotFound(_0x59f0ec,null))[_0x3c18('0x28')](function(_0x391dd9){if(_0x391dd9){var _0x36e360=_0x391dd9[_0x3c18('0xe0')]({'plain':!![]});fs['mkdirSync'](_0x3067e2);var _0x45008a={'channel':_0x3c18('0xe1'),'account':_0x36e360[_0x3c18('0xde')]['name'],'agent':_0x36e360[_0x3c18('0xdf')]?_0x36e360[_0x3c18('0xdf')]['fullname']:_0x3c18('0xe2'),'createdAt':moment(_0x36e360[_0x3c18('0x7b')])[_0x3c18('0xc3')](_0x3c18('0xc4'))[_0x3c18('0x9d')](),'closedAt':_0x36e360[_0x3c18('0x3c')]?moment(_0x36e360['closedAt'])[_0x3c18('0xc3')](_0x3c18('0xc4'))[_0x3c18('0x9d')]():'','disposition':_0x36e360[_0x3c18('0xe3')],'visibility':_0x36e360[_0x3c18('0xe4')]?'Public':'Private','messages':_(_0x36e360[_0x3c18('0xe5')])[_0x3c18('0x88')]({'secret':![]})['map'](function(_0x21809e){if(_0x21809e[_0x3c18('0xdb')]){var _0x196402=path[_0x3c18('0xd2')](_0x1779b5,_0x21809e['Attachment'][_0x3c18('0xe6')]);if(fs[_0x3c18('0xe7')](_0x196402)){fs[_0x3c18('0xe8')](_0x196402)[_0x3c18('0xe9')](fs[_0x3c18('0xea')](path[_0x3c18('0xd2')](_0x3067e2,_0x21809e[_0x3c18('0xdb')][_0x3c18('0xe6')])));}}return{'date':moment(_0x21809e[_0x3c18('0x7b')])[_0x3c18('0xc3')](_0x3c18('0xc4'))[_0x3c18('0x9d')](),'sender':_0x21809e[_0x3c18('0xdc')]==='out'?_0x21809e[_0x3c18('0x76')]?_0x21809e[_0x3c18('0x76')][_0x3c18('0x30')]:'System':_0x21809e['Contact'][_0x3c18('0xd9')]+(_0x21809e[_0x3c18('0x6c')][_0x3c18('0xeb')]?'\x20'+_0x21809e[_0x3c18('0x6c')]['lastName']:''),'body':_0x21809e['Attachment']?_0x21809e['Attachment']['basename']:_0x21809e[_0x3c18('0xbc')],'direction':_0x21809e['direction']===_0x3c18('0xec')?'A':'C','secret':_0x21809e[_0x3c18('0xed')],'read':_0x21809e[_0x3c18('0x83')],'attachment':_0x21809e[_0x3c18('0xdb')]};})[_0x3c18('0x68')]()};return ejs[_0x3c18('0xee')](path['join'](config[_0x3c18('0xd3')],_0x3c18('0xd4'),'views',_0x3c18('0xef')),{'interaction':_0x45008a})[_0x3c18('0x28')](function(_0x1cd909){var _0x4ada7e=path[_0x3c18('0xd2')](_0x3067e2,'transcript-'+_0x36e360['id']+'-'+_0x424f84+_0x3c18('0xf0'));var _0x58672b={'path':_0x4ada7e,'channel':'Openchannel','interactionId':_0x36e360['id']};return pdf['createPdfFromHTML'](_0x1cd909,_0x58672b);})[_0x3c18('0x28')](function(){return new BPromise(function(_0x2520b3,_0x11004f){zipdir(_0x3067e2,{'saveTo':_0x45a3b8},function(_0x2f7d71,_0x51fc0f){if(_0x2f7d71)return _0x11004f(_0x2f7d71);return _0x2520b3(_0x51fc0f);});})[_0x3c18('0x28')](function(){return new BPromise(function(_0x217608,_0x59515f){rimraf(_0x3067e2,function(_0x254c7e){if(_0x254c7e)_0x59515f(_0x254c7e);return _0x217608();});});})[_0x3c18('0x28')](function(){return _0x59f0ec[_0x3c18('0xf1')](_0x45a3b8,_0x28d616,function(_0x39ddca){if(_0x39ddca){console[_0x3c18('0xf2')](_0x3c18('0xf3'),_0x39ddca);}else{fs[_0x3c18('0xf4')](_0x45a3b8);}});});});}else{return _0x59f0ec[_0x3c18('0x2a')](0xc8);}})[_0x3c18('0x36')](handleError(_0x59f0ec,null));};
\ No newline at end of file
+var _0x67c5=['buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','\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)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','show','params','keys','includeAll','include','options','create','update','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','rawAttributes','format','rows','addTags','setTags','spread','emit','removeTags','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','existsSync','createReadStream','pipe','createWriteStream','basename','System','out','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','sendStatus','end','status','undefined','count','limit','set','Content-Range','json','save','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','talking','answered','unmanaged','total','UserId','waiting','closed','index','OpenchannelInteraction','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','select','field','color','u.id','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','me.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','`\x20=\x200','having','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId'];(function(_0x53e41e,_0x466088){var _0x4c8178=function(_0x2bbc3c){while(--_0x2bbc3c){_0x53e41e['push'](_0x53e41e['shift']());}};_0x4c8178(++_0x466088);}(_0x67c5,0x84));var _0x567c=function(_0x2215d1,_0x403a52){_0x2215d1=_0x2215d1-0x0;var _0x24859b=_0x67c5[_0x2215d1];return _0x24859b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x567c('0x0'));var zipdir=require(_0x567c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x567c('0x2'));var moment=require(_0x567c('0x3'));var BPromise=require(_0x567c('0x4'));var Mustache=require(_0x567c('0x5'));var util=require(_0x567c('0x6'));var path=require(_0x567c('0x7'));var sox=require(_0x567c('0x8'));var csv=require(_0x567c('0x9'));var ejs=require(_0x567c('0xa'));var fs=require('fs');var fs_extra=require(_0x567c('0xb'));var _=require(_0x567c('0xc'));var squel=require(_0x567c('0xd'));var crypto=require(_0x567c('0xe'));var jsforce=require(_0x567c('0xf'));var deskjs=require(_0x567c('0x10'));var toCsv=require(_0x567c('0x9'));var querystring=require(_0x567c('0x11'));var Papa=require(_0x567c('0x12'));var Redis=require(_0x567c('0x13'));var authService=require(_0x567c('0x14'));var qs=require(_0x567c('0x15'));var as=require(_0x567c('0x16'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x567c('0x17'));var logger=require(_0x567c('0x18'))(_0x567c('0x19'));var utils=require(_0x567c('0x1a'));var config=require(_0x567c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x567c('0x1c'))['db'];config[_0x567c('0x1d')]=_[_0x567c('0x1e')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x567c('0x1f'))(new Redis(config['redis']));require(_0x567c('0x20'))['register'](socket);function respondWithStatusCode(_0x1629e2,_0x3719c7){_0x3719c7=_0x3719c7||0xcc;return function(_0x2303c7){if(_0x2303c7){return _0x1629e2[_0x567c('0x21')](_0x3719c7);}return _0x1629e2['status'](_0x3719c7)[_0x567c('0x22')]();};}function respondWithResult(_0x2d1ac4,_0x51e4af){_0x51e4af=_0x51e4af||0xc8;return function(_0x4a28ff){if(_0x4a28ff){return _0x2d1ac4[_0x567c('0x23')](_0x51e4af)['json'](_0x4a28ff);}};}function respondWithFilteredResult(_0x3630f4,_0xac09fa){return function(_0x5e0a07){if(_0x5e0a07){var _0x56717b=typeof _0xac09fa['offset']===_0x567c('0x24')&&typeof _0xac09fa['limit']===_0x567c('0x24');var _0x12602f=_0x5e0a07[_0x567c('0x25')];var _0x5ef2b3=_0x56717b?0x0:_0xac09fa['offset'];var _0x8be81a=_0x56717b?_0x5e0a07['count']:_0xac09fa['offset']+_0xac09fa[_0x567c('0x26')];var _0x59e06a;if(_0x8be81a>=_0x12602f){_0x8be81a=_0x12602f;_0x59e06a=0xc8;}else{_0x59e06a=0xce;}_0x3630f4[_0x567c('0x23')](_0x59e06a);return _0x3630f4[_0x567c('0x27')](_0x567c('0x28'),_0x5ef2b3+'-'+_0x8be81a+'/'+_0x12602f)[_0x567c('0x29')](_0x5e0a07);}return null;};}function patchUpdates(_0x12ac8e){return function(_0x39e88f){try{jsonpatch['apply'](_0x39e88f,_0x12ac8e,!![]);}catch(_0x243229){return BPromise['reject'](_0x243229);}return _0x39e88f[_0x567c('0x2a')]();};}function saveUpdates(_0x1bce6a,_0x4d5509){return function(_0x2d4a88){if(_0x2d4a88){return _0x2d4a88['update'](_0x1bce6a)[_0x567c('0x2b')](function(_0x17fb03){return _0x17fb03;});}return null;};}function removeEntity(_0x30c2ff,_0x44c7ea){return function(_0x4a9dae){if(_0x4a9dae){return _0x4a9dae[_0x567c('0x2c')]()[_0x567c('0x2b')](function(){_0x30c2ff['status'](0xcc)[_0x567c('0x22')]();});}};}function handleEntityNotFound(_0x511b45,_0x4e4562){return function(_0x4a8389){if(!_0x4a8389){_0x511b45[_0x567c('0x21')](0x194);}return _0x4a8389;};}function handleError(_0xf552bb,_0x50aff9){_0x50aff9=_0x50aff9||0x1f4;return function(_0xbafb50){logger[_0x567c('0x2d')](_0xbafb50[_0x567c('0x2e')]);if(_0xbafb50[_0x567c('0x2f')]){delete _0xbafb50[_0x567c('0x2f')];}_0xf552bb[_0x567c('0x23')](_0x50aff9)[_0x567c('0x30')](_0xbafb50);};}function getInteractionUsers(_0x2b151c,_0x3fdd4d){return new BPromise(function(_0x5dda17,_0x318e35){try{if(_0x3fdd4d[_0x2b151c['id']]){_0x2b151c[_0x567c('0x31')]=_[_0x567c('0x32')](_0x3fdd4d[_0x2b151c['id']],function(_0x263fa3){return{'id':_0x263fa3['id'],'fullname':_0x263fa3[_0x567c('0x33')]};});}}catch(_0x29b06c){_0x318e35(_0x29b06c);}_0x5dda17(_0x2b151c);});}function getInteractionTags(_0x3c1623,_0x4fddc7){return new BPromise(function(_0x3fcc44,_0x42bb8e){try{if(_0x3c1623[_0x567c('0x34')]){_0x3c1623[_0x567c('0x35')]=[];_0x3c1623[_0x567c('0x34')][_0x567c('0x36')](',')[_0x567c('0x37')](function(_0x224866){_0x3c1623['Tags'][_0x567c('0x38')](_0x4fddc7[_0x224866]);});}delete _0x3c1623[_0x567c('0x34')];}catch(_0x17fd09){_0x42bb8e(_0x17fd09);}_0x3fcc44(_0x3c1623);});}function updateOpenchannelInteraction(_0x2c3ac6,_0x34efae,_0x15d45a){return new BPromise(function(_0x4d52ff,_0x4d51f8){return getInteractionUsers(_0x2c3ac6,_0x15d45a)['then'](function(_0x264809){return getInteractionTags(_0x264809,_0x34efae);})[_0x567c('0x2b')](function(_0x12248e){return getStateInteraction(_0x12248e);})[_0x567c('0x2b')](function(_0x5d8cfd){_0x4d52ff(_0x5d8cfd);})[_0x567c('0x39')](function(_0x2cd0f2){_0x4d51f8(_0x2cd0f2);});});}function getStateInteraction(_0x2f0dfc){return new BPromise(function(_0x52631c){_0x2f0dfc['waiting']=0x0;_0x2f0dfc[_0x567c('0x3a')]=0x0;_0x2f0dfc[_0x567c('0x3b')]=0x0;_0x2f0dfc[_0x567c('0x3c')]=0x0;_0x2f0dfc[_0x567c('0x3d')]=0x0;if(!_0x2f0dfc['closed']&&!_0x2f0dfc[_0x567c('0x3e')]){_0x2f0dfc[_0x567c('0x3f')]+=0x1;}if(!_0x2f0dfc[_0x567c('0x40')]&&_0x2f0dfc['UserId']){_0x2f0dfc[_0x567c('0x3a')]+=0x1;if(_0x2f0dfc[_0x567c('0x3f')]){_0x2f0dfc[_0x567c('0x3f')]-=0x1;}}if(_0x2f0dfc[_0x567c('0x40')]&&_0x2f0dfc[_0x567c('0x3e')]){_0x2f0dfc[_0x567c('0x3b')]+=0x1;if(_0x2f0dfc[_0x567c('0x3a')]){_0x2f0dfc[_0x567c('0x3a')]-=0x1;}}if(_0x2f0dfc[_0x567c('0x40')]&&!_0x2f0dfc[_0x567c('0x3e')]){_0x2f0dfc[_0x567c('0x3c')]+=0x1;if(_0x2f0dfc[_0x567c('0x3f')]){_0x2f0dfc[_0x567c('0x3f')]-=0x1;}}_0x2f0dfc[_0x567c('0x3d')]+=0x1;_0x52631c(_0x2f0dfc);});}exports[_0x567c('0x41')]=function(_0x11da5c,_0x17f6d8){var _0x8345c0={},_0x41c3fd={},_0x40906a={'count':0x0,'rows':[]};var _0x5d9bcf=_[_0x567c('0x32')](db[_0x567c('0x42')]['rawAttributes'],function(_0x44ada9){return{'name':_0x44ada9[_0x567c('0x43')],'type':_0x44ada9[_0x567c('0x44')]['key']};});_0x41c3fd['model']=_['map'](_0x5d9bcf,'name');_0x41c3fd[_0x567c('0x45')]=_['keys'](_0x11da5c[_0x567c('0x45')]);_0x41c3fd[_0x567c('0x46')]=_['intersection'](_0x41c3fd[_0x567c('0x47')],_0x41c3fd[_0x567c('0x45')]);_0x8345c0[_0x567c('0x48')]=_[_0x567c('0x49')](_0x41c3fd[_0x567c('0x47')],qs[_0x567c('0x4a')](_0x11da5c['query'][_0x567c('0x4a')]));_0x8345c0['attributes']=_0x8345c0['attributes'][_0x567c('0x4b')]?_0x8345c0[_0x567c('0x48')]:_0x41c3fd['model'];if(!_0x11da5c[_0x567c('0x45')][_0x567c('0x4c')](_0x567c('0x4d'))){_0x8345c0['limit']=qs[_0x567c('0x26')](_0x11da5c[_0x567c('0x45')][_0x567c('0x26')]);_0x8345c0['offset']=qs['offset'](_0x11da5c[_0x567c('0x45')][_0x567c('0x4e')]);}_0x8345c0['order']=qs[_0x567c('0x4f')](_0x11da5c[_0x567c('0x45')][_0x567c('0x4f')]);_0x8345c0[_0x567c('0x50')]=qs[_0x567c('0x46')](_[_0x567c('0x51')](_0x11da5c['query'],_0x41c3fd[_0x567c('0x46')]),_0x5d9bcf);var _0x596b9f=[];var _0x205cab=squel[_0x567c('0x52')]()['field']('id')['field'](_0x567c('0x2f'))[_0x567c('0x53')](_0x567c('0x54'))['from']('tools_tags');var _0x305ee8=squel[_0x567c('0x52')]()['field'](_0x567c('0x55'))['field']('u.fullname')[_0x567c('0x53')](_0x567c('0x56'))[_0x567c('0x57')](_0x567c('0x58'),'ui')['left_join'](_0x567c('0x59'),'u',_0x567c('0x5a'));var _0x52e64a=squel[_0x567c('0x52')]()[_0x567c('0x57')](_0x567c('0x5b'),'i')['left_join'](_0x567c('0x5c'),'c',_0x567c('0x5d'))[_0x567c('0x5e')](_0x567c('0x59'),'o',_0x567c('0x5f'))[_0x567c('0x5e')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0x567c('0x5e')]('openchannel_messages','me',_0x567c('0x60'))['left_join']('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x567c('0x5e')](_0x567c('0x61'),'t',_0x567c('0x62'));var _0x2e95d8=squel[_0x567c('0x63')]();var _0x349684=[];var _0x139eb8=squel[_0x567c('0x63')]();var _0x20b234;if(_0x11da5c[_0x567c('0x45')][_0x567c('0x64')]){_0x20b234=as['parseSearch'](_0x11da5c[_0x567c('0x45')][_0x567c('0x64')]);var _0x402393=_0x20b234[_0x567c('0x65')];for(var _0x24af19=0x0;_0x24af19<_0x20b234[_0x567c('0x66')][_0x567c('0x4b')];_0x24af19++){var _0x4b63b6=_0x20b234[_0x567c('0x66')][_0x24af19];var _0x1fd857='i';var _0x380820=_[_0x567c('0x67')](_0x5d9bcf,[_0x567c('0x2f'),_0x4b63b6[_0x567c('0x53')]]);if(!_0x380820){switch(_0x4b63b6[_0x567c('0x53')]){case'unreadMessages':if(_0x4b63b6['value']==0x1){_0x52e64a['having']('`'+_0x4b63b6[_0x567c('0x53')]+_0x567c('0x68'));}else{_0x52e64a[_0x567c('0x69')]('`'+_0x4b63b6[_0x567c('0x53')]+_0x567c('0x6a'));}break;case _0x567c('0x6b'):if(_0x4b63b6['operator']===_0x567c('0x6c')){if(_0x4b63b6[_0x567c('0x6d')]['split']('\x20')[_0x567c('0x4b')]>0x1){_0x2e95d8[_0x402393](_0x567c('0x6e'),qs[_0x567c('0x6f')](_0x4b63b6[_0x567c('0x6d')]),null);}else{var _0x16bbc8='%'+_0x4b63b6[_0x567c('0x6d')]+'%';_0x2e95d8[_0x402393](_0x567c('0x70'),_0x16bbc8,_0x16bbc8,_0x16bbc8);}}else{_0x380820=_[_0x567c('0x67')](_0x5d9bcf,[_0x567c('0x2f'),_0x567c('0x71')]);_0x4b63b6[_0x567c('0x53')]=_0x567c('0x71');_0x372149=as[_0x567c('0x72')](_0x1fd857,_0x380820[_0x567c('0x44')],_0x4b63b6);_0x2e95d8[_0x402393](_0x372149[_0x567c('0x73')],_0x372149['value'][_0x567c('0x74')],_0x372149[_0x567c('0x6d')][_0x567c('0x22')]);}break;case _0x567c('0x75'):var _0x593029=_0x4b63b6[_0x567c('0x6d')][_0x567c('0x36')](',')[_0x567c('0x32')](function(_0x1fb8de){return Number(_0x1fb8de);});_0x593029[_0x567c('0x37')](function(_0x411d4a){_0x139eb8['or'](_0x567c('0x76'),'%,'+_0x411d4a+',%');});_0x349684=_['union'](_0x349684,_0x593029);break;case _0x567c('0x77'):if(_0x4b63b6[_0x567c('0x78')]===_0x567c('0x6c')){_0x2e95d8[_0x402393](_0x567c('0x79'),'%'+_0x4b63b6[_0x567c('0x6d')]+'%',null);}else{_0x380820=_[_0x567c('0x67')](_0x5d9bcf,[_0x567c('0x2f'),_0x567c('0x3e')]);_0x4b63b6['field']=_0x567c('0x3e');_0x372149=as['buildExpression'](_0x1fd857,_0x380820[_0x567c('0x44')],_0x4b63b6);_0x2e95d8[_0x402393](_0x372149[_0x567c('0x73')],_0x372149['value']['start'],_0x372149[_0x567c('0x6d')][_0x567c('0x22')]);}break;case _0x567c('0x7a'):_0x372149=as[_0x567c('0x72')]('me',null,_0x4b63b6);_0x2e95d8[_0x402393](_0x372149[_0x567c('0x73')],_0x372149['value'][_0x567c('0x74')],_0x372149[_0x567c('0x6d')][_0x567c('0x22')]);break;}}else{var _0x372149=as['buildExpression'](_0x1fd857,_0x380820['type'],_0x4b63b6);_0x2e95d8[_0x402393](_0x372149[_0x567c('0x73')],_0x372149['value'][_0x567c('0x74')],_0x372149['value'][_0x567c('0x22')]);}}}else{var _0x3724c7=_(_0x11da5c[_0x567c('0x45')])['keys']()['map'](function(_0x24f034){return _['some'](_0x5d9bcf,['name',_0x24f034])?_0x24f034:undefined;})[_0x567c('0x7b')]()[_0x567c('0x6d')]();if(!_[_0x567c('0x7c')](_0x3724c7)){_0x3724c7[_0x567c('0x37')](function(_0x45b9f9){if(_0x45b9f9===_0x567c('0x7d')){_0x52e64a[_0x567c('0x50')](_0x567c('0x7e'),[][_0x567c('0x7f')](_0x11da5c[_0x567c('0x45')][_0x45b9f9]));}else if(_0x45b9f9===_0x567c('0x80')){var _0x39fba6=JSON[_0x567c('0x81')](_0x11da5c[_0x567c('0x45')][_0x45b9f9])[_0x567c('0x82')];var _0x4bab30=JSON[_0x567c('0x81')](_0x11da5c['query'][_0x45b9f9])['$lte'];_0x52e64a[_0x567c('0x50')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x39fba6,_0x4bab30);}else{if(_0x11da5c[_0x567c('0x45')][_0x45b9f9]==='null'){_0x52e64a[_0x567c('0x50')]('i.'+_0x45b9f9+_0x567c('0x83'));}else{_0x52e64a[_0x567c('0x50')]('i.'+_0x45b9f9+_0x567c('0x84'),_0x11da5c['query'][_0x45b9f9]);}}});}if(_0x11da5c[_0x567c('0x45')][_0x567c('0x85')]){if(_0x11da5c[_0x567c('0x45')][_0x567c('0x85')]==0x1){_0x52e64a[_0x567c('0x69')](_0x567c('0x86'));}else{_0x52e64a[_0x567c('0x69')](_0x567c('0x87'));}}if(_0x11da5c['query'][_0x567c('0x88')]){_0x349684=_['isArray'](_0x11da5c[_0x567c('0x45')][_0x567c('0x88')])?_0x11da5c[_0x567c('0x45')][_0x567c('0x88')]:new Array(_0x11da5c['query']['tag']);_0x349684[_0x567c('0x37')](function(_0x2f222b){_0x139eb8['or'](_0x567c('0x76'),'%,'+_0x2f222b+',%');});}if(_0x11da5c[_0x567c('0x45')][_0x567c('0x89')]){var _0x2d6768=_0x11da5c[_0x567c('0x45')]['filter'][_0x567c('0x8a')]('\x5c','\x5c\x5c')[_0x567c('0x8a')](/'/g,'\x27\x27');if(qs[_0x567c('0x8b')](_0x2d6768)){_0x2e95d8['or'](_0x567c('0x8c'),_0x2d6768+'%');}else{_0x2e95d8['or'](_0x567c('0x8d'),qs[_0x567c('0x6f')](_0x2d6768))['or'](_0x567c('0x8e'),_0x2d6768+'%')['or'](_0x567c('0x8f'),_0x2d6768+'%');}}}_0x52e64a[_0x567c('0x50')](_0x2e95d8);_0x52e64a['group'](_0x567c('0x90'));var _0x2a95eb={'type':db[_0x567c('0x91')][_0x567c('0x92')]['SELECT'],'raw':!![]};var _0x4e2fad=_0x52e64a[_0x567c('0x93')]();_0x4e2fad['field'](_0x567c('0x90'));_0x4e2fad['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x567c('0x94'));if(_0x8345c0[_0x567c('0x95')]){_0x8345c0[_0x567c('0x95')]['forEach'](function(_0x2e1bb9){var _0x5deade=_0x2e1bb9[0x0]===_0x567c('0x96')?_0x2e1bb9[0x0]:'i.'+_0x2e1bb9[0x0];_0x52e64a['order'](_0x5deade,_0x2e1bb9[0x1]===_0x567c('0x97')?![]:!![]);});}if(!_['isEmpty'](_0x349684)){_0x52e64a[_0x567c('0x69')](_0x139eb8);_0x4e2fad[_0x567c('0x50')](_0x567c('0x98'),_0x349684);}BPromise[_0x567c('0x99')]()[_0x567c('0x2b')](function(){if(!_0x20b234){if(_0x11da5c[_0x567c('0x45')][_0x567c('0x7d')])return;_0x4e2fad['where'](_0x567c('0x9a'));_0x52e64a[_0x567c('0x50')](_0x567c('0x9a'));return;}if(_0x11da5c[_0x567c('0x9b')]['role']!=='agent')return;return _0x11da5c[_0x567c('0x9b')][_0x567c('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0xaecfd0){if(_['isEmpty'](_0xaecfd0)){_0x4e2fad[_0x567c('0x50')](_0x567c('0x9d'));_0x52e64a[_0x567c('0x50')](_0x567c('0x9d'));}else{_0x4e2fad[_0x567c('0x50')](_0x567c('0x7e'),_[_0x567c('0x32')](_0xaecfd0,'id'));_0x52e64a[_0x567c('0x50')](_0x567c('0x7e'),_[_0x567c('0x32')](_0xaecfd0,'id'));}});})[_0x567c('0x2b')](function(){if(_0x11da5c[_0x567c('0x9b')][_0x567c('0x9e')]==='agent'&&!_0x20b234&&!_0x11da5c[_0x567c('0x45')]['OpenchannelAccountId'])return[];return db[_0x567c('0x9f')]['query'](_0x4e2fad[_0x567c('0xa0')](),_0x2a95eb);})['then'](function(_0x243207){_0x40906a['count']=_0x243207[_0x567c('0x4b')];if(_0x40906a['count']===0x0)return[];return db[_0x567c('0x9f')]['query'](_0x205cab[_0x567c('0xa0')](),_0x2a95eb)[_0x567c('0x2b')](function(_0x4b1a2c){_0x596b9f=_['keyBy'](_0x4b1a2c,'id');_0x2a95eb=_[_0x567c('0xa1')](_0x2a95eb,{'model':db[_0x567c('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x11da5c['query']['fields']){_0x8345c0['attributes']['forEach'](function(_0xabcbdc){_0x52e64a[_0x567c('0x53')]('i.'+_0xabcbdc);});}else{_0x52e64a[_0x567c('0x53')](_0x567c('0xa2'),'unreadMessages');_0x52e64a['field'](_0x567c('0xa3'),_0x567c('0xa4'));_0x52e64a[_0x567c('0x53')](_0x567c('0xa5'),_0x567c('0xa6'));_0x52e64a['field'](_0x567c('0xa7'),_0x567c('0x96'));_0x52e64a['field'](_0x567c('0xa8'));_0x52e64a[_0x567c('0x53')](_0x567c('0xa9'),_0x567c('0xaa'));_0x52e64a[_0x567c('0x53')](_0x567c('0xab'),'Contact.lastName');_0x52e64a['field'](_0x567c('0xac'),_0x567c('0xad'));_0x52e64a[_0x567c('0x53')]('c.phone',_0x567c('0xae'));_0x52e64a[_0x567c('0x53')]('c.mobile',_0x567c('0xaf'));_0x52e64a[_0x567c('0x53')]('c.fax',_0x567c('0xb0'));_0x52e64a[_0x567c('0x53')](_0x567c('0xb1'),_0x567c('0xb2'));_0x52e64a[_0x567c('0x53')](_0x567c('0xb3'),_0x567c('0xb4'));_0x52e64a[_0x567c('0x53')](_0x567c('0xb5'),'TagIds');}if(_0x8345c0[_0x567c('0x26')])_0x52e64a[_0x567c('0x26')](_0x8345c0[_0x567c('0x26')]);if(_0x8345c0['offset'])_0x52e64a[_0x567c('0x4e')](_0x8345c0[_0x567c('0x4e')]);return db['sequelize']['query'](_0x52e64a[_0x567c('0xa0')](),_0x2a95eb);})[_0x567c('0x2b')](function(_0x386cfa){if(_0x386cfa[_0x567c('0x4b')]>0x0)_0x305ee8[_0x567c('0x50')](_0x567c('0xb6'),_[_0x567c('0x32')](_0x386cfa,'id'));return db[_0x567c('0x9f')][_0x567c('0x45')](_0x305ee8[_0x567c('0xa0')](),_0x2a95eb)[_0x567c('0x2b')](function(_0xb1c99f){var _0x4be650=_['groupBy'](_0xb1c99f,_0x567c('0xb7'));var _0x40c768=[];_0x386cfa[_0x567c('0x37')](function(_0x388ffa){_0x40c768['push'](updateOpenchannelInteraction(_0x388ffa,_0x596b9f,_0x4be650));});return BPromise['all'](_0x40c768);});});})['then'](function(_0x2669b3){_0x40906a['rows']=_0x2669b3;return _0x40906a;})[_0x567c('0x2b')](respondWithFilteredResult(_0x17f6d8,_0x8345c0))[_0x567c('0x39')](handleError(_0x17f6d8,null));};exports[_0x567c('0xb8')]=function(_0xcb40b3,_0xcea3ae){var _0x37d04a={};if(_0xcb40b3[_0x567c('0x45')]['type']&&_0xcb40b3[_0x567c('0x45')][_0x567c('0x44')]===_0x567c('0x57')){_0x37d04a[_0x567c('0x57')]=_0xcb40b3['params']['id'];}else{_0x37d04a['id']=_0xcb40b3[_0x567c('0xb9')]['id'];}var _0x35a652={'raw':![],'where':_0x37d04a},_0x151001={};_0x151001['model']=_[_0x567c('0xba')](db[_0x567c('0x42')]['rawAttributes']);_0x151001[_0x567c('0x45')]=_['keys'](_0xcb40b3[_0x567c('0x45')]);_0x151001['filters']=_['intersection'](_0x151001[_0x567c('0x47')],_0x151001[_0x567c('0x45')]);_0x35a652[_0x567c('0x48')]=_[_0x567c('0x49')](_0x151001[_0x567c('0x47')],qs[_0x567c('0x4a')](_0xcb40b3[_0x567c('0x45')]['fields']));_0x35a652[_0x567c('0x48')]=_0x35a652[_0x567c('0x48')][_0x567c('0x4b')]?_0x35a652['attributes']:_0x151001[_0x567c('0x47')];if(_0xcb40b3[_0x567c('0x45')][_0x567c('0xbb')]){_0x35a652[_0x567c('0xbc')]=[{'all':!![]}];}_0x35a652=_[_0x567c('0xa1')]({},_0x35a652,_0xcb40b3[_0x567c('0xbd')]);return db[_0x567c('0x42')]['find'](_0x35a652)[_0x567c('0x2b')](handleEntityNotFound(_0xcea3ae,null))[_0x567c('0x2b')](respondWithResult(_0xcea3ae,null))[_0x567c('0x39')](handleError(_0xcea3ae,null));};exports[_0x567c('0xbe')]=function(_0x22d48c,_0x9d3f23){return db[_0x567c('0x42')]['create'](_0x22d48c[_0x567c('0x7a')],{})[_0x567c('0x2b')](respondWithResult(_0x9d3f23,0xc9))[_0x567c('0x39')](handleError(_0x9d3f23,null));};exports[_0x567c('0xbf')]=function(_0x41eda0,_0x47a35c){if(_0x41eda0['body']['id']){delete _0x41eda0[_0x567c('0x7a')]['id'];}return db[_0x567c('0x42')][_0x567c('0x67')]({'where':{'id':_0x41eda0['params']['id']}})[_0x567c('0x2b')](handleEntityNotFound(_0x47a35c,null))['then'](saveUpdates(_0x41eda0['body'],null))[_0x567c('0x2b')](respondWithResult(_0x47a35c,null))['catch'](handleError(_0x47a35c,null));};exports[_0x567c('0x2c')]=function(_0x3813ca,_0x570126){return db[_0x567c('0x42')][_0x567c('0x67')]({'where':{'id':_0x3813ca[_0x567c('0xb9')]['id']}})[_0x567c('0x2b')](handleEntityNotFound(_0x570126,null))[_0x567c('0x2b')](removeEntity(_0x570126,null))['catch'](handleError(_0x570126,null));};exports[_0x567c('0xc0')]=function(_0x22eef2,_0x10253f){return db[_0x567c('0x42')][_0x567c('0xc0')]()[_0x567c('0x2b')](respondWithResult(_0x10253f,null))[_0x567c('0x39')](handleError(_0x10253f,null));};exports['addMessage']=function(_0x1477a7,_0x4e4050,_0xabffe2){return db[_0x567c('0xc1')][_0x567c('0x67')]({'where':{'id':_0x1477a7['params']['id']}})[_0x567c('0x2b')](handleEntityNotFound(_0x4e4050,null))['then'](function(_0x35c78a){if(_0x35c78a){return _0x35c78a[_0x567c('0xc2')](_0x1477a7[_0x567c('0x7a')][_0x567c('0xc3')],_[_0x567c('0xc4')](_0x1477a7[_0x567c('0x7a')],[_0x567c('0xc3'),'id'])||{});}})[_0x567c('0x2b')](respondWithResult(_0x4e4050,null))[_0x567c('0x39')](handleError(_0x4e4050,null));};exports[_0x567c('0xc5')]=function(_0x5f6ef1,_0x51de10,_0xc75485){var _0x13f7f2={'raw':![],'where':{}};var _0x1a0300={};var _0x9474b2={'count':0x0,'rows':[]};return db[_0x567c('0x42')]['findOne']({'where':{'id':_0x5f6ef1[_0x567c('0xb9')]['id']}})[_0x567c('0x2b')](handleEntityNotFound(_0x51de10,null))[_0x567c('0x2b')](function(_0x30d076){if(_0x30d076){_0x1a0300['model']=_[_0x567c('0xba')](db[_0x567c('0xc1')][_0x567c('0xc6')]);_0x1a0300[_0x567c('0x45')]=_[_0x567c('0xba')](_0x5f6ef1[_0x567c('0x45')]);_0x1a0300[_0x567c('0x46')]=_[_0x567c('0x49')](_0x1a0300[_0x567c('0x47')],_0x1a0300[_0x567c('0x45')]);_0x13f7f2[_0x567c('0x48')]=_[_0x567c('0x49')](_0x1a0300['model'],qs[_0x567c('0x4a')](_0x5f6ef1[_0x567c('0x45')]['fields']));_0x13f7f2[_0x567c('0x48')]=_0x13f7f2['attributes']['length']?_0x13f7f2[_0x567c('0x48')]:_0x1a0300[_0x567c('0x47')];if(!_0x5f6ef1[_0x567c('0x45')][_0x567c('0x4c')]('nolimit')){_0x13f7f2[_0x567c('0x26')]=qs['limit'](_0x5f6ef1['query']['limit']);_0x13f7f2['offset']=qs[_0x567c('0x4e')](_0x5f6ef1[_0x567c('0x45')][_0x567c('0x4e')]);}_0x13f7f2[_0x567c('0x95')]=qs[_0x567c('0x4f')](_0x5f6ef1[_0x567c('0x45')][_0x567c('0x4f')]);_0x13f7f2[_0x567c('0x50')]=qs[_0x567c('0x46')](_[_0x567c('0x51')](_0x5f6ef1[_0x567c('0x45')],_0x1a0300[_0x567c('0x46')]));_0x13f7f2[_0x567c('0x50')][_0x567c('0xb7')]=_0x30d076['id'];if(_0x5f6ef1['query'][_0x567c('0x89')]){_0x13f7f2[_0x567c('0x50')]=_[_0x567c('0xa1')](_0x13f7f2['where'],{'$or':_[_0x567c('0x32')](_0x13f7f2['attributes'],function(_0x221a5d){var _0x225cb1={};_0x225cb1[_0x221a5d]={'$like':'%'+_0x5f6ef1['query'][_0x567c('0x89')]+'%'};return _0x225cb1;})});}if(_0x5f6ef1['query'][_0x567c('0x82')]){var _0x162cb6=_0x5f6ef1[_0x567c('0x45')][_0x567c('0x82')][_0x567c('0x36')](',');var _0x2f8cf3={};_0x2f8cf3[_0x162cb6[0x0]]={'$gte':moment(_0x162cb6[0x1])[_0x567c('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x13f7f2['where']=_['merge'](_0x13f7f2['where'],_0x2f8cf3);}_0x13f7f2=_[_0x567c('0xa1')]({},_0x13f7f2,_0x5f6ef1[_0x567c('0xbd')]);return db[_0x567c('0xc1')]['count']({'where':_0x13f7f2[_0x567c('0x50')]})[_0x567c('0x2b')](function(_0x54dddc){_0x9474b2[_0x567c('0x25')]=_0x54dddc;if(_0x5f6ef1['query'][_0x567c('0xbb')]){_0x13f7f2[_0x567c('0xbc')]=[{'all':!![]}];}return db[_0x567c('0xc1')]['findAll'](_0x13f7f2);})[_0x567c('0x2b')](function(_0x5b7d1f){_0x9474b2[_0x567c('0xc8')]=_0x5b7d1f;return _0x9474b2;});}})[_0x567c('0x2b')](respondWithFilteredResult(_0x51de10,_0x13f7f2))[_0x567c('0x39')](handleError(_0x51de10,null));};exports[_0x567c('0xc9')]=function(_0xe4f2f3,_0x1584e5,_0x4aa766){return db[_0x567c('0x42')][_0x567c('0x67')]({'where':{'id':_0xe4f2f3[_0x567c('0xb9')]['id']}})[_0x567c('0x2b')](handleEntityNotFound(_0x1584e5,null))[_0x567c('0x2b')](function(_0x384b7c){if(_0x384b7c){return _0x384b7c[_0x567c('0xca')](_0xe4f2f3[_0x567c('0x7a')][_0x567c('0xc3')],_[_0x567c('0xc4')](_0xe4f2f3['body'],[_0x567c('0xc3'),'id'])||{})[_0x567c('0xcb')](function(){return db[_0x567c('0x75')]['findAll']({'attributes':['id',_0x567c('0x2f'),_0x567c('0x54')],'where':{'id':_0xe4f2f3[_0x567c('0x7a')][_0x567c('0xc3')]}});})[_0x567c('0x2b')](function(_0x1af4b5){socket[_0x567c('0xcc')]('openchannelInteractionTags:save',{'id':Number(_0xe4f2f3[_0x567c('0xb9')]['id']),'tags':_0x1af4b5||[]});return{'id':Number(_0xe4f2f3[_0x567c('0xb9')]['id']),'tags':_0x1af4b5||[]};});}})[_0x567c('0x2b')](respondWithResult(_0x1584e5,null))[_0x567c('0x39')](handleError(_0x1584e5,null));};exports[_0x567c('0xcd')]=function(_0x42ffdb,_0x3b6874,_0x1e9c38){return db[_0x567c('0x42')][_0x567c('0x67')]({'where':{'id':_0x42ffdb[_0x567c('0xb9')]['id']}})[_0x567c('0x2b')](handleEntityNotFound(_0x3b6874,null))[_0x567c('0x2b')](function(_0x4aa6d5){if(_0x4aa6d5){return _0x4aa6d5[_0x567c('0xcd')](_0x42ffdb[_0x567c('0x45')][_0x567c('0xc3')]);}})['then'](respondWithStatusCode(_0x3b6874,null))[_0x567c('0x39')](handleError(_0x3b6874,null));};exports['download']=function(_0x2f18f5,_0x4cb83e){var _0xf6003f=moment()['unix']()[_0x567c('0xa0')]();var _0x28a289=path['join'](config[_0x567c('0xce')],_0x567c('0xcf'),_0x567c('0xd0'),_0x567c('0xd1'));var _0x2bb3b2=path[_0x567c('0xd2')](config['root'],_0x567c('0xcf'),_0x567c('0xd0'),_0x567c('0xd3'));var _0x5855af=path['join'](_0x28a289,_0xf6003f);var _0xeec0b7=util['format'](_0x567c('0xd4'),_0x2f18f5[_0x567c('0xb9')]['id'],_0xf6003f);var _0x149c8e=path['join'](_0x28a289,_0xeec0b7);var _0x525124=[];_0x525124[_0x567c('0x38')]({'model':db[_0x567c('0x77')],'as':_0x567c('0x77'),'attributes':['id','fullname'],'raw':!![]});_0x525124[_0x567c('0x38')]({'model':db[_0x567c('0xd5')],'as':'Contact','attributes':['id',_0x567c('0xd6'),_0x567c('0xd7')],'raw':!![]});if(_0x2f18f5[_0x567c('0x45')]['attachments']){_0x525124[_0x567c('0x38')]({'model':db[_0x567c('0xd8')],'as':_0x567c('0xd8'),'raw':!![]});}var _0x1f26bf=[{'model':db[_0x567c('0xc1')],'as':_0x567c('0xd9'),'attributes':['id',_0x567c('0x7a'),_0x567c('0x80'),_0x567c('0xda'),_0x567c('0xdb'),_0x567c('0x85')],'include':_0x525124}];_0x1f26bf[_0x567c('0x38')]({'model':db[_0x567c('0xdc')],'as':_0x567c('0xdd'),'attributes':['id','name']});_0x1f26bf[_0x567c('0x38')]({'model':db[_0x567c('0x77')],'as':_0x567c('0xde'),'attributes':['id',_0x567c('0x33')]});return db[_0x567c('0x42')][_0x567c('0x67')]({'where':{'id':_0x2f18f5[_0x567c('0xb9')]['id']},'include':_0x1f26bf})[_0x567c('0x2b')](handleEntityNotFound(_0x4cb83e,null))[_0x567c('0x2b')](function(_0x2bce02){if(_0x2bce02){var _0x3ac6a5=_0x2bce02['get']({'plain':!![]});fs[_0x567c('0xdf')](_0x5855af);var _0x154484={'channel':_0x567c('0xe0'),'account':_0x3ac6a5[_0x567c('0xdd')][_0x567c('0x2f')],'agent':_0x3ac6a5[_0x567c('0xde')]?_0x3ac6a5[_0x567c('0xde')][_0x567c('0x33')]:_0x567c('0xe1'),'createdAt':moment(_0x3ac6a5['createdAt'])[_0x567c('0xc7')](_0x567c('0xe2'))[_0x567c('0xa0')](),'closedAt':_0x3ac6a5[_0x567c('0x40')]?moment(_0x3ac6a5[_0x567c('0xe3')])[_0x567c('0xc7')](_0x567c('0xe2'))[_0x567c('0xa0')]():'','disposition':_0x3ac6a5[_0x567c('0xe4')],'visibility':_0x3ac6a5[_0x567c('0xe5')]?_0x567c('0xe6'):'Private','messages':_(_0x3ac6a5['Messages'])[_0x567c('0x89')]({'secret':![]})[_0x567c('0x32')](function(_0x4d75cf){if(_0x4d75cf[_0x567c('0xd8')]){var _0x454703=path[_0x567c('0xd2')](_0x2bb3b2,_0x4d75cf[_0x567c('0xd8')]['basename']);if(fs[_0x567c('0xe7')](_0x454703)){fs[_0x567c('0xe8')](_0x454703)[_0x567c('0xe9')](fs[_0x567c('0xea')](path['join'](_0x5855af,_0x4d75cf[_0x567c('0xd8')][_0x567c('0xeb')])));}}return{'date':moment(_0x4d75cf[_0x567c('0x80')])[_0x567c('0xc7')](_0x567c('0xe2'))['toString'](),'sender':_0x4d75cf[_0x567c('0xda')]==='out'?_0x4d75cf['User']?_0x4d75cf[_0x567c('0x77')]['fullname']:_0x567c('0xec'):_0x4d75cf[_0x567c('0x6b')][_0x567c('0xd6')]+(_0x4d75cf[_0x567c('0x6b')][_0x567c('0xd7')]?'\x20'+_0x4d75cf['Contact'][_0x567c('0xd7')]:''),'body':_0x4d75cf[_0x567c('0xd8')]?_0x4d75cf['Attachment'][_0x567c('0xeb')]:_0x4d75cf['body'],'direction':_0x4d75cf['direction']===_0x567c('0xed')?'A':'C','secret':_0x4d75cf[_0x567c('0xdb')],'read':_0x4d75cf[_0x567c('0x85')],'attachment':_0x4d75cf[_0x567c('0xd8')]};})[_0x567c('0x6d')]()};return ejs['renderFile'](path[_0x567c('0xd2')](config['root'],_0x567c('0xcf'),_0x567c('0xee'),_0x567c('0xef')),{'interaction':_0x154484})[_0x567c('0x2b')](function(_0x33cca9){var _0x3b5641=path['join'](_0x5855af,'transcript-'+_0x3ac6a5['id']+'-'+_0xf6003f+_0x567c('0xf0'));var _0x4bb996={'path':_0x3b5641,'channel':_0x567c('0xe0'),'interactionId':_0x3ac6a5['id']};return pdf[_0x567c('0xf1')](_0x33cca9,_0x4bb996);})[_0x567c('0x2b')](function(){return new BPromise(function(_0x2cf1b,_0xa96801){zipdir(_0x5855af,{'saveTo':_0x149c8e},function(_0x375142,_0xf81162){if(_0x375142)return _0xa96801(_0x375142);return _0x2cf1b(_0xf81162);});})['then'](function(){return new BPromise(function(_0x265fec,_0x4f27b4){rimraf(_0x5855af,function(_0x49c026){if(_0x49c026)_0x4f27b4(_0x49c026);return _0x265fec();});});})[_0x567c('0x2b')](function(){return _0x4cb83e[_0x567c('0xf2')](_0x149c8e,_0xeec0b7,function(_0x3a117f){if(_0x3a117f){console[_0x567c('0xf3')](_0x567c('0xf4'),_0x3a117f);}else{fs[_0x567c('0xf5')](_0x149c8e);}});});});}else{return _0x4cb83e[_0x567c('0x21')](0xc8);}})[_0x567c('0x39')](handleError(_0x4cb83e,null));};
\ No newline at end of file
index d8d3462..3781e75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee22=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers'];(function(_0xdc3218,_0x391976){var _0x4935fe=function(_0x3f16f9){while(--_0x3f16f9){_0xdc3218['push'](_0xdc3218['shift']());}};_0x4935fe(++_0x391976);}(_0xee22,0x19c));var _0x2ee2=function(_0x44c7a2,_0x449be7){_0x44c7a2=_0x44c7a2-0x0;var _0x3efc90=_0xee22[_0x44c7a2];return _0x3efc90;};'use strict';var EventEmitter=require(_0x2ee2('0x0'));var OpenchannelInteraction=require(_0x2ee2('0x1'))['db'][_0x2ee2('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x2ee2('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2ee2('0x4')](0x0);var events={'afterCreate':_0x2ee2('0x5'),'afterUpdate':_0x2ee2('0x6'),'afterDestroy':'remove'};function emitEvent(_0x35c938){return function(_0x6d3903,_0x5591dd,_0x3c4503){_0x6d3903[_0x2ee2('0x7')]({'attributes':['id'],'raw':!![]})[_0x2ee2('0x8')](function(_0x2c2ac1){_0x6d3903[_0x2ee2('0x9')](_0x2ee2('0xa'),_0x2c2ac1[_0x2ee2('0xb')](function(_0x16d5aa){return{'id':_0x16d5aa['id']};}));return OpenchannelMessage[_0x2ee2('0xc')]({'where':{'OpenchannelInteractionId':_0x6d3903['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x484c89){_0x6d3903[_0x2ee2('0x9')](_0x2ee2('0xd'),_0x484c89[_0x2ee2('0xe')]);OpenchannelInteractionEvents[_0x2ee2('0xf')](_0x35c938+':'+_0x6d3903['id'],_0x6d3903);OpenchannelInteractionEvents[_0x2ee2('0xf')](_0x35c938,_0x6d3903);_0x3c4503(null);})[_0x2ee2('0x10')](_0x3c4503(null));};}for(var e in events){if(events[_0x2ee2('0x11')](e)){var event=events[e];OpenchannelInteraction[_0x2ee2('0x12')](e,emitEvent(event));}}module[_0x2ee2('0x13')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xccd9=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll'];(function(_0x591e93,_0x2cdfb6){var _0x369ab0=function(_0x1bfa65){while(--_0x1bfa65){_0x591e93['push'](_0x591e93['shift']());}};_0x369ab0(++_0x2cdfb6);}(_0xccd9,0x148));var _0x9ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd9[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x9ccd('0x0'));var OpenchannelInteraction=require(_0x9ccd('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x9ccd('0x1'))['db'][_0x9ccd('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9ccd('0x3')](0x0);var events={'afterCreate':_0x9ccd('0x4'),'afterUpdate':_0x9ccd('0x5'),'afterDestroy':_0x9ccd('0x6')};function emitEvent(_0x2f9d49){return function(_0x157be3,_0x13db34,_0x2e2b92){_0x157be3[_0x9ccd('0x7')]({'attributes':['id'],'raw':!![]})[_0x9ccd('0x8')](function(_0x1f2ef1){_0x157be3['setDataValue'](_0x9ccd('0x9'),_0x1f2ef1[_0x9ccd('0xa')](function(_0x5a942e){return{'id':_0x5a942e['id']};}));return OpenchannelMessage[_0x9ccd('0xb')]({'where':{'OpenchannelInteractionId':_0x157be3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9ccd('0x8')](function(_0x43ff2c){_0x157be3[_0x9ccd('0xc')](_0x9ccd('0xd'),_0x43ff2c[_0x9ccd('0xe')]);OpenchannelInteractionEvents[_0x9ccd('0xf')](_0x2f9d49+':'+_0x157be3['id'],_0x157be3);OpenchannelInteractionEvents['emit'](_0x2f9d49,_0x157be3);_0x2e2b92(null);})[_0x9ccd('0x10')](_0x2e2b92(null));};}for(var e in events){if(events[_0x9ccd('0x11')](e)){var event=events[e];OpenchannelInteraction[_0x9ccd('0x12')](e,emitEvent(event));}}module[_0x9ccd('0x13')]=OpenchannelInteractionEvents;
\ No newline at end of file
index fd99c35..ffb47de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e1=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed'];(function(_0x1832d6,_0x331ad9){var _0x22d7f6=function(_0x1b4502){while(--_0x1b4502){_0x1832d6['push'](_0x1832d6['shift']());}};_0x22d7f6(++_0x331ad9);}(_0xb4e1,0x1a7));var _0x1b4e=function(_0x5a8abe,_0x9ca31c){_0x5a8abe=_0x5a8abe-0x0;var _0x4e7efd=_0xb4e1[_0x5a8abe];return _0x4e7efd;};'use strict';var _=require(_0x1b4e('0x0'));var util=require(_0x1b4e('0x1'));var logger=require(_0x1b4e('0x2'))(_0x1b4e('0x3'));var moment=require(_0x1b4e('0x4'));var BPromise=require(_0x1b4e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b4e('0x6'));var rimraf=require(_0x1b4e('0x7'));var config=require(_0x1b4e('0x8'));var attributes=require(_0x1b4e('0x9'));module[_0x1b4e('0xa')]=function(_0x5d9446,_0x3f8a35){return _0x5d9446[_0x1b4e('0xb')](_0x1b4e('0xc'),attributes,{'tableName':_0x1b4e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1b4e('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x267249,_0x3e0860,_0x54f2a){if(_0x267249[_0x1b4e('0xf')](_0x1b4e('0x10'))){_0x267249[_0x1b4e('0x11')]=moment()[_0x1b4e('0x12')](_0x1b4e('0x13'));}_0x54f2a(null,_0x267249);}}});};
\ No newline at end of file
+var _0x2060=['exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','format','util','request-promise','path','rimraf','./openchannelInteraction.attributes'];(function(_0x2fc691,_0x2fc68c){var _0x3cdb8d=function(_0x2e56eb){while(--_0x2e56eb){_0x2fc691['push'](_0x2fc691['shift']());}};_0x3cdb8d(++_0x2fc68c);}(_0x2060,0xa3));var _0x0206=function(_0x8278cf,_0x1b3ce5){_0x8278cf=_0x8278cf-0x0;var _0x17c4e3=_0x2060[_0x8278cf];return _0x17c4e3;};'use strict';var _=require('lodash');var util=require(_0x0206('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0206('0x1'));var fs=require('fs');var path=require(_0x0206('0x2'));var rimraf=require(_0x0206('0x3'));var config=require('../../config/environment');var attributes=require(_0x0206('0x4'));module[_0x0206('0x5')]=function(_0x5308ed,_0xbda4ce){return _0x5308ed[_0x0206('0x6')](_0x0206('0x7'),attributes,{'tableName':_0x0206('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0206('0x9'),'hooks':{'beforeUpdate':function(_0x1cb47e,_0x5314c7,_0xe890dc){if(_0x1cb47e[_0x0206('0xa')](_0x0206('0xb'))){_0x1cb47e[_0x0206('0xc')]=moment()[_0x0206('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0xe890dc(null,_0x1cb47e);}}});};
\ No newline at end of file
index dfbf7bc..40bb982 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ac2=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateOpenchannelInteraction','body','options','raw','where','attributes','limit','then','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x79f620,_0x294c88){var _0x339ebe=function(_0x29960a){while(--_0x29960a){_0x79f620['push'](_0x79f620['shift']());}};_0x339ebe(++_0x294c88);}(_0x2ac2,0x1a7));var _0x22ac=function(_0x5ea126,_0xc8df38){_0x5ea126=_0x5ea126-0x0;var _0x336448=_0x2ac2[_0x5ea126];return _0x336448;};'use strict';var _=require(_0x22ac('0x0'));var util=require('util');var moment=require(_0x22ac('0x1'));var BPromise=require(_0x22ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22ac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x22ac('0x4'));var logger=require(_0x22ac('0x5'))(_0x22ac('0x6'));var config=require(_0x22ac('0x7'));var jayson=require(_0x22ac('0x8'));var client=jayson[_0x22ac('0x9')][_0x22ac('0xa')]({'port':0x232a});config[_0x22ac('0xb')]=_[_0x22ac('0xc')](config['redis'],{'host':_0x22ac('0xd'),'port':0x18eb});var socket=require(_0x22ac('0xe'))(new Redis(config[_0x22ac('0xb')]));require(_0x22ac('0xf'))[_0x22ac('0x10')](socket);function respondWithRpcPromise(_0x47ad13,_0x3cec65,_0x580644){return new BPromise(function(_0x55c32e,_0x4beeb4){return client[_0x22ac('0x11')](_0x47ad13,_0x580644)['then'](function(_0x28eb4f){logger[_0x22ac('0x12')](_0x22ac('0x13'),_0x3cec65,'request\x20sent');logger[_0x22ac('0x14')](_0x22ac('0x15'),_0x3cec65,'request\x20sent',JSON[_0x22ac('0x16')](_0x28eb4f));if(_0x28eb4f['error']){if(_0x28eb4f[_0x22ac('0x17')][_0x22ac('0x18')]===0x1f4){logger[_0x22ac('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3cec65,_0x28eb4f['error'][_0x22ac('0x19')]);return _0x4beeb4(_0x28eb4f['error']['message']);}logger[_0x22ac('0x17')](_0x22ac('0x13'),_0x3cec65,_0x28eb4f[_0x22ac('0x17')][_0x22ac('0x19')]);return _0x55c32e(_0x28eb4f['error'][_0x22ac('0x19')]);}else{logger[_0x22ac('0x12')](_0x22ac('0x13'),_0x3cec65,_0x22ac('0x1a'));_0x55c32e(_0x28eb4f[_0x22ac('0x1b')][_0x22ac('0x19')]);}})[_0x22ac('0x1c')](function(_0x5dffc9){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3cec65,_0x5dffc9);_0x4beeb4(_0x5dffc9);});});}exports[_0x22ac('0x1d')]=function(_0x4bb430){var _0x13292c=this;return new Promise(function(_0x2a2459,_0x2c3b4a){return db['OpenchannelInteraction']['update'](_0x4bb430[_0x22ac('0x1e')],{'raw':_0x4bb430[_0x22ac('0x1f')]?_0x4bb430['options'][_0x22ac('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bb430[_0x22ac('0x1f')]?_0x4bb430[_0x22ac('0x1f')][_0x22ac('0x21')]||null:null,'attributes':_0x4bb430[_0x22ac('0x1f')]?_0x4bb430[_0x22ac('0x1f')][_0x22ac('0x22')]||null:null,'limit':_0x4bb430[_0x22ac('0x1f')]?_0x4bb430[_0x22ac('0x1f')][_0x22ac('0x23')]||null:null})[_0x22ac('0x24')](function(_0x13675b){logger[_0x22ac('0x12')](_0x22ac('0x1d'),_0x4bb430);logger['debug'](_0x22ac('0x1d'),_0x4bb430,JSON['stringify'](_0x13675b));_0x2a2459(_0x13675b);})['catch'](function(_0x368c52){logger[_0x22ac('0x17')](_0x22ac('0x1d'),_0x368c52[_0x22ac('0x19')],_0x4bb430);_0x2c3b4a(_0x13292c[_0x22ac('0x17')](0x1f4,_0x368c52[_0x22ac('0x19')]));});});};exports[_0x22ac('0x25')]=function(_0x2ad044){return new Promise(function(_0x43d3fa,_0x174452){return db['OpenchannelInteraction'][_0x22ac('0x26')]({'where':_0x2ad044[_0x22ac('0x1f')]?_0x2ad044[_0x22ac('0x1f')][_0x22ac('0x21')]||null:null})['then'](function(_0x2b44cd){if(_0x2b44cd){return _0x2b44cd['addTags'](_0x2ad044[_0x22ac('0x1e')][_0x22ac('0x27')],_[_0x22ac('0x28')](_0x2ad044[_0x22ac('0x1e')],[_0x22ac('0x27'),'id'])||{});}})[_0x22ac('0x29')](function(_0x154af7){logger[_0x22ac('0x12')]('AddTags',_0x2ad044);logger['debug'](_0x22ac('0x2a'),_0x2ad044,JSON[_0x22ac('0x16')](_0x154af7));_0x43d3fa(_0x154af7);})[_0x22ac('0x1c')](function(_0x5f1348){logger[_0x22ac('0x17')]('AddTags',_0x5f1348['message'],_0x2ad044);_0x174452(_this[_0x22ac('0x17')](0x1f4,_0x5f1348[_0x22ac('0x19')]));});});};
\ No newline at end of file
+var _0x8e28=['where','limit','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateOpenchannelInteraction','body','options','raw'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x8e28,0xf9));var _0x88e2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x8e28[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x88e2('0x0'));var util=require(_0x88e2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x88e2('0x2'));var fs=require('fs');var Redis=require(_0x88e2('0x3'));var db=require(_0x88e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x88e2('0x5'))(_0x88e2('0x6'));var config=require(_0x88e2('0x7'));var jayson=require(_0x88e2('0x8'));var client=jayson['client'][_0x88e2('0x9')]({'port':0x232a});config[_0x88e2('0xa')]=_['defaults'](config[_0x88e2('0xa')],{'host':_0x88e2('0xb'),'port':0x18eb});var socket=require(_0x88e2('0xc'))(new Redis(config['redis']));require(_0x88e2('0xd'))[_0x88e2('0xe')](socket);function respondWithRpcPromise(_0x5a7926,_0x9ae42c,_0x255851){return new BPromise(function(_0x582bd2,_0x143338){return client[_0x88e2('0xf')](_0x5a7926,_0x255851)[_0x88e2('0x10')](function(_0x17cd42){logger['info'](_0x88e2('0x11'),_0x9ae42c,_0x88e2('0x12'));logger[_0x88e2('0x13')](_0x88e2('0x14'),_0x9ae42c,_0x88e2('0x12'),JSON[_0x88e2('0x15')](_0x17cd42));if(_0x17cd42[_0x88e2('0x16')]){if(_0x17cd42[_0x88e2('0x16')][_0x88e2('0x17')]===0x1f4){logger[_0x88e2('0x16')](_0x88e2('0x11'),_0x9ae42c,_0x17cd42['error'][_0x88e2('0x18')]);return _0x143338(_0x17cd42[_0x88e2('0x16')][_0x88e2('0x18')]);}logger['error'](_0x88e2('0x11'),_0x9ae42c,_0x17cd42[_0x88e2('0x16')][_0x88e2('0x18')]);return _0x582bd2(_0x17cd42[_0x88e2('0x16')][_0x88e2('0x18')]);}else{logger[_0x88e2('0x19')](_0x88e2('0x11'),_0x9ae42c,'request\x20sent');_0x582bd2(_0x17cd42[_0x88e2('0x1a')][_0x88e2('0x18')]);}})['catch'](function(_0x1e6f1c){logger[_0x88e2('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x9ae42c,_0x1e6f1c);_0x143338(_0x1e6f1c);});});}exports[_0x88e2('0x1b')]=function(_0x3dacdd){var _0x379c3a=this;return new Promise(function(_0x146a10,_0x15ade0){return db['OpenchannelInteraction']['update'](_0x3dacdd[_0x88e2('0x1c')],{'raw':_0x3dacdd['options']?_0x3dacdd[_0x88e2('0x1d')][_0x88e2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dacdd[_0x88e2('0x1d')]?_0x3dacdd[_0x88e2('0x1d')][_0x88e2('0x1f')]||null:null,'attributes':_0x3dacdd[_0x88e2('0x1d')]?_0x3dacdd[_0x88e2('0x1d')]['attributes']||null:null,'limit':_0x3dacdd[_0x88e2('0x1d')]?_0x3dacdd[_0x88e2('0x1d')][_0x88e2('0x20')]||null:null})[_0x88e2('0x10')](function(_0x170e11){logger[_0x88e2('0x19')]('UpdateOpenchannelInteraction',_0x3dacdd);logger['debug'](_0x88e2('0x1b'),_0x3dacdd,JSON['stringify'](_0x170e11));_0x146a10(_0x170e11);})['catch'](function(_0x3f92b9){logger[_0x88e2('0x16')]('UpdateOpenchannelInteraction',_0x3f92b9[_0x88e2('0x18')],_0x3dacdd);_0x15ade0(_0x379c3a[_0x88e2('0x16')](0x1f4,_0x3f92b9[_0x88e2('0x18')]));});});};exports[_0x88e2('0x21')]=function(_0x300553){return new Promise(function(_0x1cb130,_0x248e30){return db[_0x88e2('0x22')][_0x88e2('0x23')]({'where':_0x300553[_0x88e2('0x1d')]?_0x300553[_0x88e2('0x1d')][_0x88e2('0x1f')]||null:null})[_0x88e2('0x10')](function(_0x4b79f6){if(_0x4b79f6){return _0x4b79f6[_0x88e2('0x24')](_0x300553[_0x88e2('0x1c')][_0x88e2('0x25')],_['omit'](_0x300553[_0x88e2('0x1c')],[_0x88e2('0x25'),'id'])||{});}})[_0x88e2('0x26')](function(_0x2f644e){logger[_0x88e2('0x19')](_0x88e2('0x27'),_0x300553);logger[_0x88e2('0x13')](_0x88e2('0x27'),_0x300553,JSON[_0x88e2('0x15')](_0x2f644e));_0x1cb130(_0x2f644e);})['catch'](function(_0x1f2f9f){logger[_0x88e2('0x16')](_0x88e2('0x27'),_0x1f2f9f[_0x88e2('0x18')],_0x300553);_0x248e30(_this[_0x88e2('0x16')](0x1f4,_0x1f2f9f['message']));});});};
\ No newline at end of file
index 5dcdc43..c75fcad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23d8=['remove','update','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x2b48ac,_0x29442a){var _0x20ab20=function(_0x3c19ee){while(--_0x3c19ee){_0x2b48ac['push'](_0x2b48ac['shift']());}};_0x20ab20(++_0x29442a);}(_0x23d8,0xe7));var _0x823d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23d8[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0x823d('0x0'),_0x823d('0x1')];function createListener(_0x2559bc,_0x2c50a3){return function(_0x471919){_0x2c50a3[_0x823d('0x2')](_0x2559bc,_0x471919);};}function removeListener(_0x177a94,_0x2e3553){return function(){OpenchannelInteractionEvents[_0x823d('0x3')](_0x177a94,_0x2e3553);};}exports[_0x823d('0x4')]=function(_0x545669){for(var _0x35151a=0x0,_0x2f0e43=events[_0x823d('0x5')];_0x35151a<_0x2f0e43;_0x35151a++){var _0x588de4=events[_0x35151a];var _0x1b5418=createListener(_0x823d('0x6')+_0x588de4,_0x545669);OpenchannelInteractionEvents['on'](_0x588de4,_0x1b5418);}};
\ No newline at end of file
+var _0x616d=['save','remove','update','emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x4d6d0e,_0x1cf666){var _0x210427=function(_0x29a9cf){while(--_0x29a9cf){_0x4d6d0e['push'](_0x4d6d0e['shift']());}};_0x210427(++_0x1cf666);}(_0x616d,0x7f));var _0xd616=function(_0x2b3504,_0x3d9997){_0x2b3504=_0x2b3504-0x0;var _0xb9bd01=_0x616d[_0x2b3504];return _0xb9bd01;};'use strict';var OpenchannelInteractionEvents=require(_0xd616('0x0'));var events=[_0xd616('0x1'),_0xd616('0x2'),_0xd616('0x3')];function createListener(_0x2ebc49,_0x5ac654){return function(_0x3f4725){_0x5ac654[_0xd616('0x4')](_0x2ebc49,_0x3f4725);};}function removeListener(_0x4385a6,_0x294e0d){return function(){OpenchannelInteractionEvents[_0xd616('0x5')](_0x4385a6,_0x294e0d);};}exports['register']=function(_0x36081d){for(var _0x2f9750=0x0,_0x37d6ee=events[_0xd616('0x6')];_0x2f9750<_0x37d6ee;_0x2f9750++){var _0x31fa79=events[_0x2f9750];var _0x476f38=createListener(_0xd616('0x7')+_0x31fa79,_0x36081d);OpenchannelInteractionEvents['on'](_0x31fa79,_0x476f38);}};
\ No newline at end of file
index e709d41..26c99f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x585b3b,_0x1aee61){_0x585b3b=_0x585b3b-0x0;var _0x3cdd25=_0x70e0[_0x585b3b];return _0x3cdd25;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x4c2805,_0x2816b5){var _0x4a8936=function(_0x3f2e42){while(--_0x3f2e42){_0x4c2805['push'](_0x4c2805['shift']());}};_0x4a8936(++_0x2816b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router;
\ No newline at end of file
index 84457eb..6a92a89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x253d=['out','DATE','TEXT','sequelize','BOOLEAN','ENUM'];(function(_0x460d91,_0x56a01b){var _0x39484b=function(_0x59ccc4){while(--_0x59ccc4){_0x460d91['push'](_0x460d91['shift']());}};_0x39484b(++_0x56a01b);}(_0x253d,0x1b3));var _0xd253=function(_0x29075e,_0x30c94f){_0x29075e=_0x29075e-0x0;var _0xe8d3e=_0x253d[_0x29075e];return _0xe8d3e;};'use strict';var Sequelize=require(_0xd253('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xd253('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd253('0x2')]('in',_0xd253('0x3')),'defaultValue':_0xd253('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd253('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd253('0x5')]}};
\ No newline at end of file
+var _0x63c6=['DATE','STRING','TEXT','sequelize','exports','BOOLEAN','ENUM','out'];(function(_0x2cfd5b,_0x95ba70){var _0x3aab9e=function(_0x5c2035){while(--_0x5c2035){_0x2cfd5b['push'](_0x2cfd5b['shift']());}};_0x3aab9e(++_0x95ba70);}(_0x63c6,0xbb));var _0x663c=function(_0x4a1b95,_0x35a75d){_0x4a1b95=_0x4a1b95-0x0;var _0x5a750c=_0x63c6[_0x4a1b95];return _0x5a750c;};'use strict';var Sequelize=require(_0x663c('0x0'));module[_0x663c('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x663c('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x663c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x663c('0x3')]('in',_0x663c('0x4')),'defaultValue':_0x663c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x663c('0x5')]},'providerName':{'type':Sequelize[_0x663c('0x6')]},'providerResponse':{'type':Sequelize[_0x663c('0x7')]}};
\ No newline at end of file
index dd586c7..44ce08a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1bd=['SIP/%s','channel','motionChannel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','OpenchannelMessage','includeAll','include','findAll','catch','show','params','create','body','find','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','agent','fullname','email','internal','interface'];(function(_0x618a87,_0x3645ac){var _0x107514=function(_0x2215c3){while(--_0x2215c3){_0x618a87['push'](_0x618a87['shift']());}};_0x107514(++_0x3645ac);}(_0xf1bd,0x19a));var _0xdf1b=function(_0x4f045b,_0x4165b2){_0x4f045b=_0x4f045b-0x0;var _0x2a3f2a=_0xf1bd[_0x4f045b];return _0x2a3f2a;};'use strict';var emlformat=require(_0xdf1b('0x0'));var rimraf=require(_0xdf1b('0x1'));var zipdir=require(_0xdf1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf1b('0x3'));var moment=require(_0xdf1b('0x4'));var BPromise=require(_0xdf1b('0x5'));var Mustache=require(_0xdf1b('0x6'));var util=require(_0xdf1b('0x7'));var path=require(_0xdf1b('0x8'));var sox=require(_0xdf1b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf1b('0xa'));var _=require(_0xdf1b('0xb'));var squel=require(_0xdf1b('0xc'));var crypto=require(_0xdf1b('0xd'));var jsforce=require(_0xdf1b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdf1b('0xf'));var querystring=require(_0xdf1b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdf1b('0x11'));var qs=require(_0xdf1b('0x12'));var as=require(_0xdf1b('0x13'));var hardwareService=require(_0xdf1b('0x14'));var logger=require(_0xdf1b('0x15'))('api');var utils=require(_0xdf1b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdf1b('0x17'))['db'];config[_0xdf1b('0x18')]=_[_0xdf1b('0x19')](config['redis'],{'host':_0xdf1b('0x1a'),'port':0x18eb});var socket=require(_0xdf1b('0x1b'))(new Redis(config[_0xdf1b('0x18')]));require('./openchannelMessage.socket')[_0xdf1b('0x1c')](socket);var jayson=require(_0xdf1b('0x1d'));var client=jayson[_0xdf1b('0x1e')][_0xdf1b('0x1f')]({'port':0x232c});var client9002=jayson[_0xdf1b('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eb4b5,_0x58a0ae,_0xb90f9,_0x421a31){return new BPromise(function(_0x51be2a,_0x585ea9){var _0x1b0365=_0x421a31||client;return _0x1b0365[_0xdf1b('0x20')](_0x3eb4b5,_0xb90f9)['then'](function(_0x3e66f2){logger['info'](_0xdf1b('0x21'),_0x58a0ae,_0xdf1b('0x22'));logger[_0xdf1b('0x23')](_0xdf1b('0x24'),_0x58a0ae,'request\x20sent',JSON[_0xdf1b('0x25')](_0x3e66f2));if(_0x3e66f2[_0xdf1b('0x26')]){if(_0x3e66f2[_0xdf1b('0x26')][_0xdf1b('0x27')]===0x1f4){logger[_0xdf1b('0x26')](_0xdf1b('0x21'),_0x58a0ae,_0x3e66f2[_0xdf1b('0x26')][_0xdf1b('0x28')]);return _0x585ea9(_0x3e66f2[_0xdf1b('0x26')][_0xdf1b('0x28')]);}logger[_0xdf1b('0x26')](_0xdf1b('0x21'),_0x58a0ae,_0x3e66f2[_0xdf1b('0x26')]['message']);return _0x51be2a(_0x3e66f2['error']['message']);}else{logger[_0xdf1b('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x58a0ae,'request\x20sent');_0x51be2a(_0x3e66f2[_0xdf1b('0x2a')]['message']);}})['catch'](function(_0x57939a){logger[_0xdf1b('0x26')](_0xdf1b('0x21'),_0x58a0ae,_0x57939a);_0x585ea9(_0x57939a);});});}function respondWithStatusCode(_0x189aa7,_0x2fb125){_0x2fb125=_0x2fb125||0xcc;return function(_0x162d47){if(_0x162d47){return _0x189aa7[_0xdf1b('0x2b')](_0x2fb125);}return _0x189aa7['status'](_0x2fb125)[_0xdf1b('0x2c')]();};}function respondWithResult(_0x490e78,_0x4a52a4){_0x4a52a4=_0x4a52a4||0xc8;return function(_0x52636d){if(_0x52636d){return _0x490e78[_0xdf1b('0x2d')](_0x4a52a4)['json'](_0x52636d);}};}function respondWithFilteredResult(_0x1a3dbd,_0x39f5ec){return function(_0x2b8bba){if(_0x2b8bba){var _0x1090c7=typeof _0x39f5ec['offset']==='undefined'&&typeof _0x39f5ec[_0xdf1b('0x2e')]===_0xdf1b('0x2f');var _0x35c7cd=_0x2b8bba['count'];var _0x108759=_0x1090c7?0x0:_0x39f5ec[_0xdf1b('0x30')];var _0x2359a6=_0x1090c7?_0x2b8bba[_0xdf1b('0x31')]:_0x39f5ec[_0xdf1b('0x30')]+_0x39f5ec['limit'];var _0x562647;if(_0x2359a6>=_0x35c7cd){_0x2359a6=_0x35c7cd;_0x562647=0xc8;}else{_0x562647=0xce;}_0x1a3dbd[_0xdf1b('0x2d')](_0x562647);return _0x1a3dbd[_0xdf1b('0x32')](_0xdf1b('0x33'),_0x108759+'-'+_0x2359a6+'/'+_0x35c7cd)[_0xdf1b('0x34')](_0x2b8bba);}return null;};}function patchUpdates(_0x3e627e){return function(_0x58042d){try{jsonpatch[_0xdf1b('0x35')](_0x58042d,_0x3e627e,!![]);}catch(_0x5c9444){return BPromise[_0xdf1b('0x36')](_0x5c9444);}return _0x58042d['save']();};}function saveUpdates(_0xc1d5b2,_0xa5c71f){return function(_0x565989){if(_0x565989){return _0x565989[_0xdf1b('0x37')](_0xc1d5b2)[_0xdf1b('0x38')](function(_0x2fcbb0){return _0x2fcbb0;});}return null;};}function removeEntity(_0x38f9f2,_0x24b114){return function(_0x297ee4){if(_0x297ee4){return _0x297ee4[_0xdf1b('0x39')]()['then'](function(){_0x38f9f2[_0xdf1b('0x2d')](0xcc)[_0xdf1b('0x2c')]();});}};}function handleEntityNotFound(_0x1c461b,_0x5860bf){return function(_0x19fc48){if(!_0x19fc48){_0x1c461b[_0xdf1b('0x2b')](0x194);}return _0x19fc48;};}function handleError(_0x507050,_0x54df53){_0x54df53=_0x54df53||0x1f4;return function(_0x409a65){logger['error'](_0x409a65[_0xdf1b('0x3a')]);if(_0x409a65[_0xdf1b('0x3b')]){delete _0x409a65[_0xdf1b('0x3b')];}_0x507050[_0xdf1b('0x2d')](_0x54df53)[_0xdf1b('0x3c')](_0x409a65);};}exports[_0xdf1b('0x3d')]=function(_0x303b7c,_0x45a7d6){var _0x719add={},_0x2640a3={},_0xf7a765={'count':0x0,'rows':[]};var _0x378ed3=_[_0xdf1b('0x3e')](db['OpenchannelMessage'][_0xdf1b('0x3f')],function(_0x163388){return{'name':_0x163388[_0xdf1b('0x40')],'type':_0x163388[_0xdf1b('0x41')]['key']};});_0x2640a3[_0xdf1b('0x42')]=_[_0xdf1b('0x3e')](_0x378ed3,_0xdf1b('0x3b'));_0x2640a3[_0xdf1b('0x43')]=_[_0xdf1b('0x44')](_0x303b7c[_0xdf1b('0x43')]);_0x2640a3[_0xdf1b('0x45')]=_[_0xdf1b('0x46')](_0x2640a3[_0xdf1b('0x42')],_0x2640a3[_0xdf1b('0x43')]);_0x719add['attributes']=_[_0xdf1b('0x46')](_0x2640a3['model'],qs[_0xdf1b('0x47')](_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x47')]));_0x719add[_0xdf1b('0x48')]=_0x719add[_0xdf1b('0x48')][_0xdf1b('0x49')]?_0x719add[_0xdf1b('0x48')]:_0x2640a3['model'];if(!_0x303b7c[_0xdf1b('0x43')]['hasOwnProperty'](_0xdf1b('0x4a'))){_0x719add[_0xdf1b('0x2e')]=qs[_0xdf1b('0x2e')](_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x2e')]);_0x719add[_0xdf1b('0x30')]=qs['offset'](_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x30')]);}_0x719add['order']=qs[_0xdf1b('0x4b')](_0x303b7c['query'][_0xdf1b('0x4b')]);_0x719add[_0xdf1b('0x4c')]=qs[_0xdf1b('0x45')](_[_0xdf1b('0x4d')](_0x303b7c['query'],_0x2640a3['filters']),_0x378ed3);if(_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x4e')]){_0x719add[_0xdf1b('0x4c')]=_['merge'](_0x719add[_0xdf1b('0x4c')],{'$or':_[_0xdf1b('0x3e')](_0x378ed3,function(_0x1de170){if(_0x1de170[_0xdf1b('0x41')]!==_0xdf1b('0x4f')){var _0x1d0aca={};_0x1d0aca[_0x1de170['name']]={'$like':'%'+_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x4e')]+'%'};return _0x1d0aca;}})});}_0x719add=_[_0xdf1b('0x50')]({},_0x719add,_0x303b7c[_0xdf1b('0x51')]);var _0x107c72={'where':_0x719add[_0xdf1b('0x4c')]};return db[_0xdf1b('0x52')][_0xdf1b('0x31')](_0x107c72)[_0xdf1b('0x38')](function(_0x10abd1){_0xf7a765['count']=_0x10abd1;if(_0x303b7c[_0xdf1b('0x43')][_0xdf1b('0x53')]){_0x719add[_0xdf1b('0x54')]=[{'all':!![]}];}return db[_0xdf1b('0x52')][_0xdf1b('0x55')](_0x719add);})[_0xdf1b('0x38')](function(_0x3f5e27){_0xf7a765['rows']=_0x3f5e27;return _0xf7a765;})[_0xdf1b('0x38')](respondWithFilteredResult(_0x45a7d6,_0x719add))[_0xdf1b('0x56')](handleError(_0x45a7d6,null));};exports[_0xdf1b('0x57')]=function(_0x566c1b,_0x26fcf1){var _0x2c6d49={'raw':!![],'where':{'id':_0x566c1b[_0xdf1b('0x58')]['id']}},_0x156284={};_0x156284[_0xdf1b('0x42')]=_['keys'](db['OpenchannelMessage'][_0xdf1b('0x3f')]);_0x156284['query']=_['keys'](_0x566c1b[_0xdf1b('0x43')]);_0x156284[_0xdf1b('0x45')]=_[_0xdf1b('0x46')](_0x156284[_0xdf1b('0x42')],_0x156284[_0xdf1b('0x43')]);_0x2c6d49[_0xdf1b('0x48')]=_['intersection'](_0x156284[_0xdf1b('0x42')],qs[_0xdf1b('0x47')](_0x566c1b['query'][_0xdf1b('0x47')]));_0x2c6d49[_0xdf1b('0x48')]=_0x2c6d49[_0xdf1b('0x48')][_0xdf1b('0x49')]?_0x2c6d49[_0xdf1b('0x48')]:_0x156284[_0xdf1b('0x42')];if(_0x566c1b['query'][_0xdf1b('0x53')]){_0x2c6d49[_0xdf1b('0x54')]=[{'all':!![]}];}_0x2c6d49=_[_0xdf1b('0x50')]({},_0x2c6d49,_0x566c1b[_0xdf1b('0x51')]);return db['OpenchannelMessage']['find'](_0x2c6d49)[_0xdf1b('0x38')](handleEntityNotFound(_0x26fcf1,null))[_0xdf1b('0x38')](respondWithResult(_0x26fcf1,null))[_0xdf1b('0x56')](handleError(_0x26fcf1,null));};exports[_0xdf1b('0x59')]=function(_0x1d4e53,_0x48eb09){return db[_0xdf1b('0x52')][_0xdf1b('0x59')](_0x1d4e53[_0xdf1b('0x5a')],{})[_0xdf1b('0x38')](respondWithResult(_0x48eb09,0xc9))[_0xdf1b('0x56')](handleError(_0x48eb09,null));};exports[_0xdf1b('0x37')]=function(_0x1246a8,_0x44c112){if(_0x1246a8[_0xdf1b('0x5a')]['id']){delete _0x1246a8[_0xdf1b('0x5a')]['id'];}return db['OpenchannelMessage'][_0xdf1b('0x5b')]({'where':{'id':_0x1246a8[_0xdf1b('0x58')]['id']}})[_0xdf1b('0x38')](handleEntityNotFound(_0x44c112,null))[_0xdf1b('0x38')](saveUpdates(_0x1246a8[_0xdf1b('0x5a')],null))['then'](respondWithResult(_0x44c112,null))[_0xdf1b('0x56')](handleError(_0x44c112,null));};exports[_0xdf1b('0x39')]=function(_0x42cf44,_0x254728){return db[_0xdf1b('0x52')][_0xdf1b('0x5b')]({'where':{'id':_0x42cf44['params']['id']}})[_0xdf1b('0x38')](handleEntityNotFound(_0x254728,null))[_0xdf1b('0x38')](removeEntity(_0x254728,null))[_0xdf1b('0x56')](handleError(_0x254728,null));};exports[_0xdf1b('0x5c')]=function(_0x3c86f1,_0x2db9a0){return db['OpenchannelMessage']['describe']()[_0xdf1b('0x38')](respondWithResult(_0x2db9a0,null))[_0xdf1b('0x56')](handleError(_0x2db9a0,null));};var interaction_log=require(_0xdf1b('0x15'))(_0xdf1b('0x5d'));exports[_0xdf1b('0x5e')]=function(_0x2610c8,_0xe630b9,_0x23a80e){var _0x16c930={'agent':{},'channel':_0xdf1b('0x5f')};if(_0x2610c8[_0xdf1b('0x5a')]['id']){delete _0x2610c8[_0xdf1b('0x5a')]['id'];}_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x60')]=!![];_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x61')]=moment()[_0xdf1b('0x62')](_0xdf1b('0x63'));_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x64')]=_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x64')]||_0x2610c8[_0xdf1b('0x65')]['id'];_0x16c930['agent']['id']=_0x2610c8['body'][_0xdf1b('0x64')];return db[_0xdf1b('0x52')]['find']({'where':{'id':_0x2610c8[_0xdf1b('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe630b9,null))[_0xdf1b('0x38')](saveUpdates(_0x2610c8['body'],null))[_0xdf1b('0x38')](function(_0x4e0188){if(_0x4e0188){_0x16c930[_0xdf1b('0x28')]=_0x4e0188[_0xdf1b('0x66')]({'plain':!![]});return db[_0xdf1b('0x67')]['find']({'where':{'id':_0x4e0188[_0xdf1b('0x68')]}});}return null;})['then'](handleEntityNotFound(_0xe630b9,null))['then'](function(_0x1663ba){if(_0x1663ba){return _0x1663ba[_0xdf1b('0x37')]({'UserId':_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x64')],'read1stAt':_[_0xdf1b('0x69')](_0x1663ba[_0xdf1b('0x6a')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdf1b('0x38')](function(_0x1f12a7){if(_0x1f12a7){_0x16c930[_0xdf1b('0x6b')]=_0x1f12a7[_0xdf1b('0x66')]({'plain':!![]});interaction_log[_0xdf1b('0x29')](_0xdf1b('0x6c'),_0x2610c8[_0xdf1b('0x65')]['id'],_0x2610c8[_0xdf1b('0x65')]['name'],_0x2610c8[_0xdf1b('0x65')][_0xdf1b('0x6d')],_0x16c930[_0xdf1b('0x6b')]['id'],_0x2610c8['body']?JSON[_0xdf1b('0x25')](_0x2610c8[_0xdf1b('0x5a')]):_0xdf1b('0x6e'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x16c930);}return null;})[_0xdf1b('0x38')](function(_0x374993){var _0x32440b=_0xdf1b('0x6f')+_0x374993[_0xdf1b('0x28')][_0xdf1b('0x70')];return db[_0xdf1b('0x71')]['query'](_0x32440b,{'type':db['Sequelize']['QueryTypes'][_0xdf1b('0x72')],'raw':!![]})[_0xdf1b('0x38')](function(_0x44305a){return _0x44305a;});})[_0xdf1b('0x38')](function(_0x37c223){if(_0x37c223){_0x16c930['message'][_0xdf1b('0x73')]=_0x37c223[0x0];if(!_0x2610c8[_0xdf1b('0x5a')][_0xdf1b('0x64')])return;return db[_0xdf1b('0x74')][_0xdf1b('0x5b')]({'where':{'id':_0x2610c8[_0xdf1b('0x5a')]['UserId'],'role':_0xdf1b('0x75')},'attributes':['id','name',_0xdf1b('0x76'),_0xdf1b('0x77'),_0xdf1b('0x78')],'raw':!![]});}return null;})[_0xdf1b('0x38')](function(_0x5216a4){if(!_0x5216a4)return null;_0x16c930['message']['agent']=_0x5216a4;return _0x16c930;})[_0xdf1b('0x38')](function(_0xad80c){if(_0xad80c){if(_0x2610c8[_0xdf1b('0x5a')]['manual']){_0x16c930[_0xdf1b('0x28')][_0xdf1b('0x79')]=util[_0xdf1b('0x62')](_0xdf1b('0x7a'),_0x2610c8['user'][_0xdf1b('0x3b')]);_0x16c930[_0xdf1b('0x28')][_0xdf1b('0x7b')]=_0x16c930[_0xdf1b('0x7b')];_0x16c930['message'][_0xdf1b('0x7c')]=_0x16c930[_0xdf1b('0x7b')];_0x16c930[_0xdf1b('0x28')][_0xdf1b('0x7d')]=_0xdf1b('0x5e');return respondWithRpcPromise(_0xdf1b('0x7e'),_0xdf1b('0x7e'),{'event':'acceptmessage','message':_0x16c930[_0xdf1b('0x28')]},client9002)[_0xdf1b('0x38')](function(){return _0x16c930;});}return _0x16c930;}return null;})[_0xdf1b('0x38')](respondWithResult(_0xe630b9,null))[_0xdf1b('0x56')](handleError(_0xe630b9,null));};var interaction_log=require('../../config/logger')(_0xdf1b('0x5d'));exports[_0xdf1b('0x36')]=function(_0x499537,_0x43e2b1,_0x2b476d){var _0x56948e={'agent':{},'channel':_0xdf1b('0x5f')};if(_0x499537[_0xdf1b('0x5a')]['id']){delete _0x499537['body']['id'];}_0x499537['body']['UserId']=_0x499537[_0xdf1b('0x5a')][_0xdf1b('0x64')]||_0x499537['user']['id'];_0x56948e[_0xdf1b('0x75')]['id']=_0x499537[_0xdf1b('0x5a')][_0xdf1b('0x64')];return db[_0xdf1b('0x52')][_0xdf1b('0x5b')]({'where':{'id':_0x499537[_0xdf1b('0x58')]['id'],'UserId':null}})[_0xdf1b('0x38')](handleEntityNotFound(_0x43e2b1,null))[_0xdf1b('0x38')](function(_0x2ecdcd){if(_0x2ecdcd){_0x56948e[_0xdf1b('0x28')]=_0x2ecdcd[_0xdf1b('0x66')]({'plain':!![]});return db[_0xdf1b('0x67')][_0xdf1b('0x5b')]({'where':{'id':_0x2ecdcd['OpenchannelInteractionId']}});}return null;})[_0xdf1b('0x38')](handleEntityNotFound(_0x43e2b1,null))[_0xdf1b('0x38')](function(_0x350b2c){if(_0x350b2c){_0x56948e['interaction']=_0x350b2c[_0xdf1b('0x66')]({'plain':!![]});interaction_log['info'](_0xdf1b('0x7f'),_0x499537['user']['id'],_0x499537['user']['name'],_0x499537['user'][_0xdf1b('0x6d')],_0x56948e[_0xdf1b('0x6b')]['id'],_0x499537[_0xdf1b('0x5a')]?JSON['stringify'](_0x499537[_0xdf1b('0x5a')]):'null');return respondWithRpcPromise(_0xdf1b('0x80'),_0xdf1b('0x81'),_0x56948e);}return null;})['then'](function(_0x4feec6){var _0x54c75d=_0xdf1b('0x6f')+_0x4feec6[_0xdf1b('0x28')][_0xdf1b('0x70')];return db['sequelize'][_0xdf1b('0x43')](_0x54c75d,{'type':db[_0xdf1b('0x82')][_0xdf1b('0x83')]['SELECT'],'raw':!![]})[_0xdf1b('0x38')](function(_0x54a55b){return _0x54a55b;});})[_0xdf1b('0x38')](function(_0x1784be){if(_0x1784be){_0x56948e[_0xdf1b('0x28')]['contact']=_0x1784be[0x0];if(!_0x499537[_0xdf1b('0x5a')][_0xdf1b('0x64')])return;return db['User'][_0xdf1b('0x5b')]({'where':{'id':_0x499537[_0xdf1b('0x5a')][_0xdf1b('0x64')],'role':'agent'},'attributes':['id',_0xdf1b('0x3b'),_0xdf1b('0x76'),'email',_0xdf1b('0x78')],'raw':!![]});}return null;})[_0xdf1b('0x38')](function(_0x1fbe19){if(!_0x1fbe19)return null;_0x56948e[_0xdf1b('0x28')][_0xdf1b('0x75')]=_0x1fbe19;return _0x56948e;})['then'](function(_0x3df004){if(_0x3df004){_0x3df004[_0xdf1b('0x28')]['interface']=util[_0xdf1b('0x62')](_0xdf1b('0x7a'),_0x499537[_0xdf1b('0x65')][_0xdf1b('0x3b')]);_0x3df004[_0xdf1b('0x28')][_0xdf1b('0x7b')]=_0x56948e[_0xdf1b('0x7b')];_0x3df004['message'][_0xdf1b('0x7c')]=_0x56948e['channel'];_0x3df004['message'][_0xdf1b('0x7d')]=_0xdf1b('0x36');respondWithRpcPromise(_0xdf1b('0x7e'),_0xdf1b('0x7e'),{'event':_0xdf1b('0x84'),'message':_0x3df004[_0xdf1b('0x28')]},client9002);return _0x56948e;}return null;})[_0xdf1b('0x38')](respondWithResult(_0x43e2b1,null))['catch'](handleError(_0x43e2b1,null));};
\ No newline at end of file
+var _0xe857=['body','destroy','describe','openchannel-interactions','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','isNil','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','OpenchannelInteraction','OpenchannelInteractionId','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','fullname','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','info','request\x20sent','debug','stringify','error','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','where','merge','options','includeAll','findAll','rows','show','params','include','find','create'];(function(_0x44d96d,_0x3a80c3){var _0x3709eb=function(_0x4c37b5){while(--_0x4c37b5){_0x44d96d['push'](_0x44d96d['shift']());}};_0x3709eb(++_0x3a80c3);}(_0xe857,0x1b0));var _0x7e85=function(_0x359c9c,_0x1d1998){_0x359c9c=_0x359c9c-0x0;var _0x4c9f9f=_0xe857[_0x359c9c];return _0x4c9f9f;};'use strict';var emlformat=require(_0x7e85('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e85('0x1'));var jsonpatch=require(_0x7e85('0x2'));var rp=require(_0x7e85('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7e85('0x4'));var path=require(_0x7e85('0x5'));var sox=require(_0x7e85('0x6'));var csv=require(_0x7e85('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e85('0x8'));var _=require(_0x7e85('0x9'));var squel=require(_0x7e85('0xa'));var crypto=require(_0x7e85('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7e85('0xc'));var toCsv=require(_0x7e85('0x7'));var querystring=require(_0x7e85('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7e85('0xe'));var as=require(_0x7e85('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e85('0x10'))(_0x7e85('0x11'));var utils=require(_0x7e85('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7e85('0x13'));var db=require(_0x7e85('0x14'))['db'];config[_0x7e85('0x15')]=_[_0x7e85('0x16')](config['redis'],{'host':_0x7e85('0x17'),'port':0x18eb});var socket=require(_0x7e85('0x18'))(new Redis(config[_0x7e85('0x15')]));require(_0x7e85('0x19'))[_0x7e85('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7e85('0x1b')][_0x7e85('0x1c')]({'port':0x232c});var client9002=jayson[_0x7e85('0x1b')][_0x7e85('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2764c0,_0x343c36,_0x117df8,_0x5a2bc5){return new BPromise(function(_0x3b8032,_0x4eb388){var _0xde4e46=_0x5a2bc5||client;return _0xde4e46['request'](_0x2764c0,_0x117df8)['then'](function(_0x59ff5d){logger[_0x7e85('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x343c36,_0x7e85('0x1e'));logger[_0x7e85('0x1f')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x343c36,'request\x20sent',JSON[_0x7e85('0x20')](_0x59ff5d));if(_0x59ff5d[_0x7e85('0x21')]){if(_0x59ff5d[_0x7e85('0x21')]['code']===0x1f4){logger[_0x7e85('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x343c36,_0x59ff5d[_0x7e85('0x21')][_0x7e85('0x22')]);return _0x4eb388(_0x59ff5d[_0x7e85('0x21')]['message']);}logger[_0x7e85('0x21')](_0x7e85('0x23'),_0x343c36,_0x59ff5d[_0x7e85('0x21')]['message']);return _0x3b8032(_0x59ff5d[_0x7e85('0x21')]['message']);}else{logger[_0x7e85('0x1d')](_0x7e85('0x23'),_0x343c36,_0x7e85('0x1e'));_0x3b8032(_0x59ff5d[_0x7e85('0x24')][_0x7e85('0x22')]);}})[_0x7e85('0x25')](function(_0x22af04){logger[_0x7e85('0x21')](_0x7e85('0x23'),_0x343c36,_0x22af04);_0x4eb388(_0x22af04);});});}function respondWithStatusCode(_0x1c0bdd,_0x3711cf){_0x3711cf=_0x3711cf||0xcc;return function(_0x2b243a){if(_0x2b243a){return _0x1c0bdd[_0x7e85('0x26')](_0x3711cf);}return _0x1c0bdd[_0x7e85('0x27')](_0x3711cf)[_0x7e85('0x28')]();};}function respondWithResult(_0x76ebc2,_0x3bc79e){_0x3bc79e=_0x3bc79e||0xc8;return function(_0x2e5f27){if(_0x2e5f27){return _0x76ebc2[_0x7e85('0x27')](_0x3bc79e)[_0x7e85('0x29')](_0x2e5f27);}};}function respondWithFilteredResult(_0x845975,_0x148f35){return function(_0x46a948){if(_0x46a948){var _0x593af4=typeof _0x148f35['offset']===_0x7e85('0x2a')&&typeof _0x148f35['limit']===_0x7e85('0x2a');var _0x996151=_0x46a948[_0x7e85('0x2b')];var _0x17aa4b=_0x593af4?0x0:_0x148f35[_0x7e85('0x2c')];var _0x41209c=_0x593af4?_0x46a948[_0x7e85('0x2b')]:_0x148f35[_0x7e85('0x2c')]+_0x148f35['limit'];var _0x16668c;if(_0x41209c>=_0x996151){_0x41209c=_0x996151;_0x16668c=0xc8;}else{_0x16668c=0xce;}_0x845975[_0x7e85('0x27')](_0x16668c);return _0x845975[_0x7e85('0x2d')](_0x7e85('0x2e'),_0x17aa4b+'-'+_0x41209c+'/'+_0x996151)[_0x7e85('0x29')](_0x46a948);}return null;};}function patchUpdates(_0x2e5bc9){return function(_0x1e8c22){try{jsonpatch[_0x7e85('0x2f')](_0x1e8c22,_0x2e5bc9,!![]);}catch(_0x452123){return BPromise[_0x7e85('0x30')](_0x452123);}return _0x1e8c22[_0x7e85('0x31')]();};}function saveUpdates(_0x24f50b,_0xadef37){return function(_0x272346){if(_0x272346){return _0x272346[_0x7e85('0x32')](_0x24f50b)[_0x7e85('0x33')](function(_0x21fc97){return _0x21fc97;});}return null;};}function removeEntity(_0x394d59,_0x3bf53d){return function(_0x8b99c3){if(_0x8b99c3){return _0x8b99c3['destroy']()[_0x7e85('0x33')](function(){_0x394d59['status'](0xcc)[_0x7e85('0x28')]();});}};}function handleEntityNotFound(_0x11c6f2,_0x5419bd){return function(_0x36e832){if(!_0x36e832){_0x11c6f2[_0x7e85('0x26')](0x194);}return _0x36e832;};}function handleError(_0x4d0d3b,_0x16fb1c){_0x16fb1c=_0x16fb1c||0x1f4;return function(_0x28050a){logger[_0x7e85('0x21')](_0x28050a[_0x7e85('0x34')]);if(_0x28050a[_0x7e85('0x35')]){delete _0x28050a[_0x7e85('0x35')];}_0x4d0d3b[_0x7e85('0x27')](_0x16fb1c)[_0x7e85('0x36')](_0x28050a);};}exports[_0x7e85('0x37')]=function(_0x2c9315,_0x59f56f){var _0x3c32b1={},_0x96e5ac={},_0x291320={'count':0x0,'rows':[]};var _0xbc4978=_[_0x7e85('0x38')](db[_0x7e85('0x39')][_0x7e85('0x3a')],function(_0x1e66a4){return{'name':_0x1e66a4[_0x7e85('0x3b')],'type':_0x1e66a4[_0x7e85('0x3c')][_0x7e85('0x3d')]};});_0x96e5ac[_0x7e85('0x3e')]=_[_0x7e85('0x38')](_0xbc4978,_0x7e85('0x35'));_0x96e5ac[_0x7e85('0x3f')]=_[_0x7e85('0x40')](_0x2c9315[_0x7e85('0x3f')]);_0x96e5ac['filters']=_[_0x7e85('0x41')](_0x96e5ac[_0x7e85('0x3e')],_0x96e5ac['query']);_0x3c32b1['attributes']=_['intersection'](_0x96e5ac[_0x7e85('0x3e')],qs[_0x7e85('0x42')](_0x2c9315[_0x7e85('0x3f')][_0x7e85('0x42')]));_0x3c32b1[_0x7e85('0x43')]=_0x3c32b1[_0x7e85('0x43')][_0x7e85('0x44')]?_0x3c32b1[_0x7e85('0x43')]:_0x96e5ac[_0x7e85('0x3e')];if(!_0x2c9315[_0x7e85('0x3f')][_0x7e85('0x45')](_0x7e85('0x46'))){_0x3c32b1[_0x7e85('0x47')]=qs[_0x7e85('0x47')](_0x2c9315[_0x7e85('0x3f')]['limit']);_0x3c32b1['offset']=qs['offset'](_0x2c9315['query'][_0x7e85('0x2c')]);}_0x3c32b1[_0x7e85('0x48')]=qs[_0x7e85('0x49')](_0x2c9315[_0x7e85('0x3f')]['sort']);_0x3c32b1['where']=qs['filters'](_[_0x7e85('0x4a')](_0x2c9315['query'],_0x96e5ac[_0x7e85('0x4b')]),_0xbc4978);if(_0x2c9315[_0x7e85('0x3f')][_0x7e85('0x4c')]){_0x3c32b1[_0x7e85('0x4d')]=_[_0x7e85('0x4e')](_0x3c32b1[_0x7e85('0x4d')],{'$or':_[_0x7e85('0x38')](_0xbc4978,function(_0xeb4347){if(_0xeb4347[_0x7e85('0x3c')]!=='VIRTUAL'){var _0x3bcfb8={};_0x3bcfb8[_0xeb4347[_0x7e85('0x35')]]={'$like':'%'+_0x2c9315[_0x7e85('0x3f')][_0x7e85('0x4c')]+'%'};return _0x3bcfb8;}})});}_0x3c32b1=_['merge']({},_0x3c32b1,_0x2c9315[_0x7e85('0x4f')]);var _0x5d00e9={'where':_0x3c32b1['where']};return db['OpenchannelMessage'][_0x7e85('0x2b')](_0x5d00e9)[_0x7e85('0x33')](function(_0x3ec76c){_0x291320[_0x7e85('0x2b')]=_0x3ec76c;if(_0x2c9315[_0x7e85('0x3f')][_0x7e85('0x50')]){_0x3c32b1['include']=[{'all':!![]}];}return db[_0x7e85('0x39')][_0x7e85('0x51')](_0x3c32b1);})[_0x7e85('0x33')](function(_0x5c9f1c){_0x291320[_0x7e85('0x52')]=_0x5c9f1c;return _0x291320;})[_0x7e85('0x33')](respondWithFilteredResult(_0x59f56f,_0x3c32b1))[_0x7e85('0x25')](handleError(_0x59f56f,null));};exports[_0x7e85('0x53')]=function(_0x1b969d,_0x674e5f){var _0x4ba213={'raw':!![],'where':{'id':_0x1b969d[_0x7e85('0x54')]['id']}},_0x2e2815={};_0x2e2815[_0x7e85('0x3e')]=_[_0x7e85('0x40')](db[_0x7e85('0x39')][_0x7e85('0x3a')]);_0x2e2815[_0x7e85('0x3f')]=_[_0x7e85('0x40')](_0x1b969d[_0x7e85('0x3f')]);_0x2e2815['filters']=_[_0x7e85('0x41')](_0x2e2815[_0x7e85('0x3e')],_0x2e2815[_0x7e85('0x3f')]);_0x4ba213['attributes']=_[_0x7e85('0x41')](_0x2e2815[_0x7e85('0x3e')],qs[_0x7e85('0x42')](_0x1b969d[_0x7e85('0x3f')][_0x7e85('0x42')]));_0x4ba213[_0x7e85('0x43')]=_0x4ba213[_0x7e85('0x43')][_0x7e85('0x44')]?_0x4ba213[_0x7e85('0x43')]:_0x2e2815[_0x7e85('0x3e')];if(_0x1b969d[_0x7e85('0x3f')][_0x7e85('0x50')]){_0x4ba213[_0x7e85('0x55')]=[{'all':!![]}];}_0x4ba213=_[_0x7e85('0x4e')]({},_0x4ba213,_0x1b969d[_0x7e85('0x4f')]);return db[_0x7e85('0x39')][_0x7e85('0x56')](_0x4ba213)['then'](handleEntityNotFound(_0x674e5f,null))['then'](respondWithResult(_0x674e5f,null))[_0x7e85('0x25')](handleError(_0x674e5f,null));};exports[_0x7e85('0x57')]=function(_0x45ea07,_0x3da70f){return db[_0x7e85('0x39')]['create'](_0x45ea07[_0x7e85('0x58')],{})[_0x7e85('0x33')](respondWithResult(_0x3da70f,0xc9))[_0x7e85('0x25')](handleError(_0x3da70f,null));};exports[_0x7e85('0x32')]=function(_0x2df973,_0x460d19){if(_0x2df973[_0x7e85('0x58')]['id']){delete _0x2df973['body']['id'];}return db[_0x7e85('0x39')][_0x7e85('0x56')]({'where':{'id':_0x2df973[_0x7e85('0x54')]['id']}})[_0x7e85('0x33')](handleEntityNotFound(_0x460d19,null))[_0x7e85('0x33')](saveUpdates(_0x2df973[_0x7e85('0x58')],null))[_0x7e85('0x33')](respondWithResult(_0x460d19,null))['catch'](handleError(_0x460d19,null));};exports[_0x7e85('0x59')]=function(_0x168cc6,_0x45f16e){return db['OpenchannelMessage'][_0x7e85('0x56')]({'where':{'id':_0x168cc6[_0x7e85('0x54')]['id']}})[_0x7e85('0x33')](handleEntityNotFound(_0x45f16e,null))[_0x7e85('0x33')](removeEntity(_0x45f16e,null))[_0x7e85('0x25')](handleError(_0x45f16e,null));};exports[_0x7e85('0x5a')]=function(_0x349f2d,_0x481884){return db[_0x7e85('0x39')][_0x7e85('0x5a')]()['then'](respondWithResult(_0x481884,null))['catch'](handleError(_0x481884,null));};var interaction_log=require(_0x7e85('0x10'))(_0x7e85('0x5b'));exports['accept']=function(_0x75b105,_0x59cc7b,_0x24cd75){var _0x181201={'agent':{},'channel':_0x7e85('0x5c')};if(_0x75b105[_0x7e85('0x58')]['id']){delete _0x75b105[_0x7e85('0x58')]['id'];}_0x75b105[_0x7e85('0x58')][_0x7e85('0x5d')]=!![];_0x75b105[_0x7e85('0x58')]['readAt']=moment()[_0x7e85('0x5e')](_0x7e85('0x5f'));_0x75b105[_0x7e85('0x58')][_0x7e85('0x60')]=_0x75b105[_0x7e85('0x58')][_0x7e85('0x60')]||_0x75b105[_0x7e85('0x61')]['id'];_0x181201['agent']['id']=_0x75b105[_0x7e85('0x58')][_0x7e85('0x60')];return db[_0x7e85('0x39')][_0x7e85('0x56')]({'where':{'id':_0x75b105[_0x7e85('0x54')]['id'],'UserId':null}})[_0x7e85('0x33')](handleEntityNotFound(_0x59cc7b,null))[_0x7e85('0x33')](saveUpdates(_0x75b105[_0x7e85('0x58')],null))['then'](function(_0x253b60){if(_0x253b60){_0x181201['message']=_0x253b60[_0x7e85('0x62')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x253b60['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x59cc7b,null))[_0x7e85('0x33')](function(_0x29b455){if(_0x29b455){return _0x29b455['update']({'UserId':_0x75b105[_0x7e85('0x58')][_0x7e85('0x60')],'read1stAt':_[_0x7e85('0x63')](_0x29b455['read1stAt'])?moment()[_0x7e85('0x5e')](_0x7e85('0x5f')):undefined});}return null;})[_0x7e85('0x33')](function(_0x45e10d){if(_0x45e10d){_0x181201['interaction']=_0x45e10d[_0x7e85('0x62')]({'plain':!![]});interaction_log[_0x7e85('0x1d')](_0x7e85('0x64'),_0x75b105[_0x7e85('0x61')]['id'],_0x75b105[_0x7e85('0x61')][_0x7e85('0x35')],_0x75b105[_0x7e85('0x61')][_0x7e85('0x65')],_0x181201['interaction']['id'],_0x75b105[_0x7e85('0x58')]?JSON[_0x7e85('0x20')](_0x75b105[_0x7e85('0x58')]):_0x7e85('0x66'));return respondWithRpcPromise(_0x7e85('0x67'),_0x7e85('0x68'),_0x181201);}return null;})['then'](function(_0x124540){var _0x389d25=_0x7e85('0x69')+_0x124540['message'][_0x7e85('0x6a')];return db[_0x7e85('0x6b')][_0x7e85('0x3f')](_0x389d25,{'type':db[_0x7e85('0x6c')][_0x7e85('0x6d')]['SELECT'],'raw':!![]})[_0x7e85('0x33')](function(_0x313219){return _0x313219;});})['then'](function(_0x53025e){if(_0x53025e){_0x181201[_0x7e85('0x22')][_0x7e85('0x6e')]=_0x53025e[0x0];if(!_0x75b105[_0x7e85('0x58')][_0x7e85('0x60')])return;return db[_0x7e85('0x6f')][_0x7e85('0x56')]({'where':{'id':_0x75b105['body'][_0x7e85('0x60')],'role':_0x7e85('0x70')},'attributes':['id','name','fullname',_0x7e85('0x71'),_0x7e85('0x72')],'raw':!![]});}return null;})[_0x7e85('0x33')](function(_0x3e4117){if(!_0x3e4117)return null;_0x181201[_0x7e85('0x22')][_0x7e85('0x70')]=_0x3e4117;return _0x181201;})[_0x7e85('0x33')](function(_0x40d483){if(_0x40d483){if(_0x75b105[_0x7e85('0x58')][_0x7e85('0x73')]){_0x181201['message']['interface']=util[_0x7e85('0x5e')](_0x7e85('0x74'),_0x75b105['user']['name']);_0x181201[_0x7e85('0x22')][_0x7e85('0x75')]=_0x181201[_0x7e85('0x75')];_0x181201[_0x7e85('0x22')][_0x7e85('0x76')]=_0x181201[_0x7e85('0x75')];_0x181201['message'][_0x7e85('0x77')]=_0x7e85('0x78');return respondWithRpcPromise(_0x7e85('0x79'),_0x7e85('0x79'),{'event':_0x7e85('0x7a'),'message':_0x181201[_0x7e85('0x22')]},client9002)[_0x7e85('0x33')](function(){return _0x181201;});}return _0x181201;}return null;})[_0x7e85('0x33')](respondWithResult(_0x59cc7b,null))[_0x7e85('0x25')](handleError(_0x59cc7b,null));};var interaction_log=require(_0x7e85('0x10'))('openchannel-interactions');exports[_0x7e85('0x30')]=function(_0x5c1525,_0x273447,_0xcdc2c4){var _0x455126={'agent':{},'channel':_0x7e85('0x5c')};if(_0x5c1525[_0x7e85('0x58')]['id']){delete _0x5c1525['body']['id'];}_0x5c1525[_0x7e85('0x58')]['UserId']=_0x5c1525['body'][_0x7e85('0x60')]||_0x5c1525[_0x7e85('0x61')]['id'];_0x455126[_0x7e85('0x70')]['id']=_0x5c1525[_0x7e85('0x58')]['UserId'];return db[_0x7e85('0x39')][_0x7e85('0x56')]({'where':{'id':_0x5c1525[_0x7e85('0x54')]['id'],'UserId':null}})[_0x7e85('0x33')](handleEntityNotFound(_0x273447,null))[_0x7e85('0x33')](function(_0x4da542){if(_0x4da542){_0x455126['message']=_0x4da542['get']({'plain':!![]});return db[_0x7e85('0x7b')][_0x7e85('0x56')]({'where':{'id':_0x4da542[_0x7e85('0x7c')]}});}return null;})[_0x7e85('0x33')](handleEntityNotFound(_0x273447,null))[_0x7e85('0x33')](function(_0x2daf73){if(_0x2daf73){_0x455126[_0x7e85('0x7d')]=_0x2daf73[_0x7e85('0x62')]({'plain':!![]});interaction_log[_0x7e85('0x1d')](_0x7e85('0x7e'),_0x5c1525['user']['id'],_0x5c1525[_0x7e85('0x61')][_0x7e85('0x35')],_0x5c1525['user'][_0x7e85('0x65')],_0x455126['interaction']['id'],_0x5c1525[_0x7e85('0x58')]?JSON['stringify'](_0x5c1525[_0x7e85('0x58')]):_0x7e85('0x66'));return respondWithRpcPromise('RejectMessage',_0x7e85('0x7f'),_0x455126);}return null;})[_0x7e85('0x33')](function(_0x51070f){var _0x3abe4d=_0x7e85('0x69')+_0x51070f[_0x7e85('0x22')][_0x7e85('0x6a')];return db['sequelize']['query'](_0x3abe4d,{'type':db[_0x7e85('0x6c')][_0x7e85('0x6d')]['SELECT'],'raw':!![]})[_0x7e85('0x33')](function(_0x337fb9){return _0x337fb9;});})[_0x7e85('0x33')](function(_0x38a9d5){if(_0x38a9d5){_0x455126[_0x7e85('0x22')][_0x7e85('0x6e')]=_0x38a9d5[0x0];if(!_0x5c1525['body'][_0x7e85('0x60')])return;return db['User']['find']({'where':{'id':_0x5c1525['body'][_0x7e85('0x60')],'role':_0x7e85('0x70')},'attributes':['id',_0x7e85('0x35'),_0x7e85('0x80'),_0x7e85('0x71'),_0x7e85('0x72')],'raw':!![]});}return null;})['then'](function(_0xde0e1e){if(!_0xde0e1e)return null;_0x455126[_0x7e85('0x22')][_0x7e85('0x70')]=_0xde0e1e;return _0x455126;})[_0x7e85('0x33')](function(_0x2a4a7e){if(_0x2a4a7e){_0x2a4a7e[_0x7e85('0x22')]['interface']=util[_0x7e85('0x5e')](_0x7e85('0x74'),_0x5c1525['user'][_0x7e85('0x35')]);_0x2a4a7e[_0x7e85('0x22')][_0x7e85('0x75')]=_0x455126[_0x7e85('0x75')];_0x2a4a7e['message'][_0x7e85('0x76')]=_0x455126[_0x7e85('0x75')];_0x2a4a7e[_0x7e85('0x22')]['event']=_0x7e85('0x30');respondWithRpcPromise(_0x7e85('0x79'),_0x7e85('0x79'),{'event':_0x7e85('0x81'),'message':_0x2a4a7e[_0x7e85('0x22')]},client9002);return _0x455126;}return null;})[_0x7e85('0x33')](respondWithResult(_0x273447,null))[_0x7e85('0x25')](handleError(_0x273447,null));};
\ No newline at end of file
index 872e61c..dfe1192 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x285d=['../../mysqldb','OpenchannelMessage','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0x285d,0xbf));var _0xd285=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x285d[_0x311c35];return _0x5cc50c;};'use strict';var EventEmitter=require(_0xd285('0x0'));var OpenchannelMessage=require(_0xd285('0x1'))['db'][_0xd285('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd285('0x3'),'afterUpdate':'update','afterDestroy':_0xd285('0x4')};function emitEvent(_0x176a29){return function(_0x481a3d,_0x39f115,_0x1b8cf6){OpenchannelMessageEvents[_0xd285('0x5')](_0x176a29+':'+_0x481a3d['id'],_0x481a3d);OpenchannelMessageEvents['emit'](_0x176a29,_0x481a3d);_0x1b8cf6(null);};}for(var e in events){if(events[_0xd285('0x6')](e)){var event=events[e];OpenchannelMessage[_0xd285('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xe55e=['events','../../mysqldb','setMaxListeners','save','remove','hasOwnProperty','hook'];(function(_0x232b67,_0x3dc89e){var _0x39fcc0=function(_0x3e20c6){while(--_0x3e20c6){_0x232b67['push'](_0x232b67['shift']());}};_0x39fcc0(++_0x3dc89e);}(_0xe55e,0x69));var _0xee55=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xe55e[_0x46e363];return _0x3fb059;};'use strict';var EventEmitter=require(_0xee55('0x0'));var OpenchannelMessage=require(_0xee55('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xee55('0x2')](0x0);var events={'afterCreate':_0xee55('0x3'),'afterUpdate':'update','afterDestroy':_0xee55('0x4')};function emitEvent(_0x2a4289){return function(_0x2d9b93,_0x3266a8,_0x181ce7){OpenchannelMessageEvents['emit'](_0x2a4289+':'+_0x2d9b93['id'],_0x2d9b93);OpenchannelMessageEvents['emit'](_0x2a4289,_0x2d9b93);_0x181ce7(null);};}for(var e in events){if(events[_0xee55('0x5')](e)){var event=events[e];OpenchannelMessage[_0xee55('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index de1f594..ebbf09f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['get','toLowerCase','direction','secret','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','omit','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','fti_openchannel_messages','body','FULLTEXT'];(function(_0x33ebf5,_0x258ec6){var _0x66957b=function(_0x49739a){while(--_0x49739a){_0x33ebf5['push'](_0x33ebf5['shift']());}};_0x66957b(++_0x258ec6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2ae8ce,_0x2a5a1f){_0x2ae8ce=_0x2ae8ce-0x0;var _0x4bf686=_0x0b0e[_0x2ae8ce];return _0x4bf686;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xe0b0('0xb'),'fields':[_0xe0b0('0xc')],'type':_0xe0b0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ac27e,_0x4c24f9,_0x338e7c){var _0x1dd3b8=_0x30e20d['models'];var _0x1fef28=_0x2ac27e[_0xe0b0('0xe')]({'plain':!![]});if(_0x1fef28['direction'][_0xe0b0('0xf')]()==='in'||_0x1fef28[_0xe0b0('0x10')][_0xe0b0('0xf')]()==='out'&&!_0x1fef28[_0xe0b0('0x11')]&&!_[_0xe0b0('0x12')](_0x1fef28[_0xe0b0('0x13')])){_0x1dd3b8[_0xe0b0('0x14')][_0xe0b0('0x15')]({'where':{'id':_0x1fef28['OpenchannelInteractionId']}})[_0xe0b0('0x16')](function(_0x154de6){if(_0x154de6){_0x154de6[_0xe0b0('0x17')]({'lastMsgAt':_0x1fef28[_0xe0b0('0x18')],'lastMsgDirection':_0x1fef28[_0xe0b0('0x10')]['toLowerCase']()});}})[_0xe0b0('0x19')](function(_0x5adb01){console[_0xe0b0('0x1a')](_0x5adb01);});}if(_0x1fef28[_0xe0b0('0x10')]==='out'&&!_0x1fef28[_0xe0b0('0x11')]){var _0x4a4cc0;_0x1dd3b8[_0xe0b0('0x1b')][_0xe0b0('0x1c')]()['then'](function(_0x54a3eb){return _0x1dd3b8[_0xe0b0('0x1d')]['find']({'where':{'id':_0x1fef28['OpenchannelAccountId']},'include':[{'model':_0x1dd3b8['OpenchannelInteraction'],'as':_0xe0b0('0x1e'),'where':{'id':_0x1fef28['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x1dd3b8['CmContact'],'as':_0xe0b0('0x1f'),'attributes':_['keys'](_0x54a3eb)}]}]});})[_0xe0b0('0x16')](function(_0x5dba2f){_0x4a4cc0=_0x5dba2f[_0xe0b0('0xe')]({'plain':!![]});if(_0x4a4cc0&&_0x4a4cc0[_0xe0b0('0x20')]){logger[_0xe0b0('0x21')](_0xe0b0('0x22'),_0xe0b0('0x23'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x1fef28['id'],_0x4a4cc0[_0xe0b0('0x20')]));if(_0x4a4cc0['Interactions']&&_0x4a4cc0[_0xe0b0('0x1e')][_0xe0b0('0x24')]){_0x1fef28['Interaction']=_[_0xe0b0('0x25')](_0x4a4cc0['Interactions'][0x0],_0xe0b0('0x1f'));_0x1fef28['Contact']=_0x4a4cc0[_0xe0b0('0x1e')][0x0]['Contact'];}var _0x4c24f9={'method':'POST','uri':encodeURI(_0x4a4cc0[_0xe0b0('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4c24f9['method']){case _0xe0b0('0x26'):_0x4c24f9['qs']=_0x1fef28;break;case'POST':_0x4c24f9[_0xe0b0('0xc')]=_0x1fef28;break;}return rp(_0x4c24f9)[_0xe0b0('0x16')](function(_0x1f1ebd){logger[_0xe0b0('0x21')](_0xe0b0('0x22'),_0xe0b0('0x23'),util['format'](_0xe0b0('0x27'),_0x1fef28['id'],_0x4a4cc0[_0xe0b0('0x20')]));if(_0x1f1ebd['body'][_0xe0b0('0x28')]&&_0x1f1ebd[_0xe0b0('0xc')][_0xe0b0('0x28')]!=_0x1fef28[_0xe0b0('0x29')][_0xe0b0('0x28')]){return _0x1dd3b8[_0xe0b0('0x14')][_0xe0b0('0x17')]({'threadId':_0x1f1ebd['body'][_0xe0b0('0x28')]},{'logging':!![],'where':{'id':_0x1fef28[_0xe0b0('0x29')]['id']}});}else{return;}})['then'](function(){return _0x2ac27e['update']({'read':!![]});})[_0xe0b0('0x19')](function(_0x33e672){logger[_0xe0b0('0x1a')](_0xe0b0('0x22'),_0xe0b0('0x23'),util['inspect'](_0x33e672,{'showHidden':![],'depth':null}));_0x338e7c();});}else{_0x338e7c();}})[_0xe0b0('0x2a')](function(){_0x338e7c();});}else{_0x338e7c();}}},'charset':_0xe0b0('0x2b'),'collate':_0xe0b0('0x2c')});};
\ No newline at end of file
+var _0x757a=['find','OpenchannelAccountId','OpenchannelInteraction','Interactions','keys','replyUri','info','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','POST','method','OpenchannelMessage,\x20%s,\x20%s','threadId','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','UserId','OpenchannelInteractionId','update','createdAt','catch','error','out','secret','CmContact','describe','then'];(function(_0x50aac5,_0x16deda){var _0x403dc7=function(_0x1cd0a4){while(--_0x1cd0a4){_0x50aac5['push'](_0x50aac5['shift']());}};_0x403dc7(++_0x16deda);}(_0x757a,0xde));var _0xa757=function(_0x59c2c0,_0x57e16b){_0x59c2c0=_0x59c2c0-0x0;var _0x149477=_0x757a[_0x59c2c0];return _0x149477;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('OpenchannelMessage',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xb')],'type':_0xa757('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a3db6,_0x5aef8a,_0x89c630){var _0x2ca96f=_0x5edca8[_0xa757('0xd')];var _0x3e2c9a=_0x3a3db6[_0xa757('0xe')]({'plain':!![]});if(_0x3e2c9a[_0xa757('0xf')][_0xa757('0x10')]()==='in'||_0x3e2c9a['direction']['toLowerCase']()==='out'&&!_0x3e2c9a['secret']&&!_['isNil'](_0x3e2c9a[_0xa757('0x11')])){_0x2ca96f['OpenchannelInteraction']['findOne']({'where':{'id':_0x3e2c9a[_0xa757('0x12')]}})['then'](function(_0x481508){if(_0x481508){_0x481508[_0xa757('0x13')]({'lastMsgAt':_0x3e2c9a[_0xa757('0x14')],'lastMsgDirection':_0x3e2c9a[_0xa757('0xf')][_0xa757('0x10')]()});}})[_0xa757('0x15')](function(_0x31cfd2){console[_0xa757('0x16')](_0x31cfd2);});}if(_0x3e2c9a[_0xa757('0xf')]===_0xa757('0x17')&&!_0x3e2c9a[_0xa757('0x18')]){var _0x50aac1;_0x2ca96f[_0xa757('0x19')][_0xa757('0x1a')]()[_0xa757('0x1b')](function(_0x4d9f58){return _0x2ca96f['OpenchannelAccount'][_0xa757('0x1c')]({'where':{'id':_0x3e2c9a[_0xa757('0x1d')]},'include':[{'model':_0x2ca96f[_0xa757('0x1e')],'as':_0xa757('0x1f'),'where':{'id':_0x3e2c9a[_0xa757('0x12')]},'limit':0x1,'include':[{'model':_0x2ca96f[_0xa757('0x19')],'as':'Contact','attributes':_[_0xa757('0x20')](_0x4d9f58)}]}]});})['then'](function(_0x32c2a1){_0x50aac1=_0x32c2a1[_0xa757('0xe')]({'plain':!![]});if(_0x50aac1&&_0x50aac1[_0xa757('0x21')]){logger[_0xa757('0x22')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xa757('0x23')](_0xa757('0x24'),_0x3e2c9a['id'],_0x50aac1[_0xa757('0x21')]));if(_0x50aac1[_0xa757('0x1f')]&&_0x50aac1[_0xa757('0x1f')][_0xa757('0x25')]){_0x3e2c9a[_0xa757('0x26')]=_[_0xa757('0x27')](_0x50aac1[_0xa757('0x1f')][0x0],'Contact');_0x3e2c9a[_0xa757('0x28')]=_0x50aac1['Interactions'][0x0][_0xa757('0x28')];}var _0x5aef8a={'method':_0xa757('0x29'),'uri':encodeURI(_0x50aac1[_0xa757('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5aef8a[_0xa757('0x2a')]){case'GET':_0x5aef8a['qs']=_0x3e2c9a;break;case _0xa757('0x29'):_0x5aef8a[_0xa757('0xb')]=_0x3e2c9a;break;}return rp(_0x5aef8a)[_0xa757('0x1b')](function(_0x3bf7f3){logger['info'](_0xa757('0x2b'),'afterCreate',util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x3e2c9a['id'],_0x50aac1['replyUri']));if(_0x3bf7f3[_0xa757('0xb')]['threadId']&&_0x3bf7f3[_0xa757('0xb')][_0xa757('0x2c')]!=_0x3e2c9a['Interaction'][_0xa757('0x2c')]){return _0x2ca96f['OpenchannelInteraction'][_0xa757('0x13')]({'threadId':_0x3bf7f3[_0xa757('0xb')]['threadId']},{'logging':!![],'where':{'id':_0x3e2c9a[_0xa757('0x26')]['id']}});}else{return;}})['then'](function(){return _0x3a3db6[_0xa757('0x13')]({'read':!![]});})[_0xa757('0x15')](function(_0x458974){logger[_0xa757('0x16')](_0xa757('0x2b'),_0xa757('0x2d'),util[_0xa757('0x2e')](_0x458974,{'showHidden':![],'depth':null}));_0x89c630();});}else{_0x89c630();}})[_0xa757('0x2f')](function(){_0x89c630();});}else{_0x89c630();}}},'charset':_0xa757('0x30'),'collate':_0xa757('0x31')});};
\ No newline at end of file
index 03f8375..bd26701 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xca7f1c,_0x1ca7a0){var _0x623f1e=function(_0x4c3baf){while(--_0x4c3baf){_0xca7f1c['push'](_0xca7f1c['shift']());}};_0x623f1e(++_0x1ca7a0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3cffb3,_0x5520ba){_0x3cffb3=_0x3cffb3-0x0;var _0x5442a4=_0x5f2f[_0x3cffb3];return _0x5442a4;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});};
\ No newline at end of file
+var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x335389,_0x5563d7){var _0x2d8581=function(_0x61d501){while(--_0x61d501){_0x335389['push'](_0x335389['shift']());}};_0x2d8581(++_0x5563d7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5c9f12,_0x571ec8){_0x5c9f12=_0x5c9f12-0x0;var _0x37ba21=_0x5f2f[_0x5c9f12];return _0x37ba21;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});};
\ No newline at end of file
index 161c66e..009daa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa209=['./openchannelMessage.events','save','update','emit','removeListener','register'];(function(_0x416321,_0x48780b){var _0x5b7a52=function(_0xf6a429){while(--_0xf6a429){_0x416321['push'](_0x416321['shift']());}};_0x5b7a52(++_0x48780b);}(_0xa209,0xba));var _0x9a20=function(_0x247369,_0x2bfe03){_0x247369=_0x247369-0x0;var _0x4ca192=_0xa209[_0x247369];return _0x4ca192;};'use strict';var OpenchannelMessageEvents=require(_0x9a20('0x0'));var events=[_0x9a20('0x1'),'remove',_0x9a20('0x2')];function createListener(_0x241329,_0x11f943){return function(_0x1da913){_0x11f943[_0x9a20('0x3')](_0x241329,_0x1da913);};}function removeListener(_0x1c7f7a,_0x4a27a1){return function(){OpenchannelMessageEvents[_0x9a20('0x4')](_0x1c7f7a,_0x4a27a1);};}exports[_0x9a20('0x5')]=function(_0xb4a3f4){for(var _0x3f6b50=0x0,_0x2fe790=events['length'];_0x3f6b50<_0x2fe790;_0x3f6b50++){var _0x3744e8=events[_0x3f6b50];var _0x2194d8=createListener('openchannelMessage:'+_0x3744e8,_0xb4a3f4);OpenchannelMessageEvents['on'](_0x3744e8,_0x2194d8);}};
\ No newline at end of file
+var _0xb2e6=['removeListener','register','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0xd5a3fb,_0x5278a6){var _0x1fd03c=function(_0x43e6e0){while(--_0x43e6e0){_0xd5a3fb['push'](_0xd5a3fb['shift']());}};_0x1fd03c(++_0x5278a6);}(_0xb2e6,0x81));var _0x6b2e=function(_0x25e82f,_0xdae013){_0x25e82f=_0x25e82f-0x0;var _0x12158d=_0xb2e6[_0x25e82f];return _0x12158d;};'use strict';var OpenchannelMessageEvents=require(_0x6b2e('0x0'));var events=[_0x6b2e('0x1'),_0x6b2e('0x2'),_0x6b2e('0x3')];function createListener(_0x165fa1,_0x10545c){return function(_0x2eaf4e){_0x10545c['emit'](_0x165fa1,_0x2eaf4e);};}function removeListener(_0x12c70c,_0x59938e){return function(){OpenchannelMessageEvents[_0x6b2e('0x4')](_0x12c70c,_0x59938e);};}exports[_0x6b2e('0x5')]=function(_0x10ca3e){for(var _0x431ccb=0x0,_0x20a220=events['length'];_0x431ccb<_0x20a220;_0x431ccb++){var _0x1ad8fb=events[_0x431ccb];var _0x63b86d=createListener(_0x6b2e('0x6')+_0x1ad8fb,_0x10ca3e);OpenchannelMessageEvents['on'](_0x1ad8fb,_0x63b86d);}};
\ No newline at end of file
index 9535f05..e984a9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59de=['getAgents','addTeams','post','addAgents','/:id','update','delete','destroy','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x3645d3,_0x12ba24){var _0x41bcfe=function(_0x163a2e){while(--_0x163a2e){_0x3645d3['push'](_0x3645d3['shift']());}};_0x41bcfe(++_0x12ba24);}(_0x59de,0xb2));var _0xe59d=function(_0x9ff51,_0x4c951f){_0x9ff51=_0x9ff51-0x0;var _0x31959b=_0x59de[_0x9ff51];return _0x31959b;};'use strict';var multer=require(_0xe59d('0x0'));var util=require(_0xe59d('0x1'));var path=require(_0xe59d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe59d('0x3')]();var fs_extra=require(_0xe59d('0x4'));var auth=require(_0xe59d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe59d('0x6'));var controller=require('./openchannelQueue.controller');router[_0xe59d('0x7')]('/',auth[_0xe59d('0x8')](),controller[_0xe59d('0x9')]);router[_0xe59d('0x7')](_0xe59d('0xa'),auth[_0xe59d('0x8')](),controller[_0xe59d('0xb')]);router['get']('/:id',auth[_0xe59d('0x8')](),controller[_0xe59d('0xc')]);router[_0xe59d('0x7')](_0xe59d('0xd'),auth[_0xe59d('0x8')](),controller[_0xe59d('0xe')]);router[_0xe59d('0x7')](_0xe59d('0xf'),auth[_0xe59d('0x8')](),controller[_0xe59d('0x10')]);router[_0xe59d('0x7')](_0xe59d('0x11'),auth[_0xe59d('0x8')](),controller[_0xe59d('0x12')]);router['post']('/',auth[_0xe59d('0x8')](),controller['create']);router['post'](_0xe59d('0xf'),auth['isAuthenticated'](),controller[_0xe59d('0x13')]);router[_0xe59d('0x14')](_0xe59d('0x11'),auth[_0xe59d('0x8')](),controller[_0xe59d('0x15')]);router['put'](_0xe59d('0x16'),auth[_0xe59d('0x8')](),controller[_0xe59d('0x17')]);router[_0xe59d('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xe59d('0x19')]);router[_0xe59d('0x18')](_0xe59d('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xe59d('0x18')](_0xe59d('0x11'),auth['isAuthenticated'](),controller[_0xe59d('0x1a')]);module[_0xe59d('0x1b')]=router;
\ No newline at end of file
+var _0xdb71=['describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdb71,0x1d0));var _0x1db7=function(_0x1c0453,_0x520210){_0x1c0453=_0x1c0453-0x0;var _0x44f80c=_0xdb71[_0x1c0453];return _0x44f80c;};'use strict';var multer=require(_0x1db7('0x0'));var util=require('util');var path=require(_0x1db7('0x1'));var timeout=require(_0x1db7('0x2'));var express=require(_0x1db7('0x3'));var router=express['Router']();var fs_extra=require(_0x1db7('0x4'));var auth=require(_0x1db7('0x5'));var interaction=require(_0x1db7('0x6'));var config=require(_0x1db7('0x7'));var controller=require(_0x1db7('0x8'));router[_0x1db7('0x9')]('/',auth[_0x1db7('0xa')](),controller['index']);router[_0x1db7('0x9')](_0x1db7('0xb'),auth[_0x1db7('0xa')](),controller[_0x1db7('0xc')]);router[_0x1db7('0x9')](_0x1db7('0xd'),auth[_0x1db7('0xa')](),controller[_0x1db7('0xe')]);router[_0x1db7('0x9')]('/:id/members',auth[_0x1db7('0xa')](),controller[_0x1db7('0xf')]);router[_0x1db7('0x9')]('/:id/teams',auth[_0x1db7('0xa')](),controller[_0x1db7('0x10')]);router[_0x1db7('0x9')](_0x1db7('0x11'),auth[_0x1db7('0xa')](),controller[_0x1db7('0x12')]);router[_0x1db7('0x13')]('/',auth[_0x1db7('0xa')](),controller[_0x1db7('0x14')]);router[_0x1db7('0x13')](_0x1db7('0x15'),auth[_0x1db7('0xa')](),controller[_0x1db7('0x16')]);router[_0x1db7('0x13')](_0x1db7('0x11'),auth[_0x1db7('0xa')](),controller[_0x1db7('0x17')]);router['put'](_0x1db7('0xd'),auth['isAuthenticated'](),controller[_0x1db7('0x18')]);router[_0x1db7('0x19')](_0x1db7('0xd'),auth[_0x1db7('0xa')](),controller[_0x1db7('0x1a')]);router['delete'](_0x1db7('0x15'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x1db7('0x19')](_0x1db7('0x11'),auth[_0x1db7('0xa')](),controller['removeAgents']);module[_0x1db7('0x1b')]=router;
\ No newline at end of file
index aa0838d..a2d8824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7424=['ENUM','rrmemory','roundrobin','exports','STRING','name'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0x7424,0xff));var _0x4742=function(_0x173cad,_0x36dcc8){_0x173cad=_0x173cad-0x0;var _0x584b38=_0x7424[_0x173cad];return _0x584b38;};'use strict';var Sequelize=require('sequelize');module[_0x4742('0x0')]={'name':{'type':Sequelize[_0x4742('0x1')],'unique':_0x4742('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4742('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4742('0x3')](_0x4742('0x4'),'beepall',_0x4742('0x5'))}};
\ No newline at end of file
+var _0x1196=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x2254a2,_0x8e4657){var _0x307643=function(_0x45174b){while(--_0x45174b){_0x2254a2['push'](_0x2254a2['shift']());}};_0x307643(++_0x8e4657);}(_0x1196,0x157));var _0x6119=function(_0xeac342,_0x9e4e9c){_0xeac342=_0xeac342-0x0;var _0x580d1a=_0x1196[_0xeac342];return _0x580d1a;};'use strict';var Sequelize=require(_0x6119('0x0'));module[_0x6119('0x1')]={'name':{'type':Sequelize[_0x6119('0x2')],'unique':_0x6119('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6119('0x2')]},'timeout':{'type':Sequelize[_0x6119('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6119('0x5')](_0x6119('0x6'),'beepall','roundrobin')}};
\ No newline at end of file
index 6b9a659..2a3078d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65db=['offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','pick','OpenchannelQueueId','User','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','voicePause','interface','flatMap','Agents','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json'];(function(_0x55f826,_0x62b965){var _0xb5d080=function(_0x5e52d8){while(--_0x5e52d8){_0x55f826['push'](_0x55f826['shift']());}};_0xb5d080(++_0x62b965);}(_0x65db,0x180));var _0xb65d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x65db[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb65d('0x0'));var zipdir=require(_0xb65d('0x1'));var jsonpatch=require(_0xb65d('0x2'));var rp=require(_0xb65d('0x3'));var moment=require(_0xb65d('0x4'));var BPromise=require(_0xb65d('0x5'));var Mustache=require(_0xb65d('0x6'));var util=require('util');var path=require(_0xb65d('0x7'));var sox=require(_0xb65d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb65d('0x9'));var squel=require('squel');var crypto=require(_0xb65d('0xa'));var jsforce=require(_0xb65d('0xb'));var deskjs=require(_0xb65d('0xc'));var toCsv=require(_0xb65d('0xd'));var querystring=require(_0xb65d('0xe'));var Papa=require(_0xb65d('0xf'));var Redis=require(_0xb65d('0x10'));var authService=require(_0xb65d('0x11'));var qs=require(_0xb65d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb65d('0x13'));var logger=require(_0xb65d('0x14'))(_0xb65d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xb65d('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xb65d('0x17'))(new Redis(config['redis']));require(_0xb65d('0x18'))[_0xb65d('0x19')](socket);function respondWithStatusCode(_0x2e16bb,_0x22c451){_0x22c451=_0x22c451||0xcc;return function(_0x2222b5){if(_0x2222b5){return _0x2e16bb[_0xb65d('0x1a')](_0x22c451);}return _0x2e16bb[_0xb65d('0x1b')](_0x22c451)[_0xb65d('0x1c')]();};}function respondWithResult(_0x56cce4,_0x308037){_0x308037=_0x308037||0xc8;return function(_0x5f0830){if(_0x5f0830){return _0x56cce4['status'](_0x308037)[_0xb65d('0x1d')](_0x5f0830);}};}function respondWithFilteredResult(_0x246430,_0xdf8921){return function(_0xa8627f){if(_0xa8627f){var _0x3067fa=typeof _0xdf8921[_0xb65d('0x1e')]===_0xb65d('0x1f')&&typeof _0xdf8921['limit']===_0xb65d('0x1f');var _0x598952=_0xa8627f['count'];var _0x2d6b0c=_0x3067fa?0x0:_0xdf8921['offset'];var _0x2c04b8=_0x3067fa?_0xa8627f[_0xb65d('0x20')]:_0xdf8921['offset']+_0xdf8921[_0xb65d('0x21')];var _0x2f5a79;if(_0x2c04b8>=_0x598952){_0x2c04b8=_0x598952;_0x2f5a79=0xc8;}else{_0x2f5a79=0xce;}_0x246430[_0xb65d('0x1b')](_0x2f5a79);return _0x246430[_0xb65d('0x22')](_0xb65d('0x23'),_0x2d6b0c+'-'+_0x2c04b8+'/'+_0x598952)[_0xb65d('0x1d')](_0xa8627f);}return null;};}function patchUpdates(_0x54132e){return function(_0x2950c1){try{jsonpatch[_0xb65d('0x24')](_0x2950c1,_0x54132e,!![]);}catch(_0x29c3dc){return BPromise[_0xb65d('0x25')](_0x29c3dc);}return _0x2950c1[_0xb65d('0x26')]();};}function saveUpdates(_0x37745f,_0x4a9ad7){return function(_0x56147f){if(_0x56147f){return _0x56147f[_0xb65d('0x27')](_0x37745f)[_0xb65d('0x28')](function(_0x396aa2){return _0x396aa2;});}return null;};}function removeEntity(_0x561de9,_0xc15380){return function(_0x3ead81){if(_0x3ead81){return _0x3ead81[_0xb65d('0x29')]()['then'](function(){var _0x31491f=_0x3ead81[_0xb65d('0x2a')]({'plain':!![]});var _0x43d79a=_0xb65d('0x2b');return db[_0xb65d('0x2c')]['destroy']({'where':{'type':_0x43d79a,'resourceId':_0x31491f['id']}})[_0xb65d('0x28')](function(){return _0x3ead81;});})[_0xb65d('0x28')](function(){_0x561de9[_0xb65d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46a526,_0x4417e8){return function(_0x230b46){if(!_0x230b46){_0x46a526[_0xb65d('0x1a')](0x194);}return _0x230b46;};}function handleError(_0x4b89f3,_0x448756){_0x448756=_0x448756||0x1f4;return function(_0x15935e){logger[_0xb65d('0x2d')](_0x15935e[_0xb65d('0x2e')]);if(_0x15935e['name']){delete _0x15935e[_0xb65d('0x2f')];}_0x4b89f3[_0xb65d('0x1b')](_0x448756)[_0xb65d('0x30')](_0x15935e);};}exports[_0xb65d('0x31')]=function(_0x53f6d7,_0x55853e){var _0x439f13={},_0x47cc00={},_0x38c2fd={'count':0x0,'rows':[]};var _0x57fa12=_[_0xb65d('0x32')](db[_0xb65d('0x33')]['rawAttributes'],function(_0x3f81ea){return{'name':_0x3f81ea[_0xb65d('0x34')],'type':_0x3f81ea['type'][_0xb65d('0x35')]};});_0x47cc00['model']=_[_0xb65d('0x32')](_0x57fa12,_0xb65d('0x2f'));_0x47cc00[_0xb65d('0x36')]=_[_0xb65d('0x37')](_0x53f6d7[_0xb65d('0x36')]);_0x47cc00['filters']=_[_0xb65d('0x38')](_0x47cc00[_0xb65d('0x39')],_0x47cc00[_0xb65d('0x36')]);_0x439f13[_0xb65d('0x3a')]=_[_0xb65d('0x38')](_0x47cc00[_0xb65d('0x39')],qs['fields'](_0x53f6d7[_0xb65d('0x36')][_0xb65d('0x3b')]));_0x439f13['attributes']=_0x439f13[_0xb65d('0x3a')][_0xb65d('0x3c')]?_0x439f13['attributes']:_0x47cc00['model'];if(!_0x53f6d7[_0xb65d('0x36')]['hasOwnProperty'](_0xb65d('0x3d'))){_0x439f13[_0xb65d('0x21')]=qs[_0xb65d('0x21')](_0x53f6d7[_0xb65d('0x36')][_0xb65d('0x21')]);_0x439f13['offset']=qs[_0xb65d('0x1e')](_0x53f6d7[_0xb65d('0x36')]['offset']);}_0x439f13[_0xb65d('0x3e')]=qs[_0xb65d('0x3f')](_0x53f6d7['query'][_0xb65d('0x3f')]);_0x439f13[_0xb65d('0x40')]=qs[_0xb65d('0x41')](_['pick'](_0x53f6d7[_0xb65d('0x36')],_0x47cc00[_0xb65d('0x41')]),_0x57fa12);if(_0x53f6d7[_0xb65d('0x36')]['filter']){_0x439f13[_0xb65d('0x40')]=_[_0xb65d('0x42')](_0x439f13[_0xb65d('0x40')],{'$or':_[_0xb65d('0x32')](_0x57fa12,function(_0x53d9cc){if(_0x53d9cc[_0xb65d('0x43')]!==_0xb65d('0x44')){var _0x106902={};_0x106902[_0x53d9cc['name']]={'$like':'%'+_0x53f6d7[_0xb65d('0x36')][_0xb65d('0x45')]+'%'};return _0x106902;}})});}_0x439f13=_[_0xb65d('0x42')]({},_0x439f13,_0x53f6d7[_0xb65d('0x46')]);var _0x37163b={'where':_0x439f13['where']};return db[_0xb65d('0x33')][_0xb65d('0x20')](_0x37163b)[_0xb65d('0x28')](function(_0x15152d){_0x38c2fd[_0xb65d('0x20')]=_0x15152d;if(_0x53f6d7['query'][_0xb65d('0x47')]){_0x439f13['include']=[{'all':!![]}];}return db[_0xb65d('0x33')][_0xb65d('0x48')](_0x439f13);})[_0xb65d('0x28')](function(_0xad64cf){_0x38c2fd[_0xb65d('0x49')]=_0xad64cf;return _0x38c2fd;})[_0xb65d('0x28')](respondWithFilteredResult(_0x55853e,_0x439f13))[_0xb65d('0x4a')](handleError(_0x55853e,null));};exports[_0xb65d('0x4b')]=function(_0x240991,_0xd04c13){var _0x293d02={'raw':!![],'where':{'id':_0x240991['params']['id']}},_0x50f8dd={};_0x50f8dd['model']=_[_0xb65d('0x37')](db[_0xb65d('0x33')][_0xb65d('0x4c')]);_0x50f8dd[_0xb65d('0x36')]=_[_0xb65d('0x37')](_0x240991[_0xb65d('0x36')]);_0x50f8dd[_0xb65d('0x41')]=_[_0xb65d('0x38')](_0x50f8dd[_0xb65d('0x39')],_0x50f8dd[_0xb65d('0x36')]);_0x293d02[_0xb65d('0x3a')]=_[_0xb65d('0x38')](_0x50f8dd[_0xb65d('0x39')],qs['fields'](_0x240991['query'][_0xb65d('0x3b')]));_0x293d02['attributes']=_0x293d02[_0xb65d('0x3a')]['length']?_0x293d02[_0xb65d('0x3a')]:_0x50f8dd['model'];if(_0x240991[_0xb65d('0x36')]['includeAll']){_0x293d02['include']=[{'all':!![]}];}_0x293d02=_[_0xb65d('0x42')]({},_0x293d02,_0x240991[_0xb65d('0x46')]);return db[_0xb65d('0x33')]['find'](_0x293d02)['then'](handleEntityNotFound(_0xd04c13,null))['then'](respondWithResult(_0xd04c13,null))[_0xb65d('0x4a')](handleError(_0xd04c13,null));};exports['create']=function(_0x408f12,_0x568a5a){return db[_0xb65d('0x33')][_0xb65d('0x4d')](_0x408f12[_0xb65d('0x4e')],{})[_0xb65d('0x28')](function(_0x361487){var _0x55431c=_0x408f12['user']['get']({'plain':!![]});if(!_0x55431c)throw new Error(_0xb65d('0x4f'));if(_0x55431c[_0xb65d('0x50')]===_0xb65d('0x51')){var _0x19b7a4=_0x361487['get']({'plain':!![]});var _0x5686d6='OpenchannelQueues';return db[_0xb65d('0x52')]['find']({'where':{'name':_0x5686d6,'userProfileId':_0x55431c['userProfileId']},'raw':!![]})[_0xb65d('0x28')](function(_0x5825b1){if(_0x5825b1&&_0x5825b1[_0xb65d('0x53')]===0x0){return db[_0xb65d('0x2c')]['create']({'name':_0x19b7a4['name'],'resourceId':_0x19b7a4['id'],'type':_0x5825b1[_0xb65d('0x2f')],'sectionId':_0x5825b1['id']},{})['then'](function(){return _0x361487;});}else{return _0x361487;}})[_0xb65d('0x4a')](function(_0x5cc0d0){logger[_0xb65d('0x2d')](_0xb65d('0x54'),_0x5cc0d0);throw _0x5cc0d0;});}return _0x361487;})[_0xb65d('0x28')](respondWithResult(_0x568a5a,0xc9))[_0xb65d('0x4a')](handleError(_0x568a5a,null));};exports[_0xb65d('0x27')]=function(_0x48966f,_0x2e641d){if(_0x48966f[_0xb65d('0x4e')]['id']){delete _0x48966f[_0xb65d('0x4e')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x48966f[_0xb65d('0x55')]['id']}})[_0xb65d('0x28')](handleEntityNotFound(_0x2e641d,null))[_0xb65d('0x28')](saveUpdates(_0x48966f[_0xb65d('0x4e')],null))[_0xb65d('0x28')](respondWithResult(_0x2e641d,null))[_0xb65d('0x4a')](handleError(_0x2e641d,null));};exports[_0xb65d('0x29')]=function(_0x4e859a,_0x41685e){return db['OpenchannelQueue'][_0xb65d('0x56')]({'where':{'id':_0x4e859a[_0xb65d('0x55')]['id']}})[_0xb65d('0x28')](handleEntityNotFound(_0x41685e,null))[_0xb65d('0x28')](removeEntity(_0x41685e,null))[_0xb65d('0x4a')](handleError(_0x41685e,null));};exports[_0xb65d('0x57')]=function(_0x54bcfe,_0x28ac25){return db[_0xb65d('0x33')][_0xb65d('0x57')]()[_0xb65d('0x28')](respondWithResult(_0x28ac25,null))[_0xb65d('0x4a')](handleError(_0x28ac25,null));};exports[_0xb65d('0x58')]=function(_0x16b2a3,_0x25754f,_0x5a9afe){var _0x58940f={'raw':!![],'where':{}},_0x3c9b9f={},_0x311932;return db[_0xb65d('0x33')][_0xb65d('0x59')]({'where':{'id':_0x16b2a3[_0xb65d('0x55')]['id']}})['then'](handleEntityNotFound(_0x25754f,null))['then'](function(_0x459ce2){if(_0x459ce2){_0x311932=_0x459ce2[_0xb65d('0x2a')]({'plain':!![]});_0x3c9b9f['model']=_['keys'](db[_0xb65d('0x5a')][_0xb65d('0x4c')]);_0x3c9b9f[_0xb65d('0x36')]=_[_0xb65d('0x37')](_0x16b2a3[_0xb65d('0x36')]);_0x3c9b9f['filters']=_[_0xb65d('0x38')](_0x3c9b9f[_0xb65d('0x39')],_0x3c9b9f[_0xb65d('0x36')]);_0x58940f[_0xb65d('0x3a')]=_[_0xb65d('0x38')](_0x3c9b9f[_0xb65d('0x39')],qs[_0xb65d('0x3b')](_0x16b2a3[_0xb65d('0x36')][_0xb65d('0x3b')]));_0x58940f[_0xb65d('0x3a')]=_0x58940f[_0xb65d('0x3a')]['length']?_0x58940f[_0xb65d('0x3a')]:_0x3c9b9f[_0xb65d('0x39')];if(!_0x16b2a3[_0xb65d('0x36')][_0xb65d('0x5b')]('nolimit')){_0x58940f[_0xb65d('0x21')]=qs[_0xb65d('0x21')](_0x16b2a3['query'][_0xb65d('0x21')]);_0x58940f[_0xb65d('0x1e')]=qs['offset'](_0x16b2a3[_0xb65d('0x36')][_0xb65d('0x1e')]);}_0x58940f[_0xb65d('0x3e')]=qs['sort'](_0x16b2a3['query']['sort']);_0x58940f[_0xb65d('0x40')]=qs['filters'](_[_0xb65d('0x5c')](_0x16b2a3[_0xb65d('0x36')],_0x3c9b9f['filters']));_0x58940f[_0xb65d('0x40')][_0xb65d('0x5d')]=_0x459ce2['id'];if(_0x16b2a3[_0xb65d('0x36')][_0xb65d('0x45')]){_0x58940f[_0xb65d('0x40')]=_[_0xb65d('0x42')](_0x58940f[_0xb65d('0x40')],{'$or':_[_0xb65d('0x32')](_0x58940f[_0xb65d('0x3a')],function(_0x1e2285){var _0x1e7b3d={};_0x1e7b3d[_0x1e2285]={'$like':'%'+_0x16b2a3[_0xb65d('0x36')]['filter']+'%'};return _0x1e7b3d;})});}_0x58940f=_['merge']({},_0x58940f,_0x16b2a3[_0xb65d('0x46')]);return db[_0xb65d('0x5a')]['findAll'](_0x58940f);}})['then'](function(_0x192ce0){if(_0x192ce0){return db[_0xb65d('0x5e')]['findAndCountAll']({'where':{'id':_[_0xb65d('0x32')](_0x192ce0,_0xb65d('0x5f')),'role':_0xb65d('0x60')},'attributes':['id',_0xb65d('0x2f'),_0xb65d('0x61'),'updatedAt',_0xb65d('0x62')]});}})[_0xb65d('0x28')](function(_0xce8352){if(_0xce8352){return{'count':_0xce8352[_0xb65d('0x20')],'rows':_[_0xb65d('0x32')](_0xce8352['rows'],function(_0x6f7a2e){return{'membername':_0x6f7a2e[_0xb65d('0x2f')],'UserId':_0x6f7a2e['id'],'queue_name':_0x311932[_0xb65d('0x2f')],'OpenchannelQueueId':_0x311932['id'],'interface':util[_0xb65d('0x63')](_0xb65d('0x64'),_0xb65d('0x65'),_0x6f7a2e[_0xb65d('0x2f')]),'penalty':0x0,'paused':_0x6f7a2e[_0xb65d('0x61')],'createdAt':_0x6f7a2e['createdAt'],'updatedAt':_0x6f7a2e[_0xb65d('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb65d('0x28')](respondWithFilteredResult(_0x25754f,_0x58940f))[_0xb65d('0x4a')](handleError(_0x25754f,null));};exports[_0xb65d('0x67')]=function(_0x218978,_0x585715,_0x30d411){var _0x3c725d={};var _0x5c04df={};var _0x34ddb7;var _0x5d8d65;return db['OpenchannelQueue'][_0xb65d('0x59')]({'where':{'id':_0x218978['params']['id']}})[_0xb65d('0x28')](handleEntityNotFound(_0x585715,null))[_0xb65d('0x28')](function(_0x3d5f0a){if(_0x3d5f0a){_0x34ddb7=_0x3d5f0a;_0x5c04df[_0xb65d('0x39')]=_[_0xb65d('0x37')](db[_0xb65d('0x68')]['rawAttributes']);_0x5c04df['query']=_[_0xb65d('0x37')](_0x218978[_0xb65d('0x36')]);_0x5c04df[_0xb65d('0x41')]=_['intersection'](_0x5c04df[_0xb65d('0x39')],_0x5c04df['query']);_0x3c725d[_0xb65d('0x3a')]=_['intersection'](_0x5c04df[_0xb65d('0x39')],qs[_0xb65d('0x3b')](_0x218978[_0xb65d('0x36')][_0xb65d('0x3b')]));_0x3c725d[_0xb65d('0x3a')]=_0x3c725d[_0xb65d('0x3a')][_0xb65d('0x3c')]?_0x3c725d[_0xb65d('0x3a')]:_0x5c04df[_0xb65d('0x39')];_0x3c725d[_0xb65d('0x3e')]=qs[_0xb65d('0x3f')](_0x218978[_0xb65d('0x36')][_0xb65d('0x3f')]);_0x3c725d[_0xb65d('0x40')]=qs[_0xb65d('0x41')](_[_0xb65d('0x5c')](_0x218978['query'],_0x5c04df[_0xb65d('0x41')]));if(_0x218978['query'][_0xb65d('0x45')]){_0x3c725d[_0xb65d('0x40')]=_['merge'](_0x3c725d[_0xb65d('0x40')],{'$or':_[_0xb65d('0x32')](_0x3c725d['attributes'],function(_0x5cc7a5){var _0x5613b8={};_0x5613b8[_0x5cc7a5]={'$like':'%'+_0x218978[_0xb65d('0x36')][_0xb65d('0x45')]+'%'};return _0x5613b8;})});}_0x3c725d=_['merge']({},_0x3c725d,_0x218978[_0xb65d('0x46')]);return _0x34ddb7[_0xb65d('0x67')](_0x3c725d);}})[_0xb65d('0x28')](function(_0x40b52c){if(_0x40b52c){_0x5d8d65=_0x40b52c[_0xb65d('0x3c')];if(!_0x218978[_0xb65d('0x36')]['hasOwnProperty']('nolimit')){_0x3c725d['limit']=qs[_0xb65d('0x21')](_0x218978[_0xb65d('0x36')]['limit']);_0x3c725d['offset']=qs[_0xb65d('0x1e')](_0x218978[_0xb65d('0x36')][_0xb65d('0x1e')]);}return _0x34ddb7['getTeams'](_0x3c725d);}})['then'](function(_0x53c3fb){if(_0x53c3fb){return _0x53c3fb?{'count':_0x5d8d65,'rows':_0x53c3fb}:null;}})[_0xb65d('0x28')](respondWithResult(_0x585715,null))['catch'](handleError(_0x585715,null));};exports['addTeams']=function(_0x5d229a,_0x3a4770,_0x8a967d){var _0xd3132d=_0x5d229a[_0xb65d('0x4e')][_0xb65d('0x69')];return db['Team'][_0xb65d('0x48')]({'where':{'id':_0xd3132d},'attributes':['id'],'include':[{'model':db[_0xb65d('0x5e')],'as':'Agents','attributes':['id',_0xb65d('0x2f'),'online',_0xb65d('0x6a'),_0xb65d('0x6b')],'raw':!![]}]})[_0xb65d('0x28')](function(_0x5c388c){if(_0x5c388c){var _0x51e3d0=_[_0xb65d('0x6c')](_0x5c388c,function(_0x2e2029){var _0x731b28=_0x2e2029[_0xb65d('0x2a')]({'plain':!![]});return _0x731b28[_0xb65d('0x6d')];});return db[_0xb65d('0x33')][_0xb65d('0x56')]({'where':{'id':_0x5d229a[_0xb65d('0x55')]['id']}})[_0xb65d('0x28')](function(_0x6a3b53){return db['sequelize'][_0xb65d('0x6e')](function(_0x36c196){return _0x6a3b53[_0xb65d('0x6f')](_0xd3132d,{'transaction':_0x36c196})[_0xb65d('0x28')](function(){return BPromise[_0xb65d('0x70')](_0x51e3d0,function(_0x384e52){return db[_0xb65d('0x5a')][_0xb65d('0x71')]({'where':{'UserId':_0x384e52['id'],'OpenchannelQueueId':_0x5d229a['params']['id']},'transaction':_0x36c196});});})[_0xb65d('0x28')](function(){_0x51e3d0[_0xb65d('0x72')](function(_0x3f74ef){socket[_0xb65d('0x73')](_0xb65d('0x74'),{'UserId':_0x3f74ef['id'],'OpenchannelQueueId':_0x6a3b53['id']});});});});});}})['then'](respondWithStatusCode(_0x3a4770,null))[_0xb65d('0x4a')](handleError(_0x3a4770,null));};exports[_0xb65d('0x75')]=function(_0x17e9fb,_0x13c119,_0x5ea708){return db[_0xb65d('0x68')]['findAll']({'where':{'id':_0x17e9fb[_0xb65d('0x36')][_0xb65d('0x69')]},'attributes':['id'],'include':[{'model':db[_0xb65d('0x5e')],'as':_0xb65d('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xb65d('0x28')](handleEntityNotFound(_0x13c119,null))['then'](function(_0x5d6a4b){var _0xcbd875=_[_0xb65d('0x32')](_0x5d6a4b,'id');var _0x2a398b=[];var _0x4e83ed=[];var _0x2d1654=squel['select']();_0x2d1654[_0xb65d('0x76')](_0xb65d('0x77'))[_0xb65d('0x78')](_0xb65d('0x79'),'tq')[_0xb65d('0x7a')](_0xb65d('0x7b'),'ut',_0xb65d('0x7c'))[_0xb65d('0x40')]('OpenchannelQueueId\x20=\x20?',_0x17e9fb[_0xb65d('0x55')]['id']);for(var _0x426b6c=0x0;_0x426b6c<_0x5d6a4b[_0xb65d('0x3c')];_0x426b6c+=0x1){let _0x1fc18e=_0x5d6a4b[_0x426b6c];for(var _0x85cfec=0x0;_0x85cfec<_0x1fc18e[_0xb65d('0x6d')][_0xb65d('0x3c')];_0x85cfec+=0x1){let _0x5309c4=_0x1fc18e[_0xb65d('0x6d')][_0x85cfec];var _0x790534=_0x2d1654['clone']();_0x790534[_0xb65d('0x40')]('ut.UserId\x20=\x20?',_0x5309c4['id']);_0x4e83ed['push'](db[_0xb65d('0x7d')]['query'](_0x790534[_0xb65d('0x7e')](),{'type':db[_0xb65d('0x7d')][_0xb65d('0x7f')]['SELECT']})[_0xb65d('0x28')](function(_0x16a31b){if(_0x16a31b['length']===0x1){return _0x5309c4['id'];}else{var _0x327971=_[_0xb65d('0x80')](_[_0xb65d('0x32')](_0x16a31b,_0xb65d('0x81')),function(_0x19156b){return _[_0xb65d('0x82')](_0xcbd875,_0x19156b);});if(_0x327971){return _0x5309c4['id'];}}}));}}return BPromise[_0xb65d('0x83')](_0x4e83ed)[_0xb65d('0x28')](function(_0x4f6ea8){_0x2a398b=_(_0x2a398b)[_0xb65d('0x84')](_0x4f6ea8)['compact']()['value']();return db[_0xb65d('0x33')][_0xb65d('0x56')]({'where':{'id':_0x17e9fb[_0xb65d('0x55')]['id']}})[_0xb65d('0x28')](function(_0x2a765a){return db['sequelize']['transaction'](function(_0x28e7f6){return _0x2a765a[_0xb65d('0x75')](_0x17e9fb['query'][_0xb65d('0x69')],{'transaction':_0x28e7f6})[_0xb65d('0x28')](function(){if(!_[_0xb65d('0x85')](_0x2a398b)){return _0x2a765a[_0xb65d('0x86')](_0x2a398b,{'transaction':_0x28e7f6});}})[_0xb65d('0x28')](function(){_0x2a398b[_0xb65d('0x72')](function(_0x4dd5a9){socket[_0xb65d('0x73')](_0xb65d('0x87'),{'UserId':_0x4dd5a9,'OpenchannelQueueId':_0x2a765a['id']});});});});});});})['then'](respondWithStatusCode(_0x13c119,null))[_0xb65d('0x4a')](handleError(_0x13c119,null));};exports[_0xb65d('0x88')]=function(_0x1ded9a,_0x489962,_0x5cb26e){return db['OpenchannelQueue'][_0xb65d('0x56')]({'where':{'id':_0x1ded9a[_0xb65d('0x55')]['id']}})[_0xb65d('0x28')](handleEntityNotFound(_0x489962,null))[_0xb65d('0x28')](function(_0x5758a2){if(_0x5758a2){return _0x5758a2[_0xb65d('0x88')](_0x1ded9a[_0xb65d('0x4e')][_0xb65d('0x69')],_['omit'](_0x1ded9a[_0xb65d('0x4e')],[_0xb65d('0x69'),'id'])||{})['spread'](function(_0x2ad6ad){for(var _0x1a8005=0x0;_0x1a8005<_0x1ded9a[_0xb65d('0x4e')][_0xb65d('0x69')][_0xb65d('0x3c')];_0x1a8005+=0x1){socket[_0xb65d('0x73')](_0xb65d('0x74'),{'UserId':Number(_0x1ded9a[_0xb65d('0x4e')][_0xb65d('0x69')][_0x1a8005]),'OpenchannelQueueId':Number(_0x1ded9a[_0xb65d('0x55')]['id'])});}return _0x2ad6ad;});}})[_0xb65d('0x28')](respondWithResult(_0x489962,null))['catch'](handleError(_0x489962,null));};exports[_0xb65d('0x86')]=function(_0x2a736c,_0x413228,_0x5d6cd0){return db[_0xb65d('0x33')]['find']({'where':{'id':_0x2a736c[_0xb65d('0x55')]['id']}})[_0xb65d('0x28')](handleEntityNotFound(_0x413228,null))[_0xb65d('0x28')](function(_0x31ac4c){if(_0x31ac4c){return _0x31ac4c[_0xb65d('0x86')](_0x2a736c[_0xb65d('0x36')][_0xb65d('0x69')])['then'](function(){if(_['isArray'](_0x2a736c[_0xb65d('0x36')][_0xb65d('0x69')])){for(var _0x1e4d5a=0x0;_0x1e4d5a<_0x2a736c[_0xb65d('0x36')][_0xb65d('0x69')]['length'];_0x1e4d5a+=0x1){socket[_0xb65d('0x73')](_0xb65d('0x87'),{'UserId':Number(_0x2a736c['query']['ids'][_0x1e4d5a]),'OpenchannelQueueId':Number(_0x2a736c['params']['id'])});}}else{socket[_0xb65d('0x73')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2a736c['query']['ids']),'OpenchannelQueueId':Number(_0x2a736c[_0xb65d('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x413228,null))[_0xb65d('0x4a')](handleError(_0x413228,null));};exports[_0xb65d('0x89')]=function(_0xcb531a,_0xd75bf4,_0x454188){var _0x3e2fa6={};var _0x1db1eb={};var _0x7740db;var _0x13dd98;return db[_0xb65d('0x33')][_0xb65d('0x59')]({'where':{'id':_0xcb531a[_0xb65d('0x55')]['id']}})['then'](handleEntityNotFound(_0xd75bf4,null))[_0xb65d('0x28')](function(_0x1a1b78){if(_0x1a1b78){_0x7740db=_0x1a1b78;_0x1db1eb[_0xb65d('0x39')]=_[_0xb65d('0x37')](db[_0xb65d('0x5e')][_0xb65d('0x4c')]);_0x1db1eb[_0xb65d('0x36')]=_[_0xb65d('0x37')](_0xcb531a[_0xb65d('0x36')]);_0x1db1eb['filters']=_[_0xb65d('0x38')](_0x1db1eb[_0xb65d('0x39')],_0x1db1eb[_0xb65d('0x36')]);_0x3e2fa6[_0xb65d('0x3a')]=_['intersection'](_0x1db1eb['model'],qs[_0xb65d('0x3b')](_0xcb531a['query'][_0xb65d('0x3b')]));_0x3e2fa6[_0xb65d('0x3a')]=_0x3e2fa6['attributes'][_0xb65d('0x3c')]?_0x3e2fa6[_0xb65d('0x3a')]:_0x1db1eb[_0xb65d('0x39')];_0x3e2fa6['order']=qs[_0xb65d('0x3f')](_0xcb531a[_0xb65d('0x36')][_0xb65d('0x3f')]);_0x3e2fa6[_0xb65d('0x40')]=qs[_0xb65d('0x41')](_['pick'](_0xcb531a['query'],_0x1db1eb[_0xb65d('0x41')]));if(_0xcb531a[_0xb65d('0x36')][_0xb65d('0x45')]){_0x3e2fa6['where']=_['merge'](_0x3e2fa6[_0xb65d('0x40')],{'$or':_[_0xb65d('0x32')](_0x3e2fa6[_0xb65d('0x3a')],function(_0x18ae13){var _0x312c8b={};_0x312c8b[_0x18ae13]={'$like':'%'+_0xcb531a[_0xb65d('0x36')]['filter']+'%'};return _0x312c8b;})});}_0x3e2fa6=_[_0xb65d('0x42')]({},_0x3e2fa6,_0xcb531a[_0xb65d('0x46')]);return _0x7740db[_0xb65d('0x89')](_0x3e2fa6);}})[_0xb65d('0x28')](function(_0x2266ab){if(_0x2266ab){_0x13dd98=_0x2266ab[_0xb65d('0x3c')];if(!_0xcb531a[_0xb65d('0x36')][_0xb65d('0x5b')](_0xb65d('0x3d'))){_0x3e2fa6[_0xb65d('0x21')]=qs['limit'](_0xcb531a[_0xb65d('0x36')][_0xb65d('0x21')]);_0x3e2fa6[_0xb65d('0x1e')]=qs['offset'](_0xcb531a[_0xb65d('0x36')]['offset']);}return _0x7740db['getAgents'](_0x3e2fa6);}})[_0xb65d('0x28')](function(_0x57d100){if(_0x57d100){return _0x57d100?{'count':_0x13dd98,'rows':_0x57d100}:null;}})[_0xb65d('0x28')](respondWithResult(_0xd75bf4,null))[_0xb65d('0x4a')](handleError(_0xd75bf4,null));};
\ No newline at end of file
+var _0x79b1=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','get','OpenchannelQueues','UserProfileResource','destroy','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','include','findAll','rows','catch','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','union','compact','isEmpty','removeAgents','forEach','emit','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents'];(function(_0x31132e,_0x11742f){var _0x3501c0=function(_0x541a27){while(--_0x541a27){_0x31132e['push'](_0x31132e['shift']());}};_0x3501c0(++_0x11742f);}(_0x79b1,0x1aa));var _0x179b=function(_0x606489,_0x61329e){_0x606489=_0x606489-0x0;var _0x3c91df=_0x79b1[_0x606489];return _0x3c91df;};'use strict';var emlformat=require(_0x179b('0x0'));var rimraf=require(_0x179b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x179b('0x2'));var rp=require(_0x179b('0x3'));var moment=require(_0x179b('0x4'));var BPromise=require(_0x179b('0x5'));var Mustache=require('mustache');var util=require(_0x179b('0x6'));var path=require('path');var sox=require(_0x179b('0x7'));var csv=require(_0x179b('0x8'));var ejs=require(_0x179b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x179b('0xa'));var squel=require('squel');var crypto=require(_0x179b('0xb'));var jsforce=require(_0x179b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x179b('0xd'));var Papa=require('papaparse');var Redis=require(_0x179b('0xe'));var authService=require(_0x179b('0xf'));var qs=require(_0x179b('0x10'));var as=require(_0x179b('0x11'));var hardwareService=require(_0x179b('0x12'));var logger=require(_0x179b('0x13'))(_0x179b('0x14'));var utils=require(_0x179b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x179b('0x16'));var db=require('../../mysqldb')['db'];config[_0x179b('0x17')]=_[_0x179b('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x179b('0x17')]));require(_0x179b('0x19'))[_0x179b('0x1a')](socket);function respondWithStatusCode(_0x184161,_0x2367c9){_0x2367c9=_0x2367c9||0xcc;return function(_0x3d9e32){if(_0x3d9e32){return _0x184161[_0x179b('0x1b')](_0x2367c9);}return _0x184161[_0x179b('0x1c')](_0x2367c9)[_0x179b('0x1d')]();};}function respondWithResult(_0x205cd0,_0x40775b){_0x40775b=_0x40775b||0xc8;return function(_0x548ab4){if(_0x548ab4){return _0x205cd0[_0x179b('0x1c')](_0x40775b)[_0x179b('0x1e')](_0x548ab4);}};}function respondWithFilteredResult(_0xc9788b,_0x461b37){return function(_0x75c218){if(_0x75c218){var _0x2c93ba=typeof _0x461b37[_0x179b('0x1f')]===_0x179b('0x20')&&typeof _0x461b37['limit']==='undefined';var _0x46004b=_0x75c218['count'];var _0x3df5ee=_0x2c93ba?0x0:_0x461b37['offset'];var _0x2ea576=_0x2c93ba?_0x75c218[_0x179b('0x21')]:_0x461b37[_0x179b('0x1f')]+_0x461b37[_0x179b('0x22')];var _0x2e4be7;if(_0x2ea576>=_0x46004b){_0x2ea576=_0x46004b;_0x2e4be7=0xc8;}else{_0x2e4be7=0xce;}_0xc9788b['status'](_0x2e4be7);return _0xc9788b[_0x179b('0x23')](_0x179b('0x24'),_0x3df5ee+'-'+_0x2ea576+'/'+_0x46004b)[_0x179b('0x1e')](_0x75c218);}return null;};}function patchUpdates(_0x177880){return function(_0x584781){try{jsonpatch[_0x179b('0x25')](_0x584781,_0x177880,!![]);}catch(_0x2c7533){return BPromise[_0x179b('0x26')](_0x2c7533);}return _0x584781[_0x179b('0x27')]();};}function saveUpdates(_0x1a2380,_0x514c2e){return function(_0x36da8c){if(_0x36da8c){return _0x36da8c['update'](_0x1a2380)[_0x179b('0x28')](function(_0xf37720){return _0xf37720;});}return null;};}function removeEntity(_0x18593e,_0x109c6b){return function(_0xdd4020){if(_0xdd4020){return _0xdd4020['destroy']()[_0x179b('0x28')](function(){var _0x191b79=_0xdd4020[_0x179b('0x29')]({'plain':!![]});var _0x14a34a=_0x179b('0x2a');return db[_0x179b('0x2b')][_0x179b('0x2c')]({'where':{'type':_0x14a34a,'resourceId':_0x191b79['id']}})[_0x179b('0x28')](function(){return _0xdd4020;});})[_0x179b('0x28')](function(){_0x18593e[_0x179b('0x1c')](0xcc)[_0x179b('0x1d')]();});}};}function handleEntityNotFound(_0x364680,_0x476107){return function(_0x14c489){if(!_0x14c489){_0x364680[_0x179b('0x1b')](0x194);}return _0x14c489;};}function handleError(_0x2f5dd7,_0x5b0bb7){_0x5b0bb7=_0x5b0bb7||0x1f4;return function(_0x39f2aa){logger['error'](_0x39f2aa['stack']);if(_0x39f2aa[_0x179b('0x2d')]){delete _0x39f2aa[_0x179b('0x2d')];}_0x2f5dd7[_0x179b('0x1c')](_0x5b0bb7)[_0x179b('0x2e')](_0x39f2aa);};}exports[_0x179b('0x2f')]=function(_0x48add2,_0x56080e){var _0x117bbc={},_0x185369={},_0x24226f={'count':0x0,'rows':[]};var _0x40a525=_[_0x179b('0x30')](db[_0x179b('0x31')][_0x179b('0x32')],function(_0x438950){return{'name':_0x438950[_0x179b('0x33')],'type':_0x438950['type'][_0x179b('0x34')]};});_0x185369[_0x179b('0x35')]=_[_0x179b('0x30')](_0x40a525,'name');_0x185369[_0x179b('0x36')]=_[_0x179b('0x37')](_0x48add2[_0x179b('0x36')]);_0x185369[_0x179b('0x38')]=_['intersection'](_0x185369[_0x179b('0x35')],_0x185369[_0x179b('0x36')]);_0x117bbc[_0x179b('0x39')]=_[_0x179b('0x3a')](_0x185369[_0x179b('0x35')],qs[_0x179b('0x3b')](_0x48add2[_0x179b('0x36')][_0x179b('0x3b')]));_0x117bbc[_0x179b('0x39')]=_0x117bbc['attributes'][_0x179b('0x3c')]?_0x117bbc['attributes']:_0x185369['model'];if(!_0x48add2[_0x179b('0x36')][_0x179b('0x3d')](_0x179b('0x3e'))){_0x117bbc[_0x179b('0x22')]=qs['limit'](_0x48add2[_0x179b('0x36')][_0x179b('0x22')]);_0x117bbc[_0x179b('0x1f')]=qs[_0x179b('0x1f')](_0x48add2['query'][_0x179b('0x1f')]);}_0x117bbc[_0x179b('0x3f')]=qs[_0x179b('0x40')](_0x48add2['query'][_0x179b('0x40')]);_0x117bbc['where']=qs[_0x179b('0x38')](_[_0x179b('0x41')](_0x48add2['query'],_0x185369[_0x179b('0x38')]),_0x40a525);if(_0x48add2[_0x179b('0x36')][_0x179b('0x42')]){_0x117bbc['where']=_[_0x179b('0x43')](_0x117bbc[_0x179b('0x44')],{'$or':_[_0x179b('0x30')](_0x40a525,function(_0xec7808){if(_0xec7808[_0x179b('0x45')]!=='VIRTUAL'){var _0x1b8233={};_0x1b8233[_0xec7808['name']]={'$like':'%'+_0x48add2[_0x179b('0x36')]['filter']+'%'};return _0x1b8233;}})});}_0x117bbc=_[_0x179b('0x43')]({},_0x117bbc,_0x48add2[_0x179b('0x46')]);var _0x168769={'where':_0x117bbc[_0x179b('0x44')]};return db['OpenchannelQueue'][_0x179b('0x21')](_0x168769)['then'](function(_0x4999d7){_0x24226f[_0x179b('0x21')]=_0x4999d7;if(_0x48add2[_0x179b('0x36')]['includeAll']){_0x117bbc[_0x179b('0x47')]=[{'all':!![]}];}return db[_0x179b('0x31')][_0x179b('0x48')](_0x117bbc);})[_0x179b('0x28')](function(_0x7b9ca2){_0x24226f[_0x179b('0x49')]=_0x7b9ca2;return _0x24226f;})[_0x179b('0x28')](respondWithFilteredResult(_0x56080e,_0x117bbc))[_0x179b('0x4a')](handleError(_0x56080e,null));};exports['show']=function(_0x27e0ca,_0x4bec8e){var _0x4a5ffd={'raw':!![],'where':{'id':_0x27e0ca[_0x179b('0x4b')]['id']}},_0x128532={};_0x128532[_0x179b('0x35')]=_[_0x179b('0x37')](db[_0x179b('0x31')][_0x179b('0x32')]);_0x128532[_0x179b('0x36')]=_[_0x179b('0x37')](_0x27e0ca['query']);_0x128532[_0x179b('0x38')]=_[_0x179b('0x3a')](_0x128532['model'],_0x128532[_0x179b('0x36')]);_0x4a5ffd[_0x179b('0x39')]=_[_0x179b('0x3a')](_0x128532[_0x179b('0x35')],qs[_0x179b('0x3b')](_0x27e0ca[_0x179b('0x36')]['fields']));_0x4a5ffd['attributes']=_0x4a5ffd[_0x179b('0x39')][_0x179b('0x3c')]?_0x4a5ffd[_0x179b('0x39')]:_0x128532[_0x179b('0x35')];if(_0x27e0ca[_0x179b('0x36')][_0x179b('0x4c')]){_0x4a5ffd[_0x179b('0x47')]=[{'all':!![]}];}_0x4a5ffd=_[_0x179b('0x43')]({},_0x4a5ffd,_0x27e0ca[_0x179b('0x46')]);return db[_0x179b('0x31')]['find'](_0x4a5ffd)['then'](handleEntityNotFound(_0x4bec8e,null))[_0x179b('0x28')](respondWithResult(_0x4bec8e,null))[_0x179b('0x4a')](handleError(_0x4bec8e,null));};exports[_0x179b('0x4d')]=function(_0x3b310f,_0x1f07f7){return db[_0x179b('0x31')][_0x179b('0x4d')](_0x3b310f[_0x179b('0x4e')],{})[_0x179b('0x28')](function(_0xf493eb){var _0x5c1fad=_0x3b310f['user'][_0x179b('0x29')]({'plain':!![]});if(!_0x5c1fad)throw new Error(_0x179b('0x4f'));if(_0x5c1fad[_0x179b('0x50')]===_0x179b('0x51')){var _0x42af09=_0xf493eb[_0x179b('0x29')]({'plain':!![]});var _0x320e4b=_0x179b('0x2a');return db[_0x179b('0x52')][_0x179b('0x53')]({'where':{'name':_0x320e4b,'userProfileId':_0x5c1fad[_0x179b('0x54')]},'raw':!![]})[_0x179b('0x28')](function(_0x53bd76){if(_0x53bd76&&_0x53bd76[_0x179b('0x55')]===0x0){return db[_0x179b('0x2b')][_0x179b('0x4d')]({'name':_0x42af09[_0x179b('0x2d')],'resourceId':_0x42af09['id'],'type':_0x53bd76['name'],'sectionId':_0x53bd76['id']},{})['then'](function(){return _0xf493eb;});}else{return _0xf493eb;}})['catch'](function(_0x13dd7a){logger[_0x179b('0x56')](_0x179b('0x57'),_0x13dd7a);throw _0x13dd7a;});}return _0xf493eb;})[_0x179b('0x28')](respondWithResult(_0x1f07f7,0xc9))[_0x179b('0x4a')](handleError(_0x1f07f7,null));};exports['update']=function(_0x21cbcf,_0x444cfa){if(_0x21cbcf[_0x179b('0x4e')]['id']){delete _0x21cbcf[_0x179b('0x4e')]['id'];}return db['OpenchannelQueue'][_0x179b('0x53')]({'where':{'id':_0x21cbcf['params']['id']}})[_0x179b('0x28')](handleEntityNotFound(_0x444cfa,null))[_0x179b('0x28')](saveUpdates(_0x21cbcf[_0x179b('0x4e')],null))[_0x179b('0x28')](respondWithResult(_0x444cfa,null))[_0x179b('0x4a')](handleError(_0x444cfa,null));};exports['destroy']=function(_0x141188,_0x2a332e){return db[_0x179b('0x31')]['find']({'where':{'id':_0x141188[_0x179b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a332e,null))[_0x179b('0x28')](removeEntity(_0x2a332e,null))[_0x179b('0x4a')](handleError(_0x2a332e,null));};exports[_0x179b('0x58')]=function(_0xb5f2c5,_0x349a4c){return db[_0x179b('0x31')][_0x179b('0x58')]()['then'](respondWithResult(_0x349a4c,null))[_0x179b('0x4a')](handleError(_0x349a4c,null));};exports[_0x179b('0x59')]=function(_0x31db4f,_0x1dca12,_0x41c9fe){var _0x2ebcb8={'raw':!![],'where':{}},_0x363e5d={},_0x54679d;return db['OpenchannelQueue'][_0x179b('0x5a')]({'where':{'id':_0x31db4f['params']['id']}})['then'](handleEntityNotFound(_0x1dca12,null))[_0x179b('0x28')](function(_0x274a37){if(_0x274a37){_0x54679d=_0x274a37[_0x179b('0x29')]({'plain':!![]});_0x363e5d['model']=_[_0x179b('0x37')](db[_0x179b('0x5b')][_0x179b('0x32')]);_0x363e5d[_0x179b('0x36')]=_[_0x179b('0x37')](_0x31db4f[_0x179b('0x36')]);_0x363e5d[_0x179b('0x38')]=_['intersection'](_0x363e5d[_0x179b('0x35')],_0x363e5d[_0x179b('0x36')]);_0x2ebcb8[_0x179b('0x39')]=_[_0x179b('0x3a')](_0x363e5d[_0x179b('0x35')],qs[_0x179b('0x3b')](_0x31db4f[_0x179b('0x36')]['fields']));_0x2ebcb8['attributes']=_0x2ebcb8[_0x179b('0x39')][_0x179b('0x3c')]?_0x2ebcb8[_0x179b('0x39')]:_0x363e5d['model'];if(!_0x31db4f[_0x179b('0x36')][_0x179b('0x3d')](_0x179b('0x3e'))){_0x2ebcb8[_0x179b('0x22')]=qs[_0x179b('0x22')](_0x31db4f[_0x179b('0x36')]['limit']);_0x2ebcb8[_0x179b('0x1f')]=qs[_0x179b('0x1f')](_0x31db4f[_0x179b('0x36')][_0x179b('0x1f')]);}_0x2ebcb8[_0x179b('0x3f')]=qs[_0x179b('0x40')](_0x31db4f[_0x179b('0x36')]['sort']);_0x2ebcb8[_0x179b('0x44')]=qs['filters'](_[_0x179b('0x41')](_0x31db4f[_0x179b('0x36')],_0x363e5d[_0x179b('0x38')]));_0x2ebcb8[_0x179b('0x44')][_0x179b('0x5c')]=_0x274a37['id'];if(_0x31db4f[_0x179b('0x36')]['filter']){_0x2ebcb8[_0x179b('0x44')]=_['merge'](_0x2ebcb8[_0x179b('0x44')],{'$or':_['map'](_0x2ebcb8[_0x179b('0x39')],function(_0x2bccb6){var _0x594cc3={};_0x594cc3[_0x2bccb6]={'$like':'%'+_0x31db4f[_0x179b('0x36')][_0x179b('0x42')]+'%'};return _0x594cc3;})});}_0x2ebcb8=_[_0x179b('0x43')]({},_0x2ebcb8,_0x31db4f[_0x179b('0x46')]);return db['UserOpenchannelQueue']['findAll'](_0x2ebcb8);}})[_0x179b('0x28')](function(_0x2f55c6){if(_0x2f55c6){return db[_0x179b('0x5d')][_0x179b('0x5e')]({'where':{'id':_[_0x179b('0x30')](_0x2f55c6,_0x179b('0x5f')),'role':'agent'},'attributes':['id',_0x179b('0x2d'),_0x179b('0x60'),'updatedAt',_0x179b('0x61')]});}})[_0x179b('0x28')](function(_0xd7fcff){if(_0xd7fcff){return{'count':_0xd7fcff[_0x179b('0x21')],'rows':_[_0x179b('0x30')](_0xd7fcff['rows'],function(_0x1a0d97){return{'membername':_0x1a0d97[_0x179b('0x2d')],'UserId':_0x1a0d97['id'],'queue_name':_0x54679d[_0x179b('0x2d')],'OpenchannelQueueId':_0x54679d['id'],'interface':util[_0x179b('0x62')](_0x179b('0x63'),_0x179b('0x64'),_0x1a0d97[_0x179b('0x2d')]),'penalty':0x0,'paused':_0x1a0d97['openchannelPause'],'createdAt':_0x1a0d97['createdAt'],'updatedAt':_0x1a0d97[_0x179b('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1dca12,_0x2ebcb8))[_0x179b('0x4a')](handleError(_0x1dca12,null));};exports[_0x179b('0x66')]=function(_0xa30b4,_0xd8edcd,_0x5c91f5){var _0x5e467a={};var _0x1c1c89={};var _0x1491cd;var _0x4b80bb;return db[_0x179b('0x31')][_0x179b('0x5a')]({'where':{'id':_0xa30b4[_0x179b('0x4b')]['id']}})[_0x179b('0x28')](handleEntityNotFound(_0xd8edcd,null))['then'](function(_0x49b509){if(_0x49b509){_0x1491cd=_0x49b509;_0x1c1c89['model']=_[_0x179b('0x37')](db[_0x179b('0x67')][_0x179b('0x32')]);_0x1c1c89[_0x179b('0x36')]=_[_0x179b('0x37')](_0xa30b4[_0x179b('0x36')]);_0x1c1c89[_0x179b('0x38')]=_['intersection'](_0x1c1c89[_0x179b('0x35')],_0x1c1c89[_0x179b('0x36')]);_0x5e467a[_0x179b('0x39')]=_['intersection'](_0x1c1c89[_0x179b('0x35')],qs[_0x179b('0x3b')](_0xa30b4[_0x179b('0x36')][_0x179b('0x3b')]));_0x5e467a[_0x179b('0x39')]=_0x5e467a[_0x179b('0x39')]['length']?_0x5e467a[_0x179b('0x39')]:_0x1c1c89[_0x179b('0x35')];_0x5e467a[_0x179b('0x3f')]=qs[_0x179b('0x40')](_0xa30b4[_0x179b('0x36')]['sort']);_0x5e467a[_0x179b('0x44')]=qs[_0x179b('0x38')](_[_0x179b('0x41')](_0xa30b4['query'],_0x1c1c89['filters']));if(_0xa30b4[_0x179b('0x36')][_0x179b('0x42')]){_0x5e467a[_0x179b('0x44')]=_[_0x179b('0x43')](_0x5e467a[_0x179b('0x44')],{'$or':_[_0x179b('0x30')](_0x5e467a[_0x179b('0x39')],function(_0x5e346a){var _0x503925={};_0x503925[_0x5e346a]={'$like':'%'+_0xa30b4['query']['filter']+'%'};return _0x503925;})});}_0x5e467a=_[_0x179b('0x43')]({},_0x5e467a,_0xa30b4[_0x179b('0x46')]);return _0x1491cd[_0x179b('0x66')](_0x5e467a);}})[_0x179b('0x28')](function(_0x4bbd5b){if(_0x4bbd5b){_0x4b80bb=_0x4bbd5b[_0x179b('0x3c')];if(!_0xa30b4[_0x179b('0x36')][_0x179b('0x3d')](_0x179b('0x3e'))){_0x5e467a['limit']=qs[_0x179b('0x22')](_0xa30b4['query'][_0x179b('0x22')]);_0x5e467a[_0x179b('0x1f')]=qs['offset'](_0xa30b4[_0x179b('0x36')][_0x179b('0x1f')]);}return _0x1491cd['getTeams'](_0x5e467a);}})['then'](function(_0x2bb889){if(_0x2bb889){return _0x2bb889?{'count':_0x4b80bb,'rows':_0x2bb889}:null;}})[_0x179b('0x28')](respondWithResult(_0xd8edcd,null))[_0x179b('0x4a')](handleError(_0xd8edcd,null));};exports['addTeams']=function(_0x5a6359,_0x1a8d5d,_0x35200b){var _0x3350c4=_0x5a6359[_0x179b('0x4e')][_0x179b('0x68')];return db[_0x179b('0x67')][_0x179b('0x48')]({'where':{'id':_0x3350c4},'attributes':['id'],'include':[{'model':db['User'],'as':_0x179b('0x69'),'attributes':['id',_0x179b('0x2d'),_0x179b('0x6a'),_0x179b('0x6b'),_0x179b('0x6c')],'raw':!![]}]})[_0x179b('0x28')](function(_0x12ec5a){if(_0x12ec5a){var _0x1b860b=_['flatMap'](_0x12ec5a,function(_0x2d84fc){var _0x272594=_0x2d84fc[_0x179b('0x29')]({'plain':!![]});return _0x272594['Agents'];});return db[_0x179b('0x31')][_0x179b('0x53')]({'where':{'id':_0x5a6359[_0x179b('0x4b')]['id']}})[_0x179b('0x28')](function(_0x4b8dfb){return db[_0x179b('0x6d')][_0x179b('0x6e')](function(_0x15f2a4){return _0x4b8dfb[_0x179b('0x6f')](_0x3350c4,{'transaction':_0x15f2a4})[_0x179b('0x28')](function(){return BPromise[_0x179b('0x70')](_0x1b860b,function(_0x40310f){return db['UserOpenchannelQueue'][_0x179b('0x71')]({'where':{'UserId':_0x40310f['id'],'OpenchannelQueueId':_0x5a6359[_0x179b('0x4b')]['id']},'transaction':_0x15f2a4});});})[_0x179b('0x28')](function(){_0x1b860b['forEach'](function(_0x352aa3){socket['emit'](_0x179b('0x72'),{'UserId':_0x352aa3['id'],'OpenchannelQueueId':_0x4b8dfb['id']});});});});});}})[_0x179b('0x28')](respondWithStatusCode(_0x1a8d5d,null))[_0x179b('0x4a')](handleError(_0x1a8d5d,null));};exports[_0x179b('0x73')]=function(_0x500ad6,_0x40803a,_0x41e898){return db[_0x179b('0x67')][_0x179b('0x48')]({'where':{'id':_0x500ad6[_0x179b('0x36')][_0x179b('0x68')]},'attributes':['id'],'include':[{'model':db[_0x179b('0x5d')],'as':_0x179b('0x69'),'attributes':['id'],'raw':!![]}]})[_0x179b('0x28')](handleEntityNotFound(_0x40803a,null))['then'](function(_0x49acf6){var _0x141666=_[_0x179b('0x30')](_0x49acf6,'id');var _0x11de1d=[];var _0x3537f7=[];var _0x1be818=squel[_0x179b('0x74')]();_0x1be818[_0x179b('0x75')](_0x179b('0x76'))[_0x179b('0x77')](_0x179b('0x78'),'tq')['join']('user_has_teams','ut',_0x179b('0x79'))[_0x179b('0x44')]('OpenchannelQueueId\x20=\x20?',_0x500ad6['params']['id']);for(var _0x1139e0=0x0;_0x1139e0<_0x49acf6['length'];_0x1139e0+=0x1){let _0x5e5229=_0x49acf6[_0x1139e0];for(var _0x5ed49c=0x0;_0x5ed49c<_0x5e5229[_0x179b('0x69')][_0x179b('0x3c')];_0x5ed49c+=0x1){let _0x4638ad=_0x5e5229[_0x179b('0x69')][_0x5ed49c];var _0x30f286=_0x1be818[_0x179b('0x7a')]();_0x30f286[_0x179b('0x44')](_0x179b('0x7b'),_0x4638ad['id']);_0x3537f7[_0x179b('0x7c')](db['sequelize']['query'](_0x30f286[_0x179b('0x7d')](),{'type':db[_0x179b('0x6d')][_0x179b('0x7e')]['SELECT']})['then'](function(_0x423c41){if(_0x423c41['length']===0x1){return _0x4638ad['id'];}else{var _0x24462f=_['every'](_['map'](_0x423c41,_0x179b('0x7f')),function(_0x53a49a){return _[_0x179b('0x80')](_0x141666,_0x53a49a);});if(_0x24462f){return _0x4638ad['id'];}}}));}}return BPromise[_0x179b('0x81')](_0x3537f7)['then'](function(_0x5915df){_0x11de1d=_(_0x11de1d)[_0x179b('0x82')](_0x5915df)[_0x179b('0x83')]()['value']();return db[_0x179b('0x31')]['find']({'where':{'id':_0x500ad6[_0x179b('0x4b')]['id']}})['then'](function(_0x103c99){return db['sequelize'][_0x179b('0x6e')](function(_0x34dca3){return _0x103c99[_0x179b('0x73')](_0x500ad6['query'][_0x179b('0x68')],{'transaction':_0x34dca3})[_0x179b('0x28')](function(){if(!_[_0x179b('0x84')](_0x11de1d)){return _0x103c99[_0x179b('0x85')](_0x11de1d,{'transaction':_0x34dca3});}})[_0x179b('0x28')](function(){_0x11de1d[_0x179b('0x86')](function(_0x3dca37){socket[_0x179b('0x87')]('userOpenchannelQueue:remove',{'UserId':_0x3dca37,'OpenchannelQueueId':_0x103c99['id']});});});});});});})[_0x179b('0x28')](respondWithStatusCode(_0x40803a,null))[_0x179b('0x4a')](handleError(_0x40803a,null));};exports['addAgents']=function(_0x5b683e,_0x5732e1,_0x596547){return db['OpenchannelQueue'][_0x179b('0x53')]({'where':{'id':_0x5b683e['params']['id']}})[_0x179b('0x28')](handleEntityNotFound(_0x5732e1,null))[_0x179b('0x28')](function(_0xe848e9){if(_0xe848e9){return _0xe848e9[_0x179b('0x88')](_0x5b683e[_0x179b('0x4e')][_0x179b('0x68')],_[_0x179b('0x89')](_0x5b683e['body'],['ids','id'])||{})[_0x179b('0x8a')](function(_0x26626e){for(var _0x2d5156=0x0;_0x2d5156<_0x5b683e[_0x179b('0x4e')][_0x179b('0x68')]['length'];_0x2d5156+=0x1){socket['emit'](_0x179b('0x72'),{'UserId':Number(_0x5b683e[_0x179b('0x4e')][_0x179b('0x68')][_0x2d5156]),'OpenchannelQueueId':Number(_0x5b683e['params']['id'])});}return _0x26626e;});}})['then'](respondWithResult(_0x5732e1,null))[_0x179b('0x4a')](handleError(_0x5732e1,null));};exports['removeAgents']=function(_0x74b2ad,_0x1aa4dd,_0x4ff52d){return db[_0x179b('0x31')]['find']({'where':{'id':_0x74b2ad[_0x179b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1aa4dd,null))['then'](function(_0x1e2f13){if(_0x1e2f13){return _0x1e2f13[_0x179b('0x85')](_0x74b2ad['query'][_0x179b('0x68')])[_0x179b('0x28')](function(){if(_[_0x179b('0x8b')](_0x74b2ad[_0x179b('0x36')][_0x179b('0x68')])){for(var _0xa46287=0x0;_0xa46287<_0x74b2ad['query'][_0x179b('0x68')][_0x179b('0x3c')];_0xa46287+=0x1){socket[_0x179b('0x87')](_0x179b('0x8c'),{'UserId':Number(_0x74b2ad[_0x179b('0x36')][_0x179b('0x68')][_0xa46287]),'OpenchannelQueueId':Number(_0x74b2ad['params']['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x74b2ad[_0x179b('0x36')][_0x179b('0x68')]),'OpenchannelQueueId':Number(_0x74b2ad['params']['id'])});}});}})[_0x179b('0x28')](respondWithStatusCode(_0x1aa4dd,null))[_0x179b('0x4a')](handleError(_0x1aa4dd,null));};exports[_0x179b('0x8d')]=function(_0x3836ee,_0x555fa,_0x540a84){var _0x11cd10={};var _0x4b5afa={};var _0x48f321;var _0x163c6a;return db[_0x179b('0x31')][_0x179b('0x5a')]({'where':{'id':_0x3836ee[_0x179b('0x4b')]['id']}})[_0x179b('0x28')](handleEntityNotFound(_0x555fa,null))[_0x179b('0x28')](function(_0x25a4a8){if(_0x25a4a8){_0x48f321=_0x25a4a8;_0x4b5afa['model']=_[_0x179b('0x37')](db[_0x179b('0x5d')]['rawAttributes']);_0x4b5afa[_0x179b('0x36')]=_[_0x179b('0x37')](_0x3836ee['query']);_0x4b5afa['filters']=_[_0x179b('0x3a')](_0x4b5afa[_0x179b('0x35')],_0x4b5afa[_0x179b('0x36')]);_0x11cd10['attributes']=_[_0x179b('0x3a')](_0x4b5afa[_0x179b('0x35')],qs['fields'](_0x3836ee[_0x179b('0x36')][_0x179b('0x3b')]));_0x11cd10[_0x179b('0x39')]=_0x11cd10['attributes'][_0x179b('0x3c')]?_0x11cd10[_0x179b('0x39')]:_0x4b5afa[_0x179b('0x35')];_0x11cd10['order']=qs['sort'](_0x3836ee[_0x179b('0x36')]['sort']);_0x11cd10[_0x179b('0x44')]=qs[_0x179b('0x38')](_[_0x179b('0x41')](_0x3836ee['query'],_0x4b5afa[_0x179b('0x38')]));if(_0x3836ee[_0x179b('0x36')][_0x179b('0x42')]){_0x11cd10[_0x179b('0x44')]=_[_0x179b('0x43')](_0x11cd10[_0x179b('0x44')],{'$or':_[_0x179b('0x30')](_0x11cd10['attributes'],function(_0x4665ac){var _0x2ead36={};_0x2ead36[_0x4665ac]={'$like':'%'+_0x3836ee[_0x179b('0x36')][_0x179b('0x42')]+'%'};return _0x2ead36;})});}_0x11cd10=_['merge']({},_0x11cd10,_0x3836ee['options']);return _0x48f321[_0x179b('0x8d')](_0x11cd10);}})[_0x179b('0x28')](function(_0x255d76){if(_0x255d76){_0x163c6a=_0x255d76[_0x179b('0x3c')];if(!_0x3836ee[_0x179b('0x36')][_0x179b('0x3d')]('nolimit')){_0x11cd10[_0x179b('0x22')]=qs[_0x179b('0x22')](_0x3836ee[_0x179b('0x36')][_0x179b('0x22')]);_0x11cd10[_0x179b('0x1f')]=qs[_0x179b('0x1f')](_0x3836ee['query'][_0x179b('0x1f')]);}return _0x48f321[_0x179b('0x8d')](_0x11cd10);}})[_0x179b('0x28')](function(_0x1a47b7){if(_0x1a47b7){return _0x1a47b7?{'count':_0x163c6a,'rows':_0x1a47b7}:null;}})[_0x179b('0x28')](respondWithResult(_0x555fa,null))['catch'](handleError(_0x555fa,null));};
\ No newline at end of file
index 161e6e8..0cc8721 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0c9=['events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x4ebf6a,_0xfd0a40){var _0x1e7a72=function(_0x5978e8){while(--_0x5978e8){_0x4ebf6a['push'](_0x4ebf6a['shift']());}};_0x1e7a72(++_0xfd0a40);}(_0xb0c9,0xd8));var _0x9b0c=function(_0x3774f5,_0x46ea55){_0x3774f5=_0x3774f5-0x0;var _0x144072=_0xb0c9[_0x3774f5];return _0x144072;};'use strict';var EventEmitter=require(_0x9b0c('0x0'));var OpenchannelQueue=require(_0x9b0c('0x1'))['db'][_0x9b0c('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9b0c('0x3')](0x0);var events={'afterCreate':_0x9b0c('0x4'),'afterUpdate':'update','afterDestroy':_0x9b0c('0x5')};function emitEvent(_0x2cdc63){return function(_0x4a1754,_0x212267,_0x546faf){OpenchannelQueueEvents[_0x9b0c('0x6')](_0x2cdc63+':'+_0x4a1754['id'],_0x4a1754);OpenchannelQueueEvents['emit'](_0x2cdc63,_0x4a1754);_0x546faf(null);};}for(var e in events){if(events[_0x9b0c('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x9b0c('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x6076=['OpenchannelQueue','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xadb9d3,_0x32d4f4){var _0x42489e=function(_0x1dab60){while(--_0x1dab60){_0xadb9d3['push'](_0xadb9d3['shift']());}};_0x42489e(++_0x32d4f4);}(_0x6076,0x1c0));var _0x6607=function(_0x3778af,_0x2caafc){_0x3778af=_0x3778af-0x0;var _0x4716fc=_0x6076[_0x3778af];return _0x4716fc;};'use strict';var EventEmitter=require(_0x6607('0x0'));var OpenchannelQueue=require(_0x6607('0x1'))['db'][_0x6607('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6607('0x3'),'afterUpdate':'update','afterDestroy':_0x6607('0x4')};function emitEvent(_0x57d272){return function(_0x32ec6e,_0x53a723,_0x41867c){OpenchannelQueueEvents[_0x6607('0x5')](_0x57d272+':'+_0x32ec6e['id'],_0x32ec6e);OpenchannelQueueEvents[_0x6607('0x5')](_0x57d272,_0x32ec6e);_0x41867c(null);};}for(var e in events){if(events[_0x6607('0x6')](e)){var event=events[e];OpenchannelQueue[_0x6607('0x7')](e,emitEvent(event));}}module[_0x6607('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
index 4378da3..07bcd1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14fa=['../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x445a63,_0x191615){var _0x269a87=function(_0x45acde){while(--_0x45acde){_0x445a63['push'](_0x445a63['shift']());}};_0x269a87(++_0x191615);}(_0x14fa,0x156));var _0xa14f=function(_0x4bab52,_0x299f01){_0x4bab52=_0x4bab52-0x0;var _0x4b6fff=_0x14fa[_0x4bab52];return _0x4b6fff;};'use strict';var _=require(_0xa14f('0x0'));var util=require(_0xa14f('0x1'));var logger=require(_0xa14f('0x2'))(_0xa14f('0x3'));var moment=require(_0xa14f('0x4'));var BPromise=require(_0xa14f('0x5'));var rp=require(_0xa14f('0x6'));var fs=require('fs');var path=require(_0xa14f('0x7'));var rimraf=require('rimraf');var config=require(_0xa14f('0x8'));var attributes=require(_0xa14f('0x9'));module[_0xa14f('0xa')]=function(_0x333dbb,_0x5980b3){return _0x333dbb[_0xa14f('0xb')](_0xa14f('0xc'),attributes,{'tableName':_0xa14f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8740=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util'];(function(_0x5aed32,_0x2a5832){var _0x4d897f=function(_0x4486cc){while(--_0x4486cc){_0x5aed32['push'](_0x5aed32['shift']());}};_0x4d897f(++_0x2a5832);}(_0x8740,0x1da));var _0x0874=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x8740[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x0874('0x0'));var util=require(_0x0874('0x1'));var logger=require(_0x0874('0x2'))(_0x0874('0x3'));var moment=require(_0x0874('0x4'));var BPromise=require(_0x0874('0x5'));var rp=require(_0x0874('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0874('0x7'));var config=require(_0x0874('0x8'));var attributes=require(_0x0874('0x9'));module[_0x0874('0xa')]=function(_0x188ccd,_0x34e506){return _0x188ccd[_0x0874('0xb')](_0x0874('0xc'),attributes,{'tableName':_0x0874('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dcf9254..8676fe2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3111=['./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','map','include','model','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x46a384,_0x12bfd0){var _0x830a96=function(_0xab15ad){while(--_0xab15ad){_0x46a384['push'](_0x46a384['shift']());}};_0x830a96(++_0x12bfd0);}(_0x3111,0x64));var _0x1311=function(_0x4c02ad,_0x3fcdc1){_0x4c02ad=_0x4c02ad-0x0;var _0xe6de92=_0x3111[_0x4c02ad];return _0xe6de92;};'use strict';var _=require(_0x1311('0x0'));var util=require(_0x1311('0x1'));var moment=require(_0x1311('0x2'));var BPromise=require(_0x1311('0x3'));var rs=require(_0x1311('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1311('0x5'));var config=require(_0x1311('0x6'));var jayson=require(_0x1311('0x7'));var client=jayson['client'][_0x1311('0x8')]({'port':0x232a});config[_0x1311('0x9')]=_['defaults'](config[_0x1311('0x9')],{'host':_0x1311('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1311('0xb'))[_0x1311('0xc')](socket);function respondWithRpcPromise(_0x4fbb7f,_0x50aa2e,_0x10484b){return new BPromise(function(_0x421a08,_0x11dfc7){return client[_0x1311('0xd')](_0x4fbb7f,_0x10484b)[_0x1311('0xe')](function(_0xbc79a9){logger['info'](_0x1311('0xf'),_0x50aa2e,_0x1311('0x10'));logger[_0x1311('0x11')](_0x1311('0x12'),_0x50aa2e,_0x1311('0x10'),JSON[_0x1311('0x13')](_0xbc79a9));if(_0xbc79a9[_0x1311('0x14')]){if(_0xbc79a9[_0x1311('0x14')][_0x1311('0x15')]===0x1f4){logger[_0x1311('0x14')](_0x1311('0xf'),_0x50aa2e,_0xbc79a9[_0x1311('0x14')][_0x1311('0x16')]);return _0x11dfc7(_0xbc79a9[_0x1311('0x14')][_0x1311('0x16')]);}logger[_0x1311('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x50aa2e,_0xbc79a9['error'][_0x1311('0x16')]);return _0x421a08(_0xbc79a9[_0x1311('0x14')][_0x1311('0x16')]);}else{logger[_0x1311('0x17')](_0x1311('0xf'),_0x50aa2e,_0x1311('0x10'));_0x421a08(_0xbc79a9['result']['message']);}})[_0x1311('0x18')](function(_0x1535b1){logger[_0x1311('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x50aa2e,_0x1535b1);_0x11dfc7(_0x1535b1);});});}exports[_0x1311('0x19')]=function(_0x157541){var _0x3583e9=this;return new Promise(function(_0x4fcf9f,_0x200c73){return db[_0x1311('0x1a')]['findAll']({'raw':_0x157541[_0x1311('0x1b')]?_0x157541[_0x1311('0x1b')][_0x1311('0x1c')]===undefined?!![]:![]:!![],'where':_0x157541['options']?_0x157541[_0x1311('0x1b')][_0x1311('0x1d')]||null:null,'attributes':_0x157541[_0x1311('0x1b')]?_0x157541[_0x1311('0x1b')][_0x1311('0x1e')]||null:null,'limit':_0x157541[_0x1311('0x1b')]?_0x157541['options'][_0x1311('0x1f')]||null:null,'include':_0x157541[_0x1311('0x1b')]?_0x157541[_0x1311('0x1b')]['include']?_[_0x1311('0x20')](_0x157541[_0x1311('0x1b')][_0x1311('0x21')],function(_0x42345b){return{'model':db[_0x42345b[_0x1311('0x22')]],'as':_0x42345b['as'],'attributes':_0x42345b[_0x1311('0x1e')],'include':_0x42345b['include']?_[_0x1311('0x20')](_0x42345b[_0x1311('0x21')],function(_0x429c61){return{'model':db[_0x429c61[_0x1311('0x22')]],'as':_0x429c61['as'],'attributes':_0x429c61['attributes'],'include':_0x429c61['include']?_[_0x1311('0x20')](_0x429c61[_0x1311('0x21')],function(_0x2c2dee){return{'model':db[_0x2c2dee['model']],'as':_0x2c2dee['as'],'attributes':_0x2c2dee[_0x1311('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1311('0xe')](function(_0x5e4bf9){logger[_0x1311('0x17')](_0x1311('0x19'),_0x157541);logger[_0x1311('0x11')]('GetOpenchannelQueue',_0x157541,JSON[_0x1311('0x13')](_0x5e4bf9));_0x4fcf9f(_0x5e4bf9);})[_0x1311('0x18')](function(_0x10f8fa){logger[_0x1311('0x14')](_0x1311('0x19'),_0x10f8fa['message'],_0x157541);_0x200c73(_0x3583e9[_0x1311('0x14')](0x1f4,_0x10f8fa[_0x1311('0x16')]));});});};exports[_0x1311('0x23')]=function(_0x2aa623){var _0x263303=this;return new Promise(function(_0x3e65a7,_0x260f83){return db[_0x1311('0x1a')][_0x1311('0x24')]({'raw':_0x2aa623[_0x1311('0x1b')]?_0x2aa623[_0x1311('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2aa623[_0x1311('0x1b')]?_0x2aa623[_0x1311('0x1b')][_0x1311('0x1d')]||null:null,'attributes':_0x2aa623[_0x1311('0x1b')]?_0x2aa623[_0x1311('0x1b')][_0x1311('0x1e')]||null:null,'include':_0x2aa623[_0x1311('0x1b')]?_0x2aa623[_0x1311('0x1b')]['include']?_[_0x1311('0x20')](_0x2aa623[_0x1311('0x1b')][_0x1311('0x21')],function(_0x16f514){return{'model':db[_0x16f514['model']],'as':_0x16f514['as'],'attributes':_0x16f514[_0x1311('0x1e')],'include':_0x16f514[_0x1311('0x21')]?_[_0x1311('0x20')](_0x16f514['include'],function(_0x7f8b32){return{'model':db[_0x7f8b32[_0x1311('0x22')]],'as':_0x7f8b32['as'],'attributes':_0x7f8b32[_0x1311('0x1e')],'include':_0x7f8b32['include']?_['map'](_0x7f8b32['include'],function(_0x461bab){return{'model':db[_0x461bab['model']],'as':_0x461bab['as'],'attributes':_0x461bab[_0x1311('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1311('0xe')](function(_0x2072be){logger[_0x1311('0x17')](_0x1311('0x23'),_0x2aa623);logger['debug'](_0x1311('0x23'),_0x2aa623,JSON[_0x1311('0x13')](_0x2072be));_0x3e65a7(_0x2072be);})[_0x1311('0x18')](function(_0x45e638){logger['error'](_0x1311('0x23'),_0x45e638['message'],_0x2aa623);_0x260f83(_0x263303[_0x1311('0x14')](0x1f4,_0x45e638[_0x1311('0x16')]));});});};
\ No newline at end of file
+var _0x4fa1=['error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','OpenchannelQueue','find','ShowOpenchannelQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0x4fa1,0x110));var _0x14fa=function(_0x260bdf,_0x228e7a){_0x260bdf=_0x260bdf-0x0;var _0x56ef20=_0x4fa1[_0x260bdf];return _0x56ef20;};'use strict';var _=require(_0x14fa('0x0'));var util=require(_0x14fa('0x1'));var moment=require(_0x14fa('0x2'));var BPromise=require('bluebird');var rs=require(_0x14fa('0x3'));var fs=require('fs');var Redis=require(_0x14fa('0x4'));var db=require(_0x14fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x14fa('0x6'))(_0x14fa('0x7'));var config=require(_0x14fa('0x8'));var jayson=require(_0x14fa('0x9'));var client=jayson[_0x14fa('0xa')][_0x14fa('0xb')]({'port':0x232a});config[_0x14fa('0xc')]=_['defaults'](config[_0x14fa('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x14fa('0xd'))(new Redis(config[_0x14fa('0xc')]));require(_0x14fa('0xe'))[_0x14fa('0xf')](socket);function respondWithRpcPromise(_0x599812,_0x460ad7,_0x2c2f6f){return new BPromise(function(_0x23d579,_0x81cbc8){return client[_0x14fa('0x10')](_0x599812,_0x2c2f6f)[_0x14fa('0x11')](function(_0x47f36c){logger[_0x14fa('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x460ad7,_0x14fa('0x13'));logger[_0x14fa('0x14')](_0x14fa('0x15'),_0x460ad7,_0x14fa('0x13'),JSON['stringify'](_0x47f36c));if(_0x47f36c['error']){if(_0x47f36c[_0x14fa('0x16')][_0x14fa('0x17')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x460ad7,_0x47f36c[_0x14fa('0x16')][_0x14fa('0x18')]);return _0x81cbc8(_0x47f36c[_0x14fa('0x16')][_0x14fa('0x18')]);}logger[_0x14fa('0x16')](_0x14fa('0x19'),_0x460ad7,_0x47f36c['error'][_0x14fa('0x18')]);return _0x23d579(_0x47f36c[_0x14fa('0x16')][_0x14fa('0x18')]);}else{logger['info'](_0x14fa('0x19'),_0x460ad7,'request\x20sent');_0x23d579(_0x47f36c[_0x14fa('0x1a')][_0x14fa('0x18')]);}})['catch'](function(_0x242a84){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x460ad7,_0x242a84);_0x81cbc8(_0x242a84);});});}exports[_0x14fa('0x1b')]=function(_0x2e1719){var _0x2d25bd=this;return new Promise(function(_0x2579ef,_0x5173ff){return db['OpenchannelQueue'][_0x14fa('0x1c')]({'raw':_0x2e1719[_0x14fa('0x1d')]?_0x2e1719['options'][_0x14fa('0x1e')]===undefined?!![]:![]:!![],'where':_0x2e1719[_0x14fa('0x1d')]?_0x2e1719[_0x14fa('0x1d')][_0x14fa('0x1f')]||null:null,'attributes':_0x2e1719[_0x14fa('0x1d')]?_0x2e1719[_0x14fa('0x1d')][_0x14fa('0x20')]||null:null,'limit':_0x2e1719[_0x14fa('0x1d')]?_0x2e1719[_0x14fa('0x1d')][_0x14fa('0x21')]||null:null,'include':_0x2e1719[_0x14fa('0x1d')]?_0x2e1719[_0x14fa('0x1d')][_0x14fa('0x22')]?_[_0x14fa('0x23')](_0x2e1719['options'][_0x14fa('0x22')],function(_0x23e641){return{'model':db[_0x23e641['model']],'as':_0x23e641['as'],'attributes':_0x23e641[_0x14fa('0x20')],'include':_0x23e641['include']?_[_0x14fa('0x23')](_0x23e641[_0x14fa('0x22')],function(_0x4d7c3d){return{'model':db[_0x4d7c3d[_0x14fa('0x24')]],'as':_0x4d7c3d['as'],'attributes':_0x4d7c3d[_0x14fa('0x20')],'include':_0x4d7c3d['include']?_['map'](_0x4d7c3d[_0x14fa('0x22')],function(_0x17dcd6){return{'model':db[_0x17dcd6[_0x14fa('0x24')]],'as':_0x17dcd6['as'],'attributes':_0x17dcd6['attributes']};}):[]};}):[]};}):[]:[]})[_0x14fa('0x11')](function(_0x1963bd){logger[_0x14fa('0x12')](_0x14fa('0x1b'),_0x2e1719);logger['debug']('GetOpenchannelQueue',_0x2e1719,JSON[_0x14fa('0x25')](_0x1963bd));_0x2579ef(_0x1963bd);})[_0x14fa('0x26')](function(_0x44770c){logger[_0x14fa('0x16')](_0x14fa('0x1b'),_0x44770c[_0x14fa('0x18')],_0x2e1719);_0x5173ff(_0x2d25bd[_0x14fa('0x16')](0x1f4,_0x44770c[_0x14fa('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x1e7714){var _0x30af70=this;return new Promise(function(_0x1d5826,_0x223961){return db[_0x14fa('0x27')][_0x14fa('0x28')]({'raw':_0x1e7714['options']?_0x1e7714[_0x14fa('0x1d')][_0x14fa('0x1e')]===undefined?!![]:![]:!![],'where':_0x1e7714[_0x14fa('0x1d')]?_0x1e7714[_0x14fa('0x1d')][_0x14fa('0x1f')]||null:null,'attributes':_0x1e7714[_0x14fa('0x1d')]?_0x1e7714[_0x14fa('0x1d')][_0x14fa('0x20')]||null:null,'include':_0x1e7714['options']?_0x1e7714[_0x14fa('0x1d')][_0x14fa('0x22')]?_[_0x14fa('0x23')](_0x1e7714[_0x14fa('0x1d')][_0x14fa('0x22')],function(_0x5bf4e6){return{'model':db[_0x5bf4e6[_0x14fa('0x24')]],'as':_0x5bf4e6['as'],'attributes':_0x5bf4e6['attributes'],'include':_0x5bf4e6[_0x14fa('0x22')]?_[_0x14fa('0x23')](_0x5bf4e6[_0x14fa('0x22')],function(_0x376c30){return{'model':db[_0x376c30['model']],'as':_0x376c30['as'],'attributes':_0x376c30[_0x14fa('0x20')],'include':_0x376c30[_0x14fa('0x22')]?_[_0x14fa('0x23')](_0x376c30[_0x14fa('0x22')],function(_0x2d2297){return{'model':db[_0x2d2297[_0x14fa('0x24')]],'as':_0x2d2297['as'],'attributes':_0x2d2297[_0x14fa('0x20')]};}):[]};}):[]};}):[]:[]})[_0x14fa('0x11')](function(_0x3bfe1b){logger[_0x14fa('0x12')](_0x14fa('0x29'),_0x1e7714);logger[_0x14fa('0x14')](_0x14fa('0x29'),_0x1e7714,JSON[_0x14fa('0x25')](_0x3bfe1b));_0x1d5826(_0x3bfe1b);})[_0x14fa('0x26')](function(_0x8cda52){logger[_0x14fa('0x16')]('ShowOpenchannelQueue',_0x8cda52[_0x14fa('0x18')],_0x1e7714);_0x223961(_0x30af70[_0x14fa('0x16')](0x1f4,_0x8cda52['message']));});});};
\ No newline at end of file
index e9801ed..3b4c224 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd41c=['update','emit','removeListener','register','length','openchannelQueue:','remove'];(function(_0x3d93aa,_0x48da03){var _0x3ac67c=function(_0x18c0f1){while(--_0x18c0f1){_0x3d93aa['push'](_0x3d93aa['shift']());}};_0x3ac67c(++_0x48da03);}(_0xd41c,0x92));var _0xcd41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd41c[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xcd41('0x0'),_0xcd41('0x1')];function createListener(_0x5e0679,_0x2c28f4){return function(_0x50279f){_0x2c28f4[_0xcd41('0x2')](_0x5e0679,_0x50279f);};}function removeListener(_0xa3e682,_0x10e529){return function(){OpenchannelQueueEvents[_0xcd41('0x3')](_0xa3e682,_0x10e529);};}exports[_0xcd41('0x4')]=function(_0x17da5){for(var _0x22d85a=0x0,_0xeab3a2=events[_0xcd41('0x5')];_0x22d85a<_0xeab3a2;_0x22d85a++){var _0x2d1a4a=events[_0x22d85a];var _0x58e7cf=createListener(_0xcd41('0x6')+_0x2d1a4a,_0x17da5);OpenchannelQueueEvents['on'](_0x2d1a4a,_0x58e7cf);}};
\ No newline at end of file
+var _0x0353=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x5a92ad,_0x2219a6){var _0x2466f8=function(_0x4ad04e){while(--_0x4ad04e){_0x5a92ad['push'](_0x5a92ad['shift']());}};_0x2466f8(++_0x2219a6);}(_0x0353,0x8a));var _0x3035=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x0353[_0x2fee96];return _0x2e6ad1;};'use strict';var OpenchannelQueueEvents=require(_0x3035('0x0'));var events=[_0x3035('0x1'),_0x3035('0x2'),_0x3035('0x3')];function createListener(_0x4861f9,_0x181791){return function(_0x363ddb){_0x181791[_0x3035('0x4')](_0x4861f9,_0x363ddb);};}function removeListener(_0x4a4f5e,_0x3a36d2){return function(){OpenchannelQueueEvents[_0x3035('0x5')](_0x4a4f5e,_0x3a36d2);};}exports[_0x3035('0x6')]=function(_0x127241){for(var _0x1a15f8=0x0,_0x18cf5b=events[_0x3035('0x7')];_0x1a15f8<_0x18cf5b;_0x1a15f8++){var _0x446fb1=events[_0x1a15f8];var _0x37cc16=createListener(_0x3035('0x8')+_0x446fb1,_0x127241);OpenchannelQueueEvents['on'](_0x446fb1,_0x37cc16);}};
\ No newline at end of file
index 8000b42..1064fa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ed9=['describe','/:id','post','create','put','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3cf0fa,_0x12d875){var _0x446657=function(_0x47ee7c){while(--_0x47ee7c){_0x3cf0fa['push'](_0x3cf0fa['shift']());}};_0x446657(++_0x12d875);}(_0x9ed9,0xa0));var _0x99ed=function(_0x24ecb6,_0x55841d){_0x24ecb6=_0x24ecb6-0x0;var _0x52e50d=_0x9ed9[_0x24ecb6];return _0x52e50d;};'use strict';var multer=require('multer');var util=require(_0x99ed('0x0'));var path=require('path');var timeout=require(_0x99ed('0x1'));var express=require(_0x99ed('0x2'));var router=express[_0x99ed('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x99ed('0x4'));var interaction=require(_0x99ed('0x5'));var config=require('../../config/environment');var controller=require(_0x99ed('0x6'));router[_0x99ed('0x7')]('/',auth[_0x99ed('0x8')](),controller[_0x99ed('0x9')]);router['get'](_0x99ed('0xa'),auth[_0x99ed('0x8')](),controller[_0x99ed('0xb')]);router[_0x99ed('0x7')](_0x99ed('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x99ed('0xd')]('/',auth[_0x99ed('0x8')](),controller[_0x99ed('0xe')]);router[_0x99ed('0xf')]('/:id',auth[_0x99ed('0x8')](),controller[_0x99ed('0x10')]);router[_0x99ed('0x11')]('/:id',auth[_0x99ed('0x8')](),controller[_0x99ed('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xaf19=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0xbd6018,_0x3dd354){var _0x54c53e=function(_0x31d861){while(--_0x31d861){_0xbd6018['push'](_0xbd6018['shift']());}};_0x54c53e(++_0x3dd354);}(_0xaf19,0x154));var _0x9af1=function(_0x1dbce3,_0x18404d){_0x1dbce3=_0x1dbce3-0x0;var _0x105378=_0xaf19[_0x1dbce3];return _0x105378;};'use strict';var multer=require(_0x9af1('0x0'));var util=require(_0x9af1('0x1'));var path=require(_0x9af1('0x2'));var timeout=require(_0x9af1('0x3'));var express=require(_0x9af1('0x4'));var router=express['Router']();var fs_extra=require(_0x9af1('0x5'));var auth=require(_0x9af1('0x6'));var interaction=require(_0x9af1('0x7'));var config=require('../../config/environment');var controller=require(_0x9af1('0x8'));router['get']('/',auth[_0x9af1('0x9')](),controller[_0x9af1('0xa')]);router['get'](_0x9af1('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9af1('0xc'),auth[_0x9af1('0x9')](),controller[_0x9af1('0xd')]);router[_0x9af1('0xe')]('/',auth['isAuthenticated'](),controller[_0x9af1('0xf')]);router[_0x9af1('0x10')](_0x9af1('0xc'),auth[_0x9af1('0x9')](),controller['update']);router[_0x9af1('0x11')]('/:id',auth[_0x9af1('0x9')](),controller[_0x9af1('0x12')]);module['exports']=router;
\ No newline at end of file
index 4e6cf37..bc13a0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1226=['DATE','moment','sequelize','exports','STRING'];(function(_0x3ec822,_0x59a9c2){var _0x5927c6=function(_0x56a240){while(--_0x56a240){_0x3ec822['push'](_0x3ec822['shift']());}};_0x5927c6(++_0x59a9c2);}(_0x1226,0x173));var _0x6122=function(_0xcc9eff,_0x13e26c){_0xcc9eff=_0xcc9eff-0x0;var _0x12b034=_0x1226[_0xcc9eff];return _0x12b034;};'use strict';var moment=require(_0x6122('0x0'));var Sequelize=require(_0x6122('0x1'));module[_0x6122('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6122('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6122('0x4')]},'exitAt':{'type':Sequelize[_0x6122('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa43a=['STRING','DATE','moment','sequelize','exports'];(function(_0x7c9fba,_0x10b015){var _0x5cceed=function(_0x4ae29a){while(--_0x4ae29a){_0x7c9fba['push'](_0x7c9fba['shift']());}};_0x5cceed(++_0x10b015);}(_0xa43a,0xe3));var _0xaa43=function(_0x40d70b,_0x1389fe){_0x40d70b=_0x40d70b-0x0;var _0xf1eab1=_0xa43a[_0x40d70b];return _0xf1eab1;};'use strict';var moment=require(_0xaa43('0x0'));var Sequelize=require(_0xaa43('0x1'));module[_0xaa43('0x2')]={'uniqueid':{'type':Sequelize[_0xaa43('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xaa43('0x3')]},'joinAt':{'type':Sequelize[_0xaa43('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xaa43('0x4')]},'exitAt':{'type':Sequelize[_0xaa43('0x4')]},'reason':{'type':Sequelize[_0xaa43('0x3')]}};
\ No newline at end of file
index ca00f9c..2ce08d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c39=['VIRTUAL','merge','include','findAll','catch','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x3792e7,_0x2078e1){var _0x10221f=function(_0xcb7a2){while(--_0xcb7a2){_0x3792e7['push'](_0x3792e7['shift']());}};_0x10221f(++_0x2078e1);}(_0x0c39,0x18d));var _0x90c3=function(_0x41e394,_0x57f4f0){_0x41e394=_0x41e394-0x0;var _0x18350b=_0x0c39[_0x41e394];return _0x18350b;};'use strict';var emlformat=require(_0x90c3('0x0'));var rimraf=require(_0x90c3('0x1'));var zipdir=require(_0x90c3('0x2'));var jsonpatch=require(_0x90c3('0x3'));var rp=require(_0x90c3('0x4'));var moment=require(_0x90c3('0x5'));var BPromise=require(_0x90c3('0x6'));var Mustache=require(_0x90c3('0x7'));var util=require(_0x90c3('0x8'));var path=require(_0x90c3('0x9'));var sox=require(_0x90c3('0xa'));var csv=require(_0x90c3('0xb'));var ejs=require(_0x90c3('0xc'));var fs=require('fs');var fs_extra=require(_0x90c3('0xd'));var _=require(_0x90c3('0xe'));var squel=require(_0x90c3('0xf'));var crypto=require(_0x90c3('0x10'));var jsforce=require(_0x90c3('0x11'));var deskjs=require(_0x90c3('0x12'));var toCsv=require(_0x90c3('0xb'));var querystring=require(_0x90c3('0x13'));var Papa=require('papaparse');var Redis=require(_0x90c3('0x14'));var authService=require(_0x90c3('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x90c3('0x16'))(_0x90c3('0x17'));var utils=require(_0x90c3('0x18'));var config=require(_0x90c3('0x19'));var licenseUtil=require(_0x90c3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x123578,_0x26d56b){_0x26d56b=_0x26d56b||0xcc;return function(_0x4b228b){if(_0x4b228b){return _0x123578[_0x90c3('0x1b')](_0x26d56b);}return _0x123578[_0x90c3('0x1c')](_0x26d56b)[_0x90c3('0x1d')]();};}function respondWithResult(_0x314f59,_0x29c741){_0x29c741=_0x29c741||0xc8;return function(_0x2ac868){if(_0x2ac868){return _0x314f59[_0x90c3('0x1c')](_0x29c741)[_0x90c3('0x1e')](_0x2ac868);}};}function respondWithFilteredResult(_0x2d95d2,_0x18fa29){return function(_0x149ab0){if(_0x149ab0){var _0x415078=typeof _0x18fa29['offset']===_0x90c3('0x1f')&&typeof _0x18fa29['limit']===_0x90c3('0x1f');var _0x1b237c=_0x149ab0[_0x90c3('0x20')];var _0x57a32f=_0x415078?0x0:_0x18fa29[_0x90c3('0x21')];var _0x3c49a5=_0x415078?_0x149ab0['count']:_0x18fa29[_0x90c3('0x21')]+_0x18fa29[_0x90c3('0x22')];var _0x5f5d49;if(_0x3c49a5>=_0x1b237c){_0x3c49a5=_0x1b237c;_0x5f5d49=0xc8;}else{_0x5f5d49=0xce;}_0x2d95d2[_0x90c3('0x1c')](_0x5f5d49);return _0x2d95d2['set'](_0x90c3('0x23'),_0x57a32f+'-'+_0x3c49a5+'/'+_0x1b237c)[_0x90c3('0x1e')](_0x149ab0);}return null;};}function patchUpdates(_0x2ad335){return function(_0x15ab8c){try{jsonpatch[_0x90c3('0x24')](_0x15ab8c,_0x2ad335,!![]);}catch(_0x424dba){return BPromise['reject'](_0x424dba);}return _0x15ab8c[_0x90c3('0x25')]();};}function saveUpdates(_0x43ad9a,_0x2805eb){return function(_0x6f1e8b){if(_0x6f1e8b){return _0x6f1e8b[_0x90c3('0x26')](_0x43ad9a)[_0x90c3('0x27')](function(_0x4d23bb){return _0x4d23bb;});}return null;};}function removeEntity(_0x3ffa91,_0x4d2664){return function(_0x565a8d){if(_0x565a8d){return _0x565a8d[_0x90c3('0x28')]()[_0x90c3('0x27')](function(){_0x3ffa91['status'](0xcc)[_0x90c3('0x1d')]();});}};}function handleEntityNotFound(_0x3a0b6d,_0x10b664){return function(_0x45a73e){if(!_0x45a73e){_0x3a0b6d[_0x90c3('0x1b')](0x194);}return _0x45a73e;};}function handleError(_0x16230a,_0x1fc8ba){_0x1fc8ba=_0x1fc8ba||0x1f4;return function(_0xebb94c){logger['error'](_0xebb94c[_0x90c3('0x29')]);if(_0xebb94c[_0x90c3('0x2a')]){delete _0xebb94c['name'];}_0x16230a[_0x90c3('0x1c')](_0x1fc8ba)[_0x90c3('0x2b')](_0xebb94c);};}exports[_0x90c3('0x2c')]=function(_0x209def,_0x3ec8ad){var _0x5588cb={},_0x5b324b={},_0x55da29={'count':0x0,'rows':[]};var _0x384a41=_['map'](db[_0x90c3('0x2d')][_0x90c3('0x2e')],function(_0x69456e){return{'name':_0x69456e[_0x90c3('0x2f')],'type':_0x69456e[_0x90c3('0x30')][_0x90c3('0x31')]};});_0x5b324b[_0x90c3('0x32')]=_[_0x90c3('0x33')](_0x384a41,_0x90c3('0x2a'));_0x5b324b[_0x90c3('0x34')]=_[_0x90c3('0x35')](_0x209def[_0x90c3('0x34')]);_0x5b324b[_0x90c3('0x36')]=_[_0x90c3('0x37')](_0x5b324b[_0x90c3('0x32')],_0x5b324b['query']);_0x5588cb[_0x90c3('0x38')]=_['intersection'](_0x5b324b[_0x90c3('0x32')],qs[_0x90c3('0x39')](_0x209def[_0x90c3('0x34')][_0x90c3('0x39')]));_0x5588cb['attributes']=_0x5588cb[_0x90c3('0x38')][_0x90c3('0x3a')]?_0x5588cb['attributes']:_0x5b324b[_0x90c3('0x32')];if(!_0x209def[_0x90c3('0x34')][_0x90c3('0x3b')](_0x90c3('0x3c'))){_0x5588cb[_0x90c3('0x22')]=qs[_0x90c3('0x22')](_0x209def[_0x90c3('0x34')][_0x90c3('0x22')]);_0x5588cb[_0x90c3('0x21')]=qs['offset'](_0x209def['query'][_0x90c3('0x21')]);}_0x5588cb[_0x90c3('0x3d')]=qs[_0x90c3('0x3e')](_0x209def['query'][_0x90c3('0x3e')]);_0x5588cb[_0x90c3('0x3f')]=qs[_0x90c3('0x36')](_['pick'](_0x209def[_0x90c3('0x34')],_0x5b324b[_0x90c3('0x36')]),_0x384a41);if(_0x209def['query'][_0x90c3('0x40')]){_0x5588cb['where']=_['merge'](_0x5588cb[_0x90c3('0x3f')],{'$or':_[_0x90c3('0x33')](_0x384a41,function(_0x55a742){if(_0x55a742[_0x90c3('0x30')]!==_0x90c3('0x41')){var _0x494cdc={};_0x494cdc[_0x55a742[_0x90c3('0x2a')]]={'$like':'%'+_0x209def[_0x90c3('0x34')][_0x90c3('0x40')]+'%'};return _0x494cdc;}})});}_0x5588cb=_[_0x90c3('0x42')]({},_0x5588cb,_0x209def['options']);var _0x1ed2e6={'where':_0x5588cb[_0x90c3('0x3f')]};return db['OpenchannelQueueReport'][_0x90c3('0x20')](_0x1ed2e6)[_0x90c3('0x27')](function(_0x52ba65){_0x55da29[_0x90c3('0x20')]=_0x52ba65;if(_0x209def['query']['includeAll']){_0x5588cb[_0x90c3('0x43')]=[{'all':!![]}];}return db[_0x90c3('0x2d')][_0x90c3('0x44')](_0x5588cb);})[_0x90c3('0x27')](function(_0x5eee8f){_0x55da29['rows']=_0x5eee8f;return _0x55da29;})[_0x90c3('0x27')](respondWithFilteredResult(_0x3ec8ad,_0x5588cb))[_0x90c3('0x45')](handleError(_0x3ec8ad,null));};exports['show']=function(_0x3037d8,_0x1d7f5c){var _0x12c50c={'raw':!![],'where':{'id':_0x3037d8['params']['id']}},_0x201dd1={};_0x201dd1['model']=_[_0x90c3('0x35')](db['OpenchannelQueueReport'][_0x90c3('0x2e')]);_0x201dd1[_0x90c3('0x34')]=_[_0x90c3('0x35')](_0x3037d8[_0x90c3('0x34')]);_0x201dd1['filters']=_[_0x90c3('0x37')](_0x201dd1['model'],_0x201dd1['query']);_0x12c50c[_0x90c3('0x38')]=_[_0x90c3('0x37')](_0x201dd1[_0x90c3('0x32')],qs[_0x90c3('0x39')](_0x3037d8[_0x90c3('0x34')][_0x90c3('0x39')]));_0x12c50c[_0x90c3('0x38')]=_0x12c50c['attributes'][_0x90c3('0x3a')]?_0x12c50c[_0x90c3('0x38')]:_0x201dd1[_0x90c3('0x32')];if(_0x3037d8['query'][_0x90c3('0x46')]){_0x12c50c[_0x90c3('0x43')]=[{'all':!![]}];}_0x12c50c=_['merge']({},_0x12c50c,_0x3037d8[_0x90c3('0x47')]);return db[_0x90c3('0x2d')][_0x90c3('0x48')](_0x12c50c)[_0x90c3('0x27')](handleEntityNotFound(_0x1d7f5c,null))['then'](respondWithResult(_0x1d7f5c,null))[_0x90c3('0x45')](handleError(_0x1d7f5c,null));};exports[_0x90c3('0x49')]=function(_0x2ba66e,_0x33675b){return db['OpenchannelQueueReport'][_0x90c3('0x49')](_0x2ba66e[_0x90c3('0x4a')],{})[_0x90c3('0x27')](respondWithResult(_0x33675b,0xc9))['catch'](handleError(_0x33675b,null));};exports['update']=function(_0x1fbada,_0x7e17cc){if(_0x1fbada[_0x90c3('0x4a')]['id']){delete _0x1fbada['body']['id'];}return db['OpenchannelQueueReport'][_0x90c3('0x48')]({'where':{'id':_0x1fbada[_0x90c3('0x4b')]['id']}})[_0x90c3('0x27')](handleEntityNotFound(_0x7e17cc,null))[_0x90c3('0x27')](saveUpdates(_0x1fbada[_0x90c3('0x4a')],null))[_0x90c3('0x27')](respondWithResult(_0x7e17cc,null))['catch'](handleError(_0x7e17cc,null));};exports['destroy']=function(_0x4a10bb,_0x41c284){return db[_0x90c3('0x2d')][_0x90c3('0x48')]({'where':{'id':_0x4a10bb[_0x90c3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41c284,null))['then'](removeEntity(_0x41c284,null))['catch'](handleError(_0x41c284,null));};exports[_0x90c3('0x4c')]=function(_0x23ba40,_0x29f93a){return db[_0x90c3('0x2d')][_0x90c3('0x4c')]()[_0x90c3('0x27')](respondWithResult(_0x29f93a,null))['catch'](handleError(_0x29f93a,null));};
\ No newline at end of file
+var _0x0536=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','length','options','create','body','find','describe','eml-format','rimraf'];(function(_0x4f2f6f,_0x435d4c){var _0x3c14fc=function(_0x4700a7){while(--_0x4700a7){_0x4f2f6f['push'](_0x4f2f6f['shift']());}};_0x3c14fc(++_0x435d4c);}(_0x0536,0xeb));var _0x6053=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0536[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x6053('0x0'));var rimraf=require(_0x6053('0x1'));var zipdir=require(_0x6053('0x2'));var jsonpatch=require(_0x6053('0x3'));var rp=require(_0x6053('0x4'));var moment=require(_0x6053('0x5'));var BPromise=require(_0x6053('0x6'));var Mustache=require('mustache');var util=require(_0x6053('0x7'));var path=require(_0x6053('0x8'));var sox=require('sox');var csv=require(_0x6053('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6053('0xa'));var _=require(_0x6053('0xb'));var squel=require(_0x6053('0xc'));var crypto=require('crypto');var jsforce=require(_0x6053('0xd'));var deskjs=require(_0x6053('0xe'));var toCsv=require(_0x6053('0x9'));var querystring=require('querystring');var Papa=require(_0x6053('0xf'));var Redis=require(_0x6053('0x10'));var authService=require(_0x6053('0x11'));var qs=require(_0x6053('0x12'));var as=require(_0x6053('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6053('0x14'))(_0x6053('0x15'));var utils=require(_0x6053('0x16'));var config=require(_0x6053('0x17'));var licenseUtil=require(_0x6053('0x18'));var db=require(_0x6053('0x19'))['db'];function respondWithStatusCode(_0x53679c,_0x368c73){_0x368c73=_0x368c73||0xcc;return function(_0x4a4298){if(_0x4a4298){return _0x53679c[_0x6053('0x1a')](_0x368c73);}return _0x53679c[_0x6053('0x1b')](_0x368c73)[_0x6053('0x1c')]();};}function respondWithResult(_0x1fc3a0,_0xd46604){_0xd46604=_0xd46604||0xc8;return function(_0x4a24eb){if(_0x4a24eb){return _0x1fc3a0[_0x6053('0x1b')](_0xd46604)['json'](_0x4a24eb);}};}function respondWithFilteredResult(_0x5851c1,_0x431c24){return function(_0x31eb34){if(_0x31eb34){var _0x34c85=typeof _0x431c24[_0x6053('0x1d')]===_0x6053('0x1e')&&typeof _0x431c24[_0x6053('0x1f')]===_0x6053('0x1e');var _0x1332a5=_0x31eb34[_0x6053('0x20')];var _0x41c601=_0x34c85?0x0:_0x431c24[_0x6053('0x1d')];var _0x50036a=_0x34c85?_0x31eb34['count']:_0x431c24[_0x6053('0x1d')]+_0x431c24[_0x6053('0x1f')];var _0x27f48e;if(_0x50036a>=_0x1332a5){_0x50036a=_0x1332a5;_0x27f48e=0xc8;}else{_0x27f48e=0xce;}_0x5851c1[_0x6053('0x1b')](_0x27f48e);return _0x5851c1[_0x6053('0x21')](_0x6053('0x22'),_0x41c601+'-'+_0x50036a+'/'+_0x1332a5)[_0x6053('0x23')](_0x31eb34);}return null;};}function patchUpdates(_0x52281c){return function(_0x3e23fd){try{jsonpatch['apply'](_0x3e23fd,_0x52281c,!![]);}catch(_0x1ca0b3){return BPromise[_0x6053('0x24')](_0x1ca0b3);}return _0x3e23fd['save']();};}function saveUpdates(_0x50fd35,_0x2f4e3d){return function(_0x248a42){if(_0x248a42){return _0x248a42[_0x6053('0x25')](_0x50fd35)[_0x6053('0x26')](function(_0x48297f){return _0x48297f;});}return null;};}function removeEntity(_0x2718c1,_0x46218c){return function(_0x13f4ea){if(_0x13f4ea){return _0x13f4ea[_0x6053('0x27')]()['then'](function(){_0x2718c1['status'](0xcc)[_0x6053('0x1c')]();});}};}function handleEntityNotFound(_0x58223a,_0x4408ed){return function(_0x25f561){if(!_0x25f561){_0x58223a[_0x6053('0x1a')](0x194);}return _0x25f561;};}function handleError(_0x356883,_0x5d1c31){_0x5d1c31=_0x5d1c31||0x1f4;return function(_0x4566aa){logger[_0x6053('0x28')](_0x4566aa['stack']);if(_0x4566aa['name']){delete _0x4566aa[_0x6053('0x29')];}_0x356883[_0x6053('0x1b')](_0x5d1c31)[_0x6053('0x2a')](_0x4566aa);};}exports[_0x6053('0x2b')]=function(_0x57174f,_0x530096){var _0x44bd4f={},_0x3471fc={},_0x4dfbb0={'count':0x0,'rows':[]};var _0x4823a6=_[_0x6053('0x2c')](db['OpenchannelQueueReport'][_0x6053('0x2d')],function(_0x27e494){return{'name':_0x27e494[_0x6053('0x2e')],'type':_0x27e494[_0x6053('0x2f')][_0x6053('0x30')]};});_0x3471fc[_0x6053('0x31')]=_['map'](_0x4823a6,_0x6053('0x29'));_0x3471fc['query']=_['keys'](_0x57174f[_0x6053('0x32')]);_0x3471fc[_0x6053('0x33')]=_['intersection'](_0x3471fc[_0x6053('0x31')],_0x3471fc['query']);_0x44bd4f[_0x6053('0x34')]=_[_0x6053('0x35')](_0x3471fc[_0x6053('0x31')],qs[_0x6053('0x36')](_0x57174f[_0x6053('0x32')]['fields']));_0x44bd4f['attributes']=_0x44bd4f['attributes']['length']?_0x44bd4f[_0x6053('0x34')]:_0x3471fc['model'];if(!_0x57174f[_0x6053('0x32')][_0x6053('0x37')](_0x6053('0x38'))){_0x44bd4f[_0x6053('0x1f')]=qs[_0x6053('0x1f')](_0x57174f[_0x6053('0x32')][_0x6053('0x1f')]);_0x44bd4f[_0x6053('0x1d')]=qs['offset'](_0x57174f[_0x6053('0x32')][_0x6053('0x1d')]);}_0x44bd4f[_0x6053('0x39')]=qs[_0x6053('0x3a')](_0x57174f[_0x6053('0x32')]['sort']);_0x44bd4f['where']=qs['filters'](_[_0x6053('0x3b')](_0x57174f['query'],_0x3471fc['filters']),_0x4823a6);if(_0x57174f[_0x6053('0x32')][_0x6053('0x3c')]){_0x44bd4f[_0x6053('0x3d')]=_[_0x6053('0x3e')](_0x44bd4f[_0x6053('0x3d')],{'$or':_['map'](_0x4823a6,function(_0x150302){if(_0x150302['type']!==_0x6053('0x3f')){var _0x3a5ba5={};_0x3a5ba5[_0x150302[_0x6053('0x29')]]={'$like':'%'+_0x57174f[_0x6053('0x32')][_0x6053('0x3c')]+'%'};return _0x3a5ba5;}})});}_0x44bd4f=_['merge']({},_0x44bd4f,_0x57174f['options']);var _0x8b09b4={'where':_0x44bd4f[_0x6053('0x3d')]};return db[_0x6053('0x40')][_0x6053('0x20')](_0x8b09b4)[_0x6053('0x26')](function(_0x4a2701){_0x4dfbb0['count']=_0x4a2701;if(_0x57174f[_0x6053('0x32')][_0x6053('0x41')]){_0x44bd4f[_0x6053('0x42')]=[{'all':!![]}];}return db[_0x6053('0x40')][_0x6053('0x43')](_0x44bd4f);})[_0x6053('0x26')](function(_0x3e5a96){_0x4dfbb0[_0x6053('0x44')]=_0x3e5a96;return _0x4dfbb0;})[_0x6053('0x26')](respondWithFilteredResult(_0x530096,_0x44bd4f))[_0x6053('0x45')](handleError(_0x530096,null));};exports[_0x6053('0x46')]=function(_0x572420,_0x53398f){var _0x15e308={'raw':!![],'where':{'id':_0x572420[_0x6053('0x47')]['id']}},_0x411fed={};_0x411fed[_0x6053('0x31')]=_[_0x6053('0x48')](db[_0x6053('0x40')][_0x6053('0x2d')]);_0x411fed[_0x6053('0x32')]=_[_0x6053('0x48')](_0x572420[_0x6053('0x32')]);_0x411fed['filters']=_[_0x6053('0x35')](_0x411fed[_0x6053('0x31')],_0x411fed[_0x6053('0x32')]);_0x15e308[_0x6053('0x34')]=_[_0x6053('0x35')](_0x411fed[_0x6053('0x31')],qs[_0x6053('0x36')](_0x572420[_0x6053('0x32')][_0x6053('0x36')]));_0x15e308[_0x6053('0x34')]=_0x15e308[_0x6053('0x34')][_0x6053('0x49')]?_0x15e308['attributes']:_0x411fed[_0x6053('0x31')];if(_0x572420[_0x6053('0x32')][_0x6053('0x41')]){_0x15e308[_0x6053('0x42')]=[{'all':!![]}];}_0x15e308=_[_0x6053('0x3e')]({},_0x15e308,_0x572420[_0x6053('0x4a')]);return db[_0x6053('0x40')]['find'](_0x15e308)[_0x6053('0x26')](handleEntityNotFound(_0x53398f,null))[_0x6053('0x26')](respondWithResult(_0x53398f,null))[_0x6053('0x45')](handleError(_0x53398f,null));};exports[_0x6053('0x4b')]=function(_0x5e669f,_0x31de4c){return db[_0x6053('0x40')][_0x6053('0x4b')](_0x5e669f[_0x6053('0x4c')],{})[_0x6053('0x26')](respondWithResult(_0x31de4c,0xc9))[_0x6053('0x45')](handleError(_0x31de4c,null));};exports[_0x6053('0x25')]=function(_0x4aced1,_0x7b9c9c){if(_0x4aced1[_0x6053('0x4c')]['id']){delete _0x4aced1['body']['id'];}return db[_0x6053('0x40')][_0x6053('0x4d')]({'where':{'id':_0x4aced1[_0x6053('0x47')]['id']}})['then'](handleEntityNotFound(_0x7b9c9c,null))['then'](saveUpdates(_0x4aced1['body'],null))['then'](respondWithResult(_0x7b9c9c,null))[_0x6053('0x45')](handleError(_0x7b9c9c,null));};exports[_0x6053('0x27')]=function(_0x161785,_0x52e27f){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x161785['params']['id']}})[_0x6053('0x26')](handleEntityNotFound(_0x52e27f,null))[_0x6053('0x26')](removeEntity(_0x52e27f,null))[_0x6053('0x45')](handleError(_0x52e27f,null));};exports[_0x6053('0x4e')]=function(_0x14731a,_0x41f8d8){return db[_0x6053('0x40')][_0x6053('0x4e')]()[_0x6053('0x26')](respondWithResult(_0x41f8d8,null))[_0x6053('0x45')](handleError(_0x41f8d8,null));};
\ No newline at end of file
index eb5ef8c..4c20d1f 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(_0x3471c9,_0x53df9d){var _0x4b1f0a=function(_0x48a009){while(--_0x48a009){_0x3471c9['push'](_0x3471c9['shift']());}};_0x4b1f0a(++_0x53df9d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0xda376e,_0x561aa2){var _0x13457f=function(_0x46da2d){while(--_0x46da2d){_0xda376e['push'](_0xda376e['shift']());}};_0x13457f(++_0x561aa2);}(_0x326f,0xd1));var _0xf326=function(_0x3a51f7,_0x13d460){_0x3a51f7=_0x3a51f7-0x0;var _0x25975b=_0x326f[_0x3a51f7];return _0x25975b;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 2ed158d..4d13ef9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e2e=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','debug','catch','update','attributes','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x3fcec2,_0x1d676d){_0x3fcec2=_0x3fcec2-0x0;var _0x195add=_0x4e2e[_0x3fcec2];return _0x195add;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});}exports['CreateOpenchannelQueueReport']=function(_0x196f16){var _0x54c80b=this;return new Promise(function(_0x1d5e9d,_0x3f313b){return db[_0xe4e2('0x15')][_0xe4e2('0x16')](_0x196f16[_0xe4e2('0x17')],{'raw':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x19')]===undefined?!![]:![]:!![]})[_0xe4e2('0xc')](function(_0x362741){logger['info'](_0xe4e2('0x1a'),_0x196f16);logger[_0xe4e2('0x1b')](_0xe4e2('0x1a'),_0x196f16,JSON[_0xe4e2('0x11')](_0x362741));_0x1d5e9d(_0x362741);})[_0xe4e2('0x1c')](function(_0x23b466){logger[_0xe4e2('0x12')]('CreateOpenchannelQueueReport',_0x23b466[_0xe4e2('0x13')],_0x196f16);_0x3f313b(_0x54c80b[_0xe4e2('0x12')](0x1f4,_0x23b466[_0xe4e2('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x353030){var _0x12ad33=this;return new Promise(function(_0x598fa3,_0xcba85a){return db[_0xe4e2('0x15')][_0xe4e2('0x1d')](_0x353030[_0xe4e2('0x17')],{'raw':_0x353030[_0xe4e2('0x18')]?_0x353030['options'][_0xe4e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x353030[_0xe4e2('0x18')]?_0x353030[_0xe4e2('0x18')]['where']||null:null,'attributes':_0x353030[_0xe4e2('0x18')]?_0x353030[_0xe4e2('0x18')][_0xe4e2('0x1e')]||null:null,'limit':_0x353030['options']?_0x353030[_0xe4e2('0x18')]['limit']||null:null})[_0xe4e2('0xc')](function(_0x1e21c0){logger['info'](_0xe4e2('0x1f'),_0x353030);logger[_0xe4e2('0x1b')](_0xe4e2('0x1f'),_0x353030,JSON[_0xe4e2('0x11')](_0x1e21c0));_0x598fa3(_0x1e21c0);})[_0xe4e2('0x1c')](function(_0x4d33de){logger['error'](_0xe4e2('0x1f'),_0x4d33de[_0xe4e2('0x13')],_0x353030);_0xcba85a(_0x12ad33[_0xe4e2('0x12')](0x1f4,_0x4d33de[_0xe4e2('0x13')]));});});};
\ No newline at end of file
+var _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x12cc3c,_0x45b54b){var _0x4a8ad1=function(_0x366611){while(--_0x366611){_0x12cc3c['push'](_0x12cc3c['shift']());}};_0x4a8ad1(++_0x45b54b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x386421,_0xe49973){_0x386421=_0x386421-0x0;var _0x396bd9=_0x5f2f[_0x386421];return _0x396bd9;};'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')]('OpenchannelQueueReport,\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);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateOpenchannelQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateOpenchannelQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});};
\ No newline at end of file
index 57fe1a7..799d4b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4041=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','isAuthenticated','/:id','post','create','update','delete','destroy','multer'];(function(_0x730a27,_0x4c972f){var _0x45d8ad=function(_0x597d83){while(--_0x597d83){_0x730a27['push'](_0x730a27['shift']());}};_0x45d8ad(++_0x4c972f);}(_0x4041,0x10f));var _0x1404=function(_0x46e23f,_0xda33d6){_0x46e23f=_0x46e23f-0x0;var _0x34e1ab=_0x4041[_0x46e23f];return _0x34e1ab;};'use strict';var multer=require(_0x1404('0x0'));var util=require(_0x1404('0x1'));var path=require(_0x1404('0x2'));var timeout=require('connect-timeout');var express=require(_0x1404('0x3'));var router=express['Router']();var fs_extra=require(_0x1404('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1404('0x5'));var config=require(_0x1404('0x6'));var controller=require(_0x1404('0x7'));router[_0x1404('0x8')]('/',auth['isAuthenticated'](),controller[_0x1404('0x9')]);router[_0x1404('0x8')]('/describe',auth[_0x1404('0xa')](),controller['describe']);router[_0x1404('0x8')](_0x1404('0xb'),auth[_0x1404('0xa')](),controller['show']);router[_0x1404('0xc')]('/',auth[_0x1404('0xa')](),controller[_0x1404('0xd')]);router['put']('/:id',auth[_0x1404('0xa')](),controller[_0x1404('0xe')]);router[_0x1404('0xf')](_0x1404('0xb'),auth[_0x1404('0xa')](),controller[_0x1404('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x28ed=['get','/describe','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x28ed,0x15f));var _0xd28e=function(_0x2fb507,_0x526d5e){_0x2fb507=_0x2fb507-0x0;var _0x42f646=_0x28ed[_0x2fb507];return _0x42f646;};'use strict';var multer=require(_0xd28e('0x0'));var util=require('util');var path=require(_0xd28e('0x1'));var timeout=require(_0xd28e('0x2'));var express=require(_0xd28e('0x3'));var router=express[_0xd28e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd28e('0x5'));var interaction=require(_0xd28e('0x6'));var config=require(_0xd28e('0x7'));var controller=require(_0xd28e('0x8'));router[_0xd28e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd28e('0x9')](_0xd28e('0xa'),auth[_0xd28e('0xb')](),controller['describe']);router[_0xd28e('0x9')](_0xd28e('0xc'),auth[_0xd28e('0xb')](),controller[_0xd28e('0xd')]);router['post']('/',auth[_0xd28e('0xb')](),controller[_0xd28e('0xe')]);router[_0xd28e('0xf')](_0xd28e('0xc'),auth[_0xd28e('0xb')](),controller[_0xd28e('0x10')]);router[_0xd28e('0x11')](_0xd28e('0xc'),auth[_0xd28e('0xb')](),controller[_0xd28e('0x12')]);module[_0xd28e('0x13')]=router;
\ No newline at end of file
index ce92906..57129e1 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(_0x30fd3c,_0x4d9823){var _0x1acd23=function(_0x59c76e){while(--_0x59c76e){_0x30fd3c['push'](_0x30fd3c['shift']());}};_0x1acd23(++_0x4d9823);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x42c118,_0x197006){_0x42c118=_0x42c118-0x0;var _0x112ebd=_0xf3cd[_0x42c118];return _0x112ebd;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2e82f5,_0x4c740a){var _0x5e7199=function(_0x46adac){while(--_0x46adac){_0x2e82f5['push'](_0x2e82f5['shift']());}};_0x5e7199(++_0x4c740a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0xcb91[_0x95411e];return _0x2c8718;};'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 bbfcb36..b484e01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5116=['find','params','catch','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','reject','update','then','destroy','end','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','rawAttributes','includeAll','body'];(function(_0x5e3a9d,_0x3a5a0d){var _0x1b1b35=function(_0x4318ab){while(--_0x4318ab){_0x5e3a9d['push'](_0x5e3a9d['shift']());}};_0x1b1b35(++_0x3a5a0d);}(_0x5116,0xee));var _0x6511=function(_0x8a36f6,_0x630132){_0x8a36f6=_0x8a36f6-0x0;var _0x50eed9=_0x5116[_0x8a36f6];return _0x50eed9;};'use strict';var emlformat=require(_0x6511('0x0'));var rimraf=require(_0x6511('0x1'));var zipdir=require(_0x6511('0x2'));var jsonpatch=require(_0x6511('0x3'));var rp=require(_0x6511('0x4'));var moment=require(_0x6511('0x5'));var BPromise=require(_0x6511('0x6'));var Mustache=require(_0x6511('0x7'));var util=require('util');var path=require(_0x6511('0x8'));var sox=require(_0x6511('0x9'));var csv=require(_0x6511('0xa'));var ejs=require(_0x6511('0xb'));var fs=require('fs');var fs_extra=require(_0x6511('0xc'));var _=require(_0x6511('0xd'));var squel=require(_0x6511('0xe'));var crypto=require('crypto');var jsforce=require(_0x6511('0xf'));var deskjs=require(_0x6511('0x10'));var toCsv=require(_0x6511('0xa'));var querystring=require('querystring');var Papa=require(_0x6511('0x11'));var Redis=require(_0x6511('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6511('0x13'));var as=require(_0x6511('0x14'));var hardwareService=require(_0x6511('0x15'));var logger=require('../../config/logger')(_0x6511('0x16'));var utils=require(_0x6511('0x17'));var config=require(_0x6511('0x18'));var licenseUtil=require(_0x6511('0x19'));var db=require(_0x6511('0x1a'))['db'];function respondWithStatusCode(_0x40a595,_0x2ade25){_0x2ade25=_0x2ade25||0xcc;return function(_0x58d3f6){if(_0x58d3f6){return _0x40a595[_0x6511('0x1b')](_0x2ade25);}return _0x40a595[_0x6511('0x1c')](_0x2ade25)['end']();};}function respondWithResult(_0x42873b,_0x3b4e10){_0x3b4e10=_0x3b4e10||0xc8;return function(_0x140ae6){if(_0x140ae6){return _0x42873b[_0x6511('0x1c')](_0x3b4e10)[_0x6511('0x1d')](_0x140ae6);}};}function respondWithFilteredResult(_0x59c0a8,_0x192cd8){return function(_0x1f0a67){if(_0x1f0a67){var _0x1baa2a=typeof _0x192cd8['offset']===_0x6511('0x1e')&&typeof _0x192cd8[_0x6511('0x1f')]==='undefined';var _0x30edf0=_0x1f0a67['count'];var _0x368790=_0x1baa2a?0x0:_0x192cd8[_0x6511('0x20')];var _0x5e6ece=_0x1baa2a?_0x1f0a67[_0x6511('0x21')]:_0x192cd8[_0x6511('0x20')]+_0x192cd8[_0x6511('0x1f')];var _0x196cf0;if(_0x5e6ece>=_0x30edf0){_0x5e6ece=_0x30edf0;_0x196cf0=0xc8;}else{_0x196cf0=0xce;}_0x59c0a8['status'](_0x196cf0);return _0x59c0a8['set'](_0x6511('0x22'),_0x368790+'-'+_0x5e6ece+'/'+_0x30edf0)[_0x6511('0x1d')](_0x1f0a67);}return null;};}function patchUpdates(_0x5f02ef){return function(_0x8ad0ee){try{jsonpatch['apply'](_0x8ad0ee,_0x5f02ef,!![]);}catch(_0x3abe2b){return BPromise[_0x6511('0x23')](_0x3abe2b);}return _0x8ad0ee['save']();};}function saveUpdates(_0x2d339e,_0x1166b8){return function(_0x77ec30){if(_0x77ec30){return _0x77ec30[_0x6511('0x24')](_0x2d339e)[_0x6511('0x25')](function(_0x57a98c){return _0x57a98c;});}return null;};}function removeEntity(_0x2e3eed,_0x27dc36){return function(_0x55a33f){if(_0x55a33f){return _0x55a33f[_0x6511('0x26')]()['then'](function(){_0x2e3eed[_0x6511('0x1c')](0xcc)[_0x6511('0x27')]();});}};}function handleEntityNotFound(_0xfb7f05,_0xc6301a){return function(_0x297cac){if(!_0x297cac){_0xfb7f05[_0x6511('0x1b')](0x194);}return _0x297cac;};}function handleError(_0xbeebe0,_0x11354a){_0x11354a=_0x11354a||0x1f4;return function(_0xad77b6){logger['error'](_0xad77b6[_0x6511('0x28')]);if(_0xad77b6[_0x6511('0x29')]){delete _0xad77b6[_0x6511('0x29')];}_0xbeebe0['status'](_0x11354a)[_0x6511('0x2a')](_0xad77b6);};}exports[_0x6511('0x2b')]=function(_0x5b47f9,_0xa741dd){var _0x23c82b={},_0xcdb34a={},_0x47d115={'count':0x0,'rows':[]};var _0x2c94df=_[_0x6511('0x2c')](db[_0x6511('0x2d')]['rawAttributes'],function(_0x1bc81b){return{'name':_0x1bc81b[_0x6511('0x2e')],'type':_0x1bc81b[_0x6511('0x2f')][_0x6511('0x30')]};});_0xcdb34a[_0x6511('0x31')]=_[_0x6511('0x2c')](_0x2c94df,_0x6511('0x29'));_0xcdb34a[_0x6511('0x32')]=_['keys'](_0x5b47f9[_0x6511('0x32')]);_0xcdb34a[_0x6511('0x33')]=_['intersection'](_0xcdb34a[_0x6511('0x31')],_0xcdb34a[_0x6511('0x32')]);_0x23c82b['attributes']=_[_0x6511('0x34')](_0xcdb34a['model'],qs['fields'](_0x5b47f9[_0x6511('0x32')][_0x6511('0x35')]));_0x23c82b[_0x6511('0x36')]=_0x23c82b['attributes'][_0x6511('0x37')]?_0x23c82b[_0x6511('0x36')]:_0xcdb34a[_0x6511('0x31')];if(!_0x5b47f9['query'][_0x6511('0x38')](_0x6511('0x39'))){_0x23c82b[_0x6511('0x1f')]=qs['limit'](_0x5b47f9[_0x6511('0x32')][_0x6511('0x1f')]);_0x23c82b[_0x6511('0x20')]=qs[_0x6511('0x20')](_0x5b47f9[_0x6511('0x32')][_0x6511('0x20')]);}_0x23c82b[_0x6511('0x3a')]=qs[_0x6511('0x3b')](_0x5b47f9[_0x6511('0x32')][_0x6511('0x3b')]);_0x23c82b['where']=qs[_0x6511('0x33')](_[_0x6511('0x3c')](_0x5b47f9[_0x6511('0x32')],_0xcdb34a[_0x6511('0x33')]),_0x2c94df);if(_0x5b47f9[_0x6511('0x32')][_0x6511('0x3d')]){_0x23c82b[_0x6511('0x3e')]=_[_0x6511('0x3f')](_0x23c82b[_0x6511('0x3e')],{'$or':_['map'](_0x2c94df,function(_0x4feb5b){if(_0x4feb5b[_0x6511('0x2f')]!==_0x6511('0x40')){var _0x36aafd={};_0x36aafd[_0x4feb5b['name']]={'$like':'%'+_0x5b47f9[_0x6511('0x32')][_0x6511('0x3d')]+'%'};return _0x36aafd;}})});}_0x23c82b=_[_0x6511('0x3f')]({},_0x23c82b,_0x5b47f9[_0x6511('0x41')]);var _0x276b7d={'where':_0x23c82b[_0x6511('0x3e')]};return db[_0x6511('0x2d')][_0x6511('0x21')](_0x276b7d)['then'](function(_0x372e17){_0x47d115[_0x6511('0x21')]=_0x372e17;if(_0x5b47f9[_0x6511('0x32')]['includeAll']){_0x23c82b[_0x6511('0x42')]=[{'all':!![]}];}return db[_0x6511('0x2d')][_0x6511('0x43')](_0x23c82b);})[_0x6511('0x25')](function(_0x3b4b38){_0x47d115[_0x6511('0x44')]=_0x3b4b38;return _0x47d115;})[_0x6511('0x25')](respondWithFilteredResult(_0xa741dd,_0x23c82b))['catch'](handleError(_0xa741dd,null));};exports[_0x6511('0x45')]=function(_0x5a5bbd,_0x101e49){var _0x21d1a3={'raw':!![],'where':{'id':_0x5a5bbd['params']['id']}},_0x531450={};_0x531450[_0x6511('0x31')]=_[_0x6511('0x46')](db[_0x6511('0x2d')][_0x6511('0x47')]);_0x531450[_0x6511('0x32')]=_[_0x6511('0x46')](_0x5a5bbd[_0x6511('0x32')]);_0x531450[_0x6511('0x33')]=_[_0x6511('0x34')](_0x531450[_0x6511('0x31')],_0x531450[_0x6511('0x32')]);_0x21d1a3[_0x6511('0x36')]=_['intersection'](_0x531450[_0x6511('0x31')],qs[_0x6511('0x35')](_0x5a5bbd['query'][_0x6511('0x35')]));_0x21d1a3[_0x6511('0x36')]=_0x21d1a3[_0x6511('0x36')]['length']?_0x21d1a3[_0x6511('0x36')]:_0x531450['model'];if(_0x5a5bbd[_0x6511('0x32')][_0x6511('0x48')]){_0x21d1a3[_0x6511('0x42')]=[{'all':!![]}];}_0x21d1a3=_['merge']({},_0x21d1a3,_0x5a5bbd['options']);return db[_0x6511('0x2d')]['find'](_0x21d1a3)[_0x6511('0x25')](handleEntityNotFound(_0x101e49,null))[_0x6511('0x25')](respondWithResult(_0x101e49,null))['catch'](handleError(_0x101e49,null));};exports['create']=function(_0xc098f0,_0x3f2582){return db[_0x6511('0x2d')]['create'](_0xc098f0[_0x6511('0x49')],{})['then'](respondWithResult(_0x3f2582,0xc9))['catch'](handleError(_0x3f2582,null));};exports['update']=function(_0x236dfa,_0x31d37e){if(_0x236dfa[_0x6511('0x49')]['id']){delete _0x236dfa['body']['id'];}return db[_0x6511('0x2d')][_0x6511('0x4a')]({'where':{'id':_0x236dfa[_0x6511('0x4b')]['id']}})[_0x6511('0x25')](handleEntityNotFound(_0x31d37e,null))['then'](saveUpdates(_0x236dfa[_0x6511('0x49')],null))[_0x6511('0x25')](respondWithResult(_0x31d37e,null))[_0x6511('0x4c')](handleError(_0x31d37e,null));};exports[_0x6511('0x26')]=function(_0x4bb402,_0x16874d){return db[_0x6511('0x2d')][_0x6511('0x4a')]({'where':{'id':_0x4bb402[_0x6511('0x4b')]['id']}})['then'](handleEntityNotFound(_0x16874d,null))[_0x6511('0x25')](removeEntity(_0x16874d,null))['catch'](handleError(_0x16874d,null));};exports[_0x6511('0x4d')]=function(_0x2994fe,_0x2fa940){return db[_0x6511('0x2d')]['describe']()[_0x6511('0x25')](respondWithResult(_0x2fa940,null))[_0x6511('0x4c')](handleError(_0x2fa940,null));};
\ No newline at end of file
+var _0xc595=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','stack','name','send','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','length','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x4d58d2,_0x40ca3b){var _0xe877ee=function(_0x16204d){while(--_0x16204d){_0x4d58d2['push'](_0x4d58d2['shift']());}};_0xe877ee(++_0x40ca3b);}(_0xc595,0x108));var _0x5c59=function(_0x13bbfd,_0x4c6d60){_0x13bbfd=_0x13bbfd-0x0;var _0x5f2aea=_0xc595[_0x13bbfd];return _0x5f2aea;};'use strict';var emlformat=require(_0x5c59('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c59('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c59('0x2'));var moment=require(_0x5c59('0x3'));var BPromise=require(_0x5c59('0x4'));var Mustache=require(_0x5c59('0x5'));var util=require(_0x5c59('0x6'));var path=require('path');var sox=require(_0x5c59('0x7'));var csv=require(_0x5c59('0x8'));var ejs=require(_0x5c59('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c59('0xa'));var squel=require(_0x5c59('0xb'));var crypto=require(_0x5c59('0xc'));var jsforce=require(_0x5c59('0xd'));var deskjs=require(_0x5c59('0xe'));var toCsv=require(_0x5c59('0x8'));var querystring=require(_0x5c59('0xf'));var Papa=require('papaparse');var Redis=require(_0x5c59('0x10'));var authService=require(_0x5c59('0x11'));var qs=require(_0x5c59('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c59('0x13'));var logger=require(_0x5c59('0x14'))(_0x5c59('0x15'));var utils=require('../../config/utils');var config=require(_0x5c59('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c59('0x17'))['db'];function respondWithStatusCode(_0x83b5fb,_0x386269){_0x386269=_0x386269||0xcc;return function(_0x147146){if(_0x147146){return _0x83b5fb[_0x5c59('0x18')](_0x386269);}return _0x83b5fb[_0x5c59('0x19')](_0x386269)[_0x5c59('0x1a')]();};}function respondWithResult(_0x45a384,_0x41b3c2){_0x41b3c2=_0x41b3c2||0xc8;return function(_0x28d313){if(_0x28d313){return _0x45a384['status'](_0x41b3c2)[_0x5c59('0x1b')](_0x28d313);}};}function respondWithFilteredResult(_0x4ed428,_0x4358ab){return function(_0x54e8f0){if(_0x54e8f0){var _0xdac993=typeof _0x4358ab[_0x5c59('0x1c')]===_0x5c59('0x1d')&&typeof _0x4358ab[_0x5c59('0x1e')]==='undefined';var _0x16b1a3=_0x54e8f0[_0x5c59('0x1f')];var _0x20f5a6=_0xdac993?0x0:_0x4358ab[_0x5c59('0x1c')];var _0x166b25=_0xdac993?_0x54e8f0[_0x5c59('0x1f')]:_0x4358ab[_0x5c59('0x1c')]+_0x4358ab[_0x5c59('0x1e')];var _0x131f9a;if(_0x166b25>=_0x16b1a3){_0x166b25=_0x16b1a3;_0x131f9a=0xc8;}else{_0x131f9a=0xce;}_0x4ed428[_0x5c59('0x19')](_0x131f9a);return _0x4ed428['set'](_0x5c59('0x20'),_0x20f5a6+'-'+_0x166b25+'/'+_0x16b1a3)[_0x5c59('0x1b')](_0x54e8f0);}return null;};}function patchUpdates(_0x130cfd){return function(_0x55325a){try{jsonpatch[_0x5c59('0x21')](_0x55325a,_0x130cfd,!![]);}catch(_0x4ef8bb){return BPromise[_0x5c59('0x22')](_0x4ef8bb);}return _0x55325a[_0x5c59('0x23')]();};}function saveUpdates(_0xfc4f95,_0x5dd9f5){return function(_0x398869){if(_0x398869){return _0x398869['update'](_0xfc4f95)[_0x5c59('0x24')](function(_0x1864de){return _0x1864de;});}return null;};}function removeEntity(_0x30b4fe,_0x426544){return function(_0x5e12dc){if(_0x5e12dc){return _0x5e12dc[_0x5c59('0x25')]()['then'](function(){_0x30b4fe['status'](0xcc)[_0x5c59('0x1a')]();});}};}function handleEntityNotFound(_0x1ba670,_0x58df45){return function(_0x4660cb){if(!_0x4660cb){_0x1ba670[_0x5c59('0x18')](0x194);}return _0x4660cb;};}function handleError(_0x46ee6f,_0x3054e8){_0x3054e8=_0x3054e8||0x1f4;return function(_0x516c92){logger['error'](_0x516c92[_0x5c59('0x26')]);if(_0x516c92[_0x5c59('0x27')]){delete _0x516c92[_0x5c59('0x27')];}_0x46ee6f[_0x5c59('0x19')](_0x3054e8)[_0x5c59('0x28')](_0x516c92);};}exports['index']=function(_0x5a804e,_0x374a7c){var _0x389b33={},_0x4f8db1={},_0x33f64b={'count':0x0,'rows':[]};var _0x1c4e56=_['map'](db[_0x5c59('0x29')][_0x5c59('0x2a')],function(_0x2a8020){return{'name':_0x2a8020[_0x5c59('0x2b')],'type':_0x2a8020[_0x5c59('0x2c')][_0x5c59('0x2d')]};});_0x4f8db1[_0x5c59('0x2e')]=_['map'](_0x1c4e56,'name');_0x4f8db1[_0x5c59('0x2f')]=_[_0x5c59('0x30')](_0x5a804e['query']);_0x4f8db1[_0x5c59('0x31')]=_['intersection'](_0x4f8db1[_0x5c59('0x2e')],_0x4f8db1[_0x5c59('0x2f')]);_0x389b33[_0x5c59('0x32')]=_[_0x5c59('0x33')](_0x4f8db1[_0x5c59('0x2e')],qs[_0x5c59('0x34')](_0x5a804e[_0x5c59('0x2f')][_0x5c59('0x34')]));_0x389b33[_0x5c59('0x32')]=_0x389b33[_0x5c59('0x32')]['length']?_0x389b33['attributes']:_0x4f8db1[_0x5c59('0x2e')];if(!_0x5a804e[_0x5c59('0x2f')][_0x5c59('0x35')](_0x5c59('0x36'))){_0x389b33[_0x5c59('0x1e')]=qs['limit'](_0x5a804e[_0x5c59('0x2f')][_0x5c59('0x1e')]);_0x389b33[_0x5c59('0x1c')]=qs[_0x5c59('0x1c')](_0x5a804e[_0x5c59('0x2f')][_0x5c59('0x1c')]);}_0x389b33['order']=qs['sort'](_0x5a804e[_0x5c59('0x2f')]['sort']);_0x389b33[_0x5c59('0x37')]=qs[_0x5c59('0x31')](_[_0x5c59('0x38')](_0x5a804e[_0x5c59('0x2f')],_0x4f8db1['filters']),_0x1c4e56);if(_0x5a804e['query']['filter']){_0x389b33[_0x5c59('0x37')]=_[_0x5c59('0x39')](_0x389b33[_0x5c59('0x37')],{'$or':_['map'](_0x1c4e56,function(_0x46bcc1){if(_0x46bcc1['type']!=='VIRTUAL'){var _0x2f671c={};_0x2f671c[_0x46bcc1['name']]={'$like':'%'+_0x5a804e['query'][_0x5c59('0x3a')]+'%'};return _0x2f671c;}})});}_0x389b33=_[_0x5c59('0x39')]({},_0x389b33,_0x5a804e[_0x5c59('0x3b')]);var _0x1f7b28={'where':_0x389b33[_0x5c59('0x37')]};return db[_0x5c59('0x29')][_0x5c59('0x1f')](_0x1f7b28)[_0x5c59('0x24')](function(_0x2e0967){_0x33f64b['count']=_0x2e0967;if(_0x5a804e[_0x5c59('0x2f')][_0x5c59('0x3c')]){_0x389b33[_0x5c59('0x3d')]=[{'all':!![]}];}return db[_0x5c59('0x29')][_0x5c59('0x3e')](_0x389b33);})[_0x5c59('0x24')](function(_0x1c14ad){_0x33f64b[_0x5c59('0x3f')]=_0x1c14ad;return _0x33f64b;})[_0x5c59('0x24')](respondWithFilteredResult(_0x374a7c,_0x389b33))[_0x5c59('0x40')](handleError(_0x374a7c,null));};exports['show']=function(_0xc2cad2,_0x638cd4){var _0x415088={'raw':!![],'where':{'id':_0xc2cad2['params']['id']}},_0x5ea346={};_0x5ea346[_0x5c59('0x2e')]=_[_0x5c59('0x30')](db['OpenchannelTransferReport']['rawAttributes']);_0x5ea346[_0x5c59('0x2f')]=_[_0x5c59('0x30')](_0xc2cad2[_0x5c59('0x2f')]);_0x5ea346[_0x5c59('0x31')]=_[_0x5c59('0x33')](_0x5ea346[_0x5c59('0x2e')],_0x5ea346[_0x5c59('0x2f')]);_0x415088[_0x5c59('0x32')]=_[_0x5c59('0x33')](_0x5ea346[_0x5c59('0x2e')],qs[_0x5c59('0x34')](_0xc2cad2[_0x5c59('0x2f')][_0x5c59('0x34')]));_0x415088[_0x5c59('0x32')]=_0x415088['attributes'][_0x5c59('0x41')]?_0x415088[_0x5c59('0x32')]:_0x5ea346[_0x5c59('0x2e')];if(_0xc2cad2[_0x5c59('0x2f')]['includeAll']){_0x415088[_0x5c59('0x3d')]=[{'all':!![]}];}_0x415088=_[_0x5c59('0x39')]({},_0x415088,_0xc2cad2[_0x5c59('0x3b')]);return db[_0x5c59('0x29')][_0x5c59('0x42')](_0x415088)[_0x5c59('0x24')](handleEntityNotFound(_0x638cd4,null))[_0x5c59('0x24')](respondWithResult(_0x638cd4,null))[_0x5c59('0x40')](handleError(_0x638cd4,null));};exports[_0x5c59('0x43')]=function(_0x520e6d,_0x1c3ff2){return db[_0x5c59('0x29')][_0x5c59('0x43')](_0x520e6d[_0x5c59('0x44')],{})[_0x5c59('0x24')](respondWithResult(_0x1c3ff2,0xc9))['catch'](handleError(_0x1c3ff2,null));};exports['update']=function(_0x5c4ab6,_0x571f8a){if(_0x5c4ab6['body']['id']){delete _0x5c4ab6[_0x5c59('0x44')]['id'];}return db['OpenchannelTransferReport'][_0x5c59('0x42')]({'where':{'id':_0x5c4ab6[_0x5c59('0x45')]['id']}})[_0x5c59('0x24')](handleEntityNotFound(_0x571f8a,null))[_0x5c59('0x24')](saveUpdates(_0x5c4ab6[_0x5c59('0x44')],null))[_0x5c59('0x24')](respondWithResult(_0x571f8a,null))[_0x5c59('0x40')](handleError(_0x571f8a,null));};exports[_0x5c59('0x25')]=function(_0x23f2b9,_0x2531ce){return db[_0x5c59('0x29')][_0x5c59('0x42')]({'where':{'id':_0x23f2b9[_0x5c59('0x45')]['id']}})[_0x5c59('0x24')](handleEntityNotFound(_0x2531ce,null))[_0x5c59('0x24')](removeEntity(_0x2531ce,null))[_0x5c59('0x40')](handleError(_0x2531ce,null));};exports['describe']=function(_0x15ab7f,_0x474e7b){return db[_0x5c59('0x29')][_0x5c59('0x46')]()[_0x5c59('0x24')](respondWithResult(_0x474e7b,null))['catch'](handleError(_0x474e7b,null));};
\ No newline at end of file
index b82c5df..02dae08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b9=['request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x589d8c,_0x210b77){var _0x486b06=function(_0x301902){while(--_0x301902){_0x589d8c['push'](_0x589d8c['shift']());}};_0x486b06(++_0x210b77);}(_0x34b9,0xe7));var _0x934b=function(_0x53cae4,_0x43cd2c){_0x53cae4=_0x53cae4-0x0;var _0x4f19f2=_0x34b9[_0x53cae4];return _0x4f19f2;};'use strict';var _=require(_0x934b('0x0'));var util=require(_0x934b('0x1'));var logger=require(_0x934b('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x934b('0x3'));var fs=require('fs');var path=require(_0x934b('0x4'));var rimraf=require(_0x934b('0x5'));var config=require(_0x934b('0x6'));var attributes=require(_0x934b('0x7'));module[_0x934b('0x8')]=function(_0x584439,_0x3a221e){return _0x584439[_0x934b('0x9')](_0x934b('0xa'),attributes,{'tableName':_0x934b('0xb'),'paranoid':![],'indexes':[{'name':_0x934b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8b6=['OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x250453,_0x2a0799){var _0x471c1a=function(_0x483a37){while(--_0x483a37){_0x250453['push'](_0x250453['shift']());}};_0x471c1a(++_0x2a0799);}(_0xf8b6,0x1b2));var _0x6f8b=function(_0x2ab697,_0xe65518){_0x2ab697=_0x2ab697-0x0;var _0x3c72f8=_0xf8b6[_0x2ab697];return _0x3c72f8;};'use strict';var _=require(_0x6f8b('0x0'));var util=require(_0x6f8b('0x1'));var logger=require(_0x6f8b('0x2'))('api');var moment=require(_0x6f8b('0x3'));var BPromise=require('bluebird');var rp=require(_0x6f8b('0x4'));var fs=require('fs');var path=require(_0x6f8b('0x5'));var rimraf=require(_0x6f8b('0x6'));var config=require(_0x6f8b('0x7'));var attributes=require(_0x6f8b('0x8'));module[_0x6f8b('0x9')]=function(_0x519bb2,_0x27d016){return _0x519bb2['define'](_0x6f8b('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x6f8b('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 8b98942..58592d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eed=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x6eed,0xff));var _0xd6ee=function(_0x5694d3,_0x2e3008){_0x5694d3=_0x5694d3-0x0;var _0x1ca96e=_0x6eed[_0x5694d3];return _0x1ca96e;};'use strict';var _=require(_0xd6ee('0x0'));var util=require(_0xd6ee('0x1'));var moment=require(_0xd6ee('0x2'));var BPromise=require(_0xd6ee('0x3'));var rs=require(_0xd6ee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6ee('0x5'))['db'];var utils=require(_0xd6ee('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd6ee('0x7'));var jayson=require(_0xd6ee('0x8'));var client=jayson[_0xd6ee('0x9')][_0xd6ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10c1d7,_0x48a812,_0x514dc3){return new BPromise(function(_0x2e6369,_0x5134ea){return client['request'](_0x10c1d7,_0x514dc3)['then'](function(_0x2c4f23){logger[_0xd6ee('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x48a812,_0xd6ee('0xc'));logger[_0xd6ee('0xd')](_0xd6ee('0xe'),_0x48a812,_0xd6ee('0xc'),JSON['stringify'](_0x2c4f23));if(_0x2c4f23[_0xd6ee('0xf')]){if(_0x2c4f23[_0xd6ee('0xf')][_0xd6ee('0x10')]===0x1f4){logger[_0xd6ee('0xf')](_0xd6ee('0x11'),_0x48a812,_0x2c4f23[_0xd6ee('0xf')]['message']);return _0x5134ea(_0x2c4f23[_0xd6ee('0xf')][_0xd6ee('0x12')]);}logger['error'](_0xd6ee('0x11'),_0x48a812,_0x2c4f23[_0xd6ee('0xf')][_0xd6ee('0x12')]);return _0x2e6369(_0x2c4f23[_0xd6ee('0xf')][_0xd6ee('0x12')]);}else{logger[_0xd6ee('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x48a812,_0xd6ee('0xc'));_0x2e6369(_0x2c4f23[_0xd6ee('0x13')][_0xd6ee('0x12')]);}})['catch'](function(_0x3196c0){logger['error'](_0xd6ee('0x11'),_0x48a812,_0x3196c0);_0x5134ea(_0x3196c0);});});}
\ No newline at end of file
+var _0x826a=['debug','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x826a,0x1aa));var _0xa826=function(_0x3e25d5,_0x378684){_0x3e25d5=_0x3e25d5-0x0;var _0x17e3be=_0x826a[_0x3e25d5];return _0x17e3be;};'use strict';var _=require('lodash');var util=require(_0xa826('0x0'));var moment=require('moment');var BPromise=require(_0xa826('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa826('0x2'));var db=require(_0xa826('0x3'))['db'];var utils=require(_0xa826('0x4'));var logger=require(_0xa826('0x5'))('rpc');var config=require(_0xa826('0x6'));var jayson=require(_0xa826('0x7'));var client=jayson[_0xa826('0x8')][_0xa826('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45154f,_0x4124f5,_0x4339f9){return new BPromise(function(_0x14c2ba,_0xc348d2){return client[_0xa826('0xa')](_0x45154f,_0x4339f9)[_0xa826('0xb')](function(_0x1005e6){logger[_0xa826('0xc')](_0xa826('0xd'),_0x4124f5,_0xa826('0xe'));logger[_0xa826('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4124f5,_0xa826('0xe'),JSON['stringify'](_0x1005e6));if(_0x1005e6[_0xa826('0x10')]){if(_0x1005e6[_0xa826('0x10')][_0xa826('0x11')]===0x1f4){logger[_0xa826('0x10')](_0xa826('0xd'),_0x4124f5,_0x1005e6[_0xa826('0x10')][_0xa826('0x12')]);return _0xc348d2(_0x1005e6['error'][_0xa826('0x12')]);}logger['error'](_0xa826('0xd'),_0x4124f5,_0x1005e6[_0xa826('0x10')]['message']);return _0x14c2ba(_0x1005e6['error']['message']);}else{logger[_0xa826('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4124f5,'request\x20sent');_0x14c2ba(_0x1005e6[_0xa826('0x13')][_0xa826('0x12')]);}})[_0xa826('0x14')](function(_0x5832b9){logger[_0xa826('0x10')](_0xa826('0xd'),_0x4124f5,_0x5832b9);_0xc348d2(_0x5832b9);});});}
\ No newline at end of file
index fa6f8d2..e8083d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f92=['post','create','put','update','delete','exports','util','path','express','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show'];(function(_0x51febc,_0x54b052){var _0x194e3b=function(_0x1c65e8){while(--_0x1c65e8){_0x51febc['push'](_0x51febc['shift']());}};_0x194e3b(++_0x54b052);}(_0x2f92,0x1d1));var _0x22f9=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x2f92[_0x68ee8b];return _0x5148f7;};'use strict';var multer=require('multer');var util=require(_0x22f9('0x0'));var path=require(_0x22f9('0x1'));var timeout=require('connect-timeout');var express=require(_0x22f9('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x22f9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x22f9('0x4'));var controller=require(_0x22f9('0x5'));router[_0x22f9('0x6')]('/',auth[_0x22f9('0x7')](),controller[_0x22f9('0x8')]);router[_0x22f9('0x6')](_0x22f9('0x9'),auth[_0x22f9('0x7')](),controller[_0x22f9('0xa')]);router[_0x22f9('0xb')]('/',auth[_0x22f9('0x7')](),controller[_0x22f9('0xc')]);router[_0x22f9('0xd')](_0x22f9('0x9'),auth[_0x22f9('0x7')](),controller[_0x22f9('0xe')]);router[_0x22f9('0xf')](_0x22f9('0x9'),auth[_0x22f9('0x7')](),controller['destroy']);module[_0x22f9('0x10')]=router;
\ No newline at end of file
+var _0x2bde=['fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x4131f0,_0x2e0e72){var _0x47c675=function(_0x417325){while(--_0x417325){_0x4131f0['push'](_0x4131f0['shift']());}};_0x47c675(++_0x2e0e72);}(_0x2bde,0x6c));var _0xe2bd=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0x2bde[_0xb8cfbe];return _0x227d51;};'use strict';var multer=require(_0xe2bd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe2bd('0x1'));var express=require(_0xe2bd('0x2'));var router=express[_0xe2bd('0x3')]();var fs_extra=require(_0xe2bd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe2bd('0x5'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0xe2bd('0x6')]('/',auth[_0xe2bd('0x7')](),controller[_0xe2bd('0x8')]);router[_0xe2bd('0x6')](_0xe2bd('0x9'),auth[_0xe2bd('0x7')](),controller['show']);router[_0xe2bd('0xa')]('/',auth[_0xe2bd('0x7')](),controller['create']);router[_0xe2bd('0xb')](_0xe2bd('0x9'),auth[_0xe2bd('0x7')](),controller[_0xe2bd('0xc')]);router[_0xe2bd('0xd')]('/:id',auth[_0xe2bd('0x7')](),controller[_0xe2bd('0xe')]);module[_0xe2bd('0xf')]=router;
\ No newline at end of file
index c8eb8b2..3e16082 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf572=['name','sequelize','exports','STRING'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf572,0x79));var _0x2f57=function(_0xadf1f,_0x42c1bd){_0xadf1f=_0xadf1f-0x0;var _0x4d5c9b=_0xf572[_0xadf1f];return _0x4d5c9b;};'use strict';var Sequelize=require(_0x2f57('0x0'));module[_0x2f57('0x1')]={'name':{'type':Sequelize[_0x2f57('0x2')],'unique':_0x2f57('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2f57('0x2')]}};
\ No newline at end of file
+var _0xfd8c=['sequelize','exports','name','STRING'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0xfd8c,0x1b8));var _0xcfd8=function(_0x4dce97,_0x1b9719){_0x4dce97=_0x4dce97-0x0;var _0x417143=_0xfd8c[_0x4dce97];return _0x417143;};'use strict';var Sequelize=require(_0xcfd8('0x0'));module[_0xcfd8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcfd8('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xcfd8('0x3')]}};
\ No newline at end of file
index 3142cc5..52ce9b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bc7=['then','destroy','Pauses','UserProfileResource','stack','name','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update'];(function(_0x2a8860,_0x2da926){var _0x2f47a4=function(_0x3b7f54){while(--_0x3b7f54){_0x2a8860['push'](_0x2a8860['shift']());}};_0x2f47a4(++_0x2da926);}(_0x9bc7,0x11a));var _0x79bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bc7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79bc('0x0'));var zipdir=require(_0x79bc('0x1'));var jsonpatch=require(_0x79bc('0x2'));var rp=require('request-promise');var moment=require(_0x79bc('0x3'));var BPromise=require(_0x79bc('0x4'));var Mustache=require(_0x79bc('0x5'));var util=require(_0x79bc('0x6'));var path=require(_0x79bc('0x7'));var sox=require(_0x79bc('0x8'));var csv=require(_0x79bc('0x9'));var ejs=require(_0x79bc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x79bc('0xb'));var crypto=require(_0x79bc('0xc'));var jsforce=require(_0x79bc('0xd'));var deskjs=require(_0x79bc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x79bc('0xf'));var Papa=require(_0x79bc('0x10'));var Redis=require(_0x79bc('0x11'));var authService=require(_0x79bc('0x12'));var qs=require(_0x79bc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79bc('0x14'));var logger=require('../../config/logger')(_0x79bc('0x15'));var utils=require(_0x79bc('0x16'));var config=require(_0x79bc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x79bc('0x18'))['db'];function respondWithStatusCode(_0x10ef82,_0x5965bd){_0x5965bd=_0x5965bd||0xcc;return function(_0x23d980){if(_0x23d980){return _0x10ef82[_0x79bc('0x19')](_0x5965bd);}return _0x10ef82[_0x79bc('0x1a')](_0x5965bd)[_0x79bc('0x1b')]();};}function respondWithResult(_0x1e7f6e,_0x53edfc){_0x53edfc=_0x53edfc||0xc8;return function(_0x180abe){if(_0x180abe){return _0x1e7f6e[_0x79bc('0x1a')](_0x53edfc)[_0x79bc('0x1c')](_0x180abe);}};}function respondWithFilteredResult(_0x5a2b35,_0x227900){return function(_0x1f2d17){if(_0x1f2d17){var _0x28d178=typeof _0x227900[_0x79bc('0x1d')]===_0x79bc('0x1e')&&typeof _0x227900['limit']===_0x79bc('0x1e');var _0x4e8ca2=_0x1f2d17[_0x79bc('0x1f')];var _0x2a68e9=_0x28d178?0x0:_0x227900[_0x79bc('0x1d')];var _0x15755c=_0x28d178?_0x1f2d17['count']:_0x227900[_0x79bc('0x1d')]+_0x227900[_0x79bc('0x20')];var _0x46ee82;if(_0x15755c>=_0x4e8ca2){_0x15755c=_0x4e8ca2;_0x46ee82=0xc8;}else{_0x46ee82=0xce;}_0x5a2b35[_0x79bc('0x1a')](_0x46ee82);return _0x5a2b35[_0x79bc('0x21')]('Content-Range',_0x2a68e9+'-'+_0x15755c+'/'+_0x4e8ca2)[_0x79bc('0x1c')](_0x1f2d17);}return null;};}function patchUpdates(_0x128e11){return function(_0xab09da){try{jsonpatch[_0x79bc('0x22')](_0xab09da,_0x128e11,!![]);}catch(_0xb1819e){return BPromise[_0x79bc('0x23')](_0xb1819e);}return _0xab09da[_0x79bc('0x24')]();};}function saveUpdates(_0x213555,_0x21b020){return function(_0x3999d1){if(_0x3999d1){return _0x3999d1[_0x79bc('0x25')](_0x213555)[_0x79bc('0x26')](function(_0x166315){return _0x166315;});}return null;};}function removeEntity(_0x4c3f57,_0x297180){return function(_0x4a7538){if(_0x4a7538){return _0x4a7538[_0x79bc('0x27')]()['then'](function(){var _0x4a2bb5=_0x4a7538['get']({'plain':!![]});var _0x5627dc=_0x79bc('0x28');return db[_0x79bc('0x29')][_0x79bc('0x27')]({'where':{'type':_0x5627dc,'resourceId':_0x4a2bb5['id']}})[_0x79bc('0x26')](function(){return _0x4a7538;});})[_0x79bc('0x26')](function(){_0x4c3f57[_0x79bc('0x1a')](0xcc)[_0x79bc('0x1b')]();});}};}function handleEntityNotFound(_0x420c0f,_0x17cec1){return function(_0x56bc6d){if(!_0x56bc6d){_0x420c0f[_0x79bc('0x19')](0x194);}return _0x56bc6d;};}function handleError(_0x159a78,_0x4843a4){_0x4843a4=_0x4843a4||0x1f4;return function(_0xe1ef12){logger['error'](_0xe1ef12[_0x79bc('0x2a')]);if(_0xe1ef12[_0x79bc('0x2b')]){delete _0xe1ef12[_0x79bc('0x2b')];}_0x159a78['status'](_0x4843a4)['send'](_0xe1ef12);};}exports['index']=function(_0x52cd37,_0xed350e){var _0x489748={},_0x87b63f={},_0x423ac5={'count':0x0,'rows':[]};var _0x4b7556=_['map'](db[_0x79bc('0x2c')][_0x79bc('0x2d')],function(_0x14adbd){return{'name':_0x14adbd[_0x79bc('0x2e')],'type':_0x14adbd[_0x79bc('0x2f')][_0x79bc('0x30')]};});_0x87b63f[_0x79bc('0x31')]=_['map'](_0x4b7556,_0x79bc('0x2b'));_0x87b63f[_0x79bc('0x32')]=_[_0x79bc('0x33')](_0x52cd37[_0x79bc('0x32')]);_0x87b63f[_0x79bc('0x34')]=_[_0x79bc('0x35')](_0x87b63f[_0x79bc('0x31')],_0x87b63f[_0x79bc('0x32')]);_0x489748[_0x79bc('0x36')]=_[_0x79bc('0x35')](_0x87b63f[_0x79bc('0x31')],qs[_0x79bc('0x37')](_0x52cd37['query'][_0x79bc('0x37')]));_0x489748['attributes']=_0x489748[_0x79bc('0x36')]['length']?_0x489748['attributes']:_0x87b63f[_0x79bc('0x31')];if(!_0x52cd37[_0x79bc('0x32')][_0x79bc('0x38')](_0x79bc('0x39'))){_0x489748[_0x79bc('0x20')]=qs[_0x79bc('0x20')](_0x52cd37['query'][_0x79bc('0x20')]);_0x489748[_0x79bc('0x1d')]=qs[_0x79bc('0x1d')](_0x52cd37[_0x79bc('0x32')][_0x79bc('0x1d')]);}_0x489748['order']=qs[_0x79bc('0x3a')](_0x52cd37[_0x79bc('0x32')][_0x79bc('0x3a')]);_0x489748['where']=qs[_0x79bc('0x34')](_[_0x79bc('0x3b')](_0x52cd37[_0x79bc('0x32')],_0x87b63f[_0x79bc('0x34')]),_0x4b7556);if(_0x52cd37[_0x79bc('0x32')][_0x79bc('0x3c')]){_0x489748[_0x79bc('0x3d')]=_[_0x79bc('0x3e')](_0x489748[_0x79bc('0x3d')],{'$or':_['map'](_0x4b7556,function(_0x15ed71){if(_0x15ed71['type']!==_0x79bc('0x3f')){var _0x19a6fe={};_0x19a6fe[_0x15ed71[_0x79bc('0x2b')]]={'$like':'%'+_0x52cd37[_0x79bc('0x32')][_0x79bc('0x3c')]+'%'};return _0x19a6fe;}})});}_0x489748=_[_0x79bc('0x3e')]({},_0x489748,_0x52cd37[_0x79bc('0x40')]);var _0x4001e5={'where':_0x489748[_0x79bc('0x3d')]};return db[_0x79bc('0x2c')][_0x79bc('0x1f')](_0x4001e5)[_0x79bc('0x26')](function(_0x303124){_0x423ac5[_0x79bc('0x1f')]=_0x303124;if(_0x52cd37[_0x79bc('0x32')][_0x79bc('0x41')]){_0x489748[_0x79bc('0x42')]=[{'all':!![]}];}return db[_0x79bc('0x2c')][_0x79bc('0x43')](_0x489748);})[_0x79bc('0x26')](function(_0x5ca663){_0x423ac5[_0x79bc('0x44')]=_0x5ca663;return _0x423ac5;})[_0x79bc('0x26')](respondWithFilteredResult(_0xed350e,_0x489748))[_0x79bc('0x45')](handleError(_0xed350e,null));};exports[_0x79bc('0x46')]=function(_0x5cf8e7,_0x1d9403){var _0x108ad1={'raw':!![],'where':{'id':_0x5cf8e7[_0x79bc('0x47')]['id']}},_0x146db7={};_0x146db7[_0x79bc('0x31')]=_['keys'](db[_0x79bc('0x2c')][_0x79bc('0x2d')]);_0x146db7[_0x79bc('0x32')]=_[_0x79bc('0x33')](_0x5cf8e7[_0x79bc('0x32')]);_0x146db7[_0x79bc('0x34')]=_['intersection'](_0x146db7['model'],_0x146db7['query']);_0x108ad1[_0x79bc('0x36')]=_[_0x79bc('0x35')](_0x146db7['model'],qs[_0x79bc('0x37')](_0x5cf8e7['query'][_0x79bc('0x37')]));_0x108ad1['attributes']=_0x108ad1[_0x79bc('0x36')]['length']?_0x108ad1[_0x79bc('0x36')]:_0x146db7['model'];if(_0x5cf8e7[_0x79bc('0x32')][_0x79bc('0x41')]){_0x108ad1[_0x79bc('0x42')]=[{'all':!![]}];}_0x108ad1=_[_0x79bc('0x3e')]({},_0x108ad1,_0x5cf8e7['options']);return db[_0x79bc('0x2c')][_0x79bc('0x48')](_0x108ad1)[_0x79bc('0x26')](handleEntityNotFound(_0x1d9403,null))[_0x79bc('0x26')](respondWithResult(_0x1d9403,null))['catch'](handleError(_0x1d9403,null));};exports[_0x79bc('0x49')]=function(_0x454142,_0x4bee0b){return db['Pause'][_0x79bc('0x49')](_0x454142['body'],{})[_0x79bc('0x26')](function(_0x5bfcfa){var _0x2971e3=_0x454142[_0x79bc('0x4a')]['get']({'plain':!![]});if(!_0x2971e3)throw new Error(_0x79bc('0x4b'));if(_0x2971e3['role']===_0x79bc('0x4a')){var _0x55e598=_0x5bfcfa[_0x79bc('0x4c')]({'plain':!![]});var _0x55aa84=_0x79bc('0x28');return db[_0x79bc('0x4d')][_0x79bc('0x48')]({'where':{'name':_0x55aa84,'userProfileId':_0x2971e3[_0x79bc('0x4e')]},'raw':!![]})[_0x79bc('0x26')](function(_0x1050d6){if(_0x1050d6&&_0x1050d6['autoAssociation']===0x0){return db[_0x79bc('0x29')][_0x79bc('0x49')]({'name':_0x55e598[_0x79bc('0x2b')],'resourceId':_0x55e598['id'],'type':_0x1050d6[_0x79bc('0x2b')],'sectionId':_0x1050d6['id']},{})['then'](function(){return _0x5bfcfa;});}else{return _0x5bfcfa;}})[_0x79bc('0x45')](function(_0x493eeb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x493eeb);throw _0x493eeb;});}return _0x5bfcfa;})[_0x79bc('0x26')](respondWithResult(_0x4bee0b,0xc9))[_0x79bc('0x45')](handleError(_0x4bee0b,null));};exports[_0x79bc('0x25')]=function(_0x10f955,_0xcf00b2){if(_0x10f955[_0x79bc('0x4f')]['id']){delete _0x10f955[_0x79bc('0x4f')]['id'];}return db['Pause']['find']({'where':{'id':_0x10f955[_0x79bc('0x47')]['id']}})['then'](handleEntityNotFound(_0xcf00b2,null))['then'](saveUpdates(_0x10f955[_0x79bc('0x4f')],null))[_0x79bc('0x26')](respondWithResult(_0xcf00b2,null))[_0x79bc('0x45')](handleError(_0xcf00b2,null));};exports['destroy']=function(_0x10a663,_0x338405){return db[_0x79bc('0x2c')]['find']({'where':{'id':_0x10a663[_0x79bc('0x47')]['id']}})[_0x79bc('0x26')](handleEntityNotFound(_0x338405,null))[_0x79bc('0x26')](removeEntity(_0x338405,null))['catch'](handleError(_0x338405,null));};
\ No newline at end of file
+var _0x92cc=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','Pauses','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','Pause','includeAll','findAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92cc,0x19c));var _0xc92c=function(_0x2a8538,_0x4235fc){_0x2a8538=_0x2a8538-0x0;var _0x55adff=_0x92cc[_0x2a8538];return _0x55adff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc92c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc92c('0x1'));var rp=require(_0xc92c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc92c('0x3'));var util=require(_0xc92c('0x4'));var path=require(_0xc92c('0x5'));var sox=require('sox');var csv=require(_0xc92c('0x6'));var ejs=require(_0xc92c('0x7'));var fs=require('fs');var fs_extra=require(_0xc92c('0x8'));var _=require(_0xc92c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc92c('0xa'));var toCsv=require(_0xc92c('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc92c('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xc92c('0xc'));var as=require(_0xc92c('0xd'));var hardwareService=require(_0xc92c('0xe'));var logger=require('../../config/logger')(_0xc92c('0xf'));var utils=require(_0xc92c('0x10'));var config=require(_0xc92c('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xc92c('0x12'))['db'];function respondWithStatusCode(_0x17ad1f,_0x561a86){_0x561a86=_0x561a86||0xcc;return function(_0x16ed52){if(_0x16ed52){return _0x17ad1f[_0xc92c('0x13')](_0x561a86);}return _0x17ad1f['status'](_0x561a86)['end']();};}function respondWithResult(_0x508af2,_0x1331e9){_0x1331e9=_0x1331e9||0xc8;return function(_0x2cc1de){if(_0x2cc1de){return _0x508af2[_0xc92c('0x14')](_0x1331e9)[_0xc92c('0x15')](_0x2cc1de);}};}function respondWithFilteredResult(_0x2b5fdd,_0x621174){return function(_0x4f5e9d){if(_0x4f5e9d){var _0x405faa=typeof _0x621174['offset']===_0xc92c('0x16')&&typeof _0x621174[_0xc92c('0x17')]===_0xc92c('0x16');var _0x1c8f9a=_0x4f5e9d[_0xc92c('0x18')];var _0x5deb40=_0x405faa?0x0:_0x621174[_0xc92c('0x19')];var _0x4df24e=_0x405faa?_0x4f5e9d['count']:_0x621174[_0xc92c('0x19')]+_0x621174['limit'];var _0x3f9d13;if(_0x4df24e>=_0x1c8f9a){_0x4df24e=_0x1c8f9a;_0x3f9d13=0xc8;}else{_0x3f9d13=0xce;}_0x2b5fdd[_0xc92c('0x14')](_0x3f9d13);return _0x2b5fdd[_0xc92c('0x1a')](_0xc92c('0x1b'),_0x5deb40+'-'+_0x4df24e+'/'+_0x1c8f9a)[_0xc92c('0x15')](_0x4f5e9d);}return null;};}function patchUpdates(_0x5d2b04){return function(_0x3e7582){try{jsonpatch[_0xc92c('0x1c')](_0x3e7582,_0x5d2b04,!![]);}catch(_0xcfcbb7){return BPromise[_0xc92c('0x1d')](_0xcfcbb7);}return _0x3e7582[_0xc92c('0x1e')]();};}function saveUpdates(_0x5951ff,_0x2bc929){return function(_0x4e104a){if(_0x4e104a){return _0x4e104a[_0xc92c('0x1f')](_0x5951ff)[_0xc92c('0x20')](function(_0x5d1947){return _0x5d1947;});}return null;};}function removeEntity(_0x5831c2,_0x446fea){return function(_0x53e62f){if(_0x53e62f){return _0x53e62f['destroy']()[_0xc92c('0x20')](function(){var _0x365602=_0x53e62f[_0xc92c('0x21')]({'plain':!![]});var _0x415a4b=_0xc92c('0x22');return db['UserProfileResource'][_0xc92c('0x23')]({'where':{'type':_0x415a4b,'resourceId':_0x365602['id']}})[_0xc92c('0x20')](function(){return _0x53e62f;});})[_0xc92c('0x20')](function(){_0x5831c2['status'](0xcc)[_0xc92c('0x24')]();});}};}function handleEntityNotFound(_0x2917f9,_0x405241){return function(_0x460a0d){if(!_0x460a0d){_0x2917f9[_0xc92c('0x13')](0x194);}return _0x460a0d;};}function handleError(_0x3b5767,_0x13a163){_0x13a163=_0x13a163||0x1f4;return function(_0x58fda3){logger[_0xc92c('0x25')](_0x58fda3[_0xc92c('0x26')]);if(_0x58fda3[_0xc92c('0x27')]){delete _0x58fda3[_0xc92c('0x27')];}_0x3b5767[_0xc92c('0x14')](_0x13a163)[_0xc92c('0x28')](_0x58fda3);};}exports['index']=function(_0x3c16e4,_0x4b2426){var _0xb2aceb={},_0xead01b={},_0x47f0bf={'count':0x0,'rows':[]};var _0x1c60f6=_[_0xc92c('0x29')](db['Pause'][_0xc92c('0x2a')],function(_0x25448d){return{'name':_0x25448d[_0xc92c('0x2b')],'type':_0x25448d[_0xc92c('0x2c')][_0xc92c('0x2d')]};});_0xead01b[_0xc92c('0x2e')]=_[_0xc92c('0x29')](_0x1c60f6,_0xc92c('0x27'));_0xead01b['query']=_[_0xc92c('0x2f')](_0x3c16e4[_0xc92c('0x30')]);_0xead01b['filters']=_[_0xc92c('0x31')](_0xead01b[_0xc92c('0x2e')],_0xead01b[_0xc92c('0x30')]);_0xb2aceb['attributes']=_[_0xc92c('0x31')](_0xead01b['model'],qs[_0xc92c('0x32')](_0x3c16e4[_0xc92c('0x30')][_0xc92c('0x32')]));_0xb2aceb[_0xc92c('0x33')]=_0xb2aceb[_0xc92c('0x33')][_0xc92c('0x34')]?_0xb2aceb[_0xc92c('0x33')]:_0xead01b['model'];if(!_0x3c16e4['query'][_0xc92c('0x35')](_0xc92c('0x36'))){_0xb2aceb[_0xc92c('0x17')]=qs['limit'](_0x3c16e4[_0xc92c('0x30')]['limit']);_0xb2aceb[_0xc92c('0x19')]=qs[_0xc92c('0x19')](_0x3c16e4['query']['offset']);}_0xb2aceb[_0xc92c('0x37')]=qs[_0xc92c('0x38')](_0x3c16e4[_0xc92c('0x30')][_0xc92c('0x38')]);_0xb2aceb[_0xc92c('0x39')]=qs[_0xc92c('0x3a')](_[_0xc92c('0x3b')](_0x3c16e4['query'],_0xead01b[_0xc92c('0x3a')]),_0x1c60f6);if(_0x3c16e4[_0xc92c('0x30')]['filter']){_0xb2aceb['where']=_[_0xc92c('0x3c')](_0xb2aceb[_0xc92c('0x39')],{'$or':_['map'](_0x1c60f6,function(_0x255afc){if(_0x255afc[_0xc92c('0x2c')]!==_0xc92c('0x3d')){var _0x2aea1c={};_0x2aea1c[_0x255afc[_0xc92c('0x27')]]={'$like':'%'+_0x3c16e4['query']['filter']+'%'};return _0x2aea1c;}})});}_0xb2aceb=_[_0xc92c('0x3c')]({},_0xb2aceb,_0x3c16e4[_0xc92c('0x3e')]);var _0x3d9bb9={'where':_0xb2aceb['where']};return db[_0xc92c('0x3f')][_0xc92c('0x18')](_0x3d9bb9)['then'](function(_0xfa572f){_0x47f0bf[_0xc92c('0x18')]=_0xfa572f;if(_0x3c16e4[_0xc92c('0x30')][_0xc92c('0x40')]){_0xb2aceb['include']=[{'all':!![]}];}return db[_0xc92c('0x3f')][_0xc92c('0x41')](_0xb2aceb);})[_0xc92c('0x20')](function(_0x48f010){_0x47f0bf[_0xc92c('0x42')]=_0x48f010;return _0x47f0bf;})[_0xc92c('0x20')](respondWithFilteredResult(_0x4b2426,_0xb2aceb))['catch'](handleError(_0x4b2426,null));};exports[_0xc92c('0x43')]=function(_0x2fe021,_0x15ffed){var _0x43e900={'raw':!![],'where':{'id':_0x2fe021[_0xc92c('0x44')]['id']}},_0x14a915={};_0x14a915['model']=_[_0xc92c('0x2f')](db['Pause'][_0xc92c('0x2a')]);_0x14a915[_0xc92c('0x30')]=_['keys'](_0x2fe021[_0xc92c('0x30')]);_0x14a915[_0xc92c('0x3a')]=_[_0xc92c('0x31')](_0x14a915[_0xc92c('0x2e')],_0x14a915[_0xc92c('0x30')]);_0x43e900[_0xc92c('0x33')]=_[_0xc92c('0x31')](_0x14a915[_0xc92c('0x2e')],qs[_0xc92c('0x32')](_0x2fe021[_0xc92c('0x30')][_0xc92c('0x32')]));_0x43e900[_0xc92c('0x33')]=_0x43e900[_0xc92c('0x33')][_0xc92c('0x34')]?_0x43e900[_0xc92c('0x33')]:_0x14a915[_0xc92c('0x2e')];if(_0x2fe021[_0xc92c('0x30')][_0xc92c('0x40')]){_0x43e900[_0xc92c('0x45')]=[{'all':!![]}];}_0x43e900=_['merge']({},_0x43e900,_0x2fe021[_0xc92c('0x3e')]);return db[_0xc92c('0x3f')][_0xc92c('0x46')](_0x43e900)[_0xc92c('0x20')](handleEntityNotFound(_0x15ffed,null))[_0xc92c('0x20')](respondWithResult(_0x15ffed,null))[_0xc92c('0x47')](handleError(_0x15ffed,null));};exports[_0xc92c('0x48')]=function(_0x33fb7a,_0x49e8a2){return db['Pause'][_0xc92c('0x48')](_0x33fb7a[_0xc92c('0x49')],{})[_0xc92c('0x20')](function(_0x14dc07){var _0x1afda7=_0x33fb7a[_0xc92c('0x4a')][_0xc92c('0x21')]({'plain':!![]});if(!_0x1afda7)throw new Error(_0xc92c('0x4b'));if(_0x1afda7[_0xc92c('0x4c')]===_0xc92c('0x4a')){var _0x27b79f=_0x14dc07['get']({'plain':!![]});var _0x3a6dc5='Pauses';return db[_0xc92c('0x4d')][_0xc92c('0x46')]({'where':{'name':_0x3a6dc5,'userProfileId':_0x1afda7[_0xc92c('0x4e')]},'raw':!![]})[_0xc92c('0x20')](function(_0xea2b63){if(_0xea2b63&&_0xea2b63[_0xc92c('0x4f')]===0x0){return db[_0xc92c('0x50')]['create']({'name':_0x27b79f['name'],'resourceId':_0x27b79f['id'],'type':_0xea2b63[_0xc92c('0x27')],'sectionId':_0xea2b63['id']},{})['then'](function(){return _0x14dc07;});}else{return _0x14dc07;}})['catch'](function(_0x1999ed){logger[_0xc92c('0x25')](_0xc92c('0x51'),_0x1999ed);throw _0x1999ed;});}return _0x14dc07;})[_0xc92c('0x20')](respondWithResult(_0x49e8a2,0xc9))['catch'](handleError(_0x49e8a2,null));};exports[_0xc92c('0x1f')]=function(_0x184ffd,_0x7f14be){if(_0x184ffd[_0xc92c('0x49')]['id']){delete _0x184ffd[_0xc92c('0x49')]['id'];}return db[_0xc92c('0x3f')][_0xc92c('0x46')]({'where':{'id':_0x184ffd[_0xc92c('0x44')]['id']}})['then'](handleEntityNotFound(_0x7f14be,null))[_0xc92c('0x20')](saveUpdates(_0x184ffd[_0xc92c('0x49')],null))[_0xc92c('0x20')](respondWithResult(_0x7f14be,null))[_0xc92c('0x47')](handleError(_0x7f14be,null));};exports[_0xc92c('0x23')]=function(_0x1b5bc,_0x18ffd9){return db[_0xc92c('0x3f')][_0xc92c('0x46')]({'where':{'id':_0x1b5bc[_0xc92c('0x44')]['id']}})[_0xc92c('0x20')](handleEntityNotFound(_0x18ffd9,null))[_0xc92c('0x20')](removeEntity(_0x18ffd9,null))[_0xc92c('0x47')](handleError(_0x18ffd9,null));};
\ No newline at end of file
index f0aecf0..650f4ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x49aa7d,_0x5d46d8){var _0xdd0d26=function(_0x159df7){while(--_0x159df7){_0x49aa7d['push'](_0x49aa7d['shift']());}};_0xdd0d26(++_0x5d46d8);}(_0x7217,0x19e));var _0x7721=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x7217[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x3914a9,_0x3866ba){var _0x27c914=function(_0x53aeab){while(--_0x53aeab){_0x3914a9['push'](_0x3914a9['shift']());}};_0x27c914(++_0x3866ba);}(_0x5fc3,0xa8));var _0x35fc=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x5fc3[_0x54c9dd];return _0x855156;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 93c2e54..cd6b460 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0xd97a82,_0x4f8c5a){var _0x324c10=function(_0x2cbc13){while(--_0x2cbc13){_0xd97a82['push'](_0xd97a82['shift']());}};_0x324c10(++_0x4f8c5a);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b7ea6,_0x195a62){_0x1b7ea6=_0x1b7ea6-0x0;var _0x4fcea6=_0xb10b[_0x1b7ea6];return _0x4fcea6;};'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
+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(_0x1fb1dd,_0x80b086){var _0x11b8dd=function(_0x1bcd8d){while(--_0x1bcd8d){_0x1fb1dd['push'](_0x1fb1dd['shift']());}};_0x11b8dd(++_0x80b086);}(_0xb10b,0x12a));var _0xbb10=function(_0x4503f6,_0x3babaf){_0x4503f6=_0x4503f6-0x0;var _0x2277d1=_0xb10b[_0x4503f6];return _0x2277d1;};'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 979a44a..ed9f6bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7c8=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','originalname','replace','format','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete'];(function(_0x5387c2,_0x19840b){var _0x5b6a53=function(_0x43370a){while(--_0x43370a){_0x5387c2['push'](_0x5387c2['shift']());}};_0x5b6a53(++_0x19840b);}(_0xb7c8,0x119));var _0x8b7c=function(_0x5c7968,_0x54d392){_0x5c7968=_0x5c7968-0x0;var _0x5d957c=_0xb7c8[_0x5c7968];return _0x5d957c;};'use strict';var multer=require('multer');var util=require(_0x8b7c('0x0'));var path=require(_0x8b7c('0x1'));var timeout=require(_0x8b7c('0x2'));var express=require(_0x8b7c('0x3'));var router=express[_0x8b7c('0x4')]();var fs_extra=require(_0x8b7c('0x5'));var auth=require(_0x8b7c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8b7c('0x7'));var controller=require(_0x8b7c('0x8'));router[_0x8b7c('0x9')]('/',auth[_0x8b7c('0xa')](),controller[_0x8b7c('0xb')]);router[_0x8b7c('0x9')](_0x8b7c('0xc'),controller[_0x8b7c('0xd')]);router[_0x8b7c('0x9')](_0x8b7c('0xe'),auth[_0x8b7c('0xa')](),controller[_0x8b7c('0xf')]);router['get'](_0x8b7c('0x10'),auth['isAuthenticated'](),controller[_0x8b7c('0x11')]);var upload=multer({'storage':multer[_0x8b7c('0x12')]({'destination':function(_0x5868ec,_0x189a25,_0x452e83){_0x452e83(null,path[_0x8b7c('0x13')](config['root'],'server/files/plugins'));},'filename':function(_0x1c7471,_0x33c5aa,_0x297c39){_0x33c5aa[_0x8b7c('0x14')]=_0x33c5aa[_0x8b7c('0x14')][_0x8b7c('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x297c39(null,util[_0x8b7c('0x16')]('%s-%s%s',path[_0x8b7c('0x17')](_0x33c5aa[_0x8b7c('0x14')],path[_0x8b7c('0x18')](_0x33c5aa['originalname'])),Date[_0x8b7c('0x19')](),path[_0x8b7c('0x18')](_0x33c5aa['originalname'])));}})});router[_0x8b7c('0x1a')]('/',upload[_0x8b7c('0x1b')](_0x8b7c('0x1c')),controller[_0x8b7c('0x1d')]);router[_0x8b7c('0x1a')]('/webhook',controller[_0x8b7c('0x1e')]);router[_0x8b7c('0x1f')](_0x8b7c('0xe'),auth[_0x8b7c('0xa')](),controller[_0x8b7c('0x20')]);router['delete'](_0x8b7c('0xe'),auth[_0x8b7c('0xa')](),controller[_0x8b7c('0x21')]);module[_0x8b7c('0x22')]=router;
\ No newline at end of file
+var _0xac9d=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','post','single','file','upload'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0xac9d,0x14d));var _0xdac9=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0xac9d[_0x2842b4];return _0x2b9521;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./plugin.controller');router[_0xdac9('0x9')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xb')]);router[_0xdac9('0x9')](_0xdac9('0xc'),controller[_0xdac9('0xd')]);router['get'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0x9')](_0xdac9('0x10'),auth[_0xdac9('0xa')](),controller[_0xdac9('0x11')]);var upload=multer({'storage':multer[_0xdac9('0x12')]({'destination':function(_0x255627,_0x1b604a,_0xbb5615){_0xbb5615(null,path['join'](config[_0xdac9('0x13')],_0xdac9('0x14')));},'filename':function(_0x5a9bde,_0x3d8e97,_0xeddbc1){_0x3d8e97[_0xdac9('0x15')]=_0x3d8e97['originalname'][_0xdac9('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xeddbc1(null,util[_0xdac9('0x17')](_0xdac9('0x18'),path['basename'](_0x3d8e97['originalname'],path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])),Date['now'](),path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])));}})});router[_0xdac9('0x1a')]('/',upload[_0xdac9('0x1b')](_0xdac9('0x1c')),controller[_0xdac9('0x1d')]);router[_0xdac9('0x1a')](_0xdac9('0xc'),controller['webhookPost']);router[_0xdac9('0x1e')](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0x1f')]);router[_0xdac9('0x20')](_0xdac9('0xe'),auth[_0xdac9('0xa')](),controller['delete']);module['exports']=router;
\ No newline at end of file
index 3004241..4f7c8a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9119=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0x9119,0x16c));var _0x9911=function(_0x1958e8,_0x1f51dc){_0x1958e8=_0x1958e8-0x0;var _0xc10b1c=_0x9119[_0x1958e8];return _0xc10b1c;};'use strict';var Sequelize=require('sequelize');module[_0x9911('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9911('0x1')](_0x9911('0x2'),_0x9911('0x3'))},'description':{'type':Sequelize[_0x9911('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x9911('0x5')],'comment':_0x9911('0x6')},'active':{'type':Sequelize[_0x9911('0x7')],'defaultValue':0x0,'comment':_0x9911('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x9911('0x9'),'agentOnly',_0x9911('0xa'),_0x9911('0xb')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x9911('0x5')]},'scriptName':{'type':Sequelize[_0x9911('0x5')]},'scriptPath':{'type':Sequelize[_0x9911('0x5')]}};
\ No newline at end of file
+var _0x0bd7=['exports','ENUM','html','script','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','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x36b88a,_0x55db0c){var _0x41909d=function(_0x2389ef){while(--_0x2389ef){_0x36b88a['push'](_0x36b88a['shift']());}};_0x41909d(++_0x55db0c);}(_0x0bd7,0x1c0));var _0x70bd=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x0bd7[_0x580647];return _0x5f0792;};'use strict';var Sequelize=require('sequelize');module[_0x70bd('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x70bd('0x1')](_0x70bd('0x2'),_0x70bd('0x3'))},'description':{'type':Sequelize[_0x70bd('0x4')]},'version':{'type':Sequelize[_0x70bd('0x4')]},'path':{'type':Sequelize[_0x70bd('0x5')],'comment':_0x70bd('0x6')},'active':{'type':Sequelize[_0x70bd('0x7')],'defaultValue':0x0,'comment':_0x70bd('0x8')},'sidebar':{'type':Sequelize[_0x70bd('0x1')](_0x70bd('0x9'),_0x70bd('0xa'),'always',_0x70bd('0xb')),'defaultValue':_0x70bd('0xc'),'comment':_0x70bd('0xd')},'icon':{'type':Sequelize[_0x70bd('0x5')]},'adminUrl':{'type':Sequelize[_0x70bd('0x5')]},'agentUrl':{'type':Sequelize[_0x70bd('0x5')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x70bd('0x5')]}};
\ No newline at end of file
index 9b2ad98..b5d07dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9af9=['Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','icon-apps','version','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','scriptName','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','Plugins','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','UserProfileResource','sendStatus','error','name','index','Plugin','rawAttributes','type','model','map','query','keys','intersection','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','include','findAll','rows','catch','show','fields','includeAll','find','download','params','root','server/files/plugins','format','basename','createWriteStream','warning','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Error','%s.zip'];(function(_0x56d412,_0x589657){var _0x5f0db7=function(_0x5bea47){while(--_0x5bea47){_0x56d412['push'](_0x56d412['shift']());}};_0x5f0db7(++_0x589657);}(_0x9af9,0x192));var _0x99af=function(_0x1530b2,_0x5be114){_0x1530b2=_0x1530b2-0x0;var _0x1bf300=_0x9af9[_0x1530b2];return _0x1bf300;};'use strict';var emlformat=require(_0x99af('0x0'));var rimraf=require(_0x99af('0x1'));var zipdir=require(_0x99af('0x2'));var jsonpatch=require(_0x99af('0x3'));var rp=require(_0x99af('0x4'));var moment=require(_0x99af('0x5'));var BPromise=require(_0x99af('0x6'));var Mustache=require(_0x99af('0x7'));var util=require(_0x99af('0x8'));var path=require(_0x99af('0x9'));var sox=require(_0x99af('0xa'));var csv=require(_0x99af('0xb'));var ejs=require(_0x99af('0xc'));var fs=require('fs');var fs_extra=require(_0x99af('0xd'));var _=require(_0x99af('0xe'));var squel=require('squel');var crypto=require(_0x99af('0xf'));var jsforce=require(_0x99af('0x10'));var deskjs=require(_0x99af('0x11'));var toCsv=require(_0x99af('0xb'));var querystring=require(_0x99af('0x12'));var Papa=require(_0x99af('0x13'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0x99af('0x14'));var Redis=require(_0x99af('0x15'));var authService=require(_0x99af('0x16'));var qs=require(_0x99af('0x17'));var as=require(_0x99af('0x18'));var hardwareService=require(_0x99af('0x19'));var logger=require('../../config/logger')('api');var utils=require(_0x99af('0x1a'));var config=require(_0x99af('0x1b'));var licenseUtil=require(_0x99af('0x1c'));var db=require(_0x99af('0x1d'))['db'];config[_0x99af('0x1e')]=_[_0x99af('0x1f')](config['redis'],{'host':_0x99af('0x20'),'port':0x18eb});var socket=require(_0x99af('0x21'))(new Redis(config[_0x99af('0x1e')]));require(_0x99af('0x22'))[_0x99af('0x23')](socket);function respondWithStatusCode(_0x19b327,_0x50d257){_0x50d257=_0x50d257||0xcc;return function(_0x56d804){if(_0x56d804){return _0x19b327['sendStatus'](_0x50d257);}return _0x19b327[_0x99af('0x24')](_0x50d257)[_0x99af('0x25')]();};}function respondWithResult(_0x44a8cd,_0x4bad49){_0x4bad49=_0x4bad49||0xc8;return function(_0x1d281a){if(_0x1d281a){return _0x44a8cd[_0x99af('0x24')](_0x4bad49)['json'](_0x1d281a);}};}function respondWithFilteredResult(_0x3a042b,_0xfdfb4d){return function(_0x1d8ca8){if(_0x1d8ca8){var _0xb2dd7e=typeof _0xfdfb4d[_0x99af('0x26')]===_0x99af('0x27')&&typeof _0xfdfb4d[_0x99af('0x28')]===_0x99af('0x27');var _0x31fcfe=_0x1d8ca8[_0x99af('0x29')];var _0x2a51c7=_0xb2dd7e?0x0:_0xfdfb4d[_0x99af('0x26')];var _0x4f126b=_0xb2dd7e?_0x1d8ca8[_0x99af('0x29')]:_0xfdfb4d['offset']+_0xfdfb4d[_0x99af('0x28')];var _0x3731b5;if(_0x4f126b>=_0x31fcfe){_0x4f126b=_0x31fcfe;_0x3731b5=0xc8;}else{_0x3731b5=0xce;}_0x3a042b[_0x99af('0x24')](_0x3731b5);return _0x3a042b[_0x99af('0x2a')](_0x99af('0x2b'),_0x2a51c7+'-'+_0x4f126b+'/'+_0x31fcfe)[_0x99af('0x2c')](_0x1d8ca8);}return null;};}function patchUpdates(_0x4e4c1f){return function(_0xa18282){try{jsonpatch[_0x99af('0x2d')](_0xa18282,_0x4e4c1f,!![]);}catch(_0x5a92fc){return BPromise[_0x99af('0x2e')](_0x5a92fc);}return _0xa18282['save']();};}function saveUpdates(_0x1e52d0,_0x286240){return function(_0x3fc0c4){if(_0x3fc0c4){return _0x3fc0c4[_0x99af('0x2f')](_0x1e52d0)[_0x99af('0x30')](function(_0x17eb04){return _0x17eb04;});}return null;};}function removeEntity(_0x4011e1,_0x515f18){return function(_0x14bf36){if(_0x14bf36){return _0x14bf36[_0x99af('0x31')]()[_0x99af('0x30')](function(){var _0x32fdaa=_0x14bf36['get']({'plain':!![]});var _0x2e309c='Plugins';return db[_0x99af('0x32')][_0x99af('0x31')]({'where':{'type':_0x2e309c,'resourceId':_0x32fdaa['id']}})[_0x99af('0x30')](function(){return _0x14bf36;});})[_0x99af('0x30')](function(){_0x4011e1[_0x99af('0x24')](0xcc)[_0x99af('0x25')]();});}};}function handleEntityNotFound(_0x353d40,_0x2f73d8){return function(_0x5870f7){if(!_0x5870f7){_0x353d40[_0x99af('0x33')](0x194);}return _0x5870f7;};}function handleError(_0x3fa1bb,_0x306076){_0x306076=_0x306076||0x1f4;return function(_0x14ad85){logger[_0x99af('0x34')](_0x14ad85['stack']);if(_0x14ad85[_0x99af('0x35')]){delete _0x14ad85[_0x99af('0x35')];}_0x3fa1bb[_0x99af('0x24')](_0x306076)['send'](_0x14ad85);};}exports[_0x99af('0x36')]=function(_0x3ba000,_0x1c2f7e){var _0x168b5e={},_0x2fa2db={},_0x4e2533={'count':0x0,'rows':[]};var _0x2cbf52=_['map'](db[_0x99af('0x37')][_0x99af('0x38')],function(_0x46f470){return{'name':_0x46f470['fieldName'],'type':_0x46f470[_0x99af('0x39')]['key']};});_0x2fa2db[_0x99af('0x3a')]=_[_0x99af('0x3b')](_0x2cbf52,'name');_0x2fa2db[_0x99af('0x3c')]=_[_0x99af('0x3d')](_0x3ba000[_0x99af('0x3c')]);_0x2fa2db['filters']=_[_0x99af('0x3e')](_0x2fa2db['model'],_0x2fa2db[_0x99af('0x3c')]);_0x168b5e[_0x99af('0x3f')]=_[_0x99af('0x3e')](_0x2fa2db['model'],qs['fields'](_0x3ba000['query']['fields']));_0x168b5e[_0x99af('0x3f')]=_0x168b5e['attributes'][_0x99af('0x40')]?_0x168b5e[_0x99af('0x3f')]:_0x2fa2db['model'];if(!_0x3ba000[_0x99af('0x3c')]['hasOwnProperty'](_0x99af('0x41'))){_0x168b5e[_0x99af('0x28')]=qs[_0x99af('0x28')](_0x3ba000['query'][_0x99af('0x28')]);_0x168b5e[_0x99af('0x26')]=qs[_0x99af('0x26')](_0x3ba000[_0x99af('0x3c')]['offset']);}_0x168b5e[_0x99af('0x42')]=qs[_0x99af('0x43')](_0x3ba000[_0x99af('0x3c')][_0x99af('0x43')]);_0x168b5e['where']=qs[_0x99af('0x44')](_[_0x99af('0x45')](_0x3ba000[_0x99af('0x3c')],_0x2fa2db[_0x99af('0x44')]),_0x2cbf52);if(_0x3ba000[_0x99af('0x3c')][_0x99af('0x46')]){_0x168b5e[_0x99af('0x47')]=_[_0x99af('0x48')](_0x168b5e[_0x99af('0x47')],{'$or':_['map'](_0x2cbf52,function(_0x52913e){if(_0x52913e[_0x99af('0x39')]!=='VIRTUAL'){var _0x55be5e={};_0x55be5e[_0x52913e[_0x99af('0x35')]]={'$like':'%'+_0x3ba000[_0x99af('0x3c')]['filter']+'%'};return _0x55be5e;}})});}_0x168b5e=_[_0x99af('0x48')]({},_0x168b5e,_0x3ba000['options']);var _0x5b991b={'where':_0x168b5e['where']};return db[_0x99af('0x37')][_0x99af('0x29')](_0x5b991b)[_0x99af('0x30')](function(_0x3eeee6){_0x4e2533['count']=_0x3eeee6;if(_0x3ba000['query']['includeAll']){_0x168b5e[_0x99af('0x49')]=[{'all':!![]}];}return db[_0x99af('0x37')][_0x99af('0x4a')](_0x168b5e);})[_0x99af('0x30')](function(_0x3fef1b){_0x4e2533[_0x99af('0x4b')]=_0x3fef1b;return _0x4e2533;})[_0x99af('0x30')](respondWithFilteredResult(_0x1c2f7e,_0x168b5e))[_0x99af('0x4c')](handleError(_0x1c2f7e,null));};exports[_0x99af('0x4d')]=function(_0x35e34d,_0x11062d){var _0x21c545={'raw':!![],'where':{'id':_0x35e34d['params']['id']}},_0x590dd3={};_0x590dd3[_0x99af('0x3a')]=_[_0x99af('0x3d')](db[_0x99af('0x37')][_0x99af('0x38')]);_0x590dd3[_0x99af('0x3c')]=_['keys'](_0x35e34d['query']);_0x590dd3[_0x99af('0x44')]=_[_0x99af('0x3e')](_0x590dd3[_0x99af('0x3a')],_0x590dd3[_0x99af('0x3c')]);_0x21c545['attributes']=_[_0x99af('0x3e')](_0x590dd3[_0x99af('0x3a')],qs[_0x99af('0x4e')](_0x35e34d[_0x99af('0x3c')]['fields']));_0x21c545[_0x99af('0x3f')]=_0x21c545[_0x99af('0x3f')][_0x99af('0x40')]?_0x21c545['attributes']:_0x590dd3[_0x99af('0x3a')];if(_0x35e34d[_0x99af('0x3c')][_0x99af('0x4f')]){_0x21c545['include']=[{'all':!![]}];}_0x21c545=_[_0x99af('0x48')]({},_0x21c545,_0x35e34d['options']);return db[_0x99af('0x37')][_0x99af('0x50')](_0x21c545)[_0x99af('0x30')](handleEntityNotFound(_0x11062d,null))[_0x99af('0x30')](respondWithResult(_0x11062d,null))[_0x99af('0x4c')](handleError(_0x11062d,null));};exports[_0x99af('0x51')]=function(_0x2506f0,_0x334237,_0x468721){return db[_0x99af('0x37')][_0x99af('0x50')]({'where':{'id':_0x2506f0[_0x99af('0x52')]['id']},'attributes':['name',_0x99af('0x9')],'raw':!![]})['then'](handleEntityNotFound(_0x334237,null))[_0x99af('0x30')](function(_0x5a2d3e){if(_0x5a2d3e){var _0x20b2b1=path['join'](config[_0x99af('0x53')],_0x99af('0x54'),util[_0x99af('0x55')]('%s.zip',path[_0x99af('0x56')](_0x5a2d3e[_0x99af('0x9')])));var _0x1bb75a=fs[_0x99af('0x57')](_0x20b2b1);var _0x5492ea=archiver('zip',{'zlib':{'level':0x9}});_0x5492ea['on'](_0x99af('0x58'),function(_0x1b2e32){if(_0x1b2e32['code']===_0x99af('0x59')){logger[_0x99af('0x34')](_0x1b2e32);}else{throw new db['Sequelize']['Error'](_0x99af('0x5a'));}});_0x5492ea['on'](_0x99af('0x34'),function(_0x1e6230){throw new db[(_0x99af('0x5b'))]['Error'](_0x99af('0x5a'));});_0x5492ea['pipe'](_0x1bb75a);_0x5492ea[_0x99af('0x5c')](_0x99af('0x5d'),{'cwd':path[_0x99af('0x5e')](config[_0x99af('0x53')],_0x99af('0x54'),path[_0x99af('0x5f')](_0x5a2d3e[_0x99af('0x9')])),'ignore':[path['join'](path[_0x99af('0x56')](_0x5a2d3e[_0x99af('0x9')]),_0x99af('0x60')),path[_0x99af('0x5e')](path['basename'](_0x5a2d3e['path']),_0x99af('0x61'))],'nodir':!![]})[_0x99af('0x62')]();_0x1bb75a['on']('close',function(){if(!fs[_0x99af('0x63')](_0x20b2b1)){throw new db[(_0x99af('0x5b'))][(_0x99af('0x64'))]('Plugin\x20not\x20found');}return _0x334237['download'](_0x20b2b1,util['format'](_0x99af('0x65'),path[_0x99af('0x56')](_0x5a2d3e[_0x99af('0x9')])),function(_0x1d8ebf){if(_0x1d8ebf){throw new db[(_0x99af('0x5b'))][(_0x99af('0x64'))](_0x99af('0x66'));}fs[_0x99af('0x67')](_0x20b2b1);logger[_0x99af('0x68')](_0x99af('0x69'));logger[_0x99af('0x68')](_0x99af('0x6a'));});});}return null;})[_0x99af('0x4c')](handleError(_0x334237,null));};exports[_0x99af('0x6b')]=function(_0x11ea82,_0x501d6a,_0x19c897){var _0x16e70b=path[_0x99af('0x56')](_0x11ea82[_0x99af('0x6c')]['filename'],path[_0x99af('0x6d')](_0x11ea82[_0x99af('0x6c')][_0x99af('0x6e')]));var _0x3346df=path[_0x99af('0x5e')](config[_0x99af('0x53')],_0x99af('0x54'),_0x11ea82[_0x99af('0x6c')][_0x99af('0x6e')]);var _0x3e0d50=path[_0x99af('0x5e')](config[_0x99af('0x53')],_0x99af('0x54'),_0x16e70b);logger[_0x99af('0x68')](_0x99af('0x6f'),_0x3346df);logger[_0x99af('0x68')](_0x99af('0x70'),_0x3e0d50);try{fs['chmodSync'](_0x3346df,parseInt('0777',0x8));extract(_0x3346df,{'dir':_0x3e0d50},function(_0x540498){if(_0x540498){logger[_0x99af('0x34')](_0x540498);handleError(_0x540498,!![]);};var _0x30986e=fs[_0x99af('0x71')](_0x3e0d50);if(_0x30986e[_0x99af('0x40')]>0x1){removeReferences(_0x3346df,_0x3e0d50);logger['error'](_0x99af('0x72'));return _0x19c897(new Error('Invalid\x20plugin\x20structure'));}var _0x42b5dc=fs[_0x99af('0x73')](path[_0x99af('0x5e')](_0x3e0d50,_0x30986e[0x0]));if(_0x42b5dc['isFile']()){removeReferences(_0x3346df,_0x3e0d50);logger[_0x99af('0x34')]('Invalid\x20plugin\x20structure');return _0x19c897(new Error(_0x99af('0x72')));}if(_0x42b5dc[_0x99af('0x74')]()){var _0x181c83=fs[_0x99af('0x71')](path[_0x99af('0x5e')](_0x3e0d50,_0x30986e[0x0]));if(_0x181c83[_0x99af('0x40')]===0x0){removeReferences(_0x3346df,_0x3e0d50);logger[_0x99af('0x34')](_0x99af('0x72'));return _0x19c897(new Error(_0x99af('0x72')));}var _0x2b1970=_0x181c83['some'](function(_0x4f1a56){return _0x4f1a56==='manifest.json';});if(!_0x2b1970){return _0x19c897(new Error('Plugin\x20manifest\x20missing'));}var _0x318747=fs[_0x99af('0x75')](path[_0x99af('0x5e')](_0x3e0d50,_0x30986e[0x0],_0x99af('0x76')));var _0x1efe50=JSON[_0x99af('0x77')](_0x318747);if(_0x99af('0x27')==typeof _0x1efe50[_0x99af('0x35')]){return _0x19c897(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x99af('0x27')==typeof _0x1efe50['type']){return _0x19c897(new Error(_0x99af('0x78')));}if(_0x99af('0x27')==typeof _0x1efe50['version']){return _0x19c897(new Error(_0x99af('0x79')));}if(_0x99af('0x27')==typeof _0x1efe50[_0x99af('0x7a')]){return _0x19c897(new Error(_0x99af('0x7b')));}if(_0x1efe50[_0x99af('0x39')]===_0x99af('0x7c')){if('undefined'==typeof _0x1efe50[_0x99af('0x7a')][_0x99af('0x7d')]){return _0x19c897(new Error(_0x99af('0x7e')));}if(_0x99af('0x27')==typeof _0x1efe50[_0x99af('0x7a')][_0x99af('0x7d')][_0x99af('0x7f')]&&_0x99af('0x27')==typeof _0x1efe50['parameters']['views'][_0x99af('0x80')]){return _0x19c897(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1efe50['type']===_0x99af('0x81')){if(_0x99af('0x27')==typeof _0x1efe50[_0x99af('0x7a')]['scriptName']){return _0x19c897(new Error(_0x99af('0x82')));}if(_0x99af('0x27')==typeof _0x1efe50[_0x99af('0x7a')][_0x99af('0x83')]){return _0x19c897(new Error(_0x99af('0x84')));}}else{return _0x19c897(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x36cc61=_0x1efe50[_0x99af('0x35')];var _0xe36bc5=_0x1efe50['description'];var _0x2b1840=_0x1efe50[_0x99af('0x39')];var _0x431180=_0x1efe50[_0x99af('0x85')]?_0x1efe50[_0x99af('0x85')]:_0x99af('0x86');var _0xc77a36=_0x1efe50[_0x99af('0x87')]?_0x1efe50['icon']:_0x99af('0x88');var _0x260cb2='';var _0x281874='';var _0x2a3e4e='';var _0xa412af='';var _0x1bbc46=_0x1efe50[_0x99af('0x89')];if(_0x2b1840===_0x99af('0x7c')){if('undefined'!=typeof _0x1efe50[_0x99af('0x7a')]['views']['admin']){var _0x48dfe4=_0x1efe50['parameters'][_0x99af('0x7d')][_0x99af('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x48dfe4)){_0x260cb2=path[_0x99af('0x5e')](_0x99af('0x8a'),_0x16e70b,_0x30986e[0x0],_0x48dfe4);}else{_0x260cb2=_0x48dfe4;}}else{logger[_0x99af('0x68')](_0x99af('0x8b'));}if('undefined'!=typeof _0x1efe50[_0x99af('0x7a')][_0x99af('0x7d')][_0x99af('0x80')]){var _0x15cac4=_0x1efe50['parameters'][_0x99af('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x99af('0x8c')](_0x15cac4)){_0x281874=path[_0x99af('0x5e')](_0x99af('0x8a'),_0x16e70b,_0x30986e[0x0],_0x15cac4);}else{_0x281874=_0x15cac4;}}else{logger[_0x99af('0x68')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x2b1840==='script'){_0x2a3e4e=_0x1efe50[_0x99af('0x7a')][_0x99af('0x8d')];_0xa412af=_0x1efe50[_0x99af('0x7a')][_0x99af('0x83')];if(_0x99af('0x27')!=typeof _0x1efe50[_0x99af('0x7a')]['views']){if('undefined'!=typeof _0x1efe50[_0x99af('0x7a')][_0x99af('0x7d')][_0x99af('0x7f')]){var _0x48dfe4=_0x1efe50['parameters'][_0x99af('0x7d')][_0x99af('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x99af('0x8c')](_0x48dfe4)){_0x260cb2=path['join'](_0x99af('0x8a'),_0x16e70b,_0x30986e[0x0],_0x48dfe4);}else{_0x260cb2=_0x48dfe4;}}if(_0x99af('0x27')!=typeof _0x1efe50[_0x99af('0x7a')][_0x99af('0x7d')]['agent']){var _0x15cac4=_0x1efe50[_0x99af('0x7a')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x99af('0x8c')](_0x15cac4)){_0x281874=path[_0x99af('0x5e')](_0x99af('0x8a'),_0x16e70b,_0x30986e[0x0],_0x15cac4);}else{_0x281874=_0x15cac4;}}}}var _0x2ea970={'name':_0x36cc61,'description':_0xe36bc5,'path':path['join'](_0x16e70b,_0x30986e[0x0]),'type':_0x2b1840,'sidebar':_0x431180,'icon':_0xc77a36,'adminUrl':_0x260cb2,'agentUrl':_0x281874,'scriptName':_0x2a3e4e,'scriptPath':_0xa412af,'version':_0x1bbc46};removeReferences(_0x3346df,null);return db['Plugin'][_0x99af('0x8e')](_0x2ea970)['then'](function(_0x717297){var _0x340165={'role':_0x11ea82[_0x99af('0x8f')][_0x99af('0x90')],'userProfileId':_0x11ea82[_0x99af('0x8f')]['userProfileId']};if(!_0x340165)throw new Error(_0x99af('0x91'));if(_0x340165[_0x99af('0x90')]===_0x99af('0x92')){var _0x203112=_0x717297[_0x99af('0x93')]({'plain':!![]});return db['UserProfileSection'][_0x99af('0x50')]({'where':{'name':_0x99af('0x94'),'userProfileId':_0x340165['userProfileId']},'raw':!![]})[_0x99af('0x30')](function(_0x3dbe9b){if(_0x3dbe9b&&_0x3dbe9b['autoAssociation']===0x0){return db[_0x99af('0x32')][_0x99af('0x8e')]({'name':_0x203112[_0x99af('0x35')],'resourceId':_0x203112['id'],'type':_0x3dbe9b[_0x99af('0x35')],'sectionId':_0x3dbe9b['id']},{})['then'](function(){return _0x717297;});}else{return _0x717297;}})[_0x99af('0x4c')](function(_0x3c0437){logger[_0x99af('0x34')](_0x99af('0x95'),_0x3c0437);throw _0x3c0437;});}return _0x717297;})[_0x99af('0x30')](respondWithResult(_0x501d6a,null))[_0x99af('0x4c')](handleError(_0x501d6a,null));}});}catch(_0x25d84e){_0x501d6a[_0x99af('0x24')](0x1f4)[_0x99af('0x96')](_0x25d84e);}};function removeReferences(_0x1fb331,_0x2a0401){try{if(_0x1fb331){fs['unlinkSync'](_0x1fb331);logger[_0x99af('0x68')]('Zip\x20archive\x20removed');}if(_0x2a0401){rimraf(_0x2a0401,function(){});logger[_0x99af('0x68')]('Extracted\x20folder\x20removed');}}catch(_0x3bd255){logger[_0x99af('0x34')](_0x3bd255);}}exports[_0x99af('0x2f')]=function(_0x94b922,_0x3b141a,_0xae9c84){return db[_0x99af('0x37')][_0x99af('0x50')]({'where':{'id':_0x94b922['params']['id']}})[_0x99af('0x30')](handleEntityNotFound(_0x3b141a,null))[_0x99af('0x30')](saveUpdates(_0x94b922[_0x99af('0x8f')],null))[_0x99af('0x30')](respondWithResult(_0x3b141a,null))[_0x99af('0x4c')](handleError(_0x3b141a,null));};exports[_0x99af('0x97')]=function(_0x3bc02b,_0x57de44,_0x284f62){return db[_0x99af('0x37')][_0x99af('0x50')]({'where':{'id':_0x3bc02b[_0x99af('0x52')]['id']}})[_0x99af('0x30')](function(_0x27c33d){if(_0x27c33d){return _0x27c33d['destroy']();}})['then'](function(_0x13c487){rimraf(path['join'](config[_0x99af('0x53')],_0x99af('0x54'),path[_0x99af('0x5f')](_0x13c487[_0x99af('0x9')])),function(){});return _0x13c487;})[_0x99af('0x30')](handleEntityNotFound(_0x57de44,null))[_0x99af('0x30')](respondWithStatusCode(_0x57de44,null))[_0x99af('0x4c')](handleError(_0x57de44,null));};exports[_0x99af('0x98')]=function(_0x373af3,_0x1b6377,_0x1aac9f){return BPromise[_0x99af('0x99')]()['then'](function(){if(!_0x373af3['query'][_0x99af('0x9')]){throw new Error(_0x99af('0x9a'));}if(!_0x373af3['query'][_0x99af('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x238172=_0x373af3[_0x99af('0x3c')][_0x99af('0x9c')]?_0x373af3[_0x99af('0x3c')][_0x99af('0x9c')]+':'+_0x373af3[_0x99af('0x3c')][_0x99af('0x9b')]:_0x99af('0x9d')+_0x373af3['query']['port'];var _0x536560=_0x373af3[_0x99af('0x3c')][_0x99af('0x2c')]?_0x373af3[_0x99af('0x3c')][_0x99af('0x2c')]:!![];var _0x315b46=_0x373af3['query'][_0x99af('0x9e')]?_0x373af3[_0x99af('0x3c')][_0x99af('0x9e')]:null;var _0x3272ae={'method':_0x373af3[_0x99af('0x9f')],'uri':util[_0x99af('0x55')]('%s%s',_0x238172,_0x373af3[_0x99af('0x3c')]['path']),'json':_0x536560,'resolveWithFullResponse':!![],'encoding':_0x315b46,'qs':_0x373af3[_0x99af('0x3c')]};if(_0x373af3[_0x99af('0xa0')]){_0x3272ae[_0x99af('0xa0')]=_0x373af3['headers'];if(_0x3272ae['headers']['content-length']){delete _0x3272ae[_0x99af('0xa0')][_0x99af('0xa1')];}}if(_0x3272ae[_0x99af('0xa0')]['content-type']){delete _0x3272ae[_0x99af('0xa0')][_0x99af('0xa2')];}return rp(_0x3272ae);})[_0x99af('0x30')](function(_0x599b66){if(_0x599b66){_0x1b6377[_0x99af('0x2a')](_0x599b66[_0x99af('0xa0')]);logger['info'](_0x599b66['body']);if(_[_0x99af('0xa3')](_0x373af3['query'][_0x99af('0x9')],_0x99af('0x51'))&&_0x599b66['statusCode']==0x1f4){return _0x1b6377['sendStatus'](_0x599b66[_0x99af('0xa4')]);}else{return _0x1b6377['status'](_0x599b66[_0x99af('0xa4')])[_0x99af('0x96')](_0x599b66[_0x99af('0x8f')]);}}else{return _0x1b6377[_0x99af('0x33')](0xc8);}})[_0x99af('0x4c')](handleError(_0x1b6377,null));};exports[_0x99af('0xa5')]=function(_0x40e01b,_0x17a6fe,_0x3ddf86){return BPromise[_0x99af('0x99')]()[_0x99af('0x30')](function(){if(!_0x40e01b[_0x99af('0x3c')][_0x99af('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x40e01b[_0x99af('0x3c')]['port']){throw new Error(_0x99af('0xa6'));}var _0x5e1c52=_0x40e01b[_0x99af('0x3c')][_0x99af('0x9c')]?_0x40e01b[_0x99af('0x3c')]['hostname']+':'+_0x40e01b[_0x99af('0x3c')][_0x99af('0x9b')]:_0x99af('0x9d')+_0x40e01b[_0x99af('0x3c')]['port'];var _0x2f89c8=_0x40e01b[_0x99af('0x3c')][_0x99af('0x2c')]?_0x40e01b['query']['json']:!![];var _0x3f3e8a=_0x40e01b[_0x99af('0x3c')]['encoding']?_0x40e01b[_0x99af('0x3c')][_0x99af('0x9e')]:null;var _0xcbe14d={'method':_0x40e01b[_0x99af('0x9f')],'uri':util[_0x99af('0x55')](_0x99af('0xa7'),_0x5e1c52,_0x40e01b[_0x99af('0x3c')][_0x99af('0x9')]),'json':_0x2f89c8,'resolveWithFullResponse':!![],'encoding':_0x3f3e8a,'body':_0x40e01b[_0x99af('0x8f')]};if(_0x40e01b[_0x99af('0xa0')]){_0xcbe14d[_0x99af('0xa0')]=_0x40e01b[_0x99af('0xa0')];if(_0xcbe14d[_0x99af('0xa0')]['content-length']){delete _0xcbe14d[_0x99af('0xa0')][_0x99af('0xa1')];}}if(_0xcbe14d[_0x99af('0xa0')][_0x99af('0xa2')]){delete _0xcbe14d[_0x99af('0xa0')]['content-type'];}return rp(_0xcbe14d);})[_0x99af('0x30')](function(_0x2d635d){if(_0x2d635d){_0x17a6fe[_0x99af('0x2a')](_0x2d635d[_0x99af('0xa0')]);logger[_0x99af('0x68')](_0x2d635d[_0x99af('0x8f')]);return _0x17a6fe[_0x99af('0x24')](_0x2d635d['statusCode'])[_0x99af('0x96')](_0x2d635d[_0x99af('0x8f')]);}else{return _0x17a6fe[_0x99af('0x33')](0xc8);}})[_0x99af('0x4c')](handleError(_0x17a6fe,null));};
\ No newline at end of file
+var _0x5cc8=['script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','params','delete','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','statusCode','webhookPost','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./plugin.socket','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','get','Plugins','UserProfileResource','end','error','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','Plugin','includeAll','include','rows','show','find','catch','download','path','join','root','server/files/plugins','format','warning','code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','dirname','node_modules/**/*','basename','attachments/**/*','close','%s.zip','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified'];(function(_0x28da51,_0x401ea9){var _0x310386=function(_0x2c1a2d){while(--_0x2c1a2d){_0x28da51['push'](_0x28da51['shift']());}};_0x310386(++_0x401ea9);}(_0x5cc8,0xce));var _0x85cc=function(_0x595495,_0x59bc71){_0x595495=_0x595495-0x0;var _0x34a329=_0x5cc8[_0x595495];return _0x34a329;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x85cc('0x0'));var zipdir=require(_0x85cc('0x1'));var jsonpatch=require(_0x85cc('0x2'));var rp=require(_0x85cc('0x3'));var moment=require(_0x85cc('0x4'));var BPromise=require(_0x85cc('0x5'));var Mustache=require(_0x85cc('0x6'));var util=require(_0x85cc('0x7'));var path=require('path');var sox=require(_0x85cc('0x8'));var csv=require('to-csv');var ejs=require(_0x85cc('0x9'));var fs=require('fs');var fs_extra=require(_0x85cc('0xa'));var _=require(_0x85cc('0xb'));var squel=require(_0x85cc('0xc'));var crypto=require(_0x85cc('0xd'));var jsforce=require(_0x85cc('0xe'));var deskjs=require(_0x85cc('0xf'));var toCsv=require(_0x85cc('0x10'));var querystring=require(_0x85cc('0x11'));var Papa=require('papaparse');var extract=require(_0x85cc('0x12'));var rimraf=require('rimraf');var archiver=require(_0x85cc('0x13'));var Redis=require(_0x85cc('0x14'));var authService=require(_0x85cc('0x15'));var qs=require(_0x85cc('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85cc('0x17'))(_0x85cc('0x18'));var utils=require(_0x85cc('0x19'));var config=require(_0x85cc('0x1a'));var licenseUtil=require(_0x85cc('0x1b'));var db=require('../../mysqldb')['db'];config[_0x85cc('0x1c')]=_['defaults'](config[_0x85cc('0x1c')],{'host':_0x85cc('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85cc('0x1c')]));require(_0x85cc('0x1e'))['register'](socket);function respondWithStatusCode(_0x3ac683,_0x462d2b){_0x462d2b=_0x462d2b||0xcc;return function(_0x6a3cac){if(_0x6a3cac){return _0x3ac683[_0x85cc('0x1f')](_0x462d2b);}return _0x3ac683[_0x85cc('0x20')](_0x462d2b)['end']();};}function respondWithResult(_0x130c45,_0x145a8a){_0x145a8a=_0x145a8a||0xc8;return function(_0x2649a3){if(_0x2649a3){return _0x130c45[_0x85cc('0x20')](_0x145a8a)['json'](_0x2649a3);}};}function respondWithFilteredResult(_0x30cde6,_0x26619e){return function(_0x3b2ef5){if(_0x3b2ef5){var _0x52fefc=typeof _0x26619e[_0x85cc('0x21')]===_0x85cc('0x22')&&typeof _0x26619e[_0x85cc('0x23')]===_0x85cc('0x22');var _0x5ece18=_0x3b2ef5[_0x85cc('0x24')];var _0x12be29=_0x52fefc?0x0:_0x26619e[_0x85cc('0x21')];var _0x556dcb=_0x52fefc?_0x3b2ef5['count']:_0x26619e[_0x85cc('0x21')]+_0x26619e['limit'];var _0x9ba97f;if(_0x556dcb>=_0x5ece18){_0x556dcb=_0x5ece18;_0x9ba97f=0xc8;}else{_0x9ba97f=0xce;}_0x30cde6[_0x85cc('0x20')](_0x9ba97f);return _0x30cde6['set'](_0x85cc('0x25'),_0x12be29+'-'+_0x556dcb+'/'+_0x5ece18)[_0x85cc('0x26')](_0x3b2ef5);}return null;};}function patchUpdates(_0x3ac9b3){return function(_0x379402){try{jsonpatch[_0x85cc('0x27')](_0x379402,_0x3ac9b3,!![]);}catch(_0x5b21bf){return BPromise[_0x85cc('0x28')](_0x5b21bf);}return _0x379402[_0x85cc('0x29')]();};}function saveUpdates(_0x5b936c,_0x50747c){return function(_0x382d6d){if(_0x382d6d){return _0x382d6d['update'](_0x5b936c)[_0x85cc('0x2a')](function(_0x5b8096){return _0x5b8096;});}return null;};}function removeEntity(_0x5b32f6,_0x205b40){return function(_0x4a50de){if(_0x4a50de){return _0x4a50de['destroy']()[_0x85cc('0x2a')](function(){var _0x1f50d3=_0x4a50de[_0x85cc('0x2b')]({'plain':!![]});var _0x1aa856=_0x85cc('0x2c');return db[_0x85cc('0x2d')]['destroy']({'where':{'type':_0x1aa856,'resourceId':_0x1f50d3['id']}})[_0x85cc('0x2a')](function(){return _0x4a50de;});})[_0x85cc('0x2a')](function(){_0x5b32f6[_0x85cc('0x20')](0xcc)[_0x85cc('0x2e')]();});}};}function handleEntityNotFound(_0x55ebcd,_0x3d2744){return function(_0xc1bc16){if(!_0xc1bc16){_0x55ebcd['sendStatus'](0x194);}return _0xc1bc16;};}function handleError(_0x3991b3,_0x6d3997){_0x6d3997=_0x6d3997||0x1f4;return function(_0xf50c1d){logger[_0x85cc('0x2f')](_0xf50c1d['stack']);if(_0xf50c1d['name']){delete _0xf50c1d['name'];}_0x3991b3[_0x85cc('0x20')](_0x6d3997)['send'](_0xf50c1d);};}exports[_0x85cc('0x30')]=function(_0x2a6121,_0x32f551){var _0x14a922={},_0xae240b={},_0x4d39e5={'count':0x0,'rows':[]};var _0x36746e=_[_0x85cc('0x31')](db['Plugin'][_0x85cc('0x32')],function(_0x3600a4){return{'name':_0x3600a4[_0x85cc('0x33')],'type':_0x3600a4[_0x85cc('0x34')][_0x85cc('0x35')]};});_0xae240b[_0x85cc('0x36')]=_[_0x85cc('0x31')](_0x36746e,'name');_0xae240b[_0x85cc('0x37')]=_[_0x85cc('0x38')](_0x2a6121[_0x85cc('0x37')]);_0xae240b[_0x85cc('0x39')]=_[_0x85cc('0x3a')](_0xae240b['model'],_0xae240b['query']);_0x14a922[_0x85cc('0x3b')]=_['intersection'](_0xae240b['model'],qs[_0x85cc('0x3c')](_0x2a6121['query'][_0x85cc('0x3c')]));_0x14a922[_0x85cc('0x3b')]=_0x14a922[_0x85cc('0x3b')][_0x85cc('0x3d')]?_0x14a922[_0x85cc('0x3b')]:_0xae240b['model'];if(!_0x2a6121['query'][_0x85cc('0x3e')](_0x85cc('0x3f'))){_0x14a922['limit']=qs['limit'](_0x2a6121[_0x85cc('0x37')][_0x85cc('0x23')]);_0x14a922['offset']=qs[_0x85cc('0x21')](_0x2a6121[_0x85cc('0x37')][_0x85cc('0x21')]);}_0x14a922[_0x85cc('0x40')]=qs[_0x85cc('0x41')](_0x2a6121[_0x85cc('0x37')][_0x85cc('0x41')]);_0x14a922[_0x85cc('0x42')]=qs[_0x85cc('0x39')](_[_0x85cc('0x43')](_0x2a6121[_0x85cc('0x37')],_0xae240b[_0x85cc('0x39')]),_0x36746e);if(_0x2a6121[_0x85cc('0x37')][_0x85cc('0x44')]){_0x14a922[_0x85cc('0x42')]=_[_0x85cc('0x45')](_0x14a922[_0x85cc('0x42')],{'$or':_[_0x85cc('0x31')](_0x36746e,function(_0xc56a2){if(_0xc56a2[_0x85cc('0x34')]!==_0x85cc('0x46')){var _0x41a0a1={};_0x41a0a1[_0xc56a2[_0x85cc('0x47')]]={'$like':'%'+_0x2a6121[_0x85cc('0x37')][_0x85cc('0x44')]+'%'};return _0x41a0a1;}})});}_0x14a922=_[_0x85cc('0x45')]({},_0x14a922,_0x2a6121[_0x85cc('0x48')]);var _0x4c916d={'where':_0x14a922['where']};return db[_0x85cc('0x49')][_0x85cc('0x24')](_0x4c916d)['then'](function(_0x18f14f){_0x4d39e5['count']=_0x18f14f;if(_0x2a6121[_0x85cc('0x37')][_0x85cc('0x4a')]){_0x14a922[_0x85cc('0x4b')]=[{'all':!![]}];}return db[_0x85cc('0x49')]['findAll'](_0x14a922);})[_0x85cc('0x2a')](function(_0x32e013){_0x4d39e5[_0x85cc('0x4c')]=_0x32e013;return _0x4d39e5;})[_0x85cc('0x2a')](respondWithFilteredResult(_0x32f551,_0x14a922))['catch'](handleError(_0x32f551,null));};exports[_0x85cc('0x4d')]=function(_0x917bb5,_0x2101df){var _0x4fc5e3={'raw':!![],'where':{'id':_0x917bb5['params']['id']}},_0x28d340={};_0x28d340[_0x85cc('0x36')]=_['keys'](db[_0x85cc('0x49')][_0x85cc('0x32')]);_0x28d340[_0x85cc('0x37')]=_[_0x85cc('0x38')](_0x917bb5['query']);_0x28d340['filters']=_['intersection'](_0x28d340[_0x85cc('0x36')],_0x28d340['query']);_0x4fc5e3[_0x85cc('0x3b')]=_[_0x85cc('0x3a')](_0x28d340[_0x85cc('0x36')],qs[_0x85cc('0x3c')](_0x917bb5[_0x85cc('0x37')][_0x85cc('0x3c')]));_0x4fc5e3[_0x85cc('0x3b')]=_0x4fc5e3['attributes'][_0x85cc('0x3d')]?_0x4fc5e3[_0x85cc('0x3b')]:_0x28d340[_0x85cc('0x36')];if(_0x917bb5['query'][_0x85cc('0x4a')]){_0x4fc5e3[_0x85cc('0x4b')]=[{'all':!![]}];}_0x4fc5e3=_[_0x85cc('0x45')]({},_0x4fc5e3,_0x917bb5[_0x85cc('0x48')]);return db[_0x85cc('0x49')][_0x85cc('0x4e')](_0x4fc5e3)['then'](handleEntityNotFound(_0x2101df,null))[_0x85cc('0x2a')](respondWithResult(_0x2101df,null))[_0x85cc('0x4f')](handleError(_0x2101df,null));};exports[_0x85cc('0x50')]=function(_0x3150ce,_0x49be81,_0x4621c2){return db[_0x85cc('0x49')][_0x85cc('0x4e')]({'where':{'id':_0x3150ce['params']['id']},'attributes':[_0x85cc('0x47'),_0x85cc('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x49be81,null))[_0x85cc('0x2a')](function(_0x597a5a){if(_0x597a5a){var _0x9d1835=path[_0x85cc('0x52')](config[_0x85cc('0x53')],_0x85cc('0x54'),util[_0x85cc('0x55')]('%s.zip',path['basename'](_0x597a5a[_0x85cc('0x51')])));var _0x4a0a26=fs['createWriteStream'](_0x9d1835);var _0xfe2dd0=archiver('zip',{'zlib':{'level':0x9}});_0xfe2dd0['on'](_0x85cc('0x56'),function(_0x307d02){if(_0x307d02[_0x85cc('0x57')]===_0x85cc('0x58')){logger[_0x85cc('0x2f')](_0x307d02);}else{throw new db['Sequelize'][(_0x85cc('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0xfe2dd0['on'](_0x85cc('0x2f'),function(_0x1eda2b){throw new db[(_0x85cc('0x5a'))][(_0x85cc('0x59'))](_0x85cc('0x5b'));});_0xfe2dd0['pipe'](_0x4a0a26);_0xfe2dd0[_0x85cc('0x5c')]('**/*',{'cwd':path['join'](config[_0x85cc('0x53')],_0x85cc('0x54'),path[_0x85cc('0x5d')](_0x597a5a['path'])),'ignore':[path[_0x85cc('0x52')](path['basename'](_0x597a5a[_0x85cc('0x51')]),_0x85cc('0x5e')),path[_0x85cc('0x52')](path[_0x85cc('0x5f')](_0x597a5a[_0x85cc('0x51')]),_0x85cc('0x60'))],'nodir':!![]})['finalize']();_0x4a0a26['on'](_0x85cc('0x61'),function(){if(!fs['existsSync'](_0x9d1835)){throw new db['Sequelize']['Error']('Plugin\x20not\x20found');}return _0x49be81['download'](_0x9d1835,util['format'](_0x85cc('0x62'),path[_0x85cc('0x5f')](_0x597a5a[_0x85cc('0x51')])),function(_0x2ac0b0){if(_0x2ac0b0){throw new db[(_0x85cc('0x5a'))][(_0x85cc('0x59'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x9d1835);logger[_0x85cc('0x63')](_0x85cc('0x64'));logger['info'](_0x85cc('0x65'));});});}return null;})['catch'](handleError(_0x49be81,null));};exports['upload']=function(_0x523cca,_0x4fd726,_0x4b34f3){var _0x5737f0=path[_0x85cc('0x5f')](_0x523cca[_0x85cc('0x66')][_0x85cc('0x67')],path[_0x85cc('0x68')](_0x523cca['file'][_0x85cc('0x67')]));var _0x55933a=path[_0x85cc('0x52')](config['root'],_0x85cc('0x54'),_0x523cca[_0x85cc('0x66')]['filename']);var _0x31d34b=path[_0x85cc('0x52')](config[_0x85cc('0x53')],_0x85cc('0x54'),_0x5737f0);logger[_0x85cc('0x63')]('Plugin\x20upload\x20filepath:\x20%s',_0x55933a);logger[_0x85cc('0x63')](_0x85cc('0x69'),_0x31d34b);try{fs[_0x85cc('0x6a')](_0x55933a,parseInt('0777',0x8));extract(_0x55933a,{'dir':_0x31d34b},function(_0x11c7ba){if(_0x11c7ba){logger[_0x85cc('0x2f')](_0x11c7ba);handleError(_0x11c7ba,!![]);};var _0x46a8d2=fs['readdirSync'](_0x31d34b);if(_0x46a8d2['length']>0x1){removeReferences(_0x55933a,_0x31d34b);logger[_0x85cc('0x2f')](_0x85cc('0x6b'));return _0x4b34f3(new Error(_0x85cc('0x6b')));}var _0xc50f98=fs[_0x85cc('0x6c')](path['join'](_0x31d34b,_0x46a8d2[0x0]));if(_0xc50f98[_0x85cc('0x6d')]()){removeReferences(_0x55933a,_0x31d34b);logger[_0x85cc('0x2f')](_0x85cc('0x6b'));return _0x4b34f3(new Error(_0x85cc('0x6b')));}if(_0xc50f98[_0x85cc('0x6e')]()){var _0x43e5fd=fs[_0x85cc('0x6f')](path[_0x85cc('0x52')](_0x31d34b,_0x46a8d2[0x0]));if(_0x43e5fd[_0x85cc('0x3d')]===0x0){removeReferences(_0x55933a,_0x31d34b);logger[_0x85cc('0x2f')](_0x85cc('0x6b'));return _0x4b34f3(new Error(_0x85cc('0x6b')));}var _0x2b9115=_0x43e5fd[_0x85cc('0x70')](function(_0x436f1e){return _0x436f1e==='manifest.json';});if(!_0x2b9115){return _0x4b34f3(new Error(_0x85cc('0x71')));}var _0xb69b44=fs[_0x85cc('0x72')](path[_0x85cc('0x52')](_0x31d34b,_0x46a8d2[0x0],_0x85cc('0x73')));var _0x8bc1c4=JSON['parse'](_0xb69b44);if(_0x85cc('0x22')==typeof _0x8bc1c4[_0x85cc('0x47')]){return _0x4b34f3(new Error(_0x85cc('0x74')));}if('undefined'==typeof _0x8bc1c4[_0x85cc('0x34')]){return _0x4b34f3(new Error(_0x85cc('0x75')));}if(_0x85cc('0x22')==typeof _0x8bc1c4[_0x85cc('0x76')]){return _0x4b34f3(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x85cc('0x22')==typeof _0x8bc1c4[_0x85cc('0x77')]){return _0x4b34f3(new Error(_0x85cc('0x78')));}if(_0x8bc1c4[_0x85cc('0x34')]===_0x85cc('0x79')){if(_0x85cc('0x22')==typeof _0x8bc1c4['parameters'][_0x85cc('0x7a')]){return _0x4b34f3(new Error(_0x85cc('0x7b')));}if('undefined'==typeof _0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7a')][_0x85cc('0x7c')]&&'undefined'==typeof _0x8bc1c4[_0x85cc('0x77')]['views']['agent']){return _0x4b34f3(new Error(_0x85cc('0x7d')));}}else if(_0x8bc1c4[_0x85cc('0x34')]===_0x85cc('0x7e')){if(_0x85cc('0x22')==typeof _0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7f')]){return _0x4b34f3(new Error(_0x85cc('0x80')));}if(_0x85cc('0x22')==typeof _0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x81')]){return _0x4b34f3(new Error(_0x85cc('0x82')));}}else{return _0x4b34f3(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2fd328=_0x8bc1c4[_0x85cc('0x47')];var _0x18ed7f=_0x8bc1c4[_0x85cc('0x83')];var _0x44501f=_0x8bc1c4[_0x85cc('0x34')];var _0x35e743=_0x8bc1c4[_0x85cc('0x84')]?_0x8bc1c4[_0x85cc('0x84')]:_0x85cc('0x85');var _0x4b166b=_0x8bc1c4['icon']?_0x8bc1c4[_0x85cc('0x86')]:'icon-apps';var _0x20e1e8='';var _0x2fd0e4='';var _0x505c1f='';var _0xb2f08b='';var _0x2e9abb=_0x8bc1c4[_0x85cc('0x76')];if(_0x44501f==='html'){if(_0x85cc('0x22')!=typeof _0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7a')][_0x85cc('0x7c')]){var _0x53fb05=_0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7a')][_0x85cc('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x53fb05)){_0x20e1e8=path[_0x85cc('0x52')](_0x85cc('0x87'),_0x5737f0,_0x46a8d2[0x0],_0x53fb05);}else{_0x20e1e8=_0x53fb05;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x85cc('0x22')!=typeof _0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7a')][_0x85cc('0x88')]){var _0x5aa0c1=_0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7a')][_0x85cc('0x88')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5aa0c1)){_0x2fd0e4=path['join'](_0x85cc('0x87'),_0x5737f0,_0x46a8d2[0x0],_0x5aa0c1);}else{_0x2fd0e4=_0x5aa0c1;}}else{logger['info'](_0x85cc('0x89'));}}else if(_0x44501f===_0x85cc('0x7e')){_0x505c1f=_0x8bc1c4[_0x85cc('0x77')]['scriptName'];_0xb2f08b=_0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x81')];if(_0x85cc('0x22')!=typeof _0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7a')]){if(_0x85cc('0x22')!=typeof _0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7a')][_0x85cc('0x7c')]){var _0x53fb05=_0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x53fb05)){_0x20e1e8=path[_0x85cc('0x52')](_0x85cc('0x87'),_0x5737f0,_0x46a8d2[0x0],_0x53fb05);}else{_0x20e1e8=_0x53fb05;}}if(_0x85cc('0x22')!=typeof _0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7a')][_0x85cc('0x88')]){var _0x5aa0c1=_0x8bc1c4[_0x85cc('0x77')][_0x85cc('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5aa0c1)){_0x2fd0e4=path[_0x85cc('0x52')](_0x85cc('0x87'),_0x5737f0,_0x46a8d2[0x0],_0x5aa0c1);}else{_0x2fd0e4=_0x5aa0c1;}}}}var _0x9c3063={'name':_0x2fd328,'description':_0x18ed7f,'path':path[_0x85cc('0x52')](_0x5737f0,_0x46a8d2[0x0]),'type':_0x44501f,'sidebar':_0x35e743,'icon':_0x4b166b,'adminUrl':_0x20e1e8,'agentUrl':_0x2fd0e4,'scriptName':_0x505c1f,'scriptPath':_0xb2f08b,'version':_0x2e9abb};removeReferences(_0x55933a,null);return db[_0x85cc('0x49')][_0x85cc('0x8a')](_0x9c3063)[_0x85cc('0x2a')](function(_0x18ff0d){var _0x5c5369={'role':_0x523cca[_0x85cc('0x8b')][_0x85cc('0x8c')],'userProfileId':_0x523cca[_0x85cc('0x8b')][_0x85cc('0x8d')]};if(!_0x5c5369)throw new Error(_0x85cc('0x8e'));if(_0x5c5369[_0x85cc('0x8c')]===_0x85cc('0x8f')){var _0x718305=_0x18ff0d['get']({'plain':!![]});return db['UserProfileSection'][_0x85cc('0x4e')]({'where':{'name':_0x85cc('0x2c'),'userProfileId':_0x5c5369['userProfileId']},'raw':!![]})[_0x85cc('0x2a')](function(_0x24beee){if(_0x24beee&&_0x24beee['autoAssociation']===0x0){return db[_0x85cc('0x2d')][_0x85cc('0x8a')]({'name':_0x718305[_0x85cc('0x47')],'resourceId':_0x718305['id'],'type':_0x24beee[_0x85cc('0x47')],'sectionId':_0x24beee['id']},{})[_0x85cc('0x2a')](function(){return _0x18ff0d;});}else{return _0x18ff0d;}})[_0x85cc('0x4f')](function(_0x25c660){logger[_0x85cc('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25c660);throw _0x25c660;});}return _0x18ff0d;})[_0x85cc('0x2a')](respondWithResult(_0x4fd726,null))[_0x85cc('0x4f')](handleError(_0x4fd726,null));}});}catch(_0x2adc0d){_0x4fd726['status'](0x1f4)[_0x85cc('0x90')](_0x2adc0d);}};function removeReferences(_0x3f7065,_0x5bfc64){try{if(_0x3f7065){fs[_0x85cc('0x91')](_0x3f7065);logger[_0x85cc('0x63')](_0x85cc('0x92'));}if(_0x5bfc64){rimraf(_0x5bfc64,function(){});logger[_0x85cc('0x63')](_0x85cc('0x93'));}}catch(_0x538569){logger[_0x85cc('0x2f')](_0x538569);}}exports[_0x85cc('0x94')]=function(_0x26819a,_0x484d40,_0x4b9d83){return db[_0x85cc('0x49')]['find']({'where':{'id':_0x26819a[_0x85cc('0x95')]['id']}})[_0x85cc('0x2a')](handleEntityNotFound(_0x484d40,null))[_0x85cc('0x2a')](saveUpdates(_0x26819a[_0x85cc('0x8b')],null))[_0x85cc('0x2a')](respondWithResult(_0x484d40,null))[_0x85cc('0x4f')](handleError(_0x484d40,null));};exports[_0x85cc('0x96')]=function(_0x2359db,_0x410987,_0x35c108){return db[_0x85cc('0x49')][_0x85cc('0x4e')]({'where':{'id':_0x2359db['params']['id']}})['then'](function(_0x1ecb2c){if(_0x1ecb2c){return _0x1ecb2c['destroy']();}})['then'](function(_0x4dd60d){rimraf(path[_0x85cc('0x52')](config[_0x85cc('0x53')],'server/files/plugins',path['dirname'](_0x4dd60d['path'])),function(){});return _0x4dd60d;})[_0x85cc('0x2a')](handleEntityNotFound(_0x410987,null))[_0x85cc('0x2a')](respondWithStatusCode(_0x410987,null))[_0x85cc('0x4f')](handleError(_0x410987,null));};exports[_0x85cc('0x97')]=function(_0x2ccfce,_0x403bc8,_0x53c03f){return BPromise[_0x85cc('0x98')]()[_0x85cc('0x2a')](function(){if(!_0x2ccfce[_0x85cc('0x37')][_0x85cc('0x51')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2ccfce[_0x85cc('0x37')]['port']){throw new Error(_0x85cc('0x99'));}var _0x1d56ab=_0x2ccfce[_0x85cc('0x37')][_0x85cc('0x9a')]?_0x2ccfce[_0x85cc('0x37')][_0x85cc('0x9a')]+':'+_0x2ccfce[_0x85cc('0x37')][_0x85cc('0x9b')]:_0x85cc('0x9c')+_0x2ccfce[_0x85cc('0x37')][_0x85cc('0x9b')];var _0x10bee7=_0x2ccfce[_0x85cc('0x37')][_0x85cc('0x26')]?_0x2ccfce[_0x85cc('0x37')][_0x85cc('0x26')]:!![];var _0x1c0860=_0x2ccfce[_0x85cc('0x37')][_0x85cc('0x9d')]?_0x2ccfce['query'][_0x85cc('0x9d')]:null;var _0x194fda={'method':_0x2ccfce[_0x85cc('0x9e')],'uri':util['format'](_0x85cc('0x9f'),_0x1d56ab,_0x2ccfce[_0x85cc('0x37')][_0x85cc('0x51')]),'json':_0x10bee7,'resolveWithFullResponse':!![],'encoding':_0x1c0860,'qs':_0x2ccfce[_0x85cc('0x37')]};if(_0x2ccfce['headers']){_0x194fda[_0x85cc('0xa0')]=_0x2ccfce[_0x85cc('0xa0')];if(_0x194fda['headers']['content-length']){delete _0x194fda[_0x85cc('0xa0')][_0x85cc('0xa1')];}}if(_0x194fda[_0x85cc('0xa0')][_0x85cc('0xa2')]){delete _0x194fda[_0x85cc('0xa0')]['content-type'];}return rp(_0x194fda);})[_0x85cc('0x2a')](function(_0x4b460f){if(_0x4b460f){_0x403bc8[_0x85cc('0xa3')](_0x4b460f[_0x85cc('0xa0')]);logger[_0x85cc('0x63')](_0x4b460f['body']);if(_['endsWith'](_0x2ccfce[_0x85cc('0x37')][_0x85cc('0x51')],_0x85cc('0x50'))&&_0x4b460f[_0x85cc('0xa4')]==0x1f4){return _0x403bc8['sendStatus'](_0x4b460f['statusCode']);}else{return _0x403bc8[_0x85cc('0x20')](_0x4b460f[_0x85cc('0xa4')])['send'](_0x4b460f[_0x85cc('0x8b')]);}}else{return _0x403bc8[_0x85cc('0x1f')](0xc8);}})[_0x85cc('0x4f')](handleError(_0x403bc8,null));};exports[_0x85cc('0xa5')]=function(_0x27890b,_0x354baf,_0x1bc8f4){return BPromise['resolve']()[_0x85cc('0x2a')](function(){if(!_0x27890b[_0x85cc('0x37')][_0x85cc('0x51')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x27890b[_0x85cc('0x37')][_0x85cc('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x23449d=_0x27890b['query'][_0x85cc('0x9a')]?_0x27890b['query']['hostname']+':'+_0x27890b['query']['port']:_0x85cc('0x9c')+_0x27890b['query'][_0x85cc('0x9b')];var _0x487829=_0x27890b[_0x85cc('0x37')][_0x85cc('0x26')]?_0x27890b[_0x85cc('0x37')][_0x85cc('0x26')]:!![];var _0x22fdb5=_0x27890b[_0x85cc('0x37')][_0x85cc('0x9d')]?_0x27890b[_0x85cc('0x37')]['encoding']:null;var _0x5efc3c={'method':_0x27890b[_0x85cc('0x9e')],'uri':util['format'](_0x85cc('0x9f'),_0x23449d,_0x27890b[_0x85cc('0x37')]['path']),'json':_0x487829,'resolveWithFullResponse':!![],'encoding':_0x22fdb5,'body':_0x27890b[_0x85cc('0x8b')]};if(_0x27890b['headers']){_0x5efc3c['headers']=_0x27890b[_0x85cc('0xa0')];if(_0x5efc3c[_0x85cc('0xa0')][_0x85cc('0xa1')]){delete _0x5efc3c[_0x85cc('0xa0')][_0x85cc('0xa1')];}}if(_0x5efc3c['headers']['content-type']){delete _0x5efc3c[_0x85cc('0xa0')]['content-type'];}return rp(_0x5efc3c);})[_0x85cc('0x2a')](function(_0x4cf216){if(_0x4cf216){_0x354baf[_0x85cc('0xa3')](_0x4cf216[_0x85cc('0xa0')]);logger[_0x85cc('0x63')](_0x4cf216[_0x85cc('0x8b')]);return _0x354baf[_0x85cc('0x20')](_0x4cf216[_0x85cc('0xa4')])['send'](_0x4cf216[_0x85cc('0x8b')]);}else{return _0x354baf[_0x85cc('0x1f')](0xc8);}})['catch'](handleError(_0x354baf,null));};
\ No newline at end of file
index cff0e27..c264af7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a63=['../../mysqldb','save','emit','hasOwnProperty','exports','events'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x5a63,0xe3));var _0x35a6=function(_0x15b368,_0x34186d){_0x15b368=_0x15b368-0x0;var _0x4bc716=_0x5a63[_0x15b368];return _0x4bc716;};'use strict';var EventEmitter=require(_0x35a6('0x0'));var Plugin=require(_0x35a6('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x35a6('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x308a05){return function(_0x3462ed,_0x7a89ee,_0x4c032d){PluginEvents[_0x35a6('0x3')](_0x308a05+':'+_0x3462ed['id'],_0x3462ed);PluginEvents['emit'](_0x308a05,_0x3462ed);_0x4c032d(null);};}for(var e in events){if(events[_0x35a6('0x4')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x35a6('0x5')]=PluginEvents;
\ No newline at end of file
+var _0xf78f=['save','update','remove','emit','hook','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0x5b134d,_0x532c17){var _0x1b205c=function(_0x537847){while(--_0x537847){_0x5b134d['push'](_0x5b134d['shift']());}};_0x1b205c(++_0x532c17);}(_0xf78f,0x72));var _0xff78=function(_0x1dcab2,_0x3d57d1){_0x1dcab2=_0x1dcab2-0x0;var _0x1af906=_0xf78f[_0x1dcab2];return _0x1af906;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xff78('0x0'))['db'][_0xff78('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xff78('0x2')](0x0);var events={'afterCreate':_0xff78('0x3'),'afterUpdate':_0xff78('0x4'),'afterDestroy':_0xff78('0x5')};function emitEvent(_0x48df16){return function(_0x48fe97,_0x5b8499,_0x5b875e){PluginEvents['emit'](_0x48df16+':'+_0x48fe97['id'],_0x48fe97);PluginEvents[_0xff78('0x6')](_0x48df16,_0x48fe97);_0x5b875e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xff78('0x7')](e,emitEvent(event));}}module[_0xff78('0x8')]=PluginEvents;
\ No newline at end of file
index 5eea0b5..2a90513 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84d4=['plugins','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin'];(function(_0x1554e6,_0x28607d){var _0x4cafbf=function(_0x478aaf){while(--_0x478aaf){_0x1554e6['push'](_0x1554e6['shift']());}};_0x4cafbf(++_0x28607d);}(_0x84d4,0x197));var _0x484d=function(_0x2502dc,_0x21dbe2){_0x2502dc=_0x2502dc-0x0;var _0x1793c3=_0x84d4[_0x2502dc];return _0x1793c3;};'use strict';var _=require(_0x484d('0x0'));var util=require('util');var logger=require(_0x484d('0x1'))(_0x484d('0x2'));var moment=require(_0x484d('0x3'));var BPromise=require(_0x484d('0x4'));var rp=require(_0x484d('0x5'));var fs=require('fs');var path=require(_0x484d('0x6'));var rimraf=require(_0x484d('0x7'));var config=require(_0x484d('0x8'));var attributes=require(_0x484d('0x9'));module[_0x484d('0xa')]=function(_0x11fd16,_0x2be968){return _0x11fd16[_0x484d('0xb')](_0x484d('0xc'),attributes,{'tableName':_0x484d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc269=['util','../../config/logger','moment','request-promise','path','../../config/environment','./plugin.attributes','define','lodash'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0xc269,0x194));var _0x9c26=function(_0x532b7e,_0x4205fa){_0x532b7e=_0x532b7e-0x0;var _0x17f4ea=_0xc269[_0x532b7e];return _0x17f4ea;};'use strict';var _=require(_0x9c26('0x0'));var util=require(_0x9c26('0x1'));var logger=require(_0x9c26('0x2'))('api');var moment=require(_0x9c26('0x3'));var BPromise=require('bluebird');var rp=require(_0x9c26('0x4'));var fs=require('fs');var path=require(_0x9c26('0x5'));var rimraf=require('rimraf');var config=require(_0x9c26('0x6'));var attributes=require(_0x9c26('0x7'));module['exports']=function(_0x32b398,_0x727102){return _0x32b398[_0x9c26('0x8')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aac6fba..693d3a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9091=['register','request','then','info','request\x20sent','debug','stringify','error','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x2cfcff,_0x2aa148){var _0x5a0a05=function(_0x39cb66){while(--_0x39cb66){_0x2cfcff['push'](_0x2cfcff['shift']());}};_0x5a0a05(++_0x2aa148);}(_0x9091,0x1ed));var _0x1909=function(_0x4a561c,_0x5c1db0){_0x4a561c=_0x4a561c-0x0;var _0x188915=_0x9091[_0x4a561c];return _0x188915;};'use strict';var _=require(_0x1909('0x0'));var util=require('util');var moment=require(_0x1909('0x1'));var BPromise=require('bluebird');var rs=require(_0x1909('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1909('0x3'))['db'];var utils=require(_0x1909('0x4'));var logger=require(_0x1909('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1909('0x6')]['http']({'port':0x232a});config[_0x1909('0x7')]=_[_0x1909('0x8')](config[_0x1909('0x7')],{'host':_0x1909('0x9'),'port':0x18eb});var socket=require(_0x1909('0xa'))(new Redis(config[_0x1909('0x7')]));require('./plugin.socket')[_0x1909('0xb')](socket);function respondWithRpcPromise(_0x4d6831,_0x49a143,_0x1a51bd){return new BPromise(function(_0x3129fb,_0x5cfc66){return client[_0x1909('0xc')](_0x4d6831,_0x1a51bd)[_0x1909('0xd')](function(_0x58708a){logger[_0x1909('0xe')]('Plugin,\x20%s,\x20%s',_0x49a143,_0x1909('0xf'));logger[_0x1909('0x10')]('Plugin,\x20%s,\x20%s,\x20%s',_0x49a143,'request\x20sent',JSON[_0x1909('0x11')](_0x58708a));if(_0x58708a[_0x1909('0x12')]){if(_0x58708a[_0x1909('0x12')]['code']===0x1f4){logger[_0x1909('0x12')](_0x1909('0x13'),_0x49a143,_0x58708a[_0x1909('0x12')][_0x1909('0x14')]);return _0x5cfc66(_0x58708a[_0x1909('0x12')]['message']);}logger[_0x1909('0x12')](_0x1909('0x13'),_0x49a143,_0x58708a[_0x1909('0x12')][_0x1909('0x14')]);return _0x3129fb(_0x58708a[_0x1909('0x12')]['message']);}else{logger[_0x1909('0xe')](_0x1909('0x13'),_0x49a143,'request\x20sent');_0x3129fb(_0x58708a[_0x1909('0x15')]['message']);}})[_0x1909('0x16')](function(_0x3c4304){logger[_0x1909('0x12')](_0x1909('0x13'),_0x49a143,_0x3c4304);_0x5cfc66(_0x3c4304);});});}exports[_0x1909('0x17')]=function(_0x36f3de){var _0x2f172f=this;return new Promise(function(_0x2545ef,_0x3ec176){return db[_0x1909('0x18')][_0x1909('0x19')](_0x36f3de[_0x1909('0x1a')],{'raw':_0x36f3de[_0x1909('0x1b')]?_0x36f3de[_0x1909('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x1909('0xd')](function(_0x3697a7){logger[_0x1909('0xe')](_0x1909('0x17'),_0x36f3de);logger[_0x1909('0x10')](_0x1909('0x17'),_0x36f3de,JSON[_0x1909('0x11')](_0x3697a7));_0x2545ef(_0x3697a7);})['catch'](function(_0x117f7b){logger[_0x1909('0x12')](_0x1909('0x17'),_0x117f7b['message'],_0x36f3de);_0x3ec176(_0x2f172f['error'](0x1f4,_0x117f7b[_0x1909('0x14')]));});});};
\ No newline at end of file
+var _0x3fdc=['localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','options','raw','CreatePlugin','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','redis','defaults'];(function(_0x1ceb7b,_0x894d3d){var _0x57c016=function(_0x282306){while(--_0x282306){_0x1ceb7b['push'](_0x1ceb7b['shift']());}};_0x57c016(++_0x894d3d);}(_0x3fdc,0xb5));var _0xc3fd=function(_0x5f18a0,_0x4d9048){_0x5f18a0=_0x5f18a0-0x0;var _0x5520f0=_0x3fdc[_0x5f18a0];return _0x5520f0;};'use strict';var _=require('lodash');var util=require(_0xc3fd('0x0'));var moment=require(_0xc3fd('0x1'));var BPromise=require(_0xc3fd('0x2'));var rs=require(_0xc3fd('0x3'));var fs=require('fs');var Redis=require(_0xc3fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc3fd('0x5'));var logger=require('../../config/logger')(_0xc3fd('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc3fd('0x7')][_0xc3fd('0x8')]({'port':0x232a});config[_0xc3fd('0x9')]=_[_0xc3fd('0xa')](config[_0xc3fd('0x9')],{'host':_0xc3fd('0xb'),'port':0x18eb});var socket=require(_0xc3fd('0xc'))(new Redis(config[_0xc3fd('0x9')]));require(_0xc3fd('0xd'))[_0xc3fd('0xe')](socket);function respondWithRpcPromise(_0x2bf8ea,_0x1b9a74,_0x2d2754){return new BPromise(function(_0x4f2c51,_0x32927b){return client[_0xc3fd('0xf')](_0x2bf8ea,_0x2d2754)[_0xc3fd('0x10')](function(_0x2da62d){logger[_0xc3fd('0x11')](_0xc3fd('0x12'),_0x1b9a74,_0xc3fd('0x13'));logger[_0xc3fd('0x14')](_0xc3fd('0x15'),_0x1b9a74,'request\x20sent',JSON[_0xc3fd('0x16')](_0x2da62d));if(_0x2da62d[_0xc3fd('0x17')]){if(_0x2da62d[_0xc3fd('0x17')][_0xc3fd('0x18')]===0x1f4){logger[_0xc3fd('0x17')]('Plugin,\x20%s,\x20%s',_0x1b9a74,_0x2da62d[_0xc3fd('0x17')][_0xc3fd('0x19')]);return _0x32927b(_0x2da62d[_0xc3fd('0x17')][_0xc3fd('0x19')]);}logger[_0xc3fd('0x17')](_0xc3fd('0x12'),_0x1b9a74,_0x2da62d[_0xc3fd('0x17')][_0xc3fd('0x19')]);return _0x4f2c51(_0x2da62d[_0xc3fd('0x17')][_0xc3fd('0x19')]);}else{logger[_0xc3fd('0x11')](_0xc3fd('0x12'),_0x1b9a74,_0xc3fd('0x13'));_0x4f2c51(_0x2da62d[_0xc3fd('0x1a')][_0xc3fd('0x19')]);}})[_0xc3fd('0x1b')](function(_0x31590c){logger[_0xc3fd('0x17')](_0xc3fd('0x12'),_0x1b9a74,_0x31590c);_0x32927b(_0x31590c);});});}exports['CreatePlugin']=function(_0x192798){var _0x1889b0=this;return new Promise(function(_0x925ed4,_0x2cff60){return db['Plugin'][_0xc3fd('0x1c')](_0x192798['body'],{'raw':_0x192798[_0xc3fd('0x1d')]?_0x192798[_0xc3fd('0x1d')][_0xc3fd('0x1e')]===undefined?!![]:![]:!![]})[_0xc3fd('0x10')](function(_0x2893c1){logger[_0xc3fd('0x11')](_0xc3fd('0x1f'),_0x192798);logger[_0xc3fd('0x14')](_0xc3fd('0x1f'),_0x192798,JSON[_0xc3fd('0x16')](_0x2893c1));_0x925ed4(_0x2893c1);})[_0xc3fd('0x1b')](function(_0x28c055){logger[_0xc3fd('0x17')]('CreatePlugin',_0x28c055[_0xc3fd('0x19')],_0x192798);_0x2cff60(_0x1889b0['error'](0x1f4,_0x28c055['message']));});});};
\ No newline at end of file
index d3f87f8..2299aca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x364a=['emit','removeListener','register','length','plugin:','./plugin.events','save','remove'];(function(_0x532d78,_0x25b6a8){var _0x5990c4=function(_0x3f23fe){while(--_0x3f23fe){_0x532d78['push'](_0x532d78['shift']());}};_0x5990c4(++_0x25b6a8);}(_0x364a,0x1cd));var _0xa364=function(_0x27d193,_0x2262b2){_0x27d193=_0x27d193-0x0;var _0x41f185=_0x364a[_0x27d193];return _0x41f185;};'use strict';var PluginEvents=require(_0xa364('0x0'));var events=[_0xa364('0x1'),_0xa364('0x2'),'update'];function createListener(_0x5ea297,_0x543d59){return function(_0x5dde4f){_0x543d59[_0xa364('0x3')](_0x5ea297,_0x5dde4f);};}function removeListener(_0x36e3d2,_0xfc1ddc){return function(){PluginEvents[_0xa364('0x4')](_0x36e3d2,_0xfc1ddc);};}exports[_0xa364('0x5')]=function(_0x597f8d){for(var _0x37b6e9=0x0,_0xdb4b74=events[_0xa364('0x6')];_0x37b6e9<_0xdb4b74;_0x37b6e9++){var _0x1d9c92=events[_0x37b6e9];var _0x2d645a=createListener(_0xa364('0x7')+_0x1d9c92,_0x597f8d);PluginEvents['on'](_0x1d9c92,_0x2d645a);}};
\ No newline at end of file
+var _0x0786=['save','update','removeListener','./plugin.events'];(function(_0x3a2a5c,_0x12aab5){var _0xfed923=function(_0x2dc3ca){while(--_0x2dc3ca){_0x3a2a5c['push'](_0x3a2a5c['shift']());}};_0xfed923(++_0x12aab5);}(_0x0786,0x9f));var _0x6078=function(_0x23cc7d,_0x553e85){_0x23cc7d=_0x23cc7d-0x0;var _0x41abb3=_0x0786[_0x23cc7d];return _0x41abb3;};'use strict';var PluginEvents=require(_0x6078('0x0'));var events=[_0x6078('0x1'),'remove',_0x6078('0x2')];function createListener(_0x5a078d,_0x5177e5){return function(_0x3816d0){_0x5177e5['emit'](_0x5a078d,_0x3816d0);};}function removeListener(_0x5db5b6,_0x775548){return function(){PluginEvents[_0x6078('0x3')](_0x5db5b6,_0x775548);};}exports['register']=function(_0x108a2e){for(var _0x41068a=0x0,_0x4354b3=events['length'];_0x41068a<_0x4354b3;_0x41068a++){var _0x1f1a19=events[_0x41068a];var _0x515437=createListener('plugin:'+_0x1f1a19,_0x108a2e);PluginEvents['on'](_0x1f1a19,_0x515437);}};
\ No newline at end of file
index ceafaf6..f39a8e4 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(_0x5102a6,_0x2dbb88){var _0x3612b1=function(_0x4d3797){while(--_0x4d3797){_0x5102a6['push'](_0x5102a6['shift']());}};_0x3612b1(++_0x2dbb88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x4b4408,_0x2354fc){var _0x5db300=function(_0x37e12f){while(--_0x37e12f){_0x4b4408['push'](_0x4b4408['shift']());}};_0x5db300(++_0x2354fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 e221c6c..18b0b8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x878f=['dirname','start','dump','restart','stop','hasOwnProperty','params','send','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','name','info','index','then','express','motion2','length','catch','show','describe','create','body','script','../../files/plugins','cwd','chdir'];(function(_0x61087b,_0x3d7cbb){var _0x5c82b8=function(_0x519d96){while(--_0x519d96){_0x61087b['push'](_0x61087b['shift']());}};_0x5c82b8(++_0x3d7cbb);}(_0x878f,0x173));var _0xf878=function(_0x5e7bd3,_0x3e911c){_0x5e7bd3=_0x5e7bd3-0x0;var _0x3a9cf5=_0x878f[_0x5e7bd3];return _0x3a9cf5;};'use strict';var _=require('lodash');var pm2=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var path=require(_0xf878('0x3'));var exec=require(_0xf878('0x4'))[_0xf878('0x5')];var BPromise=require(_0xf878('0x6'));function handleEntityNotFound(_0x45a37b,_0x240b48){return function(_0xcf1927){if(!_0xcf1927){_0x45a37b[_0xf878('0x7')](0x194);;}return _0xcf1927;};}function respondWithResult(_0x4bc9aa,_0x4ac8d8){_0x4ac8d8=_0x4ac8d8||0xc8;return function(_0x3c5f5c){if(_0x3c5f5c){return _0x4bc9aa[_0xf878('0x8')](_0x4ac8d8)['json'](_0x3c5f5c);}return null;};}function handleError(_0x52851e,_0x530767){_0x530767=_0x530767||0x1f4;return function(_0x3329df){logger['error'](_0x3329df['stack']);if(_0x3329df[_0xf878('0x9')]){delete _0x3329df[_0xf878('0x9')];}_0x52851e[_0xf878('0x8')](_0x530767)['send'](_0x3329df);};}function execChildProcess(){return new BPromise(function(_0xb2863e,_0x1399a3){exec('npm\x20install',function(_0xdf76,_0x4f7e7f,_0x31d3d2){logger[_0xf878('0xa')](_0x4f7e7f);logger[_0xf878('0xa')](_0x31d3d2);if(_0xdf76){logger['error'](_0xdf76);return _0x1399a3(_0xdf76);}return _0xb2863e(_0x4f7e7f);});});}exports[_0xf878('0xb')]=function(_0x38eddf,_0x39b1bb){return pm2['list']()[_0xf878('0xc')](function(_0x3902f7){if(_0x3902f7){var _0x119e9e=_['reject'](_0x3902f7,function(_0x568a3a){return _0x568a3a[_0xf878('0x9')]===_0xf878('0xd')||_0x568a3a[_0xf878('0x9')]===_0xf878('0xe');});return{'rows':_0x119e9e,'count':_0x119e9e[_0xf878('0xf')]};}return null;})[_0xf878('0xc')](respondWithResult(_0x39b1bb,null))[_0xf878('0x10')](handleError(_0x39b1bb,null));};exports[_0xf878('0x11')]=function(_0x3c5dee,_0x3a55f3){return pm2[_0xf878('0x12')](_0x3c5dee['params']['id'])[_0xf878('0xc')](respondWithResult(_0x3a55f3,null))[_0xf878('0xc')](handleEntityNotFound(_0x3a55f3,null))[_0xf878('0x10')](handleError(_0x3a55f3,null));};exports[_0xf878('0x13')]=function(_0x3714f6,_0x237d15){if(_0x3714f6[_0xf878('0x14')]['name']&&_0x3714f6[_0xf878('0x14')][_0xf878('0x15')]){var _0x250f85=path['join'](__dirname,_0xf878('0x16'),_0x3714f6[_0xf878('0x14')][_0xf878('0x15')]);var _0x392822=process[_0xf878('0x17')]();process[_0xf878('0x18')](path[_0xf878('0x19')](_0x250f85));return execChildProcess()[_0xf878('0xc')](function(_0x212436){process[_0xf878('0x18')](_0x392822);return pm2[_0xf878('0x1a')]({'name':_0x3714f6['body'][_0xf878('0x9')],'script':_0x250f85});})['then'](function(_0xa3d3d3){pm2[_0xf878('0x1b')]();return _0xa3d3d3[0x0];})[_0xf878('0xc')](respondWithResult(_0x237d15,0xc9))[_0xf878('0x10')](handleError(_0x237d15,null));}else{return _0x237d15[_0xf878('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x242926,_0x3baba4){if(_0x242926[_0xf878('0x14')]['id']){delete _0x242926['body']['id'];}var _0xfa3e11={'online':_0xf878('0x1c'),'stopped':_0xf878('0x1d')};if(_0xfa3e11[_0xf878('0x1e')](_0x242926[_0xf878('0x14')]['status'])){return pm2[_0xfa3e11[_0x242926['body'][_0xf878('0x8')]]](_0x242926[_0xf878('0x1f')]['id'])['then'](respondWithResult(_0x3baba4,0xc8))[_0xf878('0x10')](handleError(_0x3baba4,null));}else{return _0x3baba4['status'](0x1f4)[_0xf878('0x20')]({'message':'Unknown\x20status'});}};exports[_0xf878('0x21')]=function(_0x49e66a,_0x2630fb){if(_0x49e66a['body']['id']){delete _0x49e66a[_0xf878('0x14')]['id'];}if(_0x49e66a[_0xf878('0x1f')]['id']){return pm2[_0xf878('0x22')](_0x49e66a[_0xf878('0x1f')]['id'])[_0xf878('0xc')](function(_0x716782){pm2['dump']();return _0x716782[0x0];})[_0xf878('0xc')](respondWithResult(_0x2630fb,null))[_0xf878('0x10')](handleError(_0x2630fb,null));}else{return _0x2630fb[_0xf878('0x8')](0x1f4)[_0xf878('0x20')]({'message':_0xf878('0x23')});}};
\ No newline at end of file
+var _0xbfcc=['exec','sendStatus','json','stack','name','status','send','npm\x20install','info','error','index','list','then','reject','express','motion2','catch','show','params','create','body','script','../../files/plugins','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','api','path','child_process'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xbfcc[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xcbfc('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xcbfc('0x1'));var path=require(_0xcbfc('0x2'));var exec=require(_0xcbfc('0x3'))[_0xcbfc('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x59b1de,_0x54f81b){return function(_0x4b8361){if(!_0x4b8361){_0x59b1de[_0xcbfc('0x5')](0x194);;}return _0x4b8361;};}function respondWithResult(_0x2dbb05,_0x537813){_0x537813=_0x537813||0xc8;return function(_0x1b3917){if(_0x1b3917){return _0x2dbb05['status'](_0x537813)[_0xcbfc('0x6')](_0x1b3917);}return null;};}function handleError(_0x1f8b71,_0x1b1377){_0x1b1377=_0x1b1377||0x1f4;return function(_0xa1c83b){logger['error'](_0xa1c83b[_0xcbfc('0x7')]);if(_0xa1c83b[_0xcbfc('0x8')]){delete _0xa1c83b[_0xcbfc('0x8')];}_0x1f8b71[_0xcbfc('0x9')](_0x1b1377)[_0xcbfc('0xa')](_0xa1c83b);};}function execChildProcess(){return new BPromise(function(_0x3498c7,_0x4b34aa){exec(_0xcbfc('0xb'),function(_0x376a4c,_0x1e0d79,_0xbbb176){logger[_0xcbfc('0xc')](_0x1e0d79);logger['info'](_0xbbb176);if(_0x376a4c){logger[_0xcbfc('0xd')](_0x376a4c);return _0x4b34aa(_0x376a4c);}return _0x3498c7(_0x1e0d79);});});}exports[_0xcbfc('0xe')]=function(_0x80d08d,_0x5ba249){return pm2[_0xcbfc('0xf')]()[_0xcbfc('0x10')](function(_0x2f2bdd){if(_0x2f2bdd){var _0x45a5cc=_[_0xcbfc('0x11')](_0x2f2bdd,function(_0x53a7ea){return _0x53a7ea[_0xcbfc('0x8')]===_0xcbfc('0x12')||_0x53a7ea[_0xcbfc('0x8')]===_0xcbfc('0x13');});return{'rows':_0x45a5cc,'count':_0x45a5cc['length']};}return null;})['then'](respondWithResult(_0x5ba249,null))[_0xcbfc('0x14')](handleError(_0x5ba249,null));};exports[_0xcbfc('0x15')]=function(_0xa65368,_0x4d6946){return pm2['describe'](_0xa65368[_0xcbfc('0x16')]['id'])[_0xcbfc('0x10')](respondWithResult(_0x4d6946,null))[_0xcbfc('0x10')](handleEntityNotFound(_0x4d6946,null))['catch'](handleError(_0x4d6946,null));};exports[_0xcbfc('0x17')]=function(_0x552777,_0x28f7fb){if(_0x552777[_0xcbfc('0x18')][_0xcbfc('0x8')]&&_0x552777[_0xcbfc('0x18')][_0xcbfc('0x19')]){var _0x2653b1=path['join'](__dirname,_0xcbfc('0x1a'),_0x552777[_0xcbfc('0x18')]['script']);var _0x1da958=process['cwd']();process['chdir'](path['dirname'](_0x2653b1));return execChildProcess()[_0xcbfc('0x10')](function(_0x4a0fcb){process['chdir'](_0x1da958);return pm2[_0xcbfc('0x1b')]({'name':_0x552777[_0xcbfc('0x18')][_0xcbfc('0x8')],'script':_0x2653b1});})[_0xcbfc('0x10')](function(_0x49f5bf){pm2[_0xcbfc('0x1c')]();return _0x49f5bf[0x0];})['then'](respondWithResult(_0x28f7fb,0xc9))[_0xcbfc('0x14')](handleError(_0x28f7fb,null));}else{return _0x28f7fb[_0xcbfc('0x9')](0x1f4)['send']({'message':_0xcbfc('0x1d')});}};exports[_0xcbfc('0x1e')]=function(_0x4ab48e,_0x1b2c01){if(_0x4ab48e[_0xcbfc('0x18')]['id']){delete _0x4ab48e[_0xcbfc('0x18')]['id'];}var _0x41f3b8={'online':'restart','stopped':_0xcbfc('0x1f')};if(_0x41f3b8[_0xcbfc('0x20')](_0x4ab48e['body'][_0xcbfc('0x9')])){return pm2[_0x41f3b8[_0x4ab48e[_0xcbfc('0x18')][_0xcbfc('0x9')]]](_0x4ab48e[_0xcbfc('0x16')]['id'])[_0xcbfc('0x10')](respondWithResult(_0x1b2c01,0xc8))[_0xcbfc('0x14')](handleError(_0x1b2c01,null));}else{return _0x1b2c01[_0xcbfc('0x9')](0x1f4)['send']({'message':_0xcbfc('0x21')});}};exports[_0xcbfc('0x22')]=function(_0x3f9d20,_0x20a378){if(_0x3f9d20['body']['id']){delete _0x3f9d20[_0xcbfc('0x18')]['id'];}if(_0x3f9d20[_0xcbfc('0x16')]['id']){return pm2[_0xcbfc('0x23')](_0x3f9d20[_0xcbfc('0x16')]['id'])[_0xcbfc('0x10')](function(_0x34baa6){pm2[_0xcbfc('0x1c')]();return _0x34baa6[0x0];})['then'](respondWithResult(_0x20a378,null))[_0xcbfc('0x14')](handleError(_0x20a378,null));}else{return _0x20a378[_0xcbfc('0x9')](0x1f4)['send']({'message':_0xcbfc('0x24')});}};
\ No newline at end of file
index 2326b48..917b5a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfed0=['isAuthenticated','getAgents','/queues','exports','Router','./realtime.controller','get'];(function(_0x939192,_0x202d3f){var _0x1338a2=function(_0x650479){while(--_0x650479){_0x939192['push'](_0x939192['shift']());}};_0x1338a2(++_0x202d3f);}(_0xfed0,0x19a));var _0x0fed=function(_0xa1c6e1,_0x38d42d){_0xa1c6e1=_0xa1c6e1-0x0;var _0x2401e4=_0xfed0[_0xa1c6e1];return _0x2401e4;};'use strict';var express=require('express');var router=express[_0x0fed('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x0fed('0x1'));router[_0x0fed('0x2')]('/agents',auth[_0x0fed('0x3')](),controller[_0x0fed('0x4')]);router[_0x0fed('0x2')](_0x0fed('0x5'),auth[_0x0fed('0x3')](),controller['getQueues']);module[_0x0fed('0x6')]=router;
\ No newline at end of file
+var _0x7273=['/agents','isAuthenticated','getAgents','/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7273,0xf8));var _0x3727=function(_0x31a21c,_0xa767ac){_0x31a21c=_0x31a21c-0x0;var _0x206f8d=_0x7273[_0x31a21c];return _0x206f8d;};'use strict';var express=require(_0x3727('0x0'));var router=express[_0x3727('0x1')]();var auth=require(_0x3727('0x2'));var controller=require(_0x3727('0x3'));router[_0x3727('0x4')](_0x3727('0x5'),auth[_0x3727('0x6')](),controller[_0x3727('0x7')]);router[_0x3727('0x4')](_0x3727('0x8'),auth[_0x3727('0x6')](),controller[_0x3727('0x9')]);module[_0x3727('0xa')]=router;
\ No newline at end of file
index f03f7b7..cf28ae9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['offset','undefined','count','set','json','error','stack','name','status','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','paused','pTalking','originated','message','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','find','filter','queue','length','some','internal','toString','getMembers','UserId','online','voiceStatus','push','User','Queue','Pause','findAll','QueueId','unknown','unavailable','ringing','chatPause','mailPause','smsPause','voicePause','whatsappPause','every','idle','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','address','faxPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableAutomaticScreenRecording','openchannelPause','resolve','rawAttributes','fieldName','type','query','role','getOptions','raw','user','userProfileId','agent','nolimit','sort','findAndCountAll','rows','pick','omit','globalStatusFilter','globalStatus','pauseTypeFilter','mail','sms','openchannel','whatsapp','includes','Invalid\x20channel','channel','toLowerCase','outbound','QueueCampaigns','UserProfile','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var util=require(_0xac4a('0x0'));var _=require(_0xac4a('0x1'));var jayson=require(_0xac4a('0x2'));var qs=require(_0xac4a('0x3'));var logger=require(_0xac4a('0x4'))(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0xac4a('0x6')][_0xac4a('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x730a38,_0x215f39){return function(_0x96be2b){if(_0x96be2b){var _0x15cd34=typeof _0x215f39[_0xac4a('0x8')]===_0xac4a('0x9')&&typeof _0x215f39['limit']==='undefined';var _0x1aba6d=_0x96be2b[_0xac4a('0xa')];var _0x26ec84=_0x15cd34?0x0:_0x215f39['offset'];var _0x1d182e=_0x15cd34?_0x96be2b[_0xac4a('0xa')]:_0x215f39[_0xac4a('0x8')]+_0x215f39['limit'];var _0x30135d;if(_0x1d182e>=_0x1aba6d){_0x1d182e=_0x1aba6d;_0x30135d=0xc8;}else{_0x30135d=0xce;}_0x730a38['status'](_0x30135d);return _0x730a38[_0xac4a('0xb')]('Content-Range',_0x26ec84+'-'+_0x1d182e+'/'+_0x1aba6d)[_0xac4a('0xc')](_0x96be2b);}return null;};}function handleError(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0x1f4;return function(_0x5e16aa){logger[_0xac4a('0xd')](_0x5e16aa[_0xac4a('0xe')]);if(_0x5e16aa[_0xac4a('0xf')]){delete _0x5e16aa[_0xac4a('0xf')];}_0x2a0776[_0xac4a('0x10')](_0x24291d)[_0xac4a('0x11')](_0x5e16aa);};}function getRealtimeAgents(){return new Promise(function(_0x34bc01,_0x33c287){return amiClient[_0xac4a('0x12')](_0xac4a('0x13'),{})[_0xac4a('0x14')](function(_0x26dbb8){if(_0x26dbb8['error'])throw new Error(_0xac4a('0x15'));var _0x34d797=_0x26dbb8[_0xac4a('0x16')];return routingClient[_0xac4a('0x12')](_0xac4a('0x13'),{})[_0xac4a('0x14')](function(_0x28e304){if(_0x28e304[_0xac4a('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x5ac21e=_0x28e304[_0xac4a('0x16')];return _0x34bc01(_[_0xac4a('0x17')]({},_0x34d797,_0x5ac21e));});})[_0xac4a('0x18')](function(_0x4d837c){_0x33c287(_0x4d837c);});});}function getRealtimeQueues(_0x39e83e,_0x15c223){return new Promise(function(_0x3752e4,_0x3a3cdb){var _0x123694=_0x15c223===_0xac4a('0x19')?amiClient:routingClient;return _0x123694[_0xac4a('0x12')](_[_0xac4a('0x1a')](_0x15c223)+'Queues',_0x39e83e)[_0xac4a('0x14')](function(_0x3204ad){if(_0x3204ad['error'])throw new Error(util[_0xac4a('0x1b')](_0xac4a('0x1c'),_0x15c223));return _0x3752e4(_0x3204ad[_0xac4a('0x16')]);})[_0xac4a('0x18')](function(_0x4d2d6c){_0x3a3cdb(_0x4d2d6c);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1b7998,_0x2503d8){return amiClient[_0xac4a('0x12')](_0xac4a('0x1d'),{})[_0xac4a('0x14')](function(_0x2b0dc2){if(_0x2b0dc2[_0xac4a('0xd')])throw new Error(_0xac4a('0x1e'));return _0x1b7998(_0x2b0dc2[_0xac4a('0x16')]);})[_0xac4a('0x18')](function(_0x1d0539){_0x2503d8(_0x1d0539);});});}function initializeQueues(_0x215a31,_0x14832b,_0x472c57,_0x1c13dc){var _0x20202c=['loggedIn',_0xac4a('0x1f'),_0xac4a('0x20'),_0xac4a('0x21'),_0xac4a('0x22')];if(_0x472c57===_0xac4a('0x19')&&_0x1c13dc==='outbound'){_0x20202c['push'](_0xac4a('0x23'),_0xac4a('0x24'),_0xac4a('0x25'),'dialActive','dialMethod',_0xac4a('0x26'),_0xac4a('0x27'),_0xac4a('0x28'),_0xac4a('0x29'),_0xac4a('0x2a'),'erlangAbandonmentRate',_0xac4a('0x2b'),'dialPredictiveInterval',_0xac4a('0x2c'),'dialPredictiveIntervalMinThreshold',_0xac4a('0x2d'),_0xac4a('0x2e'),_0xac4a('0x2f'),_0xac4a('0x30'),_0xac4a('0x31'),_0xac4a('0x32'),_0xac4a('0x33'));}return _0x215a31[_0xac4a('0x34')](function(_0x29fb3b){var _0xfd7c16=_0x29fb3b[_0xac4a('0x35')]({'plain':!![]});_0xfd7c16[_0xac4a('0x36')]=[];_0xfd7c16[_0xac4a('0x22')]=0x0;_0xfd7c16[_0xac4a('0x37')]=0x0;_0xfd7c16['loggedIn']=0x0;_0xfd7c16[_0xac4a('0x1f')]=0x0;_0xfd7c16[_0xac4a('0x20')]=0x0;if(_0x472c57==='voice'){_0xfd7c16[_0xac4a('0x21')]=0x0;_0xfd7c16[_0xac4a('0x38')]=0x0;if(_0x1c13dc==='outbound'){_0xfd7c16['pTalking']=0x0;_0xfd7c16[_0xac4a('0x24')]=0x0;}}var _0x1ba096=_[_0xac4a('0x39')](_0x14832b,['id',_0xfd7c16['id']]);if(_0x1ba096)_[_0xac4a('0x17')](_0xfd7c16,_['pick'](_0x1ba096,_0x20202c));return _0xfd7c16;});}function updateAgentVoiceStatus(_0x453d02,_0x2e56c6,_0x4e7630){var _0x37f2ee=_[_0xac4a('0x3a')](_0x4e7630,[_0xac4a('0x3b'),_0x2e56c6['name']]);if(_0x37f2ee[_0xac4a('0x3c')]===0x0)return _0x453d02[_0xac4a('0x38')]=!![];if(_[_0xac4a('0x3d')](_0x37f2ee,['connectedlinenum',_0x453d02[_0xac4a('0x3e')][_0xac4a('0x3f')]()]))return _0x453d02['talking']=!![];if(!_0x453d02['talking'])return _0x453d02[_0xac4a('0x38')]=!![];}function getVoiceQueueAgents(_0x5e0926,_0x50e03e,_0x5f0af0,_0x4fee3a){var _0x41b757=_[_0xac4a('0x39')](_0x50e03e,['id',_0x5e0926['id']]);if(!_0x41b757)return _0x5e0926;return _0x41b757[_0xac4a('0x40')]({'raw':!![]})[_0xac4a('0x14')](function(_0x2bdb21){for(var _0x415f31=0x0;_0x415f31<_0x2bdb21[_0xac4a('0x3c')];_0x415f31++){var _0x2b16f0=_[_0xac4a('0x39')](_0x5f0af0,['id',_0x2bdb21[_0x415f31][_0xac4a('0x41')]]);if(!_0x2b16f0){_0x2b16f0={'id':_0x2bdb21[_0x415f31][_0xac4a('0x41')],'name':_0x2bdb21[_0x415f31][_0xac4a('0x41')],'accountcode':'','online':![]};}var _0x4e4994={'id':_0x2b16f0['id'],'name':_0x2b16f0['name'],'internal':_0x2b16f0['accountcode'],'online':Boolean(_0x2b16f0[_0xac4a('0x42')]),'paused':Boolean(_0x2bdb21[_0x415f31][_0xac4a('0x22')])};if(_0x2b16f0[_0xac4a('0x43')]===_0xac4a('0x21'))updateAgentVoiceStatus(_0x4e4994,_0x5e0926,_0x4fee3a);if(_0x4e4994[_0xac4a('0x42')])_0x5e0926[_0xac4a('0x37')]++;if(_0x4e4994[_0xac4a('0x38')])_0x5e0926[_0xac4a('0x38')]++;if(_0x4e4994[_0xac4a('0x22')]&&!_0x4e4994[_0xac4a('0x38')]&&!_0x4e4994['talking'])_0x5e0926[_0xac4a('0x22')]++;_0x5e0926[_0xac4a('0x36')][_0xac4a('0x44')](_0x4e4994);}return _0x5e0926;});}function getQueueAgents(_0x3f24a1,_0x1a96cf,_0x57b879){var _0x8700b4=_0xac4a('0x45')+_['startCase'](_0x57b879)+_0xac4a('0x46');var _0x5b1734=_0x57b879+_0xac4a('0x47');return db[_0x8700b4][_0xac4a('0x48')]({'where':{[_[_0xac4a('0x1a')](_0x57b879)+_0xac4a('0x49')]:_0x3f24a1['id']},'raw':!![]})[_0xac4a('0x14')](function(_0x463f01){for(var _0xe54edf=0x0;_0xe54edf<_0x463f01[_0xac4a('0x3c')];_0xe54edf++){var _0x98e0c4=_[_0xac4a('0x39')](_0x1a96cf,['id',_0x463f01[_0xe54edf][_0xac4a('0x41')]]);if(!_0x98e0c4){_0x98e0c4={'id':_0x463f01[_0xe54edf][_0xac4a('0x41')],'name':_0x463f01[_0xe54edf]['UserId'],'online':![],['pauseField']:![]};}var _0x1646ea={'id':_0x98e0c4['id'],'name':_0x98e0c4[_0xac4a('0xf')],'online':Boolean(_0x98e0c4[_0xac4a('0x42')]),'paused':Boolean(_0x98e0c4[_0x5b1734])};if(_0x1646ea['online'])_0x3f24a1[_0xac4a('0x37')]++;_0x3f24a1[_0xac4a('0x36')]['push'](_0x1646ea);}return _0x3f24a1;});}function isIdle(_0x42969b){return _0x42969b==='idle'||_0x42969b===_0xac4a('0x4a')||_0x42969b===_0xac4a('0x4b')||_0x42969b===_0xac4a('0x4c')||_['isNil'](_0x42969b);}function isAgentPaused(_0x588374,_0x42fd9d){var _0x4aaeff=[_0x588374[_0xac4a('0x4d')],_0x588374['faxPause'],_0x588374[_0xac4a('0x4e')],_0x588374['openchannelPause'],_0x588374[_0xac4a('0x4f')],_0x588374[_0xac4a('0x50')],_0x588374[_0xac4a('0x51')]];if(!_0x42fd9d)return _[_0xac4a('0x52')](_0x4aaeff);var _0x54782f=_[_0xac4a('0x3a')](_0x4aaeff);return _0x54782f[_0xac4a('0x3c')]>0x0&&_0x54782f[_0xac4a('0x3c')]<_0x4aaeff[_0xac4a('0x3c')]?!![]:![];}function isAgentIdle(_0x2f30e2){if(_0x2f30e2[_0xac4a('0x43')]!==_0xac4a('0x53')&&_0x2f30e2['voicePause']){_0x2f30e2[_0xac4a('0x43')]=_0xac4a('0x54');return![];}return _['every']([_0x2f30e2[_0xac4a('0x55')],_0x2f30e2[_0xac4a('0x56')],_0x2f30e2[_0xac4a('0x57')],_0x2f30e2[_0xac4a('0x58')],_0x2f30e2['smsStatus'],_0x2f30e2[_0xac4a('0x43')],_0x2f30e2[_0xac4a('0x59')]],isIdle);}function getAgentStatus(_0x2d8db8){var _0x129d58=_0xac4a('0x4a');if(isAgentPaused(_0x2d8db8))_0x129d58='pause';else if(isAgentPaused(_0x2d8db8,!![]))_0x129d58=_0xac4a('0x5a');else if(isAgentIdle(_0x2d8db8))_0x129d58='idle';else _0x129d58=_0xac4a('0x38');return _0x129d58;}exports[_0xac4a('0x5b')]=function(_0x4872e5,_0x5c9c49){var _0x437466={'count':0x0,'rows':[]},_0x70fdc3={},_0x4d448f,_0x18d29c,_0x31a4bf=[_0xac4a('0x5c'),'online',_0xac4a('0x5d'),_0xac4a('0x5e'),_0xac4a('0x5f'),_0xac4a('0x5e'),_0xac4a('0x3e'),_0xac4a('0x60'),_0xac4a('0x4d'),'openchannelPause',_0xac4a('0x4e'),_0xac4a('0x4f'),_0xac4a('0x51'),_0xac4a('0x61'),_0xac4a('0x50'),_0xac4a('0x62'),_0xac4a('0x63'),_0xac4a('0x64'),_0xac4a('0x65'),_0xac4a('0x66'),_0xac4a('0x67'),_0xac4a('0x68'),_0xac4a('0x69'),_0xac4a('0x6a'),_0xac4a('0x6b'),_0xac4a('0x6c'),'faxCurrentCapacity',_0xac4a('0x55'),'openchannelStatus',_0xac4a('0x57'),'smsStatus',_0xac4a('0x59'),'faxStatus',_0xac4a('0x43'),'chatStatusTime','openchannelStatusTime',_0xac4a('0x6d'),_0xac4a('0x6e'),_0xac4a('0x6f'),_0xac4a('0x70'),_0xac4a('0x71'),_0xac4a('0x3b'),'destconnectedlinenum',_0xac4a('0x72'),'phoneBarEnableScreenRecordingByAgent',_0xac4a('0x73'),'routealias'],_0x26b582=[_0xac4a('0x4d'),_0xac4a('0x74'),_0xac4a('0x4e'),_0xac4a('0x4f'),_0xac4a('0x51'),_0xac4a('0x61'),_0xac4a('0x50'),_0xac4a('0x42')];Promise[_0xac4a('0x75')]()[_0xac4a('0x14')](function(){var _0x42e503=_[_0xac4a('0x34')](db[_0xac4a('0x45')][_0xac4a('0x76')],function(_0x17ae93){return{'name':_0x17ae93[_0xac4a('0x77')],'type':_0x17ae93[_0xac4a('0x78')]['key']};});_0x4872e5[_0xac4a('0x79')][_0xac4a('0x7a')]='agent';_0x4872e5[_0xac4a('0x79')][_0xac4a('0x42')]=!![];_0x70fdc3=qs[_0xac4a('0x7b')](_0x42e503,_0x4872e5);_0x70fdc3[_0xac4a('0x7c')]=!![];if(_0x4872e5[_0xac4a('0x7d')]['role']==='user'){var _0x45f3c3={'params':{'id':_0x4872e5[_0xac4a('0x7d')][_0xac4a('0x7e')]},'query':{'section':_0xac4a('0x13'),'role':_0xac4a('0x7f'),'online':!![],'nolimit':_0x4872e5[_0xac4a('0x79')][_0xac4a('0x80')],'sort':_0x4872e5[_0xac4a('0x79')][_0xac4a('0x81')],'filter':_0x4872e5[_0xac4a('0x79')][_0xac4a('0x3a')],'raw':!![]}};return db['UserProfile']['getResources'](_0x45f3c3);}return db[_0xac4a('0x45')][_0xac4a('0x82')](_0x70fdc3);})[_0xac4a('0x14')](function(_0x423f70){_0x437466[_0xac4a('0xa')]=_0x423f70[_0xac4a('0xa')];_0x4d448f=_0x423f70[_0xac4a('0x83')];return getRealtimeAgents();})[_0xac4a('0x14')](function(_0x453d62){_0x18d29c=_0x453d62[_0xac4a('0x83')];return _0x4d448f[_0xac4a('0x34')](function(_0xb12cc5){var _0x5f0173=_[_0xac4a('0x39')](_0x18d29c,['id',_0xb12cc5['id']]);if(_0x5f0173)_[_0xac4a('0x17')](_0xb12cc5,_[_0xac4a('0x84')](_[_0xac4a('0x85')](_0x5f0173,_0x26b582),_0x31a4bf));_0xb12cc5['globalStatus']=getAgentStatus(_0xb12cc5);return _0xb12cc5;});})[_0xac4a('0x14')](function(_0x5a30af){if(_0x4872e5[_0xac4a('0x79')][_0xac4a('0x86')]){var _0x499abc=_['filter'](_0x5a30af,[_0xac4a('0x87'),_0x4872e5[_0xac4a('0x79')][_0xac4a('0x86')]]);if(_0x4872e5['query'][_0xac4a('0x88')]){_0x499abc=_['filter'](_0x499abc,[_0xac4a('0x5f'),_0x4872e5['query']['pauseTypeFilter']]);}}_0x437466[_0xac4a('0x83')]=_0x499abc||_0x5a30af;return _0x437466;})['then'](respondWithFilteredResult(_0x5c9c49,_0x70fdc3))[_0xac4a('0x18')](handleError(_0x5c9c49,null));};exports['getQueues']=function(_0x3cbacc,_0x3a68b6){var _0x4f03c3=[_0xac4a('0x89'),'chat',_0xac4a('0x8a'),_0xac4a('0x8b'),'fax',_0xac4a('0x8c'),'voice'];var _0x5a9111={'count':0x0,'rows':[]},_0x9f5b43={},_0x4e3129,_0x26b962,_0x558c43,_0x4ccd67,_0x1588e2;Promise[_0xac4a('0x75')]()[_0xac4a('0x14')](function(){if(_0x3cbacc['query']['channel']){if(!_[_0xac4a('0x8d')](_0x4f03c3,_0x3cbacc[_0xac4a('0x79')]['channel']['toLowerCase']()))throw new Error(_0xac4a('0x8e'));_0x4e3129=_0x3cbacc[_0xac4a('0x79')][_0xac4a('0x8f')][_0xac4a('0x90')]();}var _0x1810f7=_[_0xac4a('0x1a')](_0x4e3129)+_0xac4a('0x46');var _0x13833b=_[_0xac4a('0x34')](db[_0x1810f7]['rawAttributes'],function(_0x1201e8){return{'name':_0x1201e8[_0xac4a('0x77')],'type':_0x1201e8[_0xac4a('0x78')]['key']};});_0x9f5b43=qs[_0xac4a('0x7b')](_0x13833b,_0x3cbacc);if(_0x3cbacc[_0xac4a('0x7d')][_0xac4a('0x7a')]===_0xac4a('0x7d')){var _0x3d2b5c={'params':{'id':_0x3cbacc['user'][_0xac4a('0x7e')]},'query':{'section':_0x4e3129===_0xac4a('0x19')&&_0x3cbacc[_0xac4a('0x79')][_0xac4a('0x78')]===_0xac4a('0x91')?_0xac4a('0x92'):_[_0xac4a('0x1a')](_0x4e3129)+'Queues','type':_0x3cbacc[_0xac4a('0x79')][_0xac4a('0x78')],'nolimit':!![],'sort':_0xac4a('0xf'),'filter':_0x3cbacc[_0xac4a('0x79')][_0xac4a('0x3a')]}};return db[_0xac4a('0x93')]['getResources'](_0x3d2b5c);}return db[_0x1810f7][_0xac4a('0x82')](_0x9f5b43);})[_0xac4a('0x14')](function(_0x1b9a33){_0x5a9111[_0xac4a('0xa')]=_0x1b9a33['count'];_0x26b962=_0x1b9a33[_0xac4a('0x83')];return getRealtimeQueues(_0x3cbacc,_0x4e3129);})['then'](function(_0x4447b5){_0x4ccd67=_0x4447b5[_0xac4a('0x83')];return getRealtimeAgents();})['then'](function(_0x5b95ab){_0x558c43=_0x5b95ab[_0xac4a('0x83')];if(_0x4e3129!=_0xac4a('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0xac4a('0x14')](function(_0x4bb03d){_0x1588e2=_0x4bb03d?_0x4bb03d[_0xac4a('0x83')]:[];return initializeQueues(_0x26b962,_0x4ccd67,_0x4e3129,_0x3cbacc['query'][_0xac4a('0x78')]);})[_0xac4a('0x14')](function(_0x406b64){var _0x35328e=_0x406b64[_0xac4a('0x34')](function(_0x4c2ac5){if(_0x4e3129==='voice')return getVoiceQueueAgents(_0x4c2ac5,_0x26b962,_0x558c43,_0x1588e2);else return getQueueAgents(_0x4c2ac5,_0x558c43,_0x4e3129);});return Promise[_0xac4a('0x94')](_0x35328e);})[_0xac4a('0x14')](function(_0x23d07c){_0x5a9111[_0xac4a('0x83')]=_0x23d07c;return _0x5a9111;})[_0xac4a('0x14')](respondWithFilteredResult(_0x3a68b6,_0x9f5b43))[_0xac4a('0x18')](handleError(_0x3a68b6,null));};
\ No newline at end of file
+var _0x038b=['loggedIn','waiting','talking','paused','voice','outbound','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','loggedInDb','busy','pick','filter','length','some','connectedlinenum','internal','getMembers','find','UserId','accountcode','online','voiceStatus','agents','User','Queue','Pause','findAll','QueueId','push','idle','unknown','unavailable','ringing','isNil','chatPause','mailPause','openchannelPause','voicePause','whatsappPause','every','pause','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','getAgents','userpic','lastLoginAt','pauseType','lastPauseAt','faxPause','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','faxStatus','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','smsPause','resolve','rawAttributes','type','key','query','getOptions','user','userProfileId','agent','UserProfile','rows','omit','globalStatusFilter','globalStatus','pauseTypeFilter','getQueues','mail','chat','sms','fax','whatsapp','channel','toLowerCase','Invalid\x20channel','fieldName','role','getResources','findAndCountAll','lodash','jayson/promise','../../components/parsers/qs','api','client','http','offset','undefined','count','limit','status','set','Content-Range','json','error','stack','name','send','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','request','result','merge','catch','startCase','Queues','format','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels'];(function(_0x28c2c1,_0x1d328b){var _0x40e4bf=function(_0x56b483){while(--_0x56b483){_0x28c2c1['push'](_0x28c2c1['shift']());}};_0x40e4bf(++_0x1d328b);}(_0x038b,0x114));var _0xb038=function(_0x1d49ba,_0x4b16ea){_0x1d49ba=_0x1d49ba-0x0;var _0x3269a1=_0x038b[_0x1d49ba];return _0x3269a1;};'use strict';var util=require('util');var _=require(_0xb038('0x0'));var jayson=require(_0xb038('0x1'));var qs=require(_0xb038('0x2'));var logger=require('../../config/logger')(_0xb038('0x3'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xb038('0x4')][_0xb038('0x5')]({'port':0x232a});var routingClient=jayson['client'][_0xb038('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x11da3a,_0x4fe092){return function(_0x54e1e7){if(_0x54e1e7){var _0x2e3e64=typeof _0x4fe092[_0xb038('0x6')]===_0xb038('0x7')&&typeof _0x4fe092['limit']==='undefined';var _0x462e8f=_0x54e1e7[_0xb038('0x8')];var _0x4d85b4=_0x2e3e64?0x0:_0x4fe092['offset'];var _0xe3d046=_0x2e3e64?_0x54e1e7[_0xb038('0x8')]:_0x4fe092['offset']+_0x4fe092[_0xb038('0x9')];var _0x162ae7;if(_0xe3d046>=_0x462e8f){_0xe3d046=_0x462e8f;_0x162ae7=0xc8;}else{_0x162ae7=0xce;}_0x11da3a[_0xb038('0xa')](_0x162ae7);return _0x11da3a[_0xb038('0xb')](_0xb038('0xc'),_0x4d85b4+'-'+_0xe3d046+'/'+_0x462e8f)[_0xb038('0xd')](_0x54e1e7);}return null;};}function handleError(_0x1e6474,_0x439751){_0x439751=_0x439751||0x1f4;return function(_0x16e4a3){logger[_0xb038('0xe')](_0x16e4a3[_0xb038('0xf')]);if(_0x16e4a3[_0xb038('0x10')]){delete _0x16e4a3[_0xb038('0x10')];}_0x1e6474[_0xb038('0xa')](_0x439751)[_0xb038('0x11')](_0x16e4a3);};}function getRealtimeAgents(){return new Promise(function(_0x13acc7,_0x13f893){return amiClient['request'](_0xb038('0x12'),{})[_0xb038('0x13')](function(_0x183141){if(_0x183141[_0xb038('0xe')])throw new Error(_0xb038('0x14'));var _0x2b4173=_0x183141['result'];return routingClient[_0xb038('0x15')](_0xb038('0x12'),{})[_0xb038('0x13')](function(_0x3b095a){if(_0x3b095a['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x20cea2=_0x3b095a[_0xb038('0x16')];return _0x13acc7(_[_0xb038('0x17')]({},_0x2b4173,_0x20cea2));});})[_0xb038('0x18')](function(_0x4fd2e8){_0x13f893(_0x4fd2e8);});});}function getRealtimeQueues(_0x222b84,_0x42c8ee){return new Promise(function(_0x3e0ea0,_0x33a377){var _0xc6cd61=_0x42c8ee==='voice'?amiClient:routingClient;return _0xc6cd61[_0xb038('0x15')](_[_0xb038('0x19')](_0x42c8ee)+_0xb038('0x1a'),_0x222b84)[_0xb038('0x13')](function(_0x5f123d){if(_0x5f123d[_0xb038('0xe')])throw new Error(util[_0xb038('0x1b')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x42c8ee));return _0x3e0ea0(_0x5f123d[_0xb038('0x16')]);})[_0xb038('0x18')](function(_0x573f93){_0x33a377(_0x573f93);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x241329,_0x5337e3){return amiClient[_0xb038('0x15')](_0xb038('0x1c'),{})[_0xb038('0x13')](function(_0x1df7c4){if(_0x1df7c4[_0xb038('0xe')])throw new Error(_0xb038('0x1d'));return _0x241329(_0x1df7c4[_0xb038('0x16')]);})['catch'](function(_0xb6d93f){_0x5337e3(_0xb6d93f);});});}function initializeQueues(_0x33cf3c,_0x226631,_0x5d18c8,_0xa8fe18){var _0x3af191=[_0xb038('0x1e'),'available',_0xb038('0x1f'),_0xb038('0x20'),_0xb038('0x21')];if(_0x5d18c8===_0xb038('0x22')&&_0xa8fe18===_0xb038('0x23')){_0x3af191['push'](_0xb038('0x24'),_0xb038('0x25'),_0xb038('0x26'),_0xb038('0x27'),_0xb038('0x28'),_0xb038('0x29'),_0xb038('0x2a'),_0xb038('0x2b'),_0xb038('0x2c'),_0xb038('0x2d'),_0xb038('0x2e'),_0xb038('0x2f'),_0xb038('0x30'),'dialPredictiveIntervalMaxThreshold',_0xb038('0x31'),'predictiveIntervalAvailable',_0xb038('0x32'),_0xb038('0x33'),_0xb038('0x34'),_0xb038('0x35'),_0xb038('0x36'),_0xb038('0x37'));}return _0x33cf3c[_0xb038('0x38')](function(_0x3e6373){var _0x22fac4=_0x3e6373[_0xb038('0x39')]({'plain':!![]});_0x22fac4['agents']=[];_0x22fac4[_0xb038('0x21')]=0x0;_0x22fac4[_0xb038('0x3a')]=0x0;_0x22fac4[_0xb038('0x1e')]=0x0;_0x22fac4['available']=0x0;_0x22fac4['waiting']=0x0;if(_0x5d18c8==='voice'){_0x22fac4[_0xb038('0x20')]=0x0;_0x22fac4[_0xb038('0x3b')]=0x0;if(_0xa8fe18===_0xb038('0x23')){_0x22fac4[_0xb038('0x24')]=0x0;_0x22fac4[_0xb038('0x25')]=0x0;}}var _0x268f1b=_['find'](_0x226631,['id',_0x22fac4['id']]);if(_0x268f1b)_[_0xb038('0x17')](_0x22fac4,_[_0xb038('0x3c')](_0x268f1b,_0x3af191));return _0x22fac4;});}function updateAgentVoiceStatus(_0x1b6f1e,_0x17c445,_0x48e70b){var _0x456e44=_[_0xb038('0x3d')](_0x48e70b,['queue',_0x17c445['name']]);if(_0x456e44[_0xb038('0x3e')]===0x0)return _0x1b6f1e[_0xb038('0x3b')]=!![];if(_[_0xb038('0x3f')](_0x456e44,[_0xb038('0x40'),_0x1b6f1e[_0xb038('0x41')]['toString']()]))return _0x1b6f1e[_0xb038('0x20')]=!![];if(!_0x1b6f1e[_0xb038('0x20')])return _0x1b6f1e[_0xb038('0x3b')]=!![];}function getVoiceQueueAgents(_0x2d1e57,_0x5dd192,_0x793da9,_0x2a9da0){var _0x7d2f79=_['find'](_0x5dd192,['id',_0x2d1e57['id']]);if(!_0x7d2f79)return _0x2d1e57;return _0x7d2f79[_0xb038('0x42')]({'raw':!![]})['then'](function(_0x36f281){for(var _0x2a539a=0x0;_0x2a539a<_0x36f281[_0xb038('0x3e')];_0x2a539a++){var _0x5ce40c=_[_0xb038('0x43')](_0x793da9,['id',_0x36f281[_0x2a539a][_0xb038('0x44')]]);if(!_0x5ce40c){_0x5ce40c={'id':_0x36f281[_0x2a539a][_0xb038('0x44')],'name':_0x36f281[_0x2a539a]['UserId'],'accountcode':'','online':![]};}var _0x1a164e={'id':_0x5ce40c['id'],'name':_0x5ce40c[_0xb038('0x10')],'internal':_0x5ce40c[_0xb038('0x45')],'online':Boolean(_0x5ce40c[_0xb038('0x46')]),'paused':Boolean(_0x36f281[_0x2a539a]['paused'])};if(_0x5ce40c[_0xb038('0x47')]===_0xb038('0x20'))updateAgentVoiceStatus(_0x1a164e,_0x2d1e57,_0x2a9da0);if(_0x1a164e[_0xb038('0x46')])_0x2d1e57[_0xb038('0x3a')]++;if(_0x1a164e['busy'])_0x2d1e57[_0xb038('0x3b')]++;if(_0x1a164e[_0xb038('0x21')]&&!_0x1a164e['busy']&&!_0x1a164e[_0xb038('0x20')])_0x2d1e57[_0xb038('0x21')]++;_0x2d1e57[_0xb038('0x48')]['push'](_0x1a164e);}return _0x2d1e57;});}function getQueueAgents(_0x5b7fa3,_0x317e51,_0x5495c7){var _0x527eaa=_0xb038('0x49')+_[_0xb038('0x19')](_0x5495c7)+_0xb038('0x4a');var _0x17c904=_0x5495c7+_0xb038('0x4b');return db[_0x527eaa][_0xb038('0x4c')]({'where':{[_[_0xb038('0x19')](_0x5495c7)+_0xb038('0x4d')]:_0x5b7fa3['id']},'raw':!![]})['then'](function(_0x5f0d9d){for(var _0x5e8383=0x0;_0x5e8383<_0x5f0d9d[_0xb038('0x3e')];_0x5e8383++){var _0x3ab2b1=_['find'](_0x317e51,['id',_0x5f0d9d[_0x5e8383][_0xb038('0x44')]]);if(!_0x3ab2b1){_0x3ab2b1={'id':_0x5f0d9d[_0x5e8383][_0xb038('0x44')],'name':_0x5f0d9d[_0x5e8383][_0xb038('0x44')],'online':![],['pauseField']:![]};}var _0x5f24cd={'id':_0x3ab2b1['id'],'name':_0x3ab2b1[_0xb038('0x10')],'online':Boolean(_0x3ab2b1['online']),'paused':Boolean(_0x3ab2b1[_0x17c904])};if(_0x5f24cd['online'])_0x5b7fa3[_0xb038('0x3a')]++;_0x5b7fa3[_0xb038('0x48')][_0xb038('0x4e')](_0x5f24cd);}return _0x5b7fa3;});}function isIdle(_0x15100c){return _0x15100c===_0xb038('0x4f')||_0x15100c===_0xb038('0x50')||_0x15100c===_0xb038('0x51')||_0x15100c===_0xb038('0x52')||_[_0xb038('0x53')](_0x15100c);}function isAgentPaused(_0x3db14f,_0x47b0a5){var _0x2faf54=[_0x3db14f[_0xb038('0x54')],_0x3db14f['faxPause'],_0x3db14f[_0xb038('0x55')],_0x3db14f[_0xb038('0x56')],_0x3db14f['smsPause'],_0x3db14f[_0xb038('0x57')],_0x3db14f[_0xb038('0x58')]];if(!_0x47b0a5)return _[_0xb038('0x59')](_0x2faf54);var _0x32bd6b=_[_0xb038('0x3d')](_0x2faf54);return _0x32bd6b[_0xb038('0x3e')]>0x0&&_0x32bd6b[_0xb038('0x3e')]<_0x2faf54[_0xb038('0x3e')]?!![]:![];}function isAgentIdle(_0x3a291d){if(_0x3a291d['voiceStatus']!==_0xb038('0x4f')&&_0x3a291d[_0xb038('0x57')]){_0x3a291d[_0xb038('0x47')]=_0xb038('0x5a');return![];}return _[_0xb038('0x59')]([_0x3a291d[_0xb038('0x5b')],_0x3a291d['faxStatus'],_0x3a291d[_0xb038('0x5c')],_0x3a291d[_0xb038('0x5d')],_0x3a291d[_0xb038('0x5e')],_0x3a291d[_0xb038('0x47')],_0x3a291d[_0xb038('0x5f')]],isIdle);}function getAgentStatus(_0x24198c){var _0xd7a862='unknown';if(isAgentPaused(_0x24198c))_0xd7a862=_0xb038('0x5a');else if(isAgentPaused(_0x24198c,!![]))_0xd7a862='*pause';else if(isAgentIdle(_0x24198c))_0xd7a862=_0xb038('0x4f');else _0xd7a862=_0xb038('0x3b');return _0xd7a862;}exports[_0xb038('0x60')]=function(_0x998fe3,_0x1518c4){var _0x5ea7df={'count':0x0,'rows':[]},_0x5b10cb={},_0x4e179c,_0x1a07c8,_0x3048bc=[_0xb038('0x61'),_0xb038('0x46'),_0xb038('0x62'),'lastPauseAt',_0xb038('0x63'),_0xb038('0x64'),'internal','address',_0xb038('0x54'),'openchannelPause',_0xb038('0x55'),'smsPause',_0xb038('0x58'),_0xb038('0x65'),_0xb038('0x57'),_0xb038('0x66'),'openchannelCapacity',_0xb038('0x67'),_0xb038('0x68'),_0xb038('0x69'),_0xb038('0x6a'),_0xb038('0x6b'),_0xb038('0x6c'),_0xb038('0x6d'),_0xb038('0x6e'),_0xb038('0x6f'),_0xb038('0x70'),_0xb038('0x5b'),_0xb038('0x5d'),'mailStatus',_0xb038('0x5e'),_0xb038('0x5f'),_0xb038('0x71'),_0xb038('0x47'),_0xb038('0x72'),'openchannelStatusTime',_0xb038('0x73'),'smsStatusTime',_0xb038('0x74'),_0xb038('0x75'),'voiceStatusTime',_0xb038('0x76'),_0xb038('0x77'),_0xb038('0x78'),_0xb038('0x79'),_0xb038('0x7a'),_0xb038('0x7b')],_0x276fac=[_0xb038('0x54'),_0xb038('0x56'),_0xb038('0x55'),_0xb038('0x7c'),'whatsappPause',_0xb038('0x65'),'voicePause',_0xb038('0x46')];Promise[_0xb038('0x7d')]()[_0xb038('0x13')](function(){var _0x36568b=_[_0xb038('0x38')](db[_0xb038('0x49')][_0xb038('0x7e')],function(_0x4c23b2){return{'name':_0x4c23b2['fieldName'],'type':_0x4c23b2[_0xb038('0x7f')][_0xb038('0x80')]};});_0x998fe3[_0xb038('0x81')]['role']='agent';_0x998fe3[_0xb038('0x81')]['online']=!![];_0x5b10cb=qs[_0xb038('0x82')](_0x36568b,_0x998fe3);_0x5b10cb['raw']=!![];if(_0x998fe3[_0xb038('0x83')]['role']===_0xb038('0x83')){var _0x3d0ee1={'params':{'id':_0x998fe3[_0xb038('0x83')][_0xb038('0x84')]},'query':{'section':_0xb038('0x12'),'role':_0xb038('0x85'),'online':!![],'nolimit':_0x998fe3['query']['nolimit'],'sort':_0x998fe3[_0xb038('0x81')]['sort'],'filter':_0x998fe3[_0xb038('0x81')][_0xb038('0x3d')],'raw':!![]}};return db[_0xb038('0x86')]['getResources'](_0x3d0ee1);}return db[_0xb038('0x49')]['findAndCountAll'](_0x5b10cb);})[_0xb038('0x13')](function(_0x218394){_0x5ea7df[_0xb038('0x8')]=_0x218394[_0xb038('0x8')];_0x4e179c=_0x218394[_0xb038('0x87')];return getRealtimeAgents();})[_0xb038('0x13')](function(_0x3e2b92){_0x1a07c8=_0x3e2b92[_0xb038('0x87')];return _0x4e179c[_0xb038('0x38')](function(_0x494fe5){var _0x50a40c=_['find'](_0x1a07c8,['id',_0x494fe5['id']]);if(_0x50a40c)_[_0xb038('0x17')](_0x494fe5,_['pick'](_[_0xb038('0x88')](_0x50a40c,_0x276fac),_0x3048bc));_0x494fe5['globalStatus']=getAgentStatus(_0x494fe5);return _0x494fe5;});})[_0xb038('0x13')](function(_0x240e88){if(_0x998fe3[_0xb038('0x81')][_0xb038('0x89')]){var _0x7c8d01=_[_0xb038('0x3d')](_0x240e88,[_0xb038('0x8a'),_0x998fe3[_0xb038('0x81')][_0xb038('0x89')]]);if(_0x998fe3[_0xb038('0x81')][_0xb038('0x8b')]){_0x7c8d01=_[_0xb038('0x3d')](_0x7c8d01,[_0xb038('0x63'),_0x998fe3[_0xb038('0x81')][_0xb038('0x8b')]]);}}_0x5ea7df[_0xb038('0x87')]=_0x7c8d01||_0x240e88;return _0x5ea7df;})[_0xb038('0x13')](respondWithFilteredResult(_0x1518c4,_0x5b10cb))[_0xb038('0x18')](handleError(_0x1518c4,null));};exports[_0xb038('0x8c')]=function(_0x5d0f38,_0x23adc3){var _0x3c194d=[_0xb038('0x8d'),_0xb038('0x8e'),_0xb038('0x8f'),'openchannel',_0xb038('0x90'),_0xb038('0x91'),_0xb038('0x22')];var _0x80d720={'count':0x0,'rows':[]},_0x34e222={},_0x468b41,_0x2acbf6,_0x2d0313,_0xd5aa6d,_0x4ce25a;Promise['resolve']()[_0xb038('0x13')](function(){if(_0x5d0f38['query'][_0xb038('0x92')]){if(!_['includes'](_0x3c194d,_0x5d0f38['query']['channel'][_0xb038('0x93')]()))throw new Error(_0xb038('0x94'));_0x468b41=_0x5d0f38['query'][_0xb038('0x92')][_0xb038('0x93')]();}var _0x3da280=_[_0xb038('0x19')](_0x468b41)+_0xb038('0x4a');var _0x1f960b=_[_0xb038('0x38')](db[_0x3da280][_0xb038('0x7e')],function(_0x20926a){return{'name':_0x20926a[_0xb038('0x95')],'type':_0x20926a['type'][_0xb038('0x80')]};});_0x34e222=qs[_0xb038('0x82')](_0x1f960b,_0x5d0f38);if(_0x5d0f38[_0xb038('0x83')][_0xb038('0x96')]===_0xb038('0x83')){var _0x222e90={'params':{'id':_0x5d0f38[_0xb038('0x83')]['userProfileId']},'query':{'section':_0x468b41===_0xb038('0x22')&&_0x5d0f38[_0xb038('0x81')][_0xb038('0x7f')]==='outbound'?'QueueCampaigns':_[_0xb038('0x19')](_0x468b41)+_0xb038('0x1a'),'type':_0x5d0f38[_0xb038('0x81')]['type'],'nolimit':!![],'sort':_0xb038('0x10'),'filter':_0x5d0f38[_0xb038('0x81')]['filter']}};return db[_0xb038('0x86')][_0xb038('0x97')](_0x222e90);}return db[_0x3da280][_0xb038('0x98')](_0x34e222);})[_0xb038('0x13')](function(_0x24f810){_0x80d720[_0xb038('0x8')]=_0x24f810[_0xb038('0x8')];_0x2acbf6=_0x24f810[_0xb038('0x87')];return getRealtimeQueues(_0x5d0f38,_0x468b41);})[_0xb038('0x13')](function(_0x3d077c){_0xd5aa6d=_0x3d077c[_0xb038('0x87')];return getRealtimeAgents();})[_0xb038('0x13')](function(_0x2ee9c5){_0x2d0313=_0x2ee9c5[_0xb038('0x87')];if(_0x468b41!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xb038('0x13')](function(_0x3b282b){_0x4ce25a=_0x3b282b?_0x3b282b[_0xb038('0x87')]:[];return initializeQueues(_0x2acbf6,_0xd5aa6d,_0x468b41,_0x5d0f38[_0xb038('0x81')][_0xb038('0x7f')]);})[_0xb038('0x13')](function(_0x3ce0a2){var _0xf9caa5=_0x3ce0a2['map'](function(_0x3e29d2){if(_0x468b41===_0xb038('0x22'))return getVoiceQueueAgents(_0x3e29d2,_0x2acbf6,_0x2d0313,_0x4ce25a);else return getQueueAgents(_0x3e29d2,_0x2d0313,_0x468b41);});return Promise['all'](_0xf9caa5);})[_0xb038('0x13')](function(_0x5080e1){_0x80d720['rows']=_0x5080e1;return _0x80d720;})[_0xb038('0x13')](respondWithFilteredResult(_0x23adc3,_0x34e222))['catch'](handleError(_0x23adc3,null));};
\ No newline at end of file
index 201c359..8870043 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(_0x199dea,_0x27c11d){var _0x10a22d=function(_0x35a810){while(--_0x35a810){_0x199dea['push'](_0x199dea['shift']());}};_0x10a22d(++_0x27c11d);}(_0xe706,0xa3));var _0x6e70=function(_0x1dc24d,_0x541fa4){_0x1dc24d=_0x1dc24d-0x0;var _0x5d7fb2=_0xe706[_0x1dc24d];return _0x5d7fb2;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x14fc67,_0x2ea1fe){var _0x3cb64b=function(_0x3a32bd){while(--_0x3a32bd){_0x14fc67['push'](_0x14fc67['shift']());}};_0x3cb64b(++_0x2ea1fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 ab4cfea..a3d365c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xabce,0x103));var _0xeabc=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xabce[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'state':{'type':Sequelize[_0xeabc('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xeabc('0x3')]},'scheduledat':{'type':Sequelize[_0xeabc('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xeabc('0x4')]},'ringtime':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xeabc('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xbf07=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x31894b,_0x3679b0){var _0xea7b6f=function(_0x32d873){while(--_0x32d873){_0x31894b['push'](_0x31894b['shift']());}};_0xea7b6f(++_0x3679b0);}(_0xbf07,0x77));var _0x7bf0=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0xbf07[_0x5e238b];return _0x389bea;};'use strict';var Sequelize=require(_0x7bf0('0x0'));module[_0x7bf0('0x1')]={'state':{'type':Sequelize[_0x7bf0('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x7bf0('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x7bf0('0x3')]},'starttime':{'type':Sequelize[_0x7bf0('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x7bf0('0x3')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 113163b..a798c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd13c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x585cb0,_0x1e4a0a){var _0x148e5c=function(_0x386251){while(--_0x386251){_0x585cb0['push'](_0x585cb0['shift']());}};_0x148e5c(++_0x1e4a0a);}(_0xd13c,0x75));var _0xcd13=function(_0x5690a5,_0x23bd9c){_0x5690a5=_0x5690a5-0x0;var _0x39a90e=_0xd13c[_0x5690a5];return _0x39a90e;};'use strict';var _=require(_0xcd13('0x0'));var util=require(_0xcd13('0x1'));var logger=require(_0xcd13('0x2'))(_0xcd13('0x3'));var moment=require(_0xcd13('0x4'));var BPromise=require(_0xcd13('0x5'));var rp=require(_0xcd13('0x6'));var fs=require('fs');var path=require(_0xcd13('0x7'));var rimraf=require(_0xcd13('0x8'));var config=require(_0xcd13('0x9'));var attributes=require(_0xcd13('0xa'));module[_0xcd13('0xb')]=function(_0x85d24f,_0x37d00b){return _0x85d24f[_0xcd13('0xc')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc59=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36284b,_0x2b7436){var _0x23c34a=function(_0x14f579){while(--_0x14f579){_0x36284b['push'](_0x36284b['shift']());}};_0x23c34a(++_0x2b7436);}(_0xfc59,0x10e));var _0x9fc5=function(_0x3e2b64,_0x113afd){_0x3e2b64=_0x3e2b64-0x0;var _0x3f2ad9=_0xfc59[_0x3e2b64];return _0x3f2ad9;};'use strict';var _=require('lodash');var util=require(_0x9fc5('0x0'));var logger=require(_0x9fc5('0x1'))(_0x9fc5('0x2'));var moment=require(_0x9fc5('0x3'));var BPromise=require(_0x9fc5('0x4'));var rp=require(_0x9fc5('0x5'));var fs=require('fs');var path=require(_0x9fc5('0x6'));var rimraf=require(_0x9fc5('0x7'));var config=require(_0x9fc5('0x8'));var attributes=require(_0x9fc5('0x9'));module[_0x9fc5('0xa')]=function(_0x2af7a5,_0x446709){return _0x2af7a5[_0x9fc5('0xb')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 20e604d..bf827e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38fa=['../../mysqldb','../../config/utils','rpc','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','debug','lodash','util','moment','randomstring','ioredis'];(function(_0x16a1f8,_0xd57bbd){var _0x207a17=function(_0x1a8ab1){while(--_0x1a8ab1){_0x16a1f8['push'](_0x16a1f8['shift']());}};_0x207a17(++_0xd57bbd);}(_0x38fa,0x15a));var _0xa38f=function(_0xf786a7,_0xd4ecf){_0xf786a7=_0xf786a7-0x0;var _0x54dac8=_0x38fa[_0xf786a7];return _0x54dac8;};'use strict';var _=require(_0xa38f('0x0'));var util=require(_0xa38f('0x1'));var moment=require(_0xa38f('0x2'));var BPromise=require('bluebird');var rs=require(_0xa38f('0x3'));var fs=require('fs');var Redis=require(_0xa38f('0x4'));var db=require(_0xa38f('0x5'))['db'];var utils=require(_0xa38f('0x6'));var logger=require('../../config/logger')(_0xa38f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa38f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d7aa0,_0x10afb9,_0x2e66bd){return new BPromise(function(_0x2c93ac,_0x23285c){return client[_0xa38f('0x9')](_0x5d7aa0,_0x2e66bd)[_0xa38f('0xa')](function(_0xdcc206){logger[_0xa38f('0xb')](_0xa38f('0xc'),_0x10afb9,_0xa38f('0xd'));logger['debug'](_0xa38f('0xe'),_0x10afb9,_0xa38f('0xd'),JSON[_0xa38f('0xf')](_0xdcc206));if(_0xdcc206[_0xa38f('0x10')]){if(_0xdcc206[_0xa38f('0x10')][_0xa38f('0x11')]===0x1f4){logger[_0xa38f('0x10')](_0xa38f('0xc'),_0x10afb9,_0xdcc206[_0xa38f('0x10')][_0xa38f('0x12')]);return _0x23285c(_0xdcc206[_0xa38f('0x10')]['message']);}logger[_0xa38f('0x10')](_0xa38f('0xc'),_0x10afb9,_0xdcc206['error']['message']);return _0x2c93ac(_0xdcc206[_0xa38f('0x10')][_0xa38f('0x12')]);}else{logger[_0xa38f('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x10afb9,_0xa38f('0xd'));_0x2c93ac(_0xdcc206[_0xa38f('0x13')][_0xa38f('0x12')]);}})[_0xa38f('0x14')](function(_0x5d2d85){logger[_0xa38f('0x10')](_0xa38f('0xc'),_0x10afb9,_0x5d2d85);_0x23285c(_0x5d2d85);});});}exports[_0xa38f('0x15')]=function(_0xf90559){var _0x4ed9bf=this;return new Promise(function(_0x50518d,_0x420560){return db[_0xa38f('0x16')][_0xa38f('0x17')](_0xf90559['body'],{'raw':_0xf90559[_0xa38f('0x18')]?_0xf90559['options'][_0xa38f('0x19')]===undefined?!![]:![]:!![]})[_0xa38f('0xa')](function(_0x326bb7){logger['info'](_0xa38f('0x15'),_0xf90559);logger[_0xa38f('0x1a')]('CreateReportAgentPreview',_0xf90559,JSON[_0xa38f('0xf')](_0x326bb7));_0x50518d(_0x326bb7);})[_0xa38f('0x14')](function(_0xc06e6b){logger['error'](_0xa38f('0x15'),_0xc06e6b[_0xa38f('0x12')],_0xf90559);_0x420560(_0x4ed9bf[_0xa38f('0x10')](0x1f4,_0xc06e6b[_0xa38f('0x12')]));});});};
\ No newline at end of file
+var _0xaa64=['code','message','result','catch','create','options','then','CreateReportAgentPreview','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4295fd,_0x1f2573){var _0x96f34e=function(_0x32bf59){while(--_0x32bf59){_0x4295fd['push'](_0x4295fd['shift']());}};_0x96f34e(++_0x1f2573);}(_0xaa64,0x1dd));var _0x4aa6=function(_0x196313,_0x4b0bd3){_0x196313=_0x196313-0x0;var _0x436113=_0xaa64[_0x196313];return _0x436113;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var moment=require('moment');var BPromise=require(_0x4aa6('0x2'));var rs=require(_0x4aa6('0x3'));var fs=require('fs');var Redis=require(_0x4aa6('0x4'));var db=require(_0x4aa6('0x5'))['db'];var utils=require(_0x4aa6('0x6'));var logger=require(_0x4aa6('0x7'))('rpc');var config=require(_0x4aa6('0x8'));var jayson=require(_0x4aa6('0x9'));var client=jayson[_0x4aa6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x350587,_0x1321e9,_0x155172){return new BPromise(function(_0x33d9e1,_0x17c3f9){return client[_0x4aa6('0xb')](_0x350587,_0x155172)['then'](function(_0x1c2be1){logger[_0x4aa6('0xc')](_0x4aa6('0xd'),_0x1321e9,_0x4aa6('0xe'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x1321e9,_0x4aa6('0xe'),JSON[_0x4aa6('0xf')](_0x1c2be1));if(_0x1c2be1[_0x4aa6('0x10')]){if(_0x1c2be1['error'][_0x4aa6('0x11')]===0x1f4){logger[_0x4aa6('0x10')](_0x4aa6('0xd'),_0x1321e9,_0x1c2be1[_0x4aa6('0x10')][_0x4aa6('0x12')]);return _0x17c3f9(_0x1c2be1[_0x4aa6('0x10')][_0x4aa6('0x12')]);}logger[_0x4aa6('0x10')](_0x4aa6('0xd'),_0x1321e9,_0x1c2be1[_0x4aa6('0x10')][_0x4aa6('0x12')]);return _0x33d9e1(_0x1c2be1['error']['message']);}else{logger[_0x4aa6('0xc')](_0x4aa6('0xd'),_0x1321e9,'request\x20sent');_0x33d9e1(_0x1c2be1[_0x4aa6('0x13')]['message']);}})[_0x4aa6('0x14')](function(_0x57b0f7){logger[_0x4aa6('0x10')](_0x4aa6('0xd'),_0x1321e9,_0x57b0f7);_0x17c3f9(_0x57b0f7);});});}exports['CreateReportAgentPreview']=function(_0x36b772){var _0x582411=this;return new Promise(function(_0x1c6af5,_0x1bfcfc){return db['ReportAgentPreview'][_0x4aa6('0x15')](_0x36b772['body'],{'raw':_0x36b772[_0x4aa6('0x16')]?_0x36b772[_0x4aa6('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x4aa6('0x17')](function(_0x51c68c){logger[_0x4aa6('0xc')](_0x4aa6('0x18'),_0x36b772);logger[_0x4aa6('0x19')](_0x4aa6('0x18'),_0x36b772,JSON[_0x4aa6('0xf')](_0x51c68c));_0x1c6af5(_0x51c68c);})['catch'](function(_0x25d311){logger['error'](_0x4aa6('0x18'),_0x25d311[_0x4aa6('0x12')],_0x36b772);_0x1bfcfc(_0x582411[_0x4aa6('0x10')](0x1f4,_0x25d311[_0x4aa6('0x12')]));});});};
\ No newline at end of file
index 0a5d0ab..dac27dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53cc=['/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','showOpenchannelQueues','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','multer','util','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','mailQueues','/openchannel/queues','/sms/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x53cc,0x1a2));var _0xc53c=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0x53cc[_0x381372];return _0x4e959a;};'use strict';var multer=require(_0xc53c('0x0'));var util=require(_0xc53c('0x1'));var path=require('path');var express=require(_0xc53c('0x2'));var router=express[_0xc53c('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0xc53c('0x4'));router[_0xc53c('0x5')](_0xc53c('0x6'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x8')]);router['get'](_0xc53c('0x9'),auth[_0xc53c('0x7')](),controller[_0xc53c('0xa')]);router[_0xc53c('0x5')](_0xc53c('0xb'),auth[_0xc53c('0x7')](),controller[_0xc53c('0xc')]);router[_0xc53c('0x5')]('/voice/queues',auth['isAuthenticated'](),controller[_0xc53c('0xd')]);router[_0xc53c('0x5')](_0xc53c('0xe'),auth[_0xc53c('0x7')](),controller['chatQueues']);router['get']('/mail/queues',auth[_0xc53c('0x7')](),controller[_0xc53c('0xf')]);router[_0xc53c('0x5')]('/mail/accounts',auth[_0xc53c('0x7')](),controller['mailAccounts']);router[_0xc53c('0x5')](_0xc53c('0x10'),auth['isAuthenticated'](),controller['openchannelQueues']);router['get'](_0xc53c('0x11'),auth['isAuthenticated'](),controller['smsQueues']);router[_0xc53c('0x5')]('/whatsapp/queues',auth[_0xc53c('0x7')](),controller[_0xc53c('0x12')]);router[_0xc53c('0x5')](_0xc53c('0x13'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x14')]);router['get'](_0xc53c('0x15'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x16')]);router[_0xc53c('0x5')]('/voice/queues/channels',auth[_0xc53c('0x7')](),controller['voiceQueuesChannels']);router[_0xc53c('0x5')](_0xc53c('0x17'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x18')]);router[_0xc53c('0x5')](_0xc53c('0x19'),auth[_0xc53c('0x7')](),controller['voiceQueuesChannelHangup']);router[_0xc53c('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xc53c('0x5')](_0xc53c('0x1a'),auth['isAuthenticated'](),controller[_0xc53c('0x1b')]);router[_0xc53c('0x1c')](_0xc53c('0x1a'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x1d')]);router[_0xc53c('0x5')](_0xc53c('0x1e'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x1f')]);router[_0xc53c('0x5')]('/outbound/channels',auth[_0xc53c('0x7')](),controller['outboundChannels']);router[_0xc53c('0x5')](_0xc53c('0x20'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x21')]);router[_0xc53c('0x1c')](_0xc53c('0x22'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x23')]);router[_0xc53c('0x5')](_0xc53c('0x24'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x25')]);router[_0xc53c('0x5')](_0xc53c('0x26'),auth['isAuthenticated'](),controller[_0xc53c('0x27')]);router[_0xc53c('0x5')](_0xc53c('0x28'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x29')]);router[_0xc53c('0x5')](_0xc53c('0x2a'),auth['isAuthenticated'](),controller[_0xc53c('0x2b')]);router['get'](_0xc53c('0x2c'),auth[_0xc53c('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xc53c('0x5')](_0xc53c('0x2d'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x2e')]);router[_0xc53c('0x5')]('/openchannel/queues/waitinginteractions',auth[_0xc53c('0x7')](),controller[_0xc53c('0x2f')]);router[_0xc53c('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0xc53c('0x7')](),controller[_0xc53c('0x30')]);router[_0xc53c('0x5')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xc53c('0x31')]);router[_0xc53c('0x5')](_0xc53c('0x32'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x33')]);router['get'](_0xc53c('0x34'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x35')]);router[_0xc53c('0x36')](_0xc53c('0x37'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x38')](_0xc53c('0x39')));router[_0xc53c('0x5')](_0xc53c('0x3a'),auth[_0xc53c('0x7')](),controller['showMailQueues']);router[_0xc53c('0x36')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0xc53c('0x3b')));router[_0xc53c('0x5')](_0xc53c('0x3c'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x3d')]);router[_0xc53c('0x36')](_0xc53c('0x3e'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x38')](_0xc53c('0x3f')));router['get'](_0xc53c('0x40'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x41')]);router[_0xc53c('0x36')](_0xc53c('0x42'),auth['isAuthenticated'](),controller[_0xc53c('0x38')]('openchannel'));router[_0xc53c('0x5')]('/openchannel/queues/:id',auth[_0xc53c('0x7')](),controller[_0xc53c('0x43')]);router['post']('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xc53c('0x38')]('sms'));router['post'](_0xc53c('0x44'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x38')]('whatsapp'));router[_0xc53c('0x5')](_0xc53c('0x45'),auth['isAuthenticated'](),controller[_0xc53c('0x46')]);router[_0xc53c('0x5')](_0xc53c('0x47'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router['post'](_0xc53c('0x48'),auth[_0xc53c('0x7')](),controller[_0xc53c('0x49')]);module['exports']=router;
\ No newline at end of file
+var _0xf1fd=['mailQueues','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','chat','/fax/queues/:id/notify','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/queues','/chat/queues'];(function(_0x4e52b2,_0x41217c){var _0x4cef73=function(_0xa72719){while(--_0xa72719){_0x4e52b2['push'](_0x4e52b2['shift']());}};_0x4cef73(++_0x41217c);}(_0xf1fd,0x157));var _0xdf1f=function(_0x573f83,_0x1f3cd3){_0x573f83=_0x573f83-0x0;var _0xe89cd1=_0xf1fd[_0x573f83];return _0xe89cd1;};'use strict';var multer=require(_0xdf1f('0x0'));var util=require('util');var path=require(_0xdf1f('0x1'));var express=require(_0xdf1f('0x2'));var router=express['Router']();var auth=require(_0xdf1f('0x3'));var controller=require(_0xdf1f('0x4'));router[_0xdf1f('0x5')](_0xdf1f('0x6'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x8')]);router[_0xdf1f('0x5')](_0xdf1f('0x9'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0xdf1f('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xdf1f('0x7')](),controller['voiceChannelStopMixMonitor']);router[_0xdf1f('0x5')](_0xdf1f('0xa'),auth[_0xdf1f('0x7')](),controller['voiceQueues']);router[_0xdf1f('0x5')](_0xdf1f('0xb'),auth[_0xdf1f('0x7')](),controller['chatQueues']);router[_0xdf1f('0x5')]('/mail/queues',auth[_0xdf1f('0x7')](),controller[_0xdf1f('0xc')]);router[_0xdf1f('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller['mailAccounts']);router[_0xdf1f('0x5')](_0xdf1f('0xd'),auth['isAuthenticated'](),controller[_0xdf1f('0xe')]);router['get'](_0xdf1f('0xf'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x10')]);router[_0xdf1f('0x5')]('/whatsapp/queues',auth[_0xdf1f('0x7')](),controller['whatsappQueues']);router[_0xdf1f('0x5')](_0xdf1f('0x11'),auth[_0xdf1f('0x7')](),controller['faxQueues']);router[_0xdf1f('0x5')](_0xdf1f('0x12'),auth['isAuthenticated'](),controller[_0xdf1f('0x13')]);router[_0xdf1f('0x5')](_0xdf1f('0x14'),auth['isAuthenticated'](),controller[_0xdf1f('0x15')]);router[_0xdf1f('0x5')]('/voice/queues/channels/:uniqueid',auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x16')]);router[_0xdf1f('0x5')](_0xdf1f('0x17'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x18')]);router[_0xdf1f('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x19')]);router[_0xdf1f('0x5')]('/voice/queues/:id',auth[_0xdf1f('0x7')](),controller['showVoiceQueues']);router[_0xdf1f('0x1a')]('/voice/queues/:id',auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x1b')]);router['get'](_0xdf1f('0x1c'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x1d')]);router[_0xdf1f('0x5')](_0xdf1f('0x1e'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x1f')]);router[_0xdf1f('0x5')](_0xdf1f('0x20'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x21')]);router[_0xdf1f('0x1a')](_0xdf1f('0x22'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0xdf1f('0x5')](_0xdf1f('0x23'),auth[_0xdf1f('0x7')](),controller['telephones']);router[_0xdf1f('0x5')]('/trunks',auth['isAuthenticated'](),controller[_0xdf1f('0x24')]);router[_0xdf1f('0x5')](_0xdf1f('0x25'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x26')]);router[_0xdf1f('0x5')]('/fax/accounts',auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x27')]);router['get'](_0xdf1f('0x28'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x29')]);router[_0xdf1f('0x5')](_0xdf1f('0x2a'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x2b')]);router[_0xdf1f('0x5')](_0xdf1f('0x2c'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xdf1f('0x5')](_0xdf1f('0x2d'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x2e')]);router[_0xdf1f('0x5')](_0xdf1f('0x2f'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x30')]);router[_0xdf1f('0x5')](_0xdf1f('0x31'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x32')]);router[_0xdf1f('0x5')](_0xdf1f('0x33'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x34')]);router[_0xdf1f('0x35')]('/mail/queues/:id/notify',auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x36')](_0xdf1f('0x37')));router[_0xdf1f('0x5')](_0xdf1f('0x38'),auth[_0xdf1f('0x7')](),controller['showMailQueues']);router[_0xdf1f('0x35')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0xdf1f('0x39')));router['get']('/chat/queues/:id',auth[_0xdf1f('0x7')](),controller['showChatQueues']);router[_0xdf1f('0x35')](_0xdf1f('0x3a'),auth[_0xdf1f('0x7')](),controller['queueNotify']('fax'));router['get']('/fax/queues/:id',auth[_0xdf1f('0x7')](),controller['showFaxQueues']);router[_0xdf1f('0x35')](_0xdf1f('0x3b'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x36')](_0xdf1f('0x3c')));router[_0xdf1f('0x5')](_0xdf1f('0x3d'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x3e')]);router['post'](_0xdf1f('0x3f'),auth['isAuthenticated'](),controller[_0xdf1f('0x36')](_0xdf1f('0x40')));router[_0xdf1f('0x35')](_0xdf1f('0x41'),auth[_0xdf1f('0x7')](),controller[_0xdf1f('0x36')]('whatsapp'));router[_0xdf1f('0x5')](_0xdf1f('0x42'),auth[_0xdf1f('0x7')](),controller['showSmsQueues']);router[_0xdf1f('0x5')](_0xdf1f('0x43'),auth['isAuthenticated'](),controller[_0xdf1f('0x44')]);router[_0xdf1f('0x35')](_0xdf1f('0x45'),auth[_0xdf1f('0x7')](),controller['agentNotify']);module[_0xdf1f('0x46')]=router;
\ No newline at end of file
index 606fa9e..38e2d64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['VoiceQueuesChannelHangup','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','agent','AgentCapacity','telephones','Telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','MessageId','From','agentTransferTimeout','bluebird','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup'];(function(_0x141ce1,_0x9dbd7){var _0x4ead6d=function(_0x10753b){while(--_0x10753b){_0x141ce1['push'](_0x141ce1['shift']());}};_0x4ead6d(++_0x9dbd7);}(_0x326f,0xd1));var _0xf326=function(_0x20c219,_0x3f3546){_0x20c219=_0x20c219-0x0;var _0x376144=_0x326f[_0x20c219];return _0x376144;};'use strict';var BPromise=require(_0xf326('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0xf326('0x1'));var db=require(_0xf326('0x2'))['db'];var logger=require(_0xf326('0x3'))(_0xf326('0x4'));var jayson=require(_0xf326('0x5'));var amiClient=jayson[_0xf326('0x6')][_0xf326('0x7')]({'port':0x232a});var mailClient=jayson[_0xf326('0x6')][_0xf326('0x7')]({'port':0x232b});var routingClient=jayson[_0xf326('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){var _0x4c206c=_0x165f95?_0x165f95:amiClient;return _0x4c206c['request'](_0x3c254d,_0x3851eb)[_0xf326('0x8')](function(_0x1fc80e){if(_0x1fc80e[_0xf326('0x9')]){if(_0x1fc80e[_0xf326('0x9')][_0xf326('0xa')]===0x1f4){return _0x515bfa(_0x1fc80e['error'][_0xf326('0xb')]);}return _0x1e7b8a(_0x1fc80e['error'][_0xf326('0xb')]);}else{_0x1e7b8a(_0x1fc80e['result']);}})[_0xf326('0xc')](function(_0x518ab5){_0x515bfa(_0x518ab5);});});}function respondWithResult(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xc8;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0xd')](_0x9ed463)[_0xf326('0xe')](_0x4b3966);}return _0x3162f9[_0xf326('0xf')](0x194);};}function handleError(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0x1f4;return function(_0x45c1b6){logger['error'](_0x45c1b6['stack']);if(_0x45c1b6[_0xf326('0x10')]){delete _0x45c1b6[_0xf326('0x10')];}_0x17a098[_0xf326('0xd')](_0x5c8483)[_0xf326('0x11')](_0x45c1b6);};}function findById(_0x292f4b){return function(_0x287a2a){if(!_[_0xf326('0x12')](_0x292f4b)&&!_[_0xf326('0x12')](_0x287a2a)&&!_['isNil'](_0x287a2a[_0xf326('0x13')])){return _[_0xf326('0x14')](_0x287a2a[_0xf326('0x13')],function(_0x31ffb9){return _0x31ffb9['id']==_0x292f4b;});}return null;};}exports[_0xf326('0x15')]=function(_0x311af0,_0x4d3d41){return respondWithRpcPromise('VoiceChannels',_0x311af0['query'])[_0xf326('0x8')](respondWithResult(_0x4d3d41,null))[_0xf326('0xc')](handleError(_0x4d3d41,null));};exports['voiceChannelMixMonitor']=function(_0x4cabce,_0x128c68){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x4cabce[_0xf326('0x16')],_0x4cabce[_0xf326('0x17')]))['then'](respondWithResult(_0x128c68,null))['catch'](handleError(_0x128c68,null));};exports[_0xf326('0x18')]=function(_0xb1efcf,_0x5f21a2){return respondWithRpcPromise(_0xf326('0x19'),_[_0xf326('0x1a')](_0xb1efcf[_0xf326('0x16')],_0xb1efcf[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x5f21a2,null))[_0xf326('0xc')](handleError(_0x5f21a2,null));};exports['voiceQueues']=function(_0x55b9f4,_0x4f31f6){return respondWithRpcPromise(_0xf326('0x1b'),_0x55b9f4[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4f31f6,null))[_0xf326('0xc')](handleError(_0x4f31f6,null));};exports[_0xf326('0x1c')]=function(_0x410237,_0x5217d4){return respondWithRpcPromise(_0xf326('0x1b'),_0x410237[_0xf326('0x16')])[_0xf326('0x8')](findById(_0x410237['params']['id']))[_0xf326('0x8')](respondWithResult(_0x5217d4,null))['catch'](handleError(_0x5217d4,null));};exports['updateVoiceQueue']=function(_0x6a8e89,_0x1ae23a){return respondWithRpcPromise(_0xf326('0x1d'),_['merge'](_0x6a8e89[_0xf326('0x1e')],_0x6a8e89[_0xf326('0x17')]))['then'](respondWithResult(_0x1ae23a,null))[_0xf326('0xc')](handleError(_0x1ae23a,null));};exports[_0xf326('0x1f')]=function(_0xd77aba,_0x18d110){return respondWithRpcPromise(_0xf326('0x20'),_[_0xf326('0x1a')](_0xd77aba[_0xf326('0x16')],_0xd77aba[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x18d110,null))[_0xf326('0xc')](handleError(_0x18d110,null));};exports['voiceQueuesChannels']=function(_0x1035ed,_0x424104){return respondWithRpcPromise(_0xf326('0x21'),_0x1035ed['query'])[_0xf326('0x8')](respondWithResult(_0x424104,null))[_0xf326('0xc')](handleError(_0x424104,null));};exports[_0xf326('0x22')]=function(_0x4df451,_0x5b101d){return respondWithRpcPromise(_0xf326('0x23'),_[_0xf326('0x1a')](_0x4df451[_0xf326('0x16')],_0x4df451[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x5b101d,null))[_0xf326('0xc')](handleError(_0x5b101d,null));};exports[_0xf326('0x24')]=function(_0x2d5f20,_0x580374){return respondWithRpcPromise(_0xf326('0x25'),_[_0xf326('0x1a')](_0x2d5f20['query'],_0x2d5f20[_0xf326('0x17')]))['then'](respondWithResult(_0x580374,null))[_0xf326('0xc')](handleError(_0x580374,null));};exports['voiceQueuesChannelRedirect']=function(_0x51f147,_0xadb020){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xf326('0x1a')](_0x51f147['query'],_0x51f147[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0xadb020,null))[_0xf326('0xc')](handleError(_0xadb020,null));};exports['outbound']=function(_0x3dcc7e,_0x4095e6){return respondWithRpcPromise('Outbound',_0x3dcc7e[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4095e6,null))[_0xf326('0xc')](handleError(_0x4095e6,null));};exports[_0xf326('0x26')]=function(_0x51076c,_0x2c4416){return respondWithRpcPromise(_0xf326('0x27'),_0x51076c[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x2c4416,null))[_0xf326('0xc')](handleError(_0x2c4416,null));};exports['agents']=function(_0x3e830d,_0x1b7bf6){var _0x5cfb97;return respondWithRpcPromise('Agents',_0x3e830d[_0xf326('0x16')])['then'](function(_0x55dfa8){_0x5cfb97=_0x55dfa8;return respondWithRpcPromise(_0xf326('0x28'),_0x3e830d['query'],routingClient);})[_0xf326('0x8')](function(_0x37a95b){return _[_0xf326('0x1a')]({},_0x37a95b,_0x5cfb97);})[_0xf326('0x8')](respondWithResult(_0x1b7bf6,null))['catch'](handleError(_0x1b7bf6,null));};exports[_0xf326('0x29')]=function(_0x45d344,_0x347e7b){if(_0x45d344[_0xf326('0x1e')]&&_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')]&&_0x45d344[_0xf326('0x2b')]&&_0x45d344[_0xf326('0x2b')][_0xf326('0x10')]){for(var _0x1227d3 in _0x45d344[_0xf326('0x1e')][_0xf326('0x2a')]){if(_0x45d344['body'][_0xf326('0x2a')][_0xf326('0x2c')](_0x1227d3)){db[_0xf326('0x2d')][_0xf326('0x2e')]({'where':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3]&&_0x45d344['body'][_0xf326('0x2a')][_0x1227d3][_0xf326('0x2f')]?{'$notIn':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3]}:{'$ne':null}}})[_0xf326('0x8')](function(_0x55361f){var _0x505344=moment()[_0xf326('0x30')](_0xf326('0x31'));for(var _0x5ed62e=0x0,_0x4bd865=_0x55361f[_0xf326('0x2f')];_0x5ed62e<_0x4bd865;_0x5ed62e+=0x1){_0x55361f[_0x5ed62e][_0xf326('0x32')]({'exitAt':_0x505344});}});for(var _0x21c98e=0x0;_0x21c98e<_0x45d344['body'][_0xf326('0x2a')][_0x1227d3][_0xf326('0x2f')];_0x21c98e+=0x1){db[_0xf326('0x2d')][_0xf326('0x33')]({'where':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'type':_0xf326('0x34'),'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3][_0x21c98e],'exitAt':null},'defaults':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'interface':_[_0xf326('0x12')](_0x45d344[_0xf326('0x2b')][_0xf326('0x35')])?util[_0xf326('0x30')]('SIP/%s',_0x45d344[_0xf326('0x2b')][_0xf326('0x10')]):_0x45d344[_0xf326('0x2b')][_0xf326('0x35')],'type':'INTERACTION','enterAt':moment()[_0xf326('0x30')](_0xf326('0x31')),'role':_0xf326('0x36'),'internal':_0x45d344[_0xf326('0x2b')]['internal'],'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3][_0x21c98e]}});}}}}return respondWithRpcPromise(_0xf326('0x37'),{'id':_0x45d344[_0xf326('0x17')]['id'],'capacity':_0x45d344[_0xf326('0x1e')]['capacity']},routingClient)['then'](respondWithResult(_0x347e7b,null))[_0xf326('0xc')](handleError(_0x347e7b,null));};exports[_0xf326('0x38')]=function(_0x2ff126,_0x4cb25b){return respondWithRpcPromise(_0xf326('0x39'),_0x2ff126[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4cb25b,null))['catch'](handleError(_0x4cb25b,null));};exports['trunks']=function(_0x36ef89,_0x5b4832){return respondWithRpcPromise(_0xf326('0x3a'),_0x36ef89['query'])[_0xf326('0x8')](respondWithResult(_0x5b4832,null))[_0xf326('0xc')](handleError(_0x5b4832,null));};exports[_0xf326('0x3b')]=function(_0x25e091,_0x212594){return respondWithRpcPromise(_0xf326('0x3c'),_0x25e091[_0xf326('0x16')])['then'](respondWithResult(_0x212594,null))[_0xf326('0xc')](handleError(_0x212594,null));};exports[_0xf326('0x3d')]=function(_0x424d24,_0x4b0d8e){return respondWithRpcPromise(_0xf326('0x3e'),_0x424d24[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x4b0d8e,null))[_0xf326('0xc')](handleError(_0x4b0d8e,null));};exports[_0xf326('0x3f')]=function(_0x58fcf0,_0x161fb3){return respondWithRpcPromise(_0xf326('0x3e'),_0x58fcf0[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x58fcf0['params']['id']))[_0xf326('0x8')](respondWithResult(_0x161fb3,null))[_0xf326('0xc')](handleError(_0x161fb3,null));};exports[_0xf326('0x40')]=function(_0x29e52e,_0x4d3b9e){return respondWithRpcPromise('MailQueues',_0x29e52e[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x4d3b9e,null))['catch'](handleError(_0x4d3b9e,null));};exports[_0xf326('0x41')]=function(_0x29de71,_0x316609){return respondWithRpcPromise(_0xf326('0x42'),_0x29de71['query'],routingClient)[_0xf326('0x8')](findById(_0x29de71['params']['id']))['then'](respondWithResult(_0x316609,null))[_0xf326('0xc')](handleError(_0x316609,null));};exports['mailAccounts']=function(_0x173760,_0x52fb95){return respondWithRpcPromise(_0xf326('0x43'),_0x173760['query'],mailClient)['then'](respondWithResult(_0x52fb95,null))[_0xf326('0xc')](handleError(_0x52fb95,null));};exports[_0xf326('0x44')]=function(_0x33b259,_0x5d0177){return respondWithRpcPromise(_0xf326('0x45'),_0x33b259['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x5d0177,null))[_0xf326('0xc')](handleError(_0x5d0177,null));};exports[_0xf326('0x46')]=function(_0x217897,_0xbd3a01){return respondWithRpcPromise(_0xf326('0x45'),_0x217897[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x217897[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0xbd3a01,null))[_0xf326('0xc')](handleError(_0xbd3a01,null));};exports[_0xf326('0x47')]=function(_0x40f7cb,_0x4ca1b8){return respondWithRpcPromise(_0xf326('0x48'),_0x40f7cb['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x4ca1b8,null))[_0xf326('0xc')](handleError(_0x4ca1b8,null));};exports['showSmsQueues']=function(_0x2b770c,_0x5283da){return respondWithRpcPromise(_0xf326('0x48'),_0x2b770c[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x2b770c[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0x5283da,null))['catch'](handleError(_0x5283da,null));};exports['whatsappQueues']=function(_0x1209ca,_0x32fe3a){return respondWithRpcPromise(_0xf326('0x49'),_0x1209ca[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x32fe3a,null))['catch'](handleError(_0x32fe3a,null));};exports[_0xf326('0x4a')]=function(_0x471da8,_0x4aadc9){return respondWithRpcPromise('WhatsappQueues',_0x471da8['query'],routingClient)[_0xf326('0x8')](findById(_0x471da8[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0x4aadc9,null))[_0xf326('0xc')](handleError(_0x4aadc9,null));};exports[_0xf326('0x4b')]=function(_0x23a56e,_0x230aea){return respondWithRpcPromise('FaxQueues',_0x23a56e[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x230aea,null))[_0xf326('0xc')](handleError(_0x230aea,null));};exports[_0xf326('0x4c')]=function(_0x58de1e,_0x3717fe){return respondWithRpcPromise('FaxQueues',_0x58de1e['query'],routingClient)[_0xf326('0x8')](findById(_0x58de1e['params']['id']))[_0xf326('0x8')](respondWithResult(_0x3717fe,null))[_0xf326('0xc')](handleError(_0x3717fe,null));};exports[_0xf326('0x4d')]=function(_0x2ea5a2,_0x17cd36){return respondWithRpcPromise('FaxAccounts',_0x2ea5a2['query'])['then'](respondWithResult(_0x17cd36,null))[_0xf326('0xc')](handleError(_0x17cd36,null));};exports[_0xf326('0x4e')]=function(_0x229a34,_0x180616){return respondWithRpcPromise(_0xf326('0x4f'),_0x229a34['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x180616,null))[_0xf326('0xc')](handleError(_0x180616,null));};exports[_0xf326('0x50')]=function(_0x4f9a6a,_0x567492){return respondWithRpcPromise(_0xf326('0x51'),_0x4f9a6a[_0xf326('0x16')],routingClient)['then'](respondWithResult(_0x567492,null))['catch'](handleError(_0x567492,null));};exports[_0xf326('0x52')]=function(_0x5ba28d,_0xc3a897){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5ba28d['query'],routingClient)['then'](respondWithResult(_0xc3a897,null))[_0xf326('0xc')](handleError(_0xc3a897,null));};exports[_0xf326('0x53')]=function(_0xd44071,_0x4838d5){return respondWithRpcPromise(_0xf326('0x54'),_0xd44071[_0xf326('0x16')],routingClient)[_0xf326('0x8')](function(_0x457f3d){if(_0xd44071[_0xf326('0x16')][_0xf326('0x55')]!==undefined){var _0x7f6d0e=_(_0x457f3d[_0xf326('0x13')])[_0xf326('0x56')]([_0xd44071['query'][_0xf326('0x55')],_0xd44071['params']['id']])[_0xf326('0x57')](_0xf326('0x58'))[_0xf326('0x59')]()['value']();return _0x457f3d[_0xf326('0x13')][_0xf326('0x56')](function(_0x39c90d){return _0x7f6d0e['indexOf'](_0x39c90d[_0xf326('0x58')])>-0x1;});}else{return _0x457f3d[_0xf326('0x13')][_0xf326('0x56')](function(_0x42c7cf){return _0x42c7cf['queue_id']===parseInt(_0xd44071[_0xf326('0x17')]['id']);});}})['then'](respondWithResult(_0x4838d5,null))['catch'](handleError(_0x4838d5,null));};exports[_0xf326('0x5a')]=function(_0x2c36d3,_0x5af6b7){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c36d3['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x5af6b7,null))['catch'](handleError(_0x5af6b7,null));};exports[_0xf326('0x5b')]=function(_0x37a564,_0x3434b2){return respondWithRpcPromise(_0xf326('0x5c'),_0x37a564[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x3434b2,null))['catch'](handleError(_0x3434b2,null));};exports[_0xf326('0x5d')]=function(_0x323926,_0x5f1724){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x323926[_0xf326('0x16')],routingClient)['then'](respondWithResult(_0x5f1724,null))[_0xf326('0xc')](handleError(_0x5f1724,null));};exports[_0xf326('0x5e')]=function(_0x153027){return function(_0x363e64,_0x19d676){var _0x6e662,_0x293600;var _0x8ca46f=_[_0xf326('0x5f')](_0x153027);var _0x499cbd=_0x153027===_0xf326('0x60')?_0xf326('0x61'):'Account';return db[_0x8ca46f+_0xf326('0x62')]['findOne']({'raw':!![],'where':{'id':_0x363e64[_0xf326('0x17')]['id']}})[_0xf326('0x8')](function(_0x14e8c0){if(_['isNil'](_0x14e8c0)){throw new Error(_0x8ca46f+_0xf326('0x63'));}_0x6e662=_0x14e8c0;return db[_0x8ca46f+_0xf326('0x64')][_0xf326('0x65')]({'where':{'id':_0x363e64[_0xf326('0x1e')][_0xf326('0x66')]},'include':[{'model':db[_0x8ca46f+_0xf326('0x67')],'as':_0xf326('0x67')},{'model':db[_0x8ca46f+_0x499cbd],'as':_0xf326('0x68')}]});})[_0xf326('0x8')](function(_0x38b696){if(_[_0xf326('0x12')](_0x38b696)){throw new Error(_0x8ca46f+_0xf326('0x69'));}_0x293600=_0x38b696;return _0x38b696[_0xf326('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf326('0x8')](function(){var _0x1f990d={'uniqueid':_0x153027+'.'+_0x293600['id']+'.'+_0x293600['Interaction']['id'],'FromUserId':_0x363e64[_0xf326('0x2b')]['id'],'type':_0xf326('0x6b')};_0x1f990d[_0x8ca46f+'MessageId']=_0x293600['id'];_0x1f990d[_0x8ca46f+_0xf326('0x6c')]=_0x293600[_0xf326('0x67')]['id'];_0x1f990d['From'+_0x8ca46f+_0x499cbd+'Id']=_0x293600[_0xf326('0x68')]['id'];_0x1f990d['To'+_0x8ca46f+_0xf326('0x6d')]=_0x6e662['id'];return db[_0x8ca46f+_0xf326('0x6e')][_0xf326('0x6f')](_0x1f990d);})[_0xf326('0x8')](function(){return respondWithRpcPromise(_0xf326('0x70'),{'channel':_0x153027,'interaction':_0x293600[_0xf326('0x67')],'message':_0x293600,'account':_0x293600['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf326('0x6b'),'appdata':_0x6e662[_0xf326('0x10')]+','+(_0x293600[_0xf326('0x68')][_0xf326('0x71')]||0x12c),'interval':_0xf326('0x72')}]},routingClient);})[_0xf326('0x8')](respondWithResult(_0x19d676,null))[_0xf326('0xc')](handleError(_0x19d676,null));};};exports[_0xf326('0x73')]=function(_0x486e64,_0xa8e05b){var _0x2e2103,_0x49c3da;if(_[_0xf326('0x12')](_0x486e64['body'][_0xf326('0x74')])){throw new Error(_0xf326('0x75'));}var _0x16bc97=_0x486e64[_0xf326('0x1e')][_0xf326('0x74')];var _0x3097cf=_[_0xf326('0x5f')](_0x16bc97);var _0x1eb29d=_0x16bc97===_0xf326('0x60')?_0xf326('0x61'):_0xf326('0x68');return db[_0xf326('0x76')][_0xf326('0x65')]({'raw':!![],'where':{'id':_0x486e64[_0xf326('0x17')]['id'],'role':'agent'}})[_0xf326('0x8')](function(_0xdb6e40){if(_[_0xf326('0x12')](_0xdb6e40)){throw new Error(_0xf326('0x77'));}_0x2e2103=_0xdb6e40;return db[_0x3097cf+_0xf326('0x64')]['findOne']({'where':{'id':_0x486e64[_0xf326('0x1e')][_0xf326('0x66')]},'include':[{'model':db[_0x3097cf+_0xf326('0x67')],'as':_0xf326('0x67')},{'model':db[_0x3097cf+_0x1eb29d],'as':_0xf326('0x68')}]});})['then'](function(_0x4b6ec0){if(_[_0xf326('0x12')](_0x4b6ec0)){throw new Error(_0x3097cf+'\x20Message\x20not\x20found');}_0x49c3da=_0x4b6ec0;return _0x4b6ec0[_0xf326('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf326('0x8')](function(){var _0x29610a={'uniqueid':_0x16bc97+'.'+_0x49c3da['id']+'.'+_0x49c3da['Interaction']['id'],'FromUserId':_0x486e64['user']['id'],'type':_0xf326('0x6b'),'ToUserId':_0x2e2103['id']};_0x29610a[_0x3097cf+_0xf326('0x78')]=_0x49c3da['id'];_0x29610a[_0x3097cf+_0xf326('0x6c')]=_0x49c3da[_0xf326('0x67')]['id'];_0x29610a[_0xf326('0x79')+_0x3097cf+_0x1eb29d+'Id']=_0x49c3da['Account']['id'];return db[_0x3097cf+_0xf326('0x6e')][_0xf326('0x6f')](_0x29610a);})[_0xf326('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x16bc97,'interaction':_0x49c3da['Interaction'],'message':_0x49c3da,'account':_0x49c3da['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf326('0x36'),'appdata':_0x2e2103[_0xf326('0x10')]+','+(_0x49c3da[_0xf326('0x68')][_0xf326('0x7a')]||0x12c),'interval':_0xf326('0x72')}]},routingClient);})[_0xf326('0x8')](respondWithResult(_0xa8e05b,null))[_0xf326('0xc')](handleError(_0xa8e05b,null));};
\ No newline at end of file
+var _0x8ef6=['name','send','isNil','find','rows','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','INTERACTION','agent','internal','AgentCapacity','telephones','trunks','Trunks','campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','queue_id','value','filter','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','TransferReport','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','catch','status','sendStatus','stack'];(function(_0x479165,_0x564ae8){var _0x164ef7=function(_0x5c6107){while(--_0x5c6107){_0x479165['push'](_0x479165['shift']());}};_0x164ef7(++_0x564ae8);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3cfaa6,_0x29def0){_0x3cfaa6=_0x3cfaa6-0x0;var _0x3feecd=_0x8ef6[_0x3cfaa6];return _0x3feecd;};'use strict';var BPromise=require(_0x68ef('0x0'));var moment=require(_0x68ef('0x1'));var _=require(_0x68ef('0x2'));var util=require(_0x68ef('0x3'));var db=require(_0x68ef('0x4'))['db'];var logger=require(_0x68ef('0x5'))(_0x68ef('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x68ef('0x7')][_0x68ef('0x8')]({'port':0x232a});var mailClient=jayson[_0x68ef('0x7')][_0x68ef('0x8')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){var _0x31007e=_0x2de776?_0x2de776:amiClient;return _0x31007e[_0x68ef('0x9')](_0x3c2ff3,_0x4740e8)[_0x68ef('0xa')](function(_0x112b18){if(_0x112b18[_0x68ef('0xb')]){if(_0x112b18[_0x68ef('0xb')][_0x68ef('0xc')]===0x1f4){return _0x228967(_0x112b18[_0x68ef('0xb')][_0x68ef('0xd')]);}return _0x4eb5eb(_0x112b18[_0x68ef('0xb')][_0x68ef('0xd')]);}else{_0x4eb5eb(_0x112b18['result']);}})[_0x68ef('0xe')](function(_0x46356f){_0x228967(_0x46356f);});});}function respondWithResult(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xc8;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0xf')](_0x454ef4)['json'](_0x40f253);}return _0x1e117a[_0x68ef('0x10')](0x194);};}function handleError(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0x1f4;return function(_0x47fbb5){logger[_0x68ef('0xb')](_0x47fbb5[_0x68ef('0x11')]);if(_0x47fbb5[_0x68ef('0x12')]){delete _0x47fbb5['name'];}_0xc50cce[_0x68ef('0xf')](_0x2657c5)[_0x68ef('0x13')](_0x47fbb5);};}function findById(_0x3d1e90){return function(_0x3780a4){if(!_['isNil'](_0x3d1e90)&&!_[_0x68ef('0x14')](_0x3780a4)&&!_['isNil'](_0x3780a4['rows'])){return _[_0x68ef('0x15')](_0x3780a4[_0x68ef('0x16')],function(_0x4ade0d){return _0x4ade0d['id']==_0x3d1e90;});}return null;};}exports['voiceChannels']=function(_0x3c4c1f,_0x2cd92c){return respondWithRpcPromise(_0x68ef('0x17'),_0x3c4c1f['query'])[_0x68ef('0xa')](respondWithResult(_0x2cd92c,null))[_0x68ef('0xe')](handleError(_0x2cd92c,null));};exports[_0x68ef('0x18')]=function(_0x5b246b,_0x3c46d4){return respondWithRpcPromise(_0x68ef('0x19'),_['merge'](_0x5b246b[_0x68ef('0x1a')],_0x5b246b[_0x68ef('0x1b')]))[_0x68ef('0xa')](respondWithResult(_0x3c46d4,null))['catch'](handleError(_0x3c46d4,null));};exports['voiceChannelStopMixMonitor']=function(_0x59bebc,_0x26018d){return respondWithRpcPromise(_0x68ef('0x1c'),_[_0x68ef('0x1d')](_0x59bebc[_0x68ef('0x1a')],_0x59bebc[_0x68ef('0x1b')]))[_0x68ef('0xa')](respondWithResult(_0x26018d,null))[_0x68ef('0xe')](handleError(_0x26018d,null));};exports[_0x68ef('0x1e')]=function(_0x65fd09,_0x13280b){return respondWithRpcPromise('VoiceQueues',_0x65fd09[_0x68ef('0x1a')])['then'](respondWithResult(_0x13280b,null))['catch'](handleError(_0x13280b,null));};exports['showVoiceQueues']=function(_0x1a7ce1,_0x268f32){return respondWithRpcPromise(_0x68ef('0x1f'),_0x1a7ce1[_0x68ef('0x1a')])['then'](findById(_0x1a7ce1['params']['id']))[_0x68ef('0xa')](respondWithResult(_0x268f32,null))[_0x68ef('0xe')](handleError(_0x268f32,null));};exports[_0x68ef('0x20')]=function(_0x263b30,_0x22ef25){return respondWithRpcPromise(_0x68ef('0x21'),_[_0x68ef('0x1d')](_0x263b30[_0x68ef('0x22')],_0x263b30['params']))[_0x68ef('0xa')](respondWithResult(_0x22ef25,null))[_0x68ef('0xe')](handleError(_0x22ef25,null));};exports[_0x68ef('0x23')]=function(_0x4c25aa,_0x370a8f){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x68ef('0x1d')](_0x4c25aa[_0x68ef('0x1a')],_0x4c25aa['params']))['then'](respondWithResult(_0x370a8f,null))[_0x68ef('0xe')](handleError(_0x370a8f,null));};exports[_0x68ef('0x24')]=function(_0x4b8fc8,_0xf58fa1){return respondWithRpcPromise(_0x68ef('0x25'),_0x4b8fc8[_0x68ef('0x1a')])[_0x68ef('0xa')](respondWithResult(_0xf58fa1,null))['catch'](handleError(_0xf58fa1,null));};exports[_0x68ef('0x26')]=function(_0x1d69ac,_0x5f137b){return respondWithRpcPromise(_0x68ef('0x27'),_['merge'](_0x1d69ac[_0x68ef('0x1a')],_0x1d69ac[_0x68ef('0x1b')]))['then'](respondWithResult(_0x5f137b,null))[_0x68ef('0xe')](handleError(_0x5f137b,null));};exports['voiceQueuesChannelHangup']=function(_0x38c2f8,_0x575f43){return respondWithRpcPromise(_0x68ef('0x28'),_[_0x68ef('0x1d')](_0x38c2f8[_0x68ef('0x1a')],_0x38c2f8['params']))[_0x68ef('0xa')](respondWithResult(_0x575f43,null))['catch'](handleError(_0x575f43,null));};exports[_0x68ef('0x29')]=function(_0x4c9506,_0x474ffa){return respondWithRpcPromise(_0x68ef('0x2a'),_[_0x68ef('0x1d')](_0x4c9506[_0x68ef('0x1a')],_0x4c9506[_0x68ef('0x1b')]))[_0x68ef('0xa')](respondWithResult(_0x474ffa,null))['catch'](handleError(_0x474ffa,null));};exports[_0x68ef('0x2b')]=function(_0x15a6ab,_0x32074a){return respondWithRpcPromise('Outbound',_0x15a6ab[_0x68ef('0x1a')])[_0x68ef('0xa')](respondWithResult(_0x32074a,null))[_0x68ef('0xe')](handleError(_0x32074a,null));};exports['outboundChannels']=function(_0x49f260,_0x14f0fc){return respondWithRpcPromise(_0x68ef('0x2c'),_0x49f260[_0x68ef('0x1a')])[_0x68ef('0xa')](respondWithResult(_0x14f0fc,null))[_0x68ef('0xe')](handleError(_0x14f0fc,null));};exports[_0x68ef('0x2d')]=function(_0x41ffe0,_0x5b1246){var _0xaf7df1;return respondWithRpcPromise(_0x68ef('0x2e'),_0x41ffe0[_0x68ef('0x1a')])[_0x68ef('0xa')](function(_0x492b74){_0xaf7df1=_0x492b74;return respondWithRpcPromise(_0x68ef('0x2e'),_0x41ffe0[_0x68ef('0x1a')],routingClient);})[_0x68ef('0xa')](function(_0x410c10){return _[_0x68ef('0x1d')]({},_0x410c10,_0xaf7df1);})[_0x68ef('0xa')](respondWithResult(_0x5b1246,null))['catch'](handleError(_0x5b1246,null));};exports[_0x68ef('0x2f')]=function(_0x3f7699,_0xf5010c){if(_0x3f7699[_0x68ef('0x22')]&&_0x3f7699[_0x68ef('0x22')][_0x68ef('0x30')]&&_0x3f7699[_0x68ef('0x31')]&&_0x3f7699[_0x68ef('0x31')][_0x68ef('0x12')]){for(var _0x531096 in _0x3f7699[_0x68ef('0x22')][_0x68ef('0x30')]){if(_0x3f7699[_0x68ef('0x22')][_0x68ef('0x30')][_0x68ef('0x32')](_0x531096)){db[_0x68ef('0x33')][_0x68ef('0x34')]({'where':{'channel':_0x531096,'membername':_0x3f7699['user'][_0x68ef('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3f7699[_0x68ef('0x22')][_0x68ef('0x30')][_0x531096]&&_0x3f7699[_0x68ef('0x22')][_0x68ef('0x30')][_0x531096]['length']?{'$notIn':_0x3f7699[_0x68ef('0x22')]['interaction'][_0x531096]}:{'$ne':null}}})[_0x68ef('0xa')](function(_0x499423){var _0x227e36=moment()[_0x68ef('0x35')](_0x68ef('0x36'));for(var _0x5c4a66=0x0,_0x59b148=_0x499423[_0x68ef('0x37')];_0x5c4a66<_0x59b148;_0x5c4a66+=0x1){_0x499423[_0x5c4a66][_0x68ef('0x38')]({'exitAt':_0x227e36});}});for(var _0x58d72a=0x0;_0x58d72a<_0x3f7699['body']['interaction'][_0x531096][_0x68ef('0x37')];_0x58d72a+=0x1){db[_0x68ef('0x33')][_0x68ef('0x39')]({'where':{'channel':_0x531096,'membername':_0x3f7699[_0x68ef('0x31')][_0x68ef('0x12')],'type':'INTERACTION','uniqueid':_0x3f7699['body'][_0x68ef('0x30')][_0x531096][_0x58d72a],'exitAt':null},'defaults':{'channel':_0x531096,'membername':_0x3f7699[_0x68ef('0x31')][_0x68ef('0x12')],'interface':_[_0x68ef('0x14')](_0x3f7699['user'][_0x68ef('0x3a')])?util[_0x68ef('0x35')](_0x68ef('0x3b'),_0x3f7699[_0x68ef('0x31')]['name']):_0x3f7699['user'][_0x68ef('0x3a')],'type':_0x68ef('0x3c'),'enterAt':moment()['format'](_0x68ef('0x36')),'role':_0x68ef('0x3d'),'internal':_0x3f7699[_0x68ef('0x31')][_0x68ef('0x3e')],'uniqueid':_0x3f7699[_0x68ef('0x22')]['interaction'][_0x531096][_0x58d72a]}});}}}}return respondWithRpcPromise(_0x68ef('0x3f'),{'id':_0x3f7699[_0x68ef('0x1b')]['id'],'capacity':_0x3f7699[_0x68ef('0x22')]['capacity']},routingClient)[_0x68ef('0xa')](respondWithResult(_0xf5010c,null))[_0x68ef('0xe')](handleError(_0xf5010c,null));};exports[_0x68ef('0x40')]=function(_0x50ef1f,_0x7dce90){return respondWithRpcPromise('Telephones',_0x50ef1f['query'])[_0x68ef('0xa')](respondWithResult(_0x7dce90,null))['catch'](handleError(_0x7dce90,null));};exports[_0x68ef('0x41')]=function(_0xb33afd,_0x53ebd){return respondWithRpcPromise(_0x68ef('0x42'),_0xb33afd[_0x68ef('0x1a')])[_0x68ef('0xa')](respondWithResult(_0x53ebd,null))[_0x68ef('0xe')](handleError(_0x53ebd,null));};exports[_0x68ef('0x43')]=function(_0x2b35f4,_0x247915){return respondWithRpcPromise('Campaigns',_0x2b35f4['query'])[_0x68ef('0xa')](respondWithResult(_0x247915,null))[_0x68ef('0xe')](handleError(_0x247915,null));};exports[_0x68ef('0x44')]=function(_0xdc83f4,_0x82df12){return respondWithRpcPromise(_0x68ef('0x45'),_0xdc83f4[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0x82df12,null))[_0x68ef('0xe')](handleError(_0x82df12,null));};exports['showChatQueues']=function(_0x5685bb,_0x42a4b2){return respondWithRpcPromise('ChatQueues',_0x5685bb[_0x68ef('0x1a')],routingClient)['then'](findById(_0x5685bb[_0x68ef('0x1b')]['id']))[_0x68ef('0xa')](respondWithResult(_0x42a4b2,null))['catch'](handleError(_0x42a4b2,null));};exports[_0x68ef('0x46')]=function(_0x4e097e,_0x407c6d){return respondWithRpcPromise(_0x68ef('0x47'),_0x4e097e[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0x407c6d,null))[_0x68ef('0xe')](handleError(_0x407c6d,null));};exports[_0x68ef('0x48')]=function(_0x5c347c,_0x1cdaef){return respondWithRpcPromise(_0x68ef('0x47'),_0x5c347c[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](findById(_0x5c347c[_0x68ef('0x1b')]['id']))[_0x68ef('0xa')](respondWithResult(_0x1cdaef,null))['catch'](handleError(_0x1cdaef,null));};exports[_0x68ef('0x49')]=function(_0x42d2a3,_0x4886af){return respondWithRpcPromise(_0x68ef('0x4a'),_0x42d2a3[_0x68ef('0x1a')],mailClient)[_0x68ef('0xa')](respondWithResult(_0x4886af,null))['catch'](handleError(_0x4886af,null));};exports[_0x68ef('0x4b')]=function(_0x49d197,_0x5412ea){return respondWithRpcPromise(_0x68ef('0x4c'),_0x49d197['query'],routingClient)[_0x68ef('0xa')](respondWithResult(_0x5412ea,null))['catch'](handleError(_0x5412ea,null));};exports[_0x68ef('0x4d')]=function(_0x9e8554,_0x304405){return respondWithRpcPromise(_0x68ef('0x4c'),_0x9e8554[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](findById(_0x9e8554['params']['id']))[_0x68ef('0xa')](respondWithResult(_0x304405,null))['catch'](handleError(_0x304405,null));};exports[_0x68ef('0x4e')]=function(_0x4b0c3e,_0x2f97c5){return respondWithRpcPromise(_0x68ef('0x4f'),_0x4b0c3e[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0x2f97c5,null))[_0x68ef('0xe')](handleError(_0x2f97c5,null));};exports[_0x68ef('0x50')]=function(_0x1be626,_0x52d29a){return respondWithRpcPromise(_0x68ef('0x4f'),_0x1be626[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](findById(_0x1be626[_0x68ef('0x1b')]['id']))[_0x68ef('0xa')](respondWithResult(_0x52d29a,null))['catch'](handleError(_0x52d29a,null));};exports[_0x68ef('0x51')]=function(_0x561e8d,_0x1ed172){return respondWithRpcPromise('WhatsappQueues',_0x561e8d['query'],routingClient)[_0x68ef('0xa')](respondWithResult(_0x1ed172,null))[_0x68ef('0xe')](handleError(_0x1ed172,null));};exports[_0x68ef('0x52')]=function(_0x21b2ce,_0x51f905){return respondWithRpcPromise(_0x68ef('0x53'),_0x21b2ce['query'],routingClient)[_0x68ef('0xa')](findById(_0x21b2ce[_0x68ef('0x1b')]['id']))[_0x68ef('0xa')](respondWithResult(_0x51f905,null))['catch'](handleError(_0x51f905,null));};exports['faxQueues']=function(_0x3e74d2,_0x1092f8){return respondWithRpcPromise(_0x68ef('0x54'),_0x3e74d2[_0x68ef('0x1a')],routingClient)['then'](respondWithResult(_0x1092f8,null))[_0x68ef('0xe')](handleError(_0x1092f8,null));};exports[_0x68ef('0x55')]=function(_0x19c20f,_0x21b104){return respondWithRpcPromise('FaxQueues',_0x19c20f[_0x68ef('0x1a')],routingClient)['then'](findById(_0x19c20f[_0x68ef('0x1b')]['id']))[_0x68ef('0xa')](respondWithResult(_0x21b104,null))[_0x68ef('0xe')](handleError(_0x21b104,null));};exports[_0x68ef('0x56')]=function(_0xed16d1,_0x52cb2a){return respondWithRpcPromise(_0x68ef('0x57'),_0xed16d1[_0x68ef('0x1a')])[_0x68ef('0xa')](respondWithResult(_0x52cb2a,null))['catch'](handleError(_0x52cb2a,null));};exports[_0x68ef('0x58')]=function(_0x4de108,_0x69b1c){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4de108['query'],routingClient)[_0x68ef('0xa')](respondWithResult(_0x69b1c,null))[_0x68ef('0xe')](handleError(_0x69b1c,null));};exports[_0x68ef('0x59')]=function(_0x405971,_0x501004){return respondWithRpcPromise(_0x68ef('0x5a'),_0x405971[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0x501004,null))['catch'](handleError(_0x501004,null));};exports[_0x68ef('0x5b')]=function(_0x2db826,_0xea2a81){return respondWithRpcPromise(_0x68ef('0x5c'),_0x2db826[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0xea2a81,null))[_0x68ef('0xe')](handleError(_0xea2a81,null));};exports[_0x68ef('0x5d')]=function(_0x156ce3,_0x11feff){return respondWithRpcPromise(_0x68ef('0x5c'),_0x156ce3[_0x68ef('0x1a')],routingClient)['then'](function(_0x15378c){if(_0x156ce3[_0x68ef('0x1a')]['type']!==undefined){var _0x513c69=_(_0x15378c[_0x68ef('0x16')])['filter']([_0x156ce3[_0x68ef('0x1a')][_0x68ef('0x5e')],_0x156ce3['params']['id']])['map'](_0x68ef('0x5f'))['uniq']()[_0x68ef('0x60')]();return _0x15378c['rows'][_0x68ef('0x61')](function(_0x4f425f){return _0x513c69[_0x68ef('0x62')](_0x4f425f[_0x68ef('0x5f')])>-0x1;});}else{return _0x15378c['rows'][_0x68ef('0x61')](function(_0x357be7){return _0x357be7[_0x68ef('0x5f')]===parseInt(_0x156ce3[_0x68ef('0x1b')]['id']);});}})['then'](respondWithResult(_0x11feff,null))[_0x68ef('0xe')](handleError(_0x11feff,null));};exports[_0x68ef('0x63')]=function(_0x5b2e89,_0x3bb3b6){return respondWithRpcPromise(_0x68ef('0x64'),_0x5b2e89[_0x68ef('0x1a')],routingClient)['then'](respondWithResult(_0x3bb3b6,null))[_0x68ef('0xe')](handleError(_0x3bb3b6,null));};exports['whatsappQueuesWaitingInteractions']=function(_0xe6bf05,_0x36c109){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0xe6bf05['query'],routingClient)['then'](respondWithResult(_0x36c109,null))['catch'](handleError(_0x36c109,null));};exports[_0x68ef('0x65')]=function(_0x28ad22,_0x1217f9){return respondWithRpcPromise(_0x68ef('0x66'),_0x28ad22[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0x1217f9,null))[_0x68ef('0xe')](handleError(_0x1217f9,null));};exports[_0x68ef('0x67')]=function(_0x24ba34){return function(_0x3ae3e9,_0x17892c){var _0x108223,_0x717d7b;var _0x4bd5c3=_[_0x68ef('0x68')](_0x24ba34);var _0x556dfc=_0x24ba34===_0x68ef('0x69')?'Website':'Account';return db[_0x4bd5c3+_0x68ef('0x6a')][_0x68ef('0x6b')]({'raw':!![],'where':{'id':_0x3ae3e9[_0x68ef('0x1b')]['id']}})[_0x68ef('0xa')](function(_0x518c9a){if(_['isNil'](_0x518c9a)){throw new Error(_0x4bd5c3+_0x68ef('0x6c'));}_0x108223=_0x518c9a;return db[_0x4bd5c3+_0x68ef('0x6d')][_0x68ef('0x6b')]({'where':{'id':_0x3ae3e9['body'][_0x68ef('0x6e')]},'include':[{'model':db[_0x4bd5c3+_0x68ef('0x6f')],'as':_0x68ef('0x6f')},{'model':db[_0x4bd5c3+_0x556dfc],'as':_0x68ef('0x70')}]});})['then'](function(_0x214e89){if(_[_0x68ef('0x14')](_0x214e89)){throw new Error(_0x4bd5c3+_0x68ef('0x71'));}_0x717d7b=_0x214e89;return _0x214e89[_0x68ef('0x72')]({'read':0x0,'readAt':null,'UserId':null});})[_0x68ef('0xa')](function(){var _0x346049={'uniqueid':_0x24ba34+'.'+_0x717d7b['id']+'.'+_0x717d7b['Interaction']['id'],'FromUserId':_0x3ae3e9[_0x68ef('0x31')]['id'],'type':'queue'};_0x346049[_0x4bd5c3+_0x68ef('0x73')]=_0x717d7b['id'];_0x346049[_0x4bd5c3+_0x68ef('0x74')]=_0x717d7b[_0x68ef('0x6f')]['id'];_0x346049[_0x68ef('0x75')+_0x4bd5c3+_0x556dfc+'Id']=_0x717d7b['Account']['id'];_0x346049['To'+_0x4bd5c3+_0x68ef('0x76')]=_0x108223['id'];return db[_0x4bd5c3+'TransferReport'][_0x68ef('0x77')](_0x346049);})[_0x68ef('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x24ba34,'interaction':_0x717d7b['Interaction'],'message':_0x717d7b,'account':_0x717d7b[_0x68ef('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x108223[_0x68ef('0x12')]+','+(_0x717d7b['Account'][_0x68ef('0x78')]||0x12c),'interval':_0x68ef('0x79')}]},routingClient);})[_0x68ef('0xa')](respondWithResult(_0x17892c,null))[_0x68ef('0xe')](handleError(_0x17892c,null));};};exports[_0x68ef('0x7a')]=function(_0x66a7a8,_0x51b8db){var _0x17d014,_0x463356;if(_[_0x68ef('0x14')](_0x66a7a8[_0x68ef('0x22')][_0x68ef('0x7b')])){throw new Error(_0x68ef('0x7c'));}var _0x303add=_0x66a7a8['body'][_0x68ef('0x7b')];var _0x373ab4=_[_0x68ef('0x68')](_0x303add);var _0x2e20aa=_0x303add===_0x68ef('0x69')?_0x68ef('0x7d'):_0x68ef('0x70');return db[_0x68ef('0x7e')][_0x68ef('0x6b')]({'raw':!![],'where':{'id':_0x66a7a8['params']['id'],'role':_0x68ef('0x3d')}})['then'](function(_0x5f3b79){if(_['isNil'](_0x5f3b79)){throw new Error(_0x68ef('0x7f'));}_0x17d014=_0x5f3b79;return db[_0x373ab4+_0x68ef('0x6d')][_0x68ef('0x6b')]({'where':{'id':_0x66a7a8['body']['messageId']},'include':[{'model':db[_0x373ab4+'Interaction'],'as':_0x68ef('0x6f')},{'model':db[_0x373ab4+_0x2e20aa],'as':_0x68ef('0x70')}]});})[_0x68ef('0xa')](function(_0x40996e){if(_[_0x68ef('0x14')](_0x40996e)){throw new Error(_0x373ab4+_0x68ef('0x71'));}_0x463356=_0x40996e;return _0x40996e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x68ef('0xa')](function(){var _0x2c7f18={'uniqueid':_0x303add+'.'+_0x463356['id']+'.'+_0x463356[_0x68ef('0x6f')]['id'],'FromUserId':_0x66a7a8[_0x68ef('0x31')]['id'],'type':'queue','ToUserId':_0x17d014['id']};_0x2c7f18[_0x373ab4+_0x68ef('0x73')]=_0x463356['id'];_0x2c7f18[_0x373ab4+_0x68ef('0x74')]=_0x463356[_0x68ef('0x6f')]['id'];_0x2c7f18[_0x68ef('0x75')+_0x373ab4+_0x2e20aa+'Id']=_0x463356[_0x68ef('0x70')]['id'];return db[_0x373ab4+_0x68ef('0x80')][_0x68ef('0x77')](_0x2c7f18);})[_0x68ef('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x303add,'interaction':_0x463356[_0x68ef('0x6f')],'message':_0x463356,'account':_0x463356[_0x68ef('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x17d014[_0x68ef('0x12')]+','+(_0x463356[_0x68ef('0x70')][_0x68ef('0x81')]||0x12c),'interval':_0x68ef('0x79')}]},routingClient);})[_0x68ef('0xa')](respondWithResult(_0x51b8db,null))[_0x68ef('0xe')](handleError(_0x51b8db,null));};
\ No newline at end of file
index d44a2f5..4f429d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70ce=['../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','run','post','create','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x70ce,0xfd));var _0xe70c=function(_0x444990,_0x44196a){_0x444990=_0x444990-0x0;var _0x4b99de=_0x70ce[_0x444990];return _0x4b99de;};'use strict';var multer=require(_0xe70c('0x0'));var util=require('util');var path=require(_0xe70c('0x1'));var timeout=require(_0xe70c('0x2'));var express=require(_0xe70c('0x3'));var router=express[_0xe70c('0x4')]();var fs_extra=require(_0xe70c('0x5'));var auth=require(_0xe70c('0x6'));var interaction=require(_0xe70c('0x7'));var config=require(_0xe70c('0x8'));var controller=require(_0xe70c('0x9'));router['get']('/',auth[_0xe70c('0xa')](),controller[_0xe70c('0xb')]);router[_0xe70c('0xc')](_0xe70c('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/run',auth[_0xe70c('0xa')](),controller[_0xe70c('0xe')]);router[_0xe70c('0xf')]('/',auth['isAuthenticated'](),controller[_0xe70c('0x10')]);router[_0xe70c('0x11')](_0xe70c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe70c('0x12')](_0xe70c('0xd'),auth[_0xe70c('0xa')](),controller['destroy']);module[_0xe70c('0x13')]=router;
\ No newline at end of file
+var _0x2f12=['./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','run','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x42a1c3,_0x5a3a31){var _0x281400=function(_0x1f3297){while(--_0x1f3297){_0x42a1c3['push'](_0x42a1c3['shift']());}};_0x281400(++_0x5a3a31);}(_0x2f12,0x7b));var _0x22f1=function(_0x42808a,_0x4f2c57){_0x42808a=_0x42808a-0x0;var _0x359a5a=_0x2f12[_0x42808a];return _0x359a5a;};'use strict';var multer=require(_0x22f1('0x0'));var util=require(_0x22f1('0x1'));var path=require(_0x22f1('0x2'));var timeout=require(_0x22f1('0x3'));var express=require(_0x22f1('0x4'));var router=express[_0x22f1('0x5')]();var fs_extra=require(_0x22f1('0x6'));var auth=require(_0x22f1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x22f1('0x8'));var controller=require(_0x22f1('0x9'));router[_0x22f1('0xa')]('/',auth[_0x22f1('0xb')](),controller[_0x22f1('0xc')]);router[_0x22f1('0xa')](_0x22f1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x22f1('0xa')](_0x22f1('0xe'),auth['isAuthenticated'](),controller[_0x22f1('0xf')]);router[_0x22f1('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x22f1('0x11')](_0x22f1('0xd'),auth[_0x22f1('0xb')](),controller[_0x22f1('0x12')]);router[_0x22f1('0x13')]('/:id',auth[_0x22f1('0xb')](),controller[_0x22f1('0x14')]);module[_0x22f1('0x15')]=router;
\ No newline at end of file
index ed915bc..eb1c757 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5623=['pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','hours','minutes','days','ENUM','csv'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x5623,0xb0));var _0x3562=function(_0x259adc,_0x5defdc){_0x259adc=_0x259adc-0x0;var _0x1c3225=_0x5623[_0x259adc];return _0x1c3225;};'use strict';var Sequelize=require(_0x3562('0x0'));module[_0x3562('0x1')]={'name':{'type':Sequelize[_0x3562('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3562('0x2')]},'active':{'type':Sequelize[_0x3562('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3562('0x2')],'allowNull':![],'defaultValue':_0x3562('0x4')},'startAt':{'type':Sequelize[_0x3562('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x3562('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x3562('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x3562('0x7'),_0x3562('0x8'),'months','weeks','days',_0x3562('0x9'),_0x3562('0xa')),'allowNull':![],'defaultValue':_0x3562('0xb')},'output':{'type':Sequelize[_0x3562('0xc')](_0x3562('0xd'),_0x3562('0xe'),_0x3562('0xf')),'allowNull':![],'defaultValue':_0x3562('0xd')},'type':{'type':Sequelize[_0x3562('0xc')](_0x3562('0x10'),_0x3562('0x11')),'allowNull':![],'defaultValue':_0x3562('0x10')},'sendMail':{'type':Sequelize[_0x3562('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x3562('0x2')]},'cc':{'type':Sequelize[_0x3562('0x12')]},'bcc':{'type':Sequelize[_0x3562('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x3562('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xae0a=['0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','weeks','hours','minutes','days','pdf','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN'];(function(_0x9d984a,_0x8fe6a2){var _0x235095=function(_0x29da6c){while(--_0x29da6c){_0x9d984a['push'](_0x9d984a['shift']());}};_0x235095(++_0x8fe6a2);}(_0xae0a,0x195));var _0xaae0=function(_0x3a872e,_0x277a40){_0x3a872e=_0x3a872e-0x0;var _0x25dc1f=_0xae0a[_0x3a872e];return _0x25dc1f;};'use strict';var Sequelize=require('sequelize');module[_0xaae0('0x0')]={'name':{'type':Sequelize[_0xaae0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xaae0('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xaae0('0x1')],'allowNull':![],'defaultValue':_0xaae0('0x3')},'startAt':{'type':Sequelize[_0xaae0('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xaae0('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xaae0('0x5')](_0xaae0('0x6'),_0xaae0('0x7'),'months',_0xaae0('0x8'),'days',_0xaae0('0x9'),_0xaae0('0xa')),'allowNull':![],'defaultValue':_0xaae0('0xb')},'output':{'type':Sequelize[_0xaae0('0x5')]('csv',_0xaae0('0xc'),_0xaae0('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xaae0('0x5')](_0xaae0('0xe'),_0xaae0('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xaae0('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xaae0('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xaae0('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 8e32867..af99b8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2be1=['eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','end','stack','send','map','Schedule','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','rows','keys','options','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','create','catch','params','run','../../config/schedule'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x2be1,0x144));var _0x12be=function(_0x47b0d9,_0x41b561){_0x47b0d9=_0x47b0d9-0x0;var _0x599df3=_0x2be1[_0x47b0d9];return _0x599df3;};'use strict';var emlformat=require(_0x12be('0x0'));var rimraf=require(_0x12be('0x1'));var zipdir=require(_0x12be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x12be('0x3'));var BPromise=require(_0x12be('0x4'));var Mustache=require(_0x12be('0x5'));var util=require('util');var path=require(_0x12be('0x6'));var sox=require(_0x12be('0x7'));var csv=require('to-csv');var ejs=require(_0x12be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12be('0x9'));var squel=require(_0x12be('0xa'));var crypto=require(_0x12be('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x12be('0xc'));var toCsv=require('to-csv');var querystring=require(_0x12be('0xd'));var Papa=require(_0x12be('0xe'));var Redis=require(_0x12be('0xf'));var authService=require(_0x12be('0x10'));var qs=require(_0x12be('0x11'));var as=require(_0x12be('0x12'));var hardwareService=require(_0x12be('0x13'));var logger=require(_0x12be('0x14'))(_0x12be('0x15'));var utils=require(_0x12be('0x16'));var config=require(_0x12be('0x17'));var licenseUtil=require(_0x12be('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d7be4,_0x1608d2){_0x1608d2=_0x1608d2||0xcc;return function(_0x423010){if(_0x423010){return _0x3d7be4['sendStatus'](_0x1608d2);}return _0x3d7be4[_0x12be('0x19')](_0x1608d2)['end']();};}function respondWithResult(_0x3784f1,_0x1d9920){_0x1d9920=_0x1d9920||0xc8;return function(_0x3e01b3){if(_0x3e01b3){return _0x3784f1['status'](_0x1d9920)[_0x12be('0x1a')](_0x3e01b3);}};}function respondWithFilteredResult(_0x128845,_0x4c5df7){return function(_0x8fc2b3){if(_0x8fc2b3){var _0x57495d=typeof _0x4c5df7[_0x12be('0x1b')]==='undefined'&&typeof _0x4c5df7['limit']==='undefined';var _0x536d0f=_0x8fc2b3[_0x12be('0x1c')];var _0x1b56b8=_0x57495d?0x0:_0x4c5df7[_0x12be('0x1b')];var _0x7bd56a=_0x57495d?_0x8fc2b3[_0x12be('0x1c')]:_0x4c5df7[_0x12be('0x1b')]+_0x4c5df7[_0x12be('0x1d')];var _0xe00682;if(_0x7bd56a>=_0x536d0f){_0x7bd56a=_0x536d0f;_0xe00682=0xc8;}else{_0xe00682=0xce;}_0x128845[_0x12be('0x19')](_0xe00682);return _0x128845[_0x12be('0x1e')](_0x12be('0x1f'),_0x1b56b8+'-'+_0x7bd56a+'/'+_0x536d0f)['json'](_0x8fc2b3);}return null;};}function patchUpdates(_0x4daabe){return function(_0x4e3ab6){try{jsonpatch[_0x12be('0x20')](_0x4e3ab6,_0x4daabe,!![]);}catch(_0x4b34ee){return BPromise[_0x12be('0x21')](_0x4b34ee);}return _0x4e3ab6[_0x12be('0x22')]();};}function saveUpdates(_0x1b63ff,_0x5b2b97){return function(_0x370a3a){if(_0x370a3a){return _0x370a3a[_0x12be('0x23')](_0x1b63ff)[_0x12be('0x24')](function(_0x412707){return _0x412707;});}return null;};}function removeEntity(_0x4dab21,_0x404c5c){return function(_0x50dff8){if(_0x50dff8){return _0x50dff8[_0x12be('0x25')]()[_0x12be('0x24')](function(){var _0x12f1b4=_0x50dff8[_0x12be('0x26')]({'plain':!![]});var _0x111ade=_0x12be('0x27');return db[_0x12be('0x28')][_0x12be('0x25')]({'where':{'type':_0x111ade,'resourceId':_0x12f1b4['id']}})[_0x12be('0x24')](function(){return _0x50dff8;});})['then'](function(){_0x4dab21[_0x12be('0x19')](0xcc)[_0x12be('0x29')]();});}};}function handleEntityNotFound(_0x3ee638,_0x1c1bbe){return function(_0x46a374){if(!_0x46a374){_0x3ee638['sendStatus'](0x194);}return _0x46a374;};}function handleError(_0x4650db,_0x560816){_0x560816=_0x560816||0x1f4;return function(_0x16496a){logger['error'](_0x16496a[_0x12be('0x2a')]);if(_0x16496a['name']){delete _0x16496a['name'];}_0x4650db[_0x12be('0x19')](_0x560816)[_0x12be('0x2b')](_0x16496a);};}exports['index']=function(_0x49fe9a,_0x547e25){var _0x2a096f={},_0x52a205={},_0x2a695a={'count':0x0,'rows':[]};var _0x4af2ee=_[_0x12be('0x2c')](db[_0x12be('0x2d')][_0x12be('0x2e')],function(_0x3a2146){return{'name':_0x3a2146[_0x12be('0x2f')],'type':_0x3a2146[_0x12be('0x30')][_0x12be('0x31')]};});_0x52a205[_0x12be('0x32')]=_['map'](_0x4af2ee,_0x12be('0x33'));_0x52a205[_0x12be('0x34')]=_['keys'](_0x49fe9a[_0x12be('0x34')]);_0x52a205['filters']=_[_0x12be('0x35')](_0x52a205[_0x12be('0x32')],_0x52a205[_0x12be('0x34')]);_0x2a096f[_0x12be('0x36')]=_[_0x12be('0x35')](_0x52a205[_0x12be('0x32')],qs[_0x12be('0x37')](_0x49fe9a[_0x12be('0x34')][_0x12be('0x37')]));_0x2a096f[_0x12be('0x36')]=_0x2a096f[_0x12be('0x36')]['length']?_0x2a096f[_0x12be('0x36')]:_0x52a205[_0x12be('0x32')];if(!_0x49fe9a[_0x12be('0x34')][_0x12be('0x38')](_0x12be('0x39'))){_0x2a096f[_0x12be('0x1d')]=qs[_0x12be('0x1d')](_0x49fe9a[_0x12be('0x34')]['limit']);_0x2a096f['offset']=qs[_0x12be('0x1b')](_0x49fe9a['query'][_0x12be('0x1b')]);}_0x2a096f[_0x12be('0x3a')]=qs[_0x12be('0x3b')](_0x49fe9a[_0x12be('0x34')][_0x12be('0x3b')]);_0x2a096f[_0x12be('0x3c')]=qs[_0x12be('0x3d')](_['pick'](_0x49fe9a[_0x12be('0x34')],_0x52a205[_0x12be('0x3d')]),_0x4af2ee);if(_0x49fe9a[_0x12be('0x34')][_0x12be('0x3e')]){_0x2a096f[_0x12be('0x3c')]=_[_0x12be('0x3f')](_0x2a096f[_0x12be('0x3c')],{'$or':_['map'](_0x4af2ee,function(_0x45bca4){if(_0x45bca4['type']!=='VIRTUAL'){var _0x11b7d2={};_0x11b7d2[_0x45bca4[_0x12be('0x33')]]={'$like':'%'+_0x49fe9a['query']['filter']+'%'};return _0x11b7d2;}})});}_0x2a096f=_[_0x12be('0x3f')]({},_0x2a096f,_0x49fe9a['options']);var _0x444dac={'where':_0x2a096f['where']};return db[_0x12be('0x2d')][_0x12be('0x1c')](_0x444dac)[_0x12be('0x24')](function(_0x194c9b){_0x2a695a['count']=_0x194c9b;if(_0x49fe9a[_0x12be('0x34')][_0x12be('0x40')]){_0x2a096f[_0x12be('0x41')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x2a096f);})[_0x12be('0x24')](function(_0xbacf0){_0x2a695a[_0x12be('0x42')]=_0xbacf0;return _0x2a695a;})[_0x12be('0x24')](respondWithFilteredResult(_0x547e25,_0x2a096f))['catch'](handleError(_0x547e25,null));};exports['show']=function(_0x4d919b,_0x3484d2){var _0x5519c2={'raw':![],'where':{'id':_0x4d919b['params']['id']}},_0x5efca3={};_0x5efca3['model']=_['keys'](db[_0x12be('0x2d')][_0x12be('0x2e')]);_0x5efca3[_0x12be('0x34')]=_[_0x12be('0x43')](_0x4d919b['query']);_0x5efca3[_0x12be('0x3d')]=_[_0x12be('0x35')](_0x5efca3['model'],_0x5efca3[_0x12be('0x34')]);_0x5519c2[_0x12be('0x36')]=_[_0x12be('0x35')](_0x5efca3[_0x12be('0x32')],qs[_0x12be('0x37')](_0x4d919b['query'][_0x12be('0x37')]));_0x5519c2[_0x12be('0x36')]=_0x5519c2[_0x12be('0x36')]['length']?_0x5519c2[_0x12be('0x36')]:_0x5efca3[_0x12be('0x32')];if(_0x4d919b[_0x12be('0x34')][_0x12be('0x40')]){_0x5519c2[_0x12be('0x41')]=[{'all':!![]}];}_0x5519c2=_[_0x12be('0x3f')]({},_0x5519c2,_0x4d919b[_0x12be('0x44')]);return db[_0x12be('0x2d')][_0x12be('0x45')](_0x5519c2)[_0x12be('0x24')](handleEntityNotFound(_0x3484d2,null))[_0x12be('0x24')](respondWithResult(_0x3484d2,null))['catch'](handleError(_0x3484d2,null));};exports['create']=function(_0x30ef48,_0x581f7b){return db[_0x12be('0x2d')]['create'](_0x30ef48[_0x12be('0x46')],{})['then'](function(_0x13d222){var _0x389daa=_0x30ef48[_0x12be('0x47')]['get']({'plain':!![]});if(!_0x389daa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x389daa[_0x12be('0x48')]==='user'){var _0x2e7ad2=_0x13d222[_0x12be('0x26')]({'plain':!![]});var _0x3e765e=_0x12be('0x27');return db[_0x12be('0x49')][_0x12be('0x45')]({'where':{'name':_0x3e765e,'userProfileId':_0x389daa[_0x12be('0x4a')]},'raw':!![]})[_0x12be('0x24')](function(_0xd0d987){if(_0xd0d987&&_0xd0d987[_0x12be('0x4b')]===0x0){return db[_0x12be('0x28')][_0x12be('0x4c')]({'name':_0x2e7ad2[_0x12be('0x33')],'resourceId':_0x2e7ad2['id'],'type':_0xd0d987['name'],'sectionId':_0xd0d987['id']},{})['then'](function(){return _0x13d222;});}else{return _0x13d222;}})[_0x12be('0x4d')](function(_0x37a0e7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37a0e7);throw _0x37a0e7;});}return _0x13d222;})[_0x12be('0x24')](respondWithResult(_0x581f7b,0xc9))[_0x12be('0x4d')](handleError(_0x581f7b,null));};exports[_0x12be('0x23')]=function(_0x46c10b,_0x5d3be8){if(_0x46c10b[_0x12be('0x46')]['id']){delete _0x46c10b[_0x12be('0x46')]['id'];}return db[_0x12be('0x2d')][_0x12be('0x45')]({'where':{'id':_0x46c10b[_0x12be('0x4e')]['id']}})[_0x12be('0x24')](handleEntityNotFound(_0x5d3be8,null))[_0x12be('0x24')](saveUpdates(_0x46c10b[_0x12be('0x46')],null))['then'](respondWithResult(_0x5d3be8,null))['catch'](handleError(_0x5d3be8,null));};exports['destroy']=function(_0x33e0a7,_0x2f0b83){return db[_0x12be('0x2d')][_0x12be('0x45')]({'where':{'id':_0x33e0a7['params']['id']}})[_0x12be('0x24')](handleEntityNotFound(_0x2f0b83,null))[_0x12be('0x24')](removeEntity(_0x2f0b83,null))[_0x12be('0x4d')](handleError(_0x2f0b83,null));};exports[_0x12be('0x4f')]=function(_0x30e0e5,_0x2a73fe,_0x258587){var _0x5acea2=require(_0x12be('0x50'));return db[_0x12be('0x2d')][_0x12be('0x45')]({'where':{'id':_0x30e0e5[_0x12be('0x4e')]['id']},'raw':!![]})[_0x12be('0x24')](handleEntityNotFound(_0x2a73fe,null))['then'](function(){_0x5acea2[_0x12be('0x4f')](_0x30e0e5[_0x12be('0x4e')]['id']);})[_0x12be('0x24')](respondWithStatusCode(_0x2a73fe,null))[_0x12be('0x4d')](handleError(_0x2a73fe,null));};
\ No newline at end of file
+var _0x4dce=['send','index','Schedule','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','update','run','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Scheduler','error','stack','name'];(function(_0x2e534c,_0x17a21c){var _0x3f06a8=function(_0x50a86a){while(--_0x50a86a){_0x2e534c['push'](_0x2e534c['shift']());}};_0x3f06a8(++_0x17a21c);}(_0x4dce,0xdd));var _0xe4dc=function(_0x397bfb,_0x589665){_0x397bfb=_0x397bfb-0x0;var _0x16c9b9=_0x4dce[_0x397bfb];return _0x16c9b9;};'use strict';var emlformat=require(_0xe4dc('0x0'));var rimraf=require(_0xe4dc('0x1'));var zipdir=require(_0xe4dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4dc('0x3'));var moment=require(_0xe4dc('0x4'));var BPromise=require(_0xe4dc('0x5'));var Mustache=require(_0xe4dc('0x6'));var util=require(_0xe4dc('0x7'));var path=require(_0xe4dc('0x8'));var sox=require(_0xe4dc('0x9'));var csv=require(_0xe4dc('0xa'));var ejs=require(_0xe4dc('0xb'));var fs=require('fs');var fs_extra=require(_0xe4dc('0xc'));var _=require(_0xe4dc('0xd'));var squel=require(_0xe4dc('0xe'));var crypto=require(_0xe4dc('0xf'));var jsforce=require(_0xe4dc('0x10'));var deskjs=require(_0xe4dc('0x11'));var toCsv=require(_0xe4dc('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4dc('0x12'));var authService=require(_0xe4dc('0x13'));var qs=require(_0xe4dc('0x14'));var as=require(_0xe4dc('0x15'));var hardwareService=require(_0xe4dc('0x16'));var logger=require(_0xe4dc('0x17'))(_0xe4dc('0x18'));var utils=require(_0xe4dc('0x19'));var config=require(_0xe4dc('0x1a'));var licenseUtil=require(_0xe4dc('0x1b'));var db=require(_0xe4dc('0x1c'))['db'];function respondWithStatusCode(_0x33ecf9,_0x9030cb){_0x9030cb=_0x9030cb||0xcc;return function(_0xb30ad0){if(_0xb30ad0){return _0x33ecf9[_0xe4dc('0x1d')](_0x9030cb);}return _0x33ecf9[_0xe4dc('0x1e')](_0x9030cb)[_0xe4dc('0x1f')]();};}function respondWithResult(_0x29b7e4,_0xc17241){_0xc17241=_0xc17241||0xc8;return function(_0x13e026){if(_0x13e026){return _0x29b7e4[_0xe4dc('0x1e')](_0xc17241)[_0xe4dc('0x20')](_0x13e026);}};}function respondWithFilteredResult(_0x418a15,_0x1a34d1){return function(_0x2db077){if(_0x2db077){var _0x4c2e86=typeof _0x1a34d1[_0xe4dc('0x21')]===_0xe4dc('0x22')&&typeof _0x1a34d1[_0xe4dc('0x23')]===_0xe4dc('0x22');var _0x4e177a=_0x2db077[_0xe4dc('0x24')];var _0x151e5b=_0x4c2e86?0x0:_0x1a34d1[_0xe4dc('0x21')];var _0x6c9f9c=_0x4c2e86?_0x2db077[_0xe4dc('0x24')]:_0x1a34d1[_0xe4dc('0x21')]+_0x1a34d1[_0xe4dc('0x23')];var _0x5f1c52;if(_0x6c9f9c>=_0x4e177a){_0x6c9f9c=_0x4e177a;_0x5f1c52=0xc8;}else{_0x5f1c52=0xce;}_0x418a15[_0xe4dc('0x1e')](_0x5f1c52);return _0x418a15[_0xe4dc('0x25')](_0xe4dc('0x26'),_0x151e5b+'-'+_0x6c9f9c+'/'+_0x4e177a)[_0xe4dc('0x20')](_0x2db077);}return null;};}function patchUpdates(_0x3c2fdb){return function(_0x2d808a){try{jsonpatch[_0xe4dc('0x27')](_0x2d808a,_0x3c2fdb,!![]);}catch(_0x2aabb4){return BPromise[_0xe4dc('0x28')](_0x2aabb4);}return _0x2d808a[_0xe4dc('0x29')]();};}function saveUpdates(_0x27a211,_0x56b25e){return function(_0x31cff1){if(_0x31cff1){return _0x31cff1['update'](_0x27a211)[_0xe4dc('0x2a')](function(_0x31ad50){return _0x31ad50;});}return null;};}function removeEntity(_0x4fa1e0,_0x3738df){return function(_0x24d9da){if(_0x24d9da){return _0x24d9da[_0xe4dc('0x2b')]()[_0xe4dc('0x2a')](function(){var _0x30c723=_0x24d9da[_0xe4dc('0x2c')]({'plain':!![]});var _0xed066e=_0xe4dc('0x2d');return db['UserProfileResource'][_0xe4dc('0x2b')]({'where':{'type':_0xed066e,'resourceId':_0x30c723['id']}})['then'](function(){return _0x24d9da;});})[_0xe4dc('0x2a')](function(){_0x4fa1e0[_0xe4dc('0x1e')](0xcc)[_0xe4dc('0x1f')]();});}};}function handleEntityNotFound(_0x37c27f,_0x4da3cd){return function(_0x4e116c){if(!_0x4e116c){_0x37c27f['sendStatus'](0x194);}return _0x4e116c;};}function handleError(_0x243885,_0x13700e){_0x13700e=_0x13700e||0x1f4;return function(_0xa9ffb2){logger[_0xe4dc('0x2e')](_0xa9ffb2[_0xe4dc('0x2f')]);if(_0xa9ffb2['name']){delete _0xa9ffb2[_0xe4dc('0x30')];}_0x243885[_0xe4dc('0x1e')](_0x13700e)[_0xe4dc('0x31')](_0xa9ffb2);};}exports[_0xe4dc('0x32')]=function(_0x2c7b5a,_0x39c381){var _0x5f085e={},_0x19381b={},_0x1babfa={'count':0x0,'rows':[]};var _0x48cb82=_['map'](db[_0xe4dc('0x33')][_0xe4dc('0x34')],function(_0x4e87d3){return{'name':_0x4e87d3[_0xe4dc('0x35')],'type':_0x4e87d3[_0xe4dc('0x36')]['key']};});_0x19381b[_0xe4dc('0x37')]=_[_0xe4dc('0x38')](_0x48cb82,_0xe4dc('0x30'));_0x19381b[_0xe4dc('0x39')]=_[_0xe4dc('0x3a')](_0x2c7b5a[_0xe4dc('0x39')]);_0x19381b['filters']=_[_0xe4dc('0x3b')](_0x19381b[_0xe4dc('0x37')],_0x19381b[_0xe4dc('0x39')]);_0x5f085e[_0xe4dc('0x3c')]=_[_0xe4dc('0x3b')](_0x19381b['model'],qs['fields'](_0x2c7b5a['query'][_0xe4dc('0x3d')]));_0x5f085e[_0xe4dc('0x3c')]=_0x5f085e[_0xe4dc('0x3c')][_0xe4dc('0x3e')]?_0x5f085e[_0xe4dc('0x3c')]:_0x19381b[_0xe4dc('0x37')];if(!_0x2c7b5a[_0xe4dc('0x39')][_0xe4dc('0x3f')](_0xe4dc('0x40'))){_0x5f085e[_0xe4dc('0x23')]=qs[_0xe4dc('0x23')](_0x2c7b5a[_0xe4dc('0x39')]['limit']);_0x5f085e['offset']=qs['offset'](_0x2c7b5a[_0xe4dc('0x39')][_0xe4dc('0x21')]);}_0x5f085e['order']=qs[_0xe4dc('0x41')](_0x2c7b5a['query'][_0xe4dc('0x41')]);_0x5f085e[_0xe4dc('0x42')]=qs[_0xe4dc('0x43')](_[_0xe4dc('0x44')](_0x2c7b5a[_0xe4dc('0x39')],_0x19381b[_0xe4dc('0x43')]),_0x48cb82);if(_0x2c7b5a[_0xe4dc('0x39')][_0xe4dc('0x45')]){_0x5f085e[_0xe4dc('0x42')]=_[_0xe4dc('0x46')](_0x5f085e['where'],{'$or':_[_0xe4dc('0x38')](_0x48cb82,function(_0x5a68d1){if(_0x5a68d1[_0xe4dc('0x36')]!==_0xe4dc('0x47')){var _0x49a388={};_0x49a388[_0x5a68d1['name']]={'$like':'%'+_0x2c7b5a[_0xe4dc('0x39')][_0xe4dc('0x45')]+'%'};return _0x49a388;}})});}_0x5f085e=_['merge']({},_0x5f085e,_0x2c7b5a['options']);var _0x301618={'where':_0x5f085e['where']};return db['Schedule']['count'](_0x301618)['then'](function(_0x3cced5){_0x1babfa[_0xe4dc('0x24')]=_0x3cced5;if(_0x2c7b5a[_0xe4dc('0x39')][_0xe4dc('0x48')]){_0x5f085e[_0xe4dc('0x49')]=[{'all':!![]}];}return db[_0xe4dc('0x33')][_0xe4dc('0x4a')](_0x5f085e);})[_0xe4dc('0x2a')](function(_0x346ae6){_0x1babfa[_0xe4dc('0x4b')]=_0x346ae6;return _0x1babfa;})[_0xe4dc('0x2a')](respondWithFilteredResult(_0x39c381,_0x5f085e))['catch'](handleError(_0x39c381,null));};exports[_0xe4dc('0x4c')]=function(_0x35a809,_0x207082){var _0x198b3f={'raw':![],'where':{'id':_0x35a809[_0xe4dc('0x4d')]['id']}},_0x1af937={};_0x1af937[_0xe4dc('0x37')]=_[_0xe4dc('0x3a')](db[_0xe4dc('0x33')]['rawAttributes']);_0x1af937[_0xe4dc('0x39')]=_[_0xe4dc('0x3a')](_0x35a809[_0xe4dc('0x39')]);_0x1af937[_0xe4dc('0x43')]=_[_0xe4dc('0x3b')](_0x1af937[_0xe4dc('0x37')],_0x1af937[_0xe4dc('0x39')]);_0x198b3f['attributes']=_[_0xe4dc('0x3b')](_0x1af937[_0xe4dc('0x37')],qs[_0xe4dc('0x3d')](_0x35a809[_0xe4dc('0x39')][_0xe4dc('0x3d')]));_0x198b3f[_0xe4dc('0x3c')]=_0x198b3f[_0xe4dc('0x3c')][_0xe4dc('0x3e')]?_0x198b3f[_0xe4dc('0x3c')]:_0x1af937[_0xe4dc('0x37')];if(_0x35a809[_0xe4dc('0x39')][_0xe4dc('0x48')]){_0x198b3f[_0xe4dc('0x49')]=[{'all':!![]}];}_0x198b3f=_[_0xe4dc('0x46')]({},_0x198b3f,_0x35a809[_0xe4dc('0x4e')]);return db['Schedule']['find'](_0x198b3f)['then'](handleEntityNotFound(_0x207082,null))[_0xe4dc('0x2a')](respondWithResult(_0x207082,null))[_0xe4dc('0x4f')](handleError(_0x207082,null));};exports[_0xe4dc('0x50')]=function(_0x209e97,_0x4aeffb){return db[_0xe4dc('0x33')]['create'](_0x209e97[_0xe4dc('0x51')],{})[_0xe4dc('0x2a')](function(_0x5d6d7a){var _0x339897=_0x209e97['user']['get']({'plain':!![]});if(!_0x339897)throw new Error(_0xe4dc('0x52'));if(_0x339897[_0xe4dc('0x53')]===_0xe4dc('0x54')){var _0x116152=_0x5d6d7a[_0xe4dc('0x2c')]({'plain':!![]});var _0x457017=_0xe4dc('0x2d');return db[_0xe4dc('0x55')]['find']({'where':{'name':_0x457017,'userProfileId':_0x339897[_0xe4dc('0x56')]},'raw':!![]})[_0xe4dc('0x2a')](function(_0x50adfc){if(_0x50adfc&&_0x50adfc['autoAssociation']===0x0){return db['UserProfileResource'][_0xe4dc('0x50')]({'name':_0x116152[_0xe4dc('0x30')],'resourceId':_0x116152['id'],'type':_0x50adfc[_0xe4dc('0x30')],'sectionId':_0x50adfc['id']},{})['then'](function(){return _0x5d6d7a;});}else{return _0x5d6d7a;}})['catch'](function(_0x30bdb0){logger[_0xe4dc('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30bdb0);throw _0x30bdb0;});}return _0x5d6d7a;})['then'](respondWithResult(_0x4aeffb,0xc9))['catch'](handleError(_0x4aeffb,null));};exports[_0xe4dc('0x57')]=function(_0x464242,_0x37b602){if(_0x464242[_0xe4dc('0x51')]['id']){delete _0x464242[_0xe4dc('0x51')]['id'];}return db['Schedule']['find']({'where':{'id':_0x464242[_0xe4dc('0x4d')]['id']}})[_0xe4dc('0x2a')](handleEntityNotFound(_0x37b602,null))[_0xe4dc('0x2a')](saveUpdates(_0x464242[_0xe4dc('0x51')],null))[_0xe4dc('0x2a')](respondWithResult(_0x37b602,null))[_0xe4dc('0x4f')](handleError(_0x37b602,null));};exports[_0xe4dc('0x2b')]=function(_0x490983,_0x38810f){return db[_0xe4dc('0x33')]['find']({'where':{'id':_0x490983[_0xe4dc('0x4d')]['id']}})[_0xe4dc('0x2a')](handleEntityNotFound(_0x38810f,null))['then'](removeEntity(_0x38810f,null))[_0xe4dc('0x4f')](handleError(_0x38810f,null));};exports[_0xe4dc('0x58')]=function(_0x4e7908,_0x1c5477,_0xa2a33c){var _0x425569=require('../../config/schedule');return db[_0xe4dc('0x33')][_0xe4dc('0x59')]({'where':{'id':_0x4e7908['params']['id']},'raw':!![]})[_0xe4dc('0x2a')](handleEntityNotFound(_0x1c5477,null))['then'](function(){_0x425569[_0xe4dc('0x58')](_0x4e7908[_0xe4dc('0x4d')]['id']);})[_0xe4dc('0x2a')](respondWithStatusCode(_0x1c5477,null))['catch'](handleError(_0x1c5477,null));};
\ No newline at end of file
index 0721b92..25da29f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ea7=['request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','../../config/logger','moment','bluebird'];(function(_0x1942f5,_0x3800a5){var _0x405e7f=function(_0x5af1f2){while(--_0x5af1f2){_0x1942f5['push'](_0x1942f5['shift']());}};_0x405e7f(++_0x3800a5);}(_0x6ea7,0x165));var _0x76ea=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x6ea7[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x76ea('0x0'))('api');var moment=require(_0x76ea('0x1'));var BPromise=require(_0x76ea('0x2'));var rp=require(_0x76ea('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76ea('0x4'));var config=require(_0x76ea('0x5'));var attributes=require(_0x76ea('0x6'));module[_0x76ea('0x7')]=function(_0xa0ca1c,_0x44dfcc){return _0xa0ca1c[_0x76ea('0x8')](_0x76ea('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x71ef=['lodash','util','moment','bluebird','request-promise','./schedule.attributes','exports','define','Schedule'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x71ef,0x1c2));var _0xf71e=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x71ef[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0xf71e('0x0'));var util=require(_0xf71e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf71e('0x2'));var BPromise=require(_0xf71e('0x3'));var rp=require(_0xf71e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf71e('0x5'));module[_0xf71e('0x6')]=function(_0x2841d5,_0x4fa30b){return _0x2841d5[_0xf71e('0x7')](_0xf71e('0x8'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7efa653..28a1158 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f20=['request','then','request\x20sent','stringify','error','code','message','info','Schedule,\x20%s,\x20%s','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x3f20,0x187));var _0x03f2=function(_0x889fa4,_0x874af8){_0x889fa4=_0x889fa4-0x0;var _0x59d9d3=_0x3f20[_0x889fa4];return _0x59d9d3;};'use strict';var _=require('lodash');var util=require(_0x03f2('0x0'));var moment=require(_0x03f2('0x1'));var BPromise=require(_0x03f2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03f2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x03f2('0x4'));var logger=require(_0x03f2('0x5'))('rpc');var config=require(_0x03f2('0x6'));var jayson=require(_0x03f2('0x7'));var client=jayson['client'][_0x03f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26af93,_0x4d2dea,_0x3fc8d4){return new BPromise(function(_0xb44789,_0x554284){return client[_0x03f2('0x9')](_0x26af93,_0x3fc8d4)[_0x03f2('0xa')](function(_0x413109){logger['info']('Schedule,\x20%s,\x20%s',_0x4d2dea,_0x03f2('0xb'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x4d2dea,_0x03f2('0xb'),JSON[_0x03f2('0xc')](_0x413109));if(_0x413109[_0x03f2('0xd')]){if(_0x413109[_0x03f2('0xd')][_0x03f2('0xe')]===0x1f4){logger[_0x03f2('0xd')]('Schedule,\x20%s,\x20%s',_0x4d2dea,_0x413109[_0x03f2('0xd')][_0x03f2('0xf')]);return _0x554284(_0x413109[_0x03f2('0xd')][_0x03f2('0xf')]);}logger[_0x03f2('0xd')]('Schedule,\x20%s,\x20%s',_0x4d2dea,_0x413109[_0x03f2('0xd')][_0x03f2('0xf')]);return _0xb44789(_0x413109[_0x03f2('0xd')][_0x03f2('0xf')]);}else{logger[_0x03f2('0x10')](_0x03f2('0x11'),_0x4d2dea,'request\x20sent');_0xb44789(_0x413109[_0x03f2('0x12')]['message']);}})[_0x03f2('0x13')](function(_0x5bf769){logger[_0x03f2('0xd')]('Schedule,\x20%s,\x20%s',_0x4d2dea,_0x5bf769);_0x554284(_0x5bf769);});});}
\ No newline at end of file
+var _0xdd89=['rpc','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Schedule,\x20%s,\x20%s','request\x20sent','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x339368,_0x2f6251){var _0x2d3efd=function(_0x5d3520){while(--_0x5d3520){_0x339368['push'](_0x339368['shift']());}};_0x2d3efd(++_0x2f6251);}(_0xdd89,0x1c8));var _0x9dd8=function(_0x5cabfd,_0x5dea47){_0x5cabfd=_0x5cabfd-0x0;var _0x4bc06c=_0xdd89[_0x5cabfd];return _0x4bc06c;};'use strict';var _=require('lodash');var util=require(_0x9dd8('0x0'));var moment=require(_0x9dd8('0x1'));var BPromise=require(_0x9dd8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9dd8('0x3'));var db=require(_0x9dd8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9dd8('0x5'))(_0x9dd8('0x6'));var config=require('../../config/environment');var jayson=require(_0x9dd8('0x7'));var client=jayson[_0x9dd8('0x8')][_0x9dd8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e5d57,_0x4d4027,_0x5f091f){return new BPromise(function(_0x28b3b7,_0x6a7517){return client[_0x9dd8('0xa')](_0x5e5d57,_0x5f091f)[_0x9dd8('0xb')](function(_0x1de895){logger[_0x9dd8('0xc')]('Schedule,\x20%s,\x20%s',_0x4d4027,'request\x20sent');logger['debug'](_0x9dd8('0xd'),_0x4d4027,'request\x20sent',JSON[_0x9dd8('0xe')](_0x1de895));if(_0x1de895[_0x9dd8('0xf')]){if(_0x1de895[_0x9dd8('0xf')][_0x9dd8('0x10')]===0x1f4){logger[_0x9dd8('0xf')]('Schedule,\x20%s,\x20%s',_0x4d4027,_0x1de895[_0x9dd8('0xf')][_0x9dd8('0x11')]);return _0x6a7517(_0x1de895['error'][_0x9dd8('0x11')]);}logger[_0x9dd8('0xf')](_0x9dd8('0x12'),_0x4d4027,_0x1de895[_0x9dd8('0xf')][_0x9dd8('0x11')]);return _0x28b3b7(_0x1de895[_0x9dd8('0xf')]['message']);}else{logger[_0x9dd8('0xc')](_0x9dd8('0x12'),_0x4d4027,_0x9dd8('0x13'));_0x28b3b7(_0x1de895[_0x9dd8('0x14')][_0x9dd8('0x11')]);}})[_0x9dd8('0x15')](function(_0x4c40f2){logger[_0x9dd8('0xf')](_0x9dd8('0x12'),_0x4d4027,_0x4c40f2);_0x6a7517(_0x4c40f2);});});}
\ No newline at end of file
index 680ec90..8777225 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcc1=['../../components/auth/service','../../components/interaction/service','./screenRecording.controller','index','get','isAuthenticated','describe','/:id','/:id/download','download','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x2a2b67,_0x26f23a){var _0xe2bcdf=function(_0x15853c){while(--_0x15853c){_0x2a2b67['push'](_0x2a2b67['shift']());}};_0xe2bcdf(++_0x26f23a);}(_0xdcc1,0x170));var _0x1dcc=function(_0x4e15d1,_0x42fa28){_0x4e15d1=_0x4e15d1-0x0;var _0xbefa23=_0xdcc1[_0x4e15d1];return _0xbefa23;};'use strict';var multer=require(_0x1dcc('0x0'));var util=require(_0x1dcc('0x1'));var path=require(_0x1dcc('0x2'));var timeout=require(_0x1dcc('0x3'));var express=require('express');var router=express[_0x1dcc('0x4')]();var fs_extra=require(_0x1dcc('0x5'));var auth=require(_0x1dcc('0x6'));var interaction=require(_0x1dcc('0x7'));var config=require('../../config/environment');var controller=require(_0x1dcc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1dcc('0x9')]);router[_0x1dcc('0xa')]('/describe',auth[_0x1dcc('0xb')](),controller[_0x1dcc('0xc')]);router[_0x1dcc('0xa')](_0x1dcc('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x1dcc('0xe'),auth[_0x1dcc('0xb')](),controller[_0x1dcc('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1dcc('0x10')]);router[_0x1dcc('0x11')](_0x1dcc('0xd'),auth[_0x1dcc('0xb')](),controller[_0x1dcc('0x12')]);router[_0x1dcc('0x13')](_0x1dcc('0xd'),auth[_0x1dcc('0xb')](),controller[_0x1dcc('0x14')]);module[_0x1dcc('0x15')]=router;
\ No newline at end of file
+var _0x0cdf=['fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','isAuthenticated','index','get','describe','/:id','/:id/download','download','post','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x0cdf,0xe2));var _0xf0cd=function(_0x36e3ed,_0x35d495){_0x36e3ed=_0x36e3ed-0x0;var _0xdfd304=_0x0cdf[_0x36e3ed];return _0xdfd304;};'use strict';var multer=require(_0xf0cd('0x0'));var util=require(_0xf0cd('0x1'));var path=require(_0xf0cd('0x2'));var timeout=require(_0xf0cd('0x3'));var express=require(_0xf0cd('0x4'));var router=express['Router']();var fs_extra=require(_0xf0cd('0x5'));var auth=require(_0xf0cd('0x6'));var interaction=require(_0xf0cd('0x7'));var config=require('../../config/environment');var controller=require(_0xf0cd('0x8'));router['get']('/',auth[_0xf0cd('0x9')](),controller[_0xf0cd('0xa')]);router[_0xf0cd('0xb')]('/describe',auth[_0xf0cd('0x9')](),controller[_0xf0cd('0xc')]);router[_0xf0cd('0xb')](_0xf0cd('0xd'),auth[_0xf0cd('0x9')](),controller['show']);router[_0xf0cd('0xb')](_0xf0cd('0xe'),auth[_0xf0cd('0x9')](),controller[_0xf0cd('0xf')]);router[_0xf0cd('0x10')]('/',auth[_0xf0cd('0x9')](),controller['create']);router[_0xf0cd('0x11')](_0xf0cd('0xd'),auth[_0xf0cd('0x9')](),controller[_0xf0cd('0x12')]);router[_0xf0cd('0x13')](_0xf0cd('0xd'),auth[_0xf0cd('0x9')](),controller[_0xf0cd('0x14')]);module['exports']=router;
\ No newline at end of file
index e032abf..6eefe3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf08c=['replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','STRING'];(function(_0x17ffc8,_0x5d0890){var _0x234953=function(_0x180b2d){while(--_0x180b2d){_0x17ffc8['push'](_0x17ffc8['shift']());}};_0x234953(++_0x5d0890);}(_0xf08c,0xb5));var _0xcf08=function(_0x7e18a9,_0x2cdd5e){_0x7e18a9=_0x7e18a9-0x0;var _0x18f2cf=_0xf08c[_0x7e18a9];return _0x18f2cf;};'use strict';var Sequelize=require(_0xcf08('0x0'));var moment=require(_0xcf08('0x1'));var path=require(_0xcf08('0x2'));var config=require('../../config/environment');module[_0xcf08('0x3')]={'format':{'type':Sequelize[_0xcf08('0x4')],'get':function(){return this[_0xcf08('0x5')](_0xcf08('0x6'))?path['extname'](this['getDataValue'](_0xcf08('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xcf08('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xcf08('0x7')],'set':function(_0x37efab){var _0x13b89c=_0x37efab[_0xcf08('0x8')](/\\/g,'/');this['setDataValue']('value',_0x13b89c);}},'rating':{'type':Sequelize[_0xcf08('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x1ab45d){this[_0xcf08('0xa')](_0xcf08('0xb'),moment()[_0xcf08('0xc')](_0x1ab45d,'ms'));this['setDataValue'](_0xcf08('0xd'),moment());this[_0xcf08('0xa')](_0xcf08('0xe'),_0x1ab45d);}},'startedAt':{'type':Sequelize[_0xcf08('0xf')],'get':function(){return moment(this[_0xcf08('0x5')](_0xcf08('0xb')))[_0xcf08('0x10')](_0xcf08('0x11'))[_0xcf08('0x12')]();}},'closedAt':{'type':Sequelize[_0xcf08('0xf')],'get':function(){return moment(this[_0xcf08('0x5')]('closedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xcf08('0x12')]();}},'createdAt':{'type':Sequelize[_0xcf08('0xf')],'get':function(){return moment(this['getDataValue'](_0xcf08('0x13')))[_0xcf08('0x10')](_0xcf08('0x11'))[_0xcf08('0x12')]();}},'updatedAt':{'type':Sequelize[_0xcf08('0xf')],'get':function(){return moment(this['getDataValue'](_0xcf08('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0xcf08('0x12')]();}}};
\ No newline at end of file
+var _0x81b7=['DATE','createdAt','MM-DD-YYYY\x20HH:mm','updatedAt','moment','path','../../config/environment','exports','getDataValue','extname','value','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','format','toString'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x81b7,0x1f2));var _0x781b=function(_0x3c48f9,_0x366c67){_0x3c48f9=_0x3c48f9-0x0;var _0x12d94b=_0x81b7[_0x3c48f9];return _0x12d94b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x781b('0x0'));var path=require(_0x781b('0x1'));var config=require(_0x781b('0x2'));module[_0x781b('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x781b('0x4')]('value')?path[_0x781b('0x5')](this[_0x781b('0x4')](_0x781b('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x781b('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x781b('0x7')],'set':function(_0xd9d633){var _0x482803=_0xd9d633['replace'](/\\/g,'/');this[_0x781b('0x8')](_0x781b('0x6'),_0x482803);}},'rating':{'type':Sequelize[_0x781b('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x781b('0x9')],'set':function(_0x5591d9){this[_0x781b('0x8')](_0x781b('0xa'),moment()['subtract'](_0x5591d9,'ms'));this['setDataValue'](_0x781b('0xb'),moment());this['setDataValue'](_0x781b('0xc'),_0x5591d9);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x781b('0x4')]('startedAt'))[_0x781b('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x781b('0xe')]();}},'closedAt':{'type':Sequelize[_0x781b('0xf')],'get':function(){return moment(this[_0x781b('0x4')](_0x781b('0xb')))[_0x781b('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x781b('0xe')]();}},'createdAt':{'type':Sequelize[_0x781b('0xf')],'get':function(){return moment(this[_0x781b('0x4')](_0x781b('0x10')))['format'](_0x781b('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x781b('0xf')],'get':function(){return moment(this[_0x781b('0x4')](_0x781b('0x12')))['format'](_0x781b('0x11'))['toString']();}}};
\ No newline at end of file
index a2bef1a..9c72000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf5=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','format','query','keys','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','describe','download','uniqueid','join','root','server/files/screen_recordings','decryptFile','secrets','recording','existsSync','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x6033c0,_0x40dd96){_0x6033c0=_0x6033c0-0x0;var _0xb42cad=_0xdbf5[_0x6033c0];return _0xb42cad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x22')]();});}};}function handleEntityNotFound(_0x20ab1b,_0x42f13b){return function(_0x15a790){if(!_0x15a790){_0x20ab1b[_0x5dbf('0x16')](0x194);}return _0x15a790;};}function handleError(_0x232c77,_0x3f9e60){_0x3f9e60=_0x3f9e60||0x1f4;return function(_0x407741){logger[_0x5dbf('0x23')](_0x407741[_0x5dbf('0x24')]);if(_0x407741[_0x5dbf('0x25')]){delete _0x407741[_0x5dbf('0x25')];}_0x232c77[_0x5dbf('0x17')](_0x3f9e60)[_0x5dbf('0x26')](_0x407741);};}exports[_0x5dbf('0x27')]=function(_0x471027,_0x21cd00){var _0x5768b7={},_0x2f71eb={},_0x24dc99={'count':0x0,'rows':[]};var _0xc4748=_[_0x5dbf('0x28')](db[_0x5dbf('0x29')][_0x5dbf('0x2a')],function(_0x2a65c5){return{'name':_0x2a65c5[_0x5dbf('0x2b')],'type':_0x2a65c5[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x2f71eb[_0x5dbf('0x2e')]=_['differenceBy'](_['map'](_0xc4748,_0x5dbf('0x25')),[_0x5dbf('0x2f')]);_0x2f71eb[_0x5dbf('0x30')]=_[_0x5dbf('0x31')](_0x471027[_0x5dbf('0x30')]);_0x2f71eb['filters']=_['intersection'](_0x2f71eb[_0x5dbf('0x2e')],_0x2f71eb[_0x5dbf('0x30')]);_0x5768b7['attributes']=_[_0x5dbf('0x32')](_0x2f71eb[_0x5dbf('0x2e')],qs[_0x5dbf('0x33')](_0x471027[_0x5dbf('0x30')][_0x5dbf('0x33')]));_0x5768b7['attributes']=_0x5768b7[_0x5dbf('0x34')][_0x5dbf('0x35')]?_0x5768b7[_0x5dbf('0x34')]:_0x2f71eb[_0x5dbf('0x2e')];if(!_0x471027[_0x5dbf('0x30')]['hasOwnProperty'](_0x5dbf('0x36'))){_0x5768b7[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x471027[_0x5dbf('0x30')]['limit']);_0x5768b7[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x471027[_0x5dbf('0x30')][_0x5dbf('0x19')]);}_0x5768b7[_0x5dbf('0x38')]=qs[_0x5dbf('0x39')](_0x471027[_0x5dbf('0x30')][_0x5dbf('0x39')]);_0x5768b7[_0x5dbf('0x3a')]=qs[_0x5dbf('0x3b')](_[_0x5dbf('0x3c')](_0x471027['query'],_0x2f71eb[_0x5dbf('0x3b')]),_0xc4748);if(_0x471027[_0x5dbf('0x30')][_0x5dbf('0x3d')]){_0x5768b7['where']=_[_0x5dbf('0x3e')](_0x5768b7[_0x5dbf('0x3a')],{'$or':_[_0x5dbf('0x28')](_0xc4748,function(_0x5b3738){if(_0x5b3738[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x9bd4c0={};_0x9bd4c0[_0x5b3738['name']]={'$like':'%'+_0x471027[_0x5dbf('0x30')][_0x5dbf('0x3d')]+'%'};return _0x9bd4c0;}})});}_0x5768b7=_[_0x5dbf('0x3e')]({},_0x5768b7,_0x471027[_0x5dbf('0x40')]);var _0x10537d={'where':_0x5768b7[_0x5dbf('0x3a')]};return db[_0x5dbf('0x29')][_0x5dbf('0x1b')](_0x10537d)['then'](function(_0x5be96b){_0x24dc99['count']=_0x5be96b;if(_0x471027['query'][_0x5dbf('0x41')]){_0x5768b7[_0x5dbf('0x42')]=[{'all':!![]}];}return db['ScreenRecording'][_0x5dbf('0x43')](_0x5768b7);})[_0x5dbf('0x20')](function(_0x5a60e8){_0x24dc99[_0x5dbf('0x44')]=_0x5a60e8;return _0x24dc99;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x21cd00,_0x5768b7))[_0x5dbf('0x45')](handleError(_0x21cd00,null));};exports[_0x5dbf('0x46')]=function(_0x21ae10,_0x7c390d){var _0x2745df={'raw':![],'where':{'id':_0x21ae10[_0x5dbf('0x47')]['id']}},_0x1c020a={};_0x1c020a[_0x5dbf('0x2e')]=_['keys'](db[_0x5dbf('0x29')][_0x5dbf('0x2a')]);_0x1c020a[_0x5dbf('0x30')]=_['keys'](_0x21ae10[_0x5dbf('0x30')]);_0x1c020a[_0x5dbf('0x3b')]=_[_0x5dbf('0x32')](_0x1c020a[_0x5dbf('0x2e')],_0x1c020a['query']);_0x2745df[_0x5dbf('0x34')]=_['intersection'](_0x1c020a[_0x5dbf('0x2e')],qs[_0x5dbf('0x33')](_0x21ae10[_0x5dbf('0x30')][_0x5dbf('0x33')]));_0x2745df['attributes']=_0x2745df['attributes'][_0x5dbf('0x35')]?_0x2745df[_0x5dbf('0x34')]:_0x1c020a[_0x5dbf('0x2e')];if(_0x21ae10['query'][_0x5dbf('0x41')]){_0x2745df['include']=[{'all':!![]}];}_0x2745df=_['merge']({},_0x2745df,_0x21ae10['options']);return db['ScreenRecording'][_0x5dbf('0x48')](_0x2745df)[_0x5dbf('0x20')](handleEntityNotFound(_0x7c390d,null))['then'](respondWithResult(_0x7c390d,null))[_0x5dbf('0x45')](handleError(_0x7c390d,null));};exports[_0x5dbf('0x49')]=function(_0x4b6f30,_0x366102){return db[_0x5dbf('0x29')]['create'](_0x4b6f30[_0x5dbf('0x4a')],{})['then'](respondWithResult(_0x366102,0xc9))['catch'](handleError(_0x366102,null));};exports[_0x5dbf('0x1f')]=function(_0x2a3d30,_0x17a1c0){if(_0x2a3d30['body']['id']){delete _0x2a3d30['body']['id'];}delete _0x2a3d30[_0x5dbf('0x4a')][_0x5dbf('0x4b')];delete _0x2a3d30[_0x5dbf('0x4a')][_0x5dbf('0x4c')];delete _0x2a3d30[_0x5dbf('0x4a')][_0x5dbf('0x4d')];delete _0x2a3d30[_0x5dbf('0x4a')][_0x5dbf('0x4e')];return db['ScreenRecording'][_0x5dbf('0x48')]({'where':{'id':_0x2a3d30[_0x5dbf('0x47')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x17a1c0,null))[_0x5dbf('0x20')](saveUpdates(_0x2a3d30[_0x5dbf('0x4a')],null))[_0x5dbf('0x20')](respondWithResult(_0x17a1c0,null))[_0x5dbf('0x45')](handleError(_0x17a1c0,null));};exports['describe']=function(_0x1b0b13,_0x54f401){return db[_0x5dbf('0x29')][_0x5dbf('0x4f')]()[_0x5dbf('0x20')](respondWithResult(_0x54f401,null))[_0x5dbf('0x45')](handleError(_0x54f401,null));};exports[_0x5dbf('0x50')]=function(_0x1f165d,_0x353d0f,_0x48403a){var _0x5c3c0d=require('../../components/encryptor');var _0x1e1876=![];var _0xfdacc7={};if(_0x1f165d[_0x5dbf('0x30')]['type']&&_0x1f165d['query'][_0x5dbf('0x2c')]===_0x5dbf('0x51')){_0xfdacc7[_0x5dbf('0x51')]=_0x1f165d['params']['id'];}else{_0xfdacc7['id']=_0x1f165d[_0x5dbf('0x47')]['id'];}return db['ScreenRecording'][_0x5dbf('0x48')]({'where':_0xfdacc7,'attributes':['id',_0x5dbf('0x4e')],'raw':!![]})[_0x5dbf('0x20')](handleEntityNotFound(_0x353d0f,null))['then'](function(_0x55fd51){if(_0x55fd51){var _0x1b316d=path[_0x5dbf('0x52')](config[_0x5dbf('0x53')],_0x5dbf('0x54'),_0x55fd51['value']);var _0xfcc43c=util[_0x5dbf('0x2f')]('%s.cypher',_0x1b316d);if(fs['existsSync'](_0xfcc43c)){_0x1e1876=!![];return _0x5c3c0d[_0x5dbf('0x55')](_0xfcc43c,_0x1b316d,config[_0x5dbf('0x56')][_0x5dbf('0x57')])[_0x5dbf('0x20')](function(){return _0x55fd51;});}return _0x55fd51;}})[_0x5dbf('0x20')](function(_0x4711d5){if(_0x4711d5){var _0x50a029=path[_0x5dbf('0x52')](config['root'],'server/files/screen_recordings',_0x4711d5['value']);if(!fs[_0x5dbf('0x58')](_0x50a029)){throw new db['Sequelize'][(_0x5dbf('0x59'))](_0x5dbf('0x5a'));}if(_0x4711d5[_0x5dbf('0x5b')]){return _0x353d0f[_0x5dbf('0x50')](_0x50a029,_0x4711d5[_0x5dbf('0x5b')]+path[_0x5dbf('0x5c')](_0x50a029),function(){if(_0x1e1876){fs[_0x5dbf('0x5d')](_0x50a029);}});}else{return _0x353d0f[_0x5dbf('0x50')](_0x50a029,function(_0x2c84d6){if(_0x1e1876){fs[_0x5dbf('0x5d')](_0x50a029);}});}}})[_0x5dbf('0x45')](function(_0x2ca889){if(_0x2ca889[_0x5dbf('0x5e')]===_0x5dbf('0x5a')){_0x353d0f[_0x5dbf('0x17')](0x194)['send'](_0x5dbf('0x5f'));}else{return handleError(_0x353d0f,null);}});};exports['destroy']=function(_0xb0a9bf,_0xfc5817){return db[_0x5dbf('0x29')][_0x5dbf('0x48')]({'where':{'id':_0xb0a9bf['params']['id']}})[_0x5dbf('0x20')](function(_0x1ade34){if(_[_0x5dbf('0x60')](_0x1ade34)){throw new ReferenceError(_0x5dbf('0x61'));}return _0x1ade34;})[_0x5dbf('0x20')](function(_0x40982f){var _0x52efd7=path[_0x5dbf('0x52')](config[_0x5dbf('0x53')],_0x5dbf('0x54'),_0x40982f[_0x5dbf('0x4e')]);logger[_0x5dbf('0x62')](_0x5dbf('0x63'),_0x52efd7);if(!_[_0x5dbf('0x60')](_0x40982f[_0x5dbf('0x4e')])&&fs[_0x5dbf('0x58')](_0x52efd7)){logger[_0x5dbf('0x62')](_0x5dbf('0x64')+_0x52efd7+_0x5dbf('0x65'));fs['unlinkSync'](_0x52efd7);}_0x52efd7=_0x52efd7+'.cypher';if(!_[_0x5dbf('0x60')](_0x40982f[_0x5dbf('0x4e')])&&fs[_0x5dbf('0x58')](_0x52efd7)){logger[_0x5dbf('0x62')](_0x5dbf('0x64')+_0x52efd7+_0x5dbf('0x65'));fs[_0x5dbf('0x66')](_0x52efd7);}return _0x40982f;})[_0x5dbf('0x20')](function(_0x3a4001){if(!_0x3a4001)throw new InternalError();return _0x3a4001['destroy']();})['then'](function(){_0xfc5817['status'](0xcc)['end']();})[_0x5dbf('0x45')](handleError(_0xfc5817,null));};
\ No newline at end of file
+var _0xd6d6=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','catch','find','create','body','duration','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x50a46a,_0x21d3a7){var _0x47f62d=function(_0x331d1d){while(--_0x331d1d){_0x50a46a['push'](_0x50a46a['shift']());}};_0x47f62d(++_0x21d3a7);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5ef35b,_0x477a76){_0x5ef35b=_0x5ef35b-0x0;var _0x5e0b84=_0xd6d6[_0x5ef35b];return _0x5e0b84;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0xf0df7f,_0x12fab2){return function(_0x554f8e){if(!_0x554f8e){_0xf0df7f[_0x6d6d('0x19')](0x194);}return _0x554f8e;};}function handleError(_0x2b5e31,_0x235451){_0x235451=_0x235451||0x1f4;return function(_0x126ac8){logger[_0x6d6d('0x29')](_0x126ac8[_0x6d6d('0x2a')]);if(_0x126ac8[_0x6d6d('0x2b')]){delete _0x126ac8['name'];}_0x2b5e31[_0x6d6d('0x1a')](_0x235451)[_0x6d6d('0x2c')](_0x126ac8);};}exports['index']=function(_0x553645,_0x3edcce){var _0x5273cd={},_0x8a9a84={},_0x57341f={'count':0x0,'rows':[]};var _0xde3272=_[_0x6d6d('0x2d')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')],function(_0x64d1f7){return{'name':_0x64d1f7[_0x6d6d('0x30')],'type':_0x64d1f7[_0x6d6d('0x31')][_0x6d6d('0x32')]};});_0x8a9a84[_0x6d6d('0x33')]=_[_0x6d6d('0x34')](_['map'](_0xde3272,_0x6d6d('0x2b')),['format']);_0x8a9a84[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x553645[_0x6d6d('0x35')]);_0x8a9a84[_0x6d6d('0x37')]=_['intersection'](_0x8a9a84[_0x6d6d('0x33')],_0x8a9a84['query']);_0x5273cd[_0x6d6d('0x38')]=_[_0x6d6d('0x39')](_0x8a9a84['model'],qs[_0x6d6d('0x3a')](_0x553645[_0x6d6d('0x35')][_0x6d6d('0x3a')]));_0x5273cd[_0x6d6d('0x38')]=_0x5273cd[_0x6d6d('0x38')][_0x6d6d('0x3b')]?_0x5273cd[_0x6d6d('0x38')]:_0x8a9a84[_0x6d6d('0x33')];if(!_0x553645[_0x6d6d('0x35')][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x5273cd[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x553645[_0x6d6d('0x35')]['limit']);_0x5273cd[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x553645[_0x6d6d('0x35')][_0x6d6d('0x1f')]);}_0x5273cd['order']=qs['sort'](_0x553645[_0x6d6d('0x35')][_0x6d6d('0x3e')]);_0x5273cd[_0x6d6d('0x3f')]=qs['filters'](_[_0x6d6d('0x40')](_0x553645[_0x6d6d('0x35')],_0x8a9a84[_0x6d6d('0x37')]),_0xde3272);if(_0x553645[_0x6d6d('0x35')]['filter']){_0x5273cd['where']=_['merge'](_0x5273cd[_0x6d6d('0x3f')],{'$or':_[_0x6d6d('0x2d')](_0xde3272,function(_0x33c8f2){if(_0x33c8f2[_0x6d6d('0x31')]!=='VIRTUAL'){var _0x253416={};_0x253416[_0x33c8f2[_0x6d6d('0x2b')]]={'$like':'%'+_0x553645[_0x6d6d('0x35')][_0x6d6d('0x41')]+'%'};return _0x253416;}})});}_0x5273cd=_[_0x6d6d('0x42')]({},_0x5273cd,_0x553645[_0x6d6d('0x43')]);var _0x4b457d={'where':_0x5273cd[_0x6d6d('0x3f')]};return db[_0x6d6d('0x2e')][_0x6d6d('0x20')](_0x4b457d)[_0x6d6d('0x27')](function(_0x32275b){_0x57341f[_0x6d6d('0x20')]=_0x32275b;if(_0x553645[_0x6d6d('0x35')]['includeAll']){_0x5273cd[_0x6d6d('0x44')]=[{'all':!![]}];}return db[_0x6d6d('0x2e')][_0x6d6d('0x45')](_0x5273cd);})[_0x6d6d('0x27')](function(_0xe1aa77){_0x57341f['rows']=_0xe1aa77;return _0x57341f;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x3edcce,_0x5273cd))[_0x6d6d('0x46')](handleError(_0x3edcce,null));};exports['show']=function(_0x452de2,_0x50dc17){var _0x15bf62={'raw':![],'where':{'id':_0x452de2['params']['id']}},_0x43c03c={};_0x43c03c[_0x6d6d('0x33')]=_[_0x6d6d('0x36')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')]);_0x43c03c[_0x6d6d('0x35')]=_['keys'](_0x452de2['query']);_0x43c03c[_0x6d6d('0x37')]=_['intersection'](_0x43c03c['model'],_0x43c03c[_0x6d6d('0x35')]);_0x15bf62[_0x6d6d('0x38')]=_[_0x6d6d('0x39')](_0x43c03c['model'],qs[_0x6d6d('0x3a')](_0x452de2['query'][_0x6d6d('0x3a')]));_0x15bf62[_0x6d6d('0x38')]=_0x15bf62[_0x6d6d('0x38')][_0x6d6d('0x3b')]?_0x15bf62[_0x6d6d('0x38')]:_0x43c03c[_0x6d6d('0x33')];if(_0x452de2[_0x6d6d('0x35')]['includeAll']){_0x15bf62[_0x6d6d('0x44')]=[{'all':!![]}];}_0x15bf62=_[_0x6d6d('0x42')]({},_0x15bf62,_0x452de2[_0x6d6d('0x43')]);return db[_0x6d6d('0x2e')][_0x6d6d('0x47')](_0x15bf62)[_0x6d6d('0x27')](handleEntityNotFound(_0x50dc17,null))[_0x6d6d('0x27')](respondWithResult(_0x50dc17,null))[_0x6d6d('0x46')](handleError(_0x50dc17,null));};exports[_0x6d6d('0x48')]=function(_0x5e4c04,_0x4d78bb){return db[_0x6d6d('0x2e')][_0x6d6d('0x48')](_0x5e4c04[_0x6d6d('0x49')],{})[_0x6d6d('0x27')](respondWithResult(_0x4d78bb,0xc9))[_0x6d6d('0x46')](handleError(_0x4d78bb,null));};exports['update']=function(_0x47170d,_0x27b396){if(_0x47170d[_0x6d6d('0x49')]['id']){delete _0x47170d[_0x6d6d('0x49')]['id'];}delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4a')];delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4b')];delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4c')];delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4d')];return db['ScreenRecording'][_0x6d6d('0x47')]({'where':{'id':_0x47170d[_0x6d6d('0x4e')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x27b396,null))[_0x6d6d('0x27')](saveUpdates(_0x47170d[_0x6d6d('0x49')],null))['then'](respondWithResult(_0x27b396,null))[_0x6d6d('0x46')](handleError(_0x27b396,null));};exports[_0x6d6d('0x4f')]=function(_0x45340b,_0x4e4c3e){return db['ScreenRecording'][_0x6d6d('0x4f')]()['then'](respondWithResult(_0x4e4c3e,null))[_0x6d6d('0x46')](handleError(_0x4e4c3e,null));};exports[_0x6d6d('0x50')]=function(_0x32aaae,_0x268361,_0x4777a5){var _0x18e2de=require(_0x6d6d('0x51'));var _0x26c23a=![];var _0x1a8f33={};if(_0x32aaae[_0x6d6d('0x35')]['type']&&_0x32aaae[_0x6d6d('0x35')][_0x6d6d('0x31')]===_0x6d6d('0x52')){_0x1a8f33[_0x6d6d('0x52')]=_0x32aaae[_0x6d6d('0x4e')]['id'];}else{_0x1a8f33['id']=_0x32aaae[_0x6d6d('0x4e')]['id'];}return db[_0x6d6d('0x2e')]['find']({'where':_0x1a8f33,'attributes':['id','value'],'raw':!![]})[_0x6d6d('0x27')](handleEntityNotFound(_0x268361,null))[_0x6d6d('0x27')](function(_0x5cc644){if(_0x5cc644){var _0x3e98a0=path[_0x6d6d('0x53')](config[_0x6d6d('0x54')],_0x6d6d('0x55'),_0x5cc644[_0x6d6d('0x4d')]);var _0xc6b96e=util[_0x6d6d('0x56')](_0x6d6d('0x57'),_0x3e98a0);if(fs[_0x6d6d('0x58')](_0xc6b96e)){_0x26c23a=!![];return _0x18e2de[_0x6d6d('0x59')](_0xc6b96e,_0x3e98a0,config[_0x6d6d('0x5a')][_0x6d6d('0x5b')])[_0x6d6d('0x27')](function(){return _0x5cc644;});}return _0x5cc644;}})[_0x6d6d('0x27')](function(_0x3065ea){if(_0x3065ea){var _0x50d8dd=path[_0x6d6d('0x53')](config[_0x6d6d('0x54')],'server/files/screen_recordings',_0x3065ea[_0x6d6d('0x4d')]);if(!fs[_0x6d6d('0x58')](_0x50d8dd)){throw new db[(_0x6d6d('0x5c'))][(_0x6d6d('0x5d'))](_0x6d6d('0x5e'));}if(_0x3065ea[_0x6d6d('0x5f')]){return _0x268361[_0x6d6d('0x50')](_0x50d8dd,_0x3065ea[_0x6d6d('0x5f')]+path[_0x6d6d('0x60')](_0x50d8dd),function(){if(_0x26c23a){fs['unlink'](_0x50d8dd);}});}else{return _0x268361['download'](_0x50d8dd,function(_0x22c3a1){if(_0x26c23a){fs[_0x6d6d('0x61')](_0x50d8dd);}});}}})[_0x6d6d('0x46')](function(_0x5de33f){if(_0x5de33f['message']===_0x6d6d('0x5e')){_0x268361['status'](0x194)[_0x6d6d('0x2c')]('Not\x20found');}else{return handleError(_0x268361,null);}});};exports[_0x6d6d('0x28')]=function(_0x367a6f,_0x21f14c){return db[_0x6d6d('0x2e')][_0x6d6d('0x47')]({'where':{'id':_0x367a6f[_0x6d6d('0x4e')]['id']}})['then'](function(_0x41e576){if(_['isNil'](_0x41e576)){throw new ReferenceError(_0x6d6d('0x62'));}return _0x41e576;})['then'](function(_0x2a21d8){var _0x3e48f7=path[_0x6d6d('0x53')](config[_0x6d6d('0x54')],_0x6d6d('0x55'),_0x2a21d8[_0x6d6d('0x4d')]);logger[_0x6d6d('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x3e48f7);if(!_['isNil'](_0x2a21d8[_0x6d6d('0x4d')])&&fs['existsSync'](_0x3e48f7)){logger[_0x6d6d('0x63')]('File:\x20\x22'+_0x3e48f7+_0x6d6d('0x64'));fs[_0x6d6d('0x65')](_0x3e48f7);}_0x3e48f7=_0x3e48f7+_0x6d6d('0x66');if(!_[_0x6d6d('0x67')](_0x2a21d8[_0x6d6d('0x4d')])&&fs[_0x6d6d('0x58')](_0x3e48f7)){logger['info'](_0x6d6d('0x68')+_0x3e48f7+_0x6d6d('0x64'));fs[_0x6d6d('0x65')](_0x3e48f7);}return _0x2a21d8;})[_0x6d6d('0x27')](function(_0x1ba731){if(!_0x1ba731)throw new InternalError();return _0x1ba731[_0x6d6d('0x28')]();})[_0x6d6d('0x27')](function(){_0x21f14c['status'](0xcc)[_0x6d6d('0x1b')]();})[_0x6d6d('0x46')](handleError(_0x21f14c,null));};
\ No newline at end of file
index 05a8308..1c6d6ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a1b=['../../config/environment','exports','define','screen_recordings','interactionid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0x1a1b,0x130));var _0xb1a1=function(_0x156273,_0x4ca44a){_0x156273=_0x156273-0x0;var _0x3ef460=_0x1a1b[_0x156273];return _0x3ef460;};'use strict';var _=require(_0xb1a1('0x0'));var util=require('util');var logger=require(_0xb1a1('0x1'))(_0xb1a1('0x2'));var moment=require(_0xb1a1('0x3'));var BPromise=require(_0xb1a1('0x4'));var rp=require(_0xb1a1('0x5'));var fs=require('fs');var path=require(_0xb1a1('0x6'));var rimraf=require(_0xb1a1('0x7'));var config=require(_0xb1a1('0x8'));var attributes=require('./screenRecording.attributes');module[_0xb1a1('0x9')]=function(_0x315774,_0x44585f){return _0x315774[_0xb1a1('0xa')]('ScreenRecording',attributes,{'tableName':_0xb1a1('0xb'),'paranoid':![],'indexes':[{'name':_0xb1a1('0xc'),'fields':[_0xb1a1('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b8b=['exports','define','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x5510a6,_0x4975b9){var _0x962a10=function(_0x5cca76){while(--_0x5cca76){_0x5510a6['push'](_0x5510a6['shift']());}};_0x962a10(++_0x4975b9);}(_0x5b8b,0x8b));var _0xb5b8=function(_0x1f47d6,_0x2350be){_0x1f47d6=_0x1f47d6-0x0;var _0x11ef90=_0x5b8b[_0x1f47d6];return _0x11ef90;};'use strict';var _=require(_0xb5b8('0x0'));var util=require(_0xb5b8('0x1'));var logger=require(_0xb5b8('0x2'))(_0xb5b8('0x3'));var moment=require(_0xb5b8('0x4'));var BPromise=require(_0xb5b8('0x5'));var rp=require(_0xb5b8('0x6'));var fs=require('fs');var path=require(_0xb5b8('0x7'));var rimraf=require(_0xb5b8('0x8'));var config=require(_0xb5b8('0x9'));var attributes=require(_0xb5b8('0xa'));module[_0xb5b8('0xb')]=function(_0x1b85ea,_0x29cdf2){return _0x1b85ea[_0xb5b8('0xc')]('ScreenRecording',attributes,{'tableName':_0xb5b8('0xd'),'paranoid':![],'indexes':[{'name':_0xb5b8('0xe'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
index 13b2abb..ce65b29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed81=['ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info'];(function(_0x3eff47,_0x2796a1){var _0x8c1be2=function(_0x43d039){while(--_0x43d039){_0x3eff47['push'](_0x3eff47['shift']());}};_0x8c1be2(++_0x2796a1);}(_0xed81,0x143));var _0x1ed8=function(_0x29f73d,_0x4724d9){_0x29f73d=_0x29f73d-0x0;var _0x2a0461=_0xed81[_0x29f73d];return _0x2a0461;};'use strict';var _=require(_0x1ed8('0x0'));var util=require(_0x1ed8('0x1'));var moment=require(_0x1ed8('0x2'));var BPromise=require(_0x1ed8('0x3'));var rs=require(_0x1ed8('0x4'));var fs=require('fs');var Redis=require(_0x1ed8('0x5'));var db=require(_0x1ed8('0x6'))['db'];var utils=require(_0x1ed8('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1ed8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ed8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eeab6,_0xc7ce29,_0x3af7cf){return new BPromise(function(_0x4cda89,_0x1c6904){return client[_0x1ed8('0xa')](_0x1eeab6,_0x3af7cf)[_0x1ed8('0xb')](function(_0x270900){logger[_0x1ed8('0xc')](_0x1ed8('0xd'),_0xc7ce29,_0x1ed8('0xe'));logger['debug'](_0x1ed8('0xf'),_0xc7ce29,_0x1ed8('0xe'),JSON[_0x1ed8('0x10')](_0x270900));if(_0x270900[_0x1ed8('0x11')]){if(_0x270900[_0x1ed8('0x11')][_0x1ed8('0x12')]===0x1f4){logger[_0x1ed8('0x11')](_0x1ed8('0xd'),_0xc7ce29,_0x270900[_0x1ed8('0x11')][_0x1ed8('0x13')]);return _0x1c6904(_0x270900[_0x1ed8('0x11')][_0x1ed8('0x13')]);}logger[_0x1ed8('0x11')](_0x1ed8('0xd'),_0xc7ce29,_0x270900[_0x1ed8('0x11')][_0x1ed8('0x13')]);return _0x4cda89(_0x270900[_0x1ed8('0x11')][_0x1ed8('0x13')]);}else{logger[_0x1ed8('0xc')](_0x1ed8('0xd'),_0xc7ce29,_0x1ed8('0xe'));_0x4cda89(_0x270900['result'][_0x1ed8('0x13')]);}})[_0x1ed8('0x14')](function(_0x390992){logger['error']('ScreenRecording,\x20%s,\x20%s',_0xc7ce29,_0x390992);_0x1c6904(_0x390992);});});}
\ No newline at end of file
+var _0x02e4=['ScreenRecording,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0x02e4,0x1e8));var _0x402e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x02e4[_0x432682];return _0x463d05;};'use strict';var _=require(_0x402e('0x0'));var util=require(_0x402e('0x1'));var moment=require(_0x402e('0x2'));var BPromise=require(_0x402e('0x3'));var rs=require(_0x402e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x402e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x402e('0x6'))(_0x402e('0x7'));var config=require(_0x402e('0x8'));var jayson=require(_0x402e('0x9'));var client=jayson['client'][_0x402e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc3cca8,_0x20047d,_0x48e6a1){return new BPromise(function(_0x205b1d,_0x2e4a93){return client[_0x402e('0xb')](_0xc3cca8,_0x48e6a1)[_0x402e('0xc')](function(_0x5baa32){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x20047d,_0x402e('0xd'));logger['debug'](_0x402e('0xe'),_0x20047d,_0x402e('0xd'),JSON[_0x402e('0xf')](_0x5baa32));if(_0x5baa32[_0x402e('0x10')]){if(_0x5baa32[_0x402e('0x10')][_0x402e('0x11')]===0x1f4){logger['error'](_0x402e('0x12'),_0x20047d,_0x5baa32[_0x402e('0x10')][_0x402e('0x13')]);return _0x2e4a93(_0x5baa32[_0x402e('0x10')][_0x402e('0x13')]);}logger[_0x402e('0x10')](_0x402e('0x12'),_0x20047d,_0x5baa32['error']['message']);return _0x205b1d(_0x5baa32[_0x402e('0x10')]['message']);}else{logger[_0x402e('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x20047d,'request\x20sent');_0x205b1d(_0x5baa32['result']['message']);}})[_0x402e('0x15')](function(_0x1ce647){logger[_0x402e('0x10')](_0x402e('0x12'),_0x20047d,_0x1ce647);_0x2e4a93(_0x1ce647);});});}
\ No newline at end of file
index 4e3f58e..2f50b4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32cb=['/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','post','single','file','addLogo','server/files/images/logos/','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','/now','getDate','/:id','show'];(function(_0x30e301,_0x54a816){var _0x331951=function(_0x4750c8){while(--_0x4750c8){_0x30e301['push'](_0x30e301['shift']());}};_0x331951(++_0x54a816);}(_0x32cb,0x73));var _0xb32c=function(_0x3e446d,_0x1c77d7){_0x3e446d=_0x3e446d-0x0;var _0x491f87=_0x32cb[_0x3e446d];return _0x491f87;};'use strict';var multer=require(_0xb32c('0x0'));var util=require('util');var path=require(_0xb32c('0x1'));var timeout=require(_0xb32c('0x2'));var express=require(_0xb32c('0x3'));var router=express[_0xb32c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb32c('0x5'));var interaction=require(_0xb32c('0x6'));var config=require(_0xb32c('0x7'));var controller=require(_0xb32c('0x8'));router[_0xb32c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb32c('0x9')](_0xb32c('0xa'),controller[_0xb32c('0xb')]);router[_0xb32c('0x9')](_0xb32c('0xc'),controller[_0xb32c('0xd')]);router['get'](_0xb32c('0xe'),controller[_0xb32c('0xf')]);router[_0xb32c('0x9')](_0xb32c('0x10'),controller[_0xb32c('0x11')]);router['get']('/:id/gdpr',controller[_0xb32c('0x12')]);router[_0xb32c('0x9')](_0xb32c('0x13'),controller[_0xb32c('0x14')]);router[_0xb32c('0x9')](_0xb32c('0x15'),controller[_0xb32c('0x16')]);var upload=multer({'storage':multer[_0xb32c('0x17')]({'destination':function(_0x5f22e6,_0x1a26a9,_0x1ded4d){_0x1ded4d(null,path[_0xb32c('0x18')](config[_0xb32c('0x19')],'server/files/images/logos/'));},'filename':function(_0x396e84,_0x5afbba,_0x160182){_0x160182(null,util[_0xb32c('0x1a')](_0xb32c('0x1b'),_0xb32c('0x1c'),path[_0xb32c('0x1d')](_0x5afbba[_0xb32c('0x1e')])));}})});router[_0xb32c('0x1f')](_0xb32c('0xe'),upload[_0xb32c('0x20')](_0xb32c('0x21')),controller[_0xb32c('0x22')]);var upload=multer({'storage':multer[_0xb32c('0x17')]({'destination':function(_0x254cf2,_0x3e7771,_0x2bd327){_0x2bd327(null,path[_0xb32c('0x18')](config[_0xb32c('0x19')],'server/files/images/logos/'));},'filename':function(_0x36ea01,_0x41a9c1,_0x37a499){_0x37a499(null,util[_0xb32c('0x1a')]('%s%s','logologin',path['extname'](_0x41a9c1[_0xb32c('0x1e')])));}})});router[_0xb32c('0x1f')]('/:id/logo_login',upload['single']('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xb32c('0x17')]({'destination':function(_0x341e0f,_0x74a115,_0x2a4069){_0x2a4069(null,path['join'](config['root'],_0xb32c('0x23')));},'filename':function(_0x5cae7a,_0x276857,_0x5ce47b){_0x5ce47b(null,util['format'](_0xb32c('0x1b'),'preferred',path['extname'](_0x276857[_0xb32c('0x1e')])));}})});router[_0xb32c('0x1f')](_0xb32c('0x13'),upload[_0xb32c('0x20')](_0xb32c('0x21')),controller[_0xb32c('0x24')]);var upload=multer({'storage':multer[_0xb32c('0x17')]({'destination':function(_0x50c914,_0x51705b,_0x2c1af2){_0x2c1af2(null,path[_0xb32c('0x18')](config[_0xb32c('0x19')],_0xb32c('0x23')));},'filename':function(_0xbdf21d,_0x3c0c36,_0x225101){_0x225101(null,util[_0xb32c('0x1a')](_0xb32c('0x1b'),_0xb32c('0x25'),path[_0xb32c('0x1d')](_0x3c0c36[_0xb32c('0x1e')])));}})});router[_0xb32c('0x1f')](_0xb32c('0x15'),upload[_0xb32c('0x20')](_0xb32c('0x21')),controller[_0xb32c('0x26')]);router[_0xb32c('0x27')](_0xb32c('0xc'),auth[_0xb32c('0x28')](),controller[_0xb32c('0x29')]);module[_0xb32c('0x2a')]=router;
\ No newline at end of file
+var _0x3dd8=['addLogoLogin','preferred','favicon','/:id/favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/preferred','getFavicon','join','format','%s%s','logo','extname','originalname','single','file','addLogo','diskStorage','root','server/files/images/logos/','logologin'];(function(_0x298b78,_0x1aea5d){var _0x526c0a=function(_0xf3de9){while(--_0xf3de9){_0x298b78['push'](_0x298b78['shift']());}};_0x526c0a(++_0x1aea5d);}(_0x3dd8,0x1e1));var _0x83dd=function(_0x5c25f7,_0x3a69dc){_0x5c25f7=_0x5c25f7-0x0;var _0x1d51d1=_0x3dd8[_0x5c25f7];return _0x1d51d1;};'use strict';var multer=require(_0x83dd('0x0'));var util=require(_0x83dd('0x1'));var path=require(_0x83dd('0x2'));var timeout=require(_0x83dd('0x3'));var express=require('express');var router=express[_0x83dd('0x4')]();var fs_extra=require(_0x83dd('0x5'));var auth=require(_0x83dd('0x6'));var interaction=require(_0x83dd('0x7'));var config=require(_0x83dd('0x8'));var controller=require('./setting.controller');router[_0x83dd('0x9')]('/',auth[_0x83dd('0xa')](),controller[_0x83dd('0xb')]);router[_0x83dd('0x9')](_0x83dd('0xc'),controller[_0x83dd('0xd')]);router['get'](_0x83dd('0xe'),controller[_0x83dd('0xf')]);router[_0x83dd('0x9')](_0x83dd('0x10'),controller[_0x83dd('0x11')]);router['get'](_0x83dd('0x12'),controller[_0x83dd('0x13')]);router[_0x83dd('0x9')]('/:id/gdpr',controller['gdpr']);router['get'](_0x83dd('0x14'),controller['getPreferred']);router['get']('/:id/favicon',controller[_0x83dd('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c7071,_0x4d5dc2,_0x16d319){_0x16d319(null,path[_0x83dd('0x16')](config['root'],'server/files/images/logos/'));},'filename':function(_0xc5e381,_0x596ce7,_0xeba15b){_0xeba15b(null,util[_0x83dd('0x17')](_0x83dd('0x18'),_0x83dd('0x19'),path[_0x83dd('0x1a')](_0x596ce7[_0x83dd('0x1b')])));}})});router['post']('/:id/logo',upload[_0x83dd('0x1c')](_0x83dd('0x1d')),controller[_0x83dd('0x1e')]);var upload=multer({'storage':multer[_0x83dd('0x1f')]({'destination':function(_0x16504c,_0x4aed0b,_0x180064){_0x180064(null,path[_0x83dd('0x16')](config[_0x83dd('0x20')],_0x83dd('0x21')));},'filename':function(_0x40315c,_0x1abb19,_0x3cfdd2){_0x3cfdd2(null,util[_0x83dd('0x17')](_0x83dd('0x18'),_0x83dd('0x22'),path[_0x83dd('0x1a')](_0x1abb19[_0x83dd('0x1b')])));}})});router['post'](_0x83dd('0x12'),upload['single'](_0x83dd('0x1d')),controller[_0x83dd('0x23')]);var upload=multer({'storage':multer[_0x83dd('0x1f')]({'destination':function(_0x4e73ef,_0x252b75,_0x292305){_0x292305(null,path[_0x83dd('0x16')](config[_0x83dd('0x20')],'server/files/images/logos/'));},'filename':function(_0x4a07a1,_0x23d5bb,_0x4a8bdf){_0x4a8bdf(null,util['format']('%s%s',_0x83dd('0x24'),path[_0x83dd('0x1a')](_0x23d5bb[_0x83dd('0x1b')])));}})});router['post']('/:id/preferred',upload[_0x83dd('0x1c')](_0x83dd('0x1d')),controller['addPreferred']);var upload=multer({'storage':multer[_0x83dd('0x1f')]({'destination':function(_0x4106f7,_0x5783d3,_0x26bb2f){_0x26bb2f(null,path[_0x83dd('0x16')](config[_0x83dd('0x20')],_0x83dd('0x21')));},'filename':function(_0x2b2557,_0x161595,_0x2fdfc4){_0x2fdfc4(null,util[_0x83dd('0x17')]('%s%s',_0x83dd('0x25'),path[_0x83dd('0x1a')](_0x161595[_0x83dd('0x1b')])));}})});router['post'](_0x83dd('0x26'),upload['single']('file'),controller[_0x83dd('0x27')]);router[_0x83dd('0x28')](_0x83dd('0xe'),auth[_0x83dd('0xa')](),controller[_0x83dd('0x29')]);module[_0x83dd('0x2a')]=router;
\ No newline at end of file
index b8de6cc..06d93ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52a1=['exports','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','STRING','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize'];(function(_0x4dbfac,_0x3c2c82){var _0x2b3de1=function(_0x39f81b){while(--_0x39f81b){_0x4dbfac['push'](_0x4dbfac['shift']());}};_0x2b3de1(++_0x3c2c82);}(_0x52a1,0x1b7));var _0x152a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x52a1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x152a('0x0'));module[_0x152a('0x1')]={'min_internal':{'type':Sequelize[_0x152a('0x2')](0xb),'unique':_0x152a('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x152a('0x2')](0xb),'unique':_0x152a('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x152a('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x152a('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x152a('0x7')]},'defaultLoginLogo':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x152a('0x7')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x152a('0x7')]},'pageTitle':{'type':Sequelize[_0x152a('0x7')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x152a('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x152a('0x8')},'enableEmailPreview':{'type':Sequelize[_0x152a('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x152a('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x152a('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x152a('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x152a('0x9')},'chatTimeout':{'type':Sequelize[_0x152a('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x152a('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x152a('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x152a('0x7')]},'defaultFavicon':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x152a('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x152a('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x152a('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x152a('0x2')]},'transcribeRegion':{'type':Sequelize[_0x152a('0x7')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x152a('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x152a('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x152a('0x7')]},'bucket':{'type':Sequelize[_0x152a('0x7')]},'googleSsoEnabled':{'type':Sequelize[_0x152a('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x152a('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x152a('0x2')](0x2)[_0x152a('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x152a('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x152a('0x2')](0x2)[_0x152a('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x152a('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x152a('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x152a('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x152a('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x152a('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}};
\ No newline at end of file
+var _0xae6e=['BOOLEAN','STRING','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_internal','/var/opt/motion2/server/files/sounds/converted'];(function(_0x2d82c5,_0x39ff2d){var _0x11a7bc=function(_0x36f9b5){while(--_0x36f9b5){_0x2d82c5['push'](_0x2d82c5['shift']());}};_0x11a7bc(++_0x39ff2d);}(_0xae6e,0x1e5));var _0xeae6=function(_0x38fa54,_0x491546){_0x38fa54=_0x38fa54-0x0;var _0x26ba96=_0xae6e[_0x38fa54];return _0x26ba96;};'use strict';var Sequelize=require(_0xeae6('0x0'));module[_0xeae6('0x1')]={'min_internal':{'type':Sequelize[_0xeae6('0x2')](0xb),'unique':_0xeae6('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xeae6('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xeae6('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xeae6('0x4')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xeae6('0x6')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0xeae6('0x6')]},'turnpassword':{'type':Sequelize[_0xeae6('0x6')]},'pageTitle':{'type':Sequelize[_0xeae6('0x6')]},'defaultPageTitle':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xeae6('0x6')],'defaultValue':_0xeae6('0x7')},'enableEmailPreview':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xeae6('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xeae6('0x6')]},'defaultPreferred':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xeae6('0x6')]},'allowedLoginAttempts':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xeae6('0x6')]},'defaultFavicon':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xeae6('0x2')]},'transcribeRegion':{'type':Sequelize[_0xeae6('0x6')]},'sentiment':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xeae6('0x6')]},'language':{'type':Sequelize[_0xeae6('0x6')]},'bucket':{'type':Sequelize[_0xeae6('0x6')]},'googleSsoEnabled':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xeae6('0x2')](0x2)[_0xeae6('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xeae6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xeae6('0x2')](0x2)[_0xeae6('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xeae6('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xeae6('0x2')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14}};
\ No newline at end of file
index 2bcdd68..88c626b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd88b=['findAll','rows','catch','show','params','includeAll','find','body','file','logo','filename','loginLogo','server/files/images/logos','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','getLicense','default_loginLogo.svg','download','gdpr','favicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Setting','include'];(function(_0x128bc9,_0x16e23b){var _0x560784=function(_0x53a3d7){while(--_0x53a3d7){_0x128bc9['push'](_0x128bc9['shift']());}};_0x560784(++_0x16e23b);}(_0xd88b,0xa7));var _0xbd88=function(_0x441c7b,_0x1191f6){_0x441c7b=_0x441c7b-0x0;var _0x582068=_0xd88b[_0x441c7b];return _0x582068;};'use strict';var emlformat=require(_0xbd88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd88('0x1'));var jsonpatch=require(_0xbd88('0x2'));var rp=require(_0xbd88('0x3'));var moment=require(_0xbd88('0x4'));var BPromise=require(_0xbd88('0x5'));var Mustache=require(_0xbd88('0x6'));var util=require(_0xbd88('0x7'));var path=require(_0xbd88('0x8'));var sox=require(_0xbd88('0x9'));var csv=require(_0xbd88('0xa'));var ejs=require(_0xbd88('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd88('0xc'));var squel=require('squel');var crypto=require(_0xbd88('0xd'));var jsforce=require(_0xbd88('0xe'));var deskjs=require(_0xbd88('0xf'));var toCsv=require(_0xbd88('0xa'));var querystring=require(_0xbd88('0x10'));var Papa=require(_0xbd88('0x11'));var Redis=require(_0xbd88('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbd88('0x13'));var as=require(_0xbd88('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd88('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xbd88('0x16'));var licenseUtil=require(_0xbd88('0x17'));var db=require(_0xbd88('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xbd88('0x19')][_0xbd88('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3e4cc8,_0x3f943a,_0x208ba1,_0x2429d7){return new BPromise(function(_0x60486d,_0x5bf7f5){var _0x2b405e=_0x2429d7||client;return _0x2b405e['request'](_0x3e4cc8,_0x208ba1)[_0xbd88('0x1b')](function(_0x1777e4){logger[_0xbd88('0x1c')](_0xbd88('0x1d'),_0x3f943a,_0xbd88('0x1e'));logger[_0xbd88('0x1f')](_0xbd88('0x20'),_0x3f943a,_0xbd88('0x1e'),JSON[_0xbd88('0x21')](_0x1777e4));if(_0x1777e4[_0xbd88('0x22')]){if(_0x1777e4[_0xbd88('0x22')][_0xbd88('0x23')]===0x1f4){logger[_0xbd88('0x22')](_0xbd88('0x1d'),_0x3f943a,_0x1777e4['error'][_0xbd88('0x24')]);return _0x5bf7f5(_0x1777e4[_0xbd88('0x22')][_0xbd88('0x24')]);}logger[_0xbd88('0x22')](_0xbd88('0x1d'),_0x3f943a,_0x1777e4[_0xbd88('0x22')]['message']);return _0x60486d(_0x1777e4[_0xbd88('0x22')][_0xbd88('0x24')]);}else{logger[_0xbd88('0x1c')](_0xbd88('0x1d'),_0x3f943a,'request\x20sent');_0x60486d(_0x1777e4[_0xbd88('0x25')][_0xbd88('0x24')]);}})['catch'](function(_0x2bc983){logger['error'](_0xbd88('0x1d'),_0x3f943a,_0x2bc983);_0x5bf7f5(_0x2bc983);});});}function respondWithStatusCode(_0x434be2,_0x45e9f6){_0x45e9f6=_0x45e9f6||0xcc;return function(_0x3df1bf){if(_0x3df1bf){return _0x434be2[_0xbd88('0x26')](_0x45e9f6);}return _0x434be2['status'](_0x45e9f6)[_0xbd88('0x27')]();};}function respondWithResult(_0x4c0e9f,_0x4e59c9){_0x4e59c9=_0x4e59c9||0xc8;return function(_0x507bec){if(_0x507bec){return _0x4c0e9f['status'](_0x4e59c9)[_0xbd88('0x28')](_0x507bec);}};}function respondWithFilteredResult(_0x2995b7,_0x5e43b5){return function(_0x164a58){if(_0x164a58){var _0x4956f5=typeof _0x5e43b5[_0xbd88('0x29')]===_0xbd88('0x2a')&&typeof _0x5e43b5['limit']===_0xbd88('0x2a');var _0x2059e2=_0x164a58[_0xbd88('0x2b')];var _0x2f8f3a=_0x4956f5?0x0:_0x5e43b5[_0xbd88('0x29')];var _0x526b13=_0x4956f5?_0x164a58[_0xbd88('0x2b')]:_0x5e43b5[_0xbd88('0x29')]+_0x5e43b5[_0xbd88('0x2c')];var _0x32bc6a;if(_0x526b13>=_0x2059e2){_0x526b13=_0x2059e2;_0x32bc6a=0xc8;}else{_0x32bc6a=0xce;}_0x2995b7[_0xbd88('0x2d')](_0x32bc6a);return _0x2995b7[_0xbd88('0x2e')](_0xbd88('0x2f'),_0x2f8f3a+'-'+_0x526b13+'/'+_0x2059e2)[_0xbd88('0x28')](_0x164a58);}return null;};}function patchUpdates(_0x8d3771){return function(_0x1df5d0){try{jsonpatch[_0xbd88('0x30')](_0x1df5d0,_0x8d3771,!![]);}catch(_0x9da0ab){return BPromise[_0xbd88('0x31')](_0x9da0ab);}return _0x1df5d0[_0xbd88('0x32')]();};}function saveUpdates(_0x379b92,_0x164d22){return function(_0x5dc100){if(_0x5dc100){return _0x5dc100[_0xbd88('0x33')](_0x379b92)[_0xbd88('0x1b')](function(_0x41497e){return _0x41497e;});}return null;};}function removeEntity(_0x1697a6,_0x27bdb0){return function(_0x5bd1cb){if(_0x5bd1cb){return _0x5bd1cb[_0xbd88('0x34')]()[_0xbd88('0x1b')](function(){_0x1697a6[_0xbd88('0x2d')](0xcc)[_0xbd88('0x27')]();});}};}function handleEntityNotFound(_0x4499ff,_0x40814d){return function(_0x35dc32){if(!_0x35dc32){_0x4499ff[_0xbd88('0x26')](0x194);}return _0x35dc32;};}function handleError(_0x898e6d,_0x2b48ed){_0x2b48ed=_0x2b48ed||0x1f4;return function(_0x55dc6f){logger[_0xbd88('0x22')](_0x55dc6f[_0xbd88('0x35')]);if(_0x55dc6f[_0xbd88('0x36')]){delete _0x55dc6f[_0xbd88('0x36')];}_0x898e6d[_0xbd88('0x2d')](_0x2b48ed)[_0xbd88('0x37')](_0x55dc6f);};}exports[_0xbd88('0x38')]=function(_0x450d67,_0x3f4dbd){var _0x30300f={},_0x12da95={},_0x39681d={'count':0x0,'rows':[]};var _0x4b16f6=_['map'](db['Setting'][_0xbd88('0x39')],function(_0x54d412){return{'name':_0x54d412[_0xbd88('0x3a')],'type':_0x54d412[_0xbd88('0x3b')][_0xbd88('0x3c')]};});_0x12da95[_0xbd88('0x3d')]=_[_0xbd88('0x3e')](_0x4b16f6,_0xbd88('0x36'));_0x12da95[_0xbd88('0x3f')]=_[_0xbd88('0x40')](_0x450d67[_0xbd88('0x3f')]);_0x12da95[_0xbd88('0x41')]=_[_0xbd88('0x42')](_0x12da95[_0xbd88('0x3d')],_0x12da95[_0xbd88('0x3f')]);_0x30300f[_0xbd88('0x43')]=_['intersection'](_0x12da95['model'],qs['fields'](_0x450d67[_0xbd88('0x3f')][_0xbd88('0x44')]));_0x30300f[_0xbd88('0x43')]=_0x30300f[_0xbd88('0x43')][_0xbd88('0x45')]?_0x30300f['attributes']:_0x12da95['model'];if(!_0x450d67[_0xbd88('0x3f')][_0xbd88('0x46')](_0xbd88('0x47'))){_0x30300f[_0xbd88('0x2c')]=qs[_0xbd88('0x2c')](_0x450d67[_0xbd88('0x3f')][_0xbd88('0x2c')]);_0x30300f[_0xbd88('0x29')]=qs[_0xbd88('0x29')](_0x450d67[_0xbd88('0x3f')][_0xbd88('0x29')]);}_0x30300f[_0xbd88('0x48')]=qs[_0xbd88('0x49')](_0x450d67[_0xbd88('0x3f')]['sort']);_0x30300f[_0xbd88('0x4a')]=qs[_0xbd88('0x41')](_['pick'](_0x450d67['query'],_0x12da95[_0xbd88('0x41')]),_0x4b16f6);if(_0x450d67[_0xbd88('0x3f')][_0xbd88('0x4b')]){_0x30300f['where']=_[_0xbd88('0x4c')](_0x30300f[_0xbd88('0x4a')],{'$or':_[_0xbd88('0x3e')](_0x4b16f6,function(_0x5657c5){if(_0x5657c5[_0xbd88('0x3b')]!==_0xbd88('0x4d')){var _0x35ab66={};_0x35ab66[_0x5657c5[_0xbd88('0x36')]]={'$like':'%'+_0x450d67[_0xbd88('0x3f')][_0xbd88('0x4b')]+'%'};return _0x35ab66;}})});}_0x30300f=_[_0xbd88('0x4c')]({},_0x30300f,_0x450d67[_0xbd88('0x4e')]);var _0x2e2b09={'where':_0x30300f[_0xbd88('0x4a')]};return db[_0xbd88('0x4f')][_0xbd88('0x2b')](_0x2e2b09)[_0xbd88('0x1b')](function(_0x54cb17){_0x39681d['count']=_0x54cb17;if(_0x450d67[_0xbd88('0x3f')]['includeAll']){_0x30300f[_0xbd88('0x50')]=[{'all':!![]}];}return db[_0xbd88('0x4f')][_0xbd88('0x51')](_0x30300f);})[_0xbd88('0x1b')](function(_0x268724){_0x39681d[_0xbd88('0x52')]=_0x268724;return _0x39681d;})[_0xbd88('0x1b')](respondWithFilteredResult(_0x3f4dbd,_0x30300f))[_0xbd88('0x53')](handleError(_0x3f4dbd,null));};exports[_0xbd88('0x54')]=function(_0xc9e90,_0xe9f8c4){var _0x334028={'raw':![],'where':{'id':_0xc9e90[_0xbd88('0x55')]['id']}},_0x513548={};_0x513548[_0xbd88('0x3d')]=_['keys'](db[_0xbd88('0x4f')][_0xbd88('0x39')]);_0x513548[_0xbd88('0x3f')]=_[_0xbd88('0x40')](_0xc9e90[_0xbd88('0x3f')]);_0x513548['filters']=_[_0xbd88('0x42')](_0x513548[_0xbd88('0x3d')],_0x513548['query']);_0x334028[_0xbd88('0x43')]=_[_0xbd88('0x42')](_0x513548['model'],qs[_0xbd88('0x44')](_0xc9e90[_0xbd88('0x3f')][_0xbd88('0x44')]));_0x334028[_0xbd88('0x43')]=_0x334028[_0xbd88('0x43')][_0xbd88('0x45')]?_0x334028[_0xbd88('0x43')]:_0x513548['model'];if(_0xc9e90[_0xbd88('0x3f')][_0xbd88('0x56')]){_0x334028[_0xbd88('0x50')]=[{'all':!![]}];}_0x334028=_[_0xbd88('0x4c')]({},_0x334028,_0xc9e90[_0xbd88('0x4e')]);return db[_0xbd88('0x4f')][_0xbd88('0x57')](_0x334028)[_0xbd88('0x1b')](handleEntityNotFound(_0xe9f8c4,null))[_0xbd88('0x1b')](respondWithResult(_0xe9f8c4,null))[_0xbd88('0x53')](handleError(_0xe9f8c4,null));};exports[_0xbd88('0x33')]=function(_0x340fe4,_0x1bdd93){if(_0x340fe4[_0xbd88('0x58')]['id']){delete _0x340fe4[_0xbd88('0x58')]['id'];}return db[_0xbd88('0x4f')][_0xbd88('0x57')]({'where':{'id':_0x340fe4['params']['id']}})[_0xbd88('0x1b')](handleEntityNotFound(_0x1bdd93,null))[_0xbd88('0x1b')](saveUpdates(_0x340fe4[_0xbd88('0x58')],null))[_0xbd88('0x1b')](respondWithResult(_0x1bdd93,null))[_0xbd88('0x53')](handleError(_0x1bdd93,null));};exports['addLogo']=function(_0x1f6f48,_0xbfebec,_0x401736){if(_0x1f6f48[_0xbd88('0x59')]&&_0x1f6f48[_0xbd88('0x59')]['filename']){_0x1f6f48['body'][_0xbd88('0x5a')]=_0x1f6f48[_0xbd88('0x59')]['filename'];}return db[_0xbd88('0x4f')]['find']({'where':{'id':_0x1f6f48[_0xbd88('0x55')]['id']}})['then'](handleEntityNotFound(_0xbfebec,null))[_0xbd88('0x1b')](saveUpdates(_0x1f6f48['body'],null))[_0xbd88('0x1b')](respondWithResult(_0xbfebec,null))[_0xbd88('0x53')](handleError(_0xbfebec,null));};exports['addLogoLogin']=function(_0x16edc0,_0x3d246a,_0x264261){if(_0x16edc0['file']&&_0x16edc0[_0xbd88('0x59')][_0xbd88('0x5b')]){_0x16edc0[_0xbd88('0x58')][_0xbd88('0x5c')]=_0x16edc0[_0xbd88('0x59')][_0xbd88('0x5b')];}return db['Setting'][_0xbd88('0x57')]({'where':{'id':_0x16edc0[_0xbd88('0x55')]['id']}})[_0xbd88('0x1b')](handleEntityNotFound(_0x3d246a,null))[_0xbd88('0x1b')](saveUpdates(_0x16edc0[_0xbd88('0x58')],null))['then'](respondWithResult(_0x3d246a,null))[_0xbd88('0x53')](handleError(_0x3d246a,null));};var utilLicense=require(_0xbd88('0x17'));exports['getLogo']=function(_0x3249b3,_0x546c93,_0x1277a9){var _0x2c792d=_0xbd88('0x5d');var _0x3e5dcb={'custom':![]};return utilLicense['getLicense']()[_0xbd88('0x1b')](function(_0x3f73f0){if(_0x3f73f0){_0x3e5dcb=_0x3f73f0;}return db[_0xbd88('0x4f')][_0xbd88('0x57')]({'where':{'id':_0x3249b3[_0xbd88('0x55')]['id']},'attributes':[_0xbd88('0x5a'),'loginLogo',_0xbd88('0x5e'),'favicon',_0xbd88('0x5f'),_0xbd88('0x60'),_0xbd88('0x61'),_0xbd88('0x62')],'raw':!![]});})['then'](handleEntityNotFound(_0x546c93,null))[_0xbd88('0x1b')](function(_0x381a32){if(_0x381a32){var _0x58c4d1=_0x381a32[_0xbd88('0x5a')]&&fs[_0xbd88('0x63')](path['join'](config[_0xbd88('0x64')],_0x2c792d,_[_0xbd88('0x65')](_0x381a32[_0xbd88('0x5a')])))?path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x2c792d,_[_0xbd88('0x65')](_0x381a32[_0xbd88('0x5a')])):path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x2c792d,_[_0xbd88('0x65')](_0xbd88('0x67')));var _0x4062e7=_0xbd88('0x68')+_[_0xbd88('0x69')](_0xbd88('0x5a'));if(_0x381a32[_0x4062e7]||!_0x3e5dcb[_0xbd88('0x6a')]){_0x58c4d1=path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x2c792d,_[_0xbd88('0x65')]('default_logo.svg'));}if(!fs['existsSync'](_0x58c4d1)){throw new db[(_0xbd88('0x6b'))][(_0xbd88('0x6c'))](_['upperFirst'](_0xbd88('0x5a'))+_0xbd88('0x6d'));}return _0x546c93['download'](_0x58c4d1);}})[_0xbd88('0x53')](handleError(_0x546c93,null));};var utilLicense=require('../../config/license/util');exports[_0xbd88('0x6e')]=function(_0x16a8af,_0x3f3817,_0x30212d){var _0x4a647a=_0xbd88('0x5d');var _0x59c709={'custom':![]};return utilLicense[_0xbd88('0x6f')]()['then'](function(_0x402c22){if(_0x402c22){_0x59c709=_0x402c22;}return db[_0xbd88('0x4f')][_0xbd88('0x57')]({'where':{'id':_0x16a8af[_0xbd88('0x55')]['id']},'attributes':[_0xbd88('0x5a'),'loginLogo',_0xbd88('0x5e'),'favicon',_0xbd88('0x5f'),_0xbd88('0x60'),_0xbd88('0x61'),'defaultFavicon'],'raw':!![]});})[_0xbd88('0x1b')](handleEntityNotFound(_0x3f3817,null))[_0xbd88('0x1b')](function(_0x308e2c){if(_0x308e2c){var _0x24d591=_0x308e2c[_0xbd88('0x5c')]&&fs['existsSync'](path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x4a647a,_[_0xbd88('0x65')](_0x308e2c[_0xbd88('0x5c')])))?path[_0xbd88('0x66')](config['root'],_0x4a647a,_[_0xbd88('0x65')](_0x308e2c['loginLogo'])):path[_0xbd88('0x66')](config['root'],_0x4a647a,_[_0xbd88('0x65')](_0xbd88('0x70')));var _0x2e6daf='default'+_['upperFirst'](_0xbd88('0x5c'));if(_0x308e2c[_0x2e6daf]||!_0x59c709[_0xbd88('0x6a')]){_0x24d591=path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x4a647a,_[_0xbd88('0x65')]('default_loginLogo.svg'));}if(!fs[_0xbd88('0x63')](_0x24d591)){throw new db['Sequelize'][(_0xbd88('0x6c'))](_[_0xbd88('0x69')]('loginLogo')+_0xbd88('0x6d'));}return _0x3f3817[_0xbd88('0x71')](_0x24d591);}})[_0xbd88('0x53')](handleError(_0x3f3817,null));};exports[_0xbd88('0x72')]=function(_0x7bae1,_0x5eece3){return db['Setting'][_0xbd88('0x57')]({'where':{'id':_0x7bae1[_0xbd88('0x55')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x5eece3,null))[_0xbd88('0x53')](handleError(_0x5eece3,null));};exports['addPreferred']=function(_0x485053,_0x42ae76,_0x2881f2){if(_0x485053['file']&&_0x485053[_0xbd88('0x59')][_0xbd88('0x5b')]){_0x485053[_0xbd88('0x58')][_0xbd88('0x5e')]=_0x485053['file'][_0xbd88('0x5b')];}return db[_0xbd88('0x4f')][_0xbd88('0x57')]({'where':{'id':_0x485053[_0xbd88('0x55')]['id']}})[_0xbd88('0x1b')](handleEntityNotFound(_0x42ae76,null))[_0xbd88('0x1b')](saveUpdates(_0x485053[_0xbd88('0x58')],null))[_0xbd88('0x1b')](respondWithResult(_0x42ae76,null))[_0xbd88('0x53')](handleError(_0x42ae76,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0xce944b,_0x3cf4ac,_0x4f2e64){var _0x1df551=_0xbd88('0x5d');var _0x2b7269={'custom':![]};return utilLicense[_0xbd88('0x6f')]()[_0xbd88('0x1b')](function(_0x58810c){if(_0x58810c){_0x2b7269=_0x58810c;}return db[_0xbd88('0x4f')][_0xbd88('0x57')]({'where':{'id':_0xce944b['params']['id']},'attributes':[_0xbd88('0x5a'),'loginLogo','preferred',_0xbd88('0x73'),_0xbd88('0x5f'),_0xbd88('0x60'),_0xbd88('0x61'),_0xbd88('0x62')],'raw':!![]});})[_0xbd88('0x1b')](handleEntityNotFound(_0x3cf4ac,null))[_0xbd88('0x1b')](function(_0x27d26c){if(_0x27d26c){var _0x520724=_0x27d26c[_0xbd88('0x5e')]&&fs[_0xbd88('0x63')](path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x1df551,_[_0xbd88('0x65')](_0x27d26c[_0xbd88('0x5e')])))?path[_0xbd88('0x66')](config['root'],_0x1df551,_[_0xbd88('0x65')](_0x27d26c[_0xbd88('0x5e')])):path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x1df551,_[_0xbd88('0x65')](_0xbd88('0x74')));var _0x4167ef=_0xbd88('0x68')+_[_0xbd88('0x69')](_0xbd88('0x5e'));if(_0x27d26c[_0x4167ef]||!_0x2b7269[_0xbd88('0x6a')]||!_0x2b7269[_0xbd88('0x5e')]){_0x520724=path['join'](config['root'],_0x1df551,_[_0xbd88('0x65')](_0xbd88('0x74')));}if(!fs[_0xbd88('0x63')](_0x520724)){throw new db[(_0xbd88('0x6b'))][(_0xbd88('0x6c'))](_[_0xbd88('0x69')](_0xbd88('0x5e'))+_0xbd88('0x6d'));}return _0x3cf4ac[_0xbd88('0x71')](_0x520724);}})[_0xbd88('0x53')](handleError(_0x3cf4ac,null));};exports[_0xbd88('0x75')]=function(_0x1188d3,_0x3900a0,_0x3c6e6e){if(_0x1188d3['file']&&_0x1188d3['file'][_0xbd88('0x5b')]){_0x1188d3[_0xbd88('0x58')]['favicon']=_0x1188d3[_0xbd88('0x59')][_0xbd88('0x5b')];}return db[_0xbd88('0x4f')][_0xbd88('0x57')]({'where':{'id':_0x1188d3[_0xbd88('0x55')]['id']}})[_0xbd88('0x1b')](handleEntityNotFound(_0x3900a0,null))[_0xbd88('0x1b')](saveUpdates(_0x1188d3[_0xbd88('0x58')],null))[_0xbd88('0x1b')](respondWithResult(_0x3900a0,null))[_0xbd88('0x53')](handleError(_0x3900a0,null));};var utilLicense=require('../../config/license/util');exports[_0xbd88('0x76')]=function(_0x440612,_0x5204b2,_0x1c1c43){var _0x2cb78c=_0xbd88('0x5d');var _0x3f3a7d={'custom':![]};return utilLicense[_0xbd88('0x6f')]()[_0xbd88('0x1b')](function(_0x13bf3d){if(_0x13bf3d){_0x3f3a7d=_0x13bf3d;}return db[_0xbd88('0x4f')][_0xbd88('0x57')]({'where':{'id':_0x440612['params']['id']},'attributes':[_0xbd88('0x5a'),_0xbd88('0x5c'),_0xbd88('0x5e'),'favicon','defaultLogo',_0xbd88('0x60'),_0xbd88('0x61'),_0xbd88('0x62')],'raw':!![]});})[_0xbd88('0x1b')](handleEntityNotFound(_0x5204b2,null))['then'](function(_0x49d73b){if(_0x49d73b){var _0x21be86=_0x49d73b[_0xbd88('0x73')]&&fs['existsSync'](path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x2cb78c,_[_0xbd88('0x65')](_0x49d73b['favicon'])))?path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x2cb78c,_[_0xbd88('0x65')](_0x49d73b[_0xbd88('0x73')])):path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x2cb78c,_['toLower']('default_favicon.ico'));var _0x3363f7=_0xbd88('0x68')+_[_0xbd88('0x69')]('favicon');if(_0x49d73b[_0x3363f7]||!_0x3f3a7d[_0xbd88('0x6a')]){_0x21be86=path[_0xbd88('0x66')](config[_0xbd88('0x64')],_0x2cb78c,_['toLower'](_0xbd88('0x77')));}if(!fs[_0xbd88('0x63')](_0x21be86)){throw new db[(_0xbd88('0x6b'))][(_0xbd88('0x6c'))](_[_0xbd88('0x69')](_0xbd88('0x73'))+_0xbd88('0x6d'));}return _0x5204b2[_0xbd88('0x71')](_0x21be86);}})[_0xbd88('0x53')](handleError(_0x5204b2,null));};exports[_0xbd88('0x78')]=function(_0x402b2d,_0x423aa6){var _0x14306a={'offset':moment()['utcOffset']()};_0x14306a[_0xbd88('0x79')]=moment()[_0xbd88('0x7a')](_0x14306a[_0xbd88('0x29')])[_0xbd88('0x7b')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x423aa6[_0xbd88('0x2d')](0xc8)[_0xbd88('0x37')](_0x14306a);};
\ No newline at end of file
+var _0xcae6=['fields','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','find','update','body','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','logo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','default_loginLogo.svg','gdpr','addPreferred','preferred','getPreferred','default_preferred.png','Sequelize','addFavicon','getFavicon','default_favicon.ico','getDate','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','index','map','Setting','rawAttributes','fieldName','type','model','keys','filters','intersection'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xcae6,0x1ae));var _0x6cae=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0xcae6[_0x421c56];return _0x49b244;};'use strict';var emlformat=require(_0x6cae('0x0'));var rimraf=require(_0x6cae('0x1'));var zipdir=require(_0x6cae('0x2'));var jsonpatch=require(_0x6cae('0x3'));var rp=require('request-promise');var moment=require(_0x6cae('0x4'));var BPromise=require(_0x6cae('0x5'));var Mustache=require(_0x6cae('0x6'));var util=require('util');var path=require(_0x6cae('0x7'));var sox=require(_0x6cae('0x8'));var csv=require(_0x6cae('0x9'));var ejs=require(_0x6cae('0xa'));var fs=require('fs');var fs_extra=require(_0x6cae('0xb'));var _=require(_0x6cae('0xc'));var squel=require('squel');var crypto=require(_0x6cae('0xd'));var jsforce=require(_0x6cae('0xe'));var deskjs=require(_0x6cae('0xf'));var toCsv=require(_0x6cae('0x9'));var querystring=require(_0x6cae('0x10'));var Papa=require(_0x6cae('0x11'));var Redis=require(_0x6cae('0x12'));var authService=require(_0x6cae('0x13'));var qs=require(_0x6cae('0x14'));var as=require(_0x6cae('0x15'));var hardwareService=require(_0x6cae('0x16'));var logger=require(_0x6cae('0x17'))('api');var utils=require(_0x6cae('0x18'));var config=require(_0x6cae('0x19'));var licenseUtil=require(_0x6cae('0x1a'));var db=require(_0x6cae('0x1b'))['db'];var jayson=require(_0x6cae('0x1c'));var client=jayson[_0x6cae('0x1d')][_0x6cae('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x274dd4,_0x1b0454,_0x403d65,_0xe2da53){return new BPromise(function(_0x161a15,_0x33843f){var _0x48e474=_0xe2da53||client;return _0x48e474['request'](_0x274dd4,_0x403d65)['then'](function(_0x5656d6){logger[_0x6cae('0x1f')](_0x6cae('0x20'),_0x1b0454,_0x6cae('0x21'));logger[_0x6cae('0x22')]('Setting,\x20%s,\x20%s,\x20%s',_0x1b0454,_0x6cae('0x21'),JSON[_0x6cae('0x23')](_0x5656d6));if(_0x5656d6['error']){if(_0x5656d6[_0x6cae('0x24')][_0x6cae('0x25')]===0x1f4){logger[_0x6cae('0x24')](_0x6cae('0x20'),_0x1b0454,_0x5656d6[_0x6cae('0x24')][_0x6cae('0x26')]);return _0x33843f(_0x5656d6[_0x6cae('0x24')][_0x6cae('0x26')]);}logger['error'](_0x6cae('0x20'),_0x1b0454,_0x5656d6[_0x6cae('0x24')][_0x6cae('0x26')]);return _0x161a15(_0x5656d6[_0x6cae('0x24')][_0x6cae('0x26')]);}else{logger[_0x6cae('0x1f')](_0x6cae('0x20'),_0x1b0454,'request\x20sent');_0x161a15(_0x5656d6[_0x6cae('0x27')]['message']);}})[_0x6cae('0x28')](function(_0x249b98){logger['error'](_0x6cae('0x20'),_0x1b0454,_0x249b98);_0x33843f(_0x249b98);});});}function respondWithStatusCode(_0x350404,_0x2f8b47){_0x2f8b47=_0x2f8b47||0xcc;return function(_0x248a02){if(_0x248a02){return _0x350404[_0x6cae('0x29')](_0x2f8b47);}return _0x350404[_0x6cae('0x2a')](_0x2f8b47)[_0x6cae('0x2b')]();};}function respondWithResult(_0x351c14,_0x55f644){_0x55f644=_0x55f644||0xc8;return function(_0x599060){if(_0x599060){return _0x351c14[_0x6cae('0x2a')](_0x55f644)['json'](_0x599060);}};}function respondWithFilteredResult(_0x15fb5b,_0x5094db){return function(_0xa0ffb4){if(_0xa0ffb4){var _0x3f64eb=typeof _0x5094db[_0x6cae('0x2c')]===_0x6cae('0x2d')&&typeof _0x5094db[_0x6cae('0x2e')]===_0x6cae('0x2d');var _0x43fd3a=_0xa0ffb4[_0x6cae('0x2f')];var _0x2fe3fc=_0x3f64eb?0x0:_0x5094db['offset'];var _0x3a466c=_0x3f64eb?_0xa0ffb4['count']:_0x5094db['offset']+_0x5094db[_0x6cae('0x2e')];var _0x6b30bb;if(_0x3a466c>=_0x43fd3a){_0x3a466c=_0x43fd3a;_0x6b30bb=0xc8;}else{_0x6b30bb=0xce;}_0x15fb5b[_0x6cae('0x2a')](_0x6b30bb);return _0x15fb5b[_0x6cae('0x30')]('Content-Range',_0x2fe3fc+'-'+_0x3a466c+'/'+_0x43fd3a)['json'](_0xa0ffb4);}return null;};}function patchUpdates(_0xa80a9c){return function(_0x21ec87){try{jsonpatch[_0x6cae('0x31')](_0x21ec87,_0xa80a9c,!![]);}catch(_0x1a323a){return BPromise[_0x6cae('0x32')](_0x1a323a);}return _0x21ec87[_0x6cae('0x33')]();};}function saveUpdates(_0xc46fc5,_0x41fd7c){return function(_0x58ec36){if(_0x58ec36){return _0x58ec36['update'](_0xc46fc5)[_0x6cae('0x34')](function(_0x12aa61){return _0x12aa61;});}return null;};}function removeEntity(_0x2bda72,_0x136918){return function(_0x29970f){if(_0x29970f){return _0x29970f[_0x6cae('0x35')]()['then'](function(){_0x2bda72[_0x6cae('0x2a')](0xcc)[_0x6cae('0x2b')]();});}};}function handleEntityNotFound(_0x2935f3,_0x4bd33e){return function(_0x382537){if(!_0x382537){_0x2935f3[_0x6cae('0x29')](0x194);}return _0x382537;};}function handleError(_0x333655,_0x1b99b3){_0x1b99b3=_0x1b99b3||0x1f4;return function(_0x5b7928){logger[_0x6cae('0x24')](_0x5b7928[_0x6cae('0x36')]);if(_0x5b7928[_0x6cae('0x37')]){delete _0x5b7928[_0x6cae('0x37')];}_0x333655[_0x6cae('0x2a')](_0x1b99b3)['send'](_0x5b7928);};}exports[_0x6cae('0x38')]=function(_0xee3be4,_0x2c6f0b){var _0x2c1250={},_0xaee04={},_0x3c5149={'count':0x0,'rows':[]};var _0x2d3abf=_[_0x6cae('0x39')](db[_0x6cae('0x3a')][_0x6cae('0x3b')],function(_0x100089){return{'name':_0x100089[_0x6cae('0x3c')],'type':_0x100089[_0x6cae('0x3d')]['key']};});_0xaee04[_0x6cae('0x3e')]=_['map'](_0x2d3abf,_0x6cae('0x37'));_0xaee04['query']=_[_0x6cae('0x3f')](_0xee3be4['query']);_0xaee04[_0x6cae('0x40')]=_[_0x6cae('0x41')](_0xaee04[_0x6cae('0x3e')],_0xaee04['query']);_0x2c1250['attributes']=_[_0x6cae('0x41')](_0xaee04['model'],qs[_0x6cae('0x42')](_0xee3be4[_0x6cae('0x43')][_0x6cae('0x42')]));_0x2c1250['attributes']=_0x2c1250[_0x6cae('0x44')][_0x6cae('0x45')]?_0x2c1250[_0x6cae('0x44')]:_0xaee04[_0x6cae('0x3e')];if(!_0xee3be4[_0x6cae('0x43')][_0x6cae('0x46')](_0x6cae('0x47'))){_0x2c1250[_0x6cae('0x2e')]=qs[_0x6cae('0x2e')](_0xee3be4[_0x6cae('0x43')][_0x6cae('0x2e')]);_0x2c1250[_0x6cae('0x2c')]=qs[_0x6cae('0x2c')](_0xee3be4[_0x6cae('0x43')][_0x6cae('0x2c')]);}_0x2c1250['order']=qs[_0x6cae('0x48')](_0xee3be4[_0x6cae('0x43')][_0x6cae('0x48')]);_0x2c1250[_0x6cae('0x49')]=qs[_0x6cae('0x40')](_[_0x6cae('0x4a')](_0xee3be4[_0x6cae('0x43')],_0xaee04['filters']),_0x2d3abf);if(_0xee3be4[_0x6cae('0x43')][_0x6cae('0x4b')]){_0x2c1250['where']=_['merge'](_0x2c1250[_0x6cae('0x49')],{'$or':_[_0x6cae('0x39')](_0x2d3abf,function(_0x2d3e9a){if(_0x2d3e9a['type']!=='VIRTUAL'){var _0x125fca={};_0x125fca[_0x2d3e9a[_0x6cae('0x37')]]={'$like':'%'+_0xee3be4[_0x6cae('0x43')]['filter']+'%'};return _0x125fca;}})});}_0x2c1250=_[_0x6cae('0x4c')]({},_0x2c1250,_0xee3be4[_0x6cae('0x4d')]);var _0x3b2f68={'where':_0x2c1250[_0x6cae('0x49')]};return db['Setting'][_0x6cae('0x2f')](_0x3b2f68)['then'](function(_0x1ac7e8){_0x3c5149[_0x6cae('0x2f')]=_0x1ac7e8;if(_0xee3be4[_0x6cae('0x43')][_0x6cae('0x4e')]){_0x2c1250[_0x6cae('0x4f')]=[{'all':!![]}];}return db[_0x6cae('0x3a')][_0x6cae('0x50')](_0x2c1250);})[_0x6cae('0x34')](function(_0x392b72){_0x3c5149['rows']=_0x392b72;return _0x3c5149;})[_0x6cae('0x34')](respondWithFilteredResult(_0x2c6f0b,_0x2c1250))[_0x6cae('0x28')](handleError(_0x2c6f0b,null));};exports['show']=function(_0x4cd3ac,_0x1289ac){var _0x4fdf4d={'raw':![],'where':{'id':_0x4cd3ac[_0x6cae('0x51')]['id']}},_0x521ef1={};_0x521ef1[_0x6cae('0x3e')]=_['keys'](db[_0x6cae('0x3a')]['rawAttributes']);_0x521ef1[_0x6cae('0x43')]=_[_0x6cae('0x3f')](_0x4cd3ac[_0x6cae('0x43')]);_0x521ef1[_0x6cae('0x40')]=_[_0x6cae('0x41')](_0x521ef1[_0x6cae('0x3e')],_0x521ef1[_0x6cae('0x43')]);_0x4fdf4d[_0x6cae('0x44')]=_[_0x6cae('0x41')](_0x521ef1['model'],qs[_0x6cae('0x42')](_0x4cd3ac[_0x6cae('0x43')][_0x6cae('0x42')]));_0x4fdf4d['attributes']=_0x4fdf4d[_0x6cae('0x44')]['length']?_0x4fdf4d[_0x6cae('0x44')]:_0x521ef1['model'];if(_0x4cd3ac[_0x6cae('0x43')][_0x6cae('0x4e')]){_0x4fdf4d[_0x6cae('0x4f')]=[{'all':!![]}];}_0x4fdf4d=_[_0x6cae('0x4c')]({},_0x4fdf4d,_0x4cd3ac[_0x6cae('0x4d')]);return db['Setting'][_0x6cae('0x52')](_0x4fdf4d)[_0x6cae('0x34')](handleEntityNotFound(_0x1289ac,null))[_0x6cae('0x34')](respondWithResult(_0x1289ac,null))[_0x6cae('0x28')](handleError(_0x1289ac,null));};exports[_0x6cae('0x53')]=function(_0x3502ce,_0x50bd0a){if(_0x3502ce['body']['id']){delete _0x3502ce[_0x6cae('0x54')]['id'];}return db['Setting'][_0x6cae('0x52')]({'where':{'id':_0x3502ce[_0x6cae('0x51')]['id']}})[_0x6cae('0x34')](handleEntityNotFound(_0x50bd0a,null))[_0x6cae('0x34')](saveUpdates(_0x3502ce[_0x6cae('0x54')],null))[_0x6cae('0x34')](respondWithResult(_0x50bd0a,null))[_0x6cae('0x28')](handleError(_0x50bd0a,null));};exports['addLogo']=function(_0x52038f,_0x48647f,_0xcb5f6f){if(_0x52038f[_0x6cae('0x55')]&&_0x52038f[_0x6cae('0x55')][_0x6cae('0x56')]){_0x52038f[_0x6cae('0x54')]['logo']=_0x52038f[_0x6cae('0x55')][_0x6cae('0x56')];}return db['Setting'][_0x6cae('0x52')]({'where':{'id':_0x52038f[_0x6cae('0x51')]['id']}})['then'](handleEntityNotFound(_0x48647f,null))[_0x6cae('0x34')](saveUpdates(_0x52038f[_0x6cae('0x54')],null))['then'](respondWithResult(_0x48647f,null))[_0x6cae('0x28')](handleError(_0x48647f,null));};exports[_0x6cae('0x57')]=function(_0x1d6684,_0x6dd623,_0x4872d7){if(_0x1d6684[_0x6cae('0x55')]&&_0x1d6684[_0x6cae('0x55')][_0x6cae('0x56')]){_0x1d6684[_0x6cae('0x54')][_0x6cae('0x58')]=_0x1d6684['file']['filename'];}return db['Setting'][_0x6cae('0x52')]({'where':{'id':_0x1d6684[_0x6cae('0x51')]['id']}})[_0x6cae('0x34')](handleEntityNotFound(_0x6dd623,null))[_0x6cae('0x34')](saveUpdates(_0x1d6684[_0x6cae('0x54')],null))['then'](respondWithResult(_0x6dd623,null))['catch'](handleError(_0x6dd623,null));};var utilLicense=require(_0x6cae('0x1a'));exports[_0x6cae('0x59')]=function(_0x5c6009,_0x27e18e,_0x583d98){var _0x14b262=_0x6cae('0x5a');var _0x425ed6={'custom':![]};return utilLicense[_0x6cae('0x5b')]()[_0x6cae('0x34')](function(_0x378935){if(_0x378935){_0x425ed6=_0x378935;}return db[_0x6cae('0x3a')][_0x6cae('0x52')]({'where':{'id':_0x5c6009[_0x6cae('0x51')]['id']},'attributes':[_0x6cae('0x5c'),_0x6cae('0x58'),'preferred',_0x6cae('0x5d'),_0x6cae('0x5e'),_0x6cae('0x5f'),_0x6cae('0x60'),_0x6cae('0x61')],'raw':!![]});})[_0x6cae('0x34')](handleEntityNotFound(_0x27e18e,null))[_0x6cae('0x34')](function(_0x278c32){if(_0x278c32){var _0x53c5f7=_0x278c32['logo']&&fs[_0x6cae('0x62')](path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x14b262,_['toLower'](_0x278c32[_0x6cae('0x5c')])))?path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x14b262,_['toLower'](_0x278c32['logo'])):path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x14b262,_[_0x6cae('0x65')](_0x6cae('0x66')));var _0x2c9f3f=_0x6cae('0x67')+_[_0x6cae('0x68')](_0x6cae('0x5c'));if(_0x278c32[_0x2c9f3f]||!_0x425ed6[_0x6cae('0x69')]){_0x53c5f7=path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x14b262,_['toLower'](_0x6cae('0x66')));}if(!fs[_0x6cae('0x62')](_0x53c5f7)){throw new db['Sequelize'][(_0x6cae('0x6a'))](_[_0x6cae('0x68')]('logo')+_0x6cae('0x6b'));}return _0x27e18e[_0x6cae('0x6c')](_0x53c5f7);}})['catch'](handleError(_0x27e18e,null));};var utilLicense=require(_0x6cae('0x1a'));exports['getLogoLogin']=function(_0x3a63d1,_0x303d52,_0x131b09){var _0x4c56e9='server/files/images/logos';var _0x46b84f={'custom':![]};return utilLicense[_0x6cae('0x5b')]()[_0x6cae('0x34')](function(_0x359667){if(_0x359667){_0x46b84f=_0x359667;}return db['Setting'][_0x6cae('0x52')]({'where':{'id':_0x3a63d1[_0x6cae('0x51')]['id']},'attributes':[_0x6cae('0x5c'),_0x6cae('0x58'),'preferred',_0x6cae('0x5d'),_0x6cae('0x5e'),_0x6cae('0x5f'),_0x6cae('0x60'),_0x6cae('0x61')],'raw':!![]});})[_0x6cae('0x34')](handleEntityNotFound(_0x303d52,null))['then'](function(_0x11b4f6){if(_0x11b4f6){var _0x5ebc78=_0x11b4f6[_0x6cae('0x58')]&&fs[_0x6cae('0x62')](path['join'](config[_0x6cae('0x64')],_0x4c56e9,_['toLower'](_0x11b4f6[_0x6cae('0x58')])))?path['join'](config[_0x6cae('0x64')],_0x4c56e9,_[_0x6cae('0x65')](_0x11b4f6['loginLogo'])):path['join'](config[_0x6cae('0x64')],_0x4c56e9,_[_0x6cae('0x65')](_0x6cae('0x6d')));var _0x79a2e5=_0x6cae('0x67')+_['upperFirst'](_0x6cae('0x58'));if(_0x11b4f6[_0x79a2e5]||!_0x46b84f[_0x6cae('0x69')]){_0x5ebc78=path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x4c56e9,_[_0x6cae('0x65')](_0x6cae('0x6d')));}if(!fs[_0x6cae('0x62')](_0x5ebc78)){throw new db['Sequelize']['ValidationError'](_['upperFirst']('loginLogo')+_0x6cae('0x6b'));}return _0x303d52['download'](_0x5ebc78);}})[_0x6cae('0x28')](handleError(_0x303d52,null));};exports[_0x6cae('0x6e')]=function(_0x400708,_0x1e667d){return db[_0x6cae('0x3a')][_0x6cae('0x52')]({'where':{'id':_0x400708[_0x6cae('0x51')]['id']},'attributes':['securePassword']})[_0x6cae('0x34')](respondWithResult(_0x1e667d,null))[_0x6cae('0x28')](handleError(_0x1e667d,null));};exports[_0x6cae('0x6f')]=function(_0x2a669d,_0x364d8d,_0x13e826){if(_0x2a669d[_0x6cae('0x55')]&&_0x2a669d[_0x6cae('0x55')]['filename']){_0x2a669d['body'][_0x6cae('0x70')]=_0x2a669d[_0x6cae('0x55')][_0x6cae('0x56')];}return db['Setting'][_0x6cae('0x52')]({'where':{'id':_0x2a669d['params']['id']}})['then'](handleEntityNotFound(_0x364d8d,null))[_0x6cae('0x34')](saveUpdates(_0x2a669d[_0x6cae('0x54')],null))[_0x6cae('0x34')](respondWithResult(_0x364d8d,null))[_0x6cae('0x28')](handleError(_0x364d8d,null));};var utilLicense=require(_0x6cae('0x1a'));exports[_0x6cae('0x71')]=function(_0x2f858c,_0x2559bd,_0x1a945a){var _0x391e61='server/files/images/logos';var _0x16ee9b={'custom':![]};return utilLicense[_0x6cae('0x5b')]()[_0x6cae('0x34')](function(_0x2cd31a){if(_0x2cd31a){_0x16ee9b=_0x2cd31a;}return db[_0x6cae('0x3a')][_0x6cae('0x52')]({'where':{'id':_0x2f858c['params']['id']},'attributes':[_0x6cae('0x5c'),_0x6cae('0x58'),_0x6cae('0x70'),'favicon',_0x6cae('0x5e'),_0x6cae('0x5f'),_0x6cae('0x60'),_0x6cae('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x2559bd,null))[_0x6cae('0x34')](function(_0x1cc4d7){if(_0x1cc4d7){var _0xb1ffdc=_0x1cc4d7[_0x6cae('0x70')]&&fs[_0x6cae('0x62')](path[_0x6cae('0x63')](config['root'],_0x391e61,_[_0x6cae('0x65')](_0x1cc4d7[_0x6cae('0x70')])))?path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x391e61,_[_0x6cae('0x65')](_0x1cc4d7[_0x6cae('0x70')])):path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x391e61,_[_0x6cae('0x65')](_0x6cae('0x72')));var _0xc7e57d='default'+_['upperFirst'](_0x6cae('0x70'));if(_0x1cc4d7[_0xc7e57d]||!_0x16ee9b[_0x6cae('0x69')]||!_0x16ee9b['preferred']){_0xb1ffdc=path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x391e61,_['toLower'](_0x6cae('0x72')));}if(!fs[_0x6cae('0x62')](_0xb1ffdc)){throw new db[(_0x6cae('0x73'))][(_0x6cae('0x6a'))](_[_0x6cae('0x68')](_0x6cae('0x70'))+_0x6cae('0x6b'));}return _0x2559bd[_0x6cae('0x6c')](_0xb1ffdc);}})[_0x6cae('0x28')](handleError(_0x2559bd,null));};exports[_0x6cae('0x74')]=function(_0x572b0d,_0x22788f,_0x56d98b){if(_0x572b0d[_0x6cae('0x55')]&&_0x572b0d[_0x6cae('0x55')]['filename']){_0x572b0d[_0x6cae('0x54')][_0x6cae('0x5d')]=_0x572b0d['file'][_0x6cae('0x56')];}return db[_0x6cae('0x3a')][_0x6cae('0x52')]({'where':{'id':_0x572b0d[_0x6cae('0x51')]['id']}})[_0x6cae('0x34')](handleEntityNotFound(_0x22788f,null))['then'](saveUpdates(_0x572b0d[_0x6cae('0x54')],null))[_0x6cae('0x34')](respondWithResult(_0x22788f,null))[_0x6cae('0x28')](handleError(_0x22788f,null));};var utilLicense=require(_0x6cae('0x1a'));exports[_0x6cae('0x75')]=function(_0xaa2928,_0x2b0cab,_0x24bc7e){var _0x54767b=_0x6cae('0x5a');var _0x59d82b={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x456bf1){if(_0x456bf1){_0x59d82b=_0x456bf1;}return db['Setting'][_0x6cae('0x52')]({'where':{'id':_0xaa2928[_0x6cae('0x51')]['id']},'attributes':['logo',_0x6cae('0x58'),_0x6cae('0x70'),'favicon',_0x6cae('0x5e'),_0x6cae('0x5f'),_0x6cae('0x60'),'defaultFavicon'],'raw':!![]});})[_0x6cae('0x34')](handleEntityNotFound(_0x2b0cab,null))[_0x6cae('0x34')](function(_0x31eaf5){if(_0x31eaf5){var _0x36ad3c=_0x31eaf5[_0x6cae('0x5d')]&&fs[_0x6cae('0x62')](path['join'](config[_0x6cae('0x64')],_0x54767b,_[_0x6cae('0x65')](_0x31eaf5[_0x6cae('0x5d')])))?path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x54767b,_[_0x6cae('0x65')](_0x31eaf5['favicon'])):path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x54767b,_[_0x6cae('0x65')](_0x6cae('0x76')));var _0x34e85d=_0x6cae('0x67')+_[_0x6cae('0x68')](_0x6cae('0x5d'));if(_0x31eaf5[_0x34e85d]||!_0x59d82b[_0x6cae('0x69')]){_0x36ad3c=path[_0x6cae('0x63')](config[_0x6cae('0x64')],_0x54767b,_['toLower']('default_favicon.ico'));}if(!fs[_0x6cae('0x62')](_0x36ad3c)){throw new db[(_0x6cae('0x73'))][(_0x6cae('0x6a'))](_['upperFirst'](_0x6cae('0x5d'))+_0x6cae('0x6b'));}return _0x2b0cab[_0x6cae('0x6c')](_0x36ad3c);}})[_0x6cae('0x28')](handleError(_0x2b0cab,null));};exports[_0x6cae('0x77')]=function(_0x50dac7,_0xfd9988){var _0x64c75f={'offset':moment()['utcOffset']()};_0x64c75f[_0x6cae('0x78')]=moment()['utcOffset'](_0x64c75f[_0x6cae('0x2c')])[_0x6cae('0x79')](_0x6cae('0x7a'));return _0xfd9988[_0x6cae('0x2a')](0xc8)[_0x6cae('0x7b')](_0x64c75f);};
\ No newline at end of file
index c422b2a..2d1d92f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x260d50,_0xa1fd38){var _0x3b3225=function(_0x41da6b){while(--_0x41da6b){_0x260d50['push'](_0x260d50['shift']());}};_0x3b3225(++_0xa1fd38);}(_0xe14b,0x93));var _0xbe14=function(_0x54b4e7,_0x4f0b1e){_0x54b4e7=_0x54b4e7-0x0;var _0xea74f0=_0xe14b[_0x54b4e7];return _0xea74f0;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x267ef9,_0x3f3b6a){var _0x22aa2b=function(_0xe6f111){while(--_0xe6f111){_0x267ef9['push'](_0x267ef9['shift']());}};_0x22aa2b(++_0x3f3b6a);}(_0xe14b,0x93));var _0xbe14=function(_0x5778e4,_0xe05250){_0x5778e4=_0x5778e4-0x0;var _0x181f6f=_0xe14b[_0x5778e4];return _0x181f6f;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eb7fa10..044ec0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8bb=['then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','find','options','raw','where','attributes','include','model','map','ShowSetting','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request'];(function(_0x382ca6,_0x1aaf79){var _0x295a6c=function(_0x294a0b){while(--_0x294a0b){_0x382ca6['push'](_0x382ca6['shift']());}};_0x295a6c(++_0x1aaf79);}(_0xe8bb,0x1c7));var _0xbe8b=function(_0x561838,_0x6e3b38){_0x561838=_0x561838-0x0;var _0x3d0693=_0xe8bb[_0x561838];return _0x3d0693;};'use strict';var _=require(_0xbe8b('0x0'));var util=require('util');var moment=require(_0xbe8b('0x1'));var BPromise=require(_0xbe8b('0x2'));var rs=require(_0xbe8b('0x3'));var fs=require('fs');var Redis=require(_0xbe8b('0x4'));var db=require(_0xbe8b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbe8b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbe8b('0x7')][_0xbe8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x482fab,_0x4c7c50,_0x41218b){return new BPromise(function(_0x3cdb8d,_0x2e8066){return client[_0xbe8b('0x9')](_0x482fab,_0x41218b)[_0xbe8b('0xa')](function(_0x4781a8){logger[_0xbe8b('0xb')](_0xbe8b('0xc'),_0x4c7c50,_0xbe8b('0xd'));logger[_0xbe8b('0xe')](_0xbe8b('0xf'),_0x4c7c50,_0xbe8b('0xd'),JSON[_0xbe8b('0x10')](_0x4781a8));if(_0x4781a8[_0xbe8b('0x11')]){if(_0x4781a8['error'][_0xbe8b('0x12')]===0x1f4){logger[_0xbe8b('0x11')](_0xbe8b('0xc'),_0x4c7c50,_0x4781a8[_0xbe8b('0x11')][_0xbe8b('0x13')]);return _0x2e8066(_0x4781a8['error'][_0xbe8b('0x13')]);}logger[_0xbe8b('0x11')](_0xbe8b('0xc'),_0x4c7c50,_0x4781a8['error'][_0xbe8b('0x13')]);return _0x3cdb8d(_0x4781a8[_0xbe8b('0x11')][_0xbe8b('0x13')]);}else{logger[_0xbe8b('0xb')](_0xbe8b('0xc'),_0x4c7c50,_0xbe8b('0xd'));_0x3cdb8d(_0x4781a8[_0xbe8b('0x14')]['message']);}})['catch'](function(_0x3399be){logger['error'](_0xbe8b('0xc'),_0x4c7c50,_0x3399be);_0x2e8066(_0x3399be);});});}exports['ShowSetting']=function(_0x103984){var _0x4df8c1=this;return new Promise(function(_0x289f56,_0x446028){return db['Setting'][_0xbe8b('0x15')]({'raw':_0x103984[_0xbe8b('0x16')]?_0x103984[_0xbe8b('0x16')][_0xbe8b('0x17')]===undefined?!![]:![]:!![],'where':_0x103984[_0xbe8b('0x16')]?_0x103984['options'][_0xbe8b('0x18')]||null:null,'attributes':_0x103984[_0xbe8b('0x16')]?_0x103984['options'][_0xbe8b('0x19')]||null:null,'include':_0x103984[_0xbe8b('0x16')]?_0x103984[_0xbe8b('0x16')][_0xbe8b('0x1a')]?_['map'](_0x103984[_0xbe8b('0x16')][_0xbe8b('0x1a')],function(_0x3ba125){return{'model':db[_0x3ba125[_0xbe8b('0x1b')]],'as':_0x3ba125['as'],'attributes':_0x3ba125[_0xbe8b('0x19')],'include':_0x3ba125[_0xbe8b('0x1a')]?_[_0xbe8b('0x1c')](_0x3ba125[_0xbe8b('0x1a')],function(_0x4a1f1b){return{'model':db[_0x4a1f1b['model']],'as':_0x4a1f1b['as'],'attributes':_0x4a1f1b['attributes'],'include':_0x4a1f1b['include']?_[_0xbe8b('0x1c')](_0x4a1f1b['include'],function(_0x2870db){return{'model':db[_0x2870db['model']],'as':_0x2870db['as'],'attributes':_0x2870db[_0xbe8b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbe8b('0xa')](function(_0x13156a){logger['info']('ShowSetting',_0x103984);logger[_0xbe8b('0xe')](_0xbe8b('0x1d'),_0x103984,JSON['stringify'](_0x13156a));_0x289f56(_0x13156a);})[_0xbe8b('0x1e')](function(_0x3a4a9b){logger[_0xbe8b('0x11')]('ShowSetting',_0x3a4a9b[_0xbe8b('0x13')],_0x103984);_0x446028(_0x4df8c1[_0xbe8b('0x11')](0x1f4,_0x3a4a9b[_0xbe8b('0x13')]));});});};
\ No newline at end of file
+var _0x0042=['ShowSetting','Setting','find','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5c27ae,_0x10dfb7){var _0x3eef82=function(_0x35b90c){while(--_0x35b90c){_0x5c27ae['push'](_0x5c27ae['shift']());}};_0x3eef82(++_0x10dfb7);}(_0x0042,0xe9));var _0x2004=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0x0042[_0x29aefc];return _0x11be36;};'use strict';var _=require(_0x2004('0x0'));var util=require(_0x2004('0x1'));var moment=require(_0x2004('0x2'));var BPromise=require(_0x2004('0x3'));var rs=require(_0x2004('0x4'));var fs=require('fs');var Redis=require(_0x2004('0x5'));var db=require(_0x2004('0x6'))['db'];var utils=require(_0x2004('0x7'));var logger=require(_0x2004('0x8'))(_0x2004('0x9'));var config=require('../../config/environment');var jayson=require(_0x2004('0xa'));var client=jayson['client'][_0x2004('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53eb13,_0x50ac1e,_0x3ea830){return new BPromise(function(_0x5999dd,_0x5752d2){return client['request'](_0x53eb13,_0x3ea830)[_0x2004('0xc')](function(_0x2564c1){logger[_0x2004('0xd')](_0x2004('0xe'),_0x50ac1e,'request\x20sent');logger[_0x2004('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x50ac1e,_0x2004('0x10'),JSON[_0x2004('0x11')](_0x2564c1));if(_0x2564c1[_0x2004('0x12')]){if(_0x2564c1['error'][_0x2004('0x13')]===0x1f4){logger['error'](_0x2004('0xe'),_0x50ac1e,_0x2564c1[_0x2004('0x12')]['message']);return _0x5752d2(_0x2564c1[_0x2004('0x12')][_0x2004('0x14')]);}logger[_0x2004('0x12')]('Setting,\x20%s,\x20%s',_0x50ac1e,_0x2564c1[_0x2004('0x12')][_0x2004('0x14')]);return _0x5999dd(_0x2564c1[_0x2004('0x12')][_0x2004('0x14')]);}else{logger[_0x2004('0xd')](_0x2004('0xe'),_0x50ac1e,_0x2004('0x10'));_0x5999dd(_0x2564c1[_0x2004('0x15')][_0x2004('0x14')]);}})[_0x2004('0x16')](function(_0x3f58ee){logger[_0x2004('0x12')](_0x2004('0xe'),_0x50ac1e,_0x3f58ee);_0x5752d2(_0x3f58ee);});});}exports[_0x2004('0x17')]=function(_0x3dcdae){var _0x4c93aa=this;return new Promise(function(_0x661936,_0x2bda7d){return db[_0x2004('0x18')][_0x2004('0x19')]({'raw':_0x3dcdae[_0x2004('0x1a')]?_0x3dcdae[_0x2004('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3dcdae['options']?_0x3dcdae[_0x2004('0x1a')][_0x2004('0x1b')]||null:null,'attributes':_0x3dcdae[_0x2004('0x1a')]?_0x3dcdae[_0x2004('0x1a')]['attributes']||null:null,'include':_0x3dcdae[_0x2004('0x1a')]?_0x3dcdae[_0x2004('0x1a')][_0x2004('0x1c')]?_[_0x2004('0x1d')](_0x3dcdae[_0x2004('0x1a')]['include'],function(_0x5cc3e5){return{'model':db[_0x5cc3e5[_0x2004('0x1e')]],'as':_0x5cc3e5['as'],'attributes':_0x5cc3e5['attributes'],'include':_0x5cc3e5['include']?_[_0x2004('0x1d')](_0x5cc3e5[_0x2004('0x1c')],function(_0x296f4b){return{'model':db[_0x296f4b[_0x2004('0x1e')]],'as':_0x296f4b['as'],'attributes':_0x296f4b[_0x2004('0x1f')],'include':_0x296f4b['include']?_[_0x2004('0x1d')](_0x296f4b[_0x2004('0x1c')],function(_0xc584e9){return{'model':db[_0xc584e9[_0x2004('0x1e')]],'as':_0xc584e9['as'],'attributes':_0xc584e9['attributes']};}):[]};}):[]};}):[]:[]})[_0x2004('0xc')](function(_0x47396d){logger[_0x2004('0xd')](_0x2004('0x17'),_0x3dcdae);logger[_0x2004('0xf')]('ShowSetting',_0x3dcdae,JSON[_0x2004('0x11')](_0x47396d));_0x661936(_0x47396d);})[_0x2004('0x16')](function(_0x427e56){logger['error'](_0x2004('0x17'),_0x427e56[_0x2004('0x14')],_0x3dcdae);_0x2bda7d(_0x4c93aa[_0x2004('0x12')](0x1f4,_0x427e56[_0x2004('0x14')]));});});};
\ No newline at end of file
index a8d5cce..2eeb9bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3dbf19,_0x438e38){_0x3dbf19=_0x3dbf19-0x0;var _0x4ea3de=_0x1cb9[_0x3dbf19];return _0x4ea3de;};'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
+var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x1e2afa,_0x5609fe){var _0x2c3ff6=function(_0x1f8a13){while(--_0x1f8a13){_0x1e2afa['push'](_0x1e2afa['shift']());}};_0x2c3ff6(++_0x5609fe);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router;
\ No newline at end of file
index e0f4e8d..0ca4084 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd9f=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','intelepeer','TEXT'];(function(_0x576e6d,_0x59cb51){var _0x3e485f=function(_0x1e30ab){while(--_0x1e30ab){_0x576e6d['push'](_0x576e6d['shift']());}};_0x3e485f(++_0x59cb51);}(_0xdd9f,0xb0));var _0xfdd9=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xdd9f[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require(_0xfdd9('0x0'));var rs=require(_0xfdd9('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xfdd9('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xfdd9('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xfdd9('0x3')],'defaultValue':function(){return rs[_0xfdd9('0x4')]();}},'phone':{'type':Sequelize[_0xfdd9('0x3')]},'type':{'type':Sequelize[_0xfdd9('0x5')](_0xfdd9('0x6'),_0xfdd9('0x7'),_0xfdd9('0x8'),_0xfdd9('0x9'),_0xfdd9('0xa'),_0xfdd9('0xb'),_0xfdd9('0xc'),_0xfdd9('0xd'),'infobip',_0xfdd9('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xfdd9('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xfdd9('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xfdd9('0x3')]},'password':{'type':Sequelize[_0xfdd9('0x3')]},'apiKey':{'type':Sequelize[_0xfdd9('0x3')]},'applicationId':{'type':Sequelize[_0xfdd9('0x3')]},'accountId':{'type':Sequelize[_0xfdd9('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfdd9('0xf')],'defaultValue':function(){return _0xfdd9('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfdd9('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfdd9('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfdd9('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfdd9('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfdd9('0x12')],'comment':_0xfdd9('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xfdd9('0x11')],'defaultValue':![],'comment':_0xfdd9('0x14'),'set':function(_0x17eb38){if(!_0x17eb38)this[_0xfdd9('0x15')](_0xfdd9('0x16'),null);this['setDataValue'](_0xfdd9('0x17'),_0x17eb38);}}};
\ No newline at end of file
+var _0xdb1f=['bandwidth','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo'];(function(_0x5d9c08,_0x68d66e){var _0x3d07ae=function(_0x1f6d8d){while(--_0x1f6d8d){_0x5d9c08['push'](_0x5d9c08['shift']());}};_0x3d07ae(++_0x68d66e);}(_0xdb1f,0xc4));var _0xfdb1=function(_0x1aef76,_0x4ee33e){_0x1aef76=_0x1aef76-0x0;var _0x242d96=_0xdb1f[_0x1aef76];return _0x242d96;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xfdb1('0x0'));module[_0xfdb1('0x1')]={'name':{'type':Sequelize[_0xfdb1('0x2')],'unique':_0xfdb1('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xfdb1('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xfdb1('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xfdb1('0x2')],'defaultValue':function(){return rs[_0xfdb1('0x4')]();}},'phone':{'type':Sequelize[_0xfdb1('0x2')]},'type':{'type':Sequelize[_0xfdb1('0x5')](_0xfdb1('0x6'),_0xfdb1('0x7'),_0xfdb1('0x8'),_0xfdb1('0x9'),_0xfdb1('0xa'),'clickatell',_0xfdb1('0xb'),_0xfdb1('0xc'),_0xfdb1('0xd'),_0xfdb1('0xe'))},'accountSid':{'type':Sequelize[_0xfdb1('0x2')]},'authId':{'type':Sequelize[_0xfdb1('0x2')]},'authToken':{'type':Sequelize[_0xfdb1('0x2')]},'smsMethod':{'type':Sequelize[_0xfdb1('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xfdb1('0x2')]},'password':{'type':Sequelize[_0xfdb1('0x2')]},'apiKey':{'type':Sequelize[_0xfdb1('0x2')]},'applicationId':{'type':Sequelize[_0xfdb1('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xfdb1('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfdb1('0xf')],'defaultValue':function(){return _0xfdb1('0x10');}},'notificationSound':{'type':Sequelize[_0xfdb1('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfdb1('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfdb1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfdb1('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfdb1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfdb1('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfdb1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfdb1('0x12')],'comment':_0xfdb1('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfdb1('0x14'),'set':function(_0x4f695a){if(!_0x4f695a)this[_0xfdb1('0x15')]('mandatoryDispositionPauseId',null);this[_0xfdb1('0x15')](_0xfdb1('0x16'),_0x4f695a);}}};
\ No newline at end of file
index 497f7a3..e26c1cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb51c=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','end','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','Pause','length','create','body','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addDisposition','SmsAccountId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','plivo','MessageUUID','infobip','results','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','AttachmentId','UserId','agent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','Transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','Contact','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','message_id','DELIVERED','groupName','intelepeer','redif','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','csc','message-id','state','addAgents','omit','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0x520bd0,_0x2401c0){var _0x1e6ad7=function(_0x5500fa){while(--_0x5500fa){_0x520bd0['push'](_0x520bd0['shift']());}};_0x1e6ad7(++_0x2401c0);}(_0xb51c,0x1b0));var _0xcb51=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xb51c[_0xea8947];return _0x2455e9;};'use strict';var emlformat=require(_0xcb51('0x0'));var rimraf=require(_0xcb51('0x1'));var zipdir=require(_0xcb51('0x2'));var jsonpatch=require(_0xcb51('0x3'));var rp=require(_0xcb51('0x4'));var moment=require(_0xcb51('0x5'));var BPromise=require(_0xcb51('0x6'));var Mustache=require(_0xcb51('0x7'));var util=require('util');var path=require('path');var sox=require(_0xcb51('0x8'));var csv=require('to-csv');var ejs=require(_0xcb51('0x9'));var fs=require('fs');var fs_extra=require(_0xcb51('0xa'));var _=require(_0xcb51('0xb'));var squel=require(_0xcb51('0xc'));var crypto=require(_0xcb51('0xd'));var jsforce=require(_0xcb51('0xe'));var deskjs=require(_0xcb51('0xf'));var toCsv=require(_0xcb51('0x10'));var querystring=require('querystring');var Papa=require(_0xcb51('0x11'));var Redis=require('ioredis');var authService=require(_0xcb51('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb51('0x13'));var logger=require(_0xcb51('0x14'))(_0xcb51('0x15'));var utils=require(_0xcb51('0x16'));var config=require(_0xcb51('0x17'));var licenseUtil=require(_0xcb51('0x18'));var db=require(_0xcb51('0x19'))['db'];config[_0xcb51('0x1a')]=_[_0xcb51('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcb51('0x1c'))(new Redis(config[_0xcb51('0x1a')]));require(_0xcb51('0x1d'))[_0xcb51('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0xc239e3,_0x57361f,_0xd6ea90,_0x34b501){return new BPromise(function(_0x56b9fd,_0x559de3){var _0xa9fc1e=_0x34b501||client;return _0xa9fc1e['request'](_0xc239e3,_0xd6ea90)[_0xcb51('0x1f')](function(_0x550ad5){logger[_0xcb51('0x20')](_0xcb51('0x21'),_0x57361f,_0xcb51('0x22'));logger[_0xcb51('0x23')](_0xcb51('0x24'),_0x57361f,_0xcb51('0x22'),JSON[_0xcb51('0x25')](_0x550ad5));if(_0x550ad5['error']){if(_0x550ad5[_0xcb51('0x26')][_0xcb51('0x27')]===0x1f4){logger['error'](_0xcb51('0x21'),_0x57361f,_0x550ad5[_0xcb51('0x26')][_0xcb51('0x28')]);return _0x559de3(_0x550ad5['error']['message']);}logger[_0xcb51('0x26')](_0xcb51('0x21'),_0x57361f,_0x550ad5[_0xcb51('0x26')][_0xcb51('0x28')]);return _0x56b9fd(_0x550ad5[_0xcb51('0x26')][_0xcb51('0x28')]);}else{logger[_0xcb51('0x20')]('SmsAccount,\x20%s,\x20%s',_0x57361f,_0xcb51('0x22'));_0x56b9fd(_0x550ad5[_0xcb51('0x29')][_0xcb51('0x28')]);}})[_0xcb51('0x2a')](function(_0x45a661){logger[_0xcb51('0x26')](_0xcb51('0x21'),_0x57361f,_0x45a661);_0x559de3(_0x45a661);});});}function respondWithStatusCode(_0x4cb504,_0x493056){_0x493056=_0x493056||0xcc;return function(_0x10c9ed){if(_0x10c9ed){return _0x4cb504['sendStatus'](_0x493056);}return _0x4cb504[_0xcb51('0x2b')](_0x493056)['end']();};}function respondWithResult(_0x4e56b4,_0x5ab8bf){_0x5ab8bf=_0x5ab8bf||0xc8;return function(_0x160f5a){if(_0x160f5a){return _0x4e56b4[_0xcb51('0x2b')](_0x5ab8bf)[_0xcb51('0x2c')](_0x160f5a);}};}function respondWithFilteredResult(_0x430f79,_0x5c54ce){return function(_0x95304c){if(_0x95304c){var _0x3f0caa=typeof _0x5c54ce[_0xcb51('0x2d')]===_0xcb51('0x2e')&&typeof _0x5c54ce[_0xcb51('0x2f')]==='undefined';var _0x49533a=_0x95304c[_0xcb51('0x30')];var _0x1ab5c3=_0x3f0caa?0x0:_0x5c54ce[_0xcb51('0x2d')];var _0x497ec6=_0x3f0caa?_0x95304c['count']:_0x5c54ce[_0xcb51('0x2d')]+_0x5c54ce['limit'];var _0x45c49e;if(_0x497ec6>=_0x49533a){_0x497ec6=_0x49533a;_0x45c49e=0xc8;}else{_0x45c49e=0xce;}_0x430f79['status'](_0x45c49e);return _0x430f79[_0xcb51('0x31')](_0xcb51('0x32'),_0x1ab5c3+'-'+_0x497ec6+'/'+_0x49533a)['json'](_0x95304c);}return null;};}function patchUpdates(_0x329ecb){return function(_0x4d7416){try{jsonpatch[_0xcb51('0x33')](_0x4d7416,_0x329ecb,!![]);}catch(_0x2decd2){return BPromise[_0xcb51('0x34')](_0x2decd2);}return _0x4d7416[_0xcb51('0x35')]();};}function saveUpdates(_0x3b4a40,_0x2faee2){return function(_0x238cee){if(_0x238cee){return _0x238cee[_0xcb51('0x36')](_0x3b4a40)[_0xcb51('0x1f')](function(_0x8c3c4c){return _0x8c3c4c;});}return null;};}function removeEntity(_0x13c258,_0x5f2f1e){return function(_0xdeb27e){if(_0xdeb27e){return _0xdeb27e[_0xcb51('0x37')]()[_0xcb51('0x1f')](function(){var _0x2a1dc3=_0xdeb27e[_0xcb51('0x38')]({'plain':!![]});var _0x18c98d=_0xcb51('0x39');return db[_0xcb51('0x3a')][_0xcb51('0x37')]({'where':{'type':_0x18c98d,'resourceId':_0x2a1dc3['id']}})[_0xcb51('0x1f')](function(){return _0xdeb27e;});})['then'](function(){_0x13c258[_0xcb51('0x2b')](0xcc)[_0xcb51('0x3b')]();});}};}function handleEntityNotFound(_0x32df67,_0x33b983){return function(_0x489daf){if(!_0x489daf){_0x32df67[_0xcb51('0x3c')](0x194);}return _0x489daf;};}function handleError(_0x2c2d58,_0x2d3764){_0x2d3764=_0x2d3764||0x1f4;return function(_0x8c24e3){logger[_0xcb51('0x26')](_0x8c24e3[_0xcb51('0x3d')]);if(_0x8c24e3['name']){delete _0x8c24e3[_0xcb51('0x3e')];}_0x2c2d58[_0xcb51('0x2b')](_0x2d3764)[_0xcb51('0x3f')](_0x8c24e3);};}exports[_0xcb51('0x40')]=function(_0x29cc44,_0x5b439){var _0x1ce3db={'include':[{'model':db['Pause'],'as':_0xcb51('0x41')}]},_0x606cd8={},_0x287fb3={'count':0x0,'rows':[]};var _0x321d59=_[_0xcb51('0x42')](db[_0xcb51('0x43')][_0xcb51('0x44')],function(_0x3dc37d){return{'name':_0x3dc37d[_0xcb51('0x45')],'type':_0x3dc37d[_0xcb51('0x46')][_0xcb51('0x47')]};});_0x606cd8[_0xcb51('0x48')]=_[_0xcb51('0x42')](_0x321d59,_0xcb51('0x3e'));_0x606cd8[_0xcb51('0x49')]=_[_0xcb51('0x4a')](_0x29cc44[_0xcb51('0x49')]);_0x606cd8[_0xcb51('0x4b')]=_[_0xcb51('0x4c')](_0x606cd8[_0xcb51('0x48')],_0x606cd8[_0xcb51('0x49')]);_0x1ce3db['attributes']=_[_0xcb51('0x4c')](_0x606cd8[_0xcb51('0x48')],qs[_0xcb51('0x4d')](_0x29cc44['query'][_0xcb51('0x4d')]));_0x1ce3db[_0xcb51('0x4e')]=_0x1ce3db[_0xcb51('0x4e')]['length']?_0x1ce3db['attributes']:_0x606cd8['model'];if(!_0x29cc44[_0xcb51('0x49')]['hasOwnProperty'](_0xcb51('0x4f'))){_0x1ce3db['limit']=qs[_0xcb51('0x2f')](_0x29cc44[_0xcb51('0x49')]['limit']);_0x1ce3db[_0xcb51('0x2d')]=qs[_0xcb51('0x2d')](_0x29cc44[_0xcb51('0x49')][_0xcb51('0x2d')]);}_0x1ce3db[_0xcb51('0x50')]=qs[_0xcb51('0x51')](_0x29cc44[_0xcb51('0x49')]['sort']);_0x1ce3db[_0xcb51('0x52')]=qs[_0xcb51('0x4b')](_[_0xcb51('0x53')](_0x29cc44[_0xcb51('0x49')],_0x606cd8['filters']),_0x321d59);if(_0x29cc44[_0xcb51('0x49')][_0xcb51('0x54')]){_0x1ce3db[_0xcb51('0x52')]=_[_0xcb51('0x55')](_0x1ce3db[_0xcb51('0x52')],{'$or':_['map'](_0x321d59,function(_0x388852){if(_0x388852[_0xcb51('0x46')]!==_0xcb51('0x56')){var _0x52ec72={};_0x52ec72[_0x388852[_0xcb51('0x3e')]]={'$like':'%'+_0x29cc44[_0xcb51('0x49')][_0xcb51('0x54')]+'%'};return _0x52ec72;}})});}_0x1ce3db=_[_0xcb51('0x55')]({},_0x1ce3db,_0x29cc44[_0xcb51('0x57')]);var _0x14b5cf={'where':_0x1ce3db[_0xcb51('0x52')]};return db['SmsAccount']['count'](_0x14b5cf)[_0xcb51('0x1f')](function(_0x5af699){_0x287fb3[_0xcb51('0x30')]=_0x5af699;if(_0x29cc44['query'][_0xcb51('0x58')]){_0x1ce3db[_0xcb51('0x59')]=[{'all':!![]}];}return db['SmsAccount'][_0xcb51('0x5a')](_0x1ce3db);})['then'](function(_0x1e3095){_0x287fb3[_0xcb51('0x5b')]=_0x1e3095;return _0x287fb3;})[_0xcb51('0x1f')](respondWithFilteredResult(_0x5b439,_0x1ce3db))[_0xcb51('0x2a')](handleError(_0x5b439,null));};exports[_0xcb51('0x5c')]=function(_0x1cfbc2,_0x559255){var _0x45d191={'raw':![],'where':{'id':_0x1cfbc2['params']['id']},'include':[{'model':db[_0xcb51('0x5d')],'as':_0xcb51('0x41')}]},_0x537b81={};_0x537b81[_0xcb51('0x48')]=_[_0xcb51('0x4a')](db[_0xcb51('0x43')][_0xcb51('0x44')]);_0x537b81[_0xcb51('0x49')]=_[_0xcb51('0x4a')](_0x1cfbc2[_0xcb51('0x49')]);_0x537b81[_0xcb51('0x4b')]=_[_0xcb51('0x4c')](_0x537b81['model'],_0x537b81[_0xcb51('0x49')]);_0x45d191['attributes']=_[_0xcb51('0x4c')](_0x537b81[_0xcb51('0x48')],qs[_0xcb51('0x4d')](_0x1cfbc2[_0xcb51('0x49')]['fields']));_0x45d191[_0xcb51('0x4e')]=_0x45d191[_0xcb51('0x4e')][_0xcb51('0x5e')]?_0x45d191[_0xcb51('0x4e')]:_0x537b81[_0xcb51('0x48')];if(_0x1cfbc2[_0xcb51('0x49')][_0xcb51('0x58')]){_0x45d191[_0xcb51('0x59')]=[{'all':!![]}];}_0x45d191=_['merge']({},_0x45d191,_0x1cfbc2[_0xcb51('0x57')]);return db[_0xcb51('0x43')]['find'](_0x45d191)[_0xcb51('0x1f')](handleEntityNotFound(_0x559255,null))['then'](respondWithResult(_0x559255,null))[_0xcb51('0x2a')](handleError(_0x559255,null));};exports[_0xcb51('0x5f')]=function(_0x27ff32,_0x1851d6){return db[_0xcb51('0x43')][_0xcb51('0x5f')](_0x27ff32[_0xcb51('0x60')],{})[_0xcb51('0x1f')](function(_0x146f15){var _0x405727=_0x27ff32[_0xcb51('0x61')][_0xcb51('0x38')]({'plain':!![]});if(!_0x405727)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x405727['role']===_0xcb51('0x61')){var _0x3e0f2c=_0x146f15['get']({'plain':!![]});var _0x3c0b6b=_0xcb51('0x39');return db[_0xcb51('0x62')][_0xcb51('0x63')]({'where':{'name':_0x3c0b6b,'userProfileId':_0x405727['userProfileId']},'raw':!![]})['then'](function(_0x1f083f){if(_0x1f083f&&_0x1f083f[_0xcb51('0x64')]===0x0){return db['UserProfileResource'][_0xcb51('0x5f')]({'name':_0x3e0f2c['name'],'resourceId':_0x3e0f2c['id'],'type':_0x1f083f[_0xcb51('0x3e')],'sectionId':_0x1f083f['id']},{})[_0xcb51('0x1f')](function(){return _0x146f15;});}else{return _0x146f15;}})[_0xcb51('0x2a')](function(_0x1160fe){logger[_0xcb51('0x26')](_0xcb51('0x65'),_0x1160fe);throw _0x1160fe;});}return _0x146f15;})['then'](respondWithResult(_0x1851d6,0xc9))['catch'](handleError(_0x1851d6,null));};exports[_0xcb51('0x36')]=function(_0xa4cab5,_0x43eea4){if(_0xa4cab5['body']['id']){delete _0xa4cab5[_0xcb51('0x60')]['id'];}return db[_0xcb51('0x43')]['find']({'where':{'id':_0xa4cab5[_0xcb51('0x66')]['id']},'include':[{'model':db[_0xcb51('0x5d')],'as':_0xcb51('0x41')}]})[_0xcb51('0x1f')](handleEntityNotFound(_0x43eea4,null))[_0xcb51('0x1f')](saveUpdates(_0xa4cab5[_0xcb51('0x60')],null))[_0xcb51('0x1f')](respondWithResult(_0x43eea4,null))['catch'](handleError(_0x43eea4,null));};exports[_0xcb51('0x37')]=function(_0x3b89b6,_0x3744c9){return db[_0xcb51('0x43')][_0xcb51('0x63')]({'where':{'id':_0x3b89b6['params']['id']}})[_0xcb51('0x1f')](handleEntityNotFound(_0x3744c9,null))[_0xcb51('0x1f')](removeEntity(_0x3744c9,null))[_0xcb51('0x2a')](handleError(_0x3744c9,null));};exports['describe']=function(_0x2eac88,_0x214849){return db['SmsAccount']['describe']()[_0xcb51('0x1f')](respondWithResult(_0x214849,null))[_0xcb51('0x2a')](handleError(_0x214849,null));};exports[_0xcb51('0x67')]=function(_0x32b3d8,_0x56ba46,_0x304126){if(_0x32b3d8[_0xcb51('0x60')]['id']){delete _0x32b3d8[_0xcb51('0x60')]['id'];}return db['SmsAccount'][_0xcb51('0x63')]({'where':{'id':_0x32b3d8[_0xcb51('0x66')]['id']}})[_0xcb51('0x1f')](handleEntityNotFound(_0x56ba46,null))[_0xcb51('0x1f')](function(_0x85908a){if(_0x85908a){_0x32b3d8[_0xcb51('0x60')][_0xcb51('0x68')]=_0x85908a['id'];return db[_0xcb51('0x69')]['create'](_0x32b3d8[_0xcb51('0x60')]);}})['then'](respondWithResult(_0x56ba46,null))[_0xcb51('0x2a')](handleError(_0x56ba46,null));};exports['getDispositions']=function(_0x47ba4d,_0xd062e2,_0x218821){var _0x1ad94d={'raw':![],'where':{}};var _0x574677={};var _0x3cb259={'count':0x0,'rows':[]};return db['SmsAccount'][_0xcb51('0x6a')]({'where':{'id':_0x47ba4d[_0xcb51('0x66')]['id']}})[_0xcb51('0x1f')](handleEntityNotFound(_0xd062e2,null))['then'](function(_0x3d8fb3){if(_0x3d8fb3){_0x574677[_0xcb51('0x48')]=_['keys'](db[_0xcb51('0x69')]['rawAttributes']);_0x574677[_0xcb51('0x49')]=_[_0xcb51('0x4a')](_0x47ba4d[_0xcb51('0x49')]);_0x574677[_0xcb51('0x4b')]=_[_0xcb51('0x4c')](_0x574677[_0xcb51('0x48')],_0x574677['query']);_0x1ad94d[_0xcb51('0x4e')]=_[_0xcb51('0x4c')](_0x574677[_0xcb51('0x48')],qs[_0xcb51('0x4d')](_0x47ba4d['query']['fields']));_0x1ad94d['attributes']=_0x1ad94d[_0xcb51('0x4e')]['length']?_0x1ad94d[_0xcb51('0x4e')]:_0x574677[_0xcb51('0x48')];if(!_0x47ba4d[_0xcb51('0x49')][_0xcb51('0x6b')](_0xcb51('0x4f'))){_0x1ad94d[_0xcb51('0x2f')]=qs[_0xcb51('0x2f')](_0x47ba4d['query'][_0xcb51('0x2f')]);_0x1ad94d[_0xcb51('0x2d')]=qs[_0xcb51('0x2d')](_0x47ba4d[_0xcb51('0x49')][_0xcb51('0x2d')]);}_0x1ad94d[_0xcb51('0x50')]=qs[_0xcb51('0x51')](_0x47ba4d[_0xcb51('0x49')]['sort']);_0x1ad94d[_0xcb51('0x52')]=qs[_0xcb51('0x4b')](_[_0xcb51('0x53')](_0x47ba4d[_0xcb51('0x49')],_0x574677[_0xcb51('0x4b')]));_0x1ad94d[_0xcb51('0x52')][_0xcb51('0x68')]=_0x3d8fb3['id'];if(_0x47ba4d[_0xcb51('0x49')][_0xcb51('0x54')]){_0x1ad94d['where']=_[_0xcb51('0x55')](_0x1ad94d[_0xcb51('0x52')],{'$or':_[_0xcb51('0x42')](_0x1ad94d['attributes'],function(_0x16f2b5){var _0x1e2a28={};_0x1e2a28[_0x16f2b5]={'$like':'%'+_0x47ba4d[_0xcb51('0x49')]['filter']+'%'};return _0x1e2a28;})});}_0x1ad94d=_[_0xcb51('0x55')]({},_0x1ad94d,_0x47ba4d[_0xcb51('0x57')]);return db[_0xcb51('0x69')]['count']({'where':_0x1ad94d[_0xcb51('0x52')]})[_0xcb51('0x1f')](function(_0x179ac4){_0x3cb259[_0xcb51('0x30')]=_0x179ac4;if(_0x47ba4d[_0xcb51('0x49')][_0xcb51('0x58')]){_0x1ad94d[_0xcb51('0x59')]=[{'all':!![]}];}return db[_0xcb51('0x69')][_0xcb51('0x5a')](_0x1ad94d);})[_0xcb51('0x1f')](function(_0x51d4c0){_0x3cb259['rows']=_0x51d4c0;return _0x3cb259;});}})[_0xcb51('0x1f')](respondWithFilteredResult(_0xd062e2,_0x1ad94d))[_0xcb51('0x2a')](handleError(_0xd062e2,null));};exports['removeDispositions']=function(_0x5eaf64,_0x55e216,_0x14ba6b){return db['SmsAccount'][_0xcb51('0x63')]({'where':{'id':_0x5eaf64[_0xcb51('0x66')]['id']}})[_0xcb51('0x1f')](handleEntityNotFound(_0x55e216,null))[_0xcb51('0x1f')](function(_0xc3d947){if(_0xc3d947){return _0xc3d947[_0xcb51('0x6c')](_0x5eaf64[_0xcb51('0x49')][_0xcb51('0x6d')]);}})[_0xcb51('0x1f')](respondWithStatusCode(_0x55e216,null))[_0xcb51('0x2a')](handleError(_0x55e216,null));};exports['addAnswer']=function(_0x59e1b0,_0x4798d6,_0x448f4b){if(_0x59e1b0['body']['id']){delete _0x59e1b0[_0xcb51('0x60')]['id'];}return db[_0xcb51('0x43')][_0xcb51('0x63')]({'where':{'id':_0x59e1b0['params']['id']}})[_0xcb51('0x1f')](handleEntityNotFound(_0x4798d6,null))[_0xcb51('0x1f')](function(_0x56190b){if(_0x56190b){_0x59e1b0['body'][_0xcb51('0x68')]=_0x56190b['id'];return db[_0xcb51('0x6e')]['create'](_0x59e1b0[_0xcb51('0x60')]);}})[_0xcb51('0x1f')](respondWithResult(_0x4798d6,null))[_0xcb51('0x2a')](handleError(_0x4798d6,null));};exports['getAnswers']=function(_0x2c3b50,_0x1b04ca,_0x5758c2){var _0x3e61db={'raw':![],'where':{}};var _0x1ab54f={};var _0x15ecc6={'count':0x0,'rows':[]};return db[_0xcb51('0x43')][_0xcb51('0x6a')]({'where':{'id':_0x2c3b50[_0xcb51('0x66')]['id']}})[_0xcb51('0x1f')](handleEntityNotFound(_0x1b04ca,null))[_0xcb51('0x1f')](function(_0x339d5a){if(_0x339d5a){_0x1ab54f[_0xcb51('0x48')]=_[_0xcb51('0x4a')](db[_0xcb51('0x6e')][_0xcb51('0x44')]);_0x1ab54f[_0xcb51('0x49')]=_[_0xcb51('0x4a')](_0x2c3b50['query']);_0x1ab54f[_0xcb51('0x4b')]=_[_0xcb51('0x4c')](_0x1ab54f[_0xcb51('0x48')],_0x1ab54f['query']);_0x3e61db[_0xcb51('0x4e')]=_[_0xcb51('0x4c')](_0x1ab54f[_0xcb51('0x48')],qs['fields'](_0x2c3b50[_0xcb51('0x49')][_0xcb51('0x4d')]));_0x3e61db[_0xcb51('0x4e')]=_0x3e61db[_0xcb51('0x4e')][_0xcb51('0x5e')]?_0x3e61db[_0xcb51('0x4e')]:_0x1ab54f[_0xcb51('0x48')];if(!_0x2c3b50[_0xcb51('0x49')][_0xcb51('0x6b')](_0xcb51('0x4f'))){_0x3e61db['limit']=qs['limit'](_0x2c3b50[_0xcb51('0x49')][_0xcb51('0x2f')]);_0x3e61db[_0xcb51('0x2d')]=qs[_0xcb51('0x2d')](_0x2c3b50[_0xcb51('0x49')][_0xcb51('0x2d')]);}_0x3e61db[_0xcb51('0x50')]=qs['sort'](_0x2c3b50[_0xcb51('0x49')][_0xcb51('0x51')]);_0x3e61db[_0xcb51('0x52')]=qs[_0xcb51('0x4b')](_[_0xcb51('0x53')](_0x2c3b50[_0xcb51('0x49')],_0x1ab54f['filters']));_0x3e61db[_0xcb51('0x52')][_0xcb51('0x68')]=_0x339d5a['id'];if(_0x2c3b50[_0xcb51('0x49')][_0xcb51('0x54')]){_0x3e61db['where']=_[_0xcb51('0x55')](_0x3e61db[_0xcb51('0x52')],{'$or':_[_0xcb51('0x42')](_0x3e61db[_0xcb51('0x4e')],function(_0x255112){var _0x5c6ff8={};_0x5c6ff8[_0x255112]={'$like':'%'+_0x2c3b50[_0xcb51('0x49')]['filter']+'%'};return _0x5c6ff8;})});}_0x3e61db=_['merge']({},_0x3e61db,_0x2c3b50['options']);return db[_0xcb51('0x6e')][_0xcb51('0x30')]({'where':_0x3e61db['where']})[_0xcb51('0x1f')](function(_0x3166c4){_0x15ecc6['count']=_0x3166c4;if(_0x2c3b50[_0xcb51('0x49')][_0xcb51('0x58')]){_0x3e61db[_0xcb51('0x59')]=[{'all':!![]}];}return db[_0xcb51('0x6e')][_0xcb51('0x5a')](_0x3e61db);})[_0xcb51('0x1f')](function(_0xa02338){_0x15ecc6['rows']=_0xa02338;return _0x15ecc6;});}})[_0xcb51('0x1f')](respondWithFilteredResult(_0x1b04ca,_0x3e61db))['catch'](handleError(_0x1b04ca,null));};exports['removeAnswers']=function(_0x53159b,_0x1c17ec,_0x279185){return db['SmsAccount']['find']({'where':{'id':_0x53159b[_0xcb51('0x66')]['id']}})[_0xcb51('0x1f')](handleEntityNotFound(_0x1c17ec,null))[_0xcb51('0x1f')](function(_0xd116a2){if(_0xd116a2){return _0xd116a2[_0xcb51('0x6f')](_0x53159b[_0xcb51('0x49')][_0xcb51('0x6d')]);}})[_0xcb51('0x1f')](respondWithStatusCode(_0x1c17ec,null))['catch'](handleError(_0x1c17ec,null));};exports[_0xcb51('0x70')]=function(_0x5b24a2,_0x9b1fb8,_0x5ac6ee){var _0x1cf617={'channel':_0xcb51('0x71')};var _0x2f1211=[];var _0x3f3dce=[];var _0x40ab7a={};return db[_0xcb51('0x43')][_0xcb51('0x63')]({'where':{'id':_0x5b24a2[_0xcb51('0x66')]['id']},'include':[{'model':db[_0xcb51('0x72')],'as':_0xcb51('0x73')}]})[_0xcb51('0x1f')](handleEntityNotFound(_0x9b1fb8,null))['then'](function(_0x49d413){_0x1cf617[_0xcb51('0x74')]=_0x49d413;_0x1cf617[_0xcb51('0x75')]=_[_0xcb51('0x76')](_0x49d413['Applications'],[_0xcb51('0x77')],[_0xcb51('0x78')]);if(_0x1cf617['account'][_0xcb51('0x73')]){delete _0x1cf617[_0xcb51('0x74')][_0xcb51('0x73')];}return db['CmContact'][_0xcb51('0x79')]();})['then'](function(_0x545a5b){if(!_0x545a5b){throw new db[(_0xcb51('0x7a'))][(_0xcb51('0x7b'))](_0xcb51('0x7c'));}_0x2f1211=_[_0xcb51('0x7d')](_[_0xcb51('0x4a')](_0x545a5b),[_0xcb51('0x7e'),_0xcb51('0x7f')]);_0x3f3dce=_[_0xcb51('0x7d')](_[_0xcb51('0x4a')](_0x545a5b),[_0xcb51('0x7e'),_0xcb51('0x7f'),_0xcb51('0x80'),_0xcb51('0x81')]);_0x1cf617['body']={'mapKey':_0xcb51('0x82')};if(_0x1cf617['account'][_0xcb51('0x46')]){switch(_0x1cf617[_0xcb51('0x74')][_0xcb51('0x46')]){case _0xcb51('0x83'):_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x85')];_0x1cf617['body'][_0xcb51('0x60')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x86')];_0x1cf617[_0xcb51('0x60')][_0xcb51('0x87')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x88')];break;case _0xcb51('0x89'):_0x1cf617[_0xcb51('0x60')]['from']='+'+_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x8a')];_0x1cf617['body'][_0xcb51('0x60')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x8b')];break;case'connectel':_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')]=_0x5b24a2[_0xcb51('0x60')]['from'];_0x1cf617['body'][_0xcb51('0x60')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x28')];break;case _0xcb51('0x8c'):_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x84')];_0x1cf617[_0xcb51('0x60')]['body']=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x60')];_0x1cf617['body'][_0xcb51('0x87')]=_0x5b24a2[_0xcb51('0x60')]['message_id'];break;case _0xcb51('0x8d'):_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x85')];_0x1cf617[_0xcb51('0x60')][_0xcb51('0x60')]=_0x5b24a2[_0xcb51('0x60')]['Text'];_0x1cf617[_0xcb51('0x60')][_0xcb51('0x87')]=_0x5b24a2['body'][_0xcb51('0x8e')];break;case _0xcb51('0x8f'):_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')]='+'+_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x90')][0x0]['from'];_0x1cf617[_0xcb51('0x60')][_0xcb51('0x60')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x90')][0x0][_0xcb51('0x8b')];_0x1cf617[_0xcb51('0x60')]['messageId']=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x90')][0x0][_0xcb51('0x87')];break;case'csc':_0x1cf617[_0xcb51('0x60')]['from']=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x91')];_0x1cf617[_0xcb51('0x60')]['body']=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x92')][_0xcb51('0x28')];break;case'clickatell':_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x93')];_0x1cf617['body']['body']=_0x5b24a2['body']['text'];_0x1cf617['body']['messageId']=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x94')];break;case _0xcb51('0x95'):_0x1cf617[_0xcb51('0x60')][_0xcb51('0x87')]=_0x5b24a2['body'][0x0][_0xcb51('0x28')]['id'];_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')]=_0x5b24a2[_0xcb51('0x60')][0x0][_0xcb51('0x28')][_0xcb51('0x84')];_0x1cf617[_0xcb51('0x60')][_0xcb51('0x60')]=_0x5b24a2[_0xcb51('0x60')][0x0][_0xcb51('0x28')][_0xcb51('0x8b')];break;case'intelepeer':_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x84')];_0x1cf617['body'][_0xcb51('0x60')]=_0x5b24a2[_0xcb51('0x60')][_0xcb51('0x28')];_0x1cf617[_0xcb51('0x60')][_0xcb51('0x87')]=_0x5b24a2[_0xcb51('0x60')]['refid'];break;}}if(_0x1cf617[_0xcb51('0x60')]['id']){delete _0x1cf617['body']['id'];}if(_[_0xcb51('0x96')](_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')])){throw new db['Sequelize'][(_0xcb51('0x7b'))](_0xcb51('0x97'));}if(_[_0xcb51('0x96')](_0x1cf617[_0xcb51('0x60')]['body'])||_0x1cf617[_0xcb51('0x60')][_0xcb51('0x60')]===''){throw new db[(_0xcb51('0x7a'))][(_0xcb51('0x7b'))](_0xcb51('0x98'));}if(_[_0xcb51('0x96')](_0x1cf617[_0xcb51('0x60')][_0xcb51('0x99')])){throw new db['Sequelize'][(_0xcb51('0x7b'))](_0xcb51('0x9a')+_0x3f3dce);}if(!_['includes'](_0x3f3dce,_0x1cf617[_0xcb51('0x60')][_0xcb51('0x99')])){throw new db[(_0xcb51('0x7a'))][(_0xcb51('0x7b'))](_0xcb51('0x9b')+_0x3f3dce);}_0x40ab7a[_0x1cf617['body'][_0xcb51('0x99')]]=_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')];return db[_0xcb51('0x9c')][_0xcb51('0x63')]({'where':{'id':_0x1cf617[_0xcb51('0x74')]['ListId']},'include':[{'model':db[_0xcb51('0x9d')],'as':_0xcb51('0x9e'),'where':_0x40ab7a,'limit':0x1,'order':[[_0xcb51('0x7f'),_0xcb51('0x9f')]]}]});})[_0xcb51('0x1f')](handleEntityNotFound(_0x9b1fb8,null))[_0xcb51('0x1f')](function(_0xc49064){if(_0xc49064){_0x1cf617['list']=_['omit'](_0xc49064,[_0xcb51('0x9e')]);if(_0xc49064[_0xcb51('0x9e')][_0xcb51('0x5e')]){return _0xc49064[_0xcb51('0x9e')][0x0];}var _0x11951d=_['defaults'](_0x1cf617[_0xcb51('0x60')],{'firstName':_0x1cf617[_0xcb51('0x60')]['from'],'ListId':_0xc49064['id']});_0x11951d[_0x1cf617['body'][_0xcb51('0x99')]]=_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')];return db[_0xcb51('0x9d')][_0xcb51('0x5f')](_0x11951d,{'fields':_0x2f1211,'raw':!![]});}})[_0xcb51('0x1f')](handleEntityNotFound(_0x9b1fb8,null))[_0xcb51('0x1f')](function(_0x58422b){if(_0x58422b){_0x1cf617[_0xcb51('0xa0')]=_0x58422b;var _0x559099={'ContactId':_0x58422b['id'],'phone':_0x1cf617['body']['from'],'SmsAccountId':_0x5b24a2[_0xcb51('0x66')]['id']};var _0x36117f={'ContactId':_0x58422b['id'],'SmsAccountId':_0x5b24a2[_0xcb51('0x66')]['id'],'closed':![]};return db[_0xcb51('0xa1')][_0xcb51('0x63')]({'where':_0x36117f})['then'](function(_0x220c9e){if(_0x220c9e){return[_0x220c9e,![]];}return db[_0xcb51('0xa1')][_0xcb51('0x5f')](_0x559099)[_0xcb51('0x1f')](function(_0x3867da){return[_0x3867da,!![]];});});}})[_0xcb51('0xa2')](function(_0x1ec677,_0x193e43){_0x1cf617[_0xcb51('0xa3')]=_0x1ec677[_0xcb51('0x38')]({'plain':!![]});_0x1cf617[_0xcb51('0xa3')][_0xcb51('0xa4')]=![];if(_0x193e43){if(_0x1cf617[_0xcb51('0x74')][_0xcb51('0xa5')]){_0x1cf617['applications'][_0xcb51('0xa6')]({'id':0x0,'priority':_0x1cf617[_0xcb51('0x75')][_0xcb51('0x5e')]+0x1,'app':_0xcb51('0xa7'),'appdata':'unmanaged','interval':_0xcb51('0xa8')});}_0x1cf617['interaction'][_0xcb51('0xa4')]=!![];}return db[_0xcb51('0xa9')]['create']({'phone':_0x1cf617[_0xcb51('0x60')][_0xcb51('0x84')],'messageId':_0x1cf617[_0xcb51('0x60')][_0xcb51('0x87')],'body':_0x1cf617[_0xcb51('0x60')][_0xcb51('0x60')],'SmsAccountId':_0x5b24a2['params']['id'],'SmsInteractionId':_0x1ec677['id'],'direction':'in','ContactId':_0x1ec677['ContactId'],'AttachmentId':_0x1cf617['body'][_0xcb51('0xaa')]});})[_0xcb51('0x1f')](function(_0x3b8d55){_0x1cf617[_0xcb51('0x28')]=_0x3b8d55;if(_0x1cf617[_0xcb51('0xa3')][_0xcb51('0xab')]){return db['User'][_0xcb51('0x63')]({'attributes':['id',_0xcb51('0x3e')],'where':{'id':_0x1cf617[_0xcb51('0xa3')][_0xcb51('0xab')]}})[_0xcb51('0x1f')](function(_0x340879){if(_0x340879){_0x1cf617[_0xcb51('0x75')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcb51('0xac'),'appdata':_0x340879[_0xcb51('0x3e')]+','+(_0x1cf617[_0xcb51('0x74')]['waitForTheAssignedAgent']||0xa),'interval':_0xcb51('0xa8')});}return respondWithRpcPromise(_0xcb51('0xad'),_0xcb51('0xae'),_0x1cf617);});}return respondWithRpcPromise(_0xcb51('0xad'),_0xcb51('0xae'),_0x1cf617);})[_0xcb51('0x1f')](function(_0x48ae59){if(_0x48ae59){var _0x62c85e=0xc8;var _0x3b942e='receiveMessage';logger[_0xcb51('0x20')](_0xcb51('0x24'),_0x3b942e,_0x62c85e,'entity\x20found');logger[_0xcb51('0x23')](_0xcb51('0xaf'),_0x3b942e,_0x62c85e,'entity\x20found',JSON['stringify'](_0x48ae59));if(_0x1cf617[_0xcb51('0x74')][_0xcb51('0x46')]==='twilio'){return _0x9b1fb8[_0xcb51('0x2b')](_0x62c85e)[_0xcb51('0x31')](_0xcb51('0xb0'),'text/xml')[_0xcb51('0x3f')](_0xcb51('0xb1'));}else{return _0x9b1fb8[_0xcb51('0x2b')](_0x62c85e)['json'](_0x48ae59);}}})[_0xcb51('0x2a')](handleError(_0x9b1fb8,null));};exports[_0xcb51('0xb2')]=function(_0x314630,_0x35fa9d){var _0x483cd9=_0x314630['params']['id'];var _0x22b530=_0x314630['body'];var _0x32c13b=0xc8;var _0x5e8b42=null;return db[_0xcb51('0xb3')]['transaction']({'isolationLevel':db[_0xcb51('0xb3')][_0xcb51('0xb4')]['ISOLATION_LEVELS'][_0xcb51('0xb5')]},function(_0x5ddfe8){return db[_0xcb51('0x43')]['findOne']({'where':{'id':_0x483cd9},'transaction':_0x5ddfe8})['then'](function(_0x59b7ae){if(_0x59b7ae){return db[_0xcb51('0x72')]['destroy']({'where':{'SmsAccountId':_0x483cd9},'transaction':_0x5ddfe8})[_0xcb51('0x1f')](function(){var _0x3b6e1e=_[_0xcb51('0x42')](_0x22b530,function(_0x17e992){_0x17e992[_0xcb51('0x68')]=_0x483cd9;return _0x17e992;});return db[_0xcb51('0x72')]['bulkCreate'](_0x3b6e1e,{'transaction':_0x5ddfe8});});}else{_0x32c13b=0x194;_0x5e8b42=[];}});})[_0xcb51('0x1f')](function(){if(_0x32c13b!==0x194){return db[_0xcb51('0x72')][_0xcb51('0xb6')]({'where':{'SmsAccountId':_0x483cd9},'order':_0xcb51('0x77')})[_0xcb51('0x1f')](function(_0x2e9318){_0x5e8b42=_0x2e9318;});}})[_0xcb51('0x2a')](function(_0x2cdac5){_0x32c13b=0x1f4;logger[_0xcb51('0x26')](_0x2cdac5['stack']);if(_0x2cdac5[_0xcb51('0x3e')]){delete _0x2cdac5['name'];}_0x5e8b42=_0x2cdac5;})[_0xcb51('0xb7')](function(){if(_0x5e8b42===null){_0x35fa9d['sendStatus'](_0x32c13b);}else{if(_0x32c13b===0x1f4){_0x35fa9d['status'](_0x32c13b)['send'](_0x5e8b42);}else{_0x35fa9d[_0xcb51('0x2b')](_0x32c13b)['json'](_0x5e8b42);}}});};exports[_0xcb51('0xb8')]=function(_0xaa2ac5,_0xeca182,_0x41afd4){var _0xeadb0={};var _0x5f59d0={};var _0x57593c;var _0x28b753;return db['SmsAccount'][_0xcb51('0x6a')]({'where':{'id':_0xaa2ac5[_0xcb51('0x66')]['id']}})['then'](handleEntityNotFound(_0xeca182,null))['then'](function(_0x3b4761){if(_0x3b4761){_0x57593c=_0x3b4761;_0x5f59d0['model']=_[_0xcb51('0x4a')](db[_0xcb51('0x72')]['rawAttributes']);_0x5f59d0['query']=_[_0xcb51('0x4a')](_0xaa2ac5[_0xcb51('0x49')]);_0x5f59d0[_0xcb51('0x4b')]=_[_0xcb51('0x4c')](_0x5f59d0[_0xcb51('0x48')],_0x5f59d0[_0xcb51('0x49')]);_0xeadb0[_0xcb51('0x4e')]=_[_0xcb51('0x4c')](_0x5f59d0[_0xcb51('0x48')],qs[_0xcb51('0x4d')](_0xaa2ac5[_0xcb51('0x49')][_0xcb51('0x4d')]));_0xeadb0['attributes']=_0xeadb0[_0xcb51('0x4e')][_0xcb51('0x5e')]?_0xeadb0[_0xcb51('0x4e')]:_0x5f59d0['model'];_0xeadb0[_0xcb51('0x50')]=qs[_0xcb51('0x51')](_0xaa2ac5[_0xcb51('0x49')][_0xcb51('0x51')]);_0xeadb0[_0xcb51('0x52')]=qs['filters'](_['pick'](_0xaa2ac5['query'],_0x5f59d0['filters']));if(_0xaa2ac5[_0xcb51('0x49')]['filter']){_0xeadb0[_0xcb51('0x52')]=_[_0xcb51('0x55')](_0xeadb0[_0xcb51('0x52')],{'$or':_['map'](_0xeadb0[_0xcb51('0x4e')],function(_0x2cd156){var _0x4dd829={};_0x4dd829[_0x2cd156]={'$like':'%'+_0xaa2ac5[_0xcb51('0x49')][_0xcb51('0x54')]+'%'};return _0x4dd829;})});}_0xeadb0=_['merge']({},_0xeadb0,_0xaa2ac5[_0xcb51('0x57')]);return _0x57593c['getApplications'](_0xeadb0);}})[_0xcb51('0x1f')](function(_0x1182c5){if(_0x1182c5){_0x28b753=_0x1182c5[_0xcb51('0x5e')];if(!_0xaa2ac5[_0xcb51('0x49')]['hasOwnProperty']('nolimit')){_0xeadb0[_0xcb51('0x2f')]=qs[_0xcb51('0x2f')](_0xaa2ac5[_0xcb51('0x49')]['limit']);_0xeadb0[_0xcb51('0x2d')]=qs[_0xcb51('0x2d')](_0xaa2ac5[_0xcb51('0x49')][_0xcb51('0x2d')]);}return _0x57593c[_0xcb51('0xb8')](_0xeadb0);}})['then'](function(_0x1ce9d0){if(_0x1ce9d0){return _0x1ce9d0?{'count':_0x28b753,'rows':_0x1ce9d0}:null;}})[_0xcb51('0x1f')](respondWithResult(_0xeca182,null))[_0xcb51('0x2a')](handleError(_0xeca182,null));};exports['getInteractions']=function(_0x54e8c1,_0x34bd4e,_0x12148f){var _0x114119={'raw':![],'where':{}};var _0x4dcaf7={};var _0x52d63b={'count':0x0,'rows':[]};return db[_0xcb51('0x43')][_0xcb51('0x6a')]({'where':{'id':_0x54e8c1['params']['id']}})['then'](handleEntityNotFound(_0x34bd4e,null))[_0xcb51('0x1f')](function(_0x422555){if(_0x422555){_0x4dcaf7['model']=_[_0xcb51('0x4a')](db['SmsInteraction'][_0xcb51('0x44')]);_0x4dcaf7[_0xcb51('0x49')]=_[_0xcb51('0x4a')](_0x54e8c1['query']);_0x4dcaf7[_0xcb51('0x4b')]=_[_0xcb51('0x4c')](_0x4dcaf7['model'],_0x4dcaf7[_0xcb51('0x49')]);_0x114119['attributes']=_[_0xcb51('0x4c')](_0x4dcaf7['model'],qs[_0xcb51('0x4d')](_0x54e8c1[_0xcb51('0x49')][_0xcb51('0x4d')]));_0x114119['attributes']=_0x114119[_0xcb51('0x4e')][_0xcb51('0x5e')]?_0x114119[_0xcb51('0x4e')]:_0x4dcaf7[_0xcb51('0x48')];if(!_0x54e8c1[_0xcb51('0x49')][_0xcb51('0x6b')](_0xcb51('0x4f'))){_0x114119[_0xcb51('0x2f')]=qs[_0xcb51('0x2f')](_0x54e8c1[_0xcb51('0x49')]['limit']);_0x114119['offset']=qs[_0xcb51('0x2d')](_0x54e8c1['query'][_0xcb51('0x2d')]);}_0x114119[_0xcb51('0x50')]=qs[_0xcb51('0x51')](_0x54e8c1['query'][_0xcb51('0x51')]);_0x114119[_0xcb51('0x52')]=qs[_0xcb51('0x4b')](_['pick'](_0x54e8c1['query'],_0x4dcaf7[_0xcb51('0x4b')]));_0x114119[_0xcb51('0x52')][_0xcb51('0x68')]=_0x422555['id'];if(_0x54e8c1['query'][_0xcb51('0x54')]){_0x114119[_0xcb51('0x52')]=_[_0xcb51('0x55')](_0x114119[_0xcb51('0x52')],{'$or':_[_0xcb51('0x42')](_0x114119['attributes'],function(_0x17ec0d){var _0x5465ed={};_0x5465ed[_0x17ec0d]={'$like':'%'+_0x54e8c1[_0xcb51('0x49')]['filter']+'%'};return _0x5465ed;})});}_0x114119=_[_0xcb51('0x55')]({},_0x114119,_0x54e8c1[_0xcb51('0x57')]);return db[_0xcb51('0xa1')][_0xcb51('0x30')]({'where':_0x114119[_0xcb51('0x52')]})['then'](function(_0x552e34){_0x52d63b[_0xcb51('0x30')]=_0x552e34;if(_0x54e8c1[_0xcb51('0x49')]['includeAll']){_0x114119['include']=[{'model':db[_0xcb51('0x9d')],'as':_0xcb51('0xb9'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xcb51('0x3e'),_0xcb51('0xba'),_0xcb51('0xbb')],'required':![]},{'model':db['Tag'],'as':_0xcb51('0xbc'),'attributes':['id',_0xcb51('0x3e'),_0xcb51('0xbd')],'where':_0x54e8c1[_0xcb51('0x49')][_0xcb51('0xbe')]?{'id':_0x54e8c1['query'][_0xcb51('0xbe')]}:undefined,'required':_0x54e8c1[_0xcb51('0x49')][_0xcb51('0xbe')]?!![]:![]}];}return db[_0xcb51('0xa1')]['findAll'](_0x114119);})['then'](function(_0x32c89b){_0x52d63b[_0xcb51('0x5b')]=_0x32c89b;return _0x52d63b;});}})[_0xcb51('0x1f')](respondWithFilteredResult(_0x34bd4e,_0x114119))['catch'](handleError(_0x34bd4e,null));};exports[_0xcb51('0x3f')]=function(_0x21751b,_0x1834f9,_0x55213f){var _0x111c5a,_0x420e65,_0x156a8a;if(_['isNil'](_0x21751b[_0xcb51('0x60')]['body'])||_0x21751b['body'][_0xcb51('0x60')]===''){throw new db[(_0xcb51('0x7a'))][(_0xcb51('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xcb51('0x96')](_0x21751b[_0xcb51('0x60')]['to'])){throw new db['Sequelize'][(_0xcb51('0x7b'))](_0xcb51('0xbf'));}_0x111c5a=_0x21751b[_0xcb51('0x60')]['to'];return db['SmsAccount'][_0xcb51('0x63')]({'where':{'id':_0x21751b[_0xcb51('0x66')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xcb51('0x9d')],'as':'Contacts','where':{'mobile':_0x111c5a},'limit':0x1,'order':[['updatedAt',_0xcb51('0x9f')]]}]}]})[_0xcb51('0x1f')](handleEntityNotFound(_0x1834f9,null))[_0xcb51('0x1f')](function(_0x58a3fc){if(_0x58a3fc&&_0x58a3fc[_0xcb51('0xc0')]){_0x420e65=_0x58a3fc[_0xcb51('0x38')]({'plain':!![]});if(_0x420e65['List']&&_0x420e65[_0xcb51('0xc0')][_0xcb51('0x9e')][_0xcb51('0x5e')]){return _0x420e65[_0xcb51('0xc0')][_0xcb51('0x9e')][0x0];}return db[_0xcb51('0x9d')][_0xcb51('0x5f')](_[_0xcb51('0x1b')](_0x21751b[_0xcb51('0x60')],{'firstName':_0x111c5a,'mobile':_0x111c5a,'phone':_0x111c5a,'ListId':_0x420e65['ListId']}));}})['then'](handleEntityNotFound(_0x1834f9,null))['then'](function(_0x4d64bd){if(_0x4d64bd){_0x156a8a=_0x4d64bd;return db['SmsInteraction']['find']({'where':{'ContactId':_0x156a8a['id'],'closed':![],'SmsAccountId':_0x420e65['id']}})[_0xcb51('0x1f')](function(_0x96144e){if(_0x96144e){return[_0x96144e,![]];}return db['SmsInteraction']['create']({'UserId':_0x21751b[_0xcb51('0x61')]['id'],'ContactId':_0x156a8a['id'],'SmsAccountId':_0x420e65['id'],'phone':_0x111c5a,'firstMsgDirection':_0xcb51('0xc1'),'Messages':[_[_0xcb51('0x55')](_0x21751b[_0xcb51('0x60')],{'read':![],'body':_0x21751b[_0xcb51('0x60')]['body'],'phone':_0x111c5a,'SmsAccountId':_0x420e65['id'],'UserId':_0x21751b['user']['id'],'ContactId':_0x156a8a['id']})]},{'include':[{'model':db[_0xcb51('0xa9')],'as':_0xcb51('0xc2')}]})[_0xcb51('0x1f')](function(_0x4a2d4c){return[_0x4a2d4c,!![]];});});}})[_0xcb51('0xa2')](function(_0x564d23,_0x41e52e){if(_0x41e52e){return _0x564d23;}return db[_0xcb51('0xa9')][_0xcb51('0x5f')](_[_0xcb51('0x55')](_0x21751b['body'],{'read':![],'body':_0x21751b[_0xcb51('0x60')][_0xcb51('0x60')],'phone':_0x111c5a,'SmsAccountId':_0x420e65['id'],'SmsInteractionId':_0x564d23['id'],'UserId':_0x21751b[_0xcb51('0x61')]['id'],'ContactId':_0x156a8a['id']}))['then'](function(_0x1a55ad){_0x564d23['dataValues'][_0xcb51('0xc2')]=[];_0x564d23[_0xcb51('0xc3')][_0xcb51('0xc2')]['push'](_0x1a55ad[_0xcb51('0xc3')]);return _0x564d23;});})[_0xcb51('0x1f')](respondWithResult(_0x1834f9,null))[_0xcb51('0x2a')](handleError(_0x1834f9,null));};exports[_0xcb51('0x2b')]=function(_0x1bf16e,_0x1ea0b2,_0x3e6cf6){if(_0x1bf16e[_0xcb51('0x60')]['id']){delete _0x1bf16e[_0xcb51('0x60')]['id'];}var _0x21a4ef,_0x20b181,_0x2dcd58;return db[_0xcb51('0x43')][_0xcb51('0x63')]({'where':{'id':_0x1bf16e[_0xcb51('0x66')]['id']}})['then'](handleEntityNotFound(_0x1ea0b2,null))[_0xcb51('0x1f')](function(_0x44a43d){if(_0x44a43d){_0x2dcd58=_0x44a43d;logger[_0xcb51('0x23')](_0xcb51('0x24'),_0xcb51('0x2b'),'received\x20delivery\x20report\x20from',_0x44a43d[_0xcb51('0x46')],util[_0xcb51('0xc4')](_0x1bf16e[_0xcb51('0x60')],{'showHidden':![],'depth':null}));switch(_0x44a43d[_0xcb51('0x46')]){case _0xcb51('0x89'):if(_0x1bf16e[_0xcb51('0x60')][_0xcb51('0xc5')]&&_0x1bf16e[_0xcb51('0x60')][_0xcb51('0x2b')]){_0x20b181=_0x1bf16e[_0xcb51('0x60')][_0xcb51('0x2b')];return db[_0xcb51('0xa9')]['find']({'where':{'messageId':_0x1bf16e[_0xcb51('0x60')][_0xcb51('0xc5')]}});}break;case _0xcb51('0xc6'):if(_0x1bf16e[_0xcb51('0x60')][_0xcb51('0xc7')]&&_0x1bf16e[_0xcb51('0x60')][_0xcb51('0xc8')]){_0x20b181=_0x1bf16e['body']['statusInt'];return db[_0xcb51('0xa9')][_0xcb51('0x63')]({'where':{'messageId':_0x1bf16e['body']['requestid']}});}break;case _0xcb51('0x8c'):if(_0x1bf16e[_0xcb51('0x60')]['message_id']&&_0x1bf16e[_0xcb51('0x60')]['status_code']){_0x20b181=_0x1bf16e[_0xcb51('0x60')][_0xcb51('0xc9')];return db[_0xcb51('0xa9')][_0xcb51('0x63')]({'where':{'messageId':_0x1bf16e[_0xcb51('0x60')][_0xcb51('0xca')]}});}break;case _0xcb51('0x8f'):var _0x5b8f59=_0x1bf16e['body'][_0xcb51('0x90')][0x0];if(_0x5b8f59[_0xcb51('0x87')]&&_0x5b8f59[_0xcb51('0x2b')]['groupName']===_0xcb51('0xcb')){_0x20b181=_0x5b8f59[_0xcb51('0x2b')][_0xcb51('0xcc')];return db[_0xcb51('0xa9')][_0xcb51('0x63')]({'where':{'messageId':_0x5b8f59[_0xcb51('0x87')]}});}break;case'clickatell':if(_0x1bf16e['body'][_0xcb51('0x87')]&&_0x1bf16e[_0xcb51('0x60')][_0xcb51('0x2b')]){_0x20b181=_0x1bf16e[_0xcb51('0x60')][_0xcb51('0x2b')];return db[_0xcb51('0xa9')]['find']({'where':{'messageId':_0x1bf16e[_0xcb51('0x60')]['messageId']}});}break;case _0xcb51('0x95'):if(_0x1bf16e[_0xcb51('0x60')][0x0][_0xcb51('0x28')]['id']){_0x20b181=_0x1bf16e[_0xcb51('0x60')][0x0][_0xcb51('0x46')];return db[_0xcb51('0xa9')][_0xcb51('0x63')]({'where':{'messageId':_0x1bf16e[_0xcb51('0x60')][0x0][_0xcb51('0x28')]['id']}});}break;case _0xcb51('0xcd'):if(_0x1bf16e[_0xcb51('0x60')]['redif']&&_0x1bf16e[_0xcb51('0x60')][_0xcb51('0x2b')]){_0x20b181=_0x1bf16e[_0xcb51('0x60')][_0xcb51('0x2b')];return db[_0xcb51('0xa9')][_0xcb51('0x63')]({'where':{'messageId':_0x1bf16e['body'][_0xcb51('0xce')]}});}break;}}})[_0xcb51('0x1f')](handleEntityNotFound(_0x1ea0b2,null))[_0xcb51('0x1f')](function(_0x350441){if(_0x350441){_0x21a4ef=_0x350441;switch(_0x2dcd58[_0xcb51('0x46')]){case _0xcb51('0x89'):if(_0x20b181===_0xcb51('0xcb')){return _0x21a4ef['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xcb51('0x2b'),'skebby',util[_0xcb51('0xc4')](_0x1bf16e[_0xcb51('0x60')],{'showHidden':![],'depth':null}));}break;case _0xcb51('0xc6'):if(_0x20b181==='1'){return _0x21a4ef[_0xcb51('0x36')]({'read':!![]});}else{logger['error'](_0xcb51('0x24'),_0xcb51('0x2b'),_0xcb51('0x89'),util[_0xcb51('0xc4')](_0x1bf16e['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x1bf16e['body']['error_code']&&_0x20b181>=0xc8&&_0x20b181<=0xce){return _0x21a4ef[_0xcb51('0x36')]({'read':!![]});}else{logger['error'](_0xcb51('0x24'),_0xcb51('0x2b'),_0xcb51('0x8c'),util['inspect'](_0x1bf16e[_0xcb51('0x60')],{'showHidden':![],'depth':null}));}break;case _0xcb51('0x8f'):var _0x4974bb=_0x1bf16e[_0xcb51('0x60')][_0xcb51('0x90')][0x0];if(_0x4974bb['status'][_0xcb51('0xcc')]===_0xcb51('0xcb')){return _0x21a4ef[_0xcb51('0x36')]({'read':!![]});}else{logger[_0xcb51('0x26')](_0xcb51('0x24'),'status',_0xcb51('0x8f'),util[_0xcb51('0xc4')](_0x1bf16e[_0xcb51('0x60')],{'showHidden':![],'depth':null}));}break;case _0xcb51('0xcf'):if(_0x20b181==_0xcb51('0xd0')||_0x20b181==_0xcb51('0xd1')){return _0x21a4ef[_0xcb51('0x36')]({'read':!![]});}else{logger[_0xcb51('0x26')](_0xcb51('0x24'),_0xcb51('0x2b'),_0xcb51('0xcf'),util[_0xcb51('0xc4')](_0x1bf16e[_0xcb51('0x60')],{'showHidden':![],'depth':null}));}break;case _0xcb51('0x95'):if(_0x20b181==_0xcb51('0xd2')){return _0x21a4ef[_0xcb51('0x36')]({'read':!![]});}else{logger[_0xcb51('0x26')](_0xcb51('0x24'),'status','bandwidth',util[_0xcb51('0xc4')](_0x1bf16e[_0xcb51('0x60')],{'showHidden':![],'depth':null}));}break;case _0xcb51('0xcd'):if(_0x20b181===_0xcb51('0xd3')||_0x20b181===_0xcb51('0xd4')){return _0x21a4ef[_0xcb51('0x36')]({'read':!![]});}else{logger['error'](_0xcb51('0x24'),_0xcb51('0x2b'),_0xcb51('0xcd'),util['inspect'](_0x1bf16e['body'],{'showHidden':![],'depth':null}));}break;}return _0x21a4ef;}})['then'](respondWithResult(_0x1ea0b2,null))[_0xcb51('0x2a')](handleError(_0x1ea0b2,null));};exports[_0xcb51('0xd5')]=function(_0x4cc403,_0x4bf950,_0x32fbe2){var _0x1fcb7c,_0x4777fe,_0x26c185;return db[_0xcb51('0x43')][_0xcb51('0x63')]({'where':{'id':_0x4cc403[_0xcb51('0x66')]['id']}})[_0xcb51('0x1f')](handleEntityNotFound(_0x4bf950,null))['then'](function(_0xdefcae){if(_0xdefcae){_0x26c185=_0xdefcae;logger[_0xcb51('0x23')](_0xcb51('0x24'),_0xcb51('0x2b'),_0xcb51('0xd6'),_0xdefcae[_0xcb51('0x46')],util['inspect'](_0x4cc403[_0xcb51('0x49')],{'showHidden':![],'depth':null}));switch(_0xdefcae[_0xcb51('0x46')]){case _0xcb51('0xd7'):if(_0x4cc403[_0xcb51('0x49')][_0xcb51('0xd8')]&&_0x4cc403[_0xcb51('0x49')][_0xcb51('0xd9')]){_0x4777fe=_0x4cc403[_0xcb51('0x49')][_0xcb51('0xd9')];return db[_0xcb51('0xa9')][_0xcb51('0x63')]({'where':{'messageId':_0x4cc403['query']['message-id']}});}break;}}})[_0xcb51('0x1f')](handleEntityNotFound(_0x4bf950,null))[_0xcb51('0x1f')](function(_0x18b2ea){if(_0x18b2ea){_0x1fcb7c=_0x18b2ea;switch(_0x26c185[_0xcb51('0x46')]){case _0xcb51('0xd7'):if(_0x4777fe==='2'||_0x4777fe==='6'){return _0x1fcb7c[_0xcb51('0x36')]({'read':!![]});}else{logger[_0xcb51('0x26')](_0xcb51('0x24'),_0xcb51('0x2b'),_0xcb51('0xd7'),util[_0xcb51('0xc4')](_0x4cc403[_0xcb51('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x1fcb7c;}})[_0xcb51('0x1f')](respondWithResult(_0x4bf950,null))[_0xcb51('0x2a')](handleError(_0x4bf950,null));};exports['addAgents']=function(_0x44c9f9,_0x186748,_0xbdb0f0){return db[_0xcb51('0x43')][_0xcb51('0x63')]({'where':{'id':_0x44c9f9['params']['id']}})['then'](handleEntityNotFound(_0x186748,null))[_0xcb51('0x1f')](function(_0xbe9a86){if(_0xbe9a86){return _0xbe9a86[_0xcb51('0xda')](_0x44c9f9[_0xcb51('0x60')][_0xcb51('0x6d')],_[_0xcb51('0xdb')](_0x44c9f9[_0xcb51('0x60')],['ids','id'])||{})[_0xcb51('0xa2')](function(_0x1163aa){for(var _0x1a7657=0x0;_0x1a7657<_0x44c9f9[_0xcb51('0x60')][_0xcb51('0x6d')][_0xcb51('0x5e')];_0x1a7657+=0x1){socket[_0xcb51('0xdc')]('userSmsAccount:save',{'UserId':Number(_0x44c9f9[_0xcb51('0x60')][_0xcb51('0x6d')][_0x1a7657]),'SmsAccountId':Number(_0x44c9f9['params']['id'])});}return _0x1163aa;});}})['then'](respondWithResult(_0x186748,null))[_0xcb51('0x2a')](handleError(_0x186748,null));};exports[_0xcb51('0xdd')]=function(_0x4620b5,_0x5eb8e4,_0x35ad3a){return db[_0xcb51('0x43')][_0xcb51('0x63')]({'where':{'id':_0x4620b5[_0xcb51('0x66')]['id']}})['then'](handleEntityNotFound(_0x5eb8e4,null))[_0xcb51('0x1f')](function(_0x2b3baa){if(_0x2b3baa){return _0x2b3baa['removeAgents'](_0x4620b5['query']['ids'])[_0xcb51('0x1f')](function(){if(_[_0xcb51('0xde')](_0x4620b5[_0xcb51('0x49')][_0xcb51('0x6d')])){for(var _0x3e2d55=0x0;_0x3e2d55<_0x4620b5[_0xcb51('0x49')][_0xcb51('0x6d')][_0xcb51('0x5e')];_0x3e2d55+=0x1){socket[_0xcb51('0xdc')](_0xcb51('0xdf'),{'UserId':Number(_0x4620b5[_0xcb51('0x49')]['ids'][_0x3e2d55]),'SmsAccountId':Number(_0x4620b5[_0xcb51('0x66')]['id'])});}}else{socket[_0xcb51('0xdc')]('userSmsAccount:remove',{'UserId':Number(_0x4620b5['query'][_0xcb51('0x6d')]),'SmsAccountId':Number(_0x4620b5[_0xcb51('0x66')]['id'])});}});}})[_0xcb51('0x1f')](respondWithStatusCode(_0x5eb8e4,null))[_0xcb51('0x2a')](handleError(_0x5eb8e4,null));};exports[_0xcb51('0xe0')]=function(_0x73dfa8,_0x1367f1,_0x374c46){var _0x3641f3={};var _0x26d08b={};var _0x425464;var _0x18264e;return db['SmsAccount'][_0xcb51('0x6a')]({'where':{'id':_0x73dfa8['params']['id']}})[_0xcb51('0x1f')](handleEntityNotFound(_0x1367f1,null))[_0xcb51('0x1f')](function(_0x98af3){if(_0x98af3){_0x425464=_0x98af3;_0x26d08b[_0xcb51('0x48')]=_['keys'](db['User'][_0xcb51('0x44')]);_0x26d08b['query']=_[_0xcb51('0x4a')](_0x73dfa8[_0xcb51('0x49')]);_0x26d08b[_0xcb51('0x4b')]=_[_0xcb51('0x4c')](_0x26d08b[_0xcb51('0x48')],_0x26d08b[_0xcb51('0x49')]);_0x3641f3[_0xcb51('0x4e')]=_[_0xcb51('0x4c')](_0x26d08b[_0xcb51('0x48')],qs[_0xcb51('0x4d')](_0x73dfa8['query']['fields']));_0x3641f3[_0xcb51('0x4e')]=_0x3641f3['attributes'][_0xcb51('0x5e')]?_0x3641f3[_0xcb51('0x4e')]:_0x26d08b[_0xcb51('0x48')];_0x3641f3['order']=qs[_0xcb51('0x51')](_0x73dfa8[_0xcb51('0x49')][_0xcb51('0x51')]);_0x3641f3['where']=qs['filters'](_['pick'](_0x73dfa8['query'],_0x26d08b[_0xcb51('0x4b')]));if(_0x73dfa8[_0xcb51('0x49')]['filter']){_0x3641f3['where']=_[_0xcb51('0x55')](_0x3641f3[_0xcb51('0x52')],{'$or':_[_0xcb51('0x42')](_0x3641f3['attributes'],function(_0x3949de){var _0x32064c={};_0x32064c[_0x3949de]={'$like':'%'+_0x73dfa8['query']['filter']+'%'};return _0x32064c;})});}_0x3641f3=_[_0xcb51('0x55')]({},_0x3641f3,_0x73dfa8[_0xcb51('0x57')]);return _0x425464['getAgents'](_0x3641f3);}})[_0xcb51('0x1f')](function(_0x363b87){if(_0x363b87){_0x18264e=_0x363b87['length'];if(!_0x73dfa8[_0xcb51('0x49')][_0xcb51('0x6b')]('nolimit')){_0x3641f3['limit']=qs[_0xcb51('0x2f')](_0x73dfa8[_0xcb51('0x49')]['limit']);_0x3641f3[_0xcb51('0x2d')]=qs[_0xcb51('0x2d')](_0x73dfa8[_0xcb51('0x49')][_0xcb51('0x2d')]);}return _0x425464[_0xcb51('0xe0')](_0x3641f3);}})['then'](function(_0x1ca4de){if(_0x1ca4de){return _0x1ca4de?{'count':_0x18264e,'rows':_0x1ca4de}:null;}})[_0xcb51('0x1f')](respondWithResult(_0x1367f1,null))['catch'](handleError(_0x1367f1,null));};
\ No newline at end of file
+var _0xa9f4=['SmsAccountId','findOne','Disposition','keys','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','Applications','applications','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','from','From','messageId','MessageSid','sender','text','connectel','clicksend','message_id','MessageUUID','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','set','text/xml','addApplications','sequelize','Transaction','ISOLATION_LEVELS','SmsApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','statusInt','requestid','status_code','infobip','DELIVERED','redif','error_code','groupName','bandwidth','DELIVRD','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','SmsAccount','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','Pause','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition'];(function(_0x4a5f95,_0x1553d3){var _0x4dcfa5=function(_0x1afbcf){while(--_0x1afbcf){_0x4a5f95['push'](_0x4a5f95['shift']());}};_0x4dcfa5(++_0x1553d3);}(_0xa9f4,0x15c));var _0x4a9f=function(_0x4c718e,_0x8e8c75){_0x4c718e=_0x4c718e-0x0;var _0x1e204a=_0xa9f4[_0x4c718e];return _0x1e204a;};'use strict';var emlformat=require(_0x4a9f('0x0'));var rimraf=require(_0x4a9f('0x1'));var zipdir=require(_0x4a9f('0x2'));var jsonpatch=require(_0x4a9f('0x3'));var rp=require(_0x4a9f('0x4'));var moment=require('moment');var BPromise=require(_0x4a9f('0x5'));var Mustache=require(_0x4a9f('0x6'));var util=require('util');var path=require(_0x4a9f('0x7'));var sox=require(_0x4a9f('0x8'));var csv=require(_0x4a9f('0x9'));var ejs=require(_0x4a9f('0xa'));var fs=require('fs');var fs_extra=require(_0x4a9f('0xb'));var _=require(_0x4a9f('0xc'));var squel=require(_0x4a9f('0xd'));var crypto=require('crypto');var jsforce=require(_0x4a9f('0xe'));var deskjs=require(_0x4a9f('0xf'));var toCsv=require(_0x4a9f('0x9'));var querystring=require(_0x4a9f('0x10'));var Papa=require(_0x4a9f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4a9f('0x12'));var as=require(_0x4a9f('0x13'));var hardwareService=require(_0x4a9f('0x14'));var logger=require('../../config/logger')(_0x4a9f('0x15'));var utils=require(_0x4a9f('0x16'));var config=require(_0x4a9f('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4a9f('0x18')]=_[_0x4a9f('0x19')](config[_0x4a9f('0x18')],{'host':_0x4a9f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a9f('0x18')]));require(_0x4a9f('0x1b'))[_0x4a9f('0x1c')](socket);var jayson=require(_0x4a9f('0x1d'));var client=jayson[_0x4a9f('0x1e')][_0x4a9f('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1482e6,_0x5b8439,_0x3a7ea8,_0x16acda){return new BPromise(function(_0x47b30b,_0x589fef){var _0x3e80fb=_0x16acda||client;return _0x3e80fb[_0x4a9f('0x20')](_0x1482e6,_0x3a7ea8)[_0x4a9f('0x21')](function(_0x5eb6c7){logger[_0x4a9f('0x22')]('SmsAccount,\x20%s,\x20%s',_0x5b8439,_0x4a9f('0x23'));logger[_0x4a9f('0x24')](_0x4a9f('0x25'),_0x5b8439,_0x4a9f('0x23'),JSON['stringify'](_0x5eb6c7));if(_0x5eb6c7[_0x4a9f('0x26')]){if(_0x5eb6c7[_0x4a9f('0x26')][_0x4a9f('0x27')]===0x1f4){logger[_0x4a9f('0x26')]('SmsAccount,\x20%s,\x20%s',_0x5b8439,_0x5eb6c7[_0x4a9f('0x26')][_0x4a9f('0x28')]);return _0x589fef(_0x5eb6c7[_0x4a9f('0x26')][_0x4a9f('0x28')]);}logger[_0x4a9f('0x26')]('SmsAccount,\x20%s,\x20%s',_0x5b8439,_0x5eb6c7[_0x4a9f('0x26')][_0x4a9f('0x28')]);return _0x47b30b(_0x5eb6c7['error'][_0x4a9f('0x28')]);}else{logger[_0x4a9f('0x22')]('SmsAccount,\x20%s,\x20%s',_0x5b8439,_0x4a9f('0x23'));_0x47b30b(_0x5eb6c7[_0x4a9f('0x29')][_0x4a9f('0x28')]);}})[_0x4a9f('0x2a')](function(_0x56c6e5){logger[_0x4a9f('0x26')]('SmsAccount,\x20%s,\x20%s',_0x5b8439,_0x56c6e5);_0x589fef(_0x56c6e5);});});}function respondWithStatusCode(_0x5d93ed,_0x5161da){_0x5161da=_0x5161da||0xcc;return function(_0x31aefc){if(_0x31aefc){return _0x5d93ed[_0x4a9f('0x2b')](_0x5161da);}return _0x5d93ed[_0x4a9f('0x2c')](_0x5161da)['end']();};}function respondWithResult(_0x26ec45,_0x83d533){_0x83d533=_0x83d533||0xc8;return function(_0x544d29){if(_0x544d29){return _0x26ec45[_0x4a9f('0x2c')](_0x83d533)[_0x4a9f('0x2d')](_0x544d29);}};}function respondWithFilteredResult(_0x452b7c,_0xfb8f17){return function(_0x745ca4){if(_0x745ca4){var _0x17bf31=typeof _0xfb8f17[_0x4a9f('0x2e')]===_0x4a9f('0x2f')&&typeof _0xfb8f17[_0x4a9f('0x30')]===_0x4a9f('0x2f');var _0x42758d=_0x745ca4['count'];var _0x2f3ef2=_0x17bf31?0x0:_0xfb8f17[_0x4a9f('0x2e')];var _0x5a7340=_0x17bf31?_0x745ca4[_0x4a9f('0x31')]:_0xfb8f17[_0x4a9f('0x2e')]+_0xfb8f17[_0x4a9f('0x30')];var _0x316f1a;if(_0x5a7340>=_0x42758d){_0x5a7340=_0x42758d;_0x316f1a=0xc8;}else{_0x316f1a=0xce;}_0x452b7c[_0x4a9f('0x2c')](_0x316f1a);return _0x452b7c['set'](_0x4a9f('0x32'),_0x2f3ef2+'-'+_0x5a7340+'/'+_0x42758d)['json'](_0x745ca4);}return null;};}function patchUpdates(_0x41ce1a){return function(_0x38af64){try{jsonpatch[_0x4a9f('0x33')](_0x38af64,_0x41ce1a,!![]);}catch(_0x1bc08d){return BPromise[_0x4a9f('0x34')](_0x1bc08d);}return _0x38af64[_0x4a9f('0x35')]();};}function saveUpdates(_0x54a0b9,_0x2fa098){return function(_0x150785){if(_0x150785){return _0x150785[_0x4a9f('0x36')](_0x54a0b9)[_0x4a9f('0x21')](function(_0x5c5a41){return _0x5c5a41;});}return null;};}function removeEntity(_0x13fc61,_0x321821){return function(_0x43da11){if(_0x43da11){return _0x43da11[_0x4a9f('0x37')]()['then'](function(){var _0x5ef080=_0x43da11[_0x4a9f('0x38')]({'plain':!![]});var _0x2b1c12=_0x4a9f('0x39');return db[_0x4a9f('0x3a')][_0x4a9f('0x37')]({'where':{'type':_0x2b1c12,'resourceId':_0x5ef080['id']}})['then'](function(){return _0x43da11;});})[_0x4a9f('0x21')](function(){_0x13fc61['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e46cb,_0x5c545f){return function(_0x377fd8){if(!_0x377fd8){_0x3e46cb[_0x4a9f('0x2b')](0x194);}return _0x377fd8;};}function handleError(_0x26620a,_0x3d5537){_0x3d5537=_0x3d5537||0x1f4;return function(_0x40c670){logger['error'](_0x40c670['stack']);if(_0x40c670[_0x4a9f('0x3b')]){delete _0x40c670['name'];}_0x26620a[_0x4a9f('0x2c')](_0x3d5537)[_0x4a9f('0x3c')](_0x40c670);};}exports[_0x4a9f('0x3d')]=function(_0x459752,_0x40d167){var _0xdd10ed={'include':[{'model':db['Pause'],'as':_0x4a9f('0x3e')}]},_0x11f8c6={},_0x3b979d={'count':0x0,'rows':[]};var _0x2cbc14=_['map'](db[_0x4a9f('0x3f')]['rawAttributes'],function(_0x1efb3e){return{'name':_0x1efb3e[_0x4a9f('0x40')],'type':_0x1efb3e[_0x4a9f('0x41')][_0x4a9f('0x42')]};});_0x11f8c6[_0x4a9f('0x43')]=_[_0x4a9f('0x44')](_0x2cbc14,_0x4a9f('0x3b'));_0x11f8c6[_0x4a9f('0x45')]=_['keys'](_0x459752[_0x4a9f('0x45')]);_0x11f8c6[_0x4a9f('0x46')]=_[_0x4a9f('0x47')](_0x11f8c6['model'],_0x11f8c6['query']);_0xdd10ed[_0x4a9f('0x48')]=_[_0x4a9f('0x47')](_0x11f8c6[_0x4a9f('0x43')],qs[_0x4a9f('0x49')](_0x459752[_0x4a9f('0x45')][_0x4a9f('0x49')]));_0xdd10ed['attributes']=_0xdd10ed[_0x4a9f('0x48')][_0x4a9f('0x4a')]?_0xdd10ed['attributes']:_0x11f8c6['model'];if(!_0x459752[_0x4a9f('0x45')][_0x4a9f('0x4b')](_0x4a9f('0x4c'))){_0xdd10ed[_0x4a9f('0x30')]=qs[_0x4a9f('0x30')](_0x459752[_0x4a9f('0x45')][_0x4a9f('0x30')]);_0xdd10ed['offset']=qs[_0x4a9f('0x2e')](_0x459752['query'][_0x4a9f('0x2e')]);}_0xdd10ed['order']=qs[_0x4a9f('0x4d')](_0x459752['query']['sort']);_0xdd10ed[_0x4a9f('0x4e')]=qs[_0x4a9f('0x46')](_[_0x4a9f('0x4f')](_0x459752[_0x4a9f('0x45')],_0x11f8c6[_0x4a9f('0x46')]),_0x2cbc14);if(_0x459752[_0x4a9f('0x45')]['filter']){_0xdd10ed['where']=_['merge'](_0xdd10ed[_0x4a9f('0x4e')],{'$or':_[_0x4a9f('0x44')](_0x2cbc14,function(_0x342b3d){if(_0x342b3d[_0x4a9f('0x41')]!=='VIRTUAL'){var _0x51ef6e={};_0x51ef6e[_0x342b3d[_0x4a9f('0x3b')]]={'$like':'%'+_0x459752[_0x4a9f('0x45')][_0x4a9f('0x50')]+'%'};return _0x51ef6e;}})});}_0xdd10ed=_[_0x4a9f('0x51')]({},_0xdd10ed,_0x459752[_0x4a9f('0x52')]);var _0x252072={'where':_0xdd10ed[_0x4a9f('0x4e')]};return db['SmsAccount'][_0x4a9f('0x31')](_0x252072)['then'](function(_0xf6a223){_0x3b979d[_0x4a9f('0x31')]=_0xf6a223;if(_0x459752[_0x4a9f('0x45')][_0x4a9f('0x53')]){_0xdd10ed[_0x4a9f('0x54')]=[{'all':!![]}];}return db[_0x4a9f('0x3f')][_0x4a9f('0x55')](_0xdd10ed);})['then'](function(_0x2bf5fa){_0x3b979d[_0x4a9f('0x56')]=_0x2bf5fa;return _0x3b979d;})[_0x4a9f('0x21')](respondWithFilteredResult(_0x40d167,_0xdd10ed))[_0x4a9f('0x2a')](handleError(_0x40d167,null));};exports[_0x4a9f('0x57')]=function(_0x5b264e,_0x5a9847){var _0x22aa03={'raw':![],'where':{'id':_0x5b264e['params']['id']},'include':[{'model':db[_0x4a9f('0x58')],'as':'mandatoryDispositionPause'}]},_0x4462a1={};_0x4462a1[_0x4a9f('0x43')]=_['keys'](db[_0x4a9f('0x3f')][_0x4a9f('0x59')]);_0x4462a1[_0x4a9f('0x45')]=_['keys'](_0x5b264e['query']);_0x4462a1[_0x4a9f('0x46')]=_[_0x4a9f('0x47')](_0x4462a1[_0x4a9f('0x43')],_0x4462a1['query']);_0x22aa03[_0x4a9f('0x48')]=_[_0x4a9f('0x47')](_0x4462a1[_0x4a9f('0x43')],qs['fields'](_0x5b264e[_0x4a9f('0x45')][_0x4a9f('0x49')]));_0x22aa03['attributes']=_0x22aa03[_0x4a9f('0x48')][_0x4a9f('0x4a')]?_0x22aa03[_0x4a9f('0x48')]:_0x4462a1[_0x4a9f('0x43')];if(_0x5b264e[_0x4a9f('0x45')][_0x4a9f('0x53')]){_0x22aa03[_0x4a9f('0x54')]=[{'all':!![]}];}_0x22aa03=_[_0x4a9f('0x51')]({},_0x22aa03,_0x5b264e[_0x4a9f('0x52')]);return db[_0x4a9f('0x3f')]['find'](_0x22aa03)[_0x4a9f('0x21')](handleEntityNotFound(_0x5a9847,null))['then'](respondWithResult(_0x5a9847,null))[_0x4a9f('0x2a')](handleError(_0x5a9847,null));};exports[_0x4a9f('0x5a')]=function(_0x4bdb4b,_0x906e68){return db[_0x4a9f('0x3f')][_0x4a9f('0x5a')](_0x4bdb4b[_0x4a9f('0x5b')],{})[_0x4a9f('0x21')](function(_0x5a397e){var _0x2a43fb=_0x4bdb4b['user'][_0x4a9f('0x38')]({'plain':!![]});if(!_0x2a43fb)throw new Error(_0x4a9f('0x5c'));if(_0x2a43fb['role']===_0x4a9f('0x5d')){var _0x518414=_0x5a397e['get']({'plain':!![]});var _0x29a691=_0x4a9f('0x39');return db[_0x4a9f('0x5e')][_0x4a9f('0x5f')]({'where':{'name':_0x29a691,'userProfileId':_0x2a43fb['userProfileId']},'raw':!![]})[_0x4a9f('0x21')](function(_0x4a892c){if(_0x4a892c&&_0x4a892c['autoAssociation']===0x0){return db[_0x4a9f('0x3a')]['create']({'name':_0x518414['name'],'resourceId':_0x518414['id'],'type':_0x4a892c[_0x4a9f('0x3b')],'sectionId':_0x4a892c['id']},{})[_0x4a9f('0x21')](function(){return _0x5a397e;});}else{return _0x5a397e;}})[_0x4a9f('0x2a')](function(_0xeaad91){logger[_0x4a9f('0x26')](_0x4a9f('0x60'),_0xeaad91);throw _0xeaad91;});}return _0x5a397e;})[_0x4a9f('0x21')](respondWithResult(_0x906e68,0xc9))[_0x4a9f('0x2a')](handleError(_0x906e68,null));};exports[_0x4a9f('0x36')]=function(_0x584fe6,_0x5e9d73){if(_0x584fe6['body']['id']){delete _0x584fe6[_0x4a9f('0x5b')]['id'];}return db[_0x4a9f('0x3f')][_0x4a9f('0x5f')]({'where':{'id':_0x584fe6[_0x4a9f('0x61')]['id']},'include':[{'model':db[_0x4a9f('0x58')],'as':_0x4a9f('0x3e')}]})[_0x4a9f('0x21')](handleEntityNotFound(_0x5e9d73,null))['then'](saveUpdates(_0x584fe6[_0x4a9f('0x5b')],null))[_0x4a9f('0x21')](respondWithResult(_0x5e9d73,null))['catch'](handleError(_0x5e9d73,null));};exports[_0x4a9f('0x37')]=function(_0x37b12c,_0x390832){return db[_0x4a9f('0x3f')]['find']({'where':{'id':_0x37b12c[_0x4a9f('0x61')]['id']}})['then'](handleEntityNotFound(_0x390832,null))[_0x4a9f('0x21')](removeEntity(_0x390832,null))[_0x4a9f('0x2a')](handleError(_0x390832,null));};exports[_0x4a9f('0x62')]=function(_0x2074ec,_0x3597c0){return db['SmsAccount'][_0x4a9f('0x62')]()[_0x4a9f('0x21')](respondWithResult(_0x3597c0,null))[_0x4a9f('0x2a')](handleError(_0x3597c0,null));};exports[_0x4a9f('0x63')]=function(_0x111acb,_0x50f736,_0x5d2551){if(_0x111acb[_0x4a9f('0x5b')]['id']){delete _0x111acb[_0x4a9f('0x5b')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x111acb[_0x4a9f('0x61')]['id']}})['then'](handleEntityNotFound(_0x50f736,null))[_0x4a9f('0x21')](function(_0x4611b7){if(_0x4611b7){_0x111acb[_0x4a9f('0x5b')][_0x4a9f('0x64')]=_0x4611b7['id'];return db['Disposition']['create'](_0x111acb['body']);}})['then'](respondWithResult(_0x50f736,null))['catch'](handleError(_0x50f736,null));};exports['getDispositions']=function(_0x527273,_0x891e19,_0x82392d){var _0x5e9805={'raw':![],'where':{}};var _0x5eaa88={};var _0xd80439={'count':0x0,'rows':[]};return db[_0x4a9f('0x3f')][_0x4a9f('0x65')]({'where':{'id':_0x527273['params']['id']}})['then'](handleEntityNotFound(_0x891e19,null))[_0x4a9f('0x21')](function(_0x2c8037){if(_0x2c8037){_0x5eaa88[_0x4a9f('0x43')]=_['keys'](db[_0x4a9f('0x66')][_0x4a9f('0x59')]);_0x5eaa88[_0x4a9f('0x45')]=_[_0x4a9f('0x67')](_0x527273[_0x4a9f('0x45')]);_0x5eaa88['filters']=_[_0x4a9f('0x47')](_0x5eaa88['model'],_0x5eaa88[_0x4a9f('0x45')]);_0x5e9805[_0x4a9f('0x48')]=_[_0x4a9f('0x47')](_0x5eaa88['model'],qs[_0x4a9f('0x49')](_0x527273[_0x4a9f('0x45')]['fields']));_0x5e9805['attributes']=_0x5e9805[_0x4a9f('0x48')][_0x4a9f('0x4a')]?_0x5e9805[_0x4a9f('0x48')]:_0x5eaa88['model'];if(!_0x527273[_0x4a9f('0x45')][_0x4a9f('0x4b')]('nolimit')){_0x5e9805['limit']=qs[_0x4a9f('0x30')](_0x527273[_0x4a9f('0x45')][_0x4a9f('0x30')]);_0x5e9805[_0x4a9f('0x2e')]=qs['offset'](_0x527273[_0x4a9f('0x45')][_0x4a9f('0x2e')]);}_0x5e9805[_0x4a9f('0x68')]=qs[_0x4a9f('0x4d')](_0x527273[_0x4a9f('0x45')]['sort']);_0x5e9805[_0x4a9f('0x4e')]=qs[_0x4a9f('0x46')](_[_0x4a9f('0x4f')](_0x527273['query'],_0x5eaa88[_0x4a9f('0x46')]));_0x5e9805[_0x4a9f('0x4e')][_0x4a9f('0x64')]=_0x2c8037['id'];if(_0x527273[_0x4a9f('0x45')][_0x4a9f('0x50')]){_0x5e9805[_0x4a9f('0x4e')]=_[_0x4a9f('0x51')](_0x5e9805[_0x4a9f('0x4e')],{'$or':_['map'](_0x5e9805[_0x4a9f('0x48')],function(_0x33b58b){var _0xe47192={};_0xe47192[_0x33b58b]={'$like':'%'+_0x527273[_0x4a9f('0x45')]['filter']+'%'};return _0xe47192;})});}_0x5e9805=_[_0x4a9f('0x51')]({},_0x5e9805,_0x527273['options']);return db[_0x4a9f('0x66')]['count']({'where':_0x5e9805[_0x4a9f('0x4e')]})[_0x4a9f('0x21')](function(_0x44f15a){_0xd80439[_0x4a9f('0x31')]=_0x44f15a;if(_0x527273['query'][_0x4a9f('0x53')]){_0x5e9805['include']=[{'all':!![]}];}return db['Disposition'][_0x4a9f('0x55')](_0x5e9805);})[_0x4a9f('0x21')](function(_0x103523){_0xd80439['rows']=_0x103523;return _0xd80439;});}})[_0x4a9f('0x21')](respondWithFilteredResult(_0x891e19,_0x5e9805))[_0x4a9f('0x2a')](handleError(_0x891e19,null));};exports['removeDispositions']=function(_0x531e2b,_0x3f99dc,_0x415046){return db[_0x4a9f('0x3f')][_0x4a9f('0x5f')]({'where':{'id':_0x531e2b[_0x4a9f('0x61')]['id']}})[_0x4a9f('0x21')](handleEntityNotFound(_0x3f99dc,null))[_0x4a9f('0x21')](function(_0x42338a){if(_0x42338a){return _0x42338a[_0x4a9f('0x69')](_0x531e2b['query'][_0x4a9f('0x6a')]);}})['then'](respondWithStatusCode(_0x3f99dc,null))['catch'](handleError(_0x3f99dc,null));};exports[_0x4a9f('0x6b')]=function(_0x3acc9f,_0x3b468c,_0x4eb6f3){if(_0x3acc9f['body']['id']){delete _0x3acc9f[_0x4a9f('0x5b')]['id'];}return db[_0x4a9f('0x3f')][_0x4a9f('0x5f')]({'where':{'id':_0x3acc9f[_0x4a9f('0x61')]['id']}})[_0x4a9f('0x21')](handleEntityNotFound(_0x3b468c,null))[_0x4a9f('0x21')](function(_0x1d717e){if(_0x1d717e){_0x3acc9f[_0x4a9f('0x5b')][_0x4a9f('0x64')]=_0x1d717e['id'];return db[_0x4a9f('0x6c')][_0x4a9f('0x5a')](_0x3acc9f['body']);}})['then'](respondWithResult(_0x3b468c,null))[_0x4a9f('0x2a')](handleError(_0x3b468c,null));};exports[_0x4a9f('0x6d')]=function(_0x1b354e,_0x1f472e,_0x5a1667){var _0x2361c3={'raw':![],'where':{}};var _0x373af1={};var _0x106cc3={'count':0x0,'rows':[]};return db[_0x4a9f('0x3f')][_0x4a9f('0x65')]({'where':{'id':_0x1b354e[_0x4a9f('0x61')]['id']}})['then'](handleEntityNotFound(_0x1f472e,null))[_0x4a9f('0x21')](function(_0x13fc1d){if(_0x13fc1d){_0x373af1[_0x4a9f('0x43')]=_['keys'](db[_0x4a9f('0x6c')][_0x4a9f('0x59')]);_0x373af1['query']=_[_0x4a9f('0x67')](_0x1b354e['query']);_0x373af1[_0x4a9f('0x46')]=_['intersection'](_0x373af1[_0x4a9f('0x43')],_0x373af1[_0x4a9f('0x45')]);_0x2361c3[_0x4a9f('0x48')]=_[_0x4a9f('0x47')](_0x373af1[_0x4a9f('0x43')],qs[_0x4a9f('0x49')](_0x1b354e[_0x4a9f('0x45')][_0x4a9f('0x49')]));_0x2361c3['attributes']=_0x2361c3[_0x4a9f('0x48')][_0x4a9f('0x4a')]?_0x2361c3[_0x4a9f('0x48')]:_0x373af1[_0x4a9f('0x43')];if(!_0x1b354e[_0x4a9f('0x45')][_0x4a9f('0x4b')](_0x4a9f('0x4c'))){_0x2361c3['limit']=qs[_0x4a9f('0x30')](_0x1b354e[_0x4a9f('0x45')][_0x4a9f('0x30')]);_0x2361c3[_0x4a9f('0x2e')]=qs[_0x4a9f('0x2e')](_0x1b354e[_0x4a9f('0x45')]['offset']);}_0x2361c3['order']=qs['sort'](_0x1b354e[_0x4a9f('0x45')][_0x4a9f('0x4d')]);_0x2361c3[_0x4a9f('0x4e')]=qs[_0x4a9f('0x46')](_[_0x4a9f('0x4f')](_0x1b354e['query'],_0x373af1[_0x4a9f('0x46')]));_0x2361c3[_0x4a9f('0x4e')]['SmsAccountId']=_0x13fc1d['id'];if(_0x1b354e[_0x4a9f('0x45')][_0x4a9f('0x50')]){_0x2361c3[_0x4a9f('0x4e')]=_[_0x4a9f('0x51')](_0x2361c3['where'],{'$or':_[_0x4a9f('0x44')](_0x2361c3[_0x4a9f('0x48')],function(_0x51edf4){var _0x241e8d={};_0x241e8d[_0x51edf4]={'$like':'%'+_0x1b354e[_0x4a9f('0x45')][_0x4a9f('0x50')]+'%'};return _0x241e8d;})});}_0x2361c3=_[_0x4a9f('0x51')]({},_0x2361c3,_0x1b354e['options']);return db['CannedAnswer'][_0x4a9f('0x31')]({'where':_0x2361c3[_0x4a9f('0x4e')]})[_0x4a9f('0x21')](function(_0xc1f4eb){_0x106cc3[_0x4a9f('0x31')]=_0xc1f4eb;if(_0x1b354e[_0x4a9f('0x45')][_0x4a9f('0x53')]){_0x2361c3['include']=[{'all':!![]}];}return db[_0x4a9f('0x6c')][_0x4a9f('0x55')](_0x2361c3);})[_0x4a9f('0x21')](function(_0x4388cd){_0x106cc3[_0x4a9f('0x56')]=_0x4388cd;return _0x106cc3;});}})['then'](respondWithFilteredResult(_0x1f472e,_0x2361c3))[_0x4a9f('0x2a')](handleError(_0x1f472e,null));};exports[_0x4a9f('0x6e')]=function(_0x3281a0,_0x53bbea,_0x2c4ac6){return db[_0x4a9f('0x3f')]['find']({'where':{'id':_0x3281a0[_0x4a9f('0x61')]['id']}})[_0x4a9f('0x21')](handleEntityNotFound(_0x53bbea,null))[_0x4a9f('0x21')](function(_0x4824df){if(_0x4824df){return _0x4824df[_0x4a9f('0x6e')](_0x3281a0[_0x4a9f('0x45')][_0x4a9f('0x6a')]);}})[_0x4a9f('0x21')](respondWithStatusCode(_0x53bbea,null))[_0x4a9f('0x2a')](handleError(_0x53bbea,null));};exports[_0x4a9f('0x6f')]=function(_0x4cd907,_0x2f0f50,_0xf8065b){var _0x167f6a={'channel':'sms'};var _0x4f79a5=[];var _0x2df16e=[];var _0x1d26b4={};return db[_0x4a9f('0x3f')][_0x4a9f('0x5f')]({'where':{'id':_0x4cd907['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0x4a9f('0x70')}]})[_0x4a9f('0x21')](handleEntityNotFound(_0x2f0f50,null))[_0x4a9f('0x21')](function(_0x1362f8){_0x167f6a['account']=_0x1362f8;_0x167f6a[_0x4a9f('0x71')]=_['orderBy'](_0x1362f8[_0x4a9f('0x70')],[_0x4a9f('0x72')],[_0x4a9f('0x73')]);if(_0x167f6a[_0x4a9f('0x74')][_0x4a9f('0x70')]){delete _0x167f6a[_0x4a9f('0x74')][_0x4a9f('0x70')];}return db[_0x4a9f('0x75')][_0x4a9f('0x62')]();})[_0x4a9f('0x21')](function(_0x19f3ba){if(!_0x19f3ba){throw new db[(_0x4a9f('0x76'))][(_0x4a9f('0x77'))](_0x4a9f('0x78'));}_0x4f79a5=_[_0x4a9f('0x79')](_[_0x4a9f('0x67')](_0x19f3ba),['createdAt',_0x4a9f('0x7a')]);_0x2df16e=_[_0x4a9f('0x79')](_['keys'](_0x19f3ba),[_0x4a9f('0x7b'),_0x4a9f('0x7a'),'CompanyId',_0x4a9f('0x7c')]);_0x167f6a[_0x4a9f('0x5b')]={'mapKey':_0x4a9f('0x7d')};if(_0x167f6a[_0x4a9f('0x74')][_0x4a9f('0x41')]){switch(_0x167f6a[_0x4a9f('0x74')][_0x4a9f('0x41')]){case'twilio':_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x7e')]=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x7f')];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x5b')]=_0x4cd907[_0x4a9f('0x5b')]['Body'];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x80')]=_0x4cd907['body'][_0x4a9f('0x81')];break;case'skebby':_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x7e')]='+'+_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x82')];_0x167f6a['body'][_0x4a9f('0x5b')]=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x83')];break;case _0x4a9f('0x84'):_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x7e')]=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x7e')];_0x167f6a[_0x4a9f('0x5b')]['body']=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x28')];break;case _0x4a9f('0x85'):_0x167f6a[_0x4a9f('0x5b')]['from']=_0x4cd907['body']['from'];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x5b')]=_0x4cd907['body']['body'];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x80')]=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x86')];break;case'plivo':_0x167f6a[_0x4a9f('0x5b')]['from']=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x7f')];_0x167f6a[_0x4a9f('0x5b')]['body']=_0x4cd907[_0x4a9f('0x5b')]['Text'];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x80')]=_0x4cd907['body'][_0x4a9f('0x87')];break;case'infobip':_0x167f6a['body'][_0x4a9f('0x7e')]='+'+_0x4cd907[_0x4a9f('0x5b')]['results'][0x0][_0x4a9f('0x7e')];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x5b')]=_0x4cd907['body']['results'][0x0][_0x4a9f('0x83')];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x80')]=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x88')][0x0][_0x4a9f('0x80')];break;case _0x4a9f('0x89'):_0x167f6a['body'][_0x4a9f('0x7e')]=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x8a')];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x5b')]=_0x4cd907[_0x4a9f('0x5b')]['segmentedMessage'][_0x4a9f('0x28')];break;case _0x4a9f('0x8b'):_0x167f6a['body'][_0x4a9f('0x7e')]=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x8c')];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x5b')]=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x83')];_0x167f6a['body']['messageId']=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x8d')];break;case'bandwidth':_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x80')]=_0x4cd907[_0x4a9f('0x5b')][0x0][_0x4a9f('0x28')]['id'];_0x167f6a[_0x4a9f('0x5b')]['from']=_0x4cd907[_0x4a9f('0x5b')][0x0][_0x4a9f('0x28')][_0x4a9f('0x7e')];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x5b')]=_0x4cd907[_0x4a9f('0x5b')][0x0][_0x4a9f('0x28')]['text'];break;case _0x4a9f('0x8e'):_0x167f6a[_0x4a9f('0x5b')]['from']=_0x4cd907[_0x4a9f('0x5b')][_0x4a9f('0x7e')];_0x167f6a[_0x4a9f('0x5b')]['body']=_0x4cd907['body'][_0x4a9f('0x28')];_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x80')]=_0x4cd907[_0x4a9f('0x5b')]['refid'];break;}}if(_0x167f6a[_0x4a9f('0x5b')]['id']){delete _0x167f6a[_0x4a9f('0x5b')]['id'];}if(_[_0x4a9f('0x8f')](_0x167f6a['body'][_0x4a9f('0x7e')])){throw new db[(_0x4a9f('0x76'))][(_0x4a9f('0x77'))](_0x4a9f('0x90'));}if(_['isNil'](_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x5b')])||_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x5b')]===''){throw new db[(_0x4a9f('0x76'))]['ValidationError'](_0x4a9f('0x91'));}if(_[_0x4a9f('0x8f')](_0x167f6a[_0x4a9f('0x5b')]['mapKey'])){throw new db[(_0x4a9f('0x76'))][(_0x4a9f('0x77'))](_0x4a9f('0x92')+_0x2df16e);}if(!_['includes'](_0x2df16e,_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x93')])){throw new db[(_0x4a9f('0x76'))][(_0x4a9f('0x77'))](_0x4a9f('0x94')+_0x2df16e);}_0x1d26b4[_0x167f6a['body'][_0x4a9f('0x93')]]=_0x167f6a[_0x4a9f('0x5b')]['from'];return db[_0x4a9f('0x95')][_0x4a9f('0x5f')]({'where':{'id':_0x167f6a['account']['ListId']},'include':[{'model':db['CmContact'],'as':_0x4a9f('0x96'),'where':_0x1d26b4,'limit':0x1,'order':[[_0x4a9f('0x7a'),'DESC']]}]});})[_0x4a9f('0x21')](handleEntityNotFound(_0x2f0f50,null))['then'](function(_0x561ec7){if(_0x561ec7){_0x167f6a[_0x4a9f('0x97')]=_[_0x4a9f('0x98')](_0x561ec7,[_0x4a9f('0x96')]);if(_0x561ec7[_0x4a9f('0x96')][_0x4a9f('0x4a')]){return _0x561ec7['Contacts'][0x0];}var _0x227792=_[_0x4a9f('0x19')](_0x167f6a[_0x4a9f('0x5b')],{'firstName':_0x167f6a['body'][_0x4a9f('0x7e')],'ListId':_0x561ec7['id']});_0x227792[_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x93')]]=_0x167f6a['body'][_0x4a9f('0x7e')];return db[_0x4a9f('0x75')][_0x4a9f('0x5a')](_0x227792,{'fields':_0x4f79a5,'raw':!![]});}})[_0x4a9f('0x21')](handleEntityNotFound(_0x2f0f50,null))[_0x4a9f('0x21')](function(_0x5a1a38){if(_0x5a1a38){_0x167f6a['contact']=_0x5a1a38;var _0x3a866a={'ContactId':_0x5a1a38['id'],'phone':_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x7e')],'SmsAccountId':_0x4cd907[_0x4a9f('0x61')]['id']};var _0x519ad0={'ContactId':_0x5a1a38['id'],'SmsAccountId':_0x4cd907[_0x4a9f('0x61')]['id'],'closed':![]};return db[_0x4a9f('0x99')][_0x4a9f('0x5f')]({'where':_0x519ad0})[_0x4a9f('0x21')](function(_0x3a985e){if(_0x3a985e){return[_0x3a985e,![]];}return db[_0x4a9f('0x99')][_0x4a9f('0x5a')](_0x3a866a)[_0x4a9f('0x21')](function(_0x108b36){return[_0x108b36,!![]];});});}})[_0x4a9f('0x9a')](function(_0x53b396,_0x251c98){_0x167f6a[_0x4a9f('0x9b')]=_0x53b396[_0x4a9f('0x38')]({'plain':!![]});_0x167f6a[_0x4a9f('0x9b')][_0x4a9f('0x9c')]=![];if(_0x251c98){if(_0x167f6a[_0x4a9f('0x74')][_0x4a9f('0x9d')]){_0x167f6a[_0x4a9f('0x71')][_0x4a9f('0x9e')]({'id':0x0,'priority':_0x167f6a[_0x4a9f('0x71')][_0x4a9f('0x4a')]+0x1,'app':_0x4a9f('0x9f'),'appdata':_0x4a9f('0xa0'),'interval':_0x4a9f('0xa1')});}_0x167f6a[_0x4a9f('0x9b')][_0x4a9f('0x9c')]=!![];}return db[_0x4a9f('0xa2')]['create']({'phone':_0x167f6a['body'][_0x4a9f('0x7e')],'messageId':_0x167f6a[_0x4a9f('0x5b')]['messageId'],'body':_0x167f6a[_0x4a9f('0x5b')][_0x4a9f('0x5b')],'SmsAccountId':_0x4cd907['params']['id'],'SmsInteractionId':_0x53b396['id'],'direction':'in','ContactId':_0x53b396[_0x4a9f('0xa3')],'AttachmentId':_0x167f6a['body'][_0x4a9f('0xa4')]});})['then'](function(_0x19a4a8){_0x167f6a[_0x4a9f('0x28')]=_0x19a4a8;if(_0x167f6a[_0x4a9f('0x9b')][_0x4a9f('0xa5')]){return db[_0x4a9f('0xa6')][_0x4a9f('0x5f')]({'attributes':['id','name'],'where':{'id':_0x167f6a[_0x4a9f('0x9b')]['UserId']}})['then'](function(_0x4c7413){if(_0x4c7413){_0x167f6a[_0x4a9f('0x71')][_0x4a9f('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4c7413['name']+','+(_0x167f6a[_0x4a9f('0x74')][_0x4a9f('0xa8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4a9f('0xa9'),_0x4a9f('0xaa'),_0x167f6a);});}return respondWithRpcPromise('Start',_0x4a9f('0xaa'),_0x167f6a);})['then'](function(_0x4c7670){if(_0x4c7670){var _0x2d1e3f=0xc8;var _0x514c67=_0x4a9f('0xab');logger[_0x4a9f('0x22')](_0x4a9f('0x25'),_0x514c67,_0x2d1e3f,_0x4a9f('0xac'));logger[_0x4a9f('0x24')](_0x4a9f('0xad'),_0x514c67,_0x2d1e3f,'entity\x20found',JSON[_0x4a9f('0xae')](_0x4c7670));if(_0x167f6a[_0x4a9f('0x74')][_0x4a9f('0x41')]===_0x4a9f('0xaf')){return _0x2f0f50[_0x4a9f('0x2c')](_0x2d1e3f)[_0x4a9f('0xb0')]('Content-Type',_0x4a9f('0xb1'))[_0x4a9f('0x3c')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x2f0f50[_0x4a9f('0x2c')](_0x2d1e3f)[_0x4a9f('0x2d')](_0x4c7670);}}})[_0x4a9f('0x2a')](handleError(_0x2f0f50,null));};exports[_0x4a9f('0xb2')]=function(_0x546314,_0x53a039){var _0x587a17=_0x546314[_0x4a9f('0x61')]['id'];var _0x28c7a3=_0x546314['body'];var _0x2d33f0=0xc8;var _0x5e2364=null;return db[_0x4a9f('0xb3')]['transaction']({'isolationLevel':db[_0x4a9f('0xb3')][_0x4a9f('0xb4')][_0x4a9f('0xb5')]['READ_COMMITTED']},function(_0x48db7c){return db[_0x4a9f('0x3f')][_0x4a9f('0x65')]({'where':{'id':_0x587a17},'transaction':_0x48db7c})[_0x4a9f('0x21')](function(_0x41bf3e){if(_0x41bf3e){return db[_0x4a9f('0xb6')][_0x4a9f('0x37')]({'where':{'SmsAccountId':_0x587a17},'transaction':_0x48db7c})[_0x4a9f('0x21')](function(){var _0x2e3634=_['map'](_0x28c7a3,function(_0x49fb67){_0x49fb67[_0x4a9f('0x64')]=_0x587a17;return _0x49fb67;});return db['SmsApplication'][_0x4a9f('0xb7')](_0x2e3634,{'transaction':_0x48db7c});});}else{_0x2d33f0=0x194;_0x5e2364=[];}});})['then'](function(){if(_0x2d33f0!==0x194){return db[_0x4a9f('0xb6')][_0x4a9f('0xb8')]({'where':{'SmsAccountId':_0x587a17},'order':_0x4a9f('0x72')})[_0x4a9f('0x21')](function(_0x77c1b6){_0x5e2364=_0x77c1b6;});}})[_0x4a9f('0x2a')](function(_0xb1a11a){_0x2d33f0=0x1f4;logger[_0x4a9f('0x26')](_0xb1a11a[_0x4a9f('0xb9')]);if(_0xb1a11a[_0x4a9f('0x3b')]){delete _0xb1a11a[_0x4a9f('0x3b')];}_0x5e2364=_0xb1a11a;})[_0x4a9f('0xba')](function(){if(_0x5e2364===null){_0x53a039[_0x4a9f('0x2b')](_0x2d33f0);}else{if(_0x2d33f0===0x1f4){_0x53a039['status'](_0x2d33f0)[_0x4a9f('0x3c')](_0x5e2364);}else{_0x53a039[_0x4a9f('0x2c')](_0x2d33f0)[_0x4a9f('0x2d')](_0x5e2364);}}});};exports[_0x4a9f('0xbb')]=function(_0xcb6708,_0x597256,_0x36bfe3){var _0x14953b={};var _0x20d18f={};var _0x29d001;var _0x1d29b5;return db[_0x4a9f('0x3f')]['findOne']({'where':{'id':_0xcb6708[_0x4a9f('0x61')]['id']}})[_0x4a9f('0x21')](handleEntityNotFound(_0x597256,null))['then'](function(_0x3076b5){if(_0x3076b5){_0x29d001=_0x3076b5;_0x20d18f[_0x4a9f('0x43')]=_['keys'](db['SmsApplication'][_0x4a9f('0x59')]);_0x20d18f['query']=_[_0x4a9f('0x67')](_0xcb6708[_0x4a9f('0x45')]);_0x20d18f[_0x4a9f('0x46')]=_['intersection'](_0x20d18f[_0x4a9f('0x43')],_0x20d18f[_0x4a9f('0x45')]);_0x14953b['attributes']=_[_0x4a9f('0x47')](_0x20d18f[_0x4a9f('0x43')],qs[_0x4a9f('0x49')](_0xcb6708[_0x4a9f('0x45')][_0x4a9f('0x49')]));_0x14953b['attributes']=_0x14953b['attributes'][_0x4a9f('0x4a')]?_0x14953b[_0x4a9f('0x48')]:_0x20d18f[_0x4a9f('0x43')];_0x14953b[_0x4a9f('0x68')]=qs[_0x4a9f('0x4d')](_0xcb6708[_0x4a9f('0x45')][_0x4a9f('0x4d')]);_0x14953b[_0x4a9f('0x4e')]=qs[_0x4a9f('0x46')](_[_0x4a9f('0x4f')](_0xcb6708['query'],_0x20d18f[_0x4a9f('0x46')]));if(_0xcb6708['query'][_0x4a9f('0x50')]){_0x14953b[_0x4a9f('0x4e')]=_[_0x4a9f('0x51')](_0x14953b['where'],{'$or':_[_0x4a9f('0x44')](_0x14953b[_0x4a9f('0x48')],function(_0x1e70e6){var _0x45007b={};_0x45007b[_0x1e70e6]={'$like':'%'+_0xcb6708[_0x4a9f('0x45')][_0x4a9f('0x50')]+'%'};return _0x45007b;})});}_0x14953b=_[_0x4a9f('0x51')]({},_0x14953b,_0xcb6708[_0x4a9f('0x52')]);return _0x29d001[_0x4a9f('0xbb')](_0x14953b);}})['then'](function(_0x3f4f95){if(_0x3f4f95){_0x1d29b5=_0x3f4f95[_0x4a9f('0x4a')];if(!_0xcb6708[_0x4a9f('0x45')][_0x4a9f('0x4b')](_0x4a9f('0x4c'))){_0x14953b['limit']=qs[_0x4a9f('0x30')](_0xcb6708['query'][_0x4a9f('0x30')]);_0x14953b[_0x4a9f('0x2e')]=qs[_0x4a9f('0x2e')](_0xcb6708['query'][_0x4a9f('0x2e')]);}return _0x29d001[_0x4a9f('0xbb')](_0x14953b);}})[_0x4a9f('0x21')](function(_0x287d6b){if(_0x287d6b){return _0x287d6b?{'count':_0x1d29b5,'rows':_0x287d6b}:null;}})[_0x4a9f('0x21')](respondWithResult(_0x597256,null))[_0x4a9f('0x2a')](handleError(_0x597256,null));};exports[_0x4a9f('0xbc')]=function(_0x18b1ac,_0x26cc1f,_0x348d79){var _0xbf63db={'raw':![],'where':{}};var _0x37601b={};var _0x5bad24={'count':0x0,'rows':[]};return db[_0x4a9f('0x3f')]['findOne']({'where':{'id':_0x18b1ac[_0x4a9f('0x61')]['id']}})['then'](handleEntityNotFound(_0x26cc1f,null))['then'](function(_0xfa47f3){if(_0xfa47f3){_0x37601b[_0x4a9f('0x43')]=_[_0x4a9f('0x67')](db[_0x4a9f('0x99')]['rawAttributes']);_0x37601b[_0x4a9f('0x45')]=_[_0x4a9f('0x67')](_0x18b1ac[_0x4a9f('0x45')]);_0x37601b[_0x4a9f('0x46')]=_[_0x4a9f('0x47')](_0x37601b[_0x4a9f('0x43')],_0x37601b[_0x4a9f('0x45')]);_0xbf63db[_0x4a9f('0x48')]=_[_0x4a9f('0x47')](_0x37601b[_0x4a9f('0x43')],qs['fields'](_0x18b1ac[_0x4a9f('0x45')][_0x4a9f('0x49')]));_0xbf63db[_0x4a9f('0x48')]=_0xbf63db[_0x4a9f('0x48')][_0x4a9f('0x4a')]?_0xbf63db[_0x4a9f('0x48')]:_0x37601b[_0x4a9f('0x43')];if(!_0x18b1ac[_0x4a9f('0x45')][_0x4a9f('0x4b')](_0x4a9f('0x4c'))){_0xbf63db['limit']=qs[_0x4a9f('0x30')](_0x18b1ac['query'][_0x4a9f('0x30')]);_0xbf63db[_0x4a9f('0x2e')]=qs[_0x4a9f('0x2e')](_0x18b1ac[_0x4a9f('0x45')][_0x4a9f('0x2e')]);}_0xbf63db[_0x4a9f('0x68')]=qs[_0x4a9f('0x4d')](_0x18b1ac[_0x4a9f('0x45')][_0x4a9f('0x4d')]);_0xbf63db['where']=qs[_0x4a9f('0x46')](_[_0x4a9f('0x4f')](_0x18b1ac[_0x4a9f('0x45')],_0x37601b[_0x4a9f('0x46')]));_0xbf63db[_0x4a9f('0x4e')][_0x4a9f('0x64')]=_0xfa47f3['id'];if(_0x18b1ac[_0x4a9f('0x45')][_0x4a9f('0x50')]){_0xbf63db[_0x4a9f('0x4e')]=_['merge'](_0xbf63db[_0x4a9f('0x4e')],{'$or':_[_0x4a9f('0x44')](_0xbf63db['attributes'],function(_0xc124b1){var _0xc3df55={};_0xc3df55[_0xc124b1]={'$like':'%'+_0x18b1ac['query'][_0x4a9f('0x50')]+'%'};return _0xc3df55;})});}_0xbf63db=_[_0x4a9f('0x51')]({},_0xbf63db,_0x18b1ac[_0x4a9f('0x52')]);return db[_0x4a9f('0x99')][_0x4a9f('0x31')]({'where':_0xbf63db[_0x4a9f('0x4e')]})[_0x4a9f('0x21')](function(_0x105596){_0x5bad24['count']=_0x105596;if(_0x18b1ac[_0x4a9f('0x45')][_0x4a9f('0x53')]){_0xbf63db[_0x4a9f('0x54')]=[{'model':db[_0x4a9f('0x75')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x4a9f('0xbd'),'attributes':[_0x4a9f('0x3b'),_0x4a9f('0xbe'),_0x4a9f('0xbf')],'required':![]},{'model':db[_0x4a9f('0xc0')],'as':_0x4a9f('0xc1'),'attributes':['id','name',_0x4a9f('0xc2')],'where':_0x18b1ac[_0x4a9f('0x45')][_0x4a9f('0xc3')]?{'id':_0x18b1ac[_0x4a9f('0x45')][_0x4a9f('0xc3')]}:undefined,'required':_0x18b1ac[_0x4a9f('0x45')][_0x4a9f('0xc3')]?!![]:![]}];}return db[_0x4a9f('0x99')][_0x4a9f('0x55')](_0xbf63db);})[_0x4a9f('0x21')](function(_0x2f8f5f){_0x5bad24['rows']=_0x2f8f5f;return _0x5bad24;});}})[_0x4a9f('0x21')](respondWithFilteredResult(_0x26cc1f,_0xbf63db))[_0x4a9f('0x2a')](handleError(_0x26cc1f,null));};exports[_0x4a9f('0x3c')]=function(_0x3282bf,_0x2e2472,_0x28975a){var _0x14fd2d,_0x11d458,_0x401eb0;if(_[_0x4a9f('0x8f')](_0x3282bf['body'][_0x4a9f('0x5b')])||_0x3282bf[_0x4a9f('0x5b')][_0x4a9f('0x5b')]===''){throw new db[(_0x4a9f('0x76'))][(_0x4a9f('0x77'))](_0x4a9f('0x91'));}if(_['isNil'](_0x3282bf[_0x4a9f('0x5b')]['to'])){throw new db[(_0x4a9f('0x76'))][(_0x4a9f('0x77'))](_0x4a9f('0xc4'));}_0x14fd2d=_0x3282bf[_0x4a9f('0x5b')]['to'];return db['SmsAccount'][_0x4a9f('0x5f')]({'where':{'id':_0x3282bf['params']['id']},'include':[{'model':db[_0x4a9f('0x95')],'as':_0x4a9f('0xc5'),'include':[{'model':db[_0x4a9f('0x75')],'as':_0x4a9f('0x96'),'where':{'mobile':_0x14fd2d},'limit':0x1,'order':[['updatedAt',_0x4a9f('0xc6')]]}]}]})[_0x4a9f('0x21')](handleEntityNotFound(_0x2e2472,null))[_0x4a9f('0x21')](function(_0x3daf37){if(_0x3daf37&&_0x3daf37[_0x4a9f('0xc5')]){_0x11d458=_0x3daf37[_0x4a9f('0x38')]({'plain':!![]});if(_0x11d458[_0x4a9f('0xc5')]&&_0x11d458['List'][_0x4a9f('0x96')][_0x4a9f('0x4a')]){return _0x11d458['List']['Contacts'][0x0];}return db['CmContact']['create'](_[_0x4a9f('0x19')](_0x3282bf[_0x4a9f('0x5b')],{'firstName':_0x14fd2d,'mobile':_0x14fd2d,'phone':_0x14fd2d,'ListId':_0x11d458[_0x4a9f('0x7c')]}));}})[_0x4a9f('0x21')](handleEntityNotFound(_0x2e2472,null))[_0x4a9f('0x21')](function(_0x264de0){if(_0x264de0){_0x401eb0=_0x264de0;return db[_0x4a9f('0x99')][_0x4a9f('0x5f')]({'where':{'ContactId':_0x401eb0['id'],'closed':![],'SmsAccountId':_0x11d458['id']}})[_0x4a9f('0x21')](function(_0xfdb288){if(_0xfdb288){return[_0xfdb288,![]];}return db[_0x4a9f('0x99')][_0x4a9f('0x5a')]({'UserId':_0x3282bf['user']['id'],'ContactId':_0x401eb0['id'],'SmsAccountId':_0x11d458['id'],'phone':_0x14fd2d,'firstMsgDirection':_0x4a9f('0xc7'),'Messages':[_['merge'](_0x3282bf[_0x4a9f('0x5b')],{'read':![],'body':_0x3282bf['body'][_0x4a9f('0x5b')],'phone':_0x14fd2d,'SmsAccountId':_0x11d458['id'],'UserId':_0x3282bf[_0x4a9f('0x5d')]['id'],'ContactId':_0x401eb0['id']})]},{'include':[{'model':db[_0x4a9f('0xa2')],'as':_0x4a9f('0xc8')}]})[_0x4a9f('0x21')](function(_0x163213){return[_0x163213,!![]];});});}})[_0x4a9f('0x9a')](function(_0x5c2965,_0x573574){if(_0x573574){return _0x5c2965;}return db[_0x4a9f('0xa2')][_0x4a9f('0x5a')](_[_0x4a9f('0x51')](_0x3282bf[_0x4a9f('0x5b')],{'read':![],'body':_0x3282bf['body'][_0x4a9f('0x5b')],'phone':_0x14fd2d,'SmsAccountId':_0x11d458['id'],'SmsInteractionId':_0x5c2965['id'],'UserId':_0x3282bf[_0x4a9f('0x5d')]['id'],'ContactId':_0x401eb0['id']}))[_0x4a9f('0x21')](function(_0x8c80cd){_0x5c2965[_0x4a9f('0xc9')][_0x4a9f('0xc8')]=[];_0x5c2965[_0x4a9f('0xc9')][_0x4a9f('0xc8')][_0x4a9f('0x9e')](_0x8c80cd[_0x4a9f('0xc9')]);return _0x5c2965;});})[_0x4a9f('0x21')](respondWithResult(_0x2e2472,null))[_0x4a9f('0x2a')](handleError(_0x2e2472,null));};exports[_0x4a9f('0x2c')]=function(_0x23f609,_0x1a9073,_0x34e5ab){if(_0x23f609[_0x4a9f('0x5b')]['id']){delete _0x23f609[_0x4a9f('0x5b')]['id'];}var _0x361f4f,_0x838bbd,_0x36d440;return db['SmsAccount'][_0x4a9f('0x5f')]({'where':{'id':_0x23f609[_0x4a9f('0x61')]['id']}})[_0x4a9f('0x21')](handleEntityNotFound(_0x1a9073,null))[_0x4a9f('0x21')](function(_0x408f69){if(_0x408f69){_0x36d440=_0x408f69;logger[_0x4a9f('0x24')](_0x4a9f('0x25'),_0x4a9f('0x2c'),_0x4a9f('0xca'),_0x408f69[_0x4a9f('0x41')],util[_0x4a9f('0xcb')](_0x23f609[_0x4a9f('0x5b')],{'showHidden':![],'depth':null}));switch(_0x408f69['type']){case _0x4a9f('0xcc'):if(_0x23f609[_0x4a9f('0x5b')]['skebby_dispatch_id']&&_0x23f609['body'][_0x4a9f('0x2c')]){_0x838bbd=_0x23f609[_0x4a9f('0x5b')]['status'];return db[_0x4a9f('0xa2')][_0x4a9f('0x5f')]({'where':{'messageId':_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0xcd')]}});}break;case _0x4a9f('0x84'):if(_0x23f609[_0x4a9f('0x5b')]['requestid']&&_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0xce')]){_0x838bbd=_0x23f609[_0x4a9f('0x5b')]['statusInt'];return db[_0x4a9f('0xa2')][_0x4a9f('0x5f')]({'where':{'messageId':_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0xcf')]}});}break;case _0x4a9f('0x85'):if(_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0x86')]&&_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0xd0')]){_0x838bbd=_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0xd0')];return db[_0x4a9f('0xa2')][_0x4a9f('0x5f')]({'where':{'messageId':_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0x86')]}});}break;case _0x4a9f('0xd1'):var _0x3c43b9=_0x23f609[_0x4a9f('0x5b')]['results'][0x0];if(_0x3c43b9[_0x4a9f('0x80')]&&_0x3c43b9[_0x4a9f('0x2c')]['groupName']===_0x4a9f('0xd2')){_0x838bbd=_0x3c43b9[_0x4a9f('0x2c')]['groupName'];return db[_0x4a9f('0xa2')]['find']({'where':{'messageId':_0x3c43b9[_0x4a9f('0x80')]}});}break;case'clickatell':if(_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0x80')]&&_0x23f609[_0x4a9f('0x5b')]['status']){_0x838bbd=_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0x2c')];return db[_0x4a9f('0xa2')][_0x4a9f('0x5f')]({'where':{'messageId':_0x23f609['body'][_0x4a9f('0x80')]}});}break;case'bandwidth':if(_0x23f609[_0x4a9f('0x5b')][0x0]['message']['id']){_0x838bbd=_0x23f609[_0x4a9f('0x5b')][0x0][_0x4a9f('0x41')];return db[_0x4a9f('0xa2')][_0x4a9f('0x5f')]({'where':{'messageId':_0x23f609[_0x4a9f('0x5b')][0x0]['message']['id']}});}break;case _0x4a9f('0x8e'):if(_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0xd3')]&&_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0x2c')]){_0x838bbd=_0x23f609[_0x4a9f('0x5b')]['status'];return db[_0x4a9f('0xa2')][_0x4a9f('0x5f')]({'where':{'messageId':_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0xd3')]}});}break;}}})[_0x4a9f('0x21')](handleEntityNotFound(_0x1a9073,null))[_0x4a9f('0x21')](function(_0x238abe){if(_0x238abe){_0x361f4f=_0x238abe;switch(_0x36d440[_0x4a9f('0x41')]){case _0x4a9f('0xcc'):if(_0x838bbd==='DELIVERED'){return _0x361f4f[_0x4a9f('0x36')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4a9f('0xcc'),util['inspect'](_0x23f609[_0x4a9f('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4a9f('0x84'):if(_0x838bbd==='1'){return _0x361f4f[_0x4a9f('0x36')]({'read':!![]});}else{logger[_0x4a9f('0x26')](_0x4a9f('0x25'),_0x4a9f('0x2c'),_0x4a9f('0xcc'),util[_0x4a9f('0xcb')](_0x23f609['body'],{'showHidden':![],'depth':null}));}break;case _0x4a9f('0x85'):if(!_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0xd4')]&&_0x838bbd>=0xc8&&_0x838bbd<=0xce){return _0x361f4f['update']({'read':!![]});}else{logger[_0x4a9f('0x26')](_0x4a9f('0x25'),'status',_0x4a9f('0x85'),util[_0x4a9f('0xcb')](_0x23f609[_0x4a9f('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4a9f('0xd1'):var _0x359cc7=_0x23f609[_0x4a9f('0x5b')][_0x4a9f('0x88')][0x0];if(_0x359cc7[_0x4a9f('0x2c')][_0x4a9f('0xd5')]===_0x4a9f('0xd2')){return _0x361f4f[_0x4a9f('0x36')]({'read':!![]});}else{logger[_0x4a9f('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4a9f('0x2c'),_0x4a9f('0xd1'),util[_0x4a9f('0xcb')](_0x23f609[_0x4a9f('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4a9f('0x8b'):if(_0x838bbd=='DELIVERED_TO_GATEWAY'||_0x838bbd=='RECEIVED_BY_RECIPIENT'){return _0x361f4f[_0x4a9f('0x36')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4a9f('0x2c'),_0x4a9f('0x8b'),util['inspect'](_0x23f609['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x838bbd=='message-delivered'){return _0x361f4f[_0x4a9f('0x36')]({'read':!![]});}else{logger[_0x4a9f('0x26')](_0x4a9f('0x25'),_0x4a9f('0x2c'),_0x4a9f('0xd6'),util[_0x4a9f('0xcb')](_0x23f609[_0x4a9f('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4a9f('0x8e'):if(_0x838bbd===_0x4a9f('0xd7')||_0x838bbd==='ACCEPTD'){return _0x361f4f[_0x4a9f('0x36')]({'read':!![]});}else{logger[_0x4a9f('0x26')](_0x4a9f('0x25'),_0x4a9f('0x2c'),_0x4a9f('0x8e'),util[_0x4a9f('0xcb')](_0x23f609[_0x4a9f('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x361f4f;}})[_0x4a9f('0x21')](respondWithResult(_0x1a9073,null))[_0x4a9f('0x2a')](handleError(_0x1a9073,null));};exports['statusGet']=function(_0x549031,_0x4ac08b,_0x2bcf73){var _0x108a48,_0xed88fe,_0x3c0028;return db[_0x4a9f('0x3f')]['find']({'where':{'id':_0x549031['params']['id']}})[_0x4a9f('0x21')](handleEntityNotFound(_0x4ac08b,null))[_0x4a9f('0x21')](function(_0x5991e5){if(_0x5991e5){_0x3c0028=_0x5991e5;logger[_0x4a9f('0x24')](_0x4a9f('0x25'),_0x4a9f('0x2c'),_0x4a9f('0xca'),_0x5991e5['type'],util[_0x4a9f('0xcb')](_0x549031[_0x4a9f('0x45')],{'showHidden':![],'depth':null}));switch(_0x5991e5[_0x4a9f('0x41')]){case'csc':if(_0x549031[_0x4a9f('0x45')]['message-id']&&_0x549031[_0x4a9f('0x45')][_0x4a9f('0xd8')]){_0xed88fe=_0x549031['query'][_0x4a9f('0xd8')];return db[_0x4a9f('0xa2')][_0x4a9f('0x5f')]({'where':{'messageId':_0x549031[_0x4a9f('0x45')]['message-id']}});}break;}}})[_0x4a9f('0x21')](handleEntityNotFound(_0x4ac08b,null))['then'](function(_0x9620b6){if(_0x9620b6){_0x108a48=_0x9620b6;switch(_0x3c0028[_0x4a9f('0x41')]){case'csc':if(_0xed88fe==='2'||_0xed88fe==='6'){return _0x108a48[_0x4a9f('0x36')]({'read':!![]});}else{logger[_0x4a9f('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4a9f('0x2c'),_0x4a9f('0x89'),util[_0x4a9f('0xcb')](_0x549031[_0x4a9f('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x108a48;}})[_0x4a9f('0x21')](respondWithResult(_0x4ac08b,null))[_0x4a9f('0x2a')](handleError(_0x4ac08b,null));};exports[_0x4a9f('0xd9')]=function(_0x339e5f,_0x6c5fe0,_0x206016){return db[_0x4a9f('0x3f')][_0x4a9f('0x5f')]({'where':{'id':_0x339e5f[_0x4a9f('0x61')]['id']}})[_0x4a9f('0x21')](handleEntityNotFound(_0x6c5fe0,null))[_0x4a9f('0x21')](function(_0x2072ba){if(_0x2072ba){return _0x2072ba['addAgents'](_0x339e5f[_0x4a9f('0x5b')][_0x4a9f('0x6a')],_[_0x4a9f('0x98')](_0x339e5f[_0x4a9f('0x5b')],[_0x4a9f('0x6a'),'id'])||{})[_0x4a9f('0x9a')](function(_0x55d51f){for(var _0x357bca=0x0;_0x357bca<_0x339e5f[_0x4a9f('0x5b')][_0x4a9f('0x6a')]['length'];_0x357bca+=0x1){socket[_0x4a9f('0xda')](_0x4a9f('0xdb'),{'UserId':Number(_0x339e5f['body'][_0x4a9f('0x6a')][_0x357bca]),'SmsAccountId':Number(_0x339e5f[_0x4a9f('0x61')]['id'])});}return _0x55d51f;});}})['then'](respondWithResult(_0x6c5fe0,null))[_0x4a9f('0x2a')](handleError(_0x6c5fe0,null));};exports['removeAgents']=function(_0x198800,_0x287d8a,_0x26f42d){return db[_0x4a9f('0x3f')][_0x4a9f('0x5f')]({'where':{'id':_0x198800[_0x4a9f('0x61')]['id']}})[_0x4a9f('0x21')](handleEntityNotFound(_0x287d8a,null))[_0x4a9f('0x21')](function(_0xcdd50){if(_0xcdd50){return _0xcdd50[_0x4a9f('0xdc')](_0x198800[_0x4a9f('0x45')]['ids'])[_0x4a9f('0x21')](function(){if(_[_0x4a9f('0xdd')](_0x198800['query'][_0x4a9f('0x6a')])){for(var _0x16ab93=0x0;_0x16ab93<_0x198800[_0x4a9f('0x45')][_0x4a9f('0x6a')][_0x4a9f('0x4a')];_0x16ab93+=0x1){socket[_0x4a9f('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x198800[_0x4a9f('0x45')][_0x4a9f('0x6a')][_0x16ab93]),'SmsAccountId':Number(_0x198800[_0x4a9f('0x61')]['id'])});}}else{socket[_0x4a9f('0xda')](_0x4a9f('0xde'),{'UserId':Number(_0x198800['query'][_0x4a9f('0x6a')]),'SmsAccountId':Number(_0x198800[_0x4a9f('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x287d8a,null))[_0x4a9f('0x2a')](handleError(_0x287d8a,null));};exports[_0x4a9f('0xdf')]=function(_0x48f89e,_0x2ccba4,_0x2db35d){var _0x4614b8={};var _0x19d51a={};var _0x5c64e1;var _0x460994;return db[_0x4a9f('0x3f')][_0x4a9f('0x65')]({'where':{'id':_0x48f89e[_0x4a9f('0x61')]['id']}})[_0x4a9f('0x21')](handleEntityNotFound(_0x2ccba4,null))[_0x4a9f('0x21')](function(_0x11a9c6){if(_0x11a9c6){_0x5c64e1=_0x11a9c6;_0x19d51a[_0x4a9f('0x43')]=_['keys'](db[_0x4a9f('0xa6')][_0x4a9f('0x59')]);_0x19d51a[_0x4a9f('0x45')]=_['keys'](_0x48f89e[_0x4a9f('0x45')]);_0x19d51a[_0x4a9f('0x46')]=_['intersection'](_0x19d51a['model'],_0x19d51a[_0x4a9f('0x45')]);_0x4614b8['attributes']=_[_0x4a9f('0x47')](_0x19d51a['model'],qs[_0x4a9f('0x49')](_0x48f89e['query'][_0x4a9f('0x49')]));_0x4614b8[_0x4a9f('0x48')]=_0x4614b8[_0x4a9f('0x48')][_0x4a9f('0x4a')]?_0x4614b8['attributes']:_0x19d51a['model'];_0x4614b8[_0x4a9f('0x68')]=qs[_0x4a9f('0x4d')](_0x48f89e[_0x4a9f('0x45')]['sort']);_0x4614b8['where']=qs[_0x4a9f('0x46')](_['pick'](_0x48f89e[_0x4a9f('0x45')],_0x19d51a[_0x4a9f('0x46')]));if(_0x48f89e[_0x4a9f('0x45')][_0x4a9f('0x50')]){_0x4614b8[_0x4a9f('0x4e')]=_[_0x4a9f('0x51')](_0x4614b8['where'],{'$or':_[_0x4a9f('0x44')](_0x4614b8[_0x4a9f('0x48')],function(_0x1c9f50){var _0xa80452={};_0xa80452[_0x1c9f50]={'$like':'%'+_0x48f89e['query']['filter']+'%'};return _0xa80452;})});}_0x4614b8=_[_0x4a9f('0x51')]({},_0x4614b8,_0x48f89e[_0x4a9f('0x52')]);return _0x5c64e1['getAgents'](_0x4614b8);}})[_0x4a9f('0x21')](function(_0x399987){if(_0x399987){_0x460994=_0x399987[_0x4a9f('0x4a')];if(!_0x48f89e[_0x4a9f('0x45')][_0x4a9f('0x4b')](_0x4a9f('0x4c'))){_0x4614b8[_0x4a9f('0x30')]=qs['limit'](_0x48f89e[_0x4a9f('0x45')][_0x4a9f('0x30')]);_0x4614b8[_0x4a9f('0x2e')]=qs[_0x4a9f('0x2e')](_0x48f89e[_0x4a9f('0x45')]['offset']);}return _0x5c64e1['getAgents'](_0x4614b8);}})[_0x4a9f('0x21')](function(_0x5a046b){if(_0x5a046b){return _0x5a046b?{'count':_0x460994,'rows':_0x5a046b}:null;}})[_0x4a9f('0x21')](respondWithResult(_0x2ccba4,null))[_0x4a9f('0x2a')](handleError(_0x2ccba4,null));};
\ No newline at end of file
index 94d5973..446342d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa33e=['emit','hasOwnProperty','hook','exports','SmsAccount','setMaxListeners','save','update'];(function(_0x117bc4,_0x5a14cf){var _0x175009=function(_0x4f95d5){while(--_0x4f95d5){_0x117bc4['push'](_0x117bc4['shift']());}};_0x175009(++_0x5a14cf);}(_0xa33e,0xe4));var _0xea33=function(_0x52556d,_0x26ef67){_0x52556d=_0x52556d-0x0;var _0x4524f5=_0xa33e[_0x52556d];return _0x4524f5;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0xea33('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xea33('0x1')](0x0);var events={'afterCreate':_0xea33('0x2'),'afterUpdate':_0xea33('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5c9828){return function(_0x134ad9,_0x45a883,_0x1ea92c){SmsAccountEvents[_0xea33('0x4')](_0x5c9828+':'+_0x134ad9['id'],_0x134ad9);SmsAccountEvents[_0xea33('0x4')](_0x5c9828,_0x134ad9);_0x1ea92c(null);};}for(var e in events){if(events[_0xea33('0x5')](e)){var event=events[e];SmsAccount[_0xea33('0x6')](e,emitEvent(event));}}module[_0xea33('0x7')]=SmsAccountEvents;
\ No newline at end of file
+var _0xee32=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xee32,0x16e));var _0x2ee3=function(_0x17aeec,_0x5aead5){_0x17aeec=_0x17aeec-0x0;var _0x2c19e8=_0xee32[_0x17aeec];return _0x2c19e8;};'use strict';var EventEmitter=require(_0x2ee3('0x0'));var SmsAccount=require(_0x2ee3('0x1'))['db'][_0x2ee3('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x2ee3('0x3')](0x0);var events={'afterCreate':_0x2ee3('0x4'),'afterUpdate':_0x2ee3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x579b4e){return function(_0x35b576,_0x2ad9df,_0x4246cd){SmsAccountEvents['emit'](_0x579b4e+':'+_0x35b576['id'],_0x35b576);SmsAccountEvents[_0x2ee3('0x6')](_0x579b4e,_0x35b576);_0x4246cd(null);};}for(var e in events){if(events[_0x2ee3('0x7')](e)){var event=events[e];SmsAccount[_0x2ee3('0x8')](e,emitEvent(event));}}module[_0x2ee3('0x9')]=SmsAccountEvents;
\ No newline at end of file
index fa859cb..62e4104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc808=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash'];(function(_0xab47ce,_0x5ac471){var _0x591420=function(_0x220147){while(--_0x220147){_0xab47ce['push'](_0xab47ce['shift']());}};_0x591420(++_0x5ac471);}(_0xc808,0x128));var _0x8c80=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0xc808[_0x1c6ef2];return _0x404b8c;};'use strict';var _=require(_0x8c80('0x0'));var util=require(_0x8c80('0x1'));var logger=require(_0x8c80('0x2'))(_0x8c80('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8c80('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c80('0x5'));var config=require(_0x8c80('0x6'));var attributes=require(_0x8c80('0x7'));module['exports']=function(_0x130883,_0x346fc7){return _0x130883[_0x8c80('0x8')](_0x8c80('0x9'),attributes,{'tableName':_0x8c80('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d23=['rimraf','exports','define','SmsAccount','sms_accounts','util','../../config/logger','api','moment','path'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0x0d23,0x163));var _0x30d2=function(_0xafbbc0,_0xf82c5c){_0xafbbc0=_0xafbbc0-0x0;var _0x4fa123=_0x0d23[_0xafbbc0];return _0x4fa123;};'use strict';var _=require('lodash');var util=require(_0x30d2('0x0'));var logger=require(_0x30d2('0x1'))(_0x30d2('0x2'));var moment=require(_0x30d2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x30d2('0x4'));var rimraf=require(_0x30d2('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x30d2('0x6')]=function(_0x2764d1,_0x561448){return _0x2764d1[_0x30d2('0x7')](_0x30d2('0x8'),attributes,{'tableName':_0x30d2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0f02001..90b45d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6246=['SmsAccount','find','options','raw','where','attributes','include','map','model','debug','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','then','info','request\x20sent','stringify','code','error','message','SmsAccount,\x20%s,\x20%s','result','ShowSmsAccount'];(function(_0x8d9e0c,_0x5bf07f){var _0x4b9176=function(_0x184748){while(--_0x184748){_0x8d9e0c['push'](_0x8d9e0c['shift']());}};_0x4b9176(++_0x5bf07f);}(_0x6246,0x10e));var _0x6624=function(_0x473ed3,_0x36b961){_0x473ed3=_0x473ed3-0x0;var _0x597269=_0x6246[_0x473ed3];return _0x597269;};'use strict';var _=require('lodash');var util=require(_0x6624('0x0'));var moment=require(_0x6624('0x1'));var BPromise=require(_0x6624('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6624('0x3'));var db=require(_0x6624('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6624('0x5'))(_0x6624('0x6'));var config=require(_0x6624('0x7'));var jayson=require(_0x6624('0x8'));var client=jayson[_0x6624('0x9')]['http']({'port':0x232a});config[_0x6624('0xa')]=_[_0x6624('0xb')](config[_0x6624('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6624('0xc'))(new Redis(config[_0x6624('0xa')]));require(_0x6624('0xd'))[_0x6624('0xe')](socket);function respondWithRpcPromise(_0x5f231d,_0xaaf0a4,_0x56f5bf){return new BPromise(function(_0x156258,_0x30bd8b){return client[_0x6624('0xf')](_0x5f231d,_0x56f5bf)[_0x6624('0x10')](function(_0x385533){logger[_0x6624('0x11')]('SmsAccount,\x20%s,\x20%s',_0xaaf0a4,_0x6624('0x12'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaaf0a4,_0x6624('0x12'),JSON[_0x6624('0x13')](_0x385533));if(_0x385533['error']){if(_0x385533['error'][_0x6624('0x14')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0xaaf0a4,_0x385533['error']['message']);return _0x30bd8b(_0x385533[_0x6624('0x15')][_0x6624('0x16')]);}logger[_0x6624('0x15')](_0x6624('0x17'),_0xaaf0a4,_0x385533[_0x6624('0x15')][_0x6624('0x16')]);return _0x156258(_0x385533[_0x6624('0x15')][_0x6624('0x16')]);}else{logger[_0x6624('0x11')](_0x6624('0x17'),_0xaaf0a4,_0x6624('0x12'));_0x156258(_0x385533[_0x6624('0x18')]['message']);}})['catch'](function(_0x2a7520){logger[_0x6624('0x15')](_0x6624('0x17'),_0xaaf0a4,_0x2a7520);_0x30bd8b(_0x2a7520);});});}exports[_0x6624('0x19')]=function(_0x5d79a0){var _0x214911=this;return new Promise(function(_0x14e876,_0x20f027){return db[_0x6624('0x1a')][_0x6624('0x1b')]({'raw':_0x5d79a0[_0x6624('0x1c')]?_0x5d79a0[_0x6624('0x1c')][_0x6624('0x1d')]===undefined?!![]:![]:!![],'where':_0x5d79a0[_0x6624('0x1c')]?_0x5d79a0[_0x6624('0x1c')][_0x6624('0x1e')]||null:null,'attributes':_0x5d79a0['options']?_0x5d79a0[_0x6624('0x1c')][_0x6624('0x1f')]||null:null,'include':_0x5d79a0[_0x6624('0x1c')]?_0x5d79a0[_0x6624('0x1c')][_0x6624('0x20')]?_[_0x6624('0x21')](_0x5d79a0[_0x6624('0x1c')][_0x6624('0x20')],function(_0x323901){return{'model':db[_0x323901[_0x6624('0x22')]],'as':_0x323901['as'],'attributes':_0x323901[_0x6624('0x1f')],'include':_0x323901[_0x6624('0x20')]?_['map'](_0x323901[_0x6624('0x20')],function(_0x49bb85){return{'model':db[_0x49bb85['model']],'as':_0x49bb85['as'],'attributes':_0x49bb85[_0x6624('0x1f')],'include':_0x49bb85['include']?_[_0x6624('0x21')](_0x49bb85[_0x6624('0x20')],function(_0x34dbdc){return{'model':db[_0x34dbdc['model']],'as':_0x34dbdc['as'],'attributes':_0x34dbdc[_0x6624('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6624('0x10')](function(_0x5a60f0){logger[_0x6624('0x11')](_0x6624('0x19'),_0x5d79a0);logger[_0x6624('0x23')](_0x6624('0x19'),_0x5d79a0,JSON[_0x6624('0x13')](_0x5a60f0));_0x14e876(_0x5a60f0);})[_0x6624('0x24')](function(_0x595c5b){logger[_0x6624('0x15')]('ShowSmsAccount',_0x595c5b[_0x6624('0x16')],_0x5d79a0);_0x20f027(_0x214911[_0x6624('0x15')](0x1f4,_0x595c5b[_0x6624('0x16')]));});});};
\ No newline at end of file
+var _0xd10c=['request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s'];(function(_0x57056c,_0x12c8a1){var _0xb624a2=function(_0x3933fc){while(--_0x3933fc){_0x57056c['push'](_0x57056c['shift']());}};_0xb624a2(++_0x12c8a1);}(_0xd10c,0x80));var _0xcd10=function(_0x5becb1,_0x370067){_0x5becb1=_0x5becb1-0x0;var _0x4e40ec=_0xd10c[_0x5becb1];return _0x4e40ec;};'use strict';var _=require(_0xcd10('0x0'));var util=require(_0xcd10('0x1'));var moment=require(_0xcd10('0x2'));var BPromise=require(_0xcd10('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd10('0x4'));var db=require(_0xcd10('0x5'))['db'];var utils=require(_0xcd10('0x6'));var logger=require(_0xcd10('0x7'))(_0xcd10('0x8'));var config=require(_0xcd10('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcd10('0xa')]({'port':0x232a});config[_0xcd10('0xb')]=_[_0xcd10('0xc')](config[_0xcd10('0xb')],{'host':_0xcd10('0xd'),'port':0x18eb});var socket=require(_0xcd10('0xe'))(new Redis(config['redis']));require(_0xcd10('0xf'))['register'](socket);function respondWithRpcPromise(_0x371eb0,_0x371a37,_0x41c55c){return new BPromise(function(_0x2ddacf,_0x4ccb98){return client[_0xcd10('0x10')](_0x371eb0,_0x41c55c)[_0xcd10('0x11')](function(_0x225a09){logger[_0xcd10('0x12')](_0xcd10('0x13'),_0x371a37,_0xcd10('0x14'));logger[_0xcd10('0x15')](_0xcd10('0x16'),_0x371a37,_0xcd10('0x14'),JSON[_0xcd10('0x17')](_0x225a09));if(_0x225a09['error']){if(_0x225a09[_0xcd10('0x18')][_0xcd10('0x19')]===0x1f4){logger[_0xcd10('0x18')](_0xcd10('0x13'),_0x371a37,_0x225a09[_0xcd10('0x18')][_0xcd10('0x1a')]);return _0x4ccb98(_0x225a09[_0xcd10('0x18')][_0xcd10('0x1a')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x371a37,_0x225a09[_0xcd10('0x18')][_0xcd10('0x1a')]);return _0x2ddacf(_0x225a09[_0xcd10('0x18')][_0xcd10('0x1a')]);}else{logger[_0xcd10('0x12')]('SmsAccount,\x20%s,\x20%s',_0x371a37,'request\x20sent');_0x2ddacf(_0x225a09[_0xcd10('0x1b')][_0xcd10('0x1a')]);}})[_0xcd10('0x1c')](function(_0x391d81){logger[_0xcd10('0x18')](_0xcd10('0x13'),_0x371a37,_0x391d81);_0x4ccb98(_0x391d81);});});}exports[_0xcd10('0x1d')]=function(_0x2fe32f){var _0x52aa76=this;return new Promise(function(_0x1c3b60,_0x14a42b){return db['SmsAccount'][_0xcd10('0x1e')]({'raw':_0x2fe32f[_0xcd10('0x1f')]?_0x2fe32f[_0xcd10('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2fe32f[_0xcd10('0x1f')]?_0x2fe32f[_0xcd10('0x1f')][_0xcd10('0x20')]||null:null,'attributes':_0x2fe32f[_0xcd10('0x1f')]?_0x2fe32f[_0xcd10('0x1f')][_0xcd10('0x21')]||null:null,'include':_0x2fe32f[_0xcd10('0x1f')]?_0x2fe32f['options'][_0xcd10('0x22')]?_[_0xcd10('0x23')](_0x2fe32f[_0xcd10('0x1f')][_0xcd10('0x22')],function(_0x463a65){return{'model':db[_0x463a65[_0xcd10('0x24')]],'as':_0x463a65['as'],'attributes':_0x463a65[_0xcd10('0x21')],'include':_0x463a65[_0xcd10('0x22')]?_[_0xcd10('0x23')](_0x463a65[_0xcd10('0x22')],function(_0x6916f7){return{'model':db[_0x6916f7['model']],'as':_0x6916f7['as'],'attributes':_0x6916f7['attributes'],'include':_0x6916f7[_0xcd10('0x22')]?_[_0xcd10('0x23')](_0x6916f7['include'],function(_0x96c10e){return{'model':db[_0x96c10e[_0xcd10('0x24')]],'as':_0x96c10e['as'],'attributes':_0x96c10e[_0xcd10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xcd10('0x11')](function(_0x44035d){logger[_0xcd10('0x12')](_0xcd10('0x1d'),_0x2fe32f);logger[_0xcd10('0x15')](_0xcd10('0x1d'),_0x2fe32f,JSON[_0xcd10('0x17')](_0x44035d));_0x1c3b60(_0x44035d);})[_0xcd10('0x1c')](function(_0x20811a){logger[_0xcd10('0x18')]('ShowSmsAccount',_0x20811a[_0xcd10('0x1a')],_0x2fe32f);_0x14a42b(_0x52aa76[_0xcd10('0x18')](0x1f4,_0x20811a[_0xcd10('0x1a')]));});});};
\ No newline at end of file
index ae0d4e1..13edeff 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 8e517d6..362702e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x491ee7,_0x43a779){var _0x3ac382=function(_0x2f98b9){while(--_0x2f98b9){_0x491ee7['push'](_0x491ee7['shift']());}};_0x3ac382(++_0x43a779);}(_0x55ca,0x126));var _0xa55c=function(_0x17dd1d,_0x31f1b5){_0x17dd1d=_0x17dd1d-0x0;var _0x5e9d0c=_0x55ca[_0x17dd1d];return _0x5e9d0c;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router;
\ No newline at end of file
index e5d6a4b..edbc653 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73c4=['sequelize','INTEGER','STRING','noop'];(function(_0x153c7e,_0x32534f){var _0x544b89=function(_0x34624e){while(--_0x34624e){_0x153c7e['push'](_0x153c7e['shift']());}};_0x544b89(++_0x32534f);}(_0x73c4,0xb0));var _0x473c=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x73c4[_0x11e30d];return _0x2d4e29;};'use strict';var Sequelize=require(_0x473c('0x0'));module['exports']={'priority':{'type':Sequelize[_0x473c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x473c('0x2')],'allowNull':![],'defaultValue':_0x473c('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x473c('0x2')]},'interval':{'type':Sequelize[_0x473c('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xabc9=['noop','sequelize','exports','STRING'];(function(_0x150551,_0x6cbe68){var _0x19f9fc=function(_0x36cfda){while(--_0x36cfda){_0x150551['push'](_0x150551['shift']());}};_0x19f9fc(++_0x6cbe68);}(_0xabc9,0x139));var _0x9abc=function(_0xef2ffc,_0x5451dc){_0xef2ffc=_0xef2ffc-0x0;var _0x1ecfe4=_0xabc9[_0xef2ffc];return _0x1ecfe4;};'use strict';var Sequelize=require(_0x9abc('0x0'));module[_0x9abc('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9abc('0x2')],'allowNull':![],'defaultValue':_0x9abc('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9abc('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 6e92d42..00de2b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7b5=['desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','save','then','destroy','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','offset','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','squel','crypto','jsforce'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc7b5,0x107));var _0x5c7b=function(_0x1ec75a,_0x1194d1){_0x1ec75a=_0x1ec75a-0x0;var _0x452a64=_0xc7b5[_0x1ec75a];return _0x452a64;};'use strict';var emlformat=require(_0x5c7b('0x0'));var rimraf=require(_0x5c7b('0x1'));var zipdir=require(_0x5c7b('0x2'));var jsonpatch=require(_0x5c7b('0x3'));var rp=require(_0x5c7b('0x4'));var moment=require(_0x5c7b('0x5'));var BPromise=require(_0x5c7b('0x6'));var Mustache=require(_0x5c7b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5c7b('0x8'));var csv=require(_0x5c7b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5c7b('0xa'));var crypto=require(_0x5c7b('0xb'));var jsforce=require(_0x5c7b('0xc'));var deskjs=require(_0x5c7b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5c7b('0xe'));var Redis=require(_0x5c7b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5c7b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c7b('0x11'))(_0x5c7b('0x12'));var utils=require(_0x5c7b('0x13'));var config=require(_0x5c7b('0x14'));var licenseUtil=require(_0x5c7b('0x15'));var db=require(_0x5c7b('0x16'))['db'];function respondWithStatusCode(_0x151976,_0x164698){_0x164698=_0x164698||0xcc;return function(_0x39ad99){if(_0x39ad99){return _0x151976[_0x5c7b('0x17')](_0x164698);}return _0x151976[_0x5c7b('0x18')](_0x164698)[_0x5c7b('0x19')]();};}function respondWithResult(_0x2d4b14,_0x4119b1){_0x4119b1=_0x4119b1||0xc8;return function(_0x582d20){if(_0x582d20){return _0x2d4b14[_0x5c7b('0x18')](_0x4119b1)[_0x5c7b('0x1a')](_0x582d20);}};}function respondWithFilteredResult(_0x4c8473,_0x15029d){return function(_0x239722){if(_0x239722){var _0x12ff12=typeof _0x15029d['offset']===_0x5c7b('0x1b')&&typeof _0x15029d[_0x5c7b('0x1c')]===_0x5c7b('0x1b');var _0x281687=_0x239722['count'];var _0x216271=_0x12ff12?0x0:_0x15029d['offset'];var _0x18653f=_0x12ff12?_0x239722[_0x5c7b('0x1d')]:_0x15029d['offset']+_0x15029d[_0x5c7b('0x1c')];var _0x5354fe;if(_0x18653f>=_0x281687){_0x18653f=_0x281687;_0x5354fe=0xc8;}else{_0x5354fe=0xce;}_0x4c8473[_0x5c7b('0x18')](_0x5354fe);return _0x4c8473['set']('Content-Range',_0x216271+'-'+_0x18653f+'/'+_0x281687)[_0x5c7b('0x1a')](_0x239722);}return null;};}function patchUpdates(_0x4bf234){return function(_0x2c90ed){try{jsonpatch[_0x5c7b('0x1e')](_0x2c90ed,_0x4bf234,!![]);}catch(_0x48a3ba){return BPromise['reject'](_0x48a3ba);}return _0x2c90ed[_0x5c7b('0x1f')]();};}function saveUpdates(_0x1e5cd2,_0x1829d1){return function(_0x162af9){if(_0x162af9){return _0x162af9['update'](_0x1e5cd2)[_0x5c7b('0x20')](function(_0x32a5eb){return _0x32a5eb;});}return null;};}function removeEntity(_0x4c1073,_0x3a5d56){return function(_0x33de16){if(_0x33de16){return _0x33de16[_0x5c7b('0x21')]()[_0x5c7b('0x20')](function(){_0x4c1073[_0x5c7b('0x18')](0xcc)[_0x5c7b('0x19')]();});}};}function handleEntityNotFound(_0x37d156,_0x2d5e3f){return function(_0x26e7cb){if(!_0x26e7cb){_0x37d156[_0x5c7b('0x17')](0x194);}return _0x26e7cb;};}function handleError(_0x219760,_0x4628b5){_0x4628b5=_0x4628b5||0x1f4;return function(_0x5524af){logger[_0x5c7b('0x22')](_0x5524af[_0x5c7b('0x23')]);if(_0x5524af[_0x5c7b('0x24')]){delete _0x5524af[_0x5c7b('0x24')];}_0x219760[_0x5c7b('0x18')](_0x4628b5)['send'](_0x5524af);};}exports[_0x5c7b('0x25')]=function(_0x4ed073,_0x442b38){var _0x55b5b2={},_0x152c0e={},_0x3ac8ed={'count':0x0,'rows':[]};var _0x4e7e74=_[_0x5c7b('0x26')](db[_0x5c7b('0x27')][_0x5c7b('0x28')],function(_0x4caf11){return{'name':_0x4caf11[_0x5c7b('0x29')],'type':_0x4caf11[_0x5c7b('0x2a')][_0x5c7b('0x2b')]};});_0x152c0e['model']=_[_0x5c7b('0x26')](_0x4e7e74,_0x5c7b('0x24'));_0x152c0e[_0x5c7b('0x2c')]=_[_0x5c7b('0x2d')](_0x4ed073[_0x5c7b('0x2c')]);_0x152c0e[_0x5c7b('0x2e')]=_['intersection'](_0x152c0e[_0x5c7b('0x2f')],_0x152c0e[_0x5c7b('0x2c')]);_0x55b5b2[_0x5c7b('0x30')]=_[_0x5c7b('0x31')](_0x152c0e['model'],qs[_0x5c7b('0x32')](_0x4ed073[_0x5c7b('0x2c')][_0x5c7b('0x32')]));_0x55b5b2[_0x5c7b('0x30')]=_0x55b5b2[_0x5c7b('0x30')][_0x5c7b('0x33')]?_0x55b5b2['attributes']:_0x152c0e[_0x5c7b('0x2f')];if(!_0x4ed073[_0x5c7b('0x2c')]['hasOwnProperty']('nolimit')){_0x55b5b2[_0x5c7b('0x1c')]=qs[_0x5c7b('0x1c')](_0x4ed073['query'][_0x5c7b('0x1c')]);_0x55b5b2[_0x5c7b('0x34')]=qs[_0x5c7b('0x34')](_0x4ed073['query']['offset']);}_0x55b5b2['order']=qs[_0x5c7b('0x35')](_0x4ed073['query']['sort']);_0x55b5b2[_0x5c7b('0x36')]=qs[_0x5c7b('0x2e')](_[_0x5c7b('0x37')](_0x4ed073[_0x5c7b('0x2c')],_0x152c0e[_0x5c7b('0x2e')]),_0x4e7e74);if(_0x4ed073['query'][_0x5c7b('0x38')]){_0x55b5b2['where']=_[_0x5c7b('0x39')](_0x55b5b2[_0x5c7b('0x36')],{'$or':_[_0x5c7b('0x26')](_0x4e7e74,function(_0x573a8b){if(_0x573a8b[_0x5c7b('0x2a')]!=='VIRTUAL'){var _0x4fa91a={};_0x4fa91a[_0x573a8b[_0x5c7b('0x24')]]={'$like':'%'+_0x4ed073[_0x5c7b('0x2c')][_0x5c7b('0x38')]+'%'};return _0x4fa91a;}})});}_0x55b5b2=_['merge']({},_0x55b5b2,_0x4ed073[_0x5c7b('0x3a')]);var _0x4f3007={'where':_0x55b5b2[_0x5c7b('0x36')]};return db[_0x5c7b('0x27')]['count'](_0x4f3007)[_0x5c7b('0x20')](function(_0x15ec84){_0x3ac8ed[_0x5c7b('0x1d')]=_0x15ec84;if(_0x4ed073[_0x5c7b('0x2c')][_0x5c7b('0x3b')]){_0x55b5b2[_0x5c7b('0x3c')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x55b5b2);})[_0x5c7b('0x20')](function(_0x5eba11){_0x3ac8ed[_0x5c7b('0x3d')]=_0x5eba11;return _0x3ac8ed;})[_0x5c7b('0x20')](respondWithFilteredResult(_0x442b38,_0x55b5b2))[_0x5c7b('0x3e')](handleError(_0x442b38,null));};exports[_0x5c7b('0x3f')]=function(_0x5c75f0,_0x5b803c){var _0x577b73={'raw':!![],'where':{'id':_0x5c75f0[_0x5c7b('0x40')]['id']}},_0x42e0e2={};_0x42e0e2[_0x5c7b('0x2f')]=_[_0x5c7b('0x2d')](db['SmsApplication'][_0x5c7b('0x28')]);_0x42e0e2[_0x5c7b('0x2c')]=_[_0x5c7b('0x2d')](_0x5c75f0[_0x5c7b('0x2c')]);_0x42e0e2[_0x5c7b('0x2e')]=_[_0x5c7b('0x31')](_0x42e0e2[_0x5c7b('0x2f')],_0x42e0e2[_0x5c7b('0x2c')]);_0x577b73[_0x5c7b('0x30')]=_[_0x5c7b('0x31')](_0x42e0e2['model'],qs['fields'](_0x5c75f0[_0x5c7b('0x2c')][_0x5c7b('0x32')]));_0x577b73[_0x5c7b('0x30')]=_0x577b73[_0x5c7b('0x30')][_0x5c7b('0x33')]?_0x577b73[_0x5c7b('0x30')]:_0x42e0e2[_0x5c7b('0x2f')];if(_0x5c75f0[_0x5c7b('0x2c')][_0x5c7b('0x3b')]){_0x577b73[_0x5c7b('0x3c')]=[{'all':!![]}];}_0x577b73=_[_0x5c7b('0x39')]({},_0x577b73,_0x5c75f0[_0x5c7b('0x3a')]);return db[_0x5c7b('0x27')][_0x5c7b('0x41')](_0x577b73)[_0x5c7b('0x20')](handleEntityNotFound(_0x5b803c,null))[_0x5c7b('0x20')](respondWithResult(_0x5b803c,null))[_0x5c7b('0x3e')](handleError(_0x5b803c,null));};exports[_0x5c7b('0x42')]=function(_0x4ad355,_0x544ad8){return db[_0x5c7b('0x27')][_0x5c7b('0x42')](_0x4ad355[_0x5c7b('0x43')],{})[_0x5c7b('0x20')](respondWithResult(_0x544ad8,0xc9))[_0x5c7b('0x3e')](handleError(_0x544ad8,null));};exports[_0x5c7b('0x44')]=function(_0x1718a4,_0x2c5073){if(_0x1718a4[_0x5c7b('0x43')]['id']){delete _0x1718a4['body']['id'];}return db[_0x5c7b('0x27')][_0x5c7b('0x41')]({'where':{'id':_0x1718a4[_0x5c7b('0x40')]['id']}})[_0x5c7b('0x20')](handleEntityNotFound(_0x2c5073,null))[_0x5c7b('0x20')](saveUpdates(_0x1718a4[_0x5c7b('0x43')],null))[_0x5c7b('0x20')](respondWithResult(_0x2c5073,null))[_0x5c7b('0x3e')](handleError(_0x2c5073,null));};exports[_0x5c7b('0x21')]=function(_0x3d037f,_0x3b7ae9){return db[_0x5c7b('0x27')][_0x5c7b('0x41')]({'where':{'id':_0x3d037f[_0x5c7b('0x40')]['id']}})[_0x5c7b('0x20')](handleEntityNotFound(_0x3b7ae9,null))[_0x5c7b('0x20')](removeEntity(_0x3b7ae9,null))['catch'](handleError(_0x3b7ae9,null));};
\ No newline at end of file
+var _0x4e4d=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','sort','where','filters','pick','filter','merge','then','includeAll','SmsApplication','rows','show','include','options','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x32f9e6,_0x55ed80){var _0x11a5ea=function(_0x1862ab){while(--_0x1862ab){_0x32f9e6['push'](_0x32f9e6['shift']());}};_0x11a5ea(++_0x55ed80);}(_0x4e4d,0xd3));var _0xd4e4=function(_0x503950,_0x5022eb){_0x503950=_0x503950-0x0;var _0x1657a9=_0x4e4d[_0x503950];return _0x1657a9;};'use strict';var emlformat=require(_0xd4e4('0x0'));var rimraf=require(_0xd4e4('0x1'));var zipdir=require(_0xd4e4('0x2'));var jsonpatch=require(_0xd4e4('0x3'));var rp=require('request-promise');var moment=require(_0xd4e4('0x4'));var BPromise=require(_0xd4e4('0x5'));var Mustache=require(_0xd4e4('0x6'));var util=require(_0xd4e4('0x7'));var path=require(_0xd4e4('0x8'));var sox=require(_0xd4e4('0x9'));var csv=require(_0xd4e4('0xa'));var ejs=require(_0xd4e4('0xb'));var fs=require('fs');var fs_extra=require(_0xd4e4('0xc'));var _=require(_0xd4e4('0xd'));var squel=require(_0xd4e4('0xe'));var crypto=require(_0xd4e4('0xf'));var jsforce=require(_0xd4e4('0x10'));var deskjs=require(_0xd4e4('0x11'));var toCsv=require(_0xd4e4('0xa'));var querystring=require(_0xd4e4('0x12'));var Papa=require(_0xd4e4('0x13'));var Redis=require(_0xd4e4('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xd4e4('0x15'));var as=require(_0xd4e4('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd4e4('0x17'));var utils=require(_0xd4e4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd4e4('0x19'));var db=require(_0xd4e4('0x1a'))['db'];function respondWithStatusCode(_0xef77c3,_0x4d365c){_0x4d365c=_0x4d365c||0xcc;return function(_0x40aaf2){if(_0x40aaf2){return _0xef77c3[_0xd4e4('0x1b')](_0x4d365c);}return _0xef77c3[_0xd4e4('0x1c')](_0x4d365c)[_0xd4e4('0x1d')]();};}function respondWithResult(_0x48f290,_0x2dccdb){_0x2dccdb=_0x2dccdb||0xc8;return function(_0xad42f){if(_0xad42f){return _0x48f290[_0xd4e4('0x1c')](_0x2dccdb)['json'](_0xad42f);}};}function respondWithFilteredResult(_0x3012a5,_0x10f1d5){return function(_0x5ea8c1){if(_0x5ea8c1){var _0x5c2608=typeof _0x10f1d5[_0xd4e4('0x1e')]===_0xd4e4('0x1f')&&typeof _0x10f1d5[_0xd4e4('0x20')]===_0xd4e4('0x1f');var _0x5721db=_0x5ea8c1[_0xd4e4('0x21')];var _0x1a9d28=_0x5c2608?0x0:_0x10f1d5['offset'];var _0x1645f8=_0x5c2608?_0x5ea8c1[_0xd4e4('0x21')]:_0x10f1d5[_0xd4e4('0x1e')]+_0x10f1d5[_0xd4e4('0x20')];var _0x8dee6;if(_0x1645f8>=_0x5721db){_0x1645f8=_0x5721db;_0x8dee6=0xc8;}else{_0x8dee6=0xce;}_0x3012a5['status'](_0x8dee6);return _0x3012a5[_0xd4e4('0x22')](_0xd4e4('0x23'),_0x1a9d28+'-'+_0x1645f8+'/'+_0x5721db)[_0xd4e4('0x24')](_0x5ea8c1);}return null;};}function patchUpdates(_0x3fd385){return function(_0x50315d){try{jsonpatch[_0xd4e4('0x25')](_0x50315d,_0x3fd385,!![]);}catch(_0x1c4ea9){return BPromise[_0xd4e4('0x26')](_0x1c4ea9);}return _0x50315d['save']();};}function saveUpdates(_0x1979bf,_0x5c9740){return function(_0x2881ae){if(_0x2881ae){return _0x2881ae[_0xd4e4('0x27')](_0x1979bf)['then'](function(_0x830ad7){return _0x830ad7;});}return null;};}function removeEntity(_0xd4a6d2,_0x59e487){return function(_0x4feb0b){if(_0x4feb0b){return _0x4feb0b['destroy']()['then'](function(){_0xd4a6d2['status'](0xcc)[_0xd4e4('0x1d')]();});}};}function handleEntityNotFound(_0x28bc03,_0x480c6e){return function(_0x5da98f){if(!_0x5da98f){_0x28bc03[_0xd4e4('0x1b')](0x194);}return _0x5da98f;};}function handleError(_0x17ce3f,_0x4b10aa){_0x4b10aa=_0x4b10aa||0x1f4;return function(_0x40d3a9){logger[_0xd4e4('0x28')](_0x40d3a9[_0xd4e4('0x29')]);if(_0x40d3a9[_0xd4e4('0x2a')]){delete _0x40d3a9[_0xd4e4('0x2a')];}_0x17ce3f[_0xd4e4('0x1c')](_0x4b10aa)[_0xd4e4('0x2b')](_0x40d3a9);};}exports[_0xd4e4('0x2c')]=function(_0x44665d,_0x17f613){var _0x3d093d={},_0x1468c1={},_0x41ebf7={'count':0x0,'rows':[]};var _0x101c62=_['map'](db['SmsApplication'][_0xd4e4('0x2d')],function(_0x33f711){return{'name':_0x33f711[_0xd4e4('0x2e')],'type':_0x33f711[_0xd4e4('0x2f')][_0xd4e4('0x30')]};});_0x1468c1['model']=_[_0xd4e4('0x31')](_0x101c62,'name');_0x1468c1[_0xd4e4('0x32')]=_[_0xd4e4('0x33')](_0x44665d['query']);_0x1468c1['filters']=_[_0xd4e4('0x34')](_0x1468c1[_0xd4e4('0x35')],_0x1468c1[_0xd4e4('0x32')]);_0x3d093d[_0xd4e4('0x36')]=_[_0xd4e4('0x34')](_0x1468c1[_0xd4e4('0x35')],qs['fields'](_0x44665d[_0xd4e4('0x32')][_0xd4e4('0x37')]));_0x3d093d[_0xd4e4('0x36')]=_0x3d093d[_0xd4e4('0x36')][_0xd4e4('0x38')]?_0x3d093d[_0xd4e4('0x36')]:_0x1468c1['model'];if(!_0x44665d['query']['hasOwnProperty']('nolimit')){_0x3d093d[_0xd4e4('0x20')]=qs[_0xd4e4('0x20')](_0x44665d[_0xd4e4('0x32')][_0xd4e4('0x20')]);_0x3d093d[_0xd4e4('0x1e')]=qs[_0xd4e4('0x1e')](_0x44665d['query'][_0xd4e4('0x1e')]);}_0x3d093d['order']=qs[_0xd4e4('0x39')](_0x44665d[_0xd4e4('0x32')][_0xd4e4('0x39')]);_0x3d093d[_0xd4e4('0x3a')]=qs[_0xd4e4('0x3b')](_[_0xd4e4('0x3c')](_0x44665d[_0xd4e4('0x32')],_0x1468c1[_0xd4e4('0x3b')]),_0x101c62);if(_0x44665d[_0xd4e4('0x32')][_0xd4e4('0x3d')]){_0x3d093d[_0xd4e4('0x3a')]=_[_0xd4e4('0x3e')](_0x3d093d[_0xd4e4('0x3a')],{'$or':_[_0xd4e4('0x31')](_0x101c62,function(_0x26c613){if(_0x26c613['type']!=='VIRTUAL'){var _0xb0f2fb={};_0xb0f2fb[_0x26c613[_0xd4e4('0x2a')]]={'$like':'%'+_0x44665d['query']['filter']+'%'};return _0xb0f2fb;}})});}_0x3d093d=_[_0xd4e4('0x3e')]({},_0x3d093d,_0x44665d['options']);var _0x546c2b={'where':_0x3d093d[_0xd4e4('0x3a')]};return db['SmsApplication'][_0xd4e4('0x21')](_0x546c2b)[_0xd4e4('0x3f')](function(_0x57abd5){_0x41ebf7[_0xd4e4('0x21')]=_0x57abd5;if(_0x44665d[_0xd4e4('0x32')][_0xd4e4('0x40')]){_0x3d093d['include']=[{'all':!![]}];}return db[_0xd4e4('0x41')]['findAll'](_0x3d093d);})[_0xd4e4('0x3f')](function(_0x5e375a){_0x41ebf7[_0xd4e4('0x42')]=_0x5e375a;return _0x41ebf7;})[_0xd4e4('0x3f')](respondWithFilteredResult(_0x17f613,_0x3d093d))['catch'](handleError(_0x17f613,null));};exports[_0xd4e4('0x43')]=function(_0x396e49,_0x149e14){var _0x18688d={'raw':!![],'where':{'id':_0x396e49['params']['id']}},_0x2d9563={};_0x2d9563[_0xd4e4('0x35')]=_[_0xd4e4('0x33')](db[_0xd4e4('0x41')][_0xd4e4('0x2d')]);_0x2d9563[_0xd4e4('0x32')]=_[_0xd4e4('0x33')](_0x396e49[_0xd4e4('0x32')]);_0x2d9563[_0xd4e4('0x3b')]=_[_0xd4e4('0x34')](_0x2d9563[_0xd4e4('0x35')],_0x2d9563['query']);_0x18688d[_0xd4e4('0x36')]=_[_0xd4e4('0x34')](_0x2d9563[_0xd4e4('0x35')],qs[_0xd4e4('0x37')](_0x396e49[_0xd4e4('0x32')][_0xd4e4('0x37')]));_0x18688d['attributes']=_0x18688d[_0xd4e4('0x36')][_0xd4e4('0x38')]?_0x18688d[_0xd4e4('0x36')]:_0x2d9563['model'];if(_0x396e49[_0xd4e4('0x32')][_0xd4e4('0x40')]){_0x18688d[_0xd4e4('0x44')]=[{'all':!![]}];}_0x18688d=_['merge']({},_0x18688d,_0x396e49[_0xd4e4('0x45')]);return db[_0xd4e4('0x41')][_0xd4e4('0x46')](_0x18688d)[_0xd4e4('0x3f')](handleEntityNotFound(_0x149e14,null))['then'](respondWithResult(_0x149e14,null))[_0xd4e4('0x47')](handleError(_0x149e14,null));};exports['create']=function(_0x2b564e,_0x24086b){return db[_0xd4e4('0x41')][_0xd4e4('0x48')](_0x2b564e[_0xd4e4('0x49')],{})[_0xd4e4('0x3f')](respondWithResult(_0x24086b,0xc9))[_0xd4e4('0x47')](handleError(_0x24086b,null));};exports[_0xd4e4('0x27')]=function(_0x217885,_0x30b8c5){if(_0x217885[_0xd4e4('0x49')]['id']){delete _0x217885[_0xd4e4('0x49')]['id'];}return db[_0xd4e4('0x41')]['find']({'where':{'id':_0x217885[_0xd4e4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x30b8c5,null))['then'](saveUpdates(_0x217885[_0xd4e4('0x49')],null))[_0xd4e4('0x3f')](respondWithResult(_0x30b8c5,null))[_0xd4e4('0x47')](handleError(_0x30b8c5,null));};exports[_0xd4e4('0x4b')]=function(_0x17d5e3,_0x114b3d){return db[_0xd4e4('0x41')][_0xd4e4('0x46')]({'where':{'id':_0x17d5e3[_0xd4e4('0x4a')]['id']}})[_0xd4e4('0x3f')](handleEntityNotFound(_0x114b3d,null))[_0xd4e4('0x3f')](removeEntity(_0x114b3d,null))[_0xd4e4('0x47')](handleError(_0x114b3d,null));};
\ No newline at end of file
index 11affff..b6988fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa849=['bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x32c9b9,_0x21a0cf){var _0x239eab=function(_0x25fceb){while(--_0x25fceb){_0x32c9b9['push'](_0x32c9b9['shift']());}};_0x239eab(++_0x21a0cf);}(_0xa849,0x106));var _0x9a84=function(_0x38910e,_0x2fc911){_0x38910e=_0x38910e-0x0;var _0x397a9f=_0xa849[_0x38910e];return _0x397a9f;};'use strict';var _=require(_0x9a84('0x0'));var util=require(_0x9a84('0x1'));var logger=require('../../config/logger')(_0x9a84('0x2'));var moment=require(_0x9a84('0x3'));var BPromise=require(_0x9a84('0x4'));var rp=require(_0x9a84('0x5'));var fs=require('fs');var path=require(_0x9a84('0x6'));var rimraf=require(_0x9a84('0x7'));var config=require(_0x9a84('0x8'));var attributes=require(_0x9a84('0x9'));module[_0x9a84('0xa')]=function(_0x14ad6a,_0x14edb2){return _0x14ad6a[_0x9a84('0xb')](_0x9a84('0xc'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9a84('0xd')});};
\ No newline at end of file
+var _0x1b69=['rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise'];(function(_0x3ddffb,_0x10f42a){var _0x17eaf1=function(_0x18a806){while(--_0x18a806){_0x3ddffb['push'](_0x3ddffb['shift']());}};_0x17eaf1(++_0x10f42a);}(_0x1b69,0x1d0));var _0x91b6=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x1b69[_0x2dea24];return _0x309d58;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x91b6('0x0'));var moment=require(_0x91b6('0x1'));var BPromise=require(_0x91b6('0x2'));var rp=require(_0x91b6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91b6('0x4'));var config=require(_0x91b6('0x5'));var attributes=require(_0x91b6('0x6'));module[_0x91b6('0x7')]=function(_0x1c4412,_0xa67563){return _0x1c4412[_0x91b6('0x8')](_0x91b6('0x9'),attributes,{'tableName':_0x91b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x91b6('0xb'),'collate':_0x91b6('0xc')});};
\ No newline at end of file
index e2e7a1f..de86b89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9805=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x18ce26,_0xb6d56c){var _0x7e6cc5=function(_0x135d93){while(--_0x135d93){_0x18ce26['push'](_0x18ce26['shift']());}};_0x7e6cc5(++_0xb6d56c);}(_0x9805,0x18f));var _0x5980=function(_0x46a89e,_0x3c223c){_0x46a89e=_0x46a89e-0x0;var _0x50a1e7=_0x9805[_0x46a89e];return _0x50a1e7;};'use strict';var _=require(_0x5980('0x0'));var util=require(_0x5980('0x1'));var moment=require(_0x5980('0x2'));var BPromise=require(_0x5980('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5980('0x4'))['db'];var utils=require(_0x5980('0x5'));var logger=require(_0x5980('0x6'))(_0x5980('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5980('0x8')][_0x5980('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x326b9b,_0x1d6536,_0x175728){return new BPromise(function(_0x3399a9,_0xf8b3c0){return client[_0x5980('0xa')](_0x326b9b,_0x175728)[_0x5980('0xb')](function(_0x35b0ad){logger[_0x5980('0xc')](_0x5980('0xd'),_0x1d6536,'request\x20sent');logger['debug'](_0x5980('0xe'),_0x1d6536,_0x5980('0xf'),JSON[_0x5980('0x10')](_0x35b0ad));if(_0x35b0ad[_0x5980('0x11')]){if(_0x35b0ad['error'][_0x5980('0x12')]===0x1f4){logger[_0x5980('0x11')]('SmsApplication,\x20%s,\x20%s',_0x1d6536,_0x35b0ad['error'][_0x5980('0x13')]);return _0xf8b3c0(_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);}logger[_0x5980('0x11')](_0x5980('0xd'),_0x1d6536,_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);return _0x3399a9(_0x35b0ad[_0x5980('0x11')]['message']);}else{logger[_0x5980('0xc')]('SmsApplication,\x20%s,\x20%s',_0x1d6536,_0x5980('0xf'));_0x3399a9(_0x35b0ad[_0x5980('0x14')][_0x5980('0x13')]);}})[_0x5980('0x15')](function(_0x183261){logger['error'](_0x5980('0xd'),_0x1d6536,_0x183261);_0xf8b3c0(_0x183261);});});}
\ No newline at end of file
+var _0x4c4a=['message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x44706a,_0x281081){_0x44706a=_0x44706a-0x0;var _0x319b57=_0x4c4a[_0x44706a];return _0x319b57;};'use strict';var _=require(_0xa4c4('0x0'));var util=require(_0xa4c4('0x1'));var moment=require(_0xa4c4('0x2'));var BPromise=require('bluebird');var rs=require(_0xa4c4('0x3'));var fs=require('fs');var Redis=require(_0xa4c4('0x4'));var db=require(_0xa4c4('0x5'))['db'];var utils=require(_0xa4c4('0x6'));var logger=require('../../config/logger')(_0xa4c4('0x7'));var config=require('../../config/environment');var jayson=require(_0xa4c4('0x8'));var client=jayson[_0xa4c4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x557596,_0x11b498,_0x553525){return new BPromise(function(_0x27b877,_0x118d89){return client[_0xa4c4('0xa')](_0x557596,_0x553525)['then'](function(_0x5ec64c){logger[_0xa4c4('0xb')](_0xa4c4('0xc'),_0x11b498,_0xa4c4('0xd'));logger[_0xa4c4('0xe')](_0xa4c4('0xf'),_0x11b498,'request\x20sent',JSON[_0xa4c4('0x10')](_0x5ec64c));if(_0x5ec64c['error']){if(_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x12')]===0x1f4){logger[_0xa4c4('0x11')](_0xa4c4('0xc'),_0x11b498,_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);return _0x118d89(_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);}logger[_0xa4c4('0x11')]('SmsApplication,\x20%s,\x20%s',_0x11b498,_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);return _0x27b877(_0x5ec64c[_0xa4c4('0x11')][_0xa4c4('0x13')]);}else{logger[_0xa4c4('0xb')](_0xa4c4('0xc'),_0x11b498,_0xa4c4('0xd'));_0x27b877(_0x5ec64c['result'][_0xa4c4('0x13')]);}})[_0xa4c4('0x14')](function(_0x4b2f2d){logger[_0xa4c4('0x11')](_0xa4c4('0xc'),_0x11b498,_0x4b2f2d);_0x118d89(_0x4b2f2d);});});}
\ No newline at end of file
index 7e5b3d4..00707b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe511=['addTags','put','update','smsinteraction:destroy','destroy','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','describe','show','/:id/messages','isAuthenticated','getMessages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xe511,0x16f));var _0x1e51=function(_0x1c33dc,_0x177c7e){_0x1c33dc=_0x1c33dc-0x0;var _0x405580=_0xe511[_0x1c33dc];return _0x405580;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0x8')]('/:id/download',auth[_0x1e51('0xd')](),controller[_0x1e51('0xf')]);router[_0x1e51('0x10')]('/',auth[_0x1e51('0xd')](),controller[_0x1e51('0x11')]);router[_0x1e51('0x10')]('/:id/messages',auth[_0x1e51('0xd')](),controller[_0x1e51('0x12')]);router[_0x1e51('0x10')](_0x1e51('0x13'),auth[_0x1e51('0xd')](),interaction[_0x1e51('0x14')](_0x1e51('0x15'),_0x1e51('0x16')),controller[_0x1e51('0x17')]);router[_0x1e51('0x18')]('/:id',auth[_0x1e51('0xd')](),interaction[_0x1e51('0x14')](_0x1e51('0x15'),'smsinteraction:update'),controller[_0x1e51('0x19')]);router['delete']('/:id',auth[_0x1e51('0xd')](),interaction[_0x1e51('0x14')](_0x1e51('0x15'),_0x1e51('0x1a')),controller[_0x1e51('0x1b')]);router[_0x1e51('0x1c')]('/:id/tags',auth[_0x1e51('0xd')](),controller['removeTags']);module[_0x1e51('0x1d')]=router;
\ No newline at end of file
+var _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x1d9a9e,_0x1bb2c9){var _0x4a9419=function(_0x55c297){while(--_0x55c297){_0x1d9a9e['push'](_0x1d9a9e['shift']());}};_0x4a9419(++_0x1bb2c9);}(_0x0972,0x64));var _0x2097=function(_0x31b812,_0x212b99){_0x31b812=_0x31b812-0x0;var _0x15a5c9=_0x0972[_0x31b812];return _0x15a5c9;};'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')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router;
\ No newline at end of file
index af34334..f1535f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ca4=['STRING','DATE','ENUM','out','BOOLEAN','sequelize','moment','exports'];(function(_0x2e891a,_0xb5a3b5){var _0x39f989=function(_0x1eaec3){while(--_0x1eaec3){_0x2e891a['push'](_0x2e891a['shift']());}};_0x39f989(++_0xb5a3b5);}(_0x3ca4,0x17d));var _0x43ca=function(_0x3106b4,_0x392e64){_0x3106b4=_0x3106b4-0x0;var _0x2db35b=_0x3ca4[_0x3106b4];return _0x2db35b;};'use strict';var Sequelize=require(_0x43ca('0x0'));var moment=require(_0x43ca('0x1'));module[_0x43ca('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x43ca('0x3')]},'secondDisposition':{'type':Sequelize[_0x43ca('0x3')]},'thirdDisposition':{'type':Sequelize[_0x43ca('0x3')]},'note':{'type':Sequelize[_0x43ca('0x3')]},'phone':{'type':Sequelize[_0x43ca('0x3')]},'read1stAt':{'type':Sequelize[_0x43ca('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x43ca('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x43ca('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x43ca('0x5')]('in',_0x43ca('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x43ca('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc01b=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','moment','exports'];(function(_0x58aa50,_0x473923){var _0x3471d6=function(_0x4208d9){while(--_0x4208d9){_0x58aa50['push'](_0x58aa50['shift']());}};_0x3471d6(++_0x473923);}(_0xc01b,0x65));var _0xbc01=function(_0x2f3cdb,_0x2f5c54){_0x2f3cdb=_0x2f3cdb-0x0;var _0x2d95d2=_0xc01b[_0x2f3cdb];return _0x2d95d2;};'use strict';var Sequelize=require(_0xbc01('0x0'));var moment=require(_0xbc01('0x1'));module[_0xbc01('0x2')]={'closed':{'type':Sequelize[_0xbc01('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xbc01('0x4')]},'secondDisposition':{'type':Sequelize[_0xbc01('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xbc01('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xbc01('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xbc01('0x6')]('in',_0xbc01('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbc01('0x3')],'defaultValue':![]}};
\ No newline at end of file
index b98f0b9..6c3c85d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f31=['Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','options','catch','create','update','body','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','User','CmContact','firstName','Messages','direction','secret','SmsAccount','Account','get','Sms','Owner','closedAt','disposition','out','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','set','apply','save','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','waiting','answered','unmanaged','total','closed','UserId','talking','SmsInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.SmsInteractionId','left_join','users','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','some','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','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','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','toString','keyBy','merge','a.key','a.mandatoryDisposition'];(function(_0x3178ba,_0x3f4ec7){var _0x57062a=function(_0x6ddf02){while(--_0x6ddf02){_0x3178ba['push'](_0x3178ba['shift']());}};_0x57062a(++_0x3f4ec7);}(_0x7f31,0x137));var _0x17f3=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0x7f31[_0x4bc428];return _0x3ca37f;};'use strict';var emlformat=require(_0x17f3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x17f3('0x1'));var jsonpatch=require(_0x17f3('0x2'));var rp=require(_0x17f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x17f3('0x4'));var util=require(_0x17f3('0x5'));var path=require(_0x17f3('0x6'));var sox=require(_0x17f3('0x7'));var csv=require('to-csv');var ejs=require(_0x17f3('0x8'));var fs=require('fs');var fs_extra=require(_0x17f3('0x9'));var _=require(_0x17f3('0xa'));var squel=require('squel');var crypto=require(_0x17f3('0xb'));var jsforce=require(_0x17f3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x17f3('0xd'));var querystring=require(_0x17f3('0xe'));var Papa=require('papaparse');var Redis=require(_0x17f3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x17f3('0x10'));var hardwareService=require(_0x17f3('0x11'));var logger=require(_0x17f3('0x12'))('api');var utils=require(_0x17f3('0x13'));var config=require(_0x17f3('0x14'));var licenseUtil=require(_0x17f3('0x15'));var db=require('../../mysqldb')['db'];config[_0x17f3('0x16')]=_[_0x17f3('0x17')](config['redis'],{'host':_0x17f3('0x18'),'port':0x18eb});var socket=require(_0x17f3('0x19'))(new Redis(config[_0x17f3('0x16')]));require(_0x17f3('0x1a'))[_0x17f3('0x1b')](socket);function respondWithStatusCode(_0x1ff5fa,_0x40cf48){_0x40cf48=_0x40cf48||0xcc;return function(_0x5e354a){if(_0x5e354a){return _0x1ff5fa[_0x17f3('0x1c')](_0x40cf48);}return _0x1ff5fa[_0x17f3('0x1d')](_0x40cf48)[_0x17f3('0x1e')]();};}function respondWithResult(_0x4900a8,_0x1b30dc){_0x1b30dc=_0x1b30dc||0xc8;return function(_0x4ad06f){if(_0x4ad06f){return _0x4900a8[_0x17f3('0x1d')](_0x1b30dc)[_0x17f3('0x1f')](_0x4ad06f);}};}function respondWithFilteredResult(_0x584f44,_0x5b174b){return function(_0x3ef61c){if(_0x3ef61c){var _0x53411a=typeof _0x5b174b[_0x17f3('0x20')]==='undefined'&&typeof _0x5b174b[_0x17f3('0x21')]==='undefined';var _0x4c888e=_0x3ef61c[_0x17f3('0x22')];var _0x3f3ba4=_0x53411a?0x0:_0x5b174b[_0x17f3('0x20')];var _0x416add=_0x53411a?_0x3ef61c['count']:_0x5b174b[_0x17f3('0x20')]+_0x5b174b[_0x17f3('0x21')];var _0xe3672b;if(_0x416add>=_0x4c888e){_0x416add=_0x4c888e;_0xe3672b=0xc8;}else{_0xe3672b=0xce;}_0x584f44[_0x17f3('0x1d')](_0xe3672b);return _0x584f44[_0x17f3('0x23')]('Content-Range',_0x3f3ba4+'-'+_0x416add+'/'+_0x4c888e)[_0x17f3('0x1f')](_0x3ef61c);}return null;};}function patchUpdates(_0x284beb){return function(_0x415740){try{jsonpatch[_0x17f3('0x24')](_0x415740,_0x284beb,!![]);}catch(_0x44470c){return BPromise['reject'](_0x44470c);}return _0x415740[_0x17f3('0x25')]();};}function saveUpdates(_0x558e0c,_0x357fb5){return function(_0x119683){if(_0x119683){return _0x119683['update'](_0x558e0c)[_0x17f3('0x26')](function(_0x423069){return _0x423069;});}return null;};}function removeEntity(_0x51b01e,_0x34f444){return function(_0x37c6df){if(_0x37c6df){return _0x37c6df[_0x17f3('0x27')]()[_0x17f3('0x26')](function(){_0x51b01e['status'](0xcc)[_0x17f3('0x1e')]();});}};}function handleEntityNotFound(_0xaecc6d,_0x1748ce){return function(_0xf4af43){if(!_0xf4af43){_0xaecc6d['sendStatus'](0x194);}return _0xf4af43;};}function handleError(_0x2d1f8d,_0x949614){_0x949614=_0x949614||0x1f4;return function(_0x4f2804){logger[_0x17f3('0x28')](_0x4f2804[_0x17f3('0x29')]);if(_0x4f2804[_0x17f3('0x2a')]){delete _0x4f2804['name'];}_0x2d1f8d[_0x17f3('0x1d')](_0x949614)[_0x17f3('0x2b')](_0x4f2804);};}function getInteractionUsers(_0x3b86a6,_0x31450c){return new BPromise(function(_0x2a5d4e,_0x23cf62){try{if(_0x31450c[_0x3b86a6['id']]){_0x3b86a6[_0x17f3('0x2c')]=_[_0x17f3('0x2d')](_0x31450c[_0x3b86a6['id']],function(_0x17e4da){return{'id':_0x17e4da['id'],'fullname':_0x17e4da[_0x17f3('0x2e')]};});}}catch(_0x1cbb31){_0x23cf62(_0x1cbb31);}_0x2a5d4e(_0x3b86a6);});}function getInteractionTags(_0x33f9ac,_0x1d183c){return new BPromise(function(_0x10a042,_0x9a2f3e){try{if(_0x33f9ac[_0x17f3('0x2f')]){_0x33f9ac[_0x17f3('0x30')]=[];_0x33f9ac[_0x17f3('0x2f')][_0x17f3('0x31')](',')[_0x17f3('0x32')](function(_0x304c96){_0x33f9ac[_0x17f3('0x30')][_0x17f3('0x33')](_0x1d183c[_0x304c96]);});}delete _0x33f9ac[_0x17f3('0x2f')];}catch(_0x46e454){_0x9a2f3e(_0x46e454);}_0x10a042(_0x33f9ac);});}function updateSmsInteraction(_0x3c9dad,_0x1bb164,_0x29366a){return new BPromise(function(_0x142385,_0x54137c){return getInteractionUsers(_0x3c9dad,_0x29366a)[_0x17f3('0x26')](function(_0x1324fa){return getInteractionTags(_0x1324fa,_0x1bb164);})[_0x17f3('0x26')](function(_0x43a034){return getStateInteraction(_0x43a034);})['then'](function(_0x54f77e){_0x142385(_0x54f77e);})['catch'](function(_0x4f896f){_0x54137c(_0x4f896f);});});}function getStateInteraction(_0xcbd2fc){return new BPromise(function(_0x853901){_0xcbd2fc[_0x17f3('0x34')]=0x0;_0xcbd2fc['talking']=0x0;_0xcbd2fc[_0x17f3('0x35')]=0x0;_0xcbd2fc[_0x17f3('0x36')]=0x0;_0xcbd2fc[_0x17f3('0x37')]=0x0;if(!_0xcbd2fc[_0x17f3('0x38')]&&!_0xcbd2fc['UserId']){_0xcbd2fc[_0x17f3('0x34')]+=0x1;}if(!_0xcbd2fc[_0x17f3('0x38')]&&_0xcbd2fc[_0x17f3('0x39')]){_0xcbd2fc[_0x17f3('0x3a')]+=0x1;if(_0xcbd2fc['waiting']){_0xcbd2fc[_0x17f3('0x34')]-=0x1;}}if(_0xcbd2fc['closed']&&_0xcbd2fc[_0x17f3('0x39')]){_0xcbd2fc[_0x17f3('0x35')]+=0x1;if(_0xcbd2fc[_0x17f3('0x3a')]){_0xcbd2fc[_0x17f3('0x3a')]-=0x1;}}if(_0xcbd2fc[_0x17f3('0x38')]&&!_0xcbd2fc['UserId']){_0xcbd2fc[_0x17f3('0x36')]+=0x1;if(_0xcbd2fc[_0x17f3('0x34')]){_0xcbd2fc[_0x17f3('0x34')]-=0x1;}}_0xcbd2fc['total']+=0x1;_0x853901(_0xcbd2fc);});}exports['index']=function(_0x20eae9,_0x5b6715){var _0x3e1e5a={},_0x4ce2a6={},_0x4ed239={'count':0x0,'rows':[]};var _0x8b3669=_[_0x17f3('0x2d')](db[_0x17f3('0x3b')][_0x17f3('0x3c')],function(_0x185fce){return{'name':_0x185fce[_0x17f3('0x3d')],'type':_0x185fce[_0x17f3('0x3e')]['key']};});_0x4ce2a6[_0x17f3('0x3f')]=_['map'](_0x8b3669,_0x17f3('0x2a'));_0x4ce2a6[_0x17f3('0x40')]=_[_0x17f3('0x41')](_0x20eae9[_0x17f3('0x40')]);_0x4ce2a6[_0x17f3('0x42')]=_[_0x17f3('0x43')](_0x4ce2a6[_0x17f3('0x3f')],_0x4ce2a6[_0x17f3('0x40')]);_0x3e1e5a[_0x17f3('0x44')]=_[_0x17f3('0x43')](_0x4ce2a6[_0x17f3('0x3f')],qs[_0x17f3('0x45')](_0x20eae9[_0x17f3('0x40')][_0x17f3('0x45')]));_0x3e1e5a[_0x17f3('0x44')]=_0x3e1e5a[_0x17f3('0x44')][_0x17f3('0x46')]?_0x3e1e5a['attributes']:_0x4ce2a6[_0x17f3('0x3f')];if(!_0x20eae9[_0x17f3('0x40')][_0x17f3('0x47')](_0x17f3('0x48'))){_0x3e1e5a[_0x17f3('0x21')]=qs[_0x17f3('0x21')](_0x20eae9[_0x17f3('0x40')][_0x17f3('0x21')]);_0x3e1e5a[_0x17f3('0x20')]=qs[_0x17f3('0x20')](_0x20eae9['query']['offset']);}_0x3e1e5a[_0x17f3('0x49')]=qs[_0x17f3('0x4a')](_0x20eae9[_0x17f3('0x40')][_0x17f3('0x4a')]);_0x3e1e5a[_0x17f3('0x4b')]=qs[_0x17f3('0x42')](_[_0x17f3('0x4c')](_0x20eae9[_0x17f3('0x40')],_0x4ce2a6[_0x17f3('0x42')]),_0x8b3669);var _0x61b634=[];var _0x554b92=squel['select']()['field']('id')['field'](_0x17f3('0x2a'))[_0x17f3('0x4d')](_0x17f3('0x4e'))[_0x17f3('0x4f')]('tools_tags');var _0x524ac9=squel[_0x17f3('0x50')]()[_0x17f3('0x4d')](_0x17f3('0x51'))[_0x17f3('0x4d')](_0x17f3('0x52'))[_0x17f3('0x4d')](_0x17f3('0x53'))[_0x17f3('0x4f')]('user_has_sms_interactions','ui')[_0x17f3('0x54')](_0x17f3('0x55'),'u','u.id\x20=\x20ui.UserId');var _0x35dbf5=squel[_0x17f3('0x50')]()[_0x17f3('0x4f')]('sms_interactions','i')['left_join'](_0x17f3('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x17f3('0x54')](_0x17f3('0x55'),'o',_0x17f3('0x57'))['left_join'](_0x17f3('0x58'),'a',_0x17f3('0x59'))[_0x17f3('0x54')](_0x17f3('0x5a'),'me',_0x17f3('0x5b'))[_0x17f3('0x54')](_0x17f3('0x5c'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x17f3('0x54')]('tools_tags','t',_0x17f3('0x5d'));var _0x520fe9=squel[_0x17f3('0x5e')]();var _0x4e29da=[];var _0x306416=squel[_0x17f3('0x5e')]();var _0x587d25;if(_0x20eae9[_0x17f3('0x40')][_0x17f3('0x5f')]){_0x587d25=as[_0x17f3('0x60')](_0x20eae9[_0x17f3('0x40')]['search']);var _0x2c0610=_0x587d25[_0x17f3('0x61')];for(var _0x37ea1a=0x0;_0x37ea1a<_0x587d25['conditions']['length'];_0x37ea1a++){var _0x48ecb7=_0x587d25[_0x17f3('0x62')][_0x37ea1a];var _0x3cd546='i';var _0x13d43a=_[_0x17f3('0x63')](_0x8b3669,['name',_0x48ecb7[_0x17f3('0x4d')]]);if(!_0x13d43a){switch(_0x48ecb7[_0x17f3('0x4d')]){case _0x17f3('0x64'):if(_0x48ecb7[_0x17f3('0x65')]==0x1){_0x35dbf5[_0x17f3('0x66')]('`'+_0x48ecb7['field']+_0x17f3('0x67'));}else{_0x35dbf5[_0x17f3('0x66')]('`'+_0x48ecb7[_0x17f3('0x4d')]+'`\x20>\x200');}break;case _0x17f3('0x68'):if(_0x48ecb7[_0x17f3('0x69')]===_0x17f3('0x6a')){if(_0x48ecb7['value'][_0x17f3('0x31')]('\x20')[_0x17f3('0x46')]>0x1){_0x520fe9[_0x2c0610](_0x17f3('0x6b'),qs['getFullTextValue'](_0x48ecb7[_0x17f3('0x65')]),null);}else{var _0x3b911d='%'+_0x48ecb7[_0x17f3('0x65')]+'%';_0x520fe9[_0x2c0610](_0x17f3('0x6c'),_0x3b911d,_0x3b911d,_0x3b911d);}}else{_0x13d43a=_['find'](_0x8b3669,[_0x17f3('0x2a'),'ContactId']);_0x48ecb7[_0x17f3('0x4d')]=_0x17f3('0x6d');_0x553c0f=as[_0x17f3('0x6e')](_0x3cd546,_0x13d43a[_0x17f3('0x3e')],_0x48ecb7);_0x520fe9[_0x2c0610](_0x553c0f[_0x17f3('0x6f')],_0x553c0f[_0x17f3('0x65')][_0x17f3('0x70')],_0x553c0f[_0x17f3('0x65')][_0x17f3('0x1e')]);}break;case'Tag':var _0x1419e6=_0x48ecb7[_0x17f3('0x65')][_0x17f3('0x31')](',')['map'](function(_0x8880b8){return Number(_0x8880b8);});_0x1419e6['forEach'](function(_0x41f05a){_0x306416['or'](_0x17f3('0x71'),'%,'+_0x41f05a+',%');});_0x4e29da=_[_0x17f3('0x72')](_0x4e29da,_0x1419e6);break;case'User':if(_0x48ecb7[_0x17f3('0x69')]===_0x17f3('0x6a')){_0x520fe9[_0x2c0610]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x48ecb7[_0x17f3('0x65')]+'%',null);}else{_0x13d43a=_[_0x17f3('0x63')](_0x8b3669,[_0x17f3('0x2a'),_0x17f3('0x39')]);_0x48ecb7[_0x17f3('0x4d')]=_0x17f3('0x39');_0x553c0f=as[_0x17f3('0x6e')](_0x3cd546,_0x13d43a['type'],_0x48ecb7);_0x520fe9[_0x2c0610](_0x553c0f[_0x17f3('0x6f')],_0x553c0f[_0x17f3('0x65')]['start'],_0x553c0f['value'][_0x17f3('0x1e')]);}break;case'body':_0x553c0f=as['buildExpression']('me',null,_0x48ecb7);_0x520fe9[_0x2c0610](_0x553c0f[_0x17f3('0x6f')],_0x553c0f[_0x17f3('0x65')]['start'],_0x553c0f[_0x17f3('0x65')][_0x17f3('0x1e')]);break;}}else{var _0x553c0f=as[_0x17f3('0x6e')](_0x3cd546,_0x13d43a[_0x17f3('0x3e')],_0x48ecb7);_0x520fe9[_0x2c0610](_0x553c0f['text'],_0x553c0f['value'][_0x17f3('0x70')],_0x553c0f[_0x17f3('0x65')][_0x17f3('0x1e')]);}}}else{var _0x22693f=_(_0x20eae9[_0x17f3('0x40')])[_0x17f3('0x41')]()['map'](function(_0x38fe0a){return _[_0x17f3('0x73')](_0x8b3669,[_0x17f3('0x2a'),_0x38fe0a])?_0x38fe0a:undefined;})['compact']()[_0x17f3('0x65')]();if(!_[_0x17f3('0x74')](_0x22693f)){_0x22693f[_0x17f3('0x32')](function(_0x3ec916){if(_0x3ec916==='SmsAccountId'){_0x35dbf5['where'](_0x17f3('0x75'),[][_0x17f3('0x76')](_0x20eae9[_0x17f3('0x40')][_0x3ec916]));}else if(_0x3ec916===_0x17f3('0x77')){var _0x2914a4=JSON[_0x17f3('0x78')](_0x20eae9['query'][_0x3ec916])[_0x17f3('0x79')];var _0x568325=JSON[_0x17f3('0x78')](_0x20eae9[_0x17f3('0x40')][_0x3ec916])[_0x17f3('0x7a')];_0x35dbf5[_0x17f3('0x4b')](_0x17f3('0x7b'),_0x2914a4,_0x568325);}else{if(_0x20eae9[_0x17f3('0x40')][_0x3ec916]==='null'){_0x35dbf5[_0x17f3('0x4b')]('i.'+_0x3ec916+_0x17f3('0x7c'));}else{_0x35dbf5[_0x17f3('0x4b')]('i.'+_0x3ec916+_0x17f3('0x7d'),_0x20eae9['query'][_0x3ec916]);}}});}if(_0x20eae9[_0x17f3('0x40')][_0x17f3('0x7e')]){if(_0x20eae9[_0x17f3('0x40')][_0x17f3('0x7e')]==0x1){_0x35dbf5['having'](_0x17f3('0x7f'));}else{_0x35dbf5[_0x17f3('0x66')](_0x17f3('0x80'));}}if(_0x20eae9[_0x17f3('0x40')][_0x17f3('0x81')]){_0x4e29da=_['isArray'](_0x20eae9[_0x17f3('0x40')][_0x17f3('0x81')])?_0x20eae9[_0x17f3('0x40')][_0x17f3('0x81')]:new Array(_0x20eae9[_0x17f3('0x40')][_0x17f3('0x81')]);_0x4e29da[_0x17f3('0x32')](function(_0xf85d5b){_0x306416['or'](_0x17f3('0x71'),'%,'+_0xf85d5b+',%');});}if(_0x20eae9[_0x17f3('0x40')]['filter']){var _0x20c5ac=_0x20eae9['query'][_0x17f3('0x82')][_0x17f3('0x83')]('\x5c','\x5c\x5c')[_0x17f3('0x83')](/'/g,'\x27\x27');if(qs[_0x17f3('0x84')](_0x20c5ac)){_0x520fe9['or']('i.id\x20LIKE\x20?',_0x20c5ac+'%')['or'](_0x17f3('0x85'),_0x20c5ac+'%');}else{_0x520fe9['or'](_0x17f3('0x86'),qs['getFullTextValue'](_0x20c5ac))['or'](_0x17f3('0x87'),_0x20c5ac+'%');}}}_0x35dbf5[_0x17f3('0x4b')](_0x520fe9);_0x35dbf5[_0x17f3('0x88')](_0x17f3('0x89'));var _0x45c738={'type':db['Sequelize'][_0x17f3('0x8a')][_0x17f3('0x8b')],'raw':!![]};var _0x4da1be=_0x35dbf5[_0x17f3('0x8c')]();_0x4da1be[_0x17f3('0x4d')]('i.id');_0x4da1be['field'](_0x17f3('0x8d'),_0x17f3('0x64'));if(_0x3e1e5a[_0x17f3('0x49')]){_0x3e1e5a[_0x17f3('0x49')][_0x17f3('0x32')](function(_0x296814){var _0x580c9a=_0x296814[0x0]===_0x17f3('0x8e')?_0x296814[0x0]:'i.'+_0x296814[0x0];_0x35dbf5[_0x17f3('0x49')](_0x580c9a,_0x296814[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x4e29da)){_0x35dbf5['having'](_0x306416);_0x4da1be[_0x17f3('0x4b')]('t.id\x20IN\x20?',_0x4e29da);}BPromise[_0x17f3('0x8f')]()[_0x17f3('0x26')](function(){if(!_0x587d25){if(_0x20eae9['query'][_0x17f3('0x90')])return;_0x4da1be[_0x17f3('0x4b')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x35dbf5[_0x17f3('0x4b')](_0x17f3('0x91'));return;}if(_0x20eae9[_0x17f3('0x92')][_0x17f3('0x93')]!==_0x17f3('0x94'))return;return _0x20eae9[_0x17f3('0x92')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x17f3('0x26')](function(_0x3a430a){if(_[_0x17f3('0x74')](_0x3a430a)){_0x4da1be[_0x17f3('0x4b')](_0x17f3('0x95'));_0x35dbf5['where'](_0x17f3('0x95'));}else{_0x4da1be[_0x17f3('0x4b')]('i.SmsAccountId\x20IN\x20?',_[_0x17f3('0x2d')](_0x3a430a,'id'));_0x35dbf5[_0x17f3('0x4b')](_0x17f3('0x75'),_[_0x17f3('0x2d')](_0x3a430a,'id'));}});})[_0x17f3('0x26')](function(){if(_0x20eae9[_0x17f3('0x92')][_0x17f3('0x93')]===_0x17f3('0x94')&&!_0x587d25&&!_0x20eae9['query'][_0x17f3('0x90')])return[];return db['sequelize']['query'](_0x4da1be[_0x17f3('0x96')](),_0x45c738);})['then'](function(_0x1974af){_0x4ed239[_0x17f3('0x22')]=_0x1974af[_0x17f3('0x46')];if(_0x4ed239[_0x17f3('0x22')]===0x0)return[];return db['sequelize']['query'](_0x554b92['toString'](),_0x45c738)['then'](function(_0x2dd179){_0x61b634=_[_0x17f3('0x97')](_0x2dd179,'id');_0x45c738=_[_0x17f3('0x98')](_0x45c738,{'model':db[_0x17f3('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x20eae9[_0x17f3('0x40')][_0x17f3('0x45')]){_0x3e1e5a[_0x17f3('0x44')][_0x17f3('0x32')](function(_0x30e437){_0x35dbf5['field']('i.'+_0x30e437);});}else{_0x35dbf5[_0x17f3('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x17f3('0x64'));_0x35dbf5[_0x17f3('0x4d')](_0x17f3('0x99'),'Account.key');_0x35dbf5[_0x17f3('0x4d')](_0x17f3('0x9a'),_0x17f3('0x9b'));_0x35dbf5['field'](_0x17f3('0x9c'),_0x17f3('0x8e'));_0x35dbf5['field'](_0x17f3('0x9d'));_0x35dbf5[_0x17f3('0x4d')](_0x17f3('0x9e'),_0x17f3('0x9f'));_0x35dbf5['field'](_0x17f3('0xa0'),_0x17f3('0xa1'));_0x35dbf5[_0x17f3('0x4d')](_0x17f3('0xa2'),_0x17f3('0xa3'));_0x35dbf5[_0x17f3('0x4d')](_0x17f3('0xa4'),_0x17f3('0xa5'));_0x35dbf5['field'](_0x17f3('0xa6'),'Contact.mobile');_0x35dbf5['field']('c.fax',_0x17f3('0xa7'));_0x35dbf5[_0x17f3('0x4d')](_0x17f3('0xa8'),_0x17f3('0xa9'));_0x35dbf5['field'](_0x17f3('0xaa'),'Owner.internal');_0x35dbf5[_0x17f3('0x4d')](_0x17f3('0xab'),'TagIds');}if(_0x3e1e5a['limit'])_0x35dbf5[_0x17f3('0x21')](_0x3e1e5a[_0x17f3('0x21')]);if(_0x3e1e5a[_0x17f3('0x20')])_0x35dbf5[_0x17f3('0x20')](_0x3e1e5a[_0x17f3('0x20')]);return db[_0x17f3('0xac')][_0x17f3('0x40')](_0x35dbf5[_0x17f3('0x96')](),_0x45c738);})[_0x17f3('0x26')](function(_0x4533fd){if(_0x4533fd[_0x17f3('0x46')]>0x0)_0x524ac9[_0x17f3('0x4b')](_0x17f3('0xad'),_[_0x17f3('0x2d')](_0x4533fd,'id'));return db[_0x17f3('0xac')][_0x17f3('0x40')](_0x524ac9[_0x17f3('0x96')](),_0x45c738)[_0x17f3('0x26')](function(_0xab4d2e){var _0x3d6d81=_[_0x17f3('0xae')](_0xab4d2e,_0x17f3('0xaf'));var _0x1d2846=[];_0x4533fd[_0x17f3('0x32')](function(_0xe2ee56){_0x1d2846['push'](updateSmsInteraction(_0xe2ee56,_0x61b634,_0x3d6d81));});return BPromise[_0x17f3('0xb0')](_0x1d2846);});});})[_0x17f3('0x26')](function(_0x3e69a1){_0x4ed239[_0x17f3('0xb1')]=_0x3e69a1;return _0x4ed239;})['then'](respondWithFilteredResult(_0x5b6715,_0x3e1e5a))['catch'](handleError(_0x5b6715,null));};exports[_0x17f3('0xb2')]=function(_0x2816ec,_0x46ea76){var _0x8d715e={'raw':![],'where':{'id':_0x2816ec[_0x17f3('0xb3')]['id']}},_0x298220={};_0x298220[_0x17f3('0x3f')]=_[_0x17f3('0x41')](db[_0x17f3('0x3b')]['rawAttributes']);_0x298220[_0x17f3('0x40')]=_[_0x17f3('0x41')](_0x2816ec[_0x17f3('0x40')]);_0x298220[_0x17f3('0x42')]=_['intersection'](_0x298220[_0x17f3('0x3f')],_0x298220['query']);_0x8d715e['attributes']=_[_0x17f3('0x43')](_0x298220['model'],qs[_0x17f3('0x45')](_0x2816ec[_0x17f3('0x40')][_0x17f3('0x45')]));_0x8d715e[_0x17f3('0x44')]=_0x8d715e['attributes']['length']?_0x8d715e[_0x17f3('0x44')]:_0x298220[_0x17f3('0x3f')];if(_0x2816ec[_0x17f3('0x40')][_0x17f3('0xb4')]){_0x8d715e[_0x17f3('0xb5')]=[{'all':!![]}];}_0x8d715e=_[_0x17f3('0x98')]({},_0x8d715e,_0x2816ec[_0x17f3('0xb6')]);return db[_0x17f3('0x3b')]['find'](_0x8d715e)[_0x17f3('0x26')](handleEntityNotFound(_0x46ea76,null))[_0x17f3('0x26')](respondWithResult(_0x46ea76,null))[_0x17f3('0xb7')](handleError(_0x46ea76,null));};exports['create']=function(_0x29bd20,_0x1c570b){return db[_0x17f3('0x3b')][_0x17f3('0xb8')](_0x29bd20['body'],{})[_0x17f3('0x26')](respondWithResult(_0x1c570b,0xc9))['catch'](handleError(_0x1c570b,null));};exports[_0x17f3('0xb9')]=function(_0x2bf213,_0x28c913){if(_0x2bf213[_0x17f3('0xba')]['id']){delete _0x2bf213[_0x17f3('0xba')]['id'];}return db[_0x17f3('0x3b')]['find']({'where':{'id':_0x2bf213[_0x17f3('0xb3')]['id']}})[_0x17f3('0x26')](handleEntityNotFound(_0x28c913,null))[_0x17f3('0x26')](saveUpdates(_0x2bf213['body'],null))[_0x17f3('0x26')](respondWithResult(_0x28c913,null))[_0x17f3('0xb7')](handleError(_0x28c913,null));};exports[_0x17f3('0x27')]=function(_0x23789c,_0x308eb9){return db['SmsInteraction'][_0x17f3('0x63')]({'where':{'id':_0x23789c[_0x17f3('0xb3')]['id']}})['then'](handleEntityNotFound(_0x308eb9,null))['then'](removeEntity(_0x308eb9,null))[_0x17f3('0xb7')](handleError(_0x308eb9,null));};exports[_0x17f3('0xbb')]=function(_0x5de344,_0x171c3a){return db[_0x17f3('0x3b')][_0x17f3('0xbb')]()[_0x17f3('0x26')](respondWithResult(_0x171c3a,null))[_0x17f3('0xb7')](handleError(_0x171c3a,null));};exports[_0x17f3('0xbc')]=function(_0x1eeda8,_0x4a69ef,_0x1d0aa4){return db[_0x17f3('0xbd')][_0x17f3('0x63')]({'where':{'id':_0x1eeda8[_0x17f3('0xb3')]['id']}})[_0x17f3('0x26')](handleEntityNotFound(_0x4a69ef,null))[_0x17f3('0x26')](function(_0xb87c50){if(_0xb87c50){return _0xb87c50['addMessage'](_0x1eeda8['body'][_0x17f3('0xbe')],_[_0x17f3('0xbf')](_0x1eeda8['body'],[_0x17f3('0xbe'),'id'])||{});}})[_0x17f3('0x26')](respondWithResult(_0x4a69ef,null))[_0x17f3('0xb7')](handleError(_0x4a69ef,null));};exports[_0x17f3('0xc0')]=function(_0x487ef8,_0x5cd07d,_0x5b4ec9){var _0x35b16b={'raw':![],'where':{}};var _0x43f7a6={};var _0x4f50f6={'count':0x0,'rows':[]};return db[_0x17f3('0x3b')][_0x17f3('0xc1')]({'where':{'id':_0x487ef8[_0x17f3('0xb3')]['id']}})[_0x17f3('0x26')](handleEntityNotFound(_0x5cd07d,null))['then'](function(_0x4725fb){if(_0x4725fb){_0x43f7a6['model']=_[_0x17f3('0x41')](db['SmsMessage'][_0x17f3('0x3c')]);_0x43f7a6['query']=_[_0x17f3('0x41')](_0x487ef8['query']);_0x43f7a6['filters']=_[_0x17f3('0x43')](_0x43f7a6[_0x17f3('0x3f')],_0x43f7a6[_0x17f3('0x40')]);_0x35b16b['attributes']=_[_0x17f3('0x43')](_0x43f7a6[_0x17f3('0x3f')],qs[_0x17f3('0x45')](_0x487ef8[_0x17f3('0x40')][_0x17f3('0x45')]));_0x35b16b[_0x17f3('0x44')]=_0x35b16b[_0x17f3('0x44')]['length']?_0x35b16b[_0x17f3('0x44')]:_0x43f7a6[_0x17f3('0x3f')];if(!_0x487ef8[_0x17f3('0x40')]['hasOwnProperty'](_0x17f3('0x48'))){_0x35b16b['limit']=qs[_0x17f3('0x21')](_0x487ef8[_0x17f3('0x40')][_0x17f3('0x21')]);_0x35b16b[_0x17f3('0x20')]=qs['offset'](_0x487ef8[_0x17f3('0x40')][_0x17f3('0x20')]);}_0x35b16b[_0x17f3('0x49')]=qs[_0x17f3('0x4a')](_0x487ef8[_0x17f3('0x40')]['sort']);_0x35b16b[_0x17f3('0x4b')]=qs[_0x17f3('0x42')](_[_0x17f3('0x4c')](_0x487ef8[_0x17f3('0x40')],_0x43f7a6[_0x17f3('0x42')]));_0x35b16b[_0x17f3('0x4b')][_0x17f3('0xaf')]=_0x4725fb['id'];if(_0x487ef8[_0x17f3('0x40')][_0x17f3('0x82')]){_0x35b16b['where']=_[_0x17f3('0x98')](_0x35b16b[_0x17f3('0x4b')],{'$or':_[_0x17f3('0x2d')](_0x35b16b[_0x17f3('0x44')],function(_0x490592){var _0x5e9c59={};_0x5e9c59[_0x490592]={'$like':'%'+_0x487ef8[_0x17f3('0x40')]['filter']+'%'};return _0x5e9c59;})});}if(_0x487ef8[_0x17f3('0x40')][_0x17f3('0x79')]){var _0x226832=_0x487ef8[_0x17f3('0x40')][_0x17f3('0x79')][_0x17f3('0x31')](',');var _0x1412e4={};_0x1412e4[_0x226832[0x0]]={'$gte':moment(_0x226832[0x1])[_0x17f3('0xc2')](_0x17f3('0xc3'))};_0x35b16b[_0x17f3('0x4b')]=_[_0x17f3('0x98')](_0x35b16b[_0x17f3('0x4b')],_0x1412e4);}_0x35b16b=_[_0x17f3('0x98')]({},_0x35b16b,_0x487ef8[_0x17f3('0xb6')]);return db[_0x17f3('0xbd')][_0x17f3('0x22')]({'where':_0x35b16b[_0x17f3('0x4b')]})[_0x17f3('0x26')](function(_0x295028){_0x4f50f6[_0x17f3('0x22')]=_0x295028;if(_0x487ef8['query']['includeAll']){_0x35b16b[_0x17f3('0xb5')]=[{'all':!![]}];}return db[_0x17f3('0xbd')][_0x17f3('0xc4')](_0x35b16b);})['then'](function(_0x52704c){_0x4f50f6[_0x17f3('0xb1')]=_0x52704c;return _0x4f50f6;});}})['then'](respondWithFilteredResult(_0x5cd07d,_0x35b16b))[_0x17f3('0xb7')](handleError(_0x5cd07d,null));};exports[_0x17f3('0xc5')]=function(_0x488865,_0x347400,_0x2ca166){return db[_0x17f3('0x3b')][_0x17f3('0x63')]({'where':{'id':_0x488865[_0x17f3('0xb3')]['id']}})[_0x17f3('0x26')](handleEntityNotFound(_0x347400,null))[_0x17f3('0x26')](function(_0x4d7784){if(_0x4d7784){return _0x4d7784['setTags'](_0x488865['body'][_0x17f3('0xbe')],_['omit'](_0x488865['body'],[_0x17f3('0xbe'),'id'])||{})[_0x17f3('0xc6')](function(){return db['Tag'][_0x17f3('0xc4')]({'attributes':['id','name','color'],'where':{'id':_0x488865[_0x17f3('0xba')][_0x17f3('0xbe')]}});})['then'](function(_0x2f3900){socket[_0x17f3('0xc7')]('smsInteractionTags:save',{'id':Number(_0x488865[_0x17f3('0xb3')]['id']),'tags':_0x2f3900||[]});return{'id':Number(_0x488865[_0x17f3('0xb3')]['id']),'tags':_0x2f3900||[]};});}})[_0x17f3('0x26')](respondWithResult(_0x347400,null))['catch'](handleError(_0x347400,null));};exports['removeTags']=function(_0xc2433c,_0x279198,_0x9a9bfb){return db[_0x17f3('0x3b')][_0x17f3('0x63')]({'where':{'id':_0xc2433c['params']['id']}})[_0x17f3('0x26')](handleEntityNotFound(_0x279198,null))[_0x17f3('0x26')](function(_0xd3112a){if(_0xd3112a){return _0xd3112a[_0x17f3('0xc8')](_0xc2433c[_0x17f3('0x40')][_0x17f3('0xbe')]);}})[_0x17f3('0x26')](respondWithStatusCode(_0x279198,null))[_0x17f3('0xb7')](handleError(_0x279198,null));};exports[_0x17f3('0xc9')]=function(_0x2c6ba8,_0x433334){var _0x28687=moment()[_0x17f3('0xca')]()['toString']();var _0x500cc9=path[_0x17f3('0xcb')](config[_0x17f3('0xcc')],_0x17f3('0xcd'),'files','tmp');var _0x27f049=path[_0x17f3('0xcb')](config[_0x17f3('0xcc')],_0x17f3('0xcd'),_0x17f3('0xce'),_0x17f3('0xcf'));var _0x4a1386=path['join'](_0x500cc9,_0x28687);var _0x56ec08=util[_0x17f3('0xc2')](_0x17f3('0xd0'),_0x2c6ba8['params']['id'],_0x28687);var _0x4b2b3f=path['join'](_0x500cc9,_0x56ec08);var _0x15a346=[];_0x15a346[_0x17f3('0x33')]({'model':db[_0x17f3('0xd1')],'as':_0x17f3('0xd1'),'attributes':['id','fullname'],'raw':!![]});_0x15a346['push']({'model':db[_0x17f3('0xd2')],'as':'Contact','attributes':['id',_0x17f3('0xd3'),'lastName'],'raw':!![]});var _0xe0a278=[{'model':db[_0x17f3('0xbd')],'as':_0x17f3('0xd4'),'attributes':['id',_0x17f3('0xba'),_0x17f3('0x77'),_0x17f3('0xd5'),_0x17f3('0xd6'),_0x17f3('0x7e')],'include':_0x15a346}];_0xe0a278[_0x17f3('0x33')]({'model':db[_0x17f3('0xd7')],'as':_0x17f3('0xd8'),'attributes':['id',_0x17f3('0x2a')]});_0xe0a278['push']({'model':db[_0x17f3('0xd1')],'as':'Owner','attributes':['id',_0x17f3('0x2e')]});return db[_0x17f3('0x3b')]['find']({'where':{'id':_0x2c6ba8[_0x17f3('0xb3')]['id']},'include':_0xe0a278})[_0x17f3('0x26')](handleEntityNotFound(_0x433334,null))[_0x17f3('0x26')](function(_0x51d155){if(_0x51d155){var _0x545574=_0x51d155[_0x17f3('0xd9')]({'plain':!![]});fs['mkdirSync'](_0x4a1386);var _0x568881={'channel':_0x17f3('0xda'),'account':_0x545574[_0x17f3('0xd8')][_0x17f3('0x2a')],'agent':_0x545574[_0x17f3('0xdb')]?_0x545574[_0x17f3('0xdb')][_0x17f3('0x2e')]:'N.A.','createdAt':moment(_0x545574[_0x17f3('0x77')])[_0x17f3('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x17f3('0x96')](),'closedAt':_0x545574[_0x17f3('0x38')]?moment(_0x545574[_0x17f3('0xdc')])[_0x17f3('0xc2')](_0x17f3('0xc3'))[_0x17f3('0x96')]():'','disposition':_0x545574[_0x17f3('0xdd')],'messages':_(_0x545574['Messages'])['filter']({'secret':![]})[_0x17f3('0x2d')](function(_0x135b7d){return{'date':moment(_0x135b7d['createdAt'])[_0x17f3('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x17f3('0x96')](),'sender':_0x135b7d[_0x17f3('0xd5')]===_0x17f3('0xde')?_0x135b7d[_0x17f3('0xd1')]?_0x135b7d[_0x17f3('0xd1')]['fullname']:'System':_0x135b7d[_0x17f3('0x68')][_0x17f3('0xd3')]+(_0x135b7d[_0x17f3('0x68')]['lastName']?'\x20'+_0x135b7d[_0x17f3('0x68')][_0x17f3('0xdf')]:''),'body':_0x135b7d['body'],'direction':_0x135b7d[_0x17f3('0xd5')]==='out'?'A':'C','secret':_0x135b7d[_0x17f3('0xd6')],'read':_0x135b7d[_0x17f3('0x7e')]};})[_0x17f3('0x65')]()};return ejs[_0x17f3('0xe0')](path['join'](config[_0x17f3('0xcc')],'server',_0x17f3('0xe1'),_0x17f3('0xe2')),{'interaction':_0x568881})[_0x17f3('0x26')](function(_0x2375a2){var _0x5cae12=path[_0x17f3('0xcb')](_0x4a1386,_0x17f3('0xe3')+_0x545574['id']+'-'+_0x28687+_0x17f3('0xe4'));var _0x5c6127={'path':_0x5cae12,'channel':'Sms','interactionId':_0x545574['id']};return pdf[_0x17f3('0xe5')](_0x2375a2,_0x5c6127);})['then'](function(){return new BPromise(function(_0x1fa255,_0x48c764){zipdir(_0x4a1386,{'saveTo':_0x4b2b3f},function(_0x2d4119,_0x3059b9){if(_0x2d4119)return _0x48c764(_0x2d4119);return _0x1fa255(_0x3059b9);});})[_0x17f3('0x26')](function(){return new BPromise(function(_0x42d42b,_0x589a43){rimraf(_0x4a1386,function(_0x318826){if(_0x318826)_0x589a43(_0x318826);return _0x42d42b();});});})[_0x17f3('0x26')](function(){return _0x433334[_0x17f3('0xc9')](_0x4b2b3f,_0x56ec08,function(_0x332cb3){if(_0x332cb3){console[_0x17f3('0xe6')](_0x17f3('0xe7'),_0x332cb3);}else{fs[_0x17f3('0xe8')](_0x4b2b3f);}});});});}else{return _0x433334[_0x17f3('0x1c')](0xc8);}})[_0x17f3('0xb7')](handleError(_0x433334,null));};
\ No newline at end of file
+var _0x3767=['ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','Users','map','Tags','TagIds','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','UserId','closed','SmsInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','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','body','keys','compact','isEmpty','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','role','agent','toString','count','sequelize','keyBy','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.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','show','includeAll','include','merge','options','create','params','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','fullname','CmContact','firstName','Messages','direction','secret','SmsAccount','get','mkdirSync','Sms','Account','Owner','N.A.','System','lastName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3767,0x1d7));var _0x7376=function(_0x435afd,_0x2b7865){_0x435afd=_0x435afd-0x0;var _0x7a959=_0x3767[_0x435afd];return _0x7a959;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7376('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7376('0x1'));var rp=require(_0x7376('0x2'));var moment=require(_0x7376('0x3'));var BPromise=require(_0x7376('0x4'));var Mustache=require(_0x7376('0x5'));var util=require(_0x7376('0x6'));var path=require(_0x7376('0x7'));var sox=require('sox');var csv=require(_0x7376('0x8'));var ejs=require(_0x7376('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7376('0xa'));var squel=require('squel');var crypto=require(_0x7376('0xb'));var jsforce=require(_0x7376('0xc'));var deskjs=require(_0x7376('0xd'));var toCsv=require(_0x7376('0x8'));var querystring=require(_0x7376('0xe'));var Papa=require(_0x7376('0xf'));var Redis=require(_0x7376('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7376('0x11'));var pdf=require(_0x7376('0x12'));var hardwareService=require(_0x7376('0x13'));var logger=require('../../config/logger')(_0x7376('0x14'));var utils=require(_0x7376('0x15'));var config=require(_0x7376('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7376('0x17'))['db'];config[_0x7376('0x18')]=_[_0x7376('0x19')](config[_0x7376('0x18')],{'host':_0x7376('0x1a'),'port':0x18eb});var socket=require(_0x7376('0x1b'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x7376('0x1c')](socket);function respondWithStatusCode(_0x2606b9,_0x5a9dd4){_0x5a9dd4=_0x5a9dd4||0xcc;return function(_0x3e1d40){if(_0x3e1d40){return _0x2606b9[_0x7376('0x1d')](_0x5a9dd4);}return _0x2606b9['status'](_0x5a9dd4)['end']();};}function respondWithResult(_0x1d4a80,_0x8cc02d){_0x8cc02d=_0x8cc02d||0xc8;return function(_0x218d5d){if(_0x218d5d){return _0x1d4a80[_0x7376('0x1e')](_0x8cc02d)[_0x7376('0x1f')](_0x218d5d);}};}function respondWithFilteredResult(_0x459c9f,_0x3b79ef){return function(_0x3daf25){if(_0x3daf25){var _0x504d41=typeof _0x3b79ef['offset']===_0x7376('0x20')&&typeof _0x3b79ef[_0x7376('0x21')]===_0x7376('0x20');var _0x7e8b92=_0x3daf25['count'];var _0x201dd2=_0x504d41?0x0:_0x3b79ef[_0x7376('0x22')];var _0x83e6fc=_0x504d41?_0x3daf25['count']:_0x3b79ef[_0x7376('0x22')]+_0x3b79ef[_0x7376('0x21')];var _0x31ef72;if(_0x83e6fc>=_0x7e8b92){_0x83e6fc=_0x7e8b92;_0x31ef72=0xc8;}else{_0x31ef72=0xce;}_0x459c9f[_0x7376('0x1e')](_0x31ef72);return _0x459c9f[_0x7376('0x23')](_0x7376('0x24'),_0x201dd2+'-'+_0x83e6fc+'/'+_0x7e8b92)['json'](_0x3daf25);}return null;};}function patchUpdates(_0xe31217){return function(_0x2c649e){try{jsonpatch[_0x7376('0x25')](_0x2c649e,_0xe31217,!![]);}catch(_0x40dcb8){return BPromise[_0x7376('0x26')](_0x40dcb8);}return _0x2c649e['save']();};}function saveUpdates(_0x1ca7ee,_0x4d5c4){return function(_0x151cb8){if(_0x151cb8){return _0x151cb8[_0x7376('0x27')](_0x1ca7ee)[_0x7376('0x28')](function(_0x4d4751){return _0x4d4751;});}return null;};}function removeEntity(_0x3f00c5,_0x26994a){return function(_0x594f43){if(_0x594f43){return _0x594f43[_0x7376('0x29')]()[_0x7376('0x28')](function(){_0x3f00c5[_0x7376('0x1e')](0xcc)[_0x7376('0x2a')]();});}};}function handleEntityNotFound(_0x562c86,_0x2475d1){return function(_0x14db2e){if(!_0x14db2e){_0x562c86[_0x7376('0x1d')](0x194);}return _0x14db2e;};}function handleError(_0x1fda88,_0xf37744){_0xf37744=_0xf37744||0x1f4;return function(_0x16f96a){logger['error'](_0x16f96a[_0x7376('0x2b')]);if(_0x16f96a[_0x7376('0x2c')]){delete _0x16f96a[_0x7376('0x2c')];}_0x1fda88[_0x7376('0x1e')](_0xf37744)[_0x7376('0x2d')](_0x16f96a);};}function getInteractionUsers(_0x5a3a7e,_0x2faa9d){return new BPromise(function(_0x43841b,_0x501d78){try{if(_0x2faa9d[_0x5a3a7e['id']]){_0x5a3a7e[_0x7376('0x2e')]=_[_0x7376('0x2f')](_0x2faa9d[_0x5a3a7e['id']],function(_0x34d5ac){return{'id':_0x34d5ac['id'],'fullname':_0x34d5ac['fullname']};});}}catch(_0x440a12){_0x501d78(_0x440a12);}_0x43841b(_0x5a3a7e);});}function getInteractionTags(_0x50a9ed,_0x4cae9a){return new BPromise(function(_0x5abdf2,_0x1b08bd){try{if(_0x50a9ed['TagIds']){_0x50a9ed[_0x7376('0x30')]=[];_0x50a9ed[_0x7376('0x31')][_0x7376('0x32')](',')[_0x7376('0x33')](function(_0x499dd8){_0x50a9ed['Tags'][_0x7376('0x34')](_0x4cae9a[_0x499dd8]);});}delete _0x50a9ed[_0x7376('0x31')];}catch(_0x47b7ca){_0x1b08bd(_0x47b7ca);}_0x5abdf2(_0x50a9ed);});}function updateSmsInteraction(_0x30932b,_0x2457e2,_0xa20119){return new BPromise(function(_0x2ccfa8,_0x1ebc9b){return getInteractionUsers(_0x30932b,_0xa20119)[_0x7376('0x28')](function(_0x39746d){return getInteractionTags(_0x39746d,_0x2457e2);})[_0x7376('0x28')](function(_0x2d9355){return getStateInteraction(_0x2d9355);})[_0x7376('0x28')](function(_0x580586){_0x2ccfa8(_0x580586);})[_0x7376('0x35')](function(_0x5e76d4){_0x1ebc9b(_0x5e76d4);});});}function getStateInteraction(_0x201433){return new BPromise(function(_0x383043){_0x201433[_0x7376('0x36')]=0x0;_0x201433[_0x7376('0x37')]=0x0;_0x201433[_0x7376('0x38')]=0x0;_0x201433[_0x7376('0x39')]=0x0;_0x201433[_0x7376('0x3a')]=0x0;if(!_0x201433['closed']&&!_0x201433[_0x7376('0x3b')]){_0x201433[_0x7376('0x36')]+=0x1;}if(!_0x201433[_0x7376('0x3c')]&&_0x201433[_0x7376('0x3b')]){_0x201433[_0x7376('0x37')]+=0x1;if(_0x201433[_0x7376('0x36')]){_0x201433[_0x7376('0x36')]-=0x1;}}if(_0x201433[_0x7376('0x3c')]&&_0x201433[_0x7376('0x3b')]){_0x201433[_0x7376('0x38')]+=0x1;if(_0x201433[_0x7376('0x37')]){_0x201433['talking']-=0x1;}}if(_0x201433[_0x7376('0x3c')]&&!_0x201433['UserId']){_0x201433['unmanaged']+=0x1;if(_0x201433[_0x7376('0x36')]){_0x201433[_0x7376('0x36')]-=0x1;}}_0x201433['total']+=0x1;_0x383043(_0x201433);});}exports['index']=function(_0x1ff01e,_0xef0c8){var _0x1b6fc3={},_0x1caf18={},_0x1996d1={'count':0x0,'rows':[]};var _0x571d94=_[_0x7376('0x2f')](db[_0x7376('0x3d')][_0x7376('0x3e')],function(_0x32cdc6){return{'name':_0x32cdc6[_0x7376('0x3f')],'type':_0x32cdc6[_0x7376('0x40')][_0x7376('0x41')]};});_0x1caf18[_0x7376('0x42')]=_[_0x7376('0x2f')](_0x571d94,'name');_0x1caf18[_0x7376('0x43')]=_['keys'](_0x1ff01e['query']);_0x1caf18[_0x7376('0x44')]=_['intersection'](_0x1caf18[_0x7376('0x42')],_0x1caf18['query']);_0x1b6fc3['attributes']=_[_0x7376('0x45')](_0x1caf18[_0x7376('0x42')],qs[_0x7376('0x46')](_0x1ff01e[_0x7376('0x43')][_0x7376('0x46')]));_0x1b6fc3['attributes']=_0x1b6fc3['attributes'][_0x7376('0x47')]?_0x1b6fc3[_0x7376('0x48')]:_0x1caf18[_0x7376('0x42')];if(!_0x1ff01e['query'][_0x7376('0x49')](_0x7376('0x4a'))){_0x1b6fc3[_0x7376('0x21')]=qs['limit'](_0x1ff01e[_0x7376('0x43')][_0x7376('0x21')]);_0x1b6fc3['offset']=qs[_0x7376('0x22')](_0x1ff01e['query'][_0x7376('0x22')]);}_0x1b6fc3[_0x7376('0x4b')]=qs[_0x7376('0x4c')](_0x1ff01e[_0x7376('0x43')][_0x7376('0x4c')]);_0x1b6fc3[_0x7376('0x4d')]=qs[_0x7376('0x44')](_[_0x7376('0x4e')](_0x1ff01e[_0x7376('0x43')],_0x1caf18[_0x7376('0x44')]),_0x571d94);var _0x1922c7=[];var _0x3db5d6=squel[_0x7376('0x4f')]()[_0x7376('0x50')]('id')[_0x7376('0x50')](_0x7376('0x2c'))[_0x7376('0x50')](_0x7376('0x51'))[_0x7376('0x52')](_0x7376('0x53'));var _0x3070ef=squel[_0x7376('0x4f')]()[_0x7376('0x50')](_0x7376('0x54'))[_0x7376('0x50')](_0x7376('0x55'))[_0x7376('0x50')](_0x7376('0x56'))[_0x7376('0x52')](_0x7376('0x57'),'ui')[_0x7376('0x58')]('users','u','u.id\x20=\x20ui.UserId');var _0x31bfc9=squel[_0x7376('0x4f')]()[_0x7376('0x52')]('sms_interactions','i')[_0x7376('0x58')](_0x7376('0x59'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x7376('0x5a'),'o',_0x7376('0x5b'))[_0x7376('0x58')](_0x7376('0x5c'),'a',_0x7376('0x5d'))['left_join'](_0x7376('0x5e'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join']('sms_interaction_has_tags','it',_0x7376('0x5f'))[_0x7376('0x58')]('tools_tags','t',_0x7376('0x60'));var _0x36c091=squel['expr']();var _0x305461=[];var _0x2c4cfb=squel[_0x7376('0x61')]();var _0x2f9324;if(_0x1ff01e[_0x7376('0x43')]['search']){_0x2f9324=as[_0x7376('0x62')](_0x1ff01e[_0x7376('0x43')][_0x7376('0x63')]);var _0x2adf6d=_0x2f9324['sqlOperator'];for(var _0x4999ee=0x0;_0x4999ee<_0x2f9324['conditions'][_0x7376('0x47')];_0x4999ee++){var _0x2885df=_0x2f9324[_0x7376('0x64')][_0x4999ee];var _0x38aa82='i';var _0x476c45=_[_0x7376('0x65')](_0x571d94,['name',_0x2885df[_0x7376('0x50')]]);if(!_0x476c45){switch(_0x2885df['field']){case _0x7376('0x66'):if(_0x2885df[_0x7376('0x67')]==0x1){_0x31bfc9[_0x7376('0x68')]('`'+_0x2885df[_0x7376('0x50')]+_0x7376('0x69'));}else{_0x31bfc9[_0x7376('0x68')]('`'+_0x2885df['field']+_0x7376('0x6a'));}break;case _0x7376('0x6b'):if(_0x2885df[_0x7376('0x6c')]===_0x7376('0x6d')){if(_0x2885df[_0x7376('0x67')][_0x7376('0x32')]('\x20')['length']>0x1){_0x36c091[_0x2adf6d](_0x7376('0x6e'),qs[_0x7376('0x6f')](_0x2885df['value']),null);}else{var _0x15ebd0='%'+_0x2885df[_0x7376('0x67')]+'%';_0x36c091[_0x2adf6d](_0x7376('0x70'),_0x15ebd0,_0x15ebd0,_0x15ebd0);}}else{_0x476c45=_[_0x7376('0x65')](_0x571d94,[_0x7376('0x2c'),_0x7376('0x71')]);_0x2885df[_0x7376('0x50')]=_0x7376('0x71');_0x1b8ccf=as['buildExpression'](_0x38aa82,_0x476c45[_0x7376('0x40')],_0x2885df);_0x36c091[_0x2adf6d](_0x1b8ccf[_0x7376('0x72')],_0x1b8ccf['value'][_0x7376('0x73')],_0x1b8ccf['value'][_0x7376('0x2a')]);}break;case _0x7376('0x74'):var _0x411121=_0x2885df[_0x7376('0x67')][_0x7376('0x32')](',')['map'](function(_0x3b3fe0){return Number(_0x3b3fe0);});_0x411121[_0x7376('0x33')](function(_0x22681c){_0x2c4cfb['or'](_0x7376('0x75'),'%,'+_0x22681c+',%');});_0x305461=_[_0x7376('0x76')](_0x305461,_0x411121);break;case _0x7376('0x77'):if(_0x2885df[_0x7376('0x6c')]===_0x7376('0x6d')){_0x36c091[_0x2adf6d](_0x7376('0x78'),'%'+_0x2885df[_0x7376('0x67')]+'%',null);}else{_0x476c45=_[_0x7376('0x65')](_0x571d94,[_0x7376('0x2c'),_0x7376('0x3b')]);_0x2885df[_0x7376('0x50')]=_0x7376('0x3b');_0x1b8ccf=as[_0x7376('0x79')](_0x38aa82,_0x476c45[_0x7376('0x40')],_0x2885df);_0x36c091[_0x2adf6d](_0x1b8ccf[_0x7376('0x72')],_0x1b8ccf[_0x7376('0x67')][_0x7376('0x73')],_0x1b8ccf['value']['end']);}break;case _0x7376('0x7a'):_0x1b8ccf=as[_0x7376('0x79')]('me',null,_0x2885df);_0x36c091[_0x2adf6d](_0x1b8ccf[_0x7376('0x72')],_0x1b8ccf[_0x7376('0x67')][_0x7376('0x73')],_0x1b8ccf['value'][_0x7376('0x2a')]);break;}}else{var _0x1b8ccf=as[_0x7376('0x79')](_0x38aa82,_0x476c45['type'],_0x2885df);_0x36c091[_0x2adf6d](_0x1b8ccf[_0x7376('0x72')],_0x1b8ccf['value']['start'],_0x1b8ccf['value']['end']);}}}else{var _0x180b51=_(_0x1ff01e['query'])[_0x7376('0x7b')]()['map'](function(_0x3ee6f8){return _['some'](_0x571d94,[_0x7376('0x2c'),_0x3ee6f8])?_0x3ee6f8:undefined;})[_0x7376('0x7c')]()[_0x7376('0x67')]();if(!_[_0x7376('0x7d')](_0x180b51)){_0x180b51['forEach'](function(_0x3a007e){if(_0x3a007e==='SmsAccountId'){_0x31bfc9['where'](_0x7376('0x7e'),[]['concat'](_0x1ff01e['query'][_0x3a007e]));}else if(_0x3a007e===_0x7376('0x7f')){var _0x5c4fdc=JSON[_0x7376('0x80')](_0x1ff01e[_0x7376('0x43')][_0x3a007e])[_0x7376('0x81')];var _0x88c59e=JSON[_0x7376('0x80')](_0x1ff01e['query'][_0x3a007e])['$lte'];_0x31bfc9[_0x7376('0x4d')](_0x7376('0x82'),_0x5c4fdc,_0x88c59e);}else{if(_0x1ff01e[_0x7376('0x43')][_0x3a007e]===_0x7376('0x83')){_0x31bfc9[_0x7376('0x4d')]('i.'+_0x3a007e+_0x7376('0x84'));}else{_0x31bfc9[_0x7376('0x4d')]('i.'+_0x3a007e+_0x7376('0x85'),_0x1ff01e[_0x7376('0x43')][_0x3a007e]);}}});}if(_0x1ff01e[_0x7376('0x43')][_0x7376('0x86')]){if(_0x1ff01e['query'][_0x7376('0x86')]==0x1){_0x31bfc9[_0x7376('0x68')](_0x7376('0x87'));}else{_0x31bfc9['having'](_0x7376('0x88'));}}if(_0x1ff01e['query'][_0x7376('0x89')]){_0x305461=_[_0x7376('0x8a')](_0x1ff01e['query'][_0x7376('0x89')])?_0x1ff01e[_0x7376('0x43')][_0x7376('0x89')]:new Array(_0x1ff01e[_0x7376('0x43')][_0x7376('0x89')]);_0x305461[_0x7376('0x33')](function(_0x1c9025){_0x2c4cfb['or'](_0x7376('0x75'),'%,'+_0x1c9025+',%');});}if(_0x1ff01e[_0x7376('0x43')][_0x7376('0x8b')]){var _0xad7ce2=_0x1ff01e[_0x7376('0x43')][_0x7376('0x8b')][_0x7376('0x8c')]('\x5c','\x5c\x5c')[_0x7376('0x8c')](/'/g,'\x27\x27');if(qs[_0x7376('0x8d')](_0xad7ce2)){_0x36c091['or'](_0x7376('0x8e'),_0xad7ce2+'%')['or']('i.phone\x20LIKE\x20?',_0xad7ce2+'%');}else{_0x36c091['or'](_0x7376('0x8f'),qs[_0x7376('0x6f')](_0xad7ce2))['or'](_0x7376('0x90'),_0xad7ce2+'%');}}}_0x31bfc9[_0x7376('0x4d')](_0x36c091);_0x31bfc9[_0x7376('0x91')](_0x7376('0x92'));var _0x30d0ad={'type':db[_0x7376('0x93')]['QueryTypes'][_0x7376('0x94')],'raw':!![]};var _0x2e4130=_0x31bfc9[_0x7376('0x95')]();_0x2e4130[_0x7376('0x50')]('i.id');_0x2e4130[_0x7376('0x50')](_0x7376('0x96'),_0x7376('0x66'));if(_0x1b6fc3[_0x7376('0x4b')]){_0x1b6fc3[_0x7376('0x4b')][_0x7376('0x33')](function(_0x3e3bbb){var _0x5eadc0=_0x3e3bbb[0x0]===_0x7376('0x97')?_0x3e3bbb[0x0]:'i.'+_0x3e3bbb[0x0];_0x31bfc9[_0x7376('0x4b')](_0x5eadc0,_0x3e3bbb[0x1]===_0x7376('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x305461)){_0x31bfc9[_0x7376('0x68')](_0x2c4cfb);_0x2e4130[_0x7376('0x4d')](_0x7376('0x99'),_0x305461);}BPromise['resolve']()['then'](function(){if(!_0x2f9324){if(_0x1ff01e[_0x7376('0x43')][_0x7376('0x9a')])return;_0x2e4130[_0x7376('0x4d')](_0x7376('0x9b'));_0x31bfc9[_0x7376('0x4d')](_0x7376('0x9b'));return;}if(_0x1ff01e[_0x7376('0x9c')]['role']!=='agent')return;return _0x1ff01e[_0x7376('0x9c')][_0x7376('0x9d')]({'attributes':['id'],'raw':!![]})[_0x7376('0x28')](function(_0x2219e4){if(_[_0x7376('0x7d')](_0x2219e4)){_0x2e4130[_0x7376('0x4d')](_0x7376('0x9e'));_0x31bfc9[_0x7376('0x4d')](_0x7376('0x9e'));}else{_0x2e4130[_0x7376('0x4d')](_0x7376('0x7e'),_[_0x7376('0x2f')](_0x2219e4,'id'));_0x31bfc9[_0x7376('0x4d')](_0x7376('0x7e'),_['map'](_0x2219e4,'id'));}});})['then'](function(){if(_0x1ff01e[_0x7376('0x9c')][_0x7376('0x9f')]===_0x7376('0xa0')&&!_0x2f9324&&!_0x1ff01e['query']['SmsAccountId'])return[];return db['sequelize'][_0x7376('0x43')](_0x2e4130[_0x7376('0xa1')](),_0x30d0ad);})['then'](function(_0x47506c){_0x1996d1[_0x7376('0xa2')]=_0x47506c[_0x7376('0x47')];if(_0x1996d1[_0x7376('0xa2')]===0x0)return[];return db[_0x7376('0xa3')][_0x7376('0x43')](_0x3db5d6[_0x7376('0xa1')](),_0x30d0ad)[_0x7376('0x28')](function(_0x2f8f95){_0x1922c7=_[_0x7376('0xa4')](_0x2f8f95,'id');_0x30d0ad=_['merge'](_0x30d0ad,{'model':db[_0x7376('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ff01e[_0x7376('0x43')]['fields']){_0x1b6fc3[_0x7376('0x48')][_0x7376('0x33')](function(_0x4b1d3f){_0x31bfc9[_0x7376('0x50')]('i.'+_0x4b1d3f);});}else{_0x31bfc9[_0x7376('0x50')](_0x7376('0x96'),'unreadMessages');_0x31bfc9[_0x7376('0x50')](_0x7376('0xa5'),_0x7376('0xa6'));_0x31bfc9[_0x7376('0x50')]('a.mandatoryDisposition',_0x7376('0xa7'));_0x31bfc9[_0x7376('0x50')](_0x7376('0xa8'),'contactName');_0x31bfc9['field'](_0x7376('0xa9'));_0x31bfc9['field'](_0x7376('0xaa'),_0x7376('0xab'));_0x31bfc9['field'](_0x7376('0xac'),_0x7376('0xad'));_0x31bfc9['field']('c.email','Contact.email');_0x31bfc9[_0x7376('0x50')](_0x7376('0xae'),'Contact.phone');_0x31bfc9[_0x7376('0x50')](_0x7376('0xaf'),_0x7376('0xb0'));_0x31bfc9[_0x7376('0x50')](_0x7376('0xb1'),_0x7376('0xb2'));_0x31bfc9['field'](_0x7376('0xb3'),_0x7376('0xb4'));_0x31bfc9[_0x7376('0x50')]('o.internal',_0x7376('0xb5'));_0x31bfc9['field'](_0x7376('0xb6'),_0x7376('0x31'));}if(_0x1b6fc3[_0x7376('0x21')])_0x31bfc9['limit'](_0x1b6fc3[_0x7376('0x21')]);if(_0x1b6fc3[_0x7376('0x22')])_0x31bfc9['offset'](_0x1b6fc3['offset']);return db[_0x7376('0xa3')][_0x7376('0x43')](_0x31bfc9['toString'](),_0x30d0ad);})[_0x7376('0x28')](function(_0xbc378f){if(_0xbc378f['length']>0x0)_0x3070ef[_0x7376('0x4d')](_0x7376('0xb7'),_[_0x7376('0x2f')](_0xbc378f,'id'));return db['sequelize']['query'](_0x3070ef[_0x7376('0xa1')](),_0x30d0ad)[_0x7376('0x28')](function(_0x208f15){var _0x49ec7b=_['groupBy'](_0x208f15,_0x7376('0xb8'));var _0x53f05e=[];_0xbc378f[_0x7376('0x33')](function(_0xacaaf1){_0x53f05e['push'](updateSmsInteraction(_0xacaaf1,_0x1922c7,_0x49ec7b));});return BPromise[_0x7376('0xb9')](_0x53f05e);});});})[_0x7376('0x28')](function(_0x3069b2){_0x1996d1[_0x7376('0xba')]=_0x3069b2;return _0x1996d1;})[_0x7376('0x28')](respondWithFilteredResult(_0xef0c8,_0x1b6fc3))['catch'](handleError(_0xef0c8,null));};exports[_0x7376('0xbb')]=function(_0x94bea9,_0x50632d){var _0x56b898={'raw':![],'where':{'id':_0x94bea9['params']['id']}},_0x242582={};_0x242582[_0x7376('0x42')]=_[_0x7376('0x7b')](db['SmsInteraction']['rawAttributes']);_0x242582[_0x7376('0x43')]=_['keys'](_0x94bea9[_0x7376('0x43')]);_0x242582['filters']=_[_0x7376('0x45')](_0x242582[_0x7376('0x42')],_0x242582['query']);_0x56b898[_0x7376('0x48')]=_['intersection'](_0x242582[_0x7376('0x42')],qs[_0x7376('0x46')](_0x94bea9[_0x7376('0x43')][_0x7376('0x46')]));_0x56b898[_0x7376('0x48')]=_0x56b898['attributes']['length']?_0x56b898['attributes']:_0x242582[_0x7376('0x42')];if(_0x94bea9['query'][_0x7376('0xbc')]){_0x56b898[_0x7376('0xbd')]=[{'all':!![]}];}_0x56b898=_[_0x7376('0xbe')]({},_0x56b898,_0x94bea9[_0x7376('0xbf')]);return db[_0x7376('0x3d')]['find'](_0x56b898)[_0x7376('0x28')](handleEntityNotFound(_0x50632d,null))[_0x7376('0x28')](respondWithResult(_0x50632d,null))['catch'](handleError(_0x50632d,null));};exports[_0x7376('0xc0')]=function(_0x32da0a,_0x3809e5){return db['SmsInteraction']['create'](_0x32da0a[_0x7376('0x7a')],{})[_0x7376('0x28')](respondWithResult(_0x3809e5,0xc9))[_0x7376('0x35')](handleError(_0x3809e5,null));};exports['update']=function(_0x405601,_0x3b3163){if(_0x405601[_0x7376('0x7a')]['id']){delete _0x405601['body']['id'];}return db[_0x7376('0x3d')][_0x7376('0x65')]({'where':{'id':_0x405601[_0x7376('0xc1')]['id']}})[_0x7376('0x28')](handleEntityNotFound(_0x3b3163,null))['then'](saveUpdates(_0x405601[_0x7376('0x7a')],null))['then'](respondWithResult(_0x3b3163,null))['catch'](handleError(_0x3b3163,null));};exports[_0x7376('0x29')]=function(_0x2c4073,_0x3547fe){return db['SmsInteraction'][_0x7376('0x65')]({'where':{'id':_0x2c4073['params']['id']}})[_0x7376('0x28')](handleEntityNotFound(_0x3547fe,null))[_0x7376('0x28')](removeEntity(_0x3547fe,null))[_0x7376('0x35')](handleError(_0x3547fe,null));};exports[_0x7376('0xc2')]=function(_0xbf9ed9,_0x352b8c){return db[_0x7376('0x3d')][_0x7376('0xc2')]()[_0x7376('0x28')](respondWithResult(_0x352b8c,null))[_0x7376('0x35')](handleError(_0x352b8c,null));};exports['addMessage']=function(_0x46271f,_0x44de04,_0x1db49c){return db['SmsMessage']['find']({'where':{'id':_0x46271f[_0x7376('0xc1')]['id']}})[_0x7376('0x28')](handleEntityNotFound(_0x44de04,null))['then'](function(_0x5b71e4){if(_0x5b71e4){return _0x5b71e4[_0x7376('0xc3')](_0x46271f[_0x7376('0x7a')]['ids'],_[_0x7376('0xc4')](_0x46271f['body'],[_0x7376('0xc5'),'id'])||{});}})['then'](respondWithResult(_0x44de04,null))[_0x7376('0x35')](handleError(_0x44de04,null));};exports[_0x7376('0xc6')]=function(_0x122127,_0x168ff1,_0x391f20){var _0x4d9447={'raw':![],'where':{}};var _0x2c3fba={};var _0x1d49b7={'count':0x0,'rows':[]};return db[_0x7376('0x3d')][_0x7376('0xc7')]({'where':{'id':_0x122127[_0x7376('0xc1')]['id']}})[_0x7376('0x28')](handleEntityNotFound(_0x168ff1,null))[_0x7376('0x28')](function(_0x14f434){if(_0x14f434){_0x2c3fba[_0x7376('0x42')]=_[_0x7376('0x7b')](db[_0x7376('0xc8')][_0x7376('0x3e')]);_0x2c3fba[_0x7376('0x43')]=_[_0x7376('0x7b')](_0x122127[_0x7376('0x43')]);_0x2c3fba[_0x7376('0x44')]=_[_0x7376('0x45')](_0x2c3fba[_0x7376('0x42')],_0x2c3fba[_0x7376('0x43')]);_0x4d9447['attributes']=_['intersection'](_0x2c3fba[_0x7376('0x42')],qs[_0x7376('0x46')](_0x122127[_0x7376('0x43')][_0x7376('0x46')]));_0x4d9447[_0x7376('0x48')]=_0x4d9447[_0x7376('0x48')][_0x7376('0x47')]?_0x4d9447[_0x7376('0x48')]:_0x2c3fba[_0x7376('0x42')];if(!_0x122127[_0x7376('0x43')][_0x7376('0x49')](_0x7376('0x4a'))){_0x4d9447['limit']=qs[_0x7376('0x21')](_0x122127['query'][_0x7376('0x21')]);_0x4d9447[_0x7376('0x22')]=qs[_0x7376('0x22')](_0x122127[_0x7376('0x43')][_0x7376('0x22')]);}_0x4d9447[_0x7376('0x4b')]=qs['sort'](_0x122127[_0x7376('0x43')]['sort']);_0x4d9447['where']=qs['filters'](_[_0x7376('0x4e')](_0x122127['query'],_0x2c3fba[_0x7376('0x44')]));_0x4d9447[_0x7376('0x4d')]['SmsInteractionId']=_0x14f434['id'];if(_0x122127[_0x7376('0x43')][_0x7376('0x8b')]){_0x4d9447[_0x7376('0x4d')]=_[_0x7376('0xbe')](_0x4d9447[_0x7376('0x4d')],{'$or':_[_0x7376('0x2f')](_0x4d9447[_0x7376('0x48')],function(_0x54d42a){var _0x3837bb={};_0x3837bb[_0x54d42a]={'$like':'%'+_0x122127[_0x7376('0x43')]['filter']+'%'};return _0x3837bb;})});}if(_0x122127[_0x7376('0x43')][_0x7376('0x81')]){var _0x1a46f9=_0x122127[_0x7376('0x43')][_0x7376('0x81')]['split'](',');var _0x475bce={};_0x475bce[_0x1a46f9[0x0]]={'$gte':moment(_0x1a46f9[0x1])[_0x7376('0xc9')](_0x7376('0xca'))};_0x4d9447[_0x7376('0x4d')]=_[_0x7376('0xbe')](_0x4d9447['where'],_0x475bce);}_0x4d9447=_[_0x7376('0xbe')]({},_0x4d9447,_0x122127['options']);return db[_0x7376('0xc8')][_0x7376('0xa2')]({'where':_0x4d9447[_0x7376('0x4d')]})[_0x7376('0x28')](function(_0x1b46d3){_0x1d49b7['count']=_0x1b46d3;if(_0x122127['query'][_0x7376('0xbc')]){_0x4d9447[_0x7376('0xbd')]=[{'all':!![]}];}return db[_0x7376('0xc8')][_0x7376('0xcb')](_0x4d9447);})[_0x7376('0x28')](function(_0x321a0f){_0x1d49b7[_0x7376('0xba')]=_0x321a0f;return _0x1d49b7;});}})[_0x7376('0x28')](respondWithFilteredResult(_0x168ff1,_0x4d9447))[_0x7376('0x35')](handleError(_0x168ff1,null));};exports[_0x7376('0xcc')]=function(_0xad8493,_0x258de2,_0x2f18a8){return db[_0x7376('0x3d')]['find']({'where':{'id':_0xad8493[_0x7376('0xc1')]['id']}})[_0x7376('0x28')](handleEntityNotFound(_0x258de2,null))[_0x7376('0x28')](function(_0x3b15c5){if(_0x3b15c5){return _0x3b15c5[_0x7376('0xcd')](_0xad8493[_0x7376('0x7a')][_0x7376('0xc5')],_[_0x7376('0xc4')](_0xad8493[_0x7376('0x7a')],[_0x7376('0xc5'),'id'])||{})[_0x7376('0xce')](function(){return db[_0x7376('0x74')]['findAll']({'attributes':['id',_0x7376('0x2c'),_0x7376('0x51')],'where':{'id':_0xad8493['body']['ids']}});})[_0x7376('0x28')](function(_0x31e353){socket[_0x7376('0xcf')](_0x7376('0xd0'),{'id':Number(_0xad8493[_0x7376('0xc1')]['id']),'tags':_0x31e353||[]});return{'id':Number(_0xad8493[_0x7376('0xc1')]['id']),'tags':_0x31e353||[]};});}})[_0x7376('0x28')](respondWithResult(_0x258de2,null))[_0x7376('0x35')](handleError(_0x258de2,null));};exports[_0x7376('0xd1')]=function(_0x743aa7,_0x2b29c8,_0x57950f){return db[_0x7376('0x3d')][_0x7376('0x65')]({'where':{'id':_0x743aa7['params']['id']}})[_0x7376('0x28')](handleEntityNotFound(_0x2b29c8,null))['then'](function(_0x503d2d){if(_0x503d2d){return _0x503d2d['removeTags'](_0x743aa7[_0x7376('0x43')][_0x7376('0xc5')]);}})[_0x7376('0x28')](respondWithStatusCode(_0x2b29c8,null))[_0x7376('0x35')](handleError(_0x2b29c8,null));};exports[_0x7376('0xd2')]=function(_0x4f0d79,_0x13c6a3){var _0x29cf28=moment()[_0x7376('0xd3')]()[_0x7376('0xa1')]();var _0x252a01=path[_0x7376('0xd4')](config[_0x7376('0xd5')],_0x7376('0xd6'),'files',_0x7376('0xd7'));var _0x7be0bd=path[_0x7376('0xd4')](config[_0x7376('0xd5')],_0x7376('0xd6'),_0x7376('0xd8'),_0x7376('0xd9'));var _0x13c0d9=path['join'](_0x252a01,_0x29cf28);var _0x17d6c2=util[_0x7376('0xc9')]('transcript-%d-%s.zip',_0x4f0d79[_0x7376('0xc1')]['id'],_0x29cf28);var _0x17b8fc=path[_0x7376('0xd4')](_0x252a01,_0x17d6c2);var _0x5ac2ea=[];_0x5ac2ea['push']({'model':db[_0x7376('0x77')],'as':_0x7376('0x77'),'attributes':['id',_0x7376('0xda')],'raw':!![]});_0x5ac2ea[_0x7376('0x34')]({'model':db[_0x7376('0xdb')],'as':_0x7376('0x6b'),'attributes':['id',_0x7376('0xdc'),'lastName'],'raw':!![]});var _0x2fbdf5=[{'model':db[_0x7376('0xc8')],'as':_0x7376('0xdd'),'attributes':['id',_0x7376('0x7a'),_0x7376('0x7f'),_0x7376('0xde'),_0x7376('0xdf'),_0x7376('0x86')],'include':_0x5ac2ea}];_0x2fbdf5['push']({'model':db[_0x7376('0xe0')],'as':'Account','attributes':['id',_0x7376('0x2c')]});_0x2fbdf5[_0x7376('0x34')]({'model':db[_0x7376('0x77')],'as':'Owner','attributes':['id','fullname']});return db['SmsInteraction'][_0x7376('0x65')]({'where':{'id':_0x4f0d79['params']['id']},'include':_0x2fbdf5})[_0x7376('0x28')](handleEntityNotFound(_0x13c6a3,null))['then'](function(_0x40551c){if(_0x40551c){var _0x11b639=_0x40551c[_0x7376('0xe1')]({'plain':!![]});fs[_0x7376('0xe2')](_0x13c0d9);var _0x44bb81={'channel':_0x7376('0xe3'),'account':_0x11b639[_0x7376('0xe4')][_0x7376('0x2c')],'agent':_0x11b639[_0x7376('0xe5')]?_0x11b639[_0x7376('0xe5')][_0x7376('0xda')]:_0x7376('0xe6'),'createdAt':moment(_0x11b639['createdAt'])['format'](_0x7376('0xca'))[_0x7376('0xa1')](),'closedAt':_0x11b639[_0x7376('0x3c')]?moment(_0x11b639['closedAt'])['format'](_0x7376('0xca'))[_0x7376('0xa1')]():'','disposition':_0x11b639['disposition'],'messages':_(_0x11b639[_0x7376('0xdd')])[_0x7376('0x8b')]({'secret':![]})[_0x7376('0x2f')](function(_0x339ce9){return{'date':moment(_0x339ce9[_0x7376('0x7f')])[_0x7376('0xc9')](_0x7376('0xca'))[_0x7376('0xa1')](),'sender':_0x339ce9[_0x7376('0xde')]==='out'?_0x339ce9[_0x7376('0x77')]?_0x339ce9[_0x7376('0x77')][_0x7376('0xda')]:_0x7376('0xe7'):_0x339ce9[_0x7376('0x6b')]['firstName']+(_0x339ce9['Contact']['lastName']?'\x20'+_0x339ce9[_0x7376('0x6b')][_0x7376('0xe8')]:''),'body':_0x339ce9[_0x7376('0x7a')],'direction':_0x339ce9['direction']==='out'?'A':'C','secret':_0x339ce9[_0x7376('0xdf')],'read':_0x339ce9[_0x7376('0x86')]};})['value']()};return ejs[_0x7376('0xe9')](path[_0x7376('0xd4')](config['root'],_0x7376('0xd6'),_0x7376('0xea'),_0x7376('0xeb')),{'interaction':_0x44bb81})[_0x7376('0x28')](function(_0x27c6ee){var _0x4566b2=path['join'](_0x13c0d9,'transcript-'+_0x11b639['id']+'-'+_0x29cf28+_0x7376('0xec'));var _0x4815e5={'path':_0x4566b2,'channel':_0x7376('0xe3'),'interactionId':_0x11b639['id']};return pdf[_0x7376('0xed')](_0x27c6ee,_0x4815e5);})[_0x7376('0x28')](function(){return new BPromise(function(_0x16fd90,_0x252506){zipdir(_0x13c0d9,{'saveTo':_0x17b8fc},function(_0x4d6192,_0x1b98ae){if(_0x4d6192)return _0x252506(_0x4d6192);return _0x16fd90(_0x1b98ae);});})[_0x7376('0x28')](function(){return new BPromise(function(_0x1b90ab,_0x3d06cf){rimraf(_0x13c0d9,function(_0x26c4ff){if(_0x26c4ff)_0x3d06cf(_0x26c4ff);return _0x1b90ab();});});})[_0x7376('0x28')](function(){return _0x13c6a3[_0x7376('0xd2')](_0x17b8fc,_0x17d6c2,function(_0x3f3e86){if(_0x3f3e86){console['log'](_0x7376('0xee'),_0x3f3e86);}else{fs[_0x7376('0xef')](_0x17b8fc);}});});});}else{return _0x13c6a3[_0x7376('0x1d')](0xc8);}})[_0x7376('0x35')](handleError(_0x13c6a3,null));};
\ No newline at end of file
index 11da5a4..fe4c786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x583c=['../../mysqldb','SmsInteraction','setMaxListeners','save','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','hasOwnProperty','hook','events'];(function(_0x36d8cd,_0x17bd8b){var _0x43b369=function(_0x367491){while(--_0x367491){_0x36d8cd['push'](_0x36d8cd['shift']());}};_0x43b369(++_0x17bd8b);}(_0x583c,0x12b));var _0xc583=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0x583c[_0x51cc1d];return _0x2eb9f2;};'use strict';var EventEmitter=require(_0xc583('0x0'));var SmsInteraction=require(_0xc583('0x1'))['db'][_0xc583('0x2')];var SmsMessage=require(_0xc583('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc583('0x3')](0x0);var events={'afterCreate':_0xc583('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x13b8a7){return function(_0xf03852,_0x5b7292,_0xd3a750){_0xf03852[_0xc583('0x5')]({'attributes':['id'],'raw':!![]})[_0xc583('0x6')](function(_0x1dd37c){_0xf03852['setDataValue'](_0xc583('0x7'),_0x1dd37c[_0xc583('0x8')](function(_0x5b456e){return{'id':_0x5b456e['id']};}));return SmsMessage[_0xc583('0x9')]({'where':{'SmsInteractionId':_0xf03852['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc583('0x6')](function(_0x25f8d3){_0xf03852[_0xc583('0xa')](_0xc583('0xb'),_0x25f8d3['length']);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7+':'+_0xf03852['id'],_0xf03852);SmsInteractionEvents[_0xc583('0xc')](_0x13b8a7,_0xf03852);_0xd3a750(null);})['catch'](_0xd3a750(null));};}for(var e in events){if(events[_0xc583('0xd')](e)){var event=events[e];SmsInteraction[_0xc583('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
+var _0x236c=['length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','findAll','unreadMessages'];(function(_0x535615,_0x147e87){var _0x1c21b1=function(_0xd701ed){while(--_0xd701ed){_0x535615['push'](_0x535615['shift']());}};_0x1c21b1(++_0x147e87);}(_0x236c,0x155));var _0xc236=function(_0x3886b0,_0x5b9929){_0x3886b0=_0x3886b0-0x0;var _0x4ebc2d=_0x236c[_0x3886b0];return _0x4ebc2d;};'use strict';var EventEmitter=require(_0xc236('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xc236('0x1')];var SmsMessage=require(_0xc236('0x2'))['db'][_0xc236('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc236('0x4')](0x0);var events={'afterCreate':_0xc236('0x5'),'afterUpdate':'update','afterDestroy':_0xc236('0x6')};function emitEvent(_0x36e87d){return function(_0x33bc57,_0xd582f6,_0x23d3cc){_0x33bc57[_0xc236('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd612c6){_0x33bc57[_0xc236('0x8')]('Users',_0xd612c6['map'](function(_0x5cdee5){return{'id':_0x5cdee5['id']};}));return SmsMessage[_0xc236('0x9')]({'where':{'SmsInteractionId':_0x33bc57['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x30a28d){_0x33bc57[_0xc236('0x8')](_0xc236('0xa'),_0x30a28d[_0xc236('0xb')]);SmsInteractionEvents[_0xc236('0xc')](_0x36e87d+':'+_0x33bc57['id'],_0x33bc57);SmsInteractionEvents['emit'](_0x36e87d,_0x33bc57);_0x23d3cc(null);})[_0xc236('0xd')](_0x23d3cc(null));};}for(var e in events){if(events[_0xc236('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc236('0xf')]=SmsInteractionEvents;
\ No newline at end of file
index ee94c35..4f19ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7d1=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','SmsInteraction','sms_interactions','changed','closed','closedAt'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0xd7d1,0x82));var _0x1d7d=function(_0x699c74,_0x4db1b0){_0x699c74=_0x699c74-0x0;var _0x4b536a=_0xd7d1[_0x699c74];return _0x4b536a;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))('api');var moment=require(_0x1d7d('0x3'));var BPromise=require(_0x1d7d('0x4'));var rp=require(_0x1d7d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d7d('0x6'));var config=require(_0x1d7d('0x7'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x1c5140,_0x1314d0){return _0x1c5140[_0x1d7d('0x8')](_0x1d7d('0x9'),attributes,{'tableName':_0x1d7d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x218fe0,_0x1e0793,_0x2761f5){if(_0x218fe0[_0x1d7d('0xb')](_0x1d7d('0xc'))){_0x218fe0[_0x1d7d('0xd')]=moment()[_0x1d7d('0xe')](_0x1d7d('0xf'));}_0x2761f5(null,_0x218fe0);}}});};
\ No newline at end of file
+var _0x609a=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','define','sms_interactions','changed'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0x609a,0xe4));var _0xa609=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x609a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa609('0x0'));var util=require(_0xa609('0x1'));var logger=require(_0xa609('0x2'))('api');var moment=require(_0xa609('0x3'));var BPromise=require(_0xa609('0x4'));var rp=require(_0xa609('0x5'));var fs=require('fs');var path=require(_0xa609('0x6'));var rimraf=require(_0xa609('0x7'));var config=require('../../config/environment');var attributes=require(_0xa609('0x8'));module['exports']=function(_0x4ef6c5,_0x5ee961){return _0x4ef6c5[_0xa609('0x9')]('SmsInteraction',attributes,{'tableName':_0xa609('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5cf2cc,_0xb17a28,_0x537f56){if(_0x5cf2cc[_0xa609('0xb')](_0xa609('0xc'))){_0x5cf2cc[_0xa609('0xd')]=moment()[_0xa609('0xe')](_0xa609('0xf'));}_0x537f56(null,_0x5cf2cc);}}});};
\ No newline at end of file
index ccc7107..81143f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3851=['where','attributes','limit','stringify','addTags','body','ids','omit','spread','AddTags','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsInteraction.socket','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw'];(function(_0x54a6d0,_0x443aae){var _0x2d0153=function(_0x2158a5){while(--_0x2158a5){_0x54a6d0['push'](_0x54a6d0['shift']());}};_0x2d0153(++_0x443aae);}(_0x3851,0x14a));var _0x1385=function(_0x1cbc40,_0x1e1eee){_0x1cbc40=_0x1cbc40-0x0;var _0x3c1e28=_0x3851[_0x1cbc40];return _0x3c1e28;};'use strict';var _=require(_0x1385('0x0'));var util=require('util');var moment=require(_0x1385('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1385('0x2'));var db=require(_0x1385('0x3'))['db'];var utils=require(_0x1385('0x4'));var logger=require(_0x1385('0x5'))('rpc');var config=require(_0x1385('0x6'));var jayson=require(_0x1385('0x7'));var client=jayson[_0x1385('0x8')][_0x1385('0x9')]({'port':0x232a});config['redis']=_[_0x1385('0xa')](config[_0x1385('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1385('0xc'))(new Redis(config[_0x1385('0xb')]));require(_0x1385('0xd'))['register'](socket);function respondWithRpcPromise(_0x1393e1,_0x33908b,_0x17eb0b){return new BPromise(function(_0x5739f1,_0x4a8ba4){return client['request'](_0x1393e1,_0x17eb0b)[_0x1385('0xe')](function(_0x86b1c7){logger[_0x1385('0xf')](_0x1385('0x10'),_0x33908b,_0x1385('0x11'));logger[_0x1385('0x12')](_0x1385('0x13'),_0x33908b,_0x1385('0x11'),JSON['stringify'](_0x86b1c7));if(_0x86b1c7['error']){if(_0x86b1c7[_0x1385('0x14')][_0x1385('0x15')]===0x1f4){logger[_0x1385('0x14')](_0x1385('0x10'),_0x33908b,_0x86b1c7[_0x1385('0x14')][_0x1385('0x16')]);return _0x4a8ba4(_0x86b1c7[_0x1385('0x14')]['message']);}logger[_0x1385('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x33908b,_0x86b1c7[_0x1385('0x14')]['message']);return _0x5739f1(_0x86b1c7[_0x1385('0x14')][_0x1385('0x16')]);}else{logger[_0x1385('0xf')](_0x1385('0x10'),_0x33908b,_0x1385('0x11'));_0x5739f1(_0x86b1c7[_0x1385('0x17')]['message']);}})[_0x1385('0x18')](function(_0x5d83d3){logger[_0x1385('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x33908b,_0x5d83d3);_0x4a8ba4(_0x5d83d3);});});}exports[_0x1385('0x19')]=function(_0xae51a8){var _0x49b920=this;return new Promise(function(_0x3ffe43,_0x320529){return db[_0x1385('0x1a')][_0x1385('0x1b')](_0xae51a8['body'],{'raw':_0xae51a8[_0x1385('0x1c')]?_0xae51a8[_0x1385('0x1c')][_0x1385('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xae51a8[_0x1385('0x1c')]?_0xae51a8[_0x1385('0x1c')][_0x1385('0x1e')]||null:null,'attributes':_0xae51a8[_0x1385('0x1c')]?_0xae51a8[_0x1385('0x1c')][_0x1385('0x1f')]||null:null,'limit':_0xae51a8['options']?_0xae51a8['options'][_0x1385('0x20')]||null:null})['then'](function(_0xb31c7f){logger[_0x1385('0xf')](_0x1385('0x19'),_0xae51a8);logger[_0x1385('0x12')]('UpdateSmsInteraction',_0xae51a8,JSON[_0x1385('0x21')](_0xb31c7f));_0x3ffe43(_0xb31c7f);})[_0x1385('0x18')](function(_0x3bf6d1){logger[_0x1385('0x14')](_0x1385('0x19'),_0x3bf6d1[_0x1385('0x16')],_0xae51a8);_0x320529(_0x49b920[_0x1385('0x14')](0x1f4,_0x3bf6d1[_0x1385('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x516d45){return new Promise(function(_0x31f59c,_0x1d0d2d){return db[_0x1385('0x1a')]['find']({'where':_0x516d45[_0x1385('0x1c')]?_0x516d45[_0x1385('0x1c')][_0x1385('0x1e')]||null:null})[_0x1385('0xe')](function(_0x57f81a){if(_0x57f81a){return _0x57f81a[_0x1385('0x22')](_0x516d45[_0x1385('0x23')][_0x1385('0x24')],_[_0x1385('0x25')](_0x516d45[_0x1385('0x23')],[_0x1385('0x24'),'id'])||{});}})[_0x1385('0x26')](function(_0x4b8cd9){logger[_0x1385('0xf')](_0x1385('0x27'),_0x516d45);logger[_0x1385('0x12')](_0x1385('0x27'),_0x516d45,JSON[_0x1385('0x21')](_0x4b8cd9));_0x31f59c(_0x4b8cd9);})[_0x1385('0x18')](function(_0x3f9f6d){logger[_0x1385('0x14')](_0x1385('0x27'),_0x3f9f6d['message'],_0x516d45);_0x1d0d2d(_this[_0x1385('0x14')](0x1f4,_0x3f9f6d[_0x1385('0x16')]));});});};
\ No newline at end of file
+var _0x2dcf=['then','UpdateSmsInteraction','stringify','catch','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','SmsInteraction','update','body','options','where','attributes','limit'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0x2dcf,0x17c));var _0xf2dc=function(_0x5d1ae7,_0x5b7ffe){_0x5d1ae7=_0x5d1ae7-0x0;var _0x5ee7e0=_0x2dcf[_0x5d1ae7];return _0x5ee7e0;};'use strict';var _=require(_0xf2dc('0x0'));var util=require(_0xf2dc('0x1'));var moment=require(_0xf2dc('0x2'));var BPromise=require('bluebird');var rs=require(_0xf2dc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2dc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf2dc('0x5'))(_0xf2dc('0x6'));var config=require(_0xf2dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf2dc('0x8')]['http']({'port':0x232a});config[_0xf2dc('0x9')]=_[_0xf2dc('0xa')](config[_0xf2dc('0x9')],{'host':_0xf2dc('0xb'),'port':0x18eb});var socket=require(_0xf2dc('0xc'))(new Redis(config[_0xf2dc('0x9')]));require(_0xf2dc('0xd'))[_0xf2dc('0xe')](socket);function respondWithRpcPromise(_0x49ed10,_0xd28f0f,_0x58e097){return new BPromise(function(_0x255381,_0x380880){return client[_0xf2dc('0xf')](_0x49ed10,_0x58e097)['then'](function(_0x32d801){logger[_0xf2dc('0x10')](_0xf2dc('0x11'),_0xd28f0f,_0xf2dc('0x12'));logger[_0xf2dc('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0xd28f0f,_0xf2dc('0x12'),JSON['stringify'](_0x32d801));if(_0x32d801[_0xf2dc('0x14')]){if(_0x32d801['error'][_0xf2dc('0x15')]===0x1f4){logger[_0xf2dc('0x14')]('SmsInteraction,\x20%s,\x20%s',_0xd28f0f,_0x32d801[_0xf2dc('0x14')][_0xf2dc('0x16')]);return _0x380880(_0x32d801[_0xf2dc('0x14')][_0xf2dc('0x16')]);}logger[_0xf2dc('0x14')](_0xf2dc('0x11'),_0xd28f0f,_0x32d801['error'][_0xf2dc('0x16')]);return _0x255381(_0x32d801[_0xf2dc('0x14')][_0xf2dc('0x16')]);}else{logger[_0xf2dc('0x10')](_0xf2dc('0x11'),_0xd28f0f,_0xf2dc('0x12'));_0x255381(_0x32d801['result']['message']);}})['catch'](function(_0x491089){logger[_0xf2dc('0x14')](_0xf2dc('0x11'),_0xd28f0f,_0x491089);_0x380880(_0x491089);});});}exports['UpdateSmsInteraction']=function(_0x5a9265){var _0x266a4a=this;return new Promise(function(_0x323b2f,_0x135f69){return db[_0xf2dc('0x17')][_0xf2dc('0x18')](_0x5a9265[_0xf2dc('0x19')],{'raw':_0x5a9265[_0xf2dc('0x1a')]?_0x5a9265[_0xf2dc('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a9265[_0xf2dc('0x1a')]?_0x5a9265['options'][_0xf2dc('0x1b')]||null:null,'attributes':_0x5a9265[_0xf2dc('0x1a')]?_0x5a9265['options'][_0xf2dc('0x1c')]||null:null,'limit':_0x5a9265['options']?_0x5a9265['options'][_0xf2dc('0x1d')]||null:null})[_0xf2dc('0x1e')](function(_0x481e92){logger['info']('UpdateSmsInteraction',_0x5a9265);logger[_0xf2dc('0x13')](_0xf2dc('0x1f'),_0x5a9265,JSON[_0xf2dc('0x20')](_0x481e92));_0x323b2f(_0x481e92);})[_0xf2dc('0x21')](function(_0x222d71){logger[_0xf2dc('0x14')]('UpdateSmsInteraction',_0x222d71[_0xf2dc('0x16')],_0x5a9265);_0x135f69(_0x266a4a[_0xf2dc('0x14')](0x1f4,_0x222d71[_0xf2dc('0x16')]));});});};exports[_0xf2dc('0x22')]=function(_0x157e07){return new Promise(function(_0x3ceace,_0x2ec904){return db[_0xf2dc('0x17')][_0xf2dc('0x23')]({'where':_0x157e07['options']?_0x157e07[_0xf2dc('0x1a')][_0xf2dc('0x1b')]||null:null})[_0xf2dc('0x1e')](function(_0x3aaf1b){if(_0x3aaf1b){return _0x3aaf1b[_0xf2dc('0x24')](_0x157e07[_0xf2dc('0x19')][_0xf2dc('0x25')],_[_0xf2dc('0x26')](_0x157e07[_0xf2dc('0x19')],[_0xf2dc('0x25'),'id'])||{});}})[_0xf2dc('0x27')](function(_0x3dbb2b){logger['info'](_0xf2dc('0x28'),_0x157e07);logger[_0xf2dc('0x13')]('AddTags',_0x157e07,JSON[_0xf2dc('0x20')](_0x3dbb2b));_0x3ceace(_0x3dbb2b);})['catch'](function(_0x4da341){logger[_0xf2dc('0x14')](_0xf2dc('0x28'),_0x4da341[_0xf2dc('0x16')],_0x157e07);_0x2ec904(_this['error'](0x1f4,_0x4da341[_0xf2dc('0x16')]));});});};
\ No newline at end of file
index 67969d5..0c2f002 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15de=['register','smsInteraction:','./smsInteraction.events','save','remove','update'];(function(_0x2112fe,_0x56d7e4){var _0xa3de10=function(_0x373f4e){while(--_0x373f4e){_0x2112fe['push'](_0x2112fe['shift']());}};_0xa3de10(++_0x56d7e4);}(_0x15de,0x1dc));var _0xe15d=function(_0x1ebb10,_0x156b3e){_0x1ebb10=_0x1ebb10-0x0;var _0x20d709=_0x15de[_0x1ebb10];return _0x20d709;};'use strict';var SmsInteractionEvents=require(_0xe15d('0x0'));var events=[_0xe15d('0x1'),_0xe15d('0x2'),_0xe15d('0x3')];function createListener(_0x20f1cc,_0x5d3f3d){return function(_0x300bd4){_0x5d3f3d['emit'](_0x20f1cc,_0x300bd4);};}function removeListener(_0x160432,_0x45b7a0){return function(){SmsInteractionEvents['removeListener'](_0x160432,_0x45b7a0);};}exports[_0xe15d('0x4')]=function(_0x1c72a1){for(var _0x4d0865=0x0,_0x4a6d97=events['length'];_0x4d0865<_0x4a6d97;_0x4d0865++){var _0x2e1a42=events[_0x4d0865];var _0x3a7ed1=createListener(_0xe15d('0x5')+_0x2e1a42,_0x1c72a1);SmsInteractionEvents['on'](_0x2e1a42,_0x3a7ed1);}};
\ No newline at end of file
+var _0xb7fe=['emit','removeListener','register','length','./smsInteraction.events','update'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xb7fe,0x14e));var _0xeb7f=function(_0x4ddf10,_0x10d8ce){_0x4ddf10=_0x4ddf10-0x0;var _0x447c7f=_0xb7fe[_0x4ddf10];return _0x447c7f;};'use strict';var SmsInteractionEvents=require(_0xeb7f('0x0'));var events=['save','remove',_0xeb7f('0x1')];function createListener(_0x33d95d,_0x30c839){return function(_0x62a44f){_0x30c839[_0xeb7f('0x2')](_0x33d95d,_0x62a44f);};}function removeListener(_0x5053cc,_0x146c5c){return function(){SmsInteractionEvents[_0xeb7f('0x3')](_0x5053cc,_0x146c5c);};}exports[_0xeb7f('0x4')]=function(_0x2e3025){for(var _0x46414a=0x0,_0x515336=events[_0xeb7f('0x5')];_0x46414a<_0x515336;_0x46414a++){var _0x56c7e7=events[_0x46414a];var _0x3c043d=createListener('smsInteraction:'+_0x56c7e7,_0x2e3025);SmsInteractionEvents['on'](_0x56c7e7,_0x3c043d);}};
\ No newline at end of file
index 677fb4d..c725bb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5b2=['/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms'];(function(_0x5b36bd,_0x4dfb36){var _0x1614fe=function(_0x559b7c){while(--_0x559b7c){_0x5b36bd['push'](_0x5b36bd['shift']());}};_0x1614fe(++_0x4dfb36);}(_0xb5b2,0x10f));var _0x2b5b=function(_0x4650a7,_0x4021ac){_0x4650a7=_0x4650a7-0x0;var _0x13ea0f=_0xb5b2[_0x4650a7];return _0x13ea0f;};'use strict';var multer=require(_0x2b5b('0x0'));var util=require(_0x2b5b('0x1'));var path=require('path');var timeout=require(_0x2b5b('0x2'));var express=require(_0x2b5b('0x3'));var router=express[_0x2b5b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2b5b('0x5'));var interaction=require(_0x2b5b('0x6'));var config=require(_0x2b5b('0x7'));var controller=require(_0x2b5b('0x8'));router[_0x2b5b('0x9')]('/',auth[_0x2b5b('0xa')](),controller[_0x2b5b('0xb')]);router['get'](_0x2b5b('0xc'),auth[_0x2b5b('0xa')](),controller[_0x2b5b('0xd')]);router[_0x2b5b('0x9')](_0x2b5b('0xe'),auth['isAuthenticated'](),controller[_0x2b5b('0xf')]);router[_0x2b5b('0x10')]('/',auth['isAuthenticated'](),interaction[_0x2b5b('0x11')](_0x2b5b('0x12'),'smsmessage:create'),controller['create']);router[_0x2b5b('0x10')](_0x2b5b('0x13'),controller[_0x2b5b('0x14')]);router['put'](_0x2b5b('0xe'),auth['isAuthenticated'](),controller[_0x2b5b('0x15')]);router[_0x2b5b('0x16')](_0x2b5b('0x17'),auth[_0x2b5b('0xa')](),controller[_0x2b5b('0x18')]);router['put'](_0x2b5b('0x19'),auth['isAuthenticated'](),controller[_0x2b5b('0x1a')]);router[_0x2b5b('0x1b')](_0x2b5b('0xe'),auth[_0x2b5b('0xa')](),controller['destroy']);module[_0x2b5b('0x1c')]=router;
\ No newline at end of file
+var _0x2b81=['put','accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','sms','create','status','update'];(function(_0x2f16cd,_0x5846f7){var _0x47d1b8=function(_0xef6ea5){while(--_0xef6ea5){_0x2f16cd['push'](_0x2f16cd['shift']());}};_0x47d1b8(++_0x5846f7);}(_0x2b81,0x123));var _0x12b8=function(_0x250efd,_0x22d8ea){_0x250efd=_0x250efd-0x0;var _0x2b5660=_0x2b81[_0x250efd];return _0x2b5660;};'use strict';var multer=require(_0x12b8('0x0'));var util=require(_0x12b8('0x1'));var path=require(_0x12b8('0x2'));var timeout=require(_0x12b8('0x3'));var express=require(_0x12b8('0x4'));var router=express[_0x12b8('0x5')]();var fs_extra=require(_0x12b8('0x6'));var auth=require(_0x12b8('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x12b8('0x8'));router[_0x12b8('0x9')]('/',auth[_0x12b8('0xa')](),controller[_0x12b8('0xb')]);router[_0x12b8('0x9')](_0x12b8('0xc'),auth[_0x12b8('0xa')](),controller['describe']);router[_0x12b8('0x9')](_0x12b8('0xd'),auth[_0x12b8('0xa')](),controller[_0x12b8('0xe')]);router[_0x12b8('0xf')]('/',auth[_0x12b8('0xa')](),interaction[_0x12b8('0x10')](_0x12b8('0x11'),'smsmessage:create'),controller[_0x12b8('0x12')]);router[_0x12b8('0xf')]('/:id/status',controller[_0x12b8('0x13')]);router['put'](_0x12b8('0xd'),auth[_0x12b8('0xa')](),controller[_0x12b8('0x14')]);router[_0x12b8('0x15')]('/:id/accept',auth[_0x12b8('0xa')](),controller[_0x12b8('0x16')]);router[_0x12b8('0x15')](_0x12b8('0x17'),auth[_0x12b8('0xa')](),controller['reject']);router[_0x12b8('0x18')](_0x12b8('0xd'),auth[_0x12b8('0xa')](),controller[_0x12b8('0x19')]);module['exports']=router;
\ No newline at end of file
index 04bfcf2..f0db04a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ea0=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x43adda,_0x3eadf0){var _0x566d10=function(_0x17b347){while(--_0x17b347){_0x43adda['push'](_0x43adda['shift']());}};_0x566d10(++_0x3eadf0);}(_0x9ea0,0xc0));var _0x09ea=function(_0x54cfcf,_0x3ecf5b){_0x54cfcf=_0x54cfcf-0x0;var _0x1c2060=_0x9ea0[_0x54cfcf];return _0x1c2060;};'use strict';var Sequelize=require(_0x09ea('0x0'));module[_0x09ea('0x1')]={'body':{'type':Sequelize[_0x09ea('0x2')](_0x09ea('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x09ea('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x09ea('0x5')]('in',_0x09ea('0x6')),'defaultValue':_0x09ea('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x09ea('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x09ea('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x09ea('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xa67b=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0xa67b,0x10e));var _0xba67=function(_0x17abf2,_0x4db51c){_0x17abf2=_0x17abf2-0x0;var _0x3b3716=_0xa67b[_0x17abf2];return _0x3b3716;};'use strict';var Sequelize=require(_0xba67('0x0'));module[_0xba67('0x1')]={'body':{'type':Sequelize[_0xba67('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xba67('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xba67('0x4')]('in','out'),'defaultValue':_0xba67('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xba67('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xba67('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xba67('0x6')]},'providerResponse':{'type':Sequelize[_0xba67('0x2')]}};
\ No newline at end of file
index 4f2741b..5d0126a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b84=['attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','SmsMessage','rows','show','params','options','find','body','describe','sms-interactions','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','accept','EventManager','acceptmessage','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','email','motionChannel','event','rejectmessage','SmsAccount','SmsAccountId','debug','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','results','groupName','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','client','info','SmsMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','name','send','index','rawAttributes','type','key','keys','query','filters','intersection','model'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x7b84,0x17c));var _0x47b8=function(_0x851ad6,_0x3f7098){_0x851ad6=_0x851ad6-0x0;var _0x3148e4=_0x7b84[_0x851ad6];return _0x3148e4;};'use strict';var emlformat=require(_0x47b8('0x0'));var rimraf=require(_0x47b8('0x1'));var zipdir=require(_0x47b8('0x2'));var jsonpatch=require(_0x47b8('0x3'));var rp=require(_0x47b8('0x4'));var moment=require(_0x47b8('0x5'));var BPromise=require(_0x47b8('0x6'));var Mustache=require('mustache');var util=require(_0x47b8('0x7'));var path=require(_0x47b8('0x8'));var sox=require(_0x47b8('0x9'));var csv=require(_0x47b8('0xa'));var ejs=require(_0x47b8('0xb'));var fs=require('fs');var fs_extra=require(_0x47b8('0xc'));var _=require('lodash');var squel=require(_0x47b8('0xd'));var crypto=require(_0x47b8('0xe'));var jsforce=require(_0x47b8('0xf'));var deskjs=require(_0x47b8('0x10'));var toCsv=require(_0x47b8('0xa'));var querystring=require(_0x47b8('0x11'));var Papa=require(_0x47b8('0x12'));var Redis=require(_0x47b8('0x13'));var authService=require(_0x47b8('0x14'));var qs=require(_0x47b8('0x15'));var as=require(_0x47b8('0x16'));var hardwareService=require(_0x47b8('0x17'));var logger=require(_0x47b8('0x18'))(_0x47b8('0x19'));var utils=require(_0x47b8('0x1a'));var config=require(_0x47b8('0x1b'));var licenseUtil=require(_0x47b8('0x1c'));var db=require(_0x47b8('0x1d'))['db'];config[_0x47b8('0x1e')]=_[_0x47b8('0x1f')](config[_0x47b8('0x1e')],{'host':_0x47b8('0x20'),'port':0x18eb});var socket=require(_0x47b8('0x21'))(new Redis(config[_0x47b8('0x1e')]));require(_0x47b8('0x22'))[_0x47b8('0x23')](socket);var jayson=require(_0x47b8('0x24'));var client=jayson['client'][_0x47b8('0x25')]({'port':0x232c});var client9002=jayson[_0x47b8('0x26')][_0x47b8('0x25')]({'port':0x232a});function respondWithRpcPromise(_0x1217a4,_0x34d5a5,_0x2a36e7,_0x4765ad){return new BPromise(function(_0x5ad3ae,_0x3cc9d9){var _0x5c2b2c=_0x4765ad||client;return _0x5c2b2c['request'](_0x1217a4,_0x2a36e7)['then'](function(_0x299195){logger[_0x47b8('0x27')](_0x47b8('0x28'),_0x34d5a5,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x34d5a5,_0x47b8('0x29'),JSON['stringify'](_0x299195));if(_0x299195[_0x47b8('0x2a')]){if(_0x299195[_0x47b8('0x2a')][_0x47b8('0x2b')]===0x1f4){logger[_0x47b8('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x34d5a5,_0x299195[_0x47b8('0x2a')][_0x47b8('0x2c')]);return _0x3cc9d9(_0x299195[_0x47b8('0x2a')][_0x47b8('0x2c')]);}logger[_0x47b8('0x2a')](_0x47b8('0x28'),_0x34d5a5,_0x299195['error'][_0x47b8('0x2c')]);return _0x5ad3ae(_0x299195[_0x47b8('0x2a')]['message']);}else{logger[_0x47b8('0x27')](_0x47b8('0x28'),_0x34d5a5,_0x47b8('0x29'));_0x5ad3ae(_0x299195[_0x47b8('0x2d')]['message']);}})[_0x47b8('0x2e')](function(_0x332c23){logger[_0x47b8('0x2a')](_0x47b8('0x28'),_0x34d5a5,_0x332c23);_0x3cc9d9(_0x332c23);});});}function respondWithStatusCode(_0x28499d,_0xbf5ce9){_0xbf5ce9=_0xbf5ce9||0xcc;return function(_0x40918f){if(_0x40918f){return _0x28499d['sendStatus'](_0xbf5ce9);}return _0x28499d[_0x47b8('0x2f')](_0xbf5ce9)[_0x47b8('0x30')]();};}function respondWithResult(_0x4bcc98,_0x195a66){_0x195a66=_0x195a66||0xc8;return function(_0x6d517a){if(_0x6d517a){return _0x4bcc98[_0x47b8('0x2f')](_0x195a66)[_0x47b8('0x31')](_0x6d517a);}};}function respondWithFilteredResult(_0x4da0e0,_0x162d96){return function(_0x5c347f){if(_0x5c347f){var _0x2c89fc=typeof _0x162d96[_0x47b8('0x32')]===_0x47b8('0x33')&&typeof _0x162d96[_0x47b8('0x34')]==='undefined';var _0x35fbbb=_0x5c347f[_0x47b8('0x35')];var _0x402e7c=_0x2c89fc?0x0:_0x162d96[_0x47b8('0x32')];var _0x132f37=_0x2c89fc?_0x5c347f[_0x47b8('0x35')]:_0x162d96['offset']+_0x162d96['limit'];var _0x52599e;if(_0x132f37>=_0x35fbbb){_0x132f37=_0x35fbbb;_0x52599e=0xc8;}else{_0x52599e=0xce;}_0x4da0e0[_0x47b8('0x2f')](_0x52599e);return _0x4da0e0[_0x47b8('0x36')](_0x47b8('0x37'),_0x402e7c+'-'+_0x132f37+'/'+_0x35fbbb)['json'](_0x5c347f);}return null;};}function patchUpdates(_0x4d915e){return function(_0x5b0d1d){try{jsonpatch['apply'](_0x5b0d1d,_0x4d915e,!![]);}catch(_0x347769){return BPromise[_0x47b8('0x38')](_0x347769);}return _0x5b0d1d[_0x47b8('0x39')]();};}function saveUpdates(_0x14a7e5,_0x19454d){return function(_0x17f642){if(_0x17f642){return _0x17f642[_0x47b8('0x3a')](_0x14a7e5)[_0x47b8('0x3b')](function(_0x2bca34){return _0x2bca34;});}return null;};}function removeEntity(_0x52ce02,_0x57d95a){return function(_0x44ca76){if(_0x44ca76){return _0x44ca76[_0x47b8('0x3c')]()['then'](function(){_0x52ce02['status'](0xcc)[_0x47b8('0x30')]();});}};}function handleEntityNotFound(_0x26673e,_0x171e2f){return function(_0x51461d){if(!_0x51461d){_0x26673e[_0x47b8('0x3d')](0x194);}return _0x51461d;};}function handleError(_0xc16e2e,_0x5687c2){_0x5687c2=_0x5687c2||0x1f4;return function(_0x4e9471){logger['error'](_0x4e9471['stack']);if(_0x4e9471[_0x47b8('0x3e')]){delete _0x4e9471[_0x47b8('0x3e')];}_0xc16e2e[_0x47b8('0x2f')](_0x5687c2)[_0x47b8('0x3f')](_0x4e9471);};}exports[_0x47b8('0x40')]=function(_0x3c24c1,_0x4ed611){var _0x494a53={},_0x1259b7={},_0x2faffc={'count':0x0,'rows':[]};var _0x16880f=_['map'](db['SmsMessage'][_0x47b8('0x41')],function(_0x2c89bc){return{'name':_0x2c89bc['fieldName'],'type':_0x2c89bc[_0x47b8('0x42')][_0x47b8('0x43')]};});_0x1259b7['model']=_['map'](_0x16880f,'name');_0x1259b7['query']=_[_0x47b8('0x44')](_0x3c24c1[_0x47b8('0x45')]);_0x1259b7[_0x47b8('0x46')]=_[_0x47b8('0x47')](_0x1259b7[_0x47b8('0x48')],_0x1259b7['query']);_0x494a53[_0x47b8('0x49')]=_['intersection'](_0x1259b7[_0x47b8('0x48')],qs[_0x47b8('0x4a')](_0x3c24c1[_0x47b8('0x45')]['fields']));_0x494a53[_0x47b8('0x49')]=_0x494a53[_0x47b8('0x49')][_0x47b8('0x4b')]?_0x494a53[_0x47b8('0x49')]:_0x1259b7[_0x47b8('0x48')];if(!_0x3c24c1[_0x47b8('0x45')][_0x47b8('0x4c')]('nolimit')){_0x494a53[_0x47b8('0x34')]=qs['limit'](_0x3c24c1[_0x47b8('0x45')][_0x47b8('0x34')]);_0x494a53[_0x47b8('0x32')]=qs[_0x47b8('0x32')](_0x3c24c1[_0x47b8('0x45')][_0x47b8('0x32')]);}_0x494a53['order']=qs['sort'](_0x3c24c1[_0x47b8('0x45')][_0x47b8('0x4d')]);_0x494a53[_0x47b8('0x4e')]=qs['filters'](_[_0x47b8('0x4f')](_0x3c24c1['query'],_0x1259b7[_0x47b8('0x46')]),_0x16880f);if(_0x3c24c1[_0x47b8('0x45')][_0x47b8('0x50')]){_0x494a53[_0x47b8('0x4e')]=_[_0x47b8('0x51')](_0x494a53['where'],{'$or':_[_0x47b8('0x52')](_0x16880f,function(_0xfb8041){if(_0xfb8041[_0x47b8('0x42')]!==_0x47b8('0x53')){var _0x1dce38={};_0x1dce38[_0xfb8041[_0x47b8('0x3e')]]={'$like':'%'+_0x3c24c1[_0x47b8('0x45')]['filter']+'%'};return _0x1dce38;}})});}_0x494a53=_[_0x47b8('0x51')]({},_0x494a53,_0x3c24c1['options']);var _0x4020f2={'where':_0x494a53[_0x47b8('0x4e')]};return db['SmsMessage'][_0x47b8('0x35')](_0x4020f2)[_0x47b8('0x3b')](function(_0x119585){_0x2faffc[_0x47b8('0x35')]=_0x119585;if(_0x3c24c1[_0x47b8('0x45')][_0x47b8('0x54')]){_0x494a53[_0x47b8('0x55')]=[{'all':!![]}];}return db[_0x47b8('0x56')]['findAll'](_0x494a53);})[_0x47b8('0x3b')](function(_0x2e5996){_0x2faffc[_0x47b8('0x57')]=_0x2e5996;return _0x2faffc;})['then'](respondWithFilteredResult(_0x4ed611,_0x494a53))[_0x47b8('0x2e')](handleError(_0x4ed611,null));};exports[_0x47b8('0x58')]=function(_0x243ee8,_0x2cd519){var _0x5edde7={'raw':!![],'where':{'id':_0x243ee8[_0x47b8('0x59')]['id']}},_0x37d1ec={};_0x37d1ec['model']=_[_0x47b8('0x44')](db[_0x47b8('0x56')][_0x47b8('0x41')]);_0x37d1ec['query']=_[_0x47b8('0x44')](_0x243ee8['query']);_0x37d1ec[_0x47b8('0x46')]=_['intersection'](_0x37d1ec[_0x47b8('0x48')],_0x37d1ec['query']);_0x5edde7[_0x47b8('0x49')]=_[_0x47b8('0x47')](_0x37d1ec[_0x47b8('0x48')],qs[_0x47b8('0x4a')](_0x243ee8['query'][_0x47b8('0x4a')]));_0x5edde7[_0x47b8('0x49')]=_0x5edde7[_0x47b8('0x49')][_0x47b8('0x4b')]?_0x5edde7['attributes']:_0x37d1ec[_0x47b8('0x48')];if(_0x243ee8[_0x47b8('0x45')][_0x47b8('0x54')]){_0x5edde7['include']=[{'all':!![]}];}_0x5edde7=_['merge']({},_0x5edde7,_0x243ee8[_0x47b8('0x5a')]);return db['SmsMessage'][_0x47b8('0x5b')](_0x5edde7)[_0x47b8('0x3b')](handleEntityNotFound(_0x2cd519,null))[_0x47b8('0x3b')](respondWithResult(_0x2cd519,null))[_0x47b8('0x2e')](handleError(_0x2cd519,null));};exports['create']=function(_0x27d91c,_0x3bfeee){return db[_0x47b8('0x56')]['create'](_0x27d91c['body'],{})[_0x47b8('0x3b')](respondWithResult(_0x3bfeee,0xc9))[_0x47b8('0x2e')](handleError(_0x3bfeee,null));};exports[_0x47b8('0x3a')]=function(_0x5693a8,_0x282c3c){if(_0x5693a8[_0x47b8('0x5c')]['id']){delete _0x5693a8[_0x47b8('0x5c')]['id'];}return db[_0x47b8('0x56')]['find']({'where':{'id':_0x5693a8[_0x47b8('0x59')]['id']}})[_0x47b8('0x3b')](handleEntityNotFound(_0x282c3c,null))[_0x47b8('0x3b')](saveUpdates(_0x5693a8['body'],null))[_0x47b8('0x3b')](respondWithResult(_0x282c3c,null))['catch'](handleError(_0x282c3c,null));};exports[_0x47b8('0x3c')]=function(_0x4fc8ac,_0x447ff7){return db[_0x47b8('0x56')][_0x47b8('0x5b')]({'where':{'id':_0x4fc8ac['params']['id']}})[_0x47b8('0x3b')](handleEntityNotFound(_0x447ff7,null))[_0x47b8('0x3b')](removeEntity(_0x447ff7,null))['catch'](handleError(_0x447ff7,null));};exports[_0x47b8('0x5d')]=function(_0x4e1aa7,_0x48b1aa){return db['SmsMessage'][_0x47b8('0x5d')]()['then'](respondWithResult(_0x48b1aa,null))[_0x47b8('0x2e')](handleError(_0x48b1aa,null));};var interaction_log=require('../../config/logger')(_0x47b8('0x5e'));exports['accept']=function(_0x1e458d,_0x28b94c,_0x110564){var _0x350805={'agent':{},'channel':_0x47b8('0x5f')};if(_0x1e458d['body']['id']){delete _0x1e458d[_0x47b8('0x5c')]['id'];}_0x1e458d[_0x47b8('0x5c')][_0x47b8('0x60')]=!![];_0x1e458d[_0x47b8('0x5c')][_0x47b8('0x61')]=moment()['format'](_0x47b8('0x62'));_0x1e458d[_0x47b8('0x5c')]['UserId']=_0x1e458d[_0x47b8('0x5c')][_0x47b8('0x63')]||_0x1e458d[_0x47b8('0x64')]['id'];_0x350805[_0x47b8('0x65')]['id']=_0x1e458d['body'][_0x47b8('0x63')];return db[_0x47b8('0x56')][_0x47b8('0x5b')]({'where':{'id':_0x1e458d[_0x47b8('0x59')]['id'],'UserId':null}})[_0x47b8('0x3b')](handleEntityNotFound(_0x28b94c,null))[_0x47b8('0x3b')](saveUpdates(_0x1e458d[_0x47b8('0x5c')],null))[_0x47b8('0x3b')](function(_0x2aec5d){if(_0x2aec5d){_0x350805[_0x47b8('0x2c')]=_0x2aec5d[_0x47b8('0x66')]({'plain':!![]});return db[_0x47b8('0x67')][_0x47b8('0x5b')]({'where':{'id':_0x2aec5d[_0x47b8('0x68')]}});}return null;})[_0x47b8('0x3b')](handleEntityNotFound(_0x28b94c,null))[_0x47b8('0x3b')](function(_0x5e4b95){if(_0x5e4b95){return _0x5e4b95[_0x47b8('0x3a')]({'UserId':_0x1e458d['body'][_0x47b8('0x63')],'read1stAt':_['isNil'](_0x5e4b95[_0x47b8('0x69')])?moment()[_0x47b8('0x6a')](_0x47b8('0x62')):undefined});}return null;})[_0x47b8('0x3b')](function(_0x4a0cac){if(_0x4a0cac){_0x350805[_0x47b8('0x6b')]=_0x4a0cac[_0x47b8('0x66')]({'plain':!![]});interaction_log['info'](_0x47b8('0x6c'),_0x1e458d[_0x47b8('0x64')]['id'],_0x1e458d[_0x47b8('0x64')][_0x47b8('0x3e')],_0x1e458d[_0x47b8('0x64')][_0x47b8('0x6d')],_0x350805[_0x47b8('0x6b')]['id'],_0x1e458d[_0x47b8('0x5c')]?JSON['stringify'](_0x1e458d[_0x47b8('0x5c')]):_0x47b8('0x6e'));return respondWithRpcPromise(_0x47b8('0x6f'),_0x47b8('0x70'),_0x350805);}return null;})[_0x47b8('0x3b')](function(_0x3cf1b6){var _0x547df3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3cf1b6[_0x47b8('0x2c')][_0x47b8('0x71')];return db[_0x47b8('0x72')]['query'](_0x547df3,{'type':db['Sequelize'][_0x47b8('0x73')][_0x47b8('0x74')],'raw':!![]})[_0x47b8('0x3b')](function(_0x5e807d){return _0x5e807d;});})[_0x47b8('0x3b')](function(_0x2868c6){if(_0x2868c6){_0x350805[_0x47b8('0x2c')][_0x47b8('0x75')]=_0x2868c6[0x0];if(!_0x1e458d[_0x47b8('0x5c')][_0x47b8('0x63')])return;return db[_0x47b8('0x76')]['find']({'where':{'id':_0x1e458d[_0x47b8('0x5c')][_0x47b8('0x63')],'role':'agent'},'attributes':['id',_0x47b8('0x3e'),_0x47b8('0x77'),'email',_0x47b8('0x78')],'raw':!![]});}return null;})[_0x47b8('0x3b')](function(_0x50ec6b){if(!_0x50ec6b)return null;_0x350805[_0x47b8('0x2c')][_0x47b8('0x65')]=_0x50ec6b;return _0x350805;})['then'](function(_0x25d053){if(_0x25d053){if(_0x1e458d['body']['manual']){_0x350805[_0x47b8('0x2c')][_0x47b8('0x79')]=util[_0x47b8('0x6a')](_0x47b8('0x7a'),_0x1e458d[_0x47b8('0x64')][_0x47b8('0x3e')]);_0x350805[_0x47b8('0x2c')][_0x47b8('0x7b')]=_0x350805[_0x47b8('0x7b')];_0x350805['message']['motionChannel']=_0x350805[_0x47b8('0x7b')];_0x350805[_0x47b8('0x2c')]['event']=_0x47b8('0x7c');return respondWithRpcPromise('EventManager',_0x47b8('0x7d'),{'event':_0x47b8('0x7e'),'message':_0x350805[_0x47b8('0x2c')]},client9002)[_0x47b8('0x3b')](function(){return _0x350805;});}return _0x350805;}return null;})[_0x47b8('0x3b')](respondWithResult(_0x28b94c,null))[_0x47b8('0x2e')](handleError(_0x28b94c,null));};var interaction_log=require(_0x47b8('0x18'))(_0x47b8('0x5e'));exports[_0x47b8('0x38')]=function(_0x5e4b92,_0x437cc5,_0x590577){var _0x22f163={'agent':{},'channel':_0x47b8('0x5f')};if(_0x5e4b92['body']['id']){delete _0x5e4b92[_0x47b8('0x5c')]['id'];}_0x5e4b92[_0x47b8('0x5c')][_0x47b8('0x63')]=_0x5e4b92[_0x47b8('0x5c')][_0x47b8('0x63')]||_0x5e4b92[_0x47b8('0x64')]['id'];_0x22f163['agent']['id']=_0x5e4b92[_0x47b8('0x5c')][_0x47b8('0x63')];return db[_0x47b8('0x56')][_0x47b8('0x5b')]({'where':{'id':_0x5e4b92[_0x47b8('0x59')]['id'],'UserId':null}})[_0x47b8('0x3b')](handleEntityNotFound(_0x437cc5,null))[_0x47b8('0x3b')](function(_0x54378b){if(_0x54378b){_0x22f163['message']=_0x54378b[_0x47b8('0x66')]({'plain':!![]});return db[_0x47b8('0x67')]['find']({'where':{'id':_0x54378b['SmsInteractionId']}});}return null;})[_0x47b8('0x3b')](handleEntityNotFound(_0x437cc5,null))['then'](function(_0x3b7f3d){if(_0x3b7f3d){_0x22f163['interaction']=_0x3b7f3d['get']({'plain':!![]});interaction_log[_0x47b8('0x27')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5e4b92['user']['id'],_0x5e4b92[_0x47b8('0x64')][_0x47b8('0x3e')],_0x5e4b92['user'][_0x47b8('0x6d')],_0x22f163[_0x47b8('0x6b')]['id'],_0x5e4b92[_0x47b8('0x5c')]?JSON['stringify'](_0x5e4b92['body']):_0x47b8('0x6e'));return respondWithRpcPromise(_0x47b8('0x7f'),_0x47b8('0x80'),_0x22f163);}return null;})[_0x47b8('0x3b')](function(_0x23bf13){var _0x5237c3=_0x47b8('0x81')+_0x23bf13[_0x47b8('0x2c')][_0x47b8('0x71')];return db['sequelize']['query'](_0x5237c3,{'type':db[_0x47b8('0x82')][_0x47b8('0x73')][_0x47b8('0x74')],'raw':!![]})['then'](function(_0x517f70){return _0x517f70;});})[_0x47b8('0x3b')](function(_0x5baf1a){if(_0x5baf1a){_0x22f163[_0x47b8('0x2c')][_0x47b8('0x75')]=_0x5baf1a[0x0];if(!_0x5e4b92['body'][_0x47b8('0x63')])return;return db[_0x47b8('0x76')]['find']({'where':{'id':_0x5e4b92['body'][_0x47b8('0x63')],'role':'agent'},'attributes':['id','name',_0x47b8('0x77'),_0x47b8('0x83'),_0x47b8('0x78')],'raw':!![]});}return null;})['then'](function(_0x3559f4){if(!_0x3559f4)return null;_0x22f163[_0x47b8('0x2c')][_0x47b8('0x65')]=_0x3559f4;return _0x22f163;})[_0x47b8('0x3b')](function(_0x2faf37){if(_0x2faf37){_0x2faf37[_0x47b8('0x2c')][_0x47b8('0x79')]=util['format'](_0x47b8('0x7a'),_0x5e4b92[_0x47b8('0x64')][_0x47b8('0x3e')]);_0x2faf37[_0x47b8('0x2c')][_0x47b8('0x7b')]=_0x22f163[_0x47b8('0x7b')];_0x2faf37[_0x47b8('0x2c')][_0x47b8('0x84')]=_0x22f163[_0x47b8('0x7b')];_0x2faf37[_0x47b8('0x2c')][_0x47b8('0x85')]=_0x47b8('0x38');respondWithRpcPromise(_0x47b8('0x7d'),_0x47b8('0x7d'),{'event':_0x47b8('0x86'),'message':_0x2faf37[_0x47b8('0x2c')]},client9002);return _0x22f163;}return null;})[_0x47b8('0x3b')](respondWithResult(_0x437cc5,null))[_0x47b8('0x2e')](handleError(_0x437cc5,null));};exports[_0x47b8('0x2f')]=function(_0xd8fc8c,_0x25d129,_0x4d27a4){if(_0xd8fc8c[_0x47b8('0x5c')]['id']){delete _0xd8fc8c[_0x47b8('0x5c')]['id'];}var _0x4d5e21;return db[_0x47b8('0x56')][_0x47b8('0x5b')]({'where':{'id':_0xd8fc8c[_0x47b8('0x59')]['id']}})['then'](handleEntityNotFound(_0x25d129,null))[_0x47b8('0x3b')](function(_0x175fb5){if(_0x175fb5){_0x4d5e21=_0x175fb5;return db[_0x47b8('0x87')][_0x47b8('0x5b')]({'where':{'id':_0x175fb5[_0x47b8('0x88')]}});}})[_0x47b8('0x3b')](handleEntityNotFound(_0x25d129,null))[_0x47b8('0x3b')](function(_0x24197b){if(_0x24197b){logger[_0x47b8('0x89')](_0x47b8('0x8a'),_0x47b8('0x2f'),'received\x20delivery\x20report\x20from',_0x24197b[_0x47b8('0x42')],util[_0x47b8('0x8b')](_0xd8fc8c[_0x47b8('0x5c')],{'showHidden':![],'depth':null}));switch(_0x24197b[_0x47b8('0x42')]){case _0x47b8('0x8c'):if(_0xd8fc8c[_0x47b8('0x5c')]['MessageSid']&&_0xd8fc8c[_0x47b8('0x5c')][_0x47b8('0x8d')]===_0x4d5e21[_0x47b8('0x8e')]){return _0x4d5e21['update']({'read':!![]});}else{logger[_0x47b8('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47b8('0x2f'),_0x47b8('0x8c'),util[_0x47b8('0x8b')](_0xd8fc8c[_0x47b8('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x47b8('0x8f'):if(_0xd8fc8c[_0x47b8('0x5c')][_0x47b8('0x90')]&&_0xd8fc8c['body'][_0x47b8('0x90')]===_0x4d5e21[_0x47b8('0x8e')]&&_['indexOf'](['sent',_0x47b8('0x91')],_0xd8fc8c['body']['Status'])>=0x0){return _0x4d5e21[_0x47b8('0x3a')]({'read':!![]});}else{logger[_0x47b8('0x2a')](_0x47b8('0x92'),_0x47b8('0x2f'),_0x47b8('0x93'),util[_0x47b8('0x8b')](_0xd8fc8c[_0x47b8('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xc70488=_0xd8fc8c['body'][_0x47b8('0x94')][0x0];if(_0xc70488[_0x47b8('0x2f')][_0x47b8('0x95')]==='DELIVERED'){return _0x4d5e21[_0x47b8('0x3a')]({'read':!![]});}else{logger[_0x47b8('0x2a')](_0x47b8('0x92'),_0x47b8('0x2f'),_0x47b8('0x96'),util[_0x47b8('0x8b')](_0xd8fc8c[_0x47b8('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x4d5e21;}})[_0x47b8('0x3b')](respondWithResult(_0x25d129,null))[_0x47b8('0x2e')](handleError(_0x25d129,null));};
\ No newline at end of file
+var _0x839b=['params','describe','sms-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','isNil','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','agent','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','motionChannel','SmsAccount','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./smsMessage.socket','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','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','SmsMessage','rawAttributes','type','key','model','query','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filters','merge','filter','options','include','findAll','show','length','create','body','find'];(function(_0x3f578f,_0x51f172){var _0x32c754=function(_0x1bd873){while(--_0x1bd873){_0x3f578f['push'](_0x3f578f['shift']());}};_0x32c754(++_0x51f172);}(_0x839b,0x1d5));var _0xb839=function(_0x585549,_0x2c6f4e){_0x585549=_0x585549-0x0;var _0x30bca0=_0x839b[_0x585549];return _0x30bca0;};'use strict';var emlformat=require(_0xb839('0x0'));var rimraf=require(_0xb839('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb839('0x2'));var rp=require(_0xb839('0x3'));var moment=require(_0xb839('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb839('0x5'));var util=require('util');var path=require(_0xb839('0x6'));var sox=require(_0xb839('0x7'));var csv=require(_0xb839('0x8'));var ejs=require(_0xb839('0x9'));var fs=require('fs');var fs_extra=require(_0xb839('0xa'));var _=require(_0xb839('0xb'));var squel=require(_0xb839('0xc'));var crypto=require(_0xb839('0xd'));var jsforce=require(_0xb839('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb839('0xf'));var Papa=require(_0xb839('0x10'));var Redis=require(_0xb839('0x11'));var authService=require(_0xb839('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb839('0x13'));var hardwareService=require(_0xb839('0x14'));var logger=require(_0xb839('0x15'))(_0xb839('0x16'));var utils=require(_0xb839('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb839('0x18'));var db=require('../../mysqldb')['db'];config[_0xb839('0x19')]=_['defaults'](config[_0xb839('0x19')],{'host':_0xb839('0x1a'),'port':0x18eb});var socket=require(_0xb839('0x1b'))(new Redis(config['redis']));require(_0xb839('0x1c'))[_0xb839('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb839('0x1e')][_0xb839('0x1f')]({'port':0x232c});var client9002=jayson[_0xb839('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x552e7e,_0x147b5d,_0x1d239e,_0x65712e){return new BPromise(function(_0x57eaac,_0x2e1ce2){var _0x55ed36=_0x65712e||client;return _0x55ed36['request'](_0x552e7e,_0x1d239e)[_0xb839('0x20')](function(_0xe16062){logger[_0xb839('0x21')](_0xb839('0x22'),_0x147b5d,_0xb839('0x23'));logger[_0xb839('0x24')](_0xb839('0x25'),_0x147b5d,_0xb839('0x23'),JSON[_0xb839('0x26')](_0xe16062));if(_0xe16062[_0xb839('0x27')]){if(_0xe16062[_0xb839('0x27')][_0xb839('0x28')]===0x1f4){logger[_0xb839('0x27')](_0xb839('0x22'),_0x147b5d,_0xe16062[_0xb839('0x27')]['message']);return _0x2e1ce2(_0xe16062[_0xb839('0x27')]['message']);}logger[_0xb839('0x27')](_0xb839('0x22'),_0x147b5d,_0xe16062[_0xb839('0x27')][_0xb839('0x29')]);return _0x57eaac(_0xe16062[_0xb839('0x27')]['message']);}else{logger[_0xb839('0x21')](_0xb839('0x22'),_0x147b5d,_0xb839('0x23'));_0x57eaac(_0xe16062[_0xb839('0x2a')][_0xb839('0x29')]);}})[_0xb839('0x2b')](function(_0x5f2919){logger[_0xb839('0x27')]('SmsMessage,\x20%s,\x20%s',_0x147b5d,_0x5f2919);_0x2e1ce2(_0x5f2919);});});}function respondWithStatusCode(_0x235b44,_0x11e07b){_0x11e07b=_0x11e07b||0xcc;return function(_0x2d76b2){if(_0x2d76b2){return _0x235b44[_0xb839('0x2c')](_0x11e07b);}return _0x235b44[_0xb839('0x2d')](_0x11e07b)[_0xb839('0x2e')]();};}function respondWithResult(_0x298788,_0x3cccda){_0x3cccda=_0x3cccda||0xc8;return function(_0x37a201){if(_0x37a201){return _0x298788[_0xb839('0x2d')](_0x3cccda)[_0xb839('0x2f')](_0x37a201);}};}function respondWithFilteredResult(_0xf3ff8b,_0x544229){return function(_0x1cb100){if(_0x1cb100){var _0x52e28e=typeof _0x544229[_0xb839('0x30')]===_0xb839('0x31')&&typeof _0x544229[_0xb839('0x32')]===_0xb839('0x31');var _0x1ff577=_0x1cb100[_0xb839('0x33')];var _0x58ec68=_0x52e28e?0x0:_0x544229[_0xb839('0x30')];var _0x35aa54=_0x52e28e?_0x1cb100[_0xb839('0x33')]:_0x544229['offset']+_0x544229[_0xb839('0x32')];var _0x24b683;if(_0x35aa54>=_0x1ff577){_0x35aa54=_0x1ff577;_0x24b683=0xc8;}else{_0x24b683=0xce;}_0xf3ff8b[_0xb839('0x2d')](_0x24b683);return _0xf3ff8b[_0xb839('0x34')](_0xb839('0x35'),_0x58ec68+'-'+_0x35aa54+'/'+_0x1ff577)[_0xb839('0x2f')](_0x1cb100);}return null;};}function patchUpdates(_0x5cf662){return function(_0x2a4353){try{jsonpatch[_0xb839('0x36')](_0x2a4353,_0x5cf662,!![]);}catch(_0x391623){return BPromise[_0xb839('0x37')](_0x391623);}return _0x2a4353[_0xb839('0x38')]();};}function saveUpdates(_0x39e249,_0x2dc051){return function(_0x5ca5a9){if(_0x5ca5a9){return _0x5ca5a9[_0xb839('0x39')](_0x39e249)[_0xb839('0x20')](function(_0x257e5f){return _0x257e5f;});}return null;};}function removeEntity(_0x243a08,_0x61efcc){return function(_0x55d3df){if(_0x55d3df){return _0x55d3df[_0xb839('0x3a')]()[_0xb839('0x20')](function(){_0x243a08[_0xb839('0x2d')](0xcc)[_0xb839('0x2e')]();});}};}function handleEntityNotFound(_0x27a61d,_0x531c83){return function(_0x296481){if(!_0x296481){_0x27a61d[_0xb839('0x2c')](0x194);}return _0x296481;};}function handleError(_0x4a0f32,_0x2b7f63){_0x2b7f63=_0x2b7f63||0x1f4;return function(_0x517f8a){logger[_0xb839('0x27')](_0x517f8a[_0xb839('0x3b')]);if(_0x517f8a[_0xb839('0x3c')]){delete _0x517f8a[_0xb839('0x3c')];}_0x4a0f32['status'](_0x2b7f63)[_0xb839('0x3d')](_0x517f8a);};}exports['index']=function(_0x1816db,_0x2e275e){var _0x17d1f2={},_0x58bb83={},_0x427770={'count':0x0,'rows':[]};var _0x5137b5=_[_0xb839('0x3e')](db[_0xb839('0x3f')][_0xb839('0x40')],function(_0x52452d){return{'name':_0x52452d['fieldName'],'type':_0x52452d[_0xb839('0x41')][_0xb839('0x42')]};});_0x58bb83[_0xb839('0x43')]=_['map'](_0x5137b5,_0xb839('0x3c'));_0x58bb83[_0xb839('0x44')]=_['keys'](_0x1816db[_0xb839('0x44')]);_0x58bb83['filters']=_['intersection'](_0x58bb83[_0xb839('0x43')],_0x58bb83[_0xb839('0x44')]);_0x17d1f2[_0xb839('0x45')]=_[_0xb839('0x46')](_0x58bb83[_0xb839('0x43')],qs[_0xb839('0x47')](_0x1816db[_0xb839('0x44')][_0xb839('0x47')]));_0x17d1f2[_0xb839('0x45')]=_0x17d1f2[_0xb839('0x45')]['length']?_0x17d1f2[_0xb839('0x45')]:_0x58bb83[_0xb839('0x43')];if(!_0x1816db[_0xb839('0x44')][_0xb839('0x48')]('nolimit')){_0x17d1f2['limit']=qs[_0xb839('0x32')](_0x1816db[_0xb839('0x44')]['limit']);_0x17d1f2[_0xb839('0x30')]=qs[_0xb839('0x30')](_0x1816db[_0xb839('0x44')][_0xb839('0x30')]);}_0x17d1f2['order']=qs['sort'](_0x1816db['query'][_0xb839('0x49')]);_0x17d1f2[_0xb839('0x4a')]=qs['filters'](_[_0xb839('0x4b')](_0x1816db[_0xb839('0x44')],_0x58bb83[_0xb839('0x4c')]),_0x5137b5);if(_0x1816db[_0xb839('0x44')]['filter']){_0x17d1f2[_0xb839('0x4a')]=_[_0xb839('0x4d')](_0x17d1f2[_0xb839('0x4a')],{'$or':_[_0xb839('0x3e')](_0x5137b5,function(_0x589e5e){if(_0x589e5e[_0xb839('0x41')]!=='VIRTUAL'){var _0x5b229c={};_0x5b229c[_0x589e5e[_0xb839('0x3c')]]={'$like':'%'+_0x1816db[_0xb839('0x44')][_0xb839('0x4e')]+'%'};return _0x5b229c;}})});}_0x17d1f2=_[_0xb839('0x4d')]({},_0x17d1f2,_0x1816db[_0xb839('0x4f')]);var _0x4dd40b={'where':_0x17d1f2[_0xb839('0x4a')]};return db[_0xb839('0x3f')][_0xb839('0x33')](_0x4dd40b)[_0xb839('0x20')](function(_0x5deaec){_0x427770[_0xb839('0x33')]=_0x5deaec;if(_0x1816db[_0xb839('0x44')]['includeAll']){_0x17d1f2[_0xb839('0x50')]=[{'all':!![]}];}return db['SmsMessage'][_0xb839('0x51')](_0x17d1f2);})['then'](function(_0x5f30c3){_0x427770['rows']=_0x5f30c3;return _0x427770;})[_0xb839('0x20')](respondWithFilteredResult(_0x2e275e,_0x17d1f2))[_0xb839('0x2b')](handleError(_0x2e275e,null));};exports[_0xb839('0x52')]=function(_0x3c4b21,_0x29f1f3){var _0x6b03f7={'raw':!![],'where':{'id':_0x3c4b21['params']['id']}},_0x52db0d={};_0x52db0d['model']=_['keys'](db['SmsMessage'][_0xb839('0x40')]);_0x52db0d['query']=_['keys'](_0x3c4b21['query']);_0x52db0d['filters']=_[_0xb839('0x46')](_0x52db0d[_0xb839('0x43')],_0x52db0d[_0xb839('0x44')]);_0x6b03f7[_0xb839('0x45')]=_[_0xb839('0x46')](_0x52db0d[_0xb839('0x43')],qs[_0xb839('0x47')](_0x3c4b21['query'][_0xb839('0x47')]));_0x6b03f7[_0xb839('0x45')]=_0x6b03f7[_0xb839('0x45')][_0xb839('0x53')]?_0x6b03f7[_0xb839('0x45')]:_0x52db0d[_0xb839('0x43')];if(_0x3c4b21[_0xb839('0x44')]['includeAll']){_0x6b03f7[_0xb839('0x50')]=[{'all':!![]}];}_0x6b03f7=_[_0xb839('0x4d')]({},_0x6b03f7,_0x3c4b21[_0xb839('0x4f')]);return db[_0xb839('0x3f')]['find'](_0x6b03f7)[_0xb839('0x20')](handleEntityNotFound(_0x29f1f3,null))['then'](respondWithResult(_0x29f1f3,null))[_0xb839('0x2b')](handleError(_0x29f1f3,null));};exports[_0xb839('0x54')]=function(_0x367f75,_0xc562e9){return db[_0xb839('0x3f')][_0xb839('0x54')](_0x367f75[_0xb839('0x55')],{})['then'](respondWithResult(_0xc562e9,0xc9))[_0xb839('0x2b')](handleError(_0xc562e9,null));};exports[_0xb839('0x39')]=function(_0x5e14ef,_0x318f3e){if(_0x5e14ef['body']['id']){delete _0x5e14ef[_0xb839('0x55')]['id'];}return db['SmsMessage'][_0xb839('0x56')]({'where':{'id':_0x5e14ef[_0xb839('0x57')]['id']}})[_0xb839('0x20')](handleEntityNotFound(_0x318f3e,null))['then'](saveUpdates(_0x5e14ef[_0xb839('0x55')],null))[_0xb839('0x20')](respondWithResult(_0x318f3e,null))[_0xb839('0x2b')](handleError(_0x318f3e,null));};exports[_0xb839('0x3a')]=function(_0x2731fd,_0x3a316b){return db[_0xb839('0x3f')]['find']({'where':{'id':_0x2731fd['params']['id']}})[_0xb839('0x20')](handleEntityNotFound(_0x3a316b,null))['then'](removeEntity(_0x3a316b,null))[_0xb839('0x2b')](handleError(_0x3a316b,null));};exports[_0xb839('0x58')]=function(_0x438db7,_0x575683){return db['SmsMessage'][_0xb839('0x58')]()[_0xb839('0x20')](respondWithResult(_0x575683,null))[_0xb839('0x2b')](handleError(_0x575683,null));};var interaction_log=require('../../config/logger')(_0xb839('0x59'));exports[_0xb839('0x5a')]=function(_0x42a06e,_0x1f72b3,_0x241ac8){var _0x69c772={'agent':{},'channel':'sms'};if(_0x42a06e['body']['id']){delete _0x42a06e[_0xb839('0x55')]['id'];}_0x42a06e[_0xb839('0x55')]['read']=!![];_0x42a06e['body'][_0xb839('0x5b')]=moment()[_0xb839('0x5c')](_0xb839('0x5d'));_0x42a06e[_0xb839('0x55')][_0xb839('0x5e')]=_0x42a06e[_0xb839('0x55')][_0xb839('0x5e')]||_0x42a06e[_0xb839('0x5f')]['id'];_0x69c772['agent']['id']=_0x42a06e[_0xb839('0x55')]['UserId'];return db[_0xb839('0x3f')][_0xb839('0x56')]({'where':{'id':_0x42a06e[_0xb839('0x57')]['id'],'UserId':null}})[_0xb839('0x20')](handleEntityNotFound(_0x1f72b3,null))[_0xb839('0x20')](saveUpdates(_0x42a06e['body'],null))['then'](function(_0x545237){if(_0x545237){_0x69c772[_0xb839('0x29')]=_0x545237[_0xb839('0x60')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x545237['SmsInteractionId']}});}return null;})[_0xb839('0x20')](handleEntityNotFound(_0x1f72b3,null))['then'](function(_0x8797f9){if(_0x8797f9){return _0x8797f9[_0xb839('0x39')]({'UserId':_0x42a06e['body']['UserId'],'read1stAt':_[_0xb839('0x61')](_0x8797f9['read1stAt'])?moment()[_0xb839('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x184270){if(_0x184270){_0x69c772['interaction']=_0x184270[_0xb839('0x60')]({'plain':!![]});interaction_log[_0xb839('0x21')](_0xb839('0x62'),_0x42a06e[_0xb839('0x5f')]['id'],_0x42a06e[_0xb839('0x5f')][_0xb839('0x3c')],_0x42a06e[_0xb839('0x5f')][_0xb839('0x63')],_0x69c772[_0xb839('0x64')]['id'],_0x42a06e[_0xb839('0x55')]?JSON['stringify'](_0x42a06e[_0xb839('0x55')]):_0xb839('0x65'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x69c772);}return null;})['then'](function(_0x12d0b6){var _0x475c14=_0xb839('0x66')+_0x12d0b6[_0xb839('0x29')][_0xb839('0x67')];return db['sequelize']['query'](_0x475c14,{'type':db[_0xb839('0x68')][_0xb839('0x69')]['SELECT'],'raw':!![]})[_0xb839('0x20')](function(_0x28eb6e){return _0x28eb6e;});})[_0xb839('0x20')](function(_0x4d7cf1){if(_0x4d7cf1){_0x69c772['message'][_0xb839('0x6a')]=_0x4d7cf1[0x0];if(!_0x42a06e[_0xb839('0x55')][_0xb839('0x5e')])return;return db[_0xb839('0x6b')]['find']({'where':{'id':_0x42a06e['body'][_0xb839('0x5e')],'role':'agent'},'attributes':['id',_0xb839('0x3c'),_0xb839('0x6c'),_0xb839('0x6d'),'internal'],'raw':!![]});}return null;})[_0xb839('0x20')](function(_0x7231c6){if(!_0x7231c6)return null;_0x69c772['message'][_0xb839('0x6e')]=_0x7231c6;return _0x69c772;})[_0xb839('0x20')](function(_0x5a40bc){if(_0x5a40bc){if(_0x42a06e[_0xb839('0x55')][_0xb839('0x6f')]){_0x69c772[_0xb839('0x29')][_0xb839('0x70')]=util[_0xb839('0x5c')](_0xb839('0x71'),_0x42a06e[_0xb839('0x5f')][_0xb839('0x3c')]);_0x69c772['message'][_0xb839('0x72')]=_0x69c772[_0xb839('0x72')];_0x69c772['message']['motionChannel']=_0x69c772['channel'];_0x69c772[_0xb839('0x29')][_0xb839('0x73')]=_0xb839('0x5a');return respondWithRpcPromise(_0xb839('0x74'),_0xb839('0x74'),{'event':_0xb839('0x75'),'message':_0x69c772[_0xb839('0x29')]},client9002)[_0xb839('0x20')](function(){return _0x69c772;});}return _0x69c772;}return null;})['then'](respondWithResult(_0x1f72b3,null))['catch'](handleError(_0x1f72b3,null));};var interaction_log=require(_0xb839('0x15'))(_0xb839('0x59'));exports[_0xb839('0x37')]=function(_0x515806,_0x526f0b,_0x46e414){var _0x15d327={'agent':{},'channel':_0xb839('0x76')};if(_0x515806[_0xb839('0x55')]['id']){delete _0x515806[_0xb839('0x55')]['id'];}_0x515806[_0xb839('0x55')]['UserId']=_0x515806['body'][_0xb839('0x5e')]||_0x515806[_0xb839('0x5f')]['id'];_0x15d327[_0xb839('0x6e')]['id']=_0x515806[_0xb839('0x55')]['UserId'];return db[_0xb839('0x3f')]['find']({'where':{'id':_0x515806[_0xb839('0x57')]['id'],'UserId':null}})[_0xb839('0x20')](handleEntityNotFound(_0x526f0b,null))[_0xb839('0x20')](function(_0x3a619e){if(_0x3a619e){_0x15d327[_0xb839('0x29')]=_0x3a619e[_0xb839('0x60')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x3a619e[_0xb839('0x77')]}});}return null;})[_0xb839('0x20')](handleEntityNotFound(_0x526f0b,null))['then'](function(_0x1d66cf){if(_0x1d66cf){_0x15d327[_0xb839('0x64')]=_0x1d66cf[_0xb839('0x60')]({'plain':!![]});interaction_log[_0xb839('0x21')](_0xb839('0x78'),_0x515806[_0xb839('0x5f')]['id'],_0x515806[_0xb839('0x5f')][_0xb839('0x3c')],_0x515806[_0xb839('0x5f')]['role'],_0x15d327[_0xb839('0x64')]['id'],_0x515806[_0xb839('0x55')]?JSON[_0xb839('0x26')](_0x515806[_0xb839('0x55')]):_0xb839('0x65'));return respondWithRpcPromise(_0xb839('0x79'),_0xb839('0x7a'),_0x15d327);}return null;})[_0xb839('0x20')](function(_0xa9402e){var _0x4ccee3=_0xb839('0x66')+_0xa9402e[_0xb839('0x29')][_0xb839('0x67')];return db['sequelize']['query'](_0x4ccee3,{'type':db[_0xb839('0x68')][_0xb839('0x69')]['SELECT'],'raw':!![]})[_0xb839('0x20')](function(_0x1d8883){return _0x1d8883;});})[_0xb839('0x20')](function(_0x38c99f){if(_0x38c99f){_0x15d327[_0xb839('0x29')][_0xb839('0x6a')]=_0x38c99f[0x0];if(!_0x515806[_0xb839('0x55')]['UserId'])return;return db['User'][_0xb839('0x56')]({'where':{'id':_0x515806[_0xb839('0x55')][_0xb839('0x5e')],'role':_0xb839('0x6e')},'attributes':['id',_0xb839('0x3c'),'fullname','email',_0xb839('0x7b')],'raw':!![]});}return null;})[_0xb839('0x20')](function(_0x55dd02){if(!_0x55dd02)return null;_0x15d327[_0xb839('0x29')]['agent']=_0x55dd02;return _0x15d327;})[_0xb839('0x20')](function(_0x5925b9){if(_0x5925b9){_0x5925b9[_0xb839('0x29')]['interface']=util[_0xb839('0x5c')](_0xb839('0x71'),_0x515806[_0xb839('0x5f')]['name']);_0x5925b9[_0xb839('0x29')][_0xb839('0x72')]=_0x15d327[_0xb839('0x72')];_0x5925b9[_0xb839('0x29')][_0xb839('0x7c')]=_0x15d327['channel'];_0x5925b9[_0xb839('0x29')]['event']=_0xb839('0x37');respondWithRpcPromise('EventManager',_0xb839('0x74'),{'event':'rejectmessage','message':_0x5925b9[_0xb839('0x29')]},client9002);return _0x15d327;}return null;})['then'](respondWithResult(_0x526f0b,null))[_0xb839('0x2b')](handleError(_0x526f0b,null));};exports[_0xb839('0x2d')]=function(_0xbcbef2,_0x51e6e9,_0x544e08){if(_0xbcbef2[_0xb839('0x55')]['id']){delete _0xbcbef2[_0xb839('0x55')]['id'];}var _0x10ee35;return db[_0xb839('0x3f')][_0xb839('0x56')]({'where':{'id':_0xbcbef2[_0xb839('0x57')]['id']}})[_0xb839('0x20')](handleEntityNotFound(_0x51e6e9,null))['then'](function(_0x5684c0){if(_0x5684c0){_0x10ee35=_0x5684c0;return db[_0xb839('0x7d')][_0xb839('0x56')]({'where':{'id':_0x5684c0['SmsAccountId']}});}})[_0xb839('0x20')](handleEntityNotFound(_0x51e6e9,null))[_0xb839('0x20')](function(_0x26eb50){if(_0x26eb50){logger[_0xb839('0x24')](_0xb839('0x25'),'status','received\x20delivery\x20report\x20from',_0x26eb50[_0xb839('0x41')],util['inspect'](_0xbcbef2[_0xb839('0x55')],{'showHidden':![],'depth':null}));switch(_0x26eb50['type']){case _0xb839('0x7e'):if(_0xbcbef2['body'][_0xb839('0x7f')]&&_0xbcbef2[_0xb839('0x55')][_0xb839('0x7f')]===_0x10ee35[_0xb839('0x80')]){return _0x10ee35[_0xb839('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb839('0x2d'),_0xb839('0x7e'),util[_0xb839('0x81')](_0xbcbef2[_0xb839('0x55')],{'showHidden':![],'depth':null}));}break;case _0xb839('0x82'):if(_0xbcbef2[_0xb839('0x55')][_0xb839('0x83')]&&_0xbcbef2[_0xb839('0x55')][_0xb839('0x83')]===_0x10ee35[_0xb839('0x80')]&&_[_0xb839('0x84')]([_0xb839('0x85'),_0xb839('0x86')],_0xbcbef2[_0xb839('0x55')]['Status'])>=0x0){return _0x10ee35[_0xb839('0x39')]({'read':!![]});}else{logger[_0xb839('0x27')](_0xb839('0x87'),_0xb839('0x2d'),_0xb839('0x88'),util[_0xb839('0x81')](_0xbcbef2['body'],{'showHidden':![],'depth':null}));}break;case _0xb839('0x89'):var _0x277ac2=_0xbcbef2[_0xb839('0x55')]['results'][0x0];if(_0x277ac2[_0xb839('0x2d')][_0xb839('0x8a')]==='DELIVERED'){return _0x10ee35[_0xb839('0x39')]({'read':!![]});}else{logger[_0xb839('0x27')](_0xb839('0x87'),_0xb839('0x2d'),_0xb839('0x89'),util[_0xb839('0x81')](_0xbcbef2[_0xb839('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x10ee35;}})[_0xb839('0x20')](respondWithResult(_0x51e6e9,null))['catch'](handleError(_0x51e6e9,null));};
\ No newline at end of file
index 79978b9..91b58bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64c8=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x5cabfd,_0x5dea47){var _0x4bc06c=function(_0x4a2fea){while(--_0x4a2fea){_0x5cabfd['push'](_0x5cabfd['shift']());}};_0x4bc06c(++_0x5dea47);}(_0x64c8,0x10e));var _0x864c=function(_0xce5337,_0x45f6d2){_0xce5337=_0xce5337-0x0;var _0x4e454c=_0x64c8[_0xce5337];return _0x4e454c;};'use strict';var EventEmitter=require(_0x864c('0x0'));var SmsMessage=require(_0x864c('0x1'))['db'][_0x864c('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x864c('0x3')](0x0);var events={'afterCreate':_0x864c('0x4'),'afterUpdate':_0x864c('0x5'),'afterDestroy':_0x864c('0x6')};function emitEvent(_0x37f866){return function(_0x2b9e03,_0x43fecb,_0x5c2363){SmsMessageEvents[_0x864c('0x7')](_0x37f866+':'+_0x2b9e03['id'],_0x2b9e03);SmsMessageEvents[_0x864c('0x7')](_0x37f866,_0x2b9e03);_0x5c2363(null);};}for(var e in events){if(events[_0x864c('0x8')](e)){var event=events[e];SmsMessage[_0x864c('0x9')](e,emitEvent(event));}}module[_0x864c('0xa')]=SmsMessageEvents;
\ No newline at end of file
+var _0x41e8=['hasOwnProperty','hook','exports','SmsMessage','update','remove','emit'];(function(_0x5dcfd0,_0x19b914){var _0x5e7661=function(_0x1b059c){while(--_0x1b059c){_0x5dcfd0['push'](_0x5dcfd0['shift']());}};_0x5e7661(++_0x19b914);}(_0x41e8,0x1a7));var _0x841e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x41e8[_0xa1e3e3];return _0xc980e9;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x841e('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x841e('0x1'),'afterDestroy':_0x841e('0x2')};function emitEvent(_0x472bd0){return function(_0x14ef02,_0x359b4a,_0x3d7c87){SmsMessageEvents[_0x841e('0x3')](_0x472bd0+':'+_0x14ef02['id'],_0x14ef02);SmsMessageEvents[_0x841e('0x3')](_0x472bd0,_0x14ef02);_0x3d7c87(null);};}for(var e in events){if(events[_0x841e('0x4')](e)){var event=events[e];SmsMessage[_0x841e('0x5')](e,emitEvent(event));}}module[_0x841e('0x6')]=SmsMessageEvents;
\ No newline at end of file
index ec8c635..8cdf983 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe732=['baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','timestamp','keys','length','apiKey','createHash','md5','digest','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','toLowerCase','secret','UserId','isNil','SmsInteraction','findOne','then','update','createdAt','direction','catch','error','out','SmsAccount','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','GET','user_key','total_sent','internal_order_id','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','requestid','deliveryReport','clicksend','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0xe732,0x99));var _0x2e73=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xe732[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x2e73('0x0'));var util=require(_0x2e73('0x1'));var logger=require(_0x2e73('0x2'))(_0x2e73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2e73('0x4'));var fs=require('fs');var path=require(_0x2e73('0x5'));var rimraf=require(_0x2e73('0x6'));var config=require(_0x2e73('0x7'));var attributes=require(_0x2e73('0x8'));module['exports']=function(_0x2eeccb,_0x203c11){return _0x2eeccb['define'](_0x2e73('0x9'),attributes,{'tableName':_0x2e73('0xa'),'paranoid':![],'indexes':[{'name':_0x2e73('0xb'),'fields':[_0x2e73('0xb')]},{'name':_0x2e73('0xc'),'fields':['body'],'type':_0x2e73('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x27aea0,_0x281b5b,_0x574512){var _0x4f5d3f=_0x2eeccb['models'];var _0x5d578c=_0x27aea0[_0x2e73('0xe')]({'plain':!![]});if(_0x5d578c['direction'][_0x2e73('0xf')]()==='in'||_0x5d578c['direction'][_0x2e73('0xf')]()==='out'&&!_0x5d578c[_0x2e73('0x10')]&&!_['isNil'](_0x5d578c[_0x2e73('0x11')])&&!_[_0x2e73('0x12')](_0x5d578c['SmsInteractionId'])){_0x4f5d3f[_0x2e73('0x13')][_0x2e73('0x14')]({'where':{'id':_0x5d578c['SmsInteractionId']}})[_0x2e73('0x15')](function(_0x1a0d9b){if(_0x1a0d9b){_0x1a0d9b[_0x2e73('0x16')]({'lastMsgAt':_0x5d578c[_0x2e73('0x17')],'lastMsgDirection':_0x5d578c[_0x2e73('0x18')][_0x2e73('0xf')]()});}})[_0x2e73('0x19')](function(_0x2d73c4){console[_0x2e73('0x1a')](_0x2d73c4);});}if(_0x5d578c[_0x2e73('0x18')]===_0x2e73('0x1b')&&!_0x5d578c[_0x2e73('0x10')]){var _0x5198e3;_0x4f5d3f[_0x2e73('0x1c')]['find']({'where':{'id':_0x5d578c['SmsAccountId']},'raw':!![]})['then'](function(_0x2c6f53){_0x5198e3=_0x2c6f53;if(_0x5198e3&&_0x5198e3['type']){switch(_0x5198e3[_0x2e73('0x1d')]){case _0x2e73('0x1e'):var _0xa0e3d1=require('twilio');if(_0x5198e3[_0x2e73('0x1f')]&&_0x5198e3[_0x2e73('0x20')]&&_0x5198e3[_0x2e73('0x21')]){var _0x4470f3=new _0xa0e3d1(_0x5198e3[_0x2e73('0x1f')],_0x5198e3[_0x2e73('0x20')]);_0x4470f3[_0x2e73('0x22')][_0x2e73('0x23')]({'body':_0x5d578c[_0x2e73('0x24')],'to':_0x5d578c[_0x2e73('0x21')],'from':_0x5198e3['phone'],'statusCallback':_0x5198e3[_0x2e73('0x25')]+'/api/sms/messages/'+_0x5d578c['id']+_0x2e73('0x26')+_0x5198e3[_0x2e73('0x27')]})[_0x2e73('0x15')](function(_0x420ebe){if(_0x420ebe[_0x2e73('0x28')]){return _0x27aea0['update']({'messageId':_0x420ebe['sid']});}})[_0x2e73('0x19')](function(_0x2e38e0){logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x1e'),util['inspect'](_0x2e38e0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2e73('0x29'),'afterCreate','twilio',_0x2e73('0x2b'));}break;case _0x2e73('0x2c'):var _0x8baa5f=_0x2e73('0x2d');if(_0x5198e3[_0x2e73('0x2e')]&&_0x5198e3[_0x2e73('0x2f')]){var _0x4b5c4e={'recipient':[_0x5d578c[_0x2e73('0x21')]],'message':_0x5d578c[_0x2e73('0x24')],'message_type':_0x5198e3[_0x2e73('0x30')]};if(_0x5198e3[_0x2e73('0x30')]&&_0x5198e3['smsMethod']!=='SI'){_0x4b5c4e['sender']=_0x5198e3[_0x2e73('0x21')];}var _0x507609={'url':_0x8baa5f+_0x2e73('0x31')+_0x5198e3['username']+'&password='+_0x5198e3[_0x2e73('0x2f')],'method':_0x2e73('0x32')};rp(_0x507609)[_0x2e73('0x15')](function(_0xf478ab){var _0x43da59=_0xf478ab['split'](';');var _0x4fae8e={'user_key':_0x43da59[0x0],'session_key':_0x43da59[0x1]};_0x507609={'url':_0x8baa5f+'sms','method':'POST','headers':{'user_key':_0x4fae8e[_0x2e73('0x33')],'Session_key':_0x4fae8e['session_key']},'json':!![],'body':_0x4b5c4e};return rp(_0x507609);})[_0x2e73('0x15')](function(_0x49026e){if(_0x49026e[_0x2e73('0x34')]>=0x1){var _0xe0db1f={'messageId':_0x49026e[_0x2e73('0x35')]};if(_0x5198e3['smsMethod']!=='GP'||!_0x5198e3['deliveryReport']){_0xe0db1f[_0x2e73('0x36')]=!![];}return _0x27aea0['update'](_0xe0db1f);}else{return logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x2c'),util[_0x2e73('0x37')](_0x49026e,{'showHidden':![],'depth':null}));}})[_0x2e73('0x19')](function(_0x2c6e41){return logger[_0x2e73('0x1a')](_0x2e73('0x29'),'afterCreate',_0x2e73('0x2c'),util[_0x2e73('0x37')](_0x2c6e41,{'showHidden':![],'depth':null}));});}else{logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x2c'),_0x2e73('0x38'));}break;case _0x2e73('0x39'):if(_0x5198e3[_0x2e73('0x20')]){var _0x2e651d={'recipient':_0x5d578c[_0x2e73('0x21')],'message':_0x5d578c['body'],'sender':_0x5198e3[_0x2e73('0x3a')]||_0x5198e3[_0x2e73('0x21')],'authorization':_0x5198e3[_0x2e73('0x20')]};var _0x281b5b={'method':_0x2e73('0x3b'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x2e651d,'json':!![]};rp(_0x281b5b)['then'](function(_0x569125){var _0x333bf4={'messageId':_0x569125[_0x2e73('0x3c')]};if(!_0x5198e3[_0x2e73('0x3d')]){_0x333bf4['read']=!![];}return _0x27aea0[_0x2e73('0x16')](_0x333bf4);})['catch'](function(_0x132656){logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),'connectel',util[_0x2e73('0x37')](_0x132656,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2e73('0x29'),_0x2e73('0x2a'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x2e73('0x3e'):if(_0x5198e3[_0x2e73('0x2e')]&&_0x5198e3[_0x2e73('0x2f')]){var _0x2e651d={'messages':[{'source':'xCALLY\x20Motion','to':_0x5d578c[_0x2e73('0x21')],'body':_0x5d578c['body'],'from':_0x5198e3[_0x2e73('0x3a')]||_0x5198e3[_0x2e73('0x21')]}]};var _0x18b22a=util['format'](_0x2e73('0x3f'),_0x5198e3[_0x2e73('0x2e')],_0x5198e3[_0x2e73('0x2f')]);var _0x281b5b={'method':_0x2e73('0x3b'),'uri':_0x2e73('0x40'),'body':_0x2e651d,'headers':{'Authorization':util[_0x2e73('0x41')](_0x2e73('0x42'),new Buffer(_0x18b22a)[_0x2e73('0x43')](_0x2e73('0x44')))},'json':!![]};rp(_0x281b5b)[_0x2e73('0x15')](function(_0x3eecb8){if(_0x3eecb8[_0x2e73('0x45')]>=0xc8&&_0x3eecb8[_0x2e73('0x45')]<=0xce){if(_0x3eecb8[_0x2e73('0x46')]&&_0x3eecb8[_0x2e73('0x46')][_0x2e73('0x47')]>0x0){var _0x3f24f0=_['head'](_0x3eecb8[_0x2e73('0x46')]['messages']);var _0x430b64={'messageId':_0x3f24f0[_0x2e73('0x48')]};if(!_0x5198e3['deliveryReport']){_0x430b64[_0x2e73('0x36')]=!![];}return _0x27aea0['update'](_0x430b64);}else{logger['error'](_0x2e73('0x29'),_0x2e73('0x2a'),'clickSend',util[_0x2e73('0x37')](_0x3eecb8,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x49'),util[_0x2e73('0x37')](_0x3eecb8,{'showHidden':![],'depth':null}));}})[_0x2e73('0x19')](function(_0x234492){logger['error'](_0x2e73('0x29'),'afterCreate',_0x2e73('0x49'),util[_0x2e73('0x37')](_0x234492,{'showHidden':![],'depth':null}));});}else{logger[_0x2e73('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',_0x2e73('0x38'));}break;case _0x2e73('0x4a'):if(_0x5198e3[_0x2e73('0x4b')]&&_0x5198e3[_0x2e73('0x20')]){var _0x2e651d={'dst':_0x5d578c[_0x2e73('0x21')],'text':_0x5d578c['body'],'src':_0x5198e3[_0x2e73('0x3a')]||_0x5198e3[_0x2e73('0x21')],'url':_0x5198e3[_0x2e73('0x25')]+_0x2e73('0x4c')+_0x5d578c['id']+_0x2e73('0x26')+_0x5198e3[_0x2e73('0x27')]};var _0x18b22a=util[_0x2e73('0x41')](_0x2e73('0x3f'),_0x5198e3['authId'],_0x5198e3[_0x2e73('0x20')]);var _0x281b5b={'method':'POST','uri':util['format'](_0x2e73('0x4d'),_0x5198e3[_0x2e73('0x4b')]),'body':_0x2e651d,'headers':{'Authorization':util['format'](_0x2e73('0x42'),new Buffer(_0x18b22a)[_0x2e73('0x43')](_0x2e73('0x44')))},'json':!![]};rp(_0x281b5b)[_0x2e73('0x15')](function(_0x21d209){var _0x309661={'messageId':_0x21d209[_0x2e73('0x4e')][0x0]};return _0x27aea0[_0x2e73('0x16')](_0x309661);})[_0x2e73('0x19')](function(_0x5a1046){logger['error'](_0x2e73('0x29'),'afterCreate','plivo',util['inspect'](_0x5a1046,{'showHidden':![],'depth':null}));});}else{logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),'plivo',_0x2e73('0x4f'));}break;case _0x2e73('0x50'):if(_0x5198e3['username']&&_0x5198e3[_0x2e73('0x2f')]){if(_0x5198e3[_0x2e73('0x51')]){var _0x15af9c={'method':_0x2e73('0x3b'),'uri':_0x5198e3[_0x2e73('0x51')]+_0x2e73('0x52'),'body':{'username':_0x5198e3[_0x2e73('0x2e')],'password':_0x5198e3[_0x2e73('0x2f')]},'json':!![]};return rp(_0x15af9c)[_0x2e73('0x15')](function(_0x398bf8){var _0x5dc87e={'method':_0x2e73('0x3b'),'uri':_0x5198e3[_0x2e73('0x51')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5198e3['phone'],'destinations':[{'to':_0x5d578c['phone']}],'text':_0x5d578c['body'],'notifyUrl':_0x5198e3[_0x2e73('0x25')]+_0x2e73('0x4c')+_0x5d578c['id']+_0x2e73('0x26')+_0x5198e3[_0x2e73('0x27')],'notifyContentType':_0x2e73('0x53'),'callbackData':_0x5198e3[_0x2e73('0x21')]+';'+_0x5d578c[_0x2e73('0x24')]}]},'headers':{'Authorization':_0x2e73('0x54')+_0x398bf8[_0x2e73('0x27')]},'json':!![]};return rp(_0x5dc87e)['then'](function(_0x3947de){if(_0x3947de[_0x2e73('0x22')]){var _0x27e7e1={'messageId':_0x3947de[_0x2e73('0x22')][0x0][_0x2e73('0xb')]};if(!_0x5198e3[_0x2e73('0x3d')]){_0x27e7e1[_0x2e73('0x36')]=!![];}return _0x27aea0[_0x2e73('0x16')](_0x27e7e1);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2e73('0x2a'),_0x2e73('0x50'),util[_0x2e73('0x37')](_0x3947de,{'showHidden':![],'depth':null}));}});})[_0x2e73('0x19')](function(_0x127d57){return logger['error'](_0x2e73('0x29'),'afterCreate',_0x2e73('0x50'),util[_0x2e73('0x37')](_0x127d57,{'showHidden':![],'depth':null}));});}else{logger[_0x2e73('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2e73('0x2a'),_0x2e73('0x50'),_0x2e73('0x55'));}}else{logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x50'),_0x2e73('0x38'));}break;case _0x2e73('0x56'):var _0x2afd32=require(_0x2e73('0x57'));if(_0x5198e3['apiKey']){var _0x50ca70={};_0x50ca70[_0x2e73('0x58')]=_0x5198e3['username'];_0x50ca70[_0x2e73('0x21')]=_0x5d578c[_0x2e73('0x21')];_0x50ca70['sender']=_0x5198e3[_0x2e73('0x21')];_0x50ca70['text']=_0x5d578c[_0x2e73('0x24')];_0x50ca70[_0x2e73('0x59')]=+new Date();var _0x2d53bf='';var _0x18849e='';var _0x4a3087=Object[_0x2e73('0x5a')](_0x50ca70);_0x4a3087['sort']();for(var _0x2f1106=0x0;_0x2f1106<_0x4a3087[_0x2e73('0x5b')];_0x2f1106++){if(_0x2d53bf!=''){_0x2d53bf+='&';}_0x2d53bf+=_0x4a3087[_0x2f1106]+'='+encodeURIComponent(_0x50ca70[_0x4a3087[_0x2f1106]]);_0x18849e+=_0x50ca70[_0x4a3087[_0x2f1106]];}_0x18849e+=_0x5198e3[_0x2e73('0x5c')];_0x18849e=_0x2afd32[_0x2e73('0x5d')](_0x2e73('0x5e'))[_0x2e73('0x16')](_0x18849e)[_0x2e73('0x5f')]('hex');if(_0x2d53bf!==''){_0x2d53bf+='&';}_0x2d53bf+='signature='+_0x18849e;var _0x507609={'method':'GET','uri':_0x5198e3[_0x2e73('0x51')]+_0x2e73('0x60')+_0x2d53bf,'json':!![]};return rp(_0x507609)[_0x2e73('0x15')](function(_0x4c4507){var _0x5e5f06=Object[_0x2e73('0x5a')](_0x4c4507);if(_0x4c4507[_0x5e5f06[0x0]][_0x2e73('0x1a')]&&parseInt(_0x4c4507[_0x5e5f06[0x0]][_0x2e73('0x1a')])===0x0){var _0x6d759c={'messageId':_0x4c4507[_0x5e5f06[0x0]][_0x2e73('0x61')]};if(!_0x5198e3[_0x2e73('0x3d')]){_0x6d759c[_0x2e73('0x36')]=!![];}return _0x27aea0[_0x2e73('0x16')](_0x6d759c);}else{return logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x56'),util[_0x2e73('0x37')](_0x4c4507[_0x2e73('0x1a')],{'showHidden':![],'depth':null}));}})[_0x2e73('0x19')](function(_0x172c5b){return logger['error'](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x56'),util[_0x2e73('0x37')](_0x172c5b,{'showHidden':![],'depth':null}));});}else{logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x56'),_0x2e73('0x62'));}break;case _0x2e73('0x63'):if(_0x5198e3[_0x2e73('0x5c')]){var _0x447235={'method':_0x2e73('0x3b'),'uri':_0x2e73('0x64'),'headers':{'Authorization':_0x5198e3[_0x2e73('0x5c')]},'body':{'content':_0x5d578c[_0x2e73('0x24')],'to':[_0x5d578c[_0x2e73('0x21')]],'from':_0x5198e3[_0x2e73('0x21')],'binary':![],'clientMessageId':_0x2e73('0x65'),'charset':_0x2e73('0x66')},'json':!![]};rp(_0x447235)['then'](function(_0x32e202){if(!_0x32e202[_0x2e73('0x1a')]){var _0x565f22={'messageId':_0x32e202[_0x2e73('0x22')][0x0]['apiMessageId']};if(!_0x5198e3[_0x2e73('0x3d')]){_0x565f22[_0x2e73('0x36')]=!![];}return _0x27aea0[_0x2e73('0x16')](_0x565f22);}else{return logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x63'),util[_0x2e73('0x37')](_0x32e202[_0x2e73('0x1a')],{'showHidden':![],'depth':null}));}})[_0x2e73('0x19')](function(_0x20df77){return logger[_0x2e73('0x1a')](_0x2e73('0x29'),'afterCreate',_0x2e73('0x63'),util[_0x2e73('0x37')](_0x20df77,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x63'),_0x2e73('0x62'));}break;case _0x2e73('0x67'):if(_0x5198e3[_0x2e73('0x2e')]&&_0x5198e3[_0x2e73('0x2f')]){var _0x18b22a=util[_0x2e73('0x41')](_0x2e73('0x3f'),_0x5198e3[_0x2e73('0x2e')],_0x5198e3[_0x2e73('0x2f')]);var _0x281b5b={'method':'POST','uri':_0x2e73('0x68')+_0x5198e3[_0x2e73('0x69')]+'/messages','body':{'to':[_0x5d578c[_0x2e73('0x21')]],'text':_0x5d578c['body'],'from':_0x5198e3[_0x2e73('0x21')],'applicationId':_0x5198e3[_0x2e73('0x6a')]},'headers':{'Authorization':util[_0x2e73('0x41')]('Basic\x20%s',new Buffer(_0x18b22a)[_0x2e73('0x43')](_0x2e73('0x44')))},'json':!![]};rp(_0x281b5b)['then'](function(_0x234872){if(_0x234872['id']){var _0xa1f42b={'messageId':_0x234872['id']};return _0x27aea0[_0x2e73('0x16')](_0xa1f42b);}else{logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x67'),util[_0x2e73('0x37')](_0x234872,{'showHidden':![],'depth':null}));}})[_0x2e73('0x19')](function(_0x372a9a){logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x67'),util['inspect'](_0x372a9a,{'showHidden':![],'depth':null}));});}else{logger[_0x2e73('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2e73('0x2a'),_0x2e73('0x67'),_0x2e73('0x38'));}break;case'intelepeer':if(_0x5198e3['apiKey']){var _0xa96fdf={};var _0x507609={'method':_0x2e73('0x3b'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x5198e3[_0x2e73('0x5c')],'Content-Type':_0x2e73('0x53')},'body':{'from':_0x5198e3[_0x2e73('0x21')],'to':_0x5d578c[_0x2e73('0x21')],'text':_0x5d578c[_0x2e73('0x24')]},'json':!![]};return rp(_0x507609)['then'](function(_0x36fef7){if(_0x36fef7[_0x2e73('0x6b')]==0xca){_0xa96fdf[_0x2e73('0x6c')]=_0x36fef7;var _0x317e38={'method':'POST','uri':_0x2e73('0x6d'),'headers':{'Authorization':_0x2e73('0x6e')+_0x5198e3[_0x2e73('0x5c')],'Content-Type':_0x2e73('0x53')},'body':{'refid':_0xa96fdf[_0x2e73('0x6c')][_0x2e73('0x6f')]},'json':!![]};return rp(_0x317e38)['then'](function(_0x342282){_0xa96fdf['status']=_0x342282;var _0x98ba42={'messageId':_0xa96fdf['message']['refid'],'read':!![]};return _0x27aea0['update'](_0x98ba42);});}else{return logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),'intelepeer',util[_0x2e73('0x37')](_0x36fef7,{'showHidden':![],'depth':null}));}})[_0x2e73('0x19')](function(_0xf18968){return logger['error'](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x70'),util[_0x2e73('0x37')](_0xf18968,{'showHidden':![],'depth':null}));});}else{return logger[_0x2e73('0x1a')](_0x2e73('0x29'),_0x2e73('0x2a'),_0x2e73('0x70'),_0x2e73('0x71'));}break;}}})[_0x2e73('0x72')](function(){_0x574512();});}else{_0x574512();}}},'charset':_0x2e73('0x73'),'collate':_0x2e73('0x74')});};
\ No newline at end of file
+var _0xf9fd=['Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','exports','define','SmsMessage','sms_messages','messageId','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','username','password','smsMethod','login?username=','&password=','GET','sms','POST','total_sent','internal_order_id','deliveryReport','read','skebby','error','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','base64','data','queued_count','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','sender','timestamp','keys','sort','length','apiKey','createHash','md5','digest','hex','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9fd,0x1d8));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdf9f('0x0'));var util=require(_0xdf9f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdf9f('0x2'));var BPromise=require(_0xdf9f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf9f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0xdf9f('0x5')]=function(_0x3d4dbf,_0xf70f3){return _0x3d4dbf[_0xdf9f('0x6')](_0xdf9f('0x7'),attributes,{'tableName':_0xdf9f('0x8'),'paranoid':![],'indexes':[{'name':_0xdf9f('0x9'),'fields':[_0xdf9f('0x9')]},{'name':'fti_sms_messages','fields':['body'],'type':_0xdf9f('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x500c4c,_0x413af8,_0x4eb1c6){var _0x43dbd8=_0x3d4dbf[_0xdf9f('0xb')];var _0x1f8a27=_0x500c4c['get']({'plain':!![]});if(_0x1f8a27[_0xdf9f('0xc')]['toLowerCase']()==='in'||_0x1f8a27[_0xdf9f('0xc')][_0xdf9f('0xd')]()==='out'&&!_0x1f8a27[_0xdf9f('0xe')]&&!_[_0xdf9f('0xf')](_0x1f8a27[_0xdf9f('0x10')])&&!_['isNil'](_0x1f8a27[_0xdf9f('0x11')])){_0x43dbd8[_0xdf9f('0x12')]['findOne']({'where':{'id':_0x1f8a27['SmsInteractionId']}})[_0xdf9f('0x13')](function(_0x5048db){if(_0x5048db){_0x5048db[_0xdf9f('0x14')]({'lastMsgAt':_0x1f8a27[_0xdf9f('0x15')],'lastMsgDirection':_0x1f8a27['direction'][_0xdf9f('0xd')]()});}})[_0xdf9f('0x16')](function(_0x5e7d3a){console['error'](_0x5e7d3a);});}if(_0x1f8a27['direction']===_0xdf9f('0x17')&&!_0x1f8a27[_0xdf9f('0xe')]){var _0x461bd3;_0x43dbd8[_0xdf9f('0x18')][_0xdf9f('0x19')]({'where':{'id':_0x1f8a27[_0xdf9f('0x1a')]},'raw':!![]})[_0xdf9f('0x13')](function(_0x1302a3){_0x461bd3=_0x1302a3;if(_0x461bd3&&_0x461bd3[_0xdf9f('0x1b')]){switch(_0x461bd3[_0xdf9f('0x1b')]){case'twilio':var _0x12f7a8=require(_0xdf9f('0x1c'));if(_0x461bd3[_0xdf9f('0x1d')]&&_0x461bd3[_0xdf9f('0x1e')]&&_0x461bd3[_0xdf9f('0x1f')]){var _0x29af4c=new _0x12f7a8(_0x461bd3[_0xdf9f('0x1d')],_0x461bd3[_0xdf9f('0x1e')]);_0x29af4c[_0xdf9f('0x20')][_0xdf9f('0x21')]({'body':_0x1f8a27[_0xdf9f('0x22')],'to':_0x1f8a27['phone'],'from':_0x461bd3['phone'],'statusCallback':_0x461bd3[_0xdf9f('0x23')]+_0xdf9f('0x24')+_0x1f8a27['id']+_0xdf9f('0x25')+_0x461bd3['token']})[_0xdf9f('0x13')](function(_0x2ab530){if(_0x2ab530[_0xdf9f('0x26')]){return _0x500c4c[_0xdf9f('0x14')]({'messageId':_0x2ab530[_0xdf9f('0x26')]});}})[_0xdf9f('0x16')](function(_0x46ef32){logger['error'](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x1c'),util[_0xdf9f('0x29')](_0x46ef32,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x178af8='https://api.skebby.it/API/v1.0/REST/';if(_0x461bd3[_0xdf9f('0x2a')]&&_0x461bd3[_0xdf9f('0x2b')]){var _0x2bbed0={'recipient':[_0x1f8a27[_0xdf9f('0x1f')]],'message':_0x1f8a27[_0xdf9f('0x22')],'message_type':_0x461bd3[_0xdf9f('0x2c')]};if(_0x461bd3[_0xdf9f('0x2c')]&&_0x461bd3[_0xdf9f('0x2c')]!=='SI'){_0x2bbed0['sender']=_0x461bd3['phone'];}var _0x3dfeed={'url':_0x178af8+_0xdf9f('0x2d')+_0x461bd3[_0xdf9f('0x2a')]+_0xdf9f('0x2e')+_0x461bd3[_0xdf9f('0x2b')],'method':_0xdf9f('0x2f')};rp(_0x3dfeed)[_0xdf9f('0x13')](function(_0x2fb23d){var _0x121c08=_0x2fb23d['split'](';');var _0x13b32d={'user_key':_0x121c08[0x0],'session_key':_0x121c08[0x1]};_0x3dfeed={'url':_0x178af8+_0xdf9f('0x30'),'method':_0xdf9f('0x31'),'headers':{'user_key':_0x13b32d['user_key'],'Session_key':_0x13b32d['session_key']},'json':!![],'body':_0x2bbed0};return rp(_0x3dfeed);})[_0xdf9f('0x13')](function(_0x347ea9){if(_0x347ea9[_0xdf9f('0x32')]>=0x1){var _0x1eebf2={'messageId':_0x347ea9[_0xdf9f('0x33')]};if(_0x461bd3[_0xdf9f('0x2c')]!=='GP'||!_0x461bd3[_0xdf9f('0x34')]){_0x1eebf2[_0xdf9f('0x35')]=!![];}return _0x500c4c[_0xdf9f('0x14')](_0x1eebf2);}else{return logger['error'](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x36'),util[_0xdf9f('0x29')](_0x347ea9,{'showHidden':![],'depth':null}));}})[_0xdf9f('0x16')](function(_0x45d2df){return logger['error'](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x36'),util[_0xdf9f('0x29')](_0x45d2df,{'showHidden':![],'depth':null}));});}else{logger[_0xdf9f('0x37')](_0xdf9f('0x27'),'afterCreate',_0xdf9f('0x36'),_0xdf9f('0x38'));}break;case _0xdf9f('0x39'):if(_0x461bd3[_0xdf9f('0x1e')]){var _0x518dfc={'recipient':_0x1f8a27[_0xdf9f('0x1f')],'message':_0x1f8a27[_0xdf9f('0x22')],'sender':_0x461bd3[_0xdf9f('0x3a')]||_0x461bd3[_0xdf9f('0x1f')],'authorization':_0x461bd3[_0xdf9f('0x1e')]};var _0x413af8={'method':_0xdf9f('0x31'),'uri':_0xdf9f('0x3b'),'body':_0x518dfc,'json':!![]};rp(_0x413af8)[_0xdf9f('0x13')](function(_0x4d9bee){var _0x4e3b00={'messageId':_0x4d9bee['requestid']};if(!_0x461bd3[_0xdf9f('0x34')]){_0x4e3b00[_0xdf9f('0x35')]=!![];}return _0x500c4c[_0xdf9f('0x14')](_0x4e3b00);})[_0xdf9f('0x16')](function(_0xa10d4e){logger[_0xdf9f('0x37')](_0xdf9f('0x27'),'afterCreate','connectel',util['inspect'](_0xa10d4e,{'showHidden':![],'depth':null}));});}else{logger[_0xdf9f('0x37')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdf9f('0x28'),_0xdf9f('0x39'),_0xdf9f('0x3c'));}break;case'clicksend':if(_0x461bd3[_0xdf9f('0x2a')]&&_0x461bd3[_0xdf9f('0x2b')]){var _0x518dfc={'messages':[{'source':_0xdf9f('0x3d'),'to':_0x1f8a27[_0xdf9f('0x1f')],'body':_0x1f8a27['body'],'from':_0x461bd3[_0xdf9f('0x3a')]||_0x461bd3[_0xdf9f('0x1f')]}]};var _0x45f149=util['format'](_0xdf9f('0x3e'),_0x461bd3[_0xdf9f('0x2a')],_0x461bd3[_0xdf9f('0x2b')]);var _0x413af8={'method':_0xdf9f('0x31'),'uri':_0xdf9f('0x3f'),'body':_0x518dfc,'headers':{'Authorization':util[_0xdf9f('0x40')]('Basic\x20%s',new Buffer(_0x45f149)['toString'](_0xdf9f('0x41')))},'json':!![]};rp(_0x413af8)[_0xdf9f('0x13')](function(_0x4b874f){if(_0x4b874f['http_code']>=0xc8&&_0x4b874f['http_code']<=0xce){if(_0x4b874f[_0xdf9f('0x42')]&&_0x4b874f[_0xdf9f('0x42')][_0xdf9f('0x43')]>0x0){var _0x2758de=_[_0xdf9f('0x44')](_0x4b874f[_0xdf9f('0x42')][_0xdf9f('0x20')]);var _0x4ef1cd={'messageId':_0x2758de[_0xdf9f('0x45')]};if(!_0x461bd3[_0xdf9f('0x34')]){_0x4ef1cd[_0xdf9f('0x35')]=!![];}return _0x500c4c['update'](_0x4ef1cd);}else{logger[_0xdf9f('0x37')](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x46'),util[_0xdf9f('0x29')](_0x4b874f,{'showHidden':![],'depth':null}));}}else{logger[_0xdf9f('0x37')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdf9f('0x28'),_0xdf9f('0x46'),util[_0xdf9f('0x29')](_0x4b874f,{'showHidden':![],'depth':null}));}})[_0xdf9f('0x16')](function(_0x584e08){logger[_0xdf9f('0x37')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdf9f('0x28'),'clickSend',util[_0xdf9f('0x29')](_0x584e08,{'showHidden':![],'depth':null}));});}else{logger[_0xdf9f('0x37')](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x46'),_0xdf9f('0x38'));}break;case _0xdf9f('0x47'):if(_0x461bd3[_0xdf9f('0x48')]&&_0x461bd3['authToken']){var _0x518dfc={'dst':_0x1f8a27[_0xdf9f('0x1f')],'text':_0x1f8a27[_0xdf9f('0x22')],'src':_0x461bd3['senderString']||_0x461bd3[_0xdf9f('0x1f')],'url':_0x461bd3[_0xdf9f('0x23')]+_0xdf9f('0x24')+_0x1f8a27['id']+_0xdf9f('0x25')+_0x461bd3['token']};var _0x45f149=util[_0xdf9f('0x40')](_0xdf9f('0x3e'),_0x461bd3[_0xdf9f('0x48')],_0x461bd3[_0xdf9f('0x1e')]);var _0x413af8={'method':'POST','uri':util[_0xdf9f('0x40')](_0xdf9f('0x49'),_0x461bd3['authId']),'body':_0x518dfc,'headers':{'Authorization':util['format'](_0xdf9f('0x4a'),new Buffer(_0x45f149)[_0xdf9f('0x4b')]('base64'))},'json':!![]};rp(_0x413af8)[_0xdf9f('0x13')](function(_0x2c80f1){var _0x50ddf7={'messageId':_0x2c80f1['message_uuid'][0x0]};return _0x500c4c[_0xdf9f('0x14')](_0x50ddf7);})[_0xdf9f('0x16')](function(_0x269c01){logger[_0xdf9f('0x37')](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x47'),util[_0xdf9f('0x29')](_0x269c01,{'showHidden':![],'depth':null}));});}else{logger[_0xdf9f('0x37')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',_0xdf9f('0x4c'));}break;case _0xdf9f('0x4d'):if(_0x461bd3[_0xdf9f('0x2a')]&&_0x461bd3[_0xdf9f('0x2b')]){if(_0x461bd3[_0xdf9f('0x4e')]){var _0x3aa073={'method':'POST','uri':_0x461bd3[_0xdf9f('0x4e')]+_0xdf9f('0x4f'),'body':{'username':_0x461bd3[_0xdf9f('0x2a')],'password':_0x461bd3[_0xdf9f('0x2b')]},'json':!![]};return rp(_0x3aa073)[_0xdf9f('0x13')](function(_0x27c70a){var _0x7e5c44={'method':_0xdf9f('0x31'),'uri':_0x461bd3[_0xdf9f('0x4e')]+_0xdf9f('0x50'),'body':{'messages':[{'from':_0x461bd3[_0xdf9f('0x1f')],'destinations':[{'to':_0x1f8a27[_0xdf9f('0x1f')]}],'text':_0x1f8a27['body'],'notifyUrl':_0x461bd3['remote']+_0xdf9f('0x24')+_0x1f8a27['id']+_0xdf9f('0x25')+_0x461bd3['token'],'notifyContentType':_0xdf9f('0x51'),'callbackData':_0x461bd3[_0xdf9f('0x1f')]+';'+_0x1f8a27[_0xdf9f('0x22')]}]},'headers':{'Authorization':_0xdf9f('0x52')+_0x27c70a['token']},'json':!![]};return rp(_0x7e5c44)[_0xdf9f('0x13')](function(_0x4f9e36){if(_0x4f9e36[_0xdf9f('0x20')]){var _0x1710be={'messageId':_0x4f9e36[_0xdf9f('0x20')][0x0][_0xdf9f('0x9')]};if(!_0x461bd3[_0xdf9f('0x34')]){_0x1710be[_0xdf9f('0x35')]=!![];}return _0x500c4c['update'](_0x1710be);}else{return logger[_0xdf9f('0x37')](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x4d'),util['inspect'](_0x4f9e36,{'showHidden':![],'depth':null}));}});})[_0xdf9f('0x16')](function(_0x43cf57){return logger[_0xdf9f('0x37')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdf9f('0x28'),_0xdf9f('0x4d'),util[_0xdf9f('0x29')](_0x43cf57,{'showHidden':![],'depth':null}));});}else{logger[_0xdf9f('0x37')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdf9f('0x28'),_0xdf9f('0x4d'),_0xdf9f('0x53'));}}else{logger[_0xdf9f('0x37')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdf9f('0x28'),_0xdf9f('0x4d'),_0xdf9f('0x38'));}break;case _0xdf9f('0x54'):var _0x4647eb=require(_0xdf9f('0x55'));if(_0x461bd3['apiKey']){var _0x33d889={};_0x33d889[_0xdf9f('0x56')]=_0x461bd3[_0xdf9f('0x2a')];_0x33d889[_0xdf9f('0x1f')]=_0x1f8a27[_0xdf9f('0x1f')];_0x33d889[_0xdf9f('0x57')]=_0x461bd3['phone'];_0x33d889['text']=_0x1f8a27['body'];_0x33d889[_0xdf9f('0x58')]=+new Date();var _0x209845='';var _0x47f3fe='';var _0x5d0735=Object[_0xdf9f('0x59')](_0x33d889);_0x5d0735[_0xdf9f('0x5a')]();for(var _0x5f2e96=0x0;_0x5f2e96<_0x5d0735[_0xdf9f('0x5b')];_0x5f2e96++){if(_0x209845!=''){_0x209845+='&';}_0x209845+=_0x5d0735[_0x5f2e96]+'='+encodeURIComponent(_0x33d889[_0x5d0735[_0x5f2e96]]);_0x47f3fe+=_0x33d889[_0x5d0735[_0x5f2e96]];}_0x47f3fe+=_0x461bd3[_0xdf9f('0x5c')];_0x47f3fe=_0x4647eb[_0xdf9f('0x5d')](_0xdf9f('0x5e'))[_0xdf9f('0x14')](_0x47f3fe)[_0xdf9f('0x5f')](_0xdf9f('0x60'));if(_0x209845!==''){_0x209845+='&';}_0x209845+='signature='+_0x47f3fe;var _0x3dfeed={'method':_0xdf9f('0x2f'),'uri':_0x461bd3['baseUrl']+'/external/get/send.php?'+_0x209845,'json':!![]};return rp(_0x3dfeed)['then'](function(_0x4c0b56){var _0x5bdde4=Object[_0xdf9f('0x59')](_0x4c0b56);if(_0x4c0b56[_0x5bdde4[0x0]]['error']&&parseInt(_0x4c0b56[_0x5bdde4[0x0]][_0xdf9f('0x37')])===0x0){var _0x317b96={'messageId':_0x4c0b56[_0x5bdde4[0x0]]['id_sms']};if(!_0x461bd3[_0xdf9f('0x34')]){_0x317b96['read']=!![];}return _0x500c4c['update'](_0x317b96);}else{return logger[_0xdf9f('0x37')](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x54'),util[_0xdf9f('0x29')](_0x4c0b56[_0xdf9f('0x37')],{'showHidden':![],'depth':null}));}})[_0xdf9f('0x16')](function(_0x233def){return logger[_0xdf9f('0x37')](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x54'),util['inspect'](_0x233def,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xdf9f('0x54'),_0xdf9f('0x61'));}break;case _0xdf9f('0x62'):if(_0x461bd3['apiKey']){var _0xae3b44={'method':_0xdf9f('0x31'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x461bd3[_0xdf9f('0x5c')]},'body':{'content':_0x1f8a27['body'],'to':[_0x1f8a27[_0xdf9f('0x1f')]],'from':_0x461bd3[_0xdf9f('0x1f')],'binary':![],'clientMessageId':_0xdf9f('0x63'),'charset':_0xdf9f('0x64')},'json':!![]};rp(_0xae3b44)[_0xdf9f('0x13')](function(_0x25a5b4){if(!_0x25a5b4[_0xdf9f('0x37')]){var _0x1f9cca={'messageId':_0x25a5b4[_0xdf9f('0x20')][0x0][_0xdf9f('0x65')]};if(!_0x461bd3[_0xdf9f('0x34')]){_0x1f9cca[_0xdf9f('0x35')]=!![];}return _0x500c4c[_0xdf9f('0x14')](_0x1f9cca);}else{return logger[_0xdf9f('0x37')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xdf9f('0x62'),util['inspect'](_0x25a5b4[_0xdf9f('0x37')],{'showHidden':![],'depth':null}));}})[_0xdf9f('0x16')](function(_0x44f16a){return logger['error'](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x62'),util['inspect'](_0x44f16a,{'showHidden':![],'depth':null}));});}else{logger[_0xdf9f('0x37')](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x62'),_0xdf9f('0x61'));}break;case _0xdf9f('0x66'):if(_0x461bd3[_0xdf9f('0x2a')]&&_0x461bd3[_0xdf9f('0x2b')]){var _0x45f149=util['format'](_0xdf9f('0x3e'),_0x461bd3[_0xdf9f('0x2a')],_0x461bd3[_0xdf9f('0x2b')]);var _0x413af8={'method':_0xdf9f('0x31'),'uri':_0xdf9f('0x67')+_0x461bd3['accountId']+'/messages','body':{'to':[_0x1f8a27[_0xdf9f('0x1f')]],'text':_0x1f8a27[_0xdf9f('0x22')],'from':_0x461bd3['phone'],'applicationId':_0x461bd3[_0xdf9f('0x68')]},'headers':{'Authorization':util[_0xdf9f('0x40')]('Basic\x20%s',new Buffer(_0x45f149)['toString'](_0xdf9f('0x41')))},'json':!![]};rp(_0x413af8)[_0xdf9f('0x13')](function(_0x3a0890){if(_0x3a0890['id']){var _0x5b1d55={'messageId':_0x3a0890['id']};return _0x500c4c['update'](_0x5b1d55);}else{logger[_0xdf9f('0x37')](_0xdf9f('0x27'),'afterCreate','bandwidth',util[_0xdf9f('0x29')](_0x3a0890,{'showHidden':![],'depth':null}));}})['catch'](function(_0xa31664){logger[_0xdf9f('0x37')](_0xdf9f('0x27'),_0xdf9f('0x28'),'bandwidth',util[_0xdf9f('0x29')](_0xa31664,{'showHidden':![],'depth':null}));});}else{logger[_0xdf9f('0x37')](_0xdf9f('0x27'),_0xdf9f('0x28'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xdf9f('0x69'):if(_0x461bd3[_0xdf9f('0x5c')]){var _0x3410fc={};var _0x3dfeed={'method':_0xdf9f('0x31'),'uri':_0xdf9f('0x6a'),'headers':{'Authorization':_0xdf9f('0x6b')+_0x461bd3['apiKey'],'Content-Type':_0xdf9f('0x51')},'body':{'from':_0x461bd3['phone'],'to':_0x1f8a27[_0xdf9f('0x1f')],'text':_0x1f8a27[_0xdf9f('0x22')]},'json':!![]};return rp(_0x3dfeed)[_0xdf9f('0x13')](function(_0x526bce){if(_0x526bce[_0xdf9f('0x6c')]==0xca){_0x3410fc[_0xdf9f('0x6d')]=_0x526bce;var _0x24d52e={'method':_0xdf9f('0x31'),'uri':_0xdf9f('0x6e'),'headers':{'Authorization':_0xdf9f('0x6b')+_0x461bd3[_0xdf9f('0x5c')],'Content-Type':_0xdf9f('0x51')},'body':{'refid':_0x3410fc[_0xdf9f('0x6d')][_0xdf9f('0x6f')]},'json':!![]};return rp(_0x24d52e)['then'](function(_0x388d80){_0x3410fc[_0xdf9f('0x70')]=_0x388d80;var _0x5630ae={'messageId':_0x3410fc[_0xdf9f('0x6d')][_0xdf9f('0x6f')],'read':!![]};return _0x500c4c[_0xdf9f('0x14')](_0x5630ae);});}else{return logger[_0xdf9f('0x37')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdf9f('0x28'),_0xdf9f('0x69'),util[_0xdf9f('0x29')](_0x526bce,{'showHidden':![],'depth':null}));}})[_0xdf9f('0x16')](function(_0x10780e){return logger[_0xdf9f('0x37')](_0xdf9f('0x27'),_0xdf9f('0x28'),_0xdf9f('0x69'),util['inspect'](_0x10780e,{'showHidden':![],'depth':null}));});}else{return logger[_0xdf9f('0x37')](_0xdf9f('0x27'),'afterCreate',_0xdf9f('0x69'),_0xdf9f('0x71'));}break;}}})[_0xdf9f('0x72')](function(){_0x4eb1c6();});}else{_0x4eb1c6();}}},'charset':_0xdf9f('0x73'),'collate':_0xdf9f('0x74')});};
\ No newline at end of file
index 09b38ad..2fa3bf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe624=['debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','body','options','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent'];(function(_0x20cbdd,_0x36675d){var _0x3fb9bf=function(_0x1a37e1){while(--_0x1a37e1){_0x20cbdd['push'](_0x20cbdd['shift']());}};_0x3fb9bf(++_0x36675d);}(_0xe624,0x10c));var _0x4e62=function(_0x3b29d5,_0x12faa2){_0x3b29d5=_0x3b29d5-0x0;var _0x20b96d=_0xe624[_0x3b29d5];return _0x20b96d;};'use strict';var _=require(_0x4e62('0x0'));var util=require(_0x4e62('0x1'));var moment=require(_0x4e62('0x2'));var BPromise=require(_0x4e62('0x3'));var rs=require(_0x4e62('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e62('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e62('0x6'))('rpc');var config=require(_0x4e62('0x7'));var jayson=require(_0x4e62('0x8'));var client=jayson[_0x4e62('0x9')]['http']({'port':0x232a});config[_0x4e62('0xa')]=_[_0x4e62('0xb')](config[_0x4e62('0xa')],{'host':_0x4e62('0xc'),'port':0x18eb});var socket=require(_0x4e62('0xd'))(new Redis(config[_0x4e62('0xa')]));require(_0x4e62('0xe'))[_0x4e62('0xf')](socket);function respondWithRpcPromise(_0x2c6f67,_0x48033e,_0x58a369){return new BPromise(function(_0x2dd374,_0x52f680){return client[_0x4e62('0x10')](_0x2c6f67,_0x58a369)[_0x4e62('0x11')](function(_0xcb6c0){logger[_0x4e62('0x12')]('SmsMessage,\x20%s,\x20%s',_0x48033e,_0x4e62('0x13'));logger[_0x4e62('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x48033e,_0x4e62('0x13'),JSON[_0x4e62('0x15')](_0xcb6c0));if(_0xcb6c0[_0x4e62('0x16')]){if(_0xcb6c0['error'][_0x4e62('0x17')]===0x1f4){logger[_0x4e62('0x16')](_0x4e62('0x18'),_0x48033e,_0xcb6c0['error']['message']);return _0x52f680(_0xcb6c0[_0x4e62('0x16')][_0x4e62('0x19')]);}logger['error'](_0x4e62('0x18'),_0x48033e,_0xcb6c0[_0x4e62('0x16')][_0x4e62('0x19')]);return _0x2dd374(_0xcb6c0[_0x4e62('0x16')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x48033e,_0x4e62('0x13'));_0x2dd374(_0xcb6c0[_0x4e62('0x1a')][_0x4e62('0x19')]);}})[_0x4e62('0x1b')](function(_0x5aa6c9){logger[_0x4e62('0x16')](_0x4e62('0x18'),_0x48033e,_0x5aa6c9);_0x52f680(_0x5aa6c9);});});}exports[_0x4e62('0x1c')]=function(_0x193e04){var _0xac0ab=this;return new Promise(function(_0x1ec08f,_0x4b59e2){return db[_0x4e62('0x1d')]['create'](_0x193e04[_0x4e62('0x1e')],{'raw':_0x193e04[_0x4e62('0x1f')]?_0x193e04[_0x4e62('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x4e62('0x11')](function(_0x416c23){logger[_0x4e62('0x12')]('CreateSmsMessage',_0x193e04);logger[_0x4e62('0x14')](_0x4e62('0x1c'),_0x193e04,JSON[_0x4e62('0x15')](_0x416c23));_0x1ec08f(_0x416c23);})[_0x4e62('0x1b')](function(_0x20606f){logger[_0x4e62('0x16')](_0x4e62('0x1c'),_0x20606f[_0x4e62('0x19')],_0x193e04);_0x4b59e2(_0xac0ab['error'](0x1f4,_0x20606f['message']));});});};
\ No newline at end of file
+var _0xc372=['SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsMessage','create','body','raw','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./smsMessage.socket','request','then','info'];(function(_0x32c21b,_0xc347fb){var _0x212924=function(_0xea33dd){while(--_0xea33dd){_0x32c21b['push'](_0x32c21b['shift']());}};_0x212924(++_0xc347fb);}(_0xc372,0x10e));var _0x2c37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc372[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2c37('0x0'));var util=require('util');var moment=require(_0x2c37('0x1'));var BPromise=require(_0x2c37('0x2'));var rs=require(_0x2c37('0x3'));var fs=require('fs');var Redis=require(_0x2c37('0x4'));var db=require(_0x2c37('0x5'))['db'];var utils=require(_0x2c37('0x6'));var logger=require('../../config/logger')(_0x2c37('0x7'));var config=require(_0x2c37('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2c37('0x9')][_0x2c37('0xa')]({'port':0x232a});config[_0x2c37('0xb')]=_[_0x2c37('0xc')](config[_0x2c37('0xb')],{'host':_0x2c37('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c37('0xb')]));require(_0x2c37('0xe'))['register'](socket);function respondWithRpcPromise(_0x26a2e1,_0xebddcf,_0x593173){return new BPromise(function(_0x3e81eb,_0x17bd62){return client[_0x2c37('0xf')](_0x26a2e1,_0x593173)[_0x2c37('0x10')](function(_0x19968e){logger[_0x2c37('0x11')](_0x2c37('0x12'),_0xebddcf,_0x2c37('0x13'));logger[_0x2c37('0x14')](_0x2c37('0x15'),_0xebddcf,'request\x20sent',JSON[_0x2c37('0x16')](_0x19968e));if(_0x19968e[_0x2c37('0x17')]){if(_0x19968e[_0x2c37('0x17')][_0x2c37('0x18')]===0x1f4){logger[_0x2c37('0x17')](_0x2c37('0x12'),_0xebddcf,_0x19968e[_0x2c37('0x17')][_0x2c37('0x19')]);return _0x17bd62(_0x19968e['error']['message']);}logger[_0x2c37('0x17')](_0x2c37('0x12'),_0xebddcf,_0x19968e['error'][_0x2c37('0x19')]);return _0x3e81eb(_0x19968e[_0x2c37('0x17')]['message']);}else{logger[_0x2c37('0x11')](_0x2c37('0x12'),_0xebddcf,_0x2c37('0x13'));_0x3e81eb(_0x19968e[_0x2c37('0x1a')]['message']);}})['catch'](function(_0x5480b0){logger[_0x2c37('0x17')](_0x2c37('0x12'),_0xebddcf,_0x5480b0);_0x17bd62(_0x5480b0);});});}exports[_0x2c37('0x1b')]=function(_0x144b73){var _0x322ec9=this;return new Promise(function(_0x1266ab,_0x1ef4be){return db['SmsMessage'][_0x2c37('0x1c')](_0x144b73[_0x2c37('0x1d')],{'raw':_0x144b73['options']?_0x144b73['options'][_0x2c37('0x1e')]===undefined?!![]:![]:!![]})[_0x2c37('0x10')](function(_0xebbf7d){logger[_0x2c37('0x11')](_0x2c37('0x1b'),_0x144b73);logger[_0x2c37('0x14')](_0x2c37('0x1b'),_0x144b73,JSON['stringify'](_0xebbf7d));_0x1266ab(_0xebbf7d);})[_0x2c37('0x1f')](function(_0x92430e){logger['error'](_0x2c37('0x1b'),_0x92430e[_0x2c37('0x19')],_0x144b73);_0x1ef4be(_0x322ec9['error'](0x1f4,_0x92430e[_0x2c37('0x19')]));});});};
\ No newline at end of file
index 6e3b67c..fa143ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfb6=['smsMessage:','./smsMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2f2cb8,_0x417d38){var _0x5a7add=function(_0xc1da1d){while(--_0xc1da1d){_0x2f2cb8['push'](_0x2f2cb8['shift']());}};_0x5a7add(++_0x417d38);}(_0xcfb6,0xfd));var _0x6cfb=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0xcfb6[_0x2d8f6c];return _0x3a00f6;};'use strict';var SmsMessageEvents=require(_0x6cfb('0x0'));var events=[_0x6cfb('0x1'),_0x6cfb('0x2'),_0x6cfb('0x3')];function createListener(_0x524c84,_0xf44d37){return function(_0x450137){_0xf44d37[_0x6cfb('0x4')](_0x524c84,_0x450137);};}function removeListener(_0x805835,_0x19f451){return function(){SmsMessageEvents[_0x6cfb('0x5')](_0x805835,_0x19f451);};}exports[_0x6cfb('0x6')]=function(_0x5297d7){for(var _0x4ae70c=0x0,_0x1f81da=events[_0x6cfb('0x7')];_0x4ae70c<_0x1f81da;_0x4ae70c++){var _0x149f3e=events[_0x4ae70c];var _0x6795ef=createListener(_0x6cfb('0x8')+_0x149f3e,_0x5297d7);SmsMessageEvents['on'](_0x149f3e,_0x6795ef);}};
\ No newline at end of file
+var _0x089f=['length','smsMessage:','./smsMessage.events','save','remove','update','removeListener','register'];(function(_0xe52c3f,_0x15e96d){var _0x4d16a6=function(_0x12c81e){while(--_0x12c81e){_0xe52c3f['push'](_0xe52c3f['shift']());}};_0x4d16a6(++_0x15e96d);}(_0x089f,0xc2));var _0xf089=function(_0x2be61d,_0x28fe59){_0x2be61d=_0x2be61d-0x0;var _0x269e49=_0x089f[_0x2be61d];return _0x269e49;};'use strict';var SmsMessageEvents=require(_0xf089('0x0'));var events=[_0xf089('0x1'),_0xf089('0x2'),_0xf089('0x3')];function createListener(_0x539dcc,_0xfdd3f8){return function(_0x3d3626){_0xfdd3f8['emit'](_0x539dcc,_0x3d3626);};}function removeListener(_0x1fc865,_0x395ef1){return function(){SmsMessageEvents[_0xf089('0x4')](_0x1fc865,_0x395ef1);};}exports[_0xf089('0x5')]=function(_0xcfcb57){for(var _0x1e3121=0x0,_0x18c9ea=events[_0xf089('0x6')];_0x1e3121<_0x18c9ea;_0x1e3121++){var _0x5f201d=events[_0x1e3121];var _0x5c9d65=createListener(_0xf089('0x7')+_0x5f201d,_0xcfcb57);SmsMessageEvents['on'](_0x5f201d,_0x5c9d65);}};
\ No newline at end of file
index f627499..40f6faa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9fb=['delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','describe','/:id/members','/:id/teams','getTeams','getAgents','post','/:id/users','addAgents','/:id'];(function(_0x45b415,_0x25b0f5){var _0x239eec=function(_0x21f522){while(--_0x21f522){_0x45b415['push'](_0x45b415['shift']());}};_0x239eec(++_0x25b0f5);}(_0xd9fb,0x131));var _0xbd9f=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xd9fb[_0xd1d19a];return _0x52a79d;};'use strict';var multer=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var path=require('path');var timeout=require(_0xbd9f('0x2'));var express=require(_0xbd9f('0x3'));var router=express['Router']();var fs_extra=require(_0xbd9f('0x4'));var auth=require(_0xbd9f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbd9f('0x6'));var controller=require(_0xbd9f('0x7'));router[_0xbd9f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbd9f('0x8')](_0xbd9f('0x9'),auth[_0xbd9f('0xa')](),controller[_0xbd9f('0xb')]);router[_0xbd9f('0x8')]('/:id',auth[_0xbd9f('0xa')](),controller['show']);router[_0xbd9f('0x8')](_0xbd9f('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbd9f('0x8')](_0xbd9f('0xd'),auth[_0xbd9f('0xa')](),controller[_0xbd9f('0xe')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xbd9f('0xf')]);router[_0xbd9f('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbd9f('0x10')](_0xbd9f('0xd'),auth[_0xbd9f('0xa')](),controller['addTeams']);router[_0xbd9f('0x10')](_0xbd9f('0x11'),auth[_0xbd9f('0xa')](),controller[_0xbd9f('0x12')]);router['put'](_0xbd9f('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xbd9f('0x14')](_0xbd9f('0x13'),auth['isAuthenticated'](),controller[_0xbd9f('0x15')]);router[_0xbd9f('0x14')]('/:id/teams',auth[_0xbd9f('0xa')](),controller[_0xbd9f('0x16')]);router[_0xbd9f('0x14')]('/:id/users',auth[_0xbd9f('0xa')](),controller[_0xbd9f('0x17')]);module[_0xbd9f('0x18')]=router;
\ No newline at end of file
+var _0x2021=['./smsQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','destroy','delete','removeTeams','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3e63df,_0x146b71){var _0x47228d=function(_0x2f32a0){while(--_0x2f32a0){_0x3e63df['push'](_0x3e63df['shift']());}};_0x47228d(++_0x146b71);}(_0x2021,0x10e));var _0x1202=function(_0x231a21,_0x50242b){_0x231a21=_0x231a21-0x0;var _0x464d96=_0x2021[_0x231a21];return _0x464d96;};'use strict';var multer=require(_0x1202('0x0'));var util=require(_0x1202('0x1'));var path=require('path');var timeout=require(_0x1202('0x2'));var express=require(_0x1202('0x3'));var router=express[_0x1202('0x4')]();var fs_extra=require(_0x1202('0x5'));var auth=require(_0x1202('0x6'));var interaction=require(_0x1202('0x7'));var config=require(_0x1202('0x8'));var controller=require(_0x1202('0x9'));router[_0x1202('0xa')]('/',auth['isAuthenticated'](),controller[_0x1202('0xb')]);router[_0x1202('0xa')](_0x1202('0xc'),auth[_0x1202('0xd')](),controller[_0x1202('0xe')]);router[_0x1202('0xa')](_0x1202('0xf'),auth['isAuthenticated'](),controller[_0x1202('0x10')]);router[_0x1202('0xa')](_0x1202('0x11'),auth['isAuthenticated'](),controller[_0x1202('0x12')]);router['get'](_0x1202('0x13'),auth['isAuthenticated'](),controller[_0x1202('0x14')]);router[_0x1202('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x1202('0x15')]);router[_0x1202('0x16')]('/',auth[_0x1202('0xd')](),controller[_0x1202('0x17')]);router[_0x1202('0x16')](_0x1202('0x13'),auth[_0x1202('0xd')](),controller[_0x1202('0x18')]);router[_0x1202('0x16')](_0x1202('0x19'),auth['isAuthenticated'](),controller[_0x1202('0x1a')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x1202('0xf'),auth[_0x1202('0xd')](),controller[_0x1202('0x1b')]);router[_0x1202('0x1c')](_0x1202('0x13'),auth['isAuthenticated'](),controller[_0x1202('0x1d')]);router[_0x1202('0x1c')](_0x1202('0x19'),auth[_0x1202('0xd')](),controller[_0x1202('0x1e')]);module['exports']=router;
\ No newline at end of file
index 575750e..7db289f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ef8=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x302f85,_0x5bcca3){var _0x5ef7cb=function(_0x1f3afb){while(--_0x1f3afb){_0x302f85['push'](_0x302f85['shift']());}};_0x5ef7cb(++_0x5bcca3);}(_0x0ef8,0x1cd));var _0x80ef=function(_0x304fe6,_0xf1e847){_0x304fe6=_0x304fe6-0x0;var _0x414fcf=_0x0ef8[_0x304fe6];return _0x414fcf;};'use strict';var Sequelize=require(_0x80ef('0x0'));module[_0x80ef('0x1')]={'name':{'type':Sequelize[_0x80ef('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x80ef('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x80ef('0x4')](_0x80ef('0x5'),_0x80ef('0x6'),_0x80ef('0x7'))}};
\ No newline at end of file
+var _0x5ab6=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ab6,0xe8));var _0x65ab=function(_0x241dbb,_0x3a81c2){_0x241dbb=_0x241dbb-0x0;var _0x1ada5f=_0x5ab6[_0x241dbb];return _0x1ada5f;};'use strict';var Sequelize=require('sequelize');module[_0x65ab('0x0')]={'name':{'type':Sequelize[_0x65ab('0x1')],'unique':_0x65ab('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x65ab('0x1')]},'timeout':{'type':Sequelize[_0x65ab('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x65ab('0x4')](_0x65ab('0x5'),_0x65ab('0x6'),_0x65ab('0x7'))}};
\ No newline at end of file
index 322e081..eafe195 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bdb=['Agents','sequelize','transaction','each','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','params','keys','include','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','describe','getMembers','findOne','UserSmsQueue','pick','SmsQueueId','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','rows','format','%s/%s','Team','addTeams','ids','online','flatMap'];(function(_0x1b9063,_0x5cb9a8){var _0x57a3cd=function(_0x41ecf0){while(--_0x41ecf0){_0x1b9063['push'](_0x1b9063['shift']());}};_0x57a3cd(++_0x5cb9a8);}(_0x9bdb,0x13c));var _0xb9bd=function(_0x7ecae,_0x4181e3){_0x7ecae=_0x7ecae-0x0;var _0xf207a4=_0x9bdb[_0x7ecae];return _0xf207a4;};'use strict';var emlformat=require(_0xb9bd('0x0'));var rimraf=require(_0xb9bd('0x1'));var zipdir=require(_0xb9bd('0x2'));var jsonpatch=require(_0xb9bd('0x3'));var rp=require('request-promise');var moment=require(_0xb9bd('0x4'));var BPromise=require(_0xb9bd('0x5'));var Mustache=require(_0xb9bd('0x6'));var util=require(_0xb9bd('0x7'));var path=require(_0xb9bd('0x8'));var sox=require(_0xb9bd('0x9'));var csv=require(_0xb9bd('0xa'));var ejs=require(_0xb9bd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9bd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb9bd('0xd'));var deskjs=require(_0xb9bd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb9bd('0xf'));var Papa=require(_0xb9bd('0x10'));var Redis=require(_0xb9bd('0x11'));var authService=require(_0xb9bd('0x12'));var qs=require(_0xb9bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9bd('0x14'))(_0xb9bd('0x15'));var utils=require(_0xb9bd('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb9bd('0x17'))['db'];config[_0xb9bd('0x18')]=_['defaults'](config[_0xb9bd('0x18')],{'host':_0xb9bd('0x19'),'port':0x18eb});var socket=require(_0xb9bd('0x1a'))(new Redis(config['redis']));require(_0xb9bd('0x1b'))[_0xb9bd('0x1c')](socket);function respondWithStatusCode(_0x2b951c,_0x559855){_0x559855=_0x559855||0xcc;return function(_0x56450d){if(_0x56450d){return _0x2b951c[_0xb9bd('0x1d')](_0x559855);}return _0x2b951c['status'](_0x559855)[_0xb9bd('0x1e')]();};}function respondWithResult(_0x507236,_0x1e0c3a){_0x1e0c3a=_0x1e0c3a||0xc8;return function(_0x1ad774){if(_0x1ad774){return _0x507236[_0xb9bd('0x1f')](_0x1e0c3a)[_0xb9bd('0x20')](_0x1ad774);}};}function respondWithFilteredResult(_0x427640,_0x15dc9f){return function(_0x2f6edc){if(_0x2f6edc){var _0xd65adc=typeof _0x15dc9f[_0xb9bd('0x21')]===_0xb9bd('0x22')&&typeof _0x15dc9f[_0xb9bd('0x23')]==='undefined';var _0x48e7a5=_0x2f6edc[_0xb9bd('0x24')];var _0x2be079=_0xd65adc?0x0:_0x15dc9f[_0xb9bd('0x21')];var _0x1d3ffd=_0xd65adc?_0x2f6edc[_0xb9bd('0x24')]:_0x15dc9f['offset']+_0x15dc9f[_0xb9bd('0x23')];var _0x3657b5;if(_0x1d3ffd>=_0x48e7a5){_0x1d3ffd=_0x48e7a5;_0x3657b5=0xc8;}else{_0x3657b5=0xce;}_0x427640[_0xb9bd('0x1f')](_0x3657b5);return _0x427640[_0xb9bd('0x25')](_0xb9bd('0x26'),_0x2be079+'-'+_0x1d3ffd+'/'+_0x48e7a5)[_0xb9bd('0x20')](_0x2f6edc);}return null;};}function patchUpdates(_0x4657cb){return function(_0x3162b7){try{jsonpatch[_0xb9bd('0x27')](_0x3162b7,_0x4657cb,!![]);}catch(_0x4d2307){return BPromise[_0xb9bd('0x28')](_0x4d2307);}return _0x3162b7[_0xb9bd('0x29')]();};}function saveUpdates(_0x52e526,_0x50dced){return function(_0x4b3940){if(_0x4b3940){return _0x4b3940[_0xb9bd('0x2a')](_0x52e526)[_0xb9bd('0x2b')](function(_0x5eba05){return _0x5eba05;});}return null;};}function removeEntity(_0x9f087d,_0x18f4c1){return function(_0x3b9846){if(_0x3b9846){return _0x3b9846[_0xb9bd('0x2c')]()[_0xb9bd('0x2b')](function(){var _0x3a6cdb=_0x3b9846[_0xb9bd('0x2d')]({'plain':!![]});var _0x31e0cb=_0xb9bd('0x2e');return db[_0xb9bd('0x2f')][_0xb9bd('0x2c')]({'where':{'type':_0x31e0cb,'resourceId':_0x3a6cdb['id']}})[_0xb9bd('0x2b')](function(){return _0x3b9846;});})['then'](function(){_0x9f087d['status'](0xcc)[_0xb9bd('0x1e')]();});}};}function handleEntityNotFound(_0x206e53,_0x2eba92){return function(_0x3dba70){if(!_0x3dba70){_0x206e53[_0xb9bd('0x1d')](0x194);}return _0x3dba70;};}function handleError(_0x1660a2,_0x29cde6){_0x29cde6=_0x29cde6||0x1f4;return function(_0x42ffc1){logger[_0xb9bd('0x30')](_0x42ffc1['stack']);if(_0x42ffc1[_0xb9bd('0x31')]){delete _0x42ffc1[_0xb9bd('0x31')];}_0x1660a2[_0xb9bd('0x1f')](_0x29cde6)[_0xb9bd('0x32')](_0x42ffc1);};}exports['index']=function(_0x2c0fdc,_0x58b67f){var _0x23d9d5={},_0x111bc9={},_0x235a99={'count':0x0,'rows':[]};var _0x2b38a8=_[_0xb9bd('0x33')](db[_0xb9bd('0x34')][_0xb9bd('0x35')],function(_0x2b9569){return{'name':_0x2b9569[_0xb9bd('0x36')],'type':_0x2b9569[_0xb9bd('0x37')][_0xb9bd('0x38')]};});_0x111bc9[_0xb9bd('0x39')]=_[_0xb9bd('0x33')](_0x2b38a8,_0xb9bd('0x31'));_0x111bc9['query']=_['keys'](_0x2c0fdc[_0xb9bd('0x3a')]);_0x111bc9['filters']=_['intersection'](_0x111bc9[_0xb9bd('0x39')],_0x111bc9[_0xb9bd('0x3a')]);_0x23d9d5[_0xb9bd('0x3b')]=_[_0xb9bd('0x3c')](_0x111bc9[_0xb9bd('0x39')],qs[_0xb9bd('0x3d')](_0x2c0fdc[_0xb9bd('0x3a')][_0xb9bd('0x3d')]));_0x23d9d5[_0xb9bd('0x3b')]=_0x23d9d5[_0xb9bd('0x3b')][_0xb9bd('0x3e')]?_0x23d9d5['attributes']:_0x111bc9[_0xb9bd('0x39')];if(!_0x2c0fdc[_0xb9bd('0x3a')][_0xb9bd('0x3f')](_0xb9bd('0x40'))){_0x23d9d5['limit']=qs['limit'](_0x2c0fdc[_0xb9bd('0x3a')][_0xb9bd('0x23')]);_0x23d9d5[_0xb9bd('0x21')]=qs['offset'](_0x2c0fdc[_0xb9bd('0x3a')]['offset']);}_0x23d9d5[_0xb9bd('0x41')]=qs[_0xb9bd('0x42')](_0x2c0fdc[_0xb9bd('0x3a')][_0xb9bd('0x42')]);_0x23d9d5[_0xb9bd('0x43')]=qs[_0xb9bd('0x44')](_['pick'](_0x2c0fdc[_0xb9bd('0x3a')],_0x111bc9[_0xb9bd('0x44')]),_0x2b38a8);if(_0x2c0fdc[_0xb9bd('0x3a')][_0xb9bd('0x45')]){_0x23d9d5[_0xb9bd('0x43')]=_[_0xb9bd('0x46')](_0x23d9d5[_0xb9bd('0x43')],{'$or':_[_0xb9bd('0x33')](_0x2b38a8,function(_0x50b603){if(_0x50b603[_0xb9bd('0x37')]!==_0xb9bd('0x47')){var _0x2c394c={};_0x2c394c[_0x50b603['name']]={'$like':'%'+_0x2c0fdc[_0xb9bd('0x3a')]['filter']+'%'};return _0x2c394c;}})});}_0x23d9d5=_[_0xb9bd('0x46')]({},_0x23d9d5,_0x2c0fdc[_0xb9bd('0x48')]);var _0x2d86fa={'where':_0x23d9d5[_0xb9bd('0x43')]};return db['SmsQueue'][_0xb9bd('0x24')](_0x2d86fa)[_0xb9bd('0x2b')](function(_0x3c6b0f){_0x235a99[_0xb9bd('0x24')]=_0x3c6b0f;if(_0x2c0fdc['query'][_0xb9bd('0x49')]){_0x23d9d5['include']=[{'all':!![]}];}return db[_0xb9bd('0x34')][_0xb9bd('0x4a')](_0x23d9d5);})[_0xb9bd('0x2b')](function(_0x3e56b8){_0x235a99['rows']=_0x3e56b8;return _0x235a99;})[_0xb9bd('0x2b')](respondWithFilteredResult(_0x58b67f,_0x23d9d5))['catch'](handleError(_0x58b67f,null));};exports['show']=function(_0x2d87e1,_0x47d6a3){var _0x228b29={'raw':!![],'where':{'id':_0x2d87e1[_0xb9bd('0x4b')]['id']}},_0x4e1246={};_0x4e1246[_0xb9bd('0x39')]=_['keys'](db[_0xb9bd('0x34')][_0xb9bd('0x35')]);_0x4e1246[_0xb9bd('0x3a')]=_[_0xb9bd('0x4c')](_0x2d87e1['query']);_0x4e1246[_0xb9bd('0x44')]=_[_0xb9bd('0x3c')](_0x4e1246[_0xb9bd('0x39')],_0x4e1246[_0xb9bd('0x3a')]);_0x228b29[_0xb9bd('0x3b')]=_[_0xb9bd('0x3c')](_0x4e1246['model'],qs[_0xb9bd('0x3d')](_0x2d87e1[_0xb9bd('0x3a')][_0xb9bd('0x3d')]));_0x228b29[_0xb9bd('0x3b')]=_0x228b29['attributes'][_0xb9bd('0x3e')]?_0x228b29[_0xb9bd('0x3b')]:_0x4e1246[_0xb9bd('0x39')];if(_0x2d87e1[_0xb9bd('0x3a')][_0xb9bd('0x49')]){_0x228b29[_0xb9bd('0x4d')]=[{'all':!![]}];}_0x228b29=_[_0xb9bd('0x46')]({},_0x228b29,_0x2d87e1[_0xb9bd('0x48')]);return db[_0xb9bd('0x34')][_0xb9bd('0x4e')](_0x228b29)[_0xb9bd('0x2b')](handleEntityNotFound(_0x47d6a3,null))[_0xb9bd('0x2b')](respondWithResult(_0x47d6a3,null))[_0xb9bd('0x4f')](handleError(_0x47d6a3,null));};exports['create']=function(_0x1be63e,_0x4eb65a){return db[_0xb9bd('0x34')]['create'](_0x1be63e[_0xb9bd('0x50')],{})[_0xb9bd('0x2b')](function(_0x2a0eea){var _0x56e7e5=_0x1be63e[_0xb9bd('0x51')]['get']({'plain':!![]});if(!_0x56e7e5)throw new Error(_0xb9bd('0x52'));if(_0x56e7e5[_0xb9bd('0x53')]==='user'){var _0x49797f=_0x2a0eea['get']({'plain':!![]});var _0x12788c=_0xb9bd('0x2e');return db[_0xb9bd('0x54')][_0xb9bd('0x4e')]({'where':{'name':_0x12788c,'userProfileId':_0x56e7e5['userProfileId']},'raw':!![]})[_0xb9bd('0x2b')](function(_0x3ec5c7){if(_0x3ec5c7&&_0x3ec5c7[_0xb9bd('0x55')]===0x0){return db['UserProfileResource'][_0xb9bd('0x56')]({'name':_0x49797f[_0xb9bd('0x31')],'resourceId':_0x49797f['id'],'type':_0x3ec5c7['name'],'sectionId':_0x3ec5c7['id']},{})[_0xb9bd('0x2b')](function(){return _0x2a0eea;});}else{return _0x2a0eea;}})[_0xb9bd('0x4f')](function(_0x583a34){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x583a34);throw _0x583a34;});}return _0x2a0eea;})[_0xb9bd('0x2b')](respondWithResult(_0x4eb65a,0xc9))[_0xb9bd('0x4f')](handleError(_0x4eb65a,null));};exports['update']=function(_0x2ed406,_0x34cc3a){if(_0x2ed406[_0xb9bd('0x50')]['id']){delete _0x2ed406[_0xb9bd('0x50')]['id'];}return db[_0xb9bd('0x34')]['find']({'where':{'id':_0x2ed406['params']['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x34cc3a,null))[_0xb9bd('0x2b')](saveUpdates(_0x2ed406[_0xb9bd('0x50')],null))[_0xb9bd('0x2b')](respondWithResult(_0x34cc3a,null))['catch'](handleError(_0x34cc3a,null));};exports['destroy']=function(_0x101414,_0x48af01){return db[_0xb9bd('0x34')][_0xb9bd('0x4e')]({'where':{'id':_0x101414['params']['id']}})['then'](handleEntityNotFound(_0x48af01,null))['then'](removeEntity(_0x48af01,null))[_0xb9bd('0x4f')](handleError(_0x48af01,null));};exports[_0xb9bd('0x57')]=function(_0x5925ac,_0x560cfa){return db[_0xb9bd('0x34')][_0xb9bd('0x57')]()[_0xb9bd('0x2b')](respondWithResult(_0x560cfa,null))[_0xb9bd('0x4f')](handleError(_0x560cfa,null));};exports[_0xb9bd('0x58')]=function(_0x58e163,_0x4a35e6,_0x1d0fff){var _0x4df3a9={'raw':!![],'where':{}},_0x20526e={},_0x42311e;return db[_0xb9bd('0x34')][_0xb9bd('0x59')]({'where':{'id':_0x58e163['params']['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x4a35e6,null))[_0xb9bd('0x2b')](function(_0x5bac61){if(_0x5bac61){_0x42311e=_0x5bac61[_0xb9bd('0x2d')]({'plain':!![]});_0x20526e[_0xb9bd('0x39')]=_[_0xb9bd('0x4c')](db[_0xb9bd('0x5a')][_0xb9bd('0x35')]);_0x20526e['query']=_['keys'](_0x58e163[_0xb9bd('0x3a')]);_0x20526e[_0xb9bd('0x44')]=_[_0xb9bd('0x3c')](_0x20526e[_0xb9bd('0x39')],_0x20526e[_0xb9bd('0x3a')]);_0x4df3a9['attributes']=_[_0xb9bd('0x3c')](_0x20526e['model'],qs[_0xb9bd('0x3d')](_0x58e163['query'][_0xb9bd('0x3d')]));_0x4df3a9[_0xb9bd('0x3b')]=_0x4df3a9[_0xb9bd('0x3b')][_0xb9bd('0x3e')]?_0x4df3a9[_0xb9bd('0x3b')]:_0x20526e[_0xb9bd('0x39')];if(!_0x58e163['query'][_0xb9bd('0x3f')](_0xb9bd('0x40'))){_0x4df3a9[_0xb9bd('0x23')]=qs[_0xb9bd('0x23')](_0x58e163[_0xb9bd('0x3a')]['limit']);_0x4df3a9[_0xb9bd('0x21')]=qs[_0xb9bd('0x21')](_0x58e163[_0xb9bd('0x3a')][_0xb9bd('0x21')]);}_0x4df3a9[_0xb9bd('0x41')]=qs[_0xb9bd('0x42')](_0x58e163['query'][_0xb9bd('0x42')]);_0x4df3a9[_0xb9bd('0x43')]=qs[_0xb9bd('0x44')](_[_0xb9bd('0x5b')](_0x58e163['query'],_0x20526e[_0xb9bd('0x44')]));_0x4df3a9[_0xb9bd('0x43')][_0xb9bd('0x5c')]=_0x5bac61['id'];if(_0x58e163[_0xb9bd('0x3a')]['filter']){_0x4df3a9[_0xb9bd('0x43')]=_[_0xb9bd('0x46')](_0x4df3a9[_0xb9bd('0x43')],{'$or':_[_0xb9bd('0x33')](_0x4df3a9['attributes'],function(_0x4dceef){var _0x65ea07={};_0x65ea07[_0x4dceef]={'$like':'%'+_0x58e163[_0xb9bd('0x3a')][_0xb9bd('0x45')]+'%'};return _0x65ea07;})});}_0x4df3a9=_[_0xb9bd('0x46')]({},_0x4df3a9,_0x58e163[_0xb9bd('0x48')]);return db['UserSmsQueue'][_0xb9bd('0x4a')](_0x4df3a9);}})['then'](function(_0x4025d6){if(_0x4025d6){return db[_0xb9bd('0x5d')][_0xb9bd('0x5e')]({'where':{'id':_[_0xb9bd('0x33')](_0x4025d6,_0xb9bd('0x5f')),'role':'agent'},'attributes':['id','name',_0xb9bd('0x60'),_0xb9bd('0x61'),_0xb9bd('0x62')]});}})[_0xb9bd('0x2b')](function(_0x17379f){if(_0x17379f){return{'count':_0x17379f[_0xb9bd('0x24')],'rows':_[_0xb9bd('0x33')](_0x17379f[_0xb9bd('0x63')],function(_0x1a947a){return{'membername':_0x1a947a['name'],'UserId':_0x1a947a['id'],'queue_name':_0x42311e[_0xb9bd('0x31')],'SmsQueueId':_0x42311e['id'],'interface':util[_0xb9bd('0x64')](_0xb9bd('0x65'),'SIP',_0x1a947a[_0xb9bd('0x31')]),'penalty':0x0,'paused':_0x1a947a[_0xb9bd('0x60')],'createdAt':_0x1a947a[_0xb9bd('0x62')],'updatedAt':_0x1a947a[_0xb9bd('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb9bd('0x2b')](respondWithFilteredResult(_0x4a35e6,_0x4df3a9))[_0xb9bd('0x4f')](handleError(_0x4a35e6,null));};exports['getTeams']=function(_0x1f9196,_0xf3289a,_0x5a4dad){var _0x4fc4ee={};var _0x2d0669={};var _0x4ecb1a;var _0x2264e1;return db[_0xb9bd('0x34')][_0xb9bd('0x59')]({'where':{'id':_0x1f9196[_0xb9bd('0x4b')]['id']}})['then'](handleEntityNotFound(_0xf3289a,null))[_0xb9bd('0x2b')](function(_0x1ce8a7){if(_0x1ce8a7){_0x4ecb1a=_0x1ce8a7;_0x2d0669['model']=_['keys'](db[_0xb9bd('0x66')][_0xb9bd('0x35')]);_0x2d0669[_0xb9bd('0x3a')]=_[_0xb9bd('0x4c')](_0x1f9196[_0xb9bd('0x3a')]);_0x2d0669[_0xb9bd('0x44')]=_[_0xb9bd('0x3c')](_0x2d0669[_0xb9bd('0x39')],_0x2d0669[_0xb9bd('0x3a')]);_0x4fc4ee[_0xb9bd('0x3b')]=_['intersection'](_0x2d0669[_0xb9bd('0x39')],qs[_0xb9bd('0x3d')](_0x1f9196[_0xb9bd('0x3a')][_0xb9bd('0x3d')]));_0x4fc4ee['attributes']=_0x4fc4ee[_0xb9bd('0x3b')][_0xb9bd('0x3e')]?_0x4fc4ee[_0xb9bd('0x3b')]:_0x2d0669[_0xb9bd('0x39')];_0x4fc4ee[_0xb9bd('0x41')]=qs['sort'](_0x1f9196[_0xb9bd('0x3a')][_0xb9bd('0x42')]);_0x4fc4ee['where']=qs[_0xb9bd('0x44')](_[_0xb9bd('0x5b')](_0x1f9196[_0xb9bd('0x3a')],_0x2d0669[_0xb9bd('0x44')]));if(_0x1f9196['query']['filter']){_0x4fc4ee[_0xb9bd('0x43')]=_[_0xb9bd('0x46')](_0x4fc4ee[_0xb9bd('0x43')],{'$or':_['map'](_0x4fc4ee[_0xb9bd('0x3b')],function(_0xd1e7d8){var _0x2c634f={};_0x2c634f[_0xd1e7d8]={'$like':'%'+_0x1f9196[_0xb9bd('0x3a')][_0xb9bd('0x45')]+'%'};return _0x2c634f;})});}_0x4fc4ee=_['merge']({},_0x4fc4ee,_0x1f9196[_0xb9bd('0x48')]);return _0x4ecb1a['getTeams'](_0x4fc4ee);}})[_0xb9bd('0x2b')](function(_0x1923f9){if(_0x1923f9){_0x2264e1=_0x1923f9[_0xb9bd('0x3e')];if(!_0x1f9196[_0xb9bd('0x3a')][_0xb9bd('0x3f')](_0xb9bd('0x40'))){_0x4fc4ee['limit']=qs[_0xb9bd('0x23')](_0x1f9196['query']['limit']);_0x4fc4ee[_0xb9bd('0x21')]=qs['offset'](_0x1f9196[_0xb9bd('0x3a')][_0xb9bd('0x21')]);}return _0x4ecb1a['getTeams'](_0x4fc4ee);}})['then'](function(_0x3801c2){if(_0x3801c2){return _0x3801c2?{'count':_0x2264e1,'rows':_0x3801c2}:null;}})['then'](respondWithResult(_0xf3289a,null))[_0xb9bd('0x4f')](handleError(_0xf3289a,null));};exports[_0xb9bd('0x67')]=function(_0xc56350,_0x49ba37,_0x3a85ff){var _0x2914c7=_0xc56350['body'][_0xb9bd('0x68')];return db[_0xb9bd('0x66')][_0xb9bd('0x4a')]({'where':{'id':_0x2914c7},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb9bd('0x31'),_0xb9bd('0x69'),'voicePause','interface'],'raw':!![]}]})[_0xb9bd('0x2b')](function(_0xc40d71){if(_0xc40d71){var _0x3e4ee0=_[_0xb9bd('0x6a')](_0xc40d71,function(_0x42a7ba){var _0x1f8f0e=_0x42a7ba[_0xb9bd('0x2d')]({'plain':!![]});return _0x1f8f0e[_0xb9bd('0x6b')];});return db[_0xb9bd('0x34')]['find']({'where':{'id':_0xc56350[_0xb9bd('0x4b')]['id']}})[_0xb9bd('0x2b')](function(_0x597db7){return db[_0xb9bd('0x6c')][_0xb9bd('0x6d')](function(_0x182ed5){return _0x597db7['addTeams'](_0x2914c7,{'transaction':_0x182ed5})[_0xb9bd('0x2b')](function(){return BPromise[_0xb9bd('0x6e')](_0x3e4ee0,function(_0x4e1dc2){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4e1dc2['id'],'SmsQueueId':_0xc56350[_0xb9bd('0x4b')]['id']},'transaction':_0x182ed5});});})[_0xb9bd('0x2b')](function(){_0x3e4ee0[_0xb9bd('0x6f')](function(_0x103234){socket[_0xb9bd('0x70')](_0xb9bd('0x71'),{'UserId':_0x103234['id'],'SmsQueueId':_0x597db7['id']});});});});});}})[_0xb9bd('0x2b')](respondWithStatusCode(_0x49ba37,null))[_0xb9bd('0x4f')](handleError(_0x49ba37,null));};exports[_0xb9bd('0x72')]=function(_0x9250df,_0x3c73fc,_0x449e76){return db[_0xb9bd('0x66')][_0xb9bd('0x4a')]({'where':{'id':_0x9250df[_0xb9bd('0x3a')][_0xb9bd('0x68')]},'attributes':['id'],'include':[{'model':db[_0xb9bd('0x5d')],'as':_0xb9bd('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xb9bd('0x2b')](handleEntityNotFound(_0x3c73fc,null))[_0xb9bd('0x2b')](function(_0x525ad7){var _0x34678f=_['map'](_0x525ad7,'id');var _0x406cde=[];var _0x430b49=[];var _0x40bf59=squel[_0xb9bd('0x73')]();_0x40bf59[_0xb9bd('0x74')](_0xb9bd('0x75'))['from']('team_has_sms_queues','tq')[_0xb9bd('0x76')](_0xb9bd('0x77'),'ut',_0xb9bd('0x78'))[_0xb9bd('0x43')](_0xb9bd('0x79'),_0x9250df[_0xb9bd('0x4b')]['id']);for(var _0x31403b=0x0;_0x31403b<_0x525ad7[_0xb9bd('0x3e')];_0x31403b+=0x1){let _0x5990ff=_0x525ad7[_0x31403b];for(var _0x37a216=0x0;_0x37a216<_0x5990ff['Agents'][_0xb9bd('0x3e')];_0x37a216+=0x1){let _0x2ea85a=_0x5990ff[_0xb9bd('0x6b')][_0x37a216];var _0x347180=_0x40bf59[_0xb9bd('0x7a')]();_0x347180[_0xb9bd('0x43')](_0xb9bd('0x7b'),_0x2ea85a['id']);_0x430b49[_0xb9bd('0x7c')](db[_0xb9bd('0x6c')][_0xb9bd('0x3a')](_0x347180[_0xb9bd('0x7d')](),{'type':db[_0xb9bd('0x6c')][_0xb9bd('0x7e')]['SELECT']})[_0xb9bd('0x2b')](function(_0x140a6e){if(_0x140a6e[_0xb9bd('0x3e')]===0x1){return _0x2ea85a['id'];}else{var _0x31cc6e=_[_0xb9bd('0x7f')](_[_0xb9bd('0x33')](_0x140a6e,_0xb9bd('0x80')),function(_0x50a5a3){return _['includes'](_0x34678f,_0x50a5a3);});if(_0x31cc6e){return _0x2ea85a['id'];}}}));}}return BPromise[_0xb9bd('0x81')](_0x430b49)[_0xb9bd('0x2b')](function(_0x9bc7a5){_0x406cde=_(_0x406cde)[_0xb9bd('0x82')](_0x9bc7a5)[_0xb9bd('0x83')]()[_0xb9bd('0x84')]();return db['SmsQueue'][_0xb9bd('0x4e')]({'where':{'id':_0x9250df['params']['id']}})[_0xb9bd('0x2b')](function(_0x3fa970){return db[_0xb9bd('0x6c')][_0xb9bd('0x6d')](function(_0x515b39){return _0x3fa970[_0xb9bd('0x72')](_0x9250df[_0xb9bd('0x3a')][_0xb9bd('0x68')],{'transaction':_0x515b39})[_0xb9bd('0x2b')](function(){if(!_[_0xb9bd('0x85')](_0x406cde)){return _0x3fa970[_0xb9bd('0x86')](_0x406cde,{'transaction':_0x515b39});}})['then'](function(){_0x406cde[_0xb9bd('0x6f')](function(_0x49f897){socket['emit'](_0xb9bd('0x87'),{'UserId':_0x49f897,'SmsQueueId':_0x3fa970['id']});});});});});});})[_0xb9bd('0x2b')](respondWithStatusCode(_0x3c73fc,null))[_0xb9bd('0x4f')](handleError(_0x3c73fc,null));};exports['addAgents']=function(_0x442354,_0x3783a5,_0x1927b1){return db[_0xb9bd('0x34')]['find']({'where':{'id':_0x442354[_0xb9bd('0x4b')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x3783a5,null))[_0xb9bd('0x2b')](function(_0x32f009){if(_0x32f009){return _0x32f009[_0xb9bd('0x88')](_0x442354[_0xb9bd('0x50')][_0xb9bd('0x68')],_[_0xb9bd('0x89')](_0x442354[_0xb9bd('0x50')],[_0xb9bd('0x68'),'id'])||{})[_0xb9bd('0x8a')](function(_0x129f9e){for(var _0x3793f5=0x0;_0x3793f5<_0x442354[_0xb9bd('0x50')]['ids']['length'];_0x3793f5+=0x1){socket[_0xb9bd('0x70')](_0xb9bd('0x71'),{'UserId':Number(_0x442354[_0xb9bd('0x50')][_0xb9bd('0x68')][_0x3793f5]),'SmsQueueId':Number(_0x442354[_0xb9bd('0x4b')]['id'])});}return _0x129f9e;});}})[_0xb9bd('0x2b')](respondWithResult(_0x3783a5,null))[_0xb9bd('0x4f')](handleError(_0x3783a5,null));};exports['removeAgents']=function(_0x2bf5c5,_0x27abaa,_0x45a9b0){return db[_0xb9bd('0x34')][_0xb9bd('0x4e')]({'where':{'id':_0x2bf5c5['params']['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x27abaa,null))[_0xb9bd('0x2b')](function(_0x19d83e){if(_0x19d83e){return _0x19d83e[_0xb9bd('0x86')](_0x2bf5c5[_0xb9bd('0x3a')][_0xb9bd('0x68')])['then'](function(){if(_[_0xb9bd('0x8b')](_0x2bf5c5['query'][_0xb9bd('0x68')])){for(var _0x1d2a02=0x0;_0x1d2a02<_0x2bf5c5['query']['ids']['length'];_0x1d2a02+=0x1){socket[_0xb9bd('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x2bf5c5[_0xb9bd('0x3a')][_0xb9bd('0x68')][_0x1d2a02]),'SmsQueueId':Number(_0x2bf5c5['params']['id'])});}}else{socket[_0xb9bd('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x2bf5c5['query'][_0xb9bd('0x68')]),'SmsQueueId':Number(_0x2bf5c5[_0xb9bd('0x4b')]['id'])});}});}})[_0xb9bd('0x2b')](respondWithStatusCode(_0x27abaa,null))[_0xb9bd('0x4f')](handleError(_0x27abaa,null));};exports[_0xb9bd('0x8c')]=function(_0x3fea13,_0x590cb9,_0x33bb92){var _0x321d2a={};var _0xc88935={};var _0x5715cc;var _0x16f2ba;return db[_0xb9bd('0x34')][_0xb9bd('0x59')]({'where':{'id':_0x3fea13['params']['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x590cb9,null))[_0xb9bd('0x2b')](function(_0x1a4185){if(_0x1a4185){_0x5715cc=_0x1a4185;_0xc88935[_0xb9bd('0x39')]=_[_0xb9bd('0x4c')](db['User']['rawAttributes']);_0xc88935['query']=_[_0xb9bd('0x4c')](_0x3fea13['query']);_0xc88935[_0xb9bd('0x44')]=_[_0xb9bd('0x3c')](_0xc88935[_0xb9bd('0x39')],_0xc88935['query']);_0x321d2a['attributes']=_['intersection'](_0xc88935['model'],qs[_0xb9bd('0x3d')](_0x3fea13[_0xb9bd('0x3a')][_0xb9bd('0x3d')]));_0x321d2a[_0xb9bd('0x3b')]=_0x321d2a['attributes'][_0xb9bd('0x3e')]?_0x321d2a[_0xb9bd('0x3b')]:_0xc88935[_0xb9bd('0x39')];_0x321d2a[_0xb9bd('0x41')]=qs['sort'](_0x3fea13['query'][_0xb9bd('0x42')]);_0x321d2a['where']=qs[_0xb9bd('0x44')](_['pick'](_0x3fea13[_0xb9bd('0x3a')],_0xc88935[_0xb9bd('0x44')]));if(_0x3fea13['query'][_0xb9bd('0x45')]){_0x321d2a[_0xb9bd('0x43')]=_[_0xb9bd('0x46')](_0x321d2a['where'],{'$or':_[_0xb9bd('0x33')](_0x321d2a['attributes'],function(_0x31d022){var _0x104f2f={};_0x104f2f[_0x31d022]={'$like':'%'+_0x3fea13[_0xb9bd('0x3a')][_0xb9bd('0x45')]+'%'};return _0x104f2f;})});}_0x321d2a=_[_0xb9bd('0x46')]({},_0x321d2a,_0x3fea13[_0xb9bd('0x48')]);return _0x5715cc[_0xb9bd('0x8c')](_0x321d2a);}})[_0xb9bd('0x2b')](function(_0x187af6){if(_0x187af6){_0x16f2ba=_0x187af6[_0xb9bd('0x3e')];if(!_0x3fea13[_0xb9bd('0x3a')][_0xb9bd('0x3f')]('nolimit')){_0x321d2a['limit']=qs[_0xb9bd('0x23')](_0x3fea13['query'][_0xb9bd('0x23')]);_0x321d2a[_0xb9bd('0x21')]=qs['offset'](_0x3fea13[_0xb9bd('0x3a')][_0xb9bd('0x21')]);}return _0x5715cc['getAgents'](_0x321d2a);}})['then'](function(_0x1555bb){if(_0x1555bb){return _0x1555bb?{'count':_0x16f2ba,'rows':_0x1555bb}:null;}})[_0xb9bd('0x2b')](respondWithResult(_0x590cb9,null))[_0xb9bd('0x4f')](handleError(_0x590cb9,null));};
\ No newline at end of file
+var _0xc7d5=['create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserSmsQueue','filters','pick','SmsQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','format','getTeams','Team','Agents','online','interface','flatMap','sequelize','addTeams','each','forEach','emit','ids','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','getAgents','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','SmsQueues','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','length'];(function(_0xa76db3,_0xf8fd0){var _0x47338e=function(_0x3163b6){while(--_0x3163b6){_0xa76db3['push'](_0xa76db3['shift']());}};_0x47338e(++_0xf8fd0);}(_0xc7d5,0x156));var _0x5c7d=function(_0x16923d,_0x293bcd){_0x16923d=_0x16923d-0x0;var _0x439c36=_0xc7d5[_0x16923d];return _0x439c36;};'use strict';var emlformat=require(_0x5c7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c7d('0x1'));var jsonpatch=require(_0x5c7d('0x2'));var rp=require('request-promise');var moment=require(_0x5c7d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c7d('0x4'));var path=require(_0x5c7d('0x5'));var sox=require(_0x5c7d('0x6'));var csv=require(_0x5c7d('0x7'));var ejs=require(_0x5c7d('0x8'));var fs=require('fs');var fs_extra=require(_0x5c7d('0x9'));var _=require(_0x5c7d('0xa'));var squel=require(_0x5c7d('0xb'));var crypto=require(_0x5c7d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5c7d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5c7d('0xe'));var Redis=require(_0x5c7d('0xf'));var authService=require(_0x5c7d('0x10'));var qs=require(_0x5c7d('0x11'));var as=require(_0x5c7d('0x12'));var hardwareService=require(_0x5c7d('0x13'));var logger=require(_0x5c7d('0x14'))('api');var utils=require(_0x5c7d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5c7d('0x16'));var db=require(_0x5c7d('0x17'))['db'];config[_0x5c7d('0x18')]=_[_0x5c7d('0x19')](config[_0x5c7d('0x18')],{'host':_0x5c7d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c7d('0x18')]));require(_0x5c7d('0x1b'))[_0x5c7d('0x1c')](socket);function respondWithStatusCode(_0x491c6b,_0x597361){_0x597361=_0x597361||0xcc;return function(_0x11c948){if(_0x11c948){return _0x491c6b[_0x5c7d('0x1d')](_0x597361);}return _0x491c6b[_0x5c7d('0x1e')](_0x597361)[_0x5c7d('0x1f')]();};}function respondWithResult(_0x19f265,_0x48679f){_0x48679f=_0x48679f||0xc8;return function(_0x653593){if(_0x653593){return _0x19f265['status'](_0x48679f)['json'](_0x653593);}};}function respondWithFilteredResult(_0xc8a203,_0x4e39cd){return function(_0x9e7994){if(_0x9e7994){var _0x5a5067=typeof _0x4e39cd[_0x5c7d('0x20')]===_0x5c7d('0x21')&&typeof _0x4e39cd[_0x5c7d('0x22')]===_0x5c7d('0x21');var _0x5502a7=_0x9e7994[_0x5c7d('0x23')];var _0x55c6bd=_0x5a5067?0x0:_0x4e39cd['offset'];var _0x339d6=_0x5a5067?_0x9e7994['count']:_0x4e39cd['offset']+_0x4e39cd['limit'];var _0x17e8f3;if(_0x339d6>=_0x5502a7){_0x339d6=_0x5502a7;_0x17e8f3=0xc8;}else{_0x17e8f3=0xce;}_0xc8a203[_0x5c7d('0x1e')](_0x17e8f3);return _0xc8a203[_0x5c7d('0x24')](_0x5c7d('0x25'),_0x55c6bd+'-'+_0x339d6+'/'+_0x5502a7)[_0x5c7d('0x26')](_0x9e7994);}return null;};}function patchUpdates(_0xc1cb1c){return function(_0xbeecdd){try{jsonpatch[_0x5c7d('0x27')](_0xbeecdd,_0xc1cb1c,!![]);}catch(_0x37ab7d){return BPromise[_0x5c7d('0x28')](_0x37ab7d);}return _0xbeecdd[_0x5c7d('0x29')]();};}function saveUpdates(_0x5cf58e,_0x3e9d68){return function(_0x29abd9){if(_0x29abd9){return _0x29abd9[_0x5c7d('0x2a')](_0x5cf58e)[_0x5c7d('0x2b')](function(_0x447f8f){return _0x447f8f;});}return null;};}function removeEntity(_0x1716aa,_0x24a1f3){return function(_0x1cdff7){if(_0x1cdff7){return _0x1cdff7[_0x5c7d('0x2c')]()[_0x5c7d('0x2b')](function(){var _0x342aeb=_0x1cdff7['get']({'plain':!![]});var _0x237b81=_0x5c7d('0x2d');return db['UserProfileResource'][_0x5c7d('0x2c')]({'where':{'type':_0x237b81,'resourceId':_0x342aeb['id']}})[_0x5c7d('0x2b')](function(){return _0x1cdff7;});})[_0x5c7d('0x2b')](function(){_0x1716aa[_0x5c7d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5650fa,_0x1a105a){return function(_0x13ff91){if(!_0x13ff91){_0x5650fa[_0x5c7d('0x1d')](0x194);}return _0x13ff91;};}function handleError(_0x27f9f4,_0x43c6c9){_0x43c6c9=_0x43c6c9||0x1f4;return function(_0x24c13e){logger[_0x5c7d('0x2e')](_0x24c13e[_0x5c7d('0x2f')]);if(_0x24c13e[_0x5c7d('0x30')]){delete _0x24c13e[_0x5c7d('0x30')];}_0x27f9f4[_0x5c7d('0x1e')](_0x43c6c9)[_0x5c7d('0x31')](_0x24c13e);};}exports[_0x5c7d('0x32')]=function(_0x2ff9f6,_0x216708){var _0x20d180={},_0x3f8a33={},_0x5c36c3={'count':0x0,'rows':[]};var _0x2ce512=_[_0x5c7d('0x33')](db[_0x5c7d('0x34')][_0x5c7d('0x35')],function(_0x263431){return{'name':_0x263431[_0x5c7d('0x36')],'type':_0x263431['type'][_0x5c7d('0x37')]};});_0x3f8a33[_0x5c7d('0x38')]=_[_0x5c7d('0x33')](_0x2ce512,_0x5c7d('0x30'));_0x3f8a33['query']=_[_0x5c7d('0x39')](_0x2ff9f6['query']);_0x3f8a33['filters']=_[_0x5c7d('0x3a')](_0x3f8a33[_0x5c7d('0x38')],_0x3f8a33[_0x5c7d('0x3b')]);_0x20d180[_0x5c7d('0x3c')]=_[_0x5c7d('0x3a')](_0x3f8a33[_0x5c7d('0x38')],qs[_0x5c7d('0x3d')](_0x2ff9f6[_0x5c7d('0x3b')][_0x5c7d('0x3d')]));_0x20d180['attributes']=_0x20d180[_0x5c7d('0x3c')]['length']?_0x20d180[_0x5c7d('0x3c')]:_0x3f8a33[_0x5c7d('0x38')];if(!_0x2ff9f6[_0x5c7d('0x3b')][_0x5c7d('0x3e')](_0x5c7d('0x3f'))){_0x20d180[_0x5c7d('0x22')]=qs[_0x5c7d('0x22')](_0x2ff9f6[_0x5c7d('0x3b')][_0x5c7d('0x22')]);_0x20d180[_0x5c7d('0x20')]=qs['offset'](_0x2ff9f6[_0x5c7d('0x3b')][_0x5c7d('0x20')]);}_0x20d180[_0x5c7d('0x40')]=qs['sort'](_0x2ff9f6['query'][_0x5c7d('0x41')]);_0x20d180[_0x5c7d('0x42')]=qs['filters'](_['pick'](_0x2ff9f6[_0x5c7d('0x3b')],_0x3f8a33['filters']),_0x2ce512);if(_0x2ff9f6[_0x5c7d('0x3b')][_0x5c7d('0x43')]){_0x20d180[_0x5c7d('0x42')]=_[_0x5c7d('0x44')](_0x20d180[_0x5c7d('0x42')],{'$or':_['map'](_0x2ce512,function(_0x1b7be1){if(_0x1b7be1[_0x5c7d('0x45')]!==_0x5c7d('0x46')){var _0x529737={};_0x529737[_0x1b7be1[_0x5c7d('0x30')]]={'$like':'%'+_0x2ff9f6[_0x5c7d('0x3b')][_0x5c7d('0x43')]+'%'};return _0x529737;}})});}_0x20d180=_[_0x5c7d('0x44')]({},_0x20d180,_0x2ff9f6[_0x5c7d('0x47')]);var _0x390e84={'where':_0x20d180[_0x5c7d('0x42')]};return db[_0x5c7d('0x34')][_0x5c7d('0x23')](_0x390e84)[_0x5c7d('0x2b')](function(_0xbc20ee){_0x5c36c3[_0x5c7d('0x23')]=_0xbc20ee;if(_0x2ff9f6[_0x5c7d('0x3b')][_0x5c7d('0x48')]){_0x20d180[_0x5c7d('0x49')]=[{'all':!![]}];}return db[_0x5c7d('0x34')][_0x5c7d('0x4a')](_0x20d180);})['then'](function(_0x1c3383){_0x5c36c3[_0x5c7d('0x4b')]=_0x1c3383;return _0x5c36c3;})[_0x5c7d('0x2b')](respondWithFilteredResult(_0x216708,_0x20d180))['catch'](handleError(_0x216708,null));};exports['show']=function(_0x47b64c,_0x593807){var _0x4cb873={'raw':!![],'where':{'id':_0x47b64c[_0x5c7d('0x4c')]['id']}},_0x261440={};_0x261440['model']=_['keys'](db[_0x5c7d('0x34')]['rawAttributes']);_0x261440[_0x5c7d('0x3b')]=_[_0x5c7d('0x39')](_0x47b64c['query']);_0x261440['filters']=_[_0x5c7d('0x3a')](_0x261440[_0x5c7d('0x38')],_0x261440[_0x5c7d('0x3b')]);_0x4cb873[_0x5c7d('0x3c')]=_[_0x5c7d('0x3a')](_0x261440[_0x5c7d('0x38')],qs['fields'](_0x47b64c[_0x5c7d('0x3b')]['fields']));_0x4cb873[_0x5c7d('0x3c')]=_0x4cb873['attributes'][_0x5c7d('0x4d')]?_0x4cb873[_0x5c7d('0x3c')]:_0x261440['model'];if(_0x47b64c[_0x5c7d('0x3b')][_0x5c7d('0x48')]){_0x4cb873[_0x5c7d('0x49')]=[{'all':!![]}];}_0x4cb873=_[_0x5c7d('0x44')]({},_0x4cb873,_0x47b64c[_0x5c7d('0x47')]);return db['SmsQueue']['find'](_0x4cb873)[_0x5c7d('0x2b')](handleEntityNotFound(_0x593807,null))[_0x5c7d('0x2b')](respondWithResult(_0x593807,null))['catch'](handleError(_0x593807,null));};exports['create']=function(_0x31f4af,_0x446472){return db[_0x5c7d('0x34')][_0x5c7d('0x4e')](_0x31f4af['body'],{})[_0x5c7d('0x2b')](function(_0x219bbd){var _0x267b55=_0x31f4af['user'][_0x5c7d('0x4f')]({'plain':!![]});if(!_0x267b55)throw new Error(_0x5c7d('0x50'));if(_0x267b55[_0x5c7d('0x51')]===_0x5c7d('0x52')){var _0x5201c5=_0x219bbd['get']({'plain':!![]});var _0x560c14='SmsQueues';return db[_0x5c7d('0x53')][_0x5c7d('0x54')]({'where':{'name':_0x560c14,'userProfileId':_0x267b55['userProfileId']},'raw':!![]})[_0x5c7d('0x2b')](function(_0x139eac){if(_0x139eac&&_0x139eac[_0x5c7d('0x55')]===0x0){return db[_0x5c7d('0x56')][_0x5c7d('0x4e')]({'name':_0x5201c5[_0x5c7d('0x30')],'resourceId':_0x5201c5['id'],'type':_0x139eac[_0x5c7d('0x30')],'sectionId':_0x139eac['id']},{})[_0x5c7d('0x2b')](function(){return _0x219bbd;});}else{return _0x219bbd;}})[_0x5c7d('0x57')](function(_0x394080){logger[_0x5c7d('0x2e')](_0x5c7d('0x58'),_0x394080);throw _0x394080;});}return _0x219bbd;})[_0x5c7d('0x2b')](respondWithResult(_0x446472,0xc9))['catch'](handleError(_0x446472,null));};exports['update']=function(_0x280a34,_0x5689c5){if(_0x280a34['body']['id']){delete _0x280a34[_0x5c7d('0x59')]['id'];}return db[_0x5c7d('0x34')][_0x5c7d('0x54')]({'where':{'id':_0x280a34[_0x5c7d('0x4c')]['id']}})[_0x5c7d('0x2b')](handleEntityNotFound(_0x5689c5,null))['then'](saveUpdates(_0x280a34['body'],null))[_0x5c7d('0x2b')](respondWithResult(_0x5689c5,null))[_0x5c7d('0x57')](handleError(_0x5689c5,null));};exports['destroy']=function(_0x34553b,_0x5a6b4d){return db[_0x5c7d('0x34')][_0x5c7d('0x54')]({'where':{'id':_0x34553b['params']['id']}})[_0x5c7d('0x2b')](handleEntityNotFound(_0x5a6b4d,null))[_0x5c7d('0x2b')](removeEntity(_0x5a6b4d,null))[_0x5c7d('0x57')](handleError(_0x5a6b4d,null));};exports[_0x5c7d('0x5a')]=function(_0x3d5550,_0x5b1fdb){return db[_0x5c7d('0x34')][_0x5c7d('0x5a')]()['then'](respondWithResult(_0x5b1fdb,null))['catch'](handleError(_0x5b1fdb,null));};exports['getMembers']=function(_0x524845,_0x9bf41,_0x90f5c3){var _0x42234b={'raw':!![],'where':{}},_0x58ec1b={},_0x5e889c;return db['SmsQueue'][_0x5c7d('0x5b')]({'where':{'id':_0x524845['params']['id']}})[_0x5c7d('0x2b')](handleEntityNotFound(_0x9bf41,null))['then'](function(_0x1461f8){if(_0x1461f8){_0x5e889c=_0x1461f8[_0x5c7d('0x4f')]({'plain':!![]});_0x58ec1b[_0x5c7d('0x38')]=_[_0x5c7d('0x39')](db[_0x5c7d('0x5c')]['rawAttributes']);_0x58ec1b[_0x5c7d('0x3b')]=_[_0x5c7d('0x39')](_0x524845[_0x5c7d('0x3b')]);_0x58ec1b[_0x5c7d('0x5d')]=_['intersection'](_0x58ec1b[_0x5c7d('0x38')],_0x58ec1b[_0x5c7d('0x3b')]);_0x42234b[_0x5c7d('0x3c')]=_[_0x5c7d('0x3a')](_0x58ec1b[_0x5c7d('0x38')],qs[_0x5c7d('0x3d')](_0x524845[_0x5c7d('0x3b')][_0x5c7d('0x3d')]));_0x42234b[_0x5c7d('0x3c')]=_0x42234b[_0x5c7d('0x3c')]['length']?_0x42234b[_0x5c7d('0x3c')]:_0x58ec1b[_0x5c7d('0x38')];if(!_0x524845[_0x5c7d('0x3b')][_0x5c7d('0x3e')]('nolimit')){_0x42234b[_0x5c7d('0x22')]=qs[_0x5c7d('0x22')](_0x524845[_0x5c7d('0x3b')]['limit']);_0x42234b[_0x5c7d('0x20')]=qs['offset'](_0x524845[_0x5c7d('0x3b')][_0x5c7d('0x20')]);}_0x42234b['order']=qs['sort'](_0x524845['query'][_0x5c7d('0x41')]);_0x42234b[_0x5c7d('0x42')]=qs[_0x5c7d('0x5d')](_[_0x5c7d('0x5e')](_0x524845[_0x5c7d('0x3b')],_0x58ec1b['filters']));_0x42234b[_0x5c7d('0x42')][_0x5c7d('0x5f')]=_0x1461f8['id'];if(_0x524845[_0x5c7d('0x3b')][_0x5c7d('0x43')]){_0x42234b[_0x5c7d('0x42')]=_[_0x5c7d('0x44')](_0x42234b[_0x5c7d('0x42')],{'$or':_[_0x5c7d('0x33')](_0x42234b[_0x5c7d('0x3c')],function(_0x306806){var _0x4b4750={};_0x4b4750[_0x306806]={'$like':'%'+_0x524845[_0x5c7d('0x3b')][_0x5c7d('0x43')]+'%'};return _0x4b4750;})});}_0x42234b=_[_0x5c7d('0x44')]({},_0x42234b,_0x524845['options']);return db[_0x5c7d('0x5c')]['findAll'](_0x42234b);}})[_0x5c7d('0x2b')](function(_0x5af9e5){if(_0x5af9e5){return db[_0x5c7d('0x60')][_0x5c7d('0x61')]({'where':{'id':_[_0x5c7d('0x33')](_0x5af9e5,_0x5c7d('0x62')),'role':'agent'},'attributes':['id',_0x5c7d('0x30'),'smsPause',_0x5c7d('0x63'),_0x5c7d('0x64')]});}})[_0x5c7d('0x2b')](function(_0x1e724f){if(_0x1e724f){return{'count':_0x1e724f[_0x5c7d('0x23')],'rows':_[_0x5c7d('0x33')](_0x1e724f['rows'],function(_0x2e033f){return{'membername':_0x2e033f[_0x5c7d('0x30')],'UserId':_0x2e033f['id'],'queue_name':_0x5e889c[_0x5c7d('0x30')],'SmsQueueId':_0x5e889c['id'],'interface':util[_0x5c7d('0x65')]('%s/%s','SIP',_0x2e033f['name']),'penalty':0x0,'paused':_0x2e033f['smsPause'],'createdAt':_0x2e033f[_0x5c7d('0x64')],'updatedAt':_0x2e033f[_0x5c7d('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5c7d('0x2b')](respondWithFilteredResult(_0x9bf41,_0x42234b))[_0x5c7d('0x57')](handleError(_0x9bf41,null));};exports[_0x5c7d('0x66')]=function(_0x432d26,_0x2851fb,_0x5d2214){var _0x27a7c7={};var _0x1b7766={};var _0x3bd556;var _0x4e1315;return db['SmsQueue'][_0x5c7d('0x5b')]({'where':{'id':_0x432d26['params']['id']}})[_0x5c7d('0x2b')](handleEntityNotFound(_0x2851fb,null))['then'](function(_0x3e1bf0){if(_0x3e1bf0){_0x3bd556=_0x3e1bf0;_0x1b7766[_0x5c7d('0x38')]=_['keys'](db[_0x5c7d('0x67')]['rawAttributes']);_0x1b7766['query']=_[_0x5c7d('0x39')](_0x432d26[_0x5c7d('0x3b')]);_0x1b7766[_0x5c7d('0x5d')]=_['intersection'](_0x1b7766[_0x5c7d('0x38')],_0x1b7766['query']);_0x27a7c7[_0x5c7d('0x3c')]=_[_0x5c7d('0x3a')](_0x1b7766[_0x5c7d('0x38')],qs['fields'](_0x432d26[_0x5c7d('0x3b')][_0x5c7d('0x3d')]));_0x27a7c7[_0x5c7d('0x3c')]=_0x27a7c7['attributes'][_0x5c7d('0x4d')]?_0x27a7c7[_0x5c7d('0x3c')]:_0x1b7766['model'];_0x27a7c7[_0x5c7d('0x40')]=qs[_0x5c7d('0x41')](_0x432d26[_0x5c7d('0x3b')]['sort']);_0x27a7c7[_0x5c7d('0x42')]=qs[_0x5c7d('0x5d')](_[_0x5c7d('0x5e')](_0x432d26[_0x5c7d('0x3b')],_0x1b7766[_0x5c7d('0x5d')]));if(_0x432d26[_0x5c7d('0x3b')][_0x5c7d('0x43')]){_0x27a7c7[_0x5c7d('0x42')]=_[_0x5c7d('0x44')](_0x27a7c7[_0x5c7d('0x42')],{'$or':_[_0x5c7d('0x33')](_0x27a7c7[_0x5c7d('0x3c')],function(_0x367a42){var _0x4d11aa={};_0x4d11aa[_0x367a42]={'$like':'%'+_0x432d26[_0x5c7d('0x3b')][_0x5c7d('0x43')]+'%'};return _0x4d11aa;})});}_0x27a7c7=_[_0x5c7d('0x44')]({},_0x27a7c7,_0x432d26[_0x5c7d('0x47')]);return _0x3bd556[_0x5c7d('0x66')](_0x27a7c7);}})[_0x5c7d('0x2b')](function(_0x1deef2){if(_0x1deef2){_0x4e1315=_0x1deef2[_0x5c7d('0x4d')];if(!_0x432d26[_0x5c7d('0x3b')][_0x5c7d('0x3e')](_0x5c7d('0x3f'))){_0x27a7c7['limit']=qs[_0x5c7d('0x22')](_0x432d26['query'][_0x5c7d('0x22')]);_0x27a7c7[_0x5c7d('0x20')]=qs[_0x5c7d('0x20')](_0x432d26[_0x5c7d('0x3b')][_0x5c7d('0x20')]);}return _0x3bd556['getTeams'](_0x27a7c7);}})['then'](function(_0xeaa355){if(_0xeaa355){return _0xeaa355?{'count':_0x4e1315,'rows':_0xeaa355}:null;}})[_0x5c7d('0x2b')](respondWithResult(_0x2851fb,null))[_0x5c7d('0x57')](handleError(_0x2851fb,null));};exports['addTeams']=function(_0x5ca6ee,_0x53901c,_0x1b1511){var _0x2158da=_0x5ca6ee[_0x5c7d('0x59')]['ids'];return db[_0x5c7d('0x67')][_0x5c7d('0x4a')]({'where':{'id':_0x2158da},'attributes':['id'],'include':[{'model':db[_0x5c7d('0x60')],'as':_0x5c7d('0x68'),'attributes':['id',_0x5c7d('0x30'),_0x5c7d('0x69'),'voicePause',_0x5c7d('0x6a')],'raw':!![]}]})['then'](function(_0x1424f4){if(_0x1424f4){var _0x15d6a8=_[_0x5c7d('0x6b')](_0x1424f4,function(_0x1e46f7){var _0x5a31e0=_0x1e46f7[_0x5c7d('0x4f')]({'plain':!![]});return _0x5a31e0['Agents'];});return db[_0x5c7d('0x34')][_0x5c7d('0x54')]({'where':{'id':_0x5ca6ee[_0x5c7d('0x4c')]['id']}})['then'](function(_0x3f6784){return db[_0x5c7d('0x6c')]['transaction'](function(_0x3b4639){return _0x3f6784[_0x5c7d('0x6d')](_0x2158da,{'transaction':_0x3b4639})[_0x5c7d('0x2b')](function(){return BPromise[_0x5c7d('0x6e')](_0x15d6a8,function(_0x1daa86){return db[_0x5c7d('0x5c')]['findOrCreate']({'where':{'UserId':_0x1daa86['id'],'SmsQueueId':_0x5ca6ee[_0x5c7d('0x4c')]['id']},'transaction':_0x3b4639});});})[_0x5c7d('0x2b')](function(){_0x15d6a8[_0x5c7d('0x6f')](function(_0x106a61){socket[_0x5c7d('0x70')]('userSmsQueue:save',{'UserId':_0x106a61['id'],'SmsQueueId':_0x3f6784['id']});});});});});}})[_0x5c7d('0x2b')](respondWithStatusCode(_0x53901c,null))['catch'](handleError(_0x53901c,null));};exports['removeTeams']=function(_0x54ad04,_0x826b39,_0x1283c6){return db[_0x5c7d('0x67')][_0x5c7d('0x4a')]({'where':{'id':_0x54ad04['query'][_0x5c7d('0x71')]},'attributes':['id'],'include':[{'model':db[_0x5c7d('0x60')],'as':_0x5c7d('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x826b39,null))[_0x5c7d('0x2b')](function(_0x1fd8db){var _0x2f4a65=_[_0x5c7d('0x33')](_0x1fd8db,'id');var _0x3034c4=[];var _0x2e455d=[];var _0x2a5017=squel[_0x5c7d('0x72')]();_0x2a5017[_0x5c7d('0x73')](_0x5c7d('0x74'))[_0x5c7d('0x75')](_0x5c7d('0x76'),'tq')[_0x5c7d('0x77')](_0x5c7d('0x78'),'ut',_0x5c7d('0x79'))['where'](_0x5c7d('0x7a'),_0x54ad04[_0x5c7d('0x4c')]['id']);for(var _0x522ab2=0x0;_0x522ab2<_0x1fd8db[_0x5c7d('0x4d')];_0x522ab2+=0x1){let _0x288e6a=_0x1fd8db[_0x522ab2];for(var _0xa15a48=0x0;_0xa15a48<_0x288e6a[_0x5c7d('0x68')]['length'];_0xa15a48+=0x1){let _0x26808c=_0x288e6a['Agents'][_0xa15a48];var _0xc28569=_0x2a5017['clone']();_0xc28569[_0x5c7d('0x42')](_0x5c7d('0x7b'),_0x26808c['id']);_0x2e455d['push'](db[_0x5c7d('0x6c')][_0x5c7d('0x3b')](_0xc28569[_0x5c7d('0x7c')](),{'type':db[_0x5c7d('0x6c')][_0x5c7d('0x7d')][_0x5c7d('0x7e')]})['then'](function(_0x155d36){if(_0x155d36[_0x5c7d('0x4d')]===0x1){return _0x26808c['id'];}else{var _0x5d8577=_[_0x5c7d('0x7f')](_[_0x5c7d('0x33')](_0x155d36,_0x5c7d('0x80')),function(_0x3a52e0){return _[_0x5c7d('0x81')](_0x2f4a65,_0x3a52e0);});if(_0x5d8577){return _0x26808c['id'];}}}));}}return BPromise['all'](_0x2e455d)['then'](function(_0x158608){_0x3034c4=_(_0x3034c4)[_0x5c7d('0x82')](_0x158608)[_0x5c7d('0x83')]()[_0x5c7d('0x84')]();return db[_0x5c7d('0x34')]['find']({'where':{'id':_0x54ad04[_0x5c7d('0x4c')]['id']}})['then'](function(_0x458c18){return db[_0x5c7d('0x6c')]['transaction'](function(_0x5e8236){return _0x458c18['removeTeams'](_0x54ad04[_0x5c7d('0x3b')]['ids'],{'transaction':_0x5e8236})[_0x5c7d('0x2b')](function(){if(!_['isEmpty'](_0x3034c4)){return _0x458c18[_0x5c7d('0x85')](_0x3034c4,{'transaction':_0x5e8236});}})[_0x5c7d('0x2b')](function(){_0x3034c4[_0x5c7d('0x6f')](function(_0x40500d){socket[_0x5c7d('0x70')](_0x5c7d('0x86'),{'UserId':_0x40500d,'SmsQueueId':_0x458c18['id']});});});});});});})[_0x5c7d('0x2b')](respondWithStatusCode(_0x826b39,null))[_0x5c7d('0x57')](handleError(_0x826b39,null));};exports['addAgents']=function(_0x3987fb,_0xdd4f32,_0x571625){return db[_0x5c7d('0x34')][_0x5c7d('0x54')]({'where':{'id':_0x3987fb['params']['id']}})[_0x5c7d('0x2b')](handleEntityNotFound(_0xdd4f32,null))[_0x5c7d('0x2b')](function(_0x2229ce){if(_0x2229ce){return _0x2229ce[_0x5c7d('0x87')](_0x3987fb[_0x5c7d('0x59')][_0x5c7d('0x71')],_[_0x5c7d('0x88')](_0x3987fb[_0x5c7d('0x59')],['ids','id'])||{})[_0x5c7d('0x89')](function(_0x527e85){for(var _0x2ed2b9=0x0;_0x2ed2b9<_0x3987fb[_0x5c7d('0x59')][_0x5c7d('0x71')][_0x5c7d('0x4d')];_0x2ed2b9+=0x1){socket[_0x5c7d('0x70')](_0x5c7d('0x8a'),{'UserId':Number(_0x3987fb[_0x5c7d('0x59')][_0x5c7d('0x71')][_0x2ed2b9]),'SmsQueueId':Number(_0x3987fb[_0x5c7d('0x4c')]['id'])});}return _0x527e85;});}})['then'](respondWithResult(_0xdd4f32,null))[_0x5c7d('0x57')](handleError(_0xdd4f32,null));};exports[_0x5c7d('0x85')]=function(_0x4b1974,_0x4ebba5,_0x161225){return db[_0x5c7d('0x34')][_0x5c7d('0x54')]({'where':{'id':_0x4b1974['params']['id']}})[_0x5c7d('0x2b')](handleEntityNotFound(_0x4ebba5,null))[_0x5c7d('0x2b')](function(_0x76a79a){if(_0x76a79a){return _0x76a79a[_0x5c7d('0x85')](_0x4b1974[_0x5c7d('0x3b')][_0x5c7d('0x71')])[_0x5c7d('0x2b')](function(){if(_['isArray'](_0x4b1974[_0x5c7d('0x3b')][_0x5c7d('0x71')])){for(var _0x434205=0x0;_0x434205<_0x4b1974[_0x5c7d('0x3b')]['ids']['length'];_0x434205+=0x1){socket[_0x5c7d('0x70')](_0x5c7d('0x86'),{'UserId':Number(_0x4b1974['query'][_0x5c7d('0x71')][_0x434205]),'SmsQueueId':Number(_0x4b1974[_0x5c7d('0x4c')]['id'])});}}else{socket['emit'](_0x5c7d('0x86'),{'UserId':Number(_0x4b1974[_0x5c7d('0x3b')][_0x5c7d('0x71')]),'SmsQueueId':Number(_0x4b1974[_0x5c7d('0x4c')]['id'])});}});}})[_0x5c7d('0x2b')](respondWithStatusCode(_0x4ebba5,null))[_0x5c7d('0x57')](handleError(_0x4ebba5,null));};exports[_0x5c7d('0x8b')]=function(_0x467fdc,_0x5895d9,_0x4efbd5){var _0x328b96={};var _0x5e16d4={};var _0x440338;var _0x545d77;return db[_0x5c7d('0x34')][_0x5c7d('0x5b')]({'where':{'id':_0x467fdc[_0x5c7d('0x4c')]['id']}})[_0x5c7d('0x2b')](handleEntityNotFound(_0x5895d9,null))['then'](function(_0x301cb4){if(_0x301cb4){_0x440338=_0x301cb4;_0x5e16d4['model']=_['keys'](db[_0x5c7d('0x60')][_0x5c7d('0x35')]);_0x5e16d4[_0x5c7d('0x3b')]=_[_0x5c7d('0x39')](_0x467fdc[_0x5c7d('0x3b')]);_0x5e16d4[_0x5c7d('0x5d')]=_[_0x5c7d('0x3a')](_0x5e16d4[_0x5c7d('0x38')],_0x5e16d4[_0x5c7d('0x3b')]);_0x328b96[_0x5c7d('0x3c')]=_[_0x5c7d('0x3a')](_0x5e16d4[_0x5c7d('0x38')],qs[_0x5c7d('0x3d')](_0x467fdc[_0x5c7d('0x3b')][_0x5c7d('0x3d')]));_0x328b96['attributes']=_0x328b96[_0x5c7d('0x3c')][_0x5c7d('0x4d')]?_0x328b96['attributes']:_0x5e16d4['model'];_0x328b96[_0x5c7d('0x40')]=qs[_0x5c7d('0x41')](_0x467fdc[_0x5c7d('0x3b')][_0x5c7d('0x41')]);_0x328b96[_0x5c7d('0x42')]=qs[_0x5c7d('0x5d')](_['pick'](_0x467fdc['query'],_0x5e16d4[_0x5c7d('0x5d')]));if(_0x467fdc[_0x5c7d('0x3b')][_0x5c7d('0x43')]){_0x328b96[_0x5c7d('0x42')]=_['merge'](_0x328b96[_0x5c7d('0x42')],{'$or':_[_0x5c7d('0x33')](_0x328b96[_0x5c7d('0x3c')],function(_0x2449a1){var _0x3117d1={};_0x3117d1[_0x2449a1]={'$like':'%'+_0x467fdc[_0x5c7d('0x3b')][_0x5c7d('0x43')]+'%'};return _0x3117d1;})});}_0x328b96=_[_0x5c7d('0x44')]({},_0x328b96,_0x467fdc[_0x5c7d('0x47')]);return _0x440338[_0x5c7d('0x8b')](_0x328b96);}})['then'](function(_0x2b5e84){if(_0x2b5e84){_0x545d77=_0x2b5e84[_0x5c7d('0x4d')];if(!_0x467fdc[_0x5c7d('0x3b')][_0x5c7d('0x3e')](_0x5c7d('0x3f'))){_0x328b96[_0x5c7d('0x22')]=qs['limit'](_0x467fdc[_0x5c7d('0x3b')][_0x5c7d('0x22')]);_0x328b96[_0x5c7d('0x20')]=qs['offset'](_0x467fdc[_0x5c7d('0x3b')][_0x5c7d('0x20')]);}return _0x440338[_0x5c7d('0x8b')](_0x328b96);}})['then'](function(_0x304c92){if(_0x304c92){return _0x304c92?{'count':_0x545d77,'rows':_0x304c92}:null;}})[_0x5c7d('0x2b')](respondWithResult(_0x5895d9,null))[_0x5c7d('0x57')](handleError(_0x5895d9,null));};
\ No newline at end of file
index a856ddd..43fba92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa487=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x533110,_0x20937f){var _0xc3c866=function(_0x2d4a68){while(--_0x2d4a68){_0x533110['push'](_0x533110['shift']());}};_0xc3c866(++_0x20937f);}(_0xa487,0x98));var _0x7a48=function(_0x2897f6,_0x30b561){_0x2897f6=_0x2897f6-0x0;var _0x520889=_0xa487[_0x2897f6];return _0x520889;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x7a48('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7a48('0x1')](0x0);var events={'afterCreate':_0x7a48('0x2'),'afterUpdate':_0x7a48('0x3'),'afterDestroy':_0x7a48('0x4')};function emitEvent(_0x126ca4){return function(_0x3d9844,_0x33892c,_0xb16ccb){SmsQueueEvents[_0x7a48('0x5')](_0x126ca4+':'+_0x3d9844['id'],_0x3d9844);SmsQueueEvents[_0x7a48('0x5')](_0x126ca4,_0x3d9844);_0xb16ccb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x7a48('0x6')](e,emitEvent(event));}}module[_0x7a48('0x7')]=SmsQueueEvents;
\ No newline at end of file
+var _0xfb0e=['emit','hook','../../mysqldb','SmsQueue','save','update','remove'];(function(_0x1466bd,_0x4a9cb2){var _0x4980b4=function(_0x1f8a10){while(--_0x1f8a10){_0x1466bd['push'](_0x1466bd['shift']());}};_0x4980b4(++_0x4a9cb2);}(_0xfb0e,0x95));var _0xefb0=function(_0x1b4c04,_0x8d961d){_0x1b4c04=_0x1b4c04-0x0;var _0x374f5d=_0xfb0e[_0x1b4c04];return _0x374f5d;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xefb0('0x0'))['db'][_0xefb0('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xefb0('0x2'),'afterUpdate':_0xefb0('0x3'),'afterDestroy':_0xefb0('0x4')};function emitEvent(_0x1db22f){return function(_0x2b59b2,_0x46bdc4,_0x407289){SmsQueueEvents[_0xefb0('0x5')](_0x1db22f+':'+_0x2b59b2['id'],_0x2b59b2);SmsQueueEvents[_0xefb0('0x5')](_0x1db22f,_0x2b59b2);_0x407289(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xefb0('0x6')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index c470b1d..cdf46fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc025=['../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1e0a65,_0x2d31bd){var _0x5c2e15=function(_0x96692){while(--_0x96692){_0x1e0a65['push'](_0x1e0a65['shift']());}};_0x5c2e15(++_0x2d31bd);}(_0xc025,0x1aa));var _0x5c02=function(_0xdaa32b,_0x19c80c){_0xdaa32b=_0xdaa32b-0x0;var _0x54ac5a=_0xc025[_0xdaa32b];return _0x54ac5a;};'use strict';var _=require(_0x5c02('0x0'));var util=require(_0x5c02('0x1'));var logger=require(_0x5c02('0x2'))(_0x5c02('0x3'));var moment=require('moment');var BPromise=require(_0x5c02('0x4'));var rp=require(_0x5c02('0x5'));var fs=require('fs');var path=require(_0x5c02('0x6'));var rimraf=require(_0x5c02('0x7'));var config=require(_0x5c02('0x8'));var attributes=require(_0x5c02('0x9'));module[_0x5c02('0xa')]=function(_0x1594e2,_0x2d9032){return _0x1594e2[_0x5c02('0xb')](_0x5c02('0xc'),attributes,{'tableName':_0x5c02('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7b2=['rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x50aa52,_0x5b07f4){var _0x28d961=function(_0x33ddcd){while(--_0x33ddcd){_0x50aa52['push'](_0x50aa52['shift']());}};_0x28d961(++_0x5b07f4);}(_0xa7b2,0x18f));var _0x2a7b=function(_0x42441c,_0x1a09f0){_0x42441c=_0x42441c-0x0;var _0x4e768d=_0xa7b2[_0x42441c];return _0x4e768d;};'use strict';var _=require(_0x2a7b('0x0'));var util=require(_0x2a7b('0x1'));var logger=require(_0x2a7b('0x2'))('api');var moment=require(_0x2a7b('0x3'));var BPromise=require(_0x2a7b('0x4'));var rp=require(_0x2a7b('0x5'));var fs=require('fs');var path=require(_0x2a7b('0x6'));var rimraf=require(_0x2a7b('0x7'));var config=require(_0x2a7b('0x8'));var attributes=require(_0x2a7b('0x9'));module[_0x2a7b('0xa')]=function(_0x42a5af,_0x2dc259){return _0x42a5af[_0x2a7b('0xb')](_0x2a7b('0xc'),attributes,{'tableName':_0x2a7b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ef38679..a6f9f80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc8b=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetSmsQueue','SmsQueue','options','raw','where','include','map','attributes','model','then','find','ShowSmsQueue'];(function(_0x118d09,_0x306415){var _0x2eab57=function(_0x3faa5a){while(--_0x3faa5a){_0x118d09['push'](_0x118d09['shift']());}};_0x2eab57(++_0x306415);}(_0xdc8b,0xe4));var _0xbdc8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdc8b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xbdc8('0x0'));var moment=require(_0xbdc8('0x1'));var BPromise=require(_0xbdc8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdc8('0x3'))['db'];var utils=require(_0xbdc8('0x4'));var logger=require(_0xbdc8('0x5'))(_0xbdc8('0x6'));var config=require(_0xbdc8('0x7'));var jayson=require(_0xbdc8('0x8'));var client=jayson[_0xbdc8('0x9')][_0xbdc8('0xa')]({'port':0x232a});config[_0xbdc8('0xb')]=_[_0xbdc8('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbdc8('0xd'))(new Redis(config[_0xbdc8('0xb')]));require(_0xbdc8('0xe'))[_0xbdc8('0xf')](socket);function respondWithRpcPromise(_0x4cb042,_0x30893e,_0x212a61){return new BPromise(function(_0x2ab1db,_0x3c0662){return client['request'](_0x4cb042,_0x212a61)['then'](function(_0x36bfa9){logger['info'](_0xbdc8('0x10'),_0x30893e,'request\x20sent');logger[_0xbdc8('0x11')](_0xbdc8('0x12'),_0x30893e,_0xbdc8('0x13'),JSON[_0xbdc8('0x14')](_0x36bfa9));if(_0x36bfa9[_0xbdc8('0x15')]){if(_0x36bfa9['error']['code']===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x30893e,_0x36bfa9[_0xbdc8('0x15')]['message']);return _0x3c0662(_0x36bfa9[_0xbdc8('0x15')][_0xbdc8('0x16')]);}logger[_0xbdc8('0x15')]('SmsQueue,\x20%s,\x20%s',_0x30893e,_0x36bfa9['error'][_0xbdc8('0x16')]);return _0x2ab1db(_0x36bfa9['error'][_0xbdc8('0x16')]);}else{logger[_0xbdc8('0x17')](_0xbdc8('0x10'),_0x30893e,_0xbdc8('0x13'));_0x2ab1db(_0x36bfa9[_0xbdc8('0x18')]['message']);}})[_0xbdc8('0x19')](function(_0x4f76bc){logger[_0xbdc8('0x15')](_0xbdc8('0x10'),_0x30893e,_0x4f76bc);_0x3c0662(_0x4f76bc);});});}exports[_0xbdc8('0x1a')]=function(_0x41244a){var _0x24983e=this;return new Promise(function(_0x5a423e,_0x160298){return db[_0xbdc8('0x1b')]['findAll']({'raw':_0x41244a[_0xbdc8('0x1c')]?_0x41244a[_0xbdc8('0x1c')][_0xbdc8('0x1d')]===undefined?!![]:![]:!![],'where':_0x41244a[_0xbdc8('0x1c')]?_0x41244a[_0xbdc8('0x1c')][_0xbdc8('0x1e')]||null:null,'attributes':_0x41244a['options']?_0x41244a[_0xbdc8('0x1c')]['attributes']||null:null,'limit':_0x41244a[_0xbdc8('0x1c')]?_0x41244a[_0xbdc8('0x1c')]['limit']||null:null,'include':_0x41244a[_0xbdc8('0x1c')]?_0x41244a['options'][_0xbdc8('0x1f')]?_[_0xbdc8('0x20')](_0x41244a[_0xbdc8('0x1c')]['include'],function(_0x55776f){return{'model':db[_0x55776f['model']],'as':_0x55776f['as'],'attributes':_0x55776f[_0xbdc8('0x21')],'include':_0x55776f[_0xbdc8('0x1f')]?_['map'](_0x55776f['include'],function(_0x181f1c){return{'model':db[_0x181f1c[_0xbdc8('0x22')]],'as':_0x181f1c['as'],'attributes':_0x181f1c['attributes'],'include':_0x181f1c[_0xbdc8('0x1f')]?_[_0xbdc8('0x20')](_0x181f1c['include'],function(_0x2af8ed){return{'model':db[_0x2af8ed[_0xbdc8('0x22')]],'as':_0x2af8ed['as'],'attributes':_0x2af8ed[_0xbdc8('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbdc8('0x23')](function(_0x5cc3a9){logger[_0xbdc8('0x17')](_0xbdc8('0x1a'),_0x41244a);logger[_0xbdc8('0x11')](_0xbdc8('0x1a'),_0x41244a,JSON[_0xbdc8('0x14')](_0x5cc3a9));_0x5a423e(_0x5cc3a9);})[_0xbdc8('0x19')](function(_0x44e5e5){logger['error'](_0xbdc8('0x1a'),_0x44e5e5['message'],_0x41244a);_0x160298(_0x24983e['error'](0x1f4,_0x44e5e5[_0xbdc8('0x16')]));});});};exports['ShowSmsQueue']=function(_0x61f297){var _0x251a0f=this;return new Promise(function(_0x2a0683,_0x38aac2){return db[_0xbdc8('0x1b')][_0xbdc8('0x24')]({'raw':_0x61f297[_0xbdc8('0x1c')]?_0x61f297[_0xbdc8('0x1c')][_0xbdc8('0x1d')]===undefined?!![]:![]:!![],'where':_0x61f297['options']?_0x61f297[_0xbdc8('0x1c')][_0xbdc8('0x1e')]||null:null,'attributes':_0x61f297[_0xbdc8('0x1c')]?_0x61f297['options'][_0xbdc8('0x21')]||null:null,'include':_0x61f297[_0xbdc8('0x1c')]?_0x61f297[_0xbdc8('0x1c')]['include']?_[_0xbdc8('0x20')](_0x61f297[_0xbdc8('0x1c')]['include'],function(_0x5d984c){return{'model':db[_0x5d984c[_0xbdc8('0x22')]],'as':_0x5d984c['as'],'attributes':_0x5d984c[_0xbdc8('0x21')],'include':_0x5d984c[_0xbdc8('0x1f')]?_[_0xbdc8('0x20')](_0x5d984c[_0xbdc8('0x1f')],function(_0x1bcd19){return{'model':db[_0x1bcd19[_0xbdc8('0x22')]],'as':_0x1bcd19['as'],'attributes':_0x1bcd19[_0xbdc8('0x21')],'include':_0x1bcd19['include']?_['map'](_0x1bcd19[_0xbdc8('0x1f')],function(_0x2a5d83){return{'model':db[_0x2a5d83[_0xbdc8('0x22')]],'as':_0x2a5d83['as'],'attributes':_0x2a5d83[_0xbdc8('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b8c4a){logger['info']('ShowSmsQueue',_0x61f297);logger[_0xbdc8('0x11')](_0xbdc8('0x25'),_0x61f297,JSON[_0xbdc8('0x14')](_0x5b8c4a));_0x2a0683(_0x5b8c4a);})[_0xbdc8('0x19')](function(_0x4c2c6a){logger['error'](_0xbdc8('0x25'),_0x4c2c6a[_0xbdc8('0x16')],_0x61f297);_0x38aac2(_0x251a0f['error'](0x1f4,_0x4c2c6a[_0xbdc8('0x16')]));});});};
\ No newline at end of file
+var _0x52f5=['request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','findAll','options','raw','where','attributes','include','map','model','ShowSmsQueue','SmsQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4b5db8,_0x30c203){var _0x3f4df4=function(_0x10f36b){while(--_0x10f36b){_0x4b5db8['push'](_0x4b5db8['shift']());}};_0x3f4df4(++_0x30c203);}(_0x52f5,0x1a3));var _0x552f=function(_0x133117,_0x3bee77){_0x133117=_0x133117-0x0;var _0x4c3f37=_0x52f5[_0x133117];return _0x4c3f37;};'use strict';var _=require(_0x552f('0x0'));var util=require(_0x552f('0x1'));var moment=require(_0x552f('0x2'));var BPromise=require(_0x552f('0x3'));var rs=require(_0x552f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x552f('0x5'))['db'];var utils=require(_0x552f('0x6'));var logger=require('../../config/logger')(_0x552f('0x7'));var config=require(_0x552f('0x8'));var jayson=require(_0x552f('0x9'));var client=jayson[_0x552f('0xa')]['http']({'port':0x232a});config[_0x552f('0xb')]=_[_0x552f('0xc')](config[_0x552f('0xb')],{'host':_0x552f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x552f('0xb')]));require('./smsQueue.socket')[_0x552f('0xe')](socket);function respondWithRpcPromise(_0x1ca5f3,_0x1fc9be,_0x262fc5){return new BPromise(function(_0x5652c7,_0x51b39b){return client[_0x552f('0xf')](_0x1ca5f3,_0x262fc5)[_0x552f('0x10')](function(_0x26e0dc){logger[_0x552f('0x11')](_0x552f('0x12'),_0x1fc9be,'request\x20sent');logger[_0x552f('0x13')](_0x552f('0x14'),_0x1fc9be,_0x552f('0x15'),JSON[_0x552f('0x16')](_0x26e0dc));if(_0x26e0dc[_0x552f('0x17')]){if(_0x26e0dc[_0x552f('0x17')][_0x552f('0x18')]===0x1f4){logger[_0x552f('0x17')](_0x552f('0x12'),_0x1fc9be,_0x26e0dc[_0x552f('0x17')][_0x552f('0x19')]);return _0x51b39b(_0x26e0dc[_0x552f('0x17')][_0x552f('0x19')]);}logger[_0x552f('0x17')]('SmsQueue,\x20%s,\x20%s',_0x1fc9be,_0x26e0dc[_0x552f('0x17')]['message']);return _0x5652c7(_0x26e0dc['error'][_0x552f('0x19')]);}else{logger[_0x552f('0x11')](_0x552f('0x12'),_0x1fc9be,_0x552f('0x15'));_0x5652c7(_0x26e0dc[_0x552f('0x1a')][_0x552f('0x19')]);}})[_0x552f('0x1b')](function(_0x579931){logger[_0x552f('0x17')](_0x552f('0x12'),_0x1fc9be,_0x579931);_0x51b39b(_0x579931);});});}exports[_0x552f('0x1c')]=function(_0x19448d){var _0x21bfa4=this;return new Promise(function(_0xdaed1a,_0x424b9c){return db['SmsQueue'][_0x552f('0x1d')]({'raw':_0x19448d[_0x552f('0x1e')]?_0x19448d[_0x552f('0x1e')][_0x552f('0x1f')]===undefined?!![]:![]:!![],'where':_0x19448d[_0x552f('0x1e')]?_0x19448d[_0x552f('0x1e')][_0x552f('0x20')]||null:null,'attributes':_0x19448d[_0x552f('0x1e')]?_0x19448d[_0x552f('0x1e')][_0x552f('0x21')]||null:null,'limit':_0x19448d['options']?_0x19448d[_0x552f('0x1e')]['limit']||null:null,'include':_0x19448d[_0x552f('0x1e')]?_0x19448d['options'][_0x552f('0x22')]?_[_0x552f('0x23')](_0x19448d['options']['include'],function(_0x1f2465){return{'model':db[_0x1f2465[_0x552f('0x24')]],'as':_0x1f2465['as'],'attributes':_0x1f2465[_0x552f('0x21')],'include':_0x1f2465[_0x552f('0x22')]?_[_0x552f('0x23')](_0x1f2465[_0x552f('0x22')],function(_0x3768ef){return{'model':db[_0x3768ef[_0x552f('0x24')]],'as':_0x3768ef['as'],'attributes':_0x3768ef[_0x552f('0x21')],'include':_0x3768ef['include']?_['map'](_0x3768ef[_0x552f('0x22')],function(_0x355f67){return{'model':db[_0x355f67[_0x552f('0x24')]],'as':_0x355f67['as'],'attributes':_0x355f67[_0x552f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x552f('0x10')](function(_0x24ab3b){logger[_0x552f('0x11')]('GetSmsQueue',_0x19448d);logger[_0x552f('0x13')](_0x552f('0x1c'),_0x19448d,JSON[_0x552f('0x16')](_0x24ab3b));_0xdaed1a(_0x24ab3b);})['catch'](function(_0x2d2d5a){logger[_0x552f('0x17')](_0x552f('0x1c'),_0x2d2d5a['message'],_0x19448d);_0x424b9c(_0x21bfa4['error'](0x1f4,_0x2d2d5a[_0x552f('0x19')]));});});};exports[_0x552f('0x25')]=function(_0x331a52){var _0x434e9a=this;return new Promise(function(_0x38adcd,_0xebbe40){return db[_0x552f('0x26')][_0x552f('0x27')]({'raw':_0x331a52['options']?_0x331a52['options']['raw']===undefined?!![]:![]:!![],'where':_0x331a52[_0x552f('0x1e')]?_0x331a52['options'][_0x552f('0x20')]||null:null,'attributes':_0x331a52[_0x552f('0x1e')]?_0x331a52[_0x552f('0x1e')][_0x552f('0x21')]||null:null,'include':_0x331a52[_0x552f('0x1e')]?_0x331a52[_0x552f('0x1e')][_0x552f('0x22')]?_['map'](_0x331a52[_0x552f('0x1e')][_0x552f('0x22')],function(_0x83cf34){return{'model':db[_0x83cf34[_0x552f('0x24')]],'as':_0x83cf34['as'],'attributes':_0x83cf34[_0x552f('0x21')],'include':_0x83cf34[_0x552f('0x22')]?_[_0x552f('0x23')](_0x83cf34[_0x552f('0x22')],function(_0x1741bb){return{'model':db[_0x1741bb[_0x552f('0x24')]],'as':_0x1741bb['as'],'attributes':_0x1741bb[_0x552f('0x21')],'include':_0x1741bb[_0x552f('0x22')]?_['map'](_0x1741bb[_0x552f('0x22')],function(_0x3da5c0){return{'model':db[_0x3da5c0[_0x552f('0x24')]],'as':_0x3da5c0['as'],'attributes':_0x3da5c0[_0x552f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x552f('0x10')](function(_0x2021f7){logger[_0x552f('0x11')](_0x552f('0x25'),_0x331a52);logger[_0x552f('0x13')](_0x552f('0x25'),_0x331a52,JSON[_0x552f('0x16')](_0x2021f7));_0x38adcd(_0x2021f7);})[_0x552f('0x1b')](function(_0xfa4019){logger[_0x552f('0x17')](_0x552f('0x25'),_0xfa4019[_0x552f('0x19')],_0x331a52);_0xebbe40(_0x434e9a['error'](0x1f4,_0xfa4019[_0x552f('0x19')]));});});};
\ No newline at end of file
index 6c0fd72..9b3fe4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f9b=['smsQueue:','save','remove','update','emit','removeListener'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8f9b,0x18d));var _0xb8f9=function(_0x373106,_0x11d427){_0x373106=_0x373106-0x0;var _0x371e70=_0x8f9b[_0x373106];return _0x371e70;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xb8f9('0x0'),_0xb8f9('0x1'),_0xb8f9('0x2')];function createListener(_0x41a699,_0x50e22d){return function(_0x465fbe){_0x50e22d[_0xb8f9('0x3')](_0x41a699,_0x465fbe);};}function removeListener(_0x101111,_0x1ac70e){return function(){SmsQueueEvents[_0xb8f9('0x4')](_0x101111,_0x1ac70e);};}exports['register']=function(_0x4eef81){for(var _0xe8446c=0x0,_0x186a2c=events['length'];_0xe8446c<_0x186a2c;_0xe8446c++){var _0x56eeb7=events[_0xe8446c];var _0x3e7ed4=createListener(_0xb8f9('0x5')+_0x56eeb7,_0x4eef81);SmsQueueEvents['on'](_0x56eeb7,_0x3e7ed4);}};
\ No newline at end of file
+var _0x36b0=['update','emit','removeListener','register','length','./smsQueue.events','save','remove'];(function(_0x1baeda,_0x11e55e){var _0x56da0a=function(_0xf4e788){while(--_0xf4e788){_0x1baeda['push'](_0x1baeda['shift']());}};_0x56da0a(++_0x11e55e);}(_0x36b0,0x75));var _0x036b=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x36b0[_0x4243a3];return _0x1b2a33;};'use strict';var SmsQueueEvents=require(_0x036b('0x0'));var events=[_0x036b('0x1'),_0x036b('0x2'),_0x036b('0x3')];function createListener(_0x28408c,_0x5b0edb){return function(_0xa306e6){_0x5b0edb[_0x036b('0x4')](_0x28408c,_0xa306e6);};}function removeListener(_0x2fcccf,_0x4fa349){return function(){SmsQueueEvents[_0x036b('0x5')](_0x2fcccf,_0x4fa349);};}exports[_0x036b('0x6')]=function(_0x3a6e2d){for(var _0xc9726c=0x0,_0x480305=events[_0x036b('0x7')];_0xc9726c<_0x480305;_0xc9726c++){var _0x25038b=events[_0xc9726c];var _0x14c27a=createListener('smsQueue:'+_0x25038b,_0x3a6e2d);SmsQueueEvents['on'](_0x25038b,_0x14c27a);}};
\ No newline at end of file
index 90dbd19..c408022 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0b0=['create','update','delete','/:id','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post'];(function(_0x443b14,_0xc61eed){var _0x211471=function(_0x4a98cd){while(--_0x4a98cd){_0x443b14['push'](_0x443b14['shift']());}};_0x211471(++_0xc61eed);}(_0xb0b0,0x196));var _0x0b0b=function(_0xac8055,_0x5ababb){_0xac8055=_0xac8055-0x0;var _0x2d5608=_0xb0b0[_0xac8055];return _0x2d5608;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0b0b('0x0'));var timeout=require(_0x0b0b('0x1'));var express=require(_0x0b0b('0x2'));var router=express[_0x0b0b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0b0b('0x4'));var interaction=require(_0x0b0b('0x5'));var config=require(_0x0b0b('0x6'));var controller=require('./smsQueueReport.controller');router[_0x0b0b('0x7')]('/',auth['isAuthenticated'](),controller[_0x0b0b('0x8')]);router[_0x0b0b('0x7')](_0x0b0b('0x9'),auth[_0x0b0b('0xa')](),controller[_0x0b0b('0xb')]);router[_0x0b0b('0x7')]('/:id',auth[_0x0b0b('0xa')](),controller[_0x0b0b('0xc')]);router[_0x0b0b('0xd')]('/',auth[_0x0b0b('0xa')](),controller[_0x0b0b('0xe')]);router['put']('/:id',auth[_0x0b0b('0xa')](),controller[_0x0b0b('0xf')]);router[_0x0b0b('0x10')](_0x0b0b('0x11'),auth[_0x0b0b('0xa')](),controller[_0x0b0b('0x12')]);module[_0x0b0b('0x13')]=router;
\ No newline at end of file
+var _0x961e=['isAuthenticated','/describe','describe','/:id','post','put','update','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get'];(function(_0x261999,_0x15f7e8){var _0x109e04=function(_0x4c8e93){while(--_0x4c8e93){_0x261999['push'](_0x261999['shift']());}};_0x109e04(++_0x15f7e8);}(_0x961e,0x1a8));var _0xe961=function(_0xfa9b67,_0x2699b9){_0xfa9b67=_0xfa9b67-0x0;var _0x369022=_0x961e[_0xfa9b67];return _0x369022;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe961('0x0'));var timeout=require(_0xe961('0x1'));var express=require(_0xe961('0x2'));var router=express[_0xe961('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe961('0x4'));var config=require(_0xe961('0x5'));var controller=require(_0xe961('0x6'));router[_0xe961('0x7')]('/',auth[_0xe961('0x8')](),controller['index']);router[_0xe961('0x7')](_0xe961('0x9'),auth['isAuthenticated'](),controller[_0xe961('0xa')]);router[_0xe961('0x7')](_0xe961('0xb'),auth[_0xe961('0x8')](),controller['show']);router[_0xe961('0xc')]('/',auth[_0xe961('0x8')](),controller['create']);router[_0xe961('0xd')](_0xe961('0xb'),auth['isAuthenticated'](),controller[_0xe961('0xe')]);router['delete'](_0xe961('0xb'),auth[_0xe961('0x8')](),controller['destroy']);module[_0xe961('0xf')]=router;
\ No newline at end of file
index 5bf78bc..76cc2ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x885b=['DATE','moment','sequelize','exports','STRING'];(function(_0x3338e4,_0x2bb99e){var _0x3dc376=function(_0x3d475a){while(--_0x3d475a){_0x3338e4['push'](_0x3338e4['shift']());}};_0x3dc376(++_0x2bb99e);}(_0x885b,0x6a));var _0xb885=function(_0x545817,_0x455721){_0x545817=_0x545817-0x0;var _0x537306=_0x885b[_0x545817];return _0x537306;};'use strict';var moment=require(_0xb885('0x0'));var Sequelize=require(_0xb885('0x1'));module[_0xb885('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb885('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb885('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb885('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa209=['exports','STRING','DATE','moment','sequelize'];(function(_0x4df87b,_0x3a15bf){var _0x193aaa=function(_0x466cd4){while(--_0x466cd4){_0x4df87b['push'](_0x4df87b['shift']());}};_0x193aaa(++_0x3a15bf);}(_0xa209,0x1bb));var _0x9a20=function(_0x4595a1,_0x210b23){_0x4595a1=_0x4595a1-0x0;var _0x58a57d=_0xa209[_0x4595a1];return _0x58a57d;};'use strict';var moment=require(_0x9a20('0x0'));var Sequelize=require(_0x9a20('0x1'));module[_0x9a20('0x2')]={'uniqueid':{'type':Sequelize[_0x9a20('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9a20('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9a20('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9a20('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ce89631..3d2df6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x362e=['send','index','fieldName','type','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SmsQueueReport','includeAll','include','rows','catch','show','params','rawAttributes','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','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x362e,0x1ac));var _0xe362=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x362e[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0xe362('0x0'));var rimraf=require(_0xe362('0x1'));var zipdir=require(_0xe362('0x2'));var jsonpatch=require(_0xe362('0x3'));var rp=require(_0xe362('0x4'));var moment=require(_0xe362('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe362('0x6'));var util=require('util');var path=require(_0xe362('0x7'));var sox=require(_0xe362('0x8'));var csv=require(_0xe362('0x9'));var ejs=require(_0xe362('0xa'));var fs=require('fs');var fs_extra=require(_0xe362('0xb'));var _=require(_0xe362('0xc'));var squel=require(_0xe362('0xd'));var crypto=require(_0xe362('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe362('0xf'));var toCsv=require(_0xe362('0x9'));var querystring=require(_0xe362('0x10'));var Papa=require(_0xe362('0x11'));var Redis=require(_0xe362('0x12'));var authService=require(_0xe362('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe362('0x14'));var hardwareService=require(_0xe362('0x15'));var logger=require(_0xe362('0x16'))(_0xe362('0x17'));var utils=require('../../config/utils');var config=require(_0xe362('0x18'));var licenseUtil=require(_0xe362('0x19'));var db=require(_0xe362('0x1a'))['db'];function respondWithStatusCode(_0x45af7a,_0x3ccd85){_0x3ccd85=_0x3ccd85||0xcc;return function(_0x9602b){if(_0x9602b){return _0x45af7a[_0xe362('0x1b')](_0x3ccd85);}return _0x45af7a[_0xe362('0x1c')](_0x3ccd85)[_0xe362('0x1d')]();};}function respondWithResult(_0x2faa48,_0x32c6bf){_0x32c6bf=_0x32c6bf||0xc8;return function(_0x55523c){if(_0x55523c){return _0x2faa48['status'](_0x32c6bf)[_0xe362('0x1e')](_0x55523c);}};}function respondWithFilteredResult(_0x3daffb,_0x1d6558){return function(_0x1cab38){if(_0x1cab38){var _0x3644cb=typeof _0x1d6558[_0xe362('0x1f')]==='undefined'&&typeof _0x1d6558[_0xe362('0x20')]===_0xe362('0x21');var _0x505913=_0x1cab38[_0xe362('0x22')];var _0x35344d=_0x3644cb?0x0:_0x1d6558[_0xe362('0x1f')];var _0x4fe8dd=_0x3644cb?_0x1cab38['count']:_0x1d6558[_0xe362('0x1f')]+_0x1d6558[_0xe362('0x20')];var _0x41b6b7;if(_0x4fe8dd>=_0x505913){_0x4fe8dd=_0x505913;_0x41b6b7=0xc8;}else{_0x41b6b7=0xce;}_0x3daffb[_0xe362('0x1c')](_0x41b6b7);return _0x3daffb[_0xe362('0x23')](_0xe362('0x24'),_0x35344d+'-'+_0x4fe8dd+'/'+_0x505913)[_0xe362('0x1e')](_0x1cab38);}return null;};}function patchUpdates(_0x829217){return function(_0x92acc0){try{jsonpatch[_0xe362('0x25')](_0x92acc0,_0x829217,!![]);}catch(_0x43fc39){return BPromise[_0xe362('0x26')](_0x43fc39);}return _0x92acc0[_0xe362('0x27')]();};}function saveUpdates(_0x5b3396,_0x10d97f){return function(_0x526e35){if(_0x526e35){return _0x526e35[_0xe362('0x28')](_0x5b3396)[_0xe362('0x29')](function(_0x251181){return _0x251181;});}return null;};}function removeEntity(_0x173a35,_0x5b25e9){return function(_0x114f77){if(_0x114f77){return _0x114f77[_0xe362('0x2a')]()[_0xe362('0x29')](function(){_0x173a35[_0xe362('0x1c')](0xcc)[_0xe362('0x1d')]();});}};}function handleEntityNotFound(_0x547a26,_0x523cd3){return function(_0xe3bf35){if(!_0xe3bf35){_0x547a26['sendStatus'](0x194);}return _0xe3bf35;};}function handleError(_0x21948f,_0x57ff28){_0x57ff28=_0x57ff28||0x1f4;return function(_0x2ae68d){logger[_0xe362('0x2b')](_0x2ae68d[_0xe362('0x2c')]);if(_0x2ae68d[_0xe362('0x2d')]){delete _0x2ae68d[_0xe362('0x2d')];}_0x21948f[_0xe362('0x1c')](_0x57ff28)[_0xe362('0x2e')](_0x2ae68d);};}exports[_0xe362('0x2f')]=function(_0x2ee1ec,_0x4b2d67){var _0x5af708={},_0x14025d={},_0x31482d={'count':0x0,'rows':[]};var _0x38a4fd=_['map'](db['SmsQueueReport']['rawAttributes'],function(_0x5c715e){return{'name':_0x5c715e[_0xe362('0x30')],'type':_0x5c715e[_0xe362('0x31')]['key']};});_0x14025d['model']=_[_0xe362('0x32')](_0x38a4fd,_0xe362('0x2d'));_0x14025d[_0xe362('0x33')]=_[_0xe362('0x34')](_0x2ee1ec[_0xe362('0x33')]);_0x14025d[_0xe362('0x35')]=_['intersection'](_0x14025d[_0xe362('0x36')],_0x14025d[_0xe362('0x33')]);_0x5af708['attributes']=_[_0xe362('0x37')](_0x14025d['model'],qs['fields'](_0x2ee1ec[_0xe362('0x33')][_0xe362('0x38')]));_0x5af708[_0xe362('0x39')]=_0x5af708[_0xe362('0x39')][_0xe362('0x3a')]?_0x5af708[_0xe362('0x39')]:_0x14025d[_0xe362('0x36')];if(!_0x2ee1ec[_0xe362('0x33')][_0xe362('0x3b')](_0xe362('0x3c'))){_0x5af708['limit']=qs['limit'](_0x2ee1ec[_0xe362('0x33')][_0xe362('0x20')]);_0x5af708[_0xe362('0x1f')]=qs['offset'](_0x2ee1ec[_0xe362('0x33')][_0xe362('0x1f')]);}_0x5af708['order']=qs[_0xe362('0x3d')](_0x2ee1ec['query']['sort']);_0x5af708[_0xe362('0x3e')]=qs[_0xe362('0x35')](_[_0xe362('0x3f')](_0x2ee1ec[_0xe362('0x33')],_0x14025d[_0xe362('0x35')]),_0x38a4fd);if(_0x2ee1ec[_0xe362('0x33')][_0xe362('0x40')]){_0x5af708[_0xe362('0x3e')]=_[_0xe362('0x41')](_0x5af708['where'],{'$or':_[_0xe362('0x32')](_0x38a4fd,function(_0xbf29f1){if(_0xbf29f1['type']!==_0xe362('0x42')){var _0x742331={};_0x742331[_0xbf29f1['name']]={'$like':'%'+_0x2ee1ec[_0xe362('0x33')][_0xe362('0x40')]+'%'};return _0x742331;}})});}_0x5af708=_[_0xe362('0x41')]({},_0x5af708,_0x2ee1ec[_0xe362('0x43')]);var _0x265a32={'where':_0x5af708[_0xe362('0x3e')]};return db[_0xe362('0x44')][_0xe362('0x22')](_0x265a32)['then'](function(_0x393e07){_0x31482d[_0xe362('0x22')]=_0x393e07;if(_0x2ee1ec['query'][_0xe362('0x45')]){_0x5af708[_0xe362('0x46')]=[{'all':!![]}];}return db[_0xe362('0x44')]['findAll'](_0x5af708);})['then'](function(_0x4a4903){_0x31482d[_0xe362('0x47')]=_0x4a4903;return _0x31482d;})[_0xe362('0x29')](respondWithFilteredResult(_0x4b2d67,_0x5af708))[_0xe362('0x48')](handleError(_0x4b2d67,null));};exports[_0xe362('0x49')]=function(_0x53687d,_0x212359){var _0x4f4160={'raw':!![],'where':{'id':_0x53687d[_0xe362('0x4a')]['id']}},_0x4dcff4={};_0x4dcff4['model']=_[_0xe362('0x34')](db[_0xe362('0x44')][_0xe362('0x4b')]);_0x4dcff4[_0xe362('0x33')]=_[_0xe362('0x34')](_0x53687d[_0xe362('0x33')]);_0x4dcff4[_0xe362('0x35')]=_[_0xe362('0x37')](_0x4dcff4['model'],_0x4dcff4[_0xe362('0x33')]);_0x4f4160['attributes']=_[_0xe362('0x37')](_0x4dcff4['model'],qs[_0xe362('0x38')](_0x53687d['query'][_0xe362('0x38')]));_0x4f4160['attributes']=_0x4f4160['attributes'][_0xe362('0x3a')]?_0x4f4160[_0xe362('0x39')]:_0x4dcff4[_0xe362('0x36')];if(_0x53687d[_0xe362('0x33')][_0xe362('0x45')]){_0x4f4160[_0xe362('0x46')]=[{'all':!![]}];}_0x4f4160=_[_0xe362('0x41')]({},_0x4f4160,_0x53687d[_0xe362('0x43')]);return db['SmsQueueReport']['find'](_0x4f4160)['then'](handleEntityNotFound(_0x212359,null))[_0xe362('0x29')](respondWithResult(_0x212359,null))['catch'](handleError(_0x212359,null));};exports['create']=function(_0x1c8c6d,_0x3612b4){return db[_0xe362('0x44')]['create'](_0x1c8c6d[_0xe362('0x4c')],{})['then'](respondWithResult(_0x3612b4,0xc9))[_0xe362('0x48')](handleError(_0x3612b4,null));};exports[_0xe362('0x28')]=function(_0x21ce8a,_0xa6a8c5){if(_0x21ce8a[_0xe362('0x4c')]['id']){delete _0x21ce8a['body']['id'];}return db[_0xe362('0x44')]['find']({'where':{'id':_0x21ce8a[_0xe362('0x4a')]['id']}})[_0xe362('0x29')](handleEntityNotFound(_0xa6a8c5,null))[_0xe362('0x29')](saveUpdates(_0x21ce8a[_0xe362('0x4c')],null))[_0xe362('0x29')](respondWithResult(_0xa6a8c5,null))[_0xe362('0x48')](handleError(_0xa6a8c5,null));};exports['destroy']=function(_0x3034ad,_0x2c0364){return db[_0xe362('0x44')][_0xe362('0x4d')]({'where':{'id':_0x3034ad[_0xe362('0x4a')]['id']}})[_0xe362('0x29')](handleEntityNotFound(_0x2c0364,null))[_0xe362('0x29')](removeEntity(_0x2c0364,null))[_0xe362('0x48')](handleError(_0x2c0364,null));};exports[_0xe362('0x4e')]=function(_0x57a14f,_0x240da7){return db[_0xe362('0x44')][_0xe362('0x4e')]()[_0xe362('0x29')](respondWithResult(_0x240da7,null))[_0xe362('0x48')](handleError(_0x240da7,null));};
\ No newline at end of file
+var _0x684f=['params','include','options','find','create','body','catch','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SmsQueueReport','includeAll','findAll','rows'];(function(_0x245a7c,_0x7e4605){var _0x39365d=function(_0x3bebf8){while(--_0x3bebf8){_0x245a7c['push'](_0x245a7c['shift']());}};_0x39365d(++_0x7e4605);}(_0x684f,0x134));var _0xf684=function(_0x263418,_0x2555a9){_0x263418=_0x263418-0x0;var _0x2a66c4=_0x684f[_0x263418];return _0x2a66c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf684('0x0'));var jsonpatch=require(_0xf684('0x1'));var rp=require(_0xf684('0x2'));var moment=require(_0xf684('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf684('0x4'));var util=require(_0xf684('0x5'));var path=require(_0xf684('0x6'));var sox=require(_0xf684('0x7'));var csv=require(_0xf684('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf684('0x9'));var _=require(_0xf684('0xa'));var squel=require(_0xf684('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf684('0xc'));var Papa=require(_0xf684('0xd'));var Redis=require('ioredis');var authService=require(_0xf684('0xe'));var qs=require(_0xf684('0xf'));var as=require(_0xf684('0x10'));var hardwareService=require(_0xf684('0x11'));var logger=require(_0xf684('0x12'))(_0xf684('0x13'));var utils=require(_0xf684('0x14'));var config=require(_0xf684('0x15'));var licenseUtil=require(_0xf684('0x16'));var db=require(_0xf684('0x17'))['db'];function respondWithStatusCode(_0x40d405,_0x30c2a5){_0x30c2a5=_0x30c2a5||0xcc;return function(_0x471366){if(_0x471366){return _0x40d405['sendStatus'](_0x30c2a5);}return _0x40d405[_0xf684('0x18')](_0x30c2a5)[_0xf684('0x19')]();};}function respondWithResult(_0x1ea9a7,_0x32d203){_0x32d203=_0x32d203||0xc8;return function(_0x298b8f){if(_0x298b8f){return _0x1ea9a7[_0xf684('0x18')](_0x32d203)[_0xf684('0x1a')](_0x298b8f);}};}function respondWithFilteredResult(_0x38ef1a,_0x905897){return function(_0x49cdb6){if(_0x49cdb6){var _0x507894=typeof _0x905897[_0xf684('0x1b')]===_0xf684('0x1c')&&typeof _0x905897[_0xf684('0x1d')]===_0xf684('0x1c');var _0x24aa53=_0x49cdb6[_0xf684('0x1e')];var _0x144b56=_0x507894?0x0:_0x905897[_0xf684('0x1b')];var _0x4be72f=_0x507894?_0x49cdb6[_0xf684('0x1e')]:_0x905897[_0xf684('0x1b')]+_0x905897[_0xf684('0x1d')];var _0x36ad87;if(_0x4be72f>=_0x24aa53){_0x4be72f=_0x24aa53;_0x36ad87=0xc8;}else{_0x36ad87=0xce;}_0x38ef1a[_0xf684('0x18')](_0x36ad87);return _0x38ef1a[_0xf684('0x1f')](_0xf684('0x20'),_0x144b56+'-'+_0x4be72f+'/'+_0x24aa53)[_0xf684('0x1a')](_0x49cdb6);}return null;};}function patchUpdates(_0x117a05){return function(_0x5d451d){try{jsonpatch['apply'](_0x5d451d,_0x117a05,!![]);}catch(_0x29a340){return BPromise[_0xf684('0x21')](_0x29a340);}return _0x5d451d['save']();};}function saveUpdates(_0x534c04,_0x58ec3c){return function(_0x2963df){if(_0x2963df){return _0x2963df[_0xf684('0x22')](_0x534c04)[_0xf684('0x23')](function(_0x281b3d){return _0x281b3d;});}return null;};}function removeEntity(_0x145a85,_0x38cc69){return function(_0x20bf55){if(_0x20bf55){return _0x20bf55[_0xf684('0x24')]()['then'](function(){_0x145a85[_0xf684('0x18')](0xcc)[_0xf684('0x19')]();});}};}function handleEntityNotFound(_0x2120ab,_0xeeb63c){return function(_0x5b03fa){if(!_0x5b03fa){_0x2120ab['sendStatus'](0x194);}return _0x5b03fa;};}function handleError(_0x3bb24e,_0x5d3be8){_0x5d3be8=_0x5d3be8||0x1f4;return function(_0x56dad6){logger[_0xf684('0x25')](_0x56dad6[_0xf684('0x26')]);if(_0x56dad6[_0xf684('0x27')]){delete _0x56dad6[_0xf684('0x27')];}_0x3bb24e['status'](_0x5d3be8)[_0xf684('0x28')](_0x56dad6);};}exports[_0xf684('0x29')]=function(_0x357940,_0x41075f){var _0xbcc520={},_0x4afa70={},_0x1f7eac={'count':0x0,'rows':[]};var _0x910fd9=_[_0xf684('0x2a')](db['SmsQueueReport'][_0xf684('0x2b')],function(_0x4a4c02){return{'name':_0x4a4c02[_0xf684('0x2c')],'type':_0x4a4c02[_0xf684('0x2d')][_0xf684('0x2e')]};});_0x4afa70['model']=_[_0xf684('0x2a')](_0x910fd9,'name');_0x4afa70[_0xf684('0x2f')]=_[_0xf684('0x30')](_0x357940[_0xf684('0x2f')]);_0x4afa70[_0xf684('0x31')]=_[_0xf684('0x32')](_0x4afa70[_0xf684('0x33')],_0x4afa70[_0xf684('0x2f')]);_0xbcc520[_0xf684('0x34')]=_[_0xf684('0x32')](_0x4afa70[_0xf684('0x33')],qs[_0xf684('0x35')](_0x357940[_0xf684('0x2f')]['fields']));_0xbcc520[_0xf684('0x34')]=_0xbcc520[_0xf684('0x34')][_0xf684('0x36')]?_0xbcc520[_0xf684('0x34')]:_0x4afa70[_0xf684('0x33')];if(!_0x357940[_0xf684('0x2f')]['hasOwnProperty'](_0xf684('0x37'))){_0xbcc520[_0xf684('0x1d')]=qs['limit'](_0x357940[_0xf684('0x2f')][_0xf684('0x1d')]);_0xbcc520[_0xf684('0x1b')]=qs[_0xf684('0x1b')](_0x357940[_0xf684('0x2f')][_0xf684('0x1b')]);}_0xbcc520[_0xf684('0x38')]=qs[_0xf684('0x39')](_0x357940[_0xf684('0x2f')][_0xf684('0x39')]);_0xbcc520[_0xf684('0x3a')]=qs[_0xf684('0x31')](_[_0xf684('0x3b')](_0x357940['query'],_0x4afa70[_0xf684('0x31')]),_0x910fd9);if(_0x357940[_0xf684('0x2f')][_0xf684('0x3c')]){_0xbcc520[_0xf684('0x3a')]=_[_0xf684('0x3d')](_0xbcc520['where'],{'$or':_[_0xf684('0x2a')](_0x910fd9,function(_0x3357c5){if(_0x3357c5['type']!==_0xf684('0x3e')){var _0x12070c={};_0x12070c[_0x3357c5['name']]={'$like':'%'+_0x357940[_0xf684('0x2f')][_0xf684('0x3c')]+'%'};return _0x12070c;}})});}_0xbcc520=_['merge']({},_0xbcc520,_0x357940['options']);var _0x514ec8={'where':_0xbcc520[_0xf684('0x3a')]};return db[_0xf684('0x3f')][_0xf684('0x1e')](_0x514ec8)[_0xf684('0x23')](function(_0x5fe119){_0x1f7eac[_0xf684('0x1e')]=_0x5fe119;if(_0x357940['query'][_0xf684('0x40')]){_0xbcc520['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0xf684('0x41')](_0xbcc520);})['then'](function(_0x49cbd2){_0x1f7eac[_0xf684('0x42')]=_0x49cbd2;return _0x1f7eac;})[_0xf684('0x23')](respondWithFilteredResult(_0x41075f,_0xbcc520))['catch'](handleError(_0x41075f,null));};exports['show']=function(_0x4b4a6d,_0x306567){var _0x23251f={'raw':!![],'where':{'id':_0x4b4a6d[_0xf684('0x43')]['id']}},_0x438ff0={};_0x438ff0[_0xf684('0x33')]=_['keys'](db['SmsQueueReport']['rawAttributes']);_0x438ff0[_0xf684('0x2f')]=_[_0xf684('0x30')](_0x4b4a6d[_0xf684('0x2f')]);_0x438ff0[_0xf684('0x31')]=_[_0xf684('0x32')](_0x438ff0['model'],_0x438ff0['query']);_0x23251f[_0xf684('0x34')]=_[_0xf684('0x32')](_0x438ff0['model'],qs[_0xf684('0x35')](_0x4b4a6d[_0xf684('0x2f')][_0xf684('0x35')]));_0x23251f[_0xf684('0x34')]=_0x23251f['attributes'][_0xf684('0x36')]?_0x23251f['attributes']:_0x438ff0[_0xf684('0x33')];if(_0x4b4a6d['query'][_0xf684('0x40')]){_0x23251f[_0xf684('0x44')]=[{'all':!![]}];}_0x23251f=_['merge']({},_0x23251f,_0x4b4a6d[_0xf684('0x45')]);return db[_0xf684('0x3f')][_0xf684('0x46')](_0x23251f)[_0xf684('0x23')](handleEntityNotFound(_0x306567,null))[_0xf684('0x23')](respondWithResult(_0x306567,null))['catch'](handleError(_0x306567,null));};exports[_0xf684('0x47')]=function(_0x1d8624,_0x582766){return db[_0xf684('0x3f')]['create'](_0x1d8624[_0xf684('0x48')],{})['then'](respondWithResult(_0x582766,0xc9))['catch'](handleError(_0x582766,null));};exports[_0xf684('0x22')]=function(_0xb12b1a,_0x1a2e62){if(_0xb12b1a['body']['id']){delete _0xb12b1a[_0xf684('0x48')]['id'];}return db['SmsQueueReport'][_0xf684('0x46')]({'where':{'id':_0xb12b1a[_0xf684('0x43')]['id']}})[_0xf684('0x23')](handleEntityNotFound(_0x1a2e62,null))['then'](saveUpdates(_0xb12b1a[_0xf684('0x48')],null))['then'](respondWithResult(_0x1a2e62,null))[_0xf684('0x49')](handleError(_0x1a2e62,null));};exports[_0xf684('0x24')]=function(_0x174f5e,_0x2a1a40){return db['SmsQueueReport']['find']({'where':{'id':_0x174f5e[_0xf684('0x43')]['id']}})[_0xf684('0x23')](handleEntityNotFound(_0x2a1a40,null))[_0xf684('0x23')](removeEntity(_0x2a1a40,null))['catch'](handleError(_0x2a1a40,null));};exports[_0xf684('0x4a')]=function(_0x246cde,_0x20a01d){return db[_0xf684('0x3f')][_0xf684('0x4a')]()[_0xf684('0x23')](respondWithResult(_0x20a01d,null))[_0xf684('0x49')](handleError(_0x20a01d,null));};
\ No newline at end of file
index 1a1569a..35dc28d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x1ca96d,_0x54ae47){var _0x38de95=function(_0x1e4c32){while(--_0x1e4c32){_0x1ca96d['push'](_0x1ca96d['shift']());}};_0x38de95(++_0x54ae47);}(_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
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x3dc1bc,_0x50db83){var _0x5b33a7=function(_0xf40df7){while(--_0xf40df7){_0x3dc1bc['push'](_0x3dc1bc['shift']());}};_0x5b33a7(++_0x50db83);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xb7e7[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 670de7b..bbb6d80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a71=['then','catch','attributes','limit','UpdateSmsQueueReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','body','options','raw'];(function(_0xce8170,_0x297aa0){var _0x27b969=function(_0x5b1fc8){while(--_0x5b1fc8){_0xce8170['push'](_0xce8170['shift']());}};_0x27b969(++_0x297aa0);}(_0x4a71,0x179));var _0x14a7=function(_0x373afe,_0x4841f3){_0x373afe=_0x373afe-0x0;var _0x4decea=_0x4a71[_0x373afe];return _0x4decea;};'use strict';var _=require(_0x14a7('0x0'));var util=require('util');var moment=require(_0x14a7('0x1'));var BPromise=require(_0x14a7('0x2'));var rs=require(_0x14a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14a7('0x4'))['db'];var utils=require(_0x14a7('0x5'));var logger=require(_0x14a7('0x6'))(_0x14a7('0x7'));var config=require('../../config/environment');var jayson=require(_0x14a7('0x8'));var client=jayson[_0x14a7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdb476c,_0x259345,_0x48a582){return new BPromise(function(_0x47fe44,_0x33ea5e){return client[_0x14a7('0xa')](_0xdb476c,_0x48a582)['then'](function(_0x2a6d65){logger[_0x14a7('0xb')](_0x14a7('0xc'),_0x259345,'request\x20sent');logger[_0x14a7('0xd')](_0x14a7('0xe'),_0x259345,_0x14a7('0xf'),JSON[_0x14a7('0x10')](_0x2a6d65));if(_0x2a6d65['error']){if(_0x2a6d65[_0x14a7('0x11')][_0x14a7('0x12')]===0x1f4){logger[_0x14a7('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x259345,_0x2a6d65[_0x14a7('0x11')][_0x14a7('0x13')]);return _0x33ea5e(_0x2a6d65[_0x14a7('0x11')][_0x14a7('0x13')]);}logger[_0x14a7('0x11')](_0x14a7('0xc'),_0x259345,_0x2a6d65[_0x14a7('0x11')][_0x14a7('0x13')]);return _0x47fe44(_0x2a6d65[_0x14a7('0x11')]['message']);}else{logger[_0x14a7('0xb')](_0x14a7('0xc'),_0x259345,_0x14a7('0xf'));_0x47fe44(_0x2a6d65[_0x14a7('0x14')][_0x14a7('0x13')]);}})['catch'](function(_0x467c75){logger[_0x14a7('0x11')](_0x14a7('0xc'),_0x259345,_0x467c75);_0x33ea5e(_0x467c75);});});}exports[_0x14a7('0x15')]=function(_0x3fa5b4){var _0x38b544=this;return new Promise(function(_0x3f1938,_0x11eb7a){return db[_0x14a7('0x16')]['create'](_0x3fa5b4[_0x14a7('0x17')],{'raw':_0x3fa5b4['options']?_0x3fa5b4[_0x14a7('0x18')][_0x14a7('0x19')]===undefined?!![]:![]:!![]})[_0x14a7('0x1a')](function(_0x47357a){logger[_0x14a7('0xb')](_0x14a7('0x15'),_0x3fa5b4);logger[_0x14a7('0xd')]('CreateSmsQueueReport',_0x3fa5b4,JSON['stringify'](_0x47357a));_0x3f1938(_0x47357a);})[_0x14a7('0x1b')](function(_0xa74554){logger[_0x14a7('0x11')](_0x14a7('0x15'),_0xa74554[_0x14a7('0x13')],_0x3fa5b4);_0x11eb7a(_0x38b544['error'](0x1f4,_0xa74554[_0x14a7('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x5512b0){var _0x323422=this;return new Promise(function(_0xbf007f,_0x2990e0){return db[_0x14a7('0x16')]['update'](_0x5512b0['body'],{'raw':_0x5512b0['options']?_0x5512b0['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5512b0[_0x14a7('0x18')]?_0x5512b0['options']['where']||null:null,'attributes':_0x5512b0['options']?_0x5512b0[_0x14a7('0x18')][_0x14a7('0x1c')]||null:null,'limit':_0x5512b0[_0x14a7('0x18')]?_0x5512b0[_0x14a7('0x18')][_0x14a7('0x1d')]||null:null})[_0x14a7('0x1a')](function(_0x4675c3){logger['info'](_0x14a7('0x1e'),_0x5512b0);logger[_0x14a7('0xd')](_0x14a7('0x1e'),_0x5512b0,JSON[_0x14a7('0x10')](_0x4675c3));_0xbf007f(_0x4675c3);})['catch'](function(_0x1fb492){logger[_0x14a7('0x11')](_0x14a7('0x1e'),_0x1fb492[_0x14a7('0x13')],_0x5512b0);_0x2990e0(_0x323422['error'](0x1f4,_0x1fb492[_0x14a7('0x13')]));});});};
\ No newline at end of file
+var _0x9d4e=['then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport','create','options','raw','stringify','UpdateSmsQueueReport','SmsQueueReport','update','body','where','attributes','limit','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x66ada4,_0x4cc7e4){var _0x182543=function(_0x3a677c){while(--_0x3a677c){_0x66ada4['push'](_0x66ada4['shift']());}};_0x182543(++_0x4cc7e4);}(_0x9d4e,0x136));var _0xe9d4=function(_0x2ef252,_0x1993fe){_0x2ef252=_0x2ef252-0x0;var _0x1139ca=_0x9d4e[_0x2ef252];return _0x1139ca;};'use strict';var _=require(_0xe9d4('0x0'));var util=require(_0xe9d4('0x1'));var moment=require(_0xe9d4('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9d4('0x4'));var logger=require(_0xe9d4('0x5'))('rpc');var config=require(_0xe9d4('0x6'));var jayson=require(_0xe9d4('0x7'));var client=jayson[_0xe9d4('0x8')][_0xe9d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33eec9,_0x597869,_0x12e617){return new BPromise(function(_0x2dee43,_0x41b2c8){return client['request'](_0x33eec9,_0x12e617)[_0xe9d4('0xa')](function(_0x2de9a9){logger[_0xe9d4('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x597869,_0xe9d4('0xc'));logger[_0xe9d4('0xd')](_0xe9d4('0xe'),_0x597869,_0xe9d4('0xc'),JSON['stringify'](_0x2de9a9));if(_0x2de9a9[_0xe9d4('0xf')]){if(_0x2de9a9['error'][_0xe9d4('0x10')]===0x1f4){logger[_0xe9d4('0xf')](_0xe9d4('0x11'),_0x597869,_0x2de9a9['error'][_0xe9d4('0x12')]);return _0x41b2c8(_0x2de9a9['error'][_0xe9d4('0x12')]);}logger['error'](_0xe9d4('0x11'),_0x597869,_0x2de9a9[_0xe9d4('0xf')][_0xe9d4('0x12')]);return _0x2dee43(_0x2de9a9[_0xe9d4('0xf')]['message']);}else{logger[_0xe9d4('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x597869,_0xe9d4('0xc'));_0x2dee43(_0x2de9a9['result']['message']);}})[_0xe9d4('0x13')](function(_0xa4e490){logger['error'](_0xe9d4('0x11'),_0x597869,_0xa4e490);_0x41b2c8(_0xa4e490);});});}exports[_0xe9d4('0x14')]=function(_0x1cb313){var _0x4ccd58=this;return new Promise(function(_0x2af3c0,_0x507df2){return db['SmsQueueReport'][_0xe9d4('0x15')](_0x1cb313['body'],{'raw':_0x1cb313['options']?_0x1cb313[_0xe9d4('0x16')][_0xe9d4('0x17')]===undefined?!![]:![]:!![]})[_0xe9d4('0xa')](function(_0x253451){logger[_0xe9d4('0xb')](_0xe9d4('0x14'),_0x1cb313);logger[_0xe9d4('0xd')]('CreateSmsQueueReport',_0x1cb313,JSON[_0xe9d4('0x18')](_0x253451));_0x2af3c0(_0x253451);})['catch'](function(_0x3c0ddf){logger[_0xe9d4('0xf')](_0xe9d4('0x14'),_0x3c0ddf[_0xe9d4('0x12')],_0x1cb313);_0x507df2(_0x4ccd58[_0xe9d4('0xf')](0x1f4,_0x3c0ddf[_0xe9d4('0x12')]));});});};exports[_0xe9d4('0x19')]=function(_0x2e97b4){var _0x48257c=this;return new Promise(function(_0x1e7cd4,_0x23d4f4){return db[_0xe9d4('0x1a')][_0xe9d4('0x1b')](_0x2e97b4[_0xe9d4('0x1c')],{'raw':_0x2e97b4[_0xe9d4('0x16')]?_0x2e97b4[_0xe9d4('0x16')][_0xe9d4('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e97b4[_0xe9d4('0x16')]?_0x2e97b4[_0xe9d4('0x16')][_0xe9d4('0x1d')]||null:null,'attributes':_0x2e97b4[_0xe9d4('0x16')]?_0x2e97b4['options'][_0xe9d4('0x1e')]||null:null,'limit':_0x2e97b4[_0xe9d4('0x16')]?_0x2e97b4[_0xe9d4('0x16')][_0xe9d4('0x1f')]||null:null})[_0xe9d4('0xa')](function(_0x89d896){logger['info']('UpdateSmsQueueReport',_0x2e97b4);logger[_0xe9d4('0xd')](_0xe9d4('0x19'),_0x2e97b4,JSON['stringify'](_0x89d896));_0x1e7cd4(_0x89d896);})['catch'](function(_0x185b6a){logger[_0xe9d4('0xf')](_0xe9d4('0x19'),_0x185b6a[_0xe9d4('0x12')],_0x2e97b4);_0x23d4f4(_0x48257c[_0xe9d4('0xf')](0x1f4,_0x185b6a[_0xe9d4('0x12')]));});});};
\ No newline at end of file
index a516e03..eaa9695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf120=['Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id','update','delete','exports','util','path','connect-timeout'];(function(_0x2e2420,_0x53b1d0){var _0x1c6a09=function(_0x2b4379){while(--_0x2b4379){_0x2e2420['push'](_0x2e2420['shift']());}};_0x1c6a09(++_0x53b1d0);}(_0xf120,0x179));var _0x0f12=function(_0x5e5bb7,_0x1b8db8){_0x5e5bb7=_0x5e5bb7-0x0;var _0x49bd09=_0xf120[_0x5e5bb7];return _0x49bd09;};'use strict';var multer=require('multer');var util=require(_0x0f12('0x0'));var path=require(_0x0f12('0x1'));var timeout=require(_0x0f12('0x2'));var express=require('express');var router=express[_0x0f12('0x3')]();var fs_extra=require(_0x0f12('0x4'));var auth=require(_0x0f12('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f12('0x6'));var controller=require(_0x0f12('0x7'));router[_0x0f12('0x8')]('/',auth[_0x0f12('0x9')](),controller[_0x0f12('0xa')]);router[_0x0f12('0x8')](_0x0f12('0xb'),auth[_0x0f12('0x9')](),controller['describe']);router[_0x0f12('0x8')]('/:id',auth[_0x0f12('0x9')](),controller[_0x0f12('0xc')]);router[_0x0f12('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0f12('0xe')](_0x0f12('0xf'),auth[_0x0f12('0x9')](),controller[_0x0f12('0x10')]);router[_0x0f12('0x11')](_0x0f12('0xf'),auth[_0x0f12('0x9')](),controller['destroy']);module[_0x0f12('0x12')]=router;
\ No newline at end of file
+var _0x2123=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x41b387,_0x4d4f5a){var _0x32a8bd=function(_0x291391){while(--_0x291391){_0x41b387['push'](_0x41b387['shift']());}};_0x32a8bd(++_0x4d4f5a);}(_0x2123,0x190));var _0x3212=function(_0x289fbf,_0x3ce4fa){_0x289fbf=_0x289fbf-0x0;var _0x7cb48e=_0x2123[_0x289fbf];return _0x7cb48e;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),auth['isAuthenticated'](),controller[_0x3212('0xe')]);router['get'](_0x3212('0xf'),auth[_0x3212('0x10')](),controller[_0x3212('0x11')]);router[_0x3212('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3212('0x13')](_0x3212('0xf'),auth[_0x3212('0x10')](),controller[_0x3212('0x14')]);router[_0x3212('0x15')](_0x3212('0xf'),auth[_0x3212('0x10')](),controller[_0x3212('0x16')]);module[_0x3212('0x17')]=router;
\ No newline at end of file
index 3fa2907..9ba1c8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x9471aa,_0x54c684){var _0x3d988d=function(_0x4aa733){while(--_0x4aa733){_0x9471aa['push'](_0x9471aa['shift']());}};_0x3d988d(++_0x54c684);}(_0xaa88,0x137));var _0x8aa8=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0xaa88[_0x4cee4b];return _0x4d891d;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5eb6ad,_0x3d65e0){var _0x39a8ae=function(_0x391558){while(--_0x391558){_0x5eb6ad['push'](_0x5eb6ad['shift']());}};_0x39a8ae(++_0x3d65e0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x53b753,_0x36a09d){_0x53b753=_0x53b753-0x0;var _0x56ed68=_0xf4eb[_0x53b753];return _0x56ed68;};'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 1ec3a0b..25c74e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fcb=['map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','SmsTransferReport','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','type','key','model'];(function(_0x24b283,_0x510549){var _0x23d8a1=function(_0xc309f){while(--_0xc309f){_0x24b283['push'](_0x24b283['shift']());}};_0x23d8a1(++_0x510549);}(_0x5fcb,0x1e5));var _0xb5fc=function(_0x5c1ae4,_0x5318ea){_0x5c1ae4=_0x5c1ae4-0x0;var _0x5edd3c=_0x5fcb[_0x5c1ae4];return _0x5edd3c;};'use strict';var emlformat=require(_0xb5fc('0x0'));var rimraf=require(_0xb5fc('0x1'));var zipdir=require(_0xb5fc('0x2'));var jsonpatch=require(_0xb5fc('0x3'));var rp=require(_0xb5fc('0x4'));var moment=require(_0xb5fc('0x5'));var BPromise=require(_0xb5fc('0x6'));var Mustache=require(_0xb5fc('0x7'));var util=require('util');var path=require(_0xb5fc('0x8'));var sox=require(_0xb5fc('0x9'));var csv=require(_0xb5fc('0xa'));var ejs=require(_0xb5fc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5fc('0xc'));var squel=require(_0xb5fc('0xd'));var crypto=require(_0xb5fc('0xe'));var jsforce=require(_0xb5fc('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb5fc('0x10'));var Papa=require(_0xb5fc('0x11'));var Redis=require('ioredis');var authService=require(_0xb5fc('0x12'));var qs=require(_0xb5fc('0x13'));var as=require(_0xb5fc('0x14'));var hardwareService=require(_0xb5fc('0x15'));var logger=require(_0xb5fc('0x16'))(_0xb5fc('0x17'));var utils=require(_0xb5fc('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb5fc('0x19'))['db'];function respondWithStatusCode(_0x531584,_0xb4deb4){_0xb4deb4=_0xb4deb4||0xcc;return function(_0x279e90){if(_0x279e90){return _0x531584['sendStatus'](_0xb4deb4);}return _0x531584[_0xb5fc('0x1a')](_0xb4deb4)['end']();};}function respondWithResult(_0xab320e,_0x23e2fa){_0x23e2fa=_0x23e2fa||0xc8;return function(_0x2931f7){if(_0x2931f7){return _0xab320e[_0xb5fc('0x1a')](_0x23e2fa)['json'](_0x2931f7);}};}function respondWithFilteredResult(_0x28f8a7,_0x37a5c5){return function(_0x249a6e){if(_0x249a6e){var _0x2bd5c2=typeof _0x37a5c5[_0xb5fc('0x1b')]==='undefined'&&typeof _0x37a5c5['limit']===_0xb5fc('0x1c');var _0x1e5d9c=_0x249a6e[_0xb5fc('0x1d')];var _0x5d6e5b=_0x2bd5c2?0x0:_0x37a5c5[_0xb5fc('0x1b')];var _0x3dc00b=_0x2bd5c2?_0x249a6e[_0xb5fc('0x1d')]:_0x37a5c5[_0xb5fc('0x1b')]+_0x37a5c5[_0xb5fc('0x1e')];var _0xbe63aa;if(_0x3dc00b>=_0x1e5d9c){_0x3dc00b=_0x1e5d9c;_0xbe63aa=0xc8;}else{_0xbe63aa=0xce;}_0x28f8a7[_0xb5fc('0x1a')](_0xbe63aa);return _0x28f8a7[_0xb5fc('0x1f')](_0xb5fc('0x20'),_0x5d6e5b+'-'+_0x3dc00b+'/'+_0x1e5d9c)[_0xb5fc('0x21')](_0x249a6e);}return null;};}function patchUpdates(_0x15a42f){return function(_0xae4b3b){try{jsonpatch[_0xb5fc('0x22')](_0xae4b3b,_0x15a42f,!![]);}catch(_0x3fa34d){return BPromise['reject'](_0x3fa34d);}return _0xae4b3b['save']();};}function saveUpdates(_0x4312c5,_0x4d29f0){return function(_0x339ba4){if(_0x339ba4){return _0x339ba4[_0xb5fc('0x23')](_0x4312c5)[_0xb5fc('0x24')](function(_0x6cc65b){return _0x6cc65b;});}return null;};}function removeEntity(_0xdbd1c,_0x2c89d3){return function(_0x242ed7){if(_0x242ed7){return _0x242ed7[_0xb5fc('0x25')]()[_0xb5fc('0x24')](function(){_0xdbd1c[_0xb5fc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e7a23,_0x106487){return function(_0xbaf084){if(!_0xbaf084){_0x1e7a23[_0xb5fc('0x26')](0x194);}return _0xbaf084;};}function handleError(_0x5609ce,_0x798b00){_0x798b00=_0x798b00||0x1f4;return function(_0x56492b){logger[_0xb5fc('0x27')](_0x56492b[_0xb5fc('0x28')]);if(_0x56492b[_0xb5fc('0x29')]){delete _0x56492b[_0xb5fc('0x29')];}_0x5609ce[_0xb5fc('0x1a')](_0x798b00)['send'](_0x56492b);};}exports[_0xb5fc('0x2a')]=function(_0x3100b1,_0x57d555){var _0x1aa24c={},_0x2ba48a={},_0x3b04b2={'count':0x0,'rows':[]};var _0xa88fbd=_['map'](db['SmsTransferReport'][_0xb5fc('0x2b')],function(_0x44d665){return{'name':_0x44d665['fieldName'],'type':_0x44d665[_0xb5fc('0x2c')][_0xb5fc('0x2d')]};});_0x2ba48a[_0xb5fc('0x2e')]=_[_0xb5fc('0x2f')](_0xa88fbd,_0xb5fc('0x29'));_0x2ba48a['query']=_[_0xb5fc('0x30')](_0x3100b1[_0xb5fc('0x31')]);_0x2ba48a[_0xb5fc('0x32')]=_[_0xb5fc('0x33')](_0x2ba48a[_0xb5fc('0x2e')],_0x2ba48a[_0xb5fc('0x31')]);_0x1aa24c[_0xb5fc('0x34')]=_[_0xb5fc('0x33')](_0x2ba48a[_0xb5fc('0x2e')],qs['fields'](_0x3100b1[_0xb5fc('0x31')][_0xb5fc('0x35')]));_0x1aa24c['attributes']=_0x1aa24c[_0xb5fc('0x34')][_0xb5fc('0x36')]?_0x1aa24c[_0xb5fc('0x34')]:_0x2ba48a[_0xb5fc('0x2e')];if(!_0x3100b1[_0xb5fc('0x31')][_0xb5fc('0x37')](_0xb5fc('0x38'))){_0x1aa24c[_0xb5fc('0x1e')]=qs[_0xb5fc('0x1e')](_0x3100b1[_0xb5fc('0x31')]['limit']);_0x1aa24c[_0xb5fc('0x1b')]=qs[_0xb5fc('0x1b')](_0x3100b1['query'][_0xb5fc('0x1b')]);}_0x1aa24c['order']=qs['sort'](_0x3100b1[_0xb5fc('0x31')][_0xb5fc('0x39')]);_0x1aa24c['where']=qs[_0xb5fc('0x32')](_[_0xb5fc('0x3a')](_0x3100b1[_0xb5fc('0x31')],_0x2ba48a[_0xb5fc('0x32')]),_0xa88fbd);if(_0x3100b1['query'][_0xb5fc('0x3b')]){_0x1aa24c[_0xb5fc('0x3c')]=_['merge'](_0x1aa24c[_0xb5fc('0x3c')],{'$or':_[_0xb5fc('0x2f')](_0xa88fbd,function(_0x2b32d3){if(_0x2b32d3[_0xb5fc('0x2c')]!==_0xb5fc('0x3d')){var _0x41411b={};_0x41411b[_0x2b32d3['name']]={'$like':'%'+_0x3100b1[_0xb5fc('0x31')][_0xb5fc('0x3b')]+'%'};return _0x41411b;}})});}_0x1aa24c=_[_0xb5fc('0x3e')]({},_0x1aa24c,_0x3100b1[_0xb5fc('0x3f')]);var _0x35c4e6={'where':_0x1aa24c[_0xb5fc('0x3c')]};return db[_0xb5fc('0x40')][_0xb5fc('0x1d')](_0x35c4e6)[_0xb5fc('0x24')](function(_0x51b461){_0x3b04b2[_0xb5fc('0x1d')]=_0x51b461;if(_0x3100b1[_0xb5fc('0x31')][_0xb5fc('0x41')]){_0x1aa24c[_0xb5fc('0x42')]=[{'all':!![]}];}return db[_0xb5fc('0x40')][_0xb5fc('0x43')](_0x1aa24c);})[_0xb5fc('0x24')](function(_0x5a6660){_0x3b04b2[_0xb5fc('0x44')]=_0x5a6660;return _0x3b04b2;})['then'](respondWithFilteredResult(_0x57d555,_0x1aa24c))[_0xb5fc('0x45')](handleError(_0x57d555,null));};exports[_0xb5fc('0x46')]=function(_0x4b1cb7,_0x45b39d){var _0x42a0de={'raw':!![],'where':{'id':_0x4b1cb7[_0xb5fc('0x47')]['id']}},_0x11c882={};_0x11c882['model']=_[_0xb5fc('0x30')](db['SmsTransferReport']['rawAttributes']);_0x11c882[_0xb5fc('0x31')]=_[_0xb5fc('0x30')](_0x4b1cb7[_0xb5fc('0x31')]);_0x11c882[_0xb5fc('0x32')]=_['intersection'](_0x11c882[_0xb5fc('0x2e')],_0x11c882[_0xb5fc('0x31')]);_0x42a0de[_0xb5fc('0x34')]=_[_0xb5fc('0x33')](_0x11c882[_0xb5fc('0x2e')],qs[_0xb5fc('0x35')](_0x4b1cb7[_0xb5fc('0x31')][_0xb5fc('0x35')]));_0x42a0de[_0xb5fc('0x34')]=_0x42a0de[_0xb5fc('0x34')]['length']?_0x42a0de['attributes']:_0x11c882[_0xb5fc('0x2e')];if(_0x4b1cb7[_0xb5fc('0x31')][_0xb5fc('0x41')]){_0x42a0de[_0xb5fc('0x42')]=[{'all':!![]}];}_0x42a0de=_[_0xb5fc('0x3e')]({},_0x42a0de,_0x4b1cb7[_0xb5fc('0x3f')]);return db[_0xb5fc('0x40')]['find'](_0x42a0de)['then'](handleEntityNotFound(_0x45b39d,null))[_0xb5fc('0x24')](respondWithResult(_0x45b39d,null))[_0xb5fc('0x45')](handleError(_0x45b39d,null));};exports[_0xb5fc('0x48')]=function(_0xaab72,_0x44423a){return db['SmsTransferReport'][_0xb5fc('0x48')](_0xaab72[_0xb5fc('0x49')],{})[_0xb5fc('0x24')](respondWithResult(_0x44423a,0xc9))[_0xb5fc('0x45')](handleError(_0x44423a,null));};exports[_0xb5fc('0x23')]=function(_0x3c19fc,_0x39f289){if(_0x3c19fc[_0xb5fc('0x49')]['id']){delete _0x3c19fc['body']['id'];}return db[_0xb5fc('0x40')][_0xb5fc('0x4a')]({'where':{'id':_0x3c19fc['params']['id']}})[_0xb5fc('0x24')](handleEntityNotFound(_0x39f289,null))[_0xb5fc('0x24')](saveUpdates(_0x3c19fc[_0xb5fc('0x49')],null))[_0xb5fc('0x24')](respondWithResult(_0x39f289,null))['catch'](handleError(_0x39f289,null));};exports['destroy']=function(_0x80964b,_0x24147e){return db['SmsTransferReport'][_0xb5fc('0x4a')]({'where':{'id':_0x80964b['params']['id']}})[_0xb5fc('0x24')](handleEntityNotFound(_0x24147e,null))[_0xb5fc('0x24')](removeEntity(_0x24147e,null))[_0xb5fc('0x45')](handleError(_0x24147e,null));};exports[_0xb5fc('0x4b')]=function(_0x3c1ba3,_0x5b305f){return db[_0xb5fc('0x40')][_0xb5fc('0x4b')]()[_0xb5fc('0x24')](respondWithResult(_0x5b305f,null))[_0xb5fc('0x45')](handleError(_0x5b305f,null));};
\ No newline at end of file
+var _0x88cb=['describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','status','set','Content-Range','reject','save','update','destroy','error','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','name','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','filter','options','count','includeAll','findAll','then','rows','show','params','keys','include','find','catch','create','body'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x88cb,0x93));var _0xb88c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x88cb[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb88c('0x0'));var zipdir=require(_0xb88c('0x1'));var jsonpatch=require(_0xb88c('0x2'));var rp=require(_0xb88c('0x3'));var moment=require(_0xb88c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb88c('0x5'));var util=require('util');var path=require(_0xb88c('0x6'));var sox=require('sox');var csv=require(_0xb88c('0x7'));var ejs=require(_0xb88c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb88c('0x9'));var squel=require(_0xb88c('0xa'));var crypto=require(_0xb88c('0xb'));var jsforce=require(_0xb88c('0xc'));var deskjs=require(_0xb88c('0xd'));var toCsv=require(_0xb88c('0x7'));var querystring=require(_0xb88c('0xe'));var Papa=require(_0xb88c('0xf'));var Redis=require(_0xb88c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb88c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb88c('0x12'));var config=require(_0xb88c('0x13'));var licenseUtil=require(_0xb88c('0x14'));var db=require(_0xb88c('0x15'))['db'];function respondWithStatusCode(_0x31f851,_0x41d2db){_0x41d2db=_0x41d2db||0xcc;return function(_0x49b9d7){if(_0x49b9d7){return _0x31f851[_0xb88c('0x16')](_0x41d2db);}return _0x31f851['status'](_0x41d2db)[_0xb88c('0x17')]();};}function respondWithResult(_0x2921dd,_0x37fc35){_0x37fc35=_0x37fc35||0xc8;return function(_0x152804){if(_0x152804){return _0x2921dd['status'](_0x37fc35)[_0xb88c('0x18')](_0x152804);}};}function respondWithFilteredResult(_0x13125f,_0x3c8689){return function(_0x39136c){if(_0x39136c){var _0x50e708=typeof _0x3c8689[_0xb88c('0x19')]==='undefined'&&typeof _0x3c8689[_0xb88c('0x1a')]===_0xb88c('0x1b');var _0x1984b0=_0x39136c['count'];var _0x35982e=_0x50e708?0x0:_0x3c8689[_0xb88c('0x19')];var _0x2dba26=_0x50e708?_0x39136c['count']:_0x3c8689[_0xb88c('0x19')]+_0x3c8689[_0xb88c('0x1a')];var _0x48fd9d;if(_0x2dba26>=_0x1984b0){_0x2dba26=_0x1984b0;_0x48fd9d=0xc8;}else{_0x48fd9d=0xce;}_0x13125f[_0xb88c('0x1c')](_0x48fd9d);return _0x13125f[_0xb88c('0x1d')](_0xb88c('0x1e'),_0x35982e+'-'+_0x2dba26+'/'+_0x1984b0)[_0xb88c('0x18')](_0x39136c);}return null;};}function patchUpdates(_0x2657f6){return function(_0x21786c){try{jsonpatch['apply'](_0x21786c,_0x2657f6,!![]);}catch(_0x535a6a){return BPromise[_0xb88c('0x1f')](_0x535a6a);}return _0x21786c[_0xb88c('0x20')]();};}function saveUpdates(_0x520c1c,_0x36a3de){return function(_0x1e0522){if(_0x1e0522){return _0x1e0522[_0xb88c('0x21')](_0x520c1c)['then'](function(_0xbaf75f){return _0xbaf75f;});}return null;};}function removeEntity(_0x11d407,_0x10691c){return function(_0x3bbebb){if(_0x3bbebb){return _0x3bbebb[_0xb88c('0x22')]()['then'](function(){_0x11d407[_0xb88c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fdc2a,_0x539b47){return function(_0x38c119){if(!_0x38c119){_0x3fdc2a['sendStatus'](0x194);}return _0x38c119;};}function handleError(_0x1995a0,_0x533500){_0x533500=_0x533500||0x1f4;return function(_0x27f754){logger[_0xb88c('0x23')](_0x27f754['stack']);if(_0x27f754['name']){delete _0x27f754['name'];}_0x1995a0[_0xb88c('0x1c')](_0x533500)[_0xb88c('0x24')](_0x27f754);};}exports['index']=function(_0x4fc2e8,_0x78c86d){var _0x46eefa={},_0x5704f7={},_0x377380={'count':0x0,'rows':[]};var _0x10ed45=_[_0xb88c('0x25')](db[_0xb88c('0x26')][_0xb88c('0x27')],function(_0x1a3b97){return{'name':_0x1a3b97[_0xb88c('0x28')],'type':_0x1a3b97[_0xb88c('0x29')][_0xb88c('0x2a')]};});_0x5704f7['model']=_[_0xb88c('0x25')](_0x10ed45,_0xb88c('0x2b'));_0x5704f7[_0xb88c('0x2c')]=_['keys'](_0x4fc2e8[_0xb88c('0x2c')]);_0x5704f7[_0xb88c('0x2d')]=_['intersection'](_0x5704f7[_0xb88c('0x2e')],_0x5704f7['query']);_0x46eefa[_0xb88c('0x2f')]=_[_0xb88c('0x30')](_0x5704f7[_0xb88c('0x2e')],qs[_0xb88c('0x31')](_0x4fc2e8['query'][_0xb88c('0x31')]));_0x46eefa[_0xb88c('0x2f')]=_0x46eefa['attributes'][_0xb88c('0x32')]?_0x46eefa[_0xb88c('0x2f')]:_0x5704f7['model'];if(!_0x4fc2e8[_0xb88c('0x2c')][_0xb88c('0x33')](_0xb88c('0x34'))){_0x46eefa['limit']=qs['limit'](_0x4fc2e8['query']['limit']);_0x46eefa[_0xb88c('0x19')]=qs[_0xb88c('0x19')](_0x4fc2e8['query'][_0xb88c('0x19')]);}_0x46eefa['order']=qs[_0xb88c('0x35')](_0x4fc2e8['query'][_0xb88c('0x35')]);_0x46eefa['where']=qs[_0xb88c('0x2d')](_[_0xb88c('0x36')](_0x4fc2e8[_0xb88c('0x2c')],_0x5704f7[_0xb88c('0x2d')]),_0x10ed45);if(_0x4fc2e8[_0xb88c('0x2c')]['filter']){_0x46eefa[_0xb88c('0x37')]=_[_0xb88c('0x38')](_0x46eefa[_0xb88c('0x37')],{'$or':_['map'](_0x10ed45,function(_0x4d8de4){if(_0x4d8de4[_0xb88c('0x29')]!=='VIRTUAL'){var _0x11a029={};_0x11a029[_0x4d8de4[_0xb88c('0x2b')]]={'$like':'%'+_0x4fc2e8[_0xb88c('0x2c')][_0xb88c('0x39')]+'%'};return _0x11a029;}})});}_0x46eefa=_[_0xb88c('0x38')]({},_0x46eefa,_0x4fc2e8[_0xb88c('0x3a')]);var _0xa304a8={'where':_0x46eefa[_0xb88c('0x37')]};return db[_0xb88c('0x26')][_0xb88c('0x3b')](_0xa304a8)['then'](function(_0x4b355b){_0x377380['count']=_0x4b355b;if(_0x4fc2e8[_0xb88c('0x2c')][_0xb88c('0x3c')]){_0x46eefa['include']=[{'all':!![]}];}return db[_0xb88c('0x26')][_0xb88c('0x3d')](_0x46eefa);})[_0xb88c('0x3e')](function(_0x40e7cf){_0x377380[_0xb88c('0x3f')]=_0x40e7cf;return _0x377380;})[_0xb88c('0x3e')](respondWithFilteredResult(_0x78c86d,_0x46eefa))['catch'](handleError(_0x78c86d,null));};exports[_0xb88c('0x40')]=function(_0x547395,_0x3b95ab){var _0x96fe={'raw':!![],'where':{'id':_0x547395[_0xb88c('0x41')]['id']}},_0x2da984={};_0x2da984[_0xb88c('0x2e')]=_[_0xb88c('0x42')](db[_0xb88c('0x26')][_0xb88c('0x27')]);_0x2da984['query']=_[_0xb88c('0x42')](_0x547395[_0xb88c('0x2c')]);_0x2da984[_0xb88c('0x2d')]=_[_0xb88c('0x30')](_0x2da984['model'],_0x2da984[_0xb88c('0x2c')]);_0x96fe[_0xb88c('0x2f')]=_['intersection'](_0x2da984[_0xb88c('0x2e')],qs['fields'](_0x547395[_0xb88c('0x2c')]['fields']));_0x96fe['attributes']=_0x96fe[_0xb88c('0x2f')]['length']?_0x96fe[_0xb88c('0x2f')]:_0x2da984[_0xb88c('0x2e')];if(_0x547395[_0xb88c('0x2c')][_0xb88c('0x3c')]){_0x96fe[_0xb88c('0x43')]=[{'all':!![]}];}_0x96fe=_[_0xb88c('0x38')]({},_0x96fe,_0x547395[_0xb88c('0x3a')]);return db[_0xb88c('0x26')][_0xb88c('0x44')](_0x96fe)['then'](handleEntityNotFound(_0x3b95ab,null))[_0xb88c('0x3e')](respondWithResult(_0x3b95ab,null))[_0xb88c('0x45')](handleError(_0x3b95ab,null));};exports[_0xb88c('0x46')]=function(_0x2c3d7c,_0x253512){return db['SmsTransferReport'][_0xb88c('0x46')](_0x2c3d7c['body'],{})['then'](respondWithResult(_0x253512,0xc9))['catch'](handleError(_0x253512,null));};exports[_0xb88c('0x21')]=function(_0xa43f19,_0x3377e8){if(_0xa43f19['body']['id']){delete _0xa43f19[_0xb88c('0x47')]['id'];}return db[_0xb88c('0x26')]['find']({'where':{'id':_0xa43f19[_0xb88c('0x41')]['id']}})[_0xb88c('0x3e')](handleEntityNotFound(_0x3377e8,null))[_0xb88c('0x3e')](saveUpdates(_0xa43f19[_0xb88c('0x47')],null))[_0xb88c('0x3e')](respondWithResult(_0x3377e8,null))[_0xb88c('0x45')](handleError(_0x3377e8,null));};exports[_0xb88c('0x22')]=function(_0x24c9fe,_0x21a40d){return db[_0xb88c('0x26')][_0xb88c('0x44')]({'where':{'id':_0x24c9fe[_0xb88c('0x41')]['id']}})[_0xb88c('0x3e')](handleEntityNotFound(_0x21a40d,null))[_0xb88c('0x3e')](removeEntity(_0x21a40d,null))[_0xb88c('0x45')](handleError(_0x21a40d,null));};exports[_0xb88c('0x48')]=function(_0x433307,_0x32e9ce){return db[_0xb88c('0x26')][_0xb88c('0x48')]()[_0xb88c('0x3e')](respondWithResult(_0x32e9ce,null))[_0xb88c('0x45')](handleError(_0x32e9ce,null));};
\ No newline at end of file
index 7cfc658..0c05d43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb28=['../../config/environment','exports','SmsTransferReport','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xc55c21,_0x4886dd){var _0x4645bb=function(_0xdb768f){while(--_0xdb768f){_0xc55c21['push'](_0xc55c21['shift']());}};_0x4645bb(++_0x4886dd);}(_0xeb28,0x1d0));var _0x8eb2=function(_0xaf3b3e,_0x43335d){_0xaf3b3e=_0xaf3b3e-0x0;var _0x17fd9d=_0xeb28[_0xaf3b3e];return _0x17fd9d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8eb2('0x0'))(_0x8eb2('0x1'));var moment=require('moment');var BPromise=require(_0x8eb2('0x2'));var rp=require(_0x8eb2('0x3'));var fs=require('fs');var path=require(_0x8eb2('0x4'));var rimraf=require(_0x8eb2('0x5'));var config=require(_0x8eb2('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x8eb2('0x7')]=function(_0x215a1e,_0x58fd15){return _0x215a1e['define'](_0x8eb2('0x8'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x8eb2('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb5e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','uniqueid','lodash','util','../../config/logger'];(function(_0x5d76cc,_0x195736){var _0x4acce4=function(_0x3b889d){while(--_0x3b889d){_0x5d76cc['push'](_0x5d76cc['shift']());}};_0x4acce4(++_0x195736);}(_0xcb5e,0x1dd));var _0xecb5=function(_0x5cfb9b,_0x7317f1){_0x5cfb9b=_0x5cfb9b-0x0;var _0x488780=_0xcb5e[_0x5cfb9b];return _0x488780;};'use strict';var _=require(_0xecb5('0x0'));var util=require(_0xecb5('0x1'));var logger=require(_0xecb5('0x2'))(_0xecb5('0x3'));var moment=require(_0xecb5('0x4'));var BPromise=require(_0xecb5('0x5'));var rp=require(_0xecb5('0x6'));var fs=require('fs');var path=require(_0xecb5('0x7'));var rimraf=require(_0xecb5('0x8'));var config=require(_0xecb5('0x9'));var attributes=require(_0xecb5('0xa'));module['exports']=function(_0x5b3483,_0x3d182b){return _0x5b3483['define']('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xecb5('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 8baa325..b6d2920 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbd0=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x304e0e,_0x2654a3){var _0x4449c8=function(_0x5a9242){while(--_0x5a9242){_0x304e0e['push'](_0x304e0e['shift']());}};_0x4449c8(++_0x2654a3);}(_0xdbd0,0x88));var _0x0dbd=function(_0x1c88bd,_0x36dde2){_0x1c88bd=_0x1c88bd-0x0;var _0x20d7de=_0xdbd0[_0x1c88bd];return _0x20d7de;};'use strict';var _=require(_0x0dbd('0x0'));var util=require(_0x0dbd('0x1'));var moment=require(_0x0dbd('0x2'));var BPromise=require(_0x0dbd('0x3'));var rs=require(_0x0dbd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0dbd('0x5'))['db'];var utils=require(_0x0dbd('0x6'));var logger=require(_0x0dbd('0x7'))('rpc');var config=require(_0x0dbd('0x8'));var jayson=require(_0x0dbd('0x9'));var client=jayson[_0x0dbd('0xa')][_0x0dbd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b653b,_0x47e742,_0xcb72c2){return new BPromise(function(_0x3b3f21,_0x1a957e){return client[_0x0dbd('0xc')](_0x4b653b,_0xcb72c2)[_0x0dbd('0xd')](function(_0x453836){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x47e742,_0x0dbd('0xe'));logger[_0x0dbd('0xf')](_0x0dbd('0x10'),_0x47e742,_0x0dbd('0xe'),JSON[_0x0dbd('0x11')](_0x453836));if(_0x453836[_0x0dbd('0x12')]){if(_0x453836[_0x0dbd('0x12')][_0x0dbd('0x13')]===0x1f4){logger['error'](_0x0dbd('0x14'),_0x47e742,_0x453836[_0x0dbd('0x12')][_0x0dbd('0x15')]);return _0x1a957e(_0x453836['error'][_0x0dbd('0x15')]);}logger[_0x0dbd('0x12')](_0x0dbd('0x14'),_0x47e742,_0x453836[_0x0dbd('0x12')][_0x0dbd('0x15')]);return _0x3b3f21(_0x453836[_0x0dbd('0x12')][_0x0dbd('0x15')]);}else{logger[_0x0dbd('0x16')](_0x0dbd('0x14'),_0x47e742,'request\x20sent');_0x3b3f21(_0x453836['result'][_0x0dbd('0x15')]);}})[_0x0dbd('0x17')](function(_0x5b2a34){logger[_0x0dbd('0x12')](_0x0dbd('0x14'),_0x47e742,_0x5b2a34);_0x1a957e(_0x5b2a34);});});}
\ No newline at end of file
+var _0x158f=['request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x158f,0x137));var _0xf158=function(_0x4335bc,_0x480e11){_0x4335bc=_0x4335bc-0x0;var _0x4f804c=_0x158f[_0x4335bc];return _0x4f804c;};'use strict';var _=require('lodash');var util=require(_0xf158('0x0'));var moment=require(_0xf158('0x1'));var BPromise=require(_0xf158('0x2'));var rs=require(_0xf158('0x3'));var fs=require('fs');var Redis=require(_0xf158('0x4'));var db=require(_0xf158('0x5'))['db'];var utils=require(_0xf158('0x6'));var logger=require('../../config/logger')(_0xf158('0x7'));var config=require('../../config/environment');var jayson=require(_0xf158('0x8'));var client=jayson[_0xf158('0x9')][_0xf158('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ff44,_0x5acfb7,_0x2a24a7){return new BPromise(function(_0x395f69,_0x2873ce){return client[_0xf158('0xb')](_0x23ff44,_0x2a24a7)[_0xf158('0xc')](function(_0x2a17df){logger[_0xf158('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x5acfb7,_0xf158('0xe'));logger[_0xf158('0xf')](_0xf158('0x10'),_0x5acfb7,_0xf158('0xe'),JSON['stringify'](_0x2a17df));if(_0x2a17df[_0xf158('0x11')]){if(_0x2a17df[_0xf158('0x11')][_0xf158('0x12')]===0x1f4){logger[_0xf158('0x11')](_0xf158('0x13'),_0x5acfb7,_0x2a17df[_0xf158('0x11')][_0xf158('0x14')]);return _0x2873ce(_0x2a17df['error'][_0xf158('0x14')]);}logger['error'](_0xf158('0x13'),_0x5acfb7,_0x2a17df[_0xf158('0x11')][_0xf158('0x14')]);return _0x395f69(_0x2a17df[_0xf158('0x11')][_0xf158('0x14')]);}else{logger['info'](_0xf158('0x13'),_0x5acfb7,_0xf158('0xe'));_0x395f69(_0x2a17df[_0xf158('0x15')]['message']);}})[_0xf158('0x16')](function(_0x3bfdf1){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x5acfb7,_0x3bfdf1);_0x2873ce(_0x3bfdf1);});});}
\ No newline at end of file
index 0ce919b..6c7262c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8387=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id/download','diskStorage','join','originalname','replace','format','basename','extname','now','post','file','put','/:id','update','delete','exports'];(function(_0x160a5e,_0x29dd74){var _0x42812b=function(_0x197d3d){while(--_0x197d3d){_0x160a5e['push'](_0x160a5e['shift']());}};_0x42812b(++_0x29dd74);}(_0x8387,0x82));var _0x7838=function(_0x74e2c8,_0x22dee3){_0x74e2c8=_0x74e2c8-0x0;var _0x3ff12a=_0x8387[_0x74e2c8];return _0x3ff12a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7838('0x0'));var timeout=require(_0x7838('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7838('0x2'));var auth=require(_0x7838('0x3'));var interaction=require(_0x7838('0x4'));var config=require(_0x7838('0x5'));var controller=require(_0x7838('0x6'));router[_0x7838('0x7')]('/',auth[_0x7838('0x8')](),controller[_0x7838('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7838('0x7')](_0x7838('0xa'),auth[_0x7838('0x8')](),controller['download']);var upload=multer({'storage':multer[_0x7838('0xb')]({'destination':function(_0x58a753,_0x7b1385,_0x2ed2f8){_0x2ed2f8(null,path[_0x7838('0xc')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x144710,_0x414571,_0x55b47d){_0x414571[_0x7838('0xd')]=_0x414571['originalname'][_0x7838('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x55b47d(null,util[_0x7838('0xf')]('%s-%s%s',path[_0x7838('0x10')](_0x414571[_0x7838('0xd')],path[_0x7838('0x11')](_0x414571[_0x7838('0xd')])),Date[_0x7838('0x12')](),path[_0x7838('0x11')](_0x414571[_0x7838('0xd')])));}})});router[_0x7838('0x13')]('/',upload['single'](_0x7838('0x14')),controller['create']);router[_0x7838('0x15')](_0x7838('0x16'),auth['isAuthenticated'](),controller[_0x7838('0x17')]);router[_0x7838('0x18')](_0x7838('0x16'),auth['isAuthenticated'](),controller['delete']);module[_0x7838('0x19')]=router;
\ No newline at end of file
+var _0x3c79=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','single','create','put','update','delete','multer'];(function(_0x93d2f0,_0x324413){var _0x44dc81=function(_0x746fdf){while(--_0x746fdf){_0x93d2f0['push'](_0x93d2f0['shift']());}};_0x44dc81(++_0x324413);}(_0x3c79,0xef));var _0x93c7=function(_0x436e87,_0x39fc2f){_0x436e87=_0x436e87-0x0;var _0x10de21=_0x3c79[_0x436e87];return _0x10de21;};'use strict';var multer=require(_0x93c7('0x0'));var util=require(_0x93c7('0x1'));var path=require('path');var timeout=require(_0x93c7('0x2'));var express=require(_0x93c7('0x3'));var router=express[_0x93c7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x93c7('0x5'));var interaction=require(_0x93c7('0x6'));var config=require('../../config/environment');var controller=require(_0x93c7('0x7'));router[_0x93c7('0x8')]('/',auth[_0x93c7('0x9')](),controller[_0x93c7('0xa')]);router[_0x93c7('0x8')](_0x93c7('0xb'),auth[_0x93c7('0x9')](),controller[_0x93c7('0xc')]);router[_0x93c7('0x8')](_0x93c7('0xd'),auth[_0x93c7('0x9')](),controller[_0x93c7('0xe')]);var upload=multer({'storage':multer[_0x93c7('0xf')]({'destination':function(_0x93c935,_0x13bcd1,_0xa25754){_0xa25754(null,path['join'](config[_0x93c7('0x10')],_0x93c7('0x11')));},'filename':function(_0x522fb2,_0x587bfd,_0x1e12f5){_0x587bfd[_0x93c7('0x12')]=_0x587bfd[_0x93c7('0x12')][_0x93c7('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1e12f5(null,util[_0x93c7('0x14')](_0x93c7('0x15'),path[_0x93c7('0x16')](_0x587bfd['originalname'],path[_0x93c7('0x17')](_0x587bfd[_0x93c7('0x12')])),Date['now'](),path['extname'](_0x587bfd['originalname'])));}})});router[_0x93c7('0x18')]('/',upload[_0x93c7('0x19')]('file'),controller[_0x93c7('0x1a')]);router[_0x93c7('0x1b')](_0x93c7('0xb'),auth[_0x93c7('0x9')](),controller[_0x93c7('0x1c')]);router[_0x93c7('0x1d')](_0x93c7('0xb'),auth[_0x93c7('0x9')](),controller['delete']);module['exports']=router;
\ No newline at end of file
index 383d0e0..f377a76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27bf=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x208e29,_0x2a0ba5){var _0x426f3d=function(_0x20cd05){while(--_0x20cd05){_0x208e29['push'](_0x208e29['shift']());}};_0x426f3d(++_0x2a0ba5);}(_0x27bf,0x117));var _0xf27b=function(_0x244970,_0x570c12){_0x244970=_0x244970-0x0;var _0x436885=_0x27bf[_0x244970];return _0x436885;};'use strict';var Sequelize=require(_0xf27b('0x0'));module[_0xf27b('0x1')]={'name':{'type':Sequelize[_0xf27b('0x2')],'unique':_0xf27b('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf27b('0x2')]},'display_name':{'type':Sequelize[_0xf27b('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xf27b('0x2')]},'original_format':{'type':Sequelize[_0xf27b('0x2')]},'original_duration':{'type':Sequelize[_0xf27b('0x4')]},'original_sampleCount':{'type':Sequelize[_0xf27b('0x5')]},'original_channelCount':{'type':Sequelize[_0xf27b('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xf27b('0x6')]},'converted_format':{'type':Sequelize[_0xf27b('0x2')]},'converted_duration':{'type':Sequelize[_0xf27b('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xf27b('0x5')]},'converted_channelCount':{'type':Sequelize[_0xf27b('0x6')]},'converted_bitRate':{'type':Sequelize[_0xf27b('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x0f24=['name','BIGINT','INTEGER','FLOAT','exports','STRING'];(function(_0x15bb67,_0x4f2e12){var _0x21882a=function(_0x56a8b6){while(--_0x56a8b6){_0x15bb67['push'](_0x15bb67['shift']());}};_0x21882a(++_0x4f2e12);}(_0x0f24,0xac));var _0x40f2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0f24[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x40f2('0x0')]={'name':{'type':Sequelize[_0x40f2('0x1')],'unique':_0x40f2('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x40f2('0x1')]},'display_name':{'type':Sequelize[_0x40f2('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x40f2('0x1')]},'original_format':{'type':Sequelize[_0x40f2('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x40f2('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x40f2('0x4')]},'converted_format':{'type':Sequelize[_0x40f2('0x1')]},'converted_duration':{'type':Sequelize[_0x40f2('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x40f2('0x3')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x40f2('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x40f2('0x4')]}};
\ No newline at end of file
index a7c4d42..cadce43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd694=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','save','then','destroy','get','Sounds','UserProfileResource','end','error','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','merge','VIRTUAL','options','Sound','includeAll','findAll','rows','catch','show','params','include','find','download','converted_format','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','basename','originalname','extname','filename','file','substring','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','wav','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleRate','body','role','autoAssociation','start','update','description','delete','original_format','eml-format'];(function(_0x3593c4,_0x469267){var _0x23a4d4=function(_0x4640bf){while(--_0x4640bf){_0x3593c4['push'](_0x3593c4['shift']());}};_0x23a4d4(++_0x469267);}(_0xd694,0x1c7));var _0x4d69=function(_0x34520d,_0x31419e){_0x34520d=_0x34520d-0x0;var _0x8b8eb=_0xd694[_0x34520d];return _0x8b8eb;};'use strict';var emlformat=require(_0x4d69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d69('0x1'));var jsonpatch=require(_0x4d69('0x2'));var rp=require(_0x4d69('0x3'));var moment=require(_0x4d69('0x4'));var BPromise=require(_0x4d69('0x5'));var Mustache=require(_0x4d69('0x6'));var util=require(_0x4d69('0x7'));var path=require(_0x4d69('0x8'));var sox=require(_0x4d69('0x9'));var csv=require(_0x4d69('0xa'));var ejs=require(_0x4d69('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d69('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4d69('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4d69('0xe'));var Papa=require('papaparse');var Redis=require(_0x4d69('0xf'));var authService=require(_0x4d69('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4d69('0x11'));var hardwareService=require(_0x4d69('0x12'));var logger=require(_0x4d69('0x13'))(_0x4d69('0x14'));var utils=require(_0x4d69('0x15'));var config=require(_0x4d69('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d69('0x17'))['db'];function respondWithStatusCode(_0x1f59c8,_0x20688d){_0x20688d=_0x20688d||0xcc;return function(_0x2e242c){if(_0x2e242c){return _0x1f59c8[_0x4d69('0x18')](_0x20688d);}return _0x1f59c8[_0x4d69('0x19')](_0x20688d)['end']();};}function respondWithResult(_0x3cb6f4,_0x5a3021){_0x5a3021=_0x5a3021||0xc8;return function(_0x2c686e){if(_0x2c686e){return _0x3cb6f4[_0x4d69('0x19')](_0x5a3021)[_0x4d69('0x1a')](_0x2c686e);}};}function respondWithFilteredResult(_0x4642eb,_0x40070b){return function(_0x511438){if(_0x511438){var _0x58d681=typeof _0x40070b['offset']==='undefined'&&typeof _0x40070b['limit']===_0x4d69('0x1b');var _0x5ba860=_0x511438[_0x4d69('0x1c')];var _0x2fda41=_0x58d681?0x0:_0x40070b[_0x4d69('0x1d')];var _0x5e019a=_0x58d681?_0x511438[_0x4d69('0x1c')]:_0x40070b[_0x4d69('0x1d')]+_0x40070b[_0x4d69('0x1e')];var _0x22fea3;if(_0x5e019a>=_0x5ba860){_0x5e019a=_0x5ba860;_0x22fea3=0xc8;}else{_0x22fea3=0xce;}_0x4642eb[_0x4d69('0x19')](_0x22fea3);return _0x4642eb[_0x4d69('0x1f')]('Content-Range',_0x2fda41+'-'+_0x5e019a+'/'+_0x5ba860)['json'](_0x511438);}return null;};}function patchUpdates(_0x561e37){return function(_0x3c74c6){try{jsonpatch['apply'](_0x3c74c6,_0x561e37,!![]);}catch(_0x36420){return BPromise['reject'](_0x36420);}return _0x3c74c6[_0x4d69('0x20')]();};}function saveUpdates(_0x10d249,_0x2ecae2){return function(_0x5a07c2){if(_0x5a07c2){return _0x5a07c2['update'](_0x10d249)[_0x4d69('0x21')](function(_0x53a939){return _0x53a939;});}return null;};}function removeEntity(_0x225bfa,_0x2eb2fa){return function(_0x1b269f){if(_0x1b269f){return _0x1b269f[_0x4d69('0x22')]()[_0x4d69('0x21')](function(){var _0x5731c8=_0x1b269f[_0x4d69('0x23')]({'plain':!![]});var _0x324589=_0x4d69('0x24');return db[_0x4d69('0x25')][_0x4d69('0x22')]({'where':{'type':_0x324589,'resourceId':_0x5731c8['id']}})['then'](function(){return _0x1b269f;});})[_0x4d69('0x21')](function(){_0x225bfa['status'](0xcc)[_0x4d69('0x26')]();});}};}function handleEntityNotFound(_0x107331,_0x55c978){return function(_0xd5e7e5){if(!_0xd5e7e5){_0x107331[_0x4d69('0x18')](0x194);}return _0xd5e7e5;};}function handleError(_0x405e48,_0x888b49){_0x888b49=_0x888b49||0x1f4;return function(_0xdfb444){logger[_0x4d69('0x27')](_0xdfb444['stack']);if(_0xdfb444['name']){delete _0xdfb444['name'];}_0x405e48[_0x4d69('0x19')](_0x888b49)[_0x4d69('0x28')](_0xdfb444);};}exports[_0x4d69('0x29')]=function(_0x48095f,_0x56f29b){var _0x345510={},_0x2e697f={},_0x5f0be0={'count':0x0,'rows':[]};var _0x8c1e23=_[_0x4d69('0x2a')](db['Sound'][_0x4d69('0x2b')],function(_0x1ecb15){return{'name':_0x1ecb15['fieldName'],'type':_0x1ecb15[_0x4d69('0x2c')][_0x4d69('0x2d')]};});_0x2e697f[_0x4d69('0x2e')]=_[_0x4d69('0x2a')](_0x8c1e23,_0x4d69('0x2f'));_0x2e697f[_0x4d69('0x30')]=_[_0x4d69('0x31')](_0x48095f[_0x4d69('0x30')]);_0x2e697f[_0x4d69('0x32')]=_[_0x4d69('0x33')](_0x2e697f[_0x4d69('0x2e')],_0x2e697f[_0x4d69('0x30')]);_0x345510[_0x4d69('0x34')]=_[_0x4d69('0x33')](_0x2e697f[_0x4d69('0x2e')],qs[_0x4d69('0x35')](_0x48095f[_0x4d69('0x30')][_0x4d69('0x35')]));_0x345510[_0x4d69('0x34')]=_0x345510['attributes'][_0x4d69('0x36')]?_0x345510[_0x4d69('0x34')]:_0x2e697f['model'];if(!_0x48095f['query'][_0x4d69('0x37')]('nolimit')){_0x345510[_0x4d69('0x1e')]=qs['limit'](_0x48095f[_0x4d69('0x30')][_0x4d69('0x1e')]);_0x345510[_0x4d69('0x1d')]=qs[_0x4d69('0x1d')](_0x48095f[_0x4d69('0x30')][_0x4d69('0x1d')]);}_0x345510['order']=qs['sort'](_0x48095f[_0x4d69('0x30')][_0x4d69('0x38')]);_0x345510['where']=qs[_0x4d69('0x32')](_['pick'](_0x48095f[_0x4d69('0x30')],_0x2e697f[_0x4d69('0x32')]),_0x8c1e23);if(_0x48095f[_0x4d69('0x30')][_0x4d69('0x39')]){_0x345510['where']=_[_0x4d69('0x3a')](_0x345510['where'],{'$or':_['map'](_0x8c1e23,function(_0x22d40d){if(_0x22d40d[_0x4d69('0x2c')]!==_0x4d69('0x3b')){var _0x3e6ad6={};_0x3e6ad6[_0x22d40d[_0x4d69('0x2f')]]={'$like':'%'+_0x48095f['query'][_0x4d69('0x39')]+'%'};return _0x3e6ad6;}})});}_0x345510=_[_0x4d69('0x3a')]({},_0x345510,_0x48095f[_0x4d69('0x3c')]);var _0x59ecfe={'where':_0x345510['where']};return db[_0x4d69('0x3d')][_0x4d69('0x1c')](_0x59ecfe)['then'](function(_0x1aef78){_0x5f0be0[_0x4d69('0x1c')]=_0x1aef78;if(_0x48095f[_0x4d69('0x30')][_0x4d69('0x3e')]){_0x345510['include']=[{'all':!![]}];}return db[_0x4d69('0x3d')][_0x4d69('0x3f')](_0x345510);})[_0x4d69('0x21')](function(_0x5caedb){_0x5f0be0[_0x4d69('0x40')]=_0x5caedb;return _0x5f0be0;})['then'](respondWithFilteredResult(_0x56f29b,_0x345510))[_0x4d69('0x41')](handleError(_0x56f29b,null));};exports[_0x4d69('0x42')]=function(_0x3f1b61,_0x18d25d){var _0x3a3ab5={'raw':!![],'where':{'id':_0x3f1b61[_0x4d69('0x43')]['id']}},_0x5d75b0={};_0x5d75b0[_0x4d69('0x2e')]=_[_0x4d69('0x31')](db['Sound']['rawAttributes']);_0x5d75b0[_0x4d69('0x30')]=_[_0x4d69('0x31')](_0x3f1b61['query']);_0x5d75b0[_0x4d69('0x32')]=_[_0x4d69('0x33')](_0x5d75b0[_0x4d69('0x2e')],_0x5d75b0[_0x4d69('0x30')]);_0x3a3ab5[_0x4d69('0x34')]=_[_0x4d69('0x33')](_0x5d75b0[_0x4d69('0x2e')],qs[_0x4d69('0x35')](_0x3f1b61[_0x4d69('0x30')]['fields']));_0x3a3ab5[_0x4d69('0x34')]=_0x3a3ab5[_0x4d69('0x34')][_0x4d69('0x36')]?_0x3a3ab5[_0x4d69('0x34')]:_0x5d75b0['model'];if(_0x3f1b61[_0x4d69('0x30')][_0x4d69('0x3e')]){_0x3a3ab5[_0x4d69('0x44')]=[{'all':!![]}];}_0x3a3ab5=_[_0x4d69('0x3a')]({},_0x3a3ab5,_0x3f1b61[_0x4d69('0x3c')]);return db['Sound'][_0x4d69('0x45')](_0x3a3ab5)[_0x4d69('0x21')](handleEntityNotFound(_0x18d25d,null))[_0x4d69('0x21')](respondWithResult(_0x18d25d,null))['catch'](handleError(_0x18d25d,null));};exports[_0x4d69('0x46')]=function(_0x11b176,_0x31f553,_0x49bc0e){return db[_0x4d69('0x3d')]['find']({'where':{'id':_0x11b176['params']['id']},'attributes':[_0x4d69('0x2f'),'save_name',_0x4d69('0x47')],'raw':!![]})[_0x4d69('0x21')](handleEntityNotFound(_0x31f553,null))[_0x4d69('0x21')](function(_0x5de20e){if(_0x5de20e){if(!fs['existsSync'](path['join'](config[_0x4d69('0x48')],_0x4d69('0x49'),_0x5de20e[_0x4d69('0x4a')]+'.'+_0x5de20e[_0x4d69('0x47')]))){throw new db[(_0x4d69('0x4b'))][(_0x4d69('0x4c'))](_0x4d69('0x4d'));}return _0x31f553[_0x4d69('0x46')](path[_0x4d69('0x4e')](config[_0x4d69('0x48')],_0x4d69('0x49'),util[_0x4d69('0x4f')]('%s.%s',_0x5de20e['save_name'],_0x5de20e[_0x4d69('0x47')])),util[_0x4d69('0x4f')](_0x4d69('0x50'),_0x5de20e[_0x4d69('0x2f')],_0x5de20e[_0x4d69('0x47')]));}return null;})[_0x4d69('0x41')](handleError(_0x31f553,null));};exports[_0x4d69('0x51')]=function(_0x8518d3,_0x1a6026,_0x3a5f38){var _0x2f1efe={'name':path[_0x4d69('0x52')](_0x8518d3['file'][_0x4d69('0x53')],path[_0x4d69('0x54')](_0x8518d3['file'][_0x4d69('0x53')])),'save_name':path['basename'](_0x8518d3['file'][_0x4d69('0x55')],path[_0x4d69('0x54')](_0x8518d3['file']['filename'])),'original_format':path[_0x4d69('0x54')](_0x8518d3[_0x4d69('0x56')]['originalname'])[_0x4d69('0x57')](0x1),'converted_format':'wav'};var _0x4805af=path[_0x4d69('0x4e')](config[_0x4d69('0x48')],'server/files/sounds/original',_0x8518d3[_0x4d69('0x56')]['filename']);var _0x190d72=path[_0x4d69('0x4e')](config[_0x4d69('0x48')],_0x4d69('0x49'),util[_0x4d69('0x4f')](_0x4d69('0x50'),path[_0x4d69('0x52')](_0x8518d3['file']['filename'],path[_0x4d69('0x54')](_0x8518d3[_0x4d69('0x56')][_0x4d69('0x55')])),_0x2f1efe[_0x4d69('0x47')]));logger[_0x4d69('0x58')]('Sound\x20upload\x20filepath:\x20%s',_0x4805af);logger[_0x4d69('0x58')](_0x4d69('0x59'),_0x190d72);try{fs[_0x4d69('0x5a')](_0x4805af,parseInt(_0x4d69('0x5b'),0x8));var _0x4b69b9=sox['transcode'](_0x4805af,_0x190d72,{'sampleRate':0x1f40,'format':_0x4d69('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4b69b9['on'](_0x4d69('0x27'),function(_0x3babf5){fs[_0x4d69('0x5d')](_0x4805af);_0x1a6026[_0x4d69('0x19')](0x1f4)[_0x4d69('0x28')](_0x3babf5);});_0x4b69b9['on'](_0x4d69('0x5e'),function(_0x14300f){_0x2f1efe[_0x4d69('0x5f')]=isNaN(_0x14300f[_0x4d69('0x60')])?null:_0x14300f['duration']*0x3e8;_0x2f1efe['original_sampleCount']=isNaN(_0x14300f[_0x4d69('0x61')])?null:_0x14300f[_0x4d69('0x61')];_0x2f1efe[_0x4d69('0x62')]=isNaN(_0x14300f[_0x4d69('0x63')])?null:_0x14300f['channelCount'];_0x2f1efe[_0x4d69('0x64')]=isNaN(_0x14300f[_0x4d69('0x65')])?null:_0x14300f[_0x4d69('0x65')];_0x2f1efe[_0x4d69('0x66')]=isNaN(_0x14300f['sampleRate'])?null:_0x14300f[_0x4d69('0x67')];});_0x4b69b9['on'](_0x4d69('0x68'),function(_0x4224d8){_0x2f1efe['converted_duration']=isNaN(_0x4224d8[_0x4d69('0x60')])?null:_0x4224d8['duration']*0x3e8;_0x2f1efe['converted_sampleCount']=isNaN(_0x4224d8[_0x4d69('0x61')])?null:_0x4224d8['sampleCount'];_0x2f1efe['converted_channelCount']=isNaN(_0x4224d8[_0x4d69('0x63')])?null:_0x4224d8[_0x4d69('0x63')];_0x2f1efe['converted_bitRate']=isNaN(_0x4224d8[_0x4d69('0x65')])?null:_0x4224d8[_0x4d69('0x65')];_0x2f1efe[_0x4d69('0x69')]=isNaN(_0x4224d8[_0x4d69('0x67')])?null:_0x4224d8[_0x4d69('0x67')];});_0x4b69b9['on']('end',function(){fs[_0x4d69('0x5a')](_0x190d72,parseInt(_0x4d69('0x5b'),0x8));return db[_0x4d69('0x3d')][_0x4d69('0x51')](_0x2f1efe)[_0x4d69('0x21')](function(_0x3206ff){var _0x310d78={'role':_0x8518d3['body']['role'],'userProfileId':_0x8518d3[_0x4d69('0x6a')]['userProfileId']};if(!_0x310d78)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x310d78[_0x4d69('0x6b')]==='user'){var _0x40891f=_0x3206ff[_0x4d69('0x23')]({'plain':!![]});return db['UserProfileSection'][_0x4d69('0x45')]({'where':{'name':_0x4d69('0x24'),'userProfileId':_0x310d78['userProfileId']},'raw':!![]})['then'](function(_0x55c21b){if(_0x55c21b&&_0x55c21b[_0x4d69('0x6c')]===0x0){return db[_0x4d69('0x25')][_0x4d69('0x51')]({'name':_0x40891f[_0x4d69('0x2f')],'resourceId':_0x40891f['id'],'type':_0x55c21b[_0x4d69('0x2f')],'sectionId':_0x55c21b['id']},{})[_0x4d69('0x21')](function(){return _0x3206ff;});}else{return _0x3206ff;}})[_0x4d69('0x41')](function(_0x53386c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53386c);throw _0x53386c;});}return _0x3206ff;})[_0x4d69('0x21')](respondWithResult(_0x1a6026,null))[_0x4d69('0x41')](handleError(_0x1a6026,null));});_0x4b69b9[_0x4d69('0x6d')]();}catch(_0x371b3a){_0x1a6026[_0x4d69('0x19')](0x1f4)['send'](_0x371b3a);}};exports[_0x4d69('0x6e')]=function(_0x21ec83,_0xadd804,_0x5655ba){return db['Sound'][_0x4d69('0x45')]({'where':{'id':_0x21ec83['params']['id']}})[_0x4d69('0x21')](handleEntityNotFound(_0xadd804,null))['then'](saveUpdates(_['pick'](_0x21ec83[_0x4d69('0x6a')],[_0x4d69('0x2f'),_0x4d69('0x6f')]),null))[_0x4d69('0x21')](respondWithResult(_0xadd804,null))['catch'](handleError(_0xadd804,null));};exports[_0x4d69('0x70')]=function(_0xd3b90f,_0xe4336,_0xdb760d){return db[_0x4d69('0x3d')]['find']({'where':{'id':_0xd3b90f[_0x4d69('0x43')]['id']}})[_0x4d69('0x21')](function(_0x7bb651){if(_0x7bb651){return _0x7bb651['destroy']();}})[_0x4d69('0x21')](function(_0x38923f){var _0x605c1d=path[_0x4d69('0x4e')](config['root'],'server/files/sounds/original',util['format'](_0x4d69('0x50'),_0x38923f['save_name'],_0x38923f[_0x4d69('0x71')]));var _0x1b63f8=path['join'](config['root'],_0x4d69('0x49'),util[_0x4d69('0x4f')](_0x4d69('0x50'),_0x38923f[_0x4d69('0x4a')],_0x38923f[_0x4d69('0x47')]));fs[_0x4d69('0x5d')](_0x605c1d);fs[_0x4d69('0x5d')](_0x1b63f8);return _0x38923f;})[_0x4d69('0x21')](function(_0x2d4a0c){if(_0x2d4a0c){return _0xe4336[_0x4d69('0x19')](0xcc)[_0x4d69('0x26')]();}})[_0x4d69('0x21')](handleEntityNotFound(_0xe4336,null))[_0x4d69('0x41')](handleError(_0xe4336,null));};
\ No newline at end of file
+var _0x9652=['request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','end','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','params','keys','options','find','download','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','original_duration','duration','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','sampleCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','start','description','original_format','unlinkSync','eml-format','zip-dir','fast-json-patch'];(function(_0x5e5e96,_0x23d042){var _0x5ce55d=function(_0x2e799c){while(--_0x2e799c){_0x5e5e96['push'](_0x5e5e96['shift']());}};_0x5ce55d(++_0x23d042);}(_0x9652,0x177));var _0x2965=function(_0xc93161,_0x347e90){_0xc93161=_0xc93161-0x0;var _0x13c4f0=_0x9652[_0xc93161];return _0x13c4f0;};'use strict';var emlformat=require(_0x2965('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2965('0x1'));var jsonpatch=require(_0x2965('0x2'));var rp=require(_0x2965('0x3'));var moment=require(_0x2965('0x4'));var BPromise=require(_0x2965('0x5'));var Mustache=require(_0x2965('0x6'));var util=require(_0x2965('0x7'));var path=require(_0x2965('0x8'));var sox=require(_0x2965('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2965('0xa'));var _=require(_0x2965('0xb'));var squel=require(_0x2965('0xc'));var crypto=require(_0x2965('0xd'));var jsforce=require(_0x2965('0xe'));var deskjs=require(_0x2965('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2965('0x10'));var Papa=require('papaparse');var Redis=require(_0x2965('0x11'));var authService=require(_0x2965('0x12'));var qs=require(_0x2965('0x13'));var as=require(_0x2965('0x14'));var hardwareService=require(_0x2965('0x15'));var logger=require(_0x2965('0x16'))(_0x2965('0x17'));var utils=require(_0x2965('0x18'));var config=require(_0x2965('0x19'));var licenseUtil=require(_0x2965('0x1a'));var db=require(_0x2965('0x1b'))['db'];function respondWithStatusCode(_0xe73017,_0x836d7e){_0x836d7e=_0x836d7e||0xcc;return function(_0x1da2a3){if(_0x1da2a3){return _0xe73017[_0x2965('0x1c')](_0x836d7e);}return _0xe73017[_0x2965('0x1d')](_0x836d7e)['end']();};}function respondWithResult(_0x1eeff5,_0x2d1a1f){_0x2d1a1f=_0x2d1a1f||0xc8;return function(_0x337e87){if(_0x337e87){return _0x1eeff5[_0x2965('0x1d')](_0x2d1a1f)[_0x2965('0x1e')](_0x337e87);}};}function respondWithFilteredResult(_0x5d3df7,_0x314013){return function(_0x119e35){if(_0x119e35){var _0x5a48df=typeof _0x314013[_0x2965('0x1f')]===_0x2965('0x20')&&typeof _0x314013['limit']==='undefined';var _0x265f11=_0x119e35['count'];var _0x3c7333=_0x5a48df?0x0:_0x314013['offset'];var _0xa49a2d=_0x5a48df?_0x119e35[_0x2965('0x21')]:_0x314013[_0x2965('0x1f')]+_0x314013[_0x2965('0x22')];var _0x5702bd;if(_0xa49a2d>=_0x265f11){_0xa49a2d=_0x265f11;_0x5702bd=0xc8;}else{_0x5702bd=0xce;}_0x5d3df7[_0x2965('0x1d')](_0x5702bd);return _0x5d3df7[_0x2965('0x23')]('Content-Range',_0x3c7333+'-'+_0xa49a2d+'/'+_0x265f11)['json'](_0x119e35);}return null;};}function patchUpdates(_0x13d783){return function(_0xb54f03){try{jsonpatch[_0x2965('0x24')](_0xb54f03,_0x13d783,!![]);}catch(_0x2ebaca){return BPromise[_0x2965('0x25')](_0x2ebaca);}return _0xb54f03[_0x2965('0x26')]();};}function saveUpdates(_0x35e2ba,_0x35b2b9){return function(_0x16ec15){if(_0x16ec15){return _0x16ec15[_0x2965('0x27')](_0x35e2ba)[_0x2965('0x28')](function(_0x35f12d){return _0x35f12d;});}return null;};}function removeEntity(_0x5516e1,_0x1ad48b){return function(_0x4d5d75){if(_0x4d5d75){return _0x4d5d75[_0x2965('0x29')]()[_0x2965('0x28')](function(){var _0x6d55f1=_0x4d5d75[_0x2965('0x2a')]({'plain':!![]});var _0x39a609=_0x2965('0x2b');return db[_0x2965('0x2c')][_0x2965('0x29')]({'where':{'type':_0x39a609,'resourceId':_0x6d55f1['id']}})[_0x2965('0x28')](function(){return _0x4d5d75;});})['then'](function(){_0x5516e1[_0x2965('0x1d')](0xcc)[_0x2965('0x2d')]();});}};}function handleEntityNotFound(_0x27a313,_0x5d979a){return function(_0xbe32c3){if(!_0xbe32c3){_0x27a313[_0x2965('0x1c')](0x194);}return _0xbe32c3;};}function handleError(_0x726725,_0xa57657){_0xa57657=_0xa57657||0x1f4;return function(_0x11ae78){logger[_0x2965('0x2e')](_0x11ae78[_0x2965('0x2f')]);if(_0x11ae78[_0x2965('0x30')]){delete _0x11ae78[_0x2965('0x30')];}_0x726725[_0x2965('0x1d')](_0xa57657)[_0x2965('0x31')](_0x11ae78);};}exports[_0x2965('0x32')]=function(_0x292784,_0x245017){var _0x3b9c48={},_0x370507={},_0x1a77c2={'count':0x0,'rows':[]};var _0x458878=_[_0x2965('0x33')](db[_0x2965('0x34')][_0x2965('0x35')],function(_0x28eb83){return{'name':_0x28eb83[_0x2965('0x36')],'type':_0x28eb83[_0x2965('0x37')][_0x2965('0x38')]};});_0x370507[_0x2965('0x39')]=_[_0x2965('0x33')](_0x458878,_0x2965('0x30'));_0x370507['query']=_['keys'](_0x292784['query']);_0x370507[_0x2965('0x3a')]=_['intersection'](_0x370507[_0x2965('0x39')],_0x370507[_0x2965('0x3b')]);_0x3b9c48[_0x2965('0x3c')]=_[_0x2965('0x3d')](_0x370507[_0x2965('0x39')],qs['fields'](_0x292784[_0x2965('0x3b')][_0x2965('0x3e')]));_0x3b9c48[_0x2965('0x3c')]=_0x3b9c48['attributes'][_0x2965('0x3f')]?_0x3b9c48['attributes']:_0x370507['model'];if(!_0x292784[_0x2965('0x3b')][_0x2965('0x40')](_0x2965('0x41'))){_0x3b9c48['limit']=qs[_0x2965('0x22')](_0x292784['query'][_0x2965('0x22')]);_0x3b9c48[_0x2965('0x1f')]=qs[_0x2965('0x1f')](_0x292784['query'][_0x2965('0x1f')]);}_0x3b9c48['order']=qs['sort'](_0x292784[_0x2965('0x3b')][_0x2965('0x42')]);_0x3b9c48[_0x2965('0x43')]=qs[_0x2965('0x3a')](_[_0x2965('0x44')](_0x292784[_0x2965('0x3b')],_0x370507[_0x2965('0x3a')]),_0x458878);if(_0x292784[_0x2965('0x3b')][_0x2965('0x45')]){_0x3b9c48[_0x2965('0x43')]=_[_0x2965('0x46')](_0x3b9c48[_0x2965('0x43')],{'$or':_[_0x2965('0x33')](_0x458878,function(_0x5d110b){if(_0x5d110b[_0x2965('0x37')]!==_0x2965('0x47')){var _0x276c4e={};_0x276c4e[_0x5d110b['name']]={'$like':'%'+_0x292784[_0x2965('0x3b')]['filter']+'%'};return _0x276c4e;}})});}_0x3b9c48=_[_0x2965('0x46')]({},_0x3b9c48,_0x292784['options']);var _0x5e1b8e={'where':_0x3b9c48[_0x2965('0x43')]};return db[_0x2965('0x34')][_0x2965('0x21')](_0x5e1b8e)['then'](function(_0x236464){_0x1a77c2[_0x2965('0x21')]=_0x236464;if(_0x292784[_0x2965('0x3b')]['includeAll']){_0x3b9c48[_0x2965('0x48')]=[{'all':!![]}];}return db[_0x2965('0x34')][_0x2965('0x49')](_0x3b9c48);})['then'](function(_0x4b5053){_0x1a77c2['rows']=_0x4b5053;return _0x1a77c2;})['then'](respondWithFilteredResult(_0x245017,_0x3b9c48))[_0x2965('0x4a')](handleError(_0x245017,null));};exports['show']=function(_0xe72a51,_0x8b484){var _0x4585c7={'raw':!![],'where':{'id':_0xe72a51[_0x2965('0x4b')]['id']}},_0x4ffe57={};_0x4ffe57[_0x2965('0x39')]=_[_0x2965('0x4c')](db[_0x2965('0x34')][_0x2965('0x35')]);_0x4ffe57['query']=_[_0x2965('0x4c')](_0xe72a51[_0x2965('0x3b')]);_0x4ffe57[_0x2965('0x3a')]=_[_0x2965('0x3d')](_0x4ffe57[_0x2965('0x39')],_0x4ffe57[_0x2965('0x3b')]);_0x4585c7['attributes']=_[_0x2965('0x3d')](_0x4ffe57[_0x2965('0x39')],qs[_0x2965('0x3e')](_0xe72a51[_0x2965('0x3b')][_0x2965('0x3e')]));_0x4585c7[_0x2965('0x3c')]=_0x4585c7[_0x2965('0x3c')]['length']?_0x4585c7[_0x2965('0x3c')]:_0x4ffe57['model'];if(_0xe72a51[_0x2965('0x3b')]['includeAll']){_0x4585c7[_0x2965('0x48')]=[{'all':!![]}];}_0x4585c7=_[_0x2965('0x46')]({},_0x4585c7,_0xe72a51[_0x2965('0x4d')]);return db[_0x2965('0x34')][_0x2965('0x4e')](_0x4585c7)[_0x2965('0x28')](handleEntityNotFound(_0x8b484,null))[_0x2965('0x28')](respondWithResult(_0x8b484,null))[_0x2965('0x4a')](handleError(_0x8b484,null));};exports[_0x2965('0x4f')]=function(_0x3c256b,_0x3a3867,_0x112999){return db['Sound'][_0x2965('0x4e')]({'where':{'id':_0x3c256b[_0x2965('0x4b')]['id']},'attributes':[_0x2965('0x30'),'save_name',_0x2965('0x50')],'raw':!![]})[_0x2965('0x28')](handleEntityNotFound(_0x3a3867,null))[_0x2965('0x28')](function(_0x21c58c){if(_0x21c58c){if(!fs[_0x2965('0x51')](path[_0x2965('0x52')](config[_0x2965('0x53')],_0x2965('0x54'),_0x21c58c[_0x2965('0x55')]+'.'+_0x21c58c[_0x2965('0x50')]))){throw new db[(_0x2965('0x56'))][(_0x2965('0x57'))](_0x2965('0x58'));}return _0x3a3867[_0x2965('0x4f')](path[_0x2965('0x52')](config[_0x2965('0x53')],_0x2965('0x54'),util[_0x2965('0x59')](_0x2965('0x5a'),_0x21c58c[_0x2965('0x55')],_0x21c58c[_0x2965('0x50')])),util[_0x2965('0x59')](_0x2965('0x5a'),_0x21c58c[_0x2965('0x30')],_0x21c58c[_0x2965('0x50')]));}return null;})[_0x2965('0x4a')](handleError(_0x3a3867,null));};exports[_0x2965('0x5b')]=function(_0x583ec4,_0x5b706b,_0x94068c){var _0x313668={'name':path[_0x2965('0x5c')](_0x583ec4[_0x2965('0x5d')][_0x2965('0x5e')],path[_0x2965('0x5f')](_0x583ec4['file']['originalname'])),'save_name':path[_0x2965('0x5c')](_0x583ec4[_0x2965('0x5d')][_0x2965('0x60')],path['extname'](_0x583ec4[_0x2965('0x5d')][_0x2965('0x60')])),'original_format':path[_0x2965('0x5f')](_0x583ec4[_0x2965('0x5d')][_0x2965('0x5e')])[_0x2965('0x61')](0x1),'converted_format':_0x2965('0x62')};var _0x758203=path[_0x2965('0x52')](config['root'],_0x2965('0x63'),_0x583ec4['file'][_0x2965('0x60')]);var _0x528cd4=path[_0x2965('0x52')](config[_0x2965('0x53')],_0x2965('0x54'),util[_0x2965('0x59')]('%s.%s',path[_0x2965('0x5c')](_0x583ec4[_0x2965('0x5d')][_0x2965('0x60')],path[_0x2965('0x5f')](_0x583ec4[_0x2965('0x5d')]['filename'])),_0x313668['converted_format']));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x758203);logger[_0x2965('0x64')](_0x2965('0x65'),_0x528cd4);try{fs[_0x2965('0x66')](_0x758203,parseInt(_0x2965('0x67'),0x8));var _0x42f64c=sox[_0x2965('0x68')](_0x758203,_0x528cd4,{'sampleRate':0x1f40,'format':_0x2965('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x42f64c['on'](_0x2965('0x2e'),function(_0x59f15e){fs['unlinkSync'](_0x758203);_0x5b706b[_0x2965('0x1d')](0x1f4)[_0x2965('0x31')](_0x59f15e);});_0x42f64c['on']('src',function(_0x22a793){_0x313668[_0x2965('0x69')]=isNaN(_0x22a793['duration'])?null:_0x22a793[_0x2965('0x6a')]*0x3e8;_0x313668['original_sampleCount']=isNaN(_0x22a793['sampleCount'])?null:_0x22a793['sampleCount'];_0x313668[_0x2965('0x6b')]=isNaN(_0x22a793[_0x2965('0x6c')])?null:_0x22a793[_0x2965('0x6c')];_0x313668[_0x2965('0x6d')]=isNaN(_0x22a793[_0x2965('0x6e')])?null:_0x22a793[_0x2965('0x6e')];_0x313668[_0x2965('0x6f')]=isNaN(_0x22a793['sampleRate'])?null:_0x22a793[_0x2965('0x70')];});_0x42f64c['on']('dest',function(_0x302ffb){_0x313668['converted_duration']=isNaN(_0x302ffb[_0x2965('0x6a')])?null:_0x302ffb[_0x2965('0x6a')]*0x3e8;_0x313668['converted_sampleCount']=isNaN(_0x302ffb[_0x2965('0x71')])?null:_0x302ffb[_0x2965('0x71')];_0x313668['converted_channelCount']=isNaN(_0x302ffb[_0x2965('0x6c')])?null:_0x302ffb[_0x2965('0x6c')];_0x313668[_0x2965('0x72')]=isNaN(_0x302ffb[_0x2965('0x6e')])?null:_0x302ffb[_0x2965('0x6e')];_0x313668[_0x2965('0x73')]=isNaN(_0x302ffb[_0x2965('0x70')])?null:_0x302ffb['sampleRate'];});_0x42f64c['on'](_0x2965('0x2d'),function(){fs[_0x2965('0x66')](_0x528cd4,parseInt('0777',0x8));return db[_0x2965('0x34')][_0x2965('0x5b')](_0x313668)[_0x2965('0x28')](function(_0x28b3d3){var _0x1ffd6d={'role':_0x583ec4[_0x2965('0x74')]['role'],'userProfileId':_0x583ec4[_0x2965('0x74')][_0x2965('0x75')]};if(!_0x1ffd6d)throw new Error(_0x2965('0x76'));if(_0x1ffd6d[_0x2965('0x77')]==='user'){var _0x338b5f=_0x28b3d3[_0x2965('0x2a')]({'plain':!![]});return db[_0x2965('0x78')][_0x2965('0x4e')]({'where':{'name':'Sounds','userProfileId':_0x1ffd6d[_0x2965('0x75')]},'raw':!![]})[_0x2965('0x28')](function(_0xa4857e){if(_0xa4857e&&_0xa4857e[_0x2965('0x79')]===0x0){return db['UserProfileResource']['create']({'name':_0x338b5f[_0x2965('0x30')],'resourceId':_0x338b5f['id'],'type':_0xa4857e[_0x2965('0x30')],'sectionId':_0xa4857e['id']},{})['then'](function(){return _0x28b3d3;});}else{return _0x28b3d3;}})[_0x2965('0x4a')](function(_0x12273c){logger[_0x2965('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12273c);throw _0x12273c;});}return _0x28b3d3;})[_0x2965('0x28')](respondWithResult(_0x5b706b,null))[_0x2965('0x4a')](handleError(_0x5b706b,null));});_0x42f64c[_0x2965('0x7a')]();}catch(_0x38814a){_0x5b706b[_0x2965('0x1d')](0x1f4)[_0x2965('0x31')](_0x38814a);}};exports[_0x2965('0x27')]=function(_0xabc03d,_0x371c30,_0x30265d){return db['Sound'][_0x2965('0x4e')]({'where':{'id':_0xabc03d[_0x2965('0x4b')]['id']}})[_0x2965('0x28')](handleEntityNotFound(_0x371c30,null))[_0x2965('0x28')](saveUpdates(_[_0x2965('0x44')](_0xabc03d[_0x2965('0x74')],[_0x2965('0x30'),_0x2965('0x7b')]),null))['then'](respondWithResult(_0x371c30,null))[_0x2965('0x4a')](handleError(_0x371c30,null));};exports['delete']=function(_0xee8c10,_0x50baa7,_0x263323){return db['Sound']['find']({'where':{'id':_0xee8c10[_0x2965('0x4b')]['id']}})['then'](function(_0x5b5488){if(_0x5b5488){return _0x5b5488['destroy']();}})[_0x2965('0x28')](function(_0xa5c75){var _0x55e5f3=path[_0x2965('0x52')](config[_0x2965('0x53')],_0x2965('0x63'),util[_0x2965('0x59')](_0x2965('0x5a'),_0xa5c75[_0x2965('0x55')],_0xa5c75[_0x2965('0x7c')]));var _0x1ffd90=path[_0x2965('0x52')](config[_0x2965('0x53')],_0x2965('0x54'),util[_0x2965('0x59')](_0x2965('0x5a'),_0xa5c75[_0x2965('0x55')],_0xa5c75[_0x2965('0x50')]));fs[_0x2965('0x7d')](_0x55e5f3);fs[_0x2965('0x7d')](_0x1ffd90);return _0xa5c75;})[_0x2965('0x28')](function(_0x16dd42){if(_0x16dd42){return _0x50baa7[_0x2965('0x1d')](0xcc)[_0x2965('0x2d')]();}})[_0x2965('0x28')](handleEntityNotFound(_0x50baa7,null))[_0x2965('0x4a')](handleError(_0x50baa7,null));};
\ No newline at end of file
index 1842acf..21a372b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c4a=['bluebird','request-promise','path','rimraf','./sound.attributes','define','tools_sounds','lodash','util','../../config/logger','api','moment'];(function(_0x499fb7,_0x4c698f){var _0x147631=function(_0x189977){while(--_0x189977){_0x499fb7['push'](_0x499fb7['shift']());}};_0x147631(++_0x4c698f);}(_0x3c4a,0x73));var _0xa3c4=function(_0x24059d,_0x1fb57f){_0x24059d=_0x24059d-0x0;var _0x43e7ea=_0x3c4a[_0x24059d];return _0x43e7ea;};'use strict';var _=require(_0xa3c4('0x0'));var util=require(_0xa3c4('0x1'));var logger=require(_0xa3c4('0x2'))(_0xa3c4('0x3'));var moment=require(_0xa3c4('0x4'));var BPromise=require(_0xa3c4('0x5'));var rp=require(_0xa3c4('0x6'));var fs=require('fs');var path=require(_0xa3c4('0x7'));var rimraf=require(_0xa3c4('0x8'));var config=require('../../config/environment');var attributes=require(_0xa3c4('0x9'));module['exports']=function(_0xba9b42,_0x5ed89f){return _0xba9b42[_0xa3c4('0xa')]('Sound',attributes,{'tableName':_0xa3c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2e8a=['request-promise','path','rimraf','./sound.attributes','exports','Sound','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3a7633,_0x557d68){var _0x30113c=function(_0x572f4c){while(--_0x572f4c){_0x3a7633['push'](_0x3a7633['shift']());}};_0x30113c(++_0x557d68);}(_0x2e8a,0x19d));var _0xa2e8=function(_0x512980,_0x401e50){_0x512980=_0x512980-0x0;var _0x571f0a=_0x2e8a[_0x512980];return _0x571f0a;};'use strict';var _=require(_0xa2e8('0x0'));var util=require(_0xa2e8('0x1'));var logger=require(_0xa2e8('0x2'))('api');var moment=require(_0xa2e8('0x3'));var BPromise=require(_0xa2e8('0x4'));var rp=require(_0xa2e8('0x5'));var fs=require('fs');var path=require(_0xa2e8('0x6'));var rimraf=require(_0xa2e8('0x7'));var config=require('../../config/environment');var attributes=require(_0xa2e8('0x8'));module[_0xa2e8('0x9')]=function(_0x3c59c2,_0x42290f){return _0x3c59c2['define'](_0xa2e8('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b90677c..6394b49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2189=['stringify','error','code','message','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s'];(function(_0x36789b,_0x273122){var _0x5d5cc4=function(_0xaa7e2){while(--_0xaa7e2){_0x36789b['push'](_0x36789b['shift']());}};_0x5d5cc4(++_0x273122);}(_0x2189,0x69));var _0x9218=function(_0x2bdd51,_0x44713e){_0x2bdd51=_0x2bdd51-0x0;var _0x5a6098=_0x2189[_0x2bdd51];return _0x5a6098;};'use strict';var _=require(_0x9218('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9218('0x1'));var fs=require('fs');var Redis=require(_0x9218('0x2'));var db=require(_0x9218('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9218('0x4'));var config=require(_0x9218('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x9218('0x6')][_0x9218('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3fe3fb,_0x3461dd,_0x4b824c){return new BPromise(function(_0x4388dd,_0x405455){return client[_0x9218('0x8')](_0x3fe3fb,_0x4b824c)[_0x9218('0x9')](function(_0x404649){logger[_0x9218('0xa')](_0x9218('0xb'),_0x3461dd,_0x9218('0xc'));logger[_0x9218('0xd')](_0x9218('0xe'),_0x3461dd,_0x9218('0xc'),JSON[_0x9218('0xf')](_0x404649));if(_0x404649['error']){if(_0x404649[_0x9218('0x10')][_0x9218('0x11')]===0x1f4){logger[_0x9218('0x10')](_0x9218('0xb'),_0x3461dd,_0x404649[_0x9218('0x10')][_0x9218('0x12')]);return _0x405455(_0x404649[_0x9218('0x10')][_0x9218('0x12')]);}logger[_0x9218('0x10')](_0x9218('0xb'),_0x3461dd,_0x404649[_0x9218('0x10')][_0x9218('0x12')]);return _0x4388dd(_0x404649[_0x9218('0x10')][_0x9218('0x12')]);}else{logger[_0x9218('0xa')](_0x9218('0xb'),_0x3461dd,_0x9218('0xc'));_0x4388dd(_0x404649[_0x9218('0x13')][_0x9218('0x12')]);}})[_0x9218('0x14')](function(_0x53ef20){logger[_0x9218('0x10')](_0x9218('0xb'),_0x3461dd,_0x53ef20);_0x405455(_0x53ef20);});});}exports[_0x9218('0x15')]=function(_0x56012c){var _0xa7df8d=this;return new Promise(function(_0x198897,_0x5f32fe){return db['Sound'][_0x9218('0x16')]({'raw':_0x56012c[_0x9218('0x17')]?_0x56012c['options'][_0x9218('0x18')]===undefined?!![]:![]:!![],'where':_0x56012c[_0x9218('0x17')]?_0x56012c[_0x9218('0x17')][_0x9218('0x19')]||null:null,'attributes':_0x56012c['options']?_0x56012c[_0x9218('0x17')][_0x9218('0x1a')]||null:null,'include':_0x56012c[_0x9218('0x17')]?_0x56012c['options'][_0x9218('0x1b')]?_[_0x9218('0x1c')](_0x56012c[_0x9218('0x17')]['include'],function(_0x528eae){return{'model':db[_0x528eae[_0x9218('0x1d')]],'as':_0x528eae['as'],'attributes':_0x528eae[_0x9218('0x1a')],'include':_0x528eae[_0x9218('0x1b')]?_[_0x9218('0x1c')](_0x528eae['include'],function(_0x48a1dd){return{'model':db[_0x48a1dd[_0x9218('0x1d')]],'as':_0x48a1dd['as'],'attributes':_0x48a1dd[_0x9218('0x1a')],'include':_0x48a1dd['include']?_['map'](_0x48a1dd[_0x9218('0x1b')],function(_0x4a9ad1){return{'model':db[_0x4a9ad1[_0x9218('0x1d')]],'as':_0x4a9ad1['as'],'attributes':_0x4a9ad1['attributes']};}):[]};}):[]};}):[]:[]})[_0x9218('0x9')](function(_0x35fa73){logger[_0x9218('0xa')](_0x9218('0x15'),_0x56012c);logger[_0x9218('0xd')](_0x9218('0x15'),_0x56012c,JSON[_0x9218('0xf')](_0x35fa73));_0x198897(_0x35fa73);})[_0x9218('0x14')](function(_0x39e671){logger[_0x9218('0x10')](_0x9218('0x15'),_0x39e671[_0x9218('0x12')],_0x56012c);_0x5f32fe(_0xa7df8d[_0x9218('0x10')](0x1f4,_0x39e671[_0x9218('0x12')]));});});};
\ No newline at end of file
+var _0x2387=['debug','error','code','message','catch','ShowSound','Sound','find','options','raw','include','model','attributes','map','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent'];(function(_0xe86a2b,_0x31f167){var _0xd97c45=function(_0x554916){while(--_0x554916){_0xe86a2b['push'](_0xe86a2b['shift']());}};_0xd97c45(++_0x31f167);}(_0x2387,0x7f));var _0x7238=function(_0x75663b,_0x5853b2){_0x75663b=_0x75663b-0x0;var _0xebcdf=_0x2387[_0x75663b];return _0xebcdf;};'use strict';var _=require(_0x7238('0x0'));var util=require('util');var moment=require(_0x7238('0x1'));var BPromise=require(_0x7238('0x2'));var rs=require(_0x7238('0x3'));var fs=require('fs');var Redis=require(_0x7238('0x4'));var db=require(_0x7238('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7238('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7238('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x10a9cb,_0x242627,_0x5d7902){return new BPromise(function(_0x12db77,_0x16dd2b){return client[_0x7238('0x8')](_0x10a9cb,_0x5d7902)[_0x7238('0x9')](function(_0x289e43){logger[_0x7238('0xa')](_0x7238('0xb'),_0x242627,_0x7238('0xc'));logger[_0x7238('0xd')]('Sound,\x20%s,\x20%s,\x20%s',_0x242627,_0x7238('0xc'),JSON['stringify'](_0x289e43));if(_0x289e43[_0x7238('0xe')]){if(_0x289e43[_0x7238('0xe')][_0x7238('0xf')]===0x1f4){logger[_0x7238('0xe')](_0x7238('0xb'),_0x242627,_0x289e43[_0x7238('0xe')]['message']);return _0x16dd2b(_0x289e43[_0x7238('0xe')]['message']);}logger['error'](_0x7238('0xb'),_0x242627,_0x289e43[_0x7238('0xe')][_0x7238('0x10')]);return _0x12db77(_0x289e43[_0x7238('0xe')][_0x7238('0x10')]);}else{logger[_0x7238('0xa')](_0x7238('0xb'),_0x242627,_0x7238('0xc'));_0x12db77(_0x289e43['result'][_0x7238('0x10')]);}})[_0x7238('0x11')](function(_0x5c501b){logger[_0x7238('0xe')](_0x7238('0xb'),_0x242627,_0x5c501b);_0x16dd2b(_0x5c501b);});});}exports[_0x7238('0x12')]=function(_0x3ef1a1){var _0x5594bb=this;return new Promise(function(_0x1eff21,_0x34b66f){return db[_0x7238('0x13')][_0x7238('0x14')]({'raw':_0x3ef1a1['options']?_0x3ef1a1[_0x7238('0x15')][_0x7238('0x16')]===undefined?!![]:![]:!![],'where':_0x3ef1a1[_0x7238('0x15')]?_0x3ef1a1[_0x7238('0x15')]['where']||null:null,'attributes':_0x3ef1a1[_0x7238('0x15')]?_0x3ef1a1[_0x7238('0x15')]['attributes']||null:null,'include':_0x3ef1a1['options']?_0x3ef1a1[_0x7238('0x15')][_0x7238('0x17')]?_['map'](_0x3ef1a1[_0x7238('0x15')]['include'],function(_0x1f89f6){return{'model':db[_0x1f89f6[_0x7238('0x18')]],'as':_0x1f89f6['as'],'attributes':_0x1f89f6[_0x7238('0x19')],'include':_0x1f89f6['include']?_[_0x7238('0x1a')](_0x1f89f6[_0x7238('0x17')],function(_0x1c99fb){return{'model':db[_0x1c99fb[_0x7238('0x18')]],'as':_0x1c99fb['as'],'attributes':_0x1c99fb[_0x7238('0x19')],'include':_0x1c99fb['include']?_[_0x7238('0x1a')](_0x1c99fb[_0x7238('0x17')],function(_0x222065){return{'model':db[_0x222065[_0x7238('0x18')]],'as':_0x222065['as'],'attributes':_0x222065[_0x7238('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7238('0x9')](function(_0x419ddc){logger[_0x7238('0xa')](_0x7238('0x12'),_0x3ef1a1);logger['debug'](_0x7238('0x12'),_0x3ef1a1,JSON[_0x7238('0x1b')](_0x419ddc));_0x1eff21(_0x419ddc);})['catch'](function(_0x63637a){logger[_0x7238('0xe')]('ShowSound',_0x63637a[_0x7238('0x10')],_0x3ef1a1);_0x34b66f(_0x5594bb[_0x7238('0xe')](0x1f4,_0x63637a[_0x7238('0x10')]));});});};
\ No newline at end of file
index 4f04e17..04557e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0x8603,0x190));var _0x3860=function(_0x38a8e5,_0x55ceed){_0x38a8e5=_0x38a8e5-0x0;var _0x5670f8=_0x8603[_0x38a8e5];return _0x5670f8;};'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
+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(_0x343dab,_0x134185){var _0xa7e52d=function(_0x37a2b8){while(--_0x37a2b8){_0x343dab['push'](_0x343dab['shift']());}};_0xa7e52d(++_0x134185);}(_0xda2d,0x102));var _0xdda2=function(_0x178eaf,_0x56912f){_0x178eaf=_0x178eaf-0x0;var _0x192de2=_0xda2d[_0x178eaf];return _0x192de2;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router;
\ No newline at end of file
index 4ed2bc8..5430144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bdb=['ENUM','out','TEXT','sequelize','exports','STRING','medium'];(function(_0x47fb79,_0x1896c8){var _0x377940=function(_0x260d1b){while(--_0x260d1b){_0x47fb79['push'](_0x47fb79['shift']());}};_0x377940(++_0x1896c8);}(_0x6bdb,0x9d));var _0xb6bd=function(_0x4f7a99,_0x17fa68){_0x4f7a99=_0x4f7a99-0x0;var _0x5597e4=_0x6bdb[_0x4f7a99];return _0x5597e4;};'use strict';var Sequelize=require(_0xb6bd('0x0'));module[_0xb6bd('0x1')]={'uniqueid':{'type':Sequelize[_0xb6bd('0x2')]},'body':{'type':Sequelize['TEXT'](_0xb6bd('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xb6bd('0x4')]('in',_0xb6bd('0x5')),'defaultValue':_0xb6bd('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xb6bd('0x2')]},'providerResponse':{'type':Sequelize[_0xb6bd('0x6')]}};
\ No newline at end of file
+var _0x2f0b=['sequelize','STRING','TEXT','medium','ENUM','out'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f0b,0x138));var _0xb2f0=function(_0x42c814,_0x5127b9){_0x42c814=_0x42c814-0x0;var _0x5511ff=_0x2f0b[_0x42c814];return _0x5511ff;};'use strict';var Sequelize=require(_0xb2f0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xb2f0('0x1')]},'body':{'type':Sequelize[_0xb2f0('0x2')](_0xb2f0('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xb2f0('0x4')]('in',_0xb2f0('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 7b4636e..b79b13e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba3c=['json','reject','save','update','then','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','mustache','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','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0xba3c,0x1f2));var _0xcba3=function(_0x3c0edd,_0x55d0a4){_0x3c0edd=_0x3c0edd-0x0;var _0xba717e=_0xba3c[_0x3c0edd];return _0xba717e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcba3('0x0'));var zipdir=require(_0xcba3('0x1'));var jsonpatch=require(_0xcba3('0x2'));var rp=require(_0xcba3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcba3('0x4'));var util=require(_0xcba3('0x5'));var path=require(_0xcba3('0x6'));var sox=require(_0xcba3('0x7'));var csv=require(_0xcba3('0x8'));var ejs=require(_0xcba3('0x9'));var fs=require('fs');var fs_extra=require(_0xcba3('0xa'));var _=require(_0xcba3('0xb'));var squel=require(_0xcba3('0xc'));var crypto=require('crypto');var jsforce=require(_0xcba3('0xd'));var deskjs=require(_0xcba3('0xe'));var toCsv=require(_0xcba3('0x8'));var querystring=require(_0xcba3('0xf'));var Papa=require(_0xcba3('0x10'));var Redis=require(_0xcba3('0x11'));var authService=require(_0xcba3('0x12'));var qs=require(_0xcba3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcba3('0x14'));var logger=require(_0xcba3('0x15'))('api');var utils=require(_0xcba3('0x16'));var config=require(_0xcba3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcba3('0x18'))['db'];function respondWithStatusCode(_0x10bda0,_0x3d1e4c){_0x3d1e4c=_0x3d1e4c||0xcc;return function(_0x1ac0cd){if(_0x1ac0cd){return _0x10bda0[_0xcba3('0x19')](_0x3d1e4c);}return _0x10bda0[_0xcba3('0x1a')](_0x3d1e4c)[_0xcba3('0x1b')]();};}function respondWithResult(_0x5b24ff,_0x3bd8d4){_0x3bd8d4=_0x3bd8d4||0xc8;return function(_0xbe7ff7){if(_0xbe7ff7){return _0x5b24ff['status'](_0x3bd8d4)['json'](_0xbe7ff7);}};}function respondWithFilteredResult(_0x43ce39,_0x4c6140){return function(_0x504cb0){if(_0x504cb0){var _0xabc4c3=typeof _0x4c6140['offset']===_0xcba3('0x1c')&&typeof _0x4c6140[_0xcba3('0x1d')]===_0xcba3('0x1c');var _0x4dab3c=_0x504cb0['count'];var _0x29c0d9=_0xabc4c3?0x0:_0x4c6140['offset'];var _0x2617c8=_0xabc4c3?_0x504cb0[_0xcba3('0x1e')]:_0x4c6140[_0xcba3('0x1f')]+_0x4c6140[_0xcba3('0x1d')];var _0x39f08f;if(_0x2617c8>=_0x4dab3c){_0x2617c8=_0x4dab3c;_0x39f08f=0xc8;}else{_0x39f08f=0xce;}_0x43ce39[_0xcba3('0x1a')](_0x39f08f);return _0x43ce39[_0xcba3('0x20')](_0xcba3('0x21'),_0x29c0d9+'-'+_0x2617c8+'/'+_0x4dab3c)[_0xcba3('0x22')](_0x504cb0);}return null;};}function patchUpdates(_0x8a9b13){return function(_0x24a12a){try{jsonpatch['apply'](_0x24a12a,_0x8a9b13,!![]);}catch(_0x3d3a86){return BPromise[_0xcba3('0x23')](_0x3d3a86);}return _0x24a12a[_0xcba3('0x24')]();};}function saveUpdates(_0x1b235d,_0x1c4e8c){return function(_0x29201b){if(_0x29201b){return _0x29201b[_0xcba3('0x25')](_0x1b235d)[_0xcba3('0x26')](function(_0x53e090){return _0x53e090;});}return null;};}function removeEntity(_0x33c708,_0x24da95){return function(_0x48e0a8){if(_0x48e0a8){return _0x48e0a8['destroy']()[_0xcba3('0x26')](function(){_0x33c708[_0xcba3('0x1a')](0xcc)[_0xcba3('0x1b')]();});}};}function handleEntityNotFound(_0x1c185b,_0x21f5b8){return function(_0x20faf4){if(!_0x20faf4){_0x1c185b[_0xcba3('0x19')](0x194);}return _0x20faf4;};}function handleError(_0x3157d8,_0x544e4d){_0x544e4d=_0x544e4d||0x1f4;return function(_0x394408){logger['error'](_0x394408[_0xcba3('0x27')]);if(_0x394408[_0xcba3('0x28')]){delete _0x394408['name'];}_0x3157d8['status'](_0x544e4d)[_0xcba3('0x29')](_0x394408);};}exports[_0xcba3('0x2a')]=function(_0x12c38b,_0xa61b4d){var _0x2f3fa7={},_0x484aff={},_0x327aa5={'count':0x0,'rows':[]};var _0x1ad375=_[_0xcba3('0x2b')](db[_0xcba3('0x2c')][_0xcba3('0x2d')],function(_0x184c0d){return{'name':_0x184c0d[_0xcba3('0x2e')],'type':_0x184c0d[_0xcba3('0x2f')]['key']};});_0x484aff[_0xcba3('0x30')]=_[_0xcba3('0x2b')](_0x1ad375,_0xcba3('0x28'));_0x484aff[_0xcba3('0x31')]=_[_0xcba3('0x32')](_0x12c38b['query']);_0x484aff['filters']=_[_0xcba3('0x33')](_0x484aff['model'],_0x484aff[_0xcba3('0x31')]);_0x2f3fa7['attributes']=_[_0xcba3('0x33')](_0x484aff[_0xcba3('0x30')],qs[_0xcba3('0x34')](_0x12c38b['query'][_0xcba3('0x34')]));_0x2f3fa7['attributes']=_0x2f3fa7[_0xcba3('0x35')][_0xcba3('0x36')]?_0x2f3fa7['attributes']:_0x484aff['model'];if(!_0x12c38b['query'][_0xcba3('0x37')](_0xcba3('0x38'))){_0x2f3fa7[_0xcba3('0x1d')]=qs[_0xcba3('0x1d')](_0x12c38b[_0xcba3('0x31')][_0xcba3('0x1d')]);_0x2f3fa7[_0xcba3('0x1f')]=qs[_0xcba3('0x1f')](_0x12c38b['query'][_0xcba3('0x1f')]);}_0x2f3fa7[_0xcba3('0x39')]=qs[_0xcba3('0x3a')](_0x12c38b['query'][_0xcba3('0x3a')]);_0x2f3fa7[_0xcba3('0x3b')]=qs[_0xcba3('0x3c')](_[_0xcba3('0x3d')](_0x12c38b[_0xcba3('0x31')],_0x484aff[_0xcba3('0x3c')]),_0x1ad375);if(_0x12c38b[_0xcba3('0x31')][_0xcba3('0x3e')]){_0x2f3fa7[_0xcba3('0x3b')]=_[_0xcba3('0x3f')](_0x2f3fa7[_0xcba3('0x3b')],{'$or':_[_0xcba3('0x2b')](_0x1ad375,function(_0x43f613){if(_0x43f613[_0xcba3('0x2f')]!=='VIRTUAL'){var _0x59376={};_0x59376[_0x43f613[_0xcba3('0x28')]]={'$like':'%'+_0x12c38b[_0xcba3('0x31')][_0xcba3('0x3e')]+'%'};return _0x59376;}})});}_0x2f3fa7=_['merge']({},_0x2f3fa7,_0x12c38b[_0xcba3('0x40')]);var _0xfae4ae={'where':_0x2f3fa7['where']};return db[_0xcba3('0x2c')][_0xcba3('0x1e')](_0xfae4ae)[_0xcba3('0x26')](function(_0x56f587){_0x327aa5['count']=_0x56f587;if(_0x12c38b[_0xcba3('0x31')]['includeAll']){_0x2f3fa7[_0xcba3('0x41')]=[{'all':!![]}];}return db[_0xcba3('0x2c')][_0xcba3('0x42')](_0x2f3fa7);})['then'](function(_0x2e48ee){_0x327aa5[_0xcba3('0x43')]=_0x2e48ee;return _0x327aa5;})[_0xcba3('0x26')](respondWithFilteredResult(_0xa61b4d,_0x2f3fa7))[_0xcba3('0x44')](handleError(_0xa61b4d,null));};exports[_0xcba3('0x45')]=function(_0x38615a,_0x283e14){var _0xb45ed5={'raw':!![],'where':{'id':_0x38615a[_0xcba3('0x46')]['id']}},_0xc440d0={};_0xc440d0[_0xcba3('0x30')]=_[_0xcba3('0x32')](db['SquareMessage'][_0xcba3('0x2d')]);_0xc440d0[_0xcba3('0x31')]=_[_0xcba3('0x32')](_0x38615a[_0xcba3('0x31')]);_0xc440d0[_0xcba3('0x3c')]=_[_0xcba3('0x33')](_0xc440d0[_0xcba3('0x30')],_0xc440d0['query']);_0xb45ed5['attributes']=_[_0xcba3('0x33')](_0xc440d0['model'],qs[_0xcba3('0x34')](_0x38615a['query'][_0xcba3('0x34')]));_0xb45ed5['attributes']=_0xb45ed5[_0xcba3('0x35')]['length']?_0xb45ed5['attributes']:_0xc440d0[_0xcba3('0x30')];if(_0x38615a[_0xcba3('0x31')][_0xcba3('0x47')]){_0xb45ed5['include']=[{'all':!![]}];}_0xb45ed5=_[_0xcba3('0x3f')]({},_0xb45ed5,_0x38615a['options']);return db[_0xcba3('0x2c')][_0xcba3('0x48')](_0xb45ed5)[_0xcba3('0x26')](handleEntityNotFound(_0x283e14,null))['then'](respondWithResult(_0x283e14,null))['catch'](handleError(_0x283e14,null));};exports[_0xcba3('0x49')]=function(_0x433c21,_0x279941){return db['SquareMessage'][_0xcba3('0x49')](_0x433c21[_0xcba3('0x4a')],{})[_0xcba3('0x26')](respondWithResult(_0x279941,0xc9))[_0xcba3('0x44')](handleError(_0x279941,null));};exports[_0xcba3('0x25')]=function(_0x75252f,_0x327a0f){if(_0x75252f[_0xcba3('0x4a')]['id']){delete _0x75252f[_0xcba3('0x4a')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x75252f[_0xcba3('0x46')]['id']}})[_0xcba3('0x26')](handleEntityNotFound(_0x327a0f,null))['then'](saveUpdates(_0x75252f[_0xcba3('0x4a')],null))[_0xcba3('0x26')](respondWithResult(_0x327a0f,null))[_0xcba3('0x44')](handleError(_0x327a0f,null));};exports[_0xcba3('0x4b')]=function(_0x1b1077,_0x15f622){return db[_0xcba3('0x2c')]['find']({'where':{'id':_0x1b1077[_0xcba3('0x46')]['id']}})[_0xcba3('0x26')](handleEntityNotFound(_0x15f622,null))[_0xcba3('0x26')](removeEntity(_0x15f622,null))[_0xcba3('0x44')](handleError(_0x15f622,null));};
\ No newline at end of file
+var _0x9a0a=['end','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x9a0a,0x7c));var _0xa9a0=function(_0x2b36b9,_0x357702){_0x2b36b9=_0x2b36b9-0x0;var _0x5243d3=_0x9a0a[_0x2b36b9];return _0x5243d3;};'use strict';var emlformat=require(_0xa9a0('0x0'));var rimraf=require(_0xa9a0('0x1'));var zipdir=require(_0xa9a0('0x2'));var jsonpatch=require(_0xa9a0('0x3'));var rp=require(_0xa9a0('0x4'));var moment=require(_0xa9a0('0x5'));var BPromise=require(_0xa9a0('0x6'));var Mustache=require(_0xa9a0('0x7'));var util=require(_0xa9a0('0x8'));var path=require('path');var sox=require(_0xa9a0('0x9'));var csv=require(_0xa9a0('0xa'));var ejs=require(_0xa9a0('0xb'));var fs=require('fs');var fs_extra=require(_0xa9a0('0xc'));var _=require(_0xa9a0('0xd'));var squel=require(_0xa9a0('0xe'));var crypto=require('crypto');var jsforce=require(_0xa9a0('0xf'));var deskjs=require(_0xa9a0('0x10'));var toCsv=require(_0xa9a0('0xa'));var querystring=require(_0xa9a0('0x11'));var Papa=require(_0xa9a0('0x12'));var Redis=require('ioredis');var authService=require(_0xa9a0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa9a0('0x14'));var hardwareService=require(_0xa9a0('0x15'));var logger=require(_0xa9a0('0x16'))(_0xa9a0('0x17'));var utils=require('../../config/utils');var config=require(_0xa9a0('0x18'));var licenseUtil=require(_0xa9a0('0x19'));var db=require(_0xa9a0('0x1a'))['db'];function respondWithStatusCode(_0x2db1db,_0x1e1cf1){_0x1e1cf1=_0x1e1cf1||0xcc;return function(_0x314028){if(_0x314028){return _0x2db1db[_0xa9a0('0x1b')](_0x1e1cf1);}return _0x2db1db['status'](_0x1e1cf1)[_0xa9a0('0x1c')]();};}function respondWithResult(_0x64285a,_0x1f2159){_0x1f2159=_0x1f2159||0xc8;return function(_0x142fbc){if(_0x142fbc){return _0x64285a[_0xa9a0('0x1d')](_0x1f2159)[_0xa9a0('0x1e')](_0x142fbc);}};}function respondWithFilteredResult(_0x14f3aa,_0x2533bc){return function(_0xae4300){if(_0xae4300){var _0x43e0be=typeof _0x2533bc['offset']===_0xa9a0('0x1f')&&typeof _0x2533bc['limit']===_0xa9a0('0x1f');var _0x46bea4=_0xae4300[_0xa9a0('0x20')];var _0x88a34d=_0x43e0be?0x0:_0x2533bc[_0xa9a0('0x21')];var _0x3ee40c=_0x43e0be?_0xae4300[_0xa9a0('0x20')]:_0x2533bc['offset']+_0x2533bc[_0xa9a0('0x22')];var _0x6050ed;if(_0x3ee40c>=_0x46bea4){_0x3ee40c=_0x46bea4;_0x6050ed=0xc8;}else{_0x6050ed=0xce;}_0x14f3aa['status'](_0x6050ed);return _0x14f3aa[_0xa9a0('0x23')]('Content-Range',_0x88a34d+'-'+_0x3ee40c+'/'+_0x46bea4)[_0xa9a0('0x1e')](_0xae4300);}return null;};}function patchUpdates(_0x1ece42){return function(_0x4a17f9){try{jsonpatch[_0xa9a0('0x24')](_0x4a17f9,_0x1ece42,!![]);}catch(_0xa121c8){return BPromise[_0xa9a0('0x25')](_0xa121c8);}return _0x4a17f9[_0xa9a0('0x26')]();};}function saveUpdates(_0xa97987,_0x488615){return function(_0x47d72f){if(_0x47d72f){return _0x47d72f[_0xa9a0('0x27')](_0xa97987)[_0xa9a0('0x28')](function(_0x3040bc){return _0x3040bc;});}return null;};}function removeEntity(_0x382bcb,_0x18254c){return function(_0x210bcc){if(_0x210bcc){return _0x210bcc[_0xa9a0('0x29')]()[_0xa9a0('0x28')](function(){_0x382bcb[_0xa9a0('0x1d')](0xcc)[_0xa9a0('0x1c')]();});}};}function handleEntityNotFound(_0x1b876f,_0x248e09){return function(_0x83d9e2){if(!_0x83d9e2){_0x1b876f[_0xa9a0('0x1b')](0x194);}return _0x83d9e2;};}function handleError(_0x1292a9,_0x21c3cd){_0x21c3cd=_0x21c3cd||0x1f4;return function(_0x3d7e9f){logger[_0xa9a0('0x2a')](_0x3d7e9f[_0xa9a0('0x2b')]);if(_0x3d7e9f['name']){delete _0x3d7e9f[_0xa9a0('0x2c')];}_0x1292a9['status'](_0x21c3cd)[_0xa9a0('0x2d')](_0x3d7e9f);};}exports[_0xa9a0('0x2e')]=function(_0x3b0b5f,_0x143246){var _0x21614b={},_0x12ab84={},_0x372c0d={'count':0x0,'rows':[]};var _0x397ad3=_[_0xa9a0('0x2f')](db[_0xa9a0('0x30')][_0xa9a0('0x31')],function(_0xfb8262){return{'name':_0xfb8262['fieldName'],'type':_0xfb8262[_0xa9a0('0x32')][_0xa9a0('0x33')]};});_0x12ab84['model']=_['map'](_0x397ad3,_0xa9a0('0x2c'));_0x12ab84[_0xa9a0('0x34')]=_[_0xa9a0('0x35')](_0x3b0b5f[_0xa9a0('0x34')]);_0x12ab84[_0xa9a0('0x36')]=_['intersection'](_0x12ab84[_0xa9a0('0x37')],_0x12ab84[_0xa9a0('0x34')]);_0x21614b[_0xa9a0('0x38')]=_[_0xa9a0('0x39')](_0x12ab84[_0xa9a0('0x37')],qs['fields'](_0x3b0b5f['query'][_0xa9a0('0x3a')]));_0x21614b['attributes']=_0x21614b[_0xa9a0('0x38')]['length']?_0x21614b[_0xa9a0('0x38')]:_0x12ab84[_0xa9a0('0x37')];if(!_0x3b0b5f[_0xa9a0('0x34')]['hasOwnProperty'](_0xa9a0('0x3b'))){_0x21614b[_0xa9a0('0x22')]=qs[_0xa9a0('0x22')](_0x3b0b5f[_0xa9a0('0x34')][_0xa9a0('0x22')]);_0x21614b['offset']=qs[_0xa9a0('0x21')](_0x3b0b5f[_0xa9a0('0x34')][_0xa9a0('0x21')]);}_0x21614b['order']=qs['sort'](_0x3b0b5f[_0xa9a0('0x34')][_0xa9a0('0x3c')]);_0x21614b['where']=qs['filters'](_[_0xa9a0('0x3d')](_0x3b0b5f[_0xa9a0('0x34')],_0x12ab84[_0xa9a0('0x36')]),_0x397ad3);if(_0x3b0b5f[_0xa9a0('0x34')][_0xa9a0('0x3e')]){_0x21614b[_0xa9a0('0x3f')]=_[_0xa9a0('0x40')](_0x21614b[_0xa9a0('0x3f')],{'$or':_[_0xa9a0('0x2f')](_0x397ad3,function(_0x5a2a3c){if(_0x5a2a3c[_0xa9a0('0x32')]!==_0xa9a0('0x41')){var _0x2f997a={};_0x2f997a[_0x5a2a3c[_0xa9a0('0x2c')]]={'$like':'%'+_0x3b0b5f[_0xa9a0('0x34')][_0xa9a0('0x3e')]+'%'};return _0x2f997a;}})});}_0x21614b=_[_0xa9a0('0x40')]({},_0x21614b,_0x3b0b5f[_0xa9a0('0x42')]);var _0x43fb14={'where':_0x21614b[_0xa9a0('0x3f')]};return db[_0xa9a0('0x30')][_0xa9a0('0x20')](_0x43fb14)[_0xa9a0('0x28')](function(_0x548398){_0x372c0d[_0xa9a0('0x20')]=_0x548398;if(_0x3b0b5f[_0xa9a0('0x34')][_0xa9a0('0x43')]){_0x21614b['include']=[{'all':!![]}];}return db[_0xa9a0('0x30')][_0xa9a0('0x44')](_0x21614b);})[_0xa9a0('0x28')](function(_0x56a666){_0x372c0d['rows']=_0x56a666;return _0x372c0d;})[_0xa9a0('0x28')](respondWithFilteredResult(_0x143246,_0x21614b))[_0xa9a0('0x45')](handleError(_0x143246,null));};exports[_0xa9a0('0x46')]=function(_0x126fde,_0x250e39){var _0x1dfba5={'raw':!![],'where':{'id':_0x126fde[_0xa9a0('0x47')]['id']}},_0x35c1c4={};_0x35c1c4['model']=_[_0xa9a0('0x35')](db[_0xa9a0('0x30')][_0xa9a0('0x31')]);_0x35c1c4[_0xa9a0('0x34')]=_[_0xa9a0('0x35')](_0x126fde['query']);_0x35c1c4[_0xa9a0('0x36')]=_['intersection'](_0x35c1c4['model'],_0x35c1c4[_0xa9a0('0x34')]);_0x1dfba5[_0xa9a0('0x38')]=_['intersection'](_0x35c1c4[_0xa9a0('0x37')],qs['fields'](_0x126fde[_0xa9a0('0x34')][_0xa9a0('0x3a')]));_0x1dfba5[_0xa9a0('0x38')]=_0x1dfba5[_0xa9a0('0x38')]['length']?_0x1dfba5[_0xa9a0('0x38')]:_0x35c1c4[_0xa9a0('0x37')];if(_0x126fde[_0xa9a0('0x34')]['includeAll']){_0x1dfba5[_0xa9a0('0x48')]=[{'all':!![]}];}_0x1dfba5=_[_0xa9a0('0x40')]({},_0x1dfba5,_0x126fde[_0xa9a0('0x42')]);return db[_0xa9a0('0x30')]['find'](_0x1dfba5)[_0xa9a0('0x28')](handleEntityNotFound(_0x250e39,null))['then'](respondWithResult(_0x250e39,null))[_0xa9a0('0x45')](handleError(_0x250e39,null));};exports[_0xa9a0('0x49')]=function(_0x54fa12,_0x2885e9){return db['SquareMessage'][_0xa9a0('0x49')](_0x54fa12[_0xa9a0('0x4a')],{})['then'](respondWithResult(_0x2885e9,0xc9))[_0xa9a0('0x45')](handleError(_0x2885e9,null));};exports[_0xa9a0('0x27')]=function(_0x55537c,_0x566bb5){if(_0x55537c['body']['id']){delete _0x55537c[_0xa9a0('0x4a')]['id'];}return db[_0xa9a0('0x30')][_0xa9a0('0x4b')]({'where':{'id':_0x55537c[_0xa9a0('0x47')]['id']}})[_0xa9a0('0x28')](handleEntityNotFound(_0x566bb5,null))[_0xa9a0('0x28')](saveUpdates(_0x55537c[_0xa9a0('0x4a')],null))[_0xa9a0('0x28')](respondWithResult(_0x566bb5,null))[_0xa9a0('0x45')](handleError(_0x566bb5,null));};exports[_0xa9a0('0x29')]=function(_0x1745a0,_0x503dc2){return db['SquareMessage']['find']({'where':{'id':_0x1745a0[_0xa9a0('0x47')]['id']}})[_0xa9a0('0x28')](handleEntityNotFound(_0x503dc2,null))[_0xa9a0('0x28')](removeEntity(_0x503dc2,null))['catch'](handleError(_0x503dc2,null));};
\ No newline at end of file
index 502643e..9b4f789 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a3f=['bluebird','request-promise','path','rimraf','./squareMessage.attributes','define','SquareMessage','square_messages','util','../../config/logger','api','moment'];(function(_0x218a3f,_0x3fb5a8){var _0x1d6952=function(_0x4a9c1f){while(--_0x4a9c1f){_0x218a3f['push'](_0x218a3f['shift']());}};_0x1d6952(++_0x3fb5a8);}(_0x0a3f,0x164));var _0xf0a3=function(_0x5cc2bb,_0x472d84){_0x5cc2bb=_0x5cc2bb-0x0;var _0x4325b1=_0x0a3f[_0x5cc2bb];return _0x4325b1;};'use strict';var _=require('lodash');var util=require(_0xf0a3('0x0'));var logger=require(_0xf0a3('0x1'))(_0xf0a3('0x2'));var moment=require(_0xf0a3('0x3'));var BPromise=require(_0xf0a3('0x4'));var rp=require(_0xf0a3('0x5'));var fs=require('fs');var path=require(_0xf0a3('0x6'));var rimraf=require(_0xf0a3('0x7'));var config=require('../../config/environment');var attributes=require(_0xf0a3('0x8'));module['exports']=function(_0x167615,_0x2f57e3){return _0x167615[_0xf0a3('0x9')](_0xf0a3('0xa'),attributes,{'tableName':_0xf0a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e79=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash'];(function(_0x1a50a6,_0x400207){var _0x9cd101=function(_0x4abe53){while(--_0x4abe53){_0x1a50a6['push'](_0x1a50a6['shift']());}};_0x9cd101(++_0x400207);}(_0x6e79,0x1e0));var _0x96e7=function(_0x468b18,_0x34ae76){_0x468b18=_0x468b18-0x0;var _0x252440=_0x6e79[_0x468b18];return _0x252440;};'use strict';var _=require(_0x96e7('0x0'));var util=require(_0x96e7('0x1'));var logger=require(_0x96e7('0x2'))(_0x96e7('0x3'));var moment=require(_0x96e7('0x4'));var BPromise=require(_0x96e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96e7('0x6'));var rimraf=require(_0x96e7('0x7'));var config=require(_0x96e7('0x8'));var attributes=require(_0x96e7('0x9'));module['exports']=function(_0x2c4ec4,_0x367257){return _0x2c4ec4[_0x96e7('0xa')](_0x96e7('0xb'),attributes,{'tableName':_0x96e7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d41b56..bf0e88c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x255a=['then','info','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','SquareMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateSquareMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request'];(function(_0x276343,_0xe14809){var _0x2d3e85=function(_0x22ed9d){while(--_0x22ed9d){_0x276343['push'](_0x276343['shift']());}};_0x2d3e85(++_0xe14809);}(_0x255a,0x1b0));var _0xa255=function(_0x59f4c9,_0x6c4820){_0x59f4c9=_0x59f4c9-0x0;var _0x1f732c=_0x255a[_0x59f4c9];return _0x1f732c;};'use strict';var _=require(_0xa255('0x0'));var util=require(_0xa255('0x1'));var moment=require(_0xa255('0x2'));var BPromise=require(_0xa255('0x3'));var rs=require(_0xa255('0x4'));var fs=require('fs');var Redis=require(_0xa255('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa255('0x6'));var client=jayson[_0xa255('0x7')][_0xa255('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7e77f1,_0x2376da,_0x5c5b95){return new BPromise(function(_0x2924da,_0x2cb252){return client[_0xa255('0x9')](_0x7e77f1,_0x5c5b95)[_0xa255('0xa')](function(_0x160241){logger[_0xa255('0xb')]('SquareMessage,\x20%s,\x20%s',_0x2376da,'request\x20sent');logger[_0xa255('0xc')](_0xa255('0xd'),_0x2376da,'request\x20sent',JSON[_0xa255('0xe')](_0x160241));if(_0x160241['error']){if(_0x160241['error'][_0xa255('0xf')]===0x1f4){logger[_0xa255('0x10')](_0xa255('0x11'),_0x2376da,_0x160241[_0xa255('0x10')]['message']);return _0x2cb252(_0x160241['error'][_0xa255('0x12')]);}logger[_0xa255('0x10')](_0xa255('0x11'),_0x2376da,_0x160241[_0xa255('0x10')]['message']);return _0x2924da(_0x160241[_0xa255('0x10')][_0xa255('0x12')]);}else{logger[_0xa255('0xb')](_0xa255('0x11'),_0x2376da,_0xa255('0x13'));_0x2924da(_0x160241[_0xa255('0x14')][_0xa255('0x12')]);}})[_0xa255('0x15')](function(_0x353572){logger['error'](_0xa255('0x11'),_0x2376da,_0x353572);_0x2cb252(_0x353572);});});}exports[_0xa255('0x16')]=function(_0x2fcfd9){var _0x15400c=this;return new Promise(function(_0x4058b6,_0x3ac862){return db['SquareMessage']['create'](_0x2fcfd9[_0xa255('0x17')],{'raw':_0x2fcfd9[_0xa255('0x18')]?_0x2fcfd9[_0xa255('0x18')][_0xa255('0x19')]===undefined?!![]:![]:!![]})[_0xa255('0xa')](function(_0x1d5eb3){logger['info'](_0xa255('0x16'),_0x2fcfd9);logger[_0xa255('0xc')]('CreateSquareMessage',_0x2fcfd9,JSON[_0xa255('0xe')](_0x1d5eb3));_0x4058b6(_0x1d5eb3);})[_0xa255('0x15')](function(_0xae45b3){logger[_0xa255('0x10')]('CreateSquareMessage',_0xae45b3[_0xa255('0x12')],_0x2fcfd9);_0x3ac862(_0x15400c[_0xa255('0x10')](0x1f4,_0xae45b3[_0xa255('0x12')]));});});};
\ No newline at end of file
+var _0xb4af=['raw','CreateSquareMessage','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SquareMessage','create','body','options'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0xb4af,0x17c));var _0xfb4a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb4af[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xfb4a('0x0'));var moment=require(_0xfb4a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfb4a('0x2'));var fs=require('fs');var Redis=require(_0xfb4a('0x3'));var db=require(_0xfb4a('0x4'))['db'];var utils=require(_0xfb4a('0x5'));var logger=require(_0xfb4a('0x6'))(_0xfb4a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfb4a('0x8')][_0xfb4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22dbeb,_0x4b554d,_0x5a8e2b){return new BPromise(function(_0x3f566d,_0xc6a78d){return client[_0xfb4a('0xa')](_0x22dbeb,_0x5a8e2b)[_0xfb4a('0xb')](function(_0x45e773){logger[_0xfb4a('0xc')](_0xfb4a('0xd'),_0x4b554d,_0xfb4a('0xe'));logger[_0xfb4a('0xf')](_0xfb4a('0x10'),_0x4b554d,_0xfb4a('0xe'),JSON[_0xfb4a('0x11')](_0x45e773));if(_0x45e773['error']){if(_0x45e773[_0xfb4a('0x12')][_0xfb4a('0x13')]===0x1f4){logger[_0xfb4a('0x12')]('SquareMessage,\x20%s,\x20%s',_0x4b554d,_0x45e773[_0xfb4a('0x12')][_0xfb4a('0x14')]);return _0xc6a78d(_0x45e773[_0xfb4a('0x12')][_0xfb4a('0x14')]);}logger[_0xfb4a('0x12')](_0xfb4a('0xd'),_0x4b554d,_0x45e773[_0xfb4a('0x12')][_0xfb4a('0x14')]);return _0x3f566d(_0x45e773[_0xfb4a('0x12')][_0xfb4a('0x14')]);}else{logger['info'](_0xfb4a('0xd'),_0x4b554d,'request\x20sent');_0x3f566d(_0x45e773[_0xfb4a('0x15')]['message']);}})['catch'](function(_0x2d492e){logger['error'](_0xfb4a('0xd'),_0x4b554d,_0x2d492e);_0xc6a78d(_0x2d492e);});});}exports['CreateSquareMessage']=function(_0x41772a){var _0x38beb0=this;return new Promise(function(_0x235c69,_0x77da21){return db[_0xfb4a('0x16')][_0xfb4a('0x17')](_0x41772a[_0xfb4a('0x18')],{'raw':_0x41772a[_0xfb4a('0x19')]?_0x41772a[_0xfb4a('0x19')][_0xfb4a('0x1a')]===undefined?!![]:![]:!![]})[_0xfb4a('0xb')](function(_0x6c6add){logger[_0xfb4a('0xc')](_0xfb4a('0x1b'),_0x41772a);logger[_0xfb4a('0xf')](_0xfb4a('0x1b'),_0x41772a,JSON[_0xfb4a('0x11')](_0x6c6add));_0x235c69(_0x6c6add);})[_0xfb4a('0x1c')](function(_0x5ca4d2){logger[_0xfb4a('0x12')](_0xfb4a('0x1b'),_0x5ca4d2[_0xfb4a('0x14')],_0x41772a);_0x77da21(_0x38beb0[_0xfb4a('0x12')](0x1f4,_0x5ca4d2['message']));});});};
\ No newline at end of file
index 21d750b..dd659fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e81=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareOdbc.controller','get','index','/:id','isAuthenticated','15s','test','post','create','put','update','delete','destroy'];(function(_0x3ea0d2,_0x136a8a){var _0x4eae0c=function(_0x455600){while(--_0x455600){_0x3ea0d2['push'](_0x3ea0d2['shift']());}};_0x4eae0c(++_0x136a8a);}(_0x9e81,0xb4));var _0x19e8=function(_0x4f7e37,_0x291c9f){_0x4f7e37=_0x4f7e37-0x0;var _0x442ea8=_0x9e81[_0x4f7e37];return _0x442ea8;};'use strict';var multer=require(_0x19e8('0x0'));var util=require('util');var path=require(_0x19e8('0x1'));var timeout=require(_0x19e8('0x2'));var express=require(_0x19e8('0x3'));var router=express[_0x19e8('0x4')]();var fs_extra=require(_0x19e8('0x5'));var auth=require(_0x19e8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x19e8('0x7'));router[_0x19e8('0x8')]('/',auth['isAuthenticated'](),controller[_0x19e8('0x9')]);router['get'](_0x19e8('0xa'),auth[_0x19e8('0xb')](),controller['show']);router[_0x19e8('0x8')]('/:id/test',auth[_0x19e8('0xb')](),timeout(_0x19e8('0xc')),controller[_0x19e8('0xd')]);router[_0x19e8('0xe')]('/',auth[_0x19e8('0xb')](),controller[_0x19e8('0xf')]);router[_0x19e8('0x10')](_0x19e8('0xa'),auth[_0x19e8('0xb')](),controller[_0x19e8('0x11')]);router[_0x19e8('0x12')](_0x19e8('0xa'),auth[_0x19e8('0xb')](),controller[_0x19e8('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xa411=['../../config/environment','get','isAuthenticated','index','/:id','show','test','post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x11388e,_0x366ee0){var _0xadb678=function(_0x129fb1){while(--_0x129fb1){_0x11388e['push'](_0x11388e['shift']());}};_0xadb678(++_0x366ee0);}(_0xa411,0xb7));var _0x1a41=function(_0x479296,_0x2c1533){_0x479296=_0x479296-0x0;var _0x16817c=_0xa411[_0x479296];return _0x16817c;};'use strict';var multer=require(_0x1a41('0x0'));var util=require(_0x1a41('0x1'));var path=require('path');var timeout=require(_0x1a41('0x2'));var express=require(_0x1a41('0x3'));var router=express[_0x1a41('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a41('0x5'));var interaction=require(_0x1a41('0x6'));var config=require(_0x1a41('0x7'));var controller=require('./squareOdbc.controller');router[_0x1a41('0x8')]('/',auth[_0x1a41('0x9')](),controller[_0x1a41('0xa')]);router['get'](_0x1a41('0xb'),auth[_0x1a41('0x9')](),controller[_0x1a41('0xc')]);router[_0x1a41('0x8')]('/:id/test',auth[_0x1a41('0x9')](),timeout('15s'),controller[_0x1a41('0xd')]);router[_0x1a41('0xe')]('/',auth[_0x1a41('0x9')](),controller[_0x1a41('0xf')]);router['put'](_0x1a41('0xb'),auth[_0x1a41('0x9')](),controller[_0x1a41('0x10')]);router[_0x1a41('0x11')](_0x1a41('0xb'),auth[_0x1a41('0x9')](),controller[_0x1a41('0x12')]);module['exports']=router;
\ No newline at end of file
index b641e79..afd2659 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15fc=['name','sequelize','exports','STRING'];(function(_0x33a616,_0x58cc0b){var _0x274dac=function(_0x49a273){while(--_0x49a273){_0x33a616['push'](_0x33a616['shift']());}};_0x274dac(++_0x58cc0b);}(_0x15fc,0x16d));var _0xc15f=function(_0x202f99,_0x5f1897){_0x202f99=_0x202f99-0x0;var _0x44c111=_0x15fc[_0x202f99];return _0x44c111;};'use strict';var Sequelize=require(_0xc15f('0x0'));module[_0xc15f('0x1')]={'name':{'type':Sequelize[_0xc15f('0x2')],'unique':_0xc15f('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xc15f('0x2')]},'description':{'type':Sequelize[_0xc15f('0x2')]}};
\ No newline at end of file
+var _0x87c3=['sequelize','STRING','name'];(function(_0x2035df,_0x3cf088){var _0x5e9ce2=function(_0x538ad3){while(--_0x538ad3){_0x2035df['push'](_0x2035df['shift']());}};_0x5e9ce2(++_0x3cf088);}(_0x87c3,0x174));var _0x387c=function(_0x45e3b5,_0x234b52){_0x45e3b5=_0x45e3b5-0x0;var _0x343bc8=_0x87c3[_0x45e3b5];return _0x343bc8;};'use strict';var Sequelize=require(_0x387c('0x0'));module['exports']={'name':{'type':Sequelize[_0x387c('0x1')],'unique':_0x387c('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x387c('0x1')]},'description':{'type':Sequelize[_0x387c('0x1')]}};
\ No newline at end of file
index 1f2aac6..e1ccb99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9f6=['../../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','then','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','SquareOdbc','includeAll','findAll','rows','catch','show','params','keys','include','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x1e0b1e,_0x576a29){var _0x5102ce=function(_0x19acfd){while(--_0x19acfd){_0x1e0b1e['push'](_0x1e0b1e['shift']());}};_0x5102ce(++_0x576a29);}(_0xa9f6,0x158));var _0x6a9f=function(_0x431d1d,_0x48d9e7){_0x431d1d=_0x431d1d-0x0;var _0x223001=_0xa9f6[_0x431d1d];return _0x223001;};'use strict';var emlformat=require(_0x6a9f('0x0'));var rimraf=require(_0x6a9f('0x1'));var zipdir=require(_0x6a9f('0x2'));var jsonpatch=require(_0x6a9f('0x3'));var rp=require('request-promise');var moment=require(_0x6a9f('0x4'));var BPromise=require(_0x6a9f('0x5'));var Mustache=require(_0x6a9f('0x6'));var util=require(_0x6a9f('0x7'));var path=require(_0x6a9f('0x8'));var sox=require(_0x6a9f('0x9'));var csv=require(_0x6a9f('0xa'));var ejs=require(_0x6a9f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a9f('0xc'));var squel=require(_0x6a9f('0xd'));var crypto=require(_0x6a9f('0xe'));var jsforce=require(_0x6a9f('0xf'));var deskjs=require(_0x6a9f('0x10'));var toCsv=require(_0x6a9f('0xa'));var querystring=require(_0x6a9f('0x11'));var Papa=require('papaparse');var Redis=require(_0x6a9f('0x12'));var authService=require(_0x6a9f('0x13'));var qs=require(_0x6a9f('0x14'));var as=require(_0x6a9f('0x15'));var hardwareService=require(_0x6a9f('0x16'));var logger=require(_0x6a9f('0x17'))(_0x6a9f('0x18'));var utils=require(_0x6a9f('0x19'));var config=require(_0x6a9f('0x1a'));var licenseUtil=require(_0x6a9f('0x1b'));var db=require(_0x6a9f('0x1c'))['db'];function respondWithStatusCode(_0xfd475e,_0x2e89dc){_0x2e89dc=_0x2e89dc||0xcc;return function(_0x28f4b7){if(_0x28f4b7){return _0xfd475e[_0x6a9f('0x1d')](_0x2e89dc);}return _0xfd475e['status'](_0x2e89dc)[_0x6a9f('0x1e')]();};}function respondWithResult(_0x578f96,_0x147af9){_0x147af9=_0x147af9||0xc8;return function(_0x22f9da){if(_0x22f9da){return _0x578f96[_0x6a9f('0x1f')](_0x147af9)[_0x6a9f('0x20')](_0x22f9da);}};}function respondWithFilteredResult(_0x104258,_0xc8e436){return function(_0x3a2e47){if(_0x3a2e47){var _0x64efb1=typeof _0xc8e436[_0x6a9f('0x21')]===_0x6a9f('0x22')&&typeof _0xc8e436[_0x6a9f('0x23')]==='undefined';var _0x5a9026=_0x3a2e47[_0x6a9f('0x24')];var _0x4f52a4=_0x64efb1?0x0:_0xc8e436[_0x6a9f('0x21')];var _0x418120=_0x64efb1?_0x3a2e47['count']:_0xc8e436[_0x6a9f('0x21')]+_0xc8e436[_0x6a9f('0x23')];var _0x3baa36;if(_0x418120>=_0x5a9026){_0x418120=_0x5a9026;_0x3baa36=0xc8;}else{_0x3baa36=0xce;}_0x104258[_0x6a9f('0x1f')](_0x3baa36);return _0x104258[_0x6a9f('0x25')](_0x6a9f('0x26'),_0x4f52a4+'-'+_0x418120+'/'+_0x5a9026)[_0x6a9f('0x20')](_0x3a2e47);}return null;};}function patchUpdates(_0x395829){return function(_0x1fce1a){try{jsonpatch[_0x6a9f('0x27')](_0x1fce1a,_0x395829,!![]);}catch(_0x33436c){return BPromise['reject'](_0x33436c);}return _0x1fce1a[_0x6a9f('0x28')]();};}function saveUpdates(_0x304a7d,_0x50d9f2){return function(_0x538c35){if(_0x538c35){return _0x538c35[_0x6a9f('0x29')](_0x304a7d)[_0x6a9f('0x2a')](function(_0x40183b){return _0x40183b;});}return null;};}function removeEntity(_0x2d02f5,_0x50cb1e){return function(_0x389687){if(_0x389687){return _0x389687['destroy']()['then'](function(){var _0x585854=_0x389687['get']({'plain':!![]});var _0x26cd5b='ODBC';return db[_0x6a9f('0x2b')][_0x6a9f('0x2c')]({'where':{'type':_0x26cd5b,'resourceId':_0x585854['id']}})[_0x6a9f('0x2a')](function(){return _0x389687;});})[_0x6a9f('0x2a')](function(){_0x2d02f5['status'](0xcc)[_0x6a9f('0x1e')]();});}};}function handleEntityNotFound(_0x2ea35d,_0x1c8145){return function(_0x561a2d){if(!_0x561a2d){_0x2ea35d['sendStatus'](0x194);}return _0x561a2d;};}function handleError(_0x5c7498,_0x4346c4){_0x4346c4=_0x4346c4||0x1f4;return function(_0x23429d){logger[_0x6a9f('0x2d')](_0x23429d['stack']);if(_0x23429d['name']){delete _0x23429d[_0x6a9f('0x2e')];}_0x5c7498[_0x6a9f('0x1f')](_0x4346c4)[_0x6a9f('0x2f')](_0x23429d);};}exports[_0x6a9f('0x30')]=function(_0x35632d,_0x48cf17){var _0x4c4f09={},_0x5b19dc={},_0x30a27e={'count':0x0,'rows':[]};var _0x45cca5=_[_0x6a9f('0x31')](db['SquareOdbc'][_0x6a9f('0x32')],function(_0x445fda){return{'name':_0x445fda[_0x6a9f('0x33')],'type':_0x445fda[_0x6a9f('0x34')]['key']};});_0x5b19dc['model']=_['map'](_0x45cca5,_0x6a9f('0x2e'));_0x5b19dc[_0x6a9f('0x35')]=_['keys'](_0x35632d[_0x6a9f('0x35')]);_0x5b19dc[_0x6a9f('0x36')]=_[_0x6a9f('0x37')](_0x5b19dc[_0x6a9f('0x38')],_0x5b19dc['query']);_0x4c4f09[_0x6a9f('0x39')]=_[_0x6a9f('0x37')](_0x5b19dc['model'],qs[_0x6a9f('0x3a')](_0x35632d[_0x6a9f('0x35')]['fields']));_0x4c4f09[_0x6a9f('0x39')]=_0x4c4f09['attributes']['length']?_0x4c4f09[_0x6a9f('0x39')]:_0x5b19dc[_0x6a9f('0x38')];if(!_0x35632d['query'][_0x6a9f('0x3b')](_0x6a9f('0x3c'))){_0x4c4f09['limit']=qs[_0x6a9f('0x23')](_0x35632d[_0x6a9f('0x35')][_0x6a9f('0x23')]);_0x4c4f09['offset']=qs[_0x6a9f('0x21')](_0x35632d[_0x6a9f('0x35')][_0x6a9f('0x21')]);}_0x4c4f09[_0x6a9f('0x3d')]=qs[_0x6a9f('0x3e')](_0x35632d[_0x6a9f('0x35')][_0x6a9f('0x3e')]);_0x4c4f09[_0x6a9f('0x3f')]=qs[_0x6a9f('0x36')](_[_0x6a9f('0x40')](_0x35632d[_0x6a9f('0x35')],_0x5b19dc['filters']),_0x45cca5);if(_0x35632d[_0x6a9f('0x35')][_0x6a9f('0x41')]){_0x4c4f09[_0x6a9f('0x3f')]=_['merge'](_0x4c4f09['where'],{'$or':_[_0x6a9f('0x31')](_0x45cca5,function(_0x5ca93b){if(_0x5ca93b[_0x6a9f('0x34')]!=='VIRTUAL'){var _0x469957={};_0x469957[_0x5ca93b[_0x6a9f('0x2e')]]={'$like':'%'+_0x35632d[_0x6a9f('0x35')]['filter']+'%'};return _0x469957;}})});}_0x4c4f09=_[_0x6a9f('0x42')]({},_0x4c4f09,_0x35632d['options']);var _0x2c5240={'where':_0x4c4f09[_0x6a9f('0x3f')]};return db[_0x6a9f('0x43')][_0x6a9f('0x24')](_0x2c5240)['then'](function(_0x4f5533){_0x30a27e[_0x6a9f('0x24')]=_0x4f5533;if(_0x35632d[_0x6a9f('0x35')][_0x6a9f('0x44')]){_0x4c4f09['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x6a9f('0x45')](_0x4c4f09);})['then'](function(_0x43fc68){_0x30a27e[_0x6a9f('0x46')]=_0x43fc68;return _0x30a27e;})[_0x6a9f('0x2a')](respondWithFilteredResult(_0x48cf17,_0x4c4f09))[_0x6a9f('0x47')](handleError(_0x48cf17,null));};exports[_0x6a9f('0x48')]=function(_0x4e1915,_0x4bd2fc){var _0x13c89d={'raw':!![],'where':{'id':_0x4e1915[_0x6a9f('0x49')]['id']}},_0x6017f2={};_0x6017f2[_0x6a9f('0x38')]=_[_0x6a9f('0x4a')](db[_0x6a9f('0x43')]['rawAttributes']);_0x6017f2[_0x6a9f('0x35')]=_[_0x6a9f('0x4a')](_0x4e1915[_0x6a9f('0x35')]);_0x6017f2[_0x6a9f('0x36')]=_['intersection'](_0x6017f2[_0x6a9f('0x38')],_0x6017f2['query']);_0x13c89d['attributes']=_['intersection'](_0x6017f2[_0x6a9f('0x38')],qs[_0x6a9f('0x3a')](_0x4e1915['query'][_0x6a9f('0x3a')]));_0x13c89d[_0x6a9f('0x39')]=_0x13c89d['attributes']['length']?_0x13c89d[_0x6a9f('0x39')]:_0x6017f2['model'];if(_0x4e1915[_0x6a9f('0x35')][_0x6a9f('0x44')]){_0x13c89d[_0x6a9f('0x4b')]=[{'all':!![]}];}_0x13c89d=_['merge']({},_0x13c89d,_0x4e1915[_0x6a9f('0x4c')]);return db['SquareOdbc']['find'](_0x13c89d)[_0x6a9f('0x2a')](handleEntityNotFound(_0x4bd2fc,null))['then'](respondWithResult(_0x4bd2fc,null))[_0x6a9f('0x47')](handleError(_0x4bd2fc,null));};exports['create']=function(_0x3eb16a,_0x5adf7b){return db[_0x6a9f('0x43')][_0x6a9f('0x4d')](_0x3eb16a[_0x6a9f('0x4e')],{})[_0x6a9f('0x2a')](function(_0x75a23f){var _0xe05f24=_0x3eb16a['user'][_0x6a9f('0x4f')]({'plain':!![]});if(!_0xe05f24)throw new Error(_0x6a9f('0x50'));if(_0xe05f24[_0x6a9f('0x51')]==='user'){var _0x1aef64=_0x75a23f[_0x6a9f('0x4f')]({'plain':!![]});var _0x2ec304=_0x6a9f('0x52');return db['UserProfileSection'][_0x6a9f('0x53')]({'where':{'name':_0x2ec304,'userProfileId':_0xe05f24[_0x6a9f('0x54')]},'raw':!![]})['then'](function(_0x2cd923){if(_0x2cd923&&_0x2cd923[_0x6a9f('0x55')]===0x0){return db['UserProfileResource'][_0x6a9f('0x4d')]({'name':_0x1aef64['name'],'resourceId':_0x1aef64['id'],'type':_0x2cd923[_0x6a9f('0x2e')],'sectionId':_0x2cd923['id']},{})[_0x6a9f('0x2a')](function(){return _0x75a23f;});}else{return _0x75a23f;}})[_0x6a9f('0x47')](function(_0xe4e8bb){logger[_0x6a9f('0x2d')](_0x6a9f('0x56'),_0xe4e8bb);throw _0xe4e8bb;});}return _0x75a23f;})[_0x6a9f('0x2a')](respondWithResult(_0x5adf7b,0xc9))[_0x6a9f('0x47')](handleError(_0x5adf7b,null));};exports[_0x6a9f('0x29')]=function(_0x21815e,_0x328da6){if(_0x21815e[_0x6a9f('0x4e')]['id']){delete _0x21815e['body']['id'];}return db[_0x6a9f('0x43')][_0x6a9f('0x53')]({'where':{'id':_0x21815e['params']['id']}})[_0x6a9f('0x2a')](handleEntityNotFound(_0x328da6,null))['then'](saveUpdates(_0x21815e[_0x6a9f('0x4e')],null))[_0x6a9f('0x2a')](respondWithResult(_0x328da6,null))[_0x6a9f('0x47')](handleError(_0x328da6,null));};exports[_0x6a9f('0x2c')]=function(_0x499e29,_0x1d5bdd){return db['SquareOdbc']['find']({'where':{'id':_0x499e29[_0x6a9f('0x49')]['id']}})[_0x6a9f('0x2a')](handleEntityNotFound(_0x1d5bdd,null))[_0x6a9f('0x2a')](removeEntity(_0x1d5bdd,null))[_0x6a9f('0x47')](handleError(_0x1d5bdd,null));};exports[_0x6a9f('0x57')]=function(_0x30b769,_0x40a76a,_0x2ba494){var _0x4f4c92;return db[_0x6a9f('0x43')][_0x6a9f('0x53')]({'where':{'id':_0x30b769['params']['id']},'attributes':['id',_0x6a9f('0x58')]})[_0x6a9f('0x2a')](handleEntityNotFound(_0x40a76a,null))['then'](function(_0x359940){if(_0x359940){var _0x25ae66=require(_0x6a9f('0x59'))();_0x25ae66[_0x6a9f('0x5a')](_0x359940[_0x6a9f('0x58')]);_0x25ae66['closeSync']();return _0x359940;}})[_0x6a9f('0x2a')](respondWithResult(_0x40a76a,null))['catch'](handleError(_0x40a76a,null));};
\ No newline at end of file
+var _0xa84e=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','ODBC','UserProfileResource','sendStatus','error','name','send','map','SquareOdbc','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','fields','options','create','body','user','role','UserProfileSection','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','openSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x4a6d72,_0x3fe61f){var _0x3bd9eb=function(_0xd2d8fe){while(--_0xd2d8fe){_0x4a6d72['push'](_0x4a6d72['shift']());}};_0x3bd9eb(++_0x3fe61f);}(_0xa84e,0xf0));var _0xea84=function(_0x32e6b9,_0x1ba001){_0x32e6b9=_0x32e6b9-0x0;var _0xd18132=_0xa84e[_0x32e6b9];return _0xd18132;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xea84('0x0'));var jsonpatch=require(_0xea84('0x1'));var rp=require(_0xea84('0x2'));var moment=require(_0xea84('0x3'));var BPromise=require(_0xea84('0x4'));var Mustache=require(_0xea84('0x5'));var util=require(_0xea84('0x6'));var path=require(_0xea84('0x7'));var sox=require(_0xea84('0x8'));var csv=require(_0xea84('0x9'));var ejs=require(_0xea84('0xa'));var fs=require('fs');var fs_extra=require(_0xea84('0xb'));var _=require(_0xea84('0xc'));var squel=require(_0xea84('0xd'));var crypto=require(_0xea84('0xe'));var jsforce=require(_0xea84('0xf'));var deskjs=require(_0xea84('0x10'));var toCsv=require('to-csv');var querystring=require(_0xea84('0x11'));var Papa=require(_0xea84('0x12'));var Redis=require(_0xea84('0x13'));var authService=require(_0xea84('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xea84('0x15'));var hardwareService=require(_0xea84('0x16'));var logger=require(_0xea84('0x17'))(_0xea84('0x18'));var utils=require(_0xea84('0x19'));var config=require(_0xea84('0x1a'));var licenseUtil=require(_0xea84('0x1b'));var db=require(_0xea84('0x1c'))['db'];function respondWithStatusCode(_0x43ae52,_0x2a4c01){_0x2a4c01=_0x2a4c01||0xcc;return function(_0x1bd46e){if(_0x1bd46e){return _0x43ae52['sendStatus'](_0x2a4c01);}return _0x43ae52[_0xea84('0x1d')](_0x2a4c01)[_0xea84('0x1e')]();};}function respondWithResult(_0x58d76f,_0x18f13c){_0x18f13c=_0x18f13c||0xc8;return function(_0x448def){if(_0x448def){return _0x58d76f[_0xea84('0x1d')](_0x18f13c)[_0xea84('0x1f')](_0x448def);}};}function respondWithFilteredResult(_0x30a91c,_0x507779){return function(_0x379b0d){if(_0x379b0d){var _0x44b311=typeof _0x507779['offset']===_0xea84('0x20')&&typeof _0x507779[_0xea84('0x21')]===_0xea84('0x20');var _0x539a6e=_0x379b0d[_0xea84('0x22')];var _0x5a5c59=_0x44b311?0x0:_0x507779[_0xea84('0x23')];var _0x126509=_0x44b311?_0x379b0d['count']:_0x507779[_0xea84('0x23')]+_0x507779['limit'];var _0x38e84e;if(_0x126509>=_0x539a6e){_0x126509=_0x539a6e;_0x38e84e=0xc8;}else{_0x38e84e=0xce;}_0x30a91c[_0xea84('0x1d')](_0x38e84e);return _0x30a91c[_0xea84('0x24')](_0xea84('0x25'),_0x5a5c59+'-'+_0x126509+'/'+_0x539a6e)['json'](_0x379b0d);}return null;};}function patchUpdates(_0xb23134){return function(_0xdfaea3){try{jsonpatch[_0xea84('0x26')](_0xdfaea3,_0xb23134,!![]);}catch(_0x571f5a){return BPromise[_0xea84('0x27')](_0x571f5a);}return _0xdfaea3[_0xea84('0x28')]();};}function saveUpdates(_0x3b0d97,_0x1d9cbf){return function(_0x59da27){if(_0x59da27){return _0x59da27[_0xea84('0x29')](_0x3b0d97)['then'](function(_0x5ed9fe){return _0x5ed9fe;});}return null;};}function removeEntity(_0x29f062,_0x28c2db){return function(_0x1e905c){if(_0x1e905c){return _0x1e905c[_0xea84('0x2a')]()[_0xea84('0x2b')](function(){var _0x2d2024=_0x1e905c[_0xea84('0x2c')]({'plain':!![]});var _0x10812a=_0xea84('0x2d');return db[_0xea84('0x2e')]['destroy']({'where':{'type':_0x10812a,'resourceId':_0x2d2024['id']}})[_0xea84('0x2b')](function(){return _0x1e905c;});})[_0xea84('0x2b')](function(){_0x29f062[_0xea84('0x1d')](0xcc)[_0xea84('0x1e')]();});}};}function handleEntityNotFound(_0x335aa8,_0x70490e){return function(_0xa2b10e){if(!_0xa2b10e){_0x335aa8[_0xea84('0x2f')](0x194);}return _0xa2b10e;};}function handleError(_0x380596,_0x4aebf4){_0x4aebf4=_0x4aebf4||0x1f4;return function(_0x4ab3b2){logger[_0xea84('0x30')](_0x4ab3b2['stack']);if(_0x4ab3b2[_0xea84('0x31')]){delete _0x4ab3b2[_0xea84('0x31')];}_0x380596['status'](_0x4aebf4)[_0xea84('0x32')](_0x4ab3b2);};}exports['index']=function(_0x441c5b,_0x174691){var _0xd62e4={},_0xe7b77f={},_0x207bbc={'count':0x0,'rows':[]};var _0x30f9d9=_[_0xea84('0x33')](db[_0xea84('0x34')]['rawAttributes'],function(_0x3742ea){return{'name':_0x3742ea[_0xea84('0x35')],'type':_0x3742ea[_0xea84('0x36')][_0xea84('0x37')]};});_0xe7b77f[_0xea84('0x38')]=_[_0xea84('0x33')](_0x30f9d9,_0xea84('0x31'));_0xe7b77f[_0xea84('0x39')]=_[_0xea84('0x3a')](_0x441c5b[_0xea84('0x39')]);_0xe7b77f[_0xea84('0x3b')]=_[_0xea84('0x3c')](_0xe7b77f['model'],_0xe7b77f[_0xea84('0x39')]);_0xd62e4[_0xea84('0x3d')]=_[_0xea84('0x3c')](_0xe7b77f[_0xea84('0x38')],qs['fields'](_0x441c5b[_0xea84('0x39')]['fields']));_0xd62e4[_0xea84('0x3d')]=_0xd62e4[_0xea84('0x3d')][_0xea84('0x3e')]?_0xd62e4[_0xea84('0x3d')]:_0xe7b77f[_0xea84('0x38')];if(!_0x441c5b['query'][_0xea84('0x3f')](_0xea84('0x40'))){_0xd62e4[_0xea84('0x21')]=qs['limit'](_0x441c5b[_0xea84('0x39')][_0xea84('0x21')]);_0xd62e4[_0xea84('0x23')]=qs[_0xea84('0x23')](_0x441c5b[_0xea84('0x39')][_0xea84('0x23')]);}_0xd62e4['order']=qs[_0xea84('0x41')](_0x441c5b['query'][_0xea84('0x41')]);_0xd62e4['where']=qs[_0xea84('0x3b')](_[_0xea84('0x42')](_0x441c5b[_0xea84('0x39')],_0xe7b77f[_0xea84('0x3b')]),_0x30f9d9);if(_0x441c5b[_0xea84('0x39')][_0xea84('0x43')]){_0xd62e4['where']=_['merge'](_0xd62e4[_0xea84('0x44')],{'$or':_[_0xea84('0x33')](_0x30f9d9,function(_0x2c8d6c){if(_0x2c8d6c[_0xea84('0x36')]!==_0xea84('0x45')){var _0x3cb89a={};_0x3cb89a[_0x2c8d6c['name']]={'$like':'%'+_0x441c5b[_0xea84('0x39')][_0xea84('0x43')]+'%'};return _0x3cb89a;}})});}_0xd62e4=_['merge']({},_0xd62e4,_0x441c5b['options']);var _0x55185a={'where':_0xd62e4['where']};return db['SquareOdbc'][_0xea84('0x22')](_0x55185a)['then'](function(_0x58bdc9){_0x207bbc['count']=_0x58bdc9;if(_0x441c5b[_0xea84('0x39')][_0xea84('0x46')]){_0xd62e4[_0xea84('0x47')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0xd62e4);})[_0xea84('0x2b')](function(_0x2309cd){_0x207bbc[_0xea84('0x48')]=_0x2309cd;return _0x207bbc;})[_0xea84('0x2b')](respondWithFilteredResult(_0x174691,_0xd62e4))['catch'](handleError(_0x174691,null));};exports[_0xea84('0x49')]=function(_0x11ae1e,_0x44ab8f){var _0x526c41={'raw':!![],'where':{'id':_0x11ae1e[_0xea84('0x4a')]['id']}},_0x5869cb={};_0x5869cb[_0xea84('0x38')]=_[_0xea84('0x3a')](db['SquareOdbc'][_0xea84('0x4b')]);_0x5869cb[_0xea84('0x39')]=_[_0xea84('0x3a')](_0x11ae1e[_0xea84('0x39')]);_0x5869cb[_0xea84('0x3b')]=_[_0xea84('0x3c')](_0x5869cb[_0xea84('0x38')],_0x5869cb[_0xea84('0x39')]);_0x526c41[_0xea84('0x3d')]=_[_0xea84('0x3c')](_0x5869cb[_0xea84('0x38')],qs[_0xea84('0x4c')](_0x11ae1e['query']['fields']));_0x526c41[_0xea84('0x3d')]=_0x526c41[_0xea84('0x3d')]['length']?_0x526c41['attributes']:_0x5869cb[_0xea84('0x38')];if(_0x11ae1e[_0xea84('0x39')]['includeAll']){_0x526c41[_0xea84('0x47')]=[{'all':!![]}];}_0x526c41=_['merge']({},_0x526c41,_0x11ae1e[_0xea84('0x4d')]);return db[_0xea84('0x34')]['find'](_0x526c41)['then'](handleEntityNotFound(_0x44ab8f,null))['then'](respondWithResult(_0x44ab8f,null))['catch'](handleError(_0x44ab8f,null));};exports['create']=function(_0x6f3a11,_0x47d9c7){return db[_0xea84('0x34')][_0xea84('0x4e')](_0x6f3a11[_0xea84('0x4f')],{})[_0xea84('0x2b')](function(_0x1775fb){var _0x3553b8=_0x6f3a11[_0xea84('0x50')][_0xea84('0x2c')]({'plain':!![]});if(!_0x3553b8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3553b8[_0xea84('0x51')]===_0xea84('0x50')){var _0x1bd97d=_0x1775fb['get']({'plain':!![]});var _0x263da4='ODBC';return db[_0xea84('0x52')][_0xea84('0x53')]({'where':{'name':_0x263da4,'userProfileId':_0x3553b8[_0xea84('0x54')]},'raw':!![]})['then'](function(_0xa91147){if(_0xa91147&&_0xa91147['autoAssociation']===0x0){return db[_0xea84('0x2e')]['create']({'name':_0x1bd97d['name'],'resourceId':_0x1bd97d['id'],'type':_0xa91147[_0xea84('0x31')],'sectionId':_0xa91147['id']},{})[_0xea84('0x2b')](function(){return _0x1775fb;});}else{return _0x1775fb;}})[_0xea84('0x55')](function(_0x2c6b43){logger[_0xea84('0x30')](_0xea84('0x56'),_0x2c6b43);throw _0x2c6b43;});}return _0x1775fb;})[_0xea84('0x2b')](respondWithResult(_0x47d9c7,0xc9))['catch'](handleError(_0x47d9c7,null));};exports[_0xea84('0x29')]=function(_0x3852bb,_0x211439){if(_0x3852bb[_0xea84('0x4f')]['id']){delete _0x3852bb['body']['id'];}return db[_0xea84('0x34')]['find']({'where':{'id':_0x3852bb['params']['id']}})[_0xea84('0x2b')](handleEntityNotFound(_0x211439,null))[_0xea84('0x2b')](saveUpdates(_0x3852bb[_0xea84('0x4f')],null))[_0xea84('0x2b')](respondWithResult(_0x211439,null))[_0xea84('0x55')](handleError(_0x211439,null));};exports[_0xea84('0x2a')]=function(_0x158477,_0x43db1a){return db[_0xea84('0x34')]['find']({'where':{'id':_0x158477[_0xea84('0x4a')]['id']}})['then'](handleEntityNotFound(_0x43db1a,null))[_0xea84('0x2b')](removeEntity(_0x43db1a,null))[_0xea84('0x55')](handleError(_0x43db1a,null));};exports['test']=function(_0x214725,_0x4ebb56,_0x1d988f){var _0x631261;return db[_0xea84('0x34')][_0xea84('0x53')]({'where':{'id':_0x214725[_0xea84('0x4a')]['id']},'attributes':['id',_0xea84('0x57')]})[_0xea84('0x2b')](handleEntityNotFound(_0x4ebb56,null))[_0xea84('0x2b')](function(_0x23577c){if(_0x23577c){var _0x4837c8=require(_0xea84('0x58'))();_0x4837c8[_0xea84('0x59')](_0x23577c['dsn']);_0x4837c8['closeSync']();return _0x23577c;}})[_0xea84('0x2b')](respondWithResult(_0x4ebb56,null))[_0xea84('0x55')](handleError(_0x4ebb56,null));};
\ No newline at end of file
index 38bca60..feec23b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfda1=['define','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfda1,0x9f));var _0x1fda=function(_0x3f8a38,_0x274364){_0x3f8a38=_0x3f8a38-0x0;var _0xab48c=_0xfda1[_0x3f8a38];return _0xab48c;};'use strict';var _=require(_0x1fda('0x0'));var util=require('util');var logger=require(_0x1fda('0x1'))(_0x1fda('0x2'));var moment=require(_0x1fda('0x3'));var BPromise=require(_0x1fda('0x4'));var rp=require(_0x1fda('0x5'));var fs=require('fs');var path=require(_0x1fda('0x6'));var rimraf=require(_0x1fda('0x7'));var config=require(_0x1fda('0x8'));var attributes=require('./squareOdbc.attributes');module[_0x1fda('0x9')]=function(_0x3af7c0,_0x963b28){return _0x3af7c0[_0x1fda('0xa')](_0x1fda('0xb'),attributes,{'tableName':_0x1fda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcbf5=['api','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','square_odbc','util','../../config/logger'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xcbf5,0x1e2));var _0x5cbf=function(_0x1bebac,_0x1e74a1){_0x1bebac=_0x1bebac-0x0;var _0x776561=_0xcbf5[_0x1bebac];return _0x776561;};'use strict';var _=require('lodash');var util=require(_0x5cbf('0x0'));var logger=require(_0x5cbf('0x1'))(_0x5cbf('0x2'));var moment=require('moment');var BPromise=require(_0x5cbf('0x3'));var rp=require(_0x5cbf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5cbf('0x5'));var config=require(_0x5cbf('0x6'));var attributes=require(_0x5cbf('0x7'));module[_0x5cbf('0x8')]=function(_0x4d9535,_0x352bc2){return _0x4d9535[_0x5cbf('0x9')]('SquareOdbc',attributes,{'tableName':_0x5cbf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 59baa5f..245a840 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a84=['rpc','../../config/environment','jayson/promise','client','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','SquareOdbc','find','options','raw','where','attributes','include','map','model','ShowSquareOdbc','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0x5a84,0x19b));var _0x45a8=function(_0x1f1a6a,_0x56285e){_0x1f1a6a=_0x1f1a6a-0x0;var _0x1e40ab=_0x5a84[_0x1f1a6a];return _0x1e40ab;};'use strict';var _=require(_0x45a8('0x0'));var util=require(_0x45a8('0x1'));var moment=require(_0x45a8('0x2'));var BPromise=require(_0x45a8('0x3'));var rs=require(_0x45a8('0x4'));var fs=require('fs');var Redis=require(_0x45a8('0x5'));var db=require(_0x45a8('0x6'))['db'];var utils=require(_0x45a8('0x7'));var logger=require(_0x45a8('0x8'))(_0x45a8('0x9'));var config=require(_0x45a8('0xa'));var jayson=require(_0x45a8('0xb'));var client=jayson[_0x45a8('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43c365,_0xfae7f6,_0x18cb5a){return new BPromise(function(_0x4204ec,_0x534026){return client[_0x45a8('0xd')](_0x43c365,_0x18cb5a)[_0x45a8('0xe')](function(_0x5d9111){logger['info'](_0x45a8('0xf'),_0xfae7f6,_0x45a8('0x10'));logger[_0x45a8('0x11')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0xfae7f6,_0x45a8('0x10'),JSON[_0x45a8('0x12')](_0x5d9111));if(_0x5d9111[_0x45a8('0x13')]){if(_0x5d9111[_0x45a8('0x13')][_0x45a8('0x14')]===0x1f4){logger[_0x45a8('0x13')](_0x45a8('0xf'),_0xfae7f6,_0x5d9111[_0x45a8('0x13')][_0x45a8('0x15')]);return _0x534026(_0x5d9111[_0x45a8('0x13')][_0x45a8('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0xfae7f6,_0x5d9111[_0x45a8('0x13')][_0x45a8('0x15')]);return _0x4204ec(_0x5d9111['error']['message']);}else{logger[_0x45a8('0x16')]('SquareOdbc,\x20%s,\x20%s',_0xfae7f6,_0x45a8('0x10'));_0x4204ec(_0x5d9111[_0x45a8('0x17')][_0x45a8('0x15')]);}})['catch'](function(_0x2c43f){logger[_0x45a8('0x13')]('SquareOdbc,\x20%s,\x20%s',_0xfae7f6,_0x2c43f);_0x534026(_0x2c43f);});});}exports['ShowSquareOdbc']=function(_0x30ffd6){var _0x276020=this;return new Promise(function(_0x193d3c,_0x1fc4e0){return db[_0x45a8('0x18')][_0x45a8('0x19')]({'raw':_0x30ffd6[_0x45a8('0x1a')]?_0x30ffd6[_0x45a8('0x1a')][_0x45a8('0x1b')]===undefined?!![]:![]:!![],'where':_0x30ffd6[_0x45a8('0x1a')]?_0x30ffd6[_0x45a8('0x1a')][_0x45a8('0x1c')]||null:null,'attributes':_0x30ffd6[_0x45a8('0x1a')]?_0x30ffd6[_0x45a8('0x1a')][_0x45a8('0x1d')]||null:null,'include':_0x30ffd6[_0x45a8('0x1a')]?_0x30ffd6['options'][_0x45a8('0x1e')]?_[_0x45a8('0x1f')](_0x30ffd6[_0x45a8('0x1a')][_0x45a8('0x1e')],function(_0x585e67){return{'model':db[_0x585e67[_0x45a8('0x20')]],'as':_0x585e67['as'],'attributes':_0x585e67[_0x45a8('0x1d')],'include':_0x585e67[_0x45a8('0x1e')]?_[_0x45a8('0x1f')](_0x585e67[_0x45a8('0x1e')],function(_0x16273d){return{'model':db[_0x16273d[_0x45a8('0x20')]],'as':_0x16273d['as'],'attributes':_0x16273d[_0x45a8('0x1d')],'include':_0x16273d[_0x45a8('0x1e')]?_[_0x45a8('0x1f')](_0x16273d[_0x45a8('0x1e')],function(_0x30a2ce){return{'model':db[_0x30a2ce[_0x45a8('0x20')]],'as':_0x30a2ce['as'],'attributes':_0x30a2ce[_0x45a8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x45a8('0xe')](function(_0x4d728d){logger[_0x45a8('0x16')]('ShowSquareOdbc',_0x30ffd6);logger['debug'](_0x45a8('0x21'),_0x30ffd6,JSON['stringify'](_0x4d728d));_0x193d3c(_0x4d728d);})[_0x45a8('0x22')](function(_0x3b725){logger[_0x45a8('0x13')](_0x45a8('0x21'),_0x3b725[_0x45a8('0x15')],_0x30ffd6);_0x1fc4e0(_0x276020[_0x45a8('0x13')](0x1f4,_0x3b725[_0x45a8('0x15')]));});});};
\ No newline at end of file
+var _0x15a6=['include','model','attributes','then','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ShowSquareOdbc','SquareOdbc','find','options','where','map'];(function(_0x11cb05,_0x482088){var _0xd1bb53=function(_0xaf5b95){while(--_0xaf5b95){_0x11cb05['push'](_0x11cb05['shift']());}};_0xd1bb53(++_0x482088);}(_0x15a6,0x127));var _0x615a=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x15a6[_0x4bb66f];return _0xf2772f;};'use strict';var _=require('lodash');var util=require(_0x615a('0x0'));var moment=require(_0x615a('0x1'));var BPromise=require(_0x615a('0x2'));var rs=require(_0x615a('0x3'));var fs=require('fs');var Redis=require(_0x615a('0x4'));var db=require(_0x615a('0x5'))['db'];var utils=require(_0x615a('0x6'));var logger=require('../../config/logger')(_0x615a('0x7'));var config=require('../../config/environment');var jayson=require(_0x615a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5290dd,_0x566d43,_0xf89b33){return new BPromise(function(_0x147024,_0x234632){return client['request'](_0x5290dd,_0xf89b33)['then'](function(_0x467470){logger['info'](_0x615a('0x9'),_0x566d43,_0x615a('0xa'));logger[_0x615a('0xb')](_0x615a('0xc'),_0x566d43,_0x615a('0xa'),JSON[_0x615a('0xd')](_0x467470));if(_0x467470['error']){if(_0x467470[_0x615a('0xe')]['code']===0x1f4){logger[_0x615a('0xe')](_0x615a('0x9'),_0x566d43,_0x467470[_0x615a('0xe')][_0x615a('0xf')]);return _0x234632(_0x467470[_0x615a('0xe')][_0x615a('0xf')]);}logger[_0x615a('0xe')](_0x615a('0x9'),_0x566d43,_0x467470['error'][_0x615a('0xf')]);return _0x147024(_0x467470[_0x615a('0xe')][_0x615a('0xf')]);}else{logger[_0x615a('0x10')](_0x615a('0x9'),_0x566d43,_0x615a('0xa'));_0x147024(_0x467470[_0x615a('0x11')][_0x615a('0xf')]);}})['catch'](function(_0x39b2d6){logger[_0x615a('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x566d43,_0x39b2d6);_0x234632(_0x39b2d6);});});}exports[_0x615a('0x12')]=function(_0x29e8ab){var _0x897bcd=this;return new Promise(function(_0x40d561,_0x290ce6){return db[_0x615a('0x13')][_0x615a('0x14')]({'raw':_0x29e8ab[_0x615a('0x15')]?_0x29e8ab[_0x615a('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x29e8ab[_0x615a('0x15')]?_0x29e8ab[_0x615a('0x15')][_0x615a('0x16')]||null:null,'attributes':_0x29e8ab['options']?_0x29e8ab['options']['attributes']||null:null,'include':_0x29e8ab[_0x615a('0x15')]?_0x29e8ab[_0x615a('0x15')]['include']?_[_0x615a('0x17')](_0x29e8ab[_0x615a('0x15')][_0x615a('0x18')],function(_0x3b50d3){return{'model':db[_0x3b50d3[_0x615a('0x19')]],'as':_0x3b50d3['as'],'attributes':_0x3b50d3[_0x615a('0x1a')],'include':_0x3b50d3[_0x615a('0x18')]?_[_0x615a('0x17')](_0x3b50d3[_0x615a('0x18')],function(_0x369373){return{'model':db[_0x369373[_0x615a('0x19')]],'as':_0x369373['as'],'attributes':_0x369373['attributes'],'include':_0x369373[_0x615a('0x18')]?_[_0x615a('0x17')](_0x369373[_0x615a('0x18')],function(_0x26fab8){return{'model':db[_0x26fab8[_0x615a('0x19')]],'as':_0x26fab8['as'],'attributes':_0x26fab8['attributes']};}):[]};}):[]};}):[]:[]})[_0x615a('0x1b')](function(_0x28cf14){logger[_0x615a('0x10')](_0x615a('0x12'),_0x29e8ab);logger[_0x615a('0xb')](_0x615a('0x12'),_0x29e8ab,JSON[_0x615a('0xd')](_0x28cf14));_0x40d561(_0x28cf14);})[_0x615a('0x1c')](function(_0x5b6df1){logger[_0x615a('0xe')](_0x615a('0x12'),_0x5b6df1[_0x615a('0xf')],_0x29e8ab);_0x290ce6(_0x897bcd['error'](0x1f4,_0x5b6df1[_0x615a('0xf')]));});});};
\ No newline at end of file
index 453ccc2..46394eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc15c=['destroy','removeUsers','exports','path','connect-timeout','express','fs-extra','../../config/environment','isAuthenticated','index','show','get','/:id/users','post','create','addUsers','put','update','/:id'];(function(_0x3f8871,_0x33114d){var _0xe7fdad=function(_0xd0076e){while(--_0xd0076e){_0x3f8871['push'](_0x3f8871['shift']());}};_0xe7fdad(++_0x33114d);}(_0xc15c,0xae));var _0xcc15=function(_0x4f10b8,_0x1ec29d){_0x4f10b8=_0x4f10b8-0x0;var _0xc8e242=_0xc15c[_0x4f10b8];return _0xc8e242;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcc15('0x0'));var timeout=require(_0xcc15('0x1'));var express=require(_0xcc15('0x2'));var router=express['Router']();var fs_extra=require(_0xcc15('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcc15('0x4'));var controller=require('./squareProject.controller');router['get']('/',auth[_0xcc15('0x5')](),controller[_0xcc15('0x6')]);router['get']('/:id',auth[_0xcc15('0x5')](),controller[_0xcc15('0x7')]);router[_0xcc15('0x8')](_0xcc15('0x9'),auth[_0xcc15('0x5')](),controller['getUsers']);router[_0xcc15('0xa')]('/',auth[_0xcc15('0x5')](),controller[_0xcc15('0xb')]);router[_0xcc15('0xa')]('/:id/users',auth[_0xcc15('0x5')](),controller[_0xcc15('0xc')]);router[_0xcc15('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xcc15('0xe')]);router['delete'](_0xcc15('0xf'),auth['isAuthenticated'](),controller[_0xcc15('0x10')]);router['delete'](_0xcc15('0x9'),auth['isAuthenticated'](),controller[_0xcc15('0x11')]);module[_0xcc15('0x12')]=router;
\ No newline at end of file
+var _0x1d11=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','get','/:id','/:id/users','post','create','addUsers','update','delete','destroy','removeUsers','exports','multer','util'];(function(_0x2a8c17,_0x69c1cd){var _0x1d0942=function(_0x18ac6b){while(--_0x18ac6b){_0x2a8c17['push'](_0x2a8c17['shift']());}};_0x1d0942(++_0x69c1cd);}(_0x1d11,0xb6));var _0x11d1=function(_0x57ef4f,_0x57d60d){_0x57ef4f=_0x57ef4f-0x0;var _0x4f69c8=_0x1d11[_0x57ef4f];return _0x4f69c8;};'use strict';var multer=require(_0x11d1('0x0'));var util=require(_0x11d1('0x1'));var path=require(_0x11d1('0x2'));var timeout=require(_0x11d1('0x3'));var express=require(_0x11d1('0x4'));var router=express[_0x11d1('0x5')]();var fs_extra=require(_0x11d1('0x6'));var auth=require(_0x11d1('0x7'));var interaction=require(_0x11d1('0x8'));var config=require(_0x11d1('0x9'));var controller=require(_0x11d1('0xa'));router['get']('/',auth[_0x11d1('0xb')](),controller['index']);router[_0x11d1('0xc')](_0x11d1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x11d1('0xc')](_0x11d1('0xe'),auth['isAuthenticated'](),controller['getUsers']);router[_0x11d1('0xf')]('/',auth[_0x11d1('0xb')](),controller[_0x11d1('0x10')]);router['post']('/:id/users',auth[_0x11d1('0xb')](),controller[_0x11d1('0x11')]);router['put']('/:id',auth[_0x11d1('0xb')](),controller[_0x11d1('0x12')]);router[_0x11d1('0x13')](_0x11d1('0xd'),auth['isAuthenticated'](),controller[_0x11d1('0x14')]);router[_0x11d1('0x13')](_0x11d1('0xe'),auth['isAuthenticated'](),controller[_0x11d1('0x15')]);module[_0x11d1('0x16')]=router;
\ No newline at end of file
index d92111b..ac56bf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22ea=['name','TEXT','long','getDataValue','preproduction','BLOB','production','toString','utf8','DATE','sequelize','exports','STRING'];(function(_0x1d7245,_0x33db59){var _0x3989fc=function(_0x4db04){while(--_0x4db04){_0x1d7245['push'](_0x1d7245['shift']());}};_0x3989fc(++_0x33db59);}(_0x22ea,0xb3));var _0xa22e=function(_0x123902,_0x4912bf){_0x123902=_0x123902-0x0;var _0x1464f1=_0x22ea[_0x123902];return _0x1464f1;};'use strict';var Sequelize=require(_0xa22e('0x0'));module[_0xa22e('0x1')]={'name':{'type':Sequelize[_0xa22e('0x2')],'unique':_0xa22e('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xa22e('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0xa22e('0x5')),'get':function(){if(this[_0xa22e('0x6')](_0xa22e('0x7'))){return this[_0xa22e('0x6')](_0xa22e('0x7'))['toString']('utf8');}}},'production':{'type':Sequelize[_0xa22e('0x8')](_0xa22e('0x5')),'get':function(){if(this[_0xa22e('0x6')](_0xa22e('0x9'))){return this[_0xa22e('0x6')](_0xa22e('0x9'))[_0xa22e('0xa')](_0xa22e('0xb'));}}},'savedAt':{'type':Sequelize[_0xa22e('0xc')]},'publishedAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xdb18=['sequelize','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x31e643,_0x138c74){var _0x14ac06=function(_0x50bfc5){while(--_0x50bfc5){_0x31e643['push'](_0x31e643['shift']());}};_0x14ac06(++_0x138c74);}(_0xdb18,0x1e0));var _0x8db1=function(_0x736486,_0x3ab434){_0x736486=_0x736486-0x0;var _0x3084f3=_0xdb18[_0x736486];return _0x3084f3;};'use strict';var Sequelize=require(_0x8db1('0x0'));module[_0x8db1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x8db1('0x2')]},'notes':{'type':Sequelize[_0x8db1('0x3')]},'preproduction':{'type':Sequelize[_0x8db1('0x4')](_0x8db1('0x5')),'get':function(){if(this[_0x8db1('0x6')](_0x8db1('0x7'))){return this[_0x8db1('0x6')](_0x8db1('0x7'))[_0x8db1('0x8')](_0x8db1('0x9'));}}},'production':{'type':Sequelize[_0x8db1('0x4')](_0x8db1('0x5')),'get':function(){if(this[_0x8db1('0x6')](_0x8db1('0xa'))){return this[_0x8db1('0x6')]('production')['toString'](_0x8db1('0x9'));}}},'savedAt':{'type':Sequelize[_0x8db1('0xb')]},'publishedAt':{'type':Sequelize[_0x8db1('0xb')]}};
\ No newline at end of file
index a3f9cc1..e655787 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc24a=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','name','send','index','map','SquareProject','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc24a,0x169));var _0xac24=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc24a[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xac24('0x0'));var rimraf=require(_0xac24('0x1'));var zipdir=require(_0xac24('0x2'));var jsonpatch=require(_0xac24('0x3'));var rp=require(_0xac24('0x4'));var moment=require(_0xac24('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac24('0x6'));var sox=require('sox');var csv=require(_0xac24('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac24('0x8'));var _=require(_0xac24('0x9'));var squel=require(_0xac24('0xa'));var crypto=require(_0xac24('0xb'));var jsforce=require(_0xac24('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xac24('0xd'));var Papa=require(_0xac24('0xe'));var Redis=require(_0xac24('0xf'));var authService=require(_0xac24('0x10'));var qs=require(_0xac24('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac24('0x12'));var logger=require(_0xac24('0x13'))('api');var utils=require(_0xac24('0x14'));var config=require(_0xac24('0x15'));var licenseUtil=require(_0xac24('0x16'));var db=require('../../mysqldb')['db'];config[_0xac24('0x17')]=_[_0xac24('0x18')](config[_0xac24('0x17')],{'host':_0xac24('0x19'),'port':0x18eb});var socket=require(_0xac24('0x1a'))(new Redis(config[_0xac24('0x17')]));require(_0xac24('0x1b'))[_0xac24('0x1c')](socket);function respondWithStatusCode(_0x294617,_0x156c42){_0x156c42=_0x156c42||0xcc;return function(_0xc8cf67){if(_0xc8cf67){return _0x294617[_0xac24('0x1d')](_0x156c42);}return _0x294617[_0xac24('0x1e')](_0x156c42)[_0xac24('0x1f')]();};}function respondWithResult(_0x2c89d9,_0x11cb00){_0x11cb00=_0x11cb00||0xc8;return function(_0x2a9acd){if(_0x2a9acd){return _0x2c89d9[_0xac24('0x1e')](_0x11cb00)[_0xac24('0x20')](_0x2a9acd);}};}function respondWithFilteredResult(_0x16385c,_0x587b7d){return function(_0x5e6246){if(_0x5e6246){var _0x5eb73d=typeof _0x587b7d[_0xac24('0x21')]===_0xac24('0x22')&&typeof _0x587b7d[_0xac24('0x23')]===_0xac24('0x22');var _0x359332=_0x5e6246[_0xac24('0x24')];var _0x4a4fe1=_0x5eb73d?0x0:_0x587b7d[_0xac24('0x21')];var _0x4b460e=_0x5eb73d?_0x5e6246['count']:_0x587b7d[_0xac24('0x21')]+_0x587b7d[_0xac24('0x23')];var _0x3bdc37;if(_0x4b460e>=_0x359332){_0x4b460e=_0x359332;_0x3bdc37=0xc8;}else{_0x3bdc37=0xce;}_0x16385c[_0xac24('0x1e')](_0x3bdc37);return _0x16385c['set']('Content-Range',_0x4a4fe1+'-'+_0x4b460e+'/'+_0x359332)[_0xac24('0x20')](_0x5e6246);}return null;};}function patchUpdates(_0x2a5d8d){return function(_0x3964c5){try{jsonpatch[_0xac24('0x25')](_0x3964c5,_0x2a5d8d,!![]);}catch(_0x3c7720){return BPromise[_0xac24('0x26')](_0x3c7720);}return _0x3964c5[_0xac24('0x27')]();};}function saveUpdates(_0x5d2857,_0x334c9a){return function(_0x3bbf92){if(_0x3bbf92){return _0x3bbf92[_0xac24('0x28')](_0x5d2857)[_0xac24('0x29')](function(_0x33b2e9){return _0x33b2e9;});}return null;};}function removeEntity(_0x17bc27,_0x26f8ec){return function(_0x1c7cb3){if(_0x1c7cb3){return _0x1c7cb3[_0xac24('0x2a')]()[_0xac24('0x29')](function(){var _0x248d0e=_0x1c7cb3[_0xac24('0x2b')]({'plain':!![]});var _0xb179b3=_0xac24('0x2c');return db[_0xac24('0x2d')][_0xac24('0x2a')]({'where':{'type':_0xb179b3,'resourceId':_0x248d0e['id']}})[_0xac24('0x29')](function(){return _0x1c7cb3;});})['then'](function(){_0x17bc27[_0xac24('0x1e')](0xcc)[_0xac24('0x1f')]();});}};}function handleEntityNotFound(_0x18760f,_0x49a96b){return function(_0x3d33ce){if(!_0x3d33ce){_0x18760f[_0xac24('0x1d')](0x194);}return _0x3d33ce;};}function handleError(_0x2a5e90,_0x2c7e5d){_0x2c7e5d=_0x2c7e5d||0x1f4;return function(_0x4adb50){logger['error'](_0x4adb50['stack']);if(_0x4adb50[_0xac24('0x2e')]){delete _0x4adb50[_0xac24('0x2e')];}_0x2a5e90[_0xac24('0x1e')](_0x2c7e5d)[_0xac24('0x2f')](_0x4adb50);};}exports[_0xac24('0x30')]=function(_0x1fdb8f,_0x3e0437){var _0x955c96={},_0x46ffab={},_0x226b77={'count':0x0,'rows':[]};var _0x52f63c=_[_0xac24('0x31')](db[_0xac24('0x32')]['rawAttributes'],function(_0x178e5e){return{'name':_0x178e5e[_0xac24('0x33')],'type':_0x178e5e[_0xac24('0x34')][_0xac24('0x35')]};});_0x46ffab['model']=_[_0xac24('0x31')](_0x52f63c,_0xac24('0x2e'));_0x46ffab[_0xac24('0x36')]=_['keys'](_0x1fdb8f[_0xac24('0x36')]);_0x46ffab['filters']=_[_0xac24('0x37')](_0x46ffab['model'],_0x46ffab[_0xac24('0x36')]);_0x955c96['attributes']=_[_0xac24('0x37')](_0x46ffab[_0xac24('0x38')],qs[_0xac24('0x39')](_0x1fdb8f[_0xac24('0x36')]['fields']));_0x955c96[_0xac24('0x3a')]=_0x955c96[_0xac24('0x3a')][_0xac24('0x3b')]?_0x955c96[_0xac24('0x3a')]:_0x46ffab[_0xac24('0x38')];if(!_0x1fdb8f[_0xac24('0x36')][_0xac24('0x3c')](_0xac24('0x3d'))){_0x955c96[_0xac24('0x23')]=qs[_0xac24('0x23')](_0x1fdb8f[_0xac24('0x36')][_0xac24('0x23')]);_0x955c96['offset']=qs['offset'](_0x1fdb8f[_0xac24('0x36')]['offset']);}_0x955c96[_0xac24('0x3e')]=qs[_0xac24('0x3f')](_0x1fdb8f['query']['sort']);_0x955c96[_0xac24('0x40')]=qs[_0xac24('0x41')](_[_0xac24('0x42')](_0x1fdb8f[_0xac24('0x36')],_0x46ffab[_0xac24('0x41')]),_0x52f63c);if(_0x1fdb8f[_0xac24('0x36')][_0xac24('0x43')]){_0x955c96[_0xac24('0x40')]=_['merge'](_0x955c96['where'],{'$or':_['map'](_0x52f63c,function(_0x351108){if(_0x351108[_0xac24('0x34')]!==_0xac24('0x44')){var _0x53ff8d={};_0x53ff8d[_0x351108[_0xac24('0x2e')]]={'$like':'%'+_0x1fdb8f['query'][_0xac24('0x43')]+'%'};return _0x53ff8d;}})});}_0x955c96=_[_0xac24('0x45')]({},_0x955c96,_0x1fdb8f['options']);var _0x4a7e2b={'where':_0x955c96[_0xac24('0x40')]};return db['SquareProject'][_0xac24('0x24')](_0x4a7e2b)[_0xac24('0x29')](function(_0x4584cd){_0x226b77[_0xac24('0x24')]=_0x4584cd;if(_0x1fdb8f[_0xac24('0x36')][_0xac24('0x46')]){_0x955c96[_0xac24('0x47')]=[{'all':!![]}];}return db[_0xac24('0x32')][_0xac24('0x48')](_0x955c96);})[_0xac24('0x29')](function(_0x4da021){_0x226b77['rows']=_0x4da021;return _0x226b77;})[_0xac24('0x29')](respondWithFilteredResult(_0x3e0437,_0x955c96))[_0xac24('0x49')](handleError(_0x3e0437,null));};exports['show']=function(_0x152951,_0x4376eb){var _0x506905={'raw':![],'where':{'id':_0x152951[_0xac24('0x4a')]['id']}},_0x521e78={};_0x521e78[_0xac24('0x38')]=_[_0xac24('0x4b')](db[_0xac24('0x32')][_0xac24('0x4c')]);_0x521e78[_0xac24('0x36')]=_[_0xac24('0x4b')](_0x152951[_0xac24('0x36')]);_0x521e78['filters']=_['intersection'](_0x521e78[_0xac24('0x38')],_0x521e78[_0xac24('0x36')]);_0x506905['attributes']=_[_0xac24('0x37')](_0x521e78['model'],qs[_0xac24('0x39')](_0x152951[_0xac24('0x36')][_0xac24('0x39')]));_0x506905[_0xac24('0x3a')]=_0x506905[_0xac24('0x3a')][_0xac24('0x3b')]?_0x506905[_0xac24('0x3a')]:_0x521e78[_0xac24('0x38')];if(_0x152951[_0xac24('0x36')][_0xac24('0x46')]){_0x506905[_0xac24('0x47')]=[{'all':!![]}];}_0x506905=_['merge']({},_0x506905,_0x152951['options']);return db['SquareProject'][_0xac24('0x4d')](_0x506905)[_0xac24('0x29')](handleEntityNotFound(_0x4376eb,null))[_0xac24('0x29')](respondWithResult(_0x4376eb,null))['catch'](handleError(_0x4376eb,null));};exports[_0xac24('0x4e')]=function(_0x531b43,_0x3475fe){return db[_0xac24('0x32')]['create'](_0x531b43[_0xac24('0x4f')],{})[_0xac24('0x29')](function(_0x35db84){var _0x1efb2d=_0x531b43['user'][_0xac24('0x2b')]({'plain':!![]});if(!_0x1efb2d)throw new Error(_0xac24('0x50'));if(_0x1efb2d['role']==='user'){var _0x3766e5=_0x35db84[_0xac24('0x2b')]({'plain':!![]});var _0x21898b=_0xac24('0x2c');return db[_0xac24('0x51')]['find']({'where':{'name':_0x21898b,'userProfileId':_0x1efb2d[_0xac24('0x52')]},'raw':!![]})['then'](function(_0x35dfa6){if(_0x35dfa6&&_0x35dfa6[_0xac24('0x53')]===0x0){return db[_0xac24('0x2d')][_0xac24('0x4e')]({'name':_0x3766e5['name'],'resourceId':_0x3766e5['id'],'type':_0x35dfa6[_0xac24('0x2e')],'sectionId':_0x35dfa6['id']},{})[_0xac24('0x29')](function(){return _0x35db84;});}else{return _0x35db84;}})[_0xac24('0x49')](function(_0x1ae104){logger[_0xac24('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ae104);throw _0x1ae104;});}return _0x35db84;})[_0xac24('0x29')](respondWithResult(_0x3475fe,0xc9))['catch'](handleError(_0x3475fe,null));};exports['update']=function(_0x2b656b,_0x69c925){if(_0x2b656b[_0xac24('0x4f')]['id']){delete _0x2b656b[_0xac24('0x4f')]['id'];}return db[_0xac24('0x32')][_0xac24('0x4d')]({'where':{'id':_0x2b656b[_0xac24('0x4a')]['id']}})[_0xac24('0x29')](handleEntityNotFound(_0x69c925,null))['then'](saveUpdates(_0x2b656b[_0xac24('0x4f')],null))['then'](respondWithResult(_0x69c925,null))[_0xac24('0x49')](handleError(_0x69c925,null));};exports[_0xac24('0x2a')]=function(_0x5de091,_0x582d6e){return db[_0xac24('0x32')][_0xac24('0x4d')]({'where':{'id':_0x5de091[_0xac24('0x4a')]['id']}})['then'](handleEntityNotFound(_0x582d6e,null))[_0xac24('0x29')](removeEntity(_0x582d6e,null))[_0xac24('0x49')](handleError(_0x582d6e,null));};exports[_0xac24('0x55')]=function(_0x1949e1,_0x312a99,_0x5c520a){return db[_0xac24('0x32')][_0xac24('0x4d')]({'where':{'id':_0x1949e1['params']['id']}})[_0xac24('0x29')](handleEntityNotFound(_0x312a99,null))[_0xac24('0x29')](function(_0xf98f8d){if(_0xf98f8d){return _0xf98f8d[_0xac24('0x55')](_0x1949e1[_0xac24('0x4f')][_0xac24('0x56')],_['omit'](_0x1949e1[_0xac24('0x4f')],[_0xac24('0x56'),'id'])||{});}})[_0xac24('0x29')](respondWithResult(_0x312a99,null))[_0xac24('0x49')](handleError(_0x312a99,null));};exports[_0xac24('0x57')]=function(_0x512a49,_0xa09eac,_0x68eb51){return db['SquareProject'][_0xac24('0x4d')]({'where':{'id':_0x512a49[_0xac24('0x4a')]['id']}})[_0xac24('0x29')](handleEntityNotFound(_0xa09eac,null))[_0xac24('0x29')](function(_0x1670cf){if(_0x1670cf){return _0x1670cf[_0xac24('0x57')](_0x512a49['query'][_0xac24('0x56')])[_0xac24('0x29')](function(){if(_[_0xac24('0x58')](_0x512a49['query'][_0xac24('0x56')])){for(var _0x3f4298=0x0;_0x3f4298<_0x512a49[_0xac24('0x36')][_0xac24('0x56')][_0xac24('0x3b')];_0x3f4298+=0x1){socket[_0xac24('0x59')](_0xac24('0x5a'),{'UserId':Number(_0x512a49[_0xac24('0x36')][_0xac24('0x56')][_0x3f4298]),'SquareProjectId':Number(_0x512a49[_0xac24('0x4a')]['id'])});}}else{socket['emit'](_0xac24('0x5a'),{'UserId':Number(_0x512a49[_0xac24('0x36')][_0xac24('0x56')]),'SquareProjectId':Number(_0x512a49[_0xac24('0x4a')]['id'])});}});}})[_0xac24('0x29')](respondWithStatusCode(_0xa09eac,null))[_0xac24('0x49')](handleError(_0xa09eac,null));};exports[_0xac24('0x5b')]=function(_0x437a47,_0x56f8e1,_0x48706f){var _0x2df4a4={};var _0x31e6a9={};var _0x3b2a4f;var _0x2f8229;return db[_0xac24('0x32')][_0xac24('0x5c')]({'where':{'id':_0x437a47['params']['id']}})[_0xac24('0x29')](handleEntityNotFound(_0x56f8e1,null))[_0xac24('0x29')](function(_0x4aa1cb){if(_0x4aa1cb){_0x3b2a4f=_0x4aa1cb;_0x31e6a9[_0xac24('0x38')]=_['keys'](db[_0xac24('0x5d')][_0xac24('0x4c')]);_0x31e6a9[_0xac24('0x36')]=_[_0xac24('0x4b')](_0x437a47[_0xac24('0x36')]);_0x31e6a9['filters']=_[_0xac24('0x37')](_0x31e6a9[_0xac24('0x38')],_0x31e6a9['query']);_0x2df4a4[_0xac24('0x3a')]=_['intersection'](_0x31e6a9[_0xac24('0x38')],qs[_0xac24('0x39')](_0x437a47[_0xac24('0x36')][_0xac24('0x39')]));_0x2df4a4[_0xac24('0x3a')]=_0x2df4a4['attributes'][_0xac24('0x3b')]?_0x2df4a4[_0xac24('0x3a')]:_0x31e6a9[_0xac24('0x38')];_0x2df4a4[_0xac24('0x3e')]=qs[_0xac24('0x3f')](_0x437a47['query'][_0xac24('0x3f')]);_0x2df4a4[_0xac24('0x40')]=qs[_0xac24('0x41')](_[_0xac24('0x42')](_0x437a47[_0xac24('0x36')],_0x31e6a9[_0xac24('0x41')]));if(_0x437a47['query'][_0xac24('0x43')]){_0x2df4a4['where']=_['merge'](_0x2df4a4[_0xac24('0x40')],{'$or':_['map'](_0x2df4a4[_0xac24('0x3a')],function(_0x1badea){var _0x5d442e={};_0x5d442e[_0x1badea]={'$like':'%'+_0x437a47['query'][_0xac24('0x43')]+'%'};return _0x5d442e;})});}_0x2df4a4=_[_0xac24('0x45')]({},_0x2df4a4,_0x437a47[_0xac24('0x5e')]);return _0x3b2a4f[_0xac24('0x5b')](_0x2df4a4);}})['then'](function(_0x13508f){if(_0x13508f){_0x2f8229=_0x13508f[_0xac24('0x3b')];if(!_0x437a47[_0xac24('0x36')][_0xac24('0x3c')]('nolimit')){_0x2df4a4[_0xac24('0x23')]=qs['limit'](_0x437a47[_0xac24('0x36')][_0xac24('0x23')]);_0x2df4a4[_0xac24('0x21')]=qs[_0xac24('0x21')](_0x437a47['query']['offset']);}return _0x3b2a4f['getUsers'](_0x2df4a4);}})[_0xac24('0x29')](function(_0x3c7441){if(_0x3c7441){return _0x3c7441?{'count':_0x2f8229,'rows':_0x3c7441}:null;}})[_0xac24('0x29')](respondWithResult(_0x56f8e1,null))['catch'](handleError(_0x56f8e1,null));};
\ No newline at end of file
+var _0xc8e7=['register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','findAll','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addUsers','ids','omit','removeUsers','emit','getUsers','findOne','User','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket'];(function(_0x3aae31,_0x15b4a3){var _0x122914=function(_0x3c11f8){while(--_0x3c11f8){_0x3aae31['push'](_0x3aae31['shift']());}};_0x122914(++_0x15b4a3);}(_0xc8e7,0x111));var _0x7c8e=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xc8e7[_0x80d733];return _0x435868;};'use strict';var emlformat=require(_0x7c8e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c8e('0x1'));var rp=require(_0x7c8e('0x2'));var moment=require(_0x7c8e('0x3'));var BPromise=require(_0x7c8e('0x4'));var Mustache=require(_0x7c8e('0x5'));var util=require(_0x7c8e('0x6'));var path=require(_0x7c8e('0x7'));var sox=require(_0x7c8e('0x8'));var csv=require(_0x7c8e('0x9'));var ejs=require(_0x7c8e('0xa'));var fs=require('fs');var fs_extra=require(_0x7c8e('0xb'));var _=require(_0x7c8e('0xc'));var squel=require(_0x7c8e('0xd'));var crypto=require(_0x7c8e('0xe'));var jsforce=require(_0x7c8e('0xf'));var deskjs=require(_0x7c8e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7c8e('0x11'));var Papa=require('papaparse');var Redis=require(_0x7c8e('0x12'));var authService=require(_0x7c8e('0x13'));var qs=require(_0x7c8e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c8e('0x15'));var logger=require(_0x7c8e('0x16'))(_0x7c8e('0x17'));var utils=require(_0x7c8e('0x18'));var config=require(_0x7c8e('0x19'));var licenseUtil=require(_0x7c8e('0x1a'));var db=require(_0x7c8e('0x1b'))['db'];config[_0x7c8e('0x1c')]=_[_0x7c8e('0x1d')](config[_0x7c8e('0x1c')],{'host':_0x7c8e('0x1e'),'port':0x18eb});var socket=require(_0x7c8e('0x1f'))(new Redis(config[_0x7c8e('0x1c')]));require(_0x7c8e('0x20'))[_0x7c8e('0x21')](socket);function respondWithStatusCode(_0x13a416,_0xac1a81){_0xac1a81=_0xac1a81||0xcc;return function(_0x5d6ebf){if(_0x5d6ebf){return _0x13a416[_0x7c8e('0x22')](_0xac1a81);}return _0x13a416['status'](_0xac1a81)[_0x7c8e('0x23')]();};}function respondWithResult(_0x4aae06,_0x508f49){_0x508f49=_0x508f49||0xc8;return function(_0xaa0546){if(_0xaa0546){return _0x4aae06[_0x7c8e('0x24')](_0x508f49)[_0x7c8e('0x25')](_0xaa0546);}};}function respondWithFilteredResult(_0x202b03,_0x136e54){return function(_0x32fd36){if(_0x32fd36){var _0x23c7a3=typeof _0x136e54[_0x7c8e('0x26')]===_0x7c8e('0x27')&&typeof _0x136e54[_0x7c8e('0x28')]===_0x7c8e('0x27');var _0x140c46=_0x32fd36[_0x7c8e('0x29')];var _0x2454fa=_0x23c7a3?0x0:_0x136e54[_0x7c8e('0x26')];var _0x5d6d31=_0x23c7a3?_0x32fd36['count']:_0x136e54[_0x7c8e('0x26')]+_0x136e54[_0x7c8e('0x28')];var _0x268c58;if(_0x5d6d31>=_0x140c46){_0x5d6d31=_0x140c46;_0x268c58=0xc8;}else{_0x268c58=0xce;}_0x202b03['status'](_0x268c58);return _0x202b03[_0x7c8e('0x2a')](_0x7c8e('0x2b'),_0x2454fa+'-'+_0x5d6d31+'/'+_0x140c46)[_0x7c8e('0x25')](_0x32fd36);}return null;};}function patchUpdates(_0x28d16e){return function(_0x1c69b3){try{jsonpatch[_0x7c8e('0x2c')](_0x1c69b3,_0x28d16e,!![]);}catch(_0x2cab9b){return BPromise[_0x7c8e('0x2d')](_0x2cab9b);}return _0x1c69b3[_0x7c8e('0x2e')]();};}function saveUpdates(_0x5be964,_0xadfaf3){return function(_0x5b3451){if(_0x5b3451){return _0x5b3451['update'](_0x5be964)[_0x7c8e('0x2f')](function(_0x329d68){return _0x329d68;});}return null;};}function removeEntity(_0x46fa82,_0x1439aa){return function(_0x3a9ddf){if(_0x3a9ddf){return _0x3a9ddf[_0x7c8e('0x30')]()[_0x7c8e('0x2f')](function(){var _0x4a0d2e=_0x3a9ddf[_0x7c8e('0x31')]({'plain':!![]});var _0x2c5a19='SquareProjects';return db[_0x7c8e('0x32')]['destroy']({'where':{'type':_0x2c5a19,'resourceId':_0x4a0d2e['id']}})[_0x7c8e('0x2f')](function(){return _0x3a9ddf;});})[_0x7c8e('0x2f')](function(){_0x46fa82[_0x7c8e('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f013f,_0x3a5b0e){return function(_0x990937){if(!_0x990937){_0x3f013f['sendStatus'](0x194);}return _0x990937;};}function handleError(_0x41e431,_0x55fc00){_0x55fc00=_0x55fc00||0x1f4;return function(_0x482030){logger[_0x7c8e('0x33')](_0x482030[_0x7c8e('0x34')]);if(_0x482030[_0x7c8e('0x35')]){delete _0x482030['name'];}_0x41e431[_0x7c8e('0x24')](_0x55fc00)[_0x7c8e('0x36')](_0x482030);};}exports[_0x7c8e('0x37')]=function(_0x3909ae,_0x194e8e){var _0x23bd38={},_0x1a8d0b={},_0x4043be={'count':0x0,'rows':[]};var _0x3a63ef=_[_0x7c8e('0x38')](db[_0x7c8e('0x39')][_0x7c8e('0x3a')],function(_0x2a543d){return{'name':_0x2a543d[_0x7c8e('0x3b')],'type':_0x2a543d[_0x7c8e('0x3c')]['key']};});_0x1a8d0b[_0x7c8e('0x3d')]=_[_0x7c8e('0x38')](_0x3a63ef,_0x7c8e('0x35'));_0x1a8d0b[_0x7c8e('0x3e')]=_['keys'](_0x3909ae[_0x7c8e('0x3e')]);_0x1a8d0b[_0x7c8e('0x3f')]=_[_0x7c8e('0x40')](_0x1a8d0b['model'],_0x1a8d0b[_0x7c8e('0x3e')]);_0x23bd38[_0x7c8e('0x41')]=_[_0x7c8e('0x40')](_0x1a8d0b['model'],qs[_0x7c8e('0x42')](_0x3909ae['query'][_0x7c8e('0x42')]));_0x23bd38[_0x7c8e('0x41')]=_0x23bd38[_0x7c8e('0x41')][_0x7c8e('0x43')]?_0x23bd38[_0x7c8e('0x41')]:_0x1a8d0b[_0x7c8e('0x3d')];if(!_0x3909ae[_0x7c8e('0x3e')][_0x7c8e('0x44')]('nolimit')){_0x23bd38[_0x7c8e('0x28')]=qs[_0x7c8e('0x28')](_0x3909ae['query'][_0x7c8e('0x28')]);_0x23bd38['offset']=qs[_0x7c8e('0x26')](_0x3909ae[_0x7c8e('0x3e')]['offset']);}_0x23bd38[_0x7c8e('0x45')]=qs[_0x7c8e('0x46')](_0x3909ae[_0x7c8e('0x3e')][_0x7c8e('0x46')]);_0x23bd38[_0x7c8e('0x47')]=qs[_0x7c8e('0x3f')](_[_0x7c8e('0x48')](_0x3909ae[_0x7c8e('0x3e')],_0x1a8d0b[_0x7c8e('0x3f')]),_0x3a63ef);if(_0x3909ae[_0x7c8e('0x3e')]['filter']){_0x23bd38[_0x7c8e('0x47')]=_[_0x7c8e('0x49')](_0x23bd38[_0x7c8e('0x47')],{'$or':_[_0x7c8e('0x38')](_0x3a63ef,function(_0x550a38){if(_0x550a38[_0x7c8e('0x3c')]!=='VIRTUAL'){var _0xd46028={};_0xd46028[_0x550a38['name']]={'$like':'%'+_0x3909ae[_0x7c8e('0x3e')][_0x7c8e('0x4a')]+'%'};return _0xd46028;}})});}_0x23bd38=_[_0x7c8e('0x49')]({},_0x23bd38,_0x3909ae[_0x7c8e('0x4b')]);var _0x41137f={'where':_0x23bd38[_0x7c8e('0x47')]};return db['SquareProject'][_0x7c8e('0x29')](_0x41137f)[_0x7c8e('0x2f')](function(_0x31f26d){_0x4043be[_0x7c8e('0x29')]=_0x31f26d;if(_0x3909ae[_0x7c8e('0x3e')]['includeAll']){_0x23bd38[_0x7c8e('0x4c')]=[{'all':!![]}];}return db[_0x7c8e('0x39')][_0x7c8e('0x4d')](_0x23bd38);})[_0x7c8e('0x2f')](function(_0x2a02b6){_0x4043be['rows']=_0x2a02b6;return _0x4043be;})[_0x7c8e('0x2f')](respondWithFilteredResult(_0x194e8e,_0x23bd38))['catch'](handleError(_0x194e8e,null));};exports['show']=function(_0x1564d8,_0x21142a){var _0x378539={'raw':![],'where':{'id':_0x1564d8[_0x7c8e('0x4e')]['id']}},_0x1de04e={};_0x1de04e[_0x7c8e('0x3d')]=_[_0x7c8e('0x4f')](db[_0x7c8e('0x39')][_0x7c8e('0x3a')]);_0x1de04e['query']=_[_0x7c8e('0x4f')](_0x1564d8['query']);_0x1de04e[_0x7c8e('0x3f')]=_[_0x7c8e('0x40')](_0x1de04e['model'],_0x1de04e['query']);_0x378539[_0x7c8e('0x41')]=_[_0x7c8e('0x40')](_0x1de04e[_0x7c8e('0x3d')],qs[_0x7c8e('0x42')](_0x1564d8[_0x7c8e('0x3e')][_0x7c8e('0x42')]));_0x378539[_0x7c8e('0x41')]=_0x378539[_0x7c8e('0x41')][_0x7c8e('0x43')]?_0x378539[_0x7c8e('0x41')]:_0x1de04e[_0x7c8e('0x3d')];if(_0x1564d8[_0x7c8e('0x3e')]['includeAll']){_0x378539[_0x7c8e('0x4c')]=[{'all':!![]}];}_0x378539=_[_0x7c8e('0x49')]({},_0x378539,_0x1564d8[_0x7c8e('0x4b')]);return db[_0x7c8e('0x39')][_0x7c8e('0x50')](_0x378539)[_0x7c8e('0x2f')](handleEntityNotFound(_0x21142a,null))[_0x7c8e('0x2f')](respondWithResult(_0x21142a,null))[_0x7c8e('0x51')](handleError(_0x21142a,null));};exports['create']=function(_0x2e678f,_0x4afebd){return db[_0x7c8e('0x39')][_0x7c8e('0x52')](_0x2e678f['body'],{})[_0x7c8e('0x2f')](function(_0xd8a7c6){var _0x1a02b4=_0x2e678f[_0x7c8e('0x53')]['get']({'plain':!![]});if(!_0x1a02b4)throw new Error(_0x7c8e('0x54'));if(_0x1a02b4[_0x7c8e('0x55')]===_0x7c8e('0x53')){var _0x780fa0=_0xd8a7c6[_0x7c8e('0x31')]({'plain':!![]});var _0x109b61=_0x7c8e('0x56');return db[_0x7c8e('0x57')]['find']({'where':{'name':_0x109b61,'userProfileId':_0x1a02b4[_0x7c8e('0x58')]},'raw':!![]})[_0x7c8e('0x2f')](function(_0x58d8a5){if(_0x58d8a5&&_0x58d8a5[_0x7c8e('0x59')]===0x0){return db[_0x7c8e('0x32')][_0x7c8e('0x52')]({'name':_0x780fa0[_0x7c8e('0x35')],'resourceId':_0x780fa0['id'],'type':_0x58d8a5[_0x7c8e('0x35')],'sectionId':_0x58d8a5['id']},{})[_0x7c8e('0x2f')](function(){return _0xd8a7c6;});}else{return _0xd8a7c6;}})[_0x7c8e('0x51')](function(_0x5413cf){logger[_0x7c8e('0x33')](_0x7c8e('0x5a'),_0x5413cf);throw _0x5413cf;});}return _0xd8a7c6;})[_0x7c8e('0x2f')](respondWithResult(_0x4afebd,0xc9))[_0x7c8e('0x51')](handleError(_0x4afebd,null));};exports[_0x7c8e('0x5b')]=function(_0x220e31,_0x506244){if(_0x220e31[_0x7c8e('0x5c')]['id']){delete _0x220e31[_0x7c8e('0x5c')]['id'];}return db['SquareProject'][_0x7c8e('0x50')]({'where':{'id':_0x220e31[_0x7c8e('0x4e')]['id']}})[_0x7c8e('0x2f')](handleEntityNotFound(_0x506244,null))[_0x7c8e('0x2f')](saveUpdates(_0x220e31[_0x7c8e('0x5c')],null))[_0x7c8e('0x2f')](respondWithResult(_0x506244,null))[_0x7c8e('0x51')](handleError(_0x506244,null));};exports['destroy']=function(_0x38e97e,_0x212ee0){return db[_0x7c8e('0x39')][_0x7c8e('0x50')]({'where':{'id':_0x38e97e[_0x7c8e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x212ee0,null))[_0x7c8e('0x2f')](removeEntity(_0x212ee0,null))[_0x7c8e('0x51')](handleError(_0x212ee0,null));};exports[_0x7c8e('0x5d')]=function(_0x1e7cb6,_0x4acc84,_0x11b85a){return db[_0x7c8e('0x39')]['find']({'where':{'id':_0x1e7cb6['params']['id']}})[_0x7c8e('0x2f')](handleEntityNotFound(_0x4acc84,null))[_0x7c8e('0x2f')](function(_0x9be47f){if(_0x9be47f){return _0x9be47f['addUsers'](_0x1e7cb6[_0x7c8e('0x5c')][_0x7c8e('0x5e')],_[_0x7c8e('0x5f')](_0x1e7cb6[_0x7c8e('0x5c')],[_0x7c8e('0x5e'),'id'])||{});}})[_0x7c8e('0x2f')](respondWithResult(_0x4acc84,null))['catch'](handleError(_0x4acc84,null));};exports[_0x7c8e('0x60')]=function(_0x224da7,_0x48ec00,_0x2a40dc){return db[_0x7c8e('0x39')][_0x7c8e('0x50')]({'where':{'id':_0x224da7[_0x7c8e('0x4e')]['id']}})[_0x7c8e('0x2f')](handleEntityNotFound(_0x48ec00,null))[_0x7c8e('0x2f')](function(_0x1347a4){if(_0x1347a4){return _0x1347a4[_0x7c8e('0x60')](_0x224da7['query']['ids'])[_0x7c8e('0x2f')](function(){if(_['isArray'](_0x224da7['query']['ids'])){for(var _0x46887f=0x0;_0x46887f<_0x224da7[_0x7c8e('0x3e')][_0x7c8e('0x5e')][_0x7c8e('0x43')];_0x46887f+=0x1){socket[_0x7c8e('0x61')]('userSquareProject:remove',{'UserId':Number(_0x224da7[_0x7c8e('0x3e')][_0x7c8e('0x5e')][_0x46887f]),'SquareProjectId':Number(_0x224da7[_0x7c8e('0x4e')]['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x224da7['query'][_0x7c8e('0x5e')]),'SquareProjectId':Number(_0x224da7[_0x7c8e('0x4e')]['id'])});}});}})[_0x7c8e('0x2f')](respondWithStatusCode(_0x48ec00,null))[_0x7c8e('0x51')](handleError(_0x48ec00,null));};exports[_0x7c8e('0x62')]=function(_0xe90be4,_0x25fb36,_0x3eb2b0){var _0x4802d0={};var _0x558203={};var _0x42a8fe;var _0x5eb1e6;return db[_0x7c8e('0x39')][_0x7c8e('0x63')]({'where':{'id':_0xe90be4[_0x7c8e('0x4e')]['id']}})[_0x7c8e('0x2f')](handleEntityNotFound(_0x25fb36,null))[_0x7c8e('0x2f')](function(_0xfdbf45){if(_0xfdbf45){_0x42a8fe=_0xfdbf45;_0x558203['model']=_[_0x7c8e('0x4f')](db[_0x7c8e('0x64')][_0x7c8e('0x3a')]);_0x558203[_0x7c8e('0x3e')]=_['keys'](_0xe90be4[_0x7c8e('0x3e')]);_0x558203[_0x7c8e('0x3f')]=_[_0x7c8e('0x40')](_0x558203['model'],_0x558203['query']);_0x4802d0[_0x7c8e('0x41')]=_['intersection'](_0x558203[_0x7c8e('0x3d')],qs[_0x7c8e('0x42')](_0xe90be4['query'][_0x7c8e('0x42')]));_0x4802d0[_0x7c8e('0x41')]=_0x4802d0[_0x7c8e('0x41')]['length']?_0x4802d0[_0x7c8e('0x41')]:_0x558203['model'];_0x4802d0[_0x7c8e('0x45')]=qs[_0x7c8e('0x46')](_0xe90be4[_0x7c8e('0x3e')][_0x7c8e('0x46')]);_0x4802d0[_0x7c8e('0x47')]=qs[_0x7c8e('0x3f')](_[_0x7c8e('0x48')](_0xe90be4[_0x7c8e('0x3e')],_0x558203[_0x7c8e('0x3f')]));if(_0xe90be4[_0x7c8e('0x3e')][_0x7c8e('0x4a')]){_0x4802d0['where']=_[_0x7c8e('0x49')](_0x4802d0[_0x7c8e('0x47')],{'$or':_[_0x7c8e('0x38')](_0x4802d0[_0x7c8e('0x41')],function(_0x34fce9){var _0x5980b3={};_0x5980b3[_0x34fce9]={'$like':'%'+_0xe90be4[_0x7c8e('0x3e')][_0x7c8e('0x4a')]+'%'};return _0x5980b3;})});}_0x4802d0=_[_0x7c8e('0x49')]({},_0x4802d0,_0xe90be4[_0x7c8e('0x4b')]);return _0x42a8fe[_0x7c8e('0x62')](_0x4802d0);}})['then'](function(_0x41c4ae){if(_0x41c4ae){_0x5eb1e6=_0x41c4ae['length'];if(!_0xe90be4['query']['hasOwnProperty'](_0x7c8e('0x65'))){_0x4802d0[_0x7c8e('0x28')]=qs[_0x7c8e('0x28')](_0xe90be4[_0x7c8e('0x3e')][_0x7c8e('0x28')]);_0x4802d0[_0x7c8e('0x26')]=qs['offset'](_0xe90be4['query'][_0x7c8e('0x26')]);}return _0x42a8fe[_0x7c8e('0x62')](_0x4802d0);}})['then'](function(_0x1bcd62){if(_0x1bcd62){return _0x1bcd62?{'count':_0x5eb1e6,'rows':_0x1bcd62}:null;}})[_0x7c8e('0x2f')](respondWithResult(_0x25fb36,null))[_0x7c8e('0x51')](handleError(_0x25fb36,null));};
\ No newline at end of file
index 0f6eb12..dc0faa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc470=['emit','hasOwnProperty','hook','exports','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x15a13b,_0x88e4be){var _0x419a3a=function(_0x4e1b80){while(--_0x4e1b80){_0x15a13b['push'](_0x15a13b['shift']());}};_0x419a3a(++_0x88e4be);}(_0xc470,0x176));var _0x0c47=function(_0x4ea5eb,_0x190c43){_0x4ea5eb=_0x4ea5eb-0x0;var _0x2133cf=_0xc470[_0x4ea5eb];return _0x2133cf;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x0c47('0x0'))['db'][_0x0c47('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0c47('0x2')](0x0);var events={'afterCreate':_0x0c47('0x3'),'afterUpdate':_0x0c47('0x4'),'afterDestroy':_0x0c47('0x5')};function emitEvent(_0x534e60){return function(_0x3dba29,_0xe289e8,_0x340937){SquareProjectEvents[_0x0c47('0x6')](_0x534e60+':'+_0x3dba29['id'],_0x3dba29);SquareProjectEvents['emit'](_0x534e60,_0x3dba29);_0x340937(null);};}for(var e in events){if(events[_0x0c47('0x7')](e)){var event=events[e];SquareProject[_0x0c47('0x8')](e,emitEvent(event));}}module[_0x0c47('0x9')]=SquareProjectEvents;
\ No newline at end of file
+var _0x5949=['remove','emit','hook','exports','../../mysqldb','SquareProject','save','update'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0x5949,0x6c));var _0x9594=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0x5949[_0x108d5f];return _0x456ea3;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x9594('0x0'))['db'][_0x9594('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9594('0x2'),'afterUpdate':_0x9594('0x3'),'afterDestroy':_0x9594('0x4')};function emitEvent(_0x333ed7){return function(_0x391387,_0x10fa40,_0x8d3cd2){SquareProjectEvents[_0x9594('0x5')](_0x333ed7+':'+_0x391387['id'],_0x391387);SquareProjectEvents[_0x9594('0x5')](_0x333ed7,_0x391387);_0x8d3cd2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x9594('0x6')](e,emitEvent(event));}}module[_0x9594('0x7')]=SquareProjectEvents;
\ No newline at end of file
index 5142784..3fbaac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5d7=['bluebird','path','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','changed','preproduction','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','util','../../config/logger'];(function(_0x586b8d,_0x9e7d09){var _0x4cfc84=function(_0xbd2906){while(--_0xbd2906){_0x586b8d['push'](_0x586b8d['shift']());}};_0x4cfc84(++_0x9e7d09);}(_0xe5d7,0xcd));var _0x7e5d=function(_0x2881b6,_0x36a42d){_0x2881b6=_0x2881b6-0x0;var _0x57c528=_0xe5d7[_0x2881b6];return _0x57c528;};'use strict';var _=require(_0x7e5d('0x0'));var util=require(_0x7e5d('0x1'));var logger=require(_0x7e5d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7e5d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e5d('0x4'));var rimraf=require('rimraf');var config=require(_0x7e5d('0x5'));var attributes=require(_0x7e5d('0x6'));module[_0x7e5d('0x7')]=function(_0x58248b,_0x91f06e){return _0x58248b['define'](_0x7e5d('0x8'),attributes,{'tableName':_0x7e5d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x415a62,_0x110057,_0x1502f7){if(_0x415a62[_0x7e5d('0xa')](_0x7e5d('0xb'))){_0x415a62['savedAt']=moment()['format'](_0x7e5d('0xc'));}if(_0x415a62['changed'](_0x7e5d('0xd'))){_0x415a62[_0x7e5d('0xe')]=moment()[_0x7e5d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1502f7(null,_0x415a62);}}});};
\ No newline at end of file
+var _0x4913=['changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','moment','request-promise','rimraf','../../config/environment','exports','SquareProject','square_projects'];(function(_0x14c4fa,_0x29eb8e){var _0x1e9f4e=function(_0x4acd13){while(--_0x4acd13){_0x14c4fa['push'](_0x14c4fa['shift']());}};_0x1e9f4e(++_0x29eb8e);}(_0x4913,0x1aa));var _0x3491=function(_0x224d2d,_0x2f1337){_0x224d2d=_0x224d2d-0x0;var _0x53597e=_0x4913[_0x224d2d];return _0x53597e;};'use strict';var _=require(_0x3491('0x0'));var util=require(_0x3491('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3491('0x2'));var BPromise=require('bluebird');var rp=require(_0x3491('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3491('0x4'));var config=require(_0x3491('0x5'));var attributes=require('./squareProject.attributes');module[_0x3491('0x6')]=function(_0xf83dd2,_0x347ad7){return _0xf83dd2['define'](_0x3491('0x7'),attributes,{'tableName':_0x3491('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57db21,_0x30f7d6,_0x2179bf){if(_0x57db21[_0x3491('0x9')](_0x3491('0xa'))){_0x57db21['savedAt']=moment()[_0x3491('0xb')](_0x3491('0xc'));}if(_0x57db21[_0x3491('0x9')](_0x3491('0xd'))){_0x57db21[_0x3491('0xe')]=moment()[_0x3491('0xb')](_0x3491('0xc'));}_0x2179bf(null,_0x57db21);}}});};
\ No newline at end of file
index e22d90b..dea7370 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e96=['message','result','ShowSquareProject','options','raw','include','map','model','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x175831,_0x17b0ec){var _0x326d9c=function(_0x3ac524){while(--_0x3ac524){_0x175831['push'](_0x175831['shift']());}};_0x326d9c(++_0x17b0ec);}(_0x2e96,0x144));var _0x62e9=function(_0x2b89e3,_0x4a8c51){_0x2b89e3=_0x2b89e3-0x0;var _0x54119a=_0x2e96[_0x2b89e3];return _0x54119a;};'use strict';var _=require(_0x62e9('0x0'));var util=require('util');var moment=require(_0x62e9('0x1'));var BPromise=require('bluebird');var rs=require(_0x62e9('0x2'));var fs=require('fs');var Redis=require(_0x62e9('0x3'));var db=require(_0x62e9('0x4'))['db'];var utils=require(_0x62e9('0x5'));var logger=require(_0x62e9('0x6'))(_0x62e9('0x7'));var config=require(_0x62e9('0x8'));var jayson=require(_0x62e9('0x9'));var client=jayson[_0x62e9('0xa')]['http']({'port':0x232a});config[_0x62e9('0xb')]=_['defaults'](config[_0x62e9('0xb')],{'host':_0x62e9('0xc'),'port':0x18eb});var socket=require(_0x62e9('0xd'))(new Redis(config[_0x62e9('0xb')]));require(_0x62e9('0xe'))[_0x62e9('0xf')](socket);function respondWithRpcPromise(_0x326a40,_0x4afaef,_0xae3897){return new BPromise(function(_0x37924b,_0x512a59){return client[_0x62e9('0x10')](_0x326a40,_0xae3897)[_0x62e9('0x11')](function(_0xfaf67){logger[_0x62e9('0x12')](_0x62e9('0x13'),_0x4afaef,_0x62e9('0x14'));logger[_0x62e9('0x15')](_0x62e9('0x16'),_0x4afaef,_0x62e9('0x14'),JSON[_0x62e9('0x17')](_0xfaf67));if(_0xfaf67[_0x62e9('0x18')]){if(_0xfaf67[_0x62e9('0x18')][_0x62e9('0x19')]===0x1f4){logger[_0x62e9('0x18')](_0x62e9('0x13'),_0x4afaef,_0xfaf67['error'][_0x62e9('0x1a')]);return _0x512a59(_0xfaf67['error'][_0x62e9('0x1a')]);}logger[_0x62e9('0x18')](_0x62e9('0x13'),_0x4afaef,_0xfaf67[_0x62e9('0x18')][_0x62e9('0x1a')]);return _0x37924b(_0xfaf67[_0x62e9('0x18')][_0x62e9('0x1a')]);}else{logger['info'](_0x62e9('0x13'),_0x4afaef,_0x62e9('0x14'));_0x37924b(_0xfaf67[_0x62e9('0x1b')][_0x62e9('0x1a')]);}})['catch'](function(_0x5631cf){logger['error'](_0x62e9('0x13'),_0x4afaef,_0x5631cf);_0x512a59(_0x5631cf);});});}exports[_0x62e9('0x1c')]=function(_0x25ca9d){var _0x245ac2=this;return new Promise(function(_0x56b252,_0x643f01){return db['SquareProject']['find']({'raw':_0x25ca9d[_0x62e9('0x1d')]?_0x25ca9d[_0x62e9('0x1d')][_0x62e9('0x1e')]===undefined?!![]:![]:!![],'where':_0x25ca9d['options']?_0x25ca9d[_0x62e9('0x1d')]['where']||null:null,'attributes':_0x25ca9d[_0x62e9('0x1d')]?_0x25ca9d[_0x62e9('0x1d')]['attributes']||null:null,'include':_0x25ca9d[_0x62e9('0x1d')]?_0x25ca9d[_0x62e9('0x1d')][_0x62e9('0x1f')]?_[_0x62e9('0x20')](_0x25ca9d[_0x62e9('0x1d')][_0x62e9('0x1f')],function(_0x7c7cd1){return{'model':db[_0x7c7cd1[_0x62e9('0x21')]],'as':_0x7c7cd1['as'],'attributes':_0x7c7cd1[_0x62e9('0x22')],'include':_0x7c7cd1['include']?_[_0x62e9('0x20')](_0x7c7cd1['include'],function(_0x22c4a1){return{'model':db[_0x22c4a1['model']],'as':_0x22c4a1['as'],'attributes':_0x22c4a1[_0x62e9('0x22')],'include':_0x22c4a1[_0x62e9('0x1f')]?_[_0x62e9('0x20')](_0x22c4a1[_0x62e9('0x1f')],function(_0x4fe51d){return{'model':db[_0x4fe51d[_0x62e9('0x21')]],'as':_0x4fe51d['as'],'attributes':_0x4fe51d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x58d3c1){logger[_0x62e9('0x12')]('ShowSquareProject',_0x25ca9d);logger[_0x62e9('0x15')](_0x62e9('0x1c'),_0x25ca9d,JSON[_0x62e9('0x17')](_0x58d3c1));_0x56b252(_0x58d3c1);})['catch'](function(_0x55b883){logger[_0x62e9('0x18')](_0x62e9('0x1c'),_0x55b883[_0x62e9('0x1a')],_0x25ca9d);_0x643f01(_0x245ac2[_0x62e9('0x18')](0x1f4,_0x55b883[_0x62e9('0x1a')]));});});};
\ No newline at end of file
+var _0x97ec=['../../config/utils','../../config/logger','jayson/promise','client','http','defaults','localhost','redis','./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','SquareProject','find','options','raw','map','include','model','attributes','ShowSquareProject','debug','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3560de,_0x28b150){var _0x2d31c1=function(_0x1c13d9){while(--_0x1c13d9){_0x3560de['push'](_0x3560de['shift']());}};_0x2d31c1(++_0x28b150);}(_0x97ec,0x191));var _0xc97e=function(_0x2943af,_0x72f03b){_0x2943af=_0x2943af-0x0;var _0x3861d2=_0x97ec[_0x2943af];return _0x3861d2;};'use strict';var _=require(_0xc97e('0x0'));var util=require(_0xc97e('0x1'));var moment=require('moment');var BPromise=require(_0xc97e('0x2'));var rs=require(_0xc97e('0x3'));var fs=require('fs');var Redis=require(_0xc97e('0x4'));var db=require(_0xc97e('0x5'))['db'];var utils=require(_0xc97e('0x6'));var logger=require(_0xc97e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc97e('0x8'));var client=jayson[_0xc97e('0x9')][_0xc97e('0xa')]({'port':0x232a});config['redis']=_[_0xc97e('0xb')](config['redis'],{'host':_0xc97e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc97e('0xd')]));require(_0xc97e('0xe'))[_0xc97e('0xf')](socket);function respondWithRpcPromise(_0x442173,_0x1f9aeb,_0x3ef087){return new BPromise(function(_0x5a41f6,_0x1a0293){return client[_0xc97e('0x10')](_0x442173,_0x3ef087)[_0xc97e('0x11')](function(_0x2d0c52){logger['info'](_0xc97e('0x12'),_0x1f9aeb,_0xc97e('0x13'));logger['debug']('SquareProject,\x20%s,\x20%s,\x20%s',_0x1f9aeb,_0xc97e('0x13'),JSON[_0xc97e('0x14')](_0x2d0c52));if(_0x2d0c52[_0xc97e('0x15')]){if(_0x2d0c52[_0xc97e('0x15')][_0xc97e('0x16')]===0x1f4){logger[_0xc97e('0x15')](_0xc97e('0x12'),_0x1f9aeb,_0x2d0c52['error'][_0xc97e('0x17')]);return _0x1a0293(_0x2d0c52[_0xc97e('0x15')]['message']);}logger['error']('SquareProject,\x20%s,\x20%s',_0x1f9aeb,_0x2d0c52[_0xc97e('0x15')][_0xc97e('0x17')]);return _0x5a41f6(_0x2d0c52[_0xc97e('0x15')]['message']);}else{logger[_0xc97e('0x18')](_0xc97e('0x12'),_0x1f9aeb,_0xc97e('0x13'));_0x5a41f6(_0x2d0c52[_0xc97e('0x19')][_0xc97e('0x17')]);}})['catch'](function(_0x2ae566){logger[_0xc97e('0x15')](_0xc97e('0x12'),_0x1f9aeb,_0x2ae566);_0x1a0293(_0x2ae566);});});}exports['ShowSquareProject']=function(_0x111d79){var _0x2780d5=this;return new Promise(function(_0xe69639,_0x29354f){return db[_0xc97e('0x1a')][_0xc97e('0x1b')]({'raw':_0x111d79[_0xc97e('0x1c')]?_0x111d79[_0xc97e('0x1c')][_0xc97e('0x1d')]===undefined?!![]:![]:!![],'where':_0x111d79['options']?_0x111d79[_0xc97e('0x1c')]['where']||null:null,'attributes':_0x111d79['options']?_0x111d79[_0xc97e('0x1c')]['attributes']||null:null,'include':_0x111d79[_0xc97e('0x1c')]?_0x111d79['options']['include']?_[_0xc97e('0x1e')](_0x111d79['options'][_0xc97e('0x1f')],function(_0xc771fb){return{'model':db[_0xc771fb[_0xc97e('0x20')]],'as':_0xc771fb['as'],'attributes':_0xc771fb[_0xc97e('0x21')],'include':_0xc771fb[_0xc97e('0x1f')]?_[_0xc97e('0x1e')](_0xc771fb['include'],function(_0x111c86){return{'model':db[_0x111c86[_0xc97e('0x20')]],'as':_0x111c86['as'],'attributes':_0x111c86['attributes'],'include':_0x111c86['include']?_['map'](_0x111c86[_0xc97e('0x1f')],function(_0x4d2a93){return{'model':db[_0x4d2a93[_0xc97e('0x20')]],'as':_0x4d2a93['as'],'attributes':_0x4d2a93['attributes']};}):[]};}):[]};}):[]:[]})[_0xc97e('0x11')](function(_0x4bb43a){logger['info'](_0xc97e('0x22'),_0x111d79);logger[_0xc97e('0x23')](_0xc97e('0x22'),_0x111d79,JSON[_0xc97e('0x14')](_0x4bb43a));_0xe69639(_0x4bb43a);})[_0xc97e('0x24')](function(_0x1a5b0b){logger[_0xc97e('0x15')](_0xc97e('0x22'),_0x1a5b0b[_0xc97e('0x17')],_0x111d79);_0x29354f(_0x2780d5[_0xc97e('0x15')](0x1f4,_0x1a5b0b[_0xc97e('0x17')]));});});};
\ No newline at end of file
index 44495f3..9b80386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x484a=['length','./squareProject.events','remove','update','emit','register'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x484a,0x115));var _0xa484=function(_0x2abb82,_0x1a6248){_0x2abb82=_0x2abb82-0x0;var _0x5238d8=_0x484a[_0x2abb82];return _0x5238d8;};'use strict';var SquareProjectEvents=require(_0xa484('0x0'));var events=['save',_0xa484('0x1'),_0xa484('0x2')];function createListener(_0x285b6f,_0x4173c1){return function(_0x4bdc10){_0x4173c1[_0xa484('0x3')](_0x285b6f,_0x4bdc10);};}function removeListener(_0xe354c4,_0x4dd49a){return function(){SquareProjectEvents['removeListener'](_0xe354c4,_0x4dd49a);};}exports[_0xa484('0x4')]=function(_0xcb7b36){for(var _0x4525f9=0x0,_0x2d82a7=events[_0xa484('0x5')];_0x4525f9<_0x2d82a7;_0x4525f9++){var _0x595420=events[_0x4525f9];var _0x482d0e=createListener('squareProject:'+_0x595420,_0xcb7b36);SquareProjectEvents['on'](_0x595420,_0x482d0e);}};
\ No newline at end of file
+var _0x8976=['update','removeListener','register','length','squareProject:','./squareProject.events','save'];(function(_0xe5f27c,_0x45edb2){var _0x9c1a27=function(_0xd8c12a){while(--_0xd8c12a){_0xe5f27c['push'](_0xe5f27c['shift']());}};_0x9c1a27(++_0x45edb2);}(_0x8976,0x132));var _0x6897=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8976[_0x3dd15e];return _0x231fd0;};'use strict';var SquareProjectEvents=require(_0x6897('0x0'));var events=[_0x6897('0x1'),'remove',_0x6897('0x2')];function createListener(_0x32fe51,_0x2cbf36){return function(_0x40106f){_0x2cbf36['emit'](_0x32fe51,_0x40106f);};}function removeListener(_0x2da823,_0x284038){return function(){SquareProjectEvents[_0x6897('0x3')](_0x2da823,_0x284038);};}exports[_0x6897('0x4')]=function(_0x1ed0d2){for(var _0x5dbe0c=0x0,_0x26ad9e=events[_0x6897('0x5')];_0x5dbe0c<_0x26ad9e;_0x5dbe0c++){var _0x34840e=events[_0x5dbe0c];var _0x13f416=createListener(_0x6897('0x6')+_0x34840e,_0x1ed0d2);SquareProjectEvents['on'](_0x34840e,_0x13f416);}};
\ No newline at end of file
index 83e9b53..6c71797 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x3c98cc,_0x122fee){var _0x2e7399=function(_0x2dff83){while(--_0x2dff83){_0x3c98cc['push'](_0x3c98cc['shift']());}};_0x2e7399(++_0x122fee);}(_0x1261,0x144));var _0x1126=function(_0x6243bb,_0x269bd7){_0x6243bb=_0x6243bb-0x0;var _0x16ef17=_0x1261[_0x6243bb];return _0x16ef17;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router;
\ No newline at end of file
+var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x4f113c,_0x2ba2b3){var _0xfd6dab=function(_0x2cb0a6){while(--_0x2cb0a6){_0x4f113c['push'](_0x4f113c['shift']());}};_0xfd6dab(++_0x2ba2b3);}(_0x5fab,0x177));var _0xb5fa=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x5fab[_0x30abff];return _0x4c571e;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router;
\ No newline at end of file
index 2ddd6d1..84e85dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x570ad8,_0x425ec5){var _0x1eb874=function(_0x32f8fd){while(--_0x32f8fd){_0x570ad8['push'](_0x570ad8['shift']());}};_0x1eb874(++_0x425ec5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x21861d,_0x2d3ce4){_0x21861d=_0x21861d-0x0;var _0x2248a7=_0x8ef6[_0x21861d];return _0x2248a7;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'callerid':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize[_0x68ef('0x2')]},'extension':{'type':Sequelize[_0x68ef('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'dnid':{'type':Sequelize[_0x68ef('0x2')]},'projectName':{'type':Sequelize[_0x68ef('0x2')]},'saveName':{'type':Sequelize[_0x68ef('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x68ef('0x3')],'get':function(){var _0x4740e8='';var _0x2de776=this['getDataValue'](_0x68ef('0x4'));if(_0x2de776){_0x4740e8=_0x2de776[_0x68ef('0x5')](_0x2de776[_0x68ef('0x6')]('.'));}return _0x4740e8;}}};
\ No newline at end of file
+var _0x9957=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x1252b8,_0x6e1a18){var _0x17ed7d=function(_0x4418d7){while(--_0x4418d7){_0x1252b8['push'](_0x1252b8['shift']());}};_0x17ed7d(++_0x6e1a18);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7995('0x2')]},'extension':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x7995('0x2')]},'saveName':{'type':Sequelize[_0x7995('0x2')]},'filename':{'type':Sequelize[_0x7995('0x2')]},'savePath':{'type':Sequelize[_0x7995('0x2')]},'format':{'type':Sequelize[_0x7995('0x3')],'get':function(){var _0x326741='';var _0x4996ca=this[_0x7995('0x4')](_0x7995('0x5'));if(_0x4996ca){_0x326741=_0x4996ca['substring'](_0x4996ca[_0x7995('0x6')]('.'));}return _0x326741;}}};
\ No newline at end of file
index d7998e0..85c156e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a50=['ioredis','../../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','count','limit','set','apply','reject','save','then','destroy','error','name','send','map','SquareRecording','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','includeAll','include','rows','show','params','merge','options','find','catch','create','body','update','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','secrets','SquareRecording\x20not\x20found','extname','unlink','message','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse'];(function(_0x49123c,_0x52b8c5){var _0x56c294=function(_0x41f0ed){while(--_0x41f0ed){_0x49123c['push'](_0x49123c['shift']());}};_0x56c294(++_0x52b8c5);}(_0x2a50,0x163));var _0x02a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a50[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x02a5('0x0'));var rimraf=require(_0x02a5('0x1'));var zipdir=require(_0x02a5('0x2'));var jsonpatch=require(_0x02a5('0x3'));var rp=require(_0x02a5('0x4'));var moment=require(_0x02a5('0x5'));var BPromise=require(_0x02a5('0x6'));var Mustache=require(_0x02a5('0x7'));var util=require(_0x02a5('0x8'));var path=require(_0x02a5('0x9'));var sox=require(_0x02a5('0xa'));var csv=require(_0x02a5('0xb'));var ejs=require(_0x02a5('0xc'));var fs=require('fs');var fs_extra=require(_0x02a5('0xd'));var _=require('lodash');var squel=require(_0x02a5('0xe'));var crypto=require(_0x02a5('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x02a5('0xb'));var querystring=require('querystring');var Papa=require(_0x02a5('0x10'));var Redis=require(_0x02a5('0x11'));var authService=require(_0x02a5('0x12'));var qs=require(_0x02a5('0x13'));var as=require(_0x02a5('0x14'));var hardwareService=require(_0x02a5('0x15'));var logger=require(_0x02a5('0x16'))('api');var utils=require(_0x02a5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x02a5('0x18'));var db=require(_0x02a5('0x19'))['db'];function respondWithStatusCode(_0x8da5f5,_0x4a114f){_0x4a114f=_0x4a114f||0xcc;return function(_0x31d420){if(_0x31d420){return _0x8da5f5['sendStatus'](_0x4a114f);}return _0x8da5f5[_0x02a5('0x1a')](_0x4a114f)[_0x02a5('0x1b')]();};}function respondWithResult(_0x5a9d3b,_0x5b0f1e){_0x5b0f1e=_0x5b0f1e||0xc8;return function(_0x3ea6ee){if(_0x3ea6ee){return _0x5a9d3b[_0x02a5('0x1a')](_0x5b0f1e)[_0x02a5('0x1c')](_0x3ea6ee);}};}function respondWithFilteredResult(_0x138847,_0x50353d){return function(_0x489e02){if(_0x489e02){var _0x5e5937=typeof _0x50353d[_0x02a5('0x1d')]===_0x02a5('0x1e')&&typeof _0x50353d['limit']==='undefined';var _0x4924ed=_0x489e02[_0x02a5('0x1f')];var _0x31a42e=_0x5e5937?0x0:_0x50353d[_0x02a5('0x1d')];var _0x43e47f=_0x5e5937?_0x489e02['count']:_0x50353d[_0x02a5('0x1d')]+_0x50353d[_0x02a5('0x20')];var _0x21312b;if(_0x43e47f>=_0x4924ed){_0x43e47f=_0x4924ed;_0x21312b=0xc8;}else{_0x21312b=0xce;}_0x138847[_0x02a5('0x1a')](_0x21312b);return _0x138847[_0x02a5('0x21')]('Content-Range',_0x31a42e+'-'+_0x43e47f+'/'+_0x4924ed)[_0x02a5('0x1c')](_0x489e02);}return null;};}function patchUpdates(_0x528cc5){return function(_0x41f8e8){try{jsonpatch[_0x02a5('0x22')](_0x41f8e8,_0x528cc5,!![]);}catch(_0x52a3c9){return BPromise[_0x02a5('0x23')](_0x52a3c9);}return _0x41f8e8[_0x02a5('0x24')]();};}function saveUpdates(_0x1e9e8c,_0xbebd06){return function(_0x93be7a){if(_0x93be7a){return _0x93be7a['update'](_0x1e9e8c)[_0x02a5('0x25')](function(_0x3a18d6){return _0x3a18d6;});}return null;};}function removeEntity(_0x2805b1,_0x15e34b){return function(_0x18cd2f){if(_0x18cd2f){return _0x18cd2f[_0x02a5('0x26')]()[_0x02a5('0x25')](function(){_0x2805b1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24640f,_0x203575){return function(_0x4264ec){if(!_0x4264ec){_0x24640f['sendStatus'](0x194);}return _0x4264ec;};}function handleError(_0x143b20,_0x4d7e29){_0x4d7e29=_0x4d7e29||0x1f4;return function(_0x13c7e0){logger[_0x02a5('0x27')](_0x13c7e0['stack']);if(_0x13c7e0['name']){delete _0x13c7e0[_0x02a5('0x28')];}_0x143b20[_0x02a5('0x1a')](_0x4d7e29)[_0x02a5('0x29')](_0x13c7e0);};}exports['index']=function(_0x484144,_0x52ae34){var _0x49e1fc={},_0x4ee9d8={},_0xee2911={'count':0x0,'rows':[]};var _0xad3a0e=_[_0x02a5('0x2a')](db[_0x02a5('0x2b')]['rawAttributes'],function(_0x3f9d86){return{'name':_0x3f9d86[_0x02a5('0x2c')],'type':_0x3f9d86[_0x02a5('0x2d')][_0x02a5('0x2e')]};});_0x4ee9d8[_0x02a5('0x2f')]=_[_0x02a5('0x2a')](_0xad3a0e,'name');_0x4ee9d8[_0x02a5('0x30')]=_[_0x02a5('0x31')](_0x484144[_0x02a5('0x30')]);_0x4ee9d8[_0x02a5('0x32')]=_['intersection'](_0x4ee9d8['model'],_0x4ee9d8[_0x02a5('0x30')]);_0x49e1fc[_0x02a5('0x33')]=_[_0x02a5('0x34')](_0x4ee9d8[_0x02a5('0x2f')],qs['fields'](_0x484144[_0x02a5('0x30')][_0x02a5('0x35')]));_0x49e1fc[_0x02a5('0x33')]=_0x49e1fc[_0x02a5('0x33')][_0x02a5('0x36')]?_0x49e1fc[_0x02a5('0x33')]:_0x4ee9d8[_0x02a5('0x2f')];if(!_0x484144['query'][_0x02a5('0x37')](_0x02a5('0x38'))){_0x49e1fc[_0x02a5('0x20')]=qs['limit'](_0x484144[_0x02a5('0x30')][_0x02a5('0x20')]);_0x49e1fc[_0x02a5('0x1d')]=qs[_0x02a5('0x1d')](_0x484144[_0x02a5('0x30')][_0x02a5('0x1d')]);}_0x49e1fc[_0x02a5('0x39')]=qs[_0x02a5('0x3a')](_0x484144[_0x02a5('0x30')][_0x02a5('0x3a')]);_0x49e1fc['where']=qs['filters'](_[_0x02a5('0x3b')](_0x484144[_0x02a5('0x30')],_0x4ee9d8['filters']),_0xad3a0e);if(_0x484144[_0x02a5('0x30')]['filter']){_0x49e1fc[_0x02a5('0x3c')]=_['merge'](_0x49e1fc['where'],{'$or':_[_0x02a5('0x2a')](_0xad3a0e,function(_0x536180){if(_0x536180[_0x02a5('0x2d')]!==_0x02a5('0x3d')){var _0x1a13b6={};_0x1a13b6[_0x536180[_0x02a5('0x28')]]={'$like':'%'+_0x484144[_0x02a5('0x30')]['filter']+'%'};return _0x1a13b6;}})});}_0x49e1fc=_['merge']({},_0x49e1fc,_0x484144['options']);var _0x283c1e={'where':_0x49e1fc[_0x02a5('0x3c')]};return db[_0x02a5('0x2b')][_0x02a5('0x1f')](_0x283c1e)[_0x02a5('0x25')](function(_0x85ccd4){_0xee2911[_0x02a5('0x1f')]=_0x85ccd4;if(_0x484144[_0x02a5('0x30')][_0x02a5('0x3e')]){_0x49e1fc[_0x02a5('0x3f')]=[{'all':!![]}];}return db[_0x02a5('0x2b')]['findAll'](_0x49e1fc);})[_0x02a5('0x25')](function(_0x2d6f24){_0xee2911[_0x02a5('0x40')]=_0x2d6f24;return _0xee2911;})[_0x02a5('0x25')](respondWithFilteredResult(_0x52ae34,_0x49e1fc))['catch'](handleError(_0x52ae34,null));};exports[_0x02a5('0x41')]=function(_0x505c51,_0x2b72c7){var _0x28430a={'raw':!![],'where':{'id':_0x505c51[_0x02a5('0x42')]['id']}},_0x5235cf={};_0x5235cf[_0x02a5('0x2f')]=_[_0x02a5('0x31')](db[_0x02a5('0x2b')]['rawAttributes']);_0x5235cf[_0x02a5('0x30')]=_[_0x02a5('0x31')](_0x505c51[_0x02a5('0x30')]);_0x5235cf[_0x02a5('0x32')]=_[_0x02a5('0x34')](_0x5235cf[_0x02a5('0x2f')],_0x5235cf['query']);_0x28430a[_0x02a5('0x33')]=_['intersection'](_0x5235cf[_0x02a5('0x2f')],qs[_0x02a5('0x35')](_0x505c51['query'][_0x02a5('0x35')]));_0x28430a['attributes']=_0x28430a[_0x02a5('0x33')][_0x02a5('0x36')]?_0x28430a[_0x02a5('0x33')]:_0x5235cf[_0x02a5('0x2f')];if(_0x505c51['query']['includeAll']){_0x28430a[_0x02a5('0x3f')]=[{'all':!![]}];}_0x28430a=_[_0x02a5('0x43')]({},_0x28430a,_0x505c51[_0x02a5('0x44')]);return db[_0x02a5('0x2b')][_0x02a5('0x45')](_0x28430a)[_0x02a5('0x25')](handleEntityNotFound(_0x2b72c7,null))['then'](respondWithResult(_0x2b72c7,null))[_0x02a5('0x46')](handleError(_0x2b72c7,null));};exports[_0x02a5('0x47')]=function(_0x2557c7,_0x425deb){return db[_0x02a5('0x2b')][_0x02a5('0x47')](_0x2557c7[_0x02a5('0x48')],{})['then'](respondWithResult(_0x425deb,0xc9))[_0x02a5('0x46')](handleError(_0x425deb,null));};exports[_0x02a5('0x49')]=function(_0xfb20dd,_0x21299c){if(_0xfb20dd[_0x02a5('0x48')]['id']){delete _0xfb20dd[_0x02a5('0x48')]['id'];}return db[_0x02a5('0x2b')][_0x02a5('0x45')]({'where':{'id':_0xfb20dd['params']['id']}})[_0x02a5('0x25')](handleEntityNotFound(_0x21299c,null))[_0x02a5('0x25')](saveUpdates(_0xfb20dd[_0x02a5('0x48')],null))[_0x02a5('0x25')](respondWithResult(_0x21299c,null))[_0x02a5('0x46')](handleError(_0x21299c,null));};exports[_0x02a5('0x4a')]=function(_0x43650e,_0x3c2554,_0x3598e2){var _0x1750f0=require(_0x02a5('0x4b'));var _0xab0c4c=![];var _0x281b83={};if(_0x43650e[_0x02a5('0x30')]['type']&&_0x43650e[_0x02a5('0x30')][_0x02a5('0x2d')]===_0x02a5('0x4c')){_0x281b83[_0x02a5('0x4c')]=_0x43650e[_0x02a5('0x42')]['id'];}else{_0x281b83['id']=_0x43650e[_0x02a5('0x42')]['id'];}return db[_0x02a5('0x2b')][_0x02a5('0x45')]({'where':_0x281b83,'attributes':['id',_0x02a5('0x4d'),_0x02a5('0x4e')],'raw':!![]})[_0x02a5('0x25')](handleEntityNotFound(_0x3c2554,null))['then'](function(_0x399454){if(_0x399454){var _0x3d3b81=_0x399454[_0x02a5('0x4d')];var _0x3f2891=util[_0x02a5('0x4f')]('%s.cypher',_0x3d3b81);if(fs[_0x02a5('0x50')](_0x3f2891)){_0xab0c4c=!![];return _0x1750f0['decryptFile'](_0x3f2891,_0x3d3b81,config[_0x02a5('0x51')]['recording'])['then'](function(){return _0x399454;});}return _0x399454;}})[_0x02a5('0x25')](function(_0x21a9ac){if(_0x21a9ac){var _0x54d142=_0x21a9ac[_0x02a5('0x4d')];if(!fs[_0x02a5('0x50')](_0x54d142)){throw new db['Sequelize']['ValidationError'](_0x02a5('0x52'));}if(_0x21a9ac[_0x02a5('0x4e')]){return _0x3c2554['download'](_0x54d142,_0x21a9ac[_0x02a5('0x4e')]+path[_0x02a5('0x53')](_0x54d142),function(){if(_0xab0c4c){fs[_0x02a5('0x54')](_0x54d142);}});}else{return _0x3c2554[_0x02a5('0x4a')](_0x54d142,function(_0x5dfb06){if(_0xab0c4c){fs['unlink'](_0x54d142);}});}}})[_0x02a5('0x46')](function(_0x17034a){if(_0x17034a[_0x02a5('0x55')]===_0x02a5('0x52')){_0x3c2554[_0x02a5('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x3c2554,null);}});};exports[_0x02a5('0x26')]=function(_0x5b682b,_0xd7faf9){return db[_0x02a5('0x2b')][_0x02a5('0x45')]({'where':{'id':_0x5b682b[_0x02a5('0x42')]['id']}})['then'](function(_0x1bc1bd){if(_[_0x02a5('0x56')](_0x1bc1bd)){throw new ReferenceError(_0x02a5('0x57'));}return _0x1bc1bd;})[_0x02a5('0x25')](function(_0x4ddaba){var _0x20b395=_0x4ddaba['savePath'];logger[_0x02a5('0x58')]('cancellazione\x20fisica\x20documento\x20%s',_0x20b395);if(!_[_0x02a5('0x56')](_0x4ddaba['savePath'])&&fs[_0x02a5('0x50')](_0x20b395)){logger[_0x02a5('0x58')](_0x02a5('0x59')+_0x20b395+_0x02a5('0x5a'));fs[_0x02a5('0x5b')](_0x20b395);}_0x20b395=_0x20b395+_0x02a5('0x5c');if(!_[_0x02a5('0x56')](_0x4ddaba[_0x02a5('0x4d')])&&fs['existsSync'](_0x20b395)){logger[_0x02a5('0x58')](_0x02a5('0x59')+_0x20b395+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x02a5('0x5b')](_0x20b395);}return _0x4ddaba;})[_0x02a5('0x25')](function(_0x227da2){if(!_0x227da2)throw new InternalError();return _0x227da2['destroy']();})[_0x02a5('0x25')](function(){_0xd7faf9[_0x02a5('0x1a')](0xcc)[_0x02a5('0x1b')]();})[_0x02a5('0x46')](handleError(_0xd7faf9,null));};
\ No newline at end of file
+var _0xc7a2=['status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','SquareRecording','includeAll','findAll','show','include','find','catch','create','body','download','../../components/encryptor','uniqueid','params','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xc7a2,0xac));var _0x2c7a=function(_0x2f1753,_0x458f6d){_0x2f1753=_0x2f1753-0x0;var _0x56a164=_0xc7a2[_0x2f1753];return _0x56a164;};'use strict';var emlformat=require(_0x2c7a('0x0'));var rimraf=require(_0x2c7a('0x1'));var zipdir=require(_0x2c7a('0x2'));var jsonpatch=require(_0x2c7a('0x3'));var rp=require(_0x2c7a('0x4'));var moment=require(_0x2c7a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c7a('0x6'));var util=require(_0x2c7a('0x7'));var path=require(_0x2c7a('0x8'));var sox=require('sox');var csv=require(_0x2c7a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c7a('0xa'));var _=require(_0x2c7a('0xb'));var squel=require(_0x2c7a('0xc'));var crypto=require(_0x2c7a('0xd'));var jsforce=require(_0x2c7a('0xe'));var deskjs=require(_0x2c7a('0xf'));var toCsv=require(_0x2c7a('0x9'));var querystring=require(_0x2c7a('0x10'));var Papa=require(_0x2c7a('0x11'));var Redis=require(_0x2c7a('0x12'));var authService=require(_0x2c7a('0x13'));var qs=require(_0x2c7a('0x14'));var as=require(_0x2c7a('0x15'));var hardwareService=require(_0x2c7a('0x16'));var logger=require('../../config/logger')(_0x2c7a('0x17'));var utils=require(_0x2c7a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2c7a('0x19'));var db=require(_0x2c7a('0x1a'))['db'];function respondWithStatusCode(_0x4632e,_0xfffc1c){_0xfffc1c=_0xfffc1c||0xcc;return function(_0x3e9d75){if(_0x3e9d75){return _0x4632e[_0x2c7a('0x1b')](_0xfffc1c);}return _0x4632e[_0x2c7a('0x1c')](_0xfffc1c)[_0x2c7a('0x1d')]();};}function respondWithResult(_0x20aa61,_0x12ec72){_0x12ec72=_0x12ec72||0xc8;return function(_0x13fb31){if(_0x13fb31){return _0x20aa61[_0x2c7a('0x1c')](_0x12ec72)[_0x2c7a('0x1e')](_0x13fb31);}};}function respondWithFilteredResult(_0xc39f5d,_0x470d77){return function(_0x3c0b1e){if(_0x3c0b1e){var _0x8f2e57=typeof _0x470d77[_0x2c7a('0x1f')]===_0x2c7a('0x20')&&typeof _0x470d77[_0x2c7a('0x21')]===_0x2c7a('0x20');var _0x1ce9d6=_0x3c0b1e['count'];var _0x2f01c9=_0x8f2e57?0x0:_0x470d77[_0x2c7a('0x1f')];var _0xd97db7=_0x8f2e57?_0x3c0b1e[_0x2c7a('0x22')]:_0x470d77['offset']+_0x470d77[_0x2c7a('0x21')];var _0x240e5f;if(_0xd97db7>=_0x1ce9d6){_0xd97db7=_0x1ce9d6;_0x240e5f=0xc8;}else{_0x240e5f=0xce;}_0xc39f5d[_0x2c7a('0x1c')](_0x240e5f);return _0xc39f5d[_0x2c7a('0x23')]('Content-Range',_0x2f01c9+'-'+_0xd97db7+'/'+_0x1ce9d6)[_0x2c7a('0x1e')](_0x3c0b1e);}return null;};}function patchUpdates(_0xf9a928){return function(_0x524b45){try{jsonpatch[_0x2c7a('0x24')](_0x524b45,_0xf9a928,!![]);}catch(_0x250124){return BPromise[_0x2c7a('0x25')](_0x250124);}return _0x524b45['save']();};}function saveUpdates(_0x39632a,_0x4ef793){return function(_0x22bdd7){if(_0x22bdd7){return _0x22bdd7[_0x2c7a('0x26')](_0x39632a)[_0x2c7a('0x27')](function(_0x21944a){return _0x21944a;});}return null;};}function removeEntity(_0x373b08,_0x321385){return function(_0xb35ee3){if(_0xb35ee3){return _0xb35ee3[_0x2c7a('0x28')]()['then'](function(){_0x373b08[_0x2c7a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3675e3,_0x2760f8){return function(_0x1b9dfb){if(!_0x1b9dfb){_0x3675e3[_0x2c7a('0x1b')](0x194);}return _0x1b9dfb;};}function handleError(_0x496536,_0x57e880){_0x57e880=_0x57e880||0x1f4;return function(_0x185e11){logger['error'](_0x185e11[_0x2c7a('0x29')]);if(_0x185e11[_0x2c7a('0x2a')]){delete _0x185e11[_0x2c7a('0x2a')];}_0x496536[_0x2c7a('0x1c')](_0x57e880)[_0x2c7a('0x2b')](_0x185e11);};}exports[_0x2c7a('0x2c')]=function(_0x560ff4,_0x2887c8){var _0x2cd2b9={},_0x367ccc={},_0x5279f3={'count':0x0,'rows':[]};var _0x536396=_[_0x2c7a('0x2d')](db['SquareRecording'][_0x2c7a('0x2e')],function(_0x338161){return{'name':_0x338161[_0x2c7a('0x2f')],'type':_0x338161[_0x2c7a('0x30')][_0x2c7a('0x31')]};});_0x367ccc[_0x2c7a('0x32')]=_[_0x2c7a('0x2d')](_0x536396,'name');_0x367ccc['query']=_[_0x2c7a('0x33')](_0x560ff4[_0x2c7a('0x34')]);_0x367ccc['filters']=_['intersection'](_0x367ccc[_0x2c7a('0x32')],_0x367ccc[_0x2c7a('0x34')]);_0x2cd2b9[_0x2c7a('0x35')]=_[_0x2c7a('0x36')](_0x367ccc['model'],qs['fields'](_0x560ff4[_0x2c7a('0x34')][_0x2c7a('0x37')]));_0x2cd2b9[_0x2c7a('0x35')]=_0x2cd2b9[_0x2c7a('0x35')][_0x2c7a('0x38')]?_0x2cd2b9['attributes']:_0x367ccc[_0x2c7a('0x32')];if(!_0x560ff4['query'][_0x2c7a('0x39')](_0x2c7a('0x3a'))){_0x2cd2b9[_0x2c7a('0x21')]=qs[_0x2c7a('0x21')](_0x560ff4[_0x2c7a('0x34')]['limit']);_0x2cd2b9['offset']=qs[_0x2c7a('0x1f')](_0x560ff4[_0x2c7a('0x34')][_0x2c7a('0x1f')]);}_0x2cd2b9[_0x2c7a('0x3b')]=qs[_0x2c7a('0x3c')](_0x560ff4['query'][_0x2c7a('0x3c')]);_0x2cd2b9['where']=qs[_0x2c7a('0x3d')](_[_0x2c7a('0x3e')](_0x560ff4[_0x2c7a('0x34')],_0x367ccc[_0x2c7a('0x3d')]),_0x536396);if(_0x560ff4[_0x2c7a('0x34')][_0x2c7a('0x3f')]){_0x2cd2b9[_0x2c7a('0x40')]=_['merge'](_0x2cd2b9[_0x2c7a('0x40')],{'$or':_['map'](_0x536396,function(_0x4127aa){if(_0x4127aa[_0x2c7a('0x30')]!==_0x2c7a('0x41')){var _0x2661fe={};_0x2661fe[_0x4127aa[_0x2c7a('0x2a')]]={'$like':'%'+_0x560ff4['query']['filter']+'%'};return _0x2661fe;}})});}_0x2cd2b9=_[_0x2c7a('0x42')]({},_0x2cd2b9,_0x560ff4[_0x2c7a('0x43')]);var _0x3151df={'where':_0x2cd2b9['where']};return db[_0x2c7a('0x44')][_0x2c7a('0x22')](_0x3151df)[_0x2c7a('0x27')](function(_0x356600){_0x5279f3[_0x2c7a('0x22')]=_0x356600;if(_0x560ff4['query'][_0x2c7a('0x45')]){_0x2cd2b9['include']=[{'all':!![]}];}return db[_0x2c7a('0x44')][_0x2c7a('0x46')](_0x2cd2b9);})[_0x2c7a('0x27')](function(_0x22d6cf){_0x5279f3['rows']=_0x22d6cf;return _0x5279f3;})[_0x2c7a('0x27')](respondWithFilteredResult(_0x2887c8,_0x2cd2b9))['catch'](handleError(_0x2887c8,null));};exports[_0x2c7a('0x47')]=function(_0xf868fe,_0x3084e9){var _0x248b25={'raw':!![],'where':{'id':_0xf868fe['params']['id']}},_0x4e2744={};_0x4e2744[_0x2c7a('0x32')]=_[_0x2c7a('0x33')](db[_0x2c7a('0x44')][_0x2c7a('0x2e')]);_0x4e2744['query']=_[_0x2c7a('0x33')](_0xf868fe[_0x2c7a('0x34')]);_0x4e2744[_0x2c7a('0x3d')]=_[_0x2c7a('0x36')](_0x4e2744[_0x2c7a('0x32')],_0x4e2744[_0x2c7a('0x34')]);_0x248b25[_0x2c7a('0x35')]=_[_0x2c7a('0x36')](_0x4e2744['model'],qs[_0x2c7a('0x37')](_0xf868fe[_0x2c7a('0x34')]['fields']));_0x248b25[_0x2c7a('0x35')]=_0x248b25[_0x2c7a('0x35')][_0x2c7a('0x38')]?_0x248b25['attributes']:_0x4e2744[_0x2c7a('0x32')];if(_0xf868fe[_0x2c7a('0x34')]['includeAll']){_0x248b25[_0x2c7a('0x48')]=[{'all':!![]}];}_0x248b25=_['merge']({},_0x248b25,_0xf868fe[_0x2c7a('0x43')]);return db[_0x2c7a('0x44')][_0x2c7a('0x49')](_0x248b25)['then'](handleEntityNotFound(_0x3084e9,null))[_0x2c7a('0x27')](respondWithResult(_0x3084e9,null))[_0x2c7a('0x4a')](handleError(_0x3084e9,null));};exports['create']=function(_0x4bbce2,_0x17b5c8){return db['SquareRecording'][_0x2c7a('0x4b')](_0x4bbce2['body'],{})['then'](respondWithResult(_0x17b5c8,0xc9))[_0x2c7a('0x4a')](handleError(_0x17b5c8,null));};exports[_0x2c7a('0x26')]=function(_0x539c4e,_0x4646c1){if(_0x539c4e[_0x2c7a('0x4c')]['id']){delete _0x539c4e[_0x2c7a('0x4c')]['id'];}return db[_0x2c7a('0x44')][_0x2c7a('0x49')]({'where':{'id':_0x539c4e['params']['id']}})[_0x2c7a('0x27')](handleEntityNotFound(_0x4646c1,null))[_0x2c7a('0x27')](saveUpdates(_0x539c4e[_0x2c7a('0x4c')],null))[_0x2c7a('0x27')](respondWithResult(_0x4646c1,null))[_0x2c7a('0x4a')](handleError(_0x4646c1,null));};exports[_0x2c7a('0x4d')]=function(_0x1e9dd4,_0x9a7340,_0xaf4744){var _0xe5c2e6=require(_0x2c7a('0x4e'));var _0x412f15=![];var _0x14e89e={};if(_0x1e9dd4['query'][_0x2c7a('0x30')]&&_0x1e9dd4['query'][_0x2c7a('0x30')]===_0x2c7a('0x4f')){_0x14e89e['uniqueid']=_0x1e9dd4[_0x2c7a('0x50')]['id'];}else{_0x14e89e['id']=_0x1e9dd4[_0x2c7a('0x50')]['id'];}return db[_0x2c7a('0x44')][_0x2c7a('0x49')]({'where':_0x14e89e,'attributes':['id',_0x2c7a('0x51'),_0x2c7a('0x52')],'raw':!![]})[_0x2c7a('0x27')](handleEntityNotFound(_0x9a7340,null))['then'](function(_0x5bdbc8){if(_0x5bdbc8){var _0xf5edc6=_0x5bdbc8['savePath'];var _0x5605ec=util[_0x2c7a('0x53')](_0x2c7a('0x54'),_0xf5edc6);if(fs['existsSync'](_0x5605ec)){_0x412f15=!![];return _0xe5c2e6[_0x2c7a('0x55')](_0x5605ec,_0xf5edc6,config[_0x2c7a('0x56')][_0x2c7a('0x57')])[_0x2c7a('0x27')](function(){return _0x5bdbc8;});}return _0x5bdbc8;}})[_0x2c7a('0x27')](function(_0x3f35dd){if(_0x3f35dd){var _0x2b3003=_0x3f35dd[_0x2c7a('0x51')];if(!fs[_0x2c7a('0x58')](_0x2b3003)){throw new db['Sequelize'][(_0x2c7a('0x59'))](_0x2c7a('0x5a'));}if(_0x3f35dd[_0x2c7a('0x52')]){return _0x9a7340[_0x2c7a('0x4d')](_0x2b3003,_0x3f35dd[_0x2c7a('0x52')]+path[_0x2c7a('0x5b')](_0x2b3003),function(){if(_0x412f15){fs['unlink'](_0x2b3003);}});}else{return _0x9a7340[_0x2c7a('0x4d')](_0x2b3003,function(_0x3d7f88){if(_0x412f15){fs[_0x2c7a('0x5c')](_0x2b3003);}});}}})[_0x2c7a('0x4a')](function(_0x2f93bb){if(_0x2f93bb[_0x2c7a('0x5d')]===_0x2c7a('0x5a')){_0x9a7340[_0x2c7a('0x1c')](0x194)[_0x2c7a('0x2b')](_0x2c7a('0x5e'));}else{return handleError(_0x9a7340,null);}});};exports[_0x2c7a('0x28')]=function(_0x1f8998,_0x17037d){return db['SquareRecording'][_0x2c7a('0x49')]({'where':{'id':_0x1f8998[_0x2c7a('0x50')]['id']}})[_0x2c7a('0x27')](function(_0x2669b9){if(_[_0x2c7a('0x5f')](_0x2669b9)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2669b9;})[_0x2c7a('0x27')](function(_0x48e6cf){var _0x279337=_0x48e6cf[_0x2c7a('0x51')];logger[_0x2c7a('0x60')]('cancellazione\x20fisica\x20documento\x20%s',_0x279337);if(!_['isNil'](_0x48e6cf['savePath'])&&fs[_0x2c7a('0x58')](_0x279337)){logger[_0x2c7a('0x60')]('File:\x20\x22'+_0x279337+_0x2c7a('0x61'));fs['unlinkSync'](_0x279337);}_0x279337=_0x279337+_0x2c7a('0x62');if(!_[_0x2c7a('0x5f')](_0x48e6cf[_0x2c7a('0x51')])&&fs[_0x2c7a('0x58')](_0x279337)){logger[_0x2c7a('0x60')]('File:\x20\x22'+_0x279337+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x2c7a('0x63')](_0x279337);}return _0x48e6cf;})[_0x2c7a('0x27')](function(_0x457838){if(!_0x457838)throw new InternalError();return _0x457838['destroy']();})[_0x2c7a('0x27')](function(){_0x17037d[_0x2c7a('0x1c')](0xcc)[_0x2c7a('0x1d')]();})[_0x2c7a('0x4a')](handleError(_0x17037d,null));};
\ No newline at end of file
index 410bc20..6a6330d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36c3=['define','SquareRecording','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x53bf94,_0x667612){var _0x3875f5=function(_0x2c4483){while(--_0x2c4483){_0x53bf94['push'](_0x53bf94['shift']());}};_0x3875f5(++_0x667612);}(_0x36c3,0x1a6));var _0x336c=function(_0xc8966a,_0x19753d){_0xc8966a=_0xc8966a-0x0;var _0x2a3be4=_0x36c3[_0xc8966a];return _0x2a3be4;};'use strict';var _=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var logger=require('../../config/logger')(_0x336c('0x2'));var moment=require(_0x336c('0x3'));var BPromise=require(_0x336c('0x4'));var rp=require(_0x336c('0x5'));var fs=require('fs');var path=require(_0x336c('0x6'));var rimraf=require(_0x336c('0x7'));var config=require(_0x336c('0x8'));var attributes=require('./squareRecording.attributes');module[_0x336c('0x9')]=function(_0x2e0016,_0x2097a8){return _0x2e0016[_0x336c('0xa')](_0x336c('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x20de=['bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','lodash','../../config/logger','api','moment'];(function(_0x4af44c,_0xfc5585){var _0xe7eee9=function(_0xb15e86){while(--_0xb15e86){_0x4af44c['push'](_0x4af44c['shift']());}};_0xe7eee9(++_0xfc5585);}(_0x20de,0x134));var _0xe20d=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x20de[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0xe20d('0x0'));var util=require('util');var logger=require(_0xe20d('0x1'))(_0xe20d('0x2'));var moment=require(_0xe20d('0x3'));var BPromise=require(_0xe20d('0x4'));var rp=require(_0xe20d('0x5'));var fs=require('fs');var path=require(_0xe20d('0x6'));var rimraf=require(_0xe20d('0x7'));var config=require(_0xe20d('0x8'));var attributes=require(_0xe20d('0x9'));module[_0xe20d('0xa')]=function(_0x53f711,_0x5a8622){return _0x53f711[_0xe20d('0xb')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd66886..f956ca6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f8=['../../config/logger','rpc','../../config/environment','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','create','body','raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1408fb,_0x1070be){var _0x186bd8=function(_0x57a8bb){while(--_0x57a8bb){_0x1408fb['push'](_0x1408fb['shift']());}};_0x186bd8(++_0x1070be);}(_0x73f8,0x149));var _0x873f=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x73f8[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x873f('0x0'));var util=require(_0x873f('0x1'));var moment=require(_0x873f('0x2'));var BPromise=require('bluebird');var rs=require(_0x873f('0x3'));var fs=require('fs');var Redis=require(_0x873f('0x4'));var db=require(_0x873f('0x5'))['db'];var utils=require(_0x873f('0x6'));var logger=require(_0x873f('0x7'))(_0x873f('0x8'));var config=require(_0x873f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x873f('0xa')][_0x873f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a15aa,_0x2b42e4,_0xd4d6fa){return new BPromise(function(_0x284b9f,_0x2a08f9){return client[_0x873f('0xc')](_0x4a15aa,_0xd4d6fa)['then'](function(_0x341671){logger[_0x873f('0xd')](_0x873f('0xe'),_0x2b42e4,_0x873f('0xf'));logger[_0x873f('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x2b42e4,'request\x20sent',JSON[_0x873f('0x11')](_0x341671));if(_0x341671[_0x873f('0x12')]){if(_0x341671[_0x873f('0x12')][_0x873f('0x13')]===0x1f4){logger[_0x873f('0x12')](_0x873f('0xe'),_0x2b42e4,_0x341671['error'][_0x873f('0x14')]);return _0x2a08f9(_0x341671[_0x873f('0x12')]['message']);}logger[_0x873f('0x12')](_0x873f('0xe'),_0x2b42e4,_0x341671[_0x873f('0x12')]['message']);return _0x284b9f(_0x341671[_0x873f('0x12')][_0x873f('0x14')]);}else{logger[_0x873f('0xd')](_0x873f('0xe'),_0x2b42e4,_0x873f('0xf'));_0x284b9f(_0x341671[_0x873f('0x15')][_0x873f('0x14')]);}})['catch'](function(_0x2de6be){logger[_0x873f('0x12')](_0x873f('0xe'),_0x2b42e4,_0x2de6be);_0x2a08f9(_0x2de6be);});});}exports[_0x873f('0x16')]=function(_0x5f5610){var _0x15ed3a=this;return new Promise(function(_0x45cf98,_0x1bf6eb){return db[_0x873f('0x17')][_0x873f('0x18')](_0x5f5610[_0x873f('0x19')],{'raw':_0x5f5610['options']?_0x5f5610['options'][_0x873f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x481630){logger[_0x873f('0xd')]('CreateSquareRecording',_0x5f5610);logger['debug'](_0x873f('0x16'),_0x5f5610,JSON[_0x873f('0x11')](_0x481630));_0x45cf98(_0x481630);})[_0x873f('0x1b')](function(_0x2ee3c2){logger[_0x873f('0x12')]('CreateSquareRecording',_0x2ee3c2[_0x873f('0x14')],_0x5f5610);_0x1bf6eb(_0x15ed3a[_0x873f('0x12')](0x1f4,_0x2ee3c2['message']));});});};
\ No newline at end of file
+var _0xfbd5=['options','raw','then','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','CreateSquareRecording','SquareRecording','create','body'];(function(_0x1c1f3e,_0x665593){var _0x325903=function(_0x198216){while(--_0x198216){_0x1c1f3e['push'](_0x1c1f3e['shift']());}};_0x325903(++_0x665593);}(_0xfbd5,0x1f2));var _0x5fbd=function(_0xf55c4a,_0x307a5b){_0xf55c4a=_0xf55c4a-0x0;var _0x48122b=_0xfbd5[_0xf55c4a];return _0x48122b;};'use strict';var _=require(_0x5fbd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5fbd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fbd('0x2'));var db=require(_0x5fbd('0x3'))['db'];var utils=require(_0x5fbd('0x4'));var logger=require(_0x5fbd('0x5'))(_0x5fbd('0x6'));var config=require(_0x5fbd('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5fbd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b01ca,_0x51793f,_0x34ea10){return new BPromise(function(_0x3a08cb,_0x48d15d){return client[_0x5fbd('0x9')](_0x2b01ca,_0x34ea10)['then'](function(_0x5a5b66){logger[_0x5fbd('0xa')](_0x5fbd('0xb'),_0x51793f,'request\x20sent');logger[_0x5fbd('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x51793f,_0x5fbd('0xd'),JSON[_0x5fbd('0xe')](_0x5a5b66));if(_0x5a5b66[_0x5fbd('0xf')]){if(_0x5a5b66[_0x5fbd('0xf')][_0x5fbd('0x10')]===0x1f4){logger[_0x5fbd('0xf')](_0x5fbd('0xb'),_0x51793f,_0x5a5b66[_0x5fbd('0xf')]['message']);return _0x48d15d(_0x5a5b66[_0x5fbd('0xf')][_0x5fbd('0x11')]);}logger[_0x5fbd('0xf')](_0x5fbd('0xb'),_0x51793f,_0x5a5b66[_0x5fbd('0xf')]['message']);return _0x3a08cb(_0x5a5b66[_0x5fbd('0xf')][_0x5fbd('0x11')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x51793f,_0x5fbd('0xd'));_0x3a08cb(_0x5a5b66['result'][_0x5fbd('0x11')]);}})['catch'](function(_0x4fb206){logger[_0x5fbd('0xf')](_0x5fbd('0xb'),_0x51793f,_0x4fb206);_0x48d15d(_0x4fb206);});});}exports[_0x5fbd('0x12')]=function(_0x2857a6){var _0x567971=this;return new Promise(function(_0x6cdcde,_0x312dcd){return db[_0x5fbd('0x13')][_0x5fbd('0x14')](_0x2857a6[_0x5fbd('0x15')],{'raw':_0x2857a6[_0x5fbd('0x16')]?_0x2857a6[_0x5fbd('0x16')][_0x5fbd('0x17')]===undefined?!![]:![]:!![]})[_0x5fbd('0x18')](function(_0x1c4d03){logger[_0x5fbd('0xa')](_0x5fbd('0x12'),_0x2857a6);logger[_0x5fbd('0xc')](_0x5fbd('0x12'),_0x2857a6,JSON[_0x5fbd('0xe')](_0x1c4d03));_0x6cdcde(_0x1c4d03);})[_0x5fbd('0x19')](function(_0x4d2964){logger[_0x5fbd('0xf')](_0x5fbd('0x12'),_0x4d2964['message'],_0x2857a6);_0x312dcd(_0x567971[_0x5fbd('0xf')](0x1f4,_0x4d2964[_0x5fbd('0x11')]));});});};
\ No newline at end of file
index 7a335e4..937936a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x3eddd5,_0x34a90e){var _0xcc7fec=function(_0x2cb648){while(--_0x2cb648){_0x3eddd5['push'](_0x3eddd5['shift']());}};_0xcc7fec(++_0x34a90e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
+var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0xa16592,_0x1f67d7){var _0x1ae8bc=function(_0x2ed019){while(--_0x2ed019){_0xa16592['push'](_0xa16592['shift']());}};_0x1ae8bc(++_0x1f67d7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'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 bbb29f0..b4844fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bbb=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x398808,_0x2695e9){var _0x49cb37=function(_0x29aa9f){while(--_0x29aa9f){_0x398808['push'](_0x398808['shift']());}};_0x49cb37(++_0x2695e9);}(_0x5bbb,0x107));var _0xb5bb=function(_0x5c4d4e,_0x2387c8){_0x5c4d4e=_0x5c4d4e-0x0;var _0x53f7bc=_0x5bbb[_0x5c4d4e];return _0x53f7bc;};'use strict';var Sequelize=require(_0xb5bb('0x0'));module[_0xb5bb('0x1')]={'network':{'type':Sequelize[_0xb5bb('0x2')]},'network_script':{'type':Sequelize[_0xb5bb('0x2')]},'request':{'type':Sequelize[_0xb5bb('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb5bb('0x2')]},'type':{'type':Sequelize[_0xb5bb('0x2')]},'uniqueid':{'type':Sequelize[_0xb5bb('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb5bb('0x2')]},'calleridname':{'type':Sequelize[_0xb5bb('0x2')]},'callingpres':{'type':Sequelize[_0xb5bb('0x2')]},'callingani2':{'type':Sequelize[_0xb5bb('0x2')]},'callington':{'type':Sequelize[_0xb5bb('0x2')]},'callingtns':{'type':Sequelize[_0xb5bb('0x2')]},'dnid':{'type':Sequelize[_0xb5bb('0x2')]},'rdnis':{'type':Sequelize[_0xb5bb('0x2')]},'context':{'type':Sequelize[_0xb5bb('0x2')]},'extension':{'type':Sequelize[_0xb5bb('0x2')]},'priority':{'type':Sequelize[_0xb5bb('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xb5bb('0x2')]},'project_name':{'type':Sequelize[_0xb5bb('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb5bb('0x3')]},'bot':{'type':Sequelize[_0xb5bb('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbaf7=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x22569f,_0x4abdde){var _0x2921b2=function(_0x29a101){while(--_0x29a101){_0x22569f['push'](_0x22569f['shift']());}};_0x2921b2(++_0x4abdde);}(_0xbaf7,0x137));var _0x7baf=function(_0x5ecdff,_0x3e5a7c){_0x5ecdff=_0x5ecdff-0x0;var _0x32b6ad=_0xbaf7[_0x5ecdff];return _0x32b6ad;};'use strict';var Sequelize=require(_0x7baf('0x0'));module[_0x7baf('0x1')]={'network':{'type':Sequelize[_0x7baf('0x2')]},'network_script':{'type':Sequelize[_0x7baf('0x2')]},'request':{'type':Sequelize[_0x7baf('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7baf('0x2')]},'type':{'type':Sequelize[_0x7baf('0x2')]},'uniqueid':{'type':Sequelize[_0x7baf('0x2')]},'version':{'type':Sequelize[_0x7baf('0x2')]},'callerid':{'type':Sequelize[_0x7baf('0x2')]},'calleridname':{'type':Sequelize[_0x7baf('0x2')]},'callingpres':{'type':Sequelize[_0x7baf('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x7baf('0x2')]},'callingtns':{'type':Sequelize[_0x7baf('0x2')]},'dnid':{'type':Sequelize[_0x7baf('0x2')]},'rdnis':{'type':Sequelize[_0x7baf('0x2')]},'context':{'type':Sequelize[_0x7baf('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x7baf('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x7baf('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7baf('0x3')]},'bot':{'type':Sequelize[_0x7baf('0x4')],'defaultValue':![]}};
\ No newline at end of file
index cbe7c0d..756a4a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca36=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','name','index','SquareReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','VIRTUAL','filter','merge','include','rows','catch','show','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xca36,0x19f));var _0x6ca3=function(_0x3608f8,_0x48b5f8){_0x3608f8=_0x3608f8-0x0;var _0x34fbf0=_0xca36[_0x3608f8];return _0x34fbf0;};'use strict';var emlformat=require(_0x6ca3('0x0'));var rimraf=require(_0x6ca3('0x1'));var zipdir=require(_0x6ca3('0x2'));var jsonpatch=require(_0x6ca3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ca3('0x4'));var Mustache=require(_0x6ca3('0x5'));var util=require(_0x6ca3('0x6'));var path=require('path');var sox=require(_0x6ca3('0x7'));var csv=require('to-csv');var ejs=require(_0x6ca3('0x8'));var fs=require('fs');var fs_extra=require(_0x6ca3('0x9'));var _=require('lodash');var squel=require(_0x6ca3('0xa'));var crypto=require(_0x6ca3('0xb'));var jsforce=require(_0x6ca3('0xc'));var deskjs=require(_0x6ca3('0xd'));var toCsv=require(_0x6ca3('0xe'));var querystring=require(_0x6ca3('0xf'));var Papa=require(_0x6ca3('0x10'));var Redis=require('ioredis');var authService=require(_0x6ca3('0x11'));var qs=require(_0x6ca3('0x12'));var as=require(_0x6ca3('0x13'));var hardwareService=require(_0x6ca3('0x14'));var logger=require('../../config/logger')(_0x6ca3('0x15'));var utils=require('../../config/utils');var config=require(_0x6ca3('0x16'));var licenseUtil=require(_0x6ca3('0x17'));var db=require(_0x6ca3('0x18'))['db'];function respondWithStatusCode(_0x311131,_0x110436){_0x110436=_0x110436||0xcc;return function(_0x4369bd){if(_0x4369bd){return _0x311131[_0x6ca3('0x19')](_0x110436);}return _0x311131[_0x6ca3('0x1a')](_0x110436)['end']();};}function respondWithResult(_0xf1e35f,_0x9cecc){_0x9cecc=_0x9cecc||0xc8;return function(_0x512523){if(_0x512523){return _0xf1e35f[_0x6ca3('0x1a')](_0x9cecc)['json'](_0x512523);}};}function respondWithFilteredResult(_0x4646a7,_0x3c39a7){return function(_0x331f8e){if(_0x331f8e){var _0x321b54=typeof _0x3c39a7[_0x6ca3('0x1b')]===_0x6ca3('0x1c')&&typeof _0x3c39a7[_0x6ca3('0x1d')]==='undefined';var _0x24df7b=_0x331f8e['count'];var _0x23882c=_0x321b54?0x0:_0x3c39a7[_0x6ca3('0x1b')];var _0x5b9216=_0x321b54?_0x331f8e[_0x6ca3('0x1e')]:_0x3c39a7[_0x6ca3('0x1b')]+_0x3c39a7[_0x6ca3('0x1d')];var _0x43dfd6;if(_0x5b9216>=_0x24df7b){_0x5b9216=_0x24df7b;_0x43dfd6=0xc8;}else{_0x43dfd6=0xce;}_0x4646a7[_0x6ca3('0x1a')](_0x43dfd6);return _0x4646a7[_0x6ca3('0x1f')](_0x6ca3('0x20'),_0x23882c+'-'+_0x5b9216+'/'+_0x24df7b)['json'](_0x331f8e);}return null;};}function patchUpdates(_0x32f1a1){return function(_0x45649b){try{jsonpatch['apply'](_0x45649b,_0x32f1a1,!![]);}catch(_0x435480){return BPromise['reject'](_0x435480);}return _0x45649b[_0x6ca3('0x21')]();};}function saveUpdates(_0x50eb3d,_0x1e7c87){return function(_0x23170d){if(_0x23170d){return _0x23170d[_0x6ca3('0x22')](_0x50eb3d)[_0x6ca3('0x23')](function(_0x580d4f){return _0x580d4f;});}return null;};}function removeEntity(_0x4f188a,_0x417902){return function(_0x1849f1){if(_0x1849f1){return _0x1849f1[_0x6ca3('0x24')]()['then'](function(){_0x4f188a[_0x6ca3('0x1a')](0xcc)[_0x6ca3('0x25')]();});}};}function handleEntityNotFound(_0x4ad591,_0x45b629){return function(_0x3b383d){if(!_0x3b383d){_0x4ad591[_0x6ca3('0x19')](0x194);}return _0x3b383d;};}function handleError(_0x1f7f2f,_0x1f13d4){_0x1f13d4=_0x1f13d4||0x1f4;return function(_0x34258c){logger[_0x6ca3('0x26')](_0x34258c['stack']);if(_0x34258c[_0x6ca3('0x27')]){delete _0x34258c['name'];}_0x1f7f2f['status'](_0x1f13d4)['send'](_0x34258c);};}exports[_0x6ca3('0x28')]=function(_0x2b505f,_0x1216d4){var _0x276295={},_0xec7c73={},_0x20499b={'count':0x0,'rows':[]};var _0x2696dc=_['map'](db[_0x6ca3('0x29')][_0x6ca3('0x2a')],function(_0x27c2fa){return{'name':_0x27c2fa['fieldName'],'type':_0x27c2fa[_0x6ca3('0x2b')][_0x6ca3('0x2c')]};});_0xec7c73[_0x6ca3('0x2d')]=_[_0x6ca3('0x2e')](_0x2696dc,_0x6ca3('0x27'));_0xec7c73[_0x6ca3('0x2f')]=_[_0x6ca3('0x30')](_0x2b505f['query']);_0xec7c73['filters']=_[_0x6ca3('0x31')](_0xec7c73[_0x6ca3('0x2d')],_0xec7c73[_0x6ca3('0x2f')]);_0x276295[_0x6ca3('0x32')]=_['intersection'](_0xec7c73[_0x6ca3('0x2d')],qs[_0x6ca3('0x33')](_0x2b505f[_0x6ca3('0x2f')][_0x6ca3('0x33')]));_0x276295[_0x6ca3('0x32')]=_0x276295['attributes']['length']?_0x276295['attributes']:_0xec7c73[_0x6ca3('0x2d')];if(!_0x2b505f[_0x6ca3('0x2f')][_0x6ca3('0x34')](_0x6ca3('0x35'))){_0x276295[_0x6ca3('0x1d')]=qs[_0x6ca3('0x1d')](_0x2b505f['query']['limit']);_0x276295[_0x6ca3('0x1b')]=qs[_0x6ca3('0x1b')](_0x2b505f[_0x6ca3('0x2f')][_0x6ca3('0x1b')]);}_0x276295[_0x6ca3('0x36')]=qs['sort'](_0x2b505f[_0x6ca3('0x2f')]['sort']);_0x276295[_0x6ca3('0x37')]=qs[_0x6ca3('0x38')](_[_0x6ca3('0x39')](_0x2b505f[_0x6ca3('0x2f')],_0xec7c73[_0x6ca3('0x38')]),_0x2696dc);if(_0x2b505f['query']['filter']){_0x276295[_0x6ca3('0x37')]=_['merge'](_0x276295['where'],{'$or':_[_0x6ca3('0x2e')](_0x2696dc,function(_0x12b8c9){if(_0x12b8c9[_0x6ca3('0x2b')]!==_0x6ca3('0x3a')){var _0x1f0f86={};_0x1f0f86[_0x12b8c9['name']]={'$like':'%'+_0x2b505f[_0x6ca3('0x2f')][_0x6ca3('0x3b')]+'%'};return _0x1f0f86;}})});}_0x276295=_[_0x6ca3('0x3c')]({},_0x276295,_0x2b505f['options']);var _0xf6eb9c={'where':_0x276295['where']};return db['SquareReport']['count'](_0xf6eb9c)[_0x6ca3('0x23')](function(_0x2a42c2){_0x20499b[_0x6ca3('0x1e')]=_0x2a42c2;if(_0x2b505f[_0x6ca3('0x2f')]['includeAll']){_0x276295[_0x6ca3('0x3d')]=[{'all':!![]}];}return db[_0x6ca3('0x29')]['findAll'](_0x276295);})[_0x6ca3('0x23')](function(_0x377407){_0x20499b[_0x6ca3('0x3e')]=_0x377407;return _0x20499b;})[_0x6ca3('0x23')](respondWithFilteredResult(_0x1216d4,_0x276295))[_0x6ca3('0x3f')](handleError(_0x1216d4,null));};exports[_0x6ca3('0x40')]=function(_0xbbe05c,_0x36b4c9){var _0x3ffcb7={'raw':!![],'where':{'id':_0xbbe05c[_0x6ca3('0x41')]['id']}},_0x55bf90={};_0x55bf90[_0x6ca3('0x2d')]=_[_0x6ca3('0x30')](db[_0x6ca3('0x29')][_0x6ca3('0x2a')]);_0x55bf90['query']=_[_0x6ca3('0x30')](_0xbbe05c[_0x6ca3('0x2f')]);_0x55bf90['filters']=_['intersection'](_0x55bf90[_0x6ca3('0x2d')],_0x55bf90[_0x6ca3('0x2f')]);_0x3ffcb7[_0x6ca3('0x32')]=_['intersection'](_0x55bf90[_0x6ca3('0x2d')],qs['fields'](_0xbbe05c[_0x6ca3('0x2f')][_0x6ca3('0x33')]));_0x3ffcb7[_0x6ca3('0x32')]=_0x3ffcb7[_0x6ca3('0x32')]['length']?_0x3ffcb7['attributes']:_0x55bf90[_0x6ca3('0x2d')];if(_0xbbe05c[_0x6ca3('0x2f')][_0x6ca3('0x42')]){_0x3ffcb7[_0x6ca3('0x3d')]=[{'all':!![]}];}_0x3ffcb7=_[_0x6ca3('0x3c')]({},_0x3ffcb7,_0xbbe05c[_0x6ca3('0x43')]);return db[_0x6ca3('0x29')][_0x6ca3('0x44')](_0x3ffcb7)[_0x6ca3('0x23')](handleEntityNotFound(_0x36b4c9,null))[_0x6ca3('0x23')](respondWithResult(_0x36b4c9,null))['catch'](handleError(_0x36b4c9,null));};exports[_0x6ca3('0x45')]=function(_0x5c497b,_0x5a1d0f){return db[_0x6ca3('0x29')][_0x6ca3('0x45')](_0x5c497b[_0x6ca3('0x46')],{})[_0x6ca3('0x23')](respondWithResult(_0x5a1d0f,0xc9))[_0x6ca3('0x3f')](handleError(_0x5a1d0f,null));};exports[_0x6ca3('0x22')]=function(_0x527460,_0x3a21e7){if(_0x527460[_0x6ca3('0x46')]['id']){delete _0x527460[_0x6ca3('0x46')]['id'];}return db[_0x6ca3('0x29')][_0x6ca3('0x44')]({'where':{'id':_0x527460[_0x6ca3('0x41')]['id']}})[_0x6ca3('0x23')](handleEntityNotFound(_0x3a21e7,null))['then'](saveUpdates(_0x527460['body'],null))[_0x6ca3('0x23')](respondWithResult(_0x3a21e7,null))[_0x6ca3('0x3f')](handleError(_0x3a21e7,null));};exports[_0x6ca3('0x24')]=function(_0x2c53eb,_0x1fd264){return db[_0x6ca3('0x29')]['find']({'where':{'id':_0x2c53eb[_0x6ca3('0x41')]['id']}})[_0x6ca3('0x23')](handleEntityNotFound(_0x1fd264,null))['then'](removeEntity(_0x1fd264,null))[_0x6ca3('0x3f')](handleError(_0x1fd264,null));};exports[_0x6ca3('0x47')]=function(_0x36237d,_0x2fb8e0){return db[_0x6ca3('0x29')][_0x6ca3('0x47')]()[_0x6ca3('0x23')](respondWithResult(_0x2fb8e0,null))[_0x6ca3('0x3f')](handleError(_0x2fb8e0,null));};
\ No newline at end of file
+var _0x242f=['mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','json','apply','save','update','error','stack','name','send','index','map','SquareReport','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','then','includeAll','include','show','intersection','find','catch','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','request-promise'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x242f,0x118));var _0xf242=function(_0x2d357c,_0x58bd29){_0x2d357c=_0x2d357c-0x0;var _0x1a3480=_0x242f[_0x2d357c];return _0x1a3480;};'use strict';var emlformat=require(_0xf242('0x0'));var rimraf=require(_0xf242('0x1'));var zipdir=require(_0xf242('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf242('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf242('0x4'));var util=require(_0xf242('0x5'));var path=require('path');var sox=require(_0xf242('0x6'));var csv=require(_0xf242('0x7'));var ejs=require(_0xf242('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf242('0x9'));var squel=require(_0xf242('0xa'));var crypto=require(_0xf242('0xb'));var jsforce=require(_0xf242('0xc'));var deskjs=require(_0xf242('0xd'));var toCsv=require(_0xf242('0x7'));var querystring=require(_0xf242('0xe'));var Papa=require('papaparse');var Redis=require(_0xf242('0xf'));var authService=require(_0xf242('0x10'));var qs=require(_0xf242('0x11'));var as=require(_0xf242('0x12'));var hardwareService=require(_0xf242('0x13'));var logger=require(_0xf242('0x14'))('api');var utils=require(_0xf242('0x15'));var config=require(_0xf242('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e3cf3,_0x518bd7){_0x518bd7=_0x518bd7||0xcc;return function(_0x184aca){if(_0x184aca){return _0x3e3cf3[_0xf242('0x17')](_0x518bd7);}return _0x3e3cf3['status'](_0x518bd7)[_0xf242('0x18')]();};}function respondWithResult(_0x15f213,_0x3b9618){_0x3b9618=_0x3b9618||0xc8;return function(_0x4a6a08){if(_0x4a6a08){return _0x15f213[_0xf242('0x19')](_0x3b9618)['json'](_0x4a6a08);}};}function respondWithFilteredResult(_0x215137,_0x4560cc){return function(_0x3bf617){if(_0x3bf617){var _0x130c04=typeof _0x4560cc[_0xf242('0x1a')]===_0xf242('0x1b')&&typeof _0x4560cc[_0xf242('0x1c')]===_0xf242('0x1b');var _0x3fcb0a=_0x3bf617[_0xf242('0x1d')];var _0x216146=_0x130c04?0x0:_0x4560cc[_0xf242('0x1a')];var _0x2fb72a=_0x130c04?_0x3bf617['count']:_0x4560cc[_0xf242('0x1a')]+_0x4560cc[_0xf242('0x1c')];var _0x398c51;if(_0x2fb72a>=_0x3fcb0a){_0x2fb72a=_0x3fcb0a;_0x398c51=0xc8;}else{_0x398c51=0xce;}_0x215137[_0xf242('0x19')](_0x398c51);return _0x215137['set']('Content-Range',_0x216146+'-'+_0x2fb72a+'/'+_0x3fcb0a)[_0xf242('0x1e')](_0x3bf617);}return null;};}function patchUpdates(_0x535063){return function(_0x481014){try{jsonpatch[_0xf242('0x1f')](_0x481014,_0x535063,!![]);}catch(_0x43413d){return BPromise['reject'](_0x43413d);}return _0x481014[_0xf242('0x20')]();};}function saveUpdates(_0x48e254,_0x8af441){return function(_0x464a52){if(_0x464a52){return _0x464a52[_0xf242('0x21')](_0x48e254)['then'](function(_0xd0724b){return _0xd0724b;});}return null;};}function removeEntity(_0x30c4e6,_0x38e38d){return function(_0x440e7a){if(_0x440e7a){return _0x440e7a['destroy']()['then'](function(){_0x30c4e6[_0xf242('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2947c5,_0x8b8668){return function(_0x409ed0){if(!_0x409ed0){_0x2947c5[_0xf242('0x17')](0x194);}return _0x409ed0;};}function handleError(_0x1bffec,_0x1ca6ac){_0x1ca6ac=_0x1ca6ac||0x1f4;return function(_0x83ea36){logger[_0xf242('0x22')](_0x83ea36[_0xf242('0x23')]);if(_0x83ea36[_0xf242('0x24')]){delete _0x83ea36[_0xf242('0x24')];}_0x1bffec['status'](_0x1ca6ac)[_0xf242('0x25')](_0x83ea36);};}exports[_0xf242('0x26')]=function(_0x3ae134,_0x2b0444){var _0x26b0d3={},_0x463660={},_0x32aea5={'count':0x0,'rows':[]};var _0x14316d=_[_0xf242('0x27')](db[_0xf242('0x28')][_0xf242('0x29')],function(_0x308d40){return{'name':_0x308d40['fieldName'],'type':_0x308d40[_0xf242('0x2a')][_0xf242('0x2b')]};});_0x463660[_0xf242('0x2c')]=_[_0xf242('0x27')](_0x14316d,_0xf242('0x24'));_0x463660[_0xf242('0x2d')]=_[_0xf242('0x2e')](_0x3ae134[_0xf242('0x2d')]);_0x463660[_0xf242('0x2f')]=_['intersection'](_0x463660[_0xf242('0x2c')],_0x463660[_0xf242('0x2d')]);_0x26b0d3['attributes']=_['intersection'](_0x463660[_0xf242('0x2c')],qs[_0xf242('0x30')](_0x3ae134[_0xf242('0x2d')][_0xf242('0x30')]));_0x26b0d3['attributes']=_0x26b0d3[_0xf242('0x31')][_0xf242('0x32')]?_0x26b0d3[_0xf242('0x31')]:_0x463660['model'];if(!_0x3ae134['query'][_0xf242('0x33')](_0xf242('0x34'))){_0x26b0d3[_0xf242('0x1c')]=qs[_0xf242('0x1c')](_0x3ae134[_0xf242('0x2d')][_0xf242('0x1c')]);_0x26b0d3[_0xf242('0x1a')]=qs[_0xf242('0x1a')](_0x3ae134[_0xf242('0x2d')]['offset']);}_0x26b0d3[_0xf242('0x35')]=qs[_0xf242('0x36')](_0x3ae134['query'][_0xf242('0x36')]);_0x26b0d3[_0xf242('0x37')]=qs[_0xf242('0x2f')](_['pick'](_0x3ae134[_0xf242('0x2d')],_0x463660[_0xf242('0x2f')]),_0x14316d);if(_0x3ae134[_0xf242('0x2d')][_0xf242('0x38')]){_0x26b0d3[_0xf242('0x37')]=_[_0xf242('0x39')](_0x26b0d3['where'],{'$or':_[_0xf242('0x27')](_0x14316d,function(_0x30b6c5){if(_0x30b6c5['type']!=='VIRTUAL'){var _0xd320a8={};_0xd320a8[_0x30b6c5[_0xf242('0x24')]]={'$like':'%'+_0x3ae134[_0xf242('0x2d')][_0xf242('0x38')]+'%'};return _0xd320a8;}})});}_0x26b0d3=_[_0xf242('0x39')]({},_0x26b0d3,_0x3ae134[_0xf242('0x3a')]);var _0xac366={'where':_0x26b0d3[_0xf242('0x37')]};return db['SquareReport']['count'](_0xac366)[_0xf242('0x3b')](function(_0x3decbc){_0x32aea5[_0xf242('0x1d')]=_0x3decbc;if(_0x3ae134[_0xf242('0x2d')][_0xf242('0x3c')]){_0x26b0d3[_0xf242('0x3d')]=[{'all':!![]}];}return db[_0xf242('0x28')]['findAll'](_0x26b0d3);})[_0xf242('0x3b')](function(_0x1df3dc){_0x32aea5['rows']=_0x1df3dc;return _0x32aea5;})[_0xf242('0x3b')](respondWithFilteredResult(_0x2b0444,_0x26b0d3))['catch'](handleError(_0x2b0444,null));};exports[_0xf242('0x3e')]=function(_0x984d7,_0x717fc){var _0x5ac8f7={'raw':!![],'where':{'id':_0x984d7['params']['id']}},_0x1c7e7b={};_0x1c7e7b[_0xf242('0x2c')]=_['keys'](db['SquareReport'][_0xf242('0x29')]);_0x1c7e7b['query']=_[_0xf242('0x2e')](_0x984d7[_0xf242('0x2d')]);_0x1c7e7b[_0xf242('0x2f')]=_[_0xf242('0x3f')](_0x1c7e7b[_0xf242('0x2c')],_0x1c7e7b[_0xf242('0x2d')]);_0x5ac8f7['attributes']=_[_0xf242('0x3f')](_0x1c7e7b[_0xf242('0x2c')],qs[_0xf242('0x30')](_0x984d7['query'][_0xf242('0x30')]));_0x5ac8f7[_0xf242('0x31')]=_0x5ac8f7['attributes'][_0xf242('0x32')]?_0x5ac8f7['attributes']:_0x1c7e7b[_0xf242('0x2c')];if(_0x984d7[_0xf242('0x2d')][_0xf242('0x3c')]){_0x5ac8f7[_0xf242('0x3d')]=[{'all':!![]}];}_0x5ac8f7=_[_0xf242('0x39')]({},_0x5ac8f7,_0x984d7[_0xf242('0x3a')]);return db[_0xf242('0x28')][_0xf242('0x40')](_0x5ac8f7)[_0xf242('0x3b')](handleEntityNotFound(_0x717fc,null))['then'](respondWithResult(_0x717fc,null))[_0xf242('0x41')](handleError(_0x717fc,null));};exports[_0xf242('0x42')]=function(_0x4ab604,_0x4a80f8){return db[_0xf242('0x28')][_0xf242('0x42')](_0x4ab604[_0xf242('0x43')],{})[_0xf242('0x3b')](respondWithResult(_0x4a80f8,0xc9))[_0xf242('0x41')](handleError(_0x4a80f8,null));};exports['update']=function(_0x4d995c,_0x4d9447){if(_0x4d995c[_0xf242('0x43')]['id']){delete _0x4d995c[_0xf242('0x43')]['id'];}return db['SquareReport'][_0xf242('0x40')]({'where':{'id':_0x4d995c['params']['id']}})['then'](handleEntityNotFound(_0x4d9447,null))[_0xf242('0x3b')](saveUpdates(_0x4d995c[_0xf242('0x43')],null))[_0xf242('0x3b')](respondWithResult(_0x4d9447,null))[_0xf242('0x41')](handleError(_0x4d9447,null));};exports[_0xf242('0x44')]=function(_0x39282c,_0x1ec6d7){return db[_0xf242('0x28')][_0xf242('0x40')]({'where':{'id':_0x39282c[_0xf242('0x45')]['id']}})[_0xf242('0x3b')](handleEntityNotFound(_0x1ec6d7,null))[_0xf242('0x3b')](removeEntity(_0x1ec6d7,null))[_0xf242('0x41')](handleError(_0x1ec6d7,null));};exports[_0xf242('0x46')]=function(_0x2b868b,_0x5c4498){return db[_0xf242('0x28')]['describe']()[_0xf242('0x3b')](respondWithResult(_0x5c4498,null))[_0xf242('0x41')](handleError(_0x5c4498,null));};
\ No newline at end of file
index e63bb33..bf71008 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca65=['uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square'];(function(_0x3ef870,_0x1fde36){var _0x25cea7=function(_0x1c3a36){while(--_0x1c3a36){_0x3ef870['push'](_0x3ef870['shift']());}};_0x25cea7(++_0x1fde36);}(_0xca65,0x130));var _0x5ca6=function(_0x3ea4c0,_0x1a8ace){_0x3ea4c0=_0x3ea4c0-0x0;var _0x347bf4=_0xca65[_0x3ea4c0];return _0x347bf4;};'use strict';var _=require('lodash');var util=require(_0x5ca6('0x0'));var logger=require(_0x5ca6('0x1'))(_0x5ca6('0x2'));var moment=require('moment');var BPromise=require(_0x5ca6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ca6('0x4'));var rimraf=require(_0x5ca6('0x5'));var config=require(_0x5ca6('0x6'));var attributes=require(_0x5ca6('0x7'));module[_0x5ca6('0x8')]=function(_0x16f09d,_0x22024d){return _0x16f09d['define'](_0x5ca6('0x9'),attributes,{'tableName':_0x5ca6('0xa'),'paranoid':![],'indexes':[{'name':_0x5ca6('0xb'),'fields':[_0x5ca6('0xc'),_0x5ca6('0xd')]},{'name':'leaveAt','fields':[_0x5ca6('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc545=['SquareReport','report_square','uid_pname','uniqueid','leaveAt','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports'];(function(_0x2067c1,_0x4ad413){var _0x4c2968=function(_0x51df02){while(--_0x51df02){_0x2067c1['push'](_0x2067c1['shift']());}};_0x4c2968(++_0x4ad413);}(_0xc545,0x17f));var _0x5c54=function(_0x319568,_0x5217d4){_0x319568=_0x319568-0x0;var _0x526b3e=_0xc545[_0x319568];return _0x526b3e;};'use strict';var _=require('lodash');var util=require(_0x5c54('0x0'));var logger=require(_0x5c54('0x1'))(_0x5c54('0x2'));var moment=require('moment');var BPromise=require(_0x5c54('0x3'));var rp=require(_0x5c54('0x4'));var fs=require('fs');var path=require(_0x5c54('0x5'));var rimraf=require('rimraf');var config=require(_0x5c54('0x6'));var attributes=require(_0x5c54('0x7'));module[_0x5c54('0x8')]=function(_0x2b961e,_0x540d4f){return _0x2b961e['define'](_0x5c54('0x9'),attributes,{'tableName':_0x5c54('0xa'),'paranoid':![],'indexes':[{'name':_0x5c54('0xb'),'fields':[_0x5c54('0xc'),'project_name']},{'name':_0x5c54('0xd'),'fields':[_0x5c54('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 4f6f541..ac69bbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a31=['then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareReport','SquareReport','create','body','options','raw','update','where','UpdateSquareReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x0a31,0x70));var _0x10a3=function(_0x2a309d,_0x183dc9){_0x2a309d=_0x2a309d-0x0;var _0x1f2878=_0x0a31[_0x2a309d];return _0x1f2878;};'use strict';var _=require(_0x10a3('0x0'));var util=require('util');var moment=require(_0x10a3('0x1'));var BPromise=require(_0x10a3('0x2'));var rs=require(_0x10a3('0x3'));var fs=require('fs');var Redis=require(_0x10a3('0x4'));var db=require(_0x10a3('0x5'))['db'];var utils=require(_0x10a3('0x6'));var logger=require(_0x10a3('0x7'))(_0x10a3('0x8'));var config=require(_0x10a3('0x9'));var jayson=require(_0x10a3('0xa'));var client=jayson[_0x10a3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19749e,_0x4c753d,_0x3ddb57){return new BPromise(function(_0xe3a62,_0x315068){return client['request'](_0x19749e,_0x3ddb57)[_0x10a3('0xc')](function(_0x51e692){logger[_0x10a3('0xd')](_0x10a3('0xe'),_0x4c753d,_0x10a3('0xf'));logger[_0x10a3('0x10')](_0x10a3('0x11'),_0x4c753d,_0x10a3('0xf'),JSON[_0x10a3('0x12')](_0x51e692));if(_0x51e692[_0x10a3('0x13')]){if(_0x51e692[_0x10a3('0x13')]['code']===0x1f4){logger[_0x10a3('0x13')]('SquareReport,\x20%s,\x20%s',_0x4c753d,_0x51e692['error'][_0x10a3('0x14')]);return _0x315068(_0x51e692['error']['message']);}logger[_0x10a3('0x13')](_0x10a3('0xe'),_0x4c753d,_0x51e692['error']['message']);return _0xe3a62(_0x51e692[_0x10a3('0x13')][_0x10a3('0x14')]);}else{logger['info'](_0x10a3('0xe'),_0x4c753d,_0x10a3('0xf'));_0xe3a62(_0x51e692['result']['message']);}})[_0x10a3('0x15')](function(_0x48fa89){logger[_0x10a3('0x13')](_0x10a3('0xe'),_0x4c753d,_0x48fa89);_0x315068(_0x48fa89);});});}exports[_0x10a3('0x16')]=function(_0xa9682d){var _0x5134f0=this;return new Promise(function(_0x1aac5b,_0x3a736a){return db[_0x10a3('0x17')][_0x10a3('0x18')](_0xa9682d[_0x10a3('0x19')],{'raw':_0xa9682d[_0x10a3('0x1a')]?_0xa9682d[_0x10a3('0x1a')][_0x10a3('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2185a3){logger[_0x10a3('0xd')](_0x10a3('0x16'),_0xa9682d);logger[_0x10a3('0x10')](_0x10a3('0x16'),_0xa9682d,JSON[_0x10a3('0x12')](_0x2185a3));_0x1aac5b(_0x2185a3);})['catch'](function(_0x54aee9){logger[_0x10a3('0x13')](_0x10a3('0x16'),_0x54aee9['message'],_0xa9682d);_0x3a736a(_0x5134f0['error'](0x1f4,_0x54aee9[_0x10a3('0x14')]));});});};exports['UpdateSquareReport']=function(_0x42bd94){var _0x323075=this;return new Promise(function(_0xf85465,_0xdfa98c){return db[_0x10a3('0x17')][_0x10a3('0x1c')](_0x42bd94[_0x10a3('0x19')],{'raw':_0x42bd94[_0x10a3('0x1a')]?_0x42bd94[_0x10a3('0x1a')][_0x10a3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42bd94[_0x10a3('0x1a')]?_0x42bd94[_0x10a3('0x1a')][_0x10a3('0x1d')]||null:null,'attributes':_0x42bd94[_0x10a3('0x1a')]?_0x42bd94[_0x10a3('0x1a')]['attributes']||null:null,'limit':_0x42bd94[_0x10a3('0x1a')]?_0x42bd94[_0x10a3('0x1a')]['limit']||null:null})[_0x10a3('0xc')](function(_0x2ba1f0){logger[_0x10a3('0xd')]('UpdateSquareReport',_0x42bd94);logger[_0x10a3('0x10')](_0x10a3('0x1e'),_0x42bd94,JSON[_0x10a3('0x12')](_0x2ba1f0));_0xf85465(_0x2ba1f0);})[_0x10a3('0x15')](function(_0x3c6141){logger[_0x10a3('0x13')](_0x10a3('0x1e'),_0x3c6141['message'],_0x42bd94);_0xdfa98c(_0x323075[_0x10a3('0x13')](0x1f4,_0x3c6141[_0x10a3('0x14')]));});});};
\ No newline at end of file
+var _0x6f4f=['request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','debug','update','raw','where','limit','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0x6f4f,0x80));var _0xf6f4=function(_0x19947e,_0x2abd40){_0x19947e=_0x19947e-0x0;var _0x3b960d=_0x6f4f[_0x19947e];return _0x3b960d;};'use strict';var _=require(_0xf6f4('0x0'));var util=require(_0xf6f4('0x1'));var moment=require(_0xf6f4('0x2'));var BPromise=require(_0xf6f4('0x3'));var rs=require(_0xf6f4('0x4'));var fs=require('fs');var Redis=require(_0xf6f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf6f4('0x6'));var logger=require(_0xf6f4('0x7'))(_0xf6f4('0x8'));var config=require(_0xf6f4('0x9'));var jayson=require(_0xf6f4('0xa'));var client=jayson['client'][_0xf6f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f2b33,_0x477918,_0x4f88d0){return new BPromise(function(_0x4bdfcf,_0x2c8373){return client[_0xf6f4('0xc')](_0x3f2b33,_0x4f88d0)[_0xf6f4('0xd')](function(_0x5c0ed9){logger[_0xf6f4('0xe')](_0xf6f4('0xf'),_0x477918,_0xf6f4('0x10'));logger['debug'](_0xf6f4('0x11'),_0x477918,_0xf6f4('0x10'),JSON[_0xf6f4('0x12')](_0x5c0ed9));if(_0x5c0ed9[_0xf6f4('0x13')]){if(_0x5c0ed9[_0xf6f4('0x13')][_0xf6f4('0x14')]===0x1f4){logger['error'](_0xf6f4('0xf'),_0x477918,_0x5c0ed9[_0xf6f4('0x13')]['message']);return _0x2c8373(_0x5c0ed9[_0xf6f4('0x13')][_0xf6f4('0x15')]);}logger[_0xf6f4('0x13')](_0xf6f4('0xf'),_0x477918,_0x5c0ed9[_0xf6f4('0x13')][_0xf6f4('0x15')]);return _0x4bdfcf(_0x5c0ed9[_0xf6f4('0x13')][_0xf6f4('0x15')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x477918,'request\x20sent');_0x4bdfcf(_0x5c0ed9[_0xf6f4('0x16')][_0xf6f4('0x15')]);}})[_0xf6f4('0x17')](function(_0x361ee6){logger[_0xf6f4('0x13')](_0xf6f4('0xf'),_0x477918,_0x361ee6);_0x2c8373(_0x361ee6);});});}exports[_0xf6f4('0x18')]=function(_0x5343ea){var _0x3ebcbc=this;return new Promise(function(_0x9b1a84,_0x2b35f7){return db[_0xf6f4('0x19')][_0xf6f4('0x1a')](_0x5343ea[_0xf6f4('0x1b')],{'raw':_0x5343ea['options']?_0x5343ea[_0xf6f4('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xf6f4('0xd')](function(_0x3823ee){logger['info'](_0xf6f4('0x18'),_0x5343ea);logger[_0xf6f4('0x1d')](_0xf6f4('0x18'),_0x5343ea,JSON['stringify'](_0x3823ee));_0x9b1a84(_0x3823ee);})[_0xf6f4('0x17')](function(_0x4ccb83){logger[_0xf6f4('0x13')]('CreateSquareReport',_0x4ccb83['message'],_0x5343ea);_0x2b35f7(_0x3ebcbc[_0xf6f4('0x13')](0x1f4,_0x4ccb83[_0xf6f4('0x15')]));});});};exports['UpdateSquareReport']=function(_0x441fae){var _0x3b4bf3=this;return new Promise(function(_0x4f62be,_0x3e0830){return db['SquareReport'][_0xf6f4('0x1e')](_0x441fae[_0xf6f4('0x1b')],{'raw':_0x441fae[_0xf6f4('0x1c')]?_0x441fae[_0xf6f4('0x1c')][_0xf6f4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x441fae[_0xf6f4('0x1c')]?_0x441fae[_0xf6f4('0x1c')][_0xf6f4('0x20')]||null:null,'attributes':_0x441fae[_0xf6f4('0x1c')]?_0x441fae['options']['attributes']||null:null,'limit':_0x441fae[_0xf6f4('0x1c')]?_0x441fae[_0xf6f4('0x1c')][_0xf6f4('0x21')]||null:null})[_0xf6f4('0xd')](function(_0x8d6f9a){logger['info']('UpdateSquareReport',_0x441fae);logger[_0xf6f4('0x1d')](_0xf6f4('0x22'),_0x441fae,JSON[_0xf6f4('0x12')](_0x8d6f9a));_0x4f62be(_0x8d6f9a);})[_0xf6f4('0x17')](function(_0x336c18){logger[_0xf6f4('0x13')](_0xf6f4('0x22'),_0x336c18[_0xf6f4('0x15')],_0x441fae);_0x3e0830(_0x3b4bf3[_0xf6f4('0x13')](0x1f4,_0x336c18[_0xf6f4('0x15')]));});});};
\ No newline at end of file
index c17821e..c14a154 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57aa=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe'];(function(_0x42c0fa,_0x81c999){var _0x57f787=function(_0x5e983b){while(--_0x5e983b){_0x42c0fa['push'](_0x42c0fa['shift']());}};_0x57f787(++_0x81c999);}(_0x57aa,0xc6));var _0xa57a=function(_0x5ebc04,_0x14a363){_0x5ebc04=_0x5ebc04-0x0;var _0x17845c=_0x57aa[_0x5ebc04];return _0x17845c;};'use strict';var multer=require('multer');var util=require(_0xa57a('0x0'));var path=require(_0xa57a('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57a('0x2'));var router=express[_0xa57a('0x3')]();var fs_extra=require(_0xa57a('0x4'));var auth=require(_0xa57a('0x5'));var interaction=require(_0xa57a('0x6'));var config=require(_0xa57a('0x7'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0xa57a('0x8')](),controller[_0xa57a('0x9')]);router['get'](_0xa57a('0xa'),auth['isAuthenticated'](),controller[_0xa57a('0xb')]);router['get'](_0xa57a('0xc'),auth[_0xa57a('0x8')](),controller[_0xa57a('0xd')]);router[_0xa57a('0xe')]('/',auth[_0xa57a('0x8')](),controller[_0xa57a('0xf')]);router[_0xa57a('0x10')](_0xa57a('0xc'),auth['isAuthenticated'](),controller[_0xa57a('0x11')]);router[_0xa57a('0x12')](_0xa57a('0xc'),auth['isAuthenticated'](),controller[_0xa57a('0x13')]);module[_0xa57a('0x14')]=router;
\ No newline at end of file
+var _0xc0f6=['index','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0xc2cc1a,_0x4675c9){var _0x4cff37=function(_0x220e5b){while(--_0x220e5b){_0xc2cc1a['push'](_0xc2cc1a['shift']());}};_0x4cff37(++_0x4675c9);}(_0xc0f6,0x1d8));var _0x6c0f=function(_0x20936e,_0x4d5283){_0x20936e=_0x20936e-0x0;var _0x50a212=_0xc0f6[_0x20936e];return _0x50a212;};'use strict';var multer=require(_0x6c0f('0x0'));var util=require(_0x6c0f('0x1'));var path=require('path');var timeout=require(_0x6c0f('0x2'));var express=require(_0x6c0f('0x3'));var router=express[_0x6c0f('0x4')]();var fs_extra=require(_0x6c0f('0x5'));var auth=require(_0x6c0f('0x6'));var interaction=require(_0x6c0f('0x7'));var config=require(_0x6c0f('0x8'));var controller=require(_0x6c0f('0x9'));router[_0x6c0f('0xa')]('/',auth[_0x6c0f('0xb')](),controller[_0x6c0f('0xc')]);router[_0x6c0f('0xa')](_0x6c0f('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x6c0f('0xa')](_0x6c0f('0xe'),auth[_0x6c0f('0xb')](),controller['show']);router[_0x6c0f('0xf')]('/',auth[_0x6c0f('0xb')](),controller[_0x6c0f('0x10')]);router[_0x6c0f('0x11')](_0x6c0f('0xe'),auth[_0x6c0f('0xb')](),controller[_0x6c0f('0x12')]);router[_0x6c0f('0x13')](_0x6c0f('0xe'),auth[_0x6c0f('0xb')](),controller[_0x6c0f('0x14')]);module[_0x6c0f('0x15')]=router;
\ No newline at end of file
index 203e84d..c9f0be3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bcb=['STRING','exports'];(function(_0x3b8e5c,_0x182a8c){var _0x13c71f=function(_0x382722){while(--_0x382722){_0x3b8e5c['push'](_0x3b8e5c['shift']());}};_0x13c71f(++_0x182a8c);}(_0x1bcb,0x89));var _0xb1bc=function(_0x155503,_0x4efeb0){_0x155503=_0x155503-0x0;var _0x4427f1=_0x1bcb[_0x155503];return _0x4427f1;};'use strict';var Sequelize=require('sequelize');module[_0xb1bc('0x0')]={'uniqueid':{'type':Sequelize[_0xb1bc('0x1')]},'node':{'type':Sequelize[_0xb1bc('0x1')]},'application':{'type':Sequelize[_0xb1bc('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xb1bc('0x1')]},'callerid':{'type':Sequelize[_0xb1bc('0x1')]}};
\ No newline at end of file
+var _0x2ce1=['STRING','TEXT','sequelize','exports'];(function(_0x3f5f68,_0xa3bc8f){var _0x412342=function(_0x29c50d){while(--_0x29c50d){_0x3f5f68['push'](_0x3f5f68['shift']());}};_0x412342(++_0xa3bc8f);}(_0x2ce1,0x176));var _0x12ce=function(_0xaa7e8b,_0x25db8b){_0xaa7e8b=_0xaa7e8b-0x0;var _0xeb3130=_0x2ce1[_0xaa7e8b];return _0xeb3130;};'use strict';var Sequelize=require(_0x12ce('0x0'));module[_0x12ce('0x1')]={'uniqueid':{'type':Sequelize[_0x12ce('0x2')]},'node':{'type':Sequelize[_0x12ce('0x2')]},'application':{'type':Sequelize[_0x12ce('0x2')]},'data':{'type':Sequelize[_0x12ce('0x3')]},'project_name':{'type':Sequelize[_0x12ce('0x2')]},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9717550..5e33415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8660=['ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','SquareDetailsReport','rawAttributes','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse'];(function(_0x4fcbec,_0x90e467){var _0x275177=function(_0x1f706b){while(--_0x1f706b){_0x4fcbec['push'](_0x4fcbec['shift']());}};_0x275177(++_0x90e467);}(_0x8660,0x196));var _0x0866=function(_0x8ee4e8,_0x192cf2){_0x8ee4e8=_0x8ee4e8-0x0;var _0x4b1ec4=_0x8660[_0x8ee4e8];return _0x4b1ec4;};'use strict';var emlformat=require(_0x0866('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0866('0x1'));var jsonpatch=require(_0x0866('0x2'));var rp=require(_0x0866('0x3'));var moment=require(_0x0866('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0866('0x5'));var sox=require(_0x0866('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0866('0x7'));var _=require(_0x0866('0x8'));var squel=require(_0x0866('0x9'));var crypto=require('crypto');var jsforce=require(_0x0866('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0866('0xb'));var querystring=require(_0x0866('0xc'));var Papa=require(_0x0866('0xd'));var Redis=require(_0x0866('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0866('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0866('0x10'));var utils=require(_0x0866('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x0866('0x12'));var db=require(_0x0866('0x13'))['db'];function respondWithStatusCode(_0x358ca1,_0x4e256b){_0x4e256b=_0x4e256b||0xcc;return function(_0x4fc76b){if(_0x4fc76b){return _0x358ca1[_0x0866('0x14')](_0x4e256b);}return _0x358ca1[_0x0866('0x15')](_0x4e256b)[_0x0866('0x16')]();};}function respondWithResult(_0x5b8851,_0x594c2a){_0x594c2a=_0x594c2a||0xc8;return function(_0x541e1c){if(_0x541e1c){return _0x5b8851[_0x0866('0x15')](_0x594c2a)[_0x0866('0x17')](_0x541e1c);}};}function respondWithFilteredResult(_0x20bf9c,_0x4138c1){return function(_0x56d520){if(_0x56d520){var _0x31cc18=typeof _0x4138c1[_0x0866('0x18')]==='undefined'&&typeof _0x4138c1[_0x0866('0x19')]==='undefined';var _0x2be991=_0x56d520[_0x0866('0x1a')];var _0x113b5d=_0x31cc18?0x0:_0x4138c1[_0x0866('0x18')];var _0x15b573=_0x31cc18?_0x56d520[_0x0866('0x1a')]:_0x4138c1[_0x0866('0x18')]+_0x4138c1[_0x0866('0x19')];var _0x40729f;if(_0x15b573>=_0x2be991){_0x15b573=_0x2be991;_0x40729f=0xc8;}else{_0x40729f=0xce;}_0x20bf9c[_0x0866('0x15')](_0x40729f);return _0x20bf9c[_0x0866('0x1b')](_0x0866('0x1c'),_0x113b5d+'-'+_0x15b573+'/'+_0x2be991)[_0x0866('0x17')](_0x56d520);}return null;};}function patchUpdates(_0x2c8167){return function(_0x38eba3){try{jsonpatch[_0x0866('0x1d')](_0x38eba3,_0x2c8167,!![]);}catch(_0x5114cf){return BPromise[_0x0866('0x1e')](_0x5114cf);}return _0x38eba3['save']();};}function saveUpdates(_0x3c3afe,_0x3215ef){return function(_0x12987c){if(_0x12987c){return _0x12987c[_0x0866('0x1f')](_0x3c3afe)[_0x0866('0x20')](function(_0x3fd092){return _0x3fd092;});}return null;};}function removeEntity(_0x301391,_0x6f0e58){return function(_0x45ac50){if(_0x45ac50){return _0x45ac50['destroy']()[_0x0866('0x20')](function(){_0x301391[_0x0866('0x15')](0xcc)[_0x0866('0x16')]();});}};}function handleEntityNotFound(_0x118aa8,_0x12c2d8){return function(_0x2ef420){if(!_0x2ef420){_0x118aa8[_0x0866('0x14')](0x194);}return _0x2ef420;};}function handleError(_0x24f79a,_0x24e34f){_0x24e34f=_0x24e34f||0x1f4;return function(_0x440b1c){logger[_0x0866('0x21')](_0x440b1c[_0x0866('0x22')]);if(_0x440b1c[_0x0866('0x23')]){delete _0x440b1c['name'];}_0x24f79a[_0x0866('0x15')](_0x24e34f)[_0x0866('0x24')](_0x440b1c);};}exports[_0x0866('0x25')]=function(_0x2903c6,_0x10b8f4){var _0x7e5cd9={},_0x275d35={},_0x2a125d={'count':0x0,'rows':[]};var _0x1ea9b1=_['map'](db[_0x0866('0x26')][_0x0866('0x27')],function(_0x16474d){return{'name':_0x16474d['fieldName'],'type':_0x16474d['type']['key']};});_0x275d35[_0x0866('0x28')]=_[_0x0866('0x29')](_0x1ea9b1,'name');_0x275d35[_0x0866('0x2a')]=_[_0x0866('0x2b')](_0x2903c6[_0x0866('0x2a')]);_0x275d35[_0x0866('0x2c')]=_['intersection'](_0x275d35[_0x0866('0x28')],_0x275d35[_0x0866('0x2a')]);_0x7e5cd9[_0x0866('0x2d')]=_[_0x0866('0x2e')](_0x275d35['model'],qs[_0x0866('0x2f')](_0x2903c6[_0x0866('0x2a')][_0x0866('0x2f')]));_0x7e5cd9[_0x0866('0x2d')]=_0x7e5cd9[_0x0866('0x2d')][_0x0866('0x30')]?_0x7e5cd9[_0x0866('0x2d')]:_0x275d35[_0x0866('0x28')];if(!_0x2903c6[_0x0866('0x2a')][_0x0866('0x31')]('nolimit')){_0x7e5cd9[_0x0866('0x19')]=qs[_0x0866('0x19')](_0x2903c6['query'][_0x0866('0x19')]);_0x7e5cd9[_0x0866('0x18')]=qs['offset'](_0x2903c6[_0x0866('0x2a')]['offset']);}_0x7e5cd9[_0x0866('0x32')]=qs['sort'](_0x2903c6[_0x0866('0x2a')][_0x0866('0x33')]);_0x7e5cd9[_0x0866('0x34')]=qs['filters'](_[_0x0866('0x35')](_0x2903c6['query'],_0x275d35[_0x0866('0x2c')]),_0x1ea9b1);if(_0x2903c6[_0x0866('0x2a')][_0x0866('0x36')]){_0x7e5cd9[_0x0866('0x34')]=_[_0x0866('0x37')](_0x7e5cd9['where'],{'$or':_[_0x0866('0x29')](_0x1ea9b1,function(_0x3a00ed){if(_0x3a00ed[_0x0866('0x38')]!==_0x0866('0x39')){var _0x33ae00={};_0x33ae00[_0x3a00ed[_0x0866('0x23')]]={'$like':'%'+_0x2903c6[_0x0866('0x2a')][_0x0866('0x36')]+'%'};return _0x33ae00;}})});}_0x7e5cd9=_['merge']({},_0x7e5cd9,_0x2903c6[_0x0866('0x3a')]);var _0x3c1e30={'where':_0x7e5cd9[_0x0866('0x34')]};return db[_0x0866('0x26')]['count'](_0x3c1e30)['then'](function(_0x3f4784){_0x2a125d[_0x0866('0x1a')]=_0x3f4784;if(_0x2903c6[_0x0866('0x2a')][_0x0866('0x3b')]){_0x7e5cd9[_0x0866('0x3c')]=[{'all':!![]}];}return db[_0x0866('0x26')][_0x0866('0x3d')](_0x7e5cd9);})[_0x0866('0x20')](function(_0x1ff6f1){_0x2a125d[_0x0866('0x3e')]=_0x1ff6f1;return _0x2a125d;})[_0x0866('0x20')](respondWithFilteredResult(_0x10b8f4,_0x7e5cd9))['catch'](handleError(_0x10b8f4,null));};exports['show']=function(_0x410e82,_0x21957c){var _0xe0a401={'raw':!![],'where':{'id':_0x410e82[_0x0866('0x3f')]['id']}},_0x3bea12={};_0x3bea12[_0x0866('0x28')]=_['keys'](db[_0x0866('0x26')]['rawAttributes']);_0x3bea12[_0x0866('0x2a')]=_['keys'](_0x410e82['query']);_0x3bea12[_0x0866('0x2c')]=_[_0x0866('0x2e')](_0x3bea12[_0x0866('0x28')],_0x3bea12[_0x0866('0x2a')]);_0xe0a401['attributes']=_['intersection'](_0x3bea12['model'],qs['fields'](_0x410e82[_0x0866('0x2a')][_0x0866('0x2f')]));_0xe0a401[_0x0866('0x2d')]=_0xe0a401['attributes']['length']?_0xe0a401[_0x0866('0x2d')]:_0x3bea12[_0x0866('0x28')];if(_0x410e82[_0x0866('0x2a')]['includeAll']){_0xe0a401[_0x0866('0x3c')]=[{'all':!![]}];}_0xe0a401=_[_0x0866('0x37')]({},_0xe0a401,_0x410e82[_0x0866('0x3a')]);return db[_0x0866('0x26')]['find'](_0xe0a401)[_0x0866('0x20')](handleEntityNotFound(_0x21957c,null))[_0x0866('0x20')](respondWithResult(_0x21957c,null))[_0x0866('0x40')](handleError(_0x21957c,null));};exports[_0x0866('0x41')]=function(_0x59acba,_0x56b0d1){return db['SquareDetailsReport'][_0x0866('0x41')](_0x59acba[_0x0866('0x42')],{})[_0x0866('0x20')](respondWithResult(_0x56b0d1,0xc9))[_0x0866('0x40')](handleError(_0x56b0d1,null));};exports['update']=function(_0x59bdb3,_0x4c8ce7){if(_0x59bdb3[_0x0866('0x42')]['id']){delete _0x59bdb3[_0x0866('0x42')]['id'];}return db['SquareDetailsReport'][_0x0866('0x43')]({'where':{'id':_0x59bdb3[_0x0866('0x3f')]['id']}})[_0x0866('0x20')](handleEntityNotFound(_0x4c8ce7,null))[_0x0866('0x20')](saveUpdates(_0x59bdb3['body'],null))[_0x0866('0x20')](respondWithResult(_0x4c8ce7,null))[_0x0866('0x40')](handleError(_0x4c8ce7,null));};exports[_0x0866('0x44')]=function(_0x58c8be,_0x343cb5){return db['SquareDetailsReport'][_0x0866('0x43')]({'where':{'id':_0x58c8be[_0x0866('0x3f')]['id']}})[_0x0866('0x20')](handleEntityNotFound(_0x343cb5,null))[_0x0866('0x20')](removeEntity(_0x343cb5,null))[_0x0866('0x40')](handleError(_0x343cb5,null));};exports[_0x0866('0x45')]=function(_0x2aec90,_0x9d146b){return db[_0x0866('0x26')]['describe']()[_0x0866('0x20')](respondWithResult(_0x9d146b,null))[_0x0866('0x40')](handleError(_0x9d146b,null));};
\ No newline at end of file
+var _0xdbb9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','query'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0xdbb9,0x14e));var _0x9dbb=function(_0x356870,_0x3a1d32){_0x356870=_0x356870-0x0;var _0x2cc847=_0xdbb9[_0x356870];return _0x2cc847;};'use strict';var emlformat=require(_0x9dbb('0x0'));var rimraf=require(_0x9dbb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9dbb('0x2'));var rp=require('request-promise');var moment=require(_0x9dbb('0x3'));var BPromise=require(_0x9dbb('0x4'));var Mustache=require(_0x9dbb('0x5'));var util=require(_0x9dbb('0x6'));var path=require(_0x9dbb('0x7'));var sox=require(_0x9dbb('0x8'));var csv=require(_0x9dbb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9dbb('0xa'));var _=require(_0x9dbb('0xb'));var squel=require(_0x9dbb('0xc'));var crypto=require(_0x9dbb('0xd'));var jsforce=require(_0x9dbb('0xe'));var deskjs=require(_0x9dbb('0xf'));var toCsv=require(_0x9dbb('0x9'));var querystring=require(_0x9dbb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9dbb('0x11'));var qs=require(_0x9dbb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dbb('0x13'));var logger=require(_0x9dbb('0x14'))(_0x9dbb('0x15'));var utils=require(_0x9dbb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9dbb('0x17'));var db=require(_0x9dbb('0x18'))['db'];function respondWithStatusCode(_0x47da46,_0xcc1dd2){_0xcc1dd2=_0xcc1dd2||0xcc;return function(_0x21441b){if(_0x21441b){return _0x47da46['sendStatus'](_0xcc1dd2);}return _0x47da46[_0x9dbb('0x19')](_0xcc1dd2)[_0x9dbb('0x1a')]();};}function respondWithResult(_0x344c40,_0x222242){_0x222242=_0x222242||0xc8;return function(_0x57c0e0){if(_0x57c0e0){return _0x344c40['status'](_0x222242)['json'](_0x57c0e0);}};}function respondWithFilteredResult(_0xb3370e,_0x14c42e){return function(_0x5ce791){if(_0x5ce791){var _0x1267ab=typeof _0x14c42e[_0x9dbb('0x1b')]==='undefined'&&typeof _0x14c42e[_0x9dbb('0x1c')]===_0x9dbb('0x1d');var _0x5ed3c2=_0x5ce791[_0x9dbb('0x1e')];var _0x497bf9=_0x1267ab?0x0:_0x14c42e[_0x9dbb('0x1b')];var _0x183641=_0x1267ab?_0x5ce791[_0x9dbb('0x1e')]:_0x14c42e[_0x9dbb('0x1b')]+_0x14c42e[_0x9dbb('0x1c')];var _0x344682;if(_0x183641>=_0x5ed3c2){_0x183641=_0x5ed3c2;_0x344682=0xc8;}else{_0x344682=0xce;}_0xb3370e[_0x9dbb('0x19')](_0x344682);return _0xb3370e[_0x9dbb('0x1f')](_0x9dbb('0x20'),_0x497bf9+'-'+_0x183641+'/'+_0x5ed3c2)[_0x9dbb('0x21')](_0x5ce791);}return null;};}function patchUpdates(_0x508da2){return function(_0x350888){try{jsonpatch['apply'](_0x350888,_0x508da2,!![]);}catch(_0x3dd66d){return BPromise[_0x9dbb('0x22')](_0x3dd66d);}return _0x350888[_0x9dbb('0x23')]();};}function saveUpdates(_0x45b1c4,_0x31eb04){return function(_0x48452c){if(_0x48452c){return _0x48452c[_0x9dbb('0x24')](_0x45b1c4)[_0x9dbb('0x25')](function(_0x24031c){return _0x24031c;});}return null;};}function removeEntity(_0x3aadb9,_0x5b2ce1){return function(_0x481969){if(_0x481969){return _0x481969[_0x9dbb('0x26')]()[_0x9dbb('0x25')](function(){_0x3aadb9[_0x9dbb('0x19')](0xcc)[_0x9dbb('0x1a')]();});}};}function handleEntityNotFound(_0x29fc15,_0xa29792){return function(_0x10bd58){if(!_0x10bd58){_0x29fc15[_0x9dbb('0x27')](0x194);}return _0x10bd58;};}function handleError(_0x58f69e,_0x10b4c0){_0x10b4c0=_0x10b4c0||0x1f4;return function(_0x55a6a5){logger['error'](_0x55a6a5[_0x9dbb('0x28')]);if(_0x55a6a5['name']){delete _0x55a6a5[_0x9dbb('0x29')];}_0x58f69e[_0x9dbb('0x19')](_0x10b4c0)[_0x9dbb('0x2a')](_0x55a6a5);};}exports[_0x9dbb('0x2b')]=function(_0x47161a,_0x3e1fbb){var _0x4119b1={},_0x4c9e2b={},_0x3955d5={'count':0x0,'rows':[]};var _0xfbb925=_[_0x9dbb('0x2c')](db[_0x9dbb('0x2d')][_0x9dbb('0x2e')],function(_0x22fdbb){return{'name':_0x22fdbb['fieldName'],'type':_0x22fdbb[_0x9dbb('0x2f')][_0x9dbb('0x30')]};});_0x4c9e2b[_0x9dbb('0x31')]=_['map'](_0xfbb925,_0x9dbb('0x29'));_0x4c9e2b[_0x9dbb('0x32')]=_[_0x9dbb('0x33')](_0x47161a[_0x9dbb('0x32')]);_0x4c9e2b[_0x9dbb('0x34')]=_[_0x9dbb('0x35')](_0x4c9e2b['model'],_0x4c9e2b[_0x9dbb('0x32')]);_0x4119b1[_0x9dbb('0x36')]=_[_0x9dbb('0x35')](_0x4c9e2b[_0x9dbb('0x31')],qs['fields'](_0x47161a[_0x9dbb('0x32')][_0x9dbb('0x37')]));_0x4119b1[_0x9dbb('0x36')]=_0x4119b1['attributes'][_0x9dbb('0x38')]?_0x4119b1[_0x9dbb('0x36')]:_0x4c9e2b[_0x9dbb('0x31')];if(!_0x47161a[_0x9dbb('0x32')][_0x9dbb('0x39')]('nolimit')){_0x4119b1['limit']=qs[_0x9dbb('0x1c')](_0x47161a[_0x9dbb('0x32')][_0x9dbb('0x1c')]);_0x4119b1[_0x9dbb('0x1b')]=qs['offset'](_0x47161a[_0x9dbb('0x32')]['offset']);}_0x4119b1[_0x9dbb('0x3a')]=qs['sort'](_0x47161a['query'][_0x9dbb('0x3b')]);_0x4119b1[_0x9dbb('0x3c')]=qs[_0x9dbb('0x34')](_[_0x9dbb('0x3d')](_0x47161a[_0x9dbb('0x32')],_0x4c9e2b['filters']),_0xfbb925);if(_0x47161a[_0x9dbb('0x32')][_0x9dbb('0x3e')]){_0x4119b1[_0x9dbb('0x3c')]=_[_0x9dbb('0x3f')](_0x4119b1[_0x9dbb('0x3c')],{'$or':_['map'](_0xfbb925,function(_0x3b44fe){if(_0x3b44fe[_0x9dbb('0x2f')]!==_0x9dbb('0x40')){var _0xc7667e={};_0xc7667e[_0x3b44fe[_0x9dbb('0x29')]]={'$like':'%'+_0x47161a[_0x9dbb('0x32')]['filter']+'%'};return _0xc7667e;}})});}_0x4119b1=_[_0x9dbb('0x3f')]({},_0x4119b1,_0x47161a[_0x9dbb('0x41')]);var _0x24454f={'where':_0x4119b1['where']};return db['SquareDetailsReport']['count'](_0x24454f)['then'](function(_0x33afc3){_0x3955d5['count']=_0x33afc3;if(_0x47161a['query'][_0x9dbb('0x42')]){_0x4119b1[_0x9dbb('0x43')]=[{'all':!![]}];}return db[_0x9dbb('0x2d')][_0x9dbb('0x44')](_0x4119b1);})[_0x9dbb('0x25')](function(_0x56ebd0){_0x3955d5[_0x9dbb('0x45')]=_0x56ebd0;return _0x3955d5;})[_0x9dbb('0x25')](respondWithFilteredResult(_0x3e1fbb,_0x4119b1))[_0x9dbb('0x46')](handleError(_0x3e1fbb,null));};exports[_0x9dbb('0x47')]=function(_0xd9da26,_0x504c5c){var _0x1d3347={'raw':!![],'where':{'id':_0xd9da26['params']['id']}},_0x45dfd0={};_0x45dfd0[_0x9dbb('0x31')]=_[_0x9dbb('0x33')](db[_0x9dbb('0x2d')][_0x9dbb('0x2e')]);_0x45dfd0[_0x9dbb('0x32')]=_[_0x9dbb('0x33')](_0xd9da26[_0x9dbb('0x32')]);_0x45dfd0[_0x9dbb('0x34')]=_['intersection'](_0x45dfd0['model'],_0x45dfd0[_0x9dbb('0x32')]);_0x1d3347[_0x9dbb('0x36')]=_[_0x9dbb('0x35')](_0x45dfd0[_0x9dbb('0x31')],qs[_0x9dbb('0x37')](_0xd9da26[_0x9dbb('0x32')]['fields']));_0x1d3347[_0x9dbb('0x36')]=_0x1d3347[_0x9dbb('0x36')][_0x9dbb('0x38')]?_0x1d3347['attributes']:_0x45dfd0['model'];if(_0xd9da26[_0x9dbb('0x32')]['includeAll']){_0x1d3347['include']=[{'all':!![]}];}_0x1d3347=_['merge']({},_0x1d3347,_0xd9da26[_0x9dbb('0x41')]);return db['SquareDetailsReport'][_0x9dbb('0x48')](_0x1d3347)[_0x9dbb('0x25')](handleEntityNotFound(_0x504c5c,null))[_0x9dbb('0x25')](respondWithResult(_0x504c5c,null))[_0x9dbb('0x46')](handleError(_0x504c5c,null));};exports[_0x9dbb('0x49')]=function(_0x4d8a71,_0x380ed9){return db[_0x9dbb('0x2d')][_0x9dbb('0x49')](_0x4d8a71[_0x9dbb('0x4a')],{})[_0x9dbb('0x25')](respondWithResult(_0x380ed9,0xc9))[_0x9dbb('0x46')](handleError(_0x380ed9,null));};exports[_0x9dbb('0x24')]=function(_0x5b7530,_0x302e3a){if(_0x5b7530[_0x9dbb('0x4a')]['id']){delete _0x5b7530[_0x9dbb('0x4a')]['id'];}return db[_0x9dbb('0x2d')][_0x9dbb('0x48')]({'where':{'id':_0x5b7530[_0x9dbb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x302e3a,null))[_0x9dbb('0x25')](saveUpdates(_0x5b7530[_0x9dbb('0x4a')],null))[_0x9dbb('0x25')](respondWithResult(_0x302e3a,null))[_0x9dbb('0x46')](handleError(_0x302e3a,null));};exports[_0x9dbb('0x26')]=function(_0x553aa5,_0x2081c8){return db[_0x9dbb('0x2d')][_0x9dbb('0x48')]({'where':{'id':_0x553aa5[_0x9dbb('0x4b')]['id']}})[_0x9dbb('0x25')](handleEntityNotFound(_0x2081c8,null))[_0x9dbb('0x25')](removeEntity(_0x2081c8,null))[_0x9dbb('0x46')](handleError(_0x2081c8,null));};exports[_0x9dbb('0x4c')]=function(_0x3cb39c,_0x4b2fa3){return db[_0x9dbb('0x2d')]['describe']()[_0x9dbb('0x25')](respondWithResult(_0x4b2fa3,null))['catch'](handleError(_0x4b2fa3,null));};
\ No newline at end of file
index a3ab440..f8f536b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93ed=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x93ed,0x144));var _0xd93e=function(_0x19307b,_0x1a9bf4){_0x19307b=_0x19307b-0x0;var _0x524e95=_0x93ed[_0x19307b];return _0x524e95;};'use strict';var _=require(_0xd93e('0x0'));var util=require(_0xd93e('0x1'));var logger=require(_0xd93e('0x2'))(_0xd93e('0x3'));var moment=require(_0xd93e('0x4'));var BPromise=require(_0xd93e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd93e('0x6'));var rimraf=require('rimraf');var config=require(_0xd93e('0x7'));var attributes=require(_0xd93e('0x8'));module[_0xd93e('0x9')]=function(_0x55566f,_0x38fdf4){return _0x55566f['define'](_0xd93e('0xa'),attributes,{'tableName':_0xd93e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf2cd=['SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./squareReportDetail.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2cd,0xce));var _0xdf2c=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0xf2cd[_0x1ee351];return _0x245aaf;};'use strict';var _=require(_0xdf2c('0x0'));var util=require(_0xdf2c('0x1'));var logger=require(_0xdf2c('0x2'))(_0xdf2c('0x3'));var moment=require(_0xdf2c('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf2c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf2c('0x6'));var config=require('../../config/environment');var attributes=require(_0xdf2c('0x7'));module[_0xdf2c('0x8')]=function(_0x2ba8ff,_0x324ab9){return _0x2ba8ff[_0xdf2c('0x9')](_0xdf2c('0xa'),attributes,{'tableName':_0xdf2c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9b75ec7..795ff68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49f8=['SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','then','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','info'];(function(_0x111d8b,_0x3f356f){var _0x56656c=function(_0x193487){while(--_0x193487){_0x111d8b['push'](_0x111d8b['shift']());}};_0x56656c(++_0x3f356f);}(_0x49f8,0xff));var _0x849f=function(_0x3475f4,_0x7b1a5c){_0x3475f4=_0x3475f4-0x0;var _0x5521e0=_0x49f8[_0x3475f4];return _0x5521e0;};'use strict';var _=require(_0x849f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x849f('0x1'));var rs=require(_0x849f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x849f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x849f('0x4'))('rpc');var config=require(_0x849f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x849f('0x6')][_0x849f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21f577,_0xb4c798,_0x33b630){return new BPromise(function(_0xc6443e,_0x565438){return client['request'](_0x21f577,_0x33b630)['then'](function(_0x306c11){logger[_0x849f('0x8')](_0x849f('0x9'),_0xb4c798,_0x849f('0xa'));logger[_0x849f('0xb')](_0x849f('0xc'),_0xb4c798,_0x849f('0xa'),JSON['stringify'](_0x306c11));if(_0x306c11[_0x849f('0xd')]){if(_0x306c11['error'][_0x849f('0xe')]===0x1f4){logger[_0x849f('0xd')](_0x849f('0x9'),_0xb4c798,_0x306c11[_0x849f('0xd')]['message']);return _0x565438(_0x306c11[_0x849f('0xd')][_0x849f('0xf')]);}logger[_0x849f('0xd')](_0x849f('0x9'),_0xb4c798,_0x306c11[_0x849f('0xd')]['message']);return _0xc6443e(_0x306c11['error'][_0x849f('0xf')]);}else{logger['info'](_0x849f('0x9'),_0xb4c798,_0x849f('0xa'));_0xc6443e(_0x306c11[_0x849f('0x10')][_0x849f('0xf')]);}})[_0x849f('0x11')](function(_0x19ba28){logger[_0x849f('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0xb4c798,_0x19ba28);_0x565438(_0x19ba28);});});}exports[_0x849f('0x12')]=function(_0x20bea7){var _0x189529=this;return new Promise(function(_0x541cd6,_0x1e4017){return db[_0x849f('0x13')]['create'](_0x20bea7[_0x849f('0x14')],{'raw':_0x20bea7[_0x849f('0x15')]?_0x20bea7['options']['raw']===undefined?!![]:![]:!![]})[_0x849f('0x16')](function(_0x11d183){logger[_0x849f('0x8')](_0x849f('0x12'),_0x20bea7);logger[_0x849f('0xb')](_0x849f('0x12'),_0x20bea7,JSON[_0x849f('0x17')](_0x11d183));_0x541cd6(_0x11d183);})[_0x849f('0x11')](function(_0x4b29f1){logger[_0x849f('0xd')](_0x849f('0x12'),_0x4b29f1[_0x849f('0xf')],_0x20bea7);_0x1e4017(_0x189529[_0x849f('0xd')](0x1f4,_0x4b29f1[_0x849f('0xf')]));});});};
\ No newline at end of file
+var _0xe9e8=['info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareDetailsReport','create','body','options','then','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x418d91,_0x50e015){_0x418d91=_0x418d91-0x0;var _0x1e540f=_0xe9e8[_0x418d91];return _0x1e540f;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))(_0x8e9e('0x8'));var config=require(_0x8e9e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8e9e('0xa')][_0x8e9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x204f5c,_0x1fb8d3,_0x58f822){return new BPromise(function(_0x3b5d21,_0x2ae896){return client[_0x8e9e('0xc')](_0x204f5c,_0x58f822)['then'](function(_0x39f5e5){logger[_0x8e9e('0xd')](_0x8e9e('0xe'),_0x1fb8d3,'request\x20sent');logger[_0x8e9e('0xf')](_0x8e9e('0x10'),_0x1fb8d3,_0x8e9e('0x11'),JSON[_0x8e9e('0x12')](_0x39f5e5));if(_0x39f5e5[_0x8e9e('0x13')]){if(_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x14')]===0x1f4){logger['error'](_0x8e9e('0xe'),_0x1fb8d3,_0x39f5e5['error'][_0x8e9e('0x15')]);return _0x2ae896(_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x15')]);}logger[_0x8e9e('0x13')](_0x8e9e('0xe'),_0x1fb8d3,_0x39f5e5[_0x8e9e('0x13')][_0x8e9e('0x15')]);return _0x3b5d21(_0x39f5e5['error']['message']);}else{logger[_0x8e9e('0xd')](_0x8e9e('0xe'),_0x1fb8d3,'request\x20sent');_0x3b5d21(_0x39f5e5[_0x8e9e('0x16')][_0x8e9e('0x15')]);}})[_0x8e9e('0x17')](function(_0x22b2c7){logger[_0x8e9e('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x1fb8d3,_0x22b2c7);_0x2ae896(_0x22b2c7);});});}exports['CreateSquareDetailsReport']=function(_0x42f8e8){var _0x40f4fd=this;return new Promise(function(_0x41cdc0,_0x28584b){return db[_0x8e9e('0x18')][_0x8e9e('0x19')](_0x42f8e8[_0x8e9e('0x1a')],{'raw':_0x42f8e8['options']?_0x42f8e8[_0x8e9e('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x8e9e('0x1c')](function(_0x19a890){logger['info'](_0x8e9e('0x1d'),_0x42f8e8);logger[_0x8e9e('0xf')](_0x8e9e('0x1d'),_0x42f8e8,JSON[_0x8e9e('0x12')](_0x19a890));_0x41cdc0(_0x19a890);})[_0x8e9e('0x17')](function(_0x6a311b){logger[_0x8e9e('0x13')](_0x8e9e('0x1d'),_0x6a311b['message'],_0x42f8e8);_0x28584b(_0x40f4fd['error'](0x1f4,_0x6a311b[_0x8e9e('0x15')]));});});};
\ No newline at end of file
index 6aa6dd3..a709674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb603=['killProcess','express','Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x2334fb,_0x11a130){var _0x39f7bf=function(_0x8483af){while(--_0x8483af){_0x2334fb['push'](_0x2334fb['shift']());}};_0x39f7bf(++_0x11a130);}(_0xb603,0x1e9));var _0x3b60=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xb603[_0x8c43de];return _0xa6591b;};'use strict';var express=require(_0x3b60('0x0'));var router=express[_0x3b60('0x1')]();var auth=require(_0x3b60('0x2'));var controller=require('./system.controller');router[_0x3b60('0x3')]('/',auth[_0x3b60('0x4')](),controller[_0x3b60('0x5')]);router['get'](_0x3b60('0x6'),auth['isAuthenticated'](),controller[_0x3b60('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x6a48=['isAuthenticated','index','killProcess','exports','express','../../components/auth/service','./system.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a48,0x94));var _0x86a4=function(_0xda2597,_0x560224){_0xda2597=_0xda2597-0x0;var _0x5327b2=_0x6a48[_0xda2597];return _0x5327b2;};'use strict';var express=require(_0x86a4('0x0'));var router=express['Router']();var auth=require(_0x86a4('0x1'));var controller=require(_0x86a4('0x2'));router[_0x86a4('0x3')]('/',auth[_0x86a4('0x4')](),controller[_0x86a4('0x5')]);router[_0x86a4('0x3')]('/process/:pid/kill',auth[_0x86a4('0x4')](),controller[_0x86a4('0x6')]);module[_0x86a4('0x7')]=router;
\ No newline at end of file
index 35a6062..19bcc89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98f2=['format','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','api','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','json','catch','killProcess','params','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x98f2,0x13a));var _0x298f=function(_0x5026ca,_0x385a19){_0x5026ca=_0x5026ca-0x0;var _0x4770e6=_0x98f2[_0x5026ca];return _0x4770e6;};'use strict';var info=require(_0x298f('0x0'));var exec=require('child_process')[_0x298f('0x1')];var logger=require('../../config/logger')(_0x298f('0x2'));var util=require('util');var BPromise=require(_0x298f('0x3'));var _=require('lodash');function handleError(_0x2d576d,_0x1d3097,_0x309d17){_0x1d3097=_0x1d3097||0x1f4;return function(_0x549663){logger[_0x298f('0x4')](_0x298f('0x5'),_0x309d17,_0x1d3097,util[_0x298f('0x6')](_0x549663,{'showHidden':![],'depth':null}));delete _0x549663['name'];_0x2d576d[_0x298f('0x7')](_0x1d3097)[_0x298f('0x8')](_0x549663);};}exports[_0x298f('0x9')]=function(_0x397393,_0x46a0c9){return info[_0x298f('0xa')]()[_0x298f('0xb')](function(_0x19ffb3){return _0x46a0c9[_0x298f('0x7')](0xc8)[_0x298f('0xc')](_0x19ffb3);})[_0x298f('0xd')](function(_0x12c62c){return _0x46a0c9[_0x298f('0x7')](0x1f4)['json'](_0x12c62c);});};exports[_0x298f('0xe')]=function(_0x1857b6,_0x209ab6){var _0xa1f728=['components/import/cm'];return new BPromise(function(_0x27e946,_0x406d69){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1857b6[_0x298f('0xf')]['pid']),function(_0x273812,_0x183daa,_0x2e45e9){if(_0x273812){return _0x406d69(_0x273812);}return _0x27e946(_0x183daa);});})[_0x298f('0xb')](function(_0x1d8fb3){var _0x3803f9=![];var _0x1d51c9=_0x1d8fb3[_0x298f('0x10')](/\n/);for(var _0x148d0f=0x0,_0x52519b=_0xa1f728[_0x298f('0x11')];_0x148d0f<_0x52519b,_0x3803f9===![];_0x148d0f+=0x1){if(_0x1d8fb3['indexOf'](_0xa1f728[_0x148d0f])>=0x0){_0x3803f9=!![];}}if(!_0x3803f9){throw new Error(util['format'](_0x298f('0x12'),_0x1857b6[_0x298f('0xf')]['pid']));}process[_0x298f('0x13')](_0x1857b6[_0x298f('0xf')][_0x298f('0x14')],_0x298f('0x15'));return _0x209ab6[_0x298f('0x7')](0xc8)[_0x298f('0xc')]({'message':util[_0x298f('0x16')](_0x298f('0x17'),_0x1857b6[_0x298f('0xf')][_0x298f('0x14')])});})['catch'](handleError(_0x209ab6,null,_0x298f('0xe')));};
\ No newline at end of file
+var _0x856b=['params','split','length','indexOf','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x1eb115,_0x37d12b){var _0x54a74f=function(_0x102f5b){while(--_0x102f5b){_0x1eb115['push'](_0x1eb115['shift']());}};_0x54a74f(++_0x37d12b);}(_0x856b,0xc6));var _0xb856=function(_0x2c79cd,_0x68a109){_0x2c79cd=_0x2c79cd-0x0;var _0xf5afa8=_0x856b[_0x2c79cd];return _0xf5afa8;};'use strict';var info=require(_0xb856('0x0'));var exec=require(_0xb856('0x1'))[_0xb856('0x2')];var logger=require(_0xb856('0x3'))(_0xb856('0x4'));var util=require('util');var BPromise=require(_0xb856('0x5'));var _=require('lodash');function handleError(_0x224772,_0x210036,_0x4ed586){_0x210036=_0x210036||0x1f4;return function(_0x4a5a7d){logger[_0xb856('0x6')](_0xb856('0x7'),_0x4ed586,_0x210036,util[_0xb856('0x8')](_0x4a5a7d,{'showHidden':![],'depth':null}));delete _0x4a5a7d['name'];_0x224772[_0xb856('0x9')](_0x210036)[_0xb856('0xa')](_0x4a5a7d);};}exports[_0xb856('0xb')]=function(_0x3bc57f,_0x264491){return info[_0xb856('0xc')]()[_0xb856('0xd')](function(_0x489c57){return _0x264491[_0xb856('0x9')](0xc8)[_0xb856('0xe')](_0x489c57);})['catch'](function(_0x15ac51){return _0x264491['status'](0x1f4)[_0xb856('0xe')](_0x15ac51);});};exports[_0xb856('0xf')]=function(_0x3e3895,_0x1f7fc5){var _0x3528ad=['components/import/cm'];return new BPromise(function(_0x20de6b,_0x59ca7d){return exec(util[_0xb856('0x10')](_0xb856('0x11'),_0x3e3895[_0xb856('0x12')]['pid']),function(_0x13939e,_0x2b0a4b,_0x27eb86){if(_0x13939e){return _0x59ca7d(_0x13939e);}return _0x20de6b(_0x2b0a4b);});})[_0xb856('0xd')](function(_0x4d4b19){var _0x43f3a7=![];var _0x225672=_0x4d4b19[_0xb856('0x13')](/\n/);for(var _0x4bca14=0x0,_0x425d2a=_0x3528ad[_0xb856('0x14')];_0x4bca14<_0x425d2a,_0x43f3a7===![];_0x4bca14+=0x1){if(_0x4d4b19[_0xb856('0x15')](_0x3528ad[_0x4bca14])>=0x0){_0x43f3a7=!![];}}if(!_0x43f3a7){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x3e3895[_0xb856('0x12')][_0xb856('0x16')]));}process[_0xb856('0x17')](_0x3e3895[_0xb856('0x12')]['pid'],_0xb856('0x18'));return _0x1f7fc5['status'](0xc8)[_0xb856('0xe')]({'message':util[_0xb856('0x10')](_0xb856('0x19'),_0x3e3895['params'][_0xb856('0x16')])});})[_0xb856('0x1a')](handleError(_0x1f7fc5,null,_0xb856('0xf')));};
\ No newline at end of file
index a339e7d..bd1e0ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7529=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer','util'];(function(_0xba6cb2,_0x388a81){var _0x1e4584=function(_0x377201){while(--_0x377201){_0xba6cb2['push'](_0xba6cb2['shift']());}};_0x1e4584(++_0x388a81);}(_0x7529,0x1c6));var _0x9752=function(_0x4c3e2e,_0x2038bb){_0x4c3e2e=_0x4c3e2e-0x0;var _0x264cbe=_0x7529[_0x4c3e2e];return _0x264cbe;};'use strict';var multer=require(_0x9752('0x0'));var util=require(_0x9752('0x1'));var path=require(_0x9752('0x2'));var timeout=require(_0x9752('0x3'));var express=require(_0x9752('0x4'));var router=express[_0x9752('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9752('0x6'));var interaction=require(_0x9752('0x7'));var config=require(_0x9752('0x8'));var controller=require('./tag.controller');router['get']('/',auth[_0x9752('0x9')](),controller[_0x9752('0xa')]);router[_0x9752('0xb')](_0x9752('0xc'),auth[_0x9752('0x9')](),controller[_0x9752('0xd')]);router[_0x9752('0xe')]('/',auth[_0x9752('0x9')](),controller[_0x9752('0xf')]);router['put'](_0x9752('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9752('0x10')](_0x9752('0xc'),auth[_0x9752('0x9')](),controller[_0x9752('0x11')]);module[_0x9752('0x12')]=router;
\ No newline at end of file
+var _0x57b0=['exports','multer','util','path','connect-timeout','express','fs-extra','get','isAuthenticated','/:id','show','post','create','put','update','destroy'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0x57b0,0x1c1));var _0x057b=function(_0x5af982,_0x941927){_0x5af982=_0x5af982-0x0;var _0x2738b4=_0x57b0[_0x5af982];return _0x2738b4;};'use strict';var multer=require(_0x057b('0x0'));var util=require(_0x057b('0x1'));var path=require(_0x057b('0x2'));var timeout=require(_0x057b('0x3'));var express=require(_0x057b('0x4'));var router=express['Router']();var fs_extra=require(_0x057b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x057b('0x6')]('/',auth[_0x057b('0x7')](),controller['index']);router['get'](_0x057b('0x8'),auth['isAuthenticated'](),controller[_0x057b('0x9')]);router[_0x057b('0xa')]('/',auth[_0x057b('0x7')](),controller[_0x057b('0xb')]);router[_0x057b('0xc')](_0x057b('0x8'),auth['isAuthenticated'](),controller[_0x057b('0xd')]);router['delete'](_0x057b('0x8'),auth[_0x057b('0x7')](),controller[_0x057b('0xe')]);module[_0x057b('0xf')]=router;
\ No newline at end of file
index e08a46d..1543802 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a1b=['#0091EA','sequelize','STRING'];(function(_0x2c7357,_0x9fd7fd){var _0x49c871=function(_0x3d1add){while(--_0x3d1add){_0x2c7357['push'](_0x2c7357['shift']());}};_0x49c871(++_0x9fd7fd);}(_0x9a1b,0x1ba));var _0xb9a1=function(_0x3add8f,_0xa248a1){_0x3add8f=_0x3add8f-0x0;var _0xfa6eb0=_0x9a1b[_0x3add8f];return _0xfa6eb0;};'use strict';var Sequelize=require(_0xb9a1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb9a1('0x1')],'defaultValue':_0xb9a1('0x2')},'description':{'type':Sequelize[_0xb9a1('0x1')]}};
\ No newline at end of file
+var _0xe61a=['name','#0091EA','STRING','sequelize','exports'];(function(_0x67143c,_0x433024){var _0x1dbbc3=function(_0x35a77f){while(--_0x35a77f){_0x67143c['push'](_0x67143c['shift']());}};_0x1dbbc3(++_0x433024);}(_0xe61a,0x120));var _0xae61=function(_0x4576ec,_0x4779a4){_0x4576ec=_0x4576ec-0x0;var _0x419c00=_0xe61a[_0x4576ec];return _0x419c00;};'use strict';var Sequelize=require(_0xae61('0x0'));module[_0xae61('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xae61('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xae61('0x3')},'description':{'type':Sequelize[_0xae61('0x4')]}};
\ No newline at end of file
index b7b7ab8..4c572bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','keys','include','options','find','catch','create','body','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','sendStatus','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields'];(function(_0x5dfc75,_0x2c73b6){var _0x4360e0=function(_0x3ce8fd){while(--_0x3ce8fd){_0x5dfc75['push'](_0x5dfc75['shift']());}};_0x4360e0(++_0x2c73b6);}(_0xb43b,0xbf));var _0xbb43=function(_0x26f208,_0xde32be){_0x26f208=_0x26f208-0x0;var _0x4d4128=_0xb43b[_0x26f208];return _0x4d4128;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb43('0x1'));var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require(_0xbb43('0x5'));var Mustache=require(_0xbb43('0x6'));var util=require(_0xbb43('0x7'));var path=require(_0xbb43('0x8'));var sox=require(_0xbb43('0x9'));var csv=require(_0xbb43('0xa'));var ejs=require(_0xbb43('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb43('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb43('0xd'));var deskjs=require(_0xbb43('0xe'));var toCsv=require(_0xbb43('0xa'));var querystring=require(_0xbb43('0xf'));var Papa=require(_0xbb43('0x10'));var Redis=require('ioredis');var authService=require(_0xbb43('0x11'));var qs=require(_0xbb43('0x12'));var as=require(_0xbb43('0x13'));var hardwareService=require(_0xbb43('0x14'));var logger=require('../../config/logger')(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2867fb,_0x5d0ccc){_0x5d0ccc=_0x5d0ccc||0xcc;return function(_0x6be368){if(_0x6be368){return _0x2867fb['sendStatus'](_0x5d0ccc);}return _0x2867fb[_0xbb43('0x17')](_0x5d0ccc)[_0xbb43('0x18')]();};}function respondWithResult(_0x3ce968,_0x3327bc){_0x3327bc=_0x3327bc||0xc8;return function(_0x2e2517){if(_0x2e2517){return _0x3ce968['status'](_0x3327bc)[_0xbb43('0x19')](_0x2e2517);}};}function respondWithFilteredResult(_0x4ac25c,_0x199726){return function(_0x32425c){if(_0x32425c){var _0x15182b=typeof _0x199726[_0xbb43('0x1a')]===_0xbb43('0x1b')&&typeof _0x199726[_0xbb43('0x1c')]===_0xbb43('0x1b');var _0x209c9c=_0x32425c[_0xbb43('0x1d')];var _0x4c223b=_0x15182b?0x0:_0x199726[_0xbb43('0x1a')];var _0x4cb0b2=_0x15182b?_0x32425c[_0xbb43('0x1d')]:_0x199726['offset']+_0x199726[_0xbb43('0x1c')];var _0x5f4b4f;if(_0x4cb0b2>=_0x209c9c){_0x4cb0b2=_0x209c9c;_0x5f4b4f=0xc8;}else{_0x5f4b4f=0xce;}_0x4ac25c[_0xbb43('0x17')](_0x5f4b4f);return _0x4ac25c[_0xbb43('0x1e')]('Content-Range',_0x4c223b+'-'+_0x4cb0b2+'/'+_0x209c9c)[_0xbb43('0x19')](_0x32425c);}return null;};}function patchUpdates(_0x6cdc26){return function(_0x398ce5){try{jsonpatch[_0xbb43('0x1f')](_0x398ce5,_0x6cdc26,!![]);}catch(_0x22c5d1){return BPromise[_0xbb43('0x20')](_0x22c5d1);}return _0x398ce5[_0xbb43('0x21')]();};}function saveUpdates(_0x1e83cd,_0x3409d0){return function(_0x3cb6d1){if(_0x3cb6d1){return _0x3cb6d1[_0xbb43('0x22')](_0x1e83cd)[_0xbb43('0x23')](function(_0x36992f){return _0x36992f;});}return null;};}function removeEntity(_0x37beb0,_0x500af4){return function(_0x28b3e4){if(_0x28b3e4){return _0x28b3e4[_0xbb43('0x24')]()['then'](function(){var _0x464b4a=_0x28b3e4[_0xbb43('0x25')]({'plain':!![]});var _0x25279b='Tags';return db['UserProfileResource'][_0xbb43('0x24')]({'where':{'type':_0x25279b,'resourceId':_0x464b4a['id']}})[_0xbb43('0x23')](function(){return _0x28b3e4;});})['then'](function(){_0x37beb0['status'](0xcc)[_0xbb43('0x18')]();});}};}function handleEntityNotFound(_0xb9fe3b,_0x268fb5){return function(_0x4bb859){if(!_0x4bb859){_0xb9fe3b[_0xbb43('0x26')](0x194);}return _0x4bb859;};}function handleError(_0x426cec,_0x2dcc60){_0x2dcc60=_0x2dcc60||0x1f4;return function(_0x1a6e2b){logger['error'](_0x1a6e2b[_0xbb43('0x27')]);if(_0x1a6e2b[_0xbb43('0x28')]){delete _0x1a6e2b[_0xbb43('0x28')];}_0x426cec[_0xbb43('0x17')](_0x2dcc60)[_0xbb43('0x29')](_0x1a6e2b);};}exports[_0xbb43('0x2a')]=function(_0x2860d8,_0x48986d){var _0x3b2290={},_0x209244={},_0x3c46c6={'count':0x0,'rows':[]};var _0x5b8a7d=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')],function(_0x168374){return{'name':_0x168374[_0xbb43('0x2e')],'type':_0x168374[_0xbb43('0x2f')][_0xbb43('0x30')]};});_0x209244[_0xbb43('0x31')]=_[_0xbb43('0x2b')](_0x5b8a7d,'name');_0x209244['query']=_['keys'](_0x2860d8['query']);_0x209244[_0xbb43('0x32')]=_[_0xbb43('0x33')](_0x209244[_0xbb43('0x31')],_0x209244[_0xbb43('0x34')]);_0x3b2290[_0xbb43('0x35')]=_[_0xbb43('0x33')](_0x209244[_0xbb43('0x31')],qs[_0xbb43('0x36')](_0x2860d8['query'][_0xbb43('0x36')]));_0x3b2290[_0xbb43('0x35')]=_0x3b2290[_0xbb43('0x35')][_0xbb43('0x37')]?_0x3b2290['attributes']:_0x209244[_0xbb43('0x31')];if(!_0x2860d8[_0xbb43('0x34')][_0xbb43('0x38')](_0xbb43('0x39'))){_0x3b2290['limit']=qs[_0xbb43('0x1c')](_0x2860d8['query'][_0xbb43('0x1c')]);_0x3b2290[_0xbb43('0x1a')]=qs[_0xbb43('0x1a')](_0x2860d8[_0xbb43('0x34')][_0xbb43('0x1a')]);}_0x3b2290[_0xbb43('0x3a')]=qs[_0xbb43('0x3b')](_0x2860d8[_0xbb43('0x34')][_0xbb43('0x3b')]);_0x3b2290[_0xbb43('0x3c')]=qs[_0xbb43('0x32')](_[_0xbb43('0x3d')](_0x2860d8['query'],_0x209244[_0xbb43('0x32')]),_0x5b8a7d);if(_0x2860d8[_0xbb43('0x34')][_0xbb43('0x3e')]){_0x3b2290[_0xbb43('0x3c')]=_[_0xbb43('0x3f')](_0x3b2290[_0xbb43('0x3c')],{'$or':_[_0xbb43('0x2b')](_0x5b8a7d,function(_0x3d7d56){if(_0x3d7d56[_0xbb43('0x2f')]!==_0xbb43('0x40')){var _0x1fe204={};_0x1fe204[_0x3d7d56[_0xbb43('0x28')]]={'$like':'%'+_0x2860d8[_0xbb43('0x34')][_0xbb43('0x3e')]+'%'};return _0x1fe204;}})});}_0x3b2290=_[_0xbb43('0x3f')]({},_0x3b2290,_0x2860d8['options']);var _0x4807a3={'where':_0x3b2290[_0xbb43('0x3c')]};return db[_0xbb43('0x2c')][_0xbb43('0x1d')](_0x4807a3)[_0xbb43('0x23')](function(_0x4b32c9){_0x3c46c6['count']=_0x4b32c9;if(_0x2860d8[_0xbb43('0x34')][_0xbb43('0x41')]){_0x3b2290['include']=[{'all':!![]}];}return db['Tag'][_0xbb43('0x42')](_0x3b2290);})[_0xbb43('0x23')](function(_0x26aa10){_0x3c46c6[_0xbb43('0x43')]=_0x26aa10;return _0x3c46c6;})[_0xbb43('0x23')](respondWithFilteredResult(_0x48986d,_0x3b2290))['catch'](handleError(_0x48986d,null));};exports['show']=function(_0x2ea37b,_0x41fed6){var _0x3f48a1={'raw':!![],'where':{'id':_0x2ea37b[_0xbb43('0x44')]['id']}},_0x2d1256={};_0x2d1256[_0xbb43('0x31')]=_[_0xbb43('0x45')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x2d1256[_0xbb43('0x34')]=_['keys'](_0x2ea37b['query']);_0x2d1256[_0xbb43('0x32')]=_[_0xbb43('0x33')](_0x2d1256['model'],_0x2d1256[_0xbb43('0x34')]);_0x3f48a1[_0xbb43('0x35')]=_[_0xbb43('0x33')](_0x2d1256[_0xbb43('0x31')],qs[_0xbb43('0x36')](_0x2ea37b[_0xbb43('0x34')][_0xbb43('0x36')]));_0x3f48a1['attributes']=_0x3f48a1[_0xbb43('0x35')][_0xbb43('0x37')]?_0x3f48a1['attributes']:_0x2d1256[_0xbb43('0x31')];if(_0x2ea37b[_0xbb43('0x34')]['includeAll']){_0x3f48a1[_0xbb43('0x46')]=[{'all':!![]}];}_0x3f48a1=_[_0xbb43('0x3f')]({},_0x3f48a1,_0x2ea37b[_0xbb43('0x47')]);return db[_0xbb43('0x2c')][_0xbb43('0x48')](_0x3f48a1)[_0xbb43('0x23')](handleEntityNotFound(_0x41fed6,null))[_0xbb43('0x23')](respondWithResult(_0x41fed6,null))[_0xbb43('0x49')](handleError(_0x41fed6,null));};exports[_0xbb43('0x4a')]=function(_0x2f044f,_0x38cc4d){return db[_0xbb43('0x2c')]['create'](_0x2f044f[_0xbb43('0x4b')],{})[_0xbb43('0x23')](function(_0x50096a){var _0x7089bb=_0x2f044f['user'][_0xbb43('0x25')]({'plain':!![]});if(!_0x7089bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7089bb[_0xbb43('0x4c')]==='user'){var _0x21f78b=_0x50096a[_0xbb43('0x25')]({'plain':!![]});var _0x26586c='Tags';return db[_0xbb43('0x4d')][_0xbb43('0x48')]({'where':{'name':_0x26586c,'userProfileId':_0x7089bb[_0xbb43('0x4e')]},'raw':!![]})['then'](function(_0xd485c7){if(_0xd485c7&&_0xd485c7[_0xbb43('0x4f')]===0x0){return db['UserProfileResource'][_0xbb43('0x4a')]({'name':_0x21f78b['name'],'resourceId':_0x21f78b['id'],'type':_0xd485c7[_0xbb43('0x28')],'sectionId':_0xd485c7['id']},{})[_0xbb43('0x23')](function(){return _0x50096a;});}else{return _0x50096a;}})['catch'](function(_0x13731d){logger[_0xbb43('0x50')](_0xbb43('0x51'),_0x13731d);throw _0x13731d;});}return _0x50096a;})['then'](respondWithResult(_0x38cc4d,0xc9))[_0xbb43('0x49')](handleError(_0x38cc4d,null));};exports['update']=function(_0x3433ff,_0x451007){if(_0x3433ff[_0xbb43('0x4b')]['id']){delete _0x3433ff['body']['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x48')]({'where':{'id':_0x3433ff['params']['id']}})['then'](handleEntityNotFound(_0x451007,null))[_0xbb43('0x23')](saveUpdates(_0x3433ff[_0xbb43('0x4b')],null))['then'](respondWithResult(_0x451007,null))['catch'](handleError(_0x451007,null));};exports[_0xbb43('0x24')]=function(_0x51ca4f,_0x30908e){return db[_0xbb43('0x2c')][_0xbb43('0x48')]({'where':{'id':_0x51ca4f['params']['id']}})['then'](handleEntityNotFound(_0x30908e,null))['then'](removeEntity(_0x30908e,null))['catch'](handleError(_0x30908e,null));};
\ No newline at end of file
+var _0xf9f7=['fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','update','then','destroy','get','Tags','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','Tag','includeAll','include','rows','catch','show','find','create','role','user','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs'];(function(_0x4a914f,_0x247258){var _0x4a88fc=function(_0x3fa243){while(--_0x3fa243){_0x4a914f['push'](_0x4a914f['shift']());}};_0x4a88fc(++_0x247258);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0xf9f7[_0x4aba15];return _0x1c8122;};'use strict';var emlformat=require(_0x7f9f('0x0'));var rimraf=require(_0x7f9f('0x1'));var zipdir=require(_0x7f9f('0x2'));var jsonpatch=require(_0x7f9f('0x3'));var rp=require(_0x7f9f('0x4'));var moment=require(_0x7f9f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7f9f('0x6'));var path=require(_0x7f9f('0x7'));var sox=require(_0x7f9f('0x8'));var csv=require(_0x7f9f('0x9'));var ejs=require(_0x7f9f('0xa'));var fs=require('fs');var fs_extra=require(_0x7f9f('0xb'));var _=require('lodash');var squel=require(_0x7f9f('0xc'));var crypto=require(_0x7f9f('0xd'));var jsforce=require(_0x7f9f('0xe'));var deskjs=require(_0x7f9f('0xf'));var toCsv=require(_0x7f9f('0x9'));var querystring=require('querystring');var Papa=require(_0x7f9f('0x10'));var Redis=require(_0x7f9f('0x11'));var authService=require(_0x7f9f('0x12'));var qs=require(_0x7f9f('0x13'));var as=require(_0x7f9f('0x14'));var hardwareService=require(_0x7f9f('0x15'));var logger=require(_0x7f9f('0x16'))('api');var utils=require(_0x7f9f('0x17'));var config=require(_0x7f9f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39291c,_0x52cb68){_0x52cb68=_0x52cb68||0xcc;return function(_0x1800a0){if(_0x1800a0){return _0x39291c[_0x7f9f('0x19')](_0x52cb68);}return _0x39291c['status'](_0x52cb68)[_0x7f9f('0x1a')]();};}function respondWithResult(_0x5f1035,_0x292470){_0x292470=_0x292470||0xc8;return function(_0x39adff){if(_0x39adff){return _0x5f1035[_0x7f9f('0x1b')](_0x292470)[_0x7f9f('0x1c')](_0x39adff);}};}function respondWithFilteredResult(_0x12b182,_0x5cbd29){return function(_0x331a98){if(_0x331a98){var _0x3768ee=typeof _0x5cbd29['offset']===_0x7f9f('0x1d')&&typeof _0x5cbd29['limit']===_0x7f9f('0x1d');var _0x15c864=_0x331a98[_0x7f9f('0x1e')];var _0x35f6b1=_0x3768ee?0x0:_0x5cbd29[_0x7f9f('0x1f')];var _0x11e263=_0x3768ee?_0x331a98['count']:_0x5cbd29[_0x7f9f('0x1f')]+_0x5cbd29[_0x7f9f('0x20')];var _0x5c6345;if(_0x11e263>=_0x15c864){_0x11e263=_0x15c864;_0x5c6345=0xc8;}else{_0x5c6345=0xce;}_0x12b182[_0x7f9f('0x1b')](_0x5c6345);return _0x12b182['set'](_0x7f9f('0x21'),_0x35f6b1+'-'+_0x11e263+'/'+_0x15c864)[_0x7f9f('0x1c')](_0x331a98);}return null;};}function patchUpdates(_0x8ad1b2){return function(_0x188c51){try{jsonpatch['apply'](_0x188c51,_0x8ad1b2,!![]);}catch(_0x3aba8c){return BPromise['reject'](_0x3aba8c);}return _0x188c51['save']();};}function saveUpdates(_0x324531,_0x730665){return function(_0x1f3f66){if(_0x1f3f66){return _0x1f3f66[_0x7f9f('0x22')](_0x324531)[_0x7f9f('0x23')](function(_0x5df2b2){return _0x5df2b2;});}return null;};}function removeEntity(_0x4c7a08,_0x3ec242){return function(_0x4acc4f){if(_0x4acc4f){return _0x4acc4f[_0x7f9f('0x24')]()[_0x7f9f('0x23')](function(){var _0x392574=_0x4acc4f[_0x7f9f('0x25')]({'plain':!![]});var _0x1a49a9=_0x7f9f('0x26');return db['UserProfileResource'][_0x7f9f('0x24')]({'where':{'type':_0x1a49a9,'resourceId':_0x392574['id']}})['then'](function(){return _0x4acc4f;});})[_0x7f9f('0x23')](function(){_0x4c7a08[_0x7f9f('0x1b')](0xcc)[_0x7f9f('0x1a')]();});}};}function handleEntityNotFound(_0x59eba2,_0x120bfd){return function(_0x3380d7){if(!_0x3380d7){_0x59eba2[_0x7f9f('0x19')](0x194);}return _0x3380d7;};}function handleError(_0x531f5f,_0x43912a){_0x43912a=_0x43912a||0x1f4;return function(_0x3b6e4c){logger['error'](_0x3b6e4c['stack']);if(_0x3b6e4c['name']){delete _0x3b6e4c[_0x7f9f('0x27')];}_0x531f5f['status'](_0x43912a)[_0x7f9f('0x28')](_0x3b6e4c);};}exports[_0x7f9f('0x29')]=function(_0x5d25bf,_0x54f103){var _0x95e3f2={},_0x4d7945={},_0x13f950={'count':0x0,'rows':[]};var _0x5cfc33=_['map'](db['Tag'][_0x7f9f('0x2a')],function(_0x506d43){return{'name':_0x506d43[_0x7f9f('0x2b')],'type':_0x506d43[_0x7f9f('0x2c')][_0x7f9f('0x2d')]};});_0x4d7945[_0x7f9f('0x2e')]=_[_0x7f9f('0x2f')](_0x5cfc33,'name');_0x4d7945['query']=_[_0x7f9f('0x30')](_0x5d25bf['query']);_0x4d7945['filters']=_[_0x7f9f('0x31')](_0x4d7945[_0x7f9f('0x2e')],_0x4d7945[_0x7f9f('0x32')]);_0x95e3f2[_0x7f9f('0x33')]=_[_0x7f9f('0x31')](_0x4d7945[_0x7f9f('0x2e')],qs[_0x7f9f('0x34')](_0x5d25bf[_0x7f9f('0x32')][_0x7f9f('0x34')]));_0x95e3f2[_0x7f9f('0x33')]=_0x95e3f2[_0x7f9f('0x33')][_0x7f9f('0x35')]?_0x95e3f2[_0x7f9f('0x33')]:_0x4d7945[_0x7f9f('0x2e')];if(!_0x5d25bf['query'][_0x7f9f('0x36')]('nolimit')){_0x95e3f2[_0x7f9f('0x20')]=qs[_0x7f9f('0x20')](_0x5d25bf[_0x7f9f('0x32')][_0x7f9f('0x20')]);_0x95e3f2[_0x7f9f('0x1f')]=qs['offset'](_0x5d25bf[_0x7f9f('0x32')][_0x7f9f('0x1f')]);}_0x95e3f2['order']=qs[_0x7f9f('0x37')](_0x5d25bf[_0x7f9f('0x32')][_0x7f9f('0x37')]);_0x95e3f2[_0x7f9f('0x38')]=qs[_0x7f9f('0x39')](_[_0x7f9f('0x3a')](_0x5d25bf[_0x7f9f('0x32')],_0x4d7945[_0x7f9f('0x39')]),_0x5cfc33);if(_0x5d25bf[_0x7f9f('0x32')][_0x7f9f('0x3b')]){_0x95e3f2[_0x7f9f('0x38')]=_['merge'](_0x95e3f2[_0x7f9f('0x38')],{'$or':_[_0x7f9f('0x2f')](_0x5cfc33,function(_0x5c7f95){if(_0x5c7f95[_0x7f9f('0x2c')]!==_0x7f9f('0x3c')){var _0x57ea46={};_0x57ea46[_0x5c7f95[_0x7f9f('0x27')]]={'$like':'%'+_0x5d25bf[_0x7f9f('0x32')][_0x7f9f('0x3b')]+'%'};return _0x57ea46;}})});}_0x95e3f2=_[_0x7f9f('0x3d')]({},_0x95e3f2,_0x5d25bf[_0x7f9f('0x3e')]);var _0x321f90={'where':_0x95e3f2['where']};return db[_0x7f9f('0x3f')][_0x7f9f('0x1e')](_0x321f90)['then'](function(_0x52382e){_0x13f950[_0x7f9f('0x1e')]=_0x52382e;if(_0x5d25bf[_0x7f9f('0x32')][_0x7f9f('0x40')]){_0x95e3f2[_0x7f9f('0x41')]=[{'all':!![]}];}return db[_0x7f9f('0x3f')]['findAll'](_0x95e3f2);})['then'](function(_0x3aeb1a){_0x13f950[_0x7f9f('0x42')]=_0x3aeb1a;return _0x13f950;})[_0x7f9f('0x23')](respondWithFilteredResult(_0x54f103,_0x95e3f2))[_0x7f9f('0x43')](handleError(_0x54f103,null));};exports[_0x7f9f('0x44')]=function(_0x3c2460,_0x7f6787){var _0x372d7a={'raw':!![],'where':{'id':_0x3c2460['params']['id']}},_0x7abe6f={};_0x7abe6f['model']=_[_0x7f9f('0x30')](db[_0x7f9f('0x3f')][_0x7f9f('0x2a')]);_0x7abe6f['query']=_['keys'](_0x3c2460['query']);_0x7abe6f[_0x7f9f('0x39')]=_['intersection'](_0x7abe6f[_0x7f9f('0x2e')],_0x7abe6f[_0x7f9f('0x32')]);_0x372d7a[_0x7f9f('0x33')]=_[_0x7f9f('0x31')](_0x7abe6f['model'],qs['fields'](_0x3c2460[_0x7f9f('0x32')][_0x7f9f('0x34')]));_0x372d7a['attributes']=_0x372d7a[_0x7f9f('0x33')]['length']?_0x372d7a[_0x7f9f('0x33')]:_0x7abe6f['model'];if(_0x3c2460[_0x7f9f('0x32')][_0x7f9f('0x40')]){_0x372d7a[_0x7f9f('0x41')]=[{'all':!![]}];}_0x372d7a=_[_0x7f9f('0x3d')]({},_0x372d7a,_0x3c2460['options']);return db[_0x7f9f('0x3f')][_0x7f9f('0x45')](_0x372d7a)[_0x7f9f('0x23')](handleEntityNotFound(_0x7f6787,null))['then'](respondWithResult(_0x7f6787,null))[_0x7f9f('0x43')](handleError(_0x7f6787,null));};exports[_0x7f9f('0x46')]=function(_0x575680,_0x485113){return db['Tag'][_0x7f9f('0x46')](_0x575680['body'],{})[_0x7f9f('0x23')](function(_0xcfa8a6){var _0x18bd9b=_0x575680['user'][_0x7f9f('0x25')]({'plain':!![]});if(!_0x18bd9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18bd9b[_0x7f9f('0x47')]===_0x7f9f('0x48')){var _0x266fea=_0xcfa8a6[_0x7f9f('0x25')]({'plain':!![]});var _0xd93926=_0x7f9f('0x26');return db['UserProfileSection'][_0x7f9f('0x45')]({'where':{'name':_0xd93926,'userProfileId':_0x18bd9b[_0x7f9f('0x49')]},'raw':!![]})[_0x7f9f('0x23')](function(_0x5bf288){if(_0x5bf288&&_0x5bf288['autoAssociation']===0x0){return db[_0x7f9f('0x4a')]['create']({'name':_0x266fea[_0x7f9f('0x27')],'resourceId':_0x266fea['id'],'type':_0x5bf288[_0x7f9f('0x27')],'sectionId':_0x5bf288['id']},{})['then'](function(){return _0xcfa8a6;});}else{return _0xcfa8a6;}})[_0x7f9f('0x43')](function(_0x16537f){logger[_0x7f9f('0x4b')](_0x7f9f('0x4c'),_0x16537f);throw _0x16537f;});}return _0xcfa8a6;})[_0x7f9f('0x23')](respondWithResult(_0x485113,0xc9))['catch'](handleError(_0x485113,null));};exports[_0x7f9f('0x22')]=function(_0x3a60bd,_0x116475){if(_0x3a60bd[_0x7f9f('0x4d')]['id']){delete _0x3a60bd[_0x7f9f('0x4d')]['id'];}return db['Tag']['find']({'where':{'id':_0x3a60bd['params']['id']}})['then'](handleEntityNotFound(_0x116475,null))['then'](saveUpdates(_0x3a60bd[_0x7f9f('0x4d')],null))[_0x7f9f('0x23')](respondWithResult(_0x116475,null))[_0x7f9f('0x43')](handleError(_0x116475,null));};exports['destroy']=function(_0x127507,_0x17a6a0){return db[_0x7f9f('0x3f')][_0x7f9f('0x45')]({'where':{'id':_0x127507['params']['id']}})['then'](handleEntityNotFound(_0x17a6a0,null))[_0x7f9f('0x23')](removeEntity(_0x17a6a0,null))['catch'](handleError(_0x17a6a0,null));};
\ No newline at end of file
index e1b84cf..596da31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd272=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','define','Tag','util'];(function(_0x5c5337,_0x137b6e){var _0x3dc14a=function(_0x27b4aa){while(--_0x27b4aa){_0x5c5337['push'](_0x5c5337['shift']());}};_0x3dc14a(++_0x137b6e);}(_0xd272,0x1bb));var _0x2d27=function(_0x2881a0,_0x423bf5){_0x2881a0=_0x2881a0-0x0;var _0xcd551c=_0xd272[_0x2881a0];return _0xcd551c;};'use strict';var _=require('lodash');var util=require(_0x2d27('0x0'));var logger=require(_0x2d27('0x1'))(_0x2d27('0x2'));var moment=require(_0x2d27('0x3'));var BPromise=require(_0x2d27('0x4'));var rp=require(_0x2d27('0x5'));var fs=require('fs');var path=require(_0x2d27('0x6'));var rimraf=require(_0x2d27('0x7'));var config=require(_0x2d27('0x8'));var attributes=require(_0x2d27('0x9'));module['exports']=function(_0x5ab92c,_0x1f0d9f){return _0x5ab92c[_0x2d27('0xa')](_0x2d27('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xacff=['./tag.attributes','exports','define','Tag','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1dcd38,_0x4199d0){var _0x5743c2=function(_0x26190c){while(--_0x26190c){_0x1dcd38['push'](_0x1dcd38['shift']());}};_0x5743c2(++_0x4199d0);}(_0xacff,0x115));var _0xfacf=function(_0x26c589,_0xafd850){_0x26c589=_0x26c589-0x0;var _0x2b04c1=_0xacff[_0x26c589];return _0x2b04c1;};'use strict';var _=require(_0xfacf('0x0'));var util=require(_0xfacf('0x1'));var logger=require(_0xfacf('0x2'))(_0xfacf('0x3'));var moment=require(_0xfacf('0x4'));var BPromise=require(_0xfacf('0x5'));var rp=require(_0xfacf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfacf('0x7'));var config=require(_0xfacf('0x8'));var attributes=require(_0xfacf('0x9'));module[_0xfacf('0xa')]=function(_0x5a9130,_0x5c2e12){return _0x5a9130[_0xfacf('0xb')](_0xfacf('0xc'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 61cbdf3..0fb963f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5712=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x5a19fc,_0x58f9f4){var _0x34b413=function(_0x344feb){while(--_0x344feb){_0x5a19fc['push'](_0x5a19fc['shift']());}};_0x34b413(++_0x58f9f4);}(_0x5712,0x140));var _0x2571=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5712[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x2571('0x0'));var util=require(_0x2571('0x1'));var moment=require(_0x2571('0x2'));var BPromise=require(_0x2571('0x3'));var rs=require(_0x2571('0x4'));var fs=require('fs');var Redis=require(_0x2571('0x5'));var db=require(_0x2571('0x6'))['db'];var utils=require(_0x2571('0x7'));var logger=require(_0x2571('0x8'))(_0x2571('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2571('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e19b2,_0x251ee6,_0x3ca885){return new BPromise(function(_0x204ecc,_0xda659a){return client[_0x2571('0xb')](_0x3e19b2,_0x3ca885)['then'](function(_0x1f0c98){logger['info'](_0x2571('0xc'),_0x251ee6,_0x2571('0xd'));logger[_0x2571('0xe')](_0x2571('0xf'),_0x251ee6,_0x2571('0xd'),JSON[_0x2571('0x10')](_0x1f0c98));if(_0x1f0c98[_0x2571('0x11')]){if(_0x1f0c98[_0x2571('0x11')]['code']===0x1f4){logger['error'](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0xda659a(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0x204ecc(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}else{logger[_0x2571('0x13')]('Tag,\x20%s,\x20%s',_0x251ee6,_0x2571('0xd'));_0x204ecc(_0x1f0c98['result']['message']);}})['catch'](function(_0x4c3e11){logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x4c3e11);_0xda659a(_0x4c3e11);});});}
\ No newline at end of file
+var _0xf3cc=['rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dd76b,_0x46ef11){var _0x4f868f=function(_0x4c6e90){while(--_0x4c6e90){_0x2dd76b['push'](_0x2dd76b['shift']());}};_0x4f868f(++_0x46ef11);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x3a14ac,_0x55403f){_0x3a14ac=_0x3a14ac-0x0;var _0x5e3bc3=_0xf3cc[_0x3a14ac];return _0x5e3bc3;};'use strict';var _=require(_0xcf3c('0x0'));var util=require(_0xcf3c('0x1'));var moment=require(_0xcf3c('0x2'));var BPromise=require(_0xcf3c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf3c('0x4'));var db=require(_0xcf3c('0x5'))['db'];var utils=require(_0xcf3c('0x6'));var logger=require('../../config/logger')(_0xcf3c('0x7'));var config=require(_0xcf3c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcf3c('0x9')][_0xcf3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35cb18,_0xba8a24,_0x11deda){return new BPromise(function(_0x147e12,_0x1a593f){return client[_0xcf3c('0xb')](_0x35cb18,_0x11deda)[_0xcf3c('0xc')](function(_0x367027){logger['info']('Tag,\x20%s,\x20%s',_0xba8a24,_0xcf3c('0xd'));logger[_0xcf3c('0xe')](_0xcf3c('0xf'),_0xba8a24,_0xcf3c('0xd'),JSON[_0xcf3c('0x10')](_0x367027));if(_0x367027[_0xcf3c('0x11')]){if(_0x367027[_0xcf3c('0x11')][_0xcf3c('0x12')]===0x1f4){logger['error'](_0xcf3c('0x13'),_0xba8a24,_0x367027[_0xcf3c('0x11')]['message']);return _0x1a593f(_0x367027[_0xcf3c('0x11')]['message']);}logger['error']('Tag,\x20%s,\x20%s',_0xba8a24,_0x367027[_0xcf3c('0x11')]['message']);return _0x147e12(_0x367027[_0xcf3c('0x11')][_0xcf3c('0x14')]);}else{logger['info'](_0xcf3c('0x13'),_0xba8a24,'request\x20sent');_0x147e12(_0x367027[_0xcf3c('0x15')][_0xcf3c('0x14')]);}})[_0xcf3c('0x16')](function(_0x5157d8){logger[_0xcf3c('0x11')](_0xcf3c('0x13'),_0xba8a24,_0x5157d8);_0x1a593f(_0x5157d8);});});}
\ No newline at end of file
index 61b1862..4a2b9c9 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_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
index 40452c1..cd2b16c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['STRING','sequelize'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xb7e7[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}};
\ No newline at end of file
+var _0xbaf0=['name','exports','STRING'];(function(_0x4de9e8,_0x565ffa){var _0x4db0de=function(_0x12279d){while(--_0x12279d){_0x4de9e8['push'](_0x4de9e8['shift']());}};_0x4db0de(++_0x565ffa);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}};
\ No newline at end of file
index 40ad3a7..f9f3b7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdad1=['transaction','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','getQueues','findOne','channel','ValidationError','capitalize','toLowerCase','Queue','Queues','isValidChannel','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Sms','Fax','Whatsapp','through','TeamVoiceQueue','penalty','User','findOrCreate','Queue:save','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','all','TeamVoicePrefix','VoicePrefixId','spread','removeAgents','Mail','Openchannel','emit','Queue:remove','QueueId','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','./team.socket','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','save','update','error','stack','name','send','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Team','count','then','includeAll','findAll','catch','show','params','fields','length','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','destroy','sequelize'];(function(_0x2ec2bf,_0x64e983){var _0x2c279c=function(_0x41fe42){while(--_0x41fe42){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x2c279c(++_0x64e983);}(_0xdad1,0x174));var _0x1dad=function(_0x2e2015,_0x11fcaa){_0x2e2015=_0x2e2015-0x0;var _0x42c39e=_0xdad1[_0x2e2015];return _0x42c39e;};'use strict';var emlformat=require(_0x1dad('0x0'));var rimraf=require(_0x1dad('0x1'));var zipdir=require(_0x1dad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1dad('0x3'));var moment=require(_0x1dad('0x4'));var BPromise=require(_0x1dad('0x5'));var Mustache=require(_0x1dad('0x6'));var util=require(_0x1dad('0x7'));var path=require(_0x1dad('0x8'));var sox=require('sox');var csv=require(_0x1dad('0x9'));var ejs=require(_0x1dad('0xa'));var fs=require('fs');var fs_extra=require(_0x1dad('0xb'));var _=require(_0x1dad('0xc'));var squel=require('squel');var crypto=require(_0x1dad('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1dad('0xe'));var toCsv=require(_0x1dad('0x9'));var querystring=require(_0x1dad('0xf'));var Papa=require(_0x1dad('0x10'));var Redis=require(_0x1dad('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1dad('0x12'));var hardwareService=require(_0x1dad('0x13'));var logger=require(_0x1dad('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1dad('0x15'));var licenseUtil=require(_0x1dad('0x16'));var db=require('../../mysqldb')['db'];config[_0x1dad('0x17')]=_[_0x1dad('0x18')](config[_0x1dad('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1dad('0x17')]));require(_0x1dad('0x19'))['register'](socket);function respondWithStatusCode(_0xf734f9,_0x3c6924){_0x3c6924=_0x3c6924||0xcc;return function(_0x461f7f){if(_0x461f7f){return _0xf734f9[_0x1dad('0x1a')](_0x3c6924);}return _0xf734f9['status'](_0x3c6924)[_0x1dad('0x1b')]();};}function respondWithResult(_0x23f2df,_0x2226d4){_0x2226d4=_0x2226d4||0xc8;return function(_0x4a4cfc){if(_0x4a4cfc){return _0x23f2df[_0x1dad('0x1c')](_0x2226d4)[_0x1dad('0x1d')](_0x4a4cfc);}};}function respondWithFilteredResult(_0x3fc417,_0x4ce2a8){return function(_0x3caf77){if(_0x3caf77){var _0x5f3980=typeof _0x4ce2a8[_0x1dad('0x1e')]==='undefined'&&typeof _0x4ce2a8[_0x1dad('0x1f')]==='undefined';var _0x1d0fc4=_0x3caf77['count'];var _0x409319=_0x5f3980?0x0:_0x4ce2a8[_0x1dad('0x1e')];var _0x394d3f=_0x5f3980?_0x3caf77['count']:_0x4ce2a8[_0x1dad('0x1e')]+_0x4ce2a8['limit'];var _0x17934d;if(_0x394d3f>=_0x1d0fc4){_0x394d3f=_0x1d0fc4;_0x17934d=0xc8;}else{_0x17934d=0xce;}_0x3fc417[_0x1dad('0x1c')](_0x17934d);return _0x3fc417[_0x1dad('0x20')](_0x1dad('0x21'),_0x409319+'-'+_0x394d3f+'/'+_0x1d0fc4)[_0x1dad('0x1d')](_0x3caf77);}return null;};}function patchUpdates(_0x2673c2){return function(_0x1d5f31){try{jsonpatch[_0x1dad('0x22')](_0x1d5f31,_0x2673c2,!![]);}catch(_0x62b1b0){return BPromise['reject'](_0x62b1b0);}return _0x1d5f31[_0x1dad('0x23')]();};}function saveUpdates(_0x7518e5,_0x33ae91){return function(_0x56b010){if(_0x56b010){return _0x56b010[_0x1dad('0x24')](_0x7518e5)['then'](function(_0x220005){return _0x220005;});}return null;};}function handleEntityNotFound(_0x4aced7,_0x15898c){return function(_0x2d7538){if(!_0x2d7538){_0x4aced7[_0x1dad('0x1a')](0x194);}return _0x2d7538;};}function handleError(_0x475184,_0x4b59b0){_0x4b59b0=_0x4b59b0||0x1f4;return function(_0x3ecacc){logger[_0x1dad('0x25')](_0x3ecacc[_0x1dad('0x26')]);if(_0x3ecacc[_0x1dad('0x27')]){delete _0x3ecacc[_0x1dad('0x27')];}_0x475184[_0x1dad('0x1c')](_0x4b59b0)[_0x1dad('0x28')](_0x3ecacc);};}exports['index']=function(_0x1e7003,_0x42c6ea){var _0x121062={},_0x107e11={},_0x51a62b={'count':0x0,'rows':[]};var _0x166d0b=_['map'](db['Team'][_0x1dad('0x29')],function(_0x1d90c3){return{'name':_0x1d90c3['fieldName'],'type':_0x1d90c3[_0x1dad('0x2a')][_0x1dad('0x2b')]};});_0x107e11[_0x1dad('0x2c')]=_[_0x1dad('0x2d')](_0x166d0b,_0x1dad('0x27'));_0x107e11['query']=_[_0x1dad('0x2e')](_0x1e7003[_0x1dad('0x2f')]);_0x107e11[_0x1dad('0x30')]=_[_0x1dad('0x31')](_0x107e11[_0x1dad('0x2c')],_0x107e11[_0x1dad('0x2f')]);_0x121062[_0x1dad('0x32')]=_[_0x1dad('0x31')](_0x107e11[_0x1dad('0x2c')],qs['fields'](_0x1e7003[_0x1dad('0x2f')]['fields']));_0x121062[_0x1dad('0x32')]=_0x121062[_0x1dad('0x32')]['length']?_0x121062[_0x1dad('0x32')]:_0x107e11[_0x1dad('0x2c')];if(!_0x1e7003[_0x1dad('0x2f')]['hasOwnProperty'](_0x1dad('0x33'))){_0x121062['limit']=qs[_0x1dad('0x1f')](_0x1e7003[_0x1dad('0x2f')][_0x1dad('0x1f')]);_0x121062['offset']=qs[_0x1dad('0x1e')](_0x1e7003[_0x1dad('0x2f')]['offset']);}_0x121062[_0x1dad('0x34')]=qs[_0x1dad('0x35')](_0x1e7003[_0x1dad('0x2f')][_0x1dad('0x35')]);_0x121062[_0x1dad('0x36')]=qs[_0x1dad('0x30')](_[_0x1dad('0x37')](_0x1e7003[_0x1dad('0x2f')],_0x107e11[_0x1dad('0x30')]),_0x166d0b);if(_0x1e7003[_0x1dad('0x2f')][_0x1dad('0x38')]){_0x121062[_0x1dad('0x36')]=_[_0x1dad('0x39')](_0x121062[_0x1dad('0x36')],{'$or':_['map'](_0x166d0b,function(_0x2b898a){if(_0x2b898a[_0x1dad('0x2a')]!==_0x1dad('0x3a')){var _0x2921e1={};_0x2921e1[_0x2b898a[_0x1dad('0x27')]]={'$like':'%'+_0x1e7003['query']['filter']+'%'};return _0x2921e1;}})});}_0x121062=_[_0x1dad('0x39')]({},_0x121062,_0x1e7003[_0x1dad('0x3b')]);var _0x2ab20f={'where':_0x121062[_0x1dad('0x36')]};return db[_0x1dad('0x3c')][_0x1dad('0x3d')](_0x2ab20f)[_0x1dad('0x3e')](function(_0x33e6aa){_0x51a62b[_0x1dad('0x3d')]=_0x33e6aa;if(_0x1e7003[_0x1dad('0x2f')][_0x1dad('0x3f')]){_0x121062['include']=[{'all':!![]}];}return db['Team'][_0x1dad('0x40')](_0x121062);})[_0x1dad('0x3e')](function(_0x3474d3){_0x51a62b['rows']=_0x3474d3;return _0x51a62b;})[_0x1dad('0x3e')](respondWithFilteredResult(_0x42c6ea,_0x121062))[_0x1dad('0x41')](handleError(_0x42c6ea,null));};exports[_0x1dad('0x42')]=function(_0x4e46db,_0x432c65){var _0x556279={'raw':![],'where':{'id':_0x4e46db[_0x1dad('0x43')]['id']}},_0x1ac8e0={};_0x1ac8e0[_0x1dad('0x2c')]=_[_0x1dad('0x2e')](db[_0x1dad('0x3c')][_0x1dad('0x29')]);_0x1ac8e0[_0x1dad('0x2f')]=_['keys'](_0x4e46db[_0x1dad('0x2f')]);_0x1ac8e0[_0x1dad('0x30')]=_[_0x1dad('0x31')](_0x1ac8e0['model'],_0x1ac8e0['query']);_0x556279[_0x1dad('0x32')]=_['intersection'](_0x1ac8e0[_0x1dad('0x2c')],qs[_0x1dad('0x44')](_0x4e46db[_0x1dad('0x2f')][_0x1dad('0x44')]));_0x556279[_0x1dad('0x32')]=_0x556279[_0x1dad('0x32')][_0x1dad('0x45')]?_0x556279[_0x1dad('0x32')]:_0x1ac8e0[_0x1dad('0x2c')];if(_0x4e46db['query'][_0x1dad('0x3f')]){_0x556279[_0x1dad('0x46')]=[{'all':!![]}];}_0x556279=_['merge']({},_0x556279,_0x4e46db[_0x1dad('0x3b')]);return db[_0x1dad('0x3c')][_0x1dad('0x47')](_0x556279)[_0x1dad('0x3e')](handleEntityNotFound(_0x432c65,null))['then'](respondWithResult(_0x432c65,null))['catch'](handleError(_0x432c65,null));};exports['create']=function(_0x3a0e0f,_0x38b544){return db[_0x1dad('0x3c')][_0x1dad('0x48')](_0x3a0e0f['body'],{})['then'](function(_0x46aa33){var _0x3c5040=_0x3a0e0f[_0x1dad('0x49')][_0x1dad('0x4a')]({'plain':!![]});if(!_0x3c5040)throw new Error(_0x1dad('0x4b'));if(_0x3c5040['role']==='user'){var _0x1d172f=_0x46aa33['get']({'plain':!![]});var _0xf3a6a9=_0x1dad('0x4c');return db[_0x1dad('0x4d')][_0x1dad('0x47')]({'where':{'name':_0xf3a6a9,'userProfileId':_0x3c5040[_0x1dad('0x4e')]},'raw':!![]})[_0x1dad('0x3e')](function(_0x1f6d7e){if(_0x1f6d7e&&_0x1f6d7e[_0x1dad('0x4f')]===0x0){return db[_0x1dad('0x50')][_0x1dad('0x48')]({'name':_0x1d172f['name'],'resourceId':_0x1d172f['id'],'type':_0x1f6d7e[_0x1dad('0x27')],'sectionId':_0x1f6d7e['id']},{})[_0x1dad('0x3e')](function(){return _0x46aa33;});}else{return _0x46aa33;}})['catch'](function(_0x2038eb){logger[_0x1dad('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2038eb);throw _0x2038eb;});}return _0x46aa33;})[_0x1dad('0x3e')](respondWithResult(_0x38b544,0xc9))[_0x1dad('0x41')](handleError(_0x38b544,null));};exports['update']=function(_0x558927,_0x3703f2){if(_0x558927[_0x1dad('0x51')]['id']){delete _0x558927[_0x1dad('0x51')]['id'];}return db[_0x1dad('0x3c')][_0x1dad('0x47')]({'where':{'id':_0x558927[_0x1dad('0x43')]['id']}})['then'](handleEntityNotFound(_0x3703f2,null))[_0x1dad('0x3e')](saveUpdates(_0x558927[_0x1dad('0x51')],null))[_0x1dad('0x3e')](respondWithResult(_0x3703f2,null))[_0x1dad('0x41')](handleError(_0x3703f2,null));};exports[_0x1dad('0x52')]=function(_0x3e9afa,_0x3345c1){var _0x13fa42=_0x3e9afa[_0x1dad('0x43')]['id'];var _0x40b440=[];return db[_0x1dad('0x53')][_0x1dad('0x54')](function(_0x505bf5){var _0x252c61='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x13fa42;return db[_0x1dad('0x53')][_0x1dad('0x2f')](_0x252c61,{'type':db[_0x1dad('0x55')][_0x1dad('0x56')]['SELECT'],'raw':!![],'transaction':_0x505bf5})['then'](function(_0x28ddc2){_0x40b440=_['map'](_0x28ddc2,function(_0x3118ee){return Number(_0x3118ee[_0x1dad('0x57')]);});})[_0x1dad('0x3e')](function(){var _0x5db11d=_0x1dad('0x58')+_0x13fa42;return db[_0x1dad('0x53')][_0x1dad('0x2f')](_0x5db11d,{'type':db[_0x1dad('0x55')][_0x1dad('0x56')][_0x1dad('0x59')],'raw':!![],'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(_0x3abbaf){var _0x15da65=_[_0x1dad('0x2d')](_0x3abbaf,function(_0x10d695){return Number(_0x10d695['VoiceQueueId']);});return db[_0x1dad('0x5a')][_0x1dad('0x52')]({'where':{'UserId':{'$in':_0x40b440},'VoiceQueueId':{'$in':_0x15da65}},'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(){var _0x13ea4a='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13fa42;return db[_0x1dad('0x53')][_0x1dad('0x2f')](_0x13ea4a,{'type':db[_0x1dad('0x55')][_0x1dad('0x56')][_0x1dad('0x59')],'raw':!![],'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(_0x24099b){var _0x5e7949=_[_0x1dad('0x2d')](_0x24099b,function(_0xe56335){return Number(_0xe56335[_0x1dad('0x5b')]);});return db[_0x1dad('0x5c')][_0x1dad('0x52')]({'where':{'UserId':{'$in':_0x40b440},'MailQueueId':{'$in':_0x5e7949}},'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(){var _0x3becd8=_0x1dad('0x5d')+_0x13fa42;return db[_0x1dad('0x53')][_0x1dad('0x2f')](_0x3becd8,{'type':db[_0x1dad('0x55')][_0x1dad('0x56')][_0x1dad('0x59')],'raw':!![],'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(_0xe362fa){var _0x241704=_[_0x1dad('0x2d')](_0xe362fa,function(_0x55d2bc){return Number(_0x55d2bc[_0x1dad('0x5e')]);});return db[_0x1dad('0x5f')][_0x1dad('0x52')]({'where':{'UserId':{'$in':_0x40b440},'SmsQueueId':{'$in':_0x241704}},'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(){var _0x2fa323='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13fa42;return db['sequelize'][_0x1dad('0x2f')](_0x2fa323,{'type':db[_0x1dad('0x55')][_0x1dad('0x56')]['SELECT'],'raw':!![],'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(_0x358889){var _0xefd102=_[_0x1dad('0x2d')](_0x358889,function(_0x12bd67){return Number(_0x12bd67[_0x1dad('0x60')]);});return db[_0x1dad('0x61')][_0x1dad('0x52')]({'where':{'UserId':{'$in':_0x40b440},'ChatQueueId':{'$in':_0xefd102}},'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(){var _0x39edd1=_0x1dad('0x62')+_0x13fa42;return db[_0x1dad('0x53')][_0x1dad('0x2f')](_0x39edd1,{'type':db[_0x1dad('0x55')][_0x1dad('0x56')][_0x1dad('0x59')],'raw':!![],'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(_0x3030c8){var _0x4b0c4e=_[_0x1dad('0x2d')](_0x3030c8,function(_0x39ed04){return Number(_0x39ed04[_0x1dad('0x63')]);});return db[_0x1dad('0x64')]['destroy']({'where':{'UserId':{'$in':_0x40b440},'FaxQueueId':{'$in':_0x4b0c4e}},'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(){var _0x559e38='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x13fa42;return db[_0x1dad('0x53')][_0x1dad('0x2f')](_0x559e38,{'type':db[_0x1dad('0x55')][_0x1dad('0x56')][_0x1dad('0x59')],'raw':!![],'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(_0x4b5d35){var _0x358352=_[_0x1dad('0x2d')](_0x4b5d35,function(_0x1cb183){return Number(_0x1cb183[_0x1dad('0x65')]);});return db[_0x1dad('0x66')][_0x1dad('0x52')]({'where':{'UserId':{'$in':_0x40b440},'OpenchannelQueueId':{'$in':_0x358352}},'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(){var _0x1b1107=_0x1dad('0x67')+_0x13fa42;return db[_0x1dad('0x53')][_0x1dad('0x2f')](_0x1b1107,{'type':db[_0x1dad('0x55')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x505bf5});})['then'](function(_0x24cf66){var _0xc39a5f=_[_0x1dad('0x2d')](_0x24cf66,function(_0x57baef){return Number(_0x57baef[_0x1dad('0x68')]);});return db[_0x1dad('0x69')][_0x1dad('0x52')]({'where':{'UserId':{'$in':_0x40b440},'WhatsappQueueId':{'$in':_0xc39a5f}},'transaction':_0x505bf5});})['then'](function(){return db['TeamVoicePrefix'][_0x1dad('0x47')]({'where':{'TeamId':_0x13fa42}});})[_0x1dad('0x3e')](function(_0x3e9491){if(_0x3e9491===null){return;}return db[_0x1dad('0x6a')][_0x1dad('0x52')]({'where':{'UserId':{'$in':_0x40b440},'VoicePrefixId':_0x3e9491['VoicePrefixId']},'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(){return db[_0x1dad('0x3c')][_0x1dad('0x52')]({'where':{'id':_0x13fa42},'cascade':!![],'transaction':_0x505bf5});})[_0x1dad('0x3e')](function(_0x15b97c){if(_0x15b97c===0x0){_0x3345c1[_0x1dad('0x1a')](0x194);}else{return db[_0x1dad('0x50')][_0x1dad('0x52')]({'where':{'type':_0x1dad('0x4c'),'resourceId':_0x13fa42},'cascade':!![],'transaction':_0x505bf5})['then'](function(){_0x3345c1['status'](0xcc)['end']();});}})[_0x1dad('0x41')](function(_0x7bf03b){_0x3345c1[_0x1dad('0x1c')](0x1f4)['send'](_0x7bf03b);});});};exports[_0x1dad('0x6b')]=function(_0x3ce0ca,_0x2da8bc,_0x3107fe){return db['Team'][_0x1dad('0x6c')]({'where':{'id':_0x3ce0ca[_0x1dad('0x43')]['id']}})['then'](handleEntityNotFound(_0x2da8bc,null))[_0x1dad('0x3e')](function(_0x4c0aa9){if(!_0x3ce0ca[_0x1dad('0x2f')][_0x1dad('0x6d')]||!utils['isValidChannel'](_0x3ce0ca[_0x1dad('0x2f')][_0x1dad('0x6d')])){throw new db['Sequelize'][(_0x1dad('0x6e'))]('Unknown\x20channel');}var _0xc78d7f={};var _0x1a7ca5={};_0x1a7ca5['model']=_[_0x1dad('0x2e')](db[_[_0x1dad('0x6f')](_0x3ce0ca['query'][_0x1dad('0x6d')][_0x1dad('0x70')]())+_0x1dad('0x71')]['rawAttributes']);_0x1a7ca5[_0x1dad('0x2f')]=_['keys'](_0x3ce0ca[_0x1dad('0x2f')]);_0x1a7ca5['filters']=_[_0x1dad('0x31')](_0x1a7ca5[_0x1dad('0x2c')],_0x1a7ca5['query']);_0xc78d7f['attributes']=_[_0x1dad('0x31')](_0x1a7ca5[_0x1dad('0x2c')],qs[_0x1dad('0x44')](_0x3ce0ca[_0x1dad('0x2f')][_0x1dad('0x44')]));_0xc78d7f[_0x1dad('0x32')]=_0xc78d7f[_0x1dad('0x32')][_0x1dad('0x45')]?_0xc78d7f[_0x1dad('0x32')]:_0x1a7ca5['model'];_0xc78d7f[_0x1dad('0x1f')]=qs['limit'](_0x3ce0ca[_0x1dad('0x2f')][_0x1dad('0x1f')]);_0xc78d7f[_0x1dad('0x1e')]=qs[_0x1dad('0x1e')](_0x3ce0ca[_0x1dad('0x2f')][_0x1dad('0x1e')]);_0xc78d7f[_0x1dad('0x34')]=qs[_0x1dad('0x35')](_0x3ce0ca[_0x1dad('0x2f')][_0x1dad('0x35')]);_0xc78d7f['where']=qs[_0x1dad('0x30')](_['pick'](_0x3ce0ca['query'],_0x1a7ca5[_0x1dad('0x30')]));_0xc78d7f=_[_0x1dad('0x39')]({},_0xc78d7f,_0x3ce0ca[_0x1dad('0x3b')]);return _0x4c0aa9[_0x1dad('0x4a')+_['capitalize'](_0x3ce0ca[_0x1dad('0x2f')][_0x1dad('0x6d')][_0x1dad('0x70')]())+_0x1dad('0x72')](_0xc78d7f);})[_0x1dad('0x3e')](respondWithResult(_0x2da8bc,null))[_0x1dad('0x41')](handleError(_0x2da8bc,null));};exports['addQueues']=function(_0x3b17d9,_0xa2584d,_0x2dead3){return db[_0x1dad('0x3c')][_0x1dad('0x6c')]({'where':{'id':_0x3b17d9['params']['id']}})[_0x1dad('0x3e')](function(_0x421b9e){if(_0x421b9e){if(!_0x3b17d9['body'][_0x1dad('0x6d')]||!utils[_0x1dad('0x73')](_0x3b17d9[_0x1dad('0x51')][_0x1dad('0x6d')])){throw new db[(_0x1dad('0x55'))][(_0x1dad('0x6e'))]('Unknown\x20channel');}return _0x421b9e[_0x1dad('0x74')+_[_0x1dad('0x6f')](_0x3b17d9[_0x1dad('0x51')][_0x1dad('0x6d')][_0x1dad('0x70')]())+'Queues'](_0x3b17d9['body'][_0x1dad('0x75')]);}return null;})[_0x1dad('0x3e')](handleEntityNotFound(_0xa2584d,null))[_0x1dad('0x3e')](respondWithStatusCode(_0xa2584d,null))['catch'](handleError(_0xa2584d,null));};exports[_0x1dad('0x76')]=function(_0x4bc398,_0x393b8b,_0x4f5180){return db[_0x1dad('0x3c')][_0x1dad('0x6c')]({'where':{'id':_0x4bc398[_0x1dad('0x43')]['id']}})[_0x1dad('0x3e')](function(_0x676c03){if(_0x676c03){if(!_0x4bc398['query'][_0x1dad('0x6d')]||!utils[_0x1dad('0x73')](_0x4bc398[_0x1dad('0x2f')][_0x1dad('0x6d')])){throw new db[(_0x1dad('0x55'))][(_0x1dad('0x6e'))]('Unknown\x20channel');}return _0x676c03[_0x1dad('0x77')+_[_0x1dad('0x6f')](_0x4bc398[_0x1dad('0x2f')][_0x1dad('0x6d')][_0x1dad('0x70')]())+_0x1dad('0x72')](_0x4bc398['query'][_0x1dad('0x75')]);}return null;})[_0x1dad('0x3e')](handleEntityNotFound(_0x393b8b,null))[_0x1dad('0x3e')](respondWithStatusCode(_0x393b8b,null))[_0x1dad('0x41')](handleError(_0x393b8b,null));};exports[_0x1dad('0x78')]=function(_0x317280,_0x2f5e5b){var _0x4cc80c=_[_0x1dad('0x79')](_0x317280[_0x1dad('0x51')][_0x1dad('0x75')])?_0x317280[_0x1dad('0x51')][_0x1dad('0x75')]:[_0x317280[_0x1dad('0x51')][_0x1dad('0x75')]];var _0x3a13a9=_0x317280[_0x1dad('0x43')]['id'];return db[_0x1dad('0x3c')][_0x1dad('0x47')]({'where':{'id':_0x3a13a9}})[_0x1dad('0x3e')](handleEntityNotFound(_0x2f5e5b,null))[_0x1dad('0x3e')](function(_0x4a0866){if(_0x4a0866){var _0x25506e=[_0x1dad('0x7a'),_0x1dad('0x7b'),'Mail',_0x1dad('0x7c'),_0x1dad('0x7d'),'Openchannel',_0x1dad('0x7e')];return db[_0x1dad('0x53')][_0x1dad('0x54')](function(_0x850946){var _0x1d691a=_[_0x1dad('0x2d')](_0x25506e,function(_0x210112){var _0x27ade4={'attributes':['id',_0x1dad('0x27')]};if(_0x210112===_0x1dad('0x7a')){_0x27ade4[_0x1dad('0x7f')]={'attributes':['penalty']};}return _0x4a0866['get'+_0x210112+'Queues'](_0x27ade4)['then'](function(_0x45f5ce){var _0x5414cc=_['map'](_0x45f5ce,function(_0x54ada5){var _0x3f700a=_[_0x1dad('0x2d')](_0x4cc80c,function(_0x55cf59){var _0x3a9d08={'where':{'UserId':_0x55cf59,[_0x210112+'QueueId']:_0x54ada5['id']},'transaction':_0x850946};if(_0x210112===_0x1dad('0x7a')){_0x3a9d08['defaults']={'penalty':_0x54ada5[_0x1dad('0x80')][_0x1dad('0x81')]};}return db[_0x1dad('0x82')+_0x210112+_0x1dad('0x71')][_0x1dad('0x83')](_0x3a9d08)[_0x1dad('0x3e')](function(){socket['emit'](_0x1dad('0x49')+_0x210112+_0x1dad('0x84'),{'UserId':_0x55cf59,[_0x210112+'QueueId']:_0x54ada5['id']});if(_0x210112!==_0x1dad('0x7a')){return;}return db[_0x1dad('0x82')]['findAll']({'where':{'id':_0x4cc80c,'online':0x1},'attributes':['id',_0x1dad('0x27'),_0x1dad('0x85'),'voicePause',_0x1dad('0x86')],'raw':!![]})[_0x1dad('0x3e')](function(_0x23d4b3){var _0x44d927=_[_0x1dad('0x2d')](_0x23d4b3,function(_0x17b6ce){return db[_0x1dad('0x87')][_0x1dad('0x88')]({'membername':_0x17b6ce[_0x1dad('0x27')],'UserId':_0x17b6ce['id'],'queue_name':_0x54ada5[_0x1dad('0x27')],'VoiceQueueId':_0x54ada5['id'],'interface':_[_0x1dad('0x89')](_0x17b6ce[_0x1dad('0x86')])?util[_0x1dad('0x8a')](_0x1dad('0x8b'),_0x17b6ce[_0x1dad('0x27')]):_0x17b6ce[_0x1dad('0x86')],'paused':_0x17b6ce[_0x1dad('0x8c')]||![],'penalty':_0x54ada5[_0x1dad('0x80')][_0x1dad('0x81')]},{'transaction':_0x850946});});return Promise[_0x1dad('0x8d')](_0x44d927);});});});return Promise[_0x1dad('0x8d')](_0x3f700a);});return Promise['all'](_0x5414cc);})[_0x1dad('0x3e')](function(){return db[_0x1dad('0x8e')][_0x1dad('0x6c')]({'where':{'teamId':_0x3a13a9}})[_0x1dad('0x3e')](function(_0x53473a){if(_0x53473a){var _0x284023=_[_0x1dad('0x2d')](_0x4cc80c,function(_0x3b9b0e){db[_0x1dad('0x6a')][_0x1dad('0x88')]({'UserId':_0x3b9b0e,'VoicePrefixId':_0x53473a[_0x1dad('0x8f')]});});return Promise['all'](_0x284023);}});});});return Promise[_0x1dad('0x8d')](_0x1d691a)[_0x1dad('0x3e')](function(){return _0x4a0866[_0x1dad('0x78')](_0x4cc80c,{'transaction':_0x850946})[_0x1dad('0x90')](function(_0xa26efd){return _0xa26efd;});});});}})['then'](respondWithResult(_0x2f5e5b,null))[_0x1dad('0x41')](handleError(_0x2f5e5b,null));};exports[_0x1dad('0x91')]=function(_0xfa8bfb,_0x10941b){var _0x4047ff=_['isArray'](_0xfa8bfb[_0x1dad('0x2f')][_0x1dad('0x75')])?_0xfa8bfb[_0x1dad('0x2f')][_0x1dad('0x75')]:[_0xfa8bfb[_0x1dad('0x2f')]['ids']];var _0x345a67=_0xfa8bfb[_0x1dad('0x43')]['id'];return db['Team']['find']({'where':{'id':_0x345a67}})['then'](handleEntityNotFound(_0x10941b,null))[_0x1dad('0x3e')](function(_0x4c66e9){if(_0x4c66e9){var _0x5e4e1e=['Voice',_0x1dad('0x7b'),_0x1dad('0x92'),'Sms','Fax',_0x1dad('0x93'),_0x1dad('0x7e')];return db[_0x1dad('0x53')][_0x1dad('0x54')](function(_0x161b2d){var _0x30a3bf=_[_0x1dad('0x2d')](_0x5e4e1e,function(_0x325e7b){var _0x48af87={'attributes':['id',_0x1dad('0x27')]};return _0x4c66e9['get'+_0x325e7b+_0x1dad('0x72')](_0x48af87)['then'](function(_0x292cdc){var _0x11fac7=_[_0x1dad('0x2d')](_0x292cdc,function(_0x2f5b6e){return _0x2f5b6e[_0x1dad('0x91')](_0x4047ff,{'transaction':_0x161b2d})[_0x1dad('0x3e')](function(){var _0x270e13=_[_0x1dad('0x2d')](_0x4047ff,function(_0x203180){socket[_0x1dad('0x94')]('user'+_0x325e7b+_0x1dad('0x95'),{'UserId':Number(_0x203180),[_0x325e7b+_0x1dad('0x96')]:_0x2f5b6e['id']});if(_0x325e7b!==_0x1dad('0x7a')){return;}return db[_0x1dad('0x87')][_0x1dad('0x52')]({'where':{'VoiceQueueId':_0x2f5b6e['id'],'UserId':_0x203180},'transaction':_0x161b2d});});return Promise['all'](_0x270e13);});});return Promise[_0x1dad('0x8d')](_0x11fac7);});});return Promise['all'](_0x30a3bf)['then'](function(){return _0x4c66e9['removeAgents'](_0x4047ff,{'transaction':_0x161b2d});})[_0x1dad('0x3e')](function(){return db[_0x1dad('0x8e')]['findOne']({'where':{'teamId':_0x345a67}})[_0x1dad('0x3e')](function(_0x45b763){if(_0x45b763){var _0x54ffcf=_[_0x1dad('0x2d')](_0x4047ff,function(_0x5c204c){db[_0x1dad('0x6a')]['destroy']({'where':{'UserId':_0x5c204c,'VoicePrefixId':_0x45b763[_0x1dad('0x8f')]}});});return Promise['all'](_0x54ffcf);}});});});}})['then'](respondWithStatusCode(_0x10941b,null))[_0x1dad('0x41')](handleError(_0x10941b,null));};exports['getAgents']=function(_0x409d16,_0x5598d5,_0x173323){var _0x490376={};var _0x267e3f={};var _0x24e10a;var _0x22b2cb;return db[_0x1dad('0x3c')][_0x1dad('0x6c')]({'where':{'id':_0x409d16[_0x1dad('0x43')]['id']}})['then'](handleEntityNotFound(_0x5598d5,null))[_0x1dad('0x3e')](function(_0x5e5a8a){if(_0x5e5a8a){_0x24e10a=_0x5e5a8a;_0x267e3f['model']=_[_0x1dad('0x2e')](db[_0x1dad('0x82')][_0x1dad('0x29')]);_0x267e3f['query']=_['keys'](_0x409d16[_0x1dad('0x2f')]);_0x267e3f[_0x1dad('0x30')]=_[_0x1dad('0x31')](_0x267e3f[_0x1dad('0x2c')],_0x267e3f[_0x1dad('0x2f')]);_0x490376[_0x1dad('0x32')]=_[_0x1dad('0x31')](_0x267e3f[_0x1dad('0x2c')],qs[_0x1dad('0x44')](_0x409d16['query'][_0x1dad('0x44')]));_0x490376[_0x1dad('0x32')]=_0x490376[_0x1dad('0x32')]['length']?_0x490376['attributes']:_0x267e3f[_0x1dad('0x2c')];_0x490376[_0x1dad('0x34')]=qs[_0x1dad('0x35')](_0x409d16[_0x1dad('0x2f')][_0x1dad('0x35')]);_0x490376['where']=qs[_0x1dad('0x30')](_[_0x1dad('0x37')](_0x409d16[_0x1dad('0x2f')],_0x267e3f[_0x1dad('0x30')]));if(_0x409d16['query'][_0x1dad('0x38')]){_0x490376[_0x1dad('0x36')]=_[_0x1dad('0x39')](_0x490376[_0x1dad('0x36')],{'$or':_[_0x1dad('0x2d')](_0x490376[_0x1dad('0x32')],function(_0x51ace8){var _0x5023d6={};_0x5023d6[_0x51ace8]={'$like':'%'+_0x409d16[_0x1dad('0x2f')][_0x1dad('0x38')]+'%'};return _0x5023d6;})});}_0x490376=_['merge']({},_0x490376,_0x409d16[_0x1dad('0x3b')]);return _0x24e10a[_0x1dad('0x97')](_0x490376);}})[_0x1dad('0x3e')](function(_0x402bd7){if(_0x402bd7){_0x22b2cb=_0x402bd7[_0x1dad('0x45')];if(!_0x409d16[_0x1dad('0x2f')]['hasOwnProperty'](_0x1dad('0x33'))){_0x490376['limit']=qs[_0x1dad('0x1f')](_0x409d16[_0x1dad('0x2f')][_0x1dad('0x1f')]);_0x490376['offset']=qs[_0x1dad('0x1e')](_0x409d16[_0x1dad('0x2f')][_0x1dad('0x1e')]);}return _0x24e10a[_0x1dad('0x97')](_0x490376);}})['then'](function(_0x1038c8){if(_0x1038c8){return _0x1038c8?{'count':_0x22b2cb,'rows':_0x1038c8}:null;}})[_0x1dad('0x3e')](respondWithResult(_0x5598d5,null))[_0x1dad('0x41')](handleError(_0x5598d5,null));};
\ No newline at end of file
+var _0x0539=['online','voicePause','upsert','isNil','interface','format','SIP/%s','all','UserVoicePrefix','VoicePrefixId','addAgents','spread','removeAgents','Fax','Whatsapp','Queue:remove','getAgents','order','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','update','error','name','send','index','map','Team','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filters','VIRTUAL','filter','merge','options','then','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','length','capitalize','addQueues','findOne','add','ids','removeQueues','remove','Queues','Voice','Chat','Mail','Sms','Openchannel','penalty','QueueId','TeamVoiceQueue','User','Queue','emit','findAll'];(function(_0x146ada,_0x51e402){var _0x3a718d=function(_0x4bfccf){while(--_0x4bfccf){_0x146ada['push'](_0x146ada['shift']());}};_0x3a718d(++_0x51e402);}(_0x0539,0x138));var _0x9053=function(_0x485a9b,_0x33fe64){_0x485a9b=_0x485a9b-0x0;var _0x664451=_0x0539[_0x485a9b];return _0x664451;};'use strict';var emlformat=require(_0x9053('0x0'));var rimraf=require(_0x9053('0x1'));var zipdir=require(_0x9053('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9053('0x3'));var moment=require('moment');var BPromise=require(_0x9053('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9053('0x5'));var sox=require(_0x9053('0x6'));var csv=require('to-csv');var ejs=require(_0x9053('0x7'));var fs=require('fs');var fs_extra=require(_0x9053('0x8'));var _=require(_0x9053('0x9'));var squel=require(_0x9053('0xa'));var crypto=require(_0x9053('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9053('0xc'));var toCsv=require(_0x9053('0xd'));var querystring=require('querystring');var Papa=require(_0x9053('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9053('0xf'));var hardwareService=require(_0x9053('0x10'));var logger=require(_0x9053('0x11'))(_0x9053('0x12'));var utils=require(_0x9053('0x13'));var config=require(_0x9053('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9053('0x15'))['db'];config[_0x9053('0x16')]=_[_0x9053('0x17')](config['redis'],{'host':_0x9053('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9053('0x19'))[_0x9053('0x1a')](socket);function respondWithStatusCode(_0x8b0269,_0x21b8e8){_0x21b8e8=_0x21b8e8||0xcc;return function(_0x2546d9){if(_0x2546d9){return _0x8b0269[_0x9053('0x1b')](_0x21b8e8);}return _0x8b0269[_0x9053('0x1c')](_0x21b8e8)[_0x9053('0x1d')]();};}function respondWithResult(_0x5a9af3,_0x3ed6fd){_0x3ed6fd=_0x3ed6fd||0xc8;return function(_0x6cc820){if(_0x6cc820){return _0x5a9af3[_0x9053('0x1c')](_0x3ed6fd)[_0x9053('0x1e')](_0x6cc820);}};}function respondWithFilteredResult(_0x1bb453,_0x36c0e0){return function(_0x1c854e){if(_0x1c854e){var _0x45502b=typeof _0x36c0e0['offset']==='undefined'&&typeof _0x36c0e0['limit']===_0x9053('0x1f');var _0x41b515=_0x1c854e[_0x9053('0x20')];var _0x57c1c2=_0x45502b?0x0:_0x36c0e0[_0x9053('0x21')];var _0x4e615d=_0x45502b?_0x1c854e[_0x9053('0x20')]:_0x36c0e0[_0x9053('0x21')]+_0x36c0e0[_0x9053('0x22')];var _0x306bd3;if(_0x4e615d>=_0x41b515){_0x4e615d=_0x41b515;_0x306bd3=0xc8;}else{_0x306bd3=0xce;}_0x1bb453[_0x9053('0x1c')](_0x306bd3);return _0x1bb453['set'](_0x9053('0x23'),_0x57c1c2+'-'+_0x4e615d+'/'+_0x41b515)[_0x9053('0x1e')](_0x1c854e);}return null;};}function patchUpdates(_0x294829){return function(_0x19ce2a){try{jsonpatch['apply'](_0x19ce2a,_0x294829,!![]);}catch(_0x49712f){return BPromise[_0x9053('0x24')](_0x49712f);}return _0x19ce2a[_0x9053('0x25')]();};}function saveUpdates(_0x56149f,_0x2468c4){return function(_0x5f81e8){if(_0x5f81e8){return _0x5f81e8[_0x9053('0x26')](_0x56149f)['then'](function(_0x2eec02){return _0x2eec02;});}return null;};}function handleEntityNotFound(_0x23bb1c,_0xb7baeb){return function(_0x33963a){if(!_0x33963a){_0x23bb1c[_0x9053('0x1b')](0x194);}return _0x33963a;};}function handleError(_0x1271c4,_0x1bad8a){_0x1bad8a=_0x1bad8a||0x1f4;return function(_0xcee75b){logger[_0x9053('0x27')](_0xcee75b['stack']);if(_0xcee75b[_0x9053('0x28')]){delete _0xcee75b[_0x9053('0x28')];}_0x1271c4[_0x9053('0x1c')](_0x1bad8a)[_0x9053('0x29')](_0xcee75b);};}exports[_0x9053('0x2a')]=function(_0x3ccb67,_0x504cca){var _0x51c145={},_0x4238e6={},_0x28277d={'count':0x0,'rows':[]};var _0x2ba31d=_[_0x9053('0x2b')](db[_0x9053('0x2c')]['rawAttributes'],function(_0x21d12c){return{'name':_0x21d12c['fieldName'],'type':_0x21d12c['type'][_0x9053('0x2d')]};});_0x4238e6[_0x9053('0x2e')]=_[_0x9053('0x2b')](_0x2ba31d,'name');_0x4238e6[_0x9053('0x2f')]=_['keys'](_0x3ccb67[_0x9053('0x2f')]);_0x4238e6['filters']=_['intersection'](_0x4238e6[_0x9053('0x2e')],_0x4238e6['query']);_0x51c145[_0x9053('0x30')]=_[_0x9053('0x31')](_0x4238e6['model'],qs[_0x9053('0x32')](_0x3ccb67[_0x9053('0x2f')][_0x9053('0x32')]));_0x51c145[_0x9053('0x30')]=_0x51c145[_0x9053('0x30')]['length']?_0x51c145[_0x9053('0x30')]:_0x4238e6[_0x9053('0x2e')];if(!_0x3ccb67['query'][_0x9053('0x33')](_0x9053('0x34'))){_0x51c145['limit']=qs[_0x9053('0x22')](_0x3ccb67[_0x9053('0x2f')]['limit']);_0x51c145[_0x9053('0x21')]=qs[_0x9053('0x21')](_0x3ccb67[_0x9053('0x2f')][_0x9053('0x21')]);}_0x51c145['order']=qs[_0x9053('0x35')](_0x3ccb67[_0x9053('0x2f')]['sort']);_0x51c145[_0x9053('0x36')]=qs['filters'](_[_0x9053('0x37')](_0x3ccb67[_0x9053('0x2f')],_0x4238e6[_0x9053('0x38')]),_0x2ba31d);if(_0x3ccb67['query']['filter']){_0x51c145[_0x9053('0x36')]=_['merge'](_0x51c145[_0x9053('0x36')],{'$or':_[_0x9053('0x2b')](_0x2ba31d,function(_0x5c619a){if(_0x5c619a['type']!==_0x9053('0x39')){var _0x25fb1f={};_0x25fb1f[_0x5c619a[_0x9053('0x28')]]={'$like':'%'+_0x3ccb67[_0x9053('0x2f')][_0x9053('0x3a')]+'%'};return _0x25fb1f;}})});}_0x51c145=_[_0x9053('0x3b')]({},_0x51c145,_0x3ccb67[_0x9053('0x3c')]);var _0x25f82f={'where':_0x51c145[_0x9053('0x36')]};return db[_0x9053('0x2c')][_0x9053('0x20')](_0x25f82f)[_0x9053('0x3d')](function(_0x31ee96){_0x28277d[_0x9053('0x20')]=_0x31ee96;if(_0x3ccb67[_0x9053('0x2f')][_0x9053('0x3e')]){_0x51c145[_0x9053('0x3f')]=[{'all':!![]}];}return db[_0x9053('0x2c')]['findAll'](_0x51c145);})['then'](function(_0x4c61b8){_0x28277d[_0x9053('0x40')]=_0x4c61b8;return _0x28277d;})[_0x9053('0x3d')](respondWithFilteredResult(_0x504cca,_0x51c145))[_0x9053('0x41')](handleError(_0x504cca,null));};exports[_0x9053('0x42')]=function(_0x1c39d3,_0x1a6fdd){var _0x10e0dd={'raw':![],'where':{'id':_0x1c39d3[_0x9053('0x43')]['id']}},_0x277fad={};_0x277fad[_0x9053('0x2e')]=_[_0x9053('0x44')](db['Team'][_0x9053('0x45')]);_0x277fad['query']=_[_0x9053('0x44')](_0x1c39d3[_0x9053('0x2f')]);_0x277fad['filters']=_['intersection'](_0x277fad[_0x9053('0x2e')],_0x277fad[_0x9053('0x2f')]);_0x10e0dd[_0x9053('0x30')]=_['intersection'](_0x277fad[_0x9053('0x2e')],qs[_0x9053('0x32')](_0x1c39d3[_0x9053('0x2f')][_0x9053('0x32')]));_0x10e0dd[_0x9053('0x30')]=_0x10e0dd['attributes']['length']?_0x10e0dd[_0x9053('0x30')]:_0x277fad[_0x9053('0x2e')];if(_0x1c39d3['query'][_0x9053('0x3e')]){_0x10e0dd[_0x9053('0x3f')]=[{'all':!![]}];}_0x10e0dd=_[_0x9053('0x3b')]({},_0x10e0dd,_0x1c39d3['options']);return db[_0x9053('0x2c')]['find'](_0x10e0dd)[_0x9053('0x3d')](handleEntityNotFound(_0x1a6fdd,null))[_0x9053('0x3d')](respondWithResult(_0x1a6fdd,null))[_0x9053('0x41')](handleError(_0x1a6fdd,null));};exports[_0x9053('0x46')]=function(_0x5b836d,_0x609c0f){return db[_0x9053('0x2c')]['create'](_0x5b836d[_0x9053('0x47')],{})[_0x9053('0x3d')](function(_0x9e0acf){var _0x4f4dbe=_0x5b836d[_0x9053('0x48')][_0x9053('0x49')]({'plain':!![]});if(!_0x4f4dbe)throw new Error(_0x9053('0x4a'));if(_0x4f4dbe['role']===_0x9053('0x48')){var _0x2e9ecb=_0x9e0acf['get']({'plain':!![]});var _0x479bb7=_0x9053('0x4b');return db[_0x9053('0x4c')][_0x9053('0x4d')]({'where':{'name':_0x479bb7,'userProfileId':_0x4f4dbe['userProfileId']},'raw':!![]})[_0x9053('0x3d')](function(_0x897aec){if(_0x897aec&&_0x897aec[_0x9053('0x4e')]===0x0){return db[_0x9053('0x4f')]['create']({'name':_0x2e9ecb[_0x9053('0x28')],'resourceId':_0x2e9ecb['id'],'type':_0x897aec[_0x9053('0x28')],'sectionId':_0x897aec['id']},{})[_0x9053('0x3d')](function(){return _0x9e0acf;});}else{return _0x9e0acf;}})[_0x9053('0x41')](function(_0x18316e){logger[_0x9053('0x27')](_0x9053('0x50'),_0x18316e);throw _0x18316e;});}return _0x9e0acf;})[_0x9053('0x3d')](respondWithResult(_0x609c0f,0xc9))[_0x9053('0x41')](handleError(_0x609c0f,null));};exports['update']=function(_0x24775d,_0x2da0dd){if(_0x24775d['body']['id']){delete _0x24775d['body']['id'];}return db[_0x9053('0x2c')]['find']({'where':{'id':_0x24775d[_0x9053('0x43')]['id']}})['then'](handleEntityNotFound(_0x2da0dd,null))[_0x9053('0x3d')](saveUpdates(_0x24775d['body'],null))['then'](respondWithResult(_0x2da0dd,null))[_0x9053('0x41')](handleError(_0x2da0dd,null));};exports['destroy']=function(_0x13e04e,_0x51097a){var _0x3c85a4=_0x13e04e['params']['id'];var _0x5d5d72=[];return db['sequelize'][_0x9053('0x51')](function(_0x17efb3){var _0xc2495=_0x9053('0x52')+_0x3c85a4;return db[_0x9053('0x53')][_0x9053('0x2f')](_0xc2495,{'type':db[_0x9053('0x54')][_0x9053('0x55')][_0x9053('0x56')],'raw':!![],'transaction':_0x17efb3})[_0x9053('0x3d')](function(_0x4bb2fd){_0x5d5d72=_[_0x9053('0x2b')](_0x4bb2fd,function(_0x2eebe5){return Number(_0x2eebe5[_0x9053('0x57')]);});})[_0x9053('0x3d')](function(){var _0x5b0b0f=_0x9053('0x58')+_0x3c85a4;return db[_0x9053('0x53')][_0x9053('0x2f')](_0x5b0b0f,{'type':db[_0x9053('0x54')][_0x9053('0x55')]['SELECT'],'raw':!![],'transaction':_0x17efb3});})[_0x9053('0x3d')](function(_0x1f4bd8){var _0xbd2193=_[_0x9053('0x2b')](_0x1f4bd8,function(_0x4cd57a){return Number(_0x4cd57a[_0x9053('0x59')]);});return db[_0x9053('0x5a')][_0x9053('0x5b')]({'where':{'UserId':{'$in':_0x5d5d72},'VoiceQueueId':{'$in':_0xbd2193}},'transaction':_0x17efb3});})[_0x9053('0x3d')](function(){var _0x577bd1=_0x9053('0x5c')+_0x3c85a4;return db[_0x9053('0x53')][_0x9053('0x2f')](_0x577bd1,{'type':db['Sequelize'][_0x9053('0x55')]['SELECT'],'raw':!![],'transaction':_0x17efb3});})[_0x9053('0x3d')](function(_0x1a7665){var _0x37ce53=_['map'](_0x1a7665,function(_0x2cfc31){return Number(_0x2cfc31[_0x9053('0x5d')]);});return db['UserMailQueue'][_0x9053('0x5b')]({'where':{'UserId':{'$in':_0x5d5d72},'MailQueueId':{'$in':_0x37ce53}},'transaction':_0x17efb3});})['then'](function(){var _0x49c5ee=_0x9053('0x5e')+_0x3c85a4;return db[_0x9053('0x53')]['query'](_0x49c5ee,{'type':db[_0x9053('0x54')][_0x9053('0x55')]['SELECT'],'raw':!![],'transaction':_0x17efb3});})[_0x9053('0x3d')](function(_0x451ebf){var _0x1f02f9=_[_0x9053('0x2b')](_0x451ebf,function(_0x4f123e){return Number(_0x4f123e[_0x9053('0x5f')]);});return db[_0x9053('0x60')]['destroy']({'where':{'UserId':{'$in':_0x5d5d72},'SmsQueueId':{'$in':_0x1f02f9}},'transaction':_0x17efb3});})[_0x9053('0x3d')](function(){var _0x31c62f=_0x9053('0x61')+_0x3c85a4;return db['sequelize'][_0x9053('0x2f')](_0x31c62f,{'type':db['Sequelize'][_0x9053('0x55')][_0x9053('0x56')],'raw':!![],'transaction':_0x17efb3});})[_0x9053('0x3d')](function(_0x279376){var _0xca2bce=_[_0x9053('0x2b')](_0x279376,function(_0x7a0fe0){return Number(_0x7a0fe0['ChatQueueId']);});return db[_0x9053('0x62')][_0x9053('0x5b')]({'where':{'UserId':{'$in':_0x5d5d72},'ChatQueueId':{'$in':_0xca2bce}},'transaction':_0x17efb3});})[_0x9053('0x3d')](function(){var _0x232813=_0x9053('0x63')+_0x3c85a4;return db[_0x9053('0x53')][_0x9053('0x2f')](_0x232813,{'type':db[_0x9053('0x54')][_0x9053('0x55')][_0x9053('0x56')],'raw':!![],'transaction':_0x17efb3});})['then'](function(_0x180d0e){var _0x5c9d4d=_[_0x9053('0x2b')](_0x180d0e,function(_0x348861){return Number(_0x348861['FaxQueueId']);});return db['UserFaxQueue'][_0x9053('0x5b')]({'where':{'UserId':{'$in':_0x5d5d72},'FaxQueueId':{'$in':_0x5c9d4d}},'transaction':_0x17efb3});})[_0x9053('0x3d')](function(){var _0x2f6fa3='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3c85a4;return db['sequelize'][_0x9053('0x2f')](_0x2f6fa3,{'type':db['Sequelize'][_0x9053('0x55')]['SELECT'],'raw':!![],'transaction':_0x17efb3});})[_0x9053('0x3d')](function(_0x13d0e1){var _0x5e5462=_['map'](_0x13d0e1,function(_0x22b6ed){return Number(_0x22b6ed['OpenchannelQueueId']);});return db[_0x9053('0x64')][_0x9053('0x5b')]({'where':{'UserId':{'$in':_0x5d5d72},'OpenchannelQueueId':{'$in':_0x5e5462}},'transaction':_0x17efb3});})[_0x9053('0x3d')](function(){var _0x3d9e01=_0x9053('0x65')+_0x3c85a4;return db[_0x9053('0x53')][_0x9053('0x2f')](_0x3d9e01,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x17efb3});})[_0x9053('0x3d')](function(_0x8ef2f0){var _0x56bf6d=_[_0x9053('0x2b')](_0x8ef2f0,function(_0x5860cf){return Number(_0x5860cf['WhatsappQueueId']);});return db[_0x9053('0x66')][_0x9053('0x5b')]({'where':{'UserId':{'$in':_0x5d5d72},'WhatsappQueueId':{'$in':_0x56bf6d}},'transaction':_0x17efb3});})['then'](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x3c85a4}});})[_0x9053('0x3d')](function(_0x4f72c2){if(_0x4f72c2===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x5d5d72},'VoicePrefixId':_0x4f72c2['VoicePrefixId']},'transaction':_0x17efb3});})[_0x9053('0x3d')](function(){return db[_0x9053('0x2c')][_0x9053('0x5b')]({'where':{'id':_0x3c85a4},'cascade':!![],'transaction':_0x17efb3});})['then'](function(_0x4baf80){if(_0x4baf80===0x0){_0x51097a[_0x9053('0x1b')](0x194);}else{return db[_0x9053('0x4f')][_0x9053('0x5b')]({'where':{'type':_0x9053('0x4b'),'resourceId':_0x3c85a4},'cascade':!![],'transaction':_0x17efb3})[_0x9053('0x3d')](function(){_0x51097a[_0x9053('0x1c')](0xcc)[_0x9053('0x1d')]();});}})[_0x9053('0x41')](function(_0x1d67ce){_0x51097a[_0x9053('0x1c')](0x1f4)[_0x9053('0x29')](_0x1d67ce);});});};exports['getQueues']=function(_0x2bfced,_0x2240cf,_0x49a009){return db[_0x9053('0x2c')]['findOne']({'where':{'id':_0x2bfced['params']['id']}})[_0x9053('0x3d')](handleEntityNotFound(_0x2240cf,null))[_0x9053('0x3d')](function(_0x34f383){if(!_0x2bfced[_0x9053('0x2f')][_0x9053('0x67')]||!utils[_0x9053('0x68')](_0x2bfced['query'][_0x9053('0x67')])){throw new db['Sequelize'][(_0x9053('0x69'))](_0x9053('0x6a'));}var _0x5048a5={};var _0x465851={};_0x465851[_0x9053('0x2e')]=_[_0x9053('0x44')](db[_['capitalize'](_0x2bfced[_0x9053('0x2f')]['channel'][_0x9053('0x6b')]())+'Queue'][_0x9053('0x45')]);_0x465851['query']=_['keys'](_0x2bfced[_0x9053('0x2f')]);_0x465851[_0x9053('0x38')]=_['intersection'](_0x465851[_0x9053('0x2e')],_0x465851['query']);_0x5048a5[_0x9053('0x30')]=_[_0x9053('0x31')](_0x465851[_0x9053('0x2e')],qs[_0x9053('0x32')](_0x2bfced['query'][_0x9053('0x32')]));_0x5048a5['attributes']=_0x5048a5[_0x9053('0x30')][_0x9053('0x6c')]?_0x5048a5[_0x9053('0x30')]:_0x465851['model'];_0x5048a5['limit']=qs[_0x9053('0x22')](_0x2bfced['query']['limit']);_0x5048a5[_0x9053('0x21')]=qs[_0x9053('0x21')](_0x2bfced['query'][_0x9053('0x21')]);_0x5048a5['order']=qs[_0x9053('0x35')](_0x2bfced['query'][_0x9053('0x35')]);_0x5048a5[_0x9053('0x36')]=qs['filters'](_[_0x9053('0x37')](_0x2bfced[_0x9053('0x2f')],_0x465851[_0x9053('0x38')]));_0x5048a5=_['merge']({},_0x5048a5,_0x2bfced['options']);return _0x34f383[_0x9053('0x49')+_[_0x9053('0x6d')](_0x2bfced[_0x9053('0x2f')][_0x9053('0x67')][_0x9053('0x6b')]())+'Queues'](_0x5048a5);})['then'](respondWithResult(_0x2240cf,null))[_0x9053('0x41')](handleError(_0x2240cf,null));};exports[_0x9053('0x6e')]=function(_0x6fff7d,_0x3d7aea,_0x5ad950){return db[_0x9053('0x2c')][_0x9053('0x6f')]({'where':{'id':_0x6fff7d['params']['id']}})[_0x9053('0x3d')](function(_0x1d6d9e){if(_0x1d6d9e){if(!_0x6fff7d['body'][_0x9053('0x67')]||!utils[_0x9053('0x68')](_0x6fff7d[_0x9053('0x47')][_0x9053('0x67')])){throw new db[(_0x9053('0x54'))][(_0x9053('0x69'))](_0x9053('0x6a'));}return _0x1d6d9e[_0x9053('0x70')+_['capitalize'](_0x6fff7d[_0x9053('0x47')]['channel'][_0x9053('0x6b')]())+'Queues'](_0x6fff7d[_0x9053('0x47')][_0x9053('0x71')]);}return null;})['then'](handleEntityNotFound(_0x3d7aea,null))[_0x9053('0x3d')](respondWithStatusCode(_0x3d7aea,null))[_0x9053('0x41')](handleError(_0x3d7aea,null));};exports[_0x9053('0x72')]=function(_0xec6ecd,_0x497701,_0x24db7c){return db[_0x9053('0x2c')][_0x9053('0x6f')]({'where':{'id':_0xec6ecd[_0x9053('0x43')]['id']}})[_0x9053('0x3d')](function(_0x4aa4c9){if(_0x4aa4c9){if(!_0xec6ecd['query'][_0x9053('0x67')]||!utils[_0x9053('0x68')](_0xec6ecd[_0x9053('0x2f')][_0x9053('0x67')])){throw new db['Sequelize'][(_0x9053('0x69'))](_0x9053('0x6a'));}return _0x4aa4c9[_0x9053('0x73')+_[_0x9053('0x6d')](_0xec6ecd[_0x9053('0x2f')][_0x9053('0x67')][_0x9053('0x6b')]())+_0x9053('0x74')](_0xec6ecd[_0x9053('0x2f')]['ids']);}return null;})['then'](handleEntityNotFound(_0x497701,null))[_0x9053('0x3d')](respondWithStatusCode(_0x497701,null))['catch'](handleError(_0x497701,null));};exports['addAgents']=function(_0x15a0a7,_0x486185){var _0x2cef86=_['isArray'](_0x15a0a7['body'][_0x9053('0x71')])?_0x15a0a7[_0x9053('0x47')][_0x9053('0x71')]:[_0x15a0a7[_0x9053('0x47')][_0x9053('0x71')]];var _0x59d6ad=_0x15a0a7[_0x9053('0x43')]['id'];return db['Team'][_0x9053('0x4d')]({'where':{'id':_0x59d6ad}})[_0x9053('0x3d')](handleEntityNotFound(_0x486185,null))[_0x9053('0x3d')](function(_0x4977cc){if(_0x4977cc){var _0x12c524=[_0x9053('0x75'),_0x9053('0x76'),_0x9053('0x77'),_0x9053('0x78'),'Fax',_0x9053('0x79'),'Whatsapp'];return db[_0x9053('0x53')][_0x9053('0x51')](function(_0xd7928c){var _0x51b398=_['map'](_0x12c524,function(_0x15cd5c){var _0x89a87d={'attributes':['id',_0x9053('0x28')]};if(_0x15cd5c===_0x9053('0x75')){_0x89a87d['through']={'attributes':[_0x9053('0x7a')]};}return _0x4977cc['get'+_0x15cd5c+'Queues'](_0x89a87d)[_0x9053('0x3d')](function(_0x58498d){var _0x80a055=_[_0x9053('0x2b')](_0x58498d,function(_0x5f39e2){var _0x31d071=_['map'](_0x2cef86,function(_0x371829){var _0x23ef5e={'where':{'UserId':_0x371829,[_0x15cd5c+_0x9053('0x7b')]:_0x5f39e2['id']},'transaction':_0xd7928c};if(_0x15cd5c===_0x9053('0x75')){_0x23ef5e[_0x9053('0x17')]={'penalty':_0x5f39e2[_0x9053('0x7c')][_0x9053('0x7a')]};}return db[_0x9053('0x7d')+_0x15cd5c+_0x9053('0x7e')]['findOrCreate'](_0x23ef5e)['then'](function(){socket[_0x9053('0x7f')]('user'+_0x15cd5c+'Queue:save',{'UserId':_0x371829,[_0x15cd5c+_0x9053('0x7b')]:_0x5f39e2['id']});if(_0x15cd5c!==_0x9053('0x75')){return;}return db['User'][_0x9053('0x80')]({'where':{'id':_0x2cef86,'online':0x1},'attributes':['id','name',_0x9053('0x81'),_0x9053('0x82'),'interface'],'raw':!![]})['then'](function(_0x8ad679){var _0x528a50=_[_0x9053('0x2b')](_0x8ad679,function(_0x69357c){return db['UserVoiceQueueRt'][_0x9053('0x83')]({'membername':_0x69357c['name'],'UserId':_0x69357c['id'],'queue_name':_0x5f39e2['name'],'VoiceQueueId':_0x5f39e2['id'],'interface':_[_0x9053('0x84')](_0x69357c[_0x9053('0x85')])?util[_0x9053('0x86')](_0x9053('0x87'),_0x69357c['name']):_0x69357c[_0x9053('0x85')],'paused':_0x69357c['voicePause']||![],'penalty':_0x5f39e2['TeamVoiceQueue'][_0x9053('0x7a')]},{'transaction':_0xd7928c});});return Promise[_0x9053('0x88')](_0x528a50);});});});return Promise[_0x9053('0x88')](_0x31d071);});return Promise[_0x9053('0x88')](_0x80a055);})[_0x9053('0x3d')](function(){return db['TeamVoicePrefix'][_0x9053('0x6f')]({'where':{'teamId':_0x59d6ad}})[_0x9053('0x3d')](function(_0x46518c){if(_0x46518c){var _0x5c14ba=_['map'](_0x2cef86,function(_0x5a50b2){db[_0x9053('0x89')]['upsert']({'UserId':_0x5a50b2,'VoicePrefixId':_0x46518c[_0x9053('0x8a')]});});return Promise['all'](_0x5c14ba);}});});});return Promise[_0x9053('0x88')](_0x51b398)[_0x9053('0x3d')](function(){return _0x4977cc[_0x9053('0x8b')](_0x2cef86,{'transaction':_0xd7928c})[_0x9053('0x8c')](function(_0x58e32b){return _0x58e32b;});});});}})['then'](respondWithResult(_0x486185,null))[_0x9053('0x41')](handleError(_0x486185,null));};exports[_0x9053('0x8d')]=function(_0x1b4ed7,_0x4d9ae8){var _0x7f6777=_['isArray'](_0x1b4ed7['query'][_0x9053('0x71')])?_0x1b4ed7[_0x9053('0x2f')][_0x9053('0x71')]:[_0x1b4ed7[_0x9053('0x2f')][_0x9053('0x71')]];var _0x562561=_0x1b4ed7[_0x9053('0x43')]['id'];return db[_0x9053('0x2c')][_0x9053('0x4d')]({'where':{'id':_0x562561}})[_0x9053('0x3d')](handleEntityNotFound(_0x4d9ae8,null))['then'](function(_0x5c7dcb){if(_0x5c7dcb){var _0x2efab9=[_0x9053('0x75'),'Chat',_0x9053('0x77'),'Sms',_0x9053('0x8e'),_0x9053('0x79'),_0x9053('0x8f')];return db[_0x9053('0x53')][_0x9053('0x51')](function(_0x324311){var _0x2ebc95=_[_0x9053('0x2b')](_0x2efab9,function(_0x4d9dac){var _0x54fcf4={'attributes':['id',_0x9053('0x28')]};return _0x5c7dcb[_0x9053('0x49')+_0x4d9dac+_0x9053('0x74')](_0x54fcf4)[_0x9053('0x3d')](function(_0x19b9be){var _0x14f1c0=_[_0x9053('0x2b')](_0x19b9be,function(_0x3a9e4c){return _0x3a9e4c[_0x9053('0x8d')](_0x7f6777,{'transaction':_0x324311})[_0x9053('0x3d')](function(){var _0x4a251d=_[_0x9053('0x2b')](_0x7f6777,function(_0x18b49d){socket[_0x9053('0x7f')](_0x9053('0x48')+_0x4d9dac+_0x9053('0x90'),{'UserId':Number(_0x18b49d),[_0x4d9dac+_0x9053('0x7b')]:_0x3a9e4c['id']});if(_0x4d9dac!==_0x9053('0x75')){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3a9e4c['id'],'UserId':_0x18b49d},'transaction':_0x324311});});return Promise[_0x9053('0x88')](_0x4a251d);});});return Promise[_0x9053('0x88')](_0x14f1c0);});});return Promise['all'](_0x2ebc95)[_0x9053('0x3d')](function(){return _0x5c7dcb[_0x9053('0x8d')](_0x7f6777,{'transaction':_0x324311});})['then'](function(){return db['TeamVoicePrefix'][_0x9053('0x6f')]({'where':{'teamId':_0x562561}})[_0x9053('0x3d')](function(_0x3826cf){if(_0x3826cf){var _0x405cd6=_[_0x9053('0x2b')](_0x7f6777,function(_0x46ff54){db[_0x9053('0x89')][_0x9053('0x5b')]({'where':{'UserId':_0x46ff54,'VoicePrefixId':_0x3826cf['VoicePrefixId']}});});return Promise[_0x9053('0x88')](_0x405cd6);}});});});}})[_0x9053('0x3d')](respondWithStatusCode(_0x4d9ae8,null))['catch'](handleError(_0x4d9ae8,null));};exports[_0x9053('0x91')]=function(_0x4527f6,_0x44f63f,_0x3b54f5){var _0x25eaff={};var _0xb3ea38={};var _0x44ab93;var _0x29eda2;return db[_0x9053('0x2c')][_0x9053('0x6f')]({'where':{'id':_0x4527f6[_0x9053('0x43')]['id']}})[_0x9053('0x3d')](handleEntityNotFound(_0x44f63f,null))[_0x9053('0x3d')](function(_0x250b73){if(_0x250b73){_0x44ab93=_0x250b73;_0xb3ea38[_0x9053('0x2e')]=_[_0x9053('0x44')](db[_0x9053('0x7d')]['rawAttributes']);_0xb3ea38['query']=_[_0x9053('0x44')](_0x4527f6['query']);_0xb3ea38[_0x9053('0x38')]=_[_0x9053('0x31')](_0xb3ea38[_0x9053('0x2e')],_0xb3ea38[_0x9053('0x2f')]);_0x25eaff['attributes']=_[_0x9053('0x31')](_0xb3ea38[_0x9053('0x2e')],qs[_0x9053('0x32')](_0x4527f6[_0x9053('0x2f')][_0x9053('0x32')]));_0x25eaff[_0x9053('0x30')]=_0x25eaff[_0x9053('0x30')]['length']?_0x25eaff[_0x9053('0x30')]:_0xb3ea38[_0x9053('0x2e')];_0x25eaff[_0x9053('0x92')]=qs['sort'](_0x4527f6[_0x9053('0x2f')][_0x9053('0x35')]);_0x25eaff[_0x9053('0x36')]=qs['filters'](_[_0x9053('0x37')](_0x4527f6[_0x9053('0x2f')],_0xb3ea38['filters']));if(_0x4527f6[_0x9053('0x2f')][_0x9053('0x3a')]){_0x25eaff[_0x9053('0x36')]=_[_0x9053('0x3b')](_0x25eaff[_0x9053('0x36')],{'$or':_['map'](_0x25eaff['attributes'],function(_0x3a80d1){var _0x44f2f6={};_0x44f2f6[_0x3a80d1]={'$like':'%'+_0x4527f6[_0x9053('0x2f')][_0x9053('0x3a')]+'%'};return _0x44f2f6;})});}_0x25eaff=_[_0x9053('0x3b')]({},_0x25eaff,_0x4527f6[_0x9053('0x3c')]);return _0x44ab93['getAgents'](_0x25eaff);}})[_0x9053('0x3d')](function(_0x3a46c2){if(_0x3a46c2){_0x29eda2=_0x3a46c2['length'];if(!_0x4527f6['query']['hasOwnProperty'](_0x9053('0x34'))){_0x25eaff[_0x9053('0x22')]=qs[_0x9053('0x22')](_0x4527f6[_0x9053('0x2f')][_0x9053('0x22')]);_0x25eaff['offset']=qs['offset'](_0x4527f6[_0x9053('0x2f')][_0x9053('0x21')]);}return _0x44ab93[_0x9053('0x91')](_0x25eaff);}})[_0x9053('0x3d')](function(_0x8243b){if(_0x8243b){return _0x8243b?{'count':_0x29eda2,'rows':_0x8243b}:null;}})[_0x9053('0x3d')](respondWithResult(_0x44f63f,null))[_0x9053('0x41')](handleError(_0x44f63f,null));};
\ No newline at end of file
index a61e481..821752b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6de7=['events','../../mysqldb','save','update','remove'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0x6de7,0x1f4));var _0x76de=function(_0x4161ac,_0xbc442d){_0x4161ac=_0x4161ac-0x0;var _0x5024fe=_0x6de7[_0x4161ac];return _0x5024fe;};'use strict';var EventEmitter=require(_0x76de('0x0'));var Team=require(_0x76de('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x76de('0x2'),'afterUpdate':_0x76de('0x3'),'afterDestroy':_0x76de('0x4')};function emitEvent(_0x590c88){return function(_0x2935f3,_0x4ae02e,_0xf784c8){TeamEvents['emit'](_0x590c88+':'+_0x2935f3['id'],_0x2935f3);TeamEvents['emit'](_0x590c88,_0x2935f3);_0xf784c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
+var _0xa5df=['hook','exports','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0xa5df,0x1c4));var _0xfa5d=function(_0x1d48a0,_0x27ee3e){_0x1d48a0=_0x1d48a0-0x0;var _0x3fb49f=_0xa5df[_0x1d48a0];return _0x3fb49f;};'use strict';var EventEmitter=require('events');var Team=require(_0xfa5d('0x0'))['db'][_0xfa5d('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xfa5d('0x2')](0x0);var events={'afterCreate':_0xfa5d('0x3'),'afterUpdate':_0xfa5d('0x4'),'afterDestroy':_0xfa5d('0x5')};function emitEvent(_0x5881e2){return function(_0x2438be,_0x510ae8,_0xac2f7d){TeamEvents[_0xfa5d('0x6')](_0x5881e2+':'+_0x2438be['id'],_0x2438be);TeamEvents['emit'](_0x5881e2,_0x2438be);_0xac2f7d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xfa5d('0x7')](e,emitEvent(event));}}module[_0xfa5d('0x8')]=TeamEvents;
\ No newline at end of file
index 566e26b..cae464d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd899=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','Team','teams','lodash','../../config/logger'];(function(_0x2eba44,_0x537222){var _0x24669c=function(_0x5c1bd5){while(--_0x5c1bd5){_0x2eba44['push'](_0x2eba44['shift']());}};_0x24669c(++_0x537222);}(_0xd899,0x76));var _0x9d89=function(_0x27ef0a,_0x5c211c){_0x27ef0a=_0x27ef0a-0x0;var _0x3c0772=_0xd899[_0x27ef0a];return _0x3c0772;};'use strict';var _=require(_0x9d89('0x0'));var util=require('util');var logger=require(_0x9d89('0x1'))(_0x9d89('0x2'));var moment=require(_0x9d89('0x3'));var BPromise=require(_0x9d89('0x4'));var rp=require(_0x9d89('0x5'));var fs=require('fs');var path=require(_0x9d89('0x6'));var rimraf=require(_0x9d89('0x7'));var config=require(_0x9d89('0x8'));var attributes=require(_0x9d89('0x9'));module['exports']=function(_0x4c42a1,_0x2aee2d){return _0x4c42a1['define'](_0x9d89('0xa'),attributes,{'tableName':_0x9d89('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x365e=['exports','define','teams','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2b9f6f,_0x132d97){var _0x2bc9f8=function(_0x1f0a52){while(--_0x1f0a52){_0x2b9f6f['push'](_0x2b9f6f['shift']());}};_0x2bc9f8(++_0x132d97);}(_0x365e,0x19b));var _0xe365=function(_0x27a25f,_0x1470dd){_0x27a25f=_0x27a25f-0x0;var _0x3c4061=_0x365e[_0x27a25f];return _0x3c4061;};'use strict';var _=require(_0xe365('0x0'));var util=require(_0xe365('0x1'));var logger=require(_0xe365('0x2'))(_0xe365('0x3'));var moment=require(_0xe365('0x4'));var BPromise=require(_0xe365('0x5'));var rp=require(_0xe365('0x6'));var fs=require('fs');var path=require(_0xe365('0x7'));var rimraf=require(_0xe365('0x8'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0xe365('0x9')]=function(_0x3697ab,_0x2ce784){return _0x3697ab[_0xe365('0xa')]('Team',attributes,{'tableName':_0xe365('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 16f3dba..e1285f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe066=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4cf16f,_0x358e86){var _0x178cf8=function(_0xd1ee7e){while(--_0xd1ee7e){_0x4cf16f['push'](_0x4cf16f['shift']());}};_0x178cf8(++_0x358e86);}(_0xe066,0x159));var _0x6e06=function(_0x4631eb,_0x55649e){_0x4631eb=_0x4631eb-0x0;var _0x562eca=_0xe066[_0x4631eb];return _0x562eca;};'use strict';var _=require(_0x6e06('0x0'));var util=require('util');var moment=require(_0x6e06('0x1'));var BPromise=require(_0x6e06('0x2'));var rs=require(_0x6e06('0x3'));var fs=require('fs');var Redis=require(_0x6e06('0x4'));var db=require(_0x6e06('0x5'))['db'];var utils=require(_0x6e06('0x6'));var logger=require(_0x6e06('0x7'))(_0x6e06('0x8'));var config=require(_0x6e06('0x9'));var jayson=require(_0x6e06('0xa'));var client=jayson[_0x6e06('0xb')][_0x6e06('0xc')]({'port':0x232a});config[_0x6e06('0xd')]=_[_0x6e06('0xe')](config[_0x6e06('0xd')],{'host':_0x6e06('0xf'),'port':0x18eb});var socket=require(_0x6e06('0x10'))(new Redis(config[_0x6e06('0xd')]));require(_0x6e06('0x11'))['register'](socket);function respondWithRpcPromise(_0x2b9178,_0x5ed79c,_0x42902f){return new BPromise(function(_0x5f43f7,_0x4787dd){return client[_0x6e06('0x12')](_0x2b9178,_0x42902f)[_0x6e06('0x13')](function(_0x5b58a6){logger[_0x6e06('0x14')](_0x6e06('0x15'),_0x5ed79c,'request\x20sent');logger['debug'](_0x6e06('0x16'),_0x5ed79c,'request\x20sent',JSON['stringify'](_0x5b58a6));if(_0x5b58a6[_0x6e06('0x17')]){if(_0x5b58a6[_0x6e06('0x17')][_0x6e06('0x18')]===0x1f4){logger['error'](_0x6e06('0x15'),_0x5ed79c,_0x5b58a6[_0x6e06('0x17')][_0x6e06('0x19')]);return _0x4787dd(_0x5b58a6[_0x6e06('0x17')][_0x6e06('0x19')]);}logger['error']('Team,\x20%s,\x20%s',_0x5ed79c,_0x5b58a6[_0x6e06('0x17')][_0x6e06('0x19')]);return _0x5f43f7(_0x5b58a6[_0x6e06('0x17')][_0x6e06('0x19')]);}else{logger[_0x6e06('0x14')](_0x6e06('0x15'),_0x5ed79c,'request\x20sent');_0x5f43f7(_0x5b58a6[_0x6e06('0x1a')]['message']);}})['catch'](function(_0x14b289){logger[_0x6e06('0x17')](_0x6e06('0x15'),_0x5ed79c,_0x14b289);_0x4787dd(_0x14b289);});});}
\ No newline at end of file
+var _0x170a=['error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x447870,_0x53ea03){var _0x21fd74=function(_0x592298){while(--_0x592298){_0x447870['push'](_0x447870['shift']());}};_0x21fd74(++_0x53ea03);}(_0x170a,0xed));var _0xa170=function(_0x5f4ca8,_0x2b5c2a){_0x5f4ca8=_0x5f4ca8-0x0;var _0x24ef92=_0x170a[_0x5f4ca8];return _0x24ef92;};'use strict';var _=require(_0xa170('0x0'));var util=require(_0xa170('0x1'));var moment=require(_0xa170('0x2'));var BPromise=require('bluebird');var rs=require(_0xa170('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa170('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa170('0x5'))(_0xa170('0x6'));var config=require(_0xa170('0x7'));var jayson=require(_0xa170('0x8'));var client=jayson[_0xa170('0x9')][_0xa170('0xa')]({'port':0x232a});config[_0xa170('0xb')]=_[_0xa170('0xc')](config['redis'],{'host':_0xa170('0xd'),'port':0x18eb});var socket=require(_0xa170('0xe'))(new Redis(config[_0xa170('0xb')]));require(_0xa170('0xf'))[_0xa170('0x10')](socket);function respondWithRpcPromise(_0x2c9de7,_0x10d98b,_0x4776ed){return new BPromise(function(_0x430579,_0x3453ad){return client['request'](_0x2c9de7,_0x4776ed)[_0xa170('0x11')](function(_0x4e162d){logger[_0xa170('0x12')](_0xa170('0x13'),_0x10d98b,_0xa170('0x14'));logger[_0xa170('0x15')](_0xa170('0x16'),_0x10d98b,_0xa170('0x14'),JSON[_0xa170('0x17')](_0x4e162d));if(_0x4e162d[_0xa170('0x18')]){if(_0x4e162d[_0xa170('0x18')][_0xa170('0x19')]===0x1f4){logger[_0xa170('0x18')](_0xa170('0x13'),_0x10d98b,_0x4e162d[_0xa170('0x18')]['message']);return _0x3453ad(_0x4e162d['error']['message']);}logger[_0xa170('0x18')]('Team,\x20%s,\x20%s',_0x10d98b,_0x4e162d[_0xa170('0x18')][_0xa170('0x1a')]);return _0x430579(_0x4e162d[_0xa170('0x18')][_0xa170('0x1a')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x10d98b,_0xa170('0x14'));_0x430579(_0x4e162d[_0xa170('0x1b')][_0xa170('0x1a')]);}})[_0xa170('0x1c')](function(_0x550738){logger['error'](_0xa170('0x13'),_0x10d98b,_0x550738);_0x3453ad(_0x550738);});});}
\ No newline at end of file
index 280296e..ffa0dbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa772=['remove','update','emit','removeListener','length','team:'];(function(_0x5d58b5,_0x2b8125){var _0x3d24d3=function(_0x3e9c73){while(--_0x3e9c73){_0x5d58b5['push'](_0x5d58b5['shift']());}};_0x3d24d3(++_0x2b8125);}(_0xa772,0x114));var _0x2a77=function(_0x175342,_0x57e790){_0x175342=_0x175342-0x0;var _0x1477a8=_0xa772[_0x175342];return _0x1477a8;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x2a77('0x0'),_0x2a77('0x1')];function createListener(_0x5930c6,_0x5b83ec){return function(_0x384f72){_0x5b83ec[_0x2a77('0x2')](_0x5930c6,_0x384f72);};}function removeListener(_0x1f9627,_0x3e2670){return function(){TeamEvents[_0x2a77('0x3')](_0x1f9627,_0x3e2670);};}exports['register']=function(_0x20e909){for(var _0x2e9e78=0x0,_0x4dc727=events[_0x2a77('0x4')];_0x2e9e78<_0x4dc727;_0x2e9e78++){var _0x7ac9f=events[_0x2e9e78];var _0x20f56d=createListener(_0x2a77('0x5')+_0x7ac9f,_0x20e909);TeamEvents['on'](_0x7ac9f,_0x20f56d);}};
\ No newline at end of file
+var _0xd71d=['update','emit','removeListener','register','length','./team.events','save','remove'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0xd71d,0x1a5));var _0xdd71=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0xd71d[_0x149a9b];return _0x2c2bf6;};'use strict';var TeamEvents=require(_0xdd71('0x0'));var events=[_0xdd71('0x1'),_0xdd71('0x2'),_0xdd71('0x3')];function createListener(_0x375b72,_0x5916bc){return function(_0x419635){_0x5916bc[_0xdd71('0x4')](_0x375b72,_0x419635);};}function removeListener(_0x19415e,_0x598d89){return function(){TeamEvents[_0xdd71('0x5')](_0x19415e,_0x598d89);};}exports[_0xdd71('0x6')]=function(_0x3a06df){for(var _0x48fa17=0x0,_0x12d8a7=events[_0xdd71('0x7')];_0x48fa17<_0x12d8a7;_0x48fa17++){var _0x2b3698=events[_0x48fa17];var _0x147f9e=createListener('team:'+_0x2b3698,_0x3a06df);TeamEvents['on'](_0x2b3698,_0x147f9e);}};
\ No newline at end of file
index 848a153..9f38283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c0=['INTEGER','sequelize'];(function(_0x56c53d,_0x47c78b){var _0x12efa0=function(_0x361b5d){while(--_0x361b5d){_0x56c53d['push'](_0x56c53d['shift']());}};_0x12efa0(++_0x47c78b);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x4a0d76,_0x2d7b09){_0x4a0d76=_0x4a0d76-0x0;var _0x3dd14e=_0xe0c0[_0x4a0d76];return _0x3dd14e;};'use strict';var Sequelize=require(_0x0e0c('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x0e0c('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x0e0c('0x1')]}};
\ No newline at end of file
+var _0x5a8c=['sequelize','exports','INTEGER'];(function(_0x3be6e2,_0x5722e6){var _0x172e01=function(_0x376754){while(--_0x376754){_0x3be6e2['push'](_0x3be6e2['shift']());}};_0x172e01(++_0x5722e6);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x477611,_0x133172){_0x477611=_0x477611-0x0;var _0x4c1287=_0x5a8c[_0x477611];return _0x4c1287;};'use strict';var Sequelize=require(_0xc5a8('0x0'));module[_0xc5a8('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xc5a8('0x2')]}};
\ No newline at end of file
index 3427d79..c5e2cb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa769=['team_has_voice_prefixes','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix'];(function(_0x48b8f3,_0xdc024){var _0x52b1b9=function(_0x347e09){while(--_0x347e09){_0x48b8f3['push'](_0x48b8f3['shift']());}};_0x52b1b9(++_0xdc024);}(_0xa769,0xfb));var _0x9a76=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa769[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x9a76('0x0'));var util=require('util');var logger=require(_0x9a76('0x1'))(_0x9a76('0x2'));var moment=require(_0x9a76('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a76('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9a76('0x5'));var attributes=require(_0x9a76('0x6'));module['exports']=function(_0x24761d,_0x29af51){return _0x24761d[_0x9a76('0x7')](_0x9a76('0x8'),attributes,{'tableName':_0x9a76('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0ac0=['bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','moment'];(function(_0x179a37,_0x488fef){var _0x434a2a=function(_0x4ba230){while(--_0x4ba230){_0x179a37['push'](_0x179a37['shift']());}};_0x434a2a(++_0x488fef);}(_0x0ac0,0x130));var _0x00ac=function(_0x1b4c04,_0x8d961d){_0x1b4c04=_0x1b4c04-0x0;var _0x374f5d=_0x0ac0[_0x1b4c04];return _0x374f5d;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var logger=require(_0x00ac('0x2'))('api');var moment=require(_0x00ac('0x3'));var BPromise=require(_0x00ac('0x4'));var rp=require(_0x00ac('0x5'));var fs=require('fs');var path=require(_0x00ac('0x6'));var rimraf=require(_0x00ac('0x7'));var config=require(_0x00ac('0x8'));var attributes=require(_0x00ac('0x9'));module[_0x00ac('0xa')]=function(_0x4caaa8,_0x464817){return _0x4caaa8[_0x00ac('0xb')](_0x00ac('0xc'),attributes,{'tableName':_0x00ac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4743688..d8f3b13 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(_0x37fb3a,_0x5a14ee){var _0x1e5c8f=function(_0x4e79d1){while(--_0x4e79d1){_0x37fb3a['push'](_0x37fb3a['shift']());}};_0x1e5c8f(++_0x5a14ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x5e64aa,_0x3a5a5d){var _0x3f36da=function(_0x53bbbd){while(--_0x53bbbd){_0x5e64aa['push'](_0x5e64aa['shift']());}};_0x3f36da(++_0x3a5a5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 144ece0..884a22a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a66=['INTEGER','exports'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0x5a66,0x169));var _0x65a6=function(_0xaa7af2,_0x289bf0){_0xaa7af2=_0xaa7af2-0x0;var _0xbf48e3=_0x5a66[_0xaa7af2];return _0xbf48e3;};'use strict';var Sequelize=require('sequelize');module[_0x65a6('0x0')]={'penalty':{'type':Sequelize[_0x65a6('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4bc8=['sequelize'];(function(_0x2ae8ce,_0x2a5a1f){var _0x4bf686=function(_0x41cabf){while(--_0x41cabf){_0x2ae8ce['push'](_0x2ae8ce['shift']());}};_0x4bf686(++_0x2a5a1f);}(_0x4bc8,0xb1));var _0x84bc=function(_0x77b38,_0x4751b7){_0x77b38=_0x77b38-0x0;var _0x152c21=_0x4bc8[_0x77b38];return _0x152c21;};'use strict';var Sequelize=require(_0x84bc('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 33e7f2c..c851e46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['../../config/environment','./teamVoiceQueue.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2c4f5e,_0x2d260b){var _0x277bde=function(_0x5120ee){while(--_0x5120ee){_0x2c4f5e['push'](_0x2c4f5e['shift']());}};_0x277bde(++_0x2d260b);}(_0x81bd,0x7c));var _0xd81b=function(_0x58e389,_0x3ab426){_0x58e389=_0x58e389-0x0;var _0x1437df=_0x81bd[_0x58e389];return _0x1437df;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0bde=['request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api','bluebird'];(function(_0x29d19c,_0x373438){var _0x3bc93e=function(_0x1a4cfa){while(--_0x1a4cfa){_0x29d19c['push'](_0x29d19c['shift']());}};_0x3bc93e(++_0x373438);}(_0x0bde,0x110));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe0bd('0x0'));var util=require('util');var logger=require(_0xe0bd('0x1'))(_0xe0bd('0x2'));var moment=require('moment');var BPromise=require(_0xe0bd('0x3'));var rp=require(_0xe0bd('0x4'));var fs=require('fs');var path=require(_0xe0bd('0x5'));var rimraf=require('rimraf');var config=require(_0xe0bd('0x6'));var attributes=require(_0xe0bd('0x7'));module[_0xe0bd('0x8')]=function(_0x3a3cd2,_0x37289f){return _0x3a3cd2[_0xe0bd('0x9')](_0xe0bd('0xa'),attributes,{'tableName':_0xe0bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fdcf395..188a14b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf1b=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','jayson/promise','client','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2f503a,_0x34c790){var _0x1ca587=function(_0x5d28db){while(--_0x5d28db){_0x2f503a['push'](_0x2f503a['shift']());}};_0x1ca587(++_0x34c790);}(_0xaf1b,0x182));var _0xbaf1=function(_0x1690fe,_0x3f0412){_0x1690fe=_0x1690fe-0x0;var _0x66eede=_0xaf1b[_0x1690fe];return _0x66eede;};'use strict';var _=require(_0xbaf1('0x0'));var util=require('util');var moment=require(_0xbaf1('0x1'));var BPromise=require(_0xbaf1('0x2'));var rs=require(_0xbaf1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbaf1('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbaf1('0x5'));var client=jayson[_0xbaf1('0x6')][_0xbaf1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e4e19,_0x26a29c,_0x3a3acb){return new BPromise(function(_0x1f59b9,_0x8f5788){return client['request'](_0x5e4e19,_0x3a3acb)[_0xbaf1('0x8')](function(_0x4e8020){logger[_0xbaf1('0x9')](_0xbaf1('0xa'),_0x26a29c,_0xbaf1('0xb'));logger[_0xbaf1('0xc')](_0xbaf1('0xd'),_0x26a29c,_0xbaf1('0xb'),JSON['stringify'](_0x4e8020));if(_0x4e8020[_0xbaf1('0xe')]){if(_0x4e8020[_0xbaf1('0xe')][_0xbaf1('0xf')]===0x1f4){logger[_0xbaf1('0xe')](_0xbaf1('0xa'),_0x26a29c,_0x4e8020[_0xbaf1('0xe')][_0xbaf1('0x10')]);return _0x8f5788(_0x4e8020[_0xbaf1('0xe')][_0xbaf1('0x10')]);}logger[_0xbaf1('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x26a29c,_0x4e8020[_0xbaf1('0xe')][_0xbaf1('0x10')]);return _0x1f59b9(_0x4e8020[_0xbaf1('0xe')][_0xbaf1('0x10')]);}else{logger[_0xbaf1('0x9')]('TeamVoiceQueue,\x20%s,\x20%s',_0x26a29c,_0xbaf1('0xb'));_0x1f59b9(_0x4e8020[_0xbaf1('0x11')][_0xbaf1('0x10')]);}})[_0xbaf1('0x12')](function(_0xa5c15c){logger[_0xbaf1('0xe')](_0xbaf1('0xa'),_0x26a29c,_0xa5c15c);_0x8f5788(_0xa5c15c);});});}
\ No newline at end of file
+var _0x9314=['info','TeamVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9314,0xb2));var _0x4931=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9314[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x4931('0x0'));var util=require('util');var moment=require(_0x4931('0x1'));var BPromise=require(_0x4931('0x2'));var rs=require(_0x4931('0x3'));var fs=require('fs');var Redis=require(_0x4931('0x4'));var db=require(_0x4931('0x5'))['db'];var utils=require(_0x4931('0x6'));var logger=require(_0x4931('0x7'))(_0x4931('0x8'));var config=require(_0x4931('0x9'));var jayson=require(_0x4931('0xa'));var client=jayson['client'][_0x4931('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22feb5,_0x33e77d,_0x44df73){return new BPromise(function(_0x2ca31f,_0x3fb81b){return client[_0x4931('0xc')](_0x22feb5,_0x44df73)[_0x4931('0xd')](function(_0x3047eb){logger[_0x4931('0xe')](_0x4931('0xf'),_0x33e77d,'request\x20sent');logger[_0x4931('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x33e77d,_0x4931('0x11'),JSON[_0x4931('0x12')](_0x3047eb));if(_0x3047eb['error']){if(_0x3047eb[_0x4931('0x13')][_0x4931('0x14')]===0x1f4){logger[_0x4931('0x13')](_0x4931('0xf'),_0x33e77d,_0x3047eb[_0x4931('0x13')][_0x4931('0x15')]);return _0x3fb81b(_0x3047eb[_0x4931('0x13')][_0x4931('0x15')]);}logger[_0x4931('0x13')](_0x4931('0xf'),_0x33e77d,_0x3047eb[_0x4931('0x13')]['message']);return _0x2ca31f(_0x3047eb[_0x4931('0x13')][_0x4931('0x15')]);}else{logger[_0x4931('0xe')](_0x4931('0xf'),_0x33e77d,_0x4931('0x11'));_0x2ca31f(_0x3047eb[_0x4931('0x16')]['message']);}})[_0x4931('0x17')](function(_0x181aad){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x33e77d,_0x181aad);_0x3fb81b(_0x181aad);});});}
\ No newline at end of file
index 4e6c539..16d66ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf65d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','isAuthenticated','show','post','create','put','delete','/:id','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf65d,0x9f));var _0xdf65=function(_0x217ecd,_0x5b35da){_0x217ecd=_0x217ecd-0x0;var _0x50b480=_0xf65d[_0x217ecd];return _0x50b480;};'use strict';var multer=require(_0xdf65('0x0'));var util=require('util');var path=require(_0xdf65('0x1'));var timeout=require(_0xdf65('0x2'));var express=require(_0xdf65('0x3'));var router=express[_0xdf65('0x4')]();var fs_extra=require(_0xdf65('0x5'));var auth=require(_0xdf65('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router[_0xdf65('0x7')]('/',auth['isAuthenticated'](),controller[_0xdf65('0x8')]);router[_0xdf65('0x7')]('/:id',auth[_0xdf65('0x9')](),controller[_0xdf65('0xa')]);router[_0xdf65('0xb')]('/',auth[_0xdf65('0x9')](),controller[_0xdf65('0xc')]);router[_0xdf65('0xd')]('/:id',auth[_0xdf65('0x9')](),controller['update']);router[_0xdf65('0xe')](_0xdf65('0xf'),auth[_0xdf65('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x117c=['exports','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index','isAuthenticated','post','create','put','/:id','update','destroy'];(function(_0x3e3012,_0x46fe06){var _0x5dfc61=function(_0x4737b8){while(--_0x4737b8){_0x3e3012['push'](_0x3e3012['shift']());}};_0x5dfc61(++_0x46fe06);}(_0x117c,0x71));var _0xc117=function(_0x5db1ce,_0x57ab66){_0x5db1ce=_0x5db1ce-0x0;var _0xb62cbb=_0x117c[_0x5db1ce];return _0xb62cbb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc117('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc117('0x1'));var auth=require(_0xc117('0x2'));var interaction=require(_0xc117('0x3'));var config=require(_0xc117('0x4'));var controller=require(_0xc117('0x5'));router[_0xc117('0x6')]('/',auth['isAuthenticated'](),controller[_0xc117('0x7')]);router[_0xc117('0x6')]('/:id',auth[_0xc117('0x8')](),controller['show']);router[_0xc117('0x9')]('/',auth[_0xc117('0x8')](),controller[_0xc117('0xa')]);router[_0xc117('0xb')](_0xc117('0xc'),auth['isAuthenticated'](),controller[_0xc117('0xd')]);router['delete'](_0xc117('0xc'),auth['isAuthenticated'](),controller[_0xc117('0xe')]);module[_0xc117('0xf')]=router;
\ No newline at end of file
index 10a5422..cbf1d12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bb8=['sequelize','STRING'];(function(_0x4573bd,_0x19b9b5){var _0xc07bb9=function(_0x36a36a){while(--_0x36a36a){_0x4573bd['push'](_0x4573bd['shift']());}};_0xc07bb9(++_0x19b9b5);}(_0x9bb8,0x1f0));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x89bb('0x0'));module['exports']={'name':{'type':Sequelize[_0x89bb('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xbfe0=['exports','STRING','TEXT'];(function(_0xdc483b,_0x36babb){var _0x5caefc=function(_0x1b188a){while(--_0x1b188a){_0xdc483b['push'](_0xdc483b['shift']());}};_0x5caefc(++_0x36babb);}(_0xbfe0,0x13e));var _0x0bfe=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xbfe0[_0x511bd1];return _0x4c48ec;};'use strict';var Sequelize=require('sequelize');module[_0x0bfe('0x0')]={'name':{'type':Sequelize[_0x0bfe('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x0bfe('0x2')]}};
\ No newline at end of file
index a601cbf..8d3b4a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2890=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','Template','include','rows','catch','show','params','intersection','length','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','Templates','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters'];(function(_0x345c25,_0x11d5ec){var _0x1add66=function(_0x52f3cf){while(--_0x52f3cf){_0x345c25['push'](_0x345c25['shift']());}};_0x1add66(++_0x11d5ec);}(_0x2890,0x1c4));var _0x0289=function(_0x35aa30,_0x5e6206){_0x35aa30=_0x35aa30-0x0;var _0x127114=_0x2890[_0x35aa30];return _0x127114;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0289('0x0'));var zipdir=require(_0x0289('0x1'));var jsonpatch=require(_0x0289('0x2'));var rp=require(_0x0289('0x3'));var moment=require(_0x0289('0x4'));var BPromise=require(_0x0289('0x5'));var Mustache=require(_0x0289('0x6'));var util=require('util');var path=require(_0x0289('0x7'));var sox=require(_0x0289('0x8'));var csv=require(_0x0289('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0289('0xa'));var squel=require(_0x0289('0xb'));var crypto=require(_0x0289('0xc'));var jsforce=require(_0x0289('0xd'));var deskjs=require(_0x0289('0xe'));var toCsv=require(_0x0289('0x9'));var querystring=require('querystring');var Papa=require(_0x0289('0xf'));var Redis=require('ioredis');var authService=require(_0x0289('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0289('0x11'));var hardwareService=require(_0x0289('0x12'));var logger=require(_0x0289('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x0289('0x14'));var licenseUtil=require(_0x0289('0x15'));var db=require(_0x0289('0x16'))['db'];function respondWithStatusCode(_0x529d20,_0x133090){_0x133090=_0x133090||0xcc;return function(_0x3dd533){if(_0x3dd533){return _0x529d20[_0x0289('0x17')](_0x133090);}return _0x529d20['status'](_0x133090)[_0x0289('0x18')]();};}function respondWithResult(_0x3c9e84,_0x96c504){_0x96c504=_0x96c504||0xc8;return function(_0x52ab7c){if(_0x52ab7c){return _0x3c9e84[_0x0289('0x19')](_0x96c504)[_0x0289('0x1a')](_0x52ab7c);}};}function respondWithFilteredResult(_0x3adde6,_0x4b08a8){return function(_0x126a13){if(_0x126a13){var _0x803171=typeof _0x4b08a8[_0x0289('0x1b')]===_0x0289('0x1c')&&typeof _0x4b08a8[_0x0289('0x1d')]===_0x0289('0x1c');var _0x237bbc=_0x126a13[_0x0289('0x1e')];var _0x53517c=_0x803171?0x0:_0x4b08a8[_0x0289('0x1b')];var _0x49edd0=_0x803171?_0x126a13[_0x0289('0x1e')]:_0x4b08a8[_0x0289('0x1b')]+_0x4b08a8[_0x0289('0x1d')];var _0x184f2c;if(_0x49edd0>=_0x237bbc){_0x49edd0=_0x237bbc;_0x184f2c=0xc8;}else{_0x184f2c=0xce;}_0x3adde6[_0x0289('0x19')](_0x184f2c);return _0x3adde6[_0x0289('0x1f')](_0x0289('0x20'),_0x53517c+'-'+_0x49edd0+'/'+_0x237bbc)['json'](_0x126a13);}return null;};}function patchUpdates(_0x558eef){return function(_0x4036da){try{jsonpatch[_0x0289('0x21')](_0x4036da,_0x558eef,!![]);}catch(_0xa57647){return BPromise[_0x0289('0x22')](_0xa57647);}return _0x4036da[_0x0289('0x23')]();};}function saveUpdates(_0x1b1f84,_0x436c1f){return function(_0x3b5bff){if(_0x3b5bff){return _0x3b5bff[_0x0289('0x24')](_0x1b1f84)[_0x0289('0x25')](function(_0x151c08){return _0x151c08;});}return null;};}function removeEntity(_0x99d88a,_0x148c48){return function(_0x11e469){if(_0x11e469){return _0x11e469['destroy']()[_0x0289('0x25')](function(){var _0x23f50c=_0x11e469['get']({'plain':!![]});var _0x2af51a=_0x0289('0x26');return db[_0x0289('0x27')][_0x0289('0x28')]({'where':{'type':_0x2af51a,'resourceId':_0x23f50c['id']}})[_0x0289('0x25')](function(){return _0x11e469;});})[_0x0289('0x25')](function(){_0x99d88a['status'](0xcc)[_0x0289('0x18')]();});}};}function handleEntityNotFound(_0x124df8,_0x2a15ed){return function(_0xde3815){if(!_0xde3815){_0x124df8['sendStatus'](0x194);}return _0xde3815;};}function handleError(_0x12e4c2,_0x3ec370){_0x3ec370=_0x3ec370||0x1f4;return function(_0x2e5b5c){logger[_0x0289('0x29')](_0x2e5b5c['stack']);if(_0x2e5b5c[_0x0289('0x2a')]){delete _0x2e5b5c['name'];}_0x12e4c2['status'](_0x3ec370)[_0x0289('0x2b')](_0x2e5b5c);};}exports[_0x0289('0x2c')]=function(_0x1e8331,_0x220820){var _0x35bb72={},_0x452d5a={},_0x409239={'count':0x0,'rows':[]};var _0x3922c1=_[_0x0289('0x2d')](db['Template'][_0x0289('0x2e')],function(_0x52d02f){return{'name':_0x52d02f[_0x0289('0x2f')],'type':_0x52d02f['type']['key']};});_0x452d5a[_0x0289('0x30')]=_[_0x0289('0x2d')](_0x3922c1,_0x0289('0x2a'));_0x452d5a[_0x0289('0x31')]=_[_0x0289('0x32')](_0x1e8331[_0x0289('0x31')]);_0x452d5a[_0x0289('0x33')]=_['intersection'](_0x452d5a[_0x0289('0x30')],_0x452d5a['query']);_0x35bb72[_0x0289('0x34')]=_['intersection'](_0x452d5a[_0x0289('0x30')],qs[_0x0289('0x35')](_0x1e8331['query'][_0x0289('0x35')]));_0x35bb72[_0x0289('0x34')]=_0x35bb72[_0x0289('0x34')]['length']?_0x35bb72[_0x0289('0x34')]:_0x452d5a[_0x0289('0x30')];if(!_0x1e8331['query'][_0x0289('0x36')](_0x0289('0x37'))){_0x35bb72[_0x0289('0x1d')]=qs[_0x0289('0x1d')](_0x1e8331[_0x0289('0x31')][_0x0289('0x1d')]);_0x35bb72[_0x0289('0x1b')]=qs[_0x0289('0x1b')](_0x1e8331['query'][_0x0289('0x1b')]);}_0x35bb72[_0x0289('0x38')]=qs['sort'](_0x1e8331[_0x0289('0x31')][_0x0289('0x39')]);_0x35bb72[_0x0289('0x3a')]=qs[_0x0289('0x33')](_[_0x0289('0x3b')](_0x1e8331[_0x0289('0x31')],_0x452d5a['filters']),_0x3922c1);if(_0x1e8331[_0x0289('0x31')][_0x0289('0x3c')]){_0x35bb72['where']=_[_0x0289('0x3d')](_0x35bb72['where'],{'$or':_[_0x0289('0x2d')](_0x3922c1,function(_0x5ae3cd){if(_0x5ae3cd[_0x0289('0x3e')]!=='VIRTUAL'){var _0x5ae4f3={};_0x5ae4f3[_0x5ae3cd[_0x0289('0x2a')]]={'$like':'%'+_0x1e8331[_0x0289('0x31')][_0x0289('0x3c')]+'%'};return _0x5ae4f3;}})});}_0x35bb72=_['merge']({},_0x35bb72,_0x1e8331[_0x0289('0x3f')]);var _0x51b31a={'where':_0x35bb72[_0x0289('0x3a')]};return db[_0x0289('0x40')][_0x0289('0x1e')](_0x51b31a)['then'](function(_0x471df0){_0x409239[_0x0289('0x1e')]=_0x471df0;if(_0x1e8331[_0x0289('0x31')]['includeAll']){_0x35bb72[_0x0289('0x41')]=[{'all':!![]}];}return db[_0x0289('0x40')]['findAll'](_0x35bb72);})[_0x0289('0x25')](function(_0x13538a){_0x409239[_0x0289('0x42')]=_0x13538a;return _0x409239;})[_0x0289('0x25')](respondWithFilteredResult(_0x220820,_0x35bb72))[_0x0289('0x43')](handleError(_0x220820,null));};exports[_0x0289('0x44')]=function(_0x1c37eb,_0x39ad25){var _0x3a23e1={'raw':!![],'where':{'id':_0x1c37eb[_0x0289('0x45')]['id']}},_0x434663={};_0x434663[_0x0289('0x30')]=_[_0x0289('0x32')](db[_0x0289('0x40')][_0x0289('0x2e')]);_0x434663['query']=_['keys'](_0x1c37eb['query']);_0x434663[_0x0289('0x33')]=_[_0x0289('0x46')](_0x434663[_0x0289('0x30')],_0x434663[_0x0289('0x31')]);_0x3a23e1[_0x0289('0x34')]=_[_0x0289('0x46')](_0x434663[_0x0289('0x30')],qs['fields'](_0x1c37eb['query'][_0x0289('0x35')]));_0x3a23e1[_0x0289('0x34')]=_0x3a23e1[_0x0289('0x34')][_0x0289('0x47')]?_0x3a23e1['attributes']:_0x434663[_0x0289('0x30')];if(_0x1c37eb[_0x0289('0x31')][_0x0289('0x48')]){_0x3a23e1[_0x0289('0x41')]=[{'all':!![]}];}_0x3a23e1=_[_0x0289('0x3d')]({},_0x3a23e1,_0x1c37eb['options']);return db[_0x0289('0x40')]['find'](_0x3a23e1)[_0x0289('0x25')](handleEntityNotFound(_0x39ad25,null))[_0x0289('0x25')](respondWithResult(_0x39ad25,null))[_0x0289('0x43')](handleError(_0x39ad25,null));};exports[_0x0289('0x49')]=function(_0x217f83,_0x2d3f84){return db[_0x0289('0x40')]['create'](_0x217f83[_0x0289('0x4a')],{})['then'](function(_0x15d9d5){var _0x58ee26=_0x217f83[_0x0289('0x4b')][_0x0289('0x4c')]({'plain':!![]});if(!_0x58ee26)throw new Error(_0x0289('0x4d'));if(_0x58ee26[_0x0289('0x4e')]===_0x0289('0x4b')){var _0x363224=_0x15d9d5['get']({'plain':!![]});var _0x3516f2=_0x0289('0x26');return db[_0x0289('0x4f')]['find']({'where':{'name':_0x3516f2,'userProfileId':_0x58ee26[_0x0289('0x50')]},'raw':!![]})[_0x0289('0x25')](function(_0x4eb579){if(_0x4eb579&&_0x4eb579[_0x0289('0x51')]===0x0){return db[_0x0289('0x27')][_0x0289('0x49')]({'name':_0x363224[_0x0289('0x2a')],'resourceId':_0x363224['id'],'type':_0x4eb579[_0x0289('0x2a')],'sectionId':_0x4eb579['id']},{})[_0x0289('0x25')](function(){return _0x15d9d5;});}else{return _0x15d9d5;}})[_0x0289('0x43')](function(_0x24b360){logger['error'](_0x0289('0x52'),_0x24b360);throw _0x24b360;});}return _0x15d9d5;})[_0x0289('0x25')](respondWithResult(_0x2d3f84,0xc9))['catch'](handleError(_0x2d3f84,null));};exports[_0x0289('0x24')]=function(_0xfb202b,_0x34722c){if(_0xfb202b['body']['id']){delete _0xfb202b[_0x0289('0x4a')]['id'];}return db['Template']['find']({'where':{'id':_0xfb202b['params']['id']}})[_0x0289('0x25')](handleEntityNotFound(_0x34722c,null))[_0x0289('0x25')](saveUpdates(_0xfb202b['body'],null))[_0x0289('0x25')](respondWithResult(_0x34722c,null))[_0x0289('0x43')](handleError(_0x34722c,null));};exports[_0x0289('0x28')]=function(_0x143e96,_0x50be71){return db[_0x0289('0x40')][_0x0289('0x53')]({'where':{'id':_0x143e96['params']['id']}})[_0x0289('0x25')](handleEntityNotFound(_0x50be71,null))['then'](removeEntity(_0x50be71,null))[_0x0289('0x43')](handleError(_0x50be71,null));};
\ No newline at end of file
+var _0xe508=['mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','get','Templates','end','stack','send','index','map','Template','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','merge','options','where','includeAll','include','rows','show','params','find','catch','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','bluebird'];(function(_0x17d894,_0x3ab3b4){var _0x2a5095=function(_0x5ce82a){while(--_0x5ce82a){_0x17d894['push'](_0x17d894['shift']());}};_0x2a5095(++_0x3ab3b4);}(_0xe508,0x144));var _0x8e50=function(_0x274015,_0x589d27){_0x274015=_0x274015-0x0;var _0x2ce359=_0xe508[_0x274015];return _0x2ce359;};'use strict';var emlformat=require(_0x8e50('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8e50('0x1'));var rp=require(_0x8e50('0x2'));var moment=require('moment');var BPromise=require(_0x8e50('0x3'));var Mustache=require(_0x8e50('0x4'));var util=require(_0x8e50('0x5'));var path=require(_0x8e50('0x6'));var sox=require(_0x8e50('0x7'));var csv=require(_0x8e50('0x8'));var ejs=require(_0x8e50('0x9'));var fs=require('fs');var fs_extra=require(_0x8e50('0xa'));var _=require('lodash');var squel=require(_0x8e50('0xb'));var crypto=require(_0x8e50('0xc'));var jsforce=require(_0x8e50('0xd'));var deskjs=require(_0x8e50('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8e50('0xf'));var Papa=require(_0x8e50('0x10'));var Redis=require(_0x8e50('0x11'));var authService=require(_0x8e50('0x12'));var qs=require(_0x8e50('0x13'));var as=require(_0x8e50('0x14'));var hardwareService=require(_0x8e50('0x15'));var logger=require('../../config/logger')(_0x8e50('0x16'));var utils=require('../../config/utils');var config=require(_0x8e50('0x17'));var licenseUtil=require(_0x8e50('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f53a2,_0x205b52){_0x205b52=_0x205b52||0xcc;return function(_0x4b9498){if(_0x4b9498){return _0x5f53a2[_0x8e50('0x19')](_0x205b52);}return _0x5f53a2[_0x8e50('0x1a')](_0x205b52)['end']();};}function respondWithResult(_0x1a1c6d,_0x11d11a){_0x11d11a=_0x11d11a||0xc8;return function(_0x48ffd5){if(_0x48ffd5){return _0x1a1c6d[_0x8e50('0x1a')](_0x11d11a)['json'](_0x48ffd5);}};}function respondWithFilteredResult(_0x1ffbb9,_0x259e3c){return function(_0x50f92e){if(_0x50f92e){var _0xdf206b=typeof _0x259e3c[_0x8e50('0x1b')]==='undefined'&&typeof _0x259e3c[_0x8e50('0x1c')]===_0x8e50('0x1d');var _0x1b0a18=_0x50f92e[_0x8e50('0x1e')];var _0x31bbeb=_0xdf206b?0x0:_0x259e3c[_0x8e50('0x1b')];var _0x2bc213=_0xdf206b?_0x50f92e['count']:_0x259e3c[_0x8e50('0x1b')]+_0x259e3c[_0x8e50('0x1c')];var _0x4b7585;if(_0x2bc213>=_0x1b0a18){_0x2bc213=_0x1b0a18;_0x4b7585=0xc8;}else{_0x4b7585=0xce;}_0x1ffbb9[_0x8e50('0x1a')](_0x4b7585);return _0x1ffbb9[_0x8e50('0x1f')]('Content-Range',_0x31bbeb+'-'+_0x2bc213+'/'+_0x1b0a18)[_0x8e50('0x20')](_0x50f92e);}return null;};}function patchUpdates(_0xcd783e){return function(_0x114c6b){try{jsonpatch[_0x8e50('0x21')](_0x114c6b,_0xcd783e,!![]);}catch(_0x5f437a){return BPromise[_0x8e50('0x22')](_0x5f437a);}return _0x114c6b[_0x8e50('0x23')]();};}function saveUpdates(_0x1e563c,_0x4aaf1f){return function(_0x263cc9){if(_0x263cc9){return _0x263cc9[_0x8e50('0x24')](_0x1e563c)['then'](function(_0x2ebb1a){return _0x2ebb1a;});}return null;};}function removeEntity(_0x34ce38,_0x1352a1){return function(_0x1f5b98){if(_0x1f5b98){return _0x1f5b98[_0x8e50('0x25')]()[_0x8e50('0x26')](function(){var _0x5aa5de=_0x1f5b98[_0x8e50('0x27')]({'plain':!![]});var _0x3942fb=_0x8e50('0x28');return db['UserProfileResource'][_0x8e50('0x25')]({'where':{'type':_0x3942fb,'resourceId':_0x5aa5de['id']}})['then'](function(){return _0x1f5b98;});})['then'](function(){_0x34ce38[_0x8e50('0x1a')](0xcc)[_0x8e50('0x29')]();});}};}function handleEntityNotFound(_0x1d16aa,_0x3cb8c5){return function(_0x468745){if(!_0x468745){_0x1d16aa[_0x8e50('0x19')](0x194);}return _0x468745;};}function handleError(_0x2511e5,_0x198646){_0x198646=_0x198646||0x1f4;return function(_0x34fa5f){logger['error'](_0x34fa5f[_0x8e50('0x2a')]);if(_0x34fa5f['name']){delete _0x34fa5f['name'];}_0x2511e5[_0x8e50('0x1a')](_0x198646)[_0x8e50('0x2b')](_0x34fa5f);};}exports[_0x8e50('0x2c')]=function(_0xbd7dd9,_0x3fe34a){var _0x579d5b={},_0x31cc50={},_0x1d3d55={'count':0x0,'rows':[]};var _0x4b465b=_[_0x8e50('0x2d')](db[_0x8e50('0x2e')][_0x8e50('0x2f')],function(_0x23748e){return{'name':_0x23748e[_0x8e50('0x30')],'type':_0x23748e[_0x8e50('0x31')][_0x8e50('0x32')]};});_0x31cc50[_0x8e50('0x33')]=_[_0x8e50('0x2d')](_0x4b465b,_0x8e50('0x34'));_0x31cc50[_0x8e50('0x35')]=_[_0x8e50('0x36')](_0xbd7dd9['query']);_0x31cc50[_0x8e50('0x37')]=_['intersection'](_0x31cc50[_0x8e50('0x33')],_0x31cc50[_0x8e50('0x35')]);_0x579d5b[_0x8e50('0x38')]=_[_0x8e50('0x39')](_0x31cc50[_0x8e50('0x33')],qs[_0x8e50('0x3a')](_0xbd7dd9[_0x8e50('0x35')][_0x8e50('0x3a')]));_0x579d5b['attributes']=_0x579d5b['attributes']['length']?_0x579d5b[_0x8e50('0x38')]:_0x31cc50[_0x8e50('0x33')];if(!_0xbd7dd9[_0x8e50('0x35')]['hasOwnProperty'](_0x8e50('0x3b'))){_0x579d5b[_0x8e50('0x1c')]=qs[_0x8e50('0x1c')](_0xbd7dd9['query'][_0x8e50('0x1c')]);_0x579d5b[_0x8e50('0x1b')]=qs[_0x8e50('0x1b')](_0xbd7dd9[_0x8e50('0x35')][_0x8e50('0x1b')]);}_0x579d5b[_0x8e50('0x3c')]=qs[_0x8e50('0x3d')](_0xbd7dd9['query']['sort']);_0x579d5b['where']=qs[_0x8e50('0x37')](_[_0x8e50('0x3e')](_0xbd7dd9[_0x8e50('0x35')],_0x31cc50[_0x8e50('0x37')]),_0x4b465b);if(_0xbd7dd9[_0x8e50('0x35')][_0x8e50('0x3f')]){_0x579d5b['where']=_['merge'](_0x579d5b['where'],{'$or':_[_0x8e50('0x2d')](_0x4b465b,function(_0x2c2cf9){if(_0x2c2cf9[_0x8e50('0x31')]!=='VIRTUAL'){var _0x283065={};_0x283065[_0x2c2cf9[_0x8e50('0x34')]]={'$like':'%'+_0xbd7dd9[_0x8e50('0x35')][_0x8e50('0x3f')]+'%'};return _0x283065;}})});}_0x579d5b=_[_0x8e50('0x40')]({},_0x579d5b,_0xbd7dd9[_0x8e50('0x41')]);var _0x14da82={'where':_0x579d5b[_0x8e50('0x42')]};return db[_0x8e50('0x2e')][_0x8e50('0x1e')](_0x14da82)[_0x8e50('0x26')](function(_0x1d678e){_0x1d3d55[_0x8e50('0x1e')]=_0x1d678e;if(_0xbd7dd9[_0x8e50('0x35')][_0x8e50('0x43')]){_0x579d5b[_0x8e50('0x44')]=[{'all':!![]}];}return db[_0x8e50('0x2e')]['findAll'](_0x579d5b);})[_0x8e50('0x26')](function(_0xde6cb){_0x1d3d55[_0x8e50('0x45')]=_0xde6cb;return _0x1d3d55;})[_0x8e50('0x26')](respondWithFilteredResult(_0x3fe34a,_0x579d5b))['catch'](handleError(_0x3fe34a,null));};exports[_0x8e50('0x46')]=function(_0x4b6cbb,_0x187f60){var _0x42f948={'raw':!![],'where':{'id':_0x4b6cbb[_0x8e50('0x47')]['id']}},_0x1e745b={};_0x1e745b[_0x8e50('0x33')]=_[_0x8e50('0x36')](db[_0x8e50('0x2e')]['rawAttributes']);_0x1e745b[_0x8e50('0x35')]=_[_0x8e50('0x36')](_0x4b6cbb[_0x8e50('0x35')]);_0x1e745b[_0x8e50('0x37')]=_[_0x8e50('0x39')](_0x1e745b[_0x8e50('0x33')],_0x1e745b[_0x8e50('0x35')]);_0x42f948[_0x8e50('0x38')]=_[_0x8e50('0x39')](_0x1e745b[_0x8e50('0x33')],qs[_0x8e50('0x3a')](_0x4b6cbb[_0x8e50('0x35')][_0x8e50('0x3a')]));_0x42f948[_0x8e50('0x38')]=_0x42f948[_0x8e50('0x38')]['length']?_0x42f948[_0x8e50('0x38')]:_0x1e745b['model'];if(_0x4b6cbb[_0x8e50('0x35')][_0x8e50('0x43')]){_0x42f948['include']=[{'all':!![]}];}_0x42f948=_[_0x8e50('0x40')]({},_0x42f948,_0x4b6cbb[_0x8e50('0x41')]);return db['Template'][_0x8e50('0x48')](_0x42f948)[_0x8e50('0x26')](handleEntityNotFound(_0x187f60,null))[_0x8e50('0x26')](respondWithResult(_0x187f60,null))[_0x8e50('0x49')](handleError(_0x187f60,null));};exports[_0x8e50('0x4a')]=function(_0x3cfa2e,_0x3acca8){return db['Template']['create'](_0x3cfa2e[_0x8e50('0x4b')],{})[_0x8e50('0x26')](function(_0x50d5d4){var _0x30e38d=_0x3cfa2e[_0x8e50('0x4c')][_0x8e50('0x27')]({'plain':!![]});if(!_0x30e38d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30e38d[_0x8e50('0x4d')]===_0x8e50('0x4c')){var _0x12d4d7=_0x50d5d4[_0x8e50('0x27')]({'plain':!![]});var _0x590d73='Templates';return db[_0x8e50('0x4e')]['find']({'where':{'name':_0x590d73,'userProfileId':_0x30e38d['userProfileId']},'raw':!![]})[_0x8e50('0x26')](function(_0x48f2db){if(_0x48f2db&&_0x48f2db[_0x8e50('0x4f')]===0x0){return db[_0x8e50('0x50')][_0x8e50('0x4a')]({'name':_0x12d4d7['name'],'resourceId':_0x12d4d7['id'],'type':_0x48f2db[_0x8e50('0x34')],'sectionId':_0x48f2db['id']},{})[_0x8e50('0x26')](function(){return _0x50d5d4;});}else{return _0x50d5d4;}})[_0x8e50('0x49')](function(_0x100143){logger['error'](_0x8e50('0x51'),_0x100143);throw _0x100143;});}return _0x50d5d4;})['then'](respondWithResult(_0x3acca8,0xc9))[_0x8e50('0x49')](handleError(_0x3acca8,null));};exports[_0x8e50('0x24')]=function(_0x340e56,_0x3a5dcd){if(_0x340e56[_0x8e50('0x4b')]['id']){delete _0x340e56[_0x8e50('0x4b')]['id'];}return db['Template'][_0x8e50('0x48')]({'where':{'id':_0x340e56[_0x8e50('0x47')]['id']}})[_0x8e50('0x26')](handleEntityNotFound(_0x3a5dcd,null))[_0x8e50('0x26')](saveUpdates(_0x340e56[_0x8e50('0x4b')],null))[_0x8e50('0x26')](respondWithResult(_0x3a5dcd,null))['catch'](handleError(_0x3a5dcd,null));};exports[_0x8e50('0x25')]=function(_0x43c5af,_0x326921){return db[_0x8e50('0x2e')][_0x8e50('0x48')]({'where':{'id':_0x43c5af[_0x8e50('0x47')]['id']}})['then'](handleEntityNotFound(_0x326921,null))[_0x8e50('0x26')](removeEntity(_0x326921,null))['catch'](handleError(_0x326921,null));};
\ No newline at end of file
index 65cc7b7..f714320 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc190=['lodash','../../config/logger','bluebird','rimraf','./template.attributes','exports','Template','tools_templates'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xc190,0x180));var _0x0c19=function(_0x494a42,_0x1f2103){_0x494a42=_0x494a42-0x0;var _0x254792=_0xc190[_0x494a42];return _0x254792;};'use strict';var _=require(_0x0c19('0x0'));var util=require('util');var logger=require(_0x0c19('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0c19('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0c19('0x3'));var config=require('../../config/environment');var attributes=require(_0x0c19('0x4'));module[_0x0c19('0x5')]=function(_0x1f31f1,_0x4213da){return _0x1f31f1['define'](_0x0c19('0x6'),attributes,{'tableName':_0x0c19('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdaf7=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','./template.attributes','exports','define'];(function(_0x1f9ebb,_0x4bfd2d){var _0x3dc992=function(_0x554bd0){while(--_0x554bd0){_0x1f9ebb['push'](_0x1f9ebb['shift']());}};_0x3dc992(++_0x4bfd2d);}(_0xdaf7,0xc8));var _0x7daf=function(_0x287888,_0xc89880){_0x287888=_0x287888-0x0;var _0x430db7=_0xdaf7[_0x287888];return _0x430db7;};'use strict';var _=require(_0x7daf('0x0'));var util=require(_0x7daf('0x1'));var logger=require(_0x7daf('0x2'))(_0x7daf('0x3'));var moment=require(_0x7daf('0x4'));var BPromise=require(_0x7daf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7daf('0x6'));var config=require('../../config/environment');var attributes=require(_0x7daf('0x7'));module[_0x7daf('0x8')]=function(_0x44d124,_0x593d56){return _0x44d124[_0x7daf('0x9')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 60996a5..884f494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetTemplate','Template','findAll','options','raw','where','attributes','include','map','model','debug'];(function(_0x636977,_0x184b17){var _0x5dd2cd=function(_0x384182){while(--_0x384182){_0x636977['push'](_0x636977['shift']());}};_0x5dd2cd(++_0x184b17);}(_0xb10b,0x12a));var _0xbb10=function(_0x1bc750,_0x23f442){_0x1bc750=_0x1bc750-0x0;var _0xcd51da=_0xb10b[_0x1bc750];return _0xcd51da;};'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,'limit':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['limit']||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x407cb4){return{'model':db[_0x407cb4[_0xbb10('0x1e')]],'as':_0x407cb4['as'],'attributes':_0x407cb4[_0xbb10('0x1b')],'include':_0x407cb4[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x407cb4[_0xbb10('0x1c')],function(_0x537898){return{'model':db[_0x537898['model']],'as':_0x537898['as'],'attributes':_0x537898['attributes'],'include':_0x537898[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x537898[_0xbb10('0x1c')],function(_0x4e25ff){return{'model':db[_0x4e25ff[_0xbb10('0x1e')]],'as':_0x4e25ff['as'],'attributes':_0x4e25ff[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x1d5e95){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')]('GetTemplate',_0x378da8,JSON[_0xbb10('0x11')](_0x1d5e95));_0x575cca(_0x1d5e95);})[_0xbb10('0x20')](function(_0xfc3595){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0xfc3595[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0xfc3595[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0x5c3b=['attributes','include','map','model','GetTemplate','debug','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','findAll','options','raw','where'];(function(_0x3dc587,_0x2ebc6c){var _0x29f93a=function(_0x5ab3d4){while(--_0x5ab3d4){_0x3dc587['push'](_0x3dc587['shift']());}};_0x29f93a(++_0x2ebc6c);}(_0x5c3b,0x1d4));var _0xb5c3=function(_0x7929d8,_0x8be119){_0x7929d8=_0x7929d8-0x0;var _0x40ff94=_0x5c3b[_0x7929d8];return _0x40ff94;};'use strict';var _=require(_0xb5c3('0x0'));var util=require(_0xb5c3('0x1'));var moment=require(_0xb5c3('0x2'));var BPromise=require(_0xb5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb5c3('0x5'))(_0xb5c3('0x6'));var config=require(_0xb5c3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb5c3('0x8')][_0xb5c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59367c,_0x3961c8,_0x14fdba){return new BPromise(function(_0x33b44b,_0x34dc0d){return client[_0xb5c3('0xa')](_0x59367c,_0x14fdba)[_0xb5c3('0xb')](function(_0x3bf5bd){logger[_0xb5c3('0xc')](_0xb5c3('0xd'),_0x3961c8,_0xb5c3('0xe'));logger['debug'](_0xb5c3('0xf'),_0x3961c8,_0xb5c3('0xe'),JSON[_0xb5c3('0x10')](_0x3bf5bd));if(_0x3bf5bd[_0xb5c3('0x11')]){if(_0x3bf5bd[_0xb5c3('0x11')][_0xb5c3('0x12')]===0x1f4){logger[_0xb5c3('0x11')](_0xb5c3('0xd'),_0x3961c8,_0x3bf5bd['error'][_0xb5c3('0x13')]);return _0x34dc0d(_0x3bf5bd[_0xb5c3('0x11')][_0xb5c3('0x13')]);}logger[_0xb5c3('0x11')]('Template,\x20%s,\x20%s',_0x3961c8,_0x3bf5bd[_0xb5c3('0x11')]['message']);return _0x33b44b(_0x3bf5bd[_0xb5c3('0x11')][_0xb5c3('0x13')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x3961c8,_0xb5c3('0xe'));_0x33b44b(_0x3bf5bd[_0xb5c3('0x14')][_0xb5c3('0x13')]);}})[_0xb5c3('0x15')](function(_0x224fe6){logger['error'](_0xb5c3('0xd'),_0x3961c8,_0x224fe6);_0x34dc0d(_0x224fe6);});});}exports['GetTemplate']=function(_0x30e223){var _0x43fca8=this;return new Promise(function(_0x3d11d4,_0x51fc73){return db[_0xb5c3('0x16')][_0xb5c3('0x17')]({'raw':_0x30e223[_0xb5c3('0x18')]?_0x30e223[_0xb5c3('0x18')][_0xb5c3('0x19')]===undefined?!![]:![]:!![],'where':_0x30e223['options']?_0x30e223[_0xb5c3('0x18')][_0xb5c3('0x1a')]||null:null,'attributes':_0x30e223['options']?_0x30e223['options'][_0xb5c3('0x1b')]||null:null,'limit':_0x30e223[_0xb5c3('0x18')]?_0x30e223['options']['limit']||null:null,'include':_0x30e223[_0xb5c3('0x18')]?_0x30e223[_0xb5c3('0x18')][_0xb5c3('0x1c')]?_[_0xb5c3('0x1d')](_0x30e223[_0xb5c3('0x18')][_0xb5c3('0x1c')],function(_0x3e1e2e){return{'model':db[_0x3e1e2e['model']],'as':_0x3e1e2e['as'],'attributes':_0x3e1e2e[_0xb5c3('0x1b')],'include':_0x3e1e2e[_0xb5c3('0x1c')]?_[_0xb5c3('0x1d')](_0x3e1e2e[_0xb5c3('0x1c')],function(_0x58a8ef){return{'model':db[_0x58a8ef[_0xb5c3('0x1e')]],'as':_0x58a8ef['as'],'attributes':_0x58a8ef[_0xb5c3('0x1b')],'include':_0x58a8ef[_0xb5c3('0x1c')]?_[_0xb5c3('0x1d')](_0x58a8ef['include'],function(_0x84b78c){return{'model':db[_0x84b78c[_0xb5c3('0x1e')]],'as':_0x84b78c['as'],'attributes':_0x84b78c['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5c3('0xb')](function(_0x36bccb){logger['info'](_0xb5c3('0x1f'),_0x30e223);logger[_0xb5c3('0x20')](_0xb5c3('0x1f'),_0x30e223,JSON[_0xb5c3('0x10')](_0x36bccb));_0x3d11d4(_0x36bccb);})[_0xb5c3('0x15')](function(_0x31d1c6){logger[_0xb5c3('0x11')]('GetTemplate',_0x31d1c6[_0xb5c3('0x13')],_0x30e223);_0x51fc73(_0x43fca8[_0xb5c3('0x11')](0x1f4,_0x31d1c6[_0xb5c3('0x13')]));});});};
\ No newline at end of file
index 13b725c..e328703 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91c5=['create','addAnyCondition','addAction','put','delete','destroy','util','express','../../config/environment','./trigger.controller','isAuthenticated','index','/:id','show','get','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post'];(function(_0x2f09f7,_0x461707){var _0x1b266c=function(_0xbff8dc){while(--_0xbff8dc){_0x2f09f7['push'](_0x2f09f7['shift']());}};_0x1b266c(++_0x461707);}(_0x91c5,0x124));var _0x591c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x91c5[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x591c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x591c('0x1'));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(_0x591c('0x2'));var controller=require(_0x591c('0x3'));router['get']('/',auth[_0x591c('0x4')](),controller[_0x591c('0x5')]);router['get'](_0x591c('0x6'),auth['isAuthenticated'](),controller[_0x591c('0x7')]);router[_0x591c('0x8')](_0x591c('0x9'),auth[_0x591c('0x4')](),controller[_0x591c('0xa')]);router[_0x591c('0x8')](_0x591c('0xb'),auth[_0x591c('0x4')](),controller[_0x591c('0xc')]);router[_0x591c('0x8')](_0x591c('0xd'),auth[_0x591c('0x4')](),controller[_0x591c('0xe')]);router[_0x591c('0xf')]('/',auth[_0x591c('0x4')](),controller[_0x591c('0x10')]);router['post'](_0x591c('0x9'),auth[_0x591c('0x4')](),controller['addAllCondition']);router[_0x591c('0xf')](_0x591c('0xb'),auth[_0x591c('0x4')](),controller[_0x591c('0x11')]);router[_0x591c('0xf')](_0x591c('0xd'),auth[_0x591c('0x4')](),controller[_0x591c('0x12')]);router[_0x591c('0x13')]('/:id',auth[_0x591c('0x4')](),controller['update']);router[_0x591c('0x14')](_0x591c('0x6'),auth[_0x591c('0x4')](),controller[_0x591c('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x9091=['getAllConditions','getAnyConditions','/:id/actions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','/:id/all_conditions'];(function(_0x6813d2,_0x59c636){var _0x2544ac=function(_0x983382){while(--_0x983382){_0x6813d2['push'](_0x6813d2['shift']());}};_0x2544ac(++_0x59c636);}(_0x9091,0x1ed));var _0x1909=function(_0x4acda1,_0x5b0de7){_0x4acda1=_0x4acda1-0x0;var _0x439444=_0x9091[_0x4acda1];return _0x439444;};'use strict';var multer=require(_0x1909('0x0'));var util=require('util');var path=require(_0x1909('0x1'));var timeout=require('connect-timeout');var express=require(_0x1909('0x2'));var router=express['Router']();var fs_extra=require(_0x1909('0x3'));var auth=require(_0x1909('0x4'));var interaction=require(_0x1909('0x5'));var config=require('../../config/environment');var controller=require('./trigger.controller');router['get']('/',auth[_0x1909('0x6')](),controller['index']);router[_0x1909('0x7')](_0x1909('0x8'),auth[_0x1909('0x6')](),controller[_0x1909('0x9')]);router[_0x1909('0x7')](_0x1909('0xa'),auth['isAuthenticated'](),controller[_0x1909('0xb')]);router['get']('/:id/any_conditions',auth[_0x1909('0x6')](),controller[_0x1909('0xc')]);router['get'](_0x1909('0xd'),auth[_0x1909('0x6')](),controller['getActions']);router[_0x1909('0xe')]('/',auth['isAuthenticated'](),controller[_0x1909('0xf')]);router[_0x1909('0xe')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x1909('0x10')]);router[_0x1909('0xe')](_0x1909('0x11'),auth['isAuthenticated'](),controller[_0x1909('0x12')]);router[_0x1909('0xe')](_0x1909('0xd'),auth[_0x1909('0x6')](),controller[_0x1909('0x13')]);router['put'](_0x1909('0x8'),auth[_0x1909('0x6')](),controller[_0x1909('0x14')]);router[_0x1909('0x15')](_0x1909('0x8'),auth['isAuthenticated'](),controller[_0x1909('0x16')]);module[_0x1909('0x17')]=router;
\ No newline at end of file
index bf29c44..3db4a53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x889c=['STRING','BOOLEAN','sequelize','exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x889c,0x146));var _0xc889=function(_0x1f5bdf,_0x3a25ea){_0x1f5bdf=_0x1f5bdf-0x0;var _0x4ca8f1=_0x889c[_0x1f5bdf];return _0x4ca8f1;};'use strict';var Sequelize=require(_0xc889('0x0'));module[_0xc889('0x1')]={'name':{'type':Sequelize[_0xc889('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xc889('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x479e=['exports','STRING','BOOLEAN','sequelize'];(function(_0x543984,_0x251a39){var _0x183652=function(_0x410a17){while(--_0x410a17){_0x543984['push'](_0x543984['shift']());}};_0x183652(++_0x251a39);}(_0x479e,0x10f));var _0xe479=function(_0x5658c8,_0x33e423){_0x5658c8=_0x5658c8-0x0;var _0x58dc90=_0x479e[_0x5658c8];return _0x58dc90;};'use strict';var Sequelize=require(_0xe479('0x0'));module[_0xe479('0x1')]={'name':{'type':Sequelize[_0xe479('0x2')]},'channel':{'type':Sequelize[_0xe479('0x2')]},'description':{'type':Sequelize[_0xe479('0x2')]},'status':{'type':Sequelize[_0xe479('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 421d78a..9949a4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x110b=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','TriggerAnyId','Condition','getAllConditions','findOne','hasOwnProperty','getAnyConditions','nolimit','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','error','stack','name','send','map','Trigger','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','findAll','rows','catch','params','include','options','find','create','body'];(function(_0xa6b25e,_0x41dc8b){var _0x55daf4=function(_0x222a50){while(--_0x222a50){_0xa6b25e['push'](_0xa6b25e['shift']());}};_0x55daf4(++_0x41dc8b);}(_0x110b,0x75));var _0xb110=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x110b[_0x13b02f];return _0x12e9a6;};'use strict';var emlformat=require(_0xb110('0x0'));var rimraf=require(_0xb110('0x1'));var zipdir=require(_0xb110('0x2'));var jsonpatch=require(_0xb110('0x3'));var rp=require(_0xb110('0x4'));var moment=require(_0xb110('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb110('0x6'));var sox=require(_0xb110('0x7'));var csv=require('to-csv');var ejs=require(_0xb110('0x8'));var fs=require('fs');var fs_extra=require(_0xb110('0x9'));var _=require(_0xb110('0xa'));var squel=require(_0xb110('0xb'));var crypto=require(_0xb110('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb110('0xd'));var toCsv=require(_0xb110('0xe'));var querystring=require(_0xb110('0xf'));var Papa=require(_0xb110('0x10'));var Redis=require(_0xb110('0x11'));var authService=require(_0xb110('0x12'));var qs=require(_0xb110('0x13'));var as=require(_0xb110('0x14'));var hardwareService=require(_0xb110('0x15'));var logger=require('../../config/logger')(_0xb110('0x16'));var utils=require(_0xb110('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb110('0x18'));var db=require(_0xb110('0x19'))['db'];function respondWithStatusCode(_0x4733d0,_0x47f7a1){_0x47f7a1=_0x47f7a1||0xcc;return function(_0x2753c2){if(_0x2753c2){return _0x4733d0[_0xb110('0x1a')](_0x47f7a1);}return _0x4733d0[_0xb110('0x1b')](_0x47f7a1)[_0xb110('0x1c')]();};}function respondWithResult(_0x542b45,_0x55dd1e){_0x55dd1e=_0x55dd1e||0xc8;return function(_0x5694bc){if(_0x5694bc){return _0x542b45[_0xb110('0x1b')](_0x55dd1e)[_0xb110('0x1d')](_0x5694bc);}};}function respondWithFilteredResult(_0x276801,_0x3114bc){return function(_0x44827f){if(_0x44827f){var _0x274984=typeof _0x3114bc['offset']===_0xb110('0x1e')&&typeof _0x3114bc[_0xb110('0x1f')]==='undefined';var _0x3f1008=_0x44827f['count'];var _0x59c4b3=_0x274984?0x0:_0x3114bc['offset'];var _0x10eb72=_0x274984?_0x44827f['count']:_0x3114bc[_0xb110('0x20')]+_0x3114bc[_0xb110('0x1f')];var _0x10907c;if(_0x10eb72>=_0x3f1008){_0x10eb72=_0x3f1008;_0x10907c=0xc8;}else{_0x10907c=0xce;}_0x276801[_0xb110('0x1b')](_0x10907c);return _0x276801[_0xb110('0x21')](_0xb110('0x22'),_0x59c4b3+'-'+_0x10eb72+'/'+_0x3f1008)[_0xb110('0x1d')](_0x44827f);}return null;};}function patchUpdates(_0x120c0f){return function(_0x1c089a){try{jsonpatch[_0xb110('0x23')](_0x1c089a,_0x120c0f,!![]);}catch(_0x165ef3){return BPromise[_0xb110('0x24')](_0x165ef3);}return _0x1c089a[_0xb110('0x25')]();};}function saveUpdates(_0xb3b2bf,_0x3608ca){return function(_0x719d19){if(_0x719d19){return _0x719d19[_0xb110('0x26')](_0xb3b2bf)[_0xb110('0x27')](function(_0x319057){return _0x319057;});}return null;};}function removeEntity(_0x40449e,_0x433085){return function(_0x1bd2c2){if(_0x1bd2c2){return _0x1bd2c2[_0xb110('0x28')]()[_0xb110('0x27')](function(){var _0x78d60b=_0x1bd2c2['get']({'plain':!![]});var _0xe2f0f4=_0xb110('0x29');return db[_0xb110('0x2a')][_0xb110('0x28')]({'where':{'type':_0xe2f0f4,'resourceId':_0x78d60b['id']}})[_0xb110('0x27')](function(){return _0x1bd2c2;});})['then'](function(){_0x40449e[_0xb110('0x1b')](0xcc)[_0xb110('0x1c')]();});}};}function handleEntityNotFound(_0x40945a,_0x23341f){return function(_0x1577e7){if(!_0x1577e7){_0x40945a['sendStatus'](0x194);}return _0x1577e7;};}function handleError(_0x2e6eab,_0x5bff82){_0x5bff82=_0x5bff82||0x1f4;return function(_0x320ef6){logger[_0xb110('0x2b')](_0x320ef6[_0xb110('0x2c')]);if(_0x320ef6[_0xb110('0x2d')]){delete _0x320ef6['name'];}_0x2e6eab[_0xb110('0x1b')](_0x5bff82)[_0xb110('0x2e')](_0x320ef6);};}exports['index']=function(_0x4f11a2,_0x5171b5){var _0x23b91e={},_0x1e327e={},_0x4a90b5={'count':0x0,'rows':[]};var _0x524e5e=_[_0xb110('0x2f')](db[_0xb110('0x30')][_0xb110('0x31')],function(_0x204268){return{'name':_0x204268['fieldName'],'type':_0x204268[_0xb110('0x32')]['key']};});_0x1e327e[_0xb110('0x33')]=_[_0xb110('0x2f')](_0x524e5e,_0xb110('0x2d'));_0x1e327e[_0xb110('0x34')]=_[_0xb110('0x35')](_0x4f11a2[_0xb110('0x34')]);_0x1e327e[_0xb110('0x36')]=_[_0xb110('0x37')](_0x1e327e['model'],_0x1e327e['query']);_0x23b91e[_0xb110('0x38')]=_[_0xb110('0x37')](_0x1e327e['model'],qs[_0xb110('0x39')](_0x4f11a2['query'][_0xb110('0x39')]));_0x23b91e[_0xb110('0x38')]=_0x23b91e[_0xb110('0x38')][_0xb110('0x3a')]?_0x23b91e[_0xb110('0x38')]:_0x1e327e[_0xb110('0x33')];if(!_0x4f11a2[_0xb110('0x34')]['hasOwnProperty']('nolimit')){_0x23b91e['limit']=qs[_0xb110('0x1f')](_0x4f11a2[_0xb110('0x34')][_0xb110('0x1f')]);_0x23b91e[_0xb110('0x20')]=qs['offset'](_0x4f11a2[_0xb110('0x34')][_0xb110('0x20')]);}_0x23b91e[_0xb110('0x3b')]=qs[_0xb110('0x3c')](_0x4f11a2[_0xb110('0x34')][_0xb110('0x3c')]);_0x23b91e[_0xb110('0x3d')]=qs[_0xb110('0x36')](_[_0xb110('0x3e')](_0x4f11a2[_0xb110('0x34')],_0x1e327e['filters']),_0x524e5e);if(_0x4f11a2[_0xb110('0x34')][_0xb110('0x3f')]){_0x23b91e[_0xb110('0x3d')]=_['merge'](_0x23b91e[_0xb110('0x3d')],{'$or':_[_0xb110('0x2f')](_0x524e5e,function(_0x4663f6){if(_0x4663f6[_0xb110('0x32')]!==_0xb110('0x40')){var _0x4273ca={};_0x4273ca[_0x4663f6[_0xb110('0x2d')]]={'$like':'%'+_0x4f11a2['query'][_0xb110('0x3f')]+'%'};return _0x4273ca;}})});}_0x23b91e=_[_0xb110('0x41')]({},_0x23b91e,_0x4f11a2['options']);var _0x1662ca={'where':_0x23b91e[_0xb110('0x3d')]};return db[_0xb110('0x30')][_0xb110('0x42')](_0x1662ca)[_0xb110('0x27')](function(_0x55d3f2){_0x4a90b5['count']=_0x55d3f2;if(_0x4f11a2[_0xb110('0x34')][_0xb110('0x43')]){_0x23b91e['include']=[{'all':!![]}];}return db[_0xb110('0x30')][_0xb110('0x44')](_0x23b91e);})['then'](function(_0x3cb49e){_0x4a90b5[_0xb110('0x45')]=_0x3cb49e;return _0x4a90b5;})[_0xb110('0x27')](respondWithFilteredResult(_0x5171b5,_0x23b91e))[_0xb110('0x46')](handleError(_0x5171b5,null));};exports['show']=function(_0x45a701,_0x5938e3){var _0x11ac10={'raw':![],'where':{'id':_0x45a701[_0xb110('0x47')]['id']}},_0x14f956={};_0x14f956[_0xb110('0x33')]=_[_0xb110('0x35')](db[_0xb110('0x30')][_0xb110('0x31')]);_0x14f956[_0xb110('0x34')]=_[_0xb110('0x35')](_0x45a701[_0xb110('0x34')]);_0x14f956['filters']=_['intersection'](_0x14f956[_0xb110('0x33')],_0x14f956[_0xb110('0x34')]);_0x11ac10[_0xb110('0x38')]=_['intersection'](_0x14f956[_0xb110('0x33')],qs[_0xb110('0x39')](_0x45a701[_0xb110('0x34')][_0xb110('0x39')]));_0x11ac10[_0xb110('0x38')]=_0x11ac10['attributes'][_0xb110('0x3a')]?_0x11ac10[_0xb110('0x38')]:_0x14f956[_0xb110('0x33')];if(_0x45a701[_0xb110('0x34')][_0xb110('0x43')]){_0x11ac10[_0xb110('0x48')]=[{'all':!![]}];}_0x11ac10=_[_0xb110('0x41')]({},_0x11ac10,_0x45a701[_0xb110('0x49')]);return db[_0xb110('0x30')][_0xb110('0x4a')](_0x11ac10)[_0xb110('0x27')](handleEntityNotFound(_0x5938e3,null))[_0xb110('0x27')](respondWithResult(_0x5938e3,null))['catch'](handleError(_0x5938e3,null));};exports['create']=function(_0x5af964,_0x5b04bb){return db['Trigger'][_0xb110('0x4b')](_0x5af964[_0xb110('0x4c')],{})[_0xb110('0x27')](function(_0x17f220){var _0x397bd0=_0x5af964[_0xb110('0x4d')][_0xb110('0x4e')]({'plain':!![]});if(!_0x397bd0)throw new Error(_0xb110('0x4f'));if(_0x397bd0[_0xb110('0x50')]===_0xb110('0x4d')){var _0x3f109e=_0x17f220['get']({'plain':!![]});var _0x15e321='Triggers';return db[_0xb110('0x51')][_0xb110('0x4a')]({'where':{'name':_0x15e321,'userProfileId':_0x397bd0[_0xb110('0x52')]},'raw':!![]})[_0xb110('0x27')](function(_0x1b5135){if(_0x1b5135&&_0x1b5135[_0xb110('0x53')]===0x0){return db['UserProfileResource'][_0xb110('0x4b')]({'name':_0x3f109e[_0xb110('0x2d')],'resourceId':_0x3f109e['id'],'type':_0x1b5135['name'],'sectionId':_0x1b5135['id']},{})[_0xb110('0x27')](function(){return _0x17f220;});}else{return _0x17f220;}})[_0xb110('0x46')](function(_0x2e6221){logger[_0xb110('0x2b')](_0xb110('0x54'),_0x2e6221);throw _0x2e6221;});}return _0x17f220;})[_0xb110('0x27')](respondWithResult(_0x5b04bb,0xc9))['catch'](handleError(_0x5b04bb,null));};exports[_0xb110('0x26')]=function(_0x198486,_0xac9e3f){if(_0x198486[_0xb110('0x4c')]['id']){delete _0x198486[_0xb110('0x4c')]['id'];}return db[_0xb110('0x30')][_0xb110('0x4a')]({'where':{'id':_0x198486[_0xb110('0x47')]['id']}})['then'](handleEntityNotFound(_0xac9e3f,null))['then'](saveUpdates(_0x198486[_0xb110('0x4c')],null))['then'](respondWithResult(_0xac9e3f,null))[_0xb110('0x46')](handleError(_0xac9e3f,null));};exports[_0xb110('0x28')]=function(_0x59870d,_0x53233f){return db['Trigger'][_0xb110('0x4a')]({'where':{'id':_0x59870d[_0xb110('0x47')]['id']}})[_0xb110('0x27')](handleEntityNotFound(_0x53233f,null))[_0xb110('0x27')](removeEntity(_0x53233f,null))[_0xb110('0x46')](handleError(_0x53233f,null));};exports[_0xb110('0x55')]=function(_0x8ea537,_0x2f1e55,_0x43425b){if(_0x8ea537[_0xb110('0x4c')]['id']){delete _0x8ea537[_0xb110('0x4c')]['id'];}return db[_0xb110('0x30')]['find']({'where':{'id':_0x8ea537[_0xb110('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f1e55,null))[_0xb110('0x27')](function(_0x5422d6){if(_0x5422d6){_0x8ea537[_0xb110('0x4c')][_0xb110('0x56')]=_0x5422d6['id'];return db['Condition'][_0xb110('0x4b')](_0x8ea537[_0xb110('0x4c')]);}})[_0xb110('0x27')](respondWithResult(_0x2f1e55,null))['catch'](handleError(_0x2f1e55,null));};exports['addAnyCondition']=function(_0x329dd6,_0x28d586,_0x233fb8){if(_0x329dd6['body']['id']){delete _0x329dd6[_0xb110('0x4c')]['id'];}return db[_0xb110('0x30')]['find']({'where':{'id':_0x329dd6[_0xb110('0x47')]['id']}})[_0xb110('0x27')](handleEntityNotFound(_0x28d586,null))[_0xb110('0x27')](function(_0x12be25){if(_0x12be25){_0x329dd6[_0xb110('0x4c')][_0xb110('0x57')]=_0x12be25['id'];return db[_0xb110('0x58')][_0xb110('0x4b')](_0x329dd6[_0xb110('0x4c')]);}})[_0xb110('0x27')](respondWithResult(_0x28d586,null))[_0xb110('0x46')](handleError(_0x28d586,null));};exports[_0xb110('0x59')]=function(_0x365b25,_0x1ac5a5,_0x5b191a){var _0x2e7faa={};var _0x255616={};var _0x3dc7a7;var _0x2377fe;return db[_0xb110('0x30')][_0xb110('0x5a')]({'where':{'id':_0x365b25[_0xb110('0x47')]['id']}})[_0xb110('0x27')](handleEntityNotFound(_0x1ac5a5,null))[_0xb110('0x27')](function(_0x9b7dd3){if(_0x9b7dd3){_0x3dc7a7=_0x9b7dd3;_0x255616[_0xb110('0x33')]=_[_0xb110('0x35')](db[_0xb110('0x58')][_0xb110('0x31')]);_0x255616['query']=_[_0xb110('0x35')](_0x365b25['query']);_0x255616['filters']=_['intersection'](_0x255616[_0xb110('0x33')],_0x255616['query']);_0x2e7faa['attributes']=_[_0xb110('0x37')](_0x255616[_0xb110('0x33')],qs[_0xb110('0x39')](_0x365b25[_0xb110('0x34')]['fields']));_0x2e7faa[_0xb110('0x38')]=_0x2e7faa[_0xb110('0x38')][_0xb110('0x3a')]?_0x2e7faa[_0xb110('0x38')]:_0x255616['model'];_0x2e7faa['order']=qs[_0xb110('0x3c')](_0x365b25[_0xb110('0x34')][_0xb110('0x3c')]);_0x2e7faa[_0xb110('0x3d')]=qs[_0xb110('0x36')](_[_0xb110('0x3e')](_0x365b25[_0xb110('0x34')],_0x255616[_0xb110('0x36')]));if(_0x365b25[_0xb110('0x34')][_0xb110('0x3f')]){_0x2e7faa[_0xb110('0x3d')]=_[_0xb110('0x41')](_0x2e7faa[_0xb110('0x3d')],{'$or':_['map'](_0x2e7faa['attributes'],function(_0x5712c8){var _0x466f20={};_0x466f20[_0x5712c8]={'$like':'%'+_0x365b25['query'][_0xb110('0x3f')]+'%'};return _0x466f20;})});}_0x2e7faa=_[_0xb110('0x41')]({},_0x2e7faa,_0x365b25[_0xb110('0x49')]);return _0x3dc7a7[_0xb110('0x59')](_0x2e7faa);}})[_0xb110('0x27')](function(_0x5caf8c){if(_0x5caf8c){_0x2377fe=_0x5caf8c['length'];if(!_0x365b25[_0xb110('0x34')][_0xb110('0x5b')]('nolimit')){_0x2e7faa[_0xb110('0x1f')]=qs['limit'](_0x365b25[_0xb110('0x34')][_0xb110('0x1f')]);_0x2e7faa['offset']=qs[_0xb110('0x20')](_0x365b25[_0xb110('0x34')]['offset']);}return _0x3dc7a7[_0xb110('0x59')](_0x2e7faa);}})[_0xb110('0x27')](function(_0x10eff8){if(_0x10eff8){return _0x10eff8?{'count':_0x2377fe,'rows':_0x10eff8}:null;}})['then'](respondWithResult(_0x1ac5a5,null))[_0xb110('0x46')](handleError(_0x1ac5a5,null));};exports[_0xb110('0x5c')]=function(_0x417795,_0x1725e4,_0x3381de){var _0x4ee04f={};var _0x1afb6b={};var _0xed242f;var _0x4884ad;return db[_0xb110('0x30')]['findOne']({'where':{'id':_0x417795[_0xb110('0x47')]['id']}})[_0xb110('0x27')](handleEntityNotFound(_0x1725e4,null))[_0xb110('0x27')](function(_0x1da315){if(_0x1da315){_0xed242f=_0x1da315;_0x1afb6b['model']=_['keys'](db[_0xb110('0x58')][_0xb110('0x31')]);_0x1afb6b[_0xb110('0x34')]=_[_0xb110('0x35')](_0x417795[_0xb110('0x34')]);_0x1afb6b[_0xb110('0x36')]=_[_0xb110('0x37')](_0x1afb6b[_0xb110('0x33')],_0x1afb6b[_0xb110('0x34')]);_0x4ee04f[_0xb110('0x38')]=_[_0xb110('0x37')](_0x1afb6b[_0xb110('0x33')],qs[_0xb110('0x39')](_0x417795[_0xb110('0x34')][_0xb110('0x39')]));_0x4ee04f[_0xb110('0x38')]=_0x4ee04f[_0xb110('0x38')]['length']?_0x4ee04f[_0xb110('0x38')]:_0x1afb6b[_0xb110('0x33')];_0x4ee04f['order']=qs[_0xb110('0x3c')](_0x417795[_0xb110('0x34')][_0xb110('0x3c')]);_0x4ee04f[_0xb110('0x3d')]=qs[_0xb110('0x36')](_['pick'](_0x417795[_0xb110('0x34')],_0x1afb6b[_0xb110('0x36')]));if(_0x417795[_0xb110('0x34')][_0xb110('0x3f')]){_0x4ee04f['where']=_['merge'](_0x4ee04f['where'],{'$or':_[_0xb110('0x2f')](_0x4ee04f[_0xb110('0x38')],function(_0x3fbfb0){var _0x2f4bcb={};_0x2f4bcb[_0x3fbfb0]={'$like':'%'+_0x417795[_0xb110('0x34')][_0xb110('0x3f')]+'%'};return _0x2f4bcb;})});}_0x4ee04f=_[_0xb110('0x41')]({},_0x4ee04f,_0x417795[_0xb110('0x49')]);return _0xed242f['getAnyConditions'](_0x4ee04f);}})[_0xb110('0x27')](function(_0x25429a){if(_0x25429a){_0x4884ad=_0x25429a[_0xb110('0x3a')];if(!_0x417795['query'][_0xb110('0x5b')](_0xb110('0x5d'))){_0x4ee04f['limit']=qs[_0xb110('0x1f')](_0x417795[_0xb110('0x34')][_0xb110('0x1f')]);_0x4ee04f[_0xb110('0x20')]=qs[_0xb110('0x20')](_0x417795[_0xb110('0x34')]['offset']);}return _0xed242f[_0xb110('0x5c')](_0x4ee04f);}})['then'](function(_0x481298){if(_0x481298){return _0x481298?{'count':_0x4884ad,'rows':_0x481298}:null;}})['then'](respondWithResult(_0x1725e4,null))['catch'](handleError(_0x1725e4,null));};exports[_0xb110('0x5e')]=function(_0x3568f4,_0x5824f1,_0x3efde4){if(_0x3568f4[_0xb110('0x4c')]['id']){delete _0x3568f4[_0xb110('0x4c')]['id'];}return db[_0xb110('0x30')][_0xb110('0x4a')]({'where':{'id':_0x3568f4[_0xb110('0x47')]['id']}})[_0xb110('0x27')](handleEntityNotFound(_0x5824f1,null))['then'](function(_0x410d9f){if(_0x410d9f){_0x3568f4['body']['TriggerId']=_0x410d9f['id'];return db[_0xb110('0x5f')][_0xb110('0x4b')](_0x3568f4['body']);}})[_0xb110('0x27')](respondWithResult(_0x5824f1,null))[_0xb110('0x46')](handleError(_0x5824f1,null));};exports[_0xb110('0x60')]=function(_0x39313c,_0xd72c0e,_0x3252aa){var _0x514684={};var _0x39fc01={};var _0x152c45;var _0x3b0438;return db[_0xb110('0x30')][_0xb110('0x5a')]({'where':{'id':_0x39313c[_0xb110('0x47')]['id']}})[_0xb110('0x27')](handleEntityNotFound(_0xd72c0e,null))[_0xb110('0x27')](function(_0x1a1fd1){if(_0x1a1fd1){_0x152c45=_0x1a1fd1;_0x39fc01[_0xb110('0x33')]=_[_0xb110('0x35')](db[_0xb110('0x5f')]['rawAttributes']);_0x39fc01[_0xb110('0x34')]=_[_0xb110('0x35')](_0x39313c[_0xb110('0x34')]);_0x39fc01['filters']=_[_0xb110('0x37')](_0x39fc01[_0xb110('0x33')],_0x39fc01[_0xb110('0x34')]);_0x514684['attributes']=_[_0xb110('0x37')](_0x39fc01[_0xb110('0x33')],qs[_0xb110('0x39')](_0x39313c['query'][_0xb110('0x39')]));_0x514684['attributes']=_0x514684[_0xb110('0x38')][_0xb110('0x3a')]?_0x514684[_0xb110('0x38')]:_0x39fc01[_0xb110('0x33')];_0x514684[_0xb110('0x3b')]=qs[_0xb110('0x3c')](_0x39313c[_0xb110('0x34')]['sort']);_0x514684[_0xb110('0x3d')]=qs[_0xb110('0x36')](_[_0xb110('0x3e')](_0x39313c['query'],_0x39fc01[_0xb110('0x36')]));if(_0x39313c[_0xb110('0x34')][_0xb110('0x3f')]){_0x514684[_0xb110('0x3d')]=_[_0xb110('0x41')](_0x514684['where'],{'$or':_[_0xb110('0x2f')](_0x514684[_0xb110('0x38')],function(_0x2665e1){var _0x3c2998={};_0x3c2998[_0x2665e1]={'$like':'%'+_0x39313c[_0xb110('0x34')][_0xb110('0x3f')]+'%'};return _0x3c2998;})});}_0x514684=_['merge']({},_0x514684,_0x39313c['options']);return _0x152c45[_0xb110('0x60')](_0x514684);}})[_0xb110('0x27')](function(_0x311cae){if(_0x311cae){_0x3b0438=_0x311cae['length'];if(!_0x39313c['query'][_0xb110('0x5b')](_0xb110('0x5d'))){_0x514684[_0xb110('0x1f')]=qs[_0xb110('0x1f')](_0x39313c[_0xb110('0x34')][_0xb110('0x1f')]);_0x514684[_0xb110('0x20')]=qs[_0xb110('0x20')](_0x39313c[_0xb110('0x34')][_0xb110('0x20')]);}return _0x152c45[_0xb110('0x60')](_0x514684);}})[_0xb110('0x27')](function(_0x398ecc){if(_0x398ecc){return _0x398ecc?{'count':_0x3b0438,'rows':_0x398ecc}:null;}})[_0xb110('0x27')](respondWithResult(_0xd72c0e,null))[_0xb110('0x46')](handleError(_0xd72c0e,null));};
\ No newline at end of file
+var _0x2cc9=['then','destroy','get','Triggers','UserProfileResource','error','stack','name','map','Trigger','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','hasOwnProperty','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update'];(function(_0x1dd9cf,_0x45e721){var _0x1c3716=function(_0x44ffaa){while(--_0x44ffaa){_0x1dd9cf['push'](_0x1dd9cf['shift']());}};_0x1c3716(++_0x45e721);}(_0x2cc9,0x9b));var _0x92cc=function(_0x1b283b,_0x5b12f3){_0x1b283b=_0x1b283b-0x0;var _0x2714cd=_0x2cc9[_0x1b283b];return _0x2714cd;};'use strict';var emlformat=require(_0x92cc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x92cc('0x1'));var rp=require('request-promise');var moment=require(_0x92cc('0x2'));var BPromise=require(_0x92cc('0x3'));var Mustache=require(_0x92cc('0x4'));var util=require(_0x92cc('0x5'));var path=require(_0x92cc('0x6'));var sox=require(_0x92cc('0x7'));var csv=require('to-csv');var ejs=require(_0x92cc('0x8'));var fs=require('fs');var fs_extra=require(_0x92cc('0x9'));var _=require('lodash');var squel=require(_0x92cc('0xa'));var crypto=require(_0x92cc('0xb'));var jsforce=require(_0x92cc('0xc'));var deskjs=require(_0x92cc('0xd'));var toCsv=require(_0x92cc('0xe'));var querystring=require(_0x92cc('0xf'));var Papa=require(_0x92cc('0x10'));var Redis=require(_0x92cc('0x11'));var authService=require(_0x92cc('0x12'));var qs=require(_0x92cc('0x13'));var as=require(_0x92cc('0x14'));var hardwareService=require(_0x92cc('0x15'));var logger=require(_0x92cc('0x16'))(_0x92cc('0x17'));var utils=require(_0x92cc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x92cc('0x19'));var db=require(_0x92cc('0x1a'))['db'];function respondWithStatusCode(_0x5adf7f,_0x271ee5){_0x271ee5=_0x271ee5||0xcc;return function(_0x26d870){if(_0x26d870){return _0x5adf7f[_0x92cc('0x1b')](_0x271ee5);}return _0x5adf7f[_0x92cc('0x1c')](_0x271ee5)['end']();};}function respondWithResult(_0x5e5153,_0x2c7ed9){_0x2c7ed9=_0x2c7ed9||0xc8;return function(_0x49596c){if(_0x49596c){return _0x5e5153[_0x92cc('0x1c')](_0x2c7ed9)[_0x92cc('0x1d')](_0x49596c);}};}function respondWithFilteredResult(_0x5764bf,_0x509c3e){return function(_0x2857bd){if(_0x2857bd){var _0x282962=typeof _0x509c3e['offset']===_0x92cc('0x1e')&&typeof _0x509c3e[_0x92cc('0x1f')]===_0x92cc('0x1e');var _0x70f056=_0x2857bd['count'];var _0x4f04d7=_0x282962?0x0:_0x509c3e[_0x92cc('0x20')];var _0x30e3a7=_0x282962?_0x2857bd[_0x92cc('0x21')]:_0x509c3e[_0x92cc('0x20')]+_0x509c3e[_0x92cc('0x1f')];var _0x4116f8;if(_0x30e3a7>=_0x70f056){_0x30e3a7=_0x70f056;_0x4116f8=0xc8;}else{_0x4116f8=0xce;}_0x5764bf['status'](_0x4116f8);return _0x5764bf[_0x92cc('0x22')](_0x92cc('0x23'),_0x4f04d7+'-'+_0x30e3a7+'/'+_0x70f056)['json'](_0x2857bd);}return null;};}function patchUpdates(_0x4777cd){return function(_0x33c74f){try{jsonpatch[_0x92cc('0x24')](_0x33c74f,_0x4777cd,!![]);}catch(_0x4200c2){return BPromise['reject'](_0x4200c2);}return _0x33c74f[_0x92cc('0x25')]();};}function saveUpdates(_0x34fd4c,_0x55245d){return function(_0x52c771){if(_0x52c771){return _0x52c771[_0x92cc('0x26')](_0x34fd4c)[_0x92cc('0x27')](function(_0x5c8af5){return _0x5c8af5;});}return null;};}function removeEntity(_0x3f48c3,_0x355f79){return function(_0x5ab7c4){if(_0x5ab7c4){return _0x5ab7c4[_0x92cc('0x28')]()[_0x92cc('0x27')](function(){var _0x2b176c=_0x5ab7c4[_0x92cc('0x29')]({'plain':!![]});var _0x31070c=_0x92cc('0x2a');return db[_0x92cc('0x2b')][_0x92cc('0x28')]({'where':{'type':_0x31070c,'resourceId':_0x2b176c['id']}})['then'](function(){return _0x5ab7c4;});})[_0x92cc('0x27')](function(){_0x3f48c3[_0x92cc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21a7eb,_0x71b7ed){return function(_0xbaebd3){if(!_0xbaebd3){_0x21a7eb[_0x92cc('0x1b')](0x194);}return _0xbaebd3;};}function handleError(_0x1fedc3,_0x4047bd){_0x4047bd=_0x4047bd||0x1f4;return function(_0x4b99f1){logger[_0x92cc('0x2c')](_0x4b99f1[_0x92cc('0x2d')]);if(_0x4b99f1[_0x92cc('0x2e')]){delete _0x4b99f1[_0x92cc('0x2e')];}_0x1fedc3[_0x92cc('0x1c')](_0x4047bd)['send'](_0x4b99f1);};}exports['index']=function(_0x3b1d67,_0x18c3a6){var _0x422cc9={},_0x4e354e={},_0x3a4f89={'count':0x0,'rows':[]};var _0x4a0539=_[_0x92cc('0x2f')](db[_0x92cc('0x30')][_0x92cc('0x31')],function(_0x58b02b){return{'name':_0x58b02b[_0x92cc('0x32')],'type':_0x58b02b[_0x92cc('0x33')]['key']};});_0x4e354e[_0x92cc('0x34')]=_['map'](_0x4a0539,'name');_0x4e354e[_0x92cc('0x35')]=_['keys'](_0x3b1d67[_0x92cc('0x35')]);_0x4e354e[_0x92cc('0x36')]=_[_0x92cc('0x37')](_0x4e354e[_0x92cc('0x34')],_0x4e354e[_0x92cc('0x35')]);_0x422cc9[_0x92cc('0x38')]=_[_0x92cc('0x37')](_0x4e354e[_0x92cc('0x34')],qs[_0x92cc('0x39')](_0x3b1d67['query'][_0x92cc('0x39')]));_0x422cc9[_0x92cc('0x38')]=_0x422cc9[_0x92cc('0x38')][_0x92cc('0x3a')]?_0x422cc9[_0x92cc('0x38')]:_0x4e354e[_0x92cc('0x34')];if(!_0x3b1d67[_0x92cc('0x35')]['hasOwnProperty'](_0x92cc('0x3b'))){_0x422cc9[_0x92cc('0x1f')]=qs['limit'](_0x3b1d67[_0x92cc('0x35')][_0x92cc('0x1f')]);_0x422cc9['offset']=qs[_0x92cc('0x20')](_0x3b1d67[_0x92cc('0x35')][_0x92cc('0x20')]);}_0x422cc9[_0x92cc('0x3c')]=qs[_0x92cc('0x3d')](_0x3b1d67[_0x92cc('0x35')]['sort']);_0x422cc9[_0x92cc('0x3e')]=qs[_0x92cc('0x36')](_[_0x92cc('0x3f')](_0x3b1d67[_0x92cc('0x35')],_0x4e354e[_0x92cc('0x36')]),_0x4a0539);if(_0x3b1d67[_0x92cc('0x35')][_0x92cc('0x40')]){_0x422cc9['where']=_['merge'](_0x422cc9[_0x92cc('0x3e')],{'$or':_[_0x92cc('0x2f')](_0x4a0539,function(_0x9c876){if(_0x9c876[_0x92cc('0x33')]!=='VIRTUAL'){var _0x57e0da={};_0x57e0da[_0x9c876[_0x92cc('0x2e')]]={'$like':'%'+_0x3b1d67['query']['filter']+'%'};return _0x57e0da;}})});}_0x422cc9=_[_0x92cc('0x41')]({},_0x422cc9,_0x3b1d67[_0x92cc('0x42')]);var _0xb3edee={'where':_0x422cc9['where']};return db[_0x92cc('0x30')][_0x92cc('0x21')](_0xb3edee)['then'](function(_0x52ddcb){_0x3a4f89['count']=_0x52ddcb;if(_0x3b1d67[_0x92cc('0x35')][_0x92cc('0x43')]){_0x422cc9[_0x92cc('0x44')]=[{'all':!![]}];}return db[_0x92cc('0x30')][_0x92cc('0x45')](_0x422cc9);})[_0x92cc('0x27')](function(_0x427214){_0x3a4f89[_0x92cc('0x46')]=_0x427214;return _0x3a4f89;})[_0x92cc('0x27')](respondWithFilteredResult(_0x18c3a6,_0x422cc9))[_0x92cc('0x47')](handleError(_0x18c3a6,null));};exports[_0x92cc('0x48')]=function(_0x512e8f,_0x1e1f26){var _0x5dbb2a={'raw':![],'where':{'id':_0x512e8f[_0x92cc('0x49')]['id']}},_0x4cd32b={};_0x4cd32b[_0x92cc('0x34')]=_[_0x92cc('0x4a')](db[_0x92cc('0x30')][_0x92cc('0x31')]);_0x4cd32b[_0x92cc('0x35')]=_['keys'](_0x512e8f[_0x92cc('0x35')]);_0x4cd32b['filters']=_['intersection'](_0x4cd32b['model'],_0x4cd32b[_0x92cc('0x35')]);_0x5dbb2a[_0x92cc('0x38')]=_[_0x92cc('0x37')](_0x4cd32b['model'],qs[_0x92cc('0x39')](_0x512e8f['query']['fields']));_0x5dbb2a[_0x92cc('0x38')]=_0x5dbb2a[_0x92cc('0x38')][_0x92cc('0x3a')]?_0x5dbb2a['attributes']:_0x4cd32b[_0x92cc('0x34')];if(_0x512e8f['query'][_0x92cc('0x43')]){_0x5dbb2a['include']=[{'all':!![]}];}_0x5dbb2a=_[_0x92cc('0x41')]({},_0x5dbb2a,_0x512e8f[_0x92cc('0x42')]);return db[_0x92cc('0x30')]['find'](_0x5dbb2a)[_0x92cc('0x27')](handleEntityNotFound(_0x1e1f26,null))[_0x92cc('0x27')](respondWithResult(_0x1e1f26,null))[_0x92cc('0x47')](handleError(_0x1e1f26,null));};exports[_0x92cc('0x4b')]=function(_0x2afa64,_0x1035ce){return db[_0x92cc('0x30')][_0x92cc('0x4b')](_0x2afa64[_0x92cc('0x4c')],{})[_0x92cc('0x27')](function(_0x644515){var _0x16f363=_0x2afa64[_0x92cc('0x4d')][_0x92cc('0x29')]({'plain':!![]});if(!_0x16f363)throw new Error(_0x92cc('0x4e'));if(_0x16f363[_0x92cc('0x4f')]===_0x92cc('0x4d')){var _0x17a6e3=_0x644515['get']({'plain':!![]});var _0x746676=_0x92cc('0x2a');return db['UserProfileSection'][_0x92cc('0x50')]({'where':{'name':_0x746676,'userProfileId':_0x16f363[_0x92cc('0x51')]},'raw':!![]})[_0x92cc('0x27')](function(_0x227098){if(_0x227098&&_0x227098[_0x92cc('0x52')]===0x0){return db[_0x92cc('0x2b')][_0x92cc('0x4b')]({'name':_0x17a6e3['name'],'resourceId':_0x17a6e3['id'],'type':_0x227098[_0x92cc('0x2e')],'sectionId':_0x227098['id']},{})[_0x92cc('0x27')](function(){return _0x644515;});}else{return _0x644515;}})[_0x92cc('0x47')](function(_0x53c9ac){logger[_0x92cc('0x2c')](_0x92cc('0x53'),_0x53c9ac);throw _0x53c9ac;});}return _0x644515;})[_0x92cc('0x27')](respondWithResult(_0x1035ce,0xc9))[_0x92cc('0x47')](handleError(_0x1035ce,null));};exports['update']=function(_0x441945,_0x24b2c9){if(_0x441945[_0x92cc('0x4c')]['id']){delete _0x441945[_0x92cc('0x4c')]['id'];}return db[_0x92cc('0x30')][_0x92cc('0x50')]({'where':{'id':_0x441945[_0x92cc('0x49')]['id']}})['then'](handleEntityNotFound(_0x24b2c9,null))[_0x92cc('0x27')](saveUpdates(_0x441945['body'],null))[_0x92cc('0x27')](respondWithResult(_0x24b2c9,null))[_0x92cc('0x47')](handleError(_0x24b2c9,null));};exports[_0x92cc('0x28')]=function(_0x2c24e0,_0x1606bb){return db[_0x92cc('0x30')][_0x92cc('0x50')]({'where':{'id':_0x2c24e0['params']['id']}})[_0x92cc('0x27')](handleEntityNotFound(_0x1606bb,null))[_0x92cc('0x27')](removeEntity(_0x1606bb,null))[_0x92cc('0x47')](handleError(_0x1606bb,null));};exports[_0x92cc('0x54')]=function(_0x4f913e,_0x2d5601,_0x34eced){if(_0x4f913e[_0x92cc('0x4c')]['id']){delete _0x4f913e[_0x92cc('0x4c')]['id'];}return db[_0x92cc('0x30')][_0x92cc('0x50')]({'where':{'id':_0x4f913e[_0x92cc('0x49')]['id']}})[_0x92cc('0x27')](handleEntityNotFound(_0x2d5601,null))[_0x92cc('0x27')](function(_0x758806){if(_0x758806){_0x4f913e[_0x92cc('0x4c')][_0x92cc('0x55')]=_0x758806['id'];return db[_0x92cc('0x56')]['create'](_0x4f913e[_0x92cc('0x4c')]);}})[_0x92cc('0x27')](respondWithResult(_0x2d5601,null))[_0x92cc('0x47')](handleError(_0x2d5601,null));};exports[_0x92cc('0x57')]=function(_0x196916,_0x1407f2,_0x59e779){if(_0x196916[_0x92cc('0x4c')]['id']){delete _0x196916[_0x92cc('0x4c')]['id'];}return db[_0x92cc('0x30')][_0x92cc('0x50')]({'where':{'id':_0x196916[_0x92cc('0x49')]['id']}})[_0x92cc('0x27')](handleEntityNotFound(_0x1407f2,null))['then'](function(_0x56de63){if(_0x56de63){_0x196916[_0x92cc('0x4c')][_0x92cc('0x58')]=_0x56de63['id'];return db[_0x92cc('0x56')]['create'](_0x196916[_0x92cc('0x4c')]);}})['then'](respondWithResult(_0x1407f2,null))[_0x92cc('0x47')](handleError(_0x1407f2,null));};exports[_0x92cc('0x59')]=function(_0x251d9c,_0x2e49d4,_0x4b22a9){var _0x222ee9={};var _0x3018ef={};var _0x5408f7;var _0x59ea0c;return db['Trigger'][_0x92cc('0x5a')]({'where':{'id':_0x251d9c['params']['id']}})[_0x92cc('0x27')](handleEntityNotFound(_0x2e49d4,null))[_0x92cc('0x27')](function(_0x31a03c){if(_0x31a03c){_0x5408f7=_0x31a03c;_0x3018ef['model']=_['keys'](db[_0x92cc('0x56')][_0x92cc('0x31')]);_0x3018ef['query']=_[_0x92cc('0x4a')](_0x251d9c[_0x92cc('0x35')]);_0x3018ef['filters']=_[_0x92cc('0x37')](_0x3018ef[_0x92cc('0x34')],_0x3018ef['query']);_0x222ee9[_0x92cc('0x38')]=_[_0x92cc('0x37')](_0x3018ef[_0x92cc('0x34')],qs[_0x92cc('0x39')](_0x251d9c[_0x92cc('0x35')][_0x92cc('0x39')]));_0x222ee9[_0x92cc('0x38')]=_0x222ee9[_0x92cc('0x38')]['length']?_0x222ee9['attributes']:_0x3018ef[_0x92cc('0x34')];_0x222ee9[_0x92cc('0x3c')]=qs[_0x92cc('0x3d')](_0x251d9c[_0x92cc('0x35')][_0x92cc('0x3d')]);_0x222ee9[_0x92cc('0x3e')]=qs[_0x92cc('0x36')](_[_0x92cc('0x3f')](_0x251d9c[_0x92cc('0x35')],_0x3018ef['filters']));if(_0x251d9c[_0x92cc('0x35')][_0x92cc('0x40')]){_0x222ee9['where']=_[_0x92cc('0x41')](_0x222ee9[_0x92cc('0x3e')],{'$or':_[_0x92cc('0x2f')](_0x222ee9[_0x92cc('0x38')],function(_0x5c2dee){var _0x5c6ee3={};_0x5c6ee3[_0x5c2dee]={'$like':'%'+_0x251d9c[_0x92cc('0x35')][_0x92cc('0x40')]+'%'};return _0x5c6ee3;})});}_0x222ee9=_['merge']({},_0x222ee9,_0x251d9c[_0x92cc('0x42')]);return _0x5408f7[_0x92cc('0x59')](_0x222ee9);}})[_0x92cc('0x27')](function(_0x3b3720){if(_0x3b3720){_0x59ea0c=_0x3b3720[_0x92cc('0x3a')];if(!_0x251d9c[_0x92cc('0x35')]['hasOwnProperty'](_0x92cc('0x3b'))){_0x222ee9['limit']=qs['limit'](_0x251d9c[_0x92cc('0x35')][_0x92cc('0x1f')]);_0x222ee9['offset']=qs[_0x92cc('0x20')](_0x251d9c[_0x92cc('0x35')]['offset']);}return _0x5408f7[_0x92cc('0x59')](_0x222ee9);}})[_0x92cc('0x27')](function(_0x17b68e){if(_0x17b68e){return _0x17b68e?{'count':_0x59ea0c,'rows':_0x17b68e}:null;}})[_0x92cc('0x27')](respondWithResult(_0x2e49d4,null))['catch'](handleError(_0x2e49d4,null));};exports[_0x92cc('0x5b')]=function(_0x1c200b,_0xef8b5e,_0x532726){var _0x17cdfd={};var _0x4859e8={};var _0x53e45b;var _0x5356b5;return db[_0x92cc('0x30')][_0x92cc('0x5a')]({'where':{'id':_0x1c200b[_0x92cc('0x49')]['id']}})[_0x92cc('0x27')](handleEntityNotFound(_0xef8b5e,null))['then'](function(_0x2e31d9){if(_0x2e31d9){_0x53e45b=_0x2e31d9;_0x4859e8[_0x92cc('0x34')]=_[_0x92cc('0x4a')](db[_0x92cc('0x56')]['rawAttributes']);_0x4859e8[_0x92cc('0x35')]=_[_0x92cc('0x4a')](_0x1c200b[_0x92cc('0x35')]);_0x4859e8[_0x92cc('0x36')]=_[_0x92cc('0x37')](_0x4859e8[_0x92cc('0x34')],_0x4859e8[_0x92cc('0x35')]);_0x17cdfd[_0x92cc('0x38')]=_[_0x92cc('0x37')](_0x4859e8[_0x92cc('0x34')],qs[_0x92cc('0x39')](_0x1c200b[_0x92cc('0x35')][_0x92cc('0x39')]));_0x17cdfd[_0x92cc('0x38')]=_0x17cdfd[_0x92cc('0x38')][_0x92cc('0x3a')]?_0x17cdfd[_0x92cc('0x38')]:_0x4859e8[_0x92cc('0x34')];_0x17cdfd[_0x92cc('0x3c')]=qs[_0x92cc('0x3d')](_0x1c200b[_0x92cc('0x35')][_0x92cc('0x3d')]);_0x17cdfd['where']=qs[_0x92cc('0x36')](_['pick'](_0x1c200b[_0x92cc('0x35')],_0x4859e8[_0x92cc('0x36')]));if(_0x1c200b[_0x92cc('0x35')][_0x92cc('0x40')]){_0x17cdfd[_0x92cc('0x3e')]=_['merge'](_0x17cdfd[_0x92cc('0x3e')],{'$or':_['map'](_0x17cdfd[_0x92cc('0x38')],function(_0x1f04c8){var _0x4b9c59={};_0x4b9c59[_0x1f04c8]={'$like':'%'+_0x1c200b['query'][_0x92cc('0x40')]+'%'};return _0x4b9c59;})});}_0x17cdfd=_['merge']({},_0x17cdfd,_0x1c200b[_0x92cc('0x42')]);return _0x53e45b[_0x92cc('0x5b')](_0x17cdfd);}})[_0x92cc('0x27')](function(_0x23ba3e){if(_0x23ba3e){_0x5356b5=_0x23ba3e[_0x92cc('0x3a')];if(!_0x1c200b[_0x92cc('0x35')]['hasOwnProperty'](_0x92cc('0x3b'))){_0x17cdfd[_0x92cc('0x1f')]=qs['limit'](_0x1c200b[_0x92cc('0x35')]['limit']);_0x17cdfd[_0x92cc('0x20')]=qs[_0x92cc('0x20')](_0x1c200b[_0x92cc('0x35')][_0x92cc('0x20')]);}return _0x53e45b[_0x92cc('0x5b')](_0x17cdfd);}})[_0x92cc('0x27')](function(_0x30f49e){if(_0x30f49e){return _0x30f49e?{'count':_0x5356b5,'rows':_0x30f49e}:null;}})[_0x92cc('0x27')](respondWithResult(_0xef8b5e,null))[_0x92cc('0x47')](handleError(_0xef8b5e,null));};exports[_0x92cc('0x5c')]=function(_0x5dc06a,_0x11a1c9,_0x4e3026){if(_0x5dc06a[_0x92cc('0x4c')]['id']){delete _0x5dc06a[_0x92cc('0x4c')]['id'];}return db[_0x92cc('0x30')]['find']({'where':{'id':_0x5dc06a[_0x92cc('0x49')]['id']}})[_0x92cc('0x27')](handleEntityNotFound(_0x11a1c9,null))[_0x92cc('0x27')](function(_0x4a54cf){if(_0x4a54cf){_0x5dc06a['body'][_0x92cc('0x5d')]=_0x4a54cf['id'];return db[_0x92cc('0x5e')]['create'](_0x5dc06a[_0x92cc('0x4c')]);}})['then'](respondWithResult(_0x11a1c9,null))[_0x92cc('0x47')](handleError(_0x11a1c9,null));};exports['getActions']=function(_0x34a47c,_0x4208bd,_0x5bff46){var _0x358fb9={};var _0x4a1ddd={};var _0x4f765c;var _0x283976;return db[_0x92cc('0x30')][_0x92cc('0x5a')]({'where':{'id':_0x34a47c['params']['id']}})[_0x92cc('0x27')](handleEntityNotFound(_0x4208bd,null))[_0x92cc('0x27')](function(_0x278563){if(_0x278563){_0x4f765c=_0x278563;_0x4a1ddd[_0x92cc('0x34')]=_['keys'](db[_0x92cc('0x5e')][_0x92cc('0x31')]);_0x4a1ddd[_0x92cc('0x35')]=_[_0x92cc('0x4a')](_0x34a47c[_0x92cc('0x35')]);_0x4a1ddd[_0x92cc('0x36')]=_[_0x92cc('0x37')](_0x4a1ddd[_0x92cc('0x34')],_0x4a1ddd[_0x92cc('0x35')]);_0x358fb9[_0x92cc('0x38')]=_['intersection'](_0x4a1ddd[_0x92cc('0x34')],qs[_0x92cc('0x39')](_0x34a47c[_0x92cc('0x35')][_0x92cc('0x39')]));_0x358fb9[_0x92cc('0x38')]=_0x358fb9['attributes'][_0x92cc('0x3a')]?_0x358fb9[_0x92cc('0x38')]:_0x4a1ddd[_0x92cc('0x34')];_0x358fb9['order']=qs[_0x92cc('0x3d')](_0x34a47c['query'][_0x92cc('0x3d')]);_0x358fb9[_0x92cc('0x3e')]=qs[_0x92cc('0x36')](_[_0x92cc('0x3f')](_0x34a47c[_0x92cc('0x35')],_0x4a1ddd[_0x92cc('0x36')]));if(_0x34a47c[_0x92cc('0x35')]['filter']){_0x358fb9[_0x92cc('0x3e')]=_[_0x92cc('0x41')](_0x358fb9[_0x92cc('0x3e')],{'$or':_[_0x92cc('0x2f')](_0x358fb9['attributes'],function(_0x397b27){var _0x3ff7dd={};_0x3ff7dd[_0x397b27]={'$like':'%'+_0x34a47c['query'][_0x92cc('0x40')]+'%'};return _0x3ff7dd;})});}_0x358fb9=_[_0x92cc('0x41')]({},_0x358fb9,_0x34a47c[_0x92cc('0x42')]);return _0x4f765c[_0x92cc('0x5f')](_0x358fb9);}})[_0x92cc('0x27')](function(_0x7d555e){if(_0x7d555e){_0x283976=_0x7d555e[_0x92cc('0x3a')];if(!_0x34a47c[_0x92cc('0x35')][_0x92cc('0x60')]('nolimit')){_0x358fb9['limit']=qs[_0x92cc('0x1f')](_0x34a47c[_0x92cc('0x35')]['limit']);_0x358fb9[_0x92cc('0x20')]=qs[_0x92cc('0x20')](_0x34a47c[_0x92cc('0x35')]['offset']);}return _0x4f765c['getActions'](_0x358fb9);}})['then'](function(_0x525fb0){if(_0x525fb0){return _0x525fb0?{'count':_0x283976,'rows':_0x525fb0}:null;}})[_0x92cc('0x27')](respondWithResult(_0x4208bd,null))[_0x92cc('0x47')](handleError(_0x4208bd,null));};
\ No newline at end of file
index 74f8e86..6adebaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f10=['./trigger.attributes','define','tools_triggers','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f10,0xd5));var _0x05f1=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x5f10[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0x05f1('0x0'));var util=require(_0x05f1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x05f1('0x2'));var rp=require(_0x05f1('0x3'));var fs=require('fs');var path=require(_0x05f1('0x4'));var rimraf=require(_0x05f1('0x5'));var config=require(_0x05f1('0x6'));var attributes=require(_0x05f1('0x7'));module['exports']=function(_0x126662,_0x462faa){return _0x126662[_0x05f1('0x8')]('Trigger',attributes,{'tableName':_0x05f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x41f2=['rimraf','../../config/environment','exports','define','Trigger','lodash','util','api','moment','bluebird','request-promise'];(function(_0x55bda3,_0x55fa1c){var _0x437ab0=function(_0x37a465){while(--_0x37a465){_0x55bda3['push'](_0x55bda3['shift']());}};_0x437ab0(++_0x55fa1c);}(_0x41f2,0x14f));var _0x241f=function(_0x2ac91c,_0x570686){_0x2ac91c=_0x2ac91c-0x0;var _0x13e6b0=_0x41f2[_0x2ac91c];return _0x13e6b0;};'use strict';var _=require(_0x241f('0x0'));var util=require(_0x241f('0x1'));var logger=require('../../config/logger')(_0x241f('0x2'));var moment=require(_0x241f('0x3'));var BPromise=require(_0x241f('0x4'));var rp=require(_0x241f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x241f('0x6'));var config=require(_0x241f('0x7'));var attributes=require('./trigger.attributes');module[_0x241f('0x8')]=function(_0x2e8e9f,_0x253edb){return _0x2e8e9f[_0x241f('0x9')](_0x241f('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index af1e904..5552c0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddab=['result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','ShowTrigger','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message'];(function(_0x2dde34,_0x2bda8e){var _0x3a48f8=function(_0x16ae15){while(--_0x16ae15){_0x2dde34['push'](_0x2dde34['shift']());}};_0x3a48f8(++_0x2bda8e);}(_0xddab,0x19c));var _0xbdda=function(_0x5df0d0,_0x127ee4){_0x5df0d0=_0x5df0d0-0x0;var _0x199e68=_0xddab[_0x5df0d0];return _0x199e68;};'use strict';var _=require('lodash');var util=require(_0xbdda('0x0'));var moment=require(_0xbdda('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdda('0x2'));var db=require(_0xbdda('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdda('0x4'))(_0xbdda('0x5'));var config=require(_0xbdda('0x6'));var jayson=require(_0xbdda('0x7'));var client=jayson[_0xbdda('0x8')][_0xbdda('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47a10b,_0x460e27,_0x2f4240){return new BPromise(function(_0xda7536,_0x316e2f){return client[_0xbdda('0xa')](_0x47a10b,_0x2f4240)[_0xbdda('0xb')](function(_0x1643b9){logger[_0xbdda('0xc')]('Trigger,\x20%s,\x20%s',_0x460e27,_0xbdda('0xd'));logger['debug'](_0xbdda('0xe'),_0x460e27,_0xbdda('0xd'),JSON[_0xbdda('0xf')](_0x1643b9));if(_0x1643b9[_0xbdda('0x10')]){if(_0x1643b9[_0xbdda('0x10')][_0xbdda('0x11')]===0x1f4){logger[_0xbdda('0x10')](_0xbdda('0x12'),_0x460e27,_0x1643b9[_0xbdda('0x10')]['message']);return _0x316e2f(_0x1643b9['error'][_0xbdda('0x13')]);}logger['error'](_0xbdda('0x12'),_0x460e27,_0x1643b9[_0xbdda('0x10')][_0xbdda('0x13')]);return _0xda7536(_0x1643b9[_0xbdda('0x10')]['message']);}else{logger[_0xbdda('0xc')](_0xbdda('0x12'),_0x460e27,_0xbdda('0xd'));_0xda7536(_0x1643b9[_0xbdda('0x14')][_0xbdda('0x13')]);}})[_0xbdda('0x15')](function(_0x4a123d){logger[_0xbdda('0x10')](_0xbdda('0x12'),_0x460e27,_0x4a123d);_0x316e2f(_0x4a123d);});});}exports[_0xbdda('0x16')]=function(_0x22c9ec){var _0x62a9f2=this;return new Promise(function(_0x1c5ee7,_0x4d09de){return db[_0xbdda('0x17')][_0xbdda('0x18')]({'raw':_0x22c9ec['options']?_0x22c9ec[_0xbdda('0x19')][_0xbdda('0x1a')]===undefined?!![]:![]:!![],'where':_0x22c9ec[_0xbdda('0x19')]?_0x22c9ec['options'][_0xbdda('0x1b')]||null:null,'attributes':_0x22c9ec[_0xbdda('0x19')]?_0x22c9ec[_0xbdda('0x19')][_0xbdda('0x1c')]||null:null,'limit':_0x22c9ec[_0xbdda('0x19')]?_0x22c9ec['options'][_0xbdda('0x1d')]||null:null,'include':_0x22c9ec[_0xbdda('0x19')]?_0x22c9ec[_0xbdda('0x19')][_0xbdda('0x1e')]?_[_0xbdda('0x1f')](_0x22c9ec['options'][_0xbdda('0x1e')],function(_0x3e6e83){return{'model':db[_0x3e6e83[_0xbdda('0x20')]],'as':_0x3e6e83['as'],'attributes':_0x3e6e83['attributes'],'include':_0x3e6e83['include']?_[_0xbdda('0x1f')](_0x3e6e83[_0xbdda('0x1e')],function(_0x117e02){return{'model':db[_0x117e02[_0xbdda('0x20')]],'as':_0x117e02['as'],'attributes':_0x117e02[_0xbdda('0x1c')],'include':_0x117e02[_0xbdda('0x1e')]?_[_0xbdda('0x1f')](_0x117e02['include'],function(_0x558daf){return{'model':db[_0x558daf[_0xbdda('0x20')]],'as':_0x558daf['as'],'attributes':_0x558daf[_0xbdda('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbdda('0xb')](function(_0x45fa1a){logger[_0xbdda('0xc')]('GetTrigger',_0x22c9ec);logger[_0xbdda('0x21')](_0xbdda('0x16'),_0x22c9ec,JSON['stringify'](_0x45fa1a));_0x1c5ee7(_0x45fa1a);})['catch'](function(_0x1678de){logger['error']('GetTrigger',_0x1678de['message'],_0x22c9ec);_0x4d09de(_0x62a9f2[_0xbdda('0x10')](0x1f4,_0x1678de[_0xbdda('0x13')]));});});};exports['ShowTrigger']=function(_0x29e541){var _0x54b0a2=this;return new Promise(function(_0x2ae7f0,_0x2a5a57){return db['Trigger'][_0xbdda('0x22')]({'raw':_0x29e541['options']?_0x29e541[_0xbdda('0x19')][_0xbdda('0x1a')]===undefined?!![]:![]:!![],'where':_0x29e541[_0xbdda('0x19')]?_0x29e541[_0xbdda('0x19')]['where']||null:null,'attributes':_0x29e541[_0xbdda('0x19')]?_0x29e541['options']['attributes']||null:null,'include':_0x29e541[_0xbdda('0x19')]?_0x29e541[_0xbdda('0x19')][_0xbdda('0x1e')]?_[_0xbdda('0x1f')](_0x29e541[_0xbdda('0x19')][_0xbdda('0x1e')],function(_0x18b551){return{'model':db[_0x18b551[_0xbdda('0x20')]],'as':_0x18b551['as'],'attributes':_0x18b551[_0xbdda('0x1c')],'include':_0x18b551['include']?_[_0xbdda('0x1f')](_0x18b551[_0xbdda('0x1e')],function(_0x4d4ff2){return{'model':db[_0x4d4ff2[_0xbdda('0x20')]],'as':_0x4d4ff2['as'],'attributes':_0x4d4ff2[_0xbdda('0x1c')],'include':_0x4d4ff2[_0xbdda('0x1e')]?_['map'](_0x4d4ff2[_0xbdda('0x1e')],function(_0x322db5){return{'model':db[_0x322db5[_0xbdda('0x20')]],'as':_0x322db5['as'],'attributes':_0x322db5[_0xbdda('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16e886){logger[_0xbdda('0xc')]('ShowTrigger',_0x29e541);logger['debug'](_0xbdda('0x23'),_0x29e541,JSON[_0xbdda('0xf')](_0x16e886));_0x2ae7f0(_0x16e886);})[_0xbdda('0x15')](function(_0x5f2c2b){logger[_0xbdda('0x10')](_0xbdda('0x23'),_0x5f2c2b['message'],_0x29e541);_0x2a5a57(_0x54b0a2[_0xbdda('0x10')](0x1f4,_0x5f2c2b[_0xbdda('0x13')]));});});};
\ No newline at end of file
+var _0x04ff=['../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','where','attributes','limit','include','map','model','ShowTrigger','find','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x04ff,0xa4));var _0xf04f=function(_0x16a2ad,_0xdb0e5b){_0x16a2ad=_0x16a2ad-0x0;var _0xd36f67=_0x04ff[_0x16a2ad];return _0xd36f67;};'use strict';var _=require(_0xf04f('0x0'));var util=require('util');var moment=require(_0xf04f('0x1'));var BPromise=require(_0xf04f('0x2'));var rs=require(_0xf04f('0x3'));var fs=require('fs');var Redis=require(_0xf04f('0x4'));var db=require(_0xf04f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf04f('0x6'));var jayson=require(_0xf04f('0x7'));var client=jayson[_0xf04f('0x8')][_0xf04f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f3991,_0x2e0bc3,_0x88d529){return new BPromise(function(_0xd29f2,_0x19ea8a){return client[_0xf04f('0xa')](_0x1f3991,_0x88d529)['then'](function(_0x5d0922){logger[_0xf04f('0xb')](_0xf04f('0xc'),_0x2e0bc3,_0xf04f('0xd'));logger[_0xf04f('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x2e0bc3,'request\x20sent',JSON[_0xf04f('0xf')](_0x5d0922));if(_0x5d0922['error']){if(_0x5d0922[_0xf04f('0x10')][_0xf04f('0x11')]===0x1f4){logger[_0xf04f('0x10')](_0xf04f('0xc'),_0x2e0bc3,_0x5d0922[_0xf04f('0x10')]['message']);return _0x19ea8a(_0x5d0922['error']['message']);}logger[_0xf04f('0x10')](_0xf04f('0xc'),_0x2e0bc3,_0x5d0922[_0xf04f('0x10')][_0xf04f('0x12')]);return _0xd29f2(_0x5d0922[_0xf04f('0x10')][_0xf04f('0x12')]);}else{logger[_0xf04f('0xb')]('Trigger,\x20%s,\x20%s',_0x2e0bc3,_0xf04f('0xd'));_0xd29f2(_0x5d0922[_0xf04f('0x13')][_0xf04f('0x12')]);}})[_0xf04f('0x14')](function(_0x3b2f7e){logger[_0xf04f('0x10')](_0xf04f('0xc'),_0x2e0bc3,_0x3b2f7e);_0x19ea8a(_0x3b2f7e);});});}exports[_0xf04f('0x15')]=function(_0x2b887d){var _0x6d8c05=this;return new Promise(function(_0x2ff5af,_0x311ae3){return db[_0xf04f('0x16')][_0xf04f('0x17')]({'raw':_0x2b887d['options']?_0x2b887d['options']['raw']===undefined?!![]:![]:!![],'where':_0x2b887d[_0xf04f('0x18')]?_0x2b887d[_0xf04f('0x18')][_0xf04f('0x19')]||null:null,'attributes':_0x2b887d[_0xf04f('0x18')]?_0x2b887d['options'][_0xf04f('0x1a')]||null:null,'limit':_0x2b887d[_0xf04f('0x18')]?_0x2b887d['options'][_0xf04f('0x1b')]||null:null,'include':_0x2b887d[_0xf04f('0x18')]?_0x2b887d[_0xf04f('0x18')][_0xf04f('0x1c')]?_['map'](_0x2b887d[_0xf04f('0x18')]['include'],function(_0x381a74){return{'model':db[_0x381a74['model']],'as':_0x381a74['as'],'attributes':_0x381a74['attributes'],'include':_0x381a74['include']?_[_0xf04f('0x1d')](_0x381a74[_0xf04f('0x1c')],function(_0x2ecc79){return{'model':db[_0x2ecc79[_0xf04f('0x1e')]],'as':_0x2ecc79['as'],'attributes':_0x2ecc79[_0xf04f('0x1a')],'include':_0x2ecc79[_0xf04f('0x1c')]?_[_0xf04f('0x1d')](_0x2ecc79[_0xf04f('0x1c')],function(_0x2f1105){return{'model':db[_0x2f1105['model']],'as':_0x2f1105['as'],'attributes':_0x2f1105['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f52bf){logger[_0xf04f('0xb')](_0xf04f('0x15'),_0x2b887d);logger[_0xf04f('0xe')]('GetTrigger',_0x2b887d,JSON[_0xf04f('0xf')](_0x5f52bf));_0x2ff5af(_0x5f52bf);})[_0xf04f('0x14')](function(_0x49f720){logger[_0xf04f('0x10')](_0xf04f('0x15'),_0x49f720[_0xf04f('0x12')],_0x2b887d);_0x311ae3(_0x6d8c05['error'](0x1f4,_0x49f720[_0xf04f('0x12')]));});});};exports[_0xf04f('0x1f')]=function(_0xcf655c){var _0x4d2fdb=this;return new Promise(function(_0x2dbaeb,_0xafe8e){return db[_0xf04f('0x16')][_0xf04f('0x20')]({'raw':_0xcf655c[_0xf04f('0x18')]?_0xcf655c[_0xf04f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcf655c['options']?_0xcf655c['options']['where']||null:null,'attributes':_0xcf655c[_0xf04f('0x18')]?_0xcf655c[_0xf04f('0x18')][_0xf04f('0x1a')]||null:null,'include':_0xcf655c[_0xf04f('0x18')]?_0xcf655c[_0xf04f('0x18')][_0xf04f('0x1c')]?_['map'](_0xcf655c[_0xf04f('0x18')][_0xf04f('0x1c')],function(_0x2d166d){return{'model':db[_0x2d166d[_0xf04f('0x1e')]],'as':_0x2d166d['as'],'attributes':_0x2d166d[_0xf04f('0x1a')],'include':_0x2d166d[_0xf04f('0x1c')]?_['map'](_0x2d166d[_0xf04f('0x1c')],function(_0x90d2b2){return{'model':db[_0x90d2b2['model']],'as':_0x90d2b2['as'],'attributes':_0x90d2b2['attributes'],'include':_0x90d2b2[_0xf04f('0x1c')]?_[_0xf04f('0x1d')](_0x90d2b2[_0xf04f('0x1c')],function(_0x67d797){return{'model':db[_0x67d797[_0xf04f('0x1e')]],'as':_0x67d797['as'],'attributes':_0x67d797['attributes']};}):[]};}):[]};}):[]:[]})[_0xf04f('0x21')](function(_0x538e4f){logger[_0xf04f('0xb')](_0xf04f('0x1f'),_0xcf655c);logger[_0xf04f('0xe')](_0xf04f('0x1f'),_0xcf655c,JSON[_0xf04f('0xf')](_0x538e4f));_0x2dbaeb(_0x538e4f);})[_0xf04f('0x14')](function(_0x439482){logger[_0xf04f('0x10')](_0xf04f('0x1f'),_0x439482[_0xf04f('0x12')],_0xcf655c);_0xafe8e(_0x4d2fdb['error'](0x1f4,_0x439482[_0xf04f('0x12')]));});});};
\ No newline at end of file
index f298991..27434f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8313=['/:id/clone','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','./trunk.controller','get','isAuthenticated','/:id','show','post'];(function(_0x1b6409,_0x3c7b29){var _0x428bf6=function(_0x1a53a6){while(--_0x1a53a6){_0x1b6409['push'](_0x1b6409['shift']());}};_0x428bf6(++_0x3c7b29);}(_0x8313,0x148));var _0x3831=function(_0x4cd278,_0x56bfb7){_0x4cd278=_0x4cd278-0x0;var _0x428555=_0x8313[_0x4cd278];return _0x428555;};'use strict';var multer=require(_0x3831('0x0'));var util=require(_0x3831('0x1'));var path=require(_0x3831('0x2'));var timeout=require(_0x3831('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3831('0x4'));var auth=require(_0x3831('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3831('0x6'));router[_0x3831('0x7')]('/',auth[_0x3831('0x8')](),controller['index']);router[_0x3831('0x7')](_0x3831('0x9'),auth['isAuthenticated'](),controller[_0x3831('0xa')]);router[_0x3831('0xb')](_0x3831('0xc'),auth[_0x3831('0x8')](),controller['clone']);router['post']('/',auth[_0x3831('0x8')](),controller['create']);router[_0x3831('0xd')](_0x3831('0x9'),auth[_0x3831('0x8')](),controller['update']);router[_0x3831('0xe')](_0x3831('0x9'),auth[_0x3831('0x8')](),controller[_0x3831('0xf')]);module[_0x3831('0x10')]=router;
\ No newline at end of file
+var _0xd2de=['delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','post','clone','update'];(function(_0x5f1fde,_0x88ba06){var _0x1f2447=function(_0x249c6c){while(--_0x249c6c){_0x5f1fde['push'](_0x5f1fde['shift']());}};_0x1f2447(++_0x88ba06);}(_0xd2de,0x103));var _0xed2d=function(_0x41e2fa,_0x2ed972){_0x41e2fa=_0x41e2fa-0x0;var _0x383e5c=_0xd2de[_0x41e2fa];return _0x383e5c;};'use strict';var multer=require(_0xed2d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xed2d('0x1'));var express=require(_0xed2d('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xed2d('0x3'));var config=require(_0xed2d('0x4'));var controller=require(_0xed2d('0x5'));router['get']('/',auth[_0xed2d('0x6')](),controller[_0xed2d('0x7')]);router[_0xed2d('0x8')](_0xed2d('0x9'),auth[_0xed2d('0x6')](),controller['show']);router[_0xed2d('0xa')]('/:id/clone',auth[_0xed2d('0x6')](),controller[_0xed2d('0xb')]);router[_0xed2d('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xed2d('0x9'),auth[_0xed2d('0x6')](),controller[_0xed2d('0xc')]);router[_0xed2d('0xd')](_0xed2d('0x9'),auth[_0xed2d('0x6')](),controller[_0xed2d('0xe')]);module[_0xed2d('0xf')]=router;
\ No newline at end of file
index ef959bc..2481f2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaae0=['BOOLEAN','exports','STRING','name','friend','peer','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','active','passive','update,nonat'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaae0,0x166));var _0x0aae=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xaae0[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0x0aae('0x0')]={'name':{'type':Sequelize[_0x0aae('0x1')],'allowNull':![],'unique':_0x0aae('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0aae('0x3'),'user',_0x0aae('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x0aae('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x6'),_0x0aae('0x7'),'ALLOWED_FAILED_SCREEN',_0x0aae('0x8'),_0x0aae('0x9'),_0x0aae('0xa'),_0x0aae('0xb'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x0aae('0x1')]},'md5secret':{'type':Sequelize[_0x0aae('0x1')]},'remotesecret':{'type':Sequelize[_0x0aae('0x1')]},'transport':{'type':Sequelize[_0x0aae('0x1')],'defaultValue':_0x0aae('0xc'),'set':function(_0x436c8c){this[_0x0aae('0xd')]('transport',_0x436c8c?_0x436c8c['join'](','):null);},'get':function(){return this[_0x0aae('0xe')](_0x0aae('0xf'))?this[_0x0aae('0xe')](_0x0aae('0xf'))[_0x0aae('0x10')](','):null;},'comment':_0x0aae('0x11')},'dtmfmode':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x12'),_0x0aae('0x13'),_0x0aae('0x14'),_0x0aae('0x15'),_0x0aae('0x16')),'defaultValue':_0x0aae('0x12')},'directmedia':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no',_0x0aae('0x18'),_0x0aae('0x19'),_0x0aae('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0aae('0x1')]},'directmediadeny':{'type':Sequelize[_0x0aae('0x1')]},'nat':{'type':Sequelize[_0x0aae('0x1')],'defaultValue':_0x0aae('0x1b'),'set':function(_0x7a3124){this[_0x0aae('0xd')]('nat',_0x7a3124?_0x7a3124[_0x0aae('0x1c')](','):null);},'get':function(){return this[_0x0aae('0xe')](_0x0aae('0x1d'))?this[_0x0aae('0xe')](_0x0aae('0x1d'))['split'](','):null;},'comment':_0x0aae('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x0aae('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x0aae('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0aae('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0aae('0x1')],'defaultValue':_0x0aae('0x1f')},'allow':{'type':Sequelize[_0x0aae('0x1')],'allowNull':![],'defaultValue':_0x0aae('0x20'),'set':function(_0x3b2b78){this['setDataValue'](_0x0aae('0x21'),_0x3b2b78?_0x3b2b78[_0x0aae('0x1c')](';'):_0x0aae('0x20'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue'](_0x0aae('0x21'))[_0x0aae('0x10')](';'):null;},'comment':_0x0aae('0x22')},'autoframing':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0aae('0x23'),'set':function(_0x59f26f){this[_0x0aae('0xd')]('insecure',_0x59f26f?_0x59f26f[_0x0aae('0x1c')](','):null);},'get':function(){return this[_0x0aae('0xe')](_0x0aae('0x24'))?this[_0x0aae('0xe')](_0x0aae('0x24'))[_0x0aae('0x10')](','):null;},'comment':_0x0aae('0x25')},'trustrpid':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no',_0x0aae('0x26'))},'promiscredir':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no')},'accountcode':{'type':Sequelize[_0x0aae('0x27')](0xb)},'setvar':{'type':Sequelize[_0x0aae('0x1')]},'callerid':{'type':Sequelize[_0x0aae('0x1')],'defaultValue':_0x0aae('0x28')},'amaflags':{'type':Sequelize[_0x0aae('0x1')]},'callcounter':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x0aae('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x0aae('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x0aae('0x5')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x0aae('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x0aae('0x17'),'no',_0x0aae('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0aae('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no')},'mailbox':{'type':Sequelize[_0x0aae('0x1')]},'session_timers':{'type':Sequelize[_0x0aae('0x5')]('accept',_0x0aae('0x2a'),_0x0aae('0x2b'))},'session_expires':{'type':Sequelize[_0x0aae('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x0aae('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x0aae('0x2c'),_0x0aae('0x2d')),'defaultValue':_0x0aae('0x2d')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x0aae('0x1')]},'fromdomain':{'type':Sequelize[_0x0aae('0x1')]},'fromuser':{'type':Sequelize[_0x0aae('0x1')]},'port':{'type':Sequelize[_0x0aae('0x27')](0x5)},'qualify':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0aae('0x27')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x0aae('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0aae('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0aae('0x1')]},'callbackextension':{'type':Sequelize[_0x0aae('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x0aae('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0aae('0x27')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x0aae('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x0aae('0x1')]},'maxforwards':{'type':Sequelize[_0x0aae('0x27')](0xb)},'encryption':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no')},'force_avp':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no')},'icesupport':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x0aae('0x5')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x0aae('0x5')]('yes','no',_0x0aae('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x0aae('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0aae('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x0aae('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x0aae('0x1')]},'dtlscapath':{'type':Sequelize[_0x0aae('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x0aae('0x2f'),_0x0aae('0x30'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0aae('0x1')]},'usereqphone':{'type':Sequelize[_0x0aae('0x5')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0aae('0x1')]},'recordofffeature':{'type':Sequelize[_0x0aae('0x1')]},'call_limit':{'type':Sequelize[_0x0aae('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x0aae('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x0aae('0x17'),'no')},'vmexten':{'type':Sequelize[_0x0aae('0x1')]},'mohinterpret':{'type':Sequelize[_0x0aae('0x1')]},'mohsuggest':{'type':Sequelize[_0x0aae('0x1')]},'parkinglot':{'type':Sequelize[_0x0aae('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0aae('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x0aae('0x5')](_0x0aae('0x17'),'no','nonat',_0x0aae('0x19'),_0x0aae('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0aae('0x1')]},'otherFields':{'type':Sequelize[_0x0aae('0x1')]},'active':{'type':Sequelize[_0x0aae('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0aae('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xa8e8=['sequelize','exports','name','ENUM','friend','user','peer','STRING','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','dynamic','update,nonat','BOOLEAN'];(function(_0x197a55,_0x4654ea){var _0x108330=function(_0x5917e0){while(--_0x5917e0){_0x197a55['push'](_0x197a55['shift']());}};_0x108330(++_0x4654ea);}(_0xa8e8,0x1dd));var _0x8a8e=function(_0x18175b,_0x4d7376){_0x18175b=_0x18175b-0x0;var _0x210d45=_0xa8e8[_0x18175b];return _0x210d45;};'use strict';var Sequelize=require(_0x8a8e('0x0'));module[_0x8a8e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8a8e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x4'),_0x8a8e('0x5'),_0x8a8e('0x6')),'allowNull':![],'defaultValue':_0x8a8e('0x4')},'context':{'type':Sequelize[_0x8a8e('0x7')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x8a8e('0x3')]('ALLOWED_NOT_SCREENED',_0x8a8e('0x8'),_0x8a8e('0x9'),'ALLOWED','PROHIB_NOT_SCREENED',_0x8a8e('0xa'),_0x8a8e('0xb'),_0x8a8e('0xc'))},'deny':{'type':Sequelize[_0x8a8e('0x7')]},'permit':{'type':Sequelize[_0x8a8e('0x7')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x8a8e('0xd'),'set':function(_0x1c0ddd){this[_0x8a8e('0xe')](_0x8a8e('0xf'),_0x1c0ddd?_0x1c0ddd['join'](','):null);},'get':function(){return this[_0x8a8e('0x10')](_0x8a8e('0xf'))?this[_0x8a8e('0x10')](_0x8a8e('0xf'))[_0x8a8e('0x11')](','):null;},'comment':_0x8a8e('0x12')},'dtmfmode':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x13'),_0x8a8e('0x14'),'shortinfo',_0x8a8e('0x15'),_0x8a8e('0x16')),'defaultValue':_0x8a8e('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0x8a8e('0x17'),'no',_0x8a8e('0x18'),_0x8a8e('0x19'),_0x8a8e('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x8a8e('0x7')],'defaultValue':_0x8a8e('0x1b'),'set':function(_0x446785){this[_0x8a8e('0xe')](_0x8a8e('0x1c'),_0x446785?_0x446785[_0x8a8e('0x1d')](','):null);},'get':function(){return this['getDataValue']('nat')?this['getDataValue'](_0x8a8e('0x1c'))[_0x8a8e('0x11')](','):null;},'comment':_0x8a8e('0x1e')},'callgroup':{'type':Sequelize[_0x8a8e('0x7')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x8a8e('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x8a8e('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8a8e('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8a8e('0x7')],'defaultValue':_0x8a8e('0x1f')},'allow':{'type':Sequelize[_0x8a8e('0x7')],'allowNull':![],'defaultValue':_0x8a8e('0x20'),'set':function(_0x2ae14e){this['setDataValue'](_0x8a8e('0x21'),_0x2ae14e?_0x2ae14e['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x8a8e('0x10')]('allow')?this[_0x8a8e('0x10')](_0x8a8e('0x21'))[_0x8a8e('0x11')](';'):null;},'comment':_0x8a8e('0x22')},'autoframing':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no')},'insecure':{'type':Sequelize[_0x8a8e('0x7')],'defaultValue':_0x8a8e('0x23'),'set':function(_0x503ab5){this[_0x8a8e('0xe')]('insecure',_0x503ab5?_0x503ab5[_0x8a8e('0x1d')](','):null);},'get':function(){return this[_0x8a8e('0x10')](_0x8a8e('0x24'))?this[_0x8a8e('0x10')]('insecure')[_0x8a8e('0x11')](','):null;},'comment':_0x8a8e('0x25')},'trustrpid':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no',_0x8a8e('0x26'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x8a8e('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'setvar':{'type':Sequelize[_0x8a8e('0x7')]},'callerid':{'type':Sequelize[_0x8a8e('0x7')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x8a8e('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x8a8e('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8a8e('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x8a8e('0x7')]},'template':{'type':Sequelize[_0x8a8e('0x7')]},'videosupport':{'type':Sequelize[_0x8a8e('0x3')]('yes','no',_0x8a8e('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8a8e('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x8a8e('0x7')]},'session_timers':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x29'),_0x8a8e('0x2a'),_0x8a8e('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x8a8e('0x2c'),_0x8a8e('0x2d')),'defaultValue':_0x8a8e('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0x8a8e('0x7')]},'regexten':{'type':Sequelize[_0x8a8e('0x7')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x8a8e('0x7')]},'port':{'type':Sequelize[_0x8a8e('0x27')](0x5)},'qualify':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no'),'defaultValue':_0x8a8e('0x17')},'keepalive':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x8a8e('0x7')]},'defaultuser':{'type':Sequelize[_0x8a8e('0x7')]},'rtptimeout':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no',_0x8a8e('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8a8e('0x7')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x8a8e('0x7')]},'contactdeny':{'type':Sequelize[_0x8a8e('0x7')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x8a8e('0x7')]},'maxforwards':{'type':Sequelize[_0x8a8e('0x27')](0xb)},'encryption':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no')},'force_avp':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no')},'icesupport':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no',_0x8a8e('0x2f'),_0x8a8e('0x30'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x8a8e('0x7')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x8a8e('0x7')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x8a8e('0x7')]},'dtlssetup':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x31'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x8a8e('0x3')](_0x8a8e('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8a8e('0x7')]},'recordofffeature':{'type':Sequelize[_0x8a8e('0x7')]},'call_limit':{'type':Sequelize[_0x8a8e('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8a8e('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x8a8e('0x17'),'no')},'vmexten':{'type':Sequelize[_0x8a8e('0x7')]},'mohinterpret':{'type':Sequelize[_0x8a8e('0x7')]},'mohsuggest':{'type':Sequelize[_0x8a8e('0x7')]},'parkinglot':{'type':Sequelize[_0x8a8e('0x7')]},'description':{'type':Sequelize[_0x8a8e('0x7')]},'host':{'type':Sequelize[_0x8a8e('0x7')],'defaultValue':_0x8a8e('0x32')},'canreinvite':{'type':Sequelize[_0x8a8e('0x3')]('yes','no',_0x8a8e('0x18'),_0x8a8e('0x19'),_0x8a8e('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8a8e('0x7')]},'otherFields':{'type':Sequelize[_0x8a8e('0x7')]},'active':{'type':Sequelize[_0x8a8e('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
index 810e98f..ef5273c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x3f8551,_0x3857a2){var _0x511cee=function(_0x2255a6){while(--_0x2255a6){_0x3f8551['push'](_0x3f8551['shift']());}};_0x511cee(++_0x3857a2);}(_0xe14d,0x1ee));var _0xde14=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xe14d[_0x1ddedd];return _0xa3e1ac;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));};
\ No newline at end of file
+var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x32f42e,_0x18f468){var _0x1eb1e6=function(_0x4d4c0b){while(--_0x4d4c0b){_0x32f42e['push'](_0x32f42e['shift']());}};_0x1eb1e6(++_0x18f468);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5eadb7,_0x203077){_0x5eadb7=_0x5eadb7-0x0;var _0x39aac3=_0xd6d6[_0x5eadb7];return _0x39aac3;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));};
\ No newline at end of file
index 5fd1a14..972a02a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c99=['Trunk','tools_trunks','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./trunk.attributes','exports'];(function(_0xc2c73a,_0xd07dc3){var _0x43db73=function(_0x3fdff3){while(--_0x3fdff3){_0xc2c73a['push'](_0xc2c73a['shift']());}};_0x43db73(++_0xd07dc3);}(_0x1c99,0xca));var _0x91c9=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x1c99[_0x111e94];return _0x3de107;};'use strict';var _=require('lodash');var util=require(_0x91c9('0x0'));var logger=require(_0x91c9('0x1'))(_0x91c9('0x2'));var moment=require('moment');var BPromise=require(_0x91c9('0x3'));var rp=require(_0x91c9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x91c9('0x5'));var attributes=require(_0x91c9('0x6'));module[_0x91c9('0x7')]=function(_0x45235c,_0x38cd01){return _0x45235c['define'](_0x91c9('0x8'),attributes,{'tableName':_0x91c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5815=['exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x8cf60c,_0x1280b1){var _0x294d30=function(_0x3cbcf7){while(--_0x3cbcf7){_0x8cf60c['push'](_0x8cf60c['shift']());}};_0x294d30(++_0x1280b1);}(_0x5815,0x122));var _0x5581=function(_0x33f7c6,_0xdc3c3c){_0x33f7c6=_0x33f7c6-0x0;var _0x217037=_0x5815[_0x33f7c6];return _0x217037;};'use strict';var _=require(_0x5581('0x0'));var util=require(_0x5581('0x1'));var logger=require(_0x5581('0x2'))(_0x5581('0x3'));var moment=require(_0x5581('0x4'));var BPromise=require(_0x5581('0x5'));var rp=require(_0x5581('0x6'));var fs=require('fs');var path=require(_0x5581('0x7'));var rimraf=require(_0x5581('0x8'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0x5581('0x9')]=function(_0x31caf7,_0x39560f){return _0x31caf7[_0x5581('0xa')](_0x5581('0xb'),attributes,{'tableName':_0x5581('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ae4f473..6e70ff4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b66=['Trunk','find','where','lodash','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','findAll','options','raw','limit','include','map','model','attributes','ShowTrunk'];(function(_0x107562,_0x11d62c){var _0x2d4b03=function(_0x228e36){while(--_0x228e36){_0x107562['push'](_0x107562['shift']());}};_0x2d4b03(++_0x11d62c);}(_0x5b66,0xc9));var _0x65b6=function(_0x12e351,_0x189356){_0x12e351=_0x12e351-0x0;var _0x280338=_0x5b66[_0x12e351];return _0x280338;};'use strict';var _=require(_0x65b6('0x0'));var util=require('util');var moment=require(_0x65b6('0x1'));var BPromise=require(_0x65b6('0x2'));var rs=require(_0x65b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x65b6('0x4'));var config=require(_0x65b6('0x5'));var jayson=require(_0x65b6('0x6'));var client=jayson[_0x65b6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c2ee3,_0x5f127b,_0x1e0393){return new BPromise(function(_0x5829a9,_0x2d0938){return client[_0x65b6('0x8')](_0x1c2ee3,_0x1e0393)[_0x65b6('0x9')](function(_0x44575b){logger[_0x65b6('0xa')]('Trunk,\x20%s,\x20%s',_0x5f127b,_0x65b6('0xb'));logger[_0x65b6('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5f127b,'request\x20sent',JSON[_0x65b6('0xd')](_0x44575b));if(_0x44575b[_0x65b6('0xe')]){if(_0x44575b[_0x65b6('0xe')][_0x65b6('0xf')]===0x1f4){logger[_0x65b6('0xe')](_0x65b6('0x10'),_0x5f127b,_0x44575b[_0x65b6('0xe')][_0x65b6('0x11')]);return _0x2d0938(_0x44575b[_0x65b6('0xe')][_0x65b6('0x11')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5f127b,_0x44575b[_0x65b6('0xe')][_0x65b6('0x11')]);return _0x5829a9(_0x44575b['error'][_0x65b6('0x11')]);}else{logger['info'](_0x65b6('0x10'),_0x5f127b,'request\x20sent');_0x5829a9(_0x44575b[_0x65b6('0x12')][_0x65b6('0x11')]);}})[_0x65b6('0x13')](function(_0xf805fd){logger[_0x65b6('0xe')](_0x65b6('0x10'),_0x5f127b,_0xf805fd);_0x2d0938(_0xf805fd);});});}exports[_0x65b6('0x14')]=function(_0x4def1b){var _0x330144=this;return new Promise(function(_0x498577,_0x4ab4bd){return db['Trunk'][_0x65b6('0x15')]({'raw':_0x4def1b['options']?_0x4def1b[_0x65b6('0x16')][_0x65b6('0x17')]===undefined?!![]:![]:!![],'where':_0x4def1b[_0x65b6('0x16')]?_0x4def1b[_0x65b6('0x16')]['where']||null:null,'attributes':_0x4def1b['options']?_0x4def1b['options']['attributes']||null:null,'limit':_0x4def1b['options']?_0x4def1b['options'][_0x65b6('0x18')]||null:null,'include':_0x4def1b[_0x65b6('0x16')]?_0x4def1b['options'][_0x65b6('0x19')]?_[_0x65b6('0x1a')](_0x4def1b[_0x65b6('0x16')][_0x65b6('0x19')],function(_0x596eae){return{'model':db[_0x596eae[_0x65b6('0x1b')]],'as':_0x596eae['as'],'attributes':_0x596eae['attributes'],'include':_0x596eae[_0x65b6('0x19')]?_[_0x65b6('0x1a')](_0x596eae['include'],function(_0x399a09){return{'model':db[_0x399a09['model']],'as':_0x399a09['as'],'attributes':_0x399a09[_0x65b6('0x1c')],'include':_0x399a09[_0x65b6('0x19')]?_['map'](_0x399a09['include'],function(_0x13b0f6){return{'model':db[_0x13b0f6[_0x65b6('0x1b')]],'as':_0x13b0f6['as'],'attributes':_0x13b0f6[_0x65b6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55c001){logger['info'](_0x65b6('0x14'),_0x4def1b);logger[_0x65b6('0xc')](_0x65b6('0x14'),_0x4def1b,JSON[_0x65b6('0xd')](_0x55c001));_0x498577(_0x55c001);})[_0x65b6('0x13')](function(_0x8e100b){logger[_0x65b6('0xe')](_0x65b6('0x14'),_0x8e100b[_0x65b6('0x11')],_0x4def1b);_0x4ab4bd(_0x330144[_0x65b6('0xe')](0x1f4,_0x8e100b[_0x65b6('0x11')]));});});};exports[_0x65b6('0x1d')]=function(_0x161192){var _0x1ffb40=this;return new Promise(function(_0x2fd55d,_0x15cb14){return db[_0x65b6('0x1e')][_0x65b6('0x1f')]({'raw':_0x161192[_0x65b6('0x16')]?_0x161192[_0x65b6('0x16')][_0x65b6('0x17')]===undefined?!![]:![]:!![],'where':_0x161192[_0x65b6('0x16')]?_0x161192[_0x65b6('0x16')][_0x65b6('0x20')]||null:null,'attributes':_0x161192[_0x65b6('0x16')]?_0x161192[_0x65b6('0x16')][_0x65b6('0x1c')]||null:null,'include':_0x161192[_0x65b6('0x16')]?_0x161192[_0x65b6('0x16')]['include']?_[_0x65b6('0x1a')](_0x161192[_0x65b6('0x16')]['include'],function(_0x22d81f){return{'model':db[_0x22d81f[_0x65b6('0x1b')]],'as':_0x22d81f['as'],'attributes':_0x22d81f[_0x65b6('0x1c')],'include':_0x22d81f['include']?_[_0x65b6('0x1a')](_0x22d81f[_0x65b6('0x19')],function(_0x1418f5){return{'model':db[_0x1418f5[_0x65b6('0x1b')]],'as':_0x1418f5['as'],'attributes':_0x1418f5[_0x65b6('0x1c')],'include':_0x1418f5[_0x65b6('0x19')]?_[_0x65b6('0x1a')](_0x1418f5[_0x65b6('0x19')],function(_0x5ecc87){return{'model':db[_0x5ecc87[_0x65b6('0x1b')]],'as':_0x5ecc87['as'],'attributes':_0x5ecc87[_0x65b6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x65b6('0x9')](function(_0x450173){logger['info']('ShowTrunk',_0x161192);logger['debug'](_0x65b6('0x1d'),_0x161192,JSON['stringify'](_0x450173));_0x2fd55d(_0x450173);})['catch'](function(_0x4e2613){logger['error']('ShowTrunk',_0x4e2613['message'],_0x161192);_0x15cb14(_0x1ffb40['error'](0x1f4,_0x4e2613['message']));});});};
\ No newline at end of file
+var _0x9c3e=['model','catch','ShowTrunk','find','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','Trunk,\x20%s,\x20%s','message','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9c3e,0x125));var _0xe9c3=function(_0x49dc73,_0x1d7e67){_0x49dc73=_0x49dc73-0x0;var _0x54f839=_0x9c3e[_0x49dc73];return _0x54f839;};'use strict';var _=require(_0xe9c3('0x0'));var util=require(_0xe9c3('0x1'));var moment=require(_0xe9c3('0x2'));var BPromise=require(_0xe9c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9c3('0x4'));var db=require(_0xe9c3('0x5'))['db'];var utils=require(_0xe9c3('0x6'));var logger=require(_0xe9c3('0x7'))(_0xe9c3('0x8'));var config=require(_0xe9c3('0x9'));var jayson=require(_0xe9c3('0xa'));var client=jayson[_0xe9c3('0xb')][_0xe9c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1beff2,_0xdcce89,_0x142d90){return new BPromise(function(_0x168474,_0xf8b1c0){return client[_0xe9c3('0xd')](_0x1beff2,_0x142d90)[_0xe9c3('0xe')](function(_0x17fff9){logger[_0xe9c3('0xf')]('Trunk,\x20%s,\x20%s',_0xdcce89,'request\x20sent');logger[_0xe9c3('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0xdcce89,_0xe9c3('0x11'),JSON['stringify'](_0x17fff9));if(_0x17fff9[_0xe9c3('0x12')]){if(_0x17fff9['error']['code']===0x1f4){logger[_0xe9c3('0x12')](_0xe9c3('0x13'),_0xdcce89,_0x17fff9[_0xe9c3('0x12')]['message']);return _0xf8b1c0(_0x17fff9['error'][_0xe9c3('0x14')]);}logger['error'](_0xe9c3('0x13'),_0xdcce89,_0x17fff9[_0xe9c3('0x12')]['message']);return _0x168474(_0x17fff9[_0xe9c3('0x12')][_0xe9c3('0x14')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0xdcce89,_0xe9c3('0x11'));_0x168474(_0x17fff9['result'][_0xe9c3('0x14')]);}})['catch'](function(_0x16c59c){logger['error'](_0xe9c3('0x13'),_0xdcce89,_0x16c59c);_0xf8b1c0(_0x16c59c);});});}exports[_0xe9c3('0x15')]=function(_0x433122){var _0x3a34f0=this;return new Promise(function(_0x597b57,_0x43b6b5){return db[_0xe9c3('0x16')][_0xe9c3('0x17')]({'raw':_0x433122[_0xe9c3('0x18')]?_0x433122[_0xe9c3('0x18')][_0xe9c3('0x19')]===undefined?!![]:![]:!![],'where':_0x433122[_0xe9c3('0x18')]?_0x433122[_0xe9c3('0x18')][_0xe9c3('0x1a')]||null:null,'attributes':_0x433122[_0xe9c3('0x18')]?_0x433122[_0xe9c3('0x18')][_0xe9c3('0x1b')]||null:null,'limit':_0x433122[_0xe9c3('0x18')]?_0x433122[_0xe9c3('0x18')][_0xe9c3('0x1c')]||null:null,'include':_0x433122[_0xe9c3('0x18')]?_0x433122[_0xe9c3('0x18')][_0xe9c3('0x1d')]?_[_0xe9c3('0x1e')](_0x433122[_0xe9c3('0x18')][_0xe9c3('0x1d')],function(_0x5541bf){return{'model':db[_0x5541bf['model']],'as':_0x5541bf['as'],'attributes':_0x5541bf['attributes'],'include':_0x5541bf[_0xe9c3('0x1d')]?_['map'](_0x5541bf[_0xe9c3('0x1d')],function(_0x198779){return{'model':db[_0x198779[_0xe9c3('0x1f')]],'as':_0x198779['as'],'attributes':_0x198779[_0xe9c3('0x1b')],'include':_0x198779[_0xe9c3('0x1d')]?_[_0xe9c3('0x1e')](_0x198779[_0xe9c3('0x1d')],function(_0x3d3352){return{'model':db[_0x3d3352[_0xe9c3('0x1f')]],'as':_0x3d3352['as'],'attributes':_0x3d3352[_0xe9c3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe9c3('0xe')](function(_0x4cd452){logger['info'](_0xe9c3('0x15'),_0x433122);logger['debug']('GetTrunk',_0x433122,JSON['stringify'](_0x4cd452));_0x597b57(_0x4cd452);})[_0xe9c3('0x20')](function(_0x63d258){logger[_0xe9c3('0x12')](_0xe9c3('0x15'),_0x63d258[_0xe9c3('0x14')],_0x433122);_0x43b6b5(_0x3a34f0[_0xe9c3('0x12')](0x1f4,_0x63d258['message']));});});};exports[_0xe9c3('0x21')]=function(_0x3f2dd0){var _0x24154a=this;return new Promise(function(_0x36fcb1,_0x1e8f47){return db['Trunk'][_0xe9c3('0x22')]({'raw':_0x3f2dd0[_0xe9c3('0x18')]?_0x3f2dd0[_0xe9c3('0x18')][_0xe9c3('0x19')]===undefined?!![]:![]:!![],'where':_0x3f2dd0[_0xe9c3('0x18')]?_0x3f2dd0[_0xe9c3('0x18')]['where']||null:null,'attributes':_0x3f2dd0['options']?_0x3f2dd0['options'][_0xe9c3('0x1b')]||null:null,'include':_0x3f2dd0[_0xe9c3('0x18')]?_0x3f2dd0[_0xe9c3('0x18')][_0xe9c3('0x1d')]?_[_0xe9c3('0x1e')](_0x3f2dd0[_0xe9c3('0x18')][_0xe9c3('0x1d')],function(_0x5db822){return{'model':db[_0x5db822[_0xe9c3('0x1f')]],'as':_0x5db822['as'],'attributes':_0x5db822[_0xe9c3('0x1b')],'include':_0x5db822[_0xe9c3('0x1d')]?_[_0xe9c3('0x1e')](_0x5db822[_0xe9c3('0x1d')],function(_0x59c8cb){return{'model':db[_0x59c8cb[_0xe9c3('0x1f')]],'as':_0x59c8cb['as'],'attributes':_0x59c8cb['attributes'],'include':_0x59c8cb['include']?_[_0xe9c3('0x1e')](_0x59c8cb[_0xe9c3('0x1d')],function(_0x275ce0){return{'model':db[_0x275ce0[_0xe9c3('0x1f')]],'as':_0x275ce0['as'],'attributes':_0x275ce0['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9c3('0xe')](function(_0x558885){logger[_0xe9c3('0xf')](_0xe9c3('0x21'),_0x3f2dd0);logger[_0xe9c3('0x10')](_0xe9c3('0x21'),_0x3f2dd0,JSON[_0xe9c3('0x23')](_0x558885));_0x36fcb1(_0x558885);})['catch'](function(_0x24c49e){logger[_0xe9c3('0x12')]('ShowTrunk',_0x24c49e[_0xe9c3('0x14')],_0x3f2dd0);_0x1e8f47(_0x24154a[_0xe9c3('0x12')](0x1f4,_0x24c49e[_0xe9c3('0x14')]));});});};
\ No newline at end of file
index 35eb7b4..6d0f71d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2c7=['express','Router','../../components/auth/service','/:id','exports'];(function(_0x1f88eb,_0x24c667){var _0x5b2b5c=function(_0x3a317b){while(--_0x3a317b){_0x1f88eb['push'](_0x1f88eb['shift']());}};_0x5b2b5c(++_0x24c667);}(_0xb2c7,0x87));var _0x7b2c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb2c7[_0x4b369d];return _0x571a98;};'use strict';var express=require(_0x7b2c('0x0'));var router=express[_0x7b2c('0x1')]();var auth=require(_0x7b2c('0x2'));var controller=require('./user-setting.controller');router['put'](_0x7b2c('0x3'),auth['isAuthenticated'](),controller['update']);module[_0x7b2c('0x4')]=router;
\ No newline at end of file
+var _0x044d=['/:id','update','exports','express','Router','../../components/auth/service','./user-setting.controller','put'];(function(_0x4b35d0,_0x126f2f){var _0x3b6464=function(_0x16ed67){while(--_0x16ed67){_0x4b35d0['push'](_0x4b35d0['shift']());}};_0x3b6464(++_0x126f2f);}(_0x044d,0x17b));var _0xd044=function(_0x3d96c0,_0x35262f){_0x3d96c0=_0x3d96c0-0x0;var _0x189e9c=_0x044d[_0x3d96c0];return _0x189e9c;};'use strict';var express=require(_0xd044('0x0'));var router=express[_0xd044('0x1')]();var auth=require(_0xd044('0x2'));var controller=require(_0xd044('0x3'));router[_0xd044('0x4')](_0xd044('0x5'),auth['isAuthenticated'](),controller[_0xd044('0x6')]);module[_0xd044('0x7')]=router;
\ No newline at end of file
index 53df4d3..c0d9e21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7743=['TEXT','DATE','INTEGER','UserId','sequelize','info','debug','exports','BOOLEAN'];(function(_0x5f015f,_0x2426f1){var _0x37ad59=function(_0x347417){while(--_0x347417){_0x5f015f['push'](_0x5f015f['shift']());}};_0x37ad59(++_0x2426f1);}(_0x7743,0x163));var _0x3774=function(_0x334da0,_0x7ca56f){_0x334da0=_0x334da0-0x0;var _0x21fe6e=_0x7743[_0x334da0];return _0x21fe6e;};'use strict';var Sequelize=require(_0x3774('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error','warning',_0x3774('0x1'),_0x3774('0x2')];module[_0x3774('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x3774('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x3774('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x3774('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x3774('0x7')],'unique':_0x3774('0x8')}};
\ No newline at end of file
+var _0xc9d5=['info','debug','exports','ENUM','BOOLEAN','DATE','INTEGER','UserId','sequelize','error','warning'];(function(_0x3777b9,_0x49afc8){var _0x28261b=function(_0x345550){while(--_0x345550){_0x3777b9['push'](_0x3777b9['shift']());}};_0x28261b(++_0x49afc8);}(_0xc9d5,0x76));var _0x5c9d=function(_0x5301e0,_0x66b54b){_0x5301e0=_0x5301e0-0x0;var _0x254a48=_0xc9d5[_0x5301e0];return _0x254a48;};'use strict';var Sequelize=require(_0x5c9d('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x5c9d('0x1'),_0x5c9d('0x2'),_0x5c9d('0x3'),_0x5c9d('0x4')];module[_0x5c9d('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0x5c9d('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x5c9d('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x5c9d('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x5c9d('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x5c9d('0x9')],'unique':_0x5c9d('0xa')}};
\ No newline at end of file
index 5f72f38..7996a88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ebf=['../../mysqldb','redis','./user-setting.socket','register','defaults','json','then','sendStatus','error','stack','name','send','update','params','Invalid\x20user\x20setting\x20id','find','body','catch','lodash','ioredis','../../config/logger','../../config/environment'];(function(_0x3332af,_0x21df8f){var _0x57fa04=function(_0x2921ed){while(--_0x2921ed){_0x3332af['push'](_0x3332af['shift']());}};_0x57fa04(++_0x21df8f);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x8ebf[_0x3fc97b];return _0x3a0c82;};'use strict';var _=require(_0xf8eb('0x0'));var Redis=require(_0xf8eb('0x1'));var logger=require(_0xf8eb('0x2'))('api');var config=require(_0xf8eb('0x3'));var db=require(_0xf8eb('0x4'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xf8eb('0x5')]));require(_0xf8eb('0x6'))[_0xf8eb('0x7')](socket);config['redis']=_[_0xf8eb('0x8')](config[_0xf8eb('0x5')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x30c91c,_0x2c2489){_0x2c2489=_0x2c2489||0xc8;return function(_0x2a1fb6){if(_0x2a1fb6){return _0x30c91c['status'](_0x2c2489)[_0xf8eb('0x9')](_0x2a1fb6);}};}function saveUpdates(_0x4a22d0){return function(_0x1924e7){if(_0x1924e7){return _0x1924e7['update'](_0x4a22d0)[_0xf8eb('0xa')](function(_0x17d538){return _0x17d538;});}return null;};}function handleEntityNotFound(_0x166aa1){return function(_0x4ca01b){if(!_0x4ca01b){_0x166aa1[_0xf8eb('0xb')](0x194);}return _0x4ca01b;};}function handleError(_0x2d55dd,_0x21191d){_0x21191d=_0x21191d||0x1f4;return function(_0x2a87ab){logger[_0xf8eb('0xc')](_0x2a87ab[_0xf8eb('0xd')]);if(_0x2a87ab[_0xf8eb('0xe')]){delete _0x2a87ab[_0xf8eb('0xe')];}_0x2d55dd['status'](_0x21191d)[_0xf8eb('0xf')](_0x2a87ab);};}exports[_0xf8eb('0x10')]=function(_0x26f79f,_0xf092b6){if(_0x26f79f['user']['role']!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x26f79f[_0xf8eb('0x11')]['id'])))throw new Error(_0xf8eb('0x12'));return db['UserSetting'][_0xf8eb('0x13')]({'where':{'id':_0x26f79f[_0xf8eb('0x11')]['id']}})[_0xf8eb('0xa')](handleEntityNotFound(_0xf092b6,null))['then'](saveUpdates(_0x26f79f[_0xf8eb('0x14')],null))[_0xf8eb('0xa')](respondWithResult(_0xf092b6,null))[_0xf8eb('0x15')](handleError(_0xf092b6,null));};
\ No newline at end of file
+var _0x4abf=['stack','name','user','role','admin','Unauthorized','params','UserSetting','find','body','catch','lodash','ioredis','api','redis','./user-setting.socket','defaults','localhost','status','update','then','sendStatus','error'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x4abf,0xac));var _0xf4ab=function(_0x582ec5,_0xb743f8){_0x582ec5=_0x582ec5-0x0;var _0x23100c=_0x4abf[_0x582ec5];return _0x23100c;};'use strict';var _=require(_0xf4ab('0x0'));var Redis=require(_0xf4ab('0x1'));var logger=require('../../config/logger')(_0xf4ab('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xf4ab('0x3')]));require(_0xf4ab('0x4'))['register'](socket);config['redis']=_[_0xf4ab('0x5')](config[_0xf4ab('0x3')],{'host':_0xf4ab('0x6'),'port':0x18eb});function respondWithResult(_0x1d60fc,_0x5a0671){_0x5a0671=_0x5a0671||0xc8;return function(_0x230259){if(_0x230259){return _0x1d60fc[_0xf4ab('0x7')](_0x5a0671)['json'](_0x230259);}};}function saveUpdates(_0x45b134){return function(_0x557618){if(_0x557618){return _0x557618[_0xf4ab('0x8')](_0x45b134)[_0xf4ab('0x9')](function(_0x17a9a3){return _0x17a9a3;});}return null;};}function handleEntityNotFound(_0x1dd0fa){return function(_0x3aef30){if(!_0x3aef30){_0x1dd0fa[_0xf4ab('0xa')](0x194);}return _0x3aef30;};}function handleError(_0x4516bf,_0x3f8be4){_0x3f8be4=_0x3f8be4||0x1f4;return function(_0x3f5fe9){logger[_0xf4ab('0xb')](_0x3f5fe9[_0xf4ab('0xc')]);if(_0x3f5fe9[_0xf4ab('0xd')]){delete _0x3f5fe9[_0xf4ab('0xd')];}_0x4516bf['status'](_0x3f8be4)['send'](_0x3f5fe9);};}exports[_0xf4ab('0x8')]=function(_0x54eabf,_0x35eab2){if(_0x54eabf[_0xf4ab('0xe')][_0xf4ab('0xf')]!==_0xf4ab('0x10'))throw new Error(_0xf4ab('0x11'));if(isNaN(Number(_0x54eabf[_0xf4ab('0x12')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xf4ab('0x13')][_0xf4ab('0x14')]({'where':{'id':_0x54eabf[_0xf4ab('0x12')]['id']}})['then'](handleEntityNotFound(_0x35eab2,null))[_0xf4ab('0x9')](saveUpdates(_0x54eabf[_0xf4ab('0x15')],null))['then'](respondWithResult(_0x35eab2,null))[_0xf4ab('0x16')](handleError(_0x35eab2,null));};
\ No newline at end of file
index ab871b1..204edb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x081b=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','update'];(function(_0x4fcc5b,_0x25e4d7){var _0x1de4b6=function(_0x16ee00){while(--_0x16ee00){_0x4fcc5b['push'](_0x4fcc5b['shift']());}};_0x1de4b6(++_0x25e4d7);}(_0x081b,0x10e));var _0xb081=function(_0x2580f4,_0x2016b5){_0x2580f4=_0x2580f4-0x0;var _0x5a8838=_0x081b[_0x2580f4];return _0x5a8838;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xb081('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb081('0x1'),'afterUpdate':_0xb081('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1ec4c0){return function(_0x549ce8,_0x47293b,_0x2f368e){UserSettingEvents[_0xb081('0x3')](_0x1ec4c0+':'+_0x549ce8['id'],_0x549ce8);UserSettingEvents[_0xb081('0x3')](_0x1ec4c0,_0x549ce8);_0x2f368e(null);};}for(var e in events){if(events[_0xb081('0x4')](e)){var event=events[e];UserSetting[_0xb081('0x5')](e,emitEvent(event));}}module[_0xb081('0x6')]=UserSettingEvents;
\ No newline at end of file
+var _0x05c3=['events','../../mysqldb','UserSetting','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x4ec64c,_0x34d2f8){var _0x458348=function(_0xf68245){while(--_0xf68245){_0x4ec64c['push'](_0x4ec64c['shift']());}};_0x458348(++_0x34d2f8);}(_0x05c3,0x156));var _0x305c=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0x05c3[_0x4b6778];return _0x22dbb9;};'use strict';var EventEmitter=require(_0x305c('0x0'));var UserSetting=require(_0x305c('0x1'))['db'][_0x305c('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x305c('0x3')](0x0);var events={'afterCreate':_0x305c('0x4'),'afterUpdate':_0x305c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x23b647){return function(_0x36988b,_0xfaa02d,_0x4d2c74){UserSettingEvents[_0x305c('0x6')](_0x23b647+':'+_0x36988b['id'],_0x36988b);UserSettingEvents[_0x305c('0x6')](_0x23b647,_0x36988b);_0x4d2c74(null);};}for(var e in events){if(events[_0x305c('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x305c('0x8')]=UserSettingEvents;
\ No newline at end of file
index 86e0c7c..8215c6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c2c=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x141ec4,_0x221052){var _0x14ae56=function(_0x1a8c00){while(--_0x1a8c00){_0x141ec4['push'](_0x141ec4['shift']());}};_0x14ae56(++_0x221052);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0xc9c2('0x0'));module[_0xc9c2('0x1')]=function(_0x4ac695){return _0x4ac695['define']('UserSetting',attributes,{'tableName':_0xc9c2('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ac3bb){if(!_0x4ac3bb[_0xc9c2('0x3')])_0x4ac3bb[_0xc9c2('0x4')]=null;else if(_0x4ac3bb['clientSideLoggingEnabledSince']===null)_0x4ac3bb['clientSideLoggingEnabledSince']=new Date();}}});};
\ No newline at end of file
+var _0x7d13=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','exports','define'];(function(_0x44e8ae,_0x5ee946){var _0x582d50=function(_0x514b8c){while(--_0x514b8c){_0x44e8ae['push'](_0x44e8ae['shift']());}};_0x582d50(++_0x5ee946);}(_0x7d13,0x6c));var _0x37d1=function(_0x33df84,_0x5825d1){_0x33df84=_0x33df84-0x0;var _0x42e95e=_0x7d13[_0x33df84];return _0x42e95e;};'use strict';var attributes=require('./user-setting.attributes');module[_0x37d1('0x0')]=function(_0x59c6ac){return _0x59c6ac[_0x37d1('0x1')]('UserSetting',attributes,{'tableName':_0x37d1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x317366){if(!_0x317366[_0x37d1('0x3')])_0x317366[_0x37d1('0x4')]=null;else if(_0x317366[_0x37d1('0x4')]===null)_0x317366['clientSideLoggingEnabledSince']=new Date();}}});};
\ No newline at end of file
index f1329c8..2ac26de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x249a=['length','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x249a,0x173));var _0xa249=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x249a[_0x39096d];return _0x13da4f;};'use strict';var UserSettingEvents=require(_0xa249('0x0'));var events=[_0xa249('0x1'),_0xa249('0x2'),_0xa249('0x3')];function createListener(_0x8a5778,_0x1fbebb){return function(_0x2e9b2b){_0x1fbebb[_0xa249('0x4')](_0x8a5778,_0x2e9b2b);if(_0x8a5778===_0xa249('0x5')){_0x1fbebb[_0xa249('0x4')](_0xa249('0x6')+_0x2e9b2b['UserId'],_0x2e9b2b);}};}exports['register']=function(_0x373715){for(var _0x2d3cc1=0x0,_0xddd054=events[_0xa249('0x7')];_0x2d3cc1<_0xddd054;_0x2d3cc1++){var _0x486a49=events[_0x2d3cc1];var _0x13e0f6=createListener(_0xa249('0x8')+_0x486a49,_0x373715);UserSettingEvents['on'](_0x486a49,_0x13e0f6);}};
\ No newline at end of file
+var _0x85b0=['user-setting:','./user-setting.events','save','update','emit','user-setting:update','user-setting:update:user-','UserId','length'];(function(_0x596019,_0x14be98){var _0x47d4fc=function(_0x203dda){while(--_0x203dda){_0x596019['push'](_0x596019['shift']());}};_0x47d4fc(++_0x14be98);}(_0x85b0,0x7f));var _0x085b=function(_0x2c9642,_0x520134){_0x2c9642=_0x2c9642-0x0;var _0x4721ee=_0x85b0[_0x2c9642];return _0x4721ee;};'use strict';var UserSettingEvents=require(_0x085b('0x0'));var events=[_0x085b('0x1'),'remove',_0x085b('0x2')];function createListener(_0x2b3e7b,_0x103f4f){return function(_0x19e88b){_0x103f4f[_0x085b('0x3')](_0x2b3e7b,_0x19e88b);if(_0x2b3e7b===_0x085b('0x4')){_0x103f4f[_0x085b('0x3')](_0x085b('0x5')+_0x19e88b[_0x085b('0x6')],_0x19e88b);}};}exports['register']=function(_0xbd7580){for(var _0x50c638=0x0,_0x32cba9=events[_0x085b('0x7')];_0x50c638<_0x32cba9;_0x50c638++){var _0x208f28=events[_0x50c638];var _0x5828d1=createListener(_0x085b('0x8')+_0x208f28,_0xbd7580);UserSettingEvents['on'](_0x208f28,_0x5828d1);}};
\ No newline at end of file
index 4e803f9..7fec1ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1caa=['getWhatsappAccounts','/:id/square_projects','getScheduledCalls','/:id/api_key','post','/create_many','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/mail_accounts','/:id/openchannel_accounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','destroy','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts'];(function(_0x5470da,_0xbce5a0){var _0x3995ed=function(_0x36014d){while(--_0x36014d){_0x5470da['push'](_0x5470da['shift']());}};_0x3995ed(++_0xbce5a0);}(_0x1caa,0xa3));var _0xa1ca=function(_0x35ec83,_0x243f1e){_0x35ec83=_0x35ec83-0x0;var _0x404872=_0x1caa[_0x35ec83];return _0x404872;};'use strict';var multer=require(_0xa1ca('0x0'));var util=require(_0xa1ca('0x1'));var path=require(_0xa1ca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa1ca('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa1ca('0x4'));var interaction=require(_0xa1ca('0x5'));var config=require(_0xa1ca('0x6'));var controller=require(_0xa1ca('0x7'));router['get']('/',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x9')]);router[_0xa1ca('0xa')](_0xa1ca('0xb'),auth[_0xa1ca('0x8')](),controller['describe']);router[_0xa1ca('0xa')](_0xa1ca('0xc'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0xd')]);router['get'](_0xa1ca('0xe'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0xf')]);router[_0xa1ca('0xa')](_0xa1ca('0x10'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x11')]);router[_0xa1ca('0xa')](_0xa1ca('0x12'),controller[_0xa1ca('0x13')]);router[_0xa1ca('0xa')](_0xa1ca('0x14'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x15')]);router[_0xa1ca('0xa')](_0xa1ca('0x16'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x17')]);router[_0xa1ca('0xa')](_0xa1ca('0x18'),auth[_0xa1ca('0x8')](),controller['getQueues']);router[_0xa1ca('0xa')](_0xa1ca('0x19'),auth['isAuthenticated'](),controller[_0xa1ca('0x1a')]);router[_0xa1ca('0xa')]('/:id/groups',auth[_0xa1ca('0x8')](),controller['getGroups']);router[_0xa1ca('0xa')](_0xa1ca('0x1b'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x1c')]);router['get']('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0xa1ca('0x1d')]);router[_0xa1ca('0xa')](_0xa1ca('0x1e'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x1f')]);router['get'](_0xa1ca('0x20'),auth['isAuthenticated'](),controller[_0xa1ca('0x21')]);router[_0xa1ca('0xa')]('/:id/mail/interactions',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x22')]);router['get'](_0xa1ca('0x23'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x24')]);router[_0xa1ca('0xa')](_0xa1ca('0x25'),auth[_0xa1ca('0x8')](),controller['getFaxInteractions']);router[_0xa1ca('0xa')](_0xa1ca('0x26'),auth['isAuthenticated'](),controller[_0xa1ca('0x27')]);router['get'](_0xa1ca('0x28'),auth[_0xa1ca('0x8')](),controller['getTeams']);router['get'](_0xa1ca('0x29'),auth[_0xa1ca('0x8')](),controller['getLists']);router[_0xa1ca('0xa')](_0xa1ca('0x2a'),auth['isAuthenticated'](),controller[_0xa1ca('0x2b')]);router[_0xa1ca('0xa')](_0xa1ca('0x2c'),auth['isAuthenticated'](),controller[_0xa1ca('0x2d')]);router[_0xa1ca('0xa')](_0xa1ca('0x2e'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x2f')]);router['get']('/:id/mail_accounts',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x30')]);router['get']('/:id/openchannel_accounts',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x31')]);router[_0xa1ca('0xa')]('/:id/sms_accounts',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x32')]);router[_0xa1ca('0xa')](_0xa1ca('0x33'),auth[_0xa1ca('0x8')](),controller['getChatWebsites']);router['get'](_0xa1ca('0x34'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x35')]);router[_0xa1ca('0xa')](_0xa1ca('0x36'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0xa1ca('0xa')]('/:id/scheduled_calls',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x37')]);router[_0xa1ca('0xa')](_0xa1ca('0x38'),auth[_0xa1ca('0x8')](),controller['getApiKey']);router[_0xa1ca('0x39')]('/:id/contacts',auth[_0xa1ca('0x8')](),controller['addContacts']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa1ca('0x39')](_0xa1ca('0x3a'),auth['isAuthenticated'](),controller['bulkCreate']);router['post']('/:id/queues',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x3b')]);var upload=multer({'storage':multer[_0xa1ca('0x3c')]({'destination':function(_0x4a8375,_0x256217,_0x541e15){_0x541e15(null,path[_0xa1ca('0x3d')](config[_0xa1ca('0x3e')],_0xa1ca('0x3f')));},'filename':function(_0x42207a,_0x5d031a,_0x5210ea){_0x5210ea(null,util['format'](_0xa1ca('0x40'),Date[_0xa1ca('0x41')](),_0x5d031a['originalname']));}})});router[_0xa1ca('0x39')](_0xa1ca('0x12'),upload[_0xa1ca('0x42')](_0xa1ca('0x43')),controller[_0xa1ca('0x44')]);router[_0xa1ca('0x39')](_0xa1ca('0x45'),auth[_0xa1ca('0x8')](),controller['login']);router[_0xa1ca('0x39')](_0xa1ca('0x46'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x47')]);router[_0xa1ca('0x39')]('/:id/pause',auth[_0xa1ca('0x8')](),controller['pause']);router['post'](_0xa1ca('0x48'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x49')]);router[_0xa1ca('0x39')](_0xa1ca('0x28'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x4a')]);router[_0xa1ca('0x39')](_0xa1ca('0x4b'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x4c')]);router['post'](_0xa1ca('0x4d'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x4e')]);router['post']('/:id/fax_interactions',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x4f')]);router[_0xa1ca('0x39')](_0xa1ca('0x50'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x51')]);router[_0xa1ca('0x39')](_0xa1ca('0x52'),auth[_0xa1ca('0x8')](),controller['addOpenchannelInteractions']);router[_0xa1ca('0x39')]('/:id/whatsapp_interactions',auth[_0xa1ca('0x8')](),controller['addWhatsappInteractions']);router[_0xa1ca('0x39')](_0xa1ca('0x2e'),auth[_0xa1ca('0x8')](),controller['addFaxAccounts']);router[_0xa1ca('0x39')](_0xa1ca('0x53'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0xa1ca('0x39')](_0xa1ca('0x54'),auth['isAuthenticated'](),controller[_0xa1ca('0x55')]);router['post'](_0xa1ca('0x56'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x57')]);router[_0xa1ca('0x39')](_0xa1ca('0x33'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x58')]);router[_0xa1ca('0x39')]('/:id/whatsapp_accounts',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x59')]);router['post'](_0xa1ca('0x36'),auth['isAuthenticated'](),controller[_0xa1ca('0x5a')]);router[_0xa1ca('0x39')](_0xa1ca('0x38'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x5b')]);router[_0xa1ca('0x5c')](_0xa1ca('0x10'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x5d')]);router['put'](_0xa1ca('0x5e'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x5f')]);router[_0xa1ca('0x60')](_0xa1ca('0x18'),auth[_0xa1ca('0x8')](),controller['removeQueues']);router[_0xa1ca('0x60')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0xa1ca('0x60')]('/:id',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x61')]);router['delete'](_0xa1ca('0x4b'),auth[_0xa1ca('0x8')](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x62')]);router['delete'](_0xa1ca('0x63'),auth['isAuthenticated'](),controller[_0xa1ca('0x64')]);router[_0xa1ca('0x60')](_0xa1ca('0x50'),auth['isAuthenticated'](),controller[_0xa1ca('0x65')]);router[_0xa1ca('0x60')]('/:id/openchannel_interactions',auth[_0xa1ca('0x8')](),controller['removeOpenchannelInteractions']);router[_0xa1ca('0x60')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0xa1ca('0x60')](_0xa1ca('0x2e'),auth[_0xa1ca('0x8')](),controller['removeFaxAccounts']);router['delete'](_0xa1ca('0x53'),auth['isAuthenticated'](),controller[_0xa1ca('0x66')]);router[_0xa1ca('0x60')](_0xa1ca('0x54'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x67')]);router[_0xa1ca('0x60')](_0xa1ca('0x56'),auth[_0xa1ca('0x8')](),controller['removeSmsAccounts']);router['delete'](_0xa1ca('0x33'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x68')]);router[_0xa1ca('0x60')](_0xa1ca('0x34'),auth[_0xa1ca('0x8')](),controller[_0xa1ca('0x69')]);router[_0xa1ca('0x60')]('/:id/square_projects',auth[_0xa1ca('0x8')](),controller['removeSquareProjects']);router[_0xa1ca('0x60')](_0xa1ca('0x38'),auth['isAuthenticated'](),controller[_0xa1ca('0x6a')]);module[_0xa1ca('0x6b')]=router;
\ No newline at end of file
+var _0xdec1=['addContacts','post','create','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','addTeams','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','createApiKey','put','/:id/password','changePassword','delete','removeQueues','removeTeams','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/mail_accounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/whoami','whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdec1,0x188));var _0x1dec=function(_0x566bcc,_0x4fb784){_0x566bcc=_0x566bcc-0x0;var _0x18d59c=_0xdec1[_0x566bcc];return _0x18d59c;};'use strict';var multer=require('multer');var util=require(_0x1dec('0x0'));var path=require(_0x1dec('0x1'));var timeout=require(_0x1dec('0x2'));var express=require(_0x1dec('0x3'));var router=express['Router']();var fs_extra=require(_0x1dec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1dec('0x5'));var config=require('../../config/environment');var controller=require('./user.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1dec('0x6')]);router[_0x1dec('0x7')](_0x1dec('0x8'),auth[_0x1dec('0x9')](),controller[_0x1dec('0xa')]);router[_0x1dec('0x7')](_0x1dec('0xb'),auth['isAuthenticated'](),controller[_0x1dec('0xc')]);router[_0x1dec('0x7')](_0x1dec('0xd'),auth['isAuthenticated'](),controller['getPresence']);router['get'](_0x1dec('0xe'),auth[_0x1dec('0x9')](),controller[_0x1dec('0xf')]);router[_0x1dec('0x7')](_0x1dec('0x10'),controller[_0x1dec('0x11')]);router[_0x1dec('0x7')](_0x1dec('0x12'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x13')]);router[_0x1dec('0x7')](_0x1dec('0x14'),auth['isAuthenticated'](),controller[_0x1dec('0x15')]);router[_0x1dec('0x7')](_0x1dec('0x16'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x17')]);router['get'](_0x1dec('0x18'),auth['isAuthenticated'](),controller[_0x1dec('0x19')]);router[_0x1dec('0x7')](_0x1dec('0x1a'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x1b')]);router[_0x1dec('0x7')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x1dec('0x1c')]);router[_0x1dec('0x7')](_0x1dec('0x1d'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x1e')]);router['get'](_0x1dec('0x1f'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x20')]);router['get']('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x1dec('0x21')]);router[_0x1dec('0x7')](_0x1dec('0x22'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x23')]);router['get'](_0x1dec('0x24'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x25')]);router['get'](_0x1dec('0x26'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x27')]);router[_0x1dec('0x7')]('/:id/whatsapp/interactions',auth[_0x1dec('0x9')](),controller[_0x1dec('0x28')]);router[_0x1dec('0x7')](_0x1dec('0x29'),auth[_0x1dec('0x9')](),controller['getTeams']);router[_0x1dec('0x7')](_0x1dec('0x2a'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x2b')]);router[_0x1dec('0x7')]('/:id/agents',auth[_0x1dec('0x9')](),controller[_0x1dec('0x2c')]);router[_0x1dec('0x7')](_0x1dec('0x2d'),auth[_0x1dec('0x9')](),controller['getVoicePrefixes']);router[_0x1dec('0x7')](_0x1dec('0x2e'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x2f')]);router[_0x1dec('0x7')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['getMailAccounts']);router[_0x1dec('0x7')](_0x1dec('0x30'),auth['isAuthenticated'](),controller[_0x1dec('0x31')]);router[_0x1dec('0x7')](_0x1dec('0x32'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x33')]);router[_0x1dec('0x7')](_0x1dec('0x34'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x35')]);router[_0x1dec('0x7')](_0x1dec('0x36'),auth[_0x1dec('0x9')](),controller['getWhatsappAccounts']);router[_0x1dec('0x7')](_0x1dec('0x37'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x1dec('0x7')](_0x1dec('0x38'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x39')]);router[_0x1dec('0x7')](_0x1dec('0x3a'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x3b')]);router['post'](_0x1dec('0x14'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x3c')]);router[_0x1dec('0x3d')]('/',auth[_0x1dec('0x9')](),controller[_0x1dec('0x3e')]);router[_0x1dec('0x3d')](_0x1dec('0x3f'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x40')]);router[_0x1dec('0x3d')]('/:id/queues',auth[_0x1dec('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x1dec('0x41')]({'destination':function(_0x3b8c46,_0x4636f3,_0x55c989){_0x55c989(null,path[_0x1dec('0x42')](config[_0x1dec('0x43')],_0x1dec('0x44')));},'filename':function(_0x23260e,_0x4a54ff,_0x51fa4b){_0x51fa4b(null,util[_0x1dec('0x45')](_0x1dec('0x46'),Date[_0x1dec('0x47')](),_0x4a54ff['originalname']));}})});router[_0x1dec('0x3d')](_0x1dec('0x10'),upload['single']('file'),controller[_0x1dec('0x48')]);router[_0x1dec('0x3d')](_0x1dec('0x49'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x4a')]);router[_0x1dec('0x3d')](_0x1dec('0x4b'),auth['isAuthenticated'](),controller['logout']);router[_0x1dec('0x3d')](_0x1dec('0x4c'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x4d')]);router[_0x1dec('0x3d')](_0x1dec('0x4e'),auth[_0x1dec('0x9')](),controller['unpause']);router[_0x1dec('0x3d')](_0x1dec('0x29'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x4f')]);router['post']('/:id/chat_interactions',auth['isAuthenticated'](),controller['addChatInteractions']);router['post']('/:id/mail_interactions',auth[_0x1dec('0x9')](),controller[_0x1dec('0x50')]);router[_0x1dec('0x3d')](_0x1dec('0x51'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x52')]);router['post'](_0x1dec('0x53'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x54')]);router[_0x1dec('0x3d')](_0x1dec('0x55'),auth[_0x1dec('0x9')](),controller['addOpenchannelInteractions']);router[_0x1dec('0x3d')](_0x1dec('0x56'),auth[_0x1dec('0x9')](),controller['addWhatsappInteractions']);router[_0x1dec('0x3d')](_0x1dec('0x2e'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x57')]);router[_0x1dec('0x3d')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x1dec('0x58')]);router[_0x1dec('0x3d')](_0x1dec('0x30'),auth['isAuthenticated'](),controller[_0x1dec('0x59')]);router[_0x1dec('0x3d')](_0x1dec('0x32'),auth[_0x1dec('0x9')](),controller['addSmsAccounts']);router[_0x1dec('0x3d')](_0x1dec('0x34'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x5a')]);router['post'](_0x1dec('0x36'),auth[_0x1dec('0x9')](),controller['addWhatsappAccounts']);router['post'](_0x1dec('0x37'),auth[_0x1dec('0x9')](),controller['addSquareProjects']);router[_0x1dec('0x3d')](_0x1dec('0x3a'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x5b')]);router['put'](_0x1dec('0xe'),auth[_0x1dec('0x9')](),controller['update']);router[_0x1dec('0x5c')](_0x1dec('0x5d'),auth['isAuthenticated'](),controller[_0x1dec('0x5e')]);router[_0x1dec('0x5f')](_0x1dec('0x16'),auth['isAuthenticated'](),controller[_0x1dec('0x60')]);router['delete'](_0x1dec('0x29'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x61')]);router[_0x1dec('0x5f')](_0x1dec('0xe'),auth[_0x1dec('0x9')](),controller['destroy']);router[_0x1dec('0x5f')](_0x1dec('0x62'),auth['isAuthenticated'](),controller[_0x1dec('0x63')]);router[_0x1dec('0x5f')](_0x1dec('0x64'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x65')]);router[_0x1dec('0x5f')](_0x1dec('0x51'),auth[_0x1dec('0x9')](),controller['removeFaxInteractions']);router['delete'](_0x1dec('0x53'),auth['isAuthenticated'](),controller[_0x1dec('0x66')]);router[_0x1dec('0x5f')](_0x1dec('0x55'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x67')]);router[_0x1dec('0x5f')]('/:id/whatsapp_interactions',auth[_0x1dec('0x9')](),controller[_0x1dec('0x68')]);router['delete'](_0x1dec('0x2e'),auth[_0x1dec('0x9')](),controller['removeFaxAccounts']);router[_0x1dec('0x5f')](_0x1dec('0x69'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x6a')]);router[_0x1dec('0x5f')](_0x1dec('0x30'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x6b')]);router['delete'](_0x1dec('0x32'),auth[_0x1dec('0x9')](),controller['removeSmsAccounts']);router['delete']('/:id/chat_websites',auth[_0x1dec('0x9')](),controller[_0x1dec('0x6c')]);router[_0x1dec('0x5f')](_0x1dec('0x36'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x6d')]);router['delete'](_0x1dec('0x37'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x6e')]);router['delete'](_0x1dec('0x3a'),auth[_0x1dec('0x9')](),controller[_0x1dec('0x6f')]);module[_0x1dec('0x70')]=router;
\ No newline at end of file
index 34516dd..d958f35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe75c=['TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','util','lodash','exports','STRING','setDataValue','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','BOOLEAN','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','join','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','passive','actpass','update,nonat','DATE','showWebBar','get','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','icesupport','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe75c,0xc5));var _0xce75=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe75c[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xce75('0x0'));var moment=require('moment');var util=require(_0xce75('0x1'));var _=require(_0xce75('0x2'));module[_0xce75('0x3')]={'name':{'type':Sequelize[_0xce75('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x551945){this[_0xce75('0x5')]('name',_0x551945);this[_0xce75('0x5')]('defaultuser',_0x551945);},'comment':_0xce75('0x6')},'fullname':{'type':Sequelize[_0xce75('0x4')],'allowNull':![],'set':function(_0x4e6744){this[_0xce75('0x5')](_0xce75('0x7'),_0x4e6744);this[_0xce75('0x5')]('callerid',util[_0xce75('0x8')](_0xce75('0x9'),_0x4e6744,this[_0xce75('0xa')](_0xce75('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xce75('0x4')],'allowNull':![],'unique':_0xce75('0xc'),'validate':{'isEmail':!![]},'set':function(_0x212fd5){if(_0x212fd5){this[_0xce75('0x5')](_0xce75('0xc'),_0x212fd5[_0xce75('0xd')]());}}},'role':{'type':Sequelize[_0xce75('0xe')](_0xce75('0xf'),_0xce75('0x10'),_0xce75('0x11'),_0xce75('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xce75('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xce75('0x4')],'defaultValue':_0xce75('0x13')},'internal':{'type':Sequelize[_0xce75('0x14')](0xb),'allowNull':![],'unique':_0xce75('0xb'),'set':function(_0x2fa210){this[_0xce75('0x5')](_0xce75('0xb'),_0x2fa210);this[_0xce75('0x5')]('accountcode',_0x2fa210);this[_0xce75('0x5')]('callerid',util[_0xce75('0x8')](_0xce75('0x9'),this['getDataValue'](_0xce75('0x7')),_0x2fa210));}},'salt':{'type':Sequelize[_0xce75('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xce75('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xce75('0x4')]},'userpic':{'type':Sequelize[_0xce75('0x4')]},'city':{'type':Sequelize[_0xce75('0x4')]},'country':{'type':Sequelize[_0xce75('0x4')]},'online':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xce75('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xce75('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xce75('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xce75('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xce75('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xce75('0x16')},'ipaddr':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xce75('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xce75('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xce75('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x17'),_0xce75('0x10'),_0xce75('0x18')),'allowNull':!![],'defaultValue':_0xce75('0x17')},'context':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![],'defaultValue':_0xce75('0x19')},'callingpres':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x1a'),'ALLOWED_PASSED_SCREEN',_0xce75('0x1b'),_0xce75('0x1c'),_0xce75('0x1d'),_0xce75('0x1e'),_0xce75('0x1f'),_0xce75('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![],'defaultValue':_0xce75('0x21'),'set':function(_0x557a81){this[_0xce75('0x5')]('transport',_0x557a81?_0x557a81['join'](','):null);},'get':function(){return this[_0xce75('0xa')](_0xce75('0x22'))?this[_0xce75('0xa')](_0xce75('0x22'))[_0xce75('0x23')](','):null;},'comment':_0xce75('0x24')},'dtmfmode':{'type':Sequelize['ENUM'](_0xce75('0x25'),_0xce75('0x26'),_0xce75('0x27'),_0xce75('0x28'),_0xce75('0x29')),'allowNull':!![],'defaultValue':_0xce75('0x25')},'directmedia':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no',_0xce75('0x2b'),_0xce75('0x2c'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xce75('0x2d'),'set':function(_0x161775){this[_0xce75('0x5')](_0xce75('0x2e'),_0x161775?_0x161775[_0xce75('0x2f')](','):null);},'get':function(){return this['getDataValue'](_0xce75('0x2e'))?this[_0xce75('0xa')]('nat')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xce75('0x4')]},'namedcallgroup':{'type':Sequelize[_0xce75('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xce75('0x4')]},'language':{'type':Sequelize[_0xce75('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xce75('0x30')},'allow':{'type':Sequelize[_0xce75('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x547f13){this[_0xce75('0x5')](_0xce75('0x31'),_0x547f13?_0x547f13['join'](';'):_0xce75('0x32'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue'](_0xce75('0x31'))[_0xce75('0x23')](';'):null;},'comment':_0xce75('0x33')},'autoframing':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![],'set':function(_0x2e9fc6){this[_0xce75('0x5')](_0xce75('0x34'),_0x2e9fc6?_0x2e9fc6['join'](','):null);},'get':function(){return this[_0xce75('0xa')](_0xce75('0x34'))?this[_0xce75('0xa')](_0xce75('0x34'))['split'](','):null;},'comment':_0xce75('0x35')},'trustrpid':{'type':Sequelize['ENUM'](_0xce75('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no',_0xce75('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xce75('0xe')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![],'defaultValue':_0xce75('0x37')},'amaflags':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xce75('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xce75('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xce75('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xce75('0x2a'),'no',_0xce75('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xce75('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xce75('0xe')]('accept',_0xce75('0x39'),_0xce75('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xce75('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x3b'),_0xce75('0x3c')),'allowNull':!![],'defaultValue':_0xce75('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xce75('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xce75('0x2a')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xce75('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xce75('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xce75('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xce75('0xe')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no',_0xce75('0x3d'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xce75('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xce75('0xe')]('active',_0xce75('0x3e'),_0xce75('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xce75('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xce75('0xe')]('yes','no',_0xce75('0x2b'),'update',_0xce75('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xce75('0x41')]},'passwordResetAt':{'type':Sequelize[_0xce75('0x41')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xce75('0x14')],'defaultValue':0x0,'set':function(_0x3d3ce7){this[_0xce75('0x5')](_0xce75('0x42'),_0x3d3ce7);var _0x25cd8c=this[_0xce75('0x43')]({'plain':!![]});switch(_0x3d3ce7){case 0x0:case 0x1:var _0x32bc06=_0x25cd8c['transport']?_[_0xce75('0x44')](_0x25cd8c[_0xce75('0x22')])?_0x25cd8c[_0xce75('0x22')][_0xce75('0x2f')]():_0x25cd8c[_0xce75('0x22')]:'udp';if(_0x32bc06===_0xce75('0x45')){_0x32bc06=_0xce75('0x21');}this[_0xce75('0x5')](_0xce75('0x22'),_0x32bc06);this[_0xce75('0x5')](_0xce75('0x46'),'no');this['setDataValue'](_0xce75('0x47'),null);this['setDataValue'](_0xce75('0x48'),null);this[_0xce75('0x5')]('icesupport',null);this[_0xce75('0x5')](_0xce75('0x49'),null);this[_0xce75('0x5')](_0xce75('0x4a'),null);this['setDataValue'](_0xce75('0x4b'),null);this['setDataValue'](_0xce75('0x4c'),null);this[_0xce75('0x5')](_0xce75('0x4d'),null);this[_0xce75('0x5')](_0xce75('0x4e'),'no');break;case 0x2:this[_0xce75('0x5')]('transport','wss');this[_0xce75('0x5')](_0xce75('0x46'),_0xce75('0x2a'));this[_0xce75('0x5')]('avpf',_0xce75('0x2a'));this['setDataValue']('force_avp',_0xce75('0x2a'));this[_0xce75('0x5')](_0xce75('0x4f'),_0xce75('0x2a'));this[_0xce75('0x5')](_0xce75('0x49'),_0xce75('0x2a'));this[_0xce75('0x5')](_0xce75('0x4a'),'no');this[_0xce75('0x5')]('dtlssetup',_0xce75('0x3f'));this[_0xce75('0x5')](_0xce75('0x4c'),_0x25cd8c[_0xce75('0x4c')]||_0xce75('0x50'));this[_0xce75('0x5')]('dtlsprivatekey',_0x25cd8c['dtlsprivatekey']||_0xce75('0x51'));this[_0xce75('0x5')](_0xce75('0x4e'),_0xce75('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xce75('0x52')],'set':function(_0xd26cbf){this['setDataValue'](_0xce75('0x53'),_0xd26cbf?_0xd26cbf[_0xce75('0x2f')](','):[]);},'get':function(){return this[_0xce75('0xa')]('permissions')?_[_0xce75('0x54')](this[_0xce75('0xa')](_0xce75('0x53'))[_0xce75('0x23')](','),function(_0x242e6f){return parseInt(_0x242e6f,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xce75('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xce75('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xce75('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xce75('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xce75('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xce75('0xe')](_0xce75('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xce75('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xce75('0x55')],'get':function(){return this[_0xce75('0xa')]('phoneBarEnableScreenRecordingByAgent')?this[_0xce75('0xa')](_0xce75('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xce75('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xce75('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![],'set':function(_0x1b73b3){if(typeof _0x1b73b3==='string'){var _0x10adae=_0x1b73b3==='1'?!![]:_0x1b73b3==='0'?![]:_0x1b73b3===_0xce75('0x57')?!![]:_0x1b73b3===_0xce75('0x58')?![]:![];this[_0xce75('0x5')](_0xce75('0x59'),_0x10adae);}else{this[_0xce75('0x5')](_0xce75('0x59'),_0x1b73b3);}}},'blocked':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![],'set':function(_0x2fec40){this[_0xce75('0x5')](_0xce75('0x5a'),_0x2fec40);if(_0x2fec40===!![]){this[_0xce75('0x5')](_0xce75('0x5b'),moment());this[_0xce75('0x5')](_0xce75('0x5c'),0x0);}else{this[_0xce75('0x5')](_0xce75('0x5b'),null);}}},'blockedAt':{'type':Sequelize[_0xce75('0x41')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xce75('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xce75('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xce75('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xce75('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xce75('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xce75('0x15')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2d69=['peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','nonat','update','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','TEXT','get','isArray','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','wss','encryption','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','user'];(function(_0x55a06e,_0x2d1185){var _0x307dec=function(_0x4231fd){while(--_0x4231fd){_0x55a06e['push'](_0x55a06e['shift']());}};_0x307dec(++_0x2d1185);}(_0x2d69,0xa0));var _0x92d6=function(_0x57fc5c,_0x1981a0){_0x57fc5c=_0x57fc5c-0x0;var _0xc96d84=_0x2d69[_0x57fc5c];return _0xc96d84;};'use strict';var Sequelize=require(_0x92d6('0x0'));var moment=require(_0x92d6('0x1'));var util=require(_0x92d6('0x2'));var _=require(_0x92d6('0x3'));module[_0x92d6('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x92d6('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x27e46e){this[_0x92d6('0x6')](_0x92d6('0x5'),_0x27e46e);this[_0x92d6('0x6')](_0x92d6('0x7'),_0x27e46e);},'comment':_0x92d6('0x8')},'fullname':{'type':Sequelize[_0x92d6('0x9')],'allowNull':![],'set':function(_0x33ce06){this[_0x92d6('0x6')](_0x92d6('0xa'),_0x33ce06);this[_0x92d6('0x6')](_0x92d6('0xb'),util[_0x92d6('0xc')]('\x22%s\x22\x20<%s>',_0x33ce06,this[_0x92d6('0xd')](_0x92d6('0xe'))));}},'alias':{'type':Sequelize[_0x92d6('0x9')]},'email':{'type':Sequelize[_0x92d6('0x9')],'allowNull':![],'unique':_0x92d6('0xf'),'validate':{'isEmail':!![]},'set':function(_0x33e1ea){if(_0x33e1ea){this['setDataValue']('email',_0x33e1ea[_0x92d6('0x10')]());}}},'role':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x12'),'user',_0x92d6('0x13'),_0x92d6('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x92d6('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x92d6('0x9')],'defaultValue':_0x92d6('0x15')},'internal':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':![],'unique':_0x92d6('0xe'),'set':function(_0x4962f9){this['setDataValue']('internal',_0x4962f9);this['setDataValue'](_0x92d6('0x17'),_0x4962f9);this['setDataValue'](_0x92d6('0xb'),util[_0x92d6('0xc')](_0x92d6('0x18'),this[_0x92d6('0xd')](_0x92d6('0xa')),_0x4962f9));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x92d6('0x9')]},'mobile':{'type':Sequelize[_0x92d6('0x9')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x92d6('0x9')]},'userpic':{'type':Sequelize[_0x92d6('0x9')]},'city':{'type':Sequelize[_0x92d6('0x9')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x92d6('0x1a')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x92d6('0x9')],'defaultValue':_0x92d6('0x1b')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x92d6('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x92d6('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x92d6('0x16')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x92d6('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x92d6('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x92d6('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'description':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'host':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x92d6('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x1c'),_0x92d6('0x1d'),_0x92d6('0x1e')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0x92d6('0x1f'),_0x92d6('0x20'),_0x92d6('0x21'),'ALLOWED',_0x92d6('0x22'),_0x92d6('0x23'),'PROHIB_FAILED_SCREEN',_0x92d6('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'permit':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'transport':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![],'defaultValue':_0x92d6('0x25'),'set':function(_0x135cf9){this[_0x92d6('0x6')]('transport',_0x135cf9?_0x135cf9[_0x92d6('0x26')](','):null);},'get':function(){return this[_0x92d6('0xd')](_0x92d6('0x27'))?this['getDataValue']('transport')[_0x92d6('0x28')](','):null;},'comment':_0x92d6('0x29')},'dtmfmode':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x2a'),_0x92d6('0x2b'),_0x92d6('0x2c'),'inband',_0x92d6('0x2d')),'allowNull':!![],'defaultValue':_0x92d6('0x2a')},'directmedia':{'type':Sequelize[_0x92d6('0x11')]('yes','no',_0x92d6('0x2e'),_0x92d6('0x2f'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x92d6('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'nat':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![],'defaultValue':_0x92d6('0x31'),'set':function(_0x1c6b02){this[_0x92d6('0x6')]('nat',_0x1c6b02?_0x1c6b02['join'](','):null);},'get':function(){return this[_0x92d6('0xd')](_0x92d6('0x32'))?this[_0x92d6('0xd')](_0x92d6('0x32'))[_0x92d6('0x28')](','):null;},'comment':_0x92d6('0x33')},'callgroup':{'type':Sequelize[_0x92d6('0x9')]},'namedcallgroup':{'type':Sequelize[_0x92d6('0x9')]},'pickupgroup':{'type':Sequelize[_0x92d6('0x9')]},'namedpickupgroup':{'type':Sequelize[_0x92d6('0x9')]},'language':{'type':Sequelize[_0x92d6('0x9')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x92d6('0x34')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x92d6('0x35'),'set':function(_0x30c871){this[_0x92d6('0x6')]('allow',_0x30c871?_0x30c871[_0x92d6('0x26')](';'):_0x92d6('0x35'));},'get':function(){return this[_0x92d6('0xd')](_0x92d6('0x36'))?this['getDataValue'](_0x92d6('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x92d6('0x11')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![],'set':function(_0x561464){this['setDataValue'](_0x92d6('0x37'),_0x561464?_0x561464['join'](','):null);},'get':function(){return this[_0x92d6('0xd')](_0x92d6('0x37'))?this[_0x92d6('0xd')](_0x92d6('0x37'))[_0x92d6('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x92d6('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no',_0x92d6('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![],'defaultValue':_0x92d6('0x39')},'amaflags':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x92d6('0x30'),'no'),'allowNull':!![],'defaultValue':_0x92d6('0x30')},'busylevel':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x92d6('0x30'),'no',_0x92d6('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x92d6('0x11')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x3b'),_0x92d6('0x3c'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x3d'),_0x92d6('0x3e')),'allowNull':!![],'defaultValue':_0x92d6('0x3e')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![],'defaultValue':_0x92d6('0x30')},'keepalive':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x92d6('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x92d6('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no',_0x92d6('0x3f'),_0x92d6('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x41'),_0x92d6('0x42'),_0x92d6('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x92d6('0x30'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x92d6('0x16')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x92d6('0x11')](_0x92d6('0x30'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x92d6('0x11')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x92d6('0x11')]('yes','no',_0x92d6('0x2e'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x92d6('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0x92d6('0x1a')]},'passwordResetAt':{'type':Sequelize[_0x92d6('0x1a')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x92d6('0x44')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x51318e){this[_0x92d6('0x6')]('showWebBar',_0x51318e);var _0x48cfa9=this[_0x92d6('0x45')]({'plain':!![]});switch(_0x51318e){case 0x0:case 0x1:var _0x3cc85b=_0x48cfa9[_0x92d6('0x27')]?_[_0x92d6('0x46')](_0x48cfa9[_0x92d6('0x27')])?_0x48cfa9[_0x92d6('0x27')][_0x92d6('0x26')]():_0x48cfa9['transport']:'udp';if(_0x3cc85b==='wss'){_0x3cc85b='udp';}this[_0x92d6('0x6')](_0x92d6('0x27'),_0x3cc85b);this['setDataValue']('encryption','no');this['setDataValue'](_0x92d6('0x47'),null);this[_0x92d6('0x6')](_0x92d6('0x48'),null);this[_0x92d6('0x6')](_0x92d6('0x49'),null);this[_0x92d6('0x6')](_0x92d6('0x4a'),null);this['setDataValue'](_0x92d6('0x4b'),null);this[_0x92d6('0x6')](_0x92d6('0x4c'),null);this[_0x92d6('0x6')](_0x92d6('0x4d'),null);this['setDataValue']('dtlsprivatekey',null);this[_0x92d6('0x6')](_0x92d6('0x4e'),'no');break;case 0x2:this[_0x92d6('0x6')]('transport',_0x92d6('0x4f'));this[_0x92d6('0x6')](_0x92d6('0x50'),_0x92d6('0x30'));this['setDataValue'](_0x92d6('0x47'),_0x92d6('0x30'));this[_0x92d6('0x6')]('force_avp',_0x92d6('0x30'));this['setDataValue'](_0x92d6('0x49'),'yes');this[_0x92d6('0x6')](_0x92d6('0x4a'),_0x92d6('0x30'));this[_0x92d6('0x6')](_0x92d6('0x4b'),'no');this[_0x92d6('0x6')]('dtlssetup',_0x92d6('0x43'));this['setDataValue'](_0x92d6('0x4d'),_0x48cfa9[_0x92d6('0x4d')]||_0x92d6('0x51'));this[_0x92d6('0x6')](_0x92d6('0x52'),_0x48cfa9[_0x92d6('0x52')]||'/etc/pki/tls/private/motion.key');this[_0x92d6('0x6')](_0x92d6('0x4e'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x92d6('0x44')],'set':function(_0x2870fa){this[_0x92d6('0x6')]('permissions',_0x2870fa?_0x2870fa['join'](','):[]);},'get':function(){return this['getDataValue'](_0x92d6('0x53'))?_[_0x92d6('0x54')](this[_0x92d6('0xd')]('permissions')[_0x92d6('0x28')](','),function(_0x116afa){return parseInt(_0x116afa,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x92d6('0x9')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x92d6('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x92d6('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x92d6('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x92d6('0x30'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x92d6('0x55')],'get':function(){return this[_0x92d6('0xd')](_0x92d6('0x56'))?this[_0x92d6('0xd')](_0x92d6('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x92d6('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x50e560){if(typeof _0x50e560===_0x92d6('0x57')){var _0x33a18b=_0x50e560==='1'?!![]:_0x50e560==='0'?![]:_0x50e560===_0x92d6('0x58')?!![]:_0x50e560===_0x92d6('0x59')?![]:![];this['setDataValue']('screenrecording',_0x33a18b);}else{this[_0x92d6('0x6')](_0x92d6('0x5a'),_0x50e560);}}},'blocked':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![],'set':function(_0x339160){this[_0x92d6('0x6')](_0x92d6('0x5b'),_0x339160);if(_0x339160===!![]){this[_0x92d6('0x6')](_0x92d6('0x5c'),moment());this[_0x92d6('0x6')](_0x92d6('0x5d'),0x0);}else{this[_0x92d6('0x6')](_0x92d6('0x5c'),null);}}},'blockedAt':{'type':Sequelize[_0x92d6('0x1a')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x92d6('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x92d6('0x16')](0x5)[_0x92d6('0x5e')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x92d6('0x19')],'defaultValue':![]}};
\ No newline at end of file
index ea14322..eeaf5f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab19=['request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','busy','slice','charAt','toUpperCase','SELECT','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','register','redis','localhost','client','http','then','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','role','admin','Users','user','Agents','agent','filter','ignore','value','includes','name','UserProfileResource','stack','send','index','User','rawAttributes','map','fieldName','type','key','password','salt','where','query','includeAll','attributes','push','rows','length','fax','dataValues','mail','openchannel','whatsapp','show','params','model','differenceBy','keys','filters','intersection','fields','include','userSetting','true','merge','options','openTabs','all','body','find','describe','omit','Setting','findById','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','103','113','110','104','105','100','111','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Telephones','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','each','telephone','findAll','isEmpty','changePassword','oldPassword','newPassword','Sequelize','ValidationError','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','updatePasswordsHistory','addQueues','channel','online','voicePause','add','capitalize','toLowerCase','Queues','ids','penalty','spread','emit','Queue:save','voice','VoiceQueue','interface','format','SIP/%s','UserVoiceQueueRt','upsert','isValidChannel','Unknown\x20channel','remove','isArray','QueueId','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','getOpenTabs','chat','sms','ChatOpenTabs','CHAT','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','concat','getContacts','findOne','CmContact','order','sort','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','Queue','nolimit','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','mobile','loginInPause','intrf','user:forcelogout','headers','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','LOGININPAUSE','isMiddleware','logout','forEach','QueuePause','pause','PAUSE','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','smsPause','pauseType','manual','Pause','getTeams','addTeams','Team','setDataValue','Voice','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','Openchannel','flatten','transaction','addAgent','getDataValue','UserVoicePrefix','VoicePrefixId','removeTeams','Chat','getMailQueues','Mail','removeAgent','TeamVoicePrefix','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','$and','$or','$lte','$ne','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','CmHopper','lastName','phone','Contact','dialActive','getApiKey','retrieveApiKey','token','createApiKey','generateApiKey','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','resolve','queues','teams','inbound','lower','toString','asc','desc','substring','uniqBy','orderBy'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xab19,0x1a6));var _0x9ab1=function(_0x7c04f0,_0x38d84e){_0x7c04f0=_0x7c04f0-0x0;var _0xe16803=_0xab19[_0x7c04f0];return _0xe16803;};'use strict';var moment=require(_0x9ab1('0x0'));var BPromise=require(_0x9ab1('0x1'));var util=require(_0x9ab1('0x2'));var path=require(_0x9ab1('0x3'));var fs=require('fs');var _=require(_0x9ab1('0x4'));var squel=require(_0x9ab1('0x5'));var jayson=require('jayson/promise');var Redis=require(_0x9ab1('0x6'));var authService=require('../../components/auth/service');var qs=require(_0x9ab1('0x7'));var logger=require(_0x9ab1('0x8'))('api');var utils=require(_0x9ab1('0x9'));var config=require(_0x9ab1('0xa'));var licenseUtil=require(_0x9ab1('0xb'));var db=require(_0x9ab1('0xc'))['db'];var socket=require(_0x9ab1('0xd'))(new Redis(config['redis']));require('./user.socket')[_0x9ab1('0xe')](socket);config[_0x9ab1('0xf')]=_['defaults'](config[_0x9ab1('0xf')],{'host':_0x9ab1('0x10'),'port':0x18eb});var client=jayson[_0x9ab1('0x11')][_0x9ab1('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0x2efd88,_0x559304,_0xb88827,_0x480a18){return new BPromise(function(_0x4da929,_0x1cb106){var _0x5eec41=_0x480a18||client;return _0x5eec41['request'](_0x2efd88,_0xb88827)[_0x9ab1('0x13')](function(_0x820421){logger[_0x9ab1('0x14')](_0x9ab1('0x15'),_0x559304,'request\x20sent');logger['debug'](_0x9ab1('0x16'),_0x559304,'request\x20sent',JSON['stringify'](_0x820421));if(_0x820421[_0x9ab1('0x17')]){if(_0x820421['error']['code']===0x1f4){logger[_0x9ab1('0x17')](_0x9ab1('0x15'),_0x559304,_0x820421[_0x9ab1('0x17')][_0x9ab1('0x18')]);return _0x1cb106(_0x820421['error'][_0x9ab1('0x18')]);}logger['error'](_0x9ab1('0x15'),_0x559304,_0x820421[_0x9ab1('0x17')][_0x9ab1('0x18')]);return _0x4da929(_0x820421['error'][_0x9ab1('0x18')]);}else{logger[_0x9ab1('0x14')](_0x9ab1('0x15'),_0x559304,_0x9ab1('0x19'));_0x4da929(_0x820421['result']['message']);}})[_0x9ab1('0x1a')](function(_0x2261c9){logger[_0x9ab1('0x17')](_0x9ab1('0x15'),_0x559304,_0x2261c9);_0x1cb106(_0x2261c9);});});}function respondWithStatusCode(_0x633708,_0x3e12e4){_0x3e12e4=_0x3e12e4||0xcc;return function(_0x5a0f18){if(_0x5a0f18){return _0x633708['sendStatus'](_0x3e12e4);}return _0x633708[_0x9ab1('0x1b')](_0x3e12e4)[_0x9ab1('0x1c')]();};}function respondWithResult(_0x3bef18,_0x5240da){_0x5240da=_0x5240da||0xc8;return function(_0x6f8154){if(_0x6f8154){return _0x3bef18[_0x9ab1('0x1b')](_0x5240da)['json'](_0x6f8154);}};}function respondWithFilteredResult(_0x572820,_0x10d297){return function(_0x18f36f){if(_0x18f36f){var _0x10f0e7=typeof _0x10d297[_0x9ab1('0x1d')]===_0x9ab1('0x1e')&&typeof _0x10d297[_0x9ab1('0x1f')]==='undefined';var _0x27bf21=_0x18f36f[_0x9ab1('0x20')];var _0x65258d=_0x10f0e7?0x0:_0x10d297[_0x9ab1('0x1d')];var _0x28c212=_0x10f0e7?_0x18f36f[_0x9ab1('0x20')]:_0x10d297[_0x9ab1('0x1d')]+_0x10d297[_0x9ab1('0x1f')];var _0x1ba2ba;if(_0x28c212>=_0x27bf21){_0x28c212=_0x27bf21;_0x1ba2ba=0xc8;}else{_0x1ba2ba=0xce;}_0x572820[_0x9ab1('0x1b')](_0x1ba2ba);return _0x572820[_0x9ab1('0x21')](_0x9ab1('0x22'),_0x65258d+'-'+_0x28c212+'/'+_0x27bf21)[_0x9ab1('0x23')](_0x18f36f);}return null;};}function saveUpdates(_0x118fd7){return function(_0x2ceab2){if(_0x2ceab2){return _0x2ceab2[_0x9ab1('0x24')](_0x118fd7)['then'](function(_0x4e1c6d){return _0x4e1c6d;});}return null;};}function removeEntity(_0x12cf3f){return function(_0x2f8d54){if(_0x2f8d54){return _0x2f8d54[_0x9ab1('0x25')]()[_0x9ab1('0x13')](function(){var _0x2c2a57=_0x2f8d54[_0x9ab1('0x26')]({'plain':!![]});if(_0x2c2a57[_0x9ab1('0x27')]===_0x9ab1('0x28'))return;var _0x5ed9a2=[{'name':_0x9ab1('0x29'),'value':_0x9ab1('0x2a'),'ignore':!![]},{'name':_0x9ab1('0x2b'),'value':_0x9ab1('0x2c'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0xa3c8b1=_(_0x5ed9a2)[_0x9ab1('0x2d')](_0x9ab1('0x2e'))['map'](_0x9ab1('0x2f'))[_0x9ab1('0x2f')]();if(_[_0x9ab1('0x30')](_0xa3c8b1,_0x2c2a57[_0x9ab1('0x27')])){return;}var _0x1c1472=_['find'](_0x5ed9a2,[_0x9ab1('0x2f'),_0x2c2a57[_0x9ab1('0x27')]])[_0x9ab1('0x31')];return db[_0x9ab1('0x32')][_0x9ab1('0x25')]({'where':{'type':_0x1c1472,'resourceId':_0x2c2a57['id']}})['then'](function(){return _0x2f8d54;});})[_0x9ab1('0x13')](function(){_0x12cf3f[_0x9ab1('0x1b')](0xcc)[_0x9ab1('0x1c')]();});}};}function handleEntityNotFound(_0x580637){return function(_0x25bf80){if(!_0x25bf80){_0x580637['sendStatus'](0x194);}return _0x25bf80;};}function handleError(_0x4ce911,_0x2e4847){_0x2e4847=_0x2e4847||0x1f4;return function(_0x274d38){logger[_0x9ab1('0x17')](_0x274d38[_0x9ab1('0x33')]);if(_0x274d38['name']){delete _0x274d38[_0x9ab1('0x31')];}_0x4ce911[_0x9ab1('0x1b')](_0x2e4847)[_0x9ab1('0x34')](_0x274d38);};}exports[_0x9ab1('0x35')]=function(_0x2d2c17,_0x570b53){var _0x1f6993={},_0x4e5716={'count':0x0,'rows':[]};var _0x4f585a=_(db[_0x9ab1('0x36')][_0x9ab1('0x37')])[_0x9ab1('0x38')](function(_0x45accb){return{'name':_0x45accb[_0x9ab1('0x39')],'type':_0x45accb[_0x9ab1('0x3a')][_0x9ab1('0x3b')]};})[_0x9ab1('0x2d')](function(_0x2ca332){return!_[_0x9ab1('0x30')]([_0x9ab1('0x3c'),_0x9ab1('0x3d')],_0x2ca332['name']);})[_0x9ab1('0x2f')]();_0x1f6993=qs['getOptions'](_0x4f585a,_0x2d2c17);var _0x3d76b6={'where':_0x1f6993[_0x9ab1('0x3e')]};return db['User']['count'](_0x3d76b6)[_0x9ab1('0x13')](function(_0x114444){_0x4e5716[_0x9ab1('0x20')]=_0x114444;if(_0x2d2c17[_0x9ab1('0x3f')][_0x9ab1('0x40')]){_0x1f6993['include']=[{'all':!![]}];}if(_0x2d2c17[_0x9ab1('0x3f')]['userSetting']==='true'){_0x1f6993['include']=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_[_0x9ab1('0x30')](_0x1f6993[_0x9ab1('0x41')],'id')){_0x1f6993['attributes'][_0x9ab1('0x42')]('id');}return db[_0x9ab1('0x36')]['findAll'](_0x1f6993);})[_0x9ab1('0x13')](function(_0x4f6064){_0x4e5716['rows']=_0x4f6064;if(_0x2d2c17['query']['openTabs']==='true'){var _0x5e5ac8=[];for(var _0x521f76=0x0;_0x521f76<_0x4e5716[_0x9ab1('0x43')][_0x9ab1('0x44')];_0x521f76++){_0x5e5ac8[_0x9ab1('0x42')](get_open_tabs('chat',_0x4e5716[_0x9ab1('0x43')][_0x521f76]['dataValues']));_0x5e5ac8[_0x9ab1('0x42')](get_open_tabs('sms',_0x4e5716[_0x9ab1('0x43')][_0x521f76]['dataValues']));_0x5e5ac8['push'](get_open_tabs(_0x9ab1('0x45'),_0x4e5716[_0x9ab1('0x43')][_0x521f76][_0x9ab1('0x46')]));_0x5e5ac8[_0x9ab1('0x42')](get_open_tabs(_0x9ab1('0x47'),_0x4e5716[_0x9ab1('0x43')][_0x521f76][_0x9ab1('0x46')]));_0x5e5ac8[_0x9ab1('0x42')](get_open_tabs(_0x9ab1('0x48'),_0x4e5716[_0x9ab1('0x43')][_0x521f76][_0x9ab1('0x46')]));_0x5e5ac8[_0x9ab1('0x42')](get_open_tabs(_0x9ab1('0x49'),_0x4e5716['rows'][_0x521f76]['dataValues']));}return BPromise['all'](_0x5e5ac8)['then'](function(){return _0x4e5716;});}else{return _0x4e5716;}})['then'](respondWithFilteredResult(_0x570b53,_0x1f6993))['catch'](handleError(_0x570b53,null));};exports[_0x9ab1('0x4a')]=function(_0x142f71,_0x23e53c){var _0x53eb18={'raw':![],'where':{'id':_0x142f71[_0x9ab1('0x4b')]['id']}},_0x4cdfba={};_0x4cdfba[_0x9ab1('0x4c')]=_[_0x9ab1('0x4d')](_[_0x9ab1('0x4e')](db[_0x9ab1('0x36')][_0x9ab1('0x37')]),[_0x9ab1('0x3c'),_0x9ab1('0x3d')]);_0x4cdfba[_0x9ab1('0x3f')]=_['keys'](_0x142f71[_0x9ab1('0x3f')]);_0x4cdfba[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x4cdfba[_0x9ab1('0x4c')],_0x4cdfba[_0x9ab1('0x3f')]);_0x53eb18['attributes']=_['intersection'](_0x4cdfba[_0x9ab1('0x4c')],qs['fields'](_0x142f71[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x53eb18[_0x9ab1('0x41')]=_0x53eb18[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x53eb18[_0x9ab1('0x41')]:_0x4cdfba['model'];if(_0x142f71[_0x9ab1('0x3f')][_0x9ab1('0x40')]){_0x53eb18[_0x9ab1('0x52')]=[{'all':!![]}];}if(_0x142f71['query'][_0x9ab1('0x53')]===_0x9ab1('0x54')){_0x53eb18['include']=[{'model':db['UserSetting'],'as':_0x9ab1('0x53')}];}_0x53eb18=_[_0x9ab1('0x55')]({},_0x53eb18,_0x142f71[_0x9ab1('0x56')]);if(!_[_0x9ab1('0x30')](_0x53eb18['attributes'],'id')){_0x53eb18[_0x9ab1('0x41')]['push']('id');}return db[_0x9ab1('0x36')]['find'](_0x53eb18)['then'](handleEntityNotFound(_0x23e53c,null))[_0x9ab1('0x13')](function(_0x34fbfc){var _0x250ff8=[];values=_0x34fbfc;if(_0x142f71[_0x9ab1('0x3f')][_0x9ab1('0x57')]===_0x9ab1('0x54')){_0x250ff8[_0x9ab1('0x42')](get_open_tabs('chat',_0x34fbfc[_0x9ab1('0x46')]));_0x250ff8[_0x9ab1('0x42')](get_open_tabs('sms',_0x34fbfc[_0x9ab1('0x46')]));_0x250ff8[_0x9ab1('0x42')](get_open_tabs(_0x9ab1('0x48'),_0x34fbfc[_0x9ab1('0x46')]));_0x250ff8[_0x9ab1('0x42')](get_open_tabs(_0x9ab1('0x49'),_0x34fbfc[_0x9ab1('0x46')]));_0x250ff8[_0x9ab1('0x42')](get_open_tabs('fax',_0x34fbfc['dataValues']));_0x250ff8[_0x9ab1('0x42')](get_open_tabs(_0x9ab1('0x47'),_0x34fbfc[_0x9ab1('0x46')]));return BPromise[_0x9ab1('0x58')](_0x250ff8);}else{return values;}})['then'](function(){return values;})[_0x9ab1('0x13')](respondWithResult(_0x23e53c,null))['catch'](handleError(_0x23e53c,null));};exports['update']=function(_0x4ea9b4,_0x580e04){if(_0x4ea9b4[_0x9ab1('0x59')]['id']){delete _0x4ea9b4[_0x9ab1('0x59')]['id'];}delete _0x4ea9b4['body'][_0x9ab1('0x27')];return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x4ea9b4['params']['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x580e04,null))[_0x9ab1('0x13')](saveUpdates(_0x4ea9b4[_0x9ab1('0x59')],null))['then'](respondWithResult(_0x580e04,null))[_0x9ab1('0x1a')](handleError(_0x580e04,null));};exports[_0x9ab1('0x5b')]=function(_0x408419,_0x189785){return db[_0x9ab1('0x36')][_0x9ab1('0x5b')]()['then'](respondWithResult(_0x189785,null))[_0x9ab1('0x1a')](handleError(_0x189785,null));};exports['addContacts']=function(_0x4c272f,_0x5c974f){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x4c272f[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x5c974f,null))[_0x9ab1('0x13')](function(_0x1296ac){if(_0x1296ac){return _0x1296ac['addContacts'](_0x4c272f[_0x9ab1('0x59')]['ids'],_[_0x9ab1('0x5c')](_0x4c272f[_0x9ab1('0x59')],['ids','id'])||{});}})['then'](respondWithResult(_0x5c974f,null))[_0x9ab1('0x1a')](handleError(_0x5c974f,null));};function validateUser(_0x1349e9){return new BPromise(function(_0x37c9dd,_0xdf13c2){if(_0x1349e9['internal'])return _0x37c9dd(_0x1349e9);return db[_0x9ab1('0x5d')][_0x9ab1('0x5e')](0x1)[_0x9ab1('0x13')](function(_0x840554){if(_0x840554['securePassword'])authService[_0x9ab1('0x5f')](_0x1349e9[_0x9ab1('0x3c')]);db[_0x9ab1('0x36')][_0x9ab1('0x60')](_0x9ab1('0x61'))[_0x9ab1('0x13')](function(_0x47a441){if(_[_0x9ab1('0x62')](_0x47a441)){_0x1349e9[_0x9ab1('0x61')]=_0x840554[_0x9ab1('0x63')]||0x1;return;}if(_[_0x9ab1('0x62')](_0x840554[_0x9ab1('0x63')])||_0x840554['min_internal']===_0x47a441){_0x1349e9['internal']=_0x47a441+0x1;return;}if(_0x840554[_0x9ab1('0x63')]>_0x47a441){_0x1349e9[_0x9ab1('0x61')]=_0x840554[_0x9ab1('0x63')];return;}return db[_0x9ab1('0x64')][_0x9ab1('0x3f')]('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[_0x9ab1('0x64')][_0x9ab1('0x65')]['SELECT']})['then'](function(_0x2e1a41){if(_0x2e1a41&&_0x2e1a41[_0x9ab1('0x44')]){for(var _0x610cc8=0x0,_0x121a72=_0x2e1a41[_0x9ab1('0x44')];_0x610cc8<_0x121a72&&_['isNil'](_0x1349e9[_0x9ab1('0x61')]);_0x610cc8++){if(_0x840554[_0x9ab1('0x63')]<=_0x2e1a41[_0x610cc8][_0x9ab1('0x66')]){_0x1349e9[_0x9ab1('0x61')]=_0x2e1a41[_0x610cc8][_0x9ab1('0x66')];}else if(_0x840554[_0x9ab1('0x63')]>_0x2e1a41[_0x610cc8][_0x9ab1('0x66')]&&_0x840554[_0x9ab1('0x63')]<=_0x2e1a41[_0x610cc8]['to']){_0x1349e9[_0x9ab1('0x61')]=_0x840554[_0x9ab1('0x63')];}}}if(_[_0x9ab1('0x62')](_0x1349e9['internal'])){_0x1349e9[_0x9ab1('0x61')]=_0x47a441+0x1;}return _0x37c9dd(_0x1349e9);});});})[_0x9ab1('0x1a')](function(_0x1bb3be){_0xdf13c2(_0x1bb3be);});});}function updateUser(_0x3dbef9){return new BPromise(function(_0x240c43,_0x2b9faa){try{if(_0x3dbef9[_0x9ab1('0x67')]){_0x3dbef9[_0x9ab1('0x68')]=_0x3dbef9[_0x9ab1('0x61')];_0x3dbef9[_0x9ab1('0x69')]={'mailbox':_0x3dbef9[_0x9ab1('0x61')],'password':_0x3dbef9[_0x9ab1('0x3c')],'fullname':_0x3dbef9[_0x9ab1('0x6a')],'email':_0x3dbef9['email']};}if(_0x3dbef9['role']===_0x9ab1('0x2c')){if(!_0x3dbef9[_0x9ab1('0x6b')])_0x3dbef9['permissions']=[_0x9ab1('0x6c'),'102',_0x9ab1('0x6d'),_0x9ab1('0x6e'),_0x9ab1('0x6f'),_0x9ab1('0x70'),_0x9ab1('0x71'),'106','107','108','109',_0x9ab1('0x72'),_0x9ab1('0x73'),'114',_0x9ab1('0x74')];}_0x240c43(_0x3dbef9);}catch(_0x393c68){_0x2b9faa(_0x393c68);}});}exports[_0x9ab1('0x75')]=function(_0x3853a3,_0x469dfe){if(_0x3853a3[_0x9ab1('0x2a')][_0x9ab1('0x27')]===_0x9ab1('0x2c'))throw new Error(_0x9ab1('0x76'));if(_0x3853a3[_0x9ab1('0x59')]['role']==='user'&&_0x3853a3[_0x9ab1('0x2a')][_0x9ab1('0x27')]!==_0x9ab1('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3853a3['body']['role']===_0x9ab1('0x28')&&_0x3853a3[_0x9ab1('0x2a')]['role']!==_0x9ab1('0x28')){throw new Error(_0x9ab1('0x77'));}return licenseUtil[_0x9ab1('0x78')]([_0x3853a3[_0x9ab1('0x59')]])[_0x9ab1('0x13')](function(){return validateUser(_0x3853a3['body']);})[_0x9ab1('0x13')](function(_0x47a26d){return updateUser(_0x47a26d)['then'](function(_0xf24bbf){if(_0xf24bbf['role']===_0x9ab1('0x28')){_0xf24bbf[_0x9ab1('0x79')]=_0x3853a3[_0x9ab1('0x2a')][_0x9ab1('0x79')];delete _0xf24bbf[_0x9ab1('0x7a')];}return _0xf24bbf;});})[_0x9ab1('0x13')](function(_0x6b6f80){return db['User'][_0x9ab1('0x75')](_0x6b6f80,{'include':[{'model':db[_0x9ab1('0x69')],'as':'VoiceMail'}]});})[_0x9ab1('0x13')](function(_0x163ae9){if(_0x3853a3['body'][_0x9ab1('0x27')]==='user')return _0x163ae9;if(_0x3853a3[_0x9ab1('0x2a')][_0x9ab1('0x27')]!==_0x9ab1('0x2a'))return _0x163ae9;return db[_0x9ab1('0x7b')]['find']({'where':{'name':_0x163ae9[_0x9ab1('0x27')]===_0x9ab1('0x2c')?_0x9ab1('0x2b'):_0x9ab1('0x7c'),'userProfileId':_0x3853a3['user']['userProfileId']},'raw':!![]})[_0x9ab1('0x13')](function(_0x13acc6){if(!_0x13acc6||_0x13acc6[_0x9ab1('0x7d')]!=0x0)return _0x163ae9;return db[_0x9ab1('0x32')][_0x9ab1('0x75')]({'name':_0x163ae9[_0x9ab1('0x31')],'resourceId':_0x163ae9['id'],'type':_0x13acc6[_0x9ab1('0x31')],'sectionId':_0x13acc6['id']},{})['then'](function(){return _0x163ae9;});})[_0x9ab1('0x1a')](function(_0x5e8b38){logger[_0x9ab1('0x17')](_0x9ab1('0x7e'),_0x5e8b38);throw _0x5e8b38;});})[_0x9ab1('0x13')](respondWithResult(_0x469dfe,0xc9))[_0x9ab1('0x1a')](handleError(_0x469dfe,null));};exports[_0x9ab1('0x7f')]=function(_0x4b1a41,_0x498083){var _0x26ed8b=_0x4b1a41['body'];var _0x593b2b=[];if(_0x4b1a41['user']['role']===_0x9ab1('0x2c'))throw new Error(_0x9ab1('0x76'));if(_['some'](_0x26ed8b,[_0x9ab1('0x27'),_0x9ab1('0x2a')])&&_0x4b1a41[_0x9ab1('0x2a')]['role']!==_0x9ab1('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x9ab1('0x80')](_0x26ed8b,['role','admin'])&&_0x4b1a41['user'][_0x9ab1('0x27')]!==_0x9ab1('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x26ed8b)['then'](function(){return validateUser(_0x26ed8b[0x0]);})[_0x9ab1('0x13')](function(){for(var _0x14c073=0x1;_0x14c073<_0x26ed8b[_0x9ab1('0x44')];_0x14c073++){var _0x1a0ea9=_0x26ed8b[_0x14c073-0x1][_0x9ab1('0x61')];if(!_0x26ed8b[_0x14c073]['internal'])_0x26ed8b[_0x14c073][_0x9ab1('0x61')]=_0x1a0ea9+0x1;_0x593b2b['push'](validateUser(_0x26ed8b[_0x14c073]));}return BPromise[_0x9ab1('0x58')](_0x593b2b);})['then'](function(){_0x593b2b=[];for(var _0xc4c59a=0x0;_0xc4c59a<_0x26ed8b[_0x9ab1('0x44')];_0xc4c59a++){_0x593b2b[_0x9ab1('0x42')](updateUser(_0x26ed8b[_0xc4c59a]));}return BPromise['all'](_0x593b2b);})[_0x9ab1('0x13')](function(){return BPromise[_0x9ab1('0x81')](_0x26ed8b,function(_0x2321d2){return db[_0x9ab1('0x36')][_0x9ab1('0x75')](_0x2321d2,{'include':[{'model':db[_0x9ab1('0x69')],'as':_0x9ab1('0x69')}]})[_0x9ab1('0x13')](function(_0x5f17a1){_0x2321d2['id']=_0x5f17a1['id'];return _0x2321d2;});});})[_0x9ab1('0x13')](function(_0x1acb6a){if(_0x4b1a41[_0x9ab1('0x59')][_0x9ab1('0x27')]===_0x9ab1('0x2a'))return _0x1acb6a;if(_0x4b1a41[_0x9ab1('0x2a')]['role']!==_0x9ab1('0x2a'))return _0x1acb6a;var _0x3890e5=_['some'](_0x1acb6a,function(_0x5d112a){return _0x5d112a[_0x9ab1('0x27')]==='agent'||_0x5d112a[_0x9ab1('0x27')]===_0x9ab1('0x82');});if(!_0x3890e5)return _0x1acb6a;return db[_0x9ab1('0x7b')][_0x9ab1('0x83')]({'where':{'name':{'$or':[_0x9ab1('0x2b'),'Telephones']},'userProfileId':_0x4b1a41[_0x9ab1('0x2a')][_0x9ab1('0x7a')]},'raw':!![]})[_0x9ab1('0x13')](function(_0x272435){if(_[_0x9ab1('0x84')](_0x272435)||!_[_0x9ab1('0x80')](_0x272435,['autoAssociation',0x0]))return _0x1acb6a;_0x593b2b=[];var _0x5d66ca=_(_0x272435)[_0x9ab1('0x38')](function(_0x1cf47a){if(_0x1cf47a[_0x9ab1('0x7d')]===0x1)return;return _0x1cf47a['name']===_0x9ab1('0x2b')?_0x9ab1('0x2c'):_0x9ab1('0x82');})['compact']()['value']();for(var _0x56f963=0x0;_0x56f963<_0x1acb6a['length'];_0x56f963++){if(!_['includes'](_0x5d66ca,_0x1acb6a[_0x56f963]['role']))return;var _0x4123f5=_0x1acb6a[_0x56f963]['role']===_0x9ab1('0x2c')?_0x9ab1('0x2b'):'Telephones';_0x593b2b[_0x9ab1('0x42')](db[_0x9ab1('0x32')][_0x9ab1('0x75')]({'name':_0x1acb6a[_0x56f963][_0x9ab1('0x31')],'resourceId':_0x1acb6a[_0x56f963]['id'],'type':_0x4123f5,'sectionId':_['find'](_0x272435,[_0x9ab1('0x31'),_0x4123f5])['id']},{}));}return BPromise['all'](_0x593b2b);});})['then'](respondWithResult(_0x498083,0xc9))[_0x9ab1('0x1a')](handleError(_0x498083,null));};exports[_0x9ab1('0x85')]=function(_0x50d0de,_0x1222ea){if(_0x50d0de['body']['id']){delete _0x50d0de[_0x9ab1('0x59')]['id'];}return db[_0x9ab1('0x36')]['find']({'where':{'id':_0x50d0de['params']['id']}})['then'](function(_0x4d7e2d){if(!_0x4d7e2d)return null;if(_0x4d7e2d['id']===_0x50d0de['user']['id']){if(!_0x50d0de[_0x9ab1('0x59')][_0x9ab1('0x86')]||!_0x50d0de[_0x9ab1('0x59')][_0x9ab1('0x87')]){throw new db[(_0x9ab1('0x88'))][(_0x9ab1('0x89'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x4d7e2d[_0x9ab1('0x8a')](_0x50d0de['body'][_0x9ab1('0x86')])){throw new db[(_0x9ab1('0x88'))][(_0x9ab1('0x89'))]('Wrong\x20credentials');}if(_0x50d0de[_0x9ab1('0x59')][_0x9ab1('0x86')]===_0x50d0de[_0x9ab1('0x59')][_0x9ab1('0x87')]){throw new db[(_0x9ab1('0x88'))]['ValidationError'](_0x9ab1('0x8b'));}}else if(_0x50d0de[_0x9ab1('0x2a')][_0x9ab1('0x27')]==='admin'){if(!_0x50d0de['body'][_0x9ab1('0x87')]){throw new db[(_0x9ab1('0x88'))][(_0x9ab1('0x89'))](_0x9ab1('0x8c'));}}else if(_0x50d0de[_0x9ab1('0x2a')][_0x9ab1('0x27')]===_0x9ab1('0x2a')){if(!_0x50d0de[_0x9ab1('0x59')][_0x9ab1('0x87')]){throw new db[(_0x9ab1('0x88'))][(_0x9ab1('0x89'))](_0x9ab1('0x8c'));}if(_0x4d7e2d[_0x9ab1('0x27')]!=='agent'){throw new db['Sequelize'][(_0x9ab1('0x89'))](_0x9ab1('0x76'));}}else{throw new db[(_0x9ab1('0x88'))][(_0x9ab1('0x89'))](_0x9ab1('0x76'));}return _0x4d7e2d;})['then'](handleEntityNotFound(_0x1222ea,null))[_0x9ab1('0x13')](function(_0x143d8a){return db[_0x9ab1('0x5d')]['findOne']({'attributes':['id','securePassword',_0x9ab1('0x8d'),_0x9ab1('0x8e')]})[_0x9ab1('0x13')](function(_0x523d8a){if(_0x523d8a[_0x9ab1('0x8f')])authService[_0x9ab1('0x5f')](_0x50d0de['body'][_0x9ab1('0x87')]);if(!_0x523d8a['enforcePasswordHistory']||!_0x143d8a[_0x9ab1('0x90')])return _0x143d8a;authService['validatePasswordHistory'](_0x50d0de[_0x9ab1('0x59')][_0x9ab1('0x87')],_0x143d8a['previousPasswords'],_0x523d8a['passwordHistoryLimit']);return _0x143d8a;})[_0x9ab1('0x13')](saveUpdates({'password':_0x50d0de[_0x9ab1('0x59')][_0x9ab1('0x87')],'passwordResetAt':_0x50d0de[_0x9ab1('0x2a')]['id']==_0x50d0de[_0x9ab1('0x4b')]['id']?moment():null,'previousPasswords':authService[_0x9ab1('0x91')](_0x50d0de[_0x9ab1('0x59')][_0x9ab1('0x87')],_0x143d8a['previousPasswords'])},null));})[_0x9ab1('0x13')](respondWithResult(_0x1222ea,null))[_0x9ab1('0x1a')](handleError(_0x1222ea,null));};exports[_0x9ab1('0x92')]=function(_0xb5f65e,_0x168007){var _0xf802f6=_0xb5f65e[_0x9ab1('0x59')][_0x9ab1('0x93')];return db[_0x9ab1('0x36')]['find']({'where':{'id':_0xb5f65e['params']['id']},'attributes':['id','name',_0x9ab1('0x27'),_0x9ab1('0x94'),'loginInPause',_0x9ab1('0x95'),'interface']})[_0x9ab1('0x13')](handleEntityNotFound(_0x168007,null))['then'](function(_0x4d2dea){if(_0x4d2dea){if(!utils['isValidChannel'](_0xf802f6)){throw new db[(_0x9ab1('0x88'))][(_0x9ab1('0x89'))]('Unknown\x20channel');}return _0x4d2dea[_0x9ab1('0x96')+_[_0x9ab1('0x97')](_0xf802f6[_0x9ab1('0x98')]())+_0x9ab1('0x99')](_0xb5f65e[_0x9ab1('0x59')][_0x9ab1('0x9a')],{'penalty':_0xb5f65e[_0x9ab1('0x59')][_0x9ab1('0x9b')]||0x0})[_0x9ab1('0x9c')](function(_0xc0c823){for(var _0x4fd43a=0x0;_0x4fd43a<_0xb5f65e[_0x9ab1('0x59')][_0x9ab1('0x9a')][_0x9ab1('0x44')];_0x4fd43a+=0x1){var _0x3e073d={'UserId':Number(_0xb5f65e[_0x9ab1('0x4b')]['id'])};_0x3e073d[_['capitalize'](_0xf802f6[_0x9ab1('0x98')]())+'QueueId']=Number(_0xb5f65e[_0x9ab1('0x59')][_0x9ab1('0x9a')][_0x4fd43a]);socket[_0x9ab1('0x9d')]('user'+_[_0x9ab1('0x97')](_0xf802f6[_0x9ab1('0x98')]())+_0x9ab1('0x9e'),_0x3e073d);}return _0xc0c823;})[_0x9ab1('0x13')](function(){if(_0xf802f6===_0x9ab1('0x9f')){return db[_0x9ab1('0xa0')]['findAll']({'where':{'id':_0xb5f65e[_0x9ab1('0x59')]['ids']||[]},'raw':!![],'attributes':['id',_0x9ab1('0x31')]});}})[_0x9ab1('0x13')](function(_0x2eb693){var _0x2c8e8f=_0x4d2dea[_0x9ab1('0x26')]({'plain':!![]});var _0x3ebe95=[];if(_0xf802f6===_0x9ab1('0x9f')&&_0x2c8e8f[_0x9ab1('0x27')]==='agent'&&_0x2c8e8f[_0x9ab1('0x94')]){for(var _0x420cd2=0x0;_0x420cd2<_0x2eb693[_0x9ab1('0x44')];_0x420cd2+=0x1){_0x3ebe95[_0x9ab1('0x42')]({'membername':_0x2c8e8f[_0x9ab1('0x31')],'UserId':_0x2c8e8f['id'],'queue_name':_0x2eb693[_0x420cd2][_0x9ab1('0x31')],'VoiceQueueId':_0x2eb693[_0x420cd2]['id'],'interface':_[_0x9ab1('0x62')](_0x2c8e8f[_0x9ab1('0xa1')])?util[_0x9ab1('0xa2')](_0x9ab1('0xa3'),_0x2c8e8f[_0x9ab1('0x31')]):_0x2c8e8f[_0x9ab1('0xa1')],'paused':_0x2c8e8f[_0x9ab1('0x95')]||![],'penalty':_0xb5f65e[_0x9ab1('0x59')][_0x9ab1('0x9b')]||0x0});}return BPromise[_0x9ab1('0x81')](_0x3ebe95,function(_0x5a4f98){return db[_0x9ab1('0xa4')][_0x9ab1('0xa5')](_0x5a4f98);});}return _0x4d2dea;});}})['then'](respondWithStatusCode(_0x168007,null))[_0x9ab1('0x1a')](handleError(_0x168007,null));};exports['removeQueues']=function(_0x601a4,_0x30e51c){var _0x2c9aa0,_0x123c90;return db['User'][_0x9ab1('0x5a')]({'where':{'id':_0x601a4[_0x9ab1('0x4b')]['id']},'attributes':['id',_0x9ab1('0x31'),'role']})['then'](handleEntityNotFound(_0x30e51c,null))['then'](function(_0x468bcd){if(_0x468bcd){_0x2c9aa0=_0x468bcd;if(!_0x601a4[_0x9ab1('0x3f')]['channel']||!utils[_0x9ab1('0xa6')](_0x601a4[_0x9ab1('0x3f')][_0x9ab1('0x93')])){throw new db[(_0x9ab1('0x88'))][(_0x9ab1('0x89'))](_0x9ab1('0xa7'));}return _0x468bcd[_0x9ab1('0xa8')+_[_0x9ab1('0x97')](_0x601a4[_0x9ab1('0x3f')][_0x9ab1('0x93')][_0x9ab1('0x98')]())+_0x9ab1('0x99')](_0x601a4[_0x9ab1('0x3f')]['ids']);}})[_0x9ab1('0x13')](function(_0x4927d6){if(_[_0x9ab1('0xa9')](_0x601a4[_0x9ab1('0x3f')][_0x9ab1('0x9a')])){for(var _0x1d269a=0x0;_0x1d269a<_0x601a4[_0x9ab1('0x3f')]['ids']['length'];_0x1d269a+=0x1){_0x123c90={'UserId':Number(_0x601a4['params']['id'])};_0x123c90[_[_0x9ab1('0x97')](_0x601a4[_0x9ab1('0x3f')][_0x9ab1('0x93')][_0x9ab1('0x98')]())+_0x9ab1('0xaa')]=Number(_0x601a4[_0x9ab1('0x3f')][_0x9ab1('0x9a')][_0x1d269a]);socket['emit'](_0x9ab1('0x2a')+_[_0x9ab1('0x97')](_0x601a4[_0x9ab1('0x3f')]['channel'][_0x9ab1('0x98')]())+'Queue:remove',_0x123c90);}}else{_0x123c90={'UserId':Number(_0x601a4[_0x9ab1('0x4b')]['id'])};_0x123c90[_[_0x9ab1('0x97')](_0x601a4[_0x9ab1('0x3f')][_0x9ab1('0x93')]['toLowerCase']())+_0x9ab1('0xaa')]=Number(_0x601a4[_0x9ab1('0x3f')]['ids']);socket[_0x9ab1('0x9d')]('user'+_[_0x9ab1('0x97')](_0x601a4[_0x9ab1('0x3f')][_0x9ab1('0x93')][_0x9ab1('0x98')]())+'Queue:remove',_0x123c90);}return _0x4927d6;})[_0x9ab1('0x13')](function(){if(_0x601a4[_0x9ab1('0x3f')][_0x9ab1('0x93')]===_0x9ab1('0x9f')){return db['UserVoiceQueueRt'][_0x9ab1('0x25')]({'where':{'UserId':_0x601a4[_0x9ab1('0x4b')]['id'],'VoiceQueueId':_0x601a4[_0x9ab1('0x3f')][_0x9ab1('0x9a')]},'individualHooks':!![]})['then'](function(){return _0x2c9aa0;});}return _0x2c9aa0;})['then'](respondWithStatusCode(_0x30e51c,null))[_0x9ab1('0x1a')](handleError(_0x30e51c,null));};exports[_0x9ab1('0xab')]=function(_0x196142,_0x127c59){_0x196142[_0x9ab1('0x59')][_0x9ab1('0xac')]=_0x196142['file'][_0x9ab1('0xad')];return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x196142[_0x9ab1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x127c59,null))[_0x9ab1('0x13')](saveUpdates(_0x196142['body'],null))[_0x9ab1('0x13')](respondWithResult(_0x127c59,null))[_0x9ab1('0x1a')](handleError(_0x127c59,null));};exports[_0x9ab1('0xae')]=function(_0x5e34a7,_0x51f6cb){var _0x32bb1c=path[_0x9ab1('0xaf')](config[_0x9ab1('0xb0')],_0x9ab1('0xb1'));return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x5e34a7[_0x9ab1('0x4b')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x9ab1('0x13')](handleEntityNotFound(_0x51f6cb,null))[_0x9ab1('0x13')](function(_0x826bec){if(_0x826bec){if(_[_0x9ab1('0x62')](_0x826bec[_0x9ab1('0xac')])){return _0x51f6cb[_0x9ab1('0xb2')](_0x32bb1c);}else{if(!fs[_0x9ab1('0xb3')](path[_0x9ab1('0xaf')](config[_0x9ab1('0xb0')],'server/files/images/',_0x826bec[_0x9ab1('0xac')]))){return _0x51f6cb[_0x9ab1('0xb2')](_0x32bb1c);}return _0x51f6cb[_0x9ab1('0xb2')](path[_0x9ab1('0xaf')](config['root'],'server/files/images/',_0x826bec['userpic']));}}})['catch'](handleError(_0x51f6cb,null));};exports[_0x9ab1('0xb4')]=function(_0x231d84,_0xae49e3){return db[_0x9ab1('0x36')]['find']({'where':{'id':_0x231d84['params']['id']},'attributes':['id']})[_0x9ab1('0x13')](handleEntityNotFound(_0xae49e3,null))['then'](function(_0x4ec7b3){var _0x3e29d1=[];values=_0x4ec7b3[_0x9ab1('0x46')];_0x3e29d1[_0x9ab1('0x42')](get_open_tabs(_0x9ab1('0xb5'),_0x4ec7b3[_0x9ab1('0x46')]));_0x3e29d1[_0x9ab1('0x42')](get_open_tabs(_0x9ab1('0xb6'),_0x4ec7b3['dataValues']));_0x3e29d1[_0x9ab1('0x42')](get_open_tabs('openchannel',_0x4ec7b3[_0x9ab1('0x46')]));_0x3e29d1[_0x9ab1('0x42')](get_open_tabs('whatsapp',_0x4ec7b3['dataValues']));_0x3e29d1[_0x9ab1('0x42')](get_open_tabs(_0x9ab1('0x45'),_0x4ec7b3[_0x9ab1('0x46')]));_0x3e29d1[_0x9ab1('0x42')](get_open_tabs(_0x9ab1('0x47'),_0x4ec7b3[_0x9ab1('0x46')]));return BPromise[_0x9ab1('0x58')](_0x3e29d1);})['then'](function(_0x351cc5){if(_0x351cc5){var _0x54330e=_[_0x9ab1('0x38')](values[_0x9ab1('0xb7')],function(_0x48f2ae){return{'channel':_0x9ab1('0xb8'),'id':_0x48f2ae['id'],'createdAt':_0x48f2ae[_0x9ab1('0xb9')]};});var _0x367098=_[_0x9ab1('0x38')](values['FaxOpenTabs'],function(_0x386b52){return{'channel':'FAX','id':_0x386b52['id'],'createdAt':_0x386b52['createdAt']};});var _0x84963a=_[_0x9ab1('0x38')](values[_0x9ab1('0xba')],function(_0x1f9472){return{'channel':_0x9ab1('0xbb'),'id':_0x1f9472['id'],'createdAt':_0x1f9472[_0x9ab1('0xb9')]};});var _0x18c248=_[_0x9ab1('0x38')](values[_0x9ab1('0xbc')],function(_0x3df191){return{'channel':'MAIL','id':_0x3df191['id'],'createdAt':_0x3df191[_0x9ab1('0xb9')]};});var _0x2da118=_[_0x9ab1('0x38')](values[_0x9ab1('0xbd')],function(_0x51b295){return{'channel':_0x9ab1('0xbe'),'id':_0x51b295['id'],'createdAt':_0x51b295[_0x9ab1('0xb9')]};});var _0x4c692c=_[_0x9ab1('0x38')](values[_0x9ab1('0xbf')],function(_0x5592b2){return{'channel':'WHATSAPP','id':_0x5592b2['id'],'createdAt':_0x5592b2['createdAt']};});var _0x319d12=_[_0x9ab1('0xc0')](_0x54330e,_0x367098,_0x84963a,_0x18c248,_0x2da118,_0x4c692c);var _0x23fa5a={'count':_0x319d12[_0x9ab1('0x44')],'rows':_0x319d12};return _0x23fa5a;}else return null;})[_0x9ab1('0x13')](respondWithResult(_0xae49e3,null))[_0x9ab1('0x1a')](handleError(_0xae49e3,null));};exports[_0x9ab1('0xc1')]=function(_0x13c96b,_0x3c54b6){var _0x2c8c3e={};var _0x3944bf={};var _0x108ec4;var _0x2e276e;return db['User'][_0x9ab1('0xc2')]({'where':{'id':_0x13c96b[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x3c54b6,null))[_0x9ab1('0x13')](function(_0x37cd33){if(_0x37cd33){_0x108ec4=_0x37cd33;_0x3944bf['model']=_[_0x9ab1('0x4e')](db[_0x9ab1('0xc3')][_0x9ab1('0x37')]);_0x3944bf['query']=_['keys'](_0x13c96b[_0x9ab1('0x3f')]);_0x3944bf['filters']=_[_0x9ab1('0x50')](_0x3944bf[_0x9ab1('0x4c')],_0x3944bf[_0x9ab1('0x3f')]);_0x2c8c3e[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x3944bf['model'],qs[_0x9ab1('0x51')](_0x13c96b['query'][_0x9ab1('0x51')]));_0x2c8c3e[_0x9ab1('0x41')]=_0x2c8c3e['attributes'][_0x9ab1('0x44')]?_0x2c8c3e['attributes']:_0x3944bf['model'];_0x2c8c3e[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x13c96b[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x2c8c3e['where']=qs['filters'](_[_0x9ab1('0xc6')](_0x13c96b[_0x9ab1('0x3f')],_0x3944bf[_0x9ab1('0x4f')]));if(_0x13c96b[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x2c8c3e[_0x9ab1('0x3e')]=_[_0x9ab1('0x55')](_0x2c8c3e['where'],{'$or':_['map'](_0x2c8c3e[_0x9ab1('0x41')],function(_0xb6b748){var _0x34a914={};_0x34a914[_0xb6b748]={'$like':'%'+_0x13c96b['query']['filter']+'%'};return _0x34a914;})});}_0x2c8c3e=_['merge']({},_0x2c8c3e,_0x13c96b[_0x9ab1('0x56')]);return _0x108ec4[_0x9ab1('0xc1')](_0x2c8c3e);}})[_0x9ab1('0x13')](function(_0x2e6b3c){if(_0x2e6b3c){_0x2e276e=_0x2e6b3c[_0x9ab1('0x44')];if(_0x13c96b[_0x9ab1('0x3f')][_0x9ab1('0xc7')](_0x9ab1('0x40'))){_0x2c8c3e[_0x9ab1('0x52')]=[{'model':db[_0x9ab1('0xc8')],'as':_0x9ab1('0xc9'),'required':![]},{'model':db[_0x9ab1('0xca')],'as':_0x9ab1('0xcb'),'attributes':['id','name',_0x9ab1('0xcc')],'where':_0x13c96b[_0x9ab1('0x3f')][_0x9ab1('0xcd')]?{'id':_0x13c96b[_0x9ab1('0x3f')]['tag']}:undefined,'required':_0x13c96b[_0x9ab1('0x3f')][_0x9ab1('0xcd')]?!![]:![]}];}if(!_0x13c96b[_0x9ab1('0x3f')]['hasOwnProperty']('nolimit')){_0x2c8c3e[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x13c96b['query'][_0x9ab1('0x1f')]);_0x2c8c3e[_0x9ab1('0x1d')]=qs['offset'](_0x13c96b['query'][_0x9ab1('0x1d')]);}return _0x108ec4[_0x9ab1('0xc1')](_0x2c8c3e);}})[_0x9ab1('0x13')](function(_0x5924dd){if(_0x5924dd){return _0x5924dd?{'count':_0x2e276e,'rows':_0x5924dd}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x3c54b6,null))[_0x9ab1('0x1a')](handleError(_0x3c54b6,null));};exports['getQueues']=function(_0x183914,_0x31fec3){var _0x1ecb16;var _0x356a7e={};var _0x10280f;return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x183914[_0x9ab1('0x4b')]['id']},'attributes':['id',_0x9ab1('0x31'),_0x9ab1('0x27')]})[_0x9ab1('0x13')](handleEntityNotFound(_0x31fec3,null))['then'](function(_0x5703bf){if(!utils[_0x9ab1('0xa6')](_0x183914['query'][_0x9ab1('0x93')])){throw new db['Sequelize'][(_0x9ab1('0x89'))](_0x9ab1('0xa7'));}_0x1ecb16=_0x5703bf;var _0x1902b9={};_0x1902b9[_0x9ab1('0x4c')]=_['keys'](db[_['capitalize'](_0x183914[_0x9ab1('0x3f')][_0x9ab1('0x93')])+_0x9ab1('0xce')][_0x9ab1('0x37')]);_0x1902b9[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x183914[_0x9ab1('0x3f')]);_0x1902b9['filters']=_[_0x9ab1('0x50')](_0x1902b9[_0x9ab1('0x4c')],_0x1902b9['query']);_0x356a7e[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x1902b9[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x183914[_0x9ab1('0x3f')]['fields']));_0x356a7e[_0x9ab1('0x41')]=_0x356a7e[_0x9ab1('0x41')]['length']?_0x356a7e[_0x9ab1('0x41')]:_0x1902b9[_0x9ab1('0x4c')];_0x356a7e[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x183914[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x356a7e['where']=qs['filters'](_['pick'](_0x183914['query'],_0x1902b9[_0x9ab1('0x4f')]));if(_0x183914[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x356a7e['where']=_[_0x9ab1('0x55')](_0x356a7e[_0x9ab1('0x3e')],{'$or':_['map'](_0x356a7e[_0x9ab1('0x41')],function(_0x4f1b3f){var _0x876e9f={};_0x876e9f[_0x4f1b3f]={'$like':'%'+_0x183914[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x876e9f;})});}_0x356a7e=_[_0x9ab1('0x55')]({},_0x356a7e,_0x183914['options']);switch(_0x1ecb16[_0x9ab1('0x27')]){case _0x9ab1('0x28'):return db[_[_0x9ab1('0x97')](_0x183914['query'][_0x9ab1('0x93')])+_0x9ab1('0xce')][_0x9ab1('0x83')](_0x356a7e);case _0x9ab1('0x2a'):case _0x9ab1('0x2c'):return _0x1ecb16[_0x9ab1('0x26')+_[_0x9ab1('0x97')](_0x183914['query'][_0x9ab1('0x93')])+_0x9ab1('0x99')](_0x356a7e);default:throw new db['Sequelize'][(_0x9ab1('0x89'))]('Unknown\x20role');}})['then'](function(_0x429282){_0x10280f=_0x429282[_0x9ab1('0x44')];if(!_0x183914[_0x9ab1('0x3f')][_0x9ab1('0xc7')](_0x9ab1('0xcf'))){_0x356a7e[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x183914['query'][_0x9ab1('0x1f')]);_0x356a7e['offset']=qs['offset'](_0x183914[_0x9ab1('0x3f')]['offset']);}switch(_0x1ecb16[_0x9ab1('0x27')]){case _0x9ab1('0x28'):return db[_[_0x9ab1('0x97')](_0x183914[_0x9ab1('0x3f')][_0x9ab1('0x93')])+'Queue'][_0x9ab1('0x83')](_0x356a7e);case _0x9ab1('0x2a'):case _0x9ab1('0x2c'):return _0x1ecb16[_0x9ab1('0x26')+_[_0x9ab1('0x97')](_0x183914[_0x9ab1('0x3f')]['channel'])+_0x9ab1('0x99')](_0x356a7e);}})[_0x9ab1('0x13')](function(_0x13c0d3){return{'count':_0x10280f,'rows':_0x13c0d3};})[_0x9ab1('0x13')](respondWithResult(_0x31fec3,null))[_0x9ab1('0x1a')](handleError(_0x31fec3,null));};exports[_0x9ab1('0xd0')]=function(_0x1cd5a4,_0x188e7a){var _0x49924c={};var _0x340735={};var _0x1d7978;var _0x10cc6a;return db['User'][_0x9ab1('0xc2')]({'where':{'id':_0x1cd5a4[_0x9ab1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x188e7a,null))[_0x9ab1('0x13')](function(_0x419495){if(_0x419495){_0x1d7978=_0x419495;_0x340735[_0x9ab1('0x4c')]=_['keys'](db['UserVoiceQueueRt'][_0x9ab1('0x37')]);_0x340735[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x1cd5a4['query']);_0x340735[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x340735[_0x9ab1('0x4c')],_0x340735[_0x9ab1('0x3f')]);_0x49924c[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x340735[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x1cd5a4[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x49924c[_0x9ab1('0x41')]=_0x49924c[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x49924c['attributes']:_0x340735[_0x9ab1('0x4c')];_0x49924c[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x1cd5a4['query'][_0x9ab1('0xc5')]);_0x49924c[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x1cd5a4[_0x9ab1('0x3f')],_0x340735[_0x9ab1('0x4f')]));if(_0x1cd5a4[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x49924c[_0x9ab1('0x3e')]=_[_0x9ab1('0x55')](_0x49924c['where'],{'$or':_[_0x9ab1('0x38')](_0x49924c[_0x9ab1('0x41')],function(_0x5a6aba){var _0xc77ef2={};_0xc77ef2[_0x5a6aba]={'$like':'%'+_0x1cd5a4[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0xc77ef2;})});}_0x49924c=_[_0x9ab1('0x55')]({},_0x49924c,_0x1cd5a4[_0x9ab1('0x56')]);return _0x1d7978['getVoiceQueuesRt'](_0x49924c);}})[_0x9ab1('0x13')](function(_0x3d3f8f){if(_0x3d3f8f){_0x10cc6a=_0x3d3f8f['length'];if(!_0x1cd5a4[_0x9ab1('0x3f')]['hasOwnProperty']('nolimit')){_0x49924c['limit']=qs[_0x9ab1('0x1f')](_0x1cd5a4[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x49924c[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x1cd5a4[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}return _0x1d7978['getVoiceQueuesRt'](_0x49924c);}})[_0x9ab1('0x13')](function(_0x184975){if(_0x184975){return _0x184975?{'count':_0x10cc6a,'rows':_0x184975}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x188e7a,null))[_0x9ab1('0x1a')](handleError(_0x188e7a,null));};exports[_0x9ab1('0xd1')]=function(_0x4e0f55,_0x424d5f){var _0x298a22={};var _0x4b6cb8={};var _0x2928eb;var _0x24cda0;return db['User'][_0x9ab1('0xc2')]({'where':{'id':_0x4e0f55[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x424d5f,null))[_0x9ab1('0x13')](function(_0x132b8e){if(_0x132b8e){_0x2928eb=_0x132b8e;_0x4b6cb8[_0x9ab1('0x4c')]=_['keys'](db['ChatGroup'][_0x9ab1('0x37')]);_0x4b6cb8['query']=_[_0x9ab1('0x4e')](_0x4e0f55['query']);_0x4b6cb8[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x4b6cb8[_0x9ab1('0x4c')],_0x4b6cb8['query']);_0x298a22[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x4b6cb8[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x4e0f55[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x298a22[_0x9ab1('0x41')]=_0x298a22[_0x9ab1('0x41')]['length']?_0x298a22[_0x9ab1('0x41')]:_0x4b6cb8[_0x9ab1('0x4c')];_0x298a22[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x4e0f55[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x298a22[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x4e0f55[_0x9ab1('0x3f')],_0x4b6cb8['filters']));if(_0x4e0f55[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x298a22[_0x9ab1('0x3e')]=_[_0x9ab1('0x55')](_0x298a22[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0x298a22[_0x9ab1('0x41')],function(_0x42cf87){var _0x5aed7b={};_0x5aed7b[_0x42cf87]={'$like':'%'+_0x4e0f55[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x5aed7b;})});}_0x298a22=_[_0x9ab1('0x55')]({},_0x298a22,_0x4e0f55['options']);return _0x2928eb['getGroups'](_0x298a22);}})[_0x9ab1('0x13')](function(_0x52a5ef){if(_0x52a5ef){_0x24cda0=_0x52a5ef[_0x9ab1('0x44')];if(!_0x4e0f55[_0x9ab1('0x3f')][_0x9ab1('0xc7')]('nolimit')){_0x298a22['limit']=qs['limit'](_0x4e0f55[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x298a22[_0x9ab1('0x1d')]=qs['offset'](_0x4e0f55['query'][_0x9ab1('0x1d')]);}return _0x2928eb[_0x9ab1('0xd1')](_0x298a22);}})[_0x9ab1('0x13')](function(_0x266ac1){if(_0x266ac1){return _0x266ac1?{'count':_0x24cda0,'rows':_0x266ac1}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x424d5f,null))[_0x9ab1('0x1a')](handleError(_0x424d5f,null));};exports[_0x9ab1('0xd2')]=function(_0x19a41a,_0x4d0591){var _0xdeb5f3={'raw':!![],'where':{}};var _0x2f87d5={};var _0xccb9b7={'count':0x0,'rows':[]};return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x19a41a[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x4d0591,null))[_0x9ab1('0x13')](function(_0x356555){if(_0x356555){_0x2f87d5[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db[_0x9ab1('0xd3')][_0x9ab1('0x37')]);_0x2f87d5[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x19a41a['query']);_0x2f87d5[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x2f87d5[_0x9ab1('0x4c')],_0x2f87d5[_0x9ab1('0x3f')]);_0xdeb5f3[_0x9ab1('0x41')]=_['intersection'](_0x2f87d5[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x19a41a[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0xdeb5f3[_0x9ab1('0x41')]=_0xdeb5f3[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0xdeb5f3[_0x9ab1('0x41')]:_0x2f87d5[_0x9ab1('0x4c')];if(!_0x19a41a[_0x9ab1('0x3f')][_0x9ab1('0xc7')]('nolimit')){_0xdeb5f3['limit']=qs[_0x9ab1('0x1f')](_0x19a41a[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0xdeb5f3['offset']=qs[_0x9ab1('0x1d')](_0x19a41a['query']['offset']);}_0xdeb5f3[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x19a41a[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0xdeb5f3[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x19a41a[_0x9ab1('0x3f')],_0x2f87d5[_0x9ab1('0x4f')]));_0xdeb5f3[_0x9ab1('0x3e')][_0x9ab1('0xd4')]=_0x356555['id'];if(_0x19a41a[_0x9ab1('0x3f')]['filter']){_0xdeb5f3['where']=_[_0x9ab1('0x55')](_0xdeb5f3[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0xdeb5f3[_0x9ab1('0x41')],function(_0x49d695){var _0x4dcae3={};_0x4dcae3[_0x49d695]={'$like':'%'+_0x19a41a[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x4dcae3;})});}_0xdeb5f3=_[_0x9ab1('0x55')]({},_0xdeb5f3,_0x19a41a['options']);return db['VoiceRecording'][_0x9ab1('0x20')]({'where':_0xdeb5f3[_0x9ab1('0x3e')]})[_0x9ab1('0x13')](function(_0x266bd5){_0xccb9b7[_0x9ab1('0x20')]=_0x266bd5;if(_0x19a41a[_0x9ab1('0x3f')][_0x9ab1('0x40')]){_0xdeb5f3[_0x9ab1('0x52')]=[{'all':!![]}];}return db[_0x9ab1('0xd3')][_0x9ab1('0x83')](_0xdeb5f3);})[_0x9ab1('0x13')](function(_0x2d1750){_0xccb9b7[_0x9ab1('0x43')]=_0x2d1750;return _0xccb9b7;});}})[_0x9ab1('0x13')](respondWithFilteredResult(_0x4d0591,_0xdeb5f3))[_0x9ab1('0x1a')](handleError(_0x4d0591,null));};exports[_0x9ab1('0xd5')]=function(_0x4443aa,_0x3dff4c){var _0x17af25={'raw':!![],'where':{}};var _0x51dbb7={};var _0x5639eb={'count':0x0,'rows':[]};return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x4443aa['params']['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x3dff4c,null))['then'](function(_0x20fa02){if(_0x20fa02){_0x51dbb7[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db[_0x9ab1('0xd6')][_0x9ab1('0x37')]);_0x51dbb7['query']=_[_0x9ab1('0x4e')](_0x4443aa[_0x9ab1('0x3f')]);_0x51dbb7[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x51dbb7[_0x9ab1('0x4c')],_0x51dbb7[_0x9ab1('0x3f')]);_0x17af25[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x51dbb7[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x4443aa[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x17af25['attributes']=_0x17af25[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x17af25[_0x9ab1('0x41')]:_0x51dbb7['model'];if(!_0x4443aa[_0x9ab1('0x3f')]['hasOwnProperty'](_0x9ab1('0xcf'))){_0x17af25[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x4443aa[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x17af25[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x4443aa['query'][_0x9ab1('0x1d')]);}_0x17af25[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x4443aa[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x17af25['where']=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x4443aa[_0x9ab1('0x3f')],_0x51dbb7[_0x9ab1('0x4f')]));_0x17af25[_0x9ab1('0x3e')][_0x9ab1('0xd4')]=_0x20fa02['id'];if(_0x4443aa['query']['filter']){_0x17af25[_0x9ab1('0x3e')]=_[_0x9ab1('0x55')](_0x17af25[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0x17af25[_0x9ab1('0x41')],function(_0x47b16f){var _0x52ad38={};_0x52ad38[_0x47b16f]={'$like':'%'+_0x4443aa['query'][_0x9ab1('0x2d')]+'%'};return _0x52ad38;})});}_0x17af25=_[_0x9ab1('0x55')]({},_0x17af25,_0x4443aa[_0x9ab1('0x56')]);return db['ScreenRecording'][_0x9ab1('0x20')]({'where':_0x17af25[_0x9ab1('0x3e')]})[_0x9ab1('0x13')](function(_0x3e2af1){_0x5639eb[_0x9ab1('0x20')]=_0x3e2af1;if(_0x4443aa['query']['includeAll']){_0x17af25[_0x9ab1('0x52')]=[{'all':!![]}];}return db[_0x9ab1('0xd6')][_0x9ab1('0x83')](_0x17af25);})[_0x9ab1('0x13')](function(_0x4777c2){_0x5639eb[_0x9ab1('0x43')]=_0x4777c2;return _0x5639eb;});}})[_0x9ab1('0x13')](respondWithFilteredResult(_0x3dff4c,_0x17af25))['catch'](handleError(_0x3dff4c,null));};exports[_0x9ab1('0xd7')]=function(_0x197228,_0x2c34f8){var _0x4216c7={};var _0xaa8b88={};var _0x3227ef;var _0xac423b;return db['User'][_0x9ab1('0xc2')]({'where':{'id':_0x197228[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x2c34f8,null))['then'](function(_0x4120cf){if(_0x4120cf){_0x3227ef=_0x4120cf;_0xaa8b88['model']=_[_0x9ab1('0x4e')](db[_0x9ab1('0xd8')][_0x9ab1('0x37')]);_0xaa8b88['query']=_[_0x9ab1('0x4e')](_0x197228[_0x9ab1('0x3f')]);_0xaa8b88[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0xaa8b88[_0x9ab1('0x4c')],_0xaa8b88['query']);_0x4216c7['attributes']=_['intersection'](_0xaa8b88[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x197228[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x4216c7[_0x9ab1('0x41')]=_0x4216c7['attributes']['length']?_0x4216c7[_0x9ab1('0x41')]:_0xaa8b88['model'];_0x4216c7[_0x9ab1('0xc4')]=qs['sort'](_0x197228['query'][_0x9ab1('0xc5')]);_0x4216c7[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x197228[_0x9ab1('0x3f')],_0xaa8b88[_0x9ab1('0x4f')]));if(_0x197228[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x4216c7[_0x9ab1('0x3e')]=_[_0x9ab1('0x55')](_0x4216c7[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0x4216c7['attributes'],function(_0x5a8351){var _0x5ca01b={};_0x5ca01b[_0x5a8351]={'$like':'%'+_0x197228[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x5ca01b;})});}_0x4216c7=_[_0x9ab1('0x55')]({},_0x4216c7,_0x197228[_0x9ab1('0x56')]);return _0x3227ef[_0x9ab1('0xd7')](_0x4216c7);}})[_0x9ab1('0x13')](function(_0x321f07){if(_0x321f07){_0xac423b=_0x321f07[_0x9ab1('0x44')];if(!_0x197228[_0x9ab1('0x3f')]['hasOwnProperty']('nolimit')){_0x4216c7[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x197228[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x4216c7['offset']=qs[_0x9ab1('0x1d')](_0x197228[_0x9ab1('0x3f')]['offset']);}return _0x3227ef[_0x9ab1('0xd7')](_0x4216c7);}})[_0x9ab1('0x13')](function(_0x4adc96){if(_0x4adc96){return _0x4adc96?{'count':_0xac423b,'rows':_0x4adc96}:null;}})['then'](respondWithResult(_0x2c34f8,null))[_0x9ab1('0x1a')](handleError(_0x2c34f8,null));};exports[_0x9ab1('0xd9')]=function(_0x176925,_0x5b3549){var _0xd5d25f={};var _0x83057c={};var _0x2e8c84;var _0x30ba53;return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x176925[_0x9ab1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b3549,null))[_0x9ab1('0x13')](function(_0x4c28b6){if(_0x4c28b6){_0x2e8c84=_0x4c28b6;_0x83057c[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db[_0x9ab1('0xda')][_0x9ab1('0x37')]);_0x83057c[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x176925[_0x9ab1('0x3f')]);_0x83057c[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x83057c[_0x9ab1('0x4c')],_0x83057c['query']);_0xd5d25f[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x83057c[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x176925[_0x9ab1('0x3f')]['fields']));_0xd5d25f[_0x9ab1('0x41')]=_0xd5d25f[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0xd5d25f['attributes']:_0x83057c['model'];_0xd5d25f['order']=qs[_0x9ab1('0xc5')](_0x176925['query']['sort']);_0xd5d25f[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x176925[_0x9ab1('0x3f')],_0x83057c[_0x9ab1('0x4f')]));if(_0x176925['query']['filter']){_0xd5d25f['where']=_['merge'](_0xd5d25f[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0xd5d25f[_0x9ab1('0x41')],function(_0x550227){var _0x318914={};_0x318914[_0x550227]={'$like':'%'+_0x176925[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x318914;})});}_0xd5d25f=_[_0x9ab1('0x55')]({},_0xd5d25f,_0x176925[_0x9ab1('0x56')]);return _0x2e8c84[_0x9ab1('0xd9')](_0xd5d25f);}})['then'](function(_0x5d0d84){if(_0x5d0d84){_0x30ba53=_0x5d0d84[_0x9ab1('0x44')];if(!_0x176925[_0x9ab1('0x3f')][_0x9ab1('0xc7')](_0x9ab1('0xcf'))){_0xd5d25f[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x176925[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0xd5d25f['offset']=qs[_0x9ab1('0x1d')](_0x176925['query']['offset']);}return _0x2e8c84[_0x9ab1('0xd9')](_0xd5d25f);}})[_0x9ab1('0x13')](function(_0x3dc59f){if(_0x3dc59f){return _0x3dc59f?{'count':_0x30ba53,'rows':_0x3dc59f}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x5b3549,null))[_0x9ab1('0x1a')](handleError(_0x5b3549,null));};exports[_0x9ab1('0xdb')]=function(_0x30c925,_0x952f1a){var _0x3b790e={'raw':!![],'where':{}};var _0x1efabf={};var _0x4f750e={'count':0x0,'rows':[]};return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x30c925['params']['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x952f1a,null))[_0x9ab1('0x13')](function(_0x321722){if(_0x321722){_0x1efabf[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db['MailInteraction'][_0x9ab1('0x37')]);_0x1efabf[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x30c925['query']);_0x1efabf['filters']=_[_0x9ab1('0x50')](_0x1efabf[_0x9ab1('0x4c')],_0x1efabf[_0x9ab1('0x3f')]);_0x3b790e[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x1efabf[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x30c925[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x3b790e[_0x9ab1('0x41')]=_0x3b790e[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x3b790e[_0x9ab1('0x41')]:_0x1efabf[_0x9ab1('0x4c')];if(!_0x30c925[_0x9ab1('0x3f')][_0x9ab1('0xc7')](_0x9ab1('0xcf'))){_0x3b790e[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x30c925[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x3b790e[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x30c925[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}_0x3b790e[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x30c925[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x3b790e[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x30c925[_0x9ab1('0x3f')],_0x1efabf[_0x9ab1('0x4f')]));_0x3b790e[_0x9ab1('0x3e')][_0x9ab1('0xd4')]=_0x321722['id'];if(_0x30c925[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x3b790e['where']=_[_0x9ab1('0x55')](_0x3b790e['where'],{'$or':_[_0x9ab1('0x38')](_0x3b790e[_0x9ab1('0x41')],function(_0x327cca){var _0x3221c6={};_0x3221c6[_0x327cca]={'$like':'%'+_0x30c925[_0x9ab1('0x3f')]['filter']+'%'};return _0x3221c6;})});}_0x3b790e=_['merge']({},_0x3b790e,_0x30c925[_0x9ab1('0x56')]);return db[_0x9ab1('0xdc')]['count']({'where':_0x3b790e[_0x9ab1('0x3e')]})[_0x9ab1('0x13')](function(_0x34449c){_0x4f750e[_0x9ab1('0x20')]=_0x34449c;if(_0x30c925['query'][_0x9ab1('0x40')]){_0x3b790e[_0x9ab1('0x52')]=[{'all':!![]}];}return db[_0x9ab1('0xdc')][_0x9ab1('0x83')](_0x3b790e);})[_0x9ab1('0x13')](function(_0x2b4dbe){_0x4f750e[_0x9ab1('0x43')]=_0x2b4dbe;return _0x4f750e;});}})[_0x9ab1('0x13')](respondWithFilteredResult(_0x952f1a,_0x3b790e))[_0x9ab1('0x1a')](handleError(_0x952f1a,null));};exports[_0x9ab1('0xdd')]=function(_0x4b93b4,_0x5eea18){var _0x328f35={};var _0x306197={};var _0x19a33f;var _0x1e1c9c;return db['User']['findOne']({'where':{'id':_0x4b93b4['params']['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x5eea18,null))[_0x9ab1('0x13')](function(_0xfc92c8){if(_0xfc92c8){_0x19a33f=_0xfc92c8;_0x306197[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db[_0x9ab1('0xde')][_0x9ab1('0x37')]);_0x306197['query']=_[_0x9ab1('0x4e')](_0x4b93b4['query']);_0x306197[_0x9ab1('0x4f')]=_['intersection'](_0x306197[_0x9ab1('0x4c')],_0x306197[_0x9ab1('0x3f')]);_0x328f35[_0x9ab1('0x41')]=_['intersection'](_0x306197['model'],qs['fields'](_0x4b93b4[_0x9ab1('0x3f')]['fields']));_0x328f35[_0x9ab1('0x41')]=_0x328f35[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x328f35[_0x9ab1('0x41')]:_0x306197[_0x9ab1('0x4c')];_0x328f35['order']=qs['sort'](_0x4b93b4[_0x9ab1('0x3f')]['sort']);_0x328f35[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x4b93b4[_0x9ab1('0x3f')],_0x306197[_0x9ab1('0x4f')]));if(_0x4b93b4['query'][_0x9ab1('0x2d')]){_0x328f35[_0x9ab1('0x3e')]=_[_0x9ab1('0x55')](_0x328f35[_0x9ab1('0x3e')],{'$or':_['map'](_0x328f35[_0x9ab1('0x41')],function(_0x324282){var _0x151345={};_0x151345[_0x324282]={'$like':'%'+_0x4b93b4[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x151345;})});}_0x328f35=_['merge']({},_0x328f35,_0x4b93b4[_0x9ab1('0x56')]);return _0x19a33f['getSmsInteractions'](_0x328f35);}})[_0x9ab1('0x13')](function(_0x3ec256){if(_0x3ec256){_0x1e1c9c=_0x3ec256[_0x9ab1('0x44')];if(!_0x4b93b4[_0x9ab1('0x3f')][_0x9ab1('0xc7')](_0x9ab1('0xcf'))){_0x328f35[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x4b93b4[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x328f35[_0x9ab1('0x1d')]=qs['offset'](_0x4b93b4[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}return _0x19a33f[_0x9ab1('0xdd')](_0x328f35);}})['then'](function(_0x3164e1){if(_0x3164e1){return _0x3164e1?{'count':_0x1e1c9c,'rows':_0x3164e1}:null;}})['then'](respondWithResult(_0x5eea18,null))['catch'](handleError(_0x5eea18,null));};exports[_0x9ab1('0xdf')]=function(_0x154c37,_0x2a349f){var _0xdaefff={};var _0x3afe67={};var _0x490b2e;var _0x128dc4;return db['User'][_0x9ab1('0xc2')]({'where':{'id':_0x154c37[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x2a349f,null))[_0x9ab1('0x13')](function(_0x4a831b){if(_0x4a831b){_0x490b2e=_0x4a831b;_0x3afe67[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db[_0x9ab1('0xe0')]['rawAttributes']);_0x3afe67['query']=_[_0x9ab1('0x4e')](_0x154c37[_0x9ab1('0x3f')]);_0x3afe67[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x3afe67[_0x9ab1('0x4c')],_0x3afe67[_0x9ab1('0x3f')]);_0xdaefff[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x3afe67['model'],qs[_0x9ab1('0x51')](_0x154c37[_0x9ab1('0x3f')]['fields']));_0xdaefff[_0x9ab1('0x41')]=_0xdaefff['attributes'][_0x9ab1('0x44')]?_0xdaefff['attributes']:_0x3afe67[_0x9ab1('0x4c')];_0xdaefff[_0x9ab1('0xc4')]=qs['sort'](_0x154c37[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0xdaefff[_0x9ab1('0x3e')]=qs['filters'](_[_0x9ab1('0xc6')](_0x154c37[_0x9ab1('0x3f')],_0x3afe67['filters']));if(_0x154c37[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0xdaefff[_0x9ab1('0x3e')]=_[_0x9ab1('0x55')](_0xdaefff[_0x9ab1('0x3e')],{'$or':_['map'](_0xdaefff[_0x9ab1('0x41')],function(_0x25b6f7){var _0xe1ac2={};_0xe1ac2[_0x25b6f7]={'$like':'%'+_0x154c37['query']['filter']+'%'};return _0xe1ac2;})});}_0xdaefff=_[_0x9ab1('0x55')]({},_0xdaefff,_0x154c37[_0x9ab1('0x56')]);return _0x490b2e[_0x9ab1('0xdf')](_0xdaefff);}})[_0x9ab1('0x13')](function(_0x4ec7fd){if(_0x4ec7fd){_0x128dc4=_0x4ec7fd['length'];if(!_0x154c37[_0x9ab1('0x3f')]['hasOwnProperty'](_0x9ab1('0xcf'))){_0xdaefff[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x154c37['query'][_0x9ab1('0x1f')]);_0xdaefff[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x154c37[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}return _0x490b2e[_0x9ab1('0xdf')](_0xdaefff);}})[_0x9ab1('0x13')](function(_0x37f4b9){if(_0x37f4b9){return _0x37f4b9?{'count':_0x128dc4,'rows':_0x37f4b9}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x2a349f,null))[_0x9ab1('0x1a')](handleError(_0x2a349f,null));};exports[_0x9ab1('0xe1')]=function(_0x2e3485,_0x60d8a6){var _0x57b03e={};var _0x263f56={};var _0x171334;var _0x2bf4ab;return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x2e3485[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x60d8a6,null))[_0x9ab1('0x13')](function(_0x330d7e){if(_0x330d7e){_0x171334=_0x330d7e;_0x263f56[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db[_0x9ab1('0xe2')]['rawAttributes']);_0x263f56['query']=_[_0x9ab1('0x4e')](_0x2e3485[_0x9ab1('0x3f')]);_0x263f56[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x263f56[_0x9ab1('0x4c')],_0x263f56[_0x9ab1('0x3f')]);_0x57b03e[_0x9ab1('0x41')]=_['intersection'](_0x263f56[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x2e3485[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x57b03e[_0x9ab1('0x41')]=_0x57b03e['attributes']['length']?_0x57b03e[_0x9ab1('0x41')]:_0x263f56['model'];_0x57b03e['order']=qs[_0x9ab1('0xc5')](_0x2e3485[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x57b03e['where']=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x2e3485['query'],_0x263f56[_0x9ab1('0x4f')]));if(_0x2e3485['query'][_0x9ab1('0x2d')]){_0x57b03e['where']=_[_0x9ab1('0x55')](_0x57b03e[_0x9ab1('0x3e')],{'$or':_['map'](_0x57b03e[_0x9ab1('0x41')],function(_0x4bcea5){var _0x8b5646={};_0x8b5646[_0x4bcea5]={'$like':'%'+_0x2e3485['query']['filter']+'%'};return _0x8b5646;})});}_0x57b03e=_['merge']({},_0x57b03e,_0x2e3485[_0x9ab1('0x56')]);return _0x171334[_0x9ab1('0xe1')](_0x57b03e);}})['then'](function(_0x46f110){if(_0x46f110){_0x2bf4ab=_0x46f110['length'];if(!_0x2e3485[_0x9ab1('0x3f')][_0x9ab1('0xc7')](_0x9ab1('0xcf'))){_0x57b03e[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x2e3485[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x57b03e[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x2e3485[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}return _0x171334[_0x9ab1('0xe1')](_0x57b03e);}})[_0x9ab1('0x13')](function(_0x1b0812){if(_0x1b0812){return _0x1b0812?{'count':_0x2bf4ab,'rows':_0x1b0812}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x60d8a6,null))[_0x9ab1('0x1a')](handleError(_0x60d8a6,null));};exports[_0x9ab1('0xe3')]=function(_0x8399c6,_0x21c27a,_0x4fdcee){var _0x4ae366;var _0x3a4636;var _0x343cd8;var _0x126f0f=!_[_0x9ab1('0x62')](_0x8399c6['params']['id'])?_0x8399c6[_0x9ab1('0x4b')]['id']:!_[_0x9ab1('0x62')](_0x8399c6[_0x9ab1('0x2a')]['id'])?_0x8399c6[_0x9ab1('0x2a')]['id']:null;return db[_0x9ab1('0x36')]['find']({'where':{'id':_0x126f0f,'role':{'$or':[_0x9ab1('0x28'),_0x9ab1('0x2a'),_0x9ab1('0x2c')]}},'attributes':['id',_0x9ab1('0x31'),'phone',_0x9ab1('0xe4'),'role',_0x9ab1('0x61'),_0x9ab1('0xe5')]})[_0x9ab1('0x13')](function(_0xf2679d){if(_0xf2679d){if(_0xf2679d[_0x9ab1('0x27')]===_0x9ab1('0x2c')){_0x4ae366=_0xf2679d;if(_0x8399c6[_0x9ab1('0x59')]['interface']){_0x343cd8=util[_0x9ab1('0xa2')]('LOCAL/%s@from-sip/n',_0x4ae366[_0x8399c6[_0x9ab1('0x59')][_0x9ab1('0xa1')]]);}else if(_0x8399c6[_0x9ab1('0x59')][_0x9ab1('0xe6')]){_0x343cd8=util[_0x9ab1('0xa2')](_0x9ab1('0xa3'),_0x8399c6[_0x9ab1('0x59')][_0x9ab1('0xe6')]);}else{_0x343cd8=util[_0x9ab1('0xa2')](_0x9ab1('0xa3'),_0x4ae366[_0x9ab1('0x31')]);}socket['to'](util[_0x9ab1('0xa2')]('user:%s',_0x4ae366['name']))['emit'](_0x9ab1('0xe7'),{'user':{'id':_0x4ae366['id'],'name':_0x4ae366['name']},'ip':_0x8399c6[_0x9ab1('0xe8')][_0x9ab1('0xe9')]||_0x8399c6[_0x9ab1('0xea')]['remoteAddress']||_0x8399c6[_0x9ab1('0xeb')][_0x9ab1('0xec')]||_0x8399c6[_0x9ab1('0xea')][_0x9ab1('0xeb')]['remoteAddress']});return db[_0x9ab1('0xa4')][_0x9ab1('0x25')]({'where':{'membername':_0x4ae366[_0x9ab1('0x31')]},'individualHooks':!![]});}}else{throw new db[(_0x9ab1('0x88'))][(_0x9ab1('0x89'))](_0x9ab1('0xed'));}})[_0x9ab1('0x13')](function(){if(_0x4ae366){return _0x4ae366[_0x9ab1('0xee')]({'raw':!![]});}})[_0x9ab1('0x13')](function(_0x4b600d){if(_0x4ae366){var _0x33648f=[];if(_0x4b600d){_0x3a4636=_0x4b600d;if(_0x3a4636[_0x9ab1('0x44')]){for(var _0x36b88a=0x0;_0x36b88a<_0x3a4636[_0x9ab1('0x44')];_0x36b88a++){_0x33648f['push']({'membername':_0x4ae366[_0x9ab1('0x31')],'UserId':_0x4ae366['id'],'queue_name':_0x3a4636[_0x36b88a][_0x9ab1('0x31')],'VoiceQueueId':_0x3a4636[_0x36b88a]['id'],'interface':_0x343cd8,'paused':_0x4ae366[_0x9ab1('0xe5')]||![],'penalty':_0x3a4636[_0x36b88a][_0x9ab1('0xef')]||0x0});}return BPromise['each'](_0x33648f,function(_0x283e7c){return db[_0x9ab1('0xa4')][_0x9ab1('0xa5')](_0x283e7c);});}}}})[_0x9ab1('0x13')](function(){if(_0x4ae366){return db[_0x9ab1('0xf0')][_0x9ab1('0x83')]({'where':{'membername':_0x4ae366['name'],'exitAt':null}});}})['then'](function(_0x4834c9){if(_0x4ae366){var _0xbe631e=[];_0x4834c9['forEach'](function(_0x518be7){_0xbe631e['push'](_0x518be7[_0x9ab1('0x24')]({'exitAt':moment()['format'](_0x9ab1('0xf1'))}));});return BPromise[_0x9ab1('0x58')](_0xbe631e);}})['then'](function(){if(_0x4ae366){var _0x2cd073=[];var _0x244ac4=[];var _0x5131d3=utils[_0x9ab1('0xf2')]();var _0xcc51c0={'membername':_0x4ae366[_0x9ab1('0x31')],'interface':_0x343cd8,'enterAt':moment()[_0x9ab1('0xa2')](_0x9ab1('0xf1')),'role':_0x4ae366[_0x9ab1('0x27')],'internal':_0x4ae366[_0x9ab1('0x61')]};_0x5131d3['forEach'](function(_0x581bd7){_0x2cd073[_0x9ab1('0x42')](_[_0x9ab1('0x55')]({'channel':_0x581bd7,'type':'LOGIN','data1':_0x8399c6[_0x9ab1('0x59')][_0x9ab1('0xf3')],'data2':_0x343cd8},_0xcc51c0));if(_0x4ae366[_0x9ab1('0xe5')]){_0x244ac4['push'](_[_0x9ab1('0x55')]({'channel':_0x581bd7,'type':'PAUSE','data1':_0x9ab1('0xf4')},_0xcc51c0));}});return db[_0x9ab1('0xf0')][_0x9ab1('0x7f')](_0x2cd073[_0x9ab1('0xc0')](_0x244ac4),{'individualHooks':!![]});}})['then'](function(){if(_0x4ae366){return _0x4ae366[_0x9ab1('0x24')]({'online':!![],'lastLoginAt':moment()[_0x9ab1('0xa2')](_0x9ab1('0xf1')),'voicePause':_0x4ae366[_0x9ab1('0xe5')]||![],'mailPause':_0x4ae366['loginInPause']||![],'chatPause':_0x4ae366[_0x9ab1('0xe5')]||![],'faxPause':_0x4ae366[_0x9ab1('0xe5')]||![],'smsPause':_0x4ae366[_0x9ab1('0xe5')]||![],'openchannelPause':_0x4ae366['loginInPause']||![],'whatsappPause':_0x4ae366[_0x9ab1('0xe5')]||![],'pauseType':_0x4ae366[_0x9ab1('0xe5')]?_0x9ab1('0xf4'):null,'interface':_0x343cd8,'lastPauseAt':moment()[_0x9ab1('0xa2')](_0x9ab1('0xf1'))});}})['then'](function(_0xa8251f){if(_0x8399c6[_0x9ab1('0xf5')]){return _0x4fdcee();}else{return BPromise['resolve'](_0xa8251f)['then'](respondWithResult(_0x21c27a,null));}})['catch'](handleError(_0x21c27a,null));};exports[_0x9ab1('0xf6')]=function(_0x28e4ac,_0x1ee06f){var _0x3c34d9;return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x28e4ac[_0x9ab1('0x4b')]['id'],'role':_0x9ab1('0x2c')},'attributes':['id','name',_0x9ab1('0x27')]})[_0x9ab1('0x13')](handleEntityNotFound(_0x1ee06f,null))[_0x9ab1('0x13')](function(_0x1263ac){if(_0x1263ac){_0x3c34d9=_0x1263ac;return db[_0x9ab1('0xa4')][_0x9ab1('0x25')]({'where':{'membername':_0x3c34d9[_0x9ab1('0x31')]},'individualHooks':!![]});}})[_0x9ab1('0x13')](function(){return db['MemberReport'][_0x9ab1('0x83')]({'where':{'membername':_0x3c34d9[_0x9ab1('0x31')],'exitAt':null}});})['then'](function(_0x5e3683){var _0x44a052=[];_0x5e3683[_0x9ab1('0xf7')](function(_0x20b343){_0x44a052[_0x9ab1('0x42')](_0x20b343[_0x9ab1('0x24')]({'exitAt':moment()['format'](_0x9ab1('0xf1'))}));});return BPromise[_0x9ab1('0x58')](_0x44a052);})[_0x9ab1('0x13')](function(){return _0x3c34d9[_0x9ab1('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x1ee06f,null))[_0x9ab1('0x1a')](handleError(_0x1ee06f,null));};exports['pause']=function(_0x3d1a26,_0x6f0b49){var _0x45be48;return db[_0x9ab1('0xa4')]['update']({'paused':0x1},{'where':{'UserId':_0x3d1a26[_0x9ab1('0x4b')]['id']},'individualHooks':!![]})[_0x9ab1('0x13')](function(){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x3d1a26[_0x9ab1('0x4b')]['id'],'role':_0x9ab1('0x2c')},'attributes':['id',_0x9ab1('0x31'),_0x9ab1('0x27'),_0x9ab1('0x61'),_0x9ab1('0xa1')]});})['then'](handleEntityNotFound(_0x6f0b49,null))[_0x9ab1('0x13')](function(_0x1adb3f){if(_0x1adb3f){_0x45be48=_0x1adb3f;return respondWithRpcPromise(_0x9ab1('0xf8'),_0x9ab1('0xf9'),{'id':_0x45be48['id'],'name':_0x45be48[_0x9ab1('0x31')],'pause':!![]});}})[_0x9ab1('0x13')](function(){if(_0x45be48){return db[_0x9ab1('0xf0')][_0x9ab1('0x83')]({'where':{'membername':_0x45be48[_0x9ab1('0x31')],'type':_0x9ab1('0xfa'),'exitAt':null}});}})[_0x9ab1('0x13')](function(_0x5da131){if(_0x5da131[_0x9ab1('0x44')]){var _0x3b1ff2=moment()[_0x9ab1('0xa2')](_0x9ab1('0xf1'));for(var _0x470c2d=0x0,_0x152334=_0x5da131[_0x9ab1('0x44')];_0x470c2d<_0x152334;_0x470c2d++){_0x5da131[_0x470c2d]['updateAttributes']({'exitAt':_0x3b1ff2});}}})[_0x9ab1('0x13')](function(){var _0x44d7c3=[];var _0x1fb5ea=utils['getChannels']();_0x1fb5ea[_0x9ab1('0xf7')](function(_0x52e3a4){_0x44d7c3[_0x9ab1('0x42')]({'channel':_0x52e3a4,'membername':_0x45be48[_0x9ab1('0x31')],'interface':_[_0x9ab1('0x62')](_0x45be48[_0x9ab1('0xa1')])?util[_0x9ab1('0xa2')]('SIP/%s',_0x45be48['name']):_0x45be48[_0x9ab1('0xa1')],'type':_0x9ab1('0xfa'),'enterAt':moment()[_0x9ab1('0xa2')](_0x9ab1('0xf1')),'data1':_0x3d1a26['body'][_0x9ab1('0x3a')]||_0x9ab1('0xfb'),'role':_0x45be48[_0x9ab1('0x27')],'internal':_0x45be48[_0x9ab1('0x61')]});});return db[_0x9ab1('0xf0')]['bulkCreate'](_0x44d7c3,{'individualHooks':!![]});})[_0x9ab1('0x13')](function(){return _0x45be48['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3d1a26[_0x9ab1('0x59')][_0x9ab1('0x3a')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x9ab1('0xa2')](_0x9ab1('0xf1'))});})[_0x9ab1('0x13')](respondWithResult(_0x6f0b49,null))[_0x9ab1('0x1a')](handleError(_0x6f0b49,null));};exports[_0x9ab1('0xfc')]=function(_0x164210,_0x447a9b){var _0x4fb722;return db[_0x9ab1('0x36')]['find']({'where':{'id':_0x164210[_0x9ab1('0x4b')]['id']},'attributes':['id',_0x9ab1('0x31'),'role',_0x9ab1('0x95'),_0x9ab1('0xfd'),_0x9ab1('0xfe'),_0x9ab1('0xff'),'openchannelPause',_0x9ab1('0x100'),'whatsapppause',_0x9ab1('0x101'),'lastPauseAt']})[_0x9ab1('0x13')](handleEntityNotFound(_0x447a9b,null))[_0x9ab1('0x13')](function(_0x324d6e){if(_0x324d6e){_0x4fb722=_0x324d6e;if(_0x164210['body'][_0x9ab1('0x93')]&&!utils[_0x9ab1('0xa6')](_0x164210[_0x9ab1('0x59')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x9ab1('0xa7'));}switch(_0x164210[_0x9ab1('0x59')][_0x9ab1('0x93')]){case _0x9ab1('0x9f'):return respondWithRpcPromise(_0x9ab1('0xf8'),_0x9ab1('0xfc'),{'id':_0x4fb722['id'],'name':_0x4fb722[_0x9ab1('0x31')],'pause':![]})['then'](function(){return db[_0x9ab1('0xa4')]['update']({'paused':0x0},{'where':{'UserId':_0x4fb722['id']},'individualHooks':!![]});})[_0x9ab1('0x13')](function(){return db[_0x9ab1('0xf0')][_0x9ab1('0x5a')]({'where':{'channel':_0x164210[_0x9ab1('0x59')]['channel'],'membername':_0x4fb722[_0x9ab1('0x31')],'type':_0x9ab1('0xfa'),'exitAt':null}});})['then'](function(_0x5ab766){if(_0x5ab766){return _0x5ab766[_0x9ab1('0x24')]({'exitAt':moment()['format'](_0x9ab1('0xf1')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x9ab1('0x13')](function(){return _0x4fb722[_0x9ab1('0x24')]({'voicePause':![]});});case _0x9ab1('0x47'):case _0x9ab1('0xb5'):case'fax':case _0x9ab1('0xb6'):case _0x9ab1('0x49'):case'openchannel':return db[_0x9ab1('0xf0')][_0x9ab1('0x5a')]({'where':{'channel':_0x164210[_0x9ab1('0x59')][_0x9ab1('0x93')],'membername':_0x4fb722[_0x9ab1('0x31')],'type':_0x9ab1('0xfa'),'exitAt':null}})[_0x9ab1('0x13')](function(_0x3a266d){if(_0x3a266d){return _0x3a266d[_0x9ab1('0x24')]({'exitAt':moment()[_0x9ab1('0xa2')](_0x9ab1('0xf1')),'data2':_0x9ab1('0x102')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x2f739d={};_[_0x9ab1('0x21')](_0x2f739d,util[_0x9ab1('0xa2')]('%s%s',_0x164210[_0x9ab1('0x59')]['channel'],_0x9ab1('0x103')),![]);return _0x4fb722[_0x9ab1('0x24')](_0x2f739d);});default:return respondWithRpcPromise(_0x9ab1('0xf8'),'unpause',{'id':_0x4fb722['id'],'name':_0x4fb722[_0x9ab1('0x31')],'pause':![]})['then'](function(){return db[_0x9ab1('0xa4')]['update']({'paused':0x0},{'where':{'UserId':_0x4fb722['id']}});})[_0x9ab1('0x13')](function(){return db[_0x9ab1('0xf0')]['findAll']({'where':{'membername':_0x4fb722[_0x9ab1('0x31')],'type':_0x9ab1('0xfa'),'exitAt':null}});})[_0x9ab1('0x13')](function(_0x4b9b80){var _0x48b3a6=[];_0x4b9b80[_0x9ab1('0xf7')](function(_0x70d984){_0x48b3a6[_0x9ab1('0x42')](_0x70d984[_0x9ab1('0x24')]({'exitAt':moment()['format'](_0x9ab1('0xf1')),'data2':_0x9ab1('0x102')}));});return BPromise[_0x9ab1('0x58')](_0x48b3a6);})[_0x9ab1('0x13')](function(){return _0x4fb722[_0x9ab1('0x24')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x9ab1('0x13')](respondWithResult(_0x447a9b,null))[_0x9ab1('0x1a')](handleError(_0x447a9b,null));};exports[_0x9ab1('0x104')]=function(_0x413e7e,_0x55b8d1){var _0x1163d5={};var _0x4bd818={};var _0x299f7a;var _0x937e4;return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x413e7e[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x55b8d1,null))[_0x9ab1('0x13')](function(_0x39eca5){if(_0x39eca5){_0x299f7a=_0x39eca5;_0x4bd818[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db['Team'][_0x9ab1('0x37')]);_0x4bd818[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x413e7e[_0x9ab1('0x3f')]);_0x4bd818['filters']=_[_0x9ab1('0x50')](_0x4bd818['model'],_0x4bd818['query']);_0x1163d5['attributes']=_[_0x9ab1('0x50')](_0x4bd818[_0x9ab1('0x4c')],qs['fields'](_0x413e7e['query'][_0x9ab1('0x51')]));_0x1163d5[_0x9ab1('0x41')]=_0x1163d5[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x1163d5[_0x9ab1('0x41')]:_0x4bd818[_0x9ab1('0x4c')];_0x1163d5[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x413e7e[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x1163d5[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_['pick'](_0x413e7e[_0x9ab1('0x3f')],_0x4bd818['filters']));if(_0x413e7e[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x1163d5[_0x9ab1('0x3e')]=_[_0x9ab1('0x55')](_0x1163d5[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0x1163d5[_0x9ab1('0x41')],function(_0x3bf5f9){var _0x5a3645={};_0x5a3645[_0x3bf5f9]={'$like':'%'+_0x413e7e[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x5a3645;})});}_0x1163d5=_[_0x9ab1('0x55')]({},_0x1163d5,_0x413e7e['options']);return _0x299f7a[_0x9ab1('0x104')](_0x1163d5);}})[_0x9ab1('0x13')](function(_0x64cca1){if(_0x64cca1){_0x937e4=_0x64cca1[_0x9ab1('0x44')];if(!_0x413e7e[_0x9ab1('0x3f')][_0x9ab1('0xc7')](_0x9ab1('0xcf'))){_0x1163d5[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x413e7e['query'][_0x9ab1('0x1f')]);_0x1163d5[_0x9ab1('0x1d')]=qs['offset'](_0x413e7e[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}return _0x299f7a[_0x9ab1('0x104')](_0x1163d5);}})[_0x9ab1('0x13')](function(_0x404436){if(_0x404436){return _0x404436?{'count':_0x937e4,'rows':_0x404436}:null;}})['then'](respondWithResult(_0x55b8d1,null))[_0x9ab1('0x1a')](handleError(_0x55b8d1,null));};exports[_0x9ab1('0x105')]=function(_0x40b774,_0x19ee25){return db['User'][_0x9ab1('0x5a')]({'where':{'id':_0x40b774['params']['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x19ee25,null))[_0x9ab1('0x13')](function(_0x5d33fc){if(_0x5d33fc){var _0x4e89d0=_0x5d33fc[_0x9ab1('0x26')]({'plain':!![]});return _0x5d33fc['addTeams'](_0x40b774['body'][_0x9ab1('0x9a')],_['omit'](_0x40b774[_0x9ab1('0x59')],[_0x9ab1('0x9a'),'id'])||{})[_0x9ab1('0x13')](function(){for(var _0x1b8cfb=0x0;_0x1b8cfb<_0x40b774[_0x9ab1('0x59')]['ids'][_0x9ab1('0x44')];_0x1b8cfb++){var _0x3ad1a3=[];var _0x52db54={};db[_0x9ab1('0x106')][_0x9ab1('0xc2')]({'where':{'id':_0x40b774['body'][_0x9ab1('0x9a')][_0x1b8cfb]}})[_0x9ab1('0x13')](function(_0x4fdee5){_0x52db54=_0x4fdee5[_0x9ab1('0x46')];_0x3ad1a3[_0x9ab1('0x42')](_0x4fdee5['getVoiceQueues']()[_0x9ab1('0x13')](function(_0x11786c){for(var _0x23130c=0x0;_0x23130c<_0x11786c[_0x9ab1('0x44')];_0x23130c++){_0x11786c[_0x23130c][_0x9ab1('0x107')](_0x9ab1('0x93'),_0x9ab1('0x108'));}return _0x11786c;}));_0x3ad1a3[_0x9ab1('0x42')](_0x4fdee5['getChatQueues']()['then'](function(_0x5aa205){for(var _0x3a3b1c=0x0;_0x3a3b1c<_0x5aa205[_0x9ab1('0x44')];_0x3a3b1c++){_0x5aa205[_0x3a3b1c][_0x9ab1('0x107')](_0x9ab1('0x93'),'Chat');}return _0x5aa205;}));_0x3ad1a3[_0x9ab1('0x42')](_0x4fdee5['getMailQueues']()[_0x9ab1('0x13')](function(_0x9019cd){for(var _0x37fd45=0x0;_0x37fd45<_0x9019cd[_0x9ab1('0x44')];_0x37fd45++){_0x9019cd[_0x37fd45][_0x9ab1('0x107')](_0x9ab1('0x93'),'Mail');}return _0x9019cd;}));_0x3ad1a3[_0x9ab1('0x42')](_0x4fdee5[_0x9ab1('0x109')]()[_0x9ab1('0x13')](function(_0x54fd98){for(var _0x5d872e=0x0;_0x5d872e<_0x54fd98[_0x9ab1('0x44')];_0x5d872e++){_0x54fd98[_0x5d872e][_0x9ab1('0x107')](_0x9ab1('0x93'),_0x9ab1('0x10a'));}return _0x54fd98;}));_0x3ad1a3[_0x9ab1('0x42')](_0x4fdee5[_0x9ab1('0x10b')]()[_0x9ab1('0x13')](function(_0x3e05a4){for(var _0x1865a2=0x0;_0x1865a2<_0x3e05a4[_0x9ab1('0x44')];_0x1865a2++){_0x3e05a4[_0x1865a2]['setDataValue'](_0x9ab1('0x93'),_0x9ab1('0x10c'));}return _0x3e05a4;}));_0x3ad1a3[_0x9ab1('0x42')](_0x4fdee5[_0x9ab1('0x10d')]()[_0x9ab1('0x13')](function(_0x54524e){for(var _0x11a346=0x0;_0x11a346<_0x54524e[_0x9ab1('0x44')];_0x11a346++){_0x54524e[_0x11a346][_0x9ab1('0x107')](_0x9ab1('0x93'),_0x9ab1('0x10e'));}return _0x54524e;}));_0x3ad1a3[_0x9ab1('0x42')](_0x4fdee5['getOpenchannelQueues']()[_0x9ab1('0x13')](function(_0x4c65af){for(var _0x36ab3d=0x0;_0x36ab3d<_0x4c65af['length'];_0x36ab3d++){_0x4c65af[_0x36ab3d][_0x9ab1('0x107')](_0x9ab1('0x93'),_0x9ab1('0x10f'));}return _0x4c65af;}));return BPromise['all'](_0x3ad1a3);})[_0x9ab1('0x13')](function(_0x13faa7){var _0x2c36ec=_[_0x9ab1('0x110')](_0x13faa7);_0x3ad1a3=[];return db[_0x9ab1('0x64')][_0x9ab1('0x111')](function(_0xc6cc03){for(var _0x4dae1f=0x0;_0x4dae1f<_0x2c36ec[_0x9ab1('0x44')];_0x4dae1f++){_0x3ad1a3[_0x9ab1('0x42')](_0x2c36ec[_0x4dae1f][_0x9ab1('0x112')](_0x4e89d0['id']),{'transaction':_0xc6cc03});}return BPromise[_0x9ab1('0x58')](_0x3ad1a3)[_0x9ab1('0x13')](function(){if(_0x4e89d0[_0x9ab1('0x94')]){return BPromise[_0x9ab1('0x81')](_[_0x9ab1('0x2d')](_0x2c36ec,function(_0x56a4f8){return _0x56a4f8[_0x9ab1('0x113')](_0x9ab1('0x93'))===_0x9ab1('0x108');}),function(_0x304d38){return db[_0x9ab1('0xa4')][_0x9ab1('0xa5')]({'membername':_0x4e89d0[_0x9ab1('0x31')],'UserId':_0x4e89d0['id'],'queue_name':_0x304d38[_0x9ab1('0x31')],'VoiceQueueId':_0x304d38['id'],'interface':_[_0x9ab1('0x62')](_0x4e89d0[_0x9ab1('0xa1')])?util['format'](_0x9ab1('0xa3'),_0x4e89d0[_0x9ab1('0x31')]):_0x4e89d0[_0x9ab1('0xa1')],'paused':_0x4e89d0[_0x9ab1('0x95')]||![],'penalty':_0x4e89d0[_0x9ab1('0x9b')]},{'transaction':_0xc6cc03});});}else{return;}})['then'](function(){for(var _0x34418f=0x0;_0x34418f<_0x2c36ec[_0x9ab1('0x44')];_0x34418f++){var _0x2ca8eb=_0x2c36ec[_0x34418f]['getDataValue']('channel');var _0x328707=_0x2ca8eb+'QueueId';socket[_0x9ab1('0x9d')](_0x9ab1('0x2a')+_0x2ca8eb+_0x9ab1('0x9e'),{'UserId':_0x4e89d0['id'],['queueField']:_0x2c36ec[_0x34418f]['id']});}});});})[_0x9ab1('0x13')](function(){db['TeamVoicePrefix'][_0x9ab1('0xc2')]({'where':{'teamId':_0x52db54['id']}})[_0x9ab1('0x13')](function(_0x31e0d0){if(_0x31e0d0){db[_0x9ab1('0x114')][_0x9ab1('0x75')]({'UserId':_0x40b774[_0x9ab1('0x4b')]['id'],'VoicePrefixId':_0x31e0d0[_0x9ab1('0x115')]});}});});}});}})[_0x9ab1('0x13')](respondWithStatusCode(_0x19ee25,null))[_0x9ab1('0x1a')](handleError(_0x19ee25,null));};exports[_0x9ab1('0x116')]=function(_0x21f3af,_0xd26a35){return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x21f3af['params']['id']}})['then'](handleEntityNotFound(_0xd26a35,null))['then'](function(_0x2bd699){if(_0x2bd699){var _0x333a1c=_0x2bd699[_0x9ab1('0x26')]({'plain':!![]});var _0x316c73=_0x21f3af[_0x9ab1('0x3f')][_0x9ab1('0x9a')];return _0x2bd699[_0x9ab1('0x116')](_0x316c73)[_0x9ab1('0x13')](function(){for(var _0x51fd4f=0x0;_0x51fd4f<_0x316c73[_0x9ab1('0x44')];_0x51fd4f++){var _0x1531ce=[];var _0x116d34={};db[_0x9ab1('0x106')][_0x9ab1('0xc2')]({'where':{'id':_0x316c73[_0x51fd4f]}})[_0x9ab1('0x13')](function(_0x4a8832){_0x116d34=_0x4a8832['dataValues'];_0x1531ce[_0x9ab1('0x42')](_0x4a8832[_0x9ab1('0xee')]()['then'](function(_0x282224){for(var _0x29517f=0x0;_0x29517f<_0x282224[_0x9ab1('0x44')];_0x29517f++){_0x282224[_0x29517f]['setDataValue'](_0x9ab1('0x93'),_0x9ab1('0x108'));}return _0x282224;}));_0x1531ce[_0x9ab1('0x42')](_0x4a8832['getChatQueues']()['then'](function(_0x1072c9){for(var _0x1cd6f1=0x0;_0x1cd6f1<_0x1072c9[_0x9ab1('0x44')];_0x1cd6f1++){_0x1072c9[_0x1cd6f1][_0x9ab1('0x107')](_0x9ab1('0x93'),_0x9ab1('0x117'));}return _0x1072c9;}));_0x1531ce['push'](_0x4a8832[_0x9ab1('0x118')]()[_0x9ab1('0x13')](function(_0x44b665){for(var _0x2859aa=0x0;_0x2859aa<_0x44b665['length'];_0x2859aa++){_0x44b665[_0x2859aa][_0x9ab1('0x107')](_0x9ab1('0x93'),_0x9ab1('0x119'));}return _0x44b665;}));_0x1531ce['push'](_0x4a8832['getSmsQueues']()[_0x9ab1('0x13')](function(_0x1af3e3){for(var _0x247e8f=0x0;_0x247e8f<_0x1af3e3[_0x9ab1('0x44')];_0x247e8f++){_0x1af3e3[_0x247e8f][_0x9ab1('0x107')]('channel',_0x9ab1('0x10a'));}return _0x1af3e3;}));_0x1531ce[_0x9ab1('0x42')](_0x4a8832[_0x9ab1('0x10b')]()[_0x9ab1('0x13')](function(_0x5989e0){for(var _0x1cdbf9=0x0;_0x1cdbf9<_0x5989e0['length'];_0x1cdbf9++){_0x5989e0[_0x1cdbf9]['setDataValue']('channel','Whatsapp');}return _0x5989e0;}));_0x1531ce[_0x9ab1('0x42')](_0x4a8832[_0x9ab1('0x10d')]()[_0x9ab1('0x13')](function(_0xa0ed2a){for(var _0x31bbfd=0x0;_0x31bbfd<_0xa0ed2a[_0x9ab1('0x44')];_0x31bbfd++){_0xa0ed2a[_0x31bbfd][_0x9ab1('0x107')](_0x9ab1('0x93'),_0x9ab1('0x10e'));}return _0xa0ed2a;}));_0x1531ce[_0x9ab1('0x42')](_0x4a8832['getOpenchannelQueues']()[_0x9ab1('0x13')](function(_0x448d65){for(var _0x15d8d3=0x0;_0x15d8d3<_0x448d65[_0x9ab1('0x44')];_0x15d8d3++){_0x448d65[_0x15d8d3][_0x9ab1('0x107')](_0x9ab1('0x93'),'Openchannel');}return _0x448d65;}));return BPromise[_0x9ab1('0x58')](_0x1531ce);})[_0x9ab1('0x13')](function(_0x1d58b3){var _0x5e375e=_[_0x9ab1('0x110')](_0x1d58b3);_0x1531ce=[];return db[_0x9ab1('0x64')][_0x9ab1('0x111')](function(_0x1b21d4){for(var _0x410c46=0x0;_0x410c46<_0x5e375e['length'];_0x410c46++){_0x1531ce[_0x9ab1('0x42')](_0x5e375e[_0x410c46][_0x9ab1('0x11a')](_0x333a1c['id']),{'transaction':_0x1b21d4});}return BPromise['all'](_0x1531ce)[_0x9ab1('0x13')](function(){if(_0x333a1c[_0x9ab1('0x94')]){return BPromise[_0x9ab1('0x81')](_[_0x9ab1('0x2d')](_0x5e375e,function(_0x480819){return _0x480819['getDataValue']('channel')===_0x9ab1('0x108');}),function(_0x23f651){return db['UserVoiceQueueRt'][_0x9ab1('0x25')]({'where':{'VoiceQueueId':_0x23f651['id'],'UserId':_0x333a1c['id']},'transaction':_0x1b21d4});});}else{return;}})[_0x9ab1('0x13')](function(){db[_0x9ab1('0x11b')][_0x9ab1('0xc2')]({'where':{'teamId':_0x116d34['id']}})[_0x9ab1('0x13')](function(_0x483f52){if(_0x483f52){return db[_0x9ab1('0x114')]['destroy']({'where':{'UserId':_0x333a1c['id'],'VoicePrefixId':_0x483f52[_0x9ab1('0x46')][_0x9ab1('0x115')]}});}});})[_0x9ab1('0x13')](function(){for(var _0x22f975=0x0;_0x22f975<_0x5e375e['length'];_0x22f975++){var _0x27daab=_0x5e375e[_0x22f975][_0x9ab1('0x113')]('channel');var _0x1a0f3b=_0x27daab+_0x9ab1('0xaa');socket[_0x9ab1('0x9d')]('user'+_0x27daab+'Queue:remove',{'UserId':_0x333a1c['id'],['queueField']:_0x5e375e[_0x22f975]['id']});}});});});}});}})['then'](respondWithStatusCode(_0xd26a35,null))['catch'](handleError(_0xd26a35,null));};exports['getLists']=function(_0x1d0c1f,_0x1d478b){var _0x49ea14={};var _0xc4f8da={};var _0x2aca03;var _0x307975;return db['User'][_0x9ab1('0xc2')]({'where':{'id':_0x1d0c1f[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x1d478b,null))[_0x9ab1('0x13')](function(_0x906f0b){if(_0x906f0b){_0x2aca03=_0x906f0b;_0xc4f8da[_0x9ab1('0x4c')]=_['keys'](db[_0x9ab1('0xc8')][_0x9ab1('0x37')]);_0xc4f8da['query']=_[_0x9ab1('0x4e')](_0x1d0c1f[_0x9ab1('0x3f')]);_0xc4f8da[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0xc4f8da[_0x9ab1('0x4c')],_0xc4f8da[_0x9ab1('0x3f')]);_0x49ea14[_0x9ab1('0x41')]=_['intersection'](_0xc4f8da[_0x9ab1('0x4c')],qs['fields'](_0x1d0c1f[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x49ea14[_0x9ab1('0x41')]=_0x49ea14[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x49ea14['attributes']:_0xc4f8da[_0x9ab1('0x4c')];_0x49ea14[_0x9ab1('0xc4')]=qs['sort'](_0x1d0c1f[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x49ea14[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x1d0c1f['query'],_0xc4f8da['filters']));if(_0x1d0c1f[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x49ea14['where']=_[_0x9ab1('0x55')](_0x49ea14[_0x9ab1('0x3e')],{'$or':_['map'](_0x49ea14[_0x9ab1('0x41')],function(_0x34abb3){var _0x50da37={};_0x50da37[_0x34abb3]={'$like':'%'+_0x1d0c1f[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x50da37;})});}_0x49ea14=_[_0x9ab1('0x55')]({},_0x49ea14,_0x1d0c1f[_0x9ab1('0x56')]);return _0x2aca03[_0x9ab1('0x11c')](_0x49ea14);}})['then'](function(_0x494e66){if(_0x494e66){_0x307975=_0x494e66[_0x9ab1('0x44')];if(!_0x1d0c1f[_0x9ab1('0x3f')]['hasOwnProperty'](_0x9ab1('0xcf'))){_0x49ea14[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x1d0c1f[_0x9ab1('0x3f')]['limit']);_0x49ea14[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x1d0c1f[_0x9ab1('0x3f')]['offset']);}return _0x2aca03['getLists'](_0x49ea14);}})['then'](function(_0x5d23b0){if(_0x5d23b0){return _0x5d23b0?{'count':_0x307975,'rows':_0x5d23b0}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x1d478b,null))[_0x9ab1('0x1a')](handleError(_0x1d478b,null));};exports[_0x9ab1('0x11d')]=function(_0x40693e,_0x51319c){var _0x39b0aa={};var _0x48cfae={};var _0x3babc9;return db['User'][_0x9ab1('0xc2')]({'where':{'id':_0x40693e[_0x9ab1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x51319c,null))[_0x9ab1('0x13')](function(_0x4763a){if(_0x4763a){_0x3babc9=_0x4763a;_0x48cfae[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db[_0x9ab1('0x36')][_0x9ab1('0x37')]);_0x48cfae[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x40693e[_0x9ab1('0x3f')]);_0x48cfae[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x48cfae[_0x9ab1('0x4c')],_0x48cfae[_0x9ab1('0x3f')]);_0x39b0aa[_0x9ab1('0x41')]=_['intersection'](_0x48cfae[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x40693e[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x39b0aa[_0x9ab1('0x41')]=_0x39b0aa[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x39b0aa[_0x9ab1('0x41')]:_0x48cfae[_0x9ab1('0x4c')];_0x39b0aa[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x40693e[_0x9ab1('0x3f')]['sort']);_0x39b0aa[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x40693e['query'],_0x48cfae['filters']));if(_0x40693e[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x39b0aa['where']=_[_0x9ab1('0x55')](_0x39b0aa[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0x39b0aa[_0x9ab1('0x41')],function(_0x19da1b){var _0x3cefa4={};_0x3cefa4[_0x19da1b]={'$like':'%'+_0x40693e[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x3cefa4;})});}_0x39b0aa[_0x9ab1('0x4c')]=db[_0x9ab1('0x36')];_0x39b0aa['as']=_0x9ab1('0x2b');_0x39b0aa=_[_0x9ab1('0x55')]({},_0x39b0aa,_0x40693e[_0x9ab1('0x56')]);return _0x3babc9[_0x9ab1('0xee')]({'include':[_0x39b0aa]});}})[_0x9ab1('0x13')](function(_0x1e6bce){if(_0x1e6bce){var _0x16a876={},_0x572d06=[];for(var _0x4e4b74=0x0;_0x4e4b74<_0x1e6bce[_0x9ab1('0x44')];_0x4e4b74+=0x1){for(var _0x95fa03=0x0,_0x4bc311;_0x95fa03<_0x1e6bce[_0x4e4b74]['Agents'][_0x9ab1('0x44')];_0x95fa03+=0x1){_0x4bc311=_0x1e6bce[_0x4e4b74]['Agents'][_0x95fa03][_0x9ab1('0x26')]({'plain':!![]});_0x16a876[_0x4bc311['id']]=_0x4bc311;}}_0x16a876=_[_0x9ab1('0x11e')](_0x16a876);for(var _0x15b99b=qs[_0x9ab1('0x1d')](_0x40693e['query'][_0x9ab1('0x1d')]);_0x15b99b<_0x16a876[_0x9ab1('0x44')]&&_0x572d06[_0x9ab1('0x44')]<qs[_0x9ab1('0x1f')](_0x40693e[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x15b99b+=0x1){if(_0x16a876[_0x15b99b]){_0x572d06[_0x9ab1('0x42')](_0x16a876[_0x15b99b]);}}return{'count':_0x16a876[_0x9ab1('0x44')],'rows':_0x572d06};}})[_0x9ab1('0x13')](respondWithResult(_0x51319c,null))['catch'](handleError(_0x51319c,null));};exports['destroy']=function(_0x1166bd,_0x17af64){if(_0x1166bd['user']['id']==_0x1166bd[_0x9ab1('0x4b')]['id']){return _0x17af64['status'](0x1f4)[_0x9ab1('0x34')]({'message':_0x9ab1('0x11f')});}return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x1166bd[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x17af64,null))[_0x9ab1('0x13')](removeEntity(_0x17af64,null))[_0x9ab1('0x1a')](handleError(_0x17af64,null));};exports['addChatInteractions']=function(_0x3755ae,_0x30a7bc){return db['User'][_0x9ab1('0x5a')]({'where':{'id':_0x3755ae[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x30a7bc,null))[_0x9ab1('0x13')](function(_0x4f4075){if(_0x4f4075){return _0x4f4075[_0x9ab1('0x120')](_0x3755ae[_0x9ab1('0x59')][_0x9ab1('0x9a')],_[_0x9ab1('0x5c')](_0x3755ae[_0x9ab1('0x59')],['ids','id'])||{})['spread'](function(){for(var _0x2806dc=0x0;_0x2806dc<_0x3755ae['body'][_0x9ab1('0x9a')]['length'];_0x2806dc+=0x1){socket[_0x9ab1('0x9d')](_0x9ab1('0x121'),{'ChatInteractionId':Number(_0x3755ae[_0x9ab1('0x59')][_0x9ab1('0x9a')][_0x2806dc]),'UserId':Number(_0x3755ae[_0x9ab1('0x4b')]['id'])});}return _0x3755ae[_0x9ab1('0x59')]['ids'];});}})[_0x9ab1('0x13')](respondWithResult(_0x30a7bc,null))[_0x9ab1('0x1a')](handleError(_0x30a7bc,null));};exports[_0x9ab1('0x122')]=function(_0x5cd69c,_0x4fcae9){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x5cd69c['params']['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x4fcae9,null))[_0x9ab1('0x13')](function(_0x49d942){if(_0x49d942){return _0x49d942[_0x9ab1('0x122')](_0x5cd69c[_0x9ab1('0x3f')]['ids'])['then'](function(){if(_['isArray'](_0x5cd69c['query']['ids'])){for(var _0x4788f7=0x0;_0x4788f7<_0x5cd69c[_0x9ab1('0x3f')][_0x9ab1('0x9a')]['length'];_0x4788f7+=0x1){socket[_0x9ab1('0x9d')](_0x9ab1('0x123'),{'ChatInteractionId':Number(_0x5cd69c[_0x9ab1('0x3f')][_0x9ab1('0x9a')][_0x4788f7]),'UserId':Number(_0x5cd69c[_0x9ab1('0x4b')]['id'])});}}else{socket['emit'](_0x9ab1('0x123'),{'ChatInteractionId':Number(_0x5cd69c[_0x9ab1('0x3f')][_0x9ab1('0x9a')]),'UserId':Number(_0x5cd69c[_0x9ab1('0x4b')]['id'])});}});}})[_0x9ab1('0x13')](respondWithStatusCode(_0x4fcae9,null))['catch'](handleError(_0x4fcae9,null));};exports[_0x9ab1('0x124')]=function(_0x17db29,_0x37f6c9){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x17db29[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x37f6c9,null))[_0x9ab1('0x13')](function(_0x357b70){if(_0x357b70){return _0x357b70['addMailInteractions'](_0x17db29['body'][_0x9ab1('0x9a')],_['omit'](_0x17db29['body'],[_0x9ab1('0x9a'),'id'])||{})[_0x9ab1('0x9c')](function(){for(var _0x4da86c=0x0;_0x4da86c<_0x17db29['body'][_0x9ab1('0x9a')]['length'];_0x4da86c+=0x1){socket['emit']('user_has_mail_interactions:save',{'MailInteractionId':Number(_0x17db29[_0x9ab1('0x59')][_0x9ab1('0x9a')][_0x4da86c]),'UserId':Number(_0x17db29[_0x9ab1('0x4b')]['id'])});}return _0x17db29['body']['ids'];});}})[_0x9ab1('0x13')](respondWithResult(_0x37f6c9,null))['catch'](handleError(_0x37f6c9,null));};exports[_0x9ab1('0x125')]=function(_0x5eb057,_0x1e3645){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x5eb057[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x1e3645,null))[_0x9ab1('0x13')](function(_0x495dc0){if(_0x495dc0){return _0x495dc0[_0x9ab1('0x125')](_0x5eb057[_0x9ab1('0x3f')][_0x9ab1('0x9a')])[_0x9ab1('0x13')](function(){if(_['isArray'](_0x5eb057[_0x9ab1('0x3f')][_0x9ab1('0x9a')])){for(var _0x18dc28=0x0;_0x18dc28<_0x5eb057[_0x9ab1('0x3f')]['ids'][_0x9ab1('0x44')];_0x18dc28+=0x1){socket[_0x9ab1('0x9d')](_0x9ab1('0x126'),{'MailInteractionId':Number(_0x5eb057[_0x9ab1('0x3f')][_0x9ab1('0x9a')][_0x18dc28]),'UserId':Number(_0x5eb057['params']['id'])});}}else{socket[_0x9ab1('0x9d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x5eb057[_0x9ab1('0x3f')][_0x9ab1('0x9a')]),'UserId':Number(_0x5eb057[_0x9ab1('0x4b')]['id'])});}});}})[_0x9ab1('0x13')](respondWithStatusCode(_0x1e3645,null))[_0x9ab1('0x1a')](handleError(_0x1e3645,null));};exports[_0x9ab1('0x127')]=function(_0x4fcffb,_0x290699){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x4fcffb[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x290699,null))['then'](function(_0x2a0537){if(_0x2a0537){return _0x2a0537[_0x9ab1('0x127')](_0x4fcffb[_0x9ab1('0x59')][_0x9ab1('0x9a')],_[_0x9ab1('0x5c')](_0x4fcffb[_0x9ab1('0x59')],[_0x9ab1('0x9a'),'id'])||{})[_0x9ab1('0x9c')](function(){for(var _0x106d27=0x0;_0x106d27<_0x4fcffb[_0x9ab1('0x59')]['ids']['length'];_0x106d27+=0x1){socket[_0x9ab1('0x9d')](_0x9ab1('0x128'),{'FaxInteractionId':Number(_0x4fcffb[_0x9ab1('0x59')][_0x9ab1('0x9a')][_0x106d27]),'UserId':Number(_0x4fcffb[_0x9ab1('0x4b')]['id'])});}return _0x4fcffb[_0x9ab1('0x59')][_0x9ab1('0x9a')];});}})[_0x9ab1('0x13')](respondWithResult(_0x290699,null))[_0x9ab1('0x1a')](handleError(_0x290699,null));};exports[_0x9ab1('0x129')]=function(_0x286ece,_0x1dbe76){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x286ece[_0x9ab1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1dbe76,null))[_0x9ab1('0x13')](function(_0x5c0605){if(_0x5c0605){return _0x5c0605[_0x9ab1('0x129')](_0x286ece[_0x9ab1('0x3f')]['ids'])[_0x9ab1('0x13')](function(){if(_[_0x9ab1('0xa9')](_0x286ece[_0x9ab1('0x3f')][_0x9ab1('0x9a')])){for(var _0xa7065e=0x0;_0xa7065e<_0x286ece[_0x9ab1('0x3f')][_0x9ab1('0x9a')][_0x9ab1('0x44')];_0xa7065e+=0x1){socket[_0x9ab1('0x9d')](_0x9ab1('0x12a'),{'FaxInteractionId':Number(_0x286ece['query'][_0x9ab1('0x9a')][_0xa7065e]),'UserId':Number(_0x286ece[_0x9ab1('0x4b')]['id'])});}}else{socket[_0x9ab1('0x9d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x286ece[_0x9ab1('0x3f')]['ids']),'UserId':Number(_0x286ece['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1dbe76,null))[_0x9ab1('0x1a')](handleError(_0x1dbe76,null));};exports['addSmsInteractions']=function(_0x514e6a,_0x2ac0a8){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x514e6a[_0x9ab1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ac0a8,null))[_0x9ab1('0x13')](function(_0x109a81){if(_0x109a81){return _0x109a81[_0x9ab1('0x12b')](_0x514e6a[_0x9ab1('0x59')]['ids'],_[_0x9ab1('0x5c')](_0x514e6a['body'],['ids','id'])||{})['spread'](function(){for(var _0x12f082=0x0;_0x12f082<_0x514e6a['body'][_0x9ab1('0x9a')][_0x9ab1('0x44')];_0x12f082+=0x1){socket[_0x9ab1('0x9d')](_0x9ab1('0x12c'),{'SmsInteractionId':Number(_0x514e6a[_0x9ab1('0x59')][_0x9ab1('0x9a')][_0x12f082]),'UserId':Number(_0x514e6a['params']['id'])});}return _0x514e6a[_0x9ab1('0x59')][_0x9ab1('0x9a')];});}})['then'](respondWithResult(_0x2ac0a8,null))['catch'](handleError(_0x2ac0a8,null));};exports[_0x9ab1('0x12d')]=function(_0xa2500e,_0x21ebe7){return db['User'][_0x9ab1('0x5a')]({'where':{'id':_0xa2500e[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x21ebe7,null))['then'](function(_0xb68367){if(_0xb68367){return _0xb68367['removeSmsInteractions'](_0xa2500e[_0x9ab1('0x3f')]['ids'])[_0x9ab1('0x13')](function(){if(_['isArray'](_0xa2500e[_0x9ab1('0x3f')][_0x9ab1('0x9a')])){for(var _0x344156=0x0;_0x344156<_0xa2500e[_0x9ab1('0x3f')][_0x9ab1('0x9a')][_0x9ab1('0x44')];_0x344156+=0x1){socket[_0x9ab1('0x9d')](_0x9ab1('0x12e'),{'SmsInteractionId':Number(_0xa2500e['query'][_0x9ab1('0x9a')][_0x344156]),'UserId':Number(_0xa2500e[_0x9ab1('0x4b')]['id'])});}}else{socket[_0x9ab1('0x9d')](_0x9ab1('0x12e'),{'SmsInteractionId':Number(_0xa2500e[_0x9ab1('0x3f')]['ids']),'UserId':Number(_0xa2500e['params']['id'])});}});}})[_0x9ab1('0x13')](respondWithStatusCode(_0x21ebe7,null))[_0x9ab1('0x1a')](handleError(_0x21ebe7,null));};exports[_0x9ab1('0x12f')]=function(_0x5366d7,_0x42992a){return db['User'][_0x9ab1('0x5a')]({'where':{'id':_0x5366d7['params']['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x42992a,null))[_0x9ab1('0x13')](function(_0x46f7f5){if(_0x46f7f5){return _0x46f7f5['addOpenchannelInteractions'](_0x5366d7['body']['ids'],_[_0x9ab1('0x5c')](_0x5366d7[_0x9ab1('0x59')],[_0x9ab1('0x9a'),'id'])||{})[_0x9ab1('0x9c')](function(){for(var _0x5d8801=0x0;_0x5d8801<_0x5366d7[_0x9ab1('0x59')][_0x9ab1('0x9a')][_0x9ab1('0x44')];_0x5d8801+=0x1){socket[_0x9ab1('0x9d')](_0x9ab1('0x130'),{'OpenchannelInteractionId':Number(_0x5366d7[_0x9ab1('0x59')][_0x9ab1('0x9a')][_0x5d8801]),'UserId':Number(_0x5366d7[_0x9ab1('0x4b')]['id'])});}return _0x5366d7[_0x9ab1('0x59')][_0x9ab1('0x9a')];});}})['then'](respondWithResult(_0x42992a,null))[_0x9ab1('0x1a')](handleError(_0x42992a,null));};exports[_0x9ab1('0x131')]=function(_0x415497,_0x448ec1){return db[_0x9ab1('0x36')]['find']({'where':{'id':_0x415497[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x448ec1,null))[_0x9ab1('0x13')](function(_0x93450c){if(_0x93450c){return _0x93450c[_0x9ab1('0x131')](_0x415497[_0x9ab1('0x3f')][_0x9ab1('0x9a')])['then'](function(){if(_[_0x9ab1('0xa9')](_0x415497[_0x9ab1('0x3f')][_0x9ab1('0x9a')])){for(var _0x3cb686=0x0;_0x3cb686<_0x415497[_0x9ab1('0x3f')]['ids']['length'];_0x3cb686+=0x1){socket[_0x9ab1('0x9d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x415497[_0x9ab1('0x3f')][_0x9ab1('0x9a')][_0x3cb686]),'UserId':Number(_0x415497[_0x9ab1('0x4b')]['id'])});}}else{socket[_0x9ab1('0x9d')](_0x9ab1('0x132'),{'OpenchannelInteractionId':Number(_0x415497[_0x9ab1('0x3f')][_0x9ab1('0x9a')]),'UserId':Number(_0x415497[_0x9ab1('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x448ec1,null))[_0x9ab1('0x1a')](handleError(_0x448ec1,null));};exports[_0x9ab1('0x133')]=function(_0x98a626,_0x55ac01){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x98a626[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x55ac01,null))[_0x9ab1('0x13')](function(_0x6c93cc){if(_0x6c93cc){return _0x6c93cc['addWhatsappInteractions'](_0x98a626['body'][_0x9ab1('0x9a')],_[_0x9ab1('0x5c')](_0x98a626[_0x9ab1('0x59')],['ids','id'])||{})['spread'](function(){for(var _0x5c8fc3=0x0;_0x5c8fc3<_0x98a626[_0x9ab1('0x59')][_0x9ab1('0x9a')][_0x9ab1('0x44')];_0x5c8fc3+=0x1){socket[_0x9ab1('0x9d')]('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0x98a626['body'][_0x9ab1('0x9a')][_0x5c8fc3]),'UserId':Number(_0x98a626[_0x9ab1('0x4b')]['id'])});}return _0x98a626[_0x9ab1('0x59')][_0x9ab1('0x9a')];});}})[_0x9ab1('0x13')](respondWithResult(_0x55ac01,null))[_0x9ab1('0x1a')](handleError(_0x55ac01,null));};exports[_0x9ab1('0x134')]=function(_0x360cc6,_0x124b88){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x360cc6[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x124b88,null))[_0x9ab1('0x13')](function(_0x3ff135){if(_0x3ff135){return _0x3ff135[_0x9ab1('0x134')](_0x360cc6['query'][_0x9ab1('0x9a')]);}})['then'](respondWithStatusCode(_0x124b88,null))[_0x9ab1('0x1a')](handleError(_0x124b88,null));};exports['getVoicePrefixes']=function(_0x21c644,_0x383b97){var _0x4791b0={};var _0x80884a={};var _0x347ec4;var _0x1f6ace;return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x21c644[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x383b97,null))['then'](function(_0x54bbeb){if(_0x54bbeb){_0x347ec4=_0x54bbeb;_0x80884a['model']=_[_0x9ab1('0x4e')](db[_0x9ab1('0x135')]['rawAttributes']);_0x80884a[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x21c644[_0x9ab1('0x3f')]);_0x80884a[_0x9ab1('0x4f')]=_['intersection'](_0x80884a['model'],_0x80884a[_0x9ab1('0x3f')]);_0x4791b0[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x80884a['model'],qs['fields'](_0x21c644['query'][_0x9ab1('0x51')]));_0x4791b0[_0x9ab1('0x41')]=_0x4791b0[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x4791b0[_0x9ab1('0x41')]:_0x80884a['model'];_0x4791b0[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x21c644[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x4791b0[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x21c644['query'],_0x80884a[_0x9ab1('0x4f')]));if(_0x21c644[_0x9ab1('0x3f')]['filter']){_0x4791b0[_0x9ab1('0x3e')]=_['merge'](_0x4791b0['where'],{'$or':_['map'](_0x4791b0[_0x9ab1('0x41')],function(_0xd8e23b){var _0x58a822={};_0x58a822[_0xd8e23b]={'$like':'%'+_0x21c644[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x58a822;})});}_0x4791b0=_[_0x9ab1('0x55')]({},_0x4791b0,_0x21c644['options']);return _0x347ec4[_0x9ab1('0x136')](_0x4791b0);}})[_0x9ab1('0x13')](function(_0x115e8f){if(_0x115e8f){_0x1f6ace=_0x115e8f[_0x9ab1('0x44')];if(!_0x21c644['query'][_0x9ab1('0xc7')](_0x9ab1('0xcf'))){_0x4791b0['limit']=qs[_0x9ab1('0x1f')](_0x21c644[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x4791b0[_0x9ab1('0x1d')]=qs['offset'](_0x21c644[_0x9ab1('0x3f')]['offset']);}return _0x347ec4['getVoicePrefixes'](_0x4791b0);}})[_0x9ab1('0x13')](function(_0x57a378){if(_0x57a378){return _0x57a378?{'count':_0x1f6ace,'rows':_0x57a378}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x383b97,null))[_0x9ab1('0x1a')](handleError(_0x383b97,null));};exports[_0x9ab1('0x137')]=function(_0x71fe01,_0x6c3cc5){var _0x244ed0={};var _0x12eb5e={};var _0x924f5b;var _0x4b320b;return db['User'][_0x9ab1('0xc2')]({'where':{'id':_0x71fe01['params']['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x6c3cc5,null))[_0x9ab1('0x13')](function(_0x5a33e5){if(_0x5a33e5){_0x924f5b=_0x5a33e5;_0x12eb5e[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db[_0x9ab1('0x138')][_0x9ab1('0x37')]);_0x12eb5e['query']=_[_0x9ab1('0x4e')](_0x71fe01['query']);_0x12eb5e['filters']=_[_0x9ab1('0x50')](_0x12eb5e[_0x9ab1('0x4c')],_0x12eb5e[_0x9ab1('0x3f')]);_0x244ed0[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x12eb5e[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x71fe01[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x244ed0['attributes']=_0x244ed0['attributes']['length']?_0x244ed0[_0x9ab1('0x41')]:_0x12eb5e[_0x9ab1('0x4c')];_0x244ed0[_0x9ab1('0xc4')]=qs['sort'](_0x71fe01[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x244ed0[_0x9ab1('0x3e')]=qs['filters'](_[_0x9ab1('0xc6')](_0x71fe01[_0x9ab1('0x3f')],_0x12eb5e[_0x9ab1('0x4f')]));if(_0x71fe01[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x244ed0['where']=_[_0x9ab1('0x55')](_0x244ed0['where'],{'$or':_['map'](_0x244ed0[_0x9ab1('0x41')],function(_0x34a4be){var _0x5d8a5f={};_0x5d8a5f[_0x34a4be]={'$like':'%'+_0x71fe01[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x5d8a5f;})});}_0x244ed0=_[_0x9ab1('0x55')]({},_0x244ed0,_0x71fe01[_0x9ab1('0x56')]);return _0x924f5b[_0x9ab1('0x137')](_0x244ed0);}})[_0x9ab1('0x13')](function(_0x5b9936){if(_0x5b9936){_0x4b320b=_0x5b9936[_0x9ab1('0x44')];if(!_0x71fe01[_0x9ab1('0x3f')][_0x9ab1('0xc7')](_0x9ab1('0xcf'))){_0x244ed0[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x71fe01[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x244ed0[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x71fe01[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}return _0x924f5b['getFaxAccounts'](_0x244ed0);}})[_0x9ab1('0x13')](function(_0xfd10c6){if(_0xfd10c6){return _0xfd10c6?{'count':_0x4b320b,'rows':_0xfd10c6}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x6c3cc5,null))[_0x9ab1('0x1a')](handleError(_0x6c3cc5,null));};exports[_0x9ab1('0x139')]=function(_0x2d3e3f,_0x23a76b){return db[_0x9ab1('0x36')]['find']({'where':{'id':_0x2d3e3f[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x23a76b,null))['then'](function(_0x578b98){if(_0x578b98){return _0x578b98[_0x9ab1('0x139')](_0x2d3e3f[_0x9ab1('0x59')]['ids'],_[_0x9ab1('0x5c')](_0x2d3e3f['body'],[_0x9ab1('0x9a'),'id'])||{});}})['then'](respondWithResult(_0x23a76b,null))[_0x9ab1('0x1a')](handleError(_0x23a76b,null));};exports['removeFaxAccounts']=function(_0xba3aa4,_0x364623){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0xba3aa4['params']['id']}})['then'](handleEntityNotFound(_0x364623,null))[_0x9ab1('0x13')](function(_0xee471d){if(_0xee471d){return _0xee471d[_0x9ab1('0x13a')](_0xba3aa4[_0x9ab1('0x3f')][_0x9ab1('0x9a')]);}})[_0x9ab1('0x13')](respondWithStatusCode(_0x364623,null))[_0x9ab1('0x1a')](handleError(_0x364623,null));};exports[_0x9ab1('0x13b')]=function(_0x43fa79,_0x30564b){var _0x5716ac={};var _0x790b0b={};var _0xa38cdc;var _0xbdafba;return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x43fa79[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x30564b,null))[_0x9ab1('0x13')](function(_0x500422){if(_0x500422){_0xa38cdc=_0x500422;_0x790b0b[_0x9ab1('0x4c')]=_['keys'](db['MailAccount'][_0x9ab1('0x37')]);_0x790b0b[_0x9ab1('0x3f')]=_['keys'](_0x43fa79[_0x9ab1('0x3f')]);_0x790b0b[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x790b0b[_0x9ab1('0x4c')],_0x790b0b[_0x9ab1('0x3f')]);_0x5716ac[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x790b0b[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x43fa79[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x5716ac[_0x9ab1('0x41')]=_0x5716ac['attributes'][_0x9ab1('0x44')]?_0x5716ac['attributes']:_0x790b0b['model'];_0x5716ac[_0x9ab1('0xc4')]=qs['sort'](_0x43fa79[_0x9ab1('0x3f')]['sort']);_0x5716ac['where']=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x43fa79[_0x9ab1('0x3f')],_0x790b0b[_0x9ab1('0x4f')]));if(_0x43fa79[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x5716ac[_0x9ab1('0x3e')]=_['merge'](_0x5716ac[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0x5716ac['attributes'],function(_0x2c3534){var _0x541df3={};_0x541df3[_0x2c3534]={'$like':'%'+_0x43fa79[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x541df3;})});}_0x5716ac=_[_0x9ab1('0x55')]({},_0x5716ac,_0x43fa79[_0x9ab1('0x56')]);return _0xa38cdc[_0x9ab1('0x13b')](_0x5716ac);}})[_0x9ab1('0x13')](function(_0x1650fe){if(_0x1650fe){_0xbdafba=_0x1650fe[_0x9ab1('0x44')];if(!_0x43fa79[_0x9ab1('0x3f')]['hasOwnProperty']('nolimit')){_0x5716ac[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x43fa79[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x5716ac[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x43fa79[_0x9ab1('0x3f')]['offset']);}return _0xa38cdc[_0x9ab1('0x13b')](_0x5716ac);}})['then'](function(_0xe339b1){if(_0xe339b1){return _0xe339b1?{'count':_0xbdafba,'rows':_0xe339b1}:null;}})['then'](respondWithResult(_0x30564b,null))['catch'](handleError(_0x30564b,null));};exports[_0x9ab1('0x13c')]=function(_0x1a716d,_0x4adc70){return db[_0x9ab1('0x36')]['find']({'where':{'id':_0x1a716d[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x4adc70,null))[_0x9ab1('0x13')](function(_0x5d94cb){if(_0x5d94cb){return _0x5d94cb[_0x9ab1('0x13c')](_0x1a716d['body'][_0x9ab1('0x9a')],_[_0x9ab1('0x5c')](_0x1a716d['body'],['ids','id'])||{});}})[_0x9ab1('0x13')](respondWithResult(_0x4adc70,null))[_0x9ab1('0x1a')](handleError(_0x4adc70,null));};exports['removeMailAccounts']=function(_0x3510e1,_0x30859e){return db['User'][_0x9ab1('0x5a')]({'where':{'id':_0x3510e1[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x30859e,null))['then'](function(_0x55b867){if(_0x55b867){return _0x55b867[_0x9ab1('0x13d')](_0x3510e1[_0x9ab1('0x3f')][_0x9ab1('0x9a')]);}})[_0x9ab1('0x13')](respondWithStatusCode(_0x30859e,null))[_0x9ab1('0x1a')](handleError(_0x30859e,null));};exports[_0x9ab1('0x13e')]=function(_0x4a590e,_0x62bdda){var _0x5bf01f={};var _0x4275be={};var _0x521ac7;var _0x341e2f;return db[_0x9ab1('0x36')]['findOne']({'where':{'id':_0x4a590e[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x62bdda,null))[_0x9ab1('0x13')](function(_0x35539c){if(_0x35539c){_0x521ac7=_0x35539c;_0x4275be['model']=_[_0x9ab1('0x4e')](db['OpenchannelAccount'][_0x9ab1('0x37')]);_0x4275be['query']=_[_0x9ab1('0x4e')](_0x4a590e[_0x9ab1('0x3f')]);_0x4275be[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x4275be[_0x9ab1('0x4c')],_0x4275be[_0x9ab1('0x3f')]);_0x5bf01f[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x4275be['model'],qs[_0x9ab1('0x51')](_0x4a590e[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x5bf01f[_0x9ab1('0x41')]=_0x5bf01f[_0x9ab1('0x41')]['length']?_0x5bf01f['attributes']:_0x4275be[_0x9ab1('0x4c')];_0x5bf01f['order']=qs['sort'](_0x4a590e[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x5bf01f[_0x9ab1('0x3e')]=qs['filters'](_['pick'](_0x4a590e[_0x9ab1('0x3f')],_0x4275be[_0x9ab1('0x4f')]));if(_0x4a590e[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x5bf01f[_0x9ab1('0x3e')]=_['merge'](_0x5bf01f[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0x5bf01f[_0x9ab1('0x41')],function(_0x1ce096){var _0x4f907f={};_0x4f907f[_0x1ce096]={'$like':'%'+_0x4a590e[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x4f907f;})});}_0x5bf01f=_[_0x9ab1('0x55')]({},_0x5bf01f,_0x4a590e['options']);return _0x521ac7[_0x9ab1('0x13e')](_0x5bf01f);}})[_0x9ab1('0x13')](function(_0x388cee){if(_0x388cee){_0x341e2f=_0x388cee['length'];if(!_0x4a590e[_0x9ab1('0x3f')][_0x9ab1('0xc7')](_0x9ab1('0xcf'))){_0x5bf01f[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x4a590e['query'][_0x9ab1('0x1f')]);_0x5bf01f[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x4a590e['query'][_0x9ab1('0x1d')]);}return _0x521ac7[_0x9ab1('0x13e')](_0x5bf01f);}})[_0x9ab1('0x13')](function(_0x58b0ca){if(_0x58b0ca){return _0x58b0ca?{'count':_0x341e2f,'rows':_0x58b0ca}:null;}})['then'](respondWithResult(_0x62bdda,null))[_0x9ab1('0x1a')](handleError(_0x62bdda,null));};exports[_0x9ab1('0x13f')]=function(_0x26877b,_0x3e6fe9){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x26877b[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x3e6fe9,null))[_0x9ab1('0x13')](function(_0x24f5dd){if(_0x24f5dd){return _0x24f5dd[_0x9ab1('0x13f')](_0x26877b[_0x9ab1('0x59')]['ids'],_[_0x9ab1('0x5c')](_0x26877b[_0x9ab1('0x59')],[_0x9ab1('0x9a'),'id'])||{});}})['then'](respondWithResult(_0x3e6fe9,null))[_0x9ab1('0x1a')](handleError(_0x3e6fe9,null));};exports[_0x9ab1('0x140')]=function(_0x5668b2,_0x2a0ea4){return db['User'][_0x9ab1('0x5a')]({'where':{'id':_0x5668b2[_0x9ab1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a0ea4,null))[_0x9ab1('0x13')](function(_0x4a11fa){if(_0x4a11fa){return _0x4a11fa[_0x9ab1('0x140')](_0x5668b2[_0x9ab1('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0x2a0ea4,null))['catch'](handleError(_0x2a0ea4,null));};exports[_0x9ab1('0x141')]=function(_0x270b55,_0x24fcec){var _0x2c7e38={};var _0x1d58c0={};var _0x58574d;var _0xfa2175;return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x270b55[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x24fcec,null))['then'](function(_0x434e83){if(_0x434e83){_0x58574d=_0x434e83;_0x1d58c0[_0x9ab1('0x4c')]=_['keys'](db[_0x9ab1('0x142')][_0x9ab1('0x37')]);_0x1d58c0['query']=_[_0x9ab1('0x4e')](_0x270b55[_0x9ab1('0x3f')]);_0x1d58c0['filters']=_[_0x9ab1('0x50')](_0x1d58c0[_0x9ab1('0x4c')],_0x1d58c0[_0x9ab1('0x3f')]);_0x2c7e38[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x1d58c0[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x270b55[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x2c7e38['attributes']=_0x2c7e38[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x2c7e38['attributes']:_0x1d58c0[_0x9ab1('0x4c')];_0x2c7e38[_0x9ab1('0xc4')]=qs['sort'](_0x270b55[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0x2c7e38[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_['pick'](_0x270b55[_0x9ab1('0x3f')],_0x1d58c0[_0x9ab1('0x4f')]));if(_0x270b55['query'][_0x9ab1('0x2d')]){_0x2c7e38[_0x9ab1('0x3e')]=_[_0x9ab1('0x55')](_0x2c7e38['where'],{'$or':_[_0x9ab1('0x38')](_0x2c7e38[_0x9ab1('0x41')],function(_0x1d797b){var _0x787546={};_0x787546[_0x1d797b]={'$like':'%'+_0x270b55[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x787546;})});}_0x2c7e38=_[_0x9ab1('0x55')]({},_0x2c7e38,_0x270b55[_0x9ab1('0x56')]);return _0x58574d['getSmsAccounts'](_0x2c7e38);}})[_0x9ab1('0x13')](function(_0x4fb583){if(_0x4fb583){_0xfa2175=_0x4fb583[_0x9ab1('0x44')];if(!_0x270b55[_0x9ab1('0x3f')][_0x9ab1('0xc7')]('nolimit')){_0x2c7e38[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x270b55[_0x9ab1('0x3f')]['limit']);_0x2c7e38['offset']=qs[_0x9ab1('0x1d')](_0x270b55[_0x9ab1('0x3f')]['offset']);}return _0x58574d['getSmsAccounts'](_0x2c7e38);}})[_0x9ab1('0x13')](function(_0x2c8ee6){if(_0x2c8ee6){return _0x2c8ee6?{'count':_0xfa2175,'rows':_0x2c8ee6}:null;}})['then'](respondWithResult(_0x24fcec,null))[_0x9ab1('0x1a')](handleError(_0x24fcec,null));};exports[_0x9ab1('0x143')]=function(_0x22d7f4,_0x23f426){return db[_0x9ab1('0x36')]['find']({'where':{'id':_0x22d7f4[_0x9ab1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x23f426,null))[_0x9ab1('0x13')](function(_0x2e1303){if(_0x2e1303){return _0x2e1303[_0x9ab1('0x143')](_0x22d7f4[_0x9ab1('0x59')]['ids'],_[_0x9ab1('0x5c')](_0x22d7f4[_0x9ab1('0x59')],['ids','id'])||{});}})['then'](respondWithResult(_0x23f426,null))[_0x9ab1('0x1a')](handleError(_0x23f426,null));};exports[_0x9ab1('0x144')]=function(_0x190dbe,_0x22d949){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x190dbe['params']['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x22d949,null))[_0x9ab1('0x13')](function(_0x5b7f3f){if(_0x5b7f3f){return _0x5b7f3f[_0x9ab1('0x144')](_0x190dbe[_0x9ab1('0x3f')][_0x9ab1('0x9a')]);}})[_0x9ab1('0x13')](respondWithStatusCode(_0x22d949,null))[_0x9ab1('0x1a')](handleError(_0x22d949,null));};exports[_0x9ab1('0x145')]=function(_0x156d3d,_0x43925b){var _0x484943={};var _0x1001b9={};var _0x2cd93b;var _0x4439e8;return db['User']['findOne']({'where':{'id':_0x156d3d[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x43925b,null))[_0x9ab1('0x13')](function(_0x2d433a){if(_0x2d433a){_0x2cd93b=_0x2d433a;_0x1001b9[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db[_0x9ab1('0x146')][_0x9ab1('0x37')]);_0x1001b9['query']=_[_0x9ab1('0x4e')](_0x156d3d[_0x9ab1('0x3f')]);_0x1001b9[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x1001b9[_0x9ab1('0x4c')],_0x1001b9[_0x9ab1('0x3f')]);_0x484943[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x1001b9['model'],qs[_0x9ab1('0x51')](_0x156d3d[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x484943['attributes']=_0x484943[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x484943[_0x9ab1('0x41')]:_0x1001b9[_0x9ab1('0x4c')];_0x484943['order']=qs[_0x9ab1('0xc5')](_0x156d3d[_0x9ab1('0x3f')]['sort']);_0x484943[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_['pick'](_0x156d3d['query'],_0x1001b9[_0x9ab1('0x4f')]));if(_0x156d3d[_0x9ab1('0x3f')][_0x9ab1('0x2d')]){_0x484943[_0x9ab1('0x3e')]=_['merge'](_0x484943['where'],{'$or':_['map'](_0x484943[_0x9ab1('0x41')],function(_0x1a6d5e){var _0x56b5dc={};_0x56b5dc[_0x1a6d5e]={'$like':'%'+_0x156d3d[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x56b5dc;})});}_0x484943=_[_0x9ab1('0x55')]({},_0x484943,_0x156d3d[_0x9ab1('0x56')]);return _0x2cd93b[_0x9ab1('0x145')](_0x484943);}})['then'](function(_0x5a0e76){if(_0x5a0e76){_0x4439e8=_0x5a0e76[_0x9ab1('0x44')];if(!_0x156d3d[_0x9ab1('0x3f')][_0x9ab1('0xc7')]('nolimit')){_0x484943['limit']=qs['limit'](_0x156d3d[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x484943[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x156d3d[_0x9ab1('0x3f')]['offset']);}return _0x2cd93b[_0x9ab1('0x145')](_0x484943);}})[_0x9ab1('0x13')](function(_0x22b2c4){if(_0x22b2c4){return _0x22b2c4?{'count':_0x4439e8,'rows':_0x22b2c4}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x43925b,null))[_0x9ab1('0x1a')](handleError(_0x43925b,null));};exports['addChatWebsites']=function(_0x32a0f7,_0x3c3138){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x32a0f7[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x3c3138,null))['then'](function(_0x4491bc){if(_0x4491bc){return _0x4491bc[_0x9ab1('0x147')](_0x32a0f7[_0x9ab1('0x59')][_0x9ab1('0x9a')],_[_0x9ab1('0x5c')](_0x32a0f7[_0x9ab1('0x59')],[_0x9ab1('0x9a'),'id'])||{});}})[_0x9ab1('0x13')](respondWithResult(_0x3c3138,null))[_0x9ab1('0x1a')](handleError(_0x3c3138,null));};exports[_0x9ab1('0x148')]=function(_0x3a0bfb,_0x1efe5a){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x3a0bfb[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x1efe5a,null))['then'](function(_0x288235){if(_0x288235){return _0x288235['removeChatWebsites'](_0x3a0bfb[_0x9ab1('0x3f')][_0x9ab1('0x9a')]);}})['then'](respondWithStatusCode(_0x1efe5a,null))[_0x9ab1('0x1a')](handleError(_0x1efe5a,null));};exports[_0x9ab1('0x149')]=function(_0x55735d,_0x360950){var _0x257209={};var _0x23ebf1={};var _0x3fbd41;var _0x20671e;return db['User'][_0x9ab1('0xc2')]({'where':{'id':_0x55735d[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x360950,null))[_0x9ab1('0x13')](function(_0x16329d){if(_0x16329d){_0x3fbd41=_0x16329d;_0x23ebf1[_0x9ab1('0x4c')]=_[_0x9ab1('0x4e')](db[_0x9ab1('0x14a')][_0x9ab1('0x37')]);_0x23ebf1[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x55735d[_0x9ab1('0x3f')]);_0x23ebf1[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x23ebf1[_0x9ab1('0x4c')],_0x23ebf1[_0x9ab1('0x3f')]);_0x257209[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x23ebf1[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x55735d[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x257209['attributes']=_0x257209[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0x257209[_0x9ab1('0x41')]:_0x23ebf1[_0x9ab1('0x4c')];_0x257209['order']=qs['sort'](_0x55735d[_0x9ab1('0x3f')]['sort']);_0x257209[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x55735d['query'],_0x23ebf1[_0x9ab1('0x4f')]));if(_0x55735d[_0x9ab1('0x3f')]['filter']){_0x257209[_0x9ab1('0x3e')]=_[_0x9ab1('0x55')](_0x257209[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0x257209['attributes'],function(_0x10a1c9){var _0x475da5={};_0x475da5[_0x10a1c9]={'$like':'%'+_0x55735d['query'][_0x9ab1('0x2d')]+'%'};return _0x475da5;})});}_0x257209=_[_0x9ab1('0x55')]({},_0x257209,_0x55735d['options']);return _0x3fbd41[_0x9ab1('0x149')](_0x257209);}})[_0x9ab1('0x13')](function(_0xa51c8){if(_0xa51c8){_0x20671e=_0xa51c8['length'];if(!_0x55735d[_0x9ab1('0x3f')]['hasOwnProperty']('nolimit')){_0x257209[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x55735d[_0x9ab1('0x3f')][_0x9ab1('0x1f')]);_0x257209['offset']=qs['offset'](_0x55735d[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}return _0x3fbd41['getWhatsappAccounts'](_0x257209);}})[_0x9ab1('0x13')](function(_0x78ef20){if(_0x78ef20){return _0x78ef20?{'count':_0x20671e,'rows':_0x78ef20}:null;}})[_0x9ab1('0x13')](respondWithResult(_0x360950,null))['catch'](handleError(_0x360950,null));};exports[_0x9ab1('0x14b')]=function(_0x171546,_0xeb1ca6){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x171546[_0x9ab1('0x4b')]['id']}})['then'](handleEntityNotFound(_0xeb1ca6,null))[_0x9ab1('0x13')](function(_0x3dd6d8){if(_0x3dd6d8){return _0x3dd6d8['addWhatsappAccounts'](_0x171546[_0x9ab1('0x59')][_0x9ab1('0x9a')],_[_0x9ab1('0x5c')](_0x171546[_0x9ab1('0x59')],[_0x9ab1('0x9a'),'id'])||{});}})['then'](respondWithResult(_0xeb1ca6,null))[_0x9ab1('0x1a')](handleError(_0xeb1ca6,null));};exports[_0x9ab1('0x14c')]=function(_0x12357d,_0x56f8c0){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x12357d[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x56f8c0,null))[_0x9ab1('0x13')](function(_0x39c9c1){if(_0x39c9c1){return _0x39c9c1[_0x9ab1('0x14c')](_0x12357d['query'][_0x9ab1('0x9a')]);}})[_0x9ab1('0x13')](respondWithStatusCode(_0x56f8c0,null))[_0x9ab1('0x1a')](handleError(_0x56f8c0,null));};exports['getSquareProjects']=function(_0x560a89,_0x5b1cc0){var _0xc9b3ca={};var _0x5e8da7={};var _0x9e8a42;var _0x3acfc6;return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x560a89['params']['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x5b1cc0,null))['then'](function(_0x52e858){if(_0x52e858){_0x9e8a42=_0x52e858;_0x5e8da7['model']=_[_0x9ab1('0x4e')](db[_0x9ab1('0x14d')][_0x9ab1('0x37')]);_0x5e8da7[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x560a89['query']);_0x5e8da7[_0x9ab1('0x4f')]=_[_0x9ab1('0x50')](_0x5e8da7[_0x9ab1('0x4c')],_0x5e8da7[_0x9ab1('0x3f')]);_0xc9b3ca['attributes']=_[_0x9ab1('0x50')](_0x5e8da7[_0x9ab1('0x4c')],qs[_0x9ab1('0x51')](_0x560a89[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0xc9b3ca[_0x9ab1('0x41')]=_0xc9b3ca[_0x9ab1('0x41')][_0x9ab1('0x44')]?_0xc9b3ca[_0x9ab1('0x41')]:_0x5e8da7[_0x9ab1('0x4c')];_0xc9b3ca[_0x9ab1('0xc4')]=qs[_0x9ab1('0xc5')](_0x560a89[_0x9ab1('0x3f')][_0x9ab1('0xc5')]);_0xc9b3ca[_0x9ab1('0x3e')]=qs['filters'](_['pick'](_0x560a89[_0x9ab1('0x3f')],_0x5e8da7['filters']));if(_0x560a89[_0x9ab1('0x3f')]['filter']){_0xc9b3ca['where']=_[_0x9ab1('0x55')](_0xc9b3ca[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0xc9b3ca[_0x9ab1('0x41')],function(_0x147b65){var _0x2f4ff0={};_0x2f4ff0[_0x147b65]={'$like':'%'+_0x560a89[_0x9ab1('0x3f')][_0x9ab1('0x2d')]+'%'};return _0x2f4ff0;})});}_0xc9b3ca=_[_0x9ab1('0x55')]({},_0xc9b3ca,_0x560a89['options']);return _0x9e8a42['getSquareProjects'](_0xc9b3ca);}})[_0x9ab1('0x13')](function(_0x18cdfc){if(_0x18cdfc){_0x3acfc6=_0x18cdfc[_0x9ab1('0x44')];if(!_0x560a89[_0x9ab1('0x3f')]['hasOwnProperty'](_0x9ab1('0xcf'))){_0xc9b3ca['limit']=qs[_0x9ab1('0x1f')](_0x560a89[_0x9ab1('0x3f')]['limit']);_0xc9b3ca[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x560a89[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}return _0x9e8a42[_0x9ab1('0x14e')](_0xc9b3ca);}})['then'](function(_0x38429c){if(_0x38429c){return _0x38429c?{'count':_0x3acfc6,'rows':_0x38429c}:null;}})['then'](respondWithResult(_0x5b1cc0,null))[_0x9ab1('0x1a')](handleError(_0x5b1cc0,null));};exports[_0x9ab1('0x14f')]=function(_0x2a55a1,_0x28a625){return db['User'][_0x9ab1('0x5a')]({'where':{'id':_0x2a55a1[_0x9ab1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x28a625,null))[_0x9ab1('0x13')](function(_0x31c22b){if(_0x31c22b){return _0x31c22b[_0x9ab1('0x14f')](_0x2a55a1[_0x9ab1('0x59')]['ids'],_[_0x9ab1('0x5c')](_0x2a55a1[_0x9ab1('0x59')],['ids','id'])||{});}})['then'](respondWithResult(_0x28a625,null))[_0x9ab1('0x1a')](handleError(_0x28a625,null));};exports['removeSquareProjects']=function(_0x41a4d3,_0x5ef87c){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x41a4d3[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x5ef87c,null))[_0x9ab1('0x13')](function(_0x517bd0){if(_0x517bd0){return _0x517bd0[_0x9ab1('0x150')](_0x41a4d3[_0x9ab1('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0x5ef87c,null))[_0x9ab1('0x1a')](handleError(_0x5ef87c,null));};exports['getScheduledCalls']=function(_0x530e19,_0x297a8e){var _0x2792b2={},_0x33e17a={},_0x331d6e={'count':0x0,'rows':[]};var _0x54862d=db['CmHopper']['rawAttributes'];_0x33e17a[_0x9ab1('0x4c')]=_['keys'](_0x54862d);_0x33e17a[_0x9ab1('0x3f')]=_[_0x9ab1('0x4e')](_0x530e19[_0x9ab1('0x3f')]);_0x33e17a['filters']=_[_0x9ab1('0x50')](_0x33e17a[_0x9ab1('0x4c')],_0x33e17a['query']);_0x33e17a[_0x9ab1('0x4f')]=_['concat'](_0x33e17a[_0x9ab1('0x4f')],[_0x9ab1('0x151'),_0x9ab1('0x152'),'$gt','$gte','$lt',_0x9ab1('0x153'),_0x9ab1('0x154'),'$eq',_0x9ab1('0x155'),'$between',_0x9ab1('0x156'),_0x9ab1('0x157'),_0x9ab1('0x158'),_0x9ab1('0x159'),_0x9ab1('0x15a'),_0x9ab1('0x15b'),_0x9ab1('0x15c'),_0x9ab1('0x159'),_0x9ab1('0x15d'),'$contains','$contained',_0x9ab1('0x15e')]);_0x2792b2[_0x9ab1('0x41')]=_[_0x9ab1('0x50')](_0x33e17a['model'],qs['fields'](_0x530e19[_0x9ab1('0x3f')][_0x9ab1('0x51')]));_0x2792b2['attributes']=_0x2792b2['attributes'][_0x9ab1('0x44')]?_0x2792b2[_0x9ab1('0x41')]:_0x33e17a[_0x9ab1('0x4c')];if(!_0x530e19[_0x9ab1('0x3f')][_0x9ab1('0xc7')]('nolimit')){_0x2792b2[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x530e19[_0x9ab1('0x3f')]['limit']);_0x2792b2[_0x9ab1('0x1d')]=qs[_0x9ab1('0x1d')](_0x530e19[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}_0x2792b2['order']=qs[_0x9ab1('0xc5')](_0x530e19['query']['sort']);_0x2792b2[_0x9ab1('0x3e')]=qs[_0x9ab1('0x4f')](_[_0x9ab1('0xc6')](_0x530e19[_0x9ab1('0x3f')],_0x33e17a['filters']));if(_0x530e19['query'][_0x9ab1('0x2d')]){_0x2792b2['where']=_['merge'](_0x2792b2[_0x9ab1('0x3e')],{'$or':_[_0x9ab1('0x38')](_0x2792b2['attributes'],function(_0x2ca9fb){var _0xc3a128={};_0xc3a128[_0x2ca9fb]={'$like':'%'+_0x530e19['query']['filter']+'%'};return _0xc3a128;})});}_0x2792b2['where']={'$and':[_0x2792b2[_0x9ab1('0x3e')],{'$or':[{'UserId':_0x530e19[_0x9ab1('0x4b')]['id']},{'OwnerId':_0x530e19[_0x9ab1('0x4b')]['id']}]}]};_0x2792b2=_[_0x9ab1('0x55')]({},_0x2792b2,_0x530e19[_0x9ab1('0x56')]);var _0x5debe9={'where':_0x2792b2[_0x9ab1('0x3e')]};return db[_0x9ab1('0x15f')][_0x9ab1('0x20')](_0x5debe9)[_0x9ab1('0x13')](function(_0x85557a){_0x331d6e['count']=_0x85557a;if(_0x530e19[_0x9ab1('0x3f')][_0x9ab1('0x40')]){_0x2792b2['include']=[{'attributes':['id','firstName',_0x9ab1('0x160'),_0x9ab1('0x161')],'model':db[_0x9ab1('0xc3')],'as':_0x9ab1('0x162')},{'attributes':['id','name',_0x9ab1('0x163')],'model':db['VoiceQueue'],'as':'Queue'}];}return db[_0x9ab1('0x15f')][_0x9ab1('0x83')](_0x2792b2);})[_0x9ab1('0x13')](function(_0x4358ab){_0x331d6e[_0x9ab1('0x43')]=_0x4358ab;return _0x331d6e;})[_0x9ab1('0x13')](respondWithFilteredResult(_0x297a8e,_0x2792b2))['catch'](handleError(_0x297a8e,null));};exports[_0x9ab1('0x164')]=function(_0x37d740,_0xf23c9c){if(!_[_0x9ab1('0x62')](_0x37d740['user']['id'])&&(_0x37d740['user'][_0x9ab1('0x27')]=='admin'||_0x37d740[_0x9ab1('0x2a')][_0x9ab1('0x27')]==_0x9ab1('0x2a'))){return db[_0x9ab1('0x36')][_0x9ab1('0xc2')]({'where':{'id':_0x37d740[_0x9ab1('0x4b')]['id']},'raw':!![]})[_0x9ab1('0x13')](function(_0x1a6665){return authService[_0x9ab1('0x165')](_0x1a6665);})[_0x9ab1('0x13')](function(_0x4e1f99){if(_0x4e1f99){return _0xf23c9c[_0x9ab1('0x1b')](0xc8)[_0x9ab1('0x23')]({'api_key':_0x4e1f99[_0x9ab1('0x166')]});}else{return _0xf23c9c['status'](0xcc)[_0x9ab1('0x23')]({'message':'No\x20API\x20access\x20key\x20found!'});}})[_0x9ab1('0x1a')](handleError(_0xf23c9c,0x193));}else{return _0xf23c9c[_0x9ab1('0x1b')](0x191)['json']({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x9ab1('0x167')]=function(_0x39b711,_0xe03744){if(!_[_0x9ab1('0x62')](_0x39b711[_0x9ab1('0x2a')]['id'])&&(_0x39b711['user'][_0x9ab1('0x27')]==_0x9ab1('0x28')||_0x39b711['user']['role']=='user')){return db['User']['find']({'where':{'id':_0x39b711[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](function(_0x39d965){return authService[_0x9ab1('0x168')](_0x39d965);})[_0x9ab1('0x13')](function(_0x2e69a5){return db[_0x9ab1('0x36')][_0x9ab1('0x24')]({'apiKeyIat':_0x2e69a5['iat'],'apiKeyNonce':_0x2e69a5[_0x9ab1('0x169')]},{'where':{'id':_0x39b711[_0x9ab1('0x4b')]['id']}})['then'](function(){return _0xe03744['status'](0xc8)[_0x9ab1('0x23')]({'api_key':_0x2e69a5[_0x9ab1('0x166')]});});})['catch'](handleError(_0xe03744,0x193));}else{return _0xe03744[_0x9ab1('0x1b')](0x191)[_0x9ab1('0x23')]({'message':_0x9ab1('0x16a')});}};exports['removeApiKey']=function(_0x334b0e,_0x57870f){if(!_[_0x9ab1('0x62')](_0x334b0e[_0x9ab1('0x2a')]['id'])&&(_0x334b0e[_0x9ab1('0x2a')][_0x9ab1('0x27')]==_0x9ab1('0x28')||_0x334b0e[_0x9ab1('0x2a')][_0x9ab1('0x27')]=='user')){return db[_0x9ab1('0x36')][_0x9ab1('0x5a')]({'where':{'id':_0x334b0e[_0x9ab1('0x4b')]['id']}})[_0x9ab1('0x13')](handleEntityNotFound(_0x57870f,null))[_0x9ab1('0x13')](function(_0x3ae6d4){if(_0x3ae6d4&&_0x3ae6d4[_0x9ab1('0x16b')]&&_0x3ae6d4[_0x9ab1('0x16c')])return _0x3ae6d4;else throw{'message':_0x9ab1('0x16d')};})[_0x9ab1('0x13')](function(){return db[_0x9ab1('0x36')][_0x9ab1('0x24')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x334b0e[_0x9ab1('0x4b')]['id']}});})['then'](respondWithStatusCode(_0x57870f,0xc8))[_0x9ab1('0x1a')](handleError(_0x57870f,0x193));}else{return _0x57870f[_0x9ab1('0x1b')](0x191)[_0x9ab1('0x23')]({'message':_0x9ab1('0x16a')});}};exports['whoami']=function(_0x4594ff,_0x3e7aa2){var _0x5c538c=_0x4594ff[_0x9ab1('0x2a')][_0x9ab1('0x26')]({'plain':!![]});if(!_0x5c538c){return _0x3e7aa2[_0x9ab1('0x1b')](0x191)['send'](_0x9ab1('0x16e'));}else{Promise['resolve']()['then'](function(){if(_0x4594ff[_0x9ab1('0x3f')][_0x9ab1('0x53')]!=='true')return;return _0x4594ff[_0x9ab1('0x2a')][_0x9ab1('0x16f')]();})[_0x9ab1('0x13')](function(_0x16247c){if(!_0x16247c)return;return _0x16247c[_0x9ab1('0x26')]({'plain':!![]});})['then'](function(_0xf42d24){_0x5c538c['userSetting']=_0xf42d24;return _0x3e7aa2[_0x9ab1('0x1b')](0xc8)['json'](_0x5c538c);});}};exports[_0x9ab1('0x170')]=function(_0x4b9f04,_0x569e9e){var _0x3b0e7b={'offset':0x0},_0x4684ce={'count':0x0,'rows':[]};Promise[_0x9ab1('0x171')]()['then'](function(){if(!_0x4b9f04[_0x9ab1('0x3f')][_0x9ab1('0x2d')]&&!_0x4b9f04['query']['teams']&&!_0x4b9f04['query'][_0x9ab1('0x172')])return[];return Promise[_0x9ab1('0x171')]()['then'](function(){var _0x993522=[];if(!_[_0x9ab1('0x84')](_0x4b9f04[_0x9ab1('0x3f')][_0x9ab1('0x173')])){_0x993522[_0x9ab1('0x42')](db[_0x9ab1('0x106')][_0x9ab1('0x83')]({'attributes':['id',_0x9ab1('0x31')],'where':{'id':_0x4b9f04[_0x9ab1('0x3f')]['teams']}}));}if(!_[_0x9ab1('0x84')](_0x4b9f04[_0x9ab1('0x3f')]['queues'])){_0x993522[_0x9ab1('0x42')](db[_0x9ab1('0xa0')][_0x9ab1('0x83')]({'attributes':['id','name'],'type':_0x9ab1('0x174'),'where':{'id':_0x4b9f04['query']['queues']}}));}return Promise['all'](_0x993522);})[_0x9ab1('0x13')](function(_0xf9f9fb){var _0x561c31=_[_0x9ab1('0x110')](_0xf9f9fb)['map'](function(_0x1b3de1){return _0x1b3de1[_0x9ab1('0x11d')]({'attributes':['id',_0x9ab1('0x31'),'internal',_0x9ab1('0x94')],'raw':!![]});});return Promise[_0x9ab1('0x58')](_0x561c31);})[_0x9ab1('0x13')](function(_0x3db583){var _0x488ba=_[_0x9ab1('0x110')](_0x3db583);if(!_0x4b9f04['query'][_0x9ab1('0x2d')])return _0x488ba;if(_[_0x9ab1('0x84')](_0x488ba)){return db[_0x9ab1('0x36')][_0x9ab1('0x83')]({'attributes':['id','name',_0x9ab1('0x61'),'online'],'where':{'role':'agent','$or':[db[_0x9ab1('0x64')][_0x9ab1('0x3e')](db[_0x9ab1('0x64')]['fn'](_0x9ab1('0x175'),db[_0x9ab1('0x64')]['col']('name')),{'$like':'%'+_0x4b9f04[_0x9ab1('0x3f')]['filter'][_0x9ab1('0x98')]()+'%'}),{'internal':{'$like':'%'+_0x4b9f04[_0x9ab1('0x3f')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x488ba)[_0x9ab1('0x110')]()['filter'](function(_0x248c1c){return _0x248c1c['name']['toLowerCase']()[_0x9ab1('0x30')](_0x4b9f04['query'][_0x9ab1('0x2d')]['toLowerCase']())||_0x248c1c[_0x9ab1('0x61')][_0x9ab1('0x176')]()[_0x9ab1('0x30')](_0x4b9f04[_0x9ab1('0x3f')][_0x9ab1('0x2d')]);})[_0x9ab1('0x2f')]();}})[_0x9ab1('0x13')](function(_0x2e8858){var _0x56cdcf='name';var _0x26b619=_0x9ab1('0x177');if(_0x4b9f04[_0x9ab1('0x3f')][_0x9ab1('0xc5')]){_0x26b619=_0x4b9f04[_0x9ab1('0x3f')][_0x9ab1('0xc5')][0x0]==='-'?_0x9ab1('0x178'):_0x9ab1('0x177');_0x56cdcf=_0x26b619===_0x9ab1('0x177')?_0x4b9f04[_0x9ab1('0x3f')][_0x9ab1('0xc5')]:_0x4b9f04[_0x9ab1('0x3f')]['sort'][_0x9ab1('0x179')](0x1);}return _(_0x2e8858)[_0x9ab1('0x17a')]('id')[_0x9ab1('0x17b')]([function(_0x1add08){return _0x56cdcf===_0x9ab1('0x31')?_0x1add08[_0x56cdcf][_0x9ab1('0x98')]():_0x1add08[_0x56cdcf];}],[_0x26b619])['map'](function(_0x102769){return _[_0x9ab1('0xc6')](_0x102769,['id',_0x9ab1('0x31'),_0x9ab1('0x61'),_0x9ab1('0x94')]);})[_0x9ab1('0x2f')]();})[_0x9ab1('0x13')](function(_0x37df30){return client[_0x9ab1('0x17c')](_0x9ab1('0x2b'),_0x4b9f04)['then'](function(_0x1f2f71){if(_0x1f2f71[_0x9ab1('0x17')])throw new Error(_0x9ab1('0x17d'));var _0x300757=_0x1f2f71[_0x9ab1('0x17e')];var _0x3b9dd9=jayson[_0x9ab1('0x11')]['http']({'port':0x232c});return _0x3b9dd9['request']('Agents',_0x4b9f04)['then'](function(_0x1e5cd4){if(_0x1e5cd4[_0x9ab1('0x17')])throw new Error(_0x9ab1('0x17f'));var _0xa415d1=_0x1e5cd4['result'];return _[_0x9ab1('0x55')]({},_0xa415d1,_0x300757);});})[_0x9ab1('0x13')](function(_0xa4dd95){return _[_0x9ab1('0x38')](_0x37df30,function(_0x53f7e8){var _0x267127=_[_0x9ab1('0x5a')](_0xa4dd95[_0x9ab1('0x43')],['id',_0x53f7e8['id']]);if(!_0x267127||!_0x53f7e8['online']){_0x53f7e8[_0x9ab1('0x1b')]=_0x9ab1('0x180');}else if(_0x267127[_0x9ab1('0x95')]){_0x53f7e8['status']=_0x9ab1('0xf9');}else{_0x53f7e8[_0x9ab1('0x1b')]=_['includes']([_0x9ab1('0x181'),_0x9ab1('0x182'),_0x9ab1('0x183'),_0x9ab1('0x184'),null,undefined],_0x267127['voiceStatus'])?_0x9ab1('0x94'):_0x9ab1('0x185');}return _0x53f7e8;});});});})['then'](function(_0x5bb6dc){if(!_0x4b9f04[_0x9ab1('0x3f')]['hasOwnProperty'](_0x9ab1('0xcf'))){_0x3b0e7b[_0x9ab1('0x1f')]=qs[_0x9ab1('0x1f')](_0x4b9f04[_0x9ab1('0x3f')][_0x9ab1('0x1f')]||0xa);_0x3b0e7b['offset']=qs['offset'](_0x4b9f04[_0x9ab1('0x3f')][_0x9ab1('0x1d')]);}_0x4684ce[_0x9ab1('0x20')]=_0x5bb6dc[_0x9ab1('0x44')];_0x4684ce[_0x9ab1('0x43')]=_0x3b0e7b[_0x9ab1('0x1f')]?_0x5bb6dc[_0x9ab1('0x186')](_0x3b0e7b['offset'],_0x3b0e7b['offset']+_0x3b0e7b[_0x9ab1('0x1f')]):_0x5bb6dc;return _0x4684ce;})['then'](respondWithFilteredResult(_0x569e9e,_0x3b0e7b))[_0x9ab1('0x1a')](handleError(_0x569e9e,null));};function get_open_tabs(_0x4c8760,_0x7612d6){var _0x357c54=_0x4c8760[_0x9ab1('0x187')](0x0)[_0x9ab1('0x188')]()+_0x4c8760['slice'](0x1);var _0x1b55e8={'type':db[_0x9ab1('0x88')]['QueryTypes'][_0x9ab1('0x189')],'raw':!![]};return new BPromise(function(_0x8f010c,_0x1d9f36){var _0x3298e7=squel[_0x9ab1('0x18a')]()[_0x9ab1('0x18b')](_0x9ab1('0x18c')+_0x357c54+_0x9ab1('0x18d'),'id')[_0x9ab1('0x18b')]('ui.createdAt')[_0x9ab1('0x66')](_0x9ab1('0x18e')+_0x4c8760+_0x9ab1('0x18f'),'ui')[_0x9ab1('0x3e')](_0x9ab1('0x190'),_0x7612d6['id']);return db[_0x9ab1('0x64')][_0x9ab1('0x3f')](_0x3298e7[_0x9ab1('0x176')](),_0x1b55e8)[_0x9ab1('0x13')](function(_0x43fa50){_0x7612d6[_0x357c54+'OpenTabs']=_0x43fa50;_0x8f010c(_0x43fa50);})['catch'](function(_0x3ac9d6){_0x1d9f36(_0x3ac9d6);});});}
\ No newline at end of file
+var _0x8169=['connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','bulkCreate','isMiddleware','resolve','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','getChatQueues','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$notIn','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','Contact','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','teams','queues','inbound','lower','col','toString','asc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','pause','idle','unknown','unavailable','voiceStatus','busy','slice','charAt','toUpperCase','ui.','InteractionId','field','ui.createdAt','OpenTabs','moment','bluebird','util','path','lodash','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../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','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','role','admin','Users','user','agent','ignore','map','value','find','name','UserProfileResource','send','rawAttributes','type','includes','password','salt','getOptions','where','includeAll','include','query','true','userSetting','attributes','push','User','findAll','rows','openTabs','length','chat','sms','dataValues','fax','mail','openchannel','whatsapp','show','params','model','differenceBy','keys','filters','intersection','fields','UserSetting','options','all','body','describe','addContacts','omit','ids','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','voicemail','mailbox','fullname','email','permissions','102','103','113','110','104','107','108','109','100','111','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Telephones','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','telephone','isEmpty','Agents','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','online','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','voice','VoiceQueue','format','voicePause','UserVoiceQueueRt','upsert','removeQueues','channel','remove','isArray','emit','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','download','root','server/files/images/','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WHATSAPP','concat','getContacts','findOne','CmContact','order','sort','pick','filter','merge','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','loginInPause','SIP/%s','intrf','user:%s','user:forcelogout','headers'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x8169,0xa2));var _0x9816=function(_0x40aa8f,_0x564c24){_0x40aa8f=_0x40aa8f-0x0;var _0x128b23=_0x8169[_0x40aa8f];return _0x128b23;};'use strict';var moment=require(_0x9816('0x0'));var BPromise=require(_0x9816('0x1'));var util=require(_0x9816('0x2'));var path=require(_0x9816('0x3'));var fs=require('fs');var _=require(_0x9816('0x4'));var squel=require('squel');var jayson=require(_0x9816('0x5'));var Redis=require(_0x9816('0x6'));var authService=require(_0x9816('0x7'));var qs=require(_0x9816('0x8'));var logger=require(_0x9816('0x9'))(_0x9816('0xa'));var utils=require(_0x9816('0xb'));var config=require(_0x9816('0xc'));var licenseUtil=require(_0x9816('0xd'));var db=require(_0x9816('0xe'))['db'];var socket=require(_0x9816('0xf'))(new Redis(config[_0x9816('0x10')]));require(_0x9816('0x11'))[_0x9816('0x12')](socket);config[_0x9816('0x10')]=_[_0x9816('0x13')](config[_0x9816('0x10')],{'host':_0x9816('0x14'),'port':0x18eb});var client=jayson[_0x9816('0x15')][_0x9816('0x16')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5b68d2,_0x25bf5b,_0x14f18a,_0x4c6c93){return new BPromise(function(_0x374075,_0x31758a){var _0x469c11=_0x4c6c93||client;return _0x469c11[_0x9816('0x17')](_0x5b68d2,_0x14f18a)[_0x9816('0x18')](function(_0x3947cd){logger[_0x9816('0x19')](_0x9816('0x1a'),_0x25bf5b,_0x9816('0x1b'));logger['debug'](_0x9816('0x1c'),_0x25bf5b,_0x9816('0x1b'),JSON[_0x9816('0x1d')](_0x3947cd));if(_0x3947cd[_0x9816('0x1e')]){if(_0x3947cd[_0x9816('0x1e')][_0x9816('0x1f')]===0x1f4){logger[_0x9816('0x1e')]('User,\x20%s,\x20%s',_0x25bf5b,_0x3947cd[_0x9816('0x1e')]['message']);return _0x31758a(_0x3947cd[_0x9816('0x1e')][_0x9816('0x20')]);}logger[_0x9816('0x1e')]('User,\x20%s,\x20%s',_0x25bf5b,_0x3947cd[_0x9816('0x1e')]['message']);return _0x374075(_0x3947cd[_0x9816('0x1e')][_0x9816('0x20')]);}else{logger[_0x9816('0x19')](_0x9816('0x1a'),_0x25bf5b,_0x9816('0x1b'));_0x374075(_0x3947cd[_0x9816('0x21')][_0x9816('0x20')]);}})[_0x9816('0x22')](function(_0x4642ae){logger[_0x9816('0x1e')](_0x9816('0x1a'),_0x25bf5b,_0x4642ae);_0x31758a(_0x4642ae);});});}function respondWithStatusCode(_0x1ed51f,_0x283846){_0x283846=_0x283846||0xcc;return function(_0x1eb92f){if(_0x1eb92f){return _0x1ed51f[_0x9816('0x23')](_0x283846);}return _0x1ed51f[_0x9816('0x24')](_0x283846)[_0x9816('0x25')]();};}function respondWithResult(_0x5bf550,_0x5c1654){_0x5c1654=_0x5c1654||0xc8;return function(_0x5af51c){if(_0x5af51c){return _0x5bf550[_0x9816('0x24')](_0x5c1654)[_0x9816('0x26')](_0x5af51c);}};}function respondWithFilteredResult(_0x2f0bdc,_0x3732ca){return function(_0x5c9578){if(_0x5c9578){var _0x251115=typeof _0x3732ca[_0x9816('0x27')]===_0x9816('0x28')&&typeof _0x3732ca[_0x9816('0x29')]===_0x9816('0x28');var _0xf2f7ac=_0x5c9578[_0x9816('0x2a')];var _0x3d102a=_0x251115?0x0:_0x3732ca['offset'];var _0x5c315c=_0x251115?_0x5c9578[_0x9816('0x2a')]:_0x3732ca[_0x9816('0x27')]+_0x3732ca['limit'];var _0x312b1c;if(_0x5c315c>=_0xf2f7ac){_0x5c315c=_0xf2f7ac;_0x312b1c=0xc8;}else{_0x312b1c=0xce;}_0x2f0bdc['status'](_0x312b1c);return _0x2f0bdc[_0x9816('0x2b')](_0x9816('0x2c'),_0x3d102a+'-'+_0x5c315c+'/'+_0xf2f7ac)['json'](_0x5c9578);}return null;};}function saveUpdates(_0x37464d){return function(_0x3ebcc9){if(_0x3ebcc9){return _0x3ebcc9[_0x9816('0x2d')](_0x37464d)[_0x9816('0x18')](function(_0x5af109){return _0x5af109;});}return null;};}function removeEntity(_0x178952){return function(_0x4095d3){if(_0x4095d3){return _0x4095d3[_0x9816('0x2e')]()[_0x9816('0x18')](function(){var _0x4036c5=_0x4095d3[_0x9816('0x2f')]({'plain':!![]});if(_0x4036c5[_0x9816('0x30')]===_0x9816('0x31'))return;var _0x15e1d1=[{'name':_0x9816('0x32'),'value':_0x9816('0x33'),'ignore':!![]},{'name':'Agents','value':_0x9816('0x34'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x1b19dc=_(_0x15e1d1)['filter'](_0x9816('0x35'))[_0x9816('0x36')]('value')[_0x9816('0x37')]();if(_['includes'](_0x1b19dc,_0x4036c5[_0x9816('0x30')])){return;}var _0x45f0b8=_[_0x9816('0x38')](_0x15e1d1,[_0x9816('0x37'),_0x4036c5[_0x9816('0x30')]])[_0x9816('0x39')];return db[_0x9816('0x3a')][_0x9816('0x2e')]({'where':{'type':_0x45f0b8,'resourceId':_0x4036c5['id']}})[_0x9816('0x18')](function(){return _0x4095d3;});})[_0x9816('0x18')](function(){_0x178952[_0x9816('0x24')](0xcc)[_0x9816('0x25')]();});}};}function handleEntityNotFound(_0x2fce61){return function(_0x5b8662){if(!_0x5b8662){_0x2fce61[_0x9816('0x23')](0x194);}return _0x5b8662;};}function handleError(_0x19324c,_0x1842c1){_0x1842c1=_0x1842c1||0x1f4;return function(_0xf495bf){logger[_0x9816('0x1e')](_0xf495bf['stack']);if(_0xf495bf[_0x9816('0x39')]){delete _0xf495bf['name'];}_0x19324c['status'](_0x1842c1)[_0x9816('0x3b')](_0xf495bf);};}exports['index']=function(_0x433def,_0x628bcf){var _0x18cd5f={},_0x58e4f3={'count':0x0,'rows':[]};var _0x55df64=_(db['User'][_0x9816('0x3c')])[_0x9816('0x36')](function(_0x4fece3){return{'name':_0x4fece3['fieldName'],'type':_0x4fece3[_0x9816('0x3d')]['key']};})['filter'](function(_0x4b8dcd){return!_[_0x9816('0x3e')]([_0x9816('0x3f'),_0x9816('0x40')],_0x4b8dcd['name']);})[_0x9816('0x37')]();_0x18cd5f=qs[_0x9816('0x41')](_0x55df64,_0x433def);var _0x5a93e0={'where':_0x18cd5f[_0x9816('0x42')]};return db['User'][_0x9816('0x2a')](_0x5a93e0)[_0x9816('0x18')](function(_0x2cbb6c){_0x58e4f3[_0x9816('0x2a')]=_0x2cbb6c;if(_0x433def['query'][_0x9816('0x43')]){_0x18cd5f[_0x9816('0x44')]=[{'all':!![]}];}if(_0x433def[_0x9816('0x45')]['userSetting']===_0x9816('0x46')){_0x18cd5f[_0x9816('0x44')]=[{'model':db['UserSetting'],'as':_0x9816('0x47')}];}if(!_[_0x9816('0x3e')](_0x18cd5f[_0x9816('0x48')],'id')){_0x18cd5f[_0x9816('0x48')][_0x9816('0x49')]('id');}return db[_0x9816('0x4a')][_0x9816('0x4b')](_0x18cd5f);})[_0x9816('0x18')](function(_0x1bb981){_0x58e4f3[_0x9816('0x4c')]=_0x1bb981;if(_0x433def['query'][_0x9816('0x4d')]===_0x9816('0x46')){var _0x101124=[];for(var _0x5964e1=0x0;_0x5964e1<_0x58e4f3[_0x9816('0x4c')][_0x9816('0x4e')];_0x5964e1++){_0x101124[_0x9816('0x49')](get_open_tabs(_0x9816('0x4f'),_0x58e4f3['rows'][_0x5964e1]['dataValues']));_0x101124[_0x9816('0x49')](get_open_tabs(_0x9816('0x50'),_0x58e4f3['rows'][_0x5964e1][_0x9816('0x51')]));_0x101124[_0x9816('0x49')](get_open_tabs(_0x9816('0x52'),_0x58e4f3[_0x9816('0x4c')][_0x5964e1][_0x9816('0x51')]));_0x101124[_0x9816('0x49')](get_open_tabs(_0x9816('0x53'),_0x58e4f3[_0x9816('0x4c')][_0x5964e1]['dataValues']));_0x101124[_0x9816('0x49')](get_open_tabs(_0x9816('0x54'),_0x58e4f3[_0x9816('0x4c')][_0x5964e1]['dataValues']));_0x101124['push'](get_open_tabs(_0x9816('0x55'),_0x58e4f3['rows'][_0x5964e1][_0x9816('0x51')]));}return BPromise['all'](_0x101124)[_0x9816('0x18')](function(){return _0x58e4f3;});}else{return _0x58e4f3;}})[_0x9816('0x18')](respondWithFilteredResult(_0x628bcf,_0x18cd5f))[_0x9816('0x22')](handleError(_0x628bcf,null));};exports[_0x9816('0x56')]=function(_0x512f70,_0x27d17f){var _0x116dcb={'raw':![],'where':{'id':_0x512f70[_0x9816('0x57')]['id']}},_0x3abf9c={};_0x3abf9c[_0x9816('0x58')]=_[_0x9816('0x59')](_[_0x9816('0x5a')](db[_0x9816('0x4a')][_0x9816('0x3c')]),[_0x9816('0x3f'),_0x9816('0x40')]);_0x3abf9c[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x512f70[_0x9816('0x45')]);_0x3abf9c[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x3abf9c['model'],_0x3abf9c[_0x9816('0x45')]);_0x116dcb[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x3abf9c[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x512f70[_0x9816('0x45')][_0x9816('0x5d')]));_0x116dcb[_0x9816('0x48')]=_0x116dcb['attributes']['length']?_0x116dcb[_0x9816('0x48')]:_0x3abf9c[_0x9816('0x58')];if(_0x512f70[_0x9816('0x45')][_0x9816('0x43')]){_0x116dcb[_0x9816('0x44')]=[{'all':!![]}];}if(_0x512f70[_0x9816('0x45')][_0x9816('0x47')]===_0x9816('0x46')){_0x116dcb[_0x9816('0x44')]=[{'model':db[_0x9816('0x5e')],'as':_0x9816('0x47')}];}_0x116dcb=_['merge']({},_0x116dcb,_0x512f70[_0x9816('0x5f')]);if(!_[_0x9816('0x3e')](_0x116dcb[_0x9816('0x48')],'id')){_0x116dcb['attributes']['push']('id');}return db[_0x9816('0x4a')][_0x9816('0x38')](_0x116dcb)[_0x9816('0x18')](handleEntityNotFound(_0x27d17f,null))[_0x9816('0x18')](function(_0x427a6f){var _0x3f0264=[];values=_0x427a6f;if(_0x512f70[_0x9816('0x45')][_0x9816('0x4d')]===_0x9816('0x46')){_0x3f0264[_0x9816('0x49')](get_open_tabs(_0x9816('0x4f'),_0x427a6f[_0x9816('0x51')]));_0x3f0264[_0x9816('0x49')](get_open_tabs('sms',_0x427a6f['dataValues']));_0x3f0264[_0x9816('0x49')](get_open_tabs(_0x9816('0x54'),_0x427a6f['dataValues']));_0x3f0264['push'](get_open_tabs('whatsapp',_0x427a6f['dataValues']));_0x3f0264[_0x9816('0x49')](get_open_tabs(_0x9816('0x52'),_0x427a6f[_0x9816('0x51')]));_0x3f0264[_0x9816('0x49')](get_open_tabs(_0x9816('0x53'),_0x427a6f[_0x9816('0x51')]));return BPromise[_0x9816('0x60')](_0x3f0264);}else{return values;}})[_0x9816('0x18')](function(){return values;})[_0x9816('0x18')](respondWithResult(_0x27d17f,null))['catch'](handleError(_0x27d17f,null));};exports[_0x9816('0x2d')]=function(_0x406278,_0x3bbaa8){if(_0x406278[_0x9816('0x61')]['id']){delete _0x406278[_0x9816('0x61')]['id'];}delete _0x406278[_0x9816('0x61')]['role'];return db['User'][_0x9816('0x38')]({'where':{'id':_0x406278[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x3bbaa8,null))[_0x9816('0x18')](saveUpdates(_0x406278[_0x9816('0x61')],null))[_0x9816('0x18')](respondWithResult(_0x3bbaa8,null))[_0x9816('0x22')](handleError(_0x3bbaa8,null));};exports[_0x9816('0x62')]=function(_0x552c16,_0x3415b0){return db[_0x9816('0x4a')][_0x9816('0x62')]()['then'](respondWithResult(_0x3415b0,null))[_0x9816('0x22')](handleError(_0x3415b0,null));};exports[_0x9816('0x63')]=function(_0xbd4c0a,_0xc22af3){return db['User'][_0x9816('0x38')]({'where':{'id':_0xbd4c0a[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0xc22af3,null))[_0x9816('0x18')](function(_0x40f20c){if(_0x40f20c){return _0x40f20c[_0x9816('0x63')](_0xbd4c0a[_0x9816('0x61')]['ids'],_[_0x9816('0x64')](_0xbd4c0a[_0x9816('0x61')],[_0x9816('0x65'),'id'])||{});}})[_0x9816('0x18')](respondWithResult(_0xc22af3,null))['catch'](handleError(_0xc22af3,null));};function validateUser(_0x341b5b){return new BPromise(function(_0x54d96d,_0x212d46){if(_0x341b5b['internal'])return _0x54d96d(_0x341b5b);return db['Setting'][_0x9816('0x66')](0x1)[_0x9816('0x18')](function(_0x42ab46){if(_0x42ab46[_0x9816('0x67')])authService[_0x9816('0x68')](_0x341b5b[_0x9816('0x3f')]);db[_0x9816('0x4a')][_0x9816('0x69')](_0x9816('0x6a'))[_0x9816('0x18')](function(_0x20036f){if(_['isNil'](_0x20036f)){_0x341b5b[_0x9816('0x6a')]=_0x42ab46['min_internal']||0x1;return;}if(_[_0x9816('0x6b')](_0x42ab46[_0x9816('0x6c')])||_0x42ab46['min_internal']===_0x20036f){_0x341b5b[_0x9816('0x6a')]=_0x20036f+0x1;return;}if(_0x42ab46[_0x9816('0x6c')]>_0x20036f){_0x341b5b[_0x9816('0x6a')]=_0x42ab46['min_internal'];return;}return db[_0x9816('0x6d')]['query'](_0x9816('0x6e'),{'type':db[_0x9816('0x6d')][_0x9816('0x6f')]['SELECT']})[_0x9816('0x18')](function(_0x44ac2a){if(_0x44ac2a&&_0x44ac2a[_0x9816('0x4e')]){for(var _0x215521=0x0,_0x23cf74=_0x44ac2a[_0x9816('0x4e')];_0x215521<_0x23cf74&&_[_0x9816('0x6b')](_0x341b5b[_0x9816('0x6a')]);_0x215521++){if(_0x42ab46[_0x9816('0x6c')]<=_0x44ac2a[_0x215521][_0x9816('0x70')]){_0x341b5b[_0x9816('0x6a')]=_0x44ac2a[_0x215521]['from'];}else if(_0x42ab46[_0x9816('0x6c')]>_0x44ac2a[_0x215521][_0x9816('0x70')]&&_0x42ab46['min_internal']<=_0x44ac2a[_0x215521]['to']){_0x341b5b['internal']=_0x42ab46[_0x9816('0x6c')];}}}if(_['isNil'](_0x341b5b[_0x9816('0x6a')])){_0x341b5b[_0x9816('0x6a')]=_0x20036f+0x1;}return _0x54d96d(_0x341b5b);});});})[_0x9816('0x22')](function(_0x1e5eac){_0x212d46(_0x1e5eac);});});}function updateUser(_0x437d0c){return new BPromise(function(_0x20358f,_0x576862){try{if(_0x437d0c[_0x9816('0x71')]){_0x437d0c[_0x9816('0x72')]=_0x437d0c[_0x9816('0x6a')];_0x437d0c['VoiceMail']={'mailbox':_0x437d0c[_0x9816('0x6a')],'password':_0x437d0c[_0x9816('0x3f')],'fullname':_0x437d0c[_0x9816('0x73')],'email':_0x437d0c[_0x9816('0x74')]};}if(_0x437d0c['role']===_0x9816('0x34')){if(!_0x437d0c[_0x9816('0x75')])_0x437d0c['permissions']=['101',_0x9816('0x76'),_0x9816('0x77'),_0x9816('0x78'),_0x9816('0x79'),_0x9816('0x7a'),'105','106',_0x9816('0x7b'),_0x9816('0x7c'),_0x9816('0x7d'),_0x9816('0x7e'),_0x9816('0x7f'),'114',_0x9816('0x80')];}_0x20358f(_0x437d0c);}catch(_0x480904){_0x576862(_0x480904);}});}exports['create']=function(_0x247a4d,_0x35fdc5){if(_0x247a4d[_0x9816('0x33')]['role']===_0x9816('0x34'))throw new Error(_0x9816('0x81'));if(_0x247a4d[_0x9816('0x61')]['role']==='user'&&_0x247a4d[_0x9816('0x33')][_0x9816('0x30')]!==_0x9816('0x31')){throw new Error(_0x9816('0x82'));}if(_0x247a4d[_0x9816('0x61')][_0x9816('0x30')]===_0x9816('0x31')&&_0x247a4d[_0x9816('0x33')]['role']!==_0x9816('0x31')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x247a4d[_0x9816('0x61')]])[_0x9816('0x18')](function(){return validateUser(_0x247a4d[_0x9816('0x61')]);})['then'](function(_0x55edd6){return updateUser(_0x55edd6)[_0x9816('0x18')](function(_0x3a46df){if(_0x3a46df[_0x9816('0x30')]===_0x9816('0x31')){_0x3a46df[_0x9816('0x83')]=_0x247a4d[_0x9816('0x33')][_0x9816('0x83')];delete _0x3a46df[_0x9816('0x84')];}return _0x3a46df;});})[_0x9816('0x18')](function(_0x46f919){return db[_0x9816('0x4a')]['create'](_0x46f919,{'include':[{'model':db[_0x9816('0x85')],'as':_0x9816('0x85')}]});})[_0x9816('0x18')](function(_0xb6ff16){if(_0x247a4d[_0x9816('0x61')][_0x9816('0x30')]===_0x9816('0x33'))return _0xb6ff16;if(_0x247a4d[_0x9816('0x33')][_0x9816('0x30')]!==_0x9816('0x33'))return _0xb6ff16;return db[_0x9816('0x86')][_0x9816('0x38')]({'where':{'name':_0xb6ff16[_0x9816('0x30')]==='agent'?'Agents':_0x9816('0x87'),'userProfileId':_0x247a4d[_0x9816('0x33')][_0x9816('0x84')]},'raw':!![]})[_0x9816('0x18')](function(_0x59f95b){if(!_0x59f95b||_0x59f95b[_0x9816('0x88')]!=0x0)return _0xb6ff16;return db[_0x9816('0x3a')][_0x9816('0x89')]({'name':_0xb6ff16[_0x9816('0x39')],'resourceId':_0xb6ff16['id'],'type':_0x59f95b[_0x9816('0x39')],'sectionId':_0x59f95b['id']},{})[_0x9816('0x18')](function(){return _0xb6ff16;});})[_0x9816('0x22')](function(_0x44fdac){logger[_0x9816('0x1e')](_0x9816('0x8a'),_0x44fdac);throw _0x44fdac;});})[_0x9816('0x18')](respondWithResult(_0x35fdc5,0xc9))[_0x9816('0x22')](handleError(_0x35fdc5,null));};exports['bulkCreate']=function(_0x102be8,_0x276c8b){var _0x5421c1=_0x102be8[_0x9816('0x61')];var _0x1484c1=[];if(_0x102be8[_0x9816('0x33')][_0x9816('0x30')]==='agent')throw new Error(_0x9816('0x81'));if(_[_0x9816('0x8b')](_0x5421c1,[_0x9816('0x30'),_0x9816('0x33')])&&_0x102be8[_0x9816('0x33')]['role']!==_0x9816('0x31')){throw new Error(_0x9816('0x82'));}if(_[_0x9816('0x8b')](_0x5421c1,[_0x9816('0x30'),_0x9816('0x31')])&&_0x102be8[_0x9816('0x33')][_0x9816('0x30')]!==_0x9816('0x31')){throw new Error(_0x9816('0x8c'));}return licenseUtil[_0x9816('0x8d')](_0x5421c1)[_0x9816('0x18')](function(){return validateUser(_0x5421c1[0x0]);})[_0x9816('0x18')](function(){for(var _0x1ab44d=0x1;_0x1ab44d<_0x5421c1[_0x9816('0x4e')];_0x1ab44d++){var _0x534ac9=_0x5421c1[_0x1ab44d-0x1][_0x9816('0x6a')];if(!_0x5421c1[_0x1ab44d][_0x9816('0x6a')])_0x5421c1[_0x1ab44d][_0x9816('0x6a')]=_0x534ac9+0x1;_0x1484c1[_0x9816('0x49')](validateUser(_0x5421c1[_0x1ab44d]));}return BPromise[_0x9816('0x60')](_0x1484c1);})[_0x9816('0x18')](function(){_0x1484c1=[];for(var _0x498f4f=0x0;_0x498f4f<_0x5421c1['length'];_0x498f4f++){_0x1484c1[_0x9816('0x49')](updateUser(_0x5421c1[_0x498f4f]));}return BPromise[_0x9816('0x60')](_0x1484c1);})[_0x9816('0x18')](function(){return BPromise[_0x9816('0x8e')](_0x5421c1,function(_0x22c60c){return db['User'][_0x9816('0x89')](_0x22c60c,{'include':[{'model':db[_0x9816('0x85')],'as':_0x9816('0x85')}]})['then'](function(_0x635256){_0x22c60c['id']=_0x635256['id'];return _0x22c60c;});});})['then'](function(_0x45fbb5){if(_0x102be8['body'][_0x9816('0x30')]===_0x9816('0x33'))return _0x45fbb5;if(_0x102be8['user'][_0x9816('0x30')]!=='user')return _0x45fbb5;var _0x5a5eae=_['some'](_0x45fbb5,function(_0x496f1f){return _0x496f1f[_0x9816('0x30')]==='agent'||_0x496f1f[_0x9816('0x30')]===_0x9816('0x8f');});if(!_0x5a5eae)return _0x45fbb5;return db[_0x9816('0x86')][_0x9816('0x4b')]({'where':{'name':{'$or':['Agents',_0x9816('0x87')]},'userProfileId':_0x102be8[_0x9816('0x33')][_0x9816('0x84')]},'raw':!![]})[_0x9816('0x18')](function(_0xe15775){if(_[_0x9816('0x90')](_0xe15775)||!_['some'](_0xe15775,[_0x9816('0x88'),0x0]))return _0x45fbb5;_0x1484c1=[];var _0x5d13cd=_(_0xe15775)[_0x9816('0x36')](function(_0x3115b3){if(_0x3115b3[_0x9816('0x88')]===0x1)return;return _0x3115b3[_0x9816('0x39')]==='Agents'?_0x9816('0x34'):'telephone';})['compact']()[_0x9816('0x37')]();for(var _0x4eaf7d=0x0;_0x4eaf7d<_0x45fbb5[_0x9816('0x4e')];_0x4eaf7d++){if(!_['includes'](_0x5d13cd,_0x45fbb5[_0x4eaf7d][_0x9816('0x30')]))return;var _0x33c098=_0x45fbb5[_0x4eaf7d][_0x9816('0x30')]===_0x9816('0x34')?_0x9816('0x91'):'Telephones';_0x1484c1[_0x9816('0x49')](db['UserProfileResource'][_0x9816('0x89')]({'name':_0x45fbb5[_0x4eaf7d][_0x9816('0x39')],'resourceId':_0x45fbb5[_0x4eaf7d]['id'],'type':_0x33c098,'sectionId':_[_0x9816('0x38')](_0xe15775,[_0x9816('0x39'),_0x33c098])['id']},{}));}return BPromise[_0x9816('0x60')](_0x1484c1);});})['then'](respondWithResult(_0x276c8b,0xc9))['catch'](handleError(_0x276c8b,null));};exports[_0x9816('0x92')]=function(_0xccf6f9,_0x1efef7){if(_0xccf6f9['body']['id']){delete _0xccf6f9['body']['id'];}return db['User'][_0x9816('0x38')]({'where':{'id':_0xccf6f9[_0x9816('0x57')]['id']}})[_0x9816('0x18')](function(_0x41a27e){if(!_0x41a27e)return null;if(_0x41a27e['id']===_0xccf6f9['user']['id']){if(!_0xccf6f9[_0x9816('0x61')][_0x9816('0x93')]||!_0xccf6f9['body']['newPassword']){throw new db[(_0x9816('0x94'))][(_0x9816('0x95'))](_0x9816('0x96'));}if(!_0x41a27e[_0x9816('0x97')](_0xccf6f9['body']['oldPassword'])){throw new db[(_0x9816('0x94'))][(_0x9816('0x95'))]('Wrong\x20credentials');}if(_0xccf6f9['body'][_0x9816('0x93')]===_0xccf6f9[_0x9816('0x61')]['newPassword']){throw new db[(_0x9816('0x94'))][(_0x9816('0x95'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0xccf6f9['user'][_0x9816('0x30')]==='admin'){if(!_0xccf6f9[_0x9816('0x61')][_0x9816('0x98')]){throw new db[(_0x9816('0x94'))]['ValidationError'](_0x9816('0x99'));}}else if(_0xccf6f9[_0x9816('0x33')][_0x9816('0x30')]===_0x9816('0x33')){if(!_0xccf6f9[_0x9816('0x61')]['newPassword']){throw new db[(_0x9816('0x94'))]['ValidationError'](_0x9816('0x99'));}if(_0x41a27e[_0x9816('0x30')]!=='agent'){throw new db['Sequelize']['ValidationError'](_0x9816('0x81'));}}else{throw new db['Sequelize'][(_0x9816('0x95'))]('Unauthorized');}return _0x41a27e;})[_0x9816('0x18')](handleEntityNotFound(_0x1efef7,null))['then'](function(_0x97d6df){return db['Setting']['findOne']({'attributes':['id',_0x9816('0x67'),_0x9816('0x9a'),_0x9816('0x9b')]})[_0x9816('0x18')](function(_0x2bf1a4){if(_0x2bf1a4[_0x9816('0x67')])authService[_0x9816('0x68')](_0xccf6f9['body']['newPassword']);if(!_0x2bf1a4['enforcePasswordHistory']||!_0x97d6df[_0x9816('0x9c')])return _0x97d6df;authService[_0x9816('0x9d')](_0xccf6f9[_0x9816('0x61')][_0x9816('0x98')],_0x97d6df[_0x9816('0x9c')],_0x2bf1a4[_0x9816('0x9b')]);return _0x97d6df;})['then'](saveUpdates({'password':_0xccf6f9[_0x9816('0x61')][_0x9816('0x98')],'passwordResetAt':_0xccf6f9[_0x9816('0x33')]['id']==_0xccf6f9[_0x9816('0x57')]['id']?moment():null,'previousPasswords':authService[_0x9816('0x9e')](_0xccf6f9['body'][_0x9816('0x98')],_0x97d6df[_0x9816('0x9c')])},null));})[_0x9816('0x18')](respondWithResult(_0x1efef7,null))[_0x9816('0x22')](handleError(_0x1efef7,null));};exports[_0x9816('0x9f')]=function(_0x17bfa2,_0x460b31){var _0x339008=_0x17bfa2[_0x9816('0x61')]['channel'];return db['User'][_0x9816('0x38')]({'where':{'id':_0x17bfa2[_0x9816('0x57')]['id']},'attributes':['id',_0x9816('0x39'),_0x9816('0x30'),_0x9816('0xa0'),'loginInPause','voicePause',_0x9816('0xa1')]})[_0x9816('0x18')](handleEntityNotFound(_0x460b31,null))[_0x9816('0x18')](function(_0x3256ae){if(_0x3256ae){if(!utils[_0x9816('0xa2')](_0x339008)){throw new db[(_0x9816('0x94'))][(_0x9816('0x95'))](_0x9816('0xa3'));}return _0x3256ae[_0x9816('0xa4')+_[_0x9816('0xa5')](_0x339008[_0x9816('0xa6')]())+_0x9816('0xa7')](_0x17bfa2[_0x9816('0x61')]['ids'],{'penalty':_0x17bfa2['body'][_0x9816('0xa8')]||0x0})[_0x9816('0xa9')](function(_0x2767bc){for(var _0x13caf4=0x0;_0x13caf4<_0x17bfa2[_0x9816('0x61')][_0x9816('0x65')][_0x9816('0x4e')];_0x13caf4+=0x1){var _0x49362f={'UserId':Number(_0x17bfa2[_0x9816('0x57')]['id'])};_0x49362f[_['capitalize'](_0x339008['toLowerCase']())+_0x9816('0xaa')]=Number(_0x17bfa2['body'][_0x9816('0x65')][_0x13caf4]);socket['emit'](_0x9816('0x33')+_[_0x9816('0xa5')](_0x339008[_0x9816('0xa6')]())+_0x9816('0xab'),_0x49362f);}return _0x2767bc;})[_0x9816('0x18')](function(){if(_0x339008===_0x9816('0xac')){return db[_0x9816('0xad')][_0x9816('0x4b')]({'where':{'id':_0x17bfa2[_0x9816('0x61')]['ids']||[]},'raw':!![],'attributes':['id',_0x9816('0x39')]});}})['then'](function(_0x514ec6){var _0x435b1b=_0x3256ae['get']({'plain':!![]});var _0x3311b8=[];if(_0x339008==='voice'&&_0x435b1b[_0x9816('0x30')]===_0x9816('0x34')&&_0x435b1b[_0x9816('0xa0')]){for(var _0x2f4462=0x0;_0x2f4462<_0x514ec6['length'];_0x2f4462+=0x1){_0x3311b8['push']({'membername':_0x435b1b[_0x9816('0x39')],'UserId':_0x435b1b['id'],'queue_name':_0x514ec6[_0x2f4462][_0x9816('0x39')],'VoiceQueueId':_0x514ec6[_0x2f4462]['id'],'interface':_[_0x9816('0x6b')](_0x435b1b['interface'])?util[_0x9816('0xae')]('SIP/%s',_0x435b1b[_0x9816('0x39')]):_0x435b1b[_0x9816('0xa1')],'paused':_0x435b1b[_0x9816('0xaf')]||![],'penalty':_0x17bfa2[_0x9816('0x61')][_0x9816('0xa8')]||0x0});}return BPromise['each'](_0x3311b8,function(_0x263d31){return db[_0x9816('0xb0')][_0x9816('0xb1')](_0x263d31);});}return _0x3256ae;});}})['then'](respondWithStatusCode(_0x460b31,null))[_0x9816('0x22')](handleError(_0x460b31,null));};exports[_0x9816('0xb2')]=function(_0x4f5dca,_0x26e3de){var _0x488370,_0x5163e6;return db['User']['find']({'where':{'id':_0x4f5dca['params']['id']},'attributes':['id','name',_0x9816('0x30')]})[_0x9816('0x18')](handleEntityNotFound(_0x26e3de,null))[_0x9816('0x18')](function(_0x557228){if(_0x557228){_0x488370=_0x557228;if(!_0x4f5dca[_0x9816('0x45')][_0x9816('0xb3')]||!utils[_0x9816('0xa2')](_0x4f5dca[_0x9816('0x45')]['channel'])){throw new db['Sequelize'][(_0x9816('0x95'))](_0x9816('0xa3'));}return _0x557228[_0x9816('0xb4')+_[_0x9816('0xa5')](_0x4f5dca[_0x9816('0x45')][_0x9816('0xb3')]['toLowerCase']())+'Queues'](_0x4f5dca[_0x9816('0x45')]['ids']);}})[_0x9816('0x18')](function(_0x189b7f){if(_[_0x9816('0xb5')](_0x4f5dca[_0x9816('0x45')][_0x9816('0x65')])){for(var _0x1c1fc1=0x0;_0x1c1fc1<_0x4f5dca[_0x9816('0x45')]['ids']['length'];_0x1c1fc1+=0x1){_0x5163e6={'UserId':Number(_0x4f5dca[_0x9816('0x57')]['id'])};_0x5163e6[_[_0x9816('0xa5')](_0x4f5dca[_0x9816('0x45')][_0x9816('0xb3')]['toLowerCase']())+_0x9816('0xaa')]=Number(_0x4f5dca[_0x9816('0x45')][_0x9816('0x65')][_0x1c1fc1]);socket[_0x9816('0xb6')](_0x9816('0x33')+_[_0x9816('0xa5')](_0x4f5dca[_0x9816('0x45')][_0x9816('0xb3')]['toLowerCase']())+_0x9816('0xb7'),_0x5163e6);}}else{_0x5163e6={'UserId':Number(_0x4f5dca[_0x9816('0x57')]['id'])};_0x5163e6[_[_0x9816('0xa5')](_0x4f5dca[_0x9816('0x45')]['channel']['toLowerCase']())+_0x9816('0xaa')]=Number(_0x4f5dca[_0x9816('0x45')][_0x9816('0x65')]);socket[_0x9816('0xb6')](_0x9816('0x33')+_[_0x9816('0xa5')](_0x4f5dca['query'][_0x9816('0xb3')][_0x9816('0xa6')]())+_0x9816('0xb7'),_0x5163e6);}return _0x189b7f;})[_0x9816('0x18')](function(){if(_0x4f5dca[_0x9816('0x45')][_0x9816('0xb3')]===_0x9816('0xac')){return db['UserVoiceQueueRt'][_0x9816('0x2e')]({'where':{'UserId':_0x4f5dca['params']['id'],'VoiceQueueId':_0x4f5dca[_0x9816('0x45')][_0x9816('0x65')]},'individualHooks':!![]})['then'](function(){return _0x488370;});}return _0x488370;})[_0x9816('0x18')](respondWithStatusCode(_0x26e3de,null))[_0x9816('0x22')](handleError(_0x26e3de,null));};exports[_0x9816('0xb8')]=function(_0x186159,_0x1a52de){_0x186159[_0x9816('0x61')][_0x9816('0xb9')]=_0x186159[_0x9816('0xba')][_0x9816('0xbb')];return db[_0x9816('0x4a')]['find']({'where':{'id':_0x186159[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x1a52de,null))[_0x9816('0x18')](saveUpdates(_0x186159[_0x9816('0x61')],null))['then'](respondWithResult(_0x1a52de,null))[_0x9816('0x22')](handleError(_0x1a52de,null));};exports[_0x9816('0xbc')]=function(_0x218039,_0x487d57){var _0x4e766a=path[_0x9816('0xbd')](config['root'],'server/files/images/logos/default_profile.png');return db[_0x9816('0x4a')]['find']({'where':{'id':_0x218039[_0x9816('0x57')]['id']},'attributes':['id',_0x9816('0xb9')],'raw':!![]})['then'](handleEntityNotFound(_0x487d57,null))[_0x9816('0x18')](function(_0x2ab998){if(_0x2ab998){if(_[_0x9816('0x6b')](_0x2ab998[_0x9816('0xb9')])){return _0x487d57[_0x9816('0xbe')](_0x4e766a);}else{if(!fs['existsSync'](path[_0x9816('0xbd')](config[_0x9816('0xbf')],_0x9816('0xc0'),_0x2ab998[_0x9816('0xb9')]))){return _0x487d57[_0x9816('0xbe')](_0x4e766a);}return _0x487d57[_0x9816('0xbe')](path[_0x9816('0xbd')](config[_0x9816('0xbf')],_0x9816('0xc0'),_0x2ab998['userpic']));}}})['catch'](handleError(_0x487d57,null));};exports['getOpenTabs']=function(_0x204b39,_0x3c6e2a){return db['User'][_0x9816('0x38')]({'where':{'id':_0x204b39[_0x9816('0x57')]['id']},'attributes':['id']})[_0x9816('0x18')](handleEntityNotFound(_0x3c6e2a,null))[_0x9816('0x18')](function(_0x19fb53){var _0x264990=[];values=_0x19fb53[_0x9816('0x51')];_0x264990[_0x9816('0x49')](get_open_tabs(_0x9816('0x4f'),_0x19fb53[_0x9816('0x51')]));_0x264990[_0x9816('0x49')](get_open_tabs('sms',_0x19fb53[_0x9816('0x51')]));_0x264990[_0x9816('0x49')](get_open_tabs(_0x9816('0x54'),_0x19fb53['dataValues']));_0x264990[_0x9816('0x49')](get_open_tabs(_0x9816('0x55'),_0x19fb53[_0x9816('0x51')]));_0x264990[_0x9816('0x49')](get_open_tabs(_0x9816('0x52'),_0x19fb53['dataValues']));_0x264990[_0x9816('0x49')](get_open_tabs(_0x9816('0x53'),_0x19fb53[_0x9816('0x51')]));return BPromise['all'](_0x264990);})['then'](function(_0x2ebf01){if(_0x2ebf01){var _0x6a2a78=_[_0x9816('0x36')](values[_0x9816('0xc1')],function(_0x23d7e0){return{'channel':_0x9816('0xc2'),'id':_0x23d7e0['id'],'createdAt':_0x23d7e0['createdAt']};});var _0x38d3db=_[_0x9816('0x36')](values[_0x9816('0xc3')],function(_0x4ac6ad){return{'channel':_0x9816('0xc4'),'id':_0x4ac6ad['id'],'createdAt':_0x4ac6ad[_0x9816('0xc5')]};});var _0x28afe8=_[_0x9816('0x36')](values[_0x9816('0xc6')],function(_0x365bf5){return{'channel':_0x9816('0xc7'),'id':_0x365bf5['id'],'createdAt':_0x365bf5[_0x9816('0xc5')]};});var _0x395233=_[_0x9816('0x36')](values[_0x9816('0xc8')],function(_0xffa1a){return{'channel':_0x9816('0xc9'),'id':_0xffa1a['id'],'createdAt':_0xffa1a[_0x9816('0xc5')]};});var _0x1c4e07=_[_0x9816('0x36')](values[_0x9816('0xca')],function(_0x2ee69a){return{'channel':_0x9816('0xcb'),'id':_0x2ee69a['id'],'createdAt':_0x2ee69a['createdAt']};});var _0x7209b=_['map'](values['WhatsappOpenTabs'],function(_0x5c05e0){return{'channel':_0x9816('0xcc'),'id':_0x5c05e0['id'],'createdAt':_0x5c05e0[_0x9816('0xc5')]};});var _0x475e02=_[_0x9816('0xcd')](_0x6a2a78,_0x38d3db,_0x28afe8,_0x395233,_0x1c4e07,_0x7209b);var _0x37ad9e={'count':_0x475e02[_0x9816('0x4e')],'rows':_0x475e02};return _0x37ad9e;}else return null;})[_0x9816('0x18')](respondWithResult(_0x3c6e2a,null))[_0x9816('0x22')](handleError(_0x3c6e2a,null));};exports[_0x9816('0xce')]=function(_0x102515,_0x5594ad){var _0x2d6f11={};var _0x21038b={};var _0x219154;var _0x19a66b;return db[_0x9816('0x4a')][_0x9816('0xcf')]({'where':{'id':_0x102515[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x5594ad,null))[_0x9816('0x18')](function(_0x4b7586){if(_0x4b7586){_0x219154=_0x4b7586;_0x21038b[_0x9816('0x58')]=_['keys'](db[_0x9816('0xd0')]['rawAttributes']);_0x21038b[_0x9816('0x45')]=_['keys'](_0x102515[_0x9816('0x45')]);_0x21038b[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x21038b[_0x9816('0x58')],_0x21038b[_0x9816('0x45')]);_0x2d6f11[_0x9816('0x48')]=_['intersection'](_0x21038b['model'],qs['fields'](_0x102515['query'][_0x9816('0x5d')]));_0x2d6f11[_0x9816('0x48')]=_0x2d6f11['attributes'][_0x9816('0x4e')]?_0x2d6f11[_0x9816('0x48')]:_0x21038b[_0x9816('0x58')];_0x2d6f11[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x102515[_0x9816('0x45')]['sort']);_0x2d6f11[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x102515['query'],_0x21038b[_0x9816('0x5b')]));if(_0x102515['query'][_0x9816('0xd4')]){_0x2d6f11[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x2d6f11[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x2d6f11[_0x9816('0x48')],function(_0x43e51c){var _0x4e051e={};_0x4e051e[_0x43e51c]={'$like':'%'+_0x102515[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x4e051e;})});}_0x2d6f11=_[_0x9816('0xd5')]({},_0x2d6f11,_0x102515[_0x9816('0x5f')]);return _0x219154['getContacts'](_0x2d6f11);}})['then'](function(_0x3eb421){if(_0x3eb421){_0x19a66b=_0x3eb421[_0x9816('0x4e')];if(_0x102515[_0x9816('0x45')][_0x9816('0xd6')](_0x9816('0x43'))){_0x2d6f11[_0x9816('0x44')]=[{'model':db[_0x9816('0xd7')],'as':_0x9816('0xd8'),'required':![]},{'model':db[_0x9816('0xd9')],'as':_0x9816('0xda'),'attributes':['id',_0x9816('0x39'),_0x9816('0xdb')],'where':_0x102515[_0x9816('0x45')][_0x9816('0xdc')]?{'id':_0x102515['query']['tag']}:undefined,'required':_0x102515[_0x9816('0x45')][_0x9816('0xdc')]?!![]:![]}];}if(!_0x102515[_0x9816('0x45')][_0x9816('0xd6')](_0x9816('0xdd'))){_0x2d6f11['limit']=qs[_0x9816('0x29')](_0x102515[_0x9816('0x45')][_0x9816('0x29')]);_0x2d6f11[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x102515[_0x9816('0x45')][_0x9816('0x27')]);}return _0x219154[_0x9816('0xce')](_0x2d6f11);}})[_0x9816('0x18')](function(_0xf475d){if(_0xf475d){return _0xf475d?{'count':_0x19a66b,'rows':_0xf475d}:null;}})['then'](respondWithResult(_0x5594ad,null))[_0x9816('0x22')](handleError(_0x5594ad,null));};exports[_0x9816('0xde')]=function(_0x30d18f,_0x26c07d){var _0x12a0ee;var _0x2d12ce={};var _0x3992ad;return db['User']['findOne']({'where':{'id':_0x30d18f['params']['id']},'attributes':['id',_0x9816('0x39'),_0x9816('0x30')]})['then'](handleEntityNotFound(_0x26c07d,null))[_0x9816('0x18')](function(_0x221a62){if(!utils[_0x9816('0xa2')](_0x30d18f[_0x9816('0x45')][_0x9816('0xb3')])){throw new db['Sequelize'][(_0x9816('0x95'))](_0x9816('0xa3'));}_0x12a0ee=_0x221a62;var _0x5bda1b={};_0x5bda1b[_0x9816('0x58')]=_[_0x9816('0x5a')](db[_[_0x9816('0xa5')](_0x30d18f[_0x9816('0x45')][_0x9816('0xb3')])+_0x9816('0xdf')][_0x9816('0x3c')]);_0x5bda1b[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x30d18f[_0x9816('0x45')]);_0x5bda1b[_0x9816('0x5b')]=_['intersection'](_0x5bda1b['model'],_0x5bda1b[_0x9816('0x45')]);_0x2d12ce[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x5bda1b['model'],qs[_0x9816('0x5d')](_0x30d18f[_0x9816('0x45')]['fields']));_0x2d12ce['attributes']=_0x2d12ce[_0x9816('0x48')]['length']?_0x2d12ce[_0x9816('0x48')]:_0x5bda1b[_0x9816('0x58')];_0x2d12ce[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x30d18f[_0x9816('0x45')][_0x9816('0xd2')]);_0x2d12ce['where']=qs['filters'](_['pick'](_0x30d18f['query'],_0x5bda1b[_0x9816('0x5b')]));if(_0x30d18f['query']['filter']){_0x2d12ce[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x2d12ce[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x2d12ce['attributes'],function(_0x349f7b){var _0x30e402={};_0x30e402[_0x349f7b]={'$like':'%'+_0x30d18f[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x30e402;})});}_0x2d12ce=_[_0x9816('0xd5')]({},_0x2d12ce,_0x30d18f['options']);switch(_0x12a0ee[_0x9816('0x30')]){case _0x9816('0x31'):return db[_[_0x9816('0xa5')](_0x30d18f[_0x9816('0x45')][_0x9816('0xb3')])+_0x9816('0xdf')]['findAll'](_0x2d12ce);case'user':case _0x9816('0x34'):return _0x12a0ee['get'+_[_0x9816('0xa5')](_0x30d18f['query'][_0x9816('0xb3')])+_0x9816('0xa7')](_0x2d12ce);default:throw new db[(_0x9816('0x94'))][(_0x9816('0x95'))](_0x9816('0xe0'));}})[_0x9816('0x18')](function(_0x44f330){_0x3992ad=_0x44f330['length'];if(!_0x30d18f[_0x9816('0x45')][_0x9816('0xd6')](_0x9816('0xdd'))){_0x2d12ce['limit']=qs['limit'](_0x30d18f[_0x9816('0x45')][_0x9816('0x29')]);_0x2d12ce[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x30d18f[_0x9816('0x45')]['offset']);}switch(_0x12a0ee[_0x9816('0x30')]){case'admin':return db[_['capitalize'](_0x30d18f[_0x9816('0x45')][_0x9816('0xb3')])+_0x9816('0xdf')][_0x9816('0x4b')](_0x2d12ce);case'user':case _0x9816('0x34'):return _0x12a0ee[_0x9816('0x2f')+_[_0x9816('0xa5')](_0x30d18f[_0x9816('0x45')][_0x9816('0xb3')])+'Queues'](_0x2d12ce);}})[_0x9816('0x18')](function(_0x5ef1dc){return{'count':_0x3992ad,'rows':_0x5ef1dc};})[_0x9816('0x18')](respondWithResult(_0x26c07d,null))['catch'](handleError(_0x26c07d,null));};exports['getVoiceQueuesRt']=function(_0x312715,_0x4d9956){var _0x4ed67e={};var _0x1d7da0={};var _0x6a80d1;var _0x5b5038;return db['User'][_0x9816('0xcf')]({'where':{'id':_0x312715[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x4d9956,null))[_0x9816('0x18')](function(_0x1bfed5){if(_0x1bfed5){_0x6a80d1=_0x1bfed5;_0x1d7da0[_0x9816('0x58')]=_['keys'](db[_0x9816('0xb0')][_0x9816('0x3c')]);_0x1d7da0['query']=_[_0x9816('0x5a')](_0x312715[_0x9816('0x45')]);_0x1d7da0[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x1d7da0[_0x9816('0x58')],_0x1d7da0[_0x9816('0x45')]);_0x4ed67e['attributes']=_[_0x9816('0x5c')](_0x1d7da0[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x312715['query'][_0x9816('0x5d')]));_0x4ed67e[_0x9816('0x48')]=_0x4ed67e[_0x9816('0x48')]['length']?_0x4ed67e[_0x9816('0x48')]:_0x1d7da0[_0x9816('0x58')];_0x4ed67e[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x312715[_0x9816('0x45')][_0x9816('0xd2')]);_0x4ed67e[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x312715[_0x9816('0x45')],_0x1d7da0[_0x9816('0x5b')]));if(_0x312715['query']['filter']){_0x4ed67e[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x4ed67e['where'],{'$or':_[_0x9816('0x36')](_0x4ed67e[_0x9816('0x48')],function(_0x23e0eb){var _0x238765={};_0x238765[_0x23e0eb]={'$like':'%'+_0x312715[_0x9816('0x45')]['filter']+'%'};return _0x238765;})});}_0x4ed67e=_[_0x9816('0xd5')]({},_0x4ed67e,_0x312715[_0x9816('0x5f')]);return _0x6a80d1[_0x9816('0xe1')](_0x4ed67e);}})['then'](function(_0x3c36bb){if(_0x3c36bb){_0x5b5038=_0x3c36bb[_0x9816('0x4e')];if(!_0x312715['query'][_0x9816('0xd6')](_0x9816('0xdd'))){_0x4ed67e[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x312715[_0x9816('0x45')][_0x9816('0x29')]);_0x4ed67e[_0x9816('0x27')]=qs['offset'](_0x312715['query']['offset']);}return _0x6a80d1[_0x9816('0xe1')](_0x4ed67e);}})[_0x9816('0x18')](function(_0x4e5954){if(_0x4e5954){return _0x4e5954?{'count':_0x5b5038,'rows':_0x4e5954}:null;}})[_0x9816('0x18')](respondWithResult(_0x4d9956,null))[_0x9816('0x22')](handleError(_0x4d9956,null));};exports[_0x9816('0xe2')]=function(_0x4fc09f,_0x5f4cf3){var _0x2624bb={};var _0x411473={};var _0x556ce7;var _0x5f27be;return db[_0x9816('0x4a')]['findOne']({'where':{'id':_0x4fc09f[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x5f4cf3,null))[_0x9816('0x18')](function(_0xd1e8b0){if(_0xd1e8b0){_0x556ce7=_0xd1e8b0;_0x411473[_0x9816('0x58')]=_[_0x9816('0x5a')](db[_0x9816('0xe3')][_0x9816('0x3c')]);_0x411473[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x4fc09f[_0x9816('0x45')]);_0x411473[_0x9816('0x5b')]=_['intersection'](_0x411473[_0x9816('0x58')],_0x411473[_0x9816('0x45')]);_0x2624bb[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x411473[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x4fc09f[_0x9816('0x45')][_0x9816('0x5d')]));_0x2624bb[_0x9816('0x48')]=_0x2624bb['attributes'][_0x9816('0x4e')]?_0x2624bb[_0x9816('0x48')]:_0x411473[_0x9816('0x58')];_0x2624bb[_0x9816('0xd1')]=qs['sort'](_0x4fc09f[_0x9816('0x45')][_0x9816('0xd2')]);_0x2624bb[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x4fc09f['query'],_0x411473[_0x9816('0x5b')]));if(_0x4fc09f[_0x9816('0x45')]['filter']){_0x2624bb[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x2624bb[_0x9816('0x42')],{'$or':_['map'](_0x2624bb[_0x9816('0x48')],function(_0x5a832){var _0x479975={};_0x479975[_0x5a832]={'$like':'%'+_0x4fc09f['query'][_0x9816('0xd4')]+'%'};return _0x479975;})});}_0x2624bb=_[_0x9816('0xd5')]({},_0x2624bb,_0x4fc09f[_0x9816('0x5f')]);return _0x556ce7[_0x9816('0xe2')](_0x2624bb);}})[_0x9816('0x18')](function(_0x101b02){if(_0x101b02){_0x5f27be=_0x101b02[_0x9816('0x4e')];if(!_0x4fc09f['query'][_0x9816('0xd6')](_0x9816('0xdd'))){_0x2624bb[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x4fc09f[_0x9816('0x45')][_0x9816('0x29')]);_0x2624bb[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x4fc09f[_0x9816('0x45')][_0x9816('0x27')]);}return _0x556ce7[_0x9816('0xe2')](_0x2624bb);}})[_0x9816('0x18')](function(_0x4eea42){if(_0x4eea42){return _0x4eea42?{'count':_0x5f27be,'rows':_0x4eea42}:null;}})['then'](respondWithResult(_0x5f4cf3,null))[_0x9816('0x22')](handleError(_0x5f4cf3,null));};exports[_0x9816('0xe4')]=function(_0x164b6e,_0x31e8a1){var _0x489d29={'raw':!![],'where':{}};var _0x7d50d={};var _0x471376={'count':0x0,'rows':[]};return db['User'][_0x9816('0xcf')]({'where':{'id':_0x164b6e[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x31e8a1,null))[_0x9816('0x18')](function(_0x5eacf0){if(_0x5eacf0){_0x7d50d['model']=_[_0x9816('0x5a')](db[_0x9816('0xe5')]['rawAttributes']);_0x7d50d[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x164b6e['query']);_0x7d50d[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x7d50d[_0x9816('0x58')],_0x7d50d[_0x9816('0x45')]);_0x489d29['attributes']=_['intersection'](_0x7d50d[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x164b6e[_0x9816('0x45')][_0x9816('0x5d')]));_0x489d29['attributes']=_0x489d29['attributes'][_0x9816('0x4e')]?_0x489d29[_0x9816('0x48')]:_0x7d50d[_0x9816('0x58')];if(!_0x164b6e[_0x9816('0x45')]['hasOwnProperty'](_0x9816('0xdd'))){_0x489d29[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x164b6e[_0x9816('0x45')][_0x9816('0x29')]);_0x489d29[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x164b6e['query'][_0x9816('0x27')]);}_0x489d29[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x164b6e[_0x9816('0x45')]['sort']);_0x489d29[_0x9816('0x42')]=qs['filters'](_[_0x9816('0xd3')](_0x164b6e[_0x9816('0x45')],_0x7d50d[_0x9816('0x5b')]));_0x489d29[_0x9816('0x42')]['UserId']=_0x5eacf0['id'];if(_0x164b6e[_0x9816('0x45')][_0x9816('0xd4')]){_0x489d29[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x489d29['where'],{'$or':_[_0x9816('0x36')](_0x489d29[_0x9816('0x48')],function(_0x620c0a){var _0x49aed6={};_0x49aed6[_0x620c0a]={'$like':'%'+_0x164b6e['query'][_0x9816('0xd4')]+'%'};return _0x49aed6;})});}_0x489d29=_[_0x9816('0xd5')]({},_0x489d29,_0x164b6e[_0x9816('0x5f')]);return db[_0x9816('0xe5')][_0x9816('0x2a')]({'where':_0x489d29['where']})[_0x9816('0x18')](function(_0x14ce9e){_0x471376['count']=_0x14ce9e;if(_0x164b6e[_0x9816('0x45')][_0x9816('0x43')]){_0x489d29[_0x9816('0x44')]=[{'all':!![]}];}return db['VoiceRecording'][_0x9816('0x4b')](_0x489d29);})[_0x9816('0x18')](function(_0x5f4b31){_0x471376[_0x9816('0x4c')]=_0x5f4b31;return _0x471376;});}})[_0x9816('0x18')](respondWithFilteredResult(_0x31e8a1,_0x489d29))[_0x9816('0x22')](handleError(_0x31e8a1,null));};exports[_0x9816('0xe6')]=function(_0x530739,_0x56ff37){var _0x21261e={'raw':!![],'where':{}};var _0x2e8b7a={};var _0x5c0a4a={'count':0x0,'rows':[]};return db[_0x9816('0x4a')]['findOne']({'where':{'id':_0x530739['params']['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x56ff37,null))[_0x9816('0x18')](function(_0x9c8411){if(_0x9c8411){_0x2e8b7a[_0x9816('0x58')]=_[_0x9816('0x5a')](db[_0x9816('0xe7')][_0x9816('0x3c')]);_0x2e8b7a['query']=_[_0x9816('0x5a')](_0x530739[_0x9816('0x45')]);_0x2e8b7a['filters']=_[_0x9816('0x5c')](_0x2e8b7a[_0x9816('0x58')],_0x2e8b7a['query']);_0x21261e[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x2e8b7a['model'],qs['fields'](_0x530739['query'][_0x9816('0x5d')]));_0x21261e[_0x9816('0x48')]=_0x21261e[_0x9816('0x48')][_0x9816('0x4e')]?_0x21261e[_0x9816('0x48')]:_0x2e8b7a[_0x9816('0x58')];if(!_0x530739[_0x9816('0x45')][_0x9816('0xd6')](_0x9816('0xdd'))){_0x21261e[_0x9816('0x29')]=qs['limit'](_0x530739[_0x9816('0x45')][_0x9816('0x29')]);_0x21261e[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x530739['query'][_0x9816('0x27')]);}_0x21261e[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x530739[_0x9816('0x45')][_0x9816('0xd2')]);_0x21261e[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x530739[_0x9816('0x45')],_0x2e8b7a[_0x9816('0x5b')]));_0x21261e[_0x9816('0x42')][_0x9816('0xe8')]=_0x9c8411['id'];if(_0x530739[_0x9816('0x45')][_0x9816('0xd4')]){_0x21261e[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x21261e[_0x9816('0x42')],{'$or':_['map'](_0x21261e[_0x9816('0x48')],function(_0x471c79){var _0x55c21c={};_0x55c21c[_0x471c79]={'$like':'%'+_0x530739[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x55c21c;})});}_0x21261e=_[_0x9816('0xd5')]({},_0x21261e,_0x530739[_0x9816('0x5f')]);return db[_0x9816('0xe7')][_0x9816('0x2a')]({'where':_0x21261e[_0x9816('0x42')]})[_0x9816('0x18')](function(_0x5506d8){_0x5c0a4a[_0x9816('0x2a')]=_0x5506d8;if(_0x530739['query'][_0x9816('0x43')]){_0x21261e[_0x9816('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0x9816('0x4b')](_0x21261e);})[_0x9816('0x18')](function(_0x1ed6a7){_0x5c0a4a[_0x9816('0x4c')]=_0x1ed6a7;return _0x5c0a4a;});}})[_0x9816('0x18')](respondWithFilteredResult(_0x56ff37,_0x21261e))[_0x9816('0x22')](handleError(_0x56ff37,null));};exports['getChatInteractions']=function(_0x264a76,_0x3b17e9){var _0x52db16={};var _0x167b30={};var _0x1adafa;var _0x398be0;return db[_0x9816('0x4a')][_0x9816('0xcf')]({'where':{'id':_0x264a76[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x3b17e9,null))[_0x9816('0x18')](function(_0x40083a){if(_0x40083a){_0x1adafa=_0x40083a;_0x167b30[_0x9816('0x58')]=_[_0x9816('0x5a')](db[_0x9816('0xe9')][_0x9816('0x3c')]);_0x167b30['query']=_[_0x9816('0x5a')](_0x264a76[_0x9816('0x45')]);_0x167b30[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x167b30[_0x9816('0x58')],_0x167b30[_0x9816('0x45')]);_0x52db16[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x167b30[_0x9816('0x58')],qs['fields'](_0x264a76['query'][_0x9816('0x5d')]));_0x52db16[_0x9816('0x48')]=_0x52db16[_0x9816('0x48')][_0x9816('0x4e')]?_0x52db16[_0x9816('0x48')]:_0x167b30[_0x9816('0x58')];_0x52db16[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x264a76[_0x9816('0x45')][_0x9816('0xd2')]);_0x52db16[_0x9816('0x42')]=qs['filters'](_['pick'](_0x264a76[_0x9816('0x45')],_0x167b30[_0x9816('0x5b')]));if(_0x264a76['query'][_0x9816('0xd4')]){_0x52db16[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x52db16[_0x9816('0x42')],{'$or':_['map'](_0x52db16[_0x9816('0x48')],function(_0x4bf0ec){var _0x31abce={};_0x31abce[_0x4bf0ec]={'$like':'%'+_0x264a76['query']['filter']+'%'};return _0x31abce;})});}_0x52db16=_[_0x9816('0xd5')]({},_0x52db16,_0x264a76[_0x9816('0x5f')]);return _0x1adafa[_0x9816('0xea')](_0x52db16);}})[_0x9816('0x18')](function(_0x302d48){if(_0x302d48){_0x398be0=_0x302d48[_0x9816('0x4e')];if(!_0x264a76[_0x9816('0x45')]['hasOwnProperty']('nolimit')){_0x52db16[_0x9816('0x29')]=qs['limit'](_0x264a76[_0x9816('0x45')][_0x9816('0x29')]);_0x52db16[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x264a76[_0x9816('0x45')]['offset']);}return _0x1adafa[_0x9816('0xea')](_0x52db16);}})[_0x9816('0x18')](function(_0x564492){if(_0x564492){return _0x564492?{'count':_0x398be0,'rows':_0x564492}:null;}})['then'](respondWithResult(_0x3b17e9,null))['catch'](handleError(_0x3b17e9,null));};exports[_0x9816('0xeb')]=function(_0x16d324,_0x5753c1){var _0x4da528={};var _0x3bd548={};var _0xe09b11;var _0x4c3031;return db['User']['findOne']({'where':{'id':_0x16d324[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x5753c1,null))[_0x9816('0x18')](function(_0x1d53b1){if(_0x1d53b1){_0xe09b11=_0x1d53b1;_0x3bd548[_0x9816('0x58')]=_[_0x9816('0x5a')](db[_0x9816('0xec')][_0x9816('0x3c')]);_0x3bd548['query']=_['keys'](_0x16d324['query']);_0x3bd548[_0x9816('0x5b')]=_['intersection'](_0x3bd548[_0x9816('0x58')],_0x3bd548[_0x9816('0x45')]);_0x4da528[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x3bd548[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x16d324[_0x9816('0x45')][_0x9816('0x5d')]));_0x4da528['attributes']=_0x4da528[_0x9816('0x48')]['length']?_0x4da528['attributes']:_0x3bd548[_0x9816('0x58')];_0x4da528['order']=qs[_0x9816('0xd2')](_0x16d324[_0x9816('0x45')][_0x9816('0xd2')]);_0x4da528[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x16d324[_0x9816('0x45')],_0x3bd548['filters']));if(_0x16d324[_0x9816('0x45')]['filter']){_0x4da528[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x4da528['where'],{'$or':_[_0x9816('0x36')](_0x4da528[_0x9816('0x48')],function(_0x37e645){var _0x13454b={};_0x13454b[_0x37e645]={'$like':'%'+_0x16d324[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x13454b;})});}_0x4da528=_[_0x9816('0xd5')]({},_0x4da528,_0x16d324[_0x9816('0x5f')]);return _0xe09b11[_0x9816('0xeb')](_0x4da528);}})[_0x9816('0x18')](function(_0x39bd46){if(_0x39bd46){_0x4c3031=_0x39bd46['length'];if(!_0x16d324['query'][_0x9816('0xd6')](_0x9816('0xdd'))){_0x4da528[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x16d324[_0x9816('0x45')][_0x9816('0x29')]);_0x4da528[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x16d324[_0x9816('0x45')][_0x9816('0x27')]);}return _0xe09b11['getOpenchannelInteractions'](_0x4da528);}})['then'](function(_0x57b4cc){if(_0x57b4cc){return _0x57b4cc?{'count':_0x4c3031,'rows':_0x57b4cc}:null;}})[_0x9816('0x18')](respondWithResult(_0x5753c1,null))['catch'](handleError(_0x5753c1,null));};exports[_0x9816('0xed')]=function(_0x31b8f3,_0x7e5502){var _0x21d322={'raw':!![],'where':{}};var _0x2806b3={};var _0x3f8638={'count':0x0,'rows':[]};return db[_0x9816('0x4a')]['findOne']({'where':{'id':_0x31b8f3[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x7e5502,null))['then'](function(_0xec9820){if(_0xec9820){_0x2806b3['model']=_[_0x9816('0x5a')](db[_0x9816('0xee')][_0x9816('0x3c')]);_0x2806b3[_0x9816('0x45')]=_['keys'](_0x31b8f3['query']);_0x2806b3[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x2806b3[_0x9816('0x58')],_0x2806b3['query']);_0x21d322[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x2806b3[_0x9816('0x58')],qs['fields'](_0x31b8f3[_0x9816('0x45')]['fields']));_0x21d322[_0x9816('0x48')]=_0x21d322[_0x9816('0x48')][_0x9816('0x4e')]?_0x21d322[_0x9816('0x48')]:_0x2806b3[_0x9816('0x58')];if(!_0x31b8f3[_0x9816('0x45')][_0x9816('0xd6')](_0x9816('0xdd'))){_0x21d322[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x31b8f3[_0x9816('0x45')][_0x9816('0x29')]);_0x21d322[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x31b8f3[_0x9816('0x45')]['offset']);}_0x21d322[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x31b8f3['query'][_0x9816('0xd2')]);_0x21d322[_0x9816('0x42')]=qs['filters'](_[_0x9816('0xd3')](_0x31b8f3[_0x9816('0x45')],_0x2806b3[_0x9816('0x5b')]));_0x21d322['where'][_0x9816('0xe8')]=_0xec9820['id'];if(_0x31b8f3[_0x9816('0x45')][_0x9816('0xd4')]){_0x21d322['where']=_[_0x9816('0xd5')](_0x21d322[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x21d322[_0x9816('0x48')],function(_0x10fccd){var _0x5a7baa={};_0x5a7baa[_0x10fccd]={'$like':'%'+_0x31b8f3['query']['filter']+'%'};return _0x5a7baa;})});}_0x21d322=_[_0x9816('0xd5')]({},_0x21d322,_0x31b8f3[_0x9816('0x5f')]);return db[_0x9816('0xee')]['count']({'where':_0x21d322[_0x9816('0x42')]})['then'](function(_0x4c02a){_0x3f8638[_0x9816('0x2a')]=_0x4c02a;if(_0x31b8f3[_0x9816('0x45')][_0x9816('0x43')]){_0x21d322[_0x9816('0x44')]=[{'all':!![]}];}return db[_0x9816('0xee')][_0x9816('0x4b')](_0x21d322);})[_0x9816('0x18')](function(_0x3ab043){_0x3f8638[_0x9816('0x4c')]=_0x3ab043;return _0x3f8638;});}})['then'](respondWithFilteredResult(_0x7e5502,_0x21d322))[_0x9816('0x22')](handleError(_0x7e5502,null));};exports['getSmsInteractions']=function(_0x423d3f,_0xe2bf40){var _0x12a5e6={};var _0x27a240={};var _0x4e5fdc;var _0x14f94c;return db[_0x9816('0x4a')][_0x9816('0xcf')]({'where':{'id':_0x423d3f['params']['id']}})[_0x9816('0x18')](handleEntityNotFound(_0xe2bf40,null))[_0x9816('0x18')](function(_0x3d0c21){if(_0x3d0c21){_0x4e5fdc=_0x3d0c21;_0x27a240[_0x9816('0x58')]=_[_0x9816('0x5a')](db[_0x9816('0xef')]['rawAttributes']);_0x27a240[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x423d3f[_0x9816('0x45')]);_0x27a240[_0x9816('0x5b')]=_['intersection'](_0x27a240[_0x9816('0x58')],_0x27a240[_0x9816('0x45')]);_0x12a5e6[_0x9816('0x48')]=_['intersection'](_0x27a240[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x423d3f[_0x9816('0x45')][_0x9816('0x5d')]));_0x12a5e6[_0x9816('0x48')]=_0x12a5e6[_0x9816('0x48')][_0x9816('0x4e')]?_0x12a5e6[_0x9816('0x48')]:_0x27a240[_0x9816('0x58')];_0x12a5e6[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x423d3f['query']['sort']);_0x12a5e6[_0x9816('0x42')]=qs[_0x9816('0x5b')](_['pick'](_0x423d3f['query'],_0x27a240[_0x9816('0x5b')]));if(_0x423d3f[_0x9816('0x45')][_0x9816('0xd4')]){_0x12a5e6[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x12a5e6[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x12a5e6[_0x9816('0x48')],function(_0xb6fcff){var _0x5c32ae={};_0x5c32ae[_0xb6fcff]={'$like':'%'+_0x423d3f['query'][_0x9816('0xd4')]+'%'};return _0x5c32ae;})});}_0x12a5e6=_[_0x9816('0xd5')]({},_0x12a5e6,_0x423d3f['options']);return _0x4e5fdc[_0x9816('0xf0')](_0x12a5e6);}})[_0x9816('0x18')](function(_0x24a91b){if(_0x24a91b){_0x14f94c=_0x24a91b[_0x9816('0x4e')];if(!_0x423d3f[_0x9816('0x45')][_0x9816('0xd6')](_0x9816('0xdd'))){_0x12a5e6[_0x9816('0x29')]=qs['limit'](_0x423d3f[_0x9816('0x45')][_0x9816('0x29')]);_0x12a5e6[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x423d3f[_0x9816('0x45')]['offset']);}return _0x4e5fdc[_0x9816('0xf0')](_0x12a5e6);}})[_0x9816('0x18')](function(_0x41d166){if(_0x41d166){return _0x41d166?{'count':_0x14f94c,'rows':_0x41d166}:null;}})[_0x9816('0x18')](respondWithResult(_0xe2bf40,null))['catch'](handleError(_0xe2bf40,null));};exports[_0x9816('0xf1')]=function(_0x67d1a9,_0x5090c3){var _0x218a3f={};var _0x28aad7={};var _0x248224;var _0x27b0bd;return db[_0x9816('0x4a')][_0x9816('0xcf')]({'where':{'id':_0x67d1a9[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x5090c3,null))['then'](function(_0x2d44ee){if(_0x2d44ee){_0x248224=_0x2d44ee;_0x28aad7[_0x9816('0x58')]=_[_0x9816('0x5a')](db[_0x9816('0xf2')]['rawAttributes']);_0x28aad7[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x67d1a9['query']);_0x28aad7[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x28aad7[_0x9816('0x58')],_0x28aad7['query']);_0x218a3f['attributes']=_[_0x9816('0x5c')](_0x28aad7[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x67d1a9[_0x9816('0x45')][_0x9816('0x5d')]));_0x218a3f[_0x9816('0x48')]=_0x218a3f[_0x9816('0x48')][_0x9816('0x4e')]?_0x218a3f['attributes']:_0x28aad7['model'];_0x218a3f[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x67d1a9[_0x9816('0x45')][_0x9816('0xd2')]);_0x218a3f['where']=qs[_0x9816('0x5b')](_['pick'](_0x67d1a9[_0x9816('0x45')],_0x28aad7[_0x9816('0x5b')]));if(_0x67d1a9[_0x9816('0x45')][_0x9816('0xd4')]){_0x218a3f[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x218a3f[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x218a3f[_0x9816('0x48')],function(_0x4d89c3){var _0x26c451={};_0x26c451[_0x4d89c3]={'$like':'%'+_0x67d1a9[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x26c451;})});}_0x218a3f=_[_0x9816('0xd5')]({},_0x218a3f,_0x67d1a9['options']);return _0x248224[_0x9816('0xf1')](_0x218a3f);}})[_0x9816('0x18')](function(_0x5e85c6){if(_0x5e85c6){_0x27b0bd=_0x5e85c6[_0x9816('0x4e')];if(!_0x67d1a9[_0x9816('0x45')][_0x9816('0xd6')](_0x9816('0xdd'))){_0x218a3f['limit']=qs[_0x9816('0x29')](_0x67d1a9[_0x9816('0x45')][_0x9816('0x29')]);_0x218a3f[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x67d1a9[_0x9816('0x45')][_0x9816('0x27')]);}return _0x248224[_0x9816('0xf1')](_0x218a3f);}})['then'](function(_0x5ae479){if(_0x5ae479){return _0x5ae479?{'count':_0x27b0bd,'rows':_0x5ae479}:null;}})[_0x9816('0x18')](respondWithResult(_0x5090c3,null))[_0x9816('0x22')](handleError(_0x5090c3,null));};exports[_0x9816('0xf3')]=function(_0x3487bb,_0x2ed4c2){var _0x551816={};var _0x7a9863={};var _0x950401;var _0x64f109;return db['User'][_0x9816('0xcf')]({'where':{'id':_0x3487bb[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x2ed4c2,null))[_0x9816('0x18')](function(_0x5d5686){if(_0x5d5686){_0x950401=_0x5d5686;_0x7a9863[_0x9816('0x58')]=_[_0x9816('0x5a')](db[_0x9816('0xf4')][_0x9816('0x3c')]);_0x7a9863['query']=_[_0x9816('0x5a')](_0x3487bb[_0x9816('0x45')]);_0x7a9863['filters']=_[_0x9816('0x5c')](_0x7a9863[_0x9816('0x58')],_0x7a9863[_0x9816('0x45')]);_0x551816[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x7a9863[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x3487bb[_0x9816('0x45')][_0x9816('0x5d')]));_0x551816[_0x9816('0x48')]=_0x551816['attributes'][_0x9816('0x4e')]?_0x551816['attributes']:_0x7a9863[_0x9816('0x58')];_0x551816[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x3487bb['query'][_0x9816('0xd2')]);_0x551816[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x3487bb['query'],_0x7a9863[_0x9816('0x5b')]));if(_0x3487bb[_0x9816('0x45')]['filter']){_0x551816['where']=_[_0x9816('0xd5')](_0x551816[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x551816['attributes'],function(_0x5826ff){var _0x5ed961={};_0x5ed961[_0x5826ff]={'$like':'%'+_0x3487bb[_0x9816('0x45')]['filter']+'%'};return _0x5ed961;})});}_0x551816=_[_0x9816('0xd5')]({},_0x551816,_0x3487bb[_0x9816('0x5f')]);return _0x950401[_0x9816('0xf3')](_0x551816);}})[_0x9816('0x18')](function(_0x3aee39){if(_0x3aee39){_0x64f109=_0x3aee39[_0x9816('0x4e')];if(!_0x3487bb[_0x9816('0x45')][_0x9816('0xd6')]('nolimit')){_0x551816[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x3487bb[_0x9816('0x45')]['limit']);_0x551816[_0x9816('0x27')]=qs['offset'](_0x3487bb[_0x9816('0x45')][_0x9816('0x27')]);}return _0x950401[_0x9816('0xf3')](_0x551816);}})[_0x9816('0x18')](function(_0x4918b6){if(_0x4918b6){return _0x4918b6?{'count':_0x64f109,'rows':_0x4918b6}:null;}})[_0x9816('0x18')](respondWithResult(_0x2ed4c2,null))[_0x9816('0x22')](handleError(_0x2ed4c2,null));};exports[_0x9816('0xf5')]=function(_0x26c58f,_0x566bb8,_0xbefb6f){var _0xcf9d89;var _0x153ef7;var _0x23ab9a;var _0xe236fc=!_[_0x9816('0x6b')](_0x26c58f[_0x9816('0x57')]['id'])?_0x26c58f['params']['id']:!_[_0x9816('0x6b')](_0x26c58f[_0x9816('0x33')]['id'])?_0x26c58f['user']['id']:null;return db['User']['find']({'where':{'id':_0xe236fc,'role':{'$or':['admin','user','agent']}},'attributes':['id',_0x9816('0x39'),_0x9816('0xf6'),'mobile','role',_0x9816('0x6a'),_0x9816('0xf7')]})[_0x9816('0x18')](function(_0x5896e7){if(_0x5896e7){if(_0x5896e7[_0x9816('0x30')]===_0x9816('0x34')){_0xcf9d89=_0x5896e7;if(_0x26c58f[_0x9816('0x61')][_0x9816('0xa1')]){_0x23ab9a=util[_0x9816('0xae')]('LOCAL/%s@from-sip/n',_0xcf9d89[_0x26c58f['body']['interface']]);}else if(_0x26c58f[_0x9816('0x61')]['intrf']){_0x23ab9a=util[_0x9816('0xae')](_0x9816('0xf8'),_0x26c58f[_0x9816('0x61')][_0x9816('0xf9')]);}else{_0x23ab9a=util[_0x9816('0xae')](_0x9816('0xf8'),_0xcf9d89[_0x9816('0x39')]);}socket['to'](util['format'](_0x9816('0xfa'),_0xcf9d89[_0x9816('0x39')]))['emit'](_0x9816('0xfb'),{'user':{'id':_0xcf9d89['id'],'name':_0xcf9d89[_0x9816('0x39')]},'ip':_0x26c58f[_0x9816('0xfc')]['x-forwarded-for']||_0x26c58f[_0x9816('0xfd')][_0x9816('0xfe')]||_0x26c58f[_0x9816('0xff')][_0x9816('0xfe')]||_0x26c58f[_0x9816('0xfd')]['socket'][_0x9816('0xfe')]});return db[_0x9816('0xb0')]['destroy']({'where':{'membername':_0xcf9d89[_0x9816('0x39')]},'individualHooks':!![]});}}else{throw new db[(_0x9816('0x94'))][(_0x9816('0x95'))](_0x9816('0x100'));}})[_0x9816('0x18')](function(){if(_0xcf9d89){return _0xcf9d89[_0x9816('0x101')]({'raw':!![]});}})[_0x9816('0x18')](function(_0x377d79){if(_0xcf9d89){var _0x1569f3=[];if(_0x377d79){_0x153ef7=_0x377d79;if(_0x153ef7[_0x9816('0x4e')]){for(var _0x19548e=0x0;_0x19548e<_0x153ef7['length'];_0x19548e++){_0x1569f3['push']({'membername':_0xcf9d89[_0x9816('0x39')],'UserId':_0xcf9d89['id'],'queue_name':_0x153ef7[_0x19548e][_0x9816('0x39')],'VoiceQueueId':_0x153ef7[_0x19548e]['id'],'interface':_0x23ab9a,'paused':_0xcf9d89[_0x9816('0xf7')]||![],'penalty':_0x153ef7[_0x19548e][_0x9816('0x102')]||0x0});}return BPromise[_0x9816('0x8e')](_0x1569f3,function(_0x183efb){return db[_0x9816('0xb0')][_0x9816('0xb1')](_0x183efb);});}}}})['then'](function(){if(_0xcf9d89){return db[_0x9816('0x103')][_0x9816('0x4b')]({'where':{'membername':_0xcf9d89[_0x9816('0x39')],'exitAt':null}});}})[_0x9816('0x18')](function(_0x1c810b){if(_0xcf9d89){var _0x34d7d0=[];_0x1c810b[_0x9816('0x104')](function(_0x48fff9){_0x34d7d0[_0x9816('0x49')](_0x48fff9['update']({'exitAt':moment()[_0x9816('0xae')](_0x9816('0x105'))}));});return BPromise[_0x9816('0x60')](_0x34d7d0);}})[_0x9816('0x18')](function(){if(_0xcf9d89){var _0x4e9542=[];var _0x2cc841=[];var _0x3a0a29=utils[_0x9816('0x106')]();var _0x13b695={'membername':_0xcf9d89[_0x9816('0x39')],'interface':_0x23ab9a,'enterAt':moment()[_0x9816('0xae')](_0x9816('0x105')),'role':_0xcf9d89[_0x9816('0x30')],'internal':_0xcf9d89[_0x9816('0x6a')]};_0x3a0a29[_0x9816('0x104')](function(_0x4e2f89){_0x4e9542['push'](_[_0x9816('0xd5')]({'channel':_0x4e2f89,'type':_0x9816('0x107'),'data1':_0x26c58f['body'][_0x9816('0x108')],'data2':_0x23ab9a},_0x13b695));if(_0xcf9d89[_0x9816('0xf7')]){_0x2cc841[_0x9816('0x49')](_[_0x9816('0xd5')]({'channel':_0x4e2f89,'type':_0x9816('0x109'),'data1':'LOGININPAUSE'},_0x13b695));}});return db[_0x9816('0x103')][_0x9816('0x10a')](_0x4e9542[_0x9816('0xcd')](_0x2cc841),{'individualHooks':!![]});}})['then'](function(){if(_0xcf9d89){return _0xcf9d89['update']({'online':!![],'lastLoginAt':moment()[_0x9816('0xae')](_0x9816('0x105')),'voicePause':_0xcf9d89['loginInPause']||![],'mailPause':_0xcf9d89[_0x9816('0xf7')]||![],'chatPause':_0xcf9d89[_0x9816('0xf7')]||![],'faxPause':_0xcf9d89[_0x9816('0xf7')]||![],'smsPause':_0xcf9d89['loginInPause']||![],'openchannelPause':_0xcf9d89[_0x9816('0xf7')]||![],'whatsappPause':_0xcf9d89[_0x9816('0xf7')]||![],'pauseType':_0xcf9d89['loginInPause']?'LOGININPAUSE':null,'interface':_0x23ab9a,'lastPauseAt':moment()['format'](_0x9816('0x105'))});}})[_0x9816('0x18')](function(_0x36d10b){if(_0x26c58f[_0x9816('0x10b')]){return _0xbefb6f();}else{return BPromise[_0x9816('0x10c')](_0x36d10b)[_0x9816('0x18')](respondWithResult(_0x566bb8,null));}})[_0x9816('0x22')](handleError(_0x566bb8,null));};exports['logout']=function(_0x5235d7,_0x479004){var _0x33123f;return db['User'][_0x9816('0x38')]({'where':{'id':_0x5235d7[_0x9816('0x57')]['id'],'role':_0x9816('0x34')},'attributes':['id',_0x9816('0x39'),_0x9816('0x30')]})[_0x9816('0x18')](handleEntityNotFound(_0x479004,null))[_0x9816('0x18')](function(_0x5c9a26){if(_0x5c9a26){_0x33123f=_0x5c9a26;return db['UserVoiceQueueRt'][_0x9816('0x2e')]({'where':{'membername':_0x33123f[_0x9816('0x39')]},'individualHooks':!![]});}})[_0x9816('0x18')](function(){return db[_0x9816('0x103')]['findAll']({'where':{'membername':_0x33123f['name'],'exitAt':null}});})[_0x9816('0x18')](function(_0xb0d72b){var _0x4a9a9f=[];_0xb0d72b[_0x9816('0x104')](function(_0x32fd28){_0x4a9a9f['push'](_0x32fd28[_0x9816('0x2d')]({'exitAt':moment()[_0x9816('0xae')](_0x9816('0x105'))}));});return BPromise[_0x9816('0x60')](_0x4a9a9f);})[_0x9816('0x18')](function(){return _0x33123f[_0x9816('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x9816('0x18')](respondWithResult(_0x479004,null))[_0x9816('0x22')](handleError(_0x479004,null));};exports['pause']=function(_0x304e11,_0x5cf568){var _0x1145f1;return db[_0x9816('0xb0')][_0x9816('0x2d')]({'paused':0x1},{'where':{'UserId':_0x304e11['params']['id']},'individualHooks':!![]})[_0x9816('0x18')](function(){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x304e11[_0x9816('0x57')]['id'],'role':'agent'},'attributes':['id',_0x9816('0x39'),'role',_0x9816('0x6a'),'interface']});})[_0x9816('0x18')](handleEntityNotFound(_0x5cf568,null))[_0x9816('0x18')](function(_0x4b99a1){if(_0x4b99a1){_0x1145f1=_0x4b99a1;return respondWithRpcPromise(_0x9816('0x10d'),'pause',{'id':_0x1145f1['id'],'name':_0x1145f1['name'],'pause':!![]});}})[_0x9816('0x18')](function(){if(_0x1145f1){return db[_0x9816('0x103')]['findAll']({'where':{'membername':_0x1145f1[_0x9816('0x39')],'type':'PAUSE','exitAt':null}});}})[_0x9816('0x18')](function(_0x3b1061){if(_0x3b1061[_0x9816('0x4e')]){var _0x2ac8c7=moment()['format'](_0x9816('0x105'));for(var _0x2a528b=0x0,_0x5a5733=_0x3b1061[_0x9816('0x4e')];_0x2a528b<_0x5a5733;_0x2a528b++){_0x3b1061[_0x2a528b][_0x9816('0x10e')]({'exitAt':_0x2ac8c7});}}})[_0x9816('0x18')](function(){var _0x4b2e6d=[];var _0x20ac0c=utils[_0x9816('0x106')]();_0x20ac0c[_0x9816('0x104')](function(_0x27c43a){_0x4b2e6d[_0x9816('0x49')]({'channel':_0x27c43a,'membername':_0x1145f1[_0x9816('0x39')],'interface':_[_0x9816('0x6b')](_0x1145f1[_0x9816('0xa1')])?util[_0x9816('0xae')](_0x9816('0xf8'),_0x1145f1[_0x9816('0x39')]):_0x1145f1[_0x9816('0xa1')],'type':_0x9816('0x109'),'enterAt':moment()[_0x9816('0xae')](_0x9816('0x105')),'data1':_0x304e11[_0x9816('0x61')][_0x9816('0x3d')]||'DEFAULT\x20PAUSE','role':_0x1145f1[_0x9816('0x30')],'internal':_0x1145f1[_0x9816('0x6a')]});});return db[_0x9816('0x103')][_0x9816('0x10a')](_0x4b2e6d,{'individualHooks':!![]});})[_0x9816('0x18')](function(){return _0x1145f1[_0x9816('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x304e11[_0x9816('0x61')]['type']||_0x9816('0x10f'),'lastPauseAt':moment()['format'](_0x9816('0x105'))});})[_0x9816('0x18')](respondWithResult(_0x5cf568,null))[_0x9816('0x22')](handleError(_0x5cf568,null));};exports[_0x9816('0x110')]=function(_0x8edef3,_0x4760f1){var _0x1ee994;return db[_0x9816('0x4a')]['find']({'where':{'id':_0x8edef3['params']['id']},'attributes':['id',_0x9816('0x39'),_0x9816('0x30'),_0x9816('0xaf'),_0x9816('0x111'),_0x9816('0x112'),'faxPause',_0x9816('0x113'),_0x9816('0x114'),_0x9816('0x115'),_0x9816('0x116'),_0x9816('0x117')]})['then'](handleEntityNotFound(_0x4760f1,null))[_0x9816('0x18')](function(_0x581150){if(_0x581150){_0x1ee994=_0x581150;if(_0x8edef3['body']['channel']&&!utils[_0x9816('0xa2')](_0x8edef3[_0x9816('0x61')][_0x9816('0xb3')])){throw new db[(_0x9816('0x94'))][(_0x9816('0x95'))]('Unknown\x20channel');}switch(_0x8edef3[_0x9816('0x61')][_0x9816('0xb3')]){case _0x9816('0xac'):return respondWithRpcPromise(_0x9816('0x10d'),'unpause',{'id':_0x1ee994['id'],'name':_0x1ee994[_0x9816('0x39')],'pause':![]})[_0x9816('0x18')](function(){return db[_0x9816('0xb0')][_0x9816('0x2d')]({'paused':0x0},{'where':{'UserId':_0x1ee994['id']},'individualHooks':!![]});})[_0x9816('0x18')](function(){return db[_0x9816('0x103')]['find']({'where':{'channel':_0x8edef3['body'][_0x9816('0xb3')],'membername':_0x1ee994['name'],'type':_0x9816('0x109'),'exitAt':null}});})['then'](function(_0x3b4213){if(_0x3b4213){return _0x3b4213['update']({'exitAt':moment()['format'](_0x9816('0x105')),'data2':_0x9816('0x118')},{'individualHooks':!![]});}return null;})[_0x9816('0x18')](function(){return _0x1ee994[_0x9816('0x2d')]({'voicePause':![]});});case _0x9816('0x53'):case _0x9816('0x4f'):case _0x9816('0x52'):case _0x9816('0x50'):case'whatsapp':case _0x9816('0x54'):return db['MemberReport'][_0x9816('0x38')]({'where':{'channel':_0x8edef3[_0x9816('0x61')][_0x9816('0xb3')],'membername':_0x1ee994['name'],'type':_0x9816('0x109'),'exitAt':null}})[_0x9816('0x18')](function(_0x4e822b){if(_0x4e822b){return _0x4e822b[_0x9816('0x2d')]({'exitAt':moment()[_0x9816('0xae')](_0x9816('0x105')),'data2':_0x9816('0x118')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x54b3e8={};_[_0x9816('0x2b')](_0x54b3e8,util[_0x9816('0xae')](_0x9816('0x119'),_0x8edef3[_0x9816('0x61')][_0x9816('0xb3')],_0x9816('0x11a')),![]);return _0x1ee994['update'](_0x54b3e8);});default:return respondWithRpcPromise('QueuePause',_0x9816('0x110'),{'id':_0x1ee994['id'],'name':_0x1ee994[_0x9816('0x39')],'pause':![]})[_0x9816('0x18')](function(){return db[_0x9816('0xb0')]['update']({'paused':0x0},{'where':{'UserId':_0x1ee994['id']}});})[_0x9816('0x18')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x1ee994[_0x9816('0x39')],'type':_0x9816('0x109'),'exitAt':null}});})['then'](function(_0x1b7d0f){var _0x2baa71=[];_0x1b7d0f[_0x9816('0x104')](function(_0x5c5671){_0x2baa71[_0x9816('0x49')](_0x5c5671['update']({'exitAt':moment()[_0x9816('0xae')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x9816('0x118')}));});return BPromise[_0x9816('0x60')](_0x2baa71);})[_0x9816('0x18')](function(){return _0x1ee994[_0x9816('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x9816('0x18')](respondWithResult(_0x4760f1,null))[_0x9816('0x22')](handleError(_0x4760f1,null));};exports[_0x9816('0x11b')]=function(_0x24201f,_0x11fdab){var _0x628678={};var _0x37725f={};var _0x749837;var _0x5a6c5a;return db['User']['findOne']({'where':{'id':_0x24201f['params']['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x11fdab,null))[_0x9816('0x18')](function(_0x2fa18b){if(_0x2fa18b){_0x749837=_0x2fa18b;_0x37725f['model']=_[_0x9816('0x5a')](db[_0x9816('0x11c')][_0x9816('0x3c')]);_0x37725f['query']=_[_0x9816('0x5a')](_0x24201f[_0x9816('0x45')]);_0x37725f['filters']=_[_0x9816('0x5c')](_0x37725f[_0x9816('0x58')],_0x37725f['query']);_0x628678['attributes']=_[_0x9816('0x5c')](_0x37725f[_0x9816('0x58')],qs['fields'](_0x24201f[_0x9816('0x45')]['fields']));_0x628678['attributes']=_0x628678[_0x9816('0x48')]['length']?_0x628678['attributes']:_0x37725f['model'];_0x628678[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x24201f[_0x9816('0x45')][_0x9816('0xd2')]);_0x628678['where']=qs[_0x9816('0x5b')](_['pick'](_0x24201f['query'],_0x37725f['filters']));if(_0x24201f[_0x9816('0x45')]['filter']){_0x628678['where']=_[_0x9816('0xd5')](_0x628678[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x628678[_0x9816('0x48')],function(_0x58580d){var _0x3909d4={};_0x3909d4[_0x58580d]={'$like':'%'+_0x24201f['query']['filter']+'%'};return _0x3909d4;})});}_0x628678=_[_0x9816('0xd5')]({},_0x628678,_0x24201f[_0x9816('0x5f')]);return _0x749837[_0x9816('0x11b')](_0x628678);}})[_0x9816('0x18')](function(_0x53a65a){if(_0x53a65a){_0x5a6c5a=_0x53a65a[_0x9816('0x4e')];if(!_0x24201f[_0x9816('0x45')][_0x9816('0xd6')]('nolimit')){_0x628678['limit']=qs[_0x9816('0x29')](_0x24201f[_0x9816('0x45')][_0x9816('0x29')]);_0x628678[_0x9816('0x27')]=qs['offset'](_0x24201f[_0x9816('0x45')][_0x9816('0x27')]);}return _0x749837[_0x9816('0x11b')](_0x628678);}})['then'](function(_0x2f69cf){if(_0x2f69cf){return _0x2f69cf?{'count':_0x5a6c5a,'rows':_0x2f69cf}:null;}})[_0x9816('0x18')](respondWithResult(_0x11fdab,null))[_0x9816('0x22')](handleError(_0x11fdab,null));};exports['addTeams']=function(_0x579d76,_0xee31c7){return db['User'][_0x9816('0x38')]({'where':{'id':_0x579d76[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0xee31c7,null))[_0x9816('0x18')](function(_0x414a94){if(_0x414a94){var _0x4264a8=_0x414a94[_0x9816('0x2f')]({'plain':!![]});return _0x414a94[_0x9816('0x11d')](_0x579d76[_0x9816('0x61')][_0x9816('0x65')],_[_0x9816('0x64')](_0x579d76[_0x9816('0x61')],['ids','id'])||{})[_0x9816('0x18')](function(){for(var _0x21d7d0=0x0;_0x21d7d0<_0x579d76[_0x9816('0x61')][_0x9816('0x65')][_0x9816('0x4e')];_0x21d7d0++){var _0x3887bc=[];var _0x345a36={};db[_0x9816('0x11c')][_0x9816('0xcf')]({'where':{'id':_0x579d76['body'][_0x9816('0x65')][_0x21d7d0]}})[_0x9816('0x18')](function(_0x5541d6){_0x345a36=_0x5541d6[_0x9816('0x51')];_0x3887bc['push'](_0x5541d6['getVoiceQueues']()[_0x9816('0x18')](function(_0x3f0957){for(var _0x57382f=0x0;_0x57382f<_0x3f0957[_0x9816('0x4e')];_0x57382f++){_0x3f0957[_0x57382f][_0x9816('0x11e')]('channel','Voice');}return _0x3f0957;}));_0x3887bc['push'](_0x5541d6[_0x9816('0x11f')]()[_0x9816('0x18')](function(_0x518f33){for(var _0x50242a=0x0;_0x50242a<_0x518f33['length'];_0x50242a++){_0x518f33[_0x50242a][_0x9816('0x11e')](_0x9816('0xb3'),'Chat');}return _0x518f33;}));_0x3887bc[_0x9816('0x49')](_0x5541d6[_0x9816('0x120')]()[_0x9816('0x18')](function(_0x556aed){for(var _0x295d5f=0x0;_0x295d5f<_0x556aed[_0x9816('0x4e')];_0x295d5f++){_0x556aed[_0x295d5f][_0x9816('0x11e')](_0x9816('0xb3'),_0x9816('0x121'));}return _0x556aed;}));_0x3887bc[_0x9816('0x49')](_0x5541d6[_0x9816('0x122')]()[_0x9816('0x18')](function(_0x105215){for(var _0x1a5b1c=0x0;_0x1a5b1c<_0x105215[_0x9816('0x4e')];_0x1a5b1c++){_0x105215[_0x1a5b1c][_0x9816('0x11e')](_0x9816('0xb3'),_0x9816('0x123'));}return _0x105215;}));_0x3887bc[_0x9816('0x49')](_0x5541d6[_0x9816('0x124')]()[_0x9816('0x18')](function(_0x451585){for(var _0x3fe6a0=0x0;_0x3fe6a0<_0x451585[_0x9816('0x4e')];_0x3fe6a0++){_0x451585[_0x3fe6a0][_0x9816('0x11e')]('channel',_0x9816('0x125'));}return _0x451585;}));_0x3887bc[_0x9816('0x49')](_0x5541d6['getFaxQueues']()[_0x9816('0x18')](function(_0x5a85ef){for(var _0x1a86d4=0x0;_0x1a86d4<_0x5a85ef[_0x9816('0x4e')];_0x1a86d4++){_0x5a85ef[_0x1a86d4][_0x9816('0x11e')](_0x9816('0xb3'),_0x9816('0x126'));}return _0x5a85ef;}));_0x3887bc[_0x9816('0x49')](_0x5541d6[_0x9816('0x127')]()[_0x9816('0x18')](function(_0x2188b3){for(var _0x4d2273=0x0;_0x4d2273<_0x2188b3[_0x9816('0x4e')];_0x4d2273++){_0x2188b3[_0x4d2273][_0x9816('0x11e')](_0x9816('0xb3'),_0x9816('0x128'));}return _0x2188b3;}));return BPromise[_0x9816('0x60')](_0x3887bc);})[_0x9816('0x18')](function(_0x4a3253){var _0x2b5580=_[_0x9816('0x129')](_0x4a3253);_0x3887bc=[];return db['sequelize'][_0x9816('0x12a')](function(_0x1fb6e9){for(var _0x2304f7=0x0;_0x2304f7<_0x2b5580[_0x9816('0x4e')];_0x2304f7++){_0x3887bc[_0x9816('0x49')](_0x2b5580[_0x2304f7][_0x9816('0x12b')](_0x4264a8['id']),{'transaction':_0x1fb6e9});}return BPromise[_0x9816('0x60')](_0x3887bc)['then'](function(){if(_0x4264a8[_0x9816('0xa0')]){return BPromise[_0x9816('0x8e')](_[_0x9816('0xd4')](_0x2b5580,function(_0x3d76a2){return _0x3d76a2[_0x9816('0x12c')](_0x9816('0xb3'))===_0x9816('0x12d');}),function(_0x351cc5){return db[_0x9816('0xb0')][_0x9816('0xb1')]({'membername':_0x4264a8['name'],'UserId':_0x4264a8['id'],'queue_name':_0x351cc5[_0x9816('0x39')],'VoiceQueueId':_0x351cc5['id'],'interface':_[_0x9816('0x6b')](_0x4264a8[_0x9816('0xa1')])?util[_0x9816('0xae')](_0x9816('0xf8'),_0x4264a8[_0x9816('0x39')]):_0x4264a8[_0x9816('0xa1')],'paused':_0x4264a8[_0x9816('0xaf')]||![],'penalty':_0x4264a8[_0x9816('0xa8')]},{'transaction':_0x1fb6e9});});}else{return;}})[_0x9816('0x18')](function(){for(var _0x45b500=0x0;_0x45b500<_0x2b5580['length'];_0x45b500++){var _0x30f5fa=_0x2b5580[_0x45b500][_0x9816('0x12c')](_0x9816('0xb3'));var _0x19fbaf=_0x30f5fa+_0x9816('0xaa');socket[_0x9816('0xb6')](_0x9816('0x33')+_0x30f5fa+_0x9816('0xab'),{'UserId':_0x4264a8['id'],['queueField']:_0x2b5580[_0x45b500]['id']});}});});})[_0x9816('0x18')](function(){db[_0x9816('0x12e')][_0x9816('0xcf')]({'where':{'teamId':_0x345a36['id']}})[_0x9816('0x18')](function(_0x1cef72){if(_0x1cef72){db[_0x9816('0x12f')][_0x9816('0x89')]({'UserId':_0x579d76['params']['id'],'VoicePrefixId':_0x1cef72[_0x9816('0x130')]});}});});}});}})['then'](respondWithStatusCode(_0xee31c7,null))[_0x9816('0x22')](handleError(_0xee31c7,null));};exports[_0x9816('0x131')]=function(_0x3adb17,_0xaa08bc){return db[_0x9816('0x4a')][_0x9816('0xcf')]({'where':{'id':_0x3adb17[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0xaa08bc,null))[_0x9816('0x18')](function(_0x1047f2){if(_0x1047f2){var _0x4feda0=_0x1047f2[_0x9816('0x2f')]({'plain':!![]});var _0x90261c=_0x3adb17[_0x9816('0x45')]['ids'];return _0x1047f2['removeTeams'](_0x90261c)[_0x9816('0x18')](function(){for(var _0x4dab49=0x0;_0x4dab49<_0x90261c[_0x9816('0x4e')];_0x4dab49++){var _0x2490fb=[];var _0x4dbd24={};db['Team'][_0x9816('0xcf')]({'where':{'id':_0x90261c[_0x4dab49]}})[_0x9816('0x18')](function(_0x1069fb){_0x4dbd24=_0x1069fb[_0x9816('0x51')];_0x2490fb['push'](_0x1069fb[_0x9816('0x101')]()[_0x9816('0x18')](function(_0x1e46ef){for(var _0x4dd073=0x0;_0x4dd073<_0x1e46ef[_0x9816('0x4e')];_0x4dd073++){_0x1e46ef[_0x4dd073][_0x9816('0x11e')]('channel',_0x9816('0x12d'));}return _0x1e46ef;}));_0x2490fb[_0x9816('0x49')](_0x1069fb[_0x9816('0x11f')]()[_0x9816('0x18')](function(_0x337479){for(var _0x19247f=0x0;_0x19247f<_0x337479['length'];_0x19247f++){_0x337479[_0x19247f]['setDataValue']('channel','Chat');}return _0x337479;}));_0x2490fb[_0x9816('0x49')](_0x1069fb[_0x9816('0x120')]()[_0x9816('0x18')](function(_0x606b00){for(var _0x2444df=0x0;_0x2444df<_0x606b00[_0x9816('0x4e')];_0x2444df++){_0x606b00[_0x2444df][_0x9816('0x11e')](_0x9816('0xb3'),_0x9816('0x121'));}return _0x606b00;}));_0x2490fb[_0x9816('0x49')](_0x1069fb[_0x9816('0x122')]()['then'](function(_0x30127f){for(var _0x3eb8c8=0x0;_0x3eb8c8<_0x30127f['length'];_0x3eb8c8++){_0x30127f[_0x3eb8c8][_0x9816('0x11e')]('channel',_0x9816('0x123'));}return _0x30127f;}));_0x2490fb[_0x9816('0x49')](_0x1069fb[_0x9816('0x124')]()[_0x9816('0x18')](function(_0x5b4531){for(var _0x2c2c9d=0x0;_0x2c2c9d<_0x5b4531['length'];_0x2c2c9d++){_0x5b4531[_0x2c2c9d][_0x9816('0x11e')]('channel','Whatsapp');}return _0x5b4531;}));_0x2490fb[_0x9816('0x49')](_0x1069fb['getFaxQueues']()[_0x9816('0x18')](function(_0x34a52d){for(var _0x46e5f0=0x0;_0x46e5f0<_0x34a52d[_0x9816('0x4e')];_0x46e5f0++){_0x34a52d[_0x46e5f0][_0x9816('0x11e')](_0x9816('0xb3'),_0x9816('0x126'));}return _0x34a52d;}));_0x2490fb[_0x9816('0x49')](_0x1069fb['getOpenchannelQueues']()[_0x9816('0x18')](function(_0x558653){for(var _0x3c4dd6=0x0;_0x3c4dd6<_0x558653['length'];_0x3c4dd6++){_0x558653[_0x3c4dd6]['setDataValue']('channel',_0x9816('0x128'));}return _0x558653;}));return BPromise['all'](_0x2490fb);})[_0x9816('0x18')](function(_0x442383){var _0x1c8a7e=_['flatten'](_0x442383);_0x2490fb=[];return db[_0x9816('0x6d')][_0x9816('0x12a')](function(_0x37d02e){for(var _0x4ad3b1=0x0;_0x4ad3b1<_0x1c8a7e['length'];_0x4ad3b1++){_0x2490fb[_0x9816('0x49')](_0x1c8a7e[_0x4ad3b1]['removeAgent'](_0x4feda0['id']),{'transaction':_0x37d02e});}return BPromise[_0x9816('0x60')](_0x2490fb)[_0x9816('0x18')](function(){if(_0x4feda0[_0x9816('0xa0')]){return BPromise[_0x9816('0x8e')](_[_0x9816('0xd4')](_0x1c8a7e,function(_0x56ec49){return _0x56ec49[_0x9816('0x12c')](_0x9816('0xb3'))==='Voice';}),function(_0x4bd75c){return db['UserVoiceQueueRt'][_0x9816('0x2e')]({'where':{'VoiceQueueId':_0x4bd75c['id'],'UserId':_0x4feda0['id']},'transaction':_0x37d02e});});}else{return;}})[_0x9816('0x18')](function(){db['TeamVoicePrefix'][_0x9816('0xcf')]({'where':{'teamId':_0x4dbd24['id']}})['then'](function(_0xd400cd){if(_0xd400cd){return db[_0x9816('0x12f')]['destroy']({'where':{'UserId':_0x4feda0['id'],'VoicePrefixId':_0xd400cd[_0x9816('0x51')][_0x9816('0x130')]}});}});})[_0x9816('0x18')](function(){for(var _0xf4d6ff=0x0;_0xf4d6ff<_0x1c8a7e['length'];_0xf4d6ff++){var _0x3b01f8=_0x1c8a7e[_0xf4d6ff][_0x9816('0x12c')]('channel');var _0x56a214=_0x3b01f8+'QueueId';socket['emit']('user'+_0x3b01f8+_0x9816('0xb7'),{'UserId':_0x4feda0['id'],['queueField']:_0x1c8a7e[_0xf4d6ff]['id']});}});});});}});}})[_0x9816('0x18')](respondWithStatusCode(_0xaa08bc,null))['catch'](handleError(_0xaa08bc,null));};exports[_0x9816('0x132')]=function(_0x265fbc,_0x3f9403){var _0x4ca945={};var _0x2256d2={};var _0x56ab84;var _0xc150c6;return db[_0x9816('0x4a')][_0x9816('0xcf')]({'where':{'id':_0x265fbc['params']['id']}})['then'](handleEntityNotFound(_0x3f9403,null))['then'](function(_0x2e9732){if(_0x2e9732){_0x56ab84=_0x2e9732;_0x2256d2[_0x9816('0x58')]=_[_0x9816('0x5a')](db['CmList'][_0x9816('0x3c')]);_0x2256d2[_0x9816('0x45')]=_['keys'](_0x265fbc['query']);_0x2256d2['filters']=_[_0x9816('0x5c')](_0x2256d2['model'],_0x2256d2['query']);_0x4ca945[_0x9816('0x48')]=_['intersection'](_0x2256d2[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x265fbc['query']['fields']));_0x4ca945['attributes']=_0x4ca945[_0x9816('0x48')][_0x9816('0x4e')]?_0x4ca945[_0x9816('0x48')]:_0x2256d2[_0x9816('0x58')];_0x4ca945[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x265fbc[_0x9816('0x45')][_0x9816('0xd2')]);_0x4ca945[_0x9816('0x42')]=qs['filters'](_[_0x9816('0xd3')](_0x265fbc['query'],_0x2256d2[_0x9816('0x5b')]));if(_0x265fbc[_0x9816('0x45')]['filter']){_0x4ca945[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x4ca945[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x4ca945[_0x9816('0x48')],function(_0x2a1915){var _0xf044c2={};_0xf044c2[_0x2a1915]={'$like':'%'+_0x265fbc[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0xf044c2;})});}_0x4ca945=_[_0x9816('0xd5')]({},_0x4ca945,_0x265fbc[_0x9816('0x5f')]);return _0x56ab84[_0x9816('0x132')](_0x4ca945);}})[_0x9816('0x18')](function(_0x59ba47){if(_0x59ba47){_0xc150c6=_0x59ba47[_0x9816('0x4e')];if(!_0x265fbc['query'][_0x9816('0xd6')]('nolimit')){_0x4ca945[_0x9816('0x29')]=qs['limit'](_0x265fbc['query'][_0x9816('0x29')]);_0x4ca945[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x265fbc[_0x9816('0x45')]['offset']);}return _0x56ab84['getLists'](_0x4ca945);}})[_0x9816('0x18')](function(_0x2c7fb4){if(_0x2c7fb4){return _0x2c7fb4?{'count':_0xc150c6,'rows':_0x2c7fb4}:null;}})[_0x9816('0x18')](respondWithResult(_0x3f9403,null))[_0x9816('0x22')](handleError(_0x3f9403,null));};exports[_0x9816('0x133')]=function(_0xfb08b8,_0x1808dd){var _0x1bc33b={};var _0x154b2a={};var _0x55af59;return db['User']['findOne']({'where':{'id':_0xfb08b8[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x1808dd,null))['then'](function(_0x3f6377){if(_0x3f6377){_0x55af59=_0x3f6377;_0x154b2a[_0x9816('0x58')]=_[_0x9816('0x5a')](db['User'][_0x9816('0x3c')]);_0x154b2a[_0x9816('0x45')]=_[_0x9816('0x5a')](_0xfb08b8['query']);_0x154b2a[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x154b2a[_0x9816('0x58')],_0x154b2a[_0x9816('0x45')]);_0x1bc33b['attributes']=_[_0x9816('0x5c')](_0x154b2a[_0x9816('0x58')],qs[_0x9816('0x5d')](_0xfb08b8[_0x9816('0x45')][_0x9816('0x5d')]));_0x1bc33b['attributes']=_0x1bc33b['attributes'][_0x9816('0x4e')]?_0x1bc33b[_0x9816('0x48')]:_0x154b2a['model'];_0x1bc33b[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0xfb08b8['query']['sort']);_0x1bc33b[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0xfb08b8['query'],_0x154b2a['filters']));if(_0xfb08b8[_0x9816('0x45')][_0x9816('0xd4')]){_0x1bc33b[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x1bc33b[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x1bc33b[_0x9816('0x48')],function(_0xc33b59){var _0x192f5c={};_0x192f5c[_0xc33b59]={'$like':'%'+_0xfb08b8[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x192f5c;})});}_0x1bc33b[_0x9816('0x58')]=db[_0x9816('0x4a')];_0x1bc33b['as']=_0x9816('0x91');_0x1bc33b=_['merge']({},_0x1bc33b,_0xfb08b8[_0x9816('0x5f')]);return _0x55af59[_0x9816('0x101')]({'include':[_0x1bc33b]});}})[_0x9816('0x18')](function(_0x551a4c){if(_0x551a4c){var _0xb78444={},_0x1cd1e8=[];for(var _0x5027a0=0x0;_0x5027a0<_0x551a4c[_0x9816('0x4e')];_0x5027a0+=0x1){for(var _0x2f8026=0x0,_0x58ef50;_0x2f8026<_0x551a4c[_0x5027a0][_0x9816('0x91')]['length'];_0x2f8026+=0x1){_0x58ef50=_0x551a4c[_0x5027a0][_0x9816('0x91')][_0x2f8026][_0x9816('0x2f')]({'plain':!![]});_0xb78444[_0x58ef50['id']]=_0x58ef50;}}_0xb78444=_[_0x9816('0x134')](_0xb78444);for(var _0x3e02f0=qs[_0x9816('0x27')](_0xfb08b8[_0x9816('0x45')]['offset']);_0x3e02f0<_0xb78444[_0x9816('0x4e')]&&_0x1cd1e8[_0x9816('0x4e')]<qs[_0x9816('0x29')](_0xfb08b8[_0x9816('0x45')][_0x9816('0x29')]);_0x3e02f0+=0x1){if(_0xb78444[_0x3e02f0]){_0x1cd1e8[_0x9816('0x49')](_0xb78444[_0x3e02f0]);}}return{'count':_0xb78444[_0x9816('0x4e')],'rows':_0x1cd1e8};}})[_0x9816('0x18')](respondWithResult(_0x1808dd,null))['catch'](handleError(_0x1808dd,null));};exports['destroy']=function(_0x586cfe,_0x55c55b){if(_0x586cfe[_0x9816('0x33')]['id']==_0x586cfe[_0x9816('0x57')]['id']){return _0x55c55b[_0x9816('0x24')](0x1f4)[_0x9816('0x3b')]({'message':_0x9816('0x135')});}return db[_0x9816('0x4a')]['find']({'where':{'id':_0x586cfe['params']['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x55c55b,null))[_0x9816('0x18')](removeEntity(_0x55c55b,null))['catch'](handleError(_0x55c55b,null));};exports[_0x9816('0x136')]=function(_0x2132d1,_0x58e913){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x2132d1[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x58e913,null))[_0x9816('0x18')](function(_0xea79f8){if(_0xea79f8){return _0xea79f8[_0x9816('0x136')](_0x2132d1[_0x9816('0x61')]['ids'],_[_0x9816('0x64')](_0x2132d1['body'],[_0x9816('0x65'),'id'])||{})['spread'](function(){for(var _0x10f0ca=0x0;_0x10f0ca<_0x2132d1[_0x9816('0x61')][_0x9816('0x65')][_0x9816('0x4e')];_0x10f0ca+=0x1){socket[_0x9816('0xb6')](_0x9816('0x137'),{'ChatInteractionId':Number(_0x2132d1[_0x9816('0x61')][_0x9816('0x65')][_0x10f0ca]),'UserId':Number(_0x2132d1['params']['id'])});}return _0x2132d1['body']['ids'];});}})[_0x9816('0x18')](respondWithResult(_0x58e913,null))['catch'](handleError(_0x58e913,null));};exports['removeChatInteractions']=function(_0x5ea0f0,_0x560a4c){return db['User'][_0x9816('0x38')]({'where':{'id':_0x5ea0f0[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x560a4c,null))[_0x9816('0x18')](function(_0x2abb7e){if(_0x2abb7e){return _0x2abb7e[_0x9816('0x138')](_0x5ea0f0[_0x9816('0x45')][_0x9816('0x65')])['then'](function(){if(_[_0x9816('0xb5')](_0x5ea0f0[_0x9816('0x45')]['ids'])){for(var _0x44dba5=0x0;_0x44dba5<_0x5ea0f0['query']['ids'][_0x9816('0x4e')];_0x44dba5+=0x1){socket['emit'](_0x9816('0x139'),{'ChatInteractionId':Number(_0x5ea0f0[_0x9816('0x45')][_0x9816('0x65')][_0x44dba5]),'UserId':Number(_0x5ea0f0[_0x9816('0x57')]['id'])});}}else{socket[_0x9816('0xb6')](_0x9816('0x139'),{'ChatInteractionId':Number(_0x5ea0f0['query'][_0x9816('0x65')]),'UserId':Number(_0x5ea0f0[_0x9816('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x560a4c,null))[_0x9816('0x22')](handleError(_0x560a4c,null));};exports[_0x9816('0x13a')]=function(_0x4ff2b5,_0x205780){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x4ff2b5['params']['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x205780,null))['then'](function(_0x49b7b7){if(_0x49b7b7){return _0x49b7b7[_0x9816('0x13a')](_0x4ff2b5[_0x9816('0x61')][_0x9816('0x65')],_['omit'](_0x4ff2b5[_0x9816('0x61')],[_0x9816('0x65'),'id'])||{})['spread'](function(){for(var _0x4b867=0x0;_0x4b867<_0x4ff2b5[_0x9816('0x61')][_0x9816('0x65')]['length'];_0x4b867+=0x1){socket[_0x9816('0xb6')](_0x9816('0x13b'),{'MailInteractionId':Number(_0x4ff2b5[_0x9816('0x61')][_0x9816('0x65')][_0x4b867]),'UserId':Number(_0x4ff2b5[_0x9816('0x57')]['id'])});}return _0x4ff2b5[_0x9816('0x61')]['ids'];});}})[_0x9816('0x18')](respondWithResult(_0x205780,null))['catch'](handleError(_0x205780,null));};exports['removeMailInteractions']=function(_0x276133,_0xb97111){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x276133[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0xb97111,null))[_0x9816('0x18')](function(_0x4e3856){if(_0x4e3856){return _0x4e3856[_0x9816('0x13c')](_0x276133['query'][_0x9816('0x65')])['then'](function(){if(_[_0x9816('0xb5')](_0x276133[_0x9816('0x45')][_0x9816('0x65')])){for(var _0x5c0365=0x0;_0x5c0365<_0x276133[_0x9816('0x45')][_0x9816('0x65')]['length'];_0x5c0365+=0x1){socket[_0x9816('0xb6')](_0x9816('0x13d'),{'MailInteractionId':Number(_0x276133[_0x9816('0x45')][_0x9816('0x65')][_0x5c0365]),'UserId':Number(_0x276133[_0x9816('0x57')]['id'])});}}else{socket['emit'](_0x9816('0x13d'),{'MailInteractionId':Number(_0x276133[_0x9816('0x45')][_0x9816('0x65')]),'UserId':Number(_0x276133[_0x9816('0x57')]['id'])});}});}})[_0x9816('0x18')](respondWithStatusCode(_0xb97111,null))['catch'](handleError(_0xb97111,null));};exports[_0x9816('0x13e')]=function(_0x6a4c64,_0x23e6b5){return db['User']['find']({'where':{'id':_0x6a4c64[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x23e6b5,null))[_0x9816('0x18')](function(_0x5f1f61){if(_0x5f1f61){return _0x5f1f61['addFaxInteractions'](_0x6a4c64[_0x9816('0x61')][_0x9816('0x65')],_[_0x9816('0x64')](_0x6a4c64[_0x9816('0x61')],[_0x9816('0x65'),'id'])||{})[_0x9816('0xa9')](function(){for(var _0x27c79e=0x0;_0x27c79e<_0x6a4c64[_0x9816('0x61')][_0x9816('0x65')][_0x9816('0x4e')];_0x27c79e+=0x1){socket['emit'](_0x9816('0x13f'),{'FaxInteractionId':Number(_0x6a4c64['body']['ids'][_0x27c79e]),'UserId':Number(_0x6a4c64[_0x9816('0x57')]['id'])});}return _0x6a4c64[_0x9816('0x61')][_0x9816('0x65')];});}})[_0x9816('0x18')](respondWithResult(_0x23e6b5,null))[_0x9816('0x22')](handleError(_0x23e6b5,null));};exports[_0x9816('0x140')]=function(_0x2c4bc6,_0x45362a){return db[_0x9816('0x4a')]['find']({'where':{'id':_0x2c4bc6[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x45362a,null))[_0x9816('0x18')](function(_0x3c1626){if(_0x3c1626){return _0x3c1626[_0x9816('0x140')](_0x2c4bc6['query']['ids'])[_0x9816('0x18')](function(){if(_[_0x9816('0xb5')](_0x2c4bc6[_0x9816('0x45')][_0x9816('0x65')])){for(var _0x12aae8=0x0;_0x12aae8<_0x2c4bc6[_0x9816('0x45')][_0x9816('0x65')]['length'];_0x12aae8+=0x1){socket[_0x9816('0xb6')](_0x9816('0x141'),{'FaxInteractionId':Number(_0x2c4bc6[_0x9816('0x45')][_0x9816('0x65')][_0x12aae8]),'UserId':Number(_0x2c4bc6[_0x9816('0x57')]['id'])});}}else{socket[_0x9816('0xb6')](_0x9816('0x141'),{'FaxInteractionId':Number(_0x2c4bc6[_0x9816('0x45')]['ids']),'UserId':Number(_0x2c4bc6[_0x9816('0x57')]['id'])});}});}})[_0x9816('0x18')](respondWithStatusCode(_0x45362a,null))[_0x9816('0x22')](handleError(_0x45362a,null));};exports[_0x9816('0x142')]=function(_0x48ac40,_0x362677){return db['User'][_0x9816('0x38')]({'where':{'id':_0x48ac40[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x362677,null))['then'](function(_0x5d99b4){if(_0x5d99b4){return _0x5d99b4['addSmsInteractions'](_0x48ac40['body'][_0x9816('0x65')],_[_0x9816('0x64')](_0x48ac40['body'],[_0x9816('0x65'),'id'])||{})[_0x9816('0xa9')](function(){for(var _0x56b88c=0x0;_0x56b88c<_0x48ac40[_0x9816('0x61')][_0x9816('0x65')][_0x9816('0x4e')];_0x56b88c+=0x1){socket[_0x9816('0xb6')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x48ac40[_0x9816('0x61')][_0x9816('0x65')][_0x56b88c]),'UserId':Number(_0x48ac40[_0x9816('0x57')]['id'])});}return _0x48ac40['body'][_0x9816('0x65')];});}})['then'](respondWithResult(_0x362677,null))[_0x9816('0x22')](handleError(_0x362677,null));};exports['removeSmsInteractions']=function(_0x501513,_0x1d10db){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x501513[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x1d10db,null))[_0x9816('0x18')](function(_0x7b97a7){if(_0x7b97a7){return _0x7b97a7[_0x9816('0x143')](_0x501513[_0x9816('0x45')]['ids'])[_0x9816('0x18')](function(){if(_[_0x9816('0xb5')](_0x501513[_0x9816('0x45')][_0x9816('0x65')])){for(var _0x3d938c=0x0;_0x3d938c<_0x501513[_0x9816('0x45')][_0x9816('0x65')][_0x9816('0x4e')];_0x3d938c+=0x1){socket[_0x9816('0xb6')](_0x9816('0x144'),{'SmsInteractionId':Number(_0x501513['query']['ids'][_0x3d938c]),'UserId':Number(_0x501513['params']['id'])});}}else{socket[_0x9816('0xb6')](_0x9816('0x144'),{'SmsInteractionId':Number(_0x501513[_0x9816('0x45')][_0x9816('0x65')]),'UserId':Number(_0x501513['params']['id'])});}});}})[_0x9816('0x18')](respondWithStatusCode(_0x1d10db,null))['catch'](handleError(_0x1d10db,null));};exports[_0x9816('0x145')]=function(_0x3de7be,_0x11c558){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x3de7be[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x11c558,null))[_0x9816('0x18')](function(_0x2c4a59){if(_0x2c4a59){return _0x2c4a59[_0x9816('0x145')](_0x3de7be[_0x9816('0x61')][_0x9816('0x65')],_['omit'](_0x3de7be['body'],['ids','id'])||{})[_0x9816('0xa9')](function(){for(var _0x55f5dc=0x0;_0x55f5dc<_0x3de7be[_0x9816('0x61')]['ids'][_0x9816('0x4e')];_0x55f5dc+=0x1){socket[_0x9816('0xb6')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x3de7be[_0x9816('0x61')]['ids'][_0x55f5dc]),'UserId':Number(_0x3de7be[_0x9816('0x57')]['id'])});}return _0x3de7be[_0x9816('0x61')][_0x9816('0x65')];});}})[_0x9816('0x18')](respondWithResult(_0x11c558,null))[_0x9816('0x22')](handleError(_0x11c558,null));};exports[_0x9816('0x146')]=function(_0xcdadd0,_0x207846){return db['User'][_0x9816('0x38')]({'where':{'id':_0xcdadd0[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x207846,null))[_0x9816('0x18')](function(_0x5632b0){if(_0x5632b0){return _0x5632b0[_0x9816('0x146')](_0xcdadd0[_0x9816('0x45')]['ids'])['then'](function(){if(_[_0x9816('0xb5')](_0xcdadd0[_0x9816('0x45')]['ids'])){for(var _0x26c4db=0x0;_0x26c4db<_0xcdadd0[_0x9816('0x45')][_0x9816('0x65')][_0x9816('0x4e')];_0x26c4db+=0x1){socket[_0x9816('0xb6')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xcdadd0['query'][_0x9816('0x65')][_0x26c4db]),'UserId':Number(_0xcdadd0[_0x9816('0x57')]['id'])});}}else{socket[_0x9816('0xb6')](_0x9816('0x147'),{'OpenchannelInteractionId':Number(_0xcdadd0[_0x9816('0x45')]['ids']),'UserId':Number(_0xcdadd0[_0x9816('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x207846,null))[_0x9816('0x22')](handleError(_0x207846,null));};exports[_0x9816('0x148')]=function(_0x5850ee,_0x14c879){return db['User']['find']({'where':{'id':_0x5850ee[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x14c879,null))[_0x9816('0x18')](function(_0x417b33){if(_0x417b33){return _0x417b33[_0x9816('0x148')](_0x5850ee[_0x9816('0x61')]['ids'],_[_0x9816('0x64')](_0x5850ee[_0x9816('0x61')],[_0x9816('0x65'),'id'])||{})['spread'](function(){for(var _0x4444a5=0x0;_0x4444a5<_0x5850ee[_0x9816('0x61')][_0x9816('0x65')][_0x9816('0x4e')];_0x4444a5+=0x1){socket[_0x9816('0xb6')](_0x9816('0x149'),{'WhatsappInteractionId':Number(_0x5850ee[_0x9816('0x61')][_0x9816('0x65')][_0x4444a5]),'UserId':Number(_0x5850ee[_0x9816('0x57')]['id'])});}return _0x5850ee['body'][_0x9816('0x65')];});}})['then'](respondWithResult(_0x14c879,null))[_0x9816('0x22')](handleError(_0x14c879,null));};exports[_0x9816('0x14a')]=function(_0x1aa9f7,_0x938789){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x1aa9f7[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x938789,null))[_0x9816('0x18')](function(_0x7ab495){if(_0x7ab495){return _0x7ab495[_0x9816('0x14a')](_0x1aa9f7[_0x9816('0x45')]['ids']);}})[_0x9816('0x18')](respondWithStatusCode(_0x938789,null))[_0x9816('0x22')](handleError(_0x938789,null));};exports[_0x9816('0x14b')]=function(_0x4cb62b,_0x1136b8){var _0x182157={};var _0x28001c={};var _0x5a2550;var _0x374759;return db[_0x9816('0x4a')][_0x9816('0xcf')]({'where':{'id':_0x4cb62b[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x1136b8,null))[_0x9816('0x18')](function(_0x63b3b8){if(_0x63b3b8){_0x5a2550=_0x63b3b8;_0x28001c[_0x9816('0x58')]=_['keys'](db[_0x9816('0x14c')]['rawAttributes']);_0x28001c[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x4cb62b['query']);_0x28001c[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x28001c[_0x9816('0x58')],_0x28001c[_0x9816('0x45')]);_0x182157[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x28001c[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x4cb62b[_0x9816('0x45')][_0x9816('0x5d')]));_0x182157[_0x9816('0x48')]=_0x182157[_0x9816('0x48')][_0x9816('0x4e')]?_0x182157[_0x9816('0x48')]:_0x28001c[_0x9816('0x58')];_0x182157[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x4cb62b[_0x9816('0x45')][_0x9816('0xd2')]);_0x182157[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x4cb62b[_0x9816('0x45')],_0x28001c['filters']));if(_0x4cb62b[_0x9816('0x45')][_0x9816('0xd4')]){_0x182157[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x182157[_0x9816('0x42')],{'$or':_['map'](_0x182157[_0x9816('0x48')],function(_0x12d4ee){var _0x21fdbd={};_0x21fdbd[_0x12d4ee]={'$like':'%'+_0x4cb62b[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x21fdbd;})});}_0x182157=_[_0x9816('0xd5')]({},_0x182157,_0x4cb62b[_0x9816('0x5f')]);return _0x5a2550[_0x9816('0x14b')](_0x182157);}})[_0x9816('0x18')](function(_0x2504a6){if(_0x2504a6){_0x374759=_0x2504a6[_0x9816('0x4e')];if(!_0x4cb62b['query']['hasOwnProperty'](_0x9816('0xdd'))){_0x182157[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x4cb62b[_0x9816('0x45')][_0x9816('0x29')]);_0x182157[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x4cb62b[_0x9816('0x45')]['offset']);}return _0x5a2550[_0x9816('0x14b')](_0x182157);}})[_0x9816('0x18')](function(_0x5a962c){if(_0x5a962c){return _0x5a962c?{'count':_0x374759,'rows':_0x5a962c}:null;}})[_0x9816('0x18')](respondWithResult(_0x1136b8,null))[_0x9816('0x22')](handleError(_0x1136b8,null));};exports[_0x9816('0x14d')]=function(_0x4c0704,_0x1a69d3){var _0x677366={};var _0x135aab={};var _0x2bbb7c;var _0x53d00a;return db['User'][_0x9816('0xcf')]({'where':{'id':_0x4c0704[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x1a69d3,null))[_0x9816('0x18')](function(_0x5547a7){if(_0x5547a7){_0x2bbb7c=_0x5547a7;_0x135aab['model']=_['keys'](db[_0x9816('0x14e')][_0x9816('0x3c')]);_0x135aab[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x4c0704['query']);_0x135aab[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x135aab[_0x9816('0x58')],_0x135aab['query']);_0x677366[_0x9816('0x48')]=_['intersection'](_0x135aab['model'],qs[_0x9816('0x5d')](_0x4c0704[_0x9816('0x45')][_0x9816('0x5d')]));_0x677366[_0x9816('0x48')]=_0x677366[_0x9816('0x48')][_0x9816('0x4e')]?_0x677366[_0x9816('0x48')]:_0x135aab[_0x9816('0x58')];_0x677366[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x4c0704[_0x9816('0x45')][_0x9816('0xd2')]);_0x677366[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x4c0704['query'],_0x135aab[_0x9816('0x5b')]));if(_0x4c0704[_0x9816('0x45')][_0x9816('0xd4')]){_0x677366[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x677366['where'],{'$or':_[_0x9816('0x36')](_0x677366[_0x9816('0x48')],function(_0x15bef1){var _0x1c4cba={};_0x1c4cba[_0x15bef1]={'$like':'%'+_0x4c0704[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x1c4cba;})});}_0x677366=_['merge']({},_0x677366,_0x4c0704['options']);return _0x2bbb7c['getFaxAccounts'](_0x677366);}})[_0x9816('0x18')](function(_0x451f5e){if(_0x451f5e){_0x53d00a=_0x451f5e[_0x9816('0x4e')];if(!_0x4c0704[_0x9816('0x45')][_0x9816('0xd6')]('nolimit')){_0x677366[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x4c0704['query'][_0x9816('0x29')]);_0x677366[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x4c0704[_0x9816('0x45')][_0x9816('0x27')]);}return _0x2bbb7c[_0x9816('0x14d')](_0x677366);}})[_0x9816('0x18')](function(_0x16972e){if(_0x16972e){return _0x16972e?{'count':_0x53d00a,'rows':_0x16972e}:null;}})[_0x9816('0x18')](respondWithResult(_0x1a69d3,null))[_0x9816('0x22')](handleError(_0x1a69d3,null));};exports[_0x9816('0x14f')]=function(_0x23af4c,_0x45e814){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x23af4c[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x45e814,null))[_0x9816('0x18')](function(_0x23b582){if(_0x23b582){return _0x23b582['addFaxAccounts'](_0x23af4c[_0x9816('0x61')]['ids'],_[_0x9816('0x64')](_0x23af4c[_0x9816('0x61')],[_0x9816('0x65'),'id'])||{});}})['then'](respondWithResult(_0x45e814,null))[_0x9816('0x22')](handleError(_0x45e814,null));};exports[_0x9816('0x150')]=function(_0x329567,_0x3ec91b){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x329567['params']['id']}})['then'](handleEntityNotFound(_0x3ec91b,null))[_0x9816('0x18')](function(_0x56248d){if(_0x56248d){return _0x56248d[_0x9816('0x150')](_0x329567[_0x9816('0x45')][_0x9816('0x65')]);}})[_0x9816('0x18')](respondWithStatusCode(_0x3ec91b,null))[_0x9816('0x22')](handleError(_0x3ec91b,null));};exports[_0x9816('0x151')]=function(_0x376c0c,_0x2de048){var _0x19e47b={};var _0x2b5471={};var _0x3d6a0e;var _0x382021;return db[_0x9816('0x4a')][_0x9816('0xcf')]({'where':{'id':_0x376c0c['params']['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x2de048,null))[_0x9816('0x18')](function(_0x174e63){if(_0x174e63){_0x3d6a0e=_0x174e63;_0x2b5471[_0x9816('0x58')]=_[_0x9816('0x5a')](db[_0x9816('0x152')][_0x9816('0x3c')]);_0x2b5471['query']=_[_0x9816('0x5a')](_0x376c0c[_0x9816('0x45')]);_0x2b5471[_0x9816('0x5b')]=_['intersection'](_0x2b5471['model'],_0x2b5471[_0x9816('0x45')]);_0x19e47b['attributes']=_[_0x9816('0x5c')](_0x2b5471[_0x9816('0x58')],qs['fields'](_0x376c0c[_0x9816('0x45')][_0x9816('0x5d')]));_0x19e47b['attributes']=_0x19e47b[_0x9816('0x48')][_0x9816('0x4e')]?_0x19e47b[_0x9816('0x48')]:_0x2b5471[_0x9816('0x58')];_0x19e47b[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x376c0c[_0x9816('0x45')][_0x9816('0xd2')]);_0x19e47b['where']=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x376c0c[_0x9816('0x45')],_0x2b5471[_0x9816('0x5b')]));if(_0x376c0c[_0x9816('0x45')][_0x9816('0xd4')]){_0x19e47b[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x19e47b['where'],{'$or':_[_0x9816('0x36')](_0x19e47b[_0x9816('0x48')],function(_0x57445c){var _0x569bf8={};_0x569bf8[_0x57445c]={'$like':'%'+_0x376c0c['query']['filter']+'%'};return _0x569bf8;})});}_0x19e47b=_[_0x9816('0xd5')]({},_0x19e47b,_0x376c0c[_0x9816('0x5f')]);return _0x3d6a0e[_0x9816('0x151')](_0x19e47b);}})[_0x9816('0x18')](function(_0x27c98d){if(_0x27c98d){_0x382021=_0x27c98d[_0x9816('0x4e')];if(!_0x376c0c['query'][_0x9816('0xd6')](_0x9816('0xdd'))){_0x19e47b[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x376c0c['query'][_0x9816('0x29')]);_0x19e47b[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x376c0c[_0x9816('0x45')][_0x9816('0x27')]);}return _0x3d6a0e[_0x9816('0x151')](_0x19e47b);}})[_0x9816('0x18')](function(_0x507ab1){if(_0x507ab1){return _0x507ab1?{'count':_0x382021,'rows':_0x507ab1}:null;}})[_0x9816('0x18')](respondWithResult(_0x2de048,null))[_0x9816('0x22')](handleError(_0x2de048,null));};exports[_0x9816('0x153')]=function(_0x3efdec,_0x4b947a){return db['User']['find']({'where':{'id':_0x3efdec[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x4b947a,null))[_0x9816('0x18')](function(_0x557c92){if(_0x557c92){return _0x557c92['addMailAccounts'](_0x3efdec[_0x9816('0x61')][_0x9816('0x65')],_[_0x9816('0x64')](_0x3efdec[_0x9816('0x61')],[_0x9816('0x65'),'id'])||{});}})[_0x9816('0x18')](respondWithResult(_0x4b947a,null))[_0x9816('0x22')](handleError(_0x4b947a,null));};exports['removeMailAccounts']=function(_0x1b9512,_0x4a8019){return db['User'][_0x9816('0x38')]({'where':{'id':_0x1b9512[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x4a8019,null))[_0x9816('0x18')](function(_0x483838){if(_0x483838){return _0x483838[_0x9816('0x154')](_0x1b9512[_0x9816('0x45')]['ids']);}})[_0x9816('0x18')](respondWithStatusCode(_0x4a8019,null))[_0x9816('0x22')](handleError(_0x4a8019,null));};exports[_0x9816('0x155')]=function(_0xf6bf77,_0x2f035d){var _0x4413c0={};var _0x234c34={};var _0x14b793;var _0x356819;return db[_0x9816('0x4a')][_0x9816('0xcf')]({'where':{'id':_0xf6bf77[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x2f035d,null))[_0x9816('0x18')](function(_0x2ac7c2){if(_0x2ac7c2){_0x14b793=_0x2ac7c2;_0x234c34[_0x9816('0x58')]=_[_0x9816('0x5a')](db[_0x9816('0x156')][_0x9816('0x3c')]);_0x234c34[_0x9816('0x45')]=_['keys'](_0xf6bf77[_0x9816('0x45')]);_0x234c34[_0x9816('0x5b')]=_['intersection'](_0x234c34[_0x9816('0x58')],_0x234c34['query']);_0x4413c0[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x234c34[_0x9816('0x58')],qs['fields'](_0xf6bf77[_0x9816('0x45')][_0x9816('0x5d')]));_0x4413c0[_0x9816('0x48')]=_0x4413c0['attributes']['length']?_0x4413c0[_0x9816('0x48')]:_0x234c34[_0x9816('0x58')];_0x4413c0[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0xf6bf77[_0x9816('0x45')][_0x9816('0xd2')]);_0x4413c0[_0x9816('0x42')]=qs[_0x9816('0x5b')](_['pick'](_0xf6bf77[_0x9816('0x45')],_0x234c34[_0x9816('0x5b')]));if(_0xf6bf77['query']['filter']){_0x4413c0[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x4413c0[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x4413c0['attributes'],function(_0x3e38bd){var _0x19f527={};_0x19f527[_0x3e38bd]={'$like':'%'+_0xf6bf77[_0x9816('0x45')]['filter']+'%'};return _0x19f527;})});}_0x4413c0=_[_0x9816('0xd5')]({},_0x4413c0,_0xf6bf77[_0x9816('0x5f')]);return _0x14b793[_0x9816('0x155')](_0x4413c0);}})['then'](function(_0x5f0a31){if(_0x5f0a31){_0x356819=_0x5f0a31[_0x9816('0x4e')];if(!_0xf6bf77[_0x9816('0x45')][_0x9816('0xd6')](_0x9816('0xdd'))){_0x4413c0[_0x9816('0x29')]=qs[_0x9816('0x29')](_0xf6bf77[_0x9816('0x45')][_0x9816('0x29')]);_0x4413c0[_0x9816('0x27')]=qs[_0x9816('0x27')](_0xf6bf77[_0x9816('0x45')]['offset']);}return _0x14b793[_0x9816('0x155')](_0x4413c0);}})['then'](function(_0x1150b4){if(_0x1150b4){return _0x1150b4?{'count':_0x356819,'rows':_0x1150b4}:null;}})[_0x9816('0x18')](respondWithResult(_0x2f035d,null))['catch'](handleError(_0x2f035d,null));};exports['addOpenchannelAccounts']=function(_0x3dbc8a,_0x5a34c7){return db['User'][_0x9816('0x38')]({'where':{'id':_0x3dbc8a[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x5a34c7,null))['then'](function(_0x5333d5){if(_0x5333d5){return _0x5333d5[_0x9816('0x157')](_0x3dbc8a[_0x9816('0x61')][_0x9816('0x65')],_[_0x9816('0x64')](_0x3dbc8a[_0x9816('0x61')],['ids','id'])||{});}})[_0x9816('0x18')](respondWithResult(_0x5a34c7,null))[_0x9816('0x22')](handleError(_0x5a34c7,null));};exports[_0x9816('0x158')]=function(_0x410d99,_0x44e0c2){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x410d99[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x44e0c2,null))['then'](function(_0x36e486){if(_0x36e486){return _0x36e486[_0x9816('0x158')](_0x410d99[_0x9816('0x45')]['ids']);}})[_0x9816('0x18')](respondWithStatusCode(_0x44e0c2,null))[_0x9816('0x22')](handleError(_0x44e0c2,null));};exports['getSmsAccounts']=function(_0x4b6903,_0x2277a7){var _0x1afd3f={};var _0x46da03={};var _0xbe8a46;var _0x3002b3;return db[_0x9816('0x4a')][_0x9816('0xcf')]({'where':{'id':_0x4b6903['params']['id']}})['then'](handleEntityNotFound(_0x2277a7,null))[_0x9816('0x18')](function(_0x420008){if(_0x420008){_0xbe8a46=_0x420008;_0x46da03[_0x9816('0x58')]=_[_0x9816('0x5a')](db['SmsAccount'][_0x9816('0x3c')]);_0x46da03[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x4b6903['query']);_0x46da03[_0x9816('0x5b')]=_['intersection'](_0x46da03[_0x9816('0x58')],_0x46da03[_0x9816('0x45')]);_0x1afd3f[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x46da03['model'],qs[_0x9816('0x5d')](_0x4b6903[_0x9816('0x45')][_0x9816('0x5d')]));_0x1afd3f[_0x9816('0x48')]=_0x1afd3f[_0x9816('0x48')][_0x9816('0x4e')]?_0x1afd3f[_0x9816('0x48')]:_0x46da03['model'];_0x1afd3f[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x4b6903[_0x9816('0x45')][_0x9816('0xd2')]);_0x1afd3f[_0x9816('0x42')]=qs['filters'](_['pick'](_0x4b6903[_0x9816('0x45')],_0x46da03['filters']));if(_0x4b6903[_0x9816('0x45')][_0x9816('0xd4')]){_0x1afd3f[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x1afd3f[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x1afd3f[_0x9816('0x48')],function(_0x100b8c){var _0x497b5c={};_0x497b5c[_0x100b8c]={'$like':'%'+_0x4b6903[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x497b5c;})});}_0x1afd3f=_[_0x9816('0xd5')]({},_0x1afd3f,_0x4b6903[_0x9816('0x5f')]);return _0xbe8a46[_0x9816('0x159')](_0x1afd3f);}})[_0x9816('0x18')](function(_0x12f6a4){if(_0x12f6a4){_0x3002b3=_0x12f6a4['length'];if(!_0x4b6903['query'][_0x9816('0xd6')](_0x9816('0xdd'))){_0x1afd3f[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x4b6903['query'][_0x9816('0x29')]);_0x1afd3f[_0x9816('0x27')]=qs['offset'](_0x4b6903['query'][_0x9816('0x27')]);}return _0xbe8a46['getSmsAccounts'](_0x1afd3f);}})[_0x9816('0x18')](function(_0x449dfb){if(_0x449dfb){return _0x449dfb?{'count':_0x3002b3,'rows':_0x449dfb}:null;}})[_0x9816('0x18')](respondWithResult(_0x2277a7,null))['catch'](handleError(_0x2277a7,null));};exports[_0x9816('0x15a')]=function(_0x150ab3,_0x30440a){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x150ab3[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x30440a,null))[_0x9816('0x18')](function(_0x2b62df){if(_0x2b62df){return _0x2b62df[_0x9816('0x15a')](_0x150ab3['body']['ids'],_[_0x9816('0x64')](_0x150ab3[_0x9816('0x61')],[_0x9816('0x65'),'id'])||{});}})[_0x9816('0x18')](respondWithResult(_0x30440a,null))[_0x9816('0x22')](handleError(_0x30440a,null));};exports[_0x9816('0x15b')]=function(_0x446240,_0x1ff3d7){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x446240[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x1ff3d7,null))[_0x9816('0x18')](function(_0x24de12){if(_0x24de12){return _0x24de12[_0x9816('0x15b')](_0x446240[_0x9816('0x45')][_0x9816('0x65')]);}})[_0x9816('0x18')](respondWithStatusCode(_0x1ff3d7,null))['catch'](handleError(_0x1ff3d7,null));};exports['getChatWebsites']=function(_0x2fa977,_0x246bd2){var _0x250caf={};var _0x515a07={};var _0x45a548;var _0x47f511;return db[_0x9816('0x4a')]['findOne']({'where':{'id':_0x2fa977[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x246bd2,null))[_0x9816('0x18')](function(_0x2bd98e){if(_0x2bd98e){_0x45a548=_0x2bd98e;_0x515a07[_0x9816('0x58')]=_[_0x9816('0x5a')](db['ChatWebsite'][_0x9816('0x3c')]);_0x515a07[_0x9816('0x45')]=_['keys'](_0x2fa977['query']);_0x515a07[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x515a07[_0x9816('0x58')],_0x515a07[_0x9816('0x45')]);_0x250caf[_0x9816('0x48')]=_['intersection'](_0x515a07[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x2fa977[_0x9816('0x45')][_0x9816('0x5d')]));_0x250caf[_0x9816('0x48')]=_0x250caf[_0x9816('0x48')]['length']?_0x250caf[_0x9816('0x48')]:_0x515a07[_0x9816('0x58')];_0x250caf[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x2fa977[_0x9816('0x45')]['sort']);_0x250caf[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x2fa977[_0x9816('0x45')],_0x515a07[_0x9816('0x5b')]));if(_0x2fa977[_0x9816('0x45')][_0x9816('0xd4')]){_0x250caf[_0x9816('0x42')]=_['merge'](_0x250caf[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x250caf['attributes'],function(_0x313066){var _0x5e857f={};_0x5e857f[_0x313066]={'$like':'%'+_0x2fa977['query']['filter']+'%'};return _0x5e857f;})});}_0x250caf=_['merge']({},_0x250caf,_0x2fa977[_0x9816('0x5f')]);return _0x45a548['getChatWebsites'](_0x250caf);}})[_0x9816('0x18')](function(_0x4db97e){if(_0x4db97e){_0x47f511=_0x4db97e[_0x9816('0x4e')];if(!_0x2fa977[_0x9816('0x45')]['hasOwnProperty'](_0x9816('0xdd'))){_0x250caf[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x2fa977[_0x9816('0x45')][_0x9816('0x29')]);_0x250caf[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x2fa977[_0x9816('0x45')][_0x9816('0x27')]);}return _0x45a548[_0x9816('0x15c')](_0x250caf);}})[_0x9816('0x18')](function(_0x9fb293){if(_0x9fb293){return _0x9fb293?{'count':_0x47f511,'rows':_0x9fb293}:null;}})['then'](respondWithResult(_0x246bd2,null))[_0x9816('0x22')](handleError(_0x246bd2,null));};exports['addChatWebsites']=function(_0x138331,_0x24d1c8){return db[_0x9816('0x4a')]['find']({'where':{'id':_0x138331[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x24d1c8,null))[_0x9816('0x18')](function(_0x369044){if(_0x369044){return _0x369044['addChatWebsites'](_0x138331[_0x9816('0x61')][_0x9816('0x65')],_['omit'](_0x138331['body'],[_0x9816('0x65'),'id'])||{});}})[_0x9816('0x18')](respondWithResult(_0x24d1c8,null))[_0x9816('0x22')](handleError(_0x24d1c8,null));};exports[_0x9816('0x15d')]=function(_0x335608,_0xabbfde){return db[_0x9816('0x4a')]['find']({'where':{'id':_0x335608[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0xabbfde,null))[_0x9816('0x18')](function(_0x3ee52e){if(_0x3ee52e){return _0x3ee52e[_0x9816('0x15d')](_0x335608[_0x9816('0x45')][_0x9816('0x65')]);}})['then'](respondWithStatusCode(_0xabbfde,null))[_0x9816('0x22')](handleError(_0xabbfde,null));};exports['getWhatsappAccounts']=function(_0x2b65a7,_0x1a0cf0){var _0x468f51={};var _0x36d653={};var _0x351953;var _0x1feabf;return db['User'][_0x9816('0xcf')]({'where':{'id':_0x2b65a7['params']['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x1a0cf0,null))['then'](function(_0x1bd2da){if(_0x1bd2da){_0x351953=_0x1bd2da;_0x36d653['model']=_[_0x9816('0x5a')](db[_0x9816('0x15e')][_0x9816('0x3c')]);_0x36d653[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x2b65a7['query']);_0x36d653[_0x9816('0x5b')]=_[_0x9816('0x5c')](_0x36d653['model'],_0x36d653['query']);_0x468f51[_0x9816('0x48')]=_['intersection'](_0x36d653[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x2b65a7[_0x9816('0x45')]['fields']));_0x468f51[_0x9816('0x48')]=_0x468f51[_0x9816('0x48')]['length']?_0x468f51[_0x9816('0x48')]:_0x36d653['model'];_0x468f51[_0x9816('0xd1')]=qs[_0x9816('0xd2')](_0x2b65a7[_0x9816('0x45')]['sort']);_0x468f51[_0x9816('0x42')]=qs[_0x9816('0x5b')](_['pick'](_0x2b65a7[_0x9816('0x45')],_0x36d653['filters']));if(_0x2b65a7[_0x9816('0x45')]['filter']){_0x468f51['where']=_[_0x9816('0xd5')](_0x468f51['where'],{'$or':_[_0x9816('0x36')](_0x468f51['attributes'],function(_0x46726b){var _0x3e9f9b={};_0x3e9f9b[_0x46726b]={'$like':'%'+_0x2b65a7[_0x9816('0x45')]['filter']+'%'};return _0x3e9f9b;})});}_0x468f51=_[_0x9816('0xd5')]({},_0x468f51,_0x2b65a7['options']);return _0x351953['getWhatsappAccounts'](_0x468f51);}})[_0x9816('0x18')](function(_0x523e7a){if(_0x523e7a){_0x1feabf=_0x523e7a[_0x9816('0x4e')];if(!_0x2b65a7['query'][_0x9816('0xd6')]('nolimit')){_0x468f51['limit']=qs['limit'](_0x2b65a7[_0x9816('0x45')]['limit']);_0x468f51[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x2b65a7['query']['offset']);}return _0x351953[_0x9816('0x15f')](_0x468f51);}})['then'](function(_0xfb8abe){if(_0xfb8abe){return _0xfb8abe?{'count':_0x1feabf,'rows':_0xfb8abe}:null;}})[_0x9816('0x18')](respondWithResult(_0x1a0cf0,null))[_0x9816('0x22')](handleError(_0x1a0cf0,null));};exports[_0x9816('0x160')]=function(_0x3d4bc2,_0x1f8c47){return db[_0x9816('0x4a')]['find']({'where':{'id':_0x3d4bc2[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x1f8c47,null))[_0x9816('0x18')](function(_0xbdfdfa){if(_0xbdfdfa){return _0xbdfdfa[_0x9816('0x160')](_0x3d4bc2['body']['ids'],_[_0x9816('0x64')](_0x3d4bc2['body'],[_0x9816('0x65'),'id'])||{});}})[_0x9816('0x18')](respondWithResult(_0x1f8c47,null))[_0x9816('0x22')](handleError(_0x1f8c47,null));};exports['removeWhatsappAccounts']=function(_0x35eb23,_0x23c9bc){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x35eb23[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x23c9bc,null))[_0x9816('0x18')](function(_0x2f6608){if(_0x2f6608){return _0x2f6608['removeWhatsappAccounts'](_0x35eb23['query'][_0x9816('0x65')]);}})[_0x9816('0x18')](respondWithStatusCode(_0x23c9bc,null))[_0x9816('0x22')](handleError(_0x23c9bc,null));};exports[_0x9816('0x161')]=function(_0x144940,_0x106db0){var _0xcb831e={};var _0x32bfa3={};var _0x210b9f;var _0x13f66a;return db['User']['findOne']({'where':{'id':_0x144940[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x106db0,null))[_0x9816('0x18')](function(_0x1a23eb){if(_0x1a23eb){_0x210b9f=_0x1a23eb;_0x32bfa3['model']=_[_0x9816('0x5a')](db[_0x9816('0x162')][_0x9816('0x3c')]);_0x32bfa3[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x144940[_0x9816('0x45')]);_0x32bfa3['filters']=_['intersection'](_0x32bfa3[_0x9816('0x58')],_0x32bfa3[_0x9816('0x45')]);_0xcb831e[_0x9816('0x48')]=_[_0x9816('0x5c')](_0x32bfa3[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x144940['query'][_0x9816('0x5d')]));_0xcb831e['attributes']=_0xcb831e[_0x9816('0x48')][_0x9816('0x4e')]?_0xcb831e[_0x9816('0x48')]:_0x32bfa3['model'];_0xcb831e['order']=qs[_0x9816('0xd2')](_0x144940[_0x9816('0x45')][_0x9816('0xd2')]);_0xcb831e[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x144940[_0x9816('0x45')],_0x32bfa3[_0x9816('0x5b')]));if(_0x144940['query'][_0x9816('0xd4')]){_0xcb831e[_0x9816('0x42')]=_[_0x9816('0xd5')](_0xcb831e['where'],{'$or':_[_0x9816('0x36')](_0xcb831e[_0x9816('0x48')],function(_0x22de99){var _0x2bb46f={};_0x2bb46f[_0x22de99]={'$like':'%'+_0x144940[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x2bb46f;})});}_0xcb831e=_[_0x9816('0xd5')]({},_0xcb831e,_0x144940['options']);return _0x210b9f[_0x9816('0x161')](_0xcb831e);}})[_0x9816('0x18')](function(_0x19c8d0){if(_0x19c8d0){_0x13f66a=_0x19c8d0[_0x9816('0x4e')];if(!_0x144940[_0x9816('0x45')]['hasOwnProperty'](_0x9816('0xdd'))){_0xcb831e[_0x9816('0x29')]=qs[_0x9816('0x29')](_0x144940[_0x9816('0x45')]['limit']);_0xcb831e[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x144940[_0x9816('0x45')]['offset']);}return _0x210b9f[_0x9816('0x161')](_0xcb831e);}})['then'](function(_0x39911a){if(_0x39911a){return _0x39911a?{'count':_0x13f66a,'rows':_0x39911a}:null;}})[_0x9816('0x18')](respondWithResult(_0x106db0,null))['catch'](handleError(_0x106db0,null));};exports['addSquareProjects']=function(_0x349360,_0x5be51e){return db[_0x9816('0x4a')]['find']({'where':{'id':_0x349360['params']['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x5be51e,null))['then'](function(_0x3242f4){if(_0x3242f4){return _0x3242f4[_0x9816('0x163')](_0x349360[_0x9816('0x61')][_0x9816('0x65')],_[_0x9816('0x64')](_0x349360[_0x9816('0x61')],[_0x9816('0x65'),'id'])||{});}})[_0x9816('0x18')](respondWithResult(_0x5be51e,null))['catch'](handleError(_0x5be51e,null));};exports[_0x9816('0x164')]=function(_0x353050,_0x42940f){return db['User']['find']({'where':{'id':_0x353050[_0x9816('0x57')]['id']}})['then'](handleEntityNotFound(_0x42940f,null))['then'](function(_0x5b1a51){if(_0x5b1a51){return _0x5b1a51[_0x9816('0x164')](_0x353050['query'][_0x9816('0x65')]);}})[_0x9816('0x18')](respondWithStatusCode(_0x42940f,null))[_0x9816('0x22')](handleError(_0x42940f,null));};exports[_0x9816('0x165')]=function(_0x42daf7,_0x114221){var _0x5942e1={},_0x52df4e={},_0x525e2b={'count':0x0,'rows':[]};var _0x1dbba2=db[_0x9816('0x166')]['rawAttributes'];_0x52df4e['model']=_['keys'](_0x1dbba2);_0x52df4e[_0x9816('0x45')]=_[_0x9816('0x5a')](_0x42daf7[_0x9816('0x45')]);_0x52df4e['filters']=_[_0x9816('0x5c')](_0x52df4e['model'],_0x52df4e[_0x9816('0x45')]);_0x52df4e[_0x9816('0x5b')]=_[_0x9816('0xcd')](_0x52df4e[_0x9816('0x5b')],[_0x9816('0x167'),'$or','$gt',_0x9816('0x168'),_0x9816('0x169'),_0x9816('0x16a'),_0x9816('0x16b'),_0x9816('0x16c'),'$not',_0x9816('0x16d'),_0x9816('0x16e'),'$in',_0x9816('0x16f'),'$like',_0x9816('0x170'),_0x9816('0x171'),_0x9816('0x172'),'$like',_0x9816('0x173'),_0x9816('0x174'),_0x9816('0x175'),_0x9816('0x176')]);_0x5942e1[_0x9816('0x48')]=_['intersection'](_0x52df4e[_0x9816('0x58')],qs[_0x9816('0x5d')](_0x42daf7[_0x9816('0x45')][_0x9816('0x5d')]));_0x5942e1[_0x9816('0x48')]=_0x5942e1['attributes'][_0x9816('0x4e')]?_0x5942e1[_0x9816('0x48')]:_0x52df4e[_0x9816('0x58')];if(!_0x42daf7[_0x9816('0x45')]['hasOwnProperty'](_0x9816('0xdd'))){_0x5942e1['limit']=qs[_0x9816('0x29')](_0x42daf7[_0x9816('0x45')][_0x9816('0x29')]);_0x5942e1['offset']=qs['offset'](_0x42daf7[_0x9816('0x45')]['offset']);}_0x5942e1[_0x9816('0xd1')]=qs['sort'](_0x42daf7[_0x9816('0x45')]['sort']);_0x5942e1[_0x9816('0x42')]=qs[_0x9816('0x5b')](_[_0x9816('0xd3')](_0x42daf7[_0x9816('0x45')],_0x52df4e['filters']));if(_0x42daf7['query'][_0x9816('0xd4')]){_0x5942e1[_0x9816('0x42')]=_[_0x9816('0xd5')](_0x5942e1[_0x9816('0x42')],{'$or':_[_0x9816('0x36')](_0x5942e1[_0x9816('0x48')],function(_0x4fbf6e){var _0x528e1a={};_0x528e1a[_0x4fbf6e]={'$like':'%'+_0x42daf7[_0x9816('0x45')][_0x9816('0xd4')]+'%'};return _0x528e1a;})});}_0x5942e1[_0x9816('0x42')]={'$and':[_0x5942e1[_0x9816('0x42')],{'$or':[{'UserId':_0x42daf7['params']['id']},{'OwnerId':_0x42daf7[_0x9816('0x57')]['id']}]}]};_0x5942e1=_[_0x9816('0xd5')]({},_0x5942e1,_0x42daf7['options']);var _0x174cbf={'where':_0x5942e1[_0x9816('0x42')]};return db[_0x9816('0x166')]['count'](_0x174cbf)[_0x9816('0x18')](function(_0x2191ae){_0x525e2b['count']=_0x2191ae;if(_0x42daf7[_0x9816('0x45')][_0x9816('0x43')]){_0x5942e1[_0x9816('0x44')]=[{'attributes':['id',_0x9816('0x177'),'lastName',_0x9816('0xf6')],'model':db['CmContact'],'as':_0x9816('0x178')},{'attributes':['id',_0x9816('0x39'),'dialActive'],'model':db[_0x9816('0xad')],'as':_0x9816('0xdf')}];}return db[_0x9816('0x166')][_0x9816('0x4b')](_0x5942e1);})[_0x9816('0x18')](function(_0x408711){_0x525e2b['rows']=_0x408711;return _0x525e2b;})[_0x9816('0x18')](respondWithFilteredResult(_0x114221,_0x5942e1))[_0x9816('0x22')](handleError(_0x114221,null));};exports[_0x9816('0x179')]=function(_0x35ae5a,_0x595a09){if(!_[_0x9816('0x6b')](_0x35ae5a[_0x9816('0x33')]['id'])&&(_0x35ae5a[_0x9816('0x33')]['role']==_0x9816('0x31')||_0x35ae5a[_0x9816('0x33')]['role']=='user')){return db['User']['findOne']({'where':{'id':_0x35ae5a[_0x9816('0x57')]['id']},'raw':!![]})['then'](function(_0x18885a){return authService[_0x9816('0x17a')](_0x18885a);})[_0x9816('0x18')](function(_0x167c97){if(_0x167c97){return _0x595a09[_0x9816('0x24')](0xc8)[_0x9816('0x26')]({'api_key':_0x167c97[_0x9816('0x17b')]});}else{return _0x595a09[_0x9816('0x24')](0xcc)[_0x9816('0x26')]({'message':'No\x20API\x20access\x20key\x20found!'});}})['catch'](handleError(_0x595a09,0x193));}else{return _0x595a09[_0x9816('0x24')](0x191)[_0x9816('0x26')]({'message':_0x9816('0x17c')});}};exports[_0x9816('0x17d')]=function(_0x26a075,_0x246656){if(!_['isNil'](_0x26a075[_0x9816('0x33')]['id'])&&(_0x26a075[_0x9816('0x33')][_0x9816('0x30')]==_0x9816('0x31')||_0x26a075[_0x9816('0x33')][_0x9816('0x30')]=='user')){return db[_0x9816('0x4a')][_0x9816('0x38')]({'where':{'id':_0x26a075['params']['id']}})[_0x9816('0x18')](function(_0x40124a){return authService[_0x9816('0x17e')](_0x40124a);})[_0x9816('0x18')](function(_0x33f516){return db[_0x9816('0x4a')]['update']({'apiKeyIat':_0x33f516[_0x9816('0x17f')],'apiKeyNonce':_0x33f516['nonce']},{'where':{'id':_0x26a075[_0x9816('0x57')]['id']}})[_0x9816('0x18')](function(){return _0x246656[_0x9816('0x24')](0xc8)[_0x9816('0x26')]({'api_key':_0x33f516[_0x9816('0x17b')]});});})[_0x9816('0x22')](handleError(_0x246656,0x193));}else{return _0x246656[_0x9816('0x24')](0x191)[_0x9816('0x26')]({'message':_0x9816('0x17c')});}};exports[_0x9816('0x180')]=function(_0x4afcd3,_0x5ddd18){if(!_[_0x9816('0x6b')](_0x4afcd3['user']['id'])&&(_0x4afcd3[_0x9816('0x33')]['role']==_0x9816('0x31')||_0x4afcd3[_0x9816('0x33')][_0x9816('0x30')]==_0x9816('0x33'))){return db['User'][_0x9816('0x38')]({'where':{'id':_0x4afcd3[_0x9816('0x57')]['id']}})[_0x9816('0x18')](handleEntityNotFound(_0x5ddd18,null))['then'](function(_0x8e2f5e){if(_0x8e2f5e&&_0x8e2f5e[_0x9816('0x181')]&&_0x8e2f5e['apiKeyIat'])return _0x8e2f5e;else throw{'message':_0x9816('0x182')};})[_0x9816('0x18')](function(){return db[_0x9816('0x4a')][_0x9816('0x2d')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x4afcd3[_0x9816('0x57')]['id']}});})[_0x9816('0x18')](respondWithStatusCode(_0x5ddd18,0xc8))[_0x9816('0x22')](handleError(_0x5ddd18,0x193));}else{return _0x5ddd18[_0x9816('0x24')](0x191)[_0x9816('0x26')]({'message':_0x9816('0x17c')});}};exports['whoami']=function(_0x4a0f1d,_0x2e7e05){var _0x47a391=_0x4a0f1d[_0x9816('0x33')]['get']({'plain':!![]});if(!_0x47a391){return _0x2e7e05[_0x9816('0x24')](0x191)[_0x9816('0x3b')](_0x9816('0x183'));}else{Promise[_0x9816('0x10c')]()[_0x9816('0x18')](function(){if(_0x4a0f1d[_0x9816('0x45')][_0x9816('0x47')]!==_0x9816('0x46'))return;return _0x4a0f1d[_0x9816('0x33')][_0x9816('0x184')]();})[_0x9816('0x18')](function(_0x25b6db){if(!_0x25b6db)return;return _0x25b6db[_0x9816('0x2f')]({'plain':!![]});})[_0x9816('0x18')](function(_0x57a46f){_0x47a391[_0x9816('0x47')]=_0x57a46f;return _0x2e7e05['status'](0xc8)['json'](_0x47a391);});}};exports['getPresence']=function(_0x5938d9,_0x386785){var _0x300722={'offset':0x0},_0x2ff5bd={'count':0x0,'rows':[]};Promise[_0x9816('0x10c')]()['then'](function(){if(!_0x5938d9['query']['filter']&&!_0x5938d9['query'][_0x9816('0x185')]&&!_0x5938d9[_0x9816('0x45')]['queues'])return[];return Promise[_0x9816('0x10c')]()[_0x9816('0x18')](function(){var _0x27ae27=[];if(!_['isEmpty'](_0x5938d9[_0x9816('0x45')][_0x9816('0x185')])){_0x27ae27[_0x9816('0x49')](db[_0x9816('0x11c')][_0x9816('0x4b')]({'attributes':['id','name'],'where':{'id':_0x5938d9['query']['teams']}}));}if(!_[_0x9816('0x90')](_0x5938d9[_0x9816('0x45')][_0x9816('0x186')])){_0x27ae27['push'](db[_0x9816('0xad')][_0x9816('0x4b')]({'attributes':['id',_0x9816('0x39')],'type':_0x9816('0x187'),'where':{'id':_0x5938d9[_0x9816('0x45')][_0x9816('0x186')]}}));}return Promise[_0x9816('0x60')](_0x27ae27);})['then'](function(_0x51e731){var _0x23280e=_['flatten'](_0x51e731)[_0x9816('0x36')](function(_0x3d5352){return _0x3d5352[_0x9816('0x133')]({'attributes':['id',_0x9816('0x39'),_0x9816('0x6a'),_0x9816('0xa0')],'raw':!![]});});return Promise['all'](_0x23280e);})[_0x9816('0x18')](function(_0x3460bc){var _0x3e208c=_[_0x9816('0x129')](_0x3460bc);if(!_0x5938d9[_0x9816('0x45')][_0x9816('0xd4')])return _0x3e208c;if(_['isEmpty'](_0x3e208c)){return db[_0x9816('0x4a')][_0x9816('0x4b')]({'attributes':['id',_0x9816('0x39'),'internal','online'],'where':{'role':_0x9816('0x34'),'$or':[db['sequelize'][_0x9816('0x42')](db[_0x9816('0x6d')]['fn'](_0x9816('0x188'),db[_0x9816('0x6d')][_0x9816('0x189')]('name')),{'$like':'%'+_0x5938d9[_0x9816('0x45')][_0x9816('0xd4')][_0x9816('0xa6')]()+'%'}),{'internal':{'$like':'%'+_0x5938d9[_0x9816('0x45')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x3e208c)[_0x9816('0x129')]()[_0x9816('0xd4')](function(_0x4131ef){return _0x4131ef[_0x9816('0x39')]['toLowerCase']()[_0x9816('0x3e')](_0x5938d9[_0x9816('0x45')]['filter'][_0x9816('0xa6')]())||_0x4131ef[_0x9816('0x6a')][_0x9816('0x18a')]()[_0x9816('0x3e')](_0x5938d9['query']['filter']);})['value']();}})['then'](function(_0x3b14ff){var _0x57ebd4=_0x9816('0x39');var _0x164e21='asc';if(_0x5938d9['query']['sort']){_0x164e21=_0x5938d9[_0x9816('0x45')][_0x9816('0xd2')][0x0]==='-'?'desc':_0x9816('0x18b');_0x57ebd4=_0x164e21===_0x9816('0x18b')?_0x5938d9[_0x9816('0x45')][_0x9816('0xd2')]:_0x5938d9['query'][_0x9816('0xd2')][_0x9816('0x18c')](0x1);}return _(_0x3b14ff)[_0x9816('0x18d')]('id')[_0x9816('0x18e')]([function(_0x23dfa5){return _0x57ebd4===_0x9816('0x39')?_0x23dfa5[_0x57ebd4][_0x9816('0xa6')]():_0x23dfa5[_0x57ebd4];}],[_0x164e21])[_0x9816('0x36')](function(_0x635181){return _['pick'](_0x635181,['id',_0x9816('0x39'),_0x9816('0x6a'),_0x9816('0xa0')]);})[_0x9816('0x37')]();})[_0x9816('0x18')](function(_0x3b8650){return client[_0x9816('0x17')](_0x9816('0x91'),_0x5938d9)[_0x9816('0x18')](function(_0x5e9d06){if(_0x5e9d06[_0x9816('0x1e')])throw new Error(_0x9816('0x18f'));var _0x1573f0=_0x5e9d06['result'];var _0x425599=jayson[_0x9816('0x15')]['http']({'port':0x232c});return _0x425599[_0x9816('0x17')](_0x9816('0x91'),_0x5938d9)[_0x9816('0x18')](function(_0x2ad626){if(_0x2ad626[_0x9816('0x1e')])throw new Error(_0x9816('0x190'));var _0x3d5705=_0x2ad626[_0x9816('0x21')];return _['merge']({},_0x3d5705,_0x1573f0);});})['then'](function(_0x4f5a7b){return _[_0x9816('0x36')](_0x3b8650,function(_0x9008b6){var _0x1a47b9=_[_0x9816('0x38')](_0x4f5a7b[_0x9816('0x4c')],['id',_0x9008b6['id']]);if(!_0x1a47b9||!_0x9008b6[_0x9816('0xa0')]){_0x9008b6[_0x9816('0x24')]='offline';}else if(_0x1a47b9['voicePause']){_0x9008b6[_0x9816('0x24')]=_0x9816('0x191');}else{_0x9008b6['status']=_[_0x9816('0x3e')]([_0x9816('0x192'),_0x9816('0x193'),_0x9816('0x194'),'ringing',null,undefined],_0x1a47b9[_0x9816('0x195')])?_0x9816('0xa0'):_0x9816('0x196');}return _0x9008b6;});});});})[_0x9816('0x18')](function(_0x3cda03){if(!_0x5938d9[_0x9816('0x45')][_0x9816('0xd6')]('nolimit')){_0x300722['limit']=qs[_0x9816('0x29')](_0x5938d9[_0x9816('0x45')][_0x9816('0x29')]||0xa);_0x300722[_0x9816('0x27')]=qs[_0x9816('0x27')](_0x5938d9['query'][_0x9816('0x27')]);}_0x2ff5bd[_0x9816('0x2a')]=_0x3cda03[_0x9816('0x4e')];_0x2ff5bd[_0x9816('0x4c')]=_0x300722[_0x9816('0x29')]?_0x3cda03[_0x9816('0x197')](_0x300722[_0x9816('0x27')],_0x300722[_0x9816('0x27')]+_0x300722[_0x9816('0x29')]):_0x3cda03;return _0x2ff5bd;})[_0x9816('0x18')](respondWithFilteredResult(_0x386785,_0x300722))['catch'](handleError(_0x386785,null));};function get_open_tabs(_0x2f1c65,_0x2bc7a3){var _0x3e4f4d=_0x2f1c65[_0x9816('0x198')](0x0)[_0x9816('0x199')]()+_0x2f1c65[_0x9816('0x197')](0x1);var _0x48b0ce={'type':db[_0x9816('0x94')][_0x9816('0x6f')]['SELECT'],'raw':!![]};return new BPromise(function(_0x1f9909,_0x1188fa){var _0x28dd12=squel['select']()['field'](_0x9816('0x19a')+_0x3e4f4d+_0x9816('0x19b'),'id')[_0x9816('0x19c')](_0x9816('0x19d'))[_0x9816('0x70')]('user_has_'+_0x2f1c65+'_interactions','ui')[_0x9816('0x42')]('ui.UserId\x20=\x20?',_0x2bc7a3['id']);return db['sequelize']['query'](_0x28dd12[_0x9816('0x18a')](),_0x48b0ce)['then'](function(_0xd8e3bd){_0x2bc7a3[_0x3e4f4d+_0x9816('0x19e')]=_0xd8e3bd;_0x1f9909(_0xd8e3bd);})[_0x9816('0x22')](function(_0x46cb28){_0x1188fa(_0x46cb28);});});}
\ No newline at end of file
index 0252d31..c901b9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0231=['remove','emit','hasOwnProperty','hook','exports','events','User','setMaxListeners','save','update'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x0231,0xb9));var _0x1023=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x0231[_0x433a86];return _0x23000c;};'use strict';var EventEmitter=require(_0x1023('0x0'));var User=require('../../mysqldb')['db'][_0x1023('0x1')];var UserEvents=new EventEmitter();UserEvents[_0x1023('0x2')](0x0);var events={'afterCreate':_0x1023('0x3'),'afterUpdate':_0x1023('0x4'),'afterDestroy':_0x1023('0x5')};function emitEvent(_0x366c72){return function(_0x53d050,_0x57e67f,_0x1cee2e){UserEvents['emit'](_0x366c72+':'+_0x53d050['id'],_0x53d050);UserEvents[_0x1023('0x6')](_0x366c72,_0x53d050);_0x1cee2e(null);};}for(var e in events){if(events[_0x1023('0x7')](e)){var event=events[e];User[_0x1023('0x8')](e,emitEvent(event));}}module[_0x1023('0x9')]=UserEvents;
\ No newline at end of file
+var _0x909e=['../../mysqldb','User','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x30af86,_0x2d162d){var _0x6b9061=function(_0x276d8c){while(--_0x276d8c){_0x30af86['push'](_0x30af86['shift']());}};_0x6b9061(++_0x2d162d);}(_0x909e,0xc5));var _0xe909=function(_0x3b6714,_0x523ab3){_0x3b6714=_0x3b6714-0x0;var _0x3a4680=_0x909e[_0x3b6714];return _0x3a4680;};'use strict';var EventEmitter=require(_0xe909('0x0'));var User=require(_0xe909('0x1'))['db'][_0xe909('0x2')];var UserEvents=new EventEmitter();UserEvents[_0xe909('0x3')](0x0);var events={'afterCreate':_0xe909('0x4'),'afterUpdate':_0xe909('0x5'),'afterDestroy':_0xe909('0x6')};function emitEvent(_0x507d90){return function(_0x4c2468,_0x42827e,_0x14301f){UserEvents['emit'](_0x507d90+':'+_0x4c2468['id'],_0x4c2468);UserEvents[_0xe909('0x7')](_0x507d90,_0x4c2468);_0x14301f(null);};}for(var e in events){if(events[_0xe909('0x8')](e)){var event=events[e];User[_0xe909('0x9')](e,emitEvent(event));}}module[_0xe909('0xa')]=UserEvents;
\ No newline at end of file
index ab31f9b..d70b4c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cc=['salt','md5secret',':asterisk:','util','md5','./user.attributes','google','context','system','prefix','format','CDR(type)=%s','record','push','${UNIQUEID}.%s,a','merge','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','wav','WAV','from-sip','Set','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','Dial','Hangup','priority','VoiceChanSpy','findAll','then','internal','concat','catch','exports','models','define','utf8','undefined','resolve','UserProfile','find','userProfileId','privacyEnabled','updatePassword','changed','createUserSetting','error','bulkCreate','VoiceExtension','destroy','chanspy','length','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt'];(function(_0x2a3e5f,_0x24c745){var _0xfdbebc=function(_0x1c1bd2){while(--_0x1c1bd2){_0x2a3e5f['push'](_0x2a3e5f['shift']());}};_0xfdbebc(++_0x24c745);}(_0xf3cc,0x95));var _0xcf3c=function(_0x419aa4,_0x5926a7){_0x419aa4=_0x419aa4-0x0;var _0x557d9b=_0xf3cc[_0x419aa4];return _0x557d9b;};'use strict';var BPromise=require('bluebird');var crypto=require('crypto');var util=require(_0xcf3c('0x0'));var md5=require(_0xcf3c('0x1'));var _=require('lodash');var attributes=require(_0xcf3c('0x2'));var authTypes=[_0xcf3c('0x3')];var validatePresenceOf=function(_0x4fc652){return _0x4fc652&&_0x4fc652['length'];};var getChanSpyApplications=function(_0x177adf,_0x4b26a6,_0x541b69){var _0x2bfb3f={'context':_0x177adf[_0xcf3c('0x4')]||'from-sip','type':_0xcf3c('0x5'),'isApp':![],'UserId':_0x177adf['id']};var _0x1ad08f=[];for(var _0x465bf9=0x0,_0x3bdee2=0x1;_0x465bf9<_0x541b69['length'];_0x465bf9++,_0x3bdee2=0x1){var _0x3b1677={'exten':util['format']('%s%s',_0x541b69[_0x465bf9][_0xcf3c('0x6')],_0x4b26a6),'ChanSpyId':_0x541b69[_0x465bf9]['id']};_0x1ad08f['push'](_['merge']({'app':'Set','appdata':util[_0xcf3c('0x7')](_0xcf3c('0x8'),'chanspy'),'priority':_0x3bdee2++},_0x2bfb3f,_0x3b1677));if(_0x541b69[_0x465bf9][_0xcf3c('0x9')]){_0x1ad08f[_0xcf3c('0xa')](_['merge']({'app':'MixMonitor','appdata':util[_0xcf3c('0x7')](_0xcf3c('0xb'),_0x541b69[_0x465bf9]['recordingFormat']),'priority':_0x3bdee2++},_0x2bfb3f,_0x3b1677));}if(_0x541b69[_0x465bf9]['auth']){_0x1ad08f[_0xcf3c('0xa')](_[_0xcf3c('0xc')]({'app':_0xcf3c('0xd'),'appdata':_0x541b69[_0x465bf9][_0xcf3c('0xe')],'priority':_0x3bdee2++},_0x2bfb3f,_0x3b1677));}_0x1ad08f[_0xcf3c('0xa')](_[_0xcf3c('0xc')]({'app':_0xcf3c('0xf'),'appdata':util['format'](_0xcf3c('0x10'),_0x177adf[_0xcf3c('0x11')],_0x541b69[_0x465bf9][_0xcf3c('0x12')]?_0x541b69[_0x465bf9][_0xcf3c('0x12')][_0xcf3c('0x13')](''):''),'priority':_0x3bdee2++},_0x2bfb3f,_0x3b1677));if(_0x541b69[_0x465bf9]['record']){_0x1ad08f[_0xcf3c('0xa')](_[_0xcf3c('0xc')]({'app':_0xcf3c('0x14'),'priority':_0x3bdee2++},_0x2bfb3f,_0x3b1677));}}return _0x1ad08f;};var getUserApplications=function(_0x2c358a,_0x559a31){var _0x3df3fd=[_0xcf3c('0x15'),_0xcf3c('0x16'),'gsm'];var _0x1d51b3={'context':_0x2c358a[_0xcf3c('0x4')]||_0xcf3c('0x17'),'exten':_0x559a31,'type':'system','isApp':![],'UserId':_0x2c358a['id']};var _0x4fba35=[{'app':_0xcf3c('0x18'),'appdata':_0xcf3c('0x19')}];if(_0x2c358a[_0xcf3c('0x1a')]&&_[_0xcf3c('0x1b')](_0x3df3fd,_0x2c358a[_0xcf3c('0x1a')])){_0x4fba35[_0xcf3c('0xa')]({'app':_0xcf3c('0x18'),'appdata':_0xcf3c('0x1c')});_0x4fba35[_0xcf3c('0xa')]({'app':_0xcf3c('0x18'),'appdata':util[_0xcf3c('0x7')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x2c358a[_0xcf3c('0x1a')])});_0x4fba35['push']({'app':'Dial','appdata':util[_0xcf3c('0x7')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x2c358a[_0xcf3c('0x11')])});}else{_0x4fba35[_0xcf3c('0xa')]({'app':_0xcf3c('0x1d'),'appdata':util['format']('SIP/%s,,tTxX',_0x2c358a[_0xcf3c('0x11')])});}_0x4fba35[_0xcf3c('0xa')]({'app':_0xcf3c('0x1e')});for(var _0x3067ca=0x0;_0x3067ca<_0x4fba35['length'];_0x3067ca++){_0x4fba35[_0x3067ca][_0xcf3c('0x1f')]=_0x3067ca+0x1;_0x4fba35[_0x3067ca]=_['defaults'](_0x4fba35[_0x3067ca],_0x1d51b3);}return _0x4fba35;};var getChanSpyPromise=function(_0x1e7140,_0xe869d5){return new BPromise(function(_0x686975,_0x5954a4){return _0x1e7140[_0xcf3c('0x20')][_0xcf3c('0x21')]()[_0xcf3c('0x22')](function(_0x253cc7){if(_0x253cc7){var _0xa5361d=getChanSpyApplications(_0xe869d5,_0xe869d5[_0xcf3c('0x23')],_0x253cc7);if(_0xe869d5[_0xcf3c('0x23')]!=_0xe869d5['name']){_0xa5361d=_0xa5361d[_0xcf3c('0x24')](getChanSpyApplications(_0xe869d5,_0xe869d5[_0xcf3c('0x11')],_0x253cc7));}return _0x686975(_0xa5361d);}return _0x686975([]);})[_0xcf3c('0x25')](function(_0x1dc1bf){_0x5954a4(_0x1dc1bf);});});};module[_0xcf3c('0x26')]=function(_0x1e0b93){var _0x23103f=_0x1e0b93[_0xcf3c('0x27')];return _0x1e0b93[_0xcf3c('0x28')]('User',attributes,{'tableName':'users','charset':_0xcf3c('0x29'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x7b0d0a,_0x1ebc4b,_0x174144){var _0x5f0edd=typeof _0x7b0d0a['userProfileId']===_0xcf3c('0x2a')?BPromise[_0xcf3c('0x2b')](null):_0x23103f[_0xcf3c('0x2c')][_0xcf3c('0x2d')]({'where':{'id':_0x7b0d0a[_0xcf3c('0x2e')]}});_0x5f0edd[_0xcf3c('0x22')](function(_0x40b7e2){if(_0x40b7e2){_0x7b0d0a[_0xcf3c('0x2f')]=_0x40b7e2[_0xcf3c('0x2f')];}})[_0xcf3c('0x22')](function(){_0x7b0d0a['updateMd5Password']();_0x7b0d0a[_0xcf3c('0x30')](_0x174144);})[_0xcf3c('0x25')](function(_0x36ffaf){_0x174144(_0x36ffaf);});},'beforeUpdate':function(_0x65ba4f,_0x21c863,_0x4eb43a){Promise[_0xcf3c('0x2b')]()['then'](function(){if(_0x65ba4f[_0xcf3c('0x31')](_0xcf3c('0x2e'))===![])return;return _0x23103f['UserProfile'][_0xcf3c('0x2d')]({'where':{'id':_0x65ba4f[_0xcf3c('0x2e')]}})[_0xcf3c('0x22')](function(_0x41cce5){if(_0x41cce5)_0x65ba4f['privacyEnabled']=_0x41cce5[_0xcf3c('0x2f')];return;});})[_0xcf3c('0x22')](function(){if(_0x65ba4f[_0xcf3c('0x31')](_0xcf3c('0xe'))){_0x65ba4f['updateMd5Password']();return _0x65ba4f[_0xcf3c('0x30')](_0x4eb43a);}_0x4eb43a();})[_0xcf3c('0x25')](function(_0x34c68b){_0x4eb43a(_0x34c68b);});},'afterCreate':function(_0x2bca0d,_0xcf2295,_0x5254c8){var _0x14823c=getUserApplications(_0x2bca0d,_0x2bca0d[_0xcf3c('0x23')]);if(_0x2bca0d[_0xcf3c('0x23')]!=_0x2bca0d[_0xcf3c('0x11')]){_0x14823c=_0x14823c['concat'](getUserApplications(_0x2bca0d,_0x2bca0d[_0xcf3c('0x11')]));}return Promise[_0xcf3c('0x2b')]()[_0xcf3c('0x22')](function(){if(!_0x2bca0d['userSetting']){return _0x2bca0d[_0xcf3c('0x32')]({'clientSideLoggingLevel':_0xcf3c('0x33'),'clientSideLoggingEnabled':![]});}})['then'](function(){return _0x23103f['VoiceExtension'][_0xcf3c('0x34')](_0x14823c);})[_0xcf3c('0x22')](function(){if(_0x2bca0d['chanspy']){return getChanSpyPromise(_0x23103f,_0x2bca0d);}})[_0xcf3c('0x22')](function(_0x13d222){if(_0x13d222&&_0x13d222['length']){return _0x23103f[_0xcf3c('0x35')][_0xcf3c('0x34')](_0x13d222);}})[_0xcf3c('0x22')](function(){_0x5254c8();})[_0xcf3c('0x25')](function(_0x16db72){_0x5254c8(_0x16db72);});},'afterUpdate':function(_0x579864,_0x3069fc,_0x1f90ff){return BPromise[_0xcf3c('0x2b')]()[_0xcf3c('0x22')](function(){if(_0x579864[_0xcf3c('0x31')]('chanspy')||_0x579864[_0xcf3c('0x31')](_0xcf3c('0x4'))){return _0x23103f[_0xcf3c('0x35')][_0xcf3c('0x36')]({'where':{'UserId':_0x579864['id'],'type':'system','ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x579864[_0xcf3c('0x37')]){return getChanSpyPromise(_0x23103f,_0x579864)[_0xcf3c('0x22')](function(_0xad93f0){if(_0xad93f0&&_0xad93f0[_0xcf3c('0x38')]){return _0x23103f['VoiceExtension']['bulkCreate'](_0xad93f0);}});}});}})['then'](function(){if(_0x579864[_0xcf3c('0x31')]('extensionMonitor')||_0x579864[_0xcf3c('0x31')]('context')){return _0x23103f[_0xcf3c('0x35')][_0xcf3c('0x36')]({'where':{'UserId':_0x579864['id'],'type':_0xcf3c('0x5'),'ChanSpyId':null}})[_0xcf3c('0x22')](function(){var _0x2b9e56=getUserApplications(_0x579864,_0x579864['internal']);if(_0x579864[_0xcf3c('0x23')]!=_0x579864[_0xcf3c('0x11')]){_0x2b9e56=_0x2b9e56[_0xcf3c('0x24')](getUserApplications(_0x579864,_0x579864[_0xcf3c('0x11')]));}return _0x23103f[_0xcf3c('0x35')][_0xcf3c('0x34')](_0x2b9e56);});}})[_0xcf3c('0x22')](function(){_0x1f90ff();})[_0xcf3c('0x25')](function(_0xc87bf0){_0x1f90ff(_0xc87bf0);});},'afterDestroy':function(_0x269fbd){return _0x23103f['VoiceExtension']['destroy']({'where':{'UserId':_0x269fbd['id'],'type':_0xcf3c('0x5')}});}},'instanceMethods':{'authenticate':function(_0x4f8e4b,_0x55f071){if(!_0x55f071){return this[_0xcf3c('0xe')]===this[_0xcf3c('0x39')](_0x4f8e4b);}var _0x5d0820=this;this['encryptPassword'](_0x4f8e4b,function(_0x2ab023,_0x50fbb0){if(_0x2ab023){_0x55f071(_0x2ab023);}if(_0x5d0820[_0xcf3c('0xe')]===_0x50fbb0){_0x55f071(null,!![]);}else{_0x55f071(null,![]);}});},'makeSalt':function(_0x431483,_0x327812){var _0x31ee71=0x10;if(typeof arguments[0x0]===_0xcf3c('0x3a')){_0x327812=arguments[0x0];_0x431483=_0x31ee71;}else if(typeof arguments[0x1]===_0xcf3c('0x3a')){_0x327812=arguments[0x1];}else{throw new Error(_0xcf3c('0x3b'));}if(!_0x431483){_0x431483=_0x31ee71;}return crypto[_0xcf3c('0x3c')](_0x431483,function(_0x5334b1,_0xb9dd2f){if(_0x5334b1){_0x327812(_0x5334b1);}return _0x327812(null,_0xb9dd2f[_0xcf3c('0x3d')](_0xcf3c('0x3e')));});},'encryptPassword':function(_0x2666a6,_0x24a944){if(!_0x2666a6||!this['salt']){return _0x24a944?_0x24a944(null):null;}var _0x49132a=0x2710;var _0x518bd3=0x40;var _0x1d20ba=new Buffer(this['salt'],'base64');if(!_0x24a944){return crypto[_0xcf3c('0x3f')](_0x2666a6,_0x1d20ba,_0x49132a,_0x518bd3,_0xcf3c('0x40'))[_0xcf3c('0x3d')](_0xcf3c('0x3e'));}return crypto[_0xcf3c('0x41')](_0x2666a6,_0x1d20ba,_0x49132a,_0x518bd3,'sha1',function(_0x10e357,_0xbf47ab){if(_0x10e357){_0x24a944(_0x10e357);}return _0x24a944(null,_0xbf47ab['toString']('base64'));});},'updatePassword':function(_0x28cd4f){if(!this[_0xcf3c('0xe')]){return _0x28cd4f(null);}if(!validatePresenceOf(this[_0xcf3c('0xe')])&&authTypes[_0xcf3c('0x42')](this[_0xcf3c('0x43')])===-0x1){_0x28cd4f(new Error(_0xcf3c('0x44')));}var _0x205dc2=this;this[_0xcf3c('0x45')](function(_0x193e14,_0x18f551){if(_0x193e14){return _0x28cd4f(_0x193e14);}_0x205dc2[_0xcf3c('0x46')]=_0x18f551;_0x205dc2[_0xcf3c('0x39')](_0x205dc2[_0xcf3c('0xe')],function(_0x17d226,_0x43e33c){if(_0x17d226){_0x28cd4f(_0x17d226);}_0x205dc2['password']=_0x43e33c;_0x28cd4f(null);});});},'updateMd5Password':function(){this[_0xcf3c('0x47')]=md5(this[_0xcf3c('0x11')]+_0xcf3c('0x48')+this[_0xcf3c('0xe')]);return this[_0xcf3c('0x47')];}}});};
\ No newline at end of file
+var _0x5de4=['findAll','then','internal','catch','define','User','users','utf8','utf8_bin','userProfileId','undefined','UserProfile','find','privacyEnabled','updateMd5Password','updatePassword','resolve','changed','concat','userSetting','createUserSetting','error','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','toString','base64','salt','pbkdf2Sync','pbkdf2','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','bluebird','crypto','util','lodash','google','system','prefix','format','CDR(type)=%s','chanspy','record','push','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','name','options','join','wav','gsm','context','from-sip','Set','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','length','priority','defaults','VoiceChanSpy'];(function(_0x270ca9,_0x1bfcf8){var _0x3524b0=function(_0x4798f7){while(--_0x4798f7){_0x270ca9['push'](_0x270ca9['shift']());}};_0x3524b0(++_0x1bfcf8);}(_0x5de4,0x71));var _0x45de=function(_0x50d94b,_0x1fda85){_0x50d94b=_0x50d94b-0x0;var _0x4e1fa3=_0x5de4[_0x50d94b];return _0x4e1fa3;};'use strict';var BPromise=require(_0x45de('0x0'));var crypto=require(_0x45de('0x1'));var util=require(_0x45de('0x2'));var md5=require('md5');var _=require(_0x45de('0x3'));var attributes=require('./user.attributes');var authTypes=[_0x45de('0x4')];var validatePresenceOf=function(_0x572c7b){return _0x572c7b&&_0x572c7b['length'];};var getChanSpyApplications=function(_0x3aac60,_0x4f2a7d,_0x3c63cd){var _0x577c6e={'context':_0x3aac60['context']||'from-sip','type':_0x45de('0x5'),'isApp':![],'UserId':_0x3aac60['id']};var _0x1fe9a2=[];for(var _0x24a5d4=0x0,_0xdafaec=0x1;_0x24a5d4<_0x3c63cd['length'];_0x24a5d4++,_0xdafaec=0x1){var _0x37854e={'exten':util['format']('%s%s',_0x3c63cd[_0x24a5d4][_0x45de('0x6')],_0x4f2a7d),'ChanSpyId':_0x3c63cd[_0x24a5d4]['id']};_0x1fe9a2['push'](_['merge']({'app':'Set','appdata':util[_0x45de('0x7')](_0x45de('0x8'),_0x45de('0x9')),'priority':_0xdafaec++},_0x577c6e,_0x37854e));if(_0x3c63cd[_0x24a5d4][_0x45de('0xa')]){_0x1fe9a2[_0x45de('0xb')](_[_0x45de('0xc')]({'app':_0x45de('0xd'),'appdata':util['format'](_0x45de('0xe'),_0x3c63cd[_0x24a5d4][_0x45de('0xf')]),'priority':_0xdafaec++},_0x577c6e,_0x37854e));}if(_0x3c63cd[_0x24a5d4]['auth']){_0x1fe9a2[_0x45de('0xb')](_[_0x45de('0xc')]({'app':_0x45de('0x10'),'appdata':_0x3c63cd[_0x24a5d4][_0x45de('0x11')],'priority':_0xdafaec++},_0x577c6e,_0x37854e));}_0x1fe9a2[_0x45de('0xb')](_[_0x45de('0xc')]({'app':_0x45de('0x12'),'appdata':util['format']('SIP/%s,%s',_0x3aac60[_0x45de('0x13')],_0x3c63cd[_0x24a5d4]['options']?_0x3c63cd[_0x24a5d4][_0x45de('0x14')][_0x45de('0x15')](''):''),'priority':_0xdafaec++},_0x577c6e,_0x37854e));if(_0x3c63cd[_0x24a5d4][_0x45de('0xa')]){_0x1fe9a2[_0x45de('0xb')](_['merge']({'app':'StopMixMonitor','priority':_0xdafaec++},_0x577c6e,_0x37854e));}}return _0x1fe9a2;};var getUserApplications=function(_0x417267,_0x25c98b){var _0x19e12c=[_0x45de('0x16'),'WAV',_0x45de('0x17')];var _0x1a0c91={'context':_0x417267[_0x45de('0x18')]||_0x45de('0x19'),'exten':_0x25c98b,'type':_0x45de('0x5'),'isApp':![],'UserId':_0x417267['id']};var _0x259930=[{'app':_0x45de('0x1a'),'appdata':'CDR(type)=internal'}];if(_0x417267[_0x45de('0x1b')]&&_['includes'](_0x19e12c,_0x417267['extensionMonitor'])){_0x259930[_0x45de('0xb')]({'app':_0x45de('0x1a'),'appdata':_0x45de('0x1c')});_0x259930[_0x45de('0xb')]({'app':_0x45de('0x1a'),'appdata':util['format'](_0x45de('0x1d'),_0x417267[_0x45de('0x1b')])});_0x259930[_0x45de('0xb')]({'app':_0x45de('0x1e'),'appdata':util[_0x45de('0x7')](_0x45de('0x1f'),_0x417267[_0x45de('0x13')])});}else{_0x259930[_0x45de('0xb')]({'app':_0x45de('0x1e'),'appdata':util['format'](_0x45de('0x20'),_0x417267[_0x45de('0x13')])});}_0x259930[_0x45de('0xb')]({'app':'Hangup'});for(var _0x2c42da=0x0;_0x2c42da<_0x259930[_0x45de('0x21')];_0x2c42da++){_0x259930[_0x2c42da][_0x45de('0x22')]=_0x2c42da+0x1;_0x259930[_0x2c42da]=_[_0x45de('0x23')](_0x259930[_0x2c42da],_0x1a0c91);}return _0x259930;};var getChanSpyPromise=function(_0x2486c1,_0x2db23e){return new BPromise(function(_0x1ea963,_0x3c8ee0){return _0x2486c1[_0x45de('0x24')][_0x45de('0x25')]()[_0x45de('0x26')](function(_0x3f7190){if(_0x3f7190){var _0x59359a=getChanSpyApplications(_0x2db23e,_0x2db23e['internal'],_0x3f7190);if(_0x2db23e[_0x45de('0x27')]!=_0x2db23e[_0x45de('0x13')]){_0x59359a=_0x59359a['concat'](getChanSpyApplications(_0x2db23e,_0x2db23e[_0x45de('0x13')],_0x3f7190));}return _0x1ea963(_0x59359a);}return _0x1ea963([]);})[_0x45de('0x28')](function(_0x3a6066){_0x3c8ee0(_0x3a6066);});});};module['exports']=function(_0x21fead){var _0x531bd2=_0x21fead['models'];return _0x21fead[_0x45de('0x29')](_0x45de('0x2a'),attributes,{'tableName':_0x45de('0x2b'),'charset':_0x45de('0x2c'),'collate':_0x45de('0x2d'),'hooks':{'beforeCreate':function(_0x1863f5,_0x59f101,_0x422d7a){var _0x4f869d=typeof _0x1863f5[_0x45de('0x2e')]===_0x45de('0x2f')?BPromise['resolve'](null):_0x531bd2[_0x45de('0x30')][_0x45de('0x31')]({'where':{'id':_0x1863f5[_0x45de('0x2e')]}});_0x4f869d[_0x45de('0x26')](function(_0x1eeaf3){if(_0x1eeaf3){_0x1863f5[_0x45de('0x32')]=_0x1eeaf3[_0x45de('0x32')];}})[_0x45de('0x26')](function(){_0x1863f5[_0x45de('0x33')]();_0x1863f5[_0x45de('0x34')](_0x422d7a);})[_0x45de('0x28')](function(_0x800c68){_0x422d7a(_0x800c68);});},'beforeUpdate':function(_0x1d27e6,_0x1ab350,_0x4c36a8){Promise[_0x45de('0x35')]()[_0x45de('0x26')](function(){if(_0x1d27e6[_0x45de('0x36')](_0x45de('0x2e'))===![])return;return _0x531bd2[_0x45de('0x30')]['find']({'where':{'id':_0x1d27e6['userProfileId']}})[_0x45de('0x26')](function(_0x23e0fe){if(_0x23e0fe)_0x1d27e6[_0x45de('0x32')]=_0x23e0fe[_0x45de('0x32')];return;});})['then'](function(){if(_0x1d27e6[_0x45de('0x36')](_0x45de('0x11'))){_0x1d27e6[_0x45de('0x33')]();return _0x1d27e6[_0x45de('0x34')](_0x4c36a8);}_0x4c36a8();})[_0x45de('0x28')](function(_0x3556e8){_0x4c36a8(_0x3556e8);});},'afterCreate':function(_0x3ba700,_0x4a8aa2,_0x534407){var _0x5e4eac=getUserApplications(_0x3ba700,_0x3ba700[_0x45de('0x27')]);if(_0x3ba700[_0x45de('0x27')]!=_0x3ba700[_0x45de('0x13')]){_0x5e4eac=_0x5e4eac[_0x45de('0x37')](getUserApplications(_0x3ba700,_0x3ba700[_0x45de('0x13')]));}return Promise['resolve']()['then'](function(){if(!_0x3ba700[_0x45de('0x38')]){return _0x3ba700[_0x45de('0x39')]({'clientSideLoggingLevel':_0x45de('0x3a'),'clientSideLoggingEnabled':![]});}})[_0x45de('0x26')](function(){return _0x531bd2['VoiceExtension']['bulkCreate'](_0x5e4eac);})[_0x45de('0x26')](function(){if(_0x3ba700[_0x45de('0x9')]){return getChanSpyPromise(_0x531bd2,_0x3ba700);}})['then'](function(_0x546357){if(_0x546357&&_0x546357[_0x45de('0x21')]){return _0x531bd2[_0x45de('0x3b')][_0x45de('0x3c')](_0x546357);}})[_0x45de('0x26')](function(){_0x534407();})[_0x45de('0x28')](function(_0x3311b8){_0x534407(_0x3311b8);});},'afterUpdate':function(_0x3ca435,_0x1d13ae,_0x21dfa0){return BPromise[_0x45de('0x35')]()[_0x45de('0x26')](function(){if(_0x3ca435[_0x45de('0x36')](_0x45de('0x9'))||_0x3ca435[_0x45de('0x36')](_0x45de('0x18'))){return _0x531bd2[_0x45de('0x3b')][_0x45de('0x3d')]({'where':{'UserId':_0x3ca435['id'],'type':_0x45de('0x5'),'ChanSpyId':{'$ne':null}}})[_0x45de('0x26')](function(){if(_0x3ca435[_0x45de('0x9')]){return getChanSpyPromise(_0x531bd2,_0x3ca435)[_0x45de('0x26')](function(_0x5abf19){if(_0x5abf19&&_0x5abf19['length']){return _0x531bd2[_0x45de('0x3b')][_0x45de('0x3c')](_0x5abf19);}});}});}})[_0x45de('0x26')](function(){if(_0x3ca435[_0x45de('0x36')](_0x45de('0x1b'))||_0x3ca435[_0x45de('0x36')](_0x45de('0x18'))){return _0x531bd2[_0x45de('0x3b')]['destroy']({'where':{'UserId':_0x3ca435['id'],'type':_0x45de('0x5'),'ChanSpyId':null}})[_0x45de('0x26')](function(){var _0x159e7e=getUserApplications(_0x3ca435,_0x3ca435['internal']);if(_0x3ca435['internal']!=_0x3ca435[_0x45de('0x13')]){_0x159e7e=_0x159e7e[_0x45de('0x37')](getUserApplications(_0x3ca435,_0x3ca435[_0x45de('0x13')]));}return _0x531bd2['VoiceExtension'][_0x45de('0x3c')](_0x159e7e);});}})['then'](function(){_0x21dfa0();})[_0x45de('0x28')](function(_0x34643b){_0x21dfa0(_0x34643b);});},'afterDestroy':function(_0x20e5b1){return _0x531bd2['VoiceExtension']['destroy']({'where':{'UserId':_0x20e5b1['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x50df9e,_0x7ecc85){if(!_0x7ecc85){return this[_0x45de('0x11')]===this['encryptPassword'](_0x50df9e);}var _0x56c516=this;this[_0x45de('0x3e')](_0x50df9e,function(_0xa7ebbb,_0xbc430a){if(_0xa7ebbb){_0x7ecc85(_0xa7ebbb);}if(_0x56c516['password']===_0xbc430a){_0x7ecc85(null,!![]);}else{_0x7ecc85(null,![]);}});},'makeSalt':function(_0x521bcb,_0x503bd3){var _0x5636b9=0x10;if(typeof arguments[0x0]===_0x45de('0x3f')){_0x503bd3=arguments[0x0];_0x521bcb=_0x5636b9;}else if(typeof arguments[0x1]===_0x45de('0x3f')){_0x503bd3=arguments[0x1];}else{throw new Error(_0x45de('0x40'));}if(!_0x521bcb){_0x521bcb=_0x5636b9;}return crypto['randomBytes'](_0x521bcb,function(_0x3cf986,_0x65684b){if(_0x3cf986){_0x503bd3(_0x3cf986);}return _0x503bd3(null,_0x65684b[_0x45de('0x41')](_0x45de('0x42')));});},'encryptPassword':function(_0x1273be,_0x137a71){if(!_0x1273be||!this[_0x45de('0x43')]){return _0x137a71?_0x137a71(null):null;}var _0x137c53=0x2710;var _0x494bf0=0x40;var _0x296b2a=new Buffer(this['salt'],_0x45de('0x42'));if(!_0x137a71){return crypto[_0x45de('0x44')](_0x1273be,_0x296b2a,_0x137c53,_0x494bf0,'sha1')['toString']('base64');}return crypto[_0x45de('0x45')](_0x1273be,_0x296b2a,_0x137c53,_0x494bf0,'sha1',function(_0x18ee73,_0x1dcafb){if(_0x18ee73){_0x137a71(_0x18ee73);}return _0x137a71(null,_0x1dcafb[_0x45de('0x41')](_0x45de('0x42')));});},'updatePassword':function(_0x5414be){if(!this[_0x45de('0x11')]){return _0x5414be(null);}if(!validatePresenceOf(this[_0x45de('0x11')])&&authTypes['indexOf'](this[_0x45de('0x46')])===-0x1){_0x5414be(new Error(_0x45de('0x47')));}var _0x2751ef=this;this[_0x45de('0x48')](function(_0x5effbc,_0x481a35){if(_0x5effbc){return _0x5414be(_0x5effbc);}_0x2751ef[_0x45de('0x43')]=_0x481a35;_0x2751ef['encryptPassword'](_0x2751ef[_0x45de('0x11')],function(_0x29a57f,_0x3c5b61){if(_0x29a57f){_0x5414be(_0x29a57f);}_0x2751ef[_0x45de('0x11')]=_0x3c5b61;_0x5414be(null);});});},'updateMd5Password':function(){this[_0x45de('0x49')]=md5(this[_0x45de('0x13')]+_0x45de('0x4a')+this['password']);return this['md5secret'];}}});};
\ No newline at end of file
index bcd32e1..29a9d7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd84a=['channel','isValidChannel','voice','system','mail','openchannel','whatsapp','all','LogoutUser','destroy','LoginUser','role','mobile','phone','SIP/%s','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueue.penalty','forEach','LOGIN','callysquare','LOGININPAUSE','loginInPause','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./user.socket','then','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetUser','User','options','raw','where','attributes','limit','include','map','model','debug','stringify','find','ShowUser','UserVoiceQueueRt','update','MemberReport','findAll','name','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','push','format','interface','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','type','UnpauseUser','findOne'];(function(_0x5a5394,_0x207dda){var _0x28a655=function(_0x5db2d1){while(--_0x5db2d1){_0x5a5394['push'](_0x5a5394['shift']());}};_0x28a655(++_0x207dda);}(_0xd84a,0x1b4));var _0xad84=function(_0xb29d84,_0x1536bf){_0xb29d84=_0xb29d84-0x0;var _0x47928b=_0xd84a[_0xb29d84];return _0x47928b;};'use strict';var _=require(_0xad84('0x0'));var util=require(_0xad84('0x1'));var moment=require('moment');var BPromise=require(_0xad84('0x2'));var rs=require(_0xad84('0x3'));var fs=require('fs');var Redis=require(_0xad84('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xad84('0x5'))(_0xad84('0x6'));var config=require(_0xad84('0x7'));var jayson=require(_0xad84('0x8'));var client=jayson[_0xad84('0x9')][_0xad84('0xa')]({'port':0x232a});config[_0xad84('0xb')]=_[_0xad84('0xc')](config[_0xad84('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xad84('0xd'))['register'](socket);function respondWithRpcPromise(_0x4754ef,_0xa798b5,_0x341640){return new BPromise(function(_0x8d6a02,_0x4c2ec9){return client['request'](_0x4754ef,_0x341640)[_0xad84('0xe')](function(_0x4e3c88){logger['info'](_0xad84('0xf'),_0xa798b5,_0xad84('0x10'));logger['debug'](_0xad84('0x11'),_0xa798b5,_0xad84('0x10'),JSON['stringify'](_0x4e3c88));if(_0x4e3c88[_0xad84('0x12')]){if(_0x4e3c88[_0xad84('0x12')]['code']===0x1f4){logger[_0xad84('0x12')](_0xad84('0xf'),_0xa798b5,_0x4e3c88['error']['message']);return _0x4c2ec9(_0x4e3c88['error'][_0xad84('0x13')]);}logger[_0xad84('0x12')](_0xad84('0xf'),_0xa798b5,_0x4e3c88[_0xad84('0x12')][_0xad84('0x13')]);return _0x8d6a02(_0x4e3c88['error']['message']);}else{logger[_0xad84('0x14')](_0xad84('0xf'),_0xa798b5,_0xad84('0x10'));_0x8d6a02(_0x4e3c88[_0xad84('0x15')][_0xad84('0x13')]);}})[_0xad84('0x16')](function(_0x53f9d1){logger[_0xad84('0x12')](_0xad84('0xf'),_0xa798b5,_0x53f9d1);_0x4c2ec9(_0x53f9d1);});});}exports[_0xad84('0x17')]=function(_0x44c72a){var _0x47b0d4=this;return new Promise(function(_0x50fdf5,_0x1e3d2e){return db[_0xad84('0x18')]['findAll']({'raw':_0x44c72a['options']?_0x44c72a[_0xad84('0x19')][_0xad84('0x1a')]===undefined?!![]:![]:!![],'where':_0x44c72a[_0xad84('0x19')]?_0x44c72a[_0xad84('0x19')][_0xad84('0x1b')]||null:null,'attributes':_0x44c72a['options']?_0x44c72a[_0xad84('0x19')][_0xad84('0x1c')]||null:null,'limit':_0x44c72a[_0xad84('0x19')]?_0x44c72a['options'][_0xad84('0x1d')]||null:null,'include':_0x44c72a[_0xad84('0x19')]?_0x44c72a[_0xad84('0x19')][_0xad84('0x1e')]?_[_0xad84('0x1f')](_0x44c72a[_0xad84('0x19')][_0xad84('0x1e')],function(_0x19d5c3){return{'model':db[_0x19d5c3[_0xad84('0x20')]],'as':_0x19d5c3['as'],'attributes':_0x19d5c3[_0xad84('0x1c')],'include':_0x19d5c3[_0xad84('0x1e')]?_[_0xad84('0x1f')](_0x19d5c3['include'],function(_0x54cb46){return{'model':db[_0x54cb46['model']],'as':_0x54cb46['as'],'attributes':_0x54cb46['attributes'],'include':_0x54cb46['include']?_[_0xad84('0x1f')](_0x54cb46[_0xad84('0x1e')],function(_0x2d0eef){return{'model':db[_0x2d0eef[_0xad84('0x20')]],'as':_0x2d0eef['as'],'attributes':_0x2d0eef[_0xad84('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xad84('0xe')](function(_0x12e281){logger[_0xad84('0x14')](_0xad84('0x17'),_0x44c72a);logger[_0xad84('0x21')](_0xad84('0x17'),_0x44c72a,JSON[_0xad84('0x22')](_0x12e281));_0x50fdf5(_0x12e281);})[_0xad84('0x16')](function(_0x2085fd){logger[_0xad84('0x12')](_0xad84('0x17'),_0x2085fd['message'],_0x44c72a);_0x1e3d2e(_0x47b0d4['error'](0x1f4,_0x2085fd[_0xad84('0x13')]));});});};exports['ShowUser']=function(_0xc8283b){var _0x2f1556=this;return new Promise(function(_0x498977,_0x533b3d){return db[_0xad84('0x18')][_0xad84('0x23')]({'raw':_0xc8283b['options']?_0xc8283b['options'][_0xad84('0x1a')]===undefined?!![]:![]:!![],'where':_0xc8283b[_0xad84('0x19')]?_0xc8283b[_0xad84('0x19')][_0xad84('0x1b')]||null:null,'attributes':_0xc8283b[_0xad84('0x19')]?_0xc8283b[_0xad84('0x19')]['attributes']||null:null,'include':_0xc8283b[_0xad84('0x19')]?_0xc8283b[_0xad84('0x19')]['include']?_[_0xad84('0x1f')](_0xc8283b[_0xad84('0x19')][_0xad84('0x1e')],function(_0x5921fb){return{'model':db[_0x5921fb[_0xad84('0x20')]],'as':_0x5921fb['as'],'attributes':_0x5921fb[_0xad84('0x1c')],'include':_0x5921fb[_0xad84('0x1e')]?_[_0xad84('0x1f')](_0x5921fb[_0xad84('0x1e')],function(_0x1614c3){return{'model':db[_0x1614c3[_0xad84('0x20')]],'as':_0x1614c3['as'],'attributes':_0x1614c3['attributes'],'include':_0x1614c3[_0xad84('0x1e')]?_[_0xad84('0x1f')](_0x1614c3[_0xad84('0x1e')],function(_0x3823d3){return{'model':db[_0x3823d3['model']],'as':_0x3823d3['as'],'attributes':_0x3823d3[_0xad84('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xad84('0xe')](function(_0x5e3f05){logger[_0xad84('0x14')](_0xad84('0x24'),_0xc8283b);logger[_0xad84('0x21')](_0xad84('0x24'),_0xc8283b,JSON[_0xad84('0x22')](_0x5e3f05));_0x498977(_0x5e3f05);})[_0xad84('0x16')](function(_0x2931ab){logger['error'](_0xad84('0x24'),_0x2931ab[_0xad84('0x13')],_0xc8283b);_0x533b3d(_0x2f1556[_0xad84('0x12')](0x1f4,_0x2931ab[_0xad84('0x13')]));});});};exports['PauseUser']=function(_0x267b00){var _0x41df27=this;return new Promise(function(_0x2f7ce9,_0x28b2b3){var _0x3b44d4;return db[_0xad84('0x18')]['find']({'where':_0x267b00[_0xad84('0x19')][_0xad84('0x1b')]||{},'attributes':['id','name','role','internal','interface']})[_0xad84('0xe')](function(_0x128e4f){if(_0x128e4f){_0x3b44d4=_0x128e4f;return db[_0xad84('0x25')][_0xad84('0x26')]({'paused':0x1},{'where':{'UserId':_0x3b44d4['id']},'individualHooks':!![]});}})[_0xad84('0xe')](function(){if(_0x3b44d4){return db[_0xad84('0x27')][_0xad84('0x28')]({'where':{'membername':_0x3b44d4[_0xad84('0x29')],'type':_0xad84('0x2a'),'exitAt':null}});}})[_0xad84('0xe')](function(_0x27c15e){if(_0x3b44d4){if(_0x27c15e&&_0x27c15e[_0xad84('0x2b')]){var _0x3ea1c8=moment()['format'](_0xad84('0x2c'));for(var _0x40398a=0x0,_0x504854=_0x27c15e[_0xad84('0x2b')];_0x40398a<_0x504854;_0x40398a++){_0x27c15e[_0x40398a]['updateAttributes']({'exitAt':_0x3ea1c8});}}}})[_0xad84('0xe')](function(){if(_0x3b44d4){var _0x2a6d6d=[];var _0x4cca2d=utils['getChannels']();_0x4cca2d['forEach'](function(_0x16ec9e){_0x2a6d6d[_0xad84('0x2d')]({'channel':_0x16ec9e,'membername':_0x3b44d4['name'],'interface':_['isNil'](_0x3b44d4['interface'])?util[_0xad84('0x2e')]('SIP/%s',_0x3b44d4[_0xad84('0x29')]):_0x3b44d4[_0xad84('0x2f')],'type':_0xad84('0x2a'),'enterAt':moment()[_0xad84('0x2e')](_0xad84('0x2c')),'data1':_0x267b00[_0xad84('0x30')]['type']||_0xad84('0x31'),'role':_0x3b44d4['role'],'internal':_0x3b44d4[_0xad84('0x32')],'uniqueid':_0x267b00[_0xad84('0x30')][_0xad84('0x33')]||null});});return db[_0xad84('0x27')][_0xad84('0x34')](_0x2a6d6d,{'individualHooks':!![]});}})[_0xad84('0xe')](function(){if(_0x3b44d4){return _0x3b44d4['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x267b00[_0xad84('0x30')][_0xad84('0x35')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xad84('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xad84('0xe')](function(_0x3f485e){_0x2f7ce9(_0x3f485e);})[_0xad84('0x16')](function(_0x2127ac){_0x28b2b3(_0x41df27[_0xad84('0x12')](0x1f4,_0x2127ac[_0xad84('0x13')]));});});};exports[_0xad84('0x36')]=function(_0x18e737){var _0x3b5c72=this;return new Promise(function(_0x1a0f62,_0xa5eba8){var _0x134e32;return db[_0xad84('0x18')][_0xad84('0x37')]({'where':_0x18e737[_0xad84('0x19')][_0xad84('0x1b')]||{},'attributes':['id','name']})[_0xad84('0xe')](function(_0x1d4fb9){if(_0x1d4fb9){_0x134e32=_0x1d4fb9;if(_0x18e737[_0xad84('0x30')][_0xad84('0x38')]&&!utils[_0xad84('0x39')](_0x18e737['body'][_0xad84('0x38')])){throw new Error('Unknown\x20channel');}switch(_0x18e737[_0xad84('0x30')][_0xad84('0x38')]){case _0xad84('0x3a'):return db['UserVoiceQueueRt'][_0xad84('0x26')]({'paused':0x0},{'where':{'UserId':_0x134e32['id']}})['then'](function(){return db[_0xad84('0x27')][_0xad84('0x23')]({'where':{'channel':_0x18e737[_0xad84('0x30')][_0xad84('0x38')],'membername':_0x134e32[_0xad84('0x29')],'type':_0xad84('0x2a'),'exitAt':null}});})[_0xad84('0xe')](function(_0x4c95c6){if(_0x4c95c6){return _0x4c95c6[_0xad84('0x26')]({'exitAt':moment()[_0xad84('0x2e')](_0xad84('0x2c')),'data2':_0xad84('0x3b')},{'individualHooks':!![]});}return null;})[_0xad84('0xe')](function(){return _0x134e32[_0xad84('0x26')]({'voicePause':![]});});case _0xad84('0x3c'):case'chat':case'fax':case'sms':case _0xad84('0x3d'):case _0xad84('0x3e'):return db['MemberReport'][_0xad84('0x23')]({'where':{'channel':_0x18e737[_0xad84('0x30')][_0xad84('0x38')],'membername':_0x134e32[_0xad84('0x29')],'type':'PAUSE','exitAt':null}})['then'](function(_0x24465d){return _0x24465d[_0xad84('0x26')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xad84('0x3b')},{'individualHooks':!![]});})['then'](function(){var _0x1efb60={};_['set'](_0x1efb60,util['format']('%s%s',_0x18e737[_0xad84('0x30')]['channel'],'Pause'),![]);return _0x134e32[_0xad84('0x26')](_0x1efb60);});default:return db['UserVoiceQueueRt'][_0xad84('0x26')]({'paused':0x0},{'where':{'UserId':_0x134e32['id']}})[_0xad84('0xe')](function(){return db[_0xad84('0x27')][_0xad84('0x28')]({'where':{'membername':_0x134e32['name'],'type':_0xad84('0x2a'),'exitAt':null}});})['then'](function(_0x29a933){var _0x43ad80=[];_0x29a933['forEach'](function(_0x3a41a2){_0x43ad80[_0xad84('0x2d')](_0x3a41a2[_0xad84('0x26')]({'exitAt':moment()[_0xad84('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xad84('0x3b')}));});return BPromise[_0xad84('0x3f')](_0x43ad80);})[_0xad84('0xe')](function(){return _0x134e32['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xad84('0xe')](function(_0x18d00b){_0x1a0f62(_0x18d00b);})[_0xad84('0x16')](function(_0x528136){_0xa5eba8(_0x3b5c72['error'](0x1f4,_0x528136['message']));});});};exports[_0xad84('0x40')]=function(_0xf27d67){var _0x441bc1=this;return new Promise(function(_0x3e10da,_0xa75f6f){var _0x5d5223;return db[_0xad84('0x18')][_0xad84('0x37')]({'where':_0xf27d67[_0xad84('0x19')][_0xad84('0x1b')]||{},'attributes':['id',_0xad84('0x29')]})[_0xad84('0xe')](function(_0x4dc03a){if(_0x4dc03a){_0x5d5223=_0x4dc03a;return db[_0xad84('0x25')][_0xad84('0x41')]({'where':{'membername':_0x5d5223[_0xad84('0x29')]},'individualHooks':!![]});}})[_0xad84('0xe')](function(){if(_0x5d5223){return db[_0xad84('0x27')][_0xad84('0x28')]({'where':{'membername':_0x5d5223['name'],'exitAt':null}});}})['then'](function(_0x341049){if(_0x5d5223){if(_0x341049&&_0x341049['length']){var _0x3b71c6=[];_0x341049['forEach'](function(_0x2e7196){_0x3b71c6[_0xad84('0x2d')](_0x2e7196['update']({'exitAt':moment()[_0xad84('0x2e')](_0xad84('0x2c'))}));});return BPromise['all'](_0x3b71c6);}}})['then'](function(){if(_0x5d5223){return _0x5d5223[_0xad84('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x533b64){_0x3e10da(_0x533b64);})[_0xad84('0x16')](function(_0x3de5fb){_0xa75f6f(_0x441bc1[_0xad84('0x12')](0x1f4,_0x3de5fb[_0xad84('0x13')]));});});};exports[_0xad84('0x42')]=function(_0x51d8d5){var _0x573649=this;return new Promise(function(_0x10e7d4,_0x547cd6){var _0x1af6fc;var _0xbf87db;var _0xcf3d79;var _0x331b16;return db[_0xad84('0x18')]['findOne']({'where':_0x51d8d5[_0xad84('0x19')]['where']||{},'attributes':['id',_0xad84('0x29'),_0xad84('0x43'),_0xad84('0x44'),_0xad84('0x45'),_0xad84('0x32'),'loginInPause',_0xad84('0x2f')]})[_0xad84('0xe')](function(_0x482ba1){if(_0x482ba1){_0x1af6fc=_0x482ba1;_0x331b16=_0x51d8d5[_0xad84('0x30')][_0xad84('0x2f')]?_0x51d8d5['body'][_0xad84('0x2f')]:util['format'](_0xad84('0x46'),_0x1af6fc[_0xad84('0x29')]);return db[_0xad84('0x18')][_0xad84('0x47')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1af6fc['id']}}});}})[_0xad84('0xe')](function(_0x1f57cf){if(_0x1f57cf){_0xcf3d79=_0x1f57cf;return require(_0xad84('0x48'))[_0xad84('0x49')]();}})[_0xad84('0xe')](function(_0xe4a910){if(_0xe4a910&&_0xe4a910[_0xad84('0x4a')]&&_0xcf3d79>=_0xe4a910[_0xad84('0x4a')]){throw new Error(_0xad84('0x4b'));}})[_0xad84('0xe')](function(){if(_0x1af6fc){return db[_0xad84('0x25')][_0xad84('0x41')]({'where':{'membername':_0x1af6fc[_0xad84('0x29')]},'individualHooks':!![]});}})[_0xad84('0xe')](function(){if(_0x1af6fc){return _0x1af6fc['getVoiceQueues']({'raw':!![]});}})[_0xad84('0xe')](function(_0x271349){if(_0x1af6fc){if(_0x271349){var _0x7c4408=[];_0xbf87db=_0x271349;if(_0xbf87db[_0xad84('0x2b')]){for(var _0x28abb3=0x0;_0x28abb3<_0xbf87db['length'];_0x28abb3++){_0x7c4408[_0xad84('0x2d')](db[_0xad84('0x25')]['upsert']({'membername':_0x1af6fc['name'],'UserId':_0x1af6fc['id'],'queue_name':_0xbf87db[_0x28abb3][_0xad84('0x29')],'VoiceQueueId':_0xbf87db[_0x28abb3]['id'],'interface':_0x331b16,'paused':_0x1af6fc['loginInPause']||![],'penalty':_0xbf87db[_0x28abb3][_0xad84('0x4c')]||0x0}));}return BPromise['all'](_0x7c4408);}}}})[_0xad84('0xe')](function(){if(_0x1af6fc){return db[_0xad84('0x27')][_0xad84('0x28')]({'where':{'membername':_0x1af6fc[_0xad84('0x29')],'exitAt':null}});}})[_0xad84('0xe')](function(_0xdceff1){if(_0x1af6fc){if(_0xdceff1&&_0xdceff1[_0xad84('0x2b')]){var _0x17730c=[];_0xdceff1[_0xad84('0x4d')](function(_0x238bcf){_0x17730c[_0xad84('0x2d')](_0x238bcf['update']({'exitAt':moment()[_0xad84('0x2e')](_0xad84('0x2c'))}));});return BPromise[_0xad84('0x3f')](_0x17730c);}}})[_0xad84('0xe')](function(_0x33348b){if(_0x1af6fc){var _0x54305c=[];var _0x295b37=[];var _0x3dd905=utils['getChannels']();var _0x36a30f={'membername':_0x1af6fc['name'],'interface':_0x331b16,'enterAt':moment()['format'](_0xad84('0x2c')),'role':_0x1af6fc['role'],'internal':_0x1af6fc['internal']};_0x3dd905[_0xad84('0x4d')](function(_0xf36bfb){_0x54305c[_0xad84('0x2d')](_['merge']({'channel':_0xf36bfb,'type':_0xad84('0x4e'),'data1':_0xad84('0x4f'),'data2':_0x331b16},_0x36a30f));if(_0x1af6fc['loginInPause']){_0x295b37[_0xad84('0x2d')](_['merge']({'channel':_0xf36bfb,'type':_0xad84('0x2a'),'data1':_0xad84('0x50')},_0x36a30f));}});return db['MemberReport'][_0xad84('0x34')](_0x54305c['concat'](_0x295b37),{'individualHooks':!![]});}})['then'](function(){if(_0x1af6fc){return _0x1af6fc[_0xad84('0x26')]({'online':!![],'lastLoginAt':moment()[_0xad84('0x2e')](_0xad84('0x2c')),'voicePause':_0x1af6fc['loginInPause']||![],'mailPause':_0x1af6fc['loginInPause']||![],'chatPause':_0x1af6fc[_0xad84('0x51')]||![],'faxPause':_0x1af6fc[_0xad84('0x51')]||![],'smsPause':_0x1af6fc['loginInPause']||![],'openchannelPause':_0x1af6fc[_0xad84('0x51')]||![],'pauseType':_0x1af6fc[_0xad84('0x51')]?_0xad84('0x50'):null,'lastPauseAt':moment()['format'](_0xad84('0x2c')),'interface':_0x331b16});}})['then'](function(_0x24dfad){_0x10e7d4(_0x24dfad);})[_0xad84('0x16')](function(_0x166a72){_0x547cd6(_0x573649[_0xad84('0x12')](0x1f4,_0x166a72[_0xad84('0x13')]));});});};
\ No newline at end of file
+var _0x3909=['../../mysqldb','../../config/utils','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','findAll','options','attributes','include','map','model','debug','GetUser','ShowUser','User','find','raw','where','name','role','interface','UserVoiceQueueRt','update','PAUSE','length','format','updateAttributes','getChannels','forEach','push','isNil','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','internal','uniqueid','MemberReport','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','system','mail','chat','fax','openchannel','whatsapp','set','%s%s','LogoutUser','destroy','all','LoginUser','mobile','phone','loginInPause','SIP/%s','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','concat','lodash','util','moment','ioredis'];(function(_0x37701c,_0x51f70b){var _0x168673=function(_0x2aa570){while(--_0x2aa570){_0x37701c['push'](_0x37701c['shift']());}};_0x168673(++_0x51f70b);}(_0x3909,0x1be));var _0x9390=function(_0x55d7c2,_0x4ce6fb){_0x55d7c2=_0x55d7c2-0x0;var _0x1755ef=_0x3909[_0x55d7c2];return _0x1755ef;};'use strict';var _=require(_0x9390('0x0'));var util=require(_0x9390('0x1'));var moment=require(_0x9390('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9390('0x3'));var db=require(_0x9390('0x4'))['db'];var utils=require(_0x9390('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9390('0x6'));var client=jayson['client'][_0x9390('0x7')]({'port':0x232a});config[_0x9390('0x8')]=_['defaults'](config[_0x9390('0x8')],{'host':_0x9390('0x9'),'port':0x18eb});var socket=require(_0x9390('0xa'))(new Redis(config[_0x9390('0x8')]));require('./user.socket')[_0x9390('0xb')](socket);function respondWithRpcPromise(_0xf44303,_0x21b76b,_0x29f808){return new BPromise(function(_0x147258,_0x458dc4){return client[_0x9390('0xc')](_0xf44303,_0x29f808)[_0x9390('0xd')](function(_0x81dad1){logger['info'](_0x9390('0xe'),_0x21b76b,'request\x20sent');logger['debug'](_0x9390('0xf'),_0x21b76b,_0x9390('0x10'),JSON[_0x9390('0x11')](_0x81dad1));if(_0x81dad1[_0x9390('0x12')]){if(_0x81dad1['error']['code']===0x1f4){logger[_0x9390('0x12')](_0x9390('0xe'),_0x21b76b,_0x81dad1[_0x9390('0x12')][_0x9390('0x13')]);return _0x458dc4(_0x81dad1['error'][_0x9390('0x13')]);}logger[_0x9390('0x12')]('User,\x20%s,\x20%s',_0x21b76b,_0x81dad1[_0x9390('0x12')][_0x9390('0x13')]);return _0x147258(_0x81dad1[_0x9390('0x12')][_0x9390('0x13')]);}else{logger[_0x9390('0x14')]('User,\x20%s,\x20%s',_0x21b76b,_0x9390('0x10'));_0x147258(_0x81dad1[_0x9390('0x15')][_0x9390('0x13')]);}})[_0x9390('0x16')](function(_0x1f8696){logger[_0x9390('0x12')](_0x9390('0xe'),_0x21b76b,_0x1f8696);_0x458dc4(_0x1f8696);});});}exports['GetUser']=function(_0x219bdf){var _0x3df61c=this;return new Promise(function(_0x27aace,_0x568a17){return db['User'][_0x9390('0x17')]({'raw':_0x219bdf[_0x9390('0x18')]?_0x219bdf[_0x9390('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x219bdf[_0x9390('0x18')]?_0x219bdf['options']['where']||null:null,'attributes':_0x219bdf[_0x9390('0x18')]?_0x219bdf[_0x9390('0x18')][_0x9390('0x19')]||null:null,'limit':_0x219bdf[_0x9390('0x18')]?_0x219bdf[_0x9390('0x18')]['limit']||null:null,'include':_0x219bdf[_0x9390('0x18')]?_0x219bdf[_0x9390('0x18')][_0x9390('0x1a')]?_[_0x9390('0x1b')](_0x219bdf['options'][_0x9390('0x1a')],function(_0x2934e3){return{'model':db[_0x2934e3[_0x9390('0x1c')]],'as':_0x2934e3['as'],'attributes':_0x2934e3[_0x9390('0x19')],'include':_0x2934e3['include']?_[_0x9390('0x1b')](_0x2934e3['include'],function(_0x4aa014){return{'model':db[_0x4aa014[_0x9390('0x1c')]],'as':_0x4aa014['as'],'attributes':_0x4aa014[_0x9390('0x19')],'include':_0x4aa014[_0x9390('0x1a')]?_[_0x9390('0x1b')](_0x4aa014[_0x9390('0x1a')],function(_0x11013c){return{'model':db[_0x11013c[_0x9390('0x1c')]],'as':_0x11013c['as'],'attributes':_0x11013c['attributes']};}):[]};}):[]};}):[]:[]})[_0x9390('0xd')](function(_0x4e9c15){logger['info']('GetUser',_0x219bdf);logger[_0x9390('0x1d')]('GetUser',_0x219bdf,JSON['stringify'](_0x4e9c15));_0x27aace(_0x4e9c15);})[_0x9390('0x16')](function(_0x23d01f){logger['error'](_0x9390('0x1e'),_0x23d01f['message'],_0x219bdf);_0x568a17(_0x3df61c[_0x9390('0x12')](0x1f4,_0x23d01f[_0x9390('0x13')]));});});};exports[_0x9390('0x1f')]=function(_0x425268){var _0x2f2c5b=this;return new Promise(function(_0x46c8f8,_0x40a1e9){return db[_0x9390('0x20')][_0x9390('0x21')]({'raw':_0x425268[_0x9390('0x18')]?_0x425268['options'][_0x9390('0x22')]===undefined?!![]:![]:!![],'where':_0x425268[_0x9390('0x18')]?_0x425268[_0x9390('0x18')][_0x9390('0x23')]||null:null,'attributes':_0x425268[_0x9390('0x18')]?_0x425268[_0x9390('0x18')][_0x9390('0x19')]||null:null,'include':_0x425268[_0x9390('0x18')]?_0x425268[_0x9390('0x18')]['include']?_[_0x9390('0x1b')](_0x425268['options'][_0x9390('0x1a')],function(_0x34e72f){return{'model':db[_0x34e72f[_0x9390('0x1c')]],'as':_0x34e72f['as'],'attributes':_0x34e72f[_0x9390('0x19')],'include':_0x34e72f[_0x9390('0x1a')]?_[_0x9390('0x1b')](_0x34e72f[_0x9390('0x1a')],function(_0x580bde){return{'model':db[_0x580bde['model']],'as':_0x580bde['as'],'attributes':_0x580bde['attributes'],'include':_0x580bde[_0x9390('0x1a')]?_[_0x9390('0x1b')](_0x580bde[_0x9390('0x1a')],function(_0x4fcd78){return{'model':db[_0x4fcd78['model']],'as':_0x4fcd78['as'],'attributes':_0x4fcd78[_0x9390('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9390('0xd')](function(_0x33fa46){logger[_0x9390('0x14')]('ShowUser',_0x425268);logger['debug'](_0x9390('0x1f'),_0x425268,JSON[_0x9390('0x11')](_0x33fa46));_0x46c8f8(_0x33fa46);})[_0x9390('0x16')](function(_0xf40079){logger[_0x9390('0x12')](_0x9390('0x1f'),_0xf40079[_0x9390('0x13')],_0x425268);_0x40a1e9(_0x2f2c5b[_0x9390('0x12')](0x1f4,_0xf40079[_0x9390('0x13')]));});});};exports['PauseUser']=function(_0xb30880){var _0x388e0a=this;return new Promise(function(_0x5b49d0,_0x436435){var _0x4957c6;return db[_0x9390('0x20')][_0x9390('0x21')]({'where':_0xb30880['options'][_0x9390('0x23')]||{},'attributes':['id',_0x9390('0x24'),_0x9390('0x25'),'internal',_0x9390('0x26')]})['then'](function(_0x4063c2){if(_0x4063c2){_0x4957c6=_0x4063c2;return db[_0x9390('0x27')][_0x9390('0x28')]({'paused':0x1},{'where':{'UserId':_0x4957c6['id']},'individualHooks':!![]});}})['then'](function(){if(_0x4957c6){return db['MemberReport']['findAll']({'where':{'membername':_0x4957c6[_0x9390('0x24')],'type':_0x9390('0x29'),'exitAt':null}});}})[_0x9390('0xd')](function(_0x5f12b6){if(_0x4957c6){if(_0x5f12b6&&_0x5f12b6[_0x9390('0x2a')]){var _0x5d9b32=moment()[_0x9390('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x225b15=0x0,_0x4dde20=_0x5f12b6['length'];_0x225b15<_0x4dde20;_0x225b15++){_0x5f12b6[_0x225b15][_0x9390('0x2c')]({'exitAt':_0x5d9b32});}}}})['then'](function(){if(_0x4957c6){var _0x391e1e=[];var _0x2810c2=utils[_0x9390('0x2d')]();_0x2810c2[_0x9390('0x2e')](function(_0x336883){_0x391e1e[_0x9390('0x2f')]({'channel':_0x336883,'membername':_0x4957c6[_0x9390('0x24')],'interface':_[_0x9390('0x30')](_0x4957c6[_0x9390('0x26')])?util[_0x9390('0x2b')]('SIP/%s',_0x4957c6[_0x9390('0x24')]):_0x4957c6[_0x9390('0x26')],'type':_0x9390('0x29'),'enterAt':moment()[_0x9390('0x2b')](_0x9390('0x31')),'data1':_0xb30880[_0x9390('0x32')][_0x9390('0x33')]||_0x9390('0x34'),'role':_0x4957c6['role'],'internal':_0x4957c6[_0x9390('0x35')],'uniqueid':_0xb30880[_0x9390('0x32')][_0x9390('0x36')]||null});});return db[_0x9390('0x37')][_0x9390('0x38')](_0x391e1e,{'individualHooks':!![]});}})[_0x9390('0xd')](function(){if(_0x4957c6){return _0x4957c6[_0x9390('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0xb30880[_0x9390('0x32')][_0x9390('0x33')]||_0x9390('0x34'),'lastPauseAt':moment()['format'](_0x9390('0x31'))});}})[_0x9390('0xd')](function(_0x517684){_0x5b49d0(_0x517684);})['catch'](function(_0x4403b5){_0x436435(_0x388e0a[_0x9390('0x12')](0x1f4,_0x4403b5[_0x9390('0x13')]));});});};exports[_0x9390('0x39')]=function(_0x14a1a0){var _0x154995=this;return new Promise(function(_0x4feaa5,_0x10333b){var _0xb49494;return db[_0x9390('0x20')][_0x9390('0x3a')]({'where':_0x14a1a0[_0x9390('0x18')][_0x9390('0x23')]||{},'attributes':['id','name']})[_0x9390('0xd')](function(_0x12454c){if(_0x12454c){_0xb49494=_0x12454c;if(_0x14a1a0[_0x9390('0x32')][_0x9390('0x3b')]&&!utils[_0x9390('0x3c')](_0x14a1a0[_0x9390('0x32')][_0x9390('0x3b')])){throw new Error(_0x9390('0x3d'));}switch(_0x14a1a0[_0x9390('0x32')][_0x9390('0x3b')]){case'voice':return db[_0x9390('0x27')][_0x9390('0x28')]({'paused':0x0},{'where':{'UserId':_0xb49494['id']}})[_0x9390('0xd')](function(){return db[_0x9390('0x37')][_0x9390('0x21')]({'where':{'channel':_0x14a1a0['body']['channel'],'membername':_0xb49494[_0x9390('0x24')],'type':'PAUSE','exitAt':null}});})[_0x9390('0xd')](function(_0x11de61){if(_0x11de61){return _0x11de61['update']({'exitAt':moment()[_0x9390('0x2b')](_0x9390('0x31')),'data2':_0x9390('0x3e')},{'individualHooks':!![]});}return null;})[_0x9390('0xd')](function(){return _0xb49494[_0x9390('0x28')]({'voicePause':![]});});case _0x9390('0x3f'):case _0x9390('0x40'):case _0x9390('0x41'):case'sms':case _0x9390('0x42'):case _0x9390('0x43'):return db[_0x9390('0x37')][_0x9390('0x21')]({'where':{'channel':_0x14a1a0[_0x9390('0x32')][_0x9390('0x3b')],'membername':_0xb49494[_0x9390('0x24')],'type':_0x9390('0x29'),'exitAt':null}})[_0x9390('0xd')](function(_0x12d24b){return _0x12d24b[_0x9390('0x28')]({'exitAt':moment()[_0x9390('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x9390('0x3e')},{'individualHooks':!![]});})[_0x9390('0xd')](function(){var _0x1dd42d={};_[_0x9390('0x44')](_0x1dd42d,util[_0x9390('0x2b')](_0x9390('0x45'),_0x14a1a0[_0x9390('0x32')]['channel'],'Pause'),![]);return _0xb49494['update'](_0x1dd42d);});default:return db[_0x9390('0x27')][_0x9390('0x28')]({'paused':0x0},{'where':{'UserId':_0xb49494['id']}})[_0x9390('0xd')](function(){return db[_0x9390('0x37')]['findAll']({'where':{'membername':_0xb49494[_0x9390('0x24')],'type':'PAUSE','exitAt':null}});})[_0x9390('0xd')](function(_0x404d75){var _0x14c3df=[];_0x404d75['forEach'](function(_0x5ee9db){_0x14c3df[_0x9390('0x2f')](_0x5ee9db[_0x9390('0x28')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x9390('0x3e')}));});return BPromise['all'](_0x14c3df);})[_0x9390('0xd')](function(){return _0xb49494[_0x9390('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x350abf){_0x4feaa5(_0x350abf);})[_0x9390('0x16')](function(_0x65cc79){_0x10333b(_0x154995[_0x9390('0x12')](0x1f4,_0x65cc79[_0x9390('0x13')]));});});};exports[_0x9390('0x46')]=function(_0x3ba5be){var _0xf6c52a=this;return new Promise(function(_0x1f7d8e,_0x1263a9){var _0x2f537f;return db[_0x9390('0x20')][_0x9390('0x3a')]({'where':_0x3ba5be[_0x9390('0x18')][_0x9390('0x23')]||{},'attributes':['id',_0x9390('0x24')]})[_0x9390('0xd')](function(_0x5e5fc6){if(_0x5e5fc6){_0x2f537f=_0x5e5fc6;return db['UserVoiceQueueRt'][_0x9390('0x47')]({'where':{'membername':_0x2f537f[_0x9390('0x24')]},'individualHooks':!![]});}})[_0x9390('0xd')](function(){if(_0x2f537f){return db[_0x9390('0x37')][_0x9390('0x17')]({'where':{'membername':_0x2f537f[_0x9390('0x24')],'exitAt':null}});}})[_0x9390('0xd')](function(_0x4149e1){if(_0x2f537f){if(_0x4149e1&&_0x4149e1[_0x9390('0x2a')]){var _0x5dd831=[];_0x4149e1['forEach'](function(_0x4da841){_0x5dd831[_0x9390('0x2f')](_0x4da841[_0x9390('0x28')]({'exitAt':moment()[_0x9390('0x2b')](_0x9390('0x31'))}));});return BPromise[_0x9390('0x48')](_0x5dd831);}}})[_0x9390('0xd')](function(){if(_0x2f537f){return _0x2f537f[_0x9390('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9390('0xd')](function(_0x208403){_0x1f7d8e(_0x208403);})[_0x9390('0x16')](function(_0x139b6d){_0x1263a9(_0xf6c52a[_0x9390('0x12')](0x1f4,_0x139b6d[_0x9390('0x13')]));});});};exports[_0x9390('0x49')]=function(_0x5a0d9d){var _0x2f003a=this;return new Promise(function(_0x2295ec,_0x2e1363){var _0x100961;var _0x20a757;var _0x3cb59c;var _0x1f50ad;return db[_0x9390('0x20')][_0x9390('0x3a')]({'where':_0x5a0d9d[_0x9390('0x18')]['where']||{},'attributes':['id','name','role',_0x9390('0x4a'),_0x9390('0x4b'),'internal',_0x9390('0x4c'),'interface']})[_0x9390('0xd')](function(_0x2ecc09){if(_0x2ecc09){_0x100961=_0x2ecc09;_0x1f50ad=_0x5a0d9d['body'][_0x9390('0x26')]?_0x5a0d9d[_0x9390('0x32')][_0x9390('0x26')]:util[_0x9390('0x2b')](_0x9390('0x4d'),_0x100961[_0x9390('0x24')]);return db['User'][_0x9390('0x4e')]({'where':{'role':_0x9390('0x4f'),'online':!![],'id':{'$ne':_0x100961['id']}}});}})[_0x9390('0xd')](function(_0x88dca2){if(_0x88dca2){_0x3cb59c=_0x88dca2;return require('../../config/license/util')[_0x9390('0x50')]();}})['then'](function(_0x2af43e){if(_0x2af43e&&_0x2af43e['agents']&&_0x3cb59c>=_0x2af43e[_0x9390('0x51')]){throw new Error(_0x9390('0x52'));}})['then'](function(){if(_0x100961){return db[_0x9390('0x27')][_0x9390('0x47')]({'where':{'membername':_0x100961[_0x9390('0x24')]},'individualHooks':!![]});}})[_0x9390('0xd')](function(){if(_0x100961){return _0x100961[_0x9390('0x53')]({'raw':!![]});}})[_0x9390('0xd')](function(_0x509380){if(_0x100961){if(_0x509380){var _0x162728=[];_0x20a757=_0x509380;if(_0x20a757['length']){for(var _0x51ed55=0x0;_0x51ed55<_0x20a757[_0x9390('0x2a')];_0x51ed55++){_0x162728[_0x9390('0x2f')](db[_0x9390('0x27')][_0x9390('0x54')]({'membername':_0x100961[_0x9390('0x24')],'UserId':_0x100961['id'],'queue_name':_0x20a757[_0x51ed55][_0x9390('0x24')],'VoiceQueueId':_0x20a757[_0x51ed55]['id'],'interface':_0x1f50ad,'paused':_0x100961[_0x9390('0x4c')]||![],'penalty':_0x20a757[_0x51ed55][_0x9390('0x55')]||0x0}));}return BPromise['all'](_0x162728);}}}})[_0x9390('0xd')](function(){if(_0x100961){return db['MemberReport']['findAll']({'where':{'membername':_0x100961['name'],'exitAt':null}});}})[_0x9390('0xd')](function(_0x51af79){if(_0x100961){if(_0x51af79&&_0x51af79[_0x9390('0x2a')]){var _0x4c1913=[];_0x51af79[_0x9390('0x2e')](function(_0x3e6c2a){_0x4c1913[_0x9390('0x2f')](_0x3e6c2a[_0x9390('0x28')]({'exitAt':moment()[_0x9390('0x2b')](_0x9390('0x31'))}));});return BPromise[_0x9390('0x48')](_0x4c1913);}}})[_0x9390('0xd')](function(_0x5c7463){if(_0x100961){var _0x5926f1=[];var _0x90e73d=[];var _0x455c50=utils[_0x9390('0x2d')]();var _0x5e4ca5={'membername':_0x100961[_0x9390('0x24')],'interface':_0x1f50ad,'enterAt':moment()['format'](_0x9390('0x31')),'role':_0x100961[_0x9390('0x25')],'internal':_0x100961[_0x9390('0x35')]};_0x455c50['forEach'](function(_0x3308f2){_0x5926f1[_0x9390('0x2f')](_[_0x9390('0x56')]({'channel':_0x3308f2,'type':_0x9390('0x57'),'data1':'callysquare','data2':_0x1f50ad},_0x5e4ca5));if(_0x100961['loginInPause']){_0x90e73d['push'](_[_0x9390('0x56')]({'channel':_0x3308f2,'type':_0x9390('0x29'),'data1':_0x9390('0x58')},_0x5e4ca5));}});return db[_0x9390('0x37')][_0x9390('0x38')](_0x5926f1[_0x9390('0x59')](_0x90e73d),{'individualHooks':!![]});}})[_0x9390('0xd')](function(){if(_0x100961){return _0x100961[_0x9390('0x28')]({'online':!![],'lastLoginAt':moment()['format'](_0x9390('0x31')),'voicePause':_0x100961[_0x9390('0x4c')]||![],'mailPause':_0x100961[_0x9390('0x4c')]||![],'chatPause':_0x100961['loginInPause']||![],'faxPause':_0x100961[_0x9390('0x4c')]||![],'smsPause':_0x100961[_0x9390('0x4c')]||![],'openchannelPause':_0x100961[_0x9390('0x4c')]||![],'pauseType':_0x100961[_0x9390('0x4c')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x9390('0x2b')](_0x9390('0x31')),'interface':_0x1f50ad});}})[_0x9390('0xd')](function(_0x106fc8){_0x2295ec(_0x106fc8);})[_0x9390('0x16')](function(_0x3a0668){_0x2e1363(_0x2f003a[_0x9390('0x12')](0x1f4,_0x3a0668[_0x9390('0x13')]));});});};
\ No newline at end of file
index 9c49440..537a29c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f37=['user:','./user.events','save','remove','update'];(function(_0xe0e53b,_0x243a2f){var _0x4781bc=function(_0x3c9cf5){while(--_0x3c9cf5){_0xe0e53b['push'](_0xe0e53b['shift']());}};_0x4781bc(++_0x243a2f);}(_0x7f37,0x191));var _0x77f3=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x7f37[_0x53ccf2];return _0x5a2964;};'use strict';var UserEvents=require(_0x77f3('0x0'));var events=[_0x77f3('0x1'),_0x77f3('0x2'),_0x77f3('0x3')];function createListener(_0x43b653,_0x2d05f8){return function(_0x2f9cfc){_0x2d05f8['emit'](_0x43b653,_0x2f9cfc);};}function removeListener(_0x30fe76,_0x2619c6){return function(){UserEvents['removeListener'](_0x30fe76,_0x2619c6);};}exports['register']=function(_0x5dfc23){for(var _0x43da6b=0x0,_0x24d731=events['length'];_0x43da6b<_0x24d731;_0x43da6b++){var _0x5056fa=events[_0x43da6b];var _0x1e7ab4=createListener(_0x77f3('0x4')+_0x5056fa,_0x5dfc23);UserEvents['on'](_0x5056fa,_0x1e7ab4);}};
\ No newline at end of file
+var _0x0997=['remove','update','emit','length','./user.events'];(function(_0x17b63b,_0x3fbdd2){var _0x3c8d4c=function(_0xa20aed){while(--_0xa20aed){_0x17b63b['push'](_0x17b63b['shift']());}};_0x3c8d4c(++_0x3fbdd2);}(_0x0997,0x126));var _0x7099=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0997[_0x321bb2];return _0x9c12ed;};'use strict';var UserEvents=require(_0x7099('0x0'));var events=['save',_0x7099('0x1'),_0x7099('0x2')];function createListener(_0x359450,_0x1fac66){return function(_0x1d4bfb){_0x1fac66[_0x7099('0x3')](_0x359450,_0x1d4bfb);};}function removeListener(_0x5af096,_0x3d06f4){return function(){UserEvents['removeListener'](_0x5af096,_0x3d06f4);};}exports['register']=function(_0x2200ee){for(var _0x197d03=0x0,_0x1a6e91=events[_0x7099('0x4')];_0x197d03<_0x1a6e91;_0x197d03++){var _0x1f450e=events[_0x197d03];var _0x273a30=createListener('user:'+_0x1f450e,_0x2200ee);UserEvents['on'](_0x1f450e,_0x273a30);}};
\ No newline at end of file
index 12fc76a..719e6ce 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(_0x2c1945,_0x7e2a19){var _0x560d48=function(_0x1c7ad7){while(--_0x1c7ad7){_0x2c1945['push'](_0x2c1945['shift']());}};_0x560d48(++_0x7e2a19);}(_0x70e0,0x17b));var _0x070e=function(_0x47cfd9,_0x4750ce){_0x47cfd9=_0x47cfd9-0x0;var _0x5d9162=_0x70e0[_0x47cfd9];return _0x5d9162;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x515232,_0x3de920){var _0x45685c=function(_0x25bae8){while(--_0x25bae8){_0x515232['push'](_0x515232['shift']());}};_0x45685c(++_0x3de920);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 7381efa..55d30cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2684=['sequelize','exports','INTEGER'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x2684,0xed));var _0x4268=function(_0x1839b4,_0x40c755){_0x1839b4=_0x1839b4-0x0;var _0x57e98c=_0x2684[_0x1839b4];return _0x57e98c;};'use strict';var Sequelize=require(_0x4268('0x0'));module[_0x4268('0x1')]={'penalty':{'type':Sequelize[_0x4268('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x90c7=['sequelize','exports','INTEGER'];(function(_0x4b182c,_0xb96845){var _0x5e3a1f=function(_0x5eabed){while(--_0x5eabed){_0x4b182c['push'](_0x4b182c['shift']());}};_0x5e3a1f(++_0xb96845);}(_0x90c7,0x72));var _0x790c=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x90c7[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x790c('0x0'));module[_0x790c('0x1')]={'penalty':{'type':Sequelize[_0x790c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 18a06c6..7222871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7ee=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues'];(function(_0x34fe23,_0x39ac8a){var _0x4f3712=function(_0xb39d0d){while(--_0xb39d0d){_0x34fe23['push'](_0x34fe23['shift']());}};_0x4f3712(++_0x39ac8a);}(_0xa7ee,0x75));var _0xea7e=function(_0x4ccf96,_0x34978e){_0x4ccf96=_0x4ccf96-0x0;var _0xd103b7=_0xa7ee[_0x4ccf96];return _0xd103b7;};'use strict';var _=require(_0xea7e('0x0'));var util=require(_0xea7e('0x1'));var logger=require(_0xea7e('0x2'))(_0xea7e('0x3'));var moment=require(_0xea7e('0x4'));var BPromise=require(_0xea7e('0x5'));var rp=require(_0xea7e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea7e('0x7'));var config=require(_0xea7e('0x8'));var attributes=require(_0xea7e('0x9'));module[_0xea7e('0xa')]=function(_0x2a4ccd,_0x6c1bbd){return _0x2a4ccd[_0xea7e('0xb')]('UserChatQueue',attributes,{'tableName':_0xea7e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac7a=['path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','util','api','request-promise'];(function(_0x636f04,_0x49360a){var _0x1c6cae=function(_0x49586e){while(--_0x49586e){_0x636f04['push'](_0x636f04['shift']());}};_0x1c6cae(++_0x49360a);}(_0xac7a,0xf9));var _0xaac7=function(_0x38021d,_0x10adfb){_0x38021d=_0x38021d-0x0;var _0x2b4443=_0xac7a[_0x38021d];return _0x2b4443;};'use strict';var _=require('lodash');var util=require(_0xaac7('0x0'));var logger=require('../../config/logger')(_0xaac7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaac7('0x2'));var fs=require('fs');var path=require(_0xaac7('0x3'));var rimraf=require(_0xaac7('0x4'));var config=require('../../config/environment');var attributes=require(_0xaac7('0x5'));module[_0xaac7('0x6')]=function(_0x1be14b,_0x5b9106){return _0x1be14b[_0xaac7('0x7')](_0xaac7('0x8'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cb8e3d5..564d2ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7cb=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x3da3e4,_0x1368e1){var _0x4ba47b=function(_0x34c798){while(--_0x34c798){_0x3da3e4['push'](_0x3da3e4['shift']());}};_0x4ba47b(++_0x1368e1);}(_0xe7cb,0x108));var _0xbe7c=function(_0x1f1781,_0x8ffb04){_0x1f1781=_0x1f1781-0x0;var _0x3e5b69=_0xe7cb[_0x1f1781];return _0x3e5b69;};'use strict';var _=require(_0xbe7c('0x0'));var util=require('util');var moment=require(_0xbe7c('0x1'));var BPromise=require(_0xbe7c('0x2'));var rs=require(_0xbe7c('0x3'));var fs=require('fs');var Redis=require(_0xbe7c('0x4'));var db=require(_0xbe7c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbe7c('0x6'));var config=require(_0xbe7c('0x7'));var jayson=require(_0xbe7c('0x8'));var client=jayson[_0xbe7c('0x9')][_0xbe7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fe365,_0x5ba359,_0x5a918b){return new BPromise(function(_0x3a7421,_0xba355a){return client[_0xbe7c('0xb')](_0x1fe365,_0x5a918b)[_0xbe7c('0xc')](function(_0x13c14a){logger['info'](_0xbe7c('0xd'),_0x5ba359,_0xbe7c('0xe'));logger[_0xbe7c('0xf')](_0xbe7c('0x10'),_0x5ba359,_0xbe7c('0xe'),JSON[_0xbe7c('0x11')](_0x13c14a));if(_0x13c14a[_0xbe7c('0x12')]){if(_0x13c14a[_0xbe7c('0x12')][_0xbe7c('0x13')]===0x1f4){logger[_0xbe7c('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x5ba359,_0x13c14a['error'][_0xbe7c('0x14')]);return _0xba355a(_0x13c14a['error'][_0xbe7c('0x14')]);}logger['error'](_0xbe7c('0xd'),_0x5ba359,_0x13c14a[_0xbe7c('0x12')][_0xbe7c('0x14')]);return _0x3a7421(_0x13c14a[_0xbe7c('0x12')][_0xbe7c('0x14')]);}else{logger[_0xbe7c('0x15')](_0xbe7c('0xd'),_0x5ba359,_0xbe7c('0xe'));_0x3a7421(_0x13c14a[_0xbe7c('0x16')][_0xbe7c('0x14')]);}})[_0xbe7c('0x17')](function(_0xc37c88){logger[_0xbe7c('0x12')](_0xbe7c('0xd'),_0x5ba359,_0xc37c88);_0xba355a(_0xc37c88);});});}
\ No newline at end of file
+var _0x40fe=['code','message','UserChatQueue,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x3372dc,_0x18ff49){var _0x511d15=function(_0x310ffe){while(--_0x310ffe){_0x3372dc['push'](_0x3372dc['shift']());}};_0x511d15(++_0x18ff49);}(_0x40fe,0x1e8));var _0xe40f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x40fe[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xe40f('0x0'));var util=require(_0xe40f('0x1'));var moment=require(_0xe40f('0x2'));var BPromise=require(_0xe40f('0x3'));var rs=require(_0xe40f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe40f('0x5'));var logger=require(_0xe40f('0x6'))(_0xe40f('0x7'));var config=require(_0xe40f('0x8'));var jayson=require(_0xe40f('0x9'));var client=jayson['client'][_0xe40f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e30a,_0x125aa1,_0x3b3e26){return new BPromise(function(_0x462a44,_0x187d0c){return client[_0xe40f('0xb')](_0x45e30a,_0x3b3e26)[_0xe40f('0xc')](function(_0x4abbfe){logger[_0xe40f('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x125aa1,_0xe40f('0xe'));logger[_0xe40f('0xf')](_0xe40f('0x10'),_0x125aa1,_0xe40f('0xe'),JSON['stringify'](_0x4abbfe));if(_0x4abbfe[_0xe40f('0x11')]){if(_0x4abbfe[_0xe40f('0x11')][_0xe40f('0x12')]===0x1f4){logger[_0xe40f('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x125aa1,_0x4abbfe[_0xe40f('0x11')][_0xe40f('0x13')]);return _0x187d0c(_0x4abbfe['error'][_0xe40f('0x13')]);}logger[_0xe40f('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x125aa1,_0x4abbfe['error'][_0xe40f('0x13')]);return _0x462a44(_0x4abbfe['error']['message']);}else{logger['info'](_0xe40f('0x14'),_0x125aa1,_0xe40f('0xe'));_0x462a44(_0x4abbfe['result'][_0xe40f('0x13')]);}})[_0xe40f('0x15')](function(_0x2fe62b){logger[_0xe40f('0x11')](_0xe40f('0x14'),_0x125aa1,_0x2fe62b);_0x187d0c(_0x2fe62b);});});}
\ No newline at end of file
index cb3ecce..5af945d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x402439,_0x3a830d){var _0xe4e4f7=function(_0x296761){while(--_0x296761){_0x402439['push'](_0x402439['shift']());}};_0xe4e4f7(++_0x3a830d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'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 191ae79..b9030e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dfe=['STRING','sequelize','exports','INTEGER'];(function(_0x4bc87b,_0xd7011d){var _0x3e939f=function(_0x26fcfc){while(--_0x26fcfc){_0x4bc87b['push'](_0x4bc87b['shift']());}};_0x3e939f(++_0xd7011d);}(_0x5dfe,0x11d));var _0xe5df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5dfe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe5df('0x0'));module[_0xe5df('0x1')]={'penalty':{'type':Sequelize[_0xe5df('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe5df('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xe5df('0x3')]}};
\ No newline at end of file
+var _0xf812=['INTEGER','STRING','sequelize','exports'];(function(_0xdf531,_0x1a4025){var _0x47e1d9=function(_0x3cded6){while(--_0x3cded6){_0xdf531['push'](_0xdf531['shift']());}};_0x47e1d9(++_0x1a4025);}(_0xf812,0x176));var _0x2f81=function(_0x25e434,_0x48e43a){_0x25e434=_0x25e434-0x0;var _0x546adb=_0xf812[_0x25e434];return _0x546adb;};'use strict';var Sequelize=require(_0x2f81('0x0'));module[_0x2f81('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2f81('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2f81('0x3')]}};
\ No newline at end of file
index 441f908..b570acb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b5d=['path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','api','moment','request-promise'];(function(_0x4a22c5,_0x5ac44b){var _0x5ba569=function(_0x2d7312){while(--_0x2d7312){_0x4a22c5['push'](_0x4a22c5['shift']());}};_0x5ba569(++_0x5ac44b);}(_0x1b5d,0x7f));var _0xd1b5=function(_0xa2a38a,_0x187574){_0xa2a38a=_0xa2a38a-0x0;var _0x37144f=_0x1b5d[_0xa2a38a];return _0x37144f;};'use strict';var _=require(_0xd1b5('0x0'));var util=require(_0xd1b5('0x1'));var logger=require('../../config/logger')(_0xd1b5('0x2'));var moment=require(_0xd1b5('0x3'));var BPromise=require('bluebird');var rp=require(_0xd1b5('0x4'));var fs=require('fs');var path=require(_0xd1b5('0x5'));var rimraf=require(_0xd1b5('0x6'));var config=require(_0xd1b5('0x7'));var attributes=require(_0xd1b5('0x8'));module[_0xd1b5('0x9')]=function(_0x3b4f97,_0x2a530c){return _0x3b4f97[_0xd1b5('0xa')](_0xd1b5('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xefce=['api','bluebird','request-promise','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger'];(function(_0xe2b974,_0x5a3e23){var _0x3e4ccb=function(_0x412c65){while(--_0x412c65){_0xe2b974['push'](_0xe2b974['shift']());}};_0x3e4ccb(++_0x5a3e23);}(_0xefce,0xd0));var _0xeefc=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0xefce[_0x4404ff];return _0x5e7b19;};'use strict';var _=require(_0xeefc('0x0'));var util=require('util');var logger=require(_0xeefc('0x1'))(_0xeefc('0x2'));var moment=require('moment');var BPromise=require(_0xeefc('0x3'));var rp=require(_0xeefc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeefc('0x5'));var attributes=require(_0xeefc('0x6'));module['exports']=function(_0x3b1d86,_0x3e27d1){return _0x3b1d86[_0xeefc('0x7')](_0xeefc('0x8'),attributes,{'tableName':_0xeefc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4671691..de157eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa630=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash'];(function(_0x35b330,_0x481b18){var _0x16517e=function(_0x5b3709){while(--_0x5b3709){_0x35b330['push'](_0x35b330['shift']());}};_0x16517e(++_0x481b18);}(_0xa630,0x17b));var _0x0a63=function(_0x273daf,_0x512e18){_0x273daf=_0x273daf-0x0;var _0x19318d=_0xa630[_0x273daf];return _0x19318d;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var moment=require('moment');var BPromise=require(_0x0a63('0x2'));var rs=require(_0x0a63('0x3'));var fs=require('fs');var Redis=require(_0x0a63('0x4'));var db=require(_0x0a63('0x5'))['db'];var utils=require(_0x0a63('0x6'));var logger=require(_0x0a63('0x7'))('rpc');var config=require(_0x0a63('0x8'));var jayson=require(_0x0a63('0x9'));var client=jayson['client'][_0x0a63('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54660f,_0x5810d1,_0x3912be){return new BPromise(function(_0x312407,_0x46cb16){return client[_0x0a63('0xb')](_0x54660f,_0x3912be)['then'](function(_0xa452d1){logger['info'](_0x0a63('0xc'),_0x5810d1,_0x0a63('0xd'));logger[_0x0a63('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x5810d1,_0x0a63('0xd'),JSON['stringify'](_0xa452d1));if(_0xa452d1['error']){if(_0xa452d1[_0x0a63('0xf')][_0x0a63('0x10')]===0x1f4){logger['error'](_0x0a63('0xc'),_0x5810d1,_0xa452d1[_0x0a63('0xf')][_0x0a63('0x11')]);return _0x46cb16(_0xa452d1[_0x0a63('0xf')][_0x0a63('0x11')]);}logger[_0x0a63('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x5810d1,_0xa452d1['error'][_0x0a63('0x11')]);return _0x312407(_0xa452d1[_0x0a63('0xf')][_0x0a63('0x11')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x5810d1,_0x0a63('0xd'));_0x312407(_0xa452d1[_0x0a63('0x12')][_0x0a63('0x11')]);}})[_0x0a63('0x13')](function(_0x318d11){logger[_0x0a63('0xf')](_0x0a63('0xc'),_0x5810d1,_0x318d11);_0x46cb16(_0x318d11);});});}
\ No newline at end of file
+var _0x995e=['stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x995e,0x105));var _0xe995=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x995e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe995('0x0'));var util=require('util');var moment=require(_0xe995('0x1'));var BPromise=require(_0xe995('0x2'));var rs=require(_0xe995('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe995('0x4'))['db'];var utils=require(_0xe995('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe995('0x6'));var jayson=require(_0xe995('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd54f74,_0x4ea614,_0x24d5e6){return new BPromise(function(_0x46d0ce,_0x5300be){return client['request'](_0xd54f74,_0x24d5e6)['then'](function(_0x5624fc){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x4ea614,'request\x20sent');logger[_0xe995('0x8')](_0xe995('0x9'),_0x4ea614,_0xe995('0xa'),JSON[_0xe995('0xb')](_0x5624fc));if(_0x5624fc[_0xe995('0xc')]){if(_0x5624fc[_0xe995('0xc')][_0xe995('0xd')]===0x1f4){logger[_0xe995('0xc')](_0xe995('0xe'),_0x4ea614,_0x5624fc[_0xe995('0xc')]['message']);return _0x5300be(_0x5624fc[_0xe995('0xc')][_0xe995('0xf')]);}logger['error'](_0xe995('0xe'),_0x4ea614,_0x5624fc['error'][_0xe995('0xf')]);return _0x46d0ce(_0x5624fc[_0xe995('0xc')][_0xe995('0xf')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x4ea614,_0xe995('0xa'));_0x46d0ce(_0x5624fc['result'][_0xe995('0xf')]);}})[_0xe995('0x10')](function(_0x281cf6){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4ea614,_0x281cf6);_0x5300be(_0x281cf6);});});}
\ No newline at end of file
index b2ee67c..4cba327 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(_0x32b248,_0x4e4850){var _0x1634c4=function(_0x7bee1e){while(--_0x7bee1e){_0x32b248['push'](_0x32b248['shift']());}};_0x1634c4(++_0x4e4850);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'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(_0x53990b,_0xa5e9e9){var _0x14f232=function(_0x444fbd){while(--_0x444fbd){_0x53990b['push'](_0x53990b['shift']());}};_0x14f232(++_0xa5e9e9);}(_0xe706,0xa3));var _0x6e70=function(_0x399388,_0x378aeb){_0x399388=_0x399388-0x0;var _0x41b8a2=_0xe706[_0x399388];return _0x41b8a2;};'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 8cc24a1..46bb6cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8e9=['exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc8e9,0x18c));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9c8e('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe86f=['sequelize'];(function(_0x213bd,_0x470ad3){var _0x1bc72c=function(_0x41c33b){while(--_0x41c33b){_0x213bd['push'](_0x213bd['shift']());}};_0x1bc72c(++_0x470ad3);}(_0xe86f,0x12a));var _0xfe86=function(_0x3ab67d,_0x588bcf){_0x3ab67d=_0x3ab67d-0x0;var _0x1db612=_0xe86f[_0x3ab67d];return _0x1db612;};'use strict';var Sequelize=require(_0xfe86('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 582a830..7777ca4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9883=['request-promise','path','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9883,0x1c0));var _0x3988=function(_0x4d27bb,_0x211ada){_0x4d27bb=_0x4d27bb-0x0;var _0x30ce08=_0x9883[_0x4d27bb];return _0x30ce08;};'use strict';var _=require(_0x3988('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3988('0x1'));var BPromise=require(_0x3988('0x2'));var rp=require(_0x3988('0x3'));var fs=require('fs');var path=require(_0x3988('0x4'));var rimraf=require('rimraf');var config=require(_0x3988('0x5'));var attributes=require(_0x3988('0x6'));module[_0x3988('0x7')]=function(_0x5a12e8,_0x19c97f){return _0x5a12e8[_0x3988('0x8')](_0x3988('0x9'),attributes,{'tableName':_0x3988('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb877=['user_has_mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x337c7a,_0x450c05){var _0x4ee25e=function(_0x3c111d){while(--_0x3c111d){_0x337c7a['push'](_0x337c7a['shift']());}};_0x4ee25e(++_0x450c05);}(_0xb877,0xdd));var _0x7b87=function(_0x46f26a,_0x5ce445){_0x46f26a=_0x46f26a-0x0;var _0x40092c=_0xb877[_0x46f26a];return _0x40092c;};'use strict';var _=require('lodash');var util=require(_0x7b87('0x0'));var logger=require(_0x7b87('0x1'))(_0x7b87('0x2'));var moment=require(_0x7b87('0x3'));var BPromise=require(_0x7b87('0x4'));var rp=require(_0x7b87('0x5'));var fs=require('fs');var path=require(_0x7b87('0x6'));var rimraf=require(_0x7b87('0x7'));var config=require(_0x7b87('0x8'));var attributes=require('./userMailQueue.attributes');module[_0x7b87('0x9')]=function(_0x56cb91,_0x321861){return _0x56cb91['define']('UserMailQueue',attributes,{'tableName':_0x7b87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 69c6972..0dc509b 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','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x298c0a,_0x2836fa){_0x298c0a=_0x298c0a-0x0;var _0x2d24af=_0x1cb9[_0x298c0a];return _0x2d24af;};'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
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x7217,0x19e));var _0x7721=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7217[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
index debbeb1..cec67f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9735=['sendUserNotification','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x9735,0x1ee));var _0x5973=function(_0x3a1c0e,_0x4ead2c){_0x3a1c0e=_0x3a1c0e-0x0;var _0x46b02b=_0x9735[_0x3a1c0e];return _0x46b02b;};'use strict';var multer=require(_0x5973('0x0'));var util=require(_0x5973('0x1'));var path=require(_0x5973('0x2'));var timeout=require(_0x5973('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5973('0x4'));var auth=require(_0x5973('0x5'));var interaction=require(_0x5973('0x6'));var config=require('../../config/environment');var controller=require(_0x5973('0x7'));router[_0x5973('0x8')]('/',auth[_0x5973('0x9')](),controller[_0x5973('0xa')]);module[_0x5973('0xb')]=router;
\ No newline at end of file
+var _0xa220=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x20561a,_0x19bfc0){var _0x40e249=function(_0x7fc86d){while(--_0x7fc86d){_0x20561a['push'](_0x20561a['shift']());}};_0x40e249(++_0x19bfc0);}(_0xa220,0xd7));var _0x0a22=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa220[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x0a22('0x0'));var util=require(_0x0a22('0x1'));var path=require(_0x0a22('0x2'));var timeout=require('connect-timeout');var express=require(_0x0a22('0x3'));var router=express['Router']();var fs_extra=require(_0x0a22('0x4'));var auth=require(_0x0a22('0x5'));var interaction=require(_0x0a22('0x6'));var config=require(_0x0a22('0x7'));var controller=require(_0x0a22('0x8'));router[_0x0a22('0x9')]('/',auth[_0x0a22('0xa')](),controller[_0x0a22('0xb')]);module[_0x0a22('0xc')]=router;
\ No newline at end of file
index af63a1d..0d7c34e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e4a=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x28995a,_0x145b0e){var _0x4e1113=function(_0x1acc29){while(--_0x1acc29){_0x28995a['push'](_0x28995a['shift']());}};_0x4e1113(++_0x145b0e);}(_0x3e4a,0xc7));var _0xa3e4=function(_0x346e5d,_0x3cccc3){_0x346e5d=_0x346e5d-0x0;var _0x538ec8=_0x3e4a[_0x346e5d];return _0x538ec8;};'use strict';var Sequelize=require(_0xa3e4('0x0'));module[_0xa3e4('0x1')]={'body':{'type':Sequelize[_0xa3e4('0x2')]},'senderName':{'type':Sequelize[_0xa3e4('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xa3e4('0x3')]},'beep':{'type':Sequelize[_0xa3e4('0x4')]}};
\ No newline at end of file
+var _0xcbdd=['TEXT','STRING','BOOLEAN','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xcbdd,0x15f));var _0xdcbd=function(_0x50e058,_0xb610ed){_0x50e058=_0x50e058-0x0;var _0x36bf3b=_0xcbdd[_0x50e058];return _0x36bf3b;};'use strict';var Sequelize=require('sequelize');module[_0xdcbd('0x0')]={'body':{'type':Sequelize[_0xdcbd('0x1')]},'senderName':{'type':Sequelize[_0xdcbd('0x2')]},'recipientsId':{'type':Sequelize[_0xdcbd('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xdcbd('0x3')]}};
\ No newline at end of file
index afe1e43..ae91d9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd866=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','name','body','text','hasOwnProperty','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','create','forEach','recipient','emit','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','union','ids','queue','Queue','push','all','flatten','findOne','map','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd866,0x117));var _0x6d86=function(_0x24853d,_0x16931f){_0x24853d=_0x24853d-0x0;var _0x4c5cff=_0xd866[_0x24853d];return _0x4c5cff;};'use strict';var emlformat=require(_0x6d86('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d86('0x1'));var jsonpatch=require(_0x6d86('0x2'));var rp=require(_0x6d86('0x3'));var moment=require('moment');var BPromise=require(_0x6d86('0x4'));var Mustache=require('mustache');var util=require(_0x6d86('0x5'));var path=require(_0x6d86('0x6'));var sox=require(_0x6d86('0x7'));var csv=require(_0x6d86('0x8'));var ejs=require(_0x6d86('0x9'));var fs=require('fs');var fs_extra=require(_0x6d86('0xa'));var _=require(_0x6d86('0xb'));var squel=require(_0x6d86('0xc'));var crypto=require(_0x6d86('0xd'));var jsforce=require(_0x6d86('0xe'));var deskjs=require(_0x6d86('0xf'));var toCsv=require(_0x6d86('0x8'));var querystring=require('querystring');var Papa=require(_0x6d86('0x10'));var Redis=require(_0x6d86('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6d86('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d86('0x13'))('api');var utils=require(_0x6d86('0x14'));var config=require(_0x6d86('0x15'));var licenseUtil=require(_0x6d86('0x16'));var db=require(_0x6d86('0x17'))['db'];config[_0x6d86('0x18')]=_[_0x6d86('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d86('0x18')]));require(_0x6d86('0x1a'))[_0x6d86('0x1b')](socket);function respondWithStatusCode(_0x4c4886,_0x127962){_0x127962=_0x127962||0xcc;return function(_0x2429fc){if(_0x2429fc){return _0x4c4886[_0x6d86('0x1c')](_0x127962);}return _0x4c4886[_0x6d86('0x1d')](_0x127962)[_0x6d86('0x1e')]();};}function respondWithResult(_0x4ceabf,_0x3d3877){_0x3d3877=_0x3d3877||0xc8;return function(_0x571c7c){if(_0x571c7c){return _0x4ceabf[_0x6d86('0x1d')](_0x3d3877)[_0x6d86('0x1f')](_0x571c7c);}};}function respondWithFilteredResult(_0x470ed2,_0x2d87fa){return function(_0xf28cb){if(_0xf28cb){var _0x2b0bc7=typeof _0x2d87fa[_0x6d86('0x20')]===_0x6d86('0x21')&&typeof _0x2d87fa['limit']==='undefined';var _0x1a0ff1=_0xf28cb[_0x6d86('0x22')];var _0x519a5a=_0x2b0bc7?0x0:_0x2d87fa[_0x6d86('0x20')];var _0x51e2f6=_0x2b0bc7?_0xf28cb[_0x6d86('0x22')]:_0x2d87fa[_0x6d86('0x20')]+_0x2d87fa['limit'];var _0xec05b2;if(_0x51e2f6>=_0x1a0ff1){_0x51e2f6=_0x1a0ff1;_0xec05b2=0xc8;}else{_0xec05b2=0xce;}_0x470ed2['status'](_0xec05b2);return _0x470ed2[_0x6d86('0x23')]('Content-Range',_0x519a5a+'-'+_0x51e2f6+'/'+_0x1a0ff1)[_0x6d86('0x1f')](_0xf28cb);}return null;};}function patchUpdates(_0x2370a4){return function(_0x20099c){try{jsonpatch[_0x6d86('0x24')](_0x20099c,_0x2370a4,!![]);}catch(_0x2642e2){return BPromise[_0x6d86('0x25')](_0x2642e2);}return _0x20099c[_0x6d86('0x26')]();};}function saveUpdates(_0x9f0946,_0x5c74f2){return function(_0x2f3f60){if(_0x2f3f60){return _0x2f3f60[_0x6d86('0x27')](_0x9f0946)[_0x6d86('0x28')](function(_0x3988fe){return _0x3988fe;});}return null;};}function removeEntity(_0xd08d2a,_0x3dd5d3){return function(_0x5d2511){if(_0x5d2511){return _0x5d2511[_0x6d86('0x29')]()[_0x6d86('0x28')](function(){_0xd08d2a[_0x6d86('0x1d')](0xcc)[_0x6d86('0x1e')]();});}};}function handleEntityNotFound(_0x13f401,_0x1d9052){return function(_0x5eac22){if(!_0x5eac22){_0x13f401['sendStatus'](0x194);}return _0x5eac22;};}function handleError(_0xf710bf,_0xc3b96b){_0xc3b96b=_0xc3b96b||0x1f4;return function(_0x2355f3){logger[_0x6d86('0x2a')](_0x2355f3['stack']);if(_0x2355f3[_0x6d86('0x2b')]){delete _0x2355f3[_0x6d86('0x2b')];}_0xf710bf[_0x6d86('0x1d')](_0xc3b96b)['send'](_0x2355f3);};}exports['sendUserNotification']=function(_0x15260e,_0x11411d,_0x5c3b17){if(!_0x15260e[_0x6d86('0x2c')]['hasOwnProperty'](_0x6d86('0x2d'))&&!_0x15260e[_0x6d86('0x2c')][_0x6d86('0x2e')]('TemplateId')){throw new db[(_0x6d86('0x2f'))]['ValidationError'](_0x6d86('0x30'));}else{if(_0x15260e[_0x6d86('0x2c')][_0x6d86('0x2e')](_0x6d86('0x31'))&&!_0x15260e[_0x6d86('0x2c')]['hasOwnProperty'](_0x6d86('0x32'))){throw new db['Sequelize'][(_0x6d86('0x33'))](_0x6d86('0x34'));}if(!_0x15260e['body'][_0x6d86('0x2e')](_0x6d86('0x35'))){throw new db[(_0x6d86('0x2f'))][(_0x6d86('0x33'))](_0x6d86('0x36'));}else{try{var _0x28dc19=JSON[_0x6d86('0x37')](_0x15260e[_0x6d86('0x2c')][_0x6d86('0x35')]);}catch(_0x5a731e){logger[_0x6d86('0x2a')](_0x5a731e);throw new db[(_0x6d86('0x2f'))][(_0x6d86('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x4709c5=[_0x6d86('0x38'),_0x6d86('0x39'),_0x6d86('0x3a'),_0x6d86('0x3b'),_0x6d86('0x3c'),_0x6d86('0x3d'),_0x6d86('0x3e'),_0x6d86('0x3f'),_0x6d86('0x40')];if(_[_0x6d86('0x41')](_0x28dc19,function(_0x3d25bd){return!_[_0x6d86('0x42')](_0x4709c5,_0x3d25bd['model'][_0x6d86('0x43')]());})){throw new db[(_0x6d86('0x2f'))][(_0x6d86('0x33'))](_0x6d86('0x44'));}}}var _0x75b95d={};_0x75b95d['senderName']=_0x15260e[_0x6d86('0x2c')][_0x6d86('0x2e')](_0x6d86('0x45'))?_0x15260e[_0x6d86('0x2c')]['senderName']:_0x15260e[_0x6d86('0x40')][_0x6d86('0x46')];_0x75b95d[_0x6d86('0x47')]=_[_0x6d86('0x48')](_0x15260e['body'][_0x6d86('0x47')])?null:_0x15260e[_0x6d86('0x2c')][_0x6d86('0x47')];_0x75b95d[_0x6d86('0x49')]=_0x15260e[_0x6d86('0x2c')]['beep']||![];_0x75b95d[_0x6d86('0x4a')]=_0x15260e[_0x6d86('0x40')]['id'];return getContent(_0x15260e[_0x6d86('0x2c')])[_0x6d86('0x28')](function(_0x7c98e4){_0x75b95d['body']=_0x7c98e4;return getRecipients(_0x28dc19);})['then'](function(_0x5d0695){_0x75b95d[_0x6d86('0x4b')]=_[_0x6d86('0x4c')](_0x5d0695)[_0x6d86('0x4d')](',');return db[_0x6d86('0x4e')][_0x6d86('0x4f')](function(_0x2212d2){return db['UserNotification'][_0x6d86('0x50')](_0x75b95d,{'raw':!![],'transaction':_0x2212d2})[_0x6d86('0x28')](function(_0x596c44){var _0x2b56ed={'sender':_0x75b95d[_0x6d86('0x45')],'description':_0x75b95d[_0x6d86('0x47')],'content':_0x75b95d[_0x6d86('0x2c')],'beep':_0x75b95d['beep']};_0x5d0695[_0x6d86('0x51')](function(_0x45cc36){_0x2b56ed[_0x6d86('0x52')]=_0x45cc36;socket[_0x6d86('0x53')]('userNotification:send',_0x2b56ed);});return _0x596c44;});});})[_0x6d86('0x28')](respondWithResult(_0x11411d,0xc9))[_0x6d86('0x54')](handleError(_0x11411d,null));};function getContent(_0x289e74){return new BPromise(function(_0x21514a,_0x1a8232){if(_0x289e74[_0x6d86('0x2d')]){_0x21514a(_0x289e74[_0x6d86('0x2d')]);return;}return db['Template']['findOne']({'attributes':[_0x6d86('0x55')],'where':{'id':_0x289e74['TemplateId']},'raw':!![]})[_0x6d86('0x28')](function(_0x13950c){if(!_0x13950c)throw new db[(_0x6d86('0x2f'))][(_0x6d86('0x33'))](_0x6d86('0x56'));var _0x32527e=Mustache['render'](_0x13950c[_0x6d86('0x55')],_0x289e74[_0x6d86('0x32')]);_0x21514a(_0x32527e);})[_0x6d86('0x54')](function(_0x1fe3d9){_0x1a8232(_0x1fe3d9);});});}function getRecipients(_0x113a4c){return new BPromise(function(_0x5d5235,_0x4b4002){var _0x5b7e79=[];var _0x3af35c=[];_0x113a4c['forEach'](function(_0x248325){var _0x55f01b=_[_0x6d86('0x57')](_0x248325['model'][_0x6d86('0x43')]());if(_0x55f01b==='User'){_0x5b7e79=_[_0x6d86('0x58')](_0x5b7e79,_0x248325[_0x6d86('0x59')]);}else{if(_['includes'](_0x55f01b,_0x6d86('0x5a')))_0x55f01b=_0x55f01b['replace']('queue',_0x6d86('0x5b'));_0x248325['ids'][_0x6d86('0x51')](function(_0x19b313){_0x3af35c[_0x6d86('0x5c')](getAgents(_0x55f01b,_0x19b313));});}});return BPromise[_0x6d86('0x5d')](_0x3af35c)[_0x6d86('0x28')](function(_0x43876c){_0x5b7e79=_[_0x6d86('0x58')](_0x5b7e79,_[_0x6d86('0x5e')](_0x43876c));_0x5d5235(_0x5b7e79);})['catch'](function(_0x143dac){_0x4b4002(_0x143dac);});});}function getAgents(_0x44af3e,_0x43810c){return new BPromise(function(_0x1f39e4,_0x271f6f){return db[_0x44af3e][_0x6d86('0x5f')]({'where':{'id':_0x43810c}})[_0x6d86('0x28')](function(_0x49d270){return _0x49d270['getAgents']({'attributes':['id'],'raw':!![]})[_0x6d86('0x28')](function(_0x78240b){var _0x3402d3=_[_0x6d86('0x60')](_0x78240b,'id');_0x1f39e4(_0x3402d3);});})[_0x6d86('0x54')](function(_0x1a56bf){_0x271f6f(_0x1a56bf);});});}
\ No newline at end of file
+var _0xadb0=['sequelize','create','forEach','emit','userNotification:send','catch','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','queue','replace','Queue','push','all','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','sendUserNotification','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','hasOwnProperty','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join'];(function(_0x557b4f,_0x270dc9){var _0x5b2e36=function(_0x50ff1a){while(--_0x50ff1a){_0x557b4f['push'](_0x557b4f['shift']());}};_0x5b2e36(++_0x270dc9);}(_0xadb0,0x7b));var _0x0adb=function(_0x114c66,_0x385fa5){_0x114c66=_0x114c66-0x0;var _0x12473b=_0xadb0[_0x114c66];return _0x12473b;};'use strict';var emlformat=require(_0x0adb('0x0'));var rimraf=require(_0x0adb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0adb('0x2'));var rp=require(_0x0adb('0x3'));var moment=require(_0x0adb('0x4'));var BPromise=require(_0x0adb('0x5'));var Mustache=require(_0x0adb('0x6'));var util=require('util');var path=require(_0x0adb('0x7'));var sox=require(_0x0adb('0x8'));var csv=require('to-csv');var ejs=require(_0x0adb('0x9'));var fs=require('fs');var fs_extra=require(_0x0adb('0xa'));var _=require(_0x0adb('0xb'));var squel=require(_0x0adb('0xc'));var crypto=require(_0x0adb('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0adb('0xe'));var querystring=require(_0x0adb('0xf'));var Papa=require(_0x0adb('0x10'));var Redis=require('ioredis');var authService=require(_0x0adb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0adb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0adb('0x13'))(_0x0adb('0x14'));var utils=require('../../config/utils');var config=require(_0x0adb('0x15'));var licenseUtil=require(_0x0adb('0x16'));var db=require(_0x0adb('0x17'))['db'];config[_0x0adb('0x18')]=_[_0x0adb('0x19')](config[_0x0adb('0x18')],{'host':_0x0adb('0x1a'),'port':0x18eb});var socket=require(_0x0adb('0x1b'))(new Redis(config[_0x0adb('0x18')]));require(_0x0adb('0x1c'))[_0x0adb('0x1d')](socket);function respondWithStatusCode(_0x15c892,_0xea3178){_0xea3178=_0xea3178||0xcc;return function(_0x10e305){if(_0x10e305){return _0x15c892[_0x0adb('0x1e')](_0xea3178);}return _0x15c892[_0x0adb('0x1f')](_0xea3178)[_0x0adb('0x20')]();};}function respondWithResult(_0xe7728e,_0x1bbd36){_0x1bbd36=_0x1bbd36||0xc8;return function(_0x95b4b){if(_0x95b4b){return _0xe7728e[_0x0adb('0x1f')](_0x1bbd36)[_0x0adb('0x21')](_0x95b4b);}};}function respondWithFilteredResult(_0x4377ff,_0x38c3e2){return function(_0x255b33){if(_0x255b33){var _0x6056ba=typeof _0x38c3e2[_0x0adb('0x22')]===_0x0adb('0x23')&&typeof _0x38c3e2[_0x0adb('0x24')]===_0x0adb('0x23');var _0x5c5e1c=_0x255b33['count'];var _0x248847=_0x6056ba?0x0:_0x38c3e2['offset'];var _0x8d425e=_0x6056ba?_0x255b33[_0x0adb('0x25')]:_0x38c3e2['offset']+_0x38c3e2[_0x0adb('0x24')];var _0x4dd9e6;if(_0x8d425e>=_0x5c5e1c){_0x8d425e=_0x5c5e1c;_0x4dd9e6=0xc8;}else{_0x4dd9e6=0xce;}_0x4377ff[_0x0adb('0x1f')](_0x4dd9e6);return _0x4377ff[_0x0adb('0x26')](_0x0adb('0x27'),_0x248847+'-'+_0x8d425e+'/'+_0x5c5e1c)['json'](_0x255b33);}return null;};}function patchUpdates(_0x2d027b){return function(_0x3c4f42){try{jsonpatch[_0x0adb('0x28')](_0x3c4f42,_0x2d027b,!![]);}catch(_0x4e3115){return BPromise['reject'](_0x4e3115);}return _0x3c4f42[_0x0adb('0x29')]();};}function saveUpdates(_0x124d60,_0x8349a5){return function(_0x4abb96){if(_0x4abb96){return _0x4abb96[_0x0adb('0x2a')](_0x124d60)[_0x0adb('0x2b')](function(_0x3a1917){return _0x3a1917;});}return null;};}function removeEntity(_0x44db,_0x4b5882){return function(_0x2adc9d){if(_0x2adc9d){return _0x2adc9d[_0x0adb('0x2c')]()[_0x0adb('0x2b')](function(){_0x44db[_0x0adb('0x1f')](0xcc)[_0x0adb('0x20')]();});}};}function handleEntityNotFound(_0x47c204,_0x3d213b){return function(_0x1814d1){if(!_0x1814d1){_0x47c204[_0x0adb('0x1e')](0x194);}return _0x1814d1;};}function handleError(_0x29067b,_0x54747a){_0x54747a=_0x54747a||0x1f4;return function(_0x4a4b93){logger['error'](_0x4a4b93[_0x0adb('0x2d')]);if(_0x4a4b93[_0x0adb('0x2e')]){delete _0x4a4b93['name'];}_0x29067b[_0x0adb('0x1f')](_0x54747a)['send'](_0x4a4b93);};}exports[_0x0adb('0x2f')]=function(_0x2032c0,_0x340410,_0x4e7b08){if(!_0x2032c0['body']['hasOwnProperty']('text')&&!_0x2032c0['body']['hasOwnProperty'](_0x0adb('0x30'))){throw new db[(_0x0adb('0x31'))][(_0x0adb('0x32'))](_0x0adb('0x33'));}else{if(_0x2032c0[_0x0adb('0x34')][_0x0adb('0x35')](_0x0adb('0x30'))&&!_0x2032c0[_0x0adb('0x34')]['hasOwnProperty'](_0x0adb('0x36'))){throw new db['Sequelize']['ValidationError'](_0x0adb('0x37'));}if(!_0x2032c0[_0x0adb('0x34')][_0x0adb('0x35')](_0x0adb('0x38'))){throw new db['Sequelize'][(_0x0adb('0x32'))](_0x0adb('0x39'));}else{try{var _0x455b15=JSON[_0x0adb('0x3a')](_0x2032c0[_0x0adb('0x34')][_0x0adb('0x38')]);}catch(_0x3e4e98){logger['error'](_0x3e4e98);throw new db['Sequelize'][(_0x0adb('0x32'))](_0x0adb('0x3b'));}var _0x240c60=[_0x0adb('0x3c'),_0x0adb('0x3d'),_0x0adb('0x3e'),_0x0adb('0x3f'),'smsqueue',_0x0adb('0x40'),'whatsappqueue','team',_0x0adb('0x41')];if(_[_0x0adb('0x42')](_0x455b15,function(_0x432321){return!_[_0x0adb('0x43')](_0x240c60,_0x432321[_0x0adb('0x44')][_0x0adb('0x45')]());})){throw new db[(_0x0adb('0x31'))][(_0x0adb('0x32'))](_0x0adb('0x46'));}}}var _0x54e56a={};_0x54e56a[_0x0adb('0x47')]=_0x2032c0['body']['hasOwnProperty'](_0x0adb('0x47'))?_0x2032c0['body'][_0x0adb('0x47')]:_0x2032c0['user'][_0x0adb('0x48')];_0x54e56a[_0x0adb('0x49')]=_['isEmpty'](_0x2032c0[_0x0adb('0x34')]['recipientsDescription'])?null:_0x2032c0[_0x0adb('0x34')]['recipientsDescription'];_0x54e56a[_0x0adb('0x4a')]=_0x2032c0[_0x0adb('0x34')][_0x0adb('0x4a')]||![];_0x54e56a[_0x0adb('0x4b')]=_0x2032c0[_0x0adb('0x41')]['id'];return getContent(_0x2032c0[_0x0adb('0x34')])[_0x0adb('0x2b')](function(_0x27f409){_0x54e56a[_0x0adb('0x34')]=_0x27f409;return getRecipients(_0x455b15);})['then'](function(_0x490949){_0x54e56a[_0x0adb('0x4c')]=_[_0x0adb('0x4d')](_0x490949)[_0x0adb('0x4e')](',');return db[_0x0adb('0x4f')]['transaction'](function(_0x52aa90){return db['UserNotification'][_0x0adb('0x50')](_0x54e56a,{'raw':!![],'transaction':_0x52aa90})[_0x0adb('0x2b')](function(_0x3e3c75){var _0x4de5d8={'sender':_0x54e56a[_0x0adb('0x47')],'description':_0x54e56a['recipientsDescription'],'content':_0x54e56a['body'],'beep':_0x54e56a[_0x0adb('0x4a')]};_0x490949[_0x0adb('0x51')](function(_0x62429d){_0x4de5d8['recipient']=_0x62429d;socket[_0x0adb('0x52')](_0x0adb('0x53'),_0x4de5d8);});return _0x3e3c75;});});})['then'](respondWithResult(_0x340410,0xc9))[_0x0adb('0x54')](handleError(_0x340410,null));};function getContent(_0x6fb048){return new BPromise(function(_0x45b9a7,_0x4a342c){if(_0x6fb048['text']){_0x45b9a7(_0x6fb048[_0x0adb('0x55')]);return;}return db[_0x0adb('0x56')]['findOne']({'attributes':[_0x0adb('0x57')],'where':{'id':_0x6fb048[_0x0adb('0x30')]},'raw':!![]})['then'](function(_0x12e42f){if(!_0x12e42f)throw new db[(_0x0adb('0x31'))]['ValidationError'](_0x0adb('0x58'));var _0x3d1211=Mustache[_0x0adb('0x59')](_0x12e42f[_0x0adb('0x57')],_0x6fb048[_0x0adb('0x36')]);_0x45b9a7(_0x3d1211);})[_0x0adb('0x54')](function(_0x2d42cb){_0x4a342c(_0x2d42cb);});});}function getRecipients(_0x5ae6b6){return new BPromise(function(_0x5da59d,_0x241921){var _0x1891cb=[];var _0x49583e=[];_0x5ae6b6['forEach'](function(_0x1cc3fc){var _0x1edb9f=_[_0x0adb('0x5a')](_0x1cc3fc['model']['toLowerCase']());if(_0x1edb9f===_0x0adb('0x5b')){_0x1891cb=_[_0x0adb('0x5c')](_0x1891cb,_0x1cc3fc[_0x0adb('0x5d')]);}else{if(_[_0x0adb('0x43')](_0x1edb9f,_0x0adb('0x5e')))_0x1edb9f=_0x1edb9f[_0x0adb('0x5f')](_0x0adb('0x5e'),_0x0adb('0x60'));_0x1cc3fc[_0x0adb('0x5d')][_0x0adb('0x51')](function(_0x26fbc6){_0x49583e[_0x0adb('0x61')](getAgents(_0x1edb9f,_0x26fbc6));});}});return BPromise[_0x0adb('0x62')](_0x49583e)[_0x0adb('0x2b')](function(_0x1f5c16){_0x1891cb=_[_0x0adb('0x5c')](_0x1891cb,_['flatten'](_0x1f5c16));_0x5da59d(_0x1891cb);})['catch'](function(_0x55e6a2){_0x241921(_0x55e6a2);});});}function getAgents(_0x5b2e7f,_0x5255cd){return new BPromise(function(_0x2c57bc,_0x489fb2){return db[_0x5b2e7f]['findOne']({'where':{'id':_0x5255cd}})['then'](function(_0x327249){return _0x327249[_0x0adb('0x63')]({'attributes':['id'],'raw':!![]})[_0x0adb('0x2b')](function(_0xe60905){var _0x1a4a20=_[_0x0adb('0x64')](_0xe60905,'id');_0x2c57bc(_0x1a4a20);});})[_0x0adb('0x54')](function(_0x135435){_0x489fb2(_0x135435);});});}
\ No newline at end of file
index 78d70d2..dd78cae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b23=['emit','hasOwnProperty','exports','events','UserNotification','setMaxListeners','save','update','remove'];(function(_0x200ced,_0x503efa){var _0x28e175=function(_0x450010){while(--_0x450010){_0x200ced['push'](_0x200ced['shift']());}};_0x28e175(++_0x503efa);}(_0x6b23,0x16b));var _0x36b2=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x6b23[_0x33032e];return _0x13316b;};'use strict';var EventEmitter=require(_0x36b2('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x36b2('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x36b2('0x2')](0x0);var events={'afterCreate':_0x36b2('0x3'),'afterUpdate':_0x36b2('0x4'),'afterDestroy':_0x36b2('0x5')};function emitEvent(_0x257883){return function(_0x1f3946,_0x396faa,_0x26097d){UserNotificationEvents[_0x36b2('0x6')](_0x257883+':'+_0x1f3946['id'],_0x1f3946);UserNotificationEvents[_0x36b2('0x6')](_0x257883,_0x1f3946);_0x26097d(null);};}for(var e in events){if(events[_0x36b2('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x36b2('0x8')]=UserNotificationEvents;
\ No newline at end of file
+var _0xfe48=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x42e013,_0x4e1584){var _0x3e951b=function(_0x5fb964){while(--_0x5fb964){_0x42e013['push'](_0x42e013['shift']());}};_0x3e951b(++_0x4e1584);}(_0xfe48,0x1aa));var _0x8fe4=function(_0x818500,_0xe7620c){_0x818500=_0x818500-0x0;var _0x342023=_0xfe48[_0x818500];return _0x342023;};'use strict';var EventEmitter=require(_0x8fe4('0x0'));var UserNotification=require(_0x8fe4('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8fe4('0x2')](0x0);var events={'afterCreate':_0x8fe4('0x3'),'afterUpdate':'update','afterDestroy':_0x8fe4('0x4')};function emitEvent(_0x67448f){return function(_0xd798ad,_0x2ce9e7,_0x2d735c){UserNotificationEvents['emit'](_0x67448f+':'+_0xd798ad['id'],_0xd798ad);UserNotificationEvents[_0x8fe4('0x5')](_0x67448f,_0xd798ad);_0x2d735c(null);};}for(var e in events){if(events[_0x8fe4('0x6')](e)){var event=events[e];UserNotification[_0x8fe4('0x7')](e,emitEvent(event));}}module[_0x8fe4('0x8')]=UserNotificationEvents;
\ No newline at end of file
index 9b74977..6cb7c21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe611=['define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userNotification.attributes','exports'];(function(_0x37c2a1,_0x3c4369){var _0x19dfe2=function(_0x296593){while(--_0x296593){_0x37c2a1['push'](_0x37c2a1['shift']());}};_0x19dfe2(++_0x3c4369);}(_0xe611,0x153));var _0x1e61=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe611[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x1e61('0x0'));var util=require(_0x1e61('0x1'));var logger=require(_0x1e61('0x2'))(_0x1e61('0x3'));var moment=require(_0x1e61('0x4'));var BPromise=require(_0x1e61('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e61('0x6'));var rimraf=require(_0x1e61('0x7'));var config=require(_0x1e61('0x8'));var attributes=require(_0x1e61('0x9'));module[_0x1e61('0xa')]=function(_0x27959e,_0x25ad42){return _0x27959e[_0x1e61('0xb')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1e61('0xc'),'collate':_0x1e61('0xd')});};
\ No newline at end of file
+var _0x7499=['./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x55aff5,_0x17af88){var _0x61ff94=function(_0x273855){while(--_0x273855){_0x55aff5['push'](_0x55aff5['shift']());}};_0x61ff94(++_0x17af88);}(_0x7499,0x1b7));var _0x9749=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x7499[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x9749('0x0'));var util=require(_0x9749('0x1'));var logger=require(_0x9749('0x2'))(_0x9749('0x3'));var moment=require(_0x9749('0x4'));var BPromise=require(_0x9749('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9749('0x6'));var rimraf=require(_0x9749('0x7'));var config=require(_0x9749('0x8'));var attributes=require(_0x9749('0x9'));module[_0x9749('0xa')]=function(_0x1eb43f,_0x131540){return _0x1eb43f[_0x9749('0xb')](_0x9749('0xc'),attributes,{'tableName':_0x9749('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9749('0xe'),'collate':_0x9749('0xf')});};
\ No newline at end of file
index afd2550..385a0f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4d2=['client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4d2,0x1d2));var _0x2f4d=function(_0x2923a6,_0x197060){_0x2923a6=_0x2923a6-0x0;var _0x340da3=_0xf4d2[_0x2923a6];return _0x340da3;};'use strict';var _=require(_0x2f4d('0x0'));var util=require(_0x2f4d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2f4d('0x2'));var fs=require('fs');var Redis=require(_0x2f4d('0x3'));var db=require(_0x2f4d('0x4'))['db'];var utils=require(_0x2f4d('0x5'));var logger=require(_0x2f4d('0x6'))(_0x2f4d('0x7'));var config=require(_0x2f4d('0x8'));var jayson=require(_0x2f4d('0x9'));var client=jayson[_0x2f4d('0xa')][_0x2f4d('0xb')]({'port':0x232a});config[_0x2f4d('0xc')]=_['defaults'](config['redis'],{'host':_0x2f4d('0xd'),'port':0x18eb});var socket=require(_0x2f4d('0xe'))(new Redis(config[_0x2f4d('0xc')]));require(_0x2f4d('0xf'))[_0x2f4d('0x10')](socket);function respondWithRpcPromise(_0x456f1c,_0x36e98a,_0x3f4f5e){return new BPromise(function(_0x54d4de,_0x414294){return client[_0x2f4d('0x11')](_0x456f1c,_0x3f4f5e)['then'](function(_0x2716da){logger[_0x2f4d('0x12')](_0x2f4d('0x13'),_0x36e98a,'request\x20sent');logger[_0x2f4d('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x36e98a,_0x2f4d('0x15'),JSON[_0x2f4d('0x16')](_0x2716da));if(_0x2716da[_0x2f4d('0x17')]){if(_0x2716da['error'][_0x2f4d('0x18')]===0x1f4){logger[_0x2f4d('0x17')](_0x2f4d('0x13'),_0x36e98a,_0x2716da['error']['message']);return _0x414294(_0x2716da[_0x2f4d('0x17')]['message']);}logger[_0x2f4d('0x17')]('UserNotification,\x20%s,\x20%s',_0x36e98a,_0x2716da[_0x2f4d('0x17')]['message']);return _0x54d4de(_0x2716da['error'][_0x2f4d('0x19')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x36e98a,_0x2f4d('0x15'));_0x54d4de(_0x2716da[_0x2f4d('0x1a')][_0x2f4d('0x19')]);}})[_0x2f4d('0x1b')](function(_0x534ec2){logger[_0x2f4d('0x17')](_0x2f4d('0x13'),_0x36e98a,_0x534ec2);_0x414294(_0x534ec2);});});}
\ No newline at end of file
+var _0x87ac=['request','then','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./userNotification.socket'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x87ac,0xda));var _0xc87a=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0x87ac[_0x2ce6d5];return _0x32d272;};'use strict';var _=require(_0xc87a('0x0'));var util=require(_0xc87a('0x1'));var moment=require(_0xc87a('0x2'));var BPromise=require(_0xc87a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc87a('0x4'));var db=require(_0xc87a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc87a('0x6'));var config=require(_0xc87a('0x7'));var jayson=require(_0xc87a('0x8'));var client=jayson[_0xc87a('0x9')][_0xc87a('0xa')]({'port':0x232a});config['redis']=_[_0xc87a('0xb')](config['redis'],{'host':_0xc87a('0xc'),'port':0x18eb});var socket=require(_0xc87a('0xd'))(new Redis(config[_0xc87a('0xe')]));require(_0xc87a('0xf'))['register'](socket);function respondWithRpcPromise(_0x2d86c1,_0x9edb62,_0x4212b6){return new BPromise(function(_0x12ac7e,_0x194052){return client[_0xc87a('0x10')](_0x2d86c1,_0x4212b6)[_0xc87a('0x11')](function(_0x56b23d){logger['info']('UserNotification,\x20%s,\x20%s',_0x9edb62,_0xc87a('0x12'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x9edb62,_0xc87a('0x12'),JSON[_0xc87a('0x13')](_0x56b23d));if(_0x56b23d[_0xc87a('0x14')]){if(_0x56b23d[_0xc87a('0x14')][_0xc87a('0x15')]===0x1f4){logger[_0xc87a('0x14')](_0xc87a('0x16'),_0x9edb62,_0x56b23d['error'][_0xc87a('0x17')]);return _0x194052(_0x56b23d[_0xc87a('0x14')][_0xc87a('0x17')]);}logger[_0xc87a('0x14')](_0xc87a('0x16'),_0x9edb62,_0x56b23d[_0xc87a('0x14')][_0xc87a('0x17')]);return _0x12ac7e(_0x56b23d[_0xc87a('0x14')][_0xc87a('0x17')]);}else{logger[_0xc87a('0x18')](_0xc87a('0x16'),_0x9edb62,_0xc87a('0x12'));_0x12ac7e(_0x56b23d[_0xc87a('0x19')][_0xc87a('0x17')]);}})['catch'](function(_0x48e464){logger[_0xc87a('0x14')](_0xc87a('0x16'),_0x9edb62,_0x48e464);_0x194052(_0x48e464);});});}
\ No newline at end of file
index edde491..466ad84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9fc=['length','userNotification:','./userNotification.events','save','emit','removeListener','register'];(function(_0x3275cf,_0x3f56b2){var _0x3015b6=function(_0x4ac0cd){while(--_0x4ac0cd){_0x3275cf['push'](_0x3275cf['shift']());}};_0x3015b6(++_0x3f56b2);}(_0xd9fc,0x6b));var _0xcd9f=function(_0x56eacf,_0x393bde){_0x56eacf=_0x56eacf-0x0;var _0x276d25=_0xd9fc[_0x56eacf];return _0x276d25;};'use strict';var UserNotificationEvents=require(_0xcd9f('0x0'));var events=[_0xcd9f('0x1'),'remove','update'];function createListener(_0x1517d5,_0x216906){return function(_0x4fa13e){_0x216906[_0xcd9f('0x2')](_0x1517d5,_0x4fa13e);};}function removeListener(_0x5d96bf,_0x184efa){return function(){UserNotificationEvents[_0xcd9f('0x3')](_0x5d96bf,_0x184efa);};}exports[_0xcd9f('0x4')]=function(_0x41131e){for(var _0x460ad2=0x0,_0x252095=events[_0xcd9f('0x5')];_0x460ad2<_0x252095;_0x460ad2++){var _0x27a820=events[_0x460ad2];var _0x43c697=createListener(_0xcd9f('0x6')+_0x27a820,_0x41131e);UserNotificationEvents['on'](_0x27a820,_0x43c697);}};
\ No newline at end of file
+var _0x0450=['removeListener','register','length','userNotification:','./userNotification.events','update','emit'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0x0450,0x100));var _0x0045=function(_0x4253e4,_0x41cfb0){_0x4253e4=_0x4253e4-0x0;var _0x2afd4b=_0x0450[_0x4253e4];return _0x2afd4b;};'use strict';var UserNotificationEvents=require(_0x0045('0x0'));var events=['save','remove',_0x0045('0x1')];function createListener(_0x34d1ec,_0x8de502){return function(_0x54c7d4){_0x8de502[_0x0045('0x2')](_0x34d1ec,_0x54c7d4);};}function removeListener(_0x2c96f9,_0x19079d){return function(){UserNotificationEvents[_0x0045('0x3')](_0x2c96f9,_0x19079d);};}exports[_0x0045('0x4')]=function(_0x169e58){for(var _0x4121e6=0x0,_0x147bf6=events[_0x0045('0x5')];_0x4121e6<_0x147bf6;_0x4121e6++){var _0x21c6ee=events[_0x4121e6];var _0x1e2f1d=createListener(_0x0045('0x6')+_0x21c6ee,_0x169e58);UserNotificationEvents['on'](_0x21c6ee,_0x1e2f1d);}};
\ No newline at end of file
index 848da1e..213a029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x324189,_0x202ac1){var _0x495eee=function(_0x4380b9){while(--_0x4380b9){_0x324189['push'](_0x324189['shift']());}};_0x495eee(++_0x202ac1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xc9c128,_0x13d604){var _0x2abd60=function(_0x17a2de){while(--_0x17a2de){_0xc9c128['push'](_0xc9c128['shift']());}};_0x2abd60(++_0x13d604);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'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 2a8a407..4d2f3a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60f2=['INTEGER','sequelize','exports'];(function(_0x28c63c,_0x36b85a){var _0x315b70=function(_0x2af912){while(--_0x2af912){_0x28c63c['push'](_0x28c63c['shift']());}};_0x315b70(++_0x36b85a);}(_0x60f2,0x1bd));var _0x260f=function(_0xf6701d,_0x31db2f){_0xf6701d=_0xf6701d-0x0;var _0x1d0e5b=_0x60f2[_0xf6701d];return _0x1d0e5b;};'use strict';var Sequelize=require(_0x260f('0x0'));module[_0x260f('0x1')]={'penalty':{'type':Sequelize[_0x260f('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe29e=['exports','INTEGER','sequelize'];(function(_0x20f28c,_0x59b309){var _0x2b354d=function(_0xd408b1){while(--_0xd408b1){_0x20f28c['push'](_0x20f28c['shift']());}};_0x2b354d(++_0x59b309);}(_0xe29e,0x1ac));var _0xee29=function(_0x2ccdea,_0x14f981){_0x2ccdea=_0x2ccdea-0x0;var _0x522ec6=_0xe29e[_0x2ccdea];return _0x522ec6;};'use strict';var Sequelize=require(_0xee29('0x0'));module[_0xee29('0x1')]={'penalty':{'type':Sequelize[_0xee29('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index c488216..20f2102 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x562e=['util','../../config/logger','api','bluebird','request-promise','rimraf','./userOpenchannelQueue.attributes','user_has_openchannel_queues','lodash'];(function(_0x38a2b6,_0x8bf221){var _0x21e28d=function(_0x270cd2){while(--_0x270cd2){_0x38a2b6['push'](_0x38a2b6['shift']());}};_0x21e28d(++_0x8bf221);}(_0x562e,0x131));var _0xe562=function(_0x40b56b,_0x1a31ee){_0x40b56b=_0x40b56b-0x0;var _0x1739a5=_0x562e[_0x40b56b];return _0x1739a5;};'use strict';var _=require(_0xe562('0x0'));var util=require(_0xe562('0x1'));var logger=require(_0xe562('0x2'))(_0xe562('0x3'));var moment=require('moment');var BPromise=require(_0xe562('0x4'));var rp=require(_0xe562('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe562('0x6'));var config=require('../../config/environment');var attributes=require(_0xe562('0x7'));module['exports']=function(_0x73418c,_0x32cea0){return _0x73418c['define']('UserOpenchannelQueue',attributes,{'tableName':_0xe562('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3c5=['user_has_openchannel_queues','util','../../config/logger','bluebird','request-promise','path','./userOpenchannelQueue.attributes','define'];(function(_0x25bc56,_0x368a4c){var _0x144fb6=function(_0x2d742a){while(--_0x2d742a){_0x25bc56['push'](_0x25bc56['shift']());}};_0x144fb6(++_0x368a4c);}(_0xf3c5,0xe1));var _0x5f3c=function(_0x1b8050,_0x4d12c6){_0x1b8050=_0x1b8050-0x0;var _0x1ec2b1=_0xf3c5[_0x1b8050];return _0x1ec2b1;};'use strict';var _=require('lodash');var util=require(_0x5f3c('0x0'));var logger=require(_0x5f3c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5f3c('0x2'));var rp=require(_0x5f3c('0x3'));var fs=require('fs');var path=require(_0x5f3c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5f3c('0x5'));module['exports']=function(_0x567e8b,_0x4afd57){return _0x567e8b[_0x5f3c('0x6')]('UserOpenchannelQueue',attributes,{'tableName':_0x5f3c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 729b2f3..03ad0de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7144=['../../config/environment','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x17ac5b,_0x1a2d16){var _0x2dcec9=function(_0x4bbe8d){while(--_0x4bbe8d){_0x17ac5b['push'](_0x17ac5b['shift']());}};_0x2dcec9(++_0x1a2d16);}(_0x7144,0x1f3));var _0x4714=function(_0x28ef31,_0x62590b){_0x28ef31=_0x28ef31-0x0;var _0x580e8e=_0x7144[_0x28ef31];return _0x580e8e;};'use strict';var _=require('lodash');var util=require(_0x4714('0x0'));var moment=require(_0x4714('0x1'));var BPromise=require(_0x4714('0x2'));var rs=require(_0x4714('0x3'));var fs=require('fs');var Redis=require(_0x4714('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4714('0x5'));var logger=require('../../config/logger')(_0x4714('0x6'));var config=require(_0x4714('0x7'));var jayson=require(_0x4714('0x8'));var client=jayson['client'][_0x4714('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ce907,_0x2f0a6e,_0x1fe430){return new BPromise(function(_0x5cefa9,_0x3bafe4){return client[_0x4714('0xa')](_0x1ce907,_0x1fe430)[_0x4714('0xb')](function(_0x3ed03a){logger[_0x4714('0xc')](_0x4714('0xd'),_0x2f0a6e,'request\x20sent');logger[_0x4714('0xe')](_0x4714('0xf'),_0x2f0a6e,_0x4714('0x10'),JSON[_0x4714('0x11')](_0x3ed03a));if(_0x3ed03a[_0x4714('0x12')]){if(_0x3ed03a[_0x4714('0x12')]['code']===0x1f4){logger[_0x4714('0x12')](_0x4714('0xd'),_0x2f0a6e,_0x3ed03a[_0x4714('0x12')]['message']);return _0x3bafe4(_0x3ed03a[_0x4714('0x12')][_0x4714('0x13')]);}logger[_0x4714('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2f0a6e,_0x3ed03a['error']['message']);return _0x5cefa9(_0x3ed03a[_0x4714('0x12')][_0x4714('0x13')]);}else{logger[_0x4714('0xc')](_0x4714('0xd'),_0x2f0a6e,_0x4714('0x10'));_0x5cefa9(_0x3ed03a[_0x4714('0x14')][_0x4714('0x13')]);}})[_0x4714('0x15')](function(_0x4fb06d){logger[_0x4714('0x12')](_0x4714('0xd'),_0x2f0a6e,_0x4fb06d);_0x3bafe4(_0x4fb06d);});});}
\ No newline at end of file
+var _0x3deb=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s'];(function(_0xc2267f,_0x3dacce){var _0x2ae701=function(_0x1c0acd){while(--_0x1c0acd){_0xc2267f['push'](_0xc2267f['shift']());}};_0x2ae701(++_0x3dacce);}(_0x3deb,0xc2));var _0xb3de=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x3deb[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xb3de('0x0'));var util=require(_0xb3de('0x1'));var moment=require(_0xb3de('0x2'));var BPromise=require('bluebird');var rs=require(_0xb3de('0x3'));var fs=require('fs');var Redis=require(_0xb3de('0x4'));var db=require(_0xb3de('0x5'))['db'];var utils=require(_0xb3de('0x6'));var logger=require('../../config/logger')(_0xb3de('0x7'));var config=require(_0xb3de('0x8'));var jayson=require(_0xb3de('0x9'));var client=jayson[_0xb3de('0xa')][_0xb3de('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ab576,_0x5bba92,_0x3713b1){return new BPromise(function(_0x594812,_0x2ac1e8){return client[_0xb3de('0xc')](_0x2ab576,_0x3713b1)[_0xb3de('0xd')](function(_0x26af9d){logger[_0xb3de('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5bba92,_0xb3de('0xf'));logger[_0xb3de('0x10')](_0xb3de('0x11'),_0x5bba92,_0xb3de('0xf'),JSON[_0xb3de('0x12')](_0x26af9d));if(_0x26af9d[_0xb3de('0x13')]){if(_0x26af9d['error'][_0xb3de('0x14')]===0x1f4){logger['error'](_0xb3de('0x15'),_0x5bba92,_0x26af9d[_0xb3de('0x13')][_0xb3de('0x16')]);return _0x2ac1e8(_0x26af9d[_0xb3de('0x13')][_0xb3de('0x16')]);}logger[_0xb3de('0x13')](_0xb3de('0x15'),_0x5bba92,_0x26af9d[_0xb3de('0x13')][_0xb3de('0x16')]);return _0x594812(_0x26af9d[_0xb3de('0x13')][_0xb3de('0x16')]);}else{logger[_0xb3de('0xe')](_0xb3de('0x15'),_0x5bba92,_0xb3de('0xf'));_0x594812(_0x26af9d[_0xb3de('0x17')]['message']);}})['catch'](function(_0xa6210c){logger[_0xb3de('0x13')](_0xb3de('0x15'),_0x5bba92,_0xa6210c);_0x2ac1e8(_0xa6210c);});});}
\ No newline at end of file
index bca0250..eab0fae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78d3=['removeSections','removeResources','exports','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','create','post','/:id/clone','clone','addSections','addResources','put','update','destroy','delete'];(function(_0x3faf51,_0x4535f3){var _0x4685b7=function(_0x4c1839){while(--_0x4c1839){_0x3faf51['push'](_0x3faf51['shift']());}};_0x4685b7(++_0x4535f3);}(_0x78d3,0xeb));var _0x378d=function(_0xdb43b0,_0x1e02f4){_0xdb43b0=_0xdb43b0-0x0;var _0x4c3dd3=_0x78d3[_0xdb43b0];return _0x4c3dd3;};'use strict';var multer=require('multer');var util=require(_0x378d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x378d('0x1')]();var fs_extra=require(_0x378d('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x378d('0x3'));var config=require(_0x378d('0x4'));var controller=require(_0x378d('0x5'));router[_0x378d('0x6')]('/',auth[_0x378d('0x7')](),controller[_0x378d('0x8')]);router[_0x378d('0x6')](_0x378d('0x9'),auth['isAuthenticated'](),controller[_0x378d('0xa')]);router['get'](_0x378d('0xb'),auth[_0x378d('0x7')](),controller[_0x378d('0xc')]);router['get'](_0x378d('0xd'),auth[_0x378d('0x7')](),controller[_0x378d('0xe')]);router[_0x378d('0x6')](_0x378d('0xf'),auth[_0x378d('0x7')](),controller['getResources']);router['post']('/',auth['isAuthenticated'](),controller[_0x378d('0x10')]);router[_0x378d('0x11')](_0x378d('0x12'),auth[_0x378d('0x7')](),controller[_0x378d('0x13')]);router[_0x378d('0x11')](_0x378d('0xd'),auth[_0x378d('0x7')](),controller[_0x378d('0x14')]);router[_0x378d('0x11')](_0x378d('0xf'),auth[_0x378d('0x7')](),controller[_0x378d('0x15')]);router[_0x378d('0x16')](_0x378d('0xb'),auth['isAuthenticated'](),controller[_0x378d('0x17')]);router['delete']('/:id',auth[_0x378d('0x7')](),controller[_0x378d('0x18')]);router[_0x378d('0x19')](_0x378d('0xd'),auth['isAuthenticated'](),controller[_0x378d('0x1a')]);router[_0x378d('0x19')](_0x378d('0xf'),auth['isAuthenticated'](),controller[_0x378d('0x1b')]);module[_0x378d('0x1c')]=router;
\ No newline at end of file
+var _0x17f0=['get','isAuthenticated','/describe','describe','/:id','show','getSections','/:id/resources','getResources','post','create','clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0x4dbc5d,_0x2d0a51){var _0x45b461=function(_0x3e73ab){while(--_0x3e73ab){_0x4dbc5d['push'](_0x4dbc5d['shift']());}};_0x45b461(++_0x2d0a51);}(_0x17f0,0x91));var _0x017f=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x17f0[_0x525c7b];return _0x27b33e;};'use strict';var multer=require(_0x017f('0x0'));var util=require(_0x017f('0x1'));var path=require(_0x017f('0x2'));var timeout=require(_0x017f('0x3'));var express=require(_0x017f('0x4'));var router=express[_0x017f('0x5')]();var fs_extra=require(_0x017f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x017f('0x7'));var config=require(_0x017f('0x8'));var controller=require(_0x017f('0x9'));router[_0x017f('0xa')]('/',auth[_0x017f('0xb')](),controller['index']);router[_0x017f('0xa')](_0x017f('0xc'),auth[_0x017f('0xb')](),controller[_0x017f('0xd')]);router[_0x017f('0xa')](_0x017f('0xe'),auth[_0x017f('0xb')](),controller[_0x017f('0xf')]);router[_0x017f('0xa')]('/:id/sections',auth[_0x017f('0xb')](),controller[_0x017f('0x10')]);router['get'](_0x017f('0x11'),auth[_0x017f('0xb')](),controller[_0x017f('0x12')]);router[_0x017f('0x13')]('/',auth['isAuthenticated'](),controller[_0x017f('0x14')]);router[_0x017f('0x13')]('/:id/clone',auth['isAuthenticated'](),controller[_0x017f('0x15')]);router[_0x017f('0x13')](_0x017f('0x16'),auth[_0x017f('0xb')](),controller[_0x017f('0x17')]);router['post']('/:id/resources',auth[_0x017f('0xb')](),controller[_0x017f('0x18')]);router[_0x017f('0x19')]('/:id',auth[_0x017f('0xb')](),controller[_0x017f('0x1a')]);router[_0x017f('0x1b')](_0x017f('0xe'),auth['isAuthenticated'](),controller[_0x017f('0x1c')]);router[_0x017f('0x1b')](_0x017f('0x16'),auth[_0x017f('0xb')](),controller[_0x017f('0x1d')]);router[_0x017f('0x1b')](_0x017f('0x11'),auth[_0x017f('0xb')](),controller[_0x017f('0x1e')]);module['exports']=router;
\ No newline at end of file
index 867abcb..edfa9c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8daf=['STRING','setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports','name'];(function(_0x238c0f,_0x28e614){var _0x5c73d2=function(_0x3e6211){while(--_0x3e6211){_0x238c0f['push'](_0x238c0f['shift']());}};_0x5c73d2(++_0x28e614);}(_0x8daf,0x96));var _0xf8da=function(_0x1930b7,_0x13f7d5){_0x1930b7=_0x1930b7-0x0;var _0x118097=_0x8daf[_0x1930b7];return _0x118097;};'use strict';var Sequelize=require(_0xf8da('0x0'));module[_0xf8da('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf8da('0x2')},'crudPermissions':{'type':Sequelize[_0xf8da('0x3')],'set':function(_0x4fc304){this[_0xf8da('0x4')](_0xf8da('0x5'),_0x4fc304?_0x4fc304['join'](''):[]);},'get':function(){return this[_0xf8da('0x6')]('crudPermissions')?this[_0xf8da('0x6')](_0xf8da('0x5'))[_0xf8da('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf8da('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xf8da('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf8da('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf8da('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf8da('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf8da('0x8')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x9a45=['name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','exports','STRING'];(function(_0x4a1b31,_0x44b657){var _0x18a658=function(_0x374e91){while(--_0x374e91){_0x4a1b31['push'](_0x4a1b31['shift']());}};_0x18a658(++_0x44b657);}(_0x9a45,0x193));var _0x59a4=function(_0x47c985,_0x4d73b8){_0x47c985=_0x47c985-0x0;var _0x9f74f5=_0x9a45[_0x47c985];return _0x9f74f5;};'use strict';var Sequelize=require('sequelize');module[_0x59a4('0x0')]={'name':{'type':Sequelize[_0x59a4('0x1')],'allowNull':![],'unique':_0x59a4('0x2')},'crudPermissions':{'type':Sequelize[_0x59a4('0x1')],'set':function(_0x44f50d){this[_0x59a4('0x3')](_0x59a4('0x4'),_0x44f50d?_0x44f50d[_0x59a4('0x5')](''):[]);},'get':function(){return this[_0x59a4('0x6')](_0x59a4('0x4'))?this[_0x59a4('0x6')](_0x59a4('0x4'))[_0x59a4('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x59a4('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x59a4('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x59a4('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x59a4('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x59a4('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x59a4('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x59a4('0x8')],'defaultValue':!![]}};
\ No newline at end of file
index b7af320..01b980c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7aa=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','clone','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','update','describe','UserProfileResource','push','removeSections','ids','getSections','includes','enabled','subsections','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','index','map','UserProfile','type','key','model','name','keys','query','filters'];(function(_0x1369ca,_0x3c5e30){var _0x3be723=function(_0x3ec9f3){while(--_0x3ec9f3){_0x1369ca['push'](_0x1369ca['shift']());}};_0x3be723(++_0x3c5e30);}(_0xb7aa,0x11a));var _0xab7a=function(_0x493050,_0x1b9623){_0x493050=_0x493050-0x0;var _0x5cb73f=_0xb7aa[_0x493050];return _0x5cb73f;};'use strict';var emlformat=require(_0xab7a('0x0'));var rimraf=require(_0xab7a('0x1'));var zipdir=require(_0xab7a('0x2'));var jsonpatch=require(_0xab7a('0x3'));var rp=require(_0xab7a('0x4'));var moment=require(_0xab7a('0x5'));var BPromise=require(_0xab7a('0x6'));var Mustache=require(_0xab7a('0x7'));var util=require(_0xab7a('0x8'));var path=require(_0xab7a('0x9'));var sox=require('sox');var csv=require(_0xab7a('0xa'));var ejs=require(_0xab7a('0xb'));var fs=require('fs');var fs_extra=require(_0xab7a('0xc'));var _=require(_0xab7a('0xd'));var squel=require('squel');var crypto=require(_0xab7a('0xe'));var jsforce=require(_0xab7a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xab7a('0xa'));var querystring=require(_0xab7a('0x10'));var Papa=require(_0xab7a('0x11'));var Redis=require(_0xab7a('0x12'));var authService=require(_0xab7a('0x13'));var qs=require(_0xab7a('0x14'));var as=require(_0xab7a('0x15'));var hardwareService=require(_0xab7a('0x16'));var logger=require(_0xab7a('0x17'))(_0xab7a('0x18'));var utils=require('../../config/utils');var config=require(_0xab7a('0x19'));var licenseUtil=require(_0xab7a('0x1a'));var db=require(_0xab7a('0x1b'))['db'];config[_0xab7a('0x1c')]=_['defaults'](config[_0xab7a('0x1c')],{'host':_0xab7a('0x1d'),'port':0x18eb});var socket=require(_0xab7a('0x1e'))(new Redis(config[_0xab7a('0x1c')]));require('./userProfile.socket')[_0xab7a('0x1f')](socket);function respondWithStatusCode(_0x1cc43f,_0x4a78b8){_0x4a78b8=_0x4a78b8||0xcc;return function(_0x899a95){if(_0x899a95){return _0x1cc43f[_0xab7a('0x20')](_0x4a78b8);}return _0x1cc43f[_0xab7a('0x21')](_0x4a78b8)[_0xab7a('0x22')]();};}function respondWithResult(_0x30146c,_0x522f10){_0x522f10=_0x522f10||0xc8;return function(_0x198e78){if(_0x198e78){return _0x30146c[_0xab7a('0x21')](_0x522f10)['json'](_0x198e78);}};}function respondWithFilteredResult(_0x203980,_0x177c90){return function(_0x187f51){if(_0x187f51){var _0xc3bb41=typeof _0x177c90[_0xab7a('0x23')]===_0xab7a('0x24')&&typeof _0x177c90[_0xab7a('0x25')]==='undefined';var _0x41f3c0=_0x187f51[_0xab7a('0x26')];var _0x16ce64=_0xc3bb41?0x0:_0x177c90[_0xab7a('0x23')];var _0x2fa287=_0xc3bb41?_0x187f51[_0xab7a('0x26')]:_0x177c90[_0xab7a('0x23')]+_0x177c90[_0xab7a('0x25')];var _0x169988;if(_0x2fa287>=_0x41f3c0){_0x2fa287=_0x41f3c0;_0x169988=0xc8;}else{_0x169988=0xce;}_0x203980[_0xab7a('0x21')](_0x169988);return _0x203980[_0xab7a('0x27')]('Content-Range',_0x16ce64+'-'+_0x2fa287+'/'+_0x41f3c0)['json'](_0x187f51);}return null;};}function patchUpdates(_0x5c4c3e){return function(_0x60ad2b){try{jsonpatch[_0xab7a('0x28')](_0x60ad2b,_0x5c4c3e,!![]);}catch(_0x33f484){return BPromise[_0xab7a('0x29')](_0x33f484);}return _0x60ad2b[_0xab7a('0x2a')]();};}function saveUpdates(_0x8c1e1f,_0x3324f2){return function(_0x533680){if(_0x533680){return _0x533680['update'](_0x8c1e1f)[_0xab7a('0x2b')](function(_0x4a13dd){return _0x4a13dd;});}return null;};}function removeEntity(_0x4d8e6b,_0x249904){return function(_0x570a8b){if(_0x570a8b){return _0x570a8b[_0xab7a('0x2c')]()[_0xab7a('0x2b')](function(){_0x4d8e6b[_0xab7a('0x21')](0xcc)[_0xab7a('0x22')]();});}};}function handleEntityNotFound(_0x2b0885,_0x5bd2b2){return function(_0x14fbee){if(!_0x14fbee){_0x2b0885[_0xab7a('0x20')](0x194);}return _0x14fbee;};}function handleError(_0x26c106,_0x4e4514){_0x4e4514=_0x4e4514||0x1f4;return function(_0x42f40b){logger[_0xab7a('0x2d')](_0x42f40b[_0xab7a('0x2e')]);if(_0x42f40b['name']){delete _0x42f40b['name'];}_0x26c106[_0xab7a('0x21')](_0x4e4514)['send'](_0x42f40b);};}exports[_0xab7a('0x2f')]=function(_0x3dfbaf,_0x5a1eb4){var _0x14065b={},_0x3d31a1={},_0x467dce={'count':0x0,'rows':[]};var _0x6e0d82=_[_0xab7a('0x30')](db[_0xab7a('0x31')]['rawAttributes'],function(_0x44ba02){return{'name':_0x44ba02['fieldName'],'type':_0x44ba02[_0xab7a('0x32')][_0xab7a('0x33')]};});_0x3d31a1[_0xab7a('0x34')]=_['map'](_0x6e0d82,_0xab7a('0x35'));_0x3d31a1['query']=_[_0xab7a('0x36')](_0x3dfbaf[_0xab7a('0x37')]);_0x3d31a1[_0xab7a('0x38')]=_[_0xab7a('0x39')](_0x3d31a1[_0xab7a('0x34')],_0x3d31a1[_0xab7a('0x37')]);_0x14065b[_0xab7a('0x3a')]=_[_0xab7a('0x39')](_0x3d31a1['model'],qs[_0xab7a('0x3b')](_0x3dfbaf[_0xab7a('0x37')][_0xab7a('0x3b')]));_0x14065b[_0xab7a('0x3a')]=_0x14065b['attributes'][_0xab7a('0x3c')]?_0x14065b[_0xab7a('0x3a')]:_0x3d31a1[_0xab7a('0x34')];if(!_0x3dfbaf['query'][_0xab7a('0x3d')](_0xab7a('0x3e'))){_0x14065b[_0xab7a('0x25')]=qs[_0xab7a('0x25')](_0x3dfbaf['query'][_0xab7a('0x25')]);_0x14065b[_0xab7a('0x23')]=qs[_0xab7a('0x23')](_0x3dfbaf['query']['offset']);}_0x14065b[_0xab7a('0x3f')]=qs['sort'](_0x3dfbaf[_0xab7a('0x37')][_0xab7a('0x40')]);_0x14065b['where']=qs['filters'](_[_0xab7a('0x41')](_0x3dfbaf[_0xab7a('0x37')],_0x3d31a1[_0xab7a('0x38')]),_0x6e0d82);if(_0x3dfbaf[_0xab7a('0x37')]['filter']){_0x14065b['where']=_[_0xab7a('0x42')](_0x14065b[_0xab7a('0x43')],{'$or':_[_0xab7a('0x30')](_0x6e0d82,function(_0x42f2db){if(_0x42f2db['type']!==_0xab7a('0x44')){var _0xcac61={};_0xcac61[_0x42f2db[_0xab7a('0x35')]]={'$like':'%'+_0x3dfbaf['query'][_0xab7a('0x45')]+'%'};return _0xcac61;}})});}_0x14065b=_[_0xab7a('0x42')]({},_0x14065b,_0x3dfbaf[_0xab7a('0x46')]);var _0x9cfc25={'where':_0x14065b['where']};return db[_0xab7a('0x31')]['count'](_0x9cfc25)[_0xab7a('0x2b')](function(_0x1bf286){_0x467dce[_0xab7a('0x26')]=_0x1bf286;if(_0x3dfbaf['query'][_0xab7a('0x47')]){_0x14065b[_0xab7a('0x48')]=[{'all':!![]}];}return db[_0xab7a('0x31')][_0xab7a('0x49')](_0x14065b);})['then'](function(_0x2ddf18){_0x467dce[_0xab7a('0x4a')]=_0x2ddf18;return _0x467dce;})[_0xab7a('0x2b')](respondWithFilteredResult(_0x5a1eb4,_0x14065b))[_0xab7a('0x4b')](handleError(_0x5a1eb4,null));};exports['show']=function(_0x111d2a,_0x5c03b5){var _0x2fe553={'raw':![],'where':{'id':_0x111d2a[_0xab7a('0x4c')]['id']}},_0x4d980a={};_0x4d980a[_0xab7a('0x34')]=_['keys'](db[_0xab7a('0x31')][_0xab7a('0x4d')]);_0x4d980a[_0xab7a('0x37')]=_[_0xab7a('0x36')](_0x111d2a[_0xab7a('0x37')]);_0x4d980a[_0xab7a('0x38')]=_['intersection'](_0x4d980a['model'],_0x4d980a[_0xab7a('0x37')]);_0x2fe553[_0xab7a('0x3a')]=_[_0xab7a('0x39')](_0x4d980a[_0xab7a('0x34')],qs[_0xab7a('0x3b')](_0x111d2a[_0xab7a('0x37')][_0xab7a('0x3b')]));_0x2fe553[_0xab7a('0x3a')]=_0x2fe553[_0xab7a('0x3a')][_0xab7a('0x3c')]?_0x2fe553[_0xab7a('0x3a')]:_0x4d980a[_0xab7a('0x34')];if(_0x111d2a['query']['includeAll']){_0x2fe553[_0xab7a('0x48')]=[{'all':!![]}];}_0x2fe553=_[_0xab7a('0x42')]({},_0x2fe553,_0x111d2a[_0xab7a('0x46')]);return db['UserProfile'][_0xab7a('0x4e')](_0x2fe553)['then'](handleEntityNotFound(_0x5c03b5,null))[_0xab7a('0x2b')](respondWithResult(_0x5c03b5,null))[_0xab7a('0x4b')](handleError(_0x5c03b5,null));};exports['create']=function(_0x49438f,_0x5081e6){return db[_0xab7a('0x31')][_0xab7a('0x4f')](_0x49438f['body'],{})['then'](respondWithResult(_0x5081e6,0xc9))[_0xab7a('0x4b')](handleError(_0x5081e6,null));};exports[_0xab7a('0x50')]=function(_0xf7344c,_0x1ba1ef){var _0x18fed9={'where':{'id':_0xf7344c['params']['id']}},_0x59e28d={};_0x59e28d[_0xab7a('0x34')]=_['keys'](db[_0xab7a('0x31')]['rawAttributes']);_0x18fed9[_0xab7a('0x3a')]=_[_0xab7a('0x39')](_0x59e28d[_0xab7a('0x34')],qs[_0xab7a('0x3b')](_0xf7344c[_0xab7a('0x37')][_0xab7a('0x3b')]));_0x18fed9[_0xab7a('0x3a')]=_0x18fed9[_0xab7a('0x3a')][_0xab7a('0x3c')]?_0x18fed9[_0xab7a('0x3a')]:_0x59e28d[_0xab7a('0x34')];if(_0xf7344c['query'][_0xab7a('0x47')]){_0x18fed9[_0xab7a('0x48')]=[{'all':!![]}];}_0x18fed9=_[_0xab7a('0x42')]({},_0x18fed9,_0xf7344c[_0xab7a('0x46')]);return db['UserProfile']['find'](_0x18fed9)['then'](handleEntityNotFound(_0x1ba1ef,null))[_0xab7a('0x2b')](function(_0x114dc6){if(_0x114dc6){var _0x49f75e=_0x114dc6[_0xab7a('0x51')]({'plain':!![]});_0x49f75e=qs[_0xab7a('0x52')](_0x49f75e,['id',_0xab7a('0x53'),_0xab7a('0x54'),_0xab7a('0x55')]);_0xf7344c[_0xab7a('0x56')]=_[_0xab7a('0x52')](_0xf7344c[_0xab7a('0x56')],['id',_0xab7a('0x53'),_0xab7a('0x54')]);return db[_0xab7a('0x57')][_0xab7a('0x58')](function(_0x4ef38e){return db['UserProfile'][_0xab7a('0x4f')](_[_0xab7a('0x42')](_0x49f75e,_0xf7344c[_0xab7a('0x56')]),{'include':_0xf7344c['query'][_0xab7a('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x4ef38e})['then'](function(_0x2470b4){var _0x59c336=_0x2470b4[_0xab7a('0x51')]({'plain':!![]});return db['UserProfileSection'][_0xab7a('0x49')]({'where':{'userProfileId':_0xf7344c[_0xab7a('0x4c')]['id']},'raw':!![]})[_0xab7a('0x2b')](function(_0x187198){if(_0x187198){return BPromise[_0xab7a('0x59')](_0x187198,function(_0x13762f){return new BPromise(function(_0x23055d,_0xfb96fa){if(_0x13762f[_0xab7a('0x5a')]===null||_0x13762f['autoAssociation']===0x1)_0x23055d(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x13762f['id']},'raw':!![]})[_0xab7a('0x2b')](function(_0x2964d7){var _0x47bf46=_[_0xab7a('0x30')](_0x2964d7,function(_0x40669c){return qs[_0xab7a('0x52')](_0x40669c,['id',_0xab7a('0x53'),_0xab7a('0x54'),_0xab7a('0x5b')]);});_0x23055d(_0x47bf46);})[_0xab7a('0x4b')](function(_0x5312e4){_0xfb96fa(_0x5312e4);});})['then'](function(_0x17b982){var _0x44e31c=qs[_0xab7a('0x52')](_0x13762f,['id',_0xab7a('0x53'),_0xab7a('0x54')]);_0x44e31c[_0xab7a('0x5c')]=_0x59c336['id'];if(_0x17b982)_0x44e31c[_0xab7a('0x5d')]=_0x17b982;return _0x44e31c;})[_0xab7a('0x2b')](function(_0x37db85){return db[_0xab7a('0x5e')][_0xab7a('0x4f')](_0x37db85,{'include':[{'model':db['UserProfileResource'],'as':_0xab7a('0x5d')}],'raw':!![],'transaction':_0x4ef38e});});})['then'](function(){return _0x59c336;});}});});});}})[_0xab7a('0x2b')](respondWithResult(_0x1ba1ef,0xc9))[_0xab7a('0x4b')](handleError(_0x1ba1ef,null));};exports[_0xab7a('0x5f')]=function(_0x54307b,_0x520c83){if(_0x54307b['body']['id']){delete _0x54307b['body']['id'];}return db[_0xab7a('0x31')][_0xab7a('0x4e')]({'where':{'id':_0x54307b['params']['id']}})[_0xab7a('0x2b')](handleEntityNotFound(_0x520c83,null))[_0xab7a('0x2b')](saveUpdates(_0x54307b[_0xab7a('0x56')],null))[_0xab7a('0x2b')](respondWithResult(_0x520c83,null))[_0xab7a('0x4b')](handleError(_0x520c83,null));};exports[_0xab7a('0x2c')]=function(_0x12bc47,_0xfbdb0f){return db[_0xab7a('0x31')][_0xab7a('0x4e')]({'where':{'id':_0x12bc47['params']['id']}})[_0xab7a('0x2b')](handleEntityNotFound(_0xfbdb0f,null))[_0xab7a('0x2b')](removeEntity(_0xfbdb0f,null))[_0xab7a('0x4b')](handleError(_0xfbdb0f,null));};exports[_0xab7a('0x60')]=function(_0x3c3fe5,_0x5bfa32){return db[_0xab7a('0x31')][_0xab7a('0x60')]()[_0xab7a('0x2b')](respondWithResult(_0x5bfa32,null))['catch'](handleError(_0x5bfa32,null));};exports['addSections']=function(_0x40d4f0,_0x4cc81a){var _0x26282e=_0x40d4f0['body'];return db[_0xab7a('0x31')][_0xab7a('0x4e')]({'where':{'id':_0x40d4f0[_0xab7a('0x4c')]['id']}})[_0xab7a('0x2b')](handleEntityNotFound(_0x4cc81a,null))[_0xab7a('0x2b')](function(_0x354556){if(_0x354556){return db[_0xab7a('0x57')]['transaction'](function(_0x5267b7){return db[_0xab7a('0x5e')][_0xab7a('0x2c')]({'where':{'userProfileId':_0x40d4f0[_0xab7a('0x4c')]['id'],'sectionId':_['map'](_0x26282e,function(_0x2c54c3){return _0x2c54c3['sectionId'];})},'transaction':_0x5267b7})[_0xab7a('0x2b')](function(){var _0x369fe8=_[_0xab7a('0x30')](_0x26282e,function(_0x27b603){_0x27b603[_0xab7a('0x5c')]=_0x40d4f0[_0xab7a('0x4c')]['id'];return _0x27b603;});var _0x187228=[];return BPromise[_0xab7a('0x59')](_0x369fe8,function(_0x392ed3){return db['UserProfileSection'][_0xab7a('0x4f')](_0x392ed3,{'include':[{'model':db[_0xab7a('0x61')],'as':_0xab7a('0x5d')}],'raw':!![],'transaction':_0x5267b7})['then'](function(_0xfbebd7){_0x187228[_0xab7a('0x62')](_0xfbebd7[_0xab7a('0x51')]({'plain':!![]}));});})[_0xab7a('0x2b')](function(){return _0x187228;});});});}})[_0xab7a('0x2b')](function(_0xc2dfaa){return _0xc2dfaa;})[_0xab7a('0x2b')](respondWithResult(_0x4cc81a,null))[_0xab7a('0x4b')](handleError(_0x4cc81a,null));};exports[_0xab7a('0x63')]=function(_0x3ab784,_0x3c48f1){var _0x3667d2;return db[_0xab7a('0x31')][_0xab7a('0x4e')]({'where':{'id':_0x3ab784['params']['id']},'attributes':['id','name']})[_0xab7a('0x2b')](handleEntityNotFound(_0x3c48f1,null))[_0xab7a('0x2b')](function(_0x5ef7f1){if(_0x5ef7f1){_0x3667d2=_0x5ef7f1;return db[_0xab7a('0x5e')]['destroy']({'where':{'userProfileId':_0x3ab784[_0xab7a('0x4c')]['id'],'sectionId':_0x3ab784['query'][_0xab7a('0x64')]}});}})[_0xab7a('0x2b')](function(){return _0x3667d2;})[_0xab7a('0x2b')](respondWithStatusCode(_0x3c48f1,null))[_0xab7a('0x4b')](handleError(_0x3c48f1,null));};exports[_0xab7a('0x65')]=function(_0x22bcfc,_0x335258){var _0xedf13b=[];var _0x57fa58=[];return db[_0xab7a('0x5e')][_0xab7a('0x49')]({'where':{'userProfileId':_0x22bcfc['params']['id']},'raw':!![]})[_0xab7a('0x2b')](function(_0x103a1d){_0xedf13b=_['filter'](_0x103a1d,function(_0x3532b9){return _0x3532b9['enabled']===0x1||_[_0xab7a('0x66')]([0x3eb,0x709],_0x3532b9[_0xab7a('0x5b')]);});if(!_['isEmpty'](_0xedf13b)){return _['map'](_0xedf13b,function(_0x56b8aa){return _0x56b8aa[_0xab7a('0x5b')];});}else{return;}})[_0xab7a('0x2b')](function(_0x1c4a7f){if(_0x1c4a7f)_0x57fa58=_0x1c4a7f;if(_['includes'](_0x57fa58,0x64)){var _0x569ecd=_[_0xab7a('0x4e')](_0xedf13b,{'sectionId':0x64});return hasDefaultDashboard(_0x569ecd)[_0xab7a('0x2b')](function(_0x32aa66){return _['map'](_0xedf13b,function(_0x2bb411){if(_0x2bb411[_0xab7a('0x5b')]===0x64){_0x2bb411['subsections']=_0x32aa66;}return _0x2bb411;});});}else{return;}})['then'](function(_0x2ccb5c){if(_0x2ccb5c)_0xedf13b=_0x2ccb5c;if(_[_0xab7a('0x66')](_0x57fa58,0x3eb)){var _0x24b743=_[_0xab7a('0x4e')](_0xedf13b,{'sectionId':0x3eb});return getCustomDashboards(_0x24b743)[_0xab7a('0x2b')](function(_0xf0f63f){return _[_0xab7a('0x30')](_0xedf13b,function(_0x246127){if(_0x24b743[_0xab7a('0x67')]){if(_0x246127[_0xab7a('0x5b')]===0x3eb){_0x246127[_0xab7a('0x68')]=_0xf0f63f;}}else{if(_0x246127[_0xab7a('0x5b')]===0x64){_0x246127[_0xab7a('0x68')]=_0xf0f63f;}}return _0x246127;});});}else{return;}})[_0xab7a('0x2b')](function(_0x41159e){if(_0x41159e)_0xedf13b=_0x41159e;if(_[_0xab7a('0x66')](_0x57fa58,0x709)){var _0x345496=_[_0xab7a('0x4e')](_0xedf13b,{'sectionId':0x709});return getPlugins(_0x345496)[_0xab7a('0x2b')](function(_0xd485af){if(_0x345496[_0xab7a('0x67')]){return _[_0xab7a('0x30')](_0xedf13b,function(_0x376f98){if(_0x376f98[_0xab7a('0x5b')]===0x709){_0x376f98[_0xab7a('0x68')]=_0xd485af;}return _0x376f98;});}else{var _0x28206d={'sectionId':0x76c,'enabled':0x1,'subsections':_0xd485af};var _0x387023=_[_0xab7a('0x30')](_0xedf13b);_0x387023[_0xab7a('0x62')](_0x28206d);return _0x387023;}});}else{return;}})[_0xab7a('0x2b')](function(_0x4cf273){if(_0x4cf273)_0xedf13b=_0x4cf273;return _[_0xab7a('0x45')](_0xedf13b,['enabled',0x1]);})[_0xab7a('0x2b')](respondWithResult(_0x335258,null))[_0xab7a('0x4b')](handleError(_0x335258,null));};function hasDefaultDashboard(_0xe4b08a){var _0x2a22b9=[0x65];return new BPromise(function(_0xef8de9,_0x41e4a7){try{if(_0xe4b08a[_0xab7a('0x5a')]){_0xef8de9(_0x2a22b9);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0xe4b08a['id']},'raw':!![]})[_0xab7a('0x2b')](function(_0x292693){_0x292693?_0xef8de9(_0x2a22b9):_0xef8de9();});}}catch(_0x448f1f){_0x41e4a7(_0x448f1f);}});}function getCustomDashboards(_0x9d221f){var _0x141a2c=[];return new BPromise(function(_0x4128cf,_0x5e7dec){try{if(_0x9d221f[_0xab7a('0x5a')]){return db[_0xab7a('0x69')]['findAll']({'raw':!![]})[_0xab7a('0x2b')](function(_0xa9ac77){_0xa9ac77[_0xab7a('0x6a')](function(_0x4a375c){_0x141a2c[_0xab7a('0x62')](_0x4a375c['id']+0x1869f);});_0x4128cf(_0x141a2c);});}else{return db['UserProfileResource'][_0xab7a('0x49')]({'where':{'sectionId':_0x9d221f['id']},'raw':!![]})[_0xab7a('0x2b')](function(_0x4a3a56){_0x4a3a56[_0xab7a('0x6a')](function(_0x3f4b28){_0x141a2c[_0xab7a('0x62')](_0x3f4b28[_0xab7a('0x6b')]+0x1869f);});_0x4128cf(_0x141a2c);});}}catch(_0x3dd12f){_0x5e7dec(_0x3dd12f);}});}function getPlugins(_0x587f1d){var _0x51e595=[];return new BPromise(function(_0xdf83a4,_0x9ca150){try{if(_0x587f1d[_0xab7a('0x5a')]){return db[_0xab7a('0x6c')][_0xab7a('0x49')]({'raw':!![]})[_0xab7a('0x2b')](function(_0x1893b8){_0x1893b8[_0xab7a('0x6a')](function(_0x1e5ed0){_0x51e595[_0xab7a('0x62')](_0x1e5ed0['id']+0x15b38);});_0xdf83a4(_0x51e595);});}else{return db[_0xab7a('0x61')]['findAll']({'where':{'sectionId':_0x587f1d['id']},'raw':!![]})[_0xab7a('0x2b')](function(_0x3fcf70){_0x3fcf70[_0xab7a('0x6a')](function(_0xddb0b1){_0x51e595[_0xab7a('0x62')](_0xddb0b1[_0xab7a('0x6b')]+0x15b38);});_0xdf83a4(_0x51e595);});}}catch(_0x22235b){_0x9ca150(_0x22235b);}});}exports['addResources']=function(_0x3ad93e,_0x2f512e){return db['UserProfile'][_0xab7a('0x4e')]({'where':{'id':_0x3ad93e[_0xab7a('0x4c')]['id']}})[_0xab7a('0x2b')](handleEntityNotFound(_0x2f512e,null))[_0xab7a('0x2b')](function(_0x46f7ce){if(_0x46f7ce){return db[_0xab7a('0x57')][_0xab7a('0x58')](function(_0x414376){return db['UserProfileSection'][_0xab7a('0x49')]({'where':{'userProfileId':_0x3ad93e['params']['id']},'attributes':['id'],'raw':!![]})[_0xab7a('0x2b')](function(_0x52538e){if(_0x52538e){return db[_0xab7a('0x5e')]['destroy']({'where':{'userProfileId':_0x3ad93e[_0xab7a('0x4c')]['id'],'id':_[_0xab7a('0x30')](_0x52538e,function(_0x31bdfd){return _0x31bdfd['id'];})},'transaction':_0x414376});}})['then'](function(_0x1574af){var _0x44ae3d=_[_0xab7a('0x30')](_0x3ad93e[_0xab7a('0x56')],function(_0x9afb97){_0x9afb97[_0xab7a('0x5c')]=_0x3ad93e[_0xab7a('0x4c')]['id'];return _0x9afb97;});return db[_0xab7a('0x5e')][_0xab7a('0x6d')](_0x44ae3d,{'raw':!![],'transaction':_0x414376});})[_0xab7a('0x2b')](function(_0xbb3028){var _0x3a90a9=_[_0xab7a('0x45')](_[_0xab7a('0x30')](_0xbb3028,function(_0x56097d){return _0x56097d[_0xab7a('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x3a90a9){return db[_0xab7a('0x5e')][_0xab7a('0x49')]({'where':{'userProfileId':_0x3ad93e[_0xab7a('0x4c')]['id'],'sectionId':_[_0xab7a('0x30')](_0x3a90a9,function(_0x50929a){return _0x50929a[_0xab7a('0x5b')];})},'attributes':['id',_0xab7a('0x5b')],'raw':!![]})[_0xab7a('0x2b')](function(_0x4b192f){var _0x419053=_[_0xab7a('0x30')](_0x3ad93e['body'],function(_0x2abfe7){_0x2abfe7[_0xab7a('0x5c')]=_0x3ad93e[_0xab7a('0x4c')]['id'];return _0x2abfe7;});return db[_0xab7a('0x61')][_0xab7a('0x6d')](_0x419053,{'raw':!![],'transaction':_0x414376});});}})['catch'](handleError(_0x2f512e,null));});}})[_0xab7a('0x2b')](function(_0x328630){var _0x4685ce=_[_0xab7a('0x30')](_0x328630,function(_0x5a1eff){return _0x5a1eff[_0xab7a('0x51')]({'plain':!![]});});})[_0xab7a('0x2b')](respondWithResult(_0x2f512e,null))[_0xab7a('0x4b')](handleError(_0x2f512e,null));};exports[_0xab7a('0x6e')]=function(_0x5d71af,_0x5bef94,_0x58465d){return db['UserProfile'][_0xab7a('0x4e')]({'where':{'id':_0x5d71af[_0xab7a('0x4c')]['id']}})[_0xab7a('0x2b')](handleEntityNotFound(_0x5bef94,null))['then'](function(_0x27e329){if(_0x27e329){return _0x27e329['removeResources'](_0x5d71af[_0xab7a('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x5bef94,null))[_0xab7a('0x4b')](handleError(_0x5bef94,null));};exports[_0xab7a('0x6f')]=function(_0xd712ca,_0x37c82d){var _0x2634f2={};if(!_0xd712ca[_0xab7a('0x37')][_0xab7a('0x70')])throw new Error('Missing\x20section\x20parameter');if(!_0xd712ca[_0xab7a('0x37')][_0xab7a('0x3d')]('nolimit')){_0x2634f2['limit']=qs['limit'](_0xd712ca[_0xab7a('0x37')][_0xab7a('0x25')]);_0x2634f2['offset']=qs[_0xab7a('0x23')](_0xd712ca[_0xab7a('0x37')][_0xab7a('0x23')]);}return db['UserProfile']['find']({'where':{'id':_0xd712ca[_0xab7a('0x4c')]['id']}})[_0xab7a('0x2b')](function(_0x8f0c29){if(!_0x8f0c29)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0xd712ca[_0xab7a('0x4c')]['id']);return db[_0xab7a('0x31')][_0xab7a('0x6f')](_0xd712ca);})[_0xab7a('0x2b')](respondWithFilteredResult(_0x37c82d,_0x2634f2))[_0xab7a('0x4b')](handleError(_0x37c82d,null));};
\ No newline at end of file
+var _0x45c2=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','status','end','json','undefined','limit','count','offset','set','apply','reject','save','sendStatus','error','stack','send','index','UserProfile','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','name','options','then','includeAll','findAll','params','intersection','find','catch','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','create','each','autoAssociation','UserProfileResource','sectionId','userProfileId','UserProfileSection','Resources','update','destroy','describe','addSections','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x4d1838,_0xb1d399){var _0x341536=function(_0x25a383){while(--_0x25a383){_0x4d1838['push'](_0x4d1838['shift']());}};_0x341536(++_0xb1d399);}(_0x45c2,0x68));var _0x245c=function(_0xb2dab9,_0x2f6f99){_0xb2dab9=_0xb2dab9-0x0;var _0x10c6ae=_0x45c2[_0xb2dab9];return _0x10c6ae;};'use strict';var emlformat=require(_0x245c('0x0'));var rimraf=require(_0x245c('0x1'));var zipdir=require(_0x245c('0x2'));var jsonpatch=require(_0x245c('0x3'));var rp=require('request-promise');var moment=require(_0x245c('0x4'));var BPromise=require(_0x245c('0x5'));var Mustache=require(_0x245c('0x6'));var util=require('util');var path=require(_0x245c('0x7'));var sox=require(_0x245c('0x8'));var csv=require(_0x245c('0x9'));var ejs=require(_0x245c('0xa'));var fs=require('fs');var fs_extra=require(_0x245c('0xb'));var _=require(_0x245c('0xc'));var squel=require(_0x245c('0xd'));var crypto=require(_0x245c('0xe'));var jsforce=require(_0x245c('0xf'));var deskjs=require(_0x245c('0x10'));var toCsv=require(_0x245c('0x9'));var querystring=require(_0x245c('0x11'));var Papa=require('papaparse');var Redis=require(_0x245c('0x12'));var authService=require(_0x245c('0x13'));var qs=require(_0x245c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x245c('0x15'))(_0x245c('0x16'));var utils=require('../../config/utils');var config=require(_0x245c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x245c('0x18'))['db'];config[_0x245c('0x19')]=_[_0x245c('0x1a')](config[_0x245c('0x19')],{'host':_0x245c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x245c('0x19')]));require(_0x245c('0x1c'))[_0x245c('0x1d')](socket);function respondWithStatusCode(_0x3c0336,_0x50a77b){_0x50a77b=_0x50a77b||0xcc;return function(_0x2460ce){if(_0x2460ce){return _0x3c0336['sendStatus'](_0x50a77b);}return _0x3c0336[_0x245c('0x1e')](_0x50a77b)[_0x245c('0x1f')]();};}function respondWithResult(_0x3c2ccf,_0x19a877){_0x19a877=_0x19a877||0xc8;return function(_0x49c0f6){if(_0x49c0f6){return _0x3c2ccf[_0x245c('0x1e')](_0x19a877)[_0x245c('0x20')](_0x49c0f6);}};}function respondWithFilteredResult(_0xeb61a6,_0x21596b){return function(_0xee10c3){if(_0xee10c3){var _0x246d45=typeof _0x21596b['offset']===_0x245c('0x21')&&typeof _0x21596b[_0x245c('0x22')]==='undefined';var _0x4579d1=_0xee10c3[_0x245c('0x23')];var _0x468841=_0x246d45?0x0:_0x21596b[_0x245c('0x24')];var _0x4cf062=_0x246d45?_0xee10c3['count']:_0x21596b[_0x245c('0x24')]+_0x21596b['limit'];var _0x41c931;if(_0x4cf062>=_0x4579d1){_0x4cf062=_0x4579d1;_0x41c931=0xc8;}else{_0x41c931=0xce;}_0xeb61a6[_0x245c('0x1e')](_0x41c931);return _0xeb61a6[_0x245c('0x25')]('Content-Range',_0x468841+'-'+_0x4cf062+'/'+_0x4579d1)[_0x245c('0x20')](_0xee10c3);}return null;};}function patchUpdates(_0x52a0a3){return function(_0x4f6f91){try{jsonpatch[_0x245c('0x26')](_0x4f6f91,_0x52a0a3,!![]);}catch(_0x40444d){return BPromise[_0x245c('0x27')](_0x40444d);}return _0x4f6f91[_0x245c('0x28')]();};}function saveUpdates(_0x327140,_0x122b42){return function(_0x4e21ee){if(_0x4e21ee){return _0x4e21ee['update'](_0x327140)['then'](function(_0x51d0fc){return _0x51d0fc;});}return null;};}function removeEntity(_0x1c1b84,_0x383df5){return function(_0x1f1357){if(_0x1f1357){return _0x1f1357['destroy']()['then'](function(){_0x1c1b84[_0x245c('0x1e')](0xcc)[_0x245c('0x1f')]();});}};}function handleEntityNotFound(_0x3296e1,_0x549568){return function(_0x24f80b){if(!_0x24f80b){_0x3296e1[_0x245c('0x29')](0x194);}return _0x24f80b;};}function handleError(_0xf2f4b9,_0x3377f4){_0x3377f4=_0x3377f4||0x1f4;return function(_0x5a2a16){logger[_0x245c('0x2a')](_0x5a2a16[_0x245c('0x2b')]);if(_0x5a2a16['name']){delete _0x5a2a16['name'];}_0xf2f4b9[_0x245c('0x1e')](_0x3377f4)[_0x245c('0x2c')](_0x5a2a16);};}exports[_0x245c('0x2d')]=function(_0x475004,_0x264650){var _0x48a215={},_0x3676fe={},_0x5e31b4={'count':0x0,'rows':[]};var _0x4666fb=_['map'](db[_0x245c('0x2e')][_0x245c('0x2f')],function(_0x31fed0){return{'name':_0x31fed0['fieldName'],'type':_0x31fed0[_0x245c('0x30')][_0x245c('0x31')]};});_0x3676fe[_0x245c('0x32')]=_[_0x245c('0x33')](_0x4666fb,'name');_0x3676fe[_0x245c('0x34')]=_[_0x245c('0x35')](_0x475004[_0x245c('0x34')]);_0x3676fe[_0x245c('0x36')]=_['intersection'](_0x3676fe['model'],_0x3676fe['query']);_0x48a215[_0x245c('0x37')]=_['intersection'](_0x3676fe['model'],qs[_0x245c('0x38')](_0x475004[_0x245c('0x34')]['fields']));_0x48a215[_0x245c('0x37')]=_0x48a215[_0x245c('0x37')][_0x245c('0x39')]?_0x48a215[_0x245c('0x37')]:_0x3676fe[_0x245c('0x32')];if(!_0x475004[_0x245c('0x34')][_0x245c('0x3a')](_0x245c('0x3b'))){_0x48a215[_0x245c('0x22')]=qs[_0x245c('0x22')](_0x475004['query'][_0x245c('0x22')]);_0x48a215[_0x245c('0x24')]=qs['offset'](_0x475004['query'][_0x245c('0x24')]);}_0x48a215['order']=qs['sort'](_0x475004[_0x245c('0x34')][_0x245c('0x3c')]);_0x48a215[_0x245c('0x3d')]=qs[_0x245c('0x36')](_[_0x245c('0x3e')](_0x475004[_0x245c('0x34')],_0x3676fe['filters']),_0x4666fb);if(_0x475004['query'][_0x245c('0x3f')]){_0x48a215[_0x245c('0x3d')]=_[_0x245c('0x40')](_0x48a215[_0x245c('0x3d')],{'$or':_[_0x245c('0x33')](_0x4666fb,function(_0xa84fea){if(_0xa84fea[_0x245c('0x30')]!==_0x245c('0x41')){var _0x4beff7={};_0x4beff7[_0xa84fea[_0x245c('0x42')]]={'$like':'%'+_0x475004[_0x245c('0x34')][_0x245c('0x3f')]+'%'};return _0x4beff7;}})});}_0x48a215=_[_0x245c('0x40')]({},_0x48a215,_0x475004[_0x245c('0x43')]);var _0x1f91b6={'where':_0x48a215[_0x245c('0x3d')]};return db[_0x245c('0x2e')][_0x245c('0x23')](_0x1f91b6)[_0x245c('0x44')](function(_0x2a89df){_0x5e31b4['count']=_0x2a89df;if(_0x475004['query'][_0x245c('0x45')]){_0x48a215['include']=[{'all':!![]}];}return db[_0x245c('0x2e')][_0x245c('0x46')](_0x48a215);})[_0x245c('0x44')](function(_0x20cfdb){_0x5e31b4['rows']=_0x20cfdb;return _0x5e31b4;})[_0x245c('0x44')](respondWithFilteredResult(_0x264650,_0x48a215))['catch'](handleError(_0x264650,null));};exports['show']=function(_0x4d9f6c,_0x5d87fd){var _0x435b45={'raw':![],'where':{'id':_0x4d9f6c[_0x245c('0x47')]['id']}},_0x502a95={};_0x502a95['model']=_[_0x245c('0x35')](db[_0x245c('0x2e')][_0x245c('0x2f')]);_0x502a95[_0x245c('0x34')]=_[_0x245c('0x35')](_0x4d9f6c[_0x245c('0x34')]);_0x502a95[_0x245c('0x36')]=_['intersection'](_0x502a95[_0x245c('0x32')],_0x502a95[_0x245c('0x34')]);_0x435b45[_0x245c('0x37')]=_[_0x245c('0x48')](_0x502a95[_0x245c('0x32')],qs[_0x245c('0x38')](_0x4d9f6c[_0x245c('0x34')][_0x245c('0x38')]));_0x435b45[_0x245c('0x37')]=_0x435b45[_0x245c('0x37')][_0x245c('0x39')]?_0x435b45[_0x245c('0x37')]:_0x502a95['model'];if(_0x4d9f6c[_0x245c('0x34')][_0x245c('0x45')]){_0x435b45['include']=[{'all':!![]}];}_0x435b45=_[_0x245c('0x40')]({},_0x435b45,_0x4d9f6c['options']);return db['UserProfile'][_0x245c('0x49')](_0x435b45)[_0x245c('0x44')](handleEntityNotFound(_0x5d87fd,null))[_0x245c('0x44')](respondWithResult(_0x5d87fd,null))[_0x245c('0x4a')](handleError(_0x5d87fd,null));};exports['create']=function(_0x3b46f4,_0x2442d2){return db[_0x245c('0x2e')]['create'](_0x3b46f4[_0x245c('0x4b')],{})[_0x245c('0x44')](respondWithResult(_0x2442d2,0xc9))[_0x245c('0x4a')](handleError(_0x2442d2,null));};exports[_0x245c('0x4c')]=function(_0x2a6bb5,_0x2d8278){var _0x41346a={'where':{'id':_0x2a6bb5[_0x245c('0x47')]['id']}},_0x1330f1={};_0x1330f1['model']=_[_0x245c('0x35')](db[_0x245c('0x2e')][_0x245c('0x2f')]);_0x41346a[_0x245c('0x37')]=_[_0x245c('0x48')](_0x1330f1[_0x245c('0x32')],qs[_0x245c('0x38')](_0x2a6bb5[_0x245c('0x34')][_0x245c('0x38')]));_0x41346a[_0x245c('0x37')]=_0x41346a[_0x245c('0x37')][_0x245c('0x39')]?_0x41346a[_0x245c('0x37')]:_0x1330f1[_0x245c('0x32')];if(_0x2a6bb5[_0x245c('0x34')][_0x245c('0x45')]){_0x41346a['include']=[{'all':!![]}];}_0x41346a=_[_0x245c('0x40')]({},_0x41346a,_0x2a6bb5[_0x245c('0x43')]);return db['UserProfile'][_0x245c('0x49')](_0x41346a)['then'](handleEntityNotFound(_0x2d8278,null))[_0x245c('0x44')](function(_0x489f50){if(_0x489f50){var _0x12c7b1=_0x489f50[_0x245c('0x4d')]({'plain':!![]});_0x12c7b1=qs[_0x245c('0x4e')](_0x12c7b1,['id',_0x245c('0x4f'),_0x245c('0x50'),_0x245c('0x51')]);_0x2a6bb5[_0x245c('0x4b')]=_[_0x245c('0x4e')](_0x2a6bb5[_0x245c('0x4b')],['id','createdAt',_0x245c('0x50')]);return db[_0x245c('0x52')][_0x245c('0x53')](function(_0x3a28fe){return db['UserProfile'][_0x245c('0x54')](_['merge'](_0x12c7b1,_0x2a6bb5[_0x245c('0x4b')]),{'include':_0x2a6bb5[_0x245c('0x34')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3a28fe})['then'](function(_0x3ae734){var _0x461539=_0x3ae734[_0x245c('0x4d')]({'plain':!![]});return db['UserProfileSection'][_0x245c('0x46')]({'where':{'userProfileId':_0x2a6bb5[_0x245c('0x47')]['id']},'raw':!![]})[_0x245c('0x44')](function(_0x495c4e){if(_0x495c4e){return BPromise[_0x245c('0x55')](_0x495c4e,function(_0x52b5be){return new BPromise(function(_0x17c2d,_0x3cf064){if(_0x52b5be[_0x245c('0x56')]===null||_0x52b5be['autoAssociation']===0x1)_0x17c2d(null);return db[_0x245c('0x57')][_0x245c('0x46')]({'where':{'sectionId':_0x52b5be['id']},'raw':!![]})[_0x245c('0x44')](function(_0x42be1d){var _0x3cb3b7=_[_0x245c('0x33')](_0x42be1d,function(_0x34b694){return qs[_0x245c('0x4e')](_0x34b694,['id',_0x245c('0x4f'),_0x245c('0x50'),_0x245c('0x58')]);});_0x17c2d(_0x3cb3b7);})[_0x245c('0x4a')](function(_0x26a5b9){_0x3cf064(_0x26a5b9);});})['then'](function(_0x428e8c){var _0x5c6410=qs['omit'](_0x52b5be,['id','createdAt',_0x245c('0x50')]);_0x5c6410[_0x245c('0x59')]=_0x461539['id'];if(_0x428e8c)_0x5c6410['Resources']=_0x428e8c;return _0x5c6410;})['then'](function(_0xc21b29){return db[_0x245c('0x5a')][_0x245c('0x54')](_0xc21b29,{'include':[{'model':db['UserProfileResource'],'as':_0x245c('0x5b')}],'raw':!![],'transaction':_0x3a28fe});});})[_0x245c('0x44')](function(){return _0x461539;});}});});});}})['then'](respondWithResult(_0x2d8278,0xc9))[_0x245c('0x4a')](handleError(_0x2d8278,null));};exports[_0x245c('0x5c')]=function(_0xbca350,_0x1d904c){if(_0xbca350[_0x245c('0x4b')]['id']){delete _0xbca350[_0x245c('0x4b')]['id'];}return db[_0x245c('0x2e')][_0x245c('0x49')]({'where':{'id':_0xbca350[_0x245c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d904c,null))[_0x245c('0x44')](saveUpdates(_0xbca350[_0x245c('0x4b')],null))[_0x245c('0x44')](respondWithResult(_0x1d904c,null))[_0x245c('0x4a')](handleError(_0x1d904c,null));};exports[_0x245c('0x5d')]=function(_0x4bb85d,_0x2d463b){return db['UserProfile'][_0x245c('0x49')]({'where':{'id':_0x4bb85d[_0x245c('0x47')]['id']}})[_0x245c('0x44')](handleEntityNotFound(_0x2d463b,null))[_0x245c('0x44')](removeEntity(_0x2d463b,null))['catch'](handleError(_0x2d463b,null));};exports['describe']=function(_0x1a3cd9,_0x49ebfd){return db[_0x245c('0x2e')][_0x245c('0x5e')]()[_0x245c('0x44')](respondWithResult(_0x49ebfd,null))['catch'](handleError(_0x49ebfd,null));};exports[_0x245c('0x5f')]=function(_0xdbf818,_0x232c07){var _0x19f749=_0xdbf818[_0x245c('0x4b')];return db[_0x245c('0x2e')][_0x245c('0x49')]({'where':{'id':_0xdbf818['params']['id']}})[_0x245c('0x44')](handleEntityNotFound(_0x232c07,null))['then'](function(_0x4f2c7f){if(_0x4f2c7f){return db[_0x245c('0x52')]['transaction'](function(_0x3a9360){return db[_0x245c('0x5a')][_0x245c('0x5d')]({'where':{'userProfileId':_0xdbf818[_0x245c('0x47')]['id'],'sectionId':_['map'](_0x19f749,function(_0x3730d8){return _0x3730d8[_0x245c('0x58')];})},'transaction':_0x3a9360})['then'](function(){var _0x3961e4=_[_0x245c('0x33')](_0x19f749,function(_0x4887ae){_0x4887ae[_0x245c('0x59')]=_0xdbf818['params']['id'];return _0x4887ae;});var _0x3216f2=[];return BPromise[_0x245c('0x55')](_0x3961e4,function(_0xd2236d){return db[_0x245c('0x5a')][_0x245c('0x54')](_0xd2236d,{'include':[{'model':db['UserProfileResource'],'as':_0x245c('0x5b')}],'raw':!![],'transaction':_0x3a9360})[_0x245c('0x44')](function(_0x30193f){_0x3216f2[_0x245c('0x60')](_0x30193f[_0x245c('0x4d')]({'plain':!![]}));});})['then'](function(){return _0x3216f2;});});});}})[_0x245c('0x44')](function(_0x4f040c){return _0x4f040c;})[_0x245c('0x44')](respondWithResult(_0x232c07,null))['catch'](handleError(_0x232c07,null));};exports[_0x245c('0x61')]=function(_0x1ec4ed,_0x41d85a){var _0x5919e7;return db[_0x245c('0x2e')][_0x245c('0x49')]({'where':{'id':_0x1ec4ed['params']['id']},'attributes':['id','name']})[_0x245c('0x44')](handleEntityNotFound(_0x41d85a,null))[_0x245c('0x44')](function(_0x490c6a){if(_0x490c6a){_0x5919e7=_0x490c6a;return db[_0x245c('0x5a')]['destroy']({'where':{'userProfileId':_0x1ec4ed[_0x245c('0x47')]['id'],'sectionId':_0x1ec4ed[_0x245c('0x34')][_0x245c('0x62')]}});}})[_0x245c('0x44')](function(){return _0x5919e7;})[_0x245c('0x44')](respondWithStatusCode(_0x41d85a,null))[_0x245c('0x4a')](handleError(_0x41d85a,null));};exports[_0x245c('0x63')]=function(_0x459eb1,_0x2d41de){var _0x17e034=[];var _0x23851e=[];return db[_0x245c('0x5a')][_0x245c('0x46')]({'where':{'userProfileId':_0x459eb1[_0x245c('0x47')]['id']},'raw':!![]})[_0x245c('0x44')](function(_0x2bc43a){_0x17e034=_[_0x245c('0x3f')](_0x2bc43a,function(_0x2e5c40){return _0x2e5c40[_0x245c('0x64')]===0x1||_[_0x245c('0x65')]([0x3eb,0x709],_0x2e5c40[_0x245c('0x58')]);});if(!_[_0x245c('0x66')](_0x17e034)){return _[_0x245c('0x33')](_0x17e034,function(_0x309ba3){return _0x309ba3[_0x245c('0x58')];});}else{return;}})[_0x245c('0x44')](function(_0x12272c){if(_0x12272c)_0x23851e=_0x12272c;if(_[_0x245c('0x65')](_0x23851e,0x64)){var _0x12f3e3=_[_0x245c('0x49')](_0x17e034,{'sectionId':0x64});return hasDefaultDashboard(_0x12f3e3)[_0x245c('0x44')](function(_0x3c4d6c){return _['map'](_0x17e034,function(_0x54fbed){if(_0x54fbed[_0x245c('0x58')]===0x64){_0x54fbed[_0x245c('0x67')]=_0x3c4d6c;}return _0x54fbed;});});}else{return;}})[_0x245c('0x44')](function(_0x5587e8){if(_0x5587e8)_0x17e034=_0x5587e8;if(_[_0x245c('0x65')](_0x23851e,0x3eb)){var _0x155dc4=_['find'](_0x17e034,{'sectionId':0x3eb});return getCustomDashboards(_0x155dc4)[_0x245c('0x44')](function(_0x512e00){return _['map'](_0x17e034,function(_0x4f814e){if(_0x155dc4['enabled']){if(_0x4f814e[_0x245c('0x58')]===0x3eb){_0x4f814e[_0x245c('0x67')]=_0x512e00;}}else{if(_0x4f814e[_0x245c('0x58')]===0x64){_0x4f814e[_0x245c('0x67')]=_0x512e00;}}return _0x4f814e;});});}else{return;}})[_0x245c('0x44')](function(_0x27e678){if(_0x27e678)_0x17e034=_0x27e678;if(_[_0x245c('0x65')](_0x23851e,0x709)){var _0xcad4ed=_[_0x245c('0x49')](_0x17e034,{'sectionId':0x709});return getPlugins(_0xcad4ed)[_0x245c('0x44')](function(_0x297875){if(_0xcad4ed[_0x245c('0x64')]){return _[_0x245c('0x33')](_0x17e034,function(_0x2a665e){if(_0x2a665e[_0x245c('0x58')]===0x709){_0x2a665e[_0x245c('0x67')]=_0x297875;}return _0x2a665e;});}else{var _0x30cff6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x297875};var _0x1da8f0=_[_0x245c('0x33')](_0x17e034);_0x1da8f0[_0x245c('0x60')](_0x30cff6);return _0x1da8f0;}});}else{return;}})[_0x245c('0x44')](function(_0x183500){if(_0x183500)_0x17e034=_0x183500;return _[_0x245c('0x3f')](_0x17e034,[_0x245c('0x64'),0x1]);})[_0x245c('0x44')](respondWithResult(_0x2d41de,null))[_0x245c('0x4a')](handleError(_0x2d41de,null));};function hasDefaultDashboard(_0x57c5c7){var _0x5545cf=[0x65];return new BPromise(function(_0x18fde7,_0x1b04ee){try{if(_0x57c5c7[_0x245c('0x56')]){_0x18fde7(_0x5545cf);}else{return db['UserProfileResource'][_0x245c('0x68')]({'where':{'sectionId':_0x57c5c7['id']},'raw':!![]})[_0x245c('0x44')](function(_0x483875){_0x483875?_0x18fde7(_0x5545cf):_0x18fde7();});}}catch(_0x12f5d9){_0x1b04ee(_0x12f5d9);}});}function getCustomDashboards(_0x2afc84){var _0x3ffc0b=[];return new BPromise(function(_0x1346ea,_0x18288e){try{if(_0x2afc84[_0x245c('0x56')]){return db[_0x245c('0x69')][_0x245c('0x46')]({'raw':!![]})['then'](function(_0xcf42fc){_0xcf42fc[_0x245c('0x6a')](function(_0x492a0e){_0x3ffc0b[_0x245c('0x60')](_0x492a0e['id']+0x1869f);});_0x1346ea(_0x3ffc0b);});}else{return db['UserProfileResource'][_0x245c('0x46')]({'where':{'sectionId':_0x2afc84['id']},'raw':!![]})[_0x245c('0x44')](function(_0x3c3773){_0x3c3773['forEach'](function(_0x420d07){_0x3ffc0b['push'](_0x420d07[_0x245c('0x6b')]+0x1869f);});_0x1346ea(_0x3ffc0b);});}}catch(_0x538e47){_0x18288e(_0x538e47);}});}function getPlugins(_0x5a78b7){var _0x446521=[];return new BPromise(function(_0xe69f23,_0x7aa9a2){try{if(_0x5a78b7[_0x245c('0x56')]){return db[_0x245c('0x6c')][_0x245c('0x46')]({'raw':!![]})[_0x245c('0x44')](function(_0xe90f18){_0xe90f18[_0x245c('0x6a')](function(_0x46064f){_0x446521['push'](_0x46064f['id']+0x15b38);});_0xe69f23(_0x446521);});}else{return db[_0x245c('0x57')]['findAll']({'where':{'sectionId':_0x5a78b7['id']},'raw':!![]})[_0x245c('0x44')](function(_0x4fb55a){_0x4fb55a[_0x245c('0x6a')](function(_0x38a667){_0x446521[_0x245c('0x60')](_0x38a667[_0x245c('0x6b')]+0x15b38);});_0xe69f23(_0x446521);});}}catch(_0x1c9cd5){_0x7aa9a2(_0x1c9cd5);}});}exports['addResources']=function(_0x10372f,_0x4268f7){return db[_0x245c('0x2e')][_0x245c('0x49')]({'where':{'id':_0x10372f[_0x245c('0x47')]['id']}})[_0x245c('0x44')](handleEntityNotFound(_0x4268f7,null))[_0x245c('0x44')](function(_0x3cd996){if(_0x3cd996){return db[_0x245c('0x52')]['transaction'](function(_0x5bd9d3){return db[_0x245c('0x5a')][_0x245c('0x46')]({'where':{'userProfileId':_0x10372f[_0x245c('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x245c('0x44')](function(_0x3be028){if(_0x3be028){return db[_0x245c('0x5a')]['destroy']({'where':{'userProfileId':_0x10372f['params']['id'],'id':_['map'](_0x3be028,function(_0x4b1247){return _0x4b1247['id'];})},'transaction':_0x5bd9d3});}})[_0x245c('0x44')](function(_0x52e386){var _0x3268df=_[_0x245c('0x33')](_0x10372f['body'],function(_0x586f19){_0x586f19['userProfileId']=_0x10372f[_0x245c('0x47')]['id'];return _0x586f19;});return db['UserProfileSection'][_0x245c('0x6d')](_0x3268df,{'raw':!![],'transaction':_0x5bd9d3});})[_0x245c('0x44')](function(_0x9da066){var _0x4d6829=_[_0x245c('0x3f')](_[_0x245c('0x33')](_0x9da066,function(_0x5f0029){return _0x5f0029[_0x245c('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x4d6829){return db['UserProfileSection'][_0x245c('0x46')]({'where':{'userProfileId':_0x10372f[_0x245c('0x47')]['id'],'sectionId':_[_0x245c('0x33')](_0x4d6829,function(_0x1163bb){return _0x1163bb[_0x245c('0x58')];})},'attributes':['id',_0x245c('0x58')],'raw':!![]})['then'](function(_0x3d7c05){var _0x59ad12=_[_0x245c('0x33')](_0x10372f[_0x245c('0x4b')],function(_0x3ff710){_0x3ff710['userProfileId']=_0x10372f[_0x245c('0x47')]['id'];return _0x3ff710;});return db['UserProfileResource'][_0x245c('0x6d')](_0x59ad12,{'raw':!![],'transaction':_0x5bd9d3});});}})[_0x245c('0x4a')](handleError(_0x4268f7,null));});}})[_0x245c('0x44')](function(_0x3e9b8e){var _0x162d2c=_[_0x245c('0x33')](_0x3e9b8e,function(_0x1c1191){return _0x1c1191[_0x245c('0x4d')]({'plain':!![]});});})['then'](respondWithResult(_0x4268f7,null))[_0x245c('0x4a')](handleError(_0x4268f7,null));};exports['removeResources']=function(_0x3e0ba0,_0x5ac211,_0x4e6404){return db[_0x245c('0x2e')]['find']({'where':{'id':_0x3e0ba0[_0x245c('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ac211,null))['then'](function(_0x46bb46){if(_0x46bb46){return _0x46bb46[_0x245c('0x6e')](_0x3e0ba0[_0x245c('0x34')][_0x245c('0x62')]);}})['then'](respondWithStatusCode(_0x5ac211,null))[_0x245c('0x4a')](handleError(_0x5ac211,null));};exports[_0x245c('0x6f')]=function(_0x3e448f,_0x4e4dd3){var _0x1fb514={};if(!_0x3e448f['query']['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x3e448f[_0x245c('0x34')][_0x245c('0x3a')](_0x245c('0x3b'))){_0x1fb514[_0x245c('0x22')]=qs[_0x245c('0x22')](_0x3e448f[_0x245c('0x34')][_0x245c('0x22')]);_0x1fb514[_0x245c('0x24')]=qs['offset'](_0x3e448f[_0x245c('0x34')][_0x245c('0x24')]);}return db[_0x245c('0x2e')]['find']({'where':{'id':_0x3e448f['params']['id']}})[_0x245c('0x44')](function(_0x324f7f){if(!_0x324f7f)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x3e448f[_0x245c('0x47')]['id']);return db[_0x245c('0x2e')][_0x245c('0x6f')](_0x3e448f);})[_0x245c('0x44')](respondWithFilteredResult(_0x4e4dd3,_0x1fb514))[_0x245c('0x4a')](handleError(_0x4e4dd3,null));};
\ No newline at end of file
index 0614075..406dea2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d9=['UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2ed3a2,_0x5cc62a){var _0xf11bbc=function(_0x241d9d){while(--_0x241d9d){_0x2ed3a2['push'](_0x2ed3a2['shift']());}};_0xf11bbc(++_0x5cc62a);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x901d('0x0'));var UserProfile=require(_0x901d('0x1'))['db'][_0x901d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x901d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x901d('0x4'),'afterDestroy':_0x901d('0x5')};function emitEvent(_0x247cfc){return function(_0x8f7b4,_0x214f38,_0x456f31){UserProfileEvents[_0x901d('0x6')](_0x247cfc+':'+_0x8f7b4['id'],_0x8f7b4);UserProfileEvents['emit'](_0x247cfc,_0x8f7b4);_0x456f31(null);};}for(var e in events){if(events[_0x901d('0x7')](e)){var event=events[e];UserProfile[_0x901d('0x8')](e,emitEvent(event));}}module[_0x901d('0x9')]=UserProfileEvents;
\ No newline at end of file
+var _0x57ca=['hasOwnProperty','hook','exports','../../mysqldb','UserProfile','save','update','remove','emit'];(function(_0x590da5,_0x298084){var _0x54d4c4=function(_0xf67551){while(--_0xf67551){_0x590da5['push'](_0x590da5['shift']());}};_0x54d4c4(++_0x298084);}(_0x57ca,0x108));var _0xa57c=function(_0xfabd93,_0x4aec0b){_0xfabd93=_0xfabd93-0x0;var _0x26c3a5=_0x57ca[_0xfabd93];return _0x26c3a5;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa57c('0x0'))['db'][_0xa57c('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa57c('0x2'),'afterUpdate':_0xa57c('0x3'),'afterDestroy':_0xa57c('0x4')};function emitEvent(_0x15e330){return function(_0x1da469,_0x48be2d,_0x40ba22){UserProfileEvents[_0xa57c('0x5')](_0x15e330+':'+_0x1da469['id'],_0x1da469);UserProfileEvents[_0xa57c('0x5')](_0x15e330,_0x1da469);_0x40ba22(null);};}for(var e in events){if(events[_0xa57c('0x6')](e)){var event=events[e];UserProfile[_0xa57c('0x7')](e,emitEvent(event));}}module[_0xa57c('0x8')]=UserProfileEvents;
\ No newline at end of file
index f725e1a..f1bab16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21b6=['models','filter','field','findAll','then','associatedResources','map','catch','value','resolve','UserProfileResource','toLowerCase','squareprojects','childModel','odbc','squarerecordings','SquareRecording','name','projectName','projects','JscriptyProject','CmContact','parentSections','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','type','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Tag','templates','Template','triggers','Trigger','trunks','Trunk','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','find','params','all','ignore','union','autoAssociation','model','rawAttributes','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','filters','VIRTUAL','foreignKey','forEach','merge','reportType','default','reportId','DefaultReports','count','rows','include','color','tag','ThroughTags','Agents','true','chat','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports'];(function(_0x1d5bd8,_0x361276){var _0x1e99fd=function(_0x2a23f8){while(--_0x2a23f8){_0x1d5bd8['push'](_0x1d5bd8['shift']());}};_0x1e99fd(++_0x361276);}(_0x21b6,0x17e));var _0x621b=function(_0x5926bd,_0x5c8ddf){_0x5926bd=_0x5926bd-0x0;var _0x2b1633=_0x21b6[_0x5926bd];return _0x2b1633;};'use strict';var _=require(_0x621b('0x0'));var attributes=require(_0x621b('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x621b('0x2'));module[_0x621b('0x3')]=function(_0x4b82f9){var _0x202e87=_0x4b82f9[_0x621b('0x4')];function _0x1f9d64(_0x2b3256,_0x474e1e){return new Promise(function(_0x42b6f1,_0x493918){if(!_0x474e1e)return _0x42b6f1(null);var _0x128424=_0x474e1e[_0x621b('0x5')]?{[_0x474e1e['filter'][_0x621b('0x6')]]:_0x474e1e['filter']['value']}:undefined;return _0x202e87[_0x2b3256][_0x621b('0x7')]({'where':_0x128424,'raw':!![]})[_0x621b('0x8')](function(_0x52e8d7){_0x474e1e[_0x621b('0x9')]=_[_0x621b('0xa')](_0x52e8d7,'id');_0x42b6f1(_0x474e1e);})[_0x621b('0xb')](function(_0x1a066a){_0x493918(_0x1a066a);});});}function _0x23181a(_0x2f7f68,_0x318a12){return new Promise(function(_0x50cfef,_0x2dd998){var _0x2e9042=_0x2f7f68[_0x621b('0x5')]?{[_0x2f7f68[_0x621b('0x5')][_0x621b('0x6')]]:_0x2f7f68[_0x621b('0x5')][_0x621b('0xc')]}:undefined;return _0x202e87[_0x2f7f68['model']]['findAll']({'where':_0x2e9042,'raw':!![]})['then'](function(_0x1a83c5){_0x318a12[_0x621b('0x9')]=_[_0x621b('0xa')](_0x1a83c5,function(_0x2980ed){return _0x2980ed['name'];});_0x50cfef(_0x318a12);})['catch'](function(_0x55f61c){_0x2dd998(_0x55f61c);});});}function _0x2e3147(_0x492b66,_0x4fc747,_0x1cebe8){if(!_0x4fc747)return Promise[_0x621b('0xd')](null);return new Promise(function(_0x5a228f,_0x635d3a){return _0x202e87[_0x621b('0xe')][_0x621b('0x7')]({'where':{'sectionId':_0x4fc747['id']},'raw':!![]})['then'](function(_0x1f6df7){if(_0x492b66[_0x621b('0x6')]&&_0x492b66[_0x621b('0x6')]!=='id'){_0x4fc747[_0x621b('0x9')]=_['map'](_0x1f6df7,function(_0x4ba275){return _0x4ba275[_0x492b66[_0x621b('0x6')]];});}else{if(_0x1cebe8==='AnalyticExtractedReport'){_0x4fc747[_0x621b('0x9')]=_[_0x621b('0xa')](_0x1f6df7,function(_0xf3819a){return{'id':_0xf3819a['resourceId'],'type':_0xf3819a['type']};});}else{_0x4fc747[_0x621b('0x9')]=_['map'](_0x1f6df7,function(_0x275f74){return _0x275f74['resourceId'];});}}_0x5a228f(_0x4fc747);})[_0x621b('0xb')](function(_0x5b704f){_0x635d3a(_0x5b704f);});});}function _0x493db9(_0x5dab7c,_0x30a1aa){var _0x114b2e={'parentSections':[]};switch(_0x5dab7c[_0x621b('0xf')]()){case _0x621b('0x10'):_0x114b2e[_0x621b('0x11')]='SquareProject';break;case _0x621b('0x12'):_0x114b2e[_0x621b('0x11')]='SquareOdbc';break;case _0x621b('0x13'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x14');_0x114b2e['parentSections']=[{'name':'SquareProjects','field':_0x621b('0x15'),'foreignKey':_0x621b('0x16')}];break;case _0x621b('0x17'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x18');break;case'contacts':_0x114b2e[_0x621b('0x11')]=_0x621b('0x19');_0x114b2e[_0x621b('0x1a')]=[{'name':_0x621b('0x1b'),'field':'id','foreignKey':_0x621b('0x1c')}];break;case _0x621b('0x1d'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x1e');break;case _0x621b('0x1f'):_0x114b2e['childModel']=_0x621b('0x20');break;case _0x621b('0x21'):_0x114b2e[_0x621b('0x11')]='CmCustomField';break;case _0x621b('0x22'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x23');break;case _0x621b('0x24'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x25');break;case _0x621b('0x26'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x27');break;case _0x621b('0x28'):_0x114b2e['childModel']=_0x621b('0x29');break;case _0x621b('0x2a'):case'internalroutes':case'outboundroutes':_0x114b2e['childModel']=_0x621b('0x2b');break;case _0x621b('0x2c'):_0x114b2e['childModel']=_0x621b('0x2d');break;case _0x621b('0x2e'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x2f');break;case _0x621b('0x30'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x31');_0x114b2e[_0x621b('0x1a')]=[{'name':'Agents','field':'name','foreignKey':_0x621b('0x32'),'model':_0x621b('0x33'),'filter':{'field':_0x621b('0x34'),'value':[_0x621b('0x35')]}},{'name':_0x621b('0x36'),'field':_0x621b('0x15'),'foreignKey':_0x621b('0x32'),'model':_0x621b('0x33'),'filter':{'field':'role','value':[_0x621b('0x37')]}},{'name':_0x621b('0x38'),'field':'name','foreignKey':_0x621b('0x39'),'model':_0x621b('0x3a'),'filter':{'field':'type','value':[_0x621b('0x3b')]}},{'name':_0x621b('0x3c'),'field':_0x621b('0x15'),'foreignKey':'queue','model':_0x621b('0x3a'),'filter':{'field':_0x621b('0x3d'),'value':[_0x621b('0x3e')]}}];break;case'musiconholds':_0x114b2e[_0x621b('0x11')]=_0x621b('0x3f');break;case _0x621b('0x40'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x41');break;case _0x621b('0x42'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x43');break;case _0x621b('0x44'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x45');break;case'mailqueues':_0x114b2e[_0x621b('0x11')]=_0x621b('0x46');break;case _0x621b('0x47'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x48');break;case _0x621b('0x49'):_0x114b2e[_0x621b('0x11')]='MailSubstatus';break;case _0x621b('0x4a'):_0x114b2e[_0x621b('0x11')]='OpenchannelQueue';break;case _0x621b('0x4b'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x4c');break;case _0x621b('0x4d'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x4e');break;case _0x621b('0x4f'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x50');break;case _0x621b('0x51'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x52');break;case _0x621b('0x53'):_0x114b2e['childModel']=_0x621b('0x54');break;case _0x621b('0x55'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x56');break;case _0x621b('0x57'):case'queuecampaigns':_0x114b2e['childModel']=_0x621b('0x3a');if(_0x30a1aa){_0x114b2e[_0x621b('0x1a')]=[{'name':_0x621b('0x38')},{'name':_0x621b('0x3c')}];}break;case _0x621b('0x58'):case _0x621b('0x59'):case _0x621b('0x5a'):_0x114b2e[_0x621b('0x11')]='User';if(_0x30a1aa){_0x114b2e['parentSections']=[{'name':_0x621b('0x5b'),'filter':{'field':'role','value':[_0x621b('0x5c'),'user']},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x621b('0x5d'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x5e');break;case _0x621b('0x5f'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x60');break;case _0x621b('0x61'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x62');break;case _0x621b('0x63'):_0x114b2e['childModel']='SugarcrmAccount';break;case _0x621b('0x64'):_0x114b2e['childModel']='DeskAccount';break;case'zohoaccounts':_0x114b2e[_0x621b('0x11')]=_0x621b('0x65');break;case _0x621b('0x66'):_0x114b2e['childModel']=_0x621b('0x33');break;case _0x621b('0x67'):_0x114b2e[_0x621b('0x11')]='CannedAnswer';break;case _0x621b('0x68'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x69');break;case'customdashboards':_0x114b2e[_0x621b('0x11')]=_0x621b('0x6a');break;case _0x621b('0x6b'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x6c');break;case'pauses':_0x114b2e[_0x621b('0x11')]=_0x621b('0x6d');break;case _0x621b('0x6e'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x6f');break;case _0x621b('0x70'):_0x114b2e['childModel']='Sound';break;case'tags':_0x114b2e['childModel']=_0x621b('0x71');break;case _0x621b('0x72'):_0x114b2e['childModel']=_0x621b('0x73');break;case _0x621b('0x74'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x75');break;case _0x621b('0x76'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x77');break;case'variables':_0x114b2e[_0x621b('0x11')]=_0x621b('0x78');break;case _0x621b('0x79'):_0x114b2e[_0x621b('0x11')]=_0x621b('0x7a');break;case _0x621b('0x7b'):_0x114b2e['childModel']=_0x621b('0x7c');_0x114b2e[_0x621b('0x1a')]=[{'name':_0x621b('0x7d'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x114b2e[_0x621b('0x11')]=_0x621b('0x7e');break;}return _0x114b2e;}function _0x285b69(_0x39905d,_0x4a1424){var _0x22c1a3=_0x39905d[_0x621b('0x7f')](0x0)[_0x621b('0x80')]()+_0x39905d[_0x621b('0x81')](0x1);var _0xcbf2e1={'type':_0x202e87[_0x621b('0x82')][_0x621b('0x83')][_0x621b('0x84')],'raw':!![]};return new Promise(function(_0x24d828,_0x3203e8){var _0x5e2661=squel[_0x621b('0x85')]()[_0x621b('0x6')](_0x621b('0x86')+_0x22c1a3+_0x621b('0x87'),'id')[_0x621b('0x6')](_0x621b('0x88'))['from'](_0x621b('0x89')+_0x39905d+_0x621b('0x8a'),'ui')[_0x621b('0x8b')](_0x621b('0x8c'),_0x4a1424['id']);return _0x202e87[_0x621b('0x8d')][_0x621b('0x8e')](_0x5e2661[_0x621b('0x8f')](),_0xcbf2e1)[_0x621b('0x8')](function(_0x361570){_0x4a1424[_0x22c1a3+'OpenTabs']=_0x361570;_0x24d828(_0x361570);})['catch'](function(_0x3e03f2){_0x3203e8(_0x3e03f2);});});}return _0x4b82f9['define'](_0x621b('0x90'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3fa368){var _0x46b0ab={'raw':_0x3fa368[_0x621b('0x8e')]['raw'],'where':{}};var _0x12565d={};var _0xbc5ef5={'count':0x0,'rows':[]};var _0x177dcc=_0x3fa368[_0x621b('0x8e')][_0x621b('0x91')];var _0x2fba47=_0x3fa368['query'][_0x621b('0x92')]||![];var _0x454402=_0x493db9(_0x177dcc,_0x2fba47);if(!_0x454402[_0x621b('0x11')])throw new Error(_0x621b('0x93')+_0x177dcc+'\x27');var _0x336fdc=[{'name':_0x177dcc}];if(!_[_0x621b('0x94')](_0x454402[_0x621b('0x1a')]))_0x336fdc=_0x454402[_0x621b('0x1a')];var _0xe3bfec=[];for(var _0x5675cc=0x0;_0x5675cc<_0x336fdc['length'];_0x5675cc++){_0xe3bfec[_0x621b('0x95')](_0x202e87['UserProfileSection'][_0x621b('0x96')]({'where':{'userProfileId':_0x3fa368[_0x621b('0x97')]['id'],'name':_0x336fdc[_0x5675cc][_0x621b('0x15')]},'raw':!![]}));}return Promise[_0x621b('0x98')](_0xe3bfec)[_0x621b('0x8')](function(_0x2993c1){var _0x5433c9=_[_0x621b('0x5')](_0x2993c1,function(_0x21b4f2){return _0x21b4f2?_0x21b4f2:undefined;});var _0x9614ee=_['filter'](_0x336fdc,[_0x621b('0x99'),!![]]);var _0x4688a6=_['isEmpty'](_0x5433c9)&&_[_0x621b('0x94')](_0x9614ee)?null:_[_0x621b('0x9a')](_0x9614ee,_0x5433c9);if(!_0x4688a6)return null;var _0x59e64b=[];for(var _0x507794=0x0;_0x507794<_0x4688a6['length'];_0x507794++){var _0x2ecb0e=_[_0x621b('0x96')](_0x336fdc,function(_0x220d59){return _0x4688a6[_0x507794]?_0x220d59[_0x621b('0x15')]===_0x4688a6[_0x507794][_0x621b('0x15')]:null;});if(_0x2ecb0e){if(_0x4688a6[_0x507794][_0x621b('0x99')]){_0x59e64b[_0x621b('0x95')](_0x1f9d64(_0x454402[_0x621b('0x11')],_0x4688a6[_0x507794]));}else{if(!_0x4688a6[_0x507794][_0x621b('0x9b')]){_0x59e64b[_0x621b('0x95')](_0x2e3147(_0x2ecb0e,_0x4688a6[_0x507794],_0x454402[_0x621b('0x11')]));}else{if(_0x2ecb0e[_0x621b('0x9c')]){_0x59e64b['push'](_0x23181a(_0x2ecb0e,_0x4688a6[_0x507794]));}}}}}return Promise[_0x621b('0x98')](_0x59e64b);})['then'](function(_0x4abfd6){var _0x203d0b=_0x4abfd6;var _0x28f962=null;if(_0x203d0b){_0x28f962=_0x203d0b['length']===0x1?_0x203d0b[0x0]:null;}if(!_0x28f962&&!_0x203d0b)return _0xbc5ef5;var _0x573a70=_0x202e87[_0x454402[_0x621b('0x11')]][_0x621b('0x9d')];_0x12565d[_0x621b('0x9c')]=_[_0x621b('0x9e')](_0x573a70);_0x12565d['query']=_[_0x621b('0x9e')](_0x3fa368[_0x621b('0x8e')]);_0x12565d['filters']=_['intersection'](_0x12565d['model'],_0x12565d[_0x621b('0x8e')]);_0x46b0ab[_0x621b('0x9f')]=_[_0x621b('0xa0')](_0x12565d[_0x621b('0x9c')],qs[_0x621b('0xa1')](_0x3fa368[_0x621b('0x8e')][_0x621b('0xa1')]));_0x46b0ab[_0x621b('0x9f')]=_0x46b0ab[_0x621b('0x9f')][_0x621b('0xa2')]?_0x46b0ab['attributes']:_0x12565d['model'];if(!_0x3fa368[_0x621b('0x8e')][_0x621b('0xa3')](_0x621b('0xa4'))){_0x46b0ab[_0x621b('0xa5')]=qs[_0x621b('0xa5')](_0x3fa368[_0x621b('0x8e')][_0x621b('0xa5')]);_0x46b0ab['offset']=qs[_0x621b('0xa6')](_0x3fa368[_0x621b('0x8e')][_0x621b('0xa6')]);}_0x46b0ab[_0x621b('0xa7')]=qs[_0x621b('0xa8')](_0x3fa368[_0x621b('0x8e')][_0x621b('0xa8')]);_0x46b0ab[_0x621b('0x8b')]=qs[_0x621b('0xa9')](_['pick'](_0x3fa368['query'],_0x12565d[_0x621b('0xa9')]));if(_0x3fa368[_0x621b('0x8e')]['filter']){_0x46b0ab['where']=_['merge'](_0x46b0ab[_0x621b('0x8b')],{'$or':_[_0x621b('0xa')](_0x573a70,function(_0x52ce10){if(_0x52ce10[_0x621b('0x3d')]['key']!==_0x621b('0xaa')){var _0x43984f={};_0x43984f[_0x52ce10[_0x621b('0x6')]]={'$like':'%'+_0x3fa368[_0x621b('0x8e')][_0x621b('0x5')]+'%'};return _0x43984f;}})});}var _0x16ef18=[];var _0x31ff9e=null;var _0x4a3e1f={};if(_0x28f962){_0x31ff9e=_[_0x621b('0x96')](_0x336fdc,[_0x621b('0x15'),_0x28f962[_0x621b('0x15')]]);if(_0x31ff9e['field']){_0x4a3e1f={};if(_0x454402['childModel']==='AnalyticExtractedReport'){_0x4a3e1f[_0x31ff9e[_0x621b('0xab')]]=_[_0x621b('0xa')](_0x28f962[_0x621b('0x9')],'id');}else{_0x4a3e1f[_0x31ff9e['foreignKey']]=_0x28f962['associatedResources'];}_0x16ef18[_0x621b('0x95')](_0x4a3e1f);}else{_0x46b0ab[_0x621b('0x8b')]['id']=_0x28f962[_0x621b('0x9')];}}else{for(var _0x4d798d=0x0;_0x4d798d<_0x203d0b[_0x621b('0xa2')];_0x4d798d++){_0x31ff9e=_[_0x621b('0x96')](_0x336fdc,['name',_0x203d0b[_0x4d798d][_0x621b('0x15')]]);if(_0x31ff9e['field']){_0x4a3e1f={};_0x4a3e1f[_0x31ff9e[_0x621b('0xab')]]=_0x203d0b[_0x4d798d][_0x621b('0x9')];_0x16ef18[_0x621b('0x95')](_0x4a3e1f);}else{if(!_0x46b0ab['where']['id'])_0x46b0ab[_0x621b('0x8b')]['id']=[];_0x203d0b[_0x4d798d][_0x621b('0x9')][_0x621b('0xac')](function(_0x5e434f){_0x46b0ab[_0x621b('0x8b')]['id'][_0x621b('0x95')](_0x5e434f);});}}}if(!_[_0x621b('0x94')](_0x16ef18)){_0x46b0ab[_0x621b('0x8b')]=_[_0x621b('0xad')](_0x46b0ab[_0x621b('0x8b')],{'$and':{'$or':_0x16ef18}});}_0x46b0ab=_['merge']({},_0x46b0ab,_0x3fa368['options']);if(_0x28f962&&!_0x28f962[_0x621b('0x9b')]&&_0x454402[_0x621b('0x11')]===_0x621b('0x7c')){if(_0x3fa368[_0x621b('0x8e')]['includeAll']){_0x46b0ab['include']=[{'all':!![]}];}return _0x202e87[_0x454402['childModel']][_0x621b('0x7')](_0x46b0ab)[_0x621b('0x8')](function(_0x3362af){var _0x42e688=[];_0x3362af['forEach'](function(_0x389c33){var _0x11b9f0;switch(_0x389c33[_0x621b('0xae')]){case _0x621b('0xaf'):_0x11b9f0=_[_0x621b('0x96')](_0x28f962[_0x621b('0x9')],function(_0x464989){return _0x464989['id']===_0x389c33[_0x621b('0xb0')]&&_0x464989[_0x621b('0x3d')]===_0x621b('0xb1');});break;case'custom':_0x11b9f0=_[_0x621b('0x96')](_0x28f962[_0x621b('0x9')],function(_0x87c130){return _0x87c130['id']===_0x389c33[_0x621b('0xb0')]&&_0x87c130['type']==='CustomReports';});break;}if(_0x11b9f0)_0x42e688[_0x621b('0x95')](_0x389c33);});_0xbc5ef5[_0x621b('0xb2')]=_0x42e688[_0x621b('0xa2')];_0xbc5ef5[_0x621b('0xb3')]=_0x42e688;return _0xbc5ef5;});}else{return _0x202e87[_0x454402['childModel']][_0x621b('0xb2')]({'where':_0x46b0ab[_0x621b('0x8b')]})[_0x621b('0x8')](function(_0x2ad7b8){_0xbc5ef5[_0x621b('0xb2')]=_0x2ad7b8;if(_0x3fa368[_0x621b('0x8e')]['includeAll']){if(_0x454402[_0x621b('0x11')]===_0x621b('0x19')){_0x46b0ab[_0x621b('0xb4')]=[{'model':_0x202e87[_0x621b('0x71')],'as':'Tags','attributes':['id',_0x621b('0x15'),_0x621b('0xb5')],'required':_0x3fa368[_0x621b('0x8e')][_0x621b('0xb6')]?!![]:![]},{'model':_0x202e87[_0x621b('0x71')],'as':_0x621b('0xb7'),'attributes':['id',_0x621b('0x15'),_0x621b('0xb5')],'through':_0x3fa368[_0x621b('0x8e')][_0x621b('0xb6')]?{'attributes':[],'where':{'TagId':_0x3fa368[_0x621b('0x8e')][_0x621b('0xb6')]||undefined}}:{},'required':_0x3fa368[_0x621b('0x8e')][_0x621b('0xb6')]?!![]:![]}];}else{_0x46b0ab[_0x621b('0xb4')]=[{'all':!![]}];}}return _0x202e87[_0x454402[_0x621b('0x11')]][_0x621b('0x7')](_0x46b0ab);})[_0x621b('0x8')](function(_0xdea900){_0xbc5ef5['rows']=_0xdea900;if(_0x177dcc===_0x621b('0xb8')&&_0x3fa368[_0x621b('0x8e')]['openTabs']===_0x621b('0xb9')){var _0x363f7f=[];for(var _0x10787b=0x0;_0x10787b<_0xbc5ef5['rows'][_0x621b('0xa2')];_0x10787b++){_0x363f7f['push'](_0x285b69(_0x621b('0xba'),_0xbc5ef5[_0x621b('0xb3')][_0x10787b]['dataValues']));_0x363f7f[_0x621b('0x95')](_0x285b69(_0x621b('0xbb'),_0xbc5ef5['rows'][_0x10787b][_0x621b('0xbc')]));_0x363f7f['push'](_0x285b69(_0x621b('0xbd'),_0xbc5ef5[_0x621b('0xb3')][_0x10787b][_0x621b('0xbc')]));_0x363f7f[_0x621b('0x95')](_0x285b69(_0x621b('0xbe'),_0xbc5ef5[_0x621b('0xb3')][_0x10787b][_0x621b('0xbc')]));_0x363f7f[_0x621b('0x95')](_0x285b69(_0x621b('0xbf'),_0xbc5ef5[_0x621b('0xb3')][_0x10787b][_0x621b('0xbc')]));_0x363f7f[_0x621b('0x95')](_0x285b69(_0x621b('0xc0'),_0xbc5ef5[_0x621b('0xb3')][_0x10787b]['dataValues']));}return Promise[_0x621b('0x98')](_0x363f7f)[_0x621b('0x8')](function(){return _0xbc5ef5;});}return _0xbc5ef5;});}});}}});};
\ No newline at end of file
+var _0xdf44=['find','params','all','ignore','union','autoAssociation','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','include','DefaultReports','custom','count','rows','includeAll','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','fax','mail','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','then','associatedResources','catch','value','model','findAll','map','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','FaxQueue','inboundroutes','internalroutes','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','User','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','dispositions','Disposition','customdashboards','intervals','pauses','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','variables','Variable','plugins','Plugin','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push'];(function(_0x230850,_0x59c958){var _0x5282c1=function(_0x2d0bb1){while(--_0x2d0bb1){_0x230850['push'](_0x230850['shift']());}};_0x5282c1(++_0x59c958);}(_0xdf44,0x1a3));var _0x4df4=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xdf44[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var attributes=require(_0x4df4('0x0'));var qs=require(_0x4df4('0x1'));var squel=require(_0x4df4('0x2'));module[_0x4df4('0x3')]=function(_0x305f4a){var _0x420495=_0x305f4a[_0x4df4('0x4')];function _0x9272de(_0x53d8f9,_0x5517ea){return new Promise(function(_0x467d21,_0x237509){if(!_0x5517ea)return _0x467d21(null);var _0xb9b213=_0x5517ea[_0x4df4('0x5')]?{[_0x5517ea['filter'][_0x4df4('0x6')]]:_0x5517ea[_0x4df4('0x5')]['value']}:undefined;return _0x420495[_0x53d8f9]['findAll']({'where':_0xb9b213,'raw':!![]})[_0x4df4('0x7')](function(_0x268db4){_0x5517ea[_0x4df4('0x8')]=_['map'](_0x268db4,'id');_0x467d21(_0x5517ea);})[_0x4df4('0x9')](function(_0x12b883){_0x237509(_0x12b883);});});}function _0x5807af(_0x2efb2b,_0x3a719e){return new Promise(function(_0x4cb5a6,_0x37e055){var _0x3dfc36=_0x2efb2b['filter']?{[_0x2efb2b[_0x4df4('0x5')][_0x4df4('0x6')]]:_0x2efb2b[_0x4df4('0x5')][_0x4df4('0xa')]}:undefined;return _0x420495[_0x2efb2b[_0x4df4('0xb')]][_0x4df4('0xc')]({'where':_0x3dfc36,'raw':!![]})[_0x4df4('0x7')](function(_0xd4ce85){_0x3a719e[_0x4df4('0x8')]=_[_0x4df4('0xd')](_0xd4ce85,function(_0x5c09d0){return _0x5c09d0[_0x4df4('0xe')];});_0x4cb5a6(_0x3a719e);})[_0x4df4('0x9')](function(_0x535f61){_0x37e055(_0x535f61);});});}function _0x2e5726(_0x24c990,_0x535c0b,_0x35e44b){if(!_0x535c0b)return Promise[_0x4df4('0xf')](null);return new Promise(function(_0x13cde6,_0x48b84f){return _0x420495[_0x4df4('0x10')][_0x4df4('0xc')]({'where':{'sectionId':_0x535c0b['id']},'raw':!![]})[_0x4df4('0x7')](function(_0x402931){if(_0x24c990[_0x4df4('0x6')]&&_0x24c990['field']!=='id'){_0x535c0b[_0x4df4('0x8')]=_[_0x4df4('0xd')](_0x402931,function(_0x3b1ac3){return _0x3b1ac3[_0x24c990[_0x4df4('0x6')]];});}else{if(_0x35e44b===_0x4df4('0x11')){_0x535c0b[_0x4df4('0x8')]=_['map'](_0x402931,function(_0x118e90){return{'id':_0x118e90[_0x4df4('0x12')],'type':_0x118e90[_0x4df4('0x13')]};});}else{_0x535c0b['associatedResources']=_[_0x4df4('0xd')](_0x402931,function(_0x151371){return _0x151371['resourceId'];});}}_0x13cde6(_0x535c0b);})[_0x4df4('0x9')](function(_0x301049){_0x48b84f(_0x301049);});});}function _0x4d9418(_0x2cab93,_0x2ec79){var _0x1a5dbf={'parentSections':[]};switch(_0x2cab93[_0x4df4('0x14')]()){case _0x4df4('0x15'):_0x1a5dbf['childModel']=_0x4df4('0x16');break;case _0x4df4('0x17'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x19');break;case'squarerecordings':_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x1a');_0x1a5dbf[_0x4df4('0x1b')]=[{'name':_0x4df4('0x1c'),'field':_0x4df4('0xe'),'foreignKey':_0x4df4('0x1d')}];break;case'projects':_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x1e');break;case'contacts':_0x1a5dbf['childModel']=_0x4df4('0x1f');_0x1a5dbf[_0x4df4('0x1b')]=[{'name':_0x4df4('0x20'),'field':'id','foreignKey':_0x4df4('0x21')}];break;case _0x4df4('0x22'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x23');break;case _0x4df4('0x24'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x25');break;case _0x4df4('0x26'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x27');break;case'chatqueues':_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x28');break;case _0x4df4('0x29'):_0x1a5dbf[_0x4df4('0x18')]='ChatWebsite';break;case'faxqueues':_0x1a5dbf['childModel']=_0x4df4('0x2a');break;case'faxaccounts':_0x1a5dbf[_0x4df4('0x18')]='FaxAccount';break;case _0x4df4('0x2b'):case _0x4df4('0x2c'):case'outboundroutes':_0x1a5dbf['childModel']='VoiceExtension';break;case'contexts':_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x2d');break;case'voicemails':_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x2e');break;case _0x4df4('0x2f'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x30');_0x1a5dbf[_0x4df4('0x1b')]=[{'name':_0x4df4('0x31'),'field':_0x4df4('0xe'),'foreignKey':_0x4df4('0x32'),'model':'User','filter':{'field':_0x4df4('0x33'),'value':[_0x4df4('0x34')]}},{'name':_0x4df4('0x35'),'field':_0x4df4('0xe'),'foreignKey':_0x4df4('0x32'),'model':'User','filter':{'field':_0x4df4('0x33'),'value':[_0x4df4('0x36')]}},{'name':_0x4df4('0x37'),'field':'name','foreignKey':_0x4df4('0x38'),'model':_0x4df4('0x39'),'filter':{'field':_0x4df4('0x13'),'value':[_0x4df4('0x3a')]}},{'name':_0x4df4('0x3b'),'field':_0x4df4('0xe'),'foreignKey':_0x4df4('0x38'),'model':_0x4df4('0x39'),'filter':{'field':_0x4df4('0x13'),'value':['outbound']}}];break;case _0x4df4('0x3c'):_0x1a5dbf['childModel']='VoiceMusicOnHold';break;case _0x4df4('0x3d'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x3e');break;case _0x4df4('0x3f'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x40');break;case _0x4df4('0x41'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x42');break;case _0x4df4('0x43'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x44');break;case _0x4df4('0x45'):_0x1a5dbf[_0x4df4('0x18')]='MailAccount';break;case _0x4df4('0x46'):_0x1a5dbf['childModel']=_0x4df4('0x47');break;case'openchannelqueues':_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x48');break;case _0x4df4('0x49'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x4a');break;case _0x4df4('0x4b'):_0x1a5dbf['childModel']=_0x4df4('0x4c');break;case'smsaccounts':_0x1a5dbf[_0x4df4('0x18')]='SmsAccount';break;case _0x4df4('0x4d'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x4e');break;case'whatsappaccounts':_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x4f');break;case _0x4df4('0x50'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x51');break;case _0x4df4('0x52'):case _0x4df4('0x53'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x39');if(_0x2ec79){_0x1a5dbf['parentSections']=[{'name':_0x4df4('0x37')},{'name':_0x4df4('0x3b')}];}break;case _0x4df4('0x54'):case'agents':case'telephones':_0x1a5dbf['childModel']=_0x4df4('0x55');if(_0x2ec79){_0x1a5dbf['parentSections']=[{'name':_0x4df4('0x56'),'filter':{'field':_0x4df4('0x33'),'value':[_0x4df4('0x57'),_0x4df4('0x58')]},'ignore':!![]},{'name':_0x4df4('0x31')},{'name':_0x4df4('0x35')}];}break;case _0x4df4('0x59'):_0x1a5dbf['childModel']=_0x4df4('0x5a');break;case _0x4df4('0x5b'):_0x1a5dbf[_0x4df4('0x18')]='SalesforceAccount';break;case _0x4df4('0x5c'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x5d');break;case _0x4df4('0x5e'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x5f');break;case _0x4df4('0x60'):_0x1a5dbf['childModel']='DeskAccount';break;case _0x4df4('0x61'):_0x1a5dbf['childModel']=_0x4df4('0x62');break;case _0x4df4('0x63'):_0x1a5dbf[_0x4df4('0x18')]='User';break;case'cannedanswers':_0x1a5dbf['childModel']='CannedAnswer';break;case _0x4df4('0x64'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x65');break;case _0x4df4('0x66'):_0x1a5dbf[_0x4df4('0x18')]='Dashboard';break;case _0x4df4('0x67'):_0x1a5dbf[_0x4df4('0x18')]='Interval';break;case _0x4df4('0x68'):_0x1a5dbf['childModel']=_0x4df4('0x69');break;case _0x4df4('0x6a'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x6b');break;case'sounds':_0x1a5dbf['childModel']=_0x4df4('0x6c');break;case _0x4df4('0x6d'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x6e');break;case _0x4df4('0x6f'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x70');break;case _0x4df4('0x71'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x72');break;case'trunks':_0x1a5dbf[_0x4df4('0x18')]='Trunk';break;case _0x4df4('0x73'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x74');break;case _0x4df4('0x75'):_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x76');break;case'extractedreports':_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x11');_0x1a5dbf[_0x4df4('0x1b')]=[{'name':_0x4df4('0x77'),'field':'id','foreignKey':_0x4df4('0x78')}];break;case'metrics':_0x1a5dbf[_0x4df4('0x18')]=_0x4df4('0x79');break;}return _0x1a5dbf;}function _0x1f90a6(_0x39f145,_0x4738a1){var _0x3297e1=_0x39f145[_0x4df4('0x7a')](0x0)[_0x4df4('0x7b')]()+_0x39f145[_0x4df4('0x7c')](0x1);var _0x167504={'type':_0x420495[_0x4df4('0x7d')][_0x4df4('0x7e')][_0x4df4('0x7f')],'raw':!![]};return new Promise(function(_0x1f7b6c,_0x55a236){var _0x1068ac=squel[_0x4df4('0x80')]()['field'](_0x4df4('0x81')+_0x3297e1+'InteractionId','id')[_0x4df4('0x6')](_0x4df4('0x82'))[_0x4df4('0x83')](_0x4df4('0x84')+_0x39f145+_0x4df4('0x85'),'ui')[_0x4df4('0x86')](_0x4df4('0x87'),_0x4738a1['id']);return _0x420495['sequelize'][_0x4df4('0x88')](_0x1068ac[_0x4df4('0x89')](),_0x167504)[_0x4df4('0x7')](function(_0x4965fc){_0x4738a1[_0x3297e1+'OpenTabs']=_0x4965fc;_0x1f7b6c(_0x4965fc);})[_0x4df4('0x9')](function(_0x292cb0){_0x55a236(_0x292cb0);});});}return _0x305f4a[_0x4df4('0x8a')](_0x4df4('0x8b'),attributes,{'tableName':_0x4df4('0x8c'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x152cfa){var _0x4cd904={'raw':_0x152cfa[_0x4df4('0x88')][_0x4df4('0x8d')],'where':{}};var _0x43d234={};var _0x1954fc={'count':0x0,'rows':[]};var _0x7eac39=_0x152cfa[_0x4df4('0x88')][_0x4df4('0x8e')];var _0x35ac45=_0x152cfa[_0x4df4('0x88')][_0x4df4('0x8f')]||![];var _0x51da2b=_0x4d9418(_0x7eac39,_0x35ac45);if(!_0x51da2b[_0x4df4('0x18')])throw new Error(_0x4df4('0x90')+_0x7eac39+'\x27');var _0x2b87bd=[{'name':_0x7eac39}];if(!_[_0x4df4('0x91')](_0x51da2b[_0x4df4('0x1b')]))_0x2b87bd=_0x51da2b[_0x4df4('0x1b')];var _0xfc7dfe=[];for(var _0xc9ebf0=0x0;_0xc9ebf0<_0x2b87bd[_0x4df4('0x92')];_0xc9ebf0++){_0xfc7dfe[_0x4df4('0x93')](_0x420495['UserProfileSection'][_0x4df4('0x94')]({'where':{'userProfileId':_0x152cfa[_0x4df4('0x95')]['id'],'name':_0x2b87bd[_0xc9ebf0][_0x4df4('0xe')]},'raw':!![]}));}return Promise[_0x4df4('0x96')](_0xfc7dfe)[_0x4df4('0x7')](function(_0x6c3a02){var _0x20a5da=_[_0x4df4('0x5')](_0x6c3a02,function(_0x42f22d){return _0x42f22d?_0x42f22d:undefined;});var _0x1ecbeb=_[_0x4df4('0x5')](_0x2b87bd,[_0x4df4('0x97'),!![]]);var _0x1aa5e5=_['isEmpty'](_0x20a5da)&&_['isEmpty'](_0x1ecbeb)?null:_[_0x4df4('0x98')](_0x1ecbeb,_0x20a5da);if(!_0x1aa5e5)return null;var _0x1f2f7e=[];for(var _0x234bf6=0x0;_0x234bf6<_0x1aa5e5[_0x4df4('0x92')];_0x234bf6++){var _0x31469b=_[_0x4df4('0x94')](_0x2b87bd,function(_0x5bbded){return _0x1aa5e5[_0x234bf6]?_0x5bbded['name']===_0x1aa5e5[_0x234bf6][_0x4df4('0xe')]:null;});if(_0x31469b){if(_0x1aa5e5[_0x234bf6][_0x4df4('0x97')]){_0x1f2f7e[_0x4df4('0x93')](_0x9272de(_0x51da2b[_0x4df4('0x18')],_0x1aa5e5[_0x234bf6]));}else{if(!_0x1aa5e5[_0x234bf6][_0x4df4('0x99')]){_0x1f2f7e['push'](_0x2e5726(_0x31469b,_0x1aa5e5[_0x234bf6],_0x51da2b[_0x4df4('0x18')]));}else{if(_0x31469b[_0x4df4('0xb')]){_0x1f2f7e[_0x4df4('0x93')](_0x5807af(_0x31469b,_0x1aa5e5[_0x234bf6]));}}}}}return Promise[_0x4df4('0x96')](_0x1f2f7e);})[_0x4df4('0x7')](function(_0xf4c100){var _0x2f610b=_0xf4c100;var _0x3cd412=null;if(_0x2f610b){_0x3cd412=_0x2f610b[_0x4df4('0x92')]===0x1?_0x2f610b[0x0]:null;}if(!_0x3cd412&&!_0x2f610b)return _0x1954fc;var _0x51787b=_0x420495[_0x51da2b[_0x4df4('0x18')]]['rawAttributes'];_0x43d234[_0x4df4('0xb')]=_[_0x4df4('0x9a')](_0x51787b);_0x43d234[_0x4df4('0x88')]=_[_0x4df4('0x9a')](_0x152cfa[_0x4df4('0x88')]);_0x43d234[_0x4df4('0x9b')]=_[_0x4df4('0x9c')](_0x43d234['model'],_0x43d234[_0x4df4('0x88')]);_0x4cd904['attributes']=_[_0x4df4('0x9c')](_0x43d234['model'],qs['fields'](_0x152cfa[_0x4df4('0x88')][_0x4df4('0x9d')]));_0x4cd904[_0x4df4('0x9e')]=_0x4cd904[_0x4df4('0x9e')]['length']?_0x4cd904[_0x4df4('0x9e')]:_0x43d234['model'];if(!_0x152cfa[_0x4df4('0x88')][_0x4df4('0x9f')](_0x4df4('0xa0'))){_0x4cd904[_0x4df4('0xa1')]=qs[_0x4df4('0xa1')](_0x152cfa[_0x4df4('0x88')][_0x4df4('0xa1')]);_0x4cd904['offset']=qs[_0x4df4('0xa2')](_0x152cfa[_0x4df4('0x88')][_0x4df4('0xa2')]);}_0x4cd904[_0x4df4('0xa3')]=qs[_0x4df4('0xa4')](_0x152cfa[_0x4df4('0x88')][_0x4df4('0xa4')]);_0x4cd904[_0x4df4('0x86')]=qs[_0x4df4('0x9b')](_[_0x4df4('0xa5')](_0x152cfa[_0x4df4('0x88')],_0x43d234[_0x4df4('0x9b')]));if(_0x152cfa[_0x4df4('0x88')][_0x4df4('0x5')]){_0x4cd904[_0x4df4('0x86')]=_[_0x4df4('0xa6')](_0x4cd904['where'],{'$or':_[_0x4df4('0xd')](_0x51787b,function(_0x4b0cc7){if(_0x4b0cc7[_0x4df4('0x13')][_0x4df4('0xa7')]!==_0x4df4('0xa8')){var _0x146132={};_0x146132[_0x4b0cc7[_0x4df4('0x6')]]={'$like':'%'+_0x152cfa['query'][_0x4df4('0x5')]+'%'};return _0x146132;}})});}var _0x497a41=[];var _0x568ee8=null;var _0x1f6046={};if(_0x3cd412){_0x568ee8=_[_0x4df4('0x94')](_0x2b87bd,[_0x4df4('0xe'),_0x3cd412['name']]);if(_0x568ee8[_0x4df4('0x6')]){_0x1f6046={};if(_0x51da2b['childModel']==='AnalyticExtractedReport'){_0x1f6046[_0x568ee8[_0x4df4('0xa9')]]=_[_0x4df4('0xd')](_0x3cd412[_0x4df4('0x8')],'id');}else{_0x1f6046[_0x568ee8['foreignKey']]=_0x3cd412[_0x4df4('0x8')];}_0x497a41[_0x4df4('0x93')](_0x1f6046);}else{_0x4cd904[_0x4df4('0x86')]['id']=_0x3cd412[_0x4df4('0x8')];}}else{for(var _0x26baad=0x0;_0x26baad<_0x2f610b['length'];_0x26baad++){_0x568ee8=_['find'](_0x2b87bd,[_0x4df4('0xe'),_0x2f610b[_0x26baad]['name']]);if(_0x568ee8[_0x4df4('0x6')]){_0x1f6046={};_0x1f6046[_0x568ee8['foreignKey']]=_0x2f610b[_0x26baad][_0x4df4('0x8')];_0x497a41['push'](_0x1f6046);}else{if(!_0x4cd904[_0x4df4('0x86')]['id'])_0x4cd904[_0x4df4('0x86')]['id']=[];_0x2f610b[_0x26baad][_0x4df4('0x8')][_0x4df4('0xaa')](function(_0x2a5cba){_0x4cd904[_0x4df4('0x86')]['id'][_0x4df4('0x93')](_0x2a5cba);});}}}if(!_['isEmpty'](_0x497a41)){_0x4cd904[_0x4df4('0x86')]=_['merge'](_0x4cd904[_0x4df4('0x86')],{'$and':{'$or':_0x497a41}});}_0x4cd904=_[_0x4df4('0xa6')]({},_0x4cd904,_0x152cfa[_0x4df4('0xab')]);if(_0x3cd412&&!_0x3cd412[_0x4df4('0x99')]&&_0x51da2b[_0x4df4('0x18')]==='AnalyticExtractedReport'){if(_0x152cfa[_0x4df4('0x88')]['includeAll']){_0x4cd904[_0x4df4('0xac')]=[{'all':!![]}];}return _0x420495[_0x51da2b[_0x4df4('0x18')]][_0x4df4('0xc')](_0x4cd904)[_0x4df4('0x7')](function(_0x2728c6){var _0x66c065=[];_0x2728c6[_0x4df4('0xaa')](function(_0x4eab18){var _0x3c8f65;switch(_0x4eab18['reportType']){case'default':_0x3c8f65=_[_0x4df4('0x94')](_0x3cd412['associatedResources'],function(_0x44f1ba){return _0x44f1ba['id']===_0x4eab18[_0x4df4('0x78')]&&_0x44f1ba[_0x4df4('0x13')]===_0x4df4('0xad');});break;case _0x4df4('0xae'):_0x3c8f65=_['find'](_0x3cd412[_0x4df4('0x8')],function(_0x1e492b){return _0x1e492b['id']===_0x4eab18[_0x4df4('0x78')]&&_0x1e492b[_0x4df4('0x13')]==='CustomReports';});break;}if(_0x3c8f65)_0x66c065['push'](_0x4eab18);});_0x1954fc[_0x4df4('0xaf')]=_0x66c065['length'];_0x1954fc[_0x4df4('0xb0')]=_0x66c065;return _0x1954fc;});}else{return _0x420495[_0x51da2b[_0x4df4('0x18')]][_0x4df4('0xaf')]({'where':_0x4cd904[_0x4df4('0x86')]})[_0x4df4('0x7')](function(_0x4f43a8){_0x1954fc[_0x4df4('0xaf')]=_0x4f43a8;if(_0x152cfa['query'][_0x4df4('0xb1')]){if(_0x51da2b[_0x4df4('0x18')]===_0x4df4('0x1f')){_0x4cd904['include']=[{'model':_0x420495['Tag'],'as':_0x4df4('0xb2'),'attributes':['id',_0x4df4('0xe'),_0x4df4('0xb3')],'required':_0x152cfa[_0x4df4('0x88')][_0x4df4('0xb4')]?!![]:![]},{'model':_0x420495['Tag'],'as':_0x4df4('0xb5'),'attributes':['id',_0x4df4('0xe'),_0x4df4('0xb3')],'through':_0x152cfa['query'][_0x4df4('0xb4')]?{'attributes':[],'where':{'TagId':_0x152cfa[_0x4df4('0x88')][_0x4df4('0xb4')]||undefined}}:{},'required':_0x152cfa[_0x4df4('0x88')][_0x4df4('0xb4')]?!![]:![]}];}else{_0x4cd904['include']=[{'all':!![]}];}}return _0x420495[_0x51da2b[_0x4df4('0x18')]][_0x4df4('0xc')](_0x4cd904);})[_0x4df4('0x7')](function(_0x217575){_0x1954fc[_0x4df4('0xb0')]=_0x217575;if(_0x7eac39===_0x4df4('0x31')&&_0x152cfa[_0x4df4('0x88')][_0x4df4('0xb6')]===_0x4df4('0xb7')){var _0xb6e930=[];for(var _0xfb7c86=0x0;_0xfb7c86<_0x1954fc[_0x4df4('0xb0')][_0x4df4('0x92')];_0xfb7c86++){_0xb6e930[_0x4df4('0x93')](_0x1f90a6(_0x4df4('0xb8'),_0x1954fc[_0x4df4('0xb0')][_0xfb7c86]['dataValues']));_0xb6e930[_0x4df4('0x93')](_0x1f90a6('sms',_0x1954fc['rows'][_0xfb7c86][_0x4df4('0xb9')]));_0xb6e930['push'](_0x1f90a6(_0x4df4('0xba'),_0x1954fc[_0x4df4('0xb0')][_0xfb7c86][_0x4df4('0xb9')]));_0xb6e930[_0x4df4('0x93')](_0x1f90a6(_0x4df4('0xbb'),_0x1954fc['rows'][_0xfb7c86][_0x4df4('0xb9')]));_0xb6e930['push'](_0x1f90a6('openchannel',_0x1954fc[_0x4df4('0xb0')][_0xfb7c86][_0x4df4('0xb9')]));_0xb6e930[_0x4df4('0x93')](_0x1f90a6(_0x4df4('0xbc'),_0x1954fc[_0x4df4('0xb0')][_0xfb7c86][_0x4df4('0xb9')]));}return Promise[_0x4df4('0x96')](_0xb6e930)[_0x4df4('0x7')](function(){return _0x1954fc;});}return _0x1954fc;});}});}}});};
\ No newline at end of file
index 04e4569..7ba4eb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f96=['defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x272d97,_0x3cb745){var _0x40fc01=function(_0x1ad071){while(--_0x1ad071){_0x272d97['push'](_0x272d97['shift']());}};_0x40fc01(++_0x3cb745);}(_0x3f96,0x1d3));var _0x63f9=function(_0x486a95,_0x40ffac){_0x486a95=_0x486a95-0x0;var _0x31205c=_0x3f96[_0x486a95];return _0x31205c;};'use strict';var _=require(_0x63f9('0x0'));var util=require(_0x63f9('0x1'));var moment=require(_0x63f9('0x2'));var BPromise=require(_0x63f9('0x3'));var rs=require(_0x63f9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63f9('0x5'))['db'];var utils=require(_0x63f9('0x6'));var logger=require(_0x63f9('0x7'))(_0x63f9('0x8'));var config=require(_0x63f9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x63f9('0xa')][_0x63f9('0xb')]({'port':0x232a});config[_0x63f9('0xc')]=_[_0x63f9('0xd')](config['redis'],{'host':_0x63f9('0xe'),'port':0x18eb});var socket=require(_0x63f9('0xf'))(new Redis(config[_0x63f9('0xc')]));require(_0x63f9('0x10'))[_0x63f9('0x11')](socket);function respondWithRpcPromise(_0x9e3738,_0x26ffde,_0x338a52){return new BPromise(function(_0x584e7c,_0x3e038d){return client[_0x63f9('0x12')](_0x9e3738,_0x338a52)['then'](function(_0x409957){logger[_0x63f9('0x13')](_0x63f9('0x14'),_0x26ffde,'request\x20sent');logger[_0x63f9('0x15')](_0x63f9('0x16'),_0x26ffde,_0x63f9('0x17'),JSON[_0x63f9('0x18')](_0x409957));if(_0x409957[_0x63f9('0x19')]){if(_0x409957[_0x63f9('0x19')][_0x63f9('0x1a')]===0x1f4){logger['error'](_0x63f9('0x14'),_0x26ffde,_0x409957['error'][_0x63f9('0x1b')]);return _0x3e038d(_0x409957['error'][_0x63f9('0x1b')]);}logger[_0x63f9('0x19')](_0x63f9('0x14'),_0x26ffde,_0x409957[_0x63f9('0x19')][_0x63f9('0x1b')]);return _0x584e7c(_0x409957[_0x63f9('0x19')][_0x63f9('0x1b')]);}else{logger['info'](_0x63f9('0x14'),_0x26ffde,_0x63f9('0x17'));_0x584e7c(_0x409957[_0x63f9('0x1c')][_0x63f9('0x1b')]);}})[_0x63f9('0x1d')](function(_0x4bf06f){logger[_0x63f9('0x19')](_0x63f9('0x14'),_0x26ffde,_0x4bf06f);_0x3e038d(_0x4bf06f);});});}
\ No newline at end of file
+var _0x3641=['error','message','info','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x13ecc6,_0x1ce75c){var _0x4ba422=function(_0x4804b4){while(--_0x4804b4){_0x13ecc6['push'](_0x13ecc6['shift']());}};_0x4ba422(++_0x1ce75c);}(_0x3641,0x173));var _0x1364=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3641[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1364('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1364('0x1'));var fs=require('fs');var Redis=require(_0x1364('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1364('0x3'));var logger=require(_0x1364('0x4'))(_0x1364('0x5'));var config=require('../../config/environment');var jayson=require(_0x1364('0x6'));var client=jayson['client'][_0x1364('0x7')]({'port':0x232a});config[_0x1364('0x8')]=_[_0x1364('0x9')](config['redis'],{'host':_0x1364('0xa'),'port':0x18eb});var socket=require(_0x1364('0xb'))(new Redis(config[_0x1364('0x8')]));require(_0x1364('0xc'))[_0x1364('0xd')](socket);function respondWithRpcPromise(_0x28f140,_0x19c8db,_0x2b6559){return new BPromise(function(_0x333290,_0x26b379){return client[_0x1364('0xe')](_0x28f140,_0x2b6559)[_0x1364('0xf')](function(_0x50c4d5){logger['info'](_0x1364('0x10'),_0x19c8db,_0x1364('0x11'));logger[_0x1364('0x12')](_0x1364('0x13'),_0x19c8db,_0x1364('0x11'),JSON['stringify'](_0x50c4d5));if(_0x50c4d5[_0x1364('0x14')]){if(_0x50c4d5[_0x1364('0x14')]['code']===0x1f4){logger[_0x1364('0x14')](_0x1364('0x10'),_0x19c8db,_0x50c4d5[_0x1364('0x14')][_0x1364('0x15')]);return _0x26b379(_0x50c4d5['error']['message']);}logger[_0x1364('0x14')](_0x1364('0x10'),_0x19c8db,_0x50c4d5[_0x1364('0x14')][_0x1364('0x15')]);return _0x333290(_0x50c4d5[_0x1364('0x14')][_0x1364('0x15')]);}else{logger[_0x1364('0x16')](_0x1364('0x10'),_0x19c8db,'request\x20sent');_0x333290(_0x50c4d5['result'][_0x1364('0x15')]);}})['catch'](function(_0x36ba22){logger[_0x1364('0x14')](_0x1364('0x10'),_0x19c8db,_0x36ba22);_0x26b379(_0x36ba22);});});}
\ No newline at end of file
index 8e3c671..5e03758 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x045e=['userProfile:','./userProfile.events','save','remove','update','emit','register'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x045e,0xb7));var _0xe045=function(_0x29c2bb,_0x1bde54){_0x29c2bb=_0x29c2bb-0x0;var _0x5446f1=_0x045e[_0x29c2bb];return _0x5446f1;};'use strict';var UserProfileEvents=require(_0xe045('0x0'));var events=[_0xe045('0x1'),_0xe045('0x2'),_0xe045('0x3')];function createListener(_0x3f04e8,_0xff75a7){return function(_0x5b5fed){_0xff75a7[_0xe045('0x4')](_0x3f04e8,_0x5b5fed);};}function removeListener(_0x403ffc,_0x27c7c0){return function(){UserProfileEvents['removeListener'](_0x403ffc,_0x27c7c0);};}exports[_0xe045('0x5')]=function(_0x2c3168){for(var _0xdba31d=0x0,_0x98948=events['length'];_0xdba31d<_0x98948;_0xdba31d++){var _0x17fa2a=events[_0xdba31d];var _0x26a803=createListener(_0xe045('0x6')+_0x17fa2a,_0x2c3168);UserProfileEvents['on'](_0x17fa2a,_0x26a803);}};
\ No newline at end of file
+var _0x218e=['register','length','userProfile:','./userProfile.events','remove','removeListener'];(function(_0x8536b9,_0x4c3351){var _0x21daec=function(_0x27e0db){while(--_0x27e0db){_0x8536b9['push'](_0x8536b9['shift']());}};_0x21daec(++_0x4c3351);}(_0x218e,0x69));var _0xe218=function(_0x1acc08,_0x2bda05){_0x1acc08=_0x1acc08-0x0;var _0x50f4ac=_0x218e[_0x1acc08];return _0x50f4ac;};'use strict';var UserProfileEvents=require(_0xe218('0x0'));var events=['save',_0xe218('0x1'),'update'];function createListener(_0x100768,_0x2de8b0){return function(_0x9eaa2a){_0x2de8b0['emit'](_0x100768,_0x9eaa2a);};}function removeListener(_0x112775,_0xb3d95b){return function(){UserProfileEvents[_0xe218('0x2')](_0x112775,_0xb3d95b);};}exports[_0xe218('0x3')]=function(_0x4ee330){for(var _0x588de8=0x0,_0x3cf353=events[_0xe218('0x4')];_0x588de8<_0x3cf353;_0x588de8++){var _0x5c9546=events[_0x588de8];var _0x1f35c7=createListener(_0xe218('0x5')+_0x5c9546,_0x4ee330);UserProfileEvents['on'](_0x5c9546,_0x1f35c7);}};
\ No newline at end of file
index f5a7bdb..c138320 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d75=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1e5ae2,_0x4abdd2){var _0x284524=function(_0xaf8bb1){while(--_0xaf8bb1){_0x1e5ae2['push'](_0x1e5ae2['shift']());}};_0x284524(++_0x4abdd2);}(_0x3d75,0x176));var _0x53d7=function(_0x23143b,_0xca855a){_0x23143b=_0x23143b-0x0;var _0x332d90=_0x3d75[_0x23143b];return _0x332d90;};'use strict';var multer=require('multer');var util=require(_0x53d7('0x0'));var path=require('path');var timeout=require(_0x53d7('0x1'));var express=require(_0x53d7('0x2'));var router=express[_0x53d7('0x3')]();var fs_extra=require(_0x53d7('0x4'));var auth=require(_0x53d7('0x5'));var interaction=require(_0x53d7('0x6'));var config=require(_0x53d7('0x7'));var controller=require('./userProfileResource.controller');router[_0x53d7('0x8')]('/',auth[_0x53d7('0x9')](),controller[_0x53d7('0xa')]);router[_0x53d7('0x8')](_0x53d7('0xb'),auth[_0x53d7('0x9')](),controller[_0x53d7('0xc')]);router['get'](_0x53d7('0xd'),auth[_0x53d7('0x9')](),controller[_0x53d7('0xe')]);router[_0x53d7('0xf')]('/',auth[_0x53d7('0x9')](),controller[_0x53d7('0x10')]);router['put'](_0x53d7('0xd'),auth[_0x53d7('0x9')](),controller[_0x53d7('0x11')]);router[_0x53d7('0x12')](_0x53d7('0xd'),auth[_0x53d7('0x9')](),controller[_0x53d7('0x13')]);module[_0x53d7('0x14')]=router;
\ No newline at end of file
+var _0x3abc=['Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0x3abc,0x166));var _0xc3ab=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x3abc[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require(_0xc3ab('0x0'));var util=require(_0xc3ab('0x1'));var path=require('path');var timeout=require(_0xc3ab('0x2'));var express=require('express');var router=express[_0xc3ab('0x3')]();var fs_extra=require(_0xc3ab('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc3ab('0x5'));var config=require('../../config/environment');var controller=require(_0xc3ab('0x6'));router['get']('/',auth[_0xc3ab('0x7')](),controller['index']);router[_0xc3ab('0x8')](_0xc3ab('0x9'),auth[_0xc3ab('0x7')](),controller[_0xc3ab('0xa')]);router[_0xc3ab('0x8')](_0xc3ab('0xb'),auth['isAuthenticated'](),controller[_0xc3ab('0xc')]);router[_0xc3ab('0xd')]('/',auth[_0xc3ab('0x7')](),controller['create']);router[_0xc3ab('0xe')](_0xc3ab('0xb'),auth['isAuthenticated'](),controller[_0xc3ab('0xf')]);router[_0xc3ab('0x10')](_0xc3ab('0xb'),auth[_0xc3ab('0x7')](),controller[_0xc3ab('0x11')]);module[_0xc3ab('0x12')]=router;
\ No newline at end of file
index 17f2b3d..ea68c6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d26=['exports','INTEGER','STRING','sequelize'];(function(_0x52815e,_0x15314e){var _0x1ab139=function(_0x2b7ef8){while(--_0x2b7ef8){_0x52815e['push'](_0x52815e['shift']());}};_0x1ab139(++_0x15314e);}(_0x9d26,0x11f));var _0x69d2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9d26[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x69d2('0x0'));module[_0x69d2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x69d2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x69d2('0x3')],'allowNull':![]}};
\ No newline at end of file
+var _0x5c36=['INTEGER','STRING'];(function(_0x2c1c23,_0x436a98){var _0x40700b=function(_0x4d9be7){while(--_0x4d9be7){_0x2c1c23['push'](_0x2c1c23['shift']());}};_0x40700b(++_0x436a98);}(_0x5c36,0x10d));var _0x65c3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5c36[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x65c3('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x65c3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x65c3('0x0')],'allowNull':![]}};
\ No newline at end of file
index 06ca928..8fac8d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','UserProfileResource','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create','body','describe','eml-format'];(function(_0xc42873,_0x4f9c87){var _0x4976ee=function(_0x326564){while(--_0x326564){_0xc42873['push'](_0xc42873['shift']());}};_0x4976ee(++_0x4f9c87);}(_0x187d,0x93));var _0xd187=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x187d[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));};exports[_0xd187('0x49')]=function(_0x3aaeaa,_0x1b12c4){return db[_0xd187('0x2d')]['describe']()[_0xd187('0x3f')](respondWithResult(_0x1b12c4,null))['catch'](handleError(_0x1b12c4,null));};
\ No newline at end of file
+var _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','UserProfileResource','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x449fb3,_0x5b5f99){var _0xabd59c=function(_0x2a1f91){while(--_0x2a1f91){_0x449fb3['push'](_0x449fb3['shift']());}};_0xabd59c(++_0x5b5f99);}(_0x57ca,0x108));var _0xa57c=function(_0x1ee6f5,_0x518c73){_0x1ee6f5=_0x1ee6f5-0x0;var _0x5873ee=_0x57ca[_0x1ee6f5];return _0x5873ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['UserProfileResource'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['UserProfileResource'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));};
\ No newline at end of file
index c580ba7..1aa5b44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2a2=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','define','UserProfileResource','resourceId','sectionId'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0xb2a2,0x1a4));var _0x2b2a=function(_0x3d0feb,_0x4eae93){_0x3d0feb=_0x3d0feb-0x0;var _0x240140=_0xb2a2[_0x3d0feb];return _0x240140;};'use strict';var _=require('lodash');var util=require(_0x2b2a('0x0'));var logger=require(_0x2b2a('0x1'))('api');var moment=require(_0x2b2a('0x2'));var BPromise=require(_0x2b2a('0x3'));var rp=require(_0x2b2a('0x4'));var fs=require('fs');var path=require(_0x2b2a('0x5'));var rimraf=require(_0x2b2a('0x6'));var config=require('../../config/environment');var attributes=require(_0x2b2a('0x7'));module['exports']=function(_0x59945c,_0x589af6){return _0x59945c[_0x2b2a('0x8')](_0x2b2a('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x2b2a('0xa'),_0x2b2a('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf7ec=['compositeIndex','sectionId','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7ec,0x65));var _0xcf7e=function(_0x4583f5,_0x48986e){_0x4583f5=_0x4583f5-0x0;var _0x16513b=_0xf7ec[_0x4583f5];return _0x16513b;};'use strict';var _=require(_0xcf7e('0x0'));var util=require('util');var logger=require(_0xcf7e('0x1'))(_0xcf7e('0x2'));var moment=require('moment');var BPromise=require(_0xcf7e('0x3'));var rp=require(_0xcf7e('0x4'));var fs=require('fs');var path=require(_0xcf7e('0x5'));var rimraf=require('rimraf');var config=require(_0xcf7e('0x6'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x50604f,_0x58b72f){return _0x50604f['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xcf7e('0x7'),'fields':['resourceId',_0xcf7e('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
index 37dc68f..fc1ac22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbf8=['UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4479e0,_0x58c25b){var _0x972de8=function(_0xa732d9){while(--_0xa732d9){_0x4479e0['push'](_0x4479e0['shift']());}};_0x972de8(++_0x58c25b);}(_0xbbf8,0x17b));var _0x8bbf=function(_0x260b48,_0x117977){_0x260b48=_0x260b48-0x0;var _0x3f730b=_0xbbf8[_0x260b48];return _0x3f730b;};'use strict';var _=require(_0x8bbf('0x0'));var util=require(_0x8bbf('0x1'));var moment=require('moment');var BPromise=require(_0x8bbf('0x2'));var rs=require(_0x8bbf('0x3'));var fs=require('fs');var Redis=require(_0x8bbf('0x4'));var db=require(_0x8bbf('0x5'))['db'];var utils=require(_0x8bbf('0x6'));var logger=require(_0x8bbf('0x7'))(_0x8bbf('0x8'));var config=require(_0x8bbf('0x9'));var jayson=require(_0x8bbf('0xa'));var client=jayson[_0x8bbf('0xb')][_0x8bbf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x161b5c,_0xf6e82a,_0x5039a1){return new BPromise(function(_0x4c039f,_0x468334){return client['request'](_0x161b5c,_0x5039a1)['then'](function(_0x474020){logger[_0x8bbf('0xd')](_0x8bbf('0xe'),_0xf6e82a,_0x8bbf('0xf'));logger[_0x8bbf('0x10')](_0x8bbf('0x11'),_0xf6e82a,_0x8bbf('0xf'),JSON['stringify'](_0x474020));if(_0x474020['error']){if(_0x474020[_0x8bbf('0x12')][_0x8bbf('0x13')]===0x1f4){logger[_0x8bbf('0x12')](_0x8bbf('0xe'),_0xf6e82a,_0x474020[_0x8bbf('0x12')][_0x8bbf('0x14')]);return _0x468334(_0x474020[_0x8bbf('0x12')][_0x8bbf('0x14')]);}logger[_0x8bbf('0x12')](_0x8bbf('0xe'),_0xf6e82a,_0x474020[_0x8bbf('0x12')][_0x8bbf('0x14')]);return _0x4c039f(_0x474020[_0x8bbf('0x12')]['message']);}else{logger[_0x8bbf('0xd')](_0x8bbf('0xe'),_0xf6e82a,_0x8bbf('0xf'));_0x4c039f(_0x474020['result'][_0x8bbf('0x14')]);}})[_0x8bbf('0x15')](function(_0x1f1900){logger['error'](_0x8bbf('0xe'),_0xf6e82a,_0x1f1900);_0x468334(_0x1f1900);});});}
\ No newline at end of file
+var _0x8ad7=['message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x21dd9c,_0x31ff42){var _0x30d236=function(_0x353652){while(--_0x353652){_0x21dd9c['push'](_0x21dd9c['shift']());}};_0x30d236(++_0x31ff42);}(_0x8ad7,0xb3));var _0x78ad=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x8ad7[_0x1b6186];return _0x186121;};'use strict';var _=require(_0x78ad('0x0'));var util=require('util');var moment=require(_0x78ad('0x1'));var BPromise=require(_0x78ad('0x2'));var rs=require(_0x78ad('0x3'));var fs=require('fs');var Redis=require(_0x78ad('0x4'));var db=require(_0x78ad('0x5'))['db'];var utils=require(_0x78ad('0x6'));var logger=require(_0x78ad('0x7'))('rpc');var config=require(_0x78ad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x78ad('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16fdd4,_0x3430f1,_0x2868af){return new BPromise(function(_0x4b75a9,_0x48b3af){return client[_0x78ad('0xa')](_0x16fdd4,_0x2868af)[_0x78ad('0xb')](function(_0x48581d){logger['info'](_0x78ad('0xc'),_0x3430f1,_0x78ad('0xd'));logger[_0x78ad('0xe')](_0x78ad('0xf'),_0x3430f1,_0x78ad('0xd'),JSON[_0x78ad('0x10')](_0x48581d));if(_0x48581d[_0x78ad('0x11')]){if(_0x48581d[_0x78ad('0x11')][_0x78ad('0x12')]===0x1f4){logger[_0x78ad('0x11')](_0x78ad('0xc'),_0x3430f1,_0x48581d['error']['message']);return _0x48b3af(_0x48581d['error'][_0x78ad('0x13')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x3430f1,_0x48581d[_0x78ad('0x11')][_0x78ad('0x13')]);return _0x4b75a9(_0x48581d['error']['message']);}else{logger[_0x78ad('0x14')](_0x78ad('0xc'),_0x3430f1,'request\x20sent');_0x4b75a9(_0x48581d['result']['message']);}})[_0x78ad('0x15')](function(_0x26cd30){logger[_0x78ad('0x11')](_0x78ad('0xc'),_0x3430f1,_0x26cd30);_0x48b3af(_0x26cd30);});});}
\ No newline at end of file
index c83da5d..af1e8bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7347=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7347,0xc2));var _0x7734=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x7347[_0x1589dd];return _0x1bddd1;};'use strict';var multer=require(_0x7734('0x0'));var util=require(_0x7734('0x1'));var path=require('path');var timeout=require(_0x7734('0x2'));var express=require(_0x7734('0x3'));var router=express[_0x7734('0x4')]();var fs_extra=require(_0x7734('0x5'));var auth=require(_0x7734('0x6'));var interaction=require(_0x7734('0x7'));var config=require(_0x7734('0x8'));var controller=require(_0x7734('0x9'));router[_0x7734('0xa')]('/',auth['isAuthenticated'](),controller[_0x7734('0xb')]);router['get']('/describe',auth[_0x7734('0xc')](),controller[_0x7734('0xd')]);router[_0x7734('0xa')](_0x7734('0xe'),auth[_0x7734('0xc')](),controller[_0x7734('0xf')]);router[_0x7734('0x10')]('/',auth[_0x7734('0xc')](),controller[_0x7734('0x11')]);router['put'](_0x7734('0xe'),auth[_0x7734('0xc')](),controller[_0x7734('0x12')]);router[_0x7734('0x13')](_0x7734('0xe'),auth[_0x7734('0xc')](),controller[_0x7734('0x14')]);module[_0x7734('0x15')]=router;
\ No newline at end of file
+var _0x6b88=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','multer','util'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0x6b88,0x116));var _0x86b8=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x6b88[_0x1a36a5];return _0x746243;};'use strict';var multer=require(_0x86b8('0x0'));var util=require(_0x86b8('0x1'));var path=require(_0x86b8('0x2'));var timeout=require(_0x86b8('0x3'));var express=require(_0x86b8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x86b8('0x5'));var interaction=require(_0x86b8('0x6'));var config=require(_0x86b8('0x7'));var controller=require(_0x86b8('0x8'));router[_0x86b8('0x9')]('/',auth[_0x86b8('0xa')](),controller[_0x86b8('0xb')]);router[_0x86b8('0x9')](_0x86b8('0xc'),auth['isAuthenticated'](),controller[_0x86b8('0xd')]);router[_0x86b8('0x9')](_0x86b8('0xe'),auth['isAuthenticated'](),controller[_0x86b8('0xf')]);router[_0x86b8('0x10')]('/',auth[_0x86b8('0xa')](),controller[_0x86b8('0x11')]);router[_0x86b8('0x12')](_0x86b8('0xe'),auth[_0x86b8('0xa')](),controller['update']);router[_0x86b8('0x13')](_0x86b8('0xe'),auth[_0x86b8('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index bdb525a..cc7421c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff0=['BOOLEAN','setDataValue','crudPermissions','getDataValue','split','exports','STRING'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xfff0,0x139));var _0x0fff=function(_0xe632d0,_0x50bbb3){_0xe632d0=_0xe632d0-0x0;var _0x151481=_0xfff0[_0xe632d0];return _0x151481;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'name':{'type':Sequelize[_0x0fff('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x0fff('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0fff('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0fff('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0fff('0x1')],'set':function(_0x4bec60){this[_0x0fff('0x3')](_0x0fff('0x4'),_0x4bec60?_0x4bec60['join'](''):[]);},'get':function(){return this[_0x0fff('0x5')](_0x0fff('0x4'))?this[_0x0fff('0x5')]('crudPermissions')[_0x0fff('0x6')](''):[];}}};
\ No newline at end of file
+var _0x7334=['split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x7334,0x184));var _0x4733=function(_0x1262dd,_0x2a3d08){_0x1262dd=_0x1262dd-0x0;var _0xaada90=_0x7334[_0x1262dd];return _0xaada90;};'use strict';var Sequelize=require(_0x4733('0x0'));module[_0x4733('0x1')]={'name':{'type':Sequelize[_0x4733('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x4733('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4733('0x2')],'set':function(_0x218143){this[_0x4733('0x4')](_0x4733('0x5'),_0x218143?_0x218143[_0x4733('0x6')](''):[]);},'get':function(){return this[_0x4733('0x7')](_0x4733('0x5'))?this[_0x4733('0x7')](_0x4733('0x5'))[_0x4733('0x8')](''):[];}}};
\ No newline at end of file
index 6e99633..42f8174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4783=['index','map','UserProfileSection','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name'];(function(_0x1def93,_0x1adede){var _0x35199a=function(_0x44051a){while(--_0x44051a){_0x1def93['push'](_0x1def93['shift']());}};_0x35199a(++_0x1adede);}(_0x4783,0x6e));var _0x3478=function(_0x2e84d7,_0x40311c){_0x2e84d7=_0x2e84d7-0x0;var _0xefcb87=_0x4783[_0x2e84d7];return _0xefcb87;};'use strict';var emlformat=require(_0x3478('0x0'));var rimraf=require(_0x3478('0x1'));var zipdir=require(_0x3478('0x2'));var jsonpatch=require(_0x3478('0x3'));var rp=require(_0x3478('0x4'));var moment=require('moment');var BPromise=require(_0x3478('0x5'));var Mustache=require(_0x3478('0x6'));var util=require(_0x3478('0x7'));var path=require(_0x3478('0x8'));var sox=require(_0x3478('0x9'));var csv=require(_0x3478('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3478('0xb'));var squel=require(_0x3478('0xc'));var crypto=require('crypto');var jsforce=require(_0x3478('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3478('0xa'));var querystring=require('querystring');var Papa=require(_0x3478('0xe'));var Redis=require(_0x3478('0xf'));var authService=require(_0x3478('0x10'));var qs=require(_0x3478('0x11'));var as=require(_0x3478('0x12'));var hardwareService=require(_0x3478('0x13'));var logger=require(_0x3478('0x14'))(_0x3478('0x15'));var utils=require(_0x3478('0x16'));var config=require(_0x3478('0x17'));var licenseUtil=require(_0x3478('0x18'));var db=require(_0x3478('0x19'))['db'];function respondWithStatusCode(_0x33bdd3,_0x4b1154){_0x4b1154=_0x4b1154||0xcc;return function(_0x104d82){if(_0x104d82){return _0x33bdd3[_0x3478('0x1a')](_0x4b1154);}return _0x33bdd3[_0x3478('0x1b')](_0x4b1154)['end']();};}function respondWithResult(_0x5df41d,_0x25a086){_0x25a086=_0x25a086||0xc8;return function(_0x4eefd3){if(_0x4eefd3){return _0x5df41d[_0x3478('0x1b')](_0x25a086)['json'](_0x4eefd3);}};}function respondWithFilteredResult(_0x3144ca,_0x4b7ca9){return function(_0x9b0cf){if(_0x9b0cf){var _0xfec31=typeof _0x4b7ca9[_0x3478('0x1c')]===_0x3478('0x1d')&&typeof _0x4b7ca9['limit']===_0x3478('0x1d');var _0x47c012=_0x9b0cf[_0x3478('0x1e')];var _0x34b8fd=_0xfec31?0x0:_0x4b7ca9[_0x3478('0x1c')];var _0xec79d8=_0xfec31?_0x9b0cf[_0x3478('0x1e')]:_0x4b7ca9[_0x3478('0x1c')]+_0x4b7ca9['limit'];var _0x1f484f;if(_0xec79d8>=_0x47c012){_0xec79d8=_0x47c012;_0x1f484f=0xc8;}else{_0x1f484f=0xce;}_0x3144ca[_0x3478('0x1b')](_0x1f484f);return _0x3144ca[_0x3478('0x1f')](_0x3478('0x20'),_0x34b8fd+'-'+_0xec79d8+'/'+_0x47c012)['json'](_0x9b0cf);}return null;};}function patchUpdates(_0xa2b974){return function(_0x42fc2d){try{jsonpatch[_0x3478('0x21')](_0x42fc2d,_0xa2b974,!![]);}catch(_0x2daeea){return BPromise[_0x3478('0x22')](_0x2daeea);}return _0x42fc2d[_0x3478('0x23')]();};}function saveUpdates(_0x3e65e3,_0x16ef1c){return function(_0x58a56d){if(_0x58a56d){return _0x58a56d[_0x3478('0x24')](_0x3e65e3)[_0x3478('0x25')](function(_0x4203eb){return _0x4203eb;});}return null;};}function removeEntity(_0x517a64,_0x1677c5){return function(_0x5acce5){if(_0x5acce5){return _0x5acce5[_0x3478('0x26')]()[_0x3478('0x25')](function(){_0x517a64[_0x3478('0x1b')](0xcc)[_0x3478('0x27')]();});}};}function handleEntityNotFound(_0x2d644c,_0x5aa8fc){return function(_0x55c0fe){if(!_0x55c0fe){_0x2d644c['sendStatus'](0x194);}return _0x55c0fe;};}function handleError(_0x1c8a04,_0x7252ef){_0x7252ef=_0x7252ef||0x1f4;return function(_0x5e07c5){logger[_0x3478('0x28')](_0x5e07c5['stack']);if(_0x5e07c5['name']){delete _0x5e07c5[_0x3478('0x29')];}_0x1c8a04[_0x3478('0x1b')](_0x7252ef)['send'](_0x5e07c5);};}exports[_0x3478('0x2a')]=function(_0x3609eb,_0x5a8639){var _0x4b062c={},_0x5741d9={},_0x3aa899={'count':0x0,'rows':[]};var _0x20643c=_[_0x3478('0x2b')](db[_0x3478('0x2c')][_0x3478('0x2d')],function(_0x1ad454){return{'name':_0x1ad454[_0x3478('0x2e')],'type':_0x1ad454[_0x3478('0x2f')]['key']};});_0x5741d9[_0x3478('0x30')]=_[_0x3478('0x2b')](_0x20643c,_0x3478('0x29'));_0x5741d9[_0x3478('0x31')]=_['keys'](_0x3609eb[_0x3478('0x31')]);_0x5741d9[_0x3478('0x32')]=_[_0x3478('0x33')](_0x5741d9[_0x3478('0x30')],_0x5741d9[_0x3478('0x31')]);_0x4b062c[_0x3478('0x34')]=_[_0x3478('0x33')](_0x5741d9[_0x3478('0x30')],qs[_0x3478('0x35')](_0x3609eb[_0x3478('0x31')][_0x3478('0x35')]));_0x4b062c[_0x3478('0x34')]=_0x4b062c[_0x3478('0x34')][_0x3478('0x36')]?_0x4b062c[_0x3478('0x34')]:_0x5741d9[_0x3478('0x30')];if(!_0x3609eb['query']['hasOwnProperty'](_0x3478('0x37'))){_0x4b062c[_0x3478('0x38')]=qs[_0x3478('0x38')](_0x3609eb[_0x3478('0x31')][_0x3478('0x38')]);_0x4b062c['offset']=qs['offset'](_0x3609eb[_0x3478('0x31')][_0x3478('0x1c')]);}_0x4b062c[_0x3478('0x39')]=qs['sort'](_0x3609eb[_0x3478('0x31')][_0x3478('0x3a')]);_0x4b062c[_0x3478('0x3b')]=qs['filters'](_[_0x3478('0x3c')](_0x3609eb[_0x3478('0x31')],_0x5741d9[_0x3478('0x32')]),_0x20643c);if(_0x3609eb[_0x3478('0x31')]['filter']){_0x4b062c[_0x3478('0x3b')]=_['merge'](_0x4b062c[_0x3478('0x3b')],{'$or':_[_0x3478('0x2b')](_0x20643c,function(_0x58788d){if(_0x58788d['type']!==_0x3478('0x3d')){var _0x5e5370={};_0x5e5370[_0x58788d['name']]={'$like':'%'+_0x3609eb[_0x3478('0x31')][_0x3478('0x3e')]+'%'};return _0x5e5370;}})});}_0x4b062c=_[_0x3478('0x3f')]({},_0x4b062c,_0x3609eb[_0x3478('0x40')]);var _0x2855cb={'where':_0x4b062c[_0x3478('0x3b')]};return db[_0x3478('0x2c')][_0x3478('0x1e')](_0x2855cb)['then'](function(_0x41b517){_0x3aa899['count']=_0x41b517;if(_0x3609eb[_0x3478('0x31')][_0x3478('0x41')]){_0x4b062c['include']=[{'all':!![]}];}return db[_0x3478('0x2c')][_0x3478('0x42')](_0x4b062c);})['then'](function(_0x57cb7a){_0x3aa899[_0x3478('0x43')]=_0x57cb7a;return _0x3aa899;})[_0x3478('0x25')](respondWithFilteredResult(_0x5a8639,_0x4b062c))[_0x3478('0x44')](handleError(_0x5a8639,null));};exports['show']=function(_0x319b8b,_0x2d341e){var _0x161194={'raw':![],'where':{'id':_0x319b8b[_0x3478('0x45')]['id']}},_0x11e611={};_0x11e611[_0x3478('0x30')]=_[_0x3478('0x46')](db['UserProfileSection'][_0x3478('0x2d')]);_0x11e611[_0x3478('0x31')]=_[_0x3478('0x46')](_0x319b8b[_0x3478('0x31')]);_0x11e611['filters']=_[_0x3478('0x33')](_0x11e611['model'],_0x11e611[_0x3478('0x31')]);_0x161194[_0x3478('0x34')]=_[_0x3478('0x33')](_0x11e611[_0x3478('0x30')],qs[_0x3478('0x35')](_0x319b8b[_0x3478('0x31')][_0x3478('0x35')]));_0x161194[_0x3478('0x34')]=_0x161194[_0x3478('0x34')][_0x3478('0x36')]?_0x161194[_0x3478('0x34')]:_0x11e611['model'];if(_0x319b8b[_0x3478('0x31')][_0x3478('0x41')]){_0x161194[_0x3478('0x47')]=[{'all':!![]}];}_0x161194=_[_0x3478('0x3f')]({},_0x161194,_0x319b8b[_0x3478('0x40')]);return db[_0x3478('0x2c')][_0x3478('0x48')](_0x161194)['then'](handleEntityNotFound(_0x2d341e,null))[_0x3478('0x25')](respondWithResult(_0x2d341e,null))[_0x3478('0x44')](handleError(_0x2d341e,null));};exports[_0x3478('0x49')]=function(_0x467a54,_0x44d94f){return db[_0x3478('0x2c')][_0x3478('0x49')](_0x467a54['body'],{})[_0x3478('0x25')](respondWithResult(_0x44d94f,0xc9))[_0x3478('0x44')](handleError(_0x44d94f,null));};exports['update']=function(_0x26384e,_0x200111){if(_0x26384e['body']['id']){delete _0x26384e['body']['id'];}return db['UserProfileSection'][_0x3478('0x48')]({'where':{'id':_0x26384e[_0x3478('0x45')]['id']}})[_0x3478('0x25')](handleEntityNotFound(_0x200111,null))['then'](saveUpdates(_0x26384e[_0x3478('0x4a')],null))[_0x3478('0x25')](respondWithResult(_0x200111,null))[_0x3478('0x44')](handleError(_0x200111,null));};exports[_0x3478('0x26')]=function(_0xc48973,_0x335a35){return db['UserProfileSection'][_0x3478('0x48')]({'where':{'id':_0xc48973[_0x3478('0x45')]['id']}})[_0x3478('0x25')](handleEntityNotFound(_0x335a35,null))[_0x3478('0x25')](removeEntity(_0x335a35,null))[_0x3478('0x44')](handleError(_0x335a35,null));};exports[_0x3478('0x4b')]=function(_0x56e17c,_0x1336c6){return db[_0x3478('0x2c')][_0x3478('0x4b')]()[_0x3478('0x25')](respondWithResult(_0x1336c6,null))[_0x3478('0x44')](handleError(_0x1336c6,null));};
\ No newline at end of file
+var _0x2f7b=['count','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','UserProfileSection','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0x2f7b,0xc4));var _0xb2f7=function(_0x50230c,_0x1e56c3){_0x50230c=_0x50230c-0x0;var _0xfe3eaa=_0x2f7b[_0x50230c];return _0xfe3eaa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2f7('0x0'));var zipdir=require(_0xb2f7('0x1'));var jsonpatch=require(_0xb2f7('0x2'));var rp=require(_0xb2f7('0x3'));var moment=require(_0xb2f7('0x4'));var BPromise=require(_0xb2f7('0x5'));var Mustache=require(_0xb2f7('0x6'));var util=require(_0xb2f7('0x7'));var path=require('path');var sox=require(_0xb2f7('0x8'));var csv=require('to-csv');var ejs=require(_0xb2f7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb2f7('0xa'));var squel=require(_0xb2f7('0xb'));var crypto=require(_0xb2f7('0xc'));var jsforce=require(_0xb2f7('0xd'));var deskjs=require(_0xb2f7('0xe'));var toCsv=require(_0xb2f7('0xf'));var querystring=require(_0xb2f7('0x10'));var Papa=require(_0xb2f7('0x11'));var Redis=require(_0xb2f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb2f7('0x13'));var hardwareService=require(_0xb2f7('0x14'));var logger=require(_0xb2f7('0x15'))(_0xb2f7('0x16'));var utils=require('../../config/utils');var config=require(_0xb2f7('0x17'));var licenseUtil=require(_0xb2f7('0x18'));var db=require(_0xb2f7('0x19'))['db'];function respondWithStatusCode(_0x157201,_0x2aede7){_0x2aede7=_0x2aede7||0xcc;return function(_0x3beb68){if(_0x3beb68){return _0x157201[_0xb2f7('0x1a')](_0x2aede7);}return _0x157201[_0xb2f7('0x1b')](_0x2aede7)[_0xb2f7('0x1c')]();};}function respondWithResult(_0x3c89cc,_0x4e383d){_0x4e383d=_0x4e383d||0xc8;return function(_0x1aa606){if(_0x1aa606){return _0x3c89cc['status'](_0x4e383d)['json'](_0x1aa606);}};}function respondWithFilteredResult(_0x4c8975,_0x2e2265){return function(_0xe2549f){if(_0xe2549f){var _0x492d45=typeof _0x2e2265[_0xb2f7('0x1d')]==='undefined'&&typeof _0x2e2265[_0xb2f7('0x1e')]===_0xb2f7('0x1f');var _0x133ca3=_0xe2549f[_0xb2f7('0x20')];var _0x481e30=_0x492d45?0x0:_0x2e2265[_0xb2f7('0x1d')];var _0x445aca=_0x492d45?_0xe2549f['count']:_0x2e2265[_0xb2f7('0x1d')]+_0x2e2265['limit'];var _0x46aa44;if(_0x445aca>=_0x133ca3){_0x445aca=_0x133ca3;_0x46aa44=0xc8;}else{_0x46aa44=0xce;}_0x4c8975[_0xb2f7('0x1b')](_0x46aa44);return _0x4c8975[_0xb2f7('0x21')](_0xb2f7('0x22'),_0x481e30+'-'+_0x445aca+'/'+_0x133ca3)[_0xb2f7('0x23')](_0xe2549f);}return null;};}function patchUpdates(_0x1489ca){return function(_0x1cb213){try{jsonpatch['apply'](_0x1cb213,_0x1489ca,!![]);}catch(_0x2db088){return BPromise[_0xb2f7('0x24')](_0x2db088);}return _0x1cb213[_0xb2f7('0x25')]();};}function saveUpdates(_0x36f6f9,_0x5c72ac){return function(_0xa0a04c){if(_0xa0a04c){return _0xa0a04c[_0xb2f7('0x26')](_0x36f6f9)[_0xb2f7('0x27')](function(_0x57454f){return _0x57454f;});}return null;};}function removeEntity(_0x54b021,_0x205a93){return function(_0x1c14de){if(_0x1c14de){return _0x1c14de['destroy']()[_0xb2f7('0x27')](function(){_0x54b021[_0xb2f7('0x1b')](0xcc)[_0xb2f7('0x1c')]();});}};}function handleEntityNotFound(_0x4a137a,_0x114a7f){return function(_0x1d6bdf){if(!_0x1d6bdf){_0x4a137a[_0xb2f7('0x1a')](0x194);}return _0x1d6bdf;};}function handleError(_0x35cd27,_0x15cf2a){_0x15cf2a=_0x15cf2a||0x1f4;return function(_0x315a30){logger[_0xb2f7('0x28')](_0x315a30[_0xb2f7('0x29')]);if(_0x315a30[_0xb2f7('0x2a')]){delete _0x315a30[_0xb2f7('0x2a')];}_0x35cd27[_0xb2f7('0x1b')](_0x15cf2a)[_0xb2f7('0x2b')](_0x315a30);};}exports[_0xb2f7('0x2c')]=function(_0xf1fb10,_0x2fa3c0){var _0x456e5f={},_0xfebf52={},_0x7779b5={'count':0x0,'rows':[]};var _0x2d5e43=_['map'](db[_0xb2f7('0x2d')][_0xb2f7('0x2e')],function(_0x3711ef){return{'name':_0x3711ef['fieldName'],'type':_0x3711ef['type'][_0xb2f7('0x2f')]};});_0xfebf52[_0xb2f7('0x30')]=_[_0xb2f7('0x31')](_0x2d5e43,_0xb2f7('0x2a'));_0xfebf52[_0xb2f7('0x32')]=_[_0xb2f7('0x33')](_0xf1fb10[_0xb2f7('0x32')]);_0xfebf52[_0xb2f7('0x34')]=_[_0xb2f7('0x35')](_0xfebf52[_0xb2f7('0x30')],_0xfebf52[_0xb2f7('0x32')]);_0x456e5f[_0xb2f7('0x36')]=_['intersection'](_0xfebf52[_0xb2f7('0x30')],qs[_0xb2f7('0x37')](_0xf1fb10[_0xb2f7('0x32')][_0xb2f7('0x37')]));_0x456e5f[_0xb2f7('0x36')]=_0x456e5f[_0xb2f7('0x36')][_0xb2f7('0x38')]?_0x456e5f[_0xb2f7('0x36')]:_0xfebf52[_0xb2f7('0x30')];if(!_0xf1fb10['query']['hasOwnProperty']('nolimit')){_0x456e5f[_0xb2f7('0x1e')]=qs[_0xb2f7('0x1e')](_0xf1fb10[_0xb2f7('0x32')]['limit']);_0x456e5f[_0xb2f7('0x1d')]=qs['offset'](_0xf1fb10[_0xb2f7('0x32')][_0xb2f7('0x1d')]);}_0x456e5f[_0xb2f7('0x39')]=qs[_0xb2f7('0x3a')](_0xf1fb10[_0xb2f7('0x32')][_0xb2f7('0x3a')]);_0x456e5f[_0xb2f7('0x3b')]=qs[_0xb2f7('0x34')](_[_0xb2f7('0x3c')](_0xf1fb10[_0xb2f7('0x32')],_0xfebf52[_0xb2f7('0x34')]),_0x2d5e43);if(_0xf1fb10['query'][_0xb2f7('0x3d')]){_0x456e5f[_0xb2f7('0x3b')]=_['merge'](_0x456e5f[_0xb2f7('0x3b')],{'$or':_[_0xb2f7('0x31')](_0x2d5e43,function(_0x1d3893){if(_0x1d3893['type']!==_0xb2f7('0x3e')){var _0x21a606={};_0x21a606[_0x1d3893['name']]={'$like':'%'+_0xf1fb10['query'][_0xb2f7('0x3d')]+'%'};return _0x21a606;}})});}_0x456e5f=_[_0xb2f7('0x3f')]({},_0x456e5f,_0xf1fb10[_0xb2f7('0x40')]);var _0xc84f08={'where':_0x456e5f['where']};return db[_0xb2f7('0x2d')][_0xb2f7('0x20')](_0xc84f08)[_0xb2f7('0x27')](function(_0x1c6560){_0x7779b5[_0xb2f7('0x20')]=_0x1c6560;if(_0xf1fb10[_0xb2f7('0x32')][_0xb2f7('0x41')]){_0x456e5f[_0xb2f7('0x42')]=[{'all':!![]}];}return db[_0xb2f7('0x2d')][_0xb2f7('0x43')](_0x456e5f);})[_0xb2f7('0x27')](function(_0x556e0e){_0x7779b5[_0xb2f7('0x44')]=_0x556e0e;return _0x7779b5;})[_0xb2f7('0x27')](respondWithFilteredResult(_0x2fa3c0,_0x456e5f))[_0xb2f7('0x45')](handleError(_0x2fa3c0,null));};exports[_0xb2f7('0x46')]=function(_0x1f0812,_0x31a85e){var _0x3d53a={'raw':![],'where':{'id':_0x1f0812[_0xb2f7('0x47')]['id']}},_0x3c4a4d={};_0x3c4a4d[_0xb2f7('0x30')]=_['keys'](db[_0xb2f7('0x2d')][_0xb2f7('0x2e')]);_0x3c4a4d[_0xb2f7('0x32')]=_['keys'](_0x1f0812['query']);_0x3c4a4d[_0xb2f7('0x34')]=_[_0xb2f7('0x35')](_0x3c4a4d[_0xb2f7('0x30')],_0x3c4a4d[_0xb2f7('0x32')]);_0x3d53a[_0xb2f7('0x36')]=_['intersection'](_0x3c4a4d['model'],qs[_0xb2f7('0x37')](_0x1f0812[_0xb2f7('0x32')]['fields']));_0x3d53a[_0xb2f7('0x36')]=_0x3d53a[_0xb2f7('0x36')][_0xb2f7('0x38')]?_0x3d53a[_0xb2f7('0x36')]:_0x3c4a4d[_0xb2f7('0x30')];if(_0x1f0812[_0xb2f7('0x32')][_0xb2f7('0x41')]){_0x3d53a[_0xb2f7('0x42')]=[{'all':!![]}];}_0x3d53a=_[_0xb2f7('0x3f')]({},_0x3d53a,_0x1f0812['options']);return db[_0xb2f7('0x2d')][_0xb2f7('0x48')](_0x3d53a)[_0xb2f7('0x27')](handleEntityNotFound(_0x31a85e,null))[_0xb2f7('0x27')](respondWithResult(_0x31a85e,null))[_0xb2f7('0x45')](handleError(_0x31a85e,null));};exports[_0xb2f7('0x49')]=function(_0x24ba32,_0x486c8d){return db['UserProfileSection'][_0xb2f7('0x49')](_0x24ba32['body'],{})[_0xb2f7('0x27')](respondWithResult(_0x486c8d,0xc9))[_0xb2f7('0x45')](handleError(_0x486c8d,null));};exports['update']=function(_0x213f3d,_0x142e55){if(_0x213f3d[_0xb2f7('0x4a')]['id']){delete _0x213f3d[_0xb2f7('0x4a')]['id'];}return db['UserProfileSection'][_0xb2f7('0x48')]({'where':{'id':_0x213f3d[_0xb2f7('0x47')]['id']}})['then'](handleEntityNotFound(_0x142e55,null))['then'](saveUpdates(_0x213f3d[_0xb2f7('0x4a')],null))[_0xb2f7('0x27')](respondWithResult(_0x142e55,null))['catch'](handleError(_0x142e55,null));};exports['destroy']=function(_0x37fc5c,_0x4b9c9d){return db[_0xb2f7('0x2d')][_0xb2f7('0x48')]({'where':{'id':_0x37fc5c[_0xb2f7('0x47')]['id']}})[_0xb2f7('0x27')](handleEntityNotFound(_0x4b9c9d,null))[_0xb2f7('0x27')](removeEntity(_0x4b9c9d,null))['catch'](handleError(_0x4b9c9d,null));};exports[_0xb2f7('0x4b')]=function(_0x21fc56,_0xeb5594){return db[_0xb2f7('0x2d')][_0xb2f7('0x4b')]()[_0xb2f7('0x27')](respondWithResult(_0xeb5594,null))[_0xb2f7('0x45')](handleError(_0xeb5594,null));};
\ No newline at end of file
index 1344925..83021d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1574=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x34d0ca,_0xde0ee8){var _0x5cd69e=function(_0x5b574e){while(--_0x5b574e){_0x34d0ca['push'](_0x34d0ca['shift']());}};_0x5cd69e(++_0xde0ee8);}(_0x1574,0x148));var _0x4157=function(_0xbdcb1,_0x2c7730){_0xbdcb1=_0xbdcb1-0x0;var _0x2650d3=_0x1574[_0xbdcb1];return _0x2650d3;};'use strict';var _=require(_0x4157('0x0'));var util=require(_0x4157('0x1'));var logger=require(_0x4157('0x2'))(_0x4157('0x3'));var moment=require('moment');var BPromise=require(_0x4157('0x4'));var rp=require(_0x4157('0x5'));var fs=require('fs');var path=require(_0x4157('0x6'));var rimraf=require(_0x4157('0x7'));var config=require(_0x4157('0x8'));var attributes=require(_0x4157('0x9'));module[_0x4157('0xa')]=function(_0x43c6dc,_0xbd0cf7){return _0x43c6dc[_0x4157('0xb')](_0x4157('0xc'),attributes,{'tableName':_0x4157('0xd'),'paranoid':![],'indexes':[{'name':_0x4157('0xe'),'fields':[_0x4157('0xf'),_0x4157('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcffb=['request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','sectionId','userProfileId','util','../../config/logger','api','moment'];(function(_0x1e1e6c,_0x1100fd){var _0x3197d0=function(_0xcdaf17){while(--_0xcdaf17){_0x1e1e6c['push'](_0x1e1e6c['shift']());}};_0x3197d0(++_0x1100fd);}(_0xcffb,0x11a));var _0xbcff=function(_0x4e7b4d,_0x114080){_0x4e7b4d=_0x4e7b4d-0x0;var _0xf3b7ba=_0xcffb[_0x4e7b4d];return _0xf3b7ba;};'use strict';var _=require('lodash');var util=require(_0xbcff('0x0'));var logger=require(_0xbcff('0x1'))(_0xbcff('0x2'));var moment=require(_0xbcff('0x3'));var BPromise=require('bluebird');var rp=require(_0xbcff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbcff('0x5'));var config=require(_0xbcff('0x6'));var attributes=require(_0xbcff('0x7'));module[_0xbcff('0x8')]=function(_0x3b16c4,_0x4fa44a){return _0x3b16c4[_0xbcff('0x9')]('UserProfileSection',attributes,{'tableName':_0xbcff('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xbcff('0xb'),_0xbcff('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index f192655..ecd1cde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dcc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x73f06c,_0x2dbb1e){var _0x5c9c45=function(_0x9f5184){while(--_0x9f5184){_0x73f06c['push'](_0x73f06c['shift']());}};_0x5c9c45(++_0x2dbb1e);}(_0x7dcc,0xc3));var _0xc7dc=function(_0x3c600d,_0x4b5c85){_0x3c600d=_0x3c600d-0x0;var _0xd195e3=_0x7dcc[_0x3c600d];return _0xd195e3;};'use strict';var _=require(_0xc7dc('0x0'));var util=require(_0xc7dc('0x1'));var moment=require('moment');var BPromise=require(_0xc7dc('0x2'));var rs=require(_0xc7dc('0x3'));var fs=require('fs');var Redis=require(_0xc7dc('0x4'));var db=require(_0xc7dc('0x5'))['db'];var utils=require(_0xc7dc('0x6'));var logger=require(_0xc7dc('0x7'))(_0xc7dc('0x8'));var config=require(_0xc7dc('0x9'));var jayson=require(_0xc7dc('0xa'));var client=jayson[_0xc7dc('0xb')][_0xc7dc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1be082,_0x585ecf,_0x341f5b){return new BPromise(function(_0x4f628e,_0x4f1cb9){return client[_0xc7dc('0xd')](_0x1be082,_0x341f5b)[_0xc7dc('0xe')](function(_0x4d2c94){logger[_0xc7dc('0xf')](_0xc7dc('0x10'),_0x585ecf,_0xc7dc('0x11'));logger[_0xc7dc('0x12')](_0xc7dc('0x13'),_0x585ecf,_0xc7dc('0x11'),JSON['stringify'](_0x4d2c94));if(_0x4d2c94[_0xc7dc('0x14')]){if(_0x4d2c94[_0xc7dc('0x14')][_0xc7dc('0x15')]===0x1f4){logger[_0xc7dc('0x14')](_0xc7dc('0x10'),_0x585ecf,_0x4d2c94[_0xc7dc('0x14')][_0xc7dc('0x16')]);return _0x4f1cb9(_0x4d2c94[_0xc7dc('0x14')]['message']);}logger[_0xc7dc('0x14')](_0xc7dc('0x10'),_0x585ecf,_0x4d2c94[_0xc7dc('0x14')][_0xc7dc('0x16')]);return _0x4f628e(_0x4d2c94[_0xc7dc('0x14')][_0xc7dc('0x16')]);}else{logger[_0xc7dc('0xf')](_0xc7dc('0x10'),_0x585ecf,_0xc7dc('0x11'));_0x4f628e(_0x4d2c94[_0xc7dc('0x17')][_0xc7dc('0x16')]);}})[_0xc7dc('0x18')](function(_0x4658b9){logger[_0xc7dc('0x14')](_0xc7dc('0x10'),_0x585ecf,_0x4658b9);_0x4f1cb9(_0x4658b9);});});}
\ No newline at end of file
+var _0x3464=['../../config/logger','rpc','../../config/environment','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ff1d0,_0x15cbee){var _0x179357=function(_0x3117a8){while(--_0x3117a8){_0x4ff1d0['push'](_0x4ff1d0['shift']());}};_0x179357(++_0x15cbee);}(_0x3464,0x16e));var _0x4346=function(_0x766301,_0x3c0941){_0x766301=_0x766301-0x0;var _0x42148a=_0x3464[_0x766301];return _0x42148a;};'use strict';var _=require(_0x4346('0x0'));var util=require(_0x4346('0x1'));var moment=require(_0x4346('0x2'));var BPromise=require(_0x4346('0x3'));var rs=require(_0x4346('0x4'));var fs=require('fs');var Redis=require(_0x4346('0x5'));var db=require(_0x4346('0x6'))['db'];var utils=require(_0x4346('0x7'));var logger=require(_0x4346('0x8'))(_0x4346('0x9'));var config=require(_0x4346('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4346('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x243c58,_0x367718,_0x1d06d4){return new BPromise(function(_0x2e2f80,_0x4fc76a){return client[_0x4346('0xc')](_0x243c58,_0x1d06d4)[_0x4346('0xd')](function(_0x3114fe){logger[_0x4346('0xe')](_0x4346('0xf'),_0x367718,_0x4346('0x10'));logger['debug'](_0x4346('0x11'),_0x367718,_0x4346('0x10'),JSON['stringify'](_0x3114fe));if(_0x3114fe[_0x4346('0x12')]){if(_0x3114fe[_0x4346('0x12')][_0x4346('0x13')]===0x1f4){logger[_0x4346('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x367718,_0x3114fe['error'][_0x4346('0x14')]);return _0x4fc76a(_0x3114fe[_0x4346('0x12')][_0x4346('0x14')]);}logger[_0x4346('0x12')](_0x4346('0xf'),_0x367718,_0x3114fe[_0x4346('0x12')][_0x4346('0x14')]);return _0x2e2f80(_0x3114fe[_0x4346('0x12')][_0x4346('0x14')]);}else{logger[_0x4346('0xe')](_0x4346('0xf'),_0x367718,_0x4346('0x10'));_0x2e2f80(_0x3114fe[_0x4346('0x15')]['message']);}})['catch'](function(_0x151ab7){logger[_0x4346('0x12')](_0x4346('0xf'),_0x367718,_0x151ab7);_0x4fc76a(_0x151ab7);});});}
\ No newline at end of file
index b6e2c6a..7c352b3 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(_0x147acf,_0x12ca4a){var _0x37bac8=function(_0xf33e38){while(--_0xf33e38){_0x147acf['push'](_0x147acf['shift']());}};_0x37bac8(++_0x12ca4a);}(_0x70e0,0x17b));var _0x070e=function(_0x1f21d7,_0x371b2e){_0x1f21d7=_0x1f21d7-0x0;var _0x38f877=_0x70e0[_0x1f21d7];return _0x38f877;};'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(_0x25ac4d,_0x5668a2){var _0x3f288d=function(_0x3c1a6a){while(--_0x3c1a6a){_0x25ac4d['push'](_0x25ac4d['shift']());}};_0x3f288d(++_0x5668a2);}(_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 a1800c7..375b571 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b33=['exports','sequelize'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7b33,0x157));var _0x37b3=function(_0x3e0d2a,_0xd52596){_0x3e0d2a=_0x3e0d2a-0x0;var _0xb2ed7a=_0x7b33[_0x3e0d2a];return _0xb2ed7a;};'use strict';var Sequelize=require(_0x37b3('0x0'));module[_0x37b3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc734=['sequelize','exports','INTEGER'];(function(_0x156721,_0x4ed0fe){var _0x2c7812=function(_0x21e8ad){while(--_0x21e8ad){_0x156721['push'](_0x156721['shift']());}};_0x2c7812(++_0x4ed0fe);}(_0xc734,0x108));var _0x4c73=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xc734[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x4c73('0x0'));module[_0x4c73('0x1')]={'penalty':{'type':Sequelize[_0x4c73('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 7542ebd..5975c74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ec2=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','user_has_sms_queues'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0x6ec2,0x78));var _0x26ec=function(_0x116818,_0x380122){_0x116818=_0x116818-0x0;var _0x98908b=_0x6ec2[_0x116818];return _0x98908b;};'use strict';var _=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var logger=require(_0x26ec('0x2'))(_0x26ec('0x3'));var moment=require(_0x26ec('0x4'));var BPromise=require(_0x26ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x26ec('0x6'));var rimraf=require(_0x26ec('0x7'));var config=require(_0x26ec('0x8'));var attributes=require(_0x26ec('0x9'));module[_0x26ec('0xa')]=function(_0x4ce209,_0x3b5955){return _0x4ce209['define']('UserSmsQueue',attributes,{'tableName':_0x26ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x524e=['define','UserSmsQueue','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x33c562,_0x54f29c){var _0x4199e3=function(_0x433e55){while(--_0x433e55){_0x33c562['push'](_0x33c562['shift']());}};_0x4199e3(++_0x54f29c);}(_0x524e,0x15e));var _0xe524=function(_0x4c118c,_0x3e4858){_0x4c118c=_0x4c118c-0x0;var _0x4c0f64=_0x524e[_0x4c118c];return _0x4c0f64;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 12f9f0c..3ce4193 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x895f=['then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x36bbe8,_0x45040f){var _0x261edd=function(_0x5377b8){while(--_0x5377b8){_0x36bbe8['push'](_0x36bbe8['shift']());}};_0x261edd(++_0x45040f);}(_0x895f,0x174));var _0xf895=function(_0x483ecf,_0x20bab7){_0x483ecf=_0x483ecf-0x0;var _0x41ea13=_0x895f[_0x483ecf];return _0x41ea13;};'use strict';var _=require(_0xf895('0x0'));var util=require(_0xf895('0x1'));var moment=require('moment');var BPromise=require(_0xf895('0x2'));var rs=require(_0xf895('0x3'));var fs=require('fs');var Redis=require(_0xf895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf895('0x5'));var logger=require(_0xf895('0x6'))(_0xf895('0x7'));var config=require(_0xf895('0x8'));var jayson=require(_0xf895('0x9'));var client=jayson[_0xf895('0xa')][_0xf895('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1387c1,_0x2fd10,_0x887030){return new BPromise(function(_0x249222,_0x1f7cdf){return client['request'](_0x1387c1,_0x887030)[_0xf895('0xc')](function(_0xb6984c){logger[_0xf895('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x2fd10,_0xf895('0xe'));logger[_0xf895('0xf')](_0xf895('0x10'),_0x2fd10,_0xf895('0xe'),JSON[_0xf895('0x11')](_0xb6984c));if(_0xb6984c[_0xf895('0x12')]){if(_0xb6984c[_0xf895('0x12')][_0xf895('0x13')]===0x1f4){logger[_0xf895('0x12')](_0xf895('0x14'),_0x2fd10,_0xb6984c['error'][_0xf895('0x15')]);return _0x1f7cdf(_0xb6984c[_0xf895('0x12')][_0xf895('0x15')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x2fd10,_0xb6984c[_0xf895('0x12')]['message']);return _0x249222(_0xb6984c[_0xf895('0x12')][_0xf895('0x15')]);}else{logger[_0xf895('0xd')](_0xf895('0x14'),_0x2fd10,'request\x20sent');_0x249222(_0xb6984c[_0xf895('0x16')][_0xf895('0x15')]);}})[_0xf895('0x17')](function(_0xf850b6){logger[_0xf895('0x12')](_0xf895('0x14'),_0x2fd10,_0xf850b6);_0x1f7cdf(_0xf850b6);});});}
\ No newline at end of file
+var _0xd80e=['client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','rpc','../../config/environment','jayson/promise'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0xd80e,0x17c));var _0xed80=function(_0x34513c,_0x855411){_0x34513c=_0x34513c-0x0;var _0x1e1c53=_0xd80e[_0x34513c];return _0x1e1c53;};'use strict';var _=require('lodash');var util=require(_0xed80('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xed80('0x1'));var config=require(_0xed80('0x2'));var jayson=require(_0xed80('0x3'));var client=jayson[_0xed80('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x418287,_0x43fd5c,_0x27b41b){return new BPromise(function(_0x45f835,_0x5ac80a){return client[_0xed80('0x5')](_0x418287,_0x27b41b)[_0xed80('0x6')](function(_0x2564d9){logger[_0xed80('0x7')](_0xed80('0x8'),_0x43fd5c,_0xed80('0x9'));logger[_0xed80('0xa')](_0xed80('0xb'),_0x43fd5c,_0xed80('0x9'),JSON['stringify'](_0x2564d9));if(_0x2564d9[_0xed80('0xc')]){if(_0x2564d9['error'][_0xed80('0xd')]===0x1f4){logger[_0xed80('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x43fd5c,_0x2564d9[_0xed80('0xc')][_0xed80('0xe')]);return _0x5ac80a(_0x2564d9[_0xed80('0xc')][_0xed80('0xe')]);}logger[_0xed80('0xc')](_0xed80('0x8'),_0x43fd5c,_0x2564d9[_0xed80('0xc')][_0xed80('0xe')]);return _0x45f835(_0x2564d9[_0xed80('0xc')]['message']);}else{logger[_0xed80('0x7')]('UserSmsQueue,\x20%s,\x20%s',_0x43fd5c,_0xed80('0x9'));_0x45f835(_0x2564d9['result'][_0xed80('0xe')]);}})[_0xed80('0xf')](function(_0x133c40){logger['error'](_0xed80('0x8'),_0x43fd5c,_0x133c40);_0x5ac80a(_0x133c40);});});}
\ No newline at end of file
index c631265..eee2562 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20f7=['sequelize','exports','INTEGER'];(function(_0xdd5454,_0x5b570a){var _0x4f2225=function(_0x4bddeb){while(--_0x4bddeb){_0xdd5454['push'](_0xdd5454['shift']());}};_0x4f2225(++_0x5b570a);}(_0x20f7,0xf6));var _0x720f=function(_0x401ecb,_0x506ab7){_0x401ecb=_0x401ecb-0x0;var _0x543363=_0x20f7[_0x401ecb];return _0x543363;};'use strict';var Sequelize=require(_0x720f('0x0'));module[_0x720f('0x1')]={'UserId':{'type':Sequelize[_0x720f('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x720f('0x2')]}};
\ No newline at end of file
+var _0xa0cc=['sequelize','exports','INTEGER'];(function(_0x4c4bbe,_0x1a007e){var _0x2f90ad=function(_0x4d390f){while(--_0x4d390f){_0x4c4bbe['push'](_0x4c4bbe['shift']());}};_0x2f90ad(++_0x1a007e);}(_0xa0cc,0x12c));var _0xca0c=function(_0x4828c7,_0x105919){_0x4828c7=_0x4828c7-0x0;var _0xab22c7=_0xa0cc[_0x4828c7];return _0xab22c7;};'use strict';var Sequelize=require(_0xca0c('0x0'));module[_0xca0c('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xca0c('0x2')]}};
\ No newline at end of file
index d23cc6b..c71c4bd 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(_0x5e7687,_0x367ea6){var _0x2ede95=function(_0x16e002){while(--_0x16e002){_0x5e7687['push'](_0x5e7687['shift']());}};_0x2ede95(++_0x367ea6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var 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(_0x3c7fe8,_0x41bc3f){var _0xbf3df4=function(_0x408a11){while(--_0x408a11){_0x3c7fe8['push'](_0x3c7fe8['shift']());}};_0xbf3df4(++_0x41bc3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 5f0e1a4..aa34c6f 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(_0x5ac94d,_0x5d3a8c){var _0x563863=function(_0x39285d){while(--_0x39285d){_0x5ac94d['push'](_0x5ac94d['shift']());}};_0x563863(++_0x5d3a8c);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1e0ebe,_0x1a611a){var _0x8c4f84=function(_0x4aa974){while(--_0x4aa974){_0x1e0ebe['push'](_0x1e0ebe['shift']());}};_0x8c4f84(++_0x1a611a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0xcb91[_0x4164f2];return _0x2575c7;};'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 338531a..6e8b29e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1766=['sequelize','exports','INTEGER'];(function(_0x4f8c62,_0x6b366f){var _0x9b0e38=function(_0x3adc3b){while(--_0x3adc3b){_0x4f8c62['push'](_0x4f8c62['shift']());}};_0x9b0e38(++_0x6b366f);}(_0x1766,0xcc));var _0x6176=function(_0x5c4e0d,_0x3f49a2){_0x5c4e0d=_0x5c4e0d-0x0;var _0x183ecc=_0x1766[_0x5c4e0d];return _0x183ecc;};'use strict';var Sequelize=require(_0x6176('0x0'));module[_0x6176('0x1')]={'penalty':{'type':Sequelize[_0x6176('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x35c8=['INTEGER','sequelize','exports'];(function(_0x17ec93,_0x2e35c0){var _0x33ee69=function(_0x2566ee){while(--_0x2566ee){_0x17ec93['push'](_0x17ec93['shift']());}};_0x33ee69(++_0x2e35c0);}(_0x35c8,0xa6));var _0x835c=function(_0x50eada,_0x263c50){_0x50eada=_0x50eada-0x0;var _0xe0e2c7=_0x35c8[_0x50eada];return _0xe0e2c7;};'use strict';var Sequelize=require(_0x835c('0x0'));module[_0x835c('0x1')]={'penalty':{'type':Sequelize[_0x835c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index c48cf02..f4391e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77de=['define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','path','rimraf','./userVoiceQueue.attributes','exports'];(function(_0x10aa70,_0x51ab86){var _0x3476b7=function(_0x1b6ed5){while(--_0x1b6ed5){_0x10aa70['push'](_0x10aa70['shift']());}};_0x3476b7(++_0x51ab86);}(_0x77de,0xb3));var _0xe77d=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0x77de[_0x4b9dc9];return _0x57b302;};'use strict';var _=require(_0xe77d('0x0'));var util=require(_0xe77d('0x1'));var logger=require(_0xe77d('0x2'))('api');var moment=require(_0xe77d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe77d('0x4'));var rimraf=require(_0xe77d('0x5'));var config=require('../../config/environment');var attributes=require(_0xe77d('0x6'));module[_0xe77d('0x7')]=function(_0x29af40,_0x2d3c15){return _0x29af40[_0xe77d('0x8')](_0xe77d('0x9'),attributes,{'tableName':_0xe77d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf460=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x3b599d,_0x21475d){var _0x43be0a=function(_0x1bc24f){while(--_0x1bc24f){_0x3b599d['push'](_0x3b599d['shift']());}};_0x43be0a(++_0x21475d);}(_0xf460,0x15d));var _0x0f46=function(_0x316993,_0x2335db){_0x316993=_0x316993-0x0;var _0xff1d54=_0xf460[_0x316993];return _0xff1d54;};'use strict';var _=require(_0x0f46('0x0'));var util=require('util');var logger=require(_0x0f46('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0f46('0x2'));var rp=require(_0x0f46('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f46('0x4'));var config=require(_0x0f46('0x5'));var attributes=require(_0x0f46('0x6'));module[_0x0f46('0x7')]=function(_0x365754,_0x283087){return _0x365754['define'](_0x0f46('0x8'),attributes,{'tableName':_0x0f46('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5e883d2..365fc4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93f5=['message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x2cda8f,_0x3eec8e){var _0x4d9c41=function(_0x1e1542){while(--_0x1e1542){_0x2cda8f['push'](_0x2cda8f['shift']());}};_0x4d9c41(++_0x3eec8e);}(_0x93f5,0x7a));var _0x593f=function(_0x42e022,_0x2f50be){_0x42e022=_0x42e022-0x0;var _0x135e00=_0x93f5[_0x42e022];return _0x135e00;};'use strict';var _=require(_0x593f('0x0'));var util=require(_0x593f('0x1'));var moment=require(_0x593f('0x2'));var BPromise=require('bluebird');var rs=require(_0x593f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x593f('0x4'))['db'];var utils=require(_0x593f('0x5'));var logger=require(_0x593f('0x6'))(_0x593f('0x7'));var config=require(_0x593f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x593f('0x9')][_0x593f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b55e1,_0x2fd16f,_0x371eaf){return new BPromise(function(_0x263b5d,_0x20c2dd){return client['request'](_0x5b55e1,_0x371eaf)[_0x593f('0xb')](function(_0x12c2b7){logger[_0x593f('0xc')](_0x593f('0xd'),_0x2fd16f,_0x593f('0xe'));logger[_0x593f('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2fd16f,_0x593f('0xe'),JSON['stringify'](_0x12c2b7));if(_0x12c2b7[_0x593f('0x10')]){if(_0x12c2b7[_0x593f('0x10')][_0x593f('0x11')]===0x1f4){logger[_0x593f('0x10')](_0x593f('0xd'),_0x2fd16f,_0x12c2b7[_0x593f('0x10')][_0x593f('0x12')]);return _0x20c2dd(_0x12c2b7[_0x593f('0x10')][_0x593f('0x12')]);}logger[_0x593f('0x10')](_0x593f('0xd'),_0x2fd16f,_0x12c2b7['error'][_0x593f('0x12')]);return _0x263b5d(_0x12c2b7['error'][_0x593f('0x12')]);}else{logger[_0x593f('0xc')](_0x593f('0xd'),_0x2fd16f,_0x593f('0xe'));_0x263b5d(_0x12c2b7['result'][_0x593f('0x12')]);}})[_0x593f('0x13')](function(_0x51f6db){logger[_0x593f('0x10')](_0x593f('0xd'),_0x2fd16f,_0x51f6db);_0x20c2dd(_0x51f6db);});});}
\ No newline at end of file
+var _0x4b80=['catch','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','request','then','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result'];(function(_0x56e99b,_0x3b586d){var _0x24c200=function(_0x2f90d7){while(--_0x2f90d7){_0x56e99b['push'](_0x56e99b['shift']());}};_0x24c200(++_0x3b586d);}(_0x4b80,0x7f));var _0x04b8=function(_0xd89945,_0x480eae){_0xd89945=_0xd89945-0x0;var _0x4488f1=_0x4b80[_0xd89945];return _0x4488f1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x04b8('0x0'));var BPromise=require('bluebird');var rs=require(_0x04b8('0x1'));var fs=require('fs');var Redis=require(_0x04b8('0x2'));var db=require(_0x04b8('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04b8('0x4'));var jayson=require(_0x04b8('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5feb,_0x19bbae,_0x168c34){return new BPromise(function(_0x34fe98,_0x1e5876){return client[_0x04b8('0x6')](_0x1c5feb,_0x168c34)[_0x04b8('0x7')](function(_0x59ed29){logger[_0x04b8('0x8')]('UserVoiceQueue,\x20%s,\x20%s',_0x19bbae,'request\x20sent');logger[_0x04b8('0x9')](_0x04b8('0xa'),_0x19bbae,_0x04b8('0xb'),JSON['stringify'](_0x59ed29));if(_0x59ed29[_0x04b8('0xc')]){if(_0x59ed29['error'][_0x04b8('0xd')]===0x1f4){logger[_0x04b8('0xc')](_0x04b8('0xe'),_0x19bbae,_0x59ed29[_0x04b8('0xc')][_0x04b8('0xf')]);return _0x1e5876(_0x59ed29[_0x04b8('0xc')][_0x04b8('0xf')]);}logger[_0x04b8('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x19bbae,_0x59ed29[_0x04b8('0xc')][_0x04b8('0xf')]);return _0x34fe98(_0x59ed29[_0x04b8('0xc')][_0x04b8('0xf')]);}else{logger[_0x04b8('0x8')](_0x04b8('0xe'),_0x19bbae,'request\x20sent');_0x34fe98(_0x59ed29[_0x04b8('0x10')][_0x04b8('0xf')]);}})[_0x04b8('0x11')](function(_0x2e9c37){logger[_0x04b8('0xc')](_0x04b8('0xe'),_0x19bbae,_0x2e9c37);_0x1e5876(_0x2e9c37);});});}
\ No newline at end of file
index c655d9b..175acfc 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(_0x1b207e,_0x351aa0){var _0xc1b68=function(_0x168f76){while(--_0x168f76){_0x1b207e['push'](_0x1b207e['shift']());}};_0xc1b68(++_0x351aa0);}(_0xe706,0xa3));var _0x6e70=function(_0x5da54c,_0x520452){_0x5da54c=_0x5da54c-0x0;var _0x1246b0=_0xe706[_0x5da54c];return _0x1246b0;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x22a866,_0xfe7c94){var _0xd1545a=function(_0x63862d){while(--_0x63862d){_0x22a866['push'](_0x22a866['shift']());}};_0xd1545a(++_0xfe7c94);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index bc83ba6..7b748d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f81=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x54ac2d,_0x52b131){var _0x54b410=function(_0xc7c8cb){while(--_0xc7c8cb){_0x54ac2d['push'](_0x54ac2d['shift']());}};_0x54b410(++_0x52b131);}(_0x7f81,0x185));var _0x17f8=function(_0x5a0b97,_0x2b8f34){_0x5a0b97=_0x5a0b97-0x0;var _0x1ff2a8=_0x7f81[_0x5a0b97];return _0x1ff2a8;};'use strict';var Sequelize=require(_0x17f8('0x0'));module[_0x17f8('0x1')]={'uniqueid':{'type':Sequelize[_0x17f8('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x17f8('0x3')},'membername':{'type':Sequelize[_0x17f8('0x4')],'allowNull':![],'comment':_0x17f8('0x3')},'UserId':{'type':Sequelize[_0x17f8('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x17f8('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x17f8('0x3')},'VoiceQueueId':{'type':Sequelize[_0x17f8('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x17f8('0x4')],'allowNull':![],'unique':_0x17f8('0x5'),'comment':_0x17f8('0x3')},'penalty':{'type':Sequelize[_0x17f8('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x17f8('0x2')](0xb),'defaultValue':0x0,'comment':_0x17f8('0x3')}};
\ No newline at end of file
+var _0xcf3c=['sequelize','INTEGER','STRING','queue_interface','Required\x20by\x20Asterisk'];(function(_0x556634,_0x520958){var _0x4429fd=function(_0x1e7eb9){while(--_0x1e7eb9){_0x556634['push'](_0x556634['shift']());}};_0x4429fd(++_0x520958);}(_0xcf3c,0x168));var _0xccf3=function(_0x214829,_0x4fcfd2){_0x214829=_0x214829-0x0;var _0x267a09=_0xcf3c[_0x214829];return _0x267a09;};'use strict';var Sequelize=require(_0xccf3('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xccf3('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xccf3('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xccf3('0x2')],'allowNull':![],'unique':_0xccf3('0x3'),'comment':_0xccf3('0x4')},'VoiceQueueId':{'type':Sequelize[_0xccf3('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xccf3('0x2')],'allowNull':![],'unique':_0xccf3('0x3'),'comment':_0xccf3('0x4')},'penalty':{'type':Sequelize[_0xccf3('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xccf3('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
index e3de1ec..a4aa46a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe22f=['save','update','remove','emit','hasOwnProperty','hook','events','UserVoiceQueueRt','setMaxListeners'];(function(_0x1e54a7,_0x4e7ea3){var _0x41d78e=function(_0xbf0801){while(--_0xbf0801){_0x1e54a7['push'](_0x1e54a7['shift']());}};_0x41d78e(++_0x4e7ea3);}(_0xe22f,0xd5));var _0xfe22=function(_0x2b70b4,_0x563f4e){_0x2b70b4=_0x2b70b4-0x0;var _0x333ea3=_0xe22f[_0x2b70b4];return _0x333ea3;};'use strict';var EventEmitter=require(_0xfe22('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xfe22('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xfe22('0x2')](0x0);var events={'afterCreate':_0xfe22('0x3'),'afterUpdate':_0xfe22('0x4'),'afterDestroy':_0xfe22('0x5')};function emitEvent(_0x137a2e){return function(_0x1af21b,_0x5993c0,_0x76ca5){UserVoiceQueueRtEvents[_0xfe22('0x6')](_0x137a2e+':'+_0x1af21b['id'],_0x1af21b);UserVoiceQueueRtEvents['emit'](_0x137a2e,_0x1af21b);_0x76ca5(null);};}for(var e in events){if(events[_0xfe22('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xfe22('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xf2fd=['exports','events','../../mysqldb','UserVoiceQueueRt','save','hook'];(function(_0x510bd8,_0x46c1e6){var _0xcd6e09=function(_0x4adabe){while(--_0x4adabe){_0x510bd8['push'](_0x510bd8['shift']());}};_0xcd6e09(++_0x46c1e6);}(_0xf2fd,0x15d));var _0xdf2f=function(_0x587128,_0x57c646){_0x587128=_0x587128-0x0;var _0x15307d=_0xf2fd[_0x587128];return _0x15307d;};'use strict';var EventEmitter=require(_0xdf2f('0x0'));var UserVoiceQueueRt=require(_0xdf2f('0x1'))['db'][_0xdf2f('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdf2f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5600e6){return function(_0x5c414a,_0x5aed67,_0x27bb2){UserVoiceQueueRtEvents['emit'](_0x5600e6+':'+_0x5c414a['id'],_0x5c414a);UserVoiceQueueRtEvents['emit'](_0x5600e6,_0x5c414a);_0x27bb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xdf2f('0x4')](e,emitEvent(event));}}module[_0xdf2f('0x5')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 7f3d9b5..4421cd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa28b=['../../config/environment','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3cb773,_0x3ba3b7){var _0x520be6=function(_0x5c8659){while(--_0x5c8659){_0x3cb773['push'](_0x3cb773['shift']());}};_0x520be6(++_0x3ba3b7);}(_0xa28b,0x79));var _0xba28=function(_0x406d68,_0x39f3ee){_0x406d68=_0x406d68-0x0;var _0x321efe=_0xa28b[_0x406d68];return _0x321efe;};'use strict';var _=require(_0xba28('0x0'));var util=require(_0xba28('0x1'));var logger=require(_0xba28('0x2'))('api');var moment=require(_0xba28('0x3'));var BPromise=require(_0xba28('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xba28('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xba28('0x6')]=function(_0x429800,_0x2df348){return _0x429800[_0xba28('0x7')]('UserVoiceQueueRt',attributes,{'tableName':_0xba28('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fff=['define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','bluebird','request-promise','path','rimraf','./userVoiceQueueRt.attributes'];(function(_0x18979a,_0x4bb943){var _0x4977cc=function(_0x40c24b){while(--_0x40c24b){_0x18979a['push'](_0x18979a['shift']());}};_0x4977cc(++_0x4bb943);}(_0x3fff,0xbe));var _0xf3ff=function(_0x258e20,_0x493043){_0x258e20=_0x258e20-0x0;var _0x154da1=_0x3fff[_0x258e20];return _0x154da1;};'use strict';var _=require(_0xf3ff('0x0'));var util=require(_0xf3ff('0x1'));var logger=require('../../config/logger')(_0xf3ff('0x2'));var moment=require('moment');var BPromise=require(_0xf3ff('0x3'));var rp=require(_0xf3ff('0x4'));var fs=require('fs');var path=require(_0xf3ff('0x5'));var rimraf=require(_0xf3ff('0x6'));var config=require('../../config/environment');var attributes=require(_0xf3ff('0x7'));module['exports']=function(_0x363d75,_0x53331f){return _0x363d75[_0xf3ff('0x8')](_0xf3ff('0x9'),attributes,{'tableName':_0xf3ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d9a73dc..bf1e53c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6629=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','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','stringify','error','code','message','result','catch','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','outboundQueuePauses','GetVoiceQueueRtPauses','util','moment','bluebird'];(function(_0x56b567,_0x1751cb){var _0x5c7764=function(_0x47ce69){while(--_0x47ce69){_0x56b567['push'](_0x56b567['shift']());}};_0x5c7764(++_0x1751cb);}(_0x6629,0x6c));var _0x9662=function(_0x4c92d1,_0x2aad7f){_0x4c92d1=_0x4c92d1-0x0;var _0x1fd0c8=_0x6629[_0x4c92d1];return _0x1fd0c8;};'use strict';var _=require('lodash');var util=require(_0x9662('0x0'));var moment=require(_0x9662('0x1'));var BPromise=require(_0x9662('0x2'));var rs=require(_0x9662('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9662('0x4'))['db'];var utils=require(_0x9662('0x5'));var logger=require(_0x9662('0x6'))(_0x9662('0x7'));var config=require(_0x9662('0x8'));var jayson=require(_0x9662('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9662('0xa')]=_[_0x9662('0xb')](config[_0x9662('0xa')],{'host':_0x9662('0xc'),'port':0x18eb});var socket=require(_0x9662('0xd'))(new Redis(config['redis']));require(_0x9662('0xe'))[_0x9662('0xf')](socket);function respondWithRpcPromise(_0x828fc5,_0x560481,_0x4a8509){return new BPromise(function(_0x44ca82,_0x2dfe00){return client[_0x9662('0x10')](_0x828fc5,_0x4a8509)[_0x9662('0x11')](function(_0x320bba){logger[_0x9662('0x12')](_0x9662('0x13'),_0x560481,_0x9662('0x14'));logger[_0x9662('0x15')](_0x9662('0x16'),_0x560481,_0x9662('0x14'),JSON[_0x9662('0x17')](_0x320bba));if(_0x320bba[_0x9662('0x18')]){if(_0x320bba[_0x9662('0x18')][_0x9662('0x19')]===0x1f4){logger[_0x9662('0x18')](_0x9662('0x13'),_0x560481,_0x320bba[_0x9662('0x18')][_0x9662('0x1a')]);return _0x2dfe00(_0x320bba['error'][_0x9662('0x1a')]);}logger['error'](_0x9662('0x13'),_0x560481,_0x320bba['error'][_0x9662('0x1a')]);return _0x44ca82(_0x320bba['error'][_0x9662('0x1a')]);}else{logger[_0x9662('0x12')](_0x9662('0x13'),_0x560481,_0x9662('0x14'));_0x44ca82(_0x320bba[_0x9662('0x1b')]['message']);}})[_0x9662('0x1c')](function(_0x1a64d){logger['error'](_0x9662('0x13'),_0x560481,_0x1a64d);_0x2dfe00(_0x1a64d);});});}exports['GetVoiceQueueRtPauses']=function(_0x204be6){var _0x297db2=this;return new Promise(function(_0x3d8e5f,_0x191994){return db[_0x9662('0x1d')]['findAll']({'raw':_0x204be6['options']?_0x204be6[_0x9662('0x1e')][_0x9662('0x1f')]===undefined?!![]:![]:!![],'where':_0x204be6[_0x9662('0x1e')]?_0x204be6[_0x9662('0x1e')][_0x9662('0x20')]||null:null,'attributes':[[db[_0x9662('0x21')]['fn'](_0x9662('0x22'),db['sequelize']['fn']('IF',db[_0x9662('0x21')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x9662('0x23')]]})[_0x9662('0x11')](function(_0x4e1718){logger[_0x9662('0x12')](_0x9662('0x24'),_0x204be6);logger[_0x9662('0x15')](_0x9662('0x24'),_0x204be6,JSON[_0x9662('0x17')](_0x4e1718));_0x3d8e5f(_0x4e1718);})[_0x9662('0x1c')](function(_0x517a22){logger[_0x9662('0x18')](_0x9662('0x24'),_0x517a22[_0x9662('0x1a')],_0x204be6);_0x191994(_0x297db2[_0x9662('0x18')](0x1f4,_0x517a22[_0x9662('0x1a')]));});});};
\ No newline at end of file
+var _0x68ac=['GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','literal','outboundQueuePauses','then','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','info','debug','request\x20sent','stringify','UserVoiceQueueRt,\x20%s,\x20%s','error','message','result'];(function(_0x47b7b0,_0x52024a){var _0xc012c9=function(_0x3bc610){while(--_0x3bc610){_0x47b7b0['push'](_0x47b7b0['shift']());}};_0xc012c9(++_0x52024a);}(_0x68ac,0x182));var _0xc68a=function(_0x458726,_0xaa8ff7){_0x458726=_0x458726-0x0;var _0x1b3f22=_0x68ac[_0x458726];return _0x1b3f22;};'use strict';var _=require(_0xc68a('0x0'));var util=require('util');var moment=require(_0xc68a('0x1'));var BPromise=require(_0xc68a('0x2'));var rs=require(_0xc68a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc68a('0x4'))['db'];var utils=require(_0xc68a('0x5'));var logger=require('../../config/logger')(_0xc68a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc68a('0x7')][_0xc68a('0x8')]({'port':0x232a});config[_0xc68a('0x9')]=_[_0xc68a('0xa')](config[_0xc68a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc68a('0xb'))(new Redis(config[_0xc68a('0x9')]));require(_0xc68a('0xc'))[_0xc68a('0xd')](socket);function respondWithRpcPromise(_0x2308b4,_0x291449,_0xa0a5e9){return new BPromise(function(_0x2dac2f,_0x13871e){return client['request'](_0x2308b4,_0xa0a5e9)['then'](function(_0x3bdec7){logger[_0xc68a('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x291449,'request\x20sent');logger[_0xc68a('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x291449,_0xc68a('0x10'),JSON[_0xc68a('0x11')](_0x3bdec7));if(_0x3bdec7['error']){if(_0x3bdec7['error']['code']===0x1f4){logger['error'](_0xc68a('0x12'),_0x291449,_0x3bdec7[_0xc68a('0x13')][_0xc68a('0x14')]);return _0x13871e(_0x3bdec7['error'][_0xc68a('0x14')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x291449,_0x3bdec7['error']['message']);return _0x2dac2f(_0x3bdec7[_0xc68a('0x13')][_0xc68a('0x14')]);}else{logger[_0xc68a('0xe')](_0xc68a('0x12'),_0x291449,'request\x20sent');_0x2dac2f(_0x3bdec7[_0xc68a('0x15')][_0xc68a('0x14')]);}})['catch'](function(_0x50cd31){logger[_0xc68a('0x13')](_0xc68a('0x12'),_0x291449,_0x50cd31);_0x13871e(_0x50cd31);});});}exports[_0xc68a('0x16')]=function(_0x3481fc){var _0x2ee3d3=this;return new Promise(function(_0x2891a2,_0x455125){return db[_0xc68a('0x17')][_0xc68a('0x18')]({'raw':_0x3481fc[_0xc68a('0x19')]?_0x3481fc['options'][_0xc68a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3481fc[_0xc68a('0x19')]?_0x3481fc[_0xc68a('0x19')][_0xc68a('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0xc68a('0x1c'),db[_0xc68a('0x1d')]['fn']('IF',db[_0xc68a('0x1d')][_0xc68a('0x1e')]('`paused`\x20=\x201,\x201,\x20null'))),_0xc68a('0x1f')]]})[_0xc68a('0x20')](function(_0x15418a){logger[_0xc68a('0xe')]('GetVoiceQueueRtPauses',_0x3481fc);logger['debug'](_0xc68a('0x16'),_0x3481fc,JSON[_0xc68a('0x11')](_0x15418a));_0x2891a2(_0x15418a);})[_0xc68a('0x21')](function(_0x22f785){logger[_0xc68a('0x13')]('GetVoiceQueueRtPauses',_0x22f785[_0xc68a('0x14')],_0x3481fc);_0x455125(_0x2ee3d3[_0xc68a('0x13')](0x1f4,_0x22f785[_0xc68a('0x14')]));});});};
\ No newline at end of file
index 486c244..1ecf83c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1fc=['save','remove','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc1fc,0x93));var _0xcc1f=function(_0x577784,_0xed17c5){_0x577784=_0x577784-0x0;var _0xd60628=_0xc1fc[_0x577784];return _0xd60628;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xcc1f('0x0'),_0xcc1f('0x1'),'update'];function createListener(_0xe9fa4f,_0xcb1f19){return function(_0x35ef51){_0xcb1f19[_0xcc1f('0x2')](_0xe9fa4f,_0x35ef51);};}function removeListener(_0x26d3b2,_0x52703d){return function(){UserVoiceQueueRtEvents[_0xcc1f('0x3')](_0x26d3b2,_0x52703d);};}exports[_0xcc1f('0x4')]=function(_0x493a97){for(var _0x5f448b=0x0,_0x376348=events[_0xcc1f('0x5')];_0x5f448b<_0x376348;_0x5f448b++){var _0x431ca8=events[_0x5f448b];var _0x123b7d=createListener(_0xcc1f('0x6')+_0x431ca8,_0x493a97);UserVoiceQueueRtEvents['on'](_0x431ca8,_0x123b7d);}};
\ No newline at end of file
+var _0x0f4d=['update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x283ad0,_0x44790d){var _0x5542be=function(_0x2c3e0c){while(--_0x2c3e0c){_0x283ad0['push'](_0x283ad0['shift']());}};_0x5542be(++_0x44790d);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x236cfc,_0x195187){_0x236cfc=_0x236cfc-0x0;var _0x5332ea=_0x0f4d[_0x236cfc];return _0x5332ea;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save','remove',_0xd0f4('0x0')];function createListener(_0x5c8510,_0x20e395){return function(_0x2c06de){_0x20e395[_0xd0f4('0x1')](_0x5c8510,_0x2c06de);};}function removeListener(_0x347170,_0x1a9ba5){return function(){UserVoiceQueueRtEvents[_0xd0f4('0x2')](_0x347170,_0x1a9ba5);};}exports[_0xd0f4('0x3')]=function(_0x1d9a9d){for(var _0x531f85=0x0,_0x1164da=events[_0xd0f4('0x4')];_0x531f85<_0x1164da;_0x531f85++){var _0x4d0ab0=events[_0x531f85];var _0x3992be=createListener(_0xd0f4('0x5')+_0x4d0ab0,_0x1d9a9d);UserVoiceQueueRtEvents['on'](_0x4d0ab0,_0x3992be);}};
\ No newline at end of file
index b72df88..19e2953 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(_0x336a6e,_0x4c454f){var _0x4c0b21=function(_0x3590a0){while(--_0x3590a0){_0x336a6e['push'](_0x336a6e['shift']());}};_0x4c0b21(++_0x4c454f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x35b59c,_0x4972f2){var _0x468b49=function(_0x2cb799){while(--_0x2cb799){_0x35b59c['push'](_0x35b59c['shift']());}};_0x468b49(++_0x4972f2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0xcb91[_0x28a5ad];return _0x176b8a;};'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 3d0c76f..3742c45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfed=['exports','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfed,0xc5));var _0xddfe=function(_0x288325,_0x26e4ff){_0x288325=_0x288325-0x0;var _0x3b9fd7=_0xdfed[_0x288325];return _0x3b9fd7;};'use strict';var Sequelize=require(_0xddfe('0x0'));module[_0xddfe('0x1')]={'penalty':{'type':Sequelize[_0xddfe('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2068=['sequelize','exports'];(function(_0x34c227,_0x49733f){var _0x251ed1=function(_0x202225){while(--_0x202225){_0x34c227['push'](_0x34c227['shift']());}};_0x251ed1(++_0x49733f);}(_0x2068,0x6a));var _0x8206=function(_0xa8ec8f,_0x3eaefa){_0xa8ec8f=_0xa8ec8f-0x0;var _0xcd07ea=_0x2068[_0xa8ec8f];return _0xcd07ea;};'use strict';var Sequelize=require(_0x8206('0x0'));module[_0x8206('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index dfd65d1..79cac74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef7=['api','moment','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','lodash'];(function(_0x3fc10a,_0x56f3ea){var _0x1a133b=function(_0x2545a9){while(--_0x2545a9){_0x3fc10a['push'](_0x3fc10a['shift']());}};_0x1a133b(++_0x56f3ea);}(_0x8ef7,0x179));var _0x78ef=function(_0x49ad71,_0x68a76c){_0x49ad71=_0x49ad71-0x0;var _0xb4cc70=_0x8ef7[_0x49ad71];return _0xb4cc70;};'use strict';var _=require(_0x78ef('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x78ef('0x1'));var moment=require(_0x78ef('0x2'));var BPromise=require('bluebird');var rp=require(_0x78ef('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78ef('0x4'));var config=require(_0x78ef('0x5'));var attributes=require(_0x78ef('0x6'));module['exports']=function(_0x3ec100,_0x42848b){return _0x3ec100['define']('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x856c=['util','api','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x1e88eb,_0x4d031e){var _0x23fe01=function(_0x42f79c){while(--_0x42f79c){_0x1e88eb['push'](_0x1e88eb['shift']());}};_0x23fe01(++_0x4d031e);}(_0x856c,0xfc));var _0xc856=function(_0x1c8cec,_0x52992b){_0x1c8cec=_0x1c8cec-0x0;var _0x180989=_0x856c[_0x1c8cec];return _0x180989;};'use strict';var _=require(_0xc856('0x0'));var util=require(_0xc856('0x1'));var logger=require('../../config/logger')(_0xc856('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc856('0x3'));var fs=require('fs');var path=require(_0xc856('0x4'));var rimraf=require(_0xc856('0x5'));var config=require(_0xc856('0x6'));var attributes=require(_0xc856('0x7'));module[_0xc856('0x8')]=function(_0x2a5c0e,_0x50ebef){return _0x2a5c0e['define'](_0xc856('0x9'),attributes,{'tableName':_0xc856('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 79477dc..762d4b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa80e=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x51b90d,_0x4a2518){var _0x106a3e=function(_0x46f49e){while(--_0x46f49e){_0x51b90d['push'](_0x51b90d['shift']());}};_0x106a3e(++_0x4a2518);}(_0xa80e,0x8e));var _0xea80=function(_0x51363a,_0x25356a){_0x51363a=_0x51363a-0x0;var _0x154b34=_0xa80e[_0x51363a];return _0x154b34;};'use strict';var _=require('lodash');var util=require(_0xea80('0x0'));var moment=require(_0xea80('0x1'));var BPromise=require(_0xea80('0x2'));var rs=require(_0xea80('0x3'));var fs=require('fs');var Redis=require(_0xea80('0x4'));var db=require(_0xea80('0x5'))['db'];var utils=require(_0xea80('0x6'));var logger=require(_0xea80('0x7'))(_0xea80('0x8'));var config=require(_0xea80('0x9'));var jayson=require(_0xea80('0xa'));var client=jayson[_0xea80('0xb')][_0xea80('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ca884,_0x963672,_0x4954ff){return new BPromise(function(_0x1721c8,_0x55df7e){return client[_0xea80('0xd')](_0x2ca884,_0x4954ff)[_0xea80('0xe')](function(_0x428549){logger[_0xea80('0xf')](_0xea80('0x10'),_0x963672,_0xea80('0x11'));logger[_0xea80('0x12')](_0xea80('0x13'),_0x963672,_0xea80('0x11'),JSON[_0xea80('0x14')](_0x428549));if(_0x428549['error']){if(_0x428549[_0xea80('0x15')]['code']===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x963672,_0x428549[_0xea80('0x15')][_0xea80('0x16')]);return _0x55df7e(_0x428549[_0xea80('0x15')][_0xea80('0x16')]);}logger[_0xea80('0x15')](_0xea80('0x10'),_0x963672,_0x428549[_0xea80('0x15')][_0xea80('0x16')]);return _0x1721c8(_0x428549[_0xea80('0x15')]['message']);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x963672,_0xea80('0x11'));_0x1721c8(_0x428549[_0xea80('0x17')][_0xea80('0x16')]);}})[_0xea80('0x18')](function(_0x23628b){logger[_0xea80('0x15')](_0xea80('0x10'),_0x963672,_0x23628b);_0x55df7e(_0x23628b);});});}
\ No newline at end of file
+var _0xabc1=['UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x118297,_0x550c44){var _0x319255=function(_0x10ac18){while(--_0x10ac18){_0x118297['push'](_0x118297['shift']());}};_0x319255(++_0x550c44);}(_0xabc1,0xb2));var _0x1abc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xabc1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x1abc('0x0'));var moment=require(_0x1abc('0x1'));var BPromise=require(_0x1abc('0x2'));var rs=require(_0x1abc('0x3'));var fs=require('fs');var Redis=require(_0x1abc('0x4'));var db=require(_0x1abc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1abc('0x6'))(_0x1abc('0x7'));var config=require(_0x1abc('0x8'));var jayson=require(_0x1abc('0x9'));var client=jayson['client'][_0x1abc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3100c9,_0xcb8be8,_0x1380df){return new BPromise(function(_0xe30cff,_0x3882a4){return client[_0x1abc('0xb')](_0x3100c9,_0x1380df)[_0x1abc('0xc')](function(_0x38ce0f){logger[_0x1abc('0xd')](_0x1abc('0xe'),_0xcb8be8,'request\x20sent');logger[_0x1abc('0xf')](_0x1abc('0x10'),_0xcb8be8,_0x1abc('0x11'),JSON[_0x1abc('0x12')](_0x38ce0f));if(_0x38ce0f[_0x1abc('0x13')]){if(_0x38ce0f['error'][_0x1abc('0x14')]===0x1f4){logger[_0x1abc('0x13')](_0x1abc('0xe'),_0xcb8be8,_0x38ce0f[_0x1abc('0x13')][_0x1abc('0x15')]);return _0x3882a4(_0x38ce0f[_0x1abc('0x13')][_0x1abc('0x15')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0xcb8be8,_0x38ce0f[_0x1abc('0x13')][_0x1abc('0x15')]);return _0xe30cff(_0x38ce0f[_0x1abc('0x13')][_0x1abc('0x15')]);}else{logger[_0x1abc('0xd')](_0x1abc('0xe'),_0xcb8be8,'request\x20sent');_0xe30cff(_0x38ce0f[_0x1abc('0x16')]['message']);}})[_0x1abc('0x17')](function(_0x54395f){logger['error'](_0x1abc('0xe'),_0xcb8be8,_0x54395f);_0x3882a4(_0x54395f);});});}
\ No newline at end of file
index 12229c7..e943933 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0xe14d,0x1ee));var _0xde14=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xe14d[_0x543084];return _0x306a57;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/:id',auth[_0xde14('0xa')](),controller[_0xde14('0xc')]);router[_0xde14('0xd')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0xf')](_0xde14('0x10'),auth[_0xde14('0xa')](),controller['update']);router[_0xde14('0x11')](_0xde14('0x10'),auth[_0xde14('0xa')](),controller[_0xde14('0x12')]);module[_0xde14('0x13')]=router;
\ No newline at end of file
+var _0x6c4b=['put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x6c4b,0x93));var _0xb6c4=function(_0x1e9e68,_0x4e7a67){_0x1e9e68=_0x1e9e68-0x0;var _0x1180c8=_0x6c4b[_0x1e9e68];return _0x1180c8;};'use strict';var multer=require(_0xb6c4('0x0'));var util=require(_0xb6c4('0x1'));var path=require(_0xb6c4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb6c4('0x3'));var router=express[_0xb6c4('0x4')]();var fs_extra=require(_0xb6c4('0x5'));var auth=require(_0xb6c4('0x6'));var interaction=require(_0xb6c4('0x7'));var config=require(_0xb6c4('0x8'));var controller=require('./variable.controller');router['get']('/',auth[_0xb6c4('0x9')](),controller['index']);router[_0xb6c4('0xa')](_0xb6c4('0xb'),auth['isAuthenticated'](),controller[_0xb6c4('0xc')]);router[_0xb6c4('0xd')]('/',auth[_0xb6c4('0x9')](),controller[_0xb6c4('0xe')]);router[_0xb6c4('0xf')](_0xb6c4('0xb'),auth[_0xb6c4('0x9')](),controller['update']);router[_0xb6c4('0x10')](_0xb6c4('0xb'),auth[_0xb6c4('0x9')](),controller[_0xb6c4('0x11')]);module['exports']=router;
\ No newline at end of file
index 39b7ba8..cf0072e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x976e=['exports','name','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x976e,0x1a7));var _0xe976=function(_0x1f9b5e,_0x25e84b){_0x1f9b5e=_0x1f9b5e-0x0;var _0x4b3295=_0x976e[_0x1f9b5e];return _0x4b3295;};'use strict';var Sequelize=require('sequelize');module[_0xe976('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xe976('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe976('0x2')]}};
\ No newline at end of file
+var _0x2131=['name','STRING','sequelize','exports'];(function(_0x151321,_0x437d1a){var _0x152cb6=function(_0x1fd885){while(--_0x1fd885){_0x151321['push'](_0x151321['shift']());}};_0x152cb6(++_0x437d1a);}(_0x2131,0xee));var _0x1213=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x2131[_0x31a371];return _0x2a5bd6;};'use strict';var Sequelize=require(_0x1213('0x0'));module[_0x1213('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1213('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1213('0x3')]}};
\ No newline at end of file
index f88aa3a..f4decaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x595e=['key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Variables','UserProfileResource','destroy','name','send','index','Variable','rawAttributes','fieldName','type'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x595e,0x166));var _0xe595=function(_0x4bb928,_0x43d295){_0x4bb928=_0x4bb928-0x0;var _0x1e7cd4=_0x595e[_0x4bb928];return _0x1e7cd4;};'use strict';var emlformat=require(_0xe595('0x0'));var rimraf=require(_0xe595('0x1'));var zipdir=require(_0xe595('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe595('0x3'));var moment=require(_0xe595('0x4'));var BPromise=require(_0xe595('0x5'));var Mustache=require('mustache');var util=require(_0xe595('0x6'));var path=require(_0xe595('0x7'));var sox=require(_0xe595('0x8'));var csv=require(_0xe595('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe595('0xa'));var squel=require('squel');var crypto=require(_0xe595('0xb'));var jsforce=require(_0xe595('0xc'));var deskjs=require(_0xe595('0xd'));var toCsv=require(_0xe595('0x9'));var querystring=require('querystring');var Papa=require(_0xe595('0xe'));var Redis=require(_0xe595('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe595('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe595('0x11'));var logger=require(_0xe595('0x12'))(_0xe595('0x13'));var utils=require(_0xe595('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe595('0x15'));var db=require(_0xe595('0x16'))['db'];function respondWithStatusCode(_0xfab0d9,_0x1bbb8c){_0x1bbb8c=_0x1bbb8c||0xcc;return function(_0x112f26){if(_0x112f26){return _0xfab0d9[_0xe595('0x17')](_0x1bbb8c);}return _0xfab0d9['status'](_0x1bbb8c)['end']();};}function respondWithResult(_0x1329f6,_0x24ea59){_0x24ea59=_0x24ea59||0xc8;return function(_0x33c644){if(_0x33c644){return _0x1329f6[_0xe595('0x18')](_0x24ea59)['json'](_0x33c644);}};}function respondWithFilteredResult(_0x196133,_0x160cdc){return function(_0x33f17f){if(_0x33f17f){var _0x3979c5=typeof _0x160cdc[_0xe595('0x19')]===_0xe595('0x1a')&&typeof _0x160cdc[_0xe595('0x1b')]===_0xe595('0x1a');var _0x532ddf=_0x33f17f[_0xe595('0x1c')];var _0x4caff6=_0x3979c5?0x0:_0x160cdc[_0xe595('0x19')];var _0x557874=_0x3979c5?_0x33f17f[_0xe595('0x1c')]:_0x160cdc[_0xe595('0x19')]+_0x160cdc[_0xe595('0x1b')];var _0x174a7;if(_0x557874>=_0x532ddf){_0x557874=_0x532ddf;_0x174a7=0xc8;}else{_0x174a7=0xce;}_0x196133[_0xe595('0x18')](_0x174a7);return _0x196133[_0xe595('0x1d')](_0xe595('0x1e'),_0x4caff6+'-'+_0x557874+'/'+_0x532ddf)['json'](_0x33f17f);}return null;};}function patchUpdates(_0x544d56){return function(_0x3e19b8){try{jsonpatch[_0xe595('0x1f')](_0x3e19b8,_0x544d56,!![]);}catch(_0xab9a5){return BPromise[_0xe595('0x20')](_0xab9a5);}return _0x3e19b8[_0xe595('0x21')]();};}function saveUpdates(_0x18a178,_0x495370){return function(_0x14d836){if(_0x14d836){return _0x14d836[_0xe595('0x22')](_0x18a178)[_0xe595('0x23')](function(_0xf3f1c5){return _0xf3f1c5;});}return null;};}function removeEntity(_0x4a371a,_0x45ba95){return function(_0xa55ba4){if(_0xa55ba4){return _0xa55ba4['destroy']()[_0xe595('0x23')](function(){var _0x4ffb39=_0xa55ba4[_0xe595('0x24')]({'plain':!![]});var _0x4fc22f=_0xe595('0x25');return db[_0xe595('0x26')][_0xe595('0x27')]({'where':{'type':_0x4fc22f,'resourceId':_0x4ffb39['id']}})['then'](function(){return _0xa55ba4;});})['then'](function(){_0x4a371a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e3804,_0x2b2909){return function(_0x3e2a76){if(!_0x3e2a76){_0x3e3804[_0xe595('0x17')](0x194);}return _0x3e2a76;};}function handleError(_0x33773a,_0x3fd6c3){_0x3fd6c3=_0x3fd6c3||0x1f4;return function(_0x4cee45){logger['error'](_0x4cee45['stack']);if(_0x4cee45['name']){delete _0x4cee45[_0xe595('0x28')];}_0x33773a[_0xe595('0x18')](_0x3fd6c3)[_0xe595('0x29')](_0x4cee45);};}exports[_0xe595('0x2a')]=function(_0x41ec52,_0xb6869c){var _0x2bf30d={},_0x3b8cd0={},_0x34b984={'count':0x0,'rows':[]};var _0xd8d515=_['map'](db[_0xe595('0x2b')][_0xe595('0x2c')],function(_0xd1d286){return{'name':_0xd1d286[_0xe595('0x2d')],'type':_0xd1d286[_0xe595('0x2e')][_0xe595('0x2f')]};});_0x3b8cd0[_0xe595('0x30')]=_[_0xe595('0x31')](_0xd8d515,_0xe595('0x28'));_0x3b8cd0[_0xe595('0x32')]=_[_0xe595('0x33')](_0x41ec52['query']);_0x3b8cd0[_0xe595('0x34')]=_['intersection'](_0x3b8cd0[_0xe595('0x30')],_0x3b8cd0[_0xe595('0x32')]);_0x2bf30d[_0xe595('0x35')]=_['intersection'](_0x3b8cd0[_0xe595('0x30')],qs[_0xe595('0x36')](_0x41ec52['query'][_0xe595('0x36')]));_0x2bf30d[_0xe595('0x35')]=_0x2bf30d[_0xe595('0x35')][_0xe595('0x37')]?_0x2bf30d[_0xe595('0x35')]:_0x3b8cd0[_0xe595('0x30')];if(!_0x41ec52[_0xe595('0x32')][_0xe595('0x38')]('nolimit')){_0x2bf30d['limit']=qs[_0xe595('0x1b')](_0x41ec52[_0xe595('0x32')]['limit']);_0x2bf30d['offset']=qs[_0xe595('0x19')](_0x41ec52['query'][_0xe595('0x19')]);}_0x2bf30d[_0xe595('0x39')]=qs[_0xe595('0x3a')](_0x41ec52[_0xe595('0x32')][_0xe595('0x3a')]);_0x2bf30d[_0xe595('0x3b')]=qs['filters'](_[_0xe595('0x3c')](_0x41ec52[_0xe595('0x32')],_0x3b8cd0[_0xe595('0x34')]),_0xd8d515);if(_0x41ec52[_0xe595('0x32')][_0xe595('0x3d')]){_0x2bf30d[_0xe595('0x3b')]=_[_0xe595('0x3e')](_0x2bf30d[_0xe595('0x3b')],{'$or':_[_0xe595('0x31')](_0xd8d515,function(_0x43028b){if(_0x43028b['type']!==_0xe595('0x3f')){var _0x1e2a55={};_0x1e2a55[_0x43028b[_0xe595('0x28')]]={'$like':'%'+_0x41ec52[_0xe595('0x32')][_0xe595('0x3d')]+'%'};return _0x1e2a55;}})});}_0x2bf30d=_[_0xe595('0x3e')]({},_0x2bf30d,_0x41ec52['options']);var _0x5c704c={'where':_0x2bf30d[_0xe595('0x3b')]};return db['Variable'][_0xe595('0x1c')](_0x5c704c)[_0xe595('0x23')](function(_0x42cc2f){_0x34b984[_0xe595('0x1c')]=_0x42cc2f;if(_0x41ec52['query']['includeAll']){_0x2bf30d[_0xe595('0x40')]=[{'all':!![]}];}return db['Variable'][_0xe595('0x41')](_0x2bf30d);})['then'](function(_0x386322){_0x34b984[_0xe595('0x42')]=_0x386322;return _0x34b984;})[_0xe595('0x23')](respondWithFilteredResult(_0xb6869c,_0x2bf30d))[_0xe595('0x43')](handleError(_0xb6869c,null));};exports['show']=function(_0x2f1a0d,_0x1f12ad){var _0x176ce3={'raw':!![],'where':{'id':_0x2f1a0d[_0xe595('0x44')]['id']}},_0x51dfd3={};_0x51dfd3[_0xe595('0x30')]=_[_0xe595('0x33')](db[_0xe595('0x2b')][_0xe595('0x2c')]);_0x51dfd3[_0xe595('0x32')]=_[_0xe595('0x33')](_0x2f1a0d[_0xe595('0x32')]);_0x51dfd3[_0xe595('0x34')]=_[_0xe595('0x45')](_0x51dfd3[_0xe595('0x30')],_0x51dfd3[_0xe595('0x32')]);_0x176ce3[_0xe595('0x35')]=_[_0xe595('0x45')](_0x51dfd3['model'],qs[_0xe595('0x36')](_0x2f1a0d['query'][_0xe595('0x36')]));_0x176ce3[_0xe595('0x35')]=_0x176ce3[_0xe595('0x35')][_0xe595('0x37')]?_0x176ce3[_0xe595('0x35')]:_0x51dfd3[_0xe595('0x30')];if(_0x2f1a0d[_0xe595('0x32')][_0xe595('0x46')]){_0x176ce3[_0xe595('0x40')]=[{'all':!![]}];}_0x176ce3=_[_0xe595('0x3e')]({},_0x176ce3,_0x2f1a0d[_0xe595('0x47')]);return db['Variable'][_0xe595('0x48')](_0x176ce3)['then'](handleEntityNotFound(_0x1f12ad,null))['then'](respondWithResult(_0x1f12ad,null))['catch'](handleError(_0x1f12ad,null));};exports[_0xe595('0x49')]=function(_0x5359bf,_0x164e7c){return db[_0xe595('0x2b')][_0xe595('0x49')](_0x5359bf[_0xe595('0x4a')],{})[_0xe595('0x23')](function(_0x20eb54){var _0x1fa4f5=_0x5359bf[_0xe595('0x4b')][_0xe595('0x24')]({'plain':!![]});if(!_0x1fa4f5)throw new Error(_0xe595('0x4c'));if(_0x1fa4f5[_0xe595('0x4d')]===_0xe595('0x4b')){var _0x39e130=_0x20eb54[_0xe595('0x24')]({'plain':!![]});var _0x4d1d20=_0xe595('0x25');return db[_0xe595('0x4e')][_0xe595('0x48')]({'where':{'name':_0x4d1d20,'userProfileId':_0x1fa4f5['userProfileId']},'raw':!![]})[_0xe595('0x23')](function(_0x31146a){if(_0x31146a&&_0x31146a['autoAssociation']===0x0){return db[_0xe595('0x26')][_0xe595('0x49')]({'name':_0x39e130['name'],'resourceId':_0x39e130['id'],'type':_0x31146a[_0xe595('0x28')],'sectionId':_0x31146a['id']},{})[_0xe595('0x23')](function(){return _0x20eb54;});}else{return _0x20eb54;}})[_0xe595('0x43')](function(_0x5a60b7){logger[_0xe595('0x4f')](_0xe595('0x50'),_0x5a60b7);throw _0x5a60b7;});}return _0x20eb54;})[_0xe595('0x23')](respondWithResult(_0x164e7c,0xc9))[_0xe595('0x43')](handleError(_0x164e7c,null));};exports[_0xe595('0x22')]=function(_0x400657,_0x53b8cd){if(_0x400657[_0xe595('0x4a')]['id']){delete _0x400657[_0xe595('0x4a')]['id'];}return db[_0xe595('0x2b')][_0xe595('0x48')]({'where':{'id':_0x400657[_0xe595('0x44')]['id']}})[_0xe595('0x23')](handleEntityNotFound(_0x53b8cd,null))[_0xe595('0x23')](saveUpdates(_0x400657[_0xe595('0x4a')],null))['then'](respondWithResult(_0x53b8cd,null))[_0xe595('0x43')](handleError(_0x53b8cd,null));};exports[_0xe595('0x27')]=function(_0x297f40,_0x47ded8){return db[_0xe595('0x2b')]['find']({'where':{'id':_0x297f40['params']['id']}})[_0xe595('0x23')](handleEntityNotFound(_0x47ded8,null))['then'](removeEntity(_0x47ded8,null))[_0xe595('0x43')](handleError(_0x47ded8,null));};
\ No newline at end of file
+var _0x286f=['options','find','create','body','user','role','autoAssociation','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','index','map','Variable','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0x286f,0xeb));var _0xf286=function(_0x4fab5f,_0x374985){_0x4fab5f=_0x4fab5f-0x0;var _0x14e7e2=_0x286f[_0x4fab5f];return _0x14e7e2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf286('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf286('0x1'));var moment=require(_0xf286('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf286('0x3'));var util=require('util');var path=require(_0xf286('0x4'));var sox=require(_0xf286('0x5'));var csv=require(_0xf286('0x6'));var ejs=require(_0xf286('0x7'));var fs=require('fs');var fs_extra=require(_0xf286('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf286('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf286('0xa'));var toCsv=require(_0xf286('0x6'));var querystring=require(_0xf286('0xb'));var Papa=require(_0xf286('0xc'));var Redis=require('ioredis');var authService=require(_0xf286('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xf286('0xe'));var hardwareService=require(_0xf286('0xf'));var logger=require('../../config/logger')(_0xf286('0x10'));var utils=require('../../config/utils');var config=require(_0xf286('0x11'));var licenseUtil=require(_0xf286('0x12'));var db=require(_0xf286('0x13'))['db'];function respondWithStatusCode(_0x415959,_0x28e7c8){_0x28e7c8=_0x28e7c8||0xcc;return function(_0x54fac4){if(_0x54fac4){return _0x415959[_0xf286('0x14')](_0x28e7c8);}return _0x415959['status'](_0x28e7c8)[_0xf286('0x15')]();};}function respondWithResult(_0x44e322,_0x181603){_0x181603=_0x181603||0xc8;return function(_0x4f7647){if(_0x4f7647){return _0x44e322[_0xf286('0x16')](_0x181603)[_0xf286('0x17')](_0x4f7647);}};}function respondWithFilteredResult(_0x2c2087,_0x4c8037){return function(_0x3a84cf){if(_0x3a84cf){var _0x2f8f65=typeof _0x4c8037[_0xf286('0x18')]===_0xf286('0x19')&&typeof _0x4c8037[_0xf286('0x1a')]===_0xf286('0x19');var _0x563197=_0x3a84cf[_0xf286('0x1b')];var _0x4f9b16=_0x2f8f65?0x0:_0x4c8037[_0xf286('0x18')];var _0x201f73=_0x2f8f65?_0x3a84cf[_0xf286('0x1b')]:_0x4c8037[_0xf286('0x18')]+_0x4c8037[_0xf286('0x1a')];var _0x4e2c8d;if(_0x201f73>=_0x563197){_0x201f73=_0x563197;_0x4e2c8d=0xc8;}else{_0x4e2c8d=0xce;}_0x2c2087['status'](_0x4e2c8d);return _0x2c2087[_0xf286('0x1c')]('Content-Range',_0x4f9b16+'-'+_0x201f73+'/'+_0x563197)[_0xf286('0x17')](_0x3a84cf);}return null;};}function patchUpdates(_0x5cd5ca){return function(_0x47a776){try{jsonpatch[_0xf286('0x1d')](_0x47a776,_0x5cd5ca,!![]);}catch(_0x4601f6){return BPromise[_0xf286('0x1e')](_0x4601f6);}return _0x47a776['save']();};}function saveUpdates(_0x23856e,_0x5619ff){return function(_0x1b573a){if(_0x1b573a){return _0x1b573a[_0xf286('0x1f')](_0x23856e)[_0xf286('0x20')](function(_0x36903a){return _0x36903a;});}return null;};}function removeEntity(_0x5371cd,_0x92044a){return function(_0x29a8c8){if(_0x29a8c8){return _0x29a8c8[_0xf286('0x21')]()['then'](function(){var _0x25ccec=_0x29a8c8[_0xf286('0x22')]({'plain':!![]});var _0x5013bd=_0xf286('0x23');return db[_0xf286('0x24')][_0xf286('0x21')]({'where':{'type':_0x5013bd,'resourceId':_0x25ccec['id']}})[_0xf286('0x20')](function(){return _0x29a8c8;});})[_0xf286('0x20')](function(){_0x5371cd[_0xf286('0x16')](0xcc)[_0xf286('0x15')]();});}};}function handleEntityNotFound(_0x3a6536,_0xaf7bf9){return function(_0x13442f){if(!_0x13442f){_0x3a6536[_0xf286('0x14')](0x194);}return _0x13442f;};}function handleError(_0x33a6fa,_0x36d621){_0x36d621=_0x36d621||0x1f4;return function(_0x53de57){logger[_0xf286('0x25')](_0x53de57[_0xf286('0x26')]);if(_0x53de57[_0xf286('0x27')]){delete _0x53de57[_0xf286('0x27')];}_0x33a6fa[_0xf286('0x16')](_0x36d621)['send'](_0x53de57);};}exports[_0xf286('0x28')]=function(_0x3db582,_0x37e50c){var _0x52ab40={},_0x2cbfe3={},_0x2aed50={'count':0x0,'rows':[]};var _0x56d873=_[_0xf286('0x29')](db[_0xf286('0x2a')][_0xf286('0x2b')],function(_0x3ae38c){return{'name':_0x3ae38c[_0xf286('0x2c')],'type':_0x3ae38c['type'][_0xf286('0x2d')]};});_0x2cbfe3['model']=_['map'](_0x56d873,'name');_0x2cbfe3[_0xf286('0x2e')]=_[_0xf286('0x2f')](_0x3db582[_0xf286('0x2e')]);_0x2cbfe3[_0xf286('0x30')]=_[_0xf286('0x31')](_0x2cbfe3[_0xf286('0x32')],_0x2cbfe3['query']);_0x52ab40[_0xf286('0x33')]=_[_0xf286('0x31')](_0x2cbfe3[_0xf286('0x32')],qs[_0xf286('0x34')](_0x3db582[_0xf286('0x2e')][_0xf286('0x34')]));_0x52ab40[_0xf286('0x33')]=_0x52ab40[_0xf286('0x33')][_0xf286('0x35')]?_0x52ab40[_0xf286('0x33')]:_0x2cbfe3['model'];if(!_0x3db582[_0xf286('0x2e')][_0xf286('0x36')](_0xf286('0x37'))){_0x52ab40[_0xf286('0x1a')]=qs[_0xf286('0x1a')](_0x3db582[_0xf286('0x2e')]['limit']);_0x52ab40[_0xf286('0x18')]=qs[_0xf286('0x18')](_0x3db582[_0xf286('0x2e')]['offset']);}_0x52ab40['order']=qs[_0xf286('0x38')](_0x3db582['query'][_0xf286('0x38')]);_0x52ab40[_0xf286('0x39')]=qs['filters'](_[_0xf286('0x3a')](_0x3db582[_0xf286('0x2e')],_0x2cbfe3[_0xf286('0x30')]),_0x56d873);if(_0x3db582[_0xf286('0x2e')][_0xf286('0x3b')]){_0x52ab40[_0xf286('0x39')]=_[_0xf286('0x3c')](_0x52ab40[_0xf286('0x39')],{'$or':_[_0xf286('0x29')](_0x56d873,function(_0x6d2c7){if(_0x6d2c7[_0xf286('0x3d')]!=='VIRTUAL'){var _0x3572ca={};_0x3572ca[_0x6d2c7[_0xf286('0x27')]]={'$like':'%'+_0x3db582['query']['filter']+'%'};return _0x3572ca;}})});}_0x52ab40=_['merge']({},_0x52ab40,_0x3db582['options']);var _0x4a8311={'where':_0x52ab40[_0xf286('0x39')]};return db[_0xf286('0x2a')][_0xf286('0x1b')](_0x4a8311)[_0xf286('0x20')](function(_0x44c1e2){_0x2aed50['count']=_0x44c1e2;if(_0x3db582[_0xf286('0x2e')][_0xf286('0x3e')]){_0x52ab40[_0xf286('0x3f')]=[{'all':!![]}];}return db['Variable'][_0xf286('0x40')](_0x52ab40);})[_0xf286('0x20')](function(_0x2f8c89){_0x2aed50[_0xf286('0x41')]=_0x2f8c89;return _0x2aed50;})['then'](respondWithFilteredResult(_0x37e50c,_0x52ab40))[_0xf286('0x42')](handleError(_0x37e50c,null));};exports[_0xf286('0x43')]=function(_0x26524a,_0x218cce){var _0x58477f={'raw':!![],'where':{'id':_0x26524a[_0xf286('0x44')]['id']}},_0x46b24a={};_0x46b24a[_0xf286('0x32')]=_[_0xf286('0x2f')](db[_0xf286('0x2a')][_0xf286('0x2b')]);_0x46b24a[_0xf286('0x2e')]=_[_0xf286('0x2f')](_0x26524a[_0xf286('0x2e')]);_0x46b24a[_0xf286('0x30')]=_[_0xf286('0x31')](_0x46b24a[_0xf286('0x32')],_0x46b24a['query']);_0x58477f[_0xf286('0x33')]=_[_0xf286('0x31')](_0x46b24a[_0xf286('0x32')],qs[_0xf286('0x34')](_0x26524a[_0xf286('0x2e')][_0xf286('0x34')]));_0x58477f[_0xf286('0x33')]=_0x58477f[_0xf286('0x33')][_0xf286('0x35')]?_0x58477f[_0xf286('0x33')]:_0x46b24a[_0xf286('0x32')];if(_0x26524a[_0xf286('0x2e')][_0xf286('0x3e')]){_0x58477f[_0xf286('0x3f')]=[{'all':!![]}];}_0x58477f=_[_0xf286('0x3c')]({},_0x58477f,_0x26524a[_0xf286('0x45')]);return db[_0xf286('0x2a')][_0xf286('0x46')](_0x58477f)[_0xf286('0x20')](handleEntityNotFound(_0x218cce,null))[_0xf286('0x20')](respondWithResult(_0x218cce,null))[_0xf286('0x42')](handleError(_0x218cce,null));};exports[_0xf286('0x47')]=function(_0x240b62,_0x4f26ab){return db[_0xf286('0x2a')][_0xf286('0x47')](_0x240b62[_0xf286('0x48')],{})[_0xf286('0x20')](function(_0x43fdd1){var _0x5570f2=_0x240b62[_0xf286('0x49')]['get']({'plain':!![]});if(!_0x5570f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5570f2[_0xf286('0x4a')]===_0xf286('0x49')){var _0x1663be=_0x43fdd1[_0xf286('0x22')]({'plain':!![]});var _0x22b46b=_0xf286('0x23');return db['UserProfileSection'][_0xf286('0x46')]({'where':{'name':_0x22b46b,'userProfileId':_0x5570f2['userProfileId']},'raw':!![]})[_0xf286('0x20')](function(_0x48adac){if(_0x48adac&&_0x48adac[_0xf286('0x4b')]===0x0){return db[_0xf286('0x24')][_0xf286('0x47')]({'name':_0x1663be['name'],'resourceId':_0x1663be['id'],'type':_0x48adac['name'],'sectionId':_0x48adac['id']},{})[_0xf286('0x20')](function(){return _0x43fdd1;});}else{return _0x43fdd1;}})[_0xf286('0x42')](function(_0x5cafc2){logger[_0xf286('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cafc2);throw _0x5cafc2;});}return _0x43fdd1;})[_0xf286('0x20')](respondWithResult(_0x4f26ab,0xc9))['catch'](handleError(_0x4f26ab,null));};exports[_0xf286('0x1f')]=function(_0x116d2a,_0x29af21){if(_0x116d2a[_0xf286('0x48')]['id']){delete _0x116d2a[_0xf286('0x48')]['id'];}return db[_0xf286('0x2a')][_0xf286('0x46')]({'where':{'id':_0x116d2a[_0xf286('0x44')]['id']}})[_0xf286('0x20')](handleEntityNotFound(_0x29af21,null))[_0xf286('0x20')](saveUpdates(_0x116d2a[_0xf286('0x48')],null))[_0xf286('0x20')](respondWithResult(_0x29af21,null))[_0xf286('0x42')](handleError(_0x29af21,null));};exports[_0xf286('0x21')]=function(_0x16e6a3,_0x214cf8){return db[_0xf286('0x2a')][_0xf286('0x46')]({'where':{'id':_0x16e6a3[_0xf286('0x44')]['id']}})[_0xf286('0x20')](handleEntityNotFound(_0x214cf8,null))[_0xf286('0x20')](removeEntity(_0x214cf8,null))[_0xf286('0x42')](handleError(_0x214cf8,null));};
\ No newline at end of file
index 68563c9..fe9f529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb18=['path','rimraf','../../config/environment','./variable.attributes','exports','Variable','tools_variables','lodash','util','../../config/logger','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb18,0x96));var _0x8fb1=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0xfb18[_0x4d1ee9];return _0x9a5456;};'use strict';var _=require(_0x8fb1('0x0'));var util=require(_0x8fb1('0x1'));var logger=require(_0x8fb1('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fb1('0x4'));var rimraf=require(_0x8fb1('0x5'));var config=require(_0x8fb1('0x6'));var attributes=require(_0x8fb1('0x7'));module[_0x8fb1('0x8')]=function(_0x444546,_0xabc978){return _0x444546['define'](_0x8fb1('0x9'),attributes,{'tableName':_0x8fb1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf74b=['request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','../../config/logger','api','moment'];(function(_0x32532a,_0xd99dca){var _0x3b63a9=function(_0x125283){while(--_0x125283){_0x32532a['push'](_0x32532a['shift']());}};_0x3b63a9(++_0xd99dca);}(_0xf74b,0x11d));var _0xbf74=function(_0x47e856,_0x3de56c){_0x47e856=_0x47e856-0x0;var _0x4337b3=_0xf74b[_0x47e856];return _0x4337b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf74('0x0'))(_0xbf74('0x1'));var moment=require(_0xbf74('0x2'));var BPromise=require('bluebird');var rp=require(_0xbf74('0x3'));var fs=require('fs');var path=require(_0xbf74('0x4'));var rimraf=require(_0xbf74('0x5'));var config=require(_0xbf74('0x6'));var attributes=require(_0xbf74('0x7'));module[_0xbf74('0x8')]=function(_0x364511,_0x5ca440){return _0x364511[_0xbf74('0x9')](_0xbf74('0xa'),attributes,{'tableName':_0xbf74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a030dd2..fc22ec6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xa41a,0x6b));var _0xaa41=function(_0x4617f7,_0x51c172){_0x4617f7=_0x4617f7-0x0;var _0x3587c5=_0xa41a[_0x4617f7];return _0x3587c5;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});};
\ No newline at end of file
+var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x56a60a,_0xf4c330){var _0x5c4057=function(_0x5ed7f8){while(--_0x5ed7f8){_0x56a60a['push'](_0x56a60a['shift']());}};_0x5c4057(++_0xf4c330);}(_0x3e74,0x175));var _0x43e7=function(_0x344963,_0x547292){_0x344963=_0x344963-0x0;var _0x4f0213=_0x3e74[_0x344963];return _0x4f0213;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});};
\ No newline at end of file
index 0e32221..e2921f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf895=['/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','fetch','/reset','isAuthenticated','canUpdate','reset','/pull','/restart'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xf895,0xf1));var _0x5f89=function(_0x1438cd,_0x3ce82e){_0x1438cd=_0x1438cd-0x0;var _0xebcaa1=_0xf895[_0x1438cd];return _0xebcaa1;};'use strict';var express=require(_0x5f89('0x0'));var router=express[_0x5f89('0x1')]();var auth=require(_0x5f89('0x2'));var controller=require(_0x5f89('0x3'));router[_0x5f89('0x4')]('/',controller[_0x5f89('0x5')]);router['get'](_0x5f89('0x6'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x5f89('0x7')]);router[_0x5f89('0x4')](_0x5f89('0x8'),auth[_0x5f89('0x9')](),auth[_0x5f89('0xa')](),controller[_0x5f89('0xb')]);router[_0x5f89('0x4')](_0x5f89('0xc'),auth[_0x5f89('0x9')](),auth['canUpdate'](),controller['pull']);router[_0x5f89('0x4')](_0x5f89('0xd'),auth[_0x5f89('0x9')](),controller['restart']);router[_0x5f89('0x4')](_0x5f89('0xe'),controller[_0x5f89('0xf')]);module[_0x5f89('0x10')]=router;
\ No newline at end of file
+var _0x4e75=['restart','migrations','exports','express','Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','reset','pull'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x4e75,0x1d1));var _0x54e7=function(_0x3234b1,_0x40b7fe){_0x3234b1=_0x3234b1-0x0;var _0x47b86a=_0x4e75[_0x3234b1];return _0x47b86a;};'use strict';var express=require(_0x54e7('0x0'));var router=express[_0x54e7('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x54e7('0x2'));router[_0x54e7('0x3')]('/',controller[_0x54e7('0x4')]);router['get'](_0x54e7('0x5'),auth[_0x54e7('0x6')](),auth[_0x54e7('0x7')](),controller[_0x54e7('0x8')]);router['get']('/reset',auth[_0x54e7('0x6')](),auth[_0x54e7('0x7')](),controller[_0x54e7('0x9')]);router[_0x54e7('0x3')]('/pull',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x54e7('0xa')]);router['get']('/restart',auth['isAuthenticated'](),controller[_0x54e7('0xb')]);router[_0x54e7('0x3')]('/migrations',controller[_0x54e7('0xc')]);module[_0x54e7('0xd')]=router;
\ No newline at end of file
index 784af40..833299d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2f2=['origin','master','info','git\x20fetch','reset','FETCH_HEAD','error','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','root','server','length','replace','.js','push','sort','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','version','compare-versions','child_process','../../config/pm2','../../config/logger','update','simple-git','index','query','latest','fetch','exports','2.0.0','json','status'];(function(_0x3569fb,_0x17fff4){var _0x3c4b2d=function(_0x2b1738){while(--_0x2b1738){_0x3569fb['push'](_0x3569fb['shift']());}};_0x3c4b2d(++_0x17fff4);}(_0xa2f2,0x115));var _0x2a2f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa2f2[_0x502c7d];return _0x30b7ed;};'use strict';var Umzug=require(_0x2a2f('0x0'));var path=require(_0x2a2f('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0x2a2f('0x2'));var compareVersions=require(_0x2a2f('0x3'));var exec=require(_0x2a2f('0x4'))['exec'];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x2a2f('0x5'));var logger=require(_0x2a2f('0x6'))(_0x2a2f('0x7'));var git=require(_0x2a2f('0x8'))(config['root']);exports[_0x2a2f('0x9')]=function(_0x5f7c1b,_0x3e1189){var _0x5017ac={'current':module['exports'][_0x2a2f('0x2')],'phonebar':0x2};if(_0x5f7c1b[_0x2a2f('0xa')]&&_0x5f7c1b['query'][_0x2a2f('0xb')]){return git[_0x2a2f('0xc')]()['tags'](function(_0x13d239,_0x18ef36){_0x5017ac['latest']=(_0x13d239?module[_0x2a2f('0xd')][_0x2a2f('0x2')]:_0x18ef36[_0x2a2f('0xb')])||_0x2a2f('0xe');return _0x3e1189['status'](0xc8)[_0x2a2f('0xf')](_0x5017ac);});}else{return _0x3e1189[_0x2a2f('0x10')](0xc8)[_0x2a2f('0xf')](_0x5017ac);}};exports['fetch']=function(_0x4f4a6e,_0x38b14f){return git['fetch']([_0x2a2f('0x11'),_0x2a2f('0x12')],function(_0x1eada3){if(_0x1eada3){logger['error'](_0x1eada3);return _0x38b14f[_0x2a2f('0x10')](0x1f4)['json'](_0x1eada3);}logger[_0x2a2f('0x13')](_0x2a2f('0x14'));return _0x38b14f['status'](0xc8)[_0x2a2f('0xf')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x2a2f('0x15')]=function(_0x47baab,_0x109218){return git[_0x2a2f('0x15')](['--hard',_0x2a2f('0x16')],function(_0x4cb9da){if(_0x4cb9da){logger[_0x2a2f('0x17')](_0x4cb9da);return _0x109218[_0x2a2f('0x10')](0x1f4)[_0x2a2f('0xf')](_0x4cb9da);}logger[_0x2a2f('0x13')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x109218['status'](0xc8)[_0x2a2f('0xf')]({'output':_0x2a2f('0x18')});});};exports[_0x2a2f('0x19')]=function(_0xac3c01,_0x51684b){exec(_0x2a2f('0x1a'),function(_0x526811,_0x146249,_0xd4dd0a){logger[_0x2a2f('0x13')](_0x146249);logger[_0x2a2f('0x13')](_0xd4dd0a);if(_0x526811){logger[_0x2a2f('0x17')](_0x526811);return _0x51684b[_0x2a2f('0x10')](0x1f4)[_0x2a2f('0xf')](_0x526811);}return _0x51684b[_0x2a2f('0x10')](0xc8)[_0x2a2f('0xf')]({'output':_0x146249});});};exports['restart']=function(_0x3f6d53,_0x541b14){return pm2[_0x2a2f('0x1b')]('motion2')[_0x2a2f('0x1c')](function(_0x259c46){logger[_0x2a2f('0x13')]('pm2\x20restart\x20motion\x20%s',_0x259c46);return _0x541b14[_0x2a2f('0x10')](0xc8)['json']({'output':_0x2a2f('0x1d')});})['catch'](function(_0x1d120c){logger[_0x2a2f('0x17')](_0x1d120c);return _0x541b14[_0x2a2f('0x10')](0x1f4)[_0x2a2f('0xf')](_0x1d120c);});};exports[_0x2a2f('0x1e')]=function(_0xed402f,_0x250272){var _0x189544=fs[_0x2a2f('0x1f')](path[_0x2a2f('0x20')](config[_0x2a2f('0x21')],_0x2a2f('0x22'),_0x2a2f('0x1e')));var _0x3285a4=[];for(var _0x6a6ddb=0x0;_0x6a6ddb<_0x189544[_0x2a2f('0x23')];_0x6a6ddb++){var _0x38f2b2=_0x189544[_0x6a6ddb][_0x2a2f('0x24')](_0x2a2f('0x25'),'');if(compareVersions(module[_0x2a2f('0xd')][_0x2a2f('0x2')],_0x38f2b2)===-0x1){_0x3285a4[_0x2a2f('0x26')](_0x38f2b2);}}if(_0x3285a4[_0x2a2f('0x23')]){var _0x49d929=_0x3285a4[_0x2a2f('0x27')](compareVersions);var _0xe70715=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x2a2f('0x28')],'modelName':_0x2a2f('0x28'),'columnName':_0x2a2f('0x2')},'migrations':{'params':[db[_0x2a2f('0x29')]['getQueryInterface'](),db[_0x2a2f('0x29')][_0x2a2f('0x2a')],function(){throw new Error(_0x2a2f('0x2b'));}],'path':path[_0x2a2f('0x20')](config[_0x2a2f('0x21')],_0x2a2f('0x22'),'migrations'),'pattern':/\.js$/}});_0xe70715['up']({'migrations':_[_0x2a2f('0x2c')](_0x49d929,function(_0xb3bd64){return _0xb3bd64+'.js';})})[_0x2a2f('0x1c')](function(){return _0x250272[_0x2a2f('0x10')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x2a2f('0xd')][_0x2a2f('0x2')]+_0x2a2f('0x2d')+_[_0x2a2f('0x2e')](_0x49d929),'migrations':_['join'](_0x49d929)});})['catch'](function(_0x4bbeea){if(_0x4bbeea instanceof db[_0x2a2f('0x29')][_0x2a2f('0x2f')]){return _0x250272[_0x2a2f('0x10')](0xc8)[_0x2a2f('0xf')]({'output':_0x2a2f('0x30')});}else{return _0x250272['status'](0x1f4)[_0x2a2f('0xf')](_0x4bbeea);}});}else{return _0x250272[_0x2a2f('0x10')](0xc8)[_0x2a2f('0xf')]({'output':_0x2a2f('0x30')});}};
\ No newline at end of file
+var _0x7da4=['readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','migrations','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','child_process','exec','../../mysqldb','../../config/pm2','update','simple-git','root','index','exports','version','query','latest','tags','status','json','fetch','master','error','info','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da4,0xb3));var _0x47da=function(_0xfab694,_0x11a893){_0xfab694=_0xfab694-0x0;var _0x5269c6=_0x7da4[_0xfab694];return _0x5269c6;};'use strict';var Umzug=require(_0x47da('0x0'));var path=require(_0x47da('0x1'));var fs=require('fs');var _=require(_0x47da('0x2'));var pkginfo=require(_0x47da('0x3'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x47da('0x4'))[_0x47da('0x5')];var db=require(_0x47da('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x47da('0x7'));var logger=require('../../config/logger')(_0x47da('0x8'));var git=require(_0x47da('0x9'))(config[_0x47da('0xa')]);exports[_0x47da('0xb')]=function(_0x373a1c,_0x19eff3){var _0x55f115={'current':module[_0x47da('0xc')][_0x47da('0xd')],'phonebar':0x2};if(_0x373a1c[_0x47da('0xe')]&&_0x373a1c[_0x47da('0xe')][_0x47da('0xf')]){return git['fetch']()[_0x47da('0x10')](function(_0x5ec890,_0x1fb24a){_0x55f115[_0x47da('0xf')]=(_0x5ec890?module['exports'][_0x47da('0xd')]:_0x1fb24a['latest'])||'2.0.0';return _0x19eff3[_0x47da('0x11')](0xc8)[_0x47da('0x12')](_0x55f115);});}else{return _0x19eff3[_0x47da('0x11')](0xc8)['json'](_0x55f115);}};exports[_0x47da('0x13')]=function(_0x270cb4,_0x24f828){return git[_0x47da('0x13')](['origin',_0x47da('0x14')],function(_0x5c2d31){if(_0x5c2d31){logger[_0x47da('0x15')](_0x5c2d31);return _0x24f828['status'](0x1f4)[_0x47da('0x12')](_0x5c2d31);}logger[_0x47da('0x16')]('git\x20fetch');return _0x24f828[_0x47da('0x11')](0xc8)[_0x47da('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x442dac,_0x514624){return git[_0x47da('0x17')](['--hard',_0x47da('0x18')],function(_0x3b1c53){if(_0x3b1c53){logger['error'](_0x3b1c53);return _0x514624['status'](0x1f4)['json'](_0x3b1c53);}logger[_0x47da('0x16')](_0x47da('0x19'));return _0x514624[_0x47da('0x11')](0xc8)[_0x47da('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x47da('0x1a')]=function(_0x296aa4,_0x14f7ee){exec(_0x47da('0x1b'),function(_0x3489af,_0x2d7c2f,_0x1e2939){logger[_0x47da('0x16')](_0x2d7c2f);logger[_0x47da('0x16')](_0x1e2939);if(_0x3489af){logger[_0x47da('0x15')](_0x3489af);return _0x14f7ee[_0x47da('0x11')](0x1f4)[_0x47da('0x12')](_0x3489af);}return _0x14f7ee[_0x47da('0x11')](0xc8)['json']({'output':_0x2d7c2f});});};exports[_0x47da('0x1c')]=function(_0x2d33d3,_0x4cfbd7){return pm2['restart'](_0x47da('0x1d'))['then'](function(_0x19de0d){logger[_0x47da('0x16')](_0x47da('0x1e'),_0x19de0d);return _0x4cfbd7[_0x47da('0x11')](0xc8)[_0x47da('0x12')]({'output':_0x47da('0x1f')});})[_0x47da('0x20')](function(_0x1fd9ea){logger[_0x47da('0x15')](_0x1fd9ea);return _0x4cfbd7[_0x47da('0x11')](0x1f4)['json'](_0x1fd9ea);});};exports['migrations']=function(_0x4127f8,_0x385d4f){var _0x1fb28a=fs[_0x47da('0x21')](path[_0x47da('0x22')](config['root'],_0x47da('0x23'),'migrations'));var _0x1069a6=[];for(var _0x2ad283=0x0;_0x2ad283<_0x1fb28a[_0x47da('0x24')];_0x2ad283++){var _0x3117cf=_0x1fb28a[_0x2ad283][_0x47da('0x25')](_0x47da('0x26'),'');if(compareVersions(module['exports'][_0x47da('0xd')],_0x3117cf)===-0x1){_0x1069a6[_0x47da('0x27')](_0x3117cf);}}if(_0x1069a6[_0x47da('0x24')]){var _0x491333=_0x1069a6[_0x47da('0x28')](compareVersions);var _0x3238f0=new Umzug({'storage':_0x47da('0x29'),'storageOptions':{'model':db[_0x47da('0x2a')],'modelName':_0x47da('0x2a'),'columnName':_0x47da('0xd')},'migrations':{'params':[db['sequelize'][_0x47da('0x2b')](),db['sequelize']['constructor'],function(){throw new Error(_0x47da('0x2c'));}],'path':path['join'](config[_0x47da('0xa')],'server',_0x47da('0x2d')),'pattern':/\.js$/}});_0x3238f0['up']({'migrations':_[_0x47da('0x2e')](_0x491333,function(_0x5ad6ca){return _0x5ad6ca+'.js';})})[_0x47da('0x2f')](function(){return _0x385d4f[_0x47da('0x11')](0xc8)[_0x47da('0x12')]({'output':_0x47da('0x30')+module['exports'][_0x47da('0xd')]+_0x47da('0x31')+_[_0x47da('0x32')](_0x491333),'migrations':_['join'](_0x491333)});})[_0x47da('0x20')](function(_0x509cd6){if(_0x509cd6 instanceof db['sequelize'][_0x47da('0x33')]){return _0x385d4f[_0x47da('0x11')](0xc8)['json']({'output':_0x47da('0x34')});}else{return _0x385d4f['status'](0x1f4)['json'](_0x509cd6);}});}else{return _0x385d4f[_0x47da('0x11')](0xc8)[_0x47da('0x12')]({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
index 7f9197b..0f027fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07c9=['isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','destroy','multer','util','path','Router','fs-extra','../../config/environment'];(function(_0x585060,_0x55571f){var _0x3c35e8=function(_0x49479a){while(--_0x49479a){_0x585060['push'](_0x585060['shift']());}};_0x3c35e8(++_0x55571f);}(_0x07c9,0xc6));var _0x907c=function(_0x1efeb4,_0x3e3ae4){_0x1efeb4=_0x1efeb4-0x0;var _0x5da542=_0x07c9[_0x1efeb4];return _0x5da542;};'use strict';var multer=require(_0x907c('0x0'));var util=require(_0x907c('0x1'));var path=require(_0x907c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x907c('0x3')]();var fs_extra=require(_0x907c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x907c('0x5'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x907c('0x6')](),controller[_0x907c('0x7')]);router[_0x907c('0x8')](_0x907c('0x9'),auth[_0x907c('0x6')](),controller['describe']);router[_0x907c('0x8')](_0x907c('0xa'),auth[_0x907c('0x6')](),controller[_0x907c('0xb')]);router[_0x907c('0xc')]('/',auth[_0x907c('0x6')](),controller[_0x907c('0xd')]);router[_0x907c('0xe')](_0x907c('0xa'),auth['isAuthenticated'](),controller[_0x907c('0xf')]);router['delete'](_0x907c('0xa'),auth['isAuthenticated'](),controller[_0x907c('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x9d23=['fs-extra','../../components/interaction/service','isAuthenticated','index','/describe','get','/:id','show','update','multer','path','express'];(function(_0x3c84d5,_0x5f463e){var _0x461124=function(_0x41c57b){while(--_0x41c57b){_0x3c84d5['push'](_0x3c84d5['shift']());}};_0x461124(++_0x5f463e);}(_0x9d23,0x1a1));var _0x39d2=function(_0x17b74a,_0x107a08){_0x17b74a=_0x17b74a-0x0;var _0x225a1f=_0x9d23[_0x17b74a];return _0x225a1f;};'use strict';var multer=require(_0x39d2('0x0'));var util=require('util');var path=require(_0x39d2('0x1'));var timeout=require('connect-timeout');var express=require(_0x39d2('0x2'));var router=express['Router']();var fs_extra=require(_0x39d2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x39d2('0x4'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x39d2('0x5')](),controller[_0x39d2('0x6')]);router['get'](_0x39d2('0x7'),auth[_0x39d2('0x5')](),controller['describe']);router[_0x39d2('0x8')](_0x39d2('0x9'),auth[_0x39d2('0x5')](),controller[_0x39d2('0xa')]);router['post']('/',auth[_0x39d2('0x5')](),controller['create']);router['put'](_0x39d2('0x9'),auth['isAuthenticated'](),controller[_0x39d2('0xb')]);router['delete'](_0x39d2('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 71117b7..45de7cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c7c=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x33b732,_0x177ec4){var _0x2f75bc=function(_0x6a9b3e){while(--_0x6a9b3e){_0x33b732['push'](_0x33b732['shift']());}};_0x2f75bc(++_0x177ec4);}(_0x1c7c,0x164));var _0xc1c7=function(_0x802b2e,_0x47bbb4){_0x802b2e=_0x802b2e-0x0;var _0x3ad077=_0x1c7c[_0x802b2e];return _0x3ad077;};'use strict';var Sequelize=require(_0xc1c7('0x0'));module[_0xc1c7('0x1')]={'type':{'type':Sequelize[_0xc1c7('0x2')]},'uniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc1c7('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc1c7('0x2')]},'membername':{'type':Sequelize[_0xc1c7('0x2')]},'agentcalledAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentconnectAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xc1c7('0x3')]},'agentdumpAt':{'type':Sequelize[_0xc1c7('0x3')]},'holdtime':{'type':Sequelize[_0xc1c7('0x4')]},'agentcomplete':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc1c7('0x4')]},'agentacw':{'type':Sequelize[_0xc1c7('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc1c7('0x4')]},'reason':{'type':Sequelize[_0xc1c7('0x2')]},'lastevent':{'type':Sequelize[_0xc1c7('0x2')]},'channel':{'type':Sequelize[_0xc1c7('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xc1c7('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc1c7('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc1c7('0x2')]},'accountcode':{'type':Sequelize[_0xc1c7('0x2')]},'context':{'type':Sequelize[_0xc1c7('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc1c7('0x2')]},'destchannel':{'type':Sequelize[_0xc1c7('0x2')]},'destchannelstate':{'type':Sequelize[_0xc1c7('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xc1c7('0x2')]},'destcalleridnum':{'type':Sequelize[_0xc1c7('0x2')]},'destcalleridname':{'type':Sequelize[_0xc1c7('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc1c7('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc1c7('0x2')]},'destlanguage':{'type':Sequelize[_0xc1c7('0x2')]},'destaccountcode':{'type':Sequelize[_0xc1c7('0x2')]},'destcontext':{'type':Sequelize[_0xc1c7('0x2')]},'destexten':{'type':Sequelize[_0xc1c7('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xc1c7('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc1c7('0x2')],'comment':_0xc1c7('0x6')},'transferexten':{'type':Sequelize[_0xc1c7('0x2')]},'transferuniqueid':{'type':Sequelize[_0xc1c7('0x2')]},'agententerreason':{'type':Sequelize[_0xc1c7('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4f9b=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x3de45a,_0x22c557){_0x3de45a=_0x3de45a-0x0;var _0x496b8a=_0x4f9b[_0x3de45a];return _0x496b8a;};'use strict';var Sequelize=require(_0xb4f9('0x0'));module[_0xb4f9('0x1')]={'type':{'type':Sequelize[_0xb4f9('0x2')]},'uniqueid':{'type':Sequelize[_0xb4f9('0x2')]},'calleridnum':{'type':Sequelize[_0xb4f9('0x2')]},'calleridname':{'type':Sequelize[_0xb4f9('0x2')]},'queue':{'type':Sequelize[_0xb4f9('0x2')]},'interface':{'type':Sequelize[_0xb4f9('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xb4f9('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xb4f9('0x3')]},'agentdumpAt':{'type':Sequelize[_0xb4f9('0x3')]},'holdtime':{'type':Sequelize[_0xb4f9('0x4')]},'agentcomplete':{'type':Sequelize[_0xb4f9('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb4f9('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb4f9('0x4')]},'agentacw':{'type':Sequelize[_0xb4f9('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb4f9('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xb4f9('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb4f9('0x4')]},'channelstatedesc':{'type':Sequelize[_0xb4f9('0x2')]},'connectedlinenum':{'type':Sequelize[_0xb4f9('0x2')]},'connectedlinename':{'type':Sequelize[_0xb4f9('0x2')]},'language':{'type':Sequelize[_0xb4f9('0x2')]},'accountcode':{'type':Sequelize[_0xb4f9('0x2')]},'context':{'type':Sequelize[_0xb4f9('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb4f9('0x2')]},'destchannel':{'type':Sequelize[_0xb4f9('0x2')]},'destchannelstate':{'type':Sequelize[_0xb4f9('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xb4f9('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xb4f9('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb4f9('0x2')]},'destlanguage':{'type':Sequelize[_0xb4f9('0x2')]},'destaccountcode':{'type':Sequelize[_0xb4f9('0x2')]},'destcontext':{'type':Sequelize[_0xb4f9('0x2')]},'destexten':{'type':Sequelize[_0xb4f9('0x2')]},'destpriority':{'type':Sequelize[_0xb4f9('0x2')]},'destuniqueid':{'type':Sequelize[_0xb4f9('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb4f9('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xb4f9('0x2')]},'transfer':{'type':Sequelize[_0xb4f9('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xb4f9('0x6')},'transferexten':{'type':Sequelize[_0xb4f9('0x2')]},'transferuniqueid':{'type':Sequelize[_0xb4f9('0x2')]},'agententerreason':{'type':Sequelize[_0xb4f9('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 9fc53fd..1a12af9 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(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 3e555e9..f16cd8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb66=['path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb66,0x19f));var _0x6cb6=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0xcb66[_0x2aee2f];return _0x19337f;};'use strict';var _=require('lodash');var util=require(_0x6cb6('0x0'));var logger=require(_0x6cb6('0x1'))(_0x6cb6('0x2'));var moment=require(_0x6cb6('0x3'));var BPromise=require(_0x6cb6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cb6('0x5'));var rimraf=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var attributes=require(_0x6cb6('0x8'));module[_0x6cb6('0x9')]=function(_0x506d14,_0x53078d){return _0x506d14[_0x6cb6('0xa')](_0x6cb6('0xb'),attributes,{'tableName':_0x6cb6('0xc'),'paranoid':![],'indexes':[{'fields':[_0x6cb6('0xd'),_0x6cb6('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf006=['./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','../../config/logger','api','bluebird','path'];(function(_0x1f7f17,_0x1f05e1){var _0x1f3026=function(_0x54d950){while(--_0x54d950){_0x1f7f17['push'](_0x1f7f17['shift']());}};_0x1f3026(++_0x1f05e1);}(_0xf006,0x146));var _0x6f00=function(_0x39e301,_0x5297e5){_0x39e301=_0x39e301-0x0;var _0x17f171=_0xf006[_0x39e301];return _0x17f171;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f00('0x0'))(_0x6f00('0x1'));var moment=require('moment');var BPromise=require(_0x6f00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f00('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6f00('0x4'));module[_0x6f00('0x5')]=function(_0x141e71,_0x52c9a2){return _0x141e71[_0x6f00('0x6')]('VoiceAgentReport',attributes,{'tableName':_0x6f00('0x7'),'paranoid':![],'indexes':[{'fields':[_0x6f00('0x8'),_0x6f00('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index e916871..e7f8ecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8d0=['CreateVoiceAgentReport','UpdateVoiceAgentReport','VoiceAgentReport','update','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','info'];(function(_0x13d499,_0x5dc664){var _0x538502=function(_0x16c016){while(--_0x16c016){_0x13d499['push'](_0x13d499['shift']());}};_0x538502(++_0x5dc664);}(_0xe8d0,0x165));var _0x0e8d=function(_0x1a3938,_0x509ef3){_0x1a3938=_0x1a3938-0x0;var _0xd760e4=_0xe8d0[_0x1a3938];return _0xd760e4;};'use strict';var _=require(_0x0e8d('0x0'));var util=require(_0x0e8d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0e8d('0x2'));var fs=require('fs');var Redis=require(_0x0e8d('0x3'));var db=require(_0x0e8d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e8d('0x5'))(_0x0e8d('0x6'));var config=require(_0x0e8d('0x7'));var jayson=require(_0x0e8d('0x8'));var client=jayson[_0x0e8d('0x9')][_0x0e8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb96f38,_0xa65061,_0x5376f1){return new BPromise(function(_0x51510,_0x1a7712){return client[_0x0e8d('0xb')](_0xb96f38,_0x5376f1)[_0x0e8d('0xc')](function(_0x10a836){logger['info'](_0x0e8d('0xd'),_0xa65061,_0x0e8d('0xe'));logger[_0x0e8d('0xf')](_0x0e8d('0x10'),_0xa65061,_0x0e8d('0xe'),JSON[_0x0e8d('0x11')](_0x10a836));if(_0x10a836['error']){if(_0x10a836[_0x0e8d('0x12')][_0x0e8d('0x13')]===0x1f4){logger[_0x0e8d('0x12')](_0x0e8d('0xd'),_0xa65061,_0x10a836['error']['message']);return _0x1a7712(_0x10a836[_0x0e8d('0x12')][_0x0e8d('0x14')]);}logger[_0x0e8d('0x12')](_0x0e8d('0xd'),_0xa65061,_0x10a836[_0x0e8d('0x12')][_0x0e8d('0x14')]);return _0x51510(_0x10a836[_0x0e8d('0x12')][_0x0e8d('0x14')]);}else{logger['info'](_0x0e8d('0xd'),_0xa65061,_0x0e8d('0xe'));_0x51510(_0x10a836[_0x0e8d('0x15')][_0x0e8d('0x14')]);}})[_0x0e8d('0x16')](function(_0x454db2){logger[_0x0e8d('0x12')](_0x0e8d('0xd'),_0xa65061,_0x454db2);_0x1a7712(_0x454db2);});});}exports['CreateVoiceAgentReport']=function(_0x778087){var _0x28a379=this;return new Promise(function(_0x2f0e6c,_0x3b7ed7){return db['VoiceAgentReport']['create'](_0x778087[_0x0e8d('0x17')],{'raw':_0x778087[_0x0e8d('0x18')]?_0x778087[_0x0e8d('0x18')][_0x0e8d('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x181e80){logger[_0x0e8d('0x1a')](_0x0e8d('0x1b'),_0x778087);logger[_0x0e8d('0xf')](_0x0e8d('0x1b'),_0x778087,JSON[_0x0e8d('0x11')](_0x181e80));_0x2f0e6c(_0x181e80);})['catch'](function(_0x35b5de){logger['error'](_0x0e8d('0x1b'),_0x35b5de['message'],_0x778087);_0x3b7ed7(_0x28a379[_0x0e8d('0x12')](0x1f4,_0x35b5de[_0x0e8d('0x14')]));});});};exports[_0x0e8d('0x1c')]=function(_0x4f60ec){var _0x432fa3=this;return new Promise(function(_0x41509b,_0x4f51dd){return db[_0x0e8d('0x1d')][_0x0e8d('0x1e')](_0x4f60ec[_0x0e8d('0x17')],{'raw':_0x4f60ec[_0x0e8d('0x18')]?_0x4f60ec[_0x0e8d('0x18')][_0x0e8d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f60ec[_0x0e8d('0x18')]?_0x4f60ec[_0x0e8d('0x18')]['where']||null:null,'attributes':_0x4f60ec[_0x0e8d('0x18')]?_0x4f60ec[_0x0e8d('0x18')]['attributes']||null:null,'limit':_0x4f60ec['options']?_0x4f60ec[_0x0e8d('0x18')][_0x0e8d('0x1f')]||null:null})[_0x0e8d('0xc')](function(_0x18effa){logger[_0x0e8d('0x1a')](_0x0e8d('0x1c'),_0x4f60ec);logger['debug']('UpdateVoiceAgentReport',_0x4f60ec,JSON[_0x0e8d('0x11')](_0x18effa));_0x41509b(_0x18effa);})[_0x0e8d('0x16')](function(_0xfb08a6){logger['error'](_0x0e8d('0x1c'),_0xfb08a6[_0x0e8d('0x14')],_0x4f60ec);_0x4f51dd(_0x432fa3[_0x0e8d('0x12')](0x1f4,_0xfb08a6[_0x0e8d('0x14')]));});});};
\ No newline at end of file
+var _0x285d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceAgentReport','create','body','options','UpdateVoiceAgentReport','VoiceAgentReport','raw','attributes','lodash','util','moment'];(function(_0x2f5a0d,_0x784aff){var _0x2df193=function(_0x1879e9){while(--_0x1879e9){_0x2f5a0d['push'](_0x2f5a0d['shift']());}};_0x2df193(++_0x784aff);}(_0x285d,0x11d));var _0xd285=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x285d[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xd285('0x0'));var util=require(_0xd285('0x1'));var moment=require(_0xd285('0x2'));var BPromise=require(_0xd285('0x3'));var rs=require(_0xd285('0x4'));var fs=require('fs');var Redis=require(_0xd285('0x5'));var db=require(_0xd285('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd285('0x7'))(_0xd285('0x8'));var config=require(_0xd285('0x9'));var jayson=require(_0xd285('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26ef9a,_0x30816b,_0x43d73f){return new BPromise(function(_0x53b6d6,_0x25aeec){return client[_0xd285('0xb')](_0x26ef9a,_0x43d73f)[_0xd285('0xc')](function(_0x4f1269){logger[_0xd285('0xd')](_0xd285('0xe'),_0x30816b,'request\x20sent');logger[_0xd285('0xf')](_0xd285('0x10'),_0x30816b,_0xd285('0x11'),JSON[_0xd285('0x12')](_0x4f1269));if(_0x4f1269[_0xd285('0x13')]){if(_0x4f1269[_0xd285('0x13')][_0xd285('0x14')]===0x1f4){logger[_0xd285('0x13')](_0xd285('0xe'),_0x30816b,_0x4f1269['error'][_0xd285('0x15')]);return _0x25aeec(_0x4f1269[_0xd285('0x13')][_0xd285('0x15')]);}logger['error'](_0xd285('0xe'),_0x30816b,_0x4f1269[_0xd285('0x13')][_0xd285('0x15')]);return _0x53b6d6(_0x4f1269['error']['message']);}else{logger['info'](_0xd285('0xe'),_0x30816b,_0xd285('0x11'));_0x53b6d6(_0x4f1269[_0xd285('0x16')][_0xd285('0x15')]);}})[_0xd285('0x17')](function(_0x3f3999){logger['error'](_0xd285('0xe'),_0x30816b,_0x3f3999);_0x25aeec(_0x3f3999);});});}exports[_0xd285('0x18')]=function(_0xf2d3){var _0x5cb666=this;return new Promise(function(_0x36684a,_0x4b44a8){return db['VoiceAgentReport'][_0xd285('0x19')](_0xf2d3[_0xd285('0x1a')],{'raw':_0xf2d3[_0xd285('0x1b')]?_0xf2d3[_0xd285('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5b4877){logger[_0xd285('0xd')](_0xd285('0x18'),_0xf2d3);logger['debug'](_0xd285('0x18'),_0xf2d3,JSON[_0xd285('0x12')](_0x5b4877));_0x36684a(_0x5b4877);})[_0xd285('0x17')](function(_0x5dc219){logger[_0xd285('0x13')](_0xd285('0x18'),_0x5dc219[_0xd285('0x15')],_0xf2d3);_0x4b44a8(_0x5cb666[_0xd285('0x13')](0x1f4,_0x5dc219[_0xd285('0x15')]));});});};exports[_0xd285('0x1c')]=function(_0x200ea4){var _0x10c269=this;return new Promise(function(_0x1a19dd,_0x54987c){return db[_0xd285('0x1d')]['update'](_0x200ea4[_0xd285('0x1a')],{'raw':_0x200ea4['options']?_0x200ea4[_0xd285('0x1b')][_0xd285('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200ea4[_0xd285('0x1b')]?_0x200ea4['options']['where']||null:null,'attributes':_0x200ea4[_0xd285('0x1b')]?_0x200ea4[_0xd285('0x1b')][_0xd285('0x1f')]||null:null,'limit':_0x200ea4[_0xd285('0x1b')]?_0x200ea4['options']['limit']||null:null})[_0xd285('0xc')](function(_0x3f9683){logger[_0xd285('0xd')]('UpdateVoiceAgentReport',_0x200ea4);logger['debug']('UpdateVoiceAgentReport',_0x200ea4,JSON[_0xd285('0x12')](_0x3f9683));_0x1a19dd(_0x3f9683);})[_0xd285('0x17')](function(_0x1d1311){logger[_0xd285('0x13')]('UpdateVoiceAgentReport',_0x1d1311[_0xd285('0x15')],_0x200ea4);_0x54987c(_0x10c269[_0xd285('0x13')](0x1f4,_0x1d1311[_0xd285('0x15')]));});});};
\ No newline at end of file
index 3e83e4f..6d8fef6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x362e87,_0x38d17c){var _0x334244=function(_0x24feb8){while(--_0x24feb8){_0x362e87['push'](_0x362e87['shift']());}};_0x334244(++_0x38d17c);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x4b84[_0x1d9aa0];return _0x226868;};'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('./voiceCallReport.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
+var _0xc978=['/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x218abc,_0x5cf090){var _0x3bfe82=function(_0x3828dd){while(--_0x3828dd){_0x218abc['push'](_0x218abc['shift']());}};_0x3bfe82(++_0x5cf090);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var path=require(_0x8c97('0x2'));var timeout=require(_0x8c97('0x3'));var express=require(_0x8c97('0x4'));var router=express[_0x8c97('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8c97('0x6'));var interaction=require(_0x8c97('0x7'));var config=require(_0x8c97('0x8'));var controller=require(_0x8c97('0x9'));router[_0x8c97('0xa')]('/',auth[_0x8c97('0xb')](),controller[_0x8c97('0xc')]);router['get'](_0x8c97('0xd'),auth[_0x8c97('0xb')](),controller[_0x8c97('0xe')]);router[_0x8c97('0xa')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x10')]);router['post']('/',auth[_0x8c97('0xb')](),controller[_0x8c97('0x11')]);router[_0x8c97('0x12')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x13')]);router[_0x8c97('0x14')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller['destroy']);module[_0x8c97('0x15')]=router;
\ No newline at end of file
index 6d48201..3df2b16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe9d=['ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x3600fb,_0x4c2cac){var _0x459250=function(_0x4e8e85){while(--_0x4e8e85){_0x3600fb['push'](_0x3600fb['shift']());}};_0x459250(++_0x4c2cac);}(_0xbe9d,0x99));var _0xdbe9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbe9d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xdbe9('0x0'));module[_0xdbe9('0x1')]={'uniqueid':{'type':Sequelize[_0xdbe9('0x2')]},'type':{'type':Sequelize[_0xdbe9('0x3')](_0xdbe9('0x4'),_0xdbe9('0x5'),_0xdbe9('0x6'),_0xdbe9('0x7'),_0xdbe9('0x8'),_0xdbe9('0x9'))},'tag':{'type':Sequelize[_0xdbe9('0x2')]},'accountcode':{'type':Sequelize[_0xdbe9('0x2')]},'source':{'type':Sequelize[_0xdbe9('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xdbe9('0x2')]},'channel':{'type':Sequelize[_0xdbe9('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xdbe9('0x2')]},'lastdata':{'type':Sequelize[_0xdbe9('0xa')]},'starttime':{'type':Sequelize[_0xdbe9('0xb')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xdbe9('0xb')]},'duration':{'type':Sequelize[_0xdbe9('0xc')]},'billableseconds':{'type':Sequelize[_0xdbe9('0xc')]},'mohtime':{'type':Sequelize[_0xdbe9('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xdbe9('0x2')]},'userfield':{'type':Sequelize[_0xdbe9('0x2')]},'userDisposition':{'type':Sequelize[_0xdbe9('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xdbe9('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xdbe9('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xdbe9('0xc')]},'sipcallid':{'type':Sequelize[_0xdbe9('0x2')]}};
\ No newline at end of file
+var _0xa801=['DATE','INTEGER','exports','ENUM','inbound','internal','outbound-fax','dialer','STRING','TEXT'];(function(_0x19cbcc,_0x44384e){var _0x44d405=function(_0x475354){while(--_0x475354){_0x19cbcc['push'](_0x19cbcc['shift']());}};_0x44d405(++_0x44384e);}(_0xa801,0x138));var _0x1a80=function(_0x22acbc,_0x2fb4da){_0x22acbc=_0x22acbc-0x0;var _0x14f3a8=_0xa801[_0x22acbc];return _0x14f3a8;};'use strict';var Sequelize=require('sequelize');module[_0x1a80('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1a80('0x1')](_0x1a80('0x2'),_0x1a80('0x3'),'outbound','inbound-fax',_0x1a80('0x4'),_0x1a80('0x5'))},'tag':{'type':Sequelize[_0x1a80('0x6')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x1a80('0x6')]},'destination':{'type':Sequelize[_0x1a80('0x6')]},'destinationcontext':{'type':Sequelize[_0x1a80('0x6')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1a80('0x6')]},'destinationchannel':{'type':Sequelize[_0x1a80('0x6')]},'lastapplication':{'type':Sequelize[_0x1a80('0x6')]},'lastdata':{'type':Sequelize[_0x1a80('0x7')]},'starttime':{'type':Sequelize[_0x1a80('0x8')]},'systemanswertime':{'type':Sequelize[_0x1a80('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x1a80('0x8')]},'duration':{'type':Sequelize[_0x1a80('0x9')]},'billableseconds':{'type':Sequelize[_0x1a80('0x9')]},'mohtime':{'type':Sequelize[_0x1a80('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1a80('0x6')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x1a80('0x6')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x1a80('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x1a80('0x6')]},'note':{'type':Sequelize[_0x1a80('0x6')]},'prefix':{'type':Sequelize[_0x1a80('0x6')]},'routeid':{'type':Sequelize[_0x1a80('0x9')]},'sipcallid':{'type':Sequelize[_0x1a80('0x6')]}};
\ No newline at end of file
index dbb9106..87f4ddd 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(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'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 _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x3fc835,_0x2dd750){_0x3fc835=_0x3fc835-0x0;var _0x5b7a86=_0x2032[_0x3fc835];return _0x5b7a86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));};
\ No newline at end of file
index 5c6d1ae..ed0fe45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb31d=['path','rimraf','../../config/environment','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0xfc9774,_0x39b1ab){var _0x5deca2=function(_0x38b73b){while(--_0x38b73b){_0xfc9774['push'](_0xfc9774['shift']());}};_0x5deca2(++_0x39b1ab);}(_0xb31d,0xca));var _0xdb31=function(_0x4e833c,_0x22b08d){_0x4e833c=_0x4e833c-0x0;var _0x34a080=_0xb31d[_0x4e833c];return _0x34a080;};'use strict';var _=require(_0xdb31('0x0'));var util=require(_0xdb31('0x1'));var logger=require(_0xdb31('0x2'))(_0xdb31('0x3'));var moment=require('moment');var BPromise=require(_0xdb31('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb31('0x5'));var rimraf=require(_0xdb31('0x6'));var config=require(_0xdb31('0x7'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x417282,_0x3b2113){return _0x417282['define']('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xdb31('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a4c=['rimraf','./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40e07f,_0x24971a){var _0x279259=function(_0x2d4cd2){while(--_0x2d4cd2){_0x40e07f['push'](_0x40e07f['shift']());}};_0x279259(++_0x24971a);}(_0x2a4c,0x148));var _0xc2a4=function(_0x21714f,_0x41a71d){_0x21714f=_0x21714f-0x0;var _0x119fd7=_0x2a4c[_0x21714f];return _0x119fd7;};'use strict';var _=require(_0xc2a4('0x0'));var util=require(_0xc2a4('0x1'));var logger=require(_0xc2a4('0x2'))(_0xc2a4('0x3'));var moment=require(_0xc2a4('0x4'));var BPromise=require(_0xc2a4('0x5'));var rp=require(_0xc2a4('0x6'));var fs=require('fs');var path=require(_0xc2a4('0x7'));var rimraf=require(_0xc2a4('0x8'));var config=require('../../config/environment');var attributes=require(_0xc2a4('0x9'));module[_0xc2a4('0xa')]=function(_0x22c061,_0x4efca6){return _0x22c061[_0xc2a4('0xb')]('VoiceCallReport',attributes,{'tableName':_0xc2a4('0xc'),'paranoid':![],'indexes':[{'fields':[_0xc2a4('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 9a8aff0..eaf42f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d41=['info','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','limit','include','map','model','catch','create','body','raw','CreateVoiceCallReport','where','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','request','then','debug','request\x20sent','stringify','error','VoiceCallReport,\x20%s,\x20%s','message'];(function(_0x379ca9,_0x268f7f){var _0x8c3467=function(_0x502132){while(--_0x502132){_0x379ca9['push'](_0x379ca9['shift']());}};_0x8c3467(++_0x268f7f);}(_0x8d41,0x95));var _0x18d4=function(_0x1df954,_0x3336ad){_0x1df954=_0x1df954-0x0;var _0x58b973=_0x8d41[_0x1df954];return _0x58b973;};'use strict';var _=require(_0x18d4('0x0'));var util=require(_0x18d4('0x1'));var moment=require(_0x18d4('0x2'));var BPromise=require('bluebird');var rs=require(_0x18d4('0x3'));var fs=require('fs');var Redis=require(_0x18d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x18d4('0x5'))(_0x18d4('0x6'));var config=require('../../config/environment');var jayson=require(_0x18d4('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfadb9f,_0x5613cf,_0x34a07e){return new BPromise(function(_0x2fccfc,_0x5bb676){return client[_0x18d4('0x8')](_0xfadb9f,_0x34a07e)[_0x18d4('0x9')](function(_0x3088c8){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x5613cf,'request\x20sent');logger[_0x18d4('0xa')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5613cf,_0x18d4('0xb'),JSON[_0x18d4('0xc')](_0x3088c8));if(_0x3088c8[_0x18d4('0xd')]){if(_0x3088c8['error']['code']===0x1f4){logger[_0x18d4('0xd')](_0x18d4('0xe'),_0x5613cf,_0x3088c8[_0x18d4('0xd')][_0x18d4('0xf')]);return _0x5bb676(_0x3088c8['error'][_0x18d4('0xf')]);}logger[_0x18d4('0xd')](_0x18d4('0xe'),_0x5613cf,_0x3088c8[_0x18d4('0xd')][_0x18d4('0xf')]);return _0x2fccfc(_0x3088c8[_0x18d4('0xd')][_0x18d4('0xf')]);}else{logger[_0x18d4('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x5613cf,_0x18d4('0xb'));_0x2fccfc(_0x3088c8['result'][_0x18d4('0xf')]);}})['catch'](function(_0x4de2c7){logger[_0x18d4('0xd')](_0x18d4('0xe'),_0x5613cf,_0x4de2c7);_0x5bb676(_0x4de2c7);});});}exports[_0x18d4('0x11')]=function(_0xd9c357){var _0x2237ce=this;return new Promise(function(_0x27615e,_0x2a529d){return db[_0x18d4('0x12')][_0x18d4('0x13')]({'raw':_0xd9c357[_0x18d4('0x14')]?_0xd9c357[_0x18d4('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xd9c357[_0x18d4('0x14')]?_0xd9c357[_0x18d4('0x14')]['where']||null:null,'attributes':_0xd9c357[_0x18d4('0x14')]?_0xd9c357[_0x18d4('0x14')][_0x18d4('0x15')]||null:null,'limit':_0xd9c357[_0x18d4('0x14')]?_0xd9c357['options'][_0x18d4('0x16')]||null:null,'include':_0xd9c357[_0x18d4('0x14')]?_0xd9c357['options'][_0x18d4('0x17')]?_[_0x18d4('0x18')](_0xd9c357[_0x18d4('0x14')][_0x18d4('0x17')],function(_0x57290a){return{'model':db[_0x57290a[_0x18d4('0x19')]],'as':_0x57290a['as'],'attributes':_0x57290a[_0x18d4('0x15')],'include':_0x57290a[_0x18d4('0x17')]?_['map'](_0x57290a[_0x18d4('0x17')],function(_0x12e441){return{'model':db[_0x12e441[_0x18d4('0x19')]],'as':_0x12e441['as'],'attributes':_0x12e441[_0x18d4('0x15')],'include':_0x12e441[_0x18d4('0x17')]?_[_0x18d4('0x18')](_0x12e441[_0x18d4('0x17')],function(_0x3ba7f3){return{'model':db[_0x3ba7f3['model']],'as':_0x3ba7f3['as'],'attributes':_0x3ba7f3['attributes']};}):[]};}):[]};}):[]:[]})[_0x18d4('0x9')](function(_0x10f4e9){logger[_0x18d4('0x10')](_0x18d4('0x11'),_0xd9c357);logger[_0x18d4('0xa')](_0x18d4('0x11'),_0xd9c357,JSON['stringify'](_0x10f4e9));_0x27615e(_0x10f4e9);})[_0x18d4('0x1a')](function(_0x415f48){logger['error'](_0x18d4('0x11'),_0x415f48[_0x18d4('0xf')],_0xd9c357);_0x2a529d(_0x2237ce['error'](0x1f4,_0x415f48[_0x18d4('0xf')]));});});};exports['CreateVoiceCallReport']=function(_0x1378c6){var _0x2ef70b=this;return new Promise(function(_0x23bab5,_0x53d7f4){return db['VoiceCallReport'][_0x18d4('0x1b')](_0x1378c6[_0x18d4('0x1c')],{'raw':_0x1378c6['options']?_0x1378c6[_0x18d4('0x14')][_0x18d4('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x66978d){logger[_0x18d4('0x10')](_0x18d4('0x1e'),_0x1378c6);logger[_0x18d4('0xa')](_0x18d4('0x1e'),_0x1378c6,JSON[_0x18d4('0xc')](_0x66978d));_0x23bab5(_0x66978d);})['catch'](function(_0x9ea2a9){logger[_0x18d4('0xd')](_0x18d4('0x1e'),_0x9ea2a9[_0x18d4('0xf')],_0x1378c6);_0x53d7f4(_0x2ef70b[_0x18d4('0xd')](0x1f4,_0x9ea2a9[_0x18d4('0xf')]));});});};exports['UpdateVoiceCallReport']=function(_0x320589){var _0x5bf392=this;return new Promise(function(_0x4880b1,_0x2330df){return db[_0x18d4('0x12')]['update'](_0x320589[_0x18d4('0x1c')],{'raw':_0x320589[_0x18d4('0x14')]?_0x320589[_0x18d4('0x14')][_0x18d4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x320589[_0x18d4('0x14')]?_0x320589[_0x18d4('0x14')][_0x18d4('0x1f')]||null:null,'attributes':_0x320589['options']?_0x320589[_0x18d4('0x14')][_0x18d4('0x15')]||null:null,'limit':_0x320589[_0x18d4('0x14')]?_0x320589[_0x18d4('0x14')]['limit']||null:null})['then'](function(_0x29b320){logger[_0x18d4('0x10')](_0x18d4('0x20'),_0x320589);logger[_0x18d4('0xa')]('UpdateVoiceCallReport',_0x320589,JSON[_0x18d4('0xc')](_0x29b320));_0x4880b1(_0x29b320);})[_0x18d4('0x1a')](function(_0x30d6c0){logger['error'](_0x18d4('0x20'),_0x30d6c0[_0x18d4('0xf')],_0x320589);_0x2330df(_0x5bf392[_0x18d4('0xd')](0x1f4,_0x30d6c0[_0x18d4('0xf')]));});});};
\ No newline at end of file
+var _0xb798=['model','attributes','debug','catch','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','include','map'];(function(_0x23844d,_0x3aaea6){var _0x4ebace=function(_0x51ce2e){while(--_0x51ce2e){_0x23844d['push'](_0x23844d['shift']());}};_0x4ebace(++_0x3aaea6);}(_0xb798,0x95));var _0x8b79=function(_0x3724f0,_0x11d904){_0x3724f0=_0x3724f0-0x0;var _0x28a062=_0xb798[_0x3724f0];return _0x28a062;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8b79('0x0'));var rs=require(_0x8b79('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b79('0x2'))['db'];var utils=require(_0x8b79('0x3'));var logger=require('../../config/logger')(_0x8b79('0x4'));var config=require('../../config/environment');var jayson=require(_0x8b79('0x5'));var client=jayson[_0x8b79('0x6')][_0x8b79('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2b452a,_0x35dc11,_0x5da5b5){return new BPromise(function(_0x31bd3f,_0x46ceaf){return client['request'](_0x2b452a,_0x5da5b5)[_0x8b79('0x8')](function(_0x327a9f){logger['info'](_0x8b79('0x9'),_0x35dc11,_0x8b79('0xa'));logger['debug'](_0x8b79('0xb'),_0x35dc11,_0x8b79('0xa'),JSON[_0x8b79('0xc')](_0x327a9f));if(_0x327a9f[_0x8b79('0xd')]){if(_0x327a9f[_0x8b79('0xd')][_0x8b79('0xe')]===0x1f4){logger[_0x8b79('0xd')](_0x8b79('0x9'),_0x35dc11,_0x327a9f['error']['message']);return _0x46ceaf(_0x327a9f[_0x8b79('0xd')][_0x8b79('0xf')]);}logger['error'](_0x8b79('0x9'),_0x35dc11,_0x327a9f[_0x8b79('0xd')]['message']);return _0x31bd3f(_0x327a9f[_0x8b79('0xd')]['message']);}else{logger[_0x8b79('0x10')](_0x8b79('0x9'),_0x35dc11,'request\x20sent');_0x31bd3f(_0x327a9f[_0x8b79('0x11')][_0x8b79('0xf')]);}})['catch'](function(_0x25052c){logger[_0x8b79('0xd')](_0x8b79('0x9'),_0x35dc11,_0x25052c);_0x46ceaf(_0x25052c);});});}exports[_0x8b79('0x12')]=function(_0x1f1f55){var _0x25dafc=this;return new Promise(function(_0x55331b,_0x3499ac){return db[_0x8b79('0x13')][_0x8b79('0x14')]({'raw':_0x1f1f55[_0x8b79('0x15')]?_0x1f1f55[_0x8b79('0x15')][_0x8b79('0x16')]===undefined?!![]:![]:!![],'where':_0x1f1f55[_0x8b79('0x15')]?_0x1f1f55[_0x8b79('0x15')][_0x8b79('0x17')]||null:null,'attributes':_0x1f1f55[_0x8b79('0x15')]?_0x1f1f55['options']['attributes']||null:null,'limit':_0x1f1f55[_0x8b79('0x15')]?_0x1f1f55[_0x8b79('0x15')]['limit']||null:null,'include':_0x1f1f55[_0x8b79('0x15')]?_0x1f1f55[_0x8b79('0x15')][_0x8b79('0x18')]?_[_0x8b79('0x19')](_0x1f1f55[_0x8b79('0x15')]['include'],function(_0x324392){return{'model':db[_0x324392[_0x8b79('0x1a')]],'as':_0x324392['as'],'attributes':_0x324392[_0x8b79('0x1b')],'include':_0x324392[_0x8b79('0x18')]?_[_0x8b79('0x19')](_0x324392[_0x8b79('0x18')],function(_0x2bdeec){return{'model':db[_0x2bdeec['model']],'as':_0x2bdeec['as'],'attributes':_0x2bdeec[_0x8b79('0x1b')],'include':_0x2bdeec[_0x8b79('0x18')]?_['map'](_0x2bdeec[_0x8b79('0x18')],function(_0x51040f){return{'model':db[_0x51040f[_0x8b79('0x1a')]],'as':_0x51040f['as'],'attributes':_0x51040f[_0x8b79('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8b79('0x8')](function(_0x27f85e){logger['info'](_0x8b79('0x12'),_0x1f1f55);logger[_0x8b79('0x1c')](_0x8b79('0x12'),_0x1f1f55,JSON[_0x8b79('0xc')](_0x27f85e));_0x55331b(_0x27f85e);})[_0x8b79('0x1d')](function(_0x4c2795){logger[_0x8b79('0xd')](_0x8b79('0x12'),_0x4c2795[_0x8b79('0xf')],_0x1f1f55);_0x3499ac(_0x25dafc['error'](0x1f4,_0x4c2795['message']));});});};exports[_0x8b79('0x1e')]=function(_0x523315){var _0x190edc=this;return new Promise(function(_0x565cda,_0x453148){return db['VoiceCallReport'][_0x8b79('0x1f')](_0x523315['body'],{'raw':_0x523315[_0x8b79('0x15')]?_0x523315[_0x8b79('0x15')][_0x8b79('0x16')]===undefined?!![]:![]:!![]})[_0x8b79('0x8')](function(_0x3d1182){logger[_0x8b79('0x10')](_0x8b79('0x1e'),_0x523315);logger[_0x8b79('0x1c')](_0x8b79('0x1e'),_0x523315,JSON['stringify'](_0x3d1182));_0x565cda(_0x3d1182);})[_0x8b79('0x1d')](function(_0x1708d1){logger[_0x8b79('0xd')](_0x8b79('0x1e'),_0x1708d1[_0x8b79('0xf')],_0x523315);_0x453148(_0x190edc[_0x8b79('0xd')](0x1f4,_0x1708d1[_0x8b79('0xf')]));});});};exports[_0x8b79('0x20')]=function(_0x48e68f){var _0x3a0f06=this;return new Promise(function(_0x27e127,_0x41661a){return db[_0x8b79('0x13')][_0x8b79('0x21')](_0x48e68f[_0x8b79('0x22')],{'raw':_0x48e68f[_0x8b79('0x15')]?_0x48e68f[_0x8b79('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48e68f[_0x8b79('0x15')]?_0x48e68f[_0x8b79('0x15')]['where']||null:null,'attributes':_0x48e68f[_0x8b79('0x15')]?_0x48e68f[_0x8b79('0x15')][_0x8b79('0x1b')]||null:null,'limit':_0x48e68f[_0x8b79('0x15')]?_0x48e68f['options']['limit']||null:null})[_0x8b79('0x8')](function(_0x33dc69){logger['info']('UpdateVoiceCallReport',_0x48e68f);logger['debug'](_0x8b79('0x20'),_0x48e68f,JSON[_0x8b79('0xc')](_0x33dc69));_0x27e127(_0x33dc69);})[_0x8b79('0x1d')](function(_0x20ddd0){logger[_0x8b79('0xd')](_0x8b79('0x20'),_0x20ddd0[_0x8b79('0xf')],_0x48e68f);_0x41661a(_0x3a0f06[_0x8b79('0xd')](0x1f4,_0x20ddd0[_0x8b79('0xf')]));});});};
\ No newline at end of file
index c0d3e70..f8bb911 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1b3=['delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x5ee644,_0x420859){var _0x2a4a6a=function(_0x2f2b59){while(--_0x2f2b59){_0x5ee644['push'](_0x5ee644['shift']());}};_0x2a4a6a(++_0x420859);}(_0xd1b3,0xff));var _0x3d1b=function(_0x4261fe,_0x12459e){_0x4261fe=_0x4261fe-0x0;var _0x193fd1=_0xd1b3[_0x4261fe];return _0x193fd1;};'use strict';var multer=require(_0x3d1b('0x0'));var util=require(_0x3d1b('0x1'));var path=require('path');var timeout=require(_0x3d1b('0x2'));var express=require(_0x3d1b('0x3'));var router=express['Router']();var fs_extra=require(_0x3d1b('0x4'));var auth=require(_0x3d1b('0x5'));var interaction=require(_0x3d1b('0x6'));var config=require(_0x3d1b('0x7'));var controller=require(_0x3d1b('0x8'));router[_0x3d1b('0x9')]('/',auth['isAuthenticated'](),controller[_0x3d1b('0xa')]);router[_0x3d1b('0x9')](_0x3d1b('0xb'),auth[_0x3d1b('0xc')](),controller[_0x3d1b('0xd')]);router[_0x3d1b('0xe')]('/',auth[_0x3d1b('0xc')](),controller[_0x3d1b('0xf')]);router[_0x3d1b('0x10')](_0x3d1b('0xb'),auth[_0x3d1b('0xc')](),controller[_0x3d1b('0x11')]);router[_0x3d1b('0x12')](_0x3d1b('0xb'),auth[_0x3d1b('0xc')](),controller[_0x3d1b('0x13')]);module[_0x3d1b('0x14')]=router;
\ No newline at end of file
+var _0x30b4=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','destroy','exports','multer','util','path','express','Router'];(function(_0x3abeb0,_0x83c65a){var _0x439ba7=function(_0x45cd6c){while(--_0x45cd6c){_0x3abeb0['push'](_0x3abeb0['shift']());}};_0x439ba7(++_0x83c65a);}(_0x30b4,0x1cf));var _0x430b=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x30b4[_0x4b03c9];return _0x161ba2;};'use strict';var multer=require(_0x430b('0x0'));var util=require(_0x430b('0x1'));var path=require(_0x430b('0x2'));var timeout=require('connect-timeout');var express=require(_0x430b('0x3'));var router=express[_0x430b('0x4')]();var fs_extra=require(_0x430b('0x5'));var auth=require(_0x430b('0x6'));var interaction=require(_0x430b('0x7'));var config=require(_0x430b('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x430b('0x9')]('/',auth[_0x430b('0xa')](),controller[_0x430b('0xb')]);router[_0x430b('0x9')](_0x430b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x430b('0xd')]('/',auth[_0x430b('0xa')](),controller[_0x430b('0xe')]);router[_0x430b('0xf')](_0x430b('0xc'),auth[_0x430b('0xa')](),controller['update']);router['delete'](_0x430b('0xc'),auth[_0x430b('0xa')](),controller[_0x430b('0x10')]);module[_0x430b('0x11')]=router;
\ No newline at end of file
index 6174fdc..a8aa9d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x010e=['getDataValue','split','BOOLEAN','sequelize','STRING','name','setDataValue','options','join'];(function(_0x54693e,_0x26f4ad){var _0x43ffa6=function(_0x19dedc){while(--_0x19dedc){_0x54693e['push'](_0x54693e['shift']());}};_0x43ffa6(++_0x26f4ad);}(_0x010e,0x81));var _0xe010=function(_0x1b17a7,_0x5360ca){_0x1b17a7=_0x1b17a7-0x0;var _0x4b3580=_0x010e[_0x1b17a7];return _0x4b3580;};'use strict';var Sequelize=require(_0xe010('0x0'));module['exports']={'name':{'type':Sequelize[_0xe010('0x1')]},'prefix':{'type':Sequelize[_0xe010('0x1')],'unique':_0xe010('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xe010('0x1')],'set':function(_0x5b1815){this[_0xe010('0x3')](_0xe010('0x4'),_0x5b1815?_0x5b1815[_0xe010('0x5')](''):[]);},'get':function(){return this[_0xe010('0x6')](_0xe010('0x4'))?this[_0xe010('0x6')](_0xe010('0x4'))[_0xe010('0x7')](''):[];}},'auth':{'type':Sequelize[_0xe010('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xe010('0x1')]},'record':{'type':Sequelize[_0xe010('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe010('0x1')]},'description':{'type':Sequelize[_0xe010('0x1')]}};
\ No newline at end of file
+var _0x79d5=['sequelize','exports','STRING','name','setDataValue','getDataValue','options','BOOLEAN'];(function(_0x5c5393,_0x2909e8){var _0x360d7f=function(_0x149eb7){while(--_0x149eb7){_0x5c5393['push'](_0x5c5393['shift']());}};_0x360d7f(++_0x2909e8);}(_0x79d5,0x148));var _0x579d=function(_0x1d5ba8,_0x412a52){_0x1d5ba8=_0x1d5ba8-0x0;var _0x1022a2=_0x79d5[_0x1d5ba8];return _0x1022a2;};'use strict';var Sequelize=require(_0x579d('0x0'));module[_0x579d('0x1')]={'name':{'type':Sequelize[_0x579d('0x2')]},'prefix':{'type':Sequelize[_0x579d('0x2')],'unique':_0x579d('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x290b23){this[_0x579d('0x4')]('options',_0x290b23?_0x290b23['join'](''):[]);},'get':function(){return this[_0x579d('0x5')](_0x579d('0x6'))?this[_0x579d('0x5')]('options')['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x579d('0x2')]},'record':{'type':Sequelize[_0x579d('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x579d('0x2')]},'description':{'type':Sequelize[_0x579d('0x2')]}};
\ No newline at end of file
index 6d7c2f6..55210c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3098=['UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show','params','options','catch','create','body','user','get','role','ChanSpies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then'];(function(_0x3e7954,_0x7d8017){var _0xb028d=function(_0x50f311){while(--_0x50f311){_0x3e7954['push'](_0x3e7954['shift']());}};_0xb028d(++_0x7d8017);}(_0x3098,0x86));var _0x8309=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x3098[_0x387777];return _0x3f84c0;};'use strict';var emlformat=require(_0x8309('0x0'));var rimraf=require(_0x8309('0x1'));var zipdir=require(_0x8309('0x2'));var jsonpatch=require(_0x8309('0x3'));var rp=require('request-promise');var moment=require(_0x8309('0x4'));var BPromise=require(_0x8309('0x5'));var Mustache=require(_0x8309('0x6'));var util=require(_0x8309('0x7'));var path=require(_0x8309('0x8'));var sox=require(_0x8309('0x9'));var csv=require(_0x8309('0xa'));var ejs=require(_0x8309('0xb'));var fs=require('fs');var fs_extra=require(_0x8309('0xc'));var _=require(_0x8309('0xd'));var squel=require('squel');var crypto=require(_0x8309('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8309('0xf'));var toCsv=require(_0x8309('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8309('0x10'));var authService=require(_0x8309('0x11'));var qs=require(_0x8309('0x12'));var as=require(_0x8309('0x13'));var hardwareService=require(_0x8309('0x14'));var logger=require('../../config/logger')(_0x8309('0x15'));var utils=require(_0x8309('0x16'));var config=require(_0x8309('0x17'));var licenseUtil=require(_0x8309('0x18'));var db=require(_0x8309('0x19'))['db'];function respondWithStatusCode(_0x53ebac,_0x2473d2){_0x2473d2=_0x2473d2||0xcc;return function(_0x4a05c4){if(_0x4a05c4){return _0x53ebac[_0x8309('0x1a')](_0x2473d2);}return _0x53ebac['status'](_0x2473d2)[_0x8309('0x1b')]();};}function respondWithResult(_0x38bbc0,_0x419bff){_0x419bff=_0x419bff||0xc8;return function(_0x264867){if(_0x264867){return _0x38bbc0[_0x8309('0x1c')](_0x419bff)[_0x8309('0x1d')](_0x264867);}};}function respondWithFilteredResult(_0x3b7a1f,_0x5424cd){return function(_0x49e8a7){if(_0x49e8a7){var _0x2aefda=typeof _0x5424cd[_0x8309('0x1e')]===_0x8309('0x1f')&&typeof _0x5424cd[_0x8309('0x20')]===_0x8309('0x1f');var _0x28bfec=_0x49e8a7[_0x8309('0x21')];var _0x97f042=_0x2aefda?0x0:_0x5424cd['offset'];var _0x353f64=_0x2aefda?_0x49e8a7[_0x8309('0x21')]:_0x5424cd[_0x8309('0x1e')]+_0x5424cd[_0x8309('0x20')];var _0x1c86be;if(_0x353f64>=_0x28bfec){_0x353f64=_0x28bfec;_0x1c86be=0xc8;}else{_0x1c86be=0xce;}_0x3b7a1f[_0x8309('0x1c')](_0x1c86be);return _0x3b7a1f[_0x8309('0x22')](_0x8309('0x23'),_0x97f042+'-'+_0x353f64+'/'+_0x28bfec)[_0x8309('0x1d')](_0x49e8a7);}return null;};}function patchUpdates(_0x415490){return function(_0x3dc639){try{jsonpatch[_0x8309('0x24')](_0x3dc639,_0x415490,!![]);}catch(_0x5b252b){return BPromise['reject'](_0x5b252b);}return _0x3dc639[_0x8309('0x25')]();};}function saveUpdates(_0x1ffe6e,_0x39989f){return function(_0x37eaa7){if(_0x37eaa7){return _0x37eaa7[_0x8309('0x26')](_0x1ffe6e)[_0x8309('0x27')](function(_0x5d0096){return _0x5d0096;});}return null;};}function removeEntity(_0x25e62e,_0x350f51){return function(_0x3599da){if(_0x3599da){return _0x3599da['destroy']()[_0x8309('0x27')](function(){var _0x35c0e6=_0x3599da['get']({'plain':!![]});var _0x166902='ChanSpies';return db[_0x8309('0x28')]['destroy']({'where':{'type':_0x166902,'resourceId':_0x35c0e6['id']}})[_0x8309('0x27')](function(){return _0x3599da;});})[_0x8309('0x27')](function(){_0x25e62e[_0x8309('0x1c')](0xcc)[_0x8309('0x1b')]();});}};}function handleEntityNotFound(_0x590687,_0xe44493){return function(_0x26a378){if(!_0x26a378){_0x590687[_0x8309('0x1a')](0x194);}return _0x26a378;};}function handleError(_0x5f2f68,_0xbed74d){_0xbed74d=_0xbed74d||0x1f4;return function(_0x573fcd){logger[_0x8309('0x29')](_0x573fcd[_0x8309('0x2a')]);if(_0x573fcd[_0x8309('0x2b')]){delete _0x573fcd[_0x8309('0x2b')];}_0x5f2f68[_0x8309('0x1c')](_0xbed74d)[_0x8309('0x2c')](_0x573fcd);};}exports[_0x8309('0x2d')]=function(_0x45a763,_0x9c66b8){var _0x52628d={},_0x5680d8={},_0x3d829c={'count':0x0,'rows':[]};var _0x3fe2d1=_[_0x8309('0x2e')](db[_0x8309('0x2f')][_0x8309('0x30')],function(_0x379776){return{'name':_0x379776[_0x8309('0x31')],'type':_0x379776['type'][_0x8309('0x32')]};});_0x5680d8[_0x8309('0x33')]=_[_0x8309('0x2e')](_0x3fe2d1,_0x8309('0x2b'));_0x5680d8[_0x8309('0x34')]=_[_0x8309('0x35')](_0x45a763[_0x8309('0x34')]);_0x5680d8['filters']=_['intersection'](_0x5680d8['model'],_0x5680d8['query']);_0x52628d['attributes']=_[_0x8309('0x36')](_0x5680d8[_0x8309('0x33')],qs[_0x8309('0x37')](_0x45a763[_0x8309('0x34')][_0x8309('0x37')]));_0x52628d['attributes']=_0x52628d[_0x8309('0x38')][_0x8309('0x39')]?_0x52628d['attributes']:_0x5680d8[_0x8309('0x33')];if(!_0x45a763[_0x8309('0x34')][_0x8309('0x3a')](_0x8309('0x3b'))){_0x52628d[_0x8309('0x20')]=qs['limit'](_0x45a763['query'][_0x8309('0x20')]);_0x52628d['offset']=qs[_0x8309('0x1e')](_0x45a763[_0x8309('0x34')][_0x8309('0x1e')]);}_0x52628d['order']=qs[_0x8309('0x3c')](_0x45a763['query'][_0x8309('0x3c')]);_0x52628d[_0x8309('0x3d')]=qs[_0x8309('0x3e')](_[_0x8309('0x3f')](_0x45a763[_0x8309('0x34')],_0x5680d8[_0x8309('0x3e')]),_0x3fe2d1);if(_0x45a763[_0x8309('0x34')][_0x8309('0x40')]){_0x52628d[_0x8309('0x3d')]=_[_0x8309('0x41')](_0x52628d['where'],{'$or':_[_0x8309('0x2e')](_0x3fe2d1,function(_0x452fee){if(_0x452fee[_0x8309('0x42')]!==_0x8309('0x43')){var _0x4ecd62={};_0x4ecd62[_0x452fee[_0x8309('0x2b')]]={'$like':'%'+_0x45a763['query'][_0x8309('0x40')]+'%'};return _0x4ecd62;}})});}_0x52628d=_[_0x8309('0x41')]({},_0x52628d,_0x45a763['options']);var _0xd00993={'where':_0x52628d[_0x8309('0x3d')]};return db[_0x8309('0x2f')][_0x8309('0x21')](_0xd00993)[_0x8309('0x27')](function(_0x1eea45){_0x3d829c[_0x8309('0x21')]=_0x1eea45;if(_0x45a763[_0x8309('0x34')][_0x8309('0x44')]){_0x52628d[_0x8309('0x45')]=[{'all':!![]}];}return db[_0x8309('0x2f')]['findAll'](_0x52628d);})[_0x8309('0x27')](function(_0x269fcd){_0x3d829c[_0x8309('0x46')]=_0x269fcd;return _0x3d829c;})[_0x8309('0x27')](respondWithFilteredResult(_0x9c66b8,_0x52628d))['catch'](handleError(_0x9c66b8,null));};exports[_0x8309('0x47')]=function(_0xbf1309,_0x3a4342){var _0x6a9cd4={'raw':![],'where':{'id':_0xbf1309[_0x8309('0x48')]['id']}},_0x5edc96={};_0x5edc96[_0x8309('0x33')]=_['keys'](db['VoiceChanSpy']['rawAttributes']);_0x5edc96[_0x8309('0x34')]=_[_0x8309('0x35')](_0xbf1309['query']);_0x5edc96['filters']=_[_0x8309('0x36')](_0x5edc96[_0x8309('0x33')],_0x5edc96[_0x8309('0x34')]);_0x6a9cd4[_0x8309('0x38')]=_[_0x8309('0x36')](_0x5edc96[_0x8309('0x33')],qs[_0x8309('0x37')](_0xbf1309[_0x8309('0x34')][_0x8309('0x37')]));_0x6a9cd4[_0x8309('0x38')]=_0x6a9cd4[_0x8309('0x38')][_0x8309('0x39')]?_0x6a9cd4['attributes']:_0x5edc96[_0x8309('0x33')];if(_0xbf1309[_0x8309('0x34')]['includeAll']){_0x6a9cd4['include']=[{'all':!![]}];}_0x6a9cd4=_[_0x8309('0x41')]({},_0x6a9cd4,_0xbf1309[_0x8309('0x49')]);return db[_0x8309('0x2f')]['find'](_0x6a9cd4)['then'](handleEntityNotFound(_0x3a4342,null))[_0x8309('0x27')](respondWithResult(_0x3a4342,null))[_0x8309('0x4a')](handleError(_0x3a4342,null));};exports[_0x8309('0x4b')]=function(_0x421ff5,_0xa88f42){return db[_0x8309('0x2f')][_0x8309('0x4b')](_0x421ff5[_0x8309('0x4c')],{})[_0x8309('0x27')](function(_0x55e7b5){var _0x22e92a=_0x421ff5[_0x8309('0x4d')][_0x8309('0x4e')]({'plain':!![]});if(!_0x22e92a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22e92a[_0x8309('0x4f')]===_0x8309('0x4d')){var _0x57ace2=_0x55e7b5[_0x8309('0x4e')]({'plain':!![]});var _0x30b810=_0x8309('0x50');return db[_0x8309('0x51')][_0x8309('0x52')]({'where':{'name':_0x30b810,'userProfileId':_0x22e92a[_0x8309('0x53')]},'raw':!![]})[_0x8309('0x27')](function(_0x15d5fc){if(_0x15d5fc&&_0x15d5fc[_0x8309('0x54')]===0x0){return db[_0x8309('0x28')]['create']({'name':_0x57ace2[_0x8309('0x2b')],'resourceId':_0x57ace2['id'],'type':_0x15d5fc[_0x8309('0x2b')],'sectionId':_0x15d5fc['id']},{})[_0x8309('0x27')](function(){return _0x55e7b5;});}else{return _0x55e7b5;}})['catch'](function(_0x453365){logger[_0x8309('0x29')](_0x8309('0x55'),_0x453365);throw _0x453365;});}return _0x55e7b5;})[_0x8309('0x27')](respondWithResult(_0xa88f42,0xc9))[_0x8309('0x4a')](handleError(_0xa88f42,null));};exports[_0x8309('0x26')]=function(_0x4c25cf,_0x45f095){if(_0x4c25cf['body']['id']){delete _0x4c25cf['body']['id'];}return db[_0x8309('0x2f')][_0x8309('0x52')]({'where':{'id':_0x4c25cf['params']['id']}})[_0x8309('0x27')](handleEntityNotFound(_0x45f095,null))[_0x8309('0x27')](saveUpdates(_0x4c25cf[_0x8309('0x4c')],null))[_0x8309('0x27')](respondWithResult(_0x45f095,null))[_0x8309('0x4a')](handleError(_0x45f095,null));};exports[_0x8309('0x56')]=function(_0x3c0c4e,_0x17f7d3){return db['VoiceChanSpy'][_0x8309('0x52')]({'where':{'id':_0x3c0c4e[_0x8309('0x48')]['id']}})[_0x8309('0x27')](handleEntityNotFound(_0x17f7d3,null))['then'](removeEntity(_0x17f7d3,null))[_0x8309('0x4a')](handleError(_0x17f7d3,null));};
\ No newline at end of file
+var _0xcab6=['json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','stack','name','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','attributes','fields','length','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','end','status'];(function(_0x5dbf70,_0x898108){var _0x45bd10=function(_0x58227e){while(--_0x58227e){_0x5dbf70['push'](_0x5dbf70['shift']());}};_0x45bd10(++_0x898108);}(_0xcab6,0xd4));var _0x6cab=function(_0x24edb5,_0x5a4a70){_0x24edb5=_0x24edb5-0x0;var _0x22e13c=_0xcab6[_0x24edb5];return _0x22e13c;};'use strict';var emlformat=require(_0x6cab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6cab('0x1'));var jsonpatch=require(_0x6cab('0x2'));var rp=require(_0x6cab('0x3'));var moment=require(_0x6cab('0x4'));var BPromise=require(_0x6cab('0x5'));var Mustache=require(_0x6cab('0x6'));var util=require('util');var path=require(_0x6cab('0x7'));var sox=require('sox');var csv=require(_0x6cab('0x8'));var ejs=require(_0x6cab('0x9'));var fs=require('fs');var fs_extra=require(_0x6cab('0xa'));var _=require('lodash');var squel=require(_0x6cab('0xb'));var crypto=require(_0x6cab('0xc'));var jsforce=require(_0x6cab('0xd'));var deskjs=require(_0x6cab('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6cab('0xf'));var Redis=require(_0x6cab('0x10'));var authService=require(_0x6cab('0x11'));var qs=require(_0x6cab('0x12'));var as=require(_0x6cab('0x13'));var hardwareService=require(_0x6cab('0x14'));var logger=require('../../config/logger')(_0x6cab('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6cab('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b8609,_0x5a4033){_0x5a4033=_0x5a4033||0xcc;return function(_0x4f5067){if(_0x4f5067){return _0x3b8609['sendStatus'](_0x5a4033);}return _0x3b8609['status'](_0x5a4033)[_0x6cab('0x17')]();};}function respondWithResult(_0x971a60,_0x278be9){_0x278be9=_0x278be9||0xc8;return function(_0x30474f){if(_0x30474f){return _0x971a60[_0x6cab('0x18')](_0x278be9)[_0x6cab('0x19')](_0x30474f);}};}function respondWithFilteredResult(_0x256dbc,_0x22ea54){return function(_0x36f5e9){if(_0x36f5e9){var _0x1fc3e8=typeof _0x22ea54[_0x6cab('0x1a')]===_0x6cab('0x1b')&&typeof _0x22ea54[_0x6cab('0x1c')]==='undefined';var _0x1ff3c6=_0x36f5e9[_0x6cab('0x1d')];var _0x4e9bcb=_0x1fc3e8?0x0:_0x22ea54[_0x6cab('0x1a')];var _0x5240c1=_0x1fc3e8?_0x36f5e9[_0x6cab('0x1d')]:_0x22ea54[_0x6cab('0x1a')]+_0x22ea54['limit'];var _0x4b009c;if(_0x5240c1>=_0x1ff3c6){_0x5240c1=_0x1ff3c6;_0x4b009c=0xc8;}else{_0x4b009c=0xce;}_0x256dbc[_0x6cab('0x18')](_0x4b009c);return _0x256dbc[_0x6cab('0x1e')](_0x6cab('0x1f'),_0x4e9bcb+'-'+_0x5240c1+'/'+_0x1ff3c6)[_0x6cab('0x19')](_0x36f5e9);}return null;};}function patchUpdates(_0xa36dad){return function(_0x565a51){try{jsonpatch['apply'](_0x565a51,_0xa36dad,!![]);}catch(_0x3bbf68){return BPromise['reject'](_0x3bbf68);}return _0x565a51[_0x6cab('0x20')]();};}function saveUpdates(_0x3f8516,_0x4784a0){return function(_0x22c401){if(_0x22c401){return _0x22c401[_0x6cab('0x21')](_0x3f8516)[_0x6cab('0x22')](function(_0x163680){return _0x163680;});}return null;};}function removeEntity(_0x6efcb8,_0xd1698a){return function(_0xe6a99e){if(_0xe6a99e){return _0xe6a99e[_0x6cab('0x23')]()[_0x6cab('0x22')](function(){var _0xbfbeca=_0xe6a99e['get']({'plain':!![]});var _0x59acf4='ChanSpies';return db['UserProfileResource']['destroy']({'where':{'type':_0x59acf4,'resourceId':_0xbfbeca['id']}})[_0x6cab('0x22')](function(){return _0xe6a99e;});})[_0x6cab('0x22')](function(){_0x6efcb8[_0x6cab('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ae4e7,_0x3e7041){return function(_0x1f1729){if(!_0x1f1729){_0x2ae4e7[_0x6cab('0x24')](0x194);}return _0x1f1729;};}function handleError(_0x5ed564,_0x3b2690){_0x3b2690=_0x3b2690||0x1f4;return function(_0x3c5de1){logger['error'](_0x3c5de1[_0x6cab('0x25')]);if(_0x3c5de1['name']){delete _0x3c5de1[_0x6cab('0x26')];}_0x5ed564['status'](_0x3b2690)['send'](_0x3c5de1);};}exports[_0x6cab('0x27')]=function(_0x586dac,_0x1c3319){var _0xd983ea={},_0x5c48cd={},_0x5af167={'count':0x0,'rows':[]};var _0x70a8ef=_[_0x6cab('0x28')](db[_0x6cab('0x29')]['rawAttributes'],function(_0x52ed72){return{'name':_0x52ed72[_0x6cab('0x2a')],'type':_0x52ed72[_0x6cab('0x2b')][_0x6cab('0x2c')]};});_0x5c48cd[_0x6cab('0x2d')]=_[_0x6cab('0x28')](_0x70a8ef,_0x6cab('0x26'));_0x5c48cd[_0x6cab('0x2e')]=_[_0x6cab('0x2f')](_0x586dac['query']);_0x5c48cd['filters']=_['intersection'](_0x5c48cd[_0x6cab('0x2d')],_0x5c48cd[_0x6cab('0x2e')]);_0xd983ea[_0x6cab('0x30')]=_['intersection'](_0x5c48cd[_0x6cab('0x2d')],qs[_0x6cab('0x31')](_0x586dac[_0x6cab('0x2e')]['fields']));_0xd983ea[_0x6cab('0x30')]=_0xd983ea[_0x6cab('0x30')][_0x6cab('0x32')]?_0xd983ea['attributes']:_0x5c48cd[_0x6cab('0x2d')];if(!_0x586dac['query']['hasOwnProperty']('nolimit')){_0xd983ea[_0x6cab('0x1c')]=qs[_0x6cab('0x1c')](_0x586dac['query'][_0x6cab('0x1c')]);_0xd983ea[_0x6cab('0x1a')]=qs[_0x6cab('0x1a')](_0x586dac[_0x6cab('0x2e')][_0x6cab('0x1a')]);}_0xd983ea[_0x6cab('0x33')]=qs[_0x6cab('0x34')](_0x586dac[_0x6cab('0x2e')][_0x6cab('0x34')]);_0xd983ea[_0x6cab('0x35')]=qs['filters'](_[_0x6cab('0x36')](_0x586dac['query'],_0x5c48cd[_0x6cab('0x37')]),_0x70a8ef);if(_0x586dac['query'][_0x6cab('0x38')]){_0xd983ea[_0x6cab('0x35')]=_[_0x6cab('0x39')](_0xd983ea['where'],{'$or':_[_0x6cab('0x28')](_0x70a8ef,function(_0x452f19){if(_0x452f19[_0x6cab('0x2b')]!==_0x6cab('0x3a')){var _0xe3ca3b={};_0xe3ca3b[_0x452f19['name']]={'$like':'%'+_0x586dac[_0x6cab('0x2e')][_0x6cab('0x38')]+'%'};return _0xe3ca3b;}})});}_0xd983ea=_[_0x6cab('0x39')]({},_0xd983ea,_0x586dac[_0x6cab('0x3b')]);var _0x1e210a={'where':_0xd983ea[_0x6cab('0x35')]};return db[_0x6cab('0x29')][_0x6cab('0x1d')](_0x1e210a)[_0x6cab('0x22')](function(_0x4c33c8){_0x5af167['count']=_0x4c33c8;if(_0x586dac[_0x6cab('0x2e')][_0x6cab('0x3c')]){_0xd983ea[_0x6cab('0x3d')]=[{'all':!![]}];}return db[_0x6cab('0x29')][_0x6cab('0x3e')](_0xd983ea);})[_0x6cab('0x22')](function(_0x35ccd1){_0x5af167[_0x6cab('0x3f')]=_0x35ccd1;return _0x5af167;})[_0x6cab('0x22')](respondWithFilteredResult(_0x1c3319,_0xd983ea))['catch'](handleError(_0x1c3319,null));};exports[_0x6cab('0x40')]=function(_0x26ce12,_0x55aa26){var _0x33a4dc={'raw':![],'where':{'id':_0x26ce12[_0x6cab('0x41')]['id']}},_0x27dc1c={};_0x27dc1c['model']=_[_0x6cab('0x2f')](db['VoiceChanSpy']['rawAttributes']);_0x27dc1c['query']=_[_0x6cab('0x2f')](_0x26ce12['query']);_0x27dc1c[_0x6cab('0x37')]=_[_0x6cab('0x42')](_0x27dc1c['model'],_0x27dc1c[_0x6cab('0x2e')]);_0x33a4dc[_0x6cab('0x30')]=_['intersection'](_0x27dc1c[_0x6cab('0x2d')],qs[_0x6cab('0x31')](_0x26ce12[_0x6cab('0x2e')]['fields']));_0x33a4dc[_0x6cab('0x30')]=_0x33a4dc[_0x6cab('0x30')][_0x6cab('0x32')]?_0x33a4dc[_0x6cab('0x30')]:_0x27dc1c[_0x6cab('0x2d')];if(_0x26ce12[_0x6cab('0x2e')][_0x6cab('0x3c')]){_0x33a4dc[_0x6cab('0x3d')]=[{'all':!![]}];}_0x33a4dc=_[_0x6cab('0x39')]({},_0x33a4dc,_0x26ce12[_0x6cab('0x3b')]);return db[_0x6cab('0x29')][_0x6cab('0x43')](_0x33a4dc)[_0x6cab('0x22')](handleEntityNotFound(_0x55aa26,null))['then'](respondWithResult(_0x55aa26,null))[_0x6cab('0x44')](handleError(_0x55aa26,null));};exports['create']=function(_0x41a889,_0x110985){return db['VoiceChanSpy'][_0x6cab('0x45')](_0x41a889[_0x6cab('0x46')],{})[_0x6cab('0x22')](function(_0x1ccd7d){var _0x32a906=_0x41a889[_0x6cab('0x47')][_0x6cab('0x48')]({'plain':!![]});if(!_0x32a906)throw new Error(_0x6cab('0x49'));if(_0x32a906['role']===_0x6cab('0x47')){var _0x4fbd61=_0x1ccd7d[_0x6cab('0x48')]({'plain':!![]});var _0x1d58d9='ChanSpies';return db[_0x6cab('0x4a')]['find']({'where':{'name':_0x1d58d9,'userProfileId':_0x32a906[_0x6cab('0x4b')]},'raw':!![]})[_0x6cab('0x22')](function(_0xd36abd){if(_0xd36abd&&_0xd36abd[_0x6cab('0x4c')]===0x0){return db['UserProfileResource'][_0x6cab('0x45')]({'name':_0x4fbd61[_0x6cab('0x26')],'resourceId':_0x4fbd61['id'],'type':_0xd36abd[_0x6cab('0x26')],'sectionId':_0xd36abd['id']},{})[_0x6cab('0x22')](function(){return _0x1ccd7d;});}else{return _0x1ccd7d;}})['catch'](function(_0x2ce26c){logger[_0x6cab('0x4d')](_0x6cab('0x4e'),_0x2ce26c);throw _0x2ce26c;});}return _0x1ccd7d;})[_0x6cab('0x22')](respondWithResult(_0x110985,0xc9))[_0x6cab('0x44')](handleError(_0x110985,null));};exports['update']=function(_0x4acda7,_0x4aceed){if(_0x4acda7[_0x6cab('0x46')]['id']){delete _0x4acda7['body']['id'];}return db[_0x6cab('0x29')][_0x6cab('0x43')]({'where':{'id':_0x4acda7[_0x6cab('0x41')]['id']}})[_0x6cab('0x22')](handleEntityNotFound(_0x4aceed,null))[_0x6cab('0x22')](saveUpdates(_0x4acda7[_0x6cab('0x46')],null))[_0x6cab('0x22')](respondWithResult(_0x4aceed,null))[_0x6cab('0x44')](handleError(_0x4aceed,null));};exports[_0x6cab('0x23')]=function(_0x22dda1,_0xe2a5bf){return db[_0x6cab('0x29')][_0x6cab('0x43')]({'where':{'id':_0x22dda1[_0x6cab('0x41')]['id']}})[_0x6cab('0x22')](handleEntityNotFound(_0xe2a5bf,null))['then'](removeEntity(_0xe2a5bf,null))[_0x6cab('0x44')](handleError(_0xe2a5bf,null));};
\ No newline at end of file
index 1ec350d..b9dcbbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3820=['name','options','join','StopMixMonitor','length','concat','internal','User','findAll','then','catch','exports','models','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','bluebird','context','%s%s','merge','Set','record','push','MixMonitor','format','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s'];(function(_0x123280,_0x19a19f){var _0x387b58=function(_0xdbd693){while(--_0xdbd693){_0x123280['push'](_0x123280['shift']());}};_0x387b58(++_0x19a19f);}(_0x3820,0x170));var _0x0382=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x3820[_0x5af59e];return _0x4240df;};'use strict';var _=require(_0x0382('0x0'));var util=require('util');var BPromise=require(_0x0382('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x32d7c1,_0x12312f,_0x251912){var _0x403f10=0x1;var _0x3916a4=[];var _0x416aa6={'context':_0x12312f[_0x0382('0x2')]||'from-sip','exten':util['format'](_0x0382('0x3'),_0x32d7c1['prefix'],_0x251912),'type':'system','isApp':![],'ChanSpyId':_0x32d7c1['id'],'UserId':_0x12312f['id']};_0x3916a4['push'](_[_0x0382('0x4')]({'app':_0x0382('0x5'),'appdata':util['format']('CDR(type)=%s','chanspy'),'priority':_0x403f10++},_0x416aa6));if(_0x32d7c1[_0x0382('0x6')]){_0x3916a4[_0x0382('0x7')](_['merge']({'app':_0x0382('0x8'),'appdata':util[_0x0382('0x9')](_0x0382('0xa'),_0x32d7c1[_0x0382('0xb')]),'priority':_0x403f10++},_0x416aa6));}if(_0x32d7c1[_0x0382('0xc')]){_0x3916a4[_0x0382('0x7')](_[_0x0382('0x4')]({'app':_0x0382('0xd'),'appdata':_0x32d7c1[_0x0382('0xe')],'priority':_0x403f10++},_0x416aa6));}_0x3916a4[_0x0382('0x7')](_[_0x0382('0x4')]({'app':_0x0382('0xf'),'appdata':util[_0x0382('0x9')](_0x0382('0x10'),_0x12312f[_0x0382('0x11')],_0x32d7c1['options']?_0x32d7c1[_0x0382('0x12')][_0x0382('0x13')](''):''),'priority':_0x403f10++},_0x416aa6));if(_0x32d7c1[_0x0382('0x6')]){_0x3916a4[_0x0382('0x7')](_['merge']({'app':_0x0382('0x14'),'priority':_0x403f10++},_0x416aa6));}return _0x3916a4;};var getChanSpyApplications=function(_0x5369ef,_0x5d9ed6){var _0x7e6cd4=[];for(var _0x3f9092=0x0,_0x5b93f8=0x1;_0x3f9092<_0x5d9ed6[_0x0382('0x15')];_0x3f9092++,_0x5b93f8=0x1){_0x7e6cd4=_0x7e6cd4[_0x0382('0x16')](getUserApplications(_0x5369ef,_0x5d9ed6[_0x3f9092],_0x5d9ed6[_0x3f9092][_0x0382('0x17')]));if(_0x5d9ed6[_0x3f9092][_0x0382('0x17')]!=_0x5d9ed6[_0x3f9092]['name']){_0x7e6cd4=_0x7e6cd4[_0x0382('0x16')](getUserApplications(_0x5369ef,_0x5d9ed6[_0x3f9092],_0x5d9ed6[_0x3f9092]['name']));}}return _0x7e6cd4;};var getChanSpyPromise=function(_0x245cb4,_0x219e30){return new BPromise(function(_0x53718b,_0x5e9b11){return _0x245cb4[_0x0382('0x18')][_0x0382('0x19')]({'attributes':['id',_0x0382('0x11'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x0382('0x1a')](function(_0x4aa62e){if(_0x4aa62e){return _0x53718b(getChanSpyApplications(_0x219e30,_0x4aa62e));}return _0x53718b([]);})[_0x0382('0x1b')](function(_0x3a55a1){_0x5e9b11(_0x3a55a1);});});};module[_0x0382('0x1c')]=function(_0x1a799c,_0x506494){var _0x38c5ba=_0x1a799c[_0x0382('0x1d')];return _0x1a799c['define'](_0x0382('0x1e'),attributes,{'tableName':_0x0382('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x152c7a,_0x36b0d4,_0x221073){return getChanSpyPromise(_0x38c5ba,_0x152c7a)[_0x0382('0x1a')](function(_0x4faa65){if(_0x4faa65&&_0x4faa65['length']){return _0x38c5ba['VoiceExtension'][_0x0382('0x20')](_0x4faa65);}})['then'](function(){_0x221073();})['catch'](function(_0x577f72){_0x221073(_0x577f72);});},'afterUpdate':function(_0x5a9edc,_0x34c0ab,_0x72e0a2){return _0x38c5ba[_0x0382('0x21')][_0x0382('0x22')]({'where':{'ChanSpyId':_0x5a9edc['id']}})['then'](function(){return getChanSpyPromise(_0x38c5ba,_0x5a9edc);})[_0x0382('0x1a')](function(_0x120c2d){if(_0x120c2d&&_0x120c2d['length']){return _0x38c5ba[_0x0382('0x21')]['bulkCreate'](_0x120c2d);}})[_0x0382('0x1a')](function(){_0x72e0a2();})[_0x0382('0x1b')](function(_0x31a79f){_0x72e0a2(_0x31a79f);});},'afterDestroy':function(_0x575f5d,_0x5c650f,_0x3dead0){return _0x38c5ba[_0x0382('0x21')][_0x0382('0x22')]({'where':{'ChanSpyId':_0x575f5d['id']}})['then'](function(){_0x3dead0();})[_0x0382('0x1b')](function(_0x585593){_0x3dead0(_0x585593);});}}});};
\ No newline at end of file
+var _0x7c87=['exports','define','VoiceChanSpy','voice_chanspy','then','destroy','VoiceExtension','bulkCreate','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','push','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','merge','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','internal','name','concat','User','agent','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7c87,0x155));var _0x77c8=function(_0x4aaaa9,_0x114018){_0x4aaaa9=_0x4aaaa9-0x0;var _0x550246=_0x7c87[_0x4aaaa9];return _0x550246;};'use strict';var _=require(_0x77c8('0x0'));var util=require('util');var BPromise=require(_0x77c8('0x1'));var attributes=require(_0x77c8('0x2'));var getUserApplications=function(_0x36ed3b,_0x191e74,_0x4d15c9){var _0x525270=0x1;var _0x1cce13=[];var _0x44f456={'context':_0x191e74[_0x77c8('0x3')]||_0x77c8('0x4'),'exten':util[_0x77c8('0x5')](_0x77c8('0x6'),_0x36ed3b['prefix'],_0x4d15c9),'type':'system','isApp':![],'ChanSpyId':_0x36ed3b['id'],'UserId':_0x191e74['id']};_0x1cce13[_0x77c8('0x7')](_['merge']({'app':_0x77c8('0x8'),'appdata':util[_0x77c8('0x5')]('CDR(type)=%s',_0x77c8('0x9')),'priority':_0x525270++},_0x44f456));if(_0x36ed3b[_0x77c8('0xa')]){_0x1cce13['push'](_['merge']({'app':_0x77c8('0xb'),'appdata':util[_0x77c8('0x5')](_0x77c8('0xc'),_0x36ed3b[_0x77c8('0xd')]),'priority':_0x525270++},_0x44f456));}if(_0x36ed3b['auth']){_0x1cce13['push'](_[_0x77c8('0xe')]({'app':_0x77c8('0xf'),'appdata':_0x36ed3b[_0x77c8('0x10')],'priority':_0x525270++},_0x44f456));}_0x1cce13[_0x77c8('0x7')](_['merge']({'app':_0x77c8('0x11'),'appdata':util[_0x77c8('0x5')](_0x77c8('0x12'),_0x191e74['name'],_0x36ed3b[_0x77c8('0x13')]?_0x36ed3b[_0x77c8('0x13')][_0x77c8('0x14')](''):''),'priority':_0x525270++},_0x44f456));if(_0x36ed3b[_0x77c8('0xa')]){_0x1cce13[_0x77c8('0x7')](_[_0x77c8('0xe')]({'app':_0x77c8('0x15'),'priority':_0x525270++},_0x44f456));}return _0x1cce13;};var getChanSpyApplications=function(_0x52eb65,_0x19438b){var _0x46b9d3=[];for(var _0x2812c6=0x0,_0x3fb341=0x1;_0x2812c6<_0x19438b[_0x77c8('0x16')];_0x2812c6++,_0x3fb341=0x1){_0x46b9d3=_0x46b9d3['concat'](getUserApplications(_0x52eb65,_0x19438b[_0x2812c6],_0x19438b[_0x2812c6][_0x77c8('0x17')]));if(_0x19438b[_0x2812c6][_0x77c8('0x17')]!=_0x19438b[_0x2812c6][_0x77c8('0x18')]){_0x46b9d3=_0x46b9d3[_0x77c8('0x19')](getUserApplications(_0x52eb65,_0x19438b[_0x2812c6],_0x19438b[_0x2812c6][_0x77c8('0x18')]));}}return _0x46b9d3;};var getChanSpyPromise=function(_0x38c8a2,_0x4a5a83){return new BPromise(function(_0x140b2a,_0x4d5fd2){return _0x38c8a2[_0x77c8('0x1a')]['findAll']({'attributes':['id','name',_0x77c8('0x17')],'where':{'role':_0x77c8('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x4b46b8){if(_0x4b46b8){return _0x140b2a(getChanSpyApplications(_0x4a5a83,_0x4b46b8));}return _0x140b2a([]);})[_0x77c8('0x1c')](function(_0x1d0276){_0x4d5fd2(_0x1d0276);});});};module[_0x77c8('0x1d')]=function(_0xcdf56,_0x781289){var _0x2569f9=_0xcdf56['models'];return _0xcdf56[_0x77c8('0x1e')](_0x77c8('0x1f'),attributes,{'tableName':_0x77c8('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d1a61,_0x48a7b9,_0x15f34a){return getChanSpyPromise(_0x2569f9,_0x4d1a61)[_0x77c8('0x21')](function(_0x58786b){if(_0x58786b&&_0x58786b[_0x77c8('0x16')]){return _0x2569f9['VoiceExtension']['bulkCreate'](_0x58786b);}})[_0x77c8('0x21')](function(){_0x15f34a();})[_0x77c8('0x1c')](function(_0x2e5130){_0x15f34a(_0x2e5130);});},'afterUpdate':function(_0x2988cc,_0x68c6d5,_0x3b6559){return _0x2569f9['VoiceExtension'][_0x77c8('0x22')]({'where':{'ChanSpyId':_0x2988cc['id']}})[_0x77c8('0x21')](function(){return getChanSpyPromise(_0x2569f9,_0x2988cc);})['then'](function(_0x5371ee){if(_0x5371ee&&_0x5371ee[_0x77c8('0x16')]){return _0x2569f9[_0x77c8('0x23')][_0x77c8('0x24')](_0x5371ee);}})[_0x77c8('0x21')](function(){_0x3b6559();})['catch'](function(_0x3973d7){_0x3b6559(_0x3973d7);});},'afterDestroy':function(_0x1f24d9,_0x60eeaf,_0x5cae01){return _0x2569f9[_0x77c8('0x23')][_0x77c8('0x22')]({'where':{'ChanSpyId':_0x1f24d9['id']}})['then'](function(){_0x5cae01();})[_0x77c8('0x1c')](function(_0x34ca05){_0x5cae01(_0x34ca05);});}}});};
\ No newline at end of file
index e6f9016..be62b33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7794=['randomstring','../../mysqldb','../../config/utils','rpc','http','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0x7794,0x7b));var _0x4779=function(_0x2fb8e6,_0x5bf19b){_0x2fb8e6=_0x2fb8e6-0x0;var _0x18b53b=_0x7794[_0x2fb8e6];return _0x18b53b;};'use strict';var _=require('lodash');var util=require(_0x4779('0x0'));var moment=require(_0x4779('0x1'));var BPromise=require(_0x4779('0x2'));var rs=require(_0x4779('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4779('0x4'))['db'];var utils=require(_0x4779('0x5'));var logger=require('../../config/logger')(_0x4779('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4779('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x339512,_0x523c93,_0xb3fe18){return new BPromise(function(_0x13bb66,_0x270a5f){return client[_0x4779('0x8')](_0x339512,_0xb3fe18)[_0x4779('0x9')](function(_0x7179e1){logger[_0x4779('0xa')]('VoiceChanSpy,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));logger[_0x4779('0xc')](_0x4779('0xd'),_0x523c93,_0x4779('0xb'),JSON[_0x4779('0xe')](_0x7179e1));if(_0x7179e1[_0x4779('0xf')]){if(_0x7179e1[_0x4779('0xf')][_0x4779('0x10')]===0x1f4){logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1['error']['message']);return _0x270a5f(_0x7179e1['error'][_0x4779('0x12')]);}logger[_0x4779('0xf')](_0x4779('0x11'),_0x523c93,_0x7179e1[_0x4779('0xf')]['message']);return _0x13bb66(_0x7179e1[_0x4779('0xf')][_0x4779('0x12')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x523c93,_0x4779('0xb'));_0x13bb66(_0x7179e1[_0x4779('0x13')][_0x4779('0x12')]);}})[_0x4779('0x14')](function(_0x56ec51){logger['error'](_0x4779('0x11'),_0x523c93,_0x56ec51);_0x270a5f(_0x56ec51);});});}
\ No newline at end of file
+var _0x3f8c=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','then','info'];(function(_0x11f6fe,_0x2af6b7){var _0x2a167e=function(_0x5952da){while(--_0x5952da){_0x11f6fe['push'](_0x11f6fe['shift']());}};_0x2a167e(++_0x2af6b7);}(_0x3f8c,0x104));var _0xc3f8=function(_0x15a81b,_0x5829d8){_0x15a81b=_0x15a81b-0x0;var _0x3ae966=_0x3f8c[_0x15a81b];return _0x3ae966;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3f8('0x0'));var BPromise=require(_0xc3f8('0x1'));var rs=require(_0xc3f8('0x2'));var fs=require('fs');var Redis=require(_0xc3f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc3f8('0x4'));var client=jayson[_0xc3f8('0x5')][_0xc3f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x44c25d,_0x2bbaa5,_0x15512a){return new BPromise(function(_0x51093a,_0x28397e){return client[_0xc3f8('0x7')](_0x44c25d,_0x15512a)[_0xc3f8('0x8')](function(_0x3c340c){logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));logger['debug'](_0xc3f8('0xc'),_0x2bbaa5,_0xc3f8('0xb'),JSON[_0xc3f8('0xd')](_0x3c340c));if(_0x3c340c[_0xc3f8('0xe')]){if(_0x3c340c['error'][_0xc3f8('0xf')]===0x1f4){logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')]['message']);return _0x28397e(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);return _0x51093a(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}else{logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));_0x51093a(_0x3c340c[_0xc3f8('0x11')][_0xc3f8('0x10')]);}})['catch'](function(_0x14b3ed){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x2bbaa5,_0x14b3ed);_0x28397e(_0x14b3ed);});});}
\ No newline at end of file
index d2263d8..9a8a97b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f08=['put','isAuthenticated','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','/:id','show','post','create'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x2f08,0x112));var _0x82f0=function(_0xd5709b,_0x101823){_0xd5709b=_0xd5709b-0x0;var _0x3dc484=_0x2f08[_0xd5709b];return _0x3dc484;};'use strict';var multer=require(_0x82f0('0x0'));var util=require('util');var path=require(_0x82f0('0x1'));var timeout=require(_0x82f0('0x2'));var express=require(_0x82f0('0x3'));var router=express[_0x82f0('0x4')]();var fs_extra=require(_0x82f0('0x5'));var auth=require(_0x82f0('0x6'));var interaction=require(_0x82f0('0x7'));var config=require(_0x82f0('0x8'));var controller=require(_0x82f0('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x82f0('0xa'),auth['isAuthenticated'](),controller[_0x82f0('0xb')]);router[_0x82f0('0xc')]('/',auth['isAuthenticated'](),controller[_0x82f0('0xd')]);router[_0x82f0('0xe')](_0x82f0('0xa'),auth[_0x82f0('0xf')](),controller['update']);router[_0x82f0('0x10')](_0x82f0('0xa'),auth[_0x82f0('0xf')](),controller['destroy']);module[_0x82f0('0x11')]=router;
\ No newline at end of file
+var _0xca32=['index','show','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated'];(function(_0x2db76e,_0x22d7db){var _0x10d2f8=function(_0x4ab139){while(--_0x4ab139){_0x2db76e['push'](_0x2db76e['shift']());}};_0x10d2f8(++_0x22d7db);}(_0xca32,0x1be));var _0x2ca3=function(_0x165a00,_0x2f6d5b){_0x165a00=_0x165a00-0x0;var _0x17d70d=_0xca32[_0x165a00];return _0x17d70d;};'use strict';var multer=require(_0x2ca3('0x0'));var util=require('util');var path=require(_0x2ca3('0x1'));var timeout=require(_0x2ca3('0x2'));var express=require(_0x2ca3('0x3'));var router=express[_0x2ca3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2ca3('0x5'));var config=require(_0x2ca3('0x6'));var controller=require(_0x2ca3('0x7'));router[_0x2ca3('0x8')]('/',auth[_0x2ca3('0x9')](),controller[_0x2ca3('0xa')]);router[_0x2ca3('0x8')]('/:id',auth[_0x2ca3('0x9')](),controller[_0x2ca3('0xb')]);router[_0x2ca3('0xc')]('/',auth[_0x2ca3('0x9')](),controller[_0x2ca3('0xd')]);router[_0x2ca3('0xe')](_0x2ca3('0xf'),auth[_0x2ca3('0x9')](),controller[_0x2ca3('0x10')]);router[_0x2ca3('0x11')]('/:id',auth[_0x2ca3('0x9')](),controller['destroy']);module[_0x2ca3('0x12')]=router;
\ No newline at end of file
index eae2ee5..0eab6f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9bb=['STRING','sequelize'];(function(_0xc7301f,_0x5cb8ef){var _0x5f1b18=function(_0x460409){while(--_0x460409){_0xc7301f['push'](_0xc7301f['shift']());}};_0x5f1b18(++_0x5cb8ef);}(_0xc9bb,0xd7));var _0xbc9b=function(_0x12553d,_0x160725){_0x12553d=_0x12553d-0x0;var _0x166267=_0xc9bb[_0x12553d];return _0x166267;};'use strict';var Sequelize=require(_0xbc9b('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc9b('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xbc9b('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2986=['name','STRING','BOOLEAN','sequelize'];(function(_0x58a183,_0x4fbc2b){var _0x322e63=function(_0x175164){while(--_0x175164){_0x58a183['push'](_0x58a183['shift']());}};_0x322e63(++_0x4fbc2b);}(_0x2986,0xcb));var _0x6298=function(_0x3a9619,_0x12540){_0x3a9619=_0x3a9619-0x0;var _0x33b17a=_0x2986[_0x3a9619];return _0x33b17a;};'use strict';var Sequelize=require(_0x6298('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6298('0x1')},'description':{'type':Sequelize[_0x6298('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6298('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index ef3ae23..c7bcde2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe344=['ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','end','undefined','limit','count','offset','json','reject','update','then','get','Contexts','UserProfileResource','destroy','name','VoiceContext','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','options','rows','find','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','create','params','render','writeFileSync','chan_sip.so','utf8','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xe344,0x114));var _0x4e34=function(_0x2a6f32,_0x5af16b){_0x2a6f32=_0x2a6f32-0x0;var _0x378e55=_0xe344[_0x2a6f32];return _0x378e55;};'use strict';var emlformat=require(_0x4e34('0x0'));var rimraf=require(_0x4e34('0x1'));var zipdir=require(_0x4e34('0x2'));var jsonpatch=require(_0x4e34('0x3'));var rp=require('request-promise');var moment=require(_0x4e34('0x4'));var BPromise=require(_0x4e34('0x5'));var Mustache=require('mustache');var util=require(_0x4e34('0x6'));var path=require(_0x4e34('0x7'));var sox=require('sox');var csv=require(_0x4e34('0x8'));var ejs=require(_0x4e34('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4e34('0xa'));var crypto=require(_0x4e34('0xb'));var jsforce=require(_0x4e34('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4e34('0x8'));var querystring=require(_0x4e34('0xd'));var Papa=require('papaparse');var Redis=require(_0x4e34('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4e34('0xf'));var as=require(_0x4e34('0x10'));var hardwareService=require(_0x4e34('0x11'));var logger=require(_0x4e34('0x12'))(_0x4e34('0x13'));var utils=require('../../config/utils');var config=require(_0x4e34('0x14'));var licenseUtil=require(_0x4e34('0x15'));var db=require(_0x4e34('0x16'))['db'];var jayson=require(_0x4e34('0x17'));var client=jayson[_0x4e34('0x18')][_0x4e34('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x1998fa,_0x630981,_0x24f42d,_0x58b242){return new BPromise(function(_0x13e573,_0x1d34ad){var _0x2ae6ae=_0x58b242||client;return _0x2ae6ae[_0x4e34('0x1a')](_0x1998fa,_0x24f42d)['then'](function(_0x1ed074){logger[_0x4e34('0x1b')](_0x4e34('0x1c'),_0x630981,'request\x20sent');logger[_0x4e34('0x1d')](_0x4e34('0x1e'),_0x630981,'request\x20sent',JSON[_0x4e34('0x1f')](_0x1ed074));if(_0x1ed074[_0x4e34('0x20')]){if(_0x1ed074[_0x4e34('0x20')][_0x4e34('0x21')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x630981,_0x1ed074['error']['message']);return _0x1d34ad(_0x1ed074['error'][_0x4e34('0x22')]);}logger[_0x4e34('0x20')]('VoiceContext,\x20%s,\x20%s',_0x630981,_0x1ed074['error']['message']);return _0x13e573(_0x1ed074['error'][_0x4e34('0x22')]);}else{logger[_0x4e34('0x1b')](_0x4e34('0x1c'),_0x630981,_0x4e34('0x23'));_0x13e573(_0x1ed074['result']['message']);}})[_0x4e34('0x24')](function(_0x36be2a){logger[_0x4e34('0x20')]('VoiceContext,\x20%s,\x20%s',_0x630981,_0x36be2a);_0x1d34ad(_0x36be2a);});});}function respondWithStatusCode(_0xba642d,_0xd4381f){_0xd4381f=_0xd4381f||0xcc;return function(_0x35379f){if(_0x35379f){return _0xba642d[_0x4e34('0x25')](_0xd4381f);}return _0xba642d[_0x4e34('0x26')](_0xd4381f)[_0x4e34('0x27')]();};}function respondWithResult(_0x31e2b0,_0x26fef0){_0x26fef0=_0x26fef0||0xc8;return function(_0x18d98e){if(_0x18d98e){return _0x31e2b0[_0x4e34('0x26')](_0x26fef0)['json'](_0x18d98e);}};}function respondWithFilteredResult(_0x2b16da,_0x352c7f){return function(_0x36ff45){if(_0x36ff45){var _0x47fec7=typeof _0x352c7f['offset']===_0x4e34('0x28')&&typeof _0x352c7f[_0x4e34('0x29')]===_0x4e34('0x28');var _0x4ec64a=_0x36ff45[_0x4e34('0x2a')];var _0x5bb790=_0x47fec7?0x0:_0x352c7f['offset'];var _0x452e7d=_0x47fec7?_0x36ff45[_0x4e34('0x2a')]:_0x352c7f[_0x4e34('0x2b')]+_0x352c7f['limit'];var _0x2dd7d3;if(_0x452e7d>=_0x4ec64a){_0x452e7d=_0x4ec64a;_0x2dd7d3=0xc8;}else{_0x2dd7d3=0xce;}_0x2b16da[_0x4e34('0x26')](_0x2dd7d3);return _0x2b16da['set']('Content-Range',_0x5bb790+'-'+_0x452e7d+'/'+_0x4ec64a)[_0x4e34('0x2c')](_0x36ff45);}return null;};}function patchUpdates(_0x2fe901){return function(_0x4c1122){try{jsonpatch['apply'](_0x4c1122,_0x2fe901,!![]);}catch(_0x4a369a){return BPromise[_0x4e34('0x2d')](_0x4a369a);}return _0x4c1122['save']();};}function saveUpdates(_0x1f2544,_0x2f5320){return function(_0x5d4da0){if(_0x5d4da0){return _0x5d4da0[_0x4e34('0x2e')](_0x1f2544)[_0x4e34('0x2f')](function(_0x10ae13){return _0x10ae13;});}return null;};}function removeEntity(_0x409a3d,_0x5e60fc){return function(_0x1229d5){if(_0x1229d5){return _0x1229d5['destroy']()['then'](function(){var _0x54c8ed=_0x1229d5[_0x4e34('0x30')]({'plain':!![]});var _0x340e10=_0x4e34('0x31');return db[_0x4e34('0x32')][_0x4e34('0x33')]({'where':{'type':_0x340e10,'resourceId':_0x54c8ed['id']}})[_0x4e34('0x2f')](function(){return _0x1229d5;});})[_0x4e34('0x2f')](function(){_0x409a3d[_0x4e34('0x26')](0xcc)[_0x4e34('0x27')]();});}};}function handleEntityNotFound(_0x46e986,_0x27bb06){return function(_0x4fa873){if(!_0x4fa873){_0x46e986[_0x4e34('0x25')](0x194);}return _0x4fa873;};}function handleError(_0x50d3ac,_0x1e4d0f){_0x1e4d0f=_0x1e4d0f||0x1f4;return function(_0x2d8441){logger['error'](_0x2d8441['stack']);if(_0x2d8441['name']){delete _0x2d8441[_0x4e34('0x34')];}_0x50d3ac[_0x4e34('0x26')](_0x1e4d0f)['send'](_0x2d8441);};}exports['index']=function(_0x52d0d7,_0x1173ac){var _0x217307={},_0x3dbb28={},_0xc9cd77={'count':0x0,'rows':[]};var _0xa1935f=_['map'](db[_0x4e34('0x35')][_0x4e34('0x36')],function(_0x4bf080){return{'name':_0x4bf080[_0x4e34('0x37')],'type':_0x4bf080['type'][_0x4e34('0x38')]};});_0x3dbb28['model']=_[_0x4e34('0x39')](_0xa1935f,_0x4e34('0x34'));_0x3dbb28[_0x4e34('0x3a')]=_[_0x4e34('0x3b')](_0x52d0d7[_0x4e34('0x3a')]);_0x3dbb28[_0x4e34('0x3c')]=_[_0x4e34('0x3d')](_0x3dbb28[_0x4e34('0x3e')],_0x3dbb28[_0x4e34('0x3a')]);_0x217307['attributes']=_[_0x4e34('0x3d')](_0x3dbb28['model'],qs[_0x4e34('0x3f')](_0x52d0d7[_0x4e34('0x3a')]['fields']));_0x217307[_0x4e34('0x40')]=_0x217307[_0x4e34('0x40')][_0x4e34('0x41')]?_0x217307[_0x4e34('0x40')]:_0x3dbb28[_0x4e34('0x3e')];if(!_0x52d0d7[_0x4e34('0x3a')][_0x4e34('0x42')](_0x4e34('0x43'))){_0x217307[_0x4e34('0x29')]=qs[_0x4e34('0x29')](_0x52d0d7[_0x4e34('0x3a')][_0x4e34('0x29')]);_0x217307[_0x4e34('0x2b')]=qs[_0x4e34('0x2b')](_0x52d0d7[_0x4e34('0x3a')]['offset']);}_0x217307[_0x4e34('0x44')]=qs['sort'](_0x52d0d7[_0x4e34('0x3a')]['sort']);_0x217307[_0x4e34('0x45')]=qs[_0x4e34('0x3c')](_[_0x4e34('0x46')](_0x52d0d7['query'],_0x3dbb28['filters']),_0xa1935f);if(_0x52d0d7[_0x4e34('0x3a')][_0x4e34('0x47')]){_0x217307[_0x4e34('0x45')]=_[_0x4e34('0x48')](_0x217307[_0x4e34('0x45')],{'$or':_[_0x4e34('0x39')](_0xa1935f,function(_0x2ca7d4){if(_0x2ca7d4[_0x4e34('0x49')]!=='VIRTUAL'){var _0x58e91b={};_0x58e91b[_0x2ca7d4['name']]={'$like':'%'+_0x52d0d7['query'][_0x4e34('0x47')]+'%'};return _0x58e91b;}})});}_0x217307=_[_0x4e34('0x48')]({},_0x217307,_0x52d0d7[_0x4e34('0x4a')]);var _0x34e207={'where':_0x217307[_0x4e34('0x45')]};return db[_0x4e34('0x35')][_0x4e34('0x2a')](_0x34e207)[_0x4e34('0x2f')](function(_0x246f19){_0xc9cd77[_0x4e34('0x2a')]=_0x246f19;if(_0x52d0d7['query']['includeAll']){_0x217307['include']=[{'all':!![]}];}return db[_0x4e34('0x35')]['findAll'](_0x217307);})['then'](function(_0x5a5250){_0xc9cd77[_0x4e34('0x4b')]=_0x5a5250;return _0xc9cd77;})[_0x4e34('0x2f')](respondWithFilteredResult(_0x1173ac,_0x217307))[_0x4e34('0x24')](handleError(_0x1173ac,null));};exports['show']=function(_0x100df6,_0x78da44){var _0x579356={'raw':![],'where':{'id':_0x100df6['params']['id']}},_0x17ed8f={};_0x17ed8f['model']=_['keys'](db[_0x4e34('0x35')]['rawAttributes']);_0x17ed8f[_0x4e34('0x3a')]=_[_0x4e34('0x3b')](_0x100df6['query']);_0x17ed8f['filters']=_[_0x4e34('0x3d')](_0x17ed8f[_0x4e34('0x3e')],_0x17ed8f['query']);_0x579356[_0x4e34('0x40')]=_[_0x4e34('0x3d')](_0x17ed8f[_0x4e34('0x3e')],qs[_0x4e34('0x3f')](_0x100df6[_0x4e34('0x3a')]['fields']));_0x579356[_0x4e34('0x40')]=_0x579356[_0x4e34('0x40')][_0x4e34('0x41')]?_0x579356['attributes']:_0x17ed8f[_0x4e34('0x3e')];if(_0x100df6[_0x4e34('0x3a')]['includeAll']){_0x579356['include']=[{'all':!![]}];}_0x579356=_[_0x4e34('0x48')]({},_0x579356,_0x100df6[_0x4e34('0x4a')]);return db[_0x4e34('0x35')][_0x4e34('0x4c')](_0x579356)[_0x4e34('0x2f')](handleEntityNotFound(_0x78da44,null))[_0x4e34('0x2f')](respondWithResult(_0x78da44,null))[_0x4e34('0x24')](handleError(_0x78da44,null));};exports['create']=function(_0x748959,_0x425456,_0x481991){var _0x34122d;return db[_0x4e34('0x35')]['create'](_0x748959[_0x4e34('0x4d')],{'raw':!![]})[_0x4e34('0x2f')](function(_0x31cf6d){_0x34122d=_0x31cf6d;return db['VoiceContext'][_0x4e34('0x4e')]({'raw':!![]});})[_0x4e34('0x2f')](function(_0x4be078){var _0x50188b=fs[_0x4e34('0x4f')](path[_0x4e34('0x50')](config[_0x4e34('0x51')],_0x4e34('0x52')),'utf8');var _0x56f14b=ejs['render'](_0x50188b,{'contexts':_0x4be078||[]});fs['writeFileSync'](_0x4e34('0x53'),_0x56f14b);})['then'](function(){return respondWithRpcPromise(_0x4e34('0x54'),'create',{'module':'chan_sip.so'});})[_0x4e34('0x2f')](function(){var _0x6bfe63=_0x748959[_0x4e34('0x55')][_0x4e34('0x30')]({'plain':!![]});if(!_0x6bfe63)throw new Error(_0x4e34('0x56'));if(_0x6bfe63[_0x4e34('0x57')]===_0x4e34('0x55')){var _0x3b9609=_0x34122d['get']({'plain':!![]});return db['UserProfileSection'][_0x4e34('0x4c')]({'where':{'name':_0x4e34('0x31'),'userProfileId':_0x6bfe63[_0x4e34('0x58')]},'raw':!![]})[_0x4e34('0x2f')](function(_0x2203c5){if(_0x2203c5&&_0x2203c5['autoAssociation']===0x0){return db['UserProfileResource'][_0x4e34('0x59')]({'name':_0x3b9609['name'],'resourceId':_0x3b9609['id'],'type':_0x2203c5['name'],'sectionId':_0x2203c5['id']},{})[_0x4e34('0x2f')](function(){return _0x34122d;});}else{return _0x34122d;}})[_0x4e34('0x24')](function(_0x19d6d1){logger[_0x4e34('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19d6d1);throw _0x19d6d1;});}return _0x34122d;})['then'](respondWithResult(_0x425456,0xc9))['catch'](handleError(_0x425456,null));};exports[_0x4e34('0x2e')]=function(_0x19a9f5,_0x6be32b,_0x29731f){var _0x65f503;return db[_0x4e34('0x35')][_0x4e34('0x4c')]({'where':{'id':_0x19a9f5[_0x4e34('0x5a')]['id']}})[_0x4e34('0x2f')](handleEntityNotFound(_0x6be32b,null))['then'](saveUpdates(_0x19a9f5['body'],null))['then'](function(_0x50c56d){if(_0x50c56d){_0x65f503=_0x50c56d;return db['VoiceContext'][_0x4e34('0x4e')]({'raw':!![]});}})[_0x4e34('0x2f')](function(_0x4a2292){var _0x275166=fs[_0x4e34('0x4f')](path[_0x4e34('0x50')](config[_0x4e34('0x51')],_0x4e34('0x52')),'utf8');var _0x14ddb3=ejs[_0x4e34('0x5b')](_0x275166,{'contexts':_0x4a2292||[]});fs[_0x4e34('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x14ddb3);})['then'](function(){return respondWithRpcPromise(_0x4e34('0x54'),_0x4e34('0x2e'),{'module':_0x4e34('0x5d')});})['then'](function(){return _0x65f503;})['then'](respondWithResult(_0x6be32b,null))[_0x4e34('0x24')](handleError(_0x6be32b,null));};exports['destroy']=function(_0x59d93c,_0x291d6e,_0x5c6128){var _0x5b860e;return db[_0x4e34('0x35')]['find']({'where':{'id':_0x59d93c[_0x4e34('0x5a')]['id']}})['then'](handleEntityNotFound(_0x291d6e,null))[_0x4e34('0x2f')](removeEntity(_0x291d6e,null))['then'](function(){return db['VoiceContext'][_0x4e34('0x4e')]({'raw':!![]});})[_0x4e34('0x2f')](function(_0x3253aa){var _0x4c2350=fs[_0x4e34('0x4f')](path[_0x4e34('0x50')](config[_0x4e34('0x51')],'server/files/templates/context.ejs'),_0x4e34('0x5e'));var _0x3b0b7d=ejs[_0x4e34('0x5b')](_0x4c2350,{'contexts':_0x3253aa});fs[_0x4e34('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3b0b7d);return respondWithRpcPromise('Reload',_0x4e34('0x33'),{'module':'chan_sip.so'});})[_0x4e34('0x24')](handleError(_0x291d6e,null));};
\ No newline at end of file
+var _0x25b6=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','server/files/templates/context.ejs','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','update','destroy','get','Contexts','UserProfileResource','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','include','find','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user'];(function(_0x582ac7,_0x182598){var _0x5c8b59=function(_0x4f3108){while(--_0x4f3108){_0x582ac7['push'](_0x582ac7['shift']());}};_0x5c8b59(++_0x182598);}(_0x25b6,0x6e));var _0x625b=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x25b6[_0x15876a];return _0xbd900f;};'use strict';var emlformat=require(_0x625b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x625b('0x1'));var moment=require('moment');var BPromise=require(_0x625b('0x2'));var Mustache=require(_0x625b('0x3'));var util=require(_0x625b('0x4'));var path=require(_0x625b('0x5'));var sox=require(_0x625b('0x6'));var csv=require(_0x625b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x625b('0x8'));var squel=require(_0x625b('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x625b('0xa'));var toCsv=require(_0x625b('0x7'));var querystring=require(_0x625b('0xb'));var Papa=require(_0x625b('0xc'));var Redis=require(_0x625b('0xd'));var authService=require(_0x625b('0xe'));var qs=require(_0x625b('0xf'));var as=require(_0x625b('0x10'));var hardwareService=require(_0x625b('0x11'));var logger=require(_0x625b('0x12'))('api');var utils=require(_0x625b('0x13'));var config=require(_0x625b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x625b('0x15'))['db'];var jayson=require(_0x625b('0x16'));var client=jayson[_0x625b('0x17')][_0x625b('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xf4133b,_0x3d3ffe,_0x42e870,_0x372e81){return new BPromise(function(_0x1b1b88,_0x10444f){var _0x43cf72=_0x372e81||client;return _0x43cf72[_0x625b('0x19')](_0xf4133b,_0x42e870)[_0x625b('0x1a')](function(_0x1b0cc3){logger[_0x625b('0x1b')](_0x625b('0x1c'),_0x3d3ffe,_0x625b('0x1d'));logger[_0x625b('0x1e')](_0x625b('0x1f'),_0x3d3ffe,_0x625b('0x1d'),JSON[_0x625b('0x20')](_0x1b0cc3));if(_0x1b0cc3['error']){if(_0x1b0cc3['error'][_0x625b('0x21')]===0x1f4){logger[_0x625b('0x22')]('VoiceContext,\x20%s,\x20%s',_0x3d3ffe,_0x1b0cc3['error']['message']);return _0x10444f(_0x1b0cc3[_0x625b('0x22')][_0x625b('0x23')]);}logger[_0x625b('0x22')](_0x625b('0x1c'),_0x3d3ffe,_0x1b0cc3[_0x625b('0x22')][_0x625b('0x23')]);return _0x1b1b88(_0x1b0cc3[_0x625b('0x22')][_0x625b('0x23')]);}else{logger[_0x625b('0x1b')](_0x625b('0x1c'),_0x3d3ffe,_0x625b('0x1d'));_0x1b1b88(_0x1b0cc3['result'][_0x625b('0x23')]);}})[_0x625b('0x24')](function(_0xcc09af){logger['error'](_0x625b('0x1c'),_0x3d3ffe,_0xcc09af);_0x10444f(_0xcc09af);});});}function respondWithStatusCode(_0x4be363,_0x7cded7){_0x7cded7=_0x7cded7||0xcc;return function(_0x5050cd){if(_0x5050cd){return _0x4be363[_0x625b('0x25')](_0x7cded7);}return _0x4be363['status'](_0x7cded7)[_0x625b('0x26')]();};}function respondWithResult(_0x29445c,_0x578c0f){_0x578c0f=_0x578c0f||0xc8;return function(_0x241ef6){if(_0x241ef6){return _0x29445c['status'](_0x578c0f)[_0x625b('0x27')](_0x241ef6);}};}function respondWithFilteredResult(_0x32ad34,_0x57acfb){return function(_0x45fd0b){if(_0x45fd0b){var _0x2560df=typeof _0x57acfb[_0x625b('0x28')]===_0x625b('0x29')&&typeof _0x57acfb['limit']===_0x625b('0x29');var _0x1209f5=_0x45fd0b[_0x625b('0x2a')];var _0x39cbd6=_0x2560df?0x0:_0x57acfb[_0x625b('0x28')];var _0x4f266c=_0x2560df?_0x45fd0b['count']:_0x57acfb['offset']+_0x57acfb[_0x625b('0x2b')];var _0x1f57ac;if(_0x4f266c>=_0x1209f5){_0x4f266c=_0x1209f5;_0x1f57ac=0xc8;}else{_0x1f57ac=0xce;}_0x32ad34[_0x625b('0x2c')](_0x1f57ac);return _0x32ad34['set'](_0x625b('0x2d'),_0x39cbd6+'-'+_0x4f266c+'/'+_0x1209f5)['json'](_0x45fd0b);}return null;};}function patchUpdates(_0x351884){return function(_0x58e8d7){try{jsonpatch[_0x625b('0x2e')](_0x58e8d7,_0x351884,!![]);}catch(_0x311741){return BPromise[_0x625b('0x2f')](_0x311741);}return _0x58e8d7['save']();};}function saveUpdates(_0x1dce49,_0x7d73c7){return function(_0x453b58){if(_0x453b58){return _0x453b58[_0x625b('0x30')](_0x1dce49)[_0x625b('0x1a')](function(_0x5b0607){return _0x5b0607;});}return null;};}function removeEntity(_0x1b07d9,_0x3b2185){return function(_0x2c5081){if(_0x2c5081){return _0x2c5081[_0x625b('0x31')]()['then'](function(){var _0x2ad743=_0x2c5081[_0x625b('0x32')]({'plain':!![]});var _0x516130=_0x625b('0x33');return db[_0x625b('0x34')]['destroy']({'where':{'type':_0x516130,'resourceId':_0x2ad743['id']}})[_0x625b('0x1a')](function(){return _0x2c5081;});})[_0x625b('0x1a')](function(){_0x1b07d9['status'](0xcc)[_0x625b('0x26')]();});}};}function handleEntityNotFound(_0x2adf61,_0x14594d){return function(_0x1089b3){if(!_0x1089b3){_0x2adf61[_0x625b('0x25')](0x194);}return _0x1089b3;};}function handleError(_0x500406,_0xab4e64){_0xab4e64=_0xab4e64||0x1f4;return function(_0x30dddb){logger[_0x625b('0x22')](_0x30dddb['stack']);if(_0x30dddb['name']){delete _0x30dddb['name'];}_0x500406[_0x625b('0x2c')](_0xab4e64)[_0x625b('0x35')](_0x30dddb);};}exports[_0x625b('0x36')]=function(_0x4a9275,_0x3a4f2f){var _0xa851a0={},_0x267742={},_0x44bc28={'count':0x0,'rows':[]};var _0xfb8b85=_[_0x625b('0x37')](db[_0x625b('0x38')][_0x625b('0x39')],function(_0x309e84){return{'name':_0x309e84[_0x625b('0x3a')],'type':_0x309e84[_0x625b('0x3b')][_0x625b('0x3c')]};});_0x267742[_0x625b('0x3d')]=_['map'](_0xfb8b85,_0x625b('0x3e'));_0x267742[_0x625b('0x3f')]=_[_0x625b('0x40')](_0x4a9275['query']);_0x267742[_0x625b('0x41')]=_[_0x625b('0x42')](_0x267742[_0x625b('0x3d')],_0x267742[_0x625b('0x3f')]);_0xa851a0['attributes']=_[_0x625b('0x42')](_0x267742['model'],qs[_0x625b('0x43')](_0x4a9275[_0x625b('0x3f')][_0x625b('0x43')]));_0xa851a0[_0x625b('0x44')]=_0xa851a0[_0x625b('0x44')][_0x625b('0x45')]?_0xa851a0['attributes']:_0x267742['model'];if(!_0x4a9275[_0x625b('0x3f')][_0x625b('0x46')](_0x625b('0x47'))){_0xa851a0[_0x625b('0x2b')]=qs['limit'](_0x4a9275[_0x625b('0x3f')][_0x625b('0x2b')]);_0xa851a0[_0x625b('0x28')]=qs[_0x625b('0x28')](_0x4a9275[_0x625b('0x3f')][_0x625b('0x28')]);}_0xa851a0[_0x625b('0x48')]=qs[_0x625b('0x49')](_0x4a9275[_0x625b('0x3f')][_0x625b('0x49')]);_0xa851a0[_0x625b('0x4a')]=qs[_0x625b('0x41')](_[_0x625b('0x4b')](_0x4a9275[_0x625b('0x3f')],_0x267742[_0x625b('0x41')]),_0xfb8b85);if(_0x4a9275[_0x625b('0x3f')]['filter']){_0xa851a0['where']=_[_0x625b('0x4c')](_0xa851a0[_0x625b('0x4a')],{'$or':_['map'](_0xfb8b85,function(_0x4ea1dd){if(_0x4ea1dd['type']!=='VIRTUAL'){var _0x9e63d6={};_0x9e63d6[_0x4ea1dd[_0x625b('0x3e')]]={'$like':'%'+_0x4a9275[_0x625b('0x3f')][_0x625b('0x4d')]+'%'};return _0x9e63d6;}})});}_0xa851a0=_[_0x625b('0x4c')]({},_0xa851a0,_0x4a9275[_0x625b('0x4e')]);var _0x28970f={'where':_0xa851a0[_0x625b('0x4a')]};return db[_0x625b('0x38')][_0x625b('0x2a')](_0x28970f)['then'](function(_0x1f9c3c){_0x44bc28[_0x625b('0x2a')]=_0x1f9c3c;if(_0x4a9275[_0x625b('0x3f')][_0x625b('0x4f')]){_0xa851a0['include']=[{'all':!![]}];}return db['VoiceContext'][_0x625b('0x50')](_0xa851a0);})[_0x625b('0x1a')](function(_0xca583d){_0x44bc28[_0x625b('0x51')]=_0xca583d;return _0x44bc28;})['then'](respondWithFilteredResult(_0x3a4f2f,_0xa851a0))[_0x625b('0x24')](handleError(_0x3a4f2f,null));};exports[_0x625b('0x52')]=function(_0x21daf6,_0xd7c617){var _0x36a7e5={'raw':![],'where':{'id':_0x21daf6['params']['id']}},_0x3c9326={};_0x3c9326[_0x625b('0x3d')]=_[_0x625b('0x40')](db[_0x625b('0x38')][_0x625b('0x39')]);_0x3c9326[_0x625b('0x3f')]=_[_0x625b('0x40')](_0x21daf6[_0x625b('0x3f')]);_0x3c9326[_0x625b('0x41')]=_[_0x625b('0x42')](_0x3c9326['model'],_0x3c9326['query']);_0x36a7e5['attributes']=_[_0x625b('0x42')](_0x3c9326[_0x625b('0x3d')],qs[_0x625b('0x43')](_0x21daf6[_0x625b('0x3f')]['fields']));_0x36a7e5[_0x625b('0x44')]=_0x36a7e5['attributes'][_0x625b('0x45')]?_0x36a7e5[_0x625b('0x44')]:_0x3c9326['model'];if(_0x21daf6[_0x625b('0x3f')][_0x625b('0x4f')]){_0x36a7e5[_0x625b('0x53')]=[{'all':!![]}];}_0x36a7e5=_[_0x625b('0x4c')]({},_0x36a7e5,_0x21daf6['options']);return db[_0x625b('0x38')][_0x625b('0x54')](_0x36a7e5)[_0x625b('0x1a')](handleEntityNotFound(_0xd7c617,null))[_0x625b('0x1a')](respondWithResult(_0xd7c617,null))[_0x625b('0x24')](handleError(_0xd7c617,null));};exports[_0x625b('0x55')]=function(_0x51f89f,_0x434d0a,_0x52f1d7){var _0x53f9c9;return db[_0x625b('0x38')]['create'](_0x51f89f['body'],{'raw':!![]})[_0x625b('0x1a')](function(_0x5f1a44){_0x53f9c9=_0x5f1a44;return db['VoiceContext'][_0x625b('0x50')]({'raw':!![]});})[_0x625b('0x1a')](function(_0x30062a){var _0x24a26a=fs[_0x625b('0x56')](path[_0x625b('0x57')](config[_0x625b('0x58')],'server/files/templates/context.ejs'),_0x625b('0x59'));var _0x576524=ejs[_0x625b('0x5a')](_0x24a26a,{'contexts':_0x30062a||[]});fs[_0x625b('0x5b')](_0x625b('0x5c'),_0x576524);})['then'](function(){return respondWithRpcPromise(_0x625b('0x5d'),_0x625b('0x55'),{'module':_0x625b('0x5e')});})[_0x625b('0x1a')](function(){var _0x1e2de5=_0x51f89f[_0x625b('0x5f')]['get']({'plain':!![]});if(!_0x1e2de5)throw new Error(_0x625b('0x60'));if(_0x1e2de5[_0x625b('0x61')]===_0x625b('0x5f')){var _0x695813=_0x53f9c9[_0x625b('0x32')]({'plain':!![]});return db[_0x625b('0x62')]['find']({'where':{'name':_0x625b('0x33'),'userProfileId':_0x1e2de5[_0x625b('0x63')]},'raw':!![]})[_0x625b('0x1a')](function(_0x3c72d3){if(_0x3c72d3&&_0x3c72d3['autoAssociation']===0x0){return db[_0x625b('0x34')][_0x625b('0x55')]({'name':_0x695813['name'],'resourceId':_0x695813['id'],'type':_0x3c72d3[_0x625b('0x3e')],'sectionId':_0x3c72d3['id']},{})[_0x625b('0x1a')](function(){return _0x53f9c9;});}else{return _0x53f9c9;}})[_0x625b('0x24')](function(_0x44b2cc){logger[_0x625b('0x22')](_0x625b('0x64'),_0x44b2cc);throw _0x44b2cc;});}return _0x53f9c9;})[_0x625b('0x1a')](respondWithResult(_0x434d0a,0xc9))['catch'](handleError(_0x434d0a,null));};exports[_0x625b('0x30')]=function(_0x822a08,_0x40a845,_0x9db484){var _0x3b3e4c;return db[_0x625b('0x38')][_0x625b('0x54')]({'where':{'id':_0x822a08['params']['id']}})[_0x625b('0x1a')](handleEntityNotFound(_0x40a845,null))[_0x625b('0x1a')](saveUpdates(_0x822a08['body'],null))[_0x625b('0x1a')](function(_0x423d31){if(_0x423d31){_0x3b3e4c=_0x423d31;return db[_0x625b('0x38')]['findAll']({'raw':!![]});}})[_0x625b('0x1a')](function(_0x124f8c){var _0x2bb4bf=fs[_0x625b('0x56')](path[_0x625b('0x57')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x577732=ejs[_0x625b('0x5a')](_0x2bb4bf,{'contexts':_0x124f8c||[]});fs[_0x625b('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x577732);})[_0x625b('0x1a')](function(){return respondWithRpcPromise(_0x625b('0x5d'),_0x625b('0x30'),{'module':_0x625b('0x5e')});})[_0x625b('0x1a')](function(){return _0x3b3e4c;})[_0x625b('0x1a')](respondWithResult(_0x40a845,null))[_0x625b('0x24')](handleError(_0x40a845,null));};exports[_0x625b('0x31')]=function(_0xf136fd,_0x46974c,_0x32326f){var _0x36928b;return db[_0x625b('0x38')][_0x625b('0x54')]({'where':{'id':_0xf136fd[_0x625b('0x65')]['id']}})[_0x625b('0x1a')](handleEntityNotFound(_0x46974c,null))[_0x625b('0x1a')](removeEntity(_0x46974c,null))[_0x625b('0x1a')](function(){return db['VoiceContext'][_0x625b('0x50')]({'raw':!![]});})[_0x625b('0x1a')](function(_0x26c4be){var _0x53a638=fs[_0x625b('0x56')](path[_0x625b('0x57')](config[_0x625b('0x58')],_0x625b('0x66')),_0x625b('0x59'));var _0x3b9fb6=ejs[_0x625b('0x5a')](_0x53a638,{'contexts':_0x26c4be});fs[_0x625b('0x5b')](_0x625b('0x5c'),_0x3b9fb6);return respondWithRpcPromise(_0x625b('0x5d'),_0x625b('0x31'),{'module':_0x625b('0x5e')});})[_0x625b('0x24')](handleError(_0x46974c,null));};
\ No newline at end of file
index 29230dd..ee91994 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d3=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x89d79e,_0x3b5ddf){var _0x1a01c7=function(_0xdca183){while(--_0xdca183){_0x89d79e['push'](_0x89d79e['shift']());}};_0x1a01c7(++_0x3b5ddf);}(_0x01d3,0xa2));var _0x301d=function(_0x3dccbd,_0x473204){_0x3dccbd=_0x3dccbd-0x0;var _0x5d9c51=_0x01d3[_0x3dccbd];return _0x5d9c51;};'use strict';var _=require(_0x301d('0x0'));var util=require(_0x301d('0x1'));var logger=require(_0x301d('0x2'))(_0x301d('0x3'));var moment=require('moment');var BPromise=require(_0x301d('0x4'));var rp=require(_0x301d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x301d('0x6'));var config=require(_0x301d('0x7'));var attributes=require(_0x301d('0x8'));module[_0x301d('0x9')]=function(_0x5d1462,_0x318074){return _0x5d1462[_0x301d('0xa')](_0x301d('0xb'),attributes,{'tableName':_0x301d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b5d=['../../config/logger','moment','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash'];(function(_0xd6df5e,_0x4a4e46){var _0x155b12=function(_0x368fb6){while(--_0x368fb6){_0xd6df5e['push'](_0xd6df5e['shift']());}};_0x155b12(++_0x4a4e46);}(_0x8b5d,0x153));var _0xd8b5=function(_0x47888a,_0x7d2f3a){_0x47888a=_0x47888a-0x0;var _0x2b15a4=_0x8b5d[_0x47888a];return _0x2b15a4;};'use strict';var _=require(_0xd8b5('0x0'));var util=require('util');var logger=require(_0xd8b5('0x1'))('api');var moment=require(_0xd8b5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd8b5('0x3'));var config=require(_0xd8b5('0x4'));var attributes=require(_0xd8b5('0x5'));module[_0xd8b5('0x6')]=function(_0x5591a4,_0x51d396){return _0x5591a4[_0xd8b5('0x7')](_0xd8b5('0x8'),attributes,{'tableName':_0xd8b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8100a19..80588bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbfc=['client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x31d1f7,_0x4f61d0){var _0x167afa=function(_0x5d78dd){while(--_0x5d78dd){_0x31d1f7['push'](_0x31d1f7['shift']());}};_0x167afa(++_0x4f61d0);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x6bfb00,_0xe2ee9a){_0x6bfb00=_0x6bfb00-0x0;var _0x1a9fd9=_0xdbfc[_0x6bfb00];return _0x1a9fd9;};'use strict';var _=require(_0xcdbf('0x0'));var util=require(_0xcdbf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcdbf('0x2'));var fs=require('fs');var Redis=require(_0xcdbf('0x3'));var db=require(_0xcdbf('0x4'))['db'];var utils=require(_0xcdbf('0x5'));var logger=require(_0xcdbf('0x6'))(_0xcdbf('0x7'));var config=require(_0xcdbf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcdbf('0x9')][_0xcdbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54aeaf,_0x369d61,_0x3c077d){return new BPromise(function(_0x409a4e,_0xf4dfb5){return client['request'](_0x54aeaf,_0x3c077d)[_0xcdbf('0xb')](function(_0x30e0a4){logger[_0xcdbf('0xc')](_0xcdbf('0xd'),_0x369d61,_0xcdbf('0xe'));logger['debug'](_0xcdbf('0xf'),_0x369d61,'request\x20sent',JSON[_0xcdbf('0x10')](_0x30e0a4));if(_0x30e0a4['error']){if(_0x30e0a4[_0xcdbf('0x11')]['code']===0x1f4){logger[_0xcdbf('0x11')](_0xcdbf('0xd'),_0x369d61,_0x30e0a4[_0xcdbf('0x11')]['message']);return _0xf4dfb5(_0x30e0a4[_0xcdbf('0x11')]['message']);}logger[_0xcdbf('0x11')](_0xcdbf('0xd'),_0x369d61,_0x30e0a4[_0xcdbf('0x11')][_0xcdbf('0x12')]);return _0x409a4e(_0x30e0a4[_0xcdbf('0x11')]['message']);}else{logger[_0xcdbf('0xc')](_0xcdbf('0xd'),_0x369d61,_0xcdbf('0xe'));_0x409a4e(_0x30e0a4[_0xcdbf('0x13')][_0xcdbf('0x12')]);}})[_0xcdbf('0x14')](function(_0x19b5bd){logger[_0xcdbf('0x11')](_0xcdbf('0xd'),_0x369d61,_0x19b5bd);_0xf4dfb5(_0x19b5bd);});});}
\ No newline at end of file
+var _0x47fd=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0xdadb1b,_0x15c5fe){var _0x326400=function(_0x491e1e){while(--_0x491e1e){_0xdadb1b['push'](_0xdadb1b['shift']());}};_0x326400(++_0x15c5fe);}(_0x47fd,0x13c));var _0xd47f=function(_0x236cc3,_0x3bb005){_0x236cc3=_0x236cc3-0x0;var _0x1f97e7=_0x47fd[_0x236cc3];return _0x1f97e7;};'use strict';var _=require(_0xd47f('0x0'));var util=require(_0xd47f('0x1'));var moment=require(_0xd47f('0x2'));var BPromise=require(_0xd47f('0x3'));var rs=require(_0xd47f('0x4'));var fs=require('fs');var Redis=require(_0xd47f('0x5'));var db=require(_0xd47f('0x6'))['db'];var utils=require(_0xd47f('0x7'));var logger=require(_0xd47f('0x8'))(_0xd47f('0x9'));var config=require('../../config/environment');var jayson=require(_0xd47f('0xa'));var client=jayson[_0xd47f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11c1d4,_0x4f4706,_0x55433e){return new BPromise(function(_0x38b07c,_0x56a97a){return client['request'](_0x11c1d4,_0x55433e)[_0xd47f('0xc')](function(_0x2b694d){logger[_0xd47f('0xd')](_0xd47f('0xe'),_0x4f4706,_0xd47f('0xf'));logger[_0xd47f('0x10')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x4f4706,_0xd47f('0xf'),JSON[_0xd47f('0x11')](_0x2b694d));if(_0x2b694d['error']){if(_0x2b694d[_0xd47f('0x12')][_0xd47f('0x13')]===0x1f4){logger[_0xd47f('0x12')](_0xd47f('0xe'),_0x4f4706,_0x2b694d[_0xd47f('0x12')][_0xd47f('0x14')]);return _0x56a97a(_0x2b694d['error'][_0xd47f('0x14')]);}logger[_0xd47f('0x12')](_0xd47f('0xe'),_0x4f4706,_0x2b694d[_0xd47f('0x12')][_0xd47f('0x14')]);return _0x38b07c(_0x2b694d[_0xd47f('0x12')][_0xd47f('0x14')]);}else{logger[_0xd47f('0xd')](_0xd47f('0xe'),_0x4f4706,'request\x20sent');_0x38b07c(_0x2b694d['result'][_0xd47f('0x14')]);}})[_0xd47f('0x15')](function(_0x4d23b5){logger[_0xd47f('0x12')](_0xd47f('0xe'),_0x4f4706,_0x4d23b5);_0x56a97a(_0x4d23b5);});});}
\ No newline at end of file
index 7f5ba9c..ec60944 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf52=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x1c812b,_0x3261ca){var _0x1e5c22=function(_0x1ce1a9){while(--_0x1ce1a9){_0x1c812b['push'](_0x1c812b['shift']());}};_0x1e5c22(++_0x3261ca);}(_0xcf52,0x1a0));var _0x2cf5=function(_0x415b62,_0x23d394){_0x415b62=_0x415b62-0x0;var _0x439e1f=_0xcf52[_0x415b62];return _0x439e1f;};'use strict';var multer=require(_0x2cf5('0x0'));var util=require(_0x2cf5('0x1'));var path=require(_0x2cf5('0x2'));var timeout=require(_0x2cf5('0x3'));var express=require('express');var router=express[_0x2cf5('0x4')]();var fs_extra=require(_0x2cf5('0x5'));var auth=require(_0x2cf5('0x6'));var interaction=require(_0x2cf5('0x7'));var config=require(_0x2cf5('0x8'));var controller=require('./voiceDialReport.controller');router[_0x2cf5('0x9')]('/',auth[_0x2cf5('0xa')](),controller[_0x2cf5('0xb')]);router[_0x2cf5('0x9')](_0x2cf5('0xc'),auth[_0x2cf5('0xa')](),controller[_0x2cf5('0xd')]);router[_0x2cf5('0x9')](_0x2cf5('0xe'),auth[_0x2cf5('0xa')](),controller[_0x2cf5('0xf')]);router['post']('/',auth[_0x2cf5('0xa')](),controller[_0x2cf5('0x10')]);router[_0x2cf5('0x11')](_0x2cf5('0xe'),auth[_0x2cf5('0xa')](),controller[_0x2cf5('0x12')]);router['delete'](_0x2cf5('0xe'),auth[_0x2cf5('0xa')](),controller[_0x2cf5('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xe9f6=['destroy','multer','util','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x5d5da5,_0x530556){var _0x3e5ec5=function(_0x2fafd2){while(--_0x2fafd2){_0x5d5da5['push'](_0x5d5da5['shift']());}};_0x3e5ec5(++_0x530556);}(_0xe9f6,0x11e));var _0x6e9f=function(_0x44105a,_0xd3d69f){_0x44105a=_0x44105a-0x0;var _0x2d3b6d=_0xe9f6[_0x44105a];return _0x2d3b6d;};'use strict';var multer=require(_0x6e9f('0x0'));var util=require(_0x6e9f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6e9f('0x2'));var router=express[_0x6e9f('0x3')]();var fs_extra=require(_0x6e9f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6e9f('0x5'));var controller=require('./voiceDialReport.controller');router[_0x6e9f('0x6')]('/',auth[_0x6e9f('0x7')](),controller[_0x6e9f('0x8')]);router['get'](_0x6e9f('0x9'),auth[_0x6e9f('0x7')](),controller[_0x6e9f('0xa')]);router[_0x6e9f('0x6')](_0x6e9f('0xb'),auth[_0x6e9f('0x7')](),controller[_0x6e9f('0xc')]);router[_0x6e9f('0xd')]('/',auth[_0x6e9f('0x7')](),controller[_0x6e9f('0xe')]);router[_0x6e9f('0xf')](_0x6e9f('0xb'),auth[_0x6e9f('0x7')](),controller[_0x6e9f('0x10')]);router[_0x6e9f('0x11')](_0x6e9f('0xb'),auth[_0x6e9f('0x7')](),controller[_0x6e9f('0x12')]);module['exports']=router;
\ No newline at end of file
index abd258e..c2f4354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x2b5d39,_0x55a5f2){var _0x3917c4=function(_0x16551f){while(--_0x16551f){_0x2b5d39['push'](_0x2b5d39['shift']());}};_0x3917c4(++_0x55a5f2);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x1d9d78,_0x3c028f){_0x1d9d78=_0x1d9d78-0x0;var _0x561750=_0xd6d6[_0x1d9d78];return _0x561750;};'use strict';var Sequelize=require(_0x6d6d('0x0'));module[_0x6d6d('0x1')]={'privilege':{'type':Sequelize[_0x6d6d('0x2')]},'channel':{'type':Sequelize[_0x6d6d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6d6d('0x2')]},'calleridnum':{'type':Sequelize[_0x6d6d('0x2')]},'calleridname':{'type':Sequelize[_0x6d6d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6d6d('0x2')]},'connectedlinename':{'type':Sequelize[_0x6d6d('0x2')]},'language':{'type':Sequelize[_0x6d6d('0x2')]},'accountcode':{'type':Sequelize[_0x6d6d('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6d6d('0x2')]},'priority':{'type':Sequelize[_0x6d6d('0x3')]},'uniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'linkedid':{'type':Sequelize[_0x6d6d('0x2')]},'destchannel':{'type':Sequelize[_0x6d6d('0x2')]},'destchannelstate':{'type':Sequelize[_0x6d6d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6d6d('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x6d6d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6d6d('0x2')]},'destlanguage':{'type':Sequelize[_0x6d6d('0x2')]},'destaccountcode':{'type':Sequelize[_0x6d6d('0x2')]},'destcontext':{'type':Sequelize[_0x6d6d('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6d6d('0x3')]},'destuniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x6d6d('0x2')]},'starttime':{'type':Sequelize[_0x6d6d('0x4')]},'answertime':{'type':Sequelize[_0x6d6d('0x4')]},'endtime':{'type':Sequelize[_0x6d6d('0x4')]},'lastevent':{'type':Sequelize[_0x6d6d('0x2')],'comment':_0x6d6d('0x5')},'routeId':{'type':Sequelize[_0x6d6d('0x3')]},'duration':{'type':Sequelize[_0x6d6d('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x6d6d('0x3')]}};
\ No newline at end of file
+var _0xf2ca=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x5298b7,_0xb984c8){var _0x580911=function(_0x1cf94a){while(--_0x1cf94a){_0x5298b7['push'](_0x5298b7['shift']());}};_0x580911(++_0xb984c8);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1a27f3,_0x1c082d){_0x1a27f3=_0x1a27f3-0x0;var _0x3ce222=_0xf2ca[_0x1a27f3];return _0x3ce222;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'privilege':{'type':Sequelize[_0xaf2c('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xaf2c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'calleridnum':{'type':Sequelize[_0xaf2c('0x2')]},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'exten':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaf2c('0x2')]},'destchannel':{'type':Sequelize[_0xaf2c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xaf2c('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'destlanguage':{'type':Sequelize[_0xaf2c('0x2')]},'destaccountcode':{'type':Sequelize[_0xaf2c('0x2')]},'destcontext':{'type':Sequelize[_0xaf2c('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'destlinkedid':{'type':Sequelize[_0xaf2c('0x2')]},'dialstring':{'type':Sequelize[_0xaf2c('0x2')]},'dialstatus':{'type':Sequelize[_0xaf2c('0x2')]},'starttime':{'type':Sequelize[_0xaf2c('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xaf2c('0x2')],'comment':_0xaf2c('0x5')},'routeId':{'type':Sequelize[_0xaf2c('0x3')]},'duration':{'type':Sequelize[_0xaf2c('0x3')]},'holdtime':{'type':Sequelize[_0xaf2c('0x3')]},'billableseconds':{'type':Sequelize[_0xaf2c('0x3')]}};
\ No newline at end of file
index d3d9824..a091acc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdaa4=['end','error','send','index','VoiceDialReport','rawAttributes','fieldName','type','name','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','show','params','includeAll','find','create','body','catch','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../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','reject','save','update','then'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0xdaa4,0x73));var _0x4daa=function(_0x212a8e,_0x259099){_0x212a8e=_0x212a8e-0x0;var _0x1cbbc7=_0xdaa4[_0x212a8e];return _0x1cbbc7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4daa('0x0'));var zipdir=require(_0x4daa('0x1'));var jsonpatch=require(_0x4daa('0x2'));var rp=require(_0x4daa('0x3'));var moment=require(_0x4daa('0x4'));var BPromise=require(_0x4daa('0x5'));var Mustache=require(_0x4daa('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4daa('0x7'));var ejs=require(_0x4daa('0x8'));var fs=require('fs');var fs_extra=require(_0x4daa('0x9'));var _=require(_0x4daa('0xa'));var squel=require(_0x4daa('0xb'));var crypto=require('crypto');var jsforce=require(_0x4daa('0xc'));var deskjs=require(_0x4daa('0xd'));var toCsv=require(_0x4daa('0x7'));var querystring=require('querystring');var Papa=require(_0x4daa('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4daa('0xf'));var as=require(_0x4daa('0x10'));var hardwareService=require(_0x4daa('0x11'));var logger=require(_0x4daa('0x12'))(_0x4daa('0x13'));var utils=require(_0x4daa('0x14'));var config=require(_0x4daa('0x15'));var licenseUtil=require(_0x4daa('0x16'));var db=require(_0x4daa('0x17'))['db'];function respondWithStatusCode(_0x50fab7,_0x4802c){_0x4802c=_0x4802c||0xcc;return function(_0x20dc8e){if(_0x20dc8e){return _0x50fab7[_0x4daa('0x18')](_0x4802c);}return _0x50fab7[_0x4daa('0x19')](_0x4802c)['end']();};}function respondWithResult(_0x3ffe2f,_0x4e3632){_0x4e3632=_0x4e3632||0xc8;return function(_0x4f0085){if(_0x4f0085){return _0x3ffe2f[_0x4daa('0x19')](_0x4e3632)[_0x4daa('0x1a')](_0x4f0085);}};}function respondWithFilteredResult(_0xca17bb,_0x2dbaf0){return function(_0x2357a4){if(_0x2357a4){var _0x204c4d=typeof _0x2dbaf0[_0x4daa('0x1b')]===_0x4daa('0x1c')&&typeof _0x2dbaf0[_0x4daa('0x1d')]===_0x4daa('0x1c');var _0x23de66=_0x2357a4[_0x4daa('0x1e')];var _0x11debe=_0x204c4d?0x0:_0x2dbaf0[_0x4daa('0x1b')];var _0x552396=_0x204c4d?_0x2357a4['count']:_0x2dbaf0[_0x4daa('0x1b')]+_0x2dbaf0[_0x4daa('0x1d')];var _0x598413;if(_0x552396>=_0x23de66){_0x552396=_0x23de66;_0x598413=0xc8;}else{_0x598413=0xce;}_0xca17bb[_0x4daa('0x19')](_0x598413);return _0xca17bb['set'](_0x4daa('0x1f'),_0x11debe+'-'+_0x552396+'/'+_0x23de66)[_0x4daa('0x1a')](_0x2357a4);}return null;};}function patchUpdates(_0x4176ac){return function(_0x1acf33){try{jsonpatch[_0x4daa('0x20')](_0x1acf33,_0x4176ac,!![]);}catch(_0x197da0){return BPromise[_0x4daa('0x21')](_0x197da0);}return _0x1acf33[_0x4daa('0x22')]();};}function saveUpdates(_0x1b3b01,_0xcce950){return function(_0x2b455d){if(_0x2b455d){return _0x2b455d[_0x4daa('0x23')](_0x1b3b01)[_0x4daa('0x24')](function(_0x1f83d8){return _0x1f83d8;});}return null;};}function removeEntity(_0x377b83,_0x4f93c7){return function(_0x1198ba){if(_0x1198ba){return _0x1198ba['destroy']()[_0x4daa('0x24')](function(){_0x377b83[_0x4daa('0x19')](0xcc)[_0x4daa('0x25')]();});}};}function handleEntityNotFound(_0x1b38b2,_0x566ab7){return function(_0xa5a992){if(!_0xa5a992){_0x1b38b2[_0x4daa('0x18')](0x194);}return _0xa5a992;};}function handleError(_0x49904d,_0x391d67){_0x391d67=_0x391d67||0x1f4;return function(_0x40c746){logger[_0x4daa('0x26')](_0x40c746['stack']);if(_0x40c746['name']){delete _0x40c746['name'];}_0x49904d[_0x4daa('0x19')](_0x391d67)[_0x4daa('0x27')](_0x40c746);};}exports[_0x4daa('0x28')]=function(_0x5700ee,_0x27c465){var _0x2d1b37={},_0x8da753={},_0x1f6214={'count':0x0,'rows':[]};var _0x47c826=_['map'](db[_0x4daa('0x29')][_0x4daa('0x2a')],function(_0x4ef779){return{'name':_0x4ef779[_0x4daa('0x2b')],'type':_0x4ef779[_0x4daa('0x2c')]['key']};});_0x8da753['model']=_['map'](_0x47c826,_0x4daa('0x2d'));_0x8da753['query']=_[_0x4daa('0x2e')](_0x5700ee['query']);_0x8da753[_0x4daa('0x2f')]=_[_0x4daa('0x30')](_0x8da753[_0x4daa('0x31')],_0x8da753[_0x4daa('0x32')]);_0x2d1b37[_0x4daa('0x33')]=_[_0x4daa('0x30')](_0x8da753[_0x4daa('0x31')],qs[_0x4daa('0x34')](_0x5700ee[_0x4daa('0x32')]['fields']));_0x2d1b37[_0x4daa('0x33')]=_0x2d1b37['attributes'][_0x4daa('0x35')]?_0x2d1b37['attributes']:_0x8da753[_0x4daa('0x31')];if(!_0x5700ee[_0x4daa('0x32')][_0x4daa('0x36')](_0x4daa('0x37'))){_0x2d1b37[_0x4daa('0x1d')]=qs[_0x4daa('0x1d')](_0x5700ee[_0x4daa('0x32')][_0x4daa('0x1d')]);_0x2d1b37['offset']=qs[_0x4daa('0x1b')](_0x5700ee[_0x4daa('0x32')][_0x4daa('0x1b')]);}_0x2d1b37[_0x4daa('0x38')]=qs[_0x4daa('0x39')](_0x5700ee['query'][_0x4daa('0x39')]);_0x2d1b37[_0x4daa('0x3a')]=qs[_0x4daa('0x2f')](_[_0x4daa('0x3b')](_0x5700ee[_0x4daa('0x32')],_0x8da753[_0x4daa('0x2f')]),_0x47c826);if(_0x5700ee[_0x4daa('0x32')][_0x4daa('0x3c')]){_0x2d1b37[_0x4daa('0x3a')]=_[_0x4daa('0x3d')](_0x2d1b37['where'],{'$or':_[_0x4daa('0x3e')](_0x47c826,function(_0xb591b){if(_0xb591b[_0x4daa('0x2c')]!==_0x4daa('0x3f')){var _0x178766={};_0x178766[_0xb591b[_0x4daa('0x2d')]]={'$like':'%'+_0x5700ee[_0x4daa('0x32')]['filter']+'%'};return _0x178766;}})});}_0x2d1b37=_['merge']({},_0x2d1b37,_0x5700ee[_0x4daa('0x40')]);var _0x22adae={'where':_0x2d1b37[_0x4daa('0x3a')]};return db[_0x4daa('0x29')][_0x4daa('0x1e')](_0x22adae)[_0x4daa('0x24')](function(_0x13330a){_0x1f6214[_0x4daa('0x1e')]=_0x13330a;if(_0x5700ee[_0x4daa('0x32')]['includeAll']){_0x2d1b37[_0x4daa('0x41')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x2d1b37);})[_0x4daa('0x24')](function(_0x388908){_0x1f6214[_0x4daa('0x42')]=_0x388908;return _0x1f6214;})[_0x4daa('0x24')](respondWithFilteredResult(_0x27c465,_0x2d1b37))['catch'](handleError(_0x27c465,null));};exports[_0x4daa('0x43')]=function(_0x50080e,_0x75c652){var _0x54d05f={'raw':!![],'where':{'id':_0x50080e[_0x4daa('0x44')]['id']}},_0x1f4950={};_0x1f4950[_0x4daa('0x31')]=_[_0x4daa('0x2e')](db['VoiceDialReport'][_0x4daa('0x2a')]);_0x1f4950[_0x4daa('0x32')]=_[_0x4daa('0x2e')](_0x50080e[_0x4daa('0x32')]);_0x1f4950['filters']=_[_0x4daa('0x30')](_0x1f4950[_0x4daa('0x31')],_0x1f4950[_0x4daa('0x32')]);_0x54d05f['attributes']=_[_0x4daa('0x30')](_0x1f4950['model'],qs['fields'](_0x50080e['query']['fields']));_0x54d05f[_0x4daa('0x33')]=_0x54d05f['attributes'][_0x4daa('0x35')]?_0x54d05f[_0x4daa('0x33')]:_0x1f4950['model'];if(_0x50080e[_0x4daa('0x32')][_0x4daa('0x45')]){_0x54d05f[_0x4daa('0x41')]=[{'all':!![]}];}_0x54d05f=_[_0x4daa('0x3d')]({},_0x54d05f,_0x50080e[_0x4daa('0x40')]);return db['VoiceDialReport'][_0x4daa('0x46')](_0x54d05f)[_0x4daa('0x24')](handleEntityNotFound(_0x75c652,null))['then'](respondWithResult(_0x75c652,null))['catch'](handleError(_0x75c652,null));};exports[_0x4daa('0x47')]=function(_0x2516fe,_0xd9e065){return db[_0x4daa('0x29')]['create'](_0x2516fe[_0x4daa('0x48')],{})[_0x4daa('0x24')](respondWithResult(_0xd9e065,0xc9))[_0x4daa('0x49')](handleError(_0xd9e065,null));};exports[_0x4daa('0x23')]=function(_0x5cda68,_0x544e4a){if(_0x5cda68[_0x4daa('0x48')]['id']){delete _0x5cda68[_0x4daa('0x48')]['id'];}return db[_0x4daa('0x29')]['find']({'where':{'id':_0x5cda68[_0x4daa('0x44')]['id']}})[_0x4daa('0x24')](handleEntityNotFound(_0x544e4a,null))[_0x4daa('0x24')](saveUpdates(_0x5cda68[_0x4daa('0x48')],null))[_0x4daa('0x24')](respondWithResult(_0x544e4a,null))[_0x4daa('0x49')](handleError(_0x544e4a,null));};exports[_0x4daa('0x4a')]=function(_0x43282a,_0x586cd2){return db['VoiceDialReport'][_0x4daa('0x46')]({'where':{'id':_0x43282a[_0x4daa('0x44')]['id']}})['then'](handleEntityNotFound(_0x586cd2,null))[_0x4daa('0x24')](removeEntity(_0x586cd2,null))[_0x4daa('0x49')](handleError(_0x586cd2,null));};exports[_0x4daa('0x4b')]=function(_0x53cdce,_0x491980){return db[_0x4daa('0x29')][_0x4daa('0x4b')]()[_0x4daa('0x24')](respondWithResult(_0x491980,null))[_0x4daa('0x49')](handleError(_0x491980,null));};
\ No newline at end of file
+var _0xd4f6=['options','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','name','send','index','map','VoiceDialReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x51d3da,_0xb82800){var _0x28bc96=function(_0x295bf2){while(--_0x295bf2){_0x51d3da['push'](_0x51d3da['shift']());}};_0x28bc96(++_0xb82800);}(_0xd4f6,0x12c));var _0x6d4f=function(_0x395039,_0x30b465){_0x395039=_0x395039-0x0;var _0x37e26e=_0xd4f6[_0x395039];return _0x37e26e;};'use strict';var emlformat=require(_0x6d4f('0x0'));var rimraf=require(_0x6d4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d4f('0x2'));var rp=require(_0x6d4f('0x3'));var moment=require(_0x6d4f('0x4'));var BPromise=require(_0x6d4f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6d4f('0x6'));var csv=require(_0x6d4f('0x7'));var ejs=require(_0x6d4f('0x8'));var fs=require('fs');var fs_extra=require(_0x6d4f('0x9'));var _=require(_0x6d4f('0xa'));var squel=require('squel');var crypto=require(_0x6d4f('0xb'));var jsforce=require(_0x6d4f('0xc'));var deskjs=require(_0x6d4f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6d4f('0xe'));var Papa=require(_0x6d4f('0xf'));var Redis=require(_0x6d4f('0x10'));var authService=require(_0x6d4f('0x11'));var qs=require(_0x6d4f('0x12'));var as=require(_0x6d4f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d4f('0x14'))(_0x6d4f('0x15'));var utils=require(_0x6d4f('0x16'));var config=require(_0x6d4f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d4f('0x18'))['db'];function respondWithStatusCode(_0x2b7b5c,_0x5982ec){_0x5982ec=_0x5982ec||0xcc;return function(_0xfad51c){if(_0xfad51c){return _0x2b7b5c['sendStatus'](_0x5982ec);}return _0x2b7b5c[_0x6d4f('0x19')](_0x5982ec)['end']();};}function respondWithResult(_0x3dc561,_0x115d13){_0x115d13=_0x115d13||0xc8;return function(_0x21852c){if(_0x21852c){return _0x3dc561['status'](_0x115d13)[_0x6d4f('0x1a')](_0x21852c);}};}function respondWithFilteredResult(_0x5e6de8,_0x36c373){return function(_0x3e165b){if(_0x3e165b){var _0x5077c1=typeof _0x36c373[_0x6d4f('0x1b')]===_0x6d4f('0x1c')&&typeof _0x36c373[_0x6d4f('0x1d')]===_0x6d4f('0x1c');var _0x59bbae=_0x3e165b[_0x6d4f('0x1e')];var _0x237cf3=_0x5077c1?0x0:_0x36c373[_0x6d4f('0x1b')];var _0x42f5c0=_0x5077c1?_0x3e165b[_0x6d4f('0x1e')]:_0x36c373[_0x6d4f('0x1b')]+_0x36c373[_0x6d4f('0x1d')];var _0xe3e81b;if(_0x42f5c0>=_0x59bbae){_0x42f5c0=_0x59bbae;_0xe3e81b=0xc8;}else{_0xe3e81b=0xce;}_0x5e6de8[_0x6d4f('0x19')](_0xe3e81b);return _0x5e6de8[_0x6d4f('0x1f')](_0x6d4f('0x20'),_0x237cf3+'-'+_0x42f5c0+'/'+_0x59bbae)[_0x6d4f('0x1a')](_0x3e165b);}return null;};}function patchUpdates(_0x156544){return function(_0x2e418e){try{jsonpatch[_0x6d4f('0x21')](_0x2e418e,_0x156544,!![]);}catch(_0xc35d2d){return BPromise[_0x6d4f('0x22')](_0xc35d2d);}return _0x2e418e[_0x6d4f('0x23')]();};}function saveUpdates(_0x5fa1ff,_0x3647c6){return function(_0x52cb55){if(_0x52cb55){return _0x52cb55[_0x6d4f('0x24')](_0x5fa1ff)[_0x6d4f('0x25')](function(_0x3558cd){return _0x3558cd;});}return null;};}function removeEntity(_0x170bf0,_0x3c77a6){return function(_0x266700){if(_0x266700){return _0x266700['destroy']()['then'](function(){_0x170bf0[_0x6d4f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3af55f,_0x2928eb){return function(_0x3267d9){if(!_0x3267d9){_0x3af55f[_0x6d4f('0x26')](0x194);}return _0x3267d9;};}function handleError(_0x1322f3,_0x333f5d){_0x333f5d=_0x333f5d||0x1f4;return function(_0x3977e){logger['error'](_0x3977e['stack']);if(_0x3977e[_0x6d4f('0x27')]){delete _0x3977e['name'];}_0x1322f3[_0x6d4f('0x19')](_0x333f5d)[_0x6d4f('0x28')](_0x3977e);};}exports[_0x6d4f('0x29')]=function(_0x8ab4f7,_0xd6a029){var _0x6f8ccc={},_0x308159={},_0x3c7024={'count':0x0,'rows':[]};var _0x81334=_[_0x6d4f('0x2a')](db[_0x6d4f('0x2b')][_0x6d4f('0x2c')],function(_0x2634f5){return{'name':_0x2634f5['fieldName'],'type':_0x2634f5[_0x6d4f('0x2d')]['key']};});_0x308159[_0x6d4f('0x2e')]=_[_0x6d4f('0x2a')](_0x81334,_0x6d4f('0x27'));_0x308159[_0x6d4f('0x2f')]=_[_0x6d4f('0x30')](_0x8ab4f7[_0x6d4f('0x2f')]);_0x308159[_0x6d4f('0x31')]=_['intersection'](_0x308159[_0x6d4f('0x2e')],_0x308159[_0x6d4f('0x2f')]);_0x6f8ccc['attributes']=_[_0x6d4f('0x32')](_0x308159[_0x6d4f('0x2e')],qs[_0x6d4f('0x33')](_0x8ab4f7[_0x6d4f('0x2f')]['fields']));_0x6f8ccc[_0x6d4f('0x34')]=_0x6f8ccc['attributes']['length']?_0x6f8ccc[_0x6d4f('0x34')]:_0x308159[_0x6d4f('0x2e')];if(!_0x8ab4f7[_0x6d4f('0x2f')]['hasOwnProperty'](_0x6d4f('0x35'))){_0x6f8ccc[_0x6d4f('0x1d')]=qs[_0x6d4f('0x1d')](_0x8ab4f7['query'][_0x6d4f('0x1d')]);_0x6f8ccc[_0x6d4f('0x1b')]=qs[_0x6d4f('0x1b')](_0x8ab4f7['query']['offset']);}_0x6f8ccc['order']=qs[_0x6d4f('0x36')](_0x8ab4f7['query'][_0x6d4f('0x36')]);_0x6f8ccc[_0x6d4f('0x37')]=qs[_0x6d4f('0x31')](_[_0x6d4f('0x38')](_0x8ab4f7[_0x6d4f('0x2f')],_0x308159[_0x6d4f('0x31')]),_0x81334);if(_0x8ab4f7[_0x6d4f('0x2f')][_0x6d4f('0x39')]){_0x6f8ccc[_0x6d4f('0x37')]=_['merge'](_0x6f8ccc[_0x6d4f('0x37')],{'$or':_['map'](_0x81334,function(_0x19e59e){if(_0x19e59e[_0x6d4f('0x2d')]!==_0x6d4f('0x3a')){var _0x2fd463={};_0x2fd463[_0x19e59e['name']]={'$like':'%'+_0x8ab4f7[_0x6d4f('0x2f')][_0x6d4f('0x39')]+'%'};return _0x2fd463;}})});}_0x6f8ccc=_[_0x6d4f('0x3b')]({},_0x6f8ccc,_0x8ab4f7[_0x6d4f('0x3c')]);var _0x516205={'where':_0x6f8ccc[_0x6d4f('0x37')]};return db[_0x6d4f('0x2b')][_0x6d4f('0x1e')](_0x516205)[_0x6d4f('0x25')](function(_0xf15b5b){_0x3c7024[_0x6d4f('0x1e')]=_0xf15b5b;if(_0x8ab4f7[_0x6d4f('0x2f')]['includeAll']){_0x6f8ccc[_0x6d4f('0x3d')]=[{'all':!![]}];}return db[_0x6d4f('0x2b')][_0x6d4f('0x3e')](_0x6f8ccc);})[_0x6d4f('0x25')](function(_0x232ef7){_0x3c7024[_0x6d4f('0x3f')]=_0x232ef7;return _0x3c7024;})[_0x6d4f('0x25')](respondWithFilteredResult(_0xd6a029,_0x6f8ccc))[_0x6d4f('0x40')](handleError(_0xd6a029,null));};exports[_0x6d4f('0x41')]=function(_0x34536e,_0xf61c39){var _0x2aa925={'raw':!![],'where':{'id':_0x34536e[_0x6d4f('0x42')]['id']}},_0x1eb440={};_0x1eb440[_0x6d4f('0x2e')]=_[_0x6d4f('0x30')](db[_0x6d4f('0x2b')][_0x6d4f('0x2c')]);_0x1eb440[_0x6d4f('0x2f')]=_[_0x6d4f('0x30')](_0x34536e['query']);_0x1eb440[_0x6d4f('0x31')]=_[_0x6d4f('0x32')](_0x1eb440[_0x6d4f('0x2e')],_0x1eb440[_0x6d4f('0x2f')]);_0x2aa925[_0x6d4f('0x34')]=_[_0x6d4f('0x32')](_0x1eb440[_0x6d4f('0x2e')],qs[_0x6d4f('0x33')](_0x34536e[_0x6d4f('0x2f')][_0x6d4f('0x33')]));_0x2aa925['attributes']=_0x2aa925[_0x6d4f('0x34')][_0x6d4f('0x43')]?_0x2aa925['attributes']:_0x1eb440[_0x6d4f('0x2e')];if(_0x34536e[_0x6d4f('0x2f')]['includeAll']){_0x2aa925[_0x6d4f('0x3d')]=[{'all':!![]}];}_0x2aa925=_[_0x6d4f('0x3b')]({},_0x2aa925,_0x34536e[_0x6d4f('0x3c')]);return db['VoiceDialReport'][_0x6d4f('0x44')](_0x2aa925)['then'](handleEntityNotFound(_0xf61c39,null))['then'](respondWithResult(_0xf61c39,null))[_0x6d4f('0x40')](handleError(_0xf61c39,null));};exports[_0x6d4f('0x45')]=function(_0x520f38,_0x2bc1d7){return db[_0x6d4f('0x2b')][_0x6d4f('0x45')](_0x520f38[_0x6d4f('0x46')],{})[_0x6d4f('0x25')](respondWithResult(_0x2bc1d7,0xc9))[_0x6d4f('0x40')](handleError(_0x2bc1d7,null));};exports[_0x6d4f('0x24')]=function(_0x5a1050,_0x19eeae){if(_0x5a1050[_0x6d4f('0x46')]['id']){delete _0x5a1050[_0x6d4f('0x46')]['id'];}return db['VoiceDialReport'][_0x6d4f('0x44')]({'where':{'id':_0x5a1050[_0x6d4f('0x42')]['id']}})[_0x6d4f('0x25')](handleEntityNotFound(_0x19eeae,null))['then'](saveUpdates(_0x5a1050[_0x6d4f('0x46')],null))['then'](respondWithResult(_0x19eeae,null))[_0x6d4f('0x40')](handleError(_0x19eeae,null));};exports['destroy']=function(_0x2f728d,_0x21cf9e){return db[_0x6d4f('0x2b')][_0x6d4f('0x44')]({'where':{'id':_0x2f728d[_0x6d4f('0x42')]['id']}})[_0x6d4f('0x25')](handleEntityNotFound(_0x21cf9e,null))['then'](removeEntity(_0x21cf9e,null))[_0x6d4f('0x40')](handleError(_0x21cf9e,null));};exports['describe']=function(_0x47d4b3,_0x4583a7){return db[_0x6d4f('0x2b')][_0x6d4f('0x47')]()[_0x6d4f('0x25')](respondWithResult(_0x4583a7,null))[_0x6d4f('0x40')](handleError(_0x4583a7,null));};
\ No newline at end of file
index beff748..58f665a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1603=['define','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf','./voiceDialReport.attributes','exports'];(function(_0x2e740b,_0xed0c55){var _0x60391b=function(_0x46be41){while(--_0x46be41){_0x2e740b['push'](_0x2e740b['shift']());}};_0x60391b(++_0xed0c55);}(_0x1603,0x1b4));var _0x3160=function(_0x840e1c,_0x2486f6){_0x840e1c=_0x840e1c-0x0;var _0x1db60d=_0x1603[_0x840e1c];return _0x1db60d;};'use strict';var _=require('lodash');var util=require(_0x3160('0x0'));var logger=require(_0x3160('0x1'))('api');var moment=require(_0x3160('0x2'));var BPromise=require(_0x3160('0x3'));var rp=require(_0x3160('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3160('0x5'));var config=require('../../config/environment');var attributes=require(_0x3160('0x6'));module[_0x3160('0x7')]=function(_0x9ddb68,_0x327183){return _0x9ddb68[_0x3160('0x8')](_0x3160('0x9'),attributes,{'tableName':_0x3160('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3160('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdb1b=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define'];(function(_0x254c42,_0x3ffe09){var _0x381cb7=function(_0x4815b6){while(--_0x4815b6){_0x254c42['push'](_0x254c42['shift']());}};_0x381cb7(++_0x3ffe09);}(_0xdb1b,0x139));var _0xbdb1=function(_0x3bc824,_0x4a0281){_0x3bc824=_0x3bc824-0x0;var _0x45bb27=_0xdb1b[_0x3bc824];return _0x45bb27;};'use strict';var _=require(_0xbdb1('0x0'));var util=require(_0xbdb1('0x1'));var logger=require(_0xbdb1('0x2'))(_0xbdb1('0x3'));var moment=require('moment');var BPromise=require(_0xbdb1('0x4'));var rp=require(_0xbdb1('0x5'));var fs=require('fs');var path=require(_0xbdb1('0x6'));var rimraf=require(_0xbdb1('0x7'));var config=require(_0xbdb1('0x8'));var attributes=require(_0xbdb1('0x9'));module[_0xbdb1('0xa')]=function(_0x1eaa8b,_0x4634a2){return _0x1eaa8b[_0xbdb1('0xb')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xbdb1('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 7fff3ef..05bbdf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa277=['../../config/logger','../../config/environment','client','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','UpdateVoiceDialReport','update','where','attributes','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5f1413,_0x3e789c){var _0x4dd2f3=function(_0x27f0e1){while(--_0x27f0e1){_0x5f1413['push'](_0x5f1413['shift']());}};_0x4dd2f3(++_0x3e789c);}(_0xa277,0xad));var _0x7a27=function(_0x2d0f94,_0x38015f){_0x2d0f94=_0x2d0f94-0x0;var _0x3e98f6=_0xa277[_0x2d0f94];return _0x3e98f6;};'use strict';var _=require(_0x7a27('0x0'));var util=require(_0x7a27('0x1'));var moment=require(_0x7a27('0x2'));var BPromise=require('bluebird');var rs=require(_0x7a27('0x3'));var fs=require('fs');var Redis=require(_0x7a27('0x4'));var db=require(_0x7a27('0x5'))['db'];var utils=require(_0x7a27('0x6'));var logger=require(_0x7a27('0x7'))('rpc');var config=require(_0x7a27('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7a27('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4949cf,_0x2103d8,_0x30b10b){return new BPromise(function(_0x3bd381,_0x36d128){return client['request'](_0x4949cf,_0x30b10b)[_0x7a27('0xa')](function(_0x1c610e){logger[_0x7a27('0xb')](_0x7a27('0xc'),_0x2103d8,_0x7a27('0xd'));logger[_0x7a27('0xe')](_0x7a27('0xf'),_0x2103d8,_0x7a27('0xd'),JSON['stringify'](_0x1c610e));if(_0x1c610e[_0x7a27('0x10')]){if(_0x1c610e[_0x7a27('0x10')]['code']===0x1f4){logger[_0x7a27('0x10')](_0x7a27('0xc'),_0x2103d8,_0x1c610e[_0x7a27('0x10')][_0x7a27('0x11')]);return _0x36d128(_0x1c610e['error'][_0x7a27('0x11')]);}logger[_0x7a27('0x10')](_0x7a27('0xc'),_0x2103d8,_0x1c610e['error']['message']);return _0x3bd381(_0x1c610e[_0x7a27('0x10')][_0x7a27('0x11')]);}else{logger[_0x7a27('0xb')](_0x7a27('0xc'),_0x2103d8,'request\x20sent');_0x3bd381(_0x1c610e[_0x7a27('0x12')][_0x7a27('0x11')]);}})['catch'](function(_0x1aed6f){logger[_0x7a27('0x10')](_0x7a27('0xc'),_0x2103d8,_0x1aed6f);_0x36d128(_0x1aed6f);});});}exports[_0x7a27('0x13')]=function(_0x578f91){var _0x193eec=this;return new Promise(function(_0x37838d,_0x4e2472){return db[_0x7a27('0x14')][_0x7a27('0x15')](_0x578f91[_0x7a27('0x16')],{'raw':_0x578f91[_0x7a27('0x17')]?_0x578f91[_0x7a27('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x7a27('0xa')](function(_0x8dcbb6){logger['info'](_0x7a27('0x13'),_0x578f91);logger['debug'](_0x7a27('0x13'),_0x578f91,JSON['stringify'](_0x8dcbb6));_0x37838d(_0x8dcbb6);})['catch'](function(_0x27867c){logger['error']('CreateVoiceDialReport',_0x27867c[_0x7a27('0x11')],_0x578f91);_0x4e2472(_0x193eec['error'](0x1f4,_0x27867c[_0x7a27('0x11')]));});});};exports[_0x7a27('0x18')]=function(_0x4637c2){var _0x534352=this;return new Promise(function(_0x584f2c,_0x59bd4a){return db[_0x7a27('0x14')][_0x7a27('0x19')](_0x4637c2['body'],{'raw':_0x4637c2[_0x7a27('0x17')]?_0x4637c2['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4637c2[_0x7a27('0x17')]?_0x4637c2[_0x7a27('0x17')][_0x7a27('0x1a')]||null:null,'attributes':_0x4637c2[_0x7a27('0x17')]?_0x4637c2[_0x7a27('0x17')][_0x7a27('0x1b')]||null:null,'limit':_0x4637c2['options']?_0x4637c2[_0x7a27('0x17')]['limit']||null:null})[_0x7a27('0xa')](function(_0x5edbb8){logger[_0x7a27('0xb')](_0x7a27('0x18'),_0x4637c2);logger['debug'](_0x7a27('0x18'),_0x4637c2,JSON[_0x7a27('0x1c')](_0x5edbb8));_0x584f2c(_0x5edbb8);})[_0x7a27('0x1d')](function(_0x1e13b1){logger[_0x7a27('0x10')](_0x7a27('0x18'),_0x1e13b1[_0x7a27('0x11')],_0x4637c2);_0x59bd4a(_0x534352['error'](0x1f4,_0x1e13b1[_0x7a27('0x11')]));});});};
\ No newline at end of file
+var _0x81a1=['message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','debug','UpdateVoiceDialReport','update','raw','where','attributes','limit','lodash','util','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3d4b94,_0x34a8d3){var _0x5c6dcd=function(_0x3e06d9){while(--_0x3e06d9){_0x3d4b94['push'](_0x3d4b94['shift']());}};_0x5c6dcd(++_0x34a8d3);}(_0x81a1,0x117));var _0x181a=function(_0x33072f,_0x127671){_0x33072f=_0x33072f-0x0;var _0x279b93=_0x81a1[_0x33072f];return _0x279b93;};'use strict';var _=require(_0x181a('0x0'));var util=require(_0x181a('0x1'));var moment=require('moment');var BPromise=require(_0x181a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x181a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x181a('0x4'))(_0x181a('0x5'));var config=require('../../config/environment');var jayson=require(_0x181a('0x6'));var client=jayson[_0x181a('0x7')][_0x181a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50fdd5,_0x3853ae,_0x4a2489){return new BPromise(function(_0x3d0957,_0x2908c0){return client[_0x181a('0x9')](_0x50fdd5,_0x4a2489)[_0x181a('0xa')](function(_0x26c804){logger[_0x181a('0xb')](_0x181a('0xc'),_0x3853ae,_0x181a('0xd'));logger['debug'](_0x181a('0xe'),_0x3853ae,_0x181a('0xd'),JSON[_0x181a('0xf')](_0x26c804));if(_0x26c804[_0x181a('0x10')]){if(_0x26c804[_0x181a('0x10')][_0x181a('0x11')]===0x1f4){logger['error'](_0x181a('0xc'),_0x3853ae,_0x26c804['error'][_0x181a('0x12')]);return _0x2908c0(_0x26c804[_0x181a('0x10')][_0x181a('0x12')]);}logger[_0x181a('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x3853ae,_0x26c804[_0x181a('0x10')]['message']);return _0x3d0957(_0x26c804[_0x181a('0x10')][_0x181a('0x12')]);}else{logger[_0x181a('0xb')](_0x181a('0xc'),_0x3853ae,_0x181a('0xd'));_0x3d0957(_0x26c804[_0x181a('0x13')]['message']);}})[_0x181a('0x14')](function(_0xfaf918){logger[_0x181a('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x3853ae,_0xfaf918);_0x2908c0(_0xfaf918);});});}exports[_0x181a('0x15')]=function(_0x1d28f4){var _0x282c4b=this;return new Promise(function(_0x2c4f3e,_0x2b1ae7){return db[_0x181a('0x16')][_0x181a('0x17')](_0x1d28f4[_0x181a('0x18')],{'raw':_0x1d28f4[_0x181a('0x19')]?_0x1d28f4[_0x181a('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x181a('0xa')](function(_0x399016){logger[_0x181a('0xb')](_0x181a('0x15'),_0x1d28f4);logger[_0x181a('0x1a')](_0x181a('0x15'),_0x1d28f4,JSON[_0x181a('0xf')](_0x399016));_0x2c4f3e(_0x399016);})[_0x181a('0x14')](function(_0x993602){logger['error'](_0x181a('0x15'),_0x993602[_0x181a('0x12')],_0x1d28f4);_0x2b1ae7(_0x282c4b[_0x181a('0x10')](0x1f4,_0x993602['message']));});});};exports[_0x181a('0x1b')]=function(_0x3862ea){var _0x3f0c6c=this;return new Promise(function(_0x537a2d,_0x157d4b){return db[_0x181a('0x16')][_0x181a('0x1c')](_0x3862ea[_0x181a('0x18')],{'raw':_0x3862ea['options']?_0x3862ea[_0x181a('0x19')][_0x181a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3862ea[_0x181a('0x19')]?_0x3862ea['options'][_0x181a('0x1e')]||null:null,'attributes':_0x3862ea['options']?_0x3862ea[_0x181a('0x19')][_0x181a('0x1f')]||null:null,'limit':_0x3862ea[_0x181a('0x19')]?_0x3862ea['options'][_0x181a('0x20')]||null:null})[_0x181a('0xa')](function(_0x1b6273){logger['info']('UpdateVoiceDialReport',_0x3862ea);logger[_0x181a('0x1a')](_0x181a('0x1b'),_0x3862ea,JSON[_0x181a('0xf')](_0x1b6273));_0x537a2d(_0x1b6273);})[_0x181a('0x14')](function(_0x92ff52){logger[_0x181a('0x10')](_0x181a('0x1b'),_0x92ff52[_0x181a('0x12')],_0x3862ea);_0x157d4b(_0x3f0c6c['error'](0x1f4,_0x92ff52['message']));});});};
\ No newline at end of file
index 7b0d429..774c546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb2e=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','path'];(function(_0x553641,_0x1dc612){var _0x43e416=function(_0x29c91e){while(--_0x29c91e){_0x553641['push'](_0x553641['shift']());}};_0x43e416(++_0x1dc612);}(_0xeb2e,0x108));var _0xeeb2=function(_0x355d58,_0x3e98fb){_0x355d58=_0x355d58-0x0;var _0x5a7217=_0xeb2e[_0x355d58];return _0x5a7217;};'use strict';var multer=require(_0xeeb2('0x0'));var util=require('util');var path=require(_0xeeb2('0x1'));var timeout=require(_0xeeb2('0x2'));var express=require('express');var router=express[_0xeeb2('0x3')]();var fs_extra=require(_0xeeb2('0x4'));var auth=require(_0xeeb2('0x5'));var interaction=require(_0xeeb2('0x6'));var config=require(_0xeeb2('0x7'));var controller=require(_0xeeb2('0x8'));router[_0xeeb2('0x9')]('/',auth[_0xeeb2('0xa')](),controller[_0xeeb2('0xb')]);router[_0xeeb2('0x9')](_0xeeb2('0xc'),auth[_0xeeb2('0xa')](),controller[_0xeeb2('0xd')]);router[_0xeeb2('0xe')]('/',auth[_0xeeb2('0xa')](),controller[_0xeeb2('0xf')]);router['post']('/:id/applications',auth[_0xeeb2('0xa')](),controller['addApplications']);router[_0xeeb2('0x10')](_0xeeb2('0xc'),auth[_0xeeb2('0xa')](),controller[_0xeeb2('0x11')]);router[_0xeeb2('0x12')](_0xeeb2('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe0b9=['index','/:id','show','post','create','/:id/applications','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated'];(function(_0x3e0c9d,_0x385cb7){var _0x20c8f3=function(_0x388ae0){while(--_0x388ae0){_0x3e0c9d['push'](_0x3e0c9d['shift']());}};_0x20c8f3(++_0x385cb7);}(_0xe0b9,0x11e));var _0x9e0b=function(_0x550e29,_0x4047f){_0x550e29=_0x550e29-0x0;var _0x3515b6=_0xe0b9[_0x550e29];return _0x3515b6;};'use strict';var multer=require(_0x9e0b('0x0'));var util=require(_0x9e0b('0x1'));var path=require(_0x9e0b('0x2'));var timeout=require(_0x9e0b('0x3'));var express=require(_0x9e0b('0x4'));var router=express[_0x9e0b('0x5')]();var fs_extra=require(_0x9e0b('0x6'));var auth=require(_0x9e0b('0x7'));var interaction=require(_0x9e0b('0x8'));var config=require(_0x9e0b('0x9'));var controller=require(_0x9e0b('0xa'));router[_0x9e0b('0xb')]('/',auth[_0x9e0b('0xc')](),controller[_0x9e0b('0xd')]);router['get'](_0x9e0b('0xe'),auth['isAuthenticated'](),controller[_0x9e0b('0xf')]);router[_0x9e0b('0x10')]('/',auth[_0x9e0b('0xc')](),controller[_0x9e0b('0x11')]);router[_0x9e0b('0x10')](_0x9e0b('0x12'),auth[_0x9e0b('0xc')](),controller['addApplications']);router[_0x9e0b('0x13')](_0x9e0b('0xe'),auth[_0x9e0b('0xc')](),controller[_0x9e0b('0x14')]);router[_0x9e0b('0x15')](_0x9e0b('0xe'),auth[_0x9e0b('0xc')](),controller[_0x9e0b('0x16')]);module['exports']=router;
\ No newline at end of file
index eba625a..0a9d985 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x162c=['STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exports','compositeIndex'];(function(_0x5b936c,_0x3e40db){var _0x26f01b=function(_0x2e0802){while(--_0x2e0802){_0x5b936c['push'](_0x5b936c['shift']());}};_0x26f01b(++_0x3e40db);}(_0x162c,0x1e4));var _0xc162=function(_0x52e881,_0x5bcfe8){_0x52e881=_0x52e881-0x0;var _0x482df6=_0x162c[_0x52e881];return _0x482df6;};'use strict';var Sequelize=require('sequelize');module[_0xc162('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc162('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xc162('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xc162('0x1')},'tag':{'type':Sequelize[_0xc162('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xc162('0x2')],'allowNull':![],'defaultValue':_0xc162('0x3')},'appdata':{'type':Sequelize[_0xc162('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc162('0x4')](_0xc162('0x5'),_0xc162('0x6'),_0xc162('0x7'),_0xc162('0x8'),_0xc162('0x9'),_0xc162('0xa'),_0xc162('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xc162('0x2')]},'interval':{'type':Sequelize[_0xc162('0x2')],'allowNull':![],'defaultValue':_0xc162('0xc')},'IntervalId':{'type':Sequelize[_0xc162('0xd')]},'isApp':{'type':Sequelize[_0xc162('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xc162('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xc162('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xc162('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc162('0xd')]},'recordingFormat':{'type':Sequelize[_0xc162('0x2')],'defaultValue':_0xc162('0xf')},'answer':{'type':Sequelize[_0xc162('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xc162('0x10')],'get':function(_0x109e3d){return this[_0xc162('0x11')]('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x4e3b=['exten','sequelize','compositeIndex','STRING','ENUM','inbound','outbound','internal','inbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x4e3b,0x1e1));var _0xb4e3=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0x4e3b[_0x310a1b];return _0xdea206;};'use strict';var Sequelize=require(_0xb4e3('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb4e3('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb4e3('0x1')},'priority':{'type':Sequelize[_0xb4e3('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xb4e3('0x1')},'tag':{'type':Sequelize[_0xb4e3('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xb4e3('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xb4e3('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xb4e3('0x3')](_0xb4e3('0x4'),_0xb4e3('0x5'),_0xb4e3('0x6'),_0xb4e3('0x7'),'outbound-fax',_0xb4e3('0x8'),_0xb4e3('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xb4e3('0xa')]},'isApp':{'type':Sequelize[_0xb4e3('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xb4e3('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xb4e3('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xb4e3('0xa')]},'recordingFormat':{'type':Sequelize[_0xb4e3('0x2')],'defaultValue':_0xb4e3('0xc')},'answer':{'type':Sequelize[_0xb4e3('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xb4e3('0xd')],'get':function(_0x364928){return this[_0xb4e3('0xe')](_0xb4e3('0xf'));}},'alias':{'type':Sequelize[_0xb4e3('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 24a6936..757bef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe354=['fields','includeAll','create','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','map','value','includes','find','type','name','sendStatus','send','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params'];(function(_0x272282,_0x2e94a0){var _0xedf511=function(_0x5d1ab6){while(--_0x5d1ab6){_0x272282['push'](_0x272282['shift']());}};_0xedf511(++_0x2e94a0);}(_0xe354,0x7e));var _0x4e35=function(_0xa1a0f1,_0x49fb3c){_0xa1a0f1=_0xa1a0f1-0x0;var _0x3c2919=_0xe354[_0xa1a0f1];return _0x3c2919;};'use strict';var _=require(_0x4e35('0x0'));var Redis=require(_0x4e35('0x1'));var qs=require(_0x4e35('0x2'));var logger=require(_0x4e35('0x3'))(_0x4e35('0x4'));var config=require(_0x4e35('0x5'));var db=require('../../mysqldb')['db'];config[_0x4e35('0x6')]=_[_0x4e35('0x7')](config[_0x4e35('0x6')],{'host':_0x4e35('0x8'),'port':0x18eb});var socket=require(_0x4e35('0x9'))(new Redis(config['redis']));require(_0x4e35('0xa'))[_0x4e35('0xb')](socket);function respondWithStatusCode(_0x1dac70,_0x30ea2a){_0x30ea2a=_0x30ea2a||0xcc;return function(_0x4ac95e){if(_0x4ac95e){return _0x1dac70['sendStatus'](_0x30ea2a);}return _0x1dac70['status'](_0x30ea2a)['end']();};}function respondWithResult(_0x11bf93,_0x5df013){_0x5df013=_0x5df013||0xc8;return function(_0x2aa1ee){if(_0x2aa1ee){return _0x11bf93[_0x4e35('0xc')](_0x5df013)['json'](_0x2aa1ee);}};}function respondWithFilteredResult(_0x3c3db5,_0x523921){return function(_0x113ad4){if(_0x113ad4){var _0x177fd6=typeof _0x523921[_0x4e35('0xd')]===_0x4e35('0xe')&&typeof _0x523921[_0x4e35('0xf')]===_0x4e35('0xe');var _0x54cea3=_0x113ad4[_0x4e35('0x10')];var _0x42b85e=_0x177fd6?0x0:_0x523921[_0x4e35('0xd')];var _0x25cc72=_0x177fd6?_0x113ad4[_0x4e35('0x10')]:_0x523921['offset']+_0x523921['limit'];var _0x1371da;if(_0x25cc72>=_0x54cea3){_0x25cc72=_0x54cea3;_0x1371da=0xc8;}else{_0x1371da=0xce;}_0x3c3db5[_0x4e35('0xc')](_0x1371da);return _0x3c3db5[_0x4e35('0x11')](_0x4e35('0x12'),_0x42b85e+'-'+_0x25cc72+'/'+_0x54cea3)[_0x4e35('0x13')](_0x113ad4);}return null;};}function removeEntity(_0x42e1c2){return function(_0x2f20e4){if(_0x2f20e4){return _0x2f20e4[_0x4e35('0x14')]()[_0x4e35('0x15')](function(){var _0x49fce6=_0x2f20e4[_0x4e35('0x16')]({'plain':!![]});var _0x1b79b3=[{'name':_0x4e35('0x17'),'value':_0x4e35('0x18'),'ignore':![]},{'name':_0x4e35('0x19'),'value':_0x4e35('0x1a'),'ignore':![]},{'name':_0x4e35('0x1b'),'value':_0x4e35('0x1c'),'ignore':![]}];var _0x1c4f95=_(_0x1b79b3)['filter']('ignore')[_0x4e35('0x1d')](_0x4e35('0x1e'))[_0x4e35('0x1e')]();if(_[_0x4e35('0x1f')](_0x1c4f95,_0x49fce6['type'])){return;}var _0x2451e2=_[_0x4e35('0x20')](_0x1b79b3,['value',_0x49fce6[_0x4e35('0x21')]])[_0x4e35('0x22')];return db['UserProfileResource']['destroy']({'where':{'type':_0x2451e2,'resourceId':_0x49fce6['id']}})[_0x4e35('0x15')](function(){return _0x2f20e4;});})[_0x4e35('0x15')](function(){_0x42e1c2[_0x4e35('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x207f0a){return function(_0x858906){if(!_0x858906){_0x207f0a[_0x4e35('0x23')](0x194);}return _0x858906;};}function handleError(_0x1cbafb,_0x320205){_0x320205=_0x320205||0x1f4;return function(_0x3918fe){logger['error'](_0x3918fe['stack']);if(_0x3918fe[_0x4e35('0x22')]){delete _0x3918fe[_0x4e35('0x22')];}_0x1cbafb['status'](_0x320205)[_0x4e35('0x24')](_0x3918fe);};}exports['index']=function(_0x39c1bd,_0x2c1651){var _0x1c6594={},_0x536c53={},_0x5e61e2={'count':0x0,'rows':[]};var _0x3dc5f3=_[_0x4e35('0x1d')](db[_0x4e35('0x25')][_0x4e35('0x26')],function(_0x5bb257){return{'name':_0x5bb257[_0x4e35('0x27')],'type':_0x5bb257[_0x4e35('0x21')][_0x4e35('0x28')]};});_0x536c53['model']=_[_0x4e35('0x1d')](_0x3dc5f3,_0x4e35('0x22'));_0x536c53[_0x4e35('0x29')]=_[_0x4e35('0x2a')](_0x39c1bd[_0x4e35('0x29')]);_0x536c53[_0x4e35('0x2b')]=_[_0x4e35('0x2c')](_0x536c53[_0x4e35('0x2d')],_0x536c53[_0x4e35('0x29')]);_0x1c6594[_0x4e35('0x2e')]=_[_0x4e35('0x2c')](_0x536c53[_0x4e35('0x2d')],qs['fields'](_0x39c1bd[_0x4e35('0x29')]['fields']));_0x1c6594[_0x4e35('0x2e')]=_0x1c6594[_0x4e35('0x2e')][_0x4e35('0x2f')]?_0x1c6594['attributes']:_0x536c53[_0x4e35('0x2d')];if(!_0x39c1bd[_0x4e35('0x29')][_0x4e35('0x30')](_0x4e35('0x31'))){_0x1c6594[_0x4e35('0xf')]=qs[_0x4e35('0xf')](_0x39c1bd[_0x4e35('0x29')][_0x4e35('0xf')]);_0x1c6594[_0x4e35('0xd')]=qs[_0x4e35('0xd')](_0x39c1bd['query']['offset']);}_0x1c6594[_0x4e35('0x32')]=qs[_0x4e35('0x33')](_0x39c1bd[_0x4e35('0x29')]['sort']);_0x1c6594[_0x4e35('0x34')]=qs['filters'](_[_0x4e35('0x35')](_0x39c1bd[_0x4e35('0x29')],_0x536c53[_0x4e35('0x2b')]),_0x3dc5f3);if(_0x39c1bd['query']['filter']){_0x1c6594[_0x4e35('0x34')]=_[_0x4e35('0x36')](_0x1c6594[_0x4e35('0x34')],{'$or':_['map'](_0x3dc5f3,function(_0x5e80ff){if(_0x5e80ff[_0x4e35('0x21')]!==_0x4e35('0x37')){var _0x4b0e47={};_0x4b0e47[_0x5e80ff[_0x4e35('0x22')]]={'$like':'%'+_0x39c1bd[_0x4e35('0x29')][_0x4e35('0x38')]+'%'};return _0x4b0e47;}})});}_0x1c6594=_[_0x4e35('0x36')]({},_0x1c6594,_0x39c1bd[_0x4e35('0x39')]);var _0x55e079={'where':_0x1c6594[_0x4e35('0x34')]};return db['VoiceExtension']['count'](_0x55e079)['then'](function(_0x2f3dfe){_0x5e61e2[_0x4e35('0x10')]=_0x2f3dfe;if(_0x39c1bd[_0x4e35('0x29')]['includeAll']){_0x1c6594[_0x4e35('0x3a')]=[{'all':!![]}];}return db[_0x4e35('0x25')][_0x4e35('0x3b')](_0x1c6594);})['then'](function(_0x566b60){_0x5e61e2[_0x4e35('0x3c')]=_0x566b60;return _0x5e61e2;})[_0x4e35('0x15')](respondWithFilteredResult(_0x2c1651,_0x1c6594))[_0x4e35('0x3d')](handleError(_0x2c1651,null));};exports[_0x4e35('0x3e')]=function(_0x550821,_0xe956bb){var _0x1abe8c={'raw':![],'where':{'id':_0x550821[_0x4e35('0x3f')]['id']}},_0x19b5fc={};_0x19b5fc[_0x4e35('0x2d')]=_['keys'](db[_0x4e35('0x25')][_0x4e35('0x26')]);_0x19b5fc[_0x4e35('0x29')]=_['keys'](_0x550821[_0x4e35('0x29')]);_0x19b5fc['filters']=_[_0x4e35('0x2c')](_0x19b5fc[_0x4e35('0x2d')],_0x19b5fc['query']);_0x1abe8c[_0x4e35('0x2e')]=_['intersection'](_0x19b5fc[_0x4e35('0x2d')],qs['fields'](_0x550821[_0x4e35('0x29')][_0x4e35('0x40')]));_0x1abe8c[_0x4e35('0x2e')]=_0x1abe8c['attributes'][_0x4e35('0x2f')]?_0x1abe8c[_0x4e35('0x2e')]:_0x19b5fc[_0x4e35('0x2d')];if(_0x550821[_0x4e35('0x29')][_0x4e35('0x41')]){_0x1abe8c['include']=[{'all':!![]}];}_0x1abe8c=_[_0x4e35('0x36')]({},_0x1abe8c,_0x550821[_0x4e35('0x39')]);return db[_0x4e35('0x25')][_0x4e35('0x20')](_0x1abe8c)['then'](handleEntityNotFound(_0xe956bb,null))[_0x4e35('0x15')](respondWithResult(_0xe956bb,null))[_0x4e35('0x3d')](handleError(_0xe956bb,null));};exports[_0x4e35('0x14')]=function(_0x2f7ce1,_0x2fd23f){return db[_0x4e35('0x25')][_0x4e35('0x20')]({'where':{'id':_0x2f7ce1[_0x4e35('0x3f')]['id']}})[_0x4e35('0x15')](handleEntityNotFound(_0x2fd23f,null))[_0x4e35('0x15')](removeEntity(_0x2fd23f,null))[_0x4e35('0x3d')](handleError(_0x2fd23f,null));};exports[_0x4e35('0x42')]=function(_0x470f88,_0x496a88){if(_0x470f88[_0x4e35('0x43')][_0x4e35('0x21')]==='outbound'&&!_['startsWith'](_0x470f88[_0x4e35('0x43')][_0x4e35('0x44')],'_')){_0x470f88[_0x4e35('0x43')]['exten']='_'['concat'](_0x470f88[_0x4e35('0x43')][_0x4e35('0x44')]);}return db[_0x4e35('0x25')]['create'](_0x470f88['body'],{'raw':![]})[_0x4e35('0x15')](function(_0x21a2ed){var _0x5a9bb2=_0x470f88[_0x4e35('0x45')][_0x4e35('0x16')]({'plain':!![]});if(!_0x5a9bb2)throw new Error(_0x4e35('0x46'));if(_0x5a9bb2[_0x4e35('0x47')]===_0x4e35('0x45')){var _0x16db92=_0x21a2ed[_0x4e35('0x16')]({'plain':!![]});var _0x21e97e=[{'name':_0x4e35('0x17'),'value':_0x4e35('0x18')},{'name':_0x4e35('0x19'),'value':_0x4e35('0x1a')},{'name':_0x4e35('0x1b'),'value':_0x4e35('0x1c')}];var _0x29eb51=_[_0x4e35('0x20')](_0x21e97e,[_0x4e35('0x1e'),_0x16db92[_0x4e35('0x21')]])[_0x4e35('0x22')];return db[_0x4e35('0x48')][_0x4e35('0x20')]({'where':{'name':_0x29eb51,'userProfileId':_0x5a9bb2[_0x4e35('0x49')]},'raw':!![]})[_0x4e35('0x15')](function(_0x20da8b){if(_0x20da8b&&_0x20da8b['autoAssociation']===0x0){return db[_0x4e35('0x4a')]['create']({'name':_0x16db92[_0x4e35('0x22')],'resourceId':_0x16db92['id'],'type':_0x20da8b[_0x4e35('0x22')],'sectionId':_0x20da8b['id']},{})[_0x4e35('0x15')](function(){return _0x21a2ed;});}else{return _0x21a2ed;}})[_0x4e35('0x3d')](function(_0x317963){logger[_0x4e35('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x317963);throw _0x317963;});}return _0x21a2ed;})['then'](respondWithResult(_0x496a88,0xc9))['catch'](handleError(_0x496a88,null));};exports['update']=function(_0x5e79aa,_0x596c9e){if(_0x5e79aa[_0x4e35('0x43')]['id']){delete _0x5e79aa['body']['id'];}return db[_0x4e35('0x25')][_0x4e35('0x20')]({'where':{'id':_0x5e79aa[_0x4e35('0x3f')]['id']}})[_0x4e35('0x15')](handleEntityNotFound(_0x596c9e,null))[_0x4e35('0x15')](function(_0x217611){if(_0x217611){return db[_0x4e35('0x25')][_0x4e35('0x4c')](_[_0x4e35('0x35')](_0x5e79aa[_0x4e35('0x43')],['exten',_0x4e35('0x4d'),_0x4e35('0x4e'),_0x4e35('0x4f'),_0x4e35('0x50'),_0x4e35('0x51'),_0x4e35('0x52')]),{'where':{'context':_0x217611['context'],'exten':_0x217611[_0x4e35('0x44')]},'individualHooks':!![]})[_0x4e35('0x15')](function(_0x2acebf){return _0x2acebf;});}return null;})['then'](respondWithStatusCode(_0x596c9e,null))['catch'](handleError(_0x596c9e,null));};exports[_0x4e35('0x53')]=function(_0x47c1b6,_0x6ce3bf){var _0x7ff3f1=_0x47c1b6[_0x4e35('0x3f')]['id'];var _0x51aee8=_0x47c1b6[_0x4e35('0x43')];var _0x3fe802=0xc8;var _0x4bec17=null;return db[_0x4e35('0x54')][_0x4e35('0x55')]({'isolationLevel':db[_0x4e35('0x54')][_0x4e35('0x56')][_0x4e35('0x57')]['READ_COMMITTED']},function(_0x398052){return db[_0x4e35('0x25')][_0x4e35('0x58')]({'where':{'id':_0x7ff3f1},'transaction':_0x398052})[_0x4e35('0x15')](function(_0x4d1810){if(_0x4d1810){return db[_0x4e35('0x25')][_0x4e35('0x14')]({'where':{'VoiceExtensionId':_0x7ff3f1},'transaction':_0x398052})['then'](function(){var _0x38ea64=_['map'](_0x51aee8,function(_0x51ef43){_0x51ef43[_0x4e35('0x59')]=_0x7ff3f1;_0x51ef43[_0x4e35('0x5a')]=!![];return _0x51ef43;});return _0x4d1810[_0x4e35('0x5b')](_0x38ea64);})[_0x4e35('0x15')](function(_0x25801b){return db[_0x4e35('0x25')]['bulkCreate'](_0x25801b,{'transaction':_0x398052});});}else{_0x3fe802=0x194;_0x4bec17=[];}});})[_0x4e35('0x15')](function(){if(_0x3fe802!==0x194){return db[_0x4e35('0x25')][_0x4e35('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x7ff3f1},'order':_0x4e35('0x5d')})['then'](function(_0x544cfd){_0x4bec17=_0x544cfd;});}})[_0x4e35('0x3d')](function(_0x5e3790){_0x3fe802=0x1f4;logger[_0x4e35('0x4b')](_0x5e3790[_0x4e35('0x5e')]);if(_0x5e3790[_0x4e35('0x22')]){delete _0x5e3790[_0x4e35('0x22')];}_0x4bec17=_0x5e3790;})['finally'](function(){if(_0x4bec17===null){_0x6ce3bf[_0x4e35('0x23')](_0x3fe802);}else{if(_0x3fe802===0x1f4){_0x6ce3bf[_0x4e35('0xc')](_0x3fe802)[_0x4e35('0x24')](_0x4bec17);}else{_0x6ce3bf[_0x4e35('0xc')](_0x3fe802)[_0x4e35('0x13')](_0x4bec17);}}});};
\ No newline at end of file
+var _0x1c5d=['createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','send','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','status','end','json','offset','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','sendStatus','error','stack','name','index','fieldName','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','findAll','catch','keys','rawAttributes','length','includeAll','include','params','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp'];(function(_0x40754a,_0xbdfff5){var _0x4a2dda=function(_0x2a3d38){while(--_0x2a3d38){_0x40754a['push'](_0x40754a['shift']());}};_0x4a2dda(++_0xbdfff5);}(_0x1c5d,0x12b));var _0xd1c5=function(_0x286e47,_0x44c3fd){_0x286e47=_0x286e47-0x0;var _0x135ade=_0x1c5d[_0x286e47];return _0x135ade;};'use strict';var _=require('lodash');var Redis=require(_0xd1c5('0x0'));var qs=require(_0xd1c5('0x1'));var logger=require(_0xd1c5('0x2'))(_0xd1c5('0x3'));var config=require(_0xd1c5('0x4'));var db=require('../../mysqldb')['db'];config[_0xd1c5('0x5')]=_[_0xd1c5('0x6')](config['redis'],{'host':_0xd1c5('0x7'),'port':0x18eb});var socket=require(_0xd1c5('0x8'))(new Redis(config[_0xd1c5('0x5')]));require(_0xd1c5('0x9'))['register'](socket);function respondWithStatusCode(_0x3f05f9,_0x4407d5){_0x4407d5=_0x4407d5||0xcc;return function(_0xaa1bb0){if(_0xaa1bb0){return _0x3f05f9['sendStatus'](_0x4407d5);}return _0x3f05f9[_0xd1c5('0xa')](_0x4407d5)[_0xd1c5('0xb')]();};}function respondWithResult(_0x2e70a7,_0x1dd92a){_0x1dd92a=_0x1dd92a||0xc8;return function(_0x2492f6){if(_0x2492f6){return _0x2e70a7[_0xd1c5('0xa')](_0x1dd92a)[_0xd1c5('0xc')](_0x2492f6);}};}function respondWithFilteredResult(_0xb67dd1,_0x12f233){return function(_0x524ef8){if(_0x524ef8){var _0xb82ddb=typeof _0x12f233[_0xd1c5('0xd')]==='undefined'&&typeof _0x12f233[_0xd1c5('0xe')]==='undefined';var _0x53b006=_0x524ef8[_0xd1c5('0xf')];var _0x4a8246=_0xb82ddb?0x0:_0x12f233[_0xd1c5('0xd')];var _0x2c19ba=_0xb82ddb?_0x524ef8['count']:_0x12f233['offset']+_0x12f233[_0xd1c5('0xe')];var _0x151168;if(_0x2c19ba>=_0x53b006){_0x2c19ba=_0x53b006;_0x151168=0xc8;}else{_0x151168=0xce;}_0xb67dd1['status'](_0x151168);return _0xb67dd1[_0xd1c5('0x10')](_0xd1c5('0x11'),_0x4a8246+'-'+_0x2c19ba+'/'+_0x53b006)[_0xd1c5('0xc')](_0x524ef8);}return null;};}function removeEntity(_0x365261){return function(_0x2981f4){if(_0x2981f4){return _0x2981f4[_0xd1c5('0x12')]()[_0xd1c5('0x13')](function(){var _0x4c8fe2=_0x2981f4[_0xd1c5('0x14')]({'plain':!![]});var _0xa41706=[{'name':_0xd1c5('0x15'),'value':_0xd1c5('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':_0xd1c5('0x17'),'ignore':![]},{'name':_0xd1c5('0x18'),'value':_0xd1c5('0x19'),'ignore':![]}];var _0x1c82b9=_(_0xa41706)[_0xd1c5('0x1a')](_0xd1c5('0x1b'))[_0xd1c5('0x1c')]('value')[_0xd1c5('0x1d')]();if(_[_0xd1c5('0x1e')](_0x1c82b9,_0x4c8fe2[_0xd1c5('0x1f')])){return;}var _0x4aaf5f=_[_0xd1c5('0x20')](_0xa41706,['value',_0x4c8fe2[_0xd1c5('0x1f')]])['name'];return db['UserProfileResource'][_0xd1c5('0x12')]({'where':{'type':_0x4aaf5f,'resourceId':_0x4c8fe2['id']}})[_0xd1c5('0x13')](function(){return _0x2981f4;});})['then'](function(){_0x365261[_0xd1c5('0xa')](0xcc)[_0xd1c5('0xb')]();});}};}function handleEntityNotFound(_0x1d13ec){return function(_0xfadb51){if(!_0xfadb51){_0x1d13ec[_0xd1c5('0x21')](0x194);}return _0xfadb51;};}function handleError(_0x4938e9,_0x388448){_0x388448=_0x388448||0x1f4;return function(_0x48f794){logger[_0xd1c5('0x22')](_0x48f794[_0xd1c5('0x23')]);if(_0x48f794[_0xd1c5('0x24')]){delete _0x48f794[_0xd1c5('0x24')];}_0x4938e9[_0xd1c5('0xa')](_0x388448)['send'](_0x48f794);};}exports[_0xd1c5('0x25')]=function(_0x1dfdd6,_0x5d3f7a){var _0x2c46aa={},_0x5937cd={},_0x4821c9={'count':0x0,'rows':[]};var _0x172c16=_[_0xd1c5('0x1c')](db['VoiceExtension']['rawAttributes'],function(_0x33d089){return{'name':_0x33d089[_0xd1c5('0x26')],'type':_0x33d089[_0xd1c5('0x1f')][_0xd1c5('0x27')]};});_0x5937cd[_0xd1c5('0x28')]=_['map'](_0x172c16,_0xd1c5('0x24'));_0x5937cd['query']=_['keys'](_0x1dfdd6['query']);_0x5937cd[_0xd1c5('0x29')]=_[_0xd1c5('0x2a')](_0x5937cd[_0xd1c5('0x28')],_0x5937cd[_0xd1c5('0x2b')]);_0x2c46aa[_0xd1c5('0x2c')]=_[_0xd1c5('0x2a')](_0x5937cd[_0xd1c5('0x28')],qs['fields'](_0x1dfdd6[_0xd1c5('0x2b')][_0xd1c5('0x2d')]));_0x2c46aa[_0xd1c5('0x2c')]=_0x2c46aa[_0xd1c5('0x2c')]['length']?_0x2c46aa[_0xd1c5('0x2c')]:_0x5937cd[_0xd1c5('0x28')];if(!_0x1dfdd6[_0xd1c5('0x2b')][_0xd1c5('0x2e')](_0xd1c5('0x2f'))){_0x2c46aa[_0xd1c5('0xe')]=qs[_0xd1c5('0xe')](_0x1dfdd6[_0xd1c5('0x2b')][_0xd1c5('0xe')]);_0x2c46aa[_0xd1c5('0xd')]=qs[_0xd1c5('0xd')](_0x1dfdd6[_0xd1c5('0x2b')][_0xd1c5('0xd')]);}_0x2c46aa[_0xd1c5('0x30')]=qs['sort'](_0x1dfdd6[_0xd1c5('0x2b')][_0xd1c5('0x31')]);_0x2c46aa[_0xd1c5('0x32')]=qs[_0xd1c5('0x29')](_[_0xd1c5('0x33')](_0x1dfdd6[_0xd1c5('0x2b')],_0x5937cd[_0xd1c5('0x29')]),_0x172c16);if(_0x1dfdd6[_0xd1c5('0x2b')][_0xd1c5('0x1a')]){_0x2c46aa[_0xd1c5('0x32')]=_[_0xd1c5('0x34')](_0x2c46aa[_0xd1c5('0x32')],{'$or':_[_0xd1c5('0x1c')](_0x172c16,function(_0x3dd1a4){if(_0x3dd1a4[_0xd1c5('0x1f')]!==_0xd1c5('0x35')){var _0x44cce7={};_0x44cce7[_0x3dd1a4[_0xd1c5('0x24')]]={'$like':'%'+_0x1dfdd6[_0xd1c5('0x2b')][_0xd1c5('0x1a')]+'%'};return _0x44cce7;}})});}_0x2c46aa=_['merge']({},_0x2c46aa,_0x1dfdd6[_0xd1c5('0x36')]);var _0x581913={'where':_0x2c46aa[_0xd1c5('0x32')]};return db[_0xd1c5('0x37')]['count'](_0x581913)[_0xd1c5('0x13')](function(_0x21ca54){_0x4821c9['count']=_0x21ca54;if(_0x1dfdd6[_0xd1c5('0x2b')]['includeAll']){_0x2c46aa['include']=[{'all':!![]}];}return db[_0xd1c5('0x37')][_0xd1c5('0x38')](_0x2c46aa);})[_0xd1c5('0x13')](function(_0x14da81){_0x4821c9['rows']=_0x14da81;return _0x4821c9;})[_0xd1c5('0x13')](respondWithFilteredResult(_0x5d3f7a,_0x2c46aa))[_0xd1c5('0x39')](handleError(_0x5d3f7a,null));};exports['show']=function(_0x1ec686,_0x43becf){var _0x52294b={'raw':![],'where':{'id':_0x1ec686['params']['id']}},_0x47f318={};_0x47f318[_0xd1c5('0x28')]=_[_0xd1c5('0x3a')](db['VoiceExtension'][_0xd1c5('0x3b')]);_0x47f318['query']=_[_0xd1c5('0x3a')](_0x1ec686[_0xd1c5('0x2b')]);_0x47f318['filters']=_[_0xd1c5('0x2a')](_0x47f318[_0xd1c5('0x28')],_0x47f318[_0xd1c5('0x2b')]);_0x52294b['attributes']=_[_0xd1c5('0x2a')](_0x47f318['model'],qs[_0xd1c5('0x2d')](_0x1ec686[_0xd1c5('0x2b')][_0xd1c5('0x2d')]));_0x52294b[_0xd1c5('0x2c')]=_0x52294b[_0xd1c5('0x2c')][_0xd1c5('0x3c')]?_0x52294b['attributes']:_0x47f318[_0xd1c5('0x28')];if(_0x1ec686['query'][_0xd1c5('0x3d')]){_0x52294b[_0xd1c5('0x3e')]=[{'all':!![]}];}_0x52294b=_[_0xd1c5('0x34')]({},_0x52294b,_0x1ec686['options']);return db['VoiceExtension'][_0xd1c5('0x20')](_0x52294b)['then'](handleEntityNotFound(_0x43becf,null))[_0xd1c5('0x13')](respondWithResult(_0x43becf,null))[_0xd1c5('0x39')](handleError(_0x43becf,null));};exports[_0xd1c5('0x12')]=function(_0x447a24,_0x58c01c){return db[_0xd1c5('0x37')]['find']({'where':{'id':_0x447a24[_0xd1c5('0x3f')]['id']}})[_0xd1c5('0x13')](handleEntityNotFound(_0x58c01c,null))['then'](removeEntity(_0x58c01c,null))['catch'](handleError(_0x58c01c,null));};exports[_0xd1c5('0x40')]=function(_0x24a0f1,_0x540162){if(_0x24a0f1[_0xd1c5('0x41')][_0xd1c5('0x1f')]===_0xd1c5('0x17')&&!_[_0xd1c5('0x42')](_0x24a0f1[_0xd1c5('0x41')][_0xd1c5('0x43')],'_')){_0x24a0f1['body']['exten']='_'[_0xd1c5('0x44')](_0x24a0f1[_0xd1c5('0x41')]['exten']);}return db[_0xd1c5('0x37')][_0xd1c5('0x40')](_0x24a0f1[_0xd1c5('0x41')],{'raw':![]})['then'](function(_0xe9c89d){var _0x51f55c=_0x24a0f1[_0xd1c5('0x45')][_0xd1c5('0x14')]({'plain':!![]});if(!_0x51f55c)throw new Error(_0xd1c5('0x46'));if(_0x51f55c[_0xd1c5('0x47')]==='user'){var _0x1c70f0=_0xe9c89d[_0xd1c5('0x14')]({'plain':!![]});var _0x133f34=[{'name':_0xd1c5('0x15'),'value':_0xd1c5('0x16')},{'name':_0xd1c5('0x48'),'value':_0xd1c5('0x17')},{'name':_0xd1c5('0x18'),'value':'internal'}];var _0x34a764=_[_0xd1c5('0x20')](_0x133f34,['value',_0x1c70f0[_0xd1c5('0x1f')]])['name'];return db[_0xd1c5('0x49')]['find']({'where':{'name':_0x34a764,'userProfileId':_0x51f55c[_0xd1c5('0x4a')]},'raw':!![]})[_0xd1c5('0x13')](function(_0x51fc76){if(_0x51fc76&&_0x51fc76[_0xd1c5('0x4b')]===0x0){return db[_0xd1c5('0x4c')][_0xd1c5('0x40')]({'name':_0x1c70f0[_0xd1c5('0x24')],'resourceId':_0x1c70f0['id'],'type':_0x51fc76[_0xd1c5('0x24')],'sectionId':_0x51fc76['id']},{})[_0xd1c5('0x13')](function(){return _0xe9c89d;});}else{return _0xe9c89d;}})['catch'](function(_0x99c61c){logger[_0xd1c5('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x99c61c);throw _0x99c61c;});}return _0xe9c89d;})['then'](respondWithResult(_0x540162,0xc9))[_0xd1c5('0x39')](handleError(_0x540162,null));};exports[_0xd1c5('0x4d')]=function(_0x17ab74,_0x38513c){if(_0x17ab74[_0xd1c5('0x41')]['id']){delete _0x17ab74[_0xd1c5('0x41')]['id'];}return db[_0xd1c5('0x37')][_0xd1c5('0x20')]({'where':{'id':_0x17ab74[_0xd1c5('0x3f')]['id']}})[_0xd1c5('0x13')](handleEntityNotFound(_0x38513c,null))['then'](function(_0x3ca00e){if(_0x3ca00e){return db[_0xd1c5('0x37')][_0xd1c5('0x4d')](_[_0xd1c5('0x33')](_0x17ab74[_0xd1c5('0x41')],['exten',_0xd1c5('0x4e'),_0xd1c5('0x4f'),_0xd1c5('0x50'),_0xd1c5('0x51'),_0xd1c5('0x52'),_0xd1c5('0x53')]),{'where':{'context':_0x3ca00e[_0xd1c5('0x4e')],'exten':_0x3ca00e[_0xd1c5('0x43')]},'individualHooks':!![]})[_0xd1c5('0x13')](function(_0x478399){return _0x478399;});}return null;})[_0xd1c5('0x13')](respondWithStatusCode(_0x38513c,null))['catch'](handleError(_0x38513c,null));};exports[_0xd1c5('0x54')]=function(_0x55078d,_0x642e86){var _0x43dee5=_0x55078d[_0xd1c5('0x3f')]['id'];var _0x353a16=_0x55078d[_0xd1c5('0x41')];var _0x48d808=0xc8;var _0x54a711=null;return db['sequelize'][_0xd1c5('0x55')]({'isolationLevel':db[_0xd1c5('0x56')][_0xd1c5('0x57')][_0xd1c5('0x58')][_0xd1c5('0x59')]},function(_0x275661){return db[_0xd1c5('0x37')][_0xd1c5('0x5a')]({'where':{'id':_0x43dee5},'transaction':_0x275661})[_0xd1c5('0x13')](function(_0x349b2d){if(_0x349b2d){return db[_0xd1c5('0x37')][_0xd1c5('0x12')]({'where':{'VoiceExtensionId':_0x43dee5},'transaction':_0x275661})['then'](function(){var _0x4f2406=_[_0xd1c5('0x1c')](_0x353a16,function(_0xfab20b){_0xfab20b[_0xd1c5('0x5b')]=_0x43dee5;_0xfab20b[_0xd1c5('0x5c')]=!![];return _0xfab20b;});return _0x349b2d[_0xd1c5('0x5d')](_0x4f2406);})['then'](function(_0x113179){return db[_0xd1c5('0x37')][_0xd1c5('0x5e')](_0x113179,{'transaction':_0x275661});});}else{_0x48d808=0x194;_0x54a711=[];}});})[_0xd1c5('0x13')](function(){if(_0x48d808!==0x194){return db[_0xd1c5('0x37')][_0xd1c5('0x5f')]({'where':{'isApp':!![],'VoiceExtensionId':_0x43dee5},'order':_0xd1c5('0x60')})[_0xd1c5('0x13')](function(_0x51278a){_0x54a711=_0x51278a;});}})[_0xd1c5('0x39')](function(_0x118161){_0x48d808=0x1f4;logger[_0xd1c5('0x22')](_0x118161['stack']);if(_0x118161[_0xd1c5('0x24')]){delete _0x118161[_0xd1c5('0x24')];}_0x54a711=_0x118161;})['finally'](function(){if(_0x54a711===null){_0x642e86['sendStatus'](_0x48d808);}else{if(_0x48d808===0x1f4){_0x642e86[_0xd1c5('0xa')](_0x48d808)[_0xd1c5('0x61')](_0x54a711);}else{_0x642e86['status'](_0x48d808)[_0xd1c5('0xc')](_0x54a711);}}});};
\ No newline at end of file
index f9ff62e..ad2adcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a48=['exports','../../mysqldb','VoiceExtension','remove','emit','hasOwnProperty','hook'];(function(_0xccfc3b,_0x1b6620){var _0x3cfa86=function(_0x365a0d){while(--_0x365a0d){_0xccfc3b['push'](_0xccfc3b['shift']());}};_0x3cfa86(++_0x1b6620);}(_0x0a48,0x189));var _0x80a4=function(_0x4530a5,_0x3c4e64){_0x4530a5=_0x4530a5-0x0;var _0x24026a=_0x0a48[_0x4530a5];return _0x24026a;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x80a4('0x0'))['db'][_0x80a4('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x80a4('0x2')};function emitEvent(_0x1b4c9a){return function(_0x40106a,_0x3542bf,_0x1e1a10){VoiceExtensionEvents[_0x80a4('0x3')](_0x1b4c9a+':'+_0x40106a['id'],_0x40106a);VoiceExtensionEvents[_0x80a4('0x3')](_0x1b4c9a,_0x40106a);_0x1e1a10(null);};}for(var e in events){if(events[_0x80a4('0x4')](e)){var event=events[e];VoiceExtension[_0x80a4('0x5')](e,emitEvent(event));}}module[_0x80a4('0x6')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x9ab8=['VoiceExtension','setMaxListeners','update','emit','hook','events','../../mysqldb'];(function(_0x159f91,_0xe8a30f){var _0x26bd65=function(_0x5680d1){while(--_0x5680d1){_0x159f91['push'](_0x159f91['shift']());}};_0x26bd65(++_0xe8a30f);}(_0x9ab8,0x67));var _0x89ab=function(_0x4a1b9f,_0x557a97){_0x4a1b9f=_0x4a1b9f-0x0;var _0x125fcf=_0x9ab8[_0x4a1b9f];return _0x125fcf;};'use strict';var EventEmitter=require(_0x89ab('0x0'));var VoiceExtension=require(_0x89ab('0x1'))['db'][_0x89ab('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x89ab('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x89ab('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2fae8d){return function(_0x44c031,_0x410390,_0x57cda6){VoiceExtensionEvents[_0x89ab('0x5')](_0x2fae8d+':'+_0x44c031['id'],_0x44c031);VoiceExtensionEvents[_0x89ab('0x5')](_0x2fae8d,_0x44c031);_0x57cda6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x89ab('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index 4498f62..005105c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c9c=['ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','split','length','name','trunk','param','phone','prefix','join','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','intervals','map','filter','tag','toLowerCase','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appType','appdata','last','priority','concat','catch','define','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','XCALLY-MOTION-ANSWER=0','outbound','CDR(type)=outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)='];(function(_0x48d42a,_0x44f3cf){var _0x264cfc=function(_0x43f29d){while(--_0x43f29d){_0x48d42a['push'](_0x48d42a['shift']());}};_0x264cfc(++_0x44f3cf);}(_0x0c9c,0x188));var _0xc0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc0c9('0x0'));var attributes=require(_0xc0c9('0x1'));module[_0xc0c9('0x2')]=function(_0x3cc26b){var _0x4abb6c=_0x3cc26b[_0xc0c9('0x3')];function _0x5bc767(_0x10d090){var _0x7f8ea1=0x2;var _0x40f245=[{'type':_0x10d090[_0xc0c9('0x4')],'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x6')+_0x10d090[_0xc0c9('0x4')],'context':_0x10d090[_0xc0c9('0x7')],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']},{'type':_0x10d090[_0xc0c9('0x4')],'app':_0x10d090[_0xc0c9('0x9')]?'Set':_0xc0c9('0xa'),'appdata':_0x10d090[_0xc0c9('0x9')]?_0xc0c9('0xb')+_0x10d090[_0xc0c9('0x9')]:'No\x20alias\x20set','context':_0x10d090[_0xc0c9('0x7')],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']}];if(_0x10d090['type']===_0xc0c9('0xc')){_0x40f245['push']({'type':_0xc0c9('0xc'),'app':_0xc0c9('0x5'),'appdata':'CDR(routeid)='+_0x10d090['id'],'context':_0x10d090['context'],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']});}_0x40f245[_0xc0c9('0xd')]({'type':_0x10d090[_0xc0c9('0x4')],'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0xe'),'context':_0x10d090[_0xc0c9('0x7')],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']},{'type':_0x10d090[_0xc0c9('0x4')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x10d090[_0xc0c9('0x7')],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']},{'type':_0x10d090[_0xc0c9('0x4')],'app':_0xc0c9('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x10d090[_0xc0c9('0x7')],'exten':_0x10d090[_0xc0c9('0x8')],'priority':_0x7f8ea1++,'VoiceExtensionId':_0x10d090['id']});return _0x40f245;}function _0x9786eb(_0x3eb983){var _0x49045f=0x2;var _0x198c90=[{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x10'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0x3eb983[_0xc0c9('0x9')]?_0xc0c9('0x5'):_0xc0c9('0xa'),'appdata':_0x3eb983[_0xc0c9('0x9')]?'CDR(routeAlias)='+_0x3eb983[_0xc0c9('0x9')]:_0xc0c9('0x11'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983['exten'],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x12')+(_0x3eb983[_0xc0c9('0x13')]?_0xc0c9('0x14')+_0x3eb983[_0xc0c9('0x13')]+'}':_0xc0c9('0x15')),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':'Set','appdata':_0xc0c9('0x16')+_0x3eb983['id'],'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':'outbound','app':_0xc0c9('0x17'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x49045f+0x2)+'):Goto('+(_0x49045f+0x1)+')','context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0x3eb983[_0xc0c9('0x13')]?_0xc0c9('0x18')+_0x3eb983['cutdigits']+'}':_0xc0c9('0x19'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3eb983['context'],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x1a'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x1b')+_0x3eb983['id'],'context':_0x3eb983['context'],'exten':_0x3eb983[_0xc0c9('0x8')],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']}];if(_0x3eb983[_0xc0c9('0x1c')](_0xc0c9('0x1d'))&&_0x3eb983['recordingFormat']!=='none'){_0x198c90[_0xc0c9('0xd')]({'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x1e'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983['exten'],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']},{'type':_0xc0c9('0xf'),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x1f')+_0x3eb983['recordingFormat']||_0xc0c9('0x20'),'context':_0x3eb983[_0xc0c9('0x7')],'exten':_0x3eb983['exten'],'priority':_0x49045f++,'VoiceExtensionId':_0x3eb983['id']});}return _0x198c90;}function _0x2fda41(_0x4e4905,_0x1f14bb){var _0x53cb90=[{'name':'trunk','param':0x0},{'name':_0xc0c9('0x21'),'param':0x1},{'name':_0xc0c9('0x22'),'param':0x2},{'name':_0xc0c9('0x23'),'param':0x3}];var _0x240768={};var _0x1d114f=_0x1f14bb[_0xc0c9('0x24')](',');var _0x14184d=[];for(var _0x2942ec=0x0;_0x2942ec<_0x53cb90[_0xc0c9('0x25')];_0x2942ec++){switch(_0x53cb90[_0x2942ec][_0xc0c9('0x26')]){case _0xc0c9('0x27'):_0x240768[_0xc0c9('0x27')]=_0x1d114f[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]][_0xc0c9('0x24')]('/')[0x1];_0x240768[_0xc0c9('0x29')]=_0x1d114f[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]][_0xc0c9('0x24')]('/')[0x2];_0x240768[_0xc0c9('0x2a')]=_0x240768['phone']?_0x240768[_0xc0c9('0x29')][_0xc0c9('0x24')]('$')[0x0]:undefined;_0x240768[_0xc0c9('0x29')]=_0x4e4905[_0xc0c9('0x13')]?(_0x240768['prefix']||'')+_0xc0c9('0x14')+_0x4e4905['cutdigits']+'}':(_0x240768[_0xc0c9('0x2a')]||'')+_0xc0c9('0x15');_0x14184d[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]]=['SIP',_0x240768['trunk'],_0x240768[_0xc0c9('0x29')]][_0xc0c9('0x2b')]('/');break;case _0xc0c9('0x22'):_0x240768[_0xc0c9('0x22')]=_0x1d114f[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]];if(_0x4e4905[_0xc0c9('0x1d')]!==_0xc0c9('0x2c')){if(_0x240768[_0xc0c9('0x22')][_0xc0c9('0x2d')](_0xc0c9('0x2e'))<0x0){_0x240768[_0xc0c9('0x22')]+=_0xc0c9('0x2e');}}else{_0x240768[_0xc0c9('0x22')]=_0x240768['options'][_0xc0c9('0x2f')](_0xc0c9('0x2e'),'');}_0x14184d[_0x53cb90[_0x2942ec]['param']]=_0x240768['options'];break;default:_0x14184d[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]]=_0x1d114f[_0x53cb90[_0x2942ec][_0xc0c9('0x28')]];}}return _0x14184d[_0xc0c9('0x2b')](',');}function _0xf6bbf0(_0x1c9565,_0x4a4818,_0x1de39d){return new Promise(function(_0x52b5e6,_0x4ba503){var _0x3696ba=[];if(_[_0xc0c9('0x30')](_0x4a4818))return _0x52b5e6(_0x3696ba);_0x4abb6c['Interval'][_0xc0c9('0x31')]({'attributes':['id',_0xc0c9('0x32'),_0xc0c9('0x33')],'raw':!![]})['then'](function(_0x53c702){for(var _0x17ff60=0x0,_0x311622=0x0;_0x17ff60<_0x4a4818[_0xc0c9('0x25')];_0x17ff60++,_0x311622=0x0){var _0x411711=_0x4a4818[_0x17ff60];var _0x392a51=[];var _0x300754=[];delete _0x411711['id'];if(_0x411711[_0xc0c9('0x32')]!=='*,*,*,*'){_0x411711[_0xc0c9('0x34')]=[_0x411711[_0xc0c9('0x32')]];}else{_0x411711[_0xc0c9('0x34')]=_0x411711['IntervalId']?_[_0xc0c9('0x35')](_[_0xc0c9('0x36')](_0x53c702,{'IntervalId':_0x411711[_0xc0c9('0x33')]}),_0xc0c9('0x32')):[];}_0x411711[_0xc0c9('0x7')]=_0x1c9565[_0xc0c9('0x7')];_0x411711[_0xc0c9('0x8')]=_0x1c9565[_0xc0c9('0x8')];if(_0x411711[_0xc0c9('0x4')])_0x411711[_0xc0c9('0x4')]=_0x411711['type']['toLowerCase']();if(_0x1c9565['type']===_0xc0c9('0xf')){if(_0x411711[_0xc0c9('0x1c')](_0xc0c9('0x37'))&&_0x411711[_0xc0c9('0x37')]&&_0x411711['tag']!=='--'){_0x392a51[_0xc0c9('0xd')]({'type':_0x411711['type'][_0xc0c9('0x38')](),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x39')+_0x411711[_0xc0c9('0x37')],'context':_0x1c9565[_0xc0c9('0x7')],'exten':_0x1c9565[_0xc0c9('0x8')],'priority':_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});}_0x392a51['push']({'type':_0x411711[_0xc0c9('0x4')][_0xc0c9('0x38')](),'app':_0xc0c9('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x411711[_0xc0c9('0x3a')]?_0xc0c9('0x3b')+_0x411711[_0xc0c9('0x3a')]+')':_0xc0c9('0x3c')),'context':_0x1c9565[_0xc0c9('0x7')],'exten':_0x1c9565['exten'],'priority':_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});}else{if(_0x411711[_0xc0c9('0x1c')]('answer')){if([_0xc0c9('0x3d'),_0xc0c9('0x3e')]['includes'](_0x411711[_0xc0c9('0x3f')][_0xc0c9('0x38')]())&&_0x411711['appType']!==_0xc0c9('0x40')){if(_0x411711[_0xc0c9('0x41')]){_0x392a51[_0xc0c9('0xd')]({'type':_0x411711[_0xc0c9('0x4')][_0xc0c9('0x38')](),'app':_0xc0c9('0x17'),'appdata':_0xc0c9('0x42'),'context':_0x1c9565[_0xc0c9('0x7')],'exten':_0x1c9565[_0xc0c9('0x8')],'priority':_0x411711['intervals'][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});_0x392a51['push']({'type':_0x411711[_0xc0c9('0x4')][_0xc0c9('0x38')](),'app':'Set','appdata':_0xc0c9('0x43'),'context':_0x1c9565[_0xc0c9('0x7')],'exten':_0x1c9565[_0xc0c9('0x8')],'priority':_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});}else{_0x392a51[_0xc0c9('0xd')]({'type':_0x411711[_0xc0c9('0x4')]['toLowerCase'](),'app':_0xc0c9('0x17'),'appdata':_0xc0c9('0x44'),'context':_0x1c9565[_0xc0c9('0x7')],'exten':_0x1c9565[_0xc0c9('0x8')],'priority':_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});_0x392a51[_0xc0c9('0xd')]({'type':_0x411711[_0xc0c9('0x4')]['toLowerCase'](),'app':_0xc0c9('0x5'),'appdata':_0xc0c9('0x45'),'context':_0x1c9565['context'],'exten':_0x1c9565[_0xc0c9('0x8')],'priority':_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]+_0x1de39d+_0x311622++,'VoiceExtensionId':_0x1c9565['id']});}}}}for(var _0x1acac3=0x0;_0x1acac3<_0x411711['intervals'][_0xc0c9('0x25')];_0x1acac3++){var _0x2993d2=_0x1de39d+_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')];var _0x44a0e4=_0x1acac3===_0x411711[_0xc0c9('0x34')][_0xc0c9('0x25')]-0x1?_0x1de39d+_0x392a51['length']+_0x300754[_0xc0c9('0x25')]+0x2:_0x1de39d+_0x1acac3+0x1;_0x392a51['splice'](_0x1acac3,0x0,{'type':_0x1c9565[_0xc0c9('0x4')],'app':_0xc0c9('0x46'),'appdata':_0x411711[_0xc0c9('0x34')][_0x1acac3]+'?'+_0x1c9565[_0xc0c9('0x7')]+_0xc0c9('0x47')+_0x2993d2+':'+_0x1c9565[_0xc0c9('0x7')]+_0xc0c9('0x47')+_0x44a0e4,'exten':_0x1c9565[_0xc0c9('0x8')],'context':_0x1c9565['context'],'priority':_0x1de39d+_0x1acac3,'VoiceExtensionId':_0x1c9565['id']});}if(_0x411711[_0xc0c9('0x48')]==='outboundDial')_0x411711[_0xc0c9('0x49')]=_0x2fda41(_0x1c9565,_0x411711['appdata']);_0x411711['priority']=_0x392a51[_0xc0c9('0x25')]?_[_0xc0c9('0x4a')](_0x392a51)[_0xc0c9('0x4b')]+0x1:_0x1de39d;_0x3696ba=_[_0xc0c9('0x4c')](_0x3696ba,_0x392a51,[_0x411711],_0x300754);_0x1de39d=_[_0xc0c9('0x4a')](_0x3696ba)[_0xc0c9('0x4b')]+0x1;}return _0x52b5e6(_0x3696ba);})[_0xc0c9('0x4d')](function(_0x128017){_0x4ba503(_0x128017);});});}return _0x3cc26b[_0xc0c9('0x4e')]('VoiceExtension',attributes,{'tableName':_0xc0c9('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x17da94){var _0x255803=this[_0xc0c9('0x50')]({'plain':!![]});var _0x2ebd29=_0x255803['type']===_0xc0c9('0xf')?_0x9786eb(_0x255803):_0x5bc767(_0x255803);return _0xf6bbf0(_0x255803,_0x17da94,_[_0xc0c9('0x4a')](_0x2ebd29)['priority']+0x1)[_0xc0c9('0x51')](function(_0x3264ce){var _0x1edf4c=_[_0xc0c9('0x4c')](_0x2ebd29,_0x3264ce);_0x1edf4c['push']({'type':_0x255803['type'],'app':_0xc0c9('0x52'),'exten':_0x255803[_0xc0c9('0x8')],'context':_0x255803['context'],'priority':_[_0xc0c9('0x4a')](_0x1edf4c)[_0xc0c9('0x4b')]+0x1,'VoiceExtensionId':_0x255803['id']});return _0x1edf4c;});}}});};
\ No newline at end of file
+var _0x423b=['wav','trunk','timeout','options','url','name','param','split','phone','prefix','${EXTEN:','join','none','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','length','*,*,*,*','intervals','map','filter','tag','CDR(tag)=','ExecIf','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','toLowerCase','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','define','voice_extensions','get','concat','Hangup','./voiceExtension.attributes','models','type','CDR(type)=','context','exten','alias','Set','NoOp','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(destination)=','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x382cf1,_0x4c611b){var _0xbaa8a1=function(_0x3d806c){while(--_0x3d806c){_0x382cf1['push'](_0x382cf1['shift']());}};_0xbaa8a1(++_0x4c611b);}(_0x423b,0x12b));var _0xb423=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x423b[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require('lodash');var attributes=require(_0xb423('0x0'));module['exports']=function(_0x46e2a8){var _0x54e396=_0x46e2a8[_0xb423('0x1')];function _0x4b4acf(_0x57cd26){var _0x50f31a=0x2;var _0x2fa5da=[{'type':_0x57cd26[_0xb423('0x2')],'app':'Set','appdata':_0xb423('0x3')+_0x57cd26[_0xb423('0x2')],'context':_0x57cd26[_0xb423('0x4')],'exten':_0x57cd26[_0xb423('0x5')],'priority':_0x50f31a++,'VoiceExtensionId':_0x57cd26['id']},{'type':_0x57cd26['type'],'app':_0x57cd26[_0xb423('0x6')]?_0xb423('0x7'):_0xb423('0x8'),'appdata':_0x57cd26[_0xb423('0x6')]?_0xb423('0x9')+_0x57cd26['alias']:'No\x20alias\x20set','context':_0x57cd26[_0xb423('0x4')],'exten':_0x57cd26[_0xb423('0x5')],'priority':_0x50f31a++,'VoiceExtensionId':_0x57cd26['id']}];if(_0x57cd26[_0xb423('0x2')]===_0xb423('0xa')){_0x2fa5da[_0xb423('0xb')]({'type':'inbound','app':_0xb423('0x7'),'appdata':_0xb423('0xc')+_0x57cd26['id'],'context':_0x57cd26['context'],'exten':_0x57cd26[_0xb423('0x5')],'priority':_0x50f31a++,'VoiceExtensionId':_0x57cd26['id']});}_0x2fa5da[_0xb423('0xb')]({'type':_0x57cd26[_0xb423('0x2')],'app':'Set','appdata':_0xb423('0xd'),'context':_0x57cd26['context'],'exten':_0x57cd26[_0xb423('0x5')],'priority':_0x50f31a++,'VoiceExtensionId':_0x57cd26['id']},{'type':_0x57cd26['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x57cd26[_0xb423('0x4')],'exten':_0x57cd26[_0xb423('0x5')],'priority':_0x50f31a++,'VoiceExtensionId':_0x57cd26['id']},{'type':_0x57cd26[_0xb423('0x2')],'app':'Set','appdata':_0xb423('0xe'),'context':_0x57cd26[_0xb423('0x4')],'exten':_0x57cd26[_0xb423('0x5')],'priority':_0x50f31a++,'VoiceExtensionId':_0x57cd26['id']});return _0x2fa5da;}function _0x39edac(_0x4c20c0){var _0x42b6fe=0x2;var _0x240727=[{'type':'outbound','app':'Set','appdata':_0xb423('0xf'),'context':_0x4c20c0['context'],'exten':_0x4c20c0[_0xb423('0x5')],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']},{'type':_0xb423('0x10'),'app':_0x4c20c0[_0xb423('0x6')]?_0xb423('0x7'):_0xb423('0x8'),'appdata':_0x4c20c0[_0xb423('0x6')]?_0xb423('0x9')+_0x4c20c0[_0xb423('0x6')]:'No\x20alias\x20set','context':_0x4c20c0[_0xb423('0x4')],'exten':_0x4c20c0[_0xb423('0x5')],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']},{'type':_0xb423('0x10'),'app':'Set','appdata':_0xb423('0x11')+(_0x4c20c0[_0xb423('0x12')]?'${EXTEN:'+_0x4c20c0[_0xb423('0x12')]+'}':_0xb423('0x13')),'context':_0x4c20c0[_0xb423('0x4')],'exten':_0x4c20c0['exten'],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']},{'type':_0xb423('0x10'),'app':'Set','appdata':_0xb423('0xc')+_0x4c20c0['id'],'context':_0x4c20c0['context'],'exten':_0x4c20c0[_0xb423('0x5')],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']},{'type':_0xb423('0x10'),'app':'ExecIf','appdata':_0xb423('0x14')+(_0x42b6fe+0x2)+_0xb423('0x15')+(_0x42b6fe+0x1)+')','context':_0x4c20c0[_0xb423('0x4')],'exten':_0x4c20c0['exten'],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']},{'type':'outbound','app':_0xb423('0x7'),'appdata':_0x4c20c0['cutdigits']?_0xb423('0x16')+_0x4c20c0['cutdigits']+'}':_0xb423('0x17'),'context':_0x4c20c0[_0xb423('0x4')],'exten':_0x4c20c0[_0xb423('0x5')],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']},{'type':_0xb423('0x10'),'app':_0xb423('0x7'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4c20c0[_0xb423('0x4')],'exten':_0x4c20c0['exten'],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']},{'type':'outbound','app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4c20c0[_0xb423('0x4')],'exten':_0x4c20c0[_0xb423('0x5')],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']},{'type':_0xb423('0x10'),'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x4c20c0[_0xb423('0x4')],'exten':_0x4c20c0[_0xb423('0x5')],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']},{'type':'outbound','app':_0xb423('0x7'),'appdata':_0xb423('0x18')+_0x4c20c0['id'],'context':_0x4c20c0[_0xb423('0x4')],'exten':_0x4c20c0[_0xb423('0x5')],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']}];if(_0x4c20c0[_0xb423('0x19')]('recordingFormat')&&_0x4c20c0[_0xb423('0x1a')]!=='none'){_0x240727[_0xb423('0xb')]({'type':_0xb423('0x10'),'app':_0xb423('0x7'),'appdata':_0xb423('0x1b'),'context':_0x4c20c0[_0xb423('0x4')],'exten':_0x4c20c0[_0xb423('0x5')],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']},{'type':'outbound','app':_0xb423('0x7'),'appdata':_0xb423('0x1c')+_0x4c20c0['recordingFormat']||_0xb423('0x1d'),'context':_0x4c20c0['context'],'exten':_0x4c20c0[_0xb423('0x5')],'priority':_0x42b6fe++,'VoiceExtensionId':_0x4c20c0['id']});}return _0x240727;}function _0x1f8b36(_0x542ac0,_0x3a08db){var _0x4b0ed5=[{'name':_0xb423('0x1e'),'param':0x0},{'name':_0xb423('0x1f'),'param':0x1},{'name':_0xb423('0x20'),'param':0x2},{'name':_0xb423('0x21'),'param':0x3}];var _0x321237={};var _0x540a27=_0x3a08db['split'](',');var _0x441937=[];for(var _0x723153=0x0;_0x723153<_0x4b0ed5['length'];_0x723153++){switch(_0x4b0ed5[_0x723153][_0xb423('0x22')]){case _0xb423('0x1e'):_0x321237['trunk']=_0x540a27[_0x4b0ed5[_0x723153][_0xb423('0x23')]][_0xb423('0x24')]('/')[0x1];_0x321237[_0xb423('0x25')]=_0x540a27[_0x4b0ed5[_0x723153][_0xb423('0x23')]][_0xb423('0x24')]('/')[0x2];_0x321237[_0xb423('0x26')]=_0x321237[_0xb423('0x25')]?_0x321237[_0xb423('0x25')][_0xb423('0x24')]('$')[0x0]:undefined;_0x321237[_0xb423('0x25')]=_0x542ac0[_0xb423('0x12')]?(_0x321237[_0xb423('0x26')]||'')+_0xb423('0x27')+_0x542ac0[_0xb423('0x12')]+'}':(_0x321237['prefix']||'')+_0xb423('0x13');_0x441937[_0x4b0ed5[_0x723153]['param']]=['SIP',_0x321237['trunk'],_0x321237['phone']][_0xb423('0x28')]('/');break;case _0xb423('0x20'):_0x321237['options']=_0x540a27[_0x4b0ed5[_0x723153][_0xb423('0x23')]];if(_0x542ac0[_0xb423('0x1a')]!==_0xb423('0x29')){if(_0x321237[_0xb423('0x20')]['indexOf'](_0xb423('0x2a'))<0x0){_0x321237[_0xb423('0x20')]+=_0xb423('0x2a');}}else{_0x321237['options']=_0x321237[_0xb423('0x20')][_0xb423('0x2b')]('U(xcally-mixmonitor-context)','');}_0x441937[_0x4b0ed5[_0x723153]['param']]=_0x321237[_0xb423('0x20')];break;default:_0x441937[_0x4b0ed5[_0x723153]['param']]=_0x540a27[_0x4b0ed5[_0x723153][_0xb423('0x23')]];}}return _0x441937[_0xb423('0x28')](',');}function _0x513b75(_0x267ab0,_0x56473d,_0x2f5e97){return new Promise(function(_0x171790,_0x265c23){var _0x93bd61=[];if(_[_0xb423('0x2c')](_0x56473d))return _0x171790(_0x93bd61);_0x54e396[_0xb423('0x2d')][_0xb423('0x2e')]({'attributes':['id',_0xb423('0x2f'),_0xb423('0x30')],'raw':!![]})[_0xb423('0x31')](function(_0x314f61){for(var _0x6f7ec2=0x0,_0x45401=0x0;_0x6f7ec2<_0x56473d[_0xb423('0x32')];_0x6f7ec2++,_0x45401=0x0){var _0x13969e=_0x56473d[_0x6f7ec2];var _0x45e789=[];var _0x5825f7=[];delete _0x13969e['id'];if(_0x13969e[_0xb423('0x2f')]!==_0xb423('0x33')){_0x13969e['intervals']=[_0x13969e[_0xb423('0x2f')]];}else{_0x13969e[_0xb423('0x34')]=_0x13969e[_0xb423('0x30')]?_[_0xb423('0x35')](_[_0xb423('0x36')](_0x314f61,{'IntervalId':_0x13969e[_0xb423('0x30')]}),'interval'):[];}_0x13969e['context']=_0x267ab0['context'];_0x13969e[_0xb423('0x5')]=_0x267ab0[_0xb423('0x5')];if(_0x13969e[_0xb423('0x2')])_0x13969e[_0xb423('0x2')]=_0x13969e[_0xb423('0x2')]['toLowerCase']();if(_0x267ab0['type']===_0xb423('0x10')){if(_0x13969e['hasOwnProperty']('tag')&&_0x13969e[_0xb423('0x37')]&&_0x13969e[_0xb423('0x37')]!=='--'){_0x45e789[_0xb423('0xb')]({'type':_0x13969e['type']['toLowerCase'](),'app':_0xb423('0x7'),'appdata':_0xb423('0x38')+_0x13969e[_0xb423('0x37')],'context':_0x267ab0[_0xb423('0x4')],'exten':_0x267ab0[_0xb423('0x5')],'priority':_0x13969e['intervals']['length']+_0x2f5e97+_0x45401++,'VoiceExtensionId':_0x267ab0['id']});}_0x45e789[_0xb423('0xb')]({'type':_0x13969e['type']['toLowerCase'](),'app':_0xb423('0x39'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x13969e['callerID']?'Set(CALLERID(all)='+_0x13969e[_0xb423('0x3a')]+')':_0xb423('0x3b')),'context':_0x267ab0[_0xb423('0x4')],'exten':_0x267ab0['exten'],'priority':_0x13969e['intervals'][_0xb423('0x32')]+_0x2f5e97+_0x45401++,'VoiceExtensionId':_0x267ab0['id']});}else{if(_0x13969e[_0xb423('0x19')](_0xb423('0x3c'))){if([_0xb423('0x3d'),_0xb423('0x3e')][_0xb423('0x3f')](_0x13969e[_0xb423('0x40')]['toLowerCase']())&&_0x13969e[_0xb423('0x41')]!==_0xb423('0x42')){if(_0x13969e[_0xb423('0x3c')]){_0x45e789[_0xb423('0xb')]({'type':_0x13969e[_0xb423('0x2')][_0xb423('0x43')](),'app':_0xb423('0x39'),'appdata':_0xb423('0x44'),'context':_0x267ab0[_0xb423('0x4')],'exten':_0x267ab0['exten'],'priority':_0x13969e['intervals']['length']+_0x2f5e97+_0x45401++,'VoiceExtensionId':_0x267ab0['id']});_0x45e789[_0xb423('0xb')]({'type':_0x13969e['type'][_0xb423('0x43')](),'app':_0xb423('0x7'),'appdata':_0xb423('0x45'),'context':_0x267ab0['context'],'exten':_0x267ab0[_0xb423('0x5')],'priority':_0x13969e['intervals'][_0xb423('0x32')]+_0x2f5e97+_0x45401++,'VoiceExtensionId':_0x267ab0['id']});}else{_0x45e789[_0xb423('0xb')]({'type':_0x13969e['type'][_0xb423('0x43')](),'app':_0xb423('0x39'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x267ab0[_0xb423('0x4')],'exten':_0x267ab0[_0xb423('0x5')],'priority':_0x13969e[_0xb423('0x34')][_0xb423('0x32')]+_0x2f5e97+_0x45401++,'VoiceExtensionId':_0x267ab0['id']});_0x45e789[_0xb423('0xb')]({'type':_0x13969e['type'][_0xb423('0x43')](),'app':'Set','appdata':_0xb423('0x46'),'context':_0x267ab0[_0xb423('0x4')],'exten':_0x267ab0[_0xb423('0x5')],'priority':_0x13969e[_0xb423('0x34')][_0xb423('0x32')]+_0x2f5e97+_0x45401++,'VoiceExtensionId':_0x267ab0['id']});}}}}for(var _0x57ed42=0x0;_0x57ed42<_0x13969e[_0xb423('0x34')][_0xb423('0x32')];_0x57ed42++){var _0x2ae6eb=_0x2f5e97+_0x13969e[_0xb423('0x34')][_0xb423('0x32')];var _0x42b01d=_0x57ed42===_0x13969e[_0xb423('0x34')]['length']-0x1?_0x2f5e97+_0x45e789['length']+_0x5825f7['length']+0x2:_0x2f5e97+_0x57ed42+0x1;_0x45e789[_0xb423('0x47')](_0x57ed42,0x0,{'type':_0x267ab0[_0xb423('0x2')],'app':_0xb423('0x48'),'appdata':_0x13969e[_0xb423('0x34')][_0x57ed42]+'?'+_0x267ab0['context']+_0xb423('0x49')+_0x2ae6eb+':'+_0x267ab0['context']+',${EXTEN},'+_0x42b01d,'exten':_0x267ab0[_0xb423('0x5')],'context':_0x267ab0[_0xb423('0x4')],'priority':_0x2f5e97+_0x57ed42,'VoiceExtensionId':_0x267ab0['id']});}if(_0x13969e[_0xb423('0x41')]==='outboundDial')_0x13969e[_0xb423('0x4a')]=_0x1f8b36(_0x267ab0,_0x13969e[_0xb423('0x4a')]);_0x13969e[_0xb423('0x4b')]=_0x45e789['length']?_['last'](_0x45e789)[_0xb423('0x4b')]+0x1:_0x2f5e97;_0x93bd61=_['concat'](_0x93bd61,_0x45e789,[_0x13969e],_0x5825f7);_0x2f5e97=_[_0xb423('0x4c')](_0x93bd61)['priority']+0x1;}return _0x171790(_0x93bd61);})['catch'](function(_0x58492f){_0x265c23(_0x58492f);});});}return _0x46e2a8[_0xb423('0x4d')]('VoiceExtension',attributes,{'tableName':_0xb423('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x583d6f){var _0x2428b7=this[_0xb423('0x4f')]({'plain':!![]});var _0x3117b3=_0x2428b7[_0xb423('0x2')]===_0xb423('0x10')?_0x39edac(_0x2428b7):_0x4b4acf(_0x2428b7);return _0x513b75(_0x2428b7,_0x583d6f,_['last'](_0x3117b3)[_0xb423('0x4b')]+0x1)[_0xb423('0x31')](function(_0x588bfc){var _0x26438f=_[_0xb423('0x50')](_0x3117b3,_0x588bfc);_0x26438f[_0xb423('0xb')]({'type':_0x2428b7['type'],'app':_0xb423('0x51'),'exten':_0x2428b7[_0xb423('0x5')],'context':_0x2428b7['context'],'priority':_[_0xb423('0x4c')](_0x26438f)[_0xb423('0x4b')]+0x1,'VoiceExtensionId':_0x2428b7['id']});return _0x26438f;});}}});};
\ No newline at end of file
index e1a5b4b..8233b1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eea=['jayson/promise','client','defaults','localhost','redis','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x45376d,_0x260a60){var _0x520b33=function(_0x4cc8d8){while(--_0x4cc8d8){_0x45376d['push'](_0x45376d['shift']());}};_0x520b33(++_0x260a60);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x26bfda,_0xf2e6a1){_0x26bfda=_0x26bfda-0x0;var _0x22145d=_0x3eea[_0x26bfda];return _0x22145d;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var moment=require(_0xa3ee('0x1'));var BPromise=require(_0xa3ee('0x2'));var rs=require(_0xa3ee('0x3'));var fs=require('fs');var Redis=require(_0xa3ee('0x4'));var db=require(_0xa3ee('0x5'))['db'];var utils=require(_0xa3ee('0x6'));var logger=require(_0xa3ee('0x7'))(_0xa3ee('0x8'));var config=require(_0xa3ee('0x9'));var jayson=require(_0xa3ee('0xa'));var client=jayson[_0xa3ee('0xb')]['http']({'port':0x232a});config['redis']=_[_0xa3ee('0xc')](config['redis'],{'host':_0xa3ee('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa3ee('0xe')]));require('./voiceExtension.socket')[_0xa3ee('0xf')](socket);function respondWithRpcPromise(_0x5ef236,_0x28aeb1,_0x1a3ab0){return new BPromise(function(_0x188966,_0x50f5e6){return client[_0xa3ee('0x10')](_0x5ef236,_0x1a3ab0)[_0xa3ee('0x11')](function(_0x4dc361){logger['info'](_0xa3ee('0x12'),_0x28aeb1,_0xa3ee('0x13'));logger[_0xa3ee('0x14')](_0xa3ee('0x15'),_0x28aeb1,'request\x20sent',JSON[_0xa3ee('0x16')](_0x4dc361));if(_0x4dc361['error']){if(_0x4dc361[_0xa3ee('0x17')][_0xa3ee('0x18')]===0x1f4){logger[_0xa3ee('0x17')](_0xa3ee('0x12'),_0x28aeb1,_0x4dc361['error'][_0xa3ee('0x19')]);return _0x50f5e6(_0x4dc361[_0xa3ee('0x17')]['message']);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x28aeb1,_0x4dc361[_0xa3ee('0x17')][_0xa3ee('0x19')]);return _0x188966(_0x4dc361[_0xa3ee('0x17')][_0xa3ee('0x19')]);}else{logger['info'](_0xa3ee('0x12'),_0x28aeb1,_0xa3ee('0x13'));_0x188966(_0x4dc361[_0xa3ee('0x1a')][_0xa3ee('0x19')]);}})[_0xa3ee('0x1b')](function(_0x4aac0e){logger[_0xa3ee('0x17')](_0xa3ee('0x12'),_0x28aeb1,_0x4aac0e);_0x50f5e6(_0x4aac0e);});});}exports[_0xa3ee('0x1c')]=function(_0xad8187){var _0x216b7d=this;return new Promise(function(_0x3195a7,_0x4f8c56){return db[_0xa3ee('0x1d')][_0xa3ee('0x1e')]({'raw':_0xad8187['options']?_0xad8187[_0xa3ee('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xad8187[_0xa3ee('0x1f')]?_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x20')]||null:null,'attributes':_0xad8187[_0xa3ee('0x1f')]?_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x21')]||null:null,'limit':_0xad8187[_0xa3ee('0x1f')]?_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x22')]||null:null,'include':_0xad8187[_0xa3ee('0x1f')]?_0xad8187['options'][_0xa3ee('0x23')]?_[_0xa3ee('0x24')](_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x23')],function(_0x2c48db){return{'model':db[_0x2c48db['model']],'as':_0x2c48db['as'],'attributes':_0x2c48db[_0xa3ee('0x21')],'include':_0x2c48db[_0xa3ee('0x23')]?_[_0xa3ee('0x24')](_0x2c48db[_0xa3ee('0x23')],function(_0x42e97c){return{'model':db[_0x42e97c[_0xa3ee('0x25')]],'as':_0x42e97c['as'],'attributes':_0x42e97c[_0xa3ee('0x21')],'include':_0x42e97c[_0xa3ee('0x23')]?_[_0xa3ee('0x24')](_0x42e97c[_0xa3ee('0x23')],function(_0x59c6f9){return{'model':db[_0x59c6f9['model']],'as':_0x59c6f9['as'],'attributes':_0x59c6f9['attributes']};}):[]};}):[]};}):[]:[]})[_0xa3ee('0x11')](function(_0x481358){logger[_0xa3ee('0x26')](_0xa3ee('0x1c'),_0xad8187);logger[_0xa3ee('0x14')](_0xa3ee('0x1c'),_0xad8187,JSON[_0xa3ee('0x16')](_0x481358));_0x3195a7(_0x481358);})[_0xa3ee('0x1b')](function(_0x30ba4e){logger[_0xa3ee('0x17')](_0xa3ee('0x1c'),_0x30ba4e[_0xa3ee('0x19')],_0xad8187);_0x4f8c56(_0x216b7d['error'](0x1f4,_0x30ba4e[_0xa3ee('0x19')]));});});};
\ No newline at end of file
+var _0x103f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','info','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','attributes','model','debug','lodash','util'];(function(_0x8267aa,_0x496ef0){var _0x2a437f=function(_0x447f72){while(--_0x447f72){_0x8267aa['push'](_0x8267aa['shift']());}};_0x2a437f(++_0x496ef0);}(_0x103f,0x13e));var _0xf103=function(_0x34cec7,_0x4c87a5){_0x34cec7=_0x34cec7-0x0;var _0x209421=_0x103f[_0x34cec7];return _0x209421;};'use strict';var _=require(_0xf103('0x0'));var util=require(_0xf103('0x1'));var moment=require(_0xf103('0x2'));var BPromise=require(_0xf103('0x3'));var rs=require(_0xf103('0x4'));var fs=require('fs');var Redis=require(_0xf103('0x5'));var db=require(_0xf103('0x6'))['db'];var utils=require(_0xf103('0x7'));var logger=require(_0xf103('0x8'))(_0xf103('0x9'));var config=require('../../config/environment');var jayson=require(_0xf103('0xa'));var client=jayson[_0xf103('0xb')][_0xf103('0xc')]({'port':0x232a});config[_0xf103('0xd')]=_[_0xf103('0xe')](config[_0xf103('0xd')],{'host':_0xf103('0xf'),'port':0x18eb});var socket=require(_0xf103('0x10'))(new Redis(config[_0xf103('0xd')]));require(_0xf103('0x11'))[_0xf103('0x12')](socket);function respondWithRpcPromise(_0x267ec4,_0x47b71b,_0x228805){return new BPromise(function(_0x532559,_0x2aa8fd){return client['request'](_0x267ec4,_0x228805)['then'](function(_0xb3a849){logger[_0xf103('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x47b71b,_0xf103('0x14'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x47b71b,'request\x20sent',JSON[_0xf103('0x15')](_0xb3a849));if(_0xb3a849['error']){if(_0xb3a849[_0xf103('0x16')][_0xf103('0x17')]===0x1f4){logger['error'](_0xf103('0x18'),_0x47b71b,_0xb3a849[_0xf103('0x16')]['message']);return _0x2aa8fd(_0xb3a849[_0xf103('0x16')][_0xf103('0x19')]);}logger['error'](_0xf103('0x18'),_0x47b71b,_0xb3a849['error']['message']);return _0x532559(_0xb3a849[_0xf103('0x16')][_0xf103('0x19')]);}else{logger[_0xf103('0x13')](_0xf103('0x18'),_0x47b71b,_0xf103('0x14'));_0x532559(_0xb3a849[_0xf103('0x1a')]['message']);}})[_0xf103('0x1b')](function(_0x338a44){logger['error'](_0xf103('0x18'),_0x47b71b,_0x338a44);_0x2aa8fd(_0x338a44);});});}exports[_0xf103('0x1c')]=function(_0x280aeb){var _0x40418e=this;return new Promise(function(_0xebb4ae,_0x5d28e9){return db[_0xf103('0x1d')][_0xf103('0x1e')]({'raw':_0x280aeb[_0xf103('0x1f')]?_0x280aeb[_0xf103('0x1f')][_0xf103('0x20')]===undefined?!![]:![]:!![],'where':_0x280aeb[_0xf103('0x1f')]?_0x280aeb[_0xf103('0x1f')][_0xf103('0x21')]||null:null,'attributes':_0x280aeb['options']?_0x280aeb[_0xf103('0x1f')]['attributes']||null:null,'limit':_0x280aeb[_0xf103('0x1f')]?_0x280aeb['options'][_0xf103('0x22')]||null:null,'include':_0x280aeb[_0xf103('0x1f')]?_0x280aeb[_0xf103('0x1f')][_0xf103('0x23')]?_[_0xf103('0x24')](_0x280aeb[_0xf103('0x1f')][_0xf103('0x23')],function(_0x259797){return{'model':db[_0x259797['model']],'as':_0x259797['as'],'attributes':_0x259797[_0xf103('0x25')],'include':_0x259797['include']?_[_0xf103('0x24')](_0x259797['include'],function(_0x4423a4){return{'model':db[_0x4423a4[_0xf103('0x26')]],'as':_0x4423a4['as'],'attributes':_0x4423a4[_0xf103('0x25')],'include':_0x4423a4[_0xf103('0x23')]?_['map'](_0x4423a4[_0xf103('0x23')],function(_0x1d3cdd){return{'model':db[_0x1d3cdd[_0xf103('0x26')]],'as':_0x1d3cdd['as'],'attributes':_0x1d3cdd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b0a13){logger[_0xf103('0x13')]('GetVoiceExtension',_0x280aeb);logger[_0xf103('0x27')](_0xf103('0x1c'),_0x280aeb,JSON[_0xf103('0x15')](_0x1b0a13));_0xebb4ae(_0x1b0a13);})[_0xf103('0x1b')](function(_0x5becbe){logger['error']('GetVoiceExtension',_0x5becbe['message'],_0x280aeb);_0x5d28e9(_0x40418e[_0xf103('0x16')](0x1f4,_0x5becbe['message']));});});};
\ No newline at end of file
index 2c64545..d36300b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x35138d,_0x19d365){var _0x599225=function(_0x26dd90){while(--_0x26dd90){_0x35138d['push'](_0x35138d['shift']());}};_0x599225(++_0x19d365);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}};
\ No newline at end of file
+var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x3d9e72,_0x577dc4){var _0xf19e8d=function(_0x4ecbc0){while(--_0x4ecbc0){_0x3d9e72['push'](_0x3d9e72['shift']());}};_0xf19e8d(++_0x577dc4);}(_0x7a54,0x106));var _0x47a5=function(_0x43f5b9,_0x6c10c7){_0x43f5b9=_0x43f5b9-0x0;var _0x4aad07=_0x7a54[_0x43f5b9];return _0x4aad07;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
index bf8e0ba..3bd2fc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0adf=['put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','get','/:id','show','/:id/messages','post','create'];(function(_0x4afc57,_0x207719){var _0x3fccf7=function(_0x35e067){while(--_0x35e067){_0x4afc57['push'](_0x4afc57['shift']());}};_0x3fccf7(++_0x207719);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x518175,_0x2e3d5c){_0x518175=_0x518175-0x0;var _0x4b1359=_0x0adf[_0x518175];return _0x4b1359;};'use strict';var multer=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var path=require(_0xf0ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xf0ad('0x3'));var router=express[_0xf0ad('0x4')]();var fs_extra=require(_0xf0ad('0x5'));var auth=require(_0xf0ad('0x6'));var interaction=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var controller=require(_0xf0ad('0x9'));router['get']('/',auth[_0xf0ad('0xa')](),controller['index']);router[_0xf0ad('0xb')](_0xf0ad('0xc'),auth[_0xf0ad('0xa')](),controller[_0xf0ad('0xd')]);router[_0xf0ad('0xb')](_0xf0ad('0xe'),auth[_0xf0ad('0xa')](),controller['getMessages']);router[_0xf0ad('0xf')]('/',auth['isAuthenticated'](),controller[_0xf0ad('0x10')]);router[_0xf0ad('0x11')](_0xf0ad('0xc'),auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x12')]);router['delete']('/:id',auth[_0xf0ad('0xa')](),controller[_0xf0ad('0x13')]);module[_0xf0ad('0x14')]=router;
\ No newline at end of file
+var _0x1623=['/:id','show','get','/:id/messages','getMessages','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMail.controller','isAuthenticated','index'];(function(_0x4a14bf,_0x40b810){var _0x30190a=function(_0x5de518){while(--_0x5de518){_0x4a14bf['push'](_0x4a14bf['shift']());}};_0x30190a(++_0x40b810);}(_0x1623,0xab));var _0x3162=function(_0x360f6c,_0xa20469){_0x360f6c=_0x360f6c-0x0;var _0x287bb9=_0x1623[_0x360f6c];return _0x287bb9;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3162('0xf')](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0x10')]);router[_0x3162('0x11')](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0x12')]);module[_0x3162('0x13')]=router;
\ No newline at end of file
index f9724cf..48d8fb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ad=['mailbox','sequelize','exports','STRING','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x57ad,0xe1));var _0xd57a=function(_0x41401a,_0x470d46){_0x41401a=_0x41401a-0x0;var _0x2a0cba=_0x57ad[_0x41401a];return _0x2a0cba;};'use strict';var Sequelize=require(_0xd57a('0x0'));module[_0xd57a('0x1')]={'customer_id':{'type':Sequelize[_0xd57a('0x2')]},'context':{'type':Sequelize[_0xd57a('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xd57a('0x2')]},'fullname':{'type':Sequelize[_0xd57a('0x2')]},'email':{'type':Sequelize[_0xd57a('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2a622f){this['setDataValue'](_0xd57a('0x3'),typeof _0x2a622f===_0xd57a('0x4')&&_0x2a622f['trim']()?_0x2a622f[_0xd57a('0x5')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xd57a('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xd57a('0x6')](_0xd57a('0x7'),'no'),'defaultValue':_0xd57a('0x7'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xd57a('0x7'),'no'),'defaultValue':_0xd57a('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0xd57a('0x2')]},'callback':{'type':Sequelize[_0xd57a('0x2')]},'review':{'type':Sequelize[_0xd57a('0x6')](_0xd57a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xd57a('0x6')](_0xd57a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xd57a('0x6')](_0xd57a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xd57a('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xd57a('0x6')](_0xd57a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xd57a('0x6')](_0xd57a('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xd57a('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xd57a('0x6')](_0xd57a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xd57a('0x7'),'no'),'defaultValue':_0xd57a('0x7'),'allowNull':![]},'stamp':{'type':_0xd57a('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xd57a('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xd57a('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xd57a('0xb')],'get':function(){return this[_0xd57a('0xc')](_0xd57a('0xd'))+_0xd57a('0xe')+this[_0xd57a('0xc')](_0xd57a('0xf'));}}};
\ No newline at end of file
+var _0xd258=['setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0xd258,0xc3));var _0x8d25=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd258[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x8d25('0x0'));module[_0x8d25('0x1')]={'customer_id':{'type':Sequelize[_0x8d25('0x2')]},'context':{'type':Sequelize[_0x8d25('0x2')],'defaultValue':_0x8d25('0x3'),'unique':_0x8d25('0x4')},'mailbox':{'type':Sequelize[_0x8d25('0x2')],'defaultValue':'','allowNull':![],'unique':_0x8d25('0x4')},'password':{'type':Sequelize[_0x8d25('0x2')]},'fullname':{'type':Sequelize[_0x8d25('0x2')]},'email':{'type':Sequelize[_0x8d25('0x2')],'validate':{'isEmail':!![]},'set':function(_0xf11ff8){this[_0x8d25('0x5')](_0x8d25('0x6'),typeof _0xf11ff8===_0x8d25('0x7')&&_0xf11ff8[_0x8d25('0x8')]()?_0xf11ff8[_0x8d25('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x8d25('0x2')],'defaultValue':_0x8d25('0x9')},'attach':{'type':Sequelize[_0x8d25('0xa')](_0x8d25('0xb'),'no'),'defaultValue':_0x8d25('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x8d25('0xa')](_0x8d25('0xb'),'no'),'defaultValue':_0x8d25('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x8d25('0x2')]},'callback':{'type':Sequelize[_0x8d25('0x2')]},'review':{'type':Sequelize[_0x8d25('0xa')](_0x8d25('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8d25('0xa')](_0x8d25('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x8d25('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8d25('0xa')](_0x8d25('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x8d25('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8d25('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8d25('0xa')](_0x8d25('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8d25('0xa')]('yes','no'),'defaultValue':_0x8d25('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8d25('0xa')](_0x8d25('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8d25('0xa')](_0x8d25('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x8d25('0xa')](_0x8d25('0xb'),'no'),'defaultValue':_0x8d25('0xb'),'allowNull':![]},'stamp':{'type':_0x8d25('0xd')},'emailsubject':{'type':Sequelize[_0x8d25('0x2')]},'emailbody':{'type':Sequelize[_0x8d25('0x2')]},'maxsecs':{'type':Sequelize[_0x8d25('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8d25('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8d25('0xf')],'get':function(){return this['getDataValue'](_0x8d25('0x10'))+_0x8d25('0x11')+this[_0x8d25('0x12')](_0x8d25('0x13'));}}};
\ No newline at end of file
index 7a95eb8..5042119 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1be1=['set','Content-Range','apply','reject','save','update','then','get','Voicemails','destroy','sendStatus','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','include','findAll','rows','show','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','VoiceMailMessage','length','mailbox','findAndCountAll','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count'];(function(_0x528a6e,_0x15abad){var _0x2cf224=function(_0x2c4e14){while(--_0x2c4e14){_0x528a6e['push'](_0x528a6e['shift']());}};_0x2cf224(++_0x15abad);}(_0x1be1,0x192));var _0x11be=function(_0x46137f,_0x4068cd){_0x46137f=_0x46137f-0x0;var _0x4aa666=_0x1be1[_0x46137f];return _0x4aa666;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11be('0x0'));var jsonpatch=require(_0x11be('0x1'));var rp=require('request-promise');var moment=require(_0x11be('0x2'));var BPromise=require(_0x11be('0x3'));var Mustache=require(_0x11be('0x4'));var util=require(_0x11be('0x5'));var path=require('path');var sox=require(_0x11be('0x6'));var csv=require(_0x11be('0x7'));var ejs=require(_0x11be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11be('0x9'));var squel=require('squel');var crypto=require(_0x11be('0xa'));var jsforce=require(_0x11be('0xb'));var deskjs=require(_0x11be('0xc'));var toCsv=require(_0x11be('0x7'));var querystring=require(_0x11be('0xd'));var Papa=require('papaparse');var Redis=require(_0x11be('0xe'));var authService=require(_0x11be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x11be('0x10'));var hardwareService=require(_0x11be('0x11'));var logger=require(_0x11be('0x12'))(_0x11be('0x13'));var utils=require('../../config/utils');var config=require(_0x11be('0x14'));var licenseUtil=require(_0x11be('0x15'));var db=require(_0x11be('0x16'))['db'];function respondWithStatusCode(_0x4b36c8,_0x3ff31f){_0x3ff31f=_0x3ff31f||0xcc;return function(_0x2dad05){if(_0x2dad05){return _0x4b36c8['sendStatus'](_0x3ff31f);}return _0x4b36c8[_0x11be('0x17')](_0x3ff31f)['end']();};}function respondWithResult(_0x49228e,_0x569842){_0x569842=_0x569842||0xc8;return function(_0x4b6e7e){if(_0x4b6e7e){return _0x49228e['status'](_0x569842)['json'](_0x4b6e7e);}};}function respondWithFilteredResult(_0x588871,_0x2280e2){return function(_0x52bbef){if(_0x52bbef){var _0x31047c=typeof _0x2280e2[_0x11be('0x18')]===_0x11be('0x19')&&typeof _0x2280e2[_0x11be('0x1a')]==='undefined';var _0x2ed725=_0x52bbef[_0x11be('0x1b')];var _0x56ab61=_0x31047c?0x0:_0x2280e2[_0x11be('0x18')];var _0xc3263c=_0x31047c?_0x52bbef[_0x11be('0x1b')]:_0x2280e2['offset']+_0x2280e2['limit'];var _0x141391;if(_0xc3263c>=_0x2ed725){_0xc3263c=_0x2ed725;_0x141391=0xc8;}else{_0x141391=0xce;}_0x588871[_0x11be('0x17')](_0x141391);return _0x588871[_0x11be('0x1c')](_0x11be('0x1d'),_0x56ab61+'-'+_0xc3263c+'/'+_0x2ed725)['json'](_0x52bbef);}return null;};}function patchUpdates(_0x12a5bd){return function(_0x45136f){try{jsonpatch[_0x11be('0x1e')](_0x45136f,_0x12a5bd,!![]);}catch(_0x452315){return BPromise[_0x11be('0x1f')](_0x452315);}return _0x45136f[_0x11be('0x20')]();};}function saveUpdates(_0xa944ac,_0x17678d){return function(_0x3aea14){if(_0x3aea14){return _0x3aea14[_0x11be('0x21')](_0xa944ac)['then'](function(_0xfe3737){return _0xfe3737;});}return null;};}function removeEntity(_0x46b7c2,_0x2fe43c){return function(_0x5d1690){if(_0x5d1690){return _0x5d1690['destroy']()[_0x11be('0x22')](function(){var _0x10ce04=_0x5d1690[_0x11be('0x23')]({'plain':!![]});var _0x4cb27f=_0x11be('0x24');return db['UserProfileResource'][_0x11be('0x25')]({'where':{'type':_0x4cb27f,'resourceId':_0x10ce04['id']}})['then'](function(){return _0x5d1690;});})[_0x11be('0x22')](function(){_0x46b7c2[_0x11be('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48029b,_0x28b3a0){return function(_0x1d3b5c){if(!_0x1d3b5c){_0x48029b[_0x11be('0x26')](0x194);}return _0x1d3b5c;};}function handleError(_0x30427b,_0x17c67f){_0x17c67f=_0x17c67f||0x1f4;return function(_0xf5a6ac){logger[_0x11be('0x27')](_0xf5a6ac[_0x11be('0x28')]);if(_0xf5a6ac['name']){delete _0xf5a6ac[_0x11be('0x29')];}_0x30427b['status'](_0x17c67f)[_0x11be('0x2a')](_0xf5a6ac);};}exports[_0x11be('0x2b')]=function(_0x510476,_0x584d4c){var _0x49fd5c={},_0x265fc9={},_0x5e8f9a={'count':0x0,'rows':[]};var _0x66316d=_[_0x11be('0x2c')](db[_0x11be('0x2d')][_0x11be('0x2e')],function(_0x25e214){return{'name':_0x25e214[_0x11be('0x2f')],'type':_0x25e214['type'][_0x11be('0x30')]};});_0x265fc9[_0x11be('0x31')]=_[_0x11be('0x2c')](_0x66316d,_0x11be('0x29'));_0x265fc9[_0x11be('0x32')]=_[_0x11be('0x33')](_0x510476['query']);_0x265fc9[_0x11be('0x34')]=_[_0x11be('0x35')](_0x265fc9[_0x11be('0x31')],_0x265fc9[_0x11be('0x32')]);_0x49fd5c[_0x11be('0x36')]=_['intersection'](_0x265fc9[_0x11be('0x31')],qs[_0x11be('0x37')](_0x510476[_0x11be('0x32')]['fields']));_0x49fd5c[_0x11be('0x36')]=_0x49fd5c['attributes']['length']?_0x49fd5c['attributes']:_0x265fc9['model'];if(!_0x510476[_0x11be('0x32')][_0x11be('0x38')](_0x11be('0x39'))){_0x49fd5c['limit']=qs[_0x11be('0x1a')](_0x510476[_0x11be('0x32')]['limit']);_0x49fd5c[_0x11be('0x18')]=qs['offset'](_0x510476[_0x11be('0x32')]['offset']);}_0x49fd5c[_0x11be('0x3a')]=qs[_0x11be('0x3b')](_0x510476[_0x11be('0x32')][_0x11be('0x3b')]);_0x49fd5c['where']=qs[_0x11be('0x34')](_[_0x11be('0x3c')](_0x510476[_0x11be('0x32')],_0x265fc9[_0x11be('0x34')]),_0x66316d);if(_0x510476['query'][_0x11be('0x3d')]){_0x49fd5c[_0x11be('0x3e')]=_[_0x11be('0x3f')](_0x49fd5c[_0x11be('0x3e')],{'$or':_[_0x11be('0x2c')](_0x66316d,function(_0x1b1aac){if(_0x1b1aac[_0x11be('0x40')]!=='VIRTUAL'){var _0x2618f5={};_0x2618f5[_0x1b1aac[_0x11be('0x29')]]={'$like':'%'+_0x510476['query'][_0x11be('0x3d')]+'%'};return _0x2618f5;}})});}_0x49fd5c=_[_0x11be('0x3f')]({},_0x49fd5c,_0x510476['options']);var _0x30b67a={'where':_0x49fd5c['where']};return db[_0x11be('0x2d')]['count'](_0x30b67a)[_0x11be('0x22')](function(_0x30be21){_0x5e8f9a['count']=_0x30be21;if(_0x510476[_0x11be('0x32')]['includeAll']){_0x49fd5c[_0x11be('0x41')]=[{'all':!![]}];}return db[_0x11be('0x2d')][_0x11be('0x42')](_0x49fd5c);})[_0x11be('0x22')](function(_0x2b847a){_0x5e8f9a[_0x11be('0x43')]=_0x2b847a;return _0x5e8f9a;})[_0x11be('0x22')](respondWithFilteredResult(_0x584d4c,_0x49fd5c))['catch'](handleError(_0x584d4c,null));};exports[_0x11be('0x44')]=function(_0x18cddf,_0x9610a1){var _0x317e2d={'raw':!![],'where':{'id':_0x18cddf['params']['id']}},_0x589ac4={};_0x589ac4['model']=_[_0x11be('0x33')](db['VoiceMail'][_0x11be('0x2e')]);_0x589ac4['query']=_[_0x11be('0x33')](_0x18cddf[_0x11be('0x32')]);_0x589ac4[_0x11be('0x34')]=_[_0x11be('0x35')](_0x589ac4[_0x11be('0x31')],_0x589ac4[_0x11be('0x32')]);_0x317e2d[_0x11be('0x36')]=_['intersection'](_0x589ac4[_0x11be('0x31')],qs['fields'](_0x18cddf[_0x11be('0x32')][_0x11be('0x37')]));_0x317e2d[_0x11be('0x36')]=_0x317e2d['attributes']['length']?_0x317e2d['attributes']:_0x589ac4[_0x11be('0x31')];if(_0x18cddf[_0x11be('0x32')]['includeAll']){_0x317e2d['include']=[{'all':!![]}];}_0x317e2d=_['merge']({},_0x317e2d,_0x18cddf[_0x11be('0x45')]);return db[_0x11be('0x2d')][_0x11be('0x46')](_0x317e2d)[_0x11be('0x22')](handleEntityNotFound(_0x9610a1,null))[_0x11be('0x22')](respondWithResult(_0x9610a1,null))[_0x11be('0x47')](handleError(_0x9610a1,null));};exports[_0x11be('0x48')]=function(_0x3f2070,_0x2ce110){return db[_0x11be('0x2d')][_0x11be('0x48')](_0x3f2070['body'],{})[_0x11be('0x22')](function(_0x29f82f){var _0x534ee7=_0x3f2070['user']['get']({'plain':!![]});if(!_0x534ee7)throw new Error(_0x11be('0x49'));if(_0x534ee7['role']===_0x11be('0x4a')){var _0x1c1626=_0x29f82f[_0x11be('0x23')]({'plain':!![]});var _0x1fb48d=_0x11be('0x24');return db[_0x11be('0x4b')][_0x11be('0x46')]({'where':{'name':_0x1fb48d,'userProfileId':_0x534ee7[_0x11be('0x4c')]},'raw':!![]})[_0x11be('0x22')](function(_0x4c873a){if(_0x4c873a&&_0x4c873a[_0x11be('0x4d')]===0x0){return db['UserProfileResource'][_0x11be('0x48')]({'name':_0x1c1626[_0x11be('0x29')],'resourceId':_0x1c1626['id'],'type':_0x4c873a['name'],'sectionId':_0x4c873a['id']},{})[_0x11be('0x22')](function(){return _0x29f82f;});}else{return _0x29f82f;}})[_0x11be('0x47')](function(_0x4c0e37){logger[_0x11be('0x27')](_0x11be('0x4e'),_0x4c0e37);throw _0x4c0e37;});}return _0x29f82f;})['then'](respondWithResult(_0x2ce110,0xc9))['catch'](handleError(_0x2ce110,null));};exports[_0x11be('0x21')]=function(_0x2886ac,_0x50eeab){if(_0x2886ac['body']['id']){delete _0x2886ac[_0x11be('0x4f')]['id'];}return db[_0x11be('0x2d')][_0x11be('0x46')]({'where':{'id':_0x2886ac['params']['id']}})['then'](handleEntityNotFound(_0x50eeab,null))['then'](saveUpdates(_0x2886ac[_0x11be('0x4f')],null))[_0x11be('0x22')](respondWithResult(_0x50eeab,null))[_0x11be('0x47')](handleError(_0x50eeab,null));};exports['destroy']=function(_0x4db963,_0x33409c){return db[_0x11be('0x2d')][_0x11be('0x46')]({'where':{'id':_0x4db963[_0x11be('0x50')]['id']}})['then'](handleEntityNotFound(_0x33409c,null))[_0x11be('0x22')](removeEntity(_0x33409c,null))['catch'](handleError(_0x33409c,null));};exports['getMessages']=function(_0x568f20,_0x5aa6bf,_0x1a43df){return db[_0x11be('0x2d')][_0x11be('0x51')]({'where':{'id':_0x568f20[_0x11be('0x50')]['id']}})[_0x11be('0x22')](handleEntityNotFound(_0x5aa6bf,null))[_0x11be('0x22')](function(_0xb97604){var _0x55e79d;var _0x54e52a={},_0x7c1ee5={};_0x7c1ee5[_0x11be('0x31')]=_[_0x11be('0x33')](db[_0x11be('0x52')][_0x11be('0x2e')]);_0x7c1ee5[_0x11be('0x32')]=_[_0x11be('0x33')](_0x568f20[_0x11be('0x32')]);_0x7c1ee5[_0x11be('0x34')]=_['intersection'](_0x7c1ee5[_0x11be('0x31')],_0x7c1ee5[_0x11be('0x32')]);_0x54e52a[_0x11be('0x36')]=_['intersection'](_0x7c1ee5[_0x11be('0x31')],qs[_0x11be('0x37')](_0x568f20['query']['fields']));_0x54e52a[_0x11be('0x36')]=_0x54e52a[_0x11be('0x36')][_0x11be('0x53')]?_0x54e52a[_0x11be('0x36')]:_0x7c1ee5['model'];if(!_0x568f20[_0x11be('0x32')][_0x11be('0x38')](_0x11be('0x39'))){_0x54e52a[_0x11be('0x1a')]=qs[_0x11be('0x1a')](_0x568f20[_0x11be('0x32')][_0x11be('0x1a')]);_0x54e52a[_0x11be('0x18')]=qs[_0x11be('0x18')](_0x568f20['query']['offset']);}_0x54e52a[_0x11be('0x3a')]=qs[_0x11be('0x3b')](_0x568f20['query'][_0x11be('0x3b')]);_0x54e52a[_0x11be('0x3e')]=qs[_0x11be('0x34')](_[_0x11be('0x3c')](_0x568f20[_0x11be('0x32')],_0x7c1ee5[_0x11be('0x34')]));if(_0x568f20[_0x11be('0x32')]['filter']){_0x54e52a['where']=_[_0x11be('0x3f')](_0x54e52a[_0x11be('0x3e')],{'$or':_[_0x11be('0x2c')](_0x54e52a['attributes'],function(_0x82c02c){var _0x422696={};_0x422696[_0x82c02c]={'$like':'%'+_0x568f20[_0x11be('0x32')][_0x11be('0x3d')]+'%'};return _0x422696;})});}_0x54e52a[_0x11be('0x3e')]=_[_0x11be('0x3f')](_0x54e52a[_0x11be('0x3e')],{'mailboxuser':_0xb97604[_0x11be('0x54')]});_0x54e52a=_[_0x11be('0x3f')]({},_0x54e52a,_0x568f20[_0x11be('0x45')]);return db[_0x11be('0x52')][_0x11be('0x55')](_0x54e52a)[_0x11be('0x22')](respondWithFilteredResult(_0x5aa6bf,_0x54e52a));})[_0x11be('0x47')](handleError(_0x5aa6bf,null));};
\ No newline at end of file
+var _0xc788=['role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Voicemails','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x28496e,_0x1d43ac){var _0x38d3f9=function(_0x2bcfa4){while(--_0x2bcfa4){_0x28496e['push'](_0x28496e['shift']());}};_0x38d3f9(++_0x1d43ac);}(_0xc788,0xc4));var _0x8c78=function(_0x1850ba,_0x55e013){_0x1850ba=_0x1850ba-0x0;var _0x2045e8=_0xc788[_0x1850ba];return _0x2045e8;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];function respondWithStatusCode(_0x4b2eca,_0x56a802){_0x56a802=_0x56a802||0xcc;return function(_0x349dfa){if(_0x349dfa){return _0x4b2eca[_0x8c78('0x18')](_0x56a802);}return _0x4b2eca[_0x8c78('0x19')](_0x56a802)[_0x8c78('0x1a')]();};}function respondWithResult(_0x2eedff,_0x3d1306){_0x3d1306=_0x3d1306||0xc8;return function(_0xe5f8ae){if(_0xe5f8ae){return _0x2eedff[_0x8c78('0x19')](_0x3d1306)[_0x8c78('0x1b')](_0xe5f8ae);}};}function respondWithFilteredResult(_0x1157d0,_0x4ff4b0){return function(_0x1fa78e){if(_0x1fa78e){var _0x293cfe=typeof _0x4ff4b0['offset']===_0x8c78('0x1c')&&typeof _0x4ff4b0[_0x8c78('0x1d')]===_0x8c78('0x1c');var _0x23824e=_0x1fa78e[_0x8c78('0x1e')];var _0x461eff=_0x293cfe?0x0:_0x4ff4b0['offset'];var _0x4f7bf9=_0x293cfe?_0x1fa78e[_0x8c78('0x1e')]:_0x4ff4b0['offset']+_0x4ff4b0['limit'];var _0xece4f0;if(_0x4f7bf9>=_0x23824e){_0x4f7bf9=_0x23824e;_0xece4f0=0xc8;}else{_0xece4f0=0xce;}_0x1157d0['status'](_0xece4f0);return _0x1157d0[_0x8c78('0x1f')](_0x8c78('0x20'),_0x461eff+'-'+_0x4f7bf9+'/'+_0x23824e)['json'](_0x1fa78e);}return null;};}function patchUpdates(_0x6c9a12){return function(_0x5b111b){try{jsonpatch[_0x8c78('0x21')](_0x5b111b,_0x6c9a12,!![]);}catch(_0x3af73c){return BPromise['reject'](_0x3af73c);}return _0x5b111b[_0x8c78('0x22')]();};}function saveUpdates(_0x188cc3,_0x499603){return function(_0x2bc595){if(_0x2bc595){return _0x2bc595[_0x8c78('0x23')](_0x188cc3)[_0x8c78('0x24')](function(_0x9581c6){return _0x9581c6;});}return null;};}function removeEntity(_0x215940,_0x20f483){return function(_0xbfdf6f){if(_0xbfdf6f){return _0xbfdf6f[_0x8c78('0x25')]()[_0x8c78('0x24')](function(){var _0x4a7d20=_0xbfdf6f[_0x8c78('0x26')]({'plain':!![]});var _0x458763=_0x8c78('0x27');return db['UserProfileResource'][_0x8c78('0x25')]({'where':{'type':_0x458763,'resourceId':_0x4a7d20['id']}})['then'](function(){return _0xbfdf6f;});})[_0x8c78('0x24')](function(){_0x215940[_0x8c78('0x19')](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x496c51,_0x583a74){return function(_0x2568d5){if(!_0x2568d5){_0x496c51['sendStatus'](0x194);}return _0x2568d5;};}function handleError(_0x20b128,_0x4376da){_0x4376da=_0x4376da||0x1f4;return function(_0x394c1d){logger[_0x8c78('0x28')](_0x394c1d[_0x8c78('0x29')]);if(_0x394c1d[_0x8c78('0x2a')]){delete _0x394c1d['name'];}_0x20b128[_0x8c78('0x19')](_0x4376da)['send'](_0x394c1d);};}exports[_0x8c78('0x2b')]=function(_0x17f4c8,_0xb69c52){var _0x4e764f={},_0x1f1a0c={},_0x3816d2={'count':0x0,'rows':[]};var _0x4f0005=_[_0x8c78('0x2c')](db[_0x8c78('0x2d')][_0x8c78('0x2e')],function(_0x487a4c){return{'name':_0x487a4c[_0x8c78('0x2f')],'type':_0x487a4c[_0x8c78('0x30')][_0x8c78('0x31')]};});_0x1f1a0c['model']=_[_0x8c78('0x2c')](_0x4f0005,_0x8c78('0x2a'));_0x1f1a0c['query']=_[_0x8c78('0x32')](_0x17f4c8[_0x8c78('0x33')]);_0x1f1a0c[_0x8c78('0x34')]=_[_0x8c78('0x35')](_0x1f1a0c[_0x8c78('0x36')],_0x1f1a0c[_0x8c78('0x33')]);_0x4e764f[_0x8c78('0x37')]=_[_0x8c78('0x35')](_0x1f1a0c[_0x8c78('0x36')],qs[_0x8c78('0x38')](_0x17f4c8['query'][_0x8c78('0x38')]));_0x4e764f[_0x8c78('0x37')]=_0x4e764f[_0x8c78('0x37')][_0x8c78('0x39')]?_0x4e764f[_0x8c78('0x37')]:_0x1f1a0c['model'];if(!_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x3a')](_0x8c78('0x3b'))){_0x4e764f['limit']=qs[_0x8c78('0x1d')](_0x17f4c8[_0x8c78('0x33')]['limit']);_0x4e764f[_0x8c78('0x3c')]=qs['offset'](_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x3c')]);}_0x4e764f[_0x8c78('0x3d')]=qs[_0x8c78('0x3e')](_0x17f4c8['query'][_0x8c78('0x3e')]);_0x4e764f['where']=qs[_0x8c78('0x34')](_[_0x8c78('0x3f')](_0x17f4c8[_0x8c78('0x33')],_0x1f1a0c['filters']),_0x4f0005);if(_0x17f4c8['query'][_0x8c78('0x40')]){_0x4e764f[_0x8c78('0x41')]=_[_0x8c78('0x42')](_0x4e764f[_0x8c78('0x41')],{'$or':_[_0x8c78('0x2c')](_0x4f0005,function(_0x484931){if(_0x484931[_0x8c78('0x30')]!==_0x8c78('0x43')){var _0x1f0a2b={};_0x1f0a2b[_0x484931[_0x8c78('0x2a')]]={'$like':'%'+_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x40')]+'%'};return _0x1f0a2b;}})});}_0x4e764f=_[_0x8c78('0x42')]({},_0x4e764f,_0x17f4c8['options']);var _0x3995f4={'where':_0x4e764f[_0x8c78('0x41')]};return db['VoiceMail']['count'](_0x3995f4)[_0x8c78('0x24')](function(_0x1612d5){_0x3816d2['count']=_0x1612d5;if(_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x44')]){_0x4e764f['include']=[{'all':!![]}];}return db[_0x8c78('0x2d')][_0x8c78('0x45')](_0x4e764f);})['then'](function(_0x10d521){_0x3816d2[_0x8c78('0x46')]=_0x10d521;return _0x3816d2;})[_0x8c78('0x24')](respondWithFilteredResult(_0xb69c52,_0x4e764f))[_0x8c78('0x47')](handleError(_0xb69c52,null));};exports[_0x8c78('0x48')]=function(_0x4e4880,_0x545d90){var _0x2841c2={'raw':!![],'where':{'id':_0x4e4880[_0x8c78('0x49')]['id']}},_0x2f6a6b={};_0x2f6a6b[_0x8c78('0x36')]=_[_0x8c78('0x32')](db[_0x8c78('0x2d')][_0x8c78('0x2e')]);_0x2f6a6b[_0x8c78('0x33')]=_[_0x8c78('0x32')](_0x4e4880[_0x8c78('0x33')]);_0x2f6a6b[_0x8c78('0x34')]=_['intersection'](_0x2f6a6b[_0x8c78('0x36')],_0x2f6a6b[_0x8c78('0x33')]);_0x2841c2[_0x8c78('0x37')]=_[_0x8c78('0x35')](_0x2f6a6b[_0x8c78('0x36')],qs['fields'](_0x4e4880[_0x8c78('0x33')][_0x8c78('0x38')]));_0x2841c2[_0x8c78('0x37')]=_0x2841c2[_0x8c78('0x37')][_0x8c78('0x39')]?_0x2841c2['attributes']:_0x2f6a6b[_0x8c78('0x36')];if(_0x4e4880['query']['includeAll']){_0x2841c2[_0x8c78('0x4a')]=[{'all':!![]}];}_0x2841c2=_[_0x8c78('0x42')]({},_0x2841c2,_0x4e4880[_0x8c78('0x4b')]);return db['VoiceMail'][_0x8c78('0x4c')](_0x2841c2)[_0x8c78('0x24')](handleEntityNotFound(_0x545d90,null))[_0x8c78('0x24')](respondWithResult(_0x545d90,null))[_0x8c78('0x47')](handleError(_0x545d90,null));};exports[_0x8c78('0x4d')]=function(_0x38083e,_0x26103c){return db[_0x8c78('0x2d')][_0x8c78('0x4d')](_0x38083e['body'],{})[_0x8c78('0x24')](function(_0x1fcf97){var _0xba0de6=_0x38083e[_0x8c78('0x4e')]['get']({'plain':!![]});if(!_0xba0de6)throw new Error(_0x8c78('0x4f'));if(_0xba0de6[_0x8c78('0x50')]===_0x8c78('0x4e')){var _0x431125=_0x1fcf97['get']({'plain':!![]});var _0x336b95=_0x8c78('0x27');return db[_0x8c78('0x51')]['find']({'where':{'name':_0x336b95,'userProfileId':_0xba0de6[_0x8c78('0x52')]},'raw':!![]})['then'](function(_0xae80d){if(_0xae80d&&_0xae80d[_0x8c78('0x53')]===0x0){return db[_0x8c78('0x54')][_0x8c78('0x4d')]({'name':_0x431125[_0x8c78('0x2a')],'resourceId':_0x431125['id'],'type':_0xae80d[_0x8c78('0x2a')],'sectionId':_0xae80d['id']},{})[_0x8c78('0x24')](function(){return _0x1fcf97;});}else{return _0x1fcf97;}})[_0x8c78('0x47')](function(_0x19d807){logger[_0x8c78('0x28')](_0x8c78('0x55'),_0x19d807);throw _0x19d807;});}return _0x1fcf97;})[_0x8c78('0x24')](respondWithResult(_0x26103c,0xc9))[_0x8c78('0x47')](handleError(_0x26103c,null));};exports[_0x8c78('0x23')]=function(_0x54b40d,_0x22fe6c){if(_0x54b40d[_0x8c78('0x56')]['id']){delete _0x54b40d[_0x8c78('0x56')]['id'];}return db[_0x8c78('0x2d')]['find']({'where':{'id':_0x54b40d[_0x8c78('0x49')]['id']}})[_0x8c78('0x24')](handleEntityNotFound(_0x22fe6c,null))[_0x8c78('0x24')](saveUpdates(_0x54b40d[_0x8c78('0x56')],null))[_0x8c78('0x24')](respondWithResult(_0x22fe6c,null))[_0x8c78('0x47')](handleError(_0x22fe6c,null));};exports['destroy']=function(_0x1e616c,_0x42a34e){return db['VoiceMail'][_0x8c78('0x4c')]({'where':{'id':_0x1e616c['params']['id']}})[_0x8c78('0x24')](handleEntityNotFound(_0x42a34e,null))[_0x8c78('0x24')](removeEntity(_0x42a34e,null))[_0x8c78('0x47')](handleError(_0x42a34e,null));};exports[_0x8c78('0x57')]=function(_0x3ff236,_0x35cf85,_0x416a05){return db['VoiceMail'][_0x8c78('0x58')]({'where':{'id':_0x3ff236[_0x8c78('0x49')]['id']}})['then'](handleEntityNotFound(_0x35cf85,null))[_0x8c78('0x24')](function(_0x3529aa){var _0x577361;var _0x425994={},_0x2307d1={};_0x2307d1[_0x8c78('0x36')]=_[_0x8c78('0x32')](db[_0x8c78('0x59')][_0x8c78('0x2e')]);_0x2307d1[_0x8c78('0x33')]=_[_0x8c78('0x32')](_0x3ff236[_0x8c78('0x33')]);_0x2307d1[_0x8c78('0x34')]=_[_0x8c78('0x35')](_0x2307d1[_0x8c78('0x36')],_0x2307d1[_0x8c78('0x33')]);_0x425994[_0x8c78('0x37')]=_['intersection'](_0x2307d1[_0x8c78('0x36')],qs['fields'](_0x3ff236[_0x8c78('0x33')]['fields']));_0x425994['attributes']=_0x425994['attributes'][_0x8c78('0x39')]?_0x425994['attributes']:_0x2307d1['model'];if(!_0x3ff236['query'][_0x8c78('0x3a')](_0x8c78('0x3b'))){_0x425994[_0x8c78('0x1d')]=qs[_0x8c78('0x1d')](_0x3ff236['query'][_0x8c78('0x1d')]);_0x425994[_0x8c78('0x3c')]=qs[_0x8c78('0x3c')](_0x3ff236[_0x8c78('0x33')][_0x8c78('0x3c')]);}_0x425994[_0x8c78('0x3d')]=qs[_0x8c78('0x3e')](_0x3ff236[_0x8c78('0x33')][_0x8c78('0x3e')]);_0x425994[_0x8c78('0x41')]=qs[_0x8c78('0x34')](_[_0x8c78('0x3f')](_0x3ff236[_0x8c78('0x33')],_0x2307d1[_0x8c78('0x34')]));if(_0x3ff236['query'][_0x8c78('0x40')]){_0x425994['where']=_[_0x8c78('0x42')](_0x425994[_0x8c78('0x41')],{'$or':_[_0x8c78('0x2c')](_0x425994['attributes'],function(_0x97df9c){var _0x3e2961={};_0x3e2961[_0x97df9c]={'$like':'%'+_0x3ff236[_0x8c78('0x33')]['filter']+'%'};return _0x3e2961;})});}_0x425994[_0x8c78('0x41')]=_[_0x8c78('0x42')](_0x425994['where'],{'mailboxuser':_0x3529aa[_0x8c78('0x5a')]});_0x425994=_[_0x8c78('0x42')]({},_0x425994,_0x3ff236[_0x8c78('0x4b')]);return db['VoiceMailMessage'][_0x8c78('0x5b')](_0x425994)[_0x8c78('0x24')](respondWithFilteredResult(_0x35cf85,_0x425994));})[_0x8c78('0x47')](handleError(_0x35cf85,null));};
\ No newline at end of file
index 346f034..7e4d0e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc67a=['moment','bluebird','request-promise','path','rimraf','define','mailbox_context','mailbox','context','../../config/logger','api'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc67a,0x153));var _0xac67=function(_0x441a2d,_0x3f1b1e){_0x441a2d=_0x441a2d-0x0;var _0x1d3f13=_0xc67a[_0x441a2d];return _0x1d3f13;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xac67('0x0'))(_0xac67('0x1'));var moment=require(_0xac67('0x2'));var BPromise=require(_0xac67('0x3'));var rp=require(_0xac67('0x4'));var fs=require('fs');var path=require(_0xac67('0x5'));var rimraf=require(_0xac67('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module['exports']=function(_0x3ea1b7,_0x24e5c2){return _0x3ea1b7[_0xac67('0x7')]('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xac67('0x8'),'fields':[_0xac67('0x9'),_0xac67('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x12b5=['exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x3584,_0x3e6ba4){var _0x555a56=function(_0x5d37d2){while(--_0x5d37d2){_0x3584['push'](_0x3584['shift']());}};_0x555a56(++_0x3e6ba4);}(_0x12b5,0x117));var _0x512b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x12b5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x512b('0x0'));var util=require(_0x512b('0x1'));var logger=require(_0x512b('0x2'))(_0x512b('0x3'));var moment=require(_0x512b('0x4'));var BPromise=require('bluebird');var rp=require(_0x512b('0x5'));var fs=require('fs');var path=require(_0x512b('0x6'));var rimraf=require(_0x512b('0x7'));var config=require(_0x512b('0x8'));var attributes=require(_0x512b('0x9'));module[_0x512b('0xa')]=function(_0x2a9f98,_0x3336ed){return _0x2a9f98[_0x512b('0xb')](_0x512b('0xc'),attributes,{'tableName':_0x512b('0xd'),'paranoid':![],'indexes':[{'name':_0x512b('0xe'),'fields':[_0x512b('0xf'),_0x512b('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
index 4357111..afdbe76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc06a=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x234ab9,_0x44ceeb){var _0x4f99ee=function(_0x2c4419){while(--_0x2c4419){_0x234ab9['push'](_0x234ab9['shift']());}};_0x4f99ee(++_0x44ceeb);}(_0xc06a,0x16b));var _0xac06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc06a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac06('0x0'));var util=require('util');var moment=require(_0xac06('0x1'));var BPromise=require(_0xac06('0x2'));var rs=require(_0xac06('0x3'));var fs=require('fs');var Redis=require(_0xac06('0x4'));var db=require(_0xac06('0x5'))['db'];var utils=require(_0xac06('0x6'));var logger=require('../../config/logger')(_0xac06('0x7'));var config=require(_0xac06('0x8'));var jayson=require(_0xac06('0x9'));var client=jayson[_0xac06('0xa')][_0xac06('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dcd35,_0x2f99e6,_0x21b729){return new BPromise(function(_0x23ac7a,_0x24c7ac){return client[_0xac06('0xc')](_0x2dcd35,_0x21b729)['then'](function(_0x3ee88a){logger[_0xac06('0xd')](_0xac06('0xe'),_0x2f99e6,_0xac06('0xf'));logger[_0xac06('0x10')](_0xac06('0x11'),_0x2f99e6,_0xac06('0xf'),JSON[_0xac06('0x12')](_0x3ee88a));if(_0x3ee88a['error']){if(_0x3ee88a['error'][_0xac06('0x13')]===0x1f4){logger[_0xac06('0x14')](_0xac06('0xe'),_0x2f99e6,_0x3ee88a[_0xac06('0x14')]['message']);return _0x24c7ac(_0x3ee88a[_0xac06('0x14')]['message']);}logger[_0xac06('0x14')](_0xac06('0xe'),_0x2f99e6,_0x3ee88a[_0xac06('0x14')][_0xac06('0x15')]);return _0x23ac7a(_0x3ee88a['error']['message']);}else{logger['info'](_0xac06('0xe'),_0x2f99e6,_0xac06('0xf'));_0x23ac7a(_0x3ee88a[_0xac06('0x16')][_0xac06('0x15')]);}})[_0xac06('0x17')](function(_0x1aa88b){logger[_0xac06('0x14')]('VoiceMail,\x20%s,\x20%s',_0x2f99e6,_0x1aa88b);_0x24c7ac(_0x1aa88b);});});}
\ No newline at end of file
+var _0xfbec=['request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http'];(function(_0x55fb9e,_0x3f9a99){var _0x3eb929=function(_0x1b9e8f){while(--_0x1b9e8f){_0x55fb9e['push'](_0x55fb9e['shift']());}};_0x3eb929(++_0x3f9a99);}(_0xfbec,0x1af));var _0xcfbe=function(_0x2fcb41,_0x48d2ae){_0x2fcb41=_0x2fcb41-0x0;var _0x4d6553=_0xfbec[_0x2fcb41];return _0x4d6553;};'use strict';var _=require(_0xcfbe('0x0'));var util=require(_0xcfbe('0x1'));var moment=require(_0xcfbe('0x2'));var BPromise=require(_0xcfbe('0x3'));var rs=require(_0xcfbe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcfbe('0x5'))(_0xcfbe('0x6'));var config=require('../../config/environment');var jayson=require(_0xcfbe('0x7'));var client=jayson['client'][_0xcfbe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x346241,_0x78a9ef,_0x344221){return new BPromise(function(_0xaa6009,_0x53ec30){return client[_0xcfbe('0x9')](_0x346241,_0x344221)[_0xcfbe('0xa')](function(_0x67765c){logger['info'](_0xcfbe('0xb'),_0x78a9ef,_0xcfbe('0xc'));logger[_0xcfbe('0xd')](_0xcfbe('0xe'),_0x78a9ef,'request\x20sent',JSON['stringify'](_0x67765c));if(_0x67765c['error']){if(_0x67765c[_0xcfbe('0xf')]['code']===0x1f4){logger[_0xcfbe('0xf')](_0xcfbe('0xb'),_0x78a9ef,_0x67765c[_0xcfbe('0xf')][_0xcfbe('0x10')]);return _0x53ec30(_0x67765c[_0xcfbe('0xf')][_0xcfbe('0x10')]);}logger[_0xcfbe('0xf')](_0xcfbe('0xb'),_0x78a9ef,_0x67765c[_0xcfbe('0xf')]['message']);return _0xaa6009(_0x67765c[_0xcfbe('0xf')][_0xcfbe('0x10')]);}else{logger[_0xcfbe('0x11')](_0xcfbe('0xb'),_0x78a9ef,_0xcfbe('0xc'));_0xaa6009(_0x67765c[_0xcfbe('0x12')][_0xcfbe('0x10')]);}})[_0xcfbe('0x13')](function(_0x1b7538){logger['error'](_0xcfbe('0xb'),_0x78a9ef,_0x1b7538);_0x53ec30(_0x1b7538);});});}
\ No newline at end of file
index a0872db..592e576 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1972=['exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','/:id/download','create','put','update','delete','destroy'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x1972,0x166));var _0x2197=function(_0x55ad2b,_0x27b0a9){_0x55ad2b=_0x55ad2b-0x0;var _0x67c824=_0x1972[_0x55ad2b];return _0x67c824;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2197('0x0'));var timeout=require(_0x2197('0x1'));var express=require('express');var router=express[_0x2197('0x2')]();var fs_extra=require(_0x2197('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2197('0x4'));var config=require('../../config/environment');var controller=require(_0x2197('0x5'));router[_0x2197('0x6')]('/',auth['isAuthenticated'](),controller[_0x2197('0x7')]);router[_0x2197('0x6')](_0x2197('0x8'),auth[_0x2197('0x9')](),controller['show']);router['get'](_0x2197('0xa'),auth[_0x2197('0x9')](),controller['download']);router['post']('/',auth[_0x2197('0x9')](),controller[_0x2197('0xb')]);router[_0x2197('0xc')]('/:id',auth[_0x2197('0x9')](),controller[_0x2197('0xd')]);router[_0x2197('0xe')](_0x2197('0x8'),auth['isAuthenticated'](),controller[_0x2197('0xf')]);module[_0x2197('0x10')]=router;
\ No newline at end of file
+var _0x47e0=['/:id','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47e0,0xdb));var _0x047e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x47e0[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x047e('0x0'));var util=require(_0x047e('0x1'));var path=require(_0x047e('0x2'));var timeout=require(_0x047e('0x3'));var express=require(_0x047e('0x4'));var router=express[_0x047e('0x5')]();var fs_extra=require(_0x047e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x047e('0x7'));var config=require(_0x047e('0x8'));var controller=require(_0x047e('0x9'));router[_0x047e('0xa')]('/',auth[_0x047e('0xb')](),controller['index']);router[_0x047e('0xa')](_0x047e('0xc'),auth[_0x047e('0xb')](),controller['show']);router['get'](_0x047e('0xd'),auth[_0x047e('0xb')](),controller[_0x047e('0xe')]);router[_0x047e('0xf')]('/',auth[_0x047e('0xb')](),controller['create']);router[_0x047e('0x10')]('/:id',auth[_0x047e('0xb')](),controller[_0x047e('0x11')]);router[_0x047e('0x12')]('/:id',auth[_0x047e('0xb')](),controller[_0x047e('0x13')]);module[_0x047e('0x14')]=router;
\ No newline at end of file
index 87eab83..6e4e4b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdd0=['TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','STRING','BLOB','long'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcdd0,0x152));var _0x0cdd=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xcdd0[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0x0cdd('0x0'));module['exports']={'name':{'type':Sequelize[_0x0cdd('0x1')],'get':function(_0x5e7fc8){return this[_0x0cdd('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x0cdd('0x4')](_0x0cdd('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':''},'stamp':{'type':_0x0cdd('0x6'),'defaultValue':Sequelize['literal'](_0x0cdd('0x7'))}};
\ No newline at end of file
+var _0xfd41=['TIMESTAMP','literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','long'];(function(_0x46bea6,_0x4398cb){var _0x89d185=function(_0x182b68){while(--_0x182b68){_0x46bea6['push'](_0x46bea6['shift']());}};_0x89d185(++_0x4398cb);}(_0xfd41,0x13d));var _0x1fd4=function(_0x4a4a43,_0x115ccf){_0x4a4a43=_0x4a4a43-0x0;var _0x5893a6=_0xfd41[_0x4a4a43];return _0x5893a6;};'use strict';var Sequelize=require(_0x1fd4('0x0'));module[_0x1fd4('0x1')]={'name':{'type':Sequelize[_0x1fd4('0x2')],'get':function(_0x49f296){return this[_0x1fd4('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x1fd4('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x1fd4('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x1fd4('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x1fd4('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x1fd4('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x1fd4('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x1fd4('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x1fd4('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x1fd4('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x1fd4('0x5')],'defaultValue':''},'stamp':{'type':_0x1fd4('0x7'),'defaultValue':Sequelize[_0x1fd4('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index db47116..a892b96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e8c=['bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','create','body','update','find','recording','ValidationError','attachment','msg_id','Content-Disposition','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x167e37,_0x26a135){var _0x1ee5d7=function(_0x559a88){while(--_0x559a88){_0x167e37['push'](_0x167e37['shift']());}};_0x1ee5d7(++_0x26a135);}(_0x6e8c,0xa3));var _0xc6e8=function(_0x2e03bd,_0x4f9d0e){_0x2e03bd=_0x2e03bd-0x0;var _0x3cb242=_0x6e8c[_0x2e03bd];return _0x3cb242;};'use strict';var emlformat=require(_0xc6e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6e8('0x1'));var jsonpatch=require(_0xc6e8('0x2'));var rp=require(_0xc6e8('0x3'));var moment=require(_0xc6e8('0x4'));var BPromise=require(_0xc6e8('0x5'));var Mustache=require(_0xc6e8('0x6'));var util=require('util');var path=require(_0xc6e8('0x7'));var sox=require(_0xc6e8('0x8'));var csv=require(_0xc6e8('0x9'));var ejs=require(_0xc6e8('0xa'));var fs=require('fs');var fs_extra=require(_0xc6e8('0xb'));var _=require(_0xc6e8('0xc'));var squel=require(_0xc6e8('0xd'));var crypto=require(_0xc6e8('0xe'));var jsforce=require(_0xc6e8('0xf'));var deskjs=require(_0xc6e8('0x10'));var toCsv=require(_0xc6e8('0x9'));var querystring=require('querystring');var Papa=require(_0xc6e8('0x11'));var Redis=require(_0xc6e8('0x12'));var authService=require(_0xc6e8('0x13'));var qs=require(_0xc6e8('0x14'));var as=require(_0xc6e8('0x15'));var hardwareService=require(_0xc6e8('0x16'));var logger=require('../../config/logger')(_0xc6e8('0x17'));var utils=require(_0xc6e8('0x18'));var config=require(_0xc6e8('0x19'));var licenseUtil=require(_0xc6e8('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2612b4,_0x3d7cc8){_0x3d7cc8=_0x3d7cc8||0xcc;return function(_0x4b3924){if(_0x4b3924){return _0x2612b4['sendStatus'](_0x3d7cc8);}return _0x2612b4['status'](_0x3d7cc8)[_0xc6e8('0x1b')]();};}function respondWithResult(_0x1c7e04,_0x2d52ff){_0x2d52ff=_0x2d52ff||0xc8;return function(_0x45e25e){if(_0x45e25e){return _0x1c7e04[_0xc6e8('0x1c')](_0x2d52ff)[_0xc6e8('0x1d')](_0x45e25e);}};}function respondWithFilteredResult(_0x10d77c,_0x14db75){return function(_0x5967a8){if(_0x5967a8){var _0xc9a386=typeof _0x14db75[_0xc6e8('0x1e')]==='undefined'&&typeof _0x14db75[_0xc6e8('0x1f')]===_0xc6e8('0x20');var _0x3ef3c6=_0x5967a8['count'];var _0x47cab1=_0xc9a386?0x0:_0x14db75[_0xc6e8('0x1e')];var _0x264f44=_0xc9a386?_0x5967a8[_0xc6e8('0x21')]:_0x14db75['offset']+_0x14db75[_0xc6e8('0x1f')];var _0x3d6c4e;if(_0x264f44>=_0x3ef3c6){_0x264f44=_0x3ef3c6;_0x3d6c4e=0xc8;}else{_0x3d6c4e=0xce;}_0x10d77c[_0xc6e8('0x1c')](_0x3d6c4e);return _0x10d77c[_0xc6e8('0x22')](_0xc6e8('0x23'),_0x47cab1+'-'+_0x264f44+'/'+_0x3ef3c6)[_0xc6e8('0x1d')](_0x5967a8);}return null;};}function patchUpdates(_0x4028ee){return function(_0x4d48a9){try{jsonpatch[_0xc6e8('0x24')](_0x4d48a9,_0x4028ee,!![]);}catch(_0x596155){return BPromise['reject'](_0x596155);}return _0x4d48a9[_0xc6e8('0x25')]();};}function saveUpdates(_0x330b2a,_0x31aceb){return function(_0x254906){if(_0x254906){return _0x254906['update'](_0x330b2a)[_0xc6e8('0x26')](function(_0x536945){return _0x536945;});}return null;};}function removeEntity(_0x6f9f25,_0x7d5192){return function(_0x1483bb){if(_0x1483bb){return _0x1483bb[_0xc6e8('0x27')]()[_0xc6e8('0x26')](function(){_0x6f9f25['status'](0xcc)[_0xc6e8('0x1b')]();});}};}function handleEntityNotFound(_0x495ac8,_0x15c031){return function(_0x9ad80a){if(!_0x9ad80a){_0x495ac8[_0xc6e8('0x28')](0x194);}return _0x9ad80a;};}function handleError(_0x1a63f6,_0x5b66c6){_0x5b66c6=_0x5b66c6||0x1f4;return function(_0xac3246){logger[_0xc6e8('0x29')](_0xac3246[_0xc6e8('0x2a')]);if(_0xac3246[_0xc6e8('0x2b')]){delete _0xac3246[_0xc6e8('0x2b')];}_0x1a63f6['status'](_0x5b66c6)[_0xc6e8('0x2c')](_0xac3246);};}exports[_0xc6e8('0x2d')]=function(_0x2a1cc3,_0x5e4f36){var _0x29ba2d={},_0x3da28c={},_0x5ae02f={'count':0x0,'rows':[]};var _0x38bb1b=_[_0xc6e8('0x2e')](db[_0xc6e8('0x2f')][_0xc6e8('0x30')],function(_0x16e3d7){return{'name':_0x16e3d7[_0xc6e8('0x31')],'type':_0x16e3d7[_0xc6e8('0x32')][_0xc6e8('0x33')]};});_0x3da28c['model']=_[_0xc6e8('0x34')](_[_0xc6e8('0x2e')](_0x38bb1b,_0xc6e8('0x2b')),[_0xc6e8('0x2b')]);_0x3da28c[_0xc6e8('0x35')]=_[_0xc6e8('0x36')](_0x2a1cc3['query']);_0x3da28c[_0xc6e8('0x37')]=_[_0xc6e8('0x38')](_0x3da28c['model'],_0x3da28c[_0xc6e8('0x35')]);_0x29ba2d[_0xc6e8('0x39')]=_['intersection'](_0x3da28c[_0xc6e8('0x3a')],qs[_0xc6e8('0x3b')](_0x2a1cc3['query'][_0xc6e8('0x3b')]));_0x29ba2d[_0xc6e8('0x39')]=_0x29ba2d[_0xc6e8('0x39')]['length']?_0x29ba2d[_0xc6e8('0x39')]:_0x3da28c['model'];if(!_0x2a1cc3['query']['hasOwnProperty'](_0xc6e8('0x3c'))){_0x29ba2d['limit']=qs[_0xc6e8('0x1f')](_0x2a1cc3['query'][_0xc6e8('0x1f')]);_0x29ba2d[_0xc6e8('0x1e')]=qs[_0xc6e8('0x1e')](_0x2a1cc3[_0xc6e8('0x35')][_0xc6e8('0x1e')]);}_0x29ba2d[_0xc6e8('0x3d')]=qs[_0xc6e8('0x3e')](_0x2a1cc3[_0xc6e8('0x35')][_0xc6e8('0x3e')]);_0x29ba2d[_0xc6e8('0x3f')]=qs['filters'](_[_0xc6e8('0x40')](_0x2a1cc3[_0xc6e8('0x35')],_0x3da28c[_0xc6e8('0x37')]),_0x38bb1b);if(_0x2a1cc3[_0xc6e8('0x35')]['filter']){_0x29ba2d['where']=_[_0xc6e8('0x41')](_0x29ba2d['where'],{'$or':_['map'](_0x38bb1b,function(_0x804994){if(_0x804994[_0xc6e8('0x32')]!==_0xc6e8('0x42')){var _0x2ed7b9={};_0x2ed7b9[_0x804994['name']]={'$like':'%'+_0x2a1cc3['query'][_0xc6e8('0x43')]+'%'};return _0x2ed7b9;}})});}_0x29ba2d=_['merge']({},_0x29ba2d,_0x2a1cc3['options']);var _0x2d9c31={'where':_0x29ba2d[_0xc6e8('0x3f')]};return db[_0xc6e8('0x2f')]['count'](_0x2d9c31)[_0xc6e8('0x26')](function(_0x5268f9){_0x5ae02f[_0xc6e8('0x21')]=_0x5268f9;if(_0x2a1cc3['query'][_0xc6e8('0x44')]){_0x29ba2d[_0xc6e8('0x45')]=[{'all':!![]}];}return db[_0xc6e8('0x2f')][_0xc6e8('0x46')](_0x29ba2d);})[_0xc6e8('0x26')](function(_0x4bb27a){_0x5ae02f['rows']=_0x4bb27a;return _0x5ae02f;})['then'](respondWithFilteredResult(_0x5e4f36,_0x29ba2d))[_0xc6e8('0x47')](handleError(_0x5e4f36,null));};exports[_0xc6e8('0x48')]=function(_0x210ffb,_0x40059f){var _0x159357={'raw':!![],'where':{'id':_0x210ffb[_0xc6e8('0x49')]['id']}},_0x41198c={};_0x41198c[_0xc6e8('0x3a')]=_[_0xc6e8('0x36')](db[_0xc6e8('0x2f')][_0xc6e8('0x30')]);_0x41198c['query']=_['keys'](_0x210ffb['query']);_0x41198c['filters']=_[_0xc6e8('0x38')](_0x41198c[_0xc6e8('0x3a')],_0x41198c[_0xc6e8('0x35')]);_0x159357[_0xc6e8('0x39')]=_['intersection'](_0x41198c[_0xc6e8('0x3a')],qs['fields'](_0x210ffb[_0xc6e8('0x35')][_0xc6e8('0x3b')]));_0x159357[_0xc6e8('0x39')]=_0x159357[_0xc6e8('0x39')]['length']?_0x159357[_0xc6e8('0x39')]:_0x41198c[_0xc6e8('0x3a')];if(_0x210ffb[_0xc6e8('0x35')]['includeAll']){_0x159357['include']=[{'all':!![]}];}_0x159357=_[_0xc6e8('0x41')]({},_0x159357,_0x210ffb[_0xc6e8('0x4a')]);return db['VoiceMailMessage']['find'](_0x159357)[_0xc6e8('0x26')](handleEntityNotFound(_0x40059f,null))['then'](respondWithResult(_0x40059f,null))[_0xc6e8('0x47')](handleError(_0x40059f,null));};exports[_0xc6e8('0x4b')]=function(_0x5131e7,_0x3c9a3a){return db[_0xc6e8('0x2f')]['create'](_0x5131e7[_0xc6e8('0x4c')],{})[_0xc6e8('0x26')](respondWithResult(_0x3c9a3a,0xc9))[_0xc6e8('0x47')](handleError(_0x3c9a3a,null));};exports[_0xc6e8('0x4d')]=function(_0x57d2df,_0x22915d){if(_0x57d2df['body']['id']){delete _0x57d2df[_0xc6e8('0x4c')]['id'];}return db['VoiceMailMessage'][_0xc6e8('0x4e')]({'where':{'id':_0x57d2df[_0xc6e8('0x49')]['id']}})['then'](handleEntityNotFound(_0x22915d,null))['then'](saveUpdates(_0x57d2df[_0xc6e8('0x4c')],null))['then'](respondWithResult(_0x22915d,null))[_0xc6e8('0x47')](handleError(_0x22915d,null));};exports[_0xc6e8('0x27')]=function(_0x14b335,_0x50ad33){return db['VoiceMailMessage'][_0xc6e8('0x4e')]({'where':{'id':_0x14b335[_0xc6e8('0x49')]['id']}})[_0xc6e8('0x26')](handleEntityNotFound(_0x50ad33,null))[_0xc6e8('0x26')](removeEntity(_0x50ad33,null))[_0xc6e8('0x47')](handleError(_0x50ad33,null));};exports['download']=function(_0x980ee3,_0x2db7b4,_0x357451){return db[_0xc6e8('0x2f')][_0xc6e8('0x4e')]({'where':{'id':_0x980ee3['params']['id']},'attributes':['id',_0xc6e8('0x4f'),'msg_id']})[_0xc6e8('0x26')](handleEntityNotFound(_0x2db7b4,null))['then'](function(_0x5bb2ef){if(_0x5bb2ef){if(!_0x5bb2ef[_0xc6e8('0x4f')]){throw new db['Sequelize'][(_0xc6e8('0x50'))]('VoiceMailMessage\x20not\x20found');}var _0x3932cb={'Content-Type':'audio/wav','Content-Disposition':_0xc6e8('0x51')};if(_0x5bb2ef[_0xc6e8('0x52')]){_0x3932cb[_0xc6e8('0x53')]='attachment;\x20filename=\x22'+_0x5bb2ef[_0xc6e8('0x52')]+'.wav\x22';}_0x2db7b4['set'](_0x3932cb);return _0x2db7b4[_0xc6e8('0x2c')](new Buffer(_0x5bb2ef[_0xc6e8('0x4f')]));}})[_0xc6e8('0x47')](handleError(_0x2db7b4,null));};
\ No newline at end of file
+var _0xc41f=['moment','bluebird','util','path','to-csv','ejs','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','name','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','find','create','body','catch','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','.wav\x22','send','rimraf','zip-dir','request-promise'];(function(_0x4349df,_0x48b5fc){var _0x3685e2=function(_0x4a64f9){while(--_0x4a64f9){_0x4349df['push'](_0x4349df['shift']());}};_0x3685e2(++_0x48b5fc);}(_0xc41f,0x141));var _0xfc41=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0xc41f[_0x22b8a3];return _0x199a0c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc41('0x0'));var zipdir=require(_0xfc41('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc41('0x2'));var moment=require(_0xfc41('0x3'));var BPromise=require(_0xfc41('0x4'));var Mustache=require('mustache');var util=require(_0xfc41('0x5'));var path=require(_0xfc41('0x6'));var sox=require('sox');var csv=require(_0xfc41('0x7'));var ejs=require(_0xfc41('0x8'));var fs=require('fs');var fs_extra=require(_0xfc41('0x9'));var _=require('lodash');var squel=require(_0xfc41('0xa'));var crypto=require(_0xfc41('0xb'));var jsforce=require(_0xfc41('0xc'));var deskjs=require(_0xfc41('0xd'));var toCsv=require(_0xfc41('0x7'));var querystring=require(_0xfc41('0xe'));var Papa=require(_0xfc41('0xf'));var Redis=require(_0xfc41('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfc41('0x11'));var hardwareService=require(_0xfc41('0x12'));var logger=require(_0xfc41('0x13'))(_0xfc41('0x14'));var utils=require(_0xfc41('0x15'));var config=require(_0xfc41('0x16'));var licenseUtil=require(_0xfc41('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50fe35,_0x187965){_0x187965=_0x187965||0xcc;return function(_0x4e5e75){if(_0x4e5e75){return _0x50fe35[_0xfc41('0x18')](_0x187965);}return _0x50fe35[_0xfc41('0x19')](_0x187965)[_0xfc41('0x1a')]();};}function respondWithResult(_0x5c80a5,_0x594f47){_0x594f47=_0x594f47||0xc8;return function(_0x4b6ebd){if(_0x4b6ebd){return _0x5c80a5[_0xfc41('0x19')](_0x594f47)[_0xfc41('0x1b')](_0x4b6ebd);}};}function respondWithFilteredResult(_0x1c478d,_0x57ebb7){return function(_0x179337){if(_0x179337){var _0x314dba=typeof _0x57ebb7[_0xfc41('0x1c')]===_0xfc41('0x1d')&&typeof _0x57ebb7[_0xfc41('0x1e')]===_0xfc41('0x1d');var _0x2a919c=_0x179337[_0xfc41('0x1f')];var _0x109286=_0x314dba?0x0:_0x57ebb7[_0xfc41('0x1c')];var _0xa10172=_0x314dba?_0x179337[_0xfc41('0x1f')]:_0x57ebb7[_0xfc41('0x1c')]+_0x57ebb7[_0xfc41('0x1e')];var _0x2574bf;if(_0xa10172>=_0x2a919c){_0xa10172=_0x2a919c;_0x2574bf=0xc8;}else{_0x2574bf=0xce;}_0x1c478d[_0xfc41('0x19')](_0x2574bf);return _0x1c478d[_0xfc41('0x20')](_0xfc41('0x21'),_0x109286+'-'+_0xa10172+'/'+_0x2a919c)['json'](_0x179337);}return null;};}function patchUpdates(_0x20265a){return function(_0x36e6b6){try{jsonpatch[_0xfc41('0x22')](_0x36e6b6,_0x20265a,!![]);}catch(_0x2c877a){return BPromise['reject'](_0x2c877a);}return _0x36e6b6[_0xfc41('0x23')]();};}function saveUpdates(_0x592307,_0x5cd698){return function(_0x521680){if(_0x521680){return _0x521680[_0xfc41('0x24')](_0x592307)[_0xfc41('0x25')](function(_0x140f05){return _0x140f05;});}return null;};}function removeEntity(_0x4c1369,_0x114444){return function(_0x20a50b){if(_0x20a50b){return _0x20a50b[_0xfc41('0x26')]()[_0xfc41('0x25')](function(){_0x4c1369[_0xfc41('0x19')](0xcc)[_0xfc41('0x1a')]();});}};}function handleEntityNotFound(_0x3954ef,_0x9a9bd7){return function(_0xd5d903){if(!_0xd5d903){_0x3954ef[_0xfc41('0x18')](0x194);}return _0xd5d903;};}function handleError(_0x4ce606,_0x2c1036){_0x2c1036=_0x2c1036||0x1f4;return function(_0x239537){logger['error'](_0x239537['stack']);if(_0x239537[_0xfc41('0x27')]){delete _0x239537[_0xfc41('0x27')];}_0x4ce606[_0xfc41('0x19')](_0x2c1036)['send'](_0x239537);};}exports[_0xfc41('0x28')]=function(_0x216882,_0x130baa){var _0x334d5b={},_0x5c28ea={},_0x529fb0={'count':0x0,'rows':[]};var _0x682ebf=_[_0xfc41('0x29')](db[_0xfc41('0x2a')][_0xfc41('0x2b')],function(_0x4f514c){return{'name':_0x4f514c[_0xfc41('0x2c')],'type':_0x4f514c[_0xfc41('0x2d')][_0xfc41('0x2e')]};});_0x5c28ea[_0xfc41('0x2f')]=_['differenceBy'](_[_0xfc41('0x29')](_0x682ebf,'name'),['name']);_0x5c28ea[_0xfc41('0x30')]=_[_0xfc41('0x31')](_0x216882[_0xfc41('0x30')]);_0x5c28ea['filters']=_[_0xfc41('0x32')](_0x5c28ea['model'],_0x5c28ea[_0xfc41('0x30')]);_0x334d5b[_0xfc41('0x33')]=_['intersection'](_0x5c28ea['model'],qs[_0xfc41('0x34')](_0x216882[_0xfc41('0x30')][_0xfc41('0x34')]));_0x334d5b['attributes']=_0x334d5b[_0xfc41('0x33')][_0xfc41('0x35')]?_0x334d5b[_0xfc41('0x33')]:_0x5c28ea[_0xfc41('0x2f')];if(!_0x216882['query'][_0xfc41('0x36')](_0xfc41('0x37'))){_0x334d5b['limit']=qs[_0xfc41('0x1e')](_0x216882[_0xfc41('0x30')][_0xfc41('0x1e')]);_0x334d5b[_0xfc41('0x1c')]=qs[_0xfc41('0x1c')](_0x216882[_0xfc41('0x30')][_0xfc41('0x1c')]);}_0x334d5b['order']=qs['sort'](_0x216882[_0xfc41('0x30')]['sort']);_0x334d5b[_0xfc41('0x38')]=qs[_0xfc41('0x39')](_[_0xfc41('0x3a')](_0x216882['query'],_0x5c28ea[_0xfc41('0x39')]),_0x682ebf);if(_0x216882[_0xfc41('0x30')][_0xfc41('0x3b')]){_0x334d5b[_0xfc41('0x38')]=_[_0xfc41('0x3c')](_0x334d5b[_0xfc41('0x38')],{'$or':_[_0xfc41('0x29')](_0x682ebf,function(_0x29e611){if(_0x29e611[_0xfc41('0x2d')]!==_0xfc41('0x3d')){var _0x5c42fe={};_0x5c42fe[_0x29e611[_0xfc41('0x27')]]={'$like':'%'+_0x216882['query'][_0xfc41('0x3b')]+'%'};return _0x5c42fe;}})});}_0x334d5b=_[_0xfc41('0x3c')]({},_0x334d5b,_0x216882[_0xfc41('0x3e')]);var _0x1dff83={'where':_0x334d5b[_0xfc41('0x38')]};return db['VoiceMailMessage']['count'](_0x1dff83)[_0xfc41('0x25')](function(_0x3f8cd6){_0x529fb0[_0xfc41('0x1f')]=_0x3f8cd6;if(_0x216882[_0xfc41('0x30')][_0xfc41('0x3f')]){_0x334d5b[_0xfc41('0x40')]=[{'all':!![]}];}return db[_0xfc41('0x2a')]['findAll'](_0x334d5b);})[_0xfc41('0x25')](function(_0x47d256){_0x529fb0['rows']=_0x47d256;return _0x529fb0;})[_0xfc41('0x25')](respondWithFilteredResult(_0x130baa,_0x334d5b))['catch'](handleError(_0x130baa,null));};exports[_0xfc41('0x41')]=function(_0x44f69f,_0xec2b2c){var _0x9c3f38={'raw':!![],'where':{'id':_0x44f69f[_0xfc41('0x42')]['id']}},_0x4cf30d={};_0x4cf30d[_0xfc41('0x2f')]=_[_0xfc41('0x31')](db['VoiceMailMessage']['rawAttributes']);_0x4cf30d['query']=_['keys'](_0x44f69f[_0xfc41('0x30')]);_0x4cf30d[_0xfc41('0x39')]=_['intersection'](_0x4cf30d[_0xfc41('0x2f')],_0x4cf30d[_0xfc41('0x30')]);_0x9c3f38['attributes']=_[_0xfc41('0x32')](_0x4cf30d['model'],qs[_0xfc41('0x34')](_0x44f69f['query']['fields']));_0x9c3f38[_0xfc41('0x33')]=_0x9c3f38[_0xfc41('0x33')][_0xfc41('0x35')]?_0x9c3f38[_0xfc41('0x33')]:_0x4cf30d[_0xfc41('0x2f')];if(_0x44f69f['query'][_0xfc41('0x3f')]){_0x9c3f38[_0xfc41('0x40')]=[{'all':!![]}];}_0x9c3f38=_[_0xfc41('0x3c')]({},_0x9c3f38,_0x44f69f[_0xfc41('0x3e')]);return db[_0xfc41('0x2a')][_0xfc41('0x43')](_0x9c3f38)[_0xfc41('0x25')](handleEntityNotFound(_0xec2b2c,null))['then'](respondWithResult(_0xec2b2c,null))['catch'](handleError(_0xec2b2c,null));};exports[_0xfc41('0x44')]=function(_0x497e89,_0x77dd44){return db[_0xfc41('0x2a')][_0xfc41('0x44')](_0x497e89[_0xfc41('0x45')],{})['then'](respondWithResult(_0x77dd44,0xc9))[_0xfc41('0x46')](handleError(_0x77dd44,null));};exports[_0xfc41('0x24')]=function(_0x19a146,_0x3cc95d){if(_0x19a146[_0xfc41('0x45')]['id']){delete _0x19a146[_0xfc41('0x45')]['id'];}return db[_0xfc41('0x2a')][_0xfc41('0x43')]({'where':{'id':_0x19a146[_0xfc41('0x42')]['id']}})[_0xfc41('0x25')](handleEntityNotFound(_0x3cc95d,null))[_0xfc41('0x25')](saveUpdates(_0x19a146[_0xfc41('0x45')],null))[_0xfc41('0x25')](respondWithResult(_0x3cc95d,null))['catch'](handleError(_0x3cc95d,null));};exports[_0xfc41('0x26')]=function(_0x1dfc21,_0x504213){return db['VoiceMailMessage']['find']({'where':{'id':_0x1dfc21[_0xfc41('0x42')]['id']}})[_0xfc41('0x25')](handleEntityNotFound(_0x504213,null))[_0xfc41('0x25')](removeEntity(_0x504213,null))['catch'](handleError(_0x504213,null));};exports[_0xfc41('0x47')]=function(_0x1408f7,_0x475fe1,_0x1de3b0){return db['VoiceMailMessage'][_0xfc41('0x43')]({'where':{'id':_0x1408f7[_0xfc41('0x42')]['id']},'attributes':['id',_0xfc41('0x48'),_0xfc41('0x49')]})[_0xfc41('0x25')](handleEntityNotFound(_0x475fe1,null))['then'](function(_0x11b30b){if(_0x11b30b){if(!_0x11b30b[_0xfc41('0x48')]){throw new db[(_0xfc41('0x4a'))][(_0xfc41('0x4b'))](_0xfc41('0x4c'));}var _0x3ea7ee={'Content-Type':_0xfc41('0x4d'),'Content-Disposition':_0xfc41('0x4e')};if(_0x11b30b[_0xfc41('0x49')]){_0x3ea7ee['Content-Disposition']='attachment;\x20filename=\x22'+_0x11b30b[_0xfc41('0x49')]+_0xfc41('0x4f');}_0x475fe1[_0xfc41('0x20')](_0x3ea7ee);return _0x475fe1[_0xfc41('0x50')](new Buffer(_0x11b30b['recording']));}})[_0xfc41('0x46')](handleError(_0x475fe1,null));};
\ No newline at end of file
index 5c480a7..ce16c3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d85=['api','request-promise','../../config/environment','exports','VoiceMailMessage','voice_voicemail_messages','../../config/logger'];(function(_0x23a4bd,_0x16b1e9){var _0x390442=function(_0x2a3ecb){while(--_0x2a3ecb){_0x23a4bd['push'](_0x23a4bd['shift']());}};_0x390442(++_0x16b1e9);}(_0x1d85,0x12c));var _0x51d8=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x1d85[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51d8('0x0'))(_0x51d8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x51d8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x51d8('0x3'));var attributes=require('./voiceMailMessage.attributes');module[_0x51d8('0x4')]=function(_0x775df0,_0x37dd82){return _0x775df0['define'](_0x51d8('0x5'),attributes,{'tableName':_0x51d8('0x6'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
+var _0x336a=['path','rimraf','../../config/environment','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x9f8946,_0xe7e3d9){var _0x58b80c=function(_0x187fb4){while(--_0x187fb4){_0x9f8946['push'](_0x9f8946['shift']());}};_0x58b80c(++_0xe7e3d9);}(_0x336a,0xaf));var _0xa336=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x336a[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xa336('0x0'));var util=require(_0xa336('0x1'));var logger=require(_0xa336('0x2'))(_0xa336('0x3'));var moment=require(_0xa336('0x4'));var BPromise=require(_0xa336('0x5'));var rp=require(_0xa336('0x6'));var fs=require('fs');var path=require(_0xa336('0x7'));var rimraf=require(_0xa336('0x8'));var config=require(_0xa336('0x9'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x3ef5db,_0xf54bb7){return _0x3ef5db['define'](_0xa336('0xa'),attributes,{'tableName':_0xa336('0xb'),'paranoid':![],'indexes':[{'name':_0xa336('0xc'),'fields':[_0xa336('0xc')]}],'timestamps':![]});};
\ No newline at end of file
index 07fa54b..36d84c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f82=['../../config/utils','../../config/logger','rpc','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','moment','randomstring'];(function(_0x20d5ea,_0x293bec){var _0x58d095=function(_0x1828ea){while(--_0x1828ea){_0x20d5ea['push'](_0x20d5ea['shift']());}};_0x58d095(++_0x293bec);}(_0x4f82,0x7c));var _0x24f8=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x4f82[_0xd09668];return _0x68726;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x24f8('0x0'));var BPromise=require('bluebird');var rs=require(_0x24f8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x24f8('0x2'));var logger=require(_0x24f8('0x3'))(_0x24f8('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x24f8('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4733aa,_0x32c05c,_0x3cbc58){return new BPromise(function(_0x4e2078,_0x21e0bc){return client[_0x24f8('0x6')](_0x4733aa,_0x3cbc58)[_0x24f8('0x7')](function(_0x59f6bc){logger[_0x24f8('0x8')](_0x24f8('0x9'),_0x32c05c,_0x24f8('0xa'));logger[_0x24f8('0xb')](_0x24f8('0xc'),_0x32c05c,'request\x20sent',JSON[_0x24f8('0xd')](_0x59f6bc));if(_0x59f6bc['error']){if(_0x59f6bc['error'][_0x24f8('0xe')]===0x1f4){logger[_0x24f8('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x32c05c,_0x59f6bc['error']['message']);return _0x21e0bc(_0x59f6bc[_0x24f8('0xf')]['message']);}logger[_0x24f8('0xf')](_0x24f8('0x9'),_0x32c05c,_0x59f6bc[_0x24f8('0xf')][_0x24f8('0x10')]);return _0x4e2078(_0x59f6bc['error'][_0x24f8('0x10')]);}else{logger['info'](_0x24f8('0x9'),_0x32c05c,_0x24f8('0xa'));_0x4e2078(_0x59f6bc[_0x24f8('0x11')]['message']);}})['catch'](function(_0x5668f4){logger[_0x24f8('0xf')](_0x24f8('0x9'),_0x32c05c,_0x5668f4);_0x21e0bc(_0x5668f4);});});}
\ No newline at end of file
+var _0x2c2e=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','VoiceMailMessage,\x20%s,\x20%s','message','catch'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0x2c2e,0xdc));var _0xe2c2=function(_0x5bc52f,_0x57e794){_0x5bc52f=_0x5bc52f-0x0;var _0x51d93f=_0x2c2e[_0x5bc52f];return _0x51d93f;};'use strict';var _=require(_0xe2c2('0x0'));var util=require(_0xe2c2('0x1'));var moment=require(_0xe2c2('0x2'));var BPromise=require(_0xe2c2('0x3'));var rs=require(_0xe2c2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2c2('0x5'))['db'];var utils=require(_0xe2c2('0x6'));var logger=require(_0xe2c2('0x7'))('rpc');var config=require(_0xe2c2('0x8'));var jayson=require(_0xe2c2('0x9'));var client=jayson['client'][_0xe2c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b9233,_0x4eced1,_0x4c8148){return new BPromise(function(_0x30b500,_0x3b2e10){return client[_0xe2c2('0xb')](_0x4b9233,_0x4c8148)[_0xe2c2('0xc')](function(_0x2d7e0c){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x4eced1,_0xe2c2('0xd'));logger[_0xe2c2('0xe')](_0xe2c2('0xf'),_0x4eced1,'request\x20sent',JSON[_0xe2c2('0x10')](_0x2d7e0c));if(_0x2d7e0c['error']){if(_0x2d7e0c['error'][_0xe2c2('0x11')]===0x1f4){logger[_0xe2c2('0x12')](_0xe2c2('0x13'),_0x4eced1,_0x2d7e0c[_0xe2c2('0x12')][_0xe2c2('0x14')]);return _0x3b2e10(_0x2d7e0c['error'][_0xe2c2('0x14')]);}logger[_0xe2c2('0x12')](_0xe2c2('0x13'),_0x4eced1,_0x2d7e0c[_0xe2c2('0x12')][_0xe2c2('0x14')]);return _0x30b500(_0x2d7e0c[_0xe2c2('0x12')]['message']);}else{logger['info'](_0xe2c2('0x13'),_0x4eced1,_0xe2c2('0xd'));_0x30b500(_0x2d7e0c['result'][_0xe2c2('0x14')]);}})[_0xe2c2('0x15')](function(_0x4b6afb){logger[_0xe2c2('0x12')](_0xe2c2('0x13'),_0x4eced1,_0x4b6afb);_0x3b2e10(_0x4b6afb);});});}
\ No newline at end of file
index 79aa5af..4f7463b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0eab=['destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','create','addSound','put','update','delete'];(function(_0x2be241,_0x5bde98){var _0x48faa1=function(_0x5136f1){while(--_0x5136f1){_0x2be241['push'](_0x2be241['shift']());}};_0x48faa1(++_0x5bde98);}(_0x0eab,0x1e8));var _0xb0ea=function(_0x520f8d,_0x40fc04){_0x520f8d=_0x520f8d-0x0;var _0x390bdc=_0x0eab[_0x520f8d];return _0x390bdc;};'use strict';var multer=require(_0xb0ea('0x0'));var util=require(_0xb0ea('0x1'));var path=require(_0xb0ea('0x2'));var timeout=require(_0xb0ea('0x3'));var express=require('express');var router=express[_0xb0ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb0ea('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb0ea('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0xb0ea('0x7')]('/',auth[_0xb0ea('0x8')](),controller[_0xb0ea('0x9')]);router[_0xb0ea('0x7')](_0xb0ea('0xa'),auth[_0xb0ea('0x8')](),controller['show']);router[_0xb0ea('0x7')](_0xb0ea('0xb'),auth[_0xb0ea('0x8')](),controller[_0xb0ea('0xc')]);router['post']('/',auth[_0xb0ea('0x8')](),controller[_0xb0ea('0xd')]);router['post'](_0xb0ea('0xb'),auth['isAuthenticated'](),controller[_0xb0ea('0xe')]);router[_0xb0ea('0xf')](_0xb0ea('0xa'),auth['isAuthenticated'](),controller[_0xb0ea('0x10')]);router[_0xb0ea('0x11')](_0xb0ea('0xa'),auth['isAuthenticated'](),controller[_0xb0ea('0x12')]);router['delete'](_0xb0ea('0x13'),auth[_0xb0ea('0x8')](),controller[_0xb0ea('0x14')]);module[_0xb0ea('0x15')]=router;
\ No newline at end of file
+var _0x35f5=['index','get','/:id','show','/:id/sounds','post','create','addSound','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','isAuthenticated'];(function(_0x57fced,_0x42d2e6){var _0x2bc213=function(_0x1686ba){while(--_0x1686ba){_0x57fced['push'](_0x57fced['shift']());}};_0x2bc213(++_0x42d2e6);}(_0x35f5,0x1b1));var _0x535f=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0x35f5[_0x59342a];return _0x17abc9;};'use strict';var multer=require(_0x535f('0x0'));var util=require(_0x535f('0x1'));var path=require('path');var timeout=require(_0x535f('0x2'));var express=require(_0x535f('0x3'));var router=express['Router']();var fs_extra=require(_0x535f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x535f('0x5'));var config=require('../../config/environment');var controller=require(_0x535f('0x6'));router['get']('/',auth[_0x535f('0x7')](),controller[_0x535f('0x8')]);router[_0x535f('0x9')](_0x535f('0xa'),auth[_0x535f('0x7')](),controller[_0x535f('0xb')]);router[_0x535f('0x9')](_0x535f('0xc'),auth[_0x535f('0x7')](),controller['getSounds']);router[_0x535f('0xd')]('/',auth[_0x535f('0x7')](),controller[_0x535f('0xe')]);router[_0x535f('0xd')](_0x535f('0xc'),auth[_0x535f('0x7')](),controller[_0x535f('0xf')]);router['put']('/:id',auth[_0x535f('0x7')](),controller['update']);router[_0x535f('0x10')](_0x535f('0xa'),auth['isAuthenticated'](),controller[_0x535f('0x11')]);router[_0x535f('0x10')](_0x535f('0x12'),auth[_0x535f('0x7')](),controller[_0x535f('0x13')]);module[_0x535f('0x14')]=router;
\ No newline at end of file
index 3c24b85..b58240e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a1d=['quietmp3','mp3','files','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','quietmp3nb'];(function(_0x179b94,_0x1fac1f){var _0x583a09=function(_0x577f82){while(--_0x577f82){_0x179b94['push'](_0x179b94['shift']());}};_0x583a09(++_0x1fac1f);}(_0x3a1d,0x101));var _0xd3a1=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x3a1d[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0xd3a1('0x0'));module[_0xd3a1('0x1')]={'name':{'type':Sequelize[_0xd3a1('0x2')],'allowNull':![],'unique':_0xd3a1('0x3')},'mode':{'type':Sequelize[_0xd3a1('0x4')](_0xd3a1('0x5'),'files','mp3nb',_0xd3a1('0x6'),_0xd3a1('0x7'),_0xd3a1('0x8')),'allowNull':!![],'defaultValue':_0xd3a1('0x9')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xd3a1('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xd3a1('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xd3a1('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xd3a1('0x2')],'allowNull':!![]},'stamp':{'type':_0xd3a1('0xa')},'defaultEntry':{'type':Sequelize[_0xd3a1('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0c4f=['mp3nb','quietmp3nb','quietmp3','mp3','alpha','sequelize','exports','STRING','name','ENUM','files'];(function(_0x2c4d22,_0x4ca120){var _0x1f0537=function(_0x2374a9){while(--_0x2374a9){_0x2c4d22['push'](_0x2c4d22['shift']());}};_0x1f0537(++_0x4ca120);}(_0x0c4f,0xd6));var _0xf0c4=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x0c4f[_0x334fea];return _0x3c5829;};'use strict';var Sequelize=require(_0xf0c4('0x0'));module[_0xf0c4('0x1')]={'name':{'type':Sequelize[_0xf0c4('0x2')],'allowNull':![],'unique':_0xf0c4('0x3')},'mode':{'type':Sequelize[_0xf0c4('0x4')]('custom',_0xf0c4('0x5'),_0xf0c4('0x6'),_0xf0c4('0x7'),_0xf0c4('0x8'),_0xf0c4('0x9')),'allowNull':!![],'defaultValue':_0xf0c4('0x5')},'directory':{'type':Sequelize[_0xf0c4('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xf0c4('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf0c4('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf0c4('0xa')},'format':{'type':Sequelize[_0xf0c4('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index f32eb80..a535437 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8793=['mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','join','Sequelize','ValidationError','message','addSound','findOne','converted_format','format','basename','save_name','extname','server/files/moh','%s.%s','removeSound','id2','Sound','createdAt','getSounds','nolimit','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','MusicOnHolds','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','filters','length','include','body','find','create','sequelize','transaction','mode','files','directory','root'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x8793,0x1d1));var _0x3879=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x8793[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0x3879('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3879('0x1'));var jsonpatch=require(_0x3879('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3879('0x3'));var Mustache=require(_0x3879('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3879('0x5'));var csv=require('to-csv');var ejs=require(_0x3879('0x6'));var fs=require('fs');var fs_extra=require(_0x3879('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3879('0x8'));var jsforce=require(_0x3879('0x9'));var deskjs=require(_0x3879('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3879('0xb'));var Papa=require(_0x3879('0xc'));var Redis=require(_0x3879('0xd'));var authService=require(_0x3879('0xe'));var qs=require(_0x3879('0xf'));var as=require(_0x3879('0x10'));var hardwareService=require(_0x3879('0x11'));var logger=require(_0x3879('0x12'))('api');var utils=require(_0x3879('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3879('0x14'))['db'];function respondWithStatusCode(_0x10cfe6,_0x427ccc){_0x427ccc=_0x427ccc||0xcc;return function(_0x3503cd){if(_0x3503cd){return _0x10cfe6[_0x3879('0x15')](_0x427ccc);}return _0x10cfe6['status'](_0x427ccc)[_0x3879('0x16')]();};}function respondWithResult(_0x33a57a,_0x30f6e5){_0x30f6e5=_0x30f6e5||0xc8;return function(_0x398655){if(_0x398655){return _0x33a57a[_0x3879('0x17')](_0x30f6e5)[_0x3879('0x18')](_0x398655);}};}function respondWithFilteredResult(_0x4691ea,_0x8bc451){return function(_0x2ec0d9){if(_0x2ec0d9){var _0x4b235f=typeof _0x8bc451[_0x3879('0x19')]==='undefined'&&typeof _0x8bc451[_0x3879('0x1a')]==='undefined';var _0x1efe87=_0x2ec0d9['count'];var _0x32f388=_0x4b235f?0x0:_0x8bc451[_0x3879('0x19')];var _0x460ad7=_0x4b235f?_0x2ec0d9[_0x3879('0x1b')]:_0x8bc451[_0x3879('0x19')]+_0x8bc451[_0x3879('0x1a')];var _0xaa765a;if(_0x460ad7>=_0x1efe87){_0x460ad7=_0x1efe87;_0xaa765a=0xc8;}else{_0xaa765a=0xce;}_0x4691ea[_0x3879('0x17')](_0xaa765a);return _0x4691ea[_0x3879('0x1c')](_0x3879('0x1d'),_0x32f388+'-'+_0x460ad7+'/'+_0x1efe87)[_0x3879('0x18')](_0x2ec0d9);}return null;};}function patchUpdates(_0x3d2846){return function(_0x1330d7){try{jsonpatch[_0x3879('0x1e')](_0x1330d7,_0x3d2846,!![]);}catch(_0x54095c){return BPromise[_0x3879('0x1f')](_0x54095c);}return _0x1330d7[_0x3879('0x20')]();};}function saveUpdates(_0x5bbbf8,_0x3fe9ba){return function(_0x24580f){if(_0x24580f){return _0x24580f['update'](_0x5bbbf8)['then'](function(_0x53a899){return _0x53a899;});}return null;};}function removeEntity(_0x53f27b,_0x227feb){return function(_0xed286d){if(_0xed286d){return _0xed286d[_0x3879('0x21')]()[_0x3879('0x22')](function(){var _0x2ab36d=_0xed286d[_0x3879('0x23')]({'plain':!![]});var _0x353455=_0x3879('0x24');return db['UserProfileResource'][_0x3879('0x21')]({'where':{'type':_0x353455,'resourceId':_0x2ab36d['id']}})[_0x3879('0x22')](function(){return _0xed286d;});})[_0x3879('0x22')](function(){_0x53f27b[_0x3879('0x17')](0xcc)[_0x3879('0x16')]();});}};}function handleEntityNotFound(_0x139609,_0xaf618e){return function(_0x459587){if(!_0x459587){_0x139609[_0x3879('0x15')](0x194);}return _0x459587;};}function handleError(_0x1a11ae,_0xc3162c){_0xc3162c=_0xc3162c||0x1f4;return function(_0x20d5eb){logger[_0x3879('0x25')](_0x20d5eb[_0x3879('0x26')]);if(_0x20d5eb['name']){delete _0x20d5eb[_0x3879('0x27')];}_0x1a11ae['status'](_0xc3162c)[_0x3879('0x28')](_0x20d5eb);};}exports[_0x3879('0x29')]=function(_0x453f8e,_0x59ca43){var _0x214eac={},_0x538597={},_0x5d4e72={'count':0x0,'rows':[]};var _0x2919fa=_[_0x3879('0x2a')](db[_0x3879('0x2b')][_0x3879('0x2c')],function(_0x23ddcc){return{'name':_0x23ddcc['fieldName'],'type':_0x23ddcc[_0x3879('0x2d')][_0x3879('0x2e')]};});_0x538597[_0x3879('0x2f')]=_['map'](_0x2919fa,_0x3879('0x27'));_0x538597[_0x3879('0x30')]=_[_0x3879('0x31')](_0x453f8e[_0x3879('0x30')]);_0x538597['filters']=_[_0x3879('0x32')](_0x538597[_0x3879('0x2f')],_0x538597['query']);_0x214eac[_0x3879('0x33')]=_[_0x3879('0x32')](_0x538597[_0x3879('0x2f')],qs[_0x3879('0x34')](_0x453f8e[_0x3879('0x30')][_0x3879('0x34')]));_0x214eac[_0x3879('0x33')]=_0x214eac[_0x3879('0x33')]['length']?_0x214eac[_0x3879('0x33')]:_0x538597[_0x3879('0x2f')];if(!_0x453f8e[_0x3879('0x30')][_0x3879('0x35')]('nolimit')){_0x214eac['limit']=qs[_0x3879('0x1a')](_0x453f8e[_0x3879('0x30')]['limit']);_0x214eac['offset']=qs[_0x3879('0x19')](_0x453f8e[_0x3879('0x30')][_0x3879('0x19')]);}_0x214eac[_0x3879('0x36')]=qs[_0x3879('0x37')](_0x453f8e['query'][_0x3879('0x37')]);delete _0x453f8e['query'][_0x3879('0x37')];_0x214eac[_0x3879('0x38')]=qs['filters'](_[_0x3879('0x39')](_0x453f8e[_0x3879('0x30')],_0x538597['filters']),_0x2919fa);if(_0x453f8e[_0x3879('0x30')][_0x3879('0x3a')]){_0x214eac[_0x3879('0x38')]=_[_0x3879('0x3b')](_0x214eac['where'],{'$or':_[_0x3879('0x2a')](_0x2919fa,function(_0x4a76e8){if(_0x4a76e8[_0x3879('0x2d')]!==_0x3879('0x3c')){var _0x275351={};_0x275351[_0x4a76e8[_0x3879('0x27')]]={'$like':'%'+_0x453f8e[_0x3879('0x30')][_0x3879('0x3a')]+'%'};return _0x275351;}})});}_0x214eac=_[_0x3879('0x3b')]({},_0x214eac,_0x453f8e[_0x3879('0x3d')]);var _0x5e8a77={'where':_0x214eac[_0x3879('0x38')]};return db[_0x3879('0x2b')][_0x3879('0x1b')](_0x5e8a77)['then'](function(_0x1c0355){_0x5d4e72[_0x3879('0x1b')]=_0x1c0355;if(_0x453f8e['query'][_0x3879('0x3e')]){_0x214eac['include']=[{'all':!![]}];}return db[_0x3879('0x2b')][_0x3879('0x3f')](_0x214eac);})[_0x3879('0x22')](function(_0x1e7b22){_0x5d4e72[_0x3879('0x40')]=_0x1e7b22;return _0x5d4e72;})[_0x3879('0x22')](respondWithFilteredResult(_0x59ca43,_0x214eac))[_0x3879('0x41')](handleError(_0x59ca43,null));};exports[_0x3879('0x42')]=function(_0x3f6834,_0x25cac3){var _0x2f9a2d={'raw':![],'where':{'id':_0x3f6834[_0x3879('0x43')]['id']}},_0x217b30={};_0x217b30[_0x3879('0x2f')]=_['keys'](db['VoiceMusicOnHold'][_0x3879('0x2c')]);_0x217b30['query']=_['keys'](_0x3f6834[_0x3879('0x30')]);_0x217b30[_0x3879('0x44')]=_[_0x3879('0x32')](_0x217b30[_0x3879('0x2f')],_0x217b30['query']);_0x2f9a2d[_0x3879('0x33')]=_['intersection'](_0x217b30[_0x3879('0x2f')],qs[_0x3879('0x34')](_0x3f6834[_0x3879('0x30')][_0x3879('0x34')]));_0x2f9a2d[_0x3879('0x33')]=_0x2f9a2d['attributes'][_0x3879('0x45')]?_0x2f9a2d[_0x3879('0x33')]:_0x217b30[_0x3879('0x2f')];if(_0x3f6834['query'][_0x3879('0x3e')]){_0x2f9a2d[_0x3879('0x46')]=[{'all':!![]}];}_0x2f9a2d=_[_0x3879('0x3b')]({},_0x2f9a2d,_0x3f6834[_0x3879('0x3d')]);return db[_0x3879('0x2b')]['find'](_0x2f9a2d)[_0x3879('0x22')](handleEntityNotFound(_0x25cac3,null))[_0x3879('0x22')](respondWithResult(_0x25cac3,null))[_0x3879('0x41')](handleError(_0x25cac3,null));};exports['update']=function(_0x4eb4f5,_0x42222d){if(_0x4eb4f5[_0x3879('0x47')]['id']){delete _0x4eb4f5[_0x3879('0x47')]['id'];}return db[_0x3879('0x2b')][_0x3879('0x48')]({'where':{'id':_0x4eb4f5[_0x3879('0x43')]['id']}})[_0x3879('0x22')](handleEntityNotFound(_0x42222d,null))[_0x3879('0x22')](saveUpdates(_0x4eb4f5[_0x3879('0x47')],null))[_0x3879('0x22')](respondWithResult(_0x42222d,null))[_0x3879('0x41')](handleError(_0x42222d,null));};exports[_0x3879('0x49')]=function(_0x5d88eb,_0x3a6863,_0x402547){return db[_0x3879('0x4a')][_0x3879('0x4b')](function(_0x5cc5e3){if(_0x5d88eb[_0x3879('0x47')][_0x3879('0x4c')]===_0x3879('0x4d')){_0x5d88eb[_0x3879('0x47')][_0x3879('0x4e')]=path['join'](config[_0x3879('0x4f')],'server/files/moh',_0x5d88eb[_0x3879('0x47')][_0x3879('0x27')]);}return db[_0x3879('0x2b')][_0x3879('0x49')](_0x5d88eb['body'],{'transaction':_0x5cc5e3})[_0x3879('0x22')](function(_0x3ed47a){if(_0x5d88eb[_0x3879('0x47')][_0x3879('0x4c')]===_0x3879('0x4d')){fs[_0x3879('0x50')](_0x3ed47a[_0x3879('0x4e')],parseInt('0777',0x8));}var _0x44e62f=_0x5d88eb[_0x3879('0x51')][_0x3879('0x23')]({'plain':!![]});if(!_0x44e62f)throw new Error(_0x3879('0x52'));if(_0x44e62f[_0x3879('0x53')]===_0x3879('0x51')){var _0x2ab8e1=_0x3ed47a[_0x3879('0x23')]({'plain':!![]});return db[_0x3879('0x54')][_0x3879('0x48')]({'where':{'name':'MusicOnHolds','userProfileId':_0x44e62f[_0x3879('0x55')]},'raw':!![]})[_0x3879('0x22')](function(_0x349526){if(_0x349526&&_0x349526['autoAssociation']===0x0){return db[_0x3879('0x56')][_0x3879('0x49')]({'name':_0x2ab8e1[_0x3879('0x27')],'resourceId':_0x2ab8e1['id'],'type':_0x349526[_0x3879('0x27')],'sectionId':_0x349526['id']},{})['then'](function(){return _0x3ed47a;});}else{return _0x3ed47a;}})['catch'](function(_0x119e0a){logger['error'](_0x3879('0x57'),_0x119e0a);});}return _0x3ed47a;});})[_0x3879('0x22')](respondWithResult(_0x3a6863,0xc9))[_0x3879('0x41')](handleError(_0x3a6863,null));};exports[_0x3879('0x21')]=function(_0x39e983,_0x2d5ff2,_0x10f85a){var _0x13b349;return db[_0x3879('0x2b')][_0x3879('0x48')]({'where':{'id':_0x39e983[_0x3879('0x43')]['id']}})[_0x3879('0x22')](function(_0x1904a0){if(_0x1904a0){return db[_0x3879('0x4a')][_0x3879('0x4b')](function(_0x28f43b){return _0x1904a0[_0x3879('0x21')]({'transaction':_0x28f43b,'raw':!![]})['then'](function(_0x1d2d4e){if(_0x1d2d4e['directory']){fs[_0x3879('0x58')](_0x1d2d4e[_0x3879('0x4e')])['forEach'](function(_0x40657f){fs[_0x3879('0x59')](path[_0x3879('0x5a')](_0x1d2d4e['directory'],_0x40657f));});fs['rmdirSync'](_0x1d2d4e['directory']);}return _0x1d2d4e;});})[_0x3879('0x41')](function(_0x585737){throw new db[(_0x3879('0x5b'))][(_0x3879('0x5c'))](_0x585737[_0x3879('0x5d')]);});}})[_0x3879('0x22')](handleEntityNotFound(_0x2d5ff2,null))[_0x3879('0x22')](removeEntity(_0x2d5ff2,null))[_0x3879('0x41')](handleError(_0x2d5ff2,null));};exports[_0x3879('0x5e')]=function(_0x16594d,_0x3fe471,_0x332277){return db[_0x3879('0x4a')][_0x3879('0x4b')](function(_0x2b95c1){var _0x198afe;return db['VoiceMusicOnHold'][_0x3879('0x48')]({'where':{'id':_0x16594d[_0x3879('0x43')]['id']}})['then'](function(_0x50982c){if(_0x50982c){_0x198afe=_0x50982c;return _0x50982c[_0x3879('0x5e')](_0x16594d[_0x3879('0x47')]['id'],{'transaction':_0x2b95c1});}})[_0x3879('0x22')](function(_0x3a4db9){if(_0x3a4db9){return db['Sound'][_0x3879('0x5f')]({'where':{'id':_0x16594d[_0x3879('0x47')]['id']},'attributes':['id',_0x3879('0x27'),'save_name',_0x3879('0x60'),'createdAt'],'raw':!![]});}})[_0x3879('0x22')](function(_0x3a8366){if(_0x3a8366){var _0xf4f234=path['join'](config['root'],'server/files/sounds/converted',util[_0x3879('0x61')]('%s.%s',path[_0x3879('0x62')](_0x3a8366[_0x3879('0x63')],path[_0x3879('0x64')](_0x3a8366[_0x3879('0x63')])),_0x3a8366['converted_format']));var _0x12ad31=path[_0x3879('0x5a')](config['root'],_0x3879('0x65'),_0x198afe['name'],util[_0x3879('0x61')](_0x3879('0x66'),_0x3a8366[_0x3879('0x27')],_0x3a8366[_0x3879('0x60')]));fs['symlinkSync'](_0xf4f234,_0x12ad31);return _0x3a8366;}})[_0x3879('0x41')](function(_0xe0e1f9){throw new db[(_0x3879('0x5b'))][(_0x3879('0x5c'))](_0xe0e1f9[_0x3879('0x5d')]);});})['then'](handleEntityNotFound(_0x3fe471,null))[_0x3879('0x22')](respondWithResult(_0x3fe471,0xc9))[_0x3879('0x41')](handleError(_0x3fe471,null));};exports[_0x3879('0x67')]=function(_0x76fc73,_0x72b18b,_0x1c918e){return db[_0x3879('0x4a')][_0x3879('0x4b')](function(_0x1aade3){var _0x1e9785;return db[_0x3879('0x2b')][_0x3879('0x5f')]({'where':{'id':_0x76fc73[_0x3879('0x43')]['id']}})[_0x3879('0x22')](handleEntityNotFound(_0x72b18b,null))['then'](function(_0x27ca99){if(_0x27ca99){_0x1e9785=_0x27ca99;return _0x27ca99[_0x3879('0x67')](_0x76fc73[_0x3879('0x43')][_0x3879('0x68')]);}})['then'](function(_0x21249a){if(_0x21249a){return db[_0x3879('0x69')][_0x3879('0x5f')]({'where':{'id':_0x76fc73[_0x3879('0x43')][_0x3879('0x68')]},'attributes':['id',_0x3879('0x27'),'save_name',_0x3879('0x60'),_0x3879('0x6a')],'raw':!![]});}})[_0x3879('0x22')](function(_0x2ca526){if(_0x2ca526){fs[_0x3879('0x59')](path['join'](_0x1e9785[_0x3879('0x4e')],util[_0x3879('0x61')]('%s.%s',_0x2ca526[_0x3879('0x27')],_0x2ca526['converted_format'])));return _0x2ca526;}})[_0x3879('0x41')](function(_0xf489e9){throw new db[(_0x3879('0x5b'))][(_0x3879('0x5c'))](_0xf489e9['message']);});})['then'](handleEntityNotFound(_0x72b18b,null))[_0x3879('0x22')](respondWithStatusCode(_0x72b18b,0xcc))[_0x3879('0x41')](handleError(_0x72b18b,null));};exports[_0x3879('0x6b')]=function(_0x3f7217,_0x4b90a5,_0x179dbb){var _0x2b7d74={};var _0x350af0={};var _0x57883e;var _0x4e8ef4;return db['VoiceMusicOnHold'][_0x3879('0x5f')]({'where':{'id':_0x3f7217[_0x3879('0x43')]['id']}})[_0x3879('0x22')](handleEntityNotFound(_0x4b90a5,null))['then'](function(_0x10036e){if(_0x10036e){_0x57883e=_0x10036e;_0x350af0[_0x3879('0x2f')]=_[_0x3879('0x31')](db[_0x3879('0x69')]['rawAttributes']);_0x350af0['query']=_[_0x3879('0x31')](_0x3f7217[_0x3879('0x30')]);_0x350af0[_0x3879('0x44')]=_['intersection'](_0x350af0[_0x3879('0x2f')],_0x350af0[_0x3879('0x30')]);_0x2b7d74['attributes']=_[_0x3879('0x32')](_0x350af0[_0x3879('0x2f')],qs[_0x3879('0x34')](_0x3f7217[_0x3879('0x30')]['fields']));_0x2b7d74[_0x3879('0x33')]=_0x2b7d74[_0x3879('0x33')][_0x3879('0x45')]?_0x2b7d74[_0x3879('0x33')]:_0x350af0[_0x3879('0x2f')];_0x2b7d74[_0x3879('0x36')]=qs[_0x3879('0x37')](_0x3f7217[_0x3879('0x30')][_0x3879('0x37')]);_0x2b7d74['where']=qs[_0x3879('0x44')](_[_0x3879('0x39')](_0x3f7217[_0x3879('0x30')],_0x350af0[_0x3879('0x44')]));if(_0x3f7217['query'][_0x3879('0x3a')]){_0x2b7d74[_0x3879('0x38')]=_[_0x3879('0x3b')](_0x2b7d74['where'],{'$or':_[_0x3879('0x2a')](_0x2b7d74[_0x3879('0x33')],function(_0x3aaa3b){var _0x4221e2={};_0x4221e2[_0x3aaa3b]={'$like':'%'+_0x3f7217[_0x3879('0x30')]['filter']+'%'};return _0x4221e2;})});}_0x2b7d74=_[_0x3879('0x3b')]({},_0x2b7d74,_0x3f7217[_0x3879('0x3d')]);return _0x57883e[_0x3879('0x6b')](_0x2b7d74);}})[_0x3879('0x22')](function(_0x4ab1fc){if(_0x4ab1fc){_0x4e8ef4=_0x4ab1fc[_0x3879('0x45')];if(!_0x3f7217[_0x3879('0x30')][_0x3879('0x35')](_0x3879('0x6c'))){_0x2b7d74[_0x3879('0x1a')]=qs[_0x3879('0x1a')](_0x3f7217[_0x3879('0x30')][_0x3879('0x1a')]);_0x2b7d74[_0x3879('0x19')]=qs[_0x3879('0x19')](_0x3f7217['query'][_0x3879('0x19')]);}return _0x57883e[_0x3879('0x6b')](_0x2b7d74);}})[_0x3879('0x22')](function(_0x5c3191){if(_0x5c3191){return _0x5c3191?{'count':_0x4e8ef4,'rows':_0x5c3191}:null;}})[_0x3879('0x22')](respondWithResult(_0x4b90a5,null))[_0x3879('0x41')](handleError(_0x4b90a5,null));};
\ No newline at end of file
+var _0x784c=['includeAll','include','rows','catch','show','body','params','create','sequelize','transaction','mode','files','join','root','server/files/moh','mkdirSync','directory','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','ValidationError','message','addSound','find','Sound','findOne','save_name','converted_format','format','%s.%s','symlinkSync','Sequelize','removeSound','id2','unlinkSync','getSounds','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','get','MusicOnHolds','end','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','VoiceMusicOnHold'];(function(_0x3f4bc1,_0x15ace5){var _0x46fcf6=function(_0x3a19c1){while(--_0x3a19c1){_0x3f4bc1['push'](_0x3f4bc1['shift']());}};_0x46fcf6(++_0x15ace5);}(_0x784c,0x1e7));var _0xc784=function(_0x438391,_0x11718b){_0x438391=_0x438391-0x0;var _0x41a66f=_0x784c[_0x438391];return _0x41a66f;};'use strict';var emlformat=require(_0xc784('0x0'));var rimraf=require(_0xc784('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc784('0x2'));var rp=require(_0xc784('0x3'));var moment=require('moment');var BPromise=require(_0xc784('0x4'));var Mustache=require('mustache');var util=require(_0xc784('0x5'));var path=require(_0xc784('0x6'));var sox=require(_0xc784('0x7'));var csv=require(_0xc784('0x8'));var ejs=require(_0xc784('0x9'));var fs=require('fs');var fs_extra=require(_0xc784('0xa'));var _=require(_0xc784('0xb'));var squel=require('squel');var crypto=require(_0xc784('0xc'));var jsforce=require(_0xc784('0xd'));var deskjs=require(_0xc784('0xe'));var toCsv=require(_0xc784('0x8'));var querystring=require('querystring');var Papa=require(_0xc784('0xf'));var Redis=require('ioredis');var authService=require(_0xc784('0x10'));var qs=require(_0xc784('0x11'));var as=require(_0xc784('0x12'));var hardwareService=require(_0xc784('0x13'));var logger=require(_0xc784('0x14'))('api');var utils=require(_0xc784('0x15'));var config=require(_0xc784('0x16'));var licenseUtil=require(_0xc784('0x17'));var db=require(_0xc784('0x18'))['db'];function respondWithStatusCode(_0x4989a8,_0x4672b1){_0x4672b1=_0x4672b1||0xcc;return function(_0x29c73b){if(_0x29c73b){return _0x4989a8[_0xc784('0x19')](_0x4672b1);}return _0x4989a8[_0xc784('0x1a')](_0x4672b1)['end']();};}function respondWithResult(_0x48ab52,_0x5b4d09){_0x5b4d09=_0x5b4d09||0xc8;return function(_0xe9fbea){if(_0xe9fbea){return _0x48ab52[_0xc784('0x1a')](_0x5b4d09)[_0xc784('0x1b')](_0xe9fbea);}};}function respondWithFilteredResult(_0x5f5167,_0x13d286){return function(_0x3ce560){if(_0x3ce560){var _0x25e2b7=typeof _0x13d286[_0xc784('0x1c')]===_0xc784('0x1d')&&typeof _0x13d286['limit']===_0xc784('0x1d');var _0x46c0d4=_0x3ce560[_0xc784('0x1e')];var _0x1bba0b=_0x25e2b7?0x0:_0x13d286['offset'];var _0xc348fe=_0x25e2b7?_0x3ce560[_0xc784('0x1e')]:_0x13d286[_0xc784('0x1c')]+_0x13d286[_0xc784('0x1f')];var _0x51a5d6;if(_0xc348fe>=_0x46c0d4){_0xc348fe=_0x46c0d4;_0x51a5d6=0xc8;}else{_0x51a5d6=0xce;}_0x5f5167[_0xc784('0x1a')](_0x51a5d6);return _0x5f5167[_0xc784('0x20')](_0xc784('0x21'),_0x1bba0b+'-'+_0xc348fe+'/'+_0x46c0d4)[_0xc784('0x1b')](_0x3ce560);}return null;};}function patchUpdates(_0x2deaeb){return function(_0x5518fc){try{jsonpatch['apply'](_0x5518fc,_0x2deaeb,!![]);}catch(_0x9b0937){return BPromise[_0xc784('0x22')](_0x9b0937);}return _0x5518fc['save']();};}function saveUpdates(_0x36b533,_0x991153){return function(_0x8c1687){if(_0x8c1687){return _0x8c1687[_0xc784('0x23')](_0x36b533)['then'](function(_0x4aaacd){return _0x4aaacd;});}return null;};}function removeEntity(_0x271c8b,_0x25f375){return function(_0x183d8b){if(_0x183d8b){return _0x183d8b[_0xc784('0x24')]()[_0xc784('0x25')](function(){var _0x583969=_0x183d8b[_0xc784('0x26')]({'plain':!![]});var _0x3f9797=_0xc784('0x27');return db['UserProfileResource'][_0xc784('0x24')]({'where':{'type':_0x3f9797,'resourceId':_0x583969['id']}})[_0xc784('0x25')](function(){return _0x183d8b;});})[_0xc784('0x25')](function(){_0x271c8b['status'](0xcc)[_0xc784('0x28')]();});}};}function handleEntityNotFound(_0x5adbaf,_0x3febf7){return function(_0x52e707){if(!_0x52e707){_0x5adbaf[_0xc784('0x19')](0x194);}return _0x52e707;};}function handleError(_0x4e62e9,_0x25dbfc){_0x25dbfc=_0x25dbfc||0x1f4;return function(_0x24c3d1){logger[_0xc784('0x29')](_0x24c3d1['stack']);if(_0x24c3d1['name']){delete _0x24c3d1[_0xc784('0x2a')];}_0x4e62e9['status'](_0x25dbfc)[_0xc784('0x2b')](_0x24c3d1);};}exports[_0xc784('0x2c')]=function(_0xd603af,_0x3a738a){var _0x43ba1e={},_0x460dd2={},_0x27caad={'count':0x0,'rows':[]};var _0x51b688=_[_0xc784('0x2d')](db['VoiceMusicOnHold'][_0xc784('0x2e')],function(_0x3a0cc9){return{'name':_0x3a0cc9[_0xc784('0x2f')],'type':_0x3a0cc9[_0xc784('0x30')][_0xc784('0x31')]};});_0x460dd2['model']=_['map'](_0x51b688,_0xc784('0x2a'));_0x460dd2[_0xc784('0x32')]=_[_0xc784('0x33')](_0xd603af[_0xc784('0x32')]);_0x460dd2['filters']=_[_0xc784('0x34')](_0x460dd2['model'],_0x460dd2[_0xc784('0x32')]);_0x43ba1e['attributes']=_[_0xc784('0x34')](_0x460dd2[_0xc784('0x35')],qs[_0xc784('0x36')](_0xd603af['query'][_0xc784('0x36')]));_0x43ba1e[_0xc784('0x37')]=_0x43ba1e[_0xc784('0x37')][_0xc784('0x38')]?_0x43ba1e[_0xc784('0x37')]:_0x460dd2[_0xc784('0x35')];if(!_0xd603af['query'][_0xc784('0x39')](_0xc784('0x3a'))){_0x43ba1e[_0xc784('0x1f')]=qs['limit'](_0xd603af[_0xc784('0x32')][_0xc784('0x1f')]);_0x43ba1e[_0xc784('0x1c')]=qs['offset'](_0xd603af[_0xc784('0x32')][_0xc784('0x1c')]);}_0x43ba1e[_0xc784('0x3b')]=qs[_0xc784('0x3c')](_0xd603af[_0xc784('0x32')][_0xc784('0x3c')]);delete _0xd603af[_0xc784('0x32')][_0xc784('0x3c')];_0x43ba1e[_0xc784('0x3d')]=qs[_0xc784('0x3e')](_[_0xc784('0x3f')](_0xd603af['query'],_0x460dd2['filters']),_0x51b688);if(_0xd603af[_0xc784('0x32')][_0xc784('0x40')]){_0x43ba1e['where']=_['merge'](_0x43ba1e[_0xc784('0x3d')],{'$or':_[_0xc784('0x2d')](_0x51b688,function(_0x1eda64){if(_0x1eda64[_0xc784('0x30')]!=='VIRTUAL'){var _0x429652={};_0x429652[_0x1eda64[_0xc784('0x2a')]]={'$like':'%'+_0xd603af['query']['filter']+'%'};return _0x429652;}})});}_0x43ba1e=_[_0xc784('0x41')]({},_0x43ba1e,_0xd603af[_0xc784('0x42')]);var _0x13e462={'where':_0x43ba1e['where']};return db[_0xc784('0x43')]['count'](_0x13e462)['then'](function(_0x33d818){_0x27caad[_0xc784('0x1e')]=_0x33d818;if(_0xd603af[_0xc784('0x32')][_0xc784('0x44')]){_0x43ba1e[_0xc784('0x45')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x43ba1e);})['then'](function(_0x147203){_0x27caad[_0xc784('0x46')]=_0x147203;return _0x27caad;})[_0xc784('0x25')](respondWithFilteredResult(_0x3a738a,_0x43ba1e))[_0xc784('0x47')](handleError(_0x3a738a,null));};exports[_0xc784('0x48')]=function(_0x48db30,_0x1487b2){var _0x3eb6ce={'raw':![],'where':{'id':_0x48db30['params']['id']}},_0x16cf37={};_0x16cf37[_0xc784('0x35')]=_[_0xc784('0x33')](db[_0xc784('0x43')]['rawAttributes']);_0x16cf37[_0xc784('0x32')]=_[_0xc784('0x33')](_0x48db30[_0xc784('0x32')]);_0x16cf37[_0xc784('0x3e')]=_[_0xc784('0x34')](_0x16cf37[_0xc784('0x35')],_0x16cf37[_0xc784('0x32')]);_0x3eb6ce[_0xc784('0x37')]=_[_0xc784('0x34')](_0x16cf37[_0xc784('0x35')],qs[_0xc784('0x36')](_0x48db30['query'][_0xc784('0x36')]));_0x3eb6ce[_0xc784('0x37')]=_0x3eb6ce[_0xc784('0x37')][_0xc784('0x38')]?_0x3eb6ce[_0xc784('0x37')]:_0x16cf37['model'];if(_0x48db30[_0xc784('0x32')][_0xc784('0x44')]){_0x3eb6ce['include']=[{'all':!![]}];}_0x3eb6ce=_[_0xc784('0x41')]({},_0x3eb6ce,_0x48db30[_0xc784('0x42')]);return db[_0xc784('0x43')]['find'](_0x3eb6ce)[_0xc784('0x25')](handleEntityNotFound(_0x1487b2,null))[_0xc784('0x25')](respondWithResult(_0x1487b2,null))['catch'](handleError(_0x1487b2,null));};exports['update']=function(_0x3af0ee,_0x3e5bf9){if(_0x3af0ee[_0xc784('0x49')]['id']){delete _0x3af0ee[_0xc784('0x49')]['id'];}return db[_0xc784('0x43')]['find']({'where':{'id':_0x3af0ee[_0xc784('0x4a')]['id']}})[_0xc784('0x25')](handleEntityNotFound(_0x3e5bf9,null))[_0xc784('0x25')](saveUpdates(_0x3af0ee[_0xc784('0x49')],null))['then'](respondWithResult(_0x3e5bf9,null))['catch'](handleError(_0x3e5bf9,null));};exports[_0xc784('0x4b')]=function(_0x27c045,_0x171140,_0x3e23fd){return db[_0xc784('0x4c')][_0xc784('0x4d')](function(_0x2249b9){if(_0x27c045['body'][_0xc784('0x4e')]===_0xc784('0x4f')){_0x27c045[_0xc784('0x49')]['directory']=path[_0xc784('0x50')](config[_0xc784('0x51')],_0xc784('0x52'),_0x27c045[_0xc784('0x49')][_0xc784('0x2a')]);}return db[_0xc784('0x43')][_0xc784('0x4b')](_0x27c045[_0xc784('0x49')],{'transaction':_0x2249b9})[_0xc784('0x25')](function(_0x55afc3){if(_0x27c045[_0xc784('0x49')][_0xc784('0x4e')]===_0xc784('0x4f')){fs[_0xc784('0x53')](_0x55afc3[_0xc784('0x54')],parseInt('0777',0x8));}var _0x1f572e=_0x27c045[_0xc784('0x55')]['get']({'plain':!![]});if(!_0x1f572e)throw new Error(_0xc784('0x56'));if(_0x1f572e[_0xc784('0x57')]===_0xc784('0x55')){var _0xfc5bf9=_0x55afc3[_0xc784('0x26')]({'plain':!![]});return db[_0xc784('0x58')]['find']({'where':{'name':_0xc784('0x27'),'userProfileId':_0x1f572e[_0xc784('0x59')]},'raw':!![]})[_0xc784('0x25')](function(_0x1b4cc5){if(_0x1b4cc5&&_0x1b4cc5[_0xc784('0x5a')]===0x0){return db['UserProfileResource'][_0xc784('0x4b')]({'name':_0xfc5bf9[_0xc784('0x2a')],'resourceId':_0xfc5bf9['id'],'type':_0x1b4cc5[_0xc784('0x2a')],'sectionId':_0x1b4cc5['id']},{})[_0xc784('0x25')](function(){return _0x55afc3;});}else{return _0x55afc3;}})[_0xc784('0x47')](function(_0x3b2f59){logger[_0xc784('0x29')](_0xc784('0x5b'),_0x3b2f59);});}return _0x55afc3;});})[_0xc784('0x25')](respondWithResult(_0x171140,0xc9))[_0xc784('0x47')](handleError(_0x171140,null));};exports[_0xc784('0x24')]=function(_0x3a6093,_0x172e08,_0x3fb215){var _0x3d90a7;return db[_0xc784('0x43')]['find']({'where':{'id':_0x3a6093[_0xc784('0x4a')]['id']}})[_0xc784('0x25')](function(_0x5692a3){if(_0x5692a3){return db['sequelize'][_0xc784('0x4d')](function(_0x17ebff){return _0x5692a3[_0xc784('0x24')]({'transaction':_0x17ebff,'raw':!![]})[_0xc784('0x25')](function(_0x4692bd){if(_0x4692bd['directory']){fs[_0xc784('0x5c')](_0x4692bd[_0xc784('0x54')])[_0xc784('0x5d')](function(_0x2d3b82){fs['unlinkSync'](path[_0xc784('0x50')](_0x4692bd[_0xc784('0x54')],_0x2d3b82));});fs[_0xc784('0x5e')](_0x4692bd['directory']);}return _0x4692bd;});})[_0xc784('0x47')](function(_0x41eea8){throw new db['Sequelize'][(_0xc784('0x5f'))](_0x41eea8[_0xc784('0x60')]);});}})[_0xc784('0x25')](handleEntityNotFound(_0x172e08,null))['then'](removeEntity(_0x172e08,null))[_0xc784('0x47')](handleError(_0x172e08,null));};exports[_0xc784('0x61')]=function(_0x399d92,_0x2cffbe,_0x50ddf8){return db[_0xc784('0x4c')][_0xc784('0x4d')](function(_0x205a78){var _0x300691;return db['VoiceMusicOnHold'][_0xc784('0x62')]({'where':{'id':_0x399d92[_0xc784('0x4a')]['id']}})[_0xc784('0x25')](function(_0x8d621){if(_0x8d621){_0x300691=_0x8d621;return _0x8d621['addSound'](_0x399d92[_0xc784('0x49')]['id'],{'transaction':_0x205a78});}})[_0xc784('0x25')](function(_0x556cd7){if(_0x556cd7){return db[_0xc784('0x63')][_0xc784('0x64')]({'where':{'id':_0x399d92[_0xc784('0x49')]['id']},'attributes':['id',_0xc784('0x2a'),_0xc784('0x65'),_0xc784('0x66'),'createdAt'],'raw':!![]});}})[_0xc784('0x25')](function(_0x355c0f){if(_0x355c0f){var _0x161aaa=path[_0xc784('0x50')](config[_0xc784('0x51')],'server/files/sounds/converted',util[_0xc784('0x67')](_0xc784('0x68'),path['basename'](_0x355c0f[_0xc784('0x65')],path['extname'](_0x355c0f[_0xc784('0x65')])),_0x355c0f['converted_format']));var _0x21016f=path['join'](config[_0xc784('0x51')],_0xc784('0x52'),_0x300691[_0xc784('0x2a')],util['format']('%s.%s',_0x355c0f['name'],_0x355c0f[_0xc784('0x66')]));fs[_0xc784('0x69')](_0x161aaa,_0x21016f);return _0x355c0f;}})['catch'](function(_0x188452){throw new db[(_0xc784('0x6a'))]['ValidationError'](_0x188452[_0xc784('0x60')]);});})['then'](handleEntityNotFound(_0x2cffbe,null))[_0xc784('0x25')](respondWithResult(_0x2cffbe,0xc9))['catch'](handleError(_0x2cffbe,null));};exports[_0xc784('0x6b')]=function(_0x2473ee,_0x43a7ae,_0x461978){return db[_0xc784('0x4c')][_0xc784('0x4d')](function(_0x31dd1b){var _0x445e07;return db[_0xc784('0x43')]['findOne']({'where':{'id':_0x2473ee['params']['id']}})[_0xc784('0x25')](handleEntityNotFound(_0x43a7ae,null))[_0xc784('0x25')](function(_0x3ee4bc){if(_0x3ee4bc){_0x445e07=_0x3ee4bc;return _0x3ee4bc[_0xc784('0x6b')](_0x2473ee[_0xc784('0x4a')]['id2']);}})[_0xc784('0x25')](function(_0x38bc26){if(_0x38bc26){return db[_0xc784('0x63')]['findOne']({'where':{'id':_0x2473ee[_0xc784('0x4a')][_0xc784('0x6c')]},'attributes':['id','name',_0xc784('0x65'),_0xc784('0x66'),'createdAt'],'raw':!![]});}})['then'](function(_0x176bd7){if(_0x176bd7){fs[_0xc784('0x6d')](path['join'](_0x445e07[_0xc784('0x54')],util[_0xc784('0x67')](_0xc784('0x68'),_0x176bd7[_0xc784('0x2a')],_0x176bd7[_0xc784('0x66')])));return _0x176bd7;}})[_0xc784('0x47')](function(_0xf85a53){throw new db[(_0xc784('0x6a'))][(_0xc784('0x5f'))](_0xf85a53[_0xc784('0x60')]);});})[_0xc784('0x25')](handleEntityNotFound(_0x43a7ae,null))[_0xc784('0x25')](respondWithStatusCode(_0x43a7ae,0xcc))['catch'](handleError(_0x43a7ae,null));};exports[_0xc784('0x6e')]=function(_0x4e6a67,_0x2f0581,_0x228dfc){var _0x3ce7a6={};var _0x3b61e4={};var _0x5634bf;var _0x17d3a3;return db[_0xc784('0x43')][_0xc784('0x64')]({'where':{'id':_0x4e6a67[_0xc784('0x4a')]['id']}})[_0xc784('0x25')](handleEntityNotFound(_0x2f0581,null))[_0xc784('0x25')](function(_0x2f4166){if(_0x2f4166){_0x5634bf=_0x2f4166;_0x3b61e4[_0xc784('0x35')]=_[_0xc784('0x33')](db[_0xc784('0x63')][_0xc784('0x2e')]);_0x3b61e4[_0xc784('0x32')]=_[_0xc784('0x33')](_0x4e6a67[_0xc784('0x32')]);_0x3b61e4['filters']=_[_0xc784('0x34')](_0x3b61e4['model'],_0x3b61e4[_0xc784('0x32')]);_0x3ce7a6['attributes']=_[_0xc784('0x34')](_0x3b61e4['model'],qs['fields'](_0x4e6a67[_0xc784('0x32')][_0xc784('0x36')]));_0x3ce7a6[_0xc784('0x37')]=_0x3ce7a6[_0xc784('0x37')][_0xc784('0x38')]?_0x3ce7a6[_0xc784('0x37')]:_0x3b61e4['model'];_0x3ce7a6[_0xc784('0x3b')]=qs[_0xc784('0x3c')](_0x4e6a67[_0xc784('0x32')][_0xc784('0x3c')]);_0x3ce7a6[_0xc784('0x3d')]=qs[_0xc784('0x3e')](_[_0xc784('0x3f')](_0x4e6a67['query'],_0x3b61e4[_0xc784('0x3e')]));if(_0x4e6a67[_0xc784('0x32')][_0xc784('0x40')]){_0x3ce7a6[_0xc784('0x3d')]=_[_0xc784('0x41')](_0x3ce7a6[_0xc784('0x3d')],{'$or':_[_0xc784('0x2d')](_0x3ce7a6[_0xc784('0x37')],function(_0x394f67){var _0x2738ee={};_0x2738ee[_0x394f67]={'$like':'%'+_0x4e6a67['query'][_0xc784('0x40')]+'%'};return _0x2738ee;})});}_0x3ce7a6=_[_0xc784('0x41')]({},_0x3ce7a6,_0x4e6a67['options']);return _0x5634bf['getSounds'](_0x3ce7a6);}})[_0xc784('0x25')](function(_0x5cfab9){if(_0x5cfab9){_0x17d3a3=_0x5cfab9[_0xc784('0x38')];if(!_0x4e6a67['query']['hasOwnProperty'](_0xc784('0x3a'))){_0x3ce7a6[_0xc784('0x1f')]=qs[_0xc784('0x1f')](_0x4e6a67['query'][_0xc784('0x1f')]);_0x3ce7a6[_0xc784('0x1c')]=qs['offset'](_0x4e6a67[_0xc784('0x32')][_0xc784('0x1c')]);}return _0x5634bf[_0xc784('0x6e')](_0x3ce7a6);}})[_0xc784('0x25')](function(_0x2478e9){if(_0x2478e9){return _0x2478e9?{'count':_0x17d3a3,'rows':_0x2478e9}:null;}})['then'](respondWithResult(_0x2f0581,null))[_0xc784('0x47')](handleError(_0x2f0581,null));};
\ No newline at end of file
index 9dd8b8a..175f19c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dd9=['../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','path'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x3dd9,0x1d1));var _0x93dd=function(_0x1ceb0e,_0x16bba8){_0x1ceb0e=_0x1ceb0e-0x0;var _0x489a35=_0x3dd9[_0x1ceb0e];return _0x489a35;};'use strict';var _=require('lodash');var util=require(_0x93dd('0x0'));var logger=require(_0x93dd('0x1'))(_0x93dd('0x2'));var moment=require(_0x93dd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x93dd('0x4'));var rimraf=require('rimraf');var config=require(_0x93dd('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x93dd('0x6')]=function(_0x51212c,_0x2d1323){return _0x51212c[_0x93dd('0x7')](_0x93dd('0x8'),attributes,{'tableName':_0x93dd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x86e4=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x86e4,0x12d));var _0x486e=function(_0x5db313,_0x3c8f0c){_0x5db313=_0x5db313-0x0;var _0x36d503=_0x86e4[_0x5db313];return _0x36d503;};'use strict';var _=require(_0x486e('0x0'));var util=require(_0x486e('0x1'));var logger=require(_0x486e('0x2'))(_0x486e('0x3'));var moment=require(_0x486e('0x4'));var BPromise=require('bluebird');var rp=require(_0x486e('0x5'));var fs=require('fs');var path=require(_0x486e('0x6'));var rimraf=require(_0x486e('0x7'));var config=require(_0x486e('0x8'));var attributes=require(_0x486e('0x9'));module[_0x486e('0xa')]=function(_0x4e295c,_0x353c62){return _0x4e295c[_0x486e('0xb')](_0x486e('0xc'),attributes,{'tableName':_0x486e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bcebc32..7f0edc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x1216b9,_0x3ea78b){var _0x2aea2b=function(_0x9f818b){while(--_0x9f818b){_0x1216b9['push'](_0x1216b9['shift']());}};_0x2aea2b(++_0x3ea78b);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}
\ No newline at end of file
+var _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(_0x1a463b,_0x1eca0b){var _0x2a7758=function(_0x392cd3){while(--_0x392cd3){_0x1a463b['push'](_0x1a463b['shift']());}};_0x2a7758(++_0x1eca0b);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'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 37fea8e..1359b61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf864=['removeTeams','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','getAgents','/:id/teams','getTeams','create','/:id/users','addAgents','post','addTeams','put','/:id','update','delete','destroy','removeAgents'];(function(_0x39bc91,_0x2070c8){var _0x1695e3=function(_0x4a9046){while(--_0x4a9046){_0x39bc91['push'](_0x39bc91['shift']());}};_0x1695e3(++_0x2070c8);}(_0xf864,0x1de));var _0x4f86=function(_0x3b52de,_0x1b044c){_0x3b52de=_0x3b52de-0x0;var _0x499392=_0xf864[_0x3b52de];return _0x499392;};'use strict';var multer=require('multer');var util=require(_0x4f86('0x0'));var path=require('path');var timeout=require(_0x4f86('0x1'));var express=require(_0x4f86('0x2'));var router=express[_0x4f86('0x3')]();var fs_extra=require(_0x4f86('0x4'));var auth=require(_0x4f86('0x5'));var interaction=require(_0x4f86('0x6'));var config=require(_0x4f86('0x7'));var controller=require('./voicePrefix.controller');router[_0x4f86('0x8')]('/',auth[_0x4f86('0x9')](),controller[_0x4f86('0xa')]);router[_0x4f86('0x8')](_0x4f86('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4f86('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4f86('0x8')]('/:id/users',auth[_0x4f86('0x9')](),controller[_0x4f86('0xc')]);router[_0x4f86('0x8')](_0x4f86('0xd'),auth['isAuthenticated'](),controller[_0x4f86('0xe')]);router['post']('/',auth[_0x4f86('0x9')](),controller[_0x4f86('0xf')]);router['post'](_0x4f86('0x10'),auth[_0x4f86('0x9')](),controller[_0x4f86('0x11')]);router[_0x4f86('0x12')]('/:id/teams',auth[_0x4f86('0x9')](),controller[_0x4f86('0x13')]);router[_0x4f86('0x14')](_0x4f86('0x15'),auth[_0x4f86('0x9')](),controller[_0x4f86('0x16')]);router[_0x4f86('0x17')](_0x4f86('0x15'),auth[_0x4f86('0x9')](),controller[_0x4f86('0x18')]);router[_0x4f86('0x17')](_0x4f86('0x10'),auth['isAuthenticated'](),controller[_0x4f86('0x19')]);router[_0x4f86('0x17')](_0x4f86('0xd'),auth[_0x4f86('0x9')](),controller[_0x4f86('0x1a')]);module[_0x4f86('0x1b')]=router;
\ No newline at end of file
+var _0x528f=['/:id/teams','addTeams','put','/:id','update','destroy','delete','removeTeams','util','path','connect-timeout','express','Router','../../components/auth/service','./voicePrefix.controller','isAuthenticated','index','/describe','describe','get','show','/:id/users','getTeams','post','create','addAgents'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x528f,0x140));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xf528('0x0'));var path=require(_0xf528('0x1'));var timeout=require(_0xf528('0x2'));var express=require(_0xf528('0x3'));var router=express[_0xf528('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf528('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf528('0x6'));router['get']('/',auth[_0xf528('0x7')](),controller[_0xf528('0x8')]);router['get'](_0xf528('0x9'),auth[_0xf528('0x7')](),controller[_0xf528('0xa')]);router[_0xf528('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xf528('0xc')]);router['get'](_0xf528('0xd'),auth['isAuthenticated'](),controller['getAgents']);router[_0xf528('0xb')]('/:id/teams',auth[_0xf528('0x7')](),controller[_0xf528('0xe')]);router[_0xf528('0xf')]('/',auth[_0xf528('0x7')](),controller[_0xf528('0x10')]);router[_0xf528('0xf')]('/:id/users',auth[_0xf528('0x7')](),controller[_0xf528('0x11')]);router[_0xf528('0xf')](_0xf528('0x12'),auth[_0xf528('0x7')](),controller[_0xf528('0x13')]);router[_0xf528('0x14')](_0xf528('0x15'),auth[_0xf528('0x7')](),controller[_0xf528('0x16')]);router['delete'](_0xf528('0x15'),auth[_0xf528('0x7')](),controller[_0xf528('0x17')]);router[_0xf528('0x18')](_0xf528('0xd'),auth[_0xf528('0x7')](),controller['removeAgents']);router['delete'](_0xf528('0x12'),auth[_0xf528('0x7')](),controller[_0xf528('0x19')]);module['exports']=router;
\ No newline at end of file
index 4f66934..dc75388 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ae6=['sequelize','exports','STRING','name','VIRTUAL','getDataValue'];(function(_0x162ee0,_0x291661){var _0x48fc5e=function(_0x297a35){while(--_0x297a35){_0x162ee0['push'](_0x162ee0['shift']());}};_0x48fc5e(++_0x291661);}(_0x2ae6,0xa8));var _0x62ae=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x2ae6[_0x2aecb2];return _0x3ebb80;};'use strict';var Sequelize=require(_0x62ae('0x0'));module[_0x62ae('0x1')]={'name':{'type':Sequelize[_0x62ae('0x2')],'allowNull':![],'unique':_0x62ae('0x3')},'prefix':{'type':Sequelize[_0x62ae('0x4')],'get':function(_0x57a2f0){return'system-'+this[_0x62ae('0x5')](_0x62ae('0x3'))+'-';}},'description':{'type':Sequelize[_0x62ae('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x7c1b=['STRING','VIRTUAL','system-','name','INTEGER','exports'];(function(_0x1c67b3,_0x3fb1ca){var _0x54ecd2=function(_0x4fd560){while(--_0x4fd560){_0x1c67b3['push'](_0x1c67b3['shift']());}};_0x54ecd2(++_0x3fb1ca);}(_0x7c1b,0x65));var _0xb7c1=function(_0x595e4d,_0x4a3229){_0x595e4d=_0x595e4d-0x0;var _0xa92ae6=_0x7c1b[_0x595e4d];return _0xa92ae6;};'use strict';var Sequelize=require('sequelize');module[_0xb7c1('0x0')]={'name':{'type':Sequelize[_0xb7c1('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xb7c1('0x2')],'get':function(_0x596168){return _0xb7c1('0x3')+this['getDataValue'](_0xb7c1('0x4'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xb7c1('0x5')]}};
\ No newline at end of file
index 20cf2dc..4f05b44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c3c=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','error','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','sequelize','transaction','get','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','VoiceExtensionId','findById','addAgents','ids','omit','removeAgents','isArray','userVoicePrefix:remove','emit','getAgents','findOne','User','pick','getTeams','addTeams','Team','findAll','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','Agents','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','union','compact','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x19da4d,_0x260981){var _0xc71c77=function(_0x4edb82){while(--_0x4edb82){_0x19da4d['push'](_0x19da4d['shift']());}};_0xc71c77(++_0x260981);}(_0x5c3c,0x132));var _0xc5c3=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x5c3c[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];config[_0xc5c3('0x18')]=_[_0xc5c3('0x19')](config[_0xc5c3('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5c3('0x1a'))(new Redis(config[_0xc5c3('0x18')]));require(_0xc5c3('0x1b'))[_0xc5c3('0x1c')](socket);function respondWithStatusCode(_0xc8a636,_0x5f34bb){_0x5f34bb=_0x5f34bb||0xcc;return function(_0x5c0341){if(_0x5c0341){return _0xc8a636[_0xc5c3('0x1d')](_0x5f34bb);}return _0xc8a636[_0xc5c3('0x1e')](_0x5f34bb)[_0xc5c3('0x1f')]();};}function respondWithResult(_0xef8b21,_0x5ecd4b){_0x5ecd4b=_0x5ecd4b||0xc8;return function(_0x4ff2de){if(_0x4ff2de){return _0xef8b21[_0xc5c3('0x1e')](_0x5ecd4b)['json'](_0x4ff2de);}};}function respondWithFilteredResult(_0xa9bc84,_0x17ec62){return function(_0x2ff158){if(_0x2ff158){var _0x13c867=typeof _0x17ec62[_0xc5c3('0x20')]==='undefined'&&typeof _0x17ec62[_0xc5c3('0x21')]===_0xc5c3('0x22');var _0x123dba=_0x2ff158[_0xc5c3('0x23')];var _0x4e570f=_0x13c867?0x0:_0x17ec62[_0xc5c3('0x20')];var _0x41578a=_0x13c867?_0x2ff158[_0xc5c3('0x23')]:_0x17ec62[_0xc5c3('0x20')]+_0x17ec62[_0xc5c3('0x21')];var _0x564815;if(_0x41578a>=_0x123dba){_0x41578a=_0x123dba;_0x564815=0xc8;}else{_0x564815=0xce;}_0xa9bc84[_0xc5c3('0x1e')](_0x564815);return _0xa9bc84[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e570f+'-'+_0x41578a+'/'+_0x123dba)[_0xc5c3('0x26')](_0x2ff158);}return null;};}function patchUpdates(_0x1c5793){return function(_0x67445){try{jsonpatch[_0xc5c3('0x27')](_0x67445,_0x1c5793,!![]);}catch(_0x5996a0){return BPromise['reject'](_0x5996a0);}return _0x67445[_0xc5c3('0x28')]();};}function saveUpdates(_0x38dd9e,_0x53ab72){return function(_0x5c7329){if(_0x5c7329){return _0x5c7329[_0xc5c3('0x29')](_0x38dd9e)[_0xc5c3('0x2a')](function(_0x38a3df){return _0x38a3df;});}return null;};}function removeEntity(_0x52e54a,_0x4af067){return function(_0x2df06b){if(_0x2df06b){return _0x2df06b[_0xc5c3('0x2b')]()[_0xc5c3('0x2a')](function(){var _0x29791c=_0x2df06b['get']({'plain':!![]});var _0x21efd6='VoicePrefixes';return db[_0xc5c3('0x2c')]['destroy']({'where':{'type':_0x21efd6,'resourceId':_0x29791c['id']}})[_0xc5c3('0x2a')](function(){return _0x2df06b;});})[_0xc5c3('0x2a')](function(){_0x52e54a[_0xc5c3('0x1e')](0xcc)[_0xc5c3('0x1f')]();});}};}function handleEntityNotFound(_0x15361c,_0x2d07e1){return function(_0x35a397){if(!_0x35a397){_0x15361c['sendStatus'](0x194);}return _0x35a397;};}function handleError(_0xbcafd6,_0x4a3300){_0x4a3300=_0x4a3300||0x1f4;return function(_0xc4b134){logger[_0xc5c3('0x2d')](_0xc4b134['stack']);if(_0xc4b134['name']){delete _0xc4b134[_0xc5c3('0x2e')];}_0xbcafd6[_0xc5c3('0x1e')](_0x4a3300)[_0xc5c3('0x2f')](_0xc4b134);};}exports[_0xc5c3('0x30')]=function(_0x52adcf,_0x3f9591){var _0x24aa70={},_0x3ebcbc={},_0x303eab={'count':0x0,'rows':[]};var _0x1b4538=_[_0xc5c3('0x31')](db[_0xc5c3('0x32')][_0xc5c3('0x33')],function(_0x1d1e6d){return{'name':_0x1d1e6d['fieldName'],'type':_0x1d1e6d[_0xc5c3('0x34')][_0xc5c3('0x35')]};});_0x3ebcbc[_0xc5c3('0x36')]=_[_0xc5c3('0x31')](_0x1b4538,_0xc5c3('0x2e'));_0x3ebcbc[_0xc5c3('0x37')]=_[_0xc5c3('0x38')](_0x52adcf['query']);_0x3ebcbc['filters']=_[_0xc5c3('0x39')](_0x3ebcbc['model'],_0x3ebcbc[_0xc5c3('0x37')]);_0x24aa70[_0xc5c3('0x3a')]=_[_0xc5c3('0x39')](_0x3ebcbc[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x52adcf['query'][_0xc5c3('0x3b')]));_0x24aa70[_0xc5c3('0x3a')]=_0x24aa70['attributes'][_0xc5c3('0x3c')]?_0x24aa70[_0xc5c3('0x3a')]:_0x3ebcbc[_0xc5c3('0x36')];if(!_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x3d')](_0xc5c3('0x3e'))){_0x24aa70[_0xc5c3('0x21')]=qs[_0xc5c3('0x21')](_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x21')]);_0x24aa70['offset']=qs[_0xc5c3('0x20')](_0x52adcf['query']['offset']);}_0x24aa70[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x40')]);_0x24aa70[_0xc5c3('0x41')]=qs['filters'](_['pick'](_0x52adcf[_0xc5c3('0x37')],_0x3ebcbc[_0xc5c3('0x42')]),_0x1b4538);if(_0x52adcf['query'][_0xc5c3('0x43')]){_0x24aa70['where']=_[_0xc5c3('0x44')](_0x24aa70[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x1b4538,function(_0x59c9cb){if(_0x59c9cb[_0xc5c3('0x34')]!==_0xc5c3('0x45')){var _0x525ef8={};_0x525ef8[_0x59c9cb[_0xc5c3('0x2e')]]={'$like':'%'+_0x52adcf['query'][_0xc5c3('0x43')]+'%'};return _0x525ef8;}})});}_0x24aa70=_[_0xc5c3('0x44')]({},_0x24aa70,_0x52adcf['options']);var _0x4d2056={'where':_0x24aa70['where']};return db[_0xc5c3('0x32')][_0xc5c3('0x23')](_0x4d2056)['then'](function(_0x1a8490){_0x303eab[_0xc5c3('0x23')]=_0x1a8490;if(_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x46')]){_0x24aa70['include']=[{'all':!![]}];}return db[_0xc5c3('0x32')]['findAll'](_0x24aa70);})['then'](function(_0x1363fa){_0x303eab[_0xc5c3('0x47')]=_0x1363fa;return _0x303eab;})['then'](respondWithFilteredResult(_0x3f9591,_0x24aa70))[_0xc5c3('0x48')](handleError(_0x3f9591,null));};exports[_0xc5c3('0x49')]=function(_0x590e65,_0x333c38){var _0x4ffc5a={'raw':![],'where':{'id':_0x590e65[_0xc5c3('0x4a')]['id']}},_0x122a6d={};_0x122a6d['model']=_[_0xc5c3('0x38')](db['VoicePrefix'][_0xc5c3('0x33')]);_0x122a6d[_0xc5c3('0x37')]=_['keys'](_0x590e65[_0xc5c3('0x37')]);_0x122a6d[_0xc5c3('0x42')]=_[_0xc5c3('0x39')](_0x122a6d[_0xc5c3('0x36')],_0x122a6d[_0xc5c3('0x37')]);_0x4ffc5a[_0xc5c3('0x3a')]=_['intersection'](_0x122a6d[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x590e65[_0xc5c3('0x37')][_0xc5c3('0x3b')]));_0x4ffc5a[_0xc5c3('0x3a')]=_0x4ffc5a['attributes']['length']?_0x4ffc5a[_0xc5c3('0x3a')]:_0x122a6d[_0xc5c3('0x36')];if(_0x590e65[_0xc5c3('0x37')]['includeAll']){_0x4ffc5a[_0xc5c3('0x4b')]=[{'all':!![]}];}_0x4ffc5a=_[_0xc5c3('0x44')]({},_0x4ffc5a,_0x590e65[_0xc5c3('0x4c')]);return db[_0xc5c3('0x32')][_0xc5c3('0x4d')](_0x4ffc5a)[_0xc5c3('0x2a')](handleEntityNotFound(_0x333c38,null))[_0xc5c3('0x2a')](respondWithResult(_0x333c38,null))['catch'](handleError(_0x333c38,null));};exports[_0xc5c3('0x2b')]=function(_0x3ff21e,_0x4538ab){return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x3ff21e[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x4538ab,null))[_0xc5c3('0x2a')](removeEntity(_0x4538ab,null))[_0xc5c3('0x48')](handleError(_0x4538ab,null));};exports['describe']=function(_0xd716e6,_0x58204c){return db[_0xc5c3('0x32')]['describe']()[_0xc5c3('0x2a')](respondWithResult(_0x58204c,null))[_0xc5c3('0x48')](handleError(_0x58204c,null));};exports[_0xc5c3('0x4e')]=function(_0x325643,_0x1311de){var _0x4be969;return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x348960){return db[_0xc5c3('0x32')][_0xc5c3('0x4e')](_0x325643['body'],{'transaction':_0x348960})[_0xc5c3('0x2a')](function(_0x34bf9c){_0x4be969=_0x34bf9c[_0xc5c3('0x51')]({'plain':!![]});return db['VoiceExtension'][_0xc5c3('0x4d')]({'where':{'id':_0x4be969['VoiceExtensionId']},'raw':!![]})['then'](function(_0x39f83a){return createVoicePrefixExtensions(_0x4be969,_0x39f83a,_0x348960);});});})[_0xc5c3('0x2a')](function(){var _0x110105=_0x325643[_0xc5c3('0x52')][_0xc5c3('0x51')]({'plain':!![]});if(!_0x110105)throw new Error(_0xc5c3('0x53'));if(_0x110105['role']===_0xc5c3('0x52')){var _0x1ad3aa=_0x4be969;return db[_0xc5c3('0x54')][_0xc5c3('0x4d')]({'where':{'name':_0xc5c3('0x55'),'userProfileId':_0x110105[_0xc5c3('0x56')]},'raw':!![]})[_0xc5c3('0x2a')](function(_0x524aff){if(_0x524aff&&_0x524aff['autoAssociation']===0x0){return db[_0xc5c3('0x2c')][_0xc5c3('0x4e')]({'name':_0x1ad3aa['name'],'resourceId':_0x1ad3aa['id'],'type':_0x524aff[_0xc5c3('0x2e')],'sectionId':_0x524aff['id']},{})[_0xc5c3('0x2a')](function(){return _0x4be969;});}else{return _0x4be969;}})[_0xc5c3('0x48')](function(_0x41bcf7){logger['error'](_0xc5c3('0x57'),_0x41bcf7);throw _0x41bcf7;});}return _0x4be969;})[_0xc5c3('0x2a')](respondWithResult(_0x1311de,null))[_0xc5c3('0x48')](handleError(_0x1311de,null));};function Extension(_0x314392,_0x1b66bf,_0x36420a,_0x90e30b){this[_0xc5c3('0x58')]=_0xc5c3('0x59');this['exten']=_0x314392;this[_0xc5c3('0x5a')]=_0x36420a;this[_0xc5c3('0x34')]=_0xc5c3('0x5b');this['description']=_0xc5c3('0x5c');this[_0xc5c3('0x5d')]=_0x1b66bf;this[_0xc5c3('0x5e')]=_0x90e30b;}function createVoicePrefixExtensions(_0x30226f,_0x32d5e2,_0x5067ed){return new BPromise(function(_0xf54924,_0xea569b){var _0xf40f27=new Extension(formatPrefixName(_0x30226f[_0xc5c3('0x5f')]),0x1,_0xc5c3('0x60'),_0xc5c3('0x61'));_0xf40f27[_0xc5c3('0x62')]=_0x30226f['id'];return db['VoiceExtension'][_0xc5c3('0x4e')](_0xf40f27,{'transaction':_0x5067ed})[_0xc5c3('0x2a')](function(_0x397fc8){var _0x13f6a1=_0x397fc8[_0xc5c3('0x51')]({'plain':!![]});var _0x3cd213=_[_0xc5c3('0x31')](addVoicePrefixExtensions(_0x30226f,_0x32d5e2),function(_0x5b9013){_0x5b9013['VoiceExtensionId']=_0x13f6a1['id'];_0x5b9013[_0xc5c3('0x62')]=_0x30226f['id'];return _0x5b9013;});return db[_0xc5c3('0x63')][_0xc5c3('0x64')](_0x3cd213,{'transaction':_0x5067ed})[_0xc5c3('0x2a')](function(_0x1ed757){if(!_0x1ed757){return _0xea569b(_0xc5c3('0x65'));}else{return _0xf54924(_0x1ed757);}})[_0xc5c3('0x48')](function(_0x2cdd7a){return _0xea569b(_0x2cdd7a);});});;});};function addVoicePrefixExtensions(_0x385b39,_0x4d3e6f){var _0x92c6cf=[];var _0x358b83=formatPrefixName(_0x385b39['prefix']);_0x92c6cf['push'](new Extension(_0x358b83,0x2,_0xc5c3('0x66'),_0xc5c3('0x67')+_0x385b39[_0xc5c3('0x2e')]));if(_0x385b39[_0xc5c3('0x68')]){_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x3,_0xc5c3('0x66'),_0xc5c3('0x6a')+_0x385b39[_0xc5c3('0x68')]));}else{_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x3,'NoOp',_0xc5c3('0x6b')));}_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x4,_0xc5c3('0x6c'),_0x4d3e6f[_0xc5c3('0x58')]+','+_0xc5c3('0x6d')+(0x8+_0x385b39[_0xc5c3('0x2e')][_0xc5c3('0x3c')])+'}'+','+0x1));return _0x92c6cf;}function formatPrefixName(_0x114c90){var _0x22606a='_';for(var _0x31e280=0x0;_0x31e280<_0x114c90[_0xc5c3('0x3c')];_0x31e280++){if(_0x114c90['charAt'](_0x31e280)=='-'){_0x22606a+=_0x114c90['charAt'](_0x31e280);}else{_0x22606a+='['+_0x114c90[_0xc5c3('0x6e')](_0x31e280)+']';}}_0x22606a+='.';return _0x22606a;}exports[_0xc5c3('0x29')]=function(_0x6281e5,_0x1951a5,_0x5540c0){var _0x2da018=_0x6281e5[_0xc5c3('0x6f')];_0x2da018[_0xc5c3('0x5f')]=_0xc5c3('0x70')+_0x2da018[_0xc5c3('0x2e')]+'-';return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x4a3f71){return db[_0xc5c3('0x32')]['update'](_0x2da018,{'where':{'id':_0x2da018['id']},'transaction':_0x4a3f71})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x63')][_0xc5c3('0x2b')]({'where':{'VoicePrefixId':_0x2da018['id']},'transaction':_0x4a3f71})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x63')][_0xc5c3('0x4d')]({'where':{'id':_0x2da018[_0xc5c3('0x71')]},'raw':!![]})[_0xc5c3('0x2a')](function(_0x4813a0){return createVoicePrefixExtensions(_0x2da018,_0x4813a0,_0x4a3f71);});});});})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x32')][_0xc5c3('0x72')](_0x2da018['id']);})['then'](respondWithResult(_0x1951a5,null))['catch'](handleError(_0x1951a5,null));};exports[_0xc5c3('0x73')]=function(_0x5d6b6b,_0x5bcbd3,_0x1f222f){return db[_0xc5c3('0x32')]['find']({'where':{'id':_0x5d6b6b[_0xc5c3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bcbd3,null))['then'](function(_0x2dbe80){if(_0x2dbe80){return _0x2dbe80[_0xc5c3('0x73')](_0x5d6b6b[_0xc5c3('0x6f')][_0xc5c3('0x74')],_[_0xc5c3('0x75')](_0x5d6b6b['body'],[_0xc5c3('0x74'),'id'])||{})['spread'](function(_0x110167){for(var _0x109cfa=0x0;_0x109cfa<_0x5d6b6b[_0xc5c3('0x6f')][_0xc5c3('0x74')][_0xc5c3('0x3c')];_0x109cfa+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x5d6b6b['body'][_0xc5c3('0x74')][_0x109cfa]),'VoicePrefixId':Number(_0x5d6b6b[_0xc5c3('0x4a')]['id'])});}return _0x110167;});}})[_0xc5c3('0x2a')](respondWithResult(_0x5bcbd3,null))['catch'](handleError(_0x5bcbd3,null));};exports[_0xc5c3('0x76')]=function(_0x41222d,_0x5dcd4d,_0x3afa94){return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x41222d[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x5dcd4d,null))[_0xc5c3('0x2a')](function(_0x4b0d02){if(_0x4b0d02){return _0x4b0d02[_0xc5c3('0x76')](_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')])[_0xc5c3('0x2a')](function(){if(_[_0xc5c3('0x77')](_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')])){for(var _0x1f36f8=0x0;_0x1f36f8<_0x41222d['query']['ids']['length'];_0x1f36f8+=0x1){socket['emit'](_0xc5c3('0x78'),{'UserId':Number(_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')][_0x1f36f8]),'VoicePrefixId':Number(_0x41222d[_0xc5c3('0x4a')]['id'])});}}else{socket[_0xc5c3('0x79')](_0xc5c3('0x78'),{'UserId':Number(_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')]),'VoicePrefixId':Number(_0x41222d[_0xc5c3('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5dcd4d,null))[_0xc5c3('0x48')](handleError(_0x5dcd4d,null));};exports[_0xc5c3('0x7a')]=function(_0x3aa5e2,_0x1efa1d,_0x2fae6d){var _0x258e36={};var _0x2f1be8={};var _0x550966;var _0x5733a2;return db[_0xc5c3('0x32')][_0xc5c3('0x7b')]({'where':{'id':_0x3aa5e2[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x1efa1d,null))[_0xc5c3('0x2a')](function(_0x306d22){if(_0x306d22){_0x550966=_0x306d22;_0x2f1be8[_0xc5c3('0x36')]=_[_0xc5c3('0x38')](db[_0xc5c3('0x7c')][_0xc5c3('0x33')]);_0x2f1be8[_0xc5c3('0x37')]=_['keys'](_0x3aa5e2[_0xc5c3('0x37')]);_0x2f1be8[_0xc5c3('0x42')]=_[_0xc5c3('0x39')](_0x2f1be8[_0xc5c3('0x36')],_0x2f1be8[_0xc5c3('0x37')]);_0x258e36['attributes']=_[_0xc5c3('0x39')](_0x2f1be8[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x3aa5e2[_0xc5c3('0x37')]['fields']));_0x258e36[_0xc5c3('0x3a')]=_0x258e36[_0xc5c3('0x3a')][_0xc5c3('0x3c')]?_0x258e36['attributes']:_0x2f1be8[_0xc5c3('0x36')];_0x258e36[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x40')]);_0x258e36[_0xc5c3('0x41')]=qs[_0xc5c3('0x42')](_[_0xc5c3('0x7d')](_0x3aa5e2[_0xc5c3('0x37')],_0x2f1be8[_0xc5c3('0x42')]));if(_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x43')]){_0x258e36[_0xc5c3('0x41')]=_[_0xc5c3('0x44')](_0x258e36[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x258e36['attributes'],function(_0x2bf9d2){var _0x8aaa64={};_0x8aaa64[_0x2bf9d2]={'$like':'%'+_0x3aa5e2['query'][_0xc5c3('0x43')]+'%'};return _0x8aaa64;})});}_0x258e36=_['merge']({},_0x258e36,_0x3aa5e2[_0xc5c3('0x4c')]);return _0x550966[_0xc5c3('0x7a')](_0x258e36);}})[_0xc5c3('0x2a')](function(_0x1800a0){if(_0x1800a0){_0x5733a2=_0x1800a0[_0xc5c3('0x3c')];if(!_0x3aa5e2['query'][_0xc5c3('0x3d')](_0xc5c3('0x3e'))){_0x258e36[_0xc5c3('0x21')]=qs['limit'](_0x3aa5e2['query'][_0xc5c3('0x21')]);_0x258e36['offset']=qs[_0xc5c3('0x20')](_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x20')]);}return _0x550966['getAgents'](_0x258e36);}})[_0xc5c3('0x2a')](function(_0x3325b6){if(_0x3325b6){return _0x3325b6?{'count':_0x5733a2,'rows':_0x3325b6}:null;}})[_0xc5c3('0x2a')](respondWithResult(_0x1efa1d,null))[_0xc5c3('0x48')](handleError(_0x1efa1d,null));};exports[_0xc5c3('0x7e')]=function(_0x57070d,_0x2f5315,_0x37ef35){var _0x2dcae5={};var _0x5d5248={};var _0xd3091c;var _0x26292e;return db[_0xc5c3('0x32')][_0xc5c3('0x7b')]({'where':{'id':_0x57070d[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x2f5315,null))[_0xc5c3('0x2a')](function(_0x12d800){if(_0x12d800){_0xd3091c=_0x12d800;_0x5d5248['model']=_[_0xc5c3('0x38')](db['Team'][_0xc5c3('0x33')]);_0x5d5248[_0xc5c3('0x37')]=_['keys'](_0x57070d[_0xc5c3('0x37')]);_0x5d5248[_0xc5c3('0x42')]=_['intersection'](_0x5d5248[_0xc5c3('0x36')],_0x5d5248[_0xc5c3('0x37')]);_0x2dcae5[_0xc5c3('0x3a')]=_[_0xc5c3('0x39')](_0x5d5248[_0xc5c3('0x36')],qs['fields'](_0x57070d[_0xc5c3('0x37')][_0xc5c3('0x3b')]));_0x2dcae5[_0xc5c3('0x3a')]=_0x2dcae5[_0xc5c3('0x3a')][_0xc5c3('0x3c')]?_0x2dcae5[_0xc5c3('0x3a')]:_0x5d5248['model'];_0x2dcae5[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x57070d['query']['sort']);_0x2dcae5[_0xc5c3('0x41')]=qs[_0xc5c3('0x42')](_['pick'](_0x57070d[_0xc5c3('0x37')],_0x5d5248[_0xc5c3('0x42')]));if(_0x57070d[_0xc5c3('0x37')]['filter']){_0x2dcae5[_0xc5c3('0x41')]=_[_0xc5c3('0x44')](_0x2dcae5[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x2dcae5[_0xc5c3('0x3a')],function(_0x86d21a){var _0x53f1d={};_0x53f1d[_0x86d21a]={'$like':'%'+_0x57070d[_0xc5c3('0x37')][_0xc5c3('0x43')]+'%'};return _0x53f1d;})});}_0x2dcae5=_[_0xc5c3('0x44')]({},_0x2dcae5,_0x57070d[_0xc5c3('0x4c')]);return _0xd3091c[_0xc5c3('0x7e')](_0x2dcae5);}})['then'](function(_0x48e3a2){if(_0x48e3a2){_0x26292e=_0x48e3a2[_0xc5c3('0x3c')];if(!_0x57070d['query']['hasOwnProperty'](_0xc5c3('0x3e'))){_0x2dcae5['limit']=qs[_0xc5c3('0x21')](_0x57070d[_0xc5c3('0x37')]['limit']);_0x2dcae5['offset']=qs[_0xc5c3('0x20')](_0x57070d['query']['offset']);}return _0xd3091c[_0xc5c3('0x7e')](_0x2dcae5);}})[_0xc5c3('0x2a')](function(_0x3ce0e9){if(_0x3ce0e9){return _0x3ce0e9?{'count':_0x26292e,'rows':_0x3ce0e9}:null;}})[_0xc5c3('0x2a')](respondWithResult(_0x2f5315,null))[_0xc5c3('0x48')](handleError(_0x2f5315,null));};exports[_0xc5c3('0x7f')]=function(_0x116965,_0xa4672a,_0x1aba09){var _0x557b8f=_0x116965['body'][_0xc5c3('0x74')];var _0x389c96;return db[_0xc5c3('0x80')][_0xc5c3('0x81')]({'where':{'id':_0x557b8f},'attributes':['id'],'include':[{'model':db[_0xc5c3('0x7c')],'as':'Agents','attributes':['id',_0xc5c3('0x2e'),'online',_0xc5c3('0x82'),_0xc5c3('0x83')],'raw':!![]}]})[_0xc5c3('0x2a')](function(_0x2c8937){if(_0x2c8937){_0x389c96=_0x2c8937;var _0x9e9372=_[_0xc5c3('0x84')](_0x2c8937,function(_0x1dcde5){var _0x2c8fdb=_0x1dcde5['get']({'plain':!![]});return _0x2c8fdb['Agents'];});return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x116965[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](function(_0x3cc60b){return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x2c5fd2){return _0x3cc60b[_0xc5c3('0x7f')](_0x557b8f,{'transaction':_0x2c5fd2})[_0xc5c3('0x2a')](function(){return BPromise[_0xc5c3('0x85')](_0x389c96,function(_0x554787){return db[_0xc5c3('0x86')][_0xc5c3('0x87')]({'TeamId':_0x554787['id'],'VoicePrefixId':_0x116965[_0xc5c3('0x4a')]['id']},{'transaction':_0x2c5fd2});});})[_0xc5c3('0x2a')](function(){return BPromise[_0xc5c3('0x85')](_0x9e9372,function(_0x589e28){return db[_0xc5c3('0x88')][_0xc5c3('0x89')]({'where':{'UserId':_0x589e28['id'],'VoicePrefixId':_0x116965[_0xc5c3('0x4a')]['id']},'transaction':_0x2c5fd2});});})['then'](function(){_0x9e9372[_0xc5c3('0x8a')](function(_0x2dd850){socket[_0xc5c3('0x79')](_0xc5c3('0x8b'),{'UserId':_0x2dd850['id'],'VoicePrefixId':_0x3cc60b['id']});});});});});}})[_0xc5c3('0x2a')](respondWithStatusCode(_0xa4672a,null))[_0xc5c3('0x48')](handleError(_0xa4672a,null));};exports[_0xc5c3('0x8c')]=function(_0x53a502,_0x762654,_0x37459f){return db['Team'][_0xc5c3('0x81')]({'where':{'id':_0x53a502[_0xc5c3('0x37')][_0xc5c3('0x74')]},'attributes':['id'],'include':[{'model':db[_0xc5c3('0x7c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc5c3('0x2a')](handleEntityNotFound(_0x762654,null))[_0xc5c3('0x2a')](function(_0x3aafa0){var _0xe80b2b=_[_0xc5c3('0x31')](_0x3aafa0,'id');var _0x2b49da=[];var _0x47bd08=[];var _0x314072=squel[_0xc5c3('0x8d')]();_0x314072['field'](_0xc5c3('0x8e'))['from'](_0xc5c3('0x8f'),'tq')[_0xc5c3('0x90')](_0xc5c3('0x91'),'ut',_0xc5c3('0x92'))['where']('VoicePrefixId\x20=\x20?',_0x53a502['params']['id']);for(var _0x3b5ca9=0x0;_0x3b5ca9<_0x3aafa0[_0xc5c3('0x3c')];_0x3b5ca9+=0x1){let _0x283935=_0x3aafa0[_0x3b5ca9];for(var _0x5cebbc=0x0;_0x5cebbc<_0x283935[_0xc5c3('0x93')]['length'];_0x5cebbc+=0x1){let _0x423b48=_0x283935[_0xc5c3('0x93')][_0x5cebbc];var _0x2a8dfc=_0x314072[_0xc5c3('0x94')]();_0x2a8dfc[_0xc5c3('0x41')](_0xc5c3('0x95'),_0x423b48['id']);_0x47bd08[_0xc5c3('0x69')](db[_0xc5c3('0x4f')][_0xc5c3('0x37')](_0x2a8dfc[_0xc5c3('0x96')](),{'type':db['sequelize'][_0xc5c3('0x97')]['SELECT']})[_0xc5c3('0x2a')](function(_0x397543){if(_0x397543[_0xc5c3('0x3c')]===0x1){return _0x423b48['id'];}else{var _0x21941a=_['every'](_[_0xc5c3('0x31')](_0x397543,_0xc5c3('0x98')),function(_0x1b7fc8){return _['includes'](_0xe80b2b,_0x1b7fc8);});if(_0x21941a){return _0x423b48['id'];}}}));}}return BPromise['all'](_0x47bd08)[_0xc5c3('0x2a')](function(_0x5731da){_0x2b49da=_(_0x2b49da)[_0xc5c3('0x99')](_0x5731da)[_0xc5c3('0x9a')]()['value']();return db[_0xc5c3('0x32')][_0xc5c3('0x4d')]({'where':{'id':_0x53a502['params']['id']}})['then'](function(_0x288b93){return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x187a7a){return _0x288b93['removeTeams'](_0x53a502[_0xc5c3('0x37')][_0xc5c3('0x74')],{'transaction':_0x187a7a})[_0xc5c3('0x2a')](function(){if(!_['isEmpty'](_0x2b49da)){return _0x288b93[_0xc5c3('0x76')](_0x2b49da,{'transaction':_0x187a7a});}})[_0xc5c3('0x2a')](function(){_0x2b49da['forEach'](function(_0x8ec6b6){socket[_0xc5c3('0x79')](_0xc5c3('0x78'),{'UserId':_0x8ec6b6,'VoicePrefixId':_0x288b93['id']});});});});});});})[_0xc5c3('0x2a')](respondWithStatusCode(_0x762654,null))[_0xc5c3('0x48')](handleError(_0x762654,null));};
\ No newline at end of file
+var _0xf4f4=['role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','context','charAt','system-','addAgents','ids','spread','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','getAgents','User','order','findOne','Team','getTeams','addTeams','findAll','Agents','online','voicePause','interface','each','upsert','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','value','removeAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','VoicePrefixes','destroy','error','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','keys','includeAll','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x4ca507,_0x472c61){var _0x35ef3d=function(_0x1837f0){while(--_0x1837f0){_0x4ca507['push'](_0x4ca507['shift']());}};_0x35ef3d(++_0x472c61);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x157fbc,_0x31ca91){_0x157fbc=_0x157fbc-0x0;var _0x326bc2=_0xf4f4[_0x157fbc];return _0x326bc2;};'use strict';var emlformat=require(_0x4f4f('0x0'));var rimraf=require(_0x4f4f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f4f('0x2'));var rp=require(_0x4f4f('0x3'));var moment=require(_0x4f4f('0x4'));var BPromise=require(_0x4f4f('0x5'));var Mustache=require(_0x4f4f('0x6'));var util=require('util');var path=require(_0x4f4f('0x7'));var sox=require('sox');var csv=require(_0x4f4f('0x8'));var ejs=require(_0x4f4f('0x9'));var fs=require('fs');var fs_extra=require(_0x4f4f('0xa'));var _=require(_0x4f4f('0xb'));var squel=require(_0x4f4f('0xc'));var crypto=require(_0x4f4f('0xd'));var jsforce=require(_0x4f4f('0xe'));var deskjs=require(_0x4f4f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4f4f('0x10'));var Papa=require(_0x4f4f('0x11'));var Redis=require(_0x4f4f('0x12'));var authService=require(_0x4f4f('0x13'));var qs=require(_0x4f4f('0x14'));var as=require(_0x4f4f('0x15'));var hardwareService=require(_0x4f4f('0x16'));var logger=require(_0x4f4f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4f4f('0x18'));var licenseUtil=require(_0x4f4f('0x19'));var db=require(_0x4f4f('0x1a'))['db'];config[_0x4f4f('0x1b')]=_[_0x4f4f('0x1c')](config[_0x4f4f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f4f('0x1d'))(new Redis(config['redis']));require(_0x4f4f('0x1e'))[_0x4f4f('0x1f')](socket);function respondWithStatusCode(_0x3e16e9,_0x38535d){_0x38535d=_0x38535d||0xcc;return function(_0x4c849f){if(_0x4c849f){return _0x3e16e9[_0x4f4f('0x20')](_0x38535d);}return _0x3e16e9['status'](_0x38535d)['end']();};}function respondWithResult(_0x58de77,_0x422894){_0x422894=_0x422894||0xc8;return function(_0x8d65a2){if(_0x8d65a2){return _0x58de77[_0x4f4f('0x21')](_0x422894)[_0x4f4f('0x22')](_0x8d65a2);}};}function respondWithFilteredResult(_0x2d5e5d,_0x1777eb){return function(_0x1245c4){if(_0x1245c4){var _0x60ce2=typeof _0x1777eb[_0x4f4f('0x23')]===_0x4f4f('0x24')&&typeof _0x1777eb[_0x4f4f('0x25')]===_0x4f4f('0x24');var _0x499277=_0x1245c4[_0x4f4f('0x26')];var _0x4622c2=_0x60ce2?0x0:_0x1777eb[_0x4f4f('0x23')];var _0x201c60=_0x60ce2?_0x1245c4[_0x4f4f('0x26')]:_0x1777eb[_0x4f4f('0x23')]+_0x1777eb[_0x4f4f('0x25')];var _0x3e33d5;if(_0x201c60>=_0x499277){_0x201c60=_0x499277;_0x3e33d5=0xc8;}else{_0x3e33d5=0xce;}_0x2d5e5d[_0x4f4f('0x21')](_0x3e33d5);return _0x2d5e5d[_0x4f4f('0x27')](_0x4f4f('0x28'),_0x4622c2+'-'+_0x201c60+'/'+_0x499277)[_0x4f4f('0x22')](_0x1245c4);}return null;};}function patchUpdates(_0x17984d){return function(_0xc78135){try{jsonpatch['apply'](_0xc78135,_0x17984d,!![]);}catch(_0x4f7261){return BPromise['reject'](_0x4f7261);}return _0xc78135[_0x4f4f('0x29')]();};}function saveUpdates(_0x43e661,_0x5186ac){return function(_0x3960ae){if(_0x3960ae){return _0x3960ae[_0x4f4f('0x2a')](_0x43e661)[_0x4f4f('0x2b')](function(_0x2ec92a){return _0x2ec92a;});}return null;};}function removeEntity(_0x113ff7,_0x31b30e){return function(_0xa6371b){if(_0xa6371b){return _0xa6371b['destroy']()[_0x4f4f('0x2b')](function(){var _0x237cf9=_0xa6371b[_0x4f4f('0x2c')]({'plain':!![]});var _0x15c79c=_0x4f4f('0x2d');return db['UserProfileResource'][_0x4f4f('0x2e')]({'where':{'type':_0x15c79c,'resourceId':_0x237cf9['id']}})[_0x4f4f('0x2b')](function(){return _0xa6371b;});})[_0x4f4f('0x2b')](function(){_0x113ff7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2490,_0x73b8bb){return function(_0x5b4f6a){if(!_0x5b4f6a){_0x4c2490[_0x4f4f('0x20')](0x194);}return _0x5b4f6a;};}function handleError(_0x39c1a8,_0x2e688a){_0x2e688a=_0x2e688a||0x1f4;return function(_0x5eb7c9){logger[_0x4f4f('0x2f')](_0x5eb7c9[_0x4f4f('0x30')]);if(_0x5eb7c9['name']){delete _0x5eb7c9[_0x4f4f('0x31')];}_0x39c1a8[_0x4f4f('0x21')](_0x2e688a)[_0x4f4f('0x32')](_0x5eb7c9);};}exports['index']=function(_0x6bdf15,_0x343c75){var _0x59bdb0={},_0x5517d7={},_0x465a36={'count':0x0,'rows':[]};var _0x305bf7=_[_0x4f4f('0x33')](db[_0x4f4f('0x34')][_0x4f4f('0x35')],function(_0x8d0f53){return{'name':_0x8d0f53[_0x4f4f('0x36')],'type':_0x8d0f53[_0x4f4f('0x37')][_0x4f4f('0x38')]};});_0x5517d7[_0x4f4f('0x39')]=_['map'](_0x305bf7,'name');_0x5517d7[_0x4f4f('0x3a')]=_['keys'](_0x6bdf15[_0x4f4f('0x3a')]);_0x5517d7[_0x4f4f('0x3b')]=_[_0x4f4f('0x3c')](_0x5517d7[_0x4f4f('0x39')],_0x5517d7[_0x4f4f('0x3a')]);_0x59bdb0[_0x4f4f('0x3d')]=_[_0x4f4f('0x3c')](_0x5517d7[_0x4f4f('0x39')],qs[_0x4f4f('0x3e')](_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x3e')]));_0x59bdb0[_0x4f4f('0x3d')]=_0x59bdb0['attributes'][_0x4f4f('0x3f')]?_0x59bdb0[_0x4f4f('0x3d')]:_0x5517d7[_0x4f4f('0x39')];if(!_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x40')](_0x4f4f('0x41'))){_0x59bdb0[_0x4f4f('0x25')]=qs[_0x4f4f('0x25')](_0x6bdf15[_0x4f4f('0x3a')]['limit']);_0x59bdb0[_0x4f4f('0x23')]=qs[_0x4f4f('0x23')](_0x6bdf15[_0x4f4f('0x3a')]['offset']);}_0x59bdb0['order']=qs[_0x4f4f('0x42')](_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x42')]);_0x59bdb0[_0x4f4f('0x43')]=qs[_0x4f4f('0x3b')](_[_0x4f4f('0x44')](_0x6bdf15[_0x4f4f('0x3a')],_0x5517d7[_0x4f4f('0x3b')]),_0x305bf7);if(_0x6bdf15[_0x4f4f('0x3a')][_0x4f4f('0x45')]){_0x59bdb0[_0x4f4f('0x43')]=_[_0x4f4f('0x46')](_0x59bdb0['where'],{'$or':_[_0x4f4f('0x33')](_0x305bf7,function(_0x1b031e){if(_0x1b031e[_0x4f4f('0x37')]!==_0x4f4f('0x47')){var _0x18e805={};_0x18e805[_0x1b031e['name']]={'$like':'%'+_0x6bdf15['query'][_0x4f4f('0x45')]+'%'};return _0x18e805;}})});}_0x59bdb0=_[_0x4f4f('0x46')]({},_0x59bdb0,_0x6bdf15[_0x4f4f('0x48')]);var _0xa8f1a5={'where':_0x59bdb0['where']};return db[_0x4f4f('0x34')]['count'](_0xa8f1a5)[_0x4f4f('0x2b')](function(_0x5a7c94){_0x465a36['count']=_0x5a7c94;if(_0x6bdf15[_0x4f4f('0x3a')]['includeAll']){_0x59bdb0[_0x4f4f('0x49')]=[{'all':!![]}];}return db[_0x4f4f('0x34')]['findAll'](_0x59bdb0);})[_0x4f4f('0x2b')](function(_0x2d8ff6){_0x465a36['rows']=_0x2d8ff6;return _0x465a36;})[_0x4f4f('0x2b')](respondWithFilteredResult(_0x343c75,_0x59bdb0))[_0x4f4f('0x4a')](handleError(_0x343c75,null));};exports[_0x4f4f('0x4b')]=function(_0x3defd0,_0x162674){var _0x62b468={'raw':![],'where':{'id':_0x3defd0[_0x4f4f('0x4c')]['id']}},_0xb0d1b2={};_0xb0d1b2[_0x4f4f('0x39')]=_[_0x4f4f('0x4d')](db[_0x4f4f('0x34')][_0x4f4f('0x35')]);_0xb0d1b2[_0x4f4f('0x3a')]=_[_0x4f4f('0x4d')](_0x3defd0[_0x4f4f('0x3a')]);_0xb0d1b2['filters']=_[_0x4f4f('0x3c')](_0xb0d1b2['model'],_0xb0d1b2['query']);_0x62b468[_0x4f4f('0x3d')]=_[_0x4f4f('0x3c')](_0xb0d1b2['model'],qs[_0x4f4f('0x3e')](_0x3defd0[_0x4f4f('0x3a')][_0x4f4f('0x3e')]));_0x62b468[_0x4f4f('0x3d')]=_0x62b468[_0x4f4f('0x3d')]['length']?_0x62b468[_0x4f4f('0x3d')]:_0xb0d1b2[_0x4f4f('0x39')];if(_0x3defd0[_0x4f4f('0x3a')][_0x4f4f('0x4e')]){_0x62b468[_0x4f4f('0x49')]=[{'all':!![]}];}_0x62b468=_[_0x4f4f('0x46')]({},_0x62b468,_0x3defd0[_0x4f4f('0x48')]);return db[_0x4f4f('0x34')][_0x4f4f('0x4f')](_0x62b468)['then'](handleEntityNotFound(_0x162674,null))[_0x4f4f('0x2b')](respondWithResult(_0x162674,null))[_0x4f4f('0x4a')](handleError(_0x162674,null));};exports['destroy']=function(_0x5ac4df,_0x5941ac){return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x5ac4df[_0x4f4f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5941ac,null))[_0x4f4f('0x2b')](removeEntity(_0x5941ac,null))['catch'](handleError(_0x5941ac,null));};exports[_0x4f4f('0x50')]=function(_0x1c181e,_0x3c0d7b){return db[_0x4f4f('0x34')][_0x4f4f('0x50')]()[_0x4f4f('0x2b')](respondWithResult(_0x3c0d7b,null))[_0x4f4f('0x4a')](handleError(_0x3c0d7b,null));};exports[_0x4f4f('0x51')]=function(_0x17f6fb,_0x4dbce2){var _0x59e207;return db[_0x4f4f('0x52')][_0x4f4f('0x53')](function(_0x4c04eb){return db['VoicePrefix'][_0x4f4f('0x51')](_0x17f6fb[_0x4f4f('0x54')],{'transaction':_0x4c04eb})[_0x4f4f('0x2b')](function(_0x55a5e4){_0x59e207=_0x55a5e4['get']({'plain':!![]});return db[_0x4f4f('0x55')][_0x4f4f('0x4f')]({'where':{'id':_0x59e207[_0x4f4f('0x56')]},'raw':!![]})[_0x4f4f('0x2b')](function(_0x37cf8e){return createVoicePrefixExtensions(_0x59e207,_0x37cf8e,_0x4c04eb);});});})[_0x4f4f('0x2b')](function(){var _0xe66fc=_0x17f6fb[_0x4f4f('0x57')][_0x4f4f('0x2c')]({'plain':!![]});if(!_0xe66fc)throw new Error(_0x4f4f('0x58'));if(_0xe66fc[_0x4f4f('0x59')]==='user'){var _0x585c06=_0x59e207;return db[_0x4f4f('0x5a')][_0x4f4f('0x4f')]({'where':{'name':_0x4f4f('0x2d'),'userProfileId':_0xe66fc[_0x4f4f('0x5b')]},'raw':!![]})['then'](function(_0x1bef77){if(_0x1bef77&&_0x1bef77['autoAssociation']===0x0){return db[_0x4f4f('0x5c')][_0x4f4f('0x51')]({'name':_0x585c06[_0x4f4f('0x31')],'resourceId':_0x585c06['id'],'type':_0x1bef77['name'],'sectionId':_0x1bef77['id']},{})[_0x4f4f('0x2b')](function(){return _0x59e207;});}else{return _0x59e207;}})[_0x4f4f('0x4a')](function(_0x23e9a9){logger['error'](_0x4f4f('0x5d'),_0x23e9a9);throw _0x23e9a9;});}return _0x59e207;})[_0x4f4f('0x2b')](respondWithResult(_0x4dbce2,null))[_0x4f4f('0x4a')](handleError(_0x4dbce2,null));};function Extension(_0x58a5dd,_0x2b01da,_0x16f162,_0x3fedae){this['context']=_0x4f4f('0x5e');this['exten']=_0x58a5dd;this[_0x4f4f('0x5f')]=_0x16f162;this[_0x4f4f('0x37')]=_0x4f4f('0x60');this[_0x4f4f('0x61')]=_0x4f4f('0x62');this[_0x4f4f('0x63')]=_0x2b01da;this[_0x4f4f('0x64')]=_0x3fedae;}function createVoicePrefixExtensions(_0xb2dfda,_0x40dffa,_0x36f369){return new BPromise(function(_0x269e0d,_0x5ba1e2){var _0x4794fe=new Extension(formatPrefixName(_0xb2dfda[_0x4f4f('0x65')]),0x1,_0x4f4f('0x66'),'Voice\x20Prefix');_0x4794fe[_0x4f4f('0x67')]=_0xb2dfda['id'];return db[_0x4f4f('0x55')][_0x4f4f('0x51')](_0x4794fe,{'transaction':_0x36f369})[_0x4f4f('0x2b')](function(_0x561411){var _0x28f9e1=_0x561411[_0x4f4f('0x2c')]({'plain':!![]});var _0xc9a47a=_[_0x4f4f('0x33')](addVoicePrefixExtensions(_0xb2dfda,_0x40dffa),function(_0x157af6){_0x157af6['VoiceExtensionId']=_0x28f9e1['id'];_0x157af6[_0x4f4f('0x67')]=_0xb2dfda['id'];return _0x157af6;});return db['VoiceExtension'][_0x4f4f('0x68')](_0xc9a47a,{'transaction':_0x36f369})[_0x4f4f('0x2b')](function(_0x2da4ea){if(!_0x2da4ea){return _0x5ba1e2(_0x4f4f('0x69'));}else{return _0x269e0d(_0x2da4ea);}})[_0x4f4f('0x4a')](function(_0x23366b){return _0x5ba1e2(_0x23366b);});});;});};function addVoicePrefixExtensions(_0x4bbbf6,_0x50590c){var _0x15c86f=[];var _0x4c42fd=formatPrefixName(_0x4bbbf6[_0x4f4f('0x65')]);_0x15c86f[_0x4f4f('0x6a')](new Extension(_0x4c42fd,0x2,_0x4f4f('0x6b'),_0x4f4f('0x6c')+_0x4bbbf6[_0x4f4f('0x31')]));if(_0x4bbbf6[_0x4f4f('0x6d')]){_0x15c86f[_0x4f4f('0x6a')](new Extension(_0x4c42fd,0x3,_0x4f4f('0x6b'),_0x4f4f('0x6e')+_0x4bbbf6[_0x4f4f('0x6d')]));}else{_0x15c86f[_0x4f4f('0x6a')](new Extension(_0x4c42fd,0x3,'NoOp','No\x20callerid\x20available'));}_0x15c86f['push'](new Extension(_0x4c42fd,0x4,_0x4f4f('0x6f'),_0x50590c[_0x4f4f('0x70')]+','+'${EXTEN:'+(0x8+_0x4bbbf6[_0x4f4f('0x31')][_0x4f4f('0x3f')])+'}'+','+0x1));return _0x15c86f;}function formatPrefixName(_0x43d6c0){var _0x3007ff='_';for(var _0x12523f=0x0;_0x12523f<_0x43d6c0[_0x4f4f('0x3f')];_0x12523f++){if(_0x43d6c0['charAt'](_0x12523f)=='-'){_0x3007ff+=_0x43d6c0[_0x4f4f('0x71')](_0x12523f);}else{_0x3007ff+='['+_0x43d6c0[_0x4f4f('0x71')](_0x12523f)+']';}}_0x3007ff+='.';return _0x3007ff;}exports[_0x4f4f('0x2a')]=function(_0x24ed71,_0x33f4fd,_0x36299e){var _0x1d756b=_0x24ed71[_0x4f4f('0x54')];_0x1d756b['prefix']=_0x4f4f('0x72')+_0x1d756b[_0x4f4f('0x31')]+'-';return db[_0x4f4f('0x52')][_0x4f4f('0x53')](function(_0x5f0efc){return db[_0x4f4f('0x34')]['update'](_0x1d756b,{'where':{'id':_0x1d756b['id']},'transaction':_0x5f0efc})[_0x4f4f('0x2b')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x1d756b['id']},'transaction':_0x5f0efc})[_0x4f4f('0x2b')](function(){return db[_0x4f4f('0x55')][_0x4f4f('0x4f')]({'where':{'id':_0x1d756b[_0x4f4f('0x56')]},'raw':!![]})['then'](function(_0x90813f){return createVoicePrefixExtensions(_0x1d756b,_0x90813f,_0x5f0efc);});});});})['then'](function(){return db[_0x4f4f('0x34')]['findById'](_0x1d756b['id']);})[_0x4f4f('0x2b')](respondWithResult(_0x33f4fd,null))[_0x4f4f('0x4a')](handleError(_0x33f4fd,null));};exports[_0x4f4f('0x73')]=function(_0x577fd9,_0x41c31c,_0x4b0ab5){return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x577fd9[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x41c31c,null))[_0x4f4f('0x2b')](function(_0x4511c6){if(_0x4511c6){return _0x4511c6[_0x4f4f('0x73')](_0x577fd9[_0x4f4f('0x54')][_0x4f4f('0x74')],_['omit'](_0x577fd9[_0x4f4f('0x54')],[_0x4f4f('0x74'),'id'])||{})[_0x4f4f('0x75')](function(_0x14e4f3){for(var _0x42c638=0x0;_0x42c638<_0x577fd9[_0x4f4f('0x54')]['ids'][_0x4f4f('0x3f')];_0x42c638+=0x1){socket[_0x4f4f('0x76')](_0x4f4f('0x77'),{'UserId':Number(_0x577fd9[_0x4f4f('0x54')]['ids'][_0x42c638]),'VoicePrefixId':Number(_0x577fd9[_0x4f4f('0x4c')]['id'])});}return _0x14e4f3;});}})[_0x4f4f('0x2b')](respondWithResult(_0x41c31c,null))[_0x4f4f('0x4a')](handleError(_0x41c31c,null));};exports['removeAgents']=function(_0x838d05,_0x40bab8,_0x5ae1b6){return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x838d05[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x40bab8,null))[_0x4f4f('0x2b')](function(_0x25cd1c){if(_0x25cd1c){return _0x25cd1c['removeAgents'](_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')])[_0x4f4f('0x2b')](function(){if(_[_0x4f4f('0x78')](_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')])){for(var _0x5b6633=0x0;_0x5b6633<_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')][_0x4f4f('0x3f')];_0x5b6633+=0x1){socket['emit'](_0x4f4f('0x79'),{'UserId':Number(_0x838d05[_0x4f4f('0x3a')][_0x4f4f('0x74')][_0x5b6633]),'VoicePrefixId':Number(_0x838d05[_0x4f4f('0x4c')]['id'])});}}else{socket[_0x4f4f('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x838d05[_0x4f4f('0x3a')]['ids']),'VoicePrefixId':Number(_0x838d05['params']['id'])});}});}})[_0x4f4f('0x2b')](respondWithStatusCode(_0x40bab8,null))[_0x4f4f('0x4a')](handleError(_0x40bab8,null));};exports[_0x4f4f('0x7a')]=function(_0x33c295,_0x762acd,_0x362c6d){var _0x1d1f5f={};var _0x19e743={};var _0x167c43;var _0x50058d;return db[_0x4f4f('0x34')]['findOne']({'where':{'id':_0x33c295[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x762acd,null))['then'](function(_0x3286b1){if(_0x3286b1){_0x167c43=_0x3286b1;_0x19e743[_0x4f4f('0x39')]=_[_0x4f4f('0x4d')](db[_0x4f4f('0x7b')][_0x4f4f('0x35')]);_0x19e743[_0x4f4f('0x3a')]=_[_0x4f4f('0x4d')](_0x33c295[_0x4f4f('0x3a')]);_0x19e743['filters']=_[_0x4f4f('0x3c')](_0x19e743[_0x4f4f('0x39')],_0x19e743[_0x4f4f('0x3a')]);_0x1d1f5f['attributes']=_[_0x4f4f('0x3c')](_0x19e743['model'],qs['fields'](_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x3e')]));_0x1d1f5f[_0x4f4f('0x3d')]=_0x1d1f5f[_0x4f4f('0x3d')]['length']?_0x1d1f5f[_0x4f4f('0x3d')]:_0x19e743['model'];_0x1d1f5f[_0x4f4f('0x7c')]=qs[_0x4f4f('0x42')](_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x42')]);_0x1d1f5f[_0x4f4f('0x43')]=qs[_0x4f4f('0x3b')](_[_0x4f4f('0x44')](_0x33c295[_0x4f4f('0x3a')],_0x19e743[_0x4f4f('0x3b')]));if(_0x33c295[_0x4f4f('0x3a')]['filter']){_0x1d1f5f['where']=_[_0x4f4f('0x46')](_0x1d1f5f[_0x4f4f('0x43')],{'$or':_[_0x4f4f('0x33')](_0x1d1f5f[_0x4f4f('0x3d')],function(_0x515d05){var _0x485129={};_0x485129[_0x515d05]={'$like':'%'+_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x45')]+'%'};return _0x485129;})});}_0x1d1f5f=_[_0x4f4f('0x46')]({},_0x1d1f5f,_0x33c295[_0x4f4f('0x48')]);return _0x167c43[_0x4f4f('0x7a')](_0x1d1f5f);}})['then'](function(_0x10fa9e){if(_0x10fa9e){_0x50058d=_0x10fa9e[_0x4f4f('0x3f')];if(!_0x33c295[_0x4f4f('0x3a')][_0x4f4f('0x40')](_0x4f4f('0x41'))){_0x1d1f5f['limit']=qs[_0x4f4f('0x25')](_0x33c295['query']['limit']);_0x1d1f5f[_0x4f4f('0x23')]=qs[_0x4f4f('0x23')](_0x33c295[_0x4f4f('0x3a')]['offset']);}return _0x167c43[_0x4f4f('0x7a')](_0x1d1f5f);}})[_0x4f4f('0x2b')](function(_0x56015c){if(_0x56015c){return _0x56015c?{'count':_0x50058d,'rows':_0x56015c}:null;}})[_0x4f4f('0x2b')](respondWithResult(_0x762acd,null))[_0x4f4f('0x4a')](handleError(_0x762acd,null));};exports['getTeams']=function(_0xaa0e50,_0x23e8bd,_0x3b5214){var _0x38ea5d={};var _0x4632c0={};var _0x6ec076;var _0x56f2c5;return db[_0x4f4f('0x34')][_0x4f4f('0x7d')]({'where':{'id':_0xaa0e50[_0x4f4f('0x4c')]['id']}})[_0x4f4f('0x2b')](handleEntityNotFound(_0x23e8bd,null))[_0x4f4f('0x2b')](function(_0x3d0e57){if(_0x3d0e57){_0x6ec076=_0x3d0e57;_0x4632c0[_0x4f4f('0x39')]=_[_0x4f4f('0x4d')](db[_0x4f4f('0x7e')][_0x4f4f('0x35')]);_0x4632c0[_0x4f4f('0x3a')]=_[_0x4f4f('0x4d')](_0xaa0e50[_0x4f4f('0x3a')]);_0x4632c0[_0x4f4f('0x3b')]=_[_0x4f4f('0x3c')](_0x4632c0['model'],_0x4632c0[_0x4f4f('0x3a')]);_0x38ea5d['attributes']=_[_0x4f4f('0x3c')](_0x4632c0[_0x4f4f('0x39')],qs[_0x4f4f('0x3e')](_0xaa0e50['query'][_0x4f4f('0x3e')]));_0x38ea5d[_0x4f4f('0x3d')]=_0x38ea5d[_0x4f4f('0x3d')][_0x4f4f('0x3f')]?_0x38ea5d[_0x4f4f('0x3d')]:_0x4632c0['model'];_0x38ea5d[_0x4f4f('0x7c')]=qs[_0x4f4f('0x42')](_0xaa0e50[_0x4f4f('0x3a')]['sort']);_0x38ea5d[_0x4f4f('0x43')]=qs[_0x4f4f('0x3b')](_[_0x4f4f('0x44')](_0xaa0e50['query'],_0x4632c0[_0x4f4f('0x3b')]));if(_0xaa0e50['query'][_0x4f4f('0x45')]){_0x38ea5d['where']=_['merge'](_0x38ea5d['where'],{'$or':_['map'](_0x38ea5d['attributes'],function(_0x446cbd){var _0x2f2cb9={};_0x2f2cb9[_0x446cbd]={'$like':'%'+_0xaa0e50['query']['filter']+'%'};return _0x2f2cb9;})});}_0x38ea5d=_[_0x4f4f('0x46')]({},_0x38ea5d,_0xaa0e50[_0x4f4f('0x48')]);return _0x6ec076[_0x4f4f('0x7f')](_0x38ea5d);}})['then'](function(_0x5ad9f6){if(_0x5ad9f6){_0x56f2c5=_0x5ad9f6['length'];if(!_0xaa0e50[_0x4f4f('0x3a')]['hasOwnProperty']('nolimit')){_0x38ea5d[_0x4f4f('0x25')]=qs['limit'](_0xaa0e50[_0x4f4f('0x3a')][_0x4f4f('0x25')]);_0x38ea5d['offset']=qs[_0x4f4f('0x23')](_0xaa0e50[_0x4f4f('0x3a')]['offset']);}return _0x6ec076[_0x4f4f('0x7f')](_0x38ea5d);}})[_0x4f4f('0x2b')](function(_0x3be76f){if(_0x3be76f){return _0x3be76f?{'count':_0x56f2c5,'rows':_0x3be76f}:null;}})[_0x4f4f('0x2b')](respondWithResult(_0x23e8bd,null))['catch'](handleError(_0x23e8bd,null));};exports[_0x4f4f('0x80')]=function(_0x349e9c,_0x2fc478,_0x3a745a){var _0x53c962=_0x349e9c[_0x4f4f('0x54')][_0x4f4f('0x74')];var _0x27b573;return db[_0x4f4f('0x7e')][_0x4f4f('0x81')]({'where':{'id':_0x53c962},'attributes':['id'],'include':[{'model':db[_0x4f4f('0x7b')],'as':_0x4f4f('0x82'),'attributes':['id',_0x4f4f('0x31'),_0x4f4f('0x83'),_0x4f4f('0x84'),_0x4f4f('0x85')],'raw':!![]}]})[_0x4f4f('0x2b')](function(_0x3f87c8){if(_0x3f87c8){_0x27b573=_0x3f87c8;var _0x22e619=_['flatMap'](_0x3f87c8,function(_0x3bfc19){var _0x150474=_0x3bfc19[_0x4f4f('0x2c')]({'plain':!![]});return _0x150474[_0x4f4f('0x82')];});return db[_0x4f4f('0x34')][_0x4f4f('0x4f')]({'where':{'id':_0x349e9c['params']['id']}})[_0x4f4f('0x2b')](function(_0x5a4d26){return db[_0x4f4f('0x52')]['transaction'](function(_0x2d1cc1){return _0x5a4d26['addTeams'](_0x53c962,{'transaction':_0x2d1cc1})[_0x4f4f('0x2b')](function(){return BPromise[_0x4f4f('0x86')](_0x27b573,function(_0x2b6319){return db['TeamVoicePrefix'][_0x4f4f('0x87')]({'TeamId':_0x2b6319['id'],'VoicePrefixId':_0x349e9c[_0x4f4f('0x4c')]['id']},{'transaction':_0x2d1cc1});});})[_0x4f4f('0x2b')](function(){return BPromise[_0x4f4f('0x86')](_0x22e619,function(_0xbe8586){return db['UserVoicePrefix'][_0x4f4f('0x88')]({'where':{'UserId':_0xbe8586['id'],'VoicePrefixId':_0x349e9c['params']['id']},'transaction':_0x2d1cc1});});})[_0x4f4f('0x2b')](function(){_0x22e619[_0x4f4f('0x89')](function(_0x4bb547){socket['emit']('userVoicePrefix:save',{'UserId':_0x4bb547['id'],'VoicePrefixId':_0x5a4d26['id']});});});});});}})[_0x4f4f('0x2b')](respondWithStatusCode(_0x2fc478,null))[_0x4f4f('0x4a')](handleError(_0x2fc478,null));};exports[_0x4f4f('0x8a')]=function(_0x4c178d,_0x2cf10a,_0x53a849){return db[_0x4f4f('0x7e')]['findAll']({'where':{'id':_0x4c178d[_0x4f4f('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4f4f('0x7b')],'as':_0x4f4f('0x82'),'attributes':['id'],'raw':!![]}]})[_0x4f4f('0x2b')](handleEntityNotFound(_0x2cf10a,null))[_0x4f4f('0x2b')](function(_0x5063a6){var _0x1ce179=_[_0x4f4f('0x33')](_0x5063a6,'id');var _0x3f2b27=[];var _0x28049b=[];var _0x13418d=squel[_0x4f4f('0x8b')]();_0x13418d[_0x4f4f('0x8c')](_0x4f4f('0x8d'))[_0x4f4f('0x8e')](_0x4f4f('0x8f'),'tq')[_0x4f4f('0x90')]('user_has_teams','ut',_0x4f4f('0x91'))[_0x4f4f('0x43')](_0x4f4f('0x92'),_0x4c178d[_0x4f4f('0x4c')]['id']);for(var _0x223179=0x0;_0x223179<_0x5063a6['length'];_0x223179+=0x1){let _0x373ead=_0x5063a6[_0x223179];for(var _0x53dfb2=0x0;_0x53dfb2<_0x373ead[_0x4f4f('0x82')][_0x4f4f('0x3f')];_0x53dfb2+=0x1){let _0x3fcb64=_0x373ead[_0x4f4f('0x82')][_0x53dfb2];var _0x57405d=_0x13418d[_0x4f4f('0x93')]();_0x57405d['where'](_0x4f4f('0x94'),_0x3fcb64['id']);_0x28049b[_0x4f4f('0x6a')](db[_0x4f4f('0x52')][_0x4f4f('0x3a')](_0x57405d[_0x4f4f('0x95')](),{'type':db[_0x4f4f('0x52')][_0x4f4f('0x96')][_0x4f4f('0x97')]})[_0x4f4f('0x2b')](function(_0x3ce86c){if(_0x3ce86c['length']===0x1){return _0x3fcb64['id'];}else{var _0xe830ee=_['every'](_[_0x4f4f('0x33')](_0x3ce86c,'TeamId'),function(_0x277c96){return _[_0x4f4f('0x98')](_0x1ce179,_0x277c96);});if(_0xe830ee){return _0x3fcb64['id'];}}}));}}return BPromise[_0x4f4f('0x99')](_0x28049b)[_0x4f4f('0x2b')](function(_0x3a0382){_0x3f2b27=_(_0x3f2b27)[_0x4f4f('0x9a')](_0x3a0382)[_0x4f4f('0x9b')]()[_0x4f4f('0x9c')]();return db['VoicePrefix'][_0x4f4f('0x4f')]({'where':{'id':_0x4c178d[_0x4f4f('0x4c')]['id']}})['then'](function(_0x379a2e){return db[_0x4f4f('0x52')][_0x4f4f('0x53')](function(_0x35e9e7){return _0x379a2e['removeTeams'](_0x4c178d[_0x4f4f('0x3a')]['ids'],{'transaction':_0x35e9e7})[_0x4f4f('0x2b')](function(){if(!_['isEmpty'](_0x3f2b27)){return _0x379a2e[_0x4f4f('0x9d')](_0x3f2b27,{'transaction':_0x35e9e7});}})['then'](function(){_0x3f2b27['forEach'](function(_0x3f2df9){socket[_0x4f4f('0x76')](_0x4f4f('0x79'),{'UserId':_0x3f2df9,'VoicePrefixId':_0x379a2e['id']});});});});});});})[_0x4f4f('0x2b')](respondWithStatusCode(_0x2cf10a,null))['catch'](handleError(_0x2cf10a,null));};
\ No newline at end of file
index c56aa75..7a59ffc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72a7=['hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x6942e0,_0x131e6d){var _0xb86490=function(_0x2fd5d7){while(--_0x2fd5d7){_0x6942e0['push'](_0x6942e0['shift']());}};_0xb86490(++_0x131e6d);}(_0x72a7,0xde));var _0x772a=function(_0x1bd88d,_0x3a9825){_0x1bd88d=_0x1bd88d-0x0;var _0x39fd04=_0x72a7[_0x1bd88d];return _0x39fd04;};'use strict';var EventEmitter=require(_0x772a('0x0'));var VoicePrefix=require(_0x772a('0x1'))['db'][_0x772a('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x772a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x772a('0x4'),'afterDestroy':_0x772a('0x5')};function emitEvent(_0x538f25){return function(_0x25ab0c,_0x45671d,_0x16af61){VoicePrefixEvents[_0x772a('0x6')](_0x538f25+':'+_0x25ab0c['id'],_0x25ab0c);VoicePrefixEvents[_0x772a('0x6')](_0x538f25,_0x25ab0c);_0x16af61(null);};}for(var e in events){if(events[_0x772a('0x7')](e)){var event=events[e];VoicePrefix[_0x772a('0x8')](e,emitEvent(event));}}module[_0x772a('0x9')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x5492=['events','../../mysqldb','save','remove','emit','exports'];(function(_0x4b05fd,_0x22f222){var _0x339221=function(_0x31762d){while(--_0x31762d){_0x4b05fd['push'](_0x4b05fd['shift']());}};_0x339221(++_0x22f222);}(_0x5492,0x1c2));var _0x2549=function(_0x37b3ef,_0x49ccd8){_0x37b3ef=_0x37b3ef-0x0;var _0x200dbe=_0x5492[_0x37b3ef];return _0x200dbe;};'use strict';var EventEmitter=require(_0x2549('0x0'));var VoicePrefix=require(_0x2549('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2549('0x2'),'afterUpdate':'update','afterDestroy':_0x2549('0x3')};function emitEvent(_0x2d8731){return function(_0x2428ce,_0x259d80,_0x55bd9a){VoicePrefixEvents[_0x2549('0x4')](_0x2d8731+':'+_0x2428ce['id'],_0x2428ce);VoicePrefixEvents['emit'](_0x2d8731,_0x2428ce);_0x55bd9a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x2549('0x5')]=VoicePrefixEvents;
\ No newline at end of file
index 2b4ecd5..4aeb7a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2801=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes','exports','define','voice_prefixes','lodash'];(function(_0x37e8a1,_0x225770){var _0x14c5d0=function(_0x2860fd){while(--_0x2860fd){_0x37e8a1['push'](_0x37e8a1['shift']());}};_0x14c5d0(++_0x225770);}(_0x2801,0x110));var _0x1280=function(_0x216aef,_0x3144ae){_0x216aef=_0x216aef-0x0;var _0x25de70=_0x2801[_0x216aef];return _0x25de70;};'use strict';var _=require(_0x1280('0x0'));var util=require(_0x1280('0x1'));var logger=require(_0x1280('0x2'))(_0x1280('0x3'));var moment=require(_0x1280('0x4'));var BPromise=require(_0x1280('0x5'));var rp=require(_0x1280('0x6'));var fs=require('fs');var path=require(_0x1280('0x7'));var rimraf=require('rimraf');var config=require(_0x1280('0x8'));var attributes=require(_0x1280('0x9'));module[_0x1280('0xa')]=function(_0x3dfe13,_0x34dde0){return _0x3dfe13[_0x1280('0xb')]('VoicePrefix',attributes,{'tableName':_0x1280('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x52e6=['voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voicePrefix.attributes','exports','define'];(function(_0x5b6884,_0x13b5fd){var _0x1942c1=function(_0x2cae72){while(--_0x2cae72){_0x5b6884['push'](_0x5b6884['shift']());}};_0x1942c1(++_0x13b5fd);}(_0x52e6,0x11f));var _0x652e=function(_0x1e2c34,_0x77a982){_0x1e2c34=_0x1e2c34-0x0;var _0x58ac28=_0x52e6[_0x1e2c34];return _0x58ac28;};'use strict';var _=require('lodash');var util=require(_0x652e('0x0'));var logger=require(_0x652e('0x1'))(_0x652e('0x2'));var moment=require(_0x652e('0x3'));var BPromise=require(_0x652e('0x4'));var rp=require(_0x652e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x652e('0x6'));var config=require('../../config/environment');var attributes=require(_0x652e('0x7'));module[_0x652e('0x8')]=function(_0xf79d90,_0x3faa65){return _0xf79d90[_0x652e('0x9')]('VoicePrefix',attributes,{'tableName':_0x652e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4106ecf..0d78e00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5078=['info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then'];(function(_0x3279f1,_0x28231a){var _0xad734=function(_0x6cdc87){while(--_0x6cdc87){_0x3279f1['push'](_0x3279f1['shift']());}};_0xad734(++_0x28231a);}(_0x5078,0x148));var _0x8507=function(_0xde9484,_0x5ba41d){_0xde9484=_0xde9484-0x0;var _0x3a20a9=_0x5078[_0xde9484];return _0x3a20a9;};'use strict';var _=require(_0x8507('0x0'));var util=require(_0x8507('0x1'));var moment=require(_0x8507('0x2'));var BPromise=require(_0x8507('0x3'));var rs=require(_0x8507('0x4'));var fs=require('fs');var Redis=require(_0x8507('0x5'));var db=require(_0x8507('0x6'))['db'];var utils=require(_0x8507('0x7'));var logger=require(_0x8507('0x8'))(_0x8507('0x9'));var config=require(_0x8507('0xa'));var jayson=require(_0x8507('0xb'));var client=jayson[_0x8507('0xc')][_0x8507('0xd')]({'port':0x232a});config[_0x8507('0xe')]=_[_0x8507('0xf')](config['redis'],{'host':_0x8507('0x10'),'port':0x18eb});var socket=require(_0x8507('0x11'))(new Redis(config[_0x8507('0xe')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x168085,_0x1c71f5,_0x3c8478){return new BPromise(function(_0x339c13,_0x413984){return client[_0x8507('0x12')](_0x168085,_0x3c8478)[_0x8507('0x13')](function(_0x494fed){logger[_0x8507('0x14')](_0x8507('0x15'),_0x1c71f5,_0x8507('0x16'));logger[_0x8507('0x17')](_0x8507('0x18'),_0x1c71f5,_0x8507('0x16'),JSON['stringify'](_0x494fed));if(_0x494fed[_0x8507('0x19')]){if(_0x494fed[_0x8507('0x19')][_0x8507('0x1a')]===0x1f4){logger[_0x8507('0x19')](_0x8507('0x15'),_0x1c71f5,_0x494fed[_0x8507('0x19')]['message']);return _0x413984(_0x494fed['error'][_0x8507('0x1b')]);}logger[_0x8507('0x19')](_0x8507('0x15'),_0x1c71f5,_0x494fed['error'][_0x8507('0x1b')]);return _0x339c13(_0x494fed[_0x8507('0x19')][_0x8507('0x1b')]);}else{logger[_0x8507('0x14')](_0x8507('0x15'),_0x1c71f5,_0x8507('0x16'));_0x339c13(_0x494fed[_0x8507('0x1c')][_0x8507('0x1b')]);}})['catch'](function(_0x5d0f74){logger[_0x8507('0x19')](_0x8507('0x15'),_0x1c71f5,_0x5d0f74);_0x413984(_0x5d0f74);});});}
\ No newline at end of file
+var _0x8f9d=['request','then','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register'];(function(_0x5369be,_0x4cbfae){var _0x201657=function(_0x250fbb){while(--_0x250fbb){_0x5369be['push'](_0x5369be['shift']());}};_0x201657(++_0x4cbfae);}(_0x8f9d,0x93));var _0xd8f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8f9d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var moment=require(_0xd8f9('0x1'));var BPromise=require('bluebird');var rs=require(_0xd8f9('0x2'));var fs=require('fs');var Redis=require(_0xd8f9('0x3'));var db=require(_0xd8f9('0x4'))['db'];var utils=require(_0xd8f9('0x5'));var logger=require(_0xd8f9('0x6'))(_0xd8f9('0x7'));var config=require(_0xd8f9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd8f9('0x9')][_0xd8f9('0xa')]({'port':0x232a});config[_0xd8f9('0xb')]=_[_0xd8f9('0xc')](config[_0xd8f9('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd8f9('0xd'))(new Redis(config[_0xd8f9('0xb')]));require('./voicePrefix.socket')[_0xd8f9('0xe')](socket);function respondWithRpcPromise(_0x4ac0ea,_0x5caee9,_0x421aca){return new BPromise(function(_0x3d0bea,_0x32b880){return client[_0xd8f9('0xf')](_0x4ac0ea,_0x421aca)[_0xd8f9('0x10')](function(_0x3a1db8){logger[_0xd8f9('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x5caee9,_0xd8f9('0x12'));logger['debug'](_0xd8f9('0x13'),_0x5caee9,_0xd8f9('0x12'),JSON[_0xd8f9('0x14')](_0x3a1db8));if(_0x3a1db8['error']){if(_0x3a1db8[_0xd8f9('0x15')][_0xd8f9('0x16')]===0x1f4){logger[_0xd8f9('0x15')](_0xd8f9('0x17'),_0x5caee9,_0x3a1db8['error'][_0xd8f9('0x18')]);return _0x32b880(_0x3a1db8[_0xd8f9('0x15')][_0xd8f9('0x18')]);}logger[_0xd8f9('0x15')](_0xd8f9('0x17'),_0x5caee9,_0x3a1db8[_0xd8f9('0x15')][_0xd8f9('0x18')]);return _0x3d0bea(_0x3a1db8['error']['message']);}else{logger[_0xd8f9('0x11')](_0xd8f9('0x17'),_0x5caee9,'request\x20sent');_0x3d0bea(_0x3a1db8[_0xd8f9('0x19')]['message']);}})[_0xd8f9('0x1a')](function(_0x49f2e7){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x5caee9,_0x49f2e7);_0x32b880(_0x49f2e7);});});}
\ No newline at end of file
index 0bbb8ff..858113a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9585=['length','voicePrefix:','save','update','emit','removeListener'];(function(_0x42283a,_0x1d6205){var _0x3de9f2=function(_0xbf4fb9){while(--_0xbf4fb9){_0x42283a['push'](_0x42283a['shift']());}};_0x3de9f2(++_0x1d6205);}(_0x9585,0x15e));var _0x5958=function(_0x4cc4f6,_0x17ebd9){_0x4cc4f6=_0x4cc4f6-0x0;var _0xd79fb9=_0x9585[_0x4cc4f6];return _0xd79fb9;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x5958('0x0'),'remove',_0x5958('0x1')];function createListener(_0x5a274d,_0x384f6c){return function(_0x1a8c5e){_0x384f6c[_0x5958('0x2')](_0x5a274d,_0x1a8c5e);};}function removeListener(_0x1f8027,_0x28be1b){return function(){VoicePrefixEvents[_0x5958('0x3')](_0x1f8027,_0x28be1b);};}exports['register']=function(_0x202d6f){for(var _0x48ddaf=0x0,_0xc050d5=events[_0x5958('0x4')];_0x48ddaf<_0xc050d5;_0x48ddaf++){var _0x264827=events[_0x48ddaf];var _0x5be2d9=createListener(_0x5958('0x5')+_0x264827,_0x202d6f);VoicePrefixEvents['on'](_0x264827,_0x5be2d9);}};
\ No newline at end of file
+var _0x524a=['./voicePrefix.events','save','remove','update','emit','removeListener','register'];(function(_0x6ef5eb,_0x34a9c6){var _0x47921f=function(_0x5b4d12){while(--_0x5b4d12){_0x6ef5eb['push'](_0x6ef5eb['shift']());}};_0x47921f(++_0x34a9c6);}(_0x524a,0xf5));var _0xa524=function(_0x1db4bb,_0x2d51f4){_0x1db4bb=_0x1db4bb-0x0;var _0x2fe445=_0x524a[_0x1db4bb];return _0x2fe445;};'use strict';var VoicePrefixEvents=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(){VoicePrefixEvents[_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('voicePrefix:'+_0x3a2dd6,_0x16227b);VoicePrefixEvents['on'](_0x3a2dd6,_0x11aa98);}};
\ No newline at end of file
index cc5469f..e1d3fa3 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(_0x31d6c2,_0x422dcd){var _0x295dd0=function(_0x2b5dd1){while(--_0x2b5dd1){_0x31d6c2['push'](_0x31d6c2['shift']());}};_0x295dd0(++_0x422dcd);}(_0xb10b,0x12a));var _0xbb10=function(_0x54afe3,_0x258ce5){_0x54afe3=_0x54afe3-0x0;var _0x3e76d6=_0xb10b[_0x54afe3];return _0x3e76d6;};'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(_0x23a079,_0xb8c9aa){var _0x53f2a5=function(_0x1b3dc5){while(--_0x1b3dc5){_0x23a079['push'](_0x23a079['shift']());}};_0x53f2a5(++_0xb8c9aa);}(_0xb10b,0x12a));var _0xbb10=function(_0x4ad6e4,_0x103161){_0x4ad6e4=_0x4ad6e4-0x0;var _0x11e62a=_0xb10b[_0x4ad6e4];return _0x11e62a;};'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 1da860a..f3fbc39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa801=['ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','type','getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','wrapuptime','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xa801,0x13d));var _0x1a80=function(_0x434faa,_0x556ff9){_0x434faa=_0x434faa-0x0;var _0x6708f6=_0xa801[_0x434faa];return _0x6708f6;};'use strict';var Sequelize=require(_0x1a80('0x0'));module[_0x1a80('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1a80('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x4'),_0x1a80('0x5')),'allowNull':![],'defaultValue':_0x1a80('0x4')},'musiconhold':{'type':Sequelize[_0x1a80('0x6')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x1a80('0x7'),_0x1a80('0x8'),_0x1a80('0x9'),'random',_0x1a80('0xa'),_0x1a80('0xb'),_0x1a80('0xc'),_0x1a80('0xd')),'allowNull':![],'defaultValue':_0x1a80('0x7'),'set':function(_0x206ae6){this[_0x1a80('0xe')](_0x1a80('0xf'),_0x206ae6?_0x206ae6:_0x1a80('0xa'));},'get':function(){var _0x2de2b7=this['getDataValue'](_0x1a80('0x10'));var _0x25512d=this[_0x1a80('0x11')]('dialMethod');var _0x2cf545=this[_0x1a80('0x11')](_0x1a80('0xf'));if(_0x2de2b7===_0x1a80('0x4')){return _0x2cf545;}if(_0x25512d===_0x1a80('0x12')&&_0x2cf545===_0x1a80('0xa')||_0x25512d==='booked'&&_0x2cf545===_0x1a80('0x13')){return _0x2cf545;}if(_0x25512d===_0x1a80('0x14')||_0x25512d===_0x1a80('0x15')||_0x25512d===_0x1a80('0x16')){return _0x2cf545;}return null;}},'servicelevel':{'type':Sequelize[_0x1a80('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1a80('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1a80('0x17')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1a80('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x1a80('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x1a80('0x18'),'no'),'defaultValue':_0x1a80('0x18')},'autopause':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x18'),'no',_0x1a80('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1a80('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x1a80('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1a80('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1a80('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1a80('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1a80('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1a80('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1a80('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x1a80('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x1a80('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1a80('0x3')]('yes','no'),'defaultValue':_0x1a80('0x18')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x1a80('0x18'),'no',_0x1a80('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1a80('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1a80('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1a80('0x6')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1a80('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1a80('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1a80('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x1a80('0x6')]},'queue_quantity2':{'type':Sequelize[_0x1a80('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x1a80('0x6')]},'queue_less_than':{'type':Sequelize[_0x1a80('0x6')]},'periodic_announce':{'type':Sequelize[_0x1a80('0x1b')],'set':function(_0x18a706){this[_0x1a80('0xe')](_0x1a80('0x1c'),_0x18a706?_0x18a706['join'](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x1a80('0x11')](_0x1a80('0x1c'))[_0x1a80('0x1d')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x1a80('0x18'),'set':function(_0x15a786){this[_0x1a80('0xe')](_0x1a80('0x1e'),_0x15a786?_0x15a786[_0x1a80('0x1f')](','):undefined);},'get':function(){return this[_0x1a80('0x11')]('joinempty')?this[_0x1a80('0x11')](_0x1a80('0x1e'))[_0x1a80('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1a80('0x6')],'defaultValue':'no','set':function(_0x55f003){this[_0x1a80('0xe')](_0x1a80('0x20'),_0x55f003?_0x55f003['join'](','):undefined);},'get':function(){return this[_0x1a80('0x11')](_0x1a80('0x20'))?this[_0x1a80('0x11')](_0x1a80('0x20'))[_0x1a80('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1a80('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1a80('0x6')]},'description':{'type':Sequelize[_0x1a80('0x6')]},'acw':{'type':Sequelize[_0x1a80('0x21')],'defaultValue':0x0,'set':function(_0x2ff498){this[_0x1a80('0xe')]('acw',_0x2ff498);if(_0x2ff498){if(this[_0x1a80('0x11')]('wrapuptime')<0x2){this['setDataValue'](_0x1a80('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x23'),'progressive',_0x1a80('0x16'),'predictive',_0x1a80('0x12')),'defaultValue':_0x1a80('0x14'),'comment':_0x1a80('0x24')},'dialLimitChannel':{'type':Sequelize[_0x1a80('0x17')](0x4)[_0x1a80('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1a80('0x26')},'dialLimitQueue':{'type':Sequelize[_0x1a80('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x1a80('0x27')](0x2)[_0x1a80('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x1a80('0x28'),_0x1a80('0x29')),'defaultValue':_0x1a80('0x29'),'comment':_0x1a80('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1a80('0x27')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x1a80('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1a80('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1a80('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0x1a80('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x1a80('0x6')],'defaultValue':'tTxX','comment':_0x1a80('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x1a80('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a80('0x2d')},'dialQueueProject':{'type':Sequelize[_0x1a80('0x6')],'comment':_0x1a80('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1a80('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a80('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1a80('0x17')](0x5)[_0x1a80('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1a80('0x17')](0x3)[_0x1a80('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a80('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1a80('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a80('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1a80('0x17')](0x3)[_0x1a80('0x25')],'defaultValue':0x3,'comment':_0x1a80('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a80('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1a80('0x17')](0x3)[_0x1a80('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1a80('0x34')},'dialTimezone':{'type':Sequelize[_0x1a80('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x35'),_0x1a80('0x36'),_0x1a80('0x37')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1a80('0x38')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1a80('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1a80('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x1a80('0x17')](0x9)[_0x1a80('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1a80('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1a80('0x17')](0x9)[_0x1a80('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1a80('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1a80('0x17')](0x9)[_0x1a80('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1a80('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x1a80('0x17')](0x9)[_0x1a80('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1a80('0x17')](0x9)[_0x1a80('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1a80('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1a80('0x17')](0x9)[_0x1a80('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1a80('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1a80('0x17')](0x5)[_0x1a80('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1a80('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1a80('0x17')](0x9)[_0x1a80('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1a80('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x1a80('0x17')](0x5)[_0x1a80('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1a80('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1a80('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1a80('0x3')](_0x1a80('0x43'),_0x1a80('0x44')),'defaultValue':_0x1a80('0x43')},'dialQueueProject2':{'type':Sequelize[_0x1a80('0x6')],'comment':_0x1a80('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1a80('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x1a80('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1a80('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1a80('0x45')},'dialCutDigit':{'type':Sequelize[_0x1a80('0x17')](0x3)[_0x1a80('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1a80('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1a80('0x17')](0x3)[_0x1a80('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a80('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1a80('0x17')](0x5)[_0x1a80('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a80('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x1a80('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a80('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0x1a80('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a80('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1a80('0x17')](0x3)[_0x1a80('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a80('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1a80('0x17')](0x5)[_0x1a80('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a80('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0x1a80('0x17')](0x3)[_0x1a80('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a80('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1a80('0x17')](0x5)[_0x1a80('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a80('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1a80('0x17')](0x3)[_0x1a80('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1a80('0x17')](0x5)[_0x1a80('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a80('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1a80('0x17')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1a80('0x21')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x103a0c){if(!_0x103a0c)this[_0x1a80('0xe')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x1a80('0x50'),_0x103a0c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1a80('0x17')](0x3)[_0x1a80('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x1a80('0x21')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x2811=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\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','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','wrapuptime','BOOLEAN','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','UNSIGNED','agentBusyFactor','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)','tTxX','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\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x13834a,_0x4b6d38){var _0x20050c=function(_0x588874){while(--_0x588874){_0x13834a['push'](_0x13834a['shift']());}};_0x20050c(++_0x4b6d38);}(_0x2811,0x158));var _0x1281=function(_0x481eaa,_0x5c1098){_0x481eaa=_0x481eaa-0x0;var _0x12f613=_0x2811[_0x481eaa];return _0x12f613;};'use strict';var Sequelize=require(_0x1281('0x0'));module[_0x1281('0x1')]={'name':{'type':Sequelize[_0x1281('0x2')],'allowNull':![],'unique':_0x1281('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x5'),_0x1281('0x6')),'allowNull':![],'defaultValue':_0x1281('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x1281('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1281('0x4')]('rr',_0x1281('0x7'),_0x1281('0x8'),_0x1281('0x9'),_0x1281('0xa'),'rrmemory',_0x1281('0xb'),_0x1281('0xc'),_0x1281('0xd')),'allowNull':![],'defaultValue':_0x1281('0x7'),'set':function(_0x1bf0cc){this[_0x1281('0xe')](_0x1281('0xf'),_0x1bf0cc?_0x1bf0cc:_0x1281('0x10'));},'get':function(){var _0x2d540a=this[_0x1281('0x11')](_0x1281('0x12'));var _0xa7617a=this[_0x1281('0x11')](_0x1281('0x13'));var _0x1b9716=this[_0x1281('0x11')](_0x1281('0xf'));if(_0x2d540a===_0x1281('0x5')){return _0x1b9716;}if(_0xa7617a===_0x1281('0x14')&&_0x1b9716===_0x1281('0x10')||_0xa7617a===_0x1281('0x14')&&_0x1b9716===_0x1281('0x15')){return _0x1b9716;}if(_0xa7617a===_0x1281('0x16')||_0xa7617a==='predictive'||_0xa7617a===_0x1281('0x17')){return _0x1b9716;}return null;}},'servicelevel':{'type':Sequelize[_0x1281('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1281('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1281('0x18')](0xb)},'timeout':{'type':Sequelize[_0x1281('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1281('0x2')]},'weight':{'type':Sequelize[_0x1281('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x19'),'no'),'defaultValue':_0x1281('0x19')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x1281('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1281('0x18')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1281('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x1281('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1281('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1281('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1281('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x19'),'no'),'defaultValue':_0x1281('0x19')},'announce_holdtime':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x19'),'no',_0x1281('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1281('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1281('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x1281('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1281('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1281('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1281('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1281('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1281('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1281('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1281('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1281('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x1281('0x2')]},'queue_quantity2':{'type':Sequelize[_0x1281('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x1281('0x2')]},'periodic_announce':{'type':Sequelize[_0x1281('0x1c')],'set':function(_0x4193a8){this['setDataValue'](_0x1281('0x1d'),_0x4193a8?_0x4193a8['join'](','):[]);},'get':function(){return this['getDataValue'](_0x1281('0x1d'))?this[_0x1281('0x11')](_0x1281('0x1d'))[_0x1281('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x1281('0x2')],'defaultValue':_0x1281('0x19'),'set':function(_0x3f4825){this[_0x1281('0xe')](_0x1281('0x1f'),_0x3f4825?_0x3f4825[_0x1281('0x20')](','):undefined);},'get':function(){return this[_0x1281('0x11')](_0x1281('0x1f'))?this[_0x1281('0x11')](_0x1281('0x1f'))[_0x1281('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1281('0x2')],'defaultValue':'no','set':function(_0x5e6c8f){this[_0x1281('0xe')](_0x1281('0x21'),_0x5e6c8f?_0x5e6c8f['join'](','):undefined);},'get':function(){return this[_0x1281('0x11')](_0x1281('0x21'))?this[_0x1281('0x11')](_0x1281('0x21'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1281('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1281('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x2f62d){this['setDataValue']('acw',_0x2f62d);if(_0x2f62d){if(this[_0x1281('0x11')]('wrapuptime')<0x2){this[_0x1281('0xe')](_0x1281('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1281('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1281('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x1281('0x4')]('preview',_0x1281('0x16'),_0x1281('0x17'),'predictive',_0x1281('0x14')),'defaultValue':_0x1281('0x16'),'comment':_0x1281('0x24')},'dialLimitChannel':{'type':Sequelize[_0x1281('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1281('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1281('0x26')},'dialPowerLevel':{'type':Sequelize[_0x1281('0x27')](0x2)[_0x1281('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x29'),_0x1281('0x2a')),'defaultValue':_0x1281('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1281('0x27')](0x2)[_0x1281('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1281('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x1281('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1281('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1281('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1281('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1281('0x18')](0x3)[_0x1281('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1281('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x1281('0x2')],'defaultValue':_0x1281('0x2e'),'comment':_0x1281('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x1281('0x18')](0x3)[_0x1281('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x1281('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1281('0x18')](0x3)[_0x1281('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1281('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1281('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1281('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x1281('0x18')](0x3)[_0x1281('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1281('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1281('0x18')](0x5)[_0x1281('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1281('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1281('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1281('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1281('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1281('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1281('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1281('0x37')},'dialTimezone':{'type':Sequelize[_0x1281('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1281('0x2')],'defaultValue':_0x1281('0x38')},'dialPrefix':{'type':Sequelize[_0x1281('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1281('0x39'),_0x1281('0x3a'),_0x1281('0x3b')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1281('0x23')],'defaultValue':0x0,'comment':_0x1281('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x1281('0x18')](0x9)[_0x1281('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1281('0x18')](0x9)[_0x1281('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1281('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1281('0x18')](0x9)[_0x1281('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1281('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1281('0x18')](0x9)[_0x1281('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1281('0x3f')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1281('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1281('0x18')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1281('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1281('0x18')](0x9)[_0x1281('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1281('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1281('0x18')](0x5)[_0x1281('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1281('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1281('0x18')](0x9)[_0x1281('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1281('0x43')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x1281('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x1281('0x23')],'defaultValue':0x0,'comment':_0x1281('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1281('0x4')](_0x1281('0x45'),'ASC'),'defaultValue':_0x1281('0x45')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x1281('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1281('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1281('0x18')](0x3)[_0x1281('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1281('0x46')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1281('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1281('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1281('0x18')](0x3)[_0x1281('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1281('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1281('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1281('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x1281('0x18')](0x3)[_0x1281('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1281('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1281('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1281('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1281('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x1281('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1281('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1281('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1281('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1281('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1281('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1281('0x18')],'allowNull':!![],'comment':_0x1281('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x1281('0x23')],'defaultValue':![],'comment':_0x1281('0x4f'),'set':function(_0x57b332){if(!_0x57b332)this[_0x1281('0xe')](_0x1281('0x50'),null);this[_0x1281('0xe')](_0x1281('0x51'),_0x57b332);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1281('0x18')](0x3)[_0x1281('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x1281('0x23')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index d05cb81..ca320e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb560=['removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','name','error','stack','send','index','VoiceQueue','rawAttributes','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','type','options','includeAll','include','findAll','rows','keys','find','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','autoAssociation','getHoppers','findOne','CmHopper','hasOwnProperty','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','always','insert','fromQuery','ListId','phone','scheduledAt','ContactId','NOW()','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','into','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0xb560,0x175));var _0x0b56=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xb560[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require(_0x0b56('0x0'));var rimraf=require(_0x0b56('0x1'));var zipdir=require(_0x0b56('0x2'));var jsonpatch=require(_0x0b56('0x3'));var rp=require(_0x0b56('0x4'));var moment=require(_0x0b56('0x5'));var BPromise=require(_0x0b56('0x6'));var Mustache=require(_0x0b56('0x7'));var util=require(_0x0b56('0x8'));var path=require(_0x0b56('0x9'));var sox=require(_0x0b56('0xa'));var csv=require('to-csv');var ejs=require(_0x0b56('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b56('0xc'));var squel=require(_0x0b56('0xd'));var crypto=require(_0x0b56('0xe'));var jsforce=require(_0x0b56('0xf'));var deskjs=require(_0x0b56('0x10'));var toCsv=require(_0x0b56('0x11'));var querystring=require(_0x0b56('0x12'));var Papa=require(_0x0b56('0x13'));var Redis=require(_0x0b56('0x14'));var authService=require(_0x0b56('0x15'));var qs=require(_0x0b56('0x16'));var as=require(_0x0b56('0x17'));var hardwareService=require(_0x0b56('0x18'));var logger=require(_0x0b56('0x19'))(_0x0b56('0x1a'));var utils=require('../../config/utils');var config=require(_0x0b56('0x1b'));var licenseUtil=require(_0x0b56('0x1c'));var db=require('../../mysqldb')['db'];config[_0x0b56('0x1d')]=_[_0x0b56('0x1e')](config['redis'],{'host':_0x0b56('0x1f'),'port':0x18eb});var socket=require(_0x0b56('0x20'))(new Redis(config[_0x0b56('0x1d')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x579128,_0x27a384){_0x27a384=_0x27a384||0xcc;return function(_0x40d190){if(_0x40d190){return _0x579128[_0x0b56('0x21')](_0x27a384);}return _0x579128[_0x0b56('0x22')](_0x27a384)[_0x0b56('0x23')]();};}function respondWithResult(_0x59d18b,_0x251c9e){_0x251c9e=_0x251c9e||0xc8;return function(_0x4c4c68){if(_0x4c4c68){return _0x59d18b[_0x0b56('0x22')](_0x251c9e)[_0x0b56('0x24')](_0x4c4c68);}};}function respondWithFilteredResult(_0x5bb7e2,_0x1d0a4a){return function(_0x26d26c){if(_0x26d26c){var _0x39b4ef=typeof _0x1d0a4a[_0x0b56('0x25')]===_0x0b56('0x26')&&typeof _0x1d0a4a[_0x0b56('0x27')]===_0x0b56('0x26');var _0x193455=_0x26d26c[_0x0b56('0x28')];var _0x5c13e7=_0x39b4ef?0x0:_0x1d0a4a[_0x0b56('0x25')];var _0x2146f6=_0x39b4ef?_0x26d26c[_0x0b56('0x28')]:_0x1d0a4a[_0x0b56('0x25')]+_0x1d0a4a['limit'];var _0x18f144;if(_0x2146f6>=_0x193455){_0x2146f6=_0x193455;_0x18f144=0xc8;}else{_0x18f144=0xce;}_0x5bb7e2[_0x0b56('0x22')](_0x18f144);return _0x5bb7e2[_0x0b56('0x29')](_0x0b56('0x2a'),_0x5c13e7+'-'+_0x2146f6+'/'+_0x193455)[_0x0b56('0x24')](_0x26d26c);}return null;};}function patchUpdates(_0x14107d){return function(_0x3819b3){try{jsonpatch[_0x0b56('0x2b')](_0x3819b3,_0x14107d,!![]);}catch(_0x2905f4){return BPromise[_0x0b56('0x2c')](_0x2905f4);}return _0x3819b3[_0x0b56('0x2d')]();};}function saveUpdates(_0x454760,_0x3a9486){return function(_0x9ae2d0){if(_0x9ae2d0){return _0x9ae2d0[_0x0b56('0x2e')](_0x454760)[_0x0b56('0x2f')](function(_0x1d7429){return _0x1d7429;});}return null;};}function removeEntity(_0x46ba9c,_0x4dd91d){return function(_0x2e8832){if(_0x2e8832){return _0x2e8832[_0x0b56('0x30')]()[_0x0b56('0x2f')](function(){var _0x1006fa=_0x2e8832[_0x0b56('0x31')]({'plain':!![]});var _0x21cd34=[{'name':_0x0b56('0x32'),'value':_0x0b56('0x33'),'ignore':![]},{'name':_0x0b56('0x34'),'value':_0x0b56('0x35'),'ignore':![]}];var _0xdc4753=_(_0x21cd34)[_0x0b56('0x36')]('ignore')[_0x0b56('0x37')](_0x0b56('0x38'))['value']();if(_[_0x0b56('0x39')](_0xdc4753,_0x1006fa['type'])){return;}var _0x41cd63=_['find'](_0x21cd34,['value',_0x1006fa['type']])[_0x0b56('0x3a')];return db['UserProfileResource'][_0x0b56('0x30')]({'where':{'type':_0x41cd63,'resourceId':_0x1006fa['id']}})['then'](function(){return _0x2e8832;});})['then'](function(){_0x46ba9c[_0x0b56('0x22')](0xcc)[_0x0b56('0x23')]();});}};}function handleEntityNotFound(_0x1303f2,_0x3b010f){return function(_0x422966){if(!_0x422966){_0x1303f2['sendStatus'](0x194);}return _0x422966;};}function handleError(_0x3cf580,_0x1a7cba){_0x1a7cba=_0x1a7cba||0x1f4;return function(_0x44391a){logger[_0x0b56('0x3b')](_0x44391a[_0x0b56('0x3c')]);if(_0x44391a[_0x0b56('0x3a')]){delete _0x44391a[_0x0b56('0x3a')];}_0x3cf580['status'](_0x1a7cba)[_0x0b56('0x3d')](_0x44391a);};}exports[_0x0b56('0x3e')]=function(_0x235998,_0x54c7a4){var _0x43cb06={},_0x26fc0a={},_0xfd5c9d={'count':0x0,'rows':[]};var _0x298a0d=_['map'](db[_0x0b56('0x3f')][_0x0b56('0x40')],function(_0x2954d0){return{'name':_0x2954d0['fieldName'],'type':_0x2954d0['type']['key']};});_0x26fc0a[_0x0b56('0x41')]=_[_0x0b56('0x37')](_0x298a0d,_0x0b56('0x3a'));_0x26fc0a['query']=_['keys'](_0x235998[_0x0b56('0x42')]);_0x26fc0a[_0x0b56('0x43')]=_[_0x0b56('0x44')](_0x26fc0a['model'],_0x26fc0a[_0x0b56('0x42')]);_0x43cb06['attributes']=_[_0x0b56('0x44')](_0x26fc0a['model'],qs['fields'](_0x235998[_0x0b56('0x42')][_0x0b56('0x45')]));_0x43cb06[_0x0b56('0x46')]=_0x43cb06[_0x0b56('0x46')][_0x0b56('0x47')]?_0x43cb06['attributes']:_0x26fc0a[_0x0b56('0x41')];if(!_0x235998[_0x0b56('0x42')]['hasOwnProperty'](_0x0b56('0x48'))){_0x43cb06['limit']=qs['limit'](_0x235998[_0x0b56('0x42')][_0x0b56('0x27')]);_0x43cb06[_0x0b56('0x25')]=qs[_0x0b56('0x25')](_0x235998[_0x0b56('0x42')][_0x0b56('0x25')]);}_0x43cb06[_0x0b56('0x49')]=qs[_0x0b56('0x4a')](_0x235998['query'][_0x0b56('0x4a')]);_0x43cb06['where']=qs[_0x0b56('0x43')](_[_0x0b56('0x4b')](_0x235998[_0x0b56('0x42')],_0x26fc0a[_0x0b56('0x43')]),_0x298a0d);if(_0x235998['query'][_0x0b56('0x36')]){_0x43cb06[_0x0b56('0x4c')]=_[_0x0b56('0x4d')](_0x43cb06[_0x0b56('0x4c')],{'$or':_['map'](_0x298a0d,function(_0xf16828){if(_0xf16828[_0x0b56('0x4e')]!=='VIRTUAL'){var _0x1cb76d={};_0x1cb76d[_0xf16828[_0x0b56('0x3a')]]={'$like':'%'+_0x235998[_0x0b56('0x42')][_0x0b56('0x36')]+'%'};return _0x1cb76d;}})});}_0x43cb06=_['merge']({},_0x43cb06,_0x235998[_0x0b56('0x4f')]);var _0x345a56={'where':_0x43cb06[_0x0b56('0x4c')]};return db['VoiceQueue'][_0x0b56('0x28')](_0x345a56)[_0x0b56('0x2f')](function(_0x2cd263){_0xfd5c9d['count']=_0x2cd263;if(_0x235998['query'][_0x0b56('0x50')]){_0x43cb06[_0x0b56('0x51')]=[{'all':!![]}];}return db[_0x0b56('0x3f')][_0x0b56('0x52')](_0x43cb06);})['then'](function(_0x1a531e){_0xfd5c9d[_0x0b56('0x53')]=_0x1a531e;return _0xfd5c9d;})['then'](respondWithFilteredResult(_0x54c7a4,_0x43cb06))['catch'](handleError(_0x54c7a4,null));};exports['show']=function(_0x53224c,_0xe7900d){var _0x4dd7f5={'raw':![],'where':{'id':_0x53224c['params']['id']}},_0x21f0ab={};_0x21f0ab['model']=_[_0x0b56('0x54')](db[_0x0b56('0x3f')][_0x0b56('0x40')]);_0x21f0ab[_0x0b56('0x42')]=_['keys'](_0x53224c[_0x0b56('0x42')]);_0x21f0ab['filters']=_[_0x0b56('0x44')](_0x21f0ab[_0x0b56('0x41')],_0x21f0ab['query']);_0x4dd7f5[_0x0b56('0x46')]=_['intersection'](_0x21f0ab[_0x0b56('0x41')],qs[_0x0b56('0x45')](_0x53224c[_0x0b56('0x42')][_0x0b56('0x45')]));_0x4dd7f5['attributes']=_0x4dd7f5[_0x0b56('0x46')][_0x0b56('0x47')]?_0x4dd7f5['attributes']:_0x21f0ab[_0x0b56('0x41')];if(_0x53224c[_0x0b56('0x42')]['includeAll']){_0x4dd7f5[_0x0b56('0x51')]=[{'all':!![]}];}_0x4dd7f5=_[_0x0b56('0x4d')]({},_0x4dd7f5,_0x53224c[_0x0b56('0x4f')]);return db[_0x0b56('0x3f')][_0x0b56('0x55')](_0x4dd7f5)['then'](handleEntityNotFound(_0xe7900d,null))[_0x0b56('0x2f')](respondWithResult(_0xe7900d,null))[_0x0b56('0x56')](handleError(_0xe7900d,null));};exports['create']=function(_0x4bc35a,_0x57bb85){return db[_0x0b56('0x3f')]['create'](_0x4bc35a[_0x0b56('0x57')],{})['then'](function(_0x1eb2f0){var _0x39d6f8=_0x4bc35a['user'][_0x0b56('0x31')]({'plain':!![]});if(!_0x39d6f8)throw new Error(_0x0b56('0x58'));if(_0x39d6f8[_0x0b56('0x59')]===_0x0b56('0x5a')){var _0x41e934=_0x1eb2f0[_0x0b56('0x31')]({'plain':!![]});var _0x943cd8=[{'name':'VoiceQueues','value':_0x0b56('0x33')},{'name':_0x0b56('0x34'),'value':_0x0b56('0x35')}];var _0x26ad85=_[_0x0b56('0x55')](_0x943cd8,['value',_0x41e934[_0x0b56('0x4e')]])[_0x0b56('0x3a')];return db[_0x0b56('0x5b')][_0x0b56('0x55')]({'where':{'name':_0x26ad85,'userProfileId':_0x39d6f8[_0x0b56('0x5c')]},'raw':!![]})['then'](function(_0x2f2988){if(_0x2f2988&&_0x2f2988['autoAssociation']===0x0){return db[_0x0b56('0x5d')][_0x0b56('0x5e')]({'name':_0x41e934[_0x0b56('0x3a')],'resourceId':_0x41e934['id'],'type':_0x2f2988[_0x0b56('0x3a')],'sectionId':_0x2f2988['id']},{})[_0x0b56('0x2f')](function(){return _0x1eb2f0;});}else{return _0x1eb2f0;}})[_0x0b56('0x56')](function(_0x50d7d7){logger[_0x0b56('0x3b')](_0x0b56('0x5f'),_0x50d7d7);throw _0x50d7d7;});}return _0x1eb2f0;})[_0x0b56('0x2f')](respondWithResult(_0x57bb85,0xc9))[_0x0b56('0x56')](handleError(_0x57bb85,null));};exports[_0x0b56('0x60')]=function(_0x447d00,_0x422283){var _0x90078b={'where':{'id':_0x447d00[_0x0b56('0x61')]['id']}},_0xf9fecc={};_0xf9fecc['model']=_[_0x0b56('0x54')](db[_0x0b56('0x3f')][_0x0b56('0x40')]);_0x90078b[_0x0b56('0x46')]=_[_0x0b56('0x44')](_0xf9fecc[_0x0b56('0x41')],qs[_0x0b56('0x45')](_0x447d00[_0x0b56('0x42')]['fields']));_0x90078b['attributes']=_0x90078b[_0x0b56('0x46')][_0x0b56('0x47')]?_0x90078b[_0x0b56('0x46')]:_0xf9fecc['model'];if(_0x447d00[_0x0b56('0x42')][_0x0b56('0x50')]){_0x90078b[_0x0b56('0x51')]=[{'all':!![]}];}_0x90078b=_['merge']({},_0x90078b,_0x447d00[_0x0b56('0x4f')]);return db[_0x0b56('0x3f')][_0x0b56('0x55')](_0x90078b)[_0x0b56('0x2f')](handleEntityNotFound(_0x422283,null))['then'](function(_0x3b3c7e){if(_0x3b3c7e){var _0x4b9b5b=_0x3b3c7e[_0x0b56('0x31')]({'plain':!![]});_0x4b9b5b=qs[_0x0b56('0x62')](_0x4b9b5b,['id',_0x0b56('0x63'),_0x0b56('0x64')]);_0x447d00[_0x0b56('0x57')]=_[_0x0b56('0x62')](_0x447d00[_0x0b56('0x57')],['id',_0x0b56('0x63'),'updatedAt']);return db['VoiceQueue'][_0x0b56('0x5e')](_['merge'](_0x4b9b5b,_0x447d00[_0x0b56('0x57')]),{'include':_0x447d00['query']['includeAll']?[{'all':!![]}]:undefined})[_0x0b56('0x2f')](function(_0xf90d40){var _0x25155b=_0x447d00['user']['get']({'plain':!![]});if(!_0x25155b)throw new Error(_0x0b56('0x58'));if(_0x25155b[_0x0b56('0x59')]==='user'){var _0x37eba6=_0xf90d40['get']({'plain':!![]});var _0x3366a0=[{'name':_0x0b56('0x32'),'value':'inbound'},{'name':_0x0b56('0x34'),'value':_0x0b56('0x35')}];var _0x43edb3=_['find'](_0x3366a0,['value',_0x37eba6[_0x0b56('0x4e')]])[_0x0b56('0x3a')];return db[_0x0b56('0x5b')][_0x0b56('0x55')]({'where':{'name':_0x43edb3,'userProfileId':_0x25155b['userProfileId']},'raw':!![]})[_0x0b56('0x2f')](function(_0x280923){if(_0x280923&&_0x280923[_0x0b56('0x65')]===0x0){return db[_0x0b56('0x5d')][_0x0b56('0x5e')]({'name':_0x37eba6['name'],'resourceId':_0x37eba6['id'],'type':_0x280923[_0x0b56('0x3a')],'sectionId':_0x280923['id']},{})['then'](function(){return _0xf90d40;});}else{return _0xf90d40;}})['catch'](function(_0x32a3fa){logger['error'](_0x0b56('0x5f'),_0x32a3fa);throw _0x32a3fa;});}return _0xf90d40;});}})[_0x0b56('0x2f')](respondWithResult(_0x422283,0xc9))[_0x0b56('0x56')](handleError(_0x422283,null));};exports[_0x0b56('0x2e')]=function(_0xe3f32b,_0x5d961f){if(_0xe3f32b[_0x0b56('0x57')]['id']){delete _0xe3f32b[_0x0b56('0x57')]['id'];}return db[_0x0b56('0x3f')][_0x0b56('0x55')]({'where':{'id':_0xe3f32b[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x5d961f,null))['then'](saveUpdates(_0xe3f32b['body'],null))[_0x0b56('0x2f')](respondWithResult(_0x5d961f,null))[_0x0b56('0x56')](handleError(_0x5d961f,null));};exports['destroy']=function(_0x415e3a,_0x1c831d){return db['VoiceQueue'][_0x0b56('0x55')]({'where':{'id':_0x415e3a[_0x0b56('0x61')]['id']}})['then'](handleEntityNotFound(_0x1c831d,null))[_0x0b56('0x2f')](removeEntity(_0x1c831d,null))[_0x0b56('0x56')](handleError(_0x1c831d,null));};exports[_0x0b56('0x66')]=function(_0x3412bd,_0x4edc44,_0x33a867){var _0x429d1d={'raw':![],'where':{}};var _0x1056f0={};var _0x5940b5={'count':0x0,'rows':[]};return db[_0x0b56('0x3f')][_0x0b56('0x67')]({'where':{'id':_0x3412bd['params']['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x4edc44,null))[_0x0b56('0x2f')](function(_0x3b92ae){if(_0x3b92ae){_0x1056f0[_0x0b56('0x41')]=_[_0x0b56('0x54')](db[_0x0b56('0x68')][_0x0b56('0x40')]);_0x1056f0[_0x0b56('0x42')]=_[_0x0b56('0x54')](_0x3412bd[_0x0b56('0x42')]);_0x1056f0['filters']=_[_0x0b56('0x44')](_0x1056f0[_0x0b56('0x41')],_0x1056f0[_0x0b56('0x42')]);_0x429d1d[_0x0b56('0x46')]=_[_0x0b56('0x44')](_0x1056f0[_0x0b56('0x41')],qs['fields'](_0x3412bd[_0x0b56('0x42')][_0x0b56('0x45')]));_0x429d1d['attributes']=_0x429d1d['attributes'][_0x0b56('0x47')]?_0x429d1d[_0x0b56('0x46')]:_0x1056f0[_0x0b56('0x41')];if(!_0x3412bd[_0x0b56('0x42')][_0x0b56('0x69')](_0x0b56('0x48'))){_0x429d1d['limit']=qs['limit'](_0x3412bd[_0x0b56('0x42')][_0x0b56('0x27')]);_0x429d1d[_0x0b56('0x25')]=qs[_0x0b56('0x25')](_0x3412bd[_0x0b56('0x42')][_0x0b56('0x25')]);}_0x429d1d['order']=qs[_0x0b56('0x4a')](_0x3412bd[_0x0b56('0x42')][_0x0b56('0x4a')]);_0x429d1d[_0x0b56('0x4c')]=qs[_0x0b56('0x43')](_[_0x0b56('0x4b')](_0x3412bd[_0x0b56('0x42')],_0x1056f0['filters']));_0x429d1d['where']['VoiceQueueId']=_0x3b92ae['id'];if(_0x3412bd[_0x0b56('0x42')][_0x0b56('0x36')]){_0x429d1d[_0x0b56('0x4c')]=_[_0x0b56('0x4d')](_0x429d1d[_0x0b56('0x4c')],{'$or':_['map'](_0x429d1d[_0x0b56('0x46')],function(_0x62084){var _0x4cec6f={};_0x4cec6f[_0x62084]={'$like':'%'+_0x3412bd['query'][_0x0b56('0x36')]+'%'};return _0x4cec6f;})});}_0x429d1d=_[_0x0b56('0x4d')]({},_0x429d1d,_0x3412bd[_0x0b56('0x4f')]);return db[_0x0b56('0x68')][_0x0b56('0x28')]({'where':_0x429d1d[_0x0b56('0x4c')]})[_0x0b56('0x2f')](function(_0x1dc300){_0x5940b5[_0x0b56('0x28')]=_0x1dc300;if(_0x3412bd['query']['includeAll']){_0x429d1d['include']=[{'all':!![]}];}return db['CmHopper'][_0x0b56('0x52')](_0x429d1d);})[_0x0b56('0x2f')](function(_0x4fc570){_0x5940b5[_0x0b56('0x53')]=_0x4fc570;return _0x5940b5;});}})[_0x0b56('0x2f')](respondWithFilteredResult(_0x4edc44,_0x429d1d))[_0x0b56('0x56')](handleError(_0x4edc44,null));};exports['getHopperHistories']=function(_0x485400,_0x221cdc,_0x58ddc3){var _0x45d443={'raw':!![],'where':{}};var _0x5808df={};var _0x2c9896={'count':0x0,'rows':[]};return db[_0x0b56('0x3f')]['findOne']({'where':{'id':_0x485400['params']['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x221cdc,null))[_0x0b56('0x2f')](function(_0x3fbb7b){if(_0x3fbb7b){_0x5808df['model']=_[_0x0b56('0x54')](db['CmHopperHistory'][_0x0b56('0x40')]);_0x5808df[_0x0b56('0x42')]=_['keys'](_0x485400[_0x0b56('0x42')]);_0x5808df['filters']=_['intersection'](_0x5808df[_0x0b56('0x41')],_0x5808df[_0x0b56('0x42')]);_0x45d443['attributes']=_[_0x0b56('0x44')](_0x5808df['model'],qs['fields'](_0x485400[_0x0b56('0x42')][_0x0b56('0x45')]));_0x45d443[_0x0b56('0x46')]=_0x45d443['attributes'][_0x0b56('0x47')]?_0x45d443[_0x0b56('0x46')]:_0x5808df[_0x0b56('0x41')];if(!_0x485400[_0x0b56('0x42')][_0x0b56('0x69')](_0x0b56('0x48'))){_0x45d443['limit']=qs['limit'](_0x485400[_0x0b56('0x42')][_0x0b56('0x27')]);_0x45d443[_0x0b56('0x25')]=qs[_0x0b56('0x25')](_0x485400[_0x0b56('0x42')][_0x0b56('0x25')]);}_0x45d443[_0x0b56('0x49')]=qs[_0x0b56('0x4a')](_0x485400[_0x0b56('0x42')][_0x0b56('0x4a')]);_0x45d443[_0x0b56('0x4c')]=qs[_0x0b56('0x43')](_[_0x0b56('0x4b')](_0x485400[_0x0b56('0x42')],_0x5808df[_0x0b56('0x43')]));_0x45d443['where'][_0x0b56('0x6a')]=_0x3fbb7b['id'];if(_0x485400[_0x0b56('0x42')][_0x0b56('0x36')]){_0x45d443[_0x0b56('0x4c')]=_[_0x0b56('0x4d')](_0x45d443[_0x0b56('0x4c')],{'$or':_[_0x0b56('0x37')](_0x45d443[_0x0b56('0x46')],function(_0x49cad5){var _0x4661ac={};_0x4661ac[_0x49cad5]={'$like':'%'+_0x485400[_0x0b56('0x42')][_0x0b56('0x36')]+'%'};return _0x4661ac;})});}_0x45d443=_[_0x0b56('0x4d')]({},_0x45d443,_0x485400[_0x0b56('0x4f')]);return db['CmHopperHistory'][_0x0b56('0x28')]({'where':_0x45d443[_0x0b56('0x4c')]})['then'](function(_0x2e4084){_0x2c9896[_0x0b56('0x28')]=_0x2e4084;if(_0x485400['query'][_0x0b56('0x50')]){_0x45d443['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0b56('0x52')](_0x45d443);})[_0x0b56('0x2f')](function(_0x5b8947){_0x2c9896[_0x0b56('0x53')]=_0x5b8947;return _0x2c9896;});}})[_0x0b56('0x2f')](respondWithFilteredResult(_0x221cdc,_0x45d443))['catch'](handleError(_0x221cdc,null));};exports[_0x0b56('0x6b')]=function(_0x10ad7f,_0x3e9b14,_0x5e4856){var _0xc4fa30={'raw':!![],'where':{}};var _0x33df9c={};var _0x42259b={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x10ad7f[_0x0b56('0x61')]['id']}})['then'](handleEntityNotFound(_0x3e9b14,null))['then'](function(_0x4deacb){if(_0x4deacb){_0x33df9c[_0x0b56('0x41')]=_[_0x0b56('0x54')](db['CmHopperFinal'][_0x0b56('0x40')]);_0x33df9c[_0x0b56('0x42')]=_[_0x0b56('0x54')](_0x10ad7f['query']);_0x33df9c[_0x0b56('0x43')]=_['intersection'](_0x33df9c[_0x0b56('0x41')],_0x33df9c[_0x0b56('0x42')]);_0xc4fa30[_0x0b56('0x46')]=_[_0x0b56('0x44')](_0x33df9c[_0x0b56('0x41')],qs['fields'](_0x10ad7f[_0x0b56('0x42')][_0x0b56('0x45')]));_0xc4fa30['attributes']=_0xc4fa30[_0x0b56('0x46')][_0x0b56('0x47')]?_0xc4fa30[_0x0b56('0x46')]:_0x33df9c['model'];if(!_0x10ad7f[_0x0b56('0x42')][_0x0b56('0x69')](_0x0b56('0x48'))){_0xc4fa30['limit']=qs[_0x0b56('0x27')](_0x10ad7f[_0x0b56('0x42')][_0x0b56('0x27')]);_0xc4fa30[_0x0b56('0x25')]=qs[_0x0b56('0x25')](_0x10ad7f[_0x0b56('0x42')][_0x0b56('0x25')]);}_0xc4fa30[_0x0b56('0x49')]=qs[_0x0b56('0x4a')](_0x10ad7f['query'][_0x0b56('0x4a')]);_0xc4fa30[_0x0b56('0x4c')]=qs['filters'](_[_0x0b56('0x4b')](_0x10ad7f[_0x0b56('0x42')],_0x33df9c['filters']));_0xc4fa30[_0x0b56('0x4c')][_0x0b56('0x6a')]=_0x4deacb['id'];if(_0x10ad7f['query'][_0x0b56('0x36')]){_0xc4fa30['where']=_[_0x0b56('0x4d')](_0xc4fa30[_0x0b56('0x4c')],{'$or':_[_0x0b56('0x37')](_0xc4fa30[_0x0b56('0x46')],function(_0x32ab50){var _0x24d0fa={};_0x24d0fa[_0x32ab50]={'$like':'%'+_0x10ad7f['query'][_0x0b56('0x36')]+'%'};return _0x24d0fa;})});}_0xc4fa30=_[_0x0b56('0x4d')]({},_0xc4fa30,_0x10ad7f[_0x0b56('0x4f')]);return db[_0x0b56('0x6c')][_0x0b56('0x28')]({'where':_0xc4fa30[_0x0b56('0x4c')]})['then'](function(_0x47df2d){_0x42259b[_0x0b56('0x28')]=_0x47df2d;if(_0x10ad7f['query'][_0x0b56('0x50')]){_0xc4fa30['include']=[{'all':!![]}];}return db[_0x0b56('0x6c')][_0x0b56('0x52')](_0xc4fa30);})['then'](function(_0x4af190){_0x42259b['rows']=_0x4af190;return _0x42259b;});}})[_0x0b56('0x2f')](respondWithFilteredResult(_0x3e9b14,_0xc4fa30))[_0x0b56('0x56')](handleError(_0x3e9b14,null));};exports[_0x0b56('0x6d')]=function(_0x11731d,_0xb57536,_0x19d79f){var _0x6d35fe={'raw':!![],'where':{}};var _0x2e4259={};var _0x5c5725={'count':0x0,'rows':[]};return db[_0x0b56('0x3f')][_0x0b56('0x67')]({'where':{'id':_0x11731d[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0xb57536,null))[_0x0b56('0x2f')](function(_0x210408){if(_0x210408){_0x2e4259[_0x0b56('0x41')]=_[_0x0b56('0x54')](db[_0x0b56('0x6e')][_0x0b56('0x40')]);_0x2e4259['query']=_['keys'](_0x11731d[_0x0b56('0x42')]);_0x2e4259[_0x0b56('0x43')]=_[_0x0b56('0x44')](_0x2e4259[_0x0b56('0x41')],_0x2e4259['query']);_0x6d35fe['attributes']=_[_0x0b56('0x44')](_0x2e4259[_0x0b56('0x41')],qs['fields'](_0x11731d[_0x0b56('0x42')][_0x0b56('0x45')]));_0x6d35fe[_0x0b56('0x46')]=_0x6d35fe['attributes']['length']?_0x6d35fe[_0x0b56('0x46')]:_0x2e4259[_0x0b56('0x41')];if(!_0x11731d[_0x0b56('0x42')]['hasOwnProperty'](_0x0b56('0x48'))){_0x6d35fe[_0x0b56('0x27')]=qs[_0x0b56('0x27')](_0x11731d['query'][_0x0b56('0x27')]);_0x6d35fe[_0x0b56('0x25')]=qs[_0x0b56('0x25')](_0x11731d['query'][_0x0b56('0x25')]);}_0x6d35fe['order']=qs[_0x0b56('0x4a')](_0x11731d[_0x0b56('0x42')]['sort']);_0x6d35fe[_0x0b56('0x4c')]=qs['filters'](_[_0x0b56('0x4b')](_0x11731d[_0x0b56('0x42')],_0x2e4259[_0x0b56('0x43')]));_0x6d35fe['where'][_0x0b56('0x6a')]=_0x210408['id'];if(_0x11731d[_0x0b56('0x42')][_0x0b56('0x36')]){_0x6d35fe[_0x0b56('0x4c')]=_[_0x0b56('0x4d')](_0x6d35fe['where'],{'$or':_[_0x0b56('0x37')](_0x6d35fe[_0x0b56('0x46')],function(_0x59d0cd){var _0xaf349e={};_0xaf349e[_0x59d0cd]={'$like':'%'+_0x11731d['query']['filter']+'%'};return _0xaf349e;})});}_0x6d35fe=_[_0x0b56('0x4d')]({},_0x6d35fe,_0x11731d[_0x0b56('0x4f')]);return db[_0x0b56('0x6e')]['count']({'where':_0x6d35fe[_0x0b56('0x4c')]})[_0x0b56('0x2f')](function(_0x4f2d72){_0x5c5725[_0x0b56('0x28')]=_0x4f2d72;if(_0x11731d[_0x0b56('0x42')][_0x0b56('0x50')]){_0x6d35fe[_0x0b56('0x51')]=[{'all':!![]}];}return db[_0x0b56('0x6e')]['findAll'](_0x6d35fe);})[_0x0b56('0x2f')](function(_0x400f4c){_0x5c5725[_0x0b56('0x53')]=_0x400f4c;return _0x5c5725;});}})['then'](respondWithFilteredResult(_0xb57536,_0x6d35fe))[_0x0b56('0x56')](handleError(_0xb57536,null));};exports[_0x0b56('0x6f')]=function(_0x1d40fa,_0x49e692,_0x1284f8){var _0x313113={};var _0x3756ee={};var _0x3565ec;var _0x1e652f;return db[_0x0b56('0x3f')][_0x0b56('0x67')]({'where':{'id':_0x1d40fa['params']['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x49e692,null))[_0x0b56('0x2f')](function(_0x369751){if(_0x369751){_0x3565ec=_0x369751;_0x3756ee[_0x0b56('0x41')]=_[_0x0b56('0x54')](db[_0x0b56('0x70')][_0x0b56('0x40')]);_0x3756ee['query']=_[_0x0b56('0x54')](_0x1d40fa[_0x0b56('0x42')]);_0x3756ee[_0x0b56('0x43')]=_[_0x0b56('0x44')](_0x3756ee['model'],_0x3756ee[_0x0b56('0x42')]);_0x313113[_0x0b56('0x46')]=_['intersection'](_0x3756ee[_0x0b56('0x41')],qs[_0x0b56('0x45')](_0x1d40fa[_0x0b56('0x42')][_0x0b56('0x45')]));_0x313113[_0x0b56('0x46')]=_0x313113[_0x0b56('0x46')]['length']?_0x313113[_0x0b56('0x46')]:_0x3756ee['model'];_0x313113[_0x0b56('0x49')]=qs[_0x0b56('0x4a')](_0x1d40fa[_0x0b56('0x42')][_0x0b56('0x4a')]);_0x313113[_0x0b56('0x4c')]=qs[_0x0b56('0x43')](_['pick'](_0x1d40fa[_0x0b56('0x42')],_0x3756ee[_0x0b56('0x43')]));if(_0x1d40fa['query'][_0x0b56('0x36')]){_0x313113['where']=_['merge'](_0x313113[_0x0b56('0x4c')],{'$or':_[_0x0b56('0x37')](_0x313113[_0x0b56('0x46')],function(_0x594b69){var _0x4544af={};_0x4544af[_0x594b69]={'$like':'%'+_0x1d40fa[_0x0b56('0x42')][_0x0b56('0x36')]+'%'};return _0x4544af;})});}_0x313113=_[_0x0b56('0x4d')]({},_0x313113,_0x1d40fa[_0x0b56('0x4f')]);return _0x3565ec[_0x0b56('0x6f')](_0x313113);}})[_0x0b56('0x2f')](function(_0x561144){if(_0x561144){_0x1e652f=_0x561144[_0x0b56('0x47')];if(!_0x1d40fa[_0x0b56('0x42')][_0x0b56('0x69')](_0x0b56('0x48'))){_0x313113[_0x0b56('0x27')]=qs[_0x0b56('0x27')](_0x1d40fa[_0x0b56('0x42')][_0x0b56('0x27')]);_0x313113['offset']=qs[_0x0b56('0x25')](_0x1d40fa['query'][_0x0b56('0x25')]);}return _0x3565ec[_0x0b56('0x6f')](_0x313113);}})[_0x0b56('0x2f')](function(_0x846f0b){if(_0x846f0b){return _0x846f0b?{'count':_0x1e652f,'rows':_0x846f0b}:null;}})[_0x0b56('0x2f')](respondWithResult(_0x49e692,null))[_0x0b56('0x56')](handleError(_0x49e692,null));};exports[_0x0b56('0x71')]=function(_0x94c4a1,_0x4f46e6,_0x3ddfce){var _0x47d35f=_0x94c4a1['body'][_0x0b56('0x72')];var _0x427ffd=_[_0x0b56('0x37')](_0x47d35f,'id');return db[_0x0b56('0x70')][_0x0b56('0x52')]({'where':{'id':_0x427ffd},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x0b56('0x3a'),'online',_0x0b56('0x73'),_0x0b56('0x74')],'raw':!![]}]})['then'](function(_0x3ff2de){if(_0x3ff2de){var _0x4b97b2=_[_0x0b56('0x75')](_0x3ff2de,function(_0x99cc4e){var _0x1325e4=_0x99cc4e[_0x0b56('0x31')]({'plain':!![]});_0x1325e4['Agents'][_0x0b56('0x76')](function(_0x1ff056){_0x1ff056[_0x0b56('0x77')]=_['find'](_0x47d35f,{'id':_0x1325e4['id']})[_0x0b56('0x77')];});return _0x1325e4[_0x0b56('0x78')];});return db[_0x0b56('0x3f')][_0x0b56('0x55')]({'where':{'id':_0x94c4a1[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](function(_0x48d7c2){return db[_0x0b56('0x79')]['transaction'](function(_0xc60b10){return _0x48d7c2[_0x0b56('0x71')](_0x427ffd,{'transaction':_0xc60b10})['then'](function(){return BPromise[_0x0b56('0x7a')](_0x47d35f,function(_0x285195){return db[_0x0b56('0x7b')][_0x0b56('0x7c')]({'TeamId':_0x285195['id'],'VoiceQueueId':_0x94c4a1[_0x0b56('0x61')]['id'],'penalty':_0x285195[_0x0b56('0x77')]},{'transaction':_0xc60b10});});})[_0x0b56('0x2f')](function(){return BPromise[_0x0b56('0x7a')](_0x4b97b2,function(_0x32d540){return db['UserVoiceQueue'][_0x0b56('0x7d')]({'where':{'UserId':_0x32d540['id'],'VoiceQueueId':_0x94c4a1['params']['id']},'defaults':{'penalty':_0x32d540[_0x0b56('0x77')]},'transaction':_0xc60b10});});})[_0x0b56('0x2f')](function(){return BPromise[_0x0b56('0x7a')](_[_0x0b56('0x36')](_0x4b97b2,{'online':!![]}),function(_0x59c968){return db[_0x0b56('0x7e')]['upsert']({'membername':_0x59c968['name'],'UserId':_0x59c968['id'],'queue_name':_0x48d7c2[_0x0b56('0x3a')],'VoiceQueueId':_0x48d7c2['id'],'interface':_[_0x0b56('0x7f')](_0x59c968[_0x0b56('0x74')])?util[_0x0b56('0x80')](_0x0b56('0x81'),_0x59c968[_0x0b56('0x3a')]):_0x59c968[_0x0b56('0x74')],'paused':_0x59c968['voicePause']||![],'penalty':_0x59c968[_0x0b56('0x77')]},{'transaction':_0xc60b10});});})[_0x0b56('0x2f')](function(){_0x4b97b2['forEach'](function(_0x4e9eb3){socket[_0x0b56('0x82')](_0x0b56('0x83'),{'UserId':_0x4e9eb3['id'],'VoiceQueueId':_0x48d7c2['id']});});});});});}})[_0x0b56('0x2f')](respondWithStatusCode(_0x4f46e6,null))[_0x0b56('0x56')](handleError(_0x4f46e6,null));};exports[_0x0b56('0x84')]=function(_0xfa2602,_0x360d8d,_0x36c7aa){return db[_0x0b56('0x70')][_0x0b56('0x52')]({'where':{'id':_0xfa2602[_0x0b56('0x42')][_0x0b56('0x85')]},'attributes':['id'],'include':[{'model':db[_0x0b56('0x86')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0b56('0x2f')](handleEntityNotFound(_0x360d8d,null))[_0x0b56('0x2f')](function(_0x153418){var _0x1af91b=_[_0x0b56('0x37')](_0x153418,'id');var _0x5abba4=[];var _0x1f7226=[];var _0x21abdf=squel[_0x0b56('0x87')]();_0x21abdf[_0x0b56('0x88')](_0x0b56('0x89'))[_0x0b56('0x8a')](_0x0b56('0x8b'),'tq')[_0x0b56('0x8c')](_0x0b56('0x8d'),'ut',_0x0b56('0x8e'))['where']('VoiceQueueId\x20=\x20?',_0xfa2602[_0x0b56('0x61')]['id']);for(var _0xe5d5a5=0x0;_0xe5d5a5<_0x153418[_0x0b56('0x47')];_0xe5d5a5+=0x1){let _0x13a5df=_0x153418[_0xe5d5a5];for(var _0x2114dd=0x0;_0x2114dd<_0x13a5df[_0x0b56('0x78')][_0x0b56('0x47')];_0x2114dd+=0x1){let _0x462d90=_0x13a5df['Agents'][_0x2114dd];var _0x3b5611=_0x21abdf[_0x0b56('0x60')]();_0x3b5611['where'](_0x0b56('0x8f'),_0x462d90['id']);_0x1f7226[_0x0b56('0x90')](db['sequelize'][_0x0b56('0x42')](_0x3b5611[_0x0b56('0x91')](),{'type':db[_0x0b56('0x79')][_0x0b56('0x92')]['SELECT']})[_0x0b56('0x2f')](function(_0x1859a1){if(_0x1859a1[_0x0b56('0x47')]===0x1){return _0x462d90['id'];}else{var _0x321b5e=_['every'](_[_0x0b56('0x37')](_0x1859a1,_0x0b56('0x93')),function(_0x1dadc0){return _[_0x0b56('0x39')](_0x1af91b,_0x1dadc0);});if(_0x321b5e){return _0x462d90['id'];}}}));}}return BPromise[_0x0b56('0x94')](_0x1f7226)[_0x0b56('0x2f')](function(_0x379ae6){_0x5abba4=_(_0x5abba4)[_0x0b56('0x95')](_0x379ae6)[_0x0b56('0x96')]()[_0x0b56('0x38')]();return db['VoiceQueue'][_0x0b56('0x55')]({'where':{'id':_0xfa2602[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](function(_0x42d4f7){return db[_0x0b56('0x79')]['transaction'](function(_0x14f896){return _0x42d4f7[_0x0b56('0x84')](_0xfa2602['query'][_0x0b56('0x85')],{'transaction':_0x14f896})[_0x0b56('0x2f')](function(){if(!_[_0x0b56('0x97')](_0x5abba4)){return _0x42d4f7[_0x0b56('0x98')](_0x5abba4,{'transaction':_0x14f896})[_0x0b56('0x2f')](function(){return db['UserVoiceQueueRt'][_0x0b56('0x30')]({'where':{'VoiceQueueId':_0xfa2602[_0x0b56('0x61')]['id'],'UserId':_0x5abba4},'transaction':_0x14f896});});}})['then'](function(){_0x5abba4[_0x0b56('0x76')](function(_0x235624){socket[_0x0b56('0x82')](_0x0b56('0x99'),{'UserId':_0x235624,'VoiceQueueId':_0x42d4f7['id']});});});});});});})[_0x0b56('0x2f')](respondWithStatusCode(_0x360d8d,null))[_0x0b56('0x56')](handleError(_0x360d8d,null));};exports[_0x0b56('0x9a')]=function(_0x128637,_0x3a0760,_0x389ae6){var _0x42d009,_0x3a9f3f;return db['VoiceQueue'][_0x0b56('0x55')]({'where':{'id':_0x128637[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x3a0760,null))[_0x0b56('0x2f')](function(_0xc719f7){if(_0xc719f7){_0x3a9f3f=_0xc719f7;return _0xc719f7['addAgents'](_0x128637[_0x0b56('0x57')][_0x0b56('0x85')],_[_0x0b56('0x62')](_0x128637[_0x0b56('0x57')],['ids','id'])||{})[_0x0b56('0x9b')](function(_0x54cb30){for(var _0x94f355=0x0;_0x94f355<_0x128637[_0x0b56('0x57')][_0x0b56('0x85')][_0x0b56('0x47')];_0x94f355+=0x1){socket[_0x0b56('0x82')](_0x0b56('0x83'),{'UserId':Number(_0x128637[_0x0b56('0x57')]['ids'][_0x94f355]),'VoiceQueueId':Number(_0x128637[_0x0b56('0x61')]['id'])});}return _0x54cb30;});}})['then'](function(_0x244ef0){_0x42d009=_0x244ef0||[];if(_0x3a9f3f){return db[_0x0b56('0x86')][_0x0b56('0x52')]({'where':{'id':_0x128637[_0x0b56('0x57')][_0x0b56('0x85')]},'attributes':['id',_0x0b56('0x3a'),'online',_0x0b56('0x73'),_0x0b56('0x74')],'raw':!![]});}})[_0x0b56('0x2f')](function(_0x423773){if(!_[_0x0b56('0x97')](_0x423773)){var _0x1a973d=[];for(var _0x44170a=0x0;_0x44170a<_0x423773['length'];_0x44170a++){if(_0x423773[_0x44170a]['online']){_0x1a973d[_0x0b56('0x90')](db['UserVoiceQueueRt'][_0x0b56('0x7c')]({'membername':_0x423773[_0x44170a][_0x0b56('0x3a')],'UserId':_0x423773[_0x44170a]['id'],'queue_name':_0x3a9f3f[_0x0b56('0x3a')],'VoiceQueueId':_0x3a9f3f['id'],'interface':_[_0x0b56('0x7f')](_0x423773[_0x44170a][_0x0b56('0x74')])?util[_0x0b56('0x80')]('SIP/%s',_0x423773[_0x44170a][_0x0b56('0x3a')]):_0x423773[_0x44170a][_0x0b56('0x74')],'paused':_0x423773[_0x44170a][_0x0b56('0x73')]||![],'penalty':_0x128637['body']['penalty']||0x0}));}}return BPromise[_0x0b56('0x94')](_0x1a973d);}})[_0x0b56('0x2f')](function(){return _0x42d009;})[_0x0b56('0x2f')](respondWithResult(_0x3a0760,null))[_0x0b56('0x56')](handleError(_0x3a0760,null));};exports[_0x0b56('0x98')]=function(_0x474e46,_0x456c72,_0x59bd2c){return db['VoiceQueue'][_0x0b56('0x55')]({'where':{'id':_0x474e46[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x456c72,null))[_0x0b56('0x2f')](function(_0x434cd5){if(_0x434cd5){return _0x434cd5['removeAgents'](_0x474e46[_0x0b56('0x42')]['ids'])[_0x0b56('0x2f')](function(){if(_['isArray'](_0x474e46['query'][_0x0b56('0x85')])){for(var _0x398af0=0x0;_0x398af0<_0x474e46[_0x0b56('0x42')][_0x0b56('0x85')][_0x0b56('0x47')];_0x398af0+=0x1){socket['emit'](_0x0b56('0x99'),{'UserId':Number(_0x474e46[_0x0b56('0x42')][_0x0b56('0x85')][_0x398af0]),'VoiceQueueId':Number(_0x474e46[_0x0b56('0x61')]['id'])});}}else{socket[_0x0b56('0x82')](_0x0b56('0x99'),{'UserId':Number(_0x474e46[_0x0b56('0x42')][_0x0b56('0x85')]),'VoiceQueueId':Number(_0x474e46[_0x0b56('0x61')]['id'])});}});}})[_0x0b56('0x2f')](function(_0x59f5ae){return db[_0x0b56('0x7e')][_0x0b56('0x30')]({'where':{'VoiceQueueId':_0x474e46[_0x0b56('0x61')]['id'],'UserId':_0x474e46[_0x0b56('0x42')][_0x0b56('0x85')]}})[_0x0b56('0x2f')](function(){return _0x59f5ae;});})[_0x0b56('0x2f')](respondWithStatusCode(_0x456c72,null))[_0x0b56('0x56')](handleError(_0x456c72,null));};exports['getAgents']=function(_0x48a056,_0x132691,_0x47c00d){var _0x105d0a={};var _0x161a41={};var _0x59bebf;var _0x55a8f4;return db['VoiceQueue']['findOne']({'where':{'id':_0x48a056['params']['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x132691,null))[_0x0b56('0x2f')](function(_0x3b28d6){if(_0x3b28d6){_0x59bebf=_0x3b28d6;_0x161a41[_0x0b56('0x41')]=_[_0x0b56('0x54')](db[_0x0b56('0x86')][_0x0b56('0x40')]);_0x161a41[_0x0b56('0x42')]=_[_0x0b56('0x54')](_0x48a056[_0x0b56('0x42')]);_0x161a41[_0x0b56('0x43')]=_[_0x0b56('0x44')](_0x161a41[_0x0b56('0x41')],_0x161a41[_0x0b56('0x42')]);_0x105d0a[_0x0b56('0x46')]=_[_0x0b56('0x44')](_0x161a41['model'],qs[_0x0b56('0x45')](_0x48a056[_0x0b56('0x42')]['fields']));_0x105d0a[_0x0b56('0x46')]=_0x105d0a[_0x0b56('0x46')][_0x0b56('0x47')]?_0x105d0a[_0x0b56('0x46')]:_0x161a41['model'];_0x105d0a[_0x0b56('0x49')]=qs[_0x0b56('0x4a')](_0x48a056[_0x0b56('0x42')][_0x0b56('0x4a')]);_0x105d0a[_0x0b56('0x4c')]=qs[_0x0b56('0x43')](_['pick'](_0x48a056[_0x0b56('0x42')],_0x161a41['filters']));if(_0x48a056[_0x0b56('0x42')][_0x0b56('0x36')]){_0x105d0a[_0x0b56('0x4c')]=_['merge'](_0x105d0a[_0x0b56('0x4c')],{'$or':_[_0x0b56('0x37')](_0x105d0a['attributes'],function(_0x4a0bc1){var _0x52456a={};_0x52456a[_0x4a0bc1]={'$like':'%'+_0x48a056[_0x0b56('0x42')]['filter']+'%'};return _0x52456a;})});}_0x105d0a=_[_0x0b56('0x4d')]({},_0x105d0a,_0x48a056['options']);return _0x59bebf[_0x0b56('0x9c')](_0x105d0a);}})[_0x0b56('0x2f')](function(_0x3a9908){if(_0x3a9908){_0x55a8f4=_0x3a9908[_0x0b56('0x47')];if(!_0x48a056[_0x0b56('0x42')][_0x0b56('0x69')](_0x0b56('0x48'))){_0x105d0a[_0x0b56('0x27')]=qs[_0x0b56('0x27')](_0x48a056[_0x0b56('0x42')][_0x0b56('0x27')]);_0x105d0a['offset']=qs[_0x0b56('0x25')](_0x48a056[_0x0b56('0x42')][_0x0b56('0x25')]);}return _0x59bebf[_0x0b56('0x9c')](_0x105d0a);}})['then'](function(_0x21062e){if(_0x21062e){return _0x21062e?{'count':_0x55a8f4,'rows':_0x21062e}:null;}})[_0x0b56('0x2f')](respondWithResult(_0x132691,null))[_0x0b56('0x56')](handleError(_0x132691,null));};exports[_0x0b56('0x9d')]=function(_0x3afa7a,_0x12bcfa,_0x4ac9d7){var _0x17752a={};var _0x388b6a={};var _0xeb7bb6;var _0x165ceb;return db[_0x0b56('0x3f')][_0x0b56('0x67')]({'where':{'id':_0x3afa7a[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x12bcfa,null))[_0x0b56('0x2f')](function(_0x3059c4){if(_0x3059c4){_0xeb7bb6=_0x3059c4;_0x388b6a[_0x0b56('0x41')]=_['keys'](db[_0x0b56('0x7e')][_0x0b56('0x40')]);_0x388b6a['query']=_[_0x0b56('0x54')](_0x3afa7a[_0x0b56('0x42')]);_0x388b6a[_0x0b56('0x43')]=_['intersection'](_0x388b6a[_0x0b56('0x41')],_0x388b6a[_0x0b56('0x42')]);_0x17752a['attributes']=_[_0x0b56('0x44')](_0x388b6a[_0x0b56('0x41')],qs[_0x0b56('0x45')](_0x3afa7a[_0x0b56('0x42')]['fields']));_0x17752a['attributes']=_0x17752a[_0x0b56('0x46')][_0x0b56('0x47')]?_0x17752a['attributes']:_0x388b6a['model'];_0x17752a[_0x0b56('0x49')]=qs['sort'](_0x3afa7a[_0x0b56('0x42')]['sort']);_0x17752a[_0x0b56('0x4c')]=qs[_0x0b56('0x43')](_[_0x0b56('0x4b')](_0x3afa7a[_0x0b56('0x42')],_0x388b6a[_0x0b56('0x43')]));if(_0x3afa7a[_0x0b56('0x42')]['filter']){_0x17752a['where']=_[_0x0b56('0x4d')](_0x17752a['where'],{'$or':_[_0x0b56('0x37')](_0x17752a[_0x0b56('0x46')],function(_0x1997f7){var _0x451e31={};_0x451e31[_0x1997f7]={'$like':'%'+_0x3afa7a[_0x0b56('0x42')][_0x0b56('0x36')]+'%'};return _0x451e31;})});}_0x17752a=_[_0x0b56('0x4d')]({},_0x17752a,_0x3afa7a['options']);return _0xeb7bb6['getMembers'](_0x17752a);}})[_0x0b56('0x2f')](function(_0x51313a){if(_0x51313a){_0x165ceb=_0x51313a['length'];if(!_0x3afa7a[_0x0b56('0x42')]['hasOwnProperty'](_0x0b56('0x48'))){_0x17752a[_0x0b56('0x27')]=qs[_0x0b56('0x27')](_0x3afa7a[_0x0b56('0x42')][_0x0b56('0x27')]);_0x17752a[_0x0b56('0x25')]=qs[_0x0b56('0x25')](_0x3afa7a[_0x0b56('0x42')]['offset']);}return _0xeb7bb6[_0x0b56('0x9d')](_0x17752a);}})['then'](function(_0x5e4e64){return _0x5e4e64?{'count':_0x165ceb,'rows':_0x5e4e64}:null;})[_0x0b56('0x2f')](respondWithResult(_0x12bcfa,null))[_0x0b56('0x56')](handleError(_0x12bcfa,null));};exports[_0x0b56('0x9e')]=function(_0x387486,_0x50c30f,_0x30ee21){var _0x359d4b={};var _0x102509={};var _0x5d816e;var _0x25e568;return db[_0x0b56('0x3f')][_0x0b56('0x67')]({'where':{'id':_0x387486[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x50c30f,null))[_0x0b56('0x2f')](function(_0x2a4c4f){if(_0x2a4c4f){_0x5d816e=_0x2a4c4f;_0x102509['model']=_['keys'](db[_0x0b56('0x9f')][_0x0b56('0x40')]);_0x102509[_0x0b56('0x42')]=_[_0x0b56('0x54')](_0x387486[_0x0b56('0x42')]);_0x102509[_0x0b56('0x43')]=_['intersection'](_0x102509['model'],_0x102509[_0x0b56('0x42')]);_0x359d4b[_0x0b56('0x46')]=_[_0x0b56('0x44')](_0x102509[_0x0b56('0x41')],qs[_0x0b56('0x45')](_0x387486[_0x0b56('0x42')][_0x0b56('0x45')]));_0x359d4b[_0x0b56('0x46')]=_0x359d4b[_0x0b56('0x46')]['length']?_0x359d4b[_0x0b56('0x46')]:_0x102509[_0x0b56('0x41')];_0x359d4b[_0x0b56('0x49')]=qs[_0x0b56('0x4a')](_0x387486[_0x0b56('0x42')][_0x0b56('0x4a')]);_0x359d4b[_0x0b56('0x4c')]=qs[_0x0b56('0x43')](_[_0x0b56('0x4b')](_0x387486[_0x0b56('0x42')],_0x102509[_0x0b56('0x43')]));if(_0x387486[_0x0b56('0x42')][_0x0b56('0x36')]){_0x359d4b[_0x0b56('0x4c')]=_[_0x0b56('0x4d')](_0x359d4b['where'],{'$or':_[_0x0b56('0x37')](_0x359d4b[_0x0b56('0x46')],function(_0x130438){var _0x285863={};_0x285863[_0x130438]={'$like':'%'+_0x387486[_0x0b56('0x42')][_0x0b56('0x36')]+'%'};return _0x285863;})});}_0x359d4b=_[_0x0b56('0x4d')]({},_0x359d4b,_0x387486[_0x0b56('0x4f')]);return _0x5d816e['getLists'](_0x359d4b);}})[_0x0b56('0x2f')](function(_0x2eca25){if(_0x2eca25){_0x25e568=_0x2eca25[_0x0b56('0x47')];if(!_0x387486[_0x0b56('0x42')][_0x0b56('0x69')](_0x0b56('0x48'))){_0x359d4b[_0x0b56('0x27')]=qs['limit'](_0x387486[_0x0b56('0x42')][_0x0b56('0x27')]);_0x359d4b[_0x0b56('0x25')]=qs[_0x0b56('0x25')](_0x387486[_0x0b56('0x42')][_0x0b56('0x25')]);}return _0x5d816e['getLists'](_0x359d4b);}})[_0x0b56('0x2f')](function(_0x5894b1){if(_0x5894b1){return _0x5894b1?{'count':_0x25e568,'rows':_0x5894b1}:null;}})[_0x0b56('0x2f')](respondWithResult(_0x50c30f,null))[_0x0b56('0x56')](handleError(_0x50c30f,null));};exports['addLists']=function(_0x3e301a,_0x5387ca,_0x53371a){var _0x5d5172,_0x20c29d;return db['VoiceQueue'][_0x0b56('0x55')]({'where':{'id':_0x3e301a[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x5387ca,null))['then'](function(_0x327d52){if(_0x327d52){_0x20c29d=_0x327d52;return _0x327d52['addLists'](_0x3e301a['body'][_0x0b56('0x85')],_[_0x0b56('0x62')](_0x3e301a[_0x0b56('0x57')],[_0x0b56('0x85'),'id'])||{});}return null;})['spread'](function(_0x27df99){var _0xe90aec;_0x5d5172=_0x27df99||[];var _0x24a342=[];if(_0x27df99){for(var _0x5b502c=0x0;_0x5b502c<_0x27df99['length'];_0x5b502c+=0x1){var _0x59e29f=_0x27df99[_0x5b502c][_0x0b56('0x31')]({'plain':!![]});_0x20c29d[_0x0b56('0xa0')]=_0x3e301a[_0x0b56('0x57')][_0x0b56('0xa0')]?_0x3e301a['body'][_0x0b56('0xa0')]:_0x20c29d[_0x0b56('0xa0')];switch(_0x20c29d[_0x0b56('0xa0')]){case _0x0b56('0xa1'):_0xe90aec=squel[_0x0b56('0xa2')]()['into']('cm_hopper')[_0x0b56('0xa3')](['phone','scheduledAt','ContactId',_0x0b56('0xa4'),_0x0b56('0x6a'),_0x0b56('0x63'),'updatedAt'],squel[_0x0b56('0x87')]()['field']('phone',_0x0b56('0xa5'))[_0x0b56('0x88')]('NOW()',_0x0b56('0xa6'))[_0x0b56('0x88')]('id',_0x0b56('0xa7'))[_0x0b56('0x88')](_0x59e29f['CmListId'][_0x0b56('0x91')](),_0x0b56('0xa4'))[_0x0b56('0x88')](_0x3e301a[_0x0b56('0x61')]['id'][_0x0b56('0x91')](),_0x0b56('0x6a'))[_0x0b56('0x88')](_0x0b56('0xa8'),_0x0b56('0x63'))[_0x0b56('0x88')](_0x0b56('0xa8'),'updatedAt')['from']('cm_contacts')[_0x0b56('0x4c')]('deletedAt\x20IS\x20NULL')[_0x0b56('0x4c')]('ListId\x20=\x20?',_0x59e29f[_0x0b56('0xa9')][_0x0b56('0x91')]())['where'](_0x0b56('0xaa'))[_0x0b56('0x4c')](_0x0b56('0xab'),squel[_0x0b56('0x87')]()[_0x0b56('0x88')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x0b56('0xac'))[_0x0b56('0x4c')](_0x0b56('0xad'),_0x3e301a[_0x0b56('0x61')]['id'][_0x0b56('0x91')]()))['where'](_0x0b56('0xab'),squel[_0x0b56('0x87')]()[_0x0b56('0x88')](_0x0b56('0xae'))[_0x0b56('0x8a')](_0x0b56('0xaf'))['where'](_0x0b56('0xad'),_0x3e301a['params']['id']['toString']())))[_0x0b56('0x91')]();break;case _0x0b56('0xb0'):_0xe90aec=squel[_0x0b56('0xa2')]()[_0x0b56('0xb1')](_0x0b56('0xaf'))[_0x0b56('0xa3')]([_0x0b56('0xa5'),_0x0b56('0xa6'),'ContactId',_0x0b56('0xa4'),_0x0b56('0x6a'),'createdAt',_0x0b56('0x64')],squel['select']()['field'](_0x0b56('0xa5'),_0x0b56('0xa5'))['field'](_0x0b56('0xa8'),_0x0b56('0xa6'))[_0x0b56('0x88')]('id',_0x0b56('0xa7'))['field'](_0x59e29f['CmListId']['toString'](),_0x0b56('0xa4'))[_0x0b56('0x88')](_0x3e301a[_0x0b56('0x61')]['id'][_0x0b56('0x91')](),_0x0b56('0x6a'))[_0x0b56('0x88')](_0x0b56('0xa8'),'createdAt')[_0x0b56('0x88')]('NOW()',_0x0b56('0x64'))[_0x0b56('0x8a')](_0x0b56('0xb2'))[_0x0b56('0x4c')](_0x0b56('0xb3'))['where'](_0x0b56('0xb4'),_0x59e29f['CmListId'][_0x0b56('0x91')]())['where'](_0x0b56('0xaa'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0b56('0x87')]()[_0x0b56('0x88')]('COALESCE(phone,\x27\x27)')['from'](_0x0b56('0xaf'))[_0x0b56('0x4c')]('VoiceQueueId\x20=\x20?',_0x3e301a[_0x0b56('0x61')]['id'][_0x0b56('0x91')]())))[_0x0b56('0x91')]();break;default:_0xe90aec=squel['insert']()[_0x0b56('0xb1')](_0x0b56('0xaf'))[_0x0b56('0xa3')]([_0x0b56('0xa5'),_0x0b56('0xa6'),_0x0b56('0xa7'),'ListId','VoiceQueueId',_0x0b56('0x63'),_0x0b56('0x64')],squel[_0x0b56('0x87')]()['field']('phone',_0x0b56('0xa5'))[_0x0b56('0x88')]('NOW()',_0x0b56('0xa6'))[_0x0b56('0x88')]('id',_0x0b56('0xa7'))[_0x0b56('0x88')](_0x59e29f[_0x0b56('0xa9')]['toString'](),_0x0b56('0xa4'))[_0x0b56('0x88')](_0x3e301a['params']['id'][_0x0b56('0x91')](),_0x0b56('0x6a'))[_0x0b56('0x88')]('NOW()',_0x0b56('0x63'))[_0x0b56('0x88')]('NOW()','updatedAt')[_0x0b56('0x8a')](_0x0b56('0xb2'))[_0x0b56('0x4c')](_0x0b56('0xb3'))[_0x0b56('0x4c')]('ListId\x20=\x20?',_0x59e29f[_0x0b56('0xa9')][_0x0b56('0x91')]())['where'](_0x0b56('0xaa')))[_0x0b56('0x91')]();}_0x24a342['push'](db[_0x0b56('0x79')][_0x0b56('0x42')](_0xe90aec));}return BPromise[_0x0b56('0x94')](_0x24a342);}})['then'](function(){return _0x5d5172;})['then'](respondWithResult(_0x5387ca,null))[_0x0b56('0x56')](handleError(_0x5387ca,null));};exports[_0x0b56('0xb5')]=function(_0x440b32,_0x37350f,_0x5e2097){return db[_0x0b56('0x3f')][_0x0b56('0x55')]({'where':{'id':_0x440b32[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x37350f,null))[_0x0b56('0x2f')](function(_0x433b9a){if(_0x433b9a){return _0x433b9a[_0x0b56('0xb5')](_0x440b32[_0x0b56('0x42')][_0x0b56('0x85')]);}})[_0x0b56('0x2f')](function(_0x310ac3){if(_0x310ac3){return db[_0x0b56('0x68')][_0x0b56('0x30')]({'where':{'ListId':_0x440b32['query'][_0x0b56('0x85')],'VoiceQueueId':_0x440b32[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](function(){return _0x310ac3;});}})[_0x0b56('0x2f')](respondWithStatusCode(_0x37350f,null))[_0x0b56('0x56')](handleError(_0x37350f,null));};exports[_0x0b56('0xb6')]=function(_0x227d7c,_0x1c3f8b,_0x2facad){var _0x188dfd={};var _0x5eb03f={};var _0x148080;var _0x2bff91;return db[_0x0b56('0x3f')][_0x0b56('0x67')]({'where':{'id':_0x227d7c[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x1c3f8b,null))[_0x0b56('0x2f')](function(_0xbd5e56){if(_0xbd5e56){_0x148080=_0xbd5e56;_0x5eb03f[_0x0b56('0x41')]=_[_0x0b56('0x54')](db[_0x0b56('0x9f')]['rawAttributes']);_0x5eb03f[_0x0b56('0x42')]=_[_0x0b56('0x54')](_0x227d7c[_0x0b56('0x42')]);_0x5eb03f[_0x0b56('0x43')]=_[_0x0b56('0x44')](_0x5eb03f[_0x0b56('0x41')],_0x5eb03f[_0x0b56('0x42')]);_0x188dfd[_0x0b56('0x46')]=_[_0x0b56('0x44')](_0x5eb03f[_0x0b56('0x41')],qs[_0x0b56('0x45')](_0x227d7c[_0x0b56('0x42')][_0x0b56('0x45')]));_0x188dfd['attributes']=_0x188dfd[_0x0b56('0x46')][_0x0b56('0x47')]?_0x188dfd[_0x0b56('0x46')]:_0x5eb03f['model'];_0x188dfd[_0x0b56('0x49')]=qs[_0x0b56('0x4a')](_0x227d7c[_0x0b56('0x42')][_0x0b56('0x4a')]);_0x188dfd[_0x0b56('0x4c')]=qs[_0x0b56('0x43')](_[_0x0b56('0x4b')](_0x227d7c[_0x0b56('0x42')],_0x5eb03f[_0x0b56('0x43')]));if(_0x227d7c[_0x0b56('0x42')][_0x0b56('0x36')]){_0x188dfd[_0x0b56('0x4c')]=_[_0x0b56('0x4d')](_0x188dfd[_0x0b56('0x4c')],{'$or':_[_0x0b56('0x37')](_0x188dfd[_0x0b56('0x46')],function(_0x4b31b3){var _0x155101={};_0x155101[_0x4b31b3]={'$like':'%'+_0x227d7c[_0x0b56('0x42')]['filter']+'%'};return _0x155101;})});}_0x188dfd=_[_0x0b56('0x4d')]({},_0x188dfd,_0x227d7c[_0x0b56('0x4f')]);return _0x148080[_0x0b56('0xb6')](_0x188dfd);}})['then'](function(_0x5d713c){if(_0x5d713c){_0x2bff91=_0x5d713c[_0x0b56('0x47')];if(!_0x227d7c[_0x0b56('0x42')]['hasOwnProperty']('nolimit')){_0x188dfd[_0x0b56('0x27')]=qs[_0x0b56('0x27')](_0x227d7c[_0x0b56('0x42')][_0x0b56('0x27')]);_0x188dfd['offset']=qs[_0x0b56('0x25')](_0x227d7c[_0x0b56('0x42')][_0x0b56('0x25')]);}return _0x148080[_0x0b56('0xb6')](_0x188dfd);}})[_0x0b56('0x2f')](function(_0x5413e4){if(_0x5413e4){return _0x5413e4?{'count':_0x2bff91,'rows':_0x5413e4}:null;}})[_0x0b56('0x2f')](respondWithResult(_0x1c3f8b,null))[_0x0b56('0x56')](handleError(_0x1c3f8b,null));};exports['addBlackLists']=function(_0x200613,_0x5da61c,_0x3ac07f){var _0x5f547c,_0x422696;return db[_0x0b56('0x3f')][_0x0b56('0x55')]({'where':{'id':_0x200613[_0x0b56('0x61')]['id']}})[_0x0b56('0x2f')](handleEntityNotFound(_0x5da61c,null))['then'](function(_0x4b123c){if(_0x4b123c){_0x422696=_0x4b123c;return _0x4b123c[_0x0b56('0xb7')](_0x200613['body'][_0x0b56('0x85')],_[_0x0b56('0x62')](_0x200613[_0x0b56('0x57')],[_0x0b56('0x85'),'id'])||{});}return null;})['spread'](function(_0x4001e9){var _0x287a83;_0x5f547c=_0x4001e9||[];var _0x3a776f=[];if(_0x4001e9){for(var _0x23b70e=0x0;_0x23b70e<_0x4001e9[_0x0b56('0x47')];_0x23b70e+=0x1){var _0x132d44=_0x4001e9[_0x23b70e][_0x0b56('0x31')]({'plain':!![]});_0x287a83=squel['insert']()['into'](_0x0b56('0xb8'))[_0x0b56('0xa3')](['phone',_0x0b56('0xa7'),_0x0b56('0xa4'),_0x0b56('0x6a'),_0x0b56('0x63'),_0x0b56('0x64')],squel['select']()['field'](_0x0b56('0xa5'),_0x0b56('0xa5'))[_0x0b56('0x88')]('id',_0x0b56('0xa7'))[_0x0b56('0x88')](_0x132d44[_0x0b56('0xa9')][_0x0b56('0x91')](),_0x0b56('0xa4'))[_0x0b56('0x88')](_0x200613[_0x0b56('0x61')]['id'][_0x0b56('0x91')](),'VoiceQueueId')[_0x0b56('0x88')](_0x0b56('0xa8'),_0x0b56('0x63'))['field']('NOW()',_0x0b56('0x64'))[_0x0b56('0x8a')](_0x0b56('0xb2'))[_0x0b56('0x4c')]('deletedAt\x20IS\x20NULL')[_0x0b56('0x4c')](_0x0b56('0xb4'),_0x132d44[_0x0b56('0xa9')][_0x0b56('0x91')]())[_0x0b56('0x4c')](_0x0b56('0xaa')))[_0x0b56('0x91')]();_0x3a776f[_0x0b56('0x90')](db[_0x0b56('0x79')][_0x0b56('0x42')](_0x287a83));}return BPromise[_0x0b56('0x94')](_0x3a776f);}})[_0x0b56('0x2f')](function(){return _0x5f547c;})[_0x0b56('0x2f')](respondWithResult(_0x5da61c,null))[_0x0b56('0x56')](handleError(_0x5da61c,null));};exports[_0x0b56('0xb9')]=function(_0x1f3ade,_0x55655f,_0x5a805a){return db[_0x0b56('0x3f')][_0x0b56('0x55')]({'where':{'id':_0x1f3ade['params']['id']}})['then'](handleEntityNotFound(_0x55655f,null))[_0x0b56('0x2f')](function(_0x56babb){if(_0x56babb){return _0x56babb[_0x0b56('0xb9')](_0x1f3ade[_0x0b56('0x42')][_0x0b56('0x85')]);}})['then'](function(_0xa8fa15){if(_0xa8fa15){return db[_0x0b56('0x6e')][_0x0b56('0x30')]({'where':{'ListId':_0x1f3ade[_0x0b56('0x42')][_0x0b56('0x85')],'VoiceQueueId':_0x1f3ade[_0x0b56('0x61')]['id']}})['then'](function(){return _0xa8fa15;});}})[_0x0b56('0x2f')](respondWithStatusCode(_0x55655f,null))[_0x0b56('0x56')](handleError(_0x55655f,null));};
\ No newline at end of file
+var _0x1e3f=['online','voicePause','format','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','into','removeLists','getBlackLists','addBlackLists','omit','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','error','stack','name','send','index','VoiceQueue','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','UserProfileSection','userProfileId','autoAssociation','clone','updatedAt','createdAt','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','CmHopper','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','interface','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','SIP/%s','forEach','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','compact','isEmpty','removeAgents','addAgents','spread','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1e3f,0xe4));var _0xf1e3=function(_0x59f7b8,_0xb2ac21){_0x59f7b8=_0x59f7b8-0x0;var _0x7b28c5=_0x1e3f[_0x59f7b8];return _0x7b28c5;};'use strict';var emlformat=require(_0xf1e3('0x0'));var rimraf=require(_0xf1e3('0x1'));var zipdir=require(_0xf1e3('0x2'));var jsonpatch=require(_0xf1e3('0x3'));var rp=require(_0xf1e3('0x4'));var moment=require(_0xf1e3('0x5'));var BPromise=require(_0xf1e3('0x6'));var Mustache=require(_0xf1e3('0x7'));var util=require(_0xf1e3('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf1e3('0x9'));var fs=require('fs');var fs_extra=require(_0xf1e3('0xa'));var _=require(_0xf1e3('0xb'));var squel=require(_0xf1e3('0xc'));var crypto=require('crypto');var jsforce=require(_0xf1e3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf1e3('0xe'));var querystring=require(_0xf1e3('0xf'));var Papa=require(_0xf1e3('0x10'));var Redis=require(_0xf1e3('0x11'));var authService=require(_0xf1e3('0x12'));var qs=require(_0xf1e3('0x13'));var as=require(_0xf1e3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1e3('0x15'))(_0xf1e3('0x16'));var utils=require(_0xf1e3('0x17'));var config=require(_0xf1e3('0x18'));var licenseUtil=require(_0xf1e3('0x19'));var db=require(_0xf1e3('0x1a'))['db'];config[_0xf1e3('0x1b')]=_[_0xf1e3('0x1c')](config[_0xf1e3('0x1b')],{'host':_0xf1e3('0x1d'),'port':0x18eb});var socket=require(_0xf1e3('0x1e'))(new Redis(config[_0xf1e3('0x1b')]));require(_0xf1e3('0x1f'))[_0xf1e3('0x20')](socket);function respondWithStatusCode(_0x2f2458,_0x4d5778){_0x4d5778=_0x4d5778||0xcc;return function(_0x7fc5bb){if(_0x7fc5bb){return _0x2f2458[_0xf1e3('0x21')](_0x4d5778);}return _0x2f2458[_0xf1e3('0x22')](_0x4d5778)[_0xf1e3('0x23')]();};}function respondWithResult(_0x222b9d,_0x2ea7dd){_0x2ea7dd=_0x2ea7dd||0xc8;return function(_0x16c7e9){if(_0x16c7e9){return _0x222b9d[_0xf1e3('0x22')](_0x2ea7dd)[_0xf1e3('0x24')](_0x16c7e9);}};}function respondWithFilteredResult(_0x470593,_0x4d12ee){return function(_0x51b1dd){if(_0x51b1dd){var _0x5be8e8=typeof _0x4d12ee[_0xf1e3('0x25')]===_0xf1e3('0x26')&&typeof _0x4d12ee[_0xf1e3('0x27')]===_0xf1e3('0x26');var _0x467846=_0x51b1dd[_0xf1e3('0x28')];var _0x23594f=_0x5be8e8?0x0:_0x4d12ee[_0xf1e3('0x25')];var _0x3540f0=_0x5be8e8?_0x51b1dd[_0xf1e3('0x28')]:_0x4d12ee['offset']+_0x4d12ee[_0xf1e3('0x27')];var _0x2d2d8f;if(_0x3540f0>=_0x467846){_0x3540f0=_0x467846;_0x2d2d8f=0xc8;}else{_0x2d2d8f=0xce;}_0x470593[_0xf1e3('0x22')](_0x2d2d8f);return _0x470593[_0xf1e3('0x29')](_0xf1e3('0x2a'),_0x23594f+'-'+_0x3540f0+'/'+_0x467846)[_0xf1e3('0x24')](_0x51b1dd);}return null;};}function patchUpdates(_0xfb612e){return function(_0x456a1f){try{jsonpatch[_0xf1e3('0x2b')](_0x456a1f,_0xfb612e,!![]);}catch(_0x139b6b){return BPromise[_0xf1e3('0x2c')](_0x139b6b);}return _0x456a1f[_0xf1e3('0x2d')]();};}function saveUpdates(_0x3011f8,_0x35fe3a){return function(_0x9c615d){if(_0x9c615d){return _0x9c615d['update'](_0x3011f8)[_0xf1e3('0x2e')](function(_0x50f4a2){return _0x50f4a2;});}return null;};}function removeEntity(_0x7baecb,_0x2cefce){return function(_0x5bb16c){if(_0x5bb16c){return _0x5bb16c[_0xf1e3('0x2f')]()['then'](function(){var _0x11e1db=_0x5bb16c['get']({'plain':!![]});var _0x1fa790=[{'name':_0xf1e3('0x30'),'value':_0xf1e3('0x31'),'ignore':![]},{'name':_0xf1e3('0x32'),'value':_0xf1e3('0x33'),'ignore':![]}];var _0x112ba3=_(_0x1fa790)['filter'](_0xf1e3('0x34'))[_0xf1e3('0x35')](_0xf1e3('0x36'))[_0xf1e3('0x36')]();if(_[_0xf1e3('0x37')](_0x112ba3,_0x11e1db[_0xf1e3('0x38')])){return;}var _0x123805=_['find'](_0x1fa790,[_0xf1e3('0x36'),_0x11e1db['type']])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x123805,'resourceId':_0x11e1db['id']}})[_0xf1e3('0x2e')](function(){return _0x5bb16c;});})['then'](function(){_0x7baecb['status'](0xcc)[_0xf1e3('0x23')]();});}};}function handleEntityNotFound(_0x2ae458,_0x5ecf07){return function(_0x23fed9){if(!_0x23fed9){_0x2ae458['sendStatus'](0x194);}return _0x23fed9;};}function handleError(_0x1274a1,_0x2823c1){_0x2823c1=_0x2823c1||0x1f4;return function(_0x223c9f){logger[_0xf1e3('0x39')](_0x223c9f[_0xf1e3('0x3a')]);if(_0x223c9f[_0xf1e3('0x3b')]){delete _0x223c9f[_0xf1e3('0x3b')];}_0x1274a1[_0xf1e3('0x22')](_0x2823c1)[_0xf1e3('0x3c')](_0x223c9f);};}exports[_0xf1e3('0x3d')]=function(_0x42eecb,_0x16e032){var _0x58bac3={},_0x1d57b5={},_0x1a2b18={'count':0x0,'rows':[]};var _0x47552f=_[_0xf1e3('0x35')](db[_0xf1e3('0x3e')][_0xf1e3('0x3f')],function(_0x48c724){return{'name':_0x48c724[_0xf1e3('0x40')],'type':_0x48c724['type']['key']};});_0x1d57b5[_0xf1e3('0x41')]=_[_0xf1e3('0x35')](_0x47552f,_0xf1e3('0x3b'));_0x1d57b5['query']=_['keys'](_0x42eecb[_0xf1e3('0x42')]);_0x1d57b5[_0xf1e3('0x43')]=_[_0xf1e3('0x44')](_0x1d57b5[_0xf1e3('0x41')],_0x1d57b5[_0xf1e3('0x42')]);_0x58bac3[_0xf1e3('0x45')]=_[_0xf1e3('0x44')](_0x1d57b5[_0xf1e3('0x41')],qs[_0xf1e3('0x46')](_0x42eecb['query'][_0xf1e3('0x46')]));_0x58bac3[_0xf1e3('0x45')]=_0x58bac3[_0xf1e3('0x45')][_0xf1e3('0x47')]?_0x58bac3['attributes']:_0x1d57b5['model'];if(!_0x42eecb[_0xf1e3('0x42')][_0xf1e3('0x48')](_0xf1e3('0x49'))){_0x58bac3[_0xf1e3('0x27')]=qs[_0xf1e3('0x27')](_0x42eecb[_0xf1e3('0x42')][_0xf1e3('0x27')]);_0x58bac3[_0xf1e3('0x25')]=qs[_0xf1e3('0x25')](_0x42eecb[_0xf1e3('0x42')]['offset']);}_0x58bac3[_0xf1e3('0x4a')]=qs[_0xf1e3('0x4b')](_0x42eecb[_0xf1e3('0x42')]['sort']);_0x58bac3[_0xf1e3('0x4c')]=qs[_0xf1e3('0x43')](_[_0xf1e3('0x4d')](_0x42eecb['query'],_0x1d57b5[_0xf1e3('0x43')]),_0x47552f);if(_0x42eecb['query']['filter']){_0x58bac3[_0xf1e3('0x4c')]=_[_0xf1e3('0x4e')](_0x58bac3['where'],{'$or':_[_0xf1e3('0x35')](_0x47552f,function(_0x709343){if(_0x709343[_0xf1e3('0x38')]!=='VIRTUAL'){var _0x4f6f0c={};_0x4f6f0c[_0x709343[_0xf1e3('0x3b')]]={'$like':'%'+_0x42eecb[_0xf1e3('0x42')][_0xf1e3('0x4f')]+'%'};return _0x4f6f0c;}})});}_0x58bac3=_[_0xf1e3('0x4e')]({},_0x58bac3,_0x42eecb[_0xf1e3('0x50')]);var _0x4d779e={'where':_0x58bac3[_0xf1e3('0x4c')]};return db['VoiceQueue'][_0xf1e3('0x28')](_0x4d779e)[_0xf1e3('0x2e')](function(_0x10a201){_0x1a2b18[_0xf1e3('0x28')]=_0x10a201;if(_0x42eecb[_0xf1e3('0x42')][_0xf1e3('0x51')]){_0x58bac3[_0xf1e3('0x52')]=[{'all':!![]}];}return db[_0xf1e3('0x3e')][_0xf1e3('0x53')](_0x58bac3);})[_0xf1e3('0x2e')](function(_0x5a031e){_0x1a2b18['rows']=_0x5a031e;return _0x1a2b18;})['then'](respondWithFilteredResult(_0x16e032,_0x58bac3))[_0xf1e3('0x54')](handleError(_0x16e032,null));};exports[_0xf1e3('0x55')]=function(_0x4582de,_0x591e5f){var _0x250a9b={'raw':![],'where':{'id':_0x4582de[_0xf1e3('0x56')]['id']}},_0x54d40d={};_0x54d40d[_0xf1e3('0x41')]=_[_0xf1e3('0x57')](db[_0xf1e3('0x3e')][_0xf1e3('0x3f')]);_0x54d40d[_0xf1e3('0x42')]=_[_0xf1e3('0x57')](_0x4582de[_0xf1e3('0x42')]);_0x54d40d[_0xf1e3('0x43')]=_[_0xf1e3('0x44')](_0x54d40d[_0xf1e3('0x41')],_0x54d40d['query']);_0x250a9b[_0xf1e3('0x45')]=_[_0xf1e3('0x44')](_0x54d40d[_0xf1e3('0x41')],qs[_0xf1e3('0x46')](_0x4582de[_0xf1e3('0x42')][_0xf1e3('0x46')]));_0x250a9b[_0xf1e3('0x45')]=_0x250a9b['attributes'][_0xf1e3('0x47')]?_0x250a9b[_0xf1e3('0x45')]:_0x54d40d[_0xf1e3('0x41')];if(_0x4582de[_0xf1e3('0x42')][_0xf1e3('0x51')]){_0x250a9b[_0xf1e3('0x52')]=[{'all':!![]}];}_0x250a9b=_[_0xf1e3('0x4e')]({},_0x250a9b,_0x4582de[_0xf1e3('0x50')]);return db['VoiceQueue']['find'](_0x250a9b)[_0xf1e3('0x2e')](handleEntityNotFound(_0x591e5f,null))[_0xf1e3('0x2e')](respondWithResult(_0x591e5f,null))['catch'](handleError(_0x591e5f,null));};exports[_0xf1e3('0x58')]=function(_0x8b1007,_0x203098){return db[_0xf1e3('0x3e')][_0xf1e3('0x58')](_0x8b1007[_0xf1e3('0x59')],{})[_0xf1e3('0x2e')](function(_0x1e3052){var _0x502a84=_0x8b1007[_0xf1e3('0x5a')][_0xf1e3('0x5b')]({'plain':!![]});if(!_0x502a84)throw new Error(_0xf1e3('0x5c'));if(_0x502a84[_0xf1e3('0x5d')]===_0xf1e3('0x5a')){var _0x408fe8=_0x1e3052[_0xf1e3('0x5b')]({'plain':!![]});var _0x37cd5a=[{'name':'VoiceQueues','value':_0xf1e3('0x31')},{'name':_0xf1e3('0x32'),'value':_0xf1e3('0x33')}];var _0x1d2987=_[_0xf1e3('0x5e')](_0x37cd5a,['value',_0x408fe8[_0xf1e3('0x38')]])[_0xf1e3('0x3b')];return db[_0xf1e3('0x5f')][_0xf1e3('0x5e')]({'where':{'name':_0x1d2987,'userProfileId':_0x502a84[_0xf1e3('0x60')]},'raw':!![]})['then'](function(_0x247d11){if(_0x247d11&&_0x247d11[_0xf1e3('0x61')]===0x0){return db['UserProfileResource'][_0xf1e3('0x58')]({'name':_0x408fe8[_0xf1e3('0x3b')],'resourceId':_0x408fe8['id'],'type':_0x247d11[_0xf1e3('0x3b')],'sectionId':_0x247d11['id']},{})[_0xf1e3('0x2e')](function(){return _0x1e3052;});}else{return _0x1e3052;}})[_0xf1e3('0x54')](function(_0xdea07a){logger[_0xf1e3('0x39')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdea07a);throw _0xdea07a;});}return _0x1e3052;})['then'](respondWithResult(_0x203098,0xc9))[_0xf1e3('0x54')](handleError(_0x203098,null));};exports[_0xf1e3('0x62')]=function(_0x46b3e7,_0x2d10b9){var _0x34cb2a={'where':{'id':_0x46b3e7[_0xf1e3('0x56')]['id']}},_0x2e0011={};_0x2e0011[_0xf1e3('0x41')]=_[_0xf1e3('0x57')](db[_0xf1e3('0x3e')][_0xf1e3('0x3f')]);_0x34cb2a[_0xf1e3('0x45')]=_[_0xf1e3('0x44')](_0x2e0011[_0xf1e3('0x41')],qs['fields'](_0x46b3e7[_0xf1e3('0x42')][_0xf1e3('0x46')]));_0x34cb2a['attributes']=_0x34cb2a[_0xf1e3('0x45')][_0xf1e3('0x47')]?_0x34cb2a[_0xf1e3('0x45')]:_0x2e0011[_0xf1e3('0x41')];if(_0x46b3e7[_0xf1e3('0x42')][_0xf1e3('0x51')]){_0x34cb2a[_0xf1e3('0x52')]=[{'all':!![]}];}_0x34cb2a=_['merge']({},_0x34cb2a,_0x46b3e7[_0xf1e3('0x50')]);return db[_0xf1e3('0x3e')]['find'](_0x34cb2a)['then'](handleEntityNotFound(_0x2d10b9,null))[_0xf1e3('0x2e')](function(_0x33d217){if(_0x33d217){var _0xd6bdd5=_0x33d217[_0xf1e3('0x5b')]({'plain':!![]});_0xd6bdd5=qs['omit'](_0xd6bdd5,['id','createdAt',_0xf1e3('0x63')]);_0x46b3e7[_0xf1e3('0x59')]=_['omit'](_0x46b3e7[_0xf1e3('0x59')],['id',_0xf1e3('0x64'),'updatedAt']);return db[_0xf1e3('0x3e')][_0xf1e3('0x58')](_[_0xf1e3('0x4e')](_0xd6bdd5,_0x46b3e7['body']),{'include':_0x46b3e7[_0xf1e3('0x42')][_0xf1e3('0x51')]?[{'all':!![]}]:undefined})['then'](function(_0x2fce61){var _0x2460e6=_0x46b3e7[_0xf1e3('0x5a')]['get']({'plain':!![]});if(!_0x2460e6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2460e6[_0xf1e3('0x5d')]===_0xf1e3('0x5a')){var _0x53aa55=_0x2fce61[_0xf1e3('0x5b')]({'plain':!![]});var _0x4f095a=[{'name':_0xf1e3('0x30'),'value':_0xf1e3('0x31')},{'name':_0xf1e3('0x32'),'value':_0xf1e3('0x33')}];var _0x45a0cb=_['find'](_0x4f095a,['value',_0x53aa55[_0xf1e3('0x38')]])[_0xf1e3('0x3b')];return db[_0xf1e3('0x5f')][_0xf1e3('0x5e')]({'where':{'name':_0x45a0cb,'userProfileId':_0x2460e6[_0xf1e3('0x60')]},'raw':!![]})[_0xf1e3('0x2e')](function(_0x3b0aeb){if(_0x3b0aeb&&_0x3b0aeb['autoAssociation']===0x0){return db[_0xf1e3('0x65')]['create']({'name':_0x53aa55[_0xf1e3('0x3b')],'resourceId':_0x53aa55['id'],'type':_0x3b0aeb[_0xf1e3('0x3b')],'sectionId':_0x3b0aeb['id']},{})['then'](function(){return _0x2fce61;});}else{return _0x2fce61;}})[_0xf1e3('0x54')](function(_0x3bb08f){logger[_0xf1e3('0x39')](_0xf1e3('0x66'),_0x3bb08f);throw _0x3bb08f;});}return _0x2fce61;});}})[_0xf1e3('0x2e')](respondWithResult(_0x2d10b9,0xc9))['catch'](handleError(_0x2d10b9,null));};exports[_0xf1e3('0x67')]=function(_0x239a2b,_0xe6ac4a){if(_0x239a2b['body']['id']){delete _0x239a2b[_0xf1e3('0x59')]['id'];}return db[_0xf1e3('0x3e')][_0xf1e3('0x5e')]({'where':{'id':_0x239a2b[_0xf1e3('0x56')]['id']}})['then'](handleEntityNotFound(_0xe6ac4a,null))[_0xf1e3('0x2e')](saveUpdates(_0x239a2b[_0xf1e3('0x59')],null))[_0xf1e3('0x2e')](respondWithResult(_0xe6ac4a,null))[_0xf1e3('0x54')](handleError(_0xe6ac4a,null));};exports['destroy']=function(_0x47c110,_0x344a2e){return db[_0xf1e3('0x3e')]['find']({'where':{'id':_0x47c110[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x344a2e,null))[_0xf1e3('0x2e')](removeEntity(_0x344a2e,null))[_0xf1e3('0x54')](handleError(_0x344a2e,null));};exports[_0xf1e3('0x68')]=function(_0x4e8995,_0x3d116c,_0xb3e920){var _0x29e314={'raw':![],'where':{}};var _0x10aaac={};var _0xf5e661={'count':0x0,'rows':[]};return db[_0xf1e3('0x3e')]['findOne']({'where':{'id':_0x4e8995['params']['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x3d116c,null))[_0xf1e3('0x2e')](function(_0x36db69){if(_0x36db69){_0x10aaac[_0xf1e3('0x41')]=_[_0xf1e3('0x57')](db[_0xf1e3('0x69')][_0xf1e3('0x3f')]);_0x10aaac[_0xf1e3('0x42')]=_[_0xf1e3('0x57')](_0x4e8995[_0xf1e3('0x42')]);_0x10aaac['filters']=_[_0xf1e3('0x44')](_0x10aaac[_0xf1e3('0x41')],_0x10aaac[_0xf1e3('0x42')]);_0x29e314[_0xf1e3('0x45')]=_[_0xf1e3('0x44')](_0x10aaac[_0xf1e3('0x41')],qs[_0xf1e3('0x46')](_0x4e8995[_0xf1e3('0x42')][_0xf1e3('0x46')]));_0x29e314['attributes']=_0x29e314[_0xf1e3('0x45')][_0xf1e3('0x47')]?_0x29e314[_0xf1e3('0x45')]:_0x10aaac['model'];if(!_0x4e8995[_0xf1e3('0x42')][_0xf1e3('0x48')](_0xf1e3('0x49'))){_0x29e314[_0xf1e3('0x27')]=qs[_0xf1e3('0x27')](_0x4e8995[_0xf1e3('0x42')][_0xf1e3('0x27')]);_0x29e314['offset']=qs[_0xf1e3('0x25')](_0x4e8995[_0xf1e3('0x42')]['offset']);}_0x29e314[_0xf1e3('0x4a')]=qs['sort'](_0x4e8995[_0xf1e3('0x42')][_0xf1e3('0x4b')]);_0x29e314[_0xf1e3('0x4c')]=qs[_0xf1e3('0x43')](_[_0xf1e3('0x4d')](_0x4e8995[_0xf1e3('0x42')],_0x10aaac['filters']));_0x29e314['where'][_0xf1e3('0x6a')]=_0x36db69['id'];if(_0x4e8995[_0xf1e3('0x42')][_0xf1e3('0x4f')]){_0x29e314['where']=_[_0xf1e3('0x4e')](_0x29e314[_0xf1e3('0x4c')],{'$or':_[_0xf1e3('0x35')](_0x29e314['attributes'],function(_0x3329eb){var _0x52cd56={};_0x52cd56[_0x3329eb]={'$like':'%'+_0x4e8995['query'][_0xf1e3('0x4f')]+'%'};return _0x52cd56;})});}_0x29e314=_[_0xf1e3('0x4e')]({},_0x29e314,_0x4e8995[_0xf1e3('0x50')]);return db[_0xf1e3('0x69')][_0xf1e3('0x28')]({'where':_0x29e314['where']})[_0xf1e3('0x2e')](function(_0x1e0fed){_0xf5e661['count']=_0x1e0fed;if(_0x4e8995[_0xf1e3('0x42')][_0xf1e3('0x51')]){_0x29e314[_0xf1e3('0x52')]=[{'all':!![]}];}return db['CmHopper'][_0xf1e3('0x53')](_0x29e314);})['then'](function(_0x5adfb2){_0xf5e661['rows']=_0x5adfb2;return _0xf5e661;});}})[_0xf1e3('0x2e')](respondWithFilteredResult(_0x3d116c,_0x29e314))[_0xf1e3('0x54')](handleError(_0x3d116c,null));};exports[_0xf1e3('0x6b')]=function(_0x16e5bc,_0x2ec304,_0x24dd36){var _0x3d3f54={'raw':!![],'where':{}};var _0x2e50bd={};var _0x10d1ea={'count':0x0,'rows':[]};return db[_0xf1e3('0x3e')][_0xf1e3('0x6c')]({'where':{'id':_0x16e5bc['params']['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x2ec304,null))[_0xf1e3('0x2e')](function(_0xe74b52){if(_0xe74b52){_0x2e50bd['model']=_[_0xf1e3('0x57')](db[_0xf1e3('0x6d')][_0xf1e3('0x3f')]);_0x2e50bd[_0xf1e3('0x42')]=_[_0xf1e3('0x57')](_0x16e5bc[_0xf1e3('0x42')]);_0x2e50bd[_0xf1e3('0x43')]=_[_0xf1e3('0x44')](_0x2e50bd[_0xf1e3('0x41')],_0x2e50bd[_0xf1e3('0x42')]);_0x3d3f54['attributes']=_[_0xf1e3('0x44')](_0x2e50bd[_0xf1e3('0x41')],qs[_0xf1e3('0x46')](_0x16e5bc[_0xf1e3('0x42')][_0xf1e3('0x46')]));_0x3d3f54['attributes']=_0x3d3f54[_0xf1e3('0x45')]['length']?_0x3d3f54[_0xf1e3('0x45')]:_0x2e50bd[_0xf1e3('0x41')];if(!_0x16e5bc[_0xf1e3('0x42')][_0xf1e3('0x48')]('nolimit')){_0x3d3f54['limit']=qs['limit'](_0x16e5bc[_0xf1e3('0x42')][_0xf1e3('0x27')]);_0x3d3f54[_0xf1e3('0x25')]=qs['offset'](_0x16e5bc[_0xf1e3('0x42')][_0xf1e3('0x25')]);}_0x3d3f54[_0xf1e3('0x4a')]=qs[_0xf1e3('0x4b')](_0x16e5bc['query'][_0xf1e3('0x4b')]);_0x3d3f54['where']=qs[_0xf1e3('0x43')](_['pick'](_0x16e5bc[_0xf1e3('0x42')],_0x2e50bd[_0xf1e3('0x43')]));_0x3d3f54[_0xf1e3('0x4c')][_0xf1e3('0x6a')]=_0xe74b52['id'];if(_0x16e5bc[_0xf1e3('0x42')][_0xf1e3('0x4f')]){_0x3d3f54[_0xf1e3('0x4c')]=_['merge'](_0x3d3f54['where'],{'$or':_['map'](_0x3d3f54[_0xf1e3('0x45')],function(_0x13ddd3){var _0x37f07b={};_0x37f07b[_0x13ddd3]={'$like':'%'+_0x16e5bc['query'][_0xf1e3('0x4f')]+'%'};return _0x37f07b;})});}_0x3d3f54=_[_0xf1e3('0x4e')]({},_0x3d3f54,_0x16e5bc[_0xf1e3('0x50')]);return db['CmHopperHistory'][_0xf1e3('0x28')]({'where':_0x3d3f54[_0xf1e3('0x4c')]})[_0xf1e3('0x2e')](function(_0x410e80){_0x10d1ea[_0xf1e3('0x28')]=_0x410e80;if(_0x16e5bc[_0xf1e3('0x42')][_0xf1e3('0x51')]){_0x3d3f54[_0xf1e3('0x52')]=[{'all':!![]}];}return db[_0xf1e3('0x6d')][_0xf1e3('0x53')](_0x3d3f54);})[_0xf1e3('0x2e')](function(_0x465df8){_0x10d1ea[_0xf1e3('0x6e')]=_0x465df8;return _0x10d1ea;});}})[_0xf1e3('0x2e')](respondWithFilteredResult(_0x2ec304,_0x3d3f54))[_0xf1e3('0x54')](handleError(_0x2ec304,null));};exports[_0xf1e3('0x6f')]=function(_0x37634b,_0x9d1421,_0x4d0dbf){var _0x3d8a2c={'raw':!![],'where':{}};var _0x6ac58={};var _0x42b0f4={'count':0x0,'rows':[]};return db[_0xf1e3('0x3e')][_0xf1e3('0x6c')]({'where':{'id':_0x37634b[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x9d1421,null))[_0xf1e3('0x2e')](function(_0x50bb59){if(_0x50bb59){_0x6ac58['model']=_[_0xf1e3('0x57')](db[_0xf1e3('0x70')][_0xf1e3('0x3f')]);_0x6ac58[_0xf1e3('0x42')]=_['keys'](_0x37634b[_0xf1e3('0x42')]);_0x6ac58[_0xf1e3('0x43')]=_[_0xf1e3('0x44')](_0x6ac58[_0xf1e3('0x41')],_0x6ac58['query']);_0x3d8a2c[_0xf1e3('0x45')]=_[_0xf1e3('0x44')](_0x6ac58[_0xf1e3('0x41')],qs[_0xf1e3('0x46')](_0x37634b[_0xf1e3('0x42')][_0xf1e3('0x46')]));_0x3d8a2c['attributes']=_0x3d8a2c[_0xf1e3('0x45')][_0xf1e3('0x47')]?_0x3d8a2c[_0xf1e3('0x45')]:_0x6ac58[_0xf1e3('0x41')];if(!_0x37634b[_0xf1e3('0x42')][_0xf1e3('0x48')](_0xf1e3('0x49'))){_0x3d8a2c['limit']=qs[_0xf1e3('0x27')](_0x37634b['query'][_0xf1e3('0x27')]);_0x3d8a2c[_0xf1e3('0x25')]=qs['offset'](_0x37634b[_0xf1e3('0x42')][_0xf1e3('0x25')]);}_0x3d8a2c[_0xf1e3('0x4a')]=qs[_0xf1e3('0x4b')](_0x37634b['query'][_0xf1e3('0x4b')]);_0x3d8a2c[_0xf1e3('0x4c')]=qs[_0xf1e3('0x43')](_[_0xf1e3('0x4d')](_0x37634b[_0xf1e3('0x42')],_0x6ac58['filters']));_0x3d8a2c[_0xf1e3('0x4c')][_0xf1e3('0x6a')]=_0x50bb59['id'];if(_0x37634b[_0xf1e3('0x42')][_0xf1e3('0x4f')]){_0x3d8a2c[_0xf1e3('0x4c')]=_['merge'](_0x3d8a2c[_0xf1e3('0x4c')],{'$or':_['map'](_0x3d8a2c[_0xf1e3('0x45')],function(_0x4a0d0a){var _0x18ec53={};_0x18ec53[_0x4a0d0a]={'$like':'%'+_0x37634b['query'][_0xf1e3('0x4f')]+'%'};return _0x18ec53;})});}_0x3d8a2c=_[_0xf1e3('0x4e')]({},_0x3d8a2c,_0x37634b['options']);return db[_0xf1e3('0x70')][_0xf1e3('0x28')]({'where':_0x3d8a2c[_0xf1e3('0x4c')]})[_0xf1e3('0x2e')](function(_0x48c298){_0x42b0f4[_0xf1e3('0x28')]=_0x48c298;if(_0x37634b[_0xf1e3('0x42')][_0xf1e3('0x51')]){_0x3d8a2c[_0xf1e3('0x52')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xf1e3('0x53')](_0x3d8a2c);})['then'](function(_0x1f7b7e){_0x42b0f4[_0xf1e3('0x6e')]=_0x1f7b7e;return _0x42b0f4;});}})['then'](respondWithFilteredResult(_0x9d1421,_0x3d8a2c))[_0xf1e3('0x54')](handleError(_0x9d1421,null));};exports['getHopperBlacks']=function(_0x545fe7,_0x2ff16e,_0x22c68a){var _0xc42b18={'raw':!![],'where':{}};var _0x3491f5={};var _0x219a44={'count':0x0,'rows':[]};return db[_0xf1e3('0x3e')][_0xf1e3('0x6c')]({'where':{'id':_0x545fe7[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x2ff16e,null))[_0xf1e3('0x2e')](function(_0x310689){if(_0x310689){_0x3491f5[_0xf1e3('0x41')]=_['keys'](db[_0xf1e3('0x71')][_0xf1e3('0x3f')]);_0x3491f5['query']=_['keys'](_0x545fe7['query']);_0x3491f5['filters']=_[_0xf1e3('0x44')](_0x3491f5['model'],_0x3491f5['query']);_0xc42b18['attributes']=_[_0xf1e3('0x44')](_0x3491f5['model'],qs[_0xf1e3('0x46')](_0x545fe7[_0xf1e3('0x42')][_0xf1e3('0x46')]));_0xc42b18[_0xf1e3('0x45')]=_0xc42b18[_0xf1e3('0x45')]['length']?_0xc42b18[_0xf1e3('0x45')]:_0x3491f5['model'];if(!_0x545fe7['query'][_0xf1e3('0x48')](_0xf1e3('0x49'))){_0xc42b18[_0xf1e3('0x27')]=qs['limit'](_0x545fe7[_0xf1e3('0x42')][_0xf1e3('0x27')]);_0xc42b18[_0xf1e3('0x25')]=qs['offset'](_0x545fe7[_0xf1e3('0x42')]['offset']);}_0xc42b18[_0xf1e3('0x4a')]=qs['sort'](_0x545fe7['query'][_0xf1e3('0x4b')]);_0xc42b18[_0xf1e3('0x4c')]=qs[_0xf1e3('0x43')](_[_0xf1e3('0x4d')](_0x545fe7[_0xf1e3('0x42')],_0x3491f5[_0xf1e3('0x43')]));_0xc42b18['where'][_0xf1e3('0x6a')]=_0x310689['id'];if(_0x545fe7[_0xf1e3('0x42')][_0xf1e3('0x4f')]){_0xc42b18[_0xf1e3('0x4c')]=_['merge'](_0xc42b18['where'],{'$or':_[_0xf1e3('0x35')](_0xc42b18[_0xf1e3('0x45')],function(_0x28d6f0){var _0x53b3ea={};_0x53b3ea[_0x28d6f0]={'$like':'%'+_0x545fe7[_0xf1e3('0x42')][_0xf1e3('0x4f')]+'%'};return _0x53b3ea;})});}_0xc42b18=_[_0xf1e3('0x4e')]({},_0xc42b18,_0x545fe7[_0xf1e3('0x50')]);return db[_0xf1e3('0x71')][_0xf1e3('0x28')]({'where':_0xc42b18['where']})[_0xf1e3('0x2e')](function(_0x43c903){_0x219a44[_0xf1e3('0x28')]=_0x43c903;if(_0x545fe7[_0xf1e3('0x42')][_0xf1e3('0x51')]){_0xc42b18[_0xf1e3('0x52')]=[{'all':!![]}];}return db[_0xf1e3('0x71')][_0xf1e3('0x53')](_0xc42b18);})['then'](function(_0x68dba9){_0x219a44[_0xf1e3('0x6e')]=_0x68dba9;return _0x219a44;});}})['then'](respondWithFilteredResult(_0x2ff16e,_0xc42b18))[_0xf1e3('0x54')](handleError(_0x2ff16e,null));};exports[_0xf1e3('0x72')]=function(_0x1e404e,_0x4cbb2a,_0x56664c){var _0x4baf90={};var _0x7897c0={};var _0xa20106;var _0x4f0c4f;return db[_0xf1e3('0x3e')][_0xf1e3('0x6c')]({'where':{'id':_0x1e404e[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x4cbb2a,null))[_0xf1e3('0x2e')](function(_0x55b972){if(_0x55b972){_0xa20106=_0x55b972;_0x7897c0['model']=_['keys'](db[_0xf1e3('0x73')][_0xf1e3('0x3f')]);_0x7897c0[_0xf1e3('0x42')]=_[_0xf1e3('0x57')](_0x1e404e['query']);_0x7897c0[_0xf1e3('0x43')]=_[_0xf1e3('0x44')](_0x7897c0[_0xf1e3('0x41')],_0x7897c0[_0xf1e3('0x42')]);_0x4baf90[_0xf1e3('0x45')]=_['intersection'](_0x7897c0['model'],qs[_0xf1e3('0x46')](_0x1e404e[_0xf1e3('0x42')][_0xf1e3('0x46')]));_0x4baf90[_0xf1e3('0x45')]=_0x4baf90[_0xf1e3('0x45')]['length']?_0x4baf90['attributes']:_0x7897c0['model'];_0x4baf90[_0xf1e3('0x4a')]=qs[_0xf1e3('0x4b')](_0x1e404e['query'][_0xf1e3('0x4b')]);_0x4baf90['where']=qs[_0xf1e3('0x43')](_[_0xf1e3('0x4d')](_0x1e404e[_0xf1e3('0x42')],_0x7897c0[_0xf1e3('0x43')]));if(_0x1e404e[_0xf1e3('0x42')][_0xf1e3('0x4f')]){_0x4baf90['where']=_[_0xf1e3('0x4e')](_0x4baf90[_0xf1e3('0x4c')],{'$or':_['map'](_0x4baf90[_0xf1e3('0x45')],function(_0x490990){var _0x48e83d={};_0x48e83d[_0x490990]={'$like':'%'+_0x1e404e[_0xf1e3('0x42')][_0xf1e3('0x4f')]+'%'};return _0x48e83d;})});}_0x4baf90=_['merge']({},_0x4baf90,_0x1e404e[_0xf1e3('0x50')]);return _0xa20106['getTeams'](_0x4baf90);}})[_0xf1e3('0x2e')](function(_0xa09ccc){if(_0xa09ccc){_0x4f0c4f=_0xa09ccc[_0xf1e3('0x47')];if(!_0x1e404e['query'][_0xf1e3('0x48')](_0xf1e3('0x49'))){_0x4baf90[_0xf1e3('0x27')]=qs['limit'](_0x1e404e['query'][_0xf1e3('0x27')]);_0x4baf90[_0xf1e3('0x25')]=qs[_0xf1e3('0x25')](_0x1e404e[_0xf1e3('0x42')][_0xf1e3('0x25')]);}return _0xa20106[_0xf1e3('0x72')](_0x4baf90);}})[_0xf1e3('0x2e')](function(_0x2f5df7){if(_0x2f5df7){return _0x2f5df7?{'count':_0x4f0c4f,'rows':_0x2f5df7}:null;}})[_0xf1e3('0x2e')](respondWithResult(_0x4cbb2a,null))[_0xf1e3('0x54')](handleError(_0x4cbb2a,null));};exports[_0xf1e3('0x74')]=function(_0x31bcbe,_0x23cded,_0x67de93){var _0x1ca655=_0x31bcbe[_0xf1e3('0x59')][_0xf1e3('0x75')];var _0x366e73=_[_0xf1e3('0x35')](_0x1ca655,'id');return db[_0xf1e3('0x73')]['findAll']({'where':{'id':_0x366e73},'attributes':['id'],'include':[{'model':db[_0xf1e3('0x76')],'as':_0xf1e3('0x77'),'attributes':['id',_0xf1e3('0x3b'),'online','voicePause',_0xf1e3('0x78')],'raw':!![]}]})[_0xf1e3('0x2e')](function(_0x12927a){if(_0x12927a){var _0x396d72=_['flatMap'](_0x12927a,function(_0x591d08){var _0x5b4be4=_0x591d08[_0xf1e3('0x5b')]({'plain':!![]});_0x5b4be4[_0xf1e3('0x77')]['forEach'](function(_0x34b9dd){_0x34b9dd['penalty']=_[_0xf1e3('0x5e')](_0x1ca655,{'id':_0x5b4be4['id']})[_0xf1e3('0x79')];});return _0x5b4be4[_0xf1e3('0x77')];});return db[_0xf1e3('0x3e')][_0xf1e3('0x5e')]({'where':{'id':_0x31bcbe['params']['id']}})['then'](function(_0x153429){return db[_0xf1e3('0x7a')][_0xf1e3('0x7b')](function(_0x1b0ea3){return _0x153429[_0xf1e3('0x74')](_0x366e73,{'transaction':_0x1b0ea3})[_0xf1e3('0x2e')](function(){return BPromise[_0xf1e3('0x7c')](_0x1ca655,function(_0x14481a){return db[_0xf1e3('0x7d')][_0xf1e3('0x7e')]({'TeamId':_0x14481a['id'],'VoiceQueueId':_0x31bcbe[_0xf1e3('0x56')]['id'],'penalty':_0x14481a[_0xf1e3('0x79')]},{'transaction':_0x1b0ea3});});})[_0xf1e3('0x2e')](function(){return BPromise[_0xf1e3('0x7c')](_0x396d72,function(_0x5409bb){return db[_0xf1e3('0x7f')][_0xf1e3('0x80')]({'where':{'UserId':_0x5409bb['id'],'VoiceQueueId':_0x31bcbe['params']['id']},'defaults':{'penalty':_0x5409bb['penalty']},'transaction':_0x1b0ea3});});})[_0xf1e3('0x2e')](function(){return BPromise[_0xf1e3('0x7c')](_['filter'](_0x396d72,{'online':!![]}),function(_0x49b10b){return db[_0xf1e3('0x81')][_0xf1e3('0x7e')]({'membername':_0x49b10b[_0xf1e3('0x3b')],'UserId':_0x49b10b['id'],'queue_name':_0x153429['name'],'VoiceQueueId':_0x153429['id'],'interface':_[_0xf1e3('0x82')](_0x49b10b[_0xf1e3('0x78')])?util['format'](_0xf1e3('0x83'),_0x49b10b[_0xf1e3('0x3b')]):_0x49b10b[_0xf1e3('0x78')],'paused':_0x49b10b['voicePause']||![],'penalty':_0x49b10b[_0xf1e3('0x79')]},{'transaction':_0x1b0ea3});});})[_0xf1e3('0x2e')](function(){_0x396d72[_0xf1e3('0x84')](function(_0x5a90cc){socket['emit'](_0xf1e3('0x85'),{'UserId':_0x5a90cc['id'],'VoiceQueueId':_0x153429['id']});});});});});}})[_0xf1e3('0x2e')](respondWithStatusCode(_0x23cded,null))[_0xf1e3('0x54')](handleError(_0x23cded,null));};exports[_0xf1e3('0x86')]=function(_0x22abb2,_0x94024e,_0x1dc13b){return db[_0xf1e3('0x73')][_0xf1e3('0x53')]({'where':{'id':_0x22abb2[_0xf1e3('0x42')][_0xf1e3('0x87')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x94024e,null))[_0xf1e3('0x2e')](function(_0x2e8b3f){var _0x56e133=_[_0xf1e3('0x35')](_0x2e8b3f,'id');var _0x437883=[];var _0x2468c0=[];var _0x324256=squel[_0xf1e3('0x88')]();_0x324256[_0xf1e3('0x89')](_0xf1e3('0x8a'))['from'](_0xf1e3('0x8b'),'tq')[_0xf1e3('0x8c')]('user_has_teams','ut',_0xf1e3('0x8d'))[_0xf1e3('0x4c')](_0xf1e3('0x8e'),_0x22abb2[_0xf1e3('0x56')]['id']);for(var _0x4c8cf7=0x0;_0x4c8cf7<_0x2e8b3f[_0xf1e3('0x47')];_0x4c8cf7+=0x1){let _0x524776=_0x2e8b3f[_0x4c8cf7];for(var _0x438039=0x0;_0x438039<_0x524776[_0xf1e3('0x77')][_0xf1e3('0x47')];_0x438039+=0x1){let _0xda1331=_0x524776[_0xf1e3('0x77')][_0x438039];var _0x2418fd=_0x324256['clone']();_0x2418fd[_0xf1e3('0x4c')](_0xf1e3('0x8f'),_0xda1331['id']);_0x2468c0[_0xf1e3('0x90')](db[_0xf1e3('0x7a')][_0xf1e3('0x42')](_0x2418fd[_0xf1e3('0x91')](),{'type':db[_0xf1e3('0x7a')][_0xf1e3('0x92')][_0xf1e3('0x93')]})['then'](function(_0x405bdb){if(_0x405bdb[_0xf1e3('0x47')]===0x1){return _0xda1331['id'];}else{var _0x5af850=_[_0xf1e3('0x94')](_['map'](_0x405bdb,'TeamId'),function(_0x49f6b1){return _['includes'](_0x56e133,_0x49f6b1);});if(_0x5af850){return _0xda1331['id'];}}}));}}return BPromise[_0xf1e3('0x95')](_0x2468c0)[_0xf1e3('0x2e')](function(_0xb9ea90){_0x437883=_(_0x437883)['union'](_0xb9ea90)[_0xf1e3('0x96')]()[_0xf1e3('0x36')]();return db[_0xf1e3('0x3e')][_0xf1e3('0x5e')]({'where':{'id':_0x22abb2[_0xf1e3('0x56')]['id']}})['then'](function(_0x50daf5){return db[_0xf1e3('0x7a')][_0xf1e3('0x7b')](function(_0x4b53ca){return _0x50daf5[_0xf1e3('0x86')](_0x22abb2[_0xf1e3('0x42')][_0xf1e3('0x87')],{'transaction':_0x4b53ca})[_0xf1e3('0x2e')](function(){if(!_[_0xf1e3('0x97')](_0x437883)){return _0x50daf5[_0xf1e3('0x98')](_0x437883,{'transaction':_0x4b53ca})[_0xf1e3('0x2e')](function(){return db['UserVoiceQueueRt'][_0xf1e3('0x2f')]({'where':{'VoiceQueueId':_0x22abb2[_0xf1e3('0x56')]['id'],'UserId':_0x437883},'transaction':_0x4b53ca});});}})['then'](function(){_0x437883['forEach'](function(_0x3a42fd){socket['emit']('userVoiceQueue:remove',{'UserId':_0x3a42fd,'VoiceQueueId':_0x50daf5['id']});});});});});});})['then'](respondWithStatusCode(_0x94024e,null))[_0xf1e3('0x54')](handleError(_0x94024e,null));};exports['addAgents']=function(_0x226083,_0x37c019,_0x1bf4f0){var _0x56e5d4,_0x382c19;return db[_0xf1e3('0x3e')][_0xf1e3('0x5e')]({'where':{'id':_0x226083[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x37c019,null))[_0xf1e3('0x2e')](function(_0x2b630d){if(_0x2b630d){_0x382c19=_0x2b630d;return _0x2b630d[_0xf1e3('0x99')](_0x226083[_0xf1e3('0x59')]['ids'],_['omit'](_0x226083[_0xf1e3('0x59')],['ids','id'])||{})[_0xf1e3('0x9a')](function(_0x5c6ad5){for(var _0x1fbb13=0x0;_0x1fbb13<_0x226083[_0xf1e3('0x59')]['ids'][_0xf1e3('0x47')];_0x1fbb13+=0x1){socket[_0xf1e3('0x9b')](_0xf1e3('0x85'),{'UserId':Number(_0x226083[_0xf1e3('0x59')][_0xf1e3('0x87')][_0x1fbb13]),'VoiceQueueId':Number(_0x226083['params']['id'])});}return _0x5c6ad5;});}})[_0xf1e3('0x2e')](function(_0x341e95){_0x56e5d4=_0x341e95||[];if(_0x382c19){return db[_0xf1e3('0x76')]['findAll']({'where':{'id':_0x226083[_0xf1e3('0x59')][_0xf1e3('0x87')]},'attributes':['id','name',_0xf1e3('0x9c'),_0xf1e3('0x9d'),_0xf1e3('0x78')],'raw':!![]});}})[_0xf1e3('0x2e')](function(_0x3daa76){if(!_[_0xf1e3('0x97')](_0x3daa76)){var _0x30ad2b=[];for(var _0x1b7795=0x0;_0x1b7795<_0x3daa76['length'];_0x1b7795++){if(_0x3daa76[_0x1b7795][_0xf1e3('0x9c')]){_0x30ad2b[_0xf1e3('0x90')](db[_0xf1e3('0x81')][_0xf1e3('0x7e')]({'membername':_0x3daa76[_0x1b7795][_0xf1e3('0x3b')],'UserId':_0x3daa76[_0x1b7795]['id'],'queue_name':_0x382c19['name'],'VoiceQueueId':_0x382c19['id'],'interface':_[_0xf1e3('0x82')](_0x3daa76[_0x1b7795][_0xf1e3('0x78')])?util[_0xf1e3('0x9e')]('SIP/%s',_0x3daa76[_0x1b7795]['name']):_0x3daa76[_0x1b7795][_0xf1e3('0x78')],'paused':_0x3daa76[_0x1b7795]['voicePause']||![],'penalty':_0x226083['body'][_0xf1e3('0x79')]||0x0}));}}return BPromise[_0xf1e3('0x95')](_0x30ad2b);}})[_0xf1e3('0x2e')](function(){return _0x56e5d4;})[_0xf1e3('0x2e')](respondWithResult(_0x37c019,null))[_0xf1e3('0x54')](handleError(_0x37c019,null));};exports[_0xf1e3('0x98')]=function(_0x2fb672,_0x136a27,_0x213f49){return db[_0xf1e3('0x3e')][_0xf1e3('0x5e')]({'where':{'id':_0x2fb672[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x136a27,null))[_0xf1e3('0x2e')](function(_0x2ea3c0){if(_0x2ea3c0){return _0x2ea3c0['removeAgents'](_0x2fb672[_0xf1e3('0x42')][_0xf1e3('0x87')])[_0xf1e3('0x2e')](function(){if(_['isArray'](_0x2fb672[_0xf1e3('0x42')][_0xf1e3('0x87')])){for(var _0x28b07a=0x0;_0x28b07a<_0x2fb672[_0xf1e3('0x42')]['ids'][_0xf1e3('0x47')];_0x28b07a+=0x1){socket['emit'](_0xf1e3('0x9f'),{'UserId':Number(_0x2fb672['query'][_0xf1e3('0x87')][_0x28b07a]),'VoiceQueueId':Number(_0x2fb672[_0xf1e3('0x56')]['id'])});}}else{socket['emit'](_0xf1e3('0x9f'),{'UserId':Number(_0x2fb672[_0xf1e3('0x42')][_0xf1e3('0x87')]),'VoiceQueueId':Number(_0x2fb672[_0xf1e3('0x56')]['id'])});}});}})[_0xf1e3('0x2e')](function(_0x1b935e){return db[_0xf1e3('0x81')]['destroy']({'where':{'VoiceQueueId':_0x2fb672['params']['id'],'UserId':_0x2fb672[_0xf1e3('0x42')][_0xf1e3('0x87')]}})[_0xf1e3('0x2e')](function(){return _0x1b935e;});})[_0xf1e3('0x2e')](respondWithStatusCode(_0x136a27,null))['catch'](handleError(_0x136a27,null));};exports['getAgents']=function(_0x3b6572,_0x1924ae,_0x1e598e){var _0x35a0c6={};var _0x1bf162={};var _0x2affcb;var _0x2b725b;return db[_0xf1e3('0x3e')][_0xf1e3('0x6c')]({'where':{'id':_0x3b6572[_0xf1e3('0x56')]['id']}})['then'](handleEntityNotFound(_0x1924ae,null))[_0xf1e3('0x2e')](function(_0x20a307){if(_0x20a307){_0x2affcb=_0x20a307;_0x1bf162['model']=_[_0xf1e3('0x57')](db[_0xf1e3('0x76')][_0xf1e3('0x3f')]);_0x1bf162[_0xf1e3('0x42')]=_['keys'](_0x3b6572[_0xf1e3('0x42')]);_0x1bf162['filters']=_[_0xf1e3('0x44')](_0x1bf162[_0xf1e3('0x41')],_0x1bf162[_0xf1e3('0x42')]);_0x35a0c6[_0xf1e3('0x45')]=_[_0xf1e3('0x44')](_0x1bf162[_0xf1e3('0x41')],qs[_0xf1e3('0x46')](_0x3b6572[_0xf1e3('0x42')][_0xf1e3('0x46')]));_0x35a0c6[_0xf1e3('0x45')]=_0x35a0c6[_0xf1e3('0x45')][_0xf1e3('0x47')]?_0x35a0c6[_0xf1e3('0x45')]:_0x1bf162[_0xf1e3('0x41')];_0x35a0c6['order']=qs[_0xf1e3('0x4b')](_0x3b6572[_0xf1e3('0x42')][_0xf1e3('0x4b')]);_0x35a0c6[_0xf1e3('0x4c')]=qs[_0xf1e3('0x43')](_['pick'](_0x3b6572[_0xf1e3('0x42')],_0x1bf162['filters']));if(_0x3b6572[_0xf1e3('0x42')]['filter']){_0x35a0c6[_0xf1e3('0x4c')]=_[_0xf1e3('0x4e')](_0x35a0c6['where'],{'$or':_['map'](_0x35a0c6['attributes'],function(_0xb3bdd3){var _0x3b89b={};_0x3b89b[_0xb3bdd3]={'$like':'%'+_0x3b6572[_0xf1e3('0x42')][_0xf1e3('0x4f')]+'%'};return _0x3b89b;})});}_0x35a0c6=_[_0xf1e3('0x4e')]({},_0x35a0c6,_0x3b6572[_0xf1e3('0x50')]);return _0x2affcb[_0xf1e3('0xa0')](_0x35a0c6);}})[_0xf1e3('0x2e')](function(_0x2d4d59){if(_0x2d4d59){_0x2b725b=_0x2d4d59[_0xf1e3('0x47')];if(!_0x3b6572[_0xf1e3('0x42')]['hasOwnProperty'](_0xf1e3('0x49'))){_0x35a0c6[_0xf1e3('0x27')]=qs[_0xf1e3('0x27')](_0x3b6572[_0xf1e3('0x42')][_0xf1e3('0x27')]);_0x35a0c6[_0xf1e3('0x25')]=qs['offset'](_0x3b6572['query']['offset']);}return _0x2affcb[_0xf1e3('0xa0')](_0x35a0c6);}})[_0xf1e3('0x2e')](function(_0x252769){if(_0x252769){return _0x252769?{'count':_0x2b725b,'rows':_0x252769}:null;}})[_0xf1e3('0x2e')](respondWithResult(_0x1924ae,null))[_0xf1e3('0x54')](handleError(_0x1924ae,null));};exports[_0xf1e3('0xa1')]=function(_0x24e44a,_0x1a76a7,_0x6f2fe1){var _0x1827bd={};var _0x1e854b={};var _0x5202c1;var _0x2b7682;return db[_0xf1e3('0x3e')][_0xf1e3('0x6c')]({'where':{'id':_0x24e44a['params']['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x1a76a7,null))[_0xf1e3('0x2e')](function(_0x2798d6){if(_0x2798d6){_0x5202c1=_0x2798d6;_0x1e854b[_0xf1e3('0x41')]=_['keys'](db['UserVoiceQueueRt'][_0xf1e3('0x3f')]);_0x1e854b[_0xf1e3('0x42')]=_[_0xf1e3('0x57')](_0x24e44a['query']);_0x1e854b[_0xf1e3('0x43')]=_[_0xf1e3('0x44')](_0x1e854b[_0xf1e3('0x41')],_0x1e854b[_0xf1e3('0x42')]);_0x1827bd[_0xf1e3('0x45')]=_[_0xf1e3('0x44')](_0x1e854b[_0xf1e3('0x41')],qs[_0xf1e3('0x46')](_0x24e44a[_0xf1e3('0x42')][_0xf1e3('0x46')]));_0x1827bd[_0xf1e3('0x45')]=_0x1827bd[_0xf1e3('0x45')][_0xf1e3('0x47')]?_0x1827bd[_0xf1e3('0x45')]:_0x1e854b[_0xf1e3('0x41')];_0x1827bd['order']=qs[_0xf1e3('0x4b')](_0x24e44a['query'][_0xf1e3('0x4b')]);_0x1827bd[_0xf1e3('0x4c')]=qs[_0xf1e3('0x43')](_['pick'](_0x24e44a[_0xf1e3('0x42')],_0x1e854b[_0xf1e3('0x43')]));if(_0x24e44a[_0xf1e3('0x42')]['filter']){_0x1827bd['where']=_[_0xf1e3('0x4e')](_0x1827bd[_0xf1e3('0x4c')],{'$or':_['map'](_0x1827bd[_0xf1e3('0x45')],function(_0x22faef){var _0x69d088={};_0x69d088[_0x22faef]={'$like':'%'+_0x24e44a[_0xf1e3('0x42')][_0xf1e3('0x4f')]+'%'};return _0x69d088;})});}_0x1827bd=_['merge']({},_0x1827bd,_0x24e44a[_0xf1e3('0x50')]);return _0x5202c1[_0xf1e3('0xa1')](_0x1827bd);}})[_0xf1e3('0x2e')](function(_0x5121fa){if(_0x5121fa){_0x2b7682=_0x5121fa['length'];if(!_0x24e44a['query'][_0xf1e3('0x48')](_0xf1e3('0x49'))){_0x1827bd[_0xf1e3('0x27')]=qs[_0xf1e3('0x27')](_0x24e44a[_0xf1e3('0x42')][_0xf1e3('0x27')]);_0x1827bd[_0xf1e3('0x25')]=qs[_0xf1e3('0x25')](_0x24e44a[_0xf1e3('0x42')][_0xf1e3('0x25')]);}return _0x5202c1['getMembers'](_0x1827bd);}})[_0xf1e3('0x2e')](function(_0xa78c14){return _0xa78c14?{'count':_0x2b7682,'rows':_0xa78c14}:null;})[_0xf1e3('0x2e')](respondWithResult(_0x1a76a7,null))[_0xf1e3('0x54')](handleError(_0x1a76a7,null));};exports[_0xf1e3('0xa2')]=function(_0x47d4fc,_0x1e52e4,_0x17efb7){var _0x1dd6e1={};var _0x5aa228={};var _0x2a348b;var _0x13881e;return db['VoiceQueue'][_0xf1e3('0x6c')]({'where':{'id':_0x47d4fc['params']['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x1e52e4,null))[_0xf1e3('0x2e')](function(_0x28f5b2){if(_0x28f5b2){_0x2a348b=_0x28f5b2;_0x5aa228[_0xf1e3('0x41')]=_['keys'](db[_0xf1e3('0xa3')][_0xf1e3('0x3f')]);_0x5aa228[_0xf1e3('0x42')]=_[_0xf1e3('0x57')](_0x47d4fc[_0xf1e3('0x42')]);_0x5aa228['filters']=_['intersection'](_0x5aa228['model'],_0x5aa228[_0xf1e3('0x42')]);_0x1dd6e1[_0xf1e3('0x45')]=_[_0xf1e3('0x44')](_0x5aa228['model'],qs[_0xf1e3('0x46')](_0x47d4fc[_0xf1e3('0x42')]['fields']));_0x1dd6e1['attributes']=_0x1dd6e1['attributes']['length']?_0x1dd6e1['attributes']:_0x5aa228[_0xf1e3('0x41')];_0x1dd6e1['order']=qs[_0xf1e3('0x4b')](_0x47d4fc['query'][_0xf1e3('0x4b')]);_0x1dd6e1[_0xf1e3('0x4c')]=qs[_0xf1e3('0x43')](_[_0xf1e3('0x4d')](_0x47d4fc[_0xf1e3('0x42')],_0x5aa228['filters']));if(_0x47d4fc['query'][_0xf1e3('0x4f')]){_0x1dd6e1[_0xf1e3('0x4c')]=_[_0xf1e3('0x4e')](_0x1dd6e1[_0xf1e3('0x4c')],{'$or':_[_0xf1e3('0x35')](_0x1dd6e1[_0xf1e3('0x45')],function(_0x288288){var _0x39dd98={};_0x39dd98[_0x288288]={'$like':'%'+_0x47d4fc[_0xf1e3('0x42')][_0xf1e3('0x4f')]+'%'};return _0x39dd98;})});}_0x1dd6e1=_['merge']({},_0x1dd6e1,_0x47d4fc[_0xf1e3('0x50')]);return _0x2a348b[_0xf1e3('0xa2')](_0x1dd6e1);}})[_0xf1e3('0x2e')](function(_0x2502cf){if(_0x2502cf){_0x13881e=_0x2502cf['length'];if(!_0x47d4fc[_0xf1e3('0x42')]['hasOwnProperty'](_0xf1e3('0x49'))){_0x1dd6e1[_0xf1e3('0x27')]=qs[_0xf1e3('0x27')](_0x47d4fc[_0xf1e3('0x42')][_0xf1e3('0x27')]);_0x1dd6e1[_0xf1e3('0x25')]=qs['offset'](_0x47d4fc[_0xf1e3('0x42')][_0xf1e3('0x25')]);}return _0x2a348b[_0xf1e3('0xa2')](_0x1dd6e1);}})[_0xf1e3('0x2e')](function(_0x334cba){if(_0x334cba){return _0x334cba?{'count':_0x13881e,'rows':_0x334cba}:null;}})[_0xf1e3('0x2e')](respondWithResult(_0x1e52e4,null))[_0xf1e3('0x54')](handleError(_0x1e52e4,null));};exports[_0xf1e3('0xa4')]=function(_0x5d046c,_0x2be47f,_0x265838){var _0x4ebd69,_0x35a3d8;return db[_0xf1e3('0x3e')][_0xf1e3('0x5e')]({'where':{'id':_0x5d046c['params']['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x2be47f,null))[_0xf1e3('0x2e')](function(_0x10cb8b){if(_0x10cb8b){_0x35a3d8=_0x10cb8b;return _0x10cb8b[_0xf1e3('0xa4')](_0x5d046c[_0xf1e3('0x59')]['ids'],_['omit'](_0x5d046c[_0xf1e3('0x59')],['ids','id'])||{});}return null;})[_0xf1e3('0x9a')](function(_0x8559e5){var _0x1f757f;_0x4ebd69=_0x8559e5||[];var _0x35c333=[];if(_0x8559e5){for(var _0x2b77b7=0x0;_0x2b77b7<_0x8559e5[_0xf1e3('0x47')];_0x2b77b7+=0x1){var _0x2e013b=_0x8559e5[_0x2b77b7]['get']({'plain':!![]});_0x35a3d8[_0xf1e3('0xa5')]=_0x5d046c[_0xf1e3('0x59')][_0xf1e3('0xa5')]?_0x5d046c[_0xf1e3('0x59')][_0xf1e3('0xa5')]:_0x35a3d8[_0xf1e3('0xa5')];switch(_0x35a3d8[_0xf1e3('0xa5')]){case'always':_0x1f757f=squel['insert']()['into']('cm_hopper')[_0xf1e3('0xa6')]([_0xf1e3('0xa7'),_0xf1e3('0xa8'),_0xf1e3('0xa9'),_0xf1e3('0xaa'),_0xf1e3('0x6a'),'createdAt','updatedAt'],squel[_0xf1e3('0x88')]()[_0xf1e3('0x89')](_0xf1e3('0xa7'),_0xf1e3('0xa7'))[_0xf1e3('0x89')](_0xf1e3('0xab'),_0xf1e3('0xa8'))[_0xf1e3('0x89')]('id','ContactId')[_0xf1e3('0x89')](_0x2e013b['CmListId'][_0xf1e3('0x91')](),_0xf1e3('0xaa'))['field'](_0x5d046c[_0xf1e3('0x56')]['id'][_0xf1e3('0x91')](),_0xf1e3('0x6a'))[_0xf1e3('0x89')](_0xf1e3('0xab'),_0xf1e3('0x64'))[_0xf1e3('0x89')](_0xf1e3('0xab'),_0xf1e3('0x63'))[_0xf1e3('0xac')](_0xf1e3('0xad'))[_0xf1e3('0x4c')](_0xf1e3('0xae'))['where'](_0xf1e3('0xaf'),_0x2e013b[_0xf1e3('0xb0')][_0xf1e3('0x91')]())[_0xf1e3('0x4c')](_0xf1e3('0xb1'))[_0xf1e3('0x4c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xf1e3('0xb2'))[_0xf1e3('0xac')](_0xf1e3('0xb3'))[_0xf1e3('0x4c')](_0xf1e3('0x8e'),_0x5d046c[_0xf1e3('0x56')]['id'][_0xf1e3('0x91')]()))[_0xf1e3('0x4c')](_0xf1e3('0xb4'),squel['select']()[_0xf1e3('0x89')](_0xf1e3('0xb5'))[_0xf1e3('0xac')](_0xf1e3('0xb6'))[_0xf1e3('0x4c')](_0xf1e3('0x8e'),_0x5d046c[_0xf1e3('0x56')]['id']['toString']())))['toString']();break;case _0xf1e3('0xb7'):_0x1f757f=squel[_0xf1e3('0xb8')]()[_0xf1e3('0xb9')](_0xf1e3('0xb6'))['fromQuery']([_0xf1e3('0xa7'),_0xf1e3('0xa8'),'ContactId','ListId',_0xf1e3('0x6a'),'createdAt',_0xf1e3('0x63')],squel[_0xf1e3('0x88')]()['field'](_0xf1e3('0xa7'),_0xf1e3('0xa7'))[_0xf1e3('0x89')](_0xf1e3('0xab'),_0xf1e3('0xa8'))[_0xf1e3('0x89')]('id',_0xf1e3('0xa9'))[_0xf1e3('0x89')](_0x2e013b[_0xf1e3('0xb0')][_0xf1e3('0x91')](),_0xf1e3('0xaa'))['field'](_0x5d046c[_0xf1e3('0x56')]['id'][_0xf1e3('0x91')](),_0xf1e3('0x6a'))[_0xf1e3('0x89')](_0xf1e3('0xab'),_0xf1e3('0x64'))[_0xf1e3('0x89')](_0xf1e3('0xab'),_0xf1e3('0x63'))[_0xf1e3('0xac')](_0xf1e3('0xad'))[_0xf1e3('0x4c')](_0xf1e3('0xae'))[_0xf1e3('0x4c')]('ListId\x20=\x20?',_0x2e013b['CmListId'][_0xf1e3('0x91')]())[_0xf1e3('0x4c')]('phone\x20IS\x20NOT\x20NULL')[_0xf1e3('0x4c')](_0xf1e3('0xb4'),squel[_0xf1e3('0x88')]()[_0xf1e3('0x89')](_0xf1e3('0xb5'))[_0xf1e3('0xac')](_0xf1e3('0xb6'))['where'](_0xf1e3('0x8e'),_0x5d046c[_0xf1e3('0x56')]['id'][_0xf1e3('0x91')]())))['toString']();break;default:_0x1f757f=squel[_0xf1e3('0xb8')]()[_0xf1e3('0xb9')](_0xf1e3('0xb6'))[_0xf1e3('0xa6')]([_0xf1e3('0xa7'),_0xf1e3('0xa8'),_0xf1e3('0xa9'),'ListId',_0xf1e3('0x6a'),'createdAt',_0xf1e3('0x63')],squel[_0xf1e3('0x88')]()[_0xf1e3('0x89')](_0xf1e3('0xa7'),'phone')['field'](_0xf1e3('0xab'),_0xf1e3('0xa8'))[_0xf1e3('0x89')]('id',_0xf1e3('0xa9'))[_0xf1e3('0x89')](_0x2e013b[_0xf1e3('0xb0')][_0xf1e3('0x91')](),_0xf1e3('0xaa'))[_0xf1e3('0x89')](_0x5d046c[_0xf1e3('0x56')]['id'][_0xf1e3('0x91')](),'VoiceQueueId')['field'](_0xf1e3('0xab'),_0xf1e3('0x64'))[_0xf1e3('0x89')](_0xf1e3('0xab'),_0xf1e3('0x63'))[_0xf1e3('0xac')](_0xf1e3('0xad'))[_0xf1e3('0x4c')](_0xf1e3('0xae'))[_0xf1e3('0x4c')](_0xf1e3('0xaf'),_0x2e013b[_0xf1e3('0xb0')][_0xf1e3('0x91')]())['where'](_0xf1e3('0xb1')))['toString']();}_0x35c333[_0xf1e3('0x90')](db['sequelize']['query'](_0x1f757f));}return BPromise[_0xf1e3('0x95')](_0x35c333);}})[_0xf1e3('0x2e')](function(){return _0x4ebd69;})['then'](respondWithResult(_0x2be47f,null))[_0xf1e3('0x54')](handleError(_0x2be47f,null));};exports[_0xf1e3('0xba')]=function(_0x58eb22,_0x132778,_0x4348e9){return db[_0xf1e3('0x3e')][_0xf1e3('0x5e')]({'where':{'id':_0x58eb22[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x132778,null))['then'](function(_0x519139){if(_0x519139){return _0x519139['removeLists'](_0x58eb22['query'][_0xf1e3('0x87')]);}})['then'](function(_0x485d51){if(_0x485d51){return db[_0xf1e3('0x69')][_0xf1e3('0x2f')]({'where':{'ListId':_0x58eb22[_0xf1e3('0x42')][_0xf1e3('0x87')],'VoiceQueueId':_0x58eb22[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](function(){return _0x485d51;});}})[_0xf1e3('0x2e')](respondWithStatusCode(_0x132778,null))['catch'](handleError(_0x132778,null));};exports[_0xf1e3('0xbb')]=function(_0x16b32f,_0x423a4d,_0x5d2adb){var _0x1cc9c9={};var _0x331030={};var _0x34c5c6;var _0x3a1770;return db[_0xf1e3('0x3e')]['findOne']({'where':{'id':_0x16b32f[_0xf1e3('0x56')]['id']}})['then'](handleEntityNotFound(_0x423a4d,null))[_0xf1e3('0x2e')](function(_0x281a43){if(_0x281a43){_0x34c5c6=_0x281a43;_0x331030[_0xf1e3('0x41')]=_[_0xf1e3('0x57')](db[_0xf1e3('0xa3')][_0xf1e3('0x3f')]);_0x331030[_0xf1e3('0x42')]=_[_0xf1e3('0x57')](_0x16b32f[_0xf1e3('0x42')]);_0x331030[_0xf1e3('0x43')]=_['intersection'](_0x331030[_0xf1e3('0x41')],_0x331030[_0xf1e3('0x42')]);_0x1cc9c9['attributes']=_[_0xf1e3('0x44')](_0x331030[_0xf1e3('0x41')],qs['fields'](_0x16b32f['query']['fields']));_0x1cc9c9[_0xf1e3('0x45')]=_0x1cc9c9['attributes']['length']?_0x1cc9c9[_0xf1e3('0x45')]:_0x331030[_0xf1e3('0x41')];_0x1cc9c9[_0xf1e3('0x4a')]=qs[_0xf1e3('0x4b')](_0x16b32f[_0xf1e3('0x42')][_0xf1e3('0x4b')]);_0x1cc9c9['where']=qs['filters'](_[_0xf1e3('0x4d')](_0x16b32f[_0xf1e3('0x42')],_0x331030[_0xf1e3('0x43')]));if(_0x16b32f[_0xf1e3('0x42')][_0xf1e3('0x4f')]){_0x1cc9c9[_0xf1e3('0x4c')]=_[_0xf1e3('0x4e')](_0x1cc9c9[_0xf1e3('0x4c')],{'$or':_[_0xf1e3('0x35')](_0x1cc9c9[_0xf1e3('0x45')],function(_0x42b7ea){var _0x4993df={};_0x4993df[_0x42b7ea]={'$like':'%'+_0x16b32f['query'][_0xf1e3('0x4f')]+'%'};return _0x4993df;})});}_0x1cc9c9=_[_0xf1e3('0x4e')]({},_0x1cc9c9,_0x16b32f['options']);return _0x34c5c6['getBlackLists'](_0x1cc9c9);}})[_0xf1e3('0x2e')](function(_0x2a098f){if(_0x2a098f){_0x3a1770=_0x2a098f[_0xf1e3('0x47')];if(!_0x16b32f[_0xf1e3('0x42')][_0xf1e3('0x48')](_0xf1e3('0x49'))){_0x1cc9c9[_0xf1e3('0x27')]=qs[_0xf1e3('0x27')](_0x16b32f['query'][_0xf1e3('0x27')]);_0x1cc9c9['offset']=qs['offset'](_0x16b32f[_0xf1e3('0x42')]['offset']);}return _0x34c5c6[_0xf1e3('0xbb')](_0x1cc9c9);}})[_0xf1e3('0x2e')](function(_0x2f560e){if(_0x2f560e){return _0x2f560e?{'count':_0x3a1770,'rows':_0x2f560e}:null;}})[_0xf1e3('0x2e')](respondWithResult(_0x423a4d,null))[_0xf1e3('0x54')](handleError(_0x423a4d,null));};exports[_0xf1e3('0xbc')]=function(_0x2ed995,_0x373cb2,_0x1dd0f6){var _0x44839a,_0x33dea0;return db[_0xf1e3('0x3e')]['find']({'where':{'id':_0x2ed995[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x373cb2,null))[_0xf1e3('0x2e')](function(_0x427bb2){if(_0x427bb2){_0x33dea0=_0x427bb2;return _0x427bb2['addBlackLists'](_0x2ed995['body'][_0xf1e3('0x87')],_[_0xf1e3('0xbd')](_0x2ed995[_0xf1e3('0x59')],['ids','id'])||{});}return null;})[_0xf1e3('0x9a')](function(_0x187ea1){var _0x4fa0a1;_0x44839a=_0x187ea1||[];var _0x43a820=[];if(_0x187ea1){for(var _0x1ab371=0x0;_0x1ab371<_0x187ea1[_0xf1e3('0x47')];_0x1ab371+=0x1){var _0x24ec0a=_0x187ea1[_0x1ab371][_0xf1e3('0x5b')]({'plain':!![]});_0x4fa0a1=squel[_0xf1e3('0xb8')]()['into'](_0xf1e3('0xbe'))['fromQuery']([_0xf1e3('0xa7'),_0xf1e3('0xa9'),_0xf1e3('0xaa'),_0xf1e3('0x6a'),_0xf1e3('0x64'),_0xf1e3('0x63')],squel[_0xf1e3('0x88')]()[_0xf1e3('0x89')](_0xf1e3('0xa7'),_0xf1e3('0xa7'))[_0xf1e3('0x89')]('id',_0xf1e3('0xa9'))[_0xf1e3('0x89')](_0x24ec0a[_0xf1e3('0xb0')]['toString'](),_0xf1e3('0xaa'))[_0xf1e3('0x89')](_0x2ed995[_0xf1e3('0x56')]['id']['toString'](),_0xf1e3('0x6a'))[_0xf1e3('0x89')](_0xf1e3('0xab'),_0xf1e3('0x64'))[_0xf1e3('0x89')]('NOW()',_0xf1e3('0x63'))[_0xf1e3('0xac')](_0xf1e3('0xad'))[_0xf1e3('0x4c')](_0xf1e3('0xae'))[_0xf1e3('0x4c')](_0xf1e3('0xaf'),_0x24ec0a[_0xf1e3('0xb0')][_0xf1e3('0x91')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xf1e3('0x91')]();_0x43a820[_0xf1e3('0x90')](db[_0xf1e3('0x7a')]['query'](_0x4fa0a1));}return BPromise['all'](_0x43a820);}})[_0xf1e3('0x2e')](function(){return _0x44839a;})[_0xf1e3('0x2e')](respondWithResult(_0x373cb2,null))['catch'](handleError(_0x373cb2,null));};exports[_0xf1e3('0xbf')]=function(_0x466b62,_0x5070c1,_0x374f79){return db[_0xf1e3('0x3e')][_0xf1e3('0x5e')]({'where':{'id':_0x466b62[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](handleEntityNotFound(_0x5070c1,null))[_0xf1e3('0x2e')](function(_0x4f6ecd){if(_0x4f6ecd){return _0x4f6ecd['removeBlackLists'](_0x466b62[_0xf1e3('0x42')][_0xf1e3('0x87')]);}})[_0xf1e3('0x2e')](function(_0xc36793){if(_0xc36793){return db[_0xf1e3('0x71')][_0xf1e3('0x2f')]({'where':{'ListId':_0x466b62[_0xf1e3('0x42')][_0xf1e3('0x87')],'VoiceQueueId':_0x466b62[_0xf1e3('0x56')]['id']}})[_0xf1e3('0x2e')](function(){return _0xc36793;});}})[_0xf1e3('0x2e')](respondWithStatusCode(_0x5070c1,null))[_0xf1e3('0x54')](handleError(_0x5070c1,null));};
\ No newline at end of file
index ff9c022..540d252 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x815e=['../../mysqldb','VoiceQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x815e,0x116));var _0xe815=function(_0x220ba8,_0x4751a0){_0x220ba8=_0x220ba8-0x0;var _0x1ff7a3=_0x815e[_0x220ba8];return _0x1ff7a3;};'use strict';var EventEmitter=require(_0xe815('0x0'));var VoiceQueue=require(_0xe815('0x1'))['db'][_0xe815('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe815('0x3')](0x0);var events={'afterCreate':_0xe815('0x4'),'afterUpdate':'update','afterDestroy':_0xe815('0x5')};function emitEvent(_0x43c89e){return function(_0x3a6f32,_0x8662c0,_0x3c7c92){VoiceQueueEvents[_0xe815('0x6')](_0x43c89e+':'+_0x3a6f32['id'],_0x3a6f32);VoiceQueueEvents[_0xe815('0x6')](_0x43c89e,_0x3a6f32);_0x3c7c92(null);};}for(var e in events){if(events[_0xe815('0x7')](e)){var event=events[e];VoiceQueue[_0xe815('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0x8519=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x5eb63d,_0x15b9a9){var _0x1536b6=function(_0x593814){while(--_0x593814){_0x5eb63d['push'](_0x5eb63d['shift']());}};_0x1536b6(++_0x15b9a9);}(_0x8519,0x142));var _0x9851=function(_0xd70fab,_0x35fc28){_0xd70fab=_0xd70fab-0x0;var _0x2681eb=_0x8519[_0xd70fab];return _0x2681eb;};'use strict';var EventEmitter=require(_0x9851('0x0'));var VoiceQueue=require(_0x9851('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9851('0x2')](0x0);var events={'afterCreate':_0x9851('0x3'),'afterUpdate':_0x9851('0x4'),'afterDestroy':_0x9851('0x5')};function emitEvent(_0x5e33b8){return function(_0x2453c3,_0x208c75,_0x44a8cb){VoiceQueueEvents[_0x9851('0x6')](_0x5e33b8+':'+_0x2453c3['id'],_0x2453c3);VoiceQueueEvents['emit'](_0x5e33b8,_0x2453c3);_0x44a8cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x9851('0x7')](e,emitEvent(event));}}module[_0x9851('0x8')]=VoiceQueueEvents;
\ No newline at end of file
index 679b4b9..763b171 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(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x3e74,0x175));var _0x43e7=function(_0x42a8f3,_0x222bd0){_0x42a8f3=_0x42a8f3-0x0;var _0x26cfb3=_0x3e74[_0x42a8f3];return _0x26cfb3;};'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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x4a6d4b,_0x3cbb82){var _0x1c299a=function(_0x4532fd){while(--_0x4532fd){_0x4a6d4b['push'](_0x4a6d4b['shift']());}};_0x1c299a(++_0x3cbb82);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f5a90,_0x3e9684){_0x3f5a90=_0x3f5a90-0x0;var _0x5a68ee=_0xedd9[_0x3f5a90];return _0x5a68ee;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f093360..43dfc7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b91=['VoiceQueue,\x20%s,\x20%s,\x20%s','code','error','message','VoiceQueue,\x20%s,\x20%s','result','catch','GetVoiceQueue','VoiceQueue','options','where','limit','include','map','model','attributes','debug','ShowVoiceQueue','find','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','localhost','register','request','then','info','request\x20sent'];(function(_0x16e764,_0xa3d3a9){var _0x1dc16a=function(_0x1bc6a7){while(--_0x1bc6a7){_0x16e764['push'](_0x16e764['shift']());}};_0x1dc16a(++_0xa3d3a9);}(_0x9b91,0xad));var _0x19b9=function(_0x241099,_0x2997a9){_0x241099=_0x241099-0x0;var _0x164e96=_0x9b91[_0x241099];return _0x164e96;};'use strict';var _=require(_0x19b9('0x0'));var util=require(_0x19b9('0x1'));var moment=require(_0x19b9('0x2'));var BPromise=require(_0x19b9('0x3'));var rs=require(_0x19b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19b9('0x5'))['db'];var utils=require(_0x19b9('0x6'));var logger=require('../../config/logger')(_0x19b9('0x7'));var config=require(_0x19b9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x19b9('0x9')]({'port':0x232a});config[_0x19b9('0xa')]=_['defaults'](config[_0x19b9('0xa')],{'host':_0x19b9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0x19b9('0xc')](socket);function respondWithRpcPromise(_0x341fb1,_0x880e95,_0x246d62){return new BPromise(function(_0x21e392,_0x54436e){return client[_0x19b9('0xd')](_0x341fb1,_0x246d62)[_0x19b9('0xe')](function(_0x222af8){logger[_0x19b9('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x880e95,_0x19b9('0x10'));logger['debug'](_0x19b9('0x11'),_0x880e95,_0x19b9('0x10'),JSON['stringify'](_0x222af8));if(_0x222af8['error']){if(_0x222af8['error'][_0x19b9('0x12')]===0x1f4){logger[_0x19b9('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x880e95,_0x222af8[_0x19b9('0x13')][_0x19b9('0x14')]);return _0x54436e(_0x222af8[_0x19b9('0x13')]['message']);}logger[_0x19b9('0x13')](_0x19b9('0x15'),_0x880e95,_0x222af8[_0x19b9('0x13')][_0x19b9('0x14')]);return _0x21e392(_0x222af8[_0x19b9('0x13')][_0x19b9('0x14')]);}else{logger[_0x19b9('0xf')](_0x19b9('0x15'),_0x880e95,_0x19b9('0x10'));_0x21e392(_0x222af8[_0x19b9('0x16')]['message']);}})[_0x19b9('0x17')](function(_0x56fd7b){logger[_0x19b9('0x13')](_0x19b9('0x15'),_0x880e95,_0x56fd7b);_0x54436e(_0x56fd7b);});});}exports[_0x19b9('0x18')]=function(_0x165298){var _0x3f90d5=this;return new Promise(function(_0x118978,_0x509898){return db[_0x19b9('0x19')]['findAll']({'raw':_0x165298[_0x19b9('0x1a')]?_0x165298[_0x19b9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x165298[_0x19b9('0x1a')]?_0x165298['options'][_0x19b9('0x1b')]||null:null,'attributes':_0x165298['options']?_0x165298[_0x19b9('0x1a')]['attributes']||null:null,'limit':_0x165298['options']?_0x165298[_0x19b9('0x1a')][_0x19b9('0x1c')]||null:null,'include':_0x165298[_0x19b9('0x1a')]?_0x165298[_0x19b9('0x1a')][_0x19b9('0x1d')]?_[_0x19b9('0x1e')](_0x165298[_0x19b9('0x1a')][_0x19b9('0x1d')],function(_0x1c007c){return{'model':db[_0x1c007c[_0x19b9('0x1f')]],'as':_0x1c007c['as'],'attributes':_0x1c007c[_0x19b9('0x20')],'include':_0x1c007c['include']?_['map'](_0x1c007c[_0x19b9('0x1d')],function(_0x4bcdeb){return{'model':db[_0x4bcdeb['model']],'as':_0x4bcdeb['as'],'attributes':_0x4bcdeb[_0x19b9('0x20')],'include':_0x4bcdeb[_0x19b9('0x1d')]?_[_0x19b9('0x1e')](_0x4bcdeb[_0x19b9('0x1d')],function(_0x296511){return{'model':db[_0x296511[_0x19b9('0x1f')]],'as':_0x296511['as'],'attributes':_0x296511['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x446039){logger['info'](_0x19b9('0x18'),_0x165298);logger[_0x19b9('0x21')]('GetVoiceQueue',_0x165298,JSON['stringify'](_0x446039));_0x118978(_0x446039);})['catch'](function(_0x5eb71c){logger[_0x19b9('0x13')](_0x19b9('0x18'),_0x5eb71c[_0x19b9('0x14')],_0x165298);_0x509898(_0x3f90d5[_0x19b9('0x13')](0x1f4,_0x5eb71c[_0x19b9('0x14')]));});});};exports[_0x19b9('0x22')]=function(_0x8f36c0){var _0x422c00=this;return new Promise(function(_0x1e0218,_0x5f4477){return db[_0x19b9('0x19')][_0x19b9('0x23')]({'raw':_0x8f36c0[_0x19b9('0x1a')]?_0x8f36c0[_0x19b9('0x1a')][_0x19b9('0x24')]===undefined?!![]:![]:!![],'where':_0x8f36c0['options']?_0x8f36c0[_0x19b9('0x1a')]['where']||null:null,'attributes':_0x8f36c0[_0x19b9('0x1a')]?_0x8f36c0[_0x19b9('0x1a')][_0x19b9('0x20')]||null:null,'include':_0x8f36c0[_0x19b9('0x1a')]?_0x8f36c0[_0x19b9('0x1a')][_0x19b9('0x1d')]?_[_0x19b9('0x1e')](_0x8f36c0[_0x19b9('0x1a')]['include'],function(_0x3fd7ab){return{'model':db[_0x3fd7ab[_0x19b9('0x1f')]],'as':_0x3fd7ab['as'],'attributes':_0x3fd7ab[_0x19b9('0x20')],'include':_0x3fd7ab[_0x19b9('0x1d')]?_[_0x19b9('0x1e')](_0x3fd7ab[_0x19b9('0x1d')],function(_0x32f8c5){return{'model':db[_0x32f8c5[_0x19b9('0x1f')]],'as':_0x32f8c5['as'],'attributes':_0x32f8c5['attributes'],'include':_0x32f8c5[_0x19b9('0x1d')]?_[_0x19b9('0x1e')](_0x32f8c5['include'],function(_0x45bc53){return{'model':db[_0x45bc53[_0x19b9('0x1f')]],'as':_0x45bc53['as'],'attributes':_0x45bc53[_0x19b9('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39e5b4){logger[_0x19b9('0xf')]('ShowVoiceQueue',_0x8f36c0);logger[_0x19b9('0x21')]('ShowVoiceQueue',_0x8f36c0,JSON[_0x19b9('0x25')](_0x39e5b4));_0x1e0218(_0x39e5b4);})['catch'](function(_0x3e704c){logger['error'](_0x19b9('0x22'),_0x3e704c[_0x19b9('0x14')],_0x8f36c0);_0x5f4477(_0x422c00[_0x19b9('0x13')](0x1f4,_0x3e704c[_0x19b9('0x14')]));});});};
\ No newline at end of file
+var _0x4ab3=['VoiceQueue,\x20%s,\x20%s','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','limit','include','map','attributes','model','debug','ShowVoiceQueue','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','register','request','then','info','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x26f561,_0x1c92d0){var _0x44e3ee=function(_0x530ab5){while(--_0x530ab5){_0x26f561['push'](_0x26f561['shift']());}};_0x44e3ee(++_0x1c92d0);}(_0x4ab3,0x140));var _0x34ab=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x4ab3[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x34ab('0x0'));var util=require(_0x34ab('0x1'));var moment=require('moment');var BPromise=require(_0x34ab('0x2'));var rs=require(_0x34ab('0x3'));var fs=require('fs');var Redis=require(_0x34ab('0x4'));var db=require(_0x34ab('0x5'))['db'];var utils=require(_0x34ab('0x6'));var logger=require(_0x34ab('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x34ab('0x8'));var client=jayson[_0x34ab('0x9')]['http']({'port':0x232a});config[_0x34ab('0xa')]=_[_0x34ab('0xb')](config[_0x34ab('0xa')],{'host':_0x34ab('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34ab('0xa')]));require('./voiceQueue.socket')[_0x34ab('0xd')](socket);function respondWithRpcPromise(_0x2f9e9b,_0x5116fc,_0x252020){return new BPromise(function(_0x38097c,_0x46dba5){return client[_0x34ab('0xe')](_0x2f9e9b,_0x252020)[_0x34ab('0xf')](function(_0x31cceb){logger[_0x34ab('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x5116fc,_0x34ab('0x11'));logger['debug'](_0x34ab('0x12'),_0x5116fc,_0x34ab('0x11'),JSON[_0x34ab('0x13')](_0x31cceb));if(_0x31cceb[_0x34ab('0x14')]){if(_0x31cceb[_0x34ab('0x14')][_0x34ab('0x15')]===0x1f4){logger[_0x34ab('0x14')](_0x34ab('0x16'),_0x5116fc,_0x31cceb[_0x34ab('0x14')][_0x34ab('0x17')]);return _0x46dba5(_0x31cceb['error'][_0x34ab('0x17')]);}logger[_0x34ab('0x14')](_0x34ab('0x16'),_0x5116fc,_0x31cceb['error'][_0x34ab('0x17')]);return _0x38097c(_0x31cceb['error'][_0x34ab('0x17')]);}else{logger['info'](_0x34ab('0x16'),_0x5116fc,'request\x20sent');_0x38097c(_0x31cceb['result'][_0x34ab('0x17')]);}})[_0x34ab('0x18')](function(_0xdcef56){logger[_0x34ab('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x5116fc,_0xdcef56);_0x46dba5(_0xdcef56);});});}exports[_0x34ab('0x19')]=function(_0x13bc2d){var _0x136d05=this;return new Promise(function(_0x4d5086,_0x659966){return db[_0x34ab('0x1a')][_0x34ab('0x1b')]({'raw':_0x13bc2d[_0x34ab('0x1c')]?_0x13bc2d[_0x34ab('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x13bc2d[_0x34ab('0x1c')]?_0x13bc2d[_0x34ab('0x1c')][_0x34ab('0x1d')]||null:null,'attributes':_0x13bc2d[_0x34ab('0x1c')]?_0x13bc2d[_0x34ab('0x1c')]['attributes']||null:null,'limit':_0x13bc2d[_0x34ab('0x1c')]?_0x13bc2d[_0x34ab('0x1c')][_0x34ab('0x1e')]||null:null,'include':_0x13bc2d[_0x34ab('0x1c')]?_0x13bc2d[_0x34ab('0x1c')][_0x34ab('0x1f')]?_[_0x34ab('0x20')](_0x13bc2d[_0x34ab('0x1c')][_0x34ab('0x1f')],function(_0x2c8d00){return{'model':db[_0x2c8d00['model']],'as':_0x2c8d00['as'],'attributes':_0x2c8d00[_0x34ab('0x21')],'include':_0x2c8d00[_0x34ab('0x1f')]?_[_0x34ab('0x20')](_0x2c8d00[_0x34ab('0x1f')],function(_0x157434){return{'model':db[_0x157434[_0x34ab('0x22')]],'as':_0x157434['as'],'attributes':_0x157434[_0x34ab('0x21')],'include':_0x157434[_0x34ab('0x1f')]?_[_0x34ab('0x20')](_0x157434[_0x34ab('0x1f')],function(_0x10b00a){return{'model':db[_0x10b00a['model']],'as':_0x10b00a['as'],'attributes':_0x10b00a[_0x34ab('0x21')]};}):[]};}):[]};}):[]:[]})[_0x34ab('0xf')](function(_0x2426e3){logger['info'](_0x34ab('0x19'),_0x13bc2d);logger[_0x34ab('0x23')](_0x34ab('0x19'),_0x13bc2d,JSON['stringify'](_0x2426e3));_0x4d5086(_0x2426e3);})[_0x34ab('0x18')](function(_0x5a8fac){logger[_0x34ab('0x14')](_0x34ab('0x19'),_0x5a8fac[_0x34ab('0x17')],_0x13bc2d);_0x659966(_0x136d05[_0x34ab('0x14')](0x1f4,_0x5a8fac['message']));});});};exports[_0x34ab('0x24')]=function(_0x3d597a){var _0x51921d=this;return new Promise(function(_0x39bb4b,_0x53b166){return db[_0x34ab('0x1a')]['find']({'raw':_0x3d597a[_0x34ab('0x1c')]?_0x3d597a[_0x34ab('0x1c')][_0x34ab('0x25')]===undefined?!![]:![]:!![],'where':_0x3d597a[_0x34ab('0x1c')]?_0x3d597a[_0x34ab('0x1c')][_0x34ab('0x1d')]||null:null,'attributes':_0x3d597a[_0x34ab('0x1c')]?_0x3d597a[_0x34ab('0x1c')][_0x34ab('0x21')]||null:null,'include':_0x3d597a[_0x34ab('0x1c')]?_0x3d597a[_0x34ab('0x1c')]['include']?_[_0x34ab('0x20')](_0x3d597a[_0x34ab('0x1c')][_0x34ab('0x1f')],function(_0x45be0a){return{'model':db[_0x45be0a['model']],'as':_0x45be0a['as'],'attributes':_0x45be0a[_0x34ab('0x21')],'include':_0x45be0a[_0x34ab('0x1f')]?_[_0x34ab('0x20')](_0x45be0a['include'],function(_0x316872){return{'model':db[_0x316872[_0x34ab('0x22')]],'as':_0x316872['as'],'attributes':_0x316872['attributes'],'include':_0x316872[_0x34ab('0x1f')]?_[_0x34ab('0x20')](_0x316872['include'],function(_0x175470){return{'model':db[_0x175470['model']],'as':_0x175470['as'],'attributes':_0x175470[_0x34ab('0x21')]};}):[]};}):[]};}):[]:[]})[_0x34ab('0xf')](function(_0xb83e2e){logger[_0x34ab('0x10')](_0x34ab('0x24'),_0x3d597a);logger[_0x34ab('0x23')]('ShowVoiceQueue',_0x3d597a,JSON[_0x34ab('0x13')](_0xb83e2e));_0x39bb4b(_0xb83e2e);})[_0x34ab('0x18')](function(_0x48a49a){logger[_0x34ab('0x14')]('ShowVoiceQueue',_0x48a49a[_0x34ab('0x17')],_0x3d597a);_0x53b166(_0x51921d[_0x34ab('0x14')](0x1f4,_0x48a49a['message']));});});};
\ No newline at end of file
index a49dbd1..2d3f033 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef8=['./voiceQueue.events','save','update','register','length','voiceQueue:'];(function(_0x3cb09b,_0x31c2a5){var _0x242048=function(_0x464aba){while(--_0x464aba){_0x3cb09b['push'](_0x3cb09b['shift']());}};_0x242048(++_0x31c2a5);}(_0x2ef8,0xae));var _0x82ef=function(_0x5970f6,_0x5a2bd1){_0x5970f6=_0x5970f6-0x0;var _0x43dfc1=_0x2ef8[_0x5970f6];return _0x43dfc1;};'use strict';var VoiceQueueEvents=require(_0x82ef('0x0'));var events=[_0x82ef('0x1'),'remove',_0x82ef('0x2')];function createListener(_0x17229b,_0x136213){return function(_0x29eed6){_0x136213['emit'](_0x17229b,_0x29eed6);};}function removeListener(_0x5b071f,_0x3ded75){return function(){VoiceQueueEvents['removeListener'](_0x5b071f,_0x3ded75);};}exports[_0x82ef('0x3')]=function(_0x5505ce){for(var _0x546ca8=0x0,_0x4562f4=events[_0x82ef('0x4')];_0x546ca8<_0x4562f4;_0x546ca8++){var _0x52e97d=events[_0x546ca8];var _0x310bf2=createListener(_0x82ef('0x5')+_0x52e97d,_0x5505ce);VoiceQueueEvents['on'](_0x52e97d,_0x310bf2);}};
\ No newline at end of file
+var _0xaac9=['length','./voiceQueue.events','save','update','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaac9,0x1c8));var _0x9aac=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xaac9[_0x30b0d8];return _0x459c09;};'use strict';var VoiceQueueEvents=require(_0x9aac('0x0'));var events=[_0x9aac('0x1'),'remove',_0x9aac('0x2')];function createListener(_0x574d25,_0x1fc309){return function(_0x571ea3){_0x1fc309[_0x9aac('0x3')](_0x574d25,_0x571ea3);};}function removeListener(_0x149c7c,_0x38fad3){return function(){VoiceQueueEvents[_0x9aac('0x4')](_0x149c7c,_0x38fad3);};}exports[_0x9aac('0x5')]=function(_0x33098f){for(var _0x383a3a=0x0,_0x5754ca=events[_0x9aac('0x6')];_0x383a3a<_0x5754ca;_0x383a3a++){var _0x29a553=events[_0x383a3a];var _0x2038ef=createListener('voiceQueue:'+_0x29a553,_0x33098f);VoiceQueueEvents['on'](_0x29a553,_0x2038ef);}};
\ No newline at end of file
index 9288f06..f323548 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d70=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','create','put','/:id','delete','destroy','exports','multer','util'];(function(_0x538812,_0x312101){var _0x5759ad=function(_0x3295ac){while(--_0x3295ac){_0x538812['push'](_0x538812['shift']());}};_0x5759ad(++_0x312101);}(_0x8d70,0x98));var _0x08d7=function(_0x5571f6,_0x148662){_0x5571f6=_0x5571f6-0x0;var _0x2d41b1=_0x8d70[_0x5571f6];return _0x2d41b1;};'use strict';var multer=require(_0x08d7('0x0'));var util=require(_0x08d7('0x1'));var path=require('path');var timeout=require(_0x08d7('0x2'));var express=require(_0x08d7('0x3'));var router=express[_0x08d7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x08d7('0x5'));var interaction=require(_0x08d7('0x6'));var config=require(_0x08d7('0x7'));var controller=require(_0x08d7('0x8'));router[_0x08d7('0x9')]('/',auth[_0x08d7('0xa')](),controller[_0x08d7('0xb')]);router['get'](_0x08d7('0xc'),auth[_0x08d7('0xa')](),controller[_0x08d7('0xd')]);router[_0x08d7('0x9')](_0x08d7('0xe'),auth[_0x08d7('0xa')](),controller[_0x08d7('0xf')]);router[_0x08d7('0x9')]('/:id',auth[_0x08d7('0xa')](),controller['show']);router['post']('/',auth[_0x08d7('0xa')](),controller[_0x08d7('0x10')]);router[_0x08d7('0x11')](_0x08d7('0x12'),auth[_0x08d7('0xa')](),controller['update']);router[_0x08d7('0x13')](_0x08d7('0x12'),auth['isAuthenticated'](),controller[_0x08d7('0x14')]);module[_0x08d7('0x15')]=router;
\ No newline at end of file
+var _0x79d2=['update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','/:id','post','create','put'];(function(_0x5684ec,_0x306fe3){var _0x24d6d0=function(_0x30559b){while(--_0x30559b){_0x5684ec['push'](_0x5684ec['shift']());}};_0x24d6d0(++_0x306fe3);}(_0x79d2,0xd6));var _0x279d=function(_0x231068,_0x5bbe87){_0x231068=_0x231068-0x0;var _0x13aa8b=_0x79d2[_0x231068];return _0x13aa8b;};'use strict';var multer=require('multer');var util=require(_0x279d('0x0'));var path=require(_0x279d('0x1'));var timeout=require('connect-timeout');var express=require(_0x279d('0x2'));var router=express['Router']();var fs_extra=require(_0x279d('0x3'));var auth=require(_0x279d('0x4'));var interaction=require(_0x279d('0x5'));var config=require(_0x279d('0x6'));var controller=require(_0x279d('0x7'));router[_0x279d('0x8')]('/',auth[_0x279d('0x9')](),controller[_0x279d('0xa')]);router[_0x279d('0x8')]('/describe',auth[_0x279d('0x9')](),controller[_0x279d('0xb')]);router[_0x279d('0x8')](_0x279d('0xc'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router['get'](_0x279d('0xd'),auth[_0x279d('0x9')](),controller['show']);router[_0x279d('0xe')]('/',auth[_0x279d('0x9')](),controller[_0x279d('0xf')]);router[_0x279d('0x10')](_0x279d('0xd'),auth[_0x279d('0x9')](),controller[_0x279d('0x11')]);router[_0x279d('0x12')](_0x279d('0xd'),auth[_0x279d('0x9')](),controller[_0x279d('0x13')]);module[_0x279d('0x14')]=router;
\ No newline at end of file
index da3195f..d7a5dae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb55d=['DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING'];(function(_0x5a9002,_0x268df6){var _0x30b121=function(_0x34a37b){while(--_0x34a37b){_0x5a9002['push'](_0x5a9002['shift']());}};_0x30b121(++_0x268df6);}(_0xb55d,0x10c));var _0xdb55=function(_0x1f7536,_0x5eeb5e){_0x1f7536=_0x1f7536-0x0;var _0x17d0bc=_0xb55d[_0x1f7536];return _0x17d0bc;};'use strict';var Sequelize=require(_0xdb55('0x0'));var moment=require(_0xdb55('0x1'));module[_0xdb55('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdb55('0x3')]},'calleridnum':{'type':Sequelize[_0xdb55('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xdb55('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xdb55('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xdb55('0x4')],'set':function(_0x21b1e6){var _0x3216b7=moment(_0x21b1e6);var _0x1903f8=moment(this['getDataValue'](_0xdb55('0x5')))[_0xdb55('0x6')](_0xdb55('0x7'));var _0x11ef26=_0x3216b7[_0xdb55('0x8')](_0x1903f8,_0xdb55('0x9'));this[_0xdb55('0xa')](_0xdb55('0xb'),_0x21b1e6);this['setDataValue'](_0xdb55('0xc'),_0x11ef26||null);}},'position':{'type':Sequelize[_0xdb55('0xd')]},'count':{'type':Sequelize[_0xdb55('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xdb55('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xdb55('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xdb55('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xdb55('0x4')]},'queuecallerexit':{'type':Sequelize[_0xdb55('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xdb55('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xdb55('0x3')],'comment':_0xdb55('0xf')},'originalposition':{'type':Sequelize[_0xdb55('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xdb55('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdb55('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xdb55('0xd')]},'mohtime':{'type':Sequelize[_0xdb55('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdb55('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xdb55('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdb55('0x3')],'comment':_0xdb55('0x10')},'transferexten':{'type':Sequelize[_0xdb55('0x3')]},'transferuniqueid':{'type':Sequelize[_0xdb55('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdb55('0x3')]},'thirdDisposition':{'type':Sequelize[_0xdb55('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x069e=['getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x069e,0x114));var _0xe069=function(_0x33403b,_0x5cca9c){_0x33403b=_0x33403b-0x0;var _0x2d8657=_0x069e[_0x33403b];return _0x2d8657;};'use strict';var Sequelize=require(_0xe069('0x0'));var moment=require(_0xe069('0x1'));module['exports']={'type':{'type':Sequelize[_0xe069('0x2')]},'uniqueid':{'type':Sequelize[_0xe069('0x2')]},'calleridnum':{'type':Sequelize[_0xe069('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xe069('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xe069('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xe069('0x3')],'set':function(_0xc81b3b){var _0x174dd4=moment(_0xc81b3b);var _0x51b4ca=moment(this[_0xe069('0x4')]('queuecallerjoinAt'))[_0xe069('0x5')](_0xe069('0x6'));var _0x3ec8bd=_0x174dd4[_0xe069('0x7')](_0x51b4ca,'seconds');this[_0xe069('0x8')](_0xe069('0x9'),_0xc81b3b);this[_0xe069('0x8')](_0xe069('0xa'),_0x3ec8bd||null);}},'position':{'type':Sequelize[_0xe069('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xe069('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xe069('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe069('0x3')]},'queuecallerexit':{'type':Sequelize[_0xe069('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xe069('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xe069('0xb')]},'channel':{'type':Sequelize[_0xe069('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe069('0x2')]},'connectedlinename':{'type':Sequelize[_0xe069('0x2')]},'accountcode':{'type':Sequelize[_0xe069('0x2')]},'context':{'type':Sequelize[_0xe069('0x2')]},'exten':{'type':Sequelize[_0xe069('0x2')]},'priority':{'type':Sequelize[_0xe069('0x2')]},'holdtime':{'type':Sequelize[_0xe069('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xe069('0x2')]},'transfer':{'type':Sequelize[_0xe069('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe069('0x2')],'comment':_0xe069('0xd')},'transferexten':{'type':Sequelize[_0xe069('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xe069('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe069('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 539a52e..d72e18f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f9e=['reject','save','update','then','error','send','map','VoiceQueueReport','type','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','name','options','count','includeAll','findAll','rows','catch','params','include','find','create','body','destroy','describe','getVoiceQueuesReport','rawAttributes','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply'];(function(_0x40aaca,_0x4803f4){var _0x1252f7=function(_0x5a169a){while(--_0x5a169a){_0x40aaca['push'](_0x40aaca['shift']());}};_0x1252f7(++_0x4803f4);}(_0x7f9e,0x16d));var _0xe7f9=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x7f9e[_0x429948];return _0x35d5d1;};'use strict';var emlformat=require(_0xe7f9('0x0'));var rimraf=require(_0xe7f9('0x1'));var zipdir=require(_0xe7f9('0x2'));var jsonpatch=require(_0xe7f9('0x3'));var rp=require(_0xe7f9('0x4'));var moment=require(_0xe7f9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe7f9('0x6'));var util=require('util');var path=require(_0xe7f9('0x7'));var sox=require(_0xe7f9('0x8'));var csv=require(_0xe7f9('0x9'));var ejs=require(_0xe7f9('0xa'));var fs=require('fs');var fs_extra=require(_0xe7f9('0xb'));var _=require(_0xe7f9('0xc'));var squel=require(_0xe7f9('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7f9('0xe'));var deskjs=require(_0xe7f9('0xf'));var toCsv=require(_0xe7f9('0x9'));var querystring=require('querystring');var Papa=require(_0xe7f9('0x10'));var Redis=require(_0xe7f9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe7f9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7f9('0x13'));var logger=require(_0xe7f9('0x14'))(_0xe7f9('0x15'));var utils=require('../../config/utils');var config=require(_0xe7f9('0x16'));var licenseUtil=require(_0xe7f9('0x17'));var db=require(_0xe7f9('0x18'))['db'];config[_0xe7f9('0x19')]=_[_0xe7f9('0x1a')](config[_0xe7f9('0x19')],{'host':_0xe7f9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe7f9('0x19')]));require(_0xe7f9('0x1c'))[_0xe7f9('0x1d')](socket);function respondWithStatusCode(_0x375b53,_0x1813d2){_0x1813d2=_0x1813d2||0xcc;return function(_0x5bc8fd){if(_0x5bc8fd){return _0x375b53[_0xe7f9('0x1e')](_0x1813d2);}return _0x375b53[_0xe7f9('0x1f')](_0x1813d2)[_0xe7f9('0x20')]();};}function respondWithResult(_0x463175,_0x3274c0){_0x3274c0=_0x3274c0||0xc8;return function(_0x4f6413){if(_0x4f6413){return _0x463175[_0xe7f9('0x1f')](_0x3274c0)[_0xe7f9('0x21')](_0x4f6413);}};}function respondWithFilteredResult(_0x29dbe9,_0x365751){return function(_0x194cae){if(_0x194cae){var _0x2c35ff=typeof _0x365751[_0xe7f9('0x22')]===_0xe7f9('0x23')&&typeof _0x365751[_0xe7f9('0x24')]===_0xe7f9('0x23');var _0x3420a1=_0x194cae['count'];var _0x13b37c=_0x2c35ff?0x0:_0x365751[_0xe7f9('0x22')];var _0x5bb9c1=_0x2c35ff?_0x194cae['count']:_0x365751[_0xe7f9('0x22')]+_0x365751[_0xe7f9('0x24')];var _0x5abbe1;if(_0x5bb9c1>=_0x3420a1){_0x5bb9c1=_0x3420a1;_0x5abbe1=0xc8;}else{_0x5abbe1=0xce;}_0x29dbe9['status'](_0x5abbe1);return _0x29dbe9[_0xe7f9('0x25')](_0xe7f9('0x26'),_0x13b37c+'-'+_0x5bb9c1+'/'+_0x3420a1)[_0xe7f9('0x21')](_0x194cae);}return null;};}function patchUpdates(_0x5d0edf){return function(_0x3e1f46){try{jsonpatch[_0xe7f9('0x27')](_0x3e1f46,_0x5d0edf,!![]);}catch(_0x46203e){return BPromise[_0xe7f9('0x28')](_0x46203e);}return _0x3e1f46[_0xe7f9('0x29')]();};}function saveUpdates(_0x465a97,_0x22fdae){return function(_0x2040c5){if(_0x2040c5){return _0x2040c5[_0xe7f9('0x2a')](_0x465a97)[_0xe7f9('0x2b')](function(_0x4dc3ad){return _0x4dc3ad;});}return null;};}function removeEntity(_0x538fa2,_0xc64b4c){return function(_0x19c39e){if(_0x19c39e){return _0x19c39e['destroy']()[_0xe7f9('0x2b')](function(){_0x538fa2[_0xe7f9('0x1f')](0xcc)[_0xe7f9('0x20')]();});}};}function handleEntityNotFound(_0x396483,_0x3e9e6d){return function(_0x4cdd73){if(!_0x4cdd73){_0x396483['sendStatus'](0x194);}return _0x4cdd73;};}function handleError(_0x19f716,_0x1e4879){_0x1e4879=_0x1e4879||0x1f4;return function(_0x461a42){logger[_0xe7f9('0x2c')](_0x461a42['stack']);if(_0x461a42['name']){delete _0x461a42['name'];}_0x19f716[_0xe7f9('0x1f')](_0x1e4879)[_0xe7f9('0x2d')](_0x461a42);};}exports['index']=function(_0x967a6e,_0x560eff){var _0x209c0f={},_0x3866e9={},_0xf339b7={'count':0x0,'rows':[]};var _0x2aae86=_[_0xe7f9('0x2e')](db[_0xe7f9('0x2f')]['rawAttributes'],function(_0x2c7d5e){return{'name':_0x2c7d5e['fieldName'],'type':_0x2c7d5e[_0xe7f9('0x30')]['key']};});_0x3866e9['model']=_[_0xe7f9('0x2e')](_0x2aae86,'name');_0x3866e9[_0xe7f9('0x31')]=_[_0xe7f9('0x32')](_0x967a6e[_0xe7f9('0x31')]);_0x3866e9[_0xe7f9('0x33')]=_[_0xe7f9('0x34')](_0x3866e9['model'],_0x3866e9[_0xe7f9('0x31')]);_0x209c0f['attributes']=_['intersection'](_0x3866e9['model'],qs[_0xe7f9('0x35')](_0x967a6e['query']['fields']));_0x209c0f[_0xe7f9('0x36')]=_0x209c0f[_0xe7f9('0x36')][_0xe7f9('0x37')]?_0x209c0f[_0xe7f9('0x36')]:_0x3866e9[_0xe7f9('0x38')];if(!_0x967a6e[_0xe7f9('0x31')][_0xe7f9('0x39')](_0xe7f9('0x3a'))){_0x209c0f[_0xe7f9('0x24')]=qs[_0xe7f9('0x24')](_0x967a6e[_0xe7f9('0x31')][_0xe7f9('0x24')]);_0x209c0f[_0xe7f9('0x22')]=qs[_0xe7f9('0x22')](_0x967a6e[_0xe7f9('0x31')][_0xe7f9('0x22')]);}_0x209c0f['order']=qs[_0xe7f9('0x3b')](_0x967a6e[_0xe7f9('0x31')]['sort']);_0x209c0f[_0xe7f9('0x3c')]=qs[_0xe7f9('0x33')](_[_0xe7f9('0x3d')](_0x967a6e[_0xe7f9('0x31')],_0x3866e9[_0xe7f9('0x33')]),_0x2aae86);if(_0x967a6e[_0xe7f9('0x31')][_0xe7f9('0x3e')]){_0x209c0f[_0xe7f9('0x3c')]=_[_0xe7f9('0x3f')](_0x209c0f[_0xe7f9('0x3c')],{'$or':_[_0xe7f9('0x2e')](_0x2aae86,function(_0x30b789){if(_0x30b789['type']!=='VIRTUAL'){var _0x36649a={};_0x36649a[_0x30b789[_0xe7f9('0x40')]]={'$like':'%'+_0x967a6e['query'][_0xe7f9('0x3e')]+'%'};return _0x36649a;}})});}_0x209c0f=_[_0xe7f9('0x3f')]({},_0x209c0f,_0x967a6e[_0xe7f9('0x41')]);var _0x1c84bb={'where':_0x209c0f[_0xe7f9('0x3c')]};return db[_0xe7f9('0x2f')][_0xe7f9('0x42')](_0x1c84bb)[_0xe7f9('0x2b')](function(_0x45fd85){_0xf339b7[_0xe7f9('0x42')]=_0x45fd85;if(_0x967a6e[_0xe7f9('0x31')][_0xe7f9('0x43')]){_0x209c0f['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xe7f9('0x44')](_0x209c0f);})[_0xe7f9('0x2b')](function(_0x14db5a){_0xf339b7[_0xe7f9('0x45')]=_0x14db5a;return _0xf339b7;})[_0xe7f9('0x2b')](respondWithFilteredResult(_0x560eff,_0x209c0f))[_0xe7f9('0x46')](handleError(_0x560eff,null));};exports['show']=function(_0x4d6a3c,_0x3c5423){var _0xfef0ab={'raw':![],'where':{'id':_0x4d6a3c[_0xe7f9('0x47')]['id']}},_0x4c3f42={};_0x4c3f42[_0xe7f9('0x38')]=_[_0xe7f9('0x32')](db['VoiceQueueReport']['rawAttributes']);_0x4c3f42[_0xe7f9('0x31')]=_[_0xe7f9('0x32')](_0x4d6a3c[_0xe7f9('0x31')]);_0x4c3f42[_0xe7f9('0x33')]=_[_0xe7f9('0x34')](_0x4c3f42['model'],_0x4c3f42[_0xe7f9('0x31')]);_0xfef0ab[_0xe7f9('0x36')]=_['intersection'](_0x4c3f42[_0xe7f9('0x38')],qs[_0xe7f9('0x35')](_0x4d6a3c[_0xe7f9('0x31')][_0xe7f9('0x35')]));_0xfef0ab[_0xe7f9('0x36')]=_0xfef0ab['attributes'][_0xe7f9('0x37')]?_0xfef0ab[_0xe7f9('0x36')]:_0x4c3f42[_0xe7f9('0x38')];if(_0x4d6a3c[_0xe7f9('0x31')][_0xe7f9('0x43')]){_0xfef0ab[_0xe7f9('0x48')]=[{'all':!![]}];}_0xfef0ab=_[_0xe7f9('0x3f')]({},_0xfef0ab,_0x4d6a3c[_0xe7f9('0x41')]);return db[_0xe7f9('0x2f')][_0xe7f9('0x49')](_0xfef0ab)[_0xe7f9('0x2b')](handleEntityNotFound(_0x3c5423,null))['then'](respondWithResult(_0x3c5423,null))[_0xe7f9('0x46')](handleError(_0x3c5423,null));};exports[_0xe7f9('0x4a')]=function(_0x7abc19,_0x1fd75c){return db[_0xe7f9('0x2f')][_0xe7f9('0x4a')](_0x7abc19[_0xe7f9('0x4b')],{})['then'](respondWithResult(_0x1fd75c,0xc9))[_0xe7f9('0x46')](handleError(_0x1fd75c,null));};exports[_0xe7f9('0x2a')]=function(_0x56572b,_0x1bb3d7){if(_0x56572b[_0xe7f9('0x4b')]['id']){delete _0x56572b[_0xe7f9('0x4b')]['id'];}return db[_0xe7f9('0x2f')][_0xe7f9('0x49')]({'where':{'id':_0x56572b[_0xe7f9('0x47')]['id']}})[_0xe7f9('0x2b')](handleEntityNotFound(_0x1bb3d7,null))['then'](saveUpdates(_0x56572b['body'],null))[_0xe7f9('0x2b')](respondWithResult(_0x1bb3d7,null))['catch'](handleError(_0x1bb3d7,null));};exports[_0xe7f9('0x4c')]=function(_0x4e72f2,_0x279ad2){return db['VoiceQueueReport']['find']({'where':{'id':_0x4e72f2[_0xe7f9('0x47')]['id']}})[_0xe7f9('0x2b')](handleEntityNotFound(_0x279ad2,null))[_0xe7f9('0x2b')](removeEntity(_0x279ad2,null))[_0xe7f9('0x46')](handleError(_0x279ad2,null));};exports[_0xe7f9('0x4d')]=function(_0x4110d4,_0xa40da3){return db[_0xe7f9('0x2f')][_0xe7f9('0x4d')]()[_0xe7f9('0x2b')](respondWithResult(_0xa40da3,null))[_0xe7f9('0x46')](handleError(_0xa40da3,null));};exports[_0xe7f9('0x4e')]=function(_0x5291f2,_0x5d4de6){var _0x123516={},_0x2aa559={},_0x4b583f={'count':0x0,'rows':[]};_0x2aa559[_0xe7f9('0x38')]=_[_0xe7f9('0x32')](db[_0xe7f9('0x2f')][_0xe7f9('0x4f')]);_0x2aa559['query']=_[_0xe7f9('0x32')](_0x5291f2['query']);_0x2aa559['filters']=_[_0xe7f9('0x34')](_0x2aa559[_0xe7f9('0x38')],_0x2aa559[_0xe7f9('0x31')]);_0x123516[_0xe7f9('0x36')]=_[_0xe7f9('0x34')](_0x2aa559[_0xe7f9('0x38')],qs[_0xe7f9('0x35')](_0x5291f2[_0xe7f9('0x31')][_0xe7f9('0x35')]));_0x123516[_0xe7f9('0x36')]=_0x123516['attributes']['length']?_0x123516['attributes']:_0x2aa559[_0xe7f9('0x38')];if(!_0x5291f2[_0xe7f9('0x31')][_0xe7f9('0x39')](_0xe7f9('0x3a'))){_0x123516[_0xe7f9('0x24')]=qs[_0xe7f9('0x24')](_0x5291f2['query'][_0xe7f9('0x24')]);_0x123516[_0xe7f9('0x22')]=qs[_0xe7f9('0x22')](_0x5291f2['query'][_0xe7f9('0x22')]);}_0x123516[_0xe7f9('0x50')]=qs[_0xe7f9('0x3b')](_0x5291f2[_0xe7f9('0x31')][_0xe7f9('0x3b')]);_0x123516[_0xe7f9('0x3c')]=qs['filters'](_[_0xe7f9('0x3d')](_0x5291f2[_0xe7f9('0x31')],_0x2aa559['filters']));if(_0x5291f2[_0xe7f9('0x31')][_0xe7f9('0x3e')]){_0x123516[_0xe7f9('0x3c')]=_[_0xe7f9('0x3f')](_0x123516[_0xe7f9('0x3c')],{'$or':_[_0xe7f9('0x2e')](_0x123516['attributes'],function(_0x30b9e4){var _0x73ae61={};_0x73ae61[_0x30b9e4]={'$like':'%'+_0x5291f2[_0xe7f9('0x31')][_0xe7f9('0x3e')]+'%'};return _0x73ae61;})});}_0x123516=_[_0xe7f9('0x3f')]({},_0x123516,_0x5291f2[_0xe7f9('0x41')]);var _0x3b23a0={'where':_0x123516['where']};return db[_0xe7f9('0x2f')][_0xe7f9('0x42')](_0x3b23a0)['then'](function(_0x461e5b){_0x4b583f[_0xe7f9('0x42')]=_0x461e5b;if(_0x5291f2[_0xe7f9('0x31')][_0xe7f9('0x43')]){_0x123516[_0xe7f9('0x48')]=[{'all':!![]}];}return db[_0xe7f9('0x2f')][_0xe7f9('0x44')](_0x123516);})[_0xe7f9('0x2b')](function(_0x33ccda){_0x4b583f['rows']=_0x33ccda;return _0x4b583f;})[_0xe7f9('0x2b')](respondWithFilteredResult(_0x5d4de6,_0x123516,_0xe7f9('0x4e')))['catch'](handleError(_0x5d4de6,null,_0xe7f9('0x4e')));};
\ No newline at end of file
+var _0xb37c=['api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','end','status','json','offset','undefined','limit','count','apply','reject','then','sendStatus','error','stack','name','send','rawAttributes','type','key','map','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','destroy','describe','getVoiceQueuesReport','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3ee5df,_0x583073){var _0x446d24=function(_0x12e54e){while(--_0x12e54e){_0x3ee5df['push'](_0x3ee5df['shift']());}};_0x446d24(++_0x583073);}(_0xb37c,0x1d4));var _0xcb37=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb37c[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xcb37('0x0'));var rimraf=require(_0xcb37('0x1'));var zipdir=require(_0xcb37('0x2'));var jsonpatch=require(_0xcb37('0x3'));var rp=require(_0xcb37('0x4'));var moment=require(_0xcb37('0x5'));var BPromise=require(_0xcb37('0x6'));var Mustache=require(_0xcb37('0x7'));var util=require(_0xcb37('0x8'));var path=require(_0xcb37('0x9'));var sox=require(_0xcb37('0xa'));var csv=require('to-csv');var ejs=require(_0xcb37('0xb'));var fs=require('fs');var fs_extra=require(_0xcb37('0xc'));var _=require(_0xcb37('0xd'));var squel=require(_0xcb37('0xe'));var crypto=require(_0xcb37('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xcb37('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcb37('0x11'));var Papa=require(_0xcb37('0x12'));var Redis=require(_0xcb37('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcb37('0x14'));var as=require(_0xcb37('0x15'));var hardwareService=require(_0xcb37('0x16'));var logger=require(_0xcb37('0x17'))(_0xcb37('0x18'));var utils=require(_0xcb37('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcb37('0x1a'))['db'];config[_0xcb37('0x1b')]=_['defaults'](config['redis'],{'host':_0xcb37('0x1c'),'port':0x18eb});var socket=require(_0xcb37('0x1d'))(new Redis(config[_0xcb37('0x1b')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x6359f5,_0x56114d){_0x56114d=_0x56114d||0xcc;return function(_0x27fdb8){if(_0x27fdb8){return _0x6359f5['sendStatus'](_0x56114d);}return _0x6359f5['status'](_0x56114d)[_0xcb37('0x1e')]();};}function respondWithResult(_0x3974ad,_0x41d1c9){_0x41d1c9=_0x41d1c9||0xc8;return function(_0x16c2b2){if(_0x16c2b2){return _0x3974ad[_0xcb37('0x1f')](_0x41d1c9)[_0xcb37('0x20')](_0x16c2b2);}};}function respondWithFilteredResult(_0x3affe5,_0x57c2a3){return function(_0x18c361){if(_0x18c361){var _0x1d2ae1=typeof _0x57c2a3[_0xcb37('0x21')]===_0xcb37('0x22')&&typeof _0x57c2a3[_0xcb37('0x23')]===_0xcb37('0x22');var _0x55165a=_0x18c361[_0xcb37('0x24')];var _0x2154ed=_0x1d2ae1?0x0:_0x57c2a3[_0xcb37('0x21')];var _0x447101=_0x1d2ae1?_0x18c361[_0xcb37('0x24')]:_0x57c2a3[_0xcb37('0x21')]+_0x57c2a3[_0xcb37('0x23')];var _0x24b007;if(_0x447101>=_0x55165a){_0x447101=_0x55165a;_0x24b007=0xc8;}else{_0x24b007=0xce;}_0x3affe5[_0xcb37('0x1f')](_0x24b007);return _0x3affe5['set']('Content-Range',_0x2154ed+'-'+_0x447101+'/'+_0x55165a)[_0xcb37('0x20')](_0x18c361);}return null;};}function patchUpdates(_0x556725){return function(_0x4046e1){try{jsonpatch[_0xcb37('0x25')](_0x4046e1,_0x556725,!![]);}catch(_0x132d67){return BPromise[_0xcb37('0x26')](_0x132d67);}return _0x4046e1['save']();};}function saveUpdates(_0x2b2b4a,_0x170b15){return function(_0x10dc28){if(_0x10dc28){return _0x10dc28['update'](_0x2b2b4a)[_0xcb37('0x27')](function(_0x1cd173){return _0x1cd173;});}return null;};}function removeEntity(_0x4bd60b,_0x5b29b0){return function(_0x294104){if(_0x294104){return _0x294104['destroy']()[_0xcb37('0x27')](function(){_0x4bd60b[_0xcb37('0x1f')](0xcc)[_0xcb37('0x1e')]();});}};}function handleEntityNotFound(_0x28ac52,_0x295910){return function(_0x42f8bd){if(!_0x42f8bd){_0x28ac52[_0xcb37('0x28')](0x194);}return _0x42f8bd;};}function handleError(_0x148d6a,_0x13c82b){_0x13c82b=_0x13c82b||0x1f4;return function(_0x4fcec7){logger[_0xcb37('0x29')](_0x4fcec7[_0xcb37('0x2a')]);if(_0x4fcec7[_0xcb37('0x2b')]){delete _0x4fcec7['name'];}_0x148d6a[_0xcb37('0x1f')](_0x13c82b)[_0xcb37('0x2c')](_0x4fcec7);};}exports['index']=function(_0x285ac7,_0x289db1){var _0x297e90={},_0x2773f1={},_0x4ff254={'count':0x0,'rows':[]};var _0x2bb69e=_['map'](db['VoiceQueueReport'][_0xcb37('0x2d')],function(_0x3d2432){return{'name':_0x3d2432['fieldName'],'type':_0x3d2432[_0xcb37('0x2e')][_0xcb37('0x2f')]};});_0x2773f1['model']=_[_0xcb37('0x30')](_0x2bb69e,_0xcb37('0x2b'));_0x2773f1['query']=_[_0xcb37('0x31')](_0x285ac7[_0xcb37('0x32')]);_0x2773f1[_0xcb37('0x33')]=_[_0xcb37('0x34')](_0x2773f1[_0xcb37('0x35')],_0x2773f1[_0xcb37('0x32')]);_0x297e90[_0xcb37('0x36')]=_[_0xcb37('0x34')](_0x2773f1[_0xcb37('0x35')],qs['fields'](_0x285ac7[_0xcb37('0x32')][_0xcb37('0x37')]));_0x297e90['attributes']=_0x297e90[_0xcb37('0x36')]['length']?_0x297e90['attributes']:_0x2773f1[_0xcb37('0x35')];if(!_0x285ac7['query'][_0xcb37('0x38')]('nolimit')){_0x297e90['limit']=qs[_0xcb37('0x23')](_0x285ac7[_0xcb37('0x32')]['limit']);_0x297e90[_0xcb37('0x21')]=qs[_0xcb37('0x21')](_0x285ac7[_0xcb37('0x32')][_0xcb37('0x21')]);}_0x297e90[_0xcb37('0x39')]=qs['sort'](_0x285ac7['query'][_0xcb37('0x3a')]);_0x297e90[_0xcb37('0x3b')]=qs[_0xcb37('0x33')](_[_0xcb37('0x3c')](_0x285ac7[_0xcb37('0x32')],_0x2773f1[_0xcb37('0x33')]),_0x2bb69e);if(_0x285ac7[_0xcb37('0x32')][_0xcb37('0x3d')]){_0x297e90[_0xcb37('0x3b')]=_[_0xcb37('0x3e')](_0x297e90[_0xcb37('0x3b')],{'$or':_[_0xcb37('0x30')](_0x2bb69e,function(_0x13a330){if(_0x13a330[_0xcb37('0x2e')]!==_0xcb37('0x3f')){var _0xea74b2={};_0xea74b2[_0x13a330[_0xcb37('0x2b')]]={'$like':'%'+_0x285ac7[_0xcb37('0x32')][_0xcb37('0x3d')]+'%'};return _0xea74b2;}})});}_0x297e90=_['merge']({},_0x297e90,_0x285ac7[_0xcb37('0x40')]);var _0x39006c={'where':_0x297e90[_0xcb37('0x3b')]};return db[_0xcb37('0x41')][_0xcb37('0x24')](_0x39006c)[_0xcb37('0x27')](function(_0x1e465e){_0x4ff254[_0xcb37('0x24')]=_0x1e465e;if(_0x285ac7[_0xcb37('0x32')][_0xcb37('0x42')]){_0x297e90[_0xcb37('0x43')]=[{'all':!![]}];}return db[_0xcb37('0x41')][_0xcb37('0x44')](_0x297e90);})[_0xcb37('0x27')](function(_0x55bae8){_0x4ff254[_0xcb37('0x45')]=_0x55bae8;return _0x4ff254;})[_0xcb37('0x27')](respondWithFilteredResult(_0x289db1,_0x297e90))[_0xcb37('0x46')](handleError(_0x289db1,null));};exports[_0xcb37('0x47')]=function(_0xe8ddf4,_0x421dea){var _0x4a2d0e={'raw':![],'where':{'id':_0xe8ddf4[_0xcb37('0x48')]['id']}},_0x1013c2={};_0x1013c2[_0xcb37('0x35')]=_[_0xcb37('0x31')](db[_0xcb37('0x41')][_0xcb37('0x2d')]);_0x1013c2[_0xcb37('0x32')]=_[_0xcb37('0x31')](_0xe8ddf4[_0xcb37('0x32')]);_0x1013c2[_0xcb37('0x33')]=_['intersection'](_0x1013c2[_0xcb37('0x35')],_0x1013c2['query']);_0x4a2d0e['attributes']=_[_0xcb37('0x34')](_0x1013c2[_0xcb37('0x35')],qs[_0xcb37('0x37')](_0xe8ddf4[_0xcb37('0x32')][_0xcb37('0x37')]));_0x4a2d0e[_0xcb37('0x36')]=_0x4a2d0e[_0xcb37('0x36')][_0xcb37('0x49')]?_0x4a2d0e[_0xcb37('0x36')]:_0x1013c2['model'];if(_0xe8ddf4[_0xcb37('0x32')]['includeAll']){_0x4a2d0e[_0xcb37('0x43')]=[{'all':!![]}];}_0x4a2d0e=_[_0xcb37('0x3e')]({},_0x4a2d0e,_0xe8ddf4['options']);return db['VoiceQueueReport'][_0xcb37('0x4a')](_0x4a2d0e)[_0xcb37('0x27')](handleEntityNotFound(_0x421dea,null))[_0xcb37('0x27')](respondWithResult(_0x421dea,null))[_0xcb37('0x46')](handleError(_0x421dea,null));};exports[_0xcb37('0x4b')]=function(_0x366252,_0x1d5825){return db[_0xcb37('0x41')][_0xcb37('0x4b')](_0x366252[_0xcb37('0x4c')],{})['then'](respondWithResult(_0x1d5825,0xc9))[_0xcb37('0x46')](handleError(_0x1d5825,null));};exports[_0xcb37('0x4d')]=function(_0x4b40dd,_0x1c5d27){if(_0x4b40dd[_0xcb37('0x4c')]['id']){delete _0x4b40dd[_0xcb37('0x4c')]['id'];}return db['VoiceQueueReport'][_0xcb37('0x4a')]({'where':{'id':_0x4b40dd[_0xcb37('0x48')]['id']}})[_0xcb37('0x27')](handleEntityNotFound(_0x1c5d27,null))[_0xcb37('0x27')](saveUpdates(_0x4b40dd[_0xcb37('0x4c')],null))['then'](respondWithResult(_0x1c5d27,null))[_0xcb37('0x46')](handleError(_0x1c5d27,null));};exports[_0xcb37('0x4e')]=function(_0xa1f33c,_0x42cddc){return db['VoiceQueueReport'][_0xcb37('0x4a')]({'where':{'id':_0xa1f33c['params']['id']}})['then'](handleEntityNotFound(_0x42cddc,null))[_0xcb37('0x27')](removeEntity(_0x42cddc,null))['catch'](handleError(_0x42cddc,null));};exports['describe']=function(_0x3a56fd,_0x3e1e29){return db[_0xcb37('0x41')][_0xcb37('0x4f')]()[_0xcb37('0x27')](respondWithResult(_0x3e1e29,null))[_0xcb37('0x46')](handleError(_0x3e1e29,null));};exports[_0xcb37('0x50')]=function(_0x3b651c,_0x3cf6ba){var _0x1470b2={},_0x34b36b={},_0x474548={'count':0x0,'rows':[]};_0x34b36b[_0xcb37('0x35')]=_[_0xcb37('0x31')](db[_0xcb37('0x41')][_0xcb37('0x2d')]);_0x34b36b[_0xcb37('0x32')]=_['keys'](_0x3b651c[_0xcb37('0x32')]);_0x34b36b[_0xcb37('0x33')]=_['intersection'](_0x34b36b['model'],_0x34b36b[_0xcb37('0x32')]);_0x1470b2[_0xcb37('0x36')]=_['intersection'](_0x34b36b[_0xcb37('0x35')],qs[_0xcb37('0x37')](_0x3b651c[_0xcb37('0x32')][_0xcb37('0x37')]));_0x1470b2[_0xcb37('0x36')]=_0x1470b2['attributes'][_0xcb37('0x49')]?_0x1470b2['attributes']:_0x34b36b[_0xcb37('0x35')];if(!_0x3b651c[_0xcb37('0x32')]['hasOwnProperty'](_0xcb37('0x51'))){_0x1470b2[_0xcb37('0x23')]=qs[_0xcb37('0x23')](_0x3b651c[_0xcb37('0x32')][_0xcb37('0x23')]);_0x1470b2[_0xcb37('0x21')]=qs[_0xcb37('0x21')](_0x3b651c[_0xcb37('0x32')][_0xcb37('0x21')]);}_0x1470b2[_0xcb37('0x39')]=qs['sort'](_0x3b651c[_0xcb37('0x32')]['sort']);_0x1470b2[_0xcb37('0x3b')]=qs[_0xcb37('0x33')](_[_0xcb37('0x3c')](_0x3b651c['query'],_0x34b36b[_0xcb37('0x33')]));if(_0x3b651c['query'][_0xcb37('0x3d')]){_0x1470b2[_0xcb37('0x3b')]=_[_0xcb37('0x3e')](_0x1470b2[_0xcb37('0x3b')],{'$or':_[_0xcb37('0x30')](_0x1470b2[_0xcb37('0x36')],function(_0x1fa3eb){var _0x4a71f3={};_0x4a71f3[_0x1fa3eb]={'$like':'%'+_0x3b651c[_0xcb37('0x32')][_0xcb37('0x3d')]+'%'};return _0x4a71f3;})});}_0x1470b2=_[_0xcb37('0x3e')]({},_0x1470b2,_0x3b651c[_0xcb37('0x40')]);var _0x2ed278={'where':_0x1470b2['where']};return db[_0xcb37('0x41')][_0xcb37('0x24')](_0x2ed278)[_0xcb37('0x27')](function(_0x2af322){_0x474548[_0xcb37('0x24')]=_0x2af322;if(_0x3b651c[_0xcb37('0x32')]['includeAll']){_0x1470b2[_0xcb37('0x43')]=[{'all':!![]}];}return db[_0xcb37('0x41')][_0xcb37('0x44')](_0x1470b2);})[_0xcb37('0x27')](function(_0x33cbb5){_0x474548[_0xcb37('0x45')]=_0x33cbb5;return _0x474548;})[_0xcb37('0x27')](respondWithFilteredResult(_0x3cf6ba,_0x1470b2,_0xcb37('0x50')))['catch'](handleError(_0x3cf6ba,null,'getVoiceQueuesReport'));};
\ No newline at end of file
index f5bdf7b..a8770e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b79=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit'];(function(_0x47d013,_0xd74ddc){var _0x3c50f=function(_0x16bb4c){while(--_0x16bb4c){_0x47d013['push'](_0x47d013['shift']());}};_0x3c50f(++_0xd74ddc);}(_0x7b79,0xa3));var _0x97b7=function(_0x1e2bca,_0x2687ae){_0x1e2bca=_0x1e2bca-0x0;var _0x152840=_0x7b79[_0x1e2bca];return _0x152840;};'use strict';var EventEmitter=require(_0x97b7('0x0'));var VoiceQueueReport=require(_0x97b7('0x1'))['db'][_0x97b7('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x97b7('0x3')](0x0);var events={'afterCreate':_0x97b7('0x4'),'afterUpdate':_0x97b7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x16922c){return function(_0x2268cb,_0x3fde6c,_0x3a6b92){VoiceQueueReportEvents['emit'](_0x16922c+':'+_0x2268cb['id'],_0x2268cb);VoiceQueueReportEvents[_0x97b7('0x6')](_0x16922c,_0x2268cb);_0x3a6b92(null);};}for(var e in events){if(events[_0x97b7('0x7')](e)){var event=events[e];VoiceQueueReport[_0x97b7('0x8')](e,emitEvent(event));}}module[_0x97b7('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x7c3e=['emit','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x41438f,_0x31a39f){var _0x3c3971=function(_0x119600){while(--_0x119600){_0x41438f['push'](_0x41438f['shift']());}};_0x3c3971(++_0x31a39f);}(_0x7c3e,0x7a));var _0xe7c3=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0x7c3e[_0x3cb152];return _0x4f54c3;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xe7c3('0x0'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe7c3('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe7c3('0x2'),'afterDestroy':_0xe7c3('0x3')};function emitEvent(_0x181ae9){return function(_0x20f285,_0x1e7534,_0x23c202){VoiceQueueReportEvents[_0xe7c3('0x4')](_0x181ae9+':'+_0x20f285['id'],_0x20f285);VoiceQueueReportEvents[_0xe7c3('0x4')](_0x181ae9,_0x20f285);_0x23c202(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xe7c3('0x5')](e,emitEvent(event));}}module[_0xe7c3('0x6')]=VoiceQueueReportEvents;
\ No newline at end of file
index 0129b40..4bac526 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2cf=['exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util','api','request-promise','path','rimraf','./voiceQueueReport.attributes'];(function(_0x26fc25,_0x1d52a8){var _0xae68b2=function(_0x36941c){while(--_0x36941c){_0x26fc25['push'](_0x26fc25['shift']());}};_0xae68b2(++_0x1d52a8);}(_0xf2cf,0x95));var _0xff2c=function(_0x56ff6e,_0x2b86d9){_0x56ff6e=_0x56ff6e-0x0;var _0x18a5d8=_0xf2cf[_0x56ff6e];return _0x18a5d8;};'use strict';var _=require(_0xff2c('0x0'));var util=require(_0xff2c('0x1'));var logger=require('../../config/logger')(_0xff2c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xff2c('0x3'));var fs=require('fs');var path=require(_0xff2c('0x4'));var rimraf=require(_0xff2c('0x5'));var config=require('../../config/environment');var attributes=require(_0xff2c('0x6'));module[_0xff2c('0x7')]=function(_0x2ed434,_0x196d4a){return _0x2ed434[_0xff2c('0x8')](_0xff2c('0x9'),attributes,{'tableName':_0xff2c('0xa'),'paranoid':![],'indexes':[{'fields':[_0xff2c('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3182=['api','moment','bluebird','path','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','util','../../config/logger'];(function(_0x2d42cf,_0xa08601){var _0x438443=function(_0x38b4a3){while(--_0x38b4a3){_0x2d42cf['push'](_0x2d42cf['shift']());}};_0x438443(++_0xa08601);}(_0x3182,0x1d2));var _0x2318=function(_0x16be03,_0x4e5805){_0x16be03=_0x16be03-0x0;var _0x244806=_0x3182[_0x16be03];return _0x244806;};'use strict';var _=require('lodash');var util=require(_0x2318('0x0'));var logger=require(_0x2318('0x1'))(_0x2318('0x2'));var moment=require(_0x2318('0x3'));var BPromise=require(_0x2318('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2318('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2318('0x6'));module[_0x2318('0x7')]=function(_0xdf718e,_0x317add){return _0xdf718e[_0x2318('0x8')](_0x2318('0x9'),attributes,{'tableName':_0x2318('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2318('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
index 63f030d..cd6951e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf9a=['options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVoiceQueueReport'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xbf9a,0x1d1));var _0xabf9=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xbf9a[_0x556bb1];return _0x45455f;};'use strict';var _=require(_0xabf9('0x0'));var util=require(_0xabf9('0x1'));var moment=require(_0xabf9('0x2'));var BPromise=require(_0xabf9('0x3'));var rs=require(_0xabf9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabf9('0x5'))['db'];var utils=require(_0xabf9('0x6'));var logger=require(_0xabf9('0x7'))(_0xabf9('0x8'));var config=require(_0xabf9('0x9'));var jayson=require(_0xabf9('0xa'));var client=jayson[_0xabf9('0xb')]['http']({'port':0x232a});config[_0xabf9('0xc')]=_[_0xabf9('0xd')](config[_0xabf9('0xc')],{'host':_0xabf9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabf9('0xc')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x369239,_0x21e2c0,_0x2b6ff5){return new BPromise(function(_0xee22f4,_0x217d2f){return client[_0xabf9('0xf')](_0x369239,_0x2b6ff5)[_0xabf9('0x10')](function(_0x154327){logger['info'](_0xabf9('0x11'),_0x21e2c0,_0xabf9('0x12'));logger[_0xabf9('0x13')](_0xabf9('0x14'),_0x21e2c0,_0xabf9('0x12'),JSON[_0xabf9('0x15')](_0x154327));if(_0x154327[_0xabf9('0x16')]){if(_0x154327[_0xabf9('0x16')]['code']===0x1f4){logger[_0xabf9('0x16')](_0xabf9('0x11'),_0x21e2c0,_0x154327['error'][_0xabf9('0x17')]);return _0x217d2f(_0x154327[_0xabf9('0x16')][_0xabf9('0x17')]);}logger[_0xabf9('0x16')](_0xabf9('0x11'),_0x21e2c0,_0x154327[_0xabf9('0x16')][_0xabf9('0x17')]);return _0xee22f4(_0x154327['error'][_0xabf9('0x17')]);}else{logger[_0xabf9('0x18')](_0xabf9('0x11'),_0x21e2c0,_0xabf9('0x12'));_0xee22f4(_0x154327['result'][_0xabf9('0x17')]);}})[_0xabf9('0x19')](function(_0x576fb4){logger['error'](_0xabf9('0x11'),_0x21e2c0,_0x576fb4);_0x217d2f(_0x576fb4);});});}exports[_0xabf9('0x1a')]=function(_0x105d04){var _0x14cdd4=this;return new Promise(function(_0x2e45b8,_0x286431){return db['VoiceQueueReport']['findAll']({'raw':_0x105d04[_0xabf9('0x1b')]?_0x105d04[_0xabf9('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x105d04[_0xabf9('0x1b')]?_0x105d04['options'][_0xabf9('0x1c')]||null:null,'attributes':_0x105d04[_0xabf9('0x1b')]?_0x105d04['options'][_0xabf9('0x1d')]||null:null,'limit':_0x105d04[_0xabf9('0x1b')]?_0x105d04[_0xabf9('0x1b')][_0xabf9('0x1e')]||null:null,'include':_0x105d04['options']?_0x105d04[_0xabf9('0x1b')][_0xabf9('0x1f')]?_[_0xabf9('0x20')](_0x105d04[_0xabf9('0x1b')][_0xabf9('0x1f')],function(_0x142f5b){return{'model':db[_0x142f5b['model']],'as':_0x142f5b['as'],'attributes':_0x142f5b[_0xabf9('0x1d')],'include':_0x142f5b[_0xabf9('0x1f')]?_[_0xabf9('0x20')](_0x142f5b[_0xabf9('0x1f')],function(_0x4ebd48){return{'model':db[_0x4ebd48[_0xabf9('0x21')]],'as':_0x4ebd48['as'],'attributes':_0x4ebd48[_0xabf9('0x1d')],'include':_0x4ebd48[_0xabf9('0x1f')]?_[_0xabf9('0x20')](_0x4ebd48[_0xabf9('0x1f')],function(_0x23e766){return{'model':db[_0x23e766[_0xabf9('0x21')]],'as':_0x23e766['as'],'attributes':_0x23e766['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x580e10){logger[_0xabf9('0x18')](_0xabf9('0x1a'),_0x105d04);logger[_0xabf9('0x13')](_0xabf9('0x1a'),_0x105d04,JSON[_0xabf9('0x15')](_0x580e10));_0x2e45b8(_0x580e10);})[_0xabf9('0x19')](function(_0x436b0b){logger['error'](_0xabf9('0x1a'),_0x436b0b['message'],_0x105d04);_0x286431(_0x14cdd4['error'](0x1f4,_0x436b0b[_0xabf9('0x17')]));});});};exports[_0xabf9('0x22')]=function(_0x13e091){var _0x5398d7=this;return new Promise(function(_0x40dd49,_0x53b6a5){return db[_0xabf9('0x23')][_0xabf9('0x24')](_0x13e091[_0xabf9('0x25')],{'raw':_0x13e091[_0xabf9('0x1b')]?_0x13e091[_0xabf9('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xabf9('0x10')](function(_0x3a0acd){logger[_0xabf9('0x18')](_0xabf9('0x22'),_0x13e091);logger['debug'](_0xabf9('0x22'),_0x13e091,JSON['stringify'](_0x3a0acd));_0x40dd49(_0x3a0acd);})['catch'](function(_0xcd331e){logger[_0xabf9('0x16')](_0xabf9('0x22'),_0xcd331e[_0xabf9('0x17')],_0x13e091);_0x53b6a5(_0x5398d7[_0xabf9('0x16')](0x1f4,_0xcd331e['message']));});});};exports[_0xabf9('0x26')]=function(_0x332bf0){var _0x5b051f=this;return new Promise(function(_0x24fb89,_0x34a975){return db[_0xabf9('0x23')][_0xabf9('0x27')](_0x332bf0[_0xabf9('0x25')],{'raw':_0x332bf0[_0xabf9('0x1b')]?_0x332bf0[_0xabf9('0x1b')][_0xabf9('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x332bf0['options']?_0x332bf0[_0xabf9('0x1b')][_0xabf9('0x1c')]||null:null,'attributes':_0x332bf0[_0xabf9('0x1b')]?_0x332bf0[_0xabf9('0x1b')][_0xabf9('0x1d')]||null:null,'limit':_0x332bf0[_0xabf9('0x1b')]?_0x332bf0[_0xabf9('0x1b')]['limit']||null:null})[_0xabf9('0x10')](function(_0x5f20d2){logger[_0xabf9('0x18')](_0xabf9('0x26'),_0x332bf0);logger[_0xabf9('0x13')](_0xabf9('0x26'),_0x332bf0,JSON['stringify'](_0x5f20d2));_0x24fb89(_0x5f20d2);})[_0xabf9('0x19')](function(_0x163e22){logger[_0xabf9('0x16')](_0xabf9('0x26'),_0x163e22[_0xabf9('0x17')],_0x332bf0);_0x34a975(_0x5b051f[_0xabf9('0x16')](0x1f4,_0x163e22[_0xabf9('0x17')]));});});};
\ No newline at end of file
+var _0x69e1=['message','request\x20sent','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','attributes','limit','include','map','model','CreateVoiceQueueReport','body','update','where','UpdateVoiceQueueReport','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x227fe7,_0x392329){var _0x4b98be=function(_0xd90e58){while(--_0xd90e58){_0x227fe7['push'](_0x227fe7['shift']());}};_0x4b98be(++_0x392329);}(_0x69e1,0x182));var _0x169e=function(_0x2dfe5d,_0x2eb5b5){_0x2dfe5d=_0x2dfe5d-0x0;var _0x5292f2=_0x69e1[_0x2dfe5d];return _0x5292f2;};'use strict';var _=require(_0x169e('0x0'));var util=require(_0x169e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x169e('0x2'));var fs=require('fs');var Redis=require(_0x169e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x169e('0x4'));var logger=require(_0x169e('0x5'))(_0x169e('0x6'));var config=require(_0x169e('0x7'));var jayson=require(_0x169e('0x8'));var client=jayson[_0x169e('0x9')][_0x169e('0xa')]({'port':0x232a});config['redis']=_[_0x169e('0xb')](config[_0x169e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x169e('0xd'))(new Redis(config['redis']));require(_0x169e('0xe'))[_0x169e('0xf')](socket);function respondWithRpcPromise(_0x122e5f,_0x3d2225,_0x173c42){return new BPromise(function(_0xc25a1b,_0x11ba74){return client['request'](_0x122e5f,_0x173c42)[_0x169e('0x10')](function(_0xb7817c){logger[_0x169e('0x11')](_0x169e('0x12'),_0x3d2225,'request\x20sent');logger[_0x169e('0x13')](_0x169e('0x14'),_0x3d2225,'request\x20sent',JSON[_0x169e('0x15')](_0xb7817c));if(_0xb7817c[_0x169e('0x16')]){if(_0xb7817c[_0x169e('0x16')][_0x169e('0x17')]===0x1f4){logger[_0x169e('0x16')](_0x169e('0x12'),_0x3d2225,_0xb7817c[_0x169e('0x16')]['message']);return _0x11ba74(_0xb7817c[_0x169e('0x16')][_0x169e('0x18')]);}logger[_0x169e('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x3d2225,_0xb7817c[_0x169e('0x16')][_0x169e('0x18')]);return _0xc25a1b(_0xb7817c[_0x169e('0x16')][_0x169e('0x18')]);}else{logger[_0x169e('0x11')](_0x169e('0x12'),_0x3d2225,_0x169e('0x19'));_0xc25a1b(_0xb7817c['result'][_0x169e('0x18')]);}})[_0x169e('0x1a')](function(_0x17cb76){logger[_0x169e('0x16')](_0x169e('0x12'),_0x3d2225,_0x17cb76);_0x11ba74(_0x17cb76);});});}exports[_0x169e('0x1b')]=function(_0x5f5371){var _0x56c784=this;return new Promise(function(_0x54a6c2,_0x469c93){return db[_0x169e('0x1c')]['findAll']({'raw':_0x5f5371[_0x169e('0x1d')]?_0x5f5371['options'][_0x169e('0x1e')]===undefined?!![]:![]:!![],'where':_0x5f5371[_0x169e('0x1d')]?_0x5f5371[_0x169e('0x1d')]['where']||null:null,'attributes':_0x5f5371['options']?_0x5f5371['options'][_0x169e('0x1f')]||null:null,'limit':_0x5f5371['options']?_0x5f5371['options'][_0x169e('0x20')]||null:null,'include':_0x5f5371['options']?_0x5f5371[_0x169e('0x1d')][_0x169e('0x21')]?_[_0x169e('0x22')](_0x5f5371[_0x169e('0x1d')][_0x169e('0x21')],function(_0x4e64a6){return{'model':db[_0x4e64a6[_0x169e('0x23')]],'as':_0x4e64a6['as'],'attributes':_0x4e64a6[_0x169e('0x1f')],'include':_0x4e64a6[_0x169e('0x21')]?_['map'](_0x4e64a6[_0x169e('0x21')],function(_0x2e100c){return{'model':db[_0x2e100c[_0x169e('0x23')]],'as':_0x2e100c['as'],'attributes':_0x2e100c[_0x169e('0x1f')],'include':_0x2e100c[_0x169e('0x21')]?_['map'](_0x2e100c[_0x169e('0x21')],function(_0x3aeeb2){return{'model':db[_0x3aeeb2['model']],'as':_0x3aeeb2['as'],'attributes':_0x3aeeb2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cdd6e){logger[_0x169e('0x11')](_0x169e('0x1b'),_0x5f5371);logger['debug'](_0x169e('0x1b'),_0x5f5371,JSON[_0x169e('0x15')](_0x4cdd6e));_0x54a6c2(_0x4cdd6e);})[_0x169e('0x1a')](function(_0xd2596d){logger[_0x169e('0x16')](_0x169e('0x1b'),_0xd2596d[_0x169e('0x18')],_0x5f5371);_0x469c93(_0x56c784['error'](0x1f4,_0xd2596d[_0x169e('0x18')]));});});};exports[_0x169e('0x24')]=function(_0x3b3494){var _0x55723e=this;return new Promise(function(_0x231e0c,_0x2c83a3){return db[_0x169e('0x1c')]['create'](_0x3b3494[_0x169e('0x25')],{'raw':_0x3b3494[_0x169e('0x1d')]?_0x3b3494['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x270bf1){logger[_0x169e('0x11')](_0x169e('0x24'),_0x3b3494);logger[_0x169e('0x13')]('CreateVoiceQueueReport',_0x3b3494,JSON['stringify'](_0x270bf1));_0x231e0c(_0x270bf1);})['catch'](function(_0x5a1c26){logger[_0x169e('0x16')](_0x169e('0x24'),_0x5a1c26[_0x169e('0x18')],_0x3b3494);_0x2c83a3(_0x55723e[_0x169e('0x16')](0x1f4,_0x5a1c26[_0x169e('0x18')]));});});};exports['UpdateVoiceQueueReport']=function(_0x384506){var _0x2e51d6=this;return new Promise(function(_0x28696f,_0x589fd2){return db['VoiceQueueReport'][_0x169e('0x26')](_0x384506['body'],{'raw':_0x384506[_0x169e('0x1d')]?_0x384506[_0x169e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x384506[_0x169e('0x1d')]?_0x384506['options'][_0x169e('0x27')]||null:null,'attributes':_0x384506['options']?_0x384506[_0x169e('0x1d')][_0x169e('0x1f')]||null:null,'limit':_0x384506['options']?_0x384506['options'][_0x169e('0x20')]||null:null})['then'](function(_0x373934){logger[_0x169e('0x11')]('UpdateVoiceQueueReport',_0x384506);logger[_0x169e('0x13')]('UpdateVoiceQueueReport',_0x384506,JSON[_0x169e('0x15')](_0x373934));_0x28696f(_0x373934);})[_0x169e('0x1a')](function(_0x57b697){logger['error'](_0x169e('0x28'),_0x57b697['message'],_0x384506);_0x589fd2(_0x2e51d6[_0x169e('0x16')](0x1f4,_0x57b697[_0x169e('0x18')]));});});};
\ No newline at end of file
index fc4da52..e7d3864 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6666=['register','length','./voiceQueueReport.events','removeListener'];(function(_0x381379,_0x3f3b86){var _0x3e1063=function(_0x4c282d){while(--_0x4c282d){_0x381379['push'](_0x381379['shift']());}};_0x3e1063(++_0x3f3b86);}(_0x6666,0x6e));var _0x6666=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x6666[_0x31eb67];return _0x2a8cb8;};'use strict';var VoiceQueueReportEvents=require(_0x6666('0x0'));var events=['save','remove','update'];function createListener(_0x53f9e7,_0x3c6bbb){return function(_0x419fa5){_0x3c6bbb['emit'](_0x53f9e7,_0x419fa5);};}function removeListener(_0x5ad3be,_0x3ecd6f){return function(){VoiceQueueReportEvents[_0x6666('0x1')](_0x5ad3be,_0x3ecd6f);};}exports[_0x6666('0x2')]=function(_0x1cf748){for(var _0xfb7053=0x0,_0xcac048=events[_0x6666('0x3')];_0xfb7053<_0xcac048;_0xfb7053++){var _0x2542f1=events[_0xfb7053];var _0x2c42c3=createListener('voiceQueueReport:'+_0x2542f1,_0x1cf748);VoiceQueueReportEvents['on'](_0x2542f1,_0x2c42c3);}};
\ No newline at end of file
+var _0x9485=['removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x127074,_0x3bd855){var _0x4c9463=function(_0xf337a6){while(--_0xf337a6){_0x127074['push'](_0x127074['shift']());}};_0x4c9463(++_0x3bd855);}(_0x9485,0x8b));var _0x5948=function(_0x1eafa9,_0x3c1fda){_0x1eafa9=_0x1eafa9-0x0;var _0x1450b4=_0x9485[_0x1eafa9];return _0x1450b4;};'use strict';var VoiceQueueReportEvents=require(_0x5948('0x0'));var events=[_0x5948('0x1'),_0x5948('0x2'),_0x5948('0x3')];function createListener(_0x5ca17a,_0x42393d){return function(_0xc057c8){_0x42393d[_0x5948('0x4')](_0x5ca17a,_0xc057c8);};}function removeListener(_0x47b3f3,_0xcfd4b6){return function(){VoiceQueueReportEvents[_0x5948('0x5')](_0x47b3f3,_0xcfd4b6);};}exports[_0x5948('0x6')]=function(_0x4312a8){for(var _0x19ccdd=0x0,_0x283a13=events['length'];_0x19ccdd<_0x283a13;_0x19ccdd++){var _0x2cf314=events[_0x19ccdd];var _0x4e7f15=createListener(_0x5948('0x7')+_0x2cf314,_0x4312a8);VoiceQueueReportEvents['on'](_0x2cf314,_0x4e7f15);}};
\ No newline at end of file
index 8985c09..7e69f3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ff9=['../../config/environment','./voiceQueuesLog.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x546a75,_0x3e27a5){var _0x5cbf0d=function(_0x3e374c){while(--_0x3e374c){_0x546a75['push'](_0x546a75['shift']());}};_0x5cbf0d(++_0x3e27a5);}(_0x8ff9,0x188));var _0x98ff=function(_0x36fe16,_0x226a45){_0x36fe16=_0x36fe16-0x0;var _0x5972f2=_0x8ff9[_0x36fe16];return _0x5972f2;};'use strict';var multer=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var path=require(_0x98ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x98ff('0x3'));var router=express[_0x98ff('0x4')]();var fs_extra=require(_0x98ff('0x5'));var auth=require(_0x98ff('0x6'));var interaction=require(_0x98ff('0x7'));var config=require(_0x98ff('0x8'));var controller=require(_0x98ff('0x9'));router['get']('/',auth[_0x98ff('0xa')](),controller['index']);router[_0x98ff('0xb')](_0x98ff('0xc'),auth['isAuthenticated'](),controller[_0x98ff('0xd')]);router[_0x98ff('0xe')]('/',auth[_0x98ff('0xa')](),controller[_0x98ff('0xf')]);router[_0x98ff('0x10')](_0x98ff('0xc'),auth['isAuthenticated'](),controller[_0x98ff('0x11')]);router[_0x98ff('0x12')](_0x98ff('0xc'),auth[_0x98ff('0xa')](),controller['destroy']);module[_0x98ff('0x13')]=router;
\ No newline at end of file
+var _0x9515=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','update','delete','multer','connect-timeout','fs-extra'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0x9515,0xe7));var _0x5951=function(_0x12cf5d,_0x140a8a){_0x12cf5d=_0x12cf5d-0x0;var _0x23091d=_0x9515[_0x12cf5d];return _0x23091d;};'use strict';var multer=require(_0x5951('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5951('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5951('0x2'));var auth=require(_0x5951('0x3'));var interaction=require(_0x5951('0x4'));var config=require(_0x5951('0x5'));var controller=require('./voiceQueuesLog.controller');router[_0x5951('0x6')]('/',auth[_0x5951('0x7')](),controller[_0x5951('0x8')]);router[_0x5951('0x6')](_0x5951('0x9'),auth[_0x5951('0x7')](),controller['show']);router[_0x5951('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5951('0x9'),auth[_0x5951('0x7')](),controller[_0x5951('0xb')]);router[_0x5951('0xc')]('/:id',auth[_0x5951('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index fdb1f85..414a9ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7103=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','format'];(function(_0x4946b4,_0x3b0782){var _0x2990c4=function(_0xbac6c8){while(--_0xbac6c8){_0x4946b4['push'](_0x4946b4['shift']());}};_0x2990c4(++_0x3b0782);}(_0x7103,0x1db));var _0x3710=function(_0x5caee5,_0x3454b0){_0x5caee5=_0x5caee5-0x0;var _0x41fe57=_0x7103[_0x5caee5];return _0x41fe57;};'use strict';var Sequelize=require(_0x3710('0x0'));var moment=require(_0x3710('0x1'));module[_0x3710('0x2')]={'time':{'type':Sequelize[_0x3710('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3710('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3710('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3710('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x3710('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3710('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x3710('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x3710('0x4')](_0x3710('0x5'))}};
\ No newline at end of file
+var _0x5261=['DATE','format','sequelize','moment','exports','STRING'];(function(_0x2158d5,_0x4cf9f7){var _0x579a4c=function(_0x136891){while(--_0x136891){_0x2158d5['push'](_0x2158d5['shift']());}};_0x579a4c(++_0x4cf9f7);}(_0x5261,0x164));var _0x1526=function(_0x48036a,_0x73b68a){_0x48036a=_0x48036a-0x0;var _0x4cd9c4=_0x5261[_0x48036a];return _0x4cd9c4;};'use strict';var Sequelize=require(_0x1526('0x0'));var moment=require(_0x1526('0x1'));module[_0x1526('0x2')]={'time':{'type':Sequelize[_0x1526('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x1526('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x1526('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x1526('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x1526('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x1526('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x1526('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x1526('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x1526('0x4')],'allowNull':![],'defaultValue':moment()[_0x1526('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
index 34d45db..74c6d9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a3=['sort','where','filters','filter','merge','options','includeAll','include','VoiceQueuesLog','rows','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x3cbb31,_0x519922){var _0x44a9fd=function(_0x537536){while(--_0x537536){_0x3cbb31['push'](_0x3cbb31['shift']());}};_0x44a9fd(++_0x519922);}(_0xa8a3,0x9b));var _0x3a8a=function(_0x5d9d60,_0x27d60e){_0x5d9d60=_0x5d9d60-0x0;var _0x2c81a0=_0xa8a3[_0x5d9d60];return _0x2c81a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a8a('0x0'));var zipdir=require(_0x3a8a('0x1'));var jsonpatch=require(_0x3a8a('0x2'));var rp=require('request-promise');var moment=require(_0x3a8a('0x3'));var BPromise=require(_0x3a8a('0x4'));var Mustache=require('mustache');var util=require(_0x3a8a('0x5'));var path=require(_0x3a8a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3a8a('0x7'));var fs=require('fs');var fs_extra=require(_0x3a8a('0x8'));var _=require(_0x3a8a('0x9'));var squel=require('squel');var crypto=require(_0x3a8a('0xa'));var jsforce=require(_0x3a8a('0xb'));var deskjs=require(_0x3a8a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3a8a('0xd'));var Papa=require(_0x3a8a('0xe'));var Redis=require(_0x3a8a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3a8a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a8a('0x11'))(_0x3a8a('0x12'));var utils=require(_0x3a8a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3a8a('0x14'));var db=require(_0x3a8a('0x15'))['db'];function respondWithStatusCode(_0x1b46b6,_0x55a3b5){_0x55a3b5=_0x55a3b5||0xcc;return function(_0x33efe1){if(_0x33efe1){return _0x1b46b6['sendStatus'](_0x55a3b5);}return _0x1b46b6[_0x3a8a('0x16')](_0x55a3b5)[_0x3a8a('0x17')]();};}function respondWithResult(_0x3ca9ff,_0x5d0cde){_0x5d0cde=_0x5d0cde||0xc8;return function(_0x1a71c6){if(_0x1a71c6){return _0x3ca9ff[_0x3a8a('0x16')](_0x5d0cde)[_0x3a8a('0x18')](_0x1a71c6);}};}function respondWithFilteredResult(_0x54b287,_0x3924a2){return function(_0x3b05cf){if(_0x3b05cf){var _0x197987=typeof _0x3924a2[_0x3a8a('0x19')]==='undefined'&&typeof _0x3924a2[_0x3a8a('0x1a')]==='undefined';var _0x3e2a68=_0x3b05cf[_0x3a8a('0x1b')];var _0xa868fd=_0x197987?0x0:_0x3924a2[_0x3a8a('0x19')];var _0x4d30ca=_0x197987?_0x3b05cf[_0x3a8a('0x1b')]:_0x3924a2['offset']+_0x3924a2['limit'];var _0xe81cb1;if(_0x4d30ca>=_0x3e2a68){_0x4d30ca=_0x3e2a68;_0xe81cb1=0xc8;}else{_0xe81cb1=0xce;}_0x54b287['status'](_0xe81cb1);return _0x54b287[_0x3a8a('0x1c')](_0x3a8a('0x1d'),_0xa868fd+'-'+_0x4d30ca+'/'+_0x3e2a68)[_0x3a8a('0x18')](_0x3b05cf);}return null;};}function patchUpdates(_0x34506f){return function(_0x53f5f0){try{jsonpatch[_0x3a8a('0x1e')](_0x53f5f0,_0x34506f,!![]);}catch(_0x11d3f2){return BPromise[_0x3a8a('0x1f')](_0x11d3f2);}return _0x53f5f0[_0x3a8a('0x20')]();};}function saveUpdates(_0x33646f,_0x2b8dea){return function(_0x5b30c3){if(_0x5b30c3){return _0x5b30c3[_0x3a8a('0x21')](_0x33646f)[_0x3a8a('0x22')](function(_0x1693a0){return _0x1693a0;});}return null;};}function removeEntity(_0x7b9a57,_0x1f9e04){return function(_0x2edd94){if(_0x2edd94){return _0x2edd94[_0x3a8a('0x23')]()['then'](function(){_0x7b9a57[_0x3a8a('0x16')](0xcc)[_0x3a8a('0x17')]();});}};}function handleEntityNotFound(_0x3893e0,_0x5e17fc){return function(_0x5b3c86){if(!_0x5b3c86){_0x3893e0[_0x3a8a('0x24')](0x194);}return _0x5b3c86;};}function handleError(_0x7c0331,_0x551bbc){_0x551bbc=_0x551bbc||0x1f4;return function(_0x5cbfd6){logger[_0x3a8a('0x25')](_0x5cbfd6[_0x3a8a('0x26')]);if(_0x5cbfd6[_0x3a8a('0x27')]){delete _0x5cbfd6[_0x3a8a('0x27')];}_0x7c0331['status'](_0x551bbc)[_0x3a8a('0x28')](_0x5cbfd6);};}exports['index']=function(_0x521967,_0x473c2a){var _0x2e1035={},_0x5377bd={},_0x11fa84={'count':0x0,'rows':[]};var _0x20b3c6=_[_0x3a8a('0x29')](db['VoiceQueuesLog'][_0x3a8a('0x2a')],function(_0x25033b){return{'name':_0x25033b[_0x3a8a('0x2b')],'type':_0x25033b[_0x3a8a('0x2c')]['key']};});_0x5377bd[_0x3a8a('0x2d')]=_[_0x3a8a('0x29')](_0x20b3c6,'name');_0x5377bd[_0x3a8a('0x2e')]=_[_0x3a8a('0x2f')](_0x521967[_0x3a8a('0x2e')]);_0x5377bd['filters']=_[_0x3a8a('0x30')](_0x5377bd[_0x3a8a('0x2d')],_0x5377bd[_0x3a8a('0x2e')]);_0x2e1035[_0x3a8a('0x31')]=_[_0x3a8a('0x30')](_0x5377bd[_0x3a8a('0x2d')],qs[_0x3a8a('0x32')](_0x521967[_0x3a8a('0x2e')][_0x3a8a('0x32')]));_0x2e1035[_0x3a8a('0x31')]=_0x2e1035[_0x3a8a('0x31')][_0x3a8a('0x33')]?_0x2e1035[_0x3a8a('0x31')]:_0x5377bd[_0x3a8a('0x2d')];if(!_0x521967[_0x3a8a('0x2e')][_0x3a8a('0x34')](_0x3a8a('0x35'))){_0x2e1035['limit']=qs[_0x3a8a('0x1a')](_0x521967['query'][_0x3a8a('0x1a')]);_0x2e1035[_0x3a8a('0x19')]=qs[_0x3a8a('0x19')](_0x521967[_0x3a8a('0x2e')]['offset']);}_0x2e1035[_0x3a8a('0x36')]=qs[_0x3a8a('0x37')](_0x521967['query']['sort']);_0x2e1035[_0x3a8a('0x38')]=qs[_0x3a8a('0x39')](_['pick'](_0x521967['query'],_0x5377bd[_0x3a8a('0x39')]),_0x20b3c6);if(_0x521967[_0x3a8a('0x2e')][_0x3a8a('0x3a')]){_0x2e1035['where']=_[_0x3a8a('0x3b')](_0x2e1035[_0x3a8a('0x38')],{'$or':_[_0x3a8a('0x29')](_0x20b3c6,function(_0xbc21d9){if(_0xbc21d9[_0x3a8a('0x2c')]!=='VIRTUAL'){var _0x188bf1={};_0x188bf1[_0xbc21d9['name']]={'$like':'%'+_0x521967['query'][_0x3a8a('0x3a')]+'%'};return _0x188bf1;}})});}_0x2e1035=_['merge']({},_0x2e1035,_0x521967[_0x3a8a('0x3c')]);var _0x4be46c={'where':_0x2e1035['where']};return db['VoiceQueuesLog'][_0x3a8a('0x1b')](_0x4be46c)[_0x3a8a('0x22')](function(_0x54b17f){_0x11fa84[_0x3a8a('0x1b')]=_0x54b17f;if(_0x521967['query'][_0x3a8a('0x3d')]){_0x2e1035[_0x3a8a('0x3e')]=[{'all':!![]}];}return db[_0x3a8a('0x3f')]['findAll'](_0x2e1035);})[_0x3a8a('0x22')](function(_0xc2013f){_0x11fa84[_0x3a8a('0x40')]=_0xc2013f;return _0x11fa84;})[_0x3a8a('0x22')](respondWithFilteredResult(_0x473c2a,_0x2e1035))['catch'](handleError(_0x473c2a,null));};exports['show']=function(_0x33dbc9,_0x56e8bc){var _0x260009={'raw':!![],'where':{'id':_0x33dbc9[_0x3a8a('0x41')]['id']}},_0xb8f215={};_0xb8f215[_0x3a8a('0x2d')]=_[_0x3a8a('0x2f')](db['VoiceQueuesLog']['rawAttributes']);_0xb8f215[_0x3a8a('0x2e')]=_['keys'](_0x33dbc9[_0x3a8a('0x2e')]);_0xb8f215['filters']=_['intersection'](_0xb8f215[_0x3a8a('0x2d')],_0xb8f215[_0x3a8a('0x2e')]);_0x260009['attributes']=_['intersection'](_0xb8f215[_0x3a8a('0x2d')],qs[_0x3a8a('0x32')](_0x33dbc9[_0x3a8a('0x2e')][_0x3a8a('0x32')]));_0x260009[_0x3a8a('0x31')]=_0x260009[_0x3a8a('0x31')][_0x3a8a('0x33')]?_0x260009[_0x3a8a('0x31')]:_0xb8f215[_0x3a8a('0x2d')];if(_0x33dbc9[_0x3a8a('0x2e')][_0x3a8a('0x3d')]){_0x260009[_0x3a8a('0x3e')]=[{'all':!![]}];}_0x260009=_[_0x3a8a('0x3b')]({},_0x260009,_0x33dbc9[_0x3a8a('0x3c')]);return db[_0x3a8a('0x3f')][_0x3a8a('0x42')](_0x260009)['then'](handleEntityNotFound(_0x56e8bc,null))['then'](respondWithResult(_0x56e8bc,null))[_0x3a8a('0x43')](handleError(_0x56e8bc,null));};exports['create']=function(_0x350728,_0x5ba38){return db[_0x3a8a('0x3f')][_0x3a8a('0x44')](_0x350728[_0x3a8a('0x45')],{})[_0x3a8a('0x22')](respondWithResult(_0x5ba38,0xc9))[_0x3a8a('0x43')](handleError(_0x5ba38,null));};exports[_0x3a8a('0x21')]=function(_0x397ca5,_0x20160a){if(_0x397ca5['body']['id']){delete _0x397ca5[_0x3a8a('0x45')]['id'];}return db['VoiceQueuesLog'][_0x3a8a('0x42')]({'where':{'id':_0x397ca5[_0x3a8a('0x41')]['id']}})[_0x3a8a('0x22')](handleEntityNotFound(_0x20160a,null))[_0x3a8a('0x22')](saveUpdates(_0x397ca5[_0x3a8a('0x45')],null))[_0x3a8a('0x22')](respondWithResult(_0x20160a,null))[_0x3a8a('0x43')](handleError(_0x20160a,null));};exports[_0x3a8a('0x23')]=function(_0xa3db9a,_0x2e89f2){return db[_0x3a8a('0x3f')][_0x3a8a('0x42')]({'where':{'id':_0xa3db9a[_0x3a8a('0x41')]['id']}})[_0x3a8a('0x22')](handleEntityNotFound(_0x2e89f2,null))['then'](removeEntity(_0x2e89f2,null))[_0x3a8a('0x43')](handleError(_0x2e89f2,null));};
\ No newline at end of file
+var _0x91a9=['fast-json-patch','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','Content-Range','reject','update','then','destroy','sendStatus','error','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','catch','show','params','include','create','body','find','eml-format','zip-dir'];(function(_0x5e97a4,_0x392ec0){var _0x135555=function(_0x667207){while(--_0x667207){_0x5e97a4['push'](_0x5e97a4['shift']());}};_0x135555(++_0x392ec0);}(_0x91a9,0x10e));var _0x991a=function(_0x4c6de8,_0x146ef3){_0x4c6de8=_0x4c6de8-0x0;var _0x118386=_0x91a9[_0x4c6de8];return _0x118386;};'use strict';var emlformat=require(_0x991a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x991a('0x1'));var jsonpatch=require(_0x991a('0x2'));var rp=require('request-promise');var moment=require(_0x991a('0x3'));var BPromise=require(_0x991a('0x4'));var Mustache=require(_0x991a('0x5'));var util=require('util');var path=require(_0x991a('0x6'));var sox=require(_0x991a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x991a('0x8'));var squel=require(_0x991a('0x9'));var crypto=require(_0x991a('0xa'));var jsforce=require(_0x991a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x991a('0xc'));var querystring=require('querystring');var Papa=require(_0x991a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x991a('0xe'));var as=require(_0x991a('0xf'));var hardwareService=require(_0x991a('0x10'));var logger=require(_0x991a('0x11'))(_0x991a('0x12'));var utils=require(_0x991a('0x13'));var config=require(_0x991a('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35e5e8,_0x1a0ef1){_0x1a0ef1=_0x1a0ef1||0xcc;return function(_0x556113){if(_0x556113){return _0x35e5e8['sendStatus'](_0x1a0ef1);}return _0x35e5e8[_0x991a('0x15')](_0x1a0ef1)[_0x991a('0x16')]();};}function respondWithResult(_0x473693,_0x59718e){_0x59718e=_0x59718e||0xc8;return function(_0x362dea){if(_0x362dea){return _0x473693[_0x991a('0x15')](_0x59718e)[_0x991a('0x17')](_0x362dea);}};}function respondWithFilteredResult(_0x2007ca,_0x137e86){return function(_0x3aed2b){if(_0x3aed2b){var _0x3a4e28=typeof _0x137e86[_0x991a('0x18')]===_0x991a('0x19')&&typeof _0x137e86[_0x991a('0x1a')]===_0x991a('0x19');var _0x3c1562=_0x3aed2b['count'];var _0x3bbcf=_0x3a4e28?0x0:_0x137e86[_0x991a('0x18')];var _0x21e8ee=_0x3a4e28?_0x3aed2b['count']:_0x137e86[_0x991a('0x18')]+_0x137e86[_0x991a('0x1a')];var _0x582f4e;if(_0x21e8ee>=_0x3c1562){_0x21e8ee=_0x3c1562;_0x582f4e=0xc8;}else{_0x582f4e=0xce;}_0x2007ca['status'](_0x582f4e);return _0x2007ca['set'](_0x991a('0x1b'),_0x3bbcf+'-'+_0x21e8ee+'/'+_0x3c1562)[_0x991a('0x17')](_0x3aed2b);}return null;};}function patchUpdates(_0x1882cf){return function(_0x5e1060){try{jsonpatch['apply'](_0x5e1060,_0x1882cf,!![]);}catch(_0x3e140d){return BPromise[_0x991a('0x1c')](_0x3e140d);}return _0x5e1060['save']();};}function saveUpdates(_0x1ee9fd,_0x43f808){return function(_0x79d41c){if(_0x79d41c){return _0x79d41c[_0x991a('0x1d')](_0x1ee9fd)[_0x991a('0x1e')](function(_0x3b4949){return _0x3b4949;});}return null;};}function removeEntity(_0x1fb9c0,_0x473d75){return function(_0x28dbb0){if(_0x28dbb0){return _0x28dbb0[_0x991a('0x1f')]()[_0x991a('0x1e')](function(){_0x1fb9c0[_0x991a('0x15')](0xcc)[_0x991a('0x16')]();});}};}function handleEntityNotFound(_0x172eaf,_0x2f2b97){return function(_0x2b8224){if(!_0x2b8224){_0x172eaf[_0x991a('0x20')](0x194);}return _0x2b8224;};}function handleError(_0x1bf79d,_0x1648a9){_0x1648a9=_0x1648a9||0x1f4;return function(_0x8c02af){logger[_0x991a('0x21')](_0x8c02af['stack']);if(_0x8c02af['name']){delete _0x8c02af[_0x991a('0x22')];}_0x1bf79d['status'](_0x1648a9)['send'](_0x8c02af);};}exports[_0x991a('0x23')]=function(_0x50a4d9,_0x31484f){var _0x553041={},_0x2e2cfa={},_0x4f1a2d={'count':0x0,'rows':[]};var _0x1050d7=_[_0x991a('0x24')](db[_0x991a('0x25')][_0x991a('0x26')],function(_0xe015da){return{'name':_0xe015da[_0x991a('0x27')],'type':_0xe015da[_0x991a('0x28')][_0x991a('0x29')]};});_0x2e2cfa[_0x991a('0x2a')]=_[_0x991a('0x24')](_0x1050d7,_0x991a('0x22'));_0x2e2cfa[_0x991a('0x2b')]=_[_0x991a('0x2c')](_0x50a4d9[_0x991a('0x2b')]);_0x2e2cfa[_0x991a('0x2d')]=_[_0x991a('0x2e')](_0x2e2cfa[_0x991a('0x2a')],_0x2e2cfa[_0x991a('0x2b')]);_0x553041[_0x991a('0x2f')]=_[_0x991a('0x2e')](_0x2e2cfa[_0x991a('0x2a')],qs[_0x991a('0x30')](_0x50a4d9[_0x991a('0x2b')]['fields']));_0x553041[_0x991a('0x2f')]=_0x553041[_0x991a('0x2f')][_0x991a('0x31')]?_0x553041[_0x991a('0x2f')]:_0x2e2cfa[_0x991a('0x2a')];if(!_0x50a4d9[_0x991a('0x2b')][_0x991a('0x32')](_0x991a('0x33'))){_0x553041['limit']=qs['limit'](_0x50a4d9[_0x991a('0x2b')][_0x991a('0x1a')]);_0x553041['offset']=qs[_0x991a('0x18')](_0x50a4d9[_0x991a('0x2b')]['offset']);}_0x553041[_0x991a('0x34')]=qs[_0x991a('0x35')](_0x50a4d9['query'][_0x991a('0x35')]);_0x553041[_0x991a('0x36')]=qs['filters'](_[_0x991a('0x37')](_0x50a4d9[_0x991a('0x2b')],_0x2e2cfa['filters']),_0x1050d7);if(_0x50a4d9[_0x991a('0x2b')]['filter']){_0x553041[_0x991a('0x36')]=_[_0x991a('0x38')](_0x553041[_0x991a('0x36')],{'$or':_[_0x991a('0x24')](_0x1050d7,function(_0x57771a){if(_0x57771a[_0x991a('0x28')]!==_0x991a('0x39')){var _0x40b846={};_0x40b846[_0x57771a[_0x991a('0x22')]]={'$like':'%'+_0x50a4d9[_0x991a('0x2b')][_0x991a('0x3a')]+'%'};return _0x40b846;}})});}_0x553041=_[_0x991a('0x38')]({},_0x553041,_0x50a4d9[_0x991a('0x3b')]);var _0x386391={'where':_0x553041['where']};return db[_0x991a('0x25')][_0x991a('0x3c')](_0x386391)['then'](function(_0x1a62fc){_0x4f1a2d[_0x991a('0x3c')]=_0x1a62fc;if(_0x50a4d9['query']['includeAll']){_0x553041['include']=[{'all':!![]}];}return db[_0x991a('0x25')]['findAll'](_0x553041);})['then'](function(_0xcd9572){_0x4f1a2d['rows']=_0xcd9572;return _0x4f1a2d;})[_0x991a('0x1e')](respondWithFilteredResult(_0x31484f,_0x553041))[_0x991a('0x3d')](handleError(_0x31484f,null));};exports[_0x991a('0x3e')]=function(_0x46813e,_0x572d67){var _0x463070={'raw':!![],'where':{'id':_0x46813e[_0x991a('0x3f')]['id']}},_0x5ac3d6={};_0x5ac3d6['model']=_['keys'](db[_0x991a('0x25')]['rawAttributes']);_0x5ac3d6['query']=_['keys'](_0x46813e[_0x991a('0x2b')]);_0x5ac3d6['filters']=_['intersection'](_0x5ac3d6[_0x991a('0x2a')],_0x5ac3d6[_0x991a('0x2b')]);_0x463070[_0x991a('0x2f')]=_[_0x991a('0x2e')](_0x5ac3d6[_0x991a('0x2a')],qs[_0x991a('0x30')](_0x46813e[_0x991a('0x2b')][_0x991a('0x30')]));_0x463070[_0x991a('0x2f')]=_0x463070[_0x991a('0x2f')]['length']?_0x463070['attributes']:_0x5ac3d6[_0x991a('0x2a')];if(_0x46813e['query']['includeAll']){_0x463070[_0x991a('0x40')]=[{'all':!![]}];}_0x463070=_[_0x991a('0x38')]({},_0x463070,_0x46813e[_0x991a('0x3b')]);return db[_0x991a('0x25')]['find'](_0x463070)[_0x991a('0x1e')](handleEntityNotFound(_0x572d67,null))[_0x991a('0x1e')](respondWithResult(_0x572d67,null))[_0x991a('0x3d')](handleError(_0x572d67,null));};exports[_0x991a('0x41')]=function(_0x267ab9,_0x36f73f){return db['VoiceQueuesLog'][_0x991a('0x41')](_0x267ab9['body'],{})[_0x991a('0x1e')](respondWithResult(_0x36f73f,0xc9))[_0x991a('0x3d')](handleError(_0x36f73f,null));};exports[_0x991a('0x1d')]=function(_0x525e9a,_0x194d61){if(_0x525e9a[_0x991a('0x42')]['id']){delete _0x525e9a[_0x991a('0x42')]['id'];}return db[_0x991a('0x25')][_0x991a('0x43')]({'where':{'id':_0x525e9a[_0x991a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x194d61,null))['then'](saveUpdates(_0x525e9a[_0x991a('0x42')],null))[_0x991a('0x1e')](respondWithResult(_0x194d61,null))['catch'](handleError(_0x194d61,null));};exports[_0x991a('0x1f')]=function(_0x128223,_0x39c12b){return db[_0x991a('0x25')]['find']({'where':{'id':_0x128223[_0x991a('0x3f')]['id']}})[_0x991a('0x1e')](handleEntityNotFound(_0x39c12b,null))[_0x991a('0x1e')](removeEntity(_0x39c12b,null))[_0x991a('0x3d')](handleError(_0x39c12b,null));};
\ No newline at end of file
index 09e6e0c..a76dbf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1fa=['moment','request-promise','rimraf','../../config/environment','exports','define','voice_queues_log','event','dtm','../../config/logger','api'];(function(_0x246564,_0x21bfe6){var _0x3c2467=function(_0x49e9c3){while(--_0x49e9c3){_0x246564['push'](_0x246564['shift']());}};_0x3c2467(++_0x21bfe6);}(_0xc1fa,0xe5));var _0xac1f=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0xc1fa[_0x544099];return _0x20ab09;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xac1f('0x0'))(_0xac1f('0x1'));var moment=require(_0xac1f('0x2'));var BPromise=require('bluebird');var rp=require(_0xac1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac1f('0x4'));var config=require(_0xac1f('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0xac1f('0x6')]=function(_0x5dc627,_0x16693b){return _0x5dc627[_0xac1f('0x7')]('VoiceQueuesLog',attributes,{'tableName':_0xac1f('0x8'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xac1f('0x9'),_0xac1f('0xa')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x790c=['../../config/environment','define','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x790c,0x102));var _0xc790=function(_0x40cd38,_0x3efe1e){_0x40cd38=_0x40cd38-0x0;var _0x4b344a=_0x790c[_0x40cd38];return _0x4b344a;};'use strict';var _=require(_0xc790('0x0'));var util=require(_0xc790('0x1'));var logger=require(_0xc790('0x2'))(_0xc790('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc790('0x4'));var fs=require('fs');var path=require(_0xc790('0x5'));var rimraf=require('rimraf');var config=require(_0xc790('0x6'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x13b5a0,_0x5ec292){return _0x13b5a0[_0xc790('0x7')]('VoiceQueuesLog',attributes,{'tableName':_0xc790('0x8'),'paranoid':![],'indexes':[{'name':_0xc790('0x9'),'fields':[_0xc790('0xa'),_0xc790('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index 9aeca36..0a5914a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc12e=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x2d603d,_0x4c2e79){var _0x52c378=function(_0x43085d){while(--_0x43085d){_0x2d603d['push'](_0x2d603d['shift']());}};_0x52c378(++_0x4c2e79);}(_0xc12e,0x13f));var _0xec12=function(_0x59c18b,_0xaf1a8a){_0x59c18b=_0x59c18b-0x0;var _0x5b1447=_0xc12e[_0x59c18b];return _0x5b1447;};'use strict';var _=require(_0xec12('0x0'));var util=require(_0xec12('0x1'));var moment=require(_0xec12('0x2'));var BPromise=require(_0xec12('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec12('0x4'));var db=require(_0xec12('0x5'))['db'];var utils=require(_0xec12('0x6'));var logger=require(_0xec12('0x7'))(_0xec12('0x8'));var config=require(_0xec12('0x9'));var jayson=require(_0xec12('0xa'));var client=jayson[_0xec12('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x480b4c,_0x4a493c,_0x29a73e){return new BPromise(function(_0x4b88aa,_0x51c914){return client[_0xec12('0xc')](_0x480b4c,_0x29a73e)[_0xec12('0xd')](function(_0x1275f7){logger[_0xec12('0xe')](_0xec12('0xf'),_0x4a493c,_0xec12('0x10'));logger[_0xec12('0x11')](_0xec12('0x12'),_0x4a493c,_0xec12('0x10'),JSON[_0xec12('0x13')](_0x1275f7));if(_0x1275f7[_0xec12('0x14')]){if(_0x1275f7['error'][_0xec12('0x15')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x4a493c,_0x1275f7[_0xec12('0x14')]['message']);return _0x51c914(_0x1275f7[_0xec12('0x14')][_0xec12('0x16')]);}logger[_0xec12('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4a493c,_0x1275f7[_0xec12('0x14')][_0xec12('0x16')]);return _0x4b88aa(_0x1275f7['error'][_0xec12('0x16')]);}else{logger[_0xec12('0xe')](_0xec12('0xf'),_0x4a493c,_0xec12('0x10'));_0x4b88aa(_0x1275f7['result'][_0xec12('0x16')]);}})[_0xec12('0x17')](function(_0x1955de){logger[_0xec12('0x14')](_0xec12('0xf'),_0x4a493c,_0x1955de);_0x51c914(_0x1955de);});});}
\ No newline at end of file
+var _0x0b3e=['debug','stringify','error','message','info','VoiceQueuesLog,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','request\x20sent'];(function(_0x4da6ba,_0x4f674f){var _0x57f9b9=function(_0x2ab2f6){while(--_0x2ab2f6){_0x4da6ba['push'](_0x4da6ba['shift']());}};_0x57f9b9(++_0x4f674f);}(_0x0b3e,0xfe));var _0xe0b3=function(_0x3b5cd9,_0x36220e){_0x3b5cd9=_0x3b5cd9-0x0;var _0x23b91b=_0x0b3e[_0x3b5cd9];return _0x23b91b;};'use strict';var _=require('lodash');var util=require(_0xe0b3('0x0'));var moment=require(_0xe0b3('0x1'));var BPromise=require(_0xe0b3('0x2'));var rs=require(_0xe0b3('0x3'));var fs=require('fs');var Redis=require(_0xe0b3('0x4'));var db=require(_0xe0b3('0x5'))['db'];var utils=require(_0xe0b3('0x6'));var logger=require('../../config/logger')(_0xe0b3('0x7'));var config=require(_0xe0b3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe0b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c465f,_0x206ba2,_0x42d537){return new BPromise(function(_0x4ceb89,_0x4b62f2){return client['request'](_0x2c465f,_0x42d537)[_0xe0b3('0xa')](function(_0x4c841b){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x206ba2,_0xe0b3('0xb'));logger[_0xe0b3('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x206ba2,'request\x20sent',JSON[_0xe0b3('0xd')](_0x4c841b));if(_0x4c841b[_0xe0b3('0xe')]){if(_0x4c841b[_0xe0b3('0xe')]['code']===0x1f4){logger[_0xe0b3('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x206ba2,_0x4c841b[_0xe0b3('0xe')]['message']);return _0x4b62f2(_0x4c841b[_0xe0b3('0xe')]['message']);}logger[_0xe0b3('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x206ba2,_0x4c841b[_0xe0b3('0xe')][_0xe0b3('0xf')]);return _0x4ceb89(_0x4c841b[_0xe0b3('0xe')][_0xe0b3('0xf')]);}else{logger[_0xe0b3('0x10')](_0xe0b3('0x11'),_0x206ba2,_0xe0b3('0xb'));_0x4ceb89(_0x4c841b[_0xe0b3('0x12')][_0xe0b3('0xf')]);}})['catch'](function(_0x4eeced){logger['error'](_0xe0b3('0x11'),_0x206ba2,_0x4eeced);_0x4b62f2(_0x4eeced);});});}
\ No newline at end of file
index 4d64cb2..9053815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3e=['../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x1ecba3,_0xb7437a){var _0x96af8f=function(_0x44f617){while(--_0x44f617){_0x1ecba3['push'](_0x1ecba3['shift']());}};_0x96af8f(++_0xb7437a);}(_0xeb3e,0x19b));var _0xeeb3=function(_0x562a4f,_0x1e720f){_0x562a4f=_0x562a4f-0x0;var _0x3da801=_0xeb3e[_0x562a4f];return _0x3da801;};'use strict';var multer=require(_0xeeb3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeeb3('0x1'));var express=require('express');var router=express[_0xeeb3('0x2')]();var fs_extra=require(_0xeeb3('0x3'));var auth=require(_0xeeb3('0x4'));var interaction=require(_0xeeb3('0x5'));var config=require(_0xeeb3('0x6'));var controller=require(_0xeeb3('0x7'));router[_0xeeb3('0x8')]('/',auth['isAuthenticated'](),controller[_0xeeb3('0x9')]);router[_0xeeb3('0x8')](_0xeeb3('0xa'),auth[_0xeeb3('0xb')](),controller[_0xeeb3('0xc')]);router[_0xeeb3('0x8')](_0xeeb3('0xd'),auth[_0xeeb3('0xb')](),controller['show']);router[_0xeeb3('0x8')](_0xeeb3('0xe'),auth[_0xeeb3('0xb')](),controller[_0xeeb3('0xf')]);router[_0xeeb3('0x8')](_0xeeb3('0x10'),controller[_0xeeb3('0x11')]);router[_0xeeb3('0x8')](_0xeeb3('0x12'),auth[_0xeeb3('0xb')](),controller[_0xeeb3('0x13')]);router[_0xeeb3('0x14')]('/',auth[_0xeeb3('0xb')](),controller['create']);router[_0xeeb3('0x14')]('/:id/transcribe',auth[_0xeeb3('0xb')](),controller[_0xeeb3('0x15')]);router[_0xeeb3('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xeeb3('0x17')]);router[_0xeeb3('0x18')](_0xeeb3('0xd'),auth[_0xeeb3('0xb')](),controller[_0xeeb3('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xddc8=['/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','describe','show'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0xddc8,0x1bc));var _0x8ddc=function(_0x418082,_0x22f950){_0x418082=_0x418082-0x0;var _0x3a57b5=_0xddc8[_0x418082];return _0x3a57b5;};'use strict';var multer=require(_0x8ddc('0x0'));var util=require(_0x8ddc('0x1'));var path=require(_0x8ddc('0x2'));var timeout=require(_0x8ddc('0x3'));var express=require('express');var router=express[_0x8ddc('0x4')]();var fs_extra=require(_0x8ddc('0x5'));var auth=require(_0x8ddc('0x6'));var interaction=require(_0x8ddc('0x7'));var config=require(_0x8ddc('0x8'));var controller=require(_0x8ddc('0x9'));router['get']('/',auth[_0x8ddc('0xa')](),controller[_0x8ddc('0xb')]);router[_0x8ddc('0xc')]('/describe',auth['isAuthenticated'](),controller[_0x8ddc('0xd')]);router[_0x8ddc('0xc')]('/:id',auth[_0x8ddc('0xa')](),controller[_0x8ddc('0xe')]);router[_0x8ddc('0xc')](_0x8ddc('0xf'),auth[_0x8ddc('0xa')](),controller[_0x8ddc('0x10')]);router['get'](_0x8ddc('0x11'),controller[_0x8ddc('0x12')]);router[_0x8ddc('0xc')](_0x8ddc('0x13'),auth[_0x8ddc('0xa')](),controller[_0x8ddc('0x14')]);router[_0x8ddc('0x15')]('/',auth[_0x8ddc('0xa')](),controller[_0x8ddc('0x16')]);router[_0x8ddc('0x15')](_0x8ddc('0x13'),auth['isAuthenticated'](),controller[_0x8ddc('0x17')]);router['put']('/:id',auth[_0x8ddc('0xa')](),controller[_0x8ddc('0x18')]);router[_0x8ddc('0x19')]('/:id',auth[_0x8ddc('0xa')](),controller['destroy']);module[_0x8ddc('0x1a')]=router;
\ No newline at end of file
index 5b7bc4d..86b479f 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(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 ef131a4..d5cb35e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xace8=['destroy','error','name','send','map','VoiceRecording','fieldName','type','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','rows','catch','show','params','rawAttributes','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','push','recording','ValidationError','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','Location','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','transcribeAccountId','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','eml-format','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0x506672,_0x1dd78a){var _0x17243e=function(_0x1b2962){while(--_0x1b2962){_0x506672['push'](_0x506672['shift']());}};_0x17243e(++_0x1dd78a);}(_0xace8,0xfe));var _0x8ace=function(_0x3c3b81,_0x3bd581){_0x3c3b81=_0x3c3b81-0x0;var _0x5a1daa=_0xace8[_0x3c3b81];return _0x5a1daa;};'use strict';var emlformat=require(_0x8ace('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ace('0x1'));var jsonpatch=require(_0x8ace('0x2'));var rp=require(_0x8ace('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8ace('0x4'));var util=require('util');var path=require('path');var sox=require(_0x8ace('0x5'));var csv=require(_0x8ace('0x6'));var ejs=require(_0x8ace('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ace('0x8'));var squel=require(_0x8ace('0x9'));var crypto=require(_0x8ace('0xa'));var jsforce=require(_0x8ace('0xb'));var deskjs=require(_0x8ace('0xc'));var toCsv=require(_0x8ace('0x6'));var querystring=require(_0x8ace('0xd'));var Papa=require(_0x8ace('0xe'));var AWS=require(_0x8ace('0xf'));var uuidv4=require('uuid/v4');var Redis=require(_0x8ace('0x10'));var authService=require(_0x8ace('0x11'));var qs=require(_0x8ace('0x12'));var as=require(_0x8ace('0x13'));var hardwareService=require(_0x8ace('0x14'));var logger=require(_0x8ace('0x15'))(_0x8ace('0x16'));var utils=require(_0x8ace('0x17'));var config=require(_0x8ace('0x18'));var licenseUtil=require(_0x8ace('0x19'));var db=require(_0x8ace('0x1a'))['db'];function respondWithStatusCode(_0x16fee8,_0x436f1d){_0x436f1d=_0x436f1d||0xcc;return function(_0x4610de){if(_0x4610de){return _0x16fee8[_0x8ace('0x1b')](_0x436f1d);}return _0x16fee8[_0x8ace('0x1c')](_0x436f1d)[_0x8ace('0x1d')]();};}function respondWithResult(_0x52b583,_0x5ef329){_0x5ef329=_0x5ef329||0xc8;return function(_0x4492fc){if(_0x4492fc){return _0x52b583[_0x8ace('0x1c')](_0x5ef329)[_0x8ace('0x1e')](_0x4492fc);}};}function respondWithFilteredResult(_0x500c88,_0x8a69b2){return function(_0x50b1fb){if(_0x50b1fb){var _0x3100ca=typeof _0x8a69b2['offset']===_0x8ace('0x1f')&&typeof _0x8a69b2[_0x8ace('0x20')]===_0x8ace('0x1f');var _0x4e9a45=_0x50b1fb[_0x8ace('0x21')];var _0x2df676=_0x3100ca?0x0:_0x8a69b2['offset'];var _0x551bef=_0x3100ca?_0x50b1fb[_0x8ace('0x21')]:_0x8a69b2[_0x8ace('0x22')]+_0x8a69b2[_0x8ace('0x20')];var _0x6de504;if(_0x551bef>=_0x4e9a45){_0x551bef=_0x4e9a45;_0x6de504=0xc8;}else{_0x6de504=0xce;}_0x500c88[_0x8ace('0x1c')](_0x6de504);return _0x500c88[_0x8ace('0x23')](_0x8ace('0x24'),_0x2df676+'-'+_0x551bef+'/'+_0x4e9a45)[_0x8ace('0x1e')](_0x50b1fb);}return null;};}function patchUpdates(_0x2d8d03){return function(_0x554819){try{jsonpatch[_0x8ace('0x25')](_0x554819,_0x2d8d03,!![]);}catch(_0x1035a3){return BPromise[_0x8ace('0x26')](_0x1035a3);}return _0x554819[_0x8ace('0x27')]();};}function saveUpdates(_0x5bcccf,_0x551641){return function(_0x121135){if(_0x121135){return _0x121135[_0x8ace('0x28')](_0x5bcccf)[_0x8ace('0x29')](function(_0x472efd){return _0x472efd;});}return null;};}function removeEntity(_0x1aa115,_0x55dc84){return function(_0x4b5418){if(_0x4b5418){return _0x4b5418[_0x8ace('0x2a')]()[_0x8ace('0x29')](function(){_0x1aa115[_0x8ace('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c1976,_0x3a9ada){return function(_0x16c682){if(!_0x16c682){_0x3c1976[_0x8ace('0x1b')](0x194);}return _0x16c682;};}function handleError(_0x5f52d3,_0x4246df){_0x4246df=_0x4246df||0x1f4;return function(_0x1eb0fb){logger[_0x8ace('0x2b')](_0x1eb0fb['stack']);if(_0x1eb0fb['name']){delete _0x1eb0fb[_0x8ace('0x2c')];}_0x5f52d3[_0x8ace('0x1c')](_0x4246df)[_0x8ace('0x2d')](_0x1eb0fb);};}exports['index']=function(_0x389d4e,_0x4b92b1){var _0x53050e={},_0x1fbb1c={},_0x3faf39={'count':0x0,'rows':[]};var _0x4120f3=_[_0x8ace('0x2e')](db[_0x8ace('0x2f')]['rawAttributes'],function(_0x4bf31a){return{'name':_0x4bf31a[_0x8ace('0x30')],'type':_0x4bf31a[_0x8ace('0x31')]['key']};});_0x1fbb1c[_0x8ace('0x32')]=_[_0x8ace('0x33')](_[_0x8ace('0x2e')](_0x4120f3,_0x8ace('0x2c')),[_0x8ace('0x34')]);_0x1fbb1c[_0x8ace('0x35')]=_[_0x8ace('0x36')](_0x389d4e[_0x8ace('0x35')]);_0x1fbb1c['filters']=_[_0x8ace('0x37')](_0x1fbb1c[_0x8ace('0x32')],_0x1fbb1c[_0x8ace('0x35')]);_0x53050e[_0x8ace('0x38')]=_[_0x8ace('0x37')](_0x1fbb1c['model'],qs[_0x8ace('0x39')](_0x389d4e[_0x8ace('0x35')][_0x8ace('0x39')]));_0x53050e['attributes']=_0x53050e[_0x8ace('0x38')][_0x8ace('0x3a')]?_0x53050e[_0x8ace('0x38')]:_0x1fbb1c[_0x8ace('0x32')];if(!_0x389d4e[_0x8ace('0x35')][_0x8ace('0x3b')](_0x8ace('0x3c'))){_0x53050e[_0x8ace('0x20')]=qs[_0x8ace('0x20')](_0x389d4e[_0x8ace('0x35')]['limit']);_0x53050e[_0x8ace('0x22')]=qs[_0x8ace('0x22')](_0x389d4e[_0x8ace('0x35')][_0x8ace('0x22')]);}_0x53050e[_0x8ace('0x3d')]=qs['sort'](_0x389d4e['query'][_0x8ace('0x3e')]);_0x53050e[_0x8ace('0x3f')]=qs[_0x8ace('0x40')](_[_0x8ace('0x41')](_0x389d4e[_0x8ace('0x35')],_0x1fbb1c[_0x8ace('0x40')]),_0x4120f3);if(_0x389d4e['query'][_0x8ace('0x42')]){_0x53050e[_0x8ace('0x3f')]=_[_0x8ace('0x43')](_0x53050e[_0x8ace('0x3f')],{'$or':_[_0x8ace('0x2e')](_0x4120f3,function(_0xd32c7f){if(_0xd32c7f[_0x8ace('0x31')]!=='VIRTUAL'){var _0x2edfaa={};_0x2edfaa[_0xd32c7f[_0x8ace('0x2c')]]={'$like':'%'+_0x389d4e[_0x8ace('0x35')]['filter']+'%'};return _0x2edfaa;}})});}_0x53050e=_[_0x8ace('0x43')]({},_0x53050e,_0x389d4e[_0x8ace('0x44')]);var _0x2174aa={'where':_0x53050e[_0x8ace('0x3f')]};return db['VoiceRecording'][_0x8ace('0x21')](_0x2174aa)['then'](function(_0x243a74){_0x3faf39[_0x8ace('0x21')]=_0x243a74;if(_0x389d4e[_0x8ace('0x35')]['includeAll']){_0x53050e[_0x8ace('0x45')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x53050e);})['then'](function(_0xba8ba1){_0x3faf39[_0x8ace('0x46')]=_0xba8ba1;return _0x3faf39;})[_0x8ace('0x29')](respondWithFilteredResult(_0x4b92b1,_0x53050e))[_0x8ace('0x47')](handleError(_0x4b92b1,null));};exports[_0x8ace('0x48')]=function(_0x406568,_0x23f259){var _0x52bc20={'raw':![],'where':{'id':_0x406568[_0x8ace('0x49')]['id']}},_0x290b07={};_0x290b07['model']=_[_0x8ace('0x36')](db[_0x8ace('0x2f')][_0x8ace('0x4a')]);_0x290b07['query']=_['keys'](_0x406568[_0x8ace('0x35')]);_0x290b07['filters']=_[_0x8ace('0x37')](_0x290b07[_0x8ace('0x32')],_0x290b07[_0x8ace('0x35')]);_0x52bc20[_0x8ace('0x38')]=_[_0x8ace('0x37')](_0x290b07[_0x8ace('0x32')],qs[_0x8ace('0x39')](_0x406568['query']['fields']));_0x52bc20[_0x8ace('0x38')]=_0x52bc20[_0x8ace('0x38')]['length']?_0x52bc20[_0x8ace('0x38')]:_0x290b07[_0x8ace('0x32')];if(_0x406568[_0x8ace('0x35')]['includeAll']){_0x52bc20['include']=[{'all':!![]}];}_0x52bc20=_[_0x8ace('0x43')]({},_0x52bc20,_0x406568[_0x8ace('0x44')]);return db[_0x8ace('0x2f')][_0x8ace('0x4b')](_0x52bc20)[_0x8ace('0x29')](handleEntityNotFound(_0x23f259,null))[_0x8ace('0x29')](respondWithResult(_0x23f259,null))['catch'](handleError(_0x23f259,null));};exports['create']=function(_0x4467ca,_0x515923){return db[_0x8ace('0x2f')][_0x8ace('0x4c')](_0x4467ca[_0x8ace('0x4d')],{})[_0x8ace('0x29')](respondWithResult(_0x515923,0xc9))[_0x8ace('0x47')](handleError(_0x515923,null));};exports[_0x8ace('0x28')]=function(_0x3ec456,_0x17abe7){if(_0x3ec456[_0x8ace('0x4d')]['id']){delete _0x3ec456[_0x8ace('0x4d')]['id'];}return db['VoiceRecording'][_0x8ace('0x4b')]({'where':{'id':_0x3ec456[_0x8ace('0x49')]['id']}})['then'](handleEntityNotFound(_0x17abe7,null))[_0x8ace('0x29')](saveUpdates(_0x3ec456['body'],null))['then'](respondWithResult(_0x17abe7,null))[_0x8ace('0x47')](handleError(_0x17abe7,null));};exports[_0x8ace('0x4e')]=function(_0x2b0910,_0x5ccd83){return db['VoiceRecording'][_0x8ace('0x4e')]()['then'](respondWithResult(_0x5ccd83,null))[_0x8ace('0x47')](handleError(_0x5ccd83,null));};exports['download']=function(_0xf0215a,_0x40e154,_0x192019){var _0x3f9334=require(_0x8ace('0x4f'));var _0x4abbda=![];var _0x3b12c7={};if(_0xf0215a[_0x8ace('0x35')][_0x8ace('0x31')]&&_0xf0215a['query'][_0x8ace('0x31')]==='uniqueid'){_0x3b12c7[_0x8ace('0x50')]=_0xf0215a[_0x8ace('0x49')]['id'];}else{_0x3b12c7['id']=_0xf0215a[_0x8ace('0x49')]['id'];}return db['VoiceRecording'][_0x8ace('0x4b')]({'where':_0x3b12c7,'attributes':['id','value'],'raw':!![]})[_0x8ace('0x29')](handleEntityNotFound(_0x40e154,null))[_0x8ace('0x29')](function(_0x6c0f4c){if(_0x6c0f4c){var _0x55881d=_0x6c0f4c[_0x8ace('0x51')];var _0x525152=util[_0x8ace('0x34')](_0x8ace('0x52'),_0x55881d);if(fs[_0x8ace('0x53')](_0x525152)){_0x4abbda=!![];return _0x3f9334[_0x8ace('0x54')](_0x525152,_0x55881d,config[_0x8ace('0x55')]['recording'])[_0x8ace('0x29')](function(){return _0x6c0f4c;});}return _0x6c0f4c;}})['then'](function(_0x242a54){if(_0x242a54){var _0x945155=_0x242a54[_0x8ace('0x51')];if(!fs[_0x8ace('0x53')](_0x945155)){throw new db[(_0x8ace('0x56'))]['ValidationError'](_0x8ace('0x57'));}if(_0x242a54[_0x8ace('0x58')]){return _0x40e154[_0x8ace('0x59')](_0x945155,_0x242a54[_0x8ace('0x58')]+path[_0x8ace('0x5a')](_0x945155),function(){if(_0x4abbda){fs[_0x8ace('0x5b')](_0x945155);}});}else{return _0x40e154['download'](_0x945155,function(_0x48f780){if(_0x4abbda){fs[_0x8ace('0x5b')](_0x945155);}});}}})[_0x8ace('0x47')](function(_0x47195d){if(_0x47195d[_0x8ace('0x5c')]===_0x8ace('0x57')){_0x40e154[_0x8ace('0x1c')](0x194)[_0x8ace('0x2d')](_0x8ace('0x5d'));}else{return handleError(_0x40e154,null);}});};exports[_0x8ace('0x5e')]=function(_0x5c9f92,_0x45218e,_0x3a76cb){var _0x261af2=require('../../components/encryptor');var _0x3e58b7=![];var _0x862105={'$and':[db[_0x8ace('0x5f')]['where'](db[_0x8ace('0x5f')]['fn'](_0x8ace('0x60'),db[_0x8ace('0x5f')][_0x8ace('0x61')]('uniqueid')),_0x5c9f92[_0x8ace('0x35')]['token'])]};if(_0x5c9f92[_0x8ace('0x35')]['type']&&_0x5c9f92[_0x8ace('0x35')]['type']==='uniqueid'){_0x862105['$and']['push']({'uniqueid':_0x5c9f92[_0x8ace('0x49')]['id']});}else{_0x862105['$and'][_0x8ace('0x62')]({'id':_0x5c9f92['params']['id']});}return db[_0x8ace('0x2f')][_0x8ace('0x4b')]({'where':_0x862105,'attributes':['id',_0x8ace('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x45218e,null))[_0x8ace('0x29')](function(_0x44a5f7){if(_0x44a5f7){var _0x1b033c=util[_0x8ace('0x34')]('%s.cypher',_0x44a5f7[_0x8ace('0x51')]);if(fs['existsSync'](_0x1b033c)){_0x3e58b7=!![];return _0x261af2['decryptFile'](_0x1b033c,_0x44a5f7[_0x8ace('0x51')],config[_0x8ace('0x55')][_0x8ace('0x63')])[_0x8ace('0x29')](function(){return _0x44a5f7;});}return _0x44a5f7;}})[_0x8ace('0x29')](function(_0x5c5c9a){if(_0x5c5c9a){if(!fs[_0x8ace('0x53')](_0x5c5c9a[_0x8ace('0x51')])){throw new db['Sequelize'][(_0x8ace('0x64'))](_0x8ace('0x57'));}if(_0x5c5c9a[_0x8ace('0x58')]){return _0x45218e[_0x8ace('0x59')](_0x5c5c9a['value'],_0x5c5c9a['filename']+path['extname'](_0x5c5c9a[_0x8ace('0x51')]),function(){if(_0x3e58b7){fs['unlink'](_0x5c5c9a[_0x8ace('0x51')]);}});}else{return _0x45218e['download'](_0x5c5c9a[_0x8ace('0x51')],function(_0x595e19){if(_0x3e58b7){fs[_0x8ace('0x5b')](_0x5c5c9a[_0x8ace('0x51')]);}});}}})['catch'](handleError(_0x45218e,null));};exports[_0x8ace('0x2a')]=function(_0x61dd4e,_0x302174){return db[_0x8ace('0x2f')]['find']({'where':{'id':_0x61dd4e[_0x8ace('0x49')]['id']}})[_0x8ace('0x29')](function(_0x4e180b){if(_[_0x8ace('0x65')](_0x4e180b)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4e180b;})['then'](function(_0x2fb219){var _0x330f22=_0x2fb219[_0x8ace('0x51')];logger[_0x8ace('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x330f22);if(!_[_0x8ace('0x65')](_0x2fb219[_0x8ace('0x51')])&&fs[_0x8ace('0x53')](_0x330f22)){logger[_0x8ace('0x66')](_0x8ace('0x67')+_0x330f22+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8ace('0x68')](_0x330f22);}_0x330f22=_0x330f22+_0x8ace('0x69');if(!_[_0x8ace('0x65')](_0x2fb219[_0x8ace('0x51')])&&fs[_0x8ace('0x53')](_0x330f22)){logger[_0x8ace('0x66')](_0x8ace('0x67')+_0x330f22+_0x8ace('0x6a'));fs[_0x8ace('0x68')](_0x330f22);}return _0x2fb219;})[_0x8ace('0x29')](function(_0xffdbd3){if(!_0xffdbd3)throw new InternalError();return _0xffdbd3[_0x8ace('0x2a')]();})['then'](function(){_0x302174['status'](0xcc)[_0x8ace('0x1d')]();})['catch'](handleError(_0x302174,null));};function getBucketslist(_0x5afe57,_0x222a86,_0x4c6325){return new Promise(function(_0x30f67a,_0x1c1241){var _0x5360eb=new AWS['S3']({'accessKeyId':_0x222a86,'secretAccessKey':_0x5afe57,'region':_0x4c6325});_0x5360eb[_0x8ace('0x6b')]({},function(_0x1f6d5b,_0xba5b0e){if(_0x1f6d5b){return _0x1c1241(_0x1f6d5b);}else{return _0x30f67a(_0xba5b0e);}});});}function createBucket(_0x2a9de0,_0x5c9b98,_0x477eaf,_0xd28b82){return new Promise(function(_0x9c30a,_0x12384e){var _0x1b9128=new AWS['S3']({'accessKeyId':_0x5c9b98,'secretAccessKey':_0x2a9de0,'region':_0x477eaf});_0x1b9128[_0x8ace('0x6c')]({'Bucket':_0xd28b82},function(_0x5210ce,_0x5231f5){if(_0x5210ce){return _0x12384e(_0x5210ce);}else{return _0x9c30a(_0x5231f5);}});});}function uploadFile(_0x219a5d,_0x3df12e,_0x1de783,_0x18f3f8,_0x4472e7,_0x147a90){return new Promise(function(_0x47c534,_0x8448d0){var _0x533598=new AWS['S3']({'accessKeyId':_0x3df12e,'secretAccessKey':_0x219a5d,'region':_0x1de783});_0x533598[_0x8ace('0x6d')]({'Bucket':_0x18f3f8,'Key':_0x4472e7,'Body':_0x147a90},function(_0x141e12,_0xc43b74){if(_0x141e12){return _0x8448d0(_0x141e12);}else{return _0x47c534(_0xc43b74);}});});}function startTranscribe(_0x396764,_0x5d9e7d,_0x369f71,_0x11a61c,_0x30bba0,_0x38ddf8){return new Promise(function(_0x3832f0,_0x41ccb9){var _0x5867e6=new AWS[(_0x8ace('0x6e'))]({'accessKeyId':_0x5d9e7d,'secretAccessKey':_0x396764,'region':_0x369f71});_0x5867e6[_0x8ace('0x6f')]({'TranscriptionJobName':_0x11a61c,'LanguageCode':_0x30bba0,'Media':{'MediaFileUri':_0x38ddf8}},function(_0x5b12d0,_0x1a55ae){if(_0x5b12d0){return _0x41ccb9(_0x5b12d0);}else{return _0x3832f0(_0x1a55ae);}});});}function transcribe(_0x63cb8d,_0x16f27f,_0x2b0223,_0x4b6c98,_0x529907,_0xf09986,_0x4d37d3){return new Promise(function(_0x1cdefe,_0x3fc13f){var _0x4127af={};logger[_0x8ace('0x66')](util[_0x8ace('0x34')](_0x8ace('0x70'),_0x63cb8d,_0x529907));return uploadFile(_0x16f27f,_0x2b0223,_0x4b6c98,_0x529907,path['basename'](_0xf09986),fs['readFileSync'](_0xf09986))[_0x8ace('0x29')](function(_0x6b7403){logger[_0x8ace('0x66')](util[_0x8ace('0x34')](_0x8ace('0x71'),_0x63cb8d,_0x529907,_0x6b7403['Location']));_0x4127af[_0x8ace('0x72')]=_0x6b7403['Bucket'];_0x4127af[_0x8ace('0x73')]=_0x6b7403['Location'];logger[_0x8ace('0x66')](util[_0x8ace('0x34')](_0x8ace('0x74'),_0x63cb8d));return startTranscribe(_0x16f27f,_0x2b0223,_0x4b6c98,uuidv4(),_0x4d37d3,_0x6b7403[_0x8ace('0x75')]);})[_0x8ace('0x29')](function(_0x1e1ae9){logger['info'](util[_0x8ace('0x34')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x63cb8d,_0x1e1ae9[_0x8ace('0x76')][_0x8ace('0x77')]));_0x4127af[_0x8ace('0x78')]=_0x1e1ae9['TranscriptionJob'][_0x8ace('0x77')];_0x4127af[_0x8ace('0x79')]=_0x1e1ae9[_0x8ace('0x76')][_0x8ace('0x7a')];return _0x1cdefe(_0x4127af);})[_0x8ace('0x47')](function(_0x2ae823){return _0x3fc13f(_0x2ae823);});});}exports['runTranscribe']=function(_0x49f1b4,_0x132939,_0x50fae4){var _0x2b9459;var _0x114d58;var _0x456d7d;var _0x42121b=require(_0x8ace('0x4f'));return db['VoiceRecording'][_0x8ace('0x7b')]({'where':{'id':_0x49f1b4[_0x8ace('0x49')]['id']}})[_0x8ace('0x29')](function(_0x52ca00){if(_0x52ca00){var _0x1485e5=util[_0x8ace('0x34')](_0x8ace('0x52'),_0x52ca00[_0x8ace('0x51')]);if(fs['existsSync'](_0x1485e5)){cypher=!![];return _0x42121b['decryptFile'](_0x1485e5,_0x52ca00[_0x8ace('0x51')],config[_0x8ace('0x55')]['recording'])[_0x8ace('0x29')](function(){return _0x52ca00;});}return _0x52ca00;}})[_0x8ace('0x29')](function(_0x30720d){if(!_0x30720d){throw new db[(_0x8ace('0x56'))]['ValidationError'](_0x8ace('0x7c'));}_0x114d58=_0x30720d;return db[_0x8ace('0x7d')][_0x8ace('0x7b')]({'where':{'id':0x1}});})[_0x8ace('0x29')](handleEntityNotFound(_0x132939,null))[_0x8ace('0x29')](function(_0x484f65){if(_0x484f65){_0x2b9459=_0x484f65;if(!_0x2b9459[_0x8ace('0x7e')]||!_0x2b9459['transcribeAccountId']||!_0x2b9459[_0x8ace('0x7f')]||!_0x2b9459[_0x8ace('0x80')]||!_0x2b9459[_0x8ace('0x72')]){throw new db[(_0x8ace('0x56'))][(_0x8ace('0x64'))](_0x8ace('0x81'));}if(_0x49f1b4[_0x8ace('0x4d')][_0x8ace('0x82')]&&(!_0x2b9459[_0x8ace('0x83')]||!_0x2b9459[_0x8ace('0x84')]||!_0x2b9459['sentimentRegion']||!_0x2b9459[_0x8ace('0x80')]||!_0x2b9459['bucket'])){throw new db[(_0x8ace('0x56'))][(_0x8ace('0x64'))](_0x8ace('0x85'));}return db['CloudProvider'][_0x8ace('0x7b')]({'where':{'id':_0x2b9459[_0x8ace('0x86')]}});}})['then'](function(_0x1154a3){if(!_0x1154a3){throw new db[(_0x8ace('0x56'))][(_0x8ace('0x64'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1154a3[_0x8ace('0x87')]||!_0x1154a3[_0x8ace('0x88')]){throw new db[(_0x8ace('0x56'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x456d7d=_0x1154a3;return getBucketslist(_0x456d7d[_0x8ace('0x87')],_0x456d7d['data2'],_0x2b9459[_0x8ace('0x7f')]);})['then'](function(_0x55793d){if(_0x55793d&&_0x55793d['Buckets']){var _0xcd23d3=_[_0x8ace('0x4b')](_0x55793d[_0x8ace('0x89')],function(_0x25f193){return _0x25f193[_0x8ace('0x8a')]===_0x2b9459['bucket'];});if(!_0xcd23d3){logger[_0x8ace('0x66')](util[_0x8ace('0x34')](_0x8ace('0x8b'),_0x49f1b4[_0x8ace('0x49')]['id'],_0x2b9459[_0x8ace('0x72')]));return createBucket(_0x456d7d[_0x8ace('0x87')],_0x456d7d[_0x8ace('0x88')],_0x2b9459['transcribeRegion'],_0x2b9459[_0x8ace('0x72')]);}logger[_0x8ace('0x66')](util['format'](_0x8ace('0x8c'),_0x49f1b4[_0x8ace('0x49')]['id'],_0x2b9459[_0x8ace('0x72')]));return;}})[_0x8ace('0x29')](function(_0x12ce89){if(_0x114d58[_0x8ace('0x79')]===_0x8ace('0x8d')){return transcribe(_0x49f1b4[_0x8ace('0x49')]['id'],_0x456d7d['data1'],_0x456d7d['data2'],_0x2b9459[_0x8ace('0x7f')],_0x2b9459[_0x8ace('0x72')],_0x114d58[_0x8ace('0x51')],_0x2b9459['language']);}else{logger[_0x8ace('0x66')](util[_0x8ace('0x34')](_0x8ace('0x8e'),_0x49f1b4[_0x8ace('0x49')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x8ace('0x29')](function(_0x11a147){if(_0x11a147){_0x11a147['tempSentiment']=_0x49f1b4[_0x8ace('0x4d')][_0x8ace('0x82')];return _0x114d58[_0x8ace('0x8f')](_0x11a147);}})[_0x8ace('0x29')](respondWithResult(_0x132939,null))[_0x8ace('0x47')](handleError(_0x132939,null));};function writeFile(_0x314dd3,_0x5de257){return new Promise(function(_0x3f87e1,_0x413ba8){fs[_0x8ace('0x90')](_0x5de257,_0x314dd3,function(_0x213b57,_0x4a2851){if(_0x213b57){return _0x413ba8(_0x213b57);}else{return _0x3f87e1(_0x4a2851);}});});}exports['downloadTranscribe']=function(_0x9f57f5,_0x4776fb,_0x4f737e){return db[_0x8ace('0x2f')][_0x8ace('0x7b')]({'where':{'id':_0x9f57f5[_0x8ace('0x49')]['id']}})[_0x8ace('0x29')](handleEntityNotFound(_0x4776fb))[_0x8ace('0x29')](function(_0x94e21b){if(_0x94e21b&&_0x94e21b[_0x8ace('0x91')]){var _0x4514f0=_0x94e21b[_0x8ace('0x91')];var _0x477128=config[_0x8ace('0x92')]+_0x8ace('0x93')+_0x94e21b['id']+'.txt';if(fs[_0x8ace('0x53')](_0x477128)){return _0x477128;}return writeFile(_0x4514f0,_0x477128)[_0x8ace('0x29')](function(){return _0x477128;});}else{throw new db['Sequelize'][(_0x8ace('0x64'))]('Transcript\x20not\x20available');}})['then'](function(_0x5052dc){return _0x4776fb[_0x8ace('0x59')](_0x5052dc);})['catch'](handleError(_0x4776fb));};
\ No newline at end of file
+var _0xb1cd=['Content-Range','json','apply','destroy','then','end','send','index','rawAttributes','fieldName','key','differenceBy','map','name','format','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','VoiceRecording','includeAll','include','findAll','catch','show','params','length','find','create','body','update','describe','download','../../components/encryptor','type','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','col','token','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','runSentiment','sentiment','sentimentAccountId','language','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','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set'];(function(_0x363411,_0x4af7f8){var _0x4abeb8=function(_0x5792b1){while(--_0x5792b1){_0x363411['push'](_0x363411['shift']());}};_0x4abeb8(++_0x4af7f8);}(_0xb1cd,0x110));var _0xdb1c=function(_0x265a39,_0x21b24a){_0x265a39=_0x265a39-0x0;var _0x4b9b52=_0xb1cd[_0x265a39];return _0x4b9b52;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb1c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb1c('0x1'));var rp=require(_0xdb1c('0x2'));var moment=require(_0xdb1c('0x3'));var BPromise=require(_0xdb1c('0x4'));var Mustache=require(_0xdb1c('0x5'));var util=require(_0xdb1c('0x6'));var path=require(_0xdb1c('0x7'));var sox=require(_0xdb1c('0x8'));var csv=require(_0xdb1c('0x9'));var ejs=require(_0xdb1c('0xa'));var fs=require('fs');var fs_extra=require(_0xdb1c('0xb'));var _=require(_0xdb1c('0xc'));var squel=require(_0xdb1c('0xd'));var crypto=require('crypto');var jsforce=require(_0xdb1c('0xe'));var deskjs=require(_0xdb1c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdb1c('0x10'));var Papa=require(_0xdb1c('0x11'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0xdb1c('0x12'));var authService=require(_0xdb1c('0x13'));var qs=require(_0xdb1c('0x14'));var as=require(_0xdb1c('0x15'));var hardwareService=require(_0xdb1c('0x16'));var logger=require(_0xdb1c('0x17'))(_0xdb1c('0x18'));var utils=require(_0xdb1c('0x19'));var config=require(_0xdb1c('0x1a'));var licenseUtil=require(_0xdb1c('0x1b'));var db=require(_0xdb1c('0x1c'))['db'];function respondWithStatusCode(_0x53e98b,_0x41df1a){_0x41df1a=_0x41df1a||0xcc;return function(_0x34daa4){if(_0x34daa4){return _0x53e98b[_0xdb1c('0x1d')](_0x41df1a);}return _0x53e98b[_0xdb1c('0x1e')](_0x41df1a)['end']();};}function respondWithResult(_0x5171ad,_0x3da011){_0x3da011=_0x3da011||0xc8;return function(_0xc54493){if(_0xc54493){return _0x5171ad[_0xdb1c('0x1e')](_0x3da011)['json'](_0xc54493);}};}function respondWithFilteredResult(_0x2c2207,_0x210a84){return function(_0x174dac){if(_0x174dac){var _0x3094e3=typeof _0x210a84[_0xdb1c('0x1f')]==='undefined'&&typeof _0x210a84[_0xdb1c('0x20')]===_0xdb1c('0x21');var _0x233786=_0x174dac[_0xdb1c('0x22')];var _0x2c8384=_0x3094e3?0x0:_0x210a84[_0xdb1c('0x1f')];var _0x2cd2ee=_0x3094e3?_0x174dac['count']:_0x210a84[_0xdb1c('0x1f')]+_0x210a84[_0xdb1c('0x20')];var _0x3fc6a5;if(_0x2cd2ee>=_0x233786){_0x2cd2ee=_0x233786;_0x3fc6a5=0xc8;}else{_0x3fc6a5=0xce;}_0x2c2207[_0xdb1c('0x1e')](_0x3fc6a5);return _0x2c2207[_0xdb1c('0x23')](_0xdb1c('0x24'),_0x2c8384+'-'+_0x2cd2ee+'/'+_0x233786)[_0xdb1c('0x25')](_0x174dac);}return null;};}function patchUpdates(_0x3836ca){return function(_0x25dde4){try{jsonpatch[_0xdb1c('0x26')](_0x25dde4,_0x3836ca,!![]);}catch(_0x1bf174){return BPromise['reject'](_0x1bf174);}return _0x25dde4['save']();};}function saveUpdates(_0x2734fd,_0x1f9597){return function(_0x3844ee){if(_0x3844ee){return _0x3844ee['update'](_0x2734fd)['then'](function(_0x88da89){return _0x88da89;});}return null;};}function removeEntity(_0x2f6f81,_0x23213a){return function(_0x30eef1){if(_0x30eef1){return _0x30eef1[_0xdb1c('0x27')]()[_0xdb1c('0x28')](function(){_0x2f6f81[_0xdb1c('0x1e')](0xcc)[_0xdb1c('0x29')]();});}};}function handleEntityNotFound(_0x562bd1,_0x1d6f2b){return function(_0x1ca812){if(!_0x1ca812){_0x562bd1['sendStatus'](0x194);}return _0x1ca812;};}function handleError(_0x487a6,_0x807eb3){_0x807eb3=_0x807eb3||0x1f4;return function(_0x17619b){logger['error'](_0x17619b['stack']);if(_0x17619b['name']){delete _0x17619b['name'];}_0x487a6[_0xdb1c('0x1e')](_0x807eb3)[_0xdb1c('0x2a')](_0x17619b);};}exports[_0xdb1c('0x2b')]=function(_0x3421f6,_0x7f048c){var _0x4ff899={},_0xc6d425={},_0x394139={'count':0x0,'rows':[]};var _0x3b1ea9=_['map'](db['VoiceRecording'][_0xdb1c('0x2c')],function(_0x3fdf0d){return{'name':_0x3fdf0d[_0xdb1c('0x2d')],'type':_0x3fdf0d['type'][_0xdb1c('0x2e')]};});_0xc6d425['model']=_[_0xdb1c('0x2f')](_[_0xdb1c('0x30')](_0x3b1ea9,_0xdb1c('0x31')),[_0xdb1c('0x32')]);_0xc6d425[_0xdb1c('0x33')]=_[_0xdb1c('0x34')](_0x3421f6[_0xdb1c('0x33')]);_0xc6d425[_0xdb1c('0x35')]=_[_0xdb1c('0x36')](_0xc6d425['model'],_0xc6d425[_0xdb1c('0x33')]);_0x4ff899[_0xdb1c('0x37')]=_[_0xdb1c('0x36')](_0xc6d425[_0xdb1c('0x38')],qs[_0xdb1c('0x39')](_0x3421f6['query'][_0xdb1c('0x39')]));_0x4ff899['attributes']=_0x4ff899[_0xdb1c('0x37')]['length']?_0x4ff899[_0xdb1c('0x37')]:_0xc6d425[_0xdb1c('0x38')];if(!_0x3421f6['query'][_0xdb1c('0x3a')](_0xdb1c('0x3b'))){_0x4ff899[_0xdb1c('0x20')]=qs[_0xdb1c('0x20')](_0x3421f6[_0xdb1c('0x33')][_0xdb1c('0x20')]);_0x4ff899[_0xdb1c('0x1f')]=qs[_0xdb1c('0x1f')](_0x3421f6[_0xdb1c('0x33')][_0xdb1c('0x1f')]);}_0x4ff899['order']=qs[_0xdb1c('0x3c')](_0x3421f6[_0xdb1c('0x33')][_0xdb1c('0x3c')]);_0x4ff899[_0xdb1c('0x3d')]=qs[_0xdb1c('0x35')](_['pick'](_0x3421f6[_0xdb1c('0x33')],_0xc6d425[_0xdb1c('0x35')]),_0x3b1ea9);if(_0x3421f6[_0xdb1c('0x33')][_0xdb1c('0x3e')]){_0x4ff899[_0xdb1c('0x3d')]=_[_0xdb1c('0x3f')](_0x4ff899[_0xdb1c('0x3d')],{'$or':_[_0xdb1c('0x30')](_0x3b1ea9,function(_0x42d704){if(_0x42d704['type']!==_0xdb1c('0x40')){var _0x1b4fe5={};_0x1b4fe5[_0x42d704[_0xdb1c('0x31')]]={'$like':'%'+_0x3421f6['query'][_0xdb1c('0x3e')]+'%'};return _0x1b4fe5;}})});}_0x4ff899=_[_0xdb1c('0x3f')]({},_0x4ff899,_0x3421f6[_0xdb1c('0x41')]);var _0x1f2653={'where':_0x4ff899[_0xdb1c('0x3d')]};return db[_0xdb1c('0x42')][_0xdb1c('0x22')](_0x1f2653)[_0xdb1c('0x28')](function(_0x4c5221){_0x394139['count']=_0x4c5221;if(_0x3421f6['query'][_0xdb1c('0x43')]){_0x4ff899[_0xdb1c('0x44')]=[{'all':!![]}];}return db[_0xdb1c('0x42')][_0xdb1c('0x45')](_0x4ff899);})['then'](function(_0x2f4b40){_0x394139['rows']=_0x2f4b40;return _0x394139;})[_0xdb1c('0x28')](respondWithFilteredResult(_0x7f048c,_0x4ff899))[_0xdb1c('0x46')](handleError(_0x7f048c,null));};exports[_0xdb1c('0x47')]=function(_0x5756d9,_0x2c7c4a){var _0x2b53c6={'raw':![],'where':{'id':_0x5756d9[_0xdb1c('0x48')]['id']}},_0x4738e0={};_0x4738e0[_0xdb1c('0x38')]=_['keys'](db[_0xdb1c('0x42')][_0xdb1c('0x2c')]);_0x4738e0[_0xdb1c('0x33')]=_[_0xdb1c('0x34')](_0x5756d9[_0xdb1c('0x33')]);_0x4738e0['filters']=_[_0xdb1c('0x36')](_0x4738e0[_0xdb1c('0x38')],_0x4738e0[_0xdb1c('0x33')]);_0x2b53c6[_0xdb1c('0x37')]=_[_0xdb1c('0x36')](_0x4738e0[_0xdb1c('0x38')],qs[_0xdb1c('0x39')](_0x5756d9[_0xdb1c('0x33')]['fields']));_0x2b53c6['attributes']=_0x2b53c6[_0xdb1c('0x37')][_0xdb1c('0x49')]?_0x2b53c6[_0xdb1c('0x37')]:_0x4738e0[_0xdb1c('0x38')];if(_0x5756d9[_0xdb1c('0x33')]['includeAll']){_0x2b53c6[_0xdb1c('0x44')]=[{'all':!![]}];}_0x2b53c6=_[_0xdb1c('0x3f')]({},_0x2b53c6,_0x5756d9[_0xdb1c('0x41')]);return db[_0xdb1c('0x42')][_0xdb1c('0x4a')](_0x2b53c6)[_0xdb1c('0x28')](handleEntityNotFound(_0x2c7c4a,null))[_0xdb1c('0x28')](respondWithResult(_0x2c7c4a,null))['catch'](handleError(_0x2c7c4a,null));};exports[_0xdb1c('0x4b')]=function(_0x3fe3cf,_0x50c4d0){return db[_0xdb1c('0x42')][_0xdb1c('0x4b')](_0x3fe3cf[_0xdb1c('0x4c')],{})[_0xdb1c('0x28')](respondWithResult(_0x50c4d0,0xc9))[_0xdb1c('0x46')](handleError(_0x50c4d0,null));};exports[_0xdb1c('0x4d')]=function(_0x4d8cce,_0x2fddb0){if(_0x4d8cce[_0xdb1c('0x4c')]['id']){delete _0x4d8cce['body']['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x4d8cce['params']['id']}})[_0xdb1c('0x28')](handleEntityNotFound(_0x2fddb0,null))['then'](saveUpdates(_0x4d8cce[_0xdb1c('0x4c')],null))[_0xdb1c('0x28')](respondWithResult(_0x2fddb0,null))[_0xdb1c('0x46')](handleError(_0x2fddb0,null));};exports[_0xdb1c('0x4e')]=function(_0x521c99,_0x57e732){return db[_0xdb1c('0x42')][_0xdb1c('0x4e')]()[_0xdb1c('0x28')](respondWithResult(_0x57e732,null))[_0xdb1c('0x46')](handleError(_0x57e732,null));};exports[_0xdb1c('0x4f')]=function(_0x31be12,_0x3ad09b,_0x5eafa4){var _0x287186=require(_0xdb1c('0x50'));var _0x2370a1=![];var _0x50e2bb={};if(_0x31be12[_0xdb1c('0x33')]['type']&&_0x31be12['query'][_0xdb1c('0x51')]===_0xdb1c('0x52')){_0x50e2bb[_0xdb1c('0x52')]=_0x31be12[_0xdb1c('0x48')]['id'];}else{_0x50e2bb['id']=_0x31be12[_0xdb1c('0x48')]['id'];}return db[_0xdb1c('0x42')][_0xdb1c('0x4a')]({'where':_0x50e2bb,'attributes':['id',_0xdb1c('0x53')],'raw':!![]})[_0xdb1c('0x28')](handleEntityNotFound(_0x3ad09b,null))[_0xdb1c('0x28')](function(_0x1b333e){if(_0x1b333e){var _0x59548d=_0x1b333e[_0xdb1c('0x53')];var _0x4cc825=util['format'](_0xdb1c('0x54'),_0x59548d);if(fs[_0xdb1c('0x55')](_0x4cc825)){_0x2370a1=!![];return _0x287186[_0xdb1c('0x56')](_0x4cc825,_0x59548d,config[_0xdb1c('0x57')][_0xdb1c('0x58')])[_0xdb1c('0x28')](function(){return _0x1b333e;});}return _0x1b333e;}})['then'](function(_0x3b416f){if(_0x3b416f){var _0x52e2e3=_0x3b416f['value'];if(!fs[_0xdb1c('0x55')](_0x52e2e3)){throw new db[(_0xdb1c('0x59'))][(_0xdb1c('0x5a'))](_0xdb1c('0x5b'));}if(_0x3b416f[_0xdb1c('0x5c')]){return _0x3ad09b[_0xdb1c('0x4f')](_0x52e2e3,_0x3b416f['filename']+path[_0xdb1c('0x5d')](_0x52e2e3),function(){if(_0x2370a1){fs[_0xdb1c('0x5e')](_0x52e2e3);}});}else{return _0x3ad09b[_0xdb1c('0x4f')](_0x52e2e3,function(_0x1b9b63){if(_0x2370a1){fs[_0xdb1c('0x5e')](_0x52e2e3);}});}}})['catch'](function(_0x39f7dc){if(_0x39f7dc[_0xdb1c('0x5f')]===_0xdb1c('0x5b')){_0x3ad09b[_0xdb1c('0x1e')](0x194)['send']('Not\x20found');}else{return handleError(_0x3ad09b,null);}});};exports[_0xdb1c('0x60')]=function(_0x55f463,_0x2b7b81,_0x4a28f9){var _0x420ba0=require(_0xdb1c('0x50'));var _0x473306=![];var _0xaf7567={'$and':[db[_0xdb1c('0x61')]['where'](db['sequelize']['fn'](_0xdb1c('0x62'),db['sequelize'][_0xdb1c('0x63')](_0xdb1c('0x52'))),_0x55f463[_0xdb1c('0x33')][_0xdb1c('0x64')])]};if(_0x55f463[_0xdb1c('0x33')]['type']&&_0x55f463[_0xdb1c('0x33')][_0xdb1c('0x51')]===_0xdb1c('0x52')){_0xaf7567[_0xdb1c('0x65')][_0xdb1c('0x66')]({'uniqueid':_0x55f463[_0xdb1c('0x48')]['id']});}else{_0xaf7567[_0xdb1c('0x65')][_0xdb1c('0x66')]({'id':_0x55f463[_0xdb1c('0x48')]['id']});}return db[_0xdb1c('0x42')]['find']({'where':_0xaf7567,'attributes':['id',_0xdb1c('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x2b7b81,null))[_0xdb1c('0x28')](function(_0x3cd33c){if(_0x3cd33c){var _0xe8e1e1=util[_0xdb1c('0x32')]('%s.cypher',_0x3cd33c[_0xdb1c('0x53')]);if(fs['existsSync'](_0xe8e1e1)){_0x473306=!![];return _0x420ba0[_0xdb1c('0x56')](_0xe8e1e1,_0x3cd33c[_0xdb1c('0x53')],config[_0xdb1c('0x57')][_0xdb1c('0x58')])['then'](function(){return _0x3cd33c;});}return _0x3cd33c;}})[_0xdb1c('0x28')](function(_0x130fc7){if(_0x130fc7){if(!fs['existsSync'](_0x130fc7[_0xdb1c('0x53')])){throw new db[(_0xdb1c('0x59'))]['ValidationError'](_0xdb1c('0x5b'));}if(_0x130fc7[_0xdb1c('0x5c')]){return _0x2b7b81[_0xdb1c('0x4f')](_0x130fc7[_0xdb1c('0x53')],_0x130fc7[_0xdb1c('0x5c')]+path[_0xdb1c('0x5d')](_0x130fc7['value']),function(){if(_0x473306){fs[_0xdb1c('0x5e')](_0x130fc7['value']);}});}else{return _0x2b7b81[_0xdb1c('0x4f')](_0x130fc7['value'],function(_0x398f6d){if(_0x473306){fs[_0xdb1c('0x5e')](_0x130fc7[_0xdb1c('0x53')]);}});}}})[_0xdb1c('0x46')](handleError(_0x2b7b81,null));};exports[_0xdb1c('0x27')]=function(_0x1a2322,_0x41992f){return db[_0xdb1c('0x42')][_0xdb1c('0x4a')]({'where':{'id':_0x1a2322[_0xdb1c('0x48')]['id']}})['then'](function(_0x5344a8){if(_[_0xdb1c('0x67')](_0x5344a8)){throw new ReferenceError(_0xdb1c('0x68'));}return _0x5344a8;})[_0xdb1c('0x28')](function(_0x57f4fa){var _0x503239=_0x57f4fa[_0xdb1c('0x53')];logger[_0xdb1c('0x69')](_0xdb1c('0x6a'),_0x503239);if(!_[_0xdb1c('0x67')](_0x57f4fa[_0xdb1c('0x53')])&&fs['existsSync'](_0x503239)){logger[_0xdb1c('0x69')](_0xdb1c('0x6b')+_0x503239+_0xdb1c('0x6c'));fs[_0xdb1c('0x6d')](_0x503239);}_0x503239=_0x503239+_0xdb1c('0x6e');if(!_['isNil'](_0x57f4fa[_0xdb1c('0x53')])&&fs[_0xdb1c('0x55')](_0x503239)){logger[_0xdb1c('0x69')](_0xdb1c('0x6b')+_0x503239+_0xdb1c('0x6c'));fs[_0xdb1c('0x6d')](_0x503239);}return _0x57f4fa;})[_0xdb1c('0x28')](function(_0x521449){if(!_0x521449)throw new InternalError();return _0x521449['destroy']();})[_0xdb1c('0x28')](function(){_0x41992f[_0xdb1c('0x1e')](0xcc)[_0xdb1c('0x29')]();})[_0xdb1c('0x46')](handleError(_0x41992f,null));};function getBucketslist(_0x4298ae,_0x219ade,_0x562049){return new Promise(function(_0xaf170f,_0x2dabe2){var _0x5b9336=new AWS['S3']({'accessKeyId':_0x219ade,'secretAccessKey':_0x4298ae,'region':_0x562049});_0x5b9336[_0xdb1c('0x6f')]({},function(_0x3146cb,_0x4df2a1){if(_0x3146cb){return _0x2dabe2(_0x3146cb);}else{return _0xaf170f(_0x4df2a1);}});});}function createBucket(_0x8d0fbd,_0x3c1df4,_0x4e24b8,_0x1b85c9){return new Promise(function(_0x35a78a,_0x28e44f){var _0xa3ac7d=new AWS['S3']({'accessKeyId':_0x3c1df4,'secretAccessKey':_0x8d0fbd,'region':_0x4e24b8});_0xa3ac7d['createBucket']({'Bucket':_0x1b85c9},function(_0x358557,_0x49519d){if(_0x358557){return _0x28e44f(_0x358557);}else{return _0x35a78a(_0x49519d);}});});}function uploadFile(_0x10de4e,_0x45bfca,_0x5a4cc4,_0x58ad93,_0x8720e8,_0x49380e){return new Promise(function(_0x58be49,_0x1223d5){var _0x4efd39=new AWS['S3']({'accessKeyId':_0x45bfca,'secretAccessKey':_0x10de4e,'region':_0x5a4cc4});_0x4efd39['upload']({'Bucket':_0x58ad93,'Key':_0x8720e8,'Body':_0x49380e},function(_0x5a40b6,_0x49f0b1){if(_0x5a40b6){return _0x1223d5(_0x5a40b6);}else{return _0x58be49(_0x49f0b1);}});});}function startTranscribe(_0x53fb62,_0x194b66,_0xce7cb,_0x7a9dde,_0x59fa60,_0xb557d){return new Promise(function(_0x18f15c,_0xdf9ed0){var _0x35deca=new AWS['TranscribeService']({'accessKeyId':_0x194b66,'secretAccessKey':_0x53fb62,'region':_0xce7cb});_0x35deca[_0xdb1c('0x70')]({'TranscriptionJobName':_0x7a9dde,'LanguageCode':_0x59fa60,'Media':{'MediaFileUri':_0xb557d}},function(_0x29fd2f,_0x1e8b5f){if(_0x29fd2f){return _0xdf9ed0(_0x29fd2f);}else{return _0x18f15c(_0x1e8b5f);}});});}function transcribe(_0x3422c9,_0x544570,_0x5138d8,_0x35a208,_0x2b6cf0,_0x221734,_0x1b0660){return new Promise(function(_0x3c4b87,_0x1ba5bd){var _0x10d9a9={};logger[_0xdb1c('0x69')](util[_0xdb1c('0x32')](_0xdb1c('0x71'),_0x3422c9,_0x2b6cf0));return uploadFile(_0x544570,_0x5138d8,_0x35a208,_0x2b6cf0,path['basename'](_0x221734),fs[_0xdb1c('0x72')](_0x221734))['then'](function(_0x2dcb24){logger[_0xdb1c('0x69')](util['format'](_0xdb1c('0x73'),_0x3422c9,_0x2b6cf0,_0x2dcb24[_0xdb1c('0x74')]));_0x10d9a9[_0xdb1c('0x75')]=_0x2dcb24['Bucket'];_0x10d9a9[_0xdb1c('0x76')]=_0x2dcb24[_0xdb1c('0x74')];logger[_0xdb1c('0x69')](util[_0xdb1c('0x32')](_0xdb1c('0x77'),_0x3422c9));return startTranscribe(_0x544570,_0x5138d8,_0x35a208,uuidv4(),_0x1b0660,_0x2dcb24[_0xdb1c('0x74')]);})[_0xdb1c('0x28')](function(_0x31c1c2){logger['info'](util[_0xdb1c('0x32')](_0xdb1c('0x78'),_0x3422c9,_0x31c1c2[_0xdb1c('0x79')][_0xdb1c('0x7a')]));_0x10d9a9[_0xdb1c('0x7b')]=_0x31c1c2['TranscriptionJob'][_0xdb1c('0x7a')];_0x10d9a9['transcribeStatus']=_0x31c1c2[_0xdb1c('0x79')]['TranscriptionJobStatus'];return _0x3c4b87(_0x10d9a9);})['catch'](function(_0x31fb70){return _0x1ba5bd(_0x31fb70);});});}exports[_0xdb1c('0x7c')]=function(_0x396728,_0x1ab28f,_0x23c88a){var _0x469b39;var _0x50f38d;var _0x276f03;var _0x171613=require(_0xdb1c('0x50'));return db[_0xdb1c('0x42')][_0xdb1c('0x7d')]({'where':{'id':_0x396728['params']['id']}})['then'](function(_0x1b3462){if(_0x1b3462){var _0x3715ef=util[_0xdb1c('0x32')](_0xdb1c('0x54'),_0x1b3462[_0xdb1c('0x53')]);if(fs['existsSync'](_0x3715ef)){cypher=!![];return _0x171613['decryptFile'](_0x3715ef,_0x1b3462['value'],config[_0xdb1c('0x57')][_0xdb1c('0x58')])[_0xdb1c('0x28')](function(){return _0x1b3462;});}return _0x1b3462;}})['then'](function(_0x52edba){if(!_0x52edba){throw new db[(_0xdb1c('0x59'))][(_0xdb1c('0x5a'))](_0xdb1c('0x7e'));}_0x50f38d=_0x52edba;return db[_0xdb1c('0x7f')]['findOne']({'where':{'id':0x1}});})[_0xdb1c('0x28')](handleEntityNotFound(_0x1ab28f,null))['then'](function(_0x1b5327){if(_0x1b5327){_0x469b39=_0x1b5327;if(!_0x469b39['transcribe']||!_0x469b39[_0xdb1c('0x80')]||!_0x469b39[_0xdb1c('0x81')]||!_0x469b39['language']||!_0x469b39['bucket']){throw new db[(_0xdb1c('0x59'))][(_0xdb1c('0x5a'))]('Transcribe\x20not\x20configured');}if(_0x396728[_0xdb1c('0x4c')][_0xdb1c('0x82')]&&(!_0x469b39[_0xdb1c('0x83')]||!_0x469b39[_0xdb1c('0x84')]||!_0x469b39['sentimentRegion']||!_0x469b39[_0xdb1c('0x85')]||!_0x469b39[_0xdb1c('0x75')])){throw new db[(_0xdb1c('0x59'))][(_0xdb1c('0x5a'))](_0xdb1c('0x86'));}return db[_0xdb1c('0x87')][_0xdb1c('0x7d')]({'where':{'id':_0x469b39[_0xdb1c('0x80')]}});}})[_0xdb1c('0x28')](function(_0xbbdbed){if(!_0xbbdbed){throw new db[(_0xdb1c('0x59'))]['ValidationError'](_0xdb1c('0x88'));}if(!_0xbbdbed[_0xdb1c('0x89')]||!_0xbbdbed['data2']){throw new db[(_0xdb1c('0x59'))][(_0xdb1c('0x5a'))](_0xdb1c('0x8a'));}_0x276f03=_0xbbdbed;return getBucketslist(_0x276f03[_0xdb1c('0x89')],_0x276f03[_0xdb1c('0x8b')],_0x469b39['transcribeRegion']);})[_0xdb1c('0x28')](function(_0x1382c6){if(_0x1382c6&&_0x1382c6[_0xdb1c('0x8c')]){var _0x37e113=_[_0xdb1c('0x4a')](_0x1382c6[_0xdb1c('0x8c')],function(_0x7e1c42){return _0x7e1c42['Name']===_0x469b39['bucket'];});if(!_0x37e113){logger['info'](util[_0xdb1c('0x32')](_0xdb1c('0x8d'),_0x396728[_0xdb1c('0x48')]['id'],_0x469b39[_0xdb1c('0x75')]));return createBucket(_0x276f03[_0xdb1c('0x89')],_0x276f03[_0xdb1c('0x8b')],_0x469b39[_0xdb1c('0x81')],_0x469b39[_0xdb1c('0x75')]);}logger[_0xdb1c('0x69')](util[_0xdb1c('0x32')](_0xdb1c('0x8e'),_0x396728[_0xdb1c('0x48')]['id'],_0x469b39[_0xdb1c('0x75')]));return;}})[_0xdb1c('0x28')](function(_0x2dc14d){if(_0x50f38d[_0xdb1c('0x8f')]===_0xdb1c('0x90')){return transcribe(_0x396728[_0xdb1c('0x48')]['id'],_0x276f03[_0xdb1c('0x89')],_0x276f03['data2'],_0x469b39[_0xdb1c('0x81')],_0x469b39[_0xdb1c('0x75')],_0x50f38d[_0xdb1c('0x53')],_0x469b39[_0xdb1c('0x85')]);}else{logger[_0xdb1c('0x69')](util['format'](_0xdb1c('0x91'),_0x396728[_0xdb1c('0x48')]['id']));return{'transcribeStatus':_0xdb1c('0x92')};}})[_0xdb1c('0x28')](function(_0x5922dc){if(_0x5922dc){_0x5922dc['tempSentiment']=_0x396728[_0xdb1c('0x4c')][_0xdb1c('0x82')];return _0x50f38d[_0xdb1c('0x93')](_0x5922dc);}})[_0xdb1c('0x28')](respondWithResult(_0x1ab28f,null))[_0xdb1c('0x46')](handleError(_0x1ab28f,null));};function writeFile(_0x3e42b0,_0x6532a9){return new Promise(function(_0x4a9582,_0x2b672f){fs[_0xdb1c('0x94')](_0x6532a9,_0x3e42b0,function(_0x3c9513,_0x343369){if(_0x3c9513){return _0x2b672f(_0x3c9513);}else{return _0x4a9582(_0x343369);}});});}exports[_0xdb1c('0x95')]=function(_0x1aee23,_0x1a8b87,_0x1fba79){return db[_0xdb1c('0x42')][_0xdb1c('0x7d')]({'where':{'id':_0x1aee23[_0xdb1c('0x48')]['id']}})[_0xdb1c('0x28')](handleEntityNotFound(_0x1a8b87))[_0xdb1c('0x28')](function(_0x554ac7){if(_0x554ac7&&_0x554ac7[_0xdb1c('0x96')]){var _0xc1c75e=_0x554ac7['fileText'];var _0xea43e0=config[_0xdb1c('0x97')]+_0xdb1c('0x98')+_0x554ac7['id']+_0xdb1c('0x99');if(fs[_0xdb1c('0x55')](_0xea43e0)){return _0xea43e0;}return writeFile(_0xc1c75e,_0xea43e0)[_0xdb1c('0x28')](function(){return _0xea43e0;});}else{throw new db['Sequelize'][(_0xdb1c('0x5a'))]('Transcript\x20not\x20available');}})[_0xdb1c('0x28')](function(_0x318071){return _0x1a8b87['download'](_0x318071);})[_0xdb1c('0x46')](handleError(_0x1a8b87));};
\ No newline at end of file
index 2f7073d..ce047a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78ab=['api','moment','bluebird','request-promise','path','./voiceRecording.attributes','exports','define','uniqueid','lodash','util','../../config/logger'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0x78ab,0x81));var _0xb78a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x78ab[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xb78a('0x0'));var util=require(_0xb78a('0x1'));var logger=require(_0xb78a('0x2'))(_0xb78a('0x3'));var moment=require(_0xb78a('0x4'));var BPromise=require(_0xb78a('0x5'));var rp=require(_0xb78a('0x6'));var fs=require('fs');var path=require(_0xb78a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb78a('0x8'));module[_0xb78a('0x9')]=function(_0x20e907,_0x2166fa){return _0x20e907[_0xb78a('0xa')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xb78a('0xb'),'fields':[_0xb78a('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x94c9=['rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','moment','request-promise','path'];(function(_0x5f4055,_0x33df12){var _0x1a8df3=function(_0x39fbd4){while(--_0x39fbd4){_0x5f4055['push'](_0x5f4055['shift']());}};_0x1a8df3(++_0x33df12);}(_0x94c9,0x1b5));var _0x994c=function(_0x1bfa4f,_0x157de4){_0x1bfa4f=_0x1bfa4f-0x0;var _0x13b62d=_0x94c9[_0x1bfa4f];return _0x13b62d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x994c('0x0'));var BPromise=require('bluebird');var rp=require(_0x994c('0x1'));var fs=require('fs');var path=require(_0x994c('0x2'));var rimraf=require(_0x994c('0x3'));var config=require(_0x994c('0x4'));var attributes=require(_0x994c('0x5'));module[_0x994c('0x6')]=function(_0x5bc7a2,_0x4a0b01){return _0x5bc7a2[_0x994c('0x7')](_0x994c('0x8'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x994c('0x9'),'fields':[_0x994c('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index ce2553a..9e3de38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','where','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','format','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5d4aaa,_0x385195){var _0x427773=function(_0x41aa02){while(--_0x41aa02){_0x5d4aaa['push'](_0x5d4aaa['shift']());}};_0x427773(++_0x385195);}(_0x1623,0xab));var _0x3162=function(_0x466635,_0x29f7c2){_0x466635=_0x466635-0x0;var _0x14279d=_0x1623[_0x466635];return _0x14279d;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('VoiceRecording,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});}exports[_0x3162('0x16')]=function(_0x1eed46){var _0x391d97=this;return new Promise(function(_0x4b2bf3,_0x42f283){return db[_0x3162('0x17')][_0x3162('0x18')](_0x1eed46[_0x3162('0x19')],{'raw':_0x1eed46['options']?_0x1eed46[_0x3162('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eed46['options']?_0x1eed46[_0x3162('0x1a')][_0x3162('0x1b')]||null:null,'attributes':_0x1eed46[_0x3162('0x1a')]?_0x1eed46['options']['attributes']||null:null,'limit':_0x1eed46[_0x3162('0x1a')]?_0x1eed46[_0x3162('0x1a')][_0x3162('0x1c')]||null:null})[_0x3162('0xa')](function(_0x31b27b){logger[_0x3162('0xb')](_0x3162('0x16'),_0x1eed46);logger[_0x3162('0xc')]('UpdateVoiceRecording',_0x1eed46,JSON[_0x3162('0xf')](_0x31b27b));_0x4b2bf3(_0x31b27b);})[_0x3162('0x15')](function(_0x3919e7){logger[_0x3162('0x10')](_0x3162('0x16'),_0x3919e7[_0x3162('0x13')],_0x1eed46);_0x42f283(_0x391d97[_0x3162('0x10')](0x1f4,_0x3919e7[_0x3162('0x13')]));});});};exports[_0x3162('0x1d')]=function(_0x356c5d){var _0x8fa09f=this;return new Promise(function(_0x2f62d7,_0x1c03a4){var _0x48de45=require(_0x3162('0x1e'));var _0x552469;return db[_0x3162('0x1f')][_0x3162('0x20')]({'attributes':['id',_0x3162('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x4903e7){_0x552469=_0x4903e7;return db[_0x3162('0x17')][_0x3162('0x22')](_0x356c5d[_0x3162('0x19')]);})[_0x3162('0xa')](function(_0x2f88ec){if(_0x552469['callRecordingEncryption']&&fs[_0x3162('0x23')](_0x2f88ec['value'])){var _0xf11765=util[_0x3162('0x24')](_0x3162('0x25'),_0x2f88ec[_0x3162('0x26')]);return _0x48de45[_0x3162('0x27')](_0x2f88ec[_0x3162('0x26')],_0xf11765,config[_0x3162('0x28')][_0x3162('0x29')])['then'](function(){fs[_0x3162('0x2a')](_0x2f88ec[_0x3162('0x26')]);logger['info'](_0x3162('0x2b'));return _0x2f88ec;});}return _0x2f88ec;})[_0x3162('0xa')](function(_0x528340){logger['info'](_0x3162('0x1d'),_0x356c5d);logger['debug'](_0x3162('0x1d'),_0x356c5d,JSON[_0x3162('0xf')](_0x528340));_0x2f62d7(_0x528340);})[_0x3162('0x15')](function(_0x551442){logger['error'](_0x3162('0x1d'),_0x551442[_0x3162('0x13')],_0x356c5d);_0x1c03a4(_0x8fa09f['error'](0x1f4,_0x551442[_0x3162('0x13')]));});});};
\ No newline at end of file
+var _0xd943=['info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x2e7c96,_0x27804d){var _0x36008e=function(_0xd03b6b){while(--_0xd03b6b){_0x2e7c96['push'](_0x2e7c96['shift']());}};_0x36008e(++_0x27804d);}(_0xd943,0x15d));var _0x3d94=function(_0x2e795c,_0x3314fb){_0x2e795c=_0x2e795c-0x0;var _0x29cd10=_0xd943[_0x2e795c];return _0x29cd10;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('VoiceRecording,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}exports[_0x3d94('0x14')]=function(_0x2acee3){var _0x1c35a8=this;return new Promise(function(_0x4afc92,_0x3ca0e3){return db[_0x3d94('0x15')]['update'](_0x2acee3[_0x3d94('0x16')],{'raw':_0x2acee3['options']?_0x2acee3[_0x3d94('0x17')][_0x3d94('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2acee3[_0x3d94('0x17')]?_0x2acee3[_0x3d94('0x17')][_0x3d94('0x19')]||null:null,'attributes':_0x2acee3['options']?_0x2acee3['options'][_0x3d94('0x1a')]||null:null,'limit':_0x2acee3[_0x3d94('0x17')]?_0x2acee3[_0x3d94('0x17')]['limit']||null:null})[_0x3d94('0xa')](function(_0x2e8c91){logger[_0x3d94('0xb')](_0x3d94('0x14'),_0x2acee3);logger[_0x3d94('0x1b')](_0x3d94('0x14'),_0x2acee3,JSON[_0x3d94('0x1c')](_0x2e8c91));_0x4afc92(_0x2e8c91);})[_0x3d94('0x13')](function(_0xee7b8d){logger[_0x3d94('0xe')](_0x3d94('0x14'),_0xee7b8d[_0x3d94('0x11')],_0x2acee3);_0x3ca0e3(_0x1c35a8[_0x3d94('0xe')](0x1f4,_0xee7b8d[_0x3d94('0x11')]));});});};exports[_0x3d94('0x1d')]=function(_0x5b3b31){var _0x123183=this;return new Promise(function(_0x558fd2,_0x28a698){var _0x1d0a7a=require(_0x3d94('0x1e'));var _0x439173;return db[_0x3d94('0x1f')][_0x3d94('0x20')]({'attributes':['id',_0x3d94('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x584c4a){_0x439173=_0x584c4a;return db[_0x3d94('0x15')]['create'](_0x5b3b31['body']);})[_0x3d94('0xa')](function(_0x58c0d0){if(_0x439173[_0x3d94('0x21')]&&fs[_0x3d94('0x22')](_0x58c0d0[_0x3d94('0x23')])){var _0x4cef9c=util[_0x3d94('0x24')]('%s.cypher',_0x58c0d0[_0x3d94('0x23')]);return _0x1d0a7a['encryptFile'](_0x58c0d0[_0x3d94('0x23')],_0x4cef9c,config[_0x3d94('0x25')][_0x3d94('0x26')])[_0x3d94('0xa')](function(){fs['unlink'](_0x58c0d0[_0x3d94('0x23')]);logger['info'](_0x3d94('0x27'));return _0x58c0d0;});}return _0x58c0d0;})[_0x3d94('0xa')](function(_0x51d308){logger['info'](_0x3d94('0x1d'),_0x5b3b31);logger[_0x3d94('0x1b')](_0x3d94('0x1d'),_0x5b3b31,JSON['stringify'](_0x51d308));_0x558fd2(_0x51d308);})[_0x3d94('0x13')](function(_0x3d29fd){logger['error'](_0x3d94('0x1d'),_0x3d29fd[_0x3d94('0x11')],_0x5b3b31);_0x28a698(_0x123183[_0x3d94('0xe')](0x1f4,_0x3d29fd[_0x3d94('0x11')]));});});};
\ No newline at end of file
index 863385d..539c54a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2816=['../../config/environment','get','index','/describe','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x38da1b,_0x106e24){var _0x47c4cb=function(_0x49a394){while(--_0x49a394){_0x38da1b['push'](_0x38da1b['shift']());}};_0x47c4cb(++_0x106e24);}(_0x2816,0x12d));var _0x6281=function(_0x76318c,_0x4f7b2d){_0x76318c=_0x76318c-0x0;var _0x21d9de=_0x2816[_0x76318c];return _0x21d9de;};'use strict';var multer=require('multer');var util=require(_0x6281('0x0'));var path=require(_0x6281('0x1'));var timeout=require(_0x6281('0x2'));var express=require('express');var router=express[_0x6281('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6281('0x4'));var config=require(_0x6281('0x5'));var controller=require('./voiceTransferReport.controller');router[_0x6281('0x6')]('/',auth['isAuthenticated'](),controller[_0x6281('0x7')]);router[_0x6281('0x6')](_0x6281('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x6281('0x6')](_0x6281('0x9'),auth[_0x6281('0xa')](),controller[_0x6281('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6281('0xc')]);router[_0x6281('0xd')](_0x6281('0x9'),auth[_0x6281('0xa')](),controller[_0x6281('0xe')]);router[_0x6281('0xf')]('/:id',auth[_0x6281('0xa')](),controller[_0x6281('0x10')]);module[_0x6281('0x11')]=router;
\ No newline at end of file
+var _0x733c=['put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create'];(function(_0x4c6eb0,_0x3301b0){var _0x417e51=function(_0x884a0d){while(--_0x884a0d){_0x4c6eb0['push'](_0x4c6eb0['shift']());}};_0x417e51(++_0x3301b0);}(_0x733c,0x6c));var _0xc733=function(_0x34df72,_0x3e3fde){_0x34df72=_0x34df72-0x0;var _0x2bfb4f=_0x733c[_0x34df72];return _0x2bfb4f;};'use strict';var multer=require(_0xc733('0x0'));var util=require(_0xc733('0x1'));var path=require(_0xc733('0x2'));var timeout=require(_0xc733('0x3'));var express=require(_0xc733('0x4'));var router=express[_0xc733('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc733('0x6'));var interaction=require(_0xc733('0x7'));var config=require(_0xc733('0x8'));var controller=require(_0xc733('0x9'));router[_0xc733('0xa')]('/',auth[_0xc733('0xb')](),controller[_0xc733('0xc')]);router[_0xc733('0xa')](_0xc733('0xd'),auth[_0xc733('0xb')](),controller[_0xc733('0xe')]);router[_0xc733('0xa')](_0xc733('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xc733('0x10')]('/',auth[_0xc733('0xb')](),controller[_0xc733('0x11')]);router[_0xc733('0x12')]('/:id',auth[_0xc733('0xb')](),controller['update']);router[_0xc733('0x13')](_0xc733('0xf'),auth[_0xc733('0xb')](),controller[_0xc733('0x14')]);module['exports']=router;
\ No newline at end of file
index aacddd5..6352392 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2629=['moment','exports','ENUM','blind','attended','STRING','sequelize'];(function(_0x22dc5c,_0x175e58){var _0x51652c=function(_0xd5a47c){while(--_0xd5a47c){_0x22dc5c['push'](_0x22dc5c['shift']());}};_0x51652c(++_0x175e58);}(_0x2629,0xbc));var _0x9262=function(_0x33c42e,_0x170930){_0x33c42e=_0x33c42e-0x0;var _0xfddb2b=_0x2629[_0x33c42e];return _0xfddb2b;};'use strict';var Sequelize=require(_0x9262('0x0'));var moment=require(_0x9262('0x1'));module[_0x9262('0x2')]={'type':{'type':Sequelize[_0x9262('0x3')](_0x9262('0x4'),_0x9262('0x5'))},'result':{'type':Sequelize[_0x9262('0x6')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x9262('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x9262('0x6')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x9262('0x6')]},'transfererexten':{'type':Sequelize[_0x9262('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x9262('0x6')]},'transfereechannel':{'type':Sequelize[_0x9262('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x9262('0x6')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x9262('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x9262('0x6')]},'transfereeexten':{'type':Sequelize[_0x9262('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x9262('0x6')]},'isexternal':{'type':Sequelize[_0x9262('0x3')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9262('0x6')]}};
\ No newline at end of file
+var _0xdbbe=['STRING','Yes','sequelize','moment','exports','ENUM','blind','attended'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xdbbe,0xc2));var _0xedbb=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0xdbbe[_0x234ae1];return _0x227ba0;};'use strict';var Sequelize=require(_0xedbb('0x0'));var moment=require(_0xedbb('0x1'));module[_0xedbb('0x2')]={'type':{'type':Sequelize[_0xedbb('0x3')](_0xedbb('0x4'),_0xedbb('0x5'))},'result':{'type':Sequelize[_0xedbb('0x6')]},'transfererchannel':{'type':Sequelize[_0xedbb('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xedbb('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0xedbb('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xedbb('0x6')]},'transferercontext':{'type':Sequelize[_0xedbb('0x6')]},'transfererexten':{'type':Sequelize[_0xedbb('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xedbb('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xedbb('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xedbb('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xedbb('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xedbb('0x6')]},'transfereecontext':{'type':Sequelize[_0xedbb('0x6')]},'transfereeexten':{'type':Sequelize[_0xedbb('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0xedbb('0x7'),'No')},'context':{'type':Sequelize[_0xedbb('0x6')]},'extension':{'type':Sequelize[_0xedbb('0x6')]}};
\ No newline at end of file
index e9f807e..d29fe08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cf0=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x239839,_0x4cfc17){var _0x1ca7ea=function(_0x34417f){while(--_0x34417f){_0x239839['push'](_0x239839['shift']());}};_0x1ca7ea(++_0x4cfc17);}(_0x9cf0,0x19c));var _0x09cf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9cf0[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x09cf('0x0'));var rimraf=require(_0x09cf('0x1'));var zipdir=require(_0x09cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x09cf('0x3'));var BPromise=require(_0x09cf('0x4'));var Mustache=require('mustache');var util=require(_0x09cf('0x5'));var path=require(_0x09cf('0x6'));var sox=require('sox');var csv=require(_0x09cf('0x7'));var ejs=require(_0x09cf('0x8'));var fs=require('fs');var fs_extra=require(_0x09cf('0x9'));var _=require(_0x09cf('0xa'));var squel=require(_0x09cf('0xb'));var crypto=require('crypto');var jsforce=require(_0x09cf('0xc'));var deskjs=require(_0x09cf('0xd'));var toCsv=require(_0x09cf('0x7'));var querystring=require(_0x09cf('0xe'));var Papa=require('papaparse');var Redis=require(_0x09cf('0xf'));var authService=require(_0x09cf('0x10'));var qs=require(_0x09cf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x09cf('0x12'));var logger=require('../../config/logger')(_0x09cf('0x13'));var utils=require(_0x09cf('0x14'));var config=require(_0x09cf('0x15'));var licenseUtil=require(_0x09cf('0x16'));var db=require(_0x09cf('0x17'))['db'];function respondWithStatusCode(_0x4f0828,_0x12027f){_0x12027f=_0x12027f||0xcc;return function(_0x2d5afd){if(_0x2d5afd){return _0x4f0828[_0x09cf('0x18')](_0x12027f);}return _0x4f0828[_0x09cf('0x19')](_0x12027f)[_0x09cf('0x1a')]();};}function respondWithResult(_0x1dd957,_0x3c058a){_0x3c058a=_0x3c058a||0xc8;return function(_0x128911){if(_0x128911){return _0x1dd957[_0x09cf('0x19')](_0x3c058a)[_0x09cf('0x1b')](_0x128911);}};}function respondWithFilteredResult(_0x346afe,_0x5be3ab){return function(_0x14ae0b){if(_0x14ae0b){var _0x175ec2=typeof _0x5be3ab['offset']===_0x09cf('0x1c')&&typeof _0x5be3ab[_0x09cf('0x1d')]===_0x09cf('0x1c');var _0x2d8287=_0x14ae0b[_0x09cf('0x1e')];var _0x55171a=_0x175ec2?0x0:_0x5be3ab['offset'];var _0x4d8345=_0x175ec2?_0x14ae0b['count']:_0x5be3ab['offset']+_0x5be3ab[_0x09cf('0x1d')];var _0x48ddc1;if(_0x4d8345>=_0x2d8287){_0x4d8345=_0x2d8287;_0x48ddc1=0xc8;}else{_0x48ddc1=0xce;}_0x346afe[_0x09cf('0x19')](_0x48ddc1);return _0x346afe['set']('Content-Range',_0x55171a+'-'+_0x4d8345+'/'+_0x2d8287)[_0x09cf('0x1b')](_0x14ae0b);}return null;};}function patchUpdates(_0x5c3ae7){return function(_0x24f238){try{jsonpatch[_0x09cf('0x1f')](_0x24f238,_0x5c3ae7,!![]);}catch(_0x84f3c9){return BPromise[_0x09cf('0x20')](_0x84f3c9);}return _0x24f238[_0x09cf('0x21')]();};}function saveUpdates(_0x11679d,_0x1f3112){return function(_0x1a726f){if(_0x1a726f){return _0x1a726f[_0x09cf('0x22')](_0x11679d)[_0x09cf('0x23')](function(_0x2d96f8){return _0x2d96f8;});}return null;};}function removeEntity(_0x5a398d,_0x57a263){return function(_0x51384a){if(_0x51384a){return _0x51384a[_0x09cf('0x24')]()['then'](function(){_0x5a398d[_0x09cf('0x19')](0xcc)[_0x09cf('0x1a')]();});}};}function handleEntityNotFound(_0x51ee24,_0x42e88c){return function(_0x2e1a99){if(!_0x2e1a99){_0x51ee24[_0x09cf('0x18')](0x194);}return _0x2e1a99;};}function handleError(_0x7a932c,_0x329126){_0x329126=_0x329126||0x1f4;return function(_0x3936b2){logger[_0x09cf('0x25')](_0x3936b2[_0x09cf('0x26')]);if(_0x3936b2[_0x09cf('0x27')]){delete _0x3936b2['name'];}_0x7a932c[_0x09cf('0x19')](_0x329126)[_0x09cf('0x28')](_0x3936b2);};}exports[_0x09cf('0x29')]=function(_0x589d08,_0x14bfa3){var _0x31e9c8={},_0x40b0b8={},_0x25017a={'count':0x0,'rows':[]};var _0x137ef7=_[_0x09cf('0x2a')](db[_0x09cf('0x2b')][_0x09cf('0x2c')],function(_0x38e505){return{'name':_0x38e505['fieldName'],'type':_0x38e505['type']['key']};});_0x40b0b8['model']=_['map'](_0x137ef7,'name');_0x40b0b8[_0x09cf('0x2d')]=_[_0x09cf('0x2e')](_0x589d08['query']);_0x40b0b8[_0x09cf('0x2f')]=_[_0x09cf('0x30')](_0x40b0b8[_0x09cf('0x31')],_0x40b0b8[_0x09cf('0x2d')]);_0x31e9c8[_0x09cf('0x32')]=_[_0x09cf('0x30')](_0x40b0b8[_0x09cf('0x31')],qs['fields'](_0x589d08[_0x09cf('0x2d')][_0x09cf('0x33')]));_0x31e9c8['attributes']=_0x31e9c8['attributes'][_0x09cf('0x34')]?_0x31e9c8[_0x09cf('0x32')]:_0x40b0b8[_0x09cf('0x31')];if(!_0x589d08['query']['hasOwnProperty'](_0x09cf('0x35'))){_0x31e9c8[_0x09cf('0x1d')]=qs['limit'](_0x589d08[_0x09cf('0x2d')]['limit']);_0x31e9c8['offset']=qs[_0x09cf('0x36')](_0x589d08['query']['offset']);}_0x31e9c8[_0x09cf('0x37')]=qs[_0x09cf('0x38')](_0x589d08[_0x09cf('0x2d')]['sort']);_0x31e9c8[_0x09cf('0x39')]=qs[_0x09cf('0x2f')](_[_0x09cf('0x3a')](_0x589d08['query'],_0x40b0b8[_0x09cf('0x2f')]),_0x137ef7);if(_0x589d08[_0x09cf('0x2d')]['filter']){_0x31e9c8[_0x09cf('0x39')]=_[_0x09cf('0x3b')](_0x31e9c8['where'],{'$or':_['map'](_0x137ef7,function(_0x6d455c){if(_0x6d455c['type']!==_0x09cf('0x3c')){var _0x9b1e07={};_0x9b1e07[_0x6d455c[_0x09cf('0x27')]]={'$like':'%'+_0x589d08[_0x09cf('0x2d')][_0x09cf('0x3d')]+'%'};return _0x9b1e07;}})});}_0x31e9c8=_[_0x09cf('0x3b')]({},_0x31e9c8,_0x589d08[_0x09cf('0x3e')]);var _0x316d87={'where':_0x31e9c8[_0x09cf('0x39')]};return db['VoiceTransferReport'][_0x09cf('0x1e')](_0x316d87)[_0x09cf('0x23')](function(_0x2f5b7a){_0x25017a[_0x09cf('0x1e')]=_0x2f5b7a;if(_0x589d08[_0x09cf('0x2d')][_0x09cf('0x3f')]){_0x31e9c8['include']=[{'all':!![]}];}return db[_0x09cf('0x2b')][_0x09cf('0x40')](_0x31e9c8);})[_0x09cf('0x23')](function(_0x40b635){_0x25017a[_0x09cf('0x41')]=_0x40b635;return _0x25017a;})['then'](respondWithFilteredResult(_0x14bfa3,_0x31e9c8))[_0x09cf('0x42')](handleError(_0x14bfa3,null));};exports['show']=function(_0x19a30e,_0x58ebe0){var _0x23ac27={'raw':!![],'where':{'id':_0x19a30e[_0x09cf('0x43')]['id']}},_0x5a598b={};_0x5a598b[_0x09cf('0x31')]=_[_0x09cf('0x2e')](db['VoiceTransferReport']['rawAttributes']);_0x5a598b[_0x09cf('0x2d')]=_['keys'](_0x19a30e[_0x09cf('0x2d')]);_0x5a598b['filters']=_['intersection'](_0x5a598b[_0x09cf('0x31')],_0x5a598b[_0x09cf('0x2d')]);_0x23ac27[_0x09cf('0x32')]=_[_0x09cf('0x30')](_0x5a598b['model'],qs['fields'](_0x19a30e[_0x09cf('0x2d')][_0x09cf('0x33')]));_0x23ac27[_0x09cf('0x32')]=_0x23ac27[_0x09cf('0x32')][_0x09cf('0x34')]?_0x23ac27[_0x09cf('0x32')]:_0x5a598b[_0x09cf('0x31')];if(_0x19a30e[_0x09cf('0x2d')]['includeAll']){_0x23ac27[_0x09cf('0x44')]=[{'all':!![]}];}_0x23ac27=_[_0x09cf('0x3b')]({},_0x23ac27,_0x19a30e[_0x09cf('0x3e')]);return db[_0x09cf('0x2b')][_0x09cf('0x45')](_0x23ac27)[_0x09cf('0x23')](handleEntityNotFound(_0x58ebe0,null))[_0x09cf('0x23')](respondWithResult(_0x58ebe0,null))[_0x09cf('0x42')](handleError(_0x58ebe0,null));};exports[_0x09cf('0x46')]=function(_0x3ced56,_0x23eeda){return db[_0x09cf('0x2b')][_0x09cf('0x46')](_0x3ced56[_0x09cf('0x47')],{})[_0x09cf('0x23')](respondWithResult(_0x23eeda,0xc9))[_0x09cf('0x42')](handleError(_0x23eeda,null));};exports[_0x09cf('0x22')]=function(_0x21c863,_0x5a4f59){if(_0x21c863['body']['id']){delete _0x21c863[_0x09cf('0x47')]['id'];}return db[_0x09cf('0x2b')][_0x09cf('0x45')]({'where':{'id':_0x21c863['params']['id']}})[_0x09cf('0x23')](handleEntityNotFound(_0x5a4f59,null))['then'](saveUpdates(_0x21c863[_0x09cf('0x47')],null))[_0x09cf('0x23')](respondWithResult(_0x5a4f59,null))[_0x09cf('0x42')](handleError(_0x5a4f59,null));};exports[_0x09cf('0x24')]=function(_0x4d3930,_0x4508af){return db[_0x09cf('0x2b')]['find']({'where':{'id':_0x4d3930[_0x09cf('0x43')]['id']}})[_0x09cf('0x23')](handleEntityNotFound(_0x4508af,null))[_0x09cf('0x23')](removeEntity(_0x4508af,null))[_0x09cf('0x42')](handleError(_0x4508af,null));};exports['describe']=function(_0x1352cf,_0x1c8bb2){return db[_0x09cf('0x2b')]['describe']()[_0x09cf('0x23')](respondWithResult(_0x1c8bb2,null))[_0x09cf('0x42')](handleError(_0x1c8bb2,null));};
\ No newline at end of file
+var _0xb4e0=['rawAttributes','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../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','VoiceTransferReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','merge','where','filter','options','includeAll','include','findAll','rows','show','params'];(function(_0x16b986,_0x38c731){var _0x20e0d1=function(_0x476a23){while(--_0x476a23){_0x16b986['push'](_0x16b986['shift']());}};_0x20e0d1(++_0x38c731);}(_0xb4e0,0x99));var _0x0b4e=function(_0x559c44,_0x1064ea){_0x559c44=_0x559c44-0x0;var _0x1ae7c4=_0xb4e0[_0x559c44];return _0x1ae7c4;};'use strict';var emlformat=require(_0x0b4e('0x0'));var rimraf=require(_0x0b4e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b4e('0x2'));var rp=require(_0x0b4e('0x3'));var moment=require('moment');var BPromise=require(_0x0b4e('0x4'));var Mustache=require(_0x0b4e('0x5'));var util=require('util');var path=require(_0x0b4e('0x6'));var sox=require(_0x0b4e('0x7'));var csv=require('to-csv');var ejs=require(_0x0b4e('0x8'));var fs=require('fs');var fs_extra=require(_0x0b4e('0x9'));var _=require('lodash');var squel=require(_0x0b4e('0xa'));var crypto=require(_0x0b4e('0xb'));var jsforce=require(_0x0b4e('0xc'));var deskjs=require(_0x0b4e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0b4e('0xe'));var Papa=require(_0x0b4e('0xf'));var Redis=require(_0x0b4e('0x10'));var authService=require(_0x0b4e('0x11'));var qs=require(_0x0b4e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b4e('0x13'));var logger=require(_0x0b4e('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0b4e('0x15'));var db=require(_0x0b4e('0x16'))['db'];function respondWithStatusCode(_0x2dbe40,_0x1d0d1e){_0x1d0d1e=_0x1d0d1e||0xcc;return function(_0xcd72a3){if(_0xcd72a3){return _0x2dbe40[_0x0b4e('0x17')](_0x1d0d1e);}return _0x2dbe40[_0x0b4e('0x18')](_0x1d0d1e)[_0x0b4e('0x19')]();};}function respondWithResult(_0xcc1afe,_0x5c7351){_0x5c7351=_0x5c7351||0xc8;return function(_0x306cfe){if(_0x306cfe){return _0xcc1afe['status'](_0x5c7351)[_0x0b4e('0x1a')](_0x306cfe);}};}function respondWithFilteredResult(_0x2c1896,_0x4fe939){return function(_0x47b151){if(_0x47b151){var _0x165594=typeof _0x4fe939[_0x0b4e('0x1b')]===_0x0b4e('0x1c')&&typeof _0x4fe939[_0x0b4e('0x1d')]==='undefined';var _0x32fba2=_0x47b151[_0x0b4e('0x1e')];var _0x5c91e7=_0x165594?0x0:_0x4fe939['offset'];var _0x394c2f=_0x165594?_0x47b151['count']:_0x4fe939[_0x0b4e('0x1b')]+_0x4fe939['limit'];var _0x59cb66;if(_0x394c2f>=_0x32fba2){_0x394c2f=_0x32fba2;_0x59cb66=0xc8;}else{_0x59cb66=0xce;}_0x2c1896[_0x0b4e('0x18')](_0x59cb66);return _0x2c1896[_0x0b4e('0x1f')](_0x0b4e('0x20'),_0x5c91e7+'-'+_0x394c2f+'/'+_0x32fba2)[_0x0b4e('0x1a')](_0x47b151);}return null;};}function patchUpdates(_0xca6ac3){return function(_0x5a5021){try{jsonpatch[_0x0b4e('0x21')](_0x5a5021,_0xca6ac3,!![]);}catch(_0x203107){return BPromise[_0x0b4e('0x22')](_0x203107);}return _0x5a5021[_0x0b4e('0x23')]();};}function saveUpdates(_0x218eaa,_0x1c8e9c){return function(_0x5e9852){if(_0x5e9852){return _0x5e9852[_0x0b4e('0x24')](_0x218eaa)[_0x0b4e('0x25')](function(_0x40ad06){return _0x40ad06;});}return null;};}function removeEntity(_0xb52cd1,_0x437ea2){return function(_0x1fe304){if(_0x1fe304){return _0x1fe304[_0x0b4e('0x26')]()[_0x0b4e('0x25')](function(){_0xb52cd1['status'](0xcc)[_0x0b4e('0x19')]();});}};}function handleEntityNotFound(_0x1fa4de,_0x211e28){return function(_0x4fa5b4){if(!_0x4fa5b4){_0x1fa4de[_0x0b4e('0x17')](0x194);}return _0x4fa5b4;};}function handleError(_0x175b9a,_0x33cbc5){_0x33cbc5=_0x33cbc5||0x1f4;return function(_0x5ea99b){logger[_0x0b4e('0x27')](_0x5ea99b[_0x0b4e('0x28')]);if(_0x5ea99b[_0x0b4e('0x29')]){delete _0x5ea99b[_0x0b4e('0x29')];}_0x175b9a['status'](_0x33cbc5)[_0x0b4e('0x2a')](_0x5ea99b);};}exports[_0x0b4e('0x2b')]=function(_0xcf934e,_0x1174c4){var _0x1440f8={},_0x12ca8d={},_0x44e1ec={'count':0x0,'rows':[]};var _0x3b2b7e=_['map'](db[_0x0b4e('0x2c')]['rawAttributes'],function(_0x123c06){return{'name':_0x123c06[_0x0b4e('0x2d')],'type':_0x123c06[_0x0b4e('0x2e')][_0x0b4e('0x2f')]};});_0x12ca8d[_0x0b4e('0x30')]=_[_0x0b4e('0x31')](_0x3b2b7e,_0x0b4e('0x29'));_0x12ca8d[_0x0b4e('0x32')]=_[_0x0b4e('0x33')](_0xcf934e[_0x0b4e('0x32')]);_0x12ca8d[_0x0b4e('0x34')]=_[_0x0b4e('0x35')](_0x12ca8d[_0x0b4e('0x30')],_0x12ca8d[_0x0b4e('0x32')]);_0x1440f8[_0x0b4e('0x36')]=_[_0x0b4e('0x35')](_0x12ca8d['model'],qs[_0x0b4e('0x37')](_0xcf934e[_0x0b4e('0x32')][_0x0b4e('0x37')]));_0x1440f8[_0x0b4e('0x36')]=_0x1440f8[_0x0b4e('0x36')][_0x0b4e('0x38')]?_0x1440f8[_0x0b4e('0x36')]:_0x12ca8d[_0x0b4e('0x30')];if(!_0xcf934e['query'][_0x0b4e('0x39')]('nolimit')){_0x1440f8[_0x0b4e('0x1d')]=qs[_0x0b4e('0x1d')](_0xcf934e[_0x0b4e('0x32')][_0x0b4e('0x1d')]);_0x1440f8[_0x0b4e('0x1b')]=qs[_0x0b4e('0x1b')](_0xcf934e[_0x0b4e('0x32')][_0x0b4e('0x1b')]);}_0x1440f8['order']=qs[_0x0b4e('0x3a')](_0xcf934e[_0x0b4e('0x32')][_0x0b4e('0x3a')]);_0x1440f8['where']=qs[_0x0b4e('0x34')](_['pick'](_0xcf934e[_0x0b4e('0x32')],_0x12ca8d[_0x0b4e('0x34')]),_0x3b2b7e);if(_0xcf934e[_0x0b4e('0x32')]['filter']){_0x1440f8['where']=_[_0x0b4e('0x3b')](_0x1440f8[_0x0b4e('0x3c')],{'$or':_['map'](_0x3b2b7e,function(_0xd69a92){if(_0xd69a92[_0x0b4e('0x2e')]!=='VIRTUAL'){var _0x3bb33e={};_0x3bb33e[_0xd69a92['name']]={'$like':'%'+_0xcf934e[_0x0b4e('0x32')][_0x0b4e('0x3d')]+'%'};return _0x3bb33e;}})});}_0x1440f8=_[_0x0b4e('0x3b')]({},_0x1440f8,_0xcf934e[_0x0b4e('0x3e')]);var _0x3d9793={'where':_0x1440f8['where']};return db[_0x0b4e('0x2c')][_0x0b4e('0x1e')](_0x3d9793)[_0x0b4e('0x25')](function(_0x5bf0e4){_0x44e1ec[_0x0b4e('0x1e')]=_0x5bf0e4;if(_0xcf934e['query'][_0x0b4e('0x3f')]){_0x1440f8[_0x0b4e('0x40')]=[{'all':!![]}];}return db[_0x0b4e('0x2c')][_0x0b4e('0x41')](_0x1440f8);})[_0x0b4e('0x25')](function(_0x4c9d33){_0x44e1ec[_0x0b4e('0x42')]=_0x4c9d33;return _0x44e1ec;})['then'](respondWithFilteredResult(_0x1174c4,_0x1440f8))['catch'](handleError(_0x1174c4,null));};exports[_0x0b4e('0x43')]=function(_0x49e11e,_0x3ec613){var _0x13bef0={'raw':!![],'where':{'id':_0x49e11e[_0x0b4e('0x44')]['id']}},_0x14a2a5={};_0x14a2a5['model']=_[_0x0b4e('0x33')](db['VoiceTransferReport'][_0x0b4e('0x45')]);_0x14a2a5[_0x0b4e('0x32')]=_[_0x0b4e('0x33')](_0x49e11e['query']);_0x14a2a5['filters']=_[_0x0b4e('0x35')](_0x14a2a5[_0x0b4e('0x30')],_0x14a2a5['query']);_0x13bef0[_0x0b4e('0x36')]=_[_0x0b4e('0x35')](_0x14a2a5[_0x0b4e('0x30')],qs[_0x0b4e('0x37')](_0x49e11e[_0x0b4e('0x32')][_0x0b4e('0x37')]));_0x13bef0['attributes']=_0x13bef0[_0x0b4e('0x36')][_0x0b4e('0x38')]?_0x13bef0[_0x0b4e('0x36')]:_0x14a2a5[_0x0b4e('0x30')];if(_0x49e11e[_0x0b4e('0x32')][_0x0b4e('0x3f')]){_0x13bef0['include']=[{'all':!![]}];}_0x13bef0=_[_0x0b4e('0x3b')]({},_0x13bef0,_0x49e11e[_0x0b4e('0x3e')]);return db[_0x0b4e('0x2c')]['find'](_0x13bef0)[_0x0b4e('0x25')](handleEntityNotFound(_0x3ec613,null))[_0x0b4e('0x25')](respondWithResult(_0x3ec613,null))[_0x0b4e('0x46')](handleError(_0x3ec613,null));};exports[_0x0b4e('0x47')]=function(_0x9d3658,_0x1d0fa3){return db[_0x0b4e('0x2c')][_0x0b4e('0x47')](_0x9d3658[_0x0b4e('0x48')],{})[_0x0b4e('0x25')](respondWithResult(_0x1d0fa3,0xc9))[_0x0b4e('0x46')](handleError(_0x1d0fa3,null));};exports[_0x0b4e('0x24')]=function(_0x176487,_0x405e86){if(_0x176487[_0x0b4e('0x48')]['id']){delete _0x176487[_0x0b4e('0x48')]['id'];}return db[_0x0b4e('0x2c')]['find']({'where':{'id':_0x176487[_0x0b4e('0x44')]['id']}})[_0x0b4e('0x25')](handleEntityNotFound(_0x405e86,null))['then'](saveUpdates(_0x176487['body'],null))[_0x0b4e('0x25')](respondWithResult(_0x405e86,null))[_0x0b4e('0x46')](handleError(_0x405e86,null));};exports[_0x0b4e('0x26')]=function(_0x301536,_0x38b24a){return db['VoiceTransferReport'][_0x0b4e('0x49')]({'where':{'id':_0x301536['params']['id']}})['then'](handleEntityNotFound(_0x38b24a,null))[_0x0b4e('0x25')](removeEntity(_0x38b24a,null))['catch'](handleError(_0x38b24a,null));};exports['describe']=function(_0x586769,_0x43d22f){return db[_0x0b4e('0x2c')]['describe']()[_0x0b4e('0x25')](respondWithResult(_0x43d22f,null))[_0x0b4e('0x46')](handleError(_0x43d22f,null));};
\ No newline at end of file
index 428311a..8f73e21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc8c=['request-promise','path','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x487066,_0x1fdadd){var _0xff5f81=function(_0x568881){while(--_0x568881){_0x487066['push'](_0x487066['shift']());}};_0xff5f81(++_0x1fdadd);}(_0xdc8c,0x125));var _0xcdc8=function(_0x19725a,_0x5991dc){_0x19725a=_0x19725a-0x0;var _0xa63c19=_0xdc8c[_0x19725a];return _0xa63c19;};'use strict';var _=require(_0xcdc8('0x0'));var util=require(_0xcdc8('0x1'));var logger=require(_0xcdc8('0x2'))(_0xcdc8('0x3'));var moment=require(_0xcdc8('0x4'));var BPromise=require(_0xcdc8('0x5'));var rp=require(_0xcdc8('0x6'));var fs=require('fs');var path=require(_0xcdc8('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcdc8('0x8'));module[_0xcdc8('0x9')]=function(_0x4138e1,_0x47f2a4){return _0x4138e1[_0xcdc8('0xa')](_0xcdc8('0xb'),attributes,{'tableName':_0xcdc8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb450=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceTransferReport','lodash','util'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xb450,0x1a0));var _0x0b45=function(_0x42e85c,_0x2dcc47){_0x42e85c=_0x42e85c-0x0;var _0xd3009a=_0xb450[_0x42e85c];return _0xd3009a;};'use strict';var _=require(_0x0b45('0x0'));var util=require(_0x0b45('0x1'));var logger=require(_0x0b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0b45('0x3'));var rp=require(_0x0b45('0x4'));var fs=require('fs');var path=require(_0x0b45('0x5'));var rimraf=require(_0x0b45('0x6'));var config=require(_0x0b45('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x0b45('0x8')]=function(_0x2811d6,_0x46ded4){return _0x2811d6[_0x0b45('0x9')](_0x0b45('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index adaf714..34c4de3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ed0=['options','raw','CreateVoiceTransferReport','catch','util','moment','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','VoiceTransferReport','create','body'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x3ed0,0x1be));var _0x03ed=function(_0x558e45,_0x4f5e4f){_0x558e45=_0x558e45-0x0;var _0x3e9075=_0x3ed0[_0x558e45];return _0x3e9075;};'use strict';var _=require('lodash');var util=require(_0x03ed('0x0'));var moment=require(_0x03ed('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x03ed('0x2'));var logger=require(_0x03ed('0x3'))('rpc');var config=require(_0x03ed('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x03ed('0x5')][_0x03ed('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54db77,_0x35c808,_0x1e4e36){return new BPromise(function(_0xeeb1d3,_0x3bfc55){return client[_0x03ed('0x7')](_0x54db77,_0x1e4e36)[_0x03ed('0x8')](function(_0x3b7ee7){logger['info'](_0x03ed('0x9'),_0x35c808,_0x03ed('0xa'));logger[_0x03ed('0xb')](_0x03ed('0xc'),_0x35c808,_0x03ed('0xa'),JSON[_0x03ed('0xd')](_0x3b7ee7));if(_0x3b7ee7[_0x03ed('0xe')]){if(_0x3b7ee7[_0x03ed('0xe')][_0x03ed('0xf')]===0x1f4){logger['error'](_0x03ed('0x9'),_0x35c808,_0x3b7ee7[_0x03ed('0xe')][_0x03ed('0x10')]);return _0x3bfc55(_0x3b7ee7['error'][_0x03ed('0x10')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x35c808,_0x3b7ee7['error'][_0x03ed('0x10')]);return _0xeeb1d3(_0x3b7ee7[_0x03ed('0xe')][_0x03ed('0x10')]);}else{logger[_0x03ed('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x35c808,_0x03ed('0xa'));_0xeeb1d3(_0x3b7ee7[_0x03ed('0x12')][_0x03ed('0x10')]);}})['catch'](function(_0x17b646){logger['error'](_0x03ed('0x9'),_0x35c808,_0x17b646);_0x3bfc55(_0x17b646);});});}exports['CreateVoiceTransferReport']=function(_0xc6424){var _0x14f392=this;return new Promise(function(_0x354b58,_0x4b833d){return db[_0x03ed('0x13')][_0x03ed('0x14')](_0xc6424[_0x03ed('0x15')],{'raw':_0xc6424[_0x03ed('0x16')]?_0xc6424[_0x03ed('0x16')][_0x03ed('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x103146){logger['info']('CreateVoiceTransferReport',_0xc6424);logger['debug'](_0x03ed('0x18'),_0xc6424,JSON['stringify'](_0x103146));_0x354b58(_0x103146);})[_0x03ed('0x19')](function(_0x2616fb){logger[_0x03ed('0xe')]('CreateVoiceTransferReport',_0x2616fb['message'],_0xc6424);_0x4b833d(_0x14f392['error'](0x1f4,_0x2616fb[_0x03ed('0x10')]));});});};
\ No newline at end of file
+var _0x435e=['info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','then'];(function(_0x283023,_0x3cf4dc){var _0x1a1e78=function(_0x267af3){while(--_0x267af3){_0x283023['push'](_0x283023['shift']());}};_0x1a1e78(++_0x3cf4dc);}(_0x435e,0x1b5));var _0xe435=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x435e[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xe435('0x0'));var util=require(_0xe435('0x1'));var moment=require(_0xe435('0x2'));var BPromise=require(_0xe435('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe435('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe435('0x5'));var logger=require(_0xe435('0x6'))(_0xe435('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe435('0x8')][_0xe435('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x247c96,_0x3a6d65,_0x12280f){return new BPromise(function(_0x1ede31,_0x5acee2){return client['request'](_0x247c96,_0x12280f)[_0xe435('0xa')](function(_0xd81b81){logger[_0xe435('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x3a6d65,'request\x20sent');logger[_0xe435('0xc')](_0xe435('0xd'),_0x3a6d65,_0xe435('0xe'),JSON[_0xe435('0xf')](_0xd81b81));if(_0xd81b81[_0xe435('0x10')]){if(_0xd81b81[_0xe435('0x10')][_0xe435('0x11')]===0x1f4){logger[_0xe435('0x10')](_0xe435('0x12'),_0x3a6d65,_0xd81b81[_0xe435('0x10')][_0xe435('0x13')]);return _0x5acee2(_0xd81b81[_0xe435('0x10')][_0xe435('0x13')]);}logger[_0xe435('0x10')](_0xe435('0x12'),_0x3a6d65,_0xd81b81[_0xe435('0x10')][_0xe435('0x13')]);return _0x1ede31(_0xd81b81[_0xe435('0x10')][_0xe435('0x13')]);}else{logger[_0xe435('0xb')](_0xe435('0x12'),_0x3a6d65,_0xe435('0xe'));_0x1ede31(_0xd81b81[_0xe435('0x14')][_0xe435('0x13')]);}})[_0xe435('0x15')](function(_0x22d112){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x3a6d65,_0x22d112);_0x5acee2(_0x22d112);});});}exports[_0xe435('0x16')]=function(_0x43d1a2){var _0x480726=this;return new Promise(function(_0x777dcb,_0x4fe21f){return db[_0xe435('0x17')][_0xe435('0x18')](_0x43d1a2[_0xe435('0x19')],{'raw':_0x43d1a2[_0xe435('0x1a')]?_0x43d1a2[_0xe435('0x1a')][_0xe435('0x1b')]===undefined?!![]:![]:!![]})[_0xe435('0xa')](function(_0x25eb4e){logger[_0xe435('0xb')](_0xe435('0x16'),_0x43d1a2);logger[_0xe435('0xc')](_0xe435('0x16'),_0x43d1a2,JSON[_0xe435('0xf')](_0x25eb4e));_0x777dcb(_0x25eb4e);})['catch'](function(_0x2c28f2){logger[_0xe435('0x10')](_0xe435('0x16'),_0x2c28f2[_0xe435('0x13')],_0x43d1a2);_0x4fe21f(_0x480726[_0xe435('0x10')](0x1f4,_0x2c28f2[_0xe435('0x13')]));});});};
\ No newline at end of file
index ceaad88..16d2075 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0xab10c3,_0x1334f3){var _0x48d741=function(_0x39cd3a){while(--_0x39cd3a){_0xab10c3['push'](_0xab10c3['shift']());}};_0x48d741(++_0x1334f3);}(_0xe5b3,0x133));var _0x3e5b=function(_0x3453bd,_0x1bfbd1){_0x3453bd=_0x3453bd-0x0;var _0x4f4ea9=_0xe5b3[_0x3453bd];return _0x4f4ea9;};'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
+var _0xb43b=['/transfer','transfer','express','Router','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','hangup','/answer','isAuthenticated','answer','/unhold','unhold'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xb43b,0x1b2));var _0xbb43=function(_0x57cc6d,_0x4cb4f4){_0x57cc6d=_0x57cc6d-0x0;var _0xca1615=_0xb43b[_0x57cc6d];return _0xca1615;};'use strict';var express=require(_0xbb43('0x0'));var router=express[_0xbb43('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbb43('0x2'));router[_0xbb43('0x3')](_0xbb43('0x4'),auth['isAuthenticated'](),auth[_0xbb43('0x5')](),controller[_0xbb43('0x6')]);router[_0xbb43('0x3')](_0xbb43('0x7'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0x8')]);router['post'](_0xbb43('0x9'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xb')]);router[_0xbb43('0x3')]('/hold',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['hold']);router[_0xbb43('0x3')](_0xbb43('0xc'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xd')]);router[_0xbb43('0x3')]('/calls',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['calls']);router['post'](_0xbb43('0xe'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0xf')]);module['exports']=router;
\ No newline at end of file
index 9b8eff1..0c606dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4522=['callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','info','emit','handleError:','error','stack','name','status','send','request','then','code','message','result','catch','User','findOne','agent','all','rows','UserId','length','sessionId\x20','originate','originate\x20fired:','body','json','userId','callNumber'];(function(_0x5055c6,_0x1c68fd){var _0x39cb81=function(_0x17c5d8){while(--_0x17c5d8){_0x5055c6['push'](_0x5055c6['shift']());}};_0x39cb81(++_0x1c68fd);}(_0x4522,0x1a0));var _0x2452=function(_0x492cd4,_0x2a640f){_0x492cd4=_0x492cd4-0x0;var _0x2c73f5=_0x4522[_0x492cd4];return _0x2c73f5;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0x2452('0x0'))['db'];var config=require(_0x2452('0x1'));var util=require(_0x2452('0x2'));var BPromise=require('bluebird');var jayson=require(_0x2452('0x3'));var amiClient=jayson[_0x2452('0x4')][_0x2452('0x5')]({'port':0x232a});var logger=require(_0x2452('0x6'))(_0x2452('0x7'));var Redis=require(_0x2452('0x8'));config[_0x2452('0x9')]=_[_0x2452('0xa')](config[_0x2452('0x9')],{'host':_0x2452('0xb'),'port':0x18eb});var io=require(_0x2452('0xc'))(new Redis(config[_0x2452('0x9')]));var Schema=require(_0x2452('0xd'));var originateValidation=new Schema({'userId':{'type':_0x2452('0xe'),'required':[!![],_0x2452('0xf')]},'callNumber':{'type':_0x2452('0x10'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x2452('0x10')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2452('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2452('0xe'),'required':[!![],_0x2452('0xf')]},'sessionId':{'type':_0x2452('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2452('0xe'),'required':[!![],_0x2452('0xf')]},'sessionId':{'type':_0x2452('0x10'),'required':[!![],_0x2452('0x11')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2452('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x2452('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2452('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2452('0xe'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x2452('0xe'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x3dd8cc,_0x734b88,_0x461d2b){logger[_0x2452('0x12')](_0x3dd8cc,_0x734b88,JSON['stringify'](_0x461d2b));io['to'](_0x3dd8cc)[_0x2452('0x13')](_0x734b88,_0x461d2b);}function handleError(_0x16e33a){return function(_0x59d89a){console['log'](_0x2452('0x14'),_0x59d89a,_0x59d89a instanceof RangeError);logger[_0x2452('0x15')](_0x59d89a[_0x2452('0x16')]);if(_0x59d89a instanceof RangeError){if(_0x59d89a['name']){delete _0x59d89a[_0x2452('0x17')];}_0x16e33a[_0x2452('0x18')](0x194)[_0x2452('0x19')](_0x59d89a);}else{if(_0x59d89a[_0x2452('0x17')]){delete _0x59d89a[_0x2452('0x17')];}_0x16e33a[_0x2452('0x18')](0x1f4)[_0x2452('0x19')](_0x59d89a);}};}function checkError(){return function(_0xea452e){if(!_0xea452e){throw new RangeError('NotFound');}return _0xea452e;};}function respondWithRpcPromise(_0x48f356,_0x1f060d){return new BPromise(function(_0x32dfe7,_0x4bb3ff){var _0x17d0a0=amiClient;return _0x17d0a0[_0x2452('0x1a')](_0x48f356,_0x1f060d)[_0x2452('0x1b')](function(_0x617ba7){if(_0x617ba7[_0x2452('0x15')]){if(_0x617ba7[_0x2452('0x15')][_0x2452('0x1c')]===0x1f4){return _0x4bb3ff(_0x617ba7['error'][_0x2452('0x1d')]);}return _0x32dfe7(_0x617ba7[_0x2452('0x15')][_0x2452('0x1d')]);}else{_0x32dfe7(_0x617ba7[_0x2452('0x1e')]);}})[_0x2452('0x1f')](function(_0x516fcf){_0x4bb3ff(_0x516fcf);});});}function getAgent(_0x48783a){return db[_0x2452('0x20')][_0x2452('0x21')]({'where':{'id':_0x48783a,'role':_0x2452('0x22')}})[_0x2452('0x1b')](checkError());}function getAgentCheckSession(_0x1aac19,_0x48b313){return new BPromise(function(_0x3fba00,_0x118db1){var _0x5e9184=respondWithRpcPromise('VoiceChannels');var _0x332878=getAgent(_0x1aac19);Promise[_0x2452('0x23')]([_0x5e9184,_0x332878])[_0x2452('0x1b')](function(_0x28e6ea){var _0x43fde0=_0x28e6ea[0x0];var _0x258fa6=_0x28e6ea[0x1];var _0x504162=_['filter'](_0x43fde0[_0x2452('0x24')],function(_0x454e0a){return _0x454e0a[_0x2452('0x25')]==_0x258fa6['id']&&_0x454e0a['sessionId']==_0x48b313;});if(_0x504162[_0x2452('0x26')]==0x1){_0x3fba00(_0x258fa6);}else{_0x118db1(new RangeError(_0x2452('0x27')+_0x48b313+'\x20not\x20found!'));}});});}exports[_0x2452('0x28')]=function(_0x450112,_0x37b5e6){logger[_0x2452('0x12')](_0x2452('0x29'),_0x450112[_0x2452('0x2a')]);var _0x312f1b=originateValidation[_0x2452('0xd')](_0x450112[_0x2452('0x2a')]);if(_0x312f1b[_0x2452('0x26')]>0x0){return _0x37b5e6[_0x2452('0x18')](0x190)[_0x2452('0x2b')](_0x312f1b);}var _0x26e841=_0x450112['body'][_0x2452('0x2c')];var _0x1689cd=_0x450112['body'][_0x2452('0x2d')];var _0x48dc9a=_0x450112[_0x2452('0x2a')][_0x2452('0x2e')];var _0x4d6343=_0x450112[_0x2452('0x2a')][_0x2452('0x2f')];return getAgent(_0x26e841)[_0x2452('0x1b')](function(_0x5ce5fb){logger[_0x2452('0x12')](_0x2452('0x30'),_0x5ce5fb['name']);emit(util[_0x2452('0x31')](_0x2452('0x32'),_0x5ce5fb[_0x2452('0x17')]),_0x2452('0x33'),{'callNumber':_0x1689cd,'callerId':_0x48dc9a,'callbackUrl':_0x4d6343});return _0x37b5e6[_0x2452('0x18')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x37b5e6));};exports[_0x2452('0x34')]=function(_0x36bd19,_0x64965c){logger[_0x2452('0x12')](_0x2452('0x35'),_0x36bd19['body']);var _0x22120a=hangupValidation['validate'](_0x36bd19['body']);if(_0x22120a[_0x2452('0x26')]>0x0){return _0x64965c['status'](0x190)[_0x2452('0x2b')](_0x22120a);}var _0xac3b74=_0x36bd19['body'][_0x2452('0x2c')];var _0x2cc8a4=_0x36bd19[_0x2452('0x2a')][_0x2452('0x36')];return getAgent(_0xac3b74)[_0x2452('0x1b')](function(_0x112849){logger[_0x2452('0x12')](_0x2452('0x30'),_0x112849['name']);emit(util[_0x2452('0x31')]('user:%s',_0x112849[_0x2452('0x17')]),_0x2452('0x37'),{'sessionId':_0x2cc8a4});return _0x64965c['status'](0xc8)[_0x2452('0x2b')]({'error':![],'message':_0x2452('0x38')});})[_0x2452('0x1f')](handleError(_0x64965c));};exports[_0x2452('0x39')]=function(_0x3d8bcb,_0x5af887){logger[_0x2452('0x12')](_0x2452('0x3a'),_0x3d8bcb['body']);var _0xfabbd8=answerValidation[_0x2452('0xd')](_0x3d8bcb[_0x2452('0x2a')]);if(_0xfabbd8[_0x2452('0x26')]>0x0){return _0x5af887['status'](0x190)[_0x2452('0x2b')](_0xfabbd8);}var _0x304942=_0x3d8bcb[_0x2452('0x2a')][_0x2452('0x2c')];var _0x40a413=_0x3d8bcb[_0x2452('0x2a')]['sessionId'];return getAgent(_0x304942)[_0x2452('0x1b')](function(_0x5e3364){logger[_0x2452('0x12')](_0x2452('0x30'),_0x5e3364['name']);emit(util['format']('user:%s',_0x5e3364['name']),_0x2452('0x3b'),{'sessionId':_0x40a413});return _0x5af887['status'](0xc8)[_0x2452('0x2b')]({'error':![],'message':'answer\x20executed!'});})[_0x2452('0x1f')](handleError(_0x5af887));};exports[_0x2452('0x3c')]=function(_0x55de3d,_0x4c6b8a){logger[_0x2452('0x12')]('hold\x20fired:',_0x55de3d[_0x2452('0x2a')]);var _0x1cb30a=holdValidation[_0x2452('0xd')](_0x55de3d[_0x2452('0x2a')]);if(_0x1cb30a['length']>0x0){return _0x4c6b8a['status'](0x190)[_0x2452('0x2b')](_0x1cb30a);}var _0x38615e=_0x55de3d[_0x2452('0x2a')][_0x2452('0x2c')];var _0x453373=_0x55de3d['body'][_0x2452('0x36')];return getAgent(_0x38615e)['then'](function(_0x3634f7){logger['info'](_0x2452('0x30'),_0x3634f7[_0x2452('0x17')]);emit(util['format'](_0x2452('0x32'),_0x3634f7['name']),_0x2452('0x3d'),{'sessionId':_0x453373});return _0x4c6b8a['status'](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0x2452('0x1f')](handleError(_0x4c6b8a));};exports[_0x2452('0x3e')]=function(_0x36ebcb,_0x4b705f){logger[_0x2452('0x12')](_0x2452('0x3f'),_0x36ebcb[_0x2452('0x2a')]);var _0x2aeb74=unholdValidation[_0x2452('0xd')](_0x36ebcb['body']);if(_0x2aeb74[_0x2452('0x26')]>0x0){return _0x4b705f['status'](0x190)[_0x2452('0x2b')](_0x2aeb74);}var _0x44a6f=_0x36ebcb[_0x2452('0x2a')][_0x2452('0x2c')];var _0x6ee99d=_0x36ebcb[_0x2452('0x2a')][_0x2452('0x36')];return getAgent(_0x44a6f)[_0x2452('0x1b')](function(_0x3629d3){logger['info'](_0x2452('0x30'),_0x3629d3['name']);emit(util[_0x2452('0x31')]('user:%s',_0x3629d3[_0x2452('0x17')]),_0x2452('0x40'),{'sessionId':_0x6ee99d});return _0x4b705f['status'](0xc8)[_0x2452('0x2b')]({'error':![],'message':_0x2452('0x41')});})[_0x2452('0x1f')](handleError(_0x4b705f));};exports[_0x2452('0x42')]=function(_0x258510,_0x96a22e){logger[_0x2452('0x12')](_0x2452('0x43'),_0x96a22e[_0x2452('0x2a')]);var _0x207df7=callsValidation[_0x2452('0xd')](_0x258510['body']);if(_0x207df7[_0x2452('0x26')]>0x0){return _0x96a22e['status'](0x190)[_0x2452('0x2b')](_0x207df7);}var _0x4959a7=_0x258510[_0x2452('0x2a')][_0x2452('0x2c')];var _0x34966b=respondWithRpcPromise(_0x2452('0x44'));var _0x321092=getAgent(_0x4959a7);return Promise[_0x2452('0x23')]([_0x34966b,_0x321092])[_0x2452('0x1b')](function(_0x34ff4d){var _0x3740b4=_0x34ff4d[0x0];var _0x2d615e=_0x34ff4d[0x1];var _0x1def15=_['filter'](_0x3740b4[_0x2452('0x24')],function(_0x101106){return _0x101106[_0x2452('0x25')]==_0x2d615e['id'];});return _0x96a22e[_0x2452('0x18')](0xc8)[_0x2452('0x2b')]({'count':_0x1def15[_0x2452('0x26')],'rows':_0x1def15});})['catch'](handleError(_0x96a22e));};exports[_0x2452('0x45')]=function(_0x41aba2,_0x4bce9e){logger[_0x2452('0x12')](_0x2452('0x46'),_0x41aba2[_0x2452('0x2a')]);var _0x234468=conferenceValidation[_0x2452('0xd')](_0x41aba2[_0x2452('0x2a')]);if(_0x234468[_0x2452('0x26')]>0x0){return _0x4bce9e[_0x2452('0x18')](0x190)[_0x2452('0x2b')](_0x234468);}var _0x34f31a=_0x41aba2[_0x2452('0x2a')]['userId'];return getAgent(_0x34f31a)['then'](function(_0x288bbc){logger['info'](_0x2452('0x30'),_0x288bbc[_0x2452('0x17')]);emit(util[_0x2452('0x31')](_0x2452('0x32'),_0x288bbc[_0x2452('0x17')]),_0x2452('0x47'));return _0x4bce9e['status'](0xc8)['json']({'error':![],'message':_0x2452('0x48')});})['catch'](handleError(_0x4bce9e));};exports[_0x2452('0x49')]=function(_0x59e9b3,_0x224cc0){logger[_0x2452('0x12')](_0x2452('0x4a'),_0x59e9b3[_0x2452('0x2a')]);var _0x4b9f76=transferValidation['validate'](_0x59e9b3['body']);if(_0x4b9f76[_0x2452('0x26')]>0x0){return _0x224cc0[_0x2452('0x18')](0x190)['json'](_0x4b9f76);}var _0x4f1891=_0x59e9b3['body']['userId'];var _0x4b563d=_0x59e9b3[_0x2452('0x2a')]['sessionId'];var _0x513815=_0x59e9b3[_0x2452('0x2a')][_0x2452('0x4b')];return getAgent(_0x4f1891)[_0x2452('0x1b')](function(_0x6cf3d0){logger[_0x2452('0x12')](_0x2452('0x30'),_0x6cf3d0['name']);emit(util[_0x2452('0x31')](_0x2452('0x32'),_0x6cf3d0[_0x2452('0x17')]),'webbar:transfer',{'sessionId':_0x4b563d,'transferNumber':_0x513815});return _0x224cc0['status'](0xc8)[_0x2452('0x2b')]({'error':![],'message':_0x2452('0x4c')});})[_0x2452('0x1f')](handleError(_0x224cc0));};
\ No newline at end of file
+var _0xc36d=['all','rows','sessionId','length','sessionId\x20','originate','originate\x20fired:','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','filter','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','client','http','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','NotFound','request','then','code','result','catch','User','findOne','agent','VoiceChannels'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc36d,0x7d));var _0xdc36=function(_0xf35bd4,_0x51ff64){_0xf35bd4=_0xf35bd4-0x0;var _0x47912b=_0xc36d[_0xf35bd4];return _0x47912b;};'use strict';var path=require(_0xdc36('0x0'));var fs=require('fs');var _=require(_0xdc36('0x1'));var db=require(_0xdc36('0x2'))['db'];var config=require(_0xdc36('0x3'));var util=require(_0xdc36('0x4'));var BPromise=require(_0xdc36('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0xdc36('0x6')][_0xdc36('0x7')]({'port':0x232a});var logger=require('../../config/logger')(_0xdc36('0x8'));var Redis=require(_0xdc36('0x9'));config[_0xdc36('0xa')]=_[_0xdc36('0xb')](config[_0xdc36('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xdc36('0xc'))(new Redis(config[_0xdc36('0xa')]));var Schema=require(_0xdc36('0xd'));var originateValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xdc36('0xf'),'required':[!![],_0xdc36('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xdc36('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],_0xdc36('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],_0xdc36('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xdc36('0x11')]},'sessionId':{'type':_0xdc36('0xf'),'required':[!![],_0xdc36('0x12')]},'transferNumber':{'type':_0xdc36('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],_0xdc36('0x11')]},'sessionId':{'type':_0xdc36('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],_0xdc36('0x11')]},'sessionId':{'type':_0xdc36('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xdc36('0xe'),'required':[!![],_0xdc36('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xdc36('0x11')]}});function emit(_0x526ac8,_0x4baf2e,_0x59c88f){logger[_0xdc36('0x13')](_0x526ac8,_0x4baf2e,JSON[_0xdc36('0x14')](_0x59c88f));io['to'](_0x526ac8)['emit'](_0x4baf2e,_0x59c88f);}function handleError(_0xd38826){return function(_0x219a73){console[_0xdc36('0x15')](_0xdc36('0x16'),_0x219a73,_0x219a73 instanceof RangeError);logger[_0xdc36('0x17')](_0x219a73[_0xdc36('0x18')]);if(_0x219a73 instanceof RangeError){if(_0x219a73['name']){delete _0x219a73[_0xdc36('0x19')];}_0xd38826[_0xdc36('0x1a')](0x194)['send'](_0x219a73);}else{if(_0x219a73[_0xdc36('0x19')]){delete _0x219a73[_0xdc36('0x19')];}_0xd38826[_0xdc36('0x1a')](0x1f4)['send'](_0x219a73);}};}function checkError(){return function(_0x10aafb){if(!_0x10aafb){throw new RangeError(_0xdc36('0x1b'));}return _0x10aafb;};}function respondWithRpcPromise(_0x5b9891,_0x388b1a){return new BPromise(function(_0x480277,_0x5a6e35){var _0x12f9d8=amiClient;return _0x12f9d8[_0xdc36('0x1c')](_0x5b9891,_0x388b1a)[_0xdc36('0x1d')](function(_0xda916b){if(_0xda916b[_0xdc36('0x17')]){if(_0xda916b[_0xdc36('0x17')][_0xdc36('0x1e')]===0x1f4){return _0x5a6e35(_0xda916b[_0xdc36('0x17')]['message']);}return _0x480277(_0xda916b[_0xdc36('0x17')]['message']);}else{_0x480277(_0xda916b[_0xdc36('0x1f')]);}})[_0xdc36('0x20')](function(_0x15e686){_0x5a6e35(_0x15e686);});});}function getAgent(_0x5c785b){return db[_0xdc36('0x21')][_0xdc36('0x22')]({'where':{'id':_0x5c785b,'role':_0xdc36('0x23')}})['then'](checkError());}function getAgentCheckSession(_0x28a005,_0x2f3b6a){return new BPromise(function(_0x2a596d,_0x5f3b20){var _0x3c39e3=respondWithRpcPromise(_0xdc36('0x24'));var _0x4b15b4=getAgent(_0x28a005);Promise[_0xdc36('0x25')]([_0x3c39e3,_0x4b15b4])[_0xdc36('0x1d')](function(_0x4ea2ad){var _0x21151b=_0x4ea2ad[0x0];var _0x5bba0b=_0x4ea2ad[0x1];var _0x49bbf2=_['filter'](_0x21151b[_0xdc36('0x26')],function(_0x2f2bb4){return _0x2f2bb4['UserId']==_0x5bba0b['id']&&_0x2f2bb4[_0xdc36('0x27')]==_0x2f3b6a;});if(_0x49bbf2[_0xdc36('0x28')]==0x1){_0x2a596d(_0x5bba0b);}else{_0x5f3b20(new RangeError(_0xdc36('0x29')+_0x2f3b6a+'\x20not\x20found!'));}});});}exports[_0xdc36('0x2a')]=function(_0xcfff77,_0x1d010c){logger[_0xdc36('0x13')](_0xdc36('0x2b'),_0xcfff77[_0xdc36('0x2c')]);var _0x1aa877=originateValidation['validate'](_0xcfff77[_0xdc36('0x2c')]);if(_0x1aa877[_0xdc36('0x28')]>0x0){return _0x1d010c['status'](0x190)['json'](_0x1aa877);}var _0x359e7c=_0xcfff77[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x58a899=_0xcfff77['body'][_0xdc36('0x2e')];var _0x1a2261=_0xcfff77[_0xdc36('0x2c')][_0xdc36('0x2f')];var _0x302d69=_0xcfff77[_0xdc36('0x2c')][_0xdc36('0x30')];return getAgent(_0x359e7c)[_0xdc36('0x1d')](function(_0x734ad6){logger[_0xdc36('0x13')](_0xdc36('0x31'),_0x734ad6['name']);emit(util[_0xdc36('0x32')](_0xdc36('0x33'),_0x734ad6[_0xdc36('0x19')]),_0xdc36('0x34'),{'callNumber':_0x58a899,'callerId':_0x1a2261,'callbackUrl':_0x302d69});return _0x1d010c['status'](0xc8)[_0xdc36('0x35')]({'error':![],'message':_0xdc36('0x36')});})[_0xdc36('0x20')](handleError(_0x1d010c));};exports[_0xdc36('0x37')]=function(_0x4c4105,_0x3c8bd5){logger['info']('hangup\x20fired:',_0x4c4105[_0xdc36('0x2c')]);var _0x169c1e=hangupValidation[_0xdc36('0xd')](_0x4c4105['body']);if(_0x169c1e[_0xdc36('0x28')]>0x0){return _0x3c8bd5['status'](0x190)[_0xdc36('0x35')](_0x169c1e);}var _0x34f6be=_0x4c4105[_0xdc36('0x2c')]['userId'];var _0x34fe4d=_0x4c4105[_0xdc36('0x2c')][_0xdc36('0x27')];return getAgent(_0x34f6be)[_0xdc36('0x1d')](function(_0x50cf7b){logger[_0xdc36('0x13')](_0xdc36('0x31'),_0x50cf7b[_0xdc36('0x19')]);emit(util['format']('user:%s',_0x50cf7b[_0xdc36('0x19')]),_0xdc36('0x38'),{'sessionId':_0x34fe4d});return _0x3c8bd5['status'](0xc8)['json']({'error':![],'message':_0xdc36('0x39')});})[_0xdc36('0x20')](handleError(_0x3c8bd5));};exports[_0xdc36('0x3a')]=function(_0x1c0a6c,_0x26fb8c){logger[_0xdc36('0x13')](_0xdc36('0x3b'),_0x1c0a6c[_0xdc36('0x2c')]);var _0x2f4c89=answerValidation[_0xdc36('0xd')](_0x1c0a6c[_0xdc36('0x2c')]);if(_0x2f4c89[_0xdc36('0x28')]>0x0){return _0x26fb8c[_0xdc36('0x1a')](0x190)[_0xdc36('0x35')](_0x2f4c89);}var _0x1f2604=_0x1c0a6c[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x16dcb7=_0x1c0a6c[_0xdc36('0x2c')][_0xdc36('0x27')];return getAgent(_0x1f2604)[_0xdc36('0x1d')](function(_0x608220){logger[_0xdc36('0x13')](_0xdc36('0x31'),_0x608220[_0xdc36('0x19')]);emit(util[_0xdc36('0x32')]('user:%s',_0x608220[_0xdc36('0x19')]),_0xdc36('0x3c'),{'sessionId':_0x16dcb7});return _0x26fb8c['status'](0xc8)['json']({'error':![],'message':_0xdc36('0x3d')});})['catch'](handleError(_0x26fb8c));};exports[_0xdc36('0x3e')]=function(_0x51a276,_0x19c7fe){logger[_0xdc36('0x13')](_0xdc36('0x3f'),_0x51a276[_0xdc36('0x2c')]);var _0x34af88=holdValidation[_0xdc36('0xd')](_0x51a276[_0xdc36('0x2c')]);if(_0x34af88[_0xdc36('0x28')]>0x0){return _0x19c7fe[_0xdc36('0x1a')](0x190)[_0xdc36('0x35')](_0x34af88);}var _0x3c27c7=_0x51a276[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x10d865=_0x51a276[_0xdc36('0x2c')][_0xdc36('0x27')];return getAgent(_0x3c27c7)[_0xdc36('0x1d')](function(_0x3399cc){logger['info']('entityFound:',_0x3399cc[_0xdc36('0x19')]);emit(util[_0xdc36('0x32')](_0xdc36('0x33'),_0x3399cc[_0xdc36('0x19')]),_0xdc36('0x40'),{'sessionId':_0x10d865});return _0x19c7fe[_0xdc36('0x1a')](0xc8)['json']({'error':![],'message':_0xdc36('0x41')});})[_0xdc36('0x20')](handleError(_0x19c7fe));};exports[_0xdc36('0x42')]=function(_0x49f456,_0x2c6856){logger[_0xdc36('0x13')](_0xdc36('0x43'),_0x49f456[_0xdc36('0x2c')]);var _0x3bfc00=unholdValidation[_0xdc36('0xd')](_0x49f456['body']);if(_0x3bfc00[_0xdc36('0x28')]>0x0){return _0x2c6856[_0xdc36('0x1a')](0x190)[_0xdc36('0x35')](_0x3bfc00);}var _0x18272a=_0x49f456[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x26775a=_0x49f456[_0xdc36('0x2c')]['sessionId'];return getAgent(_0x18272a)[_0xdc36('0x1d')](function(_0x5bdc6){logger[_0xdc36('0x13')](_0xdc36('0x31'),_0x5bdc6[_0xdc36('0x19')]);emit(util[_0xdc36('0x32')](_0xdc36('0x33'),_0x5bdc6[_0xdc36('0x19')]),'webbar:unhold',{'sessionId':_0x26775a});return _0x2c6856['status'](0xc8)[_0xdc36('0x35')]({'error':![],'message':_0xdc36('0x44')});})['catch'](handleError(_0x2c6856));};exports[_0xdc36('0x45')]=function(_0xd8af57,_0x502033){logger['info'](_0xdc36('0x46'),_0x502033['body']);var _0x4277b4=callsValidation['validate'](_0xd8af57[_0xdc36('0x2c')]);if(_0x4277b4['length']>0x0){return _0x502033['status'](0x190)[_0xdc36('0x35')](_0x4277b4);}var _0x5d139f=_0xd8af57[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x33b3d2=respondWithRpcPromise(_0xdc36('0x24'));var _0x396a6a=getAgent(_0x5d139f);return Promise['all']([_0x33b3d2,_0x396a6a])[_0xdc36('0x1d')](function(_0x379a72){var _0x42d0a6=_0x379a72[0x0];var _0x4e62c2=_0x379a72[0x1];var _0x4f7bf5=_[_0xdc36('0x47')](_0x42d0a6['rows'],function(_0x3c50ea){return _0x3c50ea[_0xdc36('0x48')]==_0x4e62c2['id'];});return _0x502033[_0xdc36('0x1a')](0xc8)[_0xdc36('0x35')]({'count':_0x4f7bf5['length'],'rows':_0x4f7bf5});})['catch'](handleError(_0x502033));};exports[_0xdc36('0x49')]=function(_0x1d4707,_0x3d8c56){logger[_0xdc36('0x13')](_0xdc36('0x4a'),_0x1d4707[_0xdc36('0x2c')]);var _0x2359bd=conferenceValidation[_0xdc36('0xd')](_0x1d4707[_0xdc36('0x2c')]);if(_0x2359bd[_0xdc36('0x28')]>0x0){return _0x3d8c56['status'](0x190)[_0xdc36('0x35')](_0x2359bd);}var _0x4ea344=_0x1d4707[_0xdc36('0x2c')][_0xdc36('0x2d')];return getAgent(_0x4ea344)[_0xdc36('0x1d')](function(_0x35adec){logger[_0xdc36('0x13')](_0xdc36('0x31'),_0x35adec[_0xdc36('0x19')]);emit(util[_0xdc36('0x32')](_0xdc36('0x33'),_0x35adec[_0xdc36('0x19')]),_0xdc36('0x4b'));return _0x3d8c56[_0xdc36('0x1a')](0xc8)[_0xdc36('0x35')]({'error':![],'message':_0xdc36('0x4c')});})[_0xdc36('0x20')](handleError(_0x3d8c56));};exports[_0xdc36('0x4d')]=function(_0x43e23e,_0x1994c6){logger[_0xdc36('0x13')](_0xdc36('0x4e'),_0x43e23e['body']);var _0x327c04=transferValidation[_0xdc36('0xd')](_0x43e23e[_0xdc36('0x2c')]);if(_0x327c04[_0xdc36('0x28')]>0x0){return _0x1994c6[_0xdc36('0x1a')](0x190)[_0xdc36('0x35')](_0x327c04);}var _0x5ae258=_0x43e23e[_0xdc36('0x2c')][_0xdc36('0x2d')];var _0x52e7f7=_0x43e23e['body'][_0xdc36('0x27')];var _0x271004=_0x43e23e[_0xdc36('0x2c')]['transferNumber'];return getAgent(_0x5ae258)['then'](function(_0x6888a8){logger[_0xdc36('0x13')]('entityFound:',_0x6888a8['name']);emit(util[_0xdc36('0x32')](_0xdc36('0x33'),_0x6888a8[_0xdc36('0x19')]),_0xdc36('0x4f'),{'sessionId':_0x52e7f7,'transferNumber':_0x271004});return _0x1994c6[_0xdc36('0x1a')](0xc8)[_0xdc36('0x35')]({'error':![],'message':_0xdc36('0x50')});})[_0xdc36('0x20')](handleError(_0x1994c6));};
\ No newline at end of file
index 884b9eb..1abec54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c6=['addDisposition','/:id/canned_answers','addAnswer','addAgents','/:id/applications','addApplications','notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','getAnswers','getAgents','post','create'];(function(_0x3cf13,_0x412d45){var _0x432e85=function(_0x17db8c){while(--_0x17db8c){_0x3cf13['push'](_0x3cf13['shift']());}};_0x432e85(++_0x412d45);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x146352,_0x2710a7){_0x146352=_0x146352-0x0;var _0x4bd4fa=_0xc1c6[_0x146352];return _0x4bd4fa;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x6c1c('0x4'));var auth=require(_0x6c1c('0x5'));var interaction=require(_0x6c1c('0x6'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x6c1c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x8')]);router['get'](_0x6c1c('0x9'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x7')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xc')]);router['get'](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xe')]);router[_0x6c1c('0x7')]('/:id/canned_answers',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xf')]);router[_0x6c1c('0x7')]('/:id/users',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x10')]);router[_0x6c1c('0x7')]('/:id/applications',auth[_0x6c1c('0xa')](),controller['getApplications']);router[_0x6c1c('0x11')]('/',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x12')]);router[_0x6c1c('0x11')](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x13')]);router[_0x6c1c('0x11')](_0x6c1c('0x14'),auth['isAuthenticated'](),controller[_0x6c1c('0x15')]);router[_0x6c1c('0x11')]('/:id/users',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x16')]);router['post'](_0x6c1c('0x17'),auth['isAuthenticated'](),controller[_0x6c1c('0x18')]);router[_0x6c1c('0x11')]('/:id/notify',controller[_0x6c1c('0x19')]);router['post'](_0x6c1c('0x1a'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x1b')]);router[_0x6c1c('0x1c')](_0x6c1c('0x1d'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x1e')]);router[_0x6c1c('0x1f')](_0x6c1c('0x1d'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x20')]);router[_0x6c1c('0x1f')](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x21')]);router[_0x6c1c('0x1f')](_0x6c1c('0x14'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x22')]);router[_0x6c1c('0x1f')](_0x6c1c('0x23'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x24')]);module[_0x6c1c('0x25')]=router;
\ No newline at end of file
+var _0xc2c7=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe'];(function(_0x4f8581,_0x4953c0){var _0x62aafb=function(_0x58d6c3){while(--_0x58d6c3){_0x4f8581['push'](_0x4f8581['shift']());}};_0x62aafb(++_0x4953c0);}(_0xc2c7,0x134));var _0x7c2c=function(_0x10fe83,_0x316808){_0x10fe83=_0x10fe83-0x0;var _0x4ce73f=_0xc2c7[_0x10fe83];return _0x4ce73f;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['get'](_0x7c2c('0xe'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xf')]);router[_0x7c2c('0x8')](_0x7c2c('0x10'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x11')]);router[_0x7c2c('0x8')](_0x7c2c('0x12'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x13')]);router[_0x7c2c('0x8')](_0x7c2c('0x14'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x15')]);router[_0x7c2c('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7c2c('0x16')](_0x7c2c('0xe'),auth[_0x7c2c('0x9')](),controller['addDisposition']);router[_0x7c2c('0x16')](_0x7c2c('0x10'),auth['isAuthenticated'](),controller[_0x7c2c('0x17')]);router['post'](_0x7c2c('0x12'),auth['isAuthenticated'](),controller[_0x7c2c('0x18')]);router[_0x7c2c('0x16')](_0x7c2c('0x14'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x19')]);router[_0x7c2c('0x16')](_0x7c2c('0x1a'),controller[_0x7c2c('0x1b')]);router[_0x7c2c('0x16')](_0x7c2c('0x1c'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x1d')]);router['put'](_0x7c2c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x7c2c('0x1e')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x1f')]);router[_0x7c2c('0x1e')](_0x7c2c('0xe'),auth[_0x7c2c('0x9')](),controller['removeDispositions']);router[_0x7c2c('0x1e')]('/:id/canned_answers',auth[_0x7c2c('0x9')](),controller['removeAnswers']);router[_0x7c2c('0x1e')](_0x7c2c('0x12'),auth[_0x7c2c('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 59dcb7e..6dbf37b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc6d=['exports','name','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring'];(function(_0x526c44,_0x2a8796){var _0x2c492a=function(_0x3e8e16){while(--_0x3e8e16){_0x526c44['push'](_0x526c44['shift']());}};_0x2c492a(++_0x2a8796);}(_0xfc6d,0xdf));var _0xdfc6=function(_0x16bed8,_0x20b596){_0x16bed8=_0x16bed8-0x0;var _0x3a85fe=_0xfc6d[_0x16bed8];return _0x3a85fe;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xdfc6('0x0'));module[_0xdfc6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xdfc6('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xdfc6('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xdfc6('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xdfc6('0x3')],'defaultValue':function(){return rs[_0xdfc6('0x4')]();}},'phone':{'type':Sequelize[_0xdfc6('0x3')]},'type':{'type':Sequelize[_0xdfc6('0x5')](_0xdfc6('0x6'),_0xdfc6('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xdfc6('0x3')]},'authToken':{'type':Sequelize[_0xdfc6('0x3')]},'notificationTemplate':{'type':Sequelize[_0xdfc6('0x8')],'defaultValue':function(){return _0xdfc6('0x9');}},'notificationSound':{'type':Sequelize[_0xdfc6('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xdfc6('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdfc6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdfc6('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdfc6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdfc6('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdfc6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xdfc6('0xc')},'mandatoryDisposition':{'type':Sequelize[_0xdfc6('0xa')],'defaultValue':![],'comment':_0xdfc6('0xd'),'set':function(_0x36a13b){if(!_0x36a13b){this[_0xdfc6('0xe')](_0xdfc6('0xf'),null);}this['setDataValue']('mandatoryDisposition',_0x36a13b);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4c72=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}'];(function(_0x487ded,_0x121017){var _0x831a32=function(_0x4e2d30){while(--_0x4e2d30){_0x487ded['push'](_0x487ded['shift']());}};_0x831a32(++_0x121017);}(_0x4c72,0x18d));var _0x24c7=function(_0x308921,_0x2f9e3e){_0x308921=_0x308921-0x0;var _0xb38068=_0x4c72[_0x308921];return _0xb38068;};'use strict';var Sequelize=require(_0x24c7('0x0'));var rs=require(_0x24c7('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x24c7('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x24c7('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x24c7('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x24c7('0x4')]();}},'phone':{'type':Sequelize[_0x24c7('0x3')]},'type':{'type':Sequelize['ENUM']('twilio',_0x24c7('0x5'))},'accountSid':{'type':Sequelize[_0x24c7('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x24c7('0x6')],'defaultValue':function(){return _0x24c7('0x7');}},'notificationSound':{'type':Sequelize[_0x24c7('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x24c7('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x24c7('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x24c7('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x24c7('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x24c7('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x24c7('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x24c7('0x8')],'defaultValue':![],'comment':_0x24c7('0xb'),'set':function(_0x4ed9a9){if(!_0x4ed9a9){this[_0x24c7('0xc')](_0x24c7('0xd'),null);}this['setDataValue'](_0x24c7('0xe'),_0x4ed9a9);}},'description':{'type':Sequelize[_0x24c7('0x3')]}};
\ No newline at end of file
index bffbbb2..bc46b48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f9d=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','options','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','applications','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','whatsapp:','messageId','MessageSid','notifications','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','ListId','CmContact','DESC','list','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','user','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4f9d,0x13c));var _0xd4f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4f9d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd4f9('0x0'));var rimraf=require(_0xd4f9('0x1'));var zipdir=require(_0xd4f9('0x2'));var jsonpatch=require(_0xd4f9('0x3'));var rp=require(_0xd4f9('0x4'));var moment=require(_0xd4f9('0x5'));var BPromise=require(_0xd4f9('0x6'));var Mustache=require('mustache');var util=require(_0xd4f9('0x7'));var path=require(_0xd4f9('0x8'));var sox=require(_0xd4f9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4f9('0xa'));var squel=require(_0xd4f9('0xb'));var crypto=require(_0xd4f9('0xc'));var jsforce=require(_0xd4f9('0xd'));var deskjs=require(_0xd4f9('0xe'));var toCsv=require(_0xd4f9('0xf'));var querystring=require(_0xd4f9('0x10'));var Papa=require(_0xd4f9('0x11'));var Redis=require('ioredis');var authService=require(_0xd4f9('0x12'));var qs=require(_0xd4f9('0x13'));var as=require(_0xd4f9('0x14'));var hardwareService=require(_0xd4f9('0x15'));var logger=require(_0xd4f9('0x16'))('api');var utils=require(_0xd4f9('0x17'));var config=require(_0xd4f9('0x18'));var licenseUtil=require(_0xd4f9('0x19'));var db=require(_0xd4f9('0x1a'))['db'];config[_0xd4f9('0x1b')]=_[_0xd4f9('0x1c')](config[_0xd4f9('0x1b')],{'host':_0xd4f9('0x1d'),'port':0x18eb});var socket=require(_0xd4f9('0x1e'))(new Redis(config[_0xd4f9('0x1b')]));require(_0xd4f9('0x1f'))[_0xd4f9('0x20')](socket);var jayson=require(_0xd4f9('0x21'));var client=jayson[_0xd4f9('0x22')][_0xd4f9('0x23')]({'port':0x232c});function respondWithRpcPromise(_0xf9b684,_0x555a03,_0x4f603c,_0x4d6908){return new BPromise(function(_0x4f4f6c,_0x1e0a29){var _0xf4fb64=_0x4d6908||client;return _0xf4fb64[_0xd4f9('0x24')](_0xf9b684,_0x4f603c)[_0xd4f9('0x25')](function(_0x37fbbd){logger[_0xd4f9('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x555a03,_0xd4f9('0x27'));logger['debug'](_0xd4f9('0x28'),_0x555a03,'request\x20sent',JSON[_0xd4f9('0x29')](_0x37fbbd));if(_0x37fbbd['error']){if(_0x37fbbd[_0xd4f9('0x2a')][_0xd4f9('0x2b')]===0x1f4){logger[_0xd4f9('0x2a')](_0xd4f9('0x2c'),_0x555a03,_0x37fbbd[_0xd4f9('0x2a')][_0xd4f9('0x2d')]);return _0x1e0a29(_0x37fbbd[_0xd4f9('0x2a')][_0xd4f9('0x2d')]);}logger[_0xd4f9('0x2a')](_0xd4f9('0x2c'),_0x555a03,_0x37fbbd['error'][_0xd4f9('0x2d')]);return _0x4f4f6c(_0x37fbbd[_0xd4f9('0x2a')]['message']);}else{logger[_0xd4f9('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x555a03,_0xd4f9('0x27'));_0x4f4f6c(_0x37fbbd['result'][_0xd4f9('0x2d')]);}})[_0xd4f9('0x2e')](function(_0x2bfbd7){logger[_0xd4f9('0x2a')](_0xd4f9('0x2c'),_0x555a03,_0x2bfbd7);_0x1e0a29(_0x2bfbd7);});});}function respondWithStatusCode(_0x1af934,_0xa461f0){_0xa461f0=_0xa461f0||0xcc;return function(_0x232492){if(_0x232492){return _0x1af934[_0xd4f9('0x2f')](_0xa461f0);}return _0x1af934[_0xd4f9('0x30')](_0xa461f0)[_0xd4f9('0x31')]();};}function respondWithResult(_0xd7d6e,_0x18ff0e){_0x18ff0e=_0x18ff0e||0xc8;return function(_0x5a36fa){if(_0x5a36fa){return _0xd7d6e['status'](_0x18ff0e)[_0xd4f9('0x32')](_0x5a36fa);}};}function respondWithFilteredResult(_0x4328e5,_0x39523e){return function(_0x7b677){if(_0x7b677){var _0x6d76c0=typeof _0x39523e['offset']===_0xd4f9('0x33')&&typeof _0x39523e[_0xd4f9('0x34')]===_0xd4f9('0x33');var _0x4182a9=_0x7b677[_0xd4f9('0x35')];var _0x12f99e=_0x6d76c0?0x0:_0x39523e[_0xd4f9('0x36')];var _0x3a5669=_0x6d76c0?_0x7b677['count']:_0x39523e[_0xd4f9('0x36')]+_0x39523e['limit'];var _0x4beb74;if(_0x3a5669>=_0x4182a9){_0x3a5669=_0x4182a9;_0x4beb74=0xc8;}else{_0x4beb74=0xce;}_0x4328e5[_0xd4f9('0x30')](_0x4beb74);return _0x4328e5[_0xd4f9('0x37')]('Content-Range',_0x12f99e+'-'+_0x3a5669+'/'+_0x4182a9)[_0xd4f9('0x32')](_0x7b677);}return null;};}function patchUpdates(_0x3899b6){return function(_0x798f1b){try{jsonpatch[_0xd4f9('0x38')](_0x798f1b,_0x3899b6,!![]);}catch(_0x3ec9a9){return BPromise[_0xd4f9('0x39')](_0x3ec9a9);}return _0x798f1b[_0xd4f9('0x3a')]();};}function saveUpdates(_0x6a017e,_0x455034){return function(_0x2f85c2){if(_0x2f85c2){return _0x2f85c2[_0xd4f9('0x3b')](_0x6a017e)[_0xd4f9('0x25')](function(_0x364ce7){return _0x364ce7;});}return null;};}function removeEntity(_0x1a2588,_0x4d4bf0){return function(_0x3b21ee){if(_0x3b21ee){return _0x3b21ee[_0xd4f9('0x3c')]()[_0xd4f9('0x25')](function(){var _0xfc3f45=_0x3b21ee[_0xd4f9('0x3d')]({'plain':!![]});var _0x1b9fc3=_0xd4f9('0x3e');return db[_0xd4f9('0x3f')][_0xd4f9('0x3c')]({'where':{'type':_0x1b9fc3,'resourceId':_0xfc3f45['id']}})[_0xd4f9('0x25')](function(){return _0x3b21ee;});})[_0xd4f9('0x25')](function(){_0x1a2588[_0xd4f9('0x30')](0xcc)[_0xd4f9('0x31')]();});}};}function handleEntityNotFound(_0x5f0097,_0x90ea3f){return function(_0x4aae74){if(!_0x4aae74){_0x5f0097['sendStatus'](0x194);}return _0x4aae74;};}function handleError(_0x162cfe,_0x2798cc){_0x2798cc=_0x2798cc||0x1f4;return function(_0x25decc){logger['error'](_0x25decc['stack']);if(_0x25decc[_0xd4f9('0x40')]){delete _0x25decc[_0xd4f9('0x40')];}_0x162cfe['status'](_0x2798cc)['send'](_0x25decc);};}exports[_0xd4f9('0x41')]=function(_0x39a527,_0x3b1d20){var _0x4ee661={'include':[{'model':db[_0xd4f9('0x42')],'as':_0xd4f9('0x43')}]},_0xca5f90={},_0x3c618c={'count':0x0,'rows':[]};var _0x18e970=_[_0xd4f9('0x44')](db[_0xd4f9('0x45')][_0xd4f9('0x46')],function(_0xdeadc9){return{'name':_0xdeadc9[_0xd4f9('0x47')],'type':_0xdeadc9[_0xd4f9('0x48')][_0xd4f9('0x49')]};});_0xca5f90[_0xd4f9('0x4a')]=_[_0xd4f9('0x44')](_0x18e970,_0xd4f9('0x40'));_0xca5f90[_0xd4f9('0x4b')]=_[_0xd4f9('0x4c')](_0x39a527[_0xd4f9('0x4b')]);_0xca5f90[_0xd4f9('0x4d')]=_['intersection'](_0xca5f90[_0xd4f9('0x4a')],_0xca5f90[_0xd4f9('0x4b')]);_0x4ee661['attributes']=_[_0xd4f9('0x4e')](_0xca5f90[_0xd4f9('0x4a')],qs[_0xd4f9('0x4f')](_0x39a527[_0xd4f9('0x4b')][_0xd4f9('0x4f')]));_0x4ee661['attributes']=_0x4ee661[_0xd4f9('0x50')][_0xd4f9('0x51')]?_0x4ee661[_0xd4f9('0x50')]:_0xca5f90['model'];if(!_0x39a527[_0xd4f9('0x4b')][_0xd4f9('0x52')](_0xd4f9('0x53'))){_0x4ee661[_0xd4f9('0x34')]=qs[_0xd4f9('0x34')](_0x39a527[_0xd4f9('0x4b')]['limit']);_0x4ee661['offset']=qs[_0xd4f9('0x36')](_0x39a527['query'][_0xd4f9('0x36')]);}_0x4ee661[_0xd4f9('0x54')]=qs[_0xd4f9('0x55')](_0x39a527[_0xd4f9('0x4b')][_0xd4f9('0x55')]);_0x4ee661[_0xd4f9('0x56')]=qs['filters'](_[_0xd4f9('0x57')](_0x39a527[_0xd4f9('0x4b')],_0xca5f90[_0xd4f9('0x4d')]),_0x18e970);if(_0x39a527[_0xd4f9('0x4b')][_0xd4f9('0x58')]){_0x4ee661['where']=_[_0xd4f9('0x59')](_0x4ee661[_0xd4f9('0x56')],{'$or':_[_0xd4f9('0x44')](_0x18e970,function(_0x12cf8e){if(_0x12cf8e[_0xd4f9('0x48')]!==_0xd4f9('0x5a')){var _0x3ccad6={};_0x3ccad6[_0x12cf8e[_0xd4f9('0x40')]]={'$like':'%'+_0x39a527[_0xd4f9('0x4b')][_0xd4f9('0x58')]+'%'};return _0x3ccad6;}})});}_0x4ee661=_[_0xd4f9('0x59')]({},_0x4ee661,_0x39a527['options']);var _0xdde1a2={'where':_0x4ee661[_0xd4f9('0x56')]};return db[_0xd4f9('0x45')]['count'](_0xdde1a2)[_0xd4f9('0x25')](function(_0x5a0321){_0x3c618c[_0xd4f9('0x35')]=_0x5a0321;if(_0x39a527[_0xd4f9('0x4b')][_0xd4f9('0x5b')]){_0x4ee661[_0xd4f9('0x5c')]=[{'all':!![]}];}return db[_0xd4f9('0x45')][_0xd4f9('0x5d')](_0x4ee661);})['then'](function(_0x53c10a){_0x3c618c[_0xd4f9('0x5e')]=_0x53c10a;return _0x3c618c;})['then'](respondWithFilteredResult(_0x3b1d20,_0x4ee661))[_0xd4f9('0x2e')](handleError(_0x3b1d20,null));};exports['show']=function(_0x2581d6,_0x15cd66){var _0x5d5c5b={'raw':![],'where':{'id':_0x2581d6[_0xd4f9('0x5f')]['id']},'include':[{'model':db[_0xd4f9('0x42')],'as':_0xd4f9('0x43')}]},_0x2d4d35={};_0x2d4d35[_0xd4f9('0x4a')]=_[_0xd4f9('0x4c')](db[_0xd4f9('0x45')][_0xd4f9('0x46')]);_0x2d4d35['query']=_[_0xd4f9('0x4c')](_0x2581d6[_0xd4f9('0x4b')]);_0x2d4d35[_0xd4f9('0x4d')]=_[_0xd4f9('0x4e')](_0x2d4d35['model'],_0x2d4d35[_0xd4f9('0x4b')]);_0x5d5c5b['attributes']=_['intersection'](_0x2d4d35[_0xd4f9('0x4a')],qs['fields'](_0x2581d6[_0xd4f9('0x4b')][_0xd4f9('0x4f')]));_0x5d5c5b[_0xd4f9('0x50')]=_0x5d5c5b['attributes'][_0xd4f9('0x51')]?_0x5d5c5b[_0xd4f9('0x50')]:_0x2d4d35[_0xd4f9('0x4a')];if(_0x2581d6[_0xd4f9('0x4b')]['includeAll']){_0x5d5c5b[_0xd4f9('0x5c')]=[{'all':!![]}];}_0x5d5c5b=_[_0xd4f9('0x59')]({},_0x5d5c5b,_0x2581d6['options']);return db['WhatsappAccount']['find'](_0x5d5c5b)[_0xd4f9('0x25')](handleEntityNotFound(_0x15cd66,null))['then'](respondWithResult(_0x15cd66,null))[_0xd4f9('0x2e')](handleError(_0x15cd66,null));};exports[_0xd4f9('0x60')]=function(_0xc05428,_0x247b4b){return db[_0xd4f9('0x45')][_0xd4f9('0x60')](_0xc05428['body'],{})[_0xd4f9('0x25')](function(_0x471312){var _0x1f8ede=_0xc05428['user']['get']({'plain':!![]});if(!_0x1f8ede)throw new Error(_0xd4f9('0x61'));if(_0x1f8ede[_0xd4f9('0x62')]==='user'){var _0x2fa2d2=_0x471312['get']({'plain':!![]});var _0x4a8035='WhatsappAccounts';return db['UserProfileSection'][_0xd4f9('0x63')]({'where':{'name':_0x4a8035,'userProfileId':_0x1f8ede[_0xd4f9('0x64')]},'raw':!![]})[_0xd4f9('0x25')](function(_0x1aa7f2){if(_0x1aa7f2&&_0x1aa7f2['autoAssociation']===0x0){return db[_0xd4f9('0x3f')]['create']({'name':_0x2fa2d2[_0xd4f9('0x40')],'resourceId':_0x2fa2d2['id'],'type':_0x1aa7f2['name'],'sectionId':_0x1aa7f2['id']},{})[_0xd4f9('0x25')](function(){return _0x471312;});}else{return _0x471312;}})[_0xd4f9('0x2e')](function(_0x5e189d){logger[_0xd4f9('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e189d);throw _0x5e189d;});}return _0x471312;})[_0xd4f9('0x25')](respondWithResult(_0x247b4b,0xc9))[_0xd4f9('0x2e')](handleError(_0x247b4b,null));};exports['update']=function(_0x41bfaf,_0x4b9d62){if(_0x41bfaf[_0xd4f9('0x65')]['id']){delete _0x41bfaf[_0xd4f9('0x65')]['id'];}return db[_0xd4f9('0x45')]['find']({'where':{'id':_0x41bfaf[_0xd4f9('0x5f')]['id']},'include':[{'model':db[_0xd4f9('0x42')],'as':_0xd4f9('0x43')}]})[_0xd4f9('0x25')](handleEntityNotFound(_0x4b9d62,null))[_0xd4f9('0x25')](saveUpdates(_0x41bfaf[_0xd4f9('0x65')],null))[_0xd4f9('0x25')](respondWithResult(_0x4b9d62,null))[_0xd4f9('0x2e')](handleError(_0x4b9d62,null));};exports[_0xd4f9('0x3c')]=function(_0x103339,_0x3bb5d4){return db[_0xd4f9('0x45')][_0xd4f9('0x63')]({'where':{'id':_0x103339['params']['id']}})[_0xd4f9('0x25')](handleEntityNotFound(_0x3bb5d4,null))[_0xd4f9('0x25')](removeEntity(_0x3bb5d4,null))[_0xd4f9('0x2e')](handleError(_0x3bb5d4,null));};exports[_0xd4f9('0x66')]=function(_0x46bd0f,_0x99338f){return db[_0xd4f9('0x45')][_0xd4f9('0x66')]()[_0xd4f9('0x25')](respondWithResult(_0x99338f,null))[_0xd4f9('0x2e')](handleError(_0x99338f,null));};exports[_0xd4f9('0x67')]=function(_0x4b24c7,_0x4ee590,_0x2e0f40){if(_0x4b24c7[_0xd4f9('0x65')]['id']){delete _0x4b24c7['body']['id'];}return db[_0xd4f9('0x45')]['find']({'where':{'id':_0x4b24c7[_0xd4f9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4ee590,null))['then'](function(_0x1687fd){if(_0x1687fd){_0x4b24c7['body'][_0xd4f9('0x68')]=_0x1687fd['id'];return db[_0xd4f9('0x69')][_0xd4f9('0x60')](_0x4b24c7[_0xd4f9('0x65')]);}})[_0xd4f9('0x25')](respondWithResult(_0x4ee590,null))[_0xd4f9('0x2e')](handleError(_0x4ee590,null));};exports[_0xd4f9('0x6a')]=function(_0x5c53c1,_0x2b11e5,_0x1cd95d){var _0x330a78={'raw':![],'where':{}};var _0x180639={};var _0x5793b6={'count':0x0,'rows':[]};return db[_0xd4f9('0x45')][_0xd4f9('0x6b')]({'where':{'id':_0x5c53c1['params']['id']}})[_0xd4f9('0x25')](handleEntityNotFound(_0x2b11e5,null))['then'](function(_0x499f41){if(_0x499f41){_0x180639['model']=_[_0xd4f9('0x4c')](db[_0xd4f9('0x69')][_0xd4f9('0x46')]);_0x180639[_0xd4f9('0x4b')]=_[_0xd4f9('0x4c')](_0x5c53c1['query']);_0x180639[_0xd4f9('0x4d')]=_[_0xd4f9('0x4e')](_0x180639[_0xd4f9('0x4a')],_0x180639[_0xd4f9('0x4b')]);_0x330a78['attributes']=_[_0xd4f9('0x4e')](_0x180639['model'],qs['fields'](_0x5c53c1[_0xd4f9('0x4b')][_0xd4f9('0x4f')]));_0x330a78[_0xd4f9('0x50')]=_0x330a78[_0xd4f9('0x50')][_0xd4f9('0x51')]?_0x330a78['attributes']:_0x180639['model'];if(!_0x5c53c1[_0xd4f9('0x4b')][_0xd4f9('0x52')](_0xd4f9('0x53'))){_0x330a78[_0xd4f9('0x34')]=qs[_0xd4f9('0x34')](_0x5c53c1['query'][_0xd4f9('0x34')]);_0x330a78['offset']=qs[_0xd4f9('0x36')](_0x5c53c1[_0xd4f9('0x4b')]['offset']);}_0x330a78['order']=qs[_0xd4f9('0x55')](_0x5c53c1[_0xd4f9('0x4b')]['sort']);_0x330a78[_0xd4f9('0x56')]=qs[_0xd4f9('0x4d')](_['pick'](_0x5c53c1['query'],_0x180639['filters']));_0x330a78[_0xd4f9('0x56')]['WhatsappAccountId']=_0x499f41['id'];if(_0x5c53c1[_0xd4f9('0x4b')]['filter']){_0x330a78['where']=_[_0xd4f9('0x59')](_0x330a78[_0xd4f9('0x56')],{'$or':_['map'](_0x330a78[_0xd4f9('0x50')],function(_0x197001){var _0x5a276a={};_0x5a276a[_0x197001]={'$like':'%'+_0x5c53c1[_0xd4f9('0x4b')][_0xd4f9('0x58')]+'%'};return _0x5a276a;})});}_0x330a78=_[_0xd4f9('0x59')]({},_0x330a78,_0x5c53c1[_0xd4f9('0x6c')]);return db[_0xd4f9('0x69')][_0xd4f9('0x35')]({'where':_0x330a78[_0xd4f9('0x56')]})[_0xd4f9('0x25')](function(_0x80d1d){_0x5793b6[_0xd4f9('0x35')]=_0x80d1d;if(_0x5c53c1[_0xd4f9('0x4b')][_0xd4f9('0x5b')]){_0x330a78['include']=[{'all':!![]}];}return db[_0xd4f9('0x69')][_0xd4f9('0x5d')](_0x330a78);})[_0xd4f9('0x25')](function(_0x2d0728){_0x5793b6[_0xd4f9('0x5e')]=_0x2d0728;return _0x5793b6;});}})['then'](respondWithFilteredResult(_0x2b11e5,_0x330a78))['catch'](handleError(_0x2b11e5,null));};exports[_0xd4f9('0x6d')]=function(_0x36f6a9,_0x3a4f6b,_0x660108){return db[_0xd4f9('0x45')][_0xd4f9('0x63')]({'where':{'id':_0x36f6a9[_0xd4f9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3a4f6b,null))[_0xd4f9('0x25')](function(_0xc719a8){if(_0xc719a8){return _0xc719a8[_0xd4f9('0x6d')](_0x36f6a9[_0xd4f9('0x4b')][_0xd4f9('0x6e')]);}})[_0xd4f9('0x25')](respondWithStatusCode(_0x3a4f6b,null))[_0xd4f9('0x2e')](handleError(_0x3a4f6b,null));};exports['addAnswer']=function(_0x4fbf44,_0x381986,_0x495fcb){if(_0x4fbf44[_0xd4f9('0x65')]['id']){delete _0x4fbf44['body']['id'];}return db[_0xd4f9('0x45')]['find']({'where':{'id':_0x4fbf44['params']['id']}})['then'](handleEntityNotFound(_0x381986,null))[_0xd4f9('0x25')](function(_0x18c680){if(_0x18c680){_0x4fbf44['body']['WhatsappAccountId']=_0x18c680['id'];return db[_0xd4f9('0x6f')][_0xd4f9('0x60')](_0x4fbf44['body']);}})[_0xd4f9('0x25')](respondWithResult(_0x381986,null))['catch'](handleError(_0x381986,null));};exports[_0xd4f9('0x70')]=function(_0x2d2916,_0x10a26c,_0x1dc8c9){var _0x1ec853={'raw':![],'where':{}};var _0x3506c3={};var _0x37dd89={'count':0x0,'rows':[]};return db[_0xd4f9('0x45')][_0xd4f9('0x6b')]({'where':{'id':_0x2d2916['params']['id']}})[_0xd4f9('0x25')](handleEntityNotFound(_0x10a26c,null))[_0xd4f9('0x25')](function(_0x1cadf8){if(_0x1cadf8){_0x3506c3[_0xd4f9('0x4a')]=_[_0xd4f9('0x4c')](db[_0xd4f9('0x6f')][_0xd4f9('0x46')]);_0x3506c3[_0xd4f9('0x4b')]=_[_0xd4f9('0x4c')](_0x2d2916[_0xd4f9('0x4b')]);_0x3506c3['filters']=_['intersection'](_0x3506c3[_0xd4f9('0x4a')],_0x3506c3[_0xd4f9('0x4b')]);_0x1ec853[_0xd4f9('0x50')]=_[_0xd4f9('0x4e')](_0x3506c3[_0xd4f9('0x4a')],qs[_0xd4f9('0x4f')](_0x2d2916[_0xd4f9('0x4b')][_0xd4f9('0x4f')]));_0x1ec853['attributes']=_0x1ec853[_0xd4f9('0x50')][_0xd4f9('0x51')]?_0x1ec853[_0xd4f9('0x50')]:_0x3506c3['model'];if(!_0x2d2916['query'][_0xd4f9('0x52')]('nolimit')){_0x1ec853[_0xd4f9('0x34')]=qs[_0xd4f9('0x34')](_0x2d2916[_0xd4f9('0x4b')]['limit']);_0x1ec853['offset']=qs[_0xd4f9('0x36')](_0x2d2916[_0xd4f9('0x4b')][_0xd4f9('0x36')]);}_0x1ec853[_0xd4f9('0x54')]=qs[_0xd4f9('0x55')](_0x2d2916['query'][_0xd4f9('0x55')]);_0x1ec853['where']=qs[_0xd4f9('0x4d')](_[_0xd4f9('0x57')](_0x2d2916[_0xd4f9('0x4b')],_0x3506c3[_0xd4f9('0x4d')]));_0x1ec853[_0xd4f9('0x56')]['WhatsappAccountId']=_0x1cadf8['id'];if(_0x2d2916[_0xd4f9('0x4b')][_0xd4f9('0x58')]){_0x1ec853[_0xd4f9('0x56')]=_['merge'](_0x1ec853[_0xd4f9('0x56')],{'$or':_['map'](_0x1ec853[_0xd4f9('0x50')],function(_0x45aa06){var _0x348525={};_0x348525[_0x45aa06]={'$like':'%'+_0x2d2916[_0xd4f9('0x4b')][_0xd4f9('0x58')]+'%'};return _0x348525;})});}_0x1ec853=_[_0xd4f9('0x59')]({},_0x1ec853,_0x2d2916[_0xd4f9('0x6c')]);return db[_0xd4f9('0x6f')][_0xd4f9('0x35')]({'where':_0x1ec853[_0xd4f9('0x56')]})[_0xd4f9('0x25')](function(_0x14a61a){_0x37dd89[_0xd4f9('0x35')]=_0x14a61a;if(_0x2d2916[_0xd4f9('0x4b')]['includeAll']){_0x1ec853[_0xd4f9('0x5c')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd4f9('0x5d')](_0x1ec853);})[_0xd4f9('0x25')](function(_0x23a7cd){_0x37dd89[_0xd4f9('0x5e')]=_0x23a7cd;return _0x37dd89;});}})[_0xd4f9('0x25')](respondWithFilteredResult(_0x10a26c,_0x1ec853))['catch'](handleError(_0x10a26c,null));};exports[_0xd4f9('0x71')]=function(_0x2cc76b,_0x1099ff,_0x2d3781){return db[_0xd4f9('0x45')][_0xd4f9('0x63')]({'where':{'id':_0x2cc76b[_0xd4f9('0x5f')]['id']}})[_0xd4f9('0x25')](handleEntityNotFound(_0x1099ff,null))[_0xd4f9('0x25')](function(_0x2925b0){if(_0x2925b0){return _0x2925b0[_0xd4f9('0x71')](_0x2cc76b[_0xd4f9('0x4b')][_0xd4f9('0x6e')]);}})[_0xd4f9('0x25')](respondWithStatusCode(_0x1099ff,null))['catch'](handleError(_0x1099ff,null));};exports[_0xd4f9('0x72')]=function(_0xd33c04,_0x1d7433,_0x4bbf86){return db[_0xd4f9('0x45')]['find']({'where':{'id':_0xd33c04[_0xd4f9('0x5f')]['id']}})[_0xd4f9('0x25')](handleEntityNotFound(_0x1d7433,null))[_0xd4f9('0x25')](function(_0x372c40){if(_0x372c40){return _0x372c40['addAgents'](_0xd33c04[_0xd4f9('0x65')]['ids'],_[_0xd4f9('0x73')](_0xd33c04[_0xd4f9('0x65')],['ids','id'])||{})['spread'](function(_0x5afd67){for(var _0x2db468=0x0;_0x2db468<_0xd33c04[_0xd4f9('0x65')]['ids'][_0xd4f9('0x51')];_0x2db468+=0x1){socket[_0xd4f9('0x74')](_0xd4f9('0x75'),{'UserId':Number(_0xd33c04[_0xd4f9('0x65')][_0xd4f9('0x6e')][_0x2db468]),'WhatsappAccountId':Number(_0xd33c04[_0xd4f9('0x5f')]['id'])});}return _0x5afd67;});}})['then'](respondWithResult(_0x1d7433,null))[_0xd4f9('0x2e')](handleError(_0x1d7433,null));};exports[_0xd4f9('0x76')]=function(_0x54574d,_0x13a05b,_0x4b572a){return db['WhatsappAccount'][_0xd4f9('0x63')]({'where':{'id':_0x54574d['params']['id']}})[_0xd4f9('0x25')](handleEntityNotFound(_0x13a05b,null))[_0xd4f9('0x25')](function(_0x186470){if(_0x186470){return _0x186470[_0xd4f9('0x76')](_0x54574d['query'][_0xd4f9('0x6e')])[_0xd4f9('0x25')](function(){if(_[_0xd4f9('0x77')](_0x54574d[_0xd4f9('0x4b')][_0xd4f9('0x6e')])){for(var _0xe9a0bb=0x0;_0xe9a0bb<_0x54574d['query'][_0xd4f9('0x6e')]['length'];_0xe9a0bb+=0x1){socket[_0xd4f9('0x74')](_0xd4f9('0x78'),{'UserId':Number(_0x54574d[_0xd4f9('0x4b')][_0xd4f9('0x6e')][_0xe9a0bb]),'WhatsappAccountId':Number(_0x54574d['params']['id'])});}}else{socket[_0xd4f9('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x54574d[_0xd4f9('0x4b')]['ids']),'WhatsappAccountId':Number(_0x54574d[_0xd4f9('0x5f')]['id'])});}});}})[_0xd4f9('0x25')](respondWithStatusCode(_0x13a05b,null))['catch'](handleError(_0x13a05b,null));};exports['getAgents']=function(_0x460b91,_0x24663d,_0xbaefc){var _0xc6d7bc={};var _0x570289={};var _0x398b68;var _0x1962af;return db[_0xd4f9('0x45')][_0xd4f9('0x6b')]({'where':{'id':_0x460b91['params']['id']}})[_0xd4f9('0x25')](handleEntityNotFound(_0x24663d,null))[_0xd4f9('0x25')](function(_0x460a12){if(_0x460a12){_0x398b68=_0x460a12;_0x570289[_0xd4f9('0x4a')]=_[_0xd4f9('0x4c')](db[_0xd4f9('0x79')]['rawAttributes']);_0x570289[_0xd4f9('0x4b')]=_['keys'](_0x460b91[_0xd4f9('0x4b')]);_0x570289['filters']=_['intersection'](_0x570289['model'],_0x570289[_0xd4f9('0x4b')]);_0xc6d7bc[_0xd4f9('0x50')]=_[_0xd4f9('0x4e')](_0x570289[_0xd4f9('0x4a')],qs[_0xd4f9('0x4f')](_0x460b91[_0xd4f9('0x4b')][_0xd4f9('0x4f')]));_0xc6d7bc['attributes']=_0xc6d7bc['attributes'][_0xd4f9('0x51')]?_0xc6d7bc['attributes']:_0x570289['model'];_0xc6d7bc[_0xd4f9('0x54')]=qs[_0xd4f9('0x55')](_0x460b91[_0xd4f9('0x4b')][_0xd4f9('0x55')]);_0xc6d7bc[_0xd4f9('0x56')]=qs[_0xd4f9('0x4d')](_[_0xd4f9('0x57')](_0x460b91['query'],_0x570289[_0xd4f9('0x4d')]));if(_0x460b91[_0xd4f9('0x4b')][_0xd4f9('0x58')]){_0xc6d7bc[_0xd4f9('0x56')]=_[_0xd4f9('0x59')](_0xc6d7bc['where'],{'$or':_[_0xd4f9('0x44')](_0xc6d7bc[_0xd4f9('0x50')],function(_0x4341f7){var _0x14f7c9={};_0x14f7c9[_0x4341f7]={'$like':'%'+_0x460b91[_0xd4f9('0x4b')][_0xd4f9('0x58')]+'%'};return _0x14f7c9;})});}_0xc6d7bc=_[_0xd4f9('0x59')]({},_0xc6d7bc,_0x460b91['options']);return _0x398b68[_0xd4f9('0x7a')](_0xc6d7bc);}})[_0xd4f9('0x25')](function(_0x3c8e55){if(_0x3c8e55){_0x1962af=_0x3c8e55[_0xd4f9('0x51')];if(!_0x460b91['query'][_0xd4f9('0x52')](_0xd4f9('0x53'))){_0xc6d7bc[_0xd4f9('0x34')]=qs[_0xd4f9('0x34')](_0x460b91[_0xd4f9('0x4b')]['limit']);_0xc6d7bc['offset']=qs[_0xd4f9('0x36')](_0x460b91[_0xd4f9('0x4b')][_0xd4f9('0x36')]);}return _0x398b68[_0xd4f9('0x7a')](_0xc6d7bc);}})['then'](function(_0x480762){if(_0x480762){return _0x480762?{'count':_0x1962af,'rows':_0x480762}:null;}})[_0xd4f9('0x25')](respondWithResult(_0x24663d,null))[_0xd4f9('0x2e')](handleError(_0x24663d,null));};exports[_0xd4f9('0x7b')]=function(_0x5b8ecc,_0x17f869){var _0x256835=_0x5b8ecc['params']['id'];var _0x50ca5f=_0x5b8ecc[_0xd4f9('0x65')];var _0x4bd7af=0xc8;var _0x4ff1fe=null;return db[_0xd4f9('0x7c')][_0xd4f9('0x7d')]({'isolationLevel':db[_0xd4f9('0x7c')][_0xd4f9('0x7e')][_0xd4f9('0x7f')][_0xd4f9('0x80')]},function(_0x28ebef){return db[_0xd4f9('0x45')][_0xd4f9('0x6b')]({'where':{'id':_0x256835},'transaction':_0x28ebef})[_0xd4f9('0x25')](function(_0x1f1cf2){if(_0x1f1cf2){return db['WhatsappApplication'][_0xd4f9('0x3c')]({'where':{'WhatsappAccountId':_0x256835},'transaction':_0x28ebef})[_0xd4f9('0x25')](function(){var _0x444e39=_[_0xd4f9('0x44')](_0x50ca5f,function(_0xa52847){_0xa52847[_0xd4f9('0x68')]=_0x256835;return _0xa52847;});return db[_0xd4f9('0x81')][_0xd4f9('0x82')](_0x444e39,{'transaction':_0x28ebef});});}else{_0x4bd7af=0x194;_0x4ff1fe=[];}});})[_0xd4f9('0x25')](function(){if(_0x4bd7af!==0x194){return db[_0xd4f9('0x81')][_0xd4f9('0x83')]({'where':{'WhatsappAccountId':_0x256835},'order':_0xd4f9('0x84')})['then'](function(_0x3db4c6){_0x4ff1fe=_0x3db4c6;});}})['catch'](function(_0x1bc05b){_0x4bd7af=0x1f4;logger[_0xd4f9('0x2a')](_0x1bc05b[_0xd4f9('0x85')]);if(_0x1bc05b[_0xd4f9('0x40')]){delete _0x1bc05b[_0xd4f9('0x40')];}_0x4ff1fe=_0x1bc05b;})[_0xd4f9('0x86')](function(){if(_0x4ff1fe===null){_0x17f869[_0xd4f9('0x2f')](_0x4bd7af);}else{if(_0x4bd7af===0x1f4){_0x17f869[_0xd4f9('0x30')](_0x4bd7af)['send'](_0x4ff1fe);}else{_0x17f869[_0xd4f9('0x30')](_0x4bd7af)[_0xd4f9('0x32')](_0x4ff1fe);}}});};exports[_0xd4f9('0x87')]=function(_0x2e56f6,_0x18c0fa,_0x92ec76){var _0x2c9295={};var _0x57eb07={};var _0x3c0b63;var _0x1e74a6;return db[_0xd4f9('0x45')][_0xd4f9('0x6b')]({'where':{'id':_0x2e56f6['params']['id']}})[_0xd4f9('0x25')](handleEntityNotFound(_0x18c0fa,null))['then'](function(_0x3973ab){if(_0x3973ab){_0x3c0b63=_0x3973ab;_0x57eb07[_0xd4f9('0x4a')]=_[_0xd4f9('0x4c')](db['WhatsappApplication']['rawAttributes']);_0x57eb07[_0xd4f9('0x4b')]=_['keys'](_0x2e56f6[_0xd4f9('0x4b')]);_0x57eb07[_0xd4f9('0x4d')]=_[_0xd4f9('0x4e')](_0x57eb07['model'],_0x57eb07[_0xd4f9('0x4b')]);_0x2c9295['attributes']=_[_0xd4f9('0x4e')](_0x57eb07[_0xd4f9('0x4a')],qs[_0xd4f9('0x4f')](_0x2e56f6[_0xd4f9('0x4b')]['fields']));_0x2c9295['attributes']=_0x2c9295['attributes'][_0xd4f9('0x51')]?_0x2c9295[_0xd4f9('0x50')]:_0x57eb07[_0xd4f9('0x4a')];_0x2c9295[_0xd4f9('0x54')]=qs[_0xd4f9('0x55')](_0x2e56f6[_0xd4f9('0x4b')][_0xd4f9('0x55')]);_0x2c9295[_0xd4f9('0x56')]=qs['filters'](_[_0xd4f9('0x57')](_0x2e56f6[_0xd4f9('0x4b')],_0x57eb07[_0xd4f9('0x4d')]));if(_0x2e56f6[_0xd4f9('0x4b')]['filter']){_0x2c9295[_0xd4f9('0x56')]=_[_0xd4f9('0x59')](_0x2c9295['where'],{'$or':_[_0xd4f9('0x44')](_0x2c9295['attributes'],function(_0x207adf){var _0x4fdb91={};_0x4fdb91[_0x207adf]={'$like':'%'+_0x2e56f6[_0xd4f9('0x4b')][_0xd4f9('0x58')]+'%'};return _0x4fdb91;})});}_0x2c9295=_[_0xd4f9('0x59')]({},_0x2c9295,_0x2e56f6[_0xd4f9('0x6c')]);return _0x3c0b63[_0xd4f9('0x87')](_0x2c9295);}})[_0xd4f9('0x25')](function(_0x2ac6db){if(_0x2ac6db){_0x1e74a6=_0x2ac6db[_0xd4f9('0x51')];if(!_0x2e56f6[_0xd4f9('0x4b')]['hasOwnProperty'](_0xd4f9('0x53'))){_0x2c9295[_0xd4f9('0x34')]=qs[_0xd4f9('0x34')](_0x2e56f6[_0xd4f9('0x4b')][_0xd4f9('0x34')]);_0x2c9295[_0xd4f9('0x36')]=qs[_0xd4f9('0x36')](_0x2e56f6[_0xd4f9('0x4b')]['offset']);}return _0x3c0b63[_0xd4f9('0x87')](_0x2c9295);}})['then'](function(_0x55e760){if(_0x55e760){return _0x55e760?{'count':_0x1e74a6,'rows':_0x55e760}:null;}})[_0xd4f9('0x25')](respondWithResult(_0x18c0fa,null))[_0xd4f9('0x2e')](handleError(_0x18c0fa,null));};exports[_0xd4f9('0x88')]=function(_0x58f839,_0x408c7a,_0x42638a){var _0x25f215={'channel':_0xd4f9('0x89')};var _0x2c8c69=[];var _0x35189a=[];var _0x5bb71f={};return db[_0xd4f9('0x45')]['find']({'where':{'id':_0x58f839[_0xd4f9('0x5f')]['id']},'include':[{'model':db[_0xd4f9('0x81')],'as':_0xd4f9('0x8a')}]})['then'](handleEntityNotFound(_0x408c7a,null))['then'](function(_0x5aa2cd){_0x25f215['account']=_0x5aa2cd;if(_0x25f215[_0xd4f9('0x8b')]&&_0x25f215[_0xd4f9('0x8b')][_0xd4f9('0x48')]==='sinch'&&_0x58f839[_0xd4f9('0x65')][_0xd4f9('0x8c')]){if(_0x58f839[_0xd4f9('0x65')]['statuses'][_0xd4f9('0x51')]===0x0)return;if(_0x58f839[_0xd4f9('0x65')][_0xd4f9('0x8c')][0x0][_0xd4f9('0x8d')]!==_0xd4f9('0x8e'))return;return db[_0xd4f9('0x8f')][_0xd4f9('0x3b')]({'read':!![],'readAt':_0x58f839[_0xd4f9('0x65')]['statuses'][0x0][_0xd4f9('0x90')]},{'where':{'messageId':_0x58f839[_0xd4f9('0x65')]['statuses'][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x13de91){return _0x408c7a[_0xd4f9('0x30')](0xc8)[_0xd4f9('0x32')](_0x13de91);});}_0x25f215[_0xd4f9('0x91')]=_['orderBy'](_0x5aa2cd[_0xd4f9('0x8a')],[_0xd4f9('0x84')],[_0xd4f9('0x92')]);if(_0x25f215['account'][_0xd4f9('0x8a')]){delete _0x25f215[_0xd4f9('0x8b')]['Applications'];}return db['CmContact'][_0xd4f9('0x66')]()[_0xd4f9('0x25')](function(_0x5ee20b){if(!_0x5ee20b){throw new db[(_0xd4f9('0x93'))][(_0xd4f9('0x94'))](_0xd4f9('0x95'));}_0x2c8c69=_[_0xd4f9('0x96')](_['keys'](_0x5ee20b),[_0xd4f9('0x97'),_0xd4f9('0x98')]);_0x35189a=_[_0xd4f9('0x96')](_[_0xd4f9('0x4c')](_0x5ee20b),[_0xd4f9('0x97'),'updatedAt',_0xd4f9('0x99'),'ListId']);_0x25f215[_0xd4f9('0x65')]={'mapKey':_0xd4f9('0x9a')};if(_0x25f215[_0xd4f9('0x8b')]&&_0x25f215['account'][_0xd4f9('0x48')]===_0xd4f9('0x9b')){_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x9c')]=_0x58f839[_0xd4f9('0x65')]['From']['replace'](_0xd4f9('0x9d'),'');_0x25f215[_0xd4f9('0x65')]['body']=_0x58f839[_0xd4f9('0x65')]['Body'];_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x9e')]=_0x58f839[_0xd4f9('0x65')][_0xd4f9('0x9f')];}if(_0x25f215[_0xd4f9('0x8b')]&&_0x25f215[_0xd4f9('0x8b')][_0xd4f9('0x48')]==='sinch'){_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x9c')]=_0x58f839[_0xd4f9('0x65')][_0xd4f9('0xa0')][0x0]['from'];_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x65')]=_0x58f839['body']['notifications'][0x0]['message'][_0xd4f9('0x65')];_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x9e')]=_0x58f839[_0xd4f9('0x65')][_0xd4f9('0xa0')][0x0]['message_id'];}if(_0x25f215[_0xd4f9('0x65')]['id']){delete _0x25f215[_0xd4f9('0x65')]['id'];}if(_[_0xd4f9('0xa1')](_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x9c')])){throw new db[(_0xd4f9('0x93'))][(_0xd4f9('0x94'))]('from\x20is\x20mandatory');}if(_[_0xd4f9('0xa1')](_0x25f215['body'][_0xd4f9('0x65')])||_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x65')]===''){throw new db[(_0xd4f9('0x93'))][(_0xd4f9('0x94'))](_0xd4f9('0xa2'));}if(_[_0xd4f9('0xa1')](_0x25f215[_0xd4f9('0x65')][_0xd4f9('0xa3')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35189a);}if(!_[_0xd4f9('0xa4')](_0x35189a,_0x25f215[_0xd4f9('0x65')][_0xd4f9('0xa3')])){throw new db['Sequelize'][(_0xd4f9('0x94'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35189a);}_0x5bb71f[_0x25f215[_0xd4f9('0x65')]['mapKey']]=_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x9c')];return db[_0xd4f9('0xa5')][_0xd4f9('0x63')]({'where':{'id':_0x25f215[_0xd4f9('0x8b')][_0xd4f9('0xa6')]},'include':[{'model':db[_0xd4f9('0xa7')],'as':'Contacts','where':_0x5bb71f,'limit':0x1,'order':[['updatedAt',_0xd4f9('0xa8')]]}]});})['then'](handleEntityNotFound(_0x408c7a,null))[_0xd4f9('0x25')](function(_0x4fcbee){if(_0x4fcbee){_0x25f215[_0xd4f9('0xa9')]=_[_0xd4f9('0x73')](_0x4fcbee,[_0xd4f9('0xaa')]);if(_0x4fcbee[_0xd4f9('0xaa')][_0xd4f9('0x51')]){return _0x4fcbee[_0xd4f9('0xaa')][0x0];}var _0x459286=_[_0xd4f9('0x1c')](_0x25f215[_0xd4f9('0x65')],{'firstName':_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x9c')],'ListId':_0x4fcbee['id']});_0x459286[_0x25f215[_0xd4f9('0x65')][_0xd4f9('0xa3')]]=_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x9c')];return db[_0xd4f9('0xa7')][_0xd4f9('0x60')](_0x459286,{'fields':_0x2c8c69,'raw':!![]});}})[_0xd4f9('0x25')](handleEntityNotFound(_0x408c7a,null))[_0xd4f9('0x25')](function(_0x37d6bd){if(_0x37d6bd){_0x25f215[_0xd4f9('0xab')]=_0x37d6bd;var _0x26e903={'ContactId':_0x37d6bd['id'],'phone':_0x25f215['body'][_0xd4f9('0x9c')],'WhatsappAccountId':_0x58f839[_0xd4f9('0x5f')]['id']};var _0xe0b1c2={'ContactId':_0x37d6bd['id'],'WhatsappAccountId':_0x58f839[_0xd4f9('0x5f')]['id'],'closed':![]};return db[_0xd4f9('0xac')][_0xd4f9('0x63')]({'where':_0xe0b1c2})[_0xd4f9('0x25')](function(_0x731db){if(_0x731db){return[_0x731db,![]];}return db[_0xd4f9('0xac')][_0xd4f9('0x60')](_0x26e903)['then'](function(_0x340e09){return[_0x340e09,!![]];});});}})[_0xd4f9('0xad')](function(_0x16e473,_0x4d6dac){_0x25f215['interaction']=_0x16e473[_0xd4f9('0x3d')]({'plain':!![]});_0x25f215[_0xd4f9('0xae')][_0xd4f9('0xaf')]=![];if(_0x4d6dac){if(_0x25f215[_0xd4f9('0x8b')][_0xd4f9('0xb0')]){_0x25f215[_0xd4f9('0x91')][_0xd4f9('0xb1')]({'id':0x0,'priority':_0x25f215[_0xd4f9('0x91')]['length']+0x1,'app':_0xd4f9('0xb2'),'appdata':_0xd4f9('0xb3'),'interval':_0xd4f9('0xb4')});}_0x25f215[_0xd4f9('0xae')][_0xd4f9('0xaf')]=!![];}return db[_0xd4f9('0x8f')]['create']({'phone':_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x9c')],'messageId':_0x25f215[_0xd4f9('0x65')][_0xd4f9('0x9e')],'body':_0x25f215['body']['body'],'WhatsappAccountId':_0x58f839[_0xd4f9('0x5f')]['id'],'WhatsappInteractionId':_0x16e473['id'],'direction':'in','ContactId':_0x16e473[_0xd4f9('0xb5')],'AttachmentId':_0x25f215[_0xd4f9('0x65')]['AttachmentId']});})['then'](function(_0x13dd2e){_0x25f215[_0xd4f9('0x2d')]=_0x13dd2e;if(_0x25f215[_0xd4f9('0xae')][_0xd4f9('0xb6')]){return db['User']['find']({'attributes':['id',_0xd4f9('0x40')],'where':{'id':_0x25f215['interaction'][_0xd4f9('0xb6')]}})[_0xd4f9('0x25')](function(_0x39d45f){if(_0x39d45f){_0x25f215[_0xd4f9('0x91')][_0xd4f9('0xb7')]({'id':0x0,'priority':0x0,'app':_0xd4f9('0xb8'),'appdata':_0x39d45f[_0xd4f9('0x40')]+','+(_0x25f215['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd4f9('0xb9'),'startRouting',_0x25f215);});}return respondWithRpcPromise(_0xd4f9('0xb9'),'startRouting',_0x25f215);})[_0xd4f9('0x25')](function(_0x95f8fd){if(_0x95f8fd){var _0xfcb446=0xc8;var _0x46f6eb=_0xd4f9('0xba');logger[_0xd4f9('0x26')](_0xd4f9('0x28'),_0x46f6eb,_0xfcb446,_0xd4f9('0xbb'));logger['debug'](_0xd4f9('0xbc'),_0x46f6eb,_0xfcb446,_0xd4f9('0xbb'),JSON['stringify'](_0x95f8fd));if(_0x25f215[_0xd4f9('0x8b')][_0xd4f9('0x48')]===_0xd4f9('0x9b')){return _0x408c7a[_0xd4f9('0x30')](_0xfcb446)[_0xd4f9('0x37')](_0xd4f9('0xbd'),_0xd4f9('0xbe'))[_0xd4f9('0xbf')](_0xd4f9('0xc0'));}else{return _0x408c7a[_0xd4f9('0x30')](_0xfcb446)['json'](_0x95f8fd);}}});})[_0xd4f9('0x2e')](handleError(_0x408c7a,null));};exports[_0xd4f9('0xbf')]=function(_0x155ec3,_0x2a74b4,_0x4b6834){var _0x5499e5,_0x37b6c9,_0x351806;if(_[_0xd4f9('0xa1')](_0x155ec3[_0xd4f9('0x65')]['body'])||_0x155ec3[_0xd4f9('0x65')]['body']===''){throw new db[(_0xd4f9('0x93'))][(_0xd4f9('0x94'))](_0xd4f9('0xa2'));}if(_[_0xd4f9('0xa1')](_0x155ec3[_0xd4f9('0x65')]['to'])){throw new db['Sequelize'][(_0xd4f9('0x94'))](_0xd4f9('0xc1'));}_0x5499e5=_0x155ec3[_0xd4f9('0x65')]['to'];return db[_0xd4f9('0x45')][_0xd4f9('0x63')]({'where':{'id':_0x155ec3[_0xd4f9('0x5f')]['id']},'include':[{'model':db[_0xd4f9('0xa5')],'as':_0xd4f9('0xc2'),'include':[{'model':db[_0xd4f9('0xa7')],'as':'Contacts','where':{'mobile':_0x5499e5},'limit':0x1,'order':[['updatedAt',_0xd4f9('0xa8')]]}]}]})[_0xd4f9('0x25')](handleEntityNotFound(_0x2a74b4,null))[_0xd4f9('0x25')](function(_0x15613e){if(_0x15613e&&_0x15613e[_0xd4f9('0xc2')]){_0x37b6c9=_0x15613e[_0xd4f9('0x3d')]({'plain':!![]});if(_0x37b6c9['List']&&_0x37b6c9[_0xd4f9('0xc2')]['Contacts'][_0xd4f9('0x51')]){return _0x37b6c9[_0xd4f9('0xc2')][_0xd4f9('0xaa')][0x0];}return db[_0xd4f9('0xa7')][_0xd4f9('0x60')](_[_0xd4f9('0x1c')](_0x155ec3[_0xd4f9('0x65')],{'firstName':_0x5499e5,'mobile':_0x5499e5,'phone':_0x5499e5,'ListId':_0x37b6c9[_0xd4f9('0xa6')]}));}})[_0xd4f9('0x25')](handleEntityNotFound(_0x2a74b4,null))['then'](function(_0x307746){if(_0x307746){_0x351806=_0x307746;return db[_0xd4f9('0xac')][_0xd4f9('0x63')]({'where':{'ContactId':_0x351806['id'],'closed':![],'WhatsappAccountId':_0x37b6c9['id']}})[_0xd4f9('0x25')](function(_0xc9d85b){if(_0xc9d85b){return[_0xc9d85b,![]];}return db[_0xd4f9('0xac')][_0xd4f9('0x60')]({'UserId':_0x155ec3['user']['id'],'ContactId':_0x351806['id'],'WhatsappAccountId':_0x37b6c9['id'],'phone':_0x5499e5,'firstMsgDirection':'out','Messages':[_['merge'](_0x155ec3[_0xd4f9('0x65')],{'read':![],'body':_0x155ec3[_0xd4f9('0x65')][_0xd4f9('0x65')],'phone':_0x5499e5,'WhatsappAccountId':_0x37b6c9['id'],'UserId':_0x155ec3[_0xd4f9('0xc3')]['id'],'ContactId':_0x351806['id']})]},{'include':[{'model':db[_0xd4f9('0x8f')],'as':'Messages'}]})[_0xd4f9('0x25')](function(_0x3078c6){return[_0x3078c6,!![]];});});}})[_0xd4f9('0xad')](function(_0x66f6e1,_0x2cccb6){if(_0x2cccb6){return _0x66f6e1;}return db[_0xd4f9('0x8f')]['create'](_[_0xd4f9('0x59')](_0x155ec3['body'],{'read':![],'body':_0x155ec3[_0xd4f9('0x65')][_0xd4f9('0x65')],'phone':_0x5499e5,'WhatsappAccountId':_0x37b6c9['id'],'WhatsappInteractionId':_0x66f6e1['id'],'UserId':_0x155ec3[_0xd4f9('0xc3')]['id'],'ContactId':_0x351806['id']}))[_0xd4f9('0x25')](function(_0x1f92ca){_0x66f6e1[_0xd4f9('0xc4')][_0xd4f9('0xc5')]=[];_0x66f6e1[_0xd4f9('0xc4')][_0xd4f9('0xc5')][_0xd4f9('0xb1')](_0x1f92ca[_0xd4f9('0xc4')]);return _0x66f6e1;});})[_0xd4f9('0x25')](respondWithResult(_0x2a74b4,null))[_0xd4f9('0x2e')](handleError(_0x2a74b4,null));};
\ No newline at end of file
+var _0xc70a=['type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','addDisposition','Disposition','WhatsappAccountId','filter','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','message_id','applications','orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','WhatsappInteraction','interaction','get','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','out','WhatsappMessage','Messages','dataValues','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappAccount.socket','jayson/promise','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','status','offset','undefined','limit','count','set','json','apply','reject','save','WhatsappAccounts','UserProfileResource','destroy','end','sendStatus','stack','name','send','Pause','map','WhatsappAccount','rawAttributes','fieldName'];(function(_0x2874b3,_0xeed371){var _0x48a5aa=function(_0x45f281){while(--_0x45f281){_0x2874b3['push'](_0x2874b3['shift']());}};_0x48a5aa(++_0xeed371);}(_0xc70a,0x83));var _0xac70=function(_0x5e8660,_0x2a03de){_0x5e8660=_0x5e8660-0x0;var _0x2a8261=_0xc70a[_0x5e8660];return _0x2a8261;};'use strict';var emlformat=require(_0xac70('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac70('0x1'));var jsonpatch=require(_0xac70('0x2'));var rp=require('request-promise');var moment=require(_0xac70('0x3'));var BPromise=require(_0xac70('0x4'));var Mustache=require(_0xac70('0x5'));var util=require(_0xac70('0x6'));var path=require(_0xac70('0x7'));var sox=require(_0xac70('0x8'));var csv=require(_0xac70('0x9'));var ejs=require(_0xac70('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xac70('0xb'));var squel=require(_0xac70('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xac70('0xd'));var toCsv=require(_0xac70('0x9'));var querystring=require(_0xac70('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xac70('0xf'));var qs=require(_0xac70('0x10'));var as=require(_0xac70('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xac70('0x12'));var utils=require(_0xac70('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xac70('0x14'));var db=require('../../mysqldb')['db'];config[_0xac70('0x15')]=_[_0xac70('0x16')](config[_0xac70('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xac70('0x17'))(new Redis(config[_0xac70('0x15')]));require(_0xac70('0x18'))['register'](socket);var jayson=require(_0xac70('0x19'));var client=jayson['client'][_0xac70('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x2e5bc9,_0x37e8c4,_0x43323a,_0x3dfa14){return new BPromise(function(_0x841988,_0x438f89){var _0x483522=_0x3dfa14||client;return _0x483522[_0xac70('0x1b')](_0x2e5bc9,_0x43323a)[_0xac70('0x1c')](function(_0x1a5259){logger['info'](_0xac70('0x1d'),_0x37e8c4,_0xac70('0x1e'));logger[_0xac70('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x37e8c4,_0xac70('0x1e'),JSON[_0xac70('0x20')](_0x1a5259));if(_0x1a5259[_0xac70('0x21')]){if(_0x1a5259['error']['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x37e8c4,_0x1a5259[_0xac70('0x21')]['message']);return _0x438f89(_0x1a5259[_0xac70('0x21')][_0xac70('0x22')]);}logger[_0xac70('0x21')](_0xac70('0x1d'),_0x37e8c4,_0x1a5259['error']['message']);return _0x841988(_0x1a5259[_0xac70('0x21')][_0xac70('0x22')]);}else{logger[_0xac70('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x37e8c4,_0xac70('0x1e'));_0x841988(_0x1a5259[_0xac70('0x24')][_0xac70('0x22')]);}})[_0xac70('0x25')](function(_0x26505c){logger[_0xac70('0x21')](_0xac70('0x1d'),_0x37e8c4,_0x26505c);_0x438f89(_0x26505c);});});}function respondWithStatusCode(_0x3f44f2,_0x401909){_0x401909=_0x401909||0xcc;return function(_0x38b408){if(_0x38b408){return _0x3f44f2['sendStatus'](_0x401909);}return _0x3f44f2['status'](_0x401909)['end']();};}function respondWithResult(_0x235a5d,_0x19a7a8){_0x19a7a8=_0x19a7a8||0xc8;return function(_0x386e00){if(_0x386e00){return _0x235a5d[_0xac70('0x26')](_0x19a7a8)['json'](_0x386e00);}};}function respondWithFilteredResult(_0x4662e5,_0x3b6c01){return function(_0x49b6ad){if(_0x49b6ad){var _0x343b92=typeof _0x3b6c01[_0xac70('0x27')]===_0xac70('0x28')&&typeof _0x3b6c01[_0xac70('0x29')]===_0xac70('0x28');var _0x1a3297=_0x49b6ad[_0xac70('0x2a')];var _0x5e5868=_0x343b92?0x0:_0x3b6c01[_0xac70('0x27')];var _0x579550=_0x343b92?_0x49b6ad['count']:_0x3b6c01[_0xac70('0x27')]+_0x3b6c01[_0xac70('0x29')];var _0x793b34;if(_0x579550>=_0x1a3297){_0x579550=_0x1a3297;_0x793b34=0xc8;}else{_0x793b34=0xce;}_0x4662e5[_0xac70('0x26')](_0x793b34);return _0x4662e5[_0xac70('0x2b')]('Content-Range',_0x5e5868+'-'+_0x579550+'/'+_0x1a3297)[_0xac70('0x2c')](_0x49b6ad);}return null;};}function patchUpdates(_0x157e33){return function(_0x1bf938){try{jsonpatch[_0xac70('0x2d')](_0x1bf938,_0x157e33,!![]);}catch(_0x325ad8){return BPromise[_0xac70('0x2e')](_0x325ad8);}return _0x1bf938[_0xac70('0x2f')]();};}function saveUpdates(_0x3594fa,_0x5b81eb){return function(_0x1c0955){if(_0x1c0955){return _0x1c0955['update'](_0x3594fa)[_0xac70('0x1c')](function(_0x490ce2){return _0x490ce2;});}return null;};}function removeEntity(_0x3a779d,_0x3a1292){return function(_0x2dd905){if(_0x2dd905){return _0x2dd905['destroy']()[_0xac70('0x1c')](function(){var _0x5a9375=_0x2dd905['get']({'plain':!![]});var _0x1ef314=_0xac70('0x30');return db[_0xac70('0x31')][_0xac70('0x32')]({'where':{'type':_0x1ef314,'resourceId':_0x5a9375['id']}})['then'](function(){return _0x2dd905;});})[_0xac70('0x1c')](function(){_0x3a779d[_0xac70('0x26')](0xcc)[_0xac70('0x33')]();});}};}function handleEntityNotFound(_0x5c7b46,_0x2fa7e5){return function(_0xf0064e){if(!_0xf0064e){_0x5c7b46[_0xac70('0x34')](0x194);}return _0xf0064e;};}function handleError(_0x509547,_0x1bb9e1){_0x1bb9e1=_0x1bb9e1||0x1f4;return function(_0x4bfd79){logger[_0xac70('0x21')](_0x4bfd79[_0xac70('0x35')]);if(_0x4bfd79['name']){delete _0x4bfd79[_0xac70('0x36')];}_0x509547[_0xac70('0x26')](_0x1bb9e1)[_0xac70('0x37')](_0x4bfd79);};}exports['index']=function(_0x32f8cb,_0x25d557){var _0x2eb925={'include':[{'model':db[_0xac70('0x38')],'as':'mandatoryDispositionPause'}]},_0x5dc1dd={},_0x15b221={'count':0x0,'rows':[]};var _0x43b5d2=_[_0xac70('0x39')](db[_0xac70('0x3a')][_0xac70('0x3b')],function(_0x4c1cb5){return{'name':_0x4c1cb5[_0xac70('0x3c')],'type':_0x4c1cb5[_0xac70('0x3d')][_0xac70('0x3e')]};});_0x5dc1dd[_0xac70('0x3f')]=_['map'](_0x43b5d2,_0xac70('0x36'));_0x5dc1dd['query']=_['keys'](_0x32f8cb[_0xac70('0x40')]);_0x5dc1dd[_0xac70('0x41')]=_[_0xac70('0x42')](_0x5dc1dd['model'],_0x5dc1dd[_0xac70('0x40')]);_0x2eb925[_0xac70('0x43')]=_[_0xac70('0x42')](_0x5dc1dd[_0xac70('0x3f')],qs[_0xac70('0x44')](_0x32f8cb[_0xac70('0x40')][_0xac70('0x44')]));_0x2eb925[_0xac70('0x43')]=_0x2eb925[_0xac70('0x43')][_0xac70('0x45')]?_0x2eb925[_0xac70('0x43')]:_0x5dc1dd[_0xac70('0x3f')];if(!_0x32f8cb['query'][_0xac70('0x46')](_0xac70('0x47'))){_0x2eb925[_0xac70('0x29')]=qs[_0xac70('0x29')](_0x32f8cb[_0xac70('0x40')][_0xac70('0x29')]);_0x2eb925[_0xac70('0x27')]=qs[_0xac70('0x27')](_0x32f8cb['query'][_0xac70('0x27')]);}_0x2eb925[_0xac70('0x48')]=qs[_0xac70('0x49')](_0x32f8cb[_0xac70('0x40')]['sort']);_0x2eb925['where']=qs['filters'](_[_0xac70('0x4a')](_0x32f8cb[_0xac70('0x40')],_0x5dc1dd[_0xac70('0x41')]),_0x43b5d2);if(_0x32f8cb['query']['filter']){_0x2eb925['where']=_[_0xac70('0x4b')](_0x2eb925[_0xac70('0x4c')],{'$or':_[_0xac70('0x39')](_0x43b5d2,function(_0xbf6e9a){if(_0xbf6e9a[_0xac70('0x3d')]!==_0xac70('0x4d')){var _0x2c3626={};_0x2c3626[_0xbf6e9a[_0xac70('0x36')]]={'$like':'%'+_0x32f8cb[_0xac70('0x40')]['filter']+'%'};return _0x2c3626;}})});}_0x2eb925=_[_0xac70('0x4b')]({},_0x2eb925,_0x32f8cb[_0xac70('0x4e')]);var _0x11d269={'where':_0x2eb925[_0xac70('0x4c')]};return db[_0xac70('0x3a')][_0xac70('0x2a')](_0x11d269)['then'](function(_0x2eac08){_0x15b221[_0xac70('0x2a')]=_0x2eac08;if(_0x32f8cb['query'][_0xac70('0x4f')]){_0x2eb925[_0xac70('0x50')]=[{'all':!![]}];}return db[_0xac70('0x3a')][_0xac70('0x51')](_0x2eb925);})[_0xac70('0x1c')](function(_0x2096e0){_0x15b221[_0xac70('0x52')]=_0x2096e0;return _0x15b221;})['then'](respondWithFilteredResult(_0x25d557,_0x2eb925))[_0xac70('0x25')](handleError(_0x25d557,null));};exports[_0xac70('0x53')]=function(_0xc44900,_0x4ea523){var _0x2dd188={'raw':![],'where':{'id':_0xc44900[_0xac70('0x54')]['id']},'include':[{'model':db[_0xac70('0x38')],'as':'mandatoryDispositionPause'}]},_0x36eb57={};_0x36eb57[_0xac70('0x3f')]=_[_0xac70('0x55')](db[_0xac70('0x3a')][_0xac70('0x3b')]);_0x36eb57['query']=_['keys'](_0xc44900[_0xac70('0x40')]);_0x36eb57[_0xac70('0x41')]=_[_0xac70('0x42')](_0x36eb57[_0xac70('0x3f')],_0x36eb57[_0xac70('0x40')]);_0x2dd188[_0xac70('0x43')]=_[_0xac70('0x42')](_0x36eb57[_0xac70('0x3f')],qs[_0xac70('0x44')](_0xc44900[_0xac70('0x40')][_0xac70('0x44')]));_0x2dd188['attributes']=_0x2dd188[_0xac70('0x43')][_0xac70('0x45')]?_0x2dd188['attributes']:_0x36eb57[_0xac70('0x3f')];if(_0xc44900[_0xac70('0x40')][_0xac70('0x4f')]){_0x2dd188['include']=[{'all':!![]}];}_0x2dd188=_[_0xac70('0x4b')]({},_0x2dd188,_0xc44900[_0xac70('0x4e')]);return db[_0xac70('0x3a')][_0xac70('0x56')](_0x2dd188)['then'](handleEntityNotFound(_0x4ea523,null))[_0xac70('0x1c')](respondWithResult(_0x4ea523,null))['catch'](handleError(_0x4ea523,null));};exports[_0xac70('0x57')]=function(_0x4768a2,_0x84d2bd){return db[_0xac70('0x3a')][_0xac70('0x57')](_0x4768a2[_0xac70('0x58')],{})[_0xac70('0x1c')](function(_0xfb5db8){var _0x451258=_0x4768a2[_0xac70('0x59')]['get']({'plain':!![]});if(!_0x451258)throw new Error(_0xac70('0x5a'));if(_0x451258[_0xac70('0x5b')]===_0xac70('0x59')){var _0x279494=_0xfb5db8['get']({'plain':!![]});var _0x554784='WhatsappAccounts';return db['UserProfileSection'][_0xac70('0x56')]({'where':{'name':_0x554784,'userProfileId':_0x451258['userProfileId']},'raw':!![]})['then'](function(_0x164a2b){if(_0x164a2b&&_0x164a2b['autoAssociation']===0x0){return db[_0xac70('0x31')][_0xac70('0x57')]({'name':_0x279494[_0xac70('0x36')],'resourceId':_0x279494['id'],'type':_0x164a2b[_0xac70('0x36')],'sectionId':_0x164a2b['id']},{})[_0xac70('0x1c')](function(){return _0xfb5db8;});}else{return _0xfb5db8;}})[_0xac70('0x25')](function(_0xf40924){logger[_0xac70('0x21')](_0xac70('0x5c'),_0xf40924);throw _0xf40924;});}return _0xfb5db8;})['then'](respondWithResult(_0x84d2bd,0xc9))[_0xac70('0x25')](handleError(_0x84d2bd,null));};exports[_0xac70('0x5d')]=function(_0x1f646d,_0x1bab7f){if(_0x1f646d['body']['id']){delete _0x1f646d[_0xac70('0x58')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x1f646d[_0xac70('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xac70('0x5e')}]})[_0xac70('0x1c')](handleEntityNotFound(_0x1bab7f,null))[_0xac70('0x1c')](saveUpdates(_0x1f646d[_0xac70('0x58')],null))[_0xac70('0x1c')](respondWithResult(_0x1bab7f,null))[_0xac70('0x25')](handleError(_0x1bab7f,null));};exports[_0xac70('0x32')]=function(_0x20ade6,_0x292fbc){return db['WhatsappAccount'][_0xac70('0x56')]({'where':{'id':_0x20ade6[_0xac70('0x54')]['id']}})[_0xac70('0x1c')](handleEntityNotFound(_0x292fbc,null))[_0xac70('0x1c')](removeEntity(_0x292fbc,null))[_0xac70('0x25')](handleError(_0x292fbc,null));};exports['describe']=function(_0x4cb2ed,_0xa85860){return db[_0xac70('0x3a')][_0xac70('0x5f')]()['then'](respondWithResult(_0xa85860,null))[_0xac70('0x25')](handleError(_0xa85860,null));};exports[_0xac70('0x60')]=function(_0x3624c8,_0x5b3bb2,_0xfe55de){if(_0x3624c8[_0xac70('0x58')]['id']){delete _0x3624c8[_0xac70('0x58')]['id'];}return db['WhatsappAccount'][_0xac70('0x56')]({'where':{'id':_0x3624c8[_0xac70('0x54')]['id']}})[_0xac70('0x1c')](handleEntityNotFound(_0x5b3bb2,null))[_0xac70('0x1c')](function(_0xdbb440){if(_0xdbb440){_0x3624c8['body']['WhatsappAccountId']=_0xdbb440['id'];return db[_0xac70('0x61')][_0xac70('0x57')](_0x3624c8['body']);}})[_0xac70('0x1c')](respondWithResult(_0x5b3bb2,null))[_0xac70('0x25')](handleError(_0x5b3bb2,null));};exports['getDispositions']=function(_0x2c0000,_0x347b46,_0x324de2){var _0x2d6529={'raw':![],'where':{}};var _0x5a2f64={};var _0x1165f5={'count':0x0,'rows':[]};return db[_0xac70('0x3a')]['findOne']({'where':{'id':_0x2c0000[_0xac70('0x54')]['id']}})[_0xac70('0x1c')](handleEntityNotFound(_0x347b46,null))['then'](function(_0x214ce6){if(_0x214ce6){_0x5a2f64[_0xac70('0x3f')]=_[_0xac70('0x55')](db[_0xac70('0x61')]['rawAttributes']);_0x5a2f64[_0xac70('0x40')]=_[_0xac70('0x55')](_0x2c0000['query']);_0x5a2f64[_0xac70('0x41')]=_[_0xac70('0x42')](_0x5a2f64[_0xac70('0x3f')],_0x5a2f64['query']);_0x2d6529[_0xac70('0x43')]=_[_0xac70('0x42')](_0x5a2f64['model'],qs[_0xac70('0x44')](_0x2c0000[_0xac70('0x40')]['fields']));_0x2d6529[_0xac70('0x43')]=_0x2d6529['attributes']['length']?_0x2d6529[_0xac70('0x43')]:_0x5a2f64[_0xac70('0x3f')];if(!_0x2c0000[_0xac70('0x40')][_0xac70('0x46')](_0xac70('0x47'))){_0x2d6529[_0xac70('0x29')]=qs[_0xac70('0x29')](_0x2c0000[_0xac70('0x40')][_0xac70('0x29')]);_0x2d6529['offset']=qs[_0xac70('0x27')](_0x2c0000[_0xac70('0x40')][_0xac70('0x27')]);}_0x2d6529[_0xac70('0x48')]=qs[_0xac70('0x49')](_0x2c0000[_0xac70('0x40')]['sort']);_0x2d6529['where']=qs['filters'](_['pick'](_0x2c0000[_0xac70('0x40')],_0x5a2f64['filters']));_0x2d6529[_0xac70('0x4c')][_0xac70('0x62')]=_0x214ce6['id'];if(_0x2c0000[_0xac70('0x40')][_0xac70('0x63')]){_0x2d6529[_0xac70('0x4c')]=_[_0xac70('0x4b')](_0x2d6529[_0xac70('0x4c')],{'$or':_[_0xac70('0x39')](_0x2d6529[_0xac70('0x43')],function(_0x509ca9){var _0x7f8991={};_0x7f8991[_0x509ca9]={'$like':'%'+_0x2c0000['query'][_0xac70('0x63')]+'%'};return _0x7f8991;})});}_0x2d6529=_[_0xac70('0x4b')]({},_0x2d6529,_0x2c0000[_0xac70('0x4e')]);return db['Disposition'][_0xac70('0x2a')]({'where':_0x2d6529[_0xac70('0x4c')]})[_0xac70('0x1c')](function(_0x7a2f2e){_0x1165f5[_0xac70('0x2a')]=_0x7a2f2e;if(_0x2c0000[_0xac70('0x40')]['includeAll']){_0x2d6529[_0xac70('0x50')]=[{'all':!![]}];}return db['Disposition'][_0xac70('0x51')](_0x2d6529);})[_0xac70('0x1c')](function(_0x884938){_0x1165f5['rows']=_0x884938;return _0x1165f5;});}})[_0xac70('0x1c')](respondWithFilteredResult(_0x347b46,_0x2d6529))[_0xac70('0x25')](handleError(_0x347b46,null));};exports[_0xac70('0x64')]=function(_0x4dbd9d,_0x5a25f9,_0x534b92){return db[_0xac70('0x3a')][_0xac70('0x56')]({'where':{'id':_0x4dbd9d[_0xac70('0x54')]['id']}})['then'](handleEntityNotFound(_0x5a25f9,null))[_0xac70('0x1c')](function(_0x22191e){if(_0x22191e){return _0x22191e[_0xac70('0x64')](_0x4dbd9d[_0xac70('0x40')][_0xac70('0x65')]);}})[_0xac70('0x1c')](respondWithStatusCode(_0x5a25f9,null))[_0xac70('0x25')](handleError(_0x5a25f9,null));};exports[_0xac70('0x66')]=function(_0x494cec,_0x1920c4,_0x2a7a12){if(_0x494cec[_0xac70('0x58')]['id']){delete _0x494cec[_0xac70('0x58')]['id'];}return db['WhatsappAccount'][_0xac70('0x56')]({'where':{'id':_0x494cec[_0xac70('0x54')]['id']}})[_0xac70('0x1c')](handleEntityNotFound(_0x1920c4,null))['then'](function(_0x2a1dde){if(_0x2a1dde){_0x494cec[_0xac70('0x58')][_0xac70('0x62')]=_0x2a1dde['id'];return db[_0xac70('0x67')]['create'](_0x494cec[_0xac70('0x58')]);}})['then'](respondWithResult(_0x1920c4,null))[_0xac70('0x25')](handleError(_0x1920c4,null));};exports['getAnswers']=function(_0x20c650,_0x5ac12c,_0x4e3011){var _0x3e8878={'raw':![],'where':{}};var _0x38ec8a={};var _0x32db69={'count':0x0,'rows':[]};return db[_0xac70('0x3a')][_0xac70('0x68')]({'where':{'id':_0x20c650[_0xac70('0x54')]['id']}})[_0xac70('0x1c')](handleEntityNotFound(_0x5ac12c,null))[_0xac70('0x1c')](function(_0x408deb){if(_0x408deb){_0x38ec8a[_0xac70('0x3f')]=_[_0xac70('0x55')](db[_0xac70('0x67')][_0xac70('0x3b')]);_0x38ec8a[_0xac70('0x40')]=_['keys'](_0x20c650['query']);_0x38ec8a[_0xac70('0x41')]=_['intersection'](_0x38ec8a[_0xac70('0x3f')],_0x38ec8a['query']);_0x3e8878[_0xac70('0x43')]=_[_0xac70('0x42')](_0x38ec8a[_0xac70('0x3f')],qs[_0xac70('0x44')](_0x20c650[_0xac70('0x40')][_0xac70('0x44')]));_0x3e8878[_0xac70('0x43')]=_0x3e8878[_0xac70('0x43')]['length']?_0x3e8878[_0xac70('0x43')]:_0x38ec8a[_0xac70('0x3f')];if(!_0x20c650['query'][_0xac70('0x46')]('nolimit')){_0x3e8878[_0xac70('0x29')]=qs[_0xac70('0x29')](_0x20c650[_0xac70('0x40')][_0xac70('0x29')]);_0x3e8878[_0xac70('0x27')]=qs[_0xac70('0x27')](_0x20c650[_0xac70('0x40')]['offset']);}_0x3e8878[_0xac70('0x48')]=qs['sort'](_0x20c650['query'][_0xac70('0x49')]);_0x3e8878[_0xac70('0x4c')]=qs[_0xac70('0x41')](_[_0xac70('0x4a')](_0x20c650[_0xac70('0x40')],_0x38ec8a[_0xac70('0x41')]));_0x3e8878['where']['WhatsappAccountId']=_0x408deb['id'];if(_0x20c650[_0xac70('0x40')][_0xac70('0x63')]){_0x3e8878['where']=_['merge'](_0x3e8878[_0xac70('0x4c')],{'$or':_[_0xac70('0x39')](_0x3e8878[_0xac70('0x43')],function(_0x5ac75e){var _0x32a1b4={};_0x32a1b4[_0x5ac75e]={'$like':'%'+_0x20c650[_0xac70('0x40')]['filter']+'%'};return _0x32a1b4;})});}_0x3e8878=_['merge']({},_0x3e8878,_0x20c650[_0xac70('0x4e')]);return db['CannedAnswer'][_0xac70('0x2a')]({'where':_0x3e8878['where']})['then'](function(_0x5bac2c){_0x32db69['count']=_0x5bac2c;if(_0x20c650[_0xac70('0x40')][_0xac70('0x4f')]){_0x3e8878[_0xac70('0x50')]=[{'all':!![]}];}return db[_0xac70('0x67')][_0xac70('0x51')](_0x3e8878);})[_0xac70('0x1c')](function(_0x1a0a1f){_0x32db69[_0xac70('0x52')]=_0x1a0a1f;return _0x32db69;});}})[_0xac70('0x1c')](respondWithFilteredResult(_0x5ac12c,_0x3e8878))['catch'](handleError(_0x5ac12c,null));};exports['removeAnswers']=function(_0x35a832,_0x5bbf9b,_0x30672a){return db['WhatsappAccount'][_0xac70('0x56')]({'where':{'id':_0x35a832[_0xac70('0x54')]['id']}})[_0xac70('0x1c')](handleEntityNotFound(_0x5bbf9b,null))[_0xac70('0x1c')](function(_0x57e312){if(_0x57e312){return _0x57e312[_0xac70('0x69')](_0x35a832['query']['ids']);}})[_0xac70('0x1c')](respondWithStatusCode(_0x5bbf9b,null))[_0xac70('0x25')](handleError(_0x5bbf9b,null));};exports[_0xac70('0x6a')]=function(_0x4c850b,_0x14ffef,_0xb71d78){return db[_0xac70('0x3a')]['find']({'where':{'id':_0x4c850b[_0xac70('0x54')]['id']}})['then'](handleEntityNotFound(_0x14ffef,null))[_0xac70('0x1c')](function(_0x50eb66){if(_0x50eb66){return _0x50eb66['addAgents'](_0x4c850b[_0xac70('0x58')]['ids'],_['omit'](_0x4c850b[_0xac70('0x58')],['ids','id'])||{})[_0xac70('0x6b')](function(_0x5be3b3){for(var _0xd5c4ad=0x0;_0xd5c4ad<_0x4c850b[_0xac70('0x58')][_0xac70('0x65')][_0xac70('0x45')];_0xd5c4ad+=0x1){socket[_0xac70('0x6c')](_0xac70('0x6d'),{'UserId':Number(_0x4c850b['body'][_0xac70('0x65')][_0xd5c4ad]),'WhatsappAccountId':Number(_0x4c850b['params']['id'])});}return _0x5be3b3;});}})[_0xac70('0x1c')](respondWithResult(_0x14ffef,null))[_0xac70('0x25')](handleError(_0x14ffef,null));};exports['removeAgents']=function(_0x1a7308,_0x579d4f,_0x4543a0){return db[_0xac70('0x3a')]['find']({'where':{'id':_0x1a7308[_0xac70('0x54')]['id']}})[_0xac70('0x1c')](handleEntityNotFound(_0x579d4f,null))['then'](function(_0x4e5daf){if(_0x4e5daf){return _0x4e5daf[_0xac70('0x6e')](_0x1a7308['query']['ids'])[_0xac70('0x1c')](function(){if(_[_0xac70('0x6f')](_0x1a7308[_0xac70('0x40')]['ids'])){for(var _0xb7c9d0=0x0;_0xb7c9d0<_0x1a7308[_0xac70('0x40')][_0xac70('0x65')][_0xac70('0x45')];_0xb7c9d0+=0x1){socket[_0xac70('0x6c')](_0xac70('0x70'),{'UserId':Number(_0x1a7308['query'][_0xac70('0x65')][_0xb7c9d0]),'WhatsappAccountId':Number(_0x1a7308['params']['id'])});}}else{socket[_0xac70('0x6c')](_0xac70('0x70'),{'UserId':Number(_0x1a7308[_0xac70('0x40')][_0xac70('0x65')]),'WhatsappAccountId':Number(_0x1a7308[_0xac70('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x579d4f,null))[_0xac70('0x25')](handleError(_0x579d4f,null));};exports[_0xac70('0x71')]=function(_0x51eab9,_0x279909,_0xb3d532){var _0x591863={};var _0x3c4a4a={};var _0x49a772;var _0x15d085;return db[_0xac70('0x3a')]['findOne']({'where':{'id':_0x51eab9[_0xac70('0x54')]['id']}})['then'](handleEntityNotFound(_0x279909,null))['then'](function(_0x445121){if(_0x445121){_0x49a772=_0x445121;_0x3c4a4a[_0xac70('0x3f')]=_[_0xac70('0x55')](db['User'][_0xac70('0x3b')]);_0x3c4a4a[_0xac70('0x40')]=_['keys'](_0x51eab9[_0xac70('0x40')]);_0x3c4a4a[_0xac70('0x41')]=_[_0xac70('0x42')](_0x3c4a4a[_0xac70('0x3f')],_0x3c4a4a['query']);_0x591863[_0xac70('0x43')]=_[_0xac70('0x42')](_0x3c4a4a[_0xac70('0x3f')],qs['fields'](_0x51eab9[_0xac70('0x40')]['fields']));_0x591863[_0xac70('0x43')]=_0x591863[_0xac70('0x43')]['length']?_0x591863[_0xac70('0x43')]:_0x3c4a4a[_0xac70('0x3f')];_0x591863[_0xac70('0x48')]=qs[_0xac70('0x49')](_0x51eab9[_0xac70('0x40')][_0xac70('0x49')]);_0x591863[_0xac70('0x4c')]=qs[_0xac70('0x41')](_[_0xac70('0x4a')](_0x51eab9[_0xac70('0x40')],_0x3c4a4a['filters']));if(_0x51eab9[_0xac70('0x40')][_0xac70('0x63')]){_0x591863['where']=_['merge'](_0x591863[_0xac70('0x4c')],{'$or':_['map'](_0x591863['attributes'],function(_0x4537e0){var _0x3f157e={};_0x3f157e[_0x4537e0]={'$like':'%'+_0x51eab9[_0xac70('0x40')][_0xac70('0x63')]+'%'};return _0x3f157e;})});}_0x591863=_['merge']({},_0x591863,_0x51eab9[_0xac70('0x4e')]);return _0x49a772[_0xac70('0x71')](_0x591863);}})[_0xac70('0x1c')](function(_0x3ac201){if(_0x3ac201){_0x15d085=_0x3ac201[_0xac70('0x45')];if(!_0x51eab9['query'][_0xac70('0x46')](_0xac70('0x47'))){_0x591863[_0xac70('0x29')]=qs[_0xac70('0x29')](_0x51eab9['query'][_0xac70('0x29')]);_0x591863['offset']=qs['offset'](_0x51eab9[_0xac70('0x40')][_0xac70('0x27')]);}return _0x49a772[_0xac70('0x71')](_0x591863);}})[_0xac70('0x1c')](function(_0x4dc375){if(_0x4dc375){return _0x4dc375?{'count':_0x15d085,'rows':_0x4dc375}:null;}})[_0xac70('0x1c')](respondWithResult(_0x279909,null))['catch'](handleError(_0x279909,null));};exports[_0xac70('0x72')]=function(_0x5d1513,_0x497fe2){var _0xd48ef2=_0x5d1513[_0xac70('0x54')]['id'];var _0x4ee8b7=_0x5d1513[_0xac70('0x58')];var _0x43e0d9=0xc8;var _0x5ad41b=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0xac70('0x73')][_0xac70('0x74')][_0xac70('0x75')]},function(_0x5bb577){return db[_0xac70('0x3a')][_0xac70('0x68')]({'where':{'id':_0xd48ef2},'transaction':_0x5bb577})['then'](function(_0x5f0b50){if(_0x5f0b50){return db[_0xac70('0x76')]['destroy']({'where':{'WhatsappAccountId':_0xd48ef2},'transaction':_0x5bb577})['then'](function(){var _0x562ea9=_[_0xac70('0x39')](_0x4ee8b7,function(_0x2c5986){_0x2c5986[_0xac70('0x62')]=_0xd48ef2;return _0x2c5986;});return db[_0xac70('0x76')][_0xac70('0x77')](_0x562ea9,{'transaction':_0x5bb577});});}else{_0x43e0d9=0x194;_0x5ad41b=[];}});})[_0xac70('0x1c')](function(){if(_0x43e0d9!==0x194){return db[_0xac70('0x76')][_0xac70('0x78')]({'where':{'WhatsappAccountId':_0xd48ef2},'order':_0xac70('0x79')})[_0xac70('0x1c')](function(_0x28217b){_0x5ad41b=_0x28217b;});}})[_0xac70('0x25')](function(_0x5b14){_0x43e0d9=0x1f4;logger['error'](_0x5b14[_0xac70('0x35')]);if(_0x5b14[_0xac70('0x36')]){delete _0x5b14[_0xac70('0x36')];}_0x5ad41b=_0x5b14;})['finally'](function(){if(_0x5ad41b===null){_0x497fe2['sendStatus'](_0x43e0d9);}else{if(_0x43e0d9===0x1f4){_0x497fe2['status'](_0x43e0d9)['send'](_0x5ad41b);}else{_0x497fe2[_0xac70('0x26')](_0x43e0d9)[_0xac70('0x2c')](_0x5ad41b);}}});};exports['getApplications']=function(_0x512d49,_0x3c3fb7,_0x504b1b){var _0x3dc1a4={};var _0x1654d0={};var _0xa85bc6;var _0x3314c3;return db[_0xac70('0x3a')][_0xac70('0x68')]({'where':{'id':_0x512d49['params']['id']}})[_0xac70('0x1c')](handleEntityNotFound(_0x3c3fb7,null))[_0xac70('0x1c')](function(_0x5838a9){if(_0x5838a9){_0xa85bc6=_0x5838a9;_0x1654d0['model']=_[_0xac70('0x55')](db[_0xac70('0x76')]['rawAttributes']);_0x1654d0[_0xac70('0x40')]=_[_0xac70('0x55')](_0x512d49['query']);_0x1654d0[_0xac70('0x41')]=_[_0xac70('0x42')](_0x1654d0[_0xac70('0x3f')],_0x1654d0[_0xac70('0x40')]);_0x3dc1a4['attributes']=_[_0xac70('0x42')](_0x1654d0[_0xac70('0x3f')],qs[_0xac70('0x44')](_0x512d49['query'][_0xac70('0x44')]));_0x3dc1a4[_0xac70('0x43')]=_0x3dc1a4[_0xac70('0x43')][_0xac70('0x45')]?_0x3dc1a4[_0xac70('0x43')]:_0x1654d0[_0xac70('0x3f')];_0x3dc1a4[_0xac70('0x48')]=qs['sort'](_0x512d49[_0xac70('0x40')]['sort']);_0x3dc1a4[_0xac70('0x4c')]=qs[_0xac70('0x41')](_[_0xac70('0x4a')](_0x512d49[_0xac70('0x40')],_0x1654d0[_0xac70('0x41')]));if(_0x512d49[_0xac70('0x40')]['filter']){_0x3dc1a4[_0xac70('0x4c')]=_[_0xac70('0x4b')](_0x3dc1a4[_0xac70('0x4c')],{'$or':_[_0xac70('0x39')](_0x3dc1a4[_0xac70('0x43')],function(_0x41d89e){var _0x5bc3d2={};_0x5bc3d2[_0x41d89e]={'$like':'%'+_0x512d49[_0xac70('0x40')][_0xac70('0x63')]+'%'};return _0x5bc3d2;})});}_0x3dc1a4=_[_0xac70('0x4b')]({},_0x3dc1a4,_0x512d49[_0xac70('0x4e')]);return _0xa85bc6[_0xac70('0x7a')](_0x3dc1a4);}})[_0xac70('0x1c')](function(_0x4cc49b){if(_0x4cc49b){_0x3314c3=_0x4cc49b[_0xac70('0x45')];if(!_0x512d49['query'][_0xac70('0x46')]('nolimit')){_0x3dc1a4[_0xac70('0x29')]=qs[_0xac70('0x29')](_0x512d49[_0xac70('0x40')][_0xac70('0x29')]);_0x3dc1a4[_0xac70('0x27')]=qs[_0xac70('0x27')](_0x512d49[_0xac70('0x40')][_0xac70('0x27')]);}return _0xa85bc6['getApplications'](_0x3dc1a4);}})['then'](function(_0x35e493){if(_0x35e493){return _0x35e493?{'count':_0x3314c3,'rows':_0x35e493}:null;}})[_0xac70('0x1c')](respondWithResult(_0x3c3fb7,null))[_0xac70('0x25')](handleError(_0x3c3fb7,null));};exports[_0xac70('0x7b')]=function(_0x5e31af,_0x262c2d,_0x13e577){var _0x539d93={'channel':_0xac70('0x7c')};var _0xa79f15=[];var _0x8575d5=[];var _0x2679b4={};return db[_0xac70('0x3a')]['find']({'where':{'id':_0x5e31af[_0xac70('0x54')]['id']},'include':[{'model':db[_0xac70('0x76')],'as':_0xac70('0x7d')}]})[_0xac70('0x1c')](handleEntityNotFound(_0x262c2d,null))[_0xac70('0x1c')](function(_0x1ac2fa){_0x539d93[_0xac70('0x7e')]=_0x1ac2fa;if(_0x539d93[_0xac70('0x7e')]&&_0x539d93[_0xac70('0x7e')][_0xac70('0x3d')]===_0xac70('0x7f')&&_0x5e31af[_0xac70('0x58')][_0xac70('0x80')]){if(_0x5e31af[_0xac70('0x58')][_0xac70('0x80')][_0xac70('0x45')]===0x0)return;if(_0x5e31af[_0xac70('0x58')]['statuses'][0x0][_0xac70('0x81')]!==_0xac70('0x82'))return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0x5e31af[_0xac70('0x58')][_0xac70('0x80')][0x0]['timestamp']},{'where':{'messageId':_0x5e31af[_0xac70('0x58')]['statuses'][0x0][_0xac70('0x83')]},'individualHooks':!![]})['then'](function(_0x4c9798){return _0x262c2d['status'](0xc8)[_0xac70('0x2c')](_0x4c9798);});}_0x539d93[_0xac70('0x84')]=_[_0xac70('0x85')](_0x1ac2fa[_0xac70('0x7d')],[_0xac70('0x79')],['asc']);if(_0x539d93['account'][_0xac70('0x7d')]){delete _0x539d93[_0xac70('0x7e')][_0xac70('0x7d')];}return db[_0xac70('0x86')][_0xac70('0x5f')]()[_0xac70('0x1c')](function(_0x3ca9e6){if(!_0x3ca9e6){throw new db[(_0xac70('0x87'))][(_0xac70('0x88'))](_0xac70('0x89'));}_0xa79f15=_[_0xac70('0x8a')](_[_0xac70('0x55')](_0x3ca9e6),[_0xac70('0x8b'),_0xac70('0x8c')]);_0x8575d5=_[_0xac70('0x8a')](_[_0xac70('0x55')](_0x3ca9e6),['createdAt',_0xac70('0x8c'),_0xac70('0x8d'),_0xac70('0x8e')]);_0x539d93['body']={'mapKey':_0xac70('0x8f')};if(_0x539d93['account']&&_0x539d93['account']['type']===_0xac70('0x90')){_0x539d93[_0xac70('0x58')][_0xac70('0x91')]=_0x5e31af[_0xac70('0x58')][_0xac70('0x92')][_0xac70('0x93')](_0xac70('0x94'),'');_0x539d93['body'][_0xac70('0x58')]=_0x5e31af[_0xac70('0x58')][_0xac70('0x95')];_0x539d93['body'][_0xac70('0x96')]=_0x5e31af[_0xac70('0x58')]['MessageSid'];}if(_0x539d93[_0xac70('0x7e')]&&_0x539d93[_0xac70('0x7e')][_0xac70('0x3d')]===_0xac70('0x7f')){_0x539d93[_0xac70('0x58')][_0xac70('0x91')]=_0x5e31af[_0xac70('0x58')][_0xac70('0x97')][0x0][_0xac70('0x91')];_0x539d93[_0xac70('0x58')][_0xac70('0x58')]=_0x5e31af[_0xac70('0x58')]['notifications'][0x0][_0xac70('0x22')][_0xac70('0x58')];_0x539d93[_0xac70('0x58')][_0xac70('0x96')]=_0x5e31af[_0xac70('0x58')][_0xac70('0x97')][0x0]['message_id'];}if(_0x539d93[_0xac70('0x58')]['id']){delete _0x539d93[_0xac70('0x58')]['id'];}if(_['isNil'](_0x539d93['body']['from'])){throw new db[(_0xac70('0x87'))][(_0xac70('0x88'))](_0xac70('0x98'));}if(_[_0xac70('0x99')](_0x539d93[_0xac70('0x58')][_0xac70('0x58')])||_0x539d93['body'][_0xac70('0x58')]===''){throw new db[(_0xac70('0x87'))][(_0xac70('0x88'))](_0xac70('0x9a'));}if(_['isNil'](_0x539d93[_0xac70('0x58')][_0xac70('0x9b')])){throw new db[(_0xac70('0x87'))][(_0xac70('0x88'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x8575d5);}if(!_[_0xac70('0x9c')](_0x8575d5,_0x539d93[_0xac70('0x58')][_0xac70('0x9b')])){throw new db[(_0xac70('0x87'))][(_0xac70('0x88'))](_0xac70('0x9d')+_0x8575d5);}_0x2679b4[_0x539d93[_0xac70('0x58')]['mapKey']]=_0x539d93[_0xac70('0x58')]['from'];return db[_0xac70('0x9e')][_0xac70('0x56')]({'where':{'id':_0x539d93[_0xac70('0x7e')][_0xac70('0x8e')]},'include':[{'model':db[_0xac70('0x86')],'as':'Contacts','where':_0x2679b4,'limit':0x1,'order':[[_0xac70('0x8c'),_0xac70('0x9f')]]}]});})['then'](handleEntityNotFound(_0x262c2d,null))[_0xac70('0x1c')](function(_0x4ccad6){if(_0x4ccad6){_0x539d93[_0xac70('0xa0')]=_[_0xac70('0xa1')](_0x4ccad6,[_0xac70('0xa2')]);if(_0x4ccad6[_0xac70('0xa2')][_0xac70('0x45')]){return _0x4ccad6[_0xac70('0xa2')][0x0];}var _0x5e4dbd=_['defaults'](_0x539d93[_0xac70('0x58')],{'firstName':_0x539d93['body'][_0xac70('0x91')],'ListId':_0x4ccad6['id']});_0x5e4dbd[_0x539d93[_0xac70('0x58')][_0xac70('0x9b')]]=_0x539d93[_0xac70('0x58')][_0xac70('0x91')];return db[_0xac70('0x86')][_0xac70('0x57')](_0x5e4dbd,{'fields':_0xa79f15,'raw':!![]});}})['then'](handleEntityNotFound(_0x262c2d,null))[_0xac70('0x1c')](function(_0x17feba){if(_0x17feba){_0x539d93['contact']=_0x17feba;var _0x20f2e5={'ContactId':_0x17feba['id'],'phone':_0x539d93[_0xac70('0x58')][_0xac70('0x91')],'WhatsappAccountId':_0x5e31af[_0xac70('0x54')]['id']};var _0x20ead9={'ContactId':_0x17feba['id'],'WhatsappAccountId':_0x5e31af[_0xac70('0x54')]['id'],'closed':![]};return db[_0xac70('0xa3')][_0xac70('0x56')]({'where':_0x20ead9})[_0xac70('0x1c')](function(_0x2ba90f){if(_0x2ba90f){return[_0x2ba90f,![]];}return db[_0xac70('0xa3')][_0xac70('0x57')](_0x20f2e5)['then'](function(_0x1389e9){return[_0x1389e9,!![]];});});}})['spread'](function(_0x41473a,_0x1c6cb8){_0x539d93[_0xac70('0xa4')]=_0x41473a[_0xac70('0xa5')]({'plain':!![]});_0x539d93[_0xac70('0xa4')][_0xac70('0xa6')]=![];if(_0x1c6cb8){if(_0x539d93[_0xac70('0x7e')][_0xac70('0xa7')]){_0x539d93[_0xac70('0x84')][_0xac70('0xa8')]({'id':0x0,'priority':_0x539d93[_0xac70('0x84')]['length']+0x1,'app':_0xac70('0xa9'),'appdata':_0xac70('0xaa'),'interval':_0xac70('0xab')});}_0x539d93['interaction']['created']=!![];}return db['WhatsappMessage']['create']({'phone':_0x539d93['body'][_0xac70('0x91')],'messageId':_0x539d93[_0xac70('0x58')][_0xac70('0x96')],'body':_0x539d93['body'][_0xac70('0x58')],'WhatsappAccountId':_0x5e31af[_0xac70('0x54')]['id'],'WhatsappInteractionId':_0x41473a['id'],'direction':'in','ContactId':_0x41473a['ContactId'],'AttachmentId':_0x539d93[_0xac70('0x58')][_0xac70('0xac')]});})[_0xac70('0x1c')](function(_0xc8a099){_0x539d93[_0xac70('0x22')]=_0xc8a099;if(_0x539d93[_0xac70('0xa4')][_0xac70('0xad')]){return db[_0xac70('0xae')][_0xac70('0x56')]({'attributes':['id',_0xac70('0x36')],'where':{'id':_0x539d93[_0xac70('0xa4')][_0xac70('0xad')]}})[_0xac70('0x1c')](function(_0x2e6e06){if(_0x2e6e06){_0x539d93[_0xac70('0x84')][_0xac70('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2e6e06[_0xac70('0x36')]+','+(_0x539d93[_0xac70('0x7e')][_0xac70('0xb0')]||0xa),'interval':_0xac70('0xab')});}return respondWithRpcPromise(_0xac70('0xb1'),_0xac70('0xb2'),_0x539d93);});}return respondWithRpcPromise(_0xac70('0xb1'),_0xac70('0xb2'),_0x539d93);})[_0xac70('0x1c')](function(_0x48056d){if(_0x48056d){var _0x5b6a25=0xc8;var _0x16220b=_0xac70('0xb3');logger['info'](_0xac70('0xb4'),_0x16220b,_0x5b6a25,_0xac70('0xb5'));logger['debug'](_0xac70('0xb6'),_0x16220b,_0x5b6a25,_0xac70('0xb5'),JSON[_0xac70('0x20')](_0x48056d));if(_0x539d93[_0xac70('0x7e')][_0xac70('0x3d')]===_0xac70('0x90')){return _0x262c2d['status'](_0x5b6a25)[_0xac70('0x2b')](_0xac70('0xb7'),_0xac70('0xb8'))['send'](_0xac70('0xb9'));}else{return _0x262c2d['status'](_0x5b6a25)[_0xac70('0x2c')](_0x48056d);}}});})[_0xac70('0x25')](handleError(_0x262c2d,null));};exports[_0xac70('0x37')]=function(_0x32d661,_0x25890d,_0x564908){var _0x578a2a,_0x4cebf7,_0x2b1487;if(_[_0xac70('0x99')](_0x32d661['body'][_0xac70('0x58')])||_0x32d661[_0xac70('0x58')]['body']===''){throw new db['Sequelize'][(_0xac70('0x88'))](_0xac70('0x9a'));}if(_[_0xac70('0x99')](_0x32d661[_0xac70('0x58')]['to'])){throw new db[(_0xac70('0x87'))][(_0xac70('0x88'))](_0xac70('0xba'));}_0x578a2a=_0x32d661['body']['to'];return db[_0xac70('0x3a')][_0xac70('0x56')]({'where':{'id':_0x32d661[_0xac70('0x54')]['id']},'include':[{'model':db[_0xac70('0x9e')],'as':'List','include':[{'model':db[_0xac70('0x86')],'as':_0xac70('0xa2'),'where':{'mobile':_0x578a2a},'limit':0x1,'order':[['updatedAt',_0xac70('0x9f')]]}]}]})['then'](handleEntityNotFound(_0x25890d,null))['then'](function(_0x30af7a){if(_0x30af7a&&_0x30af7a[_0xac70('0xbb')]){_0x4cebf7=_0x30af7a[_0xac70('0xa5')]({'plain':!![]});if(_0x4cebf7[_0xac70('0xbb')]&&_0x4cebf7[_0xac70('0xbb')]['Contacts']['length']){return _0x4cebf7[_0xac70('0xbb')][_0xac70('0xa2')][0x0];}return db[_0xac70('0x86')]['create'](_[_0xac70('0x16')](_0x32d661['body'],{'firstName':_0x578a2a,'mobile':_0x578a2a,'phone':_0x578a2a,'ListId':_0x4cebf7['ListId']}));}})[_0xac70('0x1c')](handleEntityNotFound(_0x25890d,null))[_0xac70('0x1c')](function(_0x4aa844){if(_0x4aa844){_0x2b1487=_0x4aa844;return db[_0xac70('0xa3')]['find']({'where':{'ContactId':_0x2b1487['id'],'closed':![],'WhatsappAccountId':_0x4cebf7['id']}})[_0xac70('0x1c')](function(_0x42b2e2){if(_0x42b2e2){return[_0x42b2e2,![]];}return db[_0xac70('0xa3')]['create']({'UserId':_0x32d661['user']['id'],'ContactId':_0x2b1487['id'],'WhatsappAccountId':_0x4cebf7['id'],'phone':_0x578a2a,'firstMsgDirection':_0xac70('0xbc'),'Messages':[_['merge'](_0x32d661[_0xac70('0x58')],{'read':![],'body':_0x32d661[_0xac70('0x58')]['body'],'phone':_0x578a2a,'WhatsappAccountId':_0x4cebf7['id'],'UserId':_0x32d661[_0xac70('0x59')]['id'],'ContactId':_0x2b1487['id']})]},{'include':[{'model':db[_0xac70('0xbd')],'as':'Messages'}]})[_0xac70('0x1c')](function(_0x17a6a6){return[_0x17a6a6,!![]];});});}})[_0xac70('0x6b')](function(_0x4fdc2b,_0x362713){if(_0x362713){return _0x4fdc2b;}return db['WhatsappMessage'][_0xac70('0x57')](_[_0xac70('0x4b')](_0x32d661[_0xac70('0x58')],{'read':![],'body':_0x32d661[_0xac70('0x58')][_0xac70('0x58')],'phone':_0x578a2a,'WhatsappAccountId':_0x4cebf7['id'],'WhatsappInteractionId':_0x4fdc2b['id'],'UserId':_0x32d661[_0xac70('0x59')]['id'],'ContactId':_0x2b1487['id']}))[_0xac70('0x1c')](function(_0x2465c4){_0x4fdc2b['dataValues'][_0xac70('0xbe')]=[];_0x4fdc2b[_0xac70('0xbf')][_0xac70('0xbe')]['push'](_0x2465c4[_0xac70('0xbf')]);return _0x4fdc2b;});})[_0xac70('0x1c')](respondWithResult(_0x25890d,null))[_0xac70('0x25')](handleError(_0x25890d,null));};
\ No newline at end of file
index 911f8bb..eb11190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9c9=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa9c9,0x137));var _0x9a9c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa9c9[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x9a9c('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9a9c('0x1')](0x0);var events={'afterCreate':_0x9a9c('0x2'),'afterUpdate':'update','afterDestroy':_0x9a9c('0x3')};function emitEvent(_0x42f9da){return function(_0x467b3c,_0x3dfa62,_0x64680e){WhatsappAccountEvents[_0x9a9c('0x4')](_0x42f9da+':'+_0x467b3c['id'],_0x467b3c);WhatsappAccountEvents[_0x9a9c('0x4')](_0x42f9da,_0x467b3c);_0x64680e(null);};}for(var e in events){if(events[_0x9a9c('0x5')](e)){var event=events[e];WhatsappAccount[_0x9a9c('0x6')](e,emitEvent(event));}}module[_0x9a9c('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x7322=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x5b4a3c,_0x2be712){var _0x2b2000=function(_0x1e579e){while(--_0x1e579e){_0x5b4a3c['push'](_0x5b4a3c['shift']());}};_0x2b2000(++_0x2be712);}(_0x7322,0x12f));var _0x2732=function(_0x4b2b5a,_0x3f7555){_0x4b2b5a=_0x4b2b5a-0x0;var _0x47f812=_0x7322[_0x4b2b5a];return _0x47f812;};'use strict';var EventEmitter=require(_0x2732('0x0'));var WhatsappAccount=require(_0x2732('0x1'))['db'][_0x2732('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x2732('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2732('0x4'),'afterDestroy':_0x2732('0x5')};function emitEvent(_0x5958b0){return function(_0x42db3c,_0x2a2b2a,_0x4536aa){WhatsappAccountEvents[_0x2732('0x6')](_0x5958b0+':'+_0x42db3c['id'],_0x42db3c);WhatsappAccountEvents[_0x2732('0x6')](_0x5958b0,_0x42db3c);_0x4536aa(null);};}for(var e in events){if(events[_0x2732('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x2732('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
index e172d85..8c5e4c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ebb=['util','../../config/logger','bluebird','request-promise','path','define','whatsapp_accounts','lodash'];(function(_0x4b9775,_0x7b6f4f){var _0x1e86b7=function(_0x2bfcc7){while(--_0x2bfcc7){_0x4b9775['push'](_0x4b9775['shift']());}};_0x1e86b7(++_0x7b6f4f);}(_0x2ebb,0x67));var _0xb2eb=function(_0x76d9f,_0x5b30ed){_0x76d9f=_0x76d9f-0x0;var _0x16f1ea=_0x2ebb[_0x76d9f];return _0x16f1ea;};'use strict';var _=require(_0xb2eb('0x0'));var util=require(_0xb2eb('0x1'));var logger=require(_0xb2eb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb2eb('0x3'));var rp=require(_0xb2eb('0x4'));var fs=require('fs');var path=require(_0xb2eb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x3fbcef,_0x40b3a3){return _0x3fbcef[_0xb2eb('0x6')]('WhatsappAccount',attributes,{'tableName':_0xb2eb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf102=['request-promise','path','rimraf','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0xf102,0x13b));var _0x2f10=function(_0x32b4aa,_0x12eba6){_0x32b4aa=_0x32b4aa-0x0;var _0x473160=_0xf102[_0x32b4aa];return _0x473160;};'use strict';var _=require(_0x2f10('0x0'));var util=require(_0x2f10('0x1'));var logger=require(_0x2f10('0x2'))(_0x2f10('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f10('0x4'));var fs=require('fs');var path=require(_0x2f10('0x5'));var rimraf=require(_0x2f10('0x6'));var config=require('../../config/environment');var attributes=require(_0x2f10('0x7'));module['exports']=function(_0x51d4db,_0x4d514e){return _0x51d4db[_0x2f10('0x8')](_0x2f10('0x9'),attributes,{'tableName':_0x2f10('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b21d947..d4a1068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf253=['redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','WhatsappAccount','find','options','raw','where','attributes','map','include','model','ShowWhatsappAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x297044,_0x3c6522){var _0x346493=function(_0x556521){while(--_0x556521){_0x297044['push'](_0x297044['shift']());}};_0x346493(++_0x3c6522);}(_0xf253,0x139));var _0x3f25=function(_0x25ea25,_0x570998){_0x25ea25=_0x25ea25-0x0;var _0x1d453c=_0xf253[_0x25ea25];return _0x1d453c;};'use strict';var _=require('lodash');var util=require(_0x3f25('0x0'));var moment=require(_0x3f25('0x1'));var BPromise=require(_0x3f25('0x2'));var rs=require(_0x3f25('0x3'));var fs=require('fs');var Redis=require(_0x3f25('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f25('0x5'));var logger=require('../../config/logger')(_0x3f25('0x6'));var config=require(_0x3f25('0x7'));var jayson=require(_0x3f25('0x8'));var client=jayson[_0x3f25('0x9')][_0x3f25('0xa')]({'port':0x232a});config[_0x3f25('0xb')]=_[_0x3f25('0xc')](config[_0x3f25('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f25('0xd'))(new Redis(config[_0x3f25('0xb')]));require(_0x3f25('0xe'))[_0x3f25('0xf')](socket);function respondWithRpcPromise(_0x22f218,_0x4b0bfd,_0x579a21){return new BPromise(function(_0x2708df,_0x2e72fe){return client[_0x3f25('0x10')](_0x22f218,_0x579a21)[_0x3f25('0x11')](function(_0x5391ed){logger[_0x3f25('0x12')](_0x3f25('0x13'),_0x4b0bfd,'request\x20sent');logger[_0x3f25('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4b0bfd,_0x3f25('0x15'),JSON[_0x3f25('0x16')](_0x5391ed));if(_0x5391ed['error']){if(_0x5391ed[_0x3f25('0x17')][_0x3f25('0x18')]===0x1f4){logger[_0x3f25('0x17')](_0x3f25('0x13'),_0x4b0bfd,_0x5391ed[_0x3f25('0x17')][_0x3f25('0x19')]);return _0x2e72fe(_0x5391ed['error'][_0x3f25('0x19')]);}logger[_0x3f25('0x17')](_0x3f25('0x13'),_0x4b0bfd,_0x5391ed['error']['message']);return _0x2708df(_0x5391ed[_0x3f25('0x17')][_0x3f25('0x19')]);}else{logger['info'](_0x3f25('0x13'),_0x4b0bfd,_0x3f25('0x15'));_0x2708df(_0x5391ed['result']['message']);}})['catch'](function(_0x3703b1){logger[_0x3f25('0x17')](_0x3f25('0x13'),_0x4b0bfd,_0x3703b1);_0x2e72fe(_0x3703b1);});});}exports['ShowWhatsappAccount']=function(_0x3cee37){var _0x37304a=this;return new Promise(function(_0x440479,_0x238ff4){return db[_0x3f25('0x1a')][_0x3f25('0x1b')]({'raw':_0x3cee37[_0x3f25('0x1c')]?_0x3cee37['options'][_0x3f25('0x1d')]===undefined?!![]:![]:!![],'where':_0x3cee37[_0x3f25('0x1c')]?_0x3cee37['options'][_0x3f25('0x1e')]||null:null,'attributes':_0x3cee37[_0x3f25('0x1c')]?_0x3cee37[_0x3f25('0x1c')][_0x3f25('0x1f')]||null:null,'include':_0x3cee37[_0x3f25('0x1c')]?_0x3cee37[_0x3f25('0x1c')]['include']?_[_0x3f25('0x20')](_0x3cee37[_0x3f25('0x1c')][_0x3f25('0x21')],function(_0x12a9c9){return{'model':db[_0x12a9c9[_0x3f25('0x22')]],'as':_0x12a9c9['as'],'attributes':_0x12a9c9['attributes'],'include':_0x12a9c9[_0x3f25('0x21')]?_[_0x3f25('0x20')](_0x12a9c9[_0x3f25('0x21')],function(_0x413d8b){return{'model':db[_0x413d8b['model']],'as':_0x413d8b['as'],'attributes':_0x413d8b[_0x3f25('0x1f')],'include':_0x413d8b['include']?_['map'](_0x413d8b[_0x3f25('0x21')],function(_0x10d03f){return{'model':db[_0x10d03f['model']],'as':_0x10d03f['as'],'attributes':_0x10d03f[_0x3f25('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3f25('0x11')](function(_0x4e4cc8){logger['info']('ShowWhatsappAccount',_0x3cee37);logger[_0x3f25('0x14')](_0x3f25('0x23'),_0x3cee37,JSON['stringify'](_0x4e4cc8));_0x440479(_0x4e4cc8);})['catch'](function(_0x35183c){logger[_0x3f25('0x17')]('ShowWhatsappAccount',_0x35183c[_0x3f25('0x19')],_0x3cee37);_0x238ff4(_0x37304a[_0x3f25('0x17')](0x1f4,_0x35183c[_0x3f25('0x19')]));});});};
\ No newline at end of file
+var _0x79df=['ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map','model','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch'];(function(_0x4104ce,_0x234584){var _0x3c9e2c=function(_0x571393){while(--_0x571393){_0x4104ce['push'](_0x4104ce['shift']());}};_0x3c9e2c(++_0x234584);}(_0x79df,0xee));var _0xf79d=function(_0x11fcd2,_0x159f21){_0x11fcd2=_0x11fcd2-0x0;var _0x3c59c5=_0x79df[_0x11fcd2];return _0x3c59c5;};'use strict';var _=require(_0xf79d('0x0'));var util=require(_0xf79d('0x1'));var moment=require('moment');var BPromise=require(_0xf79d('0x2'));var rs=require(_0xf79d('0x3'));var fs=require('fs');var Redis=require(_0xf79d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf79d('0x5'));var logger=require(_0xf79d('0x6'))(_0xf79d('0x7'));var config=require(_0xf79d('0x8'));var jayson=require(_0xf79d('0x9'));var client=jayson[_0xf79d('0xa')][_0xf79d('0xb')]({'port':0x232a});config['redis']=_[_0xf79d('0xc')](config[_0xf79d('0xd')],{'host':_0xf79d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf79d('0xd')]));require(_0xf79d('0xf'))[_0xf79d('0x10')](socket);function respondWithRpcPromise(_0x40c7f6,_0x752799,_0x4be23f){return new BPromise(function(_0xfa793a,_0x133bad){return client[_0xf79d('0x11')](_0x40c7f6,_0x4be23f)[_0xf79d('0x12')](function(_0x265eed){logger['info'](_0xf79d('0x13'),_0x752799,_0xf79d('0x14'));logger[_0xf79d('0x15')](_0xf79d('0x16'),_0x752799,'request\x20sent',JSON['stringify'](_0x265eed));if(_0x265eed[_0xf79d('0x17')]){if(_0x265eed[_0xf79d('0x17')]['code']===0x1f4){logger['error'](_0xf79d('0x13'),_0x752799,_0x265eed[_0xf79d('0x17')][_0xf79d('0x18')]);return _0x133bad(_0x265eed[_0xf79d('0x17')][_0xf79d('0x18')]);}logger['error'](_0xf79d('0x13'),_0x752799,_0x265eed[_0xf79d('0x17')][_0xf79d('0x18')]);return _0xfa793a(_0x265eed[_0xf79d('0x17')][_0xf79d('0x18')]);}else{logger[_0xf79d('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x752799,_0xf79d('0x14'));_0xfa793a(_0x265eed[_0xf79d('0x1a')][_0xf79d('0x18')]);}})[_0xf79d('0x1b')](function(_0x542687){logger[_0xf79d('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x752799,_0x542687);_0x133bad(_0x542687);});});}exports[_0xf79d('0x1c')]=function(_0x392196){var _0x510ac4=this;return new Promise(function(_0x14206c,_0x4d8947){return db[_0xf79d('0x1d')][_0xf79d('0x1e')]({'raw':_0x392196[_0xf79d('0x1f')]?_0x392196[_0xf79d('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x392196[_0xf79d('0x1f')]?_0x392196[_0xf79d('0x1f')][_0xf79d('0x20')]||null:null,'attributes':_0x392196[_0xf79d('0x1f')]?_0x392196[_0xf79d('0x1f')][_0xf79d('0x21')]||null:null,'include':_0x392196[_0xf79d('0x1f')]?_0x392196[_0xf79d('0x1f')][_0xf79d('0x22')]?_[_0xf79d('0x23')](_0x392196[_0xf79d('0x1f')][_0xf79d('0x22')],function(_0x2eafdd){return{'model':db[_0x2eafdd['model']],'as':_0x2eafdd['as'],'attributes':_0x2eafdd['attributes'],'include':_0x2eafdd[_0xf79d('0x22')]?_[_0xf79d('0x23')](_0x2eafdd[_0xf79d('0x22')],function(_0x3a59d1){return{'model':db[_0x3a59d1[_0xf79d('0x24')]],'as':_0x3a59d1['as'],'attributes':_0x3a59d1[_0xf79d('0x21')],'include':_0x3a59d1['include']?_[_0xf79d('0x23')](_0x3a59d1[_0xf79d('0x22')],function(_0x3ee13e){return{'model':db[_0x3ee13e['model']],'as':_0x3ee13e['as'],'attributes':_0x3ee13e[_0xf79d('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf79d('0x12')](function(_0x4a0d5b){logger[_0xf79d('0x19')](_0xf79d('0x1c'),_0x392196);logger[_0xf79d('0x15')](_0xf79d('0x1c'),_0x392196,JSON[_0xf79d('0x25')](_0x4a0d5b));_0x14206c(_0x4a0d5b);})[_0xf79d('0x1b')](function(_0x3404fa){logger[_0xf79d('0x17')](_0xf79d('0x1c'),_0x3404fa[_0xf79d('0x18')],_0x392196);_0x4d8947(_0x510ac4[_0xf79d('0x17')](0x1f4,_0x3404fa['message']));});});};
\ No newline at end of file
index 4b5dbd1..6f2b8ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66d4=['remove','update','removeListener','register','./whatsappAccount.events','save'];(function(_0xa018a2,_0x4090bc){var _0x44ab22=function(_0xc20a94){while(--_0xc20a94){_0xa018a2['push'](_0xa018a2['shift']());}};_0x44ab22(++_0x4090bc);}(_0x66d4,0xfa));var _0x466d=function(_0x16cb03,_0x43ea58){_0x16cb03=_0x16cb03-0x0;var _0x10944e=_0x66d4[_0x16cb03];return _0x10944e;};'use strict';var WhatsappAccountEvents=require(_0x466d('0x0'));var events=[_0x466d('0x1'),_0x466d('0x2'),_0x466d('0x3')];function createListener(_0x59ecc6,_0xe12d74){return function(_0x4da4cd){_0xe12d74['emit'](_0x59ecc6,_0x4da4cd);};}function removeListener(_0x4f015f,_0x2bb1e6){return function(){WhatsappAccountEvents[_0x466d('0x4')](_0x4f015f,_0x2bb1e6);};}exports[_0x466d('0x5')]=function(_0x213f7b){for(var _0x5eb6fb=0x0,_0x50b2c0=events['length'];_0x5eb6fb<_0x50b2c0;_0x5eb6fb++){var _0x36ab41=events[_0x5eb6fb];var _0x411aee=createListener('whatsappAccount:'+_0x36ab41,_0x213f7b);WhatsappAccountEvents['on'](_0x36ab41,_0x411aee);}};
\ No newline at end of file
+var _0x1c4c=['register','whatsappAccount:','./whatsappAccount.events','emit','removeListener'];(function(_0x883d31,_0x50f7d0){var _0x4201bb=function(_0x3afc7e){while(--_0x3afc7e){_0x883d31['push'](_0x883d31['shift']());}};_0x4201bb(++_0x50f7d0);}(_0x1c4c,0x16a));var _0xc1c4=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x1c4c[_0x391c55];return _0xa434e0;};'use strict';var WhatsappAccountEvents=require(_0xc1c4('0x0'));var events=['save','remove','update'];function createListener(_0x58b23e,_0xa8b47e){return function(_0x312739){_0xa8b47e[_0xc1c4('0x1')](_0x58b23e,_0x312739);};}function removeListener(_0x53ac62,_0x2a1e44){return function(){WhatsappAccountEvents[_0xc1c4('0x2')](_0x53ac62,_0x2a1e44);};}exports[_0xc1c4('0x3')]=function(_0x38db2a){for(var _0x2c75e6=0x0,_0x35f53e=events['length'];_0x2c75e6<_0x35f53e;_0x2c75e6++){var _0x248273=events[_0x2c75e6];var _0x2a3888=createListener(_0xc1c4('0x4')+_0x248273,_0x38db2a);WhatsappAccountEvents['on'](_0x248273,_0x2a3888);}};
\ No newline at end of file
index 7c8abf7..82d6cf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x468f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','fs-extra'];(function(_0x3a1580,_0x565597){var _0xb101a6=function(_0xdb5833){while(--_0xdb5833){_0x3a1580['push'](_0x3a1580['shift']());}};_0xb101a6(++_0x565597);}(_0x468f,0x94));var _0xf468=function(_0x9765f2,_0x4fe9c6){_0x9765f2=_0x9765f2-0x0;var _0x27c61c=_0x468f[_0x9765f2];return _0x27c61c;};'use strict';var multer=require('multer');var util=require(_0xf468('0x0'));var path=require(_0xf468('0x1'));var timeout=require(_0xf468('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf468('0x3'));var auth=require(_0xf468('0x4'));var interaction=require(_0xf468('0x5'));var config=require(_0xf468('0x6'));var controller=require(_0xf468('0x7'));router[_0xf468('0x8')]('/',auth[_0xf468('0x9')](),controller[_0xf468('0xa')]);router[_0xf468('0x8')](_0xf468('0xb'),auth[_0xf468('0x9')](),controller[_0xf468('0xc')]);router[_0xf468('0xd')]('/',auth[_0xf468('0x9')](),controller[_0xf468('0xe')]);router[_0xf468('0xf')]('/:id',auth[_0xf468('0x9')](),controller[_0xf468('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf468('0x11')]);module[_0xf468('0x12')]=router;
\ No newline at end of file
+var _0xb4df=['./whatsappApplication.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x361229,_0x89f7fd){var _0x484ed0=function(_0x23bd60){while(--_0x23bd60){_0x361229['push'](_0x361229['shift']());}};_0x484ed0(++_0x89f7fd);}(_0xb4df,0x11a));var _0xfb4d=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xb4df[_0xc67528];return _0x38e26d;};'use strict';var multer=require(_0xfb4d('0x0'));var util=require('util');var path=require(_0xfb4d('0x1'));var timeout=require(_0xfb4d('0x2'));var express=require('express');var router=express[_0xfb4d('0x3')]();var fs_extra=require(_0xfb4d('0x4'));var auth=require(_0xfb4d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfb4d('0x6'));var controller=require(_0xfb4d('0x7'));router[_0xfb4d('0x8')]('/',auth[_0xfb4d('0x9')](),controller[_0xfb4d('0xa')]);router[_0xfb4d('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfb4d('0xb')]('/',auth[_0xfb4d('0x9')](),controller[_0xfb4d('0xc')]);router[_0xfb4d('0xd')](_0xfb4d('0xe'),auth[_0xfb4d('0x9')](),controller[_0xfb4d('0xf')]);router[_0xfb4d('0x10')](_0xfb4d('0xe'),auth[_0xfb4d('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index bdc0650..37d16fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f29=['INTEGER','STRING','TEXT','sequelize','exports'];(function(_0xa32d84,_0x3197da){var _0x41b869=function(_0x719fca){while(--_0x719fca){_0xa32d84['push'](_0xa32d84['shift']());}};_0x41b869(++_0x3197da);}(_0x2f29,0x6c));var _0x92f2=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x2f29[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0x92f2('0x0'));module[_0x92f2('0x1')]={'priority':{'type':Sequelize[_0x92f2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x92f2('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x92f2('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x92f2('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x176a=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x56d7ef,_0x38217c){var _0x51d9d8=function(_0x42bea2){while(--_0x42bea2){_0x56d7ef['push'](_0x56d7ef['shift']());}};_0x51d9d8(++_0x38217c);}(_0x176a,0xb5));var _0xa176=function(_0xaf8a25,_0x572004){_0xaf8a25=_0xaf8a25-0x0;var _0x25e31a=_0x176a[_0xaf8a25];return _0x25e31a;};'use strict';var Sequelize=require(_0xa176('0x0'));module[_0xa176('0x1')]={'priority':{'type':Sequelize[_0xa176('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa176('0x3')],'allowNull':![],'defaultValue':_0xa176('0x4')},'appdata':{'type':Sequelize[_0xa176('0x5')]()},'description':{'type':Sequelize[_0xa176('0x3')]},'interval':{'type':Sequelize[_0xa176('0x3')],'defaultValue':_0xa176('0x6')}};
\ No newline at end of file
index 1f59bea..7475903 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd36=['WhatsappApplication','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','fields','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map'];(function(_0x20d93a,_0x422a10){var _0x4e5cec=function(_0x56089c){while(--_0x56089c){_0x20d93a['push'](_0x20d93a['shift']());}};_0x4e5cec(++_0x422a10);}(_0xbd36,0x65));var _0x6bd3=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xbd36[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require(_0x6bd3('0x0'));var rimraf=require(_0x6bd3('0x1'));var zipdir=require(_0x6bd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6bd3('0x3'));var BPromise=require(_0x6bd3('0x4'));var Mustache=require('mustache');var util=require(_0x6bd3('0x5'));var path=require(_0x6bd3('0x6'));var sox=require(_0x6bd3('0x7'));var csv=require(_0x6bd3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6bd3('0x9'));var _=require(_0x6bd3('0xa'));var squel=require(_0x6bd3('0xb'));var crypto=require(_0x6bd3('0xc'));var jsforce=require(_0x6bd3('0xd'));var deskjs=require(_0x6bd3('0xe'));var toCsv=require(_0x6bd3('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6bd3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6bd3('0x10'));var as=require(_0x6bd3('0x11'));var hardwareService=require(_0x6bd3('0x12'));var logger=require(_0x6bd3('0x13'))(_0x6bd3('0x14'));var utils=require('../../config/utils');var config=require(_0x6bd3('0x15'));var licenseUtil=require(_0x6bd3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29c44d,_0x43bf5f){_0x43bf5f=_0x43bf5f||0xcc;return function(_0x2a047c){if(_0x2a047c){return _0x29c44d[_0x6bd3('0x17')](_0x43bf5f);}return _0x29c44d[_0x6bd3('0x18')](_0x43bf5f)[_0x6bd3('0x19')]();};}function respondWithResult(_0x4dd159,_0x141121){_0x141121=_0x141121||0xc8;return function(_0x4987f9){if(_0x4987f9){return _0x4dd159[_0x6bd3('0x18')](_0x141121)[_0x6bd3('0x1a')](_0x4987f9);}};}function respondWithFilteredResult(_0x5ad1f8,_0x583df8){return function(_0x47acc9){if(_0x47acc9){var _0x115ca9=typeof _0x583df8['offset']===_0x6bd3('0x1b')&&typeof _0x583df8[_0x6bd3('0x1c')]===_0x6bd3('0x1b');var _0x4732f3=_0x47acc9['count'];var _0x573656=_0x115ca9?0x0:_0x583df8[_0x6bd3('0x1d')];var _0x769de8=_0x115ca9?_0x47acc9[_0x6bd3('0x1e')]:_0x583df8[_0x6bd3('0x1d')]+_0x583df8[_0x6bd3('0x1c')];var _0xf96734;if(_0x769de8>=_0x4732f3){_0x769de8=_0x4732f3;_0xf96734=0xc8;}else{_0xf96734=0xce;}_0x5ad1f8[_0x6bd3('0x18')](_0xf96734);return _0x5ad1f8[_0x6bd3('0x1f')](_0x6bd3('0x20'),_0x573656+'-'+_0x769de8+'/'+_0x4732f3)[_0x6bd3('0x1a')](_0x47acc9);}return null;};}function patchUpdates(_0x256bca){return function(_0x175d46){try{jsonpatch[_0x6bd3('0x21')](_0x175d46,_0x256bca,!![]);}catch(_0x36618c){return BPromise[_0x6bd3('0x22')](_0x36618c);}return _0x175d46[_0x6bd3('0x23')]();};}function saveUpdates(_0x473b10,_0x1d09fd){return function(_0x9ffd4b){if(_0x9ffd4b){return _0x9ffd4b[_0x6bd3('0x24')](_0x473b10)['then'](function(_0x3365a4){return _0x3365a4;});}return null;};}function removeEntity(_0x3a9d0d,_0x28b9a9){return function(_0x52def3){if(_0x52def3){return _0x52def3[_0x6bd3('0x25')]()[_0x6bd3('0x26')](function(){_0x3a9d0d[_0x6bd3('0x18')](0xcc)[_0x6bd3('0x19')]();});}};}function handleEntityNotFound(_0xa8c894,_0x24230d){return function(_0x143055){if(!_0x143055){_0xa8c894[_0x6bd3('0x17')](0x194);}return _0x143055;};}function handleError(_0x49dc5c,_0xab162b){_0xab162b=_0xab162b||0x1f4;return function(_0x585f4e){logger[_0x6bd3('0x27')](_0x585f4e[_0x6bd3('0x28')]);if(_0x585f4e['name']){delete _0x585f4e[_0x6bd3('0x29')];}_0x49dc5c[_0x6bd3('0x18')](_0xab162b)[_0x6bd3('0x2a')](_0x585f4e);};}exports[_0x6bd3('0x2b')]=function(_0x4444bd,_0x1f45af){var _0x7f3385={},_0x552628={},_0xf12e0d={'count':0x0,'rows':[]};var _0xe2772a=_[_0x6bd3('0x2c')](db[_0x6bd3('0x2d')]['rawAttributes'],function(_0x5e1281){return{'name':_0x5e1281['fieldName'],'type':_0x5e1281[_0x6bd3('0x2e')][_0x6bd3('0x2f')]};});_0x552628[_0x6bd3('0x30')]=_[_0x6bd3('0x2c')](_0xe2772a,_0x6bd3('0x29'));_0x552628['query']=_[_0x6bd3('0x31')](_0x4444bd[_0x6bd3('0x32')]);_0x552628['filters']=_[_0x6bd3('0x33')](_0x552628[_0x6bd3('0x30')],_0x552628[_0x6bd3('0x32')]);_0x7f3385['attributes']=_[_0x6bd3('0x33')](_0x552628[_0x6bd3('0x30')],qs['fields'](_0x4444bd[_0x6bd3('0x32')]['fields']));_0x7f3385[_0x6bd3('0x34')]=_0x7f3385[_0x6bd3('0x34')][_0x6bd3('0x35')]?_0x7f3385[_0x6bd3('0x34')]:_0x552628[_0x6bd3('0x30')];if(!_0x4444bd[_0x6bd3('0x32')][_0x6bd3('0x36')]('nolimit')){_0x7f3385[_0x6bd3('0x1c')]=qs[_0x6bd3('0x1c')](_0x4444bd[_0x6bd3('0x32')][_0x6bd3('0x1c')]);_0x7f3385[_0x6bd3('0x1d')]=qs[_0x6bd3('0x1d')](_0x4444bd[_0x6bd3('0x32')][_0x6bd3('0x1d')]);}_0x7f3385[_0x6bd3('0x37')]=qs[_0x6bd3('0x38')](_0x4444bd[_0x6bd3('0x32')]['sort']);_0x7f3385['where']=qs[_0x6bd3('0x39')](_[_0x6bd3('0x3a')](_0x4444bd[_0x6bd3('0x32')],_0x552628[_0x6bd3('0x39')]),_0xe2772a);if(_0x4444bd['query'][_0x6bd3('0x3b')]){_0x7f3385['where']=_[_0x6bd3('0x3c')](_0x7f3385[_0x6bd3('0x3d')],{'$or':_['map'](_0xe2772a,function(_0x4b9031){if(_0x4b9031[_0x6bd3('0x2e')]!==_0x6bd3('0x3e')){var _0x18274d={};_0x18274d[_0x4b9031[_0x6bd3('0x29')]]={'$like':'%'+_0x4444bd['query'][_0x6bd3('0x3b')]+'%'};return _0x18274d;}})});}_0x7f3385=_[_0x6bd3('0x3c')]({},_0x7f3385,_0x4444bd[_0x6bd3('0x3f')]);var _0x581a22={'where':_0x7f3385[_0x6bd3('0x3d')]};return db['WhatsappApplication'][_0x6bd3('0x1e')](_0x581a22)[_0x6bd3('0x26')](function(_0x37019f){_0xf12e0d['count']=_0x37019f;if(_0x4444bd[_0x6bd3('0x32')][_0x6bd3('0x40')]){_0x7f3385[_0x6bd3('0x41')]=[{'all':!![]}];}return db[_0x6bd3('0x2d')]['findAll'](_0x7f3385);})[_0x6bd3('0x26')](function(_0x41199e){_0xf12e0d['rows']=_0x41199e;return _0xf12e0d;})[_0x6bd3('0x26')](respondWithFilteredResult(_0x1f45af,_0x7f3385))[_0x6bd3('0x42')](handleError(_0x1f45af,null));};exports['show']=function(_0x100015,_0x397dc8){var _0xe2ca49={'raw':!![],'where':{'id':_0x100015[_0x6bd3('0x43')]['id']}},_0x1dbd4c={};_0x1dbd4c[_0x6bd3('0x30')]=_[_0x6bd3('0x31')](db[_0x6bd3('0x2d')][_0x6bd3('0x44')]);_0x1dbd4c['query']=_[_0x6bd3('0x31')](_0x100015['query']);_0x1dbd4c[_0x6bd3('0x39')]=_[_0x6bd3('0x33')](_0x1dbd4c[_0x6bd3('0x30')],_0x1dbd4c[_0x6bd3('0x32')]);_0xe2ca49[_0x6bd3('0x34')]=_[_0x6bd3('0x33')](_0x1dbd4c[_0x6bd3('0x30')],qs[_0x6bd3('0x45')](_0x100015[_0x6bd3('0x32')][_0x6bd3('0x45')]));_0xe2ca49['attributes']=_0xe2ca49[_0x6bd3('0x34')]['length']?_0xe2ca49[_0x6bd3('0x34')]:_0x1dbd4c[_0x6bd3('0x30')];if(_0x100015['query'][_0x6bd3('0x40')]){_0xe2ca49['include']=[{'all':!![]}];}_0xe2ca49=_[_0x6bd3('0x3c')]({},_0xe2ca49,_0x100015[_0x6bd3('0x3f')]);return db[_0x6bd3('0x2d')]['find'](_0xe2ca49)[_0x6bd3('0x26')](handleEntityNotFound(_0x397dc8,null))[_0x6bd3('0x26')](respondWithResult(_0x397dc8,null))[_0x6bd3('0x42')](handleError(_0x397dc8,null));};exports[_0x6bd3('0x46')]=function(_0xfd7b2,_0xba735e){return db['WhatsappApplication'][_0x6bd3('0x46')](_0xfd7b2[_0x6bd3('0x47')],{})[_0x6bd3('0x26')](respondWithResult(_0xba735e,0xc9))['catch'](handleError(_0xba735e,null));};exports[_0x6bd3('0x24')]=function(_0x59cee9,_0x52dfb1){if(_0x59cee9[_0x6bd3('0x47')]['id']){delete _0x59cee9[_0x6bd3('0x47')]['id'];}return db['WhatsappApplication'][_0x6bd3('0x48')]({'where':{'id':_0x59cee9['params']['id']}})[_0x6bd3('0x26')](handleEntityNotFound(_0x52dfb1,null))[_0x6bd3('0x26')](saveUpdates(_0x59cee9[_0x6bd3('0x47')],null))[_0x6bd3('0x26')](respondWithResult(_0x52dfb1,null))[_0x6bd3('0x42')](handleError(_0x52dfb1,null));};exports['destroy']=function(_0x4e4b52,_0x417e4f){return db['WhatsappApplication'][_0x6bd3('0x48')]({'where':{'id':_0x4e4b52[_0x6bd3('0x43')]['id']}})[_0x6bd3('0x26')](handleEntityNotFound(_0x417e4f,null))[_0x6bd3('0x26')](removeEntity(_0x417e4f,null))['catch'](handleError(_0x417e4f,null));};
\ No newline at end of file
+var _0xab95=['destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','update','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then'];(function(_0x387159,_0x5d84ba){var _0x21bd36=function(_0x12de1b){while(--_0x12de1b){_0x387159['push'](_0x387159['shift']());}};_0x21bd36(++_0x5d84ba);}(_0xab95,0x1d5));var _0x5ab9=function(_0x4b02ec,_0x5ea646){_0x4b02ec=_0x4b02ec-0x0;var _0x2d4fbb=_0xab95[_0x4b02ec];return _0x2d4fbb;};'use strict';var emlformat=require(_0x5ab9('0x0'));var rimraf=require(_0x5ab9('0x1'));var zipdir=require(_0x5ab9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ab9('0x3'));var moment=require(_0x5ab9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5ab9('0x5'));var path=require(_0x5ab9('0x6'));var sox=require('sox');var csv=require(_0x5ab9('0x7'));var ejs=require(_0x5ab9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ab9('0x9'));var squel=require(_0x5ab9('0xa'));var crypto=require('crypto');var jsforce=require(_0x5ab9('0xb'));var deskjs=require(_0x5ab9('0xc'));var toCsv=require(_0x5ab9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5ab9('0xd'));var authService=require(_0x5ab9('0xe'));var qs=require(_0x5ab9('0xf'));var as=require(_0x5ab9('0x10'));var hardwareService=require(_0x5ab9('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5ab9('0x12'));var config=require(_0x5ab9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ab9('0x14'))['db'];function respondWithStatusCode(_0x5f2479,_0x43993a){_0x43993a=_0x43993a||0xcc;return function(_0x235916){if(_0x235916){return _0x5f2479[_0x5ab9('0x15')](_0x43993a);}return _0x5f2479[_0x5ab9('0x16')](_0x43993a)[_0x5ab9('0x17')]();};}function respondWithResult(_0x552b48,_0xec9e3c){_0xec9e3c=_0xec9e3c||0xc8;return function(_0x161c4c){if(_0x161c4c){return _0x552b48[_0x5ab9('0x16')](_0xec9e3c)['json'](_0x161c4c);}};}function respondWithFilteredResult(_0x4150d5,_0x56a4cd){return function(_0x4bcf18){if(_0x4bcf18){var _0x249172=typeof _0x56a4cd[_0x5ab9('0x18')]===_0x5ab9('0x19')&&typeof _0x56a4cd[_0x5ab9('0x1a')]===_0x5ab9('0x19');var _0x23bddf=_0x4bcf18[_0x5ab9('0x1b')];var _0x49970d=_0x249172?0x0:_0x56a4cd[_0x5ab9('0x18')];var _0x274383=_0x249172?_0x4bcf18['count']:_0x56a4cd[_0x5ab9('0x18')]+_0x56a4cd[_0x5ab9('0x1a')];var _0x559618;if(_0x274383>=_0x23bddf){_0x274383=_0x23bddf;_0x559618=0xc8;}else{_0x559618=0xce;}_0x4150d5[_0x5ab9('0x16')](_0x559618);return _0x4150d5[_0x5ab9('0x1c')](_0x5ab9('0x1d'),_0x49970d+'-'+_0x274383+'/'+_0x23bddf)[_0x5ab9('0x1e')](_0x4bcf18);}return null;};}function patchUpdates(_0x132c73){return function(_0x10d90f){try{jsonpatch[_0x5ab9('0x1f')](_0x10d90f,_0x132c73,!![]);}catch(_0x1205a6){return BPromise[_0x5ab9('0x20')](_0x1205a6);}return _0x10d90f[_0x5ab9('0x21')]();};}function saveUpdates(_0x3ee600,_0x1ee365){return function(_0x4c31e6){if(_0x4c31e6){return _0x4c31e6['update'](_0x3ee600)[_0x5ab9('0x22')](function(_0x5cc952){return _0x5cc952;});}return null;};}function removeEntity(_0x451da3,_0xdecd3d){return function(_0x1c45db){if(_0x1c45db){return _0x1c45db[_0x5ab9('0x23')]()[_0x5ab9('0x22')](function(){_0x451da3[_0x5ab9('0x16')](0xcc)[_0x5ab9('0x17')]();});}};}function handleEntityNotFound(_0x170f2d,_0x333f52){return function(_0x15bd3c){if(!_0x15bd3c){_0x170f2d['sendStatus'](0x194);}return _0x15bd3c;};}function handleError(_0x52f7d5,_0x2c65d2){_0x2c65d2=_0x2c65d2||0x1f4;return function(_0x120c92){logger[_0x5ab9('0x24')](_0x120c92[_0x5ab9('0x25')]);if(_0x120c92[_0x5ab9('0x26')]){delete _0x120c92[_0x5ab9('0x26')];}_0x52f7d5['status'](_0x2c65d2)[_0x5ab9('0x27')](_0x120c92);};}exports[_0x5ab9('0x28')]=function(_0x50a386,_0x2e492b){var _0x302a6c={},_0x4fccdf={},_0xe0f687={'count':0x0,'rows':[]};var _0x198b0f=_[_0x5ab9('0x29')](db[_0x5ab9('0x2a')][_0x5ab9('0x2b')],function(_0xf5c162){return{'name':_0xf5c162[_0x5ab9('0x2c')],'type':_0xf5c162['type']['key']};});_0x4fccdf[_0x5ab9('0x2d')]=_[_0x5ab9('0x29')](_0x198b0f,_0x5ab9('0x26'));_0x4fccdf[_0x5ab9('0x2e')]=_[_0x5ab9('0x2f')](_0x50a386[_0x5ab9('0x2e')]);_0x4fccdf[_0x5ab9('0x30')]=_[_0x5ab9('0x31')](_0x4fccdf[_0x5ab9('0x2d')],_0x4fccdf['query']);_0x302a6c[_0x5ab9('0x32')]=_[_0x5ab9('0x31')](_0x4fccdf[_0x5ab9('0x2d')],qs[_0x5ab9('0x33')](_0x50a386[_0x5ab9('0x2e')][_0x5ab9('0x33')]));_0x302a6c[_0x5ab9('0x32')]=_0x302a6c[_0x5ab9('0x32')]['length']?_0x302a6c[_0x5ab9('0x32')]:_0x4fccdf[_0x5ab9('0x2d')];if(!_0x50a386[_0x5ab9('0x2e')][_0x5ab9('0x34')](_0x5ab9('0x35'))){_0x302a6c[_0x5ab9('0x1a')]=qs[_0x5ab9('0x1a')](_0x50a386[_0x5ab9('0x2e')][_0x5ab9('0x1a')]);_0x302a6c[_0x5ab9('0x18')]=qs[_0x5ab9('0x18')](_0x50a386['query'][_0x5ab9('0x18')]);}_0x302a6c[_0x5ab9('0x36')]=qs[_0x5ab9('0x37')](_0x50a386['query'][_0x5ab9('0x37')]);_0x302a6c[_0x5ab9('0x38')]=qs[_0x5ab9('0x30')](_[_0x5ab9('0x39')](_0x50a386[_0x5ab9('0x2e')],_0x4fccdf[_0x5ab9('0x30')]),_0x198b0f);if(_0x50a386[_0x5ab9('0x2e')][_0x5ab9('0x3a')]){_0x302a6c['where']=_[_0x5ab9('0x3b')](_0x302a6c[_0x5ab9('0x38')],{'$or':_[_0x5ab9('0x29')](_0x198b0f,function(_0x3334ea){if(_0x3334ea['type']!==_0x5ab9('0x3c')){var _0x4d90d0={};_0x4d90d0[_0x3334ea['name']]={'$like':'%'+_0x50a386['query'][_0x5ab9('0x3a')]+'%'};return _0x4d90d0;}})});}_0x302a6c=_[_0x5ab9('0x3b')]({},_0x302a6c,_0x50a386[_0x5ab9('0x3d')]);var _0x1b5a5f={'where':_0x302a6c['where']};return db['WhatsappApplication'][_0x5ab9('0x1b')](_0x1b5a5f)[_0x5ab9('0x22')](function(_0x13a5a1){_0xe0f687[_0x5ab9('0x1b')]=_0x13a5a1;if(_0x50a386[_0x5ab9('0x2e')][_0x5ab9('0x3e')]){_0x302a6c[_0x5ab9('0x3f')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x5ab9('0x40')](_0x302a6c);})[_0x5ab9('0x22')](function(_0x36ecfb){_0xe0f687[_0x5ab9('0x41')]=_0x36ecfb;return _0xe0f687;})[_0x5ab9('0x22')](respondWithFilteredResult(_0x2e492b,_0x302a6c))['catch'](handleError(_0x2e492b,null));};exports[_0x5ab9('0x42')]=function(_0x6fe2d3,_0x15de13){var _0xf1f964={'raw':!![],'where':{'id':_0x6fe2d3[_0x5ab9('0x43')]['id']}},_0x535478={};_0x535478[_0x5ab9('0x2d')]=_['keys'](db['WhatsappApplication'][_0x5ab9('0x2b')]);_0x535478[_0x5ab9('0x2e')]=_['keys'](_0x6fe2d3[_0x5ab9('0x2e')]);_0x535478[_0x5ab9('0x30')]=_['intersection'](_0x535478['model'],_0x535478[_0x5ab9('0x2e')]);_0xf1f964[_0x5ab9('0x32')]=_[_0x5ab9('0x31')](_0x535478[_0x5ab9('0x2d')],qs['fields'](_0x6fe2d3['query']['fields']));_0xf1f964['attributes']=_0xf1f964['attributes']['length']?_0xf1f964[_0x5ab9('0x32')]:_0x535478[_0x5ab9('0x2d')];if(_0x6fe2d3['query']['includeAll']){_0xf1f964[_0x5ab9('0x3f')]=[{'all':!![]}];}_0xf1f964=_[_0x5ab9('0x3b')]({},_0xf1f964,_0x6fe2d3['options']);return db[_0x5ab9('0x2a')][_0x5ab9('0x44')](_0xf1f964)[_0x5ab9('0x22')](handleEntityNotFound(_0x15de13,null))[_0x5ab9('0x22')](respondWithResult(_0x15de13,null))[_0x5ab9('0x45')](handleError(_0x15de13,null));};exports['create']=function(_0x3a8be9,_0x5759e1){return db[_0x5ab9('0x2a')]['create'](_0x3a8be9[_0x5ab9('0x46')],{})['then'](respondWithResult(_0x5759e1,0xc9))[_0x5ab9('0x45')](handleError(_0x5759e1,null));};exports[_0x5ab9('0x47')]=function(_0x144602,_0x13daa8){if(_0x144602[_0x5ab9('0x46')]['id']){delete _0x144602['body']['id'];}return db[_0x5ab9('0x2a')]['find']({'where':{'id':_0x144602[_0x5ab9('0x43')]['id']}})[_0x5ab9('0x22')](handleEntityNotFound(_0x13daa8,null))['then'](saveUpdates(_0x144602[_0x5ab9('0x46')],null))['then'](respondWithResult(_0x13daa8,null))[_0x5ab9('0x45')](handleError(_0x13daa8,null));};exports['destroy']=function(_0x417113,_0x2fbfb8){return db[_0x5ab9('0x2a')][_0x5ab9('0x44')]({'where':{'id':_0x417113['params']['id']}})[_0x5ab9('0x22')](handleEntityNotFound(_0x2fbfb8,null))[_0x5ab9('0x22')](removeEntity(_0x2fbfb8,null))[_0x5ab9('0x45')](handleError(_0x2fbfb8,null));};
\ No newline at end of file
index 6cfe427..ffa64ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x5008d6,_0xf4e1f1){var _0x2c82aa=function(_0x15f04f){while(--_0x15f04f){_0x5008d6['push'](_0x5008d6['shift']());}};_0x2c82aa(++_0xf4e1f1);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x19e869,_0x5a6ec3){_0x19e869=_0x19e869-0x0;var _0x139d64=_0xd6d6[_0x19e869];return _0x139d64;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d6d('0xe'),'collate':_0x6d6d('0xf')});};
\ No newline at end of file
+var _0xe132=['whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','WhatsappApplication'];(function(_0x3dde9a,_0x5a8ca5){var _0x4907c9=function(_0x10de26){while(--_0x10de26){_0x3dde9a['push'](_0x3dde9a['shift']());}};_0x4907c9(++_0x5a8ca5);}(_0xe132,0x162));var _0x2e13=function(_0x14a0f6,_0x495c3f){_0x14a0f6=_0x14a0f6-0x0;var _0x9fad37=_0xe132[_0x14a0f6];return _0x9fad37;};'use strict';var _=require(_0x2e13('0x0'));var util=require('util');var logger=require(_0x2e13('0x1'))(_0x2e13('0x2'));var moment=require(_0x2e13('0x3'));var BPromise=require(_0x2e13('0x4'));var rp=require(_0x2e13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x260dc1,_0x2f9d00){return _0x260dc1[_0x2e13('0x8')](_0x2e13('0x9'),attributes,{'tableName':_0x2e13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e13('0xb'),'collate':_0x2e13('0xc')});};
\ No newline at end of file
index 897db52..33e39ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s'];(function(_0x2d558e,_0x259536){var _0x1107f0=function(_0xd32029){while(--_0xd32029){_0x2d558e['push'](_0x2d558e['shift']());}};_0x1107f0(++_0x259536);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x00bb[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});}
\ No newline at end of file
+var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x2128a7,_0x5810f2){var _0xaaddf2=function(_0x306601){while(--_0x306601){_0x2128a7['push'](_0x2128a7['shift']());}};_0xaaddf2(++_0x5810f2);}(_0x5fd1,0x155));var _0x15fd=function(_0x16585a,_0x325dfb){_0x16585a=_0x16585a-0x0;var _0x240a97=_0x5fd1[_0x16585a];return _0x240a97;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});}
\ No newline at end of file
index 4f78c81..81b7e62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7278=['/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','/:id/messages','getMessages','/:id/download','download','create','post','addMessage'];(function(_0x724594,_0x5b24c6){var _0x5c973c=function(_0x481187){while(--_0x481187){_0x724594['push'](_0x724594['shift']());}};_0x5c973c(++_0x5b24c6);}(_0x7278,0x161));var _0x8727=function(_0x33ed20,_0x541667){_0x33ed20=_0x33ed20-0x0;var _0x915375=_0x7278[_0x33ed20];return _0x915375;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var fs_extra=require(_0x8727('0x5'));var auth=require(_0x8727('0x6'));var interaction=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var controller=require(_0x8727('0x9'));router[_0x8727('0xa')]('/',auth[_0x8727('0xb')](),controller['index']);router[_0x8727('0xa')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0xd')]);router[_0x8727('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8727('0xa')](_0x8727('0xe'),auth[_0x8727('0xb')](),controller[_0x8727('0xf')]);router[_0x8727('0xa')](_0x8727('0x10'),auth[_0x8727('0xb')](),controller[_0x8727('0x11')]);router['post']('/',auth[_0x8727('0xb')](),controller[_0x8727('0x12')]);router[_0x8727('0x13')]('/:id/messages',auth[_0x8727('0xb')](),controller[_0x8727('0x14')]);router['post'](_0x8727('0x15'),auth[_0x8727('0xb')](),interaction[_0x8727('0x16')](_0x8727('0x17'),_0x8727('0x18')),controller[_0x8727('0x19')]);router[_0x8727('0x1a')](_0x8727('0x1b'),auth[_0x8727('0xb')](),interaction[_0x8727('0x16')]('whatsapp',_0x8727('0x1c')),controller[_0x8727('0x1d')]);router[_0x8727('0x1e')](_0x8727('0x1b'),auth[_0x8727('0xb')](),interaction[_0x8727('0x16')]('whatsapp','whatsappinteraction:destroy'),controller[_0x8727('0x1f')]);router['delete'](_0x8727('0x15'),auth[_0x8727('0xb')](),controller[_0x8727('0x20')]);module[_0x8727('0x21')]=router;
\ No newline at end of file
+var _0x7dfd=['whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x5d4e4c,_0x27eea1){var _0x206994=function(_0x170a8b){while(--_0x170a8b){_0x5d4e4c['push'](_0x5d4e4c['shift']());}};_0x206994(++_0x27eea1);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')]('/',auth[_0xd7df('0xc')](),controller[_0xd7df('0xd')]);router[_0xd7df('0xb')](_0xd7df('0xe'),auth[_0xd7df('0xc')](),controller['describe']);router[_0xd7df('0xb')](_0xd7df('0xf'),auth[_0xd7df('0xc')](),controller[_0xd7df('0x10')]);router['get'](_0xd7df('0x11'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);router['get'](_0xd7df('0x13'),auth[_0xd7df('0xc')](),controller[_0xd7df('0x14')]);router[_0xd7df('0x15')]('/',auth[_0xd7df('0xc')](),controller[_0xd7df('0x16')]);router[_0xd7df('0x15')](_0xd7df('0x11'),auth[_0xd7df('0xc')](),controller[_0xd7df('0x17')]);router[_0xd7df('0x15')](_0xd7df('0x18'),auth[_0xd7df('0xc')](),interaction[_0xd7df('0x19')](_0xd7df('0x1a'),_0xd7df('0x1b')),controller[_0xd7df('0x1c')]);router['put'](_0xd7df('0xf'),auth[_0xd7df('0xc')](),interaction['tracked'](_0xd7df('0x1a'),_0xd7df('0x1d')),controller['update']);router[_0xd7df('0x1e')](_0xd7df('0xf'),auth[_0xd7df('0xc')](),interaction['tracked'](_0xd7df('0x1a'),_0xd7df('0x1f')),controller[_0xd7df('0x20')]);router['delete'](_0xd7df('0x18'),auth[_0xd7df('0xc')](),controller[_0xd7df('0x21')]);module['exports']=router;
\ No newline at end of file
index b710b00..fd2b381 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd45e=['ENUM','out','moment','exports','DATE','STRING'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xd45e,0x182));var _0xed45=function(_0x27e6f2,_0x413871){_0x27e6f2=_0x27e6f2-0x0;var _0x2ac6ed=_0xd45e[_0x27e6f2];return _0x2ac6ed;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xed45('0x0'));module[_0xed45('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xed45('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xed45('0x3')]},'thirdDisposition':{'type':Sequelize[_0xed45('0x3')]},'note':{'type':Sequelize[_0xed45('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xed45('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xed45('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xed45('0x4')]('in',_0xed45('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe132=['DATE','STRING','out','ENUM','sequelize','exports','BOOLEAN'];(function(_0x58f42a,_0x582f5c){var _0x249e18=function(_0x456bbe){while(--_0x456bbe){_0x58f42a['push'](_0x58f42a['shift']());}};_0x249e18(++_0x582f5c);}(_0xe132,0x162));var _0x2e13=function(_0x5b1164,_0x25c0a7){_0x5b1164=_0x5b1164-0x0;var _0x4ad185=_0xe132[_0x5b1164];return _0x4ad185;};'use strict';var Sequelize=require(_0x2e13('0x0'));var moment=require('moment');module[_0x2e13('0x1')]={'closed':{'type':Sequelize[_0x2e13('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2e13('0x3')]},'disposition':{'type':Sequelize[_0x2e13('0x4')]},'secondDisposition':{'type':Sequelize[_0x2e13('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2e13('0x4')]},'phone':{'type':Sequelize[_0x2e13('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x2e13('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2e13('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2e13('0x6')]('in',_0x2e13('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2e13('0x2')],'defaultValue':![]}};
\ No newline at end of file
index d18265d..4134438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f4c=['Attachment','Messages','secret','WhatsappAccount','Account','get','mkdirSync','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','renderFile','server','views','.pdf','Whatsapp','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','map','fullname','Tags','TagIds','split','catch','waiting','talking','answered','unmanaged','total','closed','UserId','WhatsappInteraction','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','keys','some','compact','forEach','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','WhatsappAccountId','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','params','includeAll','include','merge','create','update','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','pick','$gte','format','options','addTags','spread','Tag','findAll','emit','whatsappInteractionTags:save','removeTags','download','root','tmp','join','files','attachments','User','CmContact','firstName'];(function(_0x522dfe,_0xe41eba){var _0x292ef7=function(_0x3752d7){while(--_0x3752d7){_0x522dfe['push'](_0x522dfe['shift']());}};_0x292ef7(++_0xe41eba);}(_0x8f4c,0x113));var _0xc8f4=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0x8f4c[_0x35d775];return _0x59384d;};'use strict';var emlformat=require(_0xc8f4('0x0'));var rimraf=require(_0xc8f4('0x1'));var zipdir=require(_0xc8f4('0x2'));var jsonpatch=require(_0xc8f4('0x3'));var rp=require(_0xc8f4('0x4'));var moment=require(_0xc8f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc8f4('0x6'));var util=require(_0xc8f4('0x7'));var path=require(_0xc8f4('0x8'));var sox=require('sox');var csv=require(_0xc8f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0x9'));var querystring=require(_0xc8f4('0xd'));var Papa=require(_0xc8f4('0xe'));var Redis=require('ioredis');var authService=require(_0xc8f4('0xf'));var qs=require(_0xc8f4('0x10'));var as=require(_0xc8f4('0x11'));var pdf=require(_0xc8f4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8f4('0x13'))('api');var utils=require(_0xc8f4('0x14'));var config=require(_0xc8f4('0x15'));var licenseUtil=require(_0xc8f4('0x16'));var db=require(_0xc8f4('0x17'))['db'];config[_0xc8f4('0x18')]=_['defaults'](config[_0xc8f4('0x18')],{'host':_0xc8f4('0x19'),'port':0x18eb});var socket=require(_0xc8f4('0x1a'))(new Redis(config[_0xc8f4('0x18')]));require(_0xc8f4('0x1b'))[_0xc8f4('0x1c')](socket);function respondWithStatusCode(_0x4e3c36,_0x2bce00){_0x2bce00=_0x2bce00||0xcc;return function(_0x2c7bc1){if(_0x2c7bc1){return _0x4e3c36[_0xc8f4('0x1d')](_0x2bce00);}return _0x4e3c36[_0xc8f4('0x1e')](_0x2bce00)[_0xc8f4('0x1f')]();};}function respondWithResult(_0x56a25d,_0xac45d5){_0xac45d5=_0xac45d5||0xc8;return function(_0x4d2b77){if(_0x4d2b77){return _0x56a25d['status'](_0xac45d5)[_0xc8f4('0x20')](_0x4d2b77);}};}function respondWithFilteredResult(_0x225b76,_0x108076){return function(_0x7bb973){if(_0x7bb973){var _0x4763c1=typeof _0x108076[_0xc8f4('0x21')]===_0xc8f4('0x22')&&typeof _0x108076[_0xc8f4('0x23')]===_0xc8f4('0x22');var _0x1a7bac=_0x7bb973[_0xc8f4('0x24')];var _0x3126e5=_0x4763c1?0x0:_0x108076[_0xc8f4('0x21')];var _0x5f3264=_0x4763c1?_0x7bb973[_0xc8f4('0x24')]:_0x108076[_0xc8f4('0x21')]+_0x108076[_0xc8f4('0x23')];var _0x208bcb;if(_0x5f3264>=_0x1a7bac){_0x5f3264=_0x1a7bac;_0x208bcb=0xc8;}else{_0x208bcb=0xce;}_0x225b76[_0xc8f4('0x1e')](_0x208bcb);return _0x225b76[_0xc8f4('0x25')](_0xc8f4('0x26'),_0x3126e5+'-'+_0x5f3264+'/'+_0x1a7bac)[_0xc8f4('0x20')](_0x7bb973);}return null;};}function patchUpdates(_0x5e62aa){return function(_0x4463aa){try{jsonpatch[_0xc8f4('0x27')](_0x4463aa,_0x5e62aa,!![]);}catch(_0x3195ff){return BPromise[_0xc8f4('0x28')](_0x3195ff);}return _0x4463aa['save']();};}function saveUpdates(_0x39174f,_0x4a44e0){return function(_0x3782fd){if(_0x3782fd){return _0x3782fd['update'](_0x39174f)[_0xc8f4('0x29')](function(_0x3dd717){return _0x3dd717;});}return null;};}function removeEntity(_0x5c94c6,_0x41f4de){return function(_0x21062f){if(_0x21062f){return _0x21062f[_0xc8f4('0x2a')]()[_0xc8f4('0x29')](function(){_0x5c94c6['status'](0xcc)[_0xc8f4('0x1f')]();});}};}function handleEntityNotFound(_0x3484b6,_0x5db666){return function(_0x190f61){if(!_0x190f61){_0x3484b6[_0xc8f4('0x1d')](0x194);}return _0x190f61;};}function handleError(_0x157ad5,_0x1b70bc){_0x1b70bc=_0x1b70bc||0x1f4;return function(_0x24bef0){logger[_0xc8f4('0x2b')](_0x24bef0['stack']);if(_0x24bef0[_0xc8f4('0x2c')]){delete _0x24bef0[_0xc8f4('0x2c')];}_0x157ad5[_0xc8f4('0x1e')](_0x1b70bc)['send'](_0x24bef0);};}function getInteractionUsers(_0xf4a556,_0x3a4b1b){return new BPromise(function(_0x5ab6cb,_0x56ec4b){try{if(_0x3a4b1b[_0xf4a556['id']]){_0xf4a556['Users']=_[_0xc8f4('0x2d')](_0x3a4b1b[_0xf4a556['id']],function(_0x323432){return{'id':_0x323432['id'],'fullname':_0x323432[_0xc8f4('0x2e')]};});}}catch(_0x28baa0){_0x56ec4b(_0x28baa0);}_0x5ab6cb(_0xf4a556);});}function getInteractionTags(_0x273e73,_0x2f9a80){return new BPromise(function(_0x3181af,_0xffc7aa){try{if(_0x273e73['TagIds']){_0x273e73[_0xc8f4('0x2f')]=[];_0x273e73[_0xc8f4('0x30')][_0xc8f4('0x31')](',')['forEach'](function(_0x325bfa){_0x273e73[_0xc8f4('0x2f')]['push'](_0x2f9a80[_0x325bfa]);});}delete _0x273e73[_0xc8f4('0x30')];}catch(_0x1a8553){_0xffc7aa(_0x1a8553);}_0x3181af(_0x273e73);});}function updateWhatsappInteraction(_0x36f24f,_0x5806cd,_0x114a79){return new BPromise(function(_0xa06877,_0x126731){return getInteractionUsers(_0x36f24f,_0x114a79)['then'](function(_0x1c9d57){return getInteractionTags(_0x1c9d57,_0x5806cd);})[_0xc8f4('0x29')](function(_0x4764b3){return getStateInteraction(_0x4764b3);})[_0xc8f4('0x29')](function(_0x215203){_0xa06877(_0x215203);})[_0xc8f4('0x32')](function(_0xeacb80){_0x126731(_0xeacb80);});});}function getStateInteraction(_0x287ece){return new BPromise(function(_0x2da6ab){_0x287ece[_0xc8f4('0x33')]=0x0;_0x287ece[_0xc8f4('0x34')]=0x0;_0x287ece[_0xc8f4('0x35')]=0x0;_0x287ece[_0xc8f4('0x36')]=0x0;_0x287ece[_0xc8f4('0x37')]=0x0;if(!_0x287ece[_0xc8f4('0x38')]&&!_0x287ece[_0xc8f4('0x39')]){_0x287ece['waiting']+=0x1;}if(!_0x287ece[_0xc8f4('0x38')]&&_0x287ece['UserId']){_0x287ece[_0xc8f4('0x34')]+=0x1;if(_0x287ece['waiting']){_0x287ece[_0xc8f4('0x33')]-=0x1;}}if(_0x287ece[_0xc8f4('0x38')]&&_0x287ece[_0xc8f4('0x39')]){_0x287ece[_0xc8f4('0x35')]+=0x1;if(_0x287ece[_0xc8f4('0x34')]){_0x287ece[_0xc8f4('0x34')]-=0x1;}}if(_0x287ece[_0xc8f4('0x38')]&&!_0x287ece['UserId']){_0x287ece[_0xc8f4('0x36')]+=0x1;if(_0x287ece[_0xc8f4('0x33')]){_0x287ece[_0xc8f4('0x33')]-=0x1;}}_0x287ece[_0xc8f4('0x37')]+=0x1;_0x2da6ab(_0x287ece);});}exports['index']=function(_0x172836,_0x23a918){var _0x2a72a9={},_0x1d0b2d={},_0x453914={'count':0x0,'rows':[]};var _0x1d7831=_[_0xc8f4('0x2d')](db[_0xc8f4('0x3a')][_0xc8f4('0x3b')],function(_0x30478d){return{'name':_0x30478d[_0xc8f4('0x3c')],'type':_0x30478d[_0xc8f4('0x3d')]['key']};});_0x1d0b2d[_0xc8f4('0x3e')]=_[_0xc8f4('0x2d')](_0x1d7831,_0xc8f4('0x2c'));_0x1d0b2d[_0xc8f4('0x3f')]=_['keys'](_0x172836['query']);_0x1d0b2d[_0xc8f4('0x40')]=_[_0xc8f4('0x41')](_0x1d0b2d['model'],_0x1d0b2d[_0xc8f4('0x3f')]);_0x2a72a9[_0xc8f4('0x42')]=_['intersection'](_0x1d0b2d['model'],qs[_0xc8f4('0x43')](_0x172836[_0xc8f4('0x3f')][_0xc8f4('0x43')]));_0x2a72a9[_0xc8f4('0x42')]=_0x2a72a9[_0xc8f4('0x42')][_0xc8f4('0x44')]?_0x2a72a9['attributes']:_0x1d0b2d['model'];if(!_0x172836[_0xc8f4('0x3f')][_0xc8f4('0x45')](_0xc8f4('0x46'))){_0x2a72a9['limit']=qs['limit'](_0x172836['query']['limit']);_0x2a72a9['offset']=qs[_0xc8f4('0x21')](_0x172836[_0xc8f4('0x3f')][_0xc8f4('0x21')]);}_0x2a72a9[_0xc8f4('0x47')]=qs[_0xc8f4('0x48')](_0x172836[_0xc8f4('0x3f')]['sort']);_0x2a72a9[_0xc8f4('0x49')]=qs[_0xc8f4('0x40')](_['pick'](_0x172836['query'],_0x1d0b2d[_0xc8f4('0x40')]),_0x1d7831);var _0x82a5e=[];var _0x3ca0d6=squel[_0xc8f4('0x4a')]()['field']('id')['field'](_0xc8f4('0x2c'))[_0xc8f4('0x4b')](_0xc8f4('0x4c'))[_0xc8f4('0x4d')](_0xc8f4('0x4e'));var _0x1016b7=squel['select']()['field'](_0xc8f4('0x4f'))[_0xc8f4('0x4b')](_0xc8f4('0x50'))[_0xc8f4('0x4b')](_0xc8f4('0x51'))[_0xc8f4('0x4d')](_0xc8f4('0x52'),'ui')[_0xc8f4('0x53')](_0xc8f4('0x54'),'u','u.id\x20=\x20ui.UserId');var _0x5c7768=squel[_0xc8f4('0x4a')]()[_0xc8f4('0x4d')](_0xc8f4('0x55'),'i')[_0xc8f4('0x53')](_0xc8f4('0x56'),'c',_0xc8f4('0x57'))[_0xc8f4('0x53')](_0xc8f4('0x54'),'o',_0xc8f4('0x58'))[_0xc8f4('0x53')](_0xc8f4('0x59'),'a',_0xc8f4('0x5a'))[_0xc8f4('0x53')]('whatsapp_messages','me',_0xc8f4('0x5b'))[_0xc8f4('0x53')](_0xc8f4('0x5c'),'it',_0xc8f4('0x5d'))['left_join'](_0xc8f4('0x4e'),'t',_0xc8f4('0x5e'));var _0x4b4de3=squel['expr']();var _0x405391=[];var _0x5cc52d=squel[_0xc8f4('0x5f')]();var _0x29f8f4;if(_0x172836[_0xc8f4('0x3f')][_0xc8f4('0x60')]){_0x29f8f4=as[_0xc8f4('0x61')](_0x172836[_0xc8f4('0x3f')][_0xc8f4('0x60')]);var _0x1f7602=_0x29f8f4[_0xc8f4('0x62')];for(var _0x305edb=0x0;_0x305edb<_0x29f8f4[_0xc8f4('0x63')]['length'];_0x305edb++){var _0x995b8c=_0x29f8f4[_0xc8f4('0x63')][_0x305edb];var _0x18397c='i';var _0x45a21a=_['find'](_0x1d7831,[_0xc8f4('0x2c'),_0x995b8c['field']]);if(!_0x45a21a){switch(_0x995b8c['field']){case _0xc8f4('0x64'):if(_0x995b8c[_0xc8f4('0x65')]==0x1){_0x5c7768[_0xc8f4('0x66')]('`'+_0x995b8c[_0xc8f4('0x4b')]+_0xc8f4('0x67'));}else{_0x5c7768[_0xc8f4('0x66')]('`'+_0x995b8c['field']+'`\x20>\x200');}break;case _0xc8f4('0x68'):if(_0x995b8c[_0xc8f4('0x69')]===_0xc8f4('0x6a')){if(_0x995b8c[_0xc8f4('0x65')][_0xc8f4('0x31')]('\x20')[_0xc8f4('0x44')]>0x1){_0x4b4de3[_0x1f7602](_0xc8f4('0x6b'),qs['getFullTextValue'](_0x995b8c[_0xc8f4('0x65')]),null);}else{var _0x3e74d2='%'+_0x995b8c['value']+'%';_0x4b4de3[_0x1f7602](_0xc8f4('0x6c'),_0x3e74d2,_0x3e74d2,_0x3e74d2);}}else{_0x45a21a=_[_0xc8f4('0x6d')](_0x1d7831,[_0xc8f4('0x2c'),_0xc8f4('0x6e')]);_0x995b8c[_0xc8f4('0x4b')]=_0xc8f4('0x6e');_0x239e4d=as[_0xc8f4('0x6f')](_0x18397c,_0x45a21a['type'],_0x995b8c);_0x4b4de3[_0x1f7602](_0x239e4d[_0xc8f4('0x70')],_0x239e4d[_0xc8f4('0x65')]['start'],_0x239e4d['value'][_0xc8f4('0x1f')]);}break;case'Tag':var _0x281b3a=_0x995b8c[_0xc8f4('0x65')]['split'](',')['map'](function(_0x57ad51){return Number(_0x57ad51);});_0x281b3a['forEach'](function(_0x4b619c){_0x5cc52d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4b619c+',%');});_0x405391=_[_0xc8f4('0x71')](_0x405391,_0x281b3a);break;case'User':if(_0x995b8c[_0xc8f4('0x69')]===_0xc8f4('0x6a')){_0x4b4de3[_0x1f7602](_0xc8f4('0x72'),'%'+_0x995b8c[_0xc8f4('0x65')]+'%',null);}else{_0x45a21a=_['find'](_0x1d7831,[_0xc8f4('0x2c'),_0xc8f4('0x39')]);_0x995b8c[_0xc8f4('0x4b')]=_0xc8f4('0x39');_0x239e4d=as['buildExpression'](_0x18397c,_0x45a21a[_0xc8f4('0x3d')],_0x995b8c);_0x4b4de3[_0x1f7602](_0x239e4d[_0xc8f4('0x70')],_0x239e4d[_0xc8f4('0x65')][_0xc8f4('0x73')],_0x239e4d['value'][_0xc8f4('0x1f')]);}break;case _0xc8f4('0x74'):_0x239e4d=as['buildExpression']('me',null,_0x995b8c);_0x4b4de3[_0x1f7602](_0x239e4d[_0xc8f4('0x70')],_0x239e4d[_0xc8f4('0x65')][_0xc8f4('0x73')],_0x239e4d[_0xc8f4('0x65')][_0xc8f4('0x1f')]);break;}}else{var _0x239e4d=as['buildExpression'](_0x18397c,_0x45a21a[_0xc8f4('0x3d')],_0x995b8c);_0x4b4de3[_0x1f7602](_0x239e4d[_0xc8f4('0x70')],_0x239e4d[_0xc8f4('0x65')]['start'],_0x239e4d[_0xc8f4('0x65')][_0xc8f4('0x1f')]);}}}else{var _0x3cc1cb=_(_0x172836['query'])[_0xc8f4('0x75')]()[_0xc8f4('0x2d')](function(_0x482cfd){return _[_0xc8f4('0x76')](_0x1d7831,['name',_0x482cfd])?_0x482cfd:undefined;})[_0xc8f4('0x77')]()[_0xc8f4('0x65')]();if(!_['isEmpty'](_0x3cc1cb)){_0x3cc1cb[_0xc8f4('0x78')](function(_0x31ee47){if(_0x31ee47==='WhatsappAccountId'){_0x5c7768[_0xc8f4('0x49')](_0xc8f4('0x79'),[][_0xc8f4('0x7a')](_0x172836[_0xc8f4('0x3f')][_0x31ee47]));}else if(_0x31ee47===_0xc8f4('0x7b')){var _0x83077d=JSON[_0xc8f4('0x7c')](_0x172836[_0xc8f4('0x3f')][_0x31ee47])['$gte'];var _0x2d363c=JSON[_0xc8f4('0x7c')](_0x172836[_0xc8f4('0x3f')][_0x31ee47])[_0xc8f4('0x7d')];_0x5c7768[_0xc8f4('0x49')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x83077d,_0x2d363c);}else{if(_0x172836[_0xc8f4('0x3f')][_0x31ee47]==='null'){_0x5c7768[_0xc8f4('0x49')]('i.'+_0x31ee47+_0xc8f4('0x7e'));}else{_0x5c7768[_0xc8f4('0x49')]('i.'+_0x31ee47+_0xc8f4('0x7f'),_0x172836[_0xc8f4('0x3f')][_0x31ee47]);}}});}if(_0x172836[_0xc8f4('0x3f')][_0xc8f4('0x80')]){if(_0x172836[_0xc8f4('0x3f')][_0xc8f4('0x80')]==0x1){_0x5c7768[_0xc8f4('0x66')](_0xc8f4('0x81'));}else{_0x5c7768['having'](_0xc8f4('0x82'));}}if(_0x172836[_0xc8f4('0x3f')][_0xc8f4('0x83')]){_0x405391=_[_0xc8f4('0x84')](_0x172836['query']['tag'])?_0x172836[_0xc8f4('0x3f')]['tag']:new Array(_0x172836[_0xc8f4('0x3f')]['tag']);_0x405391[_0xc8f4('0x78')](function(_0x4e973c){_0x5cc52d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4e973c+',%');});}if(_0x172836['query']['filter']){var _0x5eab20=_0x172836['query'][_0xc8f4('0x85')]['replace']('\x5c','\x5c\x5c')[_0xc8f4('0x86')](/'/g,'\x27\x27');if(qs[_0xc8f4('0x87')](_0x5eab20)){_0x4b4de3['or'](_0xc8f4('0x88'),_0x5eab20+'%')['or'](_0xc8f4('0x89'),_0x5eab20+'%');}else{_0x4b4de3['or'](_0xc8f4('0x8a'),qs['getFullTextValue'](_0x5eab20))['or'](_0xc8f4('0x8b'),_0x5eab20+'%');}}}_0x5c7768[_0xc8f4('0x49')](_0x4b4de3);_0x5c7768[_0xc8f4('0x8c')]('i.id');var _0x6da52={'type':db[_0xc8f4('0x8d')][_0xc8f4('0x8e')][_0xc8f4('0x8f')],'raw':!![]};var _0x29f54a=_0x5c7768[_0xc8f4('0x90')]();_0x29f54a[_0xc8f4('0x4b')](_0xc8f4('0x91'));_0x29f54a['field'](_0xc8f4('0x92'),_0xc8f4('0x64'));if(_0x2a72a9[_0xc8f4('0x47')]){_0x2a72a9[_0xc8f4('0x47')][_0xc8f4('0x78')](function(_0x17c918){var _0x16daa0=_0x17c918[0x0]===_0xc8f4('0x93')?_0x17c918[0x0]:'i.'+_0x17c918[0x0];_0x5c7768[_0xc8f4('0x47')](_0x16daa0,_0x17c918[0x1]===_0xc8f4('0x94')?![]:!![]);});}if(!_[_0xc8f4('0x95')](_0x405391)){_0x5c7768['having'](_0x5cc52d);_0x29f54a[_0xc8f4('0x49')](_0xc8f4('0x96'),_0x405391);}BPromise['resolve']()[_0xc8f4('0x29')](function(){if(!_0x29f8f4){if(_0x172836[_0xc8f4('0x3f')]['WhatsappAccountId'])return;_0x29f54a[_0xc8f4('0x49')](_0xc8f4('0x97'));_0x5c7768['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x172836[_0xc8f4('0x98')][_0xc8f4('0x99')]!==_0xc8f4('0x9a'))return;return _0x172836['user'][_0xc8f4('0x9b')]({'attributes':['id'],'raw':!![]})[_0xc8f4('0x29')](function(_0x5a809c){if(_['isEmpty'](_0x5a809c)){_0x29f54a[_0xc8f4('0x49')](_0xc8f4('0x9c'));_0x5c7768[_0xc8f4('0x49')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x29f54a[_0xc8f4('0x49')](_0xc8f4('0x79'),_[_0xc8f4('0x2d')](_0x5a809c,'id'));_0x5c7768['where'](_0xc8f4('0x79'),_[_0xc8f4('0x2d')](_0x5a809c,'id'));}});})[_0xc8f4('0x29')](function(){if(_0x172836[_0xc8f4('0x98')][_0xc8f4('0x99')]===_0xc8f4('0x9a')&&!_0x29f8f4&&!_0x172836[_0xc8f4('0x3f')][_0xc8f4('0x9d')])return[];return db[_0xc8f4('0x9e')][_0xc8f4('0x3f')](_0x29f54a[_0xc8f4('0x9f')](),_0x6da52);})['then'](function(_0x7ae79){_0x453914['count']=_0x7ae79[_0xc8f4('0x44')];if(_0x453914[_0xc8f4('0x24')]===0x0)return[];return db[_0xc8f4('0x9e')][_0xc8f4('0x3f')](_0x3ca0d6[_0xc8f4('0x9f')](),_0x6da52)[_0xc8f4('0x29')](function(_0x41da37){_0x82a5e=_[_0xc8f4('0xa0')](_0x41da37,'id');_0x6da52=_['merge'](_0x6da52,{'model':db[_0xc8f4('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x172836['query']['fields']){_0x2a72a9[_0xc8f4('0x42')][_0xc8f4('0x78')](function(_0x35a3db){_0x5c7768['field']('i.'+_0x35a3db);});}else{_0x5c7768['field'](_0xc8f4('0x92'),_0xc8f4('0x64'));_0x5c7768[_0xc8f4('0x4b')]('a.key',_0xc8f4('0xa1'));_0x5c7768['field'](_0xc8f4('0xa2'),_0xc8f4('0xa3'));_0x5c7768[_0xc8f4('0x4b')](_0xc8f4('0xa4'),_0xc8f4('0x93'));_0x5c7768['field'](_0xc8f4('0xa5'));_0x5c7768['field'](_0xc8f4('0xa6'),_0xc8f4('0xa7'));_0x5c7768[_0xc8f4('0x4b')](_0xc8f4('0xa8'),_0xc8f4('0xa9'));_0x5c7768[_0xc8f4('0x4b')](_0xc8f4('0xaa'),_0xc8f4('0xab'));_0x5c7768[_0xc8f4('0x4b')](_0xc8f4('0xac'),_0xc8f4('0xad'));_0x5c7768['field']('c.mobile',_0xc8f4('0xae'));_0x5c7768[_0xc8f4('0x4b')](_0xc8f4('0xaf'),_0xc8f4('0xb0'));_0x5c7768[_0xc8f4('0x4b')](_0xc8f4('0xb1'),_0xc8f4('0xb2'));_0x5c7768[_0xc8f4('0x4b')](_0xc8f4('0xb3'),_0xc8f4('0xb4'));_0x5c7768[_0xc8f4('0x4b')](_0xc8f4('0xb5'),'TagIds');}if(_0x2a72a9['limit'])_0x5c7768[_0xc8f4('0x23')](_0x2a72a9['limit']);if(_0x2a72a9['offset'])_0x5c7768[_0xc8f4('0x21')](_0x2a72a9['offset']);return db['sequelize']['query'](_0x5c7768['toString'](),_0x6da52);})['then'](function(_0x1b8f34){if(_0x1b8f34[_0xc8f4('0x44')]>0x0)_0x1016b7[_0xc8f4('0x49')](_0xc8f4('0xb6'),_[_0xc8f4('0x2d')](_0x1b8f34,'id'));return db[_0xc8f4('0x9e')][_0xc8f4('0x3f')](_0x1016b7[_0xc8f4('0x9f')](),_0x6da52)[_0xc8f4('0x29')](function(_0x170c74){var _0x317d96=_[_0xc8f4('0xb7')](_0x170c74,_0xc8f4('0xb8'));var _0x1d4e89=[];_0x1b8f34[_0xc8f4('0x78')](function(_0x4fedfe){_0x1d4e89[_0xc8f4('0xb9')](updateWhatsappInteraction(_0x4fedfe,_0x82a5e,_0x317d96));});return BPromise[_0xc8f4('0xba')](_0x1d4e89);});});})[_0xc8f4('0x29')](function(_0x35c5e9){_0x453914[_0xc8f4('0xbb')]=_0x35c5e9;return _0x453914;})[_0xc8f4('0x29')](respondWithFilteredResult(_0x23a918,_0x2a72a9))[_0xc8f4('0x32')](handleError(_0x23a918,null));};exports['show']=function(_0x535508,_0xe8ff50){var _0x416ade={'raw':![],'where':{'id':_0x535508[_0xc8f4('0xbc')]['id']}},_0x35190f={};_0x35190f[_0xc8f4('0x3e')]=_[_0xc8f4('0x75')](db[_0xc8f4('0x3a')][_0xc8f4('0x3b')]);_0x35190f[_0xc8f4('0x3f')]=_[_0xc8f4('0x75')](_0x535508[_0xc8f4('0x3f')]);_0x35190f[_0xc8f4('0x40')]=_[_0xc8f4('0x41')](_0x35190f[_0xc8f4('0x3e')],_0x35190f['query']);_0x416ade[_0xc8f4('0x42')]=_[_0xc8f4('0x41')](_0x35190f[_0xc8f4('0x3e')],qs[_0xc8f4('0x43')](_0x535508[_0xc8f4('0x3f')]['fields']));_0x416ade[_0xc8f4('0x42')]=_0x416ade[_0xc8f4('0x42')]['length']?_0x416ade['attributes']:_0x35190f[_0xc8f4('0x3e')];if(_0x535508[_0xc8f4('0x3f')][_0xc8f4('0xbd')]){_0x416ade[_0xc8f4('0xbe')]=[{'all':!![]}];}_0x416ade=_[_0xc8f4('0xbf')]({},_0x416ade,_0x535508['options']);return db['WhatsappInteraction'][_0xc8f4('0x6d')](_0x416ade)[_0xc8f4('0x29')](handleEntityNotFound(_0xe8ff50,null))['then'](respondWithResult(_0xe8ff50,null))[_0xc8f4('0x32')](handleError(_0xe8ff50,null));};exports[_0xc8f4('0xc0')]=function(_0x1efd14,_0x39a405){return db[_0xc8f4('0x3a')][_0xc8f4('0xc0')](_0x1efd14[_0xc8f4('0x74')],{})[_0xc8f4('0x29')](respondWithResult(_0x39a405,0xc9))['catch'](handleError(_0x39a405,null));};exports[_0xc8f4('0xc1')]=function(_0xc24a8f,_0x129d2a){if(_0xc24a8f['body']['id']){delete _0xc24a8f[_0xc8f4('0x74')]['id'];}return db['WhatsappInteraction'][_0xc8f4('0x6d')]({'where':{'id':_0xc24a8f[_0xc8f4('0xbc')]['id']}})[_0xc8f4('0x29')](handleEntityNotFound(_0x129d2a,null))['then'](saveUpdates(_0xc24a8f[_0xc8f4('0x74')],null))['then'](respondWithResult(_0x129d2a,null))[_0xc8f4('0x32')](handleError(_0x129d2a,null));};exports[_0xc8f4('0x2a')]=function(_0x1b1f14,_0x4bc771){return db[_0xc8f4('0x3a')][_0xc8f4('0x6d')]({'where':{'id':_0x1b1f14[_0xc8f4('0xbc')]['id']}})[_0xc8f4('0x29')](handleEntityNotFound(_0x4bc771,null))['then'](removeEntity(_0x4bc771,null))[_0xc8f4('0x32')](handleError(_0x4bc771,null));};exports['describe']=function(_0x2180a4,_0x4c7a73){return db[_0xc8f4('0x3a')][_0xc8f4('0xc2')]()['then'](respondWithResult(_0x4c7a73,null))[_0xc8f4('0x32')](handleError(_0x4c7a73,null));};exports[_0xc8f4('0xc3')]=function(_0x3ffb63,_0x1803f7,_0x2e6671){return db['WhatsappMessage'][_0xc8f4('0x6d')]({'where':{'id':_0x3ffb63[_0xc8f4('0xbc')]['id']}})[_0xc8f4('0x29')](handleEntityNotFound(_0x1803f7,null))[_0xc8f4('0x29')](function(_0x54c320){if(_0x54c320){return _0x54c320[_0xc8f4('0xc3')](_0x3ffb63[_0xc8f4('0x74')][_0xc8f4('0xc4')],_[_0xc8f4('0xc5')](_0x3ffb63['body'],[_0xc8f4('0xc4'),'id'])||{});}})[_0xc8f4('0x29')](respondWithResult(_0x1803f7,null))[_0xc8f4('0x32')](handleError(_0x1803f7,null));};exports[_0xc8f4('0xc6')]=function(_0x1d22de,_0xbc97d,_0x5b723a){var _0x9c5a78={'raw':![],'where':{}};var _0x919ea9={};var _0x5a573b={'count':0x0,'rows':[]};return db[_0xc8f4('0x3a')][_0xc8f4('0xc7')]({'where':{'id':_0x1d22de[_0xc8f4('0xbc')]['id']}})[_0xc8f4('0x29')](handleEntityNotFound(_0xbc97d,null))['then'](function(_0x25c621){if(_0x25c621){_0x919ea9['model']=_[_0xc8f4('0x75')](db[_0xc8f4('0xc8')][_0xc8f4('0x3b')]);_0x919ea9['query']=_[_0xc8f4('0x75')](_0x1d22de[_0xc8f4('0x3f')]);_0x919ea9[_0xc8f4('0x40')]=_[_0xc8f4('0x41')](_0x919ea9[_0xc8f4('0x3e')],_0x919ea9[_0xc8f4('0x3f')]);_0x9c5a78[_0xc8f4('0x42')]=_['intersection'](_0x919ea9[_0xc8f4('0x3e')],qs[_0xc8f4('0x43')](_0x1d22de[_0xc8f4('0x3f')][_0xc8f4('0x43')]));_0x9c5a78[_0xc8f4('0x42')]=_0x9c5a78[_0xc8f4('0x42')][_0xc8f4('0x44')]?_0x9c5a78[_0xc8f4('0x42')]:_0x919ea9[_0xc8f4('0x3e')];if(!_0x1d22de[_0xc8f4('0x3f')][_0xc8f4('0x45')](_0xc8f4('0x46'))){_0x9c5a78[_0xc8f4('0x23')]=qs[_0xc8f4('0x23')](_0x1d22de[_0xc8f4('0x3f')][_0xc8f4('0x23')]);_0x9c5a78[_0xc8f4('0x21')]=qs[_0xc8f4('0x21')](_0x1d22de[_0xc8f4('0x3f')][_0xc8f4('0x21')]);}_0x9c5a78['order']=qs['sort'](_0x1d22de[_0xc8f4('0x3f')]['sort']);_0x9c5a78['where']=qs[_0xc8f4('0x40')](_[_0xc8f4('0xc9')](_0x1d22de['query'],_0x919ea9['filters']));_0x9c5a78['where']['WhatsappInteractionId']=_0x25c621['id'];if(_0x1d22de[_0xc8f4('0x3f')]['filter']){_0x9c5a78['where']=_[_0xc8f4('0xbf')](_0x9c5a78[_0xc8f4('0x49')],{'$or':_[_0xc8f4('0x2d')](_0x9c5a78[_0xc8f4('0x42')],function(_0x239488){var _0x1512a0={};_0x1512a0[_0x239488]={'$like':'%'+_0x1d22de[_0xc8f4('0x3f')][_0xc8f4('0x85')]+'%'};return _0x1512a0;})});}if(_0x1d22de[_0xc8f4('0x3f')][_0xc8f4('0xca')]){var _0x52467c=_0x1d22de[_0xc8f4('0x3f')][_0xc8f4('0xca')][_0xc8f4('0x31')](',');var _0x24ff11={};_0x24ff11[_0x52467c[0x0]]={'$gte':moment(_0x52467c[0x1])[_0xc8f4('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x9c5a78['where']=_[_0xc8f4('0xbf')](_0x9c5a78[_0xc8f4('0x49')],_0x24ff11);}_0x9c5a78=_[_0xc8f4('0xbf')]({},_0x9c5a78,_0x1d22de[_0xc8f4('0xcc')]);return db['WhatsappMessage']['count']({'where':_0x9c5a78[_0xc8f4('0x49')]})[_0xc8f4('0x29')](function(_0x5b1798){_0x5a573b[_0xc8f4('0x24')]=_0x5b1798;if(_0x1d22de['query'][_0xc8f4('0xbd')]){_0x9c5a78[_0xc8f4('0xbe')]=[{'all':!![]}];}return db[_0xc8f4('0xc8')]['findAll'](_0x9c5a78);})[_0xc8f4('0x29')](function(_0x4e0e78){_0x5a573b['rows']=_0x4e0e78;return _0x5a573b;});}})[_0xc8f4('0x29')](respondWithFilteredResult(_0xbc97d,_0x9c5a78))[_0xc8f4('0x32')](handleError(_0xbc97d,null));};exports[_0xc8f4('0xcd')]=function(_0x107284,_0x3eadb9,_0x1fb379){return db['WhatsappInteraction'][_0xc8f4('0x6d')]({'where':{'id':_0x107284[_0xc8f4('0xbc')]['id']}})[_0xc8f4('0x29')](handleEntityNotFound(_0x3eadb9,null))[_0xc8f4('0x29')](function(_0x2de76a){if(_0x2de76a){return _0x2de76a['setTags'](_0x107284[_0xc8f4('0x74')][_0xc8f4('0xc4')],_[_0xc8f4('0xc5')](_0x107284[_0xc8f4('0x74')],[_0xc8f4('0xc4'),'id'])||{})[_0xc8f4('0xce')](function(){return db[_0xc8f4('0xcf')][_0xc8f4('0xd0')]({'attributes':['id','name',_0xc8f4('0x4c')],'where':{'id':_0x107284[_0xc8f4('0x74')][_0xc8f4('0xc4')]}});})[_0xc8f4('0x29')](function(_0x31b430){socket[_0xc8f4('0xd1')](_0xc8f4('0xd2'),{'id':Number(_0x107284[_0xc8f4('0xbc')]['id']),'tags':_0x31b430||[]});return{'id':Number(_0x107284['params']['id']),'tags':_0x31b430||[]};});}})['then'](respondWithResult(_0x3eadb9,null))[_0xc8f4('0x32')](handleError(_0x3eadb9,null));};exports[_0xc8f4('0xd3')]=function(_0x3490b7,_0x3ab120,_0x44647a){return db['WhatsappInteraction']['find']({'where':{'id':_0x3490b7['params']['id']}})[_0xc8f4('0x29')](handleEntityNotFound(_0x3ab120,null))[_0xc8f4('0x29')](function(_0x7efe3e){if(_0x7efe3e){return _0x7efe3e[_0xc8f4('0xd3')](_0x3490b7[_0xc8f4('0x3f')][_0xc8f4('0xc4')]);}})[_0xc8f4('0x29')](respondWithStatusCode(_0x3ab120,null))[_0xc8f4('0x32')](handleError(_0x3ab120,null));};exports[_0xc8f4('0xd4')]=function(_0x974441,_0xd06413){var _0x3ac083=moment()['unix']()[_0xc8f4('0x9f')]();var _0x3b1c45=path['join'](config[_0xc8f4('0xd5')],'server','files',_0xc8f4('0xd6'));var _0x4d00d6=path[_0xc8f4('0xd7')](config['root'],'server',_0xc8f4('0xd8'),_0xc8f4('0xd9'));var _0x7528df=path[_0xc8f4('0xd7')](_0x3b1c45,_0x3ac083);var _0xe1d552=util['format']('transcript-%d-%s.zip',_0x974441['params']['id'],_0x3ac083);var _0x5eda68=path[_0xc8f4('0xd7')](_0x3b1c45,_0xe1d552);var _0x22f593=[];_0x22f593['push']({'model':db['User'],'as':_0xc8f4('0xda'),'attributes':['id',_0xc8f4('0x2e')],'raw':!![]});_0x22f593[_0xc8f4('0xb9')]({'model':db[_0xc8f4('0xdb')],'as':_0xc8f4('0x68'),'attributes':['id',_0xc8f4('0xdc'),'lastName'],'raw':!![]});if(_0x974441[_0xc8f4('0x3f')][_0xc8f4('0xd9')]){_0x22f593['push']({'model':db[_0xc8f4('0xdd')],'as':_0xc8f4('0xdd'),'raw':!![]});}var _0xdc8ac7=[{'model':db[_0xc8f4('0xc8')],'as':_0xc8f4('0xde'),'attributes':['id',_0xc8f4('0x74'),'createdAt','direction',_0xc8f4('0xdf'),'read'],'include':_0x22f593}];_0xdc8ac7[_0xc8f4('0xb9')]({'model':db[_0xc8f4('0xe0')],'as':_0xc8f4('0xe1'),'attributes':['id','name']});_0xdc8ac7[_0xc8f4('0xb9')]({'model':db[_0xc8f4('0xda')],'as':'Owner','attributes':['id','fullname']});return db[_0xc8f4('0x3a')][_0xc8f4('0x6d')]({'where':{'id':_0x974441[_0xc8f4('0xbc')]['id']},'include':_0xdc8ac7})[_0xc8f4('0x29')](handleEntityNotFound(_0xd06413,null))['then'](function(_0x19ad71){if(_0x19ad71){var _0x1d6b66=_0x19ad71[_0xc8f4('0xe2')]({'plain':!![]});fs[_0xc8f4('0xe3')](_0x7528df);var _0x69fb6f={'channel':'Whatsapp','account':_0x1d6b66[_0xc8f4('0xe1')][_0xc8f4('0x2c')],'agent':_0x1d6b66[_0xc8f4('0xe4')]?_0x1d6b66[_0xc8f4('0xe4')][_0xc8f4('0x2e')]:_0xc8f4('0xe5'),'createdAt':moment(_0x1d6b66[_0xc8f4('0x7b')])[_0xc8f4('0xcb')](_0xc8f4('0xe6'))[_0xc8f4('0x9f')](),'closedAt':_0x1d6b66[_0xc8f4('0x38')]?moment(_0x1d6b66[_0xc8f4('0xe7')])[_0xc8f4('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc8f4('0x9f')]():'','disposition':_0x1d6b66[_0xc8f4('0xe8')],'messages':_(_0x1d6b66[_0xc8f4('0xde')])[_0xc8f4('0x85')]({'secret':![]})[_0xc8f4('0x2d')](function(_0x196fee){if(_0x196fee[_0xc8f4('0xdd')]){var _0x42da2e=path['join'](_0x4d00d6,_0x196fee[_0xc8f4('0xdd')][_0xc8f4('0xe9')]);if(fs[_0xc8f4('0xea')](_0x42da2e)){fs[_0xc8f4('0xeb')](_0x42da2e)[_0xc8f4('0xec')](fs[_0xc8f4('0xed')](path[_0xc8f4('0xd7')](_0x7528df,_0x196fee[_0xc8f4('0xdd')][_0xc8f4('0xe9')])));}}return{'date':moment(_0x196fee['createdAt'])[_0xc8f4('0xcb')](_0xc8f4('0xe6'))[_0xc8f4('0x9f')](),'sender':_0x196fee[_0xc8f4('0xee')]===_0xc8f4('0xef')?_0x196fee['User']?_0x196fee[_0xc8f4('0xda')][_0xc8f4('0x2e')]:'System':_0x196fee['Contact'][_0xc8f4('0xdc')]+(_0x196fee[_0xc8f4('0x68')]['lastName']?'\x20'+_0x196fee[_0xc8f4('0x68')]['lastName']:''),'body':_0x196fee[_0xc8f4('0xdd')]?_0x196fee[_0xc8f4('0xdd')]['basename']:_0x196fee[_0xc8f4('0x74')],'direction':_0x196fee[_0xc8f4('0xee')]===_0xc8f4('0xef')?'A':'C','secret':_0x196fee[_0xc8f4('0xdf')],'read':_0x196fee['read'],'attachment':_0x196fee[_0xc8f4('0xdd')]};})['value']()};return ejs[_0xc8f4('0xf0')](path[_0xc8f4('0xd7')](config['root'],_0xc8f4('0xf1'),_0xc8f4('0xf2'),'downloadInteraction.ejs'),{'interaction':_0x69fb6f})[_0xc8f4('0x29')](function(_0x3195f7){var _0x2c6395=path['join'](_0x7528df,'transcript-'+_0x1d6b66['id']+'-'+_0x3ac083+_0xc8f4('0xf3'));var _0x28e091={'path':_0x2c6395,'channel':_0xc8f4('0xf4'),'interactionId':_0x1d6b66['id']};return pdf['createPdfFromHTML'](_0x3195f7,_0x28e091);})[_0xc8f4('0x29')](function(){return new BPromise(function(_0x41da0e,_0x35037f){zipdir(_0x7528df,{'saveTo':_0x5eda68},function(_0x1baf22,_0x124930){if(_0x1baf22)return _0x35037f(_0x1baf22);return _0x41da0e(_0x124930);});})[_0xc8f4('0x29')](function(){return new BPromise(function(_0x1d4611,_0x1220c4){rimraf(_0x7528df,function(_0x2d0b85){if(_0x2d0b85)_0x1220c4(_0x2d0b85);return _0x1d4611();});});})[_0xc8f4('0x29')](function(){return _0xd06413[_0xc8f4('0xd4')](_0x5eda68,_0xe1d552,function(_0x4c728e){if(_0x4c728e){console[_0xc8f4('0xf5')](_0xc8f4('0xf6'),_0x4c728e);}else{fs[_0xc8f4('0xf7')](_0x5eda68);}});});});}else{return _0xd06413[_0xc8f4('0x1d')](0xc8);}})[_0xc8f4('0x32')](handleError(_0xd06413,null));};
\ No newline at end of file
+var _0x6a55=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./whatsappInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','fullname','TagIds','Tags','split','forEach','catch','waiting','talking','unmanaged','total','closed','UserId','answered','index','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','select','field','color','from','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','User','body','some','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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','isEmpty','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','merge','WhatsappInteraction','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','show','keys','includeAll','create','params','describe','addMessage','ids','getMessages','WhatsappMessage','rawAttributes','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','omit','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','server','files','tmp','join','root','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','get','mkdirSync','Whatsapp','Account','Owner','N.A.','closedAt','disposition','basename','existsSync','pipe','createWriteStream','out','System','transcript-','createPdfFromHTML','log','err','eml-format','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x53d2c5,_0x58576b){var _0xd998d6=function(_0x25a9c5){while(--_0x25a9c5){_0x53d2c5['push'](_0x53d2c5['shift']());}};_0xd998d6(++_0x58576b);}(_0x6a55,0xdb));var _0x56a5=function(_0x369cf2,_0x47e28c){_0x369cf2=_0x369cf2-0x0;var _0x5c7d3e=_0x6a55[_0x369cf2];return _0x5c7d3e;};'use strict';var emlformat=require(_0x56a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x56a5('0x2'));var util=require('util');var path=require(_0x56a5('0x3'));var sox=require('sox');var csv=require(_0x56a5('0x4'));var ejs=require(_0x56a5('0x5'));var fs=require('fs');var fs_extra=require(_0x56a5('0x6'));var _=require(_0x56a5('0x7'));var squel=require(_0x56a5('0x8'));var crypto=require(_0x56a5('0x9'));var jsforce=require(_0x56a5('0xa'));var deskjs=require(_0x56a5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0xc'));var Papa=require(_0x56a5('0xd'));var Redis=require(_0x56a5('0xe'));var authService=require(_0x56a5('0xf'));var qs=require(_0x56a5('0x10'));var as=require(_0x56a5('0x11'));var pdf=require(_0x56a5('0x12'));var hardwareService=require(_0x56a5('0x13'));var logger=require(_0x56a5('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x56a5('0x15'));var licenseUtil=require(_0x56a5('0x16'));var db=require(_0x56a5('0x17'))['db'];config[_0x56a5('0x18')]=_[_0x56a5('0x19')](config[_0x56a5('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56a5('0x18')]));require(_0x56a5('0x1a'))[_0x56a5('0x1b')](socket);function respondWithStatusCode(_0x1d7aac,_0x310c32){_0x310c32=_0x310c32||0xcc;return function(_0x2db112){if(_0x2db112){return _0x1d7aac[_0x56a5('0x1c')](_0x310c32);}return _0x1d7aac['status'](_0x310c32)[_0x56a5('0x1d')]();};}function respondWithResult(_0x5488c6,_0x41e8b6){_0x41e8b6=_0x41e8b6||0xc8;return function(_0x51d031){if(_0x51d031){return _0x5488c6[_0x56a5('0x1e')](_0x41e8b6)[_0x56a5('0x1f')](_0x51d031);}};}function respondWithFilteredResult(_0x173c65,_0x28fe74){return function(_0x1ba472){if(_0x1ba472){var _0x143f3d=typeof _0x28fe74[_0x56a5('0x20')]==='undefined'&&typeof _0x28fe74[_0x56a5('0x21')]===_0x56a5('0x22');var _0x2bd357=_0x1ba472[_0x56a5('0x23')];var _0x52eee2=_0x143f3d?0x0:_0x28fe74[_0x56a5('0x20')];var _0x1fdb7a=_0x143f3d?_0x1ba472[_0x56a5('0x23')]:_0x28fe74[_0x56a5('0x20')]+_0x28fe74[_0x56a5('0x21')];var _0x529711;if(_0x1fdb7a>=_0x2bd357){_0x1fdb7a=_0x2bd357;_0x529711=0xc8;}else{_0x529711=0xce;}_0x173c65['status'](_0x529711);return _0x173c65[_0x56a5('0x24')](_0x56a5('0x25'),_0x52eee2+'-'+_0x1fdb7a+'/'+_0x2bd357)['json'](_0x1ba472);}return null;};}function patchUpdates(_0x1556eb){return function(_0x309fa5){try{jsonpatch[_0x56a5('0x26')](_0x309fa5,_0x1556eb,!![]);}catch(_0x15d9f8){return BPromise[_0x56a5('0x27')](_0x15d9f8);}return _0x309fa5[_0x56a5('0x28')]();};}function saveUpdates(_0x148d73,_0x8431df){return function(_0x2f4514){if(_0x2f4514){return _0x2f4514[_0x56a5('0x29')](_0x148d73)[_0x56a5('0x2a')](function(_0x2f203f){return _0x2f203f;});}return null;};}function removeEntity(_0x460bc2,_0x4f68b9){return function(_0x5c76a7){if(_0x5c76a7){return _0x5c76a7[_0x56a5('0x2b')]()[_0x56a5('0x2a')](function(){_0x460bc2[_0x56a5('0x1e')](0xcc)[_0x56a5('0x1d')]();});}};}function handleEntityNotFound(_0x527e84,_0x18e863){return function(_0x54ec36){if(!_0x54ec36){_0x527e84[_0x56a5('0x1c')](0x194);}return _0x54ec36;};}function handleError(_0x3c6ac1,_0x1b27b5){_0x1b27b5=_0x1b27b5||0x1f4;return function(_0x284ee5){logger['error'](_0x284ee5[_0x56a5('0x2c')]);if(_0x284ee5[_0x56a5('0x2d')]){delete _0x284ee5[_0x56a5('0x2d')];}_0x3c6ac1['status'](_0x1b27b5)[_0x56a5('0x2e')](_0x284ee5);};}function getInteractionUsers(_0x29dbe7,_0xeb4378){return new BPromise(function(_0x214649,_0x55978e){try{if(_0xeb4378[_0x29dbe7['id']]){_0x29dbe7['Users']=_[_0x56a5('0x2f')](_0xeb4378[_0x29dbe7['id']],function(_0x3fe011){return{'id':_0x3fe011['id'],'fullname':_0x3fe011[_0x56a5('0x30')]};});}}catch(_0x34477c){_0x55978e(_0x34477c);}_0x214649(_0x29dbe7);});}function getInteractionTags(_0x643937,_0x5e85a1){return new BPromise(function(_0x516b38,_0x200c4e){try{if(_0x643937[_0x56a5('0x31')]){_0x643937[_0x56a5('0x32')]=[];_0x643937['TagIds'][_0x56a5('0x33')](',')[_0x56a5('0x34')](function(_0x5135fd){_0x643937['Tags']['push'](_0x5e85a1[_0x5135fd]);});}delete _0x643937['TagIds'];}catch(_0x423e3a){_0x200c4e(_0x423e3a);}_0x516b38(_0x643937);});}function updateWhatsappInteraction(_0x29c8f1,_0x129cb9,_0x5cb9c8){return new BPromise(function(_0x5e778a,_0x4ec189){return getInteractionUsers(_0x29c8f1,_0x5cb9c8)[_0x56a5('0x2a')](function(_0x2a1d66){return getInteractionTags(_0x2a1d66,_0x129cb9);})['then'](function(_0x1dbd9a){return getStateInteraction(_0x1dbd9a);})['then'](function(_0x112e26){_0x5e778a(_0x112e26);})[_0x56a5('0x35')](function(_0x3798f8){_0x4ec189(_0x3798f8);});});}function getStateInteraction(_0x52b23f){return new BPromise(function(_0x20d1cc){_0x52b23f[_0x56a5('0x36')]=0x0;_0x52b23f[_0x56a5('0x37')]=0x0;_0x52b23f['answered']=0x0;_0x52b23f[_0x56a5('0x38')]=0x0;_0x52b23f[_0x56a5('0x39')]=0x0;if(!_0x52b23f[_0x56a5('0x3a')]&&!_0x52b23f[_0x56a5('0x3b')]){_0x52b23f[_0x56a5('0x36')]+=0x1;}if(!_0x52b23f['closed']&&_0x52b23f['UserId']){_0x52b23f[_0x56a5('0x37')]+=0x1;if(_0x52b23f[_0x56a5('0x36')]){_0x52b23f[_0x56a5('0x36')]-=0x1;}}if(_0x52b23f[_0x56a5('0x3a')]&&_0x52b23f[_0x56a5('0x3b')]){_0x52b23f[_0x56a5('0x3c')]+=0x1;if(_0x52b23f[_0x56a5('0x37')]){_0x52b23f[_0x56a5('0x37')]-=0x1;}}if(_0x52b23f[_0x56a5('0x3a')]&&!_0x52b23f[_0x56a5('0x3b')]){_0x52b23f[_0x56a5('0x38')]+=0x1;if(_0x52b23f[_0x56a5('0x36')]){_0x52b23f[_0x56a5('0x36')]-=0x1;}}_0x52b23f[_0x56a5('0x39')]+=0x1;_0x20d1cc(_0x52b23f);});}exports[_0x56a5('0x3d')]=function(_0x32318c,_0x46dfa3){var _0x4289f6={},_0xf0f6c8={},_0xa88ae1={'count':0x0,'rows':[]};var _0x6a7b4c=_[_0x56a5('0x2f')](db['WhatsappInteraction']['rawAttributes'],function(_0xe63fd5){return{'name':_0xe63fd5['fieldName'],'type':_0xe63fd5[_0x56a5('0x3e')][_0x56a5('0x3f')]};});_0xf0f6c8[_0x56a5('0x40')]=_[_0x56a5('0x2f')](_0x6a7b4c,_0x56a5('0x2d'));_0xf0f6c8[_0x56a5('0x41')]=_['keys'](_0x32318c['query']);_0xf0f6c8[_0x56a5('0x42')]=_[_0x56a5('0x43')](_0xf0f6c8[_0x56a5('0x40')],_0xf0f6c8[_0x56a5('0x41')]);_0x4289f6[_0x56a5('0x44')]=_[_0x56a5('0x43')](_0xf0f6c8['model'],qs[_0x56a5('0x45')](_0x32318c[_0x56a5('0x41')]['fields']));_0x4289f6[_0x56a5('0x44')]=_0x4289f6[_0x56a5('0x44')][_0x56a5('0x46')]?_0x4289f6[_0x56a5('0x44')]:_0xf0f6c8['model'];if(!_0x32318c[_0x56a5('0x41')]['hasOwnProperty'](_0x56a5('0x47'))){_0x4289f6[_0x56a5('0x21')]=qs['limit'](_0x32318c[_0x56a5('0x41')]['limit']);_0x4289f6[_0x56a5('0x20')]=qs[_0x56a5('0x20')](_0x32318c['query'][_0x56a5('0x20')]);}_0x4289f6['order']=qs[_0x56a5('0x48')](_0x32318c['query'][_0x56a5('0x48')]);_0x4289f6['where']=qs[_0x56a5('0x42')](_[_0x56a5('0x49')](_0x32318c[_0x56a5('0x41')],_0xf0f6c8[_0x56a5('0x42')]),_0x6a7b4c);var _0x30d377=[];var _0x43196d=squel[_0x56a5('0x4a')]()['field']('id')['field']('name')[_0x56a5('0x4b')](_0x56a5('0x4c'))[_0x56a5('0x4d')]('tools_tags');var _0x16ba8d=squel[_0x56a5('0x4a')]()[_0x56a5('0x4b')]('u.id')[_0x56a5('0x4b')](_0x56a5('0x4e'))['field'](_0x56a5('0x4f'))[_0x56a5('0x4d')](_0x56a5('0x50'),'ui')[_0x56a5('0x51')](_0x56a5('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x2b1fcb=squel[_0x56a5('0x4a')]()[_0x56a5('0x4d')](_0x56a5('0x53'),'i')[_0x56a5('0x51')]('cm_contacts','c',_0x56a5('0x54'))[_0x56a5('0x51')]('users','o',_0x56a5('0x55'))[_0x56a5('0x51')](_0x56a5('0x56'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x56a5('0x51')]('whatsapp_messages','me',_0x56a5('0x57'))['left_join'](_0x56a5('0x58'),'it',_0x56a5('0x59'))[_0x56a5('0x51')](_0x56a5('0x5a'),'t','t.id\x20=\x20it.TagId');var _0x341116=squel['expr']();var _0x240c74=[];var _0x25429e=squel[_0x56a5('0x5b')]();var _0x3d8b81;if(_0x32318c[_0x56a5('0x41')][_0x56a5('0x5c')]){_0x3d8b81=as[_0x56a5('0x5d')](_0x32318c[_0x56a5('0x41')][_0x56a5('0x5c')]);var _0x76c6bb=_0x3d8b81['sqlOperator'];for(var _0x4659a8=0x0;_0x4659a8<_0x3d8b81[_0x56a5('0x5e')]['length'];_0x4659a8++){var _0x21a457=_0x3d8b81['conditions'][_0x4659a8];var _0x241ccb='i';var _0x3f4f57=_[_0x56a5('0x5f')](_0x6a7b4c,[_0x56a5('0x2d'),_0x21a457[_0x56a5('0x4b')]]);if(!_0x3f4f57){switch(_0x21a457['field']){case _0x56a5('0x60'):if(_0x21a457[_0x56a5('0x61')]==0x1){_0x2b1fcb[_0x56a5('0x62')]('`'+_0x21a457[_0x56a5('0x4b')]+'`\x20=\x200');}else{_0x2b1fcb['having']('`'+_0x21a457[_0x56a5('0x4b')]+_0x56a5('0x63'));}break;case _0x56a5('0x64'):if(_0x21a457[_0x56a5('0x65')]===_0x56a5('0x66')){if(_0x21a457[_0x56a5('0x61')][_0x56a5('0x33')]('\x20')['length']>0x1){_0x341116[_0x76c6bb](_0x56a5('0x67'),qs[_0x56a5('0x68')](_0x21a457[_0x56a5('0x61')]),null);}else{var _0x4fb2c5='%'+_0x21a457['value']+'%';_0x341116[_0x76c6bb](_0x56a5('0x69'),_0x4fb2c5,_0x4fb2c5,_0x4fb2c5);}}else{_0x3f4f57=_[_0x56a5('0x5f')](_0x6a7b4c,[_0x56a5('0x2d'),_0x56a5('0x6a')]);_0x21a457[_0x56a5('0x4b')]=_0x56a5('0x6a');_0xff6cb8=as[_0x56a5('0x6b')](_0x241ccb,_0x3f4f57['type'],_0x21a457);_0x341116[_0x76c6bb](_0xff6cb8[_0x56a5('0x6c')],_0xff6cb8[_0x56a5('0x61')][_0x56a5('0x6d')],_0xff6cb8[_0x56a5('0x61')][_0x56a5('0x1d')]);}break;case _0x56a5('0x6e'):var _0x50b7d0=_0x21a457[_0x56a5('0x61')][_0x56a5('0x33')](',')[_0x56a5('0x2f')](function(_0x42db28){return Number(_0x42db28);});_0x50b7d0[_0x56a5('0x34')](function(_0x263c59){_0x25429e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x263c59+',%');});_0x240c74=_['union'](_0x240c74,_0x50b7d0);break;case _0x56a5('0x6f'):if(_0x21a457[_0x56a5('0x65')]===_0x56a5('0x66')){_0x341116[_0x76c6bb]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x21a457[_0x56a5('0x61')]+'%',null);}else{_0x3f4f57=_[_0x56a5('0x5f')](_0x6a7b4c,[_0x56a5('0x2d'),_0x56a5('0x3b')]);_0x21a457[_0x56a5('0x4b')]=_0x56a5('0x3b');_0xff6cb8=as[_0x56a5('0x6b')](_0x241ccb,_0x3f4f57[_0x56a5('0x3e')],_0x21a457);_0x341116[_0x76c6bb](_0xff6cb8['text'],_0xff6cb8[_0x56a5('0x61')][_0x56a5('0x6d')],_0xff6cb8[_0x56a5('0x61')][_0x56a5('0x1d')]);}break;case _0x56a5('0x70'):_0xff6cb8=as[_0x56a5('0x6b')]('me',null,_0x21a457);_0x341116[_0x76c6bb](_0xff6cb8[_0x56a5('0x6c')],_0xff6cb8[_0x56a5('0x61')][_0x56a5('0x6d')],_0xff6cb8[_0x56a5('0x61')][_0x56a5('0x1d')]);break;}}else{var _0xff6cb8=as[_0x56a5('0x6b')](_0x241ccb,_0x3f4f57[_0x56a5('0x3e')],_0x21a457);_0x341116[_0x76c6bb](_0xff6cb8[_0x56a5('0x6c')],_0xff6cb8['value'][_0x56a5('0x6d')],_0xff6cb8[_0x56a5('0x61')][_0x56a5('0x1d')]);}}}else{var _0x4f49ab=_(_0x32318c[_0x56a5('0x41')])['keys']()[_0x56a5('0x2f')](function(_0x463196){return _[_0x56a5('0x71')](_0x6a7b4c,[_0x56a5('0x2d'),_0x463196])?_0x463196:undefined;})[_0x56a5('0x72')]()[_0x56a5('0x61')]();if(!_['isEmpty'](_0x4f49ab)){_0x4f49ab[_0x56a5('0x34')](function(_0x43efa1){if(_0x43efa1===_0x56a5('0x73')){_0x2b1fcb[_0x56a5('0x74')](_0x56a5('0x75'),[][_0x56a5('0x76')](_0x32318c[_0x56a5('0x41')][_0x43efa1]));}else if(_0x43efa1==='createdAt'){var _0x1c36fc=JSON['parse'](_0x32318c['query'][_0x43efa1])[_0x56a5('0x77')];var _0x2e4d3c=JSON[_0x56a5('0x78')](_0x32318c[_0x56a5('0x41')][_0x43efa1])['$lte'];_0x2b1fcb[_0x56a5('0x74')](_0x56a5('0x79'),_0x1c36fc,_0x2e4d3c);}else{if(_0x32318c[_0x56a5('0x41')][_0x43efa1]==='null'){_0x2b1fcb[_0x56a5('0x74')]('i.'+_0x43efa1+'\x20IS\x20NULL');}else{_0x2b1fcb[_0x56a5('0x74')]('i.'+_0x43efa1+_0x56a5('0x7a'),_0x32318c[_0x56a5('0x41')][_0x43efa1]);}}});}if(_0x32318c[_0x56a5('0x41')][_0x56a5('0x7b')]){if(_0x32318c['query'][_0x56a5('0x7b')]==0x1){_0x2b1fcb[_0x56a5('0x62')]('`unreadMessages`\x20=\x200');}else{_0x2b1fcb[_0x56a5('0x62')](_0x56a5('0x7c'));}}if(_0x32318c[_0x56a5('0x41')]['tag']){_0x240c74=_[_0x56a5('0x7d')](_0x32318c[_0x56a5('0x41')][_0x56a5('0x7e')])?_0x32318c[_0x56a5('0x41')][_0x56a5('0x7e')]:new Array(_0x32318c[_0x56a5('0x41')][_0x56a5('0x7e')]);_0x240c74[_0x56a5('0x34')](function(_0x4673fa){_0x25429e['or'](_0x56a5('0x7f'),'%,'+_0x4673fa+',%');});}if(_0x32318c[_0x56a5('0x41')][_0x56a5('0x80')]){var _0x58e6c4=_0x32318c['query'][_0x56a5('0x80')][_0x56a5('0x81')]('\x5c','\x5c\x5c')[_0x56a5('0x81')](/'/g,'\x27\x27');if(qs[_0x56a5('0x82')](_0x58e6c4)){_0x341116['or'](_0x56a5('0x83'),_0x58e6c4+'%')['or'](_0x56a5('0x84'),_0x58e6c4+'%');}else{_0x341116['or'](_0x56a5('0x85'),qs[_0x56a5('0x68')](_0x58e6c4))['or'](_0x56a5('0x86'),_0x58e6c4+'%');}}}_0x2b1fcb[_0x56a5('0x74')](_0x341116);_0x2b1fcb[_0x56a5('0x87')](_0x56a5('0x88'));var _0x2b9276={'type':db[_0x56a5('0x89')][_0x56a5('0x8a')]['SELECT'],'raw':!![]};var _0x294b93=_0x2b1fcb['clone']();_0x294b93[_0x56a5('0x4b')](_0x56a5('0x88'));_0x294b93[_0x56a5('0x4b')](_0x56a5('0x8b'),_0x56a5('0x60'));if(_0x4289f6['order']){_0x4289f6[_0x56a5('0x8c')][_0x56a5('0x34')](function(_0x112abd){var _0x4ecabb=_0x112abd[0x0]===_0x56a5('0x8d')?_0x112abd[0x0]:'i.'+_0x112abd[0x0];_0x2b1fcb[_0x56a5('0x8c')](_0x4ecabb,_0x112abd[0x1]===_0x56a5('0x8e')?![]:!![]);});}if(!_[_0x56a5('0x8f')](_0x240c74)){_0x2b1fcb[_0x56a5('0x62')](_0x25429e);_0x294b93[_0x56a5('0x74')]('t.id\x20IN\x20?',_0x240c74);}BPromise['resolve']()[_0x56a5('0x2a')](function(){if(!_0x3d8b81){if(_0x32318c[_0x56a5('0x41')]['WhatsappAccountId'])return;_0x294b93['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x2b1fcb[_0x56a5('0x74')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x32318c[_0x56a5('0x90')][_0x56a5('0x91')]!==_0x56a5('0x92'))return;return _0x32318c['user'][_0x56a5('0x93')]({'attributes':['id'],'raw':!![]})[_0x56a5('0x2a')](function(_0x420674){if(_[_0x56a5('0x8f')](_0x420674)){_0x294b93[_0x56a5('0x74')]('i.WhatsappAccountId\x20IS\x20NULL');_0x2b1fcb['where'](_0x56a5('0x94'));}else{_0x294b93[_0x56a5('0x74')](_0x56a5('0x75'),_[_0x56a5('0x2f')](_0x420674,'id'));_0x2b1fcb[_0x56a5('0x74')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x420674,'id'));}});})[_0x56a5('0x2a')](function(){if(_0x32318c['user'][_0x56a5('0x91')]==='agent'&&!_0x3d8b81&&!_0x32318c[_0x56a5('0x41')][_0x56a5('0x73')])return[];return db[_0x56a5('0x95')]['query'](_0x294b93[_0x56a5('0x96')](),_0x2b9276);})[_0x56a5('0x2a')](function(_0x2bfa59){_0xa88ae1[_0x56a5('0x23')]=_0x2bfa59[_0x56a5('0x46')];if(_0xa88ae1[_0x56a5('0x23')]===0x0)return[];return db[_0x56a5('0x95')][_0x56a5('0x41')](_0x43196d['toString'](),_0x2b9276)[_0x56a5('0x2a')](function(_0x2ae5ae){_0x30d377=_['keyBy'](_0x2ae5ae,'id');_0x2b9276=_[_0x56a5('0x97')](_0x2b9276,{'model':db[_0x56a5('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x32318c['query'][_0x56a5('0x45')]){_0x4289f6[_0x56a5('0x44')][_0x56a5('0x34')](function(_0x13f982){_0x2b1fcb['field']('i.'+_0x13f982);});}else{_0x2b1fcb['field'](_0x56a5('0x8b'),_0x56a5('0x60'));_0x2b1fcb[_0x56a5('0x4b')]('a.key',_0x56a5('0x99'));_0x2b1fcb[_0x56a5('0x4b')](_0x56a5('0x9a'),'Account.mandatoryDisposition');_0x2b1fcb[_0x56a5('0x4b')](_0x56a5('0x9b'),'contactName');_0x2b1fcb[_0x56a5('0x4b')]('i.*');_0x2b1fcb[_0x56a5('0x4b')](_0x56a5('0x9c'),_0x56a5('0x9d'));_0x2b1fcb[_0x56a5('0x4b')](_0x56a5('0x9e'),_0x56a5('0x9f'));_0x2b1fcb[_0x56a5('0x4b')](_0x56a5('0xa0'),'Contact.email');_0x2b1fcb[_0x56a5('0x4b')](_0x56a5('0xa1'),_0x56a5('0xa2'));_0x2b1fcb['field'](_0x56a5('0xa3'),_0x56a5('0xa4'));_0x2b1fcb[_0x56a5('0x4b')](_0x56a5('0xa5'),_0x56a5('0xa6'));_0x2b1fcb[_0x56a5('0x4b')]('o.fullname',_0x56a5('0xa7'));_0x2b1fcb['field']('o.internal',_0x56a5('0xa8'));_0x2b1fcb[_0x56a5('0x4b')](_0x56a5('0xa9'),_0x56a5('0x31'));}if(_0x4289f6['limit'])_0x2b1fcb['limit'](_0x4289f6['limit']);if(_0x4289f6[_0x56a5('0x20')])_0x2b1fcb[_0x56a5('0x20')](_0x4289f6[_0x56a5('0x20')]);return db[_0x56a5('0x95')][_0x56a5('0x41')](_0x2b1fcb['toString'](),_0x2b9276);})[_0x56a5('0x2a')](function(_0x1b4f5b){if(_0x1b4f5b[_0x56a5('0x46')]>0x0)_0x16ba8d[_0x56a5('0x74')](_0x56a5('0xaa'),_[_0x56a5('0x2f')](_0x1b4f5b,'id'));return db[_0x56a5('0x95')][_0x56a5('0x41')](_0x16ba8d['toString'](),_0x2b9276)['then'](function(_0x5118fd){var _0x10a3ac=_[_0x56a5('0xab')](_0x5118fd,_0x56a5('0xac'));var _0x5138db=[];_0x1b4f5b[_0x56a5('0x34')](function(_0x401cda){_0x5138db[_0x56a5('0xad')](updateWhatsappInteraction(_0x401cda,_0x30d377,_0x10a3ac));});return BPromise[_0x56a5('0xae')](_0x5138db);});});})[_0x56a5('0x2a')](function(_0x289886){_0xa88ae1['rows']=_0x289886;return _0xa88ae1;})[_0x56a5('0x2a')](respondWithFilteredResult(_0x46dfa3,_0x4289f6))[_0x56a5('0x35')](handleError(_0x46dfa3,null));};exports[_0x56a5('0xaf')]=function(_0x245f2b,_0x375bcd){var _0x18a858={'raw':![],'where':{'id':_0x245f2b['params']['id']}},_0x2703ed={};_0x2703ed['model']=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x2703ed[_0x56a5('0x41')]=_[_0x56a5('0xb0')](_0x245f2b[_0x56a5('0x41')]);_0x2703ed[_0x56a5('0x42')]=_['intersection'](_0x2703ed[_0x56a5('0x40')],_0x2703ed[_0x56a5('0x41')]);_0x18a858['attributes']=_[_0x56a5('0x43')](_0x2703ed[_0x56a5('0x40')],qs[_0x56a5('0x45')](_0x245f2b[_0x56a5('0x41')][_0x56a5('0x45')]));_0x18a858[_0x56a5('0x44')]=_0x18a858[_0x56a5('0x44')][_0x56a5('0x46')]?_0x18a858[_0x56a5('0x44')]:_0x2703ed['model'];if(_0x245f2b['query'][_0x56a5('0xb1')]){_0x18a858['include']=[{'all':!![]}];}_0x18a858=_[_0x56a5('0x97')]({},_0x18a858,_0x245f2b['options']);return db[_0x56a5('0x98')][_0x56a5('0x5f')](_0x18a858)[_0x56a5('0x2a')](handleEntityNotFound(_0x375bcd,null))[_0x56a5('0x2a')](respondWithResult(_0x375bcd,null))[_0x56a5('0x35')](handleError(_0x375bcd,null));};exports[_0x56a5('0xb2')]=function(_0x53c681,_0x4532ab){return db['WhatsappInteraction'][_0x56a5('0xb2')](_0x53c681[_0x56a5('0x70')],{})['then'](respondWithResult(_0x4532ab,0xc9))['catch'](handleError(_0x4532ab,null));};exports[_0x56a5('0x29')]=function(_0x3f80d2,_0x2fb8b3){if(_0x3f80d2[_0x56a5('0x70')]['id']){delete _0x3f80d2[_0x56a5('0x70')]['id'];}return db[_0x56a5('0x98')]['find']({'where':{'id':_0x3f80d2[_0x56a5('0xb3')]['id']}})[_0x56a5('0x2a')](handleEntityNotFound(_0x2fb8b3,null))[_0x56a5('0x2a')](saveUpdates(_0x3f80d2[_0x56a5('0x70')],null))['then'](respondWithResult(_0x2fb8b3,null))[_0x56a5('0x35')](handleError(_0x2fb8b3,null));};exports['destroy']=function(_0x4d82ba,_0x2a2666){return db[_0x56a5('0x98')]['find']({'where':{'id':_0x4d82ba[_0x56a5('0xb3')]['id']}})[_0x56a5('0x2a')](handleEntityNotFound(_0x2a2666,null))[_0x56a5('0x2a')](removeEntity(_0x2a2666,null))[_0x56a5('0x35')](handleError(_0x2a2666,null));};exports[_0x56a5('0xb4')]=function(_0x55ec52,_0x5b0675){return db[_0x56a5('0x98')][_0x56a5('0xb4')]()[_0x56a5('0x2a')](respondWithResult(_0x5b0675,null))['catch'](handleError(_0x5b0675,null));};exports[_0x56a5('0xb5')]=function(_0x3aa3c4,_0x37bbf9,_0x551448){return db['WhatsappMessage'][_0x56a5('0x5f')]({'where':{'id':_0x3aa3c4['params']['id']}})[_0x56a5('0x2a')](handleEntityNotFound(_0x37bbf9,null))[_0x56a5('0x2a')](function(_0x330443){if(_0x330443){return _0x330443[_0x56a5('0xb5')](_0x3aa3c4[_0x56a5('0x70')][_0x56a5('0xb6')],_['omit'](_0x3aa3c4[_0x56a5('0x70')],[_0x56a5('0xb6'),'id'])||{});}})[_0x56a5('0x2a')](respondWithResult(_0x37bbf9,null))[_0x56a5('0x35')](handleError(_0x37bbf9,null));};exports[_0x56a5('0xb7')]=function(_0x2ea12e,_0x2027ba,_0x29f959){var _0x4558fc={'raw':![],'where':{}};var _0xda987b={};var _0x52b23d={'count':0x0,'rows':[]};return db[_0x56a5('0x98')]['findOne']({'where':{'id':_0x2ea12e['params']['id']}})[_0x56a5('0x2a')](handleEntityNotFound(_0x2027ba,null))[_0x56a5('0x2a')](function(_0x4c01cf){if(_0x4c01cf){_0xda987b[_0x56a5('0x40')]=_[_0x56a5('0xb0')](db[_0x56a5('0xb8')][_0x56a5('0xb9')]);_0xda987b[_0x56a5('0x41')]=_[_0x56a5('0xb0')](_0x2ea12e[_0x56a5('0x41')]);_0xda987b['filters']=_[_0x56a5('0x43')](_0xda987b[_0x56a5('0x40')],_0xda987b[_0x56a5('0x41')]);_0x4558fc[_0x56a5('0x44')]=_[_0x56a5('0x43')](_0xda987b[_0x56a5('0x40')],qs[_0x56a5('0x45')](_0x2ea12e[_0x56a5('0x41')][_0x56a5('0x45')]));_0x4558fc[_0x56a5('0x44')]=_0x4558fc['attributes'][_0x56a5('0x46')]?_0x4558fc[_0x56a5('0x44')]:_0xda987b['model'];if(!_0x2ea12e['query'][_0x56a5('0xba')](_0x56a5('0x47'))){_0x4558fc[_0x56a5('0x21')]=qs[_0x56a5('0x21')](_0x2ea12e[_0x56a5('0x41')][_0x56a5('0x21')]);_0x4558fc[_0x56a5('0x20')]=qs['offset'](_0x2ea12e[_0x56a5('0x41')]['offset']);}_0x4558fc['order']=qs[_0x56a5('0x48')](_0x2ea12e[_0x56a5('0x41')]['sort']);_0x4558fc[_0x56a5('0x74')]=qs['filters'](_[_0x56a5('0x49')](_0x2ea12e['query'],_0xda987b[_0x56a5('0x42')]));_0x4558fc[_0x56a5('0x74')][_0x56a5('0xac')]=_0x4c01cf['id'];if(_0x2ea12e['query']['filter']){_0x4558fc[_0x56a5('0x74')]=_[_0x56a5('0x97')](_0x4558fc[_0x56a5('0x74')],{'$or':_['map'](_0x4558fc[_0x56a5('0x44')],function(_0x583f31){var _0x5cf351={};_0x5cf351[_0x583f31]={'$like':'%'+_0x2ea12e['query']['filter']+'%'};return _0x5cf351;})});}if(_0x2ea12e[_0x56a5('0x41')][_0x56a5('0x77')]){var _0x96d118=_0x2ea12e[_0x56a5('0x41')][_0x56a5('0x77')]['split'](',');var _0x1129fa={};_0x1129fa[_0x96d118[0x0]]={'$gte':moment(_0x96d118[0x1])['format'](_0x56a5('0xbb'))};_0x4558fc[_0x56a5('0x74')]=_[_0x56a5('0x97')](_0x4558fc[_0x56a5('0x74')],_0x1129fa);}_0x4558fc=_[_0x56a5('0x97')]({},_0x4558fc,_0x2ea12e[_0x56a5('0xbc')]);return db[_0x56a5('0xb8')][_0x56a5('0x23')]({'where':_0x4558fc[_0x56a5('0x74')]})[_0x56a5('0x2a')](function(_0x298e4c){_0x52b23d[_0x56a5('0x23')]=_0x298e4c;if(_0x2ea12e[_0x56a5('0x41')][_0x56a5('0xb1')]){_0x4558fc['include']=[{'all':!![]}];}return db[_0x56a5('0xb8')][_0x56a5('0xbd')](_0x4558fc);})[_0x56a5('0x2a')](function(_0x4b83bf){_0x52b23d['rows']=_0x4b83bf;return _0x52b23d;});}})['then'](respondWithFilteredResult(_0x2027ba,_0x4558fc))[_0x56a5('0x35')](handleError(_0x2027ba,null));};exports['addTags']=function(_0x7529f,_0x5abcc0,_0xaad9a9){return db[_0x56a5('0x98')]['find']({'where':{'id':_0x7529f[_0x56a5('0xb3')]['id']}})[_0x56a5('0x2a')](handleEntityNotFound(_0x5abcc0,null))[_0x56a5('0x2a')](function(_0x40c333){if(_0x40c333){return _0x40c333[_0x56a5('0xbe')](_0x7529f[_0x56a5('0x70')][_0x56a5('0xb6')],_[_0x56a5('0xbf')](_0x7529f[_0x56a5('0x70')],[_0x56a5('0xb6'),'id'])||{})[_0x56a5('0xc0')](function(){return db[_0x56a5('0x6e')][_0x56a5('0xbd')]({'attributes':['id','name',_0x56a5('0x4c')],'where':{'id':_0x7529f['body'][_0x56a5('0xb6')]}});})['then'](function(_0x2e147a){socket[_0x56a5('0xc1')](_0x56a5('0xc2'),{'id':Number(_0x7529f[_0x56a5('0xb3')]['id']),'tags':_0x2e147a||[]});return{'id':Number(_0x7529f[_0x56a5('0xb3')]['id']),'tags':_0x2e147a||[]};});}})['then'](respondWithResult(_0x5abcc0,null))[_0x56a5('0x35')](handleError(_0x5abcc0,null));};exports[_0x56a5('0xc3')]=function(_0x35c014,_0x173e22,_0x737594){return db[_0x56a5('0x98')][_0x56a5('0x5f')]({'where':{'id':_0x35c014['params']['id']}})[_0x56a5('0x2a')](handleEntityNotFound(_0x173e22,null))[_0x56a5('0x2a')](function(_0x43420c){if(_0x43420c){return _0x43420c['removeTags'](_0x35c014[_0x56a5('0x41')][_0x56a5('0xb6')]);}})[_0x56a5('0x2a')](respondWithStatusCode(_0x173e22,null))[_0x56a5('0x35')](handleError(_0x173e22,null));};exports[_0x56a5('0xc4')]=function(_0x36609a,_0x5f53e9){var _0x85a4fb=moment()[_0x56a5('0xc5')]()[_0x56a5('0x96')]();var _0xb78c2b=path['join'](config['root'],_0x56a5('0xc6'),_0x56a5('0xc7'),_0x56a5('0xc8'));var _0x4723c2=path[_0x56a5('0xc9')](config[_0x56a5('0xca')],'server',_0x56a5('0xc7'),_0x56a5('0xcb'));var _0x1dd2b8=path[_0x56a5('0xc9')](_0xb78c2b,_0x85a4fb);var _0x395fd3=util[_0x56a5('0xcc')](_0x56a5('0xcd'),_0x36609a[_0x56a5('0xb3')]['id'],_0x85a4fb);var _0x472d36=path[_0x56a5('0xc9')](_0xb78c2b,_0x395fd3);var _0x124b29=[];_0x124b29[_0x56a5('0xad')]({'model':db[_0x56a5('0x6f')],'as':_0x56a5('0x6f'),'attributes':['id',_0x56a5('0x30')],'raw':!![]});_0x124b29[_0x56a5('0xad')]({'model':db[_0x56a5('0xce')],'as':_0x56a5('0x64'),'attributes':['id',_0x56a5('0xcf'),_0x56a5('0xd0')],'raw':!![]});if(_0x36609a[_0x56a5('0x41')][_0x56a5('0xcb')]){_0x124b29[_0x56a5('0xad')]({'model':db[_0x56a5('0xd1')],'as':'Attachment','raw':!![]});}var _0xbdb751=[{'model':db[_0x56a5('0xb8')],'as':_0x56a5('0xd2'),'attributes':['id',_0x56a5('0x70'),_0x56a5('0xd3'),_0x56a5('0xd4'),_0x56a5('0xd5'),_0x56a5('0x7b')],'include':_0x124b29}];_0xbdb751[_0x56a5('0xad')]({'model':db[_0x56a5('0xd6')],'as':'Account','attributes':['id',_0x56a5('0x2d')]});_0xbdb751[_0x56a5('0xad')]({'model':db[_0x56a5('0x6f')],'as':'Owner','attributes':['id',_0x56a5('0x30')]});return db[_0x56a5('0x98')][_0x56a5('0x5f')]({'where':{'id':_0x36609a[_0x56a5('0xb3')]['id']},'include':_0xbdb751})[_0x56a5('0x2a')](handleEntityNotFound(_0x5f53e9,null))[_0x56a5('0x2a')](function(_0x37e727){if(_0x37e727){var _0x2327ac=_0x37e727[_0x56a5('0xd7')]({'plain':!![]});fs[_0x56a5('0xd8')](_0x1dd2b8);var _0x443475={'channel':_0x56a5('0xd9'),'account':_0x2327ac[_0x56a5('0xda')][_0x56a5('0x2d')],'agent':_0x2327ac[_0x56a5('0xdb')]?_0x2327ac[_0x56a5('0xdb')][_0x56a5('0x30')]:_0x56a5('0xdc'),'createdAt':moment(_0x2327ac[_0x56a5('0xd3')])[_0x56a5('0xcc')](_0x56a5('0xbb'))['toString'](),'closedAt':_0x2327ac['closed']?moment(_0x2327ac[_0x56a5('0xdd')])[_0x56a5('0xcc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x56a5('0x96')]():'','disposition':_0x2327ac[_0x56a5('0xde')],'messages':_(_0x2327ac[_0x56a5('0xd2')])['filter']({'secret':![]})['map'](function(_0x3fa965){if(_0x3fa965[_0x56a5('0xd1')]){var _0x2653b3=path['join'](_0x4723c2,_0x3fa965[_0x56a5('0xd1')][_0x56a5('0xdf')]);if(fs[_0x56a5('0xe0')](_0x2653b3)){fs['createReadStream'](_0x2653b3)[_0x56a5('0xe1')](fs[_0x56a5('0xe2')](path[_0x56a5('0xc9')](_0x1dd2b8,_0x3fa965[_0x56a5('0xd1')]['basename'])));}}return{'date':moment(_0x3fa965[_0x56a5('0xd3')])[_0x56a5('0xcc')](_0x56a5('0xbb'))['toString'](),'sender':_0x3fa965['direction']===_0x56a5('0xe3')?_0x3fa965[_0x56a5('0x6f')]?_0x3fa965[_0x56a5('0x6f')]['fullname']:_0x56a5('0xe4'):_0x3fa965[_0x56a5('0x64')][_0x56a5('0xcf')]+(_0x3fa965[_0x56a5('0x64')][_0x56a5('0xd0')]?'\x20'+_0x3fa965[_0x56a5('0x64')][_0x56a5('0xd0')]:''),'body':_0x3fa965[_0x56a5('0xd1')]?_0x3fa965['Attachment'][_0x56a5('0xdf')]:_0x3fa965['body'],'direction':_0x3fa965['direction']===_0x56a5('0xe3')?'A':'C','secret':_0x3fa965[_0x56a5('0xd5')],'read':_0x3fa965[_0x56a5('0x7b')],'attachment':_0x3fa965[_0x56a5('0xd1')]};})[_0x56a5('0x61')]()};return ejs['renderFile'](path[_0x56a5('0xc9')](config[_0x56a5('0xca')],'server','views','downloadInteraction.ejs'),{'interaction':_0x443475})['then'](function(_0x6e09b1){var _0x25678a=path[_0x56a5('0xc9')](_0x1dd2b8,_0x56a5('0xe5')+_0x2327ac['id']+'-'+_0x85a4fb+'.pdf');var _0x367890={'path':_0x25678a,'channel':_0x56a5('0xd9'),'interactionId':_0x2327ac['id']};return pdf[_0x56a5('0xe6')](_0x6e09b1,_0x367890);})[_0x56a5('0x2a')](function(){return new BPromise(function(_0x3be223,_0xf59ce){zipdir(_0x1dd2b8,{'saveTo':_0x472d36},function(_0x4ef518,_0x345ba9){if(_0x4ef518)return _0xf59ce(_0x4ef518);return _0x3be223(_0x345ba9);});})[_0x56a5('0x2a')](function(){return new BPromise(function(_0x26cea4,_0x597066){rimraf(_0x1dd2b8,function(_0x265a31){if(_0x265a31)_0x597066(_0x265a31);return _0x26cea4();});});})[_0x56a5('0x2a')](function(){return _0x5f53e9[_0x56a5('0xc4')](_0x472d36,_0x395fd3,function(_0x19abaf){if(_0x19abaf){console[_0x56a5('0xe7')](_0x56a5('0xe8'),_0x19abaf);}else{fs['unlinkSync'](_0x472d36);}});});});}else{return _0x5f53e9[_0x56a5('0x1c')](0xc8);}})[_0x56a5('0x35')](handleError(_0x5f53e9,null));};
\ No newline at end of file
index 2da19ad..9050025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9755=['Users','findAll','emit','catch','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','remove','getUsers','then','setDataValue'];(function(_0x4f067e,_0x406536){var _0x3930d1=function(_0x326249){while(--_0x326249){_0x4f067e['push'](_0x4f067e['shift']());}};_0x3930d1(++_0x406536);}(_0x9755,0x1c6));var _0x5975=function(_0x3bcf9e,_0x148a5d){_0x3bcf9e=_0x3bcf9e-0x0;var _0x1bb37c=_0x9755[_0x3bcf9e];return _0x1bb37c;};'use strict';var EventEmitter=require(_0x5975('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x5975('0x1')];var WhatsappMessage=require(_0x5975('0x2'))['db'][_0x5975('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5975('0x4')};function emitEvent(_0x453917){return function(_0x2b7c96,_0x1a201e,_0x414e54){_0x2b7c96[_0x5975('0x5')]({'attributes':['id'],'raw':!![]})[_0x5975('0x6')](function(_0x56fc2e){_0x2b7c96[_0x5975('0x7')](_0x5975('0x8'),_0x56fc2e['map'](function(_0x3485fa){return{'id':_0x3485fa['id']};}));return WhatsappMessage[_0x5975('0x9')]({'where':{'WhatsappInteractionId':_0x2b7c96['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5975('0x6')](function(_0x5701dd){_0x2b7c96[_0x5975('0x7')]('unreadMessages',_0x5701dd['length']);WhatsappInteractionEvents[_0x5975('0xa')](_0x453917+':'+_0x2b7c96['id'],_0x2b7c96);WhatsappInteractionEvents[_0x5975('0xa')](_0x453917,_0x2b7c96);_0x414e54(null);})[_0x5975('0xb')](_0x414e54(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x5975('0xc')](e,emitEvent(event));}}module[_0x5975('0xd')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x8e63=['emit','catch','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','getUsers','then','setDataValue','findAll'];(function(_0x3746ff,_0x5dfa8f){var _0x353055=function(_0x11eae1){while(--_0x11eae1){_0x3746ff['push'](_0x3746ff['shift']());}};_0x353055(++_0x5dfa8f);}(_0x8e63,0x7c));var _0x38e6=function(_0x21cef5,_0x714458){_0x21cef5=_0x21cef5-0x0;var _0x9ebd3=_0x8e63[_0x21cef5];return _0x9ebd3;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x38e6('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x38e6('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x38e6('0x2')](0x0);var events={'afterCreate':_0x38e6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xe108a4){return function(_0x387e21,_0x344a0c,_0x5af45e){_0x387e21[_0x38e6('0x4')]({'attributes':['id'],'raw':!![]})[_0x38e6('0x5')](function(_0x9dd996){_0x387e21[_0x38e6('0x6')]('Users',_0x9dd996['map'](function(_0x61cee2){return{'id':_0x61cee2['id']};}));return WhatsappMessage[_0x38e6('0x7')]({'where':{'WhatsappInteractionId':_0x387e21['id'],'direction':'in','read':![]},'raw':!![]});})[_0x38e6('0x5')](function(_0x37ea60){_0x387e21[_0x38e6('0x6')]('unreadMessages',_0x37ea60['length']);WhatsappInteractionEvents[_0x38e6('0x8')](_0xe108a4+':'+_0x387e21['id'],_0x387e21);WhatsappInteractionEvents['emit'](_0xe108a4,_0x387e21);_0x5af45e(null);})[_0x38e6('0x9')](_0x5af45e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x38e6('0xa')](e,emitEvent(event));}}module[_0x38e6('0xb')]=WhatsappInteractionEvents;
\ No newline at end of file
index eaaa1e0..eb94787 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10d=['moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api'];(function(_0x586439,_0x5d62b5){var _0xa90581=function(_0x41bb0b){while(--_0x41bb0b){_0x586439['push'](_0x586439['shift']());}};_0xa90581(++_0x5d62b5);}(_0xb10d,0x19e));var _0xdb10=function(_0x5f34ed,_0x5b49db){_0x5f34ed=_0x5f34ed-0x0;var _0x1813bb=_0xb10d[_0x5f34ed];return _0x1813bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdb10('0x0'))(_0xdb10('0x1'));var moment=require(_0xdb10('0x2'));var BPromise=require(_0xdb10('0x3'));var rp=require(_0xdb10('0x4'));var fs=require('fs');var path=require(_0xdb10('0x5'));var rimraf=require(_0xdb10('0x6'));var config=require('../../config/environment');var attributes=require(_0xdb10('0x7'));module[_0xdb10('0x8')]=function(_0x1a73f7,_0x5776d8){return _0x1a73f7[_0xdb10('0x9')](_0xdb10('0xa'),attributes,{'tableName':_0xdb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42aa80,_0x495f49,_0x47c6a6){if(_0x42aa80['changed'](_0xdb10('0xc'))){_0x42aa80[_0xdb10('0xd')]=moment()[_0xdb10('0xe')](_0xdb10('0xf'));}_0x47c6a6(null,_0x42aa80);}}});};
\ No newline at end of file
+var _0xe5fc=['./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','rimraf'];(function(_0x42e4d7,_0x4bd202){var _0x346cd8=function(_0x36c0f6){while(--_0x36c0f6){_0x42e4d7['push'](_0x42e4d7['shift']());}};_0x346cd8(++_0x4bd202);}(_0xe5fc,0x109));var _0xce5f=function(_0x52e262,_0x1f8822){_0x52e262=_0x52e262-0x0;var _0x4d9dce=_0xe5fc[_0x52e262];return _0x4d9dce;};'use strict';var _=require(_0xce5f('0x0'));var util=require('util');var logger=require(_0xce5f('0x1'))(_0xce5f('0x2'));var moment=require(_0xce5f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce5f('0x4'));var config=require('../../config/environment');var attributes=require(_0xce5f('0x5'));module[_0xce5f('0x6')]=function(_0x2c23b0,_0x12d30e){return _0x2c23b0[_0xce5f('0x7')](_0xce5f('0x8'),attributes,{'tableName':_0xce5f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3451af,_0x4fa651,_0x356674){if(_0x3451af[_0xce5f('0xa')](_0xce5f('0xb'))){_0x3451af[_0xce5f('0xc')]=moment()[_0xce5f('0xd')](_0xce5f('0xe'));}_0x356674(null,_0x3451af);}}});};
\ No newline at end of file
index c8f24ef..86c9d8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e5c=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','attributes','stringify','AddTagsToWhatsappInteraction','find','where','body','ids','AddTags','debug','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e5c,0xcb));var _0xc7e5=function(_0x4936fb,_0x10fda9){_0x4936fb=_0x4936fb-0x0;var _0x4430ab=_0x7e5c[_0x4936fb];return _0x4430ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc7e5('0x0'));var fs=require('fs');var Redis=require(_0xc7e5('0x1'));var db=require(_0xc7e5('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc7e5('0x3'));var config=require(_0xc7e5('0x4'));var jayson=require(_0xc7e5('0x5'));var client=jayson['client'][_0xc7e5('0x6')]({'port':0x232a});config[_0xc7e5('0x7')]=_[_0xc7e5('0x8')](config[_0xc7e5('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xc7e5('0x9'))(new Redis(config[_0xc7e5('0x7')]));require(_0xc7e5('0xa'))[_0xc7e5('0xb')](socket);function respondWithRpcPromise(_0x2b1236,_0x3a2224,_0x4d1e88){return new BPromise(function(_0x33a10a,_0x1348bf){return client[_0xc7e5('0xc')](_0x2b1236,_0x4d1e88)[_0xc7e5('0xd')](function(_0xa7ff05){logger[_0xc7e5('0xe')](_0xc7e5('0xf'),_0x3a2224,_0xc7e5('0x10'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x3a2224,_0xc7e5('0x10'),JSON['stringify'](_0xa7ff05));if(_0xa7ff05[_0xc7e5('0x11')]){if(_0xa7ff05[_0xc7e5('0x11')]['code']===0x1f4){logger[_0xc7e5('0x11')](_0xc7e5('0xf'),_0x3a2224,_0xa7ff05['error']['message']);return _0x1348bf(_0xa7ff05['error']['message']);}logger[_0xc7e5('0x11')](_0xc7e5('0xf'),_0x3a2224,_0xa7ff05[_0xc7e5('0x11')][_0xc7e5('0x12')]);return _0x33a10a(_0xa7ff05['error'][_0xc7e5('0x12')]);}else{logger[_0xc7e5('0xe')]('WhatsappInteraction,\x20%s,\x20%s',_0x3a2224,'request\x20sent');_0x33a10a(_0xa7ff05[_0xc7e5('0x13')][_0xc7e5('0x12')]);}})[_0xc7e5('0x14')](function(_0x1786b6){logger[_0xc7e5('0x11')](_0xc7e5('0xf'),_0x3a2224,_0x1786b6);_0x1348bf(_0x1786b6);});});}exports[_0xc7e5('0x15')]=function(_0x41fe02){var _0x48bf81=this;return new Promise(function(_0x49c6e2,_0x1af012){return db[_0xc7e5('0x16')][_0xc7e5('0x17')](_0x41fe02['body'],{'raw':_0x41fe02['options']?_0x41fe02[_0xc7e5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41fe02['options']?_0x41fe02[_0xc7e5('0x18')]['where']||null:null,'attributes':_0x41fe02[_0xc7e5('0x18')]?_0x41fe02[_0xc7e5('0x18')][_0xc7e5('0x19')]||null:null,'limit':_0x41fe02['options']?_0x41fe02[_0xc7e5('0x18')]['limit']||null:null})[_0xc7e5('0xd')](function(_0x3dffa5){logger['info']('UpdateWhatsappInteraction',_0x41fe02);logger['debug']('UpdateWhatsappInteraction',_0x41fe02,JSON[_0xc7e5('0x1a')](_0x3dffa5));_0x49c6e2(_0x3dffa5);})[_0xc7e5('0x14')](function(_0x21b809){logger[_0xc7e5('0x11')](_0xc7e5('0x15'),_0x21b809[_0xc7e5('0x12')],_0x41fe02);_0x1af012(_0x48bf81[_0xc7e5('0x11')](0x1f4,_0x21b809['message']));});});};exports[_0xc7e5('0x1b')]=function(_0x3f9ded){return new Promise(function(_0x26c946,_0x233415){return db['WhatsappInteraction'][_0xc7e5('0x1c')]({'where':_0x3f9ded[_0xc7e5('0x18')]?_0x3f9ded[_0xc7e5('0x18')][_0xc7e5('0x1d')]||null:null})[_0xc7e5('0xd')](function(_0x6c8e1){if(_0x6c8e1){return _0x6c8e1['addTags'](_0x3f9ded[_0xc7e5('0x1e')][_0xc7e5('0x1f')],_['omit'](_0x3f9ded[_0xc7e5('0x1e')],[_0xc7e5('0x1f'),'id'])||{});}})['spread'](function(_0x396344){logger[_0xc7e5('0xe')](_0xc7e5('0x20'),_0x3f9ded);logger[_0xc7e5('0x21')](_0xc7e5('0x20'),_0x3f9ded,JSON[_0xc7e5('0x1a')](_0x396344));_0x26c946(_0x396344);})[_0xc7e5('0x14')](function(_0x30f812){logger[_0xc7e5('0x11')]('AddTags',_0x30f812[_0xc7e5('0x12')],_0x3f9ded);_0x233415(_this[_0xc7e5('0x11')](0x1f4,_0x30f812['message']));});});};
\ No newline at end of file
+var _0x210e=['../../mysqldb','../../config/logger','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','debug','AddTagsToWhatsappInteraction','find','then','ids','omit','spread','AddTags','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x26a6b9,_0x6a0903){var _0x331a15=function(_0x2e5ec0){while(--_0x2e5ec0){_0x26a6b9['push'](_0x26a6b9['shift']());}};_0x331a15(++_0x6a0903);}(_0x210e,0x8f));var _0xe210=function(_0x2d6dc4,_0x5e2d29){_0x2d6dc4=_0x2d6dc4-0x0;var _0x52991e=_0x210e[_0x2d6dc4];return _0x52991e;};'use strict';var _=require(_0xe210('0x0'));var util=require(_0xe210('0x1'));var moment=require('moment');var BPromise=require(_0xe210('0x2'));var rs=require(_0xe210('0x3'));var fs=require('fs');var Redis=require(_0xe210('0x4'));var db=require(_0xe210('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe210('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe210('0x7')][_0xe210('0x8')]({'port':0x232a});config[_0xe210('0x9')]=_['defaults'](config['redis'],{'host':_0xe210('0xa'),'port':0x18eb});var socket=require(_0xe210('0xb'))(new Redis(config[_0xe210('0x9')]));require(_0xe210('0xc'))[_0xe210('0xd')](socket);function respondWithRpcPromise(_0x5b4d62,_0x31309e,_0x240a3a){return new BPromise(function(_0x72abb7,_0x1798b0){return client['request'](_0x5b4d62,_0x240a3a)['then'](function(_0x1f6f7c){logger['info'](_0xe210('0xe'),_0x31309e,_0xe210('0xf'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x31309e,_0xe210('0xf'),JSON[_0xe210('0x10')](_0x1f6f7c));if(_0x1f6f7c[_0xe210('0x11')]){if(_0x1f6f7c[_0xe210('0x11')][_0xe210('0x12')]===0x1f4){logger[_0xe210('0x11')](_0xe210('0xe'),_0x31309e,_0x1f6f7c[_0xe210('0x11')]['message']);return _0x1798b0(_0x1f6f7c[_0xe210('0x11')][_0xe210('0x13')]);}logger['error'](_0xe210('0xe'),_0x31309e,_0x1f6f7c[_0xe210('0x11')][_0xe210('0x13')]);return _0x72abb7(_0x1f6f7c[_0xe210('0x11')][_0xe210('0x13')]);}else{logger[_0xe210('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x31309e,_0xe210('0xf'));_0x72abb7(_0x1f6f7c[_0xe210('0x15')][_0xe210('0x13')]);}})['catch'](function(_0x559b08){logger['error'](_0xe210('0xe'),_0x31309e,_0x559b08);_0x1798b0(_0x559b08);});});}exports[_0xe210('0x16')]=function(_0x1afd27){var _0x4b7b06=this;return new Promise(function(_0x12325d,_0x4388c0){return db[_0xe210('0x17')][_0xe210('0x18')](_0x1afd27[_0xe210('0x19')],{'raw':_0x1afd27[_0xe210('0x1a')]?_0x1afd27['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1afd27[_0xe210('0x1a')]?_0x1afd27[_0xe210('0x1a')][_0xe210('0x1b')]||null:null,'attributes':_0x1afd27[_0xe210('0x1a')]?_0x1afd27[_0xe210('0x1a')]['attributes']||null:null,'limit':_0x1afd27[_0xe210('0x1a')]?_0x1afd27[_0xe210('0x1a')]['limit']||null:null})['then'](function(_0x1e8e39){logger[_0xe210('0x14')](_0xe210('0x16'),_0x1afd27);logger[_0xe210('0x1c')](_0xe210('0x16'),_0x1afd27,JSON[_0xe210('0x10')](_0x1e8e39));_0x12325d(_0x1e8e39);})['catch'](function(_0x30ab8c){logger['error']('UpdateWhatsappInteraction',_0x30ab8c['message'],_0x1afd27);_0x4388c0(_0x4b7b06[_0xe210('0x11')](0x1f4,_0x30ab8c[_0xe210('0x13')]));});});};exports[_0xe210('0x1d')]=function(_0x1c00c3){return new Promise(function(_0x2fe8d8,_0x241919){return db[_0xe210('0x17')][_0xe210('0x1e')]({'where':_0x1c00c3[_0xe210('0x1a')]?_0x1c00c3[_0xe210('0x1a')][_0xe210('0x1b')]||null:null})[_0xe210('0x1f')](function(_0x3629c4){if(_0x3629c4){return _0x3629c4['addTags'](_0x1c00c3['body'][_0xe210('0x20')],_[_0xe210('0x21')](_0x1c00c3[_0xe210('0x19')],[_0xe210('0x20'),'id'])||{});}})[_0xe210('0x22')](function(_0x2c6d4f){logger['info'](_0xe210('0x23'),_0x1c00c3);logger[_0xe210('0x1c')](_0xe210('0x23'),_0x1c00c3,JSON['stringify'](_0x2c6d4f));_0x2fe8d8(_0x2c6d4f);})[_0xe210('0x24')](function(_0x51409c){logger[_0xe210('0x11')](_0xe210('0x23'),_0x51409c[_0xe210('0x13')],_0x1c00c3);_0x241919(_this['error'](0x1f4,_0x51409c[_0xe210('0x13')]));});});};
\ No newline at end of file
index cfa7384..d4792ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91ae=['whatsappInteraction:','./whatsappInteraction.events','save','emit','removeListener','register','length'];(function(_0x3caffc,_0x46cf2d){var _0x4d7cd3=function(_0x4996ae){while(--_0x4996ae){_0x3caffc['push'](_0x3caffc['shift']());}};_0x4d7cd3(++_0x46cf2d);}(_0x91ae,0x112));var _0xe91a=function(_0xd12c1e,_0x293a81){_0xd12c1e=_0xd12c1e-0x0;var _0x2450e5=_0x91ae[_0xd12c1e];return _0x2450e5;};'use strict';var WhatsappInteractionEvents=require(_0xe91a('0x0'));var events=[_0xe91a('0x1'),'remove','update'];function createListener(_0x1e0ca1,_0x4eca70){return function(_0x4c1942){_0x4eca70[_0xe91a('0x2')](_0x1e0ca1,_0x4c1942);};}function removeListener(_0x2abcc3,_0x56d73a){return function(){WhatsappInteractionEvents[_0xe91a('0x3')](_0x2abcc3,_0x56d73a);};}exports[_0xe91a('0x4')]=function(_0x4146e1){for(var _0x2d262c=0x0,_0x2c9c70=events[_0xe91a('0x5')];_0x2d262c<_0x2c9c70;_0x2d262c++){var _0x7d78b8=events[_0x2d262c];var _0x5409dc=createListener(_0xe91a('0x6')+_0x7d78b8,_0x4146e1);WhatsappInteractionEvents['on'](_0x7d78b8,_0x5409dc);}};
\ No newline at end of file
+var _0xbba6=['whatsappInteraction:','save','remove','update','removeListener','register','length'];(function(_0x4f550e,_0x3c5b50){var _0x3c9d54=function(_0x363959){while(--_0x363959){_0x4f550e['push'](_0x4f550e['shift']());}};_0x3c9d54(++_0x3c5b50);}(_0xbba6,0xfd));var _0x6bba=function(_0x502399,_0x1878d5){_0x502399=_0x502399-0x0;var _0x53c51b=_0xbba6[_0x502399];return _0x53c51b;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x6bba('0x0'),_0x6bba('0x1'),_0x6bba('0x2')];function createListener(_0xaa7bdf,_0x3ee41a){return function(_0x372bb3){_0x3ee41a['emit'](_0xaa7bdf,_0x372bb3);};}function removeListener(_0x50dead,_0x3a9e1d){return function(){WhatsappInteractionEvents[_0x6bba('0x3')](_0x50dead,_0x3a9e1d);};}exports[_0x6bba('0x4')]=function(_0x1655c9){for(var _0x26960f=0x0,_0x5b3b53=events[_0x6bba('0x5')];_0x26960f<_0x5b3b53;_0x26960f++){var _0x4cacec=events[_0x26960f];var _0x546351=createListener(_0x6bba('0x6')+_0x4cacec,_0x1655c9);WhatsappInteractionEvents['on'](_0x4cacec,_0x546351);}};
\ No newline at end of file
index f0c6ba2..270626b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44fd=['/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','create'];(function(_0xa76664,_0x5e32db){var _0x3f7743=function(_0x477dee){while(--_0x477dee){_0xa76664['push'](_0xa76664['shift']());}};_0x3f7743(++_0x5e32db);}(_0x44fd,0x123));var _0xd44f=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x44fd[_0x59162a];return _0x35e50d;};'use strict';var multer=require(_0xd44f('0x0'));var util=require(_0xd44f('0x1'));var path=require(_0xd44f('0x2'));var timeout=require(_0xd44f('0x3'));var express=require(_0xd44f('0x4'));var router=express[_0xd44f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd44f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd44f('0x7'));router[_0xd44f('0x8')]('/',auth[_0xd44f('0x9')](),controller[_0xd44f('0xa')]);router['get']('/describe',auth[_0xd44f('0x9')](),controller[_0xd44f('0xb')]);router[_0xd44f('0x8')](_0xd44f('0xc'),auth[_0xd44f('0x9')](),controller[_0xd44f('0xd')]);router[_0xd44f('0xe')]('/',auth[_0xd44f('0x9')](),interaction[_0xd44f('0xf')]('whatsapp','whatsappmessage:create'),controller[_0xd44f('0x10')]);router['post'](_0xd44f('0x11'),controller[_0xd44f('0x12')]);router[_0xd44f('0x13')](_0xd44f('0xc'),auth['isAuthenticated'](),controller[_0xd44f('0x14')]);router['put'](_0xd44f('0x15'),auth[_0xd44f('0x9')](),controller[_0xd44f('0x16')]);router['put'](_0xd44f('0x17'),auth['isAuthenticated'](),controller[_0xd44f('0x18')]);router[_0xd44f('0x19')](_0xd44f('0xc'),auth[_0xd44f('0x9')](),controller[_0xd44f('0x1a')]);module[_0xd44f('0x1b')]=router;
\ No newline at end of file
+var _0xfc00=['put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status'];(function(_0x28884c,_0x1ed6b4){var _0x654b52=function(_0x495c2a){while(--_0x495c2a){_0x28884c['push'](_0x28884c['shift']());}};_0x654b52(++_0x1ed6b4);}(_0xfc00,0x104));var _0x0fc0=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xfc00[_0x18cd5b];return _0x5eaa52;};'use strict';var multer=require(_0x0fc0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0fc0('0x1'));var express=require(_0x0fc0('0x2'));var router=express[_0x0fc0('0x3')]();var fs_extra=require(_0x0fc0('0x4'));var auth=require(_0x0fc0('0x5'));var interaction=require(_0x0fc0('0x6'));var config=require(_0x0fc0('0x7'));var controller=require(_0x0fc0('0x8'));router[_0x0fc0('0x9')]('/',auth[_0x0fc0('0xa')](),controller[_0x0fc0('0xb')]);router[_0x0fc0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x0fc0('0xc')]);router[_0x0fc0('0x9')](_0x0fc0('0xd'),auth[_0x0fc0('0xa')](),controller['show']);router[_0x0fc0('0xe')]('/',auth[_0x0fc0('0xa')](),interaction[_0x0fc0('0xf')](_0x0fc0('0x10'),_0x0fc0('0x11')),controller['create']);router[_0x0fc0('0xe')](_0x0fc0('0x12'),controller[_0x0fc0('0x13')]);router[_0x0fc0('0x14')](_0x0fc0('0xd'),auth[_0x0fc0('0xa')](),controller[_0x0fc0('0x15')]);router[_0x0fc0('0x14')](_0x0fc0('0x16'),auth[_0x0fc0('0xa')](),controller[_0x0fc0('0x17')]);router[_0x0fc0('0x14')](_0x0fc0('0x18'),auth['isAuthenticated'](),controller[_0x0fc0('0x19')]);router['delete'](_0x0fc0('0xd'),auth[_0x0fc0('0xa')](),controller[_0x0fc0('0x1a')]);module[_0x0fc0('0x1b')]=router;
\ No newline at end of file
index edb1552..049e7ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa895=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x394cf1,_0x3d40ca){var _0x8a4dc1=function(_0x4864c3){while(--_0x4864c3){_0x394cf1['push'](_0x394cf1['shift']());}};_0x8a4dc1(++_0x3d40ca);}(_0xa895,0x145));var _0x5a89=function(_0x371f60,_0x1b6185){_0x371f60=_0x371f60-0x0;var _0x505a0d=_0xa895[_0x371f60];return _0x505a0d;};'use strict';var Sequelize=require(_0x5a89('0x0'));module[_0x5a89('0x1')]={'body':{'type':Sequelize[_0x5a89('0x2')](_0x5a89('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5a89('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5a89('0x5')]('in',_0x5a89('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x5a89('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x5a89('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5a89('0x7')]},'providerResponse':{'type':Sequelize[_0x5a89('0x2')]}};
\ No newline at end of file
+var _0x9494=['ENUM','out','STRING','DATE','TEXT','sequelize','exports','medium'];(function(_0x3fe19f,_0xf7cba3){var _0x512780=function(_0x173456){while(--_0x173456){_0x3fe19f['push'](_0x3fe19f['shift']());}};_0x512780(++_0xf7cba3);}(_0x9494,0x185));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4949('0x0'));module[_0x4949('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4949('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4949('0x3')]('in',_0x4949('0x4')),'defaultValue':_0x4949('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4949('0x5')](0xbe)},'phone':{'type':Sequelize[_0x4949('0x5')]},'readAt':{'type':Sequelize[_0x4949('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x4949('0x7')]}};
\ No newline at end of file
index 04c6f10..ba9000d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabab=['rejectMessage','Sequelize','SELECT','User','interface','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','MessageSid','messageId','MessageStatus','read','twilio','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','send','index','map','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','keys','length','WhatsappMessage','create','body','find','params','describe','accept','whatsapp','readAt','format','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','agent','fullname','email','internal','channel','event','EventManager','acceptmessage','whatsapp-interactions','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage'];(function(_0x4035dc,_0x752ace){var _0x1a581e=function(_0x3f38b3){while(--_0x3f38b3){_0x4035dc['push'](_0x4035dc['shift']());}};_0x1a581e(++_0x752ace);}(_0xabab,0x123));var _0xbaba=function(_0x471d8a,_0x29b910){_0x471d8a=_0x471d8a-0x0;var _0x3012ee=_0xabab[_0x471d8a];return _0x3012ee;};'use strict';var emlformat=require(_0xbaba('0x0'));var rimraf=require(_0xbaba('0x1'));var zipdir=require(_0xbaba('0x2'));var jsonpatch=require(_0xbaba('0x3'));var rp=require(_0xbaba('0x4'));var moment=require(_0xbaba('0x5'));var BPromise=require(_0xbaba('0x6'));var Mustache=require('mustache');var util=require(_0xbaba('0x7'));var path=require(_0xbaba('0x8'));var sox=require(_0xbaba('0x9'));var csv=require(_0xbaba('0xa'));var ejs=require(_0xbaba('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbaba('0xc'));var squel=require(_0xbaba('0xd'));var crypto=require('crypto');var jsforce=require(_0xbaba('0xe'));var deskjs=require(_0xbaba('0xf'));var toCsv=require(_0xbaba('0xa'));var querystring=require(_0xbaba('0x10'));var Papa=require(_0xbaba('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbaba('0x12'));var hardwareService=require(_0xbaba('0x13'));var logger=require(_0xbaba('0x14'))(_0xbaba('0x15'));var utils=require(_0xbaba('0x16'));var config=require(_0xbaba('0x17'));var licenseUtil=require(_0xbaba('0x18'));var db=require(_0xbaba('0x19'))['db'];config[_0xbaba('0x1a')]=_[_0xbaba('0x1b')](config[_0xbaba('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xbaba('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbaba('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xbaba('0x1d')][_0xbaba('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2ffdb1,_0x3ba5e2,_0x4364d7,_0x1144cb){return new BPromise(function(_0x33d579,_0x28b4e8){var _0x3b14b3=_0x1144cb||client;return _0x3b14b3[_0xbaba('0x1f')](_0x2ffdb1,_0x4364d7)[_0xbaba('0x20')](function(_0x4a5970){logger[_0xbaba('0x21')](_0xbaba('0x22'),_0x3ba5e2,'request\x20sent');logger[_0xbaba('0x23')](_0xbaba('0x24'),_0x3ba5e2,_0xbaba('0x25'),JSON[_0xbaba('0x26')](_0x4a5970));if(_0x4a5970[_0xbaba('0x27')]){if(_0x4a5970['error'][_0xbaba('0x28')]===0x1f4){logger[_0xbaba('0x27')](_0xbaba('0x22'),_0x3ba5e2,_0x4a5970[_0xbaba('0x27')][_0xbaba('0x29')]);return _0x28b4e8(_0x4a5970['error'][_0xbaba('0x29')]);}logger[_0xbaba('0x27')](_0xbaba('0x22'),_0x3ba5e2,_0x4a5970[_0xbaba('0x27')][_0xbaba('0x29')]);return _0x33d579(_0x4a5970[_0xbaba('0x27')][_0xbaba('0x29')]);}else{logger[_0xbaba('0x21')](_0xbaba('0x22'),_0x3ba5e2,_0xbaba('0x25'));_0x33d579(_0x4a5970[_0xbaba('0x2a')][_0xbaba('0x29')]);}})['catch'](function(_0xa9fb74){logger[_0xbaba('0x27')](_0xbaba('0x22'),_0x3ba5e2,_0xa9fb74);_0x28b4e8(_0xa9fb74);});});}function respondWithStatusCode(_0x135e25,_0x42e3ca){_0x42e3ca=_0x42e3ca||0xcc;return function(_0x45e4fe){if(_0x45e4fe){return _0x135e25[_0xbaba('0x2b')](_0x42e3ca);}return _0x135e25[_0xbaba('0x2c')](_0x42e3ca)[_0xbaba('0x2d')]();};}function respondWithResult(_0x1c3f91,_0x20a79c){_0x20a79c=_0x20a79c||0xc8;return function(_0x3ff0fa){if(_0x3ff0fa){return _0x1c3f91[_0xbaba('0x2c')](_0x20a79c)[_0xbaba('0x2e')](_0x3ff0fa);}};}function respondWithFilteredResult(_0x15c8e4,_0x998b50){return function(_0x1a061b){if(_0x1a061b){var _0x51ed2c=typeof _0x998b50[_0xbaba('0x2f')]==='undefined'&&typeof _0x998b50['limit']===_0xbaba('0x30');var _0x3a4585=_0x1a061b['count'];var _0x2f9164=_0x51ed2c?0x0:_0x998b50[_0xbaba('0x2f')];var _0x3a1847=_0x51ed2c?_0x1a061b[_0xbaba('0x31')]:_0x998b50[_0xbaba('0x2f')]+_0x998b50[_0xbaba('0x32')];var _0x53b02a;if(_0x3a1847>=_0x3a4585){_0x3a1847=_0x3a4585;_0x53b02a=0xc8;}else{_0x53b02a=0xce;}_0x15c8e4[_0xbaba('0x2c')](_0x53b02a);return _0x15c8e4[_0xbaba('0x33')](_0xbaba('0x34'),_0x2f9164+'-'+_0x3a1847+'/'+_0x3a4585)[_0xbaba('0x2e')](_0x1a061b);}return null;};}function patchUpdates(_0x3c2375){return function(_0x1014f7){try{jsonpatch[_0xbaba('0x35')](_0x1014f7,_0x3c2375,!![]);}catch(_0x47f0af){return BPromise['reject'](_0x47f0af);}return _0x1014f7[_0xbaba('0x36')]();};}function saveUpdates(_0x48f906,_0x2836a0){return function(_0x1c65b7){if(_0x1c65b7){return _0x1c65b7[_0xbaba('0x37')](_0x48f906)[_0xbaba('0x20')](function(_0x1b1280){return _0x1b1280;});}return null;};}function removeEntity(_0x26de52,_0x147659){return function(_0x14c2b6){if(_0x14c2b6){return _0x14c2b6[_0xbaba('0x38')]()[_0xbaba('0x20')](function(){_0x26de52[_0xbaba('0x2c')](0xcc)[_0xbaba('0x2d')]();});}};}function handleEntityNotFound(_0x5a091f,_0x5356b6){return function(_0x392e09){if(!_0x392e09){_0x5a091f[_0xbaba('0x2b')](0x194);}return _0x392e09;};}function handleError(_0x4e3526,_0x57fb09){_0x57fb09=_0x57fb09||0x1f4;return function(_0x217473){logger[_0xbaba('0x27')](_0x217473['stack']);if(_0x217473['name']){delete _0x217473['name'];}_0x4e3526[_0xbaba('0x2c')](_0x57fb09)[_0xbaba('0x39')](_0x217473);};}exports[_0xbaba('0x3a')]=function(_0x5963cc,_0x1c25c9){var _0x26a6c0={},_0x3cc470={},_0xa4cf={'count':0x0,'rows':[]};var _0x34702a=_[_0xbaba('0x3b')](db['WhatsappMessage']['rawAttributes'],function(_0x585de7){return{'name':_0x585de7[_0xbaba('0x3c')],'type':_0x585de7[_0xbaba('0x3d')][_0xbaba('0x3e')]};});_0x3cc470[_0xbaba('0x3f')]=_['map'](_0x34702a,_0xbaba('0x40'));_0x3cc470[_0xbaba('0x41')]=_['keys'](_0x5963cc[_0xbaba('0x41')]);_0x3cc470[_0xbaba('0x42')]=_[_0xbaba('0x43')](_0x3cc470[_0xbaba('0x3f')],_0x3cc470[_0xbaba('0x41')]);_0x26a6c0[_0xbaba('0x44')]=_[_0xbaba('0x43')](_0x3cc470['model'],qs[_0xbaba('0x45')](_0x5963cc[_0xbaba('0x41')][_0xbaba('0x45')]));_0x26a6c0[_0xbaba('0x44')]=_0x26a6c0[_0xbaba('0x44')]['length']?_0x26a6c0[_0xbaba('0x44')]:_0x3cc470[_0xbaba('0x3f')];if(!_0x5963cc['query']['hasOwnProperty'](_0xbaba('0x46'))){_0x26a6c0[_0xbaba('0x32')]=qs['limit'](_0x5963cc[_0xbaba('0x41')]['limit']);_0x26a6c0[_0xbaba('0x2f')]=qs[_0xbaba('0x2f')](_0x5963cc[_0xbaba('0x41')]['offset']);}_0x26a6c0['order']=qs[_0xbaba('0x47')](_0x5963cc['query'][_0xbaba('0x47')]);_0x26a6c0[_0xbaba('0x48')]=qs[_0xbaba('0x42')](_['pick'](_0x5963cc['query'],_0x3cc470[_0xbaba('0x42')]),_0x34702a);if(_0x5963cc[_0xbaba('0x41')][_0xbaba('0x49')]){_0x26a6c0['where']=_['merge'](_0x26a6c0[_0xbaba('0x48')],{'$or':_[_0xbaba('0x3b')](_0x34702a,function(_0x3c57a1){if(_0x3c57a1[_0xbaba('0x3d')]!==_0xbaba('0x4a')){var _0x35e977={};_0x35e977[_0x3c57a1[_0xbaba('0x40')]]={'$like':'%'+_0x5963cc[_0xbaba('0x41')]['filter']+'%'};return _0x35e977;}})});}_0x26a6c0=_[_0xbaba('0x4b')]({},_0x26a6c0,_0x5963cc[_0xbaba('0x4c')]);var _0x3e2104={'where':_0x26a6c0[_0xbaba('0x48')]};return db['WhatsappMessage'][_0xbaba('0x31')](_0x3e2104)[_0xbaba('0x20')](function(_0x590dc9){_0xa4cf[_0xbaba('0x31')]=_0x590dc9;if(_0x5963cc[_0xbaba('0x41')][_0xbaba('0x4d')]){_0x26a6c0['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xbaba('0x4e')](_0x26a6c0);})[_0xbaba('0x20')](function(_0x53ce83){_0xa4cf['rows']=_0x53ce83;return _0xa4cf;})[_0xbaba('0x20')](respondWithFilteredResult(_0x1c25c9,_0x26a6c0))[_0xbaba('0x4f')](handleError(_0x1c25c9,null));};exports[_0xbaba('0x50')]=function(_0xd71fbc,_0x331fdf){var _0x15ee85={'raw':!![],'where':{'id':_0xd71fbc['params']['id']}},_0x2bdbb2={};_0x2bdbb2[_0xbaba('0x3f')]=_[_0xbaba('0x51')](db['WhatsappMessage']['rawAttributes']);_0x2bdbb2[_0xbaba('0x41')]=_[_0xbaba('0x51')](_0xd71fbc['query']);_0x2bdbb2[_0xbaba('0x42')]=_[_0xbaba('0x43')](_0x2bdbb2['model'],_0x2bdbb2['query']);_0x15ee85[_0xbaba('0x44')]=_['intersection'](_0x2bdbb2[_0xbaba('0x3f')],qs['fields'](_0xd71fbc[_0xbaba('0x41')][_0xbaba('0x45')]));_0x15ee85[_0xbaba('0x44')]=_0x15ee85['attributes'][_0xbaba('0x52')]?_0x15ee85[_0xbaba('0x44')]:_0x2bdbb2[_0xbaba('0x3f')];if(_0xd71fbc[_0xbaba('0x41')][_0xbaba('0x4d')]){_0x15ee85['include']=[{'all':!![]}];}_0x15ee85=_['merge']({},_0x15ee85,_0xd71fbc[_0xbaba('0x4c')]);return db[_0xbaba('0x53')]['find'](_0x15ee85)[_0xbaba('0x20')](handleEntityNotFound(_0x331fdf,null))['then'](respondWithResult(_0x331fdf,null))[_0xbaba('0x4f')](handleError(_0x331fdf,null));};exports[_0xbaba('0x54')]=function(_0x37dcc6,_0x4b0d2b){return db['WhatsappMessage'][_0xbaba('0x54')](_0x37dcc6[_0xbaba('0x55')],{})[_0xbaba('0x20')](respondWithResult(_0x4b0d2b,0xc9))[_0xbaba('0x4f')](handleError(_0x4b0d2b,null));};exports['update']=function(_0x2b4990,_0x188a00){if(_0x2b4990[_0xbaba('0x55')]['id']){delete _0x2b4990[_0xbaba('0x55')]['id'];}return db[_0xbaba('0x53')][_0xbaba('0x56')]({'where':{'id':_0x2b4990['params']['id']}})['then'](handleEntityNotFound(_0x188a00,null))[_0xbaba('0x20')](saveUpdates(_0x2b4990[_0xbaba('0x55')],null))[_0xbaba('0x20')](respondWithResult(_0x188a00,null))[_0xbaba('0x4f')](handleError(_0x188a00,null));};exports['destroy']=function(_0x4d6c70,_0x5085e6){return db['WhatsappMessage'][_0xbaba('0x56')]({'where':{'id':_0x4d6c70[_0xbaba('0x57')]['id']}})[_0xbaba('0x20')](handleEntityNotFound(_0x5085e6,null))[_0xbaba('0x20')](removeEntity(_0x5085e6,null))[_0xbaba('0x4f')](handleError(_0x5085e6,null));};exports[_0xbaba('0x58')]=function(_0x2c2877,_0x58bc82){return db['WhatsappMessage']['describe']()[_0xbaba('0x20')](respondWithResult(_0x58bc82,null))['catch'](handleError(_0x58bc82,null));};var interaction_log=require(_0xbaba('0x14'))('whatsapp-interactions');exports[_0xbaba('0x59')]=function(_0x526863,_0x269b19,_0x202a98){var _0x5d0b59={'agent':{},'channel':_0xbaba('0x5a')};if(_0x526863[_0xbaba('0x55')]['id']){delete _0x526863[_0xbaba('0x55')]['id'];}_0x526863[_0xbaba('0x55')]['read']=!![];_0x526863['body'][_0xbaba('0x5b')]=moment()[_0xbaba('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x526863['body']['UserId']=_0x526863[_0xbaba('0x55')][_0xbaba('0x5d')]||_0x526863[_0xbaba('0x5e')]['id'];_0x5d0b59['agent']['id']=_0x526863[_0xbaba('0x55')]['UserId'];return db[_0xbaba('0x53')][_0xbaba('0x56')]({'where':{'id':_0x526863[_0xbaba('0x57')]['id'],'UserId':null}})[_0xbaba('0x20')](handleEntityNotFound(_0x269b19,null))['then'](saveUpdates(_0x526863[_0xbaba('0x55')],null))['then'](function(_0x32f80b){if(_0x32f80b){_0x5d0b59[_0xbaba('0x29')]=_0x32f80b[_0xbaba('0x5f')]({'plain':!![]});return db[_0xbaba('0x60')][_0xbaba('0x56')]({'where':{'id':_0x32f80b[_0xbaba('0x61')]}});}return null;})[_0xbaba('0x20')](handleEntityNotFound(_0x269b19,null))[_0xbaba('0x20')](function(_0x2ad016){if(_0x2ad016){return _0x2ad016[_0xbaba('0x37')]({'UserId':_0x526863[_0xbaba('0x55')][_0xbaba('0x5d')],'read1stAt':_[_0xbaba('0x62')](_0x2ad016[_0xbaba('0x63')])?moment()[_0xbaba('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xbaba('0x20')](function(_0xb3ecd2){if(_0xb3ecd2){_0x5d0b59[_0xbaba('0x64')]=_0xb3ecd2['get']({'plain':!![]});interaction_log[_0xbaba('0x21')](_0xbaba('0x65'),_0x526863[_0xbaba('0x5e')]['id'],_0x526863[_0xbaba('0x5e')][_0xbaba('0x40')],_0x526863[_0xbaba('0x5e')][_0xbaba('0x66')],_0x5d0b59[_0xbaba('0x64')]['id'],_0x526863[_0xbaba('0x55')]?JSON['stringify'](_0x526863[_0xbaba('0x55')]):_0xbaba('0x67'));return respondWithRpcPromise(_0xbaba('0x68'),_0xbaba('0x69'),_0x5d0b59);}return null;})[_0xbaba('0x20')](function(_0x21c030){var _0x3ce918=_0xbaba('0x6a')+_0x21c030['message'][_0xbaba('0x6b')];return db[_0xbaba('0x6c')][_0xbaba('0x41')](_0x3ce918,{'type':db['Sequelize'][_0xbaba('0x6d')]['SELECT'],'raw':!![]})[_0xbaba('0x20')](function(_0x4e940b){return _0x4e940b;});})[_0xbaba('0x20')](function(_0x42bfb0){if(_0x42bfb0){_0x5d0b59['message'][_0xbaba('0x6e')]=_0x42bfb0[0x0];if(!_0x526863[_0xbaba('0x55')][_0xbaba('0x5d')])return;return db['User'][_0xbaba('0x56')]({'where':{'id':_0x526863['body'][_0xbaba('0x5d')],'role':_0xbaba('0x6f')},'attributes':['id','name',_0xbaba('0x70'),_0xbaba('0x71'),_0xbaba('0x72')],'raw':!![]});}return null;})[_0xbaba('0x20')](function(_0x3aa207){if(!_0x3aa207)return null;_0x5d0b59[_0xbaba('0x29')]['agent']=_0x3aa207;return _0x5d0b59;})[_0xbaba('0x20')](function(_0x5354d8){if(_0x5354d8){if(_0x526863['body']['manual']){_0x5d0b59['message']['interface']=util[_0xbaba('0x5c')]('SIP/%s',_0x526863[_0xbaba('0x5e')][_0xbaba('0x40')]);_0x5d0b59['message']['channel']=_0x5d0b59[_0xbaba('0x73')];_0x5d0b59[_0xbaba('0x29')]['motionChannel']=_0x5d0b59[_0xbaba('0x73')];_0x5d0b59[_0xbaba('0x29')][_0xbaba('0x74')]=_0xbaba('0x59');return respondWithRpcPromise(_0xbaba('0x75'),_0xbaba('0x75'),{'event':_0xbaba('0x76'),'message':_0x5d0b59[_0xbaba('0x29')]},client9002)[_0xbaba('0x20')](function(){return _0x5d0b59;});}return _0x5d0b59;}return null;})[_0xbaba('0x20')](respondWithResult(_0x269b19,null))[_0xbaba('0x4f')](handleError(_0x269b19,null));};var interaction_log=require(_0xbaba('0x14'))(_0xbaba('0x77'));exports[_0xbaba('0x78')]=function(_0x462ed3,_0x3c4471,_0x25867c){var _0x62f397={'agent':{},'channel':_0xbaba('0x5a')};if(_0x462ed3[_0xbaba('0x55')]['id']){delete _0x462ed3[_0xbaba('0x55')]['id'];}_0x462ed3[_0xbaba('0x55')][_0xbaba('0x5d')]=_0x462ed3[_0xbaba('0x55')][_0xbaba('0x5d')]||_0x462ed3['user']['id'];_0x62f397['agent']['id']=_0x462ed3[_0xbaba('0x55')][_0xbaba('0x5d')];return db[_0xbaba('0x53')]['find']({'where':{'id':_0x462ed3[_0xbaba('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c4471,null))[_0xbaba('0x20')](function(_0x14a21b){if(_0x14a21b){_0x62f397[_0xbaba('0x29')]=_0x14a21b['get']({'plain':!![]});return db['WhatsappInteraction'][_0xbaba('0x56')]({'where':{'id':_0x14a21b['WhatsappInteractionId']}});}return null;})[_0xbaba('0x20')](handleEntityNotFound(_0x3c4471,null))[_0xbaba('0x20')](function(_0x129c75){if(_0x129c75){_0x62f397[_0xbaba('0x64')]=_0x129c75[_0xbaba('0x5f')]({'plain':!![]});interaction_log['info'](_0xbaba('0x79'),_0x462ed3['user']['id'],_0x462ed3[_0xbaba('0x5e')][_0xbaba('0x40')],_0x462ed3[_0xbaba('0x5e')][_0xbaba('0x66')],_0x62f397[_0xbaba('0x64')]['id'],_0x462ed3[_0xbaba('0x55')]?JSON[_0xbaba('0x26')](_0x462ed3['body']):'null');return respondWithRpcPromise(_0xbaba('0x7a'),_0xbaba('0x7b'),_0x62f397);}return null;})['then'](function(_0x48c3aa){var _0xe38938=_0xbaba('0x6a')+_0x48c3aa[_0xbaba('0x29')][_0xbaba('0x6b')];return db['sequelize'][_0xbaba('0x41')](_0xe38938,{'type':db[_0xbaba('0x7c')][_0xbaba('0x6d')][_0xbaba('0x7d')],'raw':!![]})[_0xbaba('0x20')](function(_0x2cb0b){return _0x2cb0b;});})[_0xbaba('0x20')](function(_0x190119){if(_0x190119){_0x62f397[_0xbaba('0x29')][_0xbaba('0x6e')]=_0x190119[0x0];if(!_0x462ed3[_0xbaba('0x55')]['UserId'])return;return db[_0xbaba('0x7e')][_0xbaba('0x56')]({'where':{'id':_0x462ed3[_0xbaba('0x55')][_0xbaba('0x5d')],'role':'agent'},'attributes':['id',_0xbaba('0x40'),'fullname',_0xbaba('0x71'),_0xbaba('0x72')],'raw':!![]});}return null;})['then'](function(_0x57cd82){if(!_0x57cd82)return null;_0x62f397['message'][_0xbaba('0x6f')]=_0x57cd82;return _0x62f397;})[_0xbaba('0x20')](function(_0x38725d){if(_0x38725d){_0x38725d[_0xbaba('0x29')][_0xbaba('0x7f')]=util['format'](_0xbaba('0x80'),_0x462ed3[_0xbaba('0x5e')][_0xbaba('0x40')]);_0x38725d[_0xbaba('0x29')][_0xbaba('0x73')]=_0x62f397[_0xbaba('0x73')];_0x38725d[_0xbaba('0x29')]['motionChannel']=_0x62f397[_0xbaba('0x73')];_0x38725d[_0xbaba('0x29')][_0xbaba('0x74')]=_0xbaba('0x78');respondWithRpcPromise(_0xbaba('0x75'),_0xbaba('0x75'),{'event':_0xbaba('0x81'),'message':_0x38725d['message']},client9002);return _0x62f397;}return null;})[_0xbaba('0x20')](respondWithResult(_0x3c4471,null))[_0xbaba('0x4f')](handleError(_0x3c4471,null));};exports[_0xbaba('0x2c')]=function(_0x1ab669,_0x19720e,_0x2905ea){if(_0x1ab669[_0xbaba('0x55')]['id']){delete _0x1ab669[_0xbaba('0x55')]['id'];}var _0x39404d;return db['WhatsappMessage'][_0xbaba('0x56')]({'where':{'id':_0x1ab669[_0xbaba('0x57')]['id']}})[_0xbaba('0x20')](handleEntityNotFound(_0x19720e,null))[_0xbaba('0x20')](function(_0x4ef5a0){if(_0x4ef5a0){_0x39404d=_0x4ef5a0;return db[_0xbaba('0x82')]['find']({'where':{'id':_0x4ef5a0[_0xbaba('0x83')]}});}})[_0xbaba('0x20')](handleEntityNotFound(_0x19720e,null))['then'](function(_0x171e63){if(_0x171e63){logger[_0xbaba('0x23')]('WhatsppMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x171e63['type'],util['inspect'](_0x1ab669[_0xbaba('0x55')],{'showHidden':![],'depth':null}));switch(_0x171e63[_0xbaba('0x3d')]){case'twilio':if(_0x1ab669['body'][_0xbaba('0x84')]&&_0x1ab669[_0xbaba('0x55')][_0xbaba('0x84')]===_0x39404d[_0xbaba('0x85')]&&_0x1ab669[_0xbaba('0x55')][_0xbaba('0x86')]&&_0x1ab669[_0xbaba('0x55')]['MessageStatus']===_0xbaba('0x87')){return _0x39404d[_0xbaba('0x37')]({'read':!![]});}else{logger[_0xbaba('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xbaba('0x2c'),_0xbaba('0x88'),util[_0xbaba('0x89')](_0x1ab669['body'],{'showHidden':![],'depth':null}));}break;}return _0x39404d;}})[_0xbaba('0x20')](respondWithResult(_0x19720e,null))['catch'](handleError(_0x19720e,null));};
\ No newline at end of file
+var _0x6fc6=['request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','filter','options','WhatsappMessage','includeAll','include','findAll','show','params','keys','find','body','catch','describe','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','interaction','ContactId','internal','event','rejectmessage','WhatsappAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','./whatsappMessage.socket','register','jayson/promise','http','client'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x6fc6,0xee));var _0x66fc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6fc6[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x66fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x66fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66fc('0x2'));var moment=require(_0x66fc('0x3'));var BPromise=require(_0x66fc('0x4'));var Mustache=require(_0x66fc('0x5'));var util=require(_0x66fc('0x6'));var path=require(_0x66fc('0x7'));var sox=require('sox');var csv=require(_0x66fc('0x8'));var ejs=require(_0x66fc('0x9'));var fs=require('fs');var fs_extra=require(_0x66fc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x66fc('0xb'));var jsforce=require(_0x66fc('0xc'));var deskjs=require(_0x66fc('0xd'));var toCsv=require(_0x66fc('0x8'));var querystring=require(_0x66fc('0xe'));var Papa=require(_0x66fc('0xf'));var Redis=require('ioredis');var authService=require(_0x66fc('0x10'));var qs=require(_0x66fc('0x11'));var as=require(_0x66fc('0x12'));var hardwareService=require(_0x66fc('0x13'));var logger=require(_0x66fc('0x14'))(_0x66fc('0x15'));var utils=require(_0x66fc('0x16'));var config=require(_0x66fc('0x17'));var licenseUtil=require(_0x66fc('0x18'));var db=require(_0x66fc('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x66fc('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x66fc('0x1b'))[_0x66fc('0x1c')](socket);var jayson=require(_0x66fc('0x1d'));var client=jayson['client'][_0x66fc('0x1e')]({'port':0x232c});var client9002=jayson[_0x66fc('0x1f')][_0x66fc('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1dafb9,_0xde08d7,_0x5ae9e8,_0x45ad61){return new BPromise(function(_0x380950,_0xc2b70d){var _0x84b39b=_0x45ad61||client;return _0x84b39b[_0x66fc('0x20')](_0x1dafb9,_0x5ae9e8)[_0x66fc('0x21')](function(_0x421832){logger[_0x66fc('0x22')](_0x66fc('0x23'),_0xde08d7,_0x66fc('0x24'));logger[_0x66fc('0x25')](_0x66fc('0x26'),_0xde08d7,_0x66fc('0x24'),JSON[_0x66fc('0x27')](_0x421832));if(_0x421832[_0x66fc('0x28')]){if(_0x421832[_0x66fc('0x28')]['code']===0x1f4){logger['error'](_0x66fc('0x23'),_0xde08d7,_0x421832['error'][_0x66fc('0x29')]);return _0xc2b70d(_0x421832['error'][_0x66fc('0x29')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0xde08d7,_0x421832[_0x66fc('0x28')][_0x66fc('0x29')]);return _0x380950(_0x421832[_0x66fc('0x28')][_0x66fc('0x29')]);}else{logger[_0x66fc('0x22')](_0x66fc('0x23'),_0xde08d7,_0x66fc('0x24'));_0x380950(_0x421832[_0x66fc('0x2a')][_0x66fc('0x29')]);}})['catch'](function(_0xb15eb6){logger[_0x66fc('0x28')](_0x66fc('0x23'),_0xde08d7,_0xb15eb6);_0xc2b70d(_0xb15eb6);});});}function respondWithStatusCode(_0x405b50,_0x62f571){_0x62f571=_0x62f571||0xcc;return function(_0x4421ec){if(_0x4421ec){return _0x405b50[_0x66fc('0x2b')](_0x62f571);}return _0x405b50['status'](_0x62f571)[_0x66fc('0x2c')]();};}function respondWithResult(_0x277398,_0x4c0a9e){_0x4c0a9e=_0x4c0a9e||0xc8;return function(_0x413618){if(_0x413618){return _0x277398[_0x66fc('0x2d')](_0x4c0a9e)[_0x66fc('0x2e')](_0x413618);}};}function respondWithFilteredResult(_0x25d639,_0x1aa0ea){return function(_0x36d60a){if(_0x36d60a){var _0x5e26e3=typeof _0x1aa0ea[_0x66fc('0x2f')]==='undefined'&&typeof _0x1aa0ea[_0x66fc('0x30')]==='undefined';var _0x118363=_0x36d60a['count'];var _0x57747c=_0x5e26e3?0x0:_0x1aa0ea[_0x66fc('0x2f')];var _0x23bc87=_0x5e26e3?_0x36d60a[_0x66fc('0x31')]:_0x1aa0ea[_0x66fc('0x2f')]+_0x1aa0ea[_0x66fc('0x30')];var _0x341559;if(_0x23bc87>=_0x118363){_0x23bc87=_0x118363;_0x341559=0xc8;}else{_0x341559=0xce;}_0x25d639[_0x66fc('0x2d')](_0x341559);return _0x25d639[_0x66fc('0x32')](_0x66fc('0x33'),_0x57747c+'-'+_0x23bc87+'/'+_0x118363)['json'](_0x36d60a);}return null;};}function patchUpdates(_0x541787){return function(_0x5d19a4){try{jsonpatch[_0x66fc('0x34')](_0x5d19a4,_0x541787,!![]);}catch(_0x147916){return BPromise[_0x66fc('0x35')](_0x147916);}return _0x5d19a4['save']();};}function saveUpdates(_0x92a013,_0x517f58){return function(_0x5d97cc){if(_0x5d97cc){return _0x5d97cc[_0x66fc('0x36')](_0x92a013)[_0x66fc('0x21')](function(_0x29abf8){return _0x29abf8;});}return null;};}function removeEntity(_0x3f0b13,_0x156018){return function(_0x755ec5){if(_0x755ec5){return _0x755ec5[_0x66fc('0x37')]()['then'](function(){_0x3f0b13[_0x66fc('0x2d')](0xcc)[_0x66fc('0x2c')]();});}};}function handleEntityNotFound(_0xe06601,_0x585942){return function(_0x2549e5){if(!_0x2549e5){_0xe06601[_0x66fc('0x2b')](0x194);}return _0x2549e5;};}function handleError(_0x3eaef8,_0x44a8ac){_0x44a8ac=_0x44a8ac||0x1f4;return function(_0x4482fe){logger[_0x66fc('0x28')](_0x4482fe[_0x66fc('0x38')]);if(_0x4482fe[_0x66fc('0x39')]){delete _0x4482fe['name'];}_0x3eaef8[_0x66fc('0x2d')](_0x44a8ac)[_0x66fc('0x3a')](_0x4482fe);};}exports[_0x66fc('0x3b')]=function(_0xbd6eac,_0x3990ee){var _0x50e1bb={},_0x545922={},_0x523e4f={'count':0x0,'rows':[]};var _0xb457a1=_['map'](db['WhatsappMessage'][_0x66fc('0x3c')],function(_0x589255){return{'name':_0x589255[_0x66fc('0x3d')],'type':_0x589255[_0x66fc('0x3e')]['key']};});_0x545922[_0x66fc('0x3f')]=_['map'](_0xb457a1,_0x66fc('0x39'));_0x545922[_0x66fc('0x40')]=_['keys'](_0xbd6eac['query']);_0x545922[_0x66fc('0x41')]=_[_0x66fc('0x42')](_0x545922['model'],_0x545922[_0x66fc('0x40')]);_0x50e1bb[_0x66fc('0x43')]=_[_0x66fc('0x42')](_0x545922[_0x66fc('0x3f')],qs[_0x66fc('0x44')](_0xbd6eac['query'][_0x66fc('0x44')]));_0x50e1bb[_0x66fc('0x43')]=_0x50e1bb['attributes'][_0x66fc('0x45')]?_0x50e1bb[_0x66fc('0x43')]:_0x545922['model'];if(!_0xbd6eac['query'][_0x66fc('0x46')](_0x66fc('0x47'))){_0x50e1bb[_0x66fc('0x30')]=qs['limit'](_0xbd6eac[_0x66fc('0x40')][_0x66fc('0x30')]);_0x50e1bb[_0x66fc('0x2f')]=qs[_0x66fc('0x2f')](_0xbd6eac[_0x66fc('0x40')]['offset']);}_0x50e1bb[_0x66fc('0x48')]=qs[_0x66fc('0x49')](_0xbd6eac[_0x66fc('0x40')][_0x66fc('0x49')]);_0x50e1bb['where']=qs[_0x66fc('0x41')](_['pick'](_0xbd6eac[_0x66fc('0x40')],_0x545922[_0x66fc('0x41')]),_0xb457a1);if(_0xbd6eac[_0x66fc('0x40')]['filter']){_0x50e1bb[_0x66fc('0x4a')]=_[_0x66fc('0x4b')](_0x50e1bb[_0x66fc('0x4a')],{'$or':_[_0x66fc('0x4c')](_0xb457a1,function(_0x3a0af0){if(_0x3a0af0[_0x66fc('0x3e')]!==_0x66fc('0x4d')){var _0x389044={};_0x389044[_0x3a0af0[_0x66fc('0x39')]]={'$like':'%'+_0xbd6eac[_0x66fc('0x40')][_0x66fc('0x4e')]+'%'};return _0x389044;}})});}_0x50e1bb=_[_0x66fc('0x4b')]({},_0x50e1bb,_0xbd6eac[_0x66fc('0x4f')]);var _0x11b4de={'where':_0x50e1bb[_0x66fc('0x4a')]};return db[_0x66fc('0x50')][_0x66fc('0x31')](_0x11b4de)[_0x66fc('0x21')](function(_0x17ca14){_0x523e4f['count']=_0x17ca14;if(_0xbd6eac[_0x66fc('0x40')][_0x66fc('0x51')]){_0x50e1bb[_0x66fc('0x52')]=[{'all':!![]}];}return db[_0x66fc('0x50')][_0x66fc('0x53')](_0x50e1bb);})['then'](function(_0x11c724){_0x523e4f['rows']=_0x11c724;return _0x523e4f;})['then'](respondWithFilteredResult(_0x3990ee,_0x50e1bb))['catch'](handleError(_0x3990ee,null));};exports[_0x66fc('0x54')]=function(_0x2a9d7a,_0x58ab7b){var _0xdea77b={'raw':!![],'where':{'id':_0x2a9d7a[_0x66fc('0x55')]['id']}},_0x4ad1df={};_0x4ad1df[_0x66fc('0x3f')]=_[_0x66fc('0x56')](db[_0x66fc('0x50')][_0x66fc('0x3c')]);_0x4ad1df[_0x66fc('0x40')]=_[_0x66fc('0x56')](_0x2a9d7a[_0x66fc('0x40')]);_0x4ad1df['filters']=_[_0x66fc('0x42')](_0x4ad1df['model'],_0x4ad1df[_0x66fc('0x40')]);_0xdea77b['attributes']=_[_0x66fc('0x42')](_0x4ad1df['model'],qs[_0x66fc('0x44')](_0x2a9d7a[_0x66fc('0x40')][_0x66fc('0x44')]));_0xdea77b[_0x66fc('0x43')]=_0xdea77b[_0x66fc('0x43')][_0x66fc('0x45')]?_0xdea77b['attributes']:_0x4ad1df[_0x66fc('0x3f')];if(_0x2a9d7a[_0x66fc('0x40')][_0x66fc('0x51')]){_0xdea77b['include']=[{'all':!![]}];}_0xdea77b=_[_0x66fc('0x4b')]({},_0xdea77b,_0x2a9d7a['options']);return db[_0x66fc('0x50')][_0x66fc('0x57')](_0xdea77b)['then'](handleEntityNotFound(_0x58ab7b,null))[_0x66fc('0x21')](respondWithResult(_0x58ab7b,null))['catch'](handleError(_0x58ab7b,null));};exports['create']=function(_0x132ddc,_0x113dde){return db[_0x66fc('0x50')]['create'](_0x132ddc[_0x66fc('0x58')],{})['then'](respondWithResult(_0x113dde,0xc9))[_0x66fc('0x59')](handleError(_0x113dde,null));};exports[_0x66fc('0x36')]=function(_0x449f2a,_0x475e29){if(_0x449f2a[_0x66fc('0x58')]['id']){delete _0x449f2a[_0x66fc('0x58')]['id'];}return db[_0x66fc('0x50')][_0x66fc('0x57')]({'where':{'id':_0x449f2a[_0x66fc('0x55')]['id']}})[_0x66fc('0x21')](handleEntityNotFound(_0x475e29,null))[_0x66fc('0x21')](saveUpdates(_0x449f2a[_0x66fc('0x58')],null))[_0x66fc('0x21')](respondWithResult(_0x475e29,null))['catch'](handleError(_0x475e29,null));};exports[_0x66fc('0x37')]=function(_0x2f0d4,_0x3250a3){return db[_0x66fc('0x50')]['find']({'where':{'id':_0x2f0d4[_0x66fc('0x55')]['id']}})[_0x66fc('0x21')](handleEntityNotFound(_0x3250a3,null))['then'](removeEntity(_0x3250a3,null))[_0x66fc('0x59')](handleError(_0x3250a3,null));};exports[_0x66fc('0x5a')]=function(_0x209d28,_0x171e34){return db[_0x66fc('0x50')][_0x66fc('0x5a')]()[_0x66fc('0x21')](respondWithResult(_0x171e34,null))['catch'](handleError(_0x171e34,null));};var interaction_log=require(_0x66fc('0x14'))('whatsapp-interactions');exports['accept']=function(_0x477a3f,_0x585209,_0x121ec9){var _0x54c3bf={'agent':{},'channel':_0x66fc('0x5b')};if(_0x477a3f[_0x66fc('0x58')]['id']){delete _0x477a3f[_0x66fc('0x58')]['id'];}_0x477a3f['body'][_0x66fc('0x5c')]=!![];_0x477a3f[_0x66fc('0x58')][_0x66fc('0x5d')]=moment()['format'](_0x66fc('0x5e'));_0x477a3f[_0x66fc('0x58')]['UserId']=_0x477a3f[_0x66fc('0x58')][_0x66fc('0x5f')]||_0x477a3f['user']['id'];_0x54c3bf[_0x66fc('0x60')]['id']=_0x477a3f['body'][_0x66fc('0x5f')];return db[_0x66fc('0x50')]['find']({'where':{'id':_0x477a3f['params']['id'],'UserId':null}})[_0x66fc('0x21')](handleEntityNotFound(_0x585209,null))['then'](saveUpdates(_0x477a3f['body'],null))['then'](function(_0x4f75c5){if(_0x4f75c5){_0x54c3bf[_0x66fc('0x29')]=_0x4f75c5[_0x66fc('0x61')]({'plain':!![]});return db[_0x66fc('0x62')]['find']({'where':{'id':_0x4f75c5[_0x66fc('0x63')]}});}return null;})[_0x66fc('0x21')](handleEntityNotFound(_0x585209,null))[_0x66fc('0x21')](function(_0x35a025){if(_0x35a025){return _0x35a025[_0x66fc('0x36')]({'UserId':_0x477a3f[_0x66fc('0x58')][_0x66fc('0x5f')],'read1stAt':_[_0x66fc('0x64')](_0x35a025[_0x66fc('0x65')])?moment()[_0x66fc('0x66')](_0x66fc('0x5e')):undefined});}return null;})[_0x66fc('0x21')](function(_0x42fcb4){if(_0x42fcb4){_0x54c3bf['interaction']=_0x42fcb4[_0x66fc('0x61')]({'plain':!![]});interaction_log[_0x66fc('0x22')](_0x66fc('0x67'),_0x477a3f[_0x66fc('0x68')]['id'],_0x477a3f['user'][_0x66fc('0x39')],_0x477a3f[_0x66fc('0x68')][_0x66fc('0x69')],_0x54c3bf['interaction']['id'],_0x477a3f[_0x66fc('0x58')]?JSON['stringify'](_0x477a3f['body']):_0x66fc('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x54c3bf);}return null;})[_0x66fc('0x21')](function(_0x5add54){var _0x4fd8c2=_0x66fc('0x6b')+_0x5add54['message']['ContactId'];return db[_0x66fc('0x6c')][_0x66fc('0x40')](_0x4fd8c2,{'type':db[_0x66fc('0x6d')][_0x66fc('0x6e')][_0x66fc('0x6f')],'raw':!![]})[_0x66fc('0x21')](function(_0x4f749b){return _0x4f749b;});})[_0x66fc('0x21')](function(_0x47d300){if(_0x47d300){_0x54c3bf[_0x66fc('0x29')][_0x66fc('0x70')]=_0x47d300[0x0];if(!_0x477a3f['body']['UserId'])return;return db[_0x66fc('0x71')]['find']({'where':{'id':_0x477a3f[_0x66fc('0x58')][_0x66fc('0x5f')],'role':_0x66fc('0x60')},'attributes':['id',_0x66fc('0x39'),_0x66fc('0x72'),_0x66fc('0x73'),'internal'],'raw':!![]});}return null;})['then'](function(_0x5205b6){if(!_0x5205b6)return null;_0x54c3bf[_0x66fc('0x29')][_0x66fc('0x60')]=_0x5205b6;return _0x54c3bf;})[_0x66fc('0x21')](function(_0x4b0a8c){if(_0x4b0a8c){if(_0x477a3f['body'][_0x66fc('0x74')]){_0x54c3bf['message'][_0x66fc('0x75')]=util[_0x66fc('0x66')](_0x66fc('0x76'),_0x477a3f['user']['name']);_0x54c3bf[_0x66fc('0x29')][_0x66fc('0x77')]=_0x54c3bf[_0x66fc('0x77')];_0x54c3bf['message'][_0x66fc('0x78')]=_0x54c3bf[_0x66fc('0x77')];_0x54c3bf[_0x66fc('0x29')]['event']='accept';return respondWithRpcPromise('EventManager',_0x66fc('0x79'),{'event':_0x66fc('0x7a'),'message':_0x54c3bf[_0x66fc('0x29')]},client9002)[_0x66fc('0x21')](function(){return _0x54c3bf;});}return _0x54c3bf;}return null;})['then'](respondWithResult(_0x585209,null))[_0x66fc('0x59')](handleError(_0x585209,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x66fc('0x35')]=function(_0x53a9b9,_0x34e5dd,_0x47c190){var _0x1a7983={'agent':{},'channel':'whatsapp'};if(_0x53a9b9[_0x66fc('0x58')]['id']){delete _0x53a9b9[_0x66fc('0x58')]['id'];}_0x53a9b9[_0x66fc('0x58')][_0x66fc('0x5f')]=_0x53a9b9[_0x66fc('0x58')]['UserId']||_0x53a9b9[_0x66fc('0x68')]['id'];_0x1a7983[_0x66fc('0x60')]['id']=_0x53a9b9[_0x66fc('0x58')][_0x66fc('0x5f')];return db['WhatsappMessage'][_0x66fc('0x57')]({'where':{'id':_0x53a9b9[_0x66fc('0x55')]['id'],'UserId':null}})[_0x66fc('0x21')](handleEntityNotFound(_0x34e5dd,null))['then'](function(_0x55fe3b){if(_0x55fe3b){_0x1a7983[_0x66fc('0x29')]=_0x55fe3b['get']({'plain':!![]});return db[_0x66fc('0x62')]['find']({'where':{'id':_0x55fe3b['WhatsappInteractionId']}});}return null;})[_0x66fc('0x21')](handleEntityNotFound(_0x34e5dd,null))[_0x66fc('0x21')](function(_0x397d0b){if(_0x397d0b){_0x1a7983[_0x66fc('0x7b')]=_0x397d0b[_0x66fc('0x61')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x53a9b9[_0x66fc('0x68')]['id'],_0x53a9b9[_0x66fc('0x68')]['name'],_0x53a9b9[_0x66fc('0x68')][_0x66fc('0x69')],_0x1a7983[_0x66fc('0x7b')]['id'],_0x53a9b9['body']?JSON[_0x66fc('0x27')](_0x53a9b9[_0x66fc('0x58')]):_0x66fc('0x6a'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1a7983);}return null;})['then'](function(_0x3916f6){var _0x237340=_0x66fc('0x6b')+_0x3916f6[_0x66fc('0x29')][_0x66fc('0x7c')];return db[_0x66fc('0x6c')][_0x66fc('0x40')](_0x237340,{'type':db['Sequelize'][_0x66fc('0x6e')][_0x66fc('0x6f')],'raw':!![]})[_0x66fc('0x21')](function(_0x46a93d){return _0x46a93d;});})[_0x66fc('0x21')](function(_0x2da3c9){if(_0x2da3c9){_0x1a7983[_0x66fc('0x29')][_0x66fc('0x70')]=_0x2da3c9[0x0];if(!_0x53a9b9['body'][_0x66fc('0x5f')])return;return db[_0x66fc('0x71')][_0x66fc('0x57')]({'where':{'id':_0x53a9b9[_0x66fc('0x58')]['UserId'],'role':'agent'},'attributes':['id',_0x66fc('0x39'),'fullname',_0x66fc('0x73'),_0x66fc('0x7d')],'raw':!![]});}return null;})['then'](function(_0x4073c7){if(!_0x4073c7)return null;_0x1a7983[_0x66fc('0x29')][_0x66fc('0x60')]=_0x4073c7;return _0x1a7983;})[_0x66fc('0x21')](function(_0x530ced){if(_0x530ced){_0x530ced[_0x66fc('0x29')][_0x66fc('0x75')]=util['format'](_0x66fc('0x76'),_0x53a9b9[_0x66fc('0x68')]['name']);_0x530ced[_0x66fc('0x29')][_0x66fc('0x77')]=_0x1a7983[_0x66fc('0x77')];_0x530ced[_0x66fc('0x29')][_0x66fc('0x78')]=_0x1a7983[_0x66fc('0x77')];_0x530ced[_0x66fc('0x29')][_0x66fc('0x7e')]='reject';respondWithRpcPromise(_0x66fc('0x79'),'EventManager',{'event':_0x66fc('0x7f'),'message':_0x530ced[_0x66fc('0x29')]},client9002);return _0x1a7983;}return null;})[_0x66fc('0x21')](respondWithResult(_0x34e5dd,null))[_0x66fc('0x59')](handleError(_0x34e5dd,null));};exports[_0x66fc('0x2d')]=function(_0x8cd35f,_0x5880f9,_0x1b1243){if(_0x8cd35f[_0x66fc('0x58')]['id']){delete _0x8cd35f['body']['id'];}var _0x484764;return db[_0x66fc('0x50')][_0x66fc('0x57')]({'where':{'id':_0x8cd35f[_0x66fc('0x55')]['id']}})[_0x66fc('0x21')](handleEntityNotFound(_0x5880f9,null))[_0x66fc('0x21')](function(_0x48f5aa){if(_0x48f5aa){_0x484764=_0x48f5aa;return db[_0x66fc('0x80')][_0x66fc('0x57')]({'where':{'id':_0x48f5aa['WhatsappAccountId']}});}})[_0x66fc('0x21')](handleEntityNotFound(_0x5880f9,null))[_0x66fc('0x21')](function(_0x3a7d88){if(_0x3a7d88){logger[_0x66fc('0x25')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x66fc('0x2d'),_0x66fc('0x81'),_0x3a7d88['type'],util[_0x66fc('0x82')](_0x8cd35f['body'],{'showHidden':![],'depth':null}));switch(_0x3a7d88['type']){case _0x66fc('0x83'):if(_0x8cd35f[_0x66fc('0x58')][_0x66fc('0x84')]&&_0x8cd35f[_0x66fc('0x58')]['MessageSid']===_0x484764[_0x66fc('0x85')]&&_0x8cd35f[_0x66fc('0x58')][_0x66fc('0x86')]&&_0x8cd35f[_0x66fc('0x58')]['MessageStatus']===_0x66fc('0x5c')){return _0x484764[_0x66fc('0x36')]({'read':!![]});}else{logger[_0x66fc('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x66fc('0x2d'),_0x66fc('0x83'),util[_0x66fc('0x82')](_0x8cd35f[_0x66fc('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x484764;}})[_0x66fc('0x21')](respondWithResult(_0x5880f9,null))['catch'](handleError(_0x5880f9,null));};
\ No newline at end of file
index 9114dc7..76d557c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['../../mysqldb','WhatsappMessage','remove','emit','hasOwnProperty','hook'];(function(_0x2cc193,_0x59b7b8){var _0x499b86=function(_0x3c603e){while(--_0x3c603e){_0x2cc193['push'](_0x2cc193['shift']());}};_0x499b86(++_0x59b7b8);}(_0x757a,0xde));var _0xa757=function(_0x174090,_0x2d9085){_0x174090=_0x174090-0x0;var _0x5087af=_0x757a[_0x174090];return _0x5087af;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xa757('0x0'))['db'][_0xa757('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa757('0x2')};function emitEvent(_0x1721c6){return function(_0x1c2932,_0x453d07,_0x32630d){WhatsappMessageEvents[_0xa757('0x3')](_0x1721c6+':'+_0x1c2932['id'],_0x1c2932);WhatsappMessageEvents['emit'](_0x1721c6,_0x1c2932);_0x32630d(null);};}for(var e in events){if(events[_0xa757('0x4')](e)){var event=events[e];WhatsappMessage[_0xa757('0x5')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0x9f4d=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x4cefc3,_0x23f291){_0x4cefc3=_0x4cefc3-0x0;var _0x1cc779=_0x9f4d[_0x4cefc3];return _0x1cc779;};'use strict';var EventEmitter=require(_0xd9f4('0x0'));var WhatsappMessage=require(_0xd9f4('0x1'))['db'][_0xd9f4('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd9f4('0x3')](0x0);var events={'afterCreate':_0xd9f4('0x4'),'afterUpdate':_0xd9f4('0x5'),'afterDestroy':_0xd9f4('0x6')};function emitEvent(_0x273eb9){return function(_0x7dccea,_0x5e0ab0,_0x2c39cb){WhatsappMessageEvents['emit'](_0x273eb9+':'+_0x7dccea['id'],_0x7dccea);WhatsappMessageEvents[_0xd9f4('0x7')](_0x273eb9,_0x7dccea);_0x2c39cb(null);};}for(var e in events){if(events[_0xd9f4('0x8')](e)){var event=events[e];WhatsappMessage[_0xd9f4('0x9')](e,emitEvent(event));}}module[_0xd9f4('0xa')]=WhatsappMessageEvents;
\ No newline at end of file
index 667db54..6404278 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e9=['../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','WhatsappInteraction','then','update','error','find','type','twilio','accountSid','authToken','phone','create','whatsapp:','/status?token=','token','sid','catch','afterCreate','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','node-fetch','path'];(function(_0x2532e9,_0x320c56){var _0x44e0d1=function(_0x4102c9){while(--_0x4102c9){_0x2532e9['push'](_0x2532e9['shift']());}};_0x44e0d1(++_0x320c56);}(_0x34e9,0x102));var _0x934e=function(_0x50382e,_0x1a29ff){_0x50382e=_0x50382e-0x0;var _0x4aac5e=_0x34e9[_0x50382e];return _0x4aac5e;};'use strict';var _=require(_0x934e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x934e('0x1'));var moment=require(_0x934e('0x2'));var BPromise=require(_0x934e('0x3'));var rp=require(_0x934e('0x4'));var fetch=require(_0x934e('0x5'));var fs=require('fs');var path=require(_0x934e('0x6'));var rimraf=require('rimraf');var config=require(_0x934e('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x934e('0x8')]=function(_0x546fbe,_0x459632){return _0x546fbe[_0x934e('0x9')](_0x934e('0xa'),attributes,{'tableName':_0x934e('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x934e('0xc')]},{'name':_0x934e('0xd'),'fields':[_0x934e('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29917e,_0x6cc7c0,_0x2b1375){var _0x43b34e=_0x546fbe[_0x934e('0xf')];var _0x667243=_0x29917e[_0x934e('0x10')]({'plain':!![]});if(_0x667243[_0x934e('0x11')]['toLowerCase']()==='in'||_0x667243[_0x934e('0x11')][_0x934e('0x12')]()===_0x934e('0x13')&&!_0x667243[_0x934e('0x14')]&&!_['isNil'](_0x667243['UserId'])){_0x43b34e[_0x934e('0x15')]['findOne']({'where':{'id':_0x667243['WhatsappInteractionId']}})[_0x934e('0x16')](function(_0x364f82){if(_0x364f82){_0x364f82[_0x934e('0x17')]({'lastMsgAt':_0x667243['createdAt'],'lastMsgDirection':_0x667243[_0x934e('0x11')]['toLowerCase']()});}})['catch'](function(_0x225f44){console[_0x934e('0x18')](_0x225f44);});}if(_0x667243['direction']===_0x934e('0x13')&&!_0x667243[_0x934e('0x14')]){var _0x25123c;_0x43b34e['WhatsappAccount'][_0x934e('0x19')]({'where':{'id':_0x667243['WhatsappAccountId']},'raw':!![]})[_0x934e('0x16')](function(_0x137369){_0x25123c=_0x137369;if(_0x25123c&&_0x25123c[_0x934e('0x1a')]){switch(_0x25123c['type']){case _0x934e('0x1b'):var _0x12199a=require(_0x934e('0x1b'));if(_0x25123c[_0x934e('0x1c')]&&_0x25123c[_0x934e('0x1d')]&&_0x25123c[_0x934e('0x1e')]){var _0x2271e7=new _0x12199a(_0x25123c[_0x934e('0x1c')],_0x25123c[_0x934e('0x1d')]);_0x2271e7['messages'][_0x934e('0x1f')]({'body':_0x667243[_0x934e('0xe')],'to':_0x934e('0x20')+_0x667243['phone'],'from':_0x934e('0x20')+_0x25123c[_0x934e('0x1e')],'statusCallback':_0x25123c['remote']+'/api/whatsapp/messages/'+_0x667243['id']+_0x934e('0x21')+_0x25123c[_0x934e('0x22')]})['then'](function(_0x10fb36){if(_0x10fb36[_0x934e('0x23')]){return _0x29917e[_0x934e('0x17')]({'messageId':_0x10fb36['sid']});}})[_0x934e('0x24')](function(_0x58352f){logger[_0x934e('0x18')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x934e('0x25'),'twilio',util['inspect'](_0x58352f,{'showHidden':![],'depth':null}));});}else{logger[_0x934e('0x18')](_0x934e('0x26'),_0x934e('0x25'),_0x934e('0x1b'),_0x934e('0x27'));}break;case _0x934e('0x28'):var _0x319b1a=_0x25123c[_0x934e('0x1c')];var _0x384459=_0x25123c[_0x934e('0x1d')];var _0x13408f=_0x25123c[_0x934e('0x29')]+_0x934e('0x2a')+_0x319b1a+'/messages/';var _0x2f4689={'to':[_0x667243['phone']],'message':{'type':_0x934e('0x2b'),'text':_0x667243[_0x934e('0xe')]}};var _0x23ccbd={'method':_0x934e('0x2c'),'uri':_0x13408f,'headers':{'Authorization':_0x934e('0x2d')+_0x384459,'Content-Type':_0x934e('0x2e')},'body':_0x2f4689,'json':!![]};rp(_0x23ccbd)[_0x934e('0x16')](function(_0x51b733){if(_0x51b733[_0x934e('0x2f')][0x0][_0x934e('0x30')]){return _0x29917e[_0x934e('0x17')]({'messageId':_0x51b733['statuses'][0x0][_0x934e('0x30')]});}})[_0x934e('0x24')](function(_0x3f4df3){logger[_0x934e('0x31')](_0x934e('0x32'),_0x3f4df3);});break;}}})['finally'](function(){_0x2b1375();});}else{_0x2b1375();}}},'charset':_0x934e('0x33'),'collate':_0x934e('0x34')});};
\ No newline at end of file
+var _0x0c65=['isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','createdAt','error','secret','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','update','catch','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x0c65,0x19d));var _0x50c6=function(_0x3bfa98,_0x3ed6f5){_0x3bfa98=_0x3bfa98-0x0;var _0x226a36=_0x0c65[_0x3bfa98];return _0x226a36;};'use strict';var _=require(_0x50c6('0x0'));var util=require('util');var logger=require(_0x50c6('0x1'))(_0x50c6('0x2'));var moment=require(_0x50c6('0x3'));var BPromise=require(_0x50c6('0x4'));var rp=require(_0x50c6('0x5'));var fetch=require(_0x50c6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x50c6('0x7'));var config=require(_0x50c6('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x50c6('0x9')]=function(_0x55d805,_0x301fa9){return _0x55d805[_0x50c6('0xa')](_0x50c6('0xb'),attributes,{'tableName':_0x50c6('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x50c6('0xd')]},{'name':'fti_whatsapp_messages','fields':[_0x50c6('0xe')],'type':_0x50c6('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3edf23,_0x16c5e8,_0x57a6d5){var _0xd5eb7f=_0x55d805[_0x50c6('0x10')];var _0xfc7687=_0x3edf23[_0x50c6('0x11')]({'plain':!![]});if(_0xfc7687[_0x50c6('0x12')]['toLowerCase']()==='in'||_0xfc7687[_0x50c6('0x12')][_0x50c6('0x13')]()===_0x50c6('0x14')&&!_0xfc7687['secret']&&!_[_0x50c6('0x15')](_0xfc7687[_0x50c6('0x16')])){_0xd5eb7f[_0x50c6('0x17')][_0x50c6('0x18')]({'where':{'id':_0xfc7687[_0x50c6('0x19')]}})['then'](function(_0x3394c0){if(_0x3394c0){_0x3394c0['update']({'lastMsgAt':_0xfc7687[_0x50c6('0x1a')],'lastMsgDirection':_0xfc7687[_0x50c6('0x12')]['toLowerCase']()});}})['catch'](function(_0x321cf8){console[_0x50c6('0x1b')](_0x321cf8);});}if(_0xfc7687[_0x50c6('0x12')]===_0x50c6('0x14')&&!_0xfc7687[_0x50c6('0x1c')]){var _0x4acc29;_0xd5eb7f[_0x50c6('0x1d')][_0x50c6('0x1e')]({'where':{'id':_0xfc7687[_0x50c6('0x1f')]},'raw':!![]})[_0x50c6('0x20')](function(_0xe071fa){_0x4acc29=_0xe071fa;if(_0x4acc29&&_0x4acc29['type']){switch(_0x4acc29[_0x50c6('0x21')]){case _0x50c6('0x22'):var _0x10c765=require(_0x50c6('0x22'));if(_0x4acc29[_0x50c6('0x23')]&&_0x4acc29[_0x50c6('0x24')]&&_0x4acc29[_0x50c6('0x25')]){var _0x431de0=new _0x10c765(_0x4acc29[_0x50c6('0x23')],_0x4acc29[_0x50c6('0x24')]);_0x431de0['messages'][_0x50c6('0x26')]({'body':_0xfc7687['body'],'to':_0x50c6('0x27')+_0xfc7687[_0x50c6('0x25')],'from':_0x50c6('0x27')+_0x4acc29[_0x50c6('0x25')],'statusCallback':_0x4acc29[_0x50c6('0x28')]+_0x50c6('0x29')+_0xfc7687['id']+_0x50c6('0x2a')+_0x4acc29[_0x50c6('0x2b')]})['then'](function(_0x8b509a){if(_0x8b509a[_0x50c6('0x2c')]){return _0x3edf23[_0x50c6('0x2d')]({'messageId':_0x8b509a[_0x50c6('0x2c')]});}})[_0x50c6('0x2e')](function(_0x35bae2){logger[_0x50c6('0x1b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x50c6('0x2f'),_0x50c6('0x22'),util[_0x50c6('0x30')](_0x35bae2,{'showHidden':![],'depth':null}));});}else{logger[_0x50c6('0x1b')](_0x50c6('0x31'),_0x50c6('0x2f'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x50c6('0x32'):var _0x4f9411=_0x4acc29[_0x50c6('0x23')];var _0x5ab931=_0x4acc29['authToken'];var _0x3d96d4=_0x4acc29[_0x50c6('0x33')]+_0x50c6('0x34')+_0x4f9411+_0x50c6('0x35');var _0x55e371={'to':[_0xfc7687[_0x50c6('0x25')]],'message':{'type':_0x50c6('0x36'),'text':_0xfc7687['body']}};var _0x5c9d12={'method':'POST','uri':_0x3d96d4,'headers':{'Authorization':_0x50c6('0x37')+_0x5ab931,'Content-Type':'application/json'},'body':_0x55e371,'json':!![]};rp(_0x5c9d12)[_0x50c6('0x20')](function(_0x5d5914){if(_0x5d5914[_0x50c6('0x38')][0x0][_0x50c6('0x39')]){return _0x3edf23[_0x50c6('0x2d')]({'messageId':_0x5d5914[_0x50c6('0x38')][0x0]['message_id']});}})[_0x50c6('0x2e')](function(_0x5dc28d){logger[_0x50c6('0x3a')](_0x50c6('0x3b'),_0x5dc28d);});break;}}})[_0x50c6('0x3c')](function(){_0x57a6d5();});}else{_0x57a6d5();}}},'charset':_0x50c6('0x3d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 6c974ab..6574da5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa37c=['error','code','message','info','CreateWhatsappMessage','create','body','options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x36dc4a,_0x2da194){var _0x4eb0c4=function(_0x5b7236){while(--_0x5b7236){_0x36dc4a['push'](_0x36dc4a['shift']());}};_0x4eb0c4(++_0x2da194);}(_0xa37c,0x1ad));var _0xca37=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0xa37c[_0x5f1cf8];return _0x27d0fa;};'use strict';var _=require('lodash');var util=require(_0xca37('0x0'));var moment=require('moment');var BPromise=require(_0xca37('0x1'));var rs=require(_0xca37('0x2'));var fs=require('fs');var Redis=require(_0xca37('0x3'));var db=require(_0xca37('0x4'))['db'];var utils=require(_0xca37('0x5'));var logger=require('../../config/logger')(_0xca37('0x6'));var config=require(_0xca37('0x7'));var jayson=require(_0xca37('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xca37('0x9')]=_[_0xca37('0xa')](config[_0xca37('0x9')],{'host':_0xca37('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca37('0x9')]));require(_0xca37('0xc'))[_0xca37('0xd')](socket);function respondWithRpcPromise(_0x1967be,_0x15238f,_0x4db7f5){return new BPromise(function(_0x573ed9,_0x5b9d36){return client[_0xca37('0xe')](_0x1967be,_0x4db7f5)[_0xca37('0xf')](function(_0x1cf353){logger['info'](_0xca37('0x10'),_0x15238f,_0xca37('0x11'));logger[_0xca37('0x12')](_0xca37('0x13'),_0x15238f,_0xca37('0x11'),JSON[_0xca37('0x14')](_0x1cf353));if(_0x1cf353[_0xca37('0x15')]){if(_0x1cf353[_0xca37('0x15')][_0xca37('0x16')]===0x1f4){logger[_0xca37('0x15')](_0xca37('0x10'),_0x15238f,_0x1cf353[_0xca37('0x15')][_0xca37('0x17')]);return _0x5b9d36(_0x1cf353[_0xca37('0x15')][_0xca37('0x17')]);}logger[_0xca37('0x15')](_0xca37('0x10'),_0x15238f,_0x1cf353['error'][_0xca37('0x17')]);return _0x573ed9(_0x1cf353[_0xca37('0x15')][_0xca37('0x17')]);}else{logger[_0xca37('0x18')](_0xca37('0x10'),_0x15238f,_0xca37('0x11'));_0x573ed9(_0x1cf353['result'][_0xca37('0x17')]);}})['catch'](function(_0x51de3e){logger[_0xca37('0x15')](_0xca37('0x10'),_0x15238f,_0x51de3e);_0x5b9d36(_0x51de3e);});});}exports[_0xca37('0x19')]=function(_0x2eb231){var _0x4fe395=this;return new Promise(function(_0x3367cf,_0xec52c0){return db['WhatsappMessage'][_0xca37('0x1a')](_0x2eb231[_0xca37('0x1b')],{'raw':_0x2eb231[_0xca37('0x1c')]?_0x2eb231[_0xca37('0x1c')][_0xca37('0x1d')]===undefined?!![]:![]:!![]})[_0xca37('0xf')](function(_0x2f48d1){logger[_0xca37('0x18')]('CreateWhatsappMessage',_0x2eb231);logger['debug'](_0xca37('0x19'),_0x2eb231,JSON[_0xca37('0x14')](_0x2f48d1));_0x3367cf(_0x2f48d1);})['catch'](function(_0xa1b837){logger['error'](_0xca37('0x19'),_0xa1b837[_0xca37('0x17')],_0x2eb231);_0xec52c0(_0x4fe395['error'](0x1f4,_0xa1b837[_0xca37('0x17')]));});});};
\ No newline at end of file
+var _0xb4f4=['./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x5dfd0c,_0xf26c9){var _0x34125b=function(_0x441625){while(--_0x441625){_0x5dfd0c['push'](_0x5dfd0c['shift']());}};_0x34125b(++_0xf26c9);}(_0xb4f4,0xb4));var _0x4b4f=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xb4f4[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x4b4f('0x0'));var util=require('util');var moment=require(_0x4b4f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b4f('0x2'))['db'];var utils=require(_0x4b4f('0x3'));var logger=require(_0x4b4f('0x4'))(_0x4b4f('0x5'));var config=require('../../config/environment');var jayson=require(_0x4b4f('0x6'));var client=jayson[_0x4b4f('0x7')]['http']({'port':0x232a});config[_0x4b4f('0x8')]=_[_0x4b4f('0x9')](config[_0x4b4f('0x8')],{'host':_0x4b4f('0xa'),'port':0x18eb});var socket=require(_0x4b4f('0xb'))(new Redis(config[_0x4b4f('0x8')]));require(_0x4b4f('0xc'))[_0x4b4f('0xd')](socket);function respondWithRpcPromise(_0x123ce2,_0x345c4e,_0xdc71f1){return new BPromise(function(_0x58341a,_0x18df0c){return client[_0x4b4f('0xe')](_0x123ce2,_0xdc71f1)[_0x4b4f('0xf')](function(_0x168924){logger[_0x4b4f('0x10')](_0x4b4f('0x11'),_0x345c4e,_0x4b4f('0x12'));logger[_0x4b4f('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x345c4e,_0x4b4f('0x12'),JSON[_0x4b4f('0x14')](_0x168924));if(_0x168924['error']){if(_0x168924[_0x4b4f('0x15')][_0x4b4f('0x16')]===0x1f4){logger['error'](_0x4b4f('0x11'),_0x345c4e,_0x168924[_0x4b4f('0x15')][_0x4b4f('0x17')]);return _0x18df0c(_0x168924[_0x4b4f('0x15')][_0x4b4f('0x17')]);}logger[_0x4b4f('0x15')](_0x4b4f('0x11'),_0x345c4e,_0x168924[_0x4b4f('0x15')][_0x4b4f('0x17')]);return _0x58341a(_0x168924[_0x4b4f('0x15')][_0x4b4f('0x17')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x345c4e,_0x4b4f('0x12'));_0x58341a(_0x168924[_0x4b4f('0x18')][_0x4b4f('0x17')]);}})[_0x4b4f('0x19')](function(_0x3d9b00){logger[_0x4b4f('0x15')](_0x4b4f('0x11'),_0x345c4e,_0x3d9b00);_0x18df0c(_0x3d9b00);});});}exports[_0x4b4f('0x1a')]=function(_0x54a973){var _0xdebc9e=this;return new Promise(function(_0x485f55,_0x2c91ab){return db[_0x4b4f('0x1b')][_0x4b4f('0x1c')](_0x54a973[_0x4b4f('0x1d')],{'raw':_0x54a973[_0x4b4f('0x1e')]?_0x54a973[_0x4b4f('0x1e')][_0x4b4f('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x51f371){logger[_0x4b4f('0x10')]('CreateWhatsappMessage',_0x54a973);logger['debug'](_0x4b4f('0x1a'),_0x54a973,JSON[_0x4b4f('0x14')](_0x51f371));_0x485f55(_0x51f371);})[_0x4b4f('0x19')](function(_0x15466a){logger[_0x4b4f('0x15')](_0x4b4f('0x1a'),_0x15466a['message'],_0x54a973);_0x2c91ab(_0xdebc9e[_0x4b4f('0x15')](0x1f4,_0x15466a[_0x4b4f('0x17')]));});});};
\ No newline at end of file
index cf6ca7e..0a6a1a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f8=['update','emit','register','length','whatsappMessage:','save','remove'];(function(_0x34c48e,_0x14f34c){var _0x2248f6=function(_0x2efd6e){while(--_0x2efd6e){_0x34c48e['push'](_0x34c48e['shift']());}};_0x2248f6(++_0x14f34c);}(_0x73f8,0xe5));var _0x873f=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x73f8[_0xbca1b1];return _0x4e1686;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x873f('0x0'),_0x873f('0x1'),_0x873f('0x2')];function createListener(_0x199911,_0x273a02){return function(_0x1a1db2){_0x273a02[_0x873f('0x3')](_0x199911,_0x1a1db2);};}function removeListener(_0x15ad8e,_0xac0a91){return function(){WhatsappMessageEvents['removeListener'](_0x15ad8e,_0xac0a91);};}exports[_0x873f('0x4')]=function(_0x2a0c7b){for(var _0x51b141=0x0,_0x21e334=events[_0x873f('0x5')];_0x51b141<_0x21e334;_0x51b141++){var _0x3cc6e0=events[_0x51b141];var _0x46e348=createListener(_0x873f('0x6')+_0x3cc6e0,_0x2a0c7b);WhatsappMessageEvents['on'](_0x3cc6e0,_0x46e348);}};
\ No newline at end of file
+var _0xf4e2=['register','whatsappMessage:','./whatsappMessage.events','save','update','removeListener'];(function(_0x441fae,_0x3ab2ee){var _0x189025=function(_0x4914e1){while(--_0x4914e1){_0x441fae['push'](_0x441fae['shift']());}};_0x189025(++_0x3ab2ee);}(_0xf4e2,0x164));var _0x2f4e=function(_0x36e20c,_0x43caa5){_0x36e20c=_0x36e20c-0x0;var _0x48eba2=_0xf4e2[_0x36e20c];return _0x48eba2;};'use strict';var WhatsappMessageEvents=require(_0x2f4e('0x0'));var events=[_0x2f4e('0x1'),'remove',_0x2f4e('0x2')];function createListener(_0x280d94,_0xc3f82b){return function(_0x462c2f){_0xc3f82b['emit'](_0x280d94,_0x462c2f);};}function removeListener(_0x1ad3ff,_0x1e034e){return function(){WhatsappMessageEvents[_0x2f4e('0x3')](_0x1ad3ff,_0x1e034e);};}exports[_0x2f4e('0x4')]=function(_0x23a61b){for(var _0x2885ef=0x0,_0x2d254c=events['length'];_0x2885ef<_0x2d254c;_0x2885ef++){var _0x3bb734=events[_0x2885ef];var _0x4c6056=createListener(_0x2f4e('0x5')+_0x3bb734,_0x23a61b);WhatsappMessageEvents['on'](_0x3bb734,_0x4c6056);}};
\ No newline at end of file
index e82e6ab..20e5c14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb7e=['./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','delete','destroy','removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2138df,_0x3162ed){var _0x200461=function(_0x142ab9){while(--_0x142ab9){_0x2138df['push'](_0x2138df['shift']());}};_0x200461(++_0x3162ed);}(_0xdb7e,0x11a));var _0xedb7=function(_0x3c6ce1,_0x464ccf){_0x3c6ce1=_0x3c6ce1-0x0;var _0x558d57=_0xdb7e[_0x3c6ce1];return _0x558d57;};'use strict';var multer=require(_0xedb7('0x0'));var util=require(_0xedb7('0x1'));var path=require(_0xedb7('0x2'));var timeout=require('connect-timeout');var express=require(_0xedb7('0x3'));var router=express[_0xedb7('0x4')]();var fs_extra=require(_0xedb7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xedb7('0x6'));var config=require(_0xedb7('0x7'));var controller=require(_0xedb7('0x8'));router[_0xedb7('0x9')]('/',auth[_0xedb7('0xa')](),controller[_0xedb7('0xb')]);router[_0xedb7('0x9')](_0xedb7('0xc'),auth[_0xedb7('0xa')](),controller[_0xedb7('0xd')]);router['get'](_0xedb7('0xe'),auth[_0xedb7('0xa')](),controller[_0xedb7('0xf')]);router[_0xedb7('0x9')](_0xedb7('0x10'),auth[_0xedb7('0xa')](),controller[_0xedb7('0x11')]);router[_0xedb7('0x9')](_0xedb7('0x12'),auth[_0xedb7('0xa')](),controller[_0xedb7('0x13')]);router[_0xedb7('0x9')](_0xedb7('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0xedb7('0x15')]('/',auth[_0xedb7('0xa')](),controller[_0xedb7('0x16')]);router[_0xedb7('0x15')](_0xedb7('0x12'),auth[_0xedb7('0xa')](),controller[_0xedb7('0x17')]);router[_0xedb7('0x15')](_0xedb7('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0xedb7('0x18')](_0xedb7('0xe'),auth[_0xedb7('0xa')](),controller['update']);router[_0xedb7('0x19')](_0xedb7('0xe'),auth[_0xedb7('0xa')](),controller[_0xedb7('0x1a')]);router[_0xedb7('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xedb7('0x1b')]);router[_0xedb7('0x19')](_0xedb7('0x14'),auth[_0xedb7('0xa')](),controller['removeAgents']);module[_0xedb7('0x1c')]=router;
\ No newline at end of file
+var _0xcad5=['util','path','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/describe','describe','show','/:id/members','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer'];(function(_0x33f254,_0x7945c4){var _0x345152=function(_0x2aa782){while(--_0x2aa782){_0x33f254['push'](_0x33f254['shift']());}};_0x345152(++_0x7945c4);}(_0xcad5,0x1cf));var _0x5cad=function(_0x8c2595,_0x2e6c07){_0x8c2595=_0x8c2595-0x0;var _0x1506ca=_0xcad5[_0x8c2595];return _0x1506ca;};'use strict';var multer=require(_0x5cad('0x0'));var util=require(_0x5cad('0x1'));var path=require(_0x5cad('0x2'));var timeout=require('connect-timeout');var express=require(_0x5cad('0x3'));var router=express[_0x5cad('0x4')]();var fs_extra=require(_0x5cad('0x5'));var auth=require(_0x5cad('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0x5cad('0x7')](),controller['index']);router[_0x5cad('0x8')](_0x5cad('0x9'),auth[_0x5cad('0x7')](),controller[_0x5cad('0xa')]);router['get']('/:id',auth[_0x5cad('0x7')](),controller[_0x5cad('0xb')]);router[_0x5cad('0x8')](_0x5cad('0xc'),auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/teams',auth[_0x5cad('0x7')](),controller[_0x5cad('0xd')]);router['get'](_0x5cad('0xe'),auth[_0x5cad('0x7')](),controller[_0x5cad('0xf')]);router[_0x5cad('0x10')]('/',auth[_0x5cad('0x7')](),controller[_0x5cad('0x11')]);router[_0x5cad('0x10')](_0x5cad('0x12'),auth['isAuthenticated'](),controller[_0x5cad('0x13')]);router[_0x5cad('0x10')](_0x5cad('0xe'),auth[_0x5cad('0x7')](),controller[_0x5cad('0x14')]);router[_0x5cad('0x15')](_0x5cad('0x16'),auth[_0x5cad('0x7')](),controller[_0x5cad('0x17')]);router[_0x5cad('0x18')](_0x5cad('0x16'),auth['isAuthenticated'](),controller[_0x5cad('0x19')]);router[_0x5cad('0x18')](_0x5cad('0x12'),auth[_0x5cad('0x7')](),controller[_0x5cad('0x1a')]);router['delete'](_0x5cad('0xe'),auth['isAuthenticated'](),controller[_0x5cad('0x1b')]);module[_0x5cad('0x1c')]=router;
\ No newline at end of file
index eff75df..95facde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9532=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x2364bc,_0x5b1127){var _0xcdb4c=function(_0x21b996){while(--_0x21b996){_0x2364bc['push'](_0x2364bc['shift']());}};_0xcdb4c(++_0x5b1127);}(_0x9532,0x8c));var _0x2953=function(_0x5b4a71,_0x485138){_0x5b4a71=_0x5b4a71-0x0;var _0x2c0315=_0x9532[_0x5b4a71];return _0x2c0315;};'use strict';var Sequelize=require(_0x2953('0x0'));module[_0x2953('0x1')]={'name':{'type':Sequelize[_0x2953('0x2')],'unique':_0x2953('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2953('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2953('0x5')]('rrmemory',_0x2953('0x6'),_0x2953('0x7'))},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb7c8=['beepall','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x799be3,_0x49415f){var _0x4acfac=function(_0x33169b){while(--_0x33169b){_0x799be3['push'](_0x799be3['shift']());}};_0x4acfac(++_0x49415f);}(_0xb7c8,0x119));var _0x8b7c=function(_0x1399ba,_0x246ab1){_0x1399ba=_0x1399ba-0x0;var _0x45918f=_0xb7c8[_0x1399ba];return _0x45918f;};'use strict';var Sequelize=require('sequelize');module[_0x8b7c('0x0')]={'name':{'type':Sequelize[_0x8b7c('0x1')],'unique':_0x8b7c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x8b7c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b7c('0x4')](_0x8b7c('0x5'),_0x8b7c('0x6'),'roundrobin')},'description':{'type':Sequelize[_0x8b7c('0x1')]}};
\ No newline at end of file
index 8b3a42b..72679b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb823=['nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','Agents','online','flatMap','sequelize','transaction','each','UserWhatsappQueue','findOrCreate','emit','userWhatsappQueue:save','field','from','join','user_has_teams','clone','push','toString','SELECT','every','includes','union','compact','removeTeams','isEmpty','forEach','addAgents','omit','spread','removeAgents','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','WhatsappQueues','UserProfileResource','error','stack','name','send','WhatsappQueue','fieldName','type','map','keys','query','intersection','model','attributes','fields','order','sort','filters','pick','where','merge','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty'];(function(_0x454b02,_0x14489d){var _0x181f9e=function(_0x3e825a){while(--_0x3e825a){_0x454b02['push'](_0x454b02['shift']());}};_0x181f9e(++_0x14489d);}(_0xb823,0x1cc));var _0x3b82=function(_0x33b259,_0x2036be){_0x33b259=_0x33b259-0x0;var _0xf95548=_0xb823[_0x33b259];return _0xf95548;};'use strict';var emlformat=require(_0x3b82('0x0'));var rimraf=require(_0x3b82('0x1'));var zipdir=require(_0x3b82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b82('0x3'));var moment=require(_0x3b82('0x4'));var BPromise=require(_0x3b82('0x5'));var Mustache=require(_0x3b82('0x6'));var util=require('util');var path=require(_0x3b82('0x7'));var sox=require(_0x3b82('0x8'));var csv=require('to-csv');var ejs=require(_0x3b82('0x9'));var fs=require('fs');var fs_extra=require(_0x3b82('0xa'));var _=require('lodash');var squel=require(_0x3b82('0xb'));var crypto=require('crypto');var jsforce=require(_0x3b82('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3b82('0xd'));var Papa=require('papaparse');var Redis=require(_0x3b82('0xe'));var authService=require(_0x3b82('0xf'));var qs=require(_0x3b82('0x10'));var as=require(_0x3b82('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b82('0x12'))(_0x3b82('0x13'));var utils=require(_0x3b82('0x14'));var config=require(_0x3b82('0x15'));var licenseUtil=require(_0x3b82('0x16'));var db=require('../../mysqldb')['db'];config[_0x3b82('0x17')]=_[_0x3b82('0x18')](config[_0x3b82('0x17')],{'host':_0x3b82('0x19'),'port':0x18eb});var socket=require(_0x3b82('0x1a'))(new Redis(config['redis']));require(_0x3b82('0x1b'))[_0x3b82('0x1c')](socket);function respondWithStatusCode(_0x3d5177,_0x332e90){_0x332e90=_0x332e90||0xcc;return function(_0x35a096){if(_0x35a096){return _0x3d5177[_0x3b82('0x1d')](_0x332e90);}return _0x3d5177[_0x3b82('0x1e')](_0x332e90)[_0x3b82('0x1f')]();};}function respondWithResult(_0x537cb9,_0x4c5d93){_0x4c5d93=_0x4c5d93||0xc8;return function(_0xe0b36e){if(_0xe0b36e){return _0x537cb9[_0x3b82('0x1e')](_0x4c5d93)[_0x3b82('0x20')](_0xe0b36e);}};}function respondWithFilteredResult(_0xcdfe47,_0x28fe42){return function(_0x52aeae){if(_0x52aeae){var _0x486764=typeof _0x28fe42['offset']===_0x3b82('0x21')&&typeof _0x28fe42[_0x3b82('0x22')]===_0x3b82('0x21');var _0x1e5cfc=_0x52aeae[_0x3b82('0x23')];var _0x2acf64=_0x486764?0x0:_0x28fe42[_0x3b82('0x24')];var _0x17c513=_0x486764?_0x52aeae[_0x3b82('0x23')]:_0x28fe42['offset']+_0x28fe42[_0x3b82('0x22')];var _0x494dae;if(_0x17c513>=_0x1e5cfc){_0x17c513=_0x1e5cfc;_0x494dae=0xc8;}else{_0x494dae=0xce;}_0xcdfe47[_0x3b82('0x1e')](_0x494dae);return _0xcdfe47[_0x3b82('0x25')](_0x3b82('0x26'),_0x2acf64+'-'+_0x17c513+'/'+_0x1e5cfc)['json'](_0x52aeae);}return null;};}function patchUpdates(_0x14e2ad){return function(_0x19bfc5){try{jsonpatch[_0x3b82('0x27')](_0x19bfc5,_0x14e2ad,!![]);}catch(_0x57919a){return BPromise[_0x3b82('0x28')](_0x57919a);}return _0x19bfc5[_0x3b82('0x29')]();};}function saveUpdates(_0x4b9451,_0x62532f){return function(_0x562e10){if(_0x562e10){return _0x562e10['update'](_0x4b9451)['then'](function(_0x28a527){return _0x28a527;});}return null;};}function removeEntity(_0x2ae246,_0x3ace43){return function(_0x1c60e0){if(_0x1c60e0){return _0x1c60e0[_0x3b82('0x2a')]()[_0x3b82('0x2b')](function(){var _0x3417a9=_0x1c60e0['get']({'plain':!![]});var _0x5675ae=_0x3b82('0x2c');return db[_0x3b82('0x2d')][_0x3b82('0x2a')]({'where':{'type':_0x5675ae,'resourceId':_0x3417a9['id']}})[_0x3b82('0x2b')](function(){return _0x1c60e0;});})[_0x3b82('0x2b')](function(){_0x2ae246[_0x3b82('0x1e')](0xcc)[_0x3b82('0x1f')]();});}};}function handleEntityNotFound(_0x58a974,_0x27de1a){return function(_0x1d9ace){if(!_0x1d9ace){_0x58a974[_0x3b82('0x1d')](0x194);}return _0x1d9ace;};}function handleError(_0x260980,_0x5db960){_0x5db960=_0x5db960||0x1f4;return function(_0x87fb2e){logger[_0x3b82('0x2e')](_0x87fb2e[_0x3b82('0x2f')]);if(_0x87fb2e[_0x3b82('0x30')]){delete _0x87fb2e['name'];}_0x260980['status'](_0x5db960)[_0x3b82('0x31')](_0x87fb2e);};}exports['index']=function(_0x3a527a,_0x19b7ed){var _0x38c387={},_0x4260e0={},_0x2326d5={'count':0x0,'rows':[]};var _0xb013a3=_['map'](db[_0x3b82('0x32')]['rawAttributes'],function(_0xb07379){return{'name':_0xb07379[_0x3b82('0x33')],'type':_0xb07379[_0x3b82('0x34')]['key']};});_0x4260e0['model']=_[_0x3b82('0x35')](_0xb013a3,'name');_0x4260e0['query']=_[_0x3b82('0x36')](_0x3a527a[_0x3b82('0x37')]);_0x4260e0['filters']=_[_0x3b82('0x38')](_0x4260e0[_0x3b82('0x39')],_0x4260e0[_0x3b82('0x37')]);_0x38c387[_0x3b82('0x3a')]=_['intersection'](_0x4260e0['model'],qs[_0x3b82('0x3b')](_0x3a527a[_0x3b82('0x37')][_0x3b82('0x3b')]));_0x38c387['attributes']=_0x38c387[_0x3b82('0x3a')]['length']?_0x38c387[_0x3b82('0x3a')]:_0x4260e0[_0x3b82('0x39')];if(!_0x3a527a[_0x3b82('0x37')]['hasOwnProperty']('nolimit')){_0x38c387[_0x3b82('0x22')]=qs[_0x3b82('0x22')](_0x3a527a['query'][_0x3b82('0x22')]);_0x38c387[_0x3b82('0x24')]=qs['offset'](_0x3a527a[_0x3b82('0x37')][_0x3b82('0x24')]);}_0x38c387[_0x3b82('0x3c')]=qs[_0x3b82('0x3d')](_0x3a527a[_0x3b82('0x37')][_0x3b82('0x3d')]);_0x38c387['where']=qs[_0x3b82('0x3e')](_[_0x3b82('0x3f')](_0x3a527a[_0x3b82('0x37')],_0x4260e0[_0x3b82('0x3e')]),_0xb013a3);if(_0x3a527a[_0x3b82('0x37')]['filter']){_0x38c387[_0x3b82('0x40')]=_[_0x3b82('0x41')](_0x38c387[_0x3b82('0x40')],{'$or':_[_0x3b82('0x35')](_0xb013a3,function(_0x37b595){if(_0x37b595[_0x3b82('0x34')]!=='VIRTUAL'){var _0x27cf76={};_0x27cf76[_0x37b595[_0x3b82('0x30')]]={'$like':'%'+_0x3a527a[_0x3b82('0x37')][_0x3b82('0x42')]+'%'};return _0x27cf76;}})});}_0x38c387=_[_0x3b82('0x41')]({},_0x38c387,_0x3a527a['options']);var _0x779987={'where':_0x38c387['where']};return db[_0x3b82('0x32')][_0x3b82('0x23')](_0x779987)[_0x3b82('0x2b')](function(_0x1fc065){_0x2326d5[_0x3b82('0x23')]=_0x1fc065;if(_0x3a527a['query'][_0x3b82('0x43')]){_0x38c387[_0x3b82('0x44')]=[{'all':!![]}];}return db[_0x3b82('0x32')][_0x3b82('0x45')](_0x38c387);})[_0x3b82('0x2b')](function(_0x3b19d1){_0x2326d5[_0x3b82('0x46')]=_0x3b19d1;return _0x2326d5;})[_0x3b82('0x2b')](respondWithFilteredResult(_0x19b7ed,_0x38c387))[_0x3b82('0x47')](handleError(_0x19b7ed,null));};exports[_0x3b82('0x48')]=function(_0x185c79,_0x708659){var _0x4f8d13={'raw':!![],'where':{'id':_0x185c79[_0x3b82('0x49')]['id']}},_0x34f823={};_0x34f823[_0x3b82('0x39')]=_[_0x3b82('0x36')](db[_0x3b82('0x32')][_0x3b82('0x4a')]);_0x34f823[_0x3b82('0x37')]=_[_0x3b82('0x36')](_0x185c79[_0x3b82('0x37')]);_0x34f823['filters']=_[_0x3b82('0x38')](_0x34f823[_0x3b82('0x39')],_0x34f823[_0x3b82('0x37')]);_0x4f8d13[_0x3b82('0x3a')]=_[_0x3b82('0x38')](_0x34f823[_0x3b82('0x39')],qs[_0x3b82('0x3b')](_0x185c79['query'][_0x3b82('0x3b')]));_0x4f8d13[_0x3b82('0x3a')]=_0x4f8d13[_0x3b82('0x3a')][_0x3b82('0x4b')]?_0x4f8d13[_0x3b82('0x3a')]:_0x34f823[_0x3b82('0x39')];if(_0x185c79['query']['includeAll']){_0x4f8d13['include']=[{'all':!![]}];}_0x4f8d13=_[_0x3b82('0x41')]({},_0x4f8d13,_0x185c79[_0x3b82('0x4c')]);return db[_0x3b82('0x32')][_0x3b82('0x4d')](_0x4f8d13)[_0x3b82('0x2b')](handleEntityNotFound(_0x708659,null))[_0x3b82('0x2b')](respondWithResult(_0x708659,null))['catch'](handleError(_0x708659,null));};exports[_0x3b82('0x4e')]=function(_0x5c5ba1,_0x355045){return db['WhatsappQueue'][_0x3b82('0x4e')](_0x5c5ba1[_0x3b82('0x4f')],{})[_0x3b82('0x2b')](function(_0x4773ac){var _0x520245=_0x5c5ba1[_0x3b82('0x50')][_0x3b82('0x51')]({'plain':!![]});if(!_0x520245)throw new Error(_0x3b82('0x52'));if(_0x520245[_0x3b82('0x53')]==='user'){var _0x4ebb5f=_0x4773ac[_0x3b82('0x51')]({'plain':!![]});var _0x76e7aa=_0x3b82('0x2c');return db[_0x3b82('0x54')]['find']({'where':{'name':_0x76e7aa,'userProfileId':_0x520245[_0x3b82('0x55')]},'raw':!![]})[_0x3b82('0x2b')](function(_0x508b9e){if(_0x508b9e&&_0x508b9e[_0x3b82('0x56')]===0x0){return db['UserProfileResource'][_0x3b82('0x4e')]({'name':_0x4ebb5f[_0x3b82('0x30')],'resourceId':_0x4ebb5f['id'],'type':_0x508b9e[_0x3b82('0x30')],'sectionId':_0x508b9e['id']},{})['then'](function(){return _0x4773ac;});}else{return _0x4773ac;}})['catch'](function(_0x212f8b){logger['error'](_0x3b82('0x57'),_0x212f8b);throw _0x212f8b;});}return _0x4773ac;})[_0x3b82('0x2b')](respondWithResult(_0x355045,0xc9))[_0x3b82('0x47')](handleError(_0x355045,null));};exports['update']=function(_0x49822f,_0x1cfa70){if(_0x49822f[_0x3b82('0x4f')]['id']){delete _0x49822f[_0x3b82('0x4f')]['id'];}return db[_0x3b82('0x32')][_0x3b82('0x4d')]({'where':{'id':_0x49822f['params']['id']}})[_0x3b82('0x2b')](handleEntityNotFound(_0x1cfa70,null))[_0x3b82('0x2b')](saveUpdates(_0x49822f['body'],null))[_0x3b82('0x2b')](respondWithResult(_0x1cfa70,null))['catch'](handleError(_0x1cfa70,null));};exports['destroy']=function(_0x31444d,_0x1edfa9){return db[_0x3b82('0x32')][_0x3b82('0x4d')]({'where':{'id':_0x31444d['params']['id']}})['then'](handleEntityNotFound(_0x1edfa9,null))[_0x3b82('0x2b')](removeEntity(_0x1edfa9,null))['catch'](handleError(_0x1edfa9,null));};exports[_0x3b82('0x58')]=function(_0x4e359,_0x33d977){return db[_0x3b82('0x32')][_0x3b82('0x58')]()[_0x3b82('0x2b')](respondWithResult(_0x33d977,null))[_0x3b82('0x47')](handleError(_0x33d977,null));};exports[_0x3b82('0x59')]=function(_0x14bdfd,_0xde82d8,_0x5f3c91){var _0x1abb51={'raw':!![],'where':{}},_0x36dbbc={},_0x413e4a;return db[_0x3b82('0x32')][_0x3b82('0x5a')]({'where':{'id':_0x14bdfd['params']['id']}})[_0x3b82('0x2b')](handleEntityNotFound(_0xde82d8,null))['then'](function(_0x34a47c){if(_0x34a47c){_0x413e4a=_0x34a47c[_0x3b82('0x51')]({'plain':!![]});_0x36dbbc['model']=_['keys'](db['UserWhatsappQueue'][_0x3b82('0x4a')]);_0x36dbbc[_0x3b82('0x37')]=_[_0x3b82('0x36')](_0x14bdfd[_0x3b82('0x37')]);_0x36dbbc['filters']=_['intersection'](_0x36dbbc[_0x3b82('0x39')],_0x36dbbc['query']);_0x1abb51[_0x3b82('0x3a')]=_[_0x3b82('0x38')](_0x36dbbc['model'],qs[_0x3b82('0x3b')](_0x14bdfd[_0x3b82('0x37')][_0x3b82('0x3b')]));_0x1abb51[_0x3b82('0x3a')]=_0x1abb51[_0x3b82('0x3a')][_0x3b82('0x4b')]?_0x1abb51[_0x3b82('0x3a')]:_0x36dbbc[_0x3b82('0x39')];if(!_0x14bdfd[_0x3b82('0x37')][_0x3b82('0x5b')](_0x3b82('0x5c'))){_0x1abb51[_0x3b82('0x22')]=qs[_0x3b82('0x22')](_0x14bdfd['query']['limit']);_0x1abb51[_0x3b82('0x24')]=qs[_0x3b82('0x24')](_0x14bdfd[_0x3b82('0x37')][_0x3b82('0x24')]);}_0x1abb51[_0x3b82('0x3c')]=qs[_0x3b82('0x3d')](_0x14bdfd[_0x3b82('0x37')][_0x3b82('0x3d')]);_0x1abb51['where']=qs['filters'](_[_0x3b82('0x3f')](_0x14bdfd[_0x3b82('0x37')],_0x36dbbc['filters']));_0x1abb51[_0x3b82('0x40')][_0x3b82('0x5d')]=_0x34a47c['id'];if(_0x14bdfd[_0x3b82('0x37')][_0x3b82('0x42')]){_0x1abb51[_0x3b82('0x40')]=_[_0x3b82('0x41')](_0x1abb51[_0x3b82('0x40')],{'$or':_[_0x3b82('0x35')](_0x1abb51[_0x3b82('0x3a')],function(_0x12dbd5){var _0xa1cb1f={};_0xa1cb1f[_0x12dbd5]={'$like':'%'+_0x14bdfd['query'][_0x3b82('0x42')]+'%'};return _0xa1cb1f;})});}_0x1abb51=_['merge']({},_0x1abb51,_0x14bdfd[_0x3b82('0x4c')]);return db['UserWhatsappQueue'][_0x3b82('0x45')](_0x1abb51);}})[_0x3b82('0x2b')](function(_0x5e08eb){if(_0x5e08eb){return db[_0x3b82('0x5e')][_0x3b82('0x5f')]({'where':{'id':_[_0x3b82('0x35')](_0x5e08eb,_0x3b82('0x60')),'role':_0x3b82('0x61')},'attributes':['id','name',_0x3b82('0x62'),_0x3b82('0x63'),_0x3b82('0x64')]});}})[_0x3b82('0x2b')](function(_0x1fc71f){if(_0x1fc71f){return{'count':_0x1fc71f[_0x3b82('0x23')],'rows':_[_0x3b82('0x35')](_0x1fc71f['rows'],function(_0x3f3415){return{'membername':_0x3f3415['name'],'UserId':_0x3f3415['id'],'queue_name':_0x413e4a['name'],'WhatsappQueueId':_0x413e4a['id'],'interface':util[_0x3b82('0x65')]('%s/%s','SIP',_0x3f3415['name']),'penalty':0x0,'paused':_0x3f3415[_0x3b82('0x62')],'createdAt':_0x3f3415['createdAt'],'updatedAt':_0x3f3415[_0x3b82('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3b82('0x2b')](respondWithFilteredResult(_0xde82d8,_0x1abb51))[_0x3b82('0x47')](handleError(_0xde82d8,null));};exports[_0x3b82('0x66')]=function(_0x34574b,_0x4dae73,_0x38c33e){var _0x10ce63={};var _0x193b16={};var _0x2803dc;var _0x49b9ba;return db['WhatsappQueue']['findOne']({'where':{'id':_0x34574b['params']['id']}})[_0x3b82('0x2b')](handleEntityNotFound(_0x4dae73,null))['then'](function(_0x286388){if(_0x286388){_0x2803dc=_0x286388;_0x193b16[_0x3b82('0x39')]=_[_0x3b82('0x36')](db[_0x3b82('0x67')]['rawAttributes']);_0x193b16['query']=_[_0x3b82('0x36')](_0x34574b[_0x3b82('0x37')]);_0x193b16[_0x3b82('0x3e')]=_[_0x3b82('0x38')](_0x193b16[_0x3b82('0x39')],_0x193b16[_0x3b82('0x37')]);_0x10ce63['attributes']=_[_0x3b82('0x38')](_0x193b16['model'],qs[_0x3b82('0x3b')](_0x34574b[_0x3b82('0x37')][_0x3b82('0x3b')]));_0x10ce63[_0x3b82('0x3a')]=_0x10ce63[_0x3b82('0x3a')][_0x3b82('0x4b')]?_0x10ce63['attributes']:_0x193b16[_0x3b82('0x39')];_0x10ce63[_0x3b82('0x3c')]=qs['sort'](_0x34574b['query']['sort']);_0x10ce63[_0x3b82('0x40')]=qs[_0x3b82('0x3e')](_[_0x3b82('0x3f')](_0x34574b['query'],_0x193b16[_0x3b82('0x3e')]));if(_0x34574b['query'][_0x3b82('0x42')]){_0x10ce63[_0x3b82('0x40')]=_[_0x3b82('0x41')](_0x10ce63[_0x3b82('0x40')],{'$or':_['map'](_0x10ce63[_0x3b82('0x3a')],function(_0x382d02){var _0x4d6b92={};_0x4d6b92[_0x382d02]={'$like':'%'+_0x34574b[_0x3b82('0x37')][_0x3b82('0x42')]+'%'};return _0x4d6b92;})});}_0x10ce63=_[_0x3b82('0x41')]({},_0x10ce63,_0x34574b[_0x3b82('0x4c')]);return _0x2803dc[_0x3b82('0x66')](_0x10ce63);}})[_0x3b82('0x2b')](function(_0x46afcb){if(_0x46afcb){_0x49b9ba=_0x46afcb[_0x3b82('0x4b')];if(!_0x34574b[_0x3b82('0x37')][_0x3b82('0x5b')](_0x3b82('0x5c'))){_0x10ce63['limit']=qs[_0x3b82('0x22')](_0x34574b[_0x3b82('0x37')][_0x3b82('0x22')]);_0x10ce63[_0x3b82('0x24')]=qs[_0x3b82('0x24')](_0x34574b[_0x3b82('0x37')][_0x3b82('0x24')]);}return _0x2803dc['getTeams'](_0x10ce63);}})[_0x3b82('0x2b')](function(_0x546720){if(_0x546720){return _0x546720?{'count':_0x49b9ba,'rows':_0x546720}:null;}})[_0x3b82('0x2b')](respondWithResult(_0x4dae73,null))['catch'](handleError(_0x4dae73,null));};exports[_0x3b82('0x68')]=function(_0x15decf,_0x35c42d,_0x2b3365){var _0x15dce6=_0x15decf[_0x3b82('0x4f')][_0x3b82('0x69')];return db[_0x3b82('0x67')][_0x3b82('0x45')]({'where':{'id':_0x15dce6},'attributes':['id'],'include':[{'model':db[_0x3b82('0x5e')],'as':_0x3b82('0x6a'),'attributes':['id',_0x3b82('0x30'),_0x3b82('0x6b'),'voicePause','interface'],'raw':!![]}]})[_0x3b82('0x2b')](function(_0x42795c){if(_0x42795c){var _0x2d2a1c=_[_0x3b82('0x6c')](_0x42795c,function(_0x218b4f){var _0x58eb79=_0x218b4f['get']({'plain':!![]});return _0x58eb79['Agents'];});return db[_0x3b82('0x32')][_0x3b82('0x4d')]({'where':{'id':_0x15decf['params']['id']}})[_0x3b82('0x2b')](function(_0x591ebe){return db[_0x3b82('0x6d')][_0x3b82('0x6e')](function(_0x3c383c){return _0x591ebe[_0x3b82('0x68')](_0x15dce6,{'transaction':_0x3c383c})[_0x3b82('0x2b')](function(){return BPromise[_0x3b82('0x6f')](_0x2d2a1c,function(_0x885e7d){return db[_0x3b82('0x70')][_0x3b82('0x71')]({'where':{'UserId':_0x885e7d['id'],'WhatsappQueueId':_0x15decf[_0x3b82('0x49')]['id']},'transaction':_0x3c383c});});})[_0x3b82('0x2b')](function(){_0x2d2a1c['forEach'](function(_0xbda606){socket[_0x3b82('0x72')](_0x3b82('0x73'),{'UserId':_0xbda606['id'],'WhatsappQueueId':_0x591ebe['id']});});});});});}})[_0x3b82('0x2b')](respondWithStatusCode(_0x35c42d,null))['catch'](handleError(_0x35c42d,null));};exports['removeTeams']=function(_0x47cf0a,_0x355074,_0x11f7bb){return db['Team'][_0x3b82('0x45')]({'where':{'id':_0x47cf0a['query'][_0x3b82('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3b82('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x355074,null))[_0x3b82('0x2b')](function(_0x469171){var _0x1f227b=_[_0x3b82('0x35')](_0x469171,'id');var _0x3a5a25=[];var _0x19a6ff=[];var _0x2b9198=squel['select']();_0x2b9198[_0x3b82('0x74')]('tq.TeamId')[_0x3b82('0x75')]('team_has_whatsapp_queues','tq')[_0x3b82('0x76')](_0x3b82('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3b82('0x40')]('WhatsappQueueId\x20=\x20?',_0x47cf0a[_0x3b82('0x49')]['id']);for(var _0x2c00ab=0x0;_0x2c00ab<_0x469171['length'];_0x2c00ab+=0x1){let _0x402642=_0x469171[_0x2c00ab];for(var _0x5de76d=0x0;_0x5de76d<_0x402642[_0x3b82('0x6a')][_0x3b82('0x4b')];_0x5de76d+=0x1){let _0x75469c=_0x402642[_0x3b82('0x6a')][_0x5de76d];var _0x84fb98=_0x2b9198[_0x3b82('0x78')]();_0x84fb98['where']('ut.UserId\x20=\x20?',_0x75469c['id']);_0x19a6ff[_0x3b82('0x79')](db[_0x3b82('0x6d')][_0x3b82('0x37')](_0x84fb98[_0x3b82('0x7a')](),{'type':db[_0x3b82('0x6d')]['QueryTypes'][_0x3b82('0x7b')]})['then'](function(_0x3461b0){if(_0x3461b0[_0x3b82('0x4b')]===0x1){return _0x75469c['id'];}else{var _0xf54abc=_[_0x3b82('0x7c')](_[_0x3b82('0x35')](_0x3461b0,'TeamId'),function(_0x23573e){return _[_0x3b82('0x7d')](_0x1f227b,_0x23573e);});if(_0xf54abc){return _0x75469c['id'];}}}));}}return BPromise['all'](_0x19a6ff)[_0x3b82('0x2b')](function(_0x2bcc00){_0x3a5a25=_(_0x3a5a25)[_0x3b82('0x7e')](_0x2bcc00)[_0x3b82('0x7f')]()['value']();return db[_0x3b82('0x32')][_0x3b82('0x4d')]({'where':{'id':_0x47cf0a[_0x3b82('0x49')]['id']}})['then'](function(_0x4987e3){return db['sequelize'][_0x3b82('0x6e')](function(_0x155661){return _0x4987e3[_0x3b82('0x80')](_0x47cf0a[_0x3b82('0x37')][_0x3b82('0x69')],{'transaction':_0x155661})[_0x3b82('0x2b')](function(){if(!_[_0x3b82('0x81')](_0x3a5a25)){return _0x4987e3['removeAgents'](_0x3a5a25,{'transaction':_0x155661});}})[_0x3b82('0x2b')](function(){_0x3a5a25[_0x3b82('0x82')](function(_0x25cc7e){socket[_0x3b82('0x72')]('userWhatsappQueue:remove',{'UserId':_0x25cc7e,'WhatsappQueueId':_0x4987e3['id']});});});});});});})[_0x3b82('0x2b')](respondWithStatusCode(_0x355074,null))['catch'](handleError(_0x355074,null));};exports[_0x3b82('0x83')]=function(_0x14d4a7,_0x436a92,_0x43f9a8){return db['WhatsappQueue']['find']({'where':{'id':_0x14d4a7[_0x3b82('0x49')]['id']}})[_0x3b82('0x2b')](handleEntityNotFound(_0x436a92,null))[_0x3b82('0x2b')](function(_0x22edf0){if(_0x22edf0){return _0x22edf0[_0x3b82('0x83')](_0x14d4a7[_0x3b82('0x4f')]['ids'],_[_0x3b82('0x84')](_0x14d4a7[_0x3b82('0x4f')],[_0x3b82('0x69'),'id'])||{})[_0x3b82('0x85')](function(_0x504267){for(var _0xc5937=0x0;_0xc5937<_0x14d4a7[_0x3b82('0x4f')][_0x3b82('0x69')][_0x3b82('0x4b')];_0xc5937+=0x1){socket[_0x3b82('0x72')]('userWhatsappQueue:save',{'UserId':Number(_0x14d4a7[_0x3b82('0x4f')][_0x3b82('0x69')][_0xc5937]),'WhatsappQueueId':Number(_0x14d4a7[_0x3b82('0x49')]['id'])});}return _0x504267;});}})['then'](respondWithResult(_0x436a92,null))[_0x3b82('0x47')](handleError(_0x436a92,null));};exports[_0x3b82('0x86')]=function(_0x307747,_0x1854b7,_0x541f96){return db[_0x3b82('0x32')]['find']({'where':{'id':_0x307747[_0x3b82('0x49')]['id']}})[_0x3b82('0x2b')](handleEntityNotFound(_0x1854b7,null))[_0x3b82('0x2b')](function(_0x377a37){if(_0x377a37){return _0x377a37[_0x3b82('0x86')](_0x307747[_0x3b82('0x37')]['ids'])[_0x3b82('0x2b')](function(){if(_[_0x3b82('0x87')](_0x307747[_0x3b82('0x37')][_0x3b82('0x69')])){for(var _0x53c8e7=0x0;_0x53c8e7<_0x307747['query']['ids'][_0x3b82('0x4b')];_0x53c8e7+=0x1){socket[_0x3b82('0x72')]('userWhatsappQueue:remove',{'UserId':Number(_0x307747[_0x3b82('0x37')][_0x3b82('0x69')][_0x53c8e7]),'WhatsappQueueId':Number(_0x307747['params']['id'])});}}else{socket[_0x3b82('0x72')](_0x3b82('0x88'),{'UserId':Number(_0x307747[_0x3b82('0x37')][_0x3b82('0x69')]),'WhatsappQueueId':Number(_0x307747['params']['id'])});}});}})[_0x3b82('0x2b')](respondWithStatusCode(_0x1854b7,null))['catch'](handleError(_0x1854b7,null));};exports[_0x3b82('0x89')]=function(_0x4f9432,_0x510f4d,_0x5451a4){var _0x45f998={};var _0x4e33f5={};var _0x1d32f2;var _0x2725ec;return db[_0x3b82('0x32')][_0x3b82('0x5a')]({'where':{'id':_0x4f9432['params']['id']}})[_0x3b82('0x2b')](handleEntityNotFound(_0x510f4d,null))['then'](function(_0x45be73){if(_0x45be73){_0x1d32f2=_0x45be73;_0x4e33f5[_0x3b82('0x39')]=_['keys'](db[_0x3b82('0x5e')][_0x3b82('0x4a')]);_0x4e33f5[_0x3b82('0x37')]=_[_0x3b82('0x36')](_0x4f9432[_0x3b82('0x37')]);_0x4e33f5['filters']=_[_0x3b82('0x38')](_0x4e33f5[_0x3b82('0x39')],_0x4e33f5[_0x3b82('0x37')]);_0x45f998[_0x3b82('0x3a')]=_[_0x3b82('0x38')](_0x4e33f5[_0x3b82('0x39')],qs[_0x3b82('0x3b')](_0x4f9432[_0x3b82('0x37')]['fields']));_0x45f998[_0x3b82('0x3a')]=_0x45f998[_0x3b82('0x3a')][_0x3b82('0x4b')]?_0x45f998['attributes']:_0x4e33f5[_0x3b82('0x39')];_0x45f998[_0x3b82('0x3c')]=qs[_0x3b82('0x3d')](_0x4f9432[_0x3b82('0x37')][_0x3b82('0x3d')]);_0x45f998[_0x3b82('0x40')]=qs['filters'](_[_0x3b82('0x3f')](_0x4f9432[_0x3b82('0x37')],_0x4e33f5[_0x3b82('0x3e')]));if(_0x4f9432[_0x3b82('0x37')][_0x3b82('0x42')]){_0x45f998[_0x3b82('0x40')]=_[_0x3b82('0x41')](_0x45f998[_0x3b82('0x40')],{'$or':_[_0x3b82('0x35')](_0x45f998[_0x3b82('0x3a')],function(_0x4fc671){var _0x280df9={};_0x280df9[_0x4fc671]={'$like':'%'+_0x4f9432['query'][_0x3b82('0x42')]+'%'};return _0x280df9;})});}_0x45f998=_[_0x3b82('0x41')]({},_0x45f998,_0x4f9432[_0x3b82('0x4c')]);return _0x1d32f2[_0x3b82('0x89')](_0x45f998);}})[_0x3b82('0x2b')](function(_0xc152da){if(_0xc152da){_0x2725ec=_0xc152da[_0x3b82('0x4b')];if(!_0x4f9432[_0x3b82('0x37')][_0x3b82('0x5b')]('nolimit')){_0x45f998[_0x3b82('0x22')]=qs[_0x3b82('0x22')](_0x4f9432[_0x3b82('0x37')][_0x3b82('0x22')]);_0x45f998[_0x3b82('0x24')]=qs['offset'](_0x4f9432[_0x3b82('0x37')]['offset']);}return _0x1d32f2[_0x3b82('0x89')](_0x45f998);}})['then'](function(_0x1b4961){if(_0x1b4961){return _0x1b4961?{'count':_0x2725ec,'rows':_0x1b4961}:null;}})[_0x3b82('0x2b')](respondWithResult(_0x510f4d,null))[_0x3b82('0x47')](handleError(_0x510f4d,null));};
\ No newline at end of file
+var _0xc075=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','stack','name','send','index','map','WhatsappQueue','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','keys','rawAttributes','intersection','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','pick','UserWhatsappQueue','UserId','whatsappPause','updatedAt','createdAt','format','getTeams','Team','options','ids','User','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','all','value','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x4be804,_0x2832c4){var _0xb65220=function(_0xd9c511){while(--_0xd9c511){_0x4be804['push'](_0x4be804['shift']());}};_0xb65220(++_0x2832c4);}(_0xc075,0x7f));var _0x5c07=function(_0x5c97fc,_0x329bcb){_0x5c97fc=_0x5c97fc-0x0;var _0x22156f=_0xc075[_0x5c97fc];return _0x22156f;};'use strict';var emlformat=require(_0x5c07('0x0'));var rimraf=require(_0x5c07('0x1'));var zipdir=require(_0x5c07('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c07('0x3'));var moment=require(_0x5c07('0x4'));var BPromise=require(_0x5c07('0x5'));var Mustache=require(_0x5c07('0x6'));var util=require(_0x5c07('0x7'));var path=require(_0x5c07('0x8'));var sox=require(_0x5c07('0x9'));var csv=require('to-csv');var ejs=require(_0x5c07('0xa'));var fs=require('fs');var fs_extra=require(_0x5c07('0xb'));var _=require(_0x5c07('0xc'));var squel=require(_0x5c07('0xd'));var crypto=require('crypto');var jsforce=require(_0x5c07('0xe'));var deskjs=require(_0x5c07('0xf'));var toCsv=require(_0x5c07('0x10'));var querystring=require('querystring');var Papa=require(_0x5c07('0x11'));var Redis=require(_0x5c07('0x12'));var authService=require(_0x5c07('0x13'));var qs=require(_0x5c07('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c07('0x15'));var logger=require(_0x5c07('0x16'))(_0x5c07('0x17'));var utils=require('../../config/utils');var config=require(_0x5c07('0x18'));var licenseUtil=require(_0x5c07('0x19'));var db=require(_0x5c07('0x1a'))['db'];config[_0x5c07('0x1b')]=_[_0x5c07('0x1c')](config[_0x5c07('0x1b')],{'host':_0x5c07('0x1d'),'port':0x18eb});var socket=require(_0x5c07('0x1e'))(new Redis(config[_0x5c07('0x1b')]));require(_0x5c07('0x1f'))[_0x5c07('0x20')](socket);function respondWithStatusCode(_0x342a44,_0xba7096){_0xba7096=_0xba7096||0xcc;return function(_0x6b6e8e){if(_0x6b6e8e){return _0x342a44['sendStatus'](_0xba7096);}return _0x342a44['status'](_0xba7096)[_0x5c07('0x21')]();};}function respondWithResult(_0x18f94c,_0x28586b){_0x28586b=_0x28586b||0xc8;return function(_0x9fb7a4){if(_0x9fb7a4){return _0x18f94c[_0x5c07('0x22')](_0x28586b)[_0x5c07('0x23')](_0x9fb7a4);}};}function respondWithFilteredResult(_0x2ef3e8,_0x74f0ea){return function(_0x1c94bf){if(_0x1c94bf){var _0x4abcf7=typeof _0x74f0ea[_0x5c07('0x24')]==='undefined'&&typeof _0x74f0ea[_0x5c07('0x25')]===_0x5c07('0x26');var _0x4505a7=_0x1c94bf['count'];var _0x2e163d=_0x4abcf7?0x0:_0x74f0ea[_0x5c07('0x24')];var _0x4f3498=_0x4abcf7?_0x1c94bf[_0x5c07('0x27')]:_0x74f0ea[_0x5c07('0x24')]+_0x74f0ea['limit'];var _0x42887c;if(_0x4f3498>=_0x4505a7){_0x4f3498=_0x4505a7;_0x42887c=0xc8;}else{_0x42887c=0xce;}_0x2ef3e8['status'](_0x42887c);return _0x2ef3e8[_0x5c07('0x28')](_0x5c07('0x29'),_0x2e163d+'-'+_0x4f3498+'/'+_0x4505a7)[_0x5c07('0x23')](_0x1c94bf);}return null;};}function patchUpdates(_0x5a82c8){return function(_0x333b76){try{jsonpatch[_0x5c07('0x2a')](_0x333b76,_0x5a82c8,!![]);}catch(_0x3d7ebd){return BPromise['reject'](_0x3d7ebd);}return _0x333b76[_0x5c07('0x2b')]();};}function saveUpdates(_0x50c983,_0xcd9bf1){return function(_0x28bb92){if(_0x28bb92){return _0x28bb92[_0x5c07('0x2c')](_0x50c983)[_0x5c07('0x2d')](function(_0x30f2ed){return _0x30f2ed;});}return null;};}function removeEntity(_0x4c3a7a,_0x140cbb){return function(_0x49286c){if(_0x49286c){return _0x49286c[_0x5c07('0x2e')]()[_0x5c07('0x2d')](function(){var _0x5105d=_0x49286c[_0x5c07('0x2f')]({'plain':!![]});var _0x39de8a=_0x5c07('0x30');return db[_0x5c07('0x31')][_0x5c07('0x2e')]({'where':{'type':_0x39de8a,'resourceId':_0x5105d['id']}})['then'](function(){return _0x49286c;});})[_0x5c07('0x2d')](function(){_0x4c3a7a[_0x5c07('0x22')](0xcc)[_0x5c07('0x21')]();});}};}function handleEntityNotFound(_0x31f3ce,_0x17a363){return function(_0x527d73){if(!_0x527d73){_0x31f3ce['sendStatus'](0x194);}return _0x527d73;};}function handleError(_0x5e54e4,_0x3ddd5d){_0x3ddd5d=_0x3ddd5d||0x1f4;return function(_0x4da2bb){logger['error'](_0x4da2bb[_0x5c07('0x32')]);if(_0x4da2bb[_0x5c07('0x33')]){delete _0x4da2bb[_0x5c07('0x33')];}_0x5e54e4[_0x5c07('0x22')](_0x3ddd5d)[_0x5c07('0x34')](_0x4da2bb);};}exports[_0x5c07('0x35')]=function(_0x40a9e8,_0x506650){var _0x2504c7={},_0x57b9d8={},_0x53f693={'count':0x0,'rows':[]};var _0x3daee4=_[_0x5c07('0x36')](db[_0x5c07('0x37')]['rawAttributes'],function(_0x11daa5){return{'name':_0x11daa5['fieldName'],'type':_0x11daa5[_0x5c07('0x38')][_0x5c07('0x39')]};});_0x57b9d8[_0x5c07('0x3a')]=_[_0x5c07('0x36')](_0x3daee4,'name');_0x57b9d8['query']=_['keys'](_0x40a9e8[_0x5c07('0x3b')]);_0x57b9d8['filters']=_['intersection'](_0x57b9d8['model'],_0x57b9d8[_0x5c07('0x3b')]);_0x2504c7[_0x5c07('0x3c')]=_['intersection'](_0x57b9d8['model'],qs['fields'](_0x40a9e8[_0x5c07('0x3b')][_0x5c07('0x3d')]));_0x2504c7['attributes']=_0x2504c7['attributes'][_0x5c07('0x3e')]?_0x2504c7[_0x5c07('0x3c')]:_0x57b9d8[_0x5c07('0x3a')];if(!_0x40a9e8[_0x5c07('0x3b')][_0x5c07('0x3f')](_0x5c07('0x40'))){_0x2504c7[_0x5c07('0x25')]=qs[_0x5c07('0x25')](_0x40a9e8[_0x5c07('0x3b')][_0x5c07('0x25')]);_0x2504c7[_0x5c07('0x24')]=qs[_0x5c07('0x24')](_0x40a9e8[_0x5c07('0x3b')][_0x5c07('0x24')]);}_0x2504c7[_0x5c07('0x41')]=qs[_0x5c07('0x42')](_0x40a9e8[_0x5c07('0x3b')][_0x5c07('0x42')]);_0x2504c7['where']=qs['filters'](_['pick'](_0x40a9e8[_0x5c07('0x3b')],_0x57b9d8[_0x5c07('0x43')]),_0x3daee4);if(_0x40a9e8[_0x5c07('0x3b')]['filter']){_0x2504c7[_0x5c07('0x44')]=_[_0x5c07('0x45')](_0x2504c7[_0x5c07('0x44')],{'$or':_[_0x5c07('0x36')](_0x3daee4,function(_0x5a701a){if(_0x5a701a[_0x5c07('0x38')]!==_0x5c07('0x46')){var _0x43eae1={};_0x43eae1[_0x5a701a[_0x5c07('0x33')]]={'$like':'%'+_0x40a9e8[_0x5c07('0x3b')][_0x5c07('0x47')]+'%'};return _0x43eae1;}})});}_0x2504c7=_[_0x5c07('0x45')]({},_0x2504c7,_0x40a9e8['options']);var _0x400dbc={'where':_0x2504c7['where']};return db['WhatsappQueue'][_0x5c07('0x27')](_0x400dbc)[_0x5c07('0x2d')](function(_0x38a6e2){_0x53f693[_0x5c07('0x27')]=_0x38a6e2;if(_0x40a9e8[_0x5c07('0x3b')][_0x5c07('0x48')]){_0x2504c7[_0x5c07('0x49')]=[{'all':!![]}];}return db[_0x5c07('0x37')][_0x5c07('0x4a')](_0x2504c7);})['then'](function(_0x559dbb){_0x53f693['rows']=_0x559dbb;return _0x53f693;})[_0x5c07('0x2d')](respondWithFilteredResult(_0x506650,_0x2504c7))[_0x5c07('0x4b')](handleError(_0x506650,null));};exports[_0x5c07('0x4c')]=function(_0x3b7f09,_0x46dcd7){var _0x43d9a0={'raw':!![],'where':{'id':_0x3b7f09[_0x5c07('0x4d')]['id']}},_0x512cef={};_0x512cef[_0x5c07('0x3a')]=_[_0x5c07('0x4e')](db[_0x5c07('0x37')][_0x5c07('0x4f')]);_0x512cef[_0x5c07('0x3b')]=_[_0x5c07('0x4e')](_0x3b7f09['query']);_0x512cef[_0x5c07('0x43')]=_[_0x5c07('0x50')](_0x512cef['model'],_0x512cef[_0x5c07('0x3b')]);_0x43d9a0['attributes']=_[_0x5c07('0x50')](_0x512cef[_0x5c07('0x3a')],qs[_0x5c07('0x3d')](_0x3b7f09[_0x5c07('0x3b')][_0x5c07('0x3d')]));_0x43d9a0[_0x5c07('0x3c')]=_0x43d9a0['attributes']['length']?_0x43d9a0[_0x5c07('0x3c')]:_0x512cef[_0x5c07('0x3a')];if(_0x3b7f09['query'][_0x5c07('0x48')]){_0x43d9a0[_0x5c07('0x49')]=[{'all':!![]}];}_0x43d9a0=_[_0x5c07('0x45')]({},_0x43d9a0,_0x3b7f09['options']);return db['WhatsappQueue']['find'](_0x43d9a0)['then'](handleEntityNotFound(_0x46dcd7,null))[_0x5c07('0x2d')](respondWithResult(_0x46dcd7,null))[_0x5c07('0x4b')](handleError(_0x46dcd7,null));};exports[_0x5c07('0x51')]=function(_0x135cb1,_0x4cf666){return db['WhatsappQueue'][_0x5c07('0x51')](_0x135cb1['body'],{})[_0x5c07('0x2d')](function(_0x4ac790){var _0x4e054e=_0x135cb1['user'][_0x5c07('0x2f')]({'plain':!![]});if(!_0x4e054e)throw new Error(_0x5c07('0x52'));if(_0x4e054e[_0x5c07('0x53')]===_0x5c07('0x54')){var _0x543543=_0x4ac790[_0x5c07('0x2f')]({'plain':!![]});var _0xbde3ac=_0x5c07('0x30');return db[_0x5c07('0x55')][_0x5c07('0x56')]({'where':{'name':_0xbde3ac,'userProfileId':_0x4e054e['userProfileId']},'raw':!![]})[_0x5c07('0x2d')](function(_0x37a11c){if(_0x37a11c&&_0x37a11c[_0x5c07('0x57')]===0x0){return db[_0x5c07('0x31')][_0x5c07('0x51')]({'name':_0x543543['name'],'resourceId':_0x543543['id'],'type':_0x37a11c[_0x5c07('0x33')],'sectionId':_0x37a11c['id']},{})[_0x5c07('0x2d')](function(){return _0x4ac790;});}else{return _0x4ac790;}})[_0x5c07('0x4b')](function(_0x15d6a6){logger['error'](_0x5c07('0x58'),_0x15d6a6);throw _0x15d6a6;});}return _0x4ac790;})[_0x5c07('0x2d')](respondWithResult(_0x4cf666,0xc9))[_0x5c07('0x4b')](handleError(_0x4cf666,null));};exports[_0x5c07('0x2c')]=function(_0x25e6f3,_0x86ce60){if(_0x25e6f3[_0x5c07('0x59')]['id']){delete _0x25e6f3['body']['id'];}return db[_0x5c07('0x37')]['find']({'where':{'id':_0x25e6f3[_0x5c07('0x4d')]['id']}})[_0x5c07('0x2d')](handleEntityNotFound(_0x86ce60,null))[_0x5c07('0x2d')](saveUpdates(_0x25e6f3['body'],null))['then'](respondWithResult(_0x86ce60,null))[_0x5c07('0x4b')](handleError(_0x86ce60,null));};exports['destroy']=function(_0x11ec0,_0x4d69e8){return db['WhatsappQueue'][_0x5c07('0x56')]({'where':{'id':_0x11ec0[_0x5c07('0x4d')]['id']}})[_0x5c07('0x2d')](handleEntityNotFound(_0x4d69e8,null))['then'](removeEntity(_0x4d69e8,null))[_0x5c07('0x4b')](handleError(_0x4d69e8,null));};exports[_0x5c07('0x5a')]=function(_0x5c8a91,_0x23ee27){return db[_0x5c07('0x37')][_0x5c07('0x5a')]()['then'](respondWithResult(_0x23ee27,null))[_0x5c07('0x4b')](handleError(_0x23ee27,null));};exports['getMembers']=function(_0x42a013,_0x23ec05,_0x5635c3){var _0x685d95={'raw':!![],'where':{}},_0x1190fb={},_0x323e81;return db[_0x5c07('0x37')][_0x5c07('0x5b')]({'where':{'id':_0x42a013[_0x5c07('0x4d')]['id']}})[_0x5c07('0x2d')](handleEntityNotFound(_0x23ec05,null))[_0x5c07('0x2d')](function(_0x4bd768){if(_0x4bd768){_0x323e81=_0x4bd768[_0x5c07('0x2f')]({'plain':!![]});_0x1190fb['model']=_[_0x5c07('0x4e')](db['UserWhatsappQueue'][_0x5c07('0x4f')]);_0x1190fb[_0x5c07('0x3b')]=_['keys'](_0x42a013[_0x5c07('0x3b')]);_0x1190fb[_0x5c07('0x43')]=_[_0x5c07('0x50')](_0x1190fb[_0x5c07('0x3a')],_0x1190fb[_0x5c07('0x3b')]);_0x685d95[_0x5c07('0x3c')]=_['intersection'](_0x1190fb['model'],qs[_0x5c07('0x3d')](_0x42a013['query'][_0x5c07('0x3d')]));_0x685d95[_0x5c07('0x3c')]=_0x685d95[_0x5c07('0x3c')][_0x5c07('0x3e')]?_0x685d95[_0x5c07('0x3c')]:_0x1190fb['model'];if(!_0x42a013['query'][_0x5c07('0x3f')]('nolimit')){_0x685d95[_0x5c07('0x25')]=qs['limit'](_0x42a013['query'][_0x5c07('0x25')]);_0x685d95['offset']=qs[_0x5c07('0x24')](_0x42a013[_0x5c07('0x3b')]['offset']);}_0x685d95['order']=qs['sort'](_0x42a013[_0x5c07('0x3b')][_0x5c07('0x42')]);_0x685d95[_0x5c07('0x44')]=qs[_0x5c07('0x43')](_[_0x5c07('0x5c')](_0x42a013[_0x5c07('0x3b')],_0x1190fb[_0x5c07('0x43')]));_0x685d95[_0x5c07('0x44')]['WhatsappQueueId']=_0x4bd768['id'];if(_0x42a013['query'][_0x5c07('0x47')]){_0x685d95[_0x5c07('0x44')]=_[_0x5c07('0x45')](_0x685d95[_0x5c07('0x44')],{'$or':_['map'](_0x685d95[_0x5c07('0x3c')],function(_0x394402){var _0x38646b={};_0x38646b[_0x394402]={'$like':'%'+_0x42a013[_0x5c07('0x3b')]['filter']+'%'};return _0x38646b;})});}_0x685d95=_[_0x5c07('0x45')]({},_0x685d95,_0x42a013['options']);return db[_0x5c07('0x5d')][_0x5c07('0x4a')](_0x685d95);}})[_0x5c07('0x2d')](function(_0x3f23c2){if(_0x3f23c2){return db['User']['findAndCountAll']({'where':{'id':_[_0x5c07('0x36')](_0x3f23c2,_0x5c07('0x5e')),'role':'agent'},'attributes':['id',_0x5c07('0x33'),_0x5c07('0x5f'),_0x5c07('0x60'),_0x5c07('0x61')]});}})[_0x5c07('0x2d')](function(_0x2f8b9c){if(_0x2f8b9c){return{'count':_0x2f8b9c[_0x5c07('0x27')],'rows':_[_0x5c07('0x36')](_0x2f8b9c['rows'],function(_0x2302eb){return{'membername':_0x2302eb[_0x5c07('0x33')],'UserId':_0x2302eb['id'],'queue_name':_0x323e81[_0x5c07('0x33')],'WhatsappQueueId':_0x323e81['id'],'interface':util[_0x5c07('0x62')]('%s/%s','SIP',_0x2302eb['name']),'penalty':0x0,'paused':_0x2302eb['whatsappPause'],'createdAt':_0x2302eb[_0x5c07('0x61')],'updatedAt':_0x2302eb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5c07('0x2d')](respondWithFilteredResult(_0x23ec05,_0x685d95))[_0x5c07('0x4b')](handleError(_0x23ec05,null));};exports[_0x5c07('0x63')]=function(_0x2134a9,_0x355f29,_0x5be8ea){var _0x3f57f5={};var _0x519e21={};var _0x30ee6d;var _0x43b298;return db['WhatsappQueue'][_0x5c07('0x5b')]({'where':{'id':_0x2134a9[_0x5c07('0x4d')]['id']}})['then'](handleEntityNotFound(_0x355f29,null))[_0x5c07('0x2d')](function(_0x63711c){if(_0x63711c){_0x30ee6d=_0x63711c;_0x519e21[_0x5c07('0x3a')]=_[_0x5c07('0x4e')](db[_0x5c07('0x64')][_0x5c07('0x4f')]);_0x519e21[_0x5c07('0x3b')]=_[_0x5c07('0x4e')](_0x2134a9[_0x5c07('0x3b')]);_0x519e21[_0x5c07('0x43')]=_[_0x5c07('0x50')](_0x519e21['model'],_0x519e21[_0x5c07('0x3b')]);_0x3f57f5['attributes']=_[_0x5c07('0x50')](_0x519e21[_0x5c07('0x3a')],qs['fields'](_0x2134a9[_0x5c07('0x3b')]['fields']));_0x3f57f5[_0x5c07('0x3c')]=_0x3f57f5['attributes'][_0x5c07('0x3e')]?_0x3f57f5[_0x5c07('0x3c')]:_0x519e21[_0x5c07('0x3a')];_0x3f57f5[_0x5c07('0x41')]=qs[_0x5c07('0x42')](_0x2134a9[_0x5c07('0x3b')][_0x5c07('0x42')]);_0x3f57f5[_0x5c07('0x44')]=qs[_0x5c07('0x43')](_['pick'](_0x2134a9['query'],_0x519e21[_0x5c07('0x43')]));if(_0x2134a9[_0x5c07('0x3b')][_0x5c07('0x47')]){_0x3f57f5[_0x5c07('0x44')]=_[_0x5c07('0x45')](_0x3f57f5[_0x5c07('0x44')],{'$or':_[_0x5c07('0x36')](_0x3f57f5['attributes'],function(_0xb6a650){var _0x47ac87={};_0x47ac87[_0xb6a650]={'$like':'%'+_0x2134a9[_0x5c07('0x3b')][_0x5c07('0x47')]+'%'};return _0x47ac87;})});}_0x3f57f5=_['merge']({},_0x3f57f5,_0x2134a9[_0x5c07('0x65')]);return _0x30ee6d['getTeams'](_0x3f57f5);}})[_0x5c07('0x2d')](function(_0x44ebfa){if(_0x44ebfa){_0x43b298=_0x44ebfa[_0x5c07('0x3e')];if(!_0x2134a9[_0x5c07('0x3b')][_0x5c07('0x3f')](_0x5c07('0x40'))){_0x3f57f5['limit']=qs[_0x5c07('0x25')](_0x2134a9[_0x5c07('0x3b')]['limit']);_0x3f57f5[_0x5c07('0x24')]=qs[_0x5c07('0x24')](_0x2134a9[_0x5c07('0x3b')]['offset']);}return _0x30ee6d[_0x5c07('0x63')](_0x3f57f5);}})[_0x5c07('0x2d')](function(_0x15c75d){if(_0x15c75d){return _0x15c75d?{'count':_0x43b298,'rows':_0x15c75d}:null;}})[_0x5c07('0x2d')](respondWithResult(_0x355f29,null))[_0x5c07('0x4b')](handleError(_0x355f29,null));};exports['addTeams']=function(_0x264f07,_0x327c41,_0x133b58){var _0x1655a0=_0x264f07[_0x5c07('0x59')][_0x5c07('0x66')];return db[_0x5c07('0x64')][_0x5c07('0x4a')]({'where':{'id':_0x1655a0},'attributes':['id'],'include':[{'model':db[_0x5c07('0x67')],'as':'Agents','attributes':['id',_0x5c07('0x33'),_0x5c07('0x68'),_0x5c07('0x69'),_0x5c07('0x6a')],'raw':!![]}]})[_0x5c07('0x2d')](function(_0x78457a){if(_0x78457a){var _0x56ec70=_[_0x5c07('0x6b')](_0x78457a,function(_0x44d3d8){var _0x9b2870=_0x44d3d8[_0x5c07('0x2f')]({'plain':!![]});return _0x9b2870['Agents'];});return db[_0x5c07('0x37')]['find']({'where':{'id':_0x264f07[_0x5c07('0x4d')]['id']}})[_0x5c07('0x2d')](function(_0x503c36){return db[_0x5c07('0x6c')][_0x5c07('0x6d')](function(_0x10bf7b){return _0x503c36[_0x5c07('0x6e')](_0x1655a0,{'transaction':_0x10bf7b})['then'](function(){return BPromise[_0x5c07('0x6f')](_0x56ec70,function(_0x52f484){return db[_0x5c07('0x5d')][_0x5c07('0x70')]({'where':{'UserId':_0x52f484['id'],'WhatsappQueueId':_0x264f07[_0x5c07('0x4d')]['id']},'transaction':_0x10bf7b});});})[_0x5c07('0x2d')](function(){_0x56ec70['forEach'](function(_0x2f86bb){socket[_0x5c07('0x71')](_0x5c07('0x72'),{'UserId':_0x2f86bb['id'],'WhatsappQueueId':_0x503c36['id']});});});});});}})[_0x5c07('0x2d')](respondWithStatusCode(_0x327c41,null))[_0x5c07('0x4b')](handleError(_0x327c41,null));};exports[_0x5c07('0x73')]=function(_0x2f3bb1,_0x52e006,_0xe94669){return db[_0x5c07('0x64')][_0x5c07('0x4a')]({'where':{'id':_0x2f3bb1[_0x5c07('0x3b')][_0x5c07('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5c07('0x74'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x52e006,null))[_0x5c07('0x2d')](function(_0x55651a){var _0x4197cf=_['map'](_0x55651a,'id');var _0x308701=[];var _0x38df05=[];var _0x2a72f8=squel[_0x5c07('0x75')]();_0x2a72f8[_0x5c07('0x76')](_0x5c07('0x77'))[_0x5c07('0x78')](_0x5c07('0x79'),'tq')[_0x5c07('0x7a')](_0x5c07('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5c07('0x44')](_0x5c07('0x7c'),_0x2f3bb1['params']['id']);for(var _0x4fda38=0x0;_0x4fda38<_0x55651a['length'];_0x4fda38+=0x1){let _0x1249bf=_0x55651a[_0x4fda38];for(var _0x374550=0x0;_0x374550<_0x1249bf[_0x5c07('0x74')]['length'];_0x374550+=0x1){let _0x3fc5d6=_0x1249bf[_0x5c07('0x74')][_0x374550];var _0x5c6030=_0x2a72f8[_0x5c07('0x7d')]();_0x5c6030['where'](_0x5c07('0x7e'),_0x3fc5d6['id']);_0x38df05['push'](db[_0x5c07('0x6c')]['query'](_0x5c6030[_0x5c07('0x7f')](),{'type':db[_0x5c07('0x6c')]['QueryTypes'][_0x5c07('0x80')]})['then'](function(_0x365685){if(_0x365685[_0x5c07('0x3e')]===0x1){return _0x3fc5d6['id'];}else{var _0x4fa4ed=_[_0x5c07('0x81')](_[_0x5c07('0x36')](_0x365685,'TeamId'),function(_0x57100b){return _[_0x5c07('0x82')](_0x4197cf,_0x57100b);});if(_0x4fa4ed){return _0x3fc5d6['id'];}}}));}}return BPromise[_0x5c07('0x83')](_0x38df05)[_0x5c07('0x2d')](function(_0x52ad46){_0x308701=_(_0x308701)['union'](_0x52ad46)['compact']()[_0x5c07('0x84')]();return db[_0x5c07('0x37')][_0x5c07('0x56')]({'where':{'id':_0x2f3bb1[_0x5c07('0x4d')]['id']}})[_0x5c07('0x2d')](function(_0x38b78b){return db[_0x5c07('0x6c')][_0x5c07('0x6d')](function(_0x13802e){return _0x38b78b[_0x5c07('0x73')](_0x2f3bb1[_0x5c07('0x3b')][_0x5c07('0x66')],{'transaction':_0x13802e})['then'](function(){if(!_['isEmpty'](_0x308701)){return _0x38b78b[_0x5c07('0x85')](_0x308701,{'transaction':_0x13802e});}})[_0x5c07('0x2d')](function(){_0x308701[_0x5c07('0x86')](function(_0x5c20bb){socket[_0x5c07('0x71')](_0x5c07('0x87'),{'UserId':_0x5c20bb,'WhatsappQueueId':_0x38b78b['id']});});});});});});})[_0x5c07('0x2d')](respondWithStatusCode(_0x52e006,null))[_0x5c07('0x4b')](handleError(_0x52e006,null));};exports[_0x5c07('0x88')]=function(_0x5fab9b,_0x4dd65d,_0x50602c){return db[_0x5c07('0x37')][_0x5c07('0x56')]({'where':{'id':_0x5fab9b['params']['id']}})[_0x5c07('0x2d')](handleEntityNotFound(_0x4dd65d,null))[_0x5c07('0x2d')](function(_0x131764){if(_0x131764){return _0x131764['addAgents'](_0x5fab9b[_0x5c07('0x59')][_0x5c07('0x66')],_[_0x5c07('0x89')](_0x5fab9b[_0x5c07('0x59')],[_0x5c07('0x66'),'id'])||{})[_0x5c07('0x8a')](function(_0x13f29e){for(var _0x49c1a3=0x0;_0x49c1a3<_0x5fab9b[_0x5c07('0x59')][_0x5c07('0x66')][_0x5c07('0x3e')];_0x49c1a3+=0x1){socket[_0x5c07('0x71')](_0x5c07('0x72'),{'UserId':Number(_0x5fab9b[_0x5c07('0x59')]['ids'][_0x49c1a3]),'WhatsappQueueId':Number(_0x5fab9b[_0x5c07('0x4d')]['id'])});}return _0x13f29e;});}})['then'](respondWithResult(_0x4dd65d,null))[_0x5c07('0x4b')](handleError(_0x4dd65d,null));};exports[_0x5c07('0x85')]=function(_0x6dc7f4,_0x5cb8e6,_0x392aed){return db[_0x5c07('0x37')][_0x5c07('0x56')]({'where':{'id':_0x6dc7f4[_0x5c07('0x4d')]['id']}})[_0x5c07('0x2d')](handleEntityNotFound(_0x5cb8e6,null))[_0x5c07('0x2d')](function(_0x162bb6){if(_0x162bb6){return _0x162bb6[_0x5c07('0x85')](_0x6dc7f4[_0x5c07('0x3b')][_0x5c07('0x66')])[_0x5c07('0x2d')](function(){if(_[_0x5c07('0x8b')](_0x6dc7f4['query'][_0x5c07('0x66')])){for(var _0x49229b=0x0;_0x49229b<_0x6dc7f4[_0x5c07('0x3b')][_0x5c07('0x66')][_0x5c07('0x3e')];_0x49229b+=0x1){socket[_0x5c07('0x71')](_0x5c07('0x87'),{'UserId':Number(_0x6dc7f4[_0x5c07('0x3b')][_0x5c07('0x66')][_0x49229b]),'WhatsappQueueId':Number(_0x6dc7f4['params']['id'])});}}else{socket[_0x5c07('0x71')]('userWhatsappQueue:remove',{'UserId':Number(_0x6dc7f4[_0x5c07('0x3b')][_0x5c07('0x66')]),'WhatsappQueueId':Number(_0x6dc7f4['params']['id'])});}});}})[_0x5c07('0x2d')](respondWithStatusCode(_0x5cb8e6,null))[_0x5c07('0x4b')](handleError(_0x5cb8e6,null));};exports['getAgents']=function(_0x5572e2,_0x45536e,_0x531afd){var _0x10b8c0={};var _0x34e045={};var _0x1e6be3;var _0x2190f7;return db['WhatsappQueue'][_0x5c07('0x5b')]({'where':{'id':_0x5572e2[_0x5c07('0x4d')]['id']}})[_0x5c07('0x2d')](handleEntityNotFound(_0x45536e,null))[_0x5c07('0x2d')](function(_0x1c1591){if(_0x1c1591){_0x1e6be3=_0x1c1591;_0x34e045['model']=_[_0x5c07('0x4e')](db['User'][_0x5c07('0x4f')]);_0x34e045['query']=_[_0x5c07('0x4e')](_0x5572e2[_0x5c07('0x3b')]);_0x34e045[_0x5c07('0x43')]=_[_0x5c07('0x50')](_0x34e045[_0x5c07('0x3a')],_0x34e045[_0x5c07('0x3b')]);_0x10b8c0[_0x5c07('0x3c')]=_['intersection'](_0x34e045[_0x5c07('0x3a')],qs[_0x5c07('0x3d')](_0x5572e2['query'][_0x5c07('0x3d')]));_0x10b8c0[_0x5c07('0x3c')]=_0x10b8c0['attributes'][_0x5c07('0x3e')]?_0x10b8c0[_0x5c07('0x3c')]:_0x34e045[_0x5c07('0x3a')];_0x10b8c0[_0x5c07('0x41')]=qs[_0x5c07('0x42')](_0x5572e2[_0x5c07('0x3b')][_0x5c07('0x42')]);_0x10b8c0['where']=qs[_0x5c07('0x43')](_['pick'](_0x5572e2['query'],_0x34e045[_0x5c07('0x43')]));if(_0x5572e2[_0x5c07('0x3b')]['filter']){_0x10b8c0[_0x5c07('0x44')]=_['merge'](_0x10b8c0['where'],{'$or':_[_0x5c07('0x36')](_0x10b8c0[_0x5c07('0x3c')],function(_0x30e5d7){var _0x269143={};_0x269143[_0x30e5d7]={'$like':'%'+_0x5572e2[_0x5c07('0x3b')][_0x5c07('0x47')]+'%'};return _0x269143;})});}_0x10b8c0=_[_0x5c07('0x45')]({},_0x10b8c0,_0x5572e2['options']);return _0x1e6be3[_0x5c07('0x8c')](_0x10b8c0);}})[_0x5c07('0x2d')](function(_0x441299){if(_0x441299){_0x2190f7=_0x441299[_0x5c07('0x3e')];if(!_0x5572e2[_0x5c07('0x3b')][_0x5c07('0x3f')](_0x5c07('0x40'))){_0x10b8c0['limit']=qs['limit'](_0x5572e2[_0x5c07('0x3b')][_0x5c07('0x25')]);_0x10b8c0['offset']=qs[_0x5c07('0x24')](_0x5572e2[_0x5c07('0x3b')]['offset']);}return _0x1e6be3[_0x5c07('0x8c')](_0x10b8c0);}})[_0x5c07('0x2d')](function(_0x346c7f){if(_0x346c7f){return _0x346c7f?{'count':_0x2190f7,'rows':_0x346c7f}:null;}})[_0x5c07('0x2d')](respondWithResult(_0x45536e,null))[_0x5c07('0x4b')](handleError(_0x45536e,null));};
\ No newline at end of file
index 438111a..c64d766 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca69=['events','WhatsappQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xca69,0xe7));var _0x9ca6=function(_0x217a47,_0xfbd2d3){_0x217a47=_0x217a47-0x0;var _0x22ef5e=_0xca69[_0x217a47];return _0x22ef5e;};'use strict';var EventEmitter=require(_0x9ca6('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x9ca6('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x9ca6('0x2')](0x0);var events={'afterCreate':_0x9ca6('0x3'),'afterUpdate':_0x9ca6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x38d3bc){return function(_0xc02171,_0x4a533f,_0x1d2016){WhatsappQueueEvents[_0x9ca6('0x5')](_0x38d3bc+':'+_0xc02171['id'],_0xc02171);WhatsappQueueEvents['emit'](_0x38d3bc,_0xc02171);_0x1d2016(null);};}for(var e in events){if(events[_0x9ca6('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
+var _0x0e08=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x22b345,_0x4c576c){var _0x1fb039=function(_0x551d7f){while(--_0x551d7f){_0x22b345['push'](_0x22b345['shift']());}};_0x1fb039(++_0x4c576c);}(_0x0e08,0x163));var _0x80e0=function(_0x279236,_0x56ca3f){_0x279236=_0x279236-0x0;var _0x506df9=_0x0e08[_0x279236];return _0x506df9;};'use strict';var EventEmitter=require(_0x80e0('0x0'));var WhatsappQueue=require(_0x80e0('0x1'))['db'][_0x80e0('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x80e0('0x3')](0x0);var events={'afterCreate':_0x80e0('0x4'),'afterUpdate':_0x80e0('0x5'),'afterDestroy':_0x80e0('0x6')};function emitEvent(_0x259d00){return function(_0x2ac1bb,_0x82f7c5,_0x4d9fbd){WhatsappQueueEvents[_0x80e0('0x7')](_0x259d00+':'+_0x2ac1bb['id'],_0x2ac1bb);WhatsappQueueEvents['emit'](_0x259d00,_0x2ac1bb);_0x4d9fbd(null);};}for(var e in events){if(events[_0x80e0('0x8')](e)){var event=events[e];WhatsappQueue[_0x80e0('0x9')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
index 046ce14..4cd1f2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe489=['exports','WhatsappQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x24e364,_0x22c22c){var _0x3921b0=function(_0x4f15d9){while(--_0x4f15d9){_0x24e364['push'](_0x24e364['shift']());}};_0x3921b0(++_0x22c22c);}(_0xe489,0xd4));var _0x9e48=function(_0x409b90,_0x1806be){_0x409b90=_0x409b90-0x0;var _0x2e166e=_0xe489[_0x409b90];return _0x2e166e;};'use strict';var _=require(_0x9e48('0x0'));var util=require(_0x9e48('0x1'));var logger=require(_0x9e48('0x2'))(_0x9e48('0x3'));var moment=require('moment');var BPromise=require(_0x9e48('0x4'));var rp=require(_0x9e48('0x5'));var fs=require('fs');var path=require(_0x9e48('0x6'));var rimraf=require('rimraf');var config=require(_0x9e48('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0x9e48('0x8')]=function(_0x3f7a6e,_0x7e98d9){return _0x3f7a6e['define'](_0x9e48('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaef3=['path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','api','bluebird','request-promise'];(function(_0x3d7988,_0x44d93c){var _0x173dd2=function(_0xe98676){while(--_0xe98676){_0x3d7988['push'](_0x3d7988['shift']());}};_0x173dd2(++_0x44d93c);}(_0xaef3,0x167));var _0x3aef=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0xaef3[_0x33bcdb];return _0x18a9bf;};'use strict';var _=require(_0x3aef('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3aef('0x1'));var moment=require('moment');var BPromise=require(_0x3aef('0x2'));var rp=require(_0x3aef('0x3'));var fs=require('fs');var path=require(_0x3aef('0x4'));var rimraf=require(_0x3aef('0x5'));var config=require('../../config/environment');var attributes=require(_0x3aef('0x6'));module[_0x3aef('0x7')]=function(_0x44b300,_0x4c4518){return _0x44b300[_0x3aef('0x8')](_0x3aef('0x9'),attributes,{'tableName':_0x3aef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 78dc3b3..8b2c589 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcea3=['findAll','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowWhatsappQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','info','catch','GetWhatsappQueue','WhatsappQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcea3,0x116));var _0x3cea=function(_0x379294,_0x20f816){_0x379294=_0x379294-0x0;var _0x10be7a=_0xcea3[_0x379294];return _0x10be7a;};'use strict';var _=require(_0x3cea('0x0'));var util=require(_0x3cea('0x1'));var moment=require(_0x3cea('0x2'));var BPromise=require('bluebird');var rs=require(_0x3cea('0x3'));var fs=require('fs');var Redis=require(_0x3cea('0x4'));var db=require(_0x3cea('0x5'))['db'];var utils=require(_0x3cea('0x6'));var logger=require(_0x3cea('0x7'))('rpc');var config=require(_0x3cea('0x8'));var jayson=require(_0x3cea('0x9'));var client=jayson['client'][_0x3cea('0xa')]({'port':0x232a});config[_0x3cea('0xb')]=_[_0x3cea('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3cea('0xd'))(new Redis(config[_0x3cea('0xb')]));require(_0x3cea('0xe'))['register'](socket);function respondWithRpcPromise(_0x34935b,_0x3c7690,_0x2cec42){return new BPromise(function(_0x181c31,_0x43e3b7){return client['request'](_0x34935b,_0x2cec42)[_0x3cea('0xf')](function(_0x1bdb4b){logger['info'](_0x3cea('0x10'),_0x3c7690,_0x3cea('0x11'));logger[_0x3cea('0x12')](_0x3cea('0x13'),_0x3c7690,_0x3cea('0x11'),JSON['stringify'](_0x1bdb4b));if(_0x1bdb4b[_0x3cea('0x14')]){if(_0x1bdb4b[_0x3cea('0x14')]['code']===0x1f4){logger[_0x3cea('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x3c7690,_0x1bdb4b['error'][_0x3cea('0x15')]);return _0x43e3b7(_0x1bdb4b[_0x3cea('0x14')]['message']);}logger[_0x3cea('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x3c7690,_0x1bdb4b['error'][_0x3cea('0x15')]);return _0x181c31(_0x1bdb4b['error'][_0x3cea('0x15')]);}else{logger[_0x3cea('0x16')](_0x3cea('0x10'),_0x3c7690,'request\x20sent');_0x181c31(_0x1bdb4b['result'][_0x3cea('0x15')]);}})[_0x3cea('0x17')](function(_0x32972b){logger[_0x3cea('0x14')](_0x3cea('0x10'),_0x3c7690,_0x32972b);_0x43e3b7(_0x32972b);});});}exports[_0x3cea('0x18')]=function(_0x507e74){var _0x548466=this;return new Promise(function(_0x4601f1,_0x1a5ee2){return db[_0x3cea('0x19')][_0x3cea('0x1a')]({'raw':_0x507e74[_0x3cea('0x1b')]?_0x507e74[_0x3cea('0x1b')][_0x3cea('0x1c')]===undefined?!![]:![]:!![],'where':_0x507e74[_0x3cea('0x1b')]?_0x507e74[_0x3cea('0x1b')][_0x3cea('0x1d')]||null:null,'attributes':_0x507e74['options']?_0x507e74[_0x3cea('0x1b')][_0x3cea('0x1e')]||null:null,'limit':_0x507e74['options']?_0x507e74[_0x3cea('0x1b')][_0x3cea('0x1f')]||null:null,'include':_0x507e74['options']?_0x507e74[_0x3cea('0x1b')]['include']?_['map'](_0x507e74[_0x3cea('0x1b')][_0x3cea('0x20')],function(_0x345b81){return{'model':db[_0x345b81['model']],'as':_0x345b81['as'],'attributes':_0x345b81[_0x3cea('0x1e')],'include':_0x345b81['include']?_[_0x3cea('0x21')](_0x345b81[_0x3cea('0x20')],function(_0x32144c){return{'model':db[_0x32144c[_0x3cea('0x22')]],'as':_0x32144c['as'],'attributes':_0x32144c[_0x3cea('0x1e')],'include':_0x32144c[_0x3cea('0x20')]?_[_0x3cea('0x21')](_0x32144c['include'],function(_0x3f168f){return{'model':db[_0x3f168f[_0x3cea('0x22')]],'as':_0x3f168f['as'],'attributes':_0x3f168f['attributes']};}):[]};}):[]};}):[]:[]})[_0x3cea('0xf')](function(_0x2d6e08){logger[_0x3cea('0x16')]('GetWhatsappQueue',_0x507e74);logger[_0x3cea('0x12')](_0x3cea('0x18'),_0x507e74,JSON[_0x3cea('0x23')](_0x2d6e08));_0x4601f1(_0x2d6e08);})[_0x3cea('0x17')](function(_0x5ee9dd){logger[_0x3cea('0x14')](_0x3cea('0x18'),_0x5ee9dd[_0x3cea('0x15')],_0x507e74);_0x1a5ee2(_0x548466[_0x3cea('0x14')](0x1f4,_0x5ee9dd[_0x3cea('0x15')]));});});};exports['ShowWhatsappQueue']=function(_0x29120c){var _0x4e397e=this;return new Promise(function(_0x36708f,_0x385dd3){return db[_0x3cea('0x19')][_0x3cea('0x24')]({'raw':_0x29120c[_0x3cea('0x1b')]?_0x29120c[_0x3cea('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x29120c[_0x3cea('0x1b')]?_0x29120c[_0x3cea('0x1b')][_0x3cea('0x1d')]||null:null,'attributes':_0x29120c['options']?_0x29120c[_0x3cea('0x1b')][_0x3cea('0x1e')]||null:null,'include':_0x29120c['options']?_0x29120c[_0x3cea('0x1b')][_0x3cea('0x20')]?_[_0x3cea('0x21')](_0x29120c['options'][_0x3cea('0x20')],function(_0x25d5a5){return{'model':db[_0x25d5a5[_0x3cea('0x22')]],'as':_0x25d5a5['as'],'attributes':_0x25d5a5[_0x3cea('0x1e')],'include':_0x25d5a5[_0x3cea('0x20')]?_[_0x3cea('0x21')](_0x25d5a5[_0x3cea('0x20')],function(_0x3d5833){return{'model':db[_0x3d5833[_0x3cea('0x22')]],'as':_0x3d5833['as'],'attributes':_0x3d5833['attributes'],'include':_0x3d5833[_0x3cea('0x20')]?_[_0x3cea('0x21')](_0x3d5833[_0x3cea('0x20')],function(_0x8a7f14){return{'model':db[_0x8a7f14['model']],'as':_0x8a7f14['as'],'attributes':_0x8a7f14[_0x3cea('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3cea('0xf')](function(_0x2d5a22){logger[_0x3cea('0x16')](_0x3cea('0x25'),_0x29120c);logger[_0x3cea('0x12')](_0x3cea('0x25'),_0x29120c,JSON[_0x3cea('0x23')](_0x2d5a22));_0x36708f(_0x2d5a22);})[_0x3cea('0x17')](function(_0x209654){logger[_0x3cea('0x14')](_0x3cea('0x25'),_0x209654[_0x3cea('0x15')],_0x29120c);_0x385dd3(_0x4e397e['error'](0x1f4,_0x209654[_0x3cea('0x15')]));});});};
\ No newline at end of file
+var _0x07c6=['stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','catch','GetWhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','find','ShowWhatsappQueue','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','request\x20sent','debug'];(function(_0x13eab1,_0x313146){var _0x5e50d8=function(_0x183b8b){while(--_0x183b8b){_0x13eab1['push'](_0x13eab1['shift']());}};_0x5e50d8(++_0x313146);}(_0x07c6,0xf7));var _0x607c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x07c6[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x607c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x607c('0x1'));var rs=require(_0x607c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x607c('0x3'));var logger=require(_0x607c('0x4'))(_0x607c('0x5'));var config=require('../../config/environment');var jayson=require(_0x607c('0x6'));var client=jayson[_0x607c('0x7')][_0x607c('0x8')]({'port':0x232a});config[_0x607c('0x9')]=_[_0x607c('0xa')](config[_0x607c('0x9')],{'host':_0x607c('0xb'),'port':0x18eb});var socket=require(_0x607c('0xc'))(new Redis(config[_0x607c('0x9')]));require(_0x607c('0xd'))[_0x607c('0xe')](socket);function respondWithRpcPromise(_0x492e7b,_0x1de721,_0x322188){return new BPromise(function(_0x1a16cb,_0x202bad){return client[_0x607c('0xf')](_0x492e7b,_0x322188)['then'](function(_0x103836){logger[_0x607c('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x1de721,_0x607c('0x11'));logger[_0x607c('0x12')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x1de721,_0x607c('0x11'),JSON[_0x607c('0x13')](_0x103836));if(_0x103836[_0x607c('0x14')]){if(_0x103836[_0x607c('0x14')][_0x607c('0x15')]===0x1f4){logger[_0x607c('0x14')](_0x607c('0x16'),_0x1de721,_0x103836['error'][_0x607c('0x17')]);return _0x202bad(_0x103836[_0x607c('0x14')][_0x607c('0x17')]);}logger[_0x607c('0x14')](_0x607c('0x16'),_0x1de721,_0x103836[_0x607c('0x14')][_0x607c('0x17')]);return _0x1a16cb(_0x103836['error'][_0x607c('0x17')]);}else{logger['info'](_0x607c('0x16'),_0x1de721,_0x607c('0x11'));_0x1a16cb(_0x103836['result'][_0x607c('0x17')]);}})[_0x607c('0x18')](function(_0x55ec55){logger[_0x607c('0x14')](_0x607c('0x16'),_0x1de721,_0x55ec55);_0x202bad(_0x55ec55);});});}exports[_0x607c('0x19')]=function(_0x205ebc){var _0x402567=this;return new Promise(function(_0x393e5e,_0x3f298a){return db['WhatsappQueue'][_0x607c('0x1a')]({'raw':_0x205ebc[_0x607c('0x1b')]?_0x205ebc[_0x607c('0x1b')][_0x607c('0x1c')]===undefined?!![]:![]:!![],'where':_0x205ebc[_0x607c('0x1b')]?_0x205ebc['options'][_0x607c('0x1d')]||null:null,'attributes':_0x205ebc['options']?_0x205ebc['options'][_0x607c('0x1e')]||null:null,'limit':_0x205ebc[_0x607c('0x1b')]?_0x205ebc['options'][_0x607c('0x1f')]||null:null,'include':_0x205ebc['options']?_0x205ebc[_0x607c('0x1b')][_0x607c('0x20')]?_[_0x607c('0x21')](_0x205ebc['options'][_0x607c('0x20')],function(_0x5671b9){return{'model':db[_0x5671b9[_0x607c('0x22')]],'as':_0x5671b9['as'],'attributes':_0x5671b9['attributes'],'include':_0x5671b9[_0x607c('0x20')]?_[_0x607c('0x21')](_0x5671b9[_0x607c('0x20')],function(_0x37d3ff){return{'model':db[_0x37d3ff[_0x607c('0x22')]],'as':_0x37d3ff['as'],'attributes':_0x37d3ff[_0x607c('0x1e')],'include':_0x37d3ff[_0x607c('0x20')]?_[_0x607c('0x21')](_0x37d3ff['include'],function(_0xfbb8de){return{'model':db[_0xfbb8de['model']],'as':_0xfbb8de['as'],'attributes':_0xfbb8de[_0x607c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x607c('0x23')](function(_0x23b4d9){logger[_0x607c('0x10')](_0x607c('0x19'),_0x205ebc);logger[_0x607c('0x12')](_0x607c('0x19'),_0x205ebc,JSON['stringify'](_0x23b4d9));_0x393e5e(_0x23b4d9);})[_0x607c('0x18')](function(_0x50bba3){logger[_0x607c('0x14')](_0x607c('0x19'),_0x50bba3['message'],_0x205ebc);_0x3f298a(_0x402567[_0x607c('0x14')](0x1f4,_0x50bba3[_0x607c('0x17')]));});});};exports['ShowWhatsappQueue']=function(_0x3732ad){var _0x5e452c=this;return new Promise(function(_0x37a502,_0x1bdb49){return db['WhatsappQueue'][_0x607c('0x24')]({'raw':_0x3732ad[_0x607c('0x1b')]?_0x3732ad[_0x607c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3732ad[_0x607c('0x1b')]?_0x3732ad[_0x607c('0x1b')][_0x607c('0x1d')]||null:null,'attributes':_0x3732ad[_0x607c('0x1b')]?_0x3732ad['options']['attributes']||null:null,'include':_0x3732ad[_0x607c('0x1b')]?_0x3732ad[_0x607c('0x1b')]['include']?_[_0x607c('0x21')](_0x3732ad[_0x607c('0x1b')][_0x607c('0x20')],function(_0x1c4165){return{'model':db[_0x1c4165['model']],'as':_0x1c4165['as'],'attributes':_0x1c4165[_0x607c('0x1e')],'include':_0x1c4165['include']?_[_0x607c('0x21')](_0x1c4165[_0x607c('0x20')],function(_0x2d02c8){return{'model':db[_0x2d02c8[_0x607c('0x22')]],'as':_0x2d02c8['as'],'attributes':_0x2d02c8[_0x607c('0x1e')],'include':_0x2d02c8[_0x607c('0x20')]?_[_0x607c('0x21')](_0x2d02c8[_0x607c('0x20')],function(_0x22e6d1){return{'model':db[_0x22e6d1[_0x607c('0x22')]],'as':_0x22e6d1['as'],'attributes':_0x22e6d1[_0x607c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x607c('0x23')](function(_0x197821){logger['info'](_0x607c('0x25'),_0x3732ad);logger['debug']('ShowWhatsappQueue',_0x3732ad,JSON[_0x607c('0x13')](_0x197821));_0x37a502(_0x197821);})[_0x607c('0x18')](function(_0x3046fa){logger[_0x607c('0x14')](_0x607c('0x25'),_0x3046fa[_0x607c('0x17')],_0x3732ad);_0x1bdb49(_0x5e452c['error'](0x1f4,_0x3046fa[_0x607c('0x17')]));});});};
\ No newline at end of file
index c13c0d1..a7ddf8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5be5=['emit','removeListener','register','whatsappQueue:','save','update'];(function(_0x507227,_0x5015f8){var _0x5d1373=function(_0xf1fbd6){while(--_0xf1fbd6){_0x507227['push'](_0x507227['shift']());}};_0x5d1373(++_0x5015f8);}(_0x5be5,0x1ae));var _0x55be=function(_0x31df6f,_0x380e73){_0x31df6f=_0x31df6f-0x0;var _0x31e353=_0x5be5[_0x31df6f];return _0x31e353;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x55be('0x0'),'remove',_0x55be('0x1')];function createListener(_0x2c46b9,_0x42bb7d){return function(_0x570dc7){_0x42bb7d[_0x55be('0x2')](_0x2c46b9,_0x570dc7);};}function removeListener(_0x36bee4,_0xe157e5){return function(){WhatsappQueueEvents[_0x55be('0x3')](_0x36bee4,_0xe157e5);};}exports[_0x55be('0x4')]=function(_0x4f8c83){for(var _0x1650af=0x0,_0x40d65e=events['length'];_0x1650af<_0x40d65e;_0x1650af++){var _0x400550=events[_0x1650af];var _0x4c4c53=createListener(_0x55be('0x5')+_0x400550,_0x4f8c83);WhatsappQueueEvents['on'](_0x400550,_0x4c4c53);}};
\ No newline at end of file
+var _0x56ed=['register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener'];(function(_0x3c6768,_0xa7cb46){var _0x82eb81=function(_0x48f9b7){while(--_0x48f9b7){_0x3c6768['push'](_0x3c6768['shift']());}};_0x82eb81(++_0xa7cb46);}(_0x56ed,0x1e0));var _0xd56e=function(_0x302a64,_0x191bf6){_0x302a64=_0x302a64-0x0;var _0xc4c71e=_0x56ed[_0x302a64];return _0xc4c71e;};'use strict';var WhatsappQueueEvents=require(_0xd56e('0x0'));var events=[_0xd56e('0x1'),_0xd56e('0x2'),_0xd56e('0x3')];function createListener(_0x5e10c3,_0x203a03){return function(_0x588900){_0x203a03[_0xd56e('0x4')](_0x5e10c3,_0x588900);};}function removeListener(_0x413058,_0x564983){return function(){WhatsappQueueEvents[_0xd56e('0x5')](_0x413058,_0x564983);};}exports[_0xd56e('0x6')]=function(_0x1bef94){for(var _0x49a593=0x0,_0x25b76f=events[_0xd56e('0x7')];_0x49a593<_0x25b76f;_0x49a593++){var _0x42bd43=events[_0x49a593];var _0x460441=createListener(_0xd56e('0x8')+_0x42bd43,_0x1bef94);WhatsappQueueEvents['on'](_0x42bd43,_0x460441);}};
\ No newline at end of file
index cd0a56f..33e2af3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78c0=['describe','post','create','update','delete','/:id','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x78c0,0x70));var _0x078c=function(_0x4da78a,_0x4ca645){_0x4da78a=_0x4da78a-0x0;var _0x3d2f2b=_0x78c0[_0x4da78a];return _0x3d2f2b;};'use strict';var multer=require(_0x078c('0x0'));var util=require(_0x078c('0x1'));var path=require(_0x078c('0x2'));var timeout=require(_0x078c('0x3'));var express=require(_0x078c('0x4'));var router=express['Router']();var fs_extra=require(_0x078c('0x5'));var auth=require(_0x078c('0x6'));var interaction=require(_0x078c('0x7'));var config=require(_0x078c('0x8'));var controller=require(_0x078c('0x9'));router[_0x078c('0xa')]('/',auth[_0x078c('0xb')](),controller[_0x078c('0xc')]);router[_0x078c('0xa')](_0x078c('0xd'),auth['isAuthenticated'](),controller[_0x078c('0xe')]);router['get']('/:id',auth[_0x078c('0xb')](),controller['show']);router[_0x078c('0xf')]('/',auth[_0x078c('0xb')](),controller[_0x078c('0x10')]);router['put']('/:id',auth[_0x078c('0xb')](),controller[_0x078c('0x11')]);router[_0x078c('0x12')](_0x078c('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x078c('0x14')]=router;
\ No newline at end of file
+var _0x1d88=['exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0x1d88,0x99));var _0x81d8=function(_0x17b0ad,_0xc915b){_0x17b0ad=_0x17b0ad-0x0;var _0x35513b=_0x1d88[_0x17b0ad];return _0x35513b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x81d8('0x0'));var express=require(_0x81d8('0x1'));var router=express[_0x81d8('0x2')]();var fs_extra=require(_0x81d8('0x3'));var auth=require(_0x81d8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x81d8('0x5'));router[_0x81d8('0x6')]('/',auth[_0x81d8('0x7')](),controller[_0x81d8('0x8')]);router['get'](_0x81d8('0x9'),auth[_0x81d8('0x7')](),controller[_0x81d8('0xa')]);router[_0x81d8('0x6')]('/:id',auth[_0x81d8('0x7')](),controller['show']);router[_0x81d8('0xb')]('/',auth[_0x81d8('0x7')](),controller[_0x81d8('0xc')]);router[_0x81d8('0xd')](_0x81d8('0xe'),auth['isAuthenticated'](),controller[_0x81d8('0xf')]);router[_0x81d8('0x10')](_0x81d8('0xe'),auth['isAuthenticated'](),controller[_0x81d8('0x11')]);module[_0x81d8('0x12')]=router;
\ No newline at end of file
index a91e0fb..1a4b6ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x4087ff,_0x4313b4){var _0x48fd02=function(_0x594b98){while(--_0x594b98){_0x4087ff['push'](_0x4087ff['shift']());}};_0x48fd02(++_0x4313b4);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x36fe1e,_0x175199){var _0x3368ef=function(_0x74679f){while(--_0x74679f){_0x36fe1e['push'](_0x36fe1e['shift']());}};_0x3368ef(++_0x175199);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
index 9bf2bef..941c271 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff0=['length','include','body','find','describe','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','WhatsappQueueReport','includeAll','findAll','catch','params'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xfff0,0x139));var _0x0fff=function(_0x651139,_0x535680){_0x651139=_0x651139-0x0;var _0x1d6fce=_0xfff0[_0x651139];return _0x1d6fce;};'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 hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var licenseUtil=require(_0x0fff('0x17'));var db=require(_0x0fff('0x18'))['db'];function respondWithStatusCode(_0x13f768,_0x5abecd){_0x5abecd=_0x5abecd||0xcc;return function(_0x1fb243){if(_0x1fb243){return _0x13f768['sendStatus'](_0x5abecd);}return _0x13f768[_0x0fff('0x19')](_0x5abecd)[_0x0fff('0x1a')]();};}function respondWithResult(_0x38fc82,_0x2c0322){_0x2c0322=_0x2c0322||0xc8;return function(_0x55e5fa){if(_0x55e5fa){return _0x38fc82['status'](_0x2c0322)[_0x0fff('0x1b')](_0x55e5fa);}};}function respondWithFilteredResult(_0x50a9e4,_0x5636fd){return function(_0x51ceea){if(_0x51ceea){var _0x1fb430=typeof _0x5636fd[_0x0fff('0x1c')]==='undefined'&&typeof _0x5636fd[_0x0fff('0x1d')]===_0x0fff('0x1e');var _0x540a67=_0x51ceea['count'];var _0x48f36d=_0x1fb430?0x0:_0x5636fd[_0x0fff('0x1c')];var _0x606792=_0x1fb430?_0x51ceea[_0x0fff('0x1f')]:_0x5636fd[_0x0fff('0x1c')]+_0x5636fd[_0x0fff('0x1d')];var _0xe89b4a;if(_0x606792>=_0x540a67){_0x606792=_0x540a67;_0xe89b4a=0xc8;}else{_0xe89b4a=0xce;}_0x50a9e4['status'](_0xe89b4a);return _0x50a9e4[_0x0fff('0x20')](_0x0fff('0x21'),_0x48f36d+'-'+_0x606792+'/'+_0x540a67)[_0x0fff('0x1b')](_0x51ceea);}return null;};}function patchUpdates(_0x49d211){return function(_0x5e27df){try{jsonpatch[_0x0fff('0x22')](_0x5e27df,_0x49d211,!![]);}catch(_0x330e29){return BPromise[_0x0fff('0x23')](_0x330e29);}return _0x5e27df[_0x0fff('0x24')]();};}function saveUpdates(_0x502393,_0x155132){return function(_0x2f8665){if(_0x2f8665){return _0x2f8665[_0x0fff('0x25')](_0x502393)[_0x0fff('0x26')](function(_0x16e7f4){return _0x16e7f4;});}return null;};}function removeEntity(_0x17fba6,_0x580b8e){return function(_0x6a116c){if(_0x6a116c){return _0x6a116c[_0x0fff('0x27')]()[_0x0fff('0x26')](function(){_0x17fba6[_0x0fff('0x19')](0xcc)[_0x0fff('0x1a')]();});}};}function handleEntityNotFound(_0x23d9f8,_0x482e1e){return function(_0x2c9725){if(!_0x2c9725){_0x23d9f8[_0x0fff('0x28')](0x194);}return _0x2c9725;};}function handleError(_0x2d1610,_0x440f56){_0x440f56=_0x440f56||0x1f4;return function(_0x36d268){logger[_0x0fff('0x29')](_0x36d268[_0x0fff('0x2a')]);if(_0x36d268[_0x0fff('0x2b')]){delete _0x36d268[_0x0fff('0x2b')];}_0x2d1610[_0x0fff('0x19')](_0x440f56)[_0x0fff('0x2c')](_0x36d268);};}exports[_0x0fff('0x2d')]=function(_0x495734,_0x7046a3){var _0x2d1800={},_0x17ab6f={},_0x42441e={'count':0x0,'rows':[]};var _0x1f643d=_[_0x0fff('0x2e')](db['WhatsappQueueReport'][_0x0fff('0x2f')],function(_0xa16c29){return{'name':_0xa16c29[_0x0fff('0x30')],'type':_0xa16c29['type'][_0x0fff('0x31')]};});_0x17ab6f[_0x0fff('0x32')]=_['map'](_0x1f643d,_0x0fff('0x2b'));_0x17ab6f[_0x0fff('0x33')]=_[_0x0fff('0x34')](_0x495734[_0x0fff('0x33')]);_0x17ab6f[_0x0fff('0x35')]=_[_0x0fff('0x36')](_0x17ab6f[_0x0fff('0x32')],_0x17ab6f[_0x0fff('0x33')]);_0x2d1800[_0x0fff('0x37')]=_[_0x0fff('0x36')](_0x17ab6f['model'],qs[_0x0fff('0x38')](_0x495734[_0x0fff('0x33')][_0x0fff('0x38')]));_0x2d1800[_0x0fff('0x37')]=_0x2d1800[_0x0fff('0x37')]['length']?_0x2d1800['attributes']:_0x17ab6f[_0x0fff('0x32')];if(!_0x495734[_0x0fff('0x33')][_0x0fff('0x39')](_0x0fff('0x3a'))){_0x2d1800['limit']=qs[_0x0fff('0x1d')](_0x495734[_0x0fff('0x33')][_0x0fff('0x1d')]);_0x2d1800[_0x0fff('0x1c')]=qs['offset'](_0x495734[_0x0fff('0x33')][_0x0fff('0x1c')]);}_0x2d1800[_0x0fff('0x3b')]=qs[_0x0fff('0x3c')](_0x495734[_0x0fff('0x33')][_0x0fff('0x3c')]);_0x2d1800[_0x0fff('0x3d')]=qs[_0x0fff('0x35')](_[_0x0fff('0x3e')](_0x495734[_0x0fff('0x33')],_0x17ab6f[_0x0fff('0x35')]),_0x1f643d);if(_0x495734[_0x0fff('0x33')]['filter']){_0x2d1800[_0x0fff('0x3d')]=_[_0x0fff('0x3f')](_0x2d1800[_0x0fff('0x3d')],{'$or':_[_0x0fff('0x2e')](_0x1f643d,function(_0xd65638){if(_0xd65638[_0x0fff('0x40')]!=='VIRTUAL'){var _0x10ff9d={};_0x10ff9d[_0xd65638[_0x0fff('0x2b')]]={'$like':'%'+_0x495734[_0x0fff('0x33')][_0x0fff('0x41')]+'%'};return _0x10ff9d;}})});}_0x2d1800=_[_0x0fff('0x3f')]({},_0x2d1800,_0x495734[_0x0fff('0x42')]);var _0x3dc0b8={'where':_0x2d1800[_0x0fff('0x3d')]};return db[_0x0fff('0x43')]['count'](_0x3dc0b8)[_0x0fff('0x26')](function(_0x4d89c0){_0x42441e[_0x0fff('0x1f')]=_0x4d89c0;if(_0x495734[_0x0fff('0x33')][_0x0fff('0x44')]){_0x2d1800['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x0fff('0x45')](_0x2d1800);})[_0x0fff('0x26')](function(_0x311348){_0x42441e['rows']=_0x311348;return _0x42441e;})['then'](respondWithFilteredResult(_0x7046a3,_0x2d1800))[_0x0fff('0x46')](handleError(_0x7046a3,null));};exports['show']=function(_0xd6ebeb,_0x957265){var _0x8352c1={'raw':!![],'where':{'id':_0xd6ebeb[_0x0fff('0x47')]['id']}},_0x309d75={};_0x309d75[_0x0fff('0x32')]=_['keys'](db[_0x0fff('0x43')][_0x0fff('0x2f')]);_0x309d75[_0x0fff('0x33')]=_[_0x0fff('0x34')](_0xd6ebeb[_0x0fff('0x33')]);_0x309d75[_0x0fff('0x35')]=_[_0x0fff('0x36')](_0x309d75['model'],_0x309d75[_0x0fff('0x33')]);_0x8352c1[_0x0fff('0x37')]=_[_0x0fff('0x36')](_0x309d75['model'],qs[_0x0fff('0x38')](_0xd6ebeb[_0x0fff('0x33')][_0x0fff('0x38')]));_0x8352c1[_0x0fff('0x37')]=_0x8352c1[_0x0fff('0x37')][_0x0fff('0x48')]?_0x8352c1[_0x0fff('0x37')]:_0x309d75[_0x0fff('0x32')];if(_0xd6ebeb[_0x0fff('0x33')][_0x0fff('0x44')]){_0x8352c1[_0x0fff('0x49')]=[{'all':!![]}];}_0x8352c1=_['merge']({},_0x8352c1,_0xd6ebeb[_0x0fff('0x42')]);return db[_0x0fff('0x43')]['find'](_0x8352c1)[_0x0fff('0x26')](handleEntityNotFound(_0x957265,null))[_0x0fff('0x26')](respondWithResult(_0x957265,null))[_0x0fff('0x46')](handleError(_0x957265,null));};exports['create']=function(_0x502037,_0x2a0b10){return db['WhatsappQueueReport']['create'](_0x502037[_0x0fff('0x4a')],{})[_0x0fff('0x26')](respondWithResult(_0x2a0b10,0xc9))[_0x0fff('0x46')](handleError(_0x2a0b10,null));};exports[_0x0fff('0x25')]=function(_0x3b4b8e,_0x1a7677){if(_0x3b4b8e['body']['id']){delete _0x3b4b8e[_0x0fff('0x4a')]['id'];}return db[_0x0fff('0x43')][_0x0fff('0x4b')]({'where':{'id':_0x3b4b8e[_0x0fff('0x47')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x1a7677,null))[_0x0fff('0x26')](saveUpdates(_0x3b4b8e['body'],null))[_0x0fff('0x26')](respondWithResult(_0x1a7677,null))[_0x0fff('0x46')](handleError(_0x1a7677,null));};exports['destroy']=function(_0x1fc872,_0x4bae35){return db['WhatsappQueueReport']['find']({'where':{'id':_0x1fc872[_0x0fff('0x47')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x4bae35,null))[_0x0fff('0x26')](removeEntity(_0x4bae35,null))[_0x0fff('0x46')](handleError(_0x4bae35,null));};exports[_0x0fff('0x4c')]=function(_0x4bf98d,_0x2524ad){return db[_0x0fff('0x43')][_0x0fff('0x4c')]()[_0x0fff('0x26')](respondWithResult(_0x2524ad,null))[_0x0fff('0x46')](handleError(_0x2524ad,null));};
\ No newline at end of file
+var _0xac4a=['where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','create','body','describe','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','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5b7f53,_0x3bae76){var _0x596d28=function(_0x5a1cde){while(--_0x5a1cde){_0x5b7f53['push'](_0x5b7f53['shift']());}};_0x596d28(++_0x3bae76);}(_0xac4a,0x13f));var _0xaac4=function(_0x1bf75f,_0x140b59){_0x1bf75f=_0x1bf75f-0x0;var _0x5e0cd5=_0xac4a[_0x1bf75f];return _0x5e0cd5;};'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={},_0x16b33c={},_0xda10b6={'count':0x0,'rows':[]};var _0xb76ccc=_[_0xaac4('0x29')](db[_0xaac4('0x2a')]['rawAttributes'],function(_0xcf6c1){return{'name':_0xcf6c1['fieldName'],'type':_0xcf6c1[_0xaac4('0x2b')][_0xaac4('0x2c')]};});_0x16b33c[_0xaac4('0x2d')]=_[_0xaac4('0x29')](_0xb76ccc,'name');_0x16b33c['query']=_['keys'](_0x386c9b[_0xaac4('0x2e')]);_0x16b33c[_0xaac4('0x2f')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],_0x16b33c[_0xaac4('0x2e')]);_0x316445[_0xaac4('0x31')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x32')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x33')]?_0x316445[_0xaac4('0x31')]:_0x16b33c['model'];if(!_0x386c9b['query'][_0xaac4('0x34')](_0xaac4('0x35'))){_0x316445[_0xaac4('0x1a')]=qs['limit'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x1a')]);_0x316445[_0xaac4('0x18')]=qs[_0xaac4('0x18')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x18')]);}_0x316445[_0xaac4('0x36')]=qs['sort'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x316445[_0xaac4('0x38')]=qs['filters'](_[_0xaac4('0x39')](_0x386c9b['query'],_0x16b33c['filters']),_0xb76ccc);if(_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x3a')]){_0x316445[_0xaac4('0x38')]=_['merge'](_0x316445['where'],{'$or':_[_0xaac4('0x29')](_0xb76ccc,function(_0x33cc4){if(_0x33cc4[_0xaac4('0x2b')]!==_0xaac4('0x3b')){var _0x2b65b1={};_0x2b65b1[_0x33cc4[_0xaac4('0x26')]]={'$like':'%'+_0x386c9b['query']['filter']+'%'};return _0x2b65b1;}})});}_0x316445=_[_0xaac4('0x3c')]({},_0x316445,_0x386c9b[_0xaac4('0x3d')]);var _0x5371b4={'where':_0x316445[_0xaac4('0x38')]};return db[_0xaac4('0x2a')][_0xaac4('0x1b')](_0x5371b4)['then'](function(_0x74a1c){_0xda10b6[_0xaac4('0x1b')]=_0x74a1c;if(_0x386c9b[_0xaac4('0x2e')]['includeAll']){_0x316445[_0xaac4('0x3e')]=[{'all':!![]}];}return db[_0xaac4('0x2a')][_0xaac4('0x3f')](_0x316445);})[_0xaac4('0x23')](function(_0x51e59d){_0xda10b6[_0xaac4('0x40')]=_0x51e59d;return _0xda10b6;})['then'](respondWithFilteredResult(_0x4d0f5f,_0x316445))['catch'](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x41')]=function(_0x31e240,_0x27df36){var _0x40c007={'raw':!![],'where':{'id':_0x31e240[_0xaac4('0x42')]['id']}},_0x43bc12={};_0x43bc12[_0xaac4('0x2d')]=_[_0xaac4('0x43')](db['WhatsappQueueReport'][_0xaac4('0x44')]);_0x43bc12[_0xaac4('0x2e')]=_[_0xaac4('0x43')](_0x31e240[_0xaac4('0x2e')]);_0x43bc12['filters']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],_0x43bc12[_0xaac4('0x2e')]);_0x40c007['attributes']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x31e240[_0xaac4('0x2e')]['fields']));_0x40c007[_0xaac4('0x31')]=_0x40c007[_0xaac4('0x31')][_0xaac4('0x33')]?_0x40c007['attributes']:_0x43bc12[_0xaac4('0x2d')];if(_0x31e240[_0xaac4('0x2e')][_0xaac4('0x45')]){_0x40c007[_0xaac4('0x3e')]=[{'all':!![]}];}_0x40c007=_[_0xaac4('0x3c')]({},_0x40c007,_0x31e240[_0xaac4('0x3d')]);return db[_0xaac4('0x2a')][_0xaac4('0x46')](_0x40c007)[_0xaac4('0x23')](handleEntityNotFound(_0x27df36,null))['then'](respondWithResult(_0x27df36,null))[_0xaac4('0x47')](handleError(_0x27df36,null));};exports[_0xaac4('0x48')]=function(_0x27425a,_0x360420){return db[_0xaac4('0x2a')]['create'](_0x27425a['body'],{})[_0xaac4('0x23')](respondWithResult(_0x360420,0xc9))[_0xaac4('0x47')](handleError(_0x360420,null));};exports[_0xaac4('0x21')]=function(_0x16c7f4,_0x5f33ea){if(_0x16c7f4[_0xaac4('0x49')]['id']){delete _0x16c7f4['body']['id'];}return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x16c7f4['params']['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x5f33ea,null))[_0xaac4('0x23')](saveUpdates(_0x16c7f4[_0xaac4('0x49')],null))['then'](respondWithResult(_0x5f33ea,null))['catch'](handleError(_0x5f33ea,null));};exports[_0xaac4('0x22')]=function(_0x2c1751,_0x22dda7){return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x2c1751[_0xaac4('0x42')]['id']}})['then'](handleEntityNotFound(_0x22dda7,null))[_0xaac4('0x23')](removeEntity(_0x22dda7,null))[_0xaac4('0x47')](handleError(_0x22dda7,null));};exports[_0xaac4('0x4a')]=function(_0x38f9af,_0x56201b){return db[_0xaac4('0x2a')]['describe']()[_0xaac4('0x23')](respondWithResult(_0x56201b,null))[_0xaac4('0x47')](handleError(_0x56201b,null));};
\ No newline at end of file
index 32f8d34..386071b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc63c=['util','../../config/logger','api','moment','bluebird','request-promise','./whatsappQueueReport.attributes','define','report_whatsapp_queue','uniqueid','lodash'];(function(_0x4ff731,_0x5791a5){var _0x357702=function(_0x175e35){while(--_0x175e35){_0x4ff731['push'](_0x4ff731['shift']());}};_0x357702(++_0x5791a5);}(_0xc63c,0x128));var _0xcc63=function(_0x4ea955,_0x1eda76){_0x4ea955=_0x4ea955-0x0;var _0x558561=_0xc63c[_0x4ea955];return _0x558561;};'use strict';var _=require(_0xcc63('0x0'));var util=require(_0xcc63('0x1'));var logger=require(_0xcc63('0x2'))(_0xcc63('0x3'));var moment=require(_0xcc63('0x4'));var BPromise=require(_0xcc63('0x5'));var rp=require(_0xcc63('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcc63('0x7'));module['exports']=function(_0x304b60,_0x453db8){return _0x304b60[_0xcc63('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0xcc63('0x9'),'paranoid':![],'indexes':[{'name':_0xcc63('0xa'),'fields':[_0xcc63('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fac=['exports','define','WhatsappQueueReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x324fe8,_0x1ccb46){var _0x4a1cd9=function(_0x506af2){while(--_0x506af2){_0x324fe8['push'](_0x324fe8['shift']());}};_0x4a1cd9(++_0x1ccb46);}(_0x0fac,0x90));var _0xc0fa=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0fac[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xc0fa('0x0'));var util=require('util');var logger=require(_0xc0fa('0x1'))(_0xc0fa('0x2'));var moment=require(_0xc0fa('0x3'));var BPromise=require(_0xc0fa('0x4'));var rp=require(_0xc0fa('0x5'));var fs=require('fs');var path=require(_0xc0fa('0x6'));var rimraf=require(_0xc0fa('0x7'));var config=require(_0xc0fa('0x8'));var attributes=require(_0xc0fa('0x9'));module[_0xc0fa('0xa')]=function(_0x2fa812,_0xdd166a){return _0x2fa812[_0xc0fa('0xb')](_0xc0fa('0xc'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xc0fa('0xd'),'fields':[_0xc0fa('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 63d2dd5..6a14bed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a9e=['update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw'];(function(_0x50ed0b,_0x15563f){var _0x419b8f=function(_0x114240){while(--_0x114240){_0x50ed0b['push'](_0x50ed0b['shift']());}};_0x419b8f(++_0x15563f);}(_0x2a9e,0x1b2));var _0xe2a9=function(_0x4758f2,_0x3b9c38){_0x4758f2=_0x4758f2-0x0;var _0x1275dd=_0x2a9e[_0x4758f2];return _0x1275dd;};'use strict';var _=require(_0xe2a9('0x0'));var util=require('util');var moment=require(_0xe2a9('0x1'));var BPromise=require(_0xe2a9('0x2'));var rs=require(_0xe2a9('0x3'));var fs=require('fs');var Redis=require(_0xe2a9('0x4'));var db=require(_0xe2a9('0x5'))['db'];var utils=require(_0xe2a9('0x6'));var logger=require(_0xe2a9('0x7'))(_0xe2a9('0x8'));var config=require(_0xe2a9('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe2a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9cff5a,_0x3cbc9c,_0x5f2de0){return new BPromise(function(_0x40514c,_0x34fc72){return client['request'](_0x9cff5a,_0x5f2de0)[_0xe2a9('0xb')](function(_0x266d82){logger[_0xe2a9('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3cbc9c,'request\x20sent');logger[_0xe2a9('0xd')](_0xe2a9('0xe'),_0x3cbc9c,_0xe2a9('0xf'),JSON[_0xe2a9('0x10')](_0x266d82));if(_0x266d82[_0xe2a9('0x11')]){if(_0x266d82['error']['code']===0x1f4){logger[_0xe2a9('0x11')](_0xe2a9('0x12'),_0x3cbc9c,_0x266d82[_0xe2a9('0x11')][_0xe2a9('0x13')]);return _0x34fc72(_0x266d82['error']['message']);}logger[_0xe2a9('0x11')](_0xe2a9('0x12'),_0x3cbc9c,_0x266d82[_0xe2a9('0x11')]['message']);return _0x40514c(_0x266d82[_0xe2a9('0x11')][_0xe2a9('0x13')]);}else{logger['info'](_0xe2a9('0x12'),_0x3cbc9c,'request\x20sent');_0x40514c(_0x266d82[_0xe2a9('0x14')]['message']);}})[_0xe2a9('0x15')](function(_0x1b6053){logger[_0xe2a9('0x11')](_0xe2a9('0x12'),_0x3cbc9c,_0x1b6053);_0x34fc72(_0x1b6053);});});}exports[_0xe2a9('0x16')]=function(_0x435c45){var _0x4a547f=this;return new Promise(function(_0x185f9b,_0x2589d2){return db[_0xe2a9('0x17')][_0xe2a9('0x18')](_0x435c45[_0xe2a9('0x19')],{'raw':_0x435c45[_0xe2a9('0x1a')]?_0x435c45['options'][_0xe2a9('0x1b')]===undefined?!![]:![]:!![]})[_0xe2a9('0xb')](function(_0x3fdf88){logger[_0xe2a9('0xc')](_0xe2a9('0x16'),_0x435c45);logger[_0xe2a9('0xd')](_0xe2a9('0x16'),_0x435c45,JSON['stringify'](_0x3fdf88));_0x185f9b(_0x3fdf88);})[_0xe2a9('0x15')](function(_0x40bc66){logger[_0xe2a9('0x11')](_0xe2a9('0x16'),_0x40bc66[_0xe2a9('0x13')],_0x435c45);_0x2589d2(_0x4a547f[_0xe2a9('0x11')](0x1f4,_0x40bc66[_0xe2a9('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x1fcbbc){var _0x3d958d=this;return new Promise(function(_0x2dac0a,_0x35922c){return db[_0xe2a9('0x17')][_0xe2a9('0x1c')](_0x1fcbbc[_0xe2a9('0x19')],{'raw':_0x1fcbbc[_0xe2a9('0x1a')]?_0x1fcbbc[_0xe2a9('0x1a')][_0xe2a9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fcbbc[_0xe2a9('0x1a')]?_0x1fcbbc['options'][_0xe2a9('0x1d')]||null:null,'attributes':_0x1fcbbc[_0xe2a9('0x1a')]?_0x1fcbbc[_0xe2a9('0x1a')][_0xe2a9('0x1e')]||null:null,'limit':_0x1fcbbc[_0xe2a9('0x1a')]?_0x1fcbbc['options'][_0xe2a9('0x1f')]||null:null})[_0xe2a9('0xb')](function(_0x3a6c3c){logger['info'](_0xe2a9('0x20'),_0x1fcbbc);logger[_0xe2a9('0xd')](_0xe2a9('0x20'),_0x1fcbbc,JSON[_0xe2a9('0x10')](_0x3a6c3c));_0x2dac0a(_0x3a6c3c);})[_0xe2a9('0x15')](function(_0x55414b){logger[_0xe2a9('0x11')](_0xe2a9('0x20'),_0x55414b['message'],_0x1fcbbc);_0x35922c(_0x3d958d[_0xe2a9('0x11')](0x1f4,_0x55414b[_0xe2a9('0x13')]));});});};
\ No newline at end of file
+var _0xdf82=['raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','UpdateWhatsappQueueReport','update'];(function(_0x49de7,_0x41f348){var _0x53b9a6=function(_0xc694a5){while(--_0xc694a5){_0x49de7['push'](_0x49de7['shift']());}};_0x53b9a6(++_0x41f348);}(_0xdf82,0x136));var _0x2df8=function(_0x560cf5,_0x22e2e5){_0x560cf5=_0x560cf5-0x0;var _0x41ac84=_0xdf82[_0x560cf5];return _0x41ac84;};'use strict';var _=require(_0x2df8('0x0'));var util=require(_0x2df8('0x1'));var moment=require(_0x2df8('0x2'));var BPromise=require(_0x2df8('0x3'));var rs=require(_0x2df8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2df8('0x5'));var logger=require(_0x2df8('0x6'))(_0x2df8('0x7'));var config=require(_0x2df8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2df8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a8be4,_0x5645c6,_0x885b85){return new BPromise(function(_0x4d66c7,_0x137061){return client[_0x2df8('0xa')](_0x1a8be4,_0x885b85)[_0x2df8('0xb')](function(_0x3482ee){logger[_0x2df8('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5645c6,_0x2df8('0xd'));logger[_0x2df8('0xe')](_0x2df8('0xf'),_0x5645c6,_0x2df8('0xd'),JSON[_0x2df8('0x10')](_0x3482ee));if(_0x3482ee[_0x2df8('0x11')]){if(_0x3482ee[_0x2df8('0x11')][_0x2df8('0x12')]===0x1f4){logger['error'](_0x2df8('0x13'),_0x5645c6,_0x3482ee[_0x2df8('0x11')][_0x2df8('0x14')]);return _0x137061(_0x3482ee['error']['message']);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x5645c6,_0x3482ee[_0x2df8('0x11')][_0x2df8('0x14')]);return _0x4d66c7(_0x3482ee[_0x2df8('0x11')][_0x2df8('0x14')]);}else{logger[_0x2df8('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5645c6,_0x2df8('0xd'));_0x4d66c7(_0x3482ee[_0x2df8('0x15')][_0x2df8('0x14')]);}})[_0x2df8('0x16')](function(_0xbfe443){logger[_0x2df8('0x11')](_0x2df8('0x13'),_0x5645c6,_0xbfe443);_0x137061(_0xbfe443);});});}exports[_0x2df8('0x17')]=function(_0x4f98a4){var _0x144759=this;return new Promise(function(_0x3d94be,_0x1fdf5f){return db[_0x2df8('0x18')][_0x2df8('0x19')](_0x4f98a4[_0x2df8('0x1a')],{'raw':_0x4f98a4[_0x2df8('0x1b')]?_0x4f98a4[_0x2df8('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x2df8('0xb')](function(_0x347c8c){logger['info'](_0x2df8('0x17'),_0x4f98a4);logger[_0x2df8('0xe')](_0x2df8('0x17'),_0x4f98a4,JSON[_0x2df8('0x10')](_0x347c8c));_0x3d94be(_0x347c8c);})[_0x2df8('0x16')](function(_0x4ed61d){logger[_0x2df8('0x11')](_0x2df8('0x17'),_0x4ed61d[_0x2df8('0x14')],_0x4f98a4);_0x1fdf5f(_0x144759[_0x2df8('0x11')](0x1f4,_0x4ed61d['message']));});});};exports[_0x2df8('0x1c')]=function(_0x18f072){var _0x281d8b=this;return new Promise(function(_0x3b8002,_0x507aa1){return db[_0x2df8('0x18')][_0x2df8('0x1d')](_0x18f072[_0x2df8('0x1a')],{'raw':_0x18f072['options']?_0x18f072[_0x2df8('0x1b')][_0x2df8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18f072['options']?_0x18f072[_0x2df8('0x1b')][_0x2df8('0x1f')]||null:null,'attributes':_0x18f072[_0x2df8('0x1b')]?_0x18f072[_0x2df8('0x1b')][_0x2df8('0x20')]||null:null,'limit':_0x18f072[_0x2df8('0x1b')]?_0x18f072[_0x2df8('0x1b')][_0x2df8('0x21')]||null:null})[_0x2df8('0xb')](function(_0x471976){logger['info'](_0x2df8('0x1c'),_0x18f072);logger[_0x2df8('0xe')]('UpdateWhatsappQueueReport',_0x18f072,JSON[_0x2df8('0x10')](_0x471976));_0x3b8002(_0x471976);})['catch'](function(_0x5e8115){logger[_0x2df8('0x11')](_0x2df8('0x1c'),_0x5e8115['message'],_0x18f072);_0x507aa1(_0x281d8b[_0x2df8('0x11')](0x1f4,_0x5e8115[_0x2df8('0x14')]));});});};
\ No newline at end of file
index fb8578c..ed33eac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa18=['post','create','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa18,0x113));var _0x8aa1=function(_0x2ac3a0,_0x57d3f3){_0x2ac3a0=_0x2ac3a0-0x0;var _0x117297=_0xaa18[_0x2ac3a0];return _0x117297;};'use strict';var multer=require(_0x8aa1('0x0'));var util=require('util');var path=require(_0x8aa1('0x1'));var timeout=require(_0x8aa1('0x2'));var express=require(_0x8aa1('0x3'));var router=express['Router']();var fs_extra=require(_0x8aa1('0x4'));var auth=require(_0x8aa1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8aa1('0x6'));router[_0x8aa1('0x7')]('/',auth['isAuthenticated'](),controller[_0x8aa1('0x8')]);router[_0x8aa1('0x7')](_0x8aa1('0x9'),auth[_0x8aa1('0xa')](),controller[_0x8aa1('0xb')]);router[_0x8aa1('0x7')](_0x8aa1('0xc'),auth[_0x8aa1('0xa')](),controller['show']);router[_0x8aa1('0xd')]('/',auth[_0x8aa1('0xa')](),controller[_0x8aa1('0xe')]);router['put'](_0x8aa1('0xc'),auth[_0x8aa1('0xa')](),controller[_0x8aa1('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8aa1('0x10')]);module[_0x8aa1('0x11')]=router;
\ No newline at end of file
+var _0xb07d=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller'];(function(_0x207db1,_0x19c38c){var _0x3744e1=function(_0x1cd678){while(--_0x1cd678){_0x207db1['push'](_0x207db1['shift']());}};_0x3744e1(++_0x19c38c);}(_0xb07d,0x12a));var _0xdb07=function(_0xc7514e,_0x4346bd){_0xc7514e=_0xc7514e-0x0;var _0x374bff=_0xb07d[_0xc7514e];return _0x374bff;};'use strict';var multer=require(_0xdb07('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdb07('0x1')]();var fs_extra=require(_0xdb07('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xdb07('0x3'));var config=require(_0xdb07('0x4'));var controller=require(_0xdb07('0x5'));router[_0xdb07('0x6')]('/',auth[_0xdb07('0x7')](),controller[_0xdb07('0x8')]);router[_0xdb07('0x6')]('/describe',auth[_0xdb07('0x7')](),controller['describe']);router[_0xdb07('0x6')](_0xdb07('0x9'),auth[_0xdb07('0x7')](),controller[_0xdb07('0xa')]);router[_0xdb07('0xb')]('/',auth[_0xdb07('0x7')](),controller[_0xdb07('0xc')]);router['put'](_0xdb07('0x9'),auth[_0xdb07('0x7')](),controller[_0xdb07('0xd')]);router[_0xdb07('0xe')](_0xdb07('0x9'),auth[_0xdb07('0x7')](),controller[_0xdb07('0xf')]);module['exports']=router;
\ No newline at end of file
index 2e86d5c..97aaae4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf94=['ENUM','account','agent','queue','DATE','exports','STRING'];(function(_0x5b6405,_0x357964){var _0x484ee4=function(_0x49fbeb){while(--_0x49fbeb){_0x5b6405['push'](_0x5b6405['shift']());}};_0x484ee4(++_0x357964);}(_0xdf94,0xad));var _0x4df9=function(_0x4523ce,_0x1669d1){_0x4523ce=_0x4523ce-0x0;var _0x16d854=_0xdf94[_0x4523ce];return _0x16d854;};'use strict';var Sequelize=require('sequelize');module[_0x4df9('0x0')]={'uniqueid':{'type':Sequelize[_0x4df9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4df9('0x2')](_0x4df9('0x3'),_0x4df9('0x4'),_0x4df9('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4df9('0x6')]}};
\ No newline at end of file
+var _0x36ee=['queue','DATE','STRING','account','agent'];(function(_0x50a979,_0x4b4622){var _0x44a64f=function(_0x3ea3e4){while(--_0x3ea3e4){_0x50a979['push'](_0x50a979['shift']());}};_0x44a64f(++_0x4b4622);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe36e('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe36e('0x1'),_0xe36e('0x2'),_0xe36e('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xe36e('0x4')]}};
\ No newline at end of file
index b21eb16..e52cd8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0af=['describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','count','set','apply','reject','update','then','destroy','end','error','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params'];(function(_0x49f6ef,_0x549f9e){var _0x4d0ff2=function(_0x5bc945){while(--_0x5bc945){_0x49f6ef['push'](_0x49f6ef['shift']());}};_0x4d0ff2(++_0x549f9e);}(_0xd0af,0x87));var _0xfd0a=function(_0x346f5a,_0x33de62){_0x346f5a=_0x346f5a-0x0;var _0x2c1254=_0xd0af[_0x346f5a];return _0x2c1254;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfd0a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfd0a('0x1'));var rp=require('request-promise');var moment=require(_0xfd0a('0x2'));var BPromise=require(_0xfd0a('0x3'));var Mustache=require(_0xfd0a('0x4'));var util=require(_0xfd0a('0x5'));var path=require(_0xfd0a('0x6'));var sox=require(_0xfd0a('0x7'));var csv=require(_0xfd0a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd0a('0x9'));var _=require('lodash');var squel=require(_0xfd0a('0xa'));var crypto=require(_0xfd0a('0xb'));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(_0xfd0a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xfd0a('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfd0a('0xe'));var utils=require(_0xfd0a('0xf'));var config=require(_0xfd0a('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd0a('0x11'))['db'];function respondWithStatusCode(_0x4408c0,_0x5543c8){_0x5543c8=_0x5543c8||0xcc;return function(_0xea0305){if(_0xea0305){return _0x4408c0[_0xfd0a('0x12')](_0x5543c8);}return _0x4408c0[_0xfd0a('0x13')](_0x5543c8)['end']();};}function respondWithResult(_0x3c6d69,_0x477cba){_0x477cba=_0x477cba||0xc8;return function(_0x1869e3){if(_0x1869e3){return _0x3c6d69[_0xfd0a('0x13')](_0x477cba)['json'](_0x1869e3);}};}function respondWithFilteredResult(_0x3a45d2,_0x2ba21b){return function(_0x35d92f){if(_0x35d92f){var _0x4e257e=typeof _0x2ba21b[_0xfd0a('0x14')]==='undefined'&&typeof _0x2ba21b[_0xfd0a('0x15')]==='undefined';var _0x489bbb=_0x35d92f[_0xfd0a('0x16')];var _0x1dd274=_0x4e257e?0x0:_0x2ba21b[_0xfd0a('0x14')];var _0x4a7de3=_0x4e257e?_0x35d92f['count']:_0x2ba21b[_0xfd0a('0x14')]+_0x2ba21b[_0xfd0a('0x15')];var _0x231836;if(_0x4a7de3>=_0x489bbb){_0x4a7de3=_0x489bbb;_0x231836=0xc8;}else{_0x231836=0xce;}_0x3a45d2[_0xfd0a('0x13')](_0x231836);return _0x3a45d2[_0xfd0a('0x17')]('Content-Range',_0x1dd274+'-'+_0x4a7de3+'/'+_0x489bbb)['json'](_0x35d92f);}return null;};}function patchUpdates(_0x13f4de){return function(_0x24dbb7){try{jsonpatch[_0xfd0a('0x18')](_0x24dbb7,_0x13f4de,!![]);}catch(_0x134931){return BPromise[_0xfd0a('0x19')](_0x134931);}return _0x24dbb7['save']();};}function saveUpdates(_0x34f836,_0x19b66f){return function(_0x32a576){if(_0x32a576){return _0x32a576[_0xfd0a('0x1a')](_0x34f836)[_0xfd0a('0x1b')](function(_0x4a87cd){return _0x4a87cd;});}return null;};}function removeEntity(_0x229881,_0x5f53f4){return function(_0x2b8706){if(_0x2b8706){return _0x2b8706[_0xfd0a('0x1c')]()[_0xfd0a('0x1b')](function(){_0x229881[_0xfd0a('0x13')](0xcc)[_0xfd0a('0x1d')]();});}};}function handleEntityNotFound(_0x525210,_0x223c3b){return function(_0x467278){if(!_0x467278){_0x525210[_0xfd0a('0x12')](0x194);}return _0x467278;};}function handleError(_0x55ad57,_0x24eed5){_0x24eed5=_0x24eed5||0x1f4;return function(_0x4477d7){logger[_0xfd0a('0x1e')](_0x4477d7[_0xfd0a('0x1f')]);if(_0x4477d7[_0xfd0a('0x20')]){delete _0x4477d7['name'];}_0x55ad57[_0xfd0a('0x13')](_0x24eed5)[_0xfd0a('0x21')](_0x4477d7);};}exports['index']=function(_0x27092a,_0xda4fbb){var _0x35e88d={},_0x363102={},_0x318255={'count':0x0,'rows':[]};var _0x4d5892=_[_0xfd0a('0x22')](db[_0xfd0a('0x23')][_0xfd0a('0x24')],function(_0x3a098b){return{'name':_0x3a098b[_0xfd0a('0x25')],'type':_0x3a098b[_0xfd0a('0x26')][_0xfd0a('0x27')]};});_0x363102[_0xfd0a('0x28')]=_[_0xfd0a('0x22')](_0x4d5892,_0xfd0a('0x20'));_0x363102[_0xfd0a('0x29')]=_[_0xfd0a('0x2a')](_0x27092a[_0xfd0a('0x29')]);_0x363102[_0xfd0a('0x2b')]=_['intersection'](_0x363102[_0xfd0a('0x28')],_0x363102[_0xfd0a('0x29')]);_0x35e88d[_0xfd0a('0x2c')]=_[_0xfd0a('0x2d')](_0x363102['model'],qs['fields'](_0x27092a[_0xfd0a('0x29')][_0xfd0a('0x2e')]));_0x35e88d['attributes']=_0x35e88d[_0xfd0a('0x2c')][_0xfd0a('0x2f')]?_0x35e88d[_0xfd0a('0x2c')]:_0x363102['model'];if(!_0x27092a[_0xfd0a('0x29')]['hasOwnProperty'](_0xfd0a('0x30'))){_0x35e88d[_0xfd0a('0x15')]=qs['limit'](_0x27092a['query'][_0xfd0a('0x15')]);_0x35e88d['offset']=qs[_0xfd0a('0x14')](_0x27092a['query']['offset']);}_0x35e88d[_0xfd0a('0x31')]=qs[_0xfd0a('0x32')](_0x27092a[_0xfd0a('0x29')]['sort']);_0x35e88d[_0xfd0a('0x33')]=qs[_0xfd0a('0x2b')](_[_0xfd0a('0x34')](_0x27092a['query'],_0x363102[_0xfd0a('0x2b')]),_0x4d5892);if(_0x27092a[_0xfd0a('0x29')][_0xfd0a('0x35')]){_0x35e88d['where']=_['merge'](_0x35e88d[_0xfd0a('0x33')],{'$or':_['map'](_0x4d5892,function(_0x348731){if(_0x348731[_0xfd0a('0x26')]!=='VIRTUAL'){var _0x14f783={};_0x14f783[_0x348731['name']]={'$like':'%'+_0x27092a[_0xfd0a('0x29')]['filter']+'%'};return _0x14f783;}})});}_0x35e88d=_[_0xfd0a('0x36')]({},_0x35e88d,_0x27092a[_0xfd0a('0x37')]);var _0x1fa5ce={'where':_0x35e88d[_0xfd0a('0x33')]};return db[_0xfd0a('0x23')][_0xfd0a('0x16')](_0x1fa5ce)[_0xfd0a('0x1b')](function(_0x4fd057){_0x318255['count']=_0x4fd057;if(_0x27092a[_0xfd0a('0x29')][_0xfd0a('0x38')]){_0x35e88d[_0xfd0a('0x39')]=[{'all':!![]}];}return db[_0xfd0a('0x23')][_0xfd0a('0x3a')](_0x35e88d);})[_0xfd0a('0x1b')](function(_0x447d4f){_0x318255[_0xfd0a('0x3b')]=_0x447d4f;return _0x318255;})['then'](respondWithFilteredResult(_0xda4fbb,_0x35e88d))[_0xfd0a('0x3c')](handleError(_0xda4fbb,null));};exports[_0xfd0a('0x3d')]=function(_0x4abe5b,_0x47b958){var _0x327f34={'raw':!![],'where':{'id':_0x4abe5b['params']['id']}},_0x54cbfc={};_0x54cbfc[_0xfd0a('0x28')]=_['keys'](db['WhatsappTransferReport']['rawAttributes']);_0x54cbfc[_0xfd0a('0x29')]=_[_0xfd0a('0x2a')](_0x4abe5b[_0xfd0a('0x29')]);_0x54cbfc['filters']=_[_0xfd0a('0x2d')](_0x54cbfc[_0xfd0a('0x28')],_0x54cbfc[_0xfd0a('0x29')]);_0x327f34['attributes']=_[_0xfd0a('0x2d')](_0x54cbfc[_0xfd0a('0x28')],qs[_0xfd0a('0x2e')](_0x4abe5b[_0xfd0a('0x29')][_0xfd0a('0x2e')]));_0x327f34[_0xfd0a('0x2c')]=_0x327f34['attributes'][_0xfd0a('0x2f')]?_0x327f34['attributes']:_0x54cbfc[_0xfd0a('0x28')];if(_0x4abe5b[_0xfd0a('0x29')][_0xfd0a('0x38')]){_0x327f34[_0xfd0a('0x39')]=[{'all':!![]}];}_0x327f34=_[_0xfd0a('0x36')]({},_0x327f34,_0x4abe5b[_0xfd0a('0x37')]);return db[_0xfd0a('0x23')][_0xfd0a('0x3e')](_0x327f34)[_0xfd0a('0x1b')](handleEntityNotFound(_0x47b958,null))[_0xfd0a('0x1b')](respondWithResult(_0x47b958,null))[_0xfd0a('0x3c')](handleError(_0x47b958,null));};exports[_0xfd0a('0x3f')]=function(_0x1ad3cf,_0x1db071){return db[_0xfd0a('0x23')][_0xfd0a('0x3f')](_0x1ad3cf['body'],{})['then'](respondWithResult(_0x1db071,0xc9))[_0xfd0a('0x3c')](handleError(_0x1db071,null));};exports['update']=function(_0x420a25,_0x5ea619){if(_0x420a25[_0xfd0a('0x40')]['id']){delete _0x420a25['body']['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x420a25[_0xfd0a('0x41')]['id']}})['then'](handleEntityNotFound(_0x5ea619,null))[_0xfd0a('0x1b')](saveUpdates(_0x420a25[_0xfd0a('0x40')],null))['then'](respondWithResult(_0x5ea619,null))[_0xfd0a('0x3c')](handleError(_0x5ea619,null));};exports[_0xfd0a('0x1c')]=function(_0x2620bc,_0x5041a4){return db['WhatsappTransferReport']['find']({'where':{'id':_0x2620bc[_0xfd0a('0x41')]['id']}})[_0xfd0a('0x1b')](handleEntityNotFound(_0x5041a4,null))['then'](removeEntity(_0x5041a4,null))[_0xfd0a('0x3c')](handleError(_0x5041a4,null));};exports[_0xfd0a('0x42')]=function(_0x1d9aba,_0x44a7fe){return db['WhatsappTransferReport'][_0xfd0a('0x42')]()['then'](respondWithResult(_0x44a7fe,null))[_0xfd0a('0x3c')](handleError(_0x44a7fe,null));};
\ No newline at end of file
+var _0x3e82=['body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','stack','name','send','index','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','type','VIRTUAL','filter','include','rows','catch','params','keys','includeAll','options','create'];(function(_0x1afabf,_0x56fdcc){var _0x497ff1=function(_0x2f6104){while(--_0x2f6104){_0x1afabf['push'](_0x1afabf['shift']());}};_0x497ff1(++_0x56fdcc);}(_0x3e82,0x18a));var _0x23e8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3e82[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x23e8('0x0'));var rimraf=require(_0x23e8('0x1'));var zipdir=require(_0x23e8('0x2'));var jsonpatch=require(_0x23e8('0x3'));var rp=require(_0x23e8('0x4'));var moment=require(_0x23e8('0x5'));var BPromise=require(_0x23e8('0x6'));var Mustache=require(_0x23e8('0x7'));var util=require(_0x23e8('0x8'));var path=require(_0x23e8('0x9'));var sox=require(_0x23e8('0xa'));var csv=require(_0x23e8('0xb'));var ejs=require(_0x23e8('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x23e8('0xd'));var squel=require(_0x23e8('0xe'));var crypto=require(_0x23e8('0xf'));var jsforce=require(_0x23e8('0x10'));var deskjs=require(_0x23e8('0x11'));var toCsv=require('to-csv');var querystring=require(_0x23e8('0x12'));var Papa=require('papaparse');var Redis=require(_0x23e8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x23e8('0x14'));var as=require(_0x23e8('0x15'));var hardwareService=require(_0x23e8('0x16'));var logger=require('../../config/logger')(_0x23e8('0x17'));var utils=require(_0x23e8('0x18'));var config=require(_0x23e8('0x19'));var licenseUtil=require(_0x23e8('0x1a'));var db=require(_0x23e8('0x1b'))['db'];function respondWithStatusCode(_0x166ddc,_0x3bbe3b){_0x3bbe3b=_0x3bbe3b||0xcc;return function(_0x9971c9){if(_0x9971c9){return _0x166ddc[_0x23e8('0x1c')](_0x3bbe3b);}return _0x166ddc[_0x23e8('0x1d')](_0x3bbe3b)[_0x23e8('0x1e')]();};}function respondWithResult(_0x3baadd,_0x99c8f3){_0x99c8f3=_0x99c8f3||0xc8;return function(_0x59213f){if(_0x59213f){return _0x3baadd[_0x23e8('0x1d')](_0x99c8f3)[_0x23e8('0x1f')](_0x59213f);}};}function respondWithFilteredResult(_0xc0f605,_0x6c7e8f){return function(_0x5d899e){if(_0x5d899e){var _0x3864a8=typeof _0x6c7e8f[_0x23e8('0x20')]===_0x23e8('0x21')&&typeof _0x6c7e8f[_0x23e8('0x22')]===_0x23e8('0x21');var _0x37b4a2=_0x5d899e[_0x23e8('0x23')];var _0x3783ae=_0x3864a8?0x0:_0x6c7e8f['offset'];var _0x4e009e=_0x3864a8?_0x5d899e[_0x23e8('0x23')]:_0x6c7e8f[_0x23e8('0x20')]+_0x6c7e8f['limit'];var _0x478407;if(_0x4e009e>=_0x37b4a2){_0x4e009e=_0x37b4a2;_0x478407=0xc8;}else{_0x478407=0xce;}_0xc0f605[_0x23e8('0x1d')](_0x478407);return _0xc0f605['set'](_0x23e8('0x24'),_0x3783ae+'-'+_0x4e009e+'/'+_0x37b4a2)[_0x23e8('0x1f')](_0x5d899e);}return null;};}function patchUpdates(_0x3534c6){return function(_0x4a21bf){try{jsonpatch['apply'](_0x4a21bf,_0x3534c6,!![]);}catch(_0x2a5dca){return BPromise[_0x23e8('0x25')](_0x2a5dca);}return _0x4a21bf[_0x23e8('0x26')]();};}function saveUpdates(_0x2dfe19,_0x1de9d7){return function(_0x4b0b8d){if(_0x4b0b8d){return _0x4b0b8d[_0x23e8('0x27')](_0x2dfe19)[_0x23e8('0x28')](function(_0x568485){return _0x568485;});}return null;};}function removeEntity(_0x4bd33c,_0x22fab0){return function(_0x285102){if(_0x285102){return _0x285102['destroy']()['then'](function(){_0x4bd33c['status'](0xcc)[_0x23e8('0x1e')]();});}};}function handleEntityNotFound(_0x920fae,_0x183c06){return function(_0x3dc5b1){if(!_0x3dc5b1){_0x920fae[_0x23e8('0x1c')](0x194);}return _0x3dc5b1;};}function handleError(_0x55e189,_0x53d469){_0x53d469=_0x53d469||0x1f4;return function(_0x5d2db4){logger['error'](_0x5d2db4[_0x23e8('0x29')]);if(_0x5d2db4[_0x23e8('0x2a')]){delete _0x5d2db4[_0x23e8('0x2a')];}_0x55e189[_0x23e8('0x1d')](_0x53d469)[_0x23e8('0x2b')](_0x5d2db4);};}exports[_0x23e8('0x2c')]=function(_0x2f35b7,_0x39b285){var _0x10f8cc={},_0x5df6a3={},_0x29311b={'count':0x0,'rows':[]};var _0x5a7d67=_['map'](db[_0x23e8('0x2d')][_0x23e8('0x2e')],function(_0x3b3131){return{'name':_0x3b3131[_0x23e8('0x2f')],'type':_0x3b3131['type'][_0x23e8('0x30')]};});_0x5df6a3[_0x23e8('0x31')]=_['map'](_0x5a7d67,_0x23e8('0x2a'));_0x5df6a3[_0x23e8('0x32')]=_['keys'](_0x2f35b7[_0x23e8('0x32')]);_0x5df6a3[_0x23e8('0x33')]=_[_0x23e8('0x34')](_0x5df6a3['model'],_0x5df6a3[_0x23e8('0x32')]);_0x10f8cc[_0x23e8('0x35')]=_[_0x23e8('0x34')](_0x5df6a3[_0x23e8('0x31')],qs[_0x23e8('0x36')](_0x2f35b7[_0x23e8('0x32')][_0x23e8('0x36')]));_0x10f8cc[_0x23e8('0x35')]=_0x10f8cc[_0x23e8('0x35')][_0x23e8('0x37')]?_0x10f8cc[_0x23e8('0x35')]:_0x5df6a3[_0x23e8('0x31')];if(!_0x2f35b7['query'][_0x23e8('0x38')](_0x23e8('0x39'))){_0x10f8cc[_0x23e8('0x22')]=qs[_0x23e8('0x22')](_0x2f35b7[_0x23e8('0x32')][_0x23e8('0x22')]);_0x10f8cc['offset']=qs[_0x23e8('0x20')](_0x2f35b7[_0x23e8('0x32')]['offset']);}_0x10f8cc[_0x23e8('0x3a')]=qs[_0x23e8('0x3b')](_0x2f35b7['query'][_0x23e8('0x3b')]);_0x10f8cc[_0x23e8('0x3c')]=qs[_0x23e8('0x33')](_['pick'](_0x2f35b7['query'],_0x5df6a3[_0x23e8('0x33')]),_0x5a7d67);if(_0x2f35b7['query']['filter']){_0x10f8cc[_0x23e8('0x3c')]=_[_0x23e8('0x3d')](_0x10f8cc['where'],{'$or':_[_0x23e8('0x3e')](_0x5a7d67,function(_0x5584f4){if(_0x5584f4[_0x23e8('0x3f')]!==_0x23e8('0x40')){var _0x3019c6={};_0x3019c6[_0x5584f4[_0x23e8('0x2a')]]={'$like':'%'+_0x2f35b7['query'][_0x23e8('0x41')]+'%'};return _0x3019c6;}})});}_0x10f8cc=_[_0x23e8('0x3d')]({},_0x10f8cc,_0x2f35b7['options']);var _0x564465={'where':_0x10f8cc[_0x23e8('0x3c')]};return db[_0x23e8('0x2d')][_0x23e8('0x23')](_0x564465)[_0x23e8('0x28')](function(_0x297d81){_0x29311b['count']=_0x297d81;if(_0x2f35b7[_0x23e8('0x32')]['includeAll']){_0x10f8cc[_0x23e8('0x42')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x10f8cc);})[_0x23e8('0x28')](function(_0x31abb6){_0x29311b[_0x23e8('0x43')]=_0x31abb6;return _0x29311b;})[_0x23e8('0x28')](respondWithFilteredResult(_0x39b285,_0x10f8cc))[_0x23e8('0x44')](handleError(_0x39b285,null));};exports['show']=function(_0x2a55fa,_0x776d6){var _0x50ad45={'raw':!![],'where':{'id':_0x2a55fa[_0x23e8('0x45')]['id']}},_0x524a23={};_0x524a23[_0x23e8('0x31')]=_[_0x23e8('0x46')](db[_0x23e8('0x2d')][_0x23e8('0x2e')]);_0x524a23[_0x23e8('0x32')]=_[_0x23e8('0x46')](_0x2a55fa[_0x23e8('0x32')]);_0x524a23['filters']=_[_0x23e8('0x34')](_0x524a23['model'],_0x524a23['query']);_0x50ad45['attributes']=_[_0x23e8('0x34')](_0x524a23[_0x23e8('0x31')],qs[_0x23e8('0x36')](_0x2a55fa[_0x23e8('0x32')][_0x23e8('0x36')]));_0x50ad45[_0x23e8('0x35')]=_0x50ad45[_0x23e8('0x35')][_0x23e8('0x37')]?_0x50ad45['attributes']:_0x524a23[_0x23e8('0x31')];if(_0x2a55fa[_0x23e8('0x32')][_0x23e8('0x47')]){_0x50ad45[_0x23e8('0x42')]=[{'all':!![]}];}_0x50ad45=_[_0x23e8('0x3d')]({},_0x50ad45,_0x2a55fa[_0x23e8('0x48')]);return db[_0x23e8('0x2d')]['find'](_0x50ad45)['then'](handleEntityNotFound(_0x776d6,null))[_0x23e8('0x28')](respondWithResult(_0x776d6,null))[_0x23e8('0x44')](handleError(_0x776d6,null));};exports['create']=function(_0x378fbe,_0x35a439){return db[_0x23e8('0x2d')][_0x23e8('0x49')](_0x378fbe[_0x23e8('0x4a')],{})['then'](respondWithResult(_0x35a439,0xc9))[_0x23e8('0x44')](handleError(_0x35a439,null));};exports[_0x23e8('0x27')]=function(_0x1ec32f,_0x22e6cb){if(_0x1ec32f[_0x23e8('0x4a')]['id']){delete _0x1ec32f['body']['id'];}return db[_0x23e8('0x2d')]['find']({'where':{'id':_0x1ec32f[_0x23e8('0x45')]['id']}})['then'](handleEntityNotFound(_0x22e6cb,null))[_0x23e8('0x28')](saveUpdates(_0x1ec32f[_0x23e8('0x4a')],null))[_0x23e8('0x28')](respondWithResult(_0x22e6cb,null))['catch'](handleError(_0x22e6cb,null));};exports[_0x23e8('0x4b')]=function(_0x69aa20,_0xaf61ee){return db[_0x23e8('0x2d')][_0x23e8('0x4c')]({'where':{'id':_0x69aa20['params']['id']}})['then'](handleEntityNotFound(_0xaf61ee,null))['then'](removeEntity(_0xaf61ee,null))[_0x23e8('0x44')](handleError(_0xaf61ee,null));};exports[_0x23e8('0x4d')]=function(_0x30013f,_0x33122b){return db[_0x23e8('0x2d')]['describe']()['then'](respondWithResult(_0x33122b,null))['catch'](handleError(_0x33122b,null));};
\ No newline at end of file
index a7908d5..cfab7a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2732=['define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','moment','path','rimraf','./whatsappTransferReport.attributes'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x2732,0xf4));var _0x2273=function(_0x1087b8,_0x394761){_0x1087b8=_0x1087b8-0x0;var _0x1aa3ca=_0x2732[_0x1087b8];return _0x1aa3ca;};'use strict';var _=require(_0x2273('0x0'));var util=require('util');var logger=require(_0x2273('0x1'))('api');var moment=require(_0x2273('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2273('0x3'));var rimraf=require(_0x2273('0x4'));var config=require('../../config/environment');var attributes=require(_0x2273('0x5'));module['exports']=function(_0x49c5e8,_0x5a9660){return _0x49c5e8[_0x2273('0x6')](_0x2273('0x7'),attributes,{'tableName':_0x2273('0x8'),'paranoid':![],'indexes':[{'name':_0x2273('0x9'),'fields':[_0x2273('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x54e2=['request-promise','path','rimraf','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','bluebird'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0x54e2,0x1c4));var _0x254e=function(_0x1f0a72,_0x4a2822){_0x1f0a72=_0x1f0a72-0x0;var _0x1e42de=_0x54e2[_0x1f0a72];return _0x1e42de;};'use strict';var _=require('lodash');var util=require(_0x254e('0x0'));var logger=require(_0x254e('0x1'))(_0x254e('0x2'));var moment=require('moment');var BPromise=require(_0x254e('0x3'));var rp=require(_0x254e('0x4'));var fs=require('fs');var path=require(_0x254e('0x5'));var rimraf=require(_0x254e('0x6'));var config=require('../../config/environment');var attributes=require(_0x254e('0x7'));module['exports']=function(_0x2bdb40,_0x56e9e3){return _0x2bdb40[_0x254e('0x8')](_0x254e('0x9'),attributes,{'tableName':_0x254e('0xa'),'paranoid':![],'indexes':[{'name':_0x254e('0xb'),'fields':[_0x254e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 56955c2..f3c38d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6384=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x2db94c,_0x138889){var _0x133afc=function(_0x44b793){while(--_0x44b793){_0x2db94c['push'](_0x2db94c['shift']());}};_0x133afc(++_0x138889);}(_0x6384,0x8a));var _0x4638=function(_0x4df671,_0x12b67f){_0x4df671=_0x4df671-0x0;var _0x3f9658=_0x6384[_0x4df671];return _0x3f9658;};'use strict';var _=require(_0x4638('0x0'));var util=require(_0x4638('0x1'));var moment=require(_0x4638('0x2'));var BPromise=require(_0x4638('0x3'));var rs=require(_0x4638('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4638('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4638('0x6'));var config=require(_0x4638('0x7'));var jayson=require(_0x4638('0x8'));var client=jayson[_0x4638('0x9')][_0x4638('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4300b3,_0x2973e1,_0x1d8f11){return new BPromise(function(_0x1e1719,_0x56a21b){return client['request'](_0x4300b3,_0x1d8f11)[_0x4638('0xb')](function(_0x26b211){logger['info'](_0x4638('0xc'),_0x2973e1,_0x4638('0xd'));logger[_0x4638('0xe')](_0x4638('0xf'),_0x2973e1,_0x4638('0xd'),JSON['stringify'](_0x26b211));if(_0x26b211[_0x4638('0x10')]){if(_0x26b211['error'][_0x4638('0x11')]===0x1f4){logger[_0x4638('0x10')](_0x4638('0xc'),_0x2973e1,_0x26b211[_0x4638('0x10')][_0x4638('0x12')]);return _0x56a21b(_0x26b211[_0x4638('0x10')][_0x4638('0x12')]);}logger[_0x4638('0x10')](_0x4638('0xc'),_0x2973e1,_0x26b211[_0x4638('0x10')]['message']);return _0x1e1719(_0x26b211[_0x4638('0x10')]['message']);}else{logger[_0x4638('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2973e1,'request\x20sent');_0x1e1719(_0x26b211[_0x4638('0x14')]['message']);}})[_0x4638('0x15')](function(_0x51ca63){logger['error'](_0x4638('0xc'),_0x2973e1,_0x51ca63);_0x56a21b(_0x51ca63);});});}
\ No newline at end of file
+var _0x356a=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x24b61d,_0x223497){var _0x42d09e=function(_0x39087a){while(--_0x39087a){_0x24b61d['push'](_0x24b61d['shift']());}};_0x42d09e(++_0x223497);}(_0x356a,0x16e));var _0xa356=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x356a[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xa356('0x0'));var util=require(_0xa356('0x1'));var moment=require(_0xa356('0x2'));var BPromise=require(_0xa356('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa356('0x4'));var db=require(_0xa356('0x5'))['db'];var utils=require(_0xa356('0x6'));var logger=require(_0xa356('0x7'))(_0xa356('0x8'));var config=require(_0xa356('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa356('0xa')][_0xa356('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbcf5dd,_0x5479a1,_0x11c6a3){return new BPromise(function(_0x583e57,_0x1a5f26){return client['request'](_0xbcf5dd,_0x11c6a3)[_0xa356('0xc')](function(_0x5ddcd0){logger[_0xa356('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5479a1,_0xa356('0xe'));logger[_0xa356('0xf')](_0xa356('0x10'),_0x5479a1,'request\x20sent',JSON['stringify'](_0x5ddcd0));if(_0x5ddcd0[_0xa356('0x11')]){if(_0x5ddcd0[_0xa356('0x11')][_0xa356('0x12')]===0x1f4){logger[_0xa356('0x11')](_0xa356('0x13'),_0x5479a1,_0x5ddcd0['error']['message']);return _0x1a5f26(_0x5ddcd0[_0xa356('0x11')][_0xa356('0x14')]);}logger[_0xa356('0x11')](_0xa356('0x13'),_0x5479a1,_0x5ddcd0[_0xa356('0x11')]['message']);return _0x583e57(_0x5ddcd0[_0xa356('0x11')][_0xa356('0x14')]);}else{logger[_0xa356('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5479a1,_0xa356('0xe'));_0x583e57(_0x5ddcd0[_0xa356('0x15')][_0xa356('0x14')]);}})[_0xa356('0x16')](function(_0x19c36b){logger[_0xa356('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5479a1,_0x19c36b);_0x1a5f26(_0x19c36b);});});}
\ No newline at end of file
index 5c75a2f..a1ba5ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7579=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','seedDB','default','then','listen','info','start','filter','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online','name','join','Offline\x20apps:','status','App\x20Ready!','catch','log','error'];(function(_0x41c1bb,_0xfe1783){var _0x58aa4d=function(_0x56d0ad){while(--_0x56d0ad){_0x41c1bb['push'](_0x41c1bb['shift']());}};_0x58aa4d(++_0xfe1783);}(_0x7579,0x1e2));var _0x9757=function(_0x2481f8,_0x391b9c){_0x2481f8=_0x2481f8-0x0;var _0x5b11dc=_0x7579[_0x2481f8];return _0x5b11dc;};'use strict';var _=require(_0x9757('0x0'));var db=require(_0x9757('0x1'))['db'];var seedDb=require(_0x9757('0x2'));var checkLicense=require(_0x9757('0x3'));var rpc=require(_0x9757('0x4'));var config=require(_0x9757('0x5'));var logger=require('./config/logger')(_0x9757('0x6'));var pm2=require(_0x9757('0x7'));var pm2Config=require(_0x9757('0x8'));var schedule=require(_0x9757('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x9757('0xa'));var transcribe=require(_0x9757('0xb'));var provider=require(_0x9757('0xc'));function main(){return db['sequelize'][_0x9757('0xd')]()['then'](function(){if(config[_0x9757('0xe')]){return seedDb[_0x9757('0xf')]();}})[_0x9757('0x10')](function(){return checkLicense['default']();})[_0x9757('0x10')](function(){return rpc[_0x9757('0x11')]();})[_0x9757('0x10')](function(_0xc35036){logger[_0x9757('0x12')](_0xc35036);return chat[_0x9757('0x13')]();})[_0x9757('0x10')](function(){return whatsapp[_0x9757('0x13')]();})[_0x9757('0x10')](function(){return schedule[_0x9757('0x13')]();})[_0x9757('0x10')](function(){return transcribe['start']();})[_0x9757('0x10')](function(){return provider[_0x9757('0x13')]();})[_0x9757('0x10')](function(_0x595a9e){logger[_0x9757('0x12')](_0x595a9e);return pm2[_0x9757('0x13')](pm2Config);})[_0x9757('0x10')](function(_0x14f67c){var _0x224229=_0x14f67c[_0x9757('0x14')](function(_0x105e56){return typeof _0x105e56['exitCode']===_0x9757('0x15')&&_0x105e56['exitCode']>=0x0;});if(_0x224229[_0x9757('0x16')]>0x0){throw new Error(_0x224229[_0x9757('0x16')]+_0x9757('0x17')+_[_0x9757('0x18')](_0x224229,function(_0x3f6be9){return'\x22'+_0x3f6be9[_0x9757('0x19')]['name']+'\x22';}));}logger[_0x9757('0x12')](_0x9757('0x1a'),_[_0x9757('0x18')](_[_0x9757('0x14')](_0x14f67c,{'status':_0x9757('0x1b')}),_0x9757('0x1c'))[_0x9757('0x1d')]());logger['info'](_0x9757('0x1e'),_['map'](_['filter'](_0x14f67c,function(_0x37c889){return _0x37c889[_0x9757('0x1f')]!==_0x9757('0x1b');}),_0x9757('0x1c'))['join']()||'None');console['log'](_0x9757('0x20'));})[_0x9757('0x21')](function(_0x3bec93){console[_0x9757('0x22')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x3bec93);logger[_0x9757('0x23')](_0x9757('0x24'),_0x3bec93);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0x1af5=['./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','then','default','listen','start','info','filter','number','exitCode','length','map','pm2_env','Online\x20apps:','online','name','join','Offline\x20apps:','status','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./config/license','./rpc'];(function(_0x41533b,_0x256309){var _0x11b899=function(_0x403549){while(--_0x403549){_0x41533b['push'](_0x41533b['shift']());}};_0x11b899(++_0x256309);}(_0x1af5,0x17d));var _0x51af=function(_0x315b3c,_0x2ed28c){_0x315b3c=_0x315b3c-0x0;var _0x34f38c=_0x1af5[_0x315b3c];return _0x34f38c;};'use strict';var _=require(_0x51af('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x51af('0x1'));var checkLicense=require(_0x51af('0x2'));var rpc=require(_0x51af('0x3'));var config=require(_0x51af('0x4'));var logger=require(_0x51af('0x5'))(_0x51af('0x6'));var pm2=require(_0x51af('0x7'));var pm2Config=require(_0x51af('0x8'));var schedule=require(_0x51af('0x9'));var chat=require(_0x51af('0xa'));var whatsapp=require(_0x51af('0xb'));var transcribe=require(_0x51af('0xc'));var provider=require(_0x51af('0xd'));function main(){return db['sequelize']['sync']()[_0x51af('0xe')](function(){if(config['seedDB']){return seedDb[_0x51af('0xf')]();}})[_0x51af('0xe')](function(){return checkLicense[_0x51af('0xf')]();})[_0x51af('0xe')](function(){return rpc[_0x51af('0x10')]();})[_0x51af('0xe')](function(_0x1ea2cf){logger['info'](_0x1ea2cf);return chat[_0x51af('0x11')]();})[_0x51af('0xe')](function(){return whatsapp[_0x51af('0x11')]();})[_0x51af('0xe')](function(){return schedule[_0x51af('0x11')]();})['then'](function(){return transcribe[_0x51af('0x11')]();})['then'](function(){return provider[_0x51af('0x11')]();})['then'](function(_0x9c4eeb){logger[_0x51af('0x12')](_0x9c4eeb);return pm2[_0x51af('0x11')](pm2Config);})['then'](function(_0x432a5d){var _0x2800d1=_0x432a5d[_0x51af('0x13')](function(_0x3a5414){return typeof _0x3a5414['exitCode']===_0x51af('0x14')&&_0x3a5414[_0x51af('0x15')]>=0x0;});if(_0x2800d1[_0x51af('0x16')]>0x0){throw new Error(_0x2800d1['length']+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x51af('0x17')](_0x2800d1,function(_0x1f1592){return'\x22'+_0x1f1592[_0x51af('0x18')]['name']+'\x22';}));}logger[_0x51af('0x12')](_0x51af('0x19'),_[_0x51af('0x17')](_[_0x51af('0x13')](_0x432a5d,{'status':_0x51af('0x1a')}),_0x51af('0x1b'))[_0x51af('0x1c')]());logger[_0x51af('0x12')](_0x51af('0x1d'),_['map'](_['filter'](_0x432a5d,function(_0x733b3b){return _0x733b3b[_0x51af('0x1e')]!==_0x51af('0x1a');}),_0x51af('0x1b'))[_0x51af('0x1c')]()||'None');console[_0x51af('0x1f')]('App\x20Ready!');})['catch'](function(_0x1fd0b7){console['log'](_0x51af('0x20'),_0x1fd0b7);logger['error'](_0x51af('0x21'),_0x1fd0b7);process[_0x51af('0x22')](0x1);});}main();
\ No newline at end of file
index 61677db..c7c9624 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04ab=['The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','secret','secrets','payload','options','promisify','randomBytes','toString','hex','floor','now','HS512','../../config/license/hardware','../../config/license/util','../encryptor','lodash','composable-middleware','crypto','bluebird','util','moment','session','role','fullname','name','email','userpic','permissions','md5secret','chatPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','authenticate','pass','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','sub','Setting','findOne','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','disabled','blocked','blockedAt','add','Invalid\x20API\x20access\x20key','catch','User\x20object\x20not\x20found.','update','Forbidden','isWebrtcLicence','getLicense','isMiddleware','signToken','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','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~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.'];(function(_0x567836,_0x5c1d43){var _0x2819b3=function(_0x44d7e0){while(--_0x44d7e0){_0x567836['push'](_0x567836['shift']());}};_0x2819b3(++_0x5c1d43);}(_0x04ab,0x17c));var _0xb04a=function(_0x312f8f,_0x1a6064){_0x312f8f=_0x312f8f-0x0;var _0x4d8bbe=_0x04ab[_0x312f8f];return _0x4d8bbe;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0xb04a('0x0'));var licenseUtil=require(_0xb04a('0x1'));var encryptor=require(_0xb04a('0x2'));var _=require(_0xb04a('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require(_0xb04a('0x4'));var basicAuth=require('basic-auth');var crypto=require(_0xb04a('0x5'));var BPromise=require(_0xb04a('0x6'));var util=require(_0xb04a('0x7'));var moment=require(_0xb04a('0x8'));var validateJwt=expressJwt({'secret':config['secrets'][_0xb04a('0x9')]});var userAttributes=['id',_0xb04a('0xa'),_0xb04a('0xb'),_0xb04a('0xc'),'internal',_0xb04a('0xd'),_0xb04a('0xe'),_0xb04a('0xf'),_0xb04a('0x10'),'voicePause',_0xb04a('0x11'),'mailPause',_0xb04a('0x12'),_0xb04a('0x13'),'openchannelPause',_0xb04a('0x14'),_0xb04a('0x15'),_0xb04a('0x16'),_0xb04a('0x17'),'crudPermissions','allowmessenger','passwordResetAt',_0xb04a('0x18'),'phoneBarAutoAnswer',_0xb04a('0x19'),_0xb04a('0x1a'),_0xb04a('0x1b'),_0xb04a('0x1c'),_0xb04a('0x1d'),_0xb04a('0x1e'),_0xb04a('0x1f'),_0xb04a('0x20'),'phoneBarRemoteControlPort',_0xb04a('0x21'),_0xb04a('0x22'),_0xb04a('0x23'),_0xb04a('0x24'),_0xb04a('0x25'),'wssPort',_0xb04a('0x26'),_0xb04a('0x27'),'downloadAttachments',_0xb04a('0x28'),_0xb04a('0x29')];exports[_0xb04a('0x2a')]=function(){return this[_0xb04a('0x2b')](!![])[_0xb04a('0x2c')](function(_0x42ca15,_0x5bc2dd,_0x31d5ca){if(_0x42ca15[_0xb04a('0x2d')]){_0x31d5ca();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x42ca15[_0xb04a('0x2e')]['id']},'attributes':['id',_0xb04a('0x2f'),_0xb04a('0x30')],'raw':!![]})[_0xb04a('0x31')](function(_0x9b4ce8){if(_0x9b4ce8&&_0x9b4ce8[_0xb04a('0x2f')]){return _0x5bc2dd[_0xb04a('0x32')](_0x9b4ce8['disposition']===_0xb04a('0x33')?0x195:0x193)['json']({'message':_0x9b4ce8[_0xb04a('0x30')]==='unmanaged'?_0xb04a('0x34'):_0xb04a('0x35')});}else{_0x31d5ca();}})['catch'](function(_0x131167){_0x31d5ca(_0x131167);});}});};exports['isAuthenticated']=function isAuthenticated(_0x5cfe54){return compose()[_0xb04a('0x2c')](function(_0x232fcf,_0x168f3f,_0x59ce89){var _0x449b95;if(_0x232fcf[_0xb04a('0x36')][_0xb04a('0x37')]){if(_[_0xb04a('0x38')](_0x232fcf[_0xb04a('0x36')][_0xb04a('0x37')],'Basic')){var _0x1c10e1=basicAuth(_0x232fcf);db[_0xb04a('0x39')][_0xb04a('0x3a')]({'where':{'name':_0x1c10e1[_0xb04a('0xc')]}})[_0xb04a('0x31')](function(_0x2a77dc){if(!_0x2a77dc||!_0x2a77dc[_0xb04a('0x3b')](_0x1c10e1[_0xb04a('0x3c')])){return _0x168f3f[_0xb04a('0x32')](0x191)[_0xb04a('0x3d')]({'message':_0xb04a('0x3e')});}_0x232fcf[_0xb04a('0x2d')]={'id':_0x2a77dc['id']};_0x59ce89();})['catch'](function(_0x3fa4a3){_0x59ce89(_0x3fa4a3);});}else if(_[_0xb04a('0x38')](_0x232fcf[_0xb04a('0x36')][_0xb04a('0x37')],_0xb04a('0x3f'))){validateJwt(_0x232fcf,_0x168f3f,_0x59ce89);}else{if(_0x5cfe54){_0x59ce89();}else{return _0x168f3f[_0xb04a('0x32')](0x193)[_0xb04a('0x3d')]({'message':_0xb04a('0x40')});}}}else if(_0x232fcf[_0xb04a('0x41')][_0xb04a('0x42')]){try{var _0x4f8e33={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x232fcf[_0xb04a('0x41')][_0xb04a('0x42')],_0x4f8e33)[_0xb04a('0x31')](function(_0x30ebe2){return db[_0xb04a('0x39')][_0xb04a('0x3a')]({'where':{'id':_0x30ebe2[_0xb04a('0x43')]}})['then'](function(_0x353127){_0x449b95=_0x353127;return db[_0xb04a('0x44')][_0xb04a('0x45')]({'where':{'id':0x1},'attributes':[_0xb04a('0x46'),_0xb04a('0x47')],'raw':!![]});})[_0xb04a('0x31')](function(_0x4edb2a){if(!_0x449b95||!_['isEqual'](_0x449b95[_0xb04a('0x48')],_0x30ebe2[_0xb04a('0x49')])){return _0x168f3f[_0xb04a('0x32')](0x191)[_0xb04a('0x3d')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x449b95[_0xb04a('0x4a')]){return _0x168f3f['status'](0x191)[_0xb04a('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x449b95[_0xb04a('0x4b')]){if(_0x4edb2a[_0xb04a('0x47')]>0x0){if(moment(_0x449b95[_0xb04a('0x4c')])[_0xb04a('0x4d')](_0x4edb2a[_0xb04a('0x47')],'minutes')>moment()){return _0x168f3f[_0xb04a('0x32')](0x191)['json']({'message':_0xb04a('0x4e')});}}else{return _0x168f3f[_0xb04a('0x32')](0x191)['json']({'message':_0xb04a('0x4e')});}}_0x232fcf[_0xb04a('0x2d')]={'id':_0x449b95['id']};_0x59ce89();});})[_0xb04a('0x4f')](function(){return _0x168f3f[_0xb04a('0x32')](0x191)[_0xb04a('0x3d')]({'message':_0xb04a('0x4e')});});}catch(_0x14dc34){_0x59ce89(_0x14dc34);}}else if(_0x5cfe54){_0x59ce89();}else{return _0x168f3f[_0xb04a('0x32')](0x193)[_0xb04a('0x3d')]({'message':_0xb04a('0x40')});}})[_0xb04a('0x2c')](function(_0x2f0f59,_0x5d468c,_0x1b11bf){if(_0x2f0f59['user']){db[_0xb04a('0x39')][_0xb04a('0x3a')]({'where':{'id':_0x2f0f59[_0xb04a('0x2d')]['id']},'attributes':userAttributes})[_0xb04a('0x31')](function(_0x5d5e46){if(!_0x5d5e46){return _0x5d468c[_0xb04a('0x32')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x2f0f59[_0xb04a('0x2d')]=_0x5d5e46;_0x1b11bf();})['catch'](function(_0x1248c3){_0x1b11bf(_0x1248c3);});}else if(_0x5cfe54){_0x1b11bf();}else{return _0x5d468c[_0xb04a('0x32')](0x194)[_0xb04a('0x3d')]({'message':_0xb04a('0x50')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x597b60,_0x4ad037,_0x3ca637){return licenseUtil['getLicense']()[_0xb04a('0x31')](function(_0x58e3ac){if(_0x58e3ac[_0xb04a('0x51')]){_0x3ca637();}else{return _0x4ad037['status'](0x193)['json']({'message':_0xb04a('0x52')});}})['catch'](function(_0x2bf927){_0x3ca637(_0x2bf927);});});};exports[_0xb04a('0x53')]=function isWebrtcLicence(){return compose()[_0xb04a('0x2c')](function(_0x2a2be0,_0x5588fc,_0x52b534){return licenseUtil[_0xb04a('0x54')]()['then'](function(_0x43cf15){if(_0x43cf15['webrtc']){_0x52b534();}else{return _0x5588fc['status'](0x193)[_0xb04a('0x3d')]({'message':_0xb04a('0x52')});}})[_0xb04a('0x4f')](function(_0x59d1aa){_0x52b534(_0x59d1aa);});});};exports[_0xb04a('0x55')]=function(_0x2de107,_0x22e52e,_0x51d278){_0x2de107[_0xb04a('0x55')]=!![];return _0x51d278();};exports[_0xb04a('0x56')]=function signToken(_0x1b4802){return signJwt(_0x1b4802);};exports['setTokenCookie']=function(_0x365fa3,_0x2f5bae){if(!_0x365fa3[_0xb04a('0x2d')]){return _0x2f5bae[_0xb04a('0x32')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4f072e={'payload':{'id':_0x365fa3['user']['id'],'role':_0x365fa3[_0xb04a('0x2d')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4f072e)['then'](function(_0x47bea3){_0x2f5bae[_0xb04a('0x57')]('motion.token',_0x47bea3);_0x2f5bae[_0xb04a('0x58')](_0xb04a('0x59'));})[_0xb04a('0x4f')](function(_0xd43811){return _0x2f5bae[_0xb04a('0x32')](0x1f4)[_0xb04a('0x5a')](_0xd43811);});};exports[_0xb04a('0x5b')]=function(_0x5c299f){if(_[_0xb04a('0x5c')](_0x5c299f[_0xb04a('0x48')])||_['isNil'](_0x5c299f[_0xb04a('0x5d')])){return null;}else{return createJwt(_0x5c299f);}};exports[_0xb04a('0x5e')]=function(_0x1e287b){_0x1e287b[_0xb04a('0x48')]=generateNonce();_0x1e287b[_0xb04a('0x5d')]=generateIssuedAt();return createJwt(_0x1e287b);};exports['regenerateApiKey']=function(_0xb97cb6,_0x4de511){var _0x42df74=_0xb97cb6[_0xb04a('0x41')][_0xb04a('0x42')];if(_0x42df74){var _0x3d9efa={'nonce':_0x4de511[_0xb04a('0x48')],'iat':_0x4de511[_0xb04a('0x5d')],'audience':hardwareConf[_0xb04a('0x5f')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x42df74,_0x3d9efa)[_0xb04a('0x31')](function(){return generateApiKey(_0x4de511);});}else{throw{'message':_0xb04a('0x60')};}};exports[_0xb04a('0x61')]=function(_0x154ae8){var _0x176ee9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x176ee9['test'](_0x154ae8))throw new db['Sequelize'][(_0xb04a('0x62'))](_0xb04a('0x63'));return;};exports['validatePasswordHistory']=function(_0x2719a5,_0x53c7b6,_0x49a3ca){var _0x3ffd41=encryptor[_0xb04a('0x64')](_0x53c7b6)[_0xb04a('0x65')](',');for(var _0x1aa12e=0x0;_0x1aa12e<_0x49a3ca;_0x1aa12e++){if(!_0x3ffd41[_0x1aa12e])break;if(_0x2719a5['toLowerCase']()===_0x3ffd41[_0x1aa12e][_0xb04a('0x66')]()){var _0x35de2b=util['format'](_0xb04a('0x67'),_0x49a3ca);if(_0x49a3ca===0x1){_0x35de2b=_0xb04a('0x68');}throw new db['Sequelize'][(_0xb04a('0x62'))](_0x35de2b);}}return;};exports[_0xb04a('0x69')]=function(_0x51a224,_0x2814ed){var _0x3707db=_0x2814ed?encryptor[_0xb04a('0x64')](_0x2814ed)[_0xb04a('0x65')](','):[];if(_0x3707db[_0xb04a('0x6a')]===0x5){_0x3707db[_0xb04a('0x6b')](-0x1,0x1);}_0x3707db[_0xb04a('0x6c')](_0x51a224);return encryptor[_0xb04a('0x6d')](_0x3707db['join'](','));};function signJwt(_0x3c91ef){var _0x45a22d=BPromise['promisify'](jwt['sign'],{'context':jwt});var _0x483aac=_0x3c91ef[_0xb04a('0x6e')]||config[_0xb04a('0x6f')]['session'];return new BPromise(function(_0x4c76ac,_0x1d6331){_0x45a22d(_0x3c91ef[_0xb04a('0x70')],_0x483aac,_0x3c91ef[_0xb04a('0x71')])[_0xb04a('0x31')](function(_0x5b67a3){_0x4c76ac(_0x5b67a3);})[_0xb04a('0x4f')](function(_0x4cedd5){_0x1d6331(_0x4cedd5);});});}function verifyJwt(_0x8aaeee,_0x13073f,_0x352912){var _0xf53b59=BPromise[_0xb04a('0x72')](jwt['verify'],{'context':jwt});var _0x2a90d4=_0x352912||config[_0xb04a('0x6f')]['session'];return new BPromise(function(_0x2ca3d2,_0x2911ec){_0xf53b59(_0x8aaeee,_0x2a90d4,_0x13073f)['then'](function(_0x2f1850){_0x2ca3d2(_0x2f1850);})[_0xb04a('0x4f')](function(_0x4ef742){_0x2911ec(_0x4ef742);});});}function generateNonce(){return crypto[_0xb04a('0x73')](0x10)[_0xb04a('0x74')](_0xb04a('0x75'));}function generateIssuedAt(){return Math[_0xb04a('0x76')](Date[_0xb04a('0x77')]()/0x3e8)[_0xb04a('0x74')]();}function createJwt(_0x3db5ce){var _0x172b14={'payload':{'iat':_0x3db5ce[_0xb04a('0x5d')],'nonce':_0x3db5ce[_0xb04a('0x48')]},'options':{'algorithm':_0xb04a('0x78'),'subject':_0x3db5ce['id'][_0xb04a('0x74')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x172b14)[_0xb04a('0x31')](function(_0x11e149){return{'iat':_0x3db5ce[_0xb04a('0x5d')],'nonce':_0x3db5ce[_0xb04a('0x48')],'token':_0x11e149};});}
\ No newline at end of file
+var _0x666e=['splice','unshift','join','promisify','secret','payload','options','verify','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','util','moment','secrets','session','role','fullname','internal','email','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','headers','startsWith','Basic','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','Bearer','query','getUuid','apikey','sub','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','add','Unknown\x20authorization\x20format','User\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','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~!@#$%^&-_=+[{]}.','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','split','length'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0x666e,0x17b));var _0xe666=function(_0x543f9f,_0x563bf5){_0x543f9f=_0x543f9f-0x0;var _0x23e5d3=_0x666e[_0x543f9f];return _0x23e5d3;};'use strict';var db=require(_0xe666('0x0'))['db'];var config=require(_0xe666('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xe666('0x2'));var _=require(_0xe666('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xe666('0x4'));var compose=require(_0xe666('0x5'));var basicAuth=require(_0xe666('0x6'));var crypto=require(_0xe666('0x7'));var BPromise=require('bluebird');var util=require(_0xe666('0x8'));var moment=require(_0xe666('0x9'));var validateJwt=expressJwt({'secret':config[_0xe666('0xa')][_0xe666('0xb')]});var userAttributes=['id',_0xe666('0xc'),_0xe666('0xd'),'name',_0xe666('0xe'),_0xe666('0xf'),'userpic',_0xe666('0x10'),_0xe666('0x11'),_0xe666('0x12'),_0xe666('0x13'),_0xe666('0x14'),'faxPause',_0xe666('0x15'),_0xe666('0x16'),'pauseType',_0xe666('0x17'),_0xe666('0x18'),_0xe666('0x19'),_0xe666('0x1a'),_0xe666('0x1b'),_0xe666('0x1c'),_0xe666('0x1d'),_0xe666('0x1e'),'phoneBarAutoAnswerDelay',_0xe666('0x1f'),_0xe666('0x20'),'phoneBarEnableDtmfTone',_0xe666('0x21'),'phoneBarExpires',_0xe666('0x22'),_0xe666('0x23'),_0xe666('0x24'),'hotdesk',_0xe666('0x25'),_0xe666('0x26'),_0xe666('0x27'),'settingsEnabled',_0xe666('0x28'),_0xe666('0x29'),_0xe666('0x2a'),'downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign'];exports[_0xe666('0x2b')]=function(){return this[_0xe666('0x2c')](!![])[_0xe666('0x2d')](function(_0x4c3e2d,_0x46a892,_0x2770dd){if(_0x4c3e2d[_0xe666('0x2e')]){_0x2770dd();}else{return db[_0xe666('0x2f')][_0xe666('0x30')]({'where':{'id':_0x4c3e2d['params']['id']},'attributes':['id',_0xe666('0x31'),_0xe666('0x32')],'raw':!![]})[_0xe666('0x33')](function(_0x3d5d7a){if(_0x3d5d7a&&_0x3d5d7a[_0xe666('0x31')]){return _0x46a892[_0xe666('0x34')](_0x3d5d7a[_0xe666('0x32')]===_0xe666('0x35')?0x195:0x193)[_0xe666('0x36')]({'message':_0x3d5d7a[_0xe666('0x32')]==='unmanaged'?_0xe666('0x37'):_0xe666('0x38')});}else{_0x2770dd();}})['catch'](function(_0x461223){_0x2770dd(_0x461223);});}});};exports['isAuthenticated']=function isAuthenticated(_0x23e520){return compose()[_0xe666('0x2d')](function(_0x4d05a5,_0x3d703f,_0x5d9fec){var _0x56520e;if(_0x4d05a5[_0xe666('0x39')]['authorization']){if(_[_0xe666('0x3a')](_0x4d05a5[_0xe666('0x39')]['authorization'],_0xe666('0x3b'))){var _0x273e4a=basicAuth(_0x4d05a5);db[_0xe666('0x3c')][_0xe666('0x3d')]({'where':{'name':_0x273e4a[_0xe666('0x3e')]}})['then'](function(_0x53c09d){if(!_0x53c09d||!_0x53c09d[_0xe666('0x3f')](_0x273e4a[_0xe666('0x40')])){return _0x3d703f[_0xe666('0x34')](0x191)['json']({'message':_0xe666('0x41')});}_0x4d05a5['user']={'id':_0x53c09d['id']};_0x5d9fec();})[_0xe666('0x42')](function(_0x231bdf){_0x5d9fec(_0x231bdf);});}else if(_['startsWith'](_0x4d05a5[_0xe666('0x39')]['authorization'],_0xe666('0x43'))){validateJwt(_0x4d05a5,_0x3d703f,_0x5d9fec);}else{if(_0x23e520){_0x5d9fec();}else{return _0x3d703f[_0xe666('0x34')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x4d05a5[_0xe666('0x44')]['apikey']){try{var _0x736f00={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xe666('0x45')]()};verifyJwt(_0x4d05a5[_0xe666('0x44')][_0xe666('0x46')],_0x736f00)[_0xe666('0x33')](function(_0x2f4d7f){return db[_0xe666('0x3c')][_0xe666('0x3d')]({'where':{'id':_0x2f4d7f[_0xe666('0x47')]}})[_0xe666('0x33')](function(_0x279c93){_0x56520e=_0x279c93;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xe666('0x48'),_0xe666('0x49')],'raw':!![]});})[_0xe666('0x33')](function(_0x34b9c7){if(!_0x56520e||!_[_0xe666('0x4a')](_0x56520e[_0xe666('0x4b')],_0x2f4d7f[_0xe666('0x4c')])){return _0x3d703f[_0xe666('0x34')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x56520e[_0xe666('0x4d')]){return _0x3d703f[_0xe666('0x34')](0x191)[_0xe666('0x36')]({'message':_0xe666('0x4e')});}if(_0x56520e['blocked']){if(_0x34b9c7['blockDuration']>0x0){if(moment(_0x56520e['blockedAt'])[_0xe666('0x4f')](_0x34b9c7[_0xe666('0x49')],'minutes')>moment()){return _0x3d703f[_0xe666('0x34')](0x191)['json']({'message':_0xe666('0x4e')});}}else{return _0x3d703f['status'](0x191)['json']({'message':_0xe666('0x4e')});}}_0x4d05a5[_0xe666('0x2e')]={'id':_0x56520e['id']};_0x5d9fec();});})[_0xe666('0x42')](function(){return _0x3d703f[_0xe666('0x34')](0x191)['json']({'message':_0xe666('0x4e')});});}catch(_0x2e5f18){_0x5d9fec(_0x2e5f18);}}else if(_0x23e520){_0x5d9fec();}else{return _0x3d703f[_0xe666('0x34')](0x193)[_0xe666('0x36')]({'message':_0xe666('0x50')});}})[_0xe666('0x2d')](function(_0x57b6b4,_0x25b6c1,_0x5e30bc){if(_0x57b6b4[_0xe666('0x2e')]){db['User'][_0xe666('0x3d')]({'where':{'id':_0x57b6b4[_0xe666('0x2e')]['id']},'attributes':userAttributes})['then'](function(_0x5bca91){if(!_0x5bca91){return _0x25b6c1[_0xe666('0x34')](0x194)[_0xe666('0x36')]({'message':_0xe666('0x51')});}_0x57b6b4[_0xe666('0x2e')]=_0x5bca91;_0x5e30bc();})['catch'](function(_0xfc6e68){_0x5e30bc(_0xfc6e68);});}else if(_0x23e520){_0x5e30bc();}else{return _0x25b6c1[_0xe666('0x34')](0x194)[_0xe666('0x36')]({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xe666('0x2d')](function(_0x278865,_0xc97392,_0x59e85a){return licenseUtil[_0xe666('0x52')]()[_0xe666('0x33')](function(_0xa12b2b){if(_0xa12b2b[_0xe666('0x53')]){_0x59e85a();}else{return _0xc97392[_0xe666('0x34')](0x193)[_0xe666('0x36')]({'message':_0xe666('0x54')});}})[_0xe666('0x42')](function(_0xda46cb){_0x59e85a(_0xda46cb);});});};exports[_0xe666('0x55')]=function isWebrtcLicence(){return compose()['use'](function(_0x3456bf,_0x5e94ab,_0x21fe37){return licenseUtil['getLicense']()[_0xe666('0x33')](function(_0x11a43f){if(_0x11a43f[_0xe666('0x56')]){_0x21fe37();}else{return _0x5e94ab['status'](0x193)[_0xe666('0x36')]({'message':_0xe666('0x54')});}})[_0xe666('0x42')](function(_0x55a854){_0x21fe37(_0x55a854);});});};exports['isMiddleware']=function(_0x2d8bb4,_0x15bdc3,_0x52b1d3){_0x2d8bb4[_0xe666('0x57')]=!![];return _0x52b1d3();};exports['signToken']=function signToken(_0x4b6259){return signJwt(_0x4b6259);};exports[_0xe666('0x58')]=function(_0x387bbe,_0x4bdf7f){if(!_0x387bbe[_0xe666('0x2e')]){return _0x4bdf7f[_0xe666('0x34')](0x194)[_0xe666('0x36')]({'message':_0xe666('0x59')});}var _0x542a82={'payload':{'id':_0x387bbe[_0xe666('0x2e')]['id'],'role':_0x387bbe['user'][_0xe666('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x542a82)['then'](function(_0x5735ea){_0x4bdf7f[_0xe666('0x5a')]('motion.token',_0x5735ea);_0x4bdf7f['redirect']('/dashboards/general');})['catch'](function(_0x576e8f){return _0x4bdf7f[_0xe666('0x34')](0x1f4)[_0xe666('0x5b')](_0x576e8f);});};exports[_0xe666('0x5c')]=function(_0x186089){if(_['isNil'](_0x186089[_0xe666('0x4b')])||_[_0xe666('0x5d')](_0x186089[_0xe666('0x5e')])){return null;}else{return createJwt(_0x186089);}};exports[_0xe666('0x5f')]=function(_0x30c726){_0x30c726[_0xe666('0x4b')]=generateNonce();_0x30c726[_0xe666('0x5e')]=generateIssuedAt();return createJwt(_0x30c726);};exports[_0xe666('0x60')]=function(_0x249033,_0x34af2d){var _0xe32580=_0x249033[_0xe666('0x44')][_0xe666('0x46')];if(_0xe32580){var _0x40824a={'nonce':_0x34af2d[_0xe666('0x4b')],'iat':_0x34af2d[_0xe666('0x5e')],'audience':hardwareConf[_0xe666('0x45')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xe32580,_0x40824a)[_0xe666('0x33')](function(){return generateApiKey(_0x34af2d);});}else{throw{'message':_0xe666('0x61')};}};exports['validatePasswordPattern']=function(_0x170992){var _0x81ffe5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x81ffe5[_0xe666('0x62')](_0x170992))throw new db['Sequelize'][(_0xe666('0x63'))](_0xe666('0x64'));return;};exports['validatePasswordHistory']=function(_0x149c57,_0x76f34,_0x10a0b7){var _0x5dd6e6=encryptor[_0xe666('0x65')](_0x76f34)['split'](',');for(var _0x541d6f=0x0;_0x541d6f<_0x10a0b7;_0x541d6f++){if(!_0x5dd6e6[_0x541d6f])break;if(_0x149c57['toLowerCase']()===_0x5dd6e6[_0x541d6f][_0xe666('0x66')]()){var _0x1b319d=util[_0xe666('0x67')](_0xe666('0x68'),_0x10a0b7);if(_0x10a0b7===0x1){_0x1b319d='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xe666('0x69'))][(_0xe666('0x63'))](_0x1b319d);}}return;};exports[_0xe666('0x6a')]=function(_0x3ef216,_0x43bf05){var _0x22c5a6=_0x43bf05?encryptor[_0xe666('0x65')](_0x43bf05)[_0xe666('0x6b')](','):[];if(_0x22c5a6[_0xe666('0x6c')]===0x5){_0x22c5a6[_0xe666('0x6d')](-0x1,0x1);}_0x22c5a6[_0xe666('0x6e')](_0x3ef216);return encryptor['encryptString'](_0x22c5a6[_0xe666('0x6f')](','));};function signJwt(_0x5e0169){var _0x2f1789=BPromise[_0xe666('0x70')](jwt['sign'],{'context':jwt});var _0x5418d1=_0x5e0169[_0xe666('0x71')]||config[_0xe666('0xa')][_0xe666('0xb')];return new BPromise(function(_0x3868dd,_0x2ac0c5){_0x2f1789(_0x5e0169[_0xe666('0x72')],_0x5418d1,_0x5e0169[_0xe666('0x73')])[_0xe666('0x33')](function(_0xf97f2b){_0x3868dd(_0xf97f2b);})[_0xe666('0x42')](function(_0x5195b9){_0x2ac0c5(_0x5195b9);});});}function verifyJwt(_0x5d22f9,_0x3df56f,_0x47308c){var _0x1716bc=BPromise[_0xe666('0x70')](jwt[_0xe666('0x74')],{'context':jwt});var _0x21d742=_0x47308c||config['secrets'][_0xe666('0xb')];return new BPromise(function(_0x287362,_0x5d066c){_0x1716bc(_0x5d22f9,_0x21d742,_0x3df56f)[_0xe666('0x33')](function(_0x1c31c2){_0x287362(_0x1c31c2);})[_0xe666('0x42')](function(_0x4855cf){_0x5d066c(_0x4855cf);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xe666('0x75')](_0xe666('0x76'));}function generateIssuedAt(){return Math[_0xe666('0x77')](Date[_0xe666('0x78')]()/0x3e8)[_0xe666('0x75')]();}function createJwt(_0x3ab66f){var _0xe88fec={'payload':{'iat':_0x3ab66f[_0xe666('0x5e')],'nonce':_0x3ab66f[_0xe666('0x4b')]},'options':{'algorithm':_0xe666('0x79'),'subject':_0x3ab66f['id']['toString'](),'issuer':hardwareConf[_0xe666('0x45')](),'audience':hardwareConf[_0xe666('0x45')]()}};return signJwt(_0xe88fec)[_0xe666('0x33')](function(_0x4fc6af){return{'iat':_0x3ab66f[_0xe666('0x5e')],'nonce':_0x3ab66f[_0xe666('0x4b')],'token':_0x4fc6af};});}
\ No newline at end of file
index b581dd9..b3ab6b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd547=['createDecipher','encryptString','secret','utf8','base64','decryptString','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile'];(function(_0x426e06,_0x46e804){var _0x444171=function(_0x3907f6){while(--_0x3907f6){_0x426e06['push'](_0x426e06['shift']());}};_0x444171(++_0x46e804);}(_0xd547,0x1b6));var _0x7d54=function(_0x140d2f,_0x2ad576){_0x140d2f=_0x140d2f-0x0;var _0x1a04c6=_0xd547[_0x140d2f];return _0x1a04c6;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x7d54('0x0'));var _=require(_0x7d54('0x1'));var config=require(_0x7d54('0x2'));var logger=require(_0x7d54('0x3'))(_0x7d54('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x7d54('0x5')][_0x7d54('0x6')],'algorithm':_0x7d54('0x7')};const fileOptions={'algorithm':_0x7d54('0x8')};if(config['encrypt']&&config[_0x7d54('0x9')][_0x7d54('0xa')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x7d54('0xa')]);if(isSupported){fileOptions[_0x7d54('0xa')]=config[_0x7d54('0x9')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x7d54('0xb')](config[_0x7d54('0x9')][_0x7d54('0xa')],_0x7d54('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x50fa9e){return AES_SUPPORTED_RX['test'](_0x50fa9e);}function getSupportedCiphers(){return crypto[_0x7d54('0xd')]()[_0x7d54('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x18927c){return getSupportedCiphers()[_0x7d54('0xf')](_0x18927c)>-0x1;}function combineOptions(_0x4b1b0d){var _0x55d28b={};for(var _0x2a5112 in fileOptions){if(fileOptions[_0x7d54('0x10')](_0x2a5112)){_0x55d28b[_0x2a5112]=fileOptions[_0x2a5112];}}if(_0x4b1b0d){for(var _0x34a7a8 in _0x4b1b0d){if(_0x4b1b0d[_0x7d54('0x10')](_0x34a7a8)){_0x55d28b[_0x34a7a8]=_0x4b1b0d[_0x34a7a8];}}}return _0x55d28b;}exports[_0x7d54('0x11')]=function(_0xbe046e,_0x587d48,_0x2c9ac7,_0x13c7c5){return new BPromise(function(_0x3d1ffc,_0x45b3b9){_0x13c7c5=combineOptions(_0x13c7c5);var _0x2d84ec=new Buffer(_0x2c9ac7);var _0x1dee9e=fs[_0x7d54('0x12')](_0xbe046e);var _0x372057=fs[_0x7d54('0x13')](_0x587d48);var _0x487e71=crypto[_0x7d54('0x14')](_0x13c7c5[_0x7d54('0xa')],_0x2d84ec);_0x1dee9e['on'](_0x7d54('0x15'),function(_0x2d1f6a){var _0x4b652c=new Buffer(_0x487e71[_0x7d54('0x16')](_0x2d1f6a),_0x7d54('0x17'));_0x372057[_0x7d54('0x18')](_0x4b652c);});_0x1dee9e['on'](_0x7d54('0x19'),function(){try{var _0x56bf08=new Buffer(_0x487e71[_0x7d54('0x1a')](_0x7d54('0x17')),_0x7d54('0x17'));_0x372057[_0x7d54('0x18')](_0x56bf08);_0x372057[_0x7d54('0x19')]();_0x372057['on'](_0x7d54('0x1b'),function(){return _0x3d1ffc(_0x587d48);});}catch(_0x36dc3e){fs[_0x7d54('0x1c')](_0x587d48);return _0x45b3b9(_0x36dc3e);}});});};exports[_0x7d54('0x1d')]=function(_0x1a18f4,_0x3179eb,_0x2170e8,_0x355308){return new BPromise(function(_0x3a1be6,_0x5f2425){_0x355308=combineOptions(_0x355308);var _0x2b2c46=new Buffer(_0x2170e8);var _0x3b91c0=fs['createReadStream'](_0x1a18f4);var _0x417213=fs['createWriteStream'](_0x3179eb);var _0x301f10=crypto[_0x7d54('0x1e')](_0x355308[_0x7d54('0xa')],_0x2b2c46);_0x3b91c0['on'](_0x7d54('0x15'),function(_0xb979ea){var _0x273aac=new Buffer(_0x301f10[_0x7d54('0x16')](_0xb979ea),_0x7d54('0x17'));_0x417213[_0x7d54('0x18')](_0x273aac);});_0x3b91c0['on']('end',function(){try{var _0x8372ed=new Buffer(_0x301f10[_0x7d54('0x1a')](_0x7d54('0x17')),'binary');_0x417213[_0x7d54('0x18')](_0x8372ed);_0x417213[_0x7d54('0x19')]();_0x417213['on'](_0x7d54('0x1b'),function(){return _0x3a1be6(_0x3179eb);});}catch(_0x5c5edc){fs[_0x7d54('0x1c')](_0x3179eb);return _0x5f2425(_0x5c5edc);}});});};exports[_0x7d54('0x1f')]=function(_0x5a8016,_0x4bb23d,_0x37cd17){var _0x47769b=_0x37cd17||stringOptions[_0x7d54('0xa')];var _0x4761c0=_0x4bb23d||stringOptions[_0x7d54('0x20')];var _0x17544d=crypto[_0x7d54('0x14')](_0x47769b,_0x4761c0);var _0x15812d=_0x17544d[_0x7d54('0x16')](_0x5a8016,_0x7d54('0x21'),_0x7d54('0x22'));_0x15812d+=_0x17544d[_0x7d54('0x1a')](_0x7d54('0x22'));return _0x15812d;};exports[_0x7d54('0x23')]=function(_0x42064e,_0x42793e,_0x334254){var _0x184e6b=_0x334254||stringOptions[_0x7d54('0xa')];var _0xa20909=_0x42793e||stringOptions['secret'];var _0x18e141=crypto[_0x7d54('0x1e')](_0x184e6b,_0xa20909);var _0x591622=_0x18e141[_0x7d54('0x16')](_0x42064e,_0x7d54('0x22'),_0x7d54('0x21'));_0x591622+=_0x18e141['final'](_0x7d54('0x21'));return _0x591622;};
\ No newline at end of file
+var _0x317c=['hasOwnProperty','createReadStream','createWriteStream','createCipher','binary','end','write','unlink','decryptFile','createDecipher','update','final','close','utf8','decryptString','secret','base64','crypto','lodash','../../config/environment','../../config/logger','session','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf'];(function(_0x5e2358,_0x4e3f96){var _0x50d65c=function(_0x196e5d){while(--_0x196e5d){_0x5e2358['push'](_0x5e2358['shift']());}};_0x50d65c(++_0x4e3f96);}(_0x317c,0xea));var _0xc317=function(_0x30ca4e,_0x2930ea){_0x30ca4e=_0x30ca4e-0x0;var _0x577b23=_0x317c[_0x30ca4e];return _0x577b23;};'use strict';var crypto=require(_0xc317('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xc317('0x1'));var config=require(_0xc317('0x2'));var logger=require(_0xc317('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xc317('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0xc317('0x5')]&&config['encrypt'][_0xc317('0x6')]){var isSupported=isAlgorithmSupported(config[_0xc317('0x5')][_0xc317('0x6')]);if(isSupported){fileOptions['algorithm']=config[_0xc317('0x5')][_0xc317('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc317('0x7')](',\x20');logger[_0xc317('0x8')](config[_0xc317('0x5')][_0xc317('0x6')],_0xc317('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x2a0583){return AES_SUPPORTED_RX[_0xc317('0xa')](_0x2a0583);}function getSupportedCiphers(){return crypto[_0xc317('0xb')]()[_0xc317('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x887119){return getSupportedCiphers()[_0xc317('0xd')](_0x887119)>-0x1;}function combineOptions(_0x37fdcf){var _0x10255e={};for(var _0x126f07 in fileOptions){if(fileOptions[_0xc317('0xe')](_0x126f07)){_0x10255e[_0x126f07]=fileOptions[_0x126f07];}}if(_0x37fdcf){for(var _0x5bb983 in _0x37fdcf){if(_0x37fdcf[_0xc317('0xe')](_0x5bb983)){_0x10255e[_0x5bb983]=_0x37fdcf[_0x5bb983];}}}return _0x10255e;}exports['encryptFile']=function(_0x13f019,_0x221862,_0x278aa2,_0x416ffa){return new BPromise(function(_0x28334b,_0x59b09d){_0x416ffa=combineOptions(_0x416ffa);var _0x5574de=new Buffer(_0x278aa2);var _0x4fa593=fs[_0xc317('0xf')](_0x13f019);var _0x3a3ea3=fs[_0xc317('0x10')](_0x221862);var _0x39f477=crypto[_0xc317('0x11')](_0x416ffa[_0xc317('0x6')],_0x5574de);_0x4fa593['on']('data',function(_0x3fc0d2){var _0x477c14=new Buffer(_0x39f477['update'](_0x3fc0d2),_0xc317('0x12'));_0x3a3ea3['write'](_0x477c14);});_0x4fa593['on'](_0xc317('0x13'),function(){try{var _0x2db33a=new Buffer(_0x39f477['final']('binary'),_0xc317('0x12'));_0x3a3ea3[_0xc317('0x14')](_0x2db33a);_0x3a3ea3['end']();_0x3a3ea3['on']('close',function(){return _0x28334b(_0x221862);});}catch(_0x466d86){fs[_0xc317('0x15')](_0x221862);return _0x59b09d(_0x466d86);}});});};exports[_0xc317('0x16')]=function(_0x29de58,_0x3d07f5,_0x1ef168,_0x23f8fb){return new BPromise(function(_0x436fca,_0x2d76e6){_0x23f8fb=combineOptions(_0x23f8fb);var _0x11932c=new Buffer(_0x1ef168);var _0x11cad7=fs['createReadStream'](_0x29de58);var _0x110f2b=fs['createWriteStream'](_0x3d07f5);var _0x52caf1=crypto[_0xc317('0x17')](_0x23f8fb[_0xc317('0x6')],_0x11932c);_0x11cad7['on']('data',function(_0xc9bc99){var _0x25fcb6=new Buffer(_0x52caf1[_0xc317('0x18')](_0xc9bc99),_0xc317('0x12'));_0x110f2b[_0xc317('0x14')](_0x25fcb6);});_0x11cad7['on']('end',function(){try{var _0x4b7209=new Buffer(_0x52caf1[_0xc317('0x19')](_0xc317('0x12')),_0xc317('0x12'));_0x110f2b[_0xc317('0x14')](_0x4b7209);_0x110f2b[_0xc317('0x13')]();_0x110f2b['on'](_0xc317('0x1a'),function(){return _0x436fca(_0x3d07f5);});}catch(_0x3cdb19){fs['unlink'](_0x3d07f5);return _0x2d76e6(_0x3cdb19);}});});};exports['encryptString']=function(_0x3b2d03,_0x2beeb1,_0x42fb38){var _0x533b8f=_0x42fb38||stringOptions[_0xc317('0x6')];var _0x413628=_0x2beeb1||stringOptions['secret'];var _0x1926b8=crypto['createCipher'](_0x533b8f,_0x413628);var _0x3283f5=_0x1926b8[_0xc317('0x18')](_0x3b2d03,_0xc317('0x1b'),'base64');_0x3283f5+=_0x1926b8['final']('base64');return _0x3283f5;};exports[_0xc317('0x1c')]=function(_0x24af30,_0x5088fb,_0x5ec372){var _0x55d1bf=_0x5ec372||stringOptions[_0xc317('0x6')];var _0x54cd82=_0x5088fb||stringOptions[_0xc317('0x1d')];var _0x141986=crypto['createDecipher'](_0x55d1bf,_0x54cd82);var _0x46d22a=_0x141986[_0xc317('0x18')](_0x24af30,_0xc317('0x1e'),_0xc317('0x1b'));_0x46d22a+=_0x141986[_0xc317('0x19')](_0xc317('0x1b'));return _0x46d22a;};
\ No newline at end of file
index a3f95e1..eab56f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b0c=['argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','Empty','length','range','isInteger','num','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','.csv','existsSync','join','mkdirSync','each','csv','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','util','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics'];(function(_0x2b2f0b,_0x50a9c7){var _0x8310eb=function(_0x15a76a){while(--_0x15a76a){_0x2b2f0b['push'](_0x2b2f0b['shift']());}};_0x8310eb(++_0x50a9c7);}(_0x4b0c,0x187));var _0xc4b0=function(_0x5c626a,_0x2d6b3e){_0x5c626a=_0x5c626a-0x0;var _0x19a994=_0x4b0c[_0x5c626a];return _0x19a994;};'use strict';var util=require(_0xc4b0('0x0'));var path=require('path');var _=require(_0xc4b0('0x1'));var csv=require(_0xc4b0('0x2'));var fs=require('fs');var BPromise=require(_0xc4b0('0x3'));var zipdir=require(_0xc4b0('0x4'));var rimraf=require(_0xc4b0('0x5'));var db=require(_0xc4b0('0x6'))['db'];var dbH=require(_0xc4b0('0x6'))['dbH'];var logger=require(_0xc4b0('0x7'))(_0xc4b0('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xc4b0('0x9')][0x2]);var QUERY=process[_0xc4b0('0x9')][0x3];var PATH=process[_0xc4b0('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xdae3d0,_0xc8009a){var _0x4f40bf={'status':_0xdae3d0};var _0x2e9d5d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xc8009a){_0x4f40bf[_0xc4b0('0xa')]=_0xc8009a;}return db[_0xc4b0('0xb')][_0xc4b0('0xc')](_0x4f40bf,_0x2e9d5d);}function main(){var _0x359522=0x1388;var _0x248ae7;logger['info'](util[_0xc4b0('0xd')](_0xc4b0('0xe'),EXTRACTED_REPORT_ID,_0xc4b0('0xf')));return db[_0xc4b0('0x10')][_0xc4b0('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc4b0('0x12'),_0xc4b0('0x13')]})[_0xc4b0('0x14')](function(_0x5ceaf1){if(_0x5ceaf1){_0x248ae7=_0x5ceaf1;_0x359522=_0x248ae7['splitSizeCsv']||0x1388;}})[_0xc4b0('0x14')](function(){return dbH[_0xc4b0('0x15')][_0xc4b0('0x16')](util[_0xc4b0('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xc4b0('0x17')][_0xc4b0('0x18')]});})[_0xc4b0('0x14')](function(_0x53b479){if(!_0x53b479[0x0]['num']){return analyticExtractedReport(_0xc4b0('0x19'));}var _0x4a1f67=[];var _0x5da578=0x0;if(_0x248ae7[_0xc4b0('0x12')]){if(_0x53b479&&_0x53b479[_0xc4b0('0x1a')]){var _0x465e74=_[_0xc4b0('0x1b')](_0x53b479[0x0]['num']/_0x359522);var _0x293ba8=Number[_0xc4b0('0x1c')](_0x53b479[0x0][_0xc4b0('0x1d')]/_0x359522)?_0x53b479[0x0][_0xc4b0('0x1d')]%_0x359522:0x0;_0x465e74[_0xc4b0('0x1e')](function(_0x3cb04e){if(_0x3cb04e>0x0){_0x5da578+=_0x359522;}_0x4a1f67['push'](dbH[_0xc4b0('0x15')][_0xc4b0('0x16')](util[_0xc4b0('0xd')](_0xc4b0('0x1f'),QUERY,_0x359522,_0x5da578),{'type':dbH['sequelize'][_0xc4b0('0x17')]['SELECT']}));});if(_0x293ba8>0x0){_0x5da578+=_0x359522;_0x4a1f67[_0xc4b0('0x20')](dbH[_0xc4b0('0x15')][_0xc4b0('0x16')](util[_0xc4b0('0xd')](_0xc4b0('0x1f'),QUERY,_0x293ba8,_0x5da578),{'type':dbH[_0xc4b0('0x15')]['QueryTypes'][_0xc4b0('0x18')]}));}}}else{_0x4a1f67[_0xc4b0('0x20')](dbH[_0xc4b0('0x15')][_0xc4b0('0x16')](QUERY,{'type':dbH[_0xc4b0('0x15')][_0xc4b0('0x17')][_0xc4b0('0x18')]}));}var _0x2b4e0d=path['dirname'](PATH);var _0x20fee9=path['basename'](PATH,_0xc4b0('0x21'));var _0x5016df=_0x248ae7[_0xc4b0('0x12')]&&_0x4a1f67[_0xc4b0('0x1a')]>0x1;var _0xedb289=[];if(!fs[_0xc4b0('0x22')](path[_0xc4b0('0x23')](_0x2b4e0d,_0x20fee9))&&_0x5016df){fs[_0xc4b0('0x24')](path[_0xc4b0('0x23')](_0x2b4e0d,_0x20fee9));}return BPromise[_0xc4b0('0x25')](_0x4a1f67,function(_0x5d10be){_0xedb289[_0xc4b0('0x20')](_0x5d10be);})['then'](function(){for(var _0x54afbd=0x0;_0x54afbd<_0xedb289['length'];_0x54afbd+=0x1){var _0x52cb8e;var _0x18a681=_0xedb289[_0x54afbd];if(_0x5016df){_0x52cb8e=path[_0xc4b0('0x23')](_0x2b4e0d,_0x20fee9,util[_0xc4b0('0xd')]('%s%d.%s',_0x20fee9,_0x54afbd,_0xc4b0('0x26')));}else{_0x52cb8e=path[_0xc4b0('0x23')](_0x2b4e0d,util['format']('%s.%s',_0x20fee9,_0xc4b0('0x26')));}fs[_0xc4b0('0x27')](_0x52cb8e,csv(_0x18a681));}})[_0xc4b0('0x14')](function(){if(_0x5016df){return new Promise(function(_0x125be2){zipdir(path['join'](_0x2b4e0d,_0x20fee9),{'saveTo':path[_0xc4b0('0x23')](_0x2b4e0d,util[_0xc4b0('0xd')]('%s.%s',_0x20fee9,_0xc4b0('0x28')))},function(_0x229091,_0x8f2a4a){rimraf(path[_0xc4b0('0x23')](_0x2b4e0d,_0x20fee9),function(){});_0x125be2(_0xc4b0('0x29'));});});}})['then'](function(){logger[_0xc4b0('0x2a')](util['format'](_0xc4b0('0x2b'),EXTRACTED_REPORT_ID,_0xc4b0('0xf')));return analyticExtractedReport(_0xc4b0('0x2c'),_0x5016df?util[_0xc4b0('0xd')](_0xc4b0('0x2d'),_0x20fee9,_0x5016df?'zip':_0xc4b0('0x26')):null);});})[_0xc4b0('0x2e')](function(_0x2781ef){logger['info'](util['format'](_0xc4b0('0x2f'),EXTRACTED_REPORT_ID,_0xc4b0('0xf')),util[_0xc4b0('0x30')](_0x2781ef,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xc4b0('0x31')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x830c=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','length','range','num','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','join','each','%s%d.%s','csv','writeFileSync','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','path','lodash','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x830c,0x163));var _0xc830=function(_0xd42556,_0x3c9a0a){_0xd42556=_0xd42556-0x0;var _0x953cba=_0x830c[_0xd42556];return _0x953cba;};'use strict';var util=require('util');var path=require(_0xc830('0x0'));var _=require(_0xc830('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xc830('0x2'));var rimraf=require(_0xc830('0x3'));var db=require(_0xc830('0x4'))['db'];var dbH=require(_0xc830('0x4'))[_0xc830('0x5')];var logger=require(_0xc830('0x6'))(_0xc830('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xc830('0x8')][0x2]);var QUERY=process[_0xc830('0x8')][0x3];var PATH=process[_0xc830('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x26ac65,_0x31005d){var _0x44de0e={'status':_0x26ac65};var _0x227015={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x31005d){_0x44de0e['savename']=_0x31005d;}return db[_0xc830('0x9')][_0xc830('0xa')](_0x44de0e,_0x227015);}function main(){var _0x6e6ac2=0x1388;var _0x5479a6;logger[_0xc830('0xb')](util[_0xc830('0xc')](_0xc830('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0xc830('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc830('0xf'),_0xc830('0x10')]})['then'](function(_0xf8daf1){if(_0xf8daf1){_0x5479a6=_0xf8daf1;_0x6e6ac2=_0x5479a6[_0xc830('0x10')]||0x1388;}})[_0xc830('0x11')](function(){return dbH[_0xc830('0x12')][_0xc830('0x13')](util[_0xc830('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xc830('0x12')][_0xc830('0x14')][_0xc830('0x15')]});})[_0xc830('0x11')](function(_0x5fa900){if(!_0x5fa900[0x0]['num']){return analyticExtractedReport('Empty');}var _0x41fed4=[];var _0x49d315=0x0;if(_0x5479a6[_0xc830('0xf')]){if(_0x5fa900&&_0x5fa900[_0xc830('0x16')]){var _0x491ec8=_[_0xc830('0x17')](_0x5fa900[0x0][_0xc830('0x18')]/_0x6e6ac2);var _0x28f975=Number[_0xc830('0x19')](_0x5fa900[0x0]['num']/_0x6e6ac2)?_0x5fa900[0x0][_0xc830('0x18')]%_0x6e6ac2:0x0;_0x491ec8['forEach'](function(_0x37bfd0){if(_0x37bfd0>0x0){_0x49d315+=_0x6e6ac2;}_0x41fed4[_0xc830('0x1a')](dbH['sequelize'][_0xc830('0x13')](util[_0xc830('0xc')](_0xc830('0x1b'),QUERY,_0x6e6ac2,_0x49d315),{'type':dbH[_0xc830('0x12')][_0xc830('0x14')][_0xc830('0x15')]}));});if(_0x28f975>0x0){_0x49d315+=_0x6e6ac2;_0x41fed4['push'](dbH[_0xc830('0x12')]['query'](util[_0xc830('0xc')](_0xc830('0x1b'),QUERY,_0x28f975,_0x49d315),{'type':dbH[_0xc830('0x12')][_0xc830('0x14')][_0xc830('0x15')]}));}}}else{_0x41fed4[_0xc830('0x1a')](dbH[_0xc830('0x12')][_0xc830('0x13')](QUERY,{'type':dbH[_0xc830('0x12')][_0xc830('0x14')]['SELECT']}));}var _0x8921db=path['dirname'](PATH);var _0x41ab23=path[_0xc830('0x1c')](PATH,_0xc830('0x1d'));var _0x2ad025=_0x5479a6[_0xc830('0xf')]&&_0x41fed4[_0xc830('0x16')]>0x1;var _0x3804c3=[];if(!fs[_0xc830('0x1e')](path[_0xc830('0x1f')](_0x8921db,_0x41ab23))&&_0x2ad025){fs['mkdirSync'](path[_0xc830('0x1f')](_0x8921db,_0x41ab23));}return BPromise[_0xc830('0x20')](_0x41fed4,function(_0x43eac4){_0x3804c3[_0xc830('0x1a')](_0x43eac4);})['then'](function(){for(var _0x2fadae=0x0;_0x2fadae<_0x3804c3[_0xc830('0x16')];_0x2fadae+=0x1){var _0x3f9722;var _0x4aefdc=_0x3804c3[_0x2fadae];if(_0x2ad025){_0x3f9722=path['join'](_0x8921db,_0x41ab23,util['format'](_0xc830('0x21'),_0x41ab23,_0x2fadae,_0xc830('0x22')));}else{_0x3f9722=path['join'](_0x8921db,util[_0xc830('0xc')]('%s.%s',_0x41ab23,_0xc830('0x22')));}fs[_0xc830('0x23')](_0x3f9722,csv(_0x4aefdc));}})['then'](function(){if(_0x2ad025){return new Promise(function(_0x585115){zipdir(path['join'](_0x8921db,_0x41ab23),{'saveTo':path[_0xc830('0x1f')](_0x8921db,util[_0xc830('0xc')](_0xc830('0x24'),_0x41ab23,'zip'))},function(_0x379e6f,_0x4a2f5d){rimraf(path[_0xc830('0x1f')](_0x8921db,_0x41ab23),function(){});_0x585115(_0xc830('0x25'));});});}})[_0xc830('0x11')](function(){logger['info'](util['format'](_0xc830('0x26'),EXTRACTED_REPORT_ID,_0xc830('0x27')));return analyticExtractedReport(_0xc830('0x28'),_0x2ad025?util['format'](_0xc830('0x24'),_0x41ab23,_0x2ad025?_0xc830('0x29'):_0xc830('0x22')):null);});})[_0xc830('0x2a')](function(_0x560f98){logger[_0xc830('0xb')](util[_0xc830('0xc')](_0xc830('0x2b'),EXTRACTED_REPORT_ID,'CSV'),util[_0xc830('0x2c')](_0x560f98,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xc830('0x2d')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 10e9e25..82e3454 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95da=['finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','createPdfFromHTML','util','path','moment','pdfmake/src/printer','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','map','pick','toString','fill','auto','body','push','concat','forEach','format','name','startDate','length','header','pageBreak','landscape','\x20/\x20','Arial','black','right','find','split','splitSizePdf','then','range','num','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed'];(function(_0x529ebb,_0x55bab4){var _0x2bd160=function(_0x1718d6){while(--_0x1718d6){_0x529ebb['push'](_0x529ebb['shift']());}};_0x2bd160(++_0x55bab4);}(_0x95da,0x15e));var _0xa95d=function(_0x553cce,_0x4080d5){_0x553cce=_0x553cce-0x0;var _0x2cd141=_0x95da[_0x553cce];return _0x2cd141;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xa95d('0x0'));var path=require(_0xa95d('0x1'));var moment=require(_0xa95d('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xa95d('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xa95d('0x4'));var JSDOM=require(_0xa95d('0x5'))[_0xa95d('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0xa95d('0x7'));var db=require(_0xa95d('0x8'))['db'];var dbH=require(_0xa95d('0x8'))['dbH'];var logger=require(_0xa95d('0x9'))(_0xa95d('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xa95d('0xb')][0x2]);var QUERY=process[_0xa95d('0xb')][0x3];var PATH=process[_0xa95d('0xb')][0x4];var NAME=process[_0xa95d('0xb')][0x5];var FORMAT=_0xa95d('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x165b64,_0x35b9bd){var _0x47cd25={'status':_0x165b64};var _0x2f1cc9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x35b9bd){_0x47cd25['savename']=_0x35b9bd;}return db[_0xa95d('0xd')]['update'](_0x47cd25,_0x2f1cc9);}function getHeaders(_0x53d7dc){return _[_0xa95d('0xe')](_0x53d7dc,function(_0x5d56b3){return{'text':_0x5d56b3,'style':'tableHeader'};});}function getRows(_0x52466a,_0x38d9f0){return _[_0xa95d('0xe')](_0x38d9f0,function(_0x369364){return _(_0x369364)[_0xa95d('0xf')](_0x52466a)[_0xa95d('0xe')](function(_0x24c403){return _0x24c403?_[_0xa95d('0x10')](_0x24c403):'';})['value']();});}function createTable(_0x3be655,_0x53a652){var _0x2553d9={'widths':_[_0xa95d('0x11')](Array(_0x3be655['length']),0x91),'heights':function(_0x5e68d7){return _0x5e68d7===0x0?_0xa95d('0x12'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x58c225=getHeaders(_0x3be655);_0x2553d9[_0xa95d('0x13')][_0xa95d('0x14')](_0x58c225);var _0x287539=getRows(_0x3be655,_0x53a652);_0x2553d9[_0xa95d('0x13')]=_0x2553d9[_0xa95d('0x13')][_0xa95d('0x15')](_0x287539);return _0x2553d9;}function createTables(_0x7bec84){var _0x448e21=[];var _0x2a21f8=_['chunk'](Object['keys'](_0x7bec84[0x0]),0x5);_0x2a21f8[_0xa95d('0x16')](function(_0x1c69fa){_0x448e21[_0xa95d('0x14')](createTable(_0x1c69fa,_0x7bec84));});return _0x448e21;}function getPDFDocDefinition(_0x1ea933){var _0x30556e=util[_0xa95d('0x17')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xa95d('0x18')],moment(EXTRACTED_REPORT[_0xa95d('0x19')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xa95d('0x17')](FORMAT));var _0x51212c=[];for(var _0x415dbe=0x0;_0x415dbe<_0x1ea933[_0xa95d('0x1a')];_0x415dbe++){var _0x19b984=[];if(_0x415dbe===0x0){_0x19b984[_0xa95d('0x14')]({'text':_0x30556e,'style':_0xa95d('0x1b')});}var _0x51e8af={'table':_0x1ea933[_0x415dbe]};if(_0x415dbe>0x0){_0x51e8af[_0xa95d('0x1c')]='before';_0x51e8af['margin']=[0x0,0x46,0x0,0x0];}_0x19b984[_0xa95d('0x14')](_0x51e8af);_0x51212c[_0xa95d('0x14')](_0x19b984);}return{'pageSize':'A4','pageOrientation':_0xa95d('0x1d'),'content':_0x51212c,'footer':function(_0xa0619b,_0xcfc150){return{'text':_0xa0619b[_0xa95d('0x10')]()+_0xa95d('0x1e')+_0xcfc150,'style':'footer'};},'defaultStyle':{'font':_0xa95d('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa95d('0x20')},'footer':{'alignment':_0xa95d('0x21'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x13daf6){var _0x43fba3=0x1388;var _0x2fb70f;if(!_0x13daf6[0x0]['num']){return analyticExtractedReport('Empty');}return db['Setting'][_0xa95d('0x22')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa95d('0x23'),_0xa95d('0x24')]})[_0xa95d('0x25')](function(_0x1853bd){if(_0x1853bd){_0x2fb70f=_0x1853bd;_0x43fba3=_0x2fb70f[_0xa95d('0x24')]||0x3e8;}})[_0xa95d('0x25')](function(){var _0x256d39=[];var _0x1fe3f6=0x0;if(_0x2fb70f[_0xa95d('0x23')]){if(_0x13daf6&&_0x13daf6[_0xa95d('0x1a')]){var _0x336eee=_[_0xa95d('0x26')](_0x13daf6[0x0][_0xa95d('0x27')]/_0x43fba3);var _0xbc8392=Number['isInteger'](_0x13daf6[0x0][_0xa95d('0x27')]/_0x43fba3)?_0x13daf6[0x0][_0xa95d('0x27')]%_0x43fba3:0x0;_0x336eee[_0xa95d('0x16')](function(_0x10a183){if(_0x10a183>0x0){_0x1fe3f6+=_0x43fba3;}_0x256d39[_0xa95d('0x14')](dbH[_0xa95d('0x28')]['query'](util['format'](_0xa95d('0x29'),QUERY,_0x43fba3,_0x1fe3f6),{'type':dbH['sequelize'][_0xa95d('0x2a')][_0xa95d('0x2b')]}));});if(_0xbc8392>0x0){_0x1fe3f6+=_0x43fba3;_0x256d39[_0xa95d('0x14')](dbH[_0xa95d('0x28')][_0xa95d('0x2c')](util[_0xa95d('0x17')](_0xa95d('0x29'),QUERY,_0xbc8392,_0x1fe3f6),{'type':dbH[_0xa95d('0x28')]['QueryTypes'][_0xa95d('0x2b')]}));}}}else{_0x256d39[_0xa95d('0x14')](dbH[_0xa95d('0x28')][_0xa95d('0x2c')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xa95d('0x2b')]}));}var _0xc9640a=path[_0xa95d('0x2d')](PATH);var _0x2f7dd1=path[_0xa95d('0x2e')](PATH,_0xa95d('0x2f'));var _0x4d3143=_0x2fb70f[_0xa95d('0x23')]&&_0x256d39[_0xa95d('0x1a')]>0x1;var _0x1bf08d=[];if(!fs[_0xa95d('0x30')](path[_0xa95d('0x31')](_0xc9640a,_0x2f7dd1))&&_0x4d3143){fs[_0xa95d('0x32')](path[_0xa95d('0x31')](_0xc9640a,_0x2f7dd1));}return BPromise[_0xa95d('0x33')](_0x256d39,function(_0x3b50c8){_0x1bf08d[_0xa95d('0x14')](_0x3b50c8);})[_0xa95d('0x25')](function(){var _0xcafc8e=[];for(var _0xffa69e=0x0;_0xffa69e<_0x1bf08d[_0xa95d('0x1a')];_0xffa69e+=0x1){var _0xf58ff6=_0x1bf08d[_0xffa69e];var _0x4b61d7=createTables(_[_0xa95d('0x34')](_0xf58ff6));var _0x1ebfd6;var _0x37e7e6=getPDFDocDefinition(_0x4b61d7);var _0x6f4667=getPDFPrinter();var _0x236d56=_0x6f4667[_0xa95d('0x35')](_0x37e7e6);if(_0x4d3143){_0x1ebfd6=path[_0xa95d('0x31')](_0xc9640a,_0x2f7dd1,util[_0xa95d('0x17')](_0xa95d('0x36'),_0x2f7dd1,_0xffa69e,_0xa95d('0x37')));}else{_0x1ebfd6=path['join'](_0xc9640a,util[_0xa95d('0x17')](_0xa95d('0x38'),_0x2f7dd1,_0xa95d('0x37')));}_0xcafc8e[_0xa95d('0x14')](writePDFDocument(_0x236d56,_0x1ebfd6));}return Promise[_0xa95d('0x39')](_0xcafc8e);})[_0xa95d('0x25')](function(){if(_0x4d3143){return new Promise(function(_0x240d50){zipdir(path[_0xa95d('0x31')](_0xc9640a,_0x2f7dd1),{'saveTo':path['join'](_0xc9640a,util['format'](_0xa95d('0x38'),_0x2f7dd1,_0xa95d('0x3a')))},function(){rimraf(path[_0xa95d('0x31')](_0xc9640a,_0x2f7dd1),function(){});_0x240d50(_0xa95d('0x3b'));});});}})['then'](function(){if(!_0x4d3143)return;rimraf(path[_0xa95d('0x31')](_0xc9640a,_0x2f7dd1),function(){});})[_0xa95d('0x25')](function(){logger[_0xa95d('0x3c')](util[_0xa95d('0x17')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xa95d('0x3d')));return analyticExtractedReport(_0xa95d('0x3e'),_0x4d3143?util[_0xa95d('0x17')]('%s.%s',_0x2f7dd1,_0x4d3143?_0xa95d('0x3a'):_0xa95d('0x37')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xa95d('0x3c')](util[_0xa95d('0x17')](_0xa95d('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xa95d('0xd')][_0xa95d('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa95d('0x25')](function(_0x4275b4){EXTRACTED_REPORT=_0x4275b4;return dbH['sequelize'][_0xa95d('0x2c')](util[_0xa95d('0x17')](_0xa95d('0x41'),QUERY),{'type':dbH[_0xa95d('0x28')]['QueryTypes']['SELECT']});})[_0xa95d('0x25')](extractReport)[_0xa95d('0x42')](function(_0x2bfb45){logger[_0xa95d('0x3c')](util[_0xa95d('0x17')](_0xa95d('0x43'),EXTRACTED_REPORT_ID,'PDF'),util[_0xa95d('0x44')](_0x2bfb45,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa95d('0x45'));})[_0xa95d('0x46')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4c0014=new PdfPrinter({'Arial':{'normal':__dirname+_0xa95d('0x47'),'bold':__dirname+_0xa95d('0x48'),'italics':__dirname+_0xa95d('0x49'),'bolditalics':__dirname+_0xa95d('0x4a')}});return _0x4c0014;}function getPDFDocDefinitionFromHTML(_0x3a418a,_0x4ae364){var _0x6c94ed=util[_0xa95d('0x17')]('%s\x20#%d',_0x4ae364[_0xa95d('0x4b')],_0x4ae364[_0xa95d('0x4c')]);var _0x54cea8=moment()[_0xa95d('0x17')]('YYYY-MM-DD')[_0xa95d('0x10')]();var _0x92505e=htmlToPdfmake(_0x3a418a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x92505e],'defaultStyle':{'font':_0xa95d('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa95d('0x4d'),'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':_0xa95d('0x4d')}},'header':function(){return[{'text':_0xa95d('0x4e'),'style':_0xa95d('0x1b')}];},'footer':function(_0x22f2b4,_0x131391){return[{'text':util[_0xa95d('0x17')](_0xa95d('0x4f'),_0x6c94ed,_0x22f2b4,_0x131391,_0x54cea8),'style':'footer'}];}};}function writePDFDocument(_0x38f224,_0x4a761a){return new Promise(function(_0x1e4a79,_0xcce9f4){var _0x55363c=_0x38f224[_0xa95d('0x50')](fs[_0xa95d('0x51')](_0x4a761a));_0x55363c['on'](_0xa95d('0x52'),function(){_0x1e4a79(_0xa95d('0x52'));});_0x55363c['on']('error',function(_0x476ce6){_0xcce9f4(_0x476ce6);});_0x38f224['end']();});}exports[_0xa95d('0x53')]=function(_0x195c92,_0x1fb2e8){var _0xb16391=getPDFPrinter();var _0x3bff5a=getPDFDocDefinitionFromHTML(_0x195c92,_0x1fb2e8);var _0x496df4=_0xb16391[_0xa95d('0x35')](_0x3bff5a);return writePDFDocument(_0x496df4,_0x1fb2e8['path'])[_0xa95d('0x42')](function(_0x2ddb1a){throw _0x2ddb1a;});};
\ No newline at end of file
+var _0xf436=['\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','map','pick','toString','fill','length','auto','body','concat','chunk','keys','forEach','format','name','startDate','endDate','push','header','pageBreak','before','margin','landscape'];(function(_0x10903f,_0x295851){var _0x616718=function(_0x3df6b3){while(--_0x3df6b3){_0x10903f['push'](_0x10903f['shift']());}};_0x616718(++_0x295851);}(_0xf436,0xeb));var _0x6f43=function(_0x4df970,_0x3db317){_0x4df970=_0x4df970-0x0;var _0xf98e3b=_0xf436[_0x4df970];return _0xf98e3b;};'use strict';var _=require(_0x6f43('0x0'));var fs=require('fs');var util=require(_0x6f43('0x1'));var path=require(_0x6f43('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x6f43('0x3'));var PdfPrinter=require(_0x6f43('0x4'));var zipdir=require(_0x6f43('0x5'));var rimraf=require(_0x6f43('0x6'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x6f43('0x7'));var db=require(_0x6f43('0x8'))['db'];var dbH=require(_0x6f43('0x8'))[_0x6f43('0x9')];var logger=require(_0x6f43('0xa'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6f43('0xb')][0x2]);var QUERY=process[_0x6f43('0xb')][0x3];var PATH=process[_0x6f43('0xb')][0x4];var NAME=process[_0x6f43('0xb')][0x5];var FORMAT=_0x6f43('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c1f5f,_0x4d4c3a){var _0x4668d8={'status':_0x4c1f5f};var _0x48b8cc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4d4c3a){_0x4668d8['savename']=_0x4d4c3a;}return db[_0x6f43('0xd')]['update'](_0x4668d8,_0x48b8cc);}function getHeaders(_0x193fa6){return _['map'](_0x193fa6,function(_0x3aa07e){return{'text':_0x3aa07e,'style':'tableHeader'};});}function getRows(_0x469c0d,_0x29f771){return _[_0x6f43('0xe')](_0x29f771,function(_0x1c5322){return _(_0x1c5322)[_0x6f43('0xf')](_0x469c0d)[_0x6f43('0xe')](function(_0x241d38){return _0x241d38?_[_0x6f43('0x10')](_0x241d38):'';})['value']();});}function createTable(_0x50da72,_0x473ef4){var _0x48c5e3={'widths':_[_0x6f43('0x11')](Array(_0x50da72[_0x6f43('0x12')]),0x91),'heights':function(_0x33566d){return _0x33566d===0x0?_0x6f43('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xcf5ecd=getHeaders(_0x50da72);_0x48c5e3[_0x6f43('0x14')]['push'](_0xcf5ecd);var _0x173e59=getRows(_0x50da72,_0x473ef4);_0x48c5e3[_0x6f43('0x14')]=_0x48c5e3[_0x6f43('0x14')][_0x6f43('0x15')](_0x173e59);return _0x48c5e3;}function createTables(_0x5a0799){var _0x2c3d55=[];var _0x39343f=_[_0x6f43('0x16')](Object[_0x6f43('0x17')](_0x5a0799[0x0]),0x5);_0x39343f[_0x6f43('0x18')](function(_0x3a6ecc){_0x2c3d55['push'](createTable(_0x3a6ecc,_0x5a0799));});return _0x2c3d55;}function getPDFDocDefinition(_0x2313fc){var _0x115ee2=util[_0x6f43('0x19')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x6f43('0x1a')],moment(EXTRACTED_REPORT[_0x6f43('0x1b')])[_0x6f43('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x6f43('0x1c')])['format'](FORMAT));var _0x2439ac=[];for(var _0x4adaee=0x0;_0x4adaee<_0x2313fc[_0x6f43('0x12')];_0x4adaee++){var _0x1d3198=[];if(_0x4adaee===0x0){_0x1d3198[_0x6f43('0x1d')]({'text':_0x115ee2,'style':_0x6f43('0x1e')});}var _0x3c9fbf={'table':_0x2313fc[_0x4adaee]};if(_0x4adaee>0x0){_0x3c9fbf[_0x6f43('0x1f')]=_0x6f43('0x20');_0x3c9fbf[_0x6f43('0x21')]=[0x0,0x46,0x0,0x0];}_0x1d3198[_0x6f43('0x1d')](_0x3c9fbf);_0x2439ac[_0x6f43('0x1d')](_0x1d3198);}return{'pageSize':'A4','pageOrientation':_0x6f43('0x22'),'content':_0x2439ac,'footer':function(_0x4965b2,_0x3e820f){return{'text':_0x4965b2[_0x6f43('0x10')]()+_0x6f43('0x23')+_0x3e820f,'style':_0x6f43('0x24')};},'defaultStyle':{'font':_0x6f43('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6f43('0x26')},'footer':{'alignment':_0x6f43('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4a9f61){var _0x468a53=0x1388;var _0x494ec6;if(!_0x4a9f61[0x0][_0x6f43('0x28')]){return analyticExtractedReport(_0x6f43('0x29'));}return db[_0x6f43('0x2a')][_0x6f43('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6f43('0x2c'),_0x6f43('0x2d')]})['then'](function(_0x12f17e){if(_0x12f17e){_0x494ec6=_0x12f17e;_0x468a53=_0x494ec6['splitSizePdf']||0x3e8;}})[_0x6f43('0x2e')](function(){var _0x1eaa4b=[];var _0x240f72=0x0;if(_0x494ec6[_0x6f43('0x2c')]){if(_0x4a9f61&&_0x4a9f61[_0x6f43('0x12')]){var _0x2755c2=_[_0x6f43('0x2f')](_0x4a9f61[0x0][_0x6f43('0x28')]/_0x468a53);var _0x41410c=Number[_0x6f43('0x30')](_0x4a9f61[0x0][_0x6f43('0x28')]/_0x468a53)?_0x4a9f61[0x0][_0x6f43('0x28')]%_0x468a53:0x0;_0x2755c2[_0x6f43('0x18')](function(_0xdaa7d6){if(_0xdaa7d6>0x0){_0x240f72+=_0x468a53;}_0x1eaa4b[_0x6f43('0x1d')](dbH[_0x6f43('0x31')][_0x6f43('0x32')](util[_0x6f43('0x19')](_0x6f43('0x33'),QUERY,_0x468a53,_0x240f72),{'type':dbH[_0x6f43('0x31')][_0x6f43('0x34')][_0x6f43('0x35')]}));});if(_0x41410c>0x0){_0x240f72+=_0x468a53;_0x1eaa4b[_0x6f43('0x1d')](dbH['sequelize'][_0x6f43('0x32')](util['format'](_0x6f43('0x33'),QUERY,_0x41410c,_0x240f72),{'type':dbH[_0x6f43('0x31')][_0x6f43('0x34')]['SELECT']}));}}}else{_0x1eaa4b[_0x6f43('0x1d')](dbH['sequelize'][_0x6f43('0x32')](QUERY,{'type':dbH[_0x6f43('0x31')]['QueryTypes'][_0x6f43('0x35')]}));}var _0x3f28c4=path[_0x6f43('0x36')](PATH);var _0x2b7b47=path[_0x6f43('0x37')](PATH,_0x6f43('0x38'));var _0x3c3d60=_0x494ec6['split']&&_0x1eaa4b[_0x6f43('0x12')]>0x1;var _0x2879ca=[];if(!fs[_0x6f43('0x39')](path['join'](_0x3f28c4,_0x2b7b47))&&_0x3c3d60){fs[_0x6f43('0x3a')](path[_0x6f43('0x3b')](_0x3f28c4,_0x2b7b47));}return BPromise[_0x6f43('0x3c')](_0x1eaa4b,function(_0x416cd5){_0x2879ca[_0x6f43('0x1d')](_0x416cd5);})[_0x6f43('0x2e')](function(){var _0x4e61e7=[];for(var _0x13c087=0x0;_0x13c087<_0x2879ca[_0x6f43('0x12')];_0x13c087+=0x1){var _0x25de8e=_0x2879ca[_0x13c087];var _0x494695=createTables(_[_0x6f43('0x3d')](_0x25de8e));var _0x1cf9d8;var _0x343eff=getPDFDocDefinition(_0x494695);var _0x249028=getPDFPrinter();var _0x626e6=_0x249028[_0x6f43('0x3e')](_0x343eff);if(_0x3c3d60){_0x1cf9d8=path['join'](_0x3f28c4,_0x2b7b47,util['format'](_0x6f43('0x3f'),_0x2b7b47,_0x13c087,'pdf'));}else{_0x1cf9d8=path['join'](_0x3f28c4,util[_0x6f43('0x19')]('%s.%s',_0x2b7b47,_0x6f43('0x40')));}_0x4e61e7[_0x6f43('0x1d')](writePDFDocument(_0x626e6,_0x1cf9d8));}return Promise[_0x6f43('0x41')](_0x4e61e7);})[_0x6f43('0x2e')](function(){if(_0x3c3d60){return new Promise(function(_0x1656c8){zipdir(path['join'](_0x3f28c4,_0x2b7b47),{'saveTo':path[_0x6f43('0x3b')](_0x3f28c4,util['format'](_0x6f43('0x42'),_0x2b7b47,_0x6f43('0x43')))},function(){rimraf(path[_0x6f43('0x3b')](_0x3f28c4,_0x2b7b47),function(){});_0x1656c8('zip\x20finished');});});}})[_0x6f43('0x2e')](function(){if(!_0x3c3d60)return;rimraf(path[_0x6f43('0x3b')](_0x3f28c4,_0x2b7b47),function(){});})[_0x6f43('0x2e')](function(){logger[_0x6f43('0x44')](util['format'](_0x6f43('0x45'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x6f43('0x46'),_0x3c3d60?util[_0x6f43('0x19')](_0x6f43('0x42'),_0x2b7b47,_0x3c3d60?_0x6f43('0x43'):_0x6f43('0x40')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6f43('0x44')](util[_0x6f43('0x19')](_0x6f43('0x47'),EXTRACTED_REPORT_ID,_0x6f43('0x48')));return db[_0x6f43('0xd')][_0x6f43('0x49')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x6f43('0x2e')](function(_0x51d2f7){EXTRACTED_REPORT=_0x51d2f7;return dbH[_0x6f43('0x31')][_0x6f43('0x32')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x6f43('0x31')]['QueryTypes']['SELECT']});})[_0x6f43('0x2e')](extractReport)[_0x6f43('0x4a')](function(_0x377433){logger[_0x6f43('0x44')](util[_0x6f43('0x19')](_0x6f43('0x4b'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x377433,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6f43('0x4c'));})[_0x6f43('0x4d')](function(){process[_0x6f43('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3d25cd=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x6f43('0x4f'),'italics':__dirname+_0x6f43('0x50'),'bolditalics':__dirname+_0x6f43('0x51')}});return _0x3d25cd;}function getPDFDocDefinitionFromHTML(_0x5dee0f,_0x256cd1){var _0x2d8b38=util[_0x6f43('0x19')]('%s\x20#%d',_0x256cd1[_0x6f43('0x52')],_0x256cd1['interactionId']);var _0x59760f=moment()[_0x6f43('0x19')](_0x6f43('0x53'))[_0x6f43('0x10')]();var _0x466a47=htmlToPdfmake(_0x5dee0f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x466a47],'defaultStyle':{'font':_0x6f43('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6f43('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6f43('0x54')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x4a5083,_0x454bc1){return[{'text':util[_0x6f43('0x19')](_0x6f43('0x55'),_0x2d8b38,_0x4a5083,_0x454bc1,_0x59760f),'style':'footer'}];}};}function writePDFDocument(_0x37ae12,_0x54de77){return new Promise(function(_0x346e5d,_0x546c43){var _0x119d3c=_0x37ae12[_0x6f43('0x56')](fs[_0x6f43('0x57')](_0x54de77));_0x119d3c['on']('finish',function(){_0x346e5d(_0x6f43('0x58'));});_0x119d3c['on']('error',function(_0x181384){_0x546c43(_0x181384);});_0x37ae12[_0x6f43('0x59')]();});}exports['createPdfFromHTML']=function(_0x588fac,_0x352f32){var _0x396aba=getPDFPrinter();var _0x117088=getPDFDocDefinitionFromHTML(_0x588fac,_0x352f32);var _0x1d233d=_0x396aba[_0x6f43('0x3e')](_0x117088);return writePDFDocument(_0x1d233d,_0x352f32[_0x6f43('0x2')])[_0x6f43('0x4a')](function(_0x43408a){throw _0x43408a;});};
\ No newline at end of file
index 0403011..c5acf7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb8e=['query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','each','join','%s%d.%s','xlsx','%s.%s','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','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','push'];(function(_0x11a829,_0x48a233){var _0x31218c=function(_0x25e52c){while(--_0x25e52c){_0x11a829['push'](_0x11a829['shift']());}};_0x31218c(++_0x48a233);}(_0xcb8e,0x1f3));var _0xecb8=function(_0x40f2a4,_0x261c4b){_0x40f2a4=_0x40f2a4-0x0;var _0x48f496=_0xcb8e[_0x40f2a4];return _0x48f496;};'use strict';var util=require(_0xecb8('0x0'));var path=require('path');var _=require(_0xecb8('0x1'));var fs=require('fs');var json2xls=require(_0xecb8('0x2'));var BPromise=require(_0xecb8('0x3'));var zipdir=require(_0xecb8('0x4'));var rimraf=require(_0xecb8('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xecb8('0x6'))[_0xecb8('0x7')];var logger=require('../../config/logger')(_0xecb8('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xecb8('0x9')][0x2]);var QUERY=process[_0xecb8('0x9')][0x3];var PATH=process[_0xecb8('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1a2c13,_0x17afab){var _0x48d1d4={'status':_0x1a2c13};var _0x518b8f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17afab){_0x48d1d4[_0xecb8('0xa')]=_0x17afab;}return db[_0xecb8('0xb')]['update'](_0x48d1d4,_0x518b8f);}function main(){var _0x4d1144=0x1388;var _0x26bcd4;logger[_0xecb8('0xc')](util[_0xecb8('0xd')](_0xecb8('0xe'),EXTRACTED_REPORT_ID,_0xecb8('0xf')));return db[_0xecb8('0x10')][_0xecb8('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xecb8('0x12'),_0xecb8('0x13')]})[_0xecb8('0x14')](function(_0x483fc6){if(_0x483fc6){_0x26bcd4=_0x483fc6;_0x4d1144=_0x26bcd4[_0xecb8('0x13')]||0x1388;}})[_0xecb8('0x14')](function(){return dbH[_0xecb8('0x15')]['query'](util['format'](_0xecb8('0x16'),QUERY),{'type':dbH['sequelize'][_0xecb8('0x17')][_0xecb8('0x18')]});})[_0xecb8('0x14')](function(_0x41d6d4){if(!_0x41d6d4[0x0][_0xecb8('0x19')]){return analyticExtractedReport('Empty');}var _0x2c1bf5=[];var _0x3f89c4=0x0;if(_0x26bcd4[_0xecb8('0x12')]){if(_0x41d6d4&&_0x41d6d4[_0xecb8('0x1a')]){var _0x16723c=_[_0xecb8('0x1b')](_0x41d6d4[0x0][_0xecb8('0x19')]/_0x4d1144);var _0xea478a=Number['isInteger'](_0x41d6d4[0x0][_0xecb8('0x19')]/_0x4d1144)?_0x41d6d4[0x0]['num']%_0x4d1144:0x0;_0x16723c['forEach'](function(_0x3d64a1){if(_0x3d64a1>0x0){_0x3f89c4+=_0x4d1144;}_0x2c1bf5[_0xecb8('0x1c')](dbH['sequelize'][_0xecb8('0x1d')](util['format'](_0xecb8('0x1e'),QUERY,_0x4d1144,_0x3f89c4),{'type':dbH['sequelize'][_0xecb8('0x17')]['SELECT']}));});if(_0xea478a>0x0){_0x3f89c4+=_0x4d1144;_0x2c1bf5['push'](dbH['sequelize'][_0xecb8('0x1d')](util['format'](_0xecb8('0x1e'),QUERY,_0xea478a,_0x3f89c4),{'type':dbH[_0xecb8('0x15')]['QueryTypes']['SELECT']}));}}}else{_0x2c1bf5[_0xecb8('0x1c')](dbH[_0xecb8('0x15')][_0xecb8('0x1d')](QUERY,{'type':dbH[_0xecb8('0x15')]['QueryTypes'][_0xecb8('0x18')]}));}var _0x484444=path['dirname'](PATH);var _0x23b4ca=path[_0xecb8('0x1f')](PATH,_0xecb8('0x20'));var _0x518bd4=_0x26bcd4[_0xecb8('0x12')]&&_0x2c1bf5[_0xecb8('0x1a')]>0x1;var _0xade894=[];if(!fs[_0xecb8('0x21')](path['join'](_0x484444,_0x23b4ca))&&_0x518bd4){fs['mkdirSync'](path['join'](_0x484444,_0x23b4ca));}return BPromise[_0xecb8('0x22')](_0x2c1bf5,function(_0x37c6c7){_0xade894[_0xecb8('0x1c')](_0x37c6c7);})[_0xecb8('0x14')](function(){for(var _0x40cd83=0x0;_0x40cd83<_0xade894[_0xecb8('0x1a')];_0x40cd83+=0x1){var _0x42c5ee;var _0x29e990=_0xade894[_0x40cd83];if(_0x518bd4){_0x42c5ee=path[_0xecb8('0x23')](_0x484444,_0x23b4ca,util[_0xecb8('0xd')](_0xecb8('0x24'),_0x23b4ca,_0x40cd83,_0xecb8('0x25')));}else{_0x42c5ee=path[_0xecb8('0x23')](_0x484444,util['format'](_0xecb8('0x26'),_0x23b4ca,_0xecb8('0x25')));}fs['writeFileSync'](_0x42c5ee,json2xls(_0x29e990),_0xecb8('0x27'));}})['then'](function(){if(_0x518bd4){return new Promise(function(_0x14789e){zipdir(path[_0xecb8('0x23')](_0x484444,_0x23b4ca),{'saveTo':path[_0xecb8('0x23')](_0x484444,util[_0xecb8('0xd')](_0xecb8('0x26'),_0x23b4ca,_0xecb8('0x28')))},function(_0x216686,_0x373951){rimraf(path[_0xecb8('0x23')](_0x484444,_0x23b4ca),function(){});_0x14789e(_0xecb8('0x29'));});});}})['then'](function(){logger['info'](util[_0xecb8('0xd')](_0xecb8('0x2a'),EXTRACTED_REPORT_ID,_0xecb8('0xf')));return analyticExtractedReport(_0xecb8('0x2b'),_0x518bd4?util[_0xecb8('0xd')](_0xecb8('0x26'),_0x23b4ca,_0x518bd4?'zip':_0xecb8('0x25')):null);});})[_0xecb8('0x2c')](function(_0x551b14){logger[_0xecb8('0xc')](util[_0xecb8('0xd')](_0xecb8('0x2d'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x551b14,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xecb8('0x2e')](function(){process[_0xecb8('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x61fe=['join','mkdirSync','each','%s%d.%s','writeFileSync','binary','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync'];(function(_0x38e288,_0x5782e9){var _0x47d030=function(_0x5e6b53){while(--_0x5e6b53){_0x38e288['push'](_0x38e288['shift']());}};_0x47d030(++_0x5782e9);}(_0x61fe,0x1be));var _0xe61f=function(_0x536ed2,_0x2c191d){_0x536ed2=_0x536ed2-0x0;var _0x552cf2=_0x61fe[_0x536ed2];return _0x552cf2;};'use strict';var util=require(_0xe61f('0x0'));var path=require(_0xe61f('0x1'));var _=require(_0xe61f('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xe61f('0x3'))['db'];var dbH=require(_0xe61f('0x3'))[_0xe61f('0x4')];var logger=require(_0xe61f('0x5'))(_0xe61f('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xe61f('0x7')][0x2]);var QUERY=process[_0xe61f('0x7')][0x3];var PATH=process[_0xe61f('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4cb6f6,_0x1fb913){var _0x49de53={'status':_0x4cb6f6};var _0x30a059={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1fb913){_0x49de53[_0xe61f('0x8')]=_0x1fb913;}return db[_0xe61f('0x9')]['update'](_0x49de53,_0x30a059);}function main(){var _0x530894=0x1388;var _0x58fe98;logger[_0xe61f('0xa')](util[_0xe61f('0xb')](_0xe61f('0xc'),EXTRACTED_REPORT_ID,_0xe61f('0xd')));return db[_0xe61f('0xe')][_0xe61f('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe61f('0x10'),_0xe61f('0x11')]})['then'](function(_0x9fa782){if(_0x9fa782){_0x58fe98=_0x9fa782;_0x530894=_0x58fe98[_0xe61f('0x11')]||0x1388;}})[_0xe61f('0x12')](function(){return dbH[_0xe61f('0x13')][_0xe61f('0x14')](util[_0xe61f('0xb')](_0xe61f('0x15'),QUERY),{'type':dbH[_0xe61f('0x13')][_0xe61f('0x16')][_0xe61f('0x17')]});})[_0xe61f('0x12')](function(_0x454365){if(!_0x454365[0x0][_0xe61f('0x18')]){return analyticExtractedReport(_0xe61f('0x19'));}var _0x5537c0=[];var _0x13e234=0x0;if(_0x58fe98[_0xe61f('0x10')]){if(_0x454365&&_0x454365[_0xe61f('0x1a')]){var _0x20e3bc=_[_0xe61f('0x1b')](_0x454365[0x0]['num']/_0x530894);var _0x242d85=Number['isInteger'](_0x454365[0x0]['num']/_0x530894)?_0x454365[0x0][_0xe61f('0x18')]%_0x530894:0x0;_0x20e3bc[_0xe61f('0x1c')](function(_0x42f480){if(_0x42f480>0x0){_0x13e234+=_0x530894;}_0x5537c0[_0xe61f('0x1d')](dbH[_0xe61f('0x13')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x530894,_0x13e234),{'type':dbH[_0xe61f('0x13')][_0xe61f('0x16')]['SELECT']}));});if(_0x242d85>0x0){_0x13e234+=_0x530894;_0x5537c0[_0xe61f('0x1d')](dbH[_0xe61f('0x13')][_0xe61f('0x14')](util[_0xe61f('0xb')](_0xe61f('0x1e'),QUERY,_0x242d85,_0x13e234),{'type':dbH[_0xe61f('0x13')][_0xe61f('0x16')][_0xe61f('0x17')]}));}}}else{_0x5537c0[_0xe61f('0x1d')](dbH['sequelize'][_0xe61f('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xe61f('0x17')]}));}var _0x504741=path['dirname'](PATH);var _0x32b4e6=path[_0xe61f('0x1f')](PATH,_0xe61f('0x20'));var _0x4266c6=_0x58fe98['split']&&_0x5537c0[_0xe61f('0x1a')]>0x1;var _0x550d49=[];if(!fs[_0xe61f('0x21')](path[_0xe61f('0x22')](_0x504741,_0x32b4e6))&&_0x4266c6){fs[_0xe61f('0x23')](path['join'](_0x504741,_0x32b4e6));}return BPromise[_0xe61f('0x24')](_0x5537c0,function(_0x22670e){_0x550d49[_0xe61f('0x1d')](_0x22670e);})[_0xe61f('0x12')](function(){for(var _0x18fea5=0x0;_0x18fea5<_0x550d49[_0xe61f('0x1a')];_0x18fea5+=0x1){var _0x305457;var _0x531448=_0x550d49[_0x18fea5];if(_0x4266c6){_0x305457=path[_0xe61f('0x22')](_0x504741,_0x32b4e6,util['format'](_0xe61f('0x25'),_0x32b4e6,_0x18fea5,'xlsx'));}else{_0x305457=path[_0xe61f('0x22')](_0x504741,util[_0xe61f('0xb')]('%s.%s',_0x32b4e6,'xlsx'));}fs[_0xe61f('0x26')](_0x305457,json2xls(_0x531448),_0xe61f('0x27'));}})[_0xe61f('0x12')](function(){if(_0x4266c6){return new Promise(function(_0x3905fe){zipdir(path[_0xe61f('0x22')](_0x504741,_0x32b4e6),{'saveTo':path['join'](_0x504741,util[_0xe61f('0xb')]('%s.%s',_0x32b4e6,_0xe61f('0x28')))},function(_0xcc35aa,_0x44ce60){rimraf(path['join'](_0x504741,_0x32b4e6),function(){});_0x3905fe(_0xe61f('0x29'));});});}})[_0xe61f('0x12')](function(){logger['info'](util[_0xe61f('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xe61f('0xd')));return analyticExtractedReport(_0xe61f('0x2a'),_0x4266c6?util[_0xe61f('0xb')]('%s.%s',_0x32b4e6,_0x4266c6?_0xe61f('0x28'):'xlsx'):null);});})[_0xe61f('0x2b')](function(_0x175113){logger[_0xe61f('0xa')](util[_0xe61f('0xb')](_0xe61f('0x2c'),EXTRACTED_REPORT_ID,_0xe61f('0xd')),util[_0xe61f('0x2d')](_0x175113,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe61f('0x2e'));})['finally'](function(){process[_0xe61f('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
index 233e50c..149304a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf562=['$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','interval','*,*,*,*','map','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','lodash','util','models','then','intervals','findAll','IntervalId','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','find','push','type','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','cutdigits','${EXTEN}','ExecIf'];(function(_0x5e408d,_0x29e799){var _0x83d1fc=function(_0x184662){while(--_0x184662){_0x5e408d['push'](_0x5e408d['shift']());}};_0x83d1fc(++_0x29e799);}(_0xf562,0x6b));var _0x2f56=function(_0x3c27b3,_0x178edc){_0x3c27b3=_0x3c27b3-0x0;var _0x2fa01b=_0xf562[_0x3c27b3];return _0x2fa01b;};'use strict';var _=require(_0x2f56('0x0'));var util=require(_0x2f56('0x1'));function rewrite(_0x21f281,_0xdd1a4a){var _0x43bdc4=this;return _0x21f281[_0x2f56('0x2')]['Interval']['findAll']({'raw':!![]})[_0x2f56('0x3')](function(_0x33a318){_0x43bdc4[_0x2f56('0x4')]=_0x33a318;return _0x21f281['models']['VoiceExtension'][_0x2f56('0x5')]({'where':{'IntervalId':_0xdd1a4a[_0x2f56('0x6')]},'raw':!![]});})[_0x2f56('0x3')](function(_0x254dad){return _0x21f281['models'][_0x2f56('0x7')]['findAll']({'where':{'exten':{'$in':_[_0x2f56('0x8')](_['map'](_0x254dad,_0x2f56('0x9')))}},'order':[{'raw':_0x2f56('0xa')}],'raw':!![]});})['then'](function(_0x3b756b){var _0xb50fd1=_[_0x2f56('0xb')](_0x3b756b,{'priority':'1'});var _0x2f110f=_[_0x2f56('0xb')](_0x3b756b,{'isApp':0x1});var _0x129876=_[_0x2f56('0xc')](_0x2f110f,_0x2f56('0x9'));var _0x15a427=['queue',_0x2f56('0xd')];var _0x59cdbf=[];var _0x5a62f8=[];for(var _0xd5a446 in _0x129876){if(_0x129876[_0x2f56('0xe')](_0xd5a446)){_0x43bdc4[_0x2f56('0xf')]=0x2;_0x43bdc4[_0x2f56('0x10')]=[];_0x43bdc4[_0x2f56('0x11')]=_[_0x2f56('0x12')](_0xb50fd1,{'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')]});_0x43bdc4[_0x2f56('0x10')][_0x2f56('0x13')]({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':'Set','appdata':util['format'](_0x2f56('0x15'),_0x129876[_0xd5a446][0x0]['type']),'context':_0x129876[_0xd5a446][0x0][_0x2f56('0x16')],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x43bdc4[_0x2f56('0xf')]++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});if(_0x129876[_0xd5a446][0x0][_0x2f56('0x14')]===_0x2f56('0x18')){_0x43bdc4[_0x2f56('0x10')][_0x2f56('0x13')]({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':_0x2f56('0x19'),'appdata':_0x2f56('0x1a')+_0x129876[_0xd5a446][0x0][_0x2f56('0x17')],'context':_0x129876[_0xd5a446][0x0][_0x2f56('0x16')],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x43bdc4['priority']++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});}else if(_0x129876[_0xd5a446][0x0]['type']===_0x2f56('0x1b')){if(_0x43bdc4['extension']){_0x43bdc4[_0x2f56('0x10')][_0x2f56('0x13')]({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':_0x2f56('0x19'),'appdata':'CDR(destination)='+(_0x43bdc4[_0x2f56('0x11')][_0x2f56('0x1c')]?'${EXTEN:'+_0x43bdc4['extension'][_0x2f56('0x1c')]+'}':_0x2f56('0x1d')),'context':_0x129876[_0xd5a446][0x0][_0x2f56('0x16')],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x43bdc4[_0x2f56('0xf')]++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});}_0x43bdc4[_0x2f56('0x10')][_0x2f56('0x13')]({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':_0x2f56('0x19'),'appdata':_0x2f56('0x1a')+_0x129876[_0xd5a446][0x0][_0x2f56('0x17')],'context':_0x129876[_0xd5a446][0x0][_0x2f56('0x16')],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x43bdc4['priority']++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0]['VoiceExtensionId']});var _0x5ca38=_0x43bdc4[_0x2f56('0xf')]++;_0x43bdc4[_0x2f56('0x10')][_0x2f56('0x13')]({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':_0x2f56('0x1e'),'appdata':_0x2f56('0x1f')+(_0x5ca38+0x2)+_0x2f56('0x20')+(_0x5ca38+0x1)+')','context':_0x129876[_0xd5a446][0x0][_0x2f56('0x16')],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x5ca38,'VoiceExtensionId':_0x129876[_0xd5a446][0x0]['VoiceExtensionId']});if(_0x43bdc4[_0x2f56('0x11')]){_0x43bdc4['extensions'][_0x2f56('0x13')]({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':_0x2f56('0x19'),'appdata':_0x43bdc4[_0x2f56('0x11')][_0x2f56('0x1c')]?_0x2f56('0x21')+_0x43bdc4['extension'][_0x2f56('0x1c')]+'}':_0x2f56('0x22'),'context':_0x129876[_0xd5a446][0x0]['context'],'exten':_0x129876[_0xd5a446][0x0]['exten'],'priority':_0x43bdc4[_0x2f56('0xf')]++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});}_0x43bdc4[_0x2f56('0x10')][_0x2f56('0x13')]({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':'Set','appdata':_0x2f56('0x23')+_0x129876[_0xd5a446][0x0]['VoiceExtensionId'],'context':_0x129876[_0xd5a446][0x0][_0x2f56('0x16')],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x43bdc4['priority']++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});if(_0x43bdc4['extension']&&_0x43bdc4[_0x2f56('0x11')][_0x2f56('0xe')]('recordingFormat')&&_0x43bdc4[_0x2f56('0x11')]['recordingFormat']!==_0x2f56('0x24')){_0x43bdc4['extensions'][_0x2f56('0x13')]({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':_0x2f56('0x19'),'appdata':_0x2f56('0x25'),'context':_0x129876[_0xd5a446][0x0][_0x2f56('0x16')],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x43bdc4[_0x2f56('0xf')]++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0]['VoiceExtensionId']});_0x43bdc4[_0x2f56('0x10')]['push']({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':_0x2f56('0x19'),'appdata':_0x2f56('0x26')+_0x43bdc4[_0x2f56('0x11')][_0x2f56('0x27')]||'wav','context':_0x129876[_0xd5a446][0x0][_0x2f56('0x16')],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x43bdc4[_0x2f56('0xf')]++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});}}_0x43bdc4[_0x2f56('0x10')]['push']({'type':_0x129876[_0xd5a446][0x0]['type'],'app':_0x2f56('0x19'),'appdata':_0x2f56('0x28'),'context':_0x129876[_0xd5a446][0x0]['context'],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x43bdc4[_0x2f56('0xf')]++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});_0x43bdc4[_0x2f56('0x10')]['push']({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':_0x2f56('0x19'),'appdata':_0x2f56('0x29'),'context':_0x129876[_0xd5a446][0x0][_0x2f56('0x16')],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x43bdc4[_0x2f56('0xf')]++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});_0x43bdc4[_0x2f56('0x10')][_0x2f56('0x13')]({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':_0x2f56('0x19'),'appdata':_0x2f56('0x2a'),'context':_0x129876[_0xd5a446][0x0][_0x2f56('0x16')],'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'priority':_0x43bdc4[_0x2f56('0xf')]++,'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});for(var _0x493ee0=0x0,_0x4d1de5=0x0;_0x493ee0<_0x129876[_0xd5a446][_0x2f56('0x2b')];_0x493ee0+=0x1,_0x4d1de5=0x0){var _0x59180b=_0x129876[_0xd5a446][_0x493ee0];if(_0x59180b[_0x2f56('0x14')]){_0x59180b[_0x2f56('0x14')]=_0x59180b[_0x2f56('0x14')][_0x2f56('0x2c')]();}var _0x451096=[];var _0x58c486=[];delete _0x59180b['id'];delete _0x59180b['createdAt'];delete _0x59180b['updatedAt'];var _0x307a66=_0x59180b[_0x2f56('0x2d')]!==_0x2f56('0x2e')?[_0x59180b[_0x2f56('0x2d')]]:_0x59180b[_0x2f56('0x6')]?_[_0x2f56('0x2f')](_[_0x2f56('0xb')](_0x43bdc4['intervals'],{'IntervalId':_0x59180b[_0x2f56('0x6')]}),'interval'):[];if(_0x59180b['hasOwnProperty'](_0x2f56('0x30'))){if(_0x59180b[_0x2f56('0x30')]&&_0x59180b[_0x2f56('0x30')]!=='--'){_0x451096['push']({'type':_0x59180b[_0x2f56('0x14')],'app':_0x2f56('0x19'),'appdata':'CDR(tag)='+_0x59180b[_0x2f56('0x30')],'context':_0x59180b[_0x2f56('0x16')],'exten':_0x59180b['exten'],'priority':_0x307a66['length']+_0x43bdc4[_0x2f56('0xf')]+_0x4d1de5++,'VoiceExtensionId':_0x59180b['VoiceExtensionId']});}}if(_0x59180b[_0x2f56('0x14')]==='outbound'&&_0x59180b[_0x2f56('0xe')]('callerID')){if(_0x59180b['callerID']){_0x451096[_0x2f56('0x13')]({'type':_0x59180b[_0x2f56('0x14')],'app':_0x2f56('0x1e'),'appdata':_0x2f56('0x31')+_0x59180b[_0x2f56('0x32')]+')','context':_0x59180b[_0x2f56('0x16')],'exten':_0x59180b['exten'],'priority':_0x307a66[_0x2f56('0x2b')]+_0x43bdc4[_0x2f56('0xf')]+_0x4d1de5++,'VoiceExtensionId':_0x59180b['VoiceExtensionId']});}else{_0x451096[_0x2f56('0x13')]({'type':_0x59180b['type'],'app':_0x2f56('0x1e'),'appdata':_0x2f56('0x33'),'context':_0x59180b[_0x2f56('0x16')],'exten':_0x59180b[_0x2f56('0x9')],'priority':_0x307a66['length']+_0x43bdc4[_0x2f56('0xf')]+_0x4d1de5++,'VoiceExtensionId':_0x59180b['VoiceExtensionId']});}}if(_0x59180b[_0x2f56('0xe')](_0x2f56('0x34'))){if(_0x15a427[_0x2f56('0x35')](_0x59180b['app'][_0x2f56('0x2c')]())>=0x0&&_0x59180b[_0x2f56('0x36')]!==_0x2f56('0x37')){if(_0x59180b[_0x2f56('0x34')]){_0x451096['push']({'type':_0x59180b['type'],'app':_0x2f56('0x1e'),'appdata':_0x2f56('0x38'),'context':_0x59180b[_0x2f56('0x16')],'exten':_0x59180b[_0x2f56('0x9')],'priority':_0x307a66['length']+_0x43bdc4[_0x2f56('0xf')]+_0x4d1de5++,'VoiceExtensionId':_0x59180b['VoiceExtensionId']});_0x451096[_0x2f56('0x13')]({'type':_0x59180b[_0x2f56('0x14')],'app':_0x2f56('0x19'),'appdata':_0x2f56('0x39'),'context':_0x59180b['context'],'exten':_0x59180b[_0x2f56('0x9')],'priority':_0x307a66['length']+_0x43bdc4['priority']+_0x4d1de5++,'VoiceExtensionId':_0x59180b['VoiceExtensionId']});}else{_0x451096[_0x2f56('0x13')]({'type':_0x59180b[_0x2f56('0x14')],'app':_0x2f56('0x1e'),'appdata':_0x2f56('0x3a'),'context':_0x59180b[_0x2f56('0x16')],'exten':_0x59180b[_0x2f56('0x9')],'priority':_0x307a66[_0x2f56('0x2b')]+_0x43bdc4['priority']+_0x4d1de5++,'VoiceExtensionId':_0x59180b[_0x2f56('0x17')]});_0x451096[_0x2f56('0x13')]({'type':_0x59180b['type'],'app':'Set','appdata':_0x2f56('0x3b'),'context':_0x59180b['context'],'exten':_0x59180b['exten'],'priority':_0x307a66[_0x2f56('0x2b')]+_0x43bdc4[_0x2f56('0xf')]+_0x4d1de5++,'VoiceExtensionId':_0x59180b[_0x2f56('0x17')]});}}}for(var _0x507d13=0x0;_0x507d13<_0x307a66['length'];_0x507d13+=0x1){var _0x27d4e7=_0x43bdc4[_0x2f56('0xf')]+_0x307a66[_0x2f56('0x2b')];var _0x3eebe9=_0x507d13===_0x307a66[_0x2f56('0x2b')]-0x1?_0x43bdc4[_0x2f56('0xf')]+_0x451096[_0x2f56('0x2b')]+_0x58c486[_0x2f56('0x2b')]+0x2:_0x43bdc4['priority']+_0x507d13+0x1;_0x451096[_0x2f56('0x3c')](_0x507d13,0x0,{'type':_0x59180b[_0x2f56('0x14')],'app':_0x2f56('0x3d'),'appdata':_0x307a66[_0x507d13]+'?'+_0x59180b[_0x2f56('0x16')]+_0x2f56('0x3e')+_0x27d4e7+':'+_0x59180b[_0x2f56('0x16')]+_0x2f56('0x3e')+_0x3eebe9,'exten':_0x59180b[_0x2f56('0x9')],'context':_0x59180b['context'],'priority':_0x43bdc4[_0x2f56('0xf')]+_0x507d13,'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});}_0x59180b[_0x2f56('0xf')]=_0x451096[_0x2f56('0x2b')]?_[_0x2f56('0x3f')](_0x451096)[_0x2f56('0xf')]+0x1:_0x43bdc4[_0x2f56('0xf')];_0x43bdc4[_0x2f56('0xf')]=(_0x58c486['length']?_[_0x2f56('0x3f')](_0x58c486)[_0x2f56('0xf')]:_0x59180b[_0x2f56('0xf')])+0x1;_0x43bdc4['extensions']=_[_0x2f56('0x40')](_0x43bdc4['extensions'],_0x451096,[_0x59180b],_0x58c486);}_0x43bdc4[_0x2f56('0x10')]['push']({'type':_0x129876[_0xd5a446][0x0][_0x2f56('0x14')],'app':_0x2f56('0x41'),'exten':_0x129876[_0xd5a446][0x0][_0x2f56('0x9')],'context':_0x129876[_0xd5a446][0x0]['context'],'priority':_0x43bdc4[_0x2f56('0xf')],'VoiceExtensionId':_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]});_0x59cdbf[_0x2f56('0x13')](_0x129876[_0xd5a446][0x0][_0x2f56('0x17')]);_0x5a62f8=_[_0x2f56('0x40')](_0x5a62f8,_0x43bdc4[_0x2f56('0x10')]);}}return _0x21f281[_0x2f56('0x42')](function(_0x4dda9b){return _0x21f281[_0x2f56('0x2')][_0x2f56('0x7')][_0x2f56('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x59cdbf}},'transaction':_0x4dda9b})[_0x2f56('0x3')](function(_0x96db12){return _0x21f281[_0x2f56('0x2')][_0x2f56('0x7')][_0x2f56('0x44')](_['sortBy'](_0x5a62f8,_0x2f56('0xf')),{'transaction':_0x4dda9b});});});})['catch'](function(_0x544015){console['error'](_0x544015);});}exports['rewrite']=rewrite;
\ No newline at end of file
+var _0x3d01=['intervals','models','VoiceExtension','IntervalId','map','filter','groupBy','queue','playback','extensions','exten','push','Set','format','CDR(type)=%s','type','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','updatedAt','*,*,*,*','interval','hasOwnProperty','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','lodash','util','Interval','findAll','then'];(function(_0x1a9eb4,_0x472580){var _0x46be6f=function(_0x139239){while(--_0x139239){_0x1a9eb4['push'](_0x1a9eb4['shift']());}};_0x46be6f(++_0x472580);}(_0x3d01,0x10b));var _0x13d0=function(_0x58d702,_0x153566){_0x58d702=_0x58d702-0x0;var _0x1dcaf9=_0x3d01[_0x58d702];return _0x1dcaf9;};'use strict';var _=require(_0x13d0('0x0'));var util=require(_0x13d0('0x1'));function rewrite(_0x10250b,_0x259284){var _0x108cae=this;return _0x10250b['models'][_0x13d0('0x2')][_0x13d0('0x3')]({'raw':!![]})[_0x13d0('0x4')](function(_0x30db38){_0x108cae[_0x13d0('0x5')]=_0x30db38;return _0x10250b[_0x13d0('0x6')][_0x13d0('0x7')][_0x13d0('0x3')]({'where':{'IntervalId':_0x259284[_0x13d0('0x8')]},'raw':!![]});})[_0x13d0('0x4')](function(_0x2db9fc){return _0x10250b['models']['VoiceExtension'][_0x13d0('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x13d0('0x9')](_0x2db9fc,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x13d0('0x4')](function(_0x235af7){var _0x59838c=_[_0x13d0('0xa')](_0x235af7,{'priority':'1'});var _0x1a2f06=_['filter'](_0x235af7,{'isApp':0x1});var _0x4d5c2e=_[_0x13d0('0xb')](_0x1a2f06,'exten');var _0x5c9278=[_0x13d0('0xc'),_0x13d0('0xd')];var _0x373b58=[];var _0x20efab=[];for(var _0x43ae35 in _0x4d5c2e){if(_0x4d5c2e['hasOwnProperty'](_0x43ae35)){_0x108cae['priority']=0x2;_0x108cae[_0x13d0('0xe')]=[];_0x108cae['extension']=_['find'](_0x59838c,{'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')]});_0x108cae[_0x13d0('0xe')][_0x13d0('0x10')]({'type':_0x4d5c2e[_0x43ae35][0x0]['type'],'app':_0x13d0('0x11'),'appdata':util[_0x13d0('0x12')](_0x13d0('0x13'),_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x14')]),'context':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x15')],'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')],'priority':_0x108cae[_0x13d0('0x16')]++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')]});if(_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x14')]===_0x13d0('0x18')){_0x108cae[_0x13d0('0xe')]['push']({'type':_0x4d5c2e[_0x43ae35][0x0]['type'],'app':_0x13d0('0x11'),'appdata':_0x13d0('0x19')+_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')],'context':_0x4d5c2e[_0x43ae35][0x0]['context'],'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')],'priority':_0x108cae['priority']++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0]['VoiceExtensionId']});}else if(_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x14')]===_0x13d0('0x1a')){if(_0x108cae[_0x13d0('0x1b')]){_0x108cae[_0x13d0('0xe')][_0x13d0('0x10')]({'type':_0x4d5c2e[_0x43ae35][0x0]['type'],'app':_0x13d0('0x11'),'appdata':_0x13d0('0x1c')+(_0x108cae[_0x13d0('0x1b')][_0x13d0('0x1d')]?_0x13d0('0x1e')+_0x108cae[_0x13d0('0x1b')][_0x13d0('0x1d')]+'}':'${EXTEN}'),'context':_0x4d5c2e[_0x43ae35][0x0]['context'],'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')],'priority':_0x108cae[_0x13d0('0x16')]++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0]['VoiceExtensionId']});}_0x108cae[_0x13d0('0xe')]['push']({'type':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x14')],'app':_0x13d0('0x11'),'appdata':_0x13d0('0x19')+_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')],'context':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x15')],'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')],'priority':_0x108cae['priority']++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0]['VoiceExtensionId']});var _0x3f2d51=_0x108cae[_0x13d0('0x16')]++;_0x108cae[_0x13d0('0xe')][_0x13d0('0x10')]({'type':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x14')],'app':_0x13d0('0x1f'),'appdata':_0x13d0('0x20')+(_0x3f2d51+0x2)+'):Goto('+(_0x3f2d51+0x1)+')','context':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x15')],'exten':_0x4d5c2e[_0x43ae35][0x0]['exten'],'priority':_0x3f2d51,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')]});if(_0x108cae[_0x13d0('0x1b')]){_0x108cae[_0x13d0('0xe')][_0x13d0('0x10')]({'type':_0x4d5c2e[_0x43ae35][0x0]['type'],'app':_0x13d0('0x11'),'appdata':_0x108cae[_0x13d0('0x1b')]['cutdigits']?_0x13d0('0x21')+_0x108cae[_0x13d0('0x1b')][_0x13d0('0x1d')]+'}':_0x13d0('0x22'),'context':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x15')],'exten':_0x4d5c2e[_0x43ae35][0x0]['exten'],'priority':_0x108cae[_0x13d0('0x16')]++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')]});}_0x108cae[_0x13d0('0xe')]['push']({'type':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x14')],'app':_0x13d0('0x11'),'appdata':'outboundrouteid='+_0x4d5c2e[_0x43ae35][0x0]['VoiceExtensionId'],'context':_0x4d5c2e[_0x43ae35][0x0]['context'],'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')],'priority':_0x108cae['priority']++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')]});if(_0x108cae[_0x13d0('0x1b')]&&_0x108cae[_0x13d0('0x1b')]['hasOwnProperty'](_0x13d0('0x23'))&&_0x108cae[_0x13d0('0x1b')][_0x13d0('0x23')]!=='none'){_0x108cae['extensions']['push']({'type':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x14')],'app':_0x13d0('0x11'),'appdata':_0x13d0('0x24'),'context':_0x4d5c2e[_0x43ae35][0x0]['context'],'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')],'priority':_0x108cae[_0x13d0('0x16')]++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')]});_0x108cae[_0x13d0('0xe')][_0x13d0('0x10')]({'type':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x14')],'app':_0x13d0('0x11'),'appdata':_0x13d0('0x25')+_0x108cae[_0x13d0('0x1b')]['recordingFormat']||_0x13d0('0x26'),'context':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x15')],'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')],'priority':_0x108cae[_0x13d0('0x16')]++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')]});}}_0x108cae['extensions'][_0x13d0('0x10')]({'type':_0x4d5c2e[_0x43ae35][0x0]['type'],'app':_0x13d0('0x11'),'appdata':_0x13d0('0x27'),'context':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x15')],'exten':_0x4d5c2e[_0x43ae35][0x0]['exten'],'priority':_0x108cae['priority']++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0]['VoiceExtensionId']});_0x108cae['extensions'][_0x13d0('0x10')]({'type':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x14')],'app':_0x13d0('0x11'),'appdata':_0x13d0('0x28'),'context':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x15')],'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')],'priority':_0x108cae[_0x13d0('0x16')]++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')]});_0x108cae[_0x13d0('0xe')][_0x13d0('0x10')]({'type':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x14')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x15')],'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')],'priority':_0x108cae[_0x13d0('0x16')]++,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0]['VoiceExtensionId']});for(var _0x1bb165=0x0,_0x5cdf91=0x0;_0x1bb165<_0x4d5c2e[_0x43ae35][_0x13d0('0x29')];_0x1bb165+=0x1,_0x5cdf91=0x0){var _0x37b71c=_0x4d5c2e[_0x43ae35][_0x1bb165];if(_0x37b71c[_0x13d0('0x14')]){_0x37b71c[_0x13d0('0x14')]=_0x37b71c[_0x13d0('0x14')][_0x13d0('0x2a')]();}var _0x3cee6d=[];var _0x439612=[];delete _0x37b71c['id'];delete _0x37b71c['createdAt'];delete _0x37b71c[_0x13d0('0x2b')];var _0x501b2b=_0x37b71c['interval']!==_0x13d0('0x2c')?[_0x37b71c['interval']]:_0x37b71c['IntervalId']?_[_0x13d0('0x9')](_[_0x13d0('0xa')](_0x108cae['intervals'],{'IntervalId':_0x37b71c[_0x13d0('0x8')]}),_0x13d0('0x2d')):[];if(_0x37b71c[_0x13d0('0x2e')]('tag')){if(_0x37b71c[_0x13d0('0x2f')]&&_0x37b71c['tag']!=='--'){_0x3cee6d[_0x13d0('0x10')]({'type':_0x37b71c[_0x13d0('0x14')],'app':_0x13d0('0x11'),'appdata':_0x13d0('0x30')+_0x37b71c[_0x13d0('0x2f')],'context':_0x37b71c[_0x13d0('0x15')],'exten':_0x37b71c['exten'],'priority':_0x501b2b[_0x13d0('0x29')]+_0x108cae[_0x13d0('0x16')]+_0x5cdf91++,'VoiceExtensionId':_0x37b71c[_0x13d0('0x17')]});}}if(_0x37b71c[_0x13d0('0x14')]===_0x13d0('0x1a')&&_0x37b71c[_0x13d0('0x2e')](_0x13d0('0x31'))){if(_0x37b71c[_0x13d0('0x31')]){_0x3cee6d[_0x13d0('0x10')]({'type':_0x37b71c['type'],'app':_0x13d0('0x1f'),'appdata':_0x13d0('0x32')+_0x37b71c['callerID']+')','context':_0x37b71c[_0x13d0('0x15')],'exten':_0x37b71c[_0x13d0('0xf')],'priority':_0x501b2b['length']+_0x108cae[_0x13d0('0x16')]+_0x5cdf91++,'VoiceExtensionId':_0x37b71c[_0x13d0('0x17')]});}else{_0x3cee6d[_0x13d0('0x10')]({'type':_0x37b71c[_0x13d0('0x14')],'app':_0x13d0('0x1f'),'appdata':_0x13d0('0x33'),'context':_0x37b71c[_0x13d0('0x15')],'exten':_0x37b71c[_0x13d0('0xf')],'priority':_0x501b2b[_0x13d0('0x29')]+_0x108cae[_0x13d0('0x16')]+_0x5cdf91++,'VoiceExtensionId':_0x37b71c['VoiceExtensionId']});}}if(_0x37b71c[_0x13d0('0x2e')](_0x13d0('0x34'))){if(_0x5c9278['indexOf'](_0x37b71c['app'][_0x13d0('0x2a')]())>=0x0&&_0x37b71c[_0x13d0('0x35')]!==_0x13d0('0x36')){if(_0x37b71c['answer']){_0x3cee6d[_0x13d0('0x10')]({'type':_0x37b71c[_0x13d0('0x14')],'app':_0x13d0('0x1f'),'appdata':_0x13d0('0x37'),'context':_0x37b71c[_0x13d0('0x15')],'exten':_0x37b71c[_0x13d0('0xf')],'priority':_0x501b2b[_0x13d0('0x29')]+_0x108cae[_0x13d0('0x16')]+_0x5cdf91++,'VoiceExtensionId':_0x37b71c[_0x13d0('0x17')]});_0x3cee6d[_0x13d0('0x10')]({'type':_0x37b71c['type'],'app':_0x13d0('0x11'),'appdata':_0x13d0('0x38'),'context':_0x37b71c['context'],'exten':_0x37b71c[_0x13d0('0xf')],'priority':_0x501b2b[_0x13d0('0x29')]+_0x108cae[_0x13d0('0x16')]+_0x5cdf91++,'VoiceExtensionId':_0x37b71c[_0x13d0('0x17')]});}else{_0x3cee6d[_0x13d0('0x10')]({'type':_0x37b71c[_0x13d0('0x14')],'app':_0x13d0('0x1f'),'appdata':_0x13d0('0x39'),'context':_0x37b71c[_0x13d0('0x15')],'exten':_0x37b71c[_0x13d0('0xf')],'priority':_0x501b2b[_0x13d0('0x29')]+_0x108cae[_0x13d0('0x16')]+_0x5cdf91++,'VoiceExtensionId':_0x37b71c[_0x13d0('0x17')]});_0x3cee6d[_0x13d0('0x10')]({'type':_0x37b71c[_0x13d0('0x14')],'app':_0x13d0('0x11'),'appdata':_0x13d0('0x3a'),'context':_0x37b71c[_0x13d0('0x15')],'exten':_0x37b71c[_0x13d0('0xf')],'priority':_0x501b2b[_0x13d0('0x29')]+_0x108cae[_0x13d0('0x16')]+_0x5cdf91++,'VoiceExtensionId':_0x37b71c[_0x13d0('0x17')]});}}}for(var _0x74e0bc=0x0;_0x74e0bc<_0x501b2b[_0x13d0('0x29')];_0x74e0bc+=0x1){var _0x5ab241=_0x108cae[_0x13d0('0x16')]+_0x501b2b[_0x13d0('0x29')];var _0x50c94c=_0x74e0bc===_0x501b2b['length']-0x1?_0x108cae['priority']+_0x3cee6d['length']+_0x439612['length']+0x2:_0x108cae[_0x13d0('0x16')]+_0x74e0bc+0x1;_0x3cee6d['splice'](_0x74e0bc,0x0,{'type':_0x37b71c[_0x13d0('0x14')],'app':_0x13d0('0x3b'),'appdata':_0x501b2b[_0x74e0bc]+'?'+_0x37b71c['context']+',${EXTEN},'+_0x5ab241+':'+_0x37b71c[_0x13d0('0x15')]+_0x13d0('0x3c')+_0x50c94c,'exten':_0x37b71c[_0x13d0('0xf')],'context':_0x37b71c[_0x13d0('0x15')],'priority':_0x108cae[_0x13d0('0x16')]+_0x74e0bc,'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')]});}_0x37b71c[_0x13d0('0x16')]=_0x3cee6d[_0x13d0('0x29')]?_[_0x13d0('0x3d')](_0x3cee6d)[_0x13d0('0x16')]+0x1:_0x108cae[_0x13d0('0x16')];_0x108cae['priority']=(_0x439612[_0x13d0('0x29')]?_['last'](_0x439612)[_0x13d0('0x16')]:_0x37b71c[_0x13d0('0x16')])+0x1;_0x108cae[_0x13d0('0xe')]=_[_0x13d0('0x3e')](_0x108cae[_0x13d0('0xe')],_0x3cee6d,[_0x37b71c],_0x439612);}_0x108cae['extensions'][_0x13d0('0x10')]({'type':_0x4d5c2e[_0x43ae35][0x0]['type'],'app':_0x13d0('0x3f'),'exten':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0xf')],'context':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x15')],'priority':_0x108cae['priority'],'VoiceExtensionId':_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')]});_0x373b58[_0x13d0('0x10')](_0x4d5c2e[_0x43ae35][0x0][_0x13d0('0x17')]);_0x20efab=_[_0x13d0('0x3e')](_0x20efab,_0x108cae[_0x13d0('0xe')]);}}return _0x10250b[_0x13d0('0x40')](function(_0x1a6939){return _0x10250b[_0x13d0('0x6')]['VoiceExtension'][_0x13d0('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x373b58}},'transaction':_0x1a6939})['then'](function(_0x8be06){return _0x10250b[_0x13d0('0x6')][_0x13d0('0x7')]['bulkCreate'](_[_0x13d0('0x42')](_0x20efab,_0x13d0('0x16')),{'transaction':_0x1a6939});});});})[_0x13d0('0x43')](function(_0x46e600){console['error'](_0x46e600);});}exports['rewrite']=rewrite;
\ No newline at end of file
index 12eb0d1..f7d9e8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2038=['email\x20format\x20is\x20not\x20valid!','ListId','length','find','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','cmContact','checkHopper','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','NOW()','field','toString','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','insert','into','cm_contacts','deletedAt\x20IS\x20NULL','str','calleridnum','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','cm_hopper_black','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','query','VoiceQueueId','onlyIfOpen','sequelize','all','VoiceQueue','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','resolve','createReadStream','parse','duplicate','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','errors','message','join','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email'];(function(_0xcae096,_0x378c4b){var _0x371db0=function(_0x3e7c04){while(--_0x3e7c04){_0xcae096['push'](_0xcae096['shift']());}};_0x371db0(++_0x378c4b);}(_0x2038,0x18a));var _0x8203=function(_0x2f93c3,_0x155ebe){_0x2f93c3=_0x2f93c3-0x0;var _0x5dab59=_0x2038[_0x2f93c3];return _0x5dab59;};'use strict';var BPromise=require(_0x8203('0x0'));var util=require(_0x8203('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x8203('0x2'));var Papa=require(_0x8203('0x3'));var Redis=require(_0x8203('0x4'));var db=require(_0x8203('0x5'))['db'];var config=require(_0x8203('0x6'));var logger=require('../../../config/logger')('api');config[_0x8203('0x7')]=_[_0x8203('0x8')](config[_0x8203('0x7')],{'host':_0x8203('0x9'),'port':0x18eb});var socket=require(_0x8203('0xa'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x8203('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x8203('0xc')][0x2]===_0x8203('0xd')||process['argv'][0x2]==='null'){throw new Error(_0x8203('0xe'));}var FILEPATH=process['argv'][0x2];if(!process[_0x8203('0xc')][0x3]||process[_0x8203('0xc')][0x3]===_0x8203('0xd')||process[_0x8203('0xc')][0x3]===_0x8203('0xf')||!process[_0x8203('0xc')][0x4]||process['argv'][0x4]===_0x8203('0xd')||process[_0x8203('0xc')][0x4]==='null'){throw new Error(_0x8203('0x10'));}var FIELDS=_[_0x8203('0x11')](process[_0x8203('0xc')][0x3][_0x8203('0x12')](','),process[_0x8203('0xc')][0x4]['split'](','));if(!process[_0x8203('0xc')][0x5]||process[_0x8203('0xc')][0x5]===_0x8203('0xd')||process[_0x8203('0xc')][0x5]===_0x8203('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x8203('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x8203('0xc')][0x6]!==_0x8203('0xd')&&process[_0x8203('0xc')][0x6]!==_0x8203('0xf')?process[_0x8203('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x8203('0xc')][0x7]!==_0x8203('0xd')&&process[_0x8203('0xc')][0x7]!==_0x8203('0xf')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x8203('0xc')][0x8]==='undefined'||process['argv'][0x8]===_0x8203('0xf')){throw new Error(_0x8203('0x13'));}var SOCKET_TIMESTAMP=process[_0x8203('0xc')][0x8];}catch(_0x2a200b){logger[_0x8203('0x14')](_0x2a200b);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(_0x6148f4,_0x52aca9,_0x33fe4a,_0x2e0589){var _0x1fb9ee={'message':_0x52aca9};_0x1fb9ee[_0x6148f4]=!![];if(_0x33fe4a){_0x1fb9ee[_0x8203('0x15')]=_0x33fe4a;}if(_0x2e0589){_0x1fb9ee[_0x8203('0x16')]=_0x2e0589;}return _0x1fb9ee;}function isEmail(_0x17d156){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'](_0x17d156);}function checkRow(_0x2b6bf3,_0x19215f,_0x26f31d){return new BPromise(function(_0x299ee8,_0x335a94){if(_['isNil'](_0x2b6bf3)){return _0x335a94(handleCheckRowError(_0x8203('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x26f31d));}if(_0x2b6bf3[_0x8203('0x17')]&&_0x2b6bf3[_0x8203('0x17')]['length']){var _0x3dd3f1=_['map'](_0x2b6bf3[_0x8203('0x17')],_0x8203('0x18'))[_0x8203('0x19')](';');return _0x335a94(handleCheckRowError('error',_0x3dd3f1,null,_0x26f31d));}var _0x56f99f={};for(var _0x281a2f in FIELDS){if(FIELDS['hasOwnProperty'](_0x281a2f)&&FIELDS[_0x281a2f]){_0x56f99f[_0x281a2f]=_0x2b6bf3['data'][0x0][FIELDS[_0x281a2f]]||_0x2b6bf3['data'][0x0]['\ufeff'+FIELDS[_0x281a2f]];}}if(!_0x56f99f['firstName']){return _0x335a94(handleCheckRowError(_0x8203('0x14'),_0x8203('0x1a'),null,_0x26f31d));}if(!_0x56f99f[_0x8203('0x1b')]){return _0x335a94(handleCheckRowError(_0x8203('0x14'),_0x8203('0x1c'),null,_0x26f31d));}if(_0x56f99f[_0x8203('0x1d')]){var _0x3350f0=moment(_0x56f99f[_0x8203('0x1d')],_0x8203('0x1e'));if(!_0x3350f0[_0x8203('0x1f')]()){return _0x335a94(handleCheckRowError(_0x8203('0x14'),_0x8203('0x20'),null,_0x26f31d));}}if(_0x56f99f[_0x8203('0x21')]){if(!isEmail(_0x56f99f[_0x8203('0x21')])){return _0x335a94(handleCheckRowError(_0x8203('0x14'),_0x8203('0x22'),null,_0x26f31d));}}_0x56f99f[_0x8203('0x23')]=LISTID;_0x56f99f['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8203('0x24')]&&_0x19215f){var _0x47e7f0={};for(var _0x5ca9f5=0x0,_0x53f2f6=DUPLICATES[_0x8203('0x24')];_0x5ca9f5<_0x53f2f6;_0x5ca9f5+=0x1){_0x47e7f0[DUPLICATES[_0x5ca9f5]]=_0x56f99f[DUPLICATES[_0x5ca9f5]];}var _0x444c86=_[_0x8203('0x25')](_0x19215f,_0x47e7f0);if(_0x444c86){return _0x335a94(handleCheckRowError('duplicate',_0x8203('0x26'),_0x444c86,_0x26f31d));}}return db[_0x8203('0x27')][_0x8203('0x28')](_0x56f99f,{'raw':!![],'hooks':![],'fields':_[_0x8203('0x29')](_0x56f99f)})[_0x8203('0x2a')](function(_0x1df06e){if(DUPLICATES&&DUPLICATES[_0x8203('0x24')]&&_0x19215f){_0x19215f['push'](_[_0x8203('0x2b')](_0x56f99f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1df06e['id'];return _0x299ee8();})[_0x8203('0x2c')](function(_0x52a42e){return _0x335a94(handleCheckRowError(_0x8203('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x52a42e[_0x8203('0x18')]||JSON['stringify'](_0x52a42e)),null,_0x26f31d));});});}function checkHopper(){function _0x32f561(){return function(_0x2386ee){logger[_0x8203('0x14')](_0x8203('0x2d'),_0x8203('0x2e'),util['inspect'](_0x2386ee,{'showHidden':![],'depth':null}));};}var _0x2dc4da=function(_0x37828d,_0x11aedf){var _0x15dd32=squel['insert']()['into'](_0x8203('0x2f'))[_0x8203('0x30')]([_0x8203('0x1b'),_0x8203('0x31'),_0x8203('0x32'),_0x8203('0x23'),_0x11aedf,_0x8203('0x33'),_0x8203('0x34')],squel[_0x8203('0x35')]()['field'](_0x8203('0x1b'),_0x8203('0x1b'))['field'](_0x8203('0x36'),'scheduledAt')['field']('id',_0x8203('0x32'))[_0x8203('0x37')](LISTID[_0x8203('0x38')](),'ListId')[_0x8203('0x37')](_0x37828d['id'][_0x8203('0x38')](),_0x11aedf)[_0x8203('0x37')]('NOW()',_0x8203('0x33'))[_0x8203('0x37')](_0x8203('0x36'),_0x8203('0x34'))['from']('cm_contacts')[_0x8203('0x39')]('deletedAt\x20IS\x20NULL')[_0x8203('0x39')](_0x8203('0x3a'),LISTID[_0x8203('0x38')]())['where'](_0x8203('0x3b'))['where'](_0x8203('0x3c'),squel['select']()[_0x8203('0x37')](_0x8203('0x1b'))[_0x8203('0x3d')](_0x8203('0x2f'))[_0x8203('0x39')](_0x11aedf+'\x20=\x20?',_0x37828d['id'][_0x8203('0x38')]())))[_0x8203('0x38')]();return _0x15dd32;};var _0x320bd5=function(_0x457707,_0x31f10a){var _0x487ab5=squel[_0x8203('0x3e')]()[_0x8203('0x3f')](_0x8203('0x2f'))[_0x8203('0x30')]([_0x8203('0x1b'),_0x8203('0x31'),_0x8203('0x32'),_0x8203('0x23'),_0x31f10a,'createdAt',_0x8203('0x34')],squel[_0x8203('0x35')]()[_0x8203('0x37')](_0x8203('0x1b'),_0x8203('0x1b'))['field']('NOW()','scheduledAt')[_0x8203('0x37')]('id',_0x8203('0x32'))['field'](LISTID[_0x8203('0x38')](),'ListId')[_0x8203('0x37')](_0x457707['id'][_0x8203('0x38')](),_0x31f10a)[_0x8203('0x37')](_0x8203('0x36'),_0x8203('0x33'))[_0x8203('0x37')]('NOW()',_0x8203('0x34'))[_0x8203('0x3d')](_0x8203('0x40'))['where'](_0x8203('0x41'))['where']('ListId\x20=\x20?',LISTID[_0x8203('0x38')]())['where']('id\x20IN\x20?',squel[_0x8203('0x42')](hopperContacts))[_0x8203('0x39')](_0x8203('0x3b'))[_0x8203('0x39')](_0x8203('0x3c'),squel[_0x8203('0x35')]()['field'](_0x8203('0x43'))[_0x8203('0x3d')](_0x8203('0x44'))['where'](_0x31f10a+_0x8203('0x45'),_0x457707['id'][_0x8203('0x38')]()))[_0x8203('0x39')](_0x8203('0x3c'),squel['select']()[_0x8203('0x37')](_0x8203('0x1b'))['from']('cm_hopper')['where'](_0x31f10a+_0x8203('0x45'),_0x457707['id'][_0x8203('0x38')]())))[_0x8203('0x38')]();return _0x487ab5;};function _0x35e430(_0x22331d,_0x500433){var _0x11d368=squel[_0x8203('0x3e')]()[_0x8203('0x3f')]('cm_hopper')[_0x8203('0x30')]([_0x8203('0x1b'),'scheduledAt',_0x8203('0x32'),_0x8203('0x23'),_0x500433,'createdAt',_0x8203('0x34')],squel[_0x8203('0x35')]()[_0x8203('0x37')](_0x8203('0x1b'),_0x8203('0x1b'))[_0x8203('0x37')]('NOW()','scheduledAt')[_0x8203('0x37')]('id','ContactId')[_0x8203('0x37')](LISTID[_0x8203('0x38')](),_0x8203('0x23'))[_0x8203('0x37')](_0x22331d['id'][_0x8203('0x38')](),_0x500433)[_0x8203('0x37')](_0x8203('0x36'),_0x8203('0x33'))[_0x8203('0x37')]('NOW()',_0x8203('0x34'))['from'](_0x8203('0x40'))[_0x8203('0x39')](_0x8203('0x41'))[_0x8203('0x39')]('ListId\x20=\x20?',LISTID[_0x8203('0x38')]())['where'](_0x8203('0x46'),squel[_0x8203('0x42')](hopperContacts))[_0x8203('0x39')](_0x8203('0x3b')))[_0x8203('0x38')]();return _0x11d368;}function _0x348bae(_0x3e4121,_0x46b09d){var _0x3a39cc=squel[_0x8203('0x3e')]()[_0x8203('0x3f')](_0x8203('0x47'))['fromQuery']([_0x8203('0x1b'),'ContactId',_0x8203('0x23'),_0x46b09d,'createdAt',_0x8203('0x34')],squel[_0x8203('0x35')]()[_0x8203('0x37')]('phone',_0x8203('0x1b'))[_0x8203('0x37')]('id',_0x8203('0x32'))[_0x8203('0x37')](LISTID['toString'](),'ListId')[_0x8203('0x37')](_0x3e4121['id']['toString'](),_0x46b09d)[_0x8203('0x37')](_0x8203('0x36'),_0x8203('0x33'))[_0x8203('0x37')](_0x8203('0x36'),_0x8203('0x34'))[_0x8203('0x3d')]('cm_contacts')[_0x8203('0x39')](_0x8203('0x41'))[_0x8203('0x39')]('ListId\x20=\x20?',LISTID[_0x8203('0x38')]())[_0x8203('0x39')](_0x8203('0x46'),squel[_0x8203('0x42')](hopperContacts))[_0x8203('0x39')](_0x8203('0x3b')))[_0x8203('0x38')]();return _0x3a39cc;}return db['VoiceQueue']['findAll']({'where':{'type':_0x8203('0x48')},'attributes':['id',_0x8203('0x49')],'include':[{'model':db[_0x8203('0x4a')],'as':_0x8203('0x4b'),'where':{'id':LISTID}}]})['then'](function(_0x5081e1){var _0x1f25fe=[];if(_0x5081e1){var _0x8174a;for(var _0x525ca3=0x0,_0x401e34;_0x525ca3<_0x5081e1[_0x8203('0x24')];_0x525ca3+=0x1){_0x401e34=_0x5081e1[_0x525ca3][_0x8203('0x4c')]({'plain':!![]});switch(_0x401e34[_0x8203('0x49')]){case _0x8203('0x4d'):_0x1f25fe[_0x8203('0x4e')](db['sequelize'][_0x8203('0x4f')](_0x320bd5(_0x401e34,_0x8203('0x50')))[_0x8203('0x2a')](function(){})[_0x8203('0x2c')](_0x32f561()));break;case _0x8203('0x51'):_0x1f25fe[_0x8203('0x4e')](db[_0x8203('0x52')]['query'](_0x2dc4da(_0x401e34,_0x8203('0x50')))[_0x8203('0x2a')](function(){})['catch'](_0x32f561()));break;default:_0x1f25fe[_0x8203('0x4e')](db['sequelize'][_0x8203('0x4f')](_0x35e430(_0x401e34,_0x8203('0x50')))[_0x8203('0x2a')](function(){})[_0x8203('0x2c')](_0x32f561()));}}}return _0x1f25fe;})[_0x8203('0x53')]()[_0x8203('0x2a')](function(){return db[_0x8203('0x54')][_0x8203('0x55')]({'where':{'type':_0x8203('0x48')},'attributes':['id'],'include':[{'model':db[_0x8203('0x4a')],'as':_0x8203('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x15930d){var _0x290577=[];if(_0x15930d){var _0x21ba09;for(var _0x3e6a50=0x0,_0x376e69;_0x3e6a50<_0x15930d[_0x8203('0x24')];_0x3e6a50+=0x1){_0x376e69=_0x15930d[_0x3e6a50][_0x8203('0x4c')]({'plain':!![]});_0x290577['push'](db['sequelize'][_0x8203('0x4f')](_0x348bae(_0x376e69,_0x8203('0x50')))[_0x8203('0x2a')](function(){})[_0x8203('0x2c')](_0x32f561()));}}return _0x290577;})[_0x8203('0x53')]();})[_0x8203('0x2a')](function(){return db[_0x8203('0x57')][_0x8203('0x55')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x8203('0x4a')],'as':'Lists','where':{'id':LISTID}}]})[_0x8203('0x2a')](function(_0x1e7803){var _0x384d66=[];if(_0x1e7803){for(var _0x1aa6f3=0x0,_0x1ac217;_0x1aa6f3<_0x1e7803['length'];_0x1aa6f3+=0x1){_0x1ac217=_0x1e7803[_0x1aa6f3][_0x8203('0x4c')]({'plain':!![]});switch(_0x1ac217[_0x8203('0x49')]){case _0x8203('0x4d'):_0x384d66[_0x8203('0x4e')](db[_0x8203('0x52')][_0x8203('0x4f')](_0x320bd5(_0x1ac217,_0x8203('0x58')))[_0x8203('0x2a')](function(){})[_0x8203('0x2c')](_0x32f561()));break;case'onlyIfOpen':_0x384d66[_0x8203('0x4e')](db[_0x8203('0x52')][_0x8203('0x4f')](_0x2dc4da(_0x1ac217,_0x8203('0x58')))[_0x8203('0x2a')](function(){})[_0x8203('0x2c')](_0x32f561()));break;default:_0x384d66[_0x8203('0x4e')](db[_0x8203('0x52')][_0x8203('0x4f')](_0x35e430(_0x1ac217,_0x8203('0x58')))[_0x8203('0x2a')](function(){})[_0x8203('0x2c')](_0x32f561()));}}}return _0x384d66;})[_0x8203('0x53')]();})[_0x8203('0x2a')](function(){return db[_0x8203('0x57')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x8203('0x4a')],'as':_0x8203('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x5d38e4){var _0x42382b=[];if(_0x5d38e4){for(var _0x125f53=0x0,_0x606f2e;_0x125f53<_0x5d38e4[_0x8203('0x24')];_0x125f53+=0x1){_0x606f2e=_0x5d38e4[_0x125f53][_0x8203('0x4c')]({'plain':!![]});_0x42382b[_0x8203('0x4e')](db[_0x8203('0x52')]['query'](_0x348bae(_0x606f2e,_0x8203('0x58')))['then'](function(){})['catch'](_0x32f561()));}}return _0x42382b;})[_0x8203('0x53')]();})['catch'](function(_0x2fd266){logger[_0x8203('0x14')](_0x8203('0x59'),_0x8203('0x5a'),_0x2fd266[_0x8203('0x18')]);});}var processPromises=function(_0x42ff10){return BPromise['all'](promises)[_0x8203('0x2a')](function(_0x5bb003){})[_0x8203('0x2c')](function(_0x5841ff){logger['error'](_0x8203('0x5b'),JSON[_0x8203('0x5c')](_0x5841ff));})[_0x8203('0x5d')](function(){socket[_0x8203('0x5e')](_0x8203('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x42ff10){return _0x42ff10['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0x8203('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0x8203('0x2a')](function(){socket[_0x8203('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8203('0x60')](FILEPATH);}catch(_0x2df440){logger['error'](_0x8203('0x61'),JSON[_0x8203('0x5c')](_0x2df440));}finally{process[_0x8203('0x62')](0x0);}});};process['on']('SIGINT',function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x8203('0x63')]()[_0x8203('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x8203('0x27')][_0x8203('0x55')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x47e901){var _0x3f0c8f=fs[_0x8203('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8203('0x65')](_0x3f0c8f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2a0213,_0x2addb4){total+=0x1;var _0x161b95=total;promises[_0x8203('0x4e')](checkRow(_0x2a0213,_0x47e901,_0x161b95)[_0x8203('0x2a')](function(){success+=0x1;})[_0x8203('0x2c')](function(_0x510e21){if(_0x510e21[_0x8203('0x14')]){errors+=0x1;delete _0x510e21['error'];}else if(_0x510e21[_0x8203('0x66')]){duplicates+=0x1;delete _0x510e21[_0x8203('0x66')];}rows['push'](_0x510e21);}));if(total%0xc8===0x0){_0x2addb4['pause']();return processPromises(_0x2addb4);}},'complete':function(){return processPromises()[_0x8203('0x2a')](function(){logger[_0x8203('0x67')](_0x8203('0x68'));endCsv();});},'error':function(_0x549232,_0x5bccd1){logger['info'](_0x8203('0x69'),JSON[_0x8203('0x5c')](_0x549232));endCsv();}});})['catch'](function(_0x13b948){logger['error'](_0x8203('0x6a'),JSON['stringify'](_0x13b948));});}main();
\ No newline at end of file
+var _0x3eaf=['unlinkSync','SIGINT','CSV\x20import\x20process\x20stopped!','resolve','parse','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','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!','contact','index','test','isNil','error','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','phone','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','deletedAt\x20IS\x20NULL','calleridnum','cm_hopper_final','\x20=\x20?','fromQuery','id\x20IN\x20?','str','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','emit','contact:csv_'];(function(_0x19903c,_0x5192e4){var _0x222a6c=function(_0x2121ae){while(--_0x2121ae){_0x19903c['push'](_0x19903c['shift']());}};_0x222a6c(++_0x5192e4);}(_0x3eaf,0xe5));var _0xf3ea=function(_0x4ef701,_0x1bd1ce){_0x4ef701=_0x4ef701-0x0;var _0x4b329e=_0x3eaf[_0x4ef701];return _0x4b329e;};'use strict';var BPromise=require('bluebird');var util=require(_0xf3ea('0x0'));var _=require(_0xf3ea('0x1'));var fs=require('fs');var squel=require(_0xf3ea('0x2'));var Papa=require(_0xf3ea('0x3'));var Redis=require(_0xf3ea('0x4'));var db=require(_0xf3ea('0x5'))['db'];var config=require(_0xf3ea('0x6'));var logger=require(_0xf3ea('0x7'))('api');config[_0xf3ea('0x8')]=_[_0xf3ea('0x9')](config[_0xf3ea('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xf3ea('0xa'))(new Redis(config['redis']));require(_0xf3ea('0xb'))['register'](socket);try{if(!process[_0xf3ea('0xc')][0x2]||process[_0xf3ea('0xc')][0x2]===_0xf3ea('0xd')||process['argv'][0x2]===_0xf3ea('0xe')){throw new Error(_0xf3ea('0xf'));}var FILEPATH=process['argv'][0x2];if(!process[_0xf3ea('0xc')][0x3]||process[_0xf3ea('0xc')][0x3]===_0xf3ea('0xd')||process[_0xf3ea('0xc')][0x3]===_0xf3ea('0xe')||!process['argv'][0x4]||process[_0xf3ea('0xc')][0x4]==='undefined'||process[_0xf3ea('0xc')][0x4]===_0xf3ea('0xe')){throw new Error(_0xf3ea('0x10'));}var FIELDS=_[_0xf3ea('0x11')](process[_0xf3ea('0xc')][0x3][_0xf3ea('0x12')](','),process[_0xf3ea('0xc')][0x4]['split'](','));if(!process[_0xf3ea('0xc')][0x5]||process[_0xf3ea('0xc')][0x5]==='undefined'||process[_0xf3ea('0xc')][0x5]===_0xf3ea('0xe')){throw new Error(_0xf3ea('0x13'));}var LISTID=process[_0xf3ea('0xc')][0x5];var COMPANYID=process[_0xf3ea('0xc')][0x6]&&process[_0xf3ea('0xc')][0x6]!=='undefined'&&process[_0xf3ea('0xc')][0x6]!=='null'?process[_0xf3ea('0xc')][0x6]:null;var DUPLICATES=process[_0xf3ea('0xc')][0x7]&&process[_0xf3ea('0xc')][0x7]!==_0xf3ea('0xd')&&process[_0xf3ea('0xc')][0x7]!==_0xf3ea('0xe')?process[_0xf3ea('0xc')][0x7]:null;if(!process[_0xf3ea('0xc')][0x8]||process[_0xf3ea('0xc')][0x8]===_0xf3ea('0xd')||process[_0xf3ea('0xc')][0x8]===_0xf3ea('0xe')){throw new Error(_0xf3ea('0x14'));}var SOCKET_TIMESTAMP=process[_0xf3ea('0xc')][0x8];}catch(_0x329823){logger['error'](_0x329823);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(_0x3bcdf8,_0x5c14d9,_0x28d2c9,_0x376ee6){var _0x469e89={'message':_0x5c14d9};_0x469e89[_0x3bcdf8]=!![];if(_0x28d2c9){_0x469e89[_0xf3ea('0x15')]=_0x28d2c9;}if(_0x376ee6){_0x469e89[_0xf3ea('0x16')]=_0x376ee6;}return _0x469e89;}function isEmail(_0x1e5bae){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))*$/[_0xf3ea('0x17')](_0x1e5bae);}function checkRow(_0x2e4259,_0x3e431e,_0xeb7098){return new BPromise(function(_0x3c8569,_0x3026ab){if(_[_0xf3ea('0x18')](_0x2e4259)){return _0x3026ab(handleCheckRowError(_0xf3ea('0x19'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0xeb7098));}if(_0x2e4259[_0xf3ea('0x1a')]&&_0x2e4259[_0xf3ea('0x1a')][_0xf3ea('0x1b')]){var _0x33ba2b=_[_0xf3ea('0x1c')](_0x2e4259['errors'],_0xf3ea('0x1d'))[_0xf3ea('0x1e')](';');return _0x3026ab(handleCheckRowError(_0xf3ea('0x19'),_0x33ba2b,null,_0xeb7098));}var _0x23936f={};for(var _0x3849af in FIELDS){if(FIELDS['hasOwnProperty'](_0x3849af)&&FIELDS[_0x3849af]){_0x23936f[_0x3849af]=_0x2e4259['data'][0x0][FIELDS[_0x3849af]]||_0x2e4259[_0xf3ea('0x1f')][0x0]['\ufeff'+FIELDS[_0x3849af]];}}if(!_0x23936f[_0xf3ea('0x20')]){return _0x3026ab(handleCheckRowError(_0xf3ea('0x19'),_0xf3ea('0x21'),null,_0xeb7098));}if(!_0x23936f['phone']){return _0x3026ab(handleCheckRowError(_0xf3ea('0x19'),_0xf3ea('0x22'),null,_0xeb7098));}if(_0x23936f['birthDate']){var _0x576b2f=moment(_0x23936f[_0xf3ea('0x23')],_0xf3ea('0x24'));if(!_0x576b2f[_0xf3ea('0x25')]()){return _0x3026ab(handleCheckRowError(_0xf3ea('0x19'),_0xf3ea('0x26'),null,_0xeb7098));}}if(_0x23936f['email']){if(!isEmail(_0x23936f[_0xf3ea('0x27')])){return _0x3026ab(handleCheckRowError(_0xf3ea('0x19'),'email\x20format\x20is\x20not\x20valid!',null,_0xeb7098));}}_0x23936f[_0xf3ea('0x28')]=LISTID;_0x23936f[_0xf3ea('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xf3ea('0x1b')]&&_0x3e431e){var _0x2b977c={};for(var _0x1aed15=0x0,_0x231bac=DUPLICATES[_0xf3ea('0x1b')];_0x1aed15<_0x231bac;_0x1aed15+=0x1){_0x2b977c[DUPLICATES[_0x1aed15]]=_0x23936f[DUPLICATES[_0x1aed15]];}var _0xc2aec6=_[_0xf3ea('0x2a')](_0x3e431e,_0x2b977c);if(_0xc2aec6){return _0x3026ab(handleCheckRowError(_0xf3ea('0x2b'),_0xf3ea('0x2c'),_0xc2aec6,_0xeb7098));}}return db[_0xf3ea('0x2d')]['create'](_0x23936f,{'raw':!![],'hooks':![],'fields':_['keys'](_0x23936f)})[_0xf3ea('0x2e')](function(_0x954802){if(DUPLICATES&&DUPLICATES[_0xf3ea('0x1b')]&&_0x3e431e){_0x3e431e[_0xf3ea('0x2f')](_[_0xf3ea('0x30')](_0x23936f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x954802['id'];return _0x3c8569();})['catch'](function(_0x56b871){return _0x3026ab(handleCheckRowError(_0xf3ea('0x19'),_0xf3ea('0x31')+(_0x56b871['message']||JSON[_0xf3ea('0x32')](_0x56b871)),null,_0xeb7098));});});}function checkHopper(){function _0x12e2cc(){return function(_0x31b3ba){logger[_0xf3ea('0x19')](_0xf3ea('0x33'),_0xf3ea('0x34'),util[_0xf3ea('0x35')](_0x31b3ba,{'showHidden':![],'depth':null}));};}var _0x3b16f2=function(_0x529123,_0x3618e0){var _0x562780=squel[_0xf3ea('0x36')]()[_0xf3ea('0x37')](_0xf3ea('0x38'))['fromQuery']([_0xf3ea('0x39'),_0xf3ea('0x3a'),'ContactId',_0xf3ea('0x28'),_0x3618e0,_0xf3ea('0x3b'),_0xf3ea('0x3c')],squel[_0xf3ea('0x3d')]()['field']('phone',_0xf3ea('0x39'))[_0xf3ea('0x3e')](_0xf3ea('0x3f'),'scheduledAt')['field']('id',_0xf3ea('0x40'))[_0xf3ea('0x3e')](LISTID[_0xf3ea('0x41')](),'ListId')['field'](_0x529123['id']['toString'](),_0x3618e0)[_0xf3ea('0x3e')](_0xf3ea('0x3f'),_0xf3ea('0x3b'))[_0xf3ea('0x3e')](_0xf3ea('0x3f'),'updatedAt')[_0xf3ea('0x42')](_0xf3ea('0x43'))[_0xf3ea('0x44')]('deletedAt\x20IS\x20NULL')[_0xf3ea('0x44')](_0xf3ea('0x45'),LISTID['toString']())[_0xf3ea('0x44')](_0xf3ea('0x46'))[_0xf3ea('0x44')](_0xf3ea('0x47'),squel[_0xf3ea('0x3d')]()[_0xf3ea('0x3e')]('phone')[_0xf3ea('0x42')](_0xf3ea('0x38'))[_0xf3ea('0x44')](_0x3618e0+'\x20=\x20?',_0x529123['id'][_0xf3ea('0x41')]())))['toString']();return _0x562780;};var _0x595bb1=function(_0x158434,_0x5333a9){var _0x19a5e5=squel['insert']()['into'](_0xf3ea('0x38'))['fromQuery'](['phone',_0xf3ea('0x3a'),'ContactId',_0xf3ea('0x28'),_0x5333a9,_0xf3ea('0x3b'),_0xf3ea('0x3c')],squel['select']()['field']('phone',_0xf3ea('0x39'))[_0xf3ea('0x3e')](_0xf3ea('0x3f'),_0xf3ea('0x3a'))[_0xf3ea('0x3e')]('id',_0xf3ea('0x40'))['field'](LISTID[_0xf3ea('0x41')](),_0xf3ea('0x28'))['field'](_0x158434['id'][_0xf3ea('0x41')](),_0x5333a9)[_0xf3ea('0x3e')](_0xf3ea('0x3f'),_0xf3ea('0x3b'))[_0xf3ea('0x3e')](_0xf3ea('0x3f'),'updatedAt')[_0xf3ea('0x42')]('cm_contacts')[_0xf3ea('0x44')](_0xf3ea('0x48'))[_0xf3ea('0x44')]('ListId\x20=\x20?',LISTID[_0xf3ea('0x41')]())[_0xf3ea('0x44')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xf3ea('0x44')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xf3ea('0x47'),squel[_0xf3ea('0x3d')]()[_0xf3ea('0x3e')](_0xf3ea('0x49'))[_0xf3ea('0x42')](_0xf3ea('0x4a'))[_0xf3ea('0x44')](_0x5333a9+_0xf3ea('0x4b'),_0x158434['id'][_0xf3ea('0x41')]()))[_0xf3ea('0x44')](_0xf3ea('0x47'),squel[_0xf3ea('0x3d')]()[_0xf3ea('0x3e')]('phone')['from'](_0xf3ea('0x38'))[_0xf3ea('0x44')](_0x5333a9+'\x20=\x20?',_0x158434['id'][_0xf3ea('0x41')]())))['toString']();return _0x19a5e5;};function _0x446fa8(_0x591780,_0x3043a8){var _0x511c68=squel['insert']()[_0xf3ea('0x37')](_0xf3ea('0x38'))[_0xf3ea('0x4c')]([_0xf3ea('0x39'),_0xf3ea('0x3a'),_0xf3ea('0x40'),'ListId',_0x3043a8,_0xf3ea('0x3b'),_0xf3ea('0x3c')],squel[_0xf3ea('0x3d')]()[_0xf3ea('0x3e')]('phone',_0xf3ea('0x39'))[_0xf3ea('0x3e')](_0xf3ea('0x3f'),_0xf3ea('0x3a'))[_0xf3ea('0x3e')]('id',_0xf3ea('0x40'))['field'](LISTID[_0xf3ea('0x41')](),_0xf3ea('0x28'))[_0xf3ea('0x3e')](_0x591780['id'][_0xf3ea('0x41')](),_0x3043a8)[_0xf3ea('0x3e')](_0xf3ea('0x3f'),_0xf3ea('0x3b'))['field'](_0xf3ea('0x3f'),_0xf3ea('0x3c'))[_0xf3ea('0x42')](_0xf3ea('0x43'))[_0xf3ea('0x44')](_0xf3ea('0x48'))[_0xf3ea('0x44')](_0xf3ea('0x45'),LISTID[_0xf3ea('0x41')]())[_0xf3ea('0x44')](_0xf3ea('0x4d'),squel[_0xf3ea('0x4e')](hopperContacts))[_0xf3ea('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0xf3ea('0x41')]();return _0x511c68;}function _0x59410f(_0x3bb393,_0x1e377e){var _0x489810=squel[_0xf3ea('0x36')]()['into'](_0xf3ea('0x4f'))['fromQuery']([_0xf3ea('0x39'),'ContactId',_0xf3ea('0x28'),_0x1e377e,_0xf3ea('0x3b'),'updatedAt'],squel['select']()[_0xf3ea('0x3e')](_0xf3ea('0x39'),_0xf3ea('0x39'))[_0xf3ea('0x3e')]('id','ContactId')['field'](LISTID[_0xf3ea('0x41')](),'ListId')[_0xf3ea('0x3e')](_0x3bb393['id'][_0xf3ea('0x41')](),_0x1e377e)[_0xf3ea('0x3e')]('NOW()','createdAt')[_0xf3ea('0x3e')](_0xf3ea('0x3f'),_0xf3ea('0x3c'))['from'](_0xf3ea('0x43'))[_0xf3ea('0x44')](_0xf3ea('0x48'))[_0xf3ea('0x44')]('ListId\x20=\x20?',LISTID[_0xf3ea('0x41')]())[_0xf3ea('0x44')](_0xf3ea('0x4d'),squel['str'](hopperContacts))[_0xf3ea('0x44')](_0xf3ea('0x46')))[_0xf3ea('0x41')]();return _0x489810;}return db[_0xf3ea('0x50')]['findAll']({'where':{'type':_0xf3ea('0x51')},'attributes':['id',_0xf3ea('0x52')],'include':[{'model':db[_0xf3ea('0x53')],'as':_0xf3ea('0x54'),'where':{'id':LISTID}}]})[_0xf3ea('0x2e')](function(_0x399981){var _0xe8c1d7=[];if(_0x399981){var _0x3bd035;for(var _0x27bb10=0x0,_0x10db82;_0x27bb10<_0x399981[_0xf3ea('0x1b')];_0x27bb10+=0x1){_0x10db82=_0x399981[_0x27bb10][_0xf3ea('0x55')]({'plain':!![]});switch(_0x10db82[_0xf3ea('0x52')]){case _0xf3ea('0x56'):_0xe8c1d7['push'](db[_0xf3ea('0x57')][_0xf3ea('0x58')](_0x595bb1(_0x10db82,_0xf3ea('0x59')))[_0xf3ea('0x2e')](function(){})[_0xf3ea('0x5a')](_0x12e2cc()));break;case _0xf3ea('0x5b'):_0xe8c1d7[_0xf3ea('0x2f')](db[_0xf3ea('0x57')]['query'](_0x3b16f2(_0x10db82,_0xf3ea('0x59')))[_0xf3ea('0x2e')](function(){})[_0xf3ea('0x5a')](_0x12e2cc()));break;default:_0xe8c1d7[_0xf3ea('0x2f')](db[_0xf3ea('0x57')][_0xf3ea('0x58')](_0x446fa8(_0x10db82,_0xf3ea('0x59')))[_0xf3ea('0x2e')](function(){})[_0xf3ea('0x5a')](_0x12e2cc()));}}}return _0xe8c1d7;})[_0xf3ea('0x5c')]()[_0xf3ea('0x2e')](function(){return db[_0xf3ea('0x50')][_0xf3ea('0x5d')]({'where':{'type':_0xf3ea('0x51')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xf3ea('0x5e'),'where':{'id':LISTID}}]})[_0xf3ea('0x2e')](function(_0x1a6c4f){var _0x2ad1dc=[];if(_0x1a6c4f){var _0x14c887;for(var _0x3216e2=0x0,_0x1978bc;_0x3216e2<_0x1a6c4f[_0xf3ea('0x1b')];_0x3216e2+=0x1){_0x1978bc=_0x1a6c4f[_0x3216e2]['get']({'plain':!![]});_0x2ad1dc['push'](db['sequelize'][_0xf3ea('0x58')](_0x59410f(_0x1978bc,_0xf3ea('0x59')))[_0xf3ea('0x2e')](function(){})['catch'](_0x12e2cc()));}}return _0x2ad1dc;})['all']();})['then'](function(){return db[_0xf3ea('0x5f')][_0xf3ea('0x5d')]({'attributes':['id',_0xf3ea('0x52')],'include':[{'model':db[_0xf3ea('0x53')],'as':_0xf3ea('0x54'),'where':{'id':LISTID}}]})['then'](function(_0x12f335){var _0x4dc7d3=[];if(_0x12f335){for(var _0xd31207=0x0,_0x2cbb1d;_0xd31207<_0x12f335['length'];_0xd31207+=0x1){_0x2cbb1d=_0x12f335[_0xd31207]['get']({'plain':!![]});switch(_0x2cbb1d[_0xf3ea('0x52')]){case _0xf3ea('0x56'):_0x4dc7d3[_0xf3ea('0x2f')](db['sequelize']['query'](_0x595bb1(_0x2cbb1d,'CampaignId'))['then'](function(){})[_0xf3ea('0x5a')](_0x12e2cc()));break;case _0xf3ea('0x5b'):_0x4dc7d3[_0xf3ea('0x2f')](db[_0xf3ea('0x57')][_0xf3ea('0x58')](_0x3b16f2(_0x2cbb1d,'CampaignId'))[_0xf3ea('0x2e')](function(){})['catch'](_0x12e2cc()));break;default:_0x4dc7d3[_0xf3ea('0x2f')](db[_0xf3ea('0x57')]['query'](_0x446fa8(_0x2cbb1d,_0xf3ea('0x60')))['then'](function(){})['catch'](_0x12e2cc()));}}}return _0x4dc7d3;})[_0xf3ea('0x5c')]();})[_0xf3ea('0x2e')](function(){return db[_0xf3ea('0x5f')][_0xf3ea('0x5d')]({'attributes':['id'],'include':[{'model':db[_0xf3ea('0x53')],'as':_0xf3ea('0x5e'),'where':{'id':LISTID}}]})['then'](function(_0x34295c){var _0x512c46=[];if(_0x34295c){for(var _0x1d1acb=0x0,_0x23f2a7;_0x1d1acb<_0x34295c['length'];_0x1d1acb+=0x1){_0x23f2a7=_0x34295c[_0x1d1acb][_0xf3ea('0x55')]({'plain':!![]});_0x512c46[_0xf3ea('0x2f')](db[_0xf3ea('0x57')]['query'](_0x59410f(_0x23f2a7,_0xf3ea('0x60')))[_0xf3ea('0x2e')](function(){})[_0xf3ea('0x5a')](_0x12e2cc()));}}return _0x512c46;})['all']();})[_0xf3ea('0x5a')](function(_0x19c103){logger[_0xf3ea('0x19')](_0xf3ea('0x61'),_0xf3ea('0x62'),_0x19c103['message']);});}var processPromises=function(_0x5a4401){return BPromise[_0xf3ea('0x5c')](promises)[_0xf3ea('0x2e')](function(_0x3ecd7c){})[_0xf3ea('0x5a')](function(_0x2b2bb7){logger[_0xf3ea('0x19')]('Error\x20processing\x20rows\x20block:',JSON[_0xf3ea('0x32')](_0x2b2bb7));})['finally'](function(){socket[_0xf3ea('0x63')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5a4401){return _0x5a4401['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0xf3ea('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0xf3ea('0x2e')](function(){socket[_0xf3ea('0x63')](_0xf3ea('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xf3ea('0x65')](FILEPATH);}catch(_0x15dc3d){logger[_0xf3ea('0x19')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xf3ea('0x32')](_0x15dc3d));}finally{process['exit'](0x0);}});};process['on'](_0xf3ea('0x66'),function(){logger['info'](_0xf3ea('0x67'));endCsv();});function main(){return BPromise[_0xf3ea('0x68')]()[_0xf3ea('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xf3ea('0x12')](',');return db[_0xf3ea('0x2d')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1915ab){var _0x35a8e7=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xf3ea('0x69')](_0x35a8e7,{'header':!![],'skipEmptyLines':!![],'step':function(_0x346d8d,_0x29f3f2){total+=0x1;var _0x685025=total;promises[_0xf3ea('0x2f')](checkRow(_0x346d8d,_0x1915ab,_0x685025)[_0xf3ea('0x2e')](function(){success+=0x1;})[_0xf3ea('0x5a')](function(_0x5a6824){if(_0x5a6824[_0xf3ea('0x19')]){errors+=0x1;delete _0x5a6824[_0xf3ea('0x19')];}else if(_0x5a6824[_0xf3ea('0x2b')]){duplicates+=0x1;delete _0x5a6824[_0xf3ea('0x2b')];}rows[_0xf3ea('0x2f')](_0x5a6824);}));if(total%0xc8===0x0){_0x29f3f2[_0xf3ea('0x6a')]();return processPromises(_0x29f3f2);}},'complete':function(){return processPromises()['then'](function(){logger[_0xf3ea('0x6b')](_0xf3ea('0x6c'));endCsv();});},'error':function(_0x3d422d,_0x2b548d){logger[_0xf3ea('0x6b')]('CSV\x20parse\x20error',JSON[_0xf3ea('0x32')](_0x3d422d));endCsv();}});})[_0xf3ea('0x5a')](function(_0x524be0){logger[_0xf3ea('0x19')](_0xf3ea('0x6d'),JSON[_0xf3ea('0x32')](_0x524be0));});}main();
\ No newline at end of file
index 09ea5af..0d6adcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6256=['campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','query','timezones','dialTimezone','utcOffset','set','offset','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','keys','includes','header','parse','createReadStream','data','rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','isNil','SystemRow','emit','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','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','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','path','lodash','util','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','scheduledat','ContactId','updatedAt','priority','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','insert','cm_hopper_black','createdAt','cm_contacts','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.id','ListId','UserId','.CmListId\x20=\x20?','fromQuery','.id\x20=\x20','concat','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','error','message','exit','errors','push','sequelize','spread','catch','campaigns.id','campaigns.dialTimezone'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x6256,0x18a));var _0x6625=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x6256[_0x342baa];return _0x1208f3;};'use strict';var fs=require('fs');var path=require(_0x6625('0x0'));var _=require(_0x6625('0x1'));var Papa=require('papaparse');var util=require(_0x6625('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x6625('0x3'));var Redis=require('ioredis');var db=require(_0x6625('0x4'))['db'];var config=require(_0x6625('0x5'));var shared=require(_0x6625('0x6'));var logger=require(_0x6625('0x7'))(_0x6625('0x8'));config[_0x6625('0x9')]=_[_0x6625('0xa')](config['redis'],{'host':_0x6625('0xb'),'port':0x18eb});var socket=require(_0x6625('0xc'))(new Redis(config['redis']));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'](_0x6625('0xd'));function isEmail(_0x5b1791){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))*$/[_0x6625('0xe')](_0x5b1791);}function selectNotIn(_0x3aaf9b,_0xfdd751,_0x23672a,_0x4ddbf6,_0x5ca07c){return squel[_0x6625('0xf')]()[_0x6625('0x10')](_0x6625('0x11'))[_0x6625('0x12')](_0x4ddbf6)[_0x6625('0x13')](_0xfdd751,null,_0xfdd751+'.id\x20=\x20'+_0x4ddbf6+'.'+_0x23672a)[_0x6625('0x14')](_0x4ddbf6+'.'+_0x23672a+'\x20=\x20'+_0x3aaf9b+'.'+_0x23672a)[_0x6625('0x14')](_0xfdd751+_0x6625('0x15')+_0x5ca07c[_0x6625('0x13')]()+')');}function insertCmHopper(_0x310973,_0x373efb,_0x58b6e2,_0x371968,_0x333873){var _0x3c2d06=[_0x6625('0x16'),_0x6625('0x17'),'cm_contacts.id',_0x6625('0x18'),_0x373efb+'.'+_0x371968,_0x6625('0x19'),_0x6625('0x1a'),_0x6625('0x1b'),_0x6625('0x1c'),'\x22'+_0x333873+'\x22'];return squel['insert']()[_0x6625('0x1d')]('cm_hopper')['fromQuery']([_0x6625('0x11'),_0x6625('0x1e'),_0x6625('0x1f'),'ListId',_0x371968,'createdAt',_0x6625('0x20'),_0x6625('0x21'),'UserId',_0x6625('0x22')],squel[_0x6625('0xf')]()[_0x6625('0x23')](_0x3c2d06)[_0x6625('0x12')](_0x373efb)[_0x6625('0x13')]('cm_contacts',null,_0x6625('0x24')+_0x373efb+_0x6625('0x25'))[_0x6625('0x13')](_0x58b6e2,null,_0x58b6e2+'.id\x20=\x20'+_0x373efb+'.'+_0x371968)[_0x6625('0x14')](_0x373efb+'.CmListId\x20=\x20?',_0x310973)[_0x6625('0x14')](_0x6625('0x26'),NOW)[_0x6625('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x373efb,_0x58b6e2,_0x371968,_0x6625('0x27'),['\x22always\x22',_0x6625('0x28')]))[_0x6625('0x14')](_0x6625('0x29'),selectNotIn(_0x373efb,_0x58b6e2,_0x371968,'cm_hopper',[_0x6625('0x2a')])))[_0x6625('0x2b')]();}function insertCmHopperBlack(_0x4ad8c5,_0x3142b0,_0x134dc9,_0x5bef9e){var _0x157800=[_0x6625('0x16'),'cm_contacts.id','cm_contacts.ListId',_0x3142b0+'.'+_0x5bef9e,_0x6625('0x19'),_0x6625('0x1a')];return squel[_0x6625('0x2c')]()[_0x6625('0x1d')](_0x6625('0x2d'))['fromQuery']([_0x6625('0x11'),_0x6625('0x1f'),'ListId',_0x5bef9e,_0x6625('0x2e'),_0x6625('0x20')],squel[_0x6625('0xf')]()[_0x6625('0x23')](_0x157800)[_0x6625('0x12')](_0x3142b0)['join'](_0x6625('0x2f'),null,_0x6625('0x24')+_0x3142b0+_0x6625('0x25'))[_0x6625('0x13')](_0x134dc9,null,_0x134dc9+'.id\x20=\x20'+_0x3142b0+'.'+_0x5bef9e)[_0x6625('0x14')](_0x3142b0+'.CmListId\x20=\x20?',_0x4ad8c5)[_0x6625('0x14')](_0x6625('0x26'),NOW)[_0x6625('0x14')](_0x6625('0x29'),squel[_0x6625('0xf')]()[_0x6625('0x10')](_0x6625('0x11'))[_0x6625('0x12')]('cm_hopper_black')['where'](_0x6625('0x30'),_0x4ad8c5)[_0x6625('0x14')](_0x5bef9e+_0x6625('0x31'),_0x3142b0+'.'+_0x5bef9e)))['toString']();}function insertTzCmHopper(_0x18511e,_0x223290,_0x5e8c28,_0x420699,_0x29f842,_0x2f7467){var _0x5e1d65=[_0x6625('0x16'),_0x6625('0x32')+_0x2f7467+'.offset-cm_contacts.utcOffset\x20minute)',_0x6625('0x33'),'cm_contacts.ListId',_0x223290+'.'+_0x420699,_0x6625('0x19'),_0x6625('0x1a'),'cm_contacts.priority',_0x6625('0x1c'),'\x22'+_0x29f842+'\x22'];var _0x44ad1e=squel['insert']()['into'](_0x6625('0x27'))['fromQuery']([_0x6625('0x11'),_0x6625('0x1e'),_0x6625('0x1f'),_0x6625('0x34'),_0x420699,_0x6625('0x2e'),_0x6625('0x20'),_0x6625('0x21'),_0x6625('0x35'),_0x6625('0x22')],squel[_0x6625('0xf')]()[_0x6625('0x23')](_0x5e1d65)['from'](_0x223290)[_0x6625('0x13')](_0x6625('0x2f'),null,_0x6625('0x24')+_0x223290+_0x6625('0x25'))[_0x6625('0x13')](_0x5e8c28,null,_0x5e8c28+'.id\x20=\x20'+_0x223290+'.'+_0x420699)[_0x6625('0x13')](_0x2f7467,null,_0x2f7467+'.id\x20=\x20'+_0x223290+'.'+_0x420699)[_0x6625('0x14')](_0x223290+_0x6625('0x36'),_0x18511e)[_0x6625('0x14')](_0x6625('0x26'),NOW)['where'](_0x6625('0x29'),selectNotIn(_0x223290,_0x5e8c28,_0x420699,_0x6625('0x27'),[_0x6625('0x2a'),_0x6625('0x28')]))[_0x6625('0x14')](_0x6625('0x29'),selectNotIn(_0x223290,_0x5e8c28,_0x420699,'cm_hopper',[_0x6625('0x2a')])))[_0x6625('0x2b')]();return _0x44ad1e;}function insertTzCmHopperBlack(_0x297ca2,_0x14cf59,_0x59c097,_0x516a58){var _0x49ef77=[_0x6625('0x16'),_0x6625('0x33'),_0x6625('0x18'),_0x14cf59+'.'+_0x516a58,_0x6625('0x19'),_0x6625('0x1a')];return squel['insert']()['into'](_0x6625('0x2d'))[_0x6625('0x37')]([_0x6625('0x11'),'ContactId',_0x6625('0x34'),_0x516a58,_0x6625('0x2e'),_0x6625('0x20')],squel[_0x6625('0xf')]()[_0x6625('0x23')](_0x49ef77)[_0x6625('0x12')](_0x14cf59)[_0x6625('0x13')]('cm_contacts',null,_0x6625('0x24')+_0x14cf59+_0x6625('0x25'))['join'](_0x59c097,null,_0x59c097+_0x6625('0x38')+_0x14cf59+'.'+_0x516a58)['where'](_0x14cf59+'.CmListId\x20=\x20?',_0x297ca2)[_0x6625('0x14')](_0x6625('0x26'),NOW)['where'](_0x6625('0x29'),squel[_0x6625('0xf')]()['field'](_0x6625('0x11'))['from'](_0x6625('0x2d'))[_0x6625('0x14')](_0x6625('0x30'),_0x297ca2)['where'](_0x516a58+_0x6625('0x31'),_0x14cf59+'.'+_0x516a58)))[_0x6625('0x2b')]();}function insertCmContact(_0xed0637,_0x3ad921,_0x3d29c4,_0x243cdf){var _0x3dca92=_[_0x6625('0x39')](_['keys'](_0x243cdf),[_0x6625('0x34'),_0x6625('0x3a'),_0x6625('0x2e'),_0x6625('0x20')]);return squel['insert']()['into'](_0x6625('0x2f'))[_0x6625('0x37')](_0x3dca92,squel[_0x6625('0xf')]()[_0x6625('0x23')](_0x3dca92)[_0x6625('0x12')](_0x3ad921)['where']('('+_0x3d29c4[_0x6625('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x6625('0xf')]()[_0x6625('0x23')](_0x3d29c4)[_0x6625('0x12')](_0x6625('0x2f'))[_0x6625('0x14')](_0x6625('0x30'),_0xed0637)[_0x6625('0x14')](_0x6625('0x3b')))[_0x6625('0x14')](_0x6625('0x3c'),squel['select']()['field']('MIN(id)',_0x6625('0x3d'))[_0x6625('0x12')](_0x3ad921)[_0x6625('0x3e')](_0x3d29c4[_0x6625('0x13')](','))))[_0x6625('0x2b')]();}function handleStop(){logger[_0x6625('0x3f')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4f1644){logger[_0x6625('0x40')](_0x4f1644[_0x6625('0x41')]);process[_0x6625('0x42')](0x1);}function handleError(_0x4f3cc2,_0x3feece){stats[_0x6625('0x43')][_0x6625('0x44')]({'name':_0x3feece['code'],'message':_0x3feece[_0x6625('0x41')],'row':_0x4f3cc2});}function handleQuery(_0x2ad1b8){logger['info'](_0x2ad1b8);return db[_0x6625('0x45')]['query'](_0x2ad1b8)[_0x6625('0x46')](function(_0xdaa82a){results[_0x6625('0x44')](_0xdaa82a);})[_0x6625('0x47')](function(_0xc6120c){logger[_0x6625('0x40')](_0xc6120c[_0x6625('0x41')]);});}function updateTzCampaigns(_0x328dff){return new Promise(function(_0x208b75,_0x4be2b2){var _0x225e28=squel[_0x6625('0xf')]()[_0x6625('0x23')]([_0x6625('0x48'),_0x6625('0x49')])[_0x6625('0x12')](_0x6625('0x4a'))['join'](_0x6625('0x4b'),null,_0x6625('0x4c'))[_0x6625('0x14')](_0x6625('0x4d')+_0x328dff);db[_0x6625('0x45')]['query'](_0x225e28[_0x6625('0x2b')]())[_0x6625('0x46')](function(_0x1d8bbb){var _0x3a8829=[];for(var _0x31ec32=0x0;_0x31ec32<_0x1d8bbb[_0x6625('0x4e')];_0x31ec32++){_0x3a8829[_0x6625('0x44')](getTimezoneData(_0x1d8bbb[_0x31ec32],tmp_campaigns));}BPromise[_0x6625('0x4f')](_0x3a8829)[_0x6625('0x50')](function(){_0x208b75({'val':0x1});});})[_0x6625('0x47')](function(_0x16c8dd){logger[_0x6625('0x40')](_0x16c8dd['message']);_0x208b75({'val':0x0});});});}function updateTzVoiceQueues(_0x1957c0){return new Promise(function(_0x4949b4,_0x5d2bc0){var _0x2e9a06=squel['select']()[_0x6625('0x23')]([_0x6625('0x51'),_0x6625('0x52')])[_0x6625('0x12')](_0x6625('0x53'))[_0x6625('0x13')]('voice_queues_has_cm_lists',null,_0x6625('0x54'))['where'](_0x6625('0x55')+_0x1957c0);db[_0x6625('0x45')][_0x6625('0x56')](_0x2e9a06[_0x6625('0x2b')]())['spread'](function(_0x3b627b){var _0x3c1eea=[];for(var _0x105935=0x0;_0x105935<_0x3b627b[_0x6625('0x4e')];_0x105935++){_0x3c1eea[_0x6625('0x44')](getTimezoneData(_0x3b627b[_0x105935],tmp_voice_queues));}BPromise[_0x6625('0x4f')](_0x3c1eea)[_0x6625('0x50')](function(){_0x4949b4({'val':0x1});});})['catch'](function(_0xe7b0e0){logger['error'](_0xe7b0e0['message']);_0x4949b4({'val':0x0});});});}function getTimezoneData(_0x2646c0,_0xecd4b2){return new Promise(function(_0x40d1f3,_0x5cb394){var _0x5ef7d1=shared[_0x6625('0x57')];var _0x33b6a8=_0x5ef7d1[_0x2646c0[_0x6625('0x58')]];if(_['isNil'](_0x33b6a8)){_0x40d1f3({'ret':0x1});}else{var _0x5451d8=_0x33b6a8[_0x6625('0x59')];var _0x5ad2ef=squel[_0x6625('0x2c')]()[_0x6625('0x1d')](_0xecd4b2)['set']('id',_0x2646c0['id'])[_0x6625('0x5a')](_0x6625('0x5b'),_0x5451d8)[_0x6625('0x5a')]('dialTimezone',_0x2646c0['dialTimezone'])[_0x6625('0x2b')]();return db[_0x6625('0x45')][_0x6625('0x56')](_0x5ad2ef)['spread'](function(_0x37960d){_0x40d1f3({'ret':0x1});})[_0x6625('0x47')](function(_0x299b03){logger['error'](_0x299b03[_0x6625('0x41')]);_0x5cb394({'ret':0x1});});}});}function handleTZQuery(_0x3d5590){logger['info'](_0x3d5590);return db[_0x6625('0x45')][_0x6625('0x56')](_0x3d5590)['spread'](function(_0x17893e){})[_0x6625('0x47')](function(_0x4d1b0c){logger[_0x6625('0x40')](_0x4d1b0c[_0x6625('0x41')]);});}function main(_0x3b74be,_0x45f8d5,_0x5e60ec,_0x1e02fc){logger['info'](_0x6625('0x5c'),_0x3b74be,JSON[_0x6625('0x5d')](_0x45f8d5));process[_0x6625('0x5e')](_0x6625('0x5f'));var _0x5c2206=_0x45f8d5[_0x6625('0x60')];var _0x1f1826=_0x45f8d5[_0x6625('0x61')];var _0x51721d=path[_0x6625('0x13')](config[_0x6625('0x62')],_0x6625('0x63'),_0x1f1826+_0x6625('0x64'));hasTZ=_[_0x6625('0x65')](_0x5c2206)[_0x6625('0x66')](_0x6625('0x58'));var _0x2f1c8e=_[_0x6625('0x65')](_0x5c2206)[_0x6625('0x13')]();logger['info'](_0x6625('0x67'),_0x2f1c8e);if(hasTZ)_0x2f1c8e+=',utcOffset';fs['writeFileSync'](_0x51721d,_0x2f1c8e+'\x0a');Papa[_0x6625('0x68')](fs[_0x6625('0x69')](_0x3b74be),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2ee975,_0x80bc57){try{for(var _0x45cf02=0x0,_0x332da0=[];_0x45cf02<_0x2ee975[_0x6625('0x6a')][_0x6625('0x4e')];_0x45cf02++){stats[_0x6625('0x6b')]+=0x1;if(_0x2ee975['errors'][_0x45cf02]){handleError(_0x2ee975[_0x6625('0x6a')][_0x45cf02],_0x2ee975[_0x6625('0x43')][_0x45cf02]);}else{var _0x5f43d7=[];for(var _0x2cbccb in _0x5c2206){if(_0x5c2206[_0x6625('0x6c')](_0x2cbccb)){if(_0x2ee975[_0x6625('0x6a')][_0x45cf02][_0x5c2206[_0x2cbccb]]){var _0x366470=_[_0x6625('0x6d')](_0x2ee975[_0x6625('0x6a')][_0x45cf02][_0x5c2206[_0x2cbccb]][_0x6625('0x6e')](/"/g,'\x27'));switch(_0x2cbccb){case'scheduledat':var _0x5100db=moment(_0x366470,_0x6625('0xd'),!![]);if(_0x5100db[_0x6625('0x6f')]()){_0x332da0[_0x6625('0x44')]('\x22'+_0x366470+'\x22');}else{_0x5f43d7[_0x6625('0x44')](_0x6625('0x70'));}break;case _0x6625('0x21'):var _0x56bd41=parseInt(_0x366470);_0x366470=_[_0x6625('0x71')](_0x56bd41)||_0x56bd41<0x0||_0x56bd41>0x4?_0x1e02fc?0x3:0x2:_0x56bd41;_0x332da0[_0x6625('0x44')]('\x22'+_0x366470+'\x22');break;case'UserId':var _0x53729c=parseInt(_0x366470);if(_['isNumber'](_0x53729c)&&_['includes'](_0x5e60ec,_0x53729c)){_0x332da0[_0x6625('0x44')]('\x22'+_0x53729c+'\x22');}else{_0x5f43d7[_0x6625('0x44')](_0x6625('0x72'));}break;case _0x6625('0x73'):if(isEmail(_0x366470)){_0x332da0[_0x6625('0x44')]('\x22'+_0x366470+'\x22');}else{_0x5f43d7[_0x6625('0x44')](_0x6625('0x74'));}break;case _0x6625('0x75'):var _0x2c1b13=moment(_0x366470,'YYYY-MM-DD',!![]);if(_0x2c1b13[_0x6625('0x6f')]()){_0x332da0[_0x6625('0x44')]('\x22'+_0x366470+'\x22');}else{_0x5f43d7[_0x6625('0x44')](_0x6625('0x76'));}break;case _0x6625('0x58'):var _0x226460=shared[_0x6625('0x57')];var _0x4772e4=_0x226460[_0x366470];if(!_[_0x6625('0x77')](_0x4772e4)){var _0x591c5a=_0x4772e4['utcOffset'];_0x332da0[_0x6625('0x44')]('\x22'+_0x366470+'\x22');_0x332da0[_0x6625('0x44')]('\x22'+_0x591c5a+'\x22');}break;default:_0x332da0['push']('\x22'+_0x366470+'\x22');}}else{switch(_0x2cbccb){case'firstName':case'phone':_0x5f43d7[_0x6625('0x44')](_0x2cbccb+'\x20not\x20specified');break;default:_0x332da0[_0x6625('0x44')]('\x22\x22');}}}}if(_0x5f43d7['length']){handleError(_0x2ee975[_0x6625('0x6a')][_0x45cf02],{'code':_0x6625('0x78'),'message':_0x5f43d7[_0x6625('0x13')]()});}else{fs['appendFileSync'](_0x51721d,_0x332da0[_0x6625('0x13')]()+'\x0a');}_0x332da0=[];}if(!(stats[_0x6625('0x6b')]%0xc8)){socket[_0x6625('0x79')](_0x6625('0x7a')+_0x1f1826,stats);stats[_0x6625('0x43')]=[];}}if(stopped){logger[_0x6625('0x3f')](_0x6625('0x7b'));_0x80bc57[_0x6625('0x7c')]();}}catch(_0x1dfc29){handleError(_0x2ee975[_0x6625('0x6a')][_0x45cf02],{'code':_0x6625('0x7d'),'message':_0x1dfc29[_0x6625('0x41')]});logger[_0x6625('0x40')]('step',_0x1dfc29[_0x6625('0x41')]);}},'complete':function(){try{var _0x32ad3c=[];var _0x412c69=[];var _0x32b99f=_0x6625('0x2f');if(_0x45f8d5[_0x6625('0x7e')]&&_0x45f8d5[_0x6625('0x7e')]['length']){_0x32b99f=_0x6625('0x7f')+_0x1f1826;_0x32ad3c[_0x6625('0x44')](_0x6625('0x80')+_0x32b99f+_0x6625('0x81'));}tmp_campaigns=_0x6625('0x82')+_0x1f1826;tmp_voice_queues=_0x6625('0x83')+_0x1f1826;_0x412c69[_0x6625('0x44')](_0x6625('0x80')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x412c69[_0x6625('0x44')](_0x6625('0x80')+tmp_voice_queues+_0x6625('0x84'));BPromise[_0x6625('0x85')](_0x412c69,handleTZQuery)['then'](function(_0x575944){updateTzCampaigns(_0x45f8d5['ListId'])[_0x6625('0x50')](function(_0x165e8f){updateTzVoiceQueues(_0x45f8d5['ListId'])['then'](function(_0x407dd1){var _0x419671=util[_0x6625('0x86')](_0x6625('0x87'),_0x51721d,_0x32b99f,_0x2f1c8e,_0x45f8d5[_0x6625('0x34')],_0x45f8d5[_0x6625('0x3a')]||null,NOW,NOW);if(_[_0x6625('0x77')](_0x5c2206[_0x6625('0x1e')])){_0x419671+=',\x20scheduledAt\x20=\x20NOW()';}_0x32ad3c[_0x6625('0x44')](_0x419671);if(_0x45f8d5[_0x6625('0x7e')]&&_0x45f8d5[_0x6625('0x7e')]['length']){_0x32ad3c['push'](insertCmContact(_0x45f8d5[_0x6625('0x34')],_0x32b99f,_0x45f8d5['duplicates'],_0x5c2206));_0x32ad3c['push'](_0x6625('0x88')+_0x32b99f+';');}if(hasTZ){_0x32ad3c[_0x6625('0x44')](insertTzCmHopper(_0x45f8d5[_0x6625('0x34')],_0x6625('0x89'),_0x6625('0x53'),'VoiceQueueId',_0x1e02fc,tmp_voice_queues));_0x32ad3c[_0x6625('0x44')](insertTzCmHopperBlack(_0x45f8d5['ListId'],'voice_queues_has_cm_blacklists',_0x6625('0x53'),_0x6625('0x8a')));_0x32ad3c['push'](insertTzCmHopper(_0x45f8d5['ListId'],_0x6625('0x4b'),_0x6625('0x4a'),_0x6625('0x8b'),_0x1e02fc,tmp_campaigns));_0x32ad3c[_0x6625('0x44')](insertTzCmHopperBlack(_0x45f8d5[_0x6625('0x34')],_0x6625('0x8c'),'campaigns',_0x6625('0x8b')));}else{_0x32ad3c[_0x6625('0x44')](insertCmHopper(_0x45f8d5[_0x6625('0x34')],_0x6625('0x89'),_0x6625('0x53'),_0x6625('0x8a'),_0x1e02fc));_0x32ad3c[_0x6625('0x44')](insertCmHopperBlack(_0x45f8d5['ListId'],_0x6625('0x8d'),_0x6625('0x53'),'VoiceQueueId'));_0x32ad3c[_0x6625('0x44')](insertCmHopper(_0x45f8d5[_0x6625('0x34')],'campaigns_has_cm_lists',_0x6625('0x4a'),_0x6625('0x8b'),_0x1e02fc));_0x32ad3c['push'](insertCmHopperBlack(_0x45f8d5[_0x6625('0x34')],'campaigns_has_cm_blacklists',_0x6625('0x4a'),'CampaignId'));}_0x32ad3c[_0x6625('0x44')](_0x6625('0x88')+tmp_campaigns+';');_0x32ad3c[_0x6625('0x44')](_0x6625('0x88')+tmp_voice_queues+';');BPromise[_0x6625('0x85')](_0x32ad3c,handleQuery)['then'](function(_0x26231e){stats['finish']=!![];stats['affectedRows']=_0x45f8d5[_0x6625('0x7e')]&&_0x45f8d5[_0x6625('0x7e')][_0x6625('0x4e')]?results[0x2][_0x6625('0x8e')]:results[0x0][_0x6625('0x8e')];socket[_0x6625('0x79')]('contact:import:'+_0x1f1826,stats);fs[_0x6625('0x8f')](_0x3b74be);fs[_0x6625('0x8f')](_0x51721d);process['exit'](0x0);})['catch'](function(_0x45902d){logger[_0x6625('0x40')](_0x45902d[_0x6625('0x41')]);process[_0x6625('0x42')](0x1);});});});});}catch(_0x79a42d){logger[_0x6625('0x40')](_0x6625('0x90'),_0x79a42d['message']);process[_0x6625('0x42')](0x1);}},'error':function(_0x2dbf7b,_0x5444bb,_0x15defd,_0x15bc77){throw new Error(_0x15bc77);}});}function validate(){if(process[_0x6625('0x91')]&&process[_0x6625('0x91')][_0x6625('0x4e')]<0x4){throw new Error(_0x6625('0x92'));}var _0x35e57b=path[_0x6625('0x13')](config[_0x6625('0x62')],'server/files/tmp',process[_0x6625('0x91')][0x2]);if(!fs[_0x6625('0x93')](_0x35e57b)){throw new Error(_0x6625('0x94'));}var _0x242d0e={};try{_0x242d0e=JSON[_0x6625('0x68')](process['argv'][0x3]);if(!_0x242d0e[_0x6625('0x60')]){throw new Error(_0x6625('0x95'));}if(!_0x242d0e[_0x6625('0x60')]['phone']){throw new Error(_0x6625('0x96'));}if(!_0x242d0e['binding'][_0x6625('0x97')]){throw new Error('firstName\x20is\x20mandatory');}var _0x1aa804=0x0;if(_0x242d0e['binding'][_0x6625('0x35')]){_0x1aa804=0x1;}if(!_0x242d0e[_0x6625('0x34')]){throw new Error(_0x6625('0x98'));}}catch(_0x569fdf){throw new Error('body\x20id\x20mandatory');}var _0x4f1152=[];try{_0x4f1152=_[_0x6625('0x99')](JSON[_0x6625('0x68')](process[_0x6625('0x91')][0x4]),'id');}catch(_0x2a5778){logger[_0x6625('0x3f')]('No\x20agent\x20available');}main(_0x35e57b,_0x242d0e,_0x4f1152,_0x1aa804);}validate();process['on'](_0x6625('0x9a'),handleStop);process['on'](_0x6625('0x9b'),handleUncaughtException);
\ No newline at end of file
+var _0x4c76=['format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','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','toString','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','phone','ContactId','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','exit','errors','push','code','message','sequelize','query','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','spread','length','all','then','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','utcOffset','set','offset','dialTimezone','main','stringify','send','start','binding','socket_timestamp','root','header',',utcOffset','writeFileSync','parse','createReadStream','data','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','isNil','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','VoiceQueueId','finish','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','server/files/tmp','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost'];(function(_0x2b1a78,_0x539d69){var _0x264e5d=function(_0x541cbb){while(--_0x541cbb){_0x2b1a78['push'](_0x2b1a78['shift']());}};_0x264e5d(++_0x539d69);}(_0x4c76,0x91));var _0x64c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c76[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x64c7('0x0'));var Papa=require(_0x64c7('0x1'));var util=require(_0x64c7('0x2'));var BPromise=require(_0x64c7('0x3'));var moment=require('moment');var squel=require(_0x64c7('0x4'));var Redis=require(_0x64c7('0x5'));var db=require(_0x64c7('0x6'))['db'];var config=require('../../../config/environment');var shared=require(_0x64c7('0x7'));var logger=require(_0x64c7('0x8'))(_0x64c7('0x9'));config[_0x64c7('0xa')]=_[_0x64c7('0xb')](config[_0x64c7('0xa')],{'host':_0x64c7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64c7('0xa')]));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()[_0x64c7('0xd')](_0x64c7('0xe'));function isEmail(_0x564f7a){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))*$/[_0x64c7('0xf')](_0x564f7a);}function selectNotIn(_0x4b6238,_0x9c2794,_0x3ecbed,_0x3c0ec1,_0xc0482c){return squel[_0x64c7('0x10')]()[_0x64c7('0x11')]('phone')['from'](_0x3c0ec1)[_0x64c7('0x12')](_0x9c2794,null,_0x9c2794+_0x64c7('0x13')+_0x3c0ec1+'.'+_0x3ecbed)[_0x64c7('0x14')](_0x3c0ec1+'.'+_0x3ecbed+_0x64c7('0x15')+_0x4b6238+'.'+_0x3ecbed)[_0x64c7('0x14')](_0x9c2794+_0x64c7('0x16')+_0xc0482c[_0x64c7('0x12')]()+')');}function insertCmHopper(_0xc1c9d3,_0x43f774,_0x395f6d,_0x3d93a8,_0x3de5ac){var _0x2282fe=[_0x64c7('0x17'),_0x64c7('0x18'),_0x64c7('0x19'),'cm_contacts.ListId',_0x43f774+'.'+_0x3d93a8,_0x64c7('0x1a'),'cm_contacts.updatedAt',_0x64c7('0x1b'),_0x64c7('0x1c'),'\x22'+_0x3de5ac+'\x22'];return squel[_0x64c7('0x1d')]()[_0x64c7('0x1e')](_0x64c7('0x1f'))[_0x64c7('0x20')](['phone',_0x64c7('0x21'),'ContactId',_0x64c7('0x22'),_0x3d93a8,_0x64c7('0x23'),_0x64c7('0x24'),_0x64c7('0x25'),_0x64c7('0x26'),_0x64c7('0x27')],squel[_0x64c7('0x10')]()[_0x64c7('0x28')](_0x2282fe)[_0x64c7('0x29')](_0x43f774)[_0x64c7('0x12')](_0x64c7('0x2a'),null,_0x64c7('0x2b')+_0x43f774+_0x64c7('0x2c'))['join'](_0x395f6d,null,_0x395f6d+_0x64c7('0x13')+_0x43f774+'.'+_0x3d93a8)[_0x64c7('0x14')](_0x43f774+_0x64c7('0x2d'),_0xc1c9d3)[_0x64c7('0x14')](_0x64c7('0x2e'),NOW)[_0x64c7('0x14')](_0x64c7('0x2f'),selectNotIn(_0x43f774,_0x395f6d,_0x3d93a8,_0x64c7('0x1f'),[_0x64c7('0x30'),'\x22onlyIfOpen\x22']))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x43f774,_0x395f6d,_0x3d93a8,_0x64c7('0x1f'),[_0x64c7('0x30')])))[_0x64c7('0x31')]();}function insertCmHopperBlack(_0x5dd757,_0x2ede28,_0x3a04f5,_0x45ca3c){var _0x11e33a=['cm_contacts.phone',_0x64c7('0x19'),_0x64c7('0x32'),_0x2ede28+'.'+_0x45ca3c,'cm_contacts.createdAt',_0x64c7('0x33')];return squel[_0x64c7('0x1d')]()[_0x64c7('0x1e')](_0x64c7('0x34'))[_0x64c7('0x20')]([_0x64c7('0x35'),_0x64c7('0x36'),_0x64c7('0x22'),_0x45ca3c,_0x64c7('0x23'),'updatedAt'],squel['select']()['fields'](_0x11e33a)[_0x64c7('0x29')](_0x2ede28)[_0x64c7('0x12')](_0x64c7('0x2a'),null,_0x64c7('0x2b')+_0x2ede28+_0x64c7('0x2c'))['join'](_0x3a04f5,null,_0x3a04f5+_0x64c7('0x13')+_0x2ede28+'.'+_0x45ca3c)[_0x64c7('0x14')](_0x2ede28+_0x64c7('0x2d'),_0x5dd757)[_0x64c7('0x14')](_0x64c7('0x2e'),NOW)[_0x64c7('0x14')](_0x64c7('0x2f'),squel['select']()[_0x64c7('0x11')](_0x64c7('0x35'))[_0x64c7('0x29')](_0x64c7('0x34'))[_0x64c7('0x14')](_0x64c7('0x37'),_0x5dd757)[_0x64c7('0x14')](_0x45ca3c+_0x64c7('0x38'),_0x2ede28+'.'+_0x45ca3c)))['toString']();}function insertTzCmHopper(_0x1955a1,_0x28f77c,_0xc1a5a,_0x51c437,_0x21b0bf,_0x50ee7c){var _0x46e2be=[_0x64c7('0x17'),_0x64c7('0x39')+_0x50ee7c+'.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id',_0x64c7('0x32'),_0x28f77c+'.'+_0x51c437,'cm_contacts.createdAt',_0x64c7('0x33'),_0x64c7('0x1b'),_0x64c7('0x1c'),'\x22'+_0x21b0bf+'\x22'];var _0x5da2b1=squel[_0x64c7('0x1d')]()[_0x64c7('0x1e')]('cm_hopper')[_0x64c7('0x20')]([_0x64c7('0x35'),'scheduledat','ContactId',_0x64c7('0x22'),_0x51c437,_0x64c7('0x23'),'updatedAt',_0x64c7('0x25'),_0x64c7('0x26'),_0x64c7('0x27')],squel[_0x64c7('0x10')]()[_0x64c7('0x28')](_0x46e2be)[_0x64c7('0x29')](_0x28f77c)['join'](_0x64c7('0x2a'),null,_0x64c7('0x2b')+_0x28f77c+_0x64c7('0x2c'))['join'](_0xc1a5a,null,_0xc1a5a+_0x64c7('0x13')+_0x28f77c+'.'+_0x51c437)[_0x64c7('0x12')](_0x50ee7c,null,_0x50ee7c+_0x64c7('0x13')+_0x28f77c+'.'+_0x51c437)[_0x64c7('0x14')](_0x28f77c+_0x64c7('0x2d'),_0x1955a1)[_0x64c7('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x64c7('0x14')](_0x64c7('0x2f'),selectNotIn(_0x28f77c,_0xc1a5a,_0x51c437,'cm_hopper',[_0x64c7('0x30'),'\x22onlyIfOpen\x22']))[_0x64c7('0x14')](_0x64c7('0x2f'),selectNotIn(_0x28f77c,_0xc1a5a,_0x51c437,_0x64c7('0x1f'),[_0x64c7('0x30')])))[_0x64c7('0x31')]();return _0x5da2b1;}function insertTzCmHopperBlack(_0x1e0bd0,_0x3a5f7e,_0x29050d,_0x2771bf){var _0x3adbda=['cm_contacts.phone',_0x64c7('0x19'),_0x64c7('0x32'),_0x3a5f7e+'.'+_0x2771bf,_0x64c7('0x1a'),_0x64c7('0x33')];return squel[_0x64c7('0x1d')]()[_0x64c7('0x1e')](_0x64c7('0x34'))[_0x64c7('0x20')]([_0x64c7('0x35'),_0x64c7('0x36'),_0x64c7('0x22'),_0x2771bf,_0x64c7('0x23'),_0x64c7('0x24')],squel[_0x64c7('0x10')]()['fields'](_0x3adbda)[_0x64c7('0x29')](_0x3a5f7e)['join'](_0x64c7('0x2a'),null,_0x64c7('0x2b')+_0x3a5f7e+_0x64c7('0x2c'))['join'](_0x29050d,null,_0x29050d+_0x64c7('0x13')+_0x3a5f7e+'.'+_0x2771bf)[_0x64c7('0x14')](_0x3a5f7e+_0x64c7('0x2d'),_0x1e0bd0)[_0x64c7('0x14')](_0x64c7('0x2e'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x64c7('0x10')]()[_0x64c7('0x11')](_0x64c7('0x35'))[_0x64c7('0x29')](_0x64c7('0x34'))[_0x64c7('0x14')](_0x64c7('0x37'),_0x1e0bd0)[_0x64c7('0x14')](_0x2771bf+_0x64c7('0x38'),_0x3a5f7e+'.'+_0x2771bf)))[_0x64c7('0x31')]();}function insertCmContact(_0x130e0b,_0x170ecf,_0x4aabe3,_0x47032f){var _0x546a9f=_[_0x64c7('0x3a')](_[_0x64c7('0x3b')](_0x47032f),[_0x64c7('0x22'),_0x64c7('0x3c'),_0x64c7('0x23'),_0x64c7('0x24')]);return squel[_0x64c7('0x1d')]()[_0x64c7('0x1e')](_0x64c7('0x2a'))['fromQuery'](_0x546a9f,squel['select']()['fields'](_0x546a9f)[_0x64c7('0x29')](_0x170ecf)[_0x64c7('0x14')]('('+_0x4aabe3[_0x64c7('0x12')](',')+_0x64c7('0x3d'),squel[_0x64c7('0x10')]()[_0x64c7('0x28')](_0x4aabe3)[_0x64c7('0x29')](_0x64c7('0x2a'))['where'](_0x64c7('0x37'),_0x130e0b)['where'](_0x64c7('0x3e')))[_0x64c7('0x14')](_0x64c7('0x3f'),squel[_0x64c7('0x10')]()['field']('MIN(id)',_0x64c7('0x40'))[_0x64c7('0x29')](_0x170ecf)[_0x64c7('0x41')](_0x4aabe3[_0x64c7('0x12')](','))))[_0x64c7('0x31')]();}function handleStop(){logger[_0x64c7('0x42')](_0x64c7('0x43'));stopped=!![];}function handleUncaughtException(_0x29e7a9){logger[_0x64c7('0x44')](_0x29e7a9['message']);process[_0x64c7('0x45')](0x1);}function handleError(_0x33edcf,_0x1ce82f){stats[_0x64c7('0x46')][_0x64c7('0x47')]({'name':_0x1ce82f[_0x64c7('0x48')],'message':_0x1ce82f[_0x64c7('0x49')],'row':_0x33edcf});}function handleQuery(_0x59b961){logger['info'](_0x59b961);return db[_0x64c7('0x4a')][_0x64c7('0x4b')](_0x59b961)['spread'](function(_0x33af78){results[_0x64c7('0x47')](_0x33af78);})[_0x64c7('0x4c')](function(_0x5515fa){logger['error'](_0x5515fa['message']);});}function updateTzCampaigns(_0x5ebdc3){return new Promise(function(_0x5abea2,_0x4152da){var _0x30430f=squel['select']()[_0x64c7('0x28')]([_0x64c7('0x4d'),_0x64c7('0x4e')])['from']('campaigns')[_0x64c7('0x12')](_0x64c7('0x4f'),null,_0x64c7('0x50'))[_0x64c7('0x14')](_0x64c7('0x51')+_0x5ebdc3);db[_0x64c7('0x4a')][_0x64c7('0x4b')](_0x30430f['toString']())[_0x64c7('0x52')](function(_0x3b9ee2){var _0x1e95d8=[];for(var _0x5164b7=0x0;_0x5164b7<_0x3b9ee2[_0x64c7('0x53')];_0x5164b7++){_0x1e95d8[_0x64c7('0x47')](getTimezoneData(_0x3b9ee2[_0x5164b7],tmp_campaigns));}BPromise[_0x64c7('0x54')](_0x1e95d8)[_0x64c7('0x55')](function(){_0x5abea2({'val':0x1});});})[_0x64c7('0x4c')](function(_0x2a41d3){logger[_0x64c7('0x44')](_0x2a41d3[_0x64c7('0x49')]);_0x5abea2({'val':0x0});});});}function updateTzVoiceQueues(_0x3a6989){return new Promise(function(_0x3dea71,_0x266b2d){var _0x3ca11c=squel[_0x64c7('0x10')]()['fields']([_0x64c7('0x56'),_0x64c7('0x57')])[_0x64c7('0x29')]('voice_queues')[_0x64c7('0x12')](_0x64c7('0x58'),null,_0x64c7('0x59'))[_0x64c7('0x14')](_0x64c7('0x5a')+_0x3a6989);db[_0x64c7('0x4a')]['query'](_0x3ca11c[_0x64c7('0x31')]())[_0x64c7('0x52')](function(_0xd55832){var _0x42318d=[];for(var _0x1e6924=0x0;_0x1e6924<_0xd55832['length'];_0x1e6924++){_0x42318d[_0x64c7('0x47')](getTimezoneData(_0xd55832[_0x1e6924],tmp_voice_queues));}BPromise[_0x64c7('0x54')](_0x42318d)['then'](function(){_0x3dea71({'val':0x1});});})[_0x64c7('0x4c')](function(_0x1066ee){logger['error'](_0x1066ee[_0x64c7('0x49')]);_0x3dea71({'val':0x0});});});}function getTimezoneData(_0xae98a2,_0xbc578b){return new Promise(function(_0x5e776b,_0x54aa8a){var _0x1bfa54=shared[_0x64c7('0x5b')];var _0x1bafc0=_0x1bfa54[_0xae98a2['dialTimezone']];if(_['isNil'](_0x1bafc0)){_0x5e776b({'ret':0x1});}else{var _0x19a589=_0x1bafc0[_0x64c7('0x5c')];var _0x2fd872=squel['insert']()['into'](_0xbc578b)['set']('id',_0xae98a2['id'])[_0x64c7('0x5d')](_0x64c7('0x5e'),_0x19a589)[_0x64c7('0x5d')](_0x64c7('0x5f'),_0xae98a2[_0x64c7('0x5f')])[_0x64c7('0x31')]();return db[_0x64c7('0x4a')][_0x64c7('0x4b')](_0x2fd872)['spread'](function(_0x5530a9){_0x5e776b({'ret':0x1});})['catch'](function(_0x41e33c){logger[_0x64c7('0x44')](_0x41e33c[_0x64c7('0x49')]);_0x54aa8a({'ret':0x1});});}});}function handleTZQuery(_0x5d3bfe){logger[_0x64c7('0x42')](_0x5d3bfe);return db['sequelize'][_0x64c7('0x4b')](_0x5d3bfe)[_0x64c7('0x52')](function(_0x4e3df5){})['catch'](function(_0x141d51){logger['error'](_0x141d51['message']);});}function main(_0x548e82,_0x2f4756,_0x5b7e4a,_0x1d64e3){logger[_0x64c7('0x42')](_0x64c7('0x60'),_0x548e82,JSON[_0x64c7('0x61')](_0x2f4756));process[_0x64c7('0x62')](_0x64c7('0x63'));var _0x271671=_0x2f4756[_0x64c7('0x64')];var _0x664aa2=_0x2f4756[_0x64c7('0x65')];var _0x1fa211=path[_0x64c7('0x12')](config[_0x64c7('0x66')],'server/files/tmp',_0x664aa2+'.csv');hasTZ=_[_0x64c7('0x3b')](_0x271671)['includes']('dialTimezone');var _0x9213b1=_[_0x64c7('0x3b')](_0x271671)[_0x64c7('0x12')]();logger['info'](_0x64c7('0x67'),_0x9213b1);if(hasTZ)_0x9213b1+=_0x64c7('0x68');fs[_0x64c7('0x69')](_0x1fa211,_0x9213b1+'\x0a');Papa[_0x64c7('0x6a')](fs[_0x64c7('0x6b')](_0x548e82),{'header':!![],'skipEmptyLines':!![],'step':function(_0x182889,_0x1d10e7){try{for(var _0x2d61e8=0x0,_0x39c3c4=[];_0x2d61e8<_0x182889[_0x64c7('0x6c')][_0x64c7('0x53')];_0x2d61e8++){stats['rows']+=0x1;if(_0x182889[_0x64c7('0x46')][_0x2d61e8]){handleError(_0x182889[_0x64c7('0x6c')][_0x2d61e8],_0x182889[_0x64c7('0x46')][_0x2d61e8]);}else{var _0x22399e=[];for(var _0x588c27 in _0x271671){if(_0x271671[_0x64c7('0x6d')](_0x588c27)){if(_0x182889[_0x64c7('0x6c')][_0x2d61e8][_0x271671[_0x588c27]]){var _0x3fdf39=_['trim'](_0x182889[_0x64c7('0x6c')][_0x2d61e8][_0x271671[_0x588c27]][_0x64c7('0x6e')](/"/g,'\x27'));switch(_0x588c27){case'scheduledat':var _0x5410da=moment(_0x3fdf39,_0x64c7('0xe'),!![]);if(_0x5410da[_0x64c7('0x6f')]()){_0x39c3c4['push']('\x22'+_0x3fdf39+'\x22');}else{_0x22399e[_0x64c7('0x47')](_0x64c7('0x70'));}break;case _0x64c7('0x25'):var _0x589193=parseInt(_0x3fdf39);_0x3fdf39=_[_0x64c7('0x71')](_0x589193)||_0x589193<0x0||_0x589193>0x4?_0x1d64e3?0x3:0x2:_0x589193;_0x39c3c4[_0x64c7('0x47')]('\x22'+_0x3fdf39+'\x22');break;case _0x64c7('0x26'):var _0xc31bd4=parseInt(_0x3fdf39);if(_['isNumber'](_0xc31bd4)&&_[_0x64c7('0x72')](_0x5b7e4a,_0xc31bd4)){_0x39c3c4['push']('\x22'+_0xc31bd4+'\x22');}else{_0x22399e[_0x64c7('0x47')](_0x64c7('0x73'));}break;case'email':if(isEmail(_0x3fdf39)){_0x39c3c4['push']('\x22'+_0x3fdf39+'\x22');}else{_0x22399e['push']('email\x20wrong\x20format');}break;case _0x64c7('0x74'):var _0x432291=moment(_0x3fdf39,_0x64c7('0x75'),!![]);if(_0x432291[_0x64c7('0x6f')]()){_0x39c3c4[_0x64c7('0x47')]('\x22'+_0x3fdf39+'\x22');}else{_0x22399e['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x64c7('0x5f'):var _0x5a2377=shared[_0x64c7('0x5b')];var _0x1d49e5=_0x5a2377[_0x3fdf39];if(!_[_0x64c7('0x76')](_0x1d49e5)){var _0x5da22e=_0x1d49e5['utcOffset'];_0x39c3c4['push']('\x22'+_0x3fdf39+'\x22');_0x39c3c4['push']('\x22'+_0x5da22e+'\x22');}break;default:_0x39c3c4[_0x64c7('0x47')]('\x22'+_0x3fdf39+'\x22');}}else{switch(_0x588c27){case'firstName':case'phone':_0x22399e[_0x64c7('0x47')](_0x588c27+_0x64c7('0x77'));break;default:_0x39c3c4['push']('\x22\x22');}}}}if(_0x22399e[_0x64c7('0x53')]){handleError(_0x182889['data'][_0x2d61e8],{'code':_0x64c7('0x78'),'message':_0x22399e['join']()});}else{fs[_0x64c7('0x79')](_0x1fa211,_0x39c3c4['join']()+'\x0a');}_0x39c3c4=[];}if(!(stats['rows']%0xc8)){socket[_0x64c7('0x7a')](_0x64c7('0x7b')+_0x664aa2,stats);stats['errors']=[];}}if(stopped){logger[_0x64c7('0x42')]('Abort\x20parser');_0x1d10e7['abort']();}}catch(_0x288e28){handleError(_0x182889['data'][_0x2d61e8],{'code':_0x64c7('0x7c'),'message':_0x288e28['message']});logger[_0x64c7('0x44')](_0x64c7('0x7d'),_0x288e28[_0x64c7('0x49')]);}},'complete':function(){try{var _0x1a4f9d=[];var _0x4884c4=[];var _0x3564fb='cm_contacts';if(_0x2f4756[_0x64c7('0x7e')]&&_0x2f4756['duplicates'][_0x64c7('0x53')]){_0x3564fb=_0x64c7('0x7f')+_0x664aa2;_0x1a4f9d[_0x64c7('0x47')](_0x64c7('0x80')+_0x3564fb+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x64c7('0x81')+_0x664aa2;tmp_voice_queues=_0x64c7('0x82')+_0x664aa2;_0x4884c4['push'](_0x64c7('0x80')+tmp_campaigns+_0x64c7('0x83'));_0x4884c4[_0x64c7('0x47')](_0x64c7('0x80')+tmp_voice_queues+_0x64c7('0x83'));BPromise[_0x64c7('0x84')](_0x4884c4,handleTZQuery)[_0x64c7('0x55')](function(_0x421240){updateTzCampaigns(_0x2f4756['ListId'])[_0x64c7('0x55')](function(_0x3aaca4){updateTzVoiceQueues(_0x2f4756[_0x64c7('0x22')])['then'](function(_0x50c877){var _0x2a12ad=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x1fa211,_0x3564fb,_0x9213b1,_0x2f4756['ListId'],_0x2f4756[_0x64c7('0x3c')]||null,NOW,NOW);if(_[_0x64c7('0x76')](_0x271671[_0x64c7('0x21')])){_0x2a12ad+=_0x64c7('0x85');}_0x1a4f9d[_0x64c7('0x47')](_0x2a12ad);if(_0x2f4756[_0x64c7('0x7e')]&&_0x2f4756[_0x64c7('0x7e')]['length']){_0x1a4f9d[_0x64c7('0x47')](insertCmContact(_0x2f4756[_0x64c7('0x22')],_0x3564fb,_0x2f4756[_0x64c7('0x7e')],_0x271671));_0x1a4f9d[_0x64c7('0x47')](_0x64c7('0x86')+_0x3564fb+';');}if(hasTZ){_0x1a4f9d['push'](insertTzCmHopper(_0x2f4756['ListId'],_0x64c7('0x58'),_0x64c7('0x87'),'VoiceQueueId',_0x1d64e3,tmp_voice_queues));_0x1a4f9d[_0x64c7('0x47')](insertTzCmHopperBlack(_0x2f4756['ListId'],_0x64c7('0x88'),'voice_queues','VoiceQueueId'));_0x1a4f9d[_0x64c7('0x47')](insertTzCmHopper(_0x2f4756[_0x64c7('0x22')],'campaigns_has_cm_lists',_0x64c7('0x89'),_0x64c7('0x8a'),_0x1d64e3,tmp_campaigns));_0x1a4f9d[_0x64c7('0x47')](insertTzCmHopperBlack(_0x2f4756['ListId'],_0x64c7('0x8b'),_0x64c7('0x89'),_0x64c7('0x8a')));}else{_0x1a4f9d[_0x64c7('0x47')](insertCmHopper(_0x2f4756[_0x64c7('0x22')],_0x64c7('0x58'),_0x64c7('0x87'),'VoiceQueueId',_0x1d64e3));_0x1a4f9d['push'](insertCmHopperBlack(_0x2f4756['ListId'],_0x64c7('0x88'),_0x64c7('0x87'),_0x64c7('0x8c')));_0x1a4f9d[_0x64c7('0x47')](insertCmHopper(_0x2f4756[_0x64c7('0x22')],_0x64c7('0x4f'),_0x64c7('0x89'),'CampaignId',_0x1d64e3));_0x1a4f9d[_0x64c7('0x47')](insertCmHopperBlack(_0x2f4756['ListId'],_0x64c7('0x8b'),_0x64c7('0x89'),'CampaignId'));}_0x1a4f9d[_0x64c7('0x47')]('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x1a4f9d[_0x64c7('0x47')](_0x64c7('0x86')+tmp_voice_queues+';');BPromise[_0x64c7('0x84')](_0x1a4f9d,handleQuery)[_0x64c7('0x55')](function(_0x59dd27){stats[_0x64c7('0x8d')]=!![];stats[_0x64c7('0x8e')]=_0x2f4756['duplicates']&&_0x2f4756[_0x64c7('0x7e')][_0x64c7('0x53')]?results[0x2]['affectedRows']:results[0x0][_0x64c7('0x8e')];socket[_0x64c7('0x7a')]('contact:import:'+_0x664aa2,stats);fs['unlink'](_0x548e82);fs[_0x64c7('0x8f')](_0x1fa211);process[_0x64c7('0x45')](0x0);})[_0x64c7('0x4c')](function(_0x3bdc78){logger['error'](_0x3bdc78[_0x64c7('0x49')]);process[_0x64c7('0x45')](0x1);});});});});}catch(_0x4f663c){logger[_0x64c7('0x44')](_0x64c7('0x90'),_0x4f663c[_0x64c7('0x49')]);process[_0x64c7('0x45')](0x1);}},'error':function(_0x58d7a9,_0x448d6b,_0x45c157,_0x38942f){throw new Error(_0x38942f);}});}function validate(){if(process[_0x64c7('0x91')]&&process[_0x64c7('0x91')][_0x64c7('0x53')]<0x4){throw new Error(_0x64c7('0x92'));}var _0xa1f4f3=path[_0x64c7('0x12')](config['root'],_0x64c7('0x93'),process[_0x64c7('0x91')][0x2]);if(!fs['existsSync'](_0xa1f4f3)){throw new Error(_0x64c7('0x94'));}var _0x21ff6a={};try{_0x21ff6a=JSON['parse'](process['argv'][0x3]);if(!_0x21ff6a['binding']){throw new Error(_0x64c7('0x95'));}if(!_0x21ff6a['binding']['phone']){throw new Error(_0x64c7('0x96'));}if(!_0x21ff6a['binding'][_0x64c7('0x97')]){throw new Error('firstName\x20is\x20mandatory');}var _0x4dc42c=0x0;if(_0x21ff6a[_0x64c7('0x64')][_0x64c7('0x26')]){_0x4dc42c=0x1;}if(!_0x21ff6a['ListId']){throw new Error(_0x64c7('0x98'));}}catch(_0x1057ed){throw new Error(_0x64c7('0x99'));}var _0x35f77e=[];try{_0x35f77e=_[_0x64c7('0x9a')](JSON[_0x64c7('0x6a')](process[_0x64c7('0x91')][0x4]),'id');}catch(_0x23b28b){logger[_0x64c7('0x42')](_0x64c7('0x9b'));}main(_0xa1f4f3,_0x21ff6a,_0x35f77e,_0x4dc42c);}validate();process['on'](_0x64c7('0x9c'),handleStop);process['on'](_0x64c7('0x9d'),handleUncaughtException);
\ No newline at end of file
index cb75894..1f0b141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c98=['billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','Caller\x20Number','variable','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration'];(function(_0x153faa,_0x75f2a){var _0x43c32a=function(_0x1c5721){while(--_0x1c5721){_0x153faa['push'](_0x153faa['shift']());}};_0x43c32a(++_0x75f2a);}(_0x4c98,0x1a8));var _0x84c9=function(_0x4aa1ec,_0x457655){_0x4aa1ec=_0x4aa1ec-0x0;var _0x14be37=_0x4c98[_0x4aa1ec];return _0x14be37;};'use strict';exports[_0x84c9('0x0')]=function(_0x5a5735,_0xb833b6){var _0x3ba995=[{'type':_0x84c9('0x1'),'content':_0x84c9('0x2'),'variableName':null}];switch(_0x5a5735[_0x84c9('0x3')]()){case'voice':switch(_0xb833b6['toLowerCase']()){case _0x84c9('0x4'):_0x3ba995[_0x84c9('0x5')]({'type':'variable','content':'','variableName':_0x84c9('0x6')});_0x3ba995[_0x84c9('0x5')]({'type':'variable','content':'','variableName':_0x84c9('0x7')});break;case _0x84c9('0x8'):_0x3ba995[_0x84c9('0x5')]({'type':_0x84c9('0x1'),'content':_0x84c9('0x9'),'variableName':null});_0x3ba995['push']({'type':'variable','content':'','variableName':_0x84c9('0xa')});break;}}return _0x3ba995;};exports[_0x84c9('0xb')]=function(_0x36ab2e,_0x2197a8){var _0x558764=[];switch(_0x36ab2e[_0x84c9('0x3')]()){case'voice':switch(_0x2197a8[_0x84c9('0x3')]()){case _0x84c9('0x4'):_0x558764=[{'type':_0x84c9('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0xd'),'keyType':_0x84c9('0xe'),'variableName':_0x84c9('0x7')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0xf'),'keyType':_0x84c9('0xe'),'variableName':_0x84c9('0x10')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x11'),'keyType':_0x84c9('0xe'),'variableName':_0x84c9('0x12')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x13'),'keyType':_0x84c9('0xe'),'variableName':'queue'},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x14'),'keyType':'variable','variableName':_0x84c9('0x15')},{'type':_0x84c9('0xc'),'content':'','key':'Date','keyType':_0x84c9('0xe'),'variableName':_0x84c9('0x16')},{'type':'string','content':_0x84c9('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x18'),'keyType':_0x84c9('0xe'),'variableName':_0x84c9('0x19')},{'type':'keyValue','content':'','key':_0x84c9('0x1a'),'keyType':_0x84c9('0xe'),'variableName':_0x84c9('0xa')},{'type':'string','content':_0x84c9('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0x84c9('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0x84c9('0xe'),'variableName':_0x84c9('0x16')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x1c'),'keyType':_0x84c9('0xe'),'variableName':_0x84c9('0x1d')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x1e'),'keyType':_0x84c9('0xe'),'variableName':_0x84c9('0x1f')},{'type':_0x84c9('0xc'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':'holdtime'},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x20'),'keyType':_0x84c9('0xe'),'variableName':_0x84c9('0x21')}];break;case _0x84c9('0x8'):_0x558764=[{'type':'string','content':_0x84c9('0x22'),'variableName':null},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x23'),'keyType':'variable','keyContent':'','variableName':_0x84c9('0xa')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x24'),'keyType':'variable','keyContent':'','variableName':_0x84c9('0x25')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x14'),'keyType':'variable','keyContent':'','variableName':_0x84c9('0x15')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x26'),'keyType':_0x84c9('0xe'),'keyContent':'','variableName':_0x84c9('0x27')},{'type':_0x84c9('0x1'),'content':_0x84c9('0x1b')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x28'),'keyType':_0x84c9('0xe'),'keyContent':'','variableName':_0x84c9('0x29')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x2a'),'keyType':_0x84c9('0xe'),'keyContent':'','variableName':_0x84c9('0x2b')},{'type':_0x84c9('0xc'),'content':'','key':_0x84c9('0x2c'),'keyType':_0x84c9('0xe'),'keyContent':'','variableName':_0x84c9('0x2d')},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0x84c9('0xe'),'keyContent':'','variableName':_0x84c9('0x2e')}];break;}}return _0x558764;};
\ No newline at end of file
+var _0x5e38=['destexten','Queue','UniqueId','Date','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Member\x20Name','membername','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','inbound','push','queue','calleridnum','outbound','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','variable','Caller\x20Name','calleridname'];(function(_0x1e0d4e,_0xca77c8){var _0x5e5c6b=function(_0x3238b8){while(--_0x3238b8){_0x1e0d4e['push'](_0x1e0d4e['shift']());}};_0x5e5c6b(++_0xca77c8);}(_0x5e38,0xcb));var _0x85e3=function(_0x18c24a,_0x38e08b){_0x18c24a=_0x18c24a-0x0;var _0x4582f6=_0x5e38[_0x18c24a];return _0x4582f6;};'use strict';exports[_0x85e3('0x0')]=function(_0x2ffa64,_0x47a8e1){var _0x57d150=[{'type':_0x85e3('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x2ffa64[_0x85e3('0x2')]()){case _0x85e3('0x3'):switch(_0x47a8e1['toLowerCase']()){case _0x85e3('0x4'):_0x57d150[_0x85e3('0x5')]({'type':'variable','content':'','variableName':_0x85e3('0x6')});_0x57d150['push']({'type':'variable','content':'','variableName':_0x85e3('0x7')});break;case _0x85e3('0x8'):_0x57d150[_0x85e3('0x5')]({'type':_0x85e3('0x1'),'content':_0x85e3('0x9'),'variableName':null});_0x57d150[_0x85e3('0x5')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x57d150;};exports[_0x85e3('0xa')]=function(_0x3da7b4,_0x440c76){var _0x3b7c49=[];switch(_0x3da7b4[_0x85e3('0x2')]()){case _0x85e3('0x3'):switch(_0x440c76['toLowerCase']()){case _0x85e3('0x4'):_0x3b7c49=[{'type':_0x85e3('0x1'),'content':_0x85e3('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0xd'),'keyType':_0x85e3('0xe'),'variableName':_0x85e3('0x7')},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0xf'),'keyType':_0x85e3('0xe'),'variableName':_0x85e3('0x10')},{'type':_0x85e3('0xc'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0x85e3('0x11')},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x12'),'keyType':_0x85e3('0xe'),'variableName':_0x85e3('0x6')},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x13'),'keyType':_0x85e3('0xe'),'variableName':'uniqueid'},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x14'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x85e3('0x1'),'content':_0x85e3('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x85e3('0xc'),'content':'','key':'Agent\x20Name','keyType':_0x85e3('0xe'),'variableName':_0x85e3('0x16')},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x17'),'keyType':_0x85e3('0xe'),'variableName':_0x85e3('0x18')},{'type':_0x85e3('0x1'),'content':_0x85e3('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x85e3('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0x85e3('0xe'),'variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':_0x85e3('0x1a'),'keyType':_0x85e3('0xe'),'variableName':_0x85e3('0x1b')},{'type':_0x85e3('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0x85e3('0xe'),'variableName':'agentcompleteAt'},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x1c'),'keyType':_0x85e3('0xe'),'variableName':_0x85e3('0x1d')},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x1e'),'keyType':_0x85e3('0xe'),'variableName':_0x85e3('0x1f')}];break;case _0x85e3('0x8'):_0x3b7c49=[{'type':_0x85e3('0x1'),'content':_0x85e3('0xb'),'variableName':null},{'type':_0x85e3('0xc'),'content':'','key':'Called\x20Number','keyType':_0x85e3('0xe'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x20'),'keyType':_0x85e3('0xe'),'keyContent':'','variableName':_0x85e3('0x21')},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x13'),'keyType':'variable','keyContent':'','variableName':_0x85e3('0x22')},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x14'),'keyType':_0x85e3('0xe'),'keyContent':'','variableName':_0x85e3('0x23')},{'type':_0x85e3('0x1'),'content':_0x85e3('0x19')},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x24'),'keyType':'variable','keyContent':'','variableName':_0x85e3('0x25')},{'type':'keyValue','content':'','key':_0x85e3('0x26'),'keyType':_0x85e3('0xe'),'keyContent':'','variableName':_0x85e3('0x27')},{'type':'keyValue','content':'','key':_0x85e3('0x28'),'keyType':_0x85e3('0xe'),'keyContent':'','variableName':_0x85e3('0x29')},{'type':_0x85e3('0xc'),'content':'','key':_0x85e3('0x2a'),'keyType':_0x85e3('0xe'),'keyContent':'','variableName':_0x85e3('0x2b')}];break;}}return _0x3b7c49;};
\ No newline at end of file
index 49cd50e..919c54c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc48=['body','html','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','name','role','null','Interaction','findOne','then','update','info','catch','error','tracked','user','query','omit'];(function(_0x5c0d27,_0xff9e44){var _0xefb87a=function(_0x401fc0){while(--_0x401fc0){_0x5c0d27['push'](_0x5c0d27['shift']());}};_0xefb87a(++_0xff9e44);}(_0xbc48,0x9b));var _0x8bc4=function(_0x3448ad,_0x2ab150){_0x3448ad=_0x3448ad-0x0;var _0x21b713=_0xbc48[_0x3448ad];return _0x21b713;};'use strict';var _=require(_0x8bc4('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x8bc4('0x1'))(_0x8bc4('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')(_0x8bc4('0x3')),'sms':require('../../config/logger')(_0x8bc4('0x4')),'chat':require(_0x8bc4('0x1'))(_0x8bc4('0x5')),'whatsapp':require('../../config/logger')(_0x8bc4('0x6'))};function getInteractionId(_0x1c420d,_0x4376f5,_0x21a5b1){if(_0x1c420d&&_0x1c420d[_[_0x8bc4('0x7')](_0x21a5b1)+_0x8bc4('0x8')]){return _0x1c420d[_[_0x8bc4('0x7')](_0x21a5b1)+_0x8bc4('0x8')];}else if(_0x1c420d&&_0x1c420d['id']){return _0x1c420d['id'];}else if(_0x4376f5&&_0x4376f5['id']){return _0x4376f5['id'];}else{return _0x8bc4('0x9');}}function log(_0x122737,_0x39b2aa,_0x16c4f9,_0x30babd,_0x257d18,_0x369687){loggers[_0x257d18[_0x8bc4('0xa')]()][_0x122737]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x369687['toUpperCase'](),_0x39b2aa?_0x39b2aa['id']:null,_0x39b2aa?_0x39b2aa[_0x8bc4('0xb')]:null,_0x39b2aa?_0x39b2aa[_0x8bc4('0xc')]:null,getInteractionId(_0x16c4f9,_0x30babd,_0x257d18),_0x16c4f9?JSON['stringify'](_0x16c4f9):_0x8bc4('0xd'));}function updateUser(_0x3a141e,_0x585c4d,_0x5bda62,_0x129d85,_0x5764bd){db[_['upperFirst'](_0x129d85)+_0x8bc4('0xe')][_0x8bc4('0xf')]({'where':{'id':getInteractionId(_0x585c4d,_0x5bda62,_0x129d85)}})[_0x8bc4('0x10')](function(_0x39be74){if(_0x39be74){return _0x39be74[_0x8bc4('0x11')]({'UserId':_0x3a141e?_0x3a141e['id']:null});}})[_0x8bc4('0x10')](function(_0x3eb637){if(_0x3eb637){log(_0x8bc4('0x12'),_0x3a141e,_0x585c4d,_0x5bda62,_0x129d85,_0x5764bd);}})[_0x8bc4('0x13')](function(){log(_0x8bc4('0x14'),_0x3a141e,_0x585c4d,_0x5bda62,_0x129d85,_0x5764bd);});}exports[_0x8bc4('0x15')]=function(_0x1c9065,_0x3f34e9){return function(_0x4f930c,_0x5152c3,_0x371c7b){var _0x26564f=_0x4f930c[_0x8bc4('0x16')];var _0x482295={};var _0x418b9b=_0x4f930c[_0x8bc4('0x17')];if(_0x482295){_0x482295=_['clone'](_0x4f930c['body']);_0x482295=_[_0x8bc4('0x18')](_0x482295,[_0x8bc4('0x19'),_0x8bc4('0x1a'),_0x8bc4('0x1b'),_0x8bc4('0x1c'),_0x8bc4('0x1d')]);}updateUser(_0x26564f,_0x482295,_0x418b9b,_0x1c9065,_0x3f34e9);_0x371c7b(null);};};
\ No newline at end of file
+var _0xad44=['chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','name','stringify','Interaction','findOne','then','update','info','catch','user','query','clone','body','html','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions'];(function(_0x1a9e40,_0x5d0096){var _0x5b00f2=function(_0x3b2ab6){while(--_0x3b2ab6){_0x1a9e40['push'](_0x1a9e40['shift']());}};_0x5b00f2(++_0x5d0096);}(_0xad44,0x1d6));var _0x4ad4=function(_0x9bca53,_0x59b4f8){_0x9bca53=_0x9bca53-0x0;var _0x3894bc=_0xad44[_0x9bca53];return _0x3894bc;};'use strict';var _=require(_0x4ad4('0x0'));var db=require(_0x4ad4('0x1'))['db'];var loggers={'openchannel':require(_0x4ad4('0x2'))(_0x4ad4('0x3')),'mail':require(_0x4ad4('0x2'))(_0x4ad4('0x4')),'fax':require(_0x4ad4('0x2'))('fax-interactions'),'sms':require(_0x4ad4('0x2'))('sms-interactions'),'chat':require('../../config/logger')(_0x4ad4('0x5')),'whatsapp':require(_0x4ad4('0x2'))(_0x4ad4('0x6'))};function getInteractionId(_0x4add64,_0x169b8c,_0x502ef3){if(_0x4add64&&_0x4add64[_[_0x4ad4('0x7')](_0x502ef3)+_0x4ad4('0x8')]){return _0x4add64[_['upperFirst'](_0x502ef3)+_0x4ad4('0x8')];}else if(_0x4add64&&_0x4add64['id']){return _0x4add64['id'];}else if(_0x169b8c&&_0x169b8c['id']){return _0x169b8c['id'];}else{return _0x4ad4('0x9');}}function log(_0x2af6bb,_0x50aa5f,_0x58343f,_0x5bbea3,_0x2ea77e,_0x204605){loggers[_0x2ea77e[_0x4ad4('0xa')]()][_0x2af6bb]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x204605['toUpperCase'](),_0x50aa5f?_0x50aa5f['id']:null,_0x50aa5f?_0x50aa5f[_0x4ad4('0xb')]:null,_0x50aa5f?_0x50aa5f['role']:null,getInteractionId(_0x58343f,_0x5bbea3,_0x2ea77e),_0x58343f?JSON[_0x4ad4('0xc')](_0x58343f):'null');}function updateUser(_0x37e3fa,_0x1e40fa,_0x732627,_0x2ae0f8,_0x1b0628){db[_[_0x4ad4('0x7')](_0x2ae0f8)+_0x4ad4('0xd')][_0x4ad4('0xe')]({'where':{'id':getInteractionId(_0x1e40fa,_0x732627,_0x2ae0f8)}})[_0x4ad4('0xf')](function(_0x537d7e){if(_0x537d7e){return _0x537d7e[_0x4ad4('0x10')]({'UserId':_0x37e3fa?_0x37e3fa['id']:null});}})['then'](function(_0x303642){if(_0x303642){log(_0x4ad4('0x11'),_0x37e3fa,_0x1e40fa,_0x732627,_0x2ae0f8,_0x1b0628);}})[_0x4ad4('0x12')](function(){log('error',_0x37e3fa,_0x1e40fa,_0x732627,_0x2ae0f8,_0x1b0628);});}exports['tracked']=function(_0x49e768,_0x14ea47){return function(_0x4eb4dd,_0x55543d,_0x5bfdfa){var _0x1dabd4=_0x4eb4dd[_0x4ad4('0x13')];var _0x3d2fb1={};var _0x323d1f=_0x4eb4dd[_0x4ad4('0x14')];if(_0x3d2fb1){_0x3d2fb1=_[_0x4ad4('0x15')](_0x4eb4dd[_0x4ad4('0x16')]);_0x3d2fb1=_['omit'](_0x3d2fb1,['body',_0x4ad4('0x17'),'phone','fax',_0x4ad4('0x18')]);}updateUser(_0x1dabd4,_0x3d2fb1,_0x323d1f,_0x49e768,_0x14ea47);_0x5bfdfa(null);};};
\ No newline at end of file
index dbd933b..fd4a546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd652=['status','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','user','isUserLimit','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','then','count'];(function(_0x4dc763,_0x22bff4){var _0x292fe1=function(_0x409c8a){while(--_0x409c8a){_0x4dc763['push'](_0x4dc763['shift']());}};_0x292fe1(++_0x22bff4);}(_0xd652,0xcd));var _0x2d65=function(_0xf12e7d,_0x1d65e0){_0xf12e7d=_0xf12e7d-0x0;var _0x131fdb=_0xd652[_0xf12e7d];return _0x131fdb;};'use strict';var crypto=require('crypto');var util=require(_0x2d65('0x0'));var compose=require('composable-middleware');var db=require(_0x2d65('0x1'))['db'];var config=require(_0x2d65('0x2'));function getValueFromLicense(_0x28e7dd,_0x4b3fd5){if(_0x28e7dd&&_0x4b3fd5){if(_0x4b3fd5[_0x2d65('0x3')]&&_0x4b3fd5[_0x2d65('0x4')]){var _0x4af9e0=_0x4b3fd5[_0x2d65('0x3')];var _0x1148a2=_0x4b3fd5['license'];var _0x2657ac=_0x4af9e0[_0x2d65('0x5')]('-')[0x4];var _0x1fadbb=_0x4af9e0[_0x2d65('0x5')]('-')[0x0];var _0x5e72e3=crypto[_0x2d65('0x6')]('aes-256-ctr',util['format'](_0x2d65('0x7'),_0x2657ac,_0x4af9e0,_0x1fadbb));var _0x22389a=_0x5e72e3['update'](_0x1148a2,_0x2d65('0x8'),_0x2d65('0x9'));_0x22389a+=_0x5e72e3[_0x2d65('0xa')](_0x2d65('0x9'));var _0x2a1699=JSON[_0x2d65('0xb')](_0x22389a);return _0x2a1699[_0x2d65('0xc')](_0x28e7dd)?_0x2a1699[_0x28e7dd]:null;}}return null;}function isLimit(_0x2d5875,_0x2c721f,_0x5cf4df,_0x4e61a0){var _0x159c92=_0x2c721f;return compose()['use'](function(_0x3de41d,_0x2697ae,_0xb1b0fd){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x2d65('0xd')](function(_0x47c5d8){var _0x1dba98=getValueFromLicense(_0x2d5875,_0x47c5d8);return _0x1dba98?_0x1dba98:_0x159c92;})['then'](function(_0x51f4bf){_0x159c92=_0x51f4bf;return _0x5cf4df[_0x2d65('0xe')](_0x4e61a0);})[_0x2d65('0xd')](function(_0x6fabb1){if(_0x6fabb1>=_0x159c92){return _0x2697ae[_0x2d65('0xf')](0x193)['json']({'message':util[_0x2d65('0x10')](_0x2d65('0x11'),_0x2d5875)});}_0xb1b0fd();})[_0x2d65('0x12')](function(_0x3cf4be){_0xb1b0fd(_0x3cf4be);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x2d65('0x13')],{'where':{'$or':[{'role':'admin'},{'role':_0x2d65('0x14')}]}});}exports[_0x2d65('0x15')]=isUserLimit;
\ No newline at end of file
+var _0x0a69=['users','user','crypto','util','composable-middleware','../../mysqldb','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','findOne','then','count'];(function(_0x575833,_0x11e389){var _0x2183ec=function(_0x47e278){while(--_0x47e278){_0x575833['push'](_0x575833['shift']());}};_0x2183ec(++_0x11e389);}(_0x0a69,0x13d));var _0x90a6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0a69[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require(_0x90a6('0x0'));var util=require(_0x90a6('0x1'));var compose=require(_0x90a6('0x2'));var db=require(_0x90a6('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x34bf31,_0x3aa2a1){if(_0x34bf31&&_0x3aa2a1){if(_0x3aa2a1[_0x90a6('0x4')]&&_0x3aa2a1['license']){var _0x26c34b=_0x3aa2a1[_0x90a6('0x4')];var _0x57e7d8=_0x3aa2a1[_0x90a6('0x5')];var _0x8b6944=_0x26c34b['split']('-')[0x4];var _0x4fd14b=_0x26c34b[_0x90a6('0x6')]('-')[0x0];var _0x44369d=crypto['createDecipher'](_0x90a6('0x7'),util[_0x90a6('0x8')](_0x90a6('0x9'),_0x8b6944,_0x26c34b,_0x4fd14b));var _0x5933c6=_0x44369d[_0x90a6('0xa')](_0x57e7d8,_0x90a6('0xb'),_0x90a6('0xc'));_0x5933c6+=_0x44369d['final'](_0x90a6('0xc'));var _0x3f9af1=JSON[_0x90a6('0xd')](_0x5933c6);return _0x3f9af1[_0x90a6('0xe')](_0x34bf31)?_0x3f9af1[_0x34bf31]:null;}}return null;}function isLimit(_0x2d5594,_0x369df4,_0x3d6496,_0x15b34f){var _0x2d518f=_0x369df4;return compose()[_0x90a6('0xf')](function(_0x9ac2e3,_0x10114b,_0x274968){return db['License'][_0x90a6('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x90a6('0x11')](function(_0x1f584f){var _0x8e8b4c=getValueFromLicense(_0x2d5594,_0x1f584f);return _0x8e8b4c?_0x8e8b4c:_0x2d518f;})[_0x90a6('0x11')](function(_0xc99cd8){_0x2d518f=_0xc99cd8;return _0x3d6496[_0x90a6('0x12')](_0x15b34f);})[_0x90a6('0x11')](function(_0x55fb22){if(_0x55fb22>=_0x2d518f){return _0x10114b['status'](0x193)['json']({'message':util[_0x90a6('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2d5594)});}_0x274968();})['catch'](function(_0x387614){_0x274968(_0x387614);});});}function isUserLimit(){return isLimit(_0x90a6('0x13'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x90a6('0x14')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
index 57bc71f..741ac5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ab5=['slice','forEach','shift','match','indexOf','map','conditions','push','DATE','operator','$between','value','$lte','add','days','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','$gte','>=\x20?','start','pop','utcOffset','format','hours','minutes','startsWith','[$or]','replace','split','length'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x9ab5,0x14b));var _0x59ab=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9ab5[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var moment=require('moment');exports['parseSearch']=function(_0x4baedc){var _0x579946={'conditions':[]};_0x579946['sqlOperator']=_[_0x59ab('0x0')](_0x4baedc,_0x59ab('0x1'))?'or':'and';var _0x415ccc=_0x4baedc['replace']('[$and]','')[_0x59ab('0x2')](_0x59ab('0x1'),'')[_0x59ab('0x3')]('||');for(var _0x2ea235=0x0;_0x2ea235<_0x415ccc[_0x59ab('0x4')];_0x2ea235++){var _0x20e1f9=_0x415ccc[_0x2ea235][_0x59ab('0x3')](':=');var _0x5330d4=_0x20e1f9[0x0];var _0x46e514=_0x20e1f9[_0x59ab('0x5')](0x1);_0x46e514[_0x59ab('0x6')](function(_0x14f7b0){var _0x1a2232=_0x14f7b0['split']('[')[_0x59ab('0x7')]();var _0x35d6f3=_0x14f7b0[_0x59ab('0x8')](/\[(.*?)\]/g);_0x35d6f3[_0x59ab('0x6')](function(_0x2df30d){var _0x4fb9c2=_0x2df30d[_0x59ab('0x3')]('[')['filter'](function(_0x4f5baf){return _0x4f5baf[_0x59ab('0x9')](']')>-0x1;})[_0x59ab('0xa')](function(_0x4a87d7){return _0x4a87d7['split'](']')[0x0];})[0x0];_0x579946[_0x59ab('0xb')][_0x59ab('0xc')]({'field':_0x5330d4,'operator':_0x1a2232,'value':_0x4fb9c2});});});}return _0x579946;};exports['buildExpression']=function(_0x15fcd4,_0x3e3d35,_0x22d973){var _0x6b5b8={};if(_0x3e3d35===_0x59ab('0xd')){if(_0x22d973[_0x59ab('0xe')]==='$eq'){_0x22d973[_0x59ab('0xe')]=_0x59ab('0xf');_0x22d973[_0x59ab('0x10')]+=','+_0x22d973[_0x59ab('0x10')];}else if(_['includes'](['$gt',_0x59ab('0x11')],_0x22d973[_0x59ab('0xe')])){_0x22d973[_0x59ab('0x10')]=moment(_0x22d973['value'])[_0x59ab('0x12')](0x1,_0x59ab('0x13'))['format']('YYYY-MM-DD');}}if(_0x22d973['castTo']){_0x3e3d35=_0x22d973[_0x59ab('0x14')];_0x6b5b8[_0x59ab('0x15')]=_0x59ab('0x16')+_0x15fcd4+'.'+_0x22d973['field']+_0x59ab('0x17')+_0x22d973[_0x59ab('0x14')]+')\x20'+parseOperator(_0x22d973[_0x59ab('0xe')]);}else{_0x6b5b8[_0x59ab('0x15')]=_0x15fcd4+'.'+_0x22d973[_0x59ab('0x18')]+'\x20'+parseOperator(_0x22d973[_0x59ab('0xe')]);}if(_['includes']([_0x59ab('0x19'),_0x59ab('0x1a')],_0x22d973[_0x59ab('0xe')]))_0x6b5b8['text']='('+_0x6b5b8[_0x59ab('0x15')]+_0x59ab('0x1b')+_0x15fcd4+'.'+_0x22d973[_0x59ab('0x18')]+_0x59ab('0x1c');_0x6b5b8['value']=parseValue(_0x3e3d35,_0x22d973[_0x59ab('0xe')],_0x22d973[_0x59ab('0x10')]);return _0x6b5b8;};function parseOperator(_0x2e1e56){var _0x290313;switch(_0x2e1e56){case _0x59ab('0x1d'):_0x290313=_0x59ab('0x1e');break;case _0x59ab('0x1a'):_0x290313=_0x59ab('0x1f');break;case _0x59ab('0x20'):_0x290313='=\x20?';break;case'$ne':_0x290313=_0x59ab('0x21');break;case _0x59ab('0x22'):case _0x59ab('0x23'):case'$endsWith':_0x290313=_0x59ab('0x24');break;case _0x59ab('0x25'):_0x290313='<\x20?';break;case'$gt':_0x290313=_0x59ab('0x26');break;case _0x59ab('0x11'):_0x290313=_0x59ab('0x27');break;case _0x59ab('0x28'):_0x290313=_0x59ab('0x29');break;case _0x59ab('0xf'):_0x290313='BETWEEN\x20?\x20AND\x20?';break;}return _0x290313;}function parseValue(_0x595ae5,_0x5a84e5,_0x4b2541){var _0x21fc4f={'start':undefined,'end':undefined};switch(_0x5a84e5){case'$in':case _0x59ab('0x1a'):_0x21fc4f[_0x59ab('0x2a')]=_0x4b2541[_0x59ab('0x3')](',');break;case'$substring':_0x21fc4f[_0x59ab('0x2a')]='%'+_0x4b2541+'%';break;case _0x59ab('0x23'):_0x21fc4f[_0x59ab('0x2a')]=_0x4b2541+'%';break;case'$endsWith':_0x21fc4f[_0x59ab('0x2a')]='%'+_0x4b2541;break;case'$between':var _0x38c7ae=_0x4b2541[_0x59ab('0x3')](',');var _0x4b2541=_0x38c7ae[_0x59ab('0x7')]();var _0x565c9c=_0x38c7ae[_0x59ab('0x2b')]();if(_0x595ae5===_0x59ab('0xd')){_0x4b2541=moment(_0x4b2541)[_0x59ab('0x2c')](0x0,!![])[_0x59ab('0x2d')]();_0x565c9c=moment(_0x565c9c)[_0x59ab('0x2c')](0x0,!![])[_0x59ab('0x12')](0x17,_0x59ab('0x2e'))['add'](0x3b,_0x59ab('0x2f'))[_0x59ab('0x12')](0x3b,'seconds')[_0x59ab('0x2d')]();}_0x21fc4f={'start':_0x4b2541,'end':_0x565c9c};break;default:_0x21fc4f[_0x59ab('0x2a')]=_0x4b2541;break;}return _0x21fc4f;}
\ No newline at end of file
+var _0xf7a6=['<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$in','start','pop','utcOffset','hours','minutes','seconds','moment','parseSearch','startsWith','and','replace','[$and]','[$or]','split','length','slice','shift','match','forEach','filter','map','push','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt'];(function(_0x5154a6,_0x428f5a){var _0x3c8400=function(_0x3ee3a2){while(--_0x3ee3a2){_0x5154a6['push'](_0x5154a6['shift']());}};_0x3c8400(++_0x428f5a);}(_0xf7a6,0x1a2));var _0x6f7a=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xf7a6[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');var moment=require(_0x6f7a('0x0'));exports[_0x6f7a('0x1')]=function(_0x6eb157){var _0x29f325={'conditions':[]};_0x29f325['sqlOperator']=_[_0x6f7a('0x2')](_0x6eb157,'[$or]')?'or':_0x6f7a('0x3');var _0x59c855=_0x6eb157[_0x6f7a('0x4')](_0x6f7a('0x5'),'')['replace'](_0x6f7a('0x6'),'')[_0x6f7a('0x7')]('||');for(var _0x587a62=0x0;_0x587a62<_0x59c855[_0x6f7a('0x8')];_0x587a62++){var _0x4e1ae7=_0x59c855[_0x587a62][_0x6f7a('0x7')](':=');var _0x1ebabe=_0x4e1ae7[0x0];var _0x5ce550=_0x4e1ae7[_0x6f7a('0x9')](0x1);_0x5ce550['forEach'](function(_0x4c7afc){var _0x36c3f8=_0x4c7afc[_0x6f7a('0x7')]('[')[_0x6f7a('0xa')]();var _0x5b5ca5=_0x4c7afc[_0x6f7a('0xb')](/\[(.*?)\]/g);_0x5b5ca5[_0x6f7a('0xc')](function(_0x3fc19b){var _0x1c7f55=_0x3fc19b[_0x6f7a('0x7')]('[')[_0x6f7a('0xd')](function(_0x3df957){return _0x3df957['indexOf'](']')>-0x1;})[_0x6f7a('0xe')](function(_0x3993b5){return _0x3993b5['split'](']')[0x0];})[0x0];_0x29f325['conditions'][_0x6f7a('0xf')]({'field':_0x1ebabe,'operator':_0x36c3f8,'value':_0x1c7f55});});});}return _0x29f325;};exports[_0x6f7a('0x10')]=function(_0x305d41,_0x1ebea6,_0xe4a07b){var _0x59faf9={};if(_0x1ebea6===_0x6f7a('0x11')){if(_0xe4a07b[_0x6f7a('0x12')]==='$eq'){_0xe4a07b['operator']=_0x6f7a('0x13');_0xe4a07b[_0x6f7a('0x14')]+=','+_0xe4a07b[_0x6f7a('0x14')];}else if(_[_0x6f7a('0x15')]([_0x6f7a('0x16'),_0x6f7a('0x17')],_0xe4a07b[_0x6f7a('0x12')])){_0xe4a07b[_0x6f7a('0x14')]=moment(_0xe4a07b[_0x6f7a('0x14')])[_0x6f7a('0x18')](0x1,_0x6f7a('0x19'))[_0x6f7a('0x1a')](_0x6f7a('0x1b'));}}if(_0xe4a07b[_0x6f7a('0x1c')]){_0x1ebea6=_0xe4a07b['castTo'];_0x59faf9[_0x6f7a('0x1d')]=_0x6f7a('0x1e')+_0x305d41+'.'+_0xe4a07b[_0x6f7a('0x1f')]+_0x6f7a('0x20')+_0xe4a07b[_0x6f7a('0x1c')]+')\x20'+parseOperator(_0xe4a07b[_0x6f7a('0x12')]);}else{_0x59faf9['text']=_0x305d41+'.'+_0xe4a07b[_0x6f7a('0x1f')]+'\x20'+parseOperator(_0xe4a07b['operator']);}if(_[_0x6f7a('0x15')]([_0x6f7a('0x21'),_0x6f7a('0x22')],_0xe4a07b[_0x6f7a('0x12')]))_0x59faf9[_0x6f7a('0x1d')]='('+_0x59faf9[_0x6f7a('0x1d')]+_0x6f7a('0x23')+_0x305d41+'.'+_0xe4a07b[_0x6f7a('0x1f')]+_0x6f7a('0x24');_0x59faf9[_0x6f7a('0x14')]=parseValue(_0x1ebea6,_0xe4a07b[_0x6f7a('0x12')],_0xe4a07b['value']);return _0x59faf9;};function parseOperator(_0x26b207){var _0x12d5c1;switch(_0x26b207){case'$in':_0x12d5c1=_0x6f7a('0x25');break;case'$notIn':_0x12d5c1=_0x6f7a('0x26');break;case _0x6f7a('0x27'):_0x12d5c1=_0x6f7a('0x28');break;case _0x6f7a('0x21'):_0x12d5c1=_0x6f7a('0x29');break;case _0x6f7a('0x2a'):case _0x6f7a('0x2b'):case'$endsWith':_0x12d5c1=_0x6f7a('0x2c');break;case _0x6f7a('0x2d'):_0x12d5c1=_0x6f7a('0x2e');break;case _0x6f7a('0x16'):_0x12d5c1=_0x6f7a('0x2f');break;case _0x6f7a('0x17'):_0x12d5c1=_0x6f7a('0x30');break;case _0x6f7a('0x31'):_0x12d5c1=_0x6f7a('0x32');break;case'$between':_0x12d5c1='BETWEEN\x20?\x20AND\x20?';break;}return _0x12d5c1;}function parseValue(_0x3eb628,_0x4505ce,_0x3f1ed6){var _0x4e73a5={'start':undefined,'end':undefined};switch(_0x4505ce){case _0x6f7a('0x33'):case _0x6f7a('0x22'):_0x4e73a5[_0x6f7a('0x34')]=_0x3f1ed6[_0x6f7a('0x7')](',');break;case _0x6f7a('0x2a'):_0x4e73a5[_0x6f7a('0x34')]='%'+_0x3f1ed6+'%';break;case'$startsWith':_0x4e73a5['start']=_0x3f1ed6+'%';break;case'$endsWith':_0x4e73a5['start']='%'+_0x3f1ed6;break;case _0x6f7a('0x13'):var _0xdc209b=_0x3f1ed6[_0x6f7a('0x7')](',');var _0x3f1ed6=_0xdc209b[_0x6f7a('0xa')]();var _0x129ecf=_0xdc209b[_0x6f7a('0x35')]();if(_0x3eb628===_0x6f7a('0x11')){_0x3f1ed6=moment(_0x3f1ed6)[_0x6f7a('0x36')](0x0,!![])[_0x6f7a('0x1a')]();_0x129ecf=moment(_0x129ecf)[_0x6f7a('0x36')](0x0,!![])['add'](0x17,_0x6f7a('0x37'))[_0x6f7a('0x18')](0x3b,_0x6f7a('0x38'))[_0x6f7a('0x18')](0x3b,_0x6f7a('0x39'))[_0x6f7a('0x1a')]();}_0x4e73a5={'start':_0x3f1ed6,'end':_0x129ecf};break;default:_0x4e73a5[_0x6f7a('0x34')]=_0x3f1ed6;break;}return _0x4e73a5;}
\ No newline at end of file
index 7e6518d..b51936b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb66c=['isEmpty','length','omit','isObject','unset','hasOwnProperty','isNumeric','match','isEmail','forEach','push','join','getOptions','$id','query','model','intersection','attributes','nolimit','limit','offset','where','pick','object','filter','columns','merge','map','VIRTUAL','lower','options','lodash','moment','parse','keys','includes','fields','split','filters','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','name','uniqueid','isArray','sort','cast','priority','unsigned','substr','DESC','col'];(function(_0x205e7b,_0x30d30d){var _0x16e2f5=function(_0xbc7e35){while(--_0xbc7e35){_0x205e7b['push'](_0x205e7b['shift']());}};_0x16e2f5(++_0x30d30d);}(_0xb66c,0x175));var _0xcb66=function(_0x136425,_0x553df0){_0x136425=_0x136425-0x0;var _0x464b54=_0xb66c[_0x136425];return _0x464b54;};'use strict';var _=require(_0xcb66('0x0'));var sequelize=require('sequelize');var moment=require(_0xcb66('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x55a57b){var _0x2afcb8=['ne'];try{var _0x24ea13=JSON[_0xcb66('0x2')](_0x55a57b);var _0x5f487c=Object[_0xcb66('0x3')](_0x24ea13)[0x0];return _0x2afcb8[_0xcb66('0x4')](_0x5f487c);}catch(_0x3f7cc7){return![];}}function getOperatorValue(_0x21be55){var _0x5d766d=JSON['parse'](_0x21be55);var _0x19adf5=Object[_0xcb66('0x3')](_0x5d766d)[0x0];var _0xa3993=_0x5d766d[_0x19adf5];return{['$'+_0x19adf5]:_0xa3993};}exports[_0xcb66('0x5')]=function(_0xf7bc39){var _0x58582b=null;if(_0xf7bc39){_0x58582b=_0xf7bc39[_0xcb66('0x6')](',');}return _0x58582b;};exports[_0xcb66('0x7')]=function(_0x174969,_0x25b56c){var _0x3c4ce1={};if(!_['isEmpty'](_0x174969)){_[_0xcb66('0x8')](_0x174969,function(_0x2b32ec,_0xf12828){try{if(_0x25b56c){var _0x38c2e6=_['find'](_0x25b56c,{'name':_0xf12828})||{};if(hasSequelizeOperator(_0x2b32ec)){_0x3c4ce1[_0xf12828]=getOperatorValue(_0x2b32ec);}else if(_0x38c2e6[_0xcb66('0x9')]===_0xcb66('0xa')&&_[_0xcb66('0xb')](_0x2b32ec)){var _0x2339bb=JSON['parse'](_0x2b32ec);var _0x4079ae={'$gte':moment(moment(_0x2339bb[_0xcb66('0xc')])[_0xcb66('0xd')](_0xcb66('0xe')))['utc']()[_0xcb66('0xd')](),'$lte':moment(moment(_0x2339bb['$lte'])[_0xcb66('0xd')]('YYYY-MM-DD'))[_0xcb66('0xf')]()['subtract'](0x1,'s')['format']()};_0x3c4ce1[_0xf12828]=_0x4079ae;}else if(_0x38c2e6[_0xcb66('0x10')]===_0xcb66('0x11')){_0x3c4ce1[_0xf12828]=_0x2b32ec;}else{_0x3c4ce1[_0xf12828]=_[_0xcb66('0x12')](_0x2b32ec)?_0x2b32ec:JSON[_0xcb66('0x2')](_0x2b32ec);}}else{_0x3c4ce1[_0xf12828]=_['isArray'](_0x2b32ec)?_0x2b32ec:JSON[_0xcb66('0x2')](_0x2b32ec);}}catch(_0x42ad03){_0x3c4ce1[_0xf12828]=_0x2b32ec[_0xcb66('0x6')](',');}});}return _0x3c4ce1;};exports['limit']=function(_0x2e4126){_0x2e4126=parseInt(_0x2e4126,0xa);if(!_0x2e4126||_0x2e4126<0x0){_0x2e4126=LIMIT_VALUE;}return _0x2e4126;};exports['offset']=function(_0x4165ea){_0x4165ea=parseInt(_0x4165ea,0xa);if(!_0x4165ea||_0x4165ea<0x0){_0x4165ea=0x0;}return _0x4165ea;};exports[_0xcb66('0x13')]=function(_0xdf0ba0){var _0x1ccb71,_0x540782=null;if(_0xdf0ba0){_0x1ccb71=_0xdf0ba0['split'](',');_0x540782=_['map'](_0x1ccb71,function(_0xb39b87){if(_0xb39b87['indexOf']('-')===0x0){return[_0xb39b87==='priority'?sequelize[_0xcb66('0x14')](sequelize['col'](_0xcb66('0x15')),_0xcb66('0x16')):_0xb39b87[_0xcb66('0x17')](0x1),_0xcb66('0x18')];}else{return[_0xb39b87===_0xcb66('0x15')?sequelize[_0xcb66('0x14')](sequelize[_0xcb66('0x19')]('priority'),_0xcb66('0x16')):_0xb39b87,'ASC'];}});}return _0x540782;};exports['omit']=function(_0xf89c0e,_0x37e4c8){if(_[_0xcb66('0x1a')](_0xf89c0e)){return _0xf89c0e;}if(_['isArray'](_0xf89c0e)){for(var _0x341554=0x0;_0x341554<_0xf89c0e[_0xcb66('0x1b')];_0x341554+=0x1){_0xf89c0e[_0x341554]=this[_0xcb66('0x1c')](_0xf89c0e[_0x341554],_0x37e4c8);}return _0xf89c0e;}if(!_[_0xcb66('0x1d')](_0xf89c0e)){return _0xf89c0e;}if(_['isString'](_0x37e4c8)){_0x37e4c8=[_0x37e4c8];}if(!_[_0xcb66('0x12')](_0x37e4c8)){return _0xf89c0e;}for(var _0x31560e=0x0;_0x31560e<_0x37e4c8[_0xcb66('0x1b')];_0x31560e+=0x1){_[_0xcb66('0x1e')](_0xf89c0e,_0x37e4c8[_0x31560e]);}for(var _0x37a676 in _0xf89c0e){if(_0xf89c0e[_0xcb66('0x1f')](_0x37a676)){_0xf89c0e[_0x37a676]=this[_0xcb66('0x1c')](_0xf89c0e[_0x37a676],_0x37e4c8);}}return _0xf89c0e;};exports[_0xcb66('0x20')]=function(_0x28fc0b){return _0x28fc0b[_0xcb66('0x21')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xcb66('0x22')]=function(_0x5b7cf2){return _0x5b7cf2['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x31a10a){var _0x4ca8b4=[];_0x31a10a[_0xcb66('0x6')](/[ ,]+/)[_0xcb66('0x23')](function(_0x1b8a79){_0x1b8a79=_0x1b8a79['replace'](/([^:]")"+/g,'$1');_0x1b8a79='+'+_0x1b8a79+'*';var _0x123787=/[ `!@#$%^&*()_\-?~]/;if(_0x1b8a79[_0xcb66('0x21')](_0x123787))_0x1b8a79='\x22'+_0x1b8a79+'\x22';_0x4ca8b4[_0xcb66('0x24')](_0x1b8a79);});return _0x4ca8b4[_0xcb66('0x25')]('\x20');};exports[_0xcb66('0x26')]=function(_0x375636,_0x2a5e56,_0x36dfe3){var _0x2d27f7={},_0x3e4755={};if(_0x2a5e56['query'][_0xcb66('0x27')]){_0x2a5e56[_0xcb66('0x28')]['id']=_0x2a5e56[_0xcb66('0x28')][_0xcb66('0x27')];delete _0x2a5e56[_0xcb66('0x28')][_0xcb66('0x27')];}_0x2d27f7[_0xcb66('0x29')]=_['map'](_0x375636,_0xcb66('0x10'));_0x2d27f7[_0xcb66('0x28')]=_[_0xcb66('0x3')](_0x2a5e56[_0xcb66('0x28')]);_0x2d27f7['filters']=_[_0xcb66('0x2a')](_0x2d27f7[_0xcb66('0x29')],_0x2d27f7[_0xcb66('0x28')]);_0x3e4755[_0xcb66('0x2b')]=_[_0xcb66('0x2a')](_0x2d27f7[_0xcb66('0x29')],this[_0xcb66('0x5')](_0x2a5e56[_0xcb66('0x28')][_0xcb66('0x5')]));_0x3e4755[_0xcb66('0x2b')]=_0x3e4755[_0xcb66('0x2b')][_0xcb66('0x1b')]?_0x3e4755['attributes']:_0x2d27f7['model'];if(!_0x2a5e56['query'][_0xcb66('0x1f')](_0xcb66('0x2c'))){_0x3e4755[_0xcb66('0x2d')]=this[_0xcb66('0x2d')](_0x2a5e56[_0xcb66('0x28')][_0xcb66('0x2d')]);_0x3e4755['offset']=this[_0xcb66('0x2e')](_0x2a5e56['query']['offset']);}_0x3e4755['order']=this[_0xcb66('0x13')](_0x2a5e56[_0xcb66('0x28')][_0xcb66('0x13')]);_0x3e4755[_0xcb66('0x2f')]=this[_0xcb66('0x7')](_[_0xcb66('0x30')](_0x2a5e56[_0xcb66('0x28')],_0x2d27f7[_0xcb66('0x7')]),_0x375636);if(_0x2a5e56[_0xcb66('0x28')]['filter']){var _0xe45331=_0x375636;var _0x3f2781=_0x2a5e56[_0xcb66('0x28')]['filter'];if(typeof _0x3f2781===_0xcb66('0x31')){_0xe45331=_[_0xcb66('0x32')](_0x375636,function(_0x4a5934){return _['includes'](_0x3f2781[_0xcb66('0x33')],_0x4a5934['name']);});_0x3f2781=_0x3f2781['value'];}_0x3e4755[_0xcb66('0x2f')]=_[_0xcb66('0x34')](_0x3e4755[_0xcb66('0x2f')],{'$or':_[_0xcb66('0x35')](_0xe45331,function(_0x99229){if(_0x99229[_0xcb66('0x9')]!==_0xcb66('0x36')){if(_0x36dfe3){return sequelize[_0xcb66('0x2f')](sequelize['fn'](_0xcb66('0x37'),sequelize['col'](_0x99229['name'])),{'$like':sequelize['fn']('lower','%'+_0x2a5e56[_0xcb66('0x28')]['filter']+'%')});}else{var _0x8736aa={};_0x8736aa[_0x99229['name']]={'$like':'%'+_0x2a5e56[_0xcb66('0x28')][_0xcb66('0x32')]+'%'};return _0x8736aa;}}})});}_0x3e4755=_[_0xcb66('0x34')]({},_0x3e4755,_0x2a5e56[_0xcb66('0x38')]);return _0x3e4755;};
\ No newline at end of file
+var _0x0309=['ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','push','join','getOptions','query','$id','model','intersection','attributes','fields','nolimit','order','filters','pick','filter','object','columns','name','value','where','VIRTUAL','lower','col','merge','options','lodash','moment','parse','keys','includes','split','forOwn','find','type','DATE','$gte','YYYY-MM-DD','utc','format','$lte','subtract','uniqueid','isArray','limit','offset','sort','map','priority','cast','unsigned','substr','DESC'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0309,0x165));var _0x9030=function(_0x3806db,_0x186d0f){_0x3806db=_0x3806db-0x0;var _0x400e0d=_0x0309[_0x3806db];return _0x400e0d;};'use strict';var _=require(_0x9030('0x0'));var sequelize=require('sequelize');var moment=require(_0x9030('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4875db){var _0x5b1a40=['ne'];try{var _0x352a94=JSON[_0x9030('0x2')](_0x4875db);var _0x4236be=Object[_0x9030('0x3')](_0x352a94)[0x0];return _0x5b1a40[_0x9030('0x4')](_0x4236be);}catch(_0xcbbe57){return![];}}function getOperatorValue(_0x482786){var _0x5a3334=JSON[_0x9030('0x2')](_0x482786);var _0x105c15=Object['keys'](_0x5a3334)[0x0];var _0xb53eb4=_0x5a3334[_0x105c15];return{['$'+_0x105c15]:_0xb53eb4};}exports['fields']=function(_0x1e2360){var _0x32d47d=null;if(_0x1e2360){_0x32d47d=_0x1e2360[_0x9030('0x5')](',');}return _0x32d47d;};exports['filters']=function(_0xe2c28b,_0x1da9ec){var _0x337b86={};if(!_['isEmpty'](_0xe2c28b)){_[_0x9030('0x6')](_0xe2c28b,function(_0x21bc06,_0x24d0f4){try{if(_0x1da9ec){var _0x11a539=_[_0x9030('0x7')](_0x1da9ec,{'name':_0x24d0f4})||{};if(hasSequelizeOperator(_0x21bc06)){_0x337b86[_0x24d0f4]=getOperatorValue(_0x21bc06);}else if(_0x11a539[_0x9030('0x8')]===_0x9030('0x9')&&_['isPlainObject'](_0x21bc06)){var _0x45e28a=JSON[_0x9030('0x2')](_0x21bc06);var _0x1e5bc9={'$gte':moment(moment(_0x45e28a[_0x9030('0xa')])['format'](_0x9030('0xb')))[_0x9030('0xc')]()[_0x9030('0xd')](),'$lte':moment(moment(_0x45e28a[_0x9030('0xe')])[_0x9030('0xd')](_0x9030('0xb')))[_0x9030('0xc')]()[_0x9030('0xf')](0x1,'s')[_0x9030('0xd')]()};_0x337b86[_0x24d0f4]=_0x1e5bc9;}else if(_0x11a539['name']===_0x9030('0x10')){_0x337b86[_0x24d0f4]=_0x21bc06;}else{_0x337b86[_0x24d0f4]=_[_0x9030('0x11')](_0x21bc06)?_0x21bc06:JSON[_0x9030('0x2')](_0x21bc06);}}else{_0x337b86[_0x24d0f4]=_[_0x9030('0x11')](_0x21bc06)?_0x21bc06:JSON[_0x9030('0x2')](_0x21bc06);}}catch(_0x1327ec){_0x337b86[_0x24d0f4]=_0x21bc06[_0x9030('0x5')](',');}});}return _0x337b86;};exports[_0x9030('0x12')]=function(_0x1f5474){_0x1f5474=parseInt(_0x1f5474,0xa);if(!_0x1f5474||_0x1f5474<0x0){_0x1f5474=LIMIT_VALUE;}return _0x1f5474;};exports[_0x9030('0x13')]=function(_0x164c88){_0x164c88=parseInt(_0x164c88,0xa);if(!_0x164c88||_0x164c88<0x0){_0x164c88=0x0;}return _0x164c88;};exports[_0x9030('0x14')]=function(_0x372716){var _0x243e7d,_0x1e5988=null;if(_0x372716){_0x243e7d=_0x372716[_0x9030('0x5')](',');_0x1e5988=_[_0x9030('0x15')](_0x243e7d,function(_0x4b0792){if(_0x4b0792['indexOf']('-')===0x0){return[_0x4b0792===_0x9030('0x16')?sequelize[_0x9030('0x17')](sequelize['col'](_0x9030('0x16')),_0x9030('0x18')):_0x4b0792[_0x9030('0x19')](0x1),_0x9030('0x1a')];}else{return[_0x4b0792==='priority'?sequelize[_0x9030('0x17')](sequelize['col']('priority'),_0x9030('0x18')):_0x4b0792,_0x9030('0x1b')];}});}return _0x1e5988;};exports[_0x9030('0x1c')]=function(_0x539bb7,_0x36a98a){if(_[_0x9030('0x1d')](_0x539bb7)){return _0x539bb7;}if(_[_0x9030('0x11')](_0x539bb7)){for(var _0xce2840=0x0;_0xce2840<_0x539bb7[_0x9030('0x1e')];_0xce2840+=0x1){_0x539bb7[_0xce2840]=this['omit'](_0x539bb7[_0xce2840],_0x36a98a);}return _0x539bb7;}if(!_[_0x9030('0x1f')](_0x539bb7)){return _0x539bb7;}if(_[_0x9030('0x20')](_0x36a98a)){_0x36a98a=[_0x36a98a];}if(!_[_0x9030('0x11')](_0x36a98a)){return _0x539bb7;}for(var _0x463dda=0x0;_0x463dda<_0x36a98a[_0x9030('0x1e')];_0x463dda+=0x1){_[_0x9030('0x21')](_0x539bb7,_0x36a98a[_0x463dda]);}for(var _0x155b8c in _0x539bb7){if(_0x539bb7[_0x9030('0x22')](_0x155b8c)){_0x539bb7[_0x155b8c]=this[_0x9030('0x1c')](_0x539bb7[_0x155b8c],_0x36a98a);}}return _0x539bb7;};exports[_0x9030('0x23')]=function(_0x3be936){return _0x3be936[_0x9030('0x24')](RegExp(_0x9030('0x25')))?!![]:![];};exports[_0x9030('0x26')]=function(_0x584013){return _0x584013[_0x9030('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x43a31b){var _0x5b745a=[];_0x43a31b[_0x9030('0x5')](/[ ,]+/)[_0x9030('0x27')](function(_0x1bbad0){_0x1bbad0=_0x1bbad0['replace'](/([^:]")"+/g,'$1');_0x1bbad0='+'+_0x1bbad0+'*';var _0x432a50=/[ `!@#$%^&*()_\-?~]/;if(_0x1bbad0[_0x9030('0x24')](_0x432a50))_0x1bbad0='\x22'+_0x1bbad0+'\x22';_0x5b745a[_0x9030('0x28')](_0x1bbad0);});return _0x5b745a[_0x9030('0x29')]('\x20');};exports[_0x9030('0x2a')]=function(_0x14619b,_0x754e00,_0x12b9b8){var _0x134260={},_0x3400db={};if(_0x754e00[_0x9030('0x2b')][_0x9030('0x2c')]){_0x754e00[_0x9030('0x2b')]['id']=_0x754e00[_0x9030('0x2b')][_0x9030('0x2c')];delete _0x754e00[_0x9030('0x2b')][_0x9030('0x2c')];}_0x134260[_0x9030('0x2d')]=_['map'](_0x14619b,'name');_0x134260[_0x9030('0x2b')]=_[_0x9030('0x3')](_0x754e00['query']);_0x134260['filters']=_[_0x9030('0x2e')](_0x134260[_0x9030('0x2d')],_0x134260[_0x9030('0x2b')]);_0x3400db[_0x9030('0x2f')]=_['intersection'](_0x134260[_0x9030('0x2d')],this['fields'](_0x754e00[_0x9030('0x2b')][_0x9030('0x30')]));_0x3400db['attributes']=_0x3400db[_0x9030('0x2f')][_0x9030('0x1e')]?_0x3400db[_0x9030('0x2f')]:_0x134260['model'];if(!_0x754e00[_0x9030('0x2b')]['hasOwnProperty'](_0x9030('0x31'))){_0x3400db['limit']=this[_0x9030('0x12')](_0x754e00['query'][_0x9030('0x12')]);_0x3400db[_0x9030('0x13')]=this[_0x9030('0x13')](_0x754e00[_0x9030('0x2b')][_0x9030('0x13')]);}_0x3400db[_0x9030('0x32')]=this[_0x9030('0x14')](_0x754e00[_0x9030('0x2b')][_0x9030('0x14')]);_0x3400db['where']=this[_0x9030('0x33')](_[_0x9030('0x34')](_0x754e00[_0x9030('0x2b')],_0x134260['filters']),_0x14619b);if(_0x754e00[_0x9030('0x2b')][_0x9030('0x35')]){var _0x3ebb74=_0x14619b;var _0x1a9ee5=_0x754e00['query'][_0x9030('0x35')];if(typeof _0x1a9ee5===_0x9030('0x36')){_0x3ebb74=_[_0x9030('0x35')](_0x14619b,function(_0x4ba687){return _[_0x9030('0x4')](_0x1a9ee5[_0x9030('0x37')],_0x4ba687[_0x9030('0x38')]);});_0x1a9ee5=_0x1a9ee5[_0x9030('0x39')];}_0x3400db[_0x9030('0x3a')]=_['merge'](_0x3400db[_0x9030('0x3a')],{'$or':_['map'](_0x3ebb74,function(_0x2b596c){if(_0x2b596c[_0x9030('0x8')]!==_0x9030('0x3b')){if(_0x12b9b8){return sequelize[_0x9030('0x3a')](sequelize['fn'](_0x9030('0x3c'),sequelize[_0x9030('0x3d')](_0x2b596c[_0x9030('0x38')])),{'$like':sequelize['fn'](_0x9030('0x3c'),'%'+_0x754e00['query'][_0x9030('0x35')]+'%')});}else{var _0x19d2d3={};_0x19d2d3[_0x2b596c[_0x9030('0x38')]]={'$like':'%'+_0x754e00[_0x9030('0x2b')][_0x9030('0x35')]+'%'};return _0x19d2d3;}}})});}_0x3400db=_[_0x9030('0x3e')]({},_0x3400db,_0x754e00[_0x9030('0x3f')]);return _0x3400db;};
\ No newline at end of file
index baa8bcd..ee8f7eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x27af80,_0x396b70){var _0x855bc7=function(_0x2c9733){while(--_0x2c9733){_0x27af80['push'](_0x27af80['shift']());}};_0x855bc7(++_0x396b70);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());};
\ 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(_0x597eb2,_0x165f5c){var _0x56875f=function(_0x5de36e){while(--_0x5de36e){_0x597eb2['push'](_0x597eb2['shift']());}};_0x56875f(++_0x165f5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 ad39fd1..f56d7ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d7c=['map','model','createHash','md5','digest','hex','getUuid','platform','test','licenseToken','win32','utf8','replace','hostname','macAddress','ipAddress','update','substring','lodash','crypto','execSync','../environment','networkInterfaces','orderBy','keys','filter','family','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x6d7c,0x100));var _0xc6d7=function(_0x356708,_0x47a694){_0x356708=_0x356708-0x0;var _0x152505=_0x6d7c[_0x356708];return _0x152505;};'use strict';var _=require(_0xc6d7('0x0'));var os=require('os');var crypto=require(_0xc6d7('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xc6d7('0x2')];var config=require(_0xc6d7('0x3'));function getInterfaces(){var _0x293470=[];var _0x40cc02=os[_0xc6d7('0x4')]();var _0xee172e=_[_0xc6d7('0x5')](_[_0xc6d7('0x6')](_0x40cc02));for(var _0x193f5b=0x0;_0x193f5b<_0xee172e['length'];_0x193f5b++){var _0x4ef467=_0x40cc02[_0xee172e[_0x193f5b]][_0xc6d7('0x7')](function(_0x548237){return _0x548237[_0xc6d7('0x8')]==='IPv4'&&_0x548237['internal']===![];});_0x293470=_0x293470[_0xc6d7('0x9')](_0x4ef467);}return _0x293470;}function getFirstInterface(){var _0x19b38e=_[_0xc6d7('0xa')](getInterfaces());return{'macAddress':_0x19b38e&&_0x19b38e[_0xc6d7('0xb')]?_0x19b38e['mac']:_0xc6d7('0xc'),'ipAddress':_0x19b38e&&_0x19b38e[_0xc6d7('0xd')]?_0x19b38e[_0xc6d7('0xd')]:'127.0.0.1'};}exports[_0xc6d7('0xe')]=getFirstInterface;function getCPUhash(){var _0x35d8ae=_[_0xc6d7('0x5')](os[_0xc6d7('0xf')]()[_0xc6d7('0x10')](function(_0x5b8bee){return _0x5b8bee[_0xc6d7('0x11')];}))['join'](':');return crypto[_0xc6d7('0x12')](_0xc6d7('0x13'))['update'](_0x35d8ae)[_0xc6d7('0x14')](_0xc6d7('0x15'));}exports[_0xc6d7('0x16')]=function(){var _0x14d5bc=os[_0xc6d7('0x17')]();var _0x546ccb=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x546ccb[_0xc6d7('0x18')](config[_0xc6d7('0x19')])){return config[_0xc6d7('0x19')];}else if(_0x14d5bc===_0xc6d7('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xc6d7('0x1b')})[_0xc6d7('0x1c')]('\x0d\x0a','');}else{var _0x5bd74d=getFirstInterface();var _0x306162=getCPUhash();var _0x83b606=_0x306162+'|'+os[_0xc6d7('0x1d')]()+'|'+_0x5bd74d[_0xc6d7('0x1e')]+'|'+_0x5bd74d[_0xc6d7('0x1f')];var _0x26372f=crypto['createHash'](_0xc6d7('0x13'))[_0xc6d7('0x20')](_0x83b606)[_0xc6d7('0x14')](_0xc6d7('0x15'));return _0x26372f['substring'](0x0,0x8)+'-'+_0x26372f[_0xc6d7('0x21')](0x8,0xc)+'-'+_0x26372f[_0xc6d7('0x21')](0xc,0x10)+'-'+_0x26372f[_0xc6d7('0x21')](0x10,0x14)+'-'+_0x26372f[_0xc6d7('0x21')](0x14);}};
\ No newline at end of file
+var _0xe016=['update','hex','licenseToken','test','win32','utf8','replace','hostname','macAddress','ipAddress','digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','createHash','md5'];(function(_0x2d5235,_0x3012a8){var _0x281e78=function(_0x52aa5b){while(--_0x52aa5b){_0x2d5235['push'](_0x2d5235['shift']());}};_0x281e78(++_0x3012a8);}(_0xe016,0x1bc));var _0x6e01=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xe016[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x6e01('0x0'));var os=require('os');var crypto=require(_0x6e01('0x1'));var machine=require(_0x6e01('0x2'));var exec=require(_0x6e01('0x3'))[_0x6e01('0x4')];var config=require(_0x6e01('0x5'));function getInterfaces(){var _0x574f5f=[];var _0x152d50=os[_0x6e01('0x6')]();var _0x5181ec=_[_0x6e01('0x7')](_[_0x6e01('0x8')](_0x152d50));for(var _0x4a06b1=0x0;_0x4a06b1<_0x5181ec[_0x6e01('0x9')];_0x4a06b1++){var _0x51a94d=_0x152d50[_0x5181ec[_0x4a06b1]][_0x6e01('0xa')](function(_0x4a7fe4){return _0x4a7fe4[_0x6e01('0xb')]==='IPv4'&&_0x4a7fe4[_0x6e01('0xc')]===![];});_0x574f5f=_0x574f5f[_0x6e01('0xd')](_0x51a94d);}return _0x574f5f;}function getFirstInterface(){var _0x2a6ca6=_['head'](getInterfaces());return{'macAddress':_0x2a6ca6&&_0x2a6ca6[_0x6e01('0xe')]?_0x2a6ca6[_0x6e01('0xe')]:_0x6e01('0xf'),'ipAddress':_0x2a6ca6&&_0x2a6ca6['address']?_0x2a6ca6[_0x6e01('0x10')]:_0x6e01('0x11')};}exports[_0x6e01('0x12')]=getFirstInterface;function getCPUhash(){var _0x8a4c16=_[_0x6e01('0x7')](os['cpus']()[_0x6e01('0x13')](function(_0xb9c968){return _0xb9c968[_0x6e01('0x14')];}))[_0x6e01('0x15')](':');return crypto[_0x6e01('0x16')](_0x6e01('0x17'))[_0x6e01('0x18')](_0x8a4c16)['digest'](_0x6e01('0x19'));}exports['getUuid']=function(){var _0x342372=os['platform']();var _0x440cef=/[0-9a-f-]{36}/;if(config[_0x6e01('0x1a')]&&_0x440cef[_0x6e01('0x1b')](config['licenseToken'])){return config[_0x6e01('0x1a')];}else if(_0x342372===_0x6e01('0x1c')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x6e01('0x1d')})[_0x6e01('0x1e')]('\x0d\x0a','');}else{var _0x202860=getFirstInterface();var _0x412b8c=getCPUhash();var _0x4640d2=_0x412b8c+'|'+os[_0x6e01('0x1f')]()+'|'+_0x202860[_0x6e01('0x20')]+'|'+_0x202860[_0x6e01('0x21')];var _0x5139f4=crypto[_0x6e01('0x16')](_0x6e01('0x17'))[_0x6e01('0x18')](_0x4640d2)[_0x6e01('0x22')](_0x6e01('0x19'));return _0x5139f4[_0x6e01('0x23')](0x0,0x8)+'-'+_0x5139f4['substring'](0x8,0xc)+'-'+_0x5139f4[_0x6e01('0x23')](0xc,0x10)+'-'+_0x5139f4[_0x6e01('0x23')](0x10,0x14)+'-'+_0x5139f4[_0x6e01('0x23')](0x14);}};
\ No newline at end of file
index d782c00..20599ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae78=['update','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','DEMO\x20START\x20AT\x20%s','error','message','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xae78,0x82));var _0x8ae7=function(_0x3231a7,_0x34ba2a){_0x3231a7=_0x3231a7-0x0;var _0x467506=_0xae78[_0x3231a7];return _0x467506;};'use strict';var util=require('util');var moment=require(_0x8ae7('0x0'));var rp=require(_0x8ae7('0x1'));var BPromise=require(_0x8ae7('0x2'));var pkginfo=require(_0x8ae7('0x3'))(module,'version');var db=require(_0x8ae7('0x4'))['db'];var encryptor=require(_0x8ae7('0x5'));var hardware=require('./hardware');var logger=require(_0x8ae7('0x6'))(_0x8ae7('0x7'));var HOST=_0x8ae7('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x154f82){return new BPromise(function(_0x322bbf,_0x496cc0){var _0x603b65=util[_0x8ae7('0x9')](_0x8ae7('0xa'),HOST,_0x154f82,module[_0x8ae7('0xb')]['version']);if(oldToken){_0x603b65=util[_0x8ae7('0x9')](_0x8ae7('0xc'),HOST,_0x154f82,module[_0x8ae7('0xb')]['version'],oldToken);}var _0x5b47c0={'uri':_0x603b65,'method':_0x8ae7('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x5b47c0)[_0x8ae7('0xe')](function(_0x2565c4){_0x322bbf(_0x2565c4);})[_0x8ae7('0xf')](function(_0x14b0ea){_0x496cc0(_0x14b0ea);});});}function manageLicense(_0x32dda6,_0x18bb0){var _0x1b6f70=_0x18bb0[_0x8ae7('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x1b6f70[_0x8ae7('0x11')]!==_0x32dda6&&!_0x1b6f70[_0x8ae7('0x12')]){oldToken=_0x1b6f70[_0x8ae7('0x11')];}httpRequest(_0x32dda6)['then'](function(_0x572acd){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x572acd[_0x8ae7('0x13')]){isOldTokenSent=![];if(!_0x1b6f70[_0x8ae7('0x7')]&&_0x1b6f70[_0x8ae7('0x7')]!=_0x572acd[_0x8ae7('0x7')]||_0x1b6f70[_0x8ae7('0x7')]&&_0x1b6f70[_0x8ae7('0x12')]){logger['info'](_0x8ae7('0x14'));}if(_0x1b6f70[_0x8ae7('0x7')]&&!_0x1b6f70[_0x8ae7('0x12')]&&_0x1b6f70['license']!=_0x572acd[_0x8ae7('0x7')]){logger['info'](_0x8ae7('0x15'));}if(_0x1b6f70[_0x8ae7('0x7')]&&!_0x1b6f70[_0x8ae7('0x12')]&&_0x1b6f70['license']==_0x572acd[_0x8ae7('0x7')]){return _0x18bb0;}return _0x18bb0[_0x8ae7('0x16')]({'data1':_0x32dda6,'data2':null,'license':_0x572acd[_0x8ae7('0x7')]});}else{if(_0x572acd['license']||_0x1b6f70['license']){if(!_0x1b6f70['data2']){if(_0x1b6f70[_0x8ae7('0x11')]==_0x32dda6){GRAY_PERIOD_REASON='Disabled';logger[_0x8ae7('0x17')](_0x8ae7('0x18'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0x8ae7('0x19'),_0x1b6f70[_0x8ae7('0x11')],_0x32dda6);}logger[_0x8ae7('0x17')](_0x8ae7('0x1a'),GRAY_PERIOD_REASON[_0x8ae7('0x1b')](),moment()[_0x8ae7('0x9')](_0x8ae7('0x1c')));return _0x18bb0['update']({'data2':encryptor[_0x8ae7('0x1d')](moment()[_0x8ae7('0x9')](_0x8ae7('0x1c')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x1b6f70[_0x8ae7('0x12')]),'days')>DAYS){logger['info'](_0x8ae7('0x1e'),moment()[_0x8ae7('0x9')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x18bb0[_0x8ae7('0x16')]({'data1':_0x32dda6,'data2':null,'license':null});}}}else{if(_0x1b6f70[_0x8ae7('0x11')]!=_0x32dda6){logger[_0x8ae7('0x17')](_0x8ae7('0x19'),_0x1b6f70[_0x8ae7('0x11')],_0x32dda6);return _0x18bb0['update']({'data1':_0x32dda6,'data2':null,'license':null});}}}return _0x18bb0;})[_0x8ae7('0xe')](function(_0x259cf1){_0x18bb0=_0x259cf1;})[_0x8ae7('0xf')](function(_0x359697){logger[_0x8ae7('0x1f')](_0x359697[_0x8ae7('0x20')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x18bb0);},TIME);});}function defaultLicense(){var _0x431076=hardware[_0x8ae7('0x21')]();if(_0x431076){return db['License'][_0x8ae7('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x431076}})[_0x8ae7('0x23')](function(_0x199276,_0x3e951e){logger[_0x8ae7('0x17')](_0x8ae7('0x24'),_0x431076);manageLicense(_0x431076,_0x199276);})['catch'](function(_0x4d86b2){logger[_0x8ae7('0x1f')](_0x4d86b2[_0x8ae7('0x20')]);});}}exports[_0x8ae7('0x25')]=defaultLicense;
\ No newline at end of file
+var _0x355d=['%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','finally','getUuid','License','findOrCreate','spread','message','moment','request-promise','pkginfo','version','../../mysqldb','./hardware','../logger','license'];(function(_0x14ef08,_0x332786){var _0x39636f=function(_0xfbb148){while(--_0xfbb148){_0x14ef08['push'](_0x14ef08['shift']());}};_0x39636f(++_0x332786);}(_0x355d,0x13c));var _0xd355=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x355d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var moment=require(_0xd355('0x0'));var rp=require(_0xd355('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0xd355('0x2'))(module,_0xd355('0x3'));var db=require(_0xd355('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xd355('0x5'));var logger=require(_0xd355('0x6'))(_0xd355('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2f6d09){return new BPromise(function(_0x1bbb89,_0x26146a){var _0x4f3405=util['format'](_0xd355('0x8'),HOST,_0x2f6d09,module[_0xd355('0x9')][_0xd355('0x3')]);if(oldToken){_0x4f3405=util[_0xd355('0xa')](_0xd355('0xb'),HOST,_0x2f6d09,module['exports'][_0xd355('0x3')],oldToken);}var _0x6e104d={'uri':_0x4f3405,'method':_0xd355('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x6e104d)[_0xd355('0xd')](function(_0x134745){_0x1bbb89(_0x134745);})[_0xd355('0xe')](function(_0x231a4d){_0x26146a(_0x231a4d);});});}function manageLicense(_0x4657e2,_0xb57bb2){var _0x51fd54=_0xb57bb2[_0xd355('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x51fd54[_0xd355('0x10')]!==_0x4657e2&&!_0x51fd54[_0xd355('0x11')]){oldToken=_0x51fd54[_0xd355('0x10')];}httpRequest(_0x4657e2)[_0xd355('0xd')](function(_0x37f632){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x37f632[_0xd355('0x12')]){isOldTokenSent=![];if(!_0x51fd54[_0xd355('0x7')]&&_0x51fd54['license']!=_0x37f632[_0xd355('0x7')]||_0x51fd54[_0xd355('0x7')]&&_0x51fd54['data2']){logger[_0xd355('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x51fd54[_0xd355('0x7')]&&!_0x51fd54['data2']&&_0x51fd54[_0xd355('0x7')]!=_0x37f632[_0xd355('0x7')]){logger[_0xd355('0x13')](_0xd355('0x14'));}if(_0x51fd54[_0xd355('0x7')]&&!_0x51fd54['data2']&&_0x51fd54[_0xd355('0x7')]==_0x37f632[_0xd355('0x7')]){return _0xb57bb2;}return _0xb57bb2[_0xd355('0x15')]({'data1':_0x4657e2,'data2':null,'license':_0x37f632[_0xd355('0x7')]});}else{if(_0x37f632[_0xd355('0x7')]||_0x51fd54['license']){if(!_0x51fd54[_0xd355('0x11')]){if(_0x51fd54[_0xd355('0x10')]==_0x4657e2){GRAY_PERIOD_REASON='Disabled';logger[_0xd355('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0xd355('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x51fd54['data1'],_0x4657e2);}logger[_0xd355('0x13')](_0xd355('0x16'),GRAY_PERIOD_REASON[_0xd355('0x17')](),moment()[_0xd355('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0xb57bb2[_0xd355('0x15')]({'data2':encryptor[_0xd355('0x18')](moment()[_0xd355('0xa')](_0xd355('0x19')))});}else{if(moment()[_0xd355('0x1a')](encryptor['decryptString'](_0x51fd54['data2']),_0xd355('0x1b'))>DAYS){logger[_0xd355('0x13')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0xd355('0x19')));isOldTokenSent=![];return _0xb57bb2[_0xd355('0x15')]({'data1':_0x4657e2,'data2':null,'license':null});}}}else{if(_0x51fd54[_0xd355('0x10')]!=_0x4657e2){logger['info'](_0xd355('0x1c'),_0x51fd54[_0xd355('0x10')],_0x4657e2);return _0xb57bb2[_0xd355('0x15')]({'data1':_0x4657e2,'data2':null,'license':null});}}}return _0xb57bb2;})['then'](function(_0x4484f0){_0xb57bb2=_0x4484f0;})[_0xd355('0xe')](function(_0x5154a3){logger[_0xd355('0x1d')](_0x5154a3['message']);})[_0xd355('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0xd355('0x1f')](),_0xb57bb2);},TIME);});}function defaultLicense(){var _0x22bcb4=hardware[_0xd355('0x1f')]();if(_0x22bcb4){return db[_0xd355('0x20')][_0xd355('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x22bcb4}})[_0xd355('0x22')](function(_0x5cc5bd,_0x287281){logger[_0xd355('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x22bcb4);manageLicense(_0x22bcb4,_0x5cc5bd);})[_0xd355('0xe')](function(_0x67445a){logger[_0xd355('0x1d')](_0x67445a[_0xd355('0x23')]);});}}exports['default']=defaultLicense;
\ No newline at end of file
index 3acce4a..ff76adc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73bb=['lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','deadline','add','days','grayReason','changed','disabled','message','User','role','sequelize','COUNT','col','admin','user','telephone','telephones','forEach','count','pick','License\x20limit\x20reached\x20for\x20users','exports','util'];(function(_0x4ea4d8,_0x4a9fcd){var _0x2333af=function(_0x7b52d9){while(--_0x7b52d9){_0x4ea4d8['push'](_0x4ea4d8['shift']());}};_0x2333af(++_0x4a9fcd);}(_0x73bb,0x1d5));var _0xb73b=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x73bb[_0x648163];return _0x199d4d;};'use strict';var util=require(_0xb73b('0x0'));var _=require(_0xb73b('0x1'));var moment=require(_0xb73b('0x2'));var BPromise=require('bluebird');var hardware=require(_0xb73b('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0xb73b('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb73b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb73b('0x6'),'machineUuid':hardware[_0xb73b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb73b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb73b('0x8'),'machineUuid':hardware[_0xb73b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x276ad3){return new BPromise(function(_0x59039d,_0x1b1bd5){return db[_0xb73b('0x9')][_0xb73b('0xa')](_['defaults'](_0x276ad3,{'raw':!![],'where':{'id':0x1}}))[_0xb73b('0xb')](function(_0x2208ac){return checkLicense(_0x2208ac,null);})[_0xb73b('0xb')](function(_0x35845a){_0x59039d(_0x35845a);return;})[_0xb73b('0xc')](function(_0x52ee18){_0x1b1bd5(_0x52ee18);});});}function checkLicense(_0x77da62,_0x2e1b9f){if(!_0x77da62){demoLicense[_0xb73b('0xd')]=_0x77da62['data1'];return demoLicense;}try{var _0x40e893=_0x2e1b9f||_0x77da62[_0xb73b('0xe')];if(_[_0xb73b('0xf')](_0x40e893)){throw new Error(_0xb73b('0x10'));}var _0x3413fe=_0x77da62[_0xb73b('0x11')];var _0x109a65=_0x77da62[_0xb73b('0x12')];var _0x354b1f=_0x3413fe[_0xb73b('0x13')]('-')[0x4];var _0x4957e1=_0x3413fe[_0xb73b('0x13')]('-')[0x0];var _0x381543=encryptor[_0xb73b('0x14')](_0x40e893,util[_0xb73b('0x15')](_0xb73b('0x16'),_0x354b1f,_0x3413fe,_0x4957e1));var _0x2cf6ee=JSON[_0xb73b('0x17')](_0x381543);_0x2cf6ee[_0xb73b('0x18')]=![];_0x2cf6ee[_0xb73b('0xd')]=_0x3413fe;_0x2cf6ee[_0xb73b('0x19')]=hardware[_0xb73b('0x7')]();if(_0x109a65){var _0x16eb33=encryptor[_0xb73b('0x14')](_0x109a65);_0x2cf6ee['gray']=_0x16eb33;_0x2cf6ee[_0xb73b('0x1a')]=moment(_0x16eb33)[_0xb73b('0x1b')](0x7,_0xb73b('0x1c'))[_0xb73b('0x15')]();_0x2cf6ee[_0xb73b('0x1d')]=_0x2cf6ee[_0xb73b('0xd')]!=_0x2cf6ee[_0xb73b('0x19')]?_0xb73b('0x1e'):_0xb73b('0x1f');}return _0x2cf6ee;}catch(_0x518600){breakingLicense[_0xb73b('0xd')]=_0x77da62['data1'];breakingLicense[_0xb73b('0x20')]=_0x518600[_0xb73b('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5e1e20,_0x344be9){getLicense()[_0xb73b('0xb')](function(_0x4024fc){return db[_0xb73b('0x21')]['findAll']({'attributes':[_0xb73b('0x22'),[db[_0xb73b('0x23')]['fn'](_0xb73b('0x24'),db[_0xb73b('0x23')][_0xb73b('0x25')](_0xb73b('0x22'))),'count']],'group':_0xb73b('0x22'),'where':{'role':{'$or':[_0xb73b('0x26'),_0xb73b('0x27'),_0xb73b('0x28')]}},'raw':!![]})['then'](function(_0x35fbe4){var _0x505fb1={'user':_0x4024fc['users']||0x0,'telephone':_0x4024fc[_0xb73b('0x29')]||0x0};_0x35fbe4[_0xb73b('0x2a')](function(_0x4a6a80){var _0x274d11=_0x4a6a80['role']==='admin'?_0xb73b('0x27'):_0x4a6a80[_0xb73b('0x22')];_0x505fb1[_0x274d11]-=_0x4a6a80[_0xb73b('0x2b')];if(_0x505fb1[_0x274d11]<0x0)_0x505fb1[_0x274d11]=0x0;});_0x5e1e20(_0x505fb1);return;});})[_0xb73b('0xc')](function(_0x19d0ea){_0x344be9(_0x19d0ea);});});}function checkUserLimits(_0x13a80f){return new BPromise(function(_0x45d3bc,_0x1762be){getLimits()[_0xb73b('0xb')](function(_0x8359a1){var _0x2b17cc=_[_0xb73b('0x2c')](_['countBy'](_0x13a80f,_0xb73b('0x22')),['admin',_0xb73b('0x27'),_0xb73b('0x28')]);var _0x4df41d=(_0x2b17cc[_0xb73b('0x26')]||0x0)+(_0x2b17cc['user']||0x0);var _0x3389c3=_0x2b17cc['telephone']||0x0;if(_0x4df41d>_0x8359a1['user'])return _0x1762be(_0xb73b('0x2d'));if(_0x3389c3>_0x8359a1[_0xb73b('0x28')])return _0x1762be('License\x20limit\x20reached\x20for\x20telephones');return _0x45d3bc();})[_0xb73b('0xc')](function(_0x2b50c3){_0x1762be(_0x2b50c3);});});}module[_0xb73b('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x1d80=['user','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','telephone','telephones','forEach'];(function(_0x4020c3,_0x4314ee){var _0x11df1a=function(_0x565ed2){while(--_0x565ed2){_0x4020c3['push'](_0x4020c3['shift']());}};_0x11df1a(++_0x4314ee);}(_0x1d80,0x162));var _0x01d8=function(_0x553323,_0x4ac2a8){_0x553323=_0x553323-0x0;var _0x13bd30=_0x1d80[_0x553323];return _0x13bd30;};'use strict';var util=require(_0x01d8('0x0'));var _=require(_0x01d8('0x1'));var moment=require(_0x01d8('0x2'));var BPromise=require(_0x01d8('0x3'));var hardware=require(_0x01d8('0x4'));var encryptor=require(_0x01d8('0x5'));var db=require(_0x01d8('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x01d8('0x7'),'machineUuid':hardware[_0x01d8('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x01d8('0x9'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x01d8('0xa'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x10a72a){return new BPromise(function(_0x1501bf,_0x579145){return db[_0x01d8('0xb')][_0x01d8('0xc')](_[_0x01d8('0xd')](_0x10a72a,{'raw':!![],'where':{'id':0x1}}))[_0x01d8('0xe')](function(_0x15b0e0){return checkLicense(_0x15b0e0,null);})['then'](function(_0x42c6a1){_0x1501bf(_0x42c6a1);return;})[_0x01d8('0xf')](function(_0x42ba84){_0x579145(_0x42ba84);});});}function checkLicense(_0x2d65ff,_0x3f07f7){if(!_0x2d65ff){demoLicense[_0x01d8('0x10')]=_0x2d65ff[_0x01d8('0x11')];return demoLicense;}try{var _0x146daf=_0x3f07f7||_0x2d65ff[_0x01d8('0x12')];if(_[_0x01d8('0x13')](_0x146daf)){throw new Error(_0x01d8('0x14'));}var _0x42ffd9=_0x2d65ff[_0x01d8('0x11')];var _0x1de684=_0x2d65ff[_0x01d8('0x15')];var _0x25acd3=_0x42ffd9['split']('-')[0x4];var _0x191e96=_0x42ffd9['split']('-')[0x0];var _0x4fd5ad=encryptor['decryptString'](_0x146daf,util[_0x01d8('0x16')](_0x01d8('0x17'),_0x25acd3,_0x42ffd9,_0x191e96));var _0x41a8d9=JSON[_0x01d8('0x18')](_0x4fd5ad);_0x41a8d9[_0x01d8('0x19')]=![];_0x41a8d9[_0x01d8('0x10')]=_0x42ffd9;_0x41a8d9[_0x01d8('0x1a')]=hardware[_0x01d8('0x8')]();if(_0x1de684){var _0x28a861=encryptor['decryptString'](_0x1de684);_0x41a8d9[_0x01d8('0x1b')]=_0x28a861;_0x41a8d9[_0x01d8('0x1c')]=moment(_0x28a861)[_0x01d8('0x1d')](0x7,_0x01d8('0x1e'))[_0x01d8('0x16')]();_0x41a8d9[_0x01d8('0x1f')]=_0x41a8d9[_0x01d8('0x10')]!=_0x41a8d9['machineUuid']?_0x01d8('0x20'):_0x01d8('0x21');}return _0x41a8d9;}catch(_0xc6554b){breakingLicense['uuid']=_0x2d65ff[_0x01d8('0x11')];breakingLicense[_0x01d8('0x22')]=_0xc6554b[_0x01d8('0x22')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xed0ab1,_0x42641c){getLicense()['then'](function(_0x18002a){return db[_0x01d8('0x23')][_0x01d8('0x24')]({'attributes':[_0x01d8('0x25'),[db[_0x01d8('0x26')]['fn'](_0x01d8('0x27'),db[_0x01d8('0x26')][_0x01d8('0x28')](_0x01d8('0x25'))),_0x01d8('0x29')]],'group':_0x01d8('0x25'),'where':{'role':{'$or':[_0x01d8('0x2a'),'user',_0x01d8('0x2b')]}},'raw':!![]})[_0x01d8('0xe')](function(_0x72480c){var _0x30474b={'user':_0x18002a['users']||0x0,'telephone':_0x18002a[_0x01d8('0x2c')]||0x0};_0x72480c[_0x01d8('0x2d')](function(_0x481773){var _0x4c46f0=_0x481773[_0x01d8('0x25')]===_0x01d8('0x2a')?_0x01d8('0x2e'):_0x481773[_0x01d8('0x25')];_0x30474b[_0x4c46f0]-=_0x481773['count'];if(_0x30474b[_0x4c46f0]<0x0)_0x30474b[_0x4c46f0]=0x0;});_0xed0ab1(_0x30474b);return;});})[_0x01d8('0xf')](function(_0x5c2c5b){_0x42641c(_0x5c2c5b);});});}function checkUserLimits(_0x3e3bec){return new BPromise(function(_0x4eff36,_0x225aed){getLimits()[_0x01d8('0xe')](function(_0x551fa2){var _0x299dc0=_['pick'](_['countBy'](_0x3e3bec,'role'),[_0x01d8('0x2a'),_0x01d8('0x2e'),_0x01d8('0x2b')]);var _0x47ecbb=(_0x299dc0[_0x01d8('0x2a')]||0x0)+(_0x299dc0['user']||0x0);var _0x59da92=_0x299dc0[_0x01d8('0x2b')]||0x0;if(_0x47ecbb>_0x551fa2[_0x01d8('0x2e')])return _0x225aed(_0x01d8('0x2f'));if(_0x59da92>_0x551fa2[_0x01d8('0x2b')])return _0x225aed(_0x01d8('0x30'));return _0x4eff36();})['catch'](function(_0x3d6775){_0x225aed(_0x3d6775);});});}module[_0x01d8('0x31')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index fd01f10..9e12d52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x1a37,0xb4));var _0x71a3=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x1a37[_0x2e4aa2];return _0x5e6092;};'use strict';module[_0x71a3('0x0')]={'DOMAIN':_0x71a3('0x1'),'SESSION_SECRET':_0x71a3('0x2'),'GOOGLE_ID':_0x71a3('0x3'),'GOOGLE_SECRET':_0x71a3('0x4'),'DEBUG':''};
\ No newline at end of file
+var _0xd943=['app-id','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd943,0x15d));var _0x3d94=function(_0x559237,_0x309ce2){_0x559237=_0x559237-0x0;var _0x4a4ab0=_0xd943[_0x559237];return _0x4a4ab0;};'use strict';module[_0x3d94('0x0')]={'DOMAIN':_0x3d94('0x1'),'SESSION_SECRET':_0x3d94('0x2'),'GOOGLE_ID':_0x3d94('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
index 740984f..5603c1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5008=['exports','../utils/loggers','fileLogger'];(function(_0x22bf60,_0x21611c){var _0x42ed96=function(_0x5de768){while(--_0x5de768){_0x22bf60['push'](_0x22bf60['shift']());}};_0x42ed96(++_0x21611c);}(_0x5008,0xf7));var _0x8500=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0x5008[_0x2bcd1f];return _0x2381ca;};'use strict';var fileLogger=require(_0x8500('0x0'))[_0x8500('0x1')];module[_0x8500('0x2')]=fileLogger;
\ No newline at end of file
+var _0x3473=['../utils/loggers','fileLogger','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3473,0x183));var _0x3347=function(_0x3d4e74,_0x21b4e5){_0x3d4e74=_0x3d4e74-0x0;var _0x57613d=_0x3473[_0x3d4e74];return _0x57613d;};'use strict';var fileLogger=require(_0x3347('0x0'))[_0x3347('0x1')];module[_0x3347('0x2')]=fileLogger;
\ No newline at end of file
index aad3ab8..44d0be2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ee1=['join','../../services/express/index.js','ami','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express'];(function(_0x3d6a32,_0xee5055){var _0x37b6c8=function(_0x23d4a6){while(--_0x23d4a6){_0x3d6a32['push'](_0x3d6a32['shift']());}};_0x37b6c8(++_0xee5055);}(_0x6ee1,0xa8));var _0x16ee=function(_0x379799,_0x4ccf16){_0x379799=_0x379799-0x0;var _0x46e431=_0x6ee1[_0x379799];return _0x46e431;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x16ee('0x0'),'script':path[_0x16ee('0x1')](__dirname,_0x16ee('0x2'))},{'name':_0x16ee('0x3'),'script':path[_0x16ee('0x1')](__dirname,'../../services/ami/index.js')},{'name':_0x16ee('0x4'),'script':path[_0x16ee('0x1')](__dirname,_0x16ee('0x5'))},{'name':_0x16ee('0x6'),'script':path[_0x16ee('0x1')](__dirname,_0x16ee('0x7'))},{'name':_0x16ee('0x8'),'script':path[_0x16ee('0x1')](__dirname,_0x16ee('0x9'))},{'name':_0x16ee('0xa'),'script':path[_0x16ee('0x1')](__dirname,_0x16ee('0xb'))}]};module[_0x16ee('0xc')]=config;
\ No newline at end of file
+var _0xbfaf=['../../services/xdr/index.js','exports','path','join','../../services/express/index.js','../../services/ami/index.js','agi','email','routing','../../services/routing/index.js','xdr'];(function(_0x3c3faa,_0x790ba6){var _0x4c62dc=function(_0x2d8dda){while(--_0x2d8dda){_0x3c3faa['push'](_0x3c3faa['shift']());}};_0x4c62dc(++_0x790ba6);}(_0xbfaf,0x1c5));var _0xfbfa=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0xbfaf[_0x483d8b];return _0x6500f1;};'use strict';var path=require(_0xfbfa('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xfbfa('0x1')](__dirname,_0xfbfa('0x2'))},{'name':'ami','script':path[_0xfbfa('0x1')](__dirname,_0xfbfa('0x3'))},{'name':_0xfbfa('0x4'),'script':path[_0xfbfa('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0xfbfa('0x5'),'script':path[_0xfbfa('0x1')](__dirname,'../../services/email/index.js')},{'name':_0xfbfa('0x6'),'script':path[_0xfbfa('0x1')](__dirname,_0xfbfa('0x7'))},{'name':_0xfbfa('0x8'),'script':path['join'](__dirname,_0xfbfa('0x9'))}]};module[_0xfbfa('0xa')]=config;
\ No newline at end of file
index bc2a4a0..6bb55aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee13=['pm2','start','then','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x61ded3,_0x457004){var _0x54e96e=function(_0x6f6d17){while(--_0x6f6d17){_0x61ded3['push'](_0x61ded3['shift']());}};_0x54e96e(++_0x457004);}(_0xee13,0x1ce));var _0x3ee1=function(_0x554338,_0x5c6001){_0x554338=_0x554338-0x0;var _0x92eb30=_0xee13[_0x554338];return _0x92eb30;};'use strict';var pm2=require(_0x3ee1('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x430158,_0x26bed1){return pm2['connect'](function(_0xf4924d){if(_0xf4924d){return _0x26bed1(_0xf4924d);}return _0x430158('connected');});});};exports[_0x3ee1('0x1')]=function(_0x317e5d){return connect()[_0x3ee1('0x2')](function(){return new BPromise(function(_0x2ef2f4,_0xa3fe70){return pm2[_0x3ee1('0x1')](_0x317e5d,function(_0x4c8740,_0x211460){if(_0x4c8740){return _0xa3fe70(_0x4c8740);}pm2[_0x3ee1('0x3')]();return _0x2ef2f4(_0x211460);});});});};exports[_0x3ee1('0x4')]=function(_0x3c1e30){return connect()[_0x3ee1('0x2')](function(){return new BPromise(function(_0x310a09,_0x443d9e){return pm2[_0x3ee1('0x4')](_0x3c1e30,function(_0x466e6c,_0x5d64f0){if(_0x466e6c){return _0x443d9e(_0x466e6c);}pm2[_0x3ee1('0x3')]();return _0x310a09(_0x5d64f0);});});});};exports[_0x3ee1('0x5')]=function(_0xb3304f){return connect()[_0x3ee1('0x2')](function(){return new BPromise(function(_0x39d5ef,_0x3dc17c){return pm2[_0x3ee1('0x5')](_0xb3304f,function(_0x1119d0,_0x4614bd){if(_0x1119d0){return _0x3dc17c(_0x1119d0);}pm2['disconnect']();return _0x39d5ef(_0x4614bd);});});});};exports[_0x3ee1('0x6')]=function(){return connect()[_0x3ee1('0x2')](function(){return new BPromise(function(_0x36f1f4,_0x10c100){return pm2[_0x3ee1('0x6')](function(_0x39483d,_0x3d18d5){if(_0x39483d){return _0x10c100(_0x39483d);}pm2['disconnect']();return _0x36f1f4(_0x3d18d5);});});});};exports[_0x3ee1('0x7')]=function(_0x1825a9){return connect()[_0x3ee1('0x2')](function(){return new BPromise(function(_0x275c75,_0x381475){return pm2[_0x3ee1('0x7')](_0x1825a9,function(_0x32df75,_0x30ce45){if(_0x32df75){return _0x381475(_0x32df75);}pm2[_0x3ee1('0x3')]();return _0x275c75(_0x30ce45);});});});};exports[_0x3ee1('0x8')]=function(_0x20fe2e){return connect()[_0x3ee1('0x2')](function(){return new BPromise(function(_0x28604f,_0x4a6631){return pm2[_0x3ee1('0x8')](_0x20fe2e,function(_0x3b2161,_0x4c04cc){if(_0x3b2161){return _0x4a6631(_0x3b2161);}pm2[_0x3ee1('0x3')]();return _0x28604f(_0x4c04cc);});});});};exports[_0x3ee1('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0xd65074,_0x48754c){return pm2[_0x3ee1('0x9')](function(_0x2d9c9a){if(_0x2d9c9a){return _0x48754c(_0x2d9c9a);}return _0xd65074(_0x3ee1('0xa'));});});});};
\ No newline at end of file
+var _0x69bd=['delete','dump','saved','pm2','bluebird','connect','start','then','stop','disconnect','restart','list','describe'];(function(_0x325ee2,_0xaf1371){var _0x7f2741=function(_0x15569a){while(--_0x15569a){_0x325ee2['push'](_0x325ee2['shift']());}};_0x7f2741(++_0xaf1371);}(_0x69bd,0x1bd));var _0xd69b=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x69bd[_0x266618];return _0x54dbf5;};'use strict';var pm2=require(_0xd69b('0x0'));var BPromise=require(_0xd69b('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x400957,_0x4c999a){return pm2[_0xd69b('0x2')](function(_0x3b3322){if(_0x3b3322){return _0x4c999a(_0x3b3322);}return _0x400957('connected');});});};exports[_0xd69b('0x3')]=function(_0x4c52c7){return connect()[_0xd69b('0x4')](function(){return new BPromise(function(_0x34c200,_0x2f3c05){return pm2[_0xd69b('0x3')](_0x4c52c7,function(_0x2fec34,_0x10ba74){if(_0x2fec34){return _0x2f3c05(_0x2fec34);}pm2['disconnect']();return _0x34c200(_0x10ba74);});});});};exports[_0xd69b('0x5')]=function(_0x1e9a3c){return connect()[_0xd69b('0x4')](function(){return new BPromise(function(_0x5b83f0,_0xce84b8){return pm2[_0xd69b('0x5')](_0x1e9a3c,function(_0x7f84f,_0x2e0b35){if(_0x7f84f){return _0xce84b8(_0x7f84f);}pm2[_0xd69b('0x6')]();return _0x5b83f0(_0x2e0b35);});});});};exports[_0xd69b('0x7')]=function(_0x28f009){return connect()[_0xd69b('0x4')](function(){return new BPromise(function(_0x1ea77e,_0x5b8da8){return pm2[_0xd69b('0x7')](_0x28f009,function(_0x1b1f69,_0x15c87e){if(_0x1b1f69){return _0x5b8da8(_0x1b1f69);}pm2[_0xd69b('0x6')]();return _0x1ea77e(_0x15c87e);});});});};exports[_0xd69b('0x8')]=function(){return connect()[_0xd69b('0x4')](function(){return new BPromise(function(_0x1291b8,_0x4e9987){return pm2[_0xd69b('0x8')](function(_0x48709e,_0x38abb6){if(_0x48709e){return _0x4e9987(_0x48709e);}pm2['disconnect']();return _0x1291b8(_0x38abb6);});});});};exports['describe']=function(_0xf0b24d){return connect()[_0xd69b('0x4')](function(){return new BPromise(function(_0x13a59e,_0xf97ae){return pm2[_0xd69b('0x9')](_0xf0b24d,function(_0x374d12,_0x5ee8ba){if(_0x374d12){return _0xf97ae(_0x374d12);}pm2[_0xd69b('0x6')]();return _0x13a59e(_0x5ee8ba);});});});};exports[_0xd69b('0xa')]=function(_0x149039){return connect()['then'](function(){return new BPromise(function(_0x1674ec,_0x54f526){return pm2['delete'](_0x149039,function(_0x50c2e9,_0x2da307){if(_0x50c2e9){return _0x54f526(_0x50c2e9);}pm2[_0xd69b('0x6')]();return _0x1674ec(_0x2da307);});});});};exports[_0xd69b('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x12d2de,_0x29daf7){return pm2[_0xd69b('0xb')](function(_0x18ce37){if(_0x18ce37){return _0x29daf7(_0x18ce37);}return _0x12d2de(_0xd69b('0xc'));});});});};
\ No newline at end of file
index 9fa986e..802edc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee63=['lastMsgAt','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll'];(function(_0x404996,_0x44025a){var _0x53fbe1=function(_0x254764){while(--_0x254764){_0x404996['push'](_0x404996['shift']());}};_0x53fbe1(++_0x44025a);}(_0xee63,0x19e));var _0x3ee6=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0xee63[_0x1f7413];return _0x2d2775;};'use strict';var _=require(_0x3ee6('0x0'));var moment=require(_0x3ee6('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x3ee6('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x3ee6('0x3'))(_0x3ee6('0x4'));config[_0x3ee6('0x5')]=_[_0x3ee6('0x6')](config[_0x3ee6('0x5')],{'host':_0x3ee6('0x7'),'port':0x18eb});var io=require(_0x3ee6('0x8'))(new Redis(config[_0x3ee6('0x5')]));function closeInteractions(){var _0x240514=0x0;var _0xb47cef=[];return db[_0x3ee6('0x9')][_0x3ee6('0xa')]({'raw':!![],'attributes':['id',_0x3ee6('0xb')],'where':{'id':0x1}})[_0x3ee6('0xc')](function(_0x381595){_0x240514=_0x381595[_0x3ee6('0xb')];if(_0x240514){return db[_0x3ee6('0xd')][_0x3ee6('0xe')]({'raw':!![],'attributes':['id',_0x3ee6('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x381595[_0x3ee6('0xb')],_0x3ee6('0x10'))}}});}else{return[];}})['then'](function(_0x4a412f){if(_0x4a412f&&_0x4a412f[_0x3ee6('0x11')]){_0xb47cef=_[_0x3ee6('0x12')](_0x4a412f||[],'id');logger[_0x3ee6('0x13')](_0x3ee6('0x14'),_0xb47cef[_0x3ee6('0x15')]());return db[_0x3ee6('0xd')]['update']({'closeReason':_0x3ee6('0x16'),'disposition':_0x3ee6('0x17'),'closed':!![],'closedAt':moment()[_0x3ee6('0x18')](_0x3ee6('0x19'))},{'where':{'id':_0xb47cef}});}})[_0x3ee6('0xc')](function(){if(_0xb47cef&&_0xb47cef['length']){logger[_0x3ee6('0x13')](_0x3ee6('0x1a'),_0xb47cef['join']());for(var _0x10f908=0x0;_0x10f908<_0xb47cef['length'];_0x10f908++){io[_0x3ee6('0x1b')](_0x3ee6('0x1c'),{'id':_0xb47cef[_0x10f908],'closed':!![]});}}})[_0x3ee6('0x1d')](function(_0x382ece){logger[_0x3ee6('0x1e')](_0x3ee6('0x1f'),_0x382ece?util[_0x3ee6('0x20')](_0x382ece,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x98ce=['update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','catch','error','inspect','start','lodash','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','subtract','map','info','join','ChatInteraction'];(function(_0x23c318,_0x3d783b){var _0x2a5446=function(_0x3adb1f){while(--_0x3adb1f){_0x23c318['push'](_0x23c318['shift']());}};_0x2a5446(++_0x3d783b);}(_0x98ce,0xac));var _0xe98c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x98ce[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xe98c('0x0'));var moment=require('moment');var Redis=require(_0xe98c('0x1'));var util=require('util');var config=require(_0xe98c('0x2'));var db=require(_0xe98c('0x3'))['db'];var logger=require(_0xe98c('0x4'))(_0xe98c('0x5'));config[_0xe98c('0x6')]=_[_0xe98c('0x7')](config['redis'],{'host':_0xe98c('0x8'),'port':0x18eb});var io=require(_0xe98c('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x2b69a4=0x0;var _0x1e6802=[];return db[_0xe98c('0xa')][_0xe98c('0xb')]({'raw':!![],'attributes':['id',_0xe98c('0xc')],'where':{'id':0x1}})[_0xe98c('0xd')](function(_0x37ea44){_0x2b69a4=_0x37ea44[_0xe98c('0xc')];if(_0x2b69a4){return db['ChatInteraction'][_0xe98c('0xe')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe98c('0xf')](_0x37ea44['chatTimeout'],'minutes')}}});}else{return[];}})[_0xe98c('0xd')](function(_0x5ea7c7){if(_0x5ea7c7&&_0x5ea7c7['length']){_0x1e6802=_[_0xe98c('0x10')](_0x5ea7c7||[],'id');logger[_0xe98c('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x1e6802[_0xe98c('0x12')]());return db[_0xe98c('0x13')][_0xe98c('0x14')]({'closeReason':_0xe98c('0x15'),'disposition':_0xe98c('0x16'),'closed':!![],'closedAt':moment()[_0xe98c('0x17')](_0xe98c('0x18'))},{'where':{'id':_0x1e6802}});}})[_0xe98c('0xd')](function(){if(_0x1e6802&&_0x1e6802[_0xe98c('0x19')]){logger[_0xe98c('0x11')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x1e6802[_0xe98c('0x12')]());for(var _0x2f7ddd=0x0;_0x2f7ddd<_0x1e6802['length'];_0x2f7ddd++){io[_0xe98c('0x1a')](_0xe98c('0x1b'),{'id':_0x1e6802[_0x2f7ddd],'closed':!![]});}}})[_0xe98c('0x1c')](function(_0x36cda2){logger[_0xe98c('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x36cda2?util[_0xe98c('0x1e')](_0x36cda2,{'showHidden':![],'depth':null}):'');});}exports[_0xe98c('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 6cb938a..fd6d041 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9560=['exports','startAllRefreshIntervals'];(function(_0x43fe78,_0x451270){var _0x4e8e7d=function(_0x4b683a){while(--_0x4b683a){_0x43fe78['push'](_0x43fe78['shift']());}};_0x4e8e7d(++_0x451270);}(_0x9560,0x115));var _0x0956=function(_0x43c3f9,_0x1861cb){_0x43c3f9=_0x43c3f9-0x0;var _0x4f4f54=_0x9560[_0x43c3f9];return _0x4f4f54;};'use strict';function start(){var _0x586f91=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x586f91[_0x0956('0x0')]();}module[_0x0956('0x1')]={'intervals':{},'start':start};
\ No newline at end of file
+var _0x6ca1=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x4657b4,_0x170028){var _0x547baf=function(_0x34b771){while(--_0x34b771){_0x4657b4['push'](_0x4657b4['shift']());}};_0x547baf(++_0x170028);}(_0x6ca1,0x89));var _0x16ca=function(_0x41c8fa,_0x4e9858){_0x41c8fa=_0x41c8fa-0x0;var _0x2a4faa=_0x6ca1[_0x41c8fa];return _0x2a4faa;};'use strict';function start(){var _0x3df2f3=require(_0x16ca('0x0'));return _0x3df2f3['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start};
\ No newline at end of file
index 43a876a..ea3133c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41e3=['error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','jobs','toString','keyBy','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','stop\x20cron','start','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','../../files/reports','savename','%s.%s','basename','zip','join','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x41e3,0x81));var _0x341e=function(_0xb509c2,_0xc778dd){_0xb509c2=_0xb509c2-0x0;var _0x1a63e1=_0x41e3[_0xb509c2];return _0x1a63e1;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require('lodash');var moment=require(_0x341e('0x0'));var CronJobManager=require(_0x341e('0x1'));var jayson=require(_0x341e('0x2'));var BPromise=require('bluebird');var logger=require(_0x341e('0x3'))(_0x341e('0x4'));var db=require(_0x341e('0x5'))['db'];var analyticCustomReportController=require(_0x341e('0x6'));var analyticDefaultReportController=require(_0x341e('0x7'));var client=jayson[_0x341e('0x8')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xb75f9a,_0x10202e){return function(){logger[_0x341e('0x9')](_0x341e('0xa'),_0xb75f9a[_0x341e('0xb')]);var _0xf7dfcf=!![];var _0x4ba574={'tls':{'rejectUnauthorized':![]}};if(_0xb75f9a[_0x341e('0xc')][_0x341e('0xd')][_0x341e('0xe')]){_0x4ba574['service']=_0xb75f9a[_0x341e('0xc')][_0x341e('0xd')][_0x341e('0xe')];}else{_0x4ba574[_0x341e('0xf')]=_0xb75f9a[_0x341e('0xc')][_0x341e('0xd')][_0x341e('0xf')];_0x4ba574[_0x341e('0x10')]=_0xb75f9a[_0x341e('0xc')][_0x341e('0xd')][_0x341e('0x10')];_0x4ba574[_0x341e('0x11')]=_0xb75f9a['MailAccount'][_0x341e('0xd')][_0x341e('0x11')];}if(_0xb75f9a[_0x341e('0xc')][_0x341e('0xd')][_0x341e('0x12')]){_0x4ba574['auth']={'user':_0xb75f9a['MailAccount']['Smtp'][_0x341e('0x13')],'pass':_0xb75f9a['MailAccount'][_0x341e('0xd')][_0x341e('0x14')]};}var _0x19d037={'account':_0x4ba574,'message':{'from':util[_0x341e('0x15')](_0x341e('0x16'),_0xb75f9a[_0x341e('0xc')][_0x341e('0x17')],_0xb75f9a[_0x341e('0xc')]['email']||_0xb75f9a['MailAccount'][_0x341e('0xd')][_0x341e('0x13')]),'to':_0xb75f9a['email'],'cc':_0xb75f9a['cc'],'bcc':_0xb75f9a[_0x341e('0x18')],'subject':util['format'](_0x341e('0x19'),_0x10202e[_0x341e('0x17')],_0xb75f9a[_0x341e('0x1a')],_0xb75f9a['subtractUnit'])}};var _0x53a73d=path['join'](__dirname,_0x341e('0x1b'));var _0x1f3c43=_0x10202e[_0x341e('0x1c')];var _0x4e992f=util[_0x341e('0x15')](_0x341e('0x1d'),path[_0x341e('0x1e')](_0x10202e[_0x341e('0x1c')],path['extname'](_0x10202e['savename'])),_0x341e('0x1f'));var _0x26237e=path[_0x341e('0x20')](_0x53a73d,_0x1f3c43);var _0x5ca889=path[_0x341e('0x20')](_0x53a73d,_0x4e992f);if(fs[_0x341e('0x21')](_0x26237e)){_0x10202e[_0x341e('0x22')]=_0x341e('0x23');_0x19d037[_0x341e('0x24')][_0x341e('0x25')]=[{'filename':_0x1f3c43,'path':_0x26237e}];_0x19d037[_0x341e('0x24')][_0x341e('0x26')]=util['format'](_0x341e('0x27'),JSON[_0x341e('0x28')](_0x10202e,null,0x2));}else if(fs[_0x341e('0x21')](_0x5ca889)){_0x10202e['status']=_0x341e('0x23');_0x19d037[_0x341e('0x24')][_0x341e('0x25')]=[{'filename':_0x4e992f,'path':_0x5ca889}];}else{_0x19d037[_0x341e('0x24')]['text']=_0x341e('0x29');if(!_0xb75f9a[_0x341e('0x2a')]){_0xf7dfcf=![];logger[_0x341e('0x9')](_0x341e('0x2b'));}}if(_0xf7dfcf){return client[_0x341e('0x2c')](_0x341e('0x2d'),_0x19d037)['then'](function(_0xc2d5d8){if(_0xc2d5d8[_0x341e('0x2e')]){return logger['error'](_0x341e('0x2f'),JSON['stringify'](_0xc2d5d8));}return logger[_0x341e('0x9')]('email\x20sent');})['catch'](function(_0x4d5f33){return logger[_0x341e('0x2e')](_0x341e('0x2f'),JSON[_0x341e('0x28')](_0x4d5f33));});}};}function handleError(){return function(_0x526bcb){return logger['error'](JSON[_0x341e('0x28')](_0x526bcb));};}function handleResult(_0x494af0){return function(_0x362a49){logger[_0x341e('0x9')](_0x341e('0x30'),JSON[_0x341e('0x28')](_0x362a49));if(_0x494af0[_0x341e('0xc')]&&_0x494af0[_0x341e('0xc')][_0x341e('0xd')]&&!_[_0x341e('0x31')](_0x494af0[_0x341e('0xb')])){setTimeout(handleSendEmail(_0x494af0,_0x362a49),0x3c*0x3e8);}};}function handleJob(_0x4711b1){return function(){try{if(_[_0x341e('0x31')](_0x4711b1[_0x341e('0x1a')])){return logger['info'](_0x341e('0x32'));}if(_['isNil'](_0x4711b1[_0x341e('0x33')])){return logger[_0x341e('0x9')](_0x341e('0x34'));}var _0x517b4a={'startDate':moment()['subtract'](_0x4711b1[_0x341e('0x1a')],_0x4711b1[_0x341e('0x33')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x341e('0x15')](_0x341e('0x35')),'type':'scheduled','output':_0x4711b1[_0x341e('0x36')],'name':_0x4711b1[_0x341e('0x17')]};if(!_[_0x341e('0x31')](_0x4711b1[_0x341e('0x37')])){logger['info'](_0x341e('0x38'),_0x4711b1['DefaultReportId']);return analyticDefaultReportController[_0x341e('0x39')]({'id':_0x4711b1[_0x341e('0x37')]},_0x517b4a)[_0x341e('0x3a')](handleResult(_0x4711b1))[_0x341e('0x3b')](handleError());}if(!_[_0x341e('0x31')](_0x4711b1['CustomReportId'])){logger['info'](_0x341e('0x3c'),_0x4711b1[_0x341e('0x3d')]);return analyticCustomReportController['runReport']({'id':_0x4711b1[_0x341e('0x3d')]},_0x517b4a)[_0x341e('0x3a')](handleResult(_0x4711b1))[_0x341e('0x3b')](handleError());}}catch(_0x47ea35){logger[_0x341e('0x2e')](JSON['stringify'](_0x47ea35));}return logger[_0x341e('0x9')](_0x341e('0x3e'));};}function getJobs(_0xd3ca1b){var _0x1e81da={};if(_0xd3ca1b){_0x1e81da['id']=_0xd3ca1b;}return db[_0x341e('0x3f')][_0x341e('0x40')]({'where':_0x1e81da,'include':[{'model':db['MailAccount'],'attributes':['id',_0x341e('0x17'),_0x341e('0xb')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x341e('0x3a')](function(_0x57849d){var _0x272a99=_['keys'](manager[_0x341e('0x41')]);var _0x160d1b=_['map'](_0x57849d,function(_0x85f744){return _0x85f744['id'][_0x341e('0x42')]();});var _0x1e1ba2=_[_0x341e('0x43')](_0x57849d,function(_0x1eb41e){return _0x1eb41e['id']['toString']();});var _0x151f6c=_0xd3ca1b?_0x160d1b:_['difference'](_0x160d1b,_0x272a99);var _0x54b0b1=_[_0x341e('0x44')](_0x160d1b,_0x272a99);var _0x5454f9=_['difference'](_0x272a99,_0x160d1b);var _0x303625;var _0x274764;for(_0x303625=0x0;_0x303625<_0x5454f9[_0x341e('0x45')]&&!_0xd3ca1b;_0x303625+=0x1){_0x274764=_0x5454f9[_0x303625][_0x341e('0x42')]();if(manager[_0x341e('0x46')](_0x274764)){manager[_0x341e('0x47')](_0x274764);manager[_0x341e('0x48')](_0x274764);logger[_0x341e('0x9')](_0x341e('0x49'),_0x274764);}}logger[_0x341e('0x9')](_0x341e('0x4a'),JSON[_0x341e('0x28')](_0x151f6c));for(_0x303625=0x0;_0x303625<_0x151f6c['length'];_0x303625+=0x1){_0x274764=_0x151f6c[_0x303625][_0x341e('0x42')]();logger[_0x341e('0x9')](_0x341e('0x4b'),_0x274764);if(_0xd3ca1b){logger[_0x341e('0x9')](_0x341e('0x4c'),_0xd3ca1b);logger[_0x341e('0x9')](JSON['stringify'](_0x1e1ba2[_0x274764]));BPromise[_0x341e('0x4d')]()[_0x341e('0x3a')](handleJob(_0x1e1ba2[_0x274764]));logger[_0x341e('0x9')](_0x341e('0x4e'),_0x1e1ba2[_0x274764][_0x341e('0x17')],_0x1e1ba2[_0x274764][_0x341e('0x4f')]);}else if(_0x1e1ba2[_0x274764][_0x341e('0x4f')]&&_0x1e1ba2[_0x274764][_0x341e('0x50')]&&moment()[_0x341e('0x51')](_0x1e1ba2[_0x274764][_0x341e('0x52')],_0x1e1ba2[_0x274764][_0x341e('0x53')])){manager[_0x341e('0x54')](_0x274764,_0x1e1ba2[_0x274764][_0x341e('0x4f')],handleJob(_0x1e1ba2[_0x274764]));manager['start'](_0x274764);logger[_0x341e('0x9')](_0x341e('0x55'),_0x1e1ba2[_0x274764][_0x341e('0x17')],_0x1e1ba2[_0x274764]['cron']);}else if(manager[_0x341e('0x46')](_0x274764)){manager[_0x341e('0x47')](_0x274764);manager[_0x341e('0x48')](_0x274764);logger['info'](_0x341e('0x56'),_0x1e1ba2[_0x274764]['name'],_0x1e1ba2[_0x274764][_0x341e('0x4f')]);}}for(_0x303625=0x0,_0x274764;_0x303625<_0x54b0b1[_0x341e('0x45')]&&!_0xd3ca1b;_0x303625+=0x1){_0x274764=_0x54b0b1[_0x303625]['toString']();if(manager[_0x341e('0x46')](_0x274764)){if(_0x1e1ba2[_0x274764]['cron']&&_0x1e1ba2[_0x274764][_0x341e('0x50')]&&moment()['isBetween'](_0x1e1ba2[_0x274764][_0x341e('0x52')],_0x1e1ba2[_0x274764]['endAt'])){manager['update'](_0x274764,_0x1e1ba2[_0x274764][_0x341e('0x4f')],handleJob(_0x1e1ba2[_0x274764]));logger[_0x341e('0x9')]('update\x20cron',_0x1e1ba2[_0x274764][_0x341e('0x17')],_0x1e1ba2[_0x274764][_0x341e('0x4f')]);}else{manager['stop'](_0x274764);manager[_0x341e('0x48')](_0x274764);logger[_0x341e('0x9')](_0x341e('0x56'),_0x1e1ba2[_0x274764][_0x341e('0x17')],_0x1e1ba2[_0x274764]['cron']);}}}})['catch'](function(_0x2e8aff){logger[_0x341e('0x2e')](JSON['stringify'](_0x2e8aff));});}exports['run']=function(_0x557868){return getJobs(_0x557868);};exports[_0x341e('0x57')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x03ee=['CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','update\x20cron','stop\x20cron','run','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','MailAccount','service','host','port','secure','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport'];(function(_0x225504,_0x4bf683){var _0x1897d0=function(_0x1c614b){while(--_0x1c614b){_0x225504['push'](_0x225504['shift']());}};_0x1897d0(++_0x4bf683);}(_0x03ee,0x79));var _0xe03e=function(_0x519f88,_0x3f24bb){_0x519f88=_0x519f88-0x0;var _0x26dbf1=_0x03ee[_0x519f88];return _0x26dbf1;};'use strict';var fs=require('fs');var util=require(_0xe03e('0x0'));var path=require('path');var _=require(_0xe03e('0x1'));var moment=require(_0xe03e('0x2'));var CronJobManager=require(_0xe03e('0x3'));var jayson=require(_0xe03e('0x4'));var BPromise=require(_0xe03e('0x5'));var logger=require('../logger')(_0xe03e('0x6'));var db=require(_0xe03e('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xe03e('0x8'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1b2817,_0x55743d){return function(){logger[_0xe03e('0x9')](_0xe03e('0xa'),_0x1b2817[_0xe03e('0xb')]);var _0xf78dc7=!![];var _0x21df0e={'tls':{'rejectUnauthorized':![]}};if(_0x1b2817['MailAccount'][_0xe03e('0xc')]['service']){_0x21df0e['service']=_0x1b2817[_0xe03e('0xd')][_0xe03e('0xc')][_0xe03e('0xe')];}else{_0x21df0e[_0xe03e('0xf')]=_0x1b2817[_0xe03e('0xd')][_0xe03e('0xc')][_0xe03e('0xf')];_0x21df0e[_0xe03e('0x10')]=_0x1b2817[_0xe03e('0xd')]['Smtp'][_0xe03e('0x10')];_0x21df0e['secure']=_0x1b2817[_0xe03e('0xd')][_0xe03e('0xc')][_0xe03e('0x11')];}if(_0x1b2817['MailAccount'][_0xe03e('0xc')][_0xe03e('0x12')]){_0x21df0e[_0xe03e('0x13')]={'user':_0x1b2817[_0xe03e('0xd')][_0xe03e('0xc')][_0xe03e('0x14')],'pass':_0x1b2817[_0xe03e('0xd')][_0xe03e('0xc')][_0xe03e('0x15')]};}var _0x5c11c2={'account':_0x21df0e,'message':{'from':util['format'](_0xe03e('0x16'),_0x1b2817[_0xe03e('0xd')][_0xe03e('0x17')],_0x1b2817['MailAccount'][_0xe03e('0xb')]||_0x1b2817[_0xe03e('0xd')]['Smtp'][_0xe03e('0x14')]),'to':_0x1b2817[_0xe03e('0xb')],'cc':_0x1b2817['cc'],'bcc':_0x1b2817[_0xe03e('0x18')],'subject':util[_0xe03e('0x19')](_0xe03e('0x1a'),_0x55743d[_0xe03e('0x17')],_0x1b2817['subtractNumber'],_0x1b2817[_0xe03e('0x1b')])}};var _0x4e0f7f=path[_0xe03e('0x1c')](__dirname,_0xe03e('0x1d'));var _0x3d646f=_0x55743d[_0xe03e('0x1e')];var _0x40a8ae=util[_0xe03e('0x19')](_0xe03e('0x1f'),path[_0xe03e('0x20')](_0x55743d[_0xe03e('0x1e')],path[_0xe03e('0x21')](_0x55743d['savename'])),_0xe03e('0x22'));var _0x1be819=path['join'](_0x4e0f7f,_0x3d646f);var _0x2ce2a6=path['join'](_0x4e0f7f,_0x40a8ae);if(fs[_0xe03e('0x23')](_0x1be819)){_0x55743d[_0xe03e('0x24')]=_0xe03e('0x25');_0x5c11c2[_0xe03e('0x26')][_0xe03e('0x27')]=[{'filename':_0x3d646f,'path':_0x1be819}];_0x5c11c2['message']['text']=util['format'](_0xe03e('0x28'),JSON[_0xe03e('0x29')](_0x55743d,null,0x2));}else if(fs['existsSync'](_0x2ce2a6)){_0x55743d['status']='Sent';_0x5c11c2['message'][_0xe03e('0x27')]=[{'filename':_0x40a8ae,'path':_0x2ce2a6}];}else{_0x5c11c2[_0xe03e('0x26')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x1b2817[_0xe03e('0x2a')]){_0xf78dc7=![];logger[_0xe03e('0x9')](_0xe03e('0x2b'));}}if(_0xf78dc7){return client[_0xe03e('0x2c')](_0xe03e('0x2d'),_0x5c11c2)[_0xe03e('0x2e')](function(_0x377f99){if(_0x377f99['error']){return logger[_0xe03e('0x2f')](_0xe03e('0x30'),JSON['stringify'](_0x377f99));}return logger['info'](_0xe03e('0x31'));})[_0xe03e('0x32')](function(_0x108e57){return logger[_0xe03e('0x2f')](_0xe03e('0x30'),JSON[_0xe03e('0x29')](_0x108e57));});}};}function handleError(){return function(_0x1d0ae0){return logger['error'](JSON[_0xe03e('0x29')](_0x1d0ae0));};}function handleResult(_0x2116ea){return function(_0xfc91b0){logger['info'](_0xe03e('0x33'),JSON[_0xe03e('0x29')](_0xfc91b0));if(_0x2116ea[_0xe03e('0xd')]&&_0x2116ea[_0xe03e('0xd')][_0xe03e('0xc')]&&!_[_0xe03e('0x34')](_0x2116ea['email'])){setTimeout(handleSendEmail(_0x2116ea,_0xfc91b0),0x3c*0x3e8);}};}function handleJob(_0x4bfa8e){return function(){try{if(_[_0xe03e('0x34')](_0x4bfa8e['subtractNumber'])){return logger['info'](_0xe03e('0x35'));}if(_[_0xe03e('0x34')](_0x4bfa8e[_0xe03e('0x1b')])){return logger['info'](_0xe03e('0x36'));}var _0x2ce98c={'startDate':moment()['subtract'](_0x4bfa8e['subtractNumber'],_0x4bfa8e[_0xe03e('0x1b')])[_0xe03e('0x19')](_0xe03e('0x37')),'endDate':moment()[_0xe03e('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xe03e('0x38'),'output':_0x4bfa8e[_0xe03e('0x39')],'name':_0x4bfa8e['name']};if(!_['isNil'](_0x4bfa8e[_0xe03e('0x3a')])){logger['info'](_0xe03e('0x3b'),_0x4bfa8e[_0xe03e('0x3a')]);return analyticDefaultReportController[_0xe03e('0x3c')]({'id':_0x4bfa8e[_0xe03e('0x3a')]},_0x2ce98c)[_0xe03e('0x2e')](handleResult(_0x4bfa8e))[_0xe03e('0x32')](handleError());}if(!_[_0xe03e('0x34')](_0x4bfa8e['CustomReportId'])){logger[_0xe03e('0x9')]('exec\x20custom\x20report\x20id:%s',_0x4bfa8e[_0xe03e('0x3d')]);return analyticCustomReportController[_0xe03e('0x3c')]({'id':_0x4bfa8e[_0xe03e('0x3d')]},_0x2ce98c)[_0xe03e('0x2e')](handleResult(_0x4bfa8e))['catch'](handleError());}}catch(_0x317021){logger[_0xe03e('0x2f')](JSON[_0xe03e('0x29')](_0x317021));}return logger[_0xe03e('0x9')](_0xe03e('0x3e'));};}function getJobs(_0x5ee4f3){var _0x54ac75={};if(_0x5ee4f3){_0x54ac75['id']=_0x5ee4f3;}return db[_0xe03e('0x3f')][_0xe03e('0x40')]({'where':_0x54ac75,'include':[{'model':db[_0xe03e('0xd')],'attributes':['id',_0xe03e('0x17'),_0xe03e('0xb')],'include':[{'model':db[_0xe03e('0x41')],'as':_0xe03e('0xc')}]}]})['then'](function(_0x29e9bf){var _0x3913f4=_['keys'](manager[_0xe03e('0x42')]);var _0x2a6ce4=_[_0xe03e('0x43')](_0x29e9bf,function(_0x3b15ff){return _0x3b15ff['id'][_0xe03e('0x44')]();});var _0x3cfd0c=_[_0xe03e('0x45')](_0x29e9bf,function(_0x1cf212){return _0x1cf212['id'][_0xe03e('0x44')]();});var _0x435faf=_0x5ee4f3?_0x2a6ce4:_[_0xe03e('0x46')](_0x2a6ce4,_0x3913f4);var _0x567338=_[_0xe03e('0x47')](_0x2a6ce4,_0x3913f4);var _0x17b1bf=_[_0xe03e('0x46')](_0x3913f4,_0x2a6ce4);var _0x4662f7;var _0x23a4fc;for(_0x4662f7=0x0;_0x4662f7<_0x17b1bf[_0xe03e('0x48')]&&!_0x5ee4f3;_0x4662f7+=0x1){_0x23a4fc=_0x17b1bf[_0x4662f7]['toString']();if(manager[_0xe03e('0x49')](_0x23a4fc)){manager[_0xe03e('0x4a')](_0x23a4fc);manager[_0xe03e('0x4b')](_0x23a4fc);logger['info'](_0xe03e('0x4c'),_0x23a4fc);}}logger['info'](_0xe03e('0x4d'),JSON[_0xe03e('0x29')](_0x435faf));for(_0x4662f7=0x0;_0x4662f7<_0x435faf[_0xe03e('0x48')];_0x4662f7+=0x1){_0x23a4fc=_0x435faf[_0x4662f7]['toString']();logger[_0xe03e('0x9')]('index',_0x23a4fc);if(_0x5ee4f3){logger[_0xe03e('0x9')]('my\x20id',_0x5ee4f3);logger[_0xe03e('0x9')](JSON[_0xe03e('0x29')](_0x3cfd0c[_0x23a4fc]));BPromise[_0xe03e('0x4e')]()['then'](handleJob(_0x3cfd0c[_0x23a4fc]));logger[_0xe03e('0x9')](_0xe03e('0x4f'),_0x3cfd0c[_0x23a4fc][_0xe03e('0x17')],_0x3cfd0c[_0x23a4fc]['cron']);}else if(_0x3cfd0c[_0x23a4fc][_0xe03e('0x50')]&&_0x3cfd0c[_0x23a4fc][_0xe03e('0x51')]&&moment()[_0xe03e('0x52')](_0x3cfd0c[_0x23a4fc][_0xe03e('0x53')],_0x3cfd0c[_0x23a4fc][_0xe03e('0x54')])){manager[_0xe03e('0x55')](_0x23a4fc,_0x3cfd0c[_0x23a4fc][_0xe03e('0x50')],handleJob(_0x3cfd0c[_0x23a4fc]));manager[_0xe03e('0x56')](_0x23a4fc);logger['info'](_0xe03e('0x57'),_0x3cfd0c[_0x23a4fc][_0xe03e('0x17')],_0x3cfd0c[_0x23a4fc][_0xe03e('0x50')]);}else if(manager[_0xe03e('0x49')](_0x23a4fc)){manager[_0xe03e('0x4a')](_0x23a4fc);manager[_0xe03e('0x4b')](_0x23a4fc);logger[_0xe03e('0x9')]('stop\x20cron',_0x3cfd0c[_0x23a4fc]['name'],_0x3cfd0c[_0x23a4fc][_0xe03e('0x50')]);}}for(_0x4662f7=0x0,_0x23a4fc;_0x4662f7<_0x567338['length']&&!_0x5ee4f3;_0x4662f7+=0x1){_0x23a4fc=_0x567338[_0x4662f7][_0xe03e('0x44')]();if(manager[_0xe03e('0x49')](_0x23a4fc)){if(_0x3cfd0c[_0x23a4fc]['cron']&&_0x3cfd0c[_0x23a4fc][_0xe03e('0x51')]&&moment()[_0xe03e('0x52')](_0x3cfd0c[_0x23a4fc]['startAt'],_0x3cfd0c[_0x23a4fc][_0xe03e('0x54')])){manager['update'](_0x23a4fc,_0x3cfd0c[_0x23a4fc]['cron'],handleJob(_0x3cfd0c[_0x23a4fc]));logger['info'](_0xe03e('0x58'),_0x3cfd0c[_0x23a4fc][_0xe03e('0x17')],_0x3cfd0c[_0x23a4fc][_0xe03e('0x50')]);}else{manager[_0xe03e('0x4a')](_0x23a4fc);manager[_0xe03e('0x4b')](_0x23a4fc);logger[_0xe03e('0x9')](_0xe03e('0x59'),_0x3cfd0c[_0x23a4fc][_0xe03e('0x17')],_0x3cfd0c[_0x23a4fc][_0xe03e('0x50')]);}}}})[_0xe03e('0x32')](function(_0x25a36a){logger['error'](JSON['stringify'](_0x25a36a));});}exports[_0xe03e('0x5a')]=function(_0x1076fb){return getJobs(_0x1076fb);};exports[_0xe03e('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index e862122..e092673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1f9=['data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','Negative','SentimentScore','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','bucket','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','forEach','all','inspect','lodash','aws-sdk','request-promise','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','then','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','fileText','length','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available'];(function(_0x4e7fab,_0x57482e){var _0x30139c=function(_0xf37356){while(--_0xf37356){_0x4e7fab['push'](_0x4e7fab['shift']());}};_0x30139c(++_0x57482e);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0xcd64fa,_0x3b8444){_0xcd64fa=_0xcd64fa-0x0;var _0x224ba=_0xf1f9[_0xcd64fa];return _0x224ba;};var _=require(_0x9f1f('0x0'));var AWS=require(_0x9f1f('0x1'));var rp=require(_0x9f1f('0x2'));var util=require(_0x9f1f('0x3'));var BPromise=require(_0x9f1f('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x9f1f('0x5'))(_0x9f1f('0x6'));function getTranscriptionJob(_0x37eebc,_0x360fae,_0x195353,_0x41e340){return new Promise(function(_0x5e4f05,_0x5e4150){var _0x363d26=new AWS[(_0x9f1f('0x7'))]({'accessKeyId':_0x360fae,'secretAccessKey':_0x37eebc,'region':_0x195353});_0x363d26[_0x9f1f('0x8')]({'TranscriptionJobName':_0x41e340},function(_0x12309e,_0x4e6054){if(_0x12309e){return _0x5e4150(_0x12309e);}else{return _0x5e4f05(_0x4e6054);}});});}function sentiment(_0x1643e7,_0x2dae00,_0x3efac2,_0x7cc6f1,_0x2def71){return new Promise(function(_0x24b959,_0x3fea57){var _0x50db7b=new AWS['Comprehend']({'accessKeyId':_0x2dae00,'secretAccessKey':_0x1643e7,'region':_0x3efac2});_0x50db7b[_0x9f1f('0x9')]({'Text':_0x7cc6f1,'LanguageCode':_0x2def71[_0x9f1f('0xa')](0x0,0x2)},function(_0x1dc039,_0x5a32dc){if(_0x1dc039){return _0x3fea57(_0x1dc039);}else{return _0x24b959(_0x5a32dc);}});});}function checkTranscribeJob(_0x540d50,_0x3d81cc,_0x53a884){var _0x2d4a5f;return new BPromise(function(_0x1b3e3b,_0x4d9b7e){logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')](_0x9f1f('0xd'),_0x540d50['id'],_0x540d50[_0x9f1f('0xe')]));return getTranscriptionJob(_0x53a884['data1'],_0x53a884[_0x9f1f('0xf')],_0x3d81cc['transcribeRegion'],_0x540d50[_0x9f1f('0xe')])[_0x9f1f('0x10')](function(_0x2ada8c){logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x540d50['id'],_0x540d50[_0x9f1f('0xe')],_0x2ada8c[_0x9f1f('0x11')][_0x9f1f('0x12')]));if(!_0x540d50['fileText']){switch(_0x2ada8c[_0x9f1f('0x11')][_0x9f1f('0x12')]){case _0x9f1f('0x13'):var _0x46f71a={'transcribeStatus':_0x2ada8c[_0x9f1f('0x11')]['TranscriptionJobStatus'],'fileUri':_0x2ada8c[_0x9f1f('0x11')][_0x9f1f('0x14')][_0x9f1f('0x15')]};logger[_0x9f1f('0xb')](util['format'](_0x9f1f('0x16'),_0x540d50['id']));return rp({'uri':_0x2ada8c['TranscriptionJob'][_0x9f1f('0x14')][_0x9f1f('0x15')],'json':!![]})['then'](function(_0x4042de){logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')](_0x9f1f('0x17'),_0x540d50['id']));if(_0x4042de&&_0x4042de[_0x9f1f('0x18')]&&_0x4042de['results']['transcripts']&&_0x4042de['results']['transcripts']['length']){_0x46f71a[_0x9f1f('0x19')]='';for(var _0x35dac1=0x0;_0x35dac1<_0x4042de[_0x9f1f('0x18')]['transcripts'][_0x9f1f('0x1a')];_0x35dac1++){_0x46f71a[_0x9f1f('0x19')]+=_0x4042de[_0x9f1f('0x18')][_0x9f1f('0x1b')][_0x35dac1][_0x9f1f('0x1c')]+'';}}return _0x540d50[_0x9f1f('0x1d')](_0x46f71a);})[_0x9f1f('0x10')](function(){logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')](_0x9f1f('0x1e'),_0x540d50['id']));if(!_0x540d50[_0x9f1f('0x1f')]){throw new db[(_0x9f1f('0x20'))][(_0x9f1f('0x21'))](_0x9f1f('0x22'));}if(!_0x3d81cc['sentiment']||!_0x3d81cc['sentimentAccountId']||!_0x3d81cc[_0x9f1f('0x23')]||!_0x3d81cc[_0x9f1f('0x24')]||!_0x3d81cc['bucket']){throw new db[(_0x9f1f('0x20'))][(_0x9f1f('0x21'))](_0x9f1f('0x25'));}if(!_0x46f71a[_0x9f1f('0x19')]){throw new Error(_0x9f1f('0x26'));}if(_0x3d81cc[_0x9f1f('0x27')]===_0x53a884['id']){return _0x53a884;}else{return db[_0x9f1f('0x28')][_0x9f1f('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x9f1f('0x10')](function(_0x52df33){if(!_0x52df33){throw new db[(_0x9f1f('0x20'))][(_0x9f1f('0x21'))](_0x9f1f('0x2a'));}if(!_0x52df33[_0x9f1f('0x2b')]||!_0x52df33[_0x9f1f('0xf')]){throw new db['Sequelize'][(_0x9f1f('0x21'))](_0x9f1f('0x2c'));}_0x2d4a5f=_0x52df33;logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')](_0x9f1f('0x2d'),_0x540d50['id']));return sentiment(_0x2d4a5f[_0x9f1f('0x2b')],_0x2d4a5f[_0x9f1f('0xf')],_0x3d81cc[_0x9f1f('0x23')],_0x46f71a[_0x9f1f('0x19')],_0x3d81cc[_0x9f1f('0x24')]);})[_0x9f1f('0x10')](function(_0x2d924a){logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')](_0x9f1f('0x2e'),_0x540d50['id']));return _0x540d50[_0x9f1f('0x1d')]({'sentiment':_0x2d924a[_0x9f1f('0x2f')],'sPositive':_0x2d924a['SentimentScore'][_0x9f1f('0x30')],'sNegative':_0x2d924a['SentimentScore'][_0x9f1f('0x31')],'sMixed':_0x2d924a[_0x9f1f('0x32')][_0x9f1f('0x33')],'sNeutral':_0x2d924a[_0x9f1f('0x32')][_0x9f1f('0x34')]});})[_0x9f1f('0x10')](function(){logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')](_0x9f1f('0x1e'),_0x540d50['id']));_0x1b3e3b();});case _0x9f1f('0x35'):return _0x540d50[_0x9f1f('0x1d')]({'transcribeStatus':_0x9f1f('0x35'),'failureReason':_0x2ada8c[_0x9f1f('0x11')]['FailureReason']})[_0x9f1f('0x10')](function(){logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')](_0x9f1f('0x1e'),_0x540d50['id']));_0x1b3e3b();});default:logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')](_0x9f1f('0x36'),_0x540d50['id']));break;}}else{return BPromise[_0x9f1f('0x37')]()['then'](function(){if(!_0x540d50[_0x9f1f('0x1f')]){throw new db['Sequelize'][(_0x9f1f('0x21'))](_0x9f1f('0x22'));}if(!_0x3d81cc[_0x9f1f('0x38')]||!_0x3d81cc[_0x9f1f('0x27')]||!_0x3d81cc[_0x9f1f('0x23')]||!_0x3d81cc[_0x9f1f('0x24')]||!_0x3d81cc[_0x9f1f('0x39')]){throw new db['Sequelize'][(_0x9f1f('0x21'))](_0x9f1f('0x25'));}if(!_0x540d50[_0x9f1f('0x19')]){throw new Error(_0x9f1f('0x26'));}if(_0x3d81cc[_0x9f1f('0x27')]===_0x53a884['id']){return _0x53a884;}else{return db['CloudProvider'][_0x9f1f('0x29')]({'where':{'id':_settings[_0x9f1f('0x27')]}});}})['then'](function(_0x18b554){if(!_0x18b554){throw new db[(_0x9f1f('0x20'))]['ValidationError'](_0x9f1f('0x2a'));}if(!_0x18b554[_0x9f1f('0x2b')]||!_0x18b554[_0x9f1f('0xf')]){throw new db[(_0x9f1f('0x20'))][(_0x9f1f('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x2d4a5f=_0x18b554;logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')](_0x9f1f('0x2d'),_0x540d50['id']));return sentiment(_0x2d4a5f[_0x9f1f('0x2b')],_0x2d4a5f[_0x9f1f('0xf')],_0x3d81cc[_0x9f1f('0x23')],_0x540d50[_0x9f1f('0x19')],_0x3d81cc[_0x9f1f('0x24')]);})[_0x9f1f('0x10')](function(_0x587af4){logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x540d50['id']));return _0x540d50[_0x9f1f('0x1d')]({'sentiment':_0x587af4[_0x9f1f('0x2f')],'sPositive':_0x587af4[_0x9f1f('0x32')][_0x9f1f('0x30')],'sNegative':_0x587af4[_0x9f1f('0x32')][_0x9f1f('0x31')],'sMixed':_0x587af4[_0x9f1f('0x32')][_0x9f1f('0x33')],'sNeutral':_0x587af4[_0x9f1f('0x32')][_0x9f1f('0x34')],'transcribeStatus':'COMPLETED'});})[_0x9f1f('0x10')](function(){logger[_0x9f1f('0xb')](util[_0x9f1f('0xc')](_0x9f1f('0x1e'),_0x540d50['id']));_0x1b3e3b();});}})[_0x9f1f('0x3a')](function(_0x417bc5){if(_0x417bc5){if(!_0x417bc5[_0x9f1f('0x3b')]||_0x417bc5[_0x9f1f('0x3b')]!==_0x9f1f('0x3c')){logger[_0x9f1f('0x3d')](util[_0x9f1f('0xc')](_0x9f1f('0x3e'),_0x540d50['id']),util['inspect'](_0x417bc5,{'showHidden':![],'depth':null}));}}_0x1b3e3b();});});}function checkTranscribe(){var _0x1ebf47;var _0x486420;var _0x59cd68;return db[_0x9f1f('0x3f')]['findAll']({'where':{'transcribeStatus':_0x9f1f('0x40')}})[_0x9f1f('0x10')](function(_0x50ce4d){if(!_0x50ce4d||!_0x50ce4d[_0x9f1f('0x1a')]){throw new db[(_0x9f1f('0x20'))][(_0x9f1f('0x21'))]('No\x20transcribe\x20job\x20to\x20check');}_0x1ebf47=_0x50ce4d;return db[_0x9f1f('0x41')][_0x9f1f('0x29')]({'where':{'id':0x1}});})[_0x9f1f('0x10')](function(_0x4aa61b){if(!_0x4aa61b){throw new db['Sequelize'][(_0x9f1f('0x21'))](_0x9f1f('0x42'));}_0x486420=_0x4aa61b;if(!_0x486420[_0x9f1f('0x6')]||!_0x486420[_0x9f1f('0x43')]||!_0x486420[_0x9f1f('0x44')]||!_0x486420['language']||!_0x486420[_0x9f1f('0x39')]){throw new db[(_0x9f1f('0x20'))][(_0x9f1f('0x21'))]('Transcribe\x20not\x20configured');}return db[_0x9f1f('0x28')][_0x9f1f('0x29')]({'where':{'id':_0x486420[_0x9f1f('0x43')]}});})['then'](function(_0x45c8d0){if(!_0x45c8d0){throw new db['Sequelize'][(_0x9f1f('0x21'))](_0x9f1f('0x2a'));}if(!_0x45c8d0[_0x9f1f('0x2b')]||!_0x45c8d0['data2']){throw new db[(_0x9f1f('0x20'))][(_0x9f1f('0x21'))](_0x9f1f('0x2c'));}_0x59cd68=_0x45c8d0;var _0x1e1691=[];_0x1ebf47[_0x9f1f('0x45')](function(_0x114d85){_0x1e1691['push'](checkTranscribeJob(_0x114d85,_0x486420,_0x59cd68));});return BPromise[_0x9f1f('0x46')](_0x1e1691);})['catch'](function(_0x504c8f){if(_0x504c8f){if(!_0x504c8f[_0x9f1f('0x3b')]||_0x504c8f[_0x9f1f('0x3b')]!==_0x9f1f('0x3c')){logger['error'](util[_0x9f1f('0x47')](_0x504c8f,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x9e5e=['[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','bucket','ValidationError','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','length','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','all','catch','start','lodash','aws-sdk','util','bluebird','../../mysqldb','transcribe','getTranscriptionJob','Comprehend','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x9e5e[_0x819464];return _0x49dcc0;};var _=require(_0xe9e5('0x0'));var AWS=require(_0xe9e5('0x1'));var rp=require('request-promise');var util=require(_0xe9e5('0x2'));var BPromise=require(_0xe9e5('0x3'));var db=require(_0xe9e5('0x4'))['db'];var logger=require('../../config/logger')(_0xe9e5('0x5'));function getTranscriptionJob(_0x5c29f3,_0x396715,_0x2bc952,_0x4f5182){return new Promise(function(_0x5c09f0,_0xf4d974){var _0x2333df=new AWS['TranscribeService']({'accessKeyId':_0x396715,'secretAccessKey':_0x5c29f3,'region':_0x2bc952});_0x2333df[_0xe9e5('0x6')]({'TranscriptionJobName':_0x4f5182},function(_0x2533d8,_0x3c5c1b){if(_0x2533d8){return _0xf4d974(_0x2533d8);}else{return _0x5c09f0(_0x3c5c1b);}});});}function sentiment(_0x6325f0,_0x34b7f5,_0x18a551,_0x18d1ee,_0x28a123){return new Promise(function(_0x2a58fb,_0x5397ce){var _0x38cd93=new AWS[(_0xe9e5('0x7'))]({'accessKeyId':_0x34b7f5,'secretAccessKey':_0x6325f0,'region':_0x18a551});_0x38cd93['detectSentiment']({'Text':_0x18d1ee,'LanguageCode':_0x28a123['substring'](0x0,0x2)},function(_0x4f4d79,_0x517c91){if(_0x4f4d79){return _0x5397ce(_0x4f4d79);}else{return _0x2a58fb(_0x517c91);}});});}function checkTranscribeJob(_0x439466,_0x145c5f,_0x42dcba){var _0x272b49;return new BPromise(function(_0x269ac4,_0x4aab69){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0xa'),_0x439466['id'],_0x439466[_0xe9e5('0xb')]));return getTranscriptionJob(_0x42dcba['data1'],_0x42dcba[_0xe9e5('0xc')],_0x145c5f[_0xe9e5('0xd')],_0x439466[_0xe9e5('0xb')])[_0xe9e5('0xe')](function(_0x17990d){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0xf'),_0x439466['id'],_0x439466[_0xe9e5('0xb')],_0x17990d[_0xe9e5('0x10')]['TranscriptionJobStatus']));if(!_0x439466[_0xe9e5('0x11')]){switch(_0x17990d[_0xe9e5('0x10')][_0xe9e5('0x12')]){case _0xe9e5('0x13'):var _0x28dfbe={'transcribeStatus':_0x17990d[_0xe9e5('0x10')][_0xe9e5('0x12')],'fileUri':_0x17990d[_0xe9e5('0x10')][_0xe9e5('0x14')][_0xe9e5('0x15')]};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x439466['id']));return rp({'uri':_0x17990d[_0xe9e5('0x10')][_0xe9e5('0x14')][_0xe9e5('0x15')],'json':!![]})[_0xe9e5('0xe')](function(_0x4143dc){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x16'),_0x439466['id']));if(_0x4143dc&&_0x4143dc[_0xe9e5('0x17')]&&_0x4143dc[_0xe9e5('0x17')][_0xe9e5('0x18')]&&_0x4143dc['results'][_0xe9e5('0x18')]['length']){_0x28dfbe[_0xe9e5('0x11')]='';for(var _0x48005f=0x0;_0x48005f<_0x4143dc[_0xe9e5('0x17')]['transcripts']['length'];_0x48005f++){_0x28dfbe['fileText']+=_0x4143dc[_0xe9e5('0x17')][_0xe9e5('0x18')][_0x48005f][_0xe9e5('0x19')]+'';}}return _0x439466[_0xe9e5('0x1a')](_0x28dfbe);})[_0xe9e5('0xe')](function(){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x1b'),_0x439466['id']));if(!_0x439466[_0xe9e5('0x1c')]){throw new db[(_0xe9e5('0x1d'))]['ValidationError'](_0xe9e5('0x1e'));}if(!_0x145c5f['sentiment']||!_0x145c5f[_0xe9e5('0x1f')]||!_0x145c5f[_0xe9e5('0x20')]||!_0x145c5f['language']||!_0x145c5f[_0xe9e5('0x21')]){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x28dfbe[_0xe9e5('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x145c5f[_0xe9e5('0x1f')]===_0x42dcba['id']){return _0x42dcba;}else{return db[_0xe9e5('0x23')]['findOne']({'where':{'id':_settings[_0xe9e5('0x1f')]}});}})[_0xe9e5('0xe')](function(_0x50cf20){if(!_0x50cf20){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x24'));}if(!_0x50cf20[_0xe9e5('0x25')]||!_0x50cf20[_0xe9e5('0xc')]){throw new db[(_0xe9e5('0x1d'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x272b49=_0x50cf20;logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x439466['id']));return sentiment(_0x272b49[_0xe9e5('0x25')],_0x272b49[_0xe9e5('0xc')],_0x145c5f['sentimentRegion'],_0x28dfbe['fileText'],_0x145c5f[_0xe9e5('0x26')]);})['then'](function(_0x5dde23){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x27'),_0x439466['id']));return _0x439466[_0xe9e5('0x1a')]({'sentiment':_0x5dde23[_0xe9e5('0x28')],'sPositive':_0x5dde23[_0xe9e5('0x29')][_0xe9e5('0x2a')],'sNegative':_0x5dde23[_0xe9e5('0x29')][_0xe9e5('0x2b')],'sMixed':_0x5dde23[_0xe9e5('0x29')][_0xe9e5('0x2c')],'sNeutral':_0x5dde23[_0xe9e5('0x29')][_0xe9e5('0x2d')]});})['then'](function(){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x1b'),_0x439466['id']));_0x269ac4();});case _0xe9e5('0x2e'):return _0x439466[_0xe9e5('0x1a')]({'transcribeStatus':_0xe9e5('0x2e'),'failureReason':_0x17990d['TranscriptionJob'][_0xe9e5('0x2f')]})[_0xe9e5('0xe')](function(){logger[_0xe9e5('0x8')](util['format'](_0xe9e5('0x1b'),_0x439466['id']));_0x269ac4();});default:logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x30'),_0x439466['id']));break;}}else{return BPromise[_0xe9e5('0x31')]()[_0xe9e5('0xe')](function(){if(!_0x439466[_0xe9e5('0x1c')]){throw new db['Sequelize']['ValidationError'](_0xe9e5('0x1e'));}if(!_0x145c5f[_0xe9e5('0x32')]||!_0x145c5f[_0xe9e5('0x1f')]||!_0x145c5f[_0xe9e5('0x20')]||!_0x145c5f[_0xe9e5('0x26')]||!_0x145c5f['bucket']){throw new db[(_0xe9e5('0x1d'))]['ValidationError'](_0xe9e5('0x33'));}if(!_0x439466['fileText']){throw new Error(_0xe9e5('0x34'));}if(_0x145c5f[_0xe9e5('0x1f')]===_0x42dcba['id']){return _0x42dcba;}else{return db['CloudProvider'][_0xe9e5('0x35')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xe9e5('0xe')](function(_0x2ff35a){if(!_0x2ff35a){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x24'));}if(!_0x2ff35a[_0xe9e5('0x25')]||!_0x2ff35a[_0xe9e5('0xc')]){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x36'));}_0x272b49=_0x2ff35a;logger[_0xe9e5('0x8')](util['format'](_0xe9e5('0x37'),_0x439466['id']));return sentiment(_0x272b49[_0xe9e5('0x25')],_0x272b49[_0xe9e5('0xc')],_0x145c5f[_0xe9e5('0x20')],_0x439466['fileText'],_0x145c5f['language']);})[_0xe9e5('0xe')](function(_0x54cf26){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x27'),_0x439466['id']));return _0x439466[_0xe9e5('0x1a')]({'sentiment':_0x54cf26[_0xe9e5('0x28')],'sPositive':_0x54cf26['SentimentScore'][_0xe9e5('0x2a')],'sNegative':_0x54cf26['SentimentScore']['Negative'],'sMixed':_0x54cf26['SentimentScore'][_0xe9e5('0x2c')],'sNeutral':_0x54cf26[_0xe9e5('0x29')][_0xe9e5('0x2d')],'transcribeStatus':_0xe9e5('0x13')});})[_0xe9e5('0xe')](function(){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x1b'),_0x439466['id']));_0x269ac4();});}})['catch'](function(_0x868ecb){if(_0x868ecb){if(!_0x868ecb[_0xe9e5('0x38')]||_0x868ecb[_0xe9e5('0x38')]!==_0xe9e5('0x39')){logger[_0xe9e5('0x3a')](util[_0xe9e5('0x9')](_0xe9e5('0x3b'),_0x439466['id']),util['inspect'](_0x868ecb,{'showHidden':![],'depth':null}));}}_0x269ac4();});});}function checkTranscribe(){var _0x4c38a7;var _0x24772a;var _0x4e8b56;return db[_0xe9e5('0x3c')][_0xe9e5('0x3d')]({'where':{'transcribeStatus':_0xe9e5('0x3e')}})['then'](function(_0x3eae80){if(!_0x3eae80||!_0x3eae80[_0xe9e5('0x3f')]){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))]('No\x20transcribe\x20job\x20to\x20check');}_0x4c38a7=_0x3eae80;return db[_0xe9e5('0x40')][_0xe9e5('0x35')]({'where':{'id':0x1}});})[_0xe9e5('0xe')](function(_0xda435e){if(!_0xda435e){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x41'));}_0x24772a=_0xda435e;if(!_0x24772a[_0xe9e5('0x5')]||!_0x24772a[_0xe9e5('0x42')]||!_0x24772a['transcribeRegion']||!_0x24772a['language']||!_0x24772a[_0xe9e5('0x21')]){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x43'));}return db[_0xe9e5('0x23')][_0xe9e5('0x35')]({'where':{'id':_0x24772a[_0xe9e5('0x42')]}});})[_0xe9e5('0xe')](function(_0x47d74b){if(!_0x47d74b){throw new db['Sequelize']['ValidationError'](_0xe9e5('0x24'));}if(!_0x47d74b[_0xe9e5('0x25')]||!_0x47d74b[_0xe9e5('0xc')]){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x36'));}_0x4e8b56=_0x47d74b;var _0x2fd3c1=[];_0x4c38a7['forEach'](function(_0xd6b0ed){_0x2fd3c1['push'](checkTranscribeJob(_0xd6b0ed,_0x24772a,_0x4e8b56));});return BPromise[_0xe9e5('0x44')](_0x2fd3c1);})[_0xe9e5('0x45')](function(_0x3af576){if(_0x3af576){if(!_0x3af576['name']||_0x3af576[_0xe9e5('0x38')]!==_0xe9e5('0x39')){logger['error'](util['inspect'](_0x3af576,{'showHidden':![],'depth':null}));}}});}exports[_0xe9e5('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 2ddf7ca..f4482d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83dd=['redis','defaults','socket.io-emitter','findAll','lastMsgAt','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule'];(function(_0xfe5a53,_0xf623f7){var _0x5a8a32=function(_0x460a31){while(--_0x460a31){_0xfe5a53['push'](_0xfe5a53['shift']());}};_0x5a8a32(++_0xf623f7);}(_0x83dd,0x18f));var _0xd83d=function(_0x14f226,_0x4b623c){_0x14f226=_0x14f226-0x0;var _0x4c7e09=_0x83dd[_0x14f226];return _0x4c7e09;};'use strict';var _=require(_0xd83d('0x0'));var moment=require(_0xd83d('0x1'));var Redis=require(_0xd83d('0x2'));var util=require('util');var config=require(_0xd83d('0x3'));var db=require(_0xd83d('0x4'))['db'];var logger=require(_0xd83d('0x5'))(_0xd83d('0x6'));config[_0xd83d('0x7')]=_[_0xd83d('0x8')](config[_0xd83d('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd83d('0x9'))(new Redis(config[_0xd83d('0x7')]));function closeInteractions(){var _0x2a78f5=[];return db['WhatsappInteraction'][_0xd83d('0xa')]({'raw':!![],'attributes':['id',_0xd83d('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xd83d('0xc')](0x18,'hours')}}})[_0xd83d('0xd')](function(_0x1f6dfd){if(_0x1f6dfd&&_0x1f6dfd[_0xd83d('0xe')]){_0x2a78f5=_[_0xd83d('0xf')](_0x1f6dfd||[],'id');logger[_0xd83d('0x10')](_0xd83d('0x11'),_0x2a78f5[_0xd83d('0x12')]());return db[_0xd83d('0x13')][_0xd83d('0x14')]({'closeReason':'system','disposition':_0xd83d('0x15'),'closed':!![],'closedAt':moment()[_0xd83d('0x16')](_0xd83d('0x17'))},{'where':{'id':_0x2a78f5}});}})[_0xd83d('0xd')](function(){if(_0x2a78f5&&_0x2a78f5[_0xd83d('0xe')]){logger[_0xd83d('0x10')](_0xd83d('0x18'),_0x2a78f5[_0xd83d('0x12')]());for(var _0x485213=0x0;_0x485213<_0x2a78f5[_0xd83d('0xe')];_0x485213++){io['emit'](_0xd83d('0x19'),{'id':_0x2a78f5[_0x485213],'closed':!![]});}}})[_0xd83d('0x1a')](function(_0x44c704){logger[_0xd83d('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x44c704?util['inspect'](_0x44c704,{'showHidden':![],'depth':null}):'');});}exports[_0xd83d('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x91a1=['format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','findAll','lastMsgAt','subtract','hours','then','length','map','info','join','WhatsappInteraction','update','timeout'];(function(_0x35751c,_0x4e960b){var _0x44dcd3=function(_0x44a3d9){while(--_0x44a3d9){_0x35751c['push'](_0x35751c['shift']());}};_0x44dcd3(++_0x4e960b);}(_0x91a1,0x151));var _0x191a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91a1[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x191a('0x0'));var moment=require(_0x191a('0x1'));var Redis=require(_0x191a('0x2'));var util=require(_0x191a('0x3'));var config=require(_0x191a('0x4'));var db=require(_0x191a('0x5'))['db'];var logger=require(_0x191a('0x6'))(_0x191a('0x7'));config[_0x191a('0x8')]=_[_0x191a('0x9')](config[_0x191a('0x8')],{'host':_0x191a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x191a('0x8')]));function closeInteractions(){var _0x263a0e=[];return db['WhatsappInteraction'][_0x191a('0xb')]({'raw':!![],'attributes':['id',_0x191a('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x191a('0xd')](0x18,_0x191a('0xe'))}}})[_0x191a('0xf')](function(_0x504af4){if(_0x504af4&&_0x504af4[_0x191a('0x10')]){_0x263a0e=_[_0x191a('0x11')](_0x504af4||[],'id');logger[_0x191a('0x12')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x263a0e[_0x191a('0x13')]());return db[_0x191a('0x14')][_0x191a('0x15')]({'closeReason':'system','disposition':_0x191a('0x16'),'closed':!![],'closedAt':moment()[_0x191a('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x263a0e}});}})[_0x191a('0xf')](function(){if(_0x263a0e&&_0x263a0e[_0x191a('0x10')]){logger[_0x191a('0x12')](_0x191a('0x18'),_0x263a0e[_0x191a('0x13')]());for(var _0x2e7650=0x0;_0x2e7650<_0x263a0e['length'];_0x2e7650++){io[_0x191a('0x19')](_0x191a('0x1a'),{'id':_0x263a0e[_0x2e7650],'closed':!![]});}}})['catch'](function(_0x3d10db){logger[_0x191a('0x1b')](_0x191a('0x1c'),_0x3d10db?util[_0x191a('0x1d')](_0x3d10db,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index cd0e79b..74537f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb646=['bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','catch','Biondo','innocenzo.biondo','@xcally.com','push','now','Innocenzo','CmContact','destroy','then'];(function(_0x1cd89d,_0x2d6a3c){var _0x4c5168=function(_0x52e3d8){while(--_0x52e3d8){_0x1cd89d['push'](_0x1cd89d['shift']());}};_0x4c5168(++_0x2d6a3c);}(_0xb646,0x1c7));var _0x6b64=function(_0x5a28a9,_0x467480){_0x5a28a9=_0x5a28a9-0x0;var _0x16010a=_0xb646[_0x5a28a9];return _0x16010a;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x6b64('0x0')+i,'phone':0xf879fb460+i,'email':_0x6b64('0x1')+i+_0x6b64('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6b64('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x6b64('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x6b64('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6b64('0x3')]({'id':i,'firstName':_0x6b64('0x5')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x6b64('0x1')+i+_0x6b64('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6b64('0x3')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6b64('0x4')](),'updatedAt':Date['now']()});}db[_0x6b64('0x6')][_0x6b64('0x7')]({'where':{}})[_0x6b64('0x8')](function(){return db['CmContact'][_0x6b64('0x9')](contacts);})['then'](function(){console[_0x6b64('0xa')](_0x6b64('0xb'),_0x6b64('0xc'));return db[_0x6b64('0xd')][_0x6b64('0x7')]({'where':{}});})[_0x6b64('0x8')](function(){return db[_0x6b64('0xd')][_0x6b64('0x9')](hopper);})[_0x6b64('0x8')](function(){console[_0x6b64('0xa')](_0x6b64('0xb'),_0x6b64('0xe'));return db['CmContact'][_0x6b64('0x9')](contacts2);})['then'](function(){console['log'](_0x6b64('0xb'),'contacts2');return db['CmHopper'][_0x6b64('0x9')](hopper2);})[_0x6b64('0x8')](function(){console[_0x6b64('0xa')](_0x6b64('0xb'),'hopper2');})[_0x6b64('0xf')](function(_0xea8025){console['log'](_0xea8025);});
\ No newline at end of file
+var _0x9e86=['CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb','push','now','Innocenzo','Biondo','innocenzo.biondo','CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1'];(function(_0x1a4581,_0x1b011d){var _0x53ce13=function(_0x3d13c9){while(--_0x3d13c9){_0x1a4581['push'](_0x1a4581['shift']());}};_0x53ce13(++_0x1b011d);}(_0x9e86,0xef));var _0x69e8=function(_0x441c45,_0x3699d8){_0x441c45=_0x441c45-0x0;var _0x43483a=_0x9e86[_0x441c45];return _0x43483a;};'use strict';var util=require('util');var db=require(_0x69e8('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x69e8('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x69e8('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x69e8('0x2')](),'updatedAt':Date[_0x69e8('0x2')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x69e8('0x1')]({'id':i,'firstName':_0x69e8('0x3')+i,'lastName':_0x69e8('0x4')+i,'phone':0xf879fb460+i,'email':_0x69e8('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x69e8('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x69e8('0x2')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x69e8('0x2')](),'updatedAt':Date[_0x69e8('0x2')]()});}db[_0x69e8('0x6')][_0x69e8('0x7')]({'where':{}})['then'](function(){return db['CmContact'][_0x69e8('0x8')](contacts);})[_0x69e8('0x9')](function(){console[_0x69e8('0xa')](_0x69e8('0xb'),_0x69e8('0xc'));return db[_0x69e8('0xd')][_0x69e8('0x7')]({'where':{}});})[_0x69e8('0x9')](function(){return db[_0x69e8('0xd')]['bulkCreate'](hopper);})[_0x69e8('0x9')](function(){console['log'](_0x69e8('0xb'),_0x69e8('0xe'));return db[_0x69e8('0x6')][_0x69e8('0x8')](contacts2);})[_0x69e8('0x9')](function(){console['log'](_0x69e8('0xb'),_0x69e8('0xf'));return db[_0x69e8('0xd')][_0x69e8('0x8')](hopper2);})[_0x69e8('0x9')](function(){console[_0x69e8('0xa')](_0x69e8('0xb'),_0x69e8('0x10'));})[_0x69e8('0x11')](function(_0x3035b4){console['log'](_0x3035b4);});
\ No newline at end of file
index 6df1ffa..1a324d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd439=['format','%s%s@xcally.com','password','friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','catch','log','util','push','%s%s','agent'];(function(_0x4c3afd,_0x3e7a45){var _0x4e2ef3=function(_0x426053){while(--_0x426053){_0x4c3afd['push'](_0x4c3afd['shift']());}};_0x4e2ef3(++_0x3e7a45);}(_0xd439,0x1f0));var _0x9d43=function(_0x5de023,_0x2c7cef){_0x5de023=_0x5de023-0x0;var _0xf2ef13=_0xd439[_0x5de023];return _0xf2ef13;};'use strict';var util=require(_0x9d43('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9d43('0x1')]({'name':util['format'](_0x9d43('0x2'),_0x9d43('0x3'),i),'fullname':util[_0x9d43('0x4')](_0x9d43('0x2'),'agent',i),'email':util[_0x9d43('0x4')](_0x9d43('0x5'),_0x9d43('0x3'),i),'role':_0x9d43('0x3'),'password':_0x9d43('0x6'),'internal':0xfa0+i,'type':_0x9d43('0x7'),'transport':[_0x9d43('0x8'),'ws','wss'],'disallow':[_0x9d43('0x9')],'allow':[_0x9d43('0xa')],'defaultuser':util[_0x9d43('0x4')](_0x9d43('0x2'),'agent',i),'encryption':_0x9d43('0xb'),'avpf':_0x9d43('0xb'),'force_avp':_0x9d43('0xb'),'icesupport':_0x9d43('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x9d43('0xc'),'dtlsprivatekey':_0x9d43('0xd'),'dtlssetup':_0x9d43('0xe'),'callerid':util[_0x9d43('0x4')](_0x9d43('0xf'),util[_0x9d43('0x4')](_0x9d43('0x2'),_0x9d43('0x3'),i),0xfa0+i)});}db['User'][_0x9d43('0x10')](users)[_0x9d43('0x11')](function(){console['log']('add\x20user');})[_0x9d43('0x12')](function(_0x437365){console[_0x9d43('0x13')](_0x437365);});
\ No newline at end of file
+var _0x3511=['\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3511,0x84));var _0x1351=function(_0x2e9ded,_0x235e2b){_0x2e9ded=_0x2e9ded-0x0;var _0xc88a61=_0x3511[_0x2e9ded];return _0xc88a61;};'use strict';var util=require(_0x1351('0x0'));var db=require(_0x1351('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x1351('0x2')]({'name':util[_0x1351('0x3')](_0x1351('0x4'),_0x1351('0x5'),i),'fullname':util['format']('%s%s','agent',i),'email':util[_0x1351('0x3')](_0x1351('0x6'),'agent',i),'role':_0x1351('0x5'),'password':_0x1351('0x7'),'internal':0xfa0+i,'type':_0x1351('0x8'),'transport':[_0x1351('0x9'),'ws','wss'],'disallow':[_0x1351('0xa')],'allow':[_0x1351('0xb')],'defaultuser':util['format']('%s%s',_0x1351('0x5'),i),'encryption':_0x1351('0xc'),'avpf':_0x1351('0xc'),'force_avp':'yes','icesupport':'yes','dtlsenable':_0x1351('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x1351('0xd'),'dtlssetup':_0x1351('0xe'),'callerid':util[_0x1351('0x3')](_0x1351('0xf'),util[_0x1351('0x3')]('%s%s',_0x1351('0x5'),i),0xfa0+i)});}db['User'][_0x1351('0x10')](users)[_0x1351('0x11')](function(){console[_0x1351('0x12')](_0x1351('0x13'));})[_0x1351('0x14')](function(_0x95ec25){console[_0x1351('0x12')](_0x95ec25);});
\ No newline at end of file
index cd06d0e..197769c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf087=['voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','voice:inbound','SmsQueues','Telephones','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','join','default','address','connection','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','name','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','Campaign','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin'];(function(_0x31ca1f,_0x2f5d14){var _0x3680d6=function(_0x464504){while(--_0x464504){_0x31ca1f['push'](_0x31ca1f['shift']());}};_0x3680d6(++_0x2f5d14);}(_0xf087,0x101));var _0x7f08=function(_0x341cf5,_0x106625){_0x341cf5=_0x341cf5-0x0;var _0x300383=_0xf087[_0x341cf5];return _0x300383;};'use strict';var _=require(_0x7f08('0x0'));var util=require(_0x7f08('0x1'));var BPromise=require(_0x7f08('0x2'));var db=require(_0x7f08('0x3'))['db'];var config=require(_0x7f08('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x7f08('0x5'),'model':db['User'],'attributes':['id',_0x7f08('0x6'),_0x7f08('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x7f08('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x7f08('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x7f08('0xa')],'where':{'type':_0x7f08('0xb')}};function getAssociatedResources(_0x19140b,_0x26884a,_0x521375){return db[_0x7f08('0xc')][_0x7f08('0xd')]({'where':{'name':_0x19140b,'userProfileId':_0x26884a},'raw':!![]})[_0x7f08('0xe')](function(_0x131f19){if(_0x131f19){if(_0x131f19[_0x7f08('0xf')]){switch(_0x19140b){case _0x7f08('0x10'):case _0x7f08('0x11'):case _0x7f08('0x12'):case'SmsQueues':case _0x7f08('0x13'):case _0x7f08('0x14'):case _0x7f08('0x15'):return db[_0x521375][_0x7f08('0x16')](queryQueues);case'Telephones':return db[_0x521375][_0x7f08('0x16')](queryTelephones);case _0x7f08('0x17'):return db[_0x521375]['findAll'](queryTrunks);case _0x7f08('0x18'):return db[_0x521375][_0x7f08('0x16')](queryCampaigns);}}else{return db[_0x7f08('0x19')][_0x7f08('0x16')]({'attributes':[_0x7f08('0x1a')],'where':{'sectionId':_0x131f19['id']},'raw':!![]})[_0x7f08('0xe')](function(_0x2cb77b){if(_0x2cb77b){var _0x3bd864={'where':{'id':_[_0x7f08('0x1b')](_0x2cb77b,'resourceId')},'raw':!![]};switch(_0x521375){case _0x7f08('0x1c'):_0x3bd864[_0x7f08('0x1d')][_0x7f08('0x7')]=_0x7f08('0x8');break;case _0x7f08('0x1e'):_0x3bd864[_0x7f08('0x1d')][_0x7f08('0xa')]='ivr';break;}return db[_0x521375][_0x7f08('0x16')](_0x3bd864);}else{return[];}});}}else{return[];}})[_0x7f08('0xe')](function(_0x2524f2){return _0x2524f2;});}function joinOrLeaveQueues(_0xecbae3,_0x35a0e9,_0xf77056,_0x489aee){_0xecbae3[_0x35a0e9](util[_0x7f08('0x1f')](_0x7f08('0x20'),_0xf77056,_0x489aee['name']));if(_0x489aee['Agents']){for(var _0x4bc2bc=0x0;_0x4bc2bc<_0x489aee[_0x7f08('0x5')][_0x7f08('0x21')];_0x4bc2bc+=0x1){_0xecbae3[_0x35a0e9](util['format'](_0x7f08('0x22'),_0x489aee[_0x7f08('0x5')][_0x4bc2bc][_0x7f08('0x6')]));}}}function joinOrLeave(_0x4b579d,_0xb78149,_0x3e6dfa){var _0x37ffff;if(_0x4b579d[_0x7f08('0x23')][_0x7f08('0x24')]['id']){db['User'][_0x7f08('0x25')]({'attributes':['id','name',_0x7f08('0x7'),_0x7f08('0x26')],'where':{'id':_0x4b579d[_0x7f08('0x23')][_0x7f08('0x24')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7f08('0x27')],'as':_0x7f08('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f08('0x29')],'as':_0x7f08('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f08('0x2b')],'as':_0x7f08('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f08('0x2d')],'as':_0x7f08('0x2e'),'attributes':['id'],'raw':!![]},{'model':db[_0x7f08('0x2f')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x7f08('0xe')](function(_0x3a409a){if(_0x3a409a){_0x37ffff=_0x3a409a;_0x4b579d[_0xb78149](util[_0x7f08('0x1f')](_0x7f08('0x22'),_0x3a409a[_0x7f08('0x6')]));var _0x4fd73e=[];switch(_0x3a409a[_0x7f08('0x7')]){case _0x7f08('0x30'):_0x4b579d[_0xb78149]('voice:inbound');_0x4b579d[_0xb78149](_0x7f08('0x31'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x7f08('0x32')];}_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x34')][_0x7f08('0x16')](queryQueues));_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x35')][_0x7f08('0x16')](queryQueues));_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x36')]['findAll'](queryQueues));_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x37')][_0x7f08('0x16')](queryQueues));_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x38')][_0x7f08('0x16')](queryQueues));_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x39')][_0x7f08('0x16')](queryQueues));_0x4fd73e[_0x7f08('0x33')](db['WhatsappQueue'][_0x7f08('0x16')](queryQueues));_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x1c')][_0x7f08('0x16')](queryTelephones));_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x3a')]['findAll'](queryTrunks));_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x1e')][_0x7f08('0x16')](queryCampaigns));_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x1c')][_0x7f08('0x16')](queryAgents));break;case _0x7f08('0x3b'):_0x4b579d[_0xb78149](_0x7f08('0x3c'));_0x4b579d[_0xb78149](_0x7f08('0x31'));_0x4fd73e[_0x7f08('0x33')](getAssociatedResources('VoiceQueues',_0x3a409a['userProfileId'],_0x7f08('0x34')));_0x4fd73e[_0x7f08('0x33')](getAssociatedResources('ChatQueues',_0x3a409a[_0x7f08('0x26')],'ChatQueue'));_0x4fd73e[_0x7f08('0x33')](getAssociatedResources(_0x7f08('0x12'),_0x3a409a[_0x7f08('0x26')],'FaxQueue'));_0x4fd73e[_0x7f08('0x33')](getAssociatedResources(_0x7f08('0x3d'),_0x3a409a[_0x7f08('0x26')],_0x7f08('0x37')));_0x4fd73e[_0x7f08('0x33')](getAssociatedResources(_0x7f08('0x13'),_0x3a409a[_0x7f08('0x26')],_0x7f08('0x38')));_0x4fd73e[_0x7f08('0x33')](getAssociatedResources(_0x7f08('0x14'),_0x3a409a['userProfileId'],_0x7f08('0x39')));_0x4fd73e['push'](getAssociatedResources('WhatsappQueues',_0x3a409a[_0x7f08('0x26')],'WhatsappQueue'));_0x4fd73e[_0x7f08('0x33')](getAssociatedResources(_0x7f08('0x3e'),_0x3a409a[_0x7f08('0x26')],_0x7f08('0x1c')));_0x4fd73e[_0x7f08('0x33')](getAssociatedResources('Trunks',_0x3a409a[_0x7f08('0x26')],'Trunk'));_0x4fd73e[_0x7f08('0x33')](getAssociatedResources(_0x7f08('0x18'),_0x3a409a[_0x7f08('0x26')],_0x7f08('0x1e')));_0x4fd73e[_0x7f08('0x33')](db[_0x7f08('0x1c')]['findAll'](queryAgents));break;case _0x7f08('0x9'):_0x4b579d[_0xb78149](_0x7f08('0x3c'));_0x4b579d[_0xb78149]('voice:outbound');_0x4fd73e['push'](_0x3a409a[_0x7f08('0x3f')]({'attributes':['id',_0x7f08('0x6')]}));_0x4fd73e[_0x7f08('0x33')](_0x3a409a[_0x7f08('0x40')]({'attributes':['id',_0x7f08('0x6')]}));_0x4fd73e[_0x7f08('0x33')](_0x3a409a['getFaxQueues']({'attributes':['id','name']}));_0x4fd73e[_0x7f08('0x33')](_0x3a409a[_0x7f08('0x41')]({'attributes':['id',_0x7f08('0x6')]}));_0x4fd73e[_0x7f08('0x33')](_0x3a409a[_0x7f08('0x42')]({'attributes':['id',_0x7f08('0x6')]}));_0x4fd73e[_0x7f08('0x33')](_0x3a409a[_0x7f08('0x43')]({'attributes':['id',_0x7f08('0x6')]}));_0x4fd73e['push'](_0x3a409a[_0x7f08('0x44')]({'attributes':['id',_0x7f08('0x6')]}));break;}return BPromise[_0x7f08('0x45')](_0x4fd73e);}})[_0x7f08('0xe')](function(_0x4b2efd){if(_0x4b2efd&&_0x4b2efd[_0x7f08('0x21')]){for(var _0x2d7f0e=0x0;_0x2d7f0e<_0x4b2efd[_0x7f08('0x21')];_0x2d7f0e+=0x1){for(var _0x2a5946=0x0;_0x2a5946<_0x4b2efd[_0x2d7f0e][_0x7f08('0x21')];_0x2a5946+=0x1){switch(_0x2d7f0e){case 0x0:joinOrLeaveQueues(_0x4b579d,_0xb78149,'voice',_0x4b2efd[_0x2d7f0e][_0x2a5946]);break;case 0x1:joinOrLeaveQueues(_0x4b579d,_0xb78149,_0x7f08('0x46'),_0x4b2efd[_0x2d7f0e][_0x2a5946]);break;case 0x2:joinOrLeaveQueues(_0x4b579d,_0xb78149,_0x7f08('0x47'),_0x4b2efd[_0x2d7f0e][_0x2a5946]);break;case 0x3:joinOrLeaveQueues(_0x4b579d,_0xb78149,'sms',_0x4b2efd[_0x2d7f0e][_0x2a5946]);break;case 0x4:joinOrLeaveQueues(_0x4b579d,_0xb78149,_0x7f08('0x48'),_0x4b2efd[_0x2d7f0e][_0x2a5946]);break;case 0x5:joinOrLeaveQueues(_0x4b579d,_0xb78149,_0x7f08('0x49'),_0x4b2efd[_0x2d7f0e][_0x2a5946]);break;case 0x6:joinOrLeaveQueues(_0x4b579d,_0xb78149,_0x7f08('0x4a'),_0x4b2efd[_0x2d7f0e][_0x2a5946]);break;case 0x7:if(_0x37ffff[_0x7f08('0x7')]!==_0x7f08('0x9'))_0x4b579d[_0xb78149](util[_0x7f08('0x1f')](_0x7f08('0x4b'),_0x4b2efd[_0x2d7f0e][_0x2a5946]['name']));break;case 0x8:if(_0x37ffff[_0x7f08('0x7')]!==_0x7f08('0x9'))_0x4b579d[_0xb78149](util[_0x7f08('0x1f')](_0x7f08('0x4c'),_0x4b2efd[_0x2d7f0e][_0x2a5946][_0x7f08('0x6')]));break;case 0x9:if(_0x37ffff[_0x7f08('0x7')]!==_0x7f08('0x9'))_0x4b579d[_0xb78149](util['format']('campaign:%s:%s',_0x4b2efd[_0x2d7f0e][_0x2a5946][_0x7f08('0xa')],_0x4b2efd[_0x2d7f0e][_0x2a5946][_0x7f08('0x6')]));break;case 0xa:_0x4b579d[_0xb78149](util[_0x7f08('0x1f')](_0x7f08('0x22'),_0x4b2efd[_0x2d7f0e][_0x2a5946][_0x7f08('0x6')]));break;}}}}})['then'](function(){if(_0xb78149===_0x7f08('0x4d')){var _0x25fa23=_['map'](_0x37ffff[_0x7f08('0x4e')],'id');return _0x37ffff[_0x7f08('0x4f')](_0x25fa23)['then'](function(){for(var _0x394b35=0x0;_0x394b35<_0x25fa23[_0x7f08('0x21')];_0x394b35+=0x1){_0x3e6dfa[_0x7f08('0x50')](_0x7f08('0x51'),{'ChatInteractionId':Number(_0x25fa23[_0x394b35]),'UserId':Number(_0x37ffff['id'])});}});}})[_0x7f08('0xe')](function(){if(_0xb78149===_0x7f08('0x4d')){var _0x56ba1e=_[_0x7f08('0x1b')](_0x37ffff[_0x7f08('0x28')],'id');return _0x37ffff['removeMailInteractions'](_0x56ba1e)[_0x7f08('0xe')](function(){for(var _0x877f57=0x0;_0x877f57<_0x56ba1e[_0x7f08('0x21')];_0x877f57+=0x1){_0x3e6dfa['emit'](_0x7f08('0x52'),{'MailInteractionId':Number(_0x56ba1e[_0x877f57]),'UserId':Number(_0x37ffff['id'])});}});}})[_0x7f08('0xe')](function(){if(_0xb78149===_0x7f08('0x4d')){var _0x2263eb=_['map'](_0x37ffff[_0x7f08('0x2a')],'id');return _0x37ffff['removeFaxInteractions'](_0x2263eb)[_0x7f08('0xe')](function(){for(var _0x455348=0x0;_0x455348<_0x2263eb['length'];_0x455348+=0x1){_0x3e6dfa[_0x7f08('0x50')](_0x7f08('0x53'),{'FaxInteractionId':Number(_0x2263eb[_0x455348]),'UserId':Number(_0x37ffff['id'])});}});}})[_0x7f08('0xe')](function(){if(_0xb78149===_0x7f08('0x4d')){var _0x1561e2=_[_0x7f08('0x1b')](_0x37ffff[_0x7f08('0x2c')],'id');return _0x37ffff[_0x7f08('0x54')](_0x1561e2)[_0x7f08('0xe')](function(){for(var _0x47ff9b=0x0;_0x47ff9b<_0x1561e2[_0x7f08('0x21')];_0x47ff9b+=0x1){_0x3e6dfa[_0x7f08('0x50')](_0x7f08('0x55'),{'SmsInteractionId':Number(_0x1561e2[_0x47ff9b]),'UserId':Number(_0x37ffff['id'])});}});}})['then'](function(){if(_0xb78149==='leave'){var _0x4dce9c=_[_0x7f08('0x1b')](_0x37ffff[_0x7f08('0x2e')],'id');return _0x37ffff[_0x7f08('0x56')](_0x4dce9c)[_0x7f08('0xe')](function(){for(var _0x4439df=0x0;_0x4439df<_0x4dce9c[_0x7f08('0x21')];_0x4439df+=0x1){_0x3e6dfa[_0x7f08('0x50')](_0x7f08('0x57'),{'OpenchannelInteractionId':Number(_0x4dce9c[_0x4439df]),'UserId':Number(_0x37ffff['id'])});}});}})[_0x7f08('0xe')](function(){if(_0xb78149===_0x7f08('0x4d')){var _0x6271a6=_['map'](_0x37ffff['WhatsappInteractions'],'id');return _0x37ffff[_0x7f08('0x58')](_0x6271a6)[_0x7f08('0xe')](function(){for(var _0x62e71e=0x0;_0x62e71e<_0x6271a6[_0x7f08('0x21')];_0x62e71e+=0x1){_0x3e6dfa['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x6271a6[_0x62e71e]),'UserId':Number(_0x37ffff['id'])});}});}})[_0x7f08('0x59')](function(_0x35b567){_0x4b579d['log'](_0x35b567);});}}function onDisconnect(_0x426351,_0x260081){joinOrLeave(_0x426351,_0x7f08('0x4d'),_0x260081);}function onConnect(_0x5abc1d){joinOrLeave(_0x5abc1d,_0x7f08('0x5a'));}exports[_0x7f08('0x5b')]=function(_0xcf15de){_0xcf15de['on']('connection',function(_0x4cfa86){_0x4cfa86['setMaxListeners'](0x0);_0x4cfa86[_0x7f08('0x5c')]=_0x4cfa86['request'][_0x7f08('0x5d')][_0x7f08('0x5e')]+':'+_0x4cfa86['request'][_0x7f08('0x5d')][_0x7f08('0x5f')];_0x4cfa86[_0x7f08('0x60')]=new Date();_0x4cfa86[_0x7f08('0x61')]=function(_0x22a64c){console[_0x7f08('0x61')](_0x7f08('0x62')+_0x4cfa86[_0x7f08('0x63')][_0x7f08('0x6')]+'['+_0x4cfa86['address']+']',_0x22a64c);};_0x4cfa86['on'](_0x7f08('0x64'),function(){onDisconnect(_0x4cfa86,_0xcf15de);_0x4cfa86[_0x7f08('0x61')]('DISCONNECTED');});onConnect(_0x4cfa86);_0x4cfa86[_0x7f08('0x61')](_0x7f08('0x65'));});};
\ No newline at end of file
+var _0x199c=['agent','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','Campaign','where','format','%s:queue:%s','length','user:%s','query','handshake','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteraction','admin','voice:outbound','hasOwnProperty','include','push','ChatQueue','MailQueue','WhatsappQueue','Trunk','user','voice:inbound','userProfileId','VoiceQueue','SmsQueues','SmsQueue','OpenchannelQueue','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','chat','fax','sms','mail','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone'];(function(_0x3667de,_0x12795a){var _0x52b985=function(_0x153bf5){while(--_0x153bf5){_0x3667de['push'](_0x3667de['shift']());}};_0x52b985(++_0x12795a);}(_0x199c,0x1d8));var _0xc199=function(_0x537887,_0x11c484){_0x537887=_0x537887-0x0;var _0x3707ad=_0x199c[_0x537887];return _0x3707ad;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xc199('0x0'));var db=require(_0xc199('0x1'))['db'];var config=require(_0xc199('0x2'));var queryQueues={'attributes':['id',_0xc199('0x3')],'include':[{'as':_0xc199('0x4'),'model':db[_0xc199('0x5')],'attributes':['id',_0xc199('0x3'),_0xc199('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc199('0x3')],'where':{'role':_0xc199('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xc199('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xc199('0x3'),_0xc199('0x9')],'where':{'type':_0xc199('0xa')}};function getAssociatedResources(_0x157717,_0x171ac1,_0x211733){return db[_0xc199('0xb')]['findOne']({'where':{'name':_0x157717,'userProfileId':_0x171ac1},'raw':!![]})[_0xc199('0xc')](function(_0x20a57d){if(_0x20a57d){if(_0x20a57d[_0xc199('0xd')]){switch(_0x157717){case _0xc199('0xe'):case _0xc199('0xf'):case _0xc199('0x10'):case'SmsQueues':case _0xc199('0x11'):case _0xc199('0x12'):case _0xc199('0x13'):return db[_0x211733][_0xc199('0x14')](queryQueues);case _0xc199('0x15'):return db[_0x211733]['findAll'](queryTelephones);case _0xc199('0x16'):return db[_0x211733][_0xc199('0x14')](queryTrunks);case _0xc199('0x17'):return db[_0x211733][_0xc199('0x14')](queryCampaigns);}}else{return db[_0xc199('0x18')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x20a57d['id']},'raw':!![]})[_0xc199('0xc')](function(_0x5a8e99){if(_0x5a8e99){var _0x58d871={'where':{'id':_[_0xc199('0x19')](_0x5a8e99,'resourceId')},'raw':!![]};switch(_0x211733){case _0xc199('0x5'):_0x58d871['where'][_0xc199('0x6')]=_0xc199('0x7');break;case _0xc199('0x1a'):_0x58d871[_0xc199('0x1b')][_0xc199('0x9')]=_0xc199('0xa');break;}return db[_0x211733][_0xc199('0x14')](_0x58d871);}else{return[];}});}}else{return[];}})[_0xc199('0xc')](function(_0x2c953f){return _0x2c953f;});}function joinOrLeaveQueues(_0x14e969,_0x153098,_0x54babd,_0x17e150){_0x14e969[_0x153098](util[_0xc199('0x1c')](_0xc199('0x1d'),_0x54babd,_0x17e150[_0xc199('0x3')]));if(_0x17e150['Agents']){for(var _0x32e300=0x0;_0x32e300<_0x17e150[_0xc199('0x4')][_0xc199('0x1e')];_0x32e300+=0x1){_0x14e969[_0x153098](util[_0xc199('0x1c')](_0xc199('0x1f'),_0x17e150[_0xc199('0x4')][_0x32e300]['name']));}}}function joinOrLeave(_0x51d1f1,_0x16f03f,_0x5112c4){var _0x30f576;if(_0x51d1f1['handshake'][_0xc199('0x20')]['id']){db[_0xc199('0x5')]['find']({'attributes':['id',_0xc199('0x3'),_0xc199('0x6'),'userProfileId'],'where':{'id':_0x51d1f1[_0xc199('0x21')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0xc199('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xc199('0x23')],'as':_0xc199('0x24'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xc199('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xc199('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc199('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc199('0x28')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xc199('0xc')](function(_0x13e53e){if(_0x13e53e){_0x30f576=_0x13e53e;_0x51d1f1[_0x16f03f](util[_0xc199('0x1c')](_0xc199('0x1f'),_0x13e53e[_0xc199('0x3')]));var _0x1a3e7c=[];switch(_0x13e53e[_0xc199('0x6')]){case _0xc199('0x29'):_0x51d1f1[_0x16f03f]('voice:inbound');_0x51d1f1[_0x16f03f](_0xc199('0x2a'));if(queryQueues[_0xc199('0x2b')](_0xc199('0x2c'))){delete queryQueues['include'];}_0x1a3e7c[_0xc199('0x2d')](db['VoiceQueue']['findAll'](queryQueues));_0x1a3e7c[_0xc199('0x2d')](db[_0xc199('0x2e')]['findAll'](queryQueues));_0x1a3e7c[_0xc199('0x2d')](db['FaxQueue']['findAll'](queryQueues));_0x1a3e7c[_0xc199('0x2d')](db['SmsQueue'][_0xc199('0x14')](queryQueues));_0x1a3e7c[_0xc199('0x2d')](db[_0xc199('0x2f')][_0xc199('0x14')](queryQueues));_0x1a3e7c[_0xc199('0x2d')](db['OpenchannelQueue']['findAll'](queryQueues));_0x1a3e7c['push'](db[_0xc199('0x30')]['findAll'](queryQueues));_0x1a3e7c[_0xc199('0x2d')](db[_0xc199('0x5')][_0xc199('0x14')](queryTelephones));_0x1a3e7c[_0xc199('0x2d')](db[_0xc199('0x31')][_0xc199('0x14')](queryTrunks));_0x1a3e7c[_0xc199('0x2d')](db[_0xc199('0x1a')][_0xc199('0x14')](queryCampaigns));_0x1a3e7c[_0xc199('0x2d')](db['User']['findAll'](queryAgents));break;case _0xc199('0x32'):_0x51d1f1[_0x16f03f](_0xc199('0x33'));_0x51d1f1[_0x16f03f](_0xc199('0x2a'));_0x1a3e7c[_0xc199('0x2d')](getAssociatedResources(_0xc199('0xe'),_0x13e53e[_0xc199('0x34')],_0xc199('0x35')));_0x1a3e7c[_0xc199('0x2d')](getAssociatedResources('ChatQueues',_0x13e53e['userProfileId'],'ChatQueue'));_0x1a3e7c[_0xc199('0x2d')](getAssociatedResources(_0xc199('0x10'),_0x13e53e[_0xc199('0x34')],'FaxQueue'));_0x1a3e7c[_0xc199('0x2d')](getAssociatedResources(_0xc199('0x36'),_0x13e53e['userProfileId'],_0xc199('0x37')));_0x1a3e7c[_0xc199('0x2d')](getAssociatedResources(_0xc199('0x11'),_0x13e53e[_0xc199('0x34')],'MailQueue'));_0x1a3e7c[_0xc199('0x2d')](getAssociatedResources(_0xc199('0x12'),_0x13e53e[_0xc199('0x34')],_0xc199('0x38')));_0x1a3e7c[_0xc199('0x2d')](getAssociatedResources(_0xc199('0x13'),_0x13e53e[_0xc199('0x34')],'WhatsappQueue'));_0x1a3e7c['push'](getAssociatedResources('Telephones',_0x13e53e[_0xc199('0x34')],_0xc199('0x5')));_0x1a3e7c[_0xc199('0x2d')](getAssociatedResources(_0xc199('0x16'),_0x13e53e[_0xc199('0x34')],'Trunk'));_0x1a3e7c['push'](getAssociatedResources(_0xc199('0x17'),_0x13e53e[_0xc199('0x34')],'Campaign'));_0x1a3e7c['push'](db[_0xc199('0x5')][_0xc199('0x14')](queryAgents));break;case'agent':_0x51d1f1[_0x16f03f](_0xc199('0x33'));_0x51d1f1[_0x16f03f](_0xc199('0x2a'));_0x1a3e7c['push'](_0x13e53e[_0xc199('0x39')]({'attributes':['id',_0xc199('0x3')]}));_0x1a3e7c[_0xc199('0x2d')](_0x13e53e['getChatQueues']({'attributes':['id',_0xc199('0x3')]}));_0x1a3e7c[_0xc199('0x2d')](_0x13e53e[_0xc199('0x3a')]({'attributes':['id','name']}));_0x1a3e7c[_0xc199('0x2d')](_0x13e53e[_0xc199('0x3b')]({'attributes':['id',_0xc199('0x3')]}));_0x1a3e7c['push'](_0x13e53e[_0xc199('0x3c')]({'attributes':['id',_0xc199('0x3')]}));_0x1a3e7c['push'](_0x13e53e[_0xc199('0x3d')]({'attributes':['id',_0xc199('0x3')]}));_0x1a3e7c[_0xc199('0x2d')](_0x13e53e['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0xc199('0x3e')](_0x1a3e7c);}})[_0xc199('0xc')](function(_0x54c0a8){if(_0x54c0a8&&_0x54c0a8[_0xc199('0x1e')]){for(var _0x157127=0x0;_0x157127<_0x54c0a8['length'];_0x157127+=0x1){for(var _0x1971f2=0x0;_0x1971f2<_0x54c0a8[_0x157127][_0xc199('0x1e')];_0x1971f2+=0x1){switch(_0x157127){case 0x0:joinOrLeaveQueues(_0x51d1f1,_0x16f03f,'voice',_0x54c0a8[_0x157127][_0x1971f2]);break;case 0x1:joinOrLeaveQueues(_0x51d1f1,_0x16f03f,_0xc199('0x3f'),_0x54c0a8[_0x157127][_0x1971f2]);break;case 0x2:joinOrLeaveQueues(_0x51d1f1,_0x16f03f,_0xc199('0x40'),_0x54c0a8[_0x157127][_0x1971f2]);break;case 0x3:joinOrLeaveQueues(_0x51d1f1,_0x16f03f,_0xc199('0x41'),_0x54c0a8[_0x157127][_0x1971f2]);break;case 0x4:joinOrLeaveQueues(_0x51d1f1,_0x16f03f,_0xc199('0x42'),_0x54c0a8[_0x157127][_0x1971f2]);break;case 0x5:joinOrLeaveQueues(_0x51d1f1,_0x16f03f,'openchannel',_0x54c0a8[_0x157127][_0x1971f2]);break;case 0x6:joinOrLeaveQueues(_0x51d1f1,_0x16f03f,_0xc199('0x43'),_0x54c0a8[_0x157127][_0x1971f2]);break;case 0x7:if(_0x30f576[_0xc199('0x6')]!==_0xc199('0x8'))_0x51d1f1[_0x16f03f](util[_0xc199('0x1c')]('telephone:%s',_0x54c0a8[_0x157127][_0x1971f2][_0xc199('0x3')]));break;case 0x8:if(_0x30f576['role']!=='agent')_0x51d1f1[_0x16f03f](util[_0xc199('0x1c')](_0xc199('0x44'),_0x54c0a8[_0x157127][_0x1971f2][_0xc199('0x3')]));break;case 0x9:if(_0x30f576[_0xc199('0x6')]!==_0xc199('0x8'))_0x51d1f1[_0x16f03f](util[_0xc199('0x1c')](_0xc199('0x45'),_0x54c0a8[_0x157127][_0x1971f2][_0xc199('0x9')],_0x54c0a8[_0x157127][_0x1971f2]['name']));break;case 0xa:_0x51d1f1[_0x16f03f](util['format'](_0xc199('0x1f'),_0x54c0a8[_0x157127][_0x1971f2][_0xc199('0x3')]));break;}}}}})[_0xc199('0xc')](function(){if(_0x16f03f===_0xc199('0x46')){var _0x348ecc=_[_0xc199('0x19')](_0x30f576[_0xc199('0x22')],'id');return _0x30f576[_0xc199('0x47')](_0x348ecc)[_0xc199('0xc')](function(){for(var _0x3966fc=0x0;_0x3966fc<_0x348ecc[_0xc199('0x1e')];_0x3966fc+=0x1){_0x5112c4[_0xc199('0x48')](_0xc199('0x49'),{'ChatInteractionId':Number(_0x348ecc[_0x3966fc]),'UserId':Number(_0x30f576['id'])});}});}})[_0xc199('0xc')](function(){if(_0x16f03f===_0xc199('0x46')){var _0x4573e2=_[_0xc199('0x19')](_0x30f576[_0xc199('0x24')],'id');return _0x30f576[_0xc199('0x4a')](_0x4573e2)[_0xc199('0xc')](function(){for(var _0x56edcd=0x0;_0x56edcd<_0x4573e2[_0xc199('0x1e')];_0x56edcd+=0x1){_0x5112c4['emit'](_0xc199('0x4b'),{'MailInteractionId':Number(_0x4573e2[_0x56edcd]),'UserId':Number(_0x30f576['id'])});}});}})[_0xc199('0xc')](function(){if(_0x16f03f==='leave'){var _0x2b9e1a=_[_0xc199('0x19')](_0x30f576['FaxInteractions'],'id');return _0x30f576[_0xc199('0x4c')](_0x2b9e1a)[_0xc199('0xc')](function(){for(var _0x1442ad=0x0;_0x1442ad<_0x2b9e1a[_0xc199('0x1e')];_0x1442ad+=0x1){_0x5112c4['emit'](_0xc199('0x4d'),{'FaxInteractionId':Number(_0x2b9e1a[_0x1442ad]),'UserId':Number(_0x30f576['id'])});}});}})[_0xc199('0xc')](function(){if(_0x16f03f===_0xc199('0x46')){var _0x4cd202=_['map'](_0x30f576['SmsInteractions'],'id');return _0x30f576['removeSmsInteractions'](_0x4cd202)[_0xc199('0xc')](function(){for(var _0x1335ba=0x0;_0x1335ba<_0x4cd202[_0xc199('0x1e')];_0x1335ba+=0x1){_0x5112c4[_0xc199('0x48')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x4cd202[_0x1335ba]),'UserId':Number(_0x30f576['id'])});}});}})[_0xc199('0xc')](function(){if(_0x16f03f===_0xc199('0x46')){var _0xfe3054=_[_0xc199('0x19')](_0x30f576['OpenchannelInteractions'],'id');return _0x30f576[_0xc199('0x4e')](_0xfe3054)[_0xc199('0xc')](function(){for(var _0x40e510=0x0;_0x40e510<_0xfe3054[_0xc199('0x1e')];_0x40e510+=0x1){_0x5112c4[_0xc199('0x48')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xfe3054[_0x40e510]),'UserId':Number(_0x30f576['id'])});}});}})['then'](function(){if(_0x16f03f===_0xc199('0x46')){var _0x153509=_[_0xc199('0x19')](_0x30f576[_0xc199('0x4f')],'id');return _0x30f576[_0xc199('0x50')](_0x153509)[_0xc199('0xc')](function(){for(var _0x46ca47=0x0;_0x46ca47<_0x153509[_0xc199('0x1e')];_0x46ca47+=0x1){_0x5112c4[_0xc199('0x48')](_0xc199('0x51'),{'WhatsappInteractionId':Number(_0x153509[_0x46ca47]),'UserId':Number(_0x30f576['id'])});}});}})['catch'](function(_0x56ad5c){_0x51d1f1[_0xc199('0x52')](_0x56ad5c);});}}function onDisconnect(_0x5f19b3,_0x5aa803){joinOrLeave(_0x5f19b3,'leave',_0x5aa803);}function onConnect(_0x418610){joinOrLeave(_0x418610,_0xc199('0x53'));}exports[_0xc199('0x54')]=function(_0x50885b){_0x50885b['on'](_0xc199('0x55'),function(_0x58e4a3){_0x58e4a3[_0xc199('0x56')](0x0);_0x58e4a3[_0xc199('0x57')]=_0x58e4a3[_0xc199('0x58')]['connection'][_0xc199('0x59')]+':'+_0x58e4a3[_0xc199('0x58')][_0xc199('0x55')][_0xc199('0x5a')];_0x58e4a3[_0xc199('0x5b')]=new Date();_0x58e4a3[_0xc199('0x52')]=function(_0x50ac56){console['log'](_0xc199('0x5c')+_0x58e4a3['nsp'][_0xc199('0x3')]+'['+_0x58e4a3[_0xc199('0x57')]+']',_0x50ac56);};_0x58e4a3['on'](_0xc199('0x5d'),function(){onDisconnect(_0x58e4a3,_0x50885b);_0x58e4a3[_0xc199('0x52')](_0xc199('0x5e'));});onConnect(_0x58e4a3);_0x58e4a3[_0xc199('0x52')](_0xc199('0x5f'));});};
\ No newline at end of file
index aaae99f..af2f139 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe483=['ChatMessage','afterCreate','newmessage','ChatOfflineMessage','SmsInteraction','closedinteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s','catch','channel','event','direction','ContactId','undefined','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','incomingmessage','get','offlineMessage','motionChannel','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','closed','substatus','User','fullname','email','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','newinteraction','Chat','afterUpdate'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xe483,0x15e));var _0x3e48=function(_0x4fbc25,_0x8f20aa){_0x4fbc25=_0x4fbc25-0x0;var _0xc5fd11=_0xe483[_0x4fbc25];return _0xc5fd11;};'use strict';var util=require('util');var db=require(_0x3e48('0x0'))['db'];var jayson=require(_0x3e48('0x1'));var logger=require(_0x3e48('0x2'))(_0x3e48('0x3'));var client=jayson[_0x3e48('0x4')][_0x3e48('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x3e48('0x6'),'event':'afterCreate','condition':_0x3e48('0x7'),'callback':afterCreate},{'channel':_0x3e48('0x8'),'model':'ChatInteraction','event':_0x3e48('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x3e48('0x8'),'model':_0x3e48('0xa'),'event':_0x3e48('0xb'),'condition':_0x3e48('0xc'),'callback':afterCreateMessage},{'channel':_0x3e48('0x8'),'model':_0x3e48('0xd'),'event':_0x3e48('0xb'),'condition':_0x3e48('0xc'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x3e48('0xe'),'event':_0x3e48('0xb'),'condition':_0x3e48('0x7'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0x3e48('0x9'),'condition':_0x3e48('0xf'),'callback':afterUpdate},{'channel':_0x3e48('0x10'),'model':_0x3e48('0x11'),'event':_0x3e48('0xb'),'condition':_0x3e48('0xc'),'callback':afterCreateMessage},{'channel':_0x3e48('0x12'),'model':_0x3e48('0x13'),'event':_0x3e48('0xb'),'condition':_0x3e48('0x7'),'callback':afterCreate},{'channel':_0x3e48('0x12'),'model':_0x3e48('0x13'),'event':_0x3e48('0x9'),'condition':_0x3e48('0xf'),'callback':afterUpdate},{'channel':_0x3e48('0x12'),'model':_0x3e48('0x14'),'event':_0x3e48('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x3e48('0x15'),'model':_0x3e48('0x16'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':_0x3e48('0x9'),'condition':_0x3e48('0xf'),'callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':_0x3e48('0xb'),'condition':_0x3e48('0xc'),'callback':afterCreateMessage},{'channel':_0x3e48('0x17'),'model':'MailInteraction','event':_0x3e48('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x3e48('0x17'),'model':_0x3e48('0x18'),'event':_0x3e48('0x9'),'condition':_0x3e48('0xf'),'callback':afterUpdate},{'channel':_0x3e48('0x17'),'model':'MailMessage','event':'afterCreate','condition':_0x3e48('0xc'),'callback':afterCreateMessage},{'channel':_0x3e48('0x19'),'model':'OpenchannelInteraction','event':'afterCreate','condition':_0x3e48('0x7'),'callback':afterCreate},{'channel':'Openchannel','model':_0x3e48('0x1a'),'event':_0x3e48('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0x3e48('0x1b'),'event':_0x3e48('0xb'),'condition':_0x3e48('0xc'),'callback':afterCreateMessage}];function request(_0x2339b3){return client[_0x3e48('0x1c')](_0x3e48('0x1d'),_0x2339b3)[_0x3e48('0x1e')](function(_0x106fe5){logger[_0x3e48('0x1f')]('Trigger,\x20%s','EventManager',_0x106fe5);if(_0x106fe5['error']){if(_0x106fe5[_0x3e48('0x20')][_0x3e48('0x21')]===0x1f4){logger[_0x3e48('0x20')](_0x3e48('0x22'),_0x3e48('0x1d'),_0x106fe5[_0x3e48('0x20')]);}}})[_0x3e48('0x23')](function(_0x154e2a){logger[_0x3e48('0x20')](_0x3e48('0x22'),'EventManager',_0x154e2a);});}function afterCreateMessage(_0x13b92a){return function(_0x16a8cd){_0x16a8cd=_0x16a8cd['get']({'plain':!![]});_0x16a8cd[_0x3e48('0x24')]=_0x13b92a;_0x16a8cd['motionChannel']=_0x13b92a;_0x16a8cd[_0x3e48('0x25')]=_0x16a8cd[_0x3e48('0x26')];Promise['resolve']()[_0x3e48('0x1e')](function(){if(typeof _0x16a8cd[_0x3e48('0x27')]===_0x3e48('0x28'))return null;var _0xde7cb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x16a8cd[_0x3e48('0x27')];return db[_0x3e48('0x29')][_0x3e48('0x2a')](_0xde7cb,{'type':db[_0x3e48('0x2b')][_0x3e48('0x2c')][_0x3e48('0x2d')],'raw':!![]});})[_0x3e48('0x1e')](function(_0x37f04a){if(_0x37f04a){_0x16a8cd[_0x3e48('0x2e')]=_0x37f04a[0x0];}if(typeof _0x16a8cd['UserId']===_0x3e48('0x28'))return;return getAgent(_0x16a8cd[_0x3e48('0x2f')]);})[_0x3e48('0x1e')](function(_0x5ca1a2){if(_0x5ca1a2){_0x16a8cd[_0x3e48('0x30')]=util[_0x3e48('0x31')](_0x3e48('0x32'),_0x5ca1a2[_0x3e48('0x33')]);_0x16a8cd[_0x3e48('0x34')]=_0x5ca1a2;_0x16a8cd[_0x3e48('0x24')]=_0x13b92a;return request({'event':_0x3e48('0x35'),'message':_0x16a8cd});}else{return request({'event':'outgoingmessage','message':_0x16a8cd});}})[_0x3e48('0x23')](function(_0x3607b5){logger['error']('Trigger,\x20%s','AfterCreateMessage',_0x3607b5);});};}function afterCreateOfflineMessage(_0x3aac25){return function(_0x3ff774){_0x3ff774=_0x3ff774[_0x3e48('0x36')]({'plain':!![]});_0x3ff774['channel']=_0x3aac25;_0x3ff774['motionChannel']=_0x3aac25;_0x3ff774[_0x3e48('0x25')]=_0x3e48('0x37');return request({'event':_0x3ff774[_0x3e48('0x25')],'message':_0x3ff774});};}function afterCreate(_0x345c76,_0x5b3480){return function(_0x164b66){_0x164b66=_0x164b66[_0x3e48('0x36')]({'plain':!![]});_0x164b66['channel']=_0x345c76;_0x164b66[_0x3e48('0x38')]=_0x345c76;_0x164b66[_0x3e48('0x25')]='opened';Promise[_0x3e48('0x39')]()[_0x3e48('0x1e')](function(){var _0x3d9965=_0x3e48('0x3a')+_0x164b66['ContactId'];return db[_0x3e48('0x29')][_0x3e48('0x2a')](_0x3d9965,{'type':db[_0x3e48('0x2b')][_0x3e48('0x2c')][_0x3e48('0x2d')],'raw':!![]});})[_0x3e48('0x1e')](function(_0x5c7943){if(_0x5c7943){_0x164b66[_0x3e48('0x2e')]=_0x5c7943[0x0];}if(typeof _0x164b66[_0x3e48('0x2f')]===_0x3e48('0x28'))return;return getAgent(_0x164b66[_0x3e48('0x2f')]);})[_0x3e48('0x1e')](function(_0x94f72a){if(_0x94f72a){_0x164b66[_0x3e48('0x30')]=util['format'](_0x3e48('0x32'),_0x94f72a[_0x3e48('0x33')]);_0x164b66[_0x3e48('0x34')]=_0x94f72a;}return request({'event':_0x5b3480,'message':_0x164b66});})[_0x3e48('0x23')](function(_0x4c3a64){logger['error'](_0x3e48('0x22'),'AfterCreate',_0x4c3a64);});};}function afterUpdate(_0x39d4f1){return function(_0x3aedc1){var _0x2d86c7=_0x3aedc1['changed'](_0x3e48('0x3b'))&&_0x3aedc1[_0x3e48('0x3b')];var _0x23240d=_0x3aedc1['changed'](_0x3e48('0x3c'));if(_0x2d86c7||_0x23240d){var _0x28291c=_0x2d86c7?_0x3e48('0xf'):_0x3e48('0x3c');var _0x84a78e=_0x3aedc1[_0x3e48('0x36')]({'plain':!![]});_0x84a78e['channel']=_0x39d4f1;_0x84a78e['motionChannel']=_0x39d4f1;_0x84a78e[_0x3e48('0x25')]=_0x2d86c7?_0x3e48('0x3b'):_0x3e48('0x3c');var _0x2fc4eb=_0x3e48('0x3a')+_0x84a78e[_0x3e48('0x27')];return db['sequelize'][_0x3e48('0x2a')](_0x2fc4eb,{'type':db[_0x3e48('0x2b')][_0x3e48('0x2c')][_0x3e48('0x2d')],'raw':!![]})[_0x3e48('0x1e')](function(_0x1cb851){if(_0x1cb851){_0x84a78e['contact']=_0x1cb851[0x0];}if(typeof _0x84a78e[_0x3e48('0x2f')]==='undefined')return;return getAgent(_0x84a78e['UserId']);})[_0x3e48('0x1e')](function(_0x5b858c){if(_0x5b858c){_0x84a78e[_0x3e48('0x30')]=util[_0x3e48('0x31')](_0x3e48('0x32'),_0x5b858c['name']);_0x84a78e[_0x3e48('0x34')]=_0x5b858c;}return request({'event':_0x28291c,'message':_0x84a78e});})[_0x3e48('0x23')](function(_0x2f74ff){logger['error']('Trigger,\x20%s','AfterUpdate',_0x2f74ff);});}};}function getAgent(_0x352775){return db[_0x3e48('0x3d')]['find']({'where':{'id':_0x352775},'attributes':['id','name',_0x3e48('0x3e'),_0x3e48('0x3f'),'internal'],'raw':!![]})['then'](function(_0x2a9ba0){return _0x2a9ba0;});}exports[_0x3e48('0x40')]=function(){for(var _0x47fc4a=0x0;_0x47fc4a<triggers[_0x3e48('0x41')];_0x47fc4a+=0x1){if(db[_0x3e48('0x42')](triggers[_0x47fc4a][_0x3e48('0x43')])){db[triggers[_0x47fc4a][_0x3e48('0x43')]][_0x3e48('0x44')](triggers[_0x47fc4a][_0x3e48('0x25')],triggers[_0x47fc4a][_0x3e48('0x45')](triggers[_0x47fc4a][_0x3e48('0x24')][_0x3e48('0x46')](),triggers[_0x47fc4a][_0x3e48('0x47')]));}}};
\ No newline at end of file
+var _0x54a9=['newmessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','then','info','Trigger,\x20%s','EventManager','error','code','catch','get','motionChannel','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','contact','UserId','undefined','SIP/%s','name','agent','channel','incomingmessage','outgoingmessage','AfterCreateMessage','event','offlineMessage','opened','SELECT','interface','format','AfterCreate','closed','changed','AfterUpdate','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','client','http','Chat','ChatInteraction','newinteraction','closedinteraction','ChatMessage','afterCreate','Sms','SmsInteraction','afterUpdate','Whatsapp','WhatsappInteraction'];(function(_0x1c2ea4,_0x5e9339){var _0x5844b4=function(_0x2d6dc2){while(--_0x2d6dc2){_0x1c2ea4['push'](_0x1c2ea4['shift']());}};_0x5844b4(++_0x5e9339);}(_0x54a9,0xd0));var _0x954a=function(_0x3bd313,_0x3ff27e){_0x3bd313=_0x3bd313-0x0;var _0x55ffdd=_0x54a9[_0x3bd313];return _0x55ffdd;};'use strict';var util=require(_0x954a('0x0'));var db=require(_0x954a('0x1'))['db'];var jayson=require(_0x954a('0x2'));var logger=require(_0x954a('0x3'))('triggers');var client=jayson[_0x954a('0x4')][_0x954a('0x5')]({'port':0x232a});var triggers=[{'channel':_0x954a('0x6'),'model':_0x954a('0x7'),'event':'afterCreate','condition':_0x954a('0x8'),'callback':afterCreate},{'channel':_0x954a('0x6'),'model':'ChatInteraction','event':'afterUpdate','condition':_0x954a('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0x954a('0xa'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x954a('0x6'),'model':'ChatOfflineMessage','event':_0x954a('0xb'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0x954a('0xc'),'model':'SmsInteraction','event':_0x954a('0xb'),'condition':_0x954a('0x8'),'callback':afterCreate},{'channel':_0x954a('0xc'),'model':_0x954a('0xd'),'event':_0x954a('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x954a('0xc'),'model':'SmsMessage','event':_0x954a('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x954a('0xf'),'model':_0x954a('0x10'),'event':_0x954a('0xb'),'condition':_0x954a('0x8'),'callback':afterCreate},{'channel':_0x954a('0xf'),'model':_0x954a('0x10'),'event':_0x954a('0xe'),'condition':_0x954a('0x9'),'callback':afterUpdate},{'channel':_0x954a('0xf'),'model':'WhatsappMessage','event':_0x954a('0xb'),'condition':_0x954a('0x11'),'callback':afterCreateMessage},{'channel':_0x954a('0x12'),'model':_0x954a('0x13'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x954a('0x12'),'model':'FaxInteraction','event':_0x954a('0xe'),'condition':_0x954a('0x9'),'callback':afterUpdate},{'channel':_0x954a('0x12'),'model':_0x954a('0x14'),'event':_0x954a('0xb'),'condition':_0x954a('0x11'),'callback':afterCreateMessage},{'channel':_0x954a('0x15'),'model':_0x954a('0x16'),'event':_0x954a('0xb'),'condition':_0x954a('0x8'),'callback':afterCreate},{'channel':_0x954a('0x15'),'model':_0x954a('0x16'),'event':_0x954a('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x954a('0x15'),'model':_0x954a('0x17'),'event':'afterCreate','condition':_0x954a('0x11'),'callback':afterCreateMessage},{'channel':_0x954a('0x18'),'model':'OpenchannelInteraction','event':_0x954a('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x954a('0x18'),'model':_0x954a('0x19'),'event':_0x954a('0xe'),'condition':_0x954a('0x9'),'callback':afterUpdate},{'channel':_0x954a('0x18'),'model':'OpenchannelMessage','event':_0x954a('0xb'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x2cffa3){return client[_0x954a('0x1a')]('EventManager',_0x2cffa3)[_0x954a('0x1b')](function(_0x1956ae){logger[_0x954a('0x1c')](_0x954a('0x1d'),_0x954a('0x1e'),_0x1956ae);if(_0x1956ae[_0x954a('0x1f')]){if(_0x1956ae[_0x954a('0x1f')][_0x954a('0x20')]===0x1f4){logger[_0x954a('0x1f')](_0x954a('0x1d'),_0x954a('0x1e'),_0x1956ae['error']);}}})[_0x954a('0x21')](function(_0x128779){logger[_0x954a('0x1f')](_0x954a('0x1d'),_0x954a('0x1e'),_0x128779);});}function afterCreateMessage(_0x54da83){return function(_0x395b9b){_0x395b9b=_0x395b9b[_0x954a('0x22')]({'plain':!![]});_0x395b9b['channel']=_0x54da83;_0x395b9b[_0x954a('0x23')]=_0x54da83;_0x395b9b['event']=_0x395b9b['direction'];Promise[_0x954a('0x24')]()[_0x954a('0x1b')](function(){if(typeof _0x395b9b['ContactId']==='undefined')return null;var _0x3bd71f=_0x954a('0x25')+_0x395b9b[_0x954a('0x26')];return db[_0x954a('0x27')][_0x954a('0x28')](_0x3bd71f,{'type':db[_0x954a('0x29')][_0x954a('0x2a')]['SELECT'],'raw':!![]});})['then'](function(_0x1a8076){if(_0x1a8076){_0x395b9b[_0x954a('0x2b')]=_0x1a8076[0x0];}if(typeof _0x395b9b[_0x954a('0x2c')]===_0x954a('0x2d'))return;return getAgent(_0x395b9b[_0x954a('0x2c')]);})[_0x954a('0x1b')](function(_0x11015c){if(_0x11015c){_0x395b9b['interface']=util['format'](_0x954a('0x2e'),_0x11015c[_0x954a('0x2f')]);_0x395b9b[_0x954a('0x30')]=_0x11015c;_0x395b9b[_0x954a('0x31')]=_0x54da83;return request({'event':_0x954a('0x32'),'message':_0x395b9b});}else{return request({'event':_0x954a('0x33'),'message':_0x395b9b});}})[_0x954a('0x21')](function(_0x40cc13){logger[_0x954a('0x1f')](_0x954a('0x1d'),_0x954a('0x34'),_0x40cc13);});};}function afterCreateOfflineMessage(_0x156c8a){return function(_0x2155f5){_0x2155f5=_0x2155f5[_0x954a('0x22')]({'plain':!![]});_0x2155f5[_0x954a('0x31')]=_0x156c8a;_0x2155f5[_0x954a('0x23')]=_0x156c8a;_0x2155f5[_0x954a('0x35')]=_0x954a('0x36');return request({'event':_0x2155f5['event'],'message':_0x2155f5});};}function afterCreate(_0x3e7073,_0x5076f0){return function(_0x41ae96){_0x41ae96=_0x41ae96[_0x954a('0x22')]({'plain':!![]});_0x41ae96[_0x954a('0x31')]=_0x3e7073;_0x41ae96[_0x954a('0x23')]=_0x3e7073;_0x41ae96['event']=_0x954a('0x37');Promise[_0x954a('0x24')]()[_0x954a('0x1b')](function(){var _0x4874fd=_0x954a('0x25')+_0x41ae96[_0x954a('0x26')];return db['sequelize'][_0x954a('0x28')](_0x4874fd,{'type':db[_0x954a('0x29')]['QueryTypes'][_0x954a('0x38')],'raw':!![]});})[_0x954a('0x1b')](function(_0xdf54fe){if(_0xdf54fe){_0x41ae96[_0x954a('0x2b')]=_0xdf54fe[0x0];}if(typeof _0x41ae96['UserId']===_0x954a('0x2d'))return;return getAgent(_0x41ae96[_0x954a('0x2c')]);})[_0x954a('0x1b')](function(_0x3457b6){if(_0x3457b6){_0x41ae96[_0x954a('0x39')]=util[_0x954a('0x3a')]('SIP/%s',_0x3457b6['name']);_0x41ae96[_0x954a('0x30')]=_0x3457b6;}return request({'event':_0x5076f0,'message':_0x41ae96});})[_0x954a('0x21')](function(_0x110148){logger[_0x954a('0x1f')](_0x954a('0x1d'),_0x954a('0x3b'),_0x110148);});};}function afterUpdate(_0xe0227){return function(_0x202cd3){var _0x2f8321=_0x202cd3['changed'](_0x954a('0x3c'))&&_0x202cd3[_0x954a('0x3c')];var _0x33ce7a=_0x202cd3[_0x954a('0x3d')]('substatus');if(_0x2f8321||_0x33ce7a){var _0x2a2f8f=_0x2f8321?_0x954a('0x9'):'substatus';var _0x5758de=_0x202cd3[_0x954a('0x22')]({'plain':!![]});_0x5758de[_0x954a('0x31')]=_0xe0227;_0x5758de[_0x954a('0x23')]=_0xe0227;_0x5758de[_0x954a('0x35')]=_0x2f8321?_0x954a('0x3c'):'substatus';var _0x5241ed='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5758de[_0x954a('0x26')];return db[_0x954a('0x27')][_0x954a('0x28')](_0x5241ed,{'type':db[_0x954a('0x29')][_0x954a('0x2a')][_0x954a('0x38')],'raw':!![]})[_0x954a('0x1b')](function(_0x538a1d){if(_0x538a1d){_0x5758de['contact']=_0x538a1d[0x0];}if(typeof _0x5758de['UserId']===_0x954a('0x2d'))return;return getAgent(_0x5758de[_0x954a('0x2c')]);})['then'](function(_0x230b0f){if(_0x230b0f){_0x5758de[_0x954a('0x39')]=util[_0x954a('0x3a')](_0x954a('0x2e'),_0x230b0f['name']);_0x5758de[_0x954a('0x30')]=_0x230b0f;}return request({'event':_0x2a2f8f,'message':_0x5758de});})['catch'](function(_0x46ca2f){logger[_0x954a('0x1f')](_0x954a('0x1d'),_0x954a('0x3e'),_0x46ca2f);});}};}function getAgent(_0xe87cd9){return db['User'][_0x954a('0x3f')]({'where':{'id':_0xe87cd9},'attributes':['id',_0x954a('0x2f'),_0x954a('0x40'),_0x954a('0x41'),_0x954a('0x42')],'raw':!![]})[_0x954a('0x1b')](function(_0x9d074f){return _0x9d074f;});}exports[_0x954a('0x43')]=function(){for(var _0x1e5357=0x0;_0x1e5357<triggers[_0x954a('0x44')];_0x1e5357+=0x1){if(db[_0x954a('0x45')](triggers[_0x1e5357]['model'])){db[triggers[_0x1e5357][_0x954a('0x46')]][_0x954a('0x47')](triggers[_0x1e5357][_0x954a('0x35')],triggers[_0x1e5357][_0x954a('0x48')](triggers[_0x1e5357][_0x954a('0x31')][_0x954a('0x49')](),triggers[_0x1e5357][_0x954a('0x4a')]));}}};
\ No newline at end of file
index e1a5e1f..5621202 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fc9=['agents','catch','lodash','chat','fax','whatsapp','openchannel','toLowerCase','includes','isUndefined','getLicense','agent','count','then'];(function(_0x5f097e,_0x22f250){var _0x4b001d=function(_0x3bbc36){while(--_0x3bbc36){_0x5f097e['push'](_0x5f097e['shift']());}};_0x4b001d(++_0x22f250);}(_0x7fc9,0x8e));var _0x97fc=function(_0x1d57f0,_0x45191a){_0x1d57f0=_0x1d57f0-0x0;var _0x2c2b60=_0x7fc9[_0x1d57f0];return _0x2c2b60;};'use strict';var _=require(_0x97fc('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=['voice','mail',_0x97fc('0x1'),_0x97fc('0x2'),'sms',_0x97fc('0x3'),_0x97fc('0x4')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x404f9c){_0x404f9c=_0x404f9c[_0x97fc('0x5')]();return _[_0x97fc('0x6')](channels,_0x404f9c);};exports['clearBlockUser']=function(_0x5bde05,_0x2ae035,_0x5e3680,_0x355711){var _0x218e04={'loginAttempts':_0x2ae035,'blocked':_0x5e3680};if(!_[_0x97fc('0x7')](_0x355711)){_0x218e04['blockedAt']=_0x355711;}return _0x5bde05['updateAttributes'](_0x218e04);};exports[_0x97fc('0x8')]=function(_0x10bee6){return new BPromise(function(_0x4506f6,_0x4e256e){var _0x2e92d2=0x0;if(_0x10bee6['role']!==_0x97fc('0x9')){_0x4506f6(_0x10bee6);}db['User'][_0x97fc('0xa')]({'where':{'role':_0x97fc('0x9'),'online':!![],'id':{'$ne':_0x10bee6['id']}}})['then'](function(_0x576542){_0x2e92d2=_0x576542;return util[_0x97fc('0x8')]();})[_0x97fc('0xb')](function(_0x455db9){if(_0x455db9&&_0x455db9[_0x97fc('0xc')]&&_0x2e92d2>=_0x455db9[_0x97fc('0xc')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x4506f6(_0x10bee6);})[_0x97fc('0xd')](function(_0x275ee1){_0x4e256e(_0x275ee1);});});};
\ No newline at end of file
+var _0x3664=['../mysqldb','./license/util','voice','mail','fax','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','updateAttributes','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird'];(function(_0x31739a,_0x2f44fc){var _0x43e7b9=function(_0x482ca4){while(--_0x482ca4){_0x31739a['push'](_0x31739a['shift']());}};_0x43e7b9(++_0x2f44fc);}(_0x3664,0x1e2));var _0x4366=function(_0x4a355f,_0x1f4062){_0x4a355f=_0x4a355f-0x0;var _0x57b9fe=_0x3664[_0x4a355f];return _0x57b9fe;};'use strict';var _=require(_0x4366('0x0'));var BPromise=require(_0x4366('0x1'));var db=require(_0x4366('0x2'))['db'];var util=require(_0x4366('0x3'));var channels=[_0x4366('0x4'),_0x4366('0x5'),'chat',_0x4366('0x6'),'sms','whatsapp',_0x4366('0x7')];exports[_0x4366('0x8')]=function(){return channels;};exports[_0x4366('0x9')]=function(_0x37ad0d){_0x37ad0d=_0x37ad0d[_0x4366('0xa')]();return _[_0x4366('0xb')](channels,_0x37ad0d);};exports[_0x4366('0xc')]=function(_0x4c2774,_0x10d5cc,_0x36755d,_0x416748){var _0x752c66={'loginAttempts':_0x10d5cc,'blocked':_0x36755d};if(!_[_0x4366('0xd')](_0x416748)){_0x752c66['blockedAt']=_0x416748;}return _0x4c2774[_0x4366('0xe')](_0x752c66);};exports[_0x4366('0xf')]=function(_0x3ef1b4){return new BPromise(function(_0x4488f1,_0x103c15){var _0x28b3b5=0x0;if(_0x3ef1b4[_0x4366('0x10')]!==_0x4366('0x11')){_0x4488f1(_0x3ef1b4);}db['User'][_0x4366('0x12')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x3ef1b4['id']}}})[_0x4366('0x13')](function(_0x388053){_0x28b3b5=_0x388053;return util[_0x4366('0xf')]();})[_0x4366('0x13')](function(_0x3ef46f){if(_0x3ef46f&&_0x3ef46f[_0x4366('0x14')]&&_0x28b3b5>=_0x3ef46f[_0x4366('0x14')]){throw Error(_0x4366('0x15'));}_0x4488f1(_0x3ef1b4);})['catch'](function(_0x5e0b92){_0x103c15(_0x5e0b92);});});};
\ No newline at end of file
index e667533..2b573ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2059=['status','render','exports','404'];(function(_0x552e00,_0x4978f6){var _0x48b0d1=function(_0x179b81){while(--_0x179b81){_0x552e00['push'](_0x552e00['shift']());}};_0x48b0d1(++_0x4978f6);}(_0x2059,0xf6));var _0x9205=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x2059[_0x337748];return _0x3bb03f;};'use strict';module[_0x9205('0x0')][0x194]=function pageNotFound(_0x5a4399,_0x1d0407){var _0x3e0a8e=_0x9205('0x1');var _0x3a67d3=0x194;var _0x110aba={'status':_0x3a67d3};_0x1d0407['status'](_0x110aba[_0x9205('0x2')]);_0x1d0407[_0x9205('0x3')](_0x3e0a8e,{},function(_0x4407dc,_0x2163c4){if(_0x4407dc){return _0x1d0407[_0x9205('0x2')](_0x110aba[_0x9205('0x2')])['json'](_0x110aba);}_0x1d0407['send'](_0x2163c4);});};
\ No newline at end of file
+var _0xd5f5=['404','status','render','json','exports'];(function(_0x121f35,_0x5900cd){var _0x365177=function(_0x5a9952){while(--_0x5a9952){_0x121f35['push'](_0x121f35['shift']());}};_0x365177(++_0x5900cd);}(_0xd5f5,0xcc));var _0x5d5f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd5f5[_0xfae23b];return _0x200640;};'use strict';module[_0x5d5f('0x0')][0x194]=function pageNotFound(_0x74e86b,_0x4a0c5f){var _0x101dad=_0x5d5f('0x1');var _0x11ec3d=0x194;var _0x49273b={'status':_0x11ec3d};_0x4a0c5f[_0x5d5f('0x2')](_0x49273b[_0x5d5f('0x2')]);_0x4a0c5f[_0x5d5f('0x3')](_0x101dad,{},function(_0x4bfb85,_0x5ba4eb){if(_0x4bfb85){return _0x4a0c5f[_0x5d5f('0x2')](_0x49273b[_0x5d5f('0x2')])[_0x5d5f('0x4')](_0x49273b);}_0x4a0c5f['send'](_0x5ba4eb);});};
\ No newline at end of file
index 4724f88..0804daa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc048=['../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','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','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','cascade','UserSetting','userSetting','hasMany','VoiceRecording','UserId','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','MailQueues','FaxQueues','OpenchannelQueue','ChatWebsites','FaxAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperFinals','CmHopperBlack','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailboxuser','mailbox','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Dispositions','Interactions','List','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Interaction','ChatOfflineMessageId','MailApplication','TagId','ListId','Dashboard','Items','FaxAccountId','Answers','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','SmsAccountId','SmsMessage','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','ChatMessage','chat_interaction_has_tags','ChatInteractionId','AttachmentId','Attachments','team_has_chat_queues','ChatGroupId','CompanyId','HopperHistories','Company','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','Any','ParentId','Intervals','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','SalesforceAccount','SalesforceConfiguration','Configurations','AccountId','SubjectId','DescriptionId','Field','FieldId','Variable','VariableId','SugarcrmAccount','Subjects','Descriptions','Subject','Description','int_desk_configuration_has_tags','ZohoConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','Dynamics365Field','FreshsalesField','FromId','ToId','JscriptyQuestionReport','SessionId','ProjectId','ChatQueues','OpenchannelQueues','team_has_whatsapp_queues','TeamVoicePrefix','VoicePrefixes','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToQueue','ToMailAccountId','ToAccount','FromAgent','ToAgent','ToChatQueueId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','user','Smtp','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8mb4','utf8','sequelizeHistory','name','username','password','options','database','User','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','import','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailMessage','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../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','Automation','CannedAnswer','../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','VoiceQueuesLog','../api/schedule/schedule.model','Sound','../api/sound/sound.model'];(function(_0x3394fc,_0x20ce38){var _0x1abe8b=function(_0x15c782){while(--_0x15c782){_0x3394fc['push'](_0x3394fc['shift']());}};_0x1abe8b(++_0x20ce38);}(_0xc048,0x165));var _0x8c04=function(_0xa6947b,_0x4f4c51){_0xa6947b=_0xa6947b-0x0;var _0x55f3fe=_0xc048[_0xa6947b];return _0x55f3fe;};'use strict';var config=require(_0x8c04('0x0'));var Sequelize=require(_0x8c04('0x1'));var _=require(_0x8c04('0x2'));var jstz=require(_0x8c04('0x3'));var timezone=jstz['determine']();config[_0x8c04('0x1')]=_[_0x8c04('0x4')](config[_0x8c04('0x1')],{'database':_0x8c04('0x5'),'username':_0x8c04('0x6'),'password':'xC@LL1234','options':{'host':_0x8c04('0x7'),'port':0xcea,'dialect':_0x8c04('0x8'),'dialectOptions':{'charset':_0x8c04('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8c04('0xa'),'collate':'utf8_general_ci'}}});config[_0x8c04('0xb')]=_[_0x8c04('0x4')](config[_0x8c04('0xb')],{'database':'motion2','username':_0x8c04('0x6'),'password':'xC@LL1234','options':{'host':_0x8c04('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x8c04('0xc')](),'define':{'charset':_0x8c04('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8c04('0x1')]['database'],config[_0x8c04('0x1')][_0x8c04('0xd')],config[_0x8c04('0x1')][_0x8c04('0xe')],config[_0x8c04('0x1')][_0x8c04('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8c04('0xb')][_0x8c04('0x10')],config[_0x8c04('0xb')][_0x8c04('0xd')],config['sequelizeHistory'][_0x8c04('0xe')],config[_0x8c04('0xb')][_0x8c04('0xf')])};db[_0x8c04('0x11')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x12'));db[_0x8c04('0x13')]=db['sequelize']['import'](_0x8c04('0x14'));db[_0x8c04('0x15')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x17'));db[_0x8c04('0x18')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/voiceExtension/voiceExtension.model');db[_0x8c04('0x19')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x1a'));db[_0x8c04('0x1b')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x1c'));db['VoiceRecording']=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x1d'));db[_0x8c04('0x1e')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x1f'));db['VoiceMailMessage']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x20'));db[_0x8c04('0x21')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/voiceCallReport/voiceCallReport.model');db[_0x8c04('0x22')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x23'));db[_0x8c04('0x24')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x25'));db[_0x8c04('0x26')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0x8c04('0x1')]['import'](_0x8c04('0x27'));db['Trunk']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x28'));db[_0x8c04('0x29')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x2a'));db[_0x8c04('0x2b')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x2c'));db[_0x8c04('0x2d')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0x2e'));db['UserChatQueue']=db['sequelize'][_0x8c04('0x16')](_0x8c04('0x2f'));db[_0x8c04('0x30')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x31'));db[_0x8c04('0x32')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x33'));db[_0x8c04('0x34')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x35'));db[_0x8c04('0x36')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x37'));db[_0x8c04('0x38')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x39'));db[_0x8c04('0x3a')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/mailServerIn/mailServerIn.model');db[_0x8c04('0x3b')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x3c'));db[_0x8c04('0x3d')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x3e'));db[_0x8c04('0x3f')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x40'));db[_0x8c04('0x41')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x42'));db['MailInteraction']=db['sequelize'][_0x8c04('0x16')]('../api/mailInteraction/mailInteraction.model');db[_0x8c04('0x43')]=db[_0x8c04('0x1')]['import']('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/mailApplication/mailApplication.model');db[_0x8c04('0x44')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x45'));db['Dashboard']=db['sequelize'][_0x8c04('0x16')](_0x8c04('0x46'));db[_0x8c04('0x47')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x48'));db['FaxAccount']=db['sequelize']['import'](_0x8c04('0x49'));db[_0x8c04('0x4a')]=db['sequelize']['import'](_0x8c04('0x4b'));db['FaxInteraction']=db['sequelize']['import'](_0x8c04('0x4c'));db[_0x8c04('0x4d')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x4e'));db[_0x8c04('0x4f')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x50'));db[_0x8c04('0x51')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x52'));db['SmsAccount']=db[_0x8c04('0x1')]['import'](_0x8c04('0x53'));db[_0x8c04('0x54')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x55'));db[_0x8c04('0x56')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x57'));db['SmsMessage']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x58'));db[_0x8c04('0x59')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0x5a'));db['OpenchannelAccount']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x5b'));db[_0x8c04('0x5c')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x5d'));db[_0x8c04('0x5e')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x8c04('0x5f')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/openchannelQueue/openchannelQueue.model');db[_0x8c04('0x60')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x61'));db[_0x8c04('0x62')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x63'));db[_0x8c04('0x64')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x65'));db[_0x8c04('0x66')]=db['sequelize']['import'](_0x8c04('0x67'));db['ChatMessage']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x68'));db[_0x8c04('0x69')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x8c04('0x6a')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0x6b'));db[_0x8c04('0x6c')]=db['sequelize']['import'](_0x8c04('0x6d'));db[_0x8c04('0x6e')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x6f'));db[_0x8c04('0x70')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/cmCompany/cmCompany.model');db[_0x8c04('0x71')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x72'));db[_0x8c04('0x73')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x74'));db['CmHopperBlack']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x75'));db[_0x8c04('0x76')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x77'));db[_0x8c04('0x78')]=db['sequelize']['import'](_0x8c04('0x79'));db[_0x8c04('0x7a')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x7b'));db[_0x8c04('0x7c')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x7d'));db[_0x8c04('0x7e')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/action/action.model');db[_0x8c04('0x7f')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/automation/automation.model');db[_0x8c04('0x80')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x81'));db[_0x8c04('0x82')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0x83'));db[_0x8c04('0x84')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0x85'));db[_0x8c04('0x86')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x87'));db[_0x8c04('0x88')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x89'));db['Cdr']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x8a'));db[_0x8c04('0x8b')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x8c'));db[_0x8c04('0x8d')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x8e'));db['Tag']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x8f'));db[_0x8c04('0x90')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x91'));db[_0x8c04('0x92')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0x93'));db['Variable']=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/variable/variable.model');db[_0x8c04('0x94')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x95'));db[_0x8c04('0x96')]=db['sequelize']['import'](_0x8c04('0x97'));db[_0x8c04('0x98')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x99'));db[_0x8c04('0x9a')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x9b'));db[_0x8c04('0x9c')]=db[_0x8c04('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x8c04('0x9d')]=db['sequelize']['import']('../api/analyticMetric/analyticMetric.model');db[_0x8c04('0x9e')]=db['sequelize'][_0x8c04('0x16')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x9f'));db['SalesforceAccount']=db['sequelize'][_0x8c04('0x16')](_0x8c04('0xa0'));db['SalesforceConfiguration']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xa1'));db[_0x8c04('0xa2')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xa3'));db['SugarcrmAccount']=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x8c04('0xa4')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xa5'));db[_0x8c04('0xa6')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x8c04('0xa7')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xa8'));db[_0x8c04('0xa9')]=db[_0x8c04('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x8c04('0xaa')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0xab'));db[_0x8c04('0xac')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db['sequelize']['import'](_0x8c04('0xad'));db[_0x8c04('0xae')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xaf'));db[_0x8c04('0xb0')]=db['sequelize'][_0x8c04('0x16')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x8c04('0xb1')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xb2'));db[_0x8c04('0xb3')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xb4'));db['FreshdeskAccount']=db['sequelize'][_0x8c04('0x16')](_0x8c04('0xb5'));db[_0x8c04('0xb6')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xb7'));db[_0x8c04('0xb8')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xb9'));db['VtigerAccount']=db['sequelize'][_0x8c04('0x16')](_0x8c04('0xba'));db[_0x8c04('0xbb')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xbc'));db['VtigerField']=db[_0x8c04('0x1')]['import'](_0x8c04('0xbd'));db[_0x8c04('0xbe')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xbf'));db[_0x8c04('0xc0')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xc1'));db[_0x8c04('0xc2')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/intServicenowField/intServicenowField.model');db[_0x8c04('0xc3')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xc4'));db[_0x8c04('0xc5')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xc6'));db['Dynamics365Field']=db[_0x8c04('0x1')]['import'](_0x8c04('0xc7'));db[_0x8c04('0xc8')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xc9'));db[_0x8c04('0xca')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0xcb'));db['FreshsalesField']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xcc'));db['Integration']=db['sequelize'][_0x8c04('0x16')](_0x8c04('0x95'));db[_0x8c04('0xcd')]=db[_0x8c04('0x1')]['import'](_0x8c04('0xce'));db[_0x8c04('0xcf')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xd0'));db[_0x8c04('0xd1')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x8c04('0xd2')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xd3'));db['JscriptyQuestionReport']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xd4'));db[_0x8c04('0xd5')]=db[_0x8c04('0x1')]['import'](_0x8c04('0xd6'));db[_0x8c04('0xd7')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xd8'));db[_0x8c04('0xd9')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xda'));db[_0x8c04('0xdb')]=db['sequelize'][_0x8c04('0x16')]('../api/squareReportDetail/squareReportDetail.model');db[_0x8c04('0xdc')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xdd'));db[_0x8c04('0xde')]=db[_0x8c04('0x1')]['import']('../api/setting/setting.model');db[_0x8c04('0xdf')]=db[_0x8c04('0x1')]['import'](_0x8c04('0xe0'));db[_0x8c04('0xe1')]=db['sequelize']['import']('../api/squareProject/squareProject.model');db[_0x8c04('0xe2')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0xe3'));db[_0x8c04('0xe4')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xe5'));db[_0x8c04('0xe6')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xe7'));db['License']=db['sequelize'][_0x8c04('0x16')]('../api/license/license.model');db[_0x8c04('0xe8')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xe9'));db['Migration']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xea'));db['Attachment']=db[_0x8c04('0x1')]['import']('../api/attachment/attachment.model');db[_0x8c04('0xeb')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0xec'));db[_0x8c04('0xed')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xee'));db[_0x8c04('0xef')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0xf0'));db[_0x8c04('0xf1')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/faxTransferReport/faxTransferReport.model');db[_0x8c04('0xf2')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xf3'));db[_0x8c04('0xf4')]=db['sequelize'][_0x8c04('0x16')]('../api/smsTransferReport/smsTransferReport.model');db[_0x8c04('0xf5')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/cmList/cmList.model');db[_0x8c04('0xf6')]=db[_0x8c04('0x1')]['import'](_0x8c04('0xf7'));db[_0x8c04('0xf8')]=db['sequelize']['import'](_0x8c04('0xf9'));db[_0x8c04('0xfa')]=db[_0x8c04('0x1')]['import'](_0x8c04('0xfb'));db[_0x8c04('0xfc')]=db['sequelize']['import'](_0x8c04('0xfd'));db[_0x8c04('0xfe')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0xff'));db[_0x8c04('0x100')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x101'));db[_0x8c04('0x102')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x103'));db[_0x8c04('0x104')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x105'));db['WhatsappMessage']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x106'));db[_0x8c04('0x107')]=db[_0x8c04('0x1')][_0x8c04('0x16')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x8c04('0x108')]=db['sequelize']['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x8c04('0x109')]=db['sequelize'][_0x8c04('0x16')](_0x8c04('0x10a'));db[_0x8c04('0x10b')]=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x10c'));db[_0x8c04('0x10d')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x10e'));db['TeamVoicePrefix']=db[_0x8c04('0x1')][_0x8c04('0x16')](_0x8c04('0x10f'));db[_0x8c04('0x110')]=db[_0x8c04('0x1')]['import'](_0x8c04('0x111'));db['UserSetting']=db[_0x8c04('0x1')]['import'](_0x8c04('0x112'));db[_0x8c04('0x11')][_0x8c04('0x113')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x8c04('0x114'),'foreignKey':'UserId'});db[_0x8c04('0x11')]['hasOne'](db[_0x8c04('0x115')],{'as':_0x8c04('0x116'),'onDelete':_0x8c04('0x114'),'foreignKey':'UserId'});db[_0x8c04('0x11')][_0x8c04('0x117')](db[_0x8c04('0x118')],{'as':'Recordings','foreignKey':_0x8c04('0x119')});db['User'][_0x8c04('0x117')](db['UserVoiceQueueRt'],{'as':_0x8c04('0x11a'),'foreignKey':'UserId'});db[_0x8c04('0x11')]['hasMany'](db[_0x8c04('0x18')],{'as':_0x8c04('0x11b'),'onDelete':_0x8c04('0x114'),'hooks':!![]});db[_0x8c04('0x11')]['hasMany'](db[_0x8c04('0x76')],{'as':'HopperFinals','foreignKey':_0x8c04('0x119')});db[_0x8c04('0x11')][_0x8c04('0x117')](db[_0x8c04('0x78')],{'as':_0x8c04('0x11c'),'foreignKey':_0x8c04('0x119')});db['User'][_0x8c04('0x117')](db[_0x8c04('0x7a')],{'as':_0x8c04('0x7a'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x11')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x8c04('0x11d'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x11')][_0x8c04('0x117')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x8c04('0x119')});db[_0x8c04('0x11')][_0x8c04('0x117')](db['SmsInteraction'],{'as':_0x8c04('0x11e'),'foreignKey':'UserId'});db[_0x8c04('0x11')]['hasMany'](db[_0x8c04('0x11f')],{'as':_0x8c04('0x120'),'foreignKey':'UserId'});db[_0x8c04('0x11')][_0x8c04('0x117')](db[_0x8c04('0x121')],{'as':_0x8c04('0x122'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x11')][_0x8c04('0x117')](db[_0x8c04('0x104')],{'as':_0x8c04('0x123'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x11')][_0x8c04('0x117')](db[_0x8c04('0xfe')],{'as':_0x8c04('0x124'),'foreignKey':_0x8c04('0x125')});db[_0x8c04('0x11')][_0x8c04('0x126')](db[_0x8c04('0xf8')],{'as':_0x8c04('0xf8'),'foreignKey':_0x8c04('0x127')});db[_0x8c04('0x11')]['belongsToMany'](db[_0x8c04('0x6c')],{'as':_0x8c04('0x128'),'through':_0x8c04('0x129')});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0x71')],{'as':_0x8c04('0x12b'),'through':_0x8c04('0x12c')});db['User'][_0x8c04('0x12a')](db['CmList'],{'as':_0x8c04('0x12d'),'through':_0x8c04('0x12e')});db[_0x8c04('0x11')][_0x8c04('0x12a')](db['Team'],{'through':'user_has_teams'});db[_0x8c04('0x11')][_0x8c04('0x12a')](db['MailInteraction'],{'as':_0x8c04('0x122'),'through':_0x8c04('0x12f')});db['User'][_0x8c04('0x12a')](db[_0x8c04('0x66')],{'as':_0x8c04('0x130'),'through':_0x8c04('0x131')});db[_0x8c04('0x11')]['belongsToMany'](db[_0x8c04('0x11f')],{'as':'FaxInteractions','through':_0x8c04('0x132')});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0x56')],{'as':_0x8c04('0x11e'),'through':_0x8c04('0x133')});db['User'][_0x8c04('0x12a')](db[_0x8c04('0x5e')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0x104')],{'as':_0x8c04('0x123'),'through':_0x8c04('0x134')});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0x1b')],{'as':'VoiceQueues','through':_0x8c04('0x2d'),'required':![]});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0xf6')],{'as':'VoicePrefixes','through':_0x8c04('0x110'),'required':![]});db['User'][_0x8c04('0x12a')](db[_0x8c04('0x3f')],{'as':_0x8c04('0x135'),'through':_0x8c04('0x30'),'required':![]});db[_0x8c04('0x11')][_0x8c04('0x12a')](db['ChatQueue'],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0x4f')],{'as':_0x8c04('0x136'),'through':'UserFaxQueue','required':![]});db['User']['belongsToMany'](db[_0x8c04('0x59')],{'as':'SmsQueues','through':_0x8c04('0x34'),'required':![]});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0x137')],{'as':'OpenchannelQueues','through':_0x8c04('0x36'),'required':![]});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0x109')],{'as':'WhatsappQueues','through':_0x8c04('0x38'),'required':![]});db[_0x8c04('0x11')][_0x8c04('0x12a')](db['CmList'],{'through':_0x8c04('0x12e')});db[_0x8c04('0x11')][_0x8c04('0x12a')](db['ChatWebsite'],{'as':_0x8c04('0x138'),'through':'user_has_chat_websites'});db[_0x8c04('0x11')]['belongsToMany'](db[_0x8c04('0x139')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0x3d')],{'as':_0x8c04('0x13a'),'through':_0x8c04('0x13b')});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0x13c')],{'as':_0x8c04('0x13d'),'through':_0x8c04('0x13e')});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0x13f')],{'as':'SmsAccounts','through':_0x8c04('0x140')});db[_0x8c04('0x11')]['belongsToMany'](db[_0x8c04('0x100')],{'as':_0x8c04('0x141'),'through':_0x8c04('0x142')});db[_0x8c04('0x11')][_0x8c04('0x12a')](db[_0x8c04('0xe1')],{'as':_0x8c04('0x143'),'through':'user_has_square_projects'});db[_0x8c04('0x13')]['hasMany'](db['VoiceExtension'],{'as':_0x8c04('0x144'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x145')});db[_0x8c04('0x15')][_0x8c04('0x117')](db['VoiceExtension'],{'onDelete':_0x8c04('0x114')});db['VoiceExtension'][_0x8c04('0x117')](db[_0x8c04('0x18')],{'as':_0x8c04('0x146'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x19')][_0x8c04('0x12a')](db[_0x8c04('0x8d')],{'as':_0x8c04('0x147'),'through':_0x8c04('0x148')});db[_0x8c04('0x1b')][_0x8c04('0x117')](db['UserVoiceQueueRt'],{'as':_0x8c04('0x149'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x8c04('0x117')](db[_0x8c04('0x73')],{'as':_0x8c04('0x14a'),'foreignKey':_0x8c04('0x14b')});db[_0x8c04('0x1b')][_0x8c04('0x117')](db[_0x8c04('0x76')],{'as':_0x8c04('0x14c'),'foreignKey':_0x8c04('0x14b')});db[_0x8c04('0x1b')]['hasMany'](db[_0x8c04('0x78')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db[_0x8c04('0x1b')][_0x8c04('0x117')](db['ReportAgentPreview'],{'as':_0x8c04('0x7a'),'foreignKey':_0x8c04('0x14b')});db[_0x8c04('0x1b')][_0x8c04('0x117')](db[_0x8c04('0x14d')],{'as':_0x8c04('0x14e'),'foreignKey':_0x8c04('0x14b')});db['VoiceQueue'][_0x8c04('0x117')](db['JscriptySessionReport'],{'as':_0x8c04('0x14f'),'foreignKey':_0x8c04('0x14b')});db[_0x8c04('0x1b')][_0x8c04('0x126')](db['Trunk'],{'as':_0x8c04('0x150'),'foreignKey':_0x8c04('0x151')});db['VoiceQueue'][_0x8c04('0x126')](db[_0x8c04('0x150')],{'as':_0x8c04('0x152'),'foreignKey':'TrunkBackupId'});db[_0x8c04('0x1b')]['belongsTo'](db[_0x8c04('0x86')],{'as':_0x8c04('0x86'),'foreignKey':_0x8c04('0x153')});db['VoiceQueue'][_0x8c04('0x126')](db[_0x8c04('0x88')],{'as':_0x8c04('0x154'),'foreignKey':_0x8c04('0x155')});db[_0x8c04('0x1b')]['belongsToMany'](db[_0x8c04('0xf5')],{'as':_0x8c04('0x12d'),'through':_0x8c04('0x156')});db['VoiceQueue'][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x157'),'through':'UserVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0x8c04('0xe6')],{'as':_0x8c04('0x158'),'through':_0x8c04('0x10d')});db['VoiceQueue'][_0x8c04('0x12a')](db[_0x8c04('0xf5')],{'as':_0x8c04('0x159'),'through':_0x8c04('0x15a')});db[_0x8c04('0x118')][_0x8c04('0x126')](db['User'],{'as':_0x8c04('0x11'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x15b')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'as':_0x8c04('0x11'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x1e')]['hasMany'](db[_0x8c04('0x15c')],{'as':_0x8c04('0x15d'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x15e'),'sourceKey':_0x8c04('0x15f')});db[_0x8c04('0x15c')][_0x8c04('0x126')](db['VoiceMail'],{'foreignKey':_0x8c04('0x15e'),'targetKey':_0x8c04('0x15f')});db[_0x8c04('0x21')]['hasMany'](db[_0x8c04('0x26')],{'as':'QueueCalls','foreignKey':_0x8c04('0x160'),'constraints':![]});db[_0x8c04('0x21')]['hasMany'](db[_0x8c04('0x24')],{'as':_0x8c04('0x161'),'foreignKey':_0x8c04('0x160'),'constraints':![]});db[_0x8c04('0x21')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'as':_0x8c04('0x11'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x21')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':_0x8c04('0x162'),'foreignKey':_0x8c04('0x163')});db['MailServerIn'][_0x8c04('0x126')](db['MailAccount'],{'as':_0x8c04('0x3d'),'foreignKey':_0x8c04('0x164')});db[_0x8c04('0x3a')]['belongsTo'](db[_0x8c04('0x10b')],{'as':_0x8c04('0x10b'),'foreignKey':_0x8c04('0x165'),'onDelete':_0x8c04('0x166')});db[_0x8c04('0x3b')][_0x8c04('0x126')](db[_0x8c04('0x3d')],{'as':_0x8c04('0x3d'),'foreignKey':'MailAccountId'});db[_0x8c04('0x3b')]['belongsTo'](db['CloudProvider'],{'as':_0x8c04('0x10b'),'foreignKey':_0x8c04('0x165'),'onDelete':_0x8c04('0x166')});db[_0x8c04('0x3d')][_0x8c04('0x113')](db[_0x8c04('0x3a')],{'as':_0x8c04('0x167'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x3d')][_0x8c04('0x113')](db[_0x8c04('0x3b')],{'as':'Smtp','onDelete':_0x8c04('0x114')});db[_0x8c04('0x3d')][_0x8c04('0x117')](db['Disposition'],{'as':_0x8c04('0x168'),'foreignKey':_0x8c04('0x164'),'onDelete':'cascade'});db[_0x8c04('0x3d')][_0x8c04('0x117')](db[_0x8c04('0x80')],{'as':'Answers','foreignKey':_0x8c04('0x164')});db[_0x8c04('0x3d')][_0x8c04('0x117')](db[_0x8c04('0x43')],{'as':_0x8c04('0x15d'),'foreignKey':_0x8c04('0x164')});db[_0x8c04('0x3d')]['hasMany'](db[_0x8c04('0x121')],{'as':_0x8c04('0x169')});db[_0x8c04('0x3d')][_0x8c04('0x117')](db['MailApplication'],{'as':'Applications'});db[_0x8c04('0x3d')][_0x8c04('0x126')](db[_0x8c04('0xf5')],{'as':_0x8c04('0x16a'),'foreignKey':'ListId'});db['MailAccount'][_0x8c04('0x126')](db[_0x8c04('0x90')],{'as':'Template','foreignKey':_0x8c04('0x16b')});db['MailAccount'][_0x8c04('0x126')](db[_0x8c04('0x88')],{'as':'mandatoryDispositionPause','foreignKey':_0x8c04('0x155')});db[_0x8c04('0x3d')][_0x8c04('0x12a')](db['User'],{'as':_0x8c04('0x157'),'through':_0x8c04('0x13b')});db[_0x8c04('0x3f')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':'Agents','through':_0x8c04('0x30')});db[_0x8c04('0x3f')][_0x8c04('0x12a')](db[_0x8c04('0xe6')],{'through':_0x8c04('0x16c'),'as':_0x8c04('0x158')});db['MailInteraction'][_0x8c04('0x117')](db[_0x8c04('0x43')],{'as':'Messages','onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x16d')});db[_0x8c04('0x121')]['belongsTo'](db['MailAccount'],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x164')});db[_0x8c04('0x121')][_0x8c04('0x126')](db['CmContact'],{'as':_0x8c04('0x162'),'foreignKey':_0x8c04('0x163')});db[_0x8c04('0x121')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'as':_0x8c04('0x16f'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x121')][_0x8c04('0x12a')](db[_0x8c04('0x170')],{'through':_0x8c04('0x171'),'as':_0x8c04('0x172')});db[_0x8c04('0x121')][_0x8c04('0x12a')](db[_0x8c04('0x170')],{'through':_0x8c04('0x171'),'as':_0x8c04('0x173')});db['MailInteraction'][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x174'),'through':_0x8c04('0x12f'),'foreignKey':'MailInteractionId'});db[_0x8c04('0x43')][_0x8c04('0x117')](db[_0x8c04('0x175')],{'as':'Attachments','onDelete':_0x8c04('0x114')});db[_0x8c04('0x43')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'as':_0x8c04('0x11')});db['MailMessage']['belongsTo'](db[_0x8c04('0x71')],{'onDelete':_0x8c04('0x114'),'as':_0x8c04('0x162')});db[_0x8c04('0x43')][_0x8c04('0x126')](db[_0x8c04('0x121')],{'as':_0x8c04('0x176'),'foreignKey':_0x8c04('0x16d')});db['MailMessage']['belongsTo'](db[_0x8c04('0x3d')],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x164')});db[_0x8c04('0x43')][_0x8c04('0x126')](db[_0x8c04('0x60')],{'as':_0x8c04('0x60'),'foreignKey':'ChatWebsiteId'});db[_0x8c04('0x43')][_0x8c04('0x126')](db[_0x8c04('0x69')],{'as':'ChatOfflineMessage','foreignKey':_0x8c04('0x177')});db[_0x8c04('0x178')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0x8c04('0x3f')],{'onDelete':_0x8c04('0x166')});db[_0x8c04('0x178')]['belongsTo'](db[_0x8c04('0x3d')],{'onDelete':_0x8c04('0x166')});db[_0x8c04('0x178')][_0x8c04('0x126')](db[_0x8c04('0x86')],{'onDelete':_0x8c04('0x166'),'foreignKey':_0x8c04('0x153')});db['MailApplication'][_0x8c04('0x126')](db[_0x8c04('0x170')],{'onDelete':_0x8c04('0x166'),'foreignKey':_0x8c04('0x179')});db[_0x8c04('0x44')]['belongsTo'](db[_0x8c04('0x3d')],{});db[_0x8c04('0x44')]['belongsTo'](db[_0x8c04('0xf5')],{'as':_0x8c04('0x16a'),'foreignKey':_0x8c04('0x17a')});db[_0x8c04('0x44')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':_0x8c04('0x162'),'foreignKey':'ContactId'});db[_0x8c04('0x44')]['belongsTo'](db[_0x8c04('0x121')],{});db['MailQueueReport'][_0x8c04('0x126')](db[_0x8c04('0x43')],{});db[_0x8c04('0x44')][_0x8c04('0x126')](db[_0x8c04('0x11')],{});db[_0x8c04('0x44')][_0x8c04('0x126')](db[_0x8c04('0x3f')],{});db[_0x8c04('0x17b')][_0x8c04('0x117')](db[_0x8c04('0x47')],{'as':_0x8c04('0x17c'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x139')][_0x8c04('0x117')](db[_0x8c04('0x82')],{'as':'Dispositions','foreignKey':_0x8c04('0x17d'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x139')][_0x8c04('0x117')](db[_0x8c04('0x80')],{'as':_0x8c04('0x17e'),'foreignKey':'FaxAccountId'});db[_0x8c04('0x139')][_0x8c04('0x117')](db[_0x8c04('0x11f')],{'as':_0x8c04('0x169')});db['FaxAccount'][_0x8c04('0x117')](db[_0x8c04('0x4a')],{'as':'Applications'});db[_0x8c04('0x139')][_0x8c04('0x117')](db[_0x8c04('0x18')],{'as':'Exntensions','onDelete':'cascade'});db[_0x8c04('0x139')][_0x8c04('0x117')](db[_0x8c04('0x4d')],{'as':_0x8c04('0x15d')});db[_0x8c04('0x139')]['belongsTo'](db[_0x8c04('0x150')],{'as':_0x8c04('0x150')});db[_0x8c04('0x139')][_0x8c04('0x126')](db[_0x8c04('0xf5')],{'as':'List','foreignKey':_0x8c04('0x17a')});db[_0x8c04('0x139')][_0x8c04('0x126')](db['Pause'],{'as':_0x8c04('0x154'),'foreignKey':_0x8c04('0x155')});db[_0x8c04('0x139')]['belongsToMany'](db[_0x8c04('0x11')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0x8c04('0x4a')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'onDelete':_0x8c04('0x166')});db['FaxApplication'][_0x8c04('0x126')](db[_0x8c04('0x4f')],{'onDelete':_0x8c04('0x166')});db[_0x8c04('0x4a')][_0x8c04('0x126')](db[_0x8c04('0x139')],{'onDelete':_0x8c04('0x166')});db[_0x8c04('0x4a')]['belongsTo'](db[_0x8c04('0x170')],{'onDelete':'restrict','foreignKey':_0x8c04('0x179')});db[_0x8c04('0x11f')][_0x8c04('0x117')](db[_0x8c04('0x4d')],{'as':_0x8c04('0x15d'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x17f')});db[_0x8c04('0x11f')][_0x8c04('0x126')](db[_0x8c04('0x139')],{'as':_0x8c04('0x16e'),'foreignKey':'FaxAccountId'});db[_0x8c04('0x11f')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':'Contact','foreignKey':_0x8c04('0x163')});db[_0x8c04('0x11f')][_0x8c04('0x126')](db['User'],{'as':_0x8c04('0x16f'),'foreignKey':'UserId'});db[_0x8c04('0x11f')][_0x8c04('0x12a')](db['Tag'],{'through':_0x8c04('0x180'),'as':_0x8c04('0x172')});db[_0x8c04('0x11f')][_0x8c04('0x12a')](db['Tag'],{'through':_0x8c04('0x180'),'as':_0x8c04('0x173')});db[_0x8c04('0x11f')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':'Users','through':_0x8c04('0x132'),'foreignKey':_0x8c04('0x17f')});db[_0x8c04('0x4d')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'onDelete':_0x8c04('0x114'),'as':'User'});db['FaxMessage'][_0x8c04('0x126')](db[_0x8c04('0x11f')],{'as':_0x8c04('0x176'),'foreignKey':_0x8c04('0x17f')});db['FaxMessage']['belongsTo'](db[_0x8c04('0x71')],{'onDelete':_0x8c04('0x114'),'as':_0x8c04('0x162')});db[_0x8c04('0x4d')][_0x8c04('0x126')](db[_0x8c04('0x175')],{'as':_0x8c04('0x175'),'foreignKey':'AttachmentId'});db['FaxMessage'][_0x8c04('0x126')](db[_0x8c04('0x139')],{'as':'Account','foreignKey':_0x8c04('0x17d')});db[_0x8c04('0x4f')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x157'),'through':_0x8c04('0x32')});db['FaxQueue'][_0x8c04('0x12a')](db['Team'],{'through':_0x8c04('0x181'),'as':_0x8c04('0x158')});db[_0x8c04('0x51')][_0x8c04('0x126')](db[_0x8c04('0x139')],{});db[_0x8c04('0x51')][_0x8c04('0x126')](db['CmList'],{'as':_0x8c04('0x16a'),'foreignKey':'ListId'});db[_0x8c04('0x51')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':_0x8c04('0x162'),'foreignKey':_0x8c04('0x163')});db['FaxQueueReport'][_0x8c04('0x126')](db[_0x8c04('0x11f')],{});db[_0x8c04('0x51')][_0x8c04('0x126')](db[_0x8c04('0x4d')],{});db[_0x8c04('0x51')]['belongsTo'](db['User'],{});db[_0x8c04('0x51')][_0x8c04('0x126')](db[_0x8c04('0x4f')],{});db[_0x8c04('0x13f')]['hasMany'](db[_0x8c04('0x82')],{'as':_0x8c04('0x168'),'foreignKey':_0x8c04('0x182'),'onDelete':'cascade'});db[_0x8c04('0x13f')][_0x8c04('0x117')](db['CannedAnswer'],{'as':_0x8c04('0x17e'),'foreignKey':_0x8c04('0x182')});db[_0x8c04('0x13f')][_0x8c04('0x117')](db[_0x8c04('0x183')],{'as':_0x8c04('0x15d'),'foreignKey':_0x8c04('0x182')});db[_0x8c04('0x13f')][_0x8c04('0x117')](db[_0x8c04('0x56')],{'as':_0x8c04('0x169')});db[_0x8c04('0x13f')][_0x8c04('0x117')](db['SmsApplication'],{'as':_0x8c04('0x146')});db[_0x8c04('0x13f')][_0x8c04('0x126')](db['CmList'],{'as':_0x8c04('0x16a'),'foreignKey':'ListId'});db['SmsAccount'][_0x8c04('0x126')](db['Pause'],{'as':_0x8c04('0x154'),'foreignKey':_0x8c04('0x155')});db[_0x8c04('0x13f')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x157'),'through':_0x8c04('0x140')});db['SmsApplication'][_0x8c04('0x126')](db['User'],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db['SmsQueue'],{'onDelete':'restrict'});db[_0x8c04('0x54')][_0x8c04('0x126')](db[_0x8c04('0x13f')],{'onDelete':'restrict'});db['SmsApplication'][_0x8c04('0x126')](db[_0x8c04('0x86')],{'onDelete':'restrict','foreignKey':_0x8c04('0x153')});db['SmsApplication']['belongsTo'](db[_0x8c04('0x170')],{'onDelete':_0x8c04('0x166'),'foreignKey':_0x8c04('0x179')});db[_0x8c04('0x56')]['hasMany'](db['SmsMessage'],{'as':_0x8c04('0x15d'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x8c04('0x56')][_0x8c04('0x126')](db[_0x8c04('0x13f')],{'as':_0x8c04('0x16e'),'foreignKey':'SmsAccountId'});db[_0x8c04('0x56')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':_0x8c04('0x162'),'foreignKey':_0x8c04('0x163')});db['SmsInteraction']['belongsTo'](db[_0x8c04('0x11')],{'as':_0x8c04('0x16f'),'foreignKey':'UserId'});db[_0x8c04('0x56')][_0x8c04('0x12a')](db['Tag'],{'through':_0x8c04('0x184'),'as':'Tags'});db[_0x8c04('0x56')][_0x8c04('0x12a')](db['Tag'],{'through':_0x8c04('0x184'),'as':_0x8c04('0x173')});db[_0x8c04('0x56')][_0x8c04('0x12a')](db['User'],{'as':_0x8c04('0x174'),'through':_0x8c04('0x133'),'foreignKey':_0x8c04('0x185')});db['SmsMessage'][_0x8c04('0x126')](db['User'],{'as':_0x8c04('0x11')});db['SmsMessage'][_0x8c04('0x126')](db[_0x8c04('0x71')],{'onDelete':_0x8c04('0x114'),'as':_0x8c04('0x162')});db[_0x8c04('0x183')]['belongsTo'](db['SmsInteraction'],{'onDelete':_0x8c04('0x114'),'as':_0x8c04('0x176'),'foreignKey':_0x8c04('0x185')});db['SmsMessage'][_0x8c04('0x126')](db['SmsAccount'],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x182')});db['SmsQueue'][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x157'),'through':_0x8c04('0x34'),'foreignKey':'SmsQueueId'});db[_0x8c04('0x59')][_0x8c04('0x12a')](db['Team'],{'through':_0x8c04('0x186'),'as':_0x8c04('0x158')});db['OpenchannelAccount'][_0x8c04('0x117')](db[_0x8c04('0x82')],{'as':_0x8c04('0x168'),'foreignKey':'OpenchannelAccountId','onDelete':_0x8c04('0x114')});db[_0x8c04('0x13c')]['hasMany'](db[_0x8c04('0x80')],{'as':_0x8c04('0x17e'),'foreignKey':'OpenchannelAccountId'});db[_0x8c04('0x13c')][_0x8c04('0x117')](db['OpenchannelInteraction'],{'as':_0x8c04('0x169'),'foreignKey':'OpenchannelAccountId'});db[_0x8c04('0x13c')]['hasMany'](db[_0x8c04('0x5f')],{'as':_0x8c04('0x15d'),'foreignKey':_0x8c04('0x187')});db['OpenchannelAccount'][_0x8c04('0x117')](db['OpenchannelApplication'],{'as':_0x8c04('0x146'),'foreignKey':_0x8c04('0x187')});db[_0x8c04('0x13c')]['belongsTo'](db[_0x8c04('0xf5')],{'as':_0x8c04('0x16a'),'foreignKey':_0x8c04('0x17a')});db[_0x8c04('0x13c')][_0x8c04('0x126')](db[_0x8c04('0x88')],{'as':'mandatoryDispositionPause','foreignKey':_0x8c04('0x155')});db[_0x8c04('0x13c')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x157'),'through':_0x8c04('0x13e')});db['OpenchannelApplication'][_0x8c04('0x126')](db[_0x8c04('0x11')],{'onDelete':_0x8c04('0x166')});db[_0x8c04('0x5c')]['belongsTo'](db[_0x8c04('0x137')],{'onDelete':_0x8c04('0x166'),'foreignKey':_0x8c04('0x188')});db[_0x8c04('0x5c')][_0x8c04('0x126')](db['OpenchannelAccount'],{'onDelete':_0x8c04('0x166'),'foreignKey':_0x8c04('0x187')});db[_0x8c04('0x5c')][_0x8c04('0x126')](db[_0x8c04('0x86')],{'onDelete':'restrict','foreignKey':_0x8c04('0x153')});db[_0x8c04('0x5c')][_0x8c04('0x126')](db[_0x8c04('0x170')],{'onDelete':_0x8c04('0x166'),'foreignKey':'TagId'});db['OpenchannelInteraction'][_0x8c04('0x117')](db[_0x8c04('0x5f')],{'as':_0x8c04('0x15d'),'onDelete':_0x8c04('0x114'),'foreignKey':'OpenchannelInteractionId'});db[_0x8c04('0x5e')][_0x8c04('0x126')](db[_0x8c04('0x13c')],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x187')});db[_0x8c04('0x5e')][_0x8c04('0x126')](db['CmContact'],{'as':'Contact','foreignKey':_0x8c04('0x163')});db[_0x8c04('0x5e')][_0x8c04('0x126')](db['User'],{'as':_0x8c04('0x16f'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x5e')]['belongsToMany'](db[_0x8c04('0x170')],{'through':_0x8c04('0x189'),'as':_0x8c04('0x172')});db[_0x8c04('0x5e')][_0x8c04('0x12a')](db[_0x8c04('0x170')],{'through':'openchannel_interaction_has_tags','as':_0x8c04('0x173')});db[_0x8c04('0x5e')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x174'),'through':_0x8c04('0x18a'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x8c04('0x126')](db[_0x8c04('0x11')],{'onDelete':_0x8c04('0x114'),'as':_0x8c04('0x11')});db[_0x8c04('0x5f')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'onDelete':'cascade','as':_0x8c04('0x162')});db['OpenchannelMessage'][_0x8c04('0x126')](db[_0x8c04('0x5e')],{'onDelete':'cascade','as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0x8c04('0x5f')]['belongsTo'](db[_0x8c04('0x175')],{'as':_0x8c04('0x175'),'foreignKey':'AttachmentId'});db[_0x8c04('0x5f')][_0x8c04('0x126')](db[_0x8c04('0x13c')],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x187')});db[_0x8c04('0x137')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x157'),'through':_0x8c04('0x36'),'foreignKey':_0x8c04('0x188')});db['OpenchannelQueue'][_0x8c04('0x12a')](db[_0x8c04('0xe6')],{'through':_0x8c04('0x18b'),'as':_0x8c04('0x158')});db[_0x8c04('0x60')][_0x8c04('0x117')](db[_0x8c04('0x82')],{'as':'Dispositions','foreignKey':_0x8c04('0x18c'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x60')]['hasMany'](db[_0x8c04('0x80')],{'as':_0x8c04('0x17e'),'foreignKey':'ChatWebsiteId'});db[_0x8c04('0x60')][_0x8c04('0x117')](db[_0x8c04('0x6e')],{'as':_0x8c04('0x18d')});db[_0x8c04('0x60')][_0x8c04('0x117')](db[_0x8c04('0x66')],{'as':'Interactions'});db[_0x8c04('0x60')]['hasMany'](db[_0x8c04('0x64')],{'as':_0x8c04('0x146')});db['ChatWebsite'][_0x8c04('0x117')](db['ChatMessage'],{'as':_0x8c04('0x15d')});db[_0x8c04('0x60')][_0x8c04('0x126')](db[_0x8c04('0xf5')],{'as':_0x8c04('0x16a'),'foreignKey':_0x8c04('0x17a')});db[_0x8c04('0x60')][_0x8c04('0x126')](db[_0x8c04('0x86')],{'as':_0x8c04('0x86'),'foreignKey':_0x8c04('0x153')});db[_0x8c04('0x60')][_0x8c04('0x126')](db[_0x8c04('0x3d')],{'as':_0x8c04('0x3d'),'foreignKey':'MailAccountId'});db[_0x8c04('0x60')]['belongsTo'](db[_0x8c04('0x88')],{'as':_0x8c04('0x154'),'foreignKey':_0x8c04('0x155')});db['ChatWebsite']['belongsToMany'](db[_0x8c04('0x11')],{'as':_0x8c04('0x157'),'through':_0x8c04('0x18e')});db[_0x8c04('0x62')][_0x8c04('0x126')](db[_0x8c04('0x13c')],{});db['OpenchannelQueueReport'][_0x8c04('0x126')](db['CmList'],{'as':_0x8c04('0x16a'),'foreignKey':'ListId'});db[_0x8c04('0x62')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':'Contact','foreignKey':_0x8c04('0x163')});db['OpenchannelQueueReport']['belongsTo'](db[_0x8c04('0x5e')],{});db['OpenchannelQueueReport'][_0x8c04('0x126')](db[_0x8c04('0x5f')],{});db[_0x8c04('0x62')][_0x8c04('0x126')](db[_0x8c04('0x11')],{});db[_0x8c04('0x62')]['belongsTo'](db[_0x8c04('0x137')],{});db['ChatApplication'][_0x8c04('0x126')](db[_0x8c04('0x11')],{'as':_0x8c04('0x18f'),'foreignKey':_0x8c04('0x119'),'onDelete':_0x8c04('0x166')});db[_0x8c04('0x64')][_0x8c04('0x126')](db[_0x8c04('0x6a')],{'as':_0x8c04('0x190'),'foreignKey':_0x8c04('0x191'),'onDelete':_0x8c04('0x166')});db['ChatApplication'][_0x8c04('0x126')](db[_0x8c04('0x60')],{'as':_0x8c04('0x192'),'foreignKey':_0x8c04('0x18c'),'onDelete':_0x8c04('0x166')});db[_0x8c04('0x64')][_0x8c04('0x126')](db[_0x8c04('0x170')],{'onDelete':_0x8c04('0x166'),'foreignKey':_0x8c04('0x179')});db[_0x8c04('0x66')][_0x8c04('0x117')](db[_0x8c04('0x193')],{'as':_0x8c04('0x15d'),'onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0x8c04('0x66')][_0x8c04('0x126')](db[_0x8c04('0x60')],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x18c')});db['ChatInteraction'][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':'Contact','foreignKey':_0x8c04('0x163')});db[_0x8c04('0x66')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'as':'Owner','foreignKey':_0x8c04('0x119')});db[_0x8c04('0x66')]['belongsToMany'](db[_0x8c04('0x170')],{'through':_0x8c04('0x194'),'as':_0x8c04('0x172')});db[_0x8c04('0x66')][_0x8c04('0x12a')](db[_0x8c04('0x170')],{'through':_0x8c04('0x194'),'as':_0x8c04('0x173')});db[_0x8c04('0x66')]['belongsToMany'](db['User'],{'as':_0x8c04('0x174'),'through':_0x8c04('0x131'),'foreignKey':_0x8c04('0x195')});db[_0x8c04('0x193')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'onDelete':'cascade','as':_0x8c04('0x11')});db[_0x8c04('0x193')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'onDelete':_0x8c04('0x114'),'as':_0x8c04('0x162'),'foreignKey':_0x8c04('0x163')});db[_0x8c04('0x193')][_0x8c04('0x126')](db[_0x8c04('0x66')],{'onDelete':_0x8c04('0x114'),'as':_0x8c04('0x176'),'foreignKey':_0x8c04('0x195')});db[_0x8c04('0x193')]['belongsTo'](db[_0x8c04('0x175')],{'as':_0x8c04('0x175'),'foreignKey':_0x8c04('0x196')});db[_0x8c04('0x193')]['belongsTo'](db[_0x8c04('0x60')],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x18c')});db[_0x8c04('0x69')]['hasMany'](db[_0x8c04('0x175')],{'as':_0x8c04('0x197'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x8c04('0x114'),'hooks':!![]});db[_0x8c04('0x69')][_0x8c04('0x126')](db['CmContact'],{'onDelete':_0x8c04('0x114'),'as':_0x8c04('0x162'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x8c04('0x126')](db['ChatWebsite'],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x18c')});db[_0x8c04('0x6a')][_0x8c04('0x12a')](db['User'],{'as':_0x8c04('0x157'),'through':'UserChatQueue','hooks':!![]});db[_0x8c04('0x6a')][_0x8c04('0x12a')](db[_0x8c04('0xe6')],{'through':_0x8c04('0x198'),'as':'Teams'});db[_0x8c04('0x6c')][_0x8c04('0x117')](db[_0x8c04('0xd1')],{'as':_0x8c04('0x15d'),'foreignKey':_0x8c04('0x199'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x6c')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x149'),'through':_0x8c04('0x129')});db[_0x8c04('0x6e')][_0x8c04('0x126')](db[_0x8c04('0x60')],{'as':_0x8c04('0x192'),'foreignKey':_0x8c04('0x18c')});db[_0x8c04('0x70')][_0x8c04('0x117')](db[_0x8c04('0x71')],{'as':_0x8c04('0x12b'),'foreignKey':_0x8c04('0x19a')});db[_0x8c04('0x71')][_0x8c04('0x117')](db[_0x8c04('0x73')],{'as':_0x8c04('0x14a'),'foreignKey':_0x8c04('0x163')});db[_0x8c04('0x71')][_0x8c04('0x117')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x8c04('0x163')});db[_0x8c04('0x71')][_0x8c04('0x117')](db['CmHopperHistory'],{'as':_0x8c04('0x19b'),'foreignKey':_0x8c04('0x163')});db[_0x8c04('0x71')][_0x8c04('0x117')](db[_0x8c04('0x7a')],{'as':_0x8c04('0x7a'),'foreignKey':_0x8c04('0x163')});db[_0x8c04('0x71')][_0x8c04('0x117')](db[_0x8c04('0xd5')],{'as':_0x8c04('0x14f'),'foreignKey':_0x8c04('0x163')});db[_0x8c04('0x71')][_0x8c04('0x117')](db[_0x8c04('0x5e')],{'as':_0x8c04('0x11d'),'foreignKey':'ContactId','onDelete':_0x8c04('0x166')});db[_0x8c04('0x71')][_0x8c04('0x117')](db[_0x8c04('0x66')],{'as':_0x8c04('0x130'),'foreignKey':_0x8c04('0x163'),'onDelete':_0x8c04('0x166')});db[_0x8c04('0x71')][_0x8c04('0x117')](db[_0x8c04('0x56')],{'as':_0x8c04('0x11e'),'foreignKey':'ContactId','onDelete':_0x8c04('0x166')});db[_0x8c04('0x71')][_0x8c04('0x117')](db[_0x8c04('0x11f')],{'as':_0x8c04('0x120'),'foreignKey':'ContactId','onDelete':_0x8c04('0x166')});db[_0x8c04('0x71')][_0x8c04('0x117')](db[_0x8c04('0x121')],{'as':_0x8c04('0x122'),'foreignKey':_0x8c04('0x163'),'onDelete':_0x8c04('0x166')});db[_0x8c04('0x71')][_0x8c04('0x126')](db[_0x8c04('0x70')],{'as':_0x8c04('0x19c'),'foreignKey':_0x8c04('0x19a')});db[_0x8c04('0x71')]['belongsTo'](db[_0x8c04('0xf5')],{'as':_0x8c04('0x16a'),'foreignKey':_0x8c04('0x17a'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x71')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x174'),'through':_0x8c04('0x12c')});db[_0x8c04('0x71')][_0x8c04('0x12a')](db['Tag'],{'as':_0x8c04('0x172'),'through':_0x8c04('0x19d')});db[_0x8c04('0x71')][_0x8c04('0x12a')](db['Tag'],{'through':_0x8c04('0x19d'),'as':_0x8c04('0x173')});db[_0x8c04('0x73')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':_0x8c04('0x162'),'foreignKey':_0x8c04('0x163'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0x8c04('0xf5')],{'as':_0x8c04('0x16a'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x8c04('0x73')]['belongsTo'](db['User'],{'as':_0x8c04('0x18f'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x73')]['belongsTo'](db[_0x8c04('0x1b')],{'as':'Queue','foreignKey':_0x8c04('0x14b'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x73')][_0x8c04('0x126')](db['Campaign'],{'as':_0x8c04('0xe8'),'foreignKey':_0x8c04('0x19e'),'onDelete':_0x8c04('0x114')});db['CmHopper'][_0x8c04('0x126')](db[_0x8c04('0x11')],{'as':_0x8c04('0x16f'),'foreignKey':_0x8c04('0x19f')});db['CmHopperBlack'][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':'Contact','foreignKey':_0x8c04('0x163'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x14d')][_0x8c04('0x126')](db[_0x8c04('0xf5')],{'as':_0x8c04('0x16a'),'foreignKey':_0x8c04('0x17a'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db['VoiceQueue'],{'as':_0x8c04('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0x8c04('0x114')});db[_0x8c04('0x14d')][_0x8c04('0x126')](db['Campaign'],{'as':_0x8c04('0xe8'),'foreignKey':_0x8c04('0x19e'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x7f')][_0x8c04('0x117')](db['Condition'],{'as':{'plural':_0x8c04('0x1a0'),'singular':_0x8c04('0x1a1')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x8c04('0x7f')][_0x8c04('0x117')](db[_0x8c04('0x84')],{'as':{'plural':_0x8c04('0x1a2'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x8c04('0x114'),'hooks':!![]});db['Automation'][_0x8c04('0x117')](db['Action'],{'as':'Actions','foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db['Disposition'][_0x8c04('0x117')](db[_0x8c04('0x82')],{'as':_0x8c04('0x168'),'foreignKey':_0x8c04('0x1a3'),'onDelete':_0x8c04('0x114')});db['Interval'][_0x8c04('0x117')](db[_0x8c04('0x86')],{'as':_0x8c04('0x1a4'),'foreignKey':_0x8c04('0x153'),'onDelete':_0x8c04('0x114'),'hooks':!![],'required':![]});db[_0x8c04('0x86')][_0x8c04('0x117')](db['VoiceExtension'],{'as':_0x8c04('0x11b'),'foreignKey':_0x8c04('0x153'),'onDelete':_0x8c04('0x166')});db[_0x8c04('0x86')][_0x8c04('0x117')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0x8c04('0x153')});db[_0x8c04('0x86')][_0x8c04('0x117')](db[_0x8c04('0x64')],{'as':'ChatApplications','foreignKey':_0x8c04('0x153')});db[_0x8c04('0x86')][_0x8c04('0x117')](db[_0x8c04('0x4a')],{'as':'FaxApplications','foreignKey':_0x8c04('0x153')});db[_0x8c04('0x86')][_0x8c04('0x117')](db[_0x8c04('0x54')],{'as':_0x8c04('0x1a5'),'foreignKey':_0x8c04('0x153')});db[_0x8c04('0x1a6')]['belongsTo'](db[_0x8c04('0x3d')],{});db[_0x8c04('0x1a6')]['belongsTo'](db[_0x8c04('0x9a')],{'foreignKey':_0x8c04('0x1a7')});db[_0x8c04('0x1a6')][_0x8c04('0x126')](db[_0x8c04('0x98')],{'foreignKey':_0x8c04('0x1a8')});db[_0x8c04('0x8d')][_0x8c04('0x12a')](db[_0x8c04('0x19')],{'as':_0x8c04('0x1a9'),'through':_0x8c04('0x148'),'onDelete':_0x8c04('0x166')});db[_0x8c04('0x170')][_0x8c04('0x12a')](db['CmContact'],{'through':_0x8c04('0x19d')});db[_0x8c04('0x170')][_0x8c04('0x12a')](db[_0x8c04('0x66')],{'through':_0x8c04('0x194')});db[_0x8c04('0x170')][_0x8c04('0x12a')](db[_0x8c04('0x121')],{'through':'mail_interaction_has_tags'});db[_0x8c04('0x170')][_0x8c04('0x12a')](db[_0x8c04('0x56')],{'through':'sms_interaction_has_tags'});db[_0x8c04('0x170')][_0x8c04('0x12a')](db['FaxInteraction'],{'through':_0x8c04('0x180')});db[_0x8c04('0x170')][_0x8c04('0x12a')](db[_0x8c04('0x5e')],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0x8c04('0x12a')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x8c04('0x92')][_0x8c04('0x117')](db[_0x8c04('0x84')],{'as':{'plural':_0x8c04('0x1aa'),'singular':_0x8c04('0x1ab')},'foreignKey':_0x8c04('0x1ac'),'onDelete':_0x8c04('0x114'),'hooks':!![]});db[_0x8c04('0x92')]['hasMany'](db[_0x8c04('0x84')],{'as':{'plural':_0x8c04('0x1ad'),'singular':_0x8c04('0x1ae')},'foreignKey':_0x8c04('0x1af'),'onDelete':_0x8c04('0x114'),'hooks':!![]});db[_0x8c04('0x92')][_0x8c04('0x117')](db[_0x8c04('0x7e')],{'as':_0x8c04('0x1b0'),'foreignKey':_0x8c04('0x1b1'),'onDelete':_0x8c04('0x114'),'hooks':!![]});db['AnalyticCustomReport'][_0x8c04('0x117')](db[_0x8c04('0x9e')],{'as':'Fields','onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1a8'),'hooks':!![]});db[_0x8c04('0x9a')][_0x8c04('0x117')](db[_0x8c04('0x9e')],{'as':_0x8c04('0x1b2'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1a7')});db[_0x8c04('0x9d')][_0x8c04('0x117')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b3')});db[_0x8c04('0x9e')][_0x8c04('0x126')](db[_0x8c04('0x9d')],{'foreignKey':_0x8c04('0x1b3')});db[_0x8c04('0x1b4')]['hasMany'](db[_0x8c04('0x1b5')],{'as':_0x8c04('0x1b6'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0x1b5')][_0x8c04('0x117')](db[_0x8c04('0xa2')],{'as':'Subjects','onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0x1b5')][_0x8c04('0x117')](db[_0x8c04('0xa2')],{'as':'Descriptions','onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0x1b5')][_0x8c04('0x117')](db[_0x8c04('0xa2')],{'as':_0x8c04('0x1b2'),'onDelete':_0x8c04('0x114'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x8c04('0x126')](db[_0x8c04('0x1b4')],{'as':'Account','foreignKey':'AccountId'});db[_0x8c04('0xa2')][_0x8c04('0x117')](db[_0x8c04('0xa2')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8c04('0xa2')][_0x8c04('0x117')](db[_0x8c04('0xa2')],{'as':'Description','foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0xa2')][_0x8c04('0x117')](db[_0x8c04('0xa2')],{'as':_0x8c04('0x1ba'),'foreignKey':_0x8c04('0x1bb')});db[_0x8c04('0xa2')][_0x8c04('0x126')](db[_0x8c04('0x1bc')],{'as':_0x8c04('0x1bc'),'foreignKey':_0x8c04('0x1bd')});db[_0x8c04('0x1be')]['hasMany'](db[_0x8c04('0xa4')],{'as':_0x8c04('0x1b6'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b7')});db['SugarcrmConfiguration'][_0x8c04('0x117')](db['SugarcrmField'],{'as':_0x8c04('0x1bf'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0xa4')]['hasMany'](db[_0x8c04('0xa6')],{'as':_0x8c04('0x1c0'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0xa4')]['hasMany'](db[_0x8c04('0xa6')],{'as':_0x8c04('0x1b2'),'onDelete':'cascade','foreignKey':_0x8c04('0x1bb')});db['SugarcrmConfiguration']['belongsTo'](db[_0x8c04('0x1be')],{'as':'Account','foreignKey':'AccountId'});db['SugarcrmField'][_0x8c04('0x117')](db[_0x8c04('0xa6')],{'as':_0x8c04('0x1c1'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0xa6')][_0x8c04('0x117')](db[_0x8c04('0xa6')],{'as':_0x8c04('0x1c2'),'foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0xa6')][_0x8c04('0x117')](db[_0x8c04('0xa6')],{'as':_0x8c04('0x1ba'),'foreignKey':_0x8c04('0x1bb')});db[_0x8c04('0xa6')][_0x8c04('0x126')](db['Variable'],{'as':_0x8c04('0x1bc'),'foreignKey':_0x8c04('0x1bd')});db[_0x8c04('0xa7')][_0x8c04('0x117')](db['DeskConfiguration'],{'as':_0x8c04('0x1b6'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x8c04('0xa9')][_0x8c04('0x117')](db[_0x8c04('0xaa')],{'as':_0x8c04('0x1bf'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b8')});db['DeskConfiguration']['hasMany'](db[_0x8c04('0xaa')],{'as':_0x8c04('0x1c0'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0xa9')][_0x8c04('0x117')](db['DeskField'],{'as':_0x8c04('0x1b2'),'onDelete':_0x8c04('0x114'),'foreignKey':'FieldId'});db[_0x8c04('0xa9')][_0x8c04('0x126')](db['DeskAccount'],{'as':'Account','foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0xa9')][_0x8c04('0x12a')](db['Tag'],{'through':_0x8c04('0x1c3')});db[_0x8c04('0xaa')][_0x8c04('0x117')](db[_0x8c04('0xaa')],{'as':_0x8c04('0x1c1'),'foreignKey':'SubjectId'});db[_0x8c04('0xaa')][_0x8c04('0x117')](db['DeskField'],{'as':'Description','foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0xaa')][_0x8c04('0x117')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0x8c04('0xaa')][_0x8c04('0x126')](db[_0x8c04('0x1bc')],{'as':_0x8c04('0x1bc'),'foreignKey':_0x8c04('0x1bd')});db['ZohoAccount'][_0x8c04('0x117')](db[_0x8c04('0x1c4')],{'as':_0x8c04('0x1b6'),'onDelete':_0x8c04('0x114'),'foreignKey':'AccountId'});db[_0x8c04('0x1c4')][_0x8c04('0x117')](db['ZohoField'],{'as':_0x8c04('0x1bf'),'onDelete':'cascade','foreignKey':_0x8c04('0x1b8')});db['ZohoConfiguration'][_0x8c04('0x117')](db[_0x8c04('0xae')],{'as':_0x8c04('0x1c0'),'onDelete':'cascade','foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0x1c4')]['hasMany'](db['ZohoField'],{'as':'Fields','onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1bb')});db[_0x8c04('0x1c4')][_0x8c04('0x126')](db['ZohoAccount'],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0xae')]['hasMany'](db[_0x8c04('0xae')],{'as':_0x8c04('0x1c1'),'foreignKey':_0x8c04('0x1b8')});db['ZohoField']['hasMany'](db[_0x8c04('0xae')],{'as':_0x8c04('0x1c2'),'foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0xae')][_0x8c04('0x117')](db['ZohoField'],{'as':_0x8c04('0x1ba'),'foreignKey':_0x8c04('0x1bb')});db[_0x8c04('0xae')]['belongsTo'](db[_0x8c04('0x1bc')],{'as':_0x8c04('0x1bc'),'foreignKey':_0x8c04('0x1bd')});db['ZendeskAccount'][_0x8c04('0x117')](db[_0x8c04('0xb1')],{'as':_0x8c04('0x1b6'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0xb1')]['hasMany'](db['ZendeskField'],{'as':_0x8c04('0x1bf'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0xb1')][_0x8c04('0x117')](db[_0x8c04('0xb3')],{'as':_0x8c04('0x1c0'),'foreignKey':'DescriptionId'});db[_0x8c04('0xb1')]['hasMany'](db['ZendeskField'],{'as':_0x8c04('0x1b2'),'foreignKey':_0x8c04('0x1bb')});db['ZendeskConfiguration'][_0x8c04('0x126')](db['ZendeskAccount'],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x1b7')});db['ZendeskConfiguration']['belongsToMany'](db[_0x8c04('0x170')],{'through':_0x8c04('0x1c5')});db[_0x8c04('0xb3')]['hasMany'](db[_0x8c04('0xb3')],{'as':_0x8c04('0x1c1'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0xb3')][_0x8c04('0x117')](db[_0x8c04('0xb3')],{'as':_0x8c04('0x1c2'),'foreignKey':'DescriptionId'});db['ZendeskField'][_0x8c04('0x117')](db[_0x8c04('0xb3')],{'as':_0x8c04('0x1ba'),'foreignKey':_0x8c04('0x1bb')});db['ZendeskField'][_0x8c04('0x126')](db[_0x8c04('0x1bc')],{'as':_0x8c04('0x1bc'),'foreignKey':_0x8c04('0x1bd')});db[_0x8c04('0x1c6')][_0x8c04('0x117')](db[_0x8c04('0xb6')],{'as':_0x8c04('0x1b6'),'onDelete':_0x8c04('0x114'),'foreignKey':'AccountId'});db[_0x8c04('0xb6')][_0x8c04('0x117')](db[_0x8c04('0xb8')],{'as':_0x8c04('0x1bf'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0xb6')][_0x8c04('0x117')](db[_0x8c04('0xb8')],{'as':_0x8c04('0x1c0'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0xb6')][_0x8c04('0x117')](db['FreshdeskField'],{'as':_0x8c04('0x1b2'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1bb')});db['FreshdeskConfiguration'][_0x8c04('0x126')](db[_0x8c04('0x1c6')],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0xb6')]['belongsToMany'](db[_0x8c04('0x170')],{'through':_0x8c04('0x1c7')});db[_0x8c04('0xb8')][_0x8c04('0x117')](db[_0x8c04('0xb8')],{'as':_0x8c04('0x1c1'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0xb8')][_0x8c04('0x117')](db[_0x8c04('0xb8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8c04('0xb8')][_0x8c04('0x117')](db['FreshdeskField'],{'as':_0x8c04('0x1ba'),'foreignKey':'FieldId'});db[_0x8c04('0xb8')]['belongsTo'](db['Variable'],{'as':_0x8c04('0x1bc'),'foreignKey':_0x8c04('0x1bd')});db[_0x8c04('0x1c8')][_0x8c04('0x117')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0xbb')][_0x8c04('0x117')](db[_0x8c04('0x1c9')],{'as':_0x8c04('0x1bf'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0xbb')][_0x8c04('0x117')](db['VtigerField'],{'as':_0x8c04('0x1c0'),'foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0xbb')][_0x8c04('0x117')](db[_0x8c04('0x1c9')],{'as':_0x8c04('0x1b2'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0x8c04('0x126')](db[_0x8c04('0x1c8')],{'as':'Account','foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0x1c9')][_0x8c04('0x117')](db['VtigerField'],{'as':'Subject','foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0x1c9')][_0x8c04('0x117')](db['VtigerField'],{'as':_0x8c04('0x1c2'),'foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0x1c9')][_0x8c04('0x117')](db[_0x8c04('0x1c9')],{'as':_0x8c04('0x1ba'),'foreignKey':_0x8c04('0x1bb')});db['VtigerField']['belongsTo'](db[_0x8c04('0x1bc')],{'as':_0x8c04('0x1bc'),'foreignKey':_0x8c04('0x1bd')});db[_0x8c04('0xbe')][_0x8c04('0x117')](db[_0x8c04('0xc0')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0xc0')]['hasMany'](db[_0x8c04('0xc2')],{'as':_0x8c04('0x1bf'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0xc0')][_0x8c04('0x117')](db[_0x8c04('0xc2')],{'as':_0x8c04('0x1c0'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0x8c04('0x117')](db[_0x8c04('0xc2')],{'as':_0x8c04('0x1b2'),'foreignKey':_0x8c04('0x1bb')});db[_0x8c04('0xc0')][_0x8c04('0x126')](db[_0x8c04('0xbe')],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x1b7')});db['ServicenowField']['hasMany'](db[_0x8c04('0xc2')],{'as':_0x8c04('0x1c1'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0xc2')][_0x8c04('0x117')](db[_0x8c04('0xc2')],{'as':_0x8c04('0x1c2'),'foreignKey':_0x8c04('0x1b9')});db['ServicenowField']['hasMany'](db[_0x8c04('0xc2')],{'as':_0x8c04('0x1ba'),'foreignKey':'FieldId'});db[_0x8c04('0xc2')][_0x8c04('0x126')](db[_0x8c04('0x1bc')],{'as':_0x8c04('0x1bc'),'foreignKey':'VariableId'});db[_0x8c04('0xc3')][_0x8c04('0x117')](db[_0x8c04('0xc5')],{'as':'Configurations','onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0xc3')][_0x8c04('0x126')](db[_0x8c04('0x10b')],{'as':_0x8c04('0x10b'),'foreignKey':_0x8c04('0x165')});db[_0x8c04('0xc5')][_0x8c04('0x117')](db[_0x8c04('0x1ca')],{'as':'Subjects','onDelete':_0x8c04('0x114'),'foreignKey':'SubjectId'});db[_0x8c04('0xc5')][_0x8c04('0x117')](db['Dynamics365Field'],{'as':_0x8c04('0x1c0'),'onDelete':'cascade','foreignKey':_0x8c04('0x1b9')});db[_0x8c04('0xc5')][_0x8c04('0x117')](db[_0x8c04('0x1ca')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x8c04('0x1bb')});db['Dynamics365Configuration'][_0x8c04('0x126')](db['Dynamics365Account'],{'as':_0x8c04('0x16e'),'foreignKey':'AccountId'});db[_0x8c04('0x1ca')][_0x8c04('0x117')](db[_0x8c04('0x1ca')],{'as':_0x8c04('0x1c1'),'foreignKey':_0x8c04('0x1b8')});db['Dynamics365Field']['hasMany'](db[_0x8c04('0x1ca')],{'as':_0x8c04('0x1c2'),'foreignKey':_0x8c04('0x1b9')});db['Dynamics365Field']['hasMany'](db[_0x8c04('0x1ca')],{'as':_0x8c04('0x1ba'),'foreignKey':_0x8c04('0x1bb')});db[_0x8c04('0x1ca')][_0x8c04('0x126')](db['Variable'],{'as':_0x8c04('0x1bc'),'foreignKey':_0x8c04('0x1bd')});db[_0x8c04('0xc8')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x8c04('0x1b6'),'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0xca')][_0x8c04('0x117')](db[_0x8c04('0x1cb')],{'as':_0x8c04('0x1bf'),'foreignKey':_0x8c04('0x1b8')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x8c04('0x1c0'),'foreignKey':_0x8c04('0x1b9')});db['FreshsalesConfiguration'][_0x8c04('0x117')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x8c04('0x1bb')});db[_0x8c04('0xca')][_0x8c04('0x126')](db['FreshsalesAccount'],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x1b7')});db[_0x8c04('0x1cb')][_0x8c04('0x117')](db['FreshsalesField'],{'as':_0x8c04('0x1c1'),'foreignKey':_0x8c04('0x1b8')});db[_0x8c04('0x1cb')]['hasMany'](db[_0x8c04('0x1cb')],{'as':'Description','foreignKey':'DescriptionId'});db['FreshsalesField'][_0x8c04('0x117')](db[_0x8c04('0x1cb')],{'as':_0x8c04('0x1ba'),'foreignKey':'FieldId'});db[_0x8c04('0x1cb')][_0x8c04('0x126')](db[_0x8c04('0x1bc')],{'as':'Variable','foreignKey':_0x8c04('0x1bd')});db['ChatQueueReport'][_0x8c04('0x126')](db[_0x8c04('0x60')],{});db[_0x8c04('0xcf')][_0x8c04('0x126')](db[_0x8c04('0xf5')],{'as':_0x8c04('0x16a'),'foreignKey':_0x8c04('0x17a')});db[_0x8c04('0xcf')][_0x8c04('0x126')](db['CmContact'],{'as':'Contact','foreignKey':_0x8c04('0x163')});db[_0x8c04('0xcf')][_0x8c04('0x126')](db['ChatInteraction'],{});db[_0x8c04('0xcf')][_0x8c04('0x126')](db[_0x8c04('0x193')],{});db[_0x8c04('0xcf')][_0x8c04('0x126')](db[_0x8c04('0x11')],{});db[_0x8c04('0xcf')]['belongsTo'](db['ChatQueue'],{});db[_0x8c04('0xd1')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'onDelete':_0x8c04('0x114'),'foreignKey':_0x8c04('0x1cc')});db[_0x8c04('0xd1')]['belongsTo'](db[_0x8c04('0x11')],{'onDelete':'cascade','foreignKey':_0x8c04('0x1cd')});db[_0x8c04('0xd5')]['hasMany'](db[_0x8c04('0x1ce')],{'foreignKey':'SessionId','onDelete':_0x8c04('0x114')});db[_0x8c04('0xd5')][_0x8c04('0x117')](db[_0x8c04('0xd2')],{'foreignKey':_0x8c04('0x1cf'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0xd7')][_0x8c04('0x126')](db[_0x8c04('0x13f')],{});db[_0x8c04('0xd7')][_0x8c04('0x126')](db['CmList'],{'as':_0x8c04('0x16a'),'foreignKey':'ListId'});db[_0x8c04('0xd7')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':_0x8c04('0x162'),'foreignKey':_0x8c04('0x163')});db[_0x8c04('0xd7')]['belongsTo'](db['SmsInteraction'],{});db[_0x8c04('0xd7')][_0x8c04('0x126')](db[_0x8c04('0x183')],{});db[_0x8c04('0xd7')][_0x8c04('0x126')](db['User'],{});db[_0x8c04('0xd7')][_0x8c04('0x126')](db[_0x8c04('0x59')],{});db[_0x8c04('0xdc')]['hasMany'](db[_0x8c04('0xd5')],{'foreignKey':'ProjectId'});db[_0x8c04('0xdc')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x8c04('0x1d0')});db[_0x8c04('0xdc')][_0x8c04('0x117')](db[_0x8c04('0xd2')],{'foreignKey':_0x8c04('0x1d0')});db[_0x8c04('0xe1')][_0x8c04('0x12a')](db['User'],{'as':_0x8c04('0x174'),'through':'user_has_square_projects'});db[_0x8c04('0xe6')][_0x8c04('0x12a')](db['User'],{'as':_0x8c04('0x157'),'through':'user_has_teams'});db[_0x8c04('0xe6')][_0x8c04('0x12a')](db[_0x8c04('0x1b')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db['Team'][_0x8c04('0x12a')](db[_0x8c04('0x3f')],{'through':_0x8c04('0x16c'),'as':_0x8c04('0x135')});db['Team']['belongsToMany'](db[_0x8c04('0x6a')],{'through':_0x8c04('0x198'),'as':_0x8c04('0x1d1')});db[_0x8c04('0xe6')][_0x8c04('0x12a')](db[_0x8c04('0x4f')],{'through':_0x8c04('0x181'),'as':_0x8c04('0x136')});db[_0x8c04('0xe6')][_0x8c04('0x12a')](db[_0x8c04('0x59')],{'through':_0x8c04('0x186'),'as':'SmsQueues'});db[_0x8c04('0xe6')]['belongsToMany'](db[_0x8c04('0x137')],{'through':_0x8c04('0x18b'),'as':_0x8c04('0x1d2')});db['Team'][_0x8c04('0x12a')](db['WhatsappQueue'],{'through':_0x8c04('0x1d3'),'as':'WhatsappQueues'});db['Team'][_0x8c04('0x12a')](db[_0x8c04('0xf6')],{'through':_0x8c04('0x1d4'),'as':_0x8c04('0x1d5')});db[_0x8c04('0xe8')][_0x8c04('0x117')](db[_0x8c04('0x73')],{'as':'Hoppers','foreignKey':_0x8c04('0x19e')});db[_0x8c04('0xe8')]['hasMany'](db[_0x8c04('0x76')],{'as':_0x8c04('0x14c'),'foreignKey':'CampaignId'});db[_0x8c04('0xe8')]['hasMany'](db[_0x8c04('0x78')],{'as':_0x8c04('0x19b'),'foreignKey':_0x8c04('0x19e')});db[_0x8c04('0xe8')]['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x8c04('0x19e')});db['Campaign'][_0x8c04('0x126')](db[_0x8c04('0x150')],{'as':_0x8c04('0x150'),'foreignKey':_0x8c04('0x151')});db[_0x8c04('0xe8')]['belongsTo'](db[_0x8c04('0x150')],{'as':_0x8c04('0x152'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x8c04('0x126')](db[_0x8c04('0x86')],{'as':'Interval','foreignKey':'IntervalId'});db['Campaign'][_0x8c04('0x126')](db[_0x8c04('0xe1')],{'as':_0x8c04('0xe1'),'foreignKey':'SquareProjectId'});db['Campaign']['belongsToMany'](db[_0x8c04('0xf5')],{'as':_0x8c04('0x12d'),'through':_0x8c04('0x1d6')});db[_0x8c04('0xe8')][_0x8c04('0x12a')](db['CmList'],{'as':_0x8c04('0x159'),'through':'campaigns_has_cm_blacklists'});db['Attachment'][_0x8c04('0x126')](db['ChatOfflineMessage'],{'as':_0x8c04('0x69'),'foreignKey':_0x8c04('0x177')});db['MailTransferReport'][_0x8c04('0x126')](db['MailMessage'],{});db[_0x8c04('0xed')][_0x8c04('0x126')](db['MailInteraction'],{});db[_0x8c04('0xed')][_0x8c04('0x126')](db[_0x8c04('0x3d')],{'foreignKey':_0x8c04('0x1d7'),'as':_0x8c04('0x1d8')});db['MailTransferReport'][_0x8c04('0x126')](db[_0x8c04('0x11')],{'foreignKey':_0x8c04('0x1d9'),'as':'FromAgent'});db[_0x8c04('0xed')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'foreignKey':_0x8c04('0x1da'),'as':'ToAgent'});db[_0x8c04('0xed')][_0x8c04('0x126')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x8c04('0x1db')});db['MailTransferReport'][_0x8c04('0x126')](db[_0x8c04('0x3d')],{'foreignKey':_0x8c04('0x1dc'),'as':_0x8c04('0x1dd')});db[_0x8c04('0xef')][_0x8c04('0x126')](db['ChatMessage'],{});db[_0x8c04('0xef')]['belongsTo'](db[_0x8c04('0x66')],{});db[_0x8c04('0xef')][_0x8c04('0x126')](db[_0x8c04('0x60')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0x8c04('0xef')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'foreignKey':_0x8c04('0x1d9'),'as':_0x8c04('0x1de')});db[_0x8c04('0xef')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'foreignKey':_0x8c04('0x1da'),'as':_0x8c04('0x1df')});db[_0x8c04('0xef')][_0x8c04('0x126')](db[_0x8c04('0x6a')],{'foreignKey':_0x8c04('0x1e0'),'as':'ToQueue'});db[_0x8c04('0xef')]['belongsTo'](db[_0x8c04('0x60')],{'foreignKey':'ToChatWebsiteId','as':_0x8c04('0x1dd')});db[_0x8c04('0xf1')][_0x8c04('0x126')](db[_0x8c04('0x4d')],{});db['FaxTransferReport'][_0x8c04('0x126')](db[_0x8c04('0x11f')],{});db[_0x8c04('0xf1')]['belongsTo'](db[_0x8c04('0x139')],{'foreignKey':_0x8c04('0x1e1'),'as':_0x8c04('0x1d8')});db['FaxTransferReport'][_0x8c04('0x126')](db[_0x8c04('0x11')],{'foreignKey':_0x8c04('0x1d9'),'as':_0x8c04('0x1de')});db[_0x8c04('0xf1')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'foreignKey':_0x8c04('0x1da'),'as':_0x8c04('0x1df')});db[_0x8c04('0xf1')][_0x8c04('0x126')](db[_0x8c04('0x4f')],{'foreignKey':_0x8c04('0x1e2'),'as':_0x8c04('0x1db')});db[_0x8c04('0xf1')][_0x8c04('0x126')](db[_0x8c04('0x139')],{'foreignKey':_0x8c04('0x1e3'),'as':_0x8c04('0x1dd')});db[_0x8c04('0xf2')][_0x8c04('0x126')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport'][_0x8c04('0x126')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x8c04('0x126')](db[_0x8c04('0x13c')],{'foreignKey':_0x8c04('0x1e4'),'as':_0x8c04('0x1d8')});db[_0x8c04('0xf2')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'foreignKey':'FromUserId','as':_0x8c04('0x1de')});db[_0x8c04('0xf2')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'foreignKey':_0x8c04('0x1da'),'as':_0x8c04('0x1df')});db[_0x8c04('0xf2')][_0x8c04('0x126')](db[_0x8c04('0x137')],{'foreignKey':_0x8c04('0x1e5'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0x8c04('0x126')](db[_0x8c04('0x13c')],{'foreignKey':_0x8c04('0x1e6'),'as':_0x8c04('0x1dd')});db[_0x8c04('0xf4')]['belongsTo'](db['SmsMessage'],{});db[_0x8c04('0xf4')][_0x8c04('0x126')](db['SmsInteraction'],{});db[_0x8c04('0xf4')][_0x8c04('0x126')](db[_0x8c04('0x13f')],{'foreignKey':_0x8c04('0x1e7'),'as':_0x8c04('0x1d8')});db[_0x8c04('0xf4')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'foreignKey':_0x8c04('0x1d9'),'as':_0x8c04('0x1de')});db[_0x8c04('0xf4')]['belongsTo'](db['User'],{'foreignKey':_0x8c04('0x1da'),'as':'ToAgent'});db[_0x8c04('0xf4')][_0x8c04('0x126')](db[_0x8c04('0x59')],{'foreignKey':'ToSmsQueueId','as':_0x8c04('0x1db')});db['SmsTransferReport'][_0x8c04('0x126')](db[_0x8c04('0x13f')],{'foreignKey':'ToSmsAccountId','as':_0x8c04('0x1dd')});db['CmList']['hasMany'](db[_0x8c04('0x82')],{'as':_0x8c04('0x168'),'foreignKey':_0x8c04('0x17a'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0xf5')][_0x8c04('0x117')](db[_0x8c04('0x7c')],{'as':'CustomFields','foreignKey':_0x8c04('0x17a')});db[_0x8c04('0xf5')][_0x8c04('0x117')](db[_0x8c04('0x71')],{'as':_0x8c04('0x12b'),'onDelete':'cascade','foreignKey':_0x8c04('0x17a')});db[_0x8c04('0xf5')][_0x8c04('0x117')](db[_0x8c04('0x76')],{'as':_0x8c04('0x14c'),'foreignKey':_0x8c04('0x17a')});db[_0x8c04('0xf5')][_0x8c04('0x117')](db[_0x8c04('0x78')],{'as':_0x8c04('0x11c'),'foreignKey':_0x8c04('0x17a')});db[_0x8c04('0xf5')][_0x8c04('0x117')](db[_0x8c04('0x7a')],{'as':_0x8c04('0x7a'),'foreignKey':_0x8c04('0x17a')});db['CmList'][_0x8c04('0x12a')](db[_0x8c04('0x1b')],{'as':'Queues','through':_0x8c04('0x156')});db[_0x8c04('0xf5')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':'Agents','through':_0x8c04('0x12e')});db['VoicePrefix'][_0x8c04('0x117')](db[_0x8c04('0x18')],{'as':_0x8c04('0x11b'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0xf6')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x157'),'through':_0x8c04('0x110')});db['VoicePrefix'][_0x8c04('0x12a')](db[_0x8c04('0xe6')],{'through':_0x8c04('0x1d4'),'as':_0x8c04('0x158')});db[_0x8c04('0xf8')][_0x8c04('0x117')](db[_0x8c04('0x11')],{'as':'Users','foreignKey':'userProfileId'});db[_0x8c04('0xf8')][_0x8c04('0x117')](db[_0x8c04('0xfa')],{'as':'UserProfileSections','foreignKey':_0x8c04('0x127'),'onDelete':_0x8c04('0x114')});db['UserProfileSection'][_0x8c04('0x117')](db[_0x8c04('0xfc')],{'as':_0x8c04('0x1e8'),'foreignKey':_0x8c04('0x1e9'),'onDelete':'cascade'});db[_0x8c04('0x100')][_0x8c04('0x117')](db[_0x8c04('0x82')],{'as':_0x8c04('0x168'),'foreignKey':_0x8c04('0x1ea'),'onDelete':_0x8c04('0x114')});db[_0x8c04('0x100')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8c04('0x1ea')});db['WhatsappAccount'][_0x8c04('0x117')](db[_0x8c04('0x1eb')],{'as':_0x8c04('0x15d'),'foreignKey':_0x8c04('0x1ea')});db['WhatsappAccount'][_0x8c04('0x117')](db[_0x8c04('0x104')],{'as':_0x8c04('0x169')});db[_0x8c04('0x100')]['hasMany'](db[_0x8c04('0x102')],{'as':_0x8c04('0x146')});db[_0x8c04('0x100')]['belongsTo'](db[_0x8c04('0xf5')],{'as':_0x8c04('0x16a'),'foreignKey':'ListId'});db['WhatsappAccount'][_0x8c04('0x126')](db[_0x8c04('0x88')],{'as':'mandatoryDispositionPause','foreignKey':_0x8c04('0x155')});db[_0x8c04('0x100')]['belongsToMany'](db[_0x8c04('0x11')],{'as':'Agents','through':_0x8c04('0x142')});db[_0x8c04('0x102')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'onDelete':_0x8c04('0x166')});db[_0x8c04('0x102')][_0x8c04('0x126')](db[_0x8c04('0x109')],{'onDelete':_0x8c04('0x166')});db[_0x8c04('0x102')][_0x8c04('0x126')](db[_0x8c04('0x100')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x8c04('0x126')](db[_0x8c04('0x86')],{'onDelete':_0x8c04('0x166'),'foreignKey':'IntervalId'});db[_0x8c04('0x102')][_0x8c04('0x126')](db[_0x8c04('0x170')],{'onDelete':'restrict','foreignKey':_0x8c04('0x179')});db[_0x8c04('0x104')]['hasMany'](db['WhatsappMessage'],{'as':_0x8c04('0x15d'),'onDelete':'cascade','foreignKey':_0x8c04('0x1ec')});db[_0x8c04('0x104')][_0x8c04('0x126')](db[_0x8c04('0x100')],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x1ea')});db[_0x8c04('0x104')][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':_0x8c04('0x162'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x8c04('0x126')](db[_0x8c04('0x11')],{'as':_0x8c04('0x16f'),'foreignKey':_0x8c04('0x119')});db[_0x8c04('0x104')][_0x8c04('0x12a')](db['Tag'],{'through':_0x8c04('0x1ed'),'as':_0x8c04('0x172')});db[_0x8c04('0x104')]['belongsToMany'](db[_0x8c04('0x170')],{'through':_0x8c04('0x1ed'),'as':'ThroughTags'});db[_0x8c04('0x104')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x174'),'through':'user_has_whatsapp_interactions','foreignKey':_0x8c04('0x1ec')});db[_0x8c04('0x1eb')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'as':_0x8c04('0x11')});db['WhatsappMessage'][_0x8c04('0x126')](db['CmContact'],{'onDelete':_0x8c04('0x114'),'as':_0x8c04('0x162')});db[_0x8c04('0x1eb')]['belongsTo'](db[_0x8c04('0x104')],{'onDelete':'cascade','as':_0x8c04('0x176'),'foreignKey':_0x8c04('0x1ec')});db[_0x8c04('0x1eb')][_0x8c04('0x126')](db[_0x8c04('0x100')],{'as':_0x8c04('0x16e'),'foreignKey':_0x8c04('0x1ea')});db[_0x8c04('0x107')][_0x8c04('0x126')](db[_0x8c04('0x100')],{});db['WhatsappQueueReport'][_0x8c04('0x126')](db[_0x8c04('0xf5')],{'as':_0x8c04('0x16a'),'foreignKey':_0x8c04('0x17a')});db['WhatsappQueueReport'][_0x8c04('0x126')](db[_0x8c04('0x71')],{'as':'Contact','foreignKey':_0x8c04('0x163')});db[_0x8c04('0x107')][_0x8c04('0x126')](db[_0x8c04('0x104')],{});db[_0x8c04('0x107')][_0x8c04('0x126')](db['WhatsappQueue'],{});db['WhatsappQueueReport']['belongsTo'](db['WhatsappMessage'],{});db[_0x8c04('0x107')][_0x8c04('0x126')](db[_0x8c04('0x11')],{});db['WhatsappTransferReport'][_0x8c04('0x126')](db[_0x8c04('0x1eb')],{});db[_0x8c04('0x108')]['belongsTo'](db[_0x8c04('0x104')],{});db[_0x8c04('0x108')][_0x8c04('0x126')](db[_0x8c04('0x100')],{'foreignKey':_0x8c04('0x1ee'),'as':'FromAccount'});db[_0x8c04('0x108')]['belongsTo'](db[_0x8c04('0x100')],{'foreignKey':_0x8c04('0x1ef'),'as':_0x8c04('0x1dd')});db['WhatsappTransferReport']['belongsTo'](db[_0x8c04('0x109')],{'foreignKey':_0x8c04('0x1f0'),'as':_0x8c04('0x1db')});db[_0x8c04('0x108')]['belongsTo'](db['User'],{'foreignKey':_0x8c04('0x1d9'),'as':_0x8c04('0x1de')});db[_0x8c04('0x108')]['belongsTo'](db[_0x8c04('0x11')],{'foreignKey':_0x8c04('0x1da'),'as':_0x8c04('0x1df')});db[_0x8c04('0x109')][_0x8c04('0x12a')](db[_0x8c04('0x11')],{'as':_0x8c04('0x157'),'through':_0x8c04('0x38'),'foreignKey':'WhatsappQueueId'});db[_0x8c04('0x109')][_0x8c04('0x12a')](db[_0x8c04('0xe6')],{'through':_0x8c04('0x1d3'),'as':_0x8c04('0x158')});db[_0x8c04('0x115')][_0x8c04('0x126')](db[_0x8c04('0x11')],{'as':_0x8c04('0x1f1'),'foreignKey':_0x8c04('0x119'),'onDelete':'cascade','hooks':!![]});db[_0x8c04('0x10b')]['hasOne'](db[_0x8c04('0xc3')],{'as':'Dynamics365Account','onDelete':_0x8c04('0x166')});db[_0x8c04('0x10b')]['hasOne'](db[_0x8c04('0x3a')],{'as':'Imap','onDelete':_0x8c04('0x166')});db[_0x8c04('0x10b')]['hasOne'](db['MailServerOut'],{'as':_0x8c04('0x1f2'),'onDelete':_0x8c04('0x166')});module[_0x8c04('0x1f3')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x6518=['Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareMessage','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/cloudProvider/cloudProvider.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','userSetting','UserId','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','CmHopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteractions','WhatsappInteractions','UserNotification','SenderId','belongsTo','Groups','chat_group_has_users','Contacts','belongsToMany','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','Applications','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','TeamVoiceQueue','mailboxuser','VoiceMailMessage','mailbox','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','CloudProvider','CloudProviderId','restrict','MailServerOut','Imap','Dispositions','CannedAnswer','Messages','Interactions','List','ListId','TemplateId','team_has_mail_queues','mail_interaction_has_tags','ThroughTags','Users','MailInteractionId','Attachments','MailMessage','Account','ChatOfflineMessage','ChatOfflineMessageId','IntervalId','TagId','MailQueueReport','ContactId','Disposition','FaxAccountId','FaxInteractionId','Owner','fax_interaction_has_tags','Tags','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','Teams','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','Attachment','team_has_openchannel_queues','ChatWebsiteId','Answers','OpenchannelQueueReport','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Members','CompanyId','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','OneAll','Any','OneAny','AutomationAnyId','Actions','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','Mohs','whatsapp_interaction_has_tags','AnyCondition','TriggerId','Fields','DefaultReportId','AnalyticMetric','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','AccountId','Subject','Description','FieldId','VariableId','SugarcrmField','Field','int_desk_configuration_has_tags','ZohoField','ZendeskAccount','ZendeskField','int_freshdesk_configuration_has_tags','ServicenowField','Dynamics365Account','Dynamics365Configuration','FreshsalesConfiguration','ToId','SessionId','ProjectId','team_has_whatsapp_queues','TeamVoicePrefix','HopperFinals','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToFaxQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','HopperHistory','userProfileId','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Smtp','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','mysql','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','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','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoConfiguration','../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','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model'];(function(_0x3e071d,_0x4d7e19){var _0x553223=function(_0x3f4c3e){while(--_0x3f4c3e){_0x3e071d['push'](_0x3e071d['shift']());}};_0x553223(++_0x4d7e19);}(_0x6518,0x12d));var _0x8651=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x6518[_0x618414];return _0x21c19a;};'use strict';var config=require(_0x8651('0x0'));var Sequelize=require(_0x8651('0x1'));var _=require(_0x8651('0x2'));var jstz=require('jstz');var timezone=jstz[_0x8651('0x3')]();config[_0x8651('0x1')]=_[_0x8651('0x4')](config[_0x8651('0x1')],{'database':'motion2','username':_0x8651('0x5'),'password':_0x8651('0x6'),'options':{'host':_0x8651('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x8651('0x8')},'logging':![],'timezone':timezone[_0x8651('0x9')](),'define':{'charset':_0x8651('0xa'),'collate':_0x8651('0xb')}}});config[_0x8651('0xc')]=_['defaultsDeep'](config[_0x8651('0xc')],{'database':_0x8651('0xd'),'username':_0x8651('0x5'),'password':_0x8651('0x6'),'options':{'host':_0x8651('0x7'),'port':0xcea,'dialect':_0x8651('0xe'),'dialectOptions':{'charset':_0x8651('0x8')},'logging':![],'timezone':timezone[_0x8651('0x9')](),'define':{'charset':'utf8','collate':_0x8651('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8651('0x1')][_0x8651('0xf')],config[_0x8651('0x1')][_0x8651('0x10')],config['sequelize'][_0x8651('0x11')],config[_0x8651('0x1')][_0x8651('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8651('0xc')][_0x8651('0xf')],config[_0x8651('0xc')][_0x8651('0x10')],config[_0x8651('0xc')][_0x8651('0x11')],config['sequelizeHistory']['options'])};db[_0x8651('0x13')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x15'));db[_0x8651('0x16')]=db['sequelize']['import'](_0x8651('0x17'));db[_0x8651('0x18')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x19'));db[_0x8651('0x1a')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x1b'));db[_0x8651('0x1c')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x8651('0x1d')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x1e'));db[_0x8651('0x1f')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x20'));db[_0x8651('0x21')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x22'));db[_0x8651('0x23')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x24'));db['VoiceMailMessage']=db['sequelize'][_0x8651('0x14')](_0x8651('0x25'));db[_0x8651('0x26')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x27'));db[_0x8651('0x28')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x29'));db[_0x8651('0x2a')]=db[_0x8651('0x1')]['import'](_0x8651('0x2b'));db[_0x8651('0x2c')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x2d'));db[_0x8651('0x2e')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x2f'));db['Trunk']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x30'));db[_0x8651('0x31')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x32'));db[_0x8651('0x33')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x34'));db[_0x8651('0x35')]=db['sequelize']['import'](_0x8651('0x36'));db[_0x8651('0x37')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x38'));db[_0x8651('0x39')]=db['sequelize'][_0x8651('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x8651('0x3a')]=db['sequelize']['import'](_0x8651('0x3b'));db[_0x8651('0x3c')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x3d'));db[_0x8651('0x3e')]=db['sequelize'][_0x8651('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x8651('0x3f')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x40'));db[_0x8651('0x41')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x42'));db['MailServerOut']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x43'));db[_0x8651('0x44')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x45'));db[_0x8651('0x46')]=db[_0x8651('0x1')]['import'](_0x8651('0x47'));db['MailSubstatus']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x48'));db[_0x8651('0x49')]=db[_0x8651('0x1')]['import']('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x4a'));db[_0x8651('0x4b')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x4c'));db[_0x8651('0x4d')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/dashboard/dashboard.model');db[_0x8651('0x4e')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/dashboardItem/dashboardItem.model');db[_0x8651('0x4f')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x50'));db[_0x8651('0x51')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x52'));db['FaxInteraction']=db['sequelize']['import']('../api/faxInteraction/faxInteraction.model');db[_0x8651('0x53')]=db[_0x8651('0x1')]['import'](_0x8651('0x54'));db[_0x8651('0x55')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x56'));db[_0x8651('0x57')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x58'));db[_0x8651('0x59')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0x8651('0x1')]['import']('../api/smsApplication/smsApplication.model');db[_0x8651('0x5a')]=db[_0x8651('0x1')]['import'](_0x8651('0x5b'));db[_0x8651('0x5c')]=db[_0x8651('0x1')]['import'](_0x8651('0x5d'));db['SmsQueue']=db[_0x8651('0x1')]['import'](_0x8651('0x5e'));db[_0x8651('0x5f')]=db[_0x8651('0x1')]['import'](_0x8651('0x60'));db[_0x8651('0x61')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x62'));db[_0x8651('0x63')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x64'));db['OpenchannelMessage']=db[_0x8651('0x1')][_0x8651('0x14')]('../api/openchannelMessage/openchannelMessage.model');db[_0x8651('0x65')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x66'));db['ChatWebsite']=db[_0x8651('0x1')][_0x8651('0x14')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x67'));db[_0x8651('0x68')]=db['sequelize']['import']('../api/chatApplication/chatApplication.model');db[_0x8651('0x69')]=db['sequelize']['import'](_0x8651('0x6a'));db[_0x8651('0x6b')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x6c'));db['ChatOfflineMessage']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x6d'));db[_0x8651('0x6e')]=db[_0x8651('0x1')]['import'](_0x8651('0x6f'));db[_0x8651('0x70')]=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db[_0x8651('0x71')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x8651('0x72')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x73'));db[_0x8651('0x74')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/cmContact/cmContact.model');db[_0x8651('0x75')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0x8651('0x1')][_0x8651('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x76'));db['CmHopperHistory']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x77'));db[_0x8651('0x78')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x8651('0x79')]=db[_0x8651('0x1')]['import'](_0x8651('0x7a'));db[_0x8651('0x7b')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/action/action.model');db[_0x8651('0x7c')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x7d'));db['CannedAnswer']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x7e'));db['Disposition']=db[_0x8651('0x1')][_0x8651('0x14')]('../api/disposition/disposition.model');db[_0x8651('0x7f')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x80'));db[_0x8651('0x81')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x82'));db[_0x8651('0x83')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x84'));db[_0x8651('0x85')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x86'));db[_0x8651('0x87')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db['sequelize'][_0x8651('0x14')](_0x8651('0x88'));db[_0x8651('0x89')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/sound/sound.model');db[_0x8651('0x8a')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x8b'));db[_0x8651('0x8c')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x8d'));db[_0x8651('0x8e')]=db[_0x8651('0x1')]['import']('../api/trigger/trigger.model');db[_0x8651('0x8f')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x90'));db[_0x8651('0x91')]=db[_0x8651('0x1')]['import']('../api/integration/integration.model');db[_0x8651('0x92')]=db[_0x8651('0x1')]['import'](_0x8651('0x93'));db[_0x8651('0x94')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x95'));db[_0x8651('0x96')]=db[_0x8651('0x1')]['import'](_0x8651('0x97'));db[_0x8651('0x98')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x99'));db['AnalyticMetric']=db[_0x8651('0x1')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x8651('0x9a')]=db['sequelize'][_0x8651('0x14')](_0x8651('0x9b'));db[_0x8651('0x9c')]=db['sequelize']['import'](_0x8651('0x9d'));db[_0x8651('0x9e')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x9f'));db[_0x8651('0xa0')]=db[_0x8651('0x1')]['import'](_0x8651('0xa1'));db[_0x8651('0xa2')]=db[_0x8651('0x1')]['import'](_0x8651('0xa3'));db[_0x8651('0xa4')]=db[_0x8651('0x1')]['import'](_0x8651('0xa5'));db[_0x8651('0xa6')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xa7'));db['SugarcrmField']=db['sequelize'][_0x8651('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x8651('0xa8')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xa9'));db[_0x8651('0xaa')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xab'));db[_0x8651('0xac')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/intDeskField/intDeskField.model');db[_0x8651('0xad')]=db[_0x8651('0x1')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0x8651('0xae')]=db['sequelize'][_0x8651('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db['sequelize'][_0x8651('0x14')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xaf'));db[_0x8651('0xb0')]=db['sequelize']['import'](_0x8651('0xb1'));db['ZendeskField']=db['sequelize']['import'](_0x8651('0xb2'));db[_0x8651('0xb3')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xb4'));db[_0x8651('0xb5')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xb6'));db[_0x8651('0xb7')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xb8'));db[_0x8651('0xb9')]=db['sequelize'][_0x8651('0x14')](_0x8651('0xba'));db[_0x8651('0xbb')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x8651('0xbc')]=db['sequelize'][_0x8651('0x14')](_0x8651('0xbd'));db[_0x8651('0xbe')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xbf'));db[_0x8651('0xc0')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xc1'));db['ServicenowField']=db['sequelize'][_0x8651('0x14')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0x8651('0x1')]['import'](_0x8651('0xc2'));db['Dynamics365Configuration']=db[_0x8651('0x1')]['import'](_0x8651('0xc3'));db[_0x8651('0xc4')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xc5'));db[_0x8651('0xc6')]=db[_0x8651('0x1')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x8651('0x1')]['import'](_0x8651('0xc7'));db[_0x8651('0xc8')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xc9'));db[_0x8651('0x91')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xca'));db[_0x8651('0xcb')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xcc'));db[_0x8651('0xcd')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xce'));db[_0x8651('0xcf')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xd0'));db[_0x8651('0xd1')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xd2'));db[_0x8651('0xd3')]=db[_0x8651('0x1')]['import'](_0x8651('0xd4'));db[_0x8651('0xd5')]=db['sequelize'][_0x8651('0x14')](_0x8651('0xd6'));db[_0x8651('0xd7')]=db['sequelize'][_0x8651('0x14')](_0x8651('0xd8'));db[_0x8651('0xd9')]=db['sequelize'][_0x8651('0x14')](_0x8651('0xda'));db[_0x8651('0xdb')]=db['sequelize'][_0x8651('0x14')](_0x8651('0xdc'));db[_0x8651('0xdd')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xde'));db['Setting']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xdf'));db['SquareOdbc']=db['sequelize'][_0x8651('0x14')](_0x8651('0xe0'));db['SquareProject']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xe1'));db['SquareRecording']=db[_0x8651('0x1')][_0x8651('0x14')]('../api/squareRecording/squareRecording.model');db[_0x8651('0xe2')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0x8651('0x1')][_0x8651('0x14')]('../api/team/team.model');db['License']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xe3'));db[_0x8651('0xe4')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xe5'));db[_0x8651('0xe6')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xe7'));db['Attachment']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xe8'));db[_0x8651('0xe9')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xea'));db[_0x8651('0xeb')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xec'));db[_0x8651('0xed')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0x8651('0xee')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xef'));db['OpenchannelTransferReport']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xf0'));db[_0x8651('0xf1')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xf2'));db[_0x8651('0xf3')]=db[_0x8651('0x1')]['import'](_0x8651('0xf4'));db[_0x8651('0xf5')]=db[_0x8651('0x1')]['import']('../api/voicePrefix/voicePrefix.model');db[_0x8651('0xf6')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/userProfile/userProfile.model');db[_0x8651('0xf7')]=db[_0x8651('0x1')]['import'](_0x8651('0xf8'));db[_0x8651('0xf9')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xfa'));db['UserNotification']=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xfb'));db[_0x8651('0xfc')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0xfd'));db[_0x8651('0xfe')]=db['sequelize']['import'](_0x8651('0xff'));db[_0x8651('0x100')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x8651('0x101')]=db[_0x8651('0x1')][_0x8651('0x14')]('../api/whatsappMessage/whatsappMessage.model');db[_0x8651('0x102')]=db[_0x8651('0x1')]['import'](_0x8651('0x103'));db[_0x8651('0x104')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x105'));db[_0x8651('0x106')]=db[_0x8651('0x1')]['import']('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db['sequelize']['import'](_0x8651('0x107'));db['TeamVoiceQueue']=db[_0x8651('0x1')]['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x8651('0x1')]['import'](_0x8651('0x108'));db[_0x8651('0x109')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x10a'));db[_0x8651('0x10b')]=db[_0x8651('0x1')][_0x8651('0x14')](_0x8651('0x10c'));db['User'][_0x8651('0x10d')](db['VoiceMail'],{'as':_0x8651('0x23'),'onDelete':_0x8651('0x10e'),'foreignKey':'UserId'});db[_0x8651('0x13')]['hasOne'](db['UserSetting'],{'as':_0x8651('0x10f'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x13')][_0x8651('0x111')](db[_0x8651('0x1f')],{'as':'Recordings','foreignKey':_0x8651('0x110')});db[_0x8651('0x13')][_0x8651('0x111')](db[_0x8651('0x33')],{'as':_0x8651('0x112'),'foreignKey':'UserId'});db[_0x8651('0x13')][_0x8651('0x111')](db[_0x8651('0x1a')],{'as':_0x8651('0x113'),'onDelete':'cascade','hooks':!![]});db[_0x8651('0x13')]['hasMany'](db[_0x8651('0x114')],{'as':'HopperFinals','foreignKey':_0x8651('0x110')});db[_0x8651('0x13')]['hasMany'](db[_0x8651('0x115')],{'as':'HopperHistory','foreignKey':_0x8651('0x110')});db[_0x8651('0x13')][_0x8651('0x111')](db['ReportAgentPreview'],{'as':_0x8651('0x78'),'foreignKey':'UserId'});db[_0x8651('0x13')][_0x8651('0x111')](db['OpenchannelInteraction'],{'as':_0x8651('0x116'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x13')]['hasMany'](db[_0x8651('0x69')],{'as':_0x8651('0x117'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x13')]['hasMany'](db[_0x8651('0x5a')],{'as':_0x8651('0x118'),'foreignKey':_0x8651('0x110')});db['User'][_0x8651('0x111')](db[_0x8651('0x119')],{'as':'FaxInteractions','foreignKey':_0x8651('0x110')});db[_0x8651('0x13')][_0x8651('0x111')](db[_0x8651('0x49')],{'as':_0x8651('0x11a'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x13')][_0x8651('0x111')](db[_0x8651('0x100')],{'as':_0x8651('0x11b'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x13')][_0x8651('0x111')](db[_0x8651('0x11c')],{'as':'UserNotifications','foreignKey':_0x8651('0x11d')});db[_0x8651('0x13')][_0x8651('0x11e')](db[_0x8651('0xf6')],{'as':_0x8651('0xf6'),'foreignKey':'userProfileId'});db[_0x8651('0x13')]['belongsToMany'](db[_0x8651('0x70')],{'as':_0x8651('0x11f'),'through':_0x8651('0x120')});db[_0x8651('0x13')]['belongsToMany'](db[_0x8651('0x74')],{'as':_0x8651('0x121'),'through':'cm_user_has_contacts'});db[_0x8651('0x13')][_0x8651('0x122')](db['CmList'],{'as':_0x8651('0x123'),'through':_0x8651('0x124')});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x125')],{'through':_0x8651('0x126')});db[_0x8651('0x13')][_0x8651('0x122')](db['MailInteraction'],{'as':_0x8651('0x11a'),'through':_0x8651('0x127')});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x69')],{'as':_0x8651('0x117'),'through':_0x8651('0x128')});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x119')],{'as':_0x8651('0x129'),'through':_0x8651('0x12a')});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x5a')],{'as':_0x8651('0x118'),'through':_0x8651('0x12b')});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x63')],{'as':_0x8651('0x116'),'through':_0x8651('0x12c')});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x100')],{'as':_0x8651('0x11b'),'through':_0x8651('0x12d')});db['User']['belongsToMany'](db[_0x8651('0x1d')],{'as':_0x8651('0x12e'),'through':_0x8651('0x35'),'required':![]});db[_0x8651('0x13')]['belongsToMany'](db[_0x8651('0xf5')],{'as':_0x8651('0x12f'),'through':_0x8651('0x109'),'required':![]});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x46')],{'as':_0x8651('0x130'),'through':_0x8651('0x39'),'required':![]});db['User'][_0x8651('0x122')](db[_0x8651('0x6e')],{'as':_0x8651('0x131'),'through':_0x8651('0x37'),'required':![],'hooks':!![]});db['User'][_0x8651('0x122')](db[_0x8651('0x55')],{'as':_0x8651('0x132'),'through':_0x8651('0x3a'),'required':![]});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x133')],{'as':_0x8651('0x134'),'through':_0x8651('0x3c'),'required':![]});db[_0x8651('0x13')][_0x8651('0x122')](db['OpenchannelQueue'],{'as':_0x8651('0x135'),'through':_0x8651('0x3e'),'required':![]});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x106')],{'as':_0x8651('0x136'),'through':'UserWhatsappQueue','required':![]});db['User'][_0x8651('0x122')](db[_0x8651('0xf3')],{'through':_0x8651('0x124')});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x137')],{'as':_0x8651('0x138'),'through':_0x8651('0x139')});db['User']['belongsToMany'](db[_0x8651('0x4f')],{'as':'FaxAccounts','through':_0x8651('0x13a')});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x44')],{'as':_0x8651('0x13b'),'through':_0x8651('0x13c')});db['User'][_0x8651('0x122')](db[_0x8651('0x5f')],{'as':_0x8651('0x13d'),'through':_0x8651('0x13e')});db[_0x8651('0x13')]['belongsToMany'](db[_0x8651('0x59')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0x8651('0x13')]['belongsToMany'](db['WhatsappAccount'],{'as':_0x8651('0x13f'),'through':_0x8651('0x140')});db[_0x8651('0x13')][_0x8651('0x122')](db[_0x8651('0x141')],{'as':_0x8651('0x142'),'through':_0x8651('0x143')});db[_0x8651('0x16')][_0x8651('0x111')](db[_0x8651('0x1a')],{'as':_0x8651('0x144'),'onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0x8651('0x18')][_0x8651('0x111')](db[_0x8651('0x1a')],{'onDelete':'cascade'});db[_0x8651('0x1a')][_0x8651('0x111')](db[_0x8651('0x1a')],{'as':_0x8651('0x145'),'onDelete':_0x8651('0x10e')});db['VoiceMusicOnHold'][_0x8651('0x122')](db[_0x8651('0x89')],{'as':'Sounds','through':_0x8651('0x146')});db['VoiceQueue'][_0x8651('0x111')](db[_0x8651('0x33')],{'as':'Members','foreignKey':_0x8651('0x147')});db[_0x8651('0x1d')][_0x8651('0x111')](db[_0x8651('0x75')],{'as':_0x8651('0x148'),'foreignKey':_0x8651('0x147')});db[_0x8651('0x1d')][_0x8651('0x111')](db[_0x8651('0x114')],{'as':'HopperFinals','foreignKey':_0x8651('0x147')});db[_0x8651('0x1d')][_0x8651('0x111')](db['CmHopperHistory'],{'as':_0x8651('0x149'),'foreignKey':'VoiceQueueId'});db[_0x8651('0x1d')][_0x8651('0x111')](db[_0x8651('0x78')],{'as':'ReportAgentPreview','foreignKey':_0x8651('0x147')});db[_0x8651('0x1d')][_0x8651('0x111')](db[_0x8651('0x14a')],{'as':_0x8651('0x14b'),'foreignKey':_0x8651('0x147')});db[_0x8651('0x1d')][_0x8651('0x111')](db['JscriptySessionReport'],{'as':_0x8651('0x14c'),'foreignKey':_0x8651('0x147')});db[_0x8651('0x1d')][_0x8651('0x11e')](db['Trunk'],{'as':_0x8651('0x14d'),'foreignKey':_0x8651('0x14e')});db[_0x8651('0x1d')][_0x8651('0x11e')](db[_0x8651('0x14d')],{'as':_0x8651('0x14f'),'foreignKey':_0x8651('0x150')});db[_0x8651('0x1d')][_0x8651('0x11e')](db[_0x8651('0x81')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x8651('0x1d')]['belongsTo'](db[_0x8651('0x83')],{'as':_0x8651('0x151'),'foreignKey':_0x8651('0x152')});db[_0x8651('0x1d')][_0x8651('0x122')](db['CmList'],{'as':_0x8651('0x123'),'through':_0x8651('0x153')});db['VoiceQueue'][_0x8651('0x122')](db[_0x8651('0x13')],{'as':_0x8651('0x154'),'through':'UserVoiceQueue'});db[_0x8651('0x1d')][_0x8651('0x122')](db[_0x8651('0x125')],{'as':'Teams','through':_0x8651('0x155')});db[_0x8651('0x1d')][_0x8651('0x122')](db[_0x8651('0xf3')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0x8651('0x1f')]['belongsTo'](db[_0x8651('0x13')],{'as':_0x8651('0x13'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x21')][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':_0x8651('0x13'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x23')][_0x8651('0x111')](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x156'),'sourceKey':'mailbox'});db[_0x8651('0x157')]['belongsTo'](db[_0x8651('0x23')],{'foreignKey':_0x8651('0x156'),'targetKey':_0x8651('0x158')});db[_0x8651('0x26')]['hasMany'](db[_0x8651('0x2c')],{'as':_0x8651('0x159'),'foreignKey':_0x8651('0x15a'),'constraints':![]});db[_0x8651('0x26')][_0x8651('0x111')](db[_0x8651('0x2a')],{'as':_0x8651('0x15b'),'foreignKey':_0x8651('0x15a'),'constraints':![]});db[_0x8651('0x26')][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':_0x8651('0x13'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x26')][_0x8651('0x11e')](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':'ContactId'});db[_0x8651('0x41')]['belongsTo'](db[_0x8651('0x44')],{'as':_0x8651('0x44'),'foreignKey':_0x8651('0x15d')});db[_0x8651('0x41')][_0x8651('0x11e')](db[_0x8651('0x15e')],{'as':_0x8651('0x15e'),'foreignKey':_0x8651('0x15f'),'onDelete':_0x8651('0x160')});db['MailServerOut'][_0x8651('0x11e')](db[_0x8651('0x44')],{'as':'MailAccount','foreignKey':_0x8651('0x15d')});db[_0x8651('0x161')][_0x8651('0x11e')](db[_0x8651('0x15e')],{'as':_0x8651('0x15e'),'foreignKey':'CloudProviderId','onDelete':_0x8651('0x160')});db[_0x8651('0x44')][_0x8651('0x10d')](db[_0x8651('0x41')],{'as':_0x8651('0x162'),'onDelete':_0x8651('0x10e')});db[_0x8651('0x44')][_0x8651('0x10d')](db[_0x8651('0x161')],{'as':'Smtp','onDelete':'cascade'});db[_0x8651('0x44')]['hasMany'](db['Disposition'],{'as':_0x8651('0x163'),'foreignKey':_0x8651('0x15d'),'onDelete':_0x8651('0x10e')});db[_0x8651('0x44')]['hasMany'](db[_0x8651('0x164')],{'as':'Answers','foreignKey':_0x8651('0x15d')});db[_0x8651('0x44')][_0x8651('0x111')](db['MailMessage'],{'as':_0x8651('0x165'),'foreignKey':_0x8651('0x15d')});db[_0x8651('0x44')][_0x8651('0x111')](db['MailInteraction'],{'as':_0x8651('0x166')});db[_0x8651('0x44')][_0x8651('0x111')](db[_0x8651('0x4b')],{'as':_0x8651('0x145')});db['MailAccount'][_0x8651('0x11e')](db['CmList'],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168')});db['MailAccount'][_0x8651('0x11e')](db[_0x8651('0x8c')],{'as':'Template','foreignKey':_0x8651('0x169')});db[_0x8651('0x44')][_0x8651('0x11e')](db['Pause'],{'as':_0x8651('0x151'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8651('0x44')]['belongsToMany'](db[_0x8651('0x13')],{'as':'Agents','through':'user_has_mail_accounts'});db['MailQueue'][_0x8651('0x122')](db[_0x8651('0x13')],{'as':_0x8651('0x154'),'through':_0x8651('0x39')});db['MailQueue'][_0x8651('0x122')](db[_0x8651('0x125')],{'through':_0x8651('0x16a'),'as':'Teams'});db[_0x8651('0x49')][_0x8651('0x111')](db['MailMessage'],{'as':_0x8651('0x165'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x8651('0x49')][_0x8651('0x11e')](db[_0x8651('0x44')],{'as':'Account','foreignKey':_0x8651('0x15d')});db[_0x8651('0x49')][_0x8651('0x11e')](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':'ContactId'});db[_0x8651('0x49')][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':'Owner','foreignKey':_0x8651('0x110')});db[_0x8651('0x49')]['belongsToMany'](db['Tag'],{'through':_0x8651('0x16b'),'as':'Tags'});db[_0x8651('0x49')][_0x8651('0x122')](db[_0x8651('0x8a')],{'through':_0x8651('0x16b'),'as':_0x8651('0x16c')});db[_0x8651('0x49')][_0x8651('0x122')](db[_0x8651('0x13')],{'as':_0x8651('0x16d'),'through':_0x8651('0x127'),'foreignKey':_0x8651('0x16e')});db['MailMessage']['hasMany'](db['Attachment'],{'as':_0x8651('0x16f'),'onDelete':_0x8651('0x10e')});db['MailMessage'][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':'User'});db[_0x8651('0x170')][_0x8651('0x11e')](db[_0x8651('0x74')],{'onDelete':_0x8651('0x10e'),'as':_0x8651('0x15c')});db[_0x8651('0x170')][_0x8651('0x11e')](db[_0x8651('0x49')],{'as':'Interaction','foreignKey':'MailInteractionId'});db[_0x8651('0x170')][_0x8651('0x11e')](db['MailAccount'],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x15d')});db[_0x8651('0x170')][_0x8651('0x11e')](db[_0x8651('0x137')],{'as':_0x8651('0x137'),'foreignKey':'ChatWebsiteId'});db['MailMessage'][_0x8651('0x11e')](db[_0x8651('0x172')],{'as':'ChatOfflineMessage','foreignKey':_0x8651('0x173')});db[_0x8651('0x4b')]['belongsTo'](db[_0x8651('0x13')],{'onDelete':_0x8651('0x160')});db[_0x8651('0x4b')]['belongsTo'](db[_0x8651('0x46')],{'onDelete':_0x8651('0x160')});db[_0x8651('0x4b')][_0x8651('0x11e')](db[_0x8651('0x44')],{'onDelete':'restrict'});db[_0x8651('0x4b')][_0x8651('0x11e')](db[_0x8651('0x81')],{'onDelete':_0x8651('0x160'),'foreignKey':_0x8651('0x174')});db['MailApplication']['belongsTo'](db[_0x8651('0x8a')],{'onDelete':'restrict','foreignKey':_0x8651('0x175')});db['MailQueueReport'][_0x8651('0x11e')](db['MailAccount'],{});db[_0x8651('0x176')]['belongsTo'](db[_0x8651('0xf3')],{'as':'List','foreignKey':'ListId'});db['MailQueueReport'][_0x8651('0x11e')](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':_0x8651('0x177')});db[_0x8651('0x176')][_0x8651('0x11e')](db[_0x8651('0x49')],{});db[_0x8651('0x176')]['belongsTo'](db['MailMessage'],{});db[_0x8651('0x176')][_0x8651('0x11e')](db[_0x8651('0x13')],{});db[_0x8651('0x176')][_0x8651('0x11e')](db[_0x8651('0x46')],{});db[_0x8651('0x4d')]['hasMany'](db[_0x8651('0x4e')],{'as':'Items','onDelete':'cascade'});db[_0x8651('0x4f')][_0x8651('0x111')](db[_0x8651('0x178')],{'as':'Dispositions','foreignKey':_0x8651('0x179'),'onDelete':_0x8651('0x10e')});db[_0x8651('0x4f')][_0x8651('0x111')](db[_0x8651('0x164')],{'as':'Answers','foreignKey':_0x8651('0x179')});db[_0x8651('0x4f')][_0x8651('0x111')](db[_0x8651('0x119')],{'as':_0x8651('0x166')});db[_0x8651('0x4f')][_0x8651('0x111')](db[_0x8651('0x51')],{'as':_0x8651('0x145')});db[_0x8651('0x4f')]['hasMany'](db[_0x8651('0x1a')],{'as':'Exntensions','onDelete':'cascade'});db[_0x8651('0x4f')][_0x8651('0x111')](db[_0x8651('0x53')],{'as':_0x8651('0x165')});db[_0x8651('0x4f')][_0x8651('0x11e')](db[_0x8651('0x14d')],{'as':_0x8651('0x14d')});db[_0x8651('0x4f')][_0x8651('0x11e')](db[_0x8651('0xf3')],{'as':'List','foreignKey':_0x8651('0x168')});db['FaxAccount']['belongsTo'](db[_0x8651('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x8651('0x152')});db[_0x8651('0x4f')][_0x8651('0x122')](db['User'],{'as':_0x8651('0x154'),'through':_0x8651('0x13a')});db[_0x8651('0x51')]['belongsTo'](db[_0x8651('0x13')],{'onDelete':'restrict'});db[_0x8651('0x51')][_0x8651('0x11e')](db[_0x8651('0x55')],{'onDelete':'restrict'});db[_0x8651('0x51')][_0x8651('0x11e')](db['FaxAccount'],{'onDelete':_0x8651('0x160')});db['FaxApplication'][_0x8651('0x11e')](db['Tag'],{'onDelete':_0x8651('0x160'),'foreignKey':_0x8651('0x175')});db[_0x8651('0x119')][_0x8651('0x111')](db['FaxMessage'],{'as':_0x8651('0x165'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x17a')});db[_0x8651('0x119')][_0x8651('0x11e')](db[_0x8651('0x4f')],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x179')});db['FaxInteraction'][_0x8651('0x11e')](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':'ContactId'});db[_0x8651('0x119')][_0x8651('0x11e')](db['User'],{'as':_0x8651('0x17b'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x119')][_0x8651('0x122')](db[_0x8651('0x8a')],{'through':_0x8651('0x17c'),'as':_0x8651('0x17d')});db[_0x8651('0x119')][_0x8651('0x122')](db['Tag'],{'through':_0x8651('0x17c'),'as':_0x8651('0x16c')});db['FaxInteraction'][_0x8651('0x122')](db['User'],{'as':'Users','through':_0x8651('0x12a'),'foreignKey':_0x8651('0x17a')});db['FaxMessage'][_0x8651('0x11e')](db[_0x8651('0x13')],{'onDelete':_0x8651('0x10e'),'as':'User'});db['FaxMessage']['belongsTo'](db['FaxInteraction'],{'as':_0x8651('0x17e'),'foreignKey':_0x8651('0x17a')});db[_0x8651('0x53')][_0x8651('0x11e')](db[_0x8651('0x74')],{'onDelete':_0x8651('0x10e'),'as':_0x8651('0x15c')});db[_0x8651('0x53')][_0x8651('0x11e')](db['Attachment'],{'as':'Attachment','foreignKey':_0x8651('0x17f')});db['FaxMessage'][_0x8651('0x11e')](db[_0x8651('0x4f')],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x179')});db[_0x8651('0x55')]['belongsToMany'](db[_0x8651('0x13')],{'as':_0x8651('0x154'),'through':'UserFaxQueue'});db['FaxQueue'][_0x8651('0x122')](db[_0x8651('0x125')],{'through':_0x8651('0x180'),'as':'Teams'});db[_0x8651('0x57')]['belongsTo'](db['FaxAccount'],{});db[_0x8651('0x57')]['belongsTo'](db[_0x8651('0xf3')],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168')});db['FaxQueueReport'][_0x8651('0x11e')](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0x8651('0x11e')](db[_0x8651('0x119')],{});db[_0x8651('0x57')]['belongsTo'](db[_0x8651('0x53')],{});db[_0x8651('0x57')][_0x8651('0x11e')](db[_0x8651('0x13')],{});db[_0x8651('0x57')][_0x8651('0x11e')](db['FaxQueue'],{});db[_0x8651('0x59')][_0x8651('0x111')](db[_0x8651('0x178')],{'as':_0x8651('0x163'),'foreignKey':'SmsAccountId','onDelete':_0x8651('0x10e')});db[_0x8651('0x59')][_0x8651('0x111')](db[_0x8651('0x164')],{'as':'Answers','foreignKey':_0x8651('0x181')});db[_0x8651('0x59')][_0x8651('0x111')](db[_0x8651('0x5c')],{'as':_0x8651('0x165'),'foreignKey':'SmsAccountId'});db[_0x8651('0x59')][_0x8651('0x111')](db[_0x8651('0x5a')],{'as':_0x8651('0x166')});db[_0x8651('0x59')][_0x8651('0x111')](db['SmsApplication'],{'as':_0x8651('0x145')});db['SmsAccount'][_0x8651('0x11e')](db['CmList'],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168')});db[_0x8651('0x59')][_0x8651('0x11e')](db[_0x8651('0x83')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8651('0x59')]['belongsToMany'](db['User'],{'as':_0x8651('0x154'),'through':'user_has_sms_accounts'});db[_0x8651('0x182')][_0x8651('0x11e')](db['User'],{'onDelete':_0x8651('0x160')});db[_0x8651('0x182')][_0x8651('0x11e')](db[_0x8651('0x133')],{'onDelete':'restrict'});db[_0x8651('0x182')][_0x8651('0x11e')](db[_0x8651('0x59')],{'onDelete':_0x8651('0x160')});db[_0x8651('0x182')]['belongsTo'](db[_0x8651('0x81')],{'onDelete':'restrict','foreignKey':_0x8651('0x174')});db['SmsApplication'][_0x8651('0x11e')](db['Tag'],{'onDelete':_0x8651('0x160'),'foreignKey':_0x8651('0x175')});db[_0x8651('0x5a')][_0x8651('0x111')](db['SmsMessage'],{'as':_0x8651('0x165'),'onDelete':_0x8651('0x10e'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x8651('0x11e')](db[_0x8651('0x59')],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x181')});db[_0x8651('0x5a')]['belongsTo'](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':_0x8651('0x177')});db[_0x8651('0x5a')][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':'Owner','foreignKey':_0x8651('0x110')});db[_0x8651('0x5a')]['belongsToMany'](db[_0x8651('0x8a')],{'through':'sms_interaction_has_tags','as':_0x8651('0x17d')});db[_0x8651('0x5a')][_0x8651('0x122')](db['Tag'],{'through':_0x8651('0x183'),'as':_0x8651('0x16c')});db[_0x8651('0x5a')][_0x8651('0x122')](db['User'],{'as':_0x8651('0x16d'),'through':_0x8651('0x12b'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':_0x8651('0x13')});db[_0x8651('0x5c')][_0x8651('0x11e')](db[_0x8651('0x74')],{'onDelete':_0x8651('0x10e'),'as':_0x8651('0x15c')});db[_0x8651('0x5c')][_0x8651('0x11e')](db[_0x8651('0x5a')],{'onDelete':'cascade','as':_0x8651('0x17e'),'foreignKey':_0x8651('0x184')});db[_0x8651('0x5c')][_0x8651('0x11e')](db[_0x8651('0x59')],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x181')});db[_0x8651('0x133')]['belongsToMany'](db[_0x8651('0x13')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0x8651('0x185')});db[_0x8651('0x133')][_0x8651('0x122')](db[_0x8651('0x125')],{'through':_0x8651('0x186'),'as':_0x8651('0x187')});db[_0x8651('0x5f')][_0x8651('0x111')](db[_0x8651('0x178')],{'as':_0x8651('0x163'),'foreignKey':_0x8651('0x188'),'onDelete':_0x8651('0x10e')});db[_0x8651('0x5f')][_0x8651('0x111')](db[_0x8651('0x164')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x8651('0x5f')][_0x8651('0x111')](db[_0x8651('0x63')],{'as':_0x8651('0x166'),'foreignKey':_0x8651('0x188')});db['OpenchannelAccount']['hasMany'](db[_0x8651('0x189')],{'as':_0x8651('0x165'),'foreignKey':_0x8651('0x188')});db[_0x8651('0x5f')][_0x8651('0x111')](db[_0x8651('0x61')],{'as':_0x8651('0x145'),'foreignKey':_0x8651('0x188')});db[_0x8651('0x5f')]['belongsTo'](db[_0x8651('0xf3')],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168')});db[_0x8651('0x5f')]['belongsTo'](db[_0x8651('0x83')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8651('0x5f')][_0x8651('0x122')](db[_0x8651('0x13')],{'as':'Agents','through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x8651('0x11e')](db[_0x8651('0x13')],{'onDelete':_0x8651('0x160')});db[_0x8651('0x61')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x8651('0x160'),'foreignKey':_0x8651('0x18a')});db[_0x8651('0x61')][_0x8651('0x11e')](db[_0x8651('0x5f')],{'onDelete':_0x8651('0x160'),'foreignKey':_0x8651('0x188')});db['OpenchannelApplication'][_0x8651('0x11e')](db[_0x8651('0x81')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['OpenchannelApplication']['belongsTo'](db[_0x8651('0x8a')],{'onDelete':_0x8651('0x160'),'foreignKey':_0x8651('0x175')});db['OpenchannelInteraction'][_0x8651('0x111')](db['OpenchannelMessage'],{'as':_0x8651('0x165'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x18b')});db[_0x8651('0x63')][_0x8651('0x11e')](db[_0x8651('0x5f')],{'as':_0x8651('0x171'),'foreignKey':'OpenchannelAccountId'});db[_0x8651('0x63')]['belongsTo'](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':'ContactId'});db['OpenchannelInteraction'][_0x8651('0x11e')](db['User'],{'as':_0x8651('0x17b'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x63')][_0x8651('0x122')](db[_0x8651('0x8a')],{'through':_0x8651('0x18c'),'as':_0x8651('0x17d')});db[_0x8651('0x63')][_0x8651('0x122')](db[_0x8651('0x8a')],{'through':'openchannel_interaction_has_tags','as':_0x8651('0x16c')});db[_0x8651('0x63')][_0x8651('0x122')](db['User'],{'as':_0x8651('0x16d'),'through':'user_has_openchannel_interactions','foreignKey':_0x8651('0x18b')});db['OpenchannelMessage'][_0x8651('0x11e')](db[_0x8651('0x13')],{'onDelete':'cascade','as':_0x8651('0x13')});db['OpenchannelMessage']['belongsTo'](db[_0x8651('0x74')],{'onDelete':_0x8651('0x10e'),'as':_0x8651('0x15c')});db[_0x8651('0x189')][_0x8651('0x11e')](db[_0x8651('0x63')],{'onDelete':_0x8651('0x10e'),'as':_0x8651('0x17e'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage']['belongsTo'](db[_0x8651('0x18d')],{'as':'Attachment','foreignKey':_0x8651('0x17f')});db[_0x8651('0x189')][_0x8651('0x11e')](db[_0x8651('0x5f')],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x188')});db[_0x8651('0x65')][_0x8651('0x122')](db[_0x8651('0x13')],{'as':_0x8651('0x154'),'through':_0x8651('0x3e'),'foreignKey':_0x8651('0x18a')});db[_0x8651('0x65')][_0x8651('0x122')](db['Team'],{'through':_0x8651('0x18e'),'as':'Teams'});db[_0x8651('0x137')][_0x8651('0x111')](db[_0x8651('0x178')],{'as':_0x8651('0x163'),'foreignKey':_0x8651('0x18f'),'onDelete':_0x8651('0x10e')});db['ChatWebsite'][_0x8651('0x111')](db['CannedAnswer'],{'as':_0x8651('0x190'),'foreignKey':'ChatWebsiteId'});db[_0x8651('0x137')][_0x8651('0x111')](db[_0x8651('0x71')],{'as':'ProactiveActions'});db[_0x8651('0x137')][_0x8651('0x111')](db['ChatInteraction'],{'as':'Interactions'});db[_0x8651('0x137')]['hasMany'](db['ChatApplication'],{'as':_0x8651('0x145')});db[_0x8651('0x137')]['hasMany'](db[_0x8651('0x6b')],{'as':_0x8651('0x165')});db[_0x8651('0x137')][_0x8651('0x11e')](db[_0x8651('0xf3')],{'as':_0x8651('0x167'),'foreignKey':'ListId'});db['ChatWebsite'][_0x8651('0x11e')](db['Interval'],{'as':'Interval','foreignKey':_0x8651('0x174')});db[_0x8651('0x137')][_0x8651('0x11e')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x8651('0x15d')});db[_0x8651('0x137')][_0x8651('0x11e')](db[_0x8651('0x83')],{'as':_0x8651('0x151'),'foreignKey':_0x8651('0x152')});db[_0x8651('0x137')][_0x8651('0x122')](db[_0x8651('0x13')],{'as':_0x8651('0x154'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x8651('0x11e')](db[_0x8651('0x5f')],{});db[_0x8651('0x191')][_0x8651('0x11e')](db[_0x8651('0xf3')],{'as':'List','foreignKey':_0x8651('0x168')});db['OpenchannelQueueReport'][_0x8651('0x11e')](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':'ContactId'});db[_0x8651('0x191')][_0x8651('0x11e')](db[_0x8651('0x63')],{});db[_0x8651('0x191')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x8651('0x191')]['belongsTo'](db[_0x8651('0x13')],{});db[_0x8651('0x191')][_0x8651('0x11e')](db[_0x8651('0x65')],{});db[_0x8651('0x68')][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':_0x8651('0x192'),'foreignKey':_0x8651('0x110'),'onDelete':_0x8651('0x160')});db[_0x8651('0x68')][_0x8651('0x11e')](db[_0x8651('0x6e')],{'as':'Queue','foreignKey':_0x8651('0x193'),'onDelete':_0x8651('0x160')});db['ChatApplication'][_0x8651('0x11e')](db[_0x8651('0x137')],{'as':_0x8651('0x194'),'foreignKey':_0x8651('0x18f'),'onDelete':'restrict'});db[_0x8651('0x68')][_0x8651('0x11e')](db['Tag'],{'onDelete':_0x8651('0x160'),'foreignKey':_0x8651('0x175')});db[_0x8651('0x69')][_0x8651('0x111')](db['ChatMessage'],{'as':_0x8651('0x165'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x195')});db['ChatInteraction'][_0x8651('0x11e')](db['ChatWebsite'],{'as':_0x8651('0x171'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x8651('0x11e')](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':_0x8651('0x177')});db[_0x8651('0x69')][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':_0x8651('0x17b'),'foreignKey':_0x8651('0x110')});db['ChatInteraction'][_0x8651('0x122')](db['Tag'],{'through':_0x8651('0x196'),'as':'Tags'});db['ChatInteraction'][_0x8651('0x122')](db[_0x8651('0x8a')],{'through':_0x8651('0x196'),'as':_0x8651('0x16c')});db[_0x8651('0x69')]['belongsToMany'](db[_0x8651('0x13')],{'as':_0x8651('0x16d'),'through':_0x8651('0x128'),'foreignKey':_0x8651('0x195')});db['ChatMessage'][_0x8651('0x11e')](db[_0x8651('0x13')],{'onDelete':_0x8651('0x10e'),'as':_0x8651('0x13')});db[_0x8651('0x6b')][_0x8651('0x11e')](db[_0x8651('0x74')],{'onDelete':_0x8651('0x10e'),'as':_0x8651('0x15c'),'foreignKey':_0x8651('0x177')});db[_0x8651('0x6b')]['belongsTo'](db[_0x8651('0x69')],{'onDelete':'cascade','as':_0x8651('0x17e'),'foreignKey':_0x8651('0x195')});db['ChatMessage'][_0x8651('0x11e')](db['Attachment'],{'as':_0x8651('0x18d'),'foreignKey':_0x8651('0x17f')});db[_0x8651('0x6b')][_0x8651('0x11e')](db[_0x8651('0x137')],{'as':'Account','foreignKey':_0x8651('0x18f')});db['ChatOfflineMessage'][_0x8651('0x111')](db[_0x8651('0x18d')],{'as':_0x8651('0x16f'),'foreignKey':_0x8651('0x173'),'onDelete':_0x8651('0x10e'),'hooks':!![]});db['ChatOfflineMessage'][_0x8651('0x11e')](db[_0x8651('0x74')],{'onDelete':_0x8651('0x10e'),'as':_0x8651('0x15c'),'foreignKey':_0x8651('0x177')});db['ChatOfflineMessage'][_0x8651('0x11e')](db[_0x8651('0x137')],{'as':'Account','foreignKey':_0x8651('0x18f')});db['ChatQueue'][_0x8651('0x122')](db[_0x8651('0x13')],{'as':_0x8651('0x154'),'through':_0x8651('0x37'),'hooks':!![]});db[_0x8651('0x6e')][_0x8651('0x122')](db['Team'],{'through':_0x8651('0x197'),'as':'Teams'});db[_0x8651('0x70')][_0x8651('0x111')](db['ChatInternalMessage'],{'as':_0x8651('0x165'),'foreignKey':_0x8651('0x198'),'onDelete':'cascade'});db['ChatGroup'][_0x8651('0x122')](db['User'],{'as':_0x8651('0x199'),'through':_0x8651('0x120')});db[_0x8651('0x71')][_0x8651('0x11e')](db[_0x8651('0x137')],{'as':_0x8651('0x194'),'foreignKey':_0x8651('0x18f')});db[_0x8651('0x72')][_0x8651('0x111')](db['CmContact'],{'as':_0x8651('0x121'),'foreignKey':_0x8651('0x19a')});db[_0x8651('0x74')][_0x8651('0x111')](db[_0x8651('0x75')],{'as':_0x8651('0x148'),'foreignKey':'ContactId'});db[_0x8651('0x74')]['hasMany'](db[_0x8651('0x114')],{'as':'HopperFinals','foreignKey':_0x8651('0x177')});db[_0x8651('0x74')]['hasMany'](db[_0x8651('0x115')],{'as':_0x8651('0x149'),'foreignKey':_0x8651('0x177')});db['CmContact']['hasMany'](db[_0x8651('0x78')],{'as':_0x8651('0x78'),'foreignKey':'ContactId'});db[_0x8651('0x74')]['hasMany'](db[_0x8651('0xd5')],{'as':_0x8651('0x14c'),'foreignKey':'ContactId'});db['CmContact'][_0x8651('0x111')](db[_0x8651('0x63')],{'as':_0x8651('0x116'),'foreignKey':_0x8651('0x177'),'onDelete':_0x8651('0x160')});db[_0x8651('0x74')][_0x8651('0x111')](db[_0x8651('0x69')],{'as':_0x8651('0x117'),'foreignKey':_0x8651('0x177'),'onDelete':_0x8651('0x160')});db['CmContact'][_0x8651('0x111')](db[_0x8651('0x5a')],{'as':'SmsInteractions','foreignKey':_0x8651('0x177'),'onDelete':_0x8651('0x160')});db[_0x8651('0x74')][_0x8651('0x111')](db[_0x8651('0x119')],{'as':_0x8651('0x129'),'foreignKey':_0x8651('0x177'),'onDelete':'restrict'});db[_0x8651('0x74')][_0x8651('0x111')](db[_0x8651('0x49')],{'as':_0x8651('0x11a'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x8651('0x74')][_0x8651('0x11e')](db[_0x8651('0x72')],{'as':_0x8651('0x19b'),'foreignKey':'CompanyId'});db[_0x8651('0x74')]['belongsTo'](db[_0x8651('0xf3')],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168'),'onDelete':_0x8651('0x10e')});db[_0x8651('0x74')][_0x8651('0x122')](db['User'],{'as':_0x8651('0x16d'),'through':'cm_user_has_contacts'});db[_0x8651('0x74')][_0x8651('0x122')](db['Tag'],{'as':_0x8651('0x17d'),'through':_0x8651('0x19c')});db[_0x8651('0x74')][_0x8651('0x122')](db[_0x8651('0x8a')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0x8651('0x75')][_0x8651('0x11e')](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':'ContactId','onDelete':_0x8651('0x10e')});db['CmHopper'][_0x8651('0x11e')](db[_0x8651('0xf3')],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168'),'onDelete':_0x8651('0x10e')});db['CmHopper'][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':_0x8651('0x192'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x75')][_0x8651('0x11e')](db[_0x8651('0x1d')],{'as':_0x8651('0x19d'),'foreignKey':_0x8651('0x147'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0x8651('0xe4')],{'as':_0x8651('0xe4'),'foreignKey':_0x8651('0x19e'),'onDelete':_0x8651('0x10e')});db[_0x8651('0x75')][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':_0x8651('0x17b'),'foreignKey':_0x8651('0x19f')});db[_0x8651('0x14a')][_0x8651('0x11e')](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':_0x8651('0x177'),'onDelete':_0x8651('0x10e')});db[_0x8651('0x14a')]['belongsTo'](db[_0x8651('0xf3')],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168'),'onDelete':_0x8651('0x10e')});db[_0x8651('0x14a')][_0x8651('0x11e')](db[_0x8651('0x1d')],{'as':_0x8651('0x19d'),'foreignKey':_0x8651('0x147'),'onDelete':'cascade'});db[_0x8651('0x14a')][_0x8651('0x11e')](db[_0x8651('0xe4')],{'as':_0x8651('0xe4'),'foreignKey':'CampaignId','onDelete':'cascade'});db['Automation'][_0x8651('0x111')](db['Condition'],{'as':{'plural':'All','singular':_0x8651('0x1a0')},'foreignKey':'AutomationAllId','onDelete':_0x8651('0x10e'),'hooks':!![]});db[_0x8651('0x7c')]['hasMany'](db['Condition'],{'as':{'plural':_0x8651('0x1a1'),'singular':_0x8651('0x1a2')},'foreignKey':_0x8651('0x1a3'),'onDelete':_0x8651('0x10e'),'hooks':!![]});db[_0x8651('0x7c')][_0x8651('0x111')](db[_0x8651('0x7b')],{'as':_0x8651('0x1a4'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db['Disposition'][_0x8651('0x111')](db[_0x8651('0x178')],{'as':_0x8651('0x163'),'foreignKey':_0x8651('0x1a5'),'onDelete':_0x8651('0x10e')});db[_0x8651('0x81')][_0x8651('0x111')](db['Interval'],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x8651('0x10e'),'hooks':!![],'required':![]});db['Interval'][_0x8651('0x111')](db['VoiceExtension'],{'as':_0x8651('0x113'),'foreignKey':_0x8651('0x174'),'onDelete':_0x8651('0x160')});db[_0x8651('0x81')][_0x8651('0x111')](db[_0x8651('0x4b')],{'as':_0x8651('0x1a6'),'foreignKey':_0x8651('0x174')});db[_0x8651('0x81')][_0x8651('0x111')](db[_0x8651('0x68')],{'as':_0x8651('0x1a7'),'foreignKey':_0x8651('0x174')});db[_0x8651('0x81')][_0x8651('0x111')](db[_0x8651('0x51')],{'as':_0x8651('0x1a8'),'foreignKey':_0x8651('0x174')});db[_0x8651('0x81')][_0x8651('0x111')](db[_0x8651('0x182')],{'as':_0x8651('0x1a9'),'foreignKey':_0x8651('0x174')});db[_0x8651('0x1aa')][_0x8651('0x11e')](db[_0x8651('0x44')],{});db[_0x8651('0x1aa')][_0x8651('0x11e')](db[_0x8651('0x96')],{'foreignKey':'DefaultReportId'});db[_0x8651('0x1aa')][_0x8651('0x11e')](db[_0x8651('0x94')],{'foreignKey':'CustomReportId'});db[_0x8651('0x89')][_0x8651('0x122')](db[_0x8651('0x1c')],{'as':_0x8651('0x1ab'),'through':_0x8651('0x146'),'onDelete':_0x8651('0x160')});db[_0x8651('0x8a')][_0x8651('0x122')](db[_0x8651('0x74')],{'through':_0x8651('0x19c')});db[_0x8651('0x8a')]['belongsToMany'](db['ChatInteraction'],{'through':_0x8651('0x196')});db[_0x8651('0x8a')][_0x8651('0x122')](db[_0x8651('0x49')],{'through':_0x8651('0x16b')});db['Tag'][_0x8651('0x122')](db[_0x8651('0x5a')],{'through':_0x8651('0x183')});db[_0x8651('0x8a')]['belongsToMany'](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0x8651('0x8a')]['belongsToMany'](db[_0x8651('0x63')],{'through':_0x8651('0x18c')});db['Tag'][_0x8651('0x122')](db[_0x8651('0x100')],{'through':_0x8651('0x1ac')});db['Trigger']['hasMany'](db[_0x8651('0x7f')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x8651('0x10e'),'hooks':!![]});db[_0x8651('0x8e')][_0x8651('0x111')](db['Condition'],{'as':{'plural':'AnyConditions','singular':_0x8651('0x1ad')},'foreignKey':'TriggerAnyId','onDelete':_0x8651('0x10e'),'hooks':!![]});db[_0x8651('0x8e')][_0x8651('0x111')](db[_0x8651('0x7b')],{'as':_0x8651('0x1a4'),'foreignKey':_0x8651('0x1ae'),'onDelete':_0x8651('0x10e'),'hooks':!![]});db[_0x8651('0x94')][_0x8651('0x111')](db[_0x8651('0x9a')],{'as':_0x8651('0x1af'),'onDelete':_0x8651('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x8651('0x96')][_0x8651('0x111')](db[_0x8651('0x9a')],{'as':_0x8651('0x1af'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1b0')});db[_0x8651('0x1b1')][_0x8651('0x111')](db[_0x8651('0x9a')],{'as':_0x8651('0x1af'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1b2')});db[_0x8651('0x9a')]['belongsTo'](db[_0x8651('0x1b1')],{'foreignKey':_0x8651('0x1b2')});db[_0x8651('0x9e')][_0x8651('0x111')](db[_0x8651('0xa0')],{'as':_0x8651('0x1b3'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x8651('0xa0')][_0x8651('0x111')](db['SalesforceField'],{'as':_0x8651('0x1b4'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1b5')});db[_0x8651('0xa0')][_0x8651('0x111')](db[_0x8651('0xa2')],{'as':_0x8651('0x1b6'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1b7')});db['SalesforceConfiguration'][_0x8651('0x111')](db[_0x8651('0xa2')],{'as':_0x8651('0x1af'),'onDelete':_0x8651('0x10e'),'foreignKey':'FieldId'});db[_0x8651('0xa0')][_0x8651('0x11e')](db['SalesforceAccount'],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x1b8')});db['SalesforceField'][_0x8651('0x111')](db[_0x8651('0xa2')],{'as':_0x8651('0x1b9'),'foreignKey':_0x8651('0x1b5')});db['SalesforceField'][_0x8651('0x111')](db['SalesforceField'],{'as':_0x8651('0x1ba'),'foreignKey':_0x8651('0x1b7')});db[_0x8651('0xa2')][_0x8651('0x111')](db[_0x8651('0xa2')],{'as':'Field','foreignKey':_0x8651('0x1bb')});db['SalesforceField'][_0x8651('0x11e')](db['Variable'],{'as':_0x8651('0x8f'),'foreignKey':_0x8651('0x1bc')});db[_0x8651('0xa4')][_0x8651('0x111')](db[_0x8651('0xa6')],{'as':'Configurations','onDelete':_0x8651('0x10e'),'foreignKey':'AccountId'});db['SugarcrmConfiguration']['hasMany'](db[_0x8651('0x1bd')],{'as':_0x8651('0x1b4'),'onDelete':'cascade','foreignKey':_0x8651('0x1b5')});db[_0x8651('0xa6')]['hasMany'](db[_0x8651('0x1bd')],{'as':_0x8651('0x1b6'),'onDelete':'cascade','foreignKey':_0x8651('0x1b7')});db[_0x8651('0xa6')]['hasMany'](db[_0x8651('0x1bd')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x8651('0x1bb')});db[_0x8651('0xa6')][_0x8651('0x11e')](db[_0x8651('0xa4')],{'as':'Account','foreignKey':_0x8651('0x1b8')});db[_0x8651('0x1bd')][_0x8651('0x111')](db[_0x8651('0x1bd')],{'as':'Subject','foreignKey':_0x8651('0x1b5')});db['SugarcrmField'][_0x8651('0x111')](db[_0x8651('0x1bd')],{'as':'Description','foreignKey':_0x8651('0x1b7')});db['SugarcrmField'][_0x8651('0x111')](db[_0x8651('0x1bd')],{'as':_0x8651('0x1be'),'foreignKey':_0x8651('0x1bb')});db[_0x8651('0x1bd')][_0x8651('0x11e')](db[_0x8651('0x8f')],{'as':_0x8651('0x8f'),'foreignKey':'VariableId'});db['DeskAccount'][_0x8651('0x111')](db[_0x8651('0xaa')],{'as':'Configurations','onDelete':_0x8651('0x10e'),'foreignKey':'AccountId'});db[_0x8651('0xaa')][_0x8651('0x111')](db['DeskField'],{'as':'Subjects','onDelete':_0x8651('0x10e'),'foreignKey':'SubjectId'});db[_0x8651('0xaa')]['hasMany'](db[_0x8651('0xac')],{'as':_0x8651('0x1b6'),'onDelete':'cascade','foreignKey':_0x8651('0x1b7')});db[_0x8651('0xaa')][_0x8651('0x111')](db[_0x8651('0xac')],{'as':_0x8651('0x1af'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1bb')});db[_0x8651('0xaa')]['belongsTo'](db[_0x8651('0xa8')],{'as':_0x8651('0x171'),'foreignKey':'AccountId'});db['DeskConfiguration']['belongsToMany'](db[_0x8651('0x8a')],{'through':_0x8651('0x1bf')});db[_0x8651('0xac')][_0x8651('0x111')](db[_0x8651('0xac')],{'as':_0x8651('0x1b9'),'foreignKey':_0x8651('0x1b5')});db[_0x8651('0xac')]['hasMany'](db[_0x8651('0xac')],{'as':'Description','foreignKey':_0x8651('0x1b7')});db[_0x8651('0xac')][_0x8651('0x111')](db[_0x8651('0xac')],{'as':_0x8651('0x1be'),'foreignKey':'FieldId'});db[_0x8651('0xac')][_0x8651('0x11e')](db['Variable'],{'as':_0x8651('0x8f'),'foreignKey':_0x8651('0x1bc')});db[_0x8651('0xad')]['hasMany'](db[_0x8651('0xae')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x8651('0xae')]['hasMany'](db['ZohoField'],{'as':_0x8651('0x1b4'),'onDelete':_0x8651('0x10e'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x8651('0x111')](db['ZohoField'],{'as':_0x8651('0x1b6'),'onDelete':_0x8651('0x10e'),'foreignKey':'DescriptionId'});db[_0x8651('0xae')]['hasMany'](db[_0x8651('0x1c0')],{'as':_0x8651('0x1af'),'onDelete':_0x8651('0x10e'),'foreignKey':'FieldId'});db[_0x8651('0xae')][_0x8651('0x11e')](db['ZohoAccount'],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x1b8')});db['ZohoField']['hasMany'](db[_0x8651('0x1c0')],{'as':_0x8651('0x1b9'),'foreignKey':_0x8651('0x1b5')});db[_0x8651('0x1c0')][_0x8651('0x111')](db[_0x8651('0x1c0')],{'as':_0x8651('0x1ba'),'foreignKey':_0x8651('0x1b7')});db[_0x8651('0x1c0')][_0x8651('0x111')](db[_0x8651('0x1c0')],{'as':_0x8651('0x1be'),'foreignKey':_0x8651('0x1bb')});db[_0x8651('0x1c0')][_0x8651('0x11e')](db[_0x8651('0x8f')],{'as':_0x8651('0x8f'),'foreignKey':_0x8651('0x1bc')});db[_0x8651('0x1c1')][_0x8651('0x111')](db[_0x8651('0xb0')],{'as':_0x8651('0x1b3'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1b8')});db[_0x8651('0xb0')][_0x8651('0x111')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x8651('0x1b5')});db[_0x8651('0xb0')][_0x8651('0x111')](db[_0x8651('0x1c2')],{'as':_0x8651('0x1b6'),'foreignKey':_0x8651('0x1b7')});db[_0x8651('0xb0')][_0x8651('0x111')](db[_0x8651('0x1c2')],{'as':'Fields','foreignKey':_0x8651('0x1bb')});db[_0x8651('0xb0')][_0x8651('0x11e')](db[_0x8651('0x1c1')],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x1b8')});db[_0x8651('0xb0')][_0x8651('0x122')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x8651('0x111')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x8651('0x1b5')});db['ZendeskField']['hasMany'](db[_0x8651('0x1c2')],{'as':_0x8651('0x1ba'),'foreignKey':_0x8651('0x1b7')});db[_0x8651('0x1c2')]['hasMany'](db[_0x8651('0x1c2')],{'as':'Field','foreignKey':_0x8651('0x1bb')});db['ZendeskField'][_0x8651('0x11e')](db[_0x8651('0x8f')],{'as':_0x8651('0x8f'),'foreignKey':_0x8651('0x1bc')});db[_0x8651('0xb3')][_0x8651('0x111')](db[_0x8651('0xb5')],{'as':_0x8651('0x1b3'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1b8')});db[_0x8651('0xb5')]['hasMany'](db[_0x8651('0xb7')],{'as':_0x8651('0x1b4'),'onDelete':'cascade','foreignKey':_0x8651('0x1b5')});db[_0x8651('0xb5')][_0x8651('0x111')](db[_0x8651('0xb7')],{'as':_0x8651('0x1b6'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1b7')});db[_0x8651('0xb5')][_0x8651('0x111')](db['FreshdeskField'],{'as':_0x8651('0x1af'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x8651('0xb5')]['belongsTo'](db[_0x8651('0xb3')],{'as':_0x8651('0x171'),'foreignKey':'AccountId'});db[_0x8651('0xb5')]['belongsToMany'](db['Tag'],{'through':_0x8651('0x1c3')});db[_0x8651('0xb7')][_0x8651('0x111')](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x8651('0x1b5')});db[_0x8651('0xb7')][_0x8651('0x111')](db[_0x8651('0xb7')],{'as':'Description','foreignKey':_0x8651('0x1b7')});db[_0x8651('0xb7')]['hasMany'](db['FreshdeskField'],{'as':_0x8651('0x1be'),'foreignKey':_0x8651('0x1bb')});db[_0x8651('0xb7')][_0x8651('0x11e')](db[_0x8651('0x8f')],{'as':_0x8651('0x8f'),'foreignKey':_0x8651('0x1bc')});db[_0x8651('0xb9')][_0x8651('0x111')](db[_0x8651('0xbb')],{'as':_0x8651('0x1b3'),'onDelete':'cascade','foreignKey':'AccountId'});db['VtigerConfiguration'][_0x8651('0x111')](db[_0x8651('0xbc')],{'as':_0x8651('0x1b4'),'foreignKey':_0x8651('0x1b5')});db[_0x8651('0xbb')]['hasMany'](db[_0x8651('0xbc')],{'as':'Descriptions','foreignKey':_0x8651('0x1b7')});db[_0x8651('0xbb')][_0x8651('0x111')](db['VtigerField'],{'as':_0x8651('0x1af'),'foreignKey':_0x8651('0x1bb')});db['VtigerConfiguration']['belongsTo'](db[_0x8651('0xb9')],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x1b8')});db[_0x8651('0xbc')][_0x8651('0x111')](db['VtigerField'],{'as':'Subject','foreignKey':_0x8651('0x1b5')});db[_0x8651('0xbc')][_0x8651('0x111')](db[_0x8651('0xbc')],{'as':_0x8651('0x1ba'),'foreignKey':_0x8651('0x1b7')});db[_0x8651('0xbc')][_0x8651('0x111')](db[_0x8651('0xbc')],{'as':_0x8651('0x1be'),'foreignKey':_0x8651('0x1bb')});db[_0x8651('0xbc')]['belongsTo'](db[_0x8651('0x8f')],{'as':_0x8651('0x8f'),'foreignKey':_0x8651('0x1bc')});db['ServicenowAccount']['hasMany'](db['ServicenowConfiguration'],{'as':_0x8651('0x1b3'),'onDelete':'cascade','foreignKey':_0x8651('0x1b8')});db['ServicenowConfiguration'][_0x8651('0x111')](db['ServicenowField'],{'as':_0x8651('0x1b4'),'foreignKey':_0x8651('0x1b5')});db[_0x8651('0xc0')]['hasMany'](db[_0x8651('0x1c4')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0x8651('0x111')](db[_0x8651('0x1c4')],{'as':_0x8651('0x1af'),'foreignKey':_0x8651('0x1bb')});db[_0x8651('0xc0')][_0x8651('0x11e')](db[_0x8651('0xbe')],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x1b8')});db[_0x8651('0x1c4')][_0x8651('0x111')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x8651('0x1b5')});db[_0x8651('0x1c4')]['hasMany'](db['ServicenowField'],{'as':_0x8651('0x1ba'),'foreignKey':_0x8651('0x1b7')});db[_0x8651('0x1c4')][_0x8651('0x111')](db[_0x8651('0x1c4')],{'as':_0x8651('0x1be'),'foreignKey':_0x8651('0x1bb')});db[_0x8651('0x1c4')][_0x8651('0x11e')](db['Variable'],{'as':'Variable','foreignKey':_0x8651('0x1bc')});db[_0x8651('0x1c5')]['hasMany'](db[_0x8651('0x1c6')],{'as':_0x8651('0x1b3'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1b8')});db[_0x8651('0x1c5')][_0x8651('0x11e')](db[_0x8651('0x15e')],{'as':'CloudProvider','foreignKey':'CloudProviderId'});db[_0x8651('0x1c6')][_0x8651('0x111')](db[_0x8651('0xc4')],{'as':_0x8651('0x1b4'),'onDelete':'cascade','foreignKey':_0x8651('0x1b5')});db[_0x8651('0x1c6')][_0x8651('0x111')](db[_0x8651('0xc4')],{'as':_0x8651('0x1b6'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1b7')});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1bb')});db[_0x8651('0x1c6')][_0x8651('0x11e')](db[_0x8651('0x1c5')],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x1b8')});db[_0x8651('0xc4')][_0x8651('0x111')](db[_0x8651('0xc4')],{'as':_0x8651('0x1b9'),'foreignKey':_0x8651('0x1b5')});db[_0x8651('0xc4')][_0x8651('0x111')](db['Dynamics365Field'],{'as':_0x8651('0x1ba'),'foreignKey':_0x8651('0x1b7')});db[_0x8651('0xc4')][_0x8651('0x111')](db[_0x8651('0xc4')],{'as':_0x8651('0x1be'),'foreignKey':_0x8651('0x1bb')});db['Dynamics365Field']['belongsTo'](db[_0x8651('0x8f')],{'as':_0x8651('0x8f'),'foreignKey':'VariableId'});db[_0x8651('0xc6')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x8651('0x1b3'),'onDelete':_0x8651('0x10e'),'foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0x8651('0x111')](db[_0x8651('0xc8')],{'as':'Subjects','foreignKey':_0x8651('0x1b5')});db[_0x8651('0x1c7')]['hasMany'](db['FreshsalesField'],{'as':_0x8651('0x1b6'),'foreignKey':'DescriptionId'});db[_0x8651('0x1c7')][_0x8651('0x111')](db[_0x8651('0xc8')],{'as':_0x8651('0x1af'),'foreignKey':'FieldId'});db[_0x8651('0x1c7')][_0x8651('0x11e')](db['FreshsalesAccount'],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x1b8')});db[_0x8651('0xc8')][_0x8651('0x111')](db['FreshsalesField'],{'as':_0x8651('0x1b9'),'foreignKey':_0x8651('0x1b5')});db['FreshsalesField'][_0x8651('0x111')](db[_0x8651('0xc8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8651('0xc8')][_0x8651('0x111')](db[_0x8651('0xc8')],{'as':_0x8651('0x1be'),'foreignKey':_0x8651('0x1bb')});db[_0x8651('0xc8')][_0x8651('0x11e')](db[_0x8651('0x8f')],{'as':'Variable','foreignKey':_0x8651('0x1bc')});db[_0x8651('0xcd')][_0x8651('0x11e')](db['ChatWebsite'],{});db[_0x8651('0xcd')]['belongsTo'](db['CmList'],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168')});db[_0x8651('0xcd')][_0x8651('0x11e')](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':'ContactId'});db['ChatQueueReport']['belongsTo'](db['ChatInteraction'],{});db['ChatQueueReport']['belongsTo'](db[_0x8651('0x6b')],{});db[_0x8651('0xcd')]['belongsTo'](db[_0x8651('0x13')],{});db[_0x8651('0xcd')][_0x8651('0x11e')](db['ChatQueue'],{});db['ChatInternalMessage'][_0x8651('0x11e')](db['User'],{'onDelete':_0x8651('0x10e'),'foreignKey':'FromId'});db[_0x8651('0xcf')][_0x8651('0x11e')](db[_0x8651('0x13')],{'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1c8')});db['JscriptySessionReport']['hasMany'](db[_0x8651('0xd3')],{'foreignKey':'SessionId','onDelete':_0x8651('0x10e')});db[_0x8651('0xd5')][_0x8651('0x111')](db[_0x8651('0xd1')],{'foreignKey':_0x8651('0x1c9'),'onDelete':'cascade'});db['SmsQueueReport'][_0x8651('0x11e')](db[_0x8651('0x59')],{});db['SmsQueueReport']['belongsTo'](db['CmList'],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168')});db[_0x8651('0xd7')]['belongsTo'](db['CmContact'],{'as':_0x8651('0x15c'),'foreignKey':_0x8651('0x177')});db['SmsQueueReport'][_0x8651('0x11e')](db[_0x8651('0x5a')],{});db['SmsQueueReport'][_0x8651('0x11e')](db[_0x8651('0x5c')],{});db[_0x8651('0xd7')]['belongsTo'](db[_0x8651('0x13')],{});db[_0x8651('0xd7')][_0x8651('0x11e')](db[_0x8651('0x133')],{});db[_0x8651('0xdd')][_0x8651('0x111')](db[_0x8651('0xd5')],{'foreignKey':'ProjectId'});db[_0x8651('0xdd')][_0x8651('0x111')](db['JscriptyQuestionReport'],{'foreignKey':_0x8651('0x1ca')});db[_0x8651('0xdd')][_0x8651('0x111')](db[_0x8651('0xd1')],{'foreignKey':_0x8651('0x1ca')});db[_0x8651('0x141')][_0x8651('0x122')](db['User'],{'as':_0x8651('0x16d'),'through':_0x8651('0x143')});db[_0x8651('0x125')][_0x8651('0x122')](db[_0x8651('0x13')],{'as':_0x8651('0x154'),'through':_0x8651('0x126')});db[_0x8651('0x125')][_0x8651('0x122')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x8651('0x12e')});db[_0x8651('0x125')][_0x8651('0x122')](db['MailQueue'],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0x8651('0x125')][_0x8651('0x122')](db[_0x8651('0x6e')],{'through':_0x8651('0x197'),'as':_0x8651('0x131')});db[_0x8651('0x125')][_0x8651('0x122')](db['FaxQueue'],{'through':_0x8651('0x180'),'as':'FaxQueues'});db[_0x8651('0x125')]['belongsToMany'](db[_0x8651('0x133')],{'through':'team_has_sms_queues','as':_0x8651('0x134')});db[_0x8651('0x125')][_0x8651('0x122')](db['OpenchannelQueue'],{'through':_0x8651('0x18e'),'as':_0x8651('0x135')});db[_0x8651('0x125')]['belongsToMany'](db['WhatsappQueue'],{'through':_0x8651('0x1cb'),'as':'WhatsappQueues'});db['Team'][_0x8651('0x122')](db[_0x8651('0xf5')],{'through':_0x8651('0x1cc'),'as':_0x8651('0x12f')});db[_0x8651('0xe4')]['hasMany'](db[_0x8651('0x75')],{'as':'Hoppers','foreignKey':_0x8651('0x19e')});db[_0x8651('0xe4')][_0x8651('0x111')](db[_0x8651('0x114')],{'as':_0x8651('0x1cd'),'foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0x8651('0x115')],{'as':_0x8651('0x149'),'foreignKey':'CampaignId'});db[_0x8651('0xe4')][_0x8651('0x111')](db[_0x8651('0x14a')],{'as':_0x8651('0x14b'),'foreignKey':_0x8651('0x19e')});db[_0x8651('0xe4')][_0x8651('0x11e')](db[_0x8651('0x14d')],{'as':_0x8651('0x14d'),'foreignKey':'TrunkId'});db[_0x8651('0xe4')][_0x8651('0x11e')](db[_0x8651('0x14d')],{'as':_0x8651('0x14f'),'foreignKey':_0x8651('0x150')});db[_0x8651('0xe4')][_0x8651('0x11e')](db[_0x8651('0x81')],{'as':_0x8651('0x81'),'foreignKey':_0x8651('0x174')});db[_0x8651('0xe4')][_0x8651('0x11e')](db['SquareProject'],{'as':_0x8651('0x141'),'foreignKey':'SquareProjectId'});db[_0x8651('0xe4')][_0x8651('0x122')](db[_0x8651('0xf3')],{'as':_0x8651('0x123'),'through':_0x8651('0x1ce')});db['Campaign'][_0x8651('0x122')](db['CmList'],{'as':_0x8651('0x1cf'),'through':_0x8651('0x1d0')});db[_0x8651('0x18d')][_0x8651('0x11e')](db[_0x8651('0x172')],{'as':_0x8651('0x172'),'foreignKey':'ChatOfflineMessageId'});db[_0x8651('0xeb')][_0x8651('0x11e')](db[_0x8651('0x170')],{});db[_0x8651('0xeb')][_0x8651('0x11e')](db[_0x8651('0x49')],{});db[_0x8651('0xeb')][_0x8651('0x11e')](db[_0x8651('0x44')],{'foreignKey':_0x8651('0x1d1'),'as':_0x8651('0x1d2')});db[_0x8651('0xeb')][_0x8651('0x11e')](db[_0x8651('0x13')],{'foreignKey':_0x8651('0x1d3'),'as':_0x8651('0x1d4')});db[_0x8651('0xeb')][_0x8651('0x11e')](db[_0x8651('0x13')],{'foreignKey':_0x8651('0x1d5'),'as':_0x8651('0x1d6')});db[_0x8651('0xeb')][_0x8651('0x11e')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x8651('0x1d7')});db[_0x8651('0xeb')][_0x8651('0x11e')](db[_0x8651('0x44')],{'foreignKey':_0x8651('0x1d8'),'as':_0x8651('0x1d9')});db[_0x8651('0xed')]['belongsTo'](db[_0x8651('0x6b')],{});db['ChatTransferReport'][_0x8651('0x11e')](db[_0x8651('0x69')],{});db[_0x8651('0xed')][_0x8651('0x11e')](db[_0x8651('0x137')],{'foreignKey':_0x8651('0x1da'),'as':_0x8651('0x1d2')});db[_0x8651('0xed')][_0x8651('0x11e')](db[_0x8651('0x13')],{'foreignKey':_0x8651('0x1d3'),'as':_0x8651('0x1d4')});db[_0x8651('0xed')][_0x8651('0x11e')](db[_0x8651('0x13')],{'foreignKey':_0x8651('0x1d5'),'as':'ToAgent'});db['ChatTransferReport'][_0x8651('0x11e')](db[_0x8651('0x6e')],{'foreignKey':_0x8651('0x1db'),'as':'ToQueue'});db[_0x8651('0xed')][_0x8651('0x11e')](db[_0x8651('0x137')],{'foreignKey':'ToChatWebsiteId','as':_0x8651('0x1d9')});db[_0x8651('0xee')][_0x8651('0x11e')](db['FaxMessage'],{});db['FaxTransferReport']['belongsTo'](db[_0x8651('0x119')],{});db[_0x8651('0xee')]['belongsTo'](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':_0x8651('0x1d2')});db['FaxTransferReport'][_0x8651('0x11e')](db['User'],{'foreignKey':_0x8651('0x1d3'),'as':_0x8651('0x1d4')});db['FaxTransferReport']['belongsTo'](db[_0x8651('0x13')],{'foreignKey':_0x8651('0x1d5'),'as':'ToAgent'});db[_0x8651('0xee')][_0x8651('0x11e')](db[_0x8651('0x55')],{'foreignKey':_0x8651('0x1dc'),'as':_0x8651('0x1d7')});db['FaxTransferReport'][_0x8651('0x11e')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x8651('0x1d9')});db[_0x8651('0x1dd')]['belongsTo'](db[_0x8651('0x189')],{});db[_0x8651('0x1dd')][_0x8651('0x11e')](db[_0x8651('0x63')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x8651('0x5f')],{'foreignKey':_0x8651('0x1de'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0x8651('0x11e')](db[_0x8651('0x13')],{'foreignKey':_0x8651('0x1d3'),'as':_0x8651('0x1d4')});db[_0x8651('0x1dd')]['belongsTo'](db['User'],{'foreignKey':_0x8651('0x1d5'),'as':_0x8651('0x1d6')});db['OpenchannelTransferReport'][_0x8651('0x11e')](db[_0x8651('0x65')],{'foreignKey':_0x8651('0x1df'),'as':_0x8651('0x1d7')});db['OpenchannelTransferReport'][_0x8651('0x11e')](db[_0x8651('0x5f')],{'foreignKey':_0x8651('0x1e0'),'as':'ToAccount'});db['SmsTransferReport'][_0x8651('0x11e')](db['SmsMessage'],{});db['SmsTransferReport']['belongsTo'](db[_0x8651('0x5a')],{});db[_0x8651('0xf1')][_0x8651('0x11e')](db['SmsAccount'],{'foreignKey':_0x8651('0x1e1'),'as':'FromAccount'});db[_0x8651('0xf1')][_0x8651('0x11e')](db[_0x8651('0x13')],{'foreignKey':_0x8651('0x1d3'),'as':_0x8651('0x1d4')});db[_0x8651('0xf1')][_0x8651('0x11e')](db['User'],{'foreignKey':_0x8651('0x1d5'),'as':_0x8651('0x1d6')});db['SmsTransferReport']['belongsTo'](db[_0x8651('0x133')],{'foreignKey':_0x8651('0x1e2'),'as':_0x8651('0x1d7')});db[_0x8651('0xf1')][_0x8651('0x11e')](db[_0x8651('0x59')],{'foreignKey':'ToSmsAccountId','as':_0x8651('0x1d9')});db['CmList'][_0x8651('0x111')](db[_0x8651('0x178')],{'as':_0x8651('0x163'),'foreignKey':_0x8651('0x168'),'onDelete':_0x8651('0x10e')});db['CmList'][_0x8651('0x111')](db[_0x8651('0x79')],{'as':_0x8651('0x1e3'),'foreignKey':'ListId'});db['CmList'][_0x8651('0x111')](db['CmContact'],{'as':_0x8651('0x121'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x168')});db[_0x8651('0xf3')][_0x8651('0x111')](db['CmHopperFinal'],{'as':_0x8651('0x1cd'),'foreignKey':'ListId'});db[_0x8651('0xf3')][_0x8651('0x111')](db[_0x8651('0x115')],{'as':_0x8651('0x1e4'),'foreignKey':_0x8651('0x168')});db['CmList'][_0x8651('0x111')](db[_0x8651('0x78')],{'as':_0x8651('0x78'),'foreignKey':_0x8651('0x168')});db['CmList']['belongsToMany'](db[_0x8651('0x1d')],{'as':'Queues','through':_0x8651('0x153')});db[_0x8651('0xf3')][_0x8651('0x122')](db[_0x8651('0x13')],{'as':'Agents','through':_0x8651('0x124')});db[_0x8651('0xf5')][_0x8651('0x111')](db['VoiceExtension'],{'as':_0x8651('0x113'),'onDelete':_0x8651('0x10e')});db[_0x8651('0xf5')][_0x8651('0x122')](db[_0x8651('0x13')],{'as':_0x8651('0x154'),'through':_0x8651('0x109')});db[_0x8651('0xf5')][_0x8651('0x122')](db['Team'],{'through':_0x8651('0x1cc'),'as':_0x8651('0x187')});db['UserProfile'][_0x8651('0x111')](db[_0x8651('0x13')],{'as':_0x8651('0x16d'),'foreignKey':_0x8651('0x1e5')});db['UserProfile'][_0x8651('0x111')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0x8651('0x1e5'),'onDelete':_0x8651('0x10e')});db['UserProfileSection'][_0x8651('0x111')](db[_0x8651('0xf9')],{'as':_0x8651('0x1e6'),'foreignKey':_0x8651('0x1e7'),'onDelete':_0x8651('0x10e')});db[_0x8651('0xfc')]['hasMany'](db['Disposition'],{'as':_0x8651('0x163'),'foreignKey':_0x8651('0x1e8'),'onDelete':_0x8651('0x10e')});db['WhatsappAccount']['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8651('0x1e8')});db[_0x8651('0xfc')][_0x8651('0x111')](db[_0x8651('0x101')],{'as':_0x8651('0x165'),'foreignKey':_0x8651('0x1e8')});db[_0x8651('0xfc')][_0x8651('0x111')](db[_0x8651('0x100')],{'as':_0x8651('0x166')});db[_0x8651('0xfc')][_0x8651('0x111')](db[_0x8651('0xfe')],{'as':_0x8651('0x145')});db['WhatsappAccount']['belongsTo'](db['CmList'],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168')});db[_0x8651('0xfc')][_0x8651('0x11e')](db[_0x8651('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x8651('0x152')});db[_0x8651('0xfc')][_0x8651('0x122')](db[_0x8651('0x13')],{'as':_0x8651('0x154'),'through':_0x8651('0x140')});db['WhatsappApplication'][_0x8651('0x11e')](db['User'],{'onDelete':_0x8651('0x160')});db[_0x8651('0xfe')][_0x8651('0x11e')](db[_0x8651('0x106')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x8651('0x11e')](db[_0x8651('0xfc')],{'onDelete':_0x8651('0x160')});db[_0x8651('0xfe')][_0x8651('0x11e')](db[_0x8651('0x81')],{'onDelete':'restrict','foreignKey':_0x8651('0x174')});db[_0x8651('0xfe')][_0x8651('0x11e')](db['Tag'],{'onDelete':_0x8651('0x160'),'foreignKey':_0x8651('0x175')});db[_0x8651('0x100')][_0x8651('0x111')](db['WhatsappMessage'],{'as':_0x8651('0x165'),'onDelete':_0x8651('0x10e'),'foreignKey':_0x8651('0x1e9')});db[_0x8651('0x100')][_0x8651('0x11e')](db['WhatsappAccount'],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x1e8')});db[_0x8651('0x100')][_0x8651('0x11e')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x8651('0x100')][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':_0x8651('0x17b'),'foreignKey':_0x8651('0x110')});db[_0x8651('0x100')][_0x8651('0x122')](db[_0x8651('0x8a')],{'through':_0x8651('0x1ac'),'as':_0x8651('0x17d')});db['WhatsappInteraction'][_0x8651('0x122')](db[_0x8651('0x8a')],{'through':_0x8651('0x1ac'),'as':_0x8651('0x16c')});db[_0x8651('0x100')]['belongsToMany'](db[_0x8651('0x13')],{'as':'Users','through':_0x8651('0x12d'),'foreignKey':_0x8651('0x1e9')});db[_0x8651('0x101')][_0x8651('0x11e')](db[_0x8651('0x13')],{'as':_0x8651('0x13')});db[_0x8651('0x101')][_0x8651('0x11e')](db[_0x8651('0x74')],{'onDelete':_0x8651('0x10e'),'as':'Contact'});db[_0x8651('0x101')][_0x8651('0x11e')](db['WhatsappInteraction'],{'onDelete':_0x8651('0x10e'),'as':_0x8651('0x17e'),'foreignKey':_0x8651('0x1e9')});db['WhatsappMessage'][_0x8651('0x11e')](db[_0x8651('0xfc')],{'as':_0x8651('0x171'),'foreignKey':_0x8651('0x1e8')});db[_0x8651('0x102')][_0x8651('0x11e')](db[_0x8651('0xfc')],{});db[_0x8651('0x102')][_0x8651('0x11e')](db[_0x8651('0xf3')],{'as':_0x8651('0x167'),'foreignKey':_0x8651('0x168')});db[_0x8651('0x102')]['belongsTo'](db[_0x8651('0x74')],{'as':_0x8651('0x15c'),'foreignKey':_0x8651('0x177')});db[_0x8651('0x102')]['belongsTo'](db[_0x8651('0x100')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x8651('0x106')],{});db[_0x8651('0x102')][_0x8651('0x11e')](db['WhatsappMessage'],{});db['WhatsappQueueReport'][_0x8651('0x11e')](db[_0x8651('0x13')],{});db['WhatsappTransferReport'][_0x8651('0x11e')](db[_0x8651('0x101')],{});db[_0x8651('0x104')][_0x8651('0x11e')](db[_0x8651('0x100')],{});db[_0x8651('0x104')][_0x8651('0x11e')](db['WhatsappAccount'],{'foreignKey':_0x8651('0x1ea'),'as':_0x8651('0x1d2')});db[_0x8651('0x104')][_0x8651('0x11e')](db['WhatsappAccount'],{'foreignKey':_0x8651('0x1eb'),'as':'ToAccount'});db[_0x8651('0x104')][_0x8651('0x11e')](db[_0x8651('0x106')],{'foreignKey':_0x8651('0x1ec'),'as':_0x8651('0x1d7')});db['WhatsappTransferReport'][_0x8651('0x11e')](db['User'],{'foreignKey':_0x8651('0x1d3'),'as':_0x8651('0x1d4')});db['WhatsappTransferReport'][_0x8651('0x11e')](db['User'],{'foreignKey':_0x8651('0x1d5'),'as':_0x8651('0x1d6')});db[_0x8651('0x106')][_0x8651('0x122')](db[_0x8651('0x13')],{'as':_0x8651('0x154'),'through':_0x8651('0x3f'),'foreignKey':_0x8651('0x1ed')});db[_0x8651('0x106')][_0x8651('0x122')](db[_0x8651('0x125')],{'through':_0x8651('0x1cb'),'as':_0x8651('0x187')});db['UserSetting']['belongsTo'](db[_0x8651('0x13')],{'as':_0x8651('0x1ee'),'foreignKey':_0x8651('0x110'),'onDelete':'cascade','hooks':!![]});db[_0x8651('0x15e')]['hasOne'](db[_0x8651('0x1c5')],{'as':'Dynamics365Account','onDelete':'restrict'});db[_0x8651('0x15e')][_0x8651('0x10d')](db['MailServerIn'],{'as':'Imap','onDelete':_0x8651('0x160')});db[_0x8651('0x15e')][_0x8651('0x10d')](db[_0x8651('0x161')],{'as':_0x8651('0x1ef'),'onDelete':_0x8651('0x160')});module[_0x8651('0x1f0')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 76ddece..c021f33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032e=['./api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','join','/www','static','/demo','/snippet','root','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','./errors','./config/environment','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./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/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/messages','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/user-setting','/api/auth/local','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system'];(function(_0x117f87,_0x4a1be5){var _0x3b46ad=function(_0x36e7e0){while(--_0x36e7e0){_0x117f87['push'](_0x117f87['shift']());}};_0x3b46ad(++_0x4a1be5);}(_0x032e,0x124));var _0xe032=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x032e[_0x5783f4];return _0x28e380;};'use strict';var path=require(_0xe032('0x0'));var express=require('express');var errors=require(_0xe032('0x1'));var config=require(_0xe032('0x2'));var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require(_0xe032('0x3'));exports[_0xe032('0x4')]=function(_0x2f44f6){return setupLoggers(_0x2f44f6)[_0xe032('0x5')](function(){_0x2f44f6[_0xe032('0x6')](_0xe032('0x7'),require(_0xe032('0x8')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x9'),require(_0xe032('0xa')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xb'),require(_0xe032('0xc')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xd'),require(_0xe032('0xe')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xf'),require('./api/voiceMusicOnHold'));_0x2f44f6[_0xe032('0x6')](_0xe032('0x10'),require(_0xe032('0x11')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x12'),require(_0xe032('0x13')));_0x2f44f6[_0xe032('0x6')]('/api/screen/recordings',require(_0xe032('0x14')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x15'),require(_0xe032('0x16')));_0x2f44f6['use'](_0xe032('0x17'),require(_0xe032('0x18')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x19'),require(_0xe032('0x1a')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x1b'),require('./api/voiceDialReport'));_0x2f44f6[_0xe032('0x6')](_0xe032('0x1c'),require(_0xe032('0x1d')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x1e'),require(_0xe032('0x1f')));_0x2f44f6['use'](_0xe032('0x20'),require(_0xe032('0x21')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x22'),require(_0xe032('0x23')));_0x2f44f6['use']('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x2f44f6[_0xe032('0x6')]('/api/mail/out_servers',require(_0xe032('0x24')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x25'),require(_0xe032('0x26')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x27'),require(_0xe032('0x28')));_0x2f44f6['use'](_0xe032('0x29'),require(_0xe032('0x2a')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x2b'),require(_0xe032('0x2c')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x2d'),require(_0xe032('0x2e')));_0x2f44f6['use']('/api/mail/applications',require('./api/mailApplication'));_0x2f44f6[_0xe032('0x6')](_0xe032('0x2f'),require(_0xe032('0x30')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x31'),require(_0xe032('0x32')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x33'),require(_0xe032('0x34')));_0x2f44f6[_0xe032('0x6')]('/api/fax/accounts',require(_0xe032('0x35')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x36'),require(_0xe032('0x37')));_0x2f44f6['use']('/api/fax/interactions',require(_0xe032('0x38')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x39'),require(_0xe032('0x3a')));_0x2f44f6['use']('/api/fax/queues',require('./api/faxQueue'));_0x2f44f6[_0xe032('0x6')](_0xe032('0x3b'),require(_0xe032('0x3c')));_0x2f44f6[_0xe032('0x6')]('/api/sms/accounts',require(_0xe032('0x3d')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x3e'),require(_0xe032('0x3f')));_0x2f44f6[_0xe032('0x6')]('/api/sms/interactions',require(_0xe032('0x40')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x41'),require(_0xe032('0x42')));_0x2f44f6['use'](_0xe032('0x43'),require('./api/smsQueue'));_0x2f44f6[_0xe032('0x6')]('/api/openchannel/accounts',require(_0xe032('0x44')));_0x2f44f6['use'](_0xe032('0x45'),require('./api/openchannelApplication'));_0x2f44f6[_0xe032('0x6')](_0xe032('0x46'),require('./api/openchannelInteraction'));_0x2f44f6[_0xe032('0x6')](_0xe032('0x47'),require(_0xe032('0x48')));_0x2f44f6[_0xe032('0x6')]('/api/openchannel/queues',require(_0xe032('0x49')));_0x2f44f6['use'](_0xe032('0x4a'),require(_0xe032('0x4b')));_0x2f44f6['use'](_0xe032('0x4c'),require(_0xe032('0x4d')));_0x2f44f6['use'](_0xe032('0x4e'),require(_0xe032('0x4f')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x50'),require(_0xe032('0x51')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x52'),require(_0xe032('0x53')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x54'),require(_0xe032('0x55')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x56'),require(_0xe032('0x57')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x58'),require(_0xe032('0x59')));_0x2f44f6['use'](_0xe032('0x5a'),require('./api/chatProactiveAction'));_0x2f44f6[_0xe032('0x6')](_0xe032('0x5b'),require(_0xe032('0x5c')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x5d'),require('./api/cmContact'));_0x2f44f6[_0xe032('0x6')]('/api/cm/hopper',require(_0xe032('0x5e')));_0x2f44f6['use'](_0xe032('0x5f'),require(_0xe032('0x60')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x61'),require('./api/cmHopperFinal'));_0x2f44f6[_0xe032('0x6')]('/api/cm/hopper_history',require(_0xe032('0x62')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x63'),require(_0xe032('0x64')));_0x2f44f6['use']('/api/actions',require(_0xe032('0x65')));_0x2f44f6[_0xe032('0x6')]('/api/automations',require(_0xe032('0x66')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x67'),require(_0xe032('0x68')));_0x2f44f6[_0xe032('0x6')]('/api/dispositions',require(_0xe032('0x69')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x6a'),require(_0xe032('0x6b')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x6c'),require(_0xe032('0x6d')));_0x2f44f6[_0xe032('0x6')]('/api/pauses',require('./api/pause'));_0x2f44f6[_0xe032('0x6')]('/api/cdr',require(_0xe032('0x6e')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x6f'),require(_0xe032('0x70')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x71'),require(_0xe032('0x72')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x73'),require('./api/sound'));_0x2f44f6[_0xe032('0x6')]('/api/tags',require('./api/tag'));_0x2f44f6[_0xe032('0x6')](_0xe032('0x74'),require(_0xe032('0x75')));_0x2f44f6[_0xe032('0x6')]('/api/triggers',require(_0xe032('0x76')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x77'),require(_0xe032('0x78')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x79'),require(_0xe032('0x7a')));_0x2f44f6['use'](_0xe032('0x7b'),require(_0xe032('0x7c')));_0x2f44f6['use'](_0xe032('0x7d'),require(_0xe032('0x7e')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x7f'),require(_0xe032('0x80')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x81'),require(_0xe032('0x82')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x83'),require(_0xe032('0x84')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x85'),require(_0xe032('0x86')));_0x2f44f6['use'](_0xe032('0x87'),require('./api/analyticTreeReport'));_0x2f44f6[_0xe032('0x6')](_0xe032('0x88'),require(_0xe032('0x89')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x8a'),require(_0xe032('0x8b')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x8c'),require(_0xe032('0x8d')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x8e'),require('./api/intSugarcrmAccount'));_0x2f44f6[_0xe032('0x6')](_0xe032('0x8f'),require('./api/intSugarcrmConfiguration'));_0x2f44f6[_0xe032('0x6')]('/api/integrations/sugarcrm/fields',require(_0xe032('0x90')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x91'),require(_0xe032('0x92')));_0x2f44f6[_0xe032('0x6')]('/api/integrations/desk/configurations',require(_0xe032('0x93')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x94'),require(_0xe032('0x95')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x96'),require(_0xe032('0x97')));_0x2f44f6['use'](_0xe032('0x98'),require(_0xe032('0x99')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x9a'),require(_0xe032('0x9b')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x9c'),require(_0xe032('0x9d')));_0x2f44f6[_0xe032('0x6')]('/api/integrations/zendesk/configurations',require(_0xe032('0x9e')));_0x2f44f6[_0xe032('0x6')](_0xe032('0x9f'),require('./api/intZendeskField'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xa0'),require('./api/intFreshdeskAccount'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xa1'),require(_0xe032('0xa2')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xa3'),require(_0xe032('0xa4')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xa5'),require(_0xe032('0xa6')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xa7'),require('./api/intVtigerConfiguration'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xa8'),require(_0xe032('0xa9')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xaa'),require('./api/intServicenowAccount'));_0x2f44f6[_0xe032('0x6')]('/api/integrations/servicenow/configurations',require(_0xe032('0xab')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xac'),require(_0xe032('0xad')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xae'),require(_0xe032('0xaf')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xb0'),require('./api/intDynamics365Configuration'));_0x2f44f6['use']('/api/integrations/dynamics365/fields',require(_0xe032('0xb1')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xb2'),require(_0xe032('0xb3')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xb4'),require('./api/intFreshsalesConfiguration'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xb5'),require(_0xe032('0xb6')));_0x2f44f6['use'](_0xe032('0xb7'),require('./api/network'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xb8'),require('./api/chatQueueReport'));_0x2f44f6['use']('/api/chat/internal/messages',require(_0xe032('0xb9')));_0x2f44f6['use']('/api/jscripty/answers/reports',require(_0xe032('0xba')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xbb'),require('./api/jscriptyQuestionReport'));_0x2f44f6[_0xe032('0x6')]('/api/jscripty/sessions/reports',require(_0xe032('0xbc')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xbd'),require(_0xe032('0xbe')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xbf'),require(_0xe032('0xc0')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xc1'),require(_0xe032('0xc2')));_0x2f44f6[_0xe032('0x6')]('/api/jscripty/projects',require(_0xe032('0xc3')));_0x2f44f6[_0xe032('0x6')]('/api/settings',require('./api/setting'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xc4'),require(_0xe032('0xc5')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xc6'),require(_0xe032('0xc7')));_0x2f44f6['use'](_0xe032('0xc8'),require(_0xe032('0xc9')));_0x2f44f6['use'](_0xe032('0xca'),require(_0xe032('0xcb')));_0x2f44f6[_0xe032('0x6')]('/api/teams',require(_0xe032('0xcc')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xcd'),require('./api/license'));_0x2f44f6['use'](_0xe032('0xce'),require('./api/campaign'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xcf'),require(_0xe032('0xd0')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xd1'),require(_0xe032('0xd2')));_0x2f44f6['use'](_0xe032('0xd3'),require(_0xe032('0xd4')));_0x2f44f6[_0xe032('0x6')]('/api/mail/reports/transfer',require(_0xe032('0xd5')));_0x2f44f6['use'](_0xe032('0xd6'),require('./api/chatTransferReport'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xd7'),require(_0xe032('0xd8')));_0x2f44f6['use'](_0xe032('0xd9'),require(_0xe032('0xda')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xdb'),require(_0xe032('0xdc')));_0x2f44f6[_0xe032('0x6')]('/api/cm/lists',require(_0xe032('0xdd')));_0x2f44f6[_0xe032('0x6')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xde'),require(_0xe032('0xdf')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xe0'),require('./api/userProfileSection'));_0x2f44f6[_0xe032('0x6')]('/api/userProfile/resources',require(_0xe032('0xe1')));_0x2f44f6['use'](_0xe032('0xe2'),require(_0xe032('0xe3')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xe4'),require(_0xe032('0xe5')));_0x2f44f6[_0xe032('0x6')]('/api/whatsapp/applications',require(_0xe032('0xe6')));_0x2f44f6['use']('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xe7'),require('./api/whatsappMessage'));_0x2f44f6[_0xe032('0x6')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xe8'),require('./api/whatsappTransferReport'));_0x2f44f6['use'](_0xe032('0xe9'),require(_0xe032('0xea')));_0x2f44f6['use'](_0xe032('0xeb'),require(_0xe032('0xec')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xed'),require('./api/realtime'));_0x2f44f6[_0xe032('0x6')]('/api/user-settings',require(_0xe032('0xee')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xef'),require('./api/authLocal'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xf0'),require('./api/authGoogle'));_0x2f44f6[_0xe032('0x6')](_0xe032('0xf1'),require(_0xe032('0xf2')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xf3'),require(_0xe032('0xf4')));_0x2f44f6['use'](_0xe032('0xf5'),require(_0xe032('0xf6')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xf7'),require(_0xe032('0xf8')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xf9'),require(_0xe032('0xfa')));_0x2f44f6[_0xe032('0x6')](_0xe032('0xfb'),require(_0xe032('0xfc')));_0x2f44f6['use'](_0xe032('0xfd'),require('./api/webbar'));_0x2f44f6[_0xe032('0x6')]('/api/logs',clientSideLogs);_0x2f44f6[_0xe032('0x6')](_0xe032('0xfe'),express['static'](path[_0xe032('0xff')](config['root'],'/apidoc')));_0x2f44f6['use'](_0xe032('0x100'),express[_0xe032('0x101')](path[_0xe032('0xff')](config['root'],_0xe032('0x100'))));_0x2f44f6[_0xe032('0x6')](_0xe032('0x102'),express['static'](path[_0xe032('0xff')](config['root'],_0xe032('0x102'))));_0x2f44f6[_0xe032('0x6')](_0xe032('0x103'),express[_0xe032('0x101')](path[_0xe032('0xff')](config[_0xe032('0x104')],_0xe032('0x105'),_0xe032('0x106'))));_0x2f44f6[_0xe032('0x6')](_0xe032('0x107'),express['static'](path['join'](config[_0xe032('0x104')],_0xe032('0x108'))));_0x2f44f6[_0xe032('0x109')](_0xe032('0x10a'))['get'](errors[0x194]);_0x2f44f6[_0xe032('0x109')]('/*')[_0xe032('0x10b')](function(_0x4502ea,_0xb5e19d){_0xb5e19d['sendFile'](path[_0xe032('0x10c')](_0x2f44f6[_0xe032('0x10b')](_0xe032('0x10d'))+_0xe032('0x10e')));});return _0x2f44f6;});};
\ No newline at end of file
+var _0x5fc3=['./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/dispositions','/api/conditions','./api/condition','/api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/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/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/chat/reports/queue','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','root','static','/demo','/snippet','snippet','3.0.0','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','./api/voiceRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields'];(function(_0x3d7ccf,_0x55ca96){var _0x5c2e8d=function(_0x3728c5){while(--_0x3728c5){_0x3d7ccf['push'](_0x3d7ccf['shift']());}};_0x5c2e8d(++_0x55ca96);}(_0x5fc3,0xa8));var _0x35fc=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x5fc3[_0x53cf8e];return _0x459197;};'use strict';var path=require(_0x35fc('0x0'));var express=require(_0x35fc('0x1'));var errors=require('./errors');var config=require(_0x35fc('0x2'));var setupLoggers=require(_0x35fc('0x3'))[_0x35fc('0x4')];var clientSideLogs=require(_0x35fc('0x5'));exports[_0x35fc('0x6')]=function(_0x5e75e6){return setupLoggers(_0x5e75e6)[_0x35fc('0x7')](function(){_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x9'),require('./api/user'));_0x5e75e6['use'](_0x35fc('0xa'),require('./api/voiceChanSpy'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xb'),require(_0x35fc('0xc')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xd'),require(_0x35fc('0xe')));_0x5e75e6[_0x35fc('0x8')]('/api/voice/mohs',require(_0x35fc('0xf')));_0x5e75e6[_0x35fc('0x8')]('/api/voice/queues',require(_0x35fc('0x10')));_0x5e75e6[_0x35fc('0x8')]('/api/voice/recordings',require(_0x35fc('0x11')));_0x5e75e6[_0x35fc('0x8')]('/api/screen/recordings',require('./api/screenRecording'));_0x5e75e6[_0x35fc('0x8')]('/api/voice/mails',require(_0x35fc('0x12')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x13'),require(_0x35fc('0x14')));_0x5e75e6[_0x35fc('0x8')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x5e75e6['use']('/api/voice/dials/reports',require(_0x35fc('0x15')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x16'),require(_0x35fc('0x17')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x18'),require('./api/voiceQueueReport'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x19'),require('./api/memberReport'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x1a'),require(_0x35fc('0x1b')));_0x5e75e6['use'](_0x35fc('0x1c'),require(_0x35fc('0x1d')));_0x5e75e6[_0x35fc('0x8')]('/api/mail/out_servers',require(_0x35fc('0x1e')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x1f'),require(_0x35fc('0x20')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x21'),require(_0x35fc('0x22')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x23'),require(_0x35fc('0x24')));_0x5e75e6['use'](_0x35fc('0x25'),require(_0x35fc('0x26')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x27'),require(_0x35fc('0x28')));_0x5e75e6['use'](_0x35fc('0x29'),require(_0x35fc('0x2a')));_0x5e75e6['use'](_0x35fc('0x2b'),require(_0x35fc('0x2c')));_0x5e75e6[_0x35fc('0x8')]('/api/dashboards',require(_0x35fc('0x2d')));_0x5e75e6['use'](_0x35fc('0x2e'),require(_0x35fc('0x2f')));_0x5e75e6['use']('/api/fax/accounts',require(_0x35fc('0x30')));_0x5e75e6['use'](_0x35fc('0x31'),require(_0x35fc('0x32')));_0x5e75e6['use'](_0x35fc('0x33'),require(_0x35fc('0x34')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x35'),require(_0x35fc('0x36')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x37'),require(_0x35fc('0x38')));_0x5e75e6['use'](_0x35fc('0x39'),require(_0x35fc('0x3a')));_0x5e75e6[_0x35fc('0x8')]('/api/sms/accounts',require(_0x35fc('0x3b')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x3c'),require(_0x35fc('0x3d')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x3e'),require(_0x35fc('0x3f')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x40'),require(_0x35fc('0x41')));_0x5e75e6['use']('/api/sms/queues',require(_0x35fc('0x42')));_0x5e75e6['use'](_0x35fc('0x43'),require(_0x35fc('0x44')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x45'),require(_0x35fc('0x46')));_0x5e75e6[_0x35fc('0x8')]('/api/openchannel/interactions',require(_0x35fc('0x47')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x48'),require(_0x35fc('0x49')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x4a'),require('./api/openchannelQueue'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x4b'),require(_0x35fc('0x4c')));_0x5e75e6['use'](_0x35fc('0x4d'),require('./api/openchannelQueueReport'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x4e'),require(_0x35fc('0x4f')));_0x5e75e6[_0x35fc('0x8')]('/api/chat/interactions',require('./api/chatInteraction'));_0x5e75e6['use'](_0x35fc('0x50'),require('./api/chatMessage'));_0x5e75e6[_0x35fc('0x8')]('/api/chat/offline_messages',require(_0x35fc('0x51')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x52'),require(_0x35fc('0x53')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x54'),require(_0x35fc('0x55')));_0x5e75e6['use'](_0x35fc('0x56'),require(_0x35fc('0x57')));_0x5e75e6['use'](_0x35fc('0x58'),require(_0x35fc('0x59')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x5a'),require(_0x35fc('0x5b')));_0x5e75e6[_0x35fc('0x8')]('/api/cm/hopper',require(_0x35fc('0x5c')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x5d'),require('./api/cmHopperBlack'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x5e'),require('./api/cmHopperFinal'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x5f'),require(_0x35fc('0x60')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x61'),require(_0x35fc('0x62')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x63'),require('./api/action'));_0x5e75e6['use'](_0x35fc('0x64'),require(_0x35fc('0x65')));_0x5e75e6['use']('/api/canned_answers',require('./api/cannedAnswer'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x66'),require('./api/disposition'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x67'),require(_0x35fc('0x68')));_0x5e75e6[_0x35fc('0x8')]('/api/intervals',require('./api/interval'));_0x5e75e6['use']('/api/pauses',require('./api/pause'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x69'),require('./api/cdr'));_0x5e75e6[_0x35fc('0x8')]('/api/voiceQueuesLog',require(_0x35fc('0x6a')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x6b'),require(_0x35fc('0x6c')));_0x5e75e6[_0x35fc('0x8')]('/api/sounds',require(_0x35fc('0x6d')));_0x5e75e6[_0x35fc('0x8')]('/api/tags',require(_0x35fc('0x6e')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x6f'),require(_0x35fc('0x70')));_0x5e75e6['use'](_0x35fc('0x71'),require('./api/trigger'));_0x5e75e6['use'](_0x35fc('0x72'),require(_0x35fc('0x73')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x74'),require(_0x35fc('0x75')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x76'),require(_0x35fc('0x77')));_0x5e75e6['use'](_0x35fc('0x78'),require(_0x35fc('0x79')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x7a'),require(_0x35fc('0x7b')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x7c'),require(_0x35fc('0x7d')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x7e'),require(_0x35fc('0x7f')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x80'),require(_0x35fc('0x81')));_0x5e75e6['use']('/api/analytics/tree_reports',require(_0x35fc('0x82')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x83'),require(_0x35fc('0x84')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x85'),require('./api/intSalesforceConfiguration'));_0x5e75e6['use'](_0x35fc('0x86'),require(_0x35fc('0x87')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x88'),require('./api/intSugarcrmAccount'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x89'),require('./api/intSugarcrmConfiguration'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x8a'),require('./api/intSugarcrmField'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x8b'),require(_0x35fc('0x8c')));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x5e75e6['use'](_0x35fc('0x8d'),require(_0x35fc('0x8e')));_0x5e75e6['use'](_0x35fc('0x8f'),require(_0x35fc('0x90')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x91'),require(_0x35fc('0x92')));_0x5e75e6['use'](_0x35fc('0x93'),require(_0x35fc('0x94')));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/zendesk/accounts',require(_0x35fc('0x95')));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/zendesk/configurations',require(_0x35fc('0x96')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x97'),require(_0x35fc('0x98')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x99'),require(_0x35fc('0x9a')));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/freshdesk/configurations',require(_0x35fc('0x9b')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x9c'),require('./api/intFreshdeskField'));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x5e75e6['use'](_0x35fc('0x9d'),require(_0x35fc('0x9e')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x9f'),require(_0x35fc('0xa0')));_0x5e75e6['use']('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x5e75e6['use']('/api/integrations/servicenow/configurations',require(_0x35fc('0xa1')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xa2'),require(_0x35fc('0xa3')));_0x5e75e6['use'](_0x35fc('0xa4'),require(_0x35fc('0xa5')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xa6'),require(_0x35fc('0xa7')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xa8'),require(_0x35fc('0xa9')));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/freshsales/accounts',require(_0x35fc('0xaa')));_0x5e75e6['use'](_0x35fc('0xab'),require(_0x35fc('0xac')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xad'),require('./api/intFreshsalesField'));_0x5e75e6[_0x35fc('0x8')]('/api/networks',require('./api/network'));_0x5e75e6['use'](_0x35fc('0xae'),require('./api/chatQueueReport'));_0x5e75e6[_0x35fc('0x8')]('/api/chat/internal/messages',require(_0x35fc('0xaf')));_0x5e75e6['use'](_0x35fc('0xb0'),require(_0x35fc('0xb1')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xb2'),require('./api/jscriptyQuestionReport'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xb3'),require(_0x35fc('0xb4')));_0x5e75e6['use'](_0x35fc('0xb5'),require(_0x35fc('0xb6')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xb7'),require(_0x35fc('0xb8')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xb9'),require(_0x35fc('0xba')));_0x5e75e6['use'](_0x35fc('0xbb'),require(_0x35fc('0xbc')));_0x5e75e6[_0x35fc('0x8')]('/api/settings',require(_0x35fc('0xbd')));_0x5e75e6[_0x35fc('0x8')]('/api/square/odbc',require('./api/squareOdbc'));_0x5e75e6[_0x35fc('0x8')]('/api/square/projects',require(_0x35fc('0xbe')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xbf'),require(_0x35fc('0xc0')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xc1'),require(_0x35fc('0xc2')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xc3'),require(_0x35fc('0xc4')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xc5'),require(_0x35fc('0xc6')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xc7'),require(_0x35fc('0xc8')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xc9'),require(_0x35fc('0xca')));_0x5e75e6[_0x35fc('0x8')]('/api/attachments',require(_0x35fc('0xcb')));_0x5e75e6['use'](_0x35fc('0xcc'),require(_0x35fc('0xcd')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xce'),require(_0x35fc('0xcf')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xd0'),require(_0x35fc('0xd1')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xd2'),require(_0x35fc('0xd3')));_0x5e75e6['use'](_0x35fc('0xd4'),require(_0x35fc('0xd5')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xd6'),require(_0x35fc('0xd7')));_0x5e75e6[_0x35fc('0x8')]('/api/cm/lists',require(_0x35fc('0xd8')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xd9'),require(_0x35fc('0xda')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xdb'),require(_0x35fc('0xdc')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xdd'),require('./api/userProfileSection'));_0x5e75e6[_0x35fc('0x8')]('/api/userProfile/resources',require(_0x35fc('0xde')));_0x5e75e6[_0x35fc('0x8')]('/api/userNotifications',require(_0x35fc('0xdf')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe0'),require(_0x35fc('0xe1')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe2'),require(_0x35fc('0xe3')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe4'),require('./api/whatsappInteraction'));_0x5e75e6['use']('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe5'),require(_0x35fc('0xe6')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe7'),require('./api/whatsappTransferReport'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe8'),require(_0x35fc('0xe9')));_0x5e75e6[_0x35fc('0x8')]('/api/cloudProviders',require(_0x35fc('0xea')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xeb'),require('./api/realtime'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xec'),require(_0x35fc('0xed')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xee'),require(_0x35fc('0xef')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xf0'),require('./api/authGoogle'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xf1'),require(_0x35fc('0xf2')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xf3'),require(_0x35fc('0xf4')));_0x5e75e6['use'](_0x35fc('0xf5'),require('./api/rpc'));_0x5e75e6['use'](_0x35fc('0xf6'),require('./api/version'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xf7'),require(_0x35fc('0xf8')));_0x5e75e6['use'](_0x35fc('0xf9'),require(_0x35fc('0xfa')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xfb'),require(_0x35fc('0xfc')));_0x5e75e6['use']('/api/logs',clientSideLogs);_0x5e75e6['use'](_0x35fc('0xfd'),express['static'](path[_0x35fc('0xfe')](config[_0x35fc('0xff')],_0x35fc('0xfd'))));_0x5e75e6[_0x35fc('0x8')]('/www',express[_0x35fc('0x100')](path[_0x35fc('0xfe')](config[_0x35fc('0xff')],'/www')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x101'),express[_0x35fc('0x100')](path['join'](config['root'],'/demo')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x102'),express[_0x35fc('0x100')](path[_0x35fc('0xfe')](config['root'],_0x35fc('0x103'),_0x35fc('0x104'))));_0x5e75e6['use']('/plugins',express[_0x35fc('0x100')](path[_0x35fc('0xfe')](config[_0x35fc('0xff')],'/server/files/plugins')));_0x5e75e6['route'](_0x35fc('0x105'))[_0x35fc('0x106')](errors[0x194]);_0x5e75e6['route']('/*')[_0x35fc('0x106')](function(_0x163edb,_0x1d96c9){_0x1d96c9['sendFile'](path[_0x35fc('0x107')](_0x5e75e6[_0x35fc('0x106')](_0x35fc('0x108'))+_0x35fc('0x109')));});return _0x5e75e6;});};
\ No newline at end of file
index bddc89c..d33e310 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbab1=['Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelInteraction/openchannelInteraction.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/interval/interval.rpc','../api/pause/pause.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error'];(function(_0x2615ce,_0x62b603){var _0x3a7900=function(_0x3d0a0a){while(--_0x3d0a0a){_0x2615ce['push'](_0x2615ce['shift']());}};_0x3a7900(++_0x62b603);}(_0xbab1,0x151));var _0x1bab=function(_0x4fe94f,_0x29e574){_0x4fe94f=_0x4fe94f-0x0;var _0x315e8f=_0xbab1[_0x4fe94f];return _0x315e8f;};'use strict';var jayson=require(_0x1bab('0x0'));var _=require(_0x1bab('0x1'));var config=require(_0x1bab('0x2'));exports[_0x1bab('0x3')]=function(){return new Promise(function(_0x28e7e2,_0xbd601f){var _0x53f1bb={};_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x5')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x6')));_0x53f1bb=_['merge'](_0x53f1bb,require('../api/voiceQueue/voiceQueue.rpc'));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x7')));_0x53f1bb=_['merge'](_0x53f1bb,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x53f1bb=_['merge'](_0x53f1bb,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x8')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x9')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0xa')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0xb')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/mailServerIn/mailServerIn.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0xc')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0xd')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/mailInteraction/mailInteraction.rpc'));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0xe')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0xf')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x10')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x11')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x12')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x13')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/faxMessage/faxMessage.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x14')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x15')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x16')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x17')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x18')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/smsQueue/smsQueue.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x19')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x1a')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x1b')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x1c')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x1d')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/chatQueue/chatQueue.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x1e')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x1f')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x20')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x21')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x22')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x23')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x24')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x25')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/sound/sound.rpc'));_0x53f1bb=_['merge'](_0x53f1bb,require('../api/template/template.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x26')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x27')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x28')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x29')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x2a')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x2b')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x2c')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x2d')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x2e')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/squareReport/squareReport.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x2f')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x30')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x31')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require('../api/squareProject/squareProject.rpc'));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x32')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x33')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x34')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x35')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x36')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x37')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x38')));_0x53f1bb=_['merge'](_0x53f1bb,require(_0x1bab('0x39')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x3a')));_0x53f1bb=_[_0x1bab('0x4')](_0x53f1bb,require(_0x1bab('0x3b')));var _0x3d8fb6=jayson['server'](_0x53f1bb)[_0x1bab('0x3c')]();var _0x276698=config[_0x1bab('0x3d')]['port']||config[_0x1bab('0x3e')]+0x1;var _0x4532e6=config['rpc']['ip']||_0x1bab('0x3f');_0x3d8fb6['on'](_0x1bab('0x40'),function(_0x363d5a){return _0xbd601f(_0x363d5a);});_0x3d8fb6[_0x1bab('0x3')](_0x276698,_0x4532e6,function(){console['log'](_0x1bab('0x41'),_0x4532e6,_0x276698);require('../config/triggers')['default']();return _0x28e7e2(_0x1bab('0x42')+_0x4532e6+':'+_0x276698);});});};
\ No newline at end of file
+var _0xf0de=['../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.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/chatQueue/chatQueue.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','rpc','port','localhost','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','../config/environment','merge','../api/user/user.rpc'];(function(_0x334e2b,_0x5d266b){var _0x2098f9=function(_0x35bfb8){while(--_0x35bfb8){_0x334e2b['push'](_0x334e2b['shift']());}};_0x2098f9(++_0x5d266b);}(_0xf0de,0x14c));var _0xef0d=function(_0x3b1672,_0x1075fe){_0x3b1672=_0x3b1672-0x0;var _0x538a76=_0xf0de[_0x3b1672];return _0x538a76;};'use strict';var jayson=require('jayson/promise');var _=require('lodash');var config=require(_0xef0d('0x0'));exports['listen']=function(){return new Promise(function(_0x1245cf,_0x4e656b){var _0x4c2041={};_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x2')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x3')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x4')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x5')));_0x4c2041=_['merge'](_0x4c2041,require(_0xef0d('0x6')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x7')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x8')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x9')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0xa')));_0x4c2041=_['merge'](_0x4c2041,require(_0xef0d('0xb')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0xc')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0xd')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0xe')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/mailAccount/mailAccount.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0xf')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x10')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x11')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x12')));_0x4c2041=_['merge'](_0x4c2041,require(_0xef0d('0x13')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/faxAccount/faxAccount.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x14')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/faxInteraction/faxInteraction.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x15')));_0x4c2041=_['merge'](_0x4c2041,require(_0xef0d('0x16')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4c2041=_['merge'](_0x4c2041,require(_0xef0d('0x17')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/smsInteraction/smsInteraction.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/smsMessage/smsMessage.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/smsQueue/smsQueue.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x18')));_0x4c2041=_['merge'](_0x4c2041,require(_0xef0d('0x19')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x1a')));_0x4c2041=_['merge'](_0x4c2041,require(_0xef0d('0x1b')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x1c')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x1d')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x1e')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x1f')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/cmContact/cmContact.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/cmHopper/cmHopper.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x20')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x21')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x22')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x23')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x24')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/template/template.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x25')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x26')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x27')));_0x4c2041=_['merge'](_0x4c2041,require(_0xef0d('0x28')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x29')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x2a')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x2b')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x4c2041=_['merge'](_0x4c2041,require(_0xef0d('0x2c')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x2d')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x4c2041=_['merge'](_0x4c2041,require(_0xef0d('0x2e')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x2f')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x30')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x31')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x32')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x33')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x34')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x35')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/campaign/campaign.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x36')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x37')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x38')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x39')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require(_0xef0d('0x3a')));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x4c2041=_[_0xef0d('0x1')](_0x4c2041,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0xf07135=jayson['server'](_0x4c2041)['http']();var _0x412508=config[_0xef0d('0x3b')][_0xef0d('0x3c')]||config[_0xef0d('0x3c')]+0x1;var _0x6e6193=config[_0xef0d('0x3b')]['ip']||_0xef0d('0x3d');_0xf07135['on'](_0xef0d('0x3e'),function(_0x3297cd){return _0x4e656b(_0x3297cd);});_0xf07135[_0xef0d('0x3f')](_0x412508,_0x6e6193,function(){console['log'](_0xef0d('0x40'),_0x6e6193,_0x412508);require('../config/triggers')[_0xef0d('0x41')]();return _0x1245cf(_0xef0d('0x42')+_0x6e6193+':'+_0x412508);});});};
\ No newline at end of file
index 752b7ea..ceac9d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45bb=['split','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','prototype','sendRequest','command','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','isArray','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','exports','util','lodash','events','EventEmitter','./reply','./error','call','setTimeout','utf8','headers','ready','toLowerCase','hangup','substring','520-Invalid','search','function','replace','result=','indexOf','startsWith'];(function(_0x38b2d9,_0x19fd42){var _0x23a3e1=function(_0xd8192f){while(--_0xd8192f){_0x38b2d9['push'](_0x38b2d9['shift']());}};_0x23a3e1(++_0x19fd42);}(_0x45bb,0x79));var _0xb45b=function(_0x2b60f1,_0x326420){_0x2b60f1=_0x2b60f1-0x0;var _0x540620=_0x45bb[_0x2b60f1];return _0x540620;};'use strict';var util=require(_0xb45b('0x0'));var _=require(_0xb45b('0x1'));var EventEmitter=require(_0xb45b('0x2'))[_0xb45b('0x3')];var AGIReply=require(_0xb45b('0x4'));var AGIError=require(_0xb45b('0x5'));function AGIChannel(_0x186c9d){var _0x431dea=this,_0xac5ee2=new AGIReply(),_0x145e7a=![],_0x2802b0={};EventEmitter[_0xb45b('0x6')](_0x431dea);_0x186c9d['setEncoding']('utf8');_0x186c9d[_0xb45b('0x7')](0x8*0x3c*0x3c*0x3e8);_0xac5ee2['setEncoding'](_0xb45b('0x8'));_0xac5ee2['on'](_0xb45b('0x9'),function(_0x1f9725){for(var _0x37aa3f in _0x1f9725){_0x431dea[_0x37aa3f]=_0x1f9725[_0x37aa3f];}_0x431dea['emit'](_0xb45b('0xa'));});_0xac5ee2['on']('line',function(_0x3783f2){if(_0x3783f2[_0xb45b('0xb')]()==_0xb45b('0xc')){_0x431dea['emit']('hangup');return;}if(_0x3783f2[_0xb45b('0xd')](0x0,0xb)==_0xb45b('0xe')){_0x145e7a=!![];}if(_0x145e7a){_0x2802b0['rx']+=_0x3783f2+'\x0a';if(_0x3783f2[_0xb45b('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x145e7a=![];}}else{_0x2802b0['rx']=_0x3783f2;}if(_0x145e7a){return;}if(typeof _0x2802b0['cb']==_0xb45b('0x10')){var _0x1c12bb=_0x2802b0['rx']['substring'](0x0,0x3),_0x3d3e78=null,_0x25014b=null;_0x1c12bb=parseInt(_0x1c12bb);if(isNaN(_0x1c12bb)){_0x2802b0['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x1c12bb!=0xc8){_0x2802b0['cb'](null,{'code':_0x1c12bb,'result':-0x1,'extra':'KO'});return;}_0x3d3e78=_0x2802b0['rx'][_0xb45b('0xd')](0x4)[_0xb45b('0x11')](_0xb45b('0x12'),'');if(_0x3d3e78[_0xb45b('0x13')]('\x20')!=-0x1){_0x3d3e78=_0x3d3e78['substr'](0x0,_0x3d3e78['indexOf']('\x20'));}if(_[_0xb45b('0x14')](_0x3d3e78,'-1')){_0x3d3e78=parseInt(_0x3d3e78);}_0x25014b=_0x2802b0['rx'][_0xb45b('0x15')]('\x20');if(_0x25014b[_0xb45b('0x16')]==0x3){_0x25014b=_0x25014b[0x2][_0xb45b('0xd')](0x1,_0x25014b[0x2][_0xb45b('0x16')]-0x1);}else if(_0x25014b[_0xb45b('0x16')]>0x3){var _0x3c1cc3=/\((.+)\)/;var _0x6fc346=_0x2802b0['rx'][_0xb45b('0x17')](_0x3c1cc3);if(_0x6fc346){_0x25014b=_0x6fc346[0x1];}else{_0x25014b=null;}}else{_0x25014b=null;}_0x2802b0['cb'](null,{'code':_0x1c12bb,'result':_0x3d3e78,'extra':_0x25014b});}});_0x186c9d['on'](_0xb45b('0x18'),function(_0x22faa6){_0x431dea[_0xb45b('0x19')](_0xb45b('0x18'),new AGIError(_0xb45b('0x1a'),_0x22faa6[_0xb45b('0x1b')]));});_0x186c9d['on'](_0xb45b('0x1c'),function(){_0x431dea[_0xb45b('0x19')](_0xb45b('0x1c'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x186c9d['on'](_0xb45b('0x1d'),function(){_0x431dea[_0xb45b('0x19')](_0xb45b('0x1d'),new AGIError(_0xb45b('0x1e')));_0x186c9d[_0xb45b('0x1f')]();});_0x186c9d[_0xb45b('0x20')](_0xac5ee2);this['command']=function(_0x8ae730,_0x4f7f94){var _0x8ae730=_0x8ae730||'',_0x4f7f94=typeof _0x4f7f94==_0xb45b('0x10')?_0x4f7f94:new Function();_0x2802b0={'tx':_0x8ae730,'rx':'','cb':_0x4f7f94};_0x186c9d['write'](_0x8ae730+'\x0a');},this['close']=function(){_0x186c9d[_0xb45b('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xb45b('0x21')][_0xb45b('0x22')]=function(_0x16a26b){return this[_0xb45b('0x23')]['sync'](this,_0x16a26b);};AGIChannel[_0xb45b('0x21')]['answer']=function(){return this[_0xb45b('0x22')](_0xb45b('0x24'));};AGIChannel[_0xb45b('0x21')][_0xb45b('0x25')]=function(_0x336b06,_0x2516c8,_0x11c27f){_0x336b06=_0x336b06===undefined?'beep':_0x336b06;_0x2516c8=_0x2516c8===undefined?'5':_0x2516c8;_0x11c27f=_0x11c27f===undefined?'1':_0x11c27f;return this[_0xb45b('0x22')](util[_0xb45b('0x26')](_0xb45b('0x27'),_0x336b06,_0x2516c8*0x3e8,_0x11c27f));};AGIChannel[_0xb45b('0x21')][_0xb45b('0x28')]=function(_0x10d94f){_0x10d94f=_0x10d94f||_0xb45b('0x29');return this[_0xb45b('0x22')](util['format']('VERBOSE\x20\x22%s\x22',_0x10d94f));};AGIChannel[_0xb45b('0x21')]['exec']=function(_0x2e566b,_0x57e26f){if(_[_0xb45b('0x2a')](_0x57e26f)){return this[_0xb45b('0x22')](util['format'](_0xb45b('0x2b'),_0x2e566b,_0x57e26f['join'](',')));}return this[_0xb45b('0x22')](util['format'](_0xb45b('0x2b'),_0x2e566b,_0x57e26f));};AGIChannel[_0xb45b('0x21')]['setContext']=function(_0x95f564){return this['sendRequest'](util[_0xb45b('0x26')]('SET\x20CONTEXT\x20%s',_0x95f564));};AGIChannel[_0xb45b('0x21')][_0xb45b('0x2c')]=function(_0x4bed97){return this['sendRequest'](util[_0xb45b('0x26')](_0xb45b('0x2d'),_0x4bed97));};AGIChannel[_0xb45b('0x21')][_0xb45b('0x2e')]=function(_0x32dd60){return this[_0xb45b('0x22')](util[_0xb45b('0x26')]('SET\x20PRIORITY\x20%s',_0x32dd60));};AGIChannel[_0xb45b('0x21')][_0xb45b('0xc')]=function(){return this[_0xb45b('0x22')](_0xb45b('0x2f'));};AGIChannel[_0xb45b('0x21')]['setVariable']=function(_0x255a02,_0x1aaab1){var _0x55916f=_[_0xb45b('0x30')](_0x1aaab1)||_[_0xb45b('0x31')](_0x1aaab1)?_0x1aaab1[_0xb45b('0x32')]():_0x1aaab1;return this['sendRequest'](util['format'](_0xb45b('0x33'),_0x255a02,_0x55916f?_0x55916f[_0xb45b('0x32')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb45b('0x21')]['sayNumber']=function(_0x217197,_0x4455f3){return this[_0xb45b('0x22')](util[_0xb45b('0x26')](_0xb45b('0x34'),_0x217197,_0x4455f3));};AGIChannel[_0xb45b('0x21')][_0xb45b('0x35')]=function(_0x5f3492,_0x194309){return this[_0xb45b('0x22')](util[_0xb45b('0x26')](_0xb45b('0x36'),_0x5f3492,_0x194309));};AGIChannel['prototype'][_0xb45b('0x37')]=function(_0x1f1f78,_0xef061e){return this[_0xb45b('0x22')](util[_0xb45b('0x26')](_0xb45b('0x38'),_0x1f1f78,_0xef061e));};AGIChannel[_0xb45b('0x21')][_0xb45b('0x39')]=function(_0x17cdf5,_0x3fbae1,_0x37293b){_0x3fbae1=_0x3fbae1||this[_0xb45b('0x3a')];_0x37293b=_0x37293b||0x1;this['setContext'](_0x17cdf5);this['setExtension'](_0x3fbae1);this[_0xb45b('0x2e')](_0x37293b);return this[_0xb45b('0x28')](util[_0xb45b('0x26')](_0xb45b('0x3b'),_0x17cdf5,_0x3fbae1,_0x37293b));};AGIChannel['prototype'][_0xb45b('0x3c')]=function(_0x3041ac){return this['sendRequest'](util[_0xb45b('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3041ac));};AGIChannel[_0xb45b('0x21')][_0xb45b('0x3d')]=function(_0x297826,_0x1cdc00,_0x41c367,_0x5cd2e9,_0x3a5a10,_0x213d99){_0x1cdc00=_0x1cdc00||_0xb45b('0x3e');_0x41c367=_0x41c367||'';_0x5cd2e9=_0x5cd2e9===undefined?-0x1:_0x5cd2e9==='-1'?-0x1:_0x5cd2e9*0x3e8;_0x3a5a10=_0x3a5a10===undefined?'':'s='+_0x3a5a10;_0x213d99=_0x213d99?_0xb45b('0x3f'):'';return this[_0xb45b('0x22')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x297826,_0x1cdc00,_0x41c367,_0x5cd2e9,_0x213d99,_0x3a5a10));};AGIChannel[_0xb45b('0x21')][_0xb45b('0x40')]=function(_0x4d820a,_0x26ef49){_0x26ef49=_0x26ef49||'';return this[_0xb45b('0x22')](util['format'](_0xb45b('0x41'),_0x4d820a,_0x26ef49));};AGIChannel['prototype'][_0xb45b('0x42')]=function(_0x1f15bd){return this['exec'](_0xb45b('0x43'),_0x1f15bd);};AGIChannel['prototype'][_0xb45b('0x44')]=function(_0x18f329){return this['exec'](_0xb45b('0x45'),_0x18f329);};AGIChannel[_0xb45b('0x21')]['error']=function(_0x5519e4,_0x3ff60b){this[_0xb45b('0x28')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x5519e4['id'],_0x5519e4['label'],_0x3ff60b));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb45b('0x46')]=AGIChannel;
\ No newline at end of file
+var _0x3b64=['line','toLowerCase','hangup','520\x20End\x20of\x20proper','substring','no\x20code','replace','indexOf','substr','startsWith','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','command','write','destroy','inherits','prototype','sendRequest','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','noop','GOTO\x20%s\x20%s\x20%s','getVariable','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','emit'];(function(_0x1e712f,_0x259d49){var _0x5a4aae=function(_0x14a38c){while(--_0x14a38c){_0x1e712f['push'](_0x1e712f['shift']());}};_0x5a4aae(++_0x259d49);}(_0x3b64,0x1bd));var _0x43b6=function(_0x5a6378,_0x5b9647){_0x5a6378=_0x5a6378-0x0;var _0x4dae67=_0x3b64[_0x5a6378];return _0x4dae67;};'use strict';var util=require(_0x43b6('0x0'));var _=require(_0x43b6('0x1'));var EventEmitter=require(_0x43b6('0x2'))[_0x43b6('0x3')];var AGIReply=require(_0x43b6('0x4'));var AGIError=require(_0x43b6('0x5'));function AGIChannel(_0x2321e5){var _0x5def73=this,_0x35953b=new AGIReply(),_0x5bc35d=![],_0xd9c446={};EventEmitter[_0x43b6('0x6')](_0x5def73);_0x2321e5[_0x43b6('0x7')]('utf8');_0x2321e5[_0x43b6('0x8')](0x8*0x3c*0x3c*0x3e8);_0x35953b['setEncoding'](_0x43b6('0x9'));_0x35953b['on']('headers',function(_0x2f2bc9){for(var _0x26455f in _0x2f2bc9){_0x5def73[_0x26455f]=_0x2f2bc9[_0x26455f];}_0x5def73[_0x43b6('0xa')]('ready');});_0x35953b['on'](_0x43b6('0xb'),function(_0x2b944a){if(_0x2b944a[_0x43b6('0xc')]()==_0x43b6('0xd')){_0x5def73['emit'](_0x43b6('0xd'));return;}if(_0x2b944a['substring'](0x0,0xb)=='520-Invalid'){_0x5bc35d=!![];}if(_0x5bc35d){_0xd9c446['rx']+=_0x2b944a+'\x0a';if(_0x2b944a['search'](_0x43b6('0xe'))!=-0x1){_0x5bc35d=![];}}else{_0xd9c446['rx']=_0x2b944a;}if(_0x5bc35d){return;}if(typeof _0xd9c446['cb']=='function'){var _0x4e457c=_0xd9c446['rx'][_0x43b6('0xf')](0x0,0x3),_0x2e07bb=null,_0x40f627=null;_0x4e457c=parseInt(_0x4e457c);if(isNaN(_0x4e457c)){_0xd9c446['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x43b6('0x10')});return;}if(_0x4e457c!=0xc8){_0xd9c446['cb'](null,{'code':_0x4e457c,'result':-0x1,'extra':'KO'});return;}_0x2e07bb=_0xd9c446['rx']['substring'](0x4)[_0x43b6('0x11')]('result=','');if(_0x2e07bb[_0x43b6('0x12')]('\x20')!=-0x1){_0x2e07bb=_0x2e07bb[_0x43b6('0x13')](0x0,_0x2e07bb[_0x43b6('0x12')]('\x20'));}if(_[_0x43b6('0x14')](_0x2e07bb,'-1')){_0x2e07bb=parseInt(_0x2e07bb);}_0x40f627=_0xd9c446['rx']['split']('\x20');if(_0x40f627['length']==0x3){_0x40f627=_0x40f627[0x2][_0x43b6('0xf')](0x1,_0x40f627[0x2][_0x43b6('0x15')]-0x1);}else if(_0x40f627[_0x43b6('0x15')]>0x3){var _0x5ba8c5=/\((.+)\)/;var _0xcb3942=_0xd9c446['rx']['match'](_0x5ba8c5);if(_0xcb3942){_0x40f627=_0xcb3942[0x1];}else{_0x40f627=null;}}else{_0x40f627=null;}_0xd9c446['cb'](null,{'code':_0x4e457c,'result':_0x2e07bb,'extra':_0x40f627});}});_0x2321e5['on']('error',function(_0x35ccc7){_0x5def73['emit'](_0x43b6('0x16'),new AGIError(_0x43b6('0x17'),_0x35ccc7[_0x43b6('0x18')]));});_0x2321e5['on'](_0x43b6('0x19'),function(){_0x5def73[_0x43b6('0xa')](_0x43b6('0x19'),new AGIError(_0x43b6('0x1a')));});_0x2321e5['on']('timeout',function(){_0x5def73[_0x43b6('0xa')]('timeout',new AGIError(_0x43b6('0x1b')));_0x2321e5['destroy']();});_0x2321e5['pipe'](_0x35953b);this[_0x43b6('0x1c')]=function(_0x528ec0,_0x3de32e){var _0x528ec0=_0x528ec0||'',_0x3de32e=typeof _0x3de32e=='function'?_0x3de32e:new Function();_0xd9c446={'tx':_0x528ec0,'rx':'','cb':_0x3de32e};_0x2321e5[_0x43b6('0x1d')](_0x528ec0+'\x0a');},this[_0x43b6('0x19')]=function(){_0x2321e5[_0x43b6('0x1e')]();};}util[_0x43b6('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x43b6('0x20')][_0x43b6('0x21')]=function(_0xe02e38){return this[_0x43b6('0x1c')]['sync'](this,_0xe02e38);};AGIChannel[_0x43b6('0x20')][_0x43b6('0x22')]=function(){return this[_0x43b6('0x21')](_0x43b6('0x23'));};AGIChannel[_0x43b6('0x20')][_0x43b6('0x24')]=function(_0x1dbf3e,_0x4a79b1,_0x5f2e33){_0x1dbf3e=_0x1dbf3e===undefined?_0x43b6('0x25'):_0x1dbf3e;_0x4a79b1=_0x4a79b1===undefined?'5':_0x4a79b1;_0x5f2e33=_0x5f2e33===undefined?'1':_0x5f2e33;return this[_0x43b6('0x21')](util[_0x43b6('0x26')](_0x43b6('0x27'),_0x1dbf3e,_0x4a79b1*0x3e8,_0x5f2e33));};AGIChannel['prototype']['noop']=function(_0x25fc38){_0x25fc38=_0x25fc38||_0x43b6('0x28');return this[_0x43b6('0x21')](util[_0x43b6('0x26')](_0x43b6('0x29'),_0x25fc38));};AGIChannel[_0x43b6('0x20')][_0x43b6('0x2a')]=function(_0x32bd57,_0x424cd9){if(_[_0x43b6('0x2b')](_0x424cd9)){return this[_0x43b6('0x21')](util[_0x43b6('0x26')](_0x43b6('0x2c'),_0x32bd57,_0x424cd9[_0x43b6('0x2d')](',')));}return this[_0x43b6('0x21')](util[_0x43b6('0x26')](_0x43b6('0x2c'),_0x32bd57,_0x424cd9));};AGIChannel[_0x43b6('0x20')]['setContext']=function(_0x247572){return this[_0x43b6('0x21')](util[_0x43b6('0x26')](_0x43b6('0x2e'),_0x247572));};AGIChannel[_0x43b6('0x20')][_0x43b6('0x2f')]=function(_0x47fff9){return this[_0x43b6('0x21')](util[_0x43b6('0x26')]('SET\x20EXTENSION\x20%s',_0x47fff9));};AGIChannel['prototype'][_0x43b6('0x30')]=function(_0x4f73e4){return this[_0x43b6('0x21')](util[_0x43b6('0x26')](_0x43b6('0x31'),_0x4f73e4));};AGIChannel['prototype'][_0x43b6('0xd')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x43b6('0x20')][_0x43b6('0x32')]=function(_0x10faba,_0x168b3f){var _0x5ad152=_[_0x43b6('0x33')](_0x168b3f)||_[_0x43b6('0x34')](_0x168b3f)?_0x168b3f[_0x43b6('0x35')]():_0x168b3f;return this['sendRequest'](util[_0x43b6('0x26')](_0x43b6('0x36'),_0x10faba,_0x5ad152?_0x5ad152['toString']()[_0x43b6('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x43b6('0x37')]=function(_0x5bdf13,_0x19ca4d){return this['sendRequest'](util[_0x43b6('0x26')](_0x43b6('0x38'),_0x5bdf13,_0x19ca4d));};AGIChannel['prototype']['sayDigits']=function(_0x194f85,_0x870868){return this[_0x43b6('0x21')](util['format'](_0x43b6('0x39'),_0x194f85,_0x870868));};AGIChannel[_0x43b6('0x20')]['sayPhonetic']=function(_0x4e09eb,_0x362ce3){return this[_0x43b6('0x21')](util[_0x43b6('0x26')](_0x43b6('0x3a'),_0x4e09eb,_0x362ce3));};AGIChannel[_0x43b6('0x20')][_0x43b6('0x3b')]=function(_0x47f3f2,_0xc46eba,_0xbfa4d){_0xc46eba=_0xc46eba||this[_0x43b6('0x3c')];_0xbfa4d=_0xbfa4d||0x1;this[_0x43b6('0x3d')](_0x47f3f2);this['setExtension'](_0xc46eba);this['setPriority'](_0xbfa4d);return this[_0x43b6('0x3e')](util[_0x43b6('0x26')](_0x43b6('0x3f'),_0x47f3f2,_0xc46eba,_0xbfa4d));};AGIChannel[_0x43b6('0x20')][_0x43b6('0x40')]=function(_0x25af38){return this[_0x43b6('0x21')](util[_0x43b6('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x25af38));};AGIChannel[_0x43b6('0x20')]['recordFile']=function(_0x4b8718,_0x1fd60b,_0x25454a,_0x38a539,_0x6043ee,_0x365878){_0x1fd60b=_0x1fd60b||_0x43b6('0x41');_0x25454a=_0x25454a||'';_0x38a539=_0x38a539===undefined?-0x1:_0x38a539==='-1'?-0x1:_0x38a539*0x3e8;_0x6043ee=_0x6043ee===undefined?'':'s='+_0x6043ee;_0x365878=_0x365878?_0x43b6('0x42'):'';return this[_0x43b6('0x21')](util['format'](_0x43b6('0x43'),_0x4b8718,_0x1fd60b,_0x25454a,_0x38a539,_0x365878,_0x6043ee));};AGIChannel[_0x43b6('0x20')][_0x43b6('0x44')]=function(_0x4de081,_0x783607){_0x783607=_0x783607||'';return this[_0x43b6('0x21')](util['format'](_0x43b6('0x45'),_0x4de081,_0x783607));};AGIChannel[_0x43b6('0x20')][_0x43b6('0x46')]=function(_0x5c6915){return this[_0x43b6('0x2a')](_0x43b6('0x47'),_0x5c6915);};AGIChannel[_0x43b6('0x20')][_0x43b6('0x48')]=function(_0x2e43eb){return this[_0x43b6('0x2a')]('WAIT',_0x2e43eb);};AGIChannel[_0x43b6('0x20')]['error']=function(_0x11ab0d,_0x5e2411){this[_0x43b6('0x3e')](util[_0x43b6('0x26')](_0x43b6('0x49'),_0x11ab0d['id'],_0x11ab0d[_0x43b6('0x4a')],_0x5e2411));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x43b6('0x4b')]=AGIChannel;
\ No newline at end of file
index 9b45db9..03de559 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4a7=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','exports','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xc4a7,0x169));var _0x7c4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4a7[_0x3ab51d];return _0x29a04e;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x7c4a('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x7c4a('0x1'),'E_AGI_SERVER_CLOSE':_0x7c4a('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x7c4a('0x3'),'E_AGI_SOCKET_CLOSE':_0x7c4a('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x7c4a('0x5'),'E_AGI_COMMAND_EMPTY':_0x7c4a('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x7c4a('0x7')};function AGIError(_0x2632b7){var _0x2632b7=_0x2632b7||null,_0x1bfbaf=_0x1bfbaf||[],_0x35b495=0x1,_0x5071a7='';if(!error[_0x2632b7]){_0x2632b7=_0x7c4a('0x8');}_0x1bfbaf[_0x7c4a('0x9')](error[_0x2632b7]);while(arguments[_0x35b495]){_0x1bfbaf[_0x7c4a('0x9')](arguments[_0x35b495]);_0x35b495++;}_0x5071a7=util[_0x7c4a('0xa')]['apply'](util,_0x1bfbaf);this[_0x7c4a('0xb')]=_0x5071a7;this[_0x7c4a('0xc')]=_0x2632b7;}module[_0x7c4a('0xd')]=AGIError;
\ No newline at end of file
+var _0xa1c7=['push','format','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xa1c7,0x1c9));var _0x7a1c=function(_0x554037,_0x28d28d){_0x554037=_0x554037-0x0;var _0x17ee86=_0xa1c7[_0x554037];return _0x17ee86;};'use strict';var util=require(_0x7a1c('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x7a1c('0x1'),'E_AGI_SERVER_ERROR':_0x7a1c('0x2'),'E_AGI_SERVER_CLOSE':_0x7a1c('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x7a1c('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x7a1c('0x5'),'E_AGI_SOCKET_CLOSE':_0x7a1c('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x7a1c('0x7'),'E_AGI_COMMAND_EMPTY':_0x7a1c('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x7a1c('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x16b8e1){var _0x16b8e1=_0x16b8e1||null,_0x1109aa=_0x1109aa||[],_0x29a9c0=0x1,_0x3415c6='';if(!error[_0x16b8e1]){_0x16b8e1=_0x7a1c('0xa');}_0x1109aa[_0x7a1c('0xb')](error[_0x16b8e1]);while(arguments[_0x29a9c0]){_0x1109aa[_0x7a1c('0xb')](arguments[_0x29a9c0]);_0x29a9c0++;}_0x3415c6=util[_0x7a1c('0xc')]['apply'](util,_0x1109aa);this['message']=_0x3415c6;this['name']=_0x16b8e1;}module['exports']=AGIError;
\ No newline at end of file
index 6f4bbda..5a324c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf031=['no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','agicommand','default','target','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','vertices','getVertex','traverseBFS','info'];(function(_0x789db4,_0x1c2eeb){var _0x5acd8a=function(_0x9a682e){while(--_0x9a682e){_0x789db4['push'](_0x789db4['shift']());}};_0x5acd8a(++_0x1c2eeb);}(_0xf031,0xaa));var _0x1f03=function(_0x2cc72a,_0x41ef4c){_0x2cc72a=_0x2cc72a-0x0;var _0x451d44=_0xf031[_0x2cc72a];return _0x451d44;};'use strict';var _=require(_0x1f03('0x0'));var logger=require(_0x1f03('0x1'))(_0x1f03('0x2'));var verticesWithRetry=[_0x1f03('0x3'),'getdigits',_0x1f03('0x4')];var Graph=function(){this['vertices']={};this[_0x1f03('0x5')]={};this[_0x1f03('0x6')]=0x0;};Graph[_0x1f03('0x7')][_0x1f03('0x8')]=function(_0x3c6e4f){this['vertices'][_0x3c6e4f['id']]=_0x3c6e4f;this[_0x1f03('0x5')][_0x3c6e4f['id']]=[];};Graph[_0x1f03('0x7')][_0x1f03('0x9')]=function(_0x43cd14,_0x5112a7,_0x5ee7dd){this[_0x1f03('0x5')][_0x43cd14][_0x1f03('0xa')]({'target':_0x5112a7,'condition':_0x5ee7dd});this[_0x1f03('0x6')]+=0x1;};Graph[_0x1f03('0x7')][_0x1f03('0xb')]=function(){return _['size'](this[_0x1f03('0xc')]);};Graph[_0x1f03('0x7')]['relations']=function(){return this[_0x1f03('0x6')];};Graph[_0x1f03('0x7')][_0x1f03('0xd')]=function(_0xc0f560){return this['vertices'][_0xc0f560];};Graph[_0x1f03('0x7')][_0x1f03('0xe')]=function(_0x51c357,_0x1c3ac0){if(!this[_0x1f03('0xc')][_0x51c357]){return logger[_0x1f03('0xf')](_0x1f03('0x10'));}var _0x212f05=_0x1c3ac0(this[_0x1f03('0xc')][_0x51c357]);if(!_0x212f05){return logger[_0x1f03('0xf')](_0x1f03('0x11'));}if(this[_0x1f03('0x5')][_0x51c357]['length']===0x0){return logger['info'](_0x1f03('0x12'));}for(var _0x36f839=0x0,_0x19574a=[],_0x3a564d=![];_0x36f839<this['edges'][_0x51c357][_0x1f03('0x13')];_0x36f839+=0x1){if(this[_0x1f03('0x5')][_0x51c357][_0x36f839][_0x1f03('0x14')]){_0x19574a=this[_0x1f03('0x5')][_0x51c357][_0x36f839][_0x1f03('0x14')][_0x1f03('0x15')](',');for(var _0x41fc3b=0x0;_0x41fc3b<_0x19574a['length'];_0x41fc3b+=0x1){if(this[_0x1f03('0xc')][_0x51c357][_0x1f03('0x16')]==='vswitch'&&_0x19574a[_0x41fc3b]==='-'){_0x3a564d=this[_0x1f03('0x5')][_0x51c357][_0x36f839]['target'];logger[_0x1f03('0xf')](_0x1f03('0x17'),_0x19574a[_0x41fc3b],this[_0x1f03('0x5')][_0x51c357][_0x36f839]['target']);}else if(this[_0x1f03('0xc')][_0x51c357]['agicommand']==='menu'&&_0x19574a[_0x41fc3b]==='i'){_0x3a564d=this[_0x1f03('0x5')][_0x51c357][_0x36f839][_0x1f03('0x18')];logger['info'](_0x1f03('0x19'),_0x19574a[_0x41fc3b],this['edges'][_0x51c357][_0x36f839][_0x1f03('0x18')]);}if(_0x19574a[_0x41fc3b]===_0x212f05){return this[_0x1f03('0xe')](this['edges'][_0x51c357][_0x36f839]['target'],_0x1c3ac0);}}}else{return this[_0x1f03('0xe')](this[_0x1f03('0x5')][_0x51c357][_0x36f839][_0x1f03('0x18')],_0x1c3ac0);}}if(_0x19574a['length']){if(this[_0x1f03('0xc')][_0x51c357][_0x1f03('0x16')]==='vswitch'){if(_0x3a564d){return this[_0x1f03('0xe')](_0x3a564d,_0x1c3ac0);}return logger[_0x1f03('0xf')](_0x1f03('0x1a'));}else if(_[_0x1f03('0x1b')](verticesWithRetry,this[_0x1f03('0xc')][_0x51c357][_0x1f03('0x16')])){if(_0x212f05==='-'){return logger[_0x1f03('0xf')](_0x1f03('0x1c'));}if(_0x3a564d&&_0x212f05!=='t'){return this[_0x1f03('0xe')](_0x3a564d,_0x1c3ac0);}return this[_0x1f03('0xe')](_0x51c357,_0x1c3ac0);}return logger[_0x1f03('0xf')](_0x1f03('0x1d'));}};module[_0x1f03('0x1e')]=Graph;
\ No newline at end of file
+var _0x734b=['addVertex','vertices','prototype','addEdge','push','size','relations','traverseBFS','info','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','lodash','../../../config/logger','edges','numberOfEdges'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0x734b,0x1dc));var _0xb734=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x734b[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require(_0xb734('0x0'));var logger=require(_0xb734('0x1'))('agi');var verticesWithRetry=['menu','getdigits','getsecretdigits'];var Graph=function(){this['vertices']={};this[_0xb734('0x2')]={};this[_0xb734('0x3')]=0x0;};Graph['prototype'][_0xb734('0x4')]=function(_0x37f74a){this[_0xb734('0x5')][_0x37f74a['id']]=_0x37f74a;this['edges'][_0x37f74a['id']]=[];};Graph[_0xb734('0x6')][_0xb734('0x7')]=function(_0xc55952,_0x5fe6a2,_0x3da7b3){this[_0xb734('0x2')][_0xc55952][_0xb734('0x8')]({'target':_0x5fe6a2,'condition':_0x3da7b3});this[_0xb734('0x3')]+=0x1;};Graph[_0xb734('0x6')][_0xb734('0x9')]=function(){return _[_0xb734('0x9')](this[_0xb734('0x5')]);};Graph[_0xb734('0x6')][_0xb734('0xa')]=function(){return this['numberOfEdges'];};Graph['prototype']['getVertex']=function(_0x4e2420){return this[_0xb734('0x5')][_0x4e2420];};Graph[_0xb734('0x6')][_0xb734('0xb')]=function(_0x1dcdb0,_0x544bed){if(!this[_0xb734('0x5')][_0x1dcdb0]){return logger['info']('no\x20vertex\x20found');}var _0x1b2df1=_0x544bed(this[_0xb734('0x5')][_0x1dcdb0]);if(!_0x1b2df1){return logger[_0xb734('0xc')]('stop\x20traverse');}if(this[_0xb734('0x2')][_0x1dcdb0][_0xb734('0xd')]===0x0){return logger[_0xb734('0xc')](_0xb734('0xe'));}for(var _0x3f1cdb=0x0,_0x4f5d3d=[],_0x1a612d=![];_0x3f1cdb<this[_0xb734('0x2')][_0x1dcdb0]['length'];_0x3f1cdb+=0x1){if(this[_0xb734('0x2')][_0x1dcdb0][_0x3f1cdb][_0xb734('0xf')]){_0x4f5d3d=this[_0xb734('0x2')][_0x1dcdb0][_0x3f1cdb][_0xb734('0xf')][_0xb734('0x10')](',');for(var _0x58f436=0x0;_0x58f436<_0x4f5d3d[_0xb734('0xd')];_0x58f436+=0x1){if(this[_0xb734('0x5')][_0x1dcdb0][_0xb734('0x11')]===_0xb734('0x12')&&_0x4f5d3d[_0x58f436]==='-'){_0x1a612d=this['edges'][_0x1dcdb0][_0x3f1cdb][_0xb734('0x13')];logger['info'](_0xb734('0x14'),_0x4f5d3d[_0x58f436],this['edges'][_0x1dcdb0][_0x3f1cdb]['target']);}else if(this['vertices'][_0x1dcdb0][_0xb734('0x11')]==='menu'&&_0x4f5d3d[_0x58f436]==='i'){_0x1a612d=this[_0xb734('0x2')][_0x1dcdb0][_0x3f1cdb][_0xb734('0x13')];logger[_0xb734('0xc')]('invalid',_0x4f5d3d[_0x58f436],this[_0xb734('0x2')][_0x1dcdb0][_0x3f1cdb][_0xb734('0x13')]);}if(_0x4f5d3d[_0x58f436]===_0x1b2df1){return this['traverseBFS'](this['edges'][_0x1dcdb0][_0x3f1cdb]['target'],_0x544bed);}}}else{return this[_0xb734('0xb')](this[_0xb734('0x2')][_0x1dcdb0][_0x3f1cdb][_0xb734('0x13')],_0x544bed);}}if(_0x4f5d3d['length']){if(this[_0xb734('0x5')][_0x1dcdb0][_0xb734('0x11')]===_0xb734('0x12')){if(_0x1a612d){return this[_0xb734('0xb')](_0x1a612d,_0x544bed);}return logger['info'](_0xb734('0x15'));}else if(_[_0xb734('0x16')](verticesWithRetry,this['vertices'][_0x1dcdb0]['agicommand'])){if(_0x1b2df1==='-'){return logger[_0xb734('0xc')](_0xb734('0x17'));}if(_0x1a612d&&_0x1b2df1!=='t'){return this['traverseBFS'](_0x1a612d,_0x544bed);}return this[_0xb734('0xb')](_0x1dcdb0,_0x544bed);}return logger[_0xb734('0xc')]('condition\x20not\x20found');}};module['exports']=Graph;
\ No newline at end of file
index 59db159..8bd0af4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f17=['hangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]','./server','listening','connection','syncho','util','moment','../../config/environment','../../config/license/util','./mailRpc','./graph','./vertices','agi','defaults','127.0.0.1','nextTick','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','message','error','[%s]\x20%s','name','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','root','agicommand','hasOwnProperty','retry','omit','mxCell','isArray','length','source','target','addEdge','createSquareReport','indexOf','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x51f40d,_0x3bde13){var _0x3f2243=function(_0x489011){while(--_0x489011){_0x51f40d['push'](_0x51f40d['shift']());}};_0x3f2243(++_0x3bde13);}(_0x2f17,0x133));var _0x72f1=function(_0x464abc,_0x154a21){_0x464abc=_0x464abc-0x0;var _0x5de27c=_0x2f17[_0x464abc];return _0x5de27c;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x72f1('0x0'));var util=require(_0x72f1('0x1'));var moment=require(_0x72f1('0x2'));var config=require(_0x72f1('0x3'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0x72f1('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x72f1('0x5'));var Graph=require(_0x72f1('0x6'));var Vertices=require(_0x72f1('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x72f1('0x8')]=_[_0x72f1('0x9')](config['agi'],{'ip':_0x72f1('0xa'),'port':0x11dd});function connectionHandler(_0x18ef17){process[_0x72f1('0xb')](function(){syncho(function(){try{setChannelVariables(_0x18ef17);agiHandler(_0x18ef17);}catch(_0x4d809c){logger['error'](_0x4d809c[_0x72f1('0xc')]);}});});}function listeningHandler(){console['log'](_0x72f1('0xd'),config[_0x72f1('0x8')][_0x72f1('0xe')]);logger['info'](util[_0x72f1('0xf')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x72f1('0x8')][_0x72f1('0xe')]));}function errorHandler(_0x318085){if(_0x318085&&_0x318085['name']&&_0x318085[_0x72f1('0x10')]){logger[_0x72f1('0x11')](util[_0x72f1('0xf')](_0x72f1('0x12'),_0x318085[_0x72f1('0x13')],_0x318085[_0x72f1('0x10')]));}else{logger[_0x72f1('0x11')](util[_0x72f1('0xf')](_0x72f1('0x14'),_0x318085[_0x72f1('0xc')]));}}function closeHandler(){logger[_0x72f1('0x15')](util[_0x72f1('0xf')](_0x72f1('0x16'),this[_0x72f1('0x17')],this[_0x72f1('0x18')],this[_0x72f1('0x19')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x50fec){logger[_0x72f1('0x11')](_0x50fec[_0x72f1('0xc')]);}}function timeoutHandler(){logger['info'](util[_0x72f1('0xf')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x72f1('0x17')],this[_0x72f1('0x18')],this[_0x72f1('0x19')],this[_0x72f1('0x1a')],this[_0x72f1('0x1b')]));}function hangupHandler(){logger[_0x72f1('0x15')](util[_0x72f1('0xf')](_0x72f1('0x1c'),this[_0x72f1('0x17')],this[_0x72f1('0x18')],this[_0x72f1('0x19')],this[_0x72f1('0x1a')],this[_0x72f1('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x5e57b6){return parser[_0x72f1('0x1d')](_0x5e57b6,{'object':!![]})['mxGraphModel'][_0x72f1('0x1e')];}function addVertex(_0x316e25,_0x3402fe,_0x3d5e94){_0x3402fe[_0x72f1('0x1f')]=_0x3d5e94;if(_0x3402fe[_0x72f1('0x20')](_0x72f1('0x21'))){_0x3402fe['maxRetry']=parseInt(_0x3402fe[_0x72f1('0x21')],0xa);}_0x316e25['addVertex'](_[_0x72f1('0x22')](_0x3402fe,_0x72f1('0x23')));}function initGraph(_0x5dd28d,_0x34be02){var _0x52de9d=new Graph();for(var _0x1959c4 in _0x5dd28d){if(_0x5dd28d[_0x72f1('0x20')](_0x1959c4)){if(_[_0x72f1('0x24')](_0x5dd28d[_0x1959c4])){for(var _0x155705=0x0;_0x155705<_0x5dd28d[_0x1959c4][_0x72f1('0x25')];_0x155705+=0x1){addVertex(_0x52de9d,_0x5dd28d[_0x1959c4][_0x155705],_0x1959c4);}}else{addVertex(_0x52de9d,_0x5dd28d[_0x1959c4],_0x1959c4);}}}for(var _0x25212e=0x0;_0x25212e<_0x34be02[_0x72f1('0x25')];_0x25212e+=0x1){if(_0x34be02[_0x25212e][_0x72f1('0x26')]&&_0x34be02[_0x25212e][_0x72f1('0x27')]){_0x52de9d[_0x72f1('0x28')](_0x34be02[_0x25212e][_0x72f1('0x26')],_0x34be02[_0x25212e]['target'],_0x34be02[_0x25212e]['value']);}}return _0x52de9d;}function getSquareProject(_0x3b8a58,_0x5e51af){rpc['getSquareProject'](_0x3b8a58)['then'](function(_0x5afe06){_0x5e51af(null,_0x5afe06);})['catch'](function(_0x485b7a){_0x5e51af(null,_0x485b7a);});}function createSquareReport(_0x38b965,_0x1f2fb3){rpc[_0x72f1('0x29')](_0x38b965)['then'](function(_0x2515fd){if(_0x1f2fb3){_0x1f2fb3(null,_0x2515fd);}})['catch'](function(_0x2b9065){if(_0x1f2fb3){_0x1f2fb3(null,_0x2b9065);}});}function setChannelVariables(_0x40f75){for(var _0x2379da in _0x40f75){if(_0x40f75[_0x72f1('0x20')](_0x2379da)){if(_0x2379da[_0x72f1('0x2a')]('agi_')===0x0){_0x40f75[_0x2379da[_0x72f1('0x2b')](0x4)]=_0x40f75[_0x2379da];delete _0x40f75[_0x2379da];}}}}function getLogFromObject(_0x5c55d6){return util[_0x72f1('0x2c')](_0x5c55d6,{'showHidden':![],'depth':null});}function agiHandler(_0x2b7f2b){var _0x2ed76c,_0x224642,_0x3493dd,_0xa49e2f,_0xa923b4;logger[_0x72f1('0x2d')](_0x72f1('0x2e'),JSON[_0x72f1('0x2f')](_0x2b7f2b,null,0x2));logger[_0x72f1('0x15')](util[_0x72f1('0xf')](_0x72f1('0x30'),_0x2b7f2b['arg_1'],_0x2b7f2b[_0x72f1('0x18')],_0x2b7f2b[_0x72f1('0x19')],_0x2b7f2b[_0x72f1('0x1a')],_0x2b7f2b[_0x72f1('0x1b')]));_0x2b7f2b['on'](_0x72f1('0x11'),errorHandler);_0x2b7f2b['on']('close',closeHandler);_0x2b7f2b['on']('timeout',timeoutHandler);_0x2b7f2b['evtHangup']=![];_0x2b7f2b['on'](_0x72f1('0x31'),hangupHandler);var _0x5129f3=getSquareProject[_0x72f1('0x32')](null,_0x2b7f2b[_0x72f1('0x17')]);if(_0x5129f3){if(_0x5129f3[_0x72f1('0x33')]){_0x2ed76c=getRoot(_0x5129f3[_0x72f1('0x33')]);if(_0x2ed76c&&_0x2ed76c[_0x72f1('0x34')]){logger['debug']('root',JSON[_0x72f1('0x2f')](_0x2ed76c,null,0x2));_0x2b7f2b['joinAt']=moment()[_0x72f1('0xf')](_0x72f1('0x35'));_0x224642=initGraph(_['omit'](_0x2ed76c,'mxCell'),_0x2ed76c[_0x72f1('0x23')]);_0x3493dd=new Vertices(_0x2b7f2b,rpc,mailRpc);logger[_0x72f1('0x15')](util[_0x72f1('0xf')](_0x72f1('0x36'),_0x2b7f2b[_0x72f1('0x17')],_0x2b7f2b['calleridname'],_0x2b7f2b['callerid'],_0x2b7f2b[_0x72f1('0x1a')],_0x2b7f2b[_0x72f1('0x1b')]));_0x224642[_0x72f1('0x37')](_0x2ed76c[_0x72f1('0x34')]['id'],function(_0x4b9ab2){try{_0x4b9ab2=_0x3493dd[_0x72f1('0x38')](_0x4b9ab2);logger[_0x72f1('0x2d')](_0x72f1('0x39'),JSON[_0x72f1('0x2f')](_0x4b9ab2,null,0x2));if(_0x4b9ab2[_0x72f1('0x1f')]===_0x72f1('0x3a')){logger[_0x72f1('0x15')](_0x72f1('0x3b'));_0x2b7f2b[_0x72f1('0x3c')]=_0x4b9ab2['context']||_0x2b7f2b[_0x72f1('0x3c')];_0x2b7f2b[_0x72f1('0x3d')]=_0x4b9ab2[_0x72f1('0x3d')];_0x2b7f2b[_0x72f1('0x3e')]=_0x4b9ab2[_0x72f1('0x3e')]?_0x4b9ab2[_0x72f1('0x3e')]-0x1:0x1;return null;}else if(_0x4b9ab2&&_0x3493dd[_0x4b9ab2[_0x72f1('0x1f')]]){_0xa923b4=_0x3493dd[_0x4b9ab2['agicommand']](_0x4b9ab2);logger[_0x72f1('0x15')](_0x72f1('0x3f'),JSON[_0x72f1('0x2f')](_0xa923b4,null,0x2));if(_0xa923b4&&_0xa923b4[_0x72f1('0x40')]===AGI_CODE_SUCCESS&&_0xa923b4[_0x72f1('0x41')]!==AGI_RESULT_ERROR&&!_0x2b7f2b[_0x72f1('0x42')]){logger['debug'](_0x72f1('0x3f'),getLogFromObject(_0xa923b4));return _['isUndefined'](_0xa923b4[_0x72f1('0x41')])?null:_0xa923b4[_0x72f1('0x41')][_0x72f1('0x43')]();}else{logger[_0x72f1('0x11')](_0x72f1('0x3f'),getLogFromObject(_0xa923b4));return null;}}else{logger[_0x72f1('0x11')]('agicommand\x20not\x20found');return null;}}catch(_0x45df98){logger[_0x72f1('0x11')](_0x45df98[_0x72f1('0xc')]);return null;}});if(_0x2ed76c[_0x72f1('0x44')]){logger[_0x72f1('0x15')](util[_0x72f1('0xf')](_0x72f1('0x45'),_0x2b7f2b[_0x72f1('0x17')],_0x2b7f2b[_0x72f1('0x18')],_0x2b7f2b[_0x72f1('0x19')],_0x2b7f2b[_0x72f1('0x1a')],_0x2b7f2b[_0x72f1('0x1b')]));_0x224642[_0x72f1('0x37')](_0x2ed76c[_0x72f1('0x44')]['id'],function(_0x14e657){try{_0x14e657=_0x3493dd[_0x72f1('0x38')](_0x14e657);logger[_0x72f1('0x2d')](_0x72f1('0x39'),JSON[_0x72f1('0x2f')](_0x14e657,null,0x2));if(_0x14e657&&_0x3493dd[_0x14e657['agicommand']]){_0xa923b4=_0x3493dd[_0x14e657[_0x72f1('0x1f')]](_0x14e657);if(_0xa923b4){logger[_0x72f1('0x2d')]('response',getLogFromObject(_0xa923b4));return _[_0x72f1('0x46')](_0xa923b4[_0x72f1('0x41')])?null:_0xa923b4[_0x72f1('0x41')][_0x72f1('0x43')]();}else{logger[_0x72f1('0x11')]('response',getLogFromObject(_0xa923b4));return null;}}else{logger[_0x72f1('0x11')](_0x72f1('0x47'));return null;}}catch(_0xf4543d){logger['error'](_0xf4543d[_0x72f1('0xc')]);return null;}});}logger[_0x72f1('0x15')](util[_0x72f1('0xf')](_0x72f1('0x48'),_0x2b7f2b['arg_1'],_0x2b7f2b[_0x72f1('0x18')],_0x2b7f2b[_0x72f1('0x19')],_0x2b7f2b['dnid'],_0x2b7f2b[_0x72f1('0x1b')]));logger[_0x72f1('0x15')](util[_0x72f1('0xf')](_0x72f1('0x49'),_0x2b7f2b[_0x72f1('0x3c')],_0x2b7f2b['extension'],parseInt(_0x2b7f2b['priority'],0xa)+0x1));_0x2b7f2b[_0x72f1('0x4a')](_0x2b7f2b[_0x72f1('0x3c')],_0x2b7f2b['extension'],parseInt(_0x2b7f2b[_0x72f1('0x3e')],0xa)+0x1);_0x2b7f2b[_0x72f1('0x4b')]();}}else{logger['error'](util['format']('Project\x20%s\x20not\x20published',_0x2b7f2b['arg_1']));_0x2b7f2b[_0x72f1('0x4a')](_0x2b7f2b[_0x72f1('0x3c')],_0x2b7f2b[_0x72f1('0x3d')],parseInt(_0x2b7f2b[_0x72f1('0x3e')],0xa)+0x1);_0x2b7f2b[_0x72f1('0x4b')]();}}else{logger['error'](util['format'](_0x72f1('0x4c'),_0x2b7f2b[_0x72f1('0x17')]));_0x2b7f2b[_0x72f1('0x4a')](_0x2b7f2b['context'],_0x2b7f2b[_0x72f1('0x3d')],parseInt(_0x2b7f2b[_0x72f1('0x3e')],0xa)+0x1);_0x2b7f2b['close']();}}function main(){var _0x3e9e63;return utilLicense[_0x72f1('0x4d')]()[_0x72f1('0x4e')](function(_0x12ddc1){if(_0x12ddc1){if(_0x12ddc1[_0x72f1('0x4f')]){if(_0x12ddc1[_0x72f1('0x50')]&&_0x12ddc1['callysquare']>0x0){logger[_0x72f1('0x15')](util[_0x72f1('0xf')](_0x72f1('0x51'),_0x12ddc1['callysquare']));_0x3e9e63=_0x12ddc1[_0x72f1('0x50')];}else{logger['info'](_0x72f1('0x52'));}}else{logger[_0x72f1('0x15')](_0x72f1('0x53'));_0x3e9e63=-0x1;}}})[_0x72f1('0x54')](function(_0x4f4170){logger['error'](_0x72f1('0x55'),_0x4f4170[_0x72f1('0xc')]);})[_0x72f1('0x44')](function(){var _0x5e6290=require(_0x72f1('0x56'))(config['agi'][_0x72f1('0xe')],config[_0x72f1('0x8')]['ip'],_0x3e9e63);_0x5e6290['on'](_0x72f1('0x11'),errorHandler);_0x5e6290['on'](_0x72f1('0x57'),listeningHandler);_0x5e6290['on'](_0x72f1('0x58'),connectionHandler);_0x5e6290['on'](_0x72f1('0x4b'),closeHandler);});}main();
\ No newline at end of file
+var _0x4fb4=['mxCell','isArray','length','source','target','getSquareProject','catch','then','indexOf','agi_','inspect','stringify','close','timeout','sync','production','debug','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','response','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20found','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','./rpc','./graph','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','toJson','root','agicommand','hasOwnProperty','retry'];(function(_0xbafeaf,_0x2fda25){var _0x12f2e7=function(_0x3da8cb){while(--_0x3da8cb){_0xbafeaf['push'](_0xbafeaf['shift']());}};_0x12f2e7(++_0x2fda25);}(_0x4fb4,0x1ce));var _0x44fb=function(_0x409bd0,_0xa00d02){_0x409bd0=_0x409bd0-0x0;var _0x3bc6e0=_0x4fb4[_0x409bd0];return _0x3bc6e0;};'use strict';var parser=require('xml2json');var _=require(_0x44fb('0x0'));var syncho=require(_0x44fb('0x1'));var util=require(_0x44fb('0x2'));var moment=require(_0x44fb('0x3'));var config=require(_0x44fb('0x4'));var logger=require(_0x44fb('0x5'))(_0x44fb('0x6'));var utilLicense=require('../../config/license/util');var rpc=require(_0x44fb('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0x44fb('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x44fb('0x9')](config[_0x44fb('0x6')],{'ip':_0x44fb('0xa'),'port':0x11dd});function connectionHandler(_0x5e07ad){process[_0x44fb('0xb')](function(){syncho(function(){try{setChannelVariables(_0x5e07ad);agiHandler(_0x5e07ad);}catch(_0x4dc29a){logger[_0x44fb('0xc')](_0x4dc29a[_0x44fb('0xd')]);}});});}function listeningHandler(){console[_0x44fb('0xe')](_0x44fb('0xf'),config[_0x44fb('0x6')][_0x44fb('0x10')]);logger[_0x44fb('0x11')](util[_0x44fb('0x12')](_0x44fb('0x13'),config[_0x44fb('0x6')]['ip'],config[_0x44fb('0x6')]['port']));}function errorHandler(_0xde462e){if(_0xde462e&&_0xde462e[_0x44fb('0x14')]&&_0xde462e[_0x44fb('0x15')]){logger[_0x44fb('0xc')](util[_0x44fb('0x12')](_0x44fb('0x16'),_0xde462e[_0x44fb('0x14')],_0xde462e[_0x44fb('0x15')]));}else{logger[_0x44fb('0xc')](util[_0x44fb('0x12')](_0x44fb('0x17'),_0xde462e['stack']));}}function closeHandler(){logger[_0x44fb('0x11')](util[_0x44fb('0x12')](_0x44fb('0x18'),this[_0x44fb('0x19')],this[_0x44fb('0x1a')],this[_0x44fb('0x1b')],this[_0x44fb('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x5bb766){logger[_0x44fb('0xc')](_0x5bb766[_0x44fb('0xd')]);}}function timeoutHandler(){logger[_0x44fb('0x11')](util[_0x44fb('0x12')](_0x44fb('0x1d'),this[_0x44fb('0x19')],this[_0x44fb('0x1a')],this[_0x44fb('0x1b')],this[_0x44fb('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0x44fb('0x11')](util[_0x44fb('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x44fb('0x19')],this[_0x44fb('0x1a')],this[_0x44fb('0x1b')],this['dnid'],this[_0x44fb('0x1e')]));this['evtHangup']=!![];}function getRoot(_0x27e000){return parser[_0x44fb('0x1f')](_0x27e000,{'object':!![]})['mxGraphModel'][_0x44fb('0x20')];}function addVertex(_0x1c34f5,_0x1a8f09,_0x406497){_0x1a8f09[_0x44fb('0x21')]=_0x406497;if(_0x1a8f09[_0x44fb('0x22')]('retry')){_0x1a8f09['maxRetry']=parseInt(_0x1a8f09[_0x44fb('0x23')],0xa);}_0x1c34f5['addVertex'](_['omit'](_0x1a8f09,_0x44fb('0x24')));}function initGraph(_0x6edb7,_0x11ff5e){var _0x1cfadc=new Graph();for(var _0x1cd636 in _0x6edb7){if(_0x6edb7['hasOwnProperty'](_0x1cd636)){if(_[_0x44fb('0x25')](_0x6edb7[_0x1cd636])){for(var _0x536a8f=0x0;_0x536a8f<_0x6edb7[_0x1cd636][_0x44fb('0x26')];_0x536a8f+=0x1){addVertex(_0x1cfadc,_0x6edb7[_0x1cd636][_0x536a8f],_0x1cd636);}}else{addVertex(_0x1cfadc,_0x6edb7[_0x1cd636],_0x1cd636);}}}for(var _0x25e240=0x0;_0x25e240<_0x11ff5e[_0x44fb('0x26')];_0x25e240+=0x1){if(_0x11ff5e[_0x25e240][_0x44fb('0x27')]&&_0x11ff5e[_0x25e240]['target']){_0x1cfadc['addEdge'](_0x11ff5e[_0x25e240][_0x44fb('0x27')],_0x11ff5e[_0x25e240][_0x44fb('0x28')],_0x11ff5e[_0x25e240]['value']);}}return _0x1cfadc;}function getSquareProject(_0x51cb58,_0x44e6d7){rpc[_0x44fb('0x29')](_0x51cb58)['then'](function(_0xf30135){_0x44e6d7(null,_0xf30135);})[_0x44fb('0x2a')](function(_0x3f160c){_0x44e6d7(null,_0x3f160c);});}function createSquareReport(_0x47c21e,_0x4997a4){rpc['createSquareReport'](_0x47c21e)[_0x44fb('0x2b')](function(_0x5baf45){if(_0x4997a4){_0x4997a4(null,_0x5baf45);}})[_0x44fb('0x2a')](function(_0x4c3033){if(_0x4997a4){_0x4997a4(null,_0x4c3033);}});}function setChannelVariables(_0x41562f){for(var _0x7901a8 in _0x41562f){if(_0x41562f[_0x44fb('0x22')](_0x7901a8)){if(_0x7901a8[_0x44fb('0x2c')](_0x44fb('0x2d'))===0x0){_0x41562f[_0x7901a8['substring'](0x4)]=_0x41562f[_0x7901a8];delete _0x41562f[_0x7901a8];}}}}function getLogFromObject(_0x4cd75b){return util[_0x44fb('0x2e')](_0x4cd75b,{'showHidden':![],'depth':null});}function agiHandler(_0x4d8814){var _0x410386,_0x53bf98,_0xe3b4f4,_0x3a72ba,_0x5ea120;logger['debug']('variables',JSON[_0x44fb('0x2f')](_0x4d8814,null,0x2));logger[_0x44fb('0x11')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4d8814[_0x44fb('0x19')],_0x4d8814['calleridname'],_0x4d8814[_0x44fb('0x1b')],_0x4d8814[_0x44fb('0x1c')],_0x4d8814['uniqueid']));_0x4d8814['on'](_0x44fb('0xc'),errorHandler);_0x4d8814['on'](_0x44fb('0x30'),closeHandler);_0x4d8814['on'](_0x44fb('0x31'),timeoutHandler);_0x4d8814['evtHangup']=![];_0x4d8814['on']('hangup',hangupHandler);var _0x194f22=getSquareProject[_0x44fb('0x32')](null,_0x4d8814[_0x44fb('0x19')]);if(_0x194f22){if(_0x194f22[_0x44fb('0x33')]){_0x410386=getRoot(_0x194f22[_0x44fb('0x33')]);if(_0x410386&&_0x410386['start']){logger[_0x44fb('0x34')](_0x44fb('0x20'),JSON[_0x44fb('0x2f')](_0x410386,null,0x2));_0x4d8814[_0x44fb('0x35')]=moment()['format'](_0x44fb('0x36'));_0x53bf98=initGraph(_[_0x44fb('0x37')](_0x410386,_0x44fb('0x24')),_0x410386[_0x44fb('0x24')]);_0xe3b4f4=new Vertices(_0x4d8814,rpc,mailRpc);logger[_0x44fb('0x11')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4d8814[_0x44fb('0x19')],_0x4d8814[_0x44fb('0x1a')],_0x4d8814[_0x44fb('0x1b')],_0x4d8814[_0x44fb('0x1c')],_0x4d8814[_0x44fb('0x1e')]));_0x53bf98[_0x44fb('0x38')](_0x410386['start']['id'],function(_0xd6fb06){try{_0xd6fb06=_0xe3b4f4['clear'](_0xd6fb06);logger[_0x44fb('0x34')](_0x44fb('0x39'),JSON[_0x44fb('0x2f')](_0xd6fb06,null,0x2));if(_0xd6fb06['agicommand']===_0x44fb('0x3a')){logger[_0x44fb('0x11')](_0x44fb('0x3b'));_0x4d8814[_0x44fb('0x3c')]=_0xd6fb06['context']||_0x4d8814[_0x44fb('0x3c')];_0x4d8814[_0x44fb('0x3d')]=_0xd6fb06[_0x44fb('0x3d')];_0x4d8814[_0x44fb('0x3e')]=_0xd6fb06[_0x44fb('0x3e')]?_0xd6fb06['priority']-0x1:0x1;return null;}else if(_0xd6fb06&&_0xe3b4f4[_0xd6fb06[_0x44fb('0x21')]]){_0x5ea120=_0xe3b4f4[_0xd6fb06[_0x44fb('0x21')]](_0xd6fb06);logger[_0x44fb('0x11')]('response',JSON[_0x44fb('0x2f')](_0x5ea120,null,0x2));if(_0x5ea120&&_0x5ea120[_0x44fb('0x3f')]===AGI_CODE_SUCCESS&&_0x5ea120[_0x44fb('0x40')]!==AGI_RESULT_ERROR&&!_0x4d8814[_0x44fb('0x41')]){logger[_0x44fb('0x34')](_0x44fb('0x42'),getLogFromObject(_0x5ea120));return _[_0x44fb('0x43')](_0x5ea120[_0x44fb('0x40')])?null:_0x5ea120[_0x44fb('0x40')][_0x44fb('0x44')]();}else{logger[_0x44fb('0xc')](_0x44fb('0x42'),getLogFromObject(_0x5ea120));return null;}}else{logger[_0x44fb('0xc')](_0x44fb('0x45'));return null;}}catch(_0x2567fa){logger[_0x44fb('0xc')](_0x2567fa['stack']);return null;}});if(_0x410386[_0x44fb('0x46')]){logger['info'](util['format'](_0x44fb('0x47'),_0x4d8814[_0x44fb('0x19')],_0x4d8814[_0x44fb('0x1a')],_0x4d8814[_0x44fb('0x1b')],_0x4d8814['dnid'],_0x4d8814['uniqueid']));_0x53bf98[_0x44fb('0x38')](_0x410386[_0x44fb('0x46')]['id'],function(_0x562458){try{_0x562458=_0xe3b4f4['clear'](_0x562458);logger[_0x44fb('0x34')](_0x44fb('0x39'),JSON[_0x44fb('0x2f')](_0x562458,null,0x2));if(_0x562458&&_0xe3b4f4[_0x562458['agicommand']]){_0x5ea120=_0xe3b4f4[_0x562458['agicommand']](_0x562458);if(_0x5ea120){logger[_0x44fb('0x34')](_0x44fb('0x42'),getLogFromObject(_0x5ea120));return _['isUndefined'](_0x5ea120[_0x44fb('0x40')])?null:_0x5ea120[_0x44fb('0x40')][_0x44fb('0x44')]();}else{logger[_0x44fb('0xc')](_0x44fb('0x42'),getLogFromObject(_0x5ea120));return null;}}else{logger['error'](_0x44fb('0x45'));return null;}}catch(_0x229846){logger[_0x44fb('0xc')](_0x229846[_0x44fb('0xd')]);return null;}});}logger['info'](util[_0x44fb('0x12')](_0x44fb('0x48'),_0x4d8814[_0x44fb('0x19')],_0x4d8814['calleridname'],_0x4d8814[_0x44fb('0x1b')],_0x4d8814[_0x44fb('0x1c')],_0x4d8814[_0x44fb('0x1e')]));logger[_0x44fb('0x11')](util[_0x44fb('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4d8814[_0x44fb('0x3c')],_0x4d8814[_0x44fb('0x3d')],parseInt(_0x4d8814['priority'],0xa)+0x1));_0x4d8814[_0x44fb('0x49')](_0x4d8814[_0x44fb('0x3c')],_0x4d8814[_0x44fb('0x3d')],parseInt(_0x4d8814['priority'],0xa)+0x1);_0x4d8814['close']();}}else{logger[_0x44fb('0xc')](util[_0x44fb('0x12')]('Project\x20%s\x20not\x20published',_0x4d8814[_0x44fb('0x19')]));_0x4d8814[_0x44fb('0x49')](_0x4d8814[_0x44fb('0x3c')],_0x4d8814['extension'],parseInt(_0x4d8814[_0x44fb('0x3e')],0xa)+0x1);_0x4d8814['close']();}}else{logger[_0x44fb('0xc')](util[_0x44fb('0x12')](_0x44fb('0x4a'),_0x4d8814[_0x44fb('0x19')]));_0x4d8814[_0x44fb('0x49')](_0x4d8814[_0x44fb('0x3c')],_0x4d8814[_0x44fb('0x3d')],parseInt(_0x4d8814['priority'],0xa)+0x1);_0x4d8814[_0x44fb('0x30')]();}}function main(){var _0x3fa86b;return utilLicense['getLicense']()[_0x44fb('0x2b')](function(_0x21f1ed){if(_0x21f1ed){if(_0x21f1ed['voice']){if(_0x21f1ed[_0x44fb('0x4b')]&&_0x21f1ed[_0x44fb('0x4b')]>0x0){logger[_0x44fb('0x11')](util[_0x44fb('0x12')](_0x44fb('0x4c'),_0x21f1ed[_0x44fb('0x4b')]));_0x3fa86b=_0x21f1ed[_0x44fb('0x4b')];}else{logger[_0x44fb('0x11')](_0x44fb('0x4d'));}}else{logger[_0x44fb('0x11')](_0x44fb('0x4e'));_0x3fa86b=-0x1;}}})[_0x44fb('0x2a')](function(_0x169ed3){logger[_0x44fb('0xc')](_0x44fb('0x4f'),_0x169ed3[_0x44fb('0xd')]);})[_0x44fb('0x46')](function(){var _0x1f35e7=require(_0x44fb('0x50'))(config['agi'][_0x44fb('0x10')],config['agi']['ip'],_0x3fa86b);_0x1f35e7['on'](_0x44fb('0xc'),errorHandler);_0x1f35e7['on'](_0x44fb('0x51'),listeningHandler);_0x1f35e7['on'](_0x44fb('0x52'),connectionHandler);_0x1f35e7['on'](_0x44fb('0x30'),closeHandler);});}main();
\ No newline at end of file
index a027452..a733bc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dc5=['request','then','message','catch','sendMailMessage','SendMail','bluebird','client','http'];(function(_0x536e2d,_0x290bb0){var _0x5d4300=function(_0x7a081){while(--_0x7a081){_0x536e2d['push'](_0x536e2d['shift']());}};_0x5d4300(++_0x290bb0);}(_0x4dc5,0x1ec));var _0x54dc=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x4dc5[_0xfa634c];return _0x73e478;};'use strict';var BPromise=require(_0x54dc('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x54dc('0x1')][_0x54dc('0x2')]({'port':0x232b});function request(_0x578c09,_0x1dd74d){return new BPromise(function(_0x378428,_0x4b4400){return client[_0x54dc('0x3')](_0x578c09,_0x1dd74d)[_0x54dc('0x4')](function(_0x63061){if(_0x63061['error']){return _0x4b4400(_0x63061['error'][_0x54dc('0x5')]);}else{return _0x378428(_0x63061['result']);}})[_0x54dc('0x6')](function(_0x2c6e55){return _0x4b4400(_0x2c6e55);});});}exports[_0x54dc('0x7')]=function(_0x50f35c,_0xaacc7a){return request(_0x54dc('0x8'),{'account':_0x50f35c,'message':_0xaacc7a});};
\ No newline at end of file
+var _0x976d=['catch','sendMailMessage','bluebird','jayson/promise','client','http','request','then','error','result'];(function(_0x37a3f3,_0x663b49){var _0x4da923=function(_0x47713f){while(--_0x47713f){_0x37a3f3['push'](_0x37a3f3['shift']());}};_0x4da923(++_0x663b49);}(_0x976d,0x8e));var _0xd976=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x976d[_0x5756f8];return _0x3bb749;};'use strict';var BPromise=require(_0xd976('0x0'));var jayson=require(_0xd976('0x1'));var client=jayson[_0xd976('0x2')][_0xd976('0x3')]({'port':0x232b});function request(_0xa51353,_0x2ff3a5){return new BPromise(function(_0x3a31db,_0x4f43ae){return client[_0xd976('0x4')](_0xa51353,_0x2ff3a5)[_0xd976('0x5')](function(_0x4a95e4){if(_0x4a95e4[_0xd976('0x6')]){return _0x4f43ae(_0x4a95e4[_0xd976('0x6')]['message']);}else{return _0x3a31db(_0x4a95e4[_0xd976('0x7')]);}})[_0xd976('0x8')](function(_0x4c004e){return _0x4f43ae(_0x4c004e);});});}exports[_0xd976('0x9')]=function(_0x557d22,_0x56d7f8){return request('SendMail',{'account':_0x557d22,'message':_0x56d7f8});};
\ No newline at end of file
index 61bef4e..e56811b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc342=['length','slice','trim','headers','emit','line','exports','Transform','call','inherits','prototype','_transform','_localBuffer','toString','_inBody','indexOf','substring'];(function(_0x1aa56a,_0x5fc2a0){var _0x357b47=function(_0x229e60){while(--_0x229e60){_0x1aa56a['push'](_0x1aa56a['shift']());}};_0x357b47(++_0x5fc2a0);}(_0xc342,0x106));var _0x2c34=function(_0x185d2a,_0x308609){_0x185d2a=_0x185d2a-0x0;var _0x4dea27=_0xc342[_0x185d2a];return _0x4dea27;};'use strict';var util=require('util');var Transform=require('stream')[_0x2c34('0x0')];function AGIReply(_0x148d6f){Transform[_0x2c34('0x1')](this,_0x148d6f);this['_localBuffer']='';this['_inBody']=![];}util[_0x2c34('0x2')](AGIReply,Transform);AGIReply[_0x2c34('0x3')][_0x2c34('0x4')]=function(_0x3b400b,_0x2464e9,_0x44cbe0){var _0x27537b='\x0a',_0x6137b7=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x4bec4a=-0x1,_0x181579=-0x1,_0x28e9d8='',_0x558fcc=0x0,_0x2757ef='',_0x5cc80e='';this[_0x2c34('0x5')]+=_0x3b400b[_0x2c34('0x6')]();_0x2757ef=this['_localBuffer'];if(!this[_0x2c34('0x7')]){_0x558fcc=0x0;while(_0x6137b7[_0x558fcc]){while((_0x181579=_0x2757ef[_0x2c34('0x8')](_0x6137b7[_0x558fcc]))!=-0x1){_0x28e9d8=_0x6137b7[_0x558fcc];_0x5cc80e=_0x2757ef[_0x2c34('0x9')](0x0,_0x181579);_0x2757ef=_0x2757ef['substring'](_0x181579+_0x28e9d8[_0x2c34('0xa')]);var _0x1e7cc4=_0x5cc80e['split'](_0x27537b),_0x80a1d2=0x0,_0x32a596={},_0x5113ad='',_0x3dae83='',_0x1b8ec5=-0x1;while(_0x1e7cc4[_0x80a1d2]){_0x1b8ec5=_0x1e7cc4[_0x80a1d2][_0x2c34('0x8')](':');if(_0x1b8ec5!=-0x1){_0x5113ad=_0x1e7cc4[_0x80a1d2][_0x2c34('0xb')](0x0,_0x1b8ec5)[_0x2c34('0xc')]();_0x3dae83=_0x1e7cc4[_0x80a1d2][_0x2c34('0xb')](_0x1b8ec5+0x1)[_0x2c34('0xc')]();if(_0x5113ad['length']>0x0){_0x32a596[_0x5113ad]=_0x3dae83;}}else{}_0x80a1d2++;}this['emit'](_0x2c34('0xd'),_0x32a596);this[_0x2c34('0x7')]=!![];}_0x558fcc++;}this[_0x2c34('0x5')]=_0x2757ef;}else{while((_0x4bec4a=_0x2757ef['indexOf'](_0x27537b))!=-0x1){_0x5cc80e=_0x2757ef[_0x2c34('0x9')](0x0,_0x4bec4a);this[_0x2c34('0xe')](_0x2c34('0xf'),_0x5cc80e);_0x2757ef=_0x2757ef[_0x2c34('0x9')](_0x4bec4a+_0x27537b[_0x2c34('0xa')]);}this[_0x2c34('0x5')]=_0x2757ef;}_0x44cbe0();};module[_0x2c34('0x10')]=AGIReply;
\ No newline at end of file
+var _0x165f=['prototype','_transform','indexOf','substring','length','trim','slice','emit','headers','_inBody','exports','util','Transform','call','_localBuffer','inherits'];(function(_0x13a03a,_0x5506f9){var _0x4bfec3=function(_0x42df5e){while(--_0x42df5e){_0x13a03a['push'](_0x13a03a['shift']());}};_0x4bfec3(++_0x5506f9);}(_0x165f,0x6b));var _0xf165=function(_0x4f3a57,_0x4691cf){_0x4f3a57=_0x4f3a57-0x0;var _0x5511ab=_0x165f[_0x4f3a57];return _0x5511ab;};'use strict';var util=require(_0xf165('0x0'));var Transform=require('stream')[_0xf165('0x1')];function AGIReply(_0x55f9d4){Transform[_0xf165('0x2')](this,_0x55f9d4);this[_0xf165('0x3')]='';this['_inBody']=![];}util[_0xf165('0x4')](AGIReply,Transform);AGIReply[_0xf165('0x5')][_0xf165('0x6')]=function(_0x2f6be9,_0x4f7c58,_0x413e24){var _0x1764ae='\x0a',_0x24f1a1=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x208d35=-0x1,_0x31e1e6=-0x1,_0x5415d1='',_0x5372b6=0x0,_0x12ffde='',_0x1abeb4='';this[_0xf165('0x3')]+=_0x2f6be9['toString']();_0x12ffde=this[_0xf165('0x3')];if(!this['_inBody']){_0x5372b6=0x0;while(_0x24f1a1[_0x5372b6]){while((_0x31e1e6=_0x12ffde[_0xf165('0x7')](_0x24f1a1[_0x5372b6]))!=-0x1){_0x5415d1=_0x24f1a1[_0x5372b6];_0x1abeb4=_0x12ffde['substring'](0x0,_0x31e1e6);_0x12ffde=_0x12ffde[_0xf165('0x8')](_0x31e1e6+_0x5415d1[_0xf165('0x9')]);var _0x565ca9=_0x1abeb4['split'](_0x1764ae),_0x5ae391=0x0,_0x186f0c={},_0x2a74a0='',_0x51d74c='',_0x2cba2e=-0x1;while(_0x565ca9[_0x5ae391]){_0x2cba2e=_0x565ca9[_0x5ae391][_0xf165('0x7')](':');if(_0x2cba2e!=-0x1){_0x2a74a0=_0x565ca9[_0x5ae391]['slice'](0x0,_0x2cba2e)[_0xf165('0xa')]();_0x51d74c=_0x565ca9[_0x5ae391][_0xf165('0xb')](_0x2cba2e+0x1)[_0xf165('0xa')]();if(_0x2a74a0[_0xf165('0x9')]>0x0){_0x186f0c[_0x2a74a0]=_0x51d74c;}}else{}_0x5ae391++;}this[_0xf165('0xc')](_0xf165('0xd'),_0x186f0c);this[_0xf165('0xe')]=!![];}_0x5372b6++;}this['_localBuffer']=_0x12ffde;}else{while((_0x208d35=_0x12ffde[_0xf165('0x7')](_0x1764ae))!=-0x1){_0x1abeb4=_0x12ffde['substring'](0x0,_0x208d35);this['emit']('line',_0x1abeb4);_0x12ffde=_0x12ffde['substring'](_0x208d35+_0x1764ae[_0xf165('0x9')]);}this['_localBuffer']=_0x12ffde;}_0x413e24();};module[_0xf165('0xf')]=AGIReply;
\ No newline at end of file
index 5962f81..92dea7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8388=['CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_1','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','CreateCmContact','ShowPause','agentPause','PauseUser','agentUnpause','agentLogout','bluebird','moment','lodash','util','client','http','request','then','error','message','catch','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','ShowSmsAccount','createSmsMessage'];(function(_0x4a1772,_0x50c0f5){var _0x1f19d2=function(_0x7aa2a3){while(--_0x7aa2a3){_0x4a1772['push'](_0x4a1772['shift']());}};_0x1f19d2(++_0x50c0f5);}(_0x8388,0x18d));var _0x8838=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0x8388[_0x2f5a22];return _0x326b70;};'use strict';var BPromise=require(_0x8838('0x0'));var moment=require(_0x8838('0x1'));var _=require(_0x8838('0x2'));var util=require(_0x8838('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x8838('0x4')][_0x8838('0x5')]({'port':0x2329});function request(_0x316297,_0x20a813){return new BPromise(function(_0xd474f2,_0x5036bd){return client[_0x8838('0x6')](_0x316297,_0x20a813)[_0x8838('0x7')](function(_0x49cac2){if(_0x49cac2[_0x8838('0x8')]){return _0x5036bd(_0x49cac2[_0x8838('0x8')][_0x8838('0x9')]);}else{return _0xd474f2(_0x49cac2['result']);}})[_0x8838('0xa')](function(_0x54312f){return _0x5036bd(_0x54312f);});});}exports['getSquareProject']=function(_0x8555b2){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x8555b2},'attributes':['production']}});};exports[_0x8838('0xb')]=function(_0x28de3d){return request(_0x8838('0xc'),{'options':{'raw':![],'where':{'id':_0x28de3d},'include':[{'model':_0x8838('0xd'),'as':'Smtp'}],'attributes':['id',_0x8838('0xe'),_0x8838('0xf')]}});};exports[_0x8838('0x10')]=function(_0x1b1fe6){return request('ShowSquareProject',{'options':{'where':{'id':_0x1b1fe6},'attributes':[_0x8838('0xe')]}});};exports['getVoiceQueueById']=function(_0x530bac){return request(_0x8838('0x11'),{'options':{'where':{'id':_0x530bac},'attributes':[_0x8838('0xe')]}});};exports[_0x8838('0x12')]=function(_0x43b446){return request(_0x8838('0x13'),{'options':{'where':{'id':_0x43b446},'attributes':[_0x8838('0xe')]}});};exports[_0x8838('0x14')]=function(_0x8daaab){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x8daaab},'attributes':[_0x8838('0x15')]}});};exports[_0x8838('0x16')]=function(_0x5eecf2){return request(_0x8838('0x17'),{'options':{'where':{'id':_0x5eecf2},'attributes':[_0x8838('0xe')]}});};exports[_0x8838('0x18')]=function(_0x4d0c2e){return request(_0x8838('0x19'),{'options':{'where':{'phone':_0x4d0c2e['phone']},'attributes':['id']}});};exports[_0x8838('0x1a')]=function(_0x204120){return request(_0x8838('0x1b'),{'options':{'where':{'id':_0x204120},'attributes':['name']}});};exports[_0x8838('0x1c')]=function(_0x7b836e){return request('ShowSound',{'options':{'where':{'id':_0x7b836e},'attributes':[_0x8838('0x1d')]}});};exports[_0x8838('0x1e')]=function(_0x4c5bed){return request(_0x8838('0x1f'),{'options':{'raw':![],'where':{'id':_0x4c5bed},'include':[{'model':_0x8838('0x20'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x24bc37){return request(_0x8838('0x21'),{'options':{'where':{'id':_0x24bc37},'attributes':['id',_0x8838('0xe')]}});};exports[_0x8838('0x22')]=function(_0x109341){return request(_0x8838('0x23'),{'body':_0x109341});};exports[_0x8838('0x24')]=function(_0x35c3e0){return request(_0x8838('0x25'),{'body':_0x35c3e0});};exports['createSquareReport']=function(_0x73d719){return request('CreateSquareReport',{'body':_[_0x8838('0x26')](_0x73d719,{'project_name':_0x73d719[_0x8838('0x27')],'prev_project_name':_0x73d719['arg_2']||'','is_subproject':_0x73d719['arg_2']?!![]:![],'leaveAt':moment()[_0x8838('0x28')](_0x8838('0x29'))})});};exports[_0x8838('0x2a')]=function(_0x45e5bb){return request(_0x8838('0x2b'),{'body':_0x45e5bb});};exports[_0x8838('0x2c')]=function(_0x1b7c30){return request(_0x8838('0x2d'),{'body':_0x1b7c30});};exports[_0x8838('0x2e')]=function(_0x34ba38){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x34ba38['phone'],'ListId':_0x34ba38[_0x8838('0x2f')]}}})['then'](function(_0x30ea01){if(_0x30ea01){return _0x30ea01;}return request(_0x8838('0x30'),{'body':_0x34ba38});});};exports['getPauseById']=function(_0x537c9d){return request(_0x8838('0x31'),{'options':{'where':{'id':_0x537c9d},'attributes':['name']}});};exports['agentLogin']=function(_0x1b605d,_0x10b1d3){return request('LoginUser',{'body':{'interface':_0x10b1d3},'options':{'where':_0x1b605d}});};exports[_0x8838('0x32')]=function(_0x296ba1,_0x4d8007,_0x2712be){return request(_0x8838('0x33'),{'body':{'type':_0x4d8007,'uniqueid':_0x2712be},'options':{'where':_0x296ba1}});};exports[_0x8838('0x34')]=function(_0xdd28e2){return request('UnpauseUser',{'body':{},'options':{'where':_0xdd28e2}});};exports[_0x8838('0x35')]=function(_0x700132){return request('LogoutUser',{'body':{},'options':{'where':_0x700132}});};
\ No newline at end of file
+var _0xae24=['email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','lodash','jayson/promise','client','request','then','error','catch','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','name'];(function(_0x15d500,_0x388e5e){var _0x4fbeda=function(_0x3dbe2a){while(--_0x3dbe2a){_0x15d500['push'](_0x15d500['shift']());}};_0x4fbeda(++_0x388e5e);}(_0xae24,0x182));var _0x4ae2=function(_0x44f35c,_0x584b47){_0x44f35c=_0x44f35c-0x0;var _0x449438=_0xae24[_0x44f35c];return _0x449438;};'use strict';var BPromise=require(_0x4ae2('0x0'));var moment=require('moment');var _=require(_0x4ae2('0x1'));var util=require('util');var jayson=require(_0x4ae2('0x2'));var client=jayson[_0x4ae2('0x3')]['http']({'port':0x2329});function request(_0x5b6f4d,_0x1afc7a){return new BPromise(function(_0x5b25b5,_0x2ed9ff){return client[_0x4ae2('0x4')](_0x5b6f4d,_0x1afc7a)[_0x4ae2('0x5')](function(_0x3e6055){if(_0x3e6055[_0x4ae2('0x6')]){return _0x2ed9ff(_0x3e6055[_0x4ae2('0x6')]['message']);}else{return _0x5b25b5(_0x3e6055['result']);}})[_0x4ae2('0x7')](function(_0x4d3d8a){return _0x2ed9ff(_0x4d3d8a);});});}exports['getSquareProject']=function(_0xb5587a){return request(_0x4ae2('0x8'),{'options':{'raw':![],'where':{'name':_0xb5587a},'attributes':['production']}});};exports[_0x4ae2('0x9')]=function(_0x449e1a){return request(_0x4ae2('0xa'),{'options':{'raw':![],'where':{'id':_0x449e1a},'include':[{'model':_0x4ae2('0xb'),'as':'Smtp'}],'attributes':['id',_0x4ae2('0xc'),_0x4ae2('0xd')]}});};exports[_0x4ae2('0xe')]=function(_0x4d7dc3){return request(_0x4ae2('0x8'),{'options':{'where':{'id':_0x4d7dc3},'attributes':[_0x4ae2('0xc')]}});};exports[_0x4ae2('0xf')]=function(_0x3c70bd){return request(_0x4ae2('0x10'),{'options':{'where':{'id':_0x3c70bd},'attributes':[_0x4ae2('0xc')]}});};exports[_0x4ae2('0x11')]=function(_0x3cabc9){return request(_0x4ae2('0x12'),{'options':{'where':{'id':_0x3cabc9},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x4d5cab){return request(_0x4ae2('0x13'),{'options':{'where':{'id':_0x4d5cab},'attributes':[_0x4ae2('0x14')]}});};exports['getUserById']=function(_0x463765){return request(_0x4ae2('0x15'),{'options':{'where':{'id':_0x463765},'attributes':[_0x4ae2('0xc')]}});};exports[_0x4ae2('0x16')]=function(_0x428d24){return request(_0x4ae2('0x17'),{'options':{'where':{'phone':_0x428d24[_0x4ae2('0x18')]},'attributes':['id']}});};exports[_0x4ae2('0x19')]=function(_0x41b672){return request(_0x4ae2('0x1a'),{'options':{'where':{'id':_0x41b672},'attributes':['name']}});};exports['getSoundById']=function(_0x44a2d3){return request(_0x4ae2('0x1b'),{'options':{'where':{'id':_0x44a2d3},'attributes':['save_name']}});};exports[_0x4ae2('0x1c')]=function(_0x343db1){return request(_0x4ae2('0x1d'),{'options':{'raw':![],'where':{'id':_0x343db1},'include':[{'model':_0x4ae2('0x1e'),'as':_0x4ae2('0x1f')}]}});};exports['getSmsAccountById']=function(_0x2bf5fe){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2bf5fe},'attributes':['id','name']}});};exports[_0x4ae2('0x20')]=function(_0x151b70){return request(_0x4ae2('0x21'),{'body':_0x151b70});};exports[_0x4ae2('0x22')]=function(_0xca16bf){return request('CreateSquareDetailsReport',{'body':_0xca16bf});};exports[_0x4ae2('0x23')]=function(_0x4a0ddb){return request(_0x4ae2('0x24'),{'body':_[_0x4ae2('0x25')](_0x4a0ddb,{'project_name':_0x4a0ddb[_0x4ae2('0x26')],'prev_project_name':_0x4a0ddb['arg_2']||'','is_subproject':_0x4a0ddb[_0x4ae2('0x27')]?!![]:![],'leaveAt':moment()[_0x4ae2('0x28')](_0x4ae2('0x29'))})});};exports[_0x4ae2('0x2a')]=function(_0x1c2934){return request(_0x4ae2('0x2b'),{'body':_0x1c2934});};exports['createSquareMessage']=function(_0x5962b0){return request(_0x4ae2('0x2c'),{'body':_0x5962b0});};exports[_0x4ae2('0x2d')]=function(_0x3fa514){return request(_0x4ae2('0x2e'),{'options':{'raw':![],'where':{'phone':_0x3fa514[_0x4ae2('0x18')],'ListId':_0x3fa514[_0x4ae2('0x2f')]}}})['then'](function(_0x5ec1fd){if(_0x5ec1fd){return _0x5ec1fd;}return request(_0x4ae2('0x30'),{'body':_0x3fa514});});};exports['getPauseById']=function(_0x554cff){return request('ShowPause',{'options':{'where':{'id':_0x554cff},'attributes':[_0x4ae2('0xc')]}});};exports[_0x4ae2('0x31')]=function(_0x55fafd,_0x883fd5){return request(_0x4ae2('0x32'),{'body':{'interface':_0x883fd5},'options':{'where':_0x55fafd}});};exports[_0x4ae2('0x33')]=function(_0x146bc2,_0x14fdb3,_0x23f954){return request(_0x4ae2('0x34'),{'body':{'type':_0x14fdb3,'uniqueid':_0x23f954},'options':{'where':_0x146bc2}});};exports[_0x4ae2('0x35')]=function(_0x2904f1){return request(_0x4ae2('0x36'),{'body':{},'options':{'where':_0x2904f1}});};exports[_0x4ae2('0x37')]=function(_0x12815f){return request(_0x4ae2('0x38'),{'body':{},'options':{'where':_0x12815f}});};
\ No newline at end of file
index 43aeb86..7878059 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5a=['./lex','./polly'];(function(_0x508835,_0x4105b2){var _0x378ee0=function(_0x1de55e){while(--_0x1de55e){_0x508835['push'](_0x508835['shift']());}};_0x378ee0(++_0x4105b2);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4f15ab,_0x2a06d9){_0x4f15ab=_0x4f15ab-0x0;var _0x491ad4=_0x9c5a[_0x4f15ab];return _0x491ad4;};var polly=require(_0xa9c5('0x0'));var lex=require(_0xa9c5('0x1'));module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x1fcc=['./lex','./polly'];(function(_0x32e49f,_0x4b6b3c){var _0x4a9b42=function(_0x55e73a){while(--_0x55e73a){_0x32e49f['push'](_0x32e49f['shift']());}};_0x4a9b42(++_0x4b6b3c);}(_0x1fcc,0x125));var _0xc1fc=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0x1fcc[_0x5b3950];return _0x41e436;};var polly=require(_0xc1fc('0x0'));var lex=require(_0xc1fc('0x1'));module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
index a312849..621c6e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['exports'];(function(_0x32a4a6,_0x109766){var _0x15e6e2=function(_0x2cc429){while(--_0x2cc429){_0x32a4a6['push'](_0x32a4a6['shift']());}};_0x15e6e2(++_0x109766);}(_0xb58b,0x1f1));var _0xbb58=function(_0x126991,_0x3e5ded){_0x126991=_0x126991-0x0;var _0x4c9217=_0xb58b[_0x126991];return _0x4c9217;};'use strict';var lex=require('./lib/api');module[_0xbb58('0x0')]=function(_0x3de0dd,_0x3fb85a,_0x4f5d42,_0x340c23,_0x4e6d6c,_0x5c9ec5){return lex(_0x3de0dd,_0x3fb85a,_0x4f5d42,_0x340c23,_0x4e6d6c,_0x5c9ec5);};
\ No newline at end of file
+var _0x2750=['./lib/api'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x2750,0x13b));var _0x0275=function(_0x580ac7,_0x36c271){_0x580ac7=_0x580ac7-0x0;var _0x3e1ef3=_0x2750[_0x580ac7];return _0x3e1ef3;};'use strict';var lex=require(_0x0275('0x0'));module['exports']=function(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06){return lex(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06);};
\ No newline at end of file
index 0e9bf1e..37566bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x957363,_0x156152){var _0x4559c6=function(_0x508701){while(--_0x508701){_0x957363['push'](_0x957363['shift']());}};_0x4559c6(++_0x156152);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x4935d5,_0xb0561a){var _0x49928d=function(_0x17c4ee){while(--_0x17c4ee){_0x4935d5['push'](_0x4935d5['shift']());}};_0x49928d(++_0xb0561a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 dba7933..4f7dbce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5852=['./lib/api'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5852,0x180));var _0x2585=function(_0x134058,_0x423995){_0x134058=_0x134058-0x0;var _0x14a1a9=_0x5852[_0x134058];return _0x14a1a9;};'use strict';var polly=require(_0x2585('0x0'));module['exports']=function(_0x3dc131,_0x244bdd,_0x2981b9,_0x891fcf,_0x328701,_0x5d92f6,_0x572406){return polly(_0x3dc131,_0x244bdd,_0x2981b9,_0x891fcf,_0x328701,_0x5d92f6,_0x572406);};
\ No newline at end of file
+var _0x444d=['exports','./lib/api'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0x444d,0x19f));var _0xd444=function(_0xddcda9,_0x2fc019){_0xddcda9=_0xddcda9-0x0;var _0xe36bd7=_0x444d[_0xddcda9];return _0xe36bd7;};'use strict';var polly=require(_0xd444('0x0'));module[_0xd444('0x1')]=function(_0x5db925,_0x7c6512,_0x5ed5cb,_0x49ca82,_0x2f93d2,_0x9a26ae,_0x56821f){return polly(_0x5db925,_0x7c6512,_0x5ed5cb,_0x49ca82,_0x2f93d2,_0x9a26ae,_0x56821f);};
\ No newline at end of file
index 9f576ac..c093561 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4de5=['randomstring','aws-sdk','AudioStream','writeFile','exports','text','mp3','path'];(function(_0x5461d3,_0x451a9f){var _0x1bbbb8=function(_0x93da96){while(--_0x93da96){_0x5461d3['push'](_0x5461d3['shift']());}};_0x1bbbb8(++_0x451a9f);}(_0x4de5,0x8f));var _0x54de=function(_0x2f30c8,_0x1fa752){_0x2f30c8=_0x2f30c8-0x0;var _0x522b2b=_0x4de5[_0x2f30c8];return _0x522b2b;};'use strict';var fs=require('fs');var path=require(_0x54de('0x0'));var BPromise=require('bluebird');var rs=require(_0x54de('0x1'));var AWS=require(_0x54de('0x2'));function pollyResult(_0x47e179,_0x80240a,_0x174d58){return new BPromise(function(_0x4f2247,_0xd45f9d){_0x47e179['synthesizeSpeech'](_0x80240a,function(_0x30c1c5,_0x1113ed){if(_0x30c1c5){_0xd45f9d(_0x30c1c5);}else if(_0x1113ed){if(_0x1113ed[_0x54de('0x3')]instanceof Buffer){fs[_0x54de('0x4')](_0x174d58,_0x1113ed[_0x54de('0x3')],function(_0x287bc6){if(_0x287bc6){_0xd45f9d(_0x287bc6);}else{_0x4f2247();}});}else{_0xd45f9d(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0xd45f9d(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x54de('0x5')]=function(_0x1136da,_0x38e770,_0x78e9a6,_0x347b6e,_0x902a1d,_0x3c8f99,_0x17e99f){var _0xb323e7=new AWS['Polly']({'accessKeyId':_0x1136da,'secretAccessKey':_0x38e770,'region':_0x78e9a6});var _0x19ff30={'Text':_0x902a1d,'TextType':_0x3c8f99||_0x54de('0x6'),'OutputFormat':_0x54de('0x7'),'VoiceId':_0x347b6e};return pollyResult(_0xb323e7,_0x19ff30,_0x17e99f);};
\ No newline at end of file
+var _0x5c64=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x5c64,0x165));var _0x45c6=function(_0x118423,_0x51142a){_0x118423=_0x118423-0x0;var _0xafe8e6=_0x5c64[_0x118423];return _0xafe8e6;};'use strict';var fs=require('fs');var path=require(_0x45c6('0x0'));var BPromise=require('bluebird');var rs=require(_0x45c6('0x1'));var AWS=require(_0x45c6('0x2'));function pollyResult(_0x34abd6,_0x5bd73d,_0x3b0a69){return new BPromise(function(_0xc6ace1,_0x11c813){_0x34abd6[_0x45c6('0x3')](_0x5bd73d,function(_0x55db76,_0x3f2c43){if(_0x55db76){_0x11c813(_0x55db76);}else if(_0x3f2c43){if(_0x3f2c43[_0x45c6('0x4')]instanceof Buffer){fs[_0x45c6('0x5')](_0x3b0a69,_0x3f2c43[_0x45c6('0x4')],function(_0x26a145){if(_0x26a145){_0x11c813(_0x26a145);}else{_0xc6ace1();}});}else{_0x11c813(new Error(_0x45c6('0x6')));}}else{_0x11c813(new Error(_0x45c6('0x7')));}});});}module[_0x45c6('0x8')]=function(_0x2605d4,_0x4dda3f,_0x3d8632,_0x541d73,_0x425d82,_0x21e6a9,_0x4b73bc){var _0x2a4e6e=new AWS['Polly']({'accessKeyId':_0x2605d4,'secretAccessKey':_0x4dda3f,'region':_0x3d8632});var _0x2c271b={'Text':_0x425d82,'TextType':_0x21e6a9||_0x45c6('0x9'),'OutputFormat':_0x45c6('0xa'),'VoiceId':_0x541d73};return pollyResult(_0x2a4e6e,_0x2c271b,_0x4b73bc);};
\ No newline at end of file
index a85bdc4..9b24354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var asr=require('./lib/api');module['exports']=function(_0x110306,_0xd8ac3e,_0x1beb37,_0x58df88){return asr(_0x110306,_0xd8ac3e,_0x1beb37);};
\ No newline at end of file
+var _0x83f9=['exports','./lib/api'];(function(_0x20d73e,_0x39f9ec){var _0x52e84b=function(_0x11a4ac){while(--_0x11a4ac){_0x20d73e['push'](_0x20d73e['shift']());}};_0x52e84b(++_0x39f9ec);}(_0x83f9,0xdb));var _0x983f=function(_0x7a7925,_0x494985){_0x7a7925=_0x7a7925-0x0;var _0x485e08=_0x83f9[_0x7a7925];return _0x485e08;};'use strict';var asr=require(_0x983f('0x0'));module[_0x983f('0x1')]=function(_0xb57803,_0x23c058,_0x25e456,_0xae72f8){return asr(_0xb57803,_0x23c058,_0x25e456);};
\ No newline at end of file
index b1eedeb..bd5aa50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe43c=['bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','toString','base64','LINEAR16','url'];(function(_0x49ad17,_0x110747){var _0x1d6230=function(_0x685d63){while(--_0x685d63){_0x49ad17['push'](_0x49ad17['shift']());}};_0x1d6230(++_0x110747);}(_0xe43c,0x180));var _0xce43=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xe43c[_0x5d6456];return _0x4d66c1;};'use strict';var url=require(_0xce43('0x0'));var BPromise=require(_0xce43('0x1'));var fs=require('fs');var host=_0xce43('0x2');module[_0xce43('0x3')]=function(_0x6f053b,_0x357837,_0x5baedd){return new BPromise(function(_0x415941,_0x4eed68){var _0x32b4d4;if(typeof _0x6f053b!==_0xce43('0x4')||_0x6f053b[_0xce43('0x5')]===0x0){return _0x4eed68(_0xce43('0x6'));}if(typeof _0x357837!=='string'||_0x357837[_0xce43('0x5')]===0x0){return _0x4eed68('key\x20should\x20be\x20a\x20string');}if(typeof _0x5baedd!==_0xce43('0x7')&&(typeof _0x5baedd!=='string'||_0x5baedd[_0xce43('0x5')]===0x0)){return _0x4eed68('lang\x20should\x20be\x20a\x20string');}try{_0x32b4d4=fs['readFileSync'](_0x6f053b)[_0xce43('0x8')](_0xce43('0x9'));}catch(_0x4a62bd){return _0x4eed68(_0x4a62bd);}return _0x415941({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x357837,'body':{'config':{'encoding':_0xce43('0xa'),'sampleRateHertz':'8000','languageCode':_0x5baedd},'audio':{'content':_0x32b4d4}},'json':!![]});});};
\ No newline at end of file
+var _0x684c=['url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000'];(function(_0x2929ba,_0x506aa6){var _0x365e6e=function(_0x206fd3){while(--_0x206fd3){_0x2929ba['push'](_0x2929ba['shift']());}};_0x365e6e(++_0x506aa6);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var url=require(_0xc684('0x0'));var BPromise=require(_0xc684('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xc684('0x2')]=function(_0x10c3ca,_0x313548,_0x1a0d37){return new BPromise(function(_0x2c50cf,_0x4a3536){var _0x3519e8;if(typeof _0x10c3ca!==_0xc684('0x3')||_0x10c3ca[_0xc684('0x4')]===0x0){return _0x4a3536(_0xc684('0x5'));}if(typeof _0x313548!==_0xc684('0x3')||_0x313548[_0xc684('0x4')]===0x0){return _0x4a3536(_0xc684('0x6'));}if(typeof _0x1a0d37!==_0xc684('0x7')&&(typeof _0x1a0d37!==_0xc684('0x3')||_0x1a0d37[_0xc684('0x4')]===0x0)){return _0x4a3536(_0xc684('0x8'));}try{_0x3519e8=fs[_0xc684('0x9')](_0x10c3ca)[_0xc684('0xa')](_0xc684('0xb'));}catch(_0x11e848){return _0x4a3536(_0x11e848);}return _0x2c50cf({'method':_0xc684('0xc'),'uri':host+_0xc684('0xd')+_0x313548,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xc684('0xe'),'languageCode':_0x1a0d37},'audio':{'content':_0x3519e8}},'json':!![]});});};
\ No newline at end of file
index c4888ce..5d3ad3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e22=['exports','./asr'];(function(_0x3b8823,_0x36dd39){var _0x1dde71=function(_0x44f1c8){while(--_0x44f1c8){_0x3b8823['push'](_0x3b8823['shift']());}};_0x1dde71(++_0x36dd39);}(_0x7e22,0x18f));var _0x27e2=function(_0x127ffe,_0x4b364d){_0x127ffe=_0x127ffe-0x0;var _0xd20c5b=_0x7e22[_0x127ffe];return _0xd20c5b;};var asr=require(_0x27e2('0x0'));module[_0x27e2('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xb112=['./asr','exports'];(function(_0x335a62,_0xfafea4){var _0x249a9a=function(_0xb3a9a5){while(--_0xb3a9a5){_0x335a62['push'](_0x335a62['shift']());}};_0x249a9a(++_0xfafea4);}(_0xb112,0xe2));var _0x2b11=function(_0x255f80,_0x5269f8){_0x255f80=_0x255f80-0x0;var _0x50fd69=_0xb112[_0x255f80];return _0x50fd69;};var asr=require(_0x2b11('0x0'));module[_0x2b11('0x1')]={'asr':asr};
\ No newline at end of file
index 36f8d6c..34ee54d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeab=['sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','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','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','http','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','path','WHAT_EVER','get','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','generate','writeFileSync','base64','then','unlink','chmodSync','777','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.wav','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','stringify','result','source','action','speech','score','status','code','metadata','endConversation','isFallbackIntent','replace'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xbeab,0x143));var _0xbbea=function(_0x1a25af,_0x23fb79){_0x1a25af=_0x1a25af-0x0;var _0x568931=_0xbeab[_0x1a25af];return _0x568931;};'use strict';var apiai=require(_0xbbea('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xbbea('0x1'));var https=require(_0xbbea('0x2'));var md5=require(_0xbbea('0x3'));var path=require('path');var querystring=require(_0xbbea('0x4'));var rp=require(_0xbbea('0x5'));var rs=require(_0xbbea('0x6'));var sox=require(_0xbbea('0x7'));var tts=require(_0xbbea('0x8'));var urlParse=require(_0xbbea('0x9'))[_0xbbea('0xa')];var util=require(_0xbbea('0xb'));var aws=require('./aws');var google=require(_0xbbea('0xc'));var sestek=require(_0xbbea('0xd'));var tilde=require(_0xbbea('0xe'));var logger=require(_0xbbea('0xf'))(_0xbbea('0x10'));var ISPEECH_API=_0xbbea('0x11');function downloadFile(_0x4c769b,_0x40451d){return new BPromise(function(_0x2d2a98,_0x326628){var _0x14fc7a=urlParse(_0x4c769b);var _0x3f65ec=_0x14fc7a[_0xbbea('0x12')]===_0xbbea('0x13')?https:http;var _0xeb0d6f={'host':_0x14fc7a[_0xbbea('0x14')],'path':_0x14fc7a['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x3f65ec['get'](_0xeb0d6f,function(_0x3a3d9e){if(_0x3a3d9e[_0xbbea('0x15')]!==0xc8){logger[_0xbbea('0x16')](_0xbbea('0x17')+_0x4c769b+_0xbbea('0x18')+_0x3a3d9e['statusCode']+'\x20('+_0x3a3d9e[_0xbbea('0x19')]+')');_0x326628(new Error(_0xbbea('0x17')+_0x4c769b+_0xbbea('0x18')+_0x3a3d9e[_0xbbea('0x15')]+'\x20('+_0x3a3d9e[_0xbbea('0x19')]+')'));return;}var _0x256836=fs[_0xbbea('0x1a')](_0x40451d);_0x256836['on'](_0xbbea('0x1b'),function(){logger[_0xbbea('0x1c')](_0xbbea('0x1d'));_0x256836[_0xbbea('0x1e')](_0x2d2a98);});_0x256836['on'](_0xbbea('0x16'),function(_0x2f2804){fs['unlink'](_0x40451d);logger[_0xbbea('0x16')](_0xbbea('0x1f'),_0x2f2804);_0x326628(_0x2f2804);});_0x3a3d9e[_0xbbea('0x20')](_0x256836);})['on'](_0xbbea('0x16'),function(_0x1b5a6c){logger['error'](_0x1b5a6c);_0x326628(_0x1b5a6c);})[_0xbbea('0x21')]();});}function uploadFile(_0x533998){return new BPromise(function(_0x1673c8,_0x3c8f9d){var _0x3e41d1=urlParse(_0x533998);var _0x411836=_0x3e41d1[_0xbbea('0x12')]===_0xbbea('0x13')?https:http;var _0x5afd21={'host':_0x3e41d1[_0xbbea('0x14')],'path':_0x3e41d1[_0xbbea('0x22')],'headers':{'user-agent':_0xbbea('0x23')}};_0x411836[_0xbbea('0x24')](_0x5afd21,function(_0x33a5a5){if(_0x33a5a5[_0xbbea('0x15')]!==0xc8){_0x3c8f9d(new Error('request\x20to\x20'+_0x533998+_0xbbea('0x18')+_0x33a5a5[_0xbbea('0x15')]+'\x20('+_0x33a5a5[_0xbbea('0x19')]+')'));return;}var _0x4c943f='';_0x33a5a5['on']('data',function(_0x3ba04d){_0x4c943f+=_0x3ba04d;});_0x33a5a5['on']('end',function(){_0x1673c8(_0x4c943f);});})['on'](_0xbbea('0x16'),function(_0x5ebd55){_0x3c8f9d(_0x5ebd55);})[_0xbbea('0x21')]();});}function convertFile(_0x21f072,_0x575210){return new BPromise(function(_0x204224,_0x4cf35a){var _0x4631c5=sox[_0xbbea('0x25')](_0x21f072,_0x575210,{'sampleRate':0x1f40,'format':_0xbbea('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4631c5['on'](_0xbbea('0x16'),function(_0x5d0fb8){logger['error'](_0xbbea('0x27'),_0x5d0fb8);_0x4cf35a(_0x5d0fb8);});_0x4631c5['on']('end',function(){logger[_0xbbea('0x1c')](_0xbbea('0x28'));_0x204224();});_0x4631c5[_0xbbea('0x29')]();});}function base64Decode(_0x3fbb79,_0x57a1d2){var _0x43e9bb=path[_0xbbea('0x2a')](__dirname,'tmp',rs[_0xbbea('0x2b')](0x4)+'.wav');fs[_0xbbea('0x2c')](_0x43e9bb,_0x3fbb79,_0xbbea('0x2d'));return convertFile(_0x43e9bb,_0x57a1d2)[_0xbbea('0x2e')](function(){try{fs[_0xbbea('0x2f')](_0x43e9bb);fs[_0xbbea('0x30')](_0x57a1d2,_0xbbea('0x31'));}catch(_0x913dbe){logger[_0xbbea('0x16')](_0x913dbe);}return _0x57a1d2['split']('.')[0x0];});}function base64Encode(_0x5cc767){var _0x7f18b4=fs[_0xbbea('0x32')](_0x5cc767);return new Buffer(_0x7f18b4)['toString'](_0xbbea('0x2d'));}exports[_0xbbea('0x33')]=function(_0xc87d80,_0x34179f,_0x3c9b29,_0x1af11c,_0x4c3c77,_0xe181f3){var _0x5b8698,_0x21cc89;var _0x1005ac=_0xbbea('0x34');var _0xd92aab=_0xbbea('0x35')+_0xc87d80;var _0x18ed3d={};if(_0x34179f==='ssml'){_0x18ed3d[_0xbbea('0x36')]={'ssml':_0x3c9b29};}else{_0x18ed3d[_0xbbea('0x36')]={'text':_0x3c9b29};};_0x18ed3d['voice']={'languageCode':_0x1af11c,'ssmlGender':_0x4c3c77};_0x18ed3d[_0xbbea('0x37')]={'audioEncoding':_0xbbea('0x38'),'sampleRateHertz':0x1f40};var _0x3484ae={'url':_0x1005ac+_0xbbea('0x39')+_0xd92aab,'method':_0xbbea('0x3a'),'json':!![],'body':_0x18ed3d};return rp(_0x3484ae)[_0xbbea('0x2e')](function(_0x640075){return new BPromise(function(_0x40ca72,_0x2f4c80){_0x5b8698=path[_0xbbea('0x2a')](__dirname,_0xbbea('0x3b'),rs[_0xbbea('0x2b')](0x4)+_0xbbea('0x3c'));var _0x7492a0=Buffer[_0xbbea('0x3d')](_0x640075[_0xbbea('0x3e')],_0xbbea('0x2d'));return fs['writeFile'](_0x5b8698,_0x7492a0,function(_0x1b159f){_0x2f4c80(_0x1b159f);},function(_0x387a71){fs['chmodSync'](_0x5b8698,_0xbbea('0x31'));_0x40ca72(_0x387a71);});});})[_0xbbea('0x2e')](function(_0x4d99c1){_0x21cc89=path[_0xbbea('0x2a')](__dirname,_0xbbea('0x3b'),rs[_0xbbea('0x2b')](0x4)+'.wav');return convertFile(_0x5b8698,_0x21cc89);})[_0xbbea('0x2e')](function(){try{fs[_0xbbea('0x2f')](_0x5b8698);fs[_0xbbea('0x30')](_0x21cc89,'777');}catch(_0x3e0e2e){logger[_0xbbea('0x16')](_0x3e0e2e);}logger['info'](_0xbbea('0x3f'),_0x21cc89[_0xbbea('0x40')]('.')[0x0]);return _0x21cc89[_0xbbea('0x40')]('.')[0x0];});};exports['googleTTS']=function(_0x2982d2,_0x368e19){var _0x5a108e=_0xbbea('0x41');var _0x27a280,_0x37f26c;var _0x2f9c9a;var _0x965bb7={'encoding':'utf8','method':_0xbbea('0x3a'),'timeout':0x2710,'url':_0x5a108e,'headers':{'Content-Type':_0xbbea('0x42')},'body':_0xbbea('0x43')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON['stringify']([_0x2982d2,_0x368e19||'en',![],_0xbbea('0x44')]),null,_0xbbea('0x45')]]]))};return rp(_0x965bb7)[_0xbbea('0x2e')](function(_0x84281e){try{_0x2f9c9a=eval(_0x84281e[_0xbbea('0x46')](0x5))[0x0][0x2];}catch(_0x5e7e31){throw new Error(_0xbbea('0x47')+_0x84281e[_0xbbea('0x48')]);}if(!_0x2f9c9a){if(_0x2982d2[_0xbbea('0x49')]>0xc8){throw new Error(_0xbbea('0x4a'));}else{throw new Error(_0xbbea('0x4b')+_0x368e19+_0xbbea('0x4c'));}}try{_0x2f9c9a=eval(_0x2f9c9a)[0x0];}catch(_0x1bd428){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xbbea('0x48')]);}const _0x18d363=_0x2f9c9a;_0x27a280=path[_0xbbea('0x2a')](__dirname,'tmp',rs[_0xbbea('0x2b')](0x4)+_0xbbea('0x3c'));fs[_0xbbea('0x2c')](_0x27a280,_0x2f9c9a,{'encoding':'base64'});_0x37f26c=path[_0xbbea('0x2a')](__dirname,_0xbbea('0x3b'),rs[_0xbbea('0x2b')](0x4)+_0xbbea('0x4d'));return convertFile(_0x27a280,_0x37f26c);})[_0xbbea('0x2e')](function(){try{fs[_0xbbea('0x2f')](_0x27a280);fs[_0xbbea('0x30')](_0x37f26c,_0xbbea('0x31'));}catch(_0x559c86){logger[_0xbbea('0x16')](_0x559c86);}logger[_0xbbea('0x1c')](_0xbbea('0x4e'),_0x37f26c[_0xbbea('0x40')]('.')[0x0]);return _0x37f26c[_0xbbea('0x40')]('.')[0x0];});};exports[_0xbbea('0x4f')]=function(_0x37fb99,_0x61827a,_0x274dbd){return google['asr'](_0x37fb99,_0x61827a,_0x274dbd)['then'](function(_0x5c4cf7){logger['info'](_0x5c4cf7[_0xbbea('0x50')]);return rp(_0x5c4cf7);})[_0xbbea('0x2e')](function(_0x18d04d){var _0x407f0f='';var _0x5c3352=0x0;try{fs[_0xbbea('0x2f')](_0x37fb99);}catch(_0x536499){logger[_0xbbea('0x16')](_0x536499);}if(_0x18d04d&&_0x18d04d[_0xbbea('0x51')]){_0x407f0f=_0x18d04d['results'][_0xbbea('0x52')](function(_0x2ea4d5){return _0x2ea4d5&&_0x2ea4d5['alternatives'][0x0]&&_0x2ea4d5[_0xbbea('0x53')][0x0][_0xbbea('0x54')]?_0x2ea4d5[_0xbbea('0x53')][0x0][_0xbbea('0x54')]:'';})['join']('\x0a');_0x5c3352=_0x18d04d[_0xbbea('0x51')]['map'](function(_0x1cb785){return _0x1cb785&&_0x1cb785[_0xbbea('0x53')][0x0]&&_0x1cb785[_0xbbea('0x53')][0x0][_0xbbea('0x55')]?_0x1cb785[_0xbbea('0x53')][0x0]['confidence']:0x0;})[_0xbbea('0x56')]('\x0a');}logger[_0xbbea('0x1c')](_0xbbea('0x57'),_0x407f0f);logger[_0xbbea('0x1c')](_0xbbea('0x58'),_0x5c3352);return{'transcript':_0x407f0f,'confidence':_0x5c3352};})[_0xbbea('0x59')](function(_0x364654){logger['error'](_0xbbea('0x5a'),_0x364654[_0xbbea('0x15')],_0x364654[_0xbbea('0x5b')],_0x364654[_0xbbea('0x5c')]);});};exports[_0xbbea('0x5d')]=function(_0x177b2b,_0x2db4d8,_0x3d4987,_0x120aad){var _0x5955c2=apiai(_0x2db4d8,{'language':_0x120aad||'en'});return _0x5955c2['textRequest'](_0x3d4987,{'sessionId':md5(_0x177b2b)})[_0xbbea('0x2e')](function(_0x2262d5){logger['info'](JSON[_0xbbea('0x5e')](_0x2262d5));return{'source':_0x2262d5[_0xbbea('0x5f')][_0xbbea('0x60')],'resolvedQuery':_0x2262d5['result']['resolvedQuery'],'action':_0x2262d5[_0xbbea('0x5f')][_0xbbea('0x61')],'actionIncomplete':_0x2262d5[_0xbbea('0x5f')]['actionIncomplete'],'speech':_0x2262d5[_0xbbea('0x5f')]['fulfillment'][_0xbbea('0x62')],'score':_0x2262d5[_0xbbea('0x5f')][_0xbbea('0x63')],'statusCode':_0x2262d5[_0xbbea('0x64')][_0xbbea('0x65')],'endConversation':_0x2262d5[_0xbbea('0x5f')][_0xbbea('0x66')][_0xbbea('0x67')]||![],'isFallbackIntent':_0x2262d5['result'][_0xbbea('0x66')][_0xbbea('0x68')]};});};exports['googleDialogflowV2']=function(_0x4341b7,_0x53dd8c,_0x1fd212,_0x5dee79,_0x12e713,_0x5942a5){var _0x1bc5be=_0x5dee79[_0xbbea('0x69')](/\\n/g,'\x0a');var _0x4915f4={'credentials':{'private_key':_0x1bc5be,'client_email':_0x1fd212}};var _0x149ed3=new dialogflow['SessionsClient'](_0x4915f4);var _0xc3cdcf=_0x149ed3[_0xbbea('0x6a')](_0x53dd8c,md5(_0x4341b7));var _0x3eeafc={'session':_0xc3cdcf,'queryInput':{'text':{'text':_0x12e713,'languageCode':_0x5942a5}}};return _0x149ed3[_0xbbea('0x6b')](_0x3eeafc)['then'](function(_0x34feae){if(_0x34feae&&_0x34feae[_0xbbea('0x49')]){logger[_0xbbea('0x1c')](_0xbbea('0x6c'),JSON[_0xbbea('0x5e')](_0x34feae));var _0x223fec=_0x34feae[0x0];if(_0x223fec){var _0x37fe71={'action':_0x223fec[_0xbbea('0x6d')][_0xbbea('0x61')],'allRequiredParamsPresent':_0x223fec['queryResult']['allRequiredParamsPresent'],'endConversation':_0x223fec[_0xbbea('0x6d')][_0xbbea('0x6e')]&&_0x223fec[_0xbbea('0x6d')]['diagnosticInfo'][_0xbbea('0x6f')]?_0x223fec['queryResult']['diagnosticInfo'][_0xbbea('0x6f')][_0xbbea('0x70')]['boolValue']:![],'fulfillmentText':_0x223fec[_0xbbea('0x6d')][_0xbbea('0x71')],'intentName':_0x223fec[_0xbbea('0x6d')][_0xbbea('0x72')][_0xbbea('0x5b')],'intentDisplayName':_0x223fec[_0xbbea('0x6d')]['intent'][_0xbbea('0x73')],'isFallbackIntent':_0x223fec[_0xbbea('0x6d')][_0xbbea('0x72')][_0xbbea('0x74')],'languageCode':_0x223fec['queryResult']['languageCode'],'queryText':_0x223fec['queryResult'][_0xbbea('0x75')],'responseId':_0x223fec[_0xbbea('0x76')],'score':_0x223fec[_0xbbea('0x6d')][_0xbbea('0x77')],'speech':_0x223fec['queryResult']['fulfillmentText'],'providerResponse':JSON[_0xbbea('0x5e')](_0x34feae)};return _0x37fe71;}}});};exports['tildeASR']=function(_0x576147,_0x528767,_0x485b75,_0x4e2279){return tilde[_0xbbea('0x78')](_0x576147,_0x528767,_0x485b75,_0x4e2279)['then'](function(_0x1bdf56){try{fs[_0xbbea('0x2f')](_0x576147);}catch(_0xb2772){logger[_0xbbea('0x16')](_0xb2772);}logger['info'](_0xbbea('0x79'),_0x1bdf56[_0xbbea('0x54')]);logger['info'](_0xbbea('0x7a'),_0x1bdf56[_0xbbea('0x55')]);return _0x1bdf56;});};exports[_0xbbea('0x7b')]=function(_0x4d6f93,_0x9f519b,_0x1756d7,_0x106d90,_0x34a25e,_0x44ea30){var _0x3e7274=path[_0xbbea('0x2a')](__dirname,_0xbbea('0x3b'),rs[_0xbbea('0x2b')](0x4)+_0xbbea('0x3c'));var _0x29ad1b;return aws[_0xbbea('0x7c')](_0x4d6f93,_0x9f519b,_0x1756d7,_0x106d90,_0x34a25e,_0x44ea30,_0x3e7274)['then'](function(){_0x29ad1b=path[_0xbbea('0x2a')](__dirname,_0xbbea('0x3b'),rs[_0xbbea('0x2b')](0x4)+_0xbbea('0x4d'));return convertFile(_0x3e7274,_0x29ad1b);})[_0xbbea('0x2e')](function(){try{fs[_0xbbea('0x2f')](_0x3e7274);fs['chmodSync'](_0x29ad1b,_0xbbea('0x31'));}catch(_0x2bddc0){logger[_0xbbea('0x16')](_0x2bddc0);}return _0x29ad1b[_0xbbea('0x40')]('.')[0x0];});};exports[_0xbbea('0x7d')]=function(_0x436adc,_0x5e95d5,_0xbb3cca,_0x3f885c,_0x47a640,_0x23badd){return aws[_0xbbea('0x7e')](_0x436adc,_0x5e95d5,_0xbb3cca,_0x3f885c,_0x47a640,_0x23badd)[_0xbbea('0x2e')](function(_0x5d730d){logger[_0xbbea('0x1c')](JSON[_0xbbea('0x5e')](_0x5d730d));return _0x5d730d;});};exports['ispeechTTS']=function(_0x4c6a0d,_0x2ad73f,_0x3ad73c,_0x4477a4){var _0x358434=util[_0xbbea('0x7f')](_0xbbea('0x80'),ISPEECH_API,_0x4c6a0d,encodeURIComponent(_0x2ad73f),_0x3ad73c,_0x4477a4);var _0x1e5e07=path[_0xbbea('0x2a')](__dirname,_0xbbea('0x3b'),rs['generate'](0x4)+_0xbbea('0x3c'));var _0x208367;return downloadFile(_0x358434,_0x1e5e07)['then'](function(){_0x208367=path[_0xbbea('0x2a')](__dirname,_0xbbea('0x3b'),rs[_0xbbea('0x2b')](0x4)+_0xbbea('0x4d'));return convertFile(_0x1e5e07,_0x208367);})[_0xbbea('0x2e')](function(){try{fs[_0xbbea('0x2f')](_0x1e5e07);fs[_0xbbea('0x30')](_0x208367,'777');}catch(_0x50616c){logger['error'](_0x50616c);}return _0x208367[_0xbbea('0x40')]('.')[0x0];});};exports[_0xbbea('0x81')]=function(_0x1718c8,_0x1d475e,_0x5b126c,_0x483ceb){var _0x1c8481=util['format'](_0xbbea('0x82'),ISPEECH_API,_0x1d475e,_0x5b126c,base64Encode(_0x1718c8),_0x483ceb?util[_0xbbea('0x7f')](_0xbbea('0x83'),encodeURIComponent(_0x483ceb)):_0xbbea('0x84'));return uploadFile(_0x1c8481)[_0xbbea('0x2e')](function(_0x4f02b6){return querystring[_0xbbea('0xa')](_0x4f02b6);});};exports[_0xbbea('0x85')]=function(_0xd143c7,_0x2929b6){return sestek[_0xbbea('0x86')](_0xd143c7,_0x2929b6)[_0xbbea('0x2e')](function(_0x1e9451){logger[_0xbbea('0x1c')](JSON['stringify'](_0x1e9451));var _0x31e850={'speech':_0x1e9451[_0xbbea('0x87')],'action':_0x1e9451['channelData']?_0x1e9451[_0xbbea('0x88')][_0xbbea('0x89')]:undefined,'actiondata':_0x1e9451['channelData']?_0x1e9451['channelData'][_0xbbea('0x8a')]:undefined};if(_0x1e9451[_0xbbea('0x88')]&&_0x1e9451[_0xbbea('0x88')][_0xbbea('0x8b')]){return base64Decode(_0x1e9451[_0xbbea('0x88')][_0xbbea('0x8b')][_0xbbea('0x8c')],path[_0xbbea('0x2a')](__dirname,_0xbbea('0x3b'),rs[_0xbbea('0x2b')](0x4)+_0xbbea('0x4d')))[_0xbbea('0x2e')](function(_0x5a0496){_0x31e850[_0xbbea('0x8d')]=_0x5a0496;return _0x31e850;});}return _0x31e850;});};exports[_0xbbea('0x8e')]=function(){return __dirname;};
\ No newline at end of file
+var _0xc022=['boolValue','fulfillmentText','intent','isFallback','queryText','responseId','intentDetectionConfidence','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','http','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','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','close','unlink','pipe','end','data','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','text:synthesize','.mp3','from','writeFile','then','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','action','fulfillment','speech','score','code','endConversation','metadata','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','end_conversation'];(function(_0x4abfff,_0xc39376){var _0x22e476=function(_0x27a2bf){while(--_0x27a2bf){_0x4abfff['push'](_0x4abfff['shift']());}};_0x22e476(++_0xc39376);}(_0xc022,0x1b0));var _0x2c02=function(_0x209581,_0x11f596){_0x209581=_0x209581-0x0;var _0x2fed45=_0xc022[_0x209581];return _0x2fed45;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x2c02('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x2c02('0x1'));var https=require(_0x2c02('0x2'));var md5=require(_0x2c02('0x3'));var path=require(_0x2c02('0x4'));var querystring=require(_0x2c02('0x5'));var rp=require(_0x2c02('0x6'));var rs=require(_0x2c02('0x7'));var sox=require(_0x2c02('0x8'));var tts=require('google-tts-api');var urlParse=require(_0x2c02('0x9'))[_0x2c02('0xa')];var util=require(_0x2c02('0xb'));var aws=require(_0x2c02('0xc'));var google=require('./google');var sestek=require(_0x2c02('0xd'));var tilde=require(_0x2c02('0xe'));var logger=require(_0x2c02('0xf'))('agi');var ISPEECH_API=_0x2c02('0x10');function downloadFile(_0x55445f,_0x197976){return new BPromise(function(_0x4ca665,_0xd43ae9){var _0x2504fc=urlParse(_0x55445f);var _0x81781e=_0x2504fc[_0x2c02('0x11')]===_0x2c02('0x12')?https:http;var _0x32eb04={'host':_0x2504fc[_0x2c02('0x13')],'path':_0x2504fc[_0x2c02('0x4')],'headers':{'user-agent':_0x2c02('0x14')}};_0x81781e[_0x2c02('0x15')](_0x32eb04,function(_0x50a534){if(_0x50a534[_0x2c02('0x16')]!==0xc8){logger[_0x2c02('0x17')](_0x2c02('0x18')+_0x55445f+_0x2c02('0x19')+_0x50a534['statusCode']+'\x20('+_0x50a534[_0x2c02('0x1a')]+')');_0xd43ae9(new Error(_0x2c02('0x18')+_0x55445f+_0x2c02('0x19')+_0x50a534['statusCode']+'\x20('+_0x50a534[_0x2c02('0x1a')]+')'));return;}var _0x3700b7=fs[_0x2c02('0x1b')](_0x197976);_0x3700b7['on'](_0x2c02('0x1c'),function(){logger[_0x2c02('0x1d')]('finish\x20download\x20file');_0x3700b7[_0x2c02('0x1e')](_0x4ca665);});_0x3700b7['on']('error',function(_0x93848c){fs[_0x2c02('0x1f')](_0x197976);logger[_0x2c02('0x17')]('download\x20error',_0x93848c);_0xd43ae9(_0x93848c);});_0x50a534[_0x2c02('0x20')](_0x3700b7);})['on'](_0x2c02('0x17'),function(_0x34ccc1){logger[_0x2c02('0x17')](_0x34ccc1);_0xd43ae9(_0x34ccc1);})[_0x2c02('0x21')]();});}function uploadFile(_0x63dd0d){return new BPromise(function(_0x386b57,_0x1581fd){var _0x31bbb5=urlParse(_0x63dd0d);var _0x5c1bd7=_0x31bbb5[_0x2c02('0x11')]===_0x2c02('0x12')?https:http;var _0x2e40d7={'host':_0x31bbb5[_0x2c02('0x13')],'path':_0x31bbb5[_0x2c02('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x5c1bd7[_0x2c02('0x15')](_0x2e40d7,function(_0x26ebd8){if(_0x26ebd8[_0x2c02('0x16')]!==0xc8){_0x1581fd(new Error(_0x2c02('0x18')+_0x63dd0d+_0x2c02('0x19')+_0x26ebd8['statusCode']+'\x20('+_0x26ebd8['statusMessage']+')'));return;}var _0x4924b7='';_0x26ebd8['on'](_0x2c02('0x22'),function(_0x5b301e){_0x4924b7+=_0x5b301e;});_0x26ebd8['on'](_0x2c02('0x21'),function(){_0x386b57(_0x4924b7);});})['on'](_0x2c02('0x17'),function(_0x1c7324){_0x1581fd(_0x1c7324);})['end']();});}function convertFile(_0x3a673a,_0x570c12){return new BPromise(function(_0x45dfc3,_0x3b7384){var _0x47df4c=sox['transcode'](_0x3a673a,_0x570c12,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x47df4c['on'](_0x2c02('0x17'),function(_0x4e9976){logger[_0x2c02('0x17')](_0x2c02('0x23'),_0x4e9976);_0x3b7384(_0x4e9976);});_0x47df4c['on']('end',function(){logger[_0x2c02('0x1d')](_0x2c02('0x24'));_0x45dfc3();});_0x47df4c['start']();});}function base64Decode(_0x60de0e,_0x45d3f1){var _0x38b2c7=path[_0x2c02('0x25')](__dirname,_0x2c02('0x26'),rs[_0x2c02('0x27')](0x4)+_0x2c02('0x28'));fs[_0x2c02('0x29')](_0x38b2c7,_0x60de0e,_0x2c02('0x2a'));return convertFile(_0x38b2c7,_0x45d3f1)['then'](function(){try{fs[_0x2c02('0x1f')](_0x38b2c7);fs[_0x2c02('0x2b')](_0x45d3f1,_0x2c02('0x2c'));}catch(_0x204806){logger[_0x2c02('0x17')](_0x204806);}return _0x45d3f1['split']('.')[0x0];});}function base64Encode(_0xdbe7b3){var _0x6bcfc1=fs[_0x2c02('0x2d')](_0xdbe7b3);return new Buffer(_0x6bcfc1)[_0x2c02('0x2e')](_0x2c02('0x2a'));}exports[_0x2c02('0x2f')]=function(_0x5bcf32,_0x330338,_0xbbe655,_0x2230c6,_0x1f5be0,_0x1b9e76){var _0x483a4c,_0x58fda2;var _0x15dff3=_0x2c02('0x30');var _0x32970c=_0x2c02('0x31')+_0x5bcf32;var _0x433f7e={};if(_0x330338==='ssml'){_0x433f7e['input']={'ssml':_0xbbe655};}else{_0x433f7e[_0x2c02('0x32')]={'text':_0xbbe655};};_0x433f7e['voice']={'languageCode':_0x2230c6,'ssmlGender':_0x1f5be0};_0x433f7e[_0x2c02('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x247229={'url':_0x15dff3+_0x2c02('0x34')+_0x32970c,'method':'POST','json':!![],'body':_0x433f7e};return rp(_0x247229)['then'](function(_0x2da088){return new BPromise(function(_0x38a0dc,_0xbabaeb){_0x483a4c=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x2c02('0x35'));var _0x43a6ce=Buffer[_0x2c02('0x36')](_0x2da088['audioContent'],_0x2c02('0x2a'));return fs[_0x2c02('0x37')](_0x483a4c,_0x43a6ce,function(_0xc0c4ec){_0xbabaeb(_0xc0c4ec);},function(_0x277d29){fs['chmodSync'](_0x483a4c,_0x2c02('0x2c'));_0x38a0dc(_0x277d29);});});})[_0x2c02('0x38')](function(_0x2273c4){_0x58fda2=path['resolve'](__dirname,_0x2c02('0x26'),rs[_0x2c02('0x27')](0x4)+_0x2c02('0x28'));return convertFile(_0x483a4c,_0x58fda2);})['then'](function(){try{fs['unlink'](_0x483a4c);fs[_0x2c02('0x2b')](_0x58fda2,_0x2c02('0x2c'));}catch(_0x47775b){logger['error'](_0x47775b);}logger['info']('googleCloudTTS\x20path',_0x58fda2['split']('.')[0x0]);return _0x58fda2[_0x2c02('0x39')]('.')[0x0];});};exports[_0x2c02('0x3a')]=function(_0x464505,_0xfa22d4){var _0x46ccea=_0x2c02('0x3b');var _0xcb1c4a,_0x2e63f5;var _0xb0924a;var _0x54e836={'encoding':_0x2c02('0x3c'),'method':_0x2c02('0x3d'),'timeout':0x2710,'url':_0x46ccea,'headers':{'Content-Type':_0x2c02('0x3e')},'body':_0x2c02('0x3f')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x2c02('0x40')]([_0x464505,_0xfa22d4||'en',![],'null']),null,'generic']]]))};return rp(_0x54e836)[_0x2c02('0x38')](function(_0x1fa285){try{_0xb0924a=eval(_0x1fa285[_0x2c02('0x41')](0x5))[0x0][0x2];}catch(_0x3f812e){throw new Error(_0x2c02('0x42')+_0x1fa285['data']);}if(!_0xb0924a){if(_0x464505['length']>0xc8){throw new Error(_0x2c02('0x43'));}else{throw new Error(_0x2c02('0x44')+_0xfa22d4+'\x22\x20might\x20not\x20exist');}}try{_0xb0924a=eval(_0xb0924a)[0x0];}catch(_0x2215ce){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x2c02('0x22')]);}const _0x2c77a8=_0xb0924a;_0xcb1c4a=path[_0x2c02('0x25')](__dirname,_0x2c02('0x26'),rs[_0x2c02('0x27')](0x4)+_0x2c02('0x35'));fs[_0x2c02('0x29')](_0xcb1c4a,_0xb0924a,{'encoding':'base64'});_0x2e63f5=path[_0x2c02('0x25')](__dirname,_0x2c02('0x26'),rs[_0x2c02('0x27')](0x4)+_0x2c02('0x28'));return convertFile(_0xcb1c4a,_0x2e63f5);})[_0x2c02('0x38')](function(){try{fs[_0x2c02('0x1f')](_0xcb1c4a);fs[_0x2c02('0x2b')](_0x2e63f5,_0x2c02('0x2c'));}catch(_0x102736){logger[_0x2c02('0x17')](_0x102736);}logger[_0x2c02('0x1d')](_0x2c02('0x45'),_0x2e63f5[_0x2c02('0x39')]('.')[0x0]);return _0x2e63f5[_0x2c02('0x39')]('.')[0x0];});};exports[_0x2c02('0x46')]=function(_0x34aa7b,_0x18e4ef,_0x53ff95){return google['asr'](_0x34aa7b,_0x18e4ef,_0x53ff95)[_0x2c02('0x38')](function(_0xc6ee72){logger[_0x2c02('0x1d')](_0xc6ee72[_0x2c02('0x47')]);return rp(_0xc6ee72);})[_0x2c02('0x38')](function(_0x4d7907){var _0x4c92fe='';var _0x18d869=0x0;try{fs['unlink'](_0x34aa7b);}catch(_0x282469){logger['error'](_0x282469);}if(_0x4d7907&&_0x4d7907[_0x2c02('0x48')]){_0x4c92fe=_0x4d7907[_0x2c02('0x48')][_0x2c02('0x49')](function(_0x21f5de){return _0x21f5de&&_0x21f5de['alternatives'][0x0]&&_0x21f5de[_0x2c02('0x4a')][0x0][_0x2c02('0x4b')]?_0x21f5de[_0x2c02('0x4a')][0x0][_0x2c02('0x4b')]:'';})[_0x2c02('0x4c')]('\x0a');_0x18d869=_0x4d7907[_0x2c02('0x48')][_0x2c02('0x49')](function(_0x225d91){return _0x225d91&&_0x225d91[_0x2c02('0x4a')][0x0]&&_0x225d91['alternatives'][0x0][_0x2c02('0x4d')]?_0x225d91['alternatives'][0x0][_0x2c02('0x4d')]:0x0;})[_0x2c02('0x4c')]('\x0a');}logger['info'](_0x2c02('0x4e'),_0x4c92fe);logger['info'](_0x2c02('0x4f'),_0x18d869);return{'transcript':_0x4c92fe,'confidence':_0x18d869};})['catch'](function(_0x34a71b){logger['error'](_0x2c02('0x50'),_0x34a71b[_0x2c02('0x16')],_0x34a71b[_0x2c02('0x51')],_0x34a71b[_0x2c02('0x52')]);});};exports[_0x2c02('0x53')]=function(_0x3226b6,_0x32714b,_0x1990c0,_0x325b46){var _0xfa7dc1=apiai(_0x32714b,{'language':_0x325b46||'en'});return _0xfa7dc1[_0x2c02('0x54')](_0x1990c0,{'sessionId':md5(_0x3226b6)})['then'](function(_0x53e3ea){logger['info'](JSON['stringify'](_0x53e3ea));return{'source':_0x53e3ea[_0x2c02('0x55')][_0x2c02('0x56')],'resolvedQuery':_0x53e3ea[_0x2c02('0x55')]['resolvedQuery'],'action':_0x53e3ea['result'][_0x2c02('0x57')],'actionIncomplete':_0x53e3ea[_0x2c02('0x55')]['actionIncomplete'],'speech':_0x53e3ea[_0x2c02('0x55')][_0x2c02('0x58')][_0x2c02('0x59')],'score':_0x53e3ea[_0x2c02('0x55')][_0x2c02('0x5a')],'statusCode':_0x53e3ea['status'][_0x2c02('0x5b')],'endConversation':_0x53e3ea[_0x2c02('0x55')]['metadata'][_0x2c02('0x5c')]||![],'isFallbackIntent':_0x53e3ea['result'][_0x2c02('0x5d')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x303de6,_0x15124e,_0x12656a,_0x5be67f,_0x12394f,_0x500fc0){var _0x5d1844=_0x5be67f[_0x2c02('0x5e')](/\\n/g,'\x0a');var _0x52a9e7={'credentials':{'private_key':_0x5d1844,'client_email':_0x12656a}};var _0x18cdae=new dialogflow[(_0x2c02('0x5f'))](_0x52a9e7);var _0x3073cd=_0x18cdae[_0x2c02('0x60')](_0x15124e,md5(_0x303de6));var _0x270926={'session':_0x3073cd,'queryInput':{'text':{'text':_0x12394f,'languageCode':_0x500fc0}}};return _0x18cdae[_0x2c02('0x61')](_0x270926)[_0x2c02('0x38')](function(_0x46a66f){if(_0x46a66f&&_0x46a66f[_0x2c02('0x62')]){logger[_0x2c02('0x1d')](_0x2c02('0x63'),JSON[_0x2c02('0x40')](_0x46a66f));var _0x39f8a6=_0x46a66f[0x0];if(_0x39f8a6){var _0x1e96dc={'action':_0x39f8a6[_0x2c02('0x64')][_0x2c02('0x57')],'allRequiredParamsPresent':_0x39f8a6[_0x2c02('0x64')][_0x2c02('0x65')],'endConversation':_0x39f8a6[_0x2c02('0x64')][_0x2c02('0x66')]&&_0x39f8a6[_0x2c02('0x64')]['diagnosticInfo']['fields']?_0x39f8a6['queryResult'][_0x2c02('0x66')]['fields'][_0x2c02('0x67')][_0x2c02('0x68')]:![],'fulfillmentText':_0x39f8a6[_0x2c02('0x64')][_0x2c02('0x69')],'intentName':_0x39f8a6['queryResult'][_0x2c02('0x6a')][_0x2c02('0x51')],'intentDisplayName':_0x39f8a6[_0x2c02('0x64')][_0x2c02('0x6a')]['displayName'],'isFallbackIntent':_0x39f8a6['queryResult']['intent'][_0x2c02('0x6b')],'languageCode':_0x39f8a6[_0x2c02('0x64')]['languageCode'],'queryText':_0x39f8a6['queryResult'][_0x2c02('0x6c')],'responseId':_0x39f8a6[_0x2c02('0x6d')],'score':_0x39f8a6['queryResult'][_0x2c02('0x6e')],'speech':_0x39f8a6[_0x2c02('0x64')][_0x2c02('0x69')],'providerResponse':JSON['stringify'](_0x46a66f)};return _0x1e96dc;}}});};exports['tildeASR']=function(_0x15a20d,_0x247bcf,_0x4aee84,_0x14609f){return tilde[_0x2c02('0x6f')](_0x15a20d,_0x247bcf,_0x4aee84,_0x14609f)[_0x2c02('0x38')](function(_0x50fc64){try{fs[_0x2c02('0x1f')](_0x15a20d);}catch(_0x1d6fec){logger[_0x2c02('0x17')](_0x1d6fec);}logger[_0x2c02('0x1d')](_0x2c02('0x70'),_0x50fc64[_0x2c02('0x4b')]);logger['info'](_0x2c02('0x71'),_0x50fc64[_0x2c02('0x4d')]);return _0x50fc64;});};exports[_0x2c02('0x72')]=function(_0x5e89fc,_0x27fcae,_0x2fe3ec,_0x51e3e4,_0x1f93b0,_0x3141e8){var _0x490cf0=path[_0x2c02('0x25')](__dirname,_0x2c02('0x26'),rs[_0x2c02('0x27')](0x4)+_0x2c02('0x35'));var _0xb490;return aws[_0x2c02('0x73')](_0x5e89fc,_0x27fcae,_0x2fe3ec,_0x51e3e4,_0x1f93b0,_0x3141e8,_0x490cf0)[_0x2c02('0x38')](function(){_0xb490=path[_0x2c02('0x25')](__dirname,_0x2c02('0x26'),rs['generate'](0x4)+'.wav');return convertFile(_0x490cf0,_0xb490);})['then'](function(){try{fs[_0x2c02('0x1f')](_0x490cf0);fs[_0x2c02('0x2b')](_0xb490,_0x2c02('0x2c'));}catch(_0x350648){logger[_0x2c02('0x17')](_0x350648);}return _0xb490[_0x2c02('0x39')]('.')[0x0];});};exports[_0x2c02('0x74')]=function(_0x505410,_0x21c16f,_0x1d09d4,_0xeab723,_0x5b2d17,_0x133eb1){return aws[_0x2c02('0x75')](_0x505410,_0x21c16f,_0x1d09d4,_0xeab723,_0x5b2d17,_0x133eb1)[_0x2c02('0x38')](function(_0x246901){logger['info'](JSON[_0x2c02('0x40')](_0x246901));return _0x246901;});};exports[_0x2c02('0x76')]=function(_0x21983c,_0x2c8f28,_0x21af09,_0x402ab1){var _0x26819e=util['format'](_0x2c02('0x77'),ISPEECH_API,_0x21983c,encodeURIComponent(_0x2c8f28),_0x21af09,_0x402ab1);var _0xef7f84=path[_0x2c02('0x25')](__dirname,'tmp',rs[_0x2c02('0x27')](0x4)+_0x2c02('0x35'));var _0x2a69a8;return downloadFile(_0x26819e,_0xef7f84)[_0x2c02('0x38')](function(){_0x2a69a8=path['resolve'](__dirname,_0x2c02('0x26'),rs[_0x2c02('0x27')](0x4)+_0x2c02('0x28'));return convertFile(_0xef7f84,_0x2a69a8);})[_0x2c02('0x38')](function(){try{fs[_0x2c02('0x1f')](_0xef7f84);fs[_0x2c02('0x2b')](_0x2a69a8,_0x2c02('0x2c'));}catch(_0x181b0f){logger[_0x2c02('0x17')](_0x181b0f);}return _0x2a69a8[_0x2c02('0x39')]('.')[0x0];});};exports[_0x2c02('0x78')]=function(_0x8dfdcd,_0x29c6a8,_0x189dcf,_0x43549e){var _0x36db0f=util[_0x2c02('0x79')](_0x2c02('0x7a'),ISPEECH_API,_0x29c6a8,_0x189dcf,base64Encode(_0x8dfdcd),_0x43549e?util[_0x2c02('0x79')](_0x2c02('0x7b'),encodeURIComponent(_0x43549e)):_0x2c02('0x7c'));return uploadFile(_0x36db0f)[_0x2c02('0x38')](function(_0x230950){return querystring[_0x2c02('0xa')](_0x230950);});};exports[_0x2c02('0x7d')]=function(_0x44f2e7,_0x4fa422){return sestek['nda'](_0x44f2e7,_0x4fa422)['then'](function(_0x110f10){logger[_0x2c02('0x1d')](JSON[_0x2c02('0x40')](_0x110f10));var _0x30a41b={'speech':_0x110f10[_0x2c02('0x7e')],'action':_0x110f10[_0x2c02('0x7f')]?_0x110f10['channelData'][_0x2c02('0x80')]:undefined,'actiondata':_0x110f10['channelData']?_0x110f10[_0x2c02('0x7f')][_0x2c02('0x81')]:undefined};if(_0x110f10['channelData']&&_0x110f10['channelData'][_0x2c02('0x82')]){return base64Decode(_0x110f10[_0x2c02('0x7f')][_0x2c02('0x82')][_0x2c02('0x83')],path[_0x2c02('0x25')](__dirname,_0x2c02('0x26'),rs[_0x2c02('0x27')](0x4)+_0x2c02('0x28')))['then'](function(_0xb01240){_0x30a41b[_0x2c02('0x84')]=_0xb01240;return _0x30a41b;});}return _0x30a41b;});};exports[_0x2c02('0x85')]=function(){return __dirname;};
\ No newline at end of file
index d3eab5c..8f34e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6792=['./nda','exports'];(function(_0xf04579,_0x3c29f5){var _0x1ecd4d=function(_0x1decd0){while(--_0x1decd0){_0xf04579['push'](_0xf04579['shift']());}};_0x1ecd4d(++_0x3c29f5);}(_0x6792,0x188));var _0x2679=function(_0x4929c4,_0x5a0c8d){_0x4929c4=_0x4929c4-0x0;var _0x153694=_0x6792[_0x4929c4];return _0x153694;};var nda=require(_0x2679('0x0'));module[_0x2679('0x1')]={'nda':nda};
\ No newline at end of file
+var nda=require('./nda');module['exports']={'nda':nda};
\ No newline at end of file
index 4c743b6..949101f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d8=['audio/wav','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','../../../../../config/logger','exports','resolve','ndauth_url','/token','password','username','then','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','text','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x1c7bcd,_0x478875){_0x1c7bcd=_0x1c7bcd-0x0;var _0x554320=_0xc6d8[_0x1c7bcd];return _0x554320;};'use strict';var rp=require(_0x8c6d('0x0'));var url=require('url');var logger=require(_0x8c6d('0x1'))('agi');module[_0x8c6d('0x2')]=function(_0x5974d3,_0x292852){var _0x4fa8a4={'method':'POST','uri':url[_0x8c6d('0x3')](_0x292852[_0x8c6d('0x4')],_0x8c6d('0x5')),'form':{'grant_type':_0x8c6d('0x6'),'username':_0x292852[_0x8c6d('0x7')],'password':_0x292852[_0x8c6d('0x6')]},'json':!![]};return rp(_0x4fa8a4)[_0x8c6d('0x8')](function(_0x5529f1){var _0x1496ba={'method':_0x8c6d('0x9'),'uri':url[_0x8c6d('0x3')](_0x292852['ndassistant_url'],_0x8c6d('0xa')),'body':{'type':_0x292852[_0x8c6d('0xb')]||_0x8c6d('0xc'),'channelId':_0x8c6d('0xd'),'conversation':{'id':_0x5974d3[_0x8c6d('0xe')]},'from':{'id':_0x5974d3[_0x8c6d('0xf')],'name':_0x5974d3[_0x8c6d('0x10')]},'recipient':{'id':_0x5974d3[_0x8c6d('0x11')],'name':_0x5974d3['extension']},'text':_0x292852[_0x8c6d('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x5529f1['access_token']},'json':!![]};if(_0x292852[_0x8c6d('0x13')]){_0x1496ba[_0x8c6d('0x14')][_0x8c6d('0x15')][_0x8c6d('0x16')]=_0x292852[_0x8c6d('0x13')];}if(_0x292852[_0x8c6d('0x17')]=='1'){_0x1496ba[_0x8c6d('0x14')][_0x8c6d('0x15')][_0x8c6d('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8c6d('0x19')};}if(_0x292852['custom_action']){_0x1496ba[_0x8c6d('0x14')]['channelData'][_0x8c6d('0x1a')]=_0x292852['custom_action'];if(_0x292852[_0x8c6d('0x1b')]){_0x1496ba[_0x8c6d('0x14')]['channelData'][_0x8c6d('0x1c')]=_0x292852[_0x8c6d('0x1b')];}}logger['info'](JSON[_0x8c6d('0x1d')](_0x1496ba));return rp(_0x1496ba);});};
\ No newline at end of file
+var _0x92d7=['resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','dnid','extension','access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST'];(function(_0x345a58,_0x16678f){var _0x542ad6=function(_0x1cc508){while(--_0x1cc508){_0x345a58['push'](_0x345a58['shift']());}};_0x542ad6(++_0x16678f);}(_0x92d7,0x17b));var _0x792d=function(_0x340e32,_0x19fb13){_0x340e32=_0x340e32-0x0;var _0x2bb467=_0x92d7[_0x340e32];return _0x2bb467;};'use strict';var rp=require(_0x792d('0x0'));var url=require('url');var logger=require(_0x792d('0x1'))(_0x792d('0x2'));module[_0x792d('0x3')]=function(_0xed6481,_0x46982d){var _0x1434c9={'method':_0x792d('0x4'),'uri':url[_0x792d('0x5')](_0x46982d[_0x792d('0x6')],_0x792d('0x7')),'form':{'grant_type':'password','username':_0x46982d[_0x792d('0x8')],'password':_0x46982d[_0x792d('0x9')]},'json':!![]};return rp(_0x1434c9)[_0x792d('0xa')](function(_0x11240a){var _0x56f730={'method':_0x792d('0x4'),'uri':url[_0x792d('0x5')](_0x46982d[_0x792d('0xb')],_0x792d('0xc')),'body':{'type':_0x46982d[_0x792d('0xd')]||_0x792d('0xe'),'channelId':_0x792d('0xf'),'conversation':{'id':_0xed6481['uniqueid']},'from':{'id':_0xed6481[_0x792d('0x10')],'name':_0xed6481['calleridname']},'recipient':{'id':_0xed6481[_0x792d('0x11')],'name':_0xed6481[_0x792d('0x12')]},'text':_0x46982d['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x11240a[_0x792d('0x13')]},'json':!![]};if(_0x46982d[_0x792d('0x14')]){_0x56f730[_0x792d('0x15')]['channelData'][_0x792d('0x16')]=_0x46982d[_0x792d('0x14')];}if(_0x46982d[_0x792d('0x17')]=='1'){_0x56f730[_0x792d('0x15')][_0x792d('0x18')][_0x792d('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x792d('0x1a')};}if(_0x46982d[_0x792d('0x1b')]){_0x56f730[_0x792d('0x15')][_0x792d('0x18')][_0x792d('0x1c')]=_0x46982d[_0x792d('0x1b')];if(_0x46982d[_0x792d('0x1d')]){_0x56f730[_0x792d('0x15')][_0x792d('0x18')]['CustomActionData']=_0x46982d[_0x792d('0x1d')];}}logger[_0x792d('0x1e')](JSON[_0x792d('0x1f')](_0x56f730));return rp(_0x56f730);});};
\ No newline at end of file
index cb36143..c156c76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f69=['./lib/api','exports'];(function(_0x1c37c4,_0x495441){var _0x29fad3=function(_0x4fe1b7){while(--_0x4fe1b7){_0x1c37c4['push'](_0x1c37c4['shift']());}};_0x29fad3(++_0x495441);}(_0x1f69,0xd4));var _0x91f6=function(_0xa98a54,_0x569750){_0xa98a54=_0xa98a54-0x0;var _0xcbe398=_0x1f69[_0xa98a54];return _0xcbe398;};'use strict';var asr=require(_0x91f6('0x0'));module[_0x91f6('0x1')]=function(_0xdcf36c,_0xa4beb1,_0x5531bb,_0xd69ed7){return asr(_0xdcf36c,_0xa4beb1,_0x5531bb,_0xd69ed7);};
\ No newline at end of file
+var _0x16e9=['exports','./lib/api'];(function(_0x293f0a,_0x475c08){var _0x515102=function(_0x11d2c2){while(--_0x11d2c2){_0x293f0a['push'](_0x293f0a['shift']());}};_0x515102(++_0x475c08);}(_0x16e9,0x197));var _0x916e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x16e9[_0x20a584];return _0x4b41a8;};'use strict';var asr=require(_0x916e('0x0'));module[_0x916e('0x1')]=function(_0x26d532,_0x33a4b7,_0x1fdf73,_0xe3fde1){return asr(_0x26d532,_0x33a4b7,_0x1fdf73,_0xe3fde1);};
\ No newline at end of file
index 4ed4af3..22bbda3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3525=['EOS','Tilde\x20ASR\x20send\x20error','terminate','status','result','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','send','stringify','createReadStream','data','close'];(function(_0x56b4a6,_0x4857f5){var _0x4818fa=function(_0x3a622f){while(--_0x3a622f){_0x56b4a6['push'](_0x56b4a6['shift']());}};_0x4818fa(++_0x4857f5);}(_0x3525,0x14a));var _0x5352=function(_0x9896e0,_0x69e1a7){_0x9896e0=_0x9896e0-0x0;var _0x293718=_0x3525[_0x9896e0];return _0x293718;};'use strict';var BPromise=require(_0x5352('0x0'));var _=require(_0x5352('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x5352('0x2'));var crypto=require(_0x5352('0x3'));var logger=require(_0x5352('0x4'))(_0x5352('0x5'));module[_0x5352('0x6')]=function(_0x400aae,_0x5779f6,_0x2b589d,_0x2e336f){return new BPromise(function(_0x447569,_0x1d7bea){logger[_0x5352('0x7')](_0x5352('0x8'),_0x2e336f||_0x5352('0x9'));var _0x42c7d1=new WebSocket(_0x2e336f||_0x5352('0x9'),{'perMessageDeflate':![]});var _0x577668='';var _0x5807fd='0';var _0x2d1e90='1';var _0x250c95=_0x5352('0xa');function _0x4c5e00(_0x520e98){var _0x142376=crypto[_0x5352('0xb')](_0x5352('0xc'));_0x142376[_0x5352('0xd')](_0x520e98);return _0x142376[_0x5352('0xe')](_0x5352('0xf'));}function _0x2917a5(){try{logger[_0x5352('0x7')]('Open\x20Tilde\x20ASR\x20socket');var _0x7c97ae=moment()['unix']();var _0x143115=_0x4c5e00(_0x7c97ae+_0x5779f6+_0x2b589d);_0x42c7d1[_0x5352('0x10')](JSON[_0x5352('0x11')]({'appID':_0x5779f6,'timestamp':_0x7c97ae,'appKey':_0x143115}));var _0x4b49c3=fs[_0x5352('0x12')](_0x400aae);_0x4b49c3['on'](_0x5352('0x13'),function(_0x478cbc){_0x42c7d1['send'](_0x478cbc);});_0x4b49c3['on'](_0x5352('0x14'),function(){_0x42c7d1[_0x5352('0x10')](_0x5352('0x15'));});}catch(_0x5c913a){logger['error'](_0x5352('0x16'),JSON[_0x5352('0x11')](_0x5c913a));_0x42c7d1[_0x5352('0x17')]();}}function _0x5c2682(_0x53441c){try{if(_0x53441c){var _0x12c666=JSON['parse'](_0x53441c);switch(_0x12c666[_0x5352('0x18')]){case 0x0:if(_0x12c666[_0x5352('0x19')]){if(_0x12c666['result']['final']){logger[_0x5352('0x7')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x12c666[_0x5352('0x19')]['hypotheses']));_0x577668=_0x12c666[_0x5352('0x19')][_0x5352('0x1a')][0x0]['transcript'];_0x5807fd=_0x12c666[_0x5352('0x19')][_0x5352('0x1a')][0x0][_0x5352('0x1b')];_0x2d1e90='0';_0x250c95=_0x5352('0x1c');_0x42c7d1[_0x5352('0x17')]();}}break;case 0x1:logger[_0x5352('0x7')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2d1e90='1';_0x250c95=_0x5352('0xa');break;case 0x2:logger[_0x5352('0x7')](_0x5352('0x1d'));_0x2d1e90='2';_0x250c95=_0x5352('0x1d');break;case 0x9:logger[_0x5352('0x7')](_0x5352('0x1e'));_0x2d1e90='9';_0x250c95='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x5352('0x7')](_0x5352('0x1f'));_0x2d1e90='10';_0x250c95=_0x5352('0x1f');break;case 0xb:logger[_0x5352('0x7')](_0x5352('0x20'));_0x2d1e90='11';_0x250c95='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x4fdd75){logger[_0x5352('0x21')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x5352('0x11')](_0x4fdd75));_0x42c7d1[_0x5352('0x17')]();}}function _0x42fe53(){logger['info'](_0x5352('0x22'));_0x447569({'transcript':_0x577668,'confidence':_0x5807fd,'status':_0x2d1e90,'status_message':_0x250c95});}function _0x11d526(_0x38b280){logger[_0x5352('0x21')](_0x5352('0x23'));if(!_[_0x5352('0x24')](_0x38b280)){logger[_0x5352('0x21')](_['isObject'](_0x38b280)?JSON[_0x5352('0x11')](_0x38b280):_0x38b280);}}_0x42c7d1['on'](_0x5352('0x25'),_0x2917a5);_0x42c7d1['on'](_0x5352('0x26'),_0x5c2682);_0x42c7d1['on'](_0x5352('0x14'),_0x42fe53);_0x42c7d1['on']('error',_0x11d526);});};
\ No newline at end of file
+var _0x2d5d=['stringify','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','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','bluebird','moment','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','send'];(function(_0x588d0a,_0x5e6223){var _0x2c2912=function(_0x56603c){while(--_0x56603c){_0x588d0a['push'](_0x588d0a['shift']());}};_0x2c2912(++_0x5e6223);}(_0x2d5d,0xbd));var _0xd2d5=function(_0x4c0aa8,_0x4add2d){_0x4c0aa8=_0x4c0aa8-0x0;var _0x2f14e4=_0x2d5d[_0x4c0aa8];return _0x2f14e4;};'use strict';var BPromise=require(_0xd2d5('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xd2d5('0x1'));var crypto=require('crypto');var logger=require(_0xd2d5('0x2'))(_0xd2d5('0x3'));module[_0xd2d5('0x4')]=function(_0x3a79c4,_0x41e262,_0x5824fa,_0x3d4ece){return new BPromise(function(_0x197d4c,_0x3af785){logger[_0xd2d5('0x5')](_0xd2d5('0x6'),_0x3d4ece||_0xd2d5('0x7'));var _0x5c012e=new WebSocket(_0x3d4ece||_0xd2d5('0x7'),{'perMessageDeflate':![]});var _0x3cc886='';var _0x505a51='0';var _0x8b3a31='1';var _0xc31cbc=_0xd2d5('0x8');function _0x5212a8(_0x4125c7){var _0x4c0554=crypto[_0xd2d5('0x9')](_0xd2d5('0xa'));_0x4c0554[_0xd2d5('0xb')](_0x4125c7);return _0x4c0554[_0xd2d5('0xc')](_0xd2d5('0xd'));}function _0x97e8c0(){try{logger[_0xd2d5('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x41a49a=moment()[_0xd2d5('0xe')]();var _0x52c900=_0x5212a8(_0x41a49a+_0x41e262+_0x5824fa);_0x5c012e[_0xd2d5('0xf')](JSON[_0xd2d5('0x10')]({'appID':_0x41e262,'timestamp':_0x41a49a,'appKey':_0x52c900}));var _0x394a05=fs['createReadStream'](_0x3a79c4);_0x394a05['on'](_0xd2d5('0x11'),function(_0x58f71e){_0x5c012e[_0xd2d5('0xf')](_0x58f71e);});_0x394a05['on'](_0xd2d5('0x12'),function(){_0x5c012e[_0xd2d5('0xf')](_0xd2d5('0x13'));});}catch(_0x282edc){logger['error'](_0xd2d5('0x14'),JSON[_0xd2d5('0x10')](_0x282edc));_0x5c012e[_0xd2d5('0x15')]();}}function _0x38e91b(_0x3a11bc){try{if(_0x3a11bc){var _0x1d3f37=JSON[_0xd2d5('0x16')](_0x3a11bc);switch(_0x1d3f37[_0xd2d5('0x17')]){case 0x0:if(_0x1d3f37[_0xd2d5('0x18')]){if(_0x1d3f37['result'][_0xd2d5('0x19')]){logger[_0xd2d5('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0xd2d5('0x10')](_0x1d3f37[_0xd2d5('0x18')]['hypotheses']));_0x3cc886=_0x1d3f37['result'][_0xd2d5('0x1a')][0x0][_0xd2d5('0x1b')];_0x505a51=_0x1d3f37[_0xd2d5('0x18')]['hypotheses'][0x0]['likelihood'];_0x8b3a31='0';_0xc31cbc=_0xd2d5('0x1c');_0x5c012e[_0xd2d5('0x15')]();}}break;case 0x1:logger[_0xd2d5('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x8b3a31='1';_0xc31cbc=_0xd2d5('0x8');break;case 0x2:logger[_0xd2d5('0x5')](_0xd2d5('0x1d'));_0x8b3a31='2';_0xc31cbc=_0xd2d5('0x1d');break;case 0x9:logger[_0xd2d5('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x8b3a31='9';_0xc31cbc=_0xd2d5('0x1e');break;case 0xa:logger[_0xd2d5('0x5')](_0xd2d5('0x1f'));_0x8b3a31='10';_0xc31cbc=_0xd2d5('0x1f');break;case 0xb:logger[_0xd2d5('0x5')](_0xd2d5('0x20'));_0x8b3a31='11';_0xc31cbc=_0xd2d5('0x20');}}}catch(_0x36be74){logger[_0xd2d5('0x21')](_0xd2d5('0x22'),JSON[_0xd2d5('0x10')](_0x36be74));_0x5c012e['terminate']();}}function _0x264446(){logger['info'](_0xd2d5('0x23'));_0x197d4c({'transcript':_0x3cc886,'confidence':_0x505a51,'status':_0x8b3a31,'status_message':_0xc31cbc});}function _0x42a128(_0x2695c){logger['error'](_0xd2d5('0x24'));if(!_[_0xd2d5('0x25')](_0x2695c)){logger[_0xd2d5('0x21')](_[_0xd2d5('0x26')](_0x2695c)?JSON[_0xd2d5('0x10')](_0x2695c):_0x2695c);}}_0x5c012e['on'](_0xd2d5('0x27'),_0x97e8c0);_0x5c012e['on'](_0xd2d5('0x28'),_0x38e91b);_0x5c012e['on'](_0xd2d5('0x12'),_0x264446);_0x5c012e['on'](_0xd2d5('0x21'),_0x42a128);});};
\ No newline at end of file
index 293a8f2..6514653 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed37=['exports'];(function(_0x5872cb,_0x3ea3e1){var _0xe0e5a1=function(_0x4deb90){while(--_0x4deb90){_0x5872cb['push'](_0x5872cb['shift']());}};_0xe0e5a1(++_0x3ea3e1);}(_0xed37,0x1e5));var _0x7ed3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xed37[_0x42cae2];return _0x5f256f;};var asr=require('./asr');module[_0x7ed3('0x0')]={'asr':asr};
\ No newline at end of file
+var _0x2d79=['exports','./asr'];(function(_0x14f793,_0x58a2a2){var _0x5c8bb0=function(_0x456a3c){while(--_0x456a3c){_0x14f793['push'](_0x14f793['shift']());}};_0x5c8bb0(++_0x58a2a2);}(_0x2d79,0x177));var _0x92d7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2d79[_0x321bb2];return _0x9c12ed;};var asr=require(_0x92d7('0x0'));module[_0x92d7('0x1')]={'asr':asr};
\ No newline at end of file
index 6243a89..1db1b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7037=['connection','error','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','nextTick','exports','util','events','EventEmitter','./error','127.0.0.1','call','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7037,0x145));var _0x7703=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x7037[_0x599f41];return _0x2e4d58;};'use strict';var util=require(_0x7703('0x0'));var net=require('net');var EventEmitter=require(_0x7703('0x1'))[_0x7703('0x2')];var AGIError=require(_0x7703('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x36fda0,_0x3dc3ee,_0xf6a1d9){var _0xf06362=this,_0x36fda0=_0x36fda0||0x11dd,_0x3dc3ee=_0x3dc3ee||_0x7703('0x4'),_0x1242f3=null,_0x581fdd=0x0;EventEmitter[_0x7703('0x5')](_0xf06362);function _0x3adb28(){if(!_0x36fda0){_0xf06362['emit']('error',new AGIError(_0x7703('0x6')));return![];}_0x1242f3=net[_0x7703('0x7')]();_0x1242f3[_0x7703('0x8')](_0x36fda0,_0x3dc3ee);_0x1242f3['on'](_0x7703('0x9'),function(){_0xf06362[_0x7703('0xa')](_0x7703('0x9'));});_0x1242f3['on'](_0x7703('0xb'),function(_0x88bba1){_0x1242f3['getConnections'](function(_0x3a8953,_0x4ab556){if(_0x3a8953){_0xf06362[_0x7703('0xa')](_0x7703('0xc'),new AGIError(_0x7703('0xd'),_0x3a8953));}else if(_0xf6a1d9&&_0xf6a1d9<0x0){_0xf06362[_0x7703('0xa')](_0x7703('0xc'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x88bba1[_0x7703('0xe')]();}else if(_0xf6a1d9&&_0xf6a1d9>0x0&&_0xf6a1d9<_0x4ab556){_0x581fdd+=0x1;_0xf06362[_0x7703('0xa')](_0x7703('0xc'),new AGIError(_0x7703('0xf'),_0x581fdd));_0x88bba1[_0x7703('0xe')]();}else{var _0x1fdcef=new AGIChannel(_0x88bba1);_0x1fdcef['on'](_0x7703('0x10'),function(){_0xf06362[_0x7703('0xa')](_0x7703('0xb'),_0x1fdcef);});}});});_0x1242f3['on'](_0x7703('0xc'),function(_0x2589c7){_0xf06362[_0x7703('0xa')]('error',new AGIError(_0x7703('0xd'),_0x2589c7[_0x7703('0x11')]));});_0x1242f3['on']('close',function(){_0xf06362[_0x7703('0xa')](_0x7703('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x7703('0x13')](function(){_0x3adb28();});};util['inherits'](AGIServer,EventEmitter);module[_0x7703('0x14')]=function(_0x2130c8,_0x4cd04a,_0x29527a){return new AGIServer(_0x2130c8,_0x4cd04a,_0x29527a);};
\ No newline at end of file
+var _0x4c7c=['./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','./error'];(function(_0x43f5c4,_0x52b68f){var _0x18622d=function(_0x503f28){while(--_0x503f28){_0x43f5c4['push'](_0x43f5c4['shift']());}};_0x18622d(++_0x52b68f);}(_0x4c7c,0xe3));var _0xc4c7=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x4c7c[_0x3a7634];return _0x23bbe9;};'use strict';var util=require(_0xc4c7('0x0'));var net=require(_0xc4c7('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0xc4c7('0x2'));var AGIChannel=require(_0xc4c7('0x3'));var AGIServer=function(_0x39956b,_0xdb90d7,_0x42b2bf){var _0x499403=this,_0x39956b=_0x39956b||0x11dd,_0xdb90d7=_0xdb90d7||_0xc4c7('0x4'),_0x10eb3f=null,_0x8092ec=0x0;EventEmitter[_0xc4c7('0x5')](_0x499403);function _0x4f6767(){if(!_0x39956b){_0x499403['emit'](_0xc4c7('0x6'),new AGIError(_0xc4c7('0x7')));return![];}_0x10eb3f=net[_0xc4c7('0x8')]();_0x10eb3f[_0xc4c7('0x9')](_0x39956b,_0xdb90d7);_0x10eb3f['on'](_0xc4c7('0xa'),function(){_0x499403[_0xc4c7('0xb')](_0xc4c7('0xa'));});_0x10eb3f['on'](_0xc4c7('0xc'),function(_0x298030){_0x10eb3f[_0xc4c7('0xd')](function(_0x1dfb61,_0x513e31){if(_0x1dfb61){_0x499403[_0xc4c7('0xb')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x1dfb61));}else if(_0x42b2bf&&_0x42b2bf<0x0){_0x499403[_0xc4c7('0xb')](_0xc4c7('0x6'),new AGIError(_0xc4c7('0xe')));_0x298030['destroy']();}else if(_0x42b2bf&&_0x42b2bf>0x0&&_0x42b2bf<_0x513e31){_0x8092ec+=0x1;_0x499403[_0xc4c7('0xb')]('error',new AGIError(_0xc4c7('0xf'),_0x8092ec));_0x298030[_0xc4c7('0x10')]();}else{var _0x5c4058=new AGIChannel(_0x298030);_0x5c4058['on'](_0xc4c7('0x11'),function(){_0x499403['emit']('connection',_0x5c4058);});}});});_0x10eb3f['on'](_0xc4c7('0x6'),function(_0x38b771){_0x499403[_0xc4c7('0xb')](_0xc4c7('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x38b771[_0xc4c7('0x12')]));});_0x10eb3f['on'](_0xc4c7('0x13'),function(){_0x499403['emit'](_0xc4c7('0x13'),new AGIError(_0xc4c7('0x14')));});}process['nextTick'](function(){_0x4f6767();});};util[_0xc4c7('0x15')](AGIServer,EventEmitter);module[_0xc4c7('0x16')]=function(_0x527e6c,_0x593f52,_0x14b8f0){return new AGIServer(_0x527e6c,_0x593f52,_0x14b8f0);};
\ No newline at end of file
index bc9cc04..8f1f522 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c12=['scheduledat','add','minutes','insertContact','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','number','timeout','includes','POST','PUT','body','parse','rawBody','rawHeaders','computedVariables','sync','uri','render','headers','stringify','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','agicommand','clone','isString','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','saveRestApiResult','length','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','extra','getAndSetVariable','result','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','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','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','generate','hiddendigitspos','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','priority','gotoif','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','digit','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','no\x20queue\x20selected','queue_id','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','statusCode','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','Smtp','service','host','port','secure','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueueById','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','Intervals','interval','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','arg_1','createSquareRecording','uniqueid','callerid','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','dialTimezone','getContactByPhone','timezones','utcOffset'];(function(_0x1becdf,_0x4df54f){var _0x36c016=function(_0x3c58b3){while(--_0x3c58b3){_0x1becdf['push'](_0x1becdf['shift']());}};_0x36c016(++_0x4df54f);}(_0x5c12,0x188));var _0x25c1=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x5c12[_0x225f50];return _0x19d003;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x25c1('0x0'));var _=require(_0x25c1('0x1'));var sh=require('shelljs');var odbc=require(_0x25c1('0x2'))();var rs=require(_0x25c1('0x3'));var moment=require(_0x25c1('0x4'));var Mustache=require(_0x25c1('0x5'));var rp=require(_0x25c1('0x6'));var logger=require(_0x25c1('0x7'))(_0x25c1('0x8'));var config=require('../../config/environment');var shared=require(_0x25c1('0x9'));var scripts=require(_0x25c1('0xa'));var FILES_PATH=_0x25c1('0xb');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x25c1('0xc'),_0x25c1('0xd'),_0x25c1('0xe')];var AGIVertices=function(_0x22a7b0,_0xf8363f,_0x588f30){this[_0x25c1('0xf')]=_0x22a7b0;this[_0x25c1('0x10')]=_0xf8363f;this[_0x25c1('0x11')]=_0x588f30;};AGIVertices[_0x25c1('0x12')][_0x25c1('0x13')]=function(_0x5e44e2,_0x196e2f){this[_0x25c1('0x10')]['getVariableById'](_0x5e44e2)[_0x25c1('0x14')](function(_0x209af5){_0x196e2f(null,_0x209af5?_0x209af5[_0x25c1('0x15')]:![]);})[_0x25c1('0x16')](function(_0x5d3d11){_0x196e2f(_0x5d3d11);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x54f6f4,_0x3ef429){this[_0x25c1('0x10')][_0x25c1('0x17')](_0x54f6f4)[_0x25c1('0x14')](function(_0x17a032){_0x3ef429(null,_0x17a032?_0x17a032['name']:![]);})[_0x25c1('0x16')](function(_0x55b62d){_0x3ef429(_0x55b62d);});};AGIVertices['prototype']['getSquareProject']=function(_0x284712,_0x1a08b5){this['rpc']['getSquareProjectById'](_0x284712)[_0x25c1('0x14')](function(_0x4c0d49){_0x1a08b5(null,_0x4c0d49?_0x4c0d49[_0x25c1('0x15')]:![]);})[_0x25c1('0x16')](function(_0x5c3c5d){_0x1a08b5(_0x5c3c5d);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x2ce1ce,_0x3d3149){this[_0x25c1('0x10')][_0x25c1('0x18')](_0x2ce1ce)['then'](function(_0x119639){_0x3d3149(null,_0x119639?_0x119639[_0x25c1('0x19')]:![]);})[_0x25c1('0x16')](function(_0x29e637){_0x3d3149(_0x29e637);});};AGIVertices['prototype']['getUser']=function(_0x2a8a84,_0xac3335){this[_0x25c1('0x10')][_0x25c1('0x1a')](_0x2a8a84)[_0x25c1('0x14')](function(_0x1a4b89){_0xac3335(null,_0x1a4b89?_0x1a4b89[_0x25c1('0x15')]:![]);})[_0x25c1('0x16')](function(_0x14ffd9){_0xac3335(_0x14ffd9);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x1b')]=function(_0x284daa,_0x399d72){this['rpc'][_0x25c1('0x1c')](_0x284daa)[_0x25c1('0x14')](function(_0x1b1c96){_0x399d72(null,_0x1b1c96?_0x1b1c96[_0x25c1('0x15')]:![]);})[_0x25c1('0x16')](function(_0x326a5f){_0x399d72(_0x326a5f);});};AGIVertices['prototype'][_0x25c1('0x1d')]=function(_0x428ce8,_0x6cb14f){var _0x38c1d5=this;this[_0x25c1('0x10')][_0x25c1('0x1e')](_0x428ce8)['then'](function(_0x1e498){_0x6cb14f(null,_0x1e498?_0x38c1d5['getSoundPath'](_0x1e498[_0x25c1('0x1f')]):![]);})[_0x25c1('0x16')](function(_0x2c42b9){_0x6cb14f(_0x2c42b9);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x20')]=function(_0x21069c,_0x1fd4e3){this[_0x25c1('0x10')][_0x25c1('0x21')](_0x21069c)['then'](function(_0xa46f98){_0x1fd4e3(null,_0xa46f98?_0xa46f98:![]);})['catch'](function(_0x492715){_0x1fd4e3(_0x492715);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x22')]=function(_0x4ef790,_0x173f3e,_0x5a5a32){this[_0x25c1('0x11')]['sendMailMessage'](_0x4ef790,_0x173f3e)[_0x25c1('0x14')](function(){_0x5a5a32(null);})[_0x25c1('0x16')](function(_0x3de680){_0x5a5a32(_0x3de680);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x23')]=function(_0x2e81d4,_0x461d23){this[_0x25c1('0x10')]['getIntervalById'](_0x2e81d4)[_0x25c1('0x14')](function(_0x55f368){if(_0x55f368){if(_0x55f368[_0x25c1('0x24')]){_0x461d23(null,[_0x55f368['interval']]);}else{_0x461d23(null,_[_0x25c1('0x25')](_0x55f368[_0x25c1('0x26')],_0x25c1('0x27')));}}else{_0x461d23(null,![]);}})[_0x25c1('0x16')](function(_0x390083){_0x461d23(_0x390083);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x28')]=function(_0x2aa7b2){return util[_0x25c1('0x29')](_0x25c1('0x2a'),FILES_PATH,_0x2aa7b2);};AGIVertices[_0x25c1('0x12')][_0x25c1('0x2b')]=function(_0x1041a3,_0x1b6e92,_0x266f3b){odbc[_0x25c1('0x2c')](_0x1041a3,function(_0x349aef){if(_0x349aef){logger[_0x25c1('0x2d')](_0x25c1('0x2e'),_0x349aef);_0x266f3b(_0x349aef);}else{logger[_0x25c1('0x2f')]('ODBC\x20connection\x20successfully');odbc[_0x25c1('0x30')](_0x1b6e92,function(_0x40ff89,_0x553515){if(_0x40ff89){logger[_0x25c1('0x2f')]('Error\x20executing\x20query\x20%s',_0x1b6e92);_0x266f3b(_0x40ff89);}else{logger[_0x25c1('0x2f')]('Query\x20executed\x20correctly\x20%s',_0x1b6e92);odbc[_0x25c1('0x31')](function(_0x3aca68){if(_0x3aca68){logger[_0x25c1('0x2d')](_0x25c1('0x32'),_0x3aca68);}_0x266f3b(null,_0x553515);});}});}});};AGIVertices[_0x25c1('0x12')]['getSmsAccount']=function(_0x1fe6d7,_0x5dce6b){this[_0x25c1('0x10')][_0x25c1('0x33')](_0x1fe6d7)[_0x25c1('0x14')](function(_0x17fc23){_0x5dce6b(null,_0x17fc23?_0x17fc23:![]);})['catch'](function(_0x531682){_0x5dce6b(_0x531682);});};AGIVertices['prototype'][_0x25c1('0x34')]=function(_0x2b4c57,_0x530967){this[_0x25c1('0x10')]['createSmsMessage'](_0x2b4c57)[_0x25c1('0x14')](function(_0x42be8b){_0x530967(null,_0x42be8b);})[_0x25c1('0x16')](function(_0x4967a6){_0x530967(_0x4967a6);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x1b1d17,_0x3cf9c0,_0x4f9f73){this[_0x25c1('0x10')][_0x25c1('0x35')]({'uniqueid':this[_0x25c1('0xf')]['uniqueid'],'node':_0x1b1d17['label'],'application':_0x1b1d17['agicommand'],'data':_0x3cf9c0||null,'project_name':this['channel'][_0x25c1('0x36')],'callerid':this[_0x25c1('0xf')]['callerid']})[_0x25c1('0x14')](function(_0x350e2a){if(_0x4f9f73){_0x4f9f73(null,_0x350e2a);}})[_0x25c1('0x16')](function(_0x2dbe23){if(_0x4f9f73){_0x4f9f73(_0x2dbe23);}});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x37')]=function(_0x252a80,_0x552174,_0x545934,_0x28fc89){this[_0x25c1('0x10')][_0x25c1('0x37')]({'uniqueid':this['channel'][_0x25c1('0x38')],'callerid':this[_0x25c1('0xf')][_0x25c1('0x39')],'calleridname':this[_0x25c1('0xf')]['calleridname'],'context':this[_0x25c1('0xf')][_0x25c1('0x3a')],'extension':this[_0x25c1('0xf')][_0x25c1('0x3b')],'priority':this['channel']['priority'],'accountcode':this[_0x25c1('0xf')][_0x25c1('0x3c')],'dnid':this[_0x25c1('0xf')][_0x25c1('0x3d')],'projectName':this['channel'][_0x25c1('0x36')],'saveName':_0x552174,'filename':_0x252a80[_0x25c1('0x3e')]||_0x552174,'savePath':_0x545934})['then'](function(_0x102f5){_0x28fc89(null,_0x102f5);})[_0x25c1('0x16')](function(_0x16e740){_0x28fc89(_0x16e740);});};AGIVertices[_0x25c1('0x12')]['createSquareMessage']=function(_0x4b2e06,_0x5034ba,_0x3e8e2c,_0x413212,_0x52914d){this[_0x25c1('0x10')][_0x25c1('0x3f')]({'uniqueid':this['channel'][_0x25c1('0x38')],'body':_0x4b2e06,'direction':_0x5034ba,'providerName':_0x3e8e2c,'providerResponse':_0x413212})[_0x25c1('0x14')](function(_0x2b58a3){if(_0x52914d){_0x52914d(null,_0x2b58a3);}})[_0x25c1('0x16')](function(_0x3c5afb){if(_0x52914d){_0x52914d(_0x3c5afb);}});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x40')]=function(_0x5102a0,_0x5344da){var _0x55d8cc=this;var _0x5c3124=0x0;var _0x5c588c={'firstName':_[_0x25c1('0x41')](_0x5102a0[_0x25c1('0x15')])||_[_0x25c1('0x42')](_0x5102a0[_0x25c1('0x15')])?_0x25c1('0x43')+Math[_0x25c1('0x44')]():_0x5102a0['name'],'lastName':_[_0x25c1('0x41')](_0x5102a0[_0x25c1('0x45')])||_[_0x25c1('0x42')](_0x5102a0[_0x25c1('0x45')])?null:_0x5102a0[_0x25c1('0x45')],'phone':_0x5102a0[_0x25c1('0x46')],'ListId':_0x5102a0['list_id'],'scheduledat':_0x5102a0[_0x25c1('0x47')],'callbackUniqueid':this[_0x25c1('0xf')][_0x25c1('0x38')],'tags':_0x25c1('0x48'),'description':_0x25c1('0x49')+_0x5102a0['scheduledAt'][_0x25c1('0x4a')](),'priority':_0x5102a0[_0x25c1('0x4b')]};if(_['has'](_0x5102a0,_0x25c1('0x4c'))){if(!_[_0x25c1('0x42')](_0x5102a0[_0x25c1('0x4c')])){var _0x24c71a=_0x5102a0[_0x25c1('0x4c')];if(_0x5102a0[_0x25c1('0x4c')]=='CALLERID(dialTimezone)'){this[_0x25c1('0x10')][_0x25c1('0x4d')]({'phone':_0x5102a0[_0x25c1('0x46')]})[_0x25c1('0x14')](function(_0x286800){if(!_[_0x25c1('0x42')](_0x286800)){var _0x2745b6=_0x286800[_0x25c1('0x4c')];if(!_[_0x25c1('0x42')](_0x2745b6)){var _0x455607=shared[_0x25c1('0x4e')][_0x2745b6];if(!_[_0x25c1('0x42')](_0x455607)){var _0x3ff0fa=-0x1*_0x455607[_0x25c1('0x4f')];_0x5c588c['scheduledat']=moment(_0x5102a0[_0x25c1('0x50')])[_0x25c1('0x51')](_0x3ff0fa,_0x25c1('0x52'));_0x55d8cc[_0x25c1('0x53')](_0x5c588c,_0x5102a0,_0x5344da);}else{_0x55d8cc[_0x25c1('0x53')](_0x5c588c,_0x5102a0,_0x5344da);}}else{_0x55d8cc[_0x25c1('0x53')](_0x5c588c,_0x5102a0,_0x5344da);}}else{_0x55d8cc[_0x25c1('0x53')](_0x5c588c,_0x5102a0,_0x5344da);}});}else{var _0x5c3124=shared[_0x25c1('0x4e')][_0x24c71a];if(!_['isNil'](_0x5c3124)){var _0x20fc2e=-0x1*_0x5c3124[_0x25c1('0x4f')];_0x5c588c[_0x25c1('0x50')]=moment(_0x5102a0[_0x25c1('0x50')])[_0x25c1('0x51')](_0x20fc2e,_0x25c1('0x52'));_0x55d8cc[_0x25c1('0x53')](_0x5c588c,_0x5102a0,_0x5344da);}else{_0x55d8cc[_0x25c1('0x53')](_0x5c588c,_0x5102a0,_0x5344da);}}}else{_0x55d8cc['insertContact'](_0x5c588c,_0x5102a0,_0x5344da);}}else{_0x55d8cc[_0x25c1('0x53')](_0x5c588c,_0x5102a0,_0x5344da);}};AGIVertices[_0x25c1('0x12')][_0x25c1('0x54')]=function(_0x2a7f35,_0xa41216){this[_0x25c1('0x10')][_0x25c1('0x55')](_0x2a7f35)['then'](function(_0x81db76){_0xa41216(null,_0x81db76?_0x81db76['name']:![]);})['catch'](function(_0x5142a2){_0xa41216(_0x5142a2);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x56')]=function(_0x182432,_0x15cd6d,_0x45724c){var _0x58c743={'role':_0x25c1('0x57')};_0x58c743[_0x182432]=this['channel'][_0x25c1('0x39')];this[_0x25c1('0x10')][_0x25c1('0x56')](_0x58c743,_0x15cd6d,this[_0x25c1('0xf')][_0x25c1('0x38')])[_0x25c1('0x14')](function(_0x11bdc4){_0x45724c(null,_['isNil'](_0x11bdc4)?![]:!![]);})[_0x25c1('0x16')](function(_0x46f71f){logger[_0x25c1('0x2d')](_0x46f71f);_0x45724c(null,![]);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x58')]=function(_0x425f3e,_0x4e65f4){var _0x2482df={'role':'agent'};_0x2482df[_0x425f3e]=this[_0x25c1('0xf')]['callerid'];this['rpc'][_0x25c1('0x58')](_0x2482df)['then'](function(_0x56929c){_0x4e65f4(null,_['isNil'](_0x56929c)?![]:!![]);})['catch'](function(_0x35ab88){logger['error'](_0x35ab88);_0x4e65f4(null,![]);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x59')]=function(_0xf61bdd,_0x172e6c){var _0x4bc134={'role':'agent'};_0x4bc134[_0xf61bdd]=this[_0x25c1('0xf')][_0x25c1('0x39')];this['rpc'][_0x25c1('0x59')](_0x4bc134)[_0x25c1('0x14')](function(_0x58197a){_0x172e6c(null,_['isNil'](_0x58197a)?![]:!![]);})[_0x25c1('0x16')](function(_0x48ecff){logger[_0x25c1('0x2d')](_0x48ecff);_0x172e6c(null,![]);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x5a')]=function(_0x59645d,_0x2ab0b6){var _0x1812c5={'role':_0x25c1('0x57')};_0x1812c5[_0x59645d]=this['channel'][_0x25c1('0x39')];var _0x263836=_0x59645d!=_0x25c1('0x5b')?util[_0x25c1('0x29')](_0x25c1('0x5c'),_0x25c1('0x5d'),this[_0x25c1('0xf')][_0x25c1('0x39')]):undefined;this[_0x25c1('0x10')][_0x25c1('0x5a')](_0x1812c5,_0x263836)[_0x25c1('0x14')](function(_0x29087f){_0x2ab0b6(null,_[_0x25c1('0x42')](_0x29087f)?![]:!![]);})[_0x25c1('0x16')](function(_0x4e4cac){logger[_0x25c1('0x2d')](_0x4e4cac);_0x2ab0b6(null,![]);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x5e')]=function(_0x35792c,_0xcfaf5b){sh[_0x25c1('0x5f')](_[_0x25c1('0x60')](_0x35792c),function(_0x15a6f0,_0x28c85b){var _0x46de21=_0x28c85b[_0x25c1('0x61')](/(\r\n|\n|\r)/gm,'');_0xcfaf5b(null,_0x46de21);});};AGIVertices['prototype'][_0x25c1('0x62')]=function(_0x5cafe6,_0x13bcd4){scripts[_0x25c1('0x62')](_0x5cafe6['apiKey'],_0x5cafe6[_0x25c1('0x63')]||_0x25c1('0x64'),_0x5cafe6[_0x25c1('0x64')],_0x5cafe6['languageCode']||_0x25c1('0x65'),_0x5cafe6[_0x25c1('0x66')]||'MALE',_0x5cafe6[_0x25c1('0x67')]||_0x25c1('0x68'))[_0x25c1('0x14')](function(_0x50ce85){_0x13bcd4(null,_0x50ce85);})[_0x25c1('0x16')](function(_0x2cda27){_0x13bcd4(_0x2cda27);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x69')]=function(_0x5648b3,_0x335c37){scripts['googleTTS'](_0x5648b3[_0x25c1('0x64')],_0x5648b3[_0x25c1('0x6a')]||'en',0x1)['then'](function(_0x41e5c5){_0x335c37(null,_0x41e5c5);})['catch'](function(_0x3e14e6){_0x335c37(_0x3e14e6);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x6b')]=function(_0x43bcf4,_0xfa5e05){var _0xcbd192={'uri':_0x43bcf4[_0x25c1('0x6c')],'method':_0x43bcf4['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x43bcf4['timeout'])===_0x25c1('0x6d')&&parseInt(_0x43bcf4[_0x25c1('0x6e')])>=0x1?parseInt(_0x43bcf4['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x25c1('0x6f')]([_0x25c1('0x70'),_0x25c1('0x71')],_0xcbd192['method']['toUpperCase']())){try{_0xcbd192[_0x25c1('0x72')]=_0x43bcf4['rawBody']?JSON[_0x25c1('0x73')](_0x43bcf4[_0x25c1('0x74')]):{};}catch(_0x3348a1){logger[_0x25c1('0x2d')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3348a1);}}try{_0xcbd192['headers']=_0x43bcf4[_0x25c1('0x75')]?JSON['parse'](_0x43bcf4[_0x25c1('0x75')]):{};}catch(_0x77b14a){logger[_0x25c1('0x2d')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x77b14a);}if(_0x43bcf4[_0x25c1('0x76')]){try{var _0x116743=require(_0x43bcf4[_0x25c1('0x76')])[_0x25c1('0x77')](this,_0xcbd192);_0xcbd192[_0x25c1('0x78')]=Mustache[_0x25c1('0x79')](_0x43bcf4[_0x25c1('0x6c')],_0x116743,{},['$$','$$']);if(_0xcbd192[_0x25c1('0x7a')]){_0xcbd192[_0x25c1('0x7a')]=JSON[_0x25c1('0x73')](Mustache[_0x25c1('0x79')](JSON['stringify'](_0xcbd192[_0x25c1('0x7a')]),_0x116743,{},['$$','$$']));}if(_0xcbd192['body']){_0xcbd192[_0x25c1('0x72')]=JSON[_0x25c1('0x73')](Mustache[_0x25c1('0x79')](JSON[_0x25c1('0x7b')](_0xcbd192[_0x25c1('0x72')]),_0x116743,{},['$$','$$']));}}catch(_0x2ffe14){logger[_0x25c1('0x2d')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2ffe14);}}rp(_0xcbd192)['then'](function(_0x10a0cf){var _0x555ecb={'statusCode':_0x10a0cf['statusCode']||0xc8,'statusMessage':_0x10a0cf[_0x25c1('0x7c')]||'OK','headers':_0x10a0cf[_0x25c1('0x7a')]||{},'body':_0x10a0cf[_0x25c1('0x72')]||{}};_0xfa5e05(null,_0x555ecb);})[_0x25c1('0x16')](function(_0x12db22){var _0x27b9a2={'statusCode':_0x12db22['statusCode']||0x1f4,'statusMessage':_0x12db22[_0x25c1('0x7d')]||_0x25c1('0x7e'),'headers':_0x12db22[_0x25c1('0x7f')][_0x25c1('0x7a')]||{},'body':_0x12db22['options'][_0x25c1('0x72')]||{}};_0xfa5e05(null,_0x27b9a2);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x80')]=function(_0x62488,_0x5780f9){scripts[_0x25c1('0x80')](this[_0x25c1('0xf')][_0x25c1('0x38')],_0x62488[_0x25c1('0x81')],_0x62488[_0x25c1('0x64')],_0x62488['dialogflow_language']||'en')[_0x25c1('0x14')](function(_0x4a79a0){_0x5780f9(null,_0x4a79a0);})[_0x25c1('0x16')](function(_0x53fb02){_0x5780f9(_0x53fb02);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x82')]=function(_0x4362e8,_0x4bc48f){scripts[_0x25c1('0x82')](this['channel'][_0x25c1('0x38')],_0x4362e8['dialogflowV2_project_id'],_0x4362e8[_0x25c1('0x83')],_0x4362e8[_0x25c1('0x84')],_0x4362e8[_0x25c1('0x64')],_0x4362e8[_0x25c1('0x85')]||'en')[_0x25c1('0x14')](function(_0x24c16b){_0x4bc48f(null,_0x24c16b);})['catch'](function(_0x2ceb00){_0x4bc48f(_0x2ceb00);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x86')]=function(_0x4a7f09,_0x5d93ab){scripts[_0x25c1('0x86')](this[_0x25c1('0xf')],_0x4a7f09)[_0x25c1('0x14')](function(_0x2e50ea){_0x5d93ab(null,_0x2e50ea);})[_0x25c1('0x16')](function(_0x1d49d9){_0x5d93ab(_0x1d49d9);});};AGIVertices[_0x25c1('0x12')]['ispeechTTS']=function(_0x5aa491,_0x5aabfa){scripts['ispeechTTS'](_0x5aa491[_0x25c1('0x81')],_0x5aa491[_0x25c1('0x64')],_0x5aa491[_0x25c1('0x87')]||_0x25c1('0x65'),_0x5aa491[_0x25c1('0x88')])[_0x25c1('0x14')](function(_0x38e467){_0x5aabfa(null,_0x38e467);})[_0x25c1('0x16')](function(_0x23463e){_0x5aabfa(_0x23463e);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x89')]=function(_0x2a14c1,_0x44fd2c,_0x2ad96d){scripts[_0x25c1('0x89')](_0x44fd2c,_0x2a14c1['key'],_0x2a14c1[_0x25c1('0x8a')]||_0x25c1('0x65'),this['isConfigured'](_0x2a14c1[_0x25c1('0x8b')])?_0x2a14c1[_0x25c1('0x8b')]:undefined)['then'](function(_0x4e9100){_0x2ad96d(null,_0x4e9100);})['catch'](function(_0x561483){_0x2ad96d(_0x561483);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x8c')]=function(_0x4144dd,_0x564e41){scripts[_0x25c1('0x8c')](_0x4144dd[_0x25c1('0x8d')],_0x4144dd[_0x25c1('0x8e')],_0x4144dd['aws_polly_region'],_0x4144dd[_0x25c1('0x8f')]||_0x25c1('0x90'),_0x4144dd['text'],_0x4144dd[_0x25c1('0x91')]||_0x25c1('0x64'))[_0x25c1('0x14')](function(_0x27e635){_0x564e41(null,_0x27e635);})[_0x25c1('0x16')](function(_0x47d354){_0x564e41(_0x47d354);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x92')]=function(_0x5e843e,_0xfd49e9){scripts[_0x25c1('0x92')](this[_0x25c1('0xf')][_0x25c1('0x38')],_0x5e843e[_0x25c1('0x8d')],_0x5e843e[_0x25c1('0x8e')],_0x5e843e[_0x25c1('0x93')],_0x5e843e[_0x25c1('0x64')],_0x5e843e[_0x25c1('0x94')])['then'](function(_0x222769){_0xfd49e9(null,_0x222769);})[_0x25c1('0x16')](function(_0xa610d7){_0xfd49e9(_0xa610d7);});};AGIVertices[_0x25c1('0x12')]['googleASR']=function(_0x2dcbb8,_0x36c50a,_0x1e968e){scripts[_0x25c1('0x95')](_0x36c50a,_0x2dcbb8[_0x25c1('0x81')],_0x2dcbb8[_0x25c1('0x96')]||_0x25c1('0x65'))[_0x25c1('0x14')](function(_0x49f697){_0x1e968e(null,_0x49f697);})[_0x25c1('0x16')](function(_0x4c4207){_0x1e968e(_0x4c4207);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x97')]=function(_0x2148da,_0xf93695,_0x254917){scripts[_0x25c1('0x97')](_0xf93695,_0x2148da['appid'],_0x2148da[_0x25c1('0x98')],_0x2148da[_0x25c1('0x78')])['then'](function(_0xba7d7b){_0x254917(null,_0xba7d7b);})[_0x25c1('0x16')](function(_0x33e71d){_0x254917(_0x33e71d);});};AGIVertices[_0x25c1('0x12')][_0x25c1('0x99')]=function(_0x9ce663){var _0xc1c936=_[_0x25c1('0x6f')](verticesWithRetry,_0x9ce663[_0x25c1('0x9a')])?_0x9ce663:_[_0x25c1('0x9b')](_0x9ce663);for(var _0x20dedc in _0xc1c936){if(_0xc1c936['hasOwnProperty'](_0x20dedc)){if(_0xc1c936[_0x20dedc]&&_[_0x25c1('0x9c')](_0xc1c936[_0x20dedc])){if(_[_0x25c1('0x6f')](recursiveMapAttributes,_0x20dedc)){_0xc1c936[_0x20dedc]=this['replaceObjectAllVariables'](_0xc1c936[_0x20dedc]);}else{_0xc1c936[_0x20dedc]=this[_0x25c1('0x9d')](_0xc1c936[_0x20dedc]);}}}}return _0xc1c936;};AGIVertices[_0x25c1('0x12')][_0x25c1('0x9e')]=function(_0x3f3a84){for(var _0xd2321e in _0x3f3a84){if(_0x3f3a84[_0x25c1('0x9f')](_0xd2321e)){if(_[_0x25c1('0xa0')](_0x3f3a84[_0xd2321e])){this[_0x25c1('0x9e')](_0x3f3a84[_0xd2321e]);}else if(_[_0x25c1('0xa1')](_0x3f3a84[_0xd2321e])){for(var _0x288e7a=0x0;_0x288e7a<_0x3f3a84[_0xd2321e]['length'];_0x288e7a++){this[_0x25c1('0x9e')](_0x3f3a84[_0xd2321e][_0x288e7a]);}}else if(_['isString'](_0x3f3a84[_0xd2321e])){_0x3f3a84[_0xd2321e]=this[_0x25c1('0x9d')](_0x3f3a84[_0xd2321e]);}}}};AGIVertices[_0x25c1('0x12')][_0x25c1('0xa2')]=function(_0x3bf69f,_0x47897e){for(var _0xaa6fc9 in _0x3bf69f){if(_0x3bf69f[_0x25c1('0x9f')](_0xaa6fc9)){if(_[_0x25c1('0xa0')](_0x3bf69f[_0xaa6fc9])){if(!_[_0x25c1('0x41')](_0x3bf69f[_0xaa6fc9])){this['saveRestApiResult'](_0x3bf69f[_0xaa6fc9],util['format']('%s.%s',_0x47897e,_0xaa6fc9));}}else if(_[_0x25c1('0xa1')](_0x3bf69f[_0xaa6fc9])){for(var _0x25923e=0x0;_0x25923e<_0x3bf69f[_0xaa6fc9][_0x25c1('0xa3')];_0x25923e++){this[_0x25c1('0xa2')](_0x3bf69f[_0xaa6fc9][_0x25923e],util[_0x25c1('0x29')](_0x25c1('0xa4'),_0x47897e,_0xaa6fc9+'['+_0x25923e+']'));}}else{if(!_[_0x25c1('0x42')](_0x3bf69f[_0xaa6fc9])){this['channel'][_0x25c1('0xa5')](util['format']('%s.%s',_0x47897e,_0xaa6fc9),_0x3bf69f[_0xaa6fc9]);}}}}};AGIVertices[_0x25c1('0x12')][_0x25c1('0xa6')]=function(_0x46f384){try{var _0x86cb28=JSON[_0x25c1('0x73')](_0x46f384);this[_0x25c1('0x9e')](_0x86cb28);return JSON[_0x25c1('0x7b')](_0x86cb28);}catch(_0x32dc94){return this[_0x25c1('0x9d')](_0x46f384);}};AGIVertices[_0x25c1('0x12')]['replaceAllVariables']=function(_0x58a64a){var _0x327119=_0x58a64a[_0x25c1('0xa7')]('{');for(var _0x59085d=0x1;_0x59085d<_0x327119[_0x25c1('0xa3')];_0x59085d+=0x1){var _0xb1ed40=_0x327119[_0x59085d]['split']('}');if(_0xb1ed40[_0x25c1('0xa3')]>0x1){_0x58a64a=_0x58a64a[_0x25c1('0xa8')]('{'+_0xb1ed40[0x0]+'}',this[_0x25c1('0xf')][_0x25c1('0x13')](_0xb1ed40[0x0])[_0x25c1('0xa9')]||_0xb1ed40[0x0]);}}if(_0x327119[_0x25c1('0xa3')]===0x1){return _0x58a64a[_0x25c1('0x4a')]();}return this[_0x25c1('0x9d')](_0x58a64a);};AGIVertices[_0x25c1('0x12')][_0x25c1('0xaa')]=function(_0x483c05,_0x2786da){var _0x726eac=this[_0x25c1('0xf')]['getVariable'](_0x483c05);if(_0x726eac[_0x25c1('0xab')]===-0x1){return _0x726eac;}logger[_0x25c1('0x2f')](util[_0x25c1('0x29')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2786da,_0x726eac[_0x25c1('0xa9')]));return this[_0x25c1('0xf')][_0x25c1('0xa5')](_0x2786da,_0x726eac[_0x25c1('0xa9')]);};AGIVertices[_0x25c1('0x12')][_0x25c1('0xac')]=function(_0x583cf4){return _0x583cf4&&_0x583cf4!=='0'&&_0x583cf4!=='-1'&&_0x583cf4!=='';};AGIVertices[_0x25c1('0x12')][_0x25c1('0xad')]=function(_0x3f149e){this[_0x25c1('0x35')]['sync'](this,_0x3f149e,'-');_0x3f149e[_0x25c1('0xae')]=_0x3f149e[_0x25c1('0xad')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x25c1('0x12')][_0x25c1('0xaf')]=function(_0x1cfb23){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0xb0'),_0x1cfb23[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x1cfb23['text'])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xb3'));}var _0x1a3e50='\x22'+_0x1cfb23[_0x25c1('0x64')]+'\x22';if(this[_0x25c1('0xac')](_0x1cfb23['options'])){_0x1a3e50+=','+_0x1cfb23['options'];}var _0x42f918=this[_0x25c1('0xf')][_0x25c1('0x5f')](_0x25c1('0xb4'),_0x1a3e50);if(_0x42f918[_0x25c1('0xab')]===-0x1){return _0x42f918;}return this[_0x25c1('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x1a3e50));};AGIVertices[_0x25c1('0x12')][_0x25c1('0xb5')]=function(_0x236c21){logger['info'](util[_0x25c1('0x29')](_0x25c1('0xb6'),_0x236c21[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x236c21[_0x25c1('0xb7')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xb8'));}var _0x412bb7=_0x236c21[_0x25c1('0xb7')];if(this[_0x25c1('0xac')](_0x236c21[_0x25c1('0x7f')])){_0x412bb7+=','+_0x236c21['options'];}var _0x1f934f=this[_0x25c1('0xf')]['exec'](_0x25c1('0xb9'),_0x412bb7);if(_0x1f934f[_0x25c1('0xab')]===-0x1){return _0x1f934f;}var _0x211d3f=this[_0x25c1('0xaa')](_0x25c1('0xba'),'MRCP_RECOG_CONFIDENCE');if(_0x211d3f[_0x25c1('0xab')]===-0x1){return _0x211d3f;}var _0x72e665=this[_0x25c1('0xaa')](_0x25c1('0xbb'),'MRCP_RECOG_TRANSCRIPT');if(_0x72e665[_0x25c1('0xab')]===-0x1){return _0x72e665;}var _0x47a731=this[_0x25c1('0xaa')](_0x25c1('0xbc'),_0x25c1('0xbd'));if(_0x47a731['result']===-0x1){return _0x47a731;}return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0xbe'),_0x412bb7));};AGIVertices[_0x25c1('0x12')][_0x25c1('0x8')]=function(_0x2e18b5){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x2e18b5[_0x25c1('0xb1')]));return this[_0x25c1('0xf')][_0x25c1('0x8')]([_0x2e18b5[_0x25c1('0xbf')],_0x2e18b5[_0x25c1('0xc0')]]);};AGIVertices['prototype'][_0x25c1('0xc1')]=function(_0xc402d1){logger[_0x25c1('0x2f')](util['format'](_0x25c1('0xc2'),_0xc402d1[_0x25c1('0xb1')]));if(this[_0x25c1('0xac')](_0xc402d1['timeout'])){logger['info'](util['format'](_0x25c1('0xc3'),_0xc402d1[_0x25c1('0x6e')]));var _0x278be7=this[_0x25c1('0xf')][_0x25c1('0xc4')](_0xc402d1[_0x25c1('0x6e')]);if(_0x278be7[_0x25c1('0xab')]===-0x1){return _0x278be7;}}return this[_0x25c1('0xf')][_0x25c1('0xc1')]();};AGIVertices[_0x25c1('0x12')][_0x25c1('0x48')]=function(_0x585c0c){logger['info'](util[_0x25c1('0x29')](_0x25c1('0xc5'),_0x585c0c[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x585c0c[_0x25c1('0xc6')])){return this['channel'][_0x25c1('0x2d')](_0x585c0c,'no\x20list\x20selected');}_0x585c0c[_0x25c1('0x47')]=moment();if(this[_0x25c1('0xac')](_0x585c0c[_0x25c1('0xc7')])){_0x585c0c[_0x25c1('0x47')]=moment()['add'](_0x585c0c['delay'],_0x25c1('0x52'));}if(!this[_0x25c1('0xac')](_0x585c0c[_0x25c1('0x4b')])){_0x585c0c['callback_priority']=0x2;}this['createCmContact'][_0x25c1('0x77')](this,_0x585c0c);return this[_0x25c1('0xf')]['noop'](util[_0x25c1('0x29')](_0x25c1('0xc8'),_0x585c0c[_0x25c1('0x46')],_0x585c0c[_0x25c1('0xc6')],_0x585c0c[_0x25c1('0x47')]));};AGIVertices[_0x25c1('0x12')][_0x25c1('0xc9')]=function(_0x46522a){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0xca'),_0x46522a[_0x25c1('0xb1')]));var _0x1f53c3=this[_0x25c1('0xf')]['exec'](_0x46522a[_0x25c1('0xcb')],_0x46522a[_0x25c1('0x7f')]);if(_0x1f53c3['result']===-0x1){return _0x1f53c3;}return this[_0x25c1('0xf')]['noop'](util[_0x25c1('0x29')](_0x25c1('0xcc'),_0x46522a['application'],_0x46522a[_0x25c1('0x7f')]));};AGIVertices[_0x25c1('0x12')][_0x25c1('0xcd')]=function(_0x2c350c){logger[_0x25c1('0x2f')](util['format'](_0x25c1('0xce'),_0x2c350c[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x2c350c[_0x25c1('0x64')])){return this['channel'][_0x25c1('0xb2')](_0x25c1('0xb3'));}var _0x460514='\x22'+_0x2c350c['text']+'\x22';if(this[_0x25c1('0xac')](_0x2c350c[_0x25c1('0x7f')])){_0x460514+=','+_0x2c350c[_0x25c1('0x7f')];}var _0x4095af=this[_0x25c1('0xf')][_0x25c1('0x5f')](_0x25c1('0xb4'),_0x460514);if(_0x4095af[_0x25c1('0xab')]===-0x1){return _0x4095af;}return this['channel']['noop'](util['format'](_0x25c1('0xcf'),_0x460514));};AGIVertices[_0x25c1('0x12')][_0x25c1('0xd0')]=function(_0x529ea6){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0xd1'),_0x529ea6[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x529ea6[_0x25c1('0x64')])){return this[_0x25c1('0xf')]['noop'](_0x25c1('0xb3'));}var _0x318cdf='\x22'+_0x529ea6['text']+'\x22';if(this[_0x25c1('0xac')](_0x529ea6[_0x25c1('0x7f')])){_0x318cdf+=','+_0x529ea6[_0x25c1('0x7f')];}var _0x2fc724=this[_0x25c1('0xf')][_0x25c1('0x5f')](_0x25c1('0xb4'),_0x318cdf);if(_0x2fc724[_0x25c1('0xab')]===-0x1){return _0x2fc724;}return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0xcf'),_0x318cdf));};AGIVertices[_0x25c1('0x12')][_0x25c1('0xd2')]=function(_0x253941){logger['info'](util['format'](_0x25c1('0xd3'),_0x253941[_0x25c1('0xb1')]));if(!this['isConfigured'](_0x253941[_0x25c1('0xb7')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')]('no\x20grammar\x20configured');}var _0x1ac8b3=_0x253941[_0x25c1('0xb7')];if(this[_0x25c1('0xac')](_0x253941[_0x25c1('0x7f')])){_0x1ac8b3+=','+_0x253941[_0x25c1('0x7f')];}var _0x5d0b5f=this[_0x25c1('0xf')][_0x25c1('0x5f')](_0x25c1('0xb9'),_0x1ac8b3);if(_0x5d0b5f[_0x25c1('0xab')]===-0x1){return _0x5d0b5f;}var _0x4fa88e=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x4fa88e[_0x25c1('0xab')]===-0x1){return _0x4fa88e;}var _0x478ecf=this[_0x25c1('0xaa')]('RECOG_INPUT()',_0x25c1('0xd4'));if(_0x478ecf[_0x25c1('0xab')]===-0x1){return _0x478ecf;}var _0x135a4f=this[_0x25c1('0xaa')](_0x25c1('0xbc'),_0x25c1('0xd5'));if(_0x135a4f[_0x25c1('0xab')]===-0x1){return _0x135a4f;}return this['channel']['noop'](util[_0x25c1('0x29')](_0x25c1('0xbe'),_0x1ac8b3));};AGIVertices[_0x25c1('0x12')][_0x25c1('0xd6')]=function(_0x300282){logger['info'](util['format'](_0x25c1('0xd7'),_0x300282[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x300282[_0x25c1('0xb7')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xb8'));}var _0x255c1a=_0x300282[_0x25c1('0xb7')];if(this[_0x25c1('0xac')](_0x300282[_0x25c1('0x7f')])){_0x255c1a+=','+_0x300282[_0x25c1('0x7f')];}var _0x4fd6a3=this[_0x25c1('0xf')][_0x25c1('0x5f')]('MRCPRecog',_0x255c1a);if(_0x4fd6a3[_0x25c1('0xab')]===-0x1){return _0x4fd6a3;}var _0x2418c9=this[_0x25c1('0xaa')](_0x25c1('0xba'),'SESTEK_ASR_CONFIDENCE');if(_0x2418c9[_0x25c1('0xab')]===-0x1){return _0x2418c9;}var _0x47d0d7=this['getAndSetVariable'](_0x25c1('0xbb'),_0x25c1('0xd8'));if(_0x47d0d7['result']===-0x1){return _0x47d0d7;}var _0x569b69=this[_0x25c1('0xaa')](_0x25c1('0xbc'),_0x25c1('0xd9'));if(_0x569b69[_0x25c1('0xab')]===-0x1){return _0x569b69;}return this[_0x25c1('0xf')]['noop'](util[_0x25c1('0x29')](_0x25c1('0xbe'),_0x255c1a));};AGIVertices['prototype']['database']=function(_0x38ed31){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0xda'),_0x38ed31[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x38ed31[_0x25c1('0xdb')])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x38ed31,_0x25c1('0xdc'));}var _0x32f7cf=this[_0x25c1('0xdd')][_0x25c1('0x77')](this,_0x38ed31[_0x25c1('0xdb')]);if(!_0x32f7cf){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x38ed31,_0x25c1('0xde'));}if(!this[_0x25c1('0xac')](_0x38ed31[_0x25c1('0x30')])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x38ed31,_0x25c1('0xdf'));}var _0x3294f7=_0x38ed31[_0x25c1('0x30')][_0x25c1('0x61')](/(\r\n|\n|\r)/gm,'\x20');this[_0x25c1('0xf')]['noop'](util[_0x25c1('0x29')]('query:\x20%s',_0x3294f7));var _0x37d7ad=this['getQueryOdbc']['sync'](this,_0x32f7cf,_0x3294f7);this['createSquareDetailsReport']['sync'](this,_0x38ed31,_0x3294f7);if(!this[_0x25c1('0xac')](_0x38ed31[_0x25c1('0xe0')])){return this[_0x25c1('0xf')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3b65e8=this[_0x25c1('0x13')]['sync'](this,_0x38ed31[_0x25c1('0xe0')]);if(!_0x3b65e8){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x38ed31,_0x25c1('0xe1'));}var _0x1d789d=this;_0x37d7ad[_0x25c1('0xe2')](function(_0x3071ea,_0x378429){Object['keys'](_0x3071ea)[_0x25c1('0xe2')](function(_0x3277ce){_0x1d789d['channel']['setVariable'](util['format'](_0x25c1('0xe3'),_0x3b65e8,_0x378429,_0x3277ce),_0x3071ea[_0x3277ce]);});});this[_0x25c1('0xf')][_0x25c1('0xa5')](util[_0x25c1('0x29')](_0x25c1('0xe4'),_0x3b65e8),_0x37d7ad['length']);return this[_0x25c1('0xf')][_0x25c1('0xb2')](util['format'](_0x25c1('0xe5'),_0x3b65e8));};AGIVertices[_0x25c1('0x12')][_0x25c1('0xe6')]=function(_0x3c0292){logger[_0x25c1('0xe7')](util['format'](_0x25c1('0xe8'),_0x3c0292[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x3c0292[_0x25c1('0xe9')])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x3c0292,_0x25c1('0xea'));}var _0x271769=this[_0x25c1('0xeb')]['sync'](this,_0x3c0292[_0x25c1('0xe9')]);if(!_0x271769){return this['channel'][_0x25c1('0x2d')](_0x3c0292,'no\x20user\x20found');}var _0x320993=this[_0x25c1('0xf')][_0x25c1('0x5f')](_0x25c1('0xec'),[util[_0x25c1('0x29')](_0x25c1('0xed'),_0x271769),_0x3c0292[_0x25c1('0x6e')],_0x3c0292['opts'],_0x3c0292['url']]);if(_0x320993[_0x25c1('0xab')]===-0x1){return _0x320993;}return this[_0x25c1('0xf')][_0x25c1('0xb2')](util['format'](_0x25c1('0xee'),_0x25c1('0xec')));};AGIVertices['prototype'][_0x25c1('0xef')]=function(_0x2aa0fb){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0xf0'),_0x2aa0fb[_0x25c1('0xb1')]));if(!this['isConfigured'](_0x2aa0fb[_0x25c1('0x81')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xf1'));}if(!this[_0x25c1('0xac')](_0x2aa0fb[_0x25c1('0x64')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xb3'));}this[_0x25c1('0xf')][_0x25c1('0xf2')]=!![];this[_0x25c1('0x35')](_0x2aa0fb);this[_0x25c1('0x3f')](_0x2aa0fb[_0x25c1('0x64')],'in','','');this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0xf3'),_0x2aa0fb[_0x25c1('0x64')]));var _0xbb7a3c=this[_0x25c1('0x80')][_0x25c1('0x77')](this,_0x2aa0fb);if(_0xbb7a3c){for(var _0x480710 in _0xbb7a3c){if(_0xbb7a3c[_0x25c1('0x9f')](_0x480710)){this['channel']['setVariable'](util[_0x25c1('0x29')](_0x25c1('0xf4'),_0x480710[_0x25c1('0xf5')]()),_0xbb7a3c[_0x480710]);}}this[_0x25c1('0x3f')](_0xbb7a3c['speech'],_0x25c1('0xf6'),_0x25c1('0xef'),'');return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0xf7'),_0xbb7a3c[_0x25c1('0xf8')]));}return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x2aa0fb,_0x25c1('0xf9'));};AGIVertices[_0x25c1('0x12')][_0x25c1('0xfa')]=function(_0x2df80b){logger[_0x25c1('0x2f')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x2df80b['label']));if(!this[_0x25c1('0xac')](_0x2df80b[_0x25c1('0xfb')])){return this['channel'][_0x25c1('0xb2')](_0x25c1('0xfc'));}if(!this[_0x25c1('0xac')](_0x2df80b[_0x25c1('0x83')])){return this[_0x25c1('0xf')]['noop'](_0x25c1('0xfd'));}if(!this[_0x25c1('0xac')](_0x2df80b[_0x25c1('0x84')])){return this[_0x25c1('0xf')]['noop'](_0x25c1('0xfe'));}if(!this[_0x25c1('0xac')](_0x2df80b[_0x25c1('0x85')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xff'));}if(!this[_0x25c1('0xac')](_0x2df80b[_0x25c1('0x64')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xb3'));}this['channel'][_0x25c1('0xf2')]=!![];this['createSquareDetailsReport'](_0x2df80b);this[_0x25c1('0x3f')](_0x2df80b[_0x25c1('0x64')],'in','','');this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')]('Trying\x20DialogflowV2:\x20%s',_0x2df80b[_0x25c1('0x64')]));var _0x489d78=this['googleDialogflowV2'][_0x25c1('0x77')](this,_0x2df80b);if(_0x489d78){for(var _0x794186 in _0x489d78){if(_0x489d78[_0x25c1('0x9f')](_0x794186)){if(_0x794186!==_0x25c1('0x100')){this[_0x25c1('0xf')][_0x25c1('0xa5')](util[_0x25c1('0x29')](_0x25c1('0xf4'),_0x794186[_0x25c1('0xf5')]()),_0x489d78[_0x794186]);}}}this[_0x25c1('0x3f')](_0x489d78[_0x25c1('0xf8')],_0x25c1('0xf6'),_0x25c1('0xfa'),_0x489d78[_0x25c1('0x100')]);return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')]('DialogflowV2\x20Result\x20%s',_0x489d78[_0x25c1('0xf8')]));}return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x2df80b,_0x25c1('0x101'));};AGIVertices[_0x25c1('0x12')]['sesteknda']=function(_0x35d77a){logger['info'](util['format'](_0x25c1('0x102'),_0x35d77a['label']));if(!this[_0x25c1('0xac')](_0x35d77a[_0x25c1('0x103')])){return this['channel'][_0x25c1('0xb2')](_0x25c1('0x104'));}if(!this['isConfigured'](_0x35d77a[_0x25c1('0x105')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x106'));}if(!this['isConfigured'](_0x35d77a[_0x25c1('0x107')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x108'));}if(!this[_0x25c1('0xac')](_0x35d77a[_0x25c1('0x109')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')]('no\x20text\x20configured');}this['channel'][_0x25c1('0xf2')]=!![];this[_0x25c1('0x35')](_0x35d77a);this[_0x25c1('0x3f')](_0x35d77a[_0x25c1('0x64')],'in','','');this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x10a'),_0x35d77a[_0x25c1('0x64')]));var _0x12cc47=this['sestekNDA']['sync'](this,_0x35d77a);if(_0x12cc47){for(var _0x2b87d2 in _0x12cc47){if(_0x12cc47[_0x25c1('0x9f')](_0x2b87d2)){this[_0x25c1('0xf')][_0x25c1('0xa5')](util[_0x25c1('0x29')]('SESTEK_NDA_%s',_0x2b87d2[_0x25c1('0xf5')]()),_0x12cc47[_0x2b87d2]);}}this[_0x25c1('0x3f')](_0x12cc47['speech'],_0x25c1('0xf6'),'sesteknda','');if(_0x12cc47[_0x25c1('0x10b')]){this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x10c'),_0x12cc47[_0x25c1('0x10b')]));var _0x5dc717=this[_0x25c1('0xf')][_0x25c1('0x10d')](_0x12cc47['audiofile']);try{fs[_0x25c1('0x10e')](_0x12cc47[_0x25c1('0x10b')]+'.wav');}catch(_0xc8ab54){logger['error'](_0xc8ab54);}return _0x5dc717;}else{return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x10f'),_0x12cc47['speech']));}}return this['channel']['error'](_0x35d77a,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x25c1('0x12')][_0x25c1('0x110')]=function(_0x58ad0e){logger[_0x25c1('0x2f')](util['format'](_0x25c1('0x111'),_0x58ad0e[_0x25c1('0xb1')]));return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x110'));};AGIVertices[_0x25c1('0x12')][_0x25c1('0x112')]=function(_0x4f9f90){logger['info'](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x4f9f90[_0x25c1('0xb1')]));var _0x5c7f2b='';if(_0x4f9f90[_0x25c1('0x113')]){if(!this[_0x25c1('0xac')](_0x4f9f90[_0x25c1('0x113')])){return this['channel'][_0x25c1('0x2d')](_0x4f9f90,_0x25c1('0x114'));}else{var _0x53d4e6=parseInt(_0x4f9f90[_0x25c1('0x113')],0xa);if(isNaN(_0x53d4e6)){_0x5c7f2b=_0x4f9f90[_0x25c1('0x113')];}else{_0x5c7f2b=this['getTrunk'][_0x25c1('0x77')](this,_0x4f9f90['trunk_id']);if(!_0x5c7f2b){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x4f9f90,_0x25c1('0x115'));}}}}else if(_0x4f9f90['trunk_name']){_0x5c7f2b=_0x4f9f90[_0x25c1('0x116')];}else{return this['channel'][_0x25c1('0x2d')](_0x4f9f90,'no\x20trunk\x20selected');}var _0x245bb1=this[_0x25c1('0xf')]['exec'](_0x25c1('0xec'),[util[_0x25c1('0x29')](_0x25c1('0x117'),_0x5c7f2b,_0x4f9f90[_0x25c1('0x46')]),_0x4f9f90[_0x25c1('0x6e')],_0x4f9f90[_0x25c1('0x118')],_0x4f9f90[_0x25c1('0x6c')]]);if(_0x245bb1['result']===-0x1){return _0x245bb1;}return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0xee'),_0x25c1('0xec')));};AGIVertices['prototype'][_0x25c1('0x119')]=function(_0x576ad5){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x11a'),_0x576ad5[_0x25c1('0xb1')]));return this[_0x25c1('0xf')][_0x25c1('0xb2')]('finally');};AGIVertices[_0x25c1('0x12')][_0x25c1('0xd')]=function(_0x27e159){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x11b'),_0x27e159[_0x25c1('0xb1')]));if(_0x27e159['retry']===0x0){return this[_0x25c1('0xad')](_0x27e159);}_0x27e159['retry']-=0x1;if(!this[_0x25c1('0xac')](_0x27e159[_0x25c1('0x11c')])){return this['channel'][_0x25c1('0x2d')](_0x27e159,_0x25c1('0x11d'));}var _0x4f2959=this[_0x25c1('0x1d')][_0x25c1('0x77')](this,_0x27e159['file_id']);if(!_0x4f2959){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x27e159,'no\x20file\x20audio\x20found');}if(!this[_0x25c1('0xac')](_0x27e159[_0x25c1('0xe0')])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x25c1('0x11e'));}var _0xbec462=this[_0x25c1('0xf')][_0x25c1('0x11f')](_0x4f2959,_0x27e159[_0x25c1('0x120')],_0x27e159[_0x25c1('0x121')]);var _0x359c39=_0xbec462[_0x25c1('0xab')]?_0xbec462[_0x25c1('0xab')][_0x25c1('0x4a')]():'';logger[_0x25c1('0x2f')]('test',JSON[_0x25c1('0x7b')](_0xbec462));if(_0xbec462[_0x25c1('0xab')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x27e159,_0x359c39);return _0xbec462;}else if(_0xbec462['extra']===_0x25c1('0x6e')){_0xbec462['result']=_0x359c39['length']>=parseInt(_0x27e159[_0x25c1('0x122')])?'x':'i';}else{_0xbec462[_0x25c1('0xab')]=_0x359c39['length']>=parseInt(_0x27e159[_0x25c1('0x122')])&&_0x359c39[_0x25c1('0xa3')]<=parseInt(_0x27e159[_0x25c1('0x121')])?'x':'i';}var _0x37c5b0=this[_0x25c1('0x13')][_0x25c1('0x77')](this,_0x27e159['variable_id']);if(!_0x37c5b0){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x27e159,_0x25c1('0xe1'));}this[_0x25c1('0xf')][_0x25c1('0xa5')](_0x37c5b0,_0x359c39);if(this[_0x25c1('0xac')](_0x27e159['hiddendigitsnum'])){var _0x49dd56=parseInt(_0x27e159['hiddendigitsnum'],0xa);var _0x49f80c=rs[_0x25c1('0x123')]({'charset':'*','length':_0x49dd56});var _0x59f723=_0x359c39['length'];if(_0x59f723>0x0){if(_0x59f723>_0x49dd56){this[_0x25c1('0x35')][_0x25c1('0x77')](this,_0x27e159,_0x27e159[_0x25c1('0x124')]==='first'?_0x49f80c+_0x359c39[_0x25c1('0x125')](_0x49dd56):_0x359c39[_0x25c1('0x125')](0x0,_0x59f723-_0x49dd56)+_0x49f80c);}else{this[_0x25c1('0x35')][_0x25c1('0x77')](this,_0x27e159,rs[_0x25c1('0x123')]({'charset':'*','length':_0x59f723}));}}else{this[_0x25c1('0x35')][_0x25c1('0x77')](this,_0x27e159,'');}}else{this[_0x25c1('0x35')][_0x25c1('0x77')](this,_0x27e159,_0x359c39);}return _0xbec462;};AGIVertices['prototype']['getsecretdigits']=function(_0x43d2d1){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x43d2d1[_0x25c1('0xb1')]));return this[_0x25c1('0xd')](_0x43d2d1);};AGIVertices['prototype'][_0x25c1('0x126')]=function(_0x3ba80f){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x127'),_0x3ba80f[_0x25c1('0xb1')]));this[_0x25c1('0x35')]['sync'](this,_0x3ba80f,_0x3ba80f[_0x25c1('0x128')]);return this[_0x25c1('0xf')][_0x25c1('0xb2')](util['format'](_0x25c1('0x129'),_0x3ba80f[_0x25c1('0x128')]));};AGIVertices[_0x25c1('0x12')][_0x25c1('0x12a')]=function(_0x4780bd){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x12b'),_0x4780bd[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x4780bd[_0x25c1('0x8d')])||!this[_0x25c1('0xac')](_0x4780bd[_0x25c1('0x8e')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x12c'));}if(!this[_0x25c1('0xac')](_0x4780bd[_0x25c1('0x64')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xb3'));}this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x12d'),_0x4780bd[_0x25c1('0x64')]));var _0x54d85c=this['awsPolly'][_0x25c1('0x77')](this,_0x4780bd);if(_0x54d85c){this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')]('aws\x20Polly\x20%s\x20file\x20created',_0x54d85c));var _0x470e6d=this[_0x25c1('0xf')][_0x25c1('0x10d')](_0x54d85c);try{fs[_0x25c1('0x10e')](_0x54d85c+_0x25c1('0x12e'));}catch(_0x4d3e9b){logger[_0x25c1('0x2d')](_0x4d3e9b);}return _0x470e6d;}return this['channel'][_0x25c1('0x2d')](_0x4780bd,_0x25c1('0x12f'));};AGIVertices[_0x25c1('0x12')][_0x25c1('0x130')]=function(_0x5f3247){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x131'),_0x5f3247[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x5f3247[_0x25c1('0x8d')])||!this[_0x25c1('0xac')](_0x5f3247[_0x25c1('0x8e')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x5f3247[_0x25c1('0x94')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')]('no\x20bot\x20name\x20configured');}if(!this[_0x25c1('0xac')](_0x5f3247[_0x25c1('0x64')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xb3'));}this['channel'][_0x25c1('0xf2')]=!![];this[_0x25c1('0x35')](_0x5f3247);this[_0x25c1('0x3f')](_0x5f3247[_0x25c1('0x64')],'in','','');this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x132'),_0x5f3247[_0x25c1('0x64')]));var _0x58fde1=this[_0x25c1('0x92')][_0x25c1('0x77')](this,_0x5f3247);if(_0x58fde1){for(var _0x3263cb in _0x58fde1){if(_0x58fde1[_0x25c1('0x9f')](_0x3263cb)&&_['isString'](_0x58fde1[_0x3263cb])){this[_0x25c1('0xf')][_0x25c1('0xa5')](util['format'](_0x25c1('0x133'),_0x3263cb[_0x25c1('0xf5')]()),_0x58fde1[_0x3263cb]);}}if(_[_0x25c1('0x42')](_0x58fde1[_0x25c1('0x7d')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x134'));}else{this[_0x25c1('0x3f')](_0x58fde1[_0x25c1('0x7d')],'out',_0x25c1('0x135'),'');return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x136'),_0x58fde1[_0x25c1('0x7d')]));}}return this['channel']['error'](_0x5f3247,_0x25c1('0x137'));};AGIVertices['prototype'][_0x25c1('0x138')]=function(_0xfecf83){logger['info'](util['format'](_0x25c1('0x139'),_0xfecf83['label'],_0xfecf83[_0x25c1('0x6e')]));if(!this[_0x25c1('0xac')](_0xfecf83['key'])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xf1'));}var _0x3d5b69=_0x25c1('0x13a');var _0x5c619c=util[_0x25c1('0x29')](_0x25c1('0x13b'),FILES_PATH,rs[_0x25c1('0x123')](0x4));var _0x336d03=util['format'](_0x25c1('0xa4'),_0x5c619c,_0x3d5b69);var _0x8c01e7=!![];if(_0xfecf83['beep']==='NOBEEP'){_0x8c01e7=![];}var _0x3e97d4=this[_0x25c1('0xf')]['recordFile'](_0x5c619c,_0x3d5b69,_0xfecf83[_0x25c1('0x13c')],_0xfecf83[_0x25c1('0x6e')],undefined,_0x8c01e7);if(_0x3e97d4[_0x25c1('0xab')]!==-0x1){this['channel'][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x13d'),_0x336d03));var _0x304a3c=this['googleASR'][_0x25c1('0x77')](this,_0xfecf83,_0x336d03);if(_0x304a3c){for(var _0x36852e in _0x304a3c){if(_0x304a3c['hasOwnProperty'](_0x36852e)){this[_0x25c1('0xf')][_0x25c1('0xa5')](util[_0x25c1('0x29')](_0x25c1('0x13e'),_0x36852e[_0x25c1('0xf5')]()),_0x304a3c[_0x36852e]);}}return this[_0x25c1('0xf')][_0x25c1('0xb2')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0x25c1('0x7b')](_0x304a3c)));}}return _0x3e97d4;};AGIVertices[_0x25c1('0x12')][_0x25c1('0x13f')]=function(_0x2c334c){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x140'),_0x2c334c[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x2c334c[_0x25c1('0x141')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x142'));}if(!this['isConfigured'](_0x2c334c[_0x25c1('0x98')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x143'));}var _0x3d1bcb='wav';var _0xf15153=util['format'](_0x25c1('0x13b'),FILES_PATH,rs['generate'](0x4));var _0xa5ceed=util['format'](_0x25c1('0xa4'),_0xf15153,_0x3d1bcb);var _0x5b09bd=!![];if(_0x2c334c[_0x25c1('0x144')]==='NOBEEP'){_0x5b09bd=![];}var _0x19e553=this['channel'][_0x25c1('0x145')](_0xf15153,_0x3d1bcb,_0x2c334c[_0x25c1('0x13c')],_0x2c334c[_0x25c1('0x6e')],undefined,_0x5b09bd);if(_0x19e553[_0x25c1('0xab')]!==-0x1){this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x146'),_0xa5ceed));var _0x378927=this['tildeASR']['sync'](this,_0x2c334c,_0xa5ceed);if(_0x378927){for(var _0x438d00 in _0x378927){if(_0x378927[_0x25c1('0x9f')](_0x438d00)){this[_0x25c1('0xf')][_0x25c1('0xa5')](util['format'](_0x25c1('0x147'),_0x438d00[_0x25c1('0xf5')]()),_0x378927[_0x438d00]);}}return this['channel'][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x148'),JSON[_0x25c1('0x7b')](_0x378927)));}}return _0x19e553;};AGIVertices[_0x25c1('0x12')][_0x25c1('0x149')]=function(_0x739ce3){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x739ce3[_0x25c1('0xb1')]));return this[_0x25c1('0xf')][_0x25c1('0x14a')](_0x739ce3['context'],_0x739ce3[_0x25c1('0x3b')],_0x739ce3[_0x25c1('0x14b')]);};AGIVertices['prototype'][_0x25c1('0x14c')]=function(_0x2a670c){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x2a670c['label']));if(!this[_0x25c1('0xac')](_0x2a670c[_0x25c1('0x14d')])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x2a670c,_0x25c1('0x14e'));}try{var _0x155a28=eval(_0x2a670c[_0x25c1('0x14d')])?_0x25c1('0x14f'):'false';this['channel'][_0x25c1('0xb2')](util['format'](_0x25c1('0x150'),_0x2a670c[_0x25c1('0x14d')],_0x155a28));return{'code':0xc8,'result':_0x155a28};}catch(_0x561fb5){return{'code':0xc8,'result':_0x25c1('0x151')};}};AGIVertices[_0x25c1('0x12')][_0x25c1('0x152')]=function(_0x57dcea){logger['info'](util[_0x25c1('0x29')](_0x25c1('0x153'),_0x57dcea[_0x25c1('0xb1')]));if(!this['isConfigured'](_0x57dcea[_0x25c1('0x154')])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x57dcea,_0x25c1('0x155'));}var _0x4f22ba=this[_0x25c1('0x23')]['sync'](this,_0x57dcea['interval_id']);if(!_0x4f22ba){return this[_0x25c1('0xf')]['error'](_0x57dcea,_0x25c1('0x156'));}for(var _0x3d68d2=0x0;_0x3d68d2<_0x4f22ba['length'];_0x3d68d2+=0x1){var _0x5738d7=this['channel'][_0x25c1('0x13')](util[_0x25c1('0x29')]('IFTIME(%s?true:false)',_0x4f22ba[_0x3d68d2]));if(_0x5738d7[_0x25c1('0xab')]===-0x1){return _0x5738d7;}logger['info'](util[_0x25c1('0x29')](_0x25c1('0x157'),_0x4f22ba[_0x3d68d2],_0x5738d7[_0x25c1('0xa9')]));if(_0x5738d7[_0x25c1('0xa9')]==='true'){logger[_0x25c1('0x2f')](util['format'](_0x25c1('0x157'),_0x4f22ba[_0x3d68d2],_0x25c1('0x14f')));this[_0x25c1('0xf')][_0x25c1('0xb2')](util['format']('IFTIME\x20%s\x20%s',_0x4f22ba[_0x3d68d2],_0x25c1('0x14f')));return{'code':0xc8,'result':_0x25c1('0x14f')};}else{logger[_0x25c1('0x2f')](util['format'](_0x25c1('0x157'),_0x4f22ba[_0x3d68d2],_0x25c1('0x151')));this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x157'),_0x4f22ba[_0x3d68d2],_0x25c1('0x151')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype']['hangup']=function(_0x550f64){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x158'),_0x550f64[_0x25c1('0xb1')]));return this[_0x25c1('0xf')][_0x25c1('0x159')]();};AGIVertices[_0x25c1('0x12')][_0x25c1('0x15a')]=function(_0x585a34){logger['info'](util[_0x25c1('0x29')](_0x25c1('0x15b'),_0x585a34[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x585a34['key'])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xf1'));}var _0x4ac0d0='wav';var _0x31e8d7=util[_0x25c1('0x29')](_0x25c1('0x13b'),FILES_PATH,rs['generate'](0x4));var _0x21e5ca=util[_0x25c1('0x29')](_0x25c1('0xa4'),_0x31e8d7,_0x4ac0d0);var _0x2eb3b6=!![];if(_0x585a34[_0x25c1('0x144')]===_0x25c1('0x15c')){_0x2eb3b6=![];}var _0x4bc83d=this[_0x25c1('0xf')][_0x25c1('0x145')](_0x31e8d7,_0x4ac0d0,_0x585a34[_0x25c1('0x13c')],_0x585a34[_0x25c1('0x6e')],undefined,_0x2eb3b6);if(_0x4bc83d['result']!==-0x1){this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x15d'),_0x21e5ca));var _0x188250=this['ispeechASR'][_0x25c1('0x77')](this,_0x585a34,_0x21e5ca);if(_0x188250){for(var _0x5b6749 in _0x188250){if(_0x188250[_0x25c1('0x9f')](_0x5b6749)){this[_0x25c1('0xf')][_0x25c1('0xa5')](util[_0x25c1('0x29')](_0x25c1('0x15e'),_0x5b6749['toUpperCase']()),_0x188250[_0x5b6749]);}}return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x15f'),JSON[_0x25c1('0x7b')](_0x188250)));}}return _0x4bc83d;};AGIVertices[_0x25c1('0x12')][_0x25c1('0x160')]=function(_0x4f15a7){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x161'),_0x4f15a7[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x4f15a7[_0x25c1('0x81')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xf1'));}if(!this[_0x25c1('0xac')](_0x4f15a7[_0x25c1('0x64')])){return this[_0x25c1('0xf')]['noop'](_0x25c1('0xb3'));}this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x162'),_0x4f15a7[_0x25c1('0x64')]));var _0x1eda47=this['ispeechTTS'][_0x25c1('0x77')](this,_0x4f15a7);if(_0x1eda47){this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')]('ispeech\x20%s\x20file\x20created',_0x1eda47));var _0x17095=this[_0x25c1('0xf')][_0x25c1('0x10d')](_0x1eda47,_0x4f15a7[_0x25c1('0x13c')]);try{fs[_0x25c1('0x10e')](_0x1eda47+_0x25c1('0x12e'));}catch(_0x2bcf64){logger['error'](_0x2bcf64);}return _0x17095;}return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x4f15a7,_0x25c1('0x163'));};AGIVertices[_0x25c1('0x12')][_0x25c1('0x164')]=function(_0x46f0dd){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x165'),_0x46f0dd[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x46f0dd[_0x25c1('0x166')])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x46f0dd,_0x25c1('0x167'));}logger['info'](util['format'](_0x25c1('0x168'),this[_0x25c1('0xf')]['callerid'],_0x46f0dd[_0x25c1('0x166')]));var _0x1553b1=this[_0x25c1('0x5a')][_0x25c1('0x77')](this,_0x46f0dd[_0x25c1('0x166')]);if(_0x1553b1){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x169'),this[_0x25c1('0xf')]['callerid'],_0x46f0dd[_0x25c1('0x166')]));this[_0x25c1('0xf')]['noop'](util['format'](_0x25c1('0x169'),this[_0x25c1('0xf')]['callerid'],_0x46f0dd[_0x25c1('0x166')]));return{'code':0xc8,'result':_0x25c1('0x16a')};}else{logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x16b'),this[_0x25c1('0xf')][_0x25c1('0x39')],_0x46f0dd[_0x25c1('0x166')]));this[_0x25c1('0xf')][_0x25c1('0xb2')](util['format'](_0x25c1('0x16b'),this[_0x25c1('0xf')][_0x25c1('0x39')],_0x46f0dd['findBy']));return{'code':0xc8,'result':_0x25c1('0x16c')};}};AGIVertices[_0x25c1('0x12')][_0x25c1('0x16d')]=function(_0x3f796a){logger['info'](util[_0x25c1('0x29')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3f796a[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x3f796a['findBy'])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x3f796a,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x25c1('0x168'),this['channel'][_0x25c1('0x39')],_0x3f796a['findBy']));var _0x3f738a=this[_0x25c1('0x59')]['sync'](this,_0x3f796a[_0x25c1('0x166')]);if(_0x3f738a){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x169'),this[_0x25c1('0xf')][_0x25c1('0x39')],_0x3f796a[_0x25c1('0x166')]));this[_0x25c1('0xf')][_0x25c1('0xb2')](util['format'](_0x25c1('0x169'),this['channel']['callerid'],_0x3f796a['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x16b'),this[_0x25c1('0xf')][_0x25c1('0x39')],_0x3f796a[_0x25c1('0x166')]));this[_0x25c1('0xf')]['noop'](util[_0x25c1('0x29')](_0x25c1('0x16b'),this[_0x25c1('0xf')][_0x25c1('0x39')],_0x3f796a['findBy']));return{'code':0xc8,'result':_0x25c1('0x16c')};}};AGIVertices[_0x25c1('0x12')][_0x25c1('0x16e')]=function(_0x2588e5){logger[_0x25c1('0x2f')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x2588e5[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x2588e5['operation'])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x2588e5,_0x25c1('0x16f'));}this[_0x25c1('0xf')][_0x25c1('0xb2')](util['format'](_0x25c1('0x170'),_0x2588e5[_0x25c1('0x171')]));var _0x596add=eval(_0x2588e5[_0x25c1('0x171')]);if(!this[_0x25c1('0xac')](_0x2588e5[_0x25c1('0xe0')])){return this['channel']['noop'](_0x25c1('0x11e'));}var _0x33adfe=this[_0x25c1('0x13')][_0x25c1('0x77')](this,_0x2588e5[_0x25c1('0xe0')]);if(!_0x33adfe){return this[_0x25c1('0xf')]['error'](_0x2588e5,'no\x20variable\x20found');}if(_[_0x25c1('0xa1')](_0x596add)){var _0x110119=this;_0x596add[_0x25c1('0xe2')](function(_0x2902e6,_0x370f33){_0x110119['channel'][_0x25c1('0xa5')](util['format'](_0x25c1('0x172'),_0x33adfe,_0x370f33),_0x2902e6);});return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x173'),_0x33adfe));}else{return this['channel']['setVariable'](_0x33adfe,_0x596add);}};AGIVertices[_0x25c1('0x12')]['menu']=function(_0xe91fae){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0xe91fae[_0x25c1('0xb1')]));if(_0xe91fae[_0x25c1('0xae')]===0x0){return this['maxRetry'](_0xe91fae);}_0xe91fae[_0x25c1('0xae')]-=0x1;if(!this[_0x25c1('0xac')](_0xe91fae[_0x25c1('0x11c')])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0xe91fae,_0x25c1('0x11d'));}var _0x38b9ad=this['getSound']['sync'](this,_0xe91fae[_0x25c1('0x11c')]);if(!_0x38b9ad){return this['channel'][_0x25c1('0x2d')](_0xe91fae,'no\x20file\x20audio\x20found');}var _0x4b22cc=this[_0x25c1('0xf')]['getData'](_0x38b9ad,_0xe91fae[_0x25c1('0x120')],_0xe91fae[_0x25c1('0x174')]);var _0x53aac3=_0x4b22cc[_0x25c1('0xab')];if(_0x4b22cc[_0x25c1('0xab')]===-0x1){this[_0x25c1('0x35')][_0x25c1('0x77')](this,_0xe91fae,'-1');return _0x4b22cc;}else if(_0x4b22cc['extra']===_0x25c1('0x6e')){_0x4b22cc['result']=_0x4b22cc[_0x25c1('0xab')]['length']>0x0?_0x4b22cc['result']:'t';}else if(_[_0x25c1('0x41')](_0x4b22cc[_0x25c1('0xab')])){_0x4b22cc[_0x25c1('0xab')]='#';_0x53aac3='#';}if(!this[_0x25c1('0xac')](_0xe91fae[_0x25c1('0xe0')])){this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x11e'));}else{var _0x1730d2=this['getVariable'][_0x25c1('0x77')](this,_0xe91fae['variable_id']);if(!_0x1730d2){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0xe91fae,'no\x20variable\x20found');}this[_0x25c1('0xf')]['setVariable'](_0x1730d2,_0x53aac3);}this[_0x25c1('0x35')]['sync'](this,_0xe91fae,_0x53aac3);return _0x4b22cc;};AGIVertices[_0x25c1('0x12')][_0x25c1('0xb2')]=function(_0x3b40f3){logger['info'](util[_0x25c1('0x29')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x3b40f3[_0x25c1('0xb1')]));return this[_0x25c1('0xf')]['noop'](_0x3b40f3[_0x25c1('0x175')]||_0x3b40f3[_0x25c1('0xb1')]);};AGIVertices[_0x25c1('0x12')][_0x25c1('0x176')]=function(_0x3f1667){logger['info'](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x3f1667[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x3f1667[_0x25c1('0x166')])){return this['channel']['error'](_0x3f1667,_0x25c1('0x167'));}logger[_0x25c1('0x2f')](util[_0x25c1('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x25c1('0xf')][_0x25c1('0x39')],_0x3f1667['findBy']));var _0x5816e5=this[_0x25c1('0x54')][_0x25c1('0x77')](this,_0x3f1667[_0x25c1('0x177')]);var _0x5c405e=this[_0x25c1('0x56')]['sync'](this,_0x3f1667[_0x25c1('0x166')],_0x5816e5);if(_0x5c405e){logger[_0x25c1('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x25c1('0xf')][_0x25c1('0x39')],_0x3f1667[_0x25c1('0x166')]));this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x169'),this['channel'][_0x25c1('0x39')],_0x3f1667['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x25c1('0x29')](_0x25c1('0x16b'),this['channel']['callerid'],_0x3f1667[_0x25c1('0x166')]));this['channel'][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x169'),this[_0x25c1('0xf')][_0x25c1('0x39')],_0x3f1667[_0x25c1('0x166')]));return{'code':0xc8,'result':_0x25c1('0x16c')};}};AGIVertices['prototype'][_0x25c1('0x178')]=function(_0x23dc91){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x179'),_0x23dc91[_0x25c1('0xb1')]));if(!this['isConfigured'](_0x23dc91[_0x25c1('0x11c')])){return this['channel'][_0x25c1('0x2d')](_0x23dc91,_0x25c1('0x11d'));}var _0x2a5484=this[_0x25c1('0x1d')][_0x25c1('0x77')](this,_0x23dc91[_0x25c1('0x11c')]);if(!_0x2a5484){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x23dc91,'no\x20file\x20audio\x20found');}var _0x27e622=this['channel'][_0x25c1('0x5f')]('PLAYBACK',[_0x2a5484,_0x23dc91[_0x25c1('0x118')]]);if(_0x27e622[_0x25c1('0xab')]===-0x1){return _0x27e622;}return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0xcc'),_0x25c1('0x17a'),_0x2a5484));};AGIVertices[_0x25c1('0x12')][_0x25c1('0x17b')]=function(_0x2c722c){logger['info'](util[_0x25c1('0x29')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x2c722c['label']));if(!this[_0x25c1('0xac')](_0x2c722c['queue_id'])){return this['channel'][_0x25c1('0x2d')](_0x2c722c,_0x25c1('0x17c'));}var _0x4f2b6a='';var _0x1abc07=parseInt(_0x2c722c[_0x25c1('0x17d')],0xa);if(isNaN(_0x1abc07)){_0x4f2b6a=_0x2c722c[_0x25c1('0x17d')];}else{_0x4f2b6a=this[_0x25c1('0x17e')]['sync'](this,_0x2c722c[_0x25c1('0x17d')]);if(!_0x4f2b6a){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x2c722c,'no\x20queue\x20found');}}var _0x5266c7='';if(this[_0x25c1('0xac')](_0x2c722c['file_id'])){var _0x660ba6=this[_0x25c1('0x1d')][_0x25c1('0x77')](this,_0x2c722c[_0x25c1('0x11c')]);if(_0x660ba6){_0x5266c7=_0x660ba6;}}this['createSquareDetailsReport'][_0x25c1('0x77')](this,_0x2c722c,_0x4f2b6a);if(_0x2c722c[_0x25c1('0x118')]['indexOf']('x')<0x0){_0x2c722c[_0x25c1('0x118')]+='x';}if(_0x2c722c[_0x25c1('0x118')][_0x25c1('0x17f')]('X')<0x0){_0x2c722c[_0x25c1('0x118')]+='X';}this[_0x25c1('0xf')][_0x25c1('0xa5')](_0x25c1('0x180'),_0x4f2b6a?_0x4f2b6a[_0x25c1('0x181')]():'');var _0x4d4d99=this[_0x25c1('0xf')]['exec']('QUEUE',[_0x4f2b6a,_0x2c722c[_0x25c1('0x118')],_0x2c722c[_0x25c1('0x6c')],_0x5266c7,_0x2c722c[_0x25c1('0x6e')],_0x2c722c[_0x25c1('0x8')],_0x2c722c['macro'],_0x2c722c[_0x25c1('0x182')],'',_0x2c722c[_0x25c1('0x183')]]);if(_0x4d4d99[_0x25c1('0xab')]===-0x1){return _0x4d4d99;}return this['channel'][_0x25c1('0xb2')](util['format'](_0x25c1('0xcc'),_0x25c1('0x184'),_0x4f2b6a));};AGIVertices[_0x25c1('0x12')][_0x25c1('0x185')]=function(_0x4de992){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x186'),_0x4de992[_0x25c1('0xb1')]));var _0x4b0a28=_0x4de992[_0x25c1('0x187')]||'wav';var _0xf2fce8=util[_0x25c1('0x29')](_0x25c1('0x188'),this[_0x25c1('0xf')][_0x25c1('0x38')],rs[_0x25c1('0x123')](0x5));var _0x1e3889=util[_0x25c1('0x29')](_0x25c1('0x189'),FILES_PATH,_0xf2fce8,_0x4b0a28);var _0x5a7718=util[_0x25c1('0x29')](_0x25c1('0x13b'),FILES_PATH,_0xf2fce8);this[_0x25c1('0x37')][_0x25c1('0x77')](this,_0x4de992,_0xf2fce8,_0x1e3889);this[_0x25c1('0xf')]['setVariable'](_0x25c1('0x18a'),_0xf2fce8);logger[_0x25c1('0x2f')](_0x25c1('0x18b'),_0x5a7718,_0x4b0a28,_0x4de992['escape_digits'],_0x4de992['timeout']);return this[_0x25c1('0xf')]['recordFile'](_0x5a7718,_0x4b0a28,_0x4de992[_0x25c1('0x18c')],_0x4de992[_0x25c1('0x6e')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x3b9ece){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x3b9ece['label']));if(!this[_0x25c1('0xac')](_0x3b9ece[_0x25c1('0x6c')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x18d'));}var _0x48eafc=this[_0x25c1('0x6b')][_0x25c1('0x77')](this,_0x3b9ece);logger['info'](util[_0x25c1('0x29')](_0x25c1('0x18e'),util[_0x25c1('0x18f')](_0x48eafc,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x3b9ece[_0x25c1('0xe0')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x6450ac=this['getVariable'][_0x25c1('0x77')](this,_0x3b9ece['variable_id']);if(!_0x6450ac){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x3b9ece,_0x25c1('0xe1'));}this['channel'][_0x25c1('0xa5')](util[_0x25c1('0x29')](_0x25c1('0x190'),_0x6450ac),_0x48eafc[_0x25c1('0x191')]?_0x48eafc[_0x25c1('0x191')]:'200');this[_0x25c1('0xf')]['setVariable'](util[_0x25c1('0x29')]('%s_STATUS_MESSAGE',_0x6450ac),_0x48eafc['statusMessage']?_0x48eafc[_0x25c1('0x7c')]:'OK');if(_0x48eafc[_0x25c1('0x72')]){try{this['saveRestApiResult'](_0x48eafc[_0x25c1('0x72')],_0x6450ac);}catch(_0x30f5ab){logger[_0x25c1('0x2d')](util[_0x25c1('0x29')](_0x25c1('0x192'),_0x6450ac));}}return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0xe5'),_0x6450ac));};AGIVertices[_0x25c1('0x12')][_0x25c1('0x193')]=function(_0xcd42b6){logger['info'](util[_0x25c1('0x29')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0xcd42b6[_0x25c1('0xb1')]));return this[_0x25c1('0xf')]['sayDigits'](_0xcd42b6[_0x25c1('0x194')]['replace'](/\s+/g,''),_0xcd42b6['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0x258e9a){logger[_0x25c1('0x2f')](util['format'](_0x25c1('0x195'),_0x258e9a['label']));return this['channel'][_0x25c1('0x196')](_0x258e9a[_0x25c1('0x6d')][_0x25c1('0x61')](/\s+/g,''),_0x258e9a[_0x25c1('0x18c')]);};AGIVertices[_0x25c1('0x12')]['sayphonetic']=function(_0x15daa6){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x197'),_0x15daa6[_0x25c1('0xb1')]));return this[_0x25c1('0xf')][_0x25c1('0x198')](_0x15daa6['text'],_0x15daa6['escape_digits']);};AGIVertices[_0x25c1('0x12')][_0x25c1('0x199')]=function(_0x404d21){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x19a'),_0x404d21[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x404d21[_0x25c1('0x19b')])){return this[_0x25c1('0xf')]['noop']('no\x20mail\x20account\x20configured');}var _0x40cb37=this[_0x25c1('0x20')]['sync'](this,_0x404d21['account_id']);if(!_0x40cb37||!_0x40cb37['Smtp']){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x404d21,_0x25c1('0x19c'));}var _0x373175={'from':util[_0x25c1('0x29')](_0x25c1('0x19d'),_0x40cb37[_0x25c1('0x15')],_0x40cb37[_0x25c1('0x19e')]||_0x40cb37['Smtp'][_0x25c1('0x19f')]),'to':_0x404d21['to']||'','cc':_0x404d21['cc']||'','bcc':_0x404d21[_0x25c1('0x1a0')]||'','subject':_0x404d21['subject'],'html':_0x404d21[_0x25c1('0x64')],'text':_0x404d21['text']};var _0x3555dd={'tls':{'rejectUnauthorized':![]}};if(_0x40cb37[_0x25c1('0x1a1')][_0x25c1('0x1a2')]){_0x3555dd[_0x25c1('0x1a2')]=_0x40cb37['Smtp'][_0x25c1('0x1a2')];}else{_0x3555dd[_0x25c1('0x1a3')]=_0x40cb37[_0x25c1('0x1a1')][_0x25c1('0x1a3')];_0x3555dd[_0x25c1('0x1a4')]=_0x40cb37['Smtp'][_0x25c1('0x1a4')];_0x3555dd[_0x25c1('0x1a5')]=_0x40cb37[_0x25c1('0x1a1')][_0x25c1('0x1a5')];}if(_0x40cb37['Smtp']['authentication']){_0x3555dd[_0x25c1('0x1a6')]={'user':_0x40cb37['Smtp']['user'],'pass':_0x40cb37[_0x25c1('0x1a1')][_0x25c1('0x1a7')]};}if(this[_0x25c1('0xac')](_0x404d21[_0x25c1('0x1a8')])){}logger[_0x25c1('0xe7')](_0x25c1('0x1a9'),JSON[_0x25c1('0x7b')](_0x373175));this['createSquareDetailsReport'][_0x25c1('0x77')](this,_0x404d21,_0x404d21[_0x25c1('0x19b')]);this[_0x25c1('0xf')]['noop'](util['format'](_0x25c1('0x1aa'),_0x40cb37[_0x25c1('0x15')]));this[_0x25c1('0x22')][_0x25c1('0x77')](this,_0x3555dd,_0x373175);return this[_0x25c1('0xf')]['noop'](_0x25c1('0x1ab'));};AGIVertices[_0x25c1('0x12')][_0x25c1('0x1ac')]=function(_0x54a114){logger[_0x25c1('0x2f')](util['format'](_0x25c1('0x1ad'),_0x54a114[_0x25c1('0xb1')]));return this['channel'][_0x25c1('0xb2')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x25c1('0x1ae')]=function(_0x25cfd3){logger['info'](util[_0x25c1('0x29')](_0x25c1('0x1af'),_0x25cfd3[_0x25c1('0xb1')]));if(!this['isConfigured'](_0x25cfd3[_0x25c1('0x1b0')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x1b1'));}var _0x120ba3=this[_0x25c1('0x1b2')][_0x25c1('0x77')](this,_0x25cfd3[_0x25c1('0x1b0')]);if(!_0x120ba3){return this[_0x25c1('0xf')]['error'](_0x25cfd3,_0x25c1('0x1b3'));}var _0x26dd82={'body':_0x25cfd3['sms_text'],'phone':_0x25cfd3['to']||'','SmsAccountId':_0x120ba3['id']};logger['debug'](_0x25c1('0x1b4'),JSON[_0x25c1('0x7b')](_0x26dd82));this['createSquareDetailsReport'][_0x25c1('0x77')](this,_0x25cfd3,_0x25cfd3[_0x25c1('0x1b0')]);this['channel'][_0x25c1('0xb2')](util['format'](_0x25c1('0x1b5'),_0x120ba3[_0x25c1('0x15')]));this[_0x25c1('0x34')][_0x25c1('0x77')](this,_0x26dd82);return this[_0x25c1('0xf')]['noop'](_0x25c1('0x1b6'));};AGIVertices['prototype'][_0x25c1('0x1b7')]=function(_0x4a72ba){logger['info'](util[_0x25c1('0x29')](_0x25c1('0x1b8'),_0x4a72ba[_0x25c1('0xb1')]));if(!this['isConfigured'](_0x4a72ba[_0x25c1('0xe0')])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x4a72ba,_0x25c1('0x1b9'));}var _0x4b0d10=this[_0x25c1('0x13')][_0x25c1('0x77')](this,_0x4a72ba[_0x25c1('0xe0')]);if(!_0x4b0d10){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x4a72ba,_0x25c1('0xe1'));}return this[_0x25c1('0xf')]['setVariable'](_0x4b0d10,_0x4a72ba['variable_value']);};AGIVertices[_0x25c1('0x12')][_0x25c1('0x1ba')]=function(_0x2d09a3){logger[_0x25c1('0x2f')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x2d09a3[_0x25c1('0xb1')]));this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x1bb'));if(_0x2d09a3[_0x25c1('0xc1')]===_0x25c1('0x1bc')){this[_0x25c1('0xf')]['noop'](_0x25c1('0x1bd'));return this[_0x25c1('0xf')][_0x25c1('0xc1')]();}return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x1be'));};AGIVertices[_0x25c1('0x12')]['subproject']=function(_0x1ae4d7){logger[_0x25c1('0x2f')](util['format'](_0x25c1('0x1bf'),_0x1ae4d7[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x1ae4d7['project_id'])){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x1ae4d7,_0x25c1('0x1c0'));}var _0x5f0cb5=this['getSquareProject'][_0x25c1('0x77')](this,_0x1ae4d7[_0x25c1('0x1c1')]);if(!this[_0x25c1('0xac')](_0x5f0cb5)){return this[_0x25c1('0xf')]['error'](_0x1ae4d7,util['format'](_0x25c1('0x1c2'),_0x1ae4d7[_0x25c1('0x1c1')]));}if(_0x5f0cb5===this[_0x25c1('0xf')][_0x25c1('0x36')]){return this[_0x25c1('0xf')][_0x25c1('0x2d')](_0x1ae4d7,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport'][_0x25c1('0x77')](this,_0x1ae4d7,_0x5f0cb5);var _0x51b7a2=this[_0x25c1('0xf')][_0x25c1('0x5f')](_0x25c1('0x1c3'),util[_0x25c1('0x29')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x25c1('0x8')][_0x25c1('0x1a3')]||_0x25c1('0x1c4'),_0x5f0cb5,this[_0x25c1('0xf')][_0x25c1('0x36')]));if(_0x51b7a2[_0x25c1('0xab')]===-0x1){return _0x51b7a2;}return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')]('Executed\x20command\x20%s\x20%s',_0x25c1('0x1c3'),_0x5f0cb5));};AGIVertices['prototype'][_0x25c1('0x1c5')]=function(_0x1408aa){logger[_0x25c1('0x2f')](util['format'](_0x25c1('0x1c6'),_0x1408aa['label']));var _0x2e83e8=this[_0x25c1('0x5e')][_0x25c1('0x77')](this,_0x1408aa[_0x25c1('0xbf')]);this[_0x25c1('0x35')][_0x25c1('0x77')](this,_0x1408aa,_0x1408aa['command']);if(this['isConfigured'](_0x1408aa[_0x25c1('0xe0')])){var _0x5dcae3=this['getVariable'][_0x25c1('0x77')](this,_0x1408aa['variable_id']);if(_0x5dcae3){this[_0x25c1('0xf')][_0x25c1('0xa5')](_0x5dcae3,_0x2e83e8);return this[_0x25c1('0xf')][_0x25c1('0xb2')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1408aa['command'],_0x5dcae3));}}return this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x1c7'),_0x1408aa[_0x25c1('0xbf')]));};AGIVertices['prototype'][_0x25c1('0x1c8')]=function(_0x306a48){logger[_0x25c1('0x2f')](util['format'](_0x25c1('0x1c9'),_0x306a48[_0x25c1('0xb1')]));_0x306a48[_0x25c1('0x64')]=_0x306a48[_0x25c1('0x64')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x306a48[_0x25c1('0x1ca')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0x1cb'));}if(!this[_0x25c1('0xac')](_0x306a48[_0x25c1('0x64')])){return this[_0x25c1('0xf')][_0x25c1('0xb2')](_0x25c1('0xb3'));}this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x306a48['text']));var _0x261505=this[_0x25c1('0x62')]['sync'](this,_0x306a48);if(_0x261505){this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x261505));var _0x4c05b1=this['channel']['streamFile'](_0x261505);try{fs[_0x25c1('0x10e')](_0x261505+_0x25c1('0x12e'));}catch(_0x29051e){logger['error'](_0x29051e);}return _0x4c05b1;}return this['channel']['error'](_0x306a48,_0x25c1('0x1cc'));};AGIVertices[_0x25c1('0x12')]['tts']=function(_0x7d1e7a){logger['info'](util[_0x25c1('0x29')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x7d1e7a[_0x25c1('0xb1')]));_0x7d1e7a['text']=_0x7d1e7a[_0x25c1('0x64')][_0x25c1('0x61')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x25c1('0xac')](_0x7d1e7a[_0x25c1('0x64')])){return this['channel'][_0x25c1('0xb2')](_0x25c1('0xb3'));}this[_0x25c1('0xf')][_0x25c1('0xb2')](util['format'](_0x25c1('0x1cd'),_0x7d1e7a['text']));var _0x230824=this['googleTTS'][_0x25c1('0x77')](this,_0x7d1e7a);if(_0x230824){this['channel'][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x1ce'),_0x230824));var _0x45f853=this['channel']['streamFile'](_0x230824);try{fs[_0x25c1('0x10e')](_0x230824+_0x25c1('0x12e'));}catch(_0x5d905d){logger[_0x25c1('0x2d')](_0x5d905d);}return _0x45f853;}return this['channel']['error'](_0x7d1e7a,_0x25c1('0x1cf'));};AGIVertices['prototype'][_0x25c1('0x1d0')]=function(_0x4a51c3){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x1d1'),_0x4a51c3[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x4a51c3[_0x25c1('0x166')])){return this[_0x25c1('0xf')]['error'](_0x4a51c3,_0x25c1('0x167'));}logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x168'),this[_0x25c1('0xf')][_0x25c1('0x39')],_0x4a51c3[_0x25c1('0x166')]));var _0x4c432c=this[_0x25c1('0x58')]['sync'](this,_0x4a51c3[_0x25c1('0x166')]);if(_0x4c432c){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x169'),this['channel'][_0x25c1('0x39')],_0x4a51c3[_0x25c1('0x166')]));this[_0x25c1('0xf')]['noop'](util[_0x25c1('0x29')](_0x25c1('0x169'),this[_0x25c1('0xf')][_0x25c1('0x39')],_0x4a51c3['findBy']));return{'code':0xc8,'result':_0x25c1('0x16a')};}else{logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x16b'),this[_0x25c1('0xf')][_0x25c1('0x39')],_0x4a51c3[_0x25c1('0x166')]));this[_0x25c1('0xf')][_0x25c1('0xb2')](util[_0x25c1('0x29')](_0x25c1('0x16b'),this['channel'][_0x25c1('0x39')],_0x4a51c3[_0x25c1('0x166')]));return{'code':0xc8,'result':_0x25c1('0x16c')};}};AGIVertices[_0x25c1('0x12')][_0x25c1('0x1d2')]=function(_0x326641){logger[_0x25c1('0x2f')](util[_0x25c1('0x29')](_0x25c1('0x1d3'),_0x326641[_0x25c1('0xb1')]));var _0x468d6b=this['channel'][_0x25c1('0x5f')](_0x25c1('0x1d4'),[_0x326641[_0x25c1('0x1d5')],_0x326641[_0x25c1('0x7f')]]);if(_0x468d6b[_0x25c1('0xab')]===-0x1){return _0x468d6b;}return this[_0x25c1('0xf')]['noop'](util[_0x25c1('0x29')](_0x25c1('0xcc'),_0x25c1('0x1d4'),_0x326641['mailbox']));};AGIVertices[_0x25c1('0x12')][_0x25c1('0x1d6')]=function(_0x2cb0fd){logger['info'](util['format'](_0x25c1('0x1d7'),_0x2cb0fd[_0x25c1('0xb1')]));if(!this[_0x25c1('0xac')](_0x2cb0fd['variable_id'])){return this['channel'][_0x25c1('0x2d')](_0x2cb0fd,_0x25c1('0x1b9'));}var _0x1acb9d=this[_0x25c1('0x13')][_0x25c1('0x77')](this,_0x2cb0fd[_0x25c1('0xe0')]);if(!_0x1acb9d){return this['channel'][_0x25c1('0x2d')](_0x2cb0fd,_0x25c1('0xe1'));}var _0x1d910f=this[_0x25c1('0xf')][_0x25c1('0x13')](_0x1acb9d);return{'code':0xc8,'result':_0x1d910f[_0x25c1('0xa9')]?_0x1d910f[_0x25c1('0xa9')]:'-'};};String[_0x25c1('0x12')][_0x25c1('0xa8')]=function(_0xb7495f,_0x18e0e0){return this['split'](_0xb7495f)['join'](_0x18e0e0);};module['exports']=AGIVertices;
\ No newline at end of file
+var _0x8c32=['isPlainObject','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','getVariable','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','noop','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','scheduledAt','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','generate','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','recordFile','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','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','no\x20interval\x20configured','getIntervals','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','bcc','service','host','port','secure','auth','user','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','answer','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','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','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','mailRpc','prototype','rpc','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','callback_','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','isNil','timezones','utcOffset','scheduledat','minutes','insertContact','add','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','shellCommand','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','restAPI','url','method','timeout','includes','POST','PUT','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','headers','parse','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isArray','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c32,0x130));var _0x28c3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8c32[_0x57b54c];return _0x59cc19;};'use strict';var fs=require('fs');var path=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var _=require(_0x28c3('0x2'));var sh=require(_0x28c3('0x3'));var odbc=require(_0x28c3('0x4'))();var rs=require(_0x28c3('0x5'));var moment=require(_0x28c3('0x6'));var Mustache=require(_0x28c3('0x7'));var rp=require(_0x28c3('0x8'));var logger=require(_0x28c3('0x9'))(_0x28c3('0xa'));var config=require(_0x28c3('0xb'));var shared=require('../../config/environment/shared');var scripts=require(_0x28c3('0xc'));var FILES_PATH=_0x28c3('0xd');var recursiveMapAttributes=[_0x28c3('0xe'),_0x28c3('0xf')];var verticesWithRetry=[_0x28c3('0x10'),_0x28c3('0x11'),'getsecretdigits'];var AGIVertices=function(_0x1f8595,_0x37bda3,_0x52d697){this['channel']=_0x1f8595;this['rpc']=_0x37bda3;this[_0x28c3('0x12')]=_0x52d697;};AGIVertices[_0x28c3('0x13')]['getVariable']=function(_0x1e2862,_0x15c306){this[_0x28c3('0x14')]['getVariableById'](_0x1e2862)[_0x28c3('0x15')](function(_0x145986){_0x15c306(null,_0x145986?_0x145986[_0x28c3('0x16')]:![]);})[_0x28c3('0x17')](function(_0x41cd05){_0x15c306(_0x41cd05);});};AGIVertices['prototype'][_0x28c3('0x18')]=function(_0x4f7ec0,_0x39dcd7){this['rpc'][_0x28c3('0x19')](_0x4f7ec0)['then'](function(_0x902890){_0x39dcd7(null,_0x902890?_0x902890[_0x28c3('0x16')]:![]);})['catch'](function(_0x194c6e){_0x39dcd7(_0x194c6e);});};AGIVertices['prototype']['getSquareProject']=function(_0x58e2b9,_0x1ccd33){this[_0x28c3('0x14')][_0x28c3('0x1a')](_0x58e2b9)['then'](function(_0x39706b){_0x1ccd33(null,_0x39706b?_0x39706b[_0x28c3('0x16')]:![]);})[_0x28c3('0x17')](function(_0x39256d){_0x1ccd33(_0x39256d);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x1b')]=function(_0x1de176,_0x177189){this[_0x28c3('0x14')][_0x28c3('0x1c')](_0x1de176)[_0x28c3('0x15')](function(_0x13cdae){_0x177189(null,_0x13cdae?_0x13cdae[_0x28c3('0x1d')]:![]);})[_0x28c3('0x17')](function(_0x1101e1){_0x177189(_0x1101e1);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x1e')]=function(_0x34767a,_0x864cc0){this[_0x28c3('0x14')][_0x28c3('0x1f')](_0x34767a)[_0x28c3('0x15')](function(_0x2862d4){_0x864cc0(null,_0x2862d4?_0x2862d4[_0x28c3('0x16')]:![]);})['catch'](function(_0x312f25){_0x864cc0(_0x312f25);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x20')]=function(_0x43409c,_0x17f4aa){this['rpc'][_0x28c3('0x21')](_0x43409c)['then'](function(_0x486a9e){_0x17f4aa(null,_0x486a9e?_0x486a9e[_0x28c3('0x16')]:![]);})['catch'](function(_0x68671c){_0x17f4aa(_0x68671c);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x22')]=function(_0x52f128,_0x4077b0){var _0x465048=this;this[_0x28c3('0x14')][_0x28c3('0x23')](_0x52f128)['then'](function(_0x3eccd6){_0x4077b0(null,_0x3eccd6?_0x465048[_0x28c3('0x24')](_0x3eccd6[_0x28c3('0x25')]):![]);})['catch'](function(_0x285fc8){_0x4077b0(_0x285fc8);});};AGIVertices['prototype'][_0x28c3('0x26')]=function(_0x22d287,_0x267693){this[_0x28c3('0x14')]['getMailAccountById'](_0x22d287)[_0x28c3('0x15')](function(_0x23a2eb){_0x267693(null,_0x23a2eb?_0x23a2eb:![]);})['catch'](function(_0x257be8){_0x267693(_0x257be8);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x27')]=function(_0x540786,_0x545658,_0x5d2b27){this['mailRpc'][_0x28c3('0x27')](_0x540786,_0x545658)[_0x28c3('0x15')](function(){_0x5d2b27(null);})[_0x28c3('0x17')](function(_0x33e431){_0x5d2b27(_0x33e431);});};AGIVertices[_0x28c3('0x13')]['getIntervals']=function(_0x3a8bfa,_0x1f6911){this[_0x28c3('0x14')][_0x28c3('0x28')](_0x3a8bfa)[_0x28c3('0x15')](function(_0x1aab03){if(_0x1aab03){if(_0x1aab03[_0x28c3('0x29')]){_0x1f6911(null,[_0x1aab03[_0x28c3('0x2a')]]);}else{_0x1f6911(null,_[_0x28c3('0x2b')](_0x1aab03[_0x28c3('0x2c')],_0x28c3('0x2a')));}}else{_0x1f6911(null,![]);}})['catch'](function(_0x25afcc){_0x1f6911(_0x25afcc);});};AGIVertices[_0x28c3('0x13')]['getSoundPath']=function(_0x3a2d2c){return util[_0x28c3('0x2d')](_0x28c3('0x2e'),FILES_PATH,_0x3a2d2c);};AGIVertices[_0x28c3('0x13')][_0x28c3('0x2f')]=function(_0x1e7a78,_0x2971cc,_0x240df0){odbc['open'](_0x1e7a78,function(_0x23e909){if(_0x23e909){logger['error'](_0x28c3('0x30'),_0x23e909);_0x240df0(_0x23e909);}else{logger[_0x28c3('0x31')]('ODBC\x20connection\x20successfully');odbc['query'](_0x2971cc,function(_0x5ed86e,_0x5de1f6){if(_0x5ed86e){logger[_0x28c3('0x31')](_0x28c3('0x32'),_0x2971cc);_0x240df0(_0x5ed86e);}else{logger[_0x28c3('0x31')](_0x28c3('0x33'),_0x2971cc);odbc[_0x28c3('0x34')](function(_0x2516b7){if(_0x2516b7){logger[_0x28c3('0x35')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x2516b7);}_0x240df0(null,_0x5de1f6);});}});}});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x36')]=function(_0x56e476,_0x3a7b86){this[_0x28c3('0x14')]['getSmsAccountById'](_0x56e476)[_0x28c3('0x15')](function(_0x52aef8){_0x3a7b86(null,_0x52aef8?_0x52aef8:![]);})['catch'](function(_0x327632){_0x3a7b86(_0x327632);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x37')]=function(_0x50c967,_0x46bb17){this['rpc'][_0x28c3('0x37')](_0x50c967)['then'](function(_0x280128){_0x46bb17(null,_0x280128);})[_0x28c3('0x17')](function(_0x458ccb){_0x46bb17(_0x458ccb);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x416669,_0x5e4d8f,_0x36d447){this[_0x28c3('0x14')][_0x28c3('0x38')]({'uniqueid':this[_0x28c3('0x39')][_0x28c3('0x3a')],'node':_0x416669[_0x28c3('0x3b')],'application':_0x416669[_0x28c3('0x3c')],'data':_0x5e4d8f||null,'project_name':this['channel'][_0x28c3('0x3d')],'callerid':this[_0x28c3('0x39')][_0x28c3('0x3e')]})[_0x28c3('0x15')](function(_0x9c9cbb){if(_0x36d447){_0x36d447(null,_0x9c9cbb);}})[_0x28c3('0x17')](function(_0x30a0d8){if(_0x36d447){_0x36d447(_0x30a0d8);}});};AGIVertices['prototype'][_0x28c3('0x3f')]=function(_0x24a2a0,_0x2a5844,_0xd1e2ec,_0x214b7f){this[_0x28c3('0x14')]['createSquareRecording']({'uniqueid':this[_0x28c3('0x39')][_0x28c3('0x3a')],'callerid':this['channel'][_0x28c3('0x3e')],'calleridname':this['channel']['calleridname'],'context':this[_0x28c3('0x39')][_0x28c3('0x40')],'extension':this[_0x28c3('0x39')][_0x28c3('0x41')],'priority':this['channel'][_0x28c3('0x42')],'accountcode':this['channel'][_0x28c3('0x43')],'dnid':this[_0x28c3('0x39')]['dnid'],'projectName':this[_0x28c3('0x39')]['arg_1'],'saveName':_0x2a5844,'filename':_0x24a2a0[_0x28c3('0x44')]||_0x2a5844,'savePath':_0xd1e2ec})[_0x28c3('0x15')](function(_0x1a8eec){_0x214b7f(null,_0x1a8eec);})[_0x28c3('0x17')](function(_0x125993){_0x214b7f(_0x125993);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x45')]=function(_0x1508dd,_0x28bbb0,_0x3c791a,_0x343312,_0x153b9d){this[_0x28c3('0x14')]['createSquareMessage']({'uniqueid':this[_0x28c3('0x39')]['uniqueid'],'body':_0x1508dd,'direction':_0x28bbb0,'providerName':_0x3c791a,'providerResponse':_0x343312})[_0x28c3('0x15')](function(_0x405592){if(_0x153b9d){_0x153b9d(null,_0x405592);}})[_0x28c3('0x17')](function(_0x4ec30b){if(_0x153b9d){_0x153b9d(_0x4ec30b);}});};AGIVertices['prototype'][_0x28c3('0x46')]=function(_0x3baa75,_0x1fd021){var _0x4c1584=this;var _0x1aaf03=0x0;var _0x5608e6={'firstName':_[_0x28c3('0x47')](_0x3baa75[_0x28c3('0x16')])||_['isNil'](_0x3baa75[_0x28c3('0x16')])?_0x28c3('0x48')+Math['random']():_0x3baa75[_0x28c3('0x16')],'lastName':_[_0x28c3('0x47')](_0x3baa75[_0x28c3('0x49')])||_['isNil'](_0x3baa75[_0x28c3('0x49')])?null:_0x3baa75['lastName'],'phone':_0x3baa75[_0x28c3('0x4a')],'ListId':_0x3baa75[_0x28c3('0x4b')],'scheduledat':_0x3baa75['scheduledAt'],'callbackUniqueid':this[_0x28c3('0x39')][_0x28c3('0x3a')],'tags':_0x28c3('0x4c'),'description':_0x28c3('0x4d')+_0x3baa75['scheduledAt']['toString'](),'priority':_0x3baa75[_0x28c3('0x4e')]};if(_[_0x28c3('0x4f')](_0x3baa75,_0x28c3('0x50'))){if(!_['isNil'](_0x3baa75[_0x28c3('0x50')])){var _0x280b02=_0x3baa75[_0x28c3('0x50')];if(_0x3baa75[_0x28c3('0x50')]==_0x28c3('0x51')){this[_0x28c3('0x14')]['getContactByPhone']({'phone':_0x3baa75[_0x28c3('0x4a')]})['then'](function(_0x16746c){if(!_[_0x28c3('0x52')](_0x16746c)){var _0x5037f2=_0x16746c[_0x28c3('0x50')];if(!_[_0x28c3('0x52')](_0x5037f2)){var _0x5d367f=shared[_0x28c3('0x53')][_0x5037f2];if(!_['isNil'](_0x5d367f)){var _0x321d3=-0x1*_0x5d367f[_0x28c3('0x54')];_0x5608e6[_0x28c3('0x55')]=moment(_0x3baa75[_0x28c3('0x55')])['add'](_0x321d3,_0x28c3('0x56'));_0x4c1584[_0x28c3('0x57')](_0x5608e6,_0x3baa75,_0x1fd021);}else{_0x4c1584[_0x28c3('0x57')](_0x5608e6,_0x3baa75,_0x1fd021);}}else{_0x4c1584['insertContact'](_0x5608e6,_0x3baa75,_0x1fd021);}}else{_0x4c1584[_0x28c3('0x57')](_0x5608e6,_0x3baa75,_0x1fd021);}});}else{var _0x1aaf03=shared[_0x28c3('0x53')][_0x280b02];if(!_['isNil'](_0x1aaf03)){var _0x3c1890=-0x1*_0x1aaf03[_0x28c3('0x54')];_0x5608e6[_0x28c3('0x55')]=moment(_0x3baa75[_0x28c3('0x55')])[_0x28c3('0x58')](_0x3c1890,_0x28c3('0x56'));_0x4c1584[_0x28c3('0x57')](_0x5608e6,_0x3baa75,_0x1fd021);}else{_0x4c1584[_0x28c3('0x57')](_0x5608e6,_0x3baa75,_0x1fd021);}}}else{_0x4c1584[_0x28c3('0x57')](_0x5608e6,_0x3baa75,_0x1fd021);}}else{_0x4c1584[_0x28c3('0x57')](_0x5608e6,_0x3baa75,_0x1fd021);}};AGIVertices[_0x28c3('0x13')][_0x28c3('0x59')]=function(_0x34c9ea,_0x13e868){this[_0x28c3('0x14')]['getPauseById'](_0x34c9ea)[_0x28c3('0x15')](function(_0x7f1ec0){_0x13e868(null,_0x7f1ec0?_0x7f1ec0[_0x28c3('0x16')]:![]);})[_0x28c3('0x17')](function(_0x47a600){_0x13e868(_0x47a600);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x5a')]=function(_0x5dc8fe,_0x859277,_0xc72cf0){var _0x1cd3b4={'role':_0x28c3('0x5b')};_0x1cd3b4[_0x5dc8fe]=this['channel'][_0x28c3('0x3e')];this[_0x28c3('0x14')][_0x28c3('0x5a')](_0x1cd3b4,_0x859277,this['channel'][_0x28c3('0x3a')])[_0x28c3('0x15')](function(_0x1654e4){_0xc72cf0(null,_[_0x28c3('0x52')](_0x1654e4)?![]:!![]);})[_0x28c3('0x17')](function(_0x4fdd99){logger[_0x28c3('0x35')](_0x4fdd99);_0xc72cf0(null,![]);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x5c')]=function(_0x39f230,_0x587f08){var _0x5abb76={'role':_0x28c3('0x5b')};_0x5abb76[_0x39f230]=this[_0x28c3('0x39')][_0x28c3('0x3e')];this[_0x28c3('0x14')][_0x28c3('0x5c')](_0x5abb76)[_0x28c3('0x15')](function(_0x541841){_0x587f08(null,_[_0x28c3('0x52')](_0x541841)?![]:!![]);})[_0x28c3('0x17')](function(_0x1bc465){logger['error'](_0x1bc465);_0x587f08(null,![]);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x5d')]=function(_0x4c6faa,_0x264602){var _0x581485={'role':_0x28c3('0x5b')};_0x581485[_0x4c6faa]=this[_0x28c3('0x39')][_0x28c3('0x3e')];this[_0x28c3('0x14')][_0x28c3('0x5d')](_0x581485)[_0x28c3('0x15')](function(_0x42aace){_0x264602(null,_[_0x28c3('0x52')](_0x42aace)?![]:!![]);})[_0x28c3('0x17')](function(_0x5a268f){logger['error'](_0x5a268f);_0x264602(null,![]);});};AGIVertices['prototype'][_0x28c3('0x5e')]=function(_0x56ae40,_0x30883e){var _0x20065b={'role':_0x28c3('0x5b')};_0x20065b[_0x56ae40]=this[_0x28c3('0x39')][_0x28c3('0x3e')];var _0x217558=_0x56ae40!='internal'?util[_0x28c3('0x2d')](_0x28c3('0x5f'),'LOCAL',this[_0x28c3('0x39')][_0x28c3('0x3e')]):undefined;this[_0x28c3('0x14')][_0x28c3('0x5e')](_0x20065b,_0x217558)[_0x28c3('0x15')](function(_0x2ba1d8){_0x30883e(null,_[_0x28c3('0x52')](_0x2ba1d8)?![]:!![]);})[_0x28c3('0x17')](function(_0xea5a28){logger[_0x28c3('0x35')](_0xea5a28);_0x30883e(null,![]);});};AGIVertices['prototype'][_0x28c3('0x60')]=function(_0x3083a4,_0x27843b){sh['exec'](_['trim'](_0x3083a4),function(_0x47fb60,_0x721b32){var _0x1d338e=_0x721b32[_0x28c3('0x61')](/(\r\n|\n|\r)/gm,'');_0x27843b(null,_0x1d338e);});};AGIVertices['prototype'][_0x28c3('0x62')]=function(_0x26d373,_0x3a55e3){scripts[_0x28c3('0x62')](_0x26d373[_0x28c3('0x63')],_0x26d373[_0x28c3('0x64')]||'text',_0x26d373[_0x28c3('0x65')],_0x26d373[_0x28c3('0x66')]||_0x28c3('0x67'),_0x26d373[_0x28c3('0x68')]||_0x28c3('0x69'),_0x26d373['audioEncoding']||_0x28c3('0x6a'))[_0x28c3('0x15')](function(_0x18e1e4){_0x3a55e3(null,_0x18e1e4);})[_0x28c3('0x17')](function(_0x4fd40d){_0x3a55e3(_0x4fd40d);});};AGIVertices[_0x28c3('0x13')]['googleTTS']=function(_0x14df84,_0x1bcfdb){scripts[_0x28c3('0x6b')](_0x14df84[_0x28c3('0x65')],_0x14df84['google_tts_language']||'en',0x1)[_0x28c3('0x15')](function(_0x451009){_0x1bcfdb(null,_0x451009);})['catch'](function(_0x409f7d){_0x1bcfdb(_0x409f7d);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x6c')]=function(_0xe931c5,_0x34fef7){var _0x2cd22a={'uri':_0xe931c5[_0x28c3('0x6d')],'method':_0xe931c5[_0x28c3('0x6e')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xe931c5[_0x28c3('0x6f')])==='number'&&parseInt(_0xe931c5[_0x28c3('0x6f')])>=0x1?parseInt(_0xe931c5[_0x28c3('0x6f')])*0x3e8:0x5*0x3e8};if(_[_0x28c3('0x70')]([_0x28c3('0x71'),_0x28c3('0x72')],_0x2cd22a[_0x28c3('0x6e')]['toUpperCase']())){try{_0x2cd22a[_0x28c3('0x73')]=_0xe931c5[_0x28c3('0xf')]?JSON['parse'](_0xe931c5['rawBody']):{};}catch(_0x5c165c){logger[_0x28c3('0x35')](_0x28c3('0x74'),_0x5c165c);}}try{_0x2cd22a['headers']=_0xe931c5[_0x28c3('0xe')]?JSON['parse'](_0xe931c5[_0x28c3('0xe')]):{};}catch(_0x417e3e){logger[_0x28c3('0x35')](_0x28c3('0x75'),_0x417e3e);}if(_0xe931c5[_0x28c3('0x76')]){try{var _0x5d3993=require(_0xe931c5[_0x28c3('0x76')])[_0x28c3('0x77')](this,_0x2cd22a);_0x2cd22a[_0x28c3('0x78')]=Mustache['render'](_0xe931c5[_0x28c3('0x6d')],_0x5d3993,{},['$$','$$']);if(_0x2cd22a[_0x28c3('0x79')]){_0x2cd22a[_0x28c3('0x79')]=JSON[_0x28c3('0x7a')](Mustache[_0x28c3('0x7b')](JSON['stringify'](_0x2cd22a['headers']),_0x5d3993,{},['$$','$$']));}if(_0x2cd22a[_0x28c3('0x73')]){_0x2cd22a[_0x28c3('0x73')]=JSON[_0x28c3('0x7a')](Mustache['render'](JSON[_0x28c3('0x7c')](_0x2cd22a[_0x28c3('0x73')]),_0x5d3993,{},['$$','$$']));}}catch(_0xf9ef33){logger[_0x28c3('0x35')](_0x28c3('0x7d'),_0xf9ef33);}}rp(_0x2cd22a)[_0x28c3('0x15')](function(_0x36e367){var _0x5eb359={'statusCode':_0x36e367[_0x28c3('0x7e')]||0xc8,'statusMessage':_0x36e367[_0x28c3('0x7f')]||'OK','headers':_0x36e367[_0x28c3('0x79')]||{},'body':_0x36e367[_0x28c3('0x73')]||{}};_0x34fef7(null,_0x5eb359);})[_0x28c3('0x17')](function(_0x4db316){var _0x294eb9={'statusCode':_0x4db316[_0x28c3('0x7e')]||0x1f4,'statusMessage':_0x4db316[_0x28c3('0x80')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4db316['options'][_0x28c3('0x79')]||{},'body':_0x4db316[_0x28c3('0x81')][_0x28c3('0x73')]||{}};_0x34fef7(null,_0x294eb9);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x82')]=function(_0x4a8d4b,_0x7fb517){scripts['googleDialogflow'](this[_0x28c3('0x39')][_0x28c3('0x3a')],_0x4a8d4b[_0x28c3('0x83')],_0x4a8d4b['text'],_0x4a8d4b[_0x28c3('0x84')]||'en')[_0x28c3('0x15')](function(_0x3874e9){_0x7fb517(null,_0x3874e9);})[_0x28c3('0x17')](function(_0x2a65b7){_0x7fb517(_0x2a65b7);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x85')]=function(_0x3dd631,_0x393697){scripts[_0x28c3('0x85')](this[_0x28c3('0x39')][_0x28c3('0x3a')],_0x3dd631[_0x28c3('0x86')],_0x3dd631[_0x28c3('0x87')],_0x3dd631[_0x28c3('0x88')],_0x3dd631[_0x28c3('0x65')],_0x3dd631[_0x28c3('0x89')]||'en')[_0x28c3('0x15')](function(_0x425e3b){_0x393697(null,_0x425e3b);})['catch'](function(_0x46bf6b){_0x393697(_0x46bf6b);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x8a')]=function(_0x3802fc,_0x200bb0){scripts[_0x28c3('0x8a')](this[_0x28c3('0x39')],_0x3802fc)[_0x28c3('0x15')](function(_0x2a8636){_0x200bb0(null,_0x2a8636);})['catch'](function(_0x4c6425){_0x200bb0(_0x4c6425);});};AGIVertices['prototype'][_0x28c3('0x8b')]=function(_0x13b5dc,_0x3a4b75){scripts[_0x28c3('0x8b')](_0x13b5dc[_0x28c3('0x83')],_0x13b5dc[_0x28c3('0x65')],_0x13b5dc[_0x28c3('0x8c')]||'en-US',_0x13b5dc[_0x28c3('0x8d')])[_0x28c3('0x15')](function(_0x310cfb){_0x3a4b75(null,_0x310cfb);})[_0x28c3('0x17')](function(_0x5da3fe){_0x3a4b75(_0x5da3fe);});};AGIVertices[_0x28c3('0x13')]['ispeechASR']=function(_0x56821e,_0x10a54d,_0xc13bce){scripts[_0x28c3('0x8e')](_0x10a54d,_0x56821e[_0x28c3('0x83')],_0x56821e[_0x28c3('0x8f')]||_0x28c3('0x67'),this['isConfigured'](_0x56821e[_0x28c3('0x90')])?_0x56821e[_0x28c3('0x90')]:undefined)[_0x28c3('0x15')](function(_0x3387a0){_0xc13bce(null,_0x3387a0);})[_0x28c3('0x17')](function(_0x18edd1){_0xc13bce(_0x18edd1);});};AGIVertices['prototype'][_0x28c3('0x91')]=function(_0x3cc364,_0xc1e13f){scripts[_0x28c3('0x91')](_0x3cc364[_0x28c3('0x92')],_0x3cc364['aws_secret_access_key'],_0x3cc364[_0x28c3('0x93')],_0x3cc364[_0x28c3('0x94')]||_0x28c3('0x95'),_0x3cc364['text'],_0x3cc364[_0x28c3('0x96')]||_0x28c3('0x65'))[_0x28c3('0x15')](function(_0x2a477d){_0xc1e13f(null,_0x2a477d);})[_0x28c3('0x17')](function(_0x455600){_0xc1e13f(_0x455600);});};AGIVertices[_0x28c3('0x13')]['awsLex']=function(_0x5eb755,_0x120a83){scripts[_0x28c3('0x97')](this[_0x28c3('0x39')]['uniqueid'],_0x5eb755['aws_access_key_id'],_0x5eb755[_0x28c3('0x98')],_0x5eb755[_0x28c3('0x99')],_0x5eb755['text'],_0x5eb755[_0x28c3('0x9a')])[_0x28c3('0x15')](function(_0x3537b7){_0x120a83(null,_0x3537b7);})[_0x28c3('0x17')](function(_0x182a0e){_0x120a83(_0x182a0e);});};AGIVertices['prototype'][_0x28c3('0x9b')]=function(_0x59d9fd,_0xdaffa3,_0x5a1009){scripts['googleASR'](_0xdaffa3,_0x59d9fd['key'],_0x59d9fd[_0x28c3('0x9c')]||_0x28c3('0x67'))['then'](function(_0x56a48e){_0x5a1009(null,_0x56a48e);})[_0x28c3('0x17')](function(_0x51ba81){_0x5a1009(_0x51ba81);});};AGIVertices[_0x28c3('0x13')][_0x28c3('0x9d')]=function(_0x12f577,_0x52155d,_0xe05452){scripts[_0x28c3('0x9d')](_0x52155d,_0x12f577[_0x28c3('0x9e')],_0x12f577[_0x28c3('0x9f')],_0x12f577[_0x28c3('0x78')])[_0x28c3('0x15')](function(_0x22d9b8){_0xe05452(null,_0x22d9b8);})[_0x28c3('0x17')](function(_0x224a06){_0xe05452(_0x224a06);});};AGIVertices['prototype'][_0x28c3('0xa0')]=function(_0xa172f4){var _0x3618f3=_[_0x28c3('0x70')](verticesWithRetry,_0xa172f4[_0x28c3('0x3c')])?_0xa172f4:_[_0x28c3('0xa1')](_0xa172f4);for(var _0x5e2cdb in _0x3618f3){if(_0x3618f3[_0x28c3('0xa2')](_0x5e2cdb)){if(_0x3618f3[_0x5e2cdb]&&_[_0x28c3('0xa3')](_0x3618f3[_0x5e2cdb])){if(_[_0x28c3('0x70')](recursiveMapAttributes,_0x5e2cdb)){_0x3618f3[_0x5e2cdb]=this['replaceObjectAllVariables'](_0x3618f3[_0x5e2cdb]);}else{_0x3618f3[_0x5e2cdb]=this[_0x28c3('0xa4')](_0x3618f3[_0x5e2cdb]);}}}}return _0x3618f3;};AGIVertices['prototype'][_0x28c3('0xa5')]=function(_0x1568c6){for(var _0x4aae30 in _0x1568c6){if(_0x1568c6[_0x28c3('0xa2')](_0x4aae30)){if(_['isPlainObject'](_0x1568c6[_0x4aae30])){this['recursiveNodeIndex'](_0x1568c6[_0x4aae30]);}else if(_[_0x28c3('0xa6')](_0x1568c6[_0x4aae30])){for(var _0x54357e=0x0;_0x54357e<_0x1568c6[_0x4aae30][_0x28c3('0xa7')];_0x54357e++){this[_0x28c3('0xa5')](_0x1568c6[_0x4aae30][_0x54357e]);}}else if(_[_0x28c3('0xa3')](_0x1568c6[_0x4aae30])){_0x1568c6[_0x4aae30]=this[_0x28c3('0xa4')](_0x1568c6[_0x4aae30]);}}}};AGIVertices[_0x28c3('0x13')]['saveRestApiResult']=function(_0x254efb,_0x1a204a){for(var _0x3182e2 in _0x254efb){if(_0x254efb[_0x28c3('0xa2')](_0x3182e2)){if(_[_0x28c3('0xa8')](_0x254efb[_0x3182e2])){if(!_[_0x28c3('0x47')](_0x254efb[_0x3182e2])){this[_0x28c3('0xa9')](_0x254efb[_0x3182e2],util[_0x28c3('0x2d')](_0x28c3('0xaa'),_0x1a204a,_0x3182e2));}}else if(_[_0x28c3('0xa6')](_0x254efb[_0x3182e2])){for(var _0x5ba709=0x0;_0x5ba709<_0x254efb[_0x3182e2]['length'];_0x5ba709++){this['saveRestApiResult'](_0x254efb[_0x3182e2][_0x5ba709],util[_0x28c3('0x2d')](_0x28c3('0xaa'),_0x1a204a,_0x3182e2+'['+_0x5ba709+']'));}}else{if(!_[_0x28c3('0x52')](_0x254efb[_0x3182e2])){this[_0x28c3('0x39')][_0x28c3('0xab')](util[_0x28c3('0x2d')]('%s.%s',_0x1a204a,_0x3182e2),_0x254efb[_0x3182e2]);}}}}};AGIVertices['prototype'][_0x28c3('0xac')]=function(_0x3d4c43){try{var _0x5b08c1=JSON[_0x28c3('0x7a')](_0x3d4c43);this[_0x28c3('0xa5')](_0x5b08c1);return JSON[_0x28c3('0x7c')](_0x5b08c1);}catch(_0x5c634b){return this[_0x28c3('0xa4')](_0x3d4c43);}};AGIVertices[_0x28c3('0x13')]['replaceAllVariables']=function(_0x2480c5){var _0x417b08=_0x2480c5['split']('{');for(var _0x5f02a0=0x1;_0x5f02a0<_0x417b08['length'];_0x5f02a0+=0x1){var _0x10b251=_0x417b08[_0x5f02a0][_0x28c3('0xad')]('}');if(_0x10b251[_0x28c3('0xa7')]>0x1){_0x2480c5=_0x2480c5[_0x28c3('0xae')]('{'+_0x10b251[0x0]+'}',this[_0x28c3('0x39')][_0x28c3('0xaf')](_0x10b251[0x0])[_0x28c3('0xb0')]||_0x10b251[0x0]);}}if(_0x417b08[_0x28c3('0xa7')]===0x1){return _0x2480c5[_0x28c3('0xb1')]();}return this[_0x28c3('0xa4')](_0x2480c5);};AGIVertices[_0x28c3('0x13')][_0x28c3('0xb2')]=function(_0x1512d8,_0x4df09b){var _0x13bb53=this[_0x28c3('0x39')][_0x28c3('0xaf')](_0x1512d8);if(_0x13bb53[_0x28c3('0xb3')]===-0x1){return _0x13bb53;}logger['info'](util[_0x28c3('0x2d')](_0x28c3('0xb4'),_0x4df09b,_0x13bb53[_0x28c3('0xb0')]));return this[_0x28c3('0x39')][_0x28c3('0xab')](_0x4df09b,_0x13bb53[_0x28c3('0xb0')]);};AGIVertices[_0x28c3('0x13')][_0x28c3('0xb5')]=function(_0x25c918){return _0x25c918&&_0x25c918!=='0'&&_0x25c918!=='-1'&&_0x25c918!=='';};AGIVertices[_0x28c3('0x13')][_0x28c3('0xb6')]=function(_0x1613b3){this[_0x28c3('0x38')][_0x28c3('0x77')](this,_0x1613b3,'-');_0x1613b3[_0x28c3('0xb7')]=_0x1613b3[_0x28c3('0xb6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x28c3('0x13')][_0x28c3('0xb8')]=function(_0x189270){logger['info'](util[_0x28c3('0x2d')](_0x28c3('0xb9'),_0x189270[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x189270['text'])){return this[_0x28c3('0x39')]['noop'](_0x28c3('0xba'));}var _0x504a00='\x22'+_0x189270[_0x28c3('0x65')]+'\x22';if(this['isConfigured'](_0x189270['options'])){_0x504a00+=','+_0x189270[_0x28c3('0x81')];}var _0x4029bd=this[_0x28c3('0x39')]['exec'](_0x28c3('0xbb'),_0x504a00);if(_0x4029bd[_0x28c3('0xb3')]===-0x1){return _0x4029bd;}return this['channel']['noop'](util[_0x28c3('0x2d')](_0x28c3('0xbc'),_0x504a00));};AGIVertices[_0x28c3('0x13')][_0x28c3('0xbd')]=function(_0x13c813){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x13c813[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x13c813['grammar'])){return this['channel'][_0x28c3('0xbe')](_0x28c3('0xbf'));}var _0x16c888=_0x13c813['grammar'];if(this[_0x28c3('0xb5')](_0x13c813[_0x28c3('0x81')])){_0x16c888+=','+_0x13c813[_0x28c3('0x81')];}var _0x4a8e96=this[_0x28c3('0x39')]['exec'](_0x28c3('0xc0'),_0x16c888);if(_0x4a8e96[_0x28c3('0xb3')]===-0x1){return _0x4a8e96;}var _0x2e5eb8=this[_0x28c3('0xb2')](_0x28c3('0xc1'),'MRCP_RECOG_CONFIDENCE');if(_0x2e5eb8[_0x28c3('0xb3')]===-0x1){return _0x2e5eb8;}var _0xc1355=this['getAndSetVariable']('RECOG_INPUT()',_0x28c3('0xc2'));if(_0xc1355[_0x28c3('0xb3')]===-0x1){return _0xc1355;}var _0x350af2=this[_0x28c3('0xb2')]('RECOG_INSTANCE()',_0x28c3('0xc3'));if(_0x350af2[_0x28c3('0xb3')]===-0x1){return _0x350af2;}return this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0xc4'),_0x16c888));};AGIVertices[_0x28c3('0x13')]['agi']=function(_0x392fa0){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x392fa0[_0x28c3('0x3b')]));return this[_0x28c3('0x39')]['agi']([_0x392fa0[_0x28c3('0xc5')],_0x392fa0[_0x28c3('0xc6')]]);};AGIVertices[_0x28c3('0x13')]['answer']=function(_0x1a6cdb){logger[_0x28c3('0x31')](util['format'](_0x28c3('0xc7'),_0x1a6cdb[_0x28c3('0x3b')]));if(this['isConfigured'](_0x1a6cdb[_0x28c3('0x6f')])){logger['info'](util[_0x28c3('0x2d')](_0x28c3('0xc8'),_0x1a6cdb[_0x28c3('0x6f')]));var _0x402cb9=this[_0x28c3('0x39')][_0x28c3('0xc9')](_0x1a6cdb['timeout']);if(_0x402cb9[_0x28c3('0xb3')]===-0x1){return _0x402cb9;}}return this[_0x28c3('0x39')]['answer']();};AGIVertices[_0x28c3('0x13')][_0x28c3('0x4c')]=function(_0x3ed210){logger['info'](util[_0x28c3('0x2d')](_0x28c3('0xca'),_0x3ed210[_0x28c3('0x3b')]));if(!this['isConfigured'](_0x3ed210[_0x28c3('0x4b')])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x3ed210,'no\x20list\x20selected');}_0x3ed210['scheduledAt']=moment();if(this[_0x28c3('0xb5')](_0x3ed210[_0x28c3('0xcb')])){_0x3ed210['scheduledAt']=moment()[_0x28c3('0x58')](_0x3ed210[_0x28c3('0xcb')],_0x28c3('0x56'));}if(!this[_0x28c3('0xb5')](_0x3ed210[_0x28c3('0x4e')])){_0x3ed210['callback_priority']=0x2;}this[_0x28c3('0x46')][_0x28c3('0x77')](this,_0x3ed210);return this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format'](_0x28c3('0xcc'),_0x3ed210['phone'],_0x3ed210[_0x28c3('0x4b')],_0x3ed210[_0x28c3('0xcd')]));};AGIVertices[_0x28c3('0x13')][_0x28c3('0xce')]=function(_0x58f3cf){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0xcf'),_0x58f3cf[_0x28c3('0x3b')]));var _0x278df4=this['channel'][_0x28c3('0xd0')](_0x58f3cf[_0x28c3('0xd1')],_0x58f3cf[_0x28c3('0x81')]);if(_0x278df4[_0x28c3('0xb3')]===-0x1){return _0x278df4;}return this[_0x28c3('0x39')]['noop'](util['format'](_0x28c3('0xd2'),_0x58f3cf[_0x28c3('0xd1')],_0x58f3cf[_0x28c3('0x81')]));};AGIVertices[_0x28c3('0x13')][_0x28c3('0xd3')]=function(_0x5ca099){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0xd4'),_0x5ca099[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x5ca099[_0x28c3('0x65')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xba'));}var _0x8890='\x22'+_0x5ca099[_0x28c3('0x65')]+'\x22';if(this[_0x28c3('0xb5')](_0x5ca099[_0x28c3('0x81')])){_0x8890+=','+_0x5ca099[_0x28c3('0x81')];}var _0x4f59c6=this[_0x28c3('0x39')]['exec'](_0x28c3('0xbb'),_0x8890);if(_0x4f59c6[_0x28c3('0xb3')]===-0x1){return _0x4f59c6;}return this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0xbc'),_0x8890));};AGIVertices[_0x28c3('0x13')]['sestektts']=function(_0x480911){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0xd5'),_0x480911['label']));if(!this['isConfigured'](_0x480911[_0x28c3('0x65')])){return this['channel']['noop'](_0x28c3('0xba'));}var _0x37e34d='\x22'+_0x480911[_0x28c3('0x65')]+'\x22';if(this[_0x28c3('0xb5')](_0x480911['options'])){_0x37e34d+=','+_0x480911[_0x28c3('0x81')];}var _0x174e26=this[_0x28c3('0x39')][_0x28c3('0xd0')]('MRCPSynth',_0x37e34d);if(_0x174e26['result']===-0x1){return _0x174e26;}return this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x37e34d));};AGIVertices[_0x28c3('0x13')][_0x28c3('0xd6')]=function(_0x19ab84){logger[_0x28c3('0x31')](util['format'](_0x28c3('0xd7'),_0x19ab84[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x19ab84[_0x28c3('0xd8')])){return this['channel'][_0x28c3('0xbe')](_0x28c3('0xbf'));}var _0x11ff77=_0x19ab84[_0x28c3('0xd8')];if(this[_0x28c3('0xb5')](_0x19ab84[_0x28c3('0x81')])){_0x11ff77+=','+_0x19ab84[_0x28c3('0x81')];}var _0x35532c=this[_0x28c3('0x39')]['exec'](_0x28c3('0xc0'),_0x11ff77);if(_0x35532c['result']===-0x1){return _0x35532c;}var _0x44d664=this['getAndSetVariable'](_0x28c3('0xc1'),'LUMENVOX_ASR_CONFIDENCE');if(_0x44d664['result']===-0x1){return _0x44d664;}var _0xd18309=this[_0x28c3('0xb2')]('RECOG_INPUT()',_0x28c3('0xd9'));if(_0xd18309[_0x28c3('0xb3')]===-0x1){return _0xd18309;}var _0x26ffe5=this[_0x28c3('0xb2')](_0x28c3('0xda'),_0x28c3('0xdb'));if(_0x26ffe5['result']===-0x1){return _0x26ffe5;}return this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0xc4'),_0x11ff77));};AGIVertices['prototype'][_0x28c3('0xdc')]=function(_0x2676d5){logger['info'](util[_0x28c3('0x2d')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x2676d5[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x2676d5['grammar'])){return this['channel'][_0x28c3('0xbe')](_0x28c3('0xbf'));}var _0x3af2dc=_0x2676d5[_0x28c3('0xd8')];if(this['isConfigured'](_0x2676d5['options'])){_0x3af2dc+=','+_0x2676d5[_0x28c3('0x81')];}var _0x33337b=this[_0x28c3('0x39')][_0x28c3('0xd0')](_0x28c3('0xc0'),_0x3af2dc);if(_0x33337b[_0x28c3('0xb3')]===-0x1){return _0x33337b;}var _0x3d0c4c=this[_0x28c3('0xb2')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x3d0c4c['result']===-0x1){return _0x3d0c4c;}var _0x4007a6=this[_0x28c3('0xb2')]('RECOG_INPUT()',_0x28c3('0xdd'));if(_0x4007a6['result']===-0x1){return _0x4007a6;}var _0x4473a6=this[_0x28c3('0xb2')](_0x28c3('0xda'),'SESTEK_ASR_INSTANCE');if(_0x4473a6[_0x28c3('0xb3')]===-0x1){return _0x4473a6;}return this[_0x28c3('0x39')]['noop'](util['format'](_0x28c3('0xc4'),_0x3af2dc));};AGIVertices[_0x28c3('0x13')]['database']=function(_0x5f2923){logger['info'](util[_0x28c3('0x2d')](_0x28c3('0xde'),_0x5f2923[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x5f2923[_0x28c3('0xdf')])){return this['channel'][_0x28c3('0x35')](_0x5f2923,'no\x20database\x20selected');}var _0x39a6be=this[_0x28c3('0x1b')][_0x28c3('0x77')](this,_0x5f2923[_0x28c3('0xdf')]);if(!_0x39a6be){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x5f2923,_0x28c3('0xe0'));}if(!this['isConfigured'](_0x5f2923[_0x28c3('0xe1')])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x5f2923,_0x28c3('0xe2'));}var _0x2d9abb=_0x5f2923['query'][_0x28c3('0x61')](/(\r\n|\n|\r)/gm,'\x20');this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format']('query:\x20%s',_0x2d9abb));var _0x30656a=this['getQueryOdbc'][_0x28c3('0x77')](this,_0x39a6be,_0x2d9abb);this[_0x28c3('0x38')][_0x28c3('0x77')](this,_0x5f2923,_0x2d9abb);if(!this[_0x28c3('0xb5')](_0x5f2923[_0x28c3('0xe3')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xe4'));}var _0x2571e5=this[_0x28c3('0xaf')][_0x28c3('0x77')](this,_0x5f2923[_0x28c3('0xe3')]);if(!_0x2571e5){return this['channel'][_0x28c3('0x35')](_0x5f2923,_0x28c3('0xe5'));}var _0x4791b6=this;_0x30656a[_0x28c3('0xe6')](function(_0x507f45,_0x249ebd){Object[_0x28c3('0xe7')](_0x507f45)[_0x28c3('0xe6')](function(_0xd6efd5){_0x4791b6[_0x28c3('0x39')][_0x28c3('0xab')](util[_0x28c3('0x2d')]('%s[%s][%s]',_0x2571e5,_0x249ebd,_0xd6efd5),_0x507f45[_0xd6efd5]);});});this[_0x28c3('0x39')][_0x28c3('0xab')](util[_0x28c3('0x2d')](_0x28c3('0xe8'),_0x2571e5),_0x30656a[_0x28c3('0xa7')]);return this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0xe9'),_0x2571e5));};AGIVertices[_0x28c3('0x13')][_0x28c3('0xea')]=function(_0x1a4376){logger[_0x28c3('0xeb')](util['format'](_0x28c3('0xec'),_0x1a4376[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x1a4376[_0x28c3('0xed')])){return this['channel'][_0x28c3('0x35')](_0x1a4376,_0x28c3('0xee'));}var _0xa18b6c=this['getUser'][_0x28c3('0x77')](this,_0x1a4376[_0x28c3('0xed')]);if(!_0xa18b6c){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x1a4376,_0x28c3('0xef'));}var _0x5b8874=this[_0x28c3('0x39')][_0x28c3('0xd0')]('DIAL',[util[_0x28c3('0x2d')]('SIP/%s',_0xa18b6c),_0x1a4376[_0x28c3('0x6f')],_0x1a4376[_0x28c3('0xf0')],_0x1a4376[_0x28c3('0x6d')]]);if(_0x5b8874[_0x28c3('0xb3')]===-0x1){return _0x5b8874;}return this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0xf1'),_0x28c3('0xf2')));};AGIVertices[_0x28c3('0x13')][_0x28c3('0xf3')]=function(_0x5090df){logger['info'](util[_0x28c3('0x2d')](_0x28c3('0xf4'),_0x5090df['label']));if(!this[_0x28c3('0xb5')](_0x5090df[_0x28c3('0x83')])){return this['channel'][_0x28c3('0xbe')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x5090df['text'])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xba'));}this['channel'][_0x28c3('0xf5')]=!![];this['createSquareDetailsReport'](_0x5090df);this[_0x28c3('0x45')](_0x5090df['text'],'in','','');this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')]('Trying\x20Dialogflow:\x20%s',_0x5090df[_0x28c3('0x65')]));var _0xb3a842=this[_0x28c3('0x82')][_0x28c3('0x77')](this,_0x5090df);if(_0xb3a842){for(var _0x581d00 in _0xb3a842){if(_0xb3a842['hasOwnProperty'](_0x581d00)){this[_0x28c3('0x39')][_0x28c3('0xab')](util[_0x28c3('0x2d')](_0x28c3('0xf6'),_0x581d00[_0x28c3('0xf7')]()),_0xb3a842[_0x581d00]);}}this[_0x28c3('0x45')](_0xb3a842[_0x28c3('0xf8')],_0x28c3('0xf9'),_0x28c3('0xf3'),'');return this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format'](_0x28c3('0xfa'),_0xb3a842[_0x28c3('0xf8')]));}return this['channel'][_0x28c3('0x35')](_0x5090df,_0x28c3('0xfb'));};AGIVertices[_0x28c3('0x13')]['dialogflowV2']=function(_0x39d476){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0xfc'),_0x39d476['label']));if(!this[_0x28c3('0xb5')](_0x39d476['dialogflowV2_project_id'])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xfd'));}if(!this[_0x28c3('0xb5')](_0x39d476[_0x28c3('0x87')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xfe'));}if(!this[_0x28c3('0xb5')](_0x39d476[_0x28c3('0x88')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xff'));}if(!this[_0x28c3('0xb5')](_0x39d476[_0x28c3('0x89')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x100'));}if(!this[_0x28c3('0xb5')](_0x39d476[_0x28c3('0x65')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xba'));}this[_0x28c3('0x39')][_0x28c3('0xf5')]=!![];this[_0x28c3('0x38')](_0x39d476);this[_0x28c3('0x45')](_0x39d476[_0x28c3('0x65')],'in','','');this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format'](_0x28c3('0x101'),_0x39d476[_0x28c3('0x65')]));var _0x1c901a=this['googleDialogflowV2'][_0x28c3('0x77')](this,_0x39d476);if(_0x1c901a){for(var _0x5854d0 in _0x1c901a){if(_0x1c901a['hasOwnProperty'](_0x5854d0)){if(_0x5854d0!==_0x28c3('0x102')){this['channel'][_0x28c3('0xab')](util[_0x28c3('0x2d')](_0x28c3('0xf6'),_0x5854d0[_0x28c3('0xf7')]()),_0x1c901a[_0x5854d0]);}}}this['createSquareMessage'](_0x1c901a['speech'],'out',_0x28c3('0x103'),_0x1c901a[_0x28c3('0x102')]);return this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format'](_0x28c3('0x104'),_0x1c901a[_0x28c3('0xf8')]));}return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x39d476,_0x28c3('0x105'));};AGIVertices[_0x28c3('0x13')]['sesteknda']=function(_0xa88804){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0xa88804[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0xa88804[_0x28c3('0x106')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x107'));}if(!this[_0x28c3('0xb5')](_0xa88804[_0x28c3('0x108')])){return this[_0x28c3('0x39')]['noop']('no\x20username\x20configured');}if(!this[_0x28c3('0xb5')](_0xa88804[_0x28c3('0x109')])){return this[_0x28c3('0x39')]['noop'](_0x28c3('0x10a'));}if(!this[_0x28c3('0xb5')](_0xa88804[_0x28c3('0x10b')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xba'));}this[_0x28c3('0x39')][_0x28c3('0xf5')]=!![];this[_0x28c3('0x38')](_0xa88804);this[_0x28c3('0x45')](_0xa88804[_0x28c3('0x65')],'in','','');this[_0x28c3('0x39')]['noop'](util[_0x28c3('0x2d')](_0x28c3('0x10c'),_0xa88804[_0x28c3('0x65')]));var _0x1471be=this[_0x28c3('0x8a')][_0x28c3('0x77')](this,_0xa88804);if(_0x1471be){for(var _0x5cdfe7 in _0x1471be){if(_0x1471be[_0x28c3('0xa2')](_0x5cdfe7)){this[_0x28c3('0x39')]['setVariable'](util[_0x28c3('0x2d')]('SESTEK_NDA_%s',_0x5cdfe7[_0x28c3('0xf7')]()),_0x1471be[_0x5cdfe7]);}}this[_0x28c3('0x45')](_0x1471be[_0x28c3('0xf8')],_0x28c3('0xf9'),_0x28c3('0x10d'),'');if(_0x1471be[_0x28c3('0x10e')]){this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x10f'),_0x1471be[_0x28c3('0x10e')]));var _0x305347=this[_0x28c3('0x39')][_0x28c3('0x110')](_0x1471be[_0x28c3('0x10e')]);try{fs[_0x28c3('0x111')](_0x1471be['audiofile']+_0x28c3('0x112'));}catch(_0x110d9b){logger[_0x28c3('0x35')](_0x110d9b);}return _0x305347;}else{return this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x113'),_0x1471be[_0x28c3('0xf8')]));}}return this[_0x28c3('0x39')]['error'](_0xa88804,_0x28c3('0x114'));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x115')]=function(_0x527a52){logger['info'](util['format'](_0x28c3('0x116'),_0x527a52['label']));return this[_0x28c3('0x39')][_0x28c3('0xbe')]('end');};AGIVertices[_0x28c3('0x13')][_0x28c3('0x117')]=function(_0x3a6b7c){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x118'),_0x3a6b7c[_0x28c3('0x3b')]));var _0x51107a='';if(_0x3a6b7c['trunk_id']){if(!this['isConfigured'](_0x3a6b7c['trunk_id'])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x3a6b7c,_0x28c3('0x119'));}else{var _0xad869a=parseInt(_0x3a6b7c[_0x28c3('0x11a')],0xa);if(isNaN(_0xad869a)){_0x51107a=_0x3a6b7c[_0x28c3('0x11a')];}else{_0x51107a=this[_0x28c3('0x20')][_0x28c3('0x77')](this,_0x3a6b7c['trunk_id']);if(!_0x51107a){return this['channel'][_0x28c3('0x35')](_0x3a6b7c,_0x28c3('0x11b'));}}}}else if(_0x3a6b7c[_0x28c3('0x11c')]){_0x51107a=_0x3a6b7c['trunk_name'];}else{return this['channel'][_0x28c3('0x35')](_0x3a6b7c,_0x28c3('0x119'));}var _0x59e8ef=this[_0x28c3('0x39')]['exec'](_0x28c3('0xf2'),[util['format'](_0x28c3('0x11d'),_0x51107a,_0x3a6b7c[_0x28c3('0x4a')]),_0x3a6b7c['timeout'],_0x3a6b7c['opts'],_0x3a6b7c[_0x28c3('0x6d')]]);if(_0x59e8ef['result']===-0x1){return _0x59e8ef;}return this['channel']['noop'](util[_0x28c3('0x2d')](_0x28c3('0xf1'),_0x28c3('0xf2')));};AGIVertices[_0x28c3('0x13')]['finally']=function(_0x553a92){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x11e'),_0x553a92[_0x28c3('0x3b')]));return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x11f'));};AGIVertices['prototype'][_0x28c3('0x11')]=function(_0x55db03){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x120'),_0x55db03[_0x28c3('0x3b')]));if(_0x55db03[_0x28c3('0xb7')]===0x0){return this[_0x28c3('0xb6')](_0x55db03);}_0x55db03[_0x28c3('0xb7')]-=0x1;if(!this['isConfigured'](_0x55db03[_0x28c3('0x121')])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x55db03,_0x28c3('0x122'));}var _0x13a537=this[_0x28c3('0x22')][_0x28c3('0x77')](this,_0x55db03[_0x28c3('0x121')]);if(!_0x13a537){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x55db03,'no\x20file\x20audio\x20found');}if(!this[_0x28c3('0xb5')](_0x55db03[_0x28c3('0xe3')])){return this['channel'][_0x28c3('0x35')](_0x28c3('0xe4'));}var _0x5632b7=this['channel'][_0x28c3('0x123')](_0x13a537,_0x55db03['response'],_0x55db03[_0x28c3('0x124')]);var _0xfeaf5=_0x5632b7[_0x28c3('0xb3')]?_0x5632b7[_0x28c3('0xb3')][_0x28c3('0xb1')]():'';logger[_0x28c3('0x31')](_0x28c3('0x125'),JSON['stringify'](_0x5632b7));if(_0x5632b7[_0x28c3('0xb3')]===-0x1){this['createSquareDetailsReport'][_0x28c3('0x77')](this,_0x55db03,_0xfeaf5);return _0x5632b7;}else if(_0x5632b7['extra']===_0x28c3('0x6f')){_0x5632b7['result']=_0xfeaf5[_0x28c3('0xa7')]>=parseInt(_0x55db03['mindigit'])?'x':'i';}else{_0x5632b7['result']=_0xfeaf5['length']>=parseInt(_0x55db03[_0x28c3('0x126')])&&_0xfeaf5[_0x28c3('0xa7')]<=parseInt(_0x55db03[_0x28c3('0x124')])?'x':'i';}var _0x319438=this[_0x28c3('0xaf')][_0x28c3('0x77')](this,_0x55db03[_0x28c3('0xe3')]);if(!_0x319438){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x55db03,_0x28c3('0xe5'));}this[_0x28c3('0x39')][_0x28c3('0xab')](_0x319438,_0xfeaf5);if(this[_0x28c3('0xb5')](_0x55db03[_0x28c3('0x127')])){var _0x592967=parseInt(_0x55db03[_0x28c3('0x127')],0xa);var _0x384be4=rs['generate']({'charset':'*','length':_0x592967});var _0x2c421a=_0xfeaf5['length'];if(_0x2c421a>0x0){if(_0x2c421a>_0x592967){this['createSquareDetailsReport'][_0x28c3('0x77')](this,_0x55db03,_0x55db03[_0x28c3('0x128')]===_0x28c3('0x129')?_0x384be4+_0xfeaf5['substr'](_0x592967):_0xfeaf5[_0x28c3('0x12a')](0x0,_0x2c421a-_0x592967)+_0x384be4);}else{this[_0x28c3('0x38')][_0x28c3('0x77')](this,_0x55db03,rs['generate']({'charset':'*','length':_0x2c421a}));}}else{this[_0x28c3('0x38')][_0x28c3('0x77')](this,_0x55db03,'');}}else{this[_0x28c3('0x38')]['sync'](this,_0x55db03,_0xfeaf5);}return _0x5632b7;};AGIVertices['prototype'][_0x28c3('0x12b')]=function(_0x388170){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x12c'),_0x388170[_0x28c3('0x3b')]));return this['getdigits'](_0x388170);};AGIVertices['prototype'][_0x28c3('0x12d')]=function(_0x369586){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x12e'),_0x369586[_0x28c3('0x3b')]));this[_0x28c3('0x38')][_0x28c3('0x77')](this,_0x369586,_0x369586[_0x28c3('0x12f')]);return this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x130'),_0x369586[_0x28c3('0x12f')]));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x131')]=function(_0x5237da){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5237da[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x5237da[_0x28c3('0x92')])||!this[_0x28c3('0xb5')](_0x5237da['aws_secret_access_key'])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x132'));}if(!this[_0x28c3('0xb5')](_0x5237da[_0x28c3('0x65')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xba'));}this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format'](_0x28c3('0x133'),_0x5237da[_0x28c3('0x65')]));var _0x328d1f=this[_0x28c3('0x91')][_0x28c3('0x77')](this,_0x5237da);if(_0x328d1f){this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x134'),_0x328d1f));var _0x3461fe=this[_0x28c3('0x39')][_0x28c3('0x110')](_0x328d1f);try{fs[_0x28c3('0x111')](_0x328d1f+'.wav');}catch(_0x294e7a){logger[_0x28c3('0x35')](_0x294e7a);}return _0x3461fe;}return this['channel'][_0x28c3('0x35')](_0x5237da,_0x28c3('0x135'));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x136')]=function(_0x2a7093){logger[_0x28c3('0x31')](util['format'](_0x28c3('0x137'),_0x2a7093['label']));if(!this[_0x28c3('0xb5')](_0x2a7093[_0x28c3('0x92')])||!this[_0x28c3('0xb5')](_0x2a7093[_0x28c3('0x98')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x132'));}if(!this[_0x28c3('0xb5')](_0x2a7093['aws_bot_name'])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x138'));}if(!this[_0x28c3('0xb5')](_0x2a7093[_0x28c3('0x65')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')]('no\x20text\x20configured');}this[_0x28c3('0x39')][_0x28c3('0xf5')]=!![];this[_0x28c3('0x38')](_0x2a7093);this['createSquareMessage'](_0x2a7093[_0x28c3('0x65')],'in','','');this[_0x28c3('0x39')]['noop'](util[_0x28c3('0x2d')](_0x28c3('0x139'),_0x2a7093[_0x28c3('0x65')]));var _0x744652=this[_0x28c3('0x97')][_0x28c3('0x77')](this,_0x2a7093);if(_0x744652){for(var _0x1d7c7d in _0x744652){if(_0x744652[_0x28c3('0xa2')](_0x1d7c7d)&&_[_0x28c3('0xa3')](_0x744652[_0x1d7c7d])){this[_0x28c3('0x39')]['setVariable'](util[_0x28c3('0x2d')](_0x28c3('0x13a'),_0x1d7c7d['toUpperCase']()),_0x744652[_0x1d7c7d]);}}if(_[_0x28c3('0x52')](_0x744652[_0x28c3('0x80')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x28c3('0x45')](_0x744652[_0x28c3('0x80')],_0x28c3('0xf9'),_0x28c3('0x13b'),'');return this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format'](_0x28c3('0x13c'),_0x744652[_0x28c3('0x80')]));}}return this[_0x28c3('0x39')]['error'](_0x2a7093,_0x28c3('0x13d'));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x13e')]=function(_0xa746aa){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x13f'),_0xa746aa[_0x28c3('0x3b')],_0xa746aa[_0x28c3('0x6f')]));if(!this[_0x28c3('0xb5')](_0xa746aa[_0x28c3('0x83')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')]('no\x20key\x20configured');}var _0x4455d2=_0x28c3('0x140');var _0x271f38=util[_0x28c3('0x2d')]('%s/recordings/%s',FILES_PATH,rs[_0x28c3('0x141')](0x4));var _0x3fa0a2=util['format'](_0x28c3('0xaa'),_0x271f38,_0x4455d2);var _0x36cd5a=!![];if(_0xa746aa[_0x28c3('0x142')]===_0x28c3('0x143')){_0x36cd5a=![];}var _0x52e541=this['channel']['recordFile'](_0x271f38,_0x4455d2,_0xa746aa[_0x28c3('0x144')],_0xa746aa[_0x28c3('0x6f')],undefined,_0x36cd5a);if(_0x52e541[_0x28c3('0xb3')]!==-0x1){this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format'](_0x28c3('0x145'),_0x3fa0a2));var _0x1ad531=this[_0x28c3('0x9b')][_0x28c3('0x77')](this,_0xa746aa,_0x3fa0a2);if(_0x1ad531){for(var _0x14304d in _0x1ad531){if(_0x1ad531['hasOwnProperty'](_0x14304d)){this['channel'][_0x28c3('0xab')](util[_0x28c3('0x2d')](_0x28c3('0x146'),_0x14304d[_0x28c3('0xf7')]()),_0x1ad531[_0x14304d]);}}return this[_0x28c3('0x39')]['noop'](util[_0x28c3('0x2d')](_0x28c3('0x147'),JSON[_0x28c3('0x7c')](_0x1ad531)));}}return _0x52e541;};AGIVertices[_0x28c3('0x13')][_0x28c3('0x148')]=function(_0x17927e){logger[_0x28c3('0x31')](util['format'](_0x28c3('0x149'),_0x17927e[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x17927e['appid'])){return this['channel'][_0x28c3('0xbe')](_0x28c3('0x14a'));}if(!this[_0x28c3('0xb5')](_0x17927e['appsecret'])){return this['channel'][_0x28c3('0xbe')]('no\x20appsecret\x20configured');}var _0x30c4d9=_0x28c3('0x140');var _0x330e70=util[_0x28c3('0x2d')](_0x28c3('0x14b'),FILES_PATH,rs['generate'](0x4));var _0x491802=util[_0x28c3('0x2d')](_0x28c3('0xaa'),_0x330e70,_0x30c4d9);var _0x38696b=!![];if(_0x17927e['beep']===_0x28c3('0x143')){_0x38696b=![];}var _0x5e3b72=this[_0x28c3('0x39')][_0x28c3('0x14c')](_0x330e70,_0x30c4d9,_0x17927e['intKey'],_0x17927e['timeout'],undefined,_0x38696b);if(_0x5e3b72[_0x28c3('0xb3')]!==-0x1){this['channel']['noop'](util['format']('tilde\x20%s\x20file\x20created',_0x491802));var _0x1e7053=this[_0x28c3('0x9d')][_0x28c3('0x77')](this,_0x17927e,_0x491802);if(_0x1e7053){for(var _0x1e96b8 in _0x1e7053){if(_0x1e7053[_0x28c3('0xa2')](_0x1e96b8)){this[_0x28c3('0x39')][_0x28c3('0xab')](util[_0x28c3('0x2d')]('TILDE_ASR_%s',_0x1e96b8[_0x28c3('0xf7')]()),_0x1e7053[_0x1e96b8]);}}return this[_0x28c3('0x39')]['noop'](util[_0x28c3('0x2d')](_0x28c3('0x14d'),JSON[_0x28c3('0x7c')](_0x1e7053)));}}return _0x5e3b72;};AGIVertices[_0x28c3('0x13')]['gotoc']=function(_0x3416bb){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x14e'),_0x3416bb['label']));return this[_0x28c3('0x39')][_0x28c3('0x14f')](_0x3416bb[_0x28c3('0x40')],_0x3416bb['extension'],_0x3416bb['priority']);};AGIVertices[_0x28c3('0x13')][_0x28c3('0x150')]=function(_0x5d94a8){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x151'),_0x5d94a8[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x5d94a8[_0x28c3('0x152')])){return this['channel'][_0x28c3('0x35')](_0x5d94a8,_0x28c3('0x153'));}try{var _0xf4a920=eval(_0x5d94a8['condition'])?_0x28c3('0x154'):_0x28c3('0x155');this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x156'),_0x5d94a8[_0x28c3('0x152')],_0xf4a920));return{'code':0xc8,'result':_0xf4a920};}catch(_0xbd4937){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x28c3('0x13')][_0x28c3('0x157')]=function(_0x5d2b60){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x158'),_0x5d2b60['label']));if(!this['isConfigured'](_0x5d2b60['interval_id'])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x5d2b60,_0x28c3('0x159'));}var _0x4d4651=this[_0x28c3('0x15a')][_0x28c3('0x77')](this,_0x5d2b60[_0x28c3('0x15b')]);if(!_0x4d4651){return this[_0x28c3('0x39')]['error'](_0x5d2b60,_0x28c3('0x15c'));}for(var _0x59ef57=0x0;_0x59ef57<_0x4d4651[_0x28c3('0xa7')];_0x59ef57+=0x1){var _0x28c976=this[_0x28c3('0x39')][_0x28c3('0xaf')](util[_0x28c3('0x2d')]('IFTIME(%s?true:false)',_0x4d4651[_0x59ef57]));if(_0x28c976[_0x28c3('0xb3')]===-0x1){return _0x28c976;}logger['info'](util[_0x28c3('0x2d')](_0x28c3('0x15d'),_0x4d4651[_0x59ef57],_0x28c976[_0x28c3('0xb0')]));if(_0x28c976['extra']===_0x28c3('0x154')){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')]('IFTIME\x20%s\x20%s',_0x4d4651[_0x59ef57],_0x28c3('0x154')));this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')]('IFTIME\x20%s\x20%s',_0x4d4651[_0x59ef57],_0x28c3('0x154')));return{'code':0xc8,'result':'true'};}else{logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x15d'),_0x4d4651[_0x59ef57],_0x28c3('0x155')));this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x15d'),_0x4d4651[_0x59ef57],_0x28c3('0x155')));}}return{'code':0xc8,'result':_0x28c3('0x155')};};AGIVertices['prototype'][_0x28c3('0x15e')]=function(_0x249ff0){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x15f'),_0x249ff0['label']));return this[_0x28c3('0x39')][_0x28c3('0x15e')]();};AGIVertices['prototype']['ispeechasr']=function(_0x2d471c){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x160'),_0x2d471c['label']));if(!this[_0x28c3('0xb5')](_0x2d471c[_0x28c3('0x83')])){return this[_0x28c3('0x39')]['noop'](_0x28c3('0x161'));}var _0x514b30=_0x28c3('0x140');var _0x2b0ff4=util[_0x28c3('0x2d')](_0x28c3('0x14b'),FILES_PATH,rs[_0x28c3('0x141')](0x4));var _0x297c09=util[_0x28c3('0x2d')](_0x28c3('0xaa'),_0x2b0ff4,_0x514b30);var _0x133747=!![];if(_0x2d471c[_0x28c3('0x142')]===_0x28c3('0x143')){_0x133747=![];}var _0x401070=this[_0x28c3('0x39')]['recordFile'](_0x2b0ff4,_0x514b30,_0x2d471c[_0x28c3('0x144')],_0x2d471c[_0x28c3('0x6f')],undefined,_0x133747);if(_0x401070[_0x28c3('0xb3')]!==-0x1){this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')]('ispeech\x20%s\x20file\x20created',_0x297c09));var _0x1b5a4c=this[_0x28c3('0x8e')][_0x28c3('0x77')](this,_0x2d471c,_0x297c09);if(_0x1b5a4c){for(var _0x304934 in _0x1b5a4c){if(_0x1b5a4c[_0x28c3('0xa2')](_0x304934)){this[_0x28c3('0x39')][_0x28c3('0xab')](util[_0x28c3('0x2d')]('ISPEECH_ASR_%s',_0x304934[_0x28c3('0xf7')]()),_0x1b5a4c[_0x304934]);}}return this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x162'),JSON[_0x28c3('0x7c')](_0x1b5a4c)));}}return _0x401070;};AGIVertices['prototype']['ispeechtts']=function(_0x3d5678){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x163'),_0x3d5678[_0x28c3('0x3b')]));if(!this['isConfigured'](_0x3d5678['key'])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x161'));}if(!this[_0x28c3('0xb5')](_0x3d5678[_0x28c3('0x65')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xba'));}this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')]('Trying\x20ispeech\x20TTS\x20%s',_0x3d5678[_0x28c3('0x65')]));var _0x2b4f69=this['ispeechTTS'][_0x28c3('0x77')](this,_0x3d5678);if(_0x2b4f69){this[_0x28c3('0x39')]['noop'](util[_0x28c3('0x2d')](_0x28c3('0x164'),_0x2b4f69));var _0x38b2b6=this[_0x28c3('0x39')][_0x28c3('0x110')](_0x2b4f69,_0x3d5678['intKey']);try{fs[_0x28c3('0x111')](_0x2b4f69+_0x28c3('0x112'));}catch(_0x232415){logger[_0x28c3('0x35')](_0x232415);}return _0x38b2b6;}return this['channel'][_0x28c3('0x35')](_0x3d5678,_0x28c3('0x165'));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x166')]=function(_0x57b4f8){logger[_0x28c3('0x31')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x57b4f8[_0x28c3('0x3b')]));if(!this['isConfigured'](_0x57b4f8[_0x28c3('0x167')])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x57b4f8,_0x28c3('0x168'));}logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x169'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x57b4f8[_0x28c3('0x167')]));var _0x5cce97=this[_0x28c3('0x5e')][_0x28c3('0x77')](this,_0x57b4f8[_0x28c3('0x167')]);if(_0x5cce97){logger[_0x28c3('0x31')](util['format'](_0x28c3('0x16a'),this['channel'][_0x28c3('0x3e')],_0x57b4f8[_0x28c3('0x167')]));this[_0x28c3('0x39')]['noop'](util['format'](_0x28c3('0x16a'),this[_0x28c3('0x39')]['callerid'],_0x57b4f8['findBy']));return{'code':0xc8,'result':_0x28c3('0x16b')};}else{logger['info'](util[_0x28c3('0x2d')](_0x28c3('0x16c'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x57b4f8[_0x28c3('0x167')]));this[_0x28c3('0x39')]['noop'](util[_0x28c3('0x2d')](_0x28c3('0x16c'),this[_0x28c3('0x39')]['callerid'],_0x57b4f8[_0x28c3('0x167')]));return{'code':0xc8,'result':_0x28c3('0x16d')};}};AGIVertices['prototype'][_0x28c3('0x16e')]=function(_0x12741b){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x16f'),_0x12741b[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x12741b['findBy'])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x12741b,_0x28c3('0x168'));}logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x169'),this[_0x28c3('0x39')]['callerid'],_0x12741b['findBy']));var _0x35ad22=this[_0x28c3('0x5d')]['sync'](this,_0x12741b[_0x28c3('0x167')]);if(_0x35ad22){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x16a'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x12741b[_0x28c3('0x167')]));this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x16a'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x12741b['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x16c'),this[_0x28c3('0x39')]['callerid'],_0x12741b[_0x28c3('0x167')]));this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x16c'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x12741b[_0x28c3('0x167')]));return{'code':0xc8,'result':_0x28c3('0x16d')};}};AGIVertices[_0x28c3('0x13')][_0x28c3('0x170')]=function(_0x1648fe){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1648fe['label']));if(!this[_0x28c3('0xb5')](_0x1648fe['operation'])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x1648fe,_0x28c3('0x171'));}this[_0x28c3('0x39')]['noop'](util[_0x28c3('0x2d')](_0x28c3('0x172'),_0x1648fe[_0x28c3('0x173')]));var _0xcfaf9=eval(_0x1648fe[_0x28c3('0x173')]);if(!this['isConfigured'](_0x1648fe['variable_id'])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xe4'));}var _0x8baa6b=this[_0x28c3('0xaf')]['sync'](this,_0x1648fe['variable_id']);if(!_0x8baa6b){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x1648fe,_0x28c3('0xe5'));}if(_[_0x28c3('0xa6')](_0xcfaf9)){var _0x3a3e8f=this;_0xcfaf9['forEach'](function(_0x44fdac,_0x5b338c){_0x3a3e8f[_0x28c3('0x39')][_0x28c3('0xab')](util[_0x28c3('0x2d')]('%s[%s]',_0x8baa6b,_0x5b338c),_0x44fdac);});return this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x174'),_0x8baa6b));}else{return this[_0x28c3('0x39')][_0x28c3('0xab')](_0x8baa6b,_0xcfaf9);}};AGIVertices['prototype'][_0x28c3('0x10')]=function(_0x4f8968){logger['info'](util['format'](_0x28c3('0x175'),_0x4f8968['label']));if(_0x4f8968[_0x28c3('0xb7')]===0x0){return this[_0x28c3('0xb6')](_0x4f8968);}_0x4f8968[_0x28c3('0xb7')]-=0x1;if(!this[_0x28c3('0xb5')](_0x4f8968[_0x28c3('0x121')])){return this['channel']['error'](_0x4f8968,'no\x20file\x20audio\x20selected');}var _0x23c481=this[_0x28c3('0x22')][_0x28c3('0x77')](this,_0x4f8968[_0x28c3('0x121')]);if(!_0x23c481){return this['channel'][_0x28c3('0x35')](_0x4f8968,_0x28c3('0x176'));}var _0x2c80d5=this[_0x28c3('0x39')][_0x28c3('0x123')](_0x23c481,_0x4f8968[_0x28c3('0x177')],_0x4f8968[_0x28c3('0x178')]);var _0x468594=_0x2c80d5[_0x28c3('0xb3')];if(_0x2c80d5[_0x28c3('0xb3')]===-0x1){this['createSquareDetailsReport'][_0x28c3('0x77')](this,_0x4f8968,'-1');return _0x2c80d5;}else if(_0x2c80d5[_0x28c3('0xb0')]==='timeout'){_0x2c80d5[_0x28c3('0xb3')]=_0x2c80d5[_0x28c3('0xb3')]['length']>0x0?_0x2c80d5['result']:'t';}else if(_[_0x28c3('0x47')](_0x2c80d5[_0x28c3('0xb3')])){_0x2c80d5['result']='#';_0x468594='#';}if(!this['isConfigured'](_0x4f8968[_0x28c3('0xe3')])){this[_0x28c3('0x39')][_0x28c3('0xbe')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x31e796=this[_0x28c3('0xaf')]['sync'](this,_0x4f8968[_0x28c3('0xe3')]);if(!_0x31e796){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x4f8968,_0x28c3('0xe5'));}this['channel']['setVariable'](_0x31e796,_0x468594);}this[_0x28c3('0x38')][_0x28c3('0x77')](this,_0x4f8968,_0x468594);return _0x2c80d5;};AGIVertices[_0x28c3('0x13')]['noop']=function(_0x5a6b13){logger[_0x28c3('0x31')](util['format'](_0x28c3('0x179'),_0x5a6b13['label']));return this['channel'][_0x28c3('0xbe')](_0x5a6b13[_0x28c3('0x17a')]||_0x5a6b13[_0x28c3('0x3b')]);};AGIVertices[_0x28c3('0x13')][_0x28c3('0x17b')]=function(_0x56172d){logger[_0x28c3('0x31')](util['format'](_0x28c3('0x17c'),_0x56172d[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x56172d[_0x28c3('0x167')])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x56172d,_0x28c3('0x168'));}logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x169'),this['channel'][_0x28c3('0x3e')],_0x56172d[_0x28c3('0x167')]));var _0x2e94fe=this[_0x28c3('0x59')][_0x28c3('0x77')](this,_0x56172d[_0x28c3('0x17d')]);var _0x229b28=this[_0x28c3('0x5a')][_0x28c3('0x77')](this,_0x56172d[_0x28c3('0x167')],_0x2e94fe);if(_0x229b28){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x16a'),this['channel'][_0x28c3('0x3e')],_0x56172d[_0x28c3('0x167')]));this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x56172d[_0x28c3('0x167')]));return{'code':0xc8,'result':'success'};}else{logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x16c'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x56172d[_0x28c3('0x167')]));this[_0x28c3('0x39')]['noop'](util[_0x28c3('0x2d')](_0x28c3('0x16a'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x56172d[_0x28c3('0x167')]));return{'code':0xc8,'result':_0x28c3('0x16d')};}};AGIVertices[_0x28c3('0x13')][_0x28c3('0x17e')]=function(_0x524edc){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x524edc[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x524edc[_0x28c3('0x121')])){return this['channel']['error'](_0x524edc,_0x28c3('0x122'));}var _0x3edf22=this['getSound'][_0x28c3('0x77')](this,_0x524edc[_0x28c3('0x121')]);if(!_0x3edf22){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x524edc,_0x28c3('0x176'));}var _0xd25846=this[_0x28c3('0x39')]['exec'](_0x28c3('0x17f'),[_0x3edf22,_0x524edc[_0x28c3('0xf0')]]);if(_0xd25846['result']===-0x1){return _0xd25846;}return this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0xd2'),_0x28c3('0x17f'),_0x3edf22));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x180')]=function(_0x203cb1){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x203cb1['label']));if(!this['isConfigured'](_0x203cb1[_0x28c3('0x181')])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x203cb1,_0x28c3('0x182'));}var _0x1f85ad='';var _0x572533=parseInt(_0x203cb1['queue_id'],0xa);if(isNaN(_0x572533)){_0x1f85ad=_0x203cb1[_0x28c3('0x181')];}else{_0x1f85ad=this[_0x28c3('0x18')]['sync'](this,_0x203cb1[_0x28c3('0x181')]);if(!_0x1f85ad){return this['channel'][_0x28c3('0x35')](_0x203cb1,'no\x20queue\x20found');}}var _0x343413='';if(this[_0x28c3('0xb5')](_0x203cb1['file_id'])){var _0x14d3ee=this[_0x28c3('0x22')][_0x28c3('0x77')](this,_0x203cb1[_0x28c3('0x121')]);if(_0x14d3ee){_0x343413=_0x14d3ee;}}this[_0x28c3('0x38')][_0x28c3('0x77')](this,_0x203cb1,_0x1f85ad);if(_0x203cb1['opts'][_0x28c3('0x183')]('x')<0x0){_0x203cb1[_0x28c3('0xf0')]+='x';}if(_0x203cb1[_0x28c3('0xf0')][_0x28c3('0x183')]('X')<0x0){_0x203cb1[_0x28c3('0xf0')]+='X';}this[_0x28c3('0x39')][_0x28c3('0xab')](_0x28c3('0x184'),_0x1f85ad?_0x1f85ad[_0x28c3('0x185')]():'');var _0x2e290d=this['channel'][_0x28c3('0xd0')](_0x28c3('0x186'),[_0x1f85ad,_0x203cb1['opts'],_0x203cb1['url'],_0x343413,_0x203cb1[_0x28c3('0x6f')],_0x203cb1[_0x28c3('0xa')],_0x203cb1[_0x28c3('0x187')],_0x203cb1[_0x28c3('0x188')],'',_0x203cb1[_0x28c3('0x189')]]);if(_0x2e290d[_0x28c3('0xb3')]===-0x1){return _0x2e290d;}return this[_0x28c3('0x39')]['noop'](util[_0x28c3('0x2d')](_0x28c3('0xd2'),_0x28c3('0x186'),_0x1f85ad));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x18a')]=function(_0xfd75e8){logger['info'](util['format'](_0x28c3('0x18b'),_0xfd75e8[_0x28c3('0x3b')]));var _0x4bb00f=_0xfd75e8[_0x28c3('0x18c')]||'wav';var _0x3bf523=util[_0x28c3('0x2d')](_0x28c3('0x18d'),this[_0x28c3('0x39')][_0x28c3('0x3a')],rs[_0x28c3('0x141')](0x5));var _0x23a2b9=util[_0x28c3('0x2d')](_0x28c3('0x18e'),FILES_PATH,_0x3bf523,_0x4bb00f);var _0x5a1323=util['format'](_0x28c3('0x14b'),FILES_PATH,_0x3bf523);this[_0x28c3('0x3f')][_0x28c3('0x77')](this,_0xfd75e8,_0x3bf523,_0x23a2b9);this[_0x28c3('0x39')][_0x28c3('0xab')](_0x28c3('0x18f'),_0x3bf523);logger[_0x28c3('0x31')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x5a1323,_0x4bb00f,_0xfd75e8[_0x28c3('0x190')],_0xfd75e8['timeout']);return this[_0x28c3('0x39')]['recordFile'](_0x5a1323,_0x4bb00f,_0xfd75e8[_0x28c3('0x190')],_0xfd75e8[_0x28c3('0x6f')],undefined,!![]);};AGIVertices['prototype'][_0x28c3('0x191')]=function(_0x166cc0){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x192'),_0x166cc0[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x166cc0[_0x28c3('0x6d')])){return this['channel']['noop']('no\x20url\x20configured');}var _0x1dfb8f=this[_0x28c3('0x6c')]['sync'](this,_0x166cc0);logger[_0x28c3('0x31')](util[_0x28c3('0x2d')]('Response:',util[_0x28c3('0x193')](_0x1dfb8f,{'showHidden':![],'depth':null})));if(!this[_0x28c3('0xb5')](_0x166cc0[_0x28c3('0xe3')])){return this[_0x28c3('0x39')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x3b596f=this['getVariable'][_0x28c3('0x77')](this,_0x166cc0[_0x28c3('0xe3')]);if(!_0x3b596f){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x166cc0,'no\x20variable\x20found');}this['channel'][_0x28c3('0xab')](util['format'](_0x28c3('0x194'),_0x3b596f),_0x1dfb8f[_0x28c3('0x7e')]?_0x1dfb8f[_0x28c3('0x7e')]:_0x28c3('0x195'));this['channel'][_0x28c3('0xab')](util['format'](_0x28c3('0x196'),_0x3b596f),_0x1dfb8f[_0x28c3('0x7f')]?_0x1dfb8f[_0x28c3('0x7f')]:'OK');if(_0x1dfb8f[_0x28c3('0x73')]){try{this[_0x28c3('0xa9')](_0x1dfb8f[_0x28c3('0x73')],_0x3b596f);}catch(_0x2b5ce6){logger[_0x28c3('0x35')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x3b596f));}}return this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0xe9'),_0x3b596f));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x197')]=function(_0x4e9d3b){logger[_0x28c3('0x31')](util['format'](_0x28c3('0x198'),_0x4e9d3b[_0x28c3('0x3b')]));return this[_0x28c3('0x39')][_0x28c3('0x199')](_0x4e9d3b[_0x28c3('0x19a')]['replace'](/\s+/g,''),_0x4e9d3b[_0x28c3('0x190')]);};AGIVertices['prototype'][_0x28c3('0x19b')]=function(_0x1364f9){logger[_0x28c3('0x31')](util['format'](_0x28c3('0x19c'),_0x1364f9[_0x28c3('0x3b')]));return this[_0x28c3('0x39')]['sayNumber'](_0x1364f9[_0x28c3('0x19d')][_0x28c3('0x61')](/\s+/g,''),_0x1364f9[_0x28c3('0x190')]);};AGIVertices[_0x28c3('0x13')][_0x28c3('0x19e')]=function(_0x2039d7){logger['info'](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x2039d7[_0x28c3('0x3b')]));return this['channel'][_0x28c3('0x19f')](_0x2039d7[_0x28c3('0x65')],_0x2039d7[_0x28c3('0x190')]);};AGIVertices[_0x28c3('0x13')][_0x28c3('0x1a0')]=function(_0x413384){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x1a1'),_0x413384[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x413384[_0x28c3('0x1a2')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x1a3'));}var _0x38f042=this['getMailAccount'][_0x28c3('0x77')](this,_0x413384[_0x28c3('0x1a2')]);if(!_0x38f042||!_0x38f042[_0x28c3('0x1a4')]){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x413384,'no\x20mail\x20account\x20found');}var _0x4027de={'from':util[_0x28c3('0x2d')]('\x22%s\x22\x20<%s>',_0x38f042[_0x28c3('0x16')],_0x38f042['email']||_0x38f042[_0x28c3('0x1a4')]['user']),'to':_0x413384['to']||'','cc':_0x413384['cc']||'','bcc':_0x413384[_0x28c3('0x1a5')]||'','subject':_0x413384['subject'],'html':_0x413384['text'],'text':_0x413384[_0x28c3('0x65')]};var _0x484490={'tls':{'rejectUnauthorized':![]}};if(_0x38f042[_0x28c3('0x1a4')]['service']){_0x484490['service']=_0x38f042[_0x28c3('0x1a4')][_0x28c3('0x1a6')];}else{_0x484490[_0x28c3('0x1a7')]=_0x38f042[_0x28c3('0x1a4')][_0x28c3('0x1a7')];_0x484490[_0x28c3('0x1a8')]=_0x38f042[_0x28c3('0x1a4')][_0x28c3('0x1a8')];_0x484490[_0x28c3('0x1a9')]=_0x38f042[_0x28c3('0x1a4')][_0x28c3('0x1a9')];}if(_0x38f042[_0x28c3('0x1a4')]['authentication']){_0x484490[_0x28c3('0x1aa')]={'user':_0x38f042[_0x28c3('0x1a4')][_0x28c3('0x1ab')],'pass':_0x38f042[_0x28c3('0x1a4')]['pass']};}if(this[_0x28c3('0xb5')](_0x413384['template_id'])){}logger[_0x28c3('0xeb')]('sendMail\x20message',JSON[_0x28c3('0x7c')](_0x4027de));this[_0x28c3('0x38')][_0x28c3('0x77')](this,_0x413384,_0x413384[_0x28c3('0x1a2')]);this['channel']['noop'](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x38f042['name']));this[_0x28c3('0x27')][_0x28c3('0x77')](this,_0x484490,_0x4027de);return this[_0x28c3('0x39')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x28c3('0x13')]['sendFax']=function(_0x3fb405){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x3fb405[_0x28c3('0x3b')]));return this[_0x28c3('0x39')][_0x28c3('0xbe')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x28c3('0x13')]['sendSMS']=function(_0x542c50){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x1ac'),_0x542c50[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0x542c50['sms_account_id'])){return this['channel']['noop']('no\x20sms\x20account\x20configured');}var _0x3ae1ed=this['getSmsAccount'][_0x28c3('0x77')](this,_0x542c50[_0x28c3('0x1ad')]);if(!_0x3ae1ed){return this['channel']['error'](_0x542c50,_0x28c3('0x1ae'));}var _0x596480={'body':_0x542c50[_0x28c3('0x1af')],'phone':_0x542c50['to']||'','SmsAccountId':_0x3ae1ed['id']};logger[_0x28c3('0xeb')](_0x28c3('0x1b0'),JSON[_0x28c3('0x7c')](_0x596480));this[_0x28c3('0x38')][_0x28c3('0x77')](this,_0x542c50,_0x542c50[_0x28c3('0x1ad')]);this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x3ae1ed[_0x28c3('0x16')]));this[_0x28c3('0x37')][_0x28c3('0x77')](this,_0x596480);return this['channel'][_0x28c3('0xbe')](_0x28c3('0x1b1'));};AGIVertices['prototype']['set']=function(_0xa35cfc){logger[_0x28c3('0x31')](util['format'](_0x28c3('0x1b2'),_0xa35cfc[_0x28c3('0x3b')]));if(!this[_0x28c3('0xb5')](_0xa35cfc[_0x28c3('0xe3')])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0xa35cfc,_0x28c3('0x1b3'));}var _0x3a1dea=this[_0x28c3('0xaf')][_0x28c3('0x77')](this,_0xa35cfc['variable_id']);if(!_0x3a1dea){return this['channel']['error'](_0xa35cfc,'no\x20variable\x20found');}return this[_0x28c3('0x39')][_0x28c3('0xab')](_0x3a1dea,_0xa35cfc[_0x28c3('0x1b4')]);};AGIVertices[_0x28c3('0x13')][_0x28c3('0x1b5')]=function(_0x5e1e61){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')]('Enter\x20in\x20START\x20(%s)\x20block',_0x5e1e61[_0x28c3('0x3b')]));this[_0x28c3('0x39')][_0x28c3('0xbe')]('START\x20CALLY\x20SQUARE');if(_0x5e1e61[_0x28c3('0x1b6')]===_0x28c3('0x1b7')){this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x1b8'));return this['channel']['answer']();}return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x1b9'));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x1ba')]=function(_0x488690){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x1bb'),_0x488690[_0x28c3('0x3b')]));if(!this['isConfigured'](_0x488690['project_id'])){return this[_0x28c3('0x39')]['error'](_0x488690,_0x28c3('0x1bc'));}var _0xca5467=this[_0x28c3('0x1bd')][_0x28c3('0x77')](this,_0x488690[_0x28c3('0x1be')]);if(!this[_0x28c3('0xb5')](_0xca5467)){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x488690,util[_0x28c3('0x2d')](_0x28c3('0x1bf'),_0x488690[_0x28c3('0x1be')]));}if(_0xca5467===this[_0x28c3('0x39')][_0x28c3('0x3d')]){return this[_0x28c3('0x39')]['error'](_0x488690,_0x28c3('0x1c0'));}this['createSquareDetailsReport'][_0x28c3('0x77')](this,_0x488690,_0xca5467);var _0x310a18=this[_0x28c3('0x39')][_0x28c3('0xd0')](_0x28c3('0x1c1'),util[_0x28c3('0x2d')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x28c3('0x1a7')]||'127.0.0.1',_0xca5467,this[_0x28c3('0x39')][_0x28c3('0x3d')]));if(_0x310a18['result']===-0x1){return _0x310a18;}return this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format'](_0x28c3('0xd2'),'AGI',_0xca5467));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x1c2')]=function(_0x146bed){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x1c3'),_0x146bed['label']));var _0xb3cfac=this[_0x28c3('0x60')][_0x28c3('0x77')](this,_0x146bed[_0x28c3('0xc5')]);this['createSquareDetailsReport'][_0x28c3('0x77')](this,_0x146bed,_0x146bed[_0x28c3('0xc5')]);if(this['isConfigured'](_0x146bed[_0x28c3('0xe3')])){var _0x208b27=this[_0x28c3('0xaf')]['sync'](this,_0x146bed[_0x28c3('0xe3')]);if(_0x208b27){this['channel']['setVariable'](_0x208b27,_0xb3cfac);return this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x1c4'),_0x146bed[_0x28c3('0xc5')],_0x208b27));}}return this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x1c5'),_0x146bed[_0x28c3('0xc5')]));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x1c6')]=function(_0x1dda31){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x1c7'),_0x1dda31[_0x28c3('0x3b')]));_0x1dda31['text']=_0x1dda31[_0x28c3('0x65')][_0x28c3('0x61')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x28c3('0xb5')](_0x1dda31['apiKey'])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0x1c8'));}if(!this[_0x28c3('0xb5')](_0x1dda31[_0x28c3('0x65')])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xba'));}this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x1c9'),_0x1dda31[_0x28c3('0x65')]));var _0x14131e=this[_0x28c3('0x62')][_0x28c3('0x77')](this,_0x1dda31);if(_0x14131e){this[_0x28c3('0x39')][_0x28c3('0xbe')](util[_0x28c3('0x2d')](_0x28c3('0x1ca'),_0x14131e));var _0x5e1673=this[_0x28c3('0x39')]['streamFile'](_0x14131e);try{fs[_0x28c3('0x111')](_0x14131e+_0x28c3('0x112'));}catch(_0x286266){logger[_0x28c3('0x35')](_0x286266);}return _0x5e1673;}return this['channel'][_0x28c3('0x35')](_0x1dda31,_0x28c3('0x1cb'));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x1cc')]=function(_0x296bb1){logger['info'](util[_0x28c3('0x2d')](_0x28c3('0x1cd'),_0x296bb1['label']));_0x296bb1[_0x28c3('0x65')]=_0x296bb1[_0x28c3('0x65')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x28c3('0xb5')](_0x296bb1['text'])){return this[_0x28c3('0x39')][_0x28c3('0xbe')](_0x28c3('0xba'));}this['channel'][_0x28c3('0xbe')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x296bb1[_0x28c3('0x65')]));var _0x30322c=this['googleTTS'][_0x28c3('0x77')](this,_0x296bb1);if(_0x30322c){this['channel'][_0x28c3('0xbe')](util[_0x28c3('0x2d')]('Google\x20TTS\x20%s\x20file\x20created',_0x30322c));var _0x1019ab=this['channel']['streamFile'](_0x30322c);try{fs[_0x28c3('0x111')](_0x30322c+'.wav');}catch(_0x1b6c67){logger[_0x28c3('0x35')](_0x1b6c67);}return _0x1019ab;}return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x296bb1,_0x28c3('0x1ce'));};AGIVertices[_0x28c3('0x13')][_0x28c3('0x1cf')]=function(_0x2f9bae){logger[_0x28c3('0x31')](util['format'](_0x28c3('0x1d0'),_0x2f9bae[_0x28c3('0x3b')]));if(!this['isConfigured'](_0x2f9bae[_0x28c3('0x167')])){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x2f9bae,_0x28c3('0x168'));}logger['info'](util[_0x28c3('0x2d')](_0x28c3('0x169'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x2f9bae[_0x28c3('0x167')]));var _0x470b22=this[_0x28c3('0x5c')][_0x28c3('0x77')](this,_0x2f9bae[_0x28c3('0x167')]);if(_0x470b22){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x16a'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x2f9bae[_0x28c3('0x167')]));this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format'](_0x28c3('0x16a'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x2f9bae['findBy']));return{'code':0xc8,'result':_0x28c3('0x16b')};}else{logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x16c'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x2f9bae['findBy']));this[_0x28c3('0x39')][_0x28c3('0xbe')](util['format'](_0x28c3('0x16c'),this[_0x28c3('0x39')][_0x28c3('0x3e')],_0x2f9bae[_0x28c3('0x167')]));return{'code':0xc8,'result':_0x28c3('0x16d')};}};AGIVertices[_0x28c3('0x13')][_0x28c3('0x1d1')]=function(_0x20b2a0){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x1d2'),_0x20b2a0[_0x28c3('0x3b')]));var _0x46ee6a=this[_0x28c3('0x39')][_0x28c3('0xd0')](_0x28c3('0x1d3'),[_0x20b2a0[_0x28c3('0x1d4')],_0x20b2a0[_0x28c3('0x81')]]);if(_0x46ee6a[_0x28c3('0xb3')]===-0x1){return _0x46ee6a;}return this['channel']['noop'](util[_0x28c3('0x2d')](_0x28c3('0xd2'),_0x28c3('0x1d3'),_0x20b2a0[_0x28c3('0x1d4')]));};AGIVertices['prototype']['vswitch']=function(_0x51a447){logger[_0x28c3('0x31')](util[_0x28c3('0x2d')](_0x28c3('0x1d5'),_0x51a447[_0x28c3('0x3b')]));if(!this['isConfigured'](_0x51a447[_0x28c3('0xe3')])){return this[_0x28c3('0x39')]['error'](_0x51a447,_0x28c3('0x1b3'));}var _0x3cf1ff=this[_0x28c3('0xaf')][_0x28c3('0x77')](this,_0x51a447[_0x28c3('0xe3')]);if(!_0x3cf1ff){return this[_0x28c3('0x39')][_0x28c3('0x35')](_0x51a447,_0x28c3('0xe5'));}var _0x3fd546=this['channel'][_0x28c3('0xaf')](_0x3cf1ff);return{'code':0xc8,'result':_0x3fd546['extra']?_0x3fd546[_0x28c3('0xb0')]:'-'};};String['prototype']['replaceAll']=function(_0x4bac77,_0x163013){return this['split'](_0x4bac77)[_0x28c3('0x1d6')](_0x163013);};module[_0x28c3('0x1d7')]=AGIVertices;
\ No newline at end of file
index 2c6daf7..0cd27bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ec8=['transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','../ami','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','startAcw','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil'];(function(_0x3a4203,_0xa6ff2e){var _0x1a5661=function(_0x584f45){while(--_0x584f45){_0x3a4203['push'](_0x3a4203['shift']());}};_0x1a5661(++_0xa6ff2e);}(_0x8ec8,0xff));var _0x88ec=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8ec8[_0x2641f9];return _0x585741;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var ami=require(_0x88ec('0x0'));var logger=require(_0x88ec('0x1'))('acw');var RpcUser=require(_0x88ec('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x25d8e9){this[_0x88ec('0x3')]=_0x25d8e9['voiceQueues'];this[_0x88ec('0x4')]=_0x25d8e9[_0x88ec('0x4')];this[_0x88ec('0x5')]=_0x25d8e9[_0x88ec('0x5')];this[_0x88ec('0x6')]={};ami['on'](_0x88ec('0x7'),this['syncAgentConnect'][_0x88ec('0x8')](this));ami['on']('hanguprequest',this[_0x88ec('0x9')][_0x88ec('0x8')](this));ami['on'](_0x88ec('0xa'),this[_0x88ec('0xb')][_0x88ec('0x8')](this));ami['on'](_0x88ec('0xc'),this[_0x88ec('0xd')][_0x88ec('0x8')](this));ami['on']('attendedtransfer',this[_0x88ec('0xe')][_0x88ec('0x8')](this));ami['on']('blindtransfer',this[_0x88ec('0xf')][_0x88ec('0x8')](this));ami['on']('custom:agentConnectPreview',this[_0x88ec('0x10')][_0x88ec('0x8')](this));}function getDiff(_0x208bd6){var _0x3104b1=moment()[_0x88ec('0x11')](0x0);var _0x2f2465=moment(_0x208bd6)['milliseconds'](0x0);return _0x3104b1[_0x88ec('0x12')](_0x2f2465,'seconds');}Acw['prototype'][_0x88ec('0x13')]=function(_0x1c6230){try{var _0x34a21f=this;var _0x39d451=this[_0x88ec('0x6')][_0x1c6230]['interface'];var _0x19449b=this[_0x88ec('0x6')][_0x1c6230][_0x88ec('0x14')];var _0x51146d=this[_0x88ec('0x3')][_0x19449b];var _0x5d18e1=![];var _0x4b5a90=_0x88ec('0x15');if(_0x51146d['mandatoryDisposition']){if(_0x51146d[_0x88ec('0x16')][_0x88ec('0x17')]){_0x5d18e1=!![];_0x4b5a90=_0x51146d[_0x88ec('0x16')][_0x88ec('0x17')];}}ami[_0x88ec('0x18')]({'action':_0x88ec('0x19'),'interface':_0x39d451,'paused':!![],'reason':_0x4b5a90})[_0x88ec('0x1a')](function(_0x55c1d9){if(_0x34a21f['agents'][_0x39d451]){return RpcUser[_0x88ec('0x1b')](_0x34a21f[_0x88ec('0x4')][_0x39d451]['id'])[_0x88ec('0x1a')](function(_0x52dc60){if(_0x52dc60&&!_0x52dc60[_0x88ec('0x1c')]){logger['info'](_0x88ec('0x1d'),_0x1c6230,_0x39d451,_0x19449b);var _0x55baf7=_0x34a21f[_0x88ec('0x6')][_0x1c6230][_0x88ec('0x1e')]&&_0x34a21f[_0x88ec('0x6')][_0x1c6230]['destlinkedid']?_0x34a21f['channels'][_0x1c6230][_0x88ec('0x1f')]:_0x1c6230;return RpcUser[_0x88ec('0x20')](_0x34a21f['agents'][_0x39d451],_0x4b5a90,_0x55baf7)[_0x88ec('0x1a')](function(_0x2833ff){if(!_0x5d18e1){_0x34a21f[_0x88ec('0x5')][_0x39d451]={};logger['info'](_0x88ec('0x21'),_0x1c6230,_0x34a21f[_0x88ec('0x3')][_0x19449b][_0x88ec('0x22')],_0x39d451,_0x19449b);_0x34a21f[_0x88ec('0x5')][_0x39d451]['timer']=setTimeout(_0x34a21f[_0x88ec('0x23')][_0x88ec('0x8')](_0x34a21f,_0x39d451),_0x34a21f[_0x88ec('0x3')][_0x19449b][_0x88ec('0x22')]*0x3e8);_0x34a21f[_0x88ec('0x5')][_0x39d451][_0x88ec('0x24')]=moment()[_0x88ec('0x25')](_0x88ec('0x26'));_0x34a21f[_0x88ec('0x5')][_0x39d451][_0x88ec('0x27')]=_0x1c6230;_0x34a21f['timers'][_0x39d451][_0x88ec('0x14')]=_0x19449b;_0x34a21f[_0x88ec('0x5')][_0x39d451][_0x88ec('0x28')]=function(){var _0xdbad50=getDiff(_0x34a21f['timers'][_0x39d451]['lastPauseAt']);clearTimeout(_0x34a21f[_0x88ec('0x5')][_0x39d451]['timer']);_0x34a21f['timers'][_0x39d451][_0x88ec('0x29')]=![];RpcVoiceAgentReport[_0x88ec('0x2a')]({'acwtime':_0xdbad50},_0x34a21f[_0x88ec('0x5')][_0x39d451][_0x88ec('0x27')],_0x39d451)['then'](function(_0x13f485){logger['info'](_0x88ec('0x2b'),_0x1c6230,_0xdbad50,_0x13f485);})[_0x88ec('0x2c')](function(_0xbfbd63){logger[_0x88ec('0x2d')](_0x88ec('0x2e'),_0x1c6230,_0xbfbd63);});delete _0x34a21f[_0x88ec('0x5')][_0x39d451];};}});}else{logger[_0x88ec('0x2f')](_0x88ec('0x30'),_0x1c6230,_0x39d451,_0x19449b);}});}})[_0x88ec('0x2c')](function(_0x5e22e8){logger[_0x88ec('0x2d')](_0x88ec('0x21'),_0x1c6230,_0x34a21f[_0x88ec('0x3')][_0x19449b]['acwTimeout'],_0x39d451,_0x19449b);})['finally'](function(){delete _0x34a21f[_0x88ec('0x6')][_0x1c6230];});}catch(_0x238a67){logger[_0x88ec('0x2d')](_0x88ec('0x31'),_0x238a67[_0x88ec('0x32')]);}};Acw[_0x88ec('0x33')]['stopAcw']=function(_0x4c84d8){try{var _0x513b10=this;if(_0x513b10[_0x88ec('0x5')][_0x4c84d8]){_0x513b10['timers'][_0x4c84d8][_0x88ec('0x29')]=![];var _0x44ee7c=_0x513b10[_0x88ec('0x5')][_0x4c84d8]['uniqueid'];var _0x4458bc=_0x513b10[_0x88ec('0x5')][_0x4c84d8][_0x88ec('0x14')];var _0x4c9483=_0x513b10[_0x88ec('0x3')][_0x4458bc][_0x88ec('0x22')];logger[_0x88ec('0x2f')](_0x88ec('0x34'),_0x44ee7c,_0x4c84d8);RpcUser[_0x88ec('0x35')](this[_0x88ec('0x4')][_0x4c84d8]);RpcVoiceAgentReport[_0x88ec('0x2a')]({'acwtime':_0x4c9483,'agentacw':!![]},_0x44ee7c,_0x4c84d8)['then'](function(_0x26b5d5){logger[_0x88ec('0x2f')](_0x88ec('0x2b'),_0x44ee7c,_0x4c9483,_0x26b5d5);})[_0x88ec('0x2c')](function(_0x562613){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x44ee7c,_0x562613);});}else{logger[_0x88ec('0x2d')](_0x88ec('0x36'),_0x4c84d8);if(_0x513b10['timers']){logger[_0x88ec('0x2f')]('[ACW][TIMERS]',JSON[_0x88ec('0x37')](_0x513b10['timers']));}}}catch(_0x4d328c){logger[_0x88ec('0x2d')](_0x88ec('0x38'),_0x4d328c['message']);}};Acw[_0x88ec('0x33')][_0x88ec('0x39')]=function(_0x9bc738){try{if(this[_0x88ec('0x3')][_0x9bc738[_0x88ec('0x14')]]&&(this[_0x88ec('0x3')][_0x9bc738[_0x88ec('0x14')]][_0x88ec('0x3a')]||this['voiceQueues'][_0x9bc738[_0x88ec('0x14')]]['mandatoryDisposition'])){if(this[_0x88ec('0x4')][_0x9bc738[_0x88ec('0x3b')]]){this['channels'][_0x9bc738['uniqueid']]={'queue':_0x9bc738[_0x88ec('0x14')],'interface':_0x9bc738[_0x88ec('0x3b')],'destlinkedid':_0x9bc738[_0x88ec('0x1f')]};}}}catch(_0x14d913){logger[_0x88ec('0x2d')](_0x88ec('0x3c'),_0x14d913[_0x88ec('0x32')]);}};Acw[_0x88ec('0x33')][_0x88ec('0x10')]=function(_0x3a628e){try{if(this['voiceQueues'][_0x3a628e[_0x88ec('0x14')]]&&(this[_0x88ec('0x3')][_0x3a628e[_0x88ec('0x14')]][_0x88ec('0x3a')]||this[_0x88ec('0x3')][_0x3a628e[_0x88ec('0x14')]]['mandatoryDisposition'])){if(this[_0x88ec('0x4')][_0x3a628e[_0x88ec('0x3b')]]){this[_0x88ec('0x6')][_0x3a628e[_0x88ec('0x27')]]={'queue':_0x3a628e[_0x88ec('0x14')],'interface':_0x3a628e[_0x88ec('0x3b')]};}}}catch(_0x520bd4){logger['error'](_0x88ec('0x3d'),_0x520bd4[_0x88ec('0x32')]);}};Acw[_0x88ec('0x33')][_0x88ec('0x9')]=function(_0x2c546e){try{if(this[_0x88ec('0x6')][_0x2c546e[_0x88ec('0x27')]]&&_['isUndefined'](this[_0x88ec('0x6')][_0x2c546e[_0x88ec('0x27')]]['attended'])){logger[_0x88ec('0x2f')]('[%s][HANGUP:UNIQUEID]',_0x2c546e[_0x88ec('0x27')]);this[_0x88ec('0x13')](_0x2c546e['uniqueid']);}else if(this[_0x88ec('0x6')][_0x2c546e['linkedid']]&&_[_0x88ec('0x3e')](this[_0x88ec('0x6')][_0x2c546e['linkedid']][_0x88ec('0x1e')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x2c546e[_0x88ec('0x3f')]);this[_0x88ec('0x13')](_0x2c546e[_0x88ec('0x3f')]);}}catch(_0x91e79f){logger[_0x88ec('0x2d')](_0x88ec('0x40'),_0x91e79f[_0x88ec('0x32')]);}};Acw[_0x88ec('0x33')][_0x88ec('0xb')]=function(_0x52c406){try{if(this['channels'][_0x52c406[_0x88ec('0x27')]]&&this[_0x88ec('0x6')][_0x52c406['uniqueid']][_0x88ec('0x1e')]){logger[_0x88ec('0x2f')](_0x88ec('0x41'),_0x52c406['uniqueid']);this['startAcw'](_0x52c406['uniqueid']);}else if(this[_0x88ec('0x6')][_0x52c406[_0x88ec('0x3f')]]&&this[_0x88ec('0x6')][_0x52c406[_0x88ec('0x3f')]][_0x88ec('0x1e')]){logger[_0x88ec('0x2f')](_0x88ec('0x42'),_0x52c406[_0x88ec('0x3f')]);this[_0x88ec('0x13')](_0x52c406['linkedid']);}}catch(_0x157843){logger[_0x88ec('0x2d')](_0x88ec('0x43'),_0x157843[_0x88ec('0x32')]);}};Acw[_0x88ec('0x33')]['syncAttendedTransfer']=function(_0xe9de9e){try{if(!_[_0x88ec('0x44')](this[_0x88ec('0x6')][_0xe9de9e[_0x88ec('0x45')]])){this[_0x88ec('0x13')](_0xe9de9e[_0x88ec('0x45')]);if(this[_0x88ec('0x6')][_0xe9de9e[_0x88ec('0x46')]]){this[_0x88ec('0x6')][_0xe9de9e[_0x88ec('0x46')]]['attended']=!![];this[_0x88ec('0x6')][_0xe9de9e[_0x88ec('0x47')]]=this[_0x88ec('0x6')][_0xe9de9e[_0x88ec('0x46')]];delete this['channels'][_0xe9de9e[_0x88ec('0x46')]];}}else if(!_['isNil'](this[_0x88ec('0x6')][_0xe9de9e['transfertargetuniqueid']])){this[_0x88ec('0x13')](_0xe9de9e[_0x88ec('0x47')]);if(this[_0x88ec('0x6')][_0xe9de9e[_0x88ec('0x48')]]){this[_0x88ec('0x6')][_0xe9de9e['origtransfereruniqueid']][_0x88ec('0x1e')]=!![];this[_0x88ec('0x6')][_0xe9de9e[_0x88ec('0x45')]]=this[_0x88ec('0x6')][_0xe9de9e[_0x88ec('0x48')]];delete this[_0x88ec('0x6')][_0xe9de9e[_0x88ec('0x48')]];}}}catch(_0x176615){logger[_0x88ec('0x2d')]('[ACW][syncAttendedTransfer]\x20%s',_0x176615['message']);}};Acw[_0x88ec('0x33')][_0x88ec('0xf')]=function(_0x4e794a){try{if(this[_0x88ec('0x6')][_0x4e794a[_0x88ec('0x49')]]){logger[_0x88ec('0x2f')](_0x88ec('0x4a'),JSON[_0x88ec('0x37')](_0x4e794a['transfereruniqueid']));this[_0x88ec('0x13')](_0x4e794a['transfereruniqueid']);}else if(this[_0x88ec('0x6')][_0x4e794a[_0x88ec('0x4b')]]){logger['info'](_0x88ec('0x4c'),JSON[_0x88ec('0x37')](_0x4e794a[_0x88ec('0x4b')]));this[_0x88ec('0x13')](_0x4e794a[_0x88ec('0x4b')]);}}catch(_0x26e3cb){logger[_0x88ec('0x2d')](_0x88ec('0x4d'),_0x26e3cb[_0x88ec('0x32')]);}};Acw[_0x88ec('0x33')]['syncAgentRingNoAnswer']=function(_0x2a8299){try{if(this[_0x88ec('0x3')][_0x2a8299[_0x88ec('0x14')]]&&this['voiceQueues'][_0x2a8299[_0x88ec('0x14')]]['autopause']===_0x88ec('0x4e')){if(this[_0x88ec('0x4')][_0x2a8299[_0x88ec('0x3b')]]){logger[_0x88ec('0x2f')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x2a8299[_0x88ec('0x27')],_0x2a8299[_0x88ec('0x3b')],_0x2a8299[_0x88ec('0x14')]);return RpcUser['savePause'](this[_0x88ec('0x4')][_0x2a8299[_0x88ec('0x3b')]],_0x88ec('0x4f'),_0x2a8299['uniqueid']);}}}catch(_0x56ce41){logger['error'](_0x88ec('0x50'),_0x56ce41[_0x88ec('0x32')]);}};module['exports']=Acw;
\ No newline at end of file
+var _0x0dfe=['../ami','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hangup','bind','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','startAcw','channels','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','uniqueid','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','message','prototype','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','syncHangupRequest','attended','[%s][HANGUP:UNIQUEID]','isUndefined','[%s][HANGUP:LINKEDID]','linkedid','syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0dfe,0xea));var _0xe0df=function(_0x2bd28d,_0x3b260b){_0x2bd28d=_0x2bd28d-0x0;var _0x24c85b=_0x0dfe[_0x2bd28d];return _0x24c85b;};'use strict';var util=require(_0xe0df('0x0'));var _=require(_0xe0df('0x1'));var moment=require(_0xe0df('0x2'));var ami=require(_0xe0df('0x3'));var logger=require('../../../config/logger')(_0xe0df('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xe0df('0x5'));function Acw(_0x43eff3){this[_0xe0df('0x6')]=_0x43eff3[_0xe0df('0x6')];this[_0xe0df('0x7')]=_0x43eff3[_0xe0df('0x7')];this['timers']=_0x43eff3[_0xe0df('0x8')];this['channels']={};ami['on'](_0xe0df('0x9'),this[_0xe0df('0xa')]['bind'](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on'](_0xe0df('0xb'),this['syncHangup'][_0xe0df('0xc')](this));ami['on'](_0xe0df('0xd'),this[_0xe0df('0xe')]['bind'](this));ami['on'](_0xe0df('0xf'),this[_0xe0df('0x10')][_0xe0df('0xc')](this));ami['on'](_0xe0df('0x11'),this[_0xe0df('0x12')][_0xe0df('0xc')](this));ami['on'](_0xe0df('0x13'),this['syncAgentConnectPreview'][_0xe0df('0xc')](this));}function getDiff(_0x2571c2){var _0x3424fb=moment()[_0xe0df('0x14')](0x0);var _0xc6ba4c=moment(_0x2571c2)[_0xe0df('0x14')](0x0);return _0x3424fb[_0xe0df('0x15')](_0xc6ba4c,_0xe0df('0x16'));}Acw['prototype'][_0xe0df('0x17')]=function(_0x5802ba){try{var _0xd933e8=this;var _0x12b4e6=this['channels'][_0x5802ba]['interface'];var _0x203811=this[_0xe0df('0x18')][_0x5802ba][_0xe0df('0x19')];var _0x55f649=this[_0xe0df('0x6')][_0x203811];var _0x2d4182=![];var _0x49a37d=_0xe0df('0x1a');if(_0x55f649['mandatoryDisposition']){if(_0x55f649[_0xe0df('0x1b')][_0xe0df('0x1c')]){_0x2d4182=!![];_0x49a37d=_0x55f649[_0xe0df('0x1b')][_0xe0df('0x1c')];}}ami[_0xe0df('0x1d')]({'action':_0xe0df('0x1e'),'interface':_0x12b4e6,'paused':!![],'reason':_0x49a37d})[_0xe0df('0x1f')](function(_0x4676c0){if(_0xd933e8[_0xe0df('0x7')][_0x12b4e6]){return RpcUser[_0xe0df('0x20')](_0xd933e8[_0xe0df('0x7')][_0x12b4e6]['id'])['then'](function(_0x878684){if(_0x878684&&!_0x878684[_0xe0df('0x21')]){logger[_0xe0df('0x22')](_0xe0df('0x23'),_0x5802ba,_0x12b4e6,_0x203811);var _0x3f79a4=_0xd933e8['channels'][_0x5802ba]['attended']&&_0xd933e8[_0xe0df('0x18')][_0x5802ba]['destlinkedid']?_0xd933e8[_0xe0df('0x18')][_0x5802ba][_0xe0df('0x24')]:_0x5802ba;return RpcUser[_0xe0df('0x25')](_0xd933e8[_0xe0df('0x7')][_0x12b4e6],_0x49a37d,_0x3f79a4)[_0xe0df('0x1f')](function(_0xa92ea9){if(!_0x2d4182){_0xd933e8[_0xe0df('0x8')][_0x12b4e6]={};logger[_0xe0df('0x22')](_0xe0df('0x26'),_0x5802ba,_0xd933e8['voiceQueues'][_0x203811][_0xe0df('0x27')],_0x12b4e6,_0x203811);_0xd933e8[_0xe0df('0x8')][_0x12b4e6][_0xe0df('0x28')]=setTimeout(_0xd933e8['stopAcw']['bind'](_0xd933e8,_0x12b4e6),_0xd933e8[_0xe0df('0x6')][_0x203811][_0xe0df('0x27')]*0x3e8);_0xd933e8['timers'][_0x12b4e6]['lastPauseAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xd933e8[_0xe0df('0x8')][_0x12b4e6][_0xe0df('0x29')]=_0x5802ba;_0xd933e8['timers'][_0x12b4e6][_0xe0df('0x19')]=_0x203811;_0xd933e8[_0xe0df('0x8')][_0x12b4e6]['updateAcw']=function(){var _0x549542=getDiff(_0xd933e8['timers'][_0x12b4e6][_0xe0df('0x2a')]);clearTimeout(_0xd933e8[_0xe0df('0x8')][_0x12b4e6][_0xe0df('0x28')]);_0xd933e8['timers'][_0x12b4e6][_0xe0df('0x28')]=![];RpcVoiceAgentReport[_0xe0df('0x2b')]({'acwtime':_0x549542},_0xd933e8[_0xe0df('0x8')][_0x12b4e6][_0xe0df('0x29')],_0x12b4e6)[_0xe0df('0x1f')](function(_0x3d227d){logger[_0xe0df('0x22')](_0xe0df('0x2c'),_0x5802ba,_0x549542,_0x3d227d);})[_0xe0df('0x2d')](function(_0x3802bc){logger[_0xe0df('0x2e')](_0xe0df('0x2f'),_0x5802ba,_0x3802bc);});delete _0xd933e8[_0xe0df('0x8')][_0x12b4e6];};}});}else{logger[_0xe0df('0x22')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x5802ba,_0x12b4e6,_0x203811);}});}})[_0xe0df('0x2d')](function(_0xfc25ab){logger[_0xe0df('0x2e')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5802ba,_0xd933e8[_0xe0df('0x6')][_0x203811]['acwTimeout'],_0x12b4e6,_0x203811);})[_0xe0df('0x30')](function(){delete _0xd933e8[_0xe0df('0x18')][_0x5802ba];});}catch(_0x43e030){logger[_0xe0df('0x2e')]('[ACW][START]\x20%s',_0x43e030[_0xe0df('0x31')]);}};Acw[_0xe0df('0x32')]['stopAcw']=function(_0x1da728){try{var _0x54ccba=this;if(_0x54ccba[_0xe0df('0x8')][_0x1da728]){_0x54ccba['timers'][_0x1da728][_0xe0df('0x28')]=![];var _0x28b703=_0x54ccba[_0xe0df('0x8')][_0x1da728][_0xe0df('0x29')];var _0x5c6c7e=_0x54ccba[_0xe0df('0x8')][_0x1da728][_0xe0df('0x19')];var _0x285352=_0x54ccba[_0xe0df('0x6')][_0x5c6c7e][_0xe0df('0x27')];logger[_0xe0df('0x22')]('[%s][TIMER][STOP][AGENT:%s]',_0x28b703,_0x1da728);RpcUser['saveUnpause'](this[_0xe0df('0x7')][_0x1da728]);RpcVoiceAgentReport[_0xe0df('0x2b')]({'acwtime':_0x285352,'agentacw':!![]},_0x28b703,_0x1da728)[_0xe0df('0x1f')](function(_0x5efddc){logger['info'](_0xe0df('0x2c'),_0x28b703,_0x285352,_0x5efddc);})[_0xe0df('0x2d')](function(_0x88dd33){logger['error'](_0xe0df('0x2f'),_0x28b703,_0x88dd33);});}else{logger[_0xe0df('0x2e')](_0xe0df('0x33'),_0x1da728);if(_0x54ccba[_0xe0df('0x8')]){logger[_0xe0df('0x22')]('[ACW][TIMERS]',JSON[_0xe0df('0x34')](_0x54ccba[_0xe0df('0x8')]));}}}catch(_0xb1e799){logger['error'](_0xe0df('0x35'),_0xb1e799[_0xe0df('0x31')]);}};Acw['prototype'][_0xe0df('0xa')]=function(_0x4c5915){try{if(this[_0xe0df('0x6')][_0x4c5915[_0xe0df('0x19')]]&&(this[_0xe0df('0x6')][_0x4c5915['queue']]['acw']||this[_0xe0df('0x6')][_0x4c5915[_0xe0df('0x19')]][_0xe0df('0x36')])){if(this[_0xe0df('0x7')][_0x4c5915['interface']]){this[_0xe0df('0x18')][_0x4c5915[_0xe0df('0x29')]]={'queue':_0x4c5915[_0xe0df('0x19')],'interface':_0x4c5915[_0xe0df('0x37')],'destlinkedid':_0x4c5915['destlinkedid']};}}}catch(_0x658aae){logger[_0xe0df('0x2e')](_0xe0df('0x38'),_0x658aae[_0xe0df('0x31')]);}};Acw[_0xe0df('0x32')]['syncAgentConnectPreview']=function(_0x43fcdb){try{if(this['voiceQueues'][_0x43fcdb[_0xe0df('0x19')]]&&(this[_0xe0df('0x6')][_0x43fcdb[_0xe0df('0x19')]]['acw']||this[_0xe0df('0x6')][_0x43fcdb[_0xe0df('0x19')]][_0xe0df('0x36')])){if(this[_0xe0df('0x7')][_0x43fcdb['interface']]){this[_0xe0df('0x18')][_0x43fcdb[_0xe0df('0x29')]]={'queue':_0x43fcdb['queue'],'interface':_0x43fcdb[_0xe0df('0x37')]};}}}catch(_0x52ebd0){logger[_0xe0df('0x2e')]('[ACW][syncAgentConnectPreview]\x20%s',_0x52ebd0['message']);}};Acw[_0xe0df('0x32')][_0xe0df('0x39')]=function(_0x2e1b48){try{if(this['channels'][_0x2e1b48[_0xe0df('0x29')]]&&_['isUndefined'](this[_0xe0df('0x18')][_0x2e1b48[_0xe0df('0x29')]][_0xe0df('0x3a')])){logger[_0xe0df('0x22')](_0xe0df('0x3b'),_0x2e1b48[_0xe0df('0x29')]);this['startAcw'](_0x2e1b48[_0xe0df('0x29')]);}else if(this[_0xe0df('0x18')][_0x2e1b48['linkedid']]&&_[_0xe0df('0x3c')](this['channels'][_0x2e1b48['linkedid']]['attended'])){logger[_0xe0df('0x22')](_0xe0df('0x3d'),_0x2e1b48[_0xe0df('0x3e')]);this['startAcw'](_0x2e1b48['linkedid']);}}catch(_0x484c81){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x484c81[_0xe0df('0x31')]);}};Acw[_0xe0df('0x32')][_0xe0df('0x3f')]=function(_0x33e8d5){try{if(this[_0xe0df('0x18')][_0x33e8d5[_0xe0df('0x29')]]&&this[_0xe0df('0x18')][_0x33e8d5['uniqueid']]['attended']){logger[_0xe0df('0x22')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x33e8d5[_0xe0df('0x29')]);this[_0xe0df('0x17')](_0x33e8d5[_0xe0df('0x29')]);}else if(this['channels'][_0x33e8d5[_0xe0df('0x3e')]]&&this[_0xe0df('0x18')][_0x33e8d5[_0xe0df('0x3e')]][_0xe0df('0x3a')]){logger[_0xe0df('0x22')](_0xe0df('0x40'),_0x33e8d5[_0xe0df('0x3e')]);this[_0xe0df('0x17')](_0x33e8d5[_0xe0df('0x3e')]);}}catch(_0x6f678f){logger[_0xe0df('0x2e')](_0xe0df('0x41'),_0x6f678f[_0xe0df('0x31')]);}};Acw[_0xe0df('0x32')]['syncAttendedTransfer']=function(_0x2b3b3f){try{if(!_[_0xe0df('0x42')](this[_0xe0df('0x18')][_0x2b3b3f[_0xe0df('0x43')]])){this[_0xe0df('0x17')](_0x2b3b3f[_0xe0df('0x43')]);if(this[_0xe0df('0x18')][_0x2b3b3f[_0xe0df('0x44')]]){this[_0xe0df('0x18')][_0x2b3b3f[_0xe0df('0x44')]][_0xe0df('0x3a')]=!![];this[_0xe0df('0x18')][_0x2b3b3f[_0xe0df('0x45')]]=this[_0xe0df('0x18')][_0x2b3b3f[_0xe0df('0x44')]];delete this[_0xe0df('0x18')][_0x2b3b3f[_0xe0df('0x44')]];}}else if(!_[_0xe0df('0x42')](this[_0xe0df('0x18')][_0x2b3b3f[_0xe0df('0x45')]])){this[_0xe0df('0x17')](_0x2b3b3f['transfertargetuniqueid']);if(this[_0xe0df('0x18')][_0x2b3b3f['origtransfereruniqueid']]){this[_0xe0df('0x18')][_0x2b3b3f['origtransfereruniqueid']][_0xe0df('0x3a')]=!![];this[_0xe0df('0x18')][_0x2b3b3f[_0xe0df('0x43')]]=this['channels'][_0x2b3b3f[_0xe0df('0x46')]];delete this['channels'][_0x2b3b3f[_0xe0df('0x46')]];}}}catch(_0x4a0019){logger[_0xe0df('0x2e')](_0xe0df('0x47'),_0x4a0019[_0xe0df('0x31')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x3d4224){try{if(this[_0xe0df('0x18')][_0x3d4224[_0xe0df('0x48')]]){logger[_0xe0df('0x22')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xe0df('0x34')](_0x3d4224['transfereruniqueid']));this[_0xe0df('0x17')](_0x3d4224['transfereruniqueid']);}else if(this[_0xe0df('0x18')][_0x3d4224[_0xe0df('0x49')]]){logger['info'](_0xe0df('0x4a'),JSON['stringify'](_0x3d4224[_0xe0df('0x49')]));this['startAcw'](_0x3d4224[_0xe0df('0x49')]);}}catch(_0x46800e){logger[_0xe0df('0x2e')]('[ACW][syncBlindTransfer]\x20%s',_0x46800e[_0xe0df('0x31')]);}};Acw[_0xe0df('0x32')][_0xe0df('0xe')]=function(_0x401aad){try{if(this[_0xe0df('0x6')][_0x401aad[_0xe0df('0x19')]]&&this[_0xe0df('0x6')][_0x401aad[_0xe0df('0x19')]]['autopause']===_0xe0df('0x4b')){if(this[_0xe0df('0x7')][_0x401aad[_0xe0df('0x37')]]){logger[_0xe0df('0x22')](_0xe0df('0x4c'),_0x401aad[_0xe0df('0x29')],_0x401aad[_0xe0df('0x37')],_0x401aad['queue']);return RpcUser[_0xe0df('0x25')](this[_0xe0df('0x7')][_0x401aad[_0xe0df('0x37')]],_0xe0df('0x4d'),_0x401aad['uniqueid']);}}}catch(_0x2f3a26){logger[_0xe0df('0x2e')](_0xe0df('0x4e'),_0x2f3a26['message']);}};module['exports']=Acw;
\ No newline at end of file
index b55f811..86e7e6f 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(_0x379a64,_0x4f95fd){var _0x1e56d0=function(_0x3455b2){while(--_0x3455b2){_0x379a64['push'](_0x379a64['shift']());}};_0x1e56d0(++_0x4f95fd);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3f9ea9,_0x19840d){_0x3f9ea9=_0x3f9ea9-0x0;var _0x291e7f=_0x0b0e[_0x3f9ea9];return _0x291e7f;};'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 _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2032,0xd9));var _0x2203=function(_0x4e3472,_0x3222b6){_0x4e3472=_0x4e3472-0x0;var _0x349e76=_0x2032[_0x4e3472];return _0x349e76;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami;
\ No newline at end of file
index 61df69e..31aa062 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(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0xe706,0xa3));var _0x6e70=function(_0x192136,_0x434d09){_0x192136=_0x192136-0x0;var _0x2524a5=_0xe706[_0x192136];return _0x2524a5;};'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 _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0xa8d8fb,_0x438854){var _0x84bc96=function(_0x3f9b2b){while(--_0x3f9b2b){_0xa8d8fb['push'](_0xa8d8fb['shift']());}};_0x84bc96(++_0x438854);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client;
\ No newline at end of file
index d592af5..d3afbc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38fa=['getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype'];(function(_0x23dafe,_0x334a57){var _0x2dbf58=function(_0x2ce53e){while(--_0x2ce53e){_0x23dafe['push'](_0x23dafe['shift']());}};_0x2dbf58(++_0x334a57);}(_0x38fa,0x17d));var _0xa38f=function(_0xc6a313,_0x4d1edc){_0xc6a313=_0xc6a313-0x0;var _0x1d7602=_0x38fa[_0xc6a313];return _0x1d7602;};'use strict';var util=require(_0xa38f('0x0'));var _=require(_0xa38f('0x1'));var moment=require(_0xa38f('0x2'));function checkNameSurname(_0x42ef35,_0x2691c1,_0x2896ec){var _0x3c382f='';if(!_[_0xa38f('0x3')](_0x2691c1)&&_0xa38f('0x4')===typeof _0x2691c1){_0x3c382f+=_0x2691c1;}if(!_[_0xa38f('0x3')](_0x2896ec)&&_0xa38f('0x4')===typeof _0x2896ec){_0x3c382f+='\x20'+_0x2896ec;}if(_0x3c382f!==''){return _0x3c382f;}return _0x42ef35;}function Action(_0x2224ab,_0x51eebb,_0x4f6989){this[_0xa38f('0x5')]=_0x2224ab;this[_0xa38f('0x6')]=_0x4f6989||undefined;this[_0xa38f('0x7')]=checkNameSurname(_0x51eebb[_0xa38f('0x8')][_0xa38f('0x9')],_0x51eebb[_0xa38f('0x8')][_0xa38f('0xa')],_0x51eebb[_0xa38f('0x8')][_0xa38f('0xb')]);this[_0xa38f('0xc')]=_0x51eebb[_0xa38f('0x8')][_0xa38f('0x9')];this[_0xa38f('0xd')]=_0x2224ab[_0xa38f('0x7')];this[_0xa38f('0xe')]=_0x51eebb['active']||![];this['type']=_0x2224ab[_0xa38f('0xf')];this[_0xa38f('0x10')]=_0x2224ab[_0xa38f('0x10')]||0x3;this[_0xa38f('0x11')]=_0x51eebb[_0xa38f('0x11')];this[_0xa38f('0x12')]=_0x51eebb[_0xa38f('0x12')];this[_0xa38f('0x13')]=_0x51eebb['countcongestionretry'];this[_0xa38f('0x14')]=_0x51eebb[_0xa38f('0x14')];this[_0xa38f('0x15')]=_0x51eebb['countnosuchnumberretry'];this[_0xa38f('0x16')]=_0x51eebb[_0xa38f('0x16')];this[_0xa38f('0x17')]=_0x51eebb[_0xa38f('0x17')];this['countmachineretry']=_0x51eebb[_0xa38f('0x18')];this['countagentrejectretry']=_0x51eebb[_0xa38f('0x19')];this[_0xa38f('0x1a')]=_0x51eebb['ContactId'];this['ListId']=_0x51eebb[_0xa38f('0x1b')];this[_0xa38f('0x1c')]=_0x51eebb['UserId'];this[_0xa38f('0x1d')]=_0x51eebb['VoiceQueueId'];this[_0xa38f('0x1e')]=_0x51eebb[_0xa38f('0x1e')];this[_0xa38f('0x1f')]=_0x51eebb['id'];this[_0xa38f('0x20')]=_0x51eebb['Contact'][_0xa38f('0xa')]||'';this[_0xa38f('0x21')]=moment()['format'](_0xa38f('0x22'));this[_0xa38f('0x23')]=_0x51eebb[_0xa38f('0x23')];this[_0xa38f('0x24')]=_0x51eebb[_0xa38f('0x24')];this['callbackat']=_0x51eebb[_0xa38f('0x25')];this[_0xa38f('0x26')]=_0x51eebb['recallme'];this[_0xa38f('0x27')]='';this[_0xa38f('0x28')]='';}Action[_0xa38f('0x29')][_0xa38f('0x2a')]=function(){return util[_0xa38f('0x2b')](_0xa38f('0x2c'),this[_0xa38f('0x7')],this[_0xa38f('0x5')][_0xa38f('0x2d')]>0x0?this[_0xa38f('0xc')][_0xa38f('0x2e')](this['voiceQueue'][_0xa38f('0x2d')]):this[_0xa38f('0xc')]);};Action['prototype']['getQueue']=function(){return this[_0xa38f('0xd')];};module['exports']=Action;
\ No newline at end of file
+var _0x7975=['number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','dialCutDigit','substring','getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x7975,0x15e));var _0x5797=function(_0x7eac2f,_0x498b62){_0x7eac2f=_0x7eac2f-0x0;var _0x14d14e=_0x7975[_0x7eac2f];return _0x14d14e;};'use strict';var util=require('util');var _=require(_0x5797('0x0'));var moment=require(_0x5797('0x1'));function checkNameSurname(_0x232146,_0x3a3981,_0x5f2103){var _0x2c2be7='';if(!_[_0x5797('0x2')](_0x3a3981)&&_0x5797('0x3')===typeof _0x3a3981){_0x2c2be7+=_0x3a3981;}if(!_['isNil'](_0x5f2103)&&_0x5797('0x3')===typeof _0x5f2103){_0x2c2be7+='\x20'+_0x5f2103;}if(_0x2c2be7!==''){return _0x2c2be7;}return _0x232146;}function Action(_0x408e8e,_0x5a5d10,_0x114261){this[_0x5797('0x4')]=_0x408e8e;this[_0x5797('0x5')]=_0x114261||undefined;this[_0x5797('0x6')]=checkNameSurname(_0x5a5d10[_0x5797('0x7')][_0x5797('0x8')],_0x5a5d10[_0x5797('0x7')][_0x5797('0x9')],_0x5a5d10[_0x5797('0x7')]['lastName']);this[_0x5797('0xa')]=_0x5a5d10['Contact'][_0x5797('0x8')];this[_0x5797('0xb')]=_0x408e8e['name'];this[_0x5797('0xc')]=_0x5a5d10['active']||![];this[_0x5797('0xd')]=_0x408e8e[_0x5797('0xd')];this['dialQueueTimeout']=_0x408e8e[_0x5797('0xe')]||0x3;this['scheduledat']=_0x5a5d10[_0x5797('0xf')];this['countbusyretry']=_0x5a5d10[_0x5797('0x10')];this[_0x5797('0x11')]=_0x5a5d10[_0x5797('0x11')];this['countnoanswerretry']=_0x5a5d10['countnoanswerretry'];this[_0x5797('0x12')]=_0x5a5d10[_0x5797('0x12')];this['countdropretry']=_0x5a5d10[_0x5797('0x13')];this[_0x5797('0x14')]=_0x5a5d10[_0x5797('0x14')];this[_0x5797('0x15')]=_0x5a5d10['countmachineretry'];this['countagentrejectretry']=_0x5a5d10[_0x5797('0x16')];this[_0x5797('0x17')]=_0x5a5d10[_0x5797('0x17')];this[_0x5797('0x18')]=_0x5a5d10['ListId'];this[_0x5797('0x19')]=_0x5a5d10[_0x5797('0x19')];this[_0x5797('0x1a')]=_0x5a5d10['VoiceQueueId'];this[_0x5797('0x1b')]=_0x5a5d10[_0x5797('0x1b')];this[_0x5797('0x1c')]=_0x5a5d10['id'];this[_0x5797('0x1d')]=_0x5a5d10[_0x5797('0x7')][_0x5797('0x9')]||'';this[_0x5797('0x1e')]=moment()[_0x5797('0x1f')](_0x5797('0x20'));this[_0x5797('0x21')]=_0x5a5d10[_0x5797('0x21')];this[_0x5797('0x22')]=_0x5a5d10[_0x5797('0x22')];this[_0x5797('0x23')]=_0x5a5d10[_0x5797('0x23')];this[_0x5797('0x24')]=_0x5a5d10[_0x5797('0x24')];this[_0x5797('0x25')]='';this[_0x5797('0x26')]='';}Action[_0x5797('0x27')][_0x5797('0x28')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['name'],this[_0x5797('0x4')][_0x5797('0x29')]>0x0?this[_0x5797('0xa')][_0x5797('0x2a')](this['voiceQueue'][_0x5797('0x29')]):this[_0x5797('0xa')]);};Action['prototype'][_0x5797('0x2b')]=function(){return this[_0x5797('0xb')];};module[_0x5797('0x2c')]=Action;
\ No newline at end of file
index d595e67..7463adc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f6f=['ringtime','holdtime','talktime','endtime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x505b1,_0x3f2a5d){var _0x6f5380=function(_0x439bda){while(--_0x439bda){_0x505b1['push'](_0x505b1['shift']());}};_0x6f5380(++_0x3f2a5d);}(_0x7f6f,0x6c));var _0xf7f6=function(_0xd2133e,_0x3f060a){_0xd2133e=_0xd2133e-0x0;var _0xb62051=_0x7f6f[_0xd2133e];return _0xb62051;};'use strict';var util=require(_0xf7f6('0x0'));var _=require(_0xf7f6('0x1'));var moment=require(_0xf7f6('0x2'));function getSeconds(_0x1adb07,_0x386064){var _0x2e271d=moment(_0x1adb07)['milliseconds'](0x0);var _0x561993=moment(_0x386064)[_0xf7f6('0x3')](0x0);return _0x2e271d[_0xf7f6('0x4')](_0x561993,_0xf7f6('0x5'));}function AgentComplete(_0x2fb67a,_0x46075f){this[_0xf7f6('0x6')]=0x4;this[_0xf7f6('0x7')]=_0xf7f6('0x8');this[_0xf7f6('0x9')]=_0x2fb67a[_0xf7f6('0x9')];this[_0xf7f6('0xa')]=_0x2fb67a['type'];this[_0xf7f6('0xb')]=_0x2fb67a['type']===_0xf7f6('0xc')?_0xf7f6('0xd'):_0x2fb67a['type'];this[_0xf7f6('0xe')]=_0x2fb67a[_0xf7f6('0xe')];this[_0xf7f6('0xf')]=_0x2fb67a[_0xf7f6('0xf')];this[_0xf7f6('0x10')]=_0x2fb67a[_0xf7f6('0x10')];this[_0xf7f6('0x11')]=_0x2fb67a['countbusyretry']+_0x2fb67a[_0xf7f6('0xf')]+_0x2fb67a[_0xf7f6('0x10')]+_0x2fb67a[_0xf7f6('0x12')]+_0x2fb67a[_0xf7f6('0x13')]+_0x2fb67a[_0xf7f6('0x14')]+_0x2fb67a[_0xf7f6('0x15')]+_0x2fb67a[_0xf7f6('0x16')];this['countnosuchnumberretry']=_0x2fb67a[_0xf7f6('0x12')];this[_0xf7f6('0x13')]=_0x2fb67a['countdropretry'];this[_0xf7f6('0x14')]=_0x2fb67a[_0xf7f6('0x14')];this[_0xf7f6('0x15')]=_0x2fb67a[_0xf7f6('0x15')];this['countagentrejectretry']=_0x2fb67a[_0xf7f6('0x16')];this['uniqueid']=_0x46075f['uniqueid'];this['calleridname']=_0x2fb67a[_0xf7f6('0x17')];this[_0xf7f6('0x18')]=_0x2fb67a[_0xf7f6('0x19')];this[_0xf7f6('0x1a')]=_0x2fb67a[_0xf7f6('0x1a')];this[_0xf7f6('0x1b')]=_0x2fb67a[_0xf7f6('0x1b')];this[_0xf7f6('0x1c')]=_0x2fb67a[_0xf7f6('0x1c')];this['endtime']=moment()['format'](_0xf7f6('0x1d'));this[_0xf7f6('0x1e')]=getSeconds(_0x2fb67a[_0xf7f6('0x1b')],_0x2fb67a['starttime']);this[_0xf7f6('0x1f')]=getSeconds(_0x2fb67a['answertime'],_0x2fb67a[_0xf7f6('0x1b')]);this[_0xf7f6('0x20')]=getSeconds(this[_0xf7f6('0x21')],_0x2fb67a[_0xf7f6('0x1c')]);this[_0xf7f6('0xd')]=_0x46075f[_0xf7f6('0xd')];this['membername']=_0x46075f['membername'];this[_0xf7f6('0x22')]=_0x46075f[_0xf7f6('0x22')];this[_0xf7f6('0x23')]=_0x2fb67a['callback'];this[_0xf7f6('0x24')]=_0x2fb67a['callbackuniqueid'];this[_0xf7f6('0x25')]=_0x2fb67a[_0xf7f6('0x25')];this[_0xf7f6('0x26')]=_0x2fb67a[_0xf7f6('0x26')];this[_0xf7f6('0x27')]=_0x2fb67a[_0xf7f6('0x27')];this[_0xf7f6('0x28')]=_0x2fb67a['ListId'];this[_0xf7f6('0x29')]=_0x2fb67a['UserId'];this['VoiceQueueId']=_0x2fb67a[_0xf7f6('0x2a')];this[_0xf7f6('0x2b')]=_0x2fb67a['CampaignId'];this['originatecalleridnum']=_0x2fb67a[_0xf7f6('0x2c')]||'';this[_0xf7f6('0x2d')]=_0x2fb67a[_0xf7f6('0x2d')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
+var _0xc02c=['countdropretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry'];(function(_0x5ccfbb,_0xeb456){var _0x5b4fd9=function(_0xb9ee89){while(--_0xb9ee89){_0x5ccfbb['push'](_0x5ccfbb['shift']());}};_0x5b4fd9(++_0xeb456);}(_0xc02c,0x16b));var _0xcc02=function(_0x4c84c9,_0x4d200e){_0x4c84c9=_0x4c84c9-0x0;var _0x3707fd=_0xc02c[_0x4c84c9];return _0x3707fd;};'use strict';var util=require(_0xcc02('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x3f5bf5,_0x5ba8f8){var _0x3bafc0=moment(_0x3f5bf5)[_0xcc02('0x1')](0x0);var _0x349096=moment(_0x5ba8f8)[_0xcc02('0x1')](0x0);return _0x3bafc0[_0xcc02('0x2')](_0x349096,'seconds');}function AgentComplete(_0x19b171,_0x19d02b){this['state']=0x4;this[_0xcc02('0x3')]=_0xcc02('0x4');this[_0xcc02('0x5')]=_0x19b171[_0xcc02('0x5')];this[_0xcc02('0x6')]=_0x19b171['type'];this[_0xcc02('0x7')]=_0x19b171[_0xcc02('0x6')]==='outbound'?_0xcc02('0x8'):_0x19b171[_0xcc02('0x6')];this[_0xcc02('0x9')]=_0x19b171[_0xcc02('0x9')];this['countcongestionretry']=_0x19b171[_0xcc02('0xa')];this[_0xcc02('0xb')]=_0x19b171[_0xcc02('0xb')];this[_0xcc02('0xc')]=_0x19b171[_0xcc02('0x9')]+_0x19b171[_0xcc02('0xa')]+_0x19b171[_0xcc02('0xb')]+_0x19b171[_0xcc02('0xd')]+_0x19b171['countdropretry']+_0x19b171['countabandonedretry']+_0x19b171[_0xcc02('0xe')]+_0x19b171['countagentrejectretry'];this[_0xcc02('0xd')]=_0x19b171[_0xcc02('0xd')];this[_0xcc02('0xf')]=_0x19b171[_0xcc02('0xf')];this['countabandonedretry']=_0x19b171['countabandonedretry'];this[_0xcc02('0xe')]=_0x19b171[_0xcc02('0xe')];this[_0xcc02('0x10')]=_0x19b171[_0xcc02('0x10')];this[_0xcc02('0x11')]=_0x19d02b[_0xcc02('0x11')];this['calleridname']=_0x19b171[_0xcc02('0x12')];this[_0xcc02('0x13')]=_0x19b171[_0xcc02('0x14')];this[_0xcc02('0x15')]=_0x19b171[_0xcc02('0x15')];this[_0xcc02('0x16')]=_0x19b171[_0xcc02('0x16')];this[_0xcc02('0x17')]=_0x19b171[_0xcc02('0x17')];this[_0xcc02('0x18')]=moment()[_0xcc02('0x19')](_0xcc02('0x1a'));this['ringtime']=getSeconds(_0x19b171[_0xcc02('0x16')],_0x19b171[_0xcc02('0x15')]);this[_0xcc02('0x1b')]=getSeconds(_0x19b171['answertime'],_0x19b171[_0xcc02('0x16')]);this[_0xcc02('0x1c')]=getSeconds(this['endtime'],_0x19b171[_0xcc02('0x17')]);this['queue']=_0x19d02b['queue'];this[_0xcc02('0x1d')]=_0x19d02b['membername'];this[_0xcc02('0x1e')]=_0x19d02b[_0xcc02('0x1e')];this[_0xcc02('0x1f')]=_0x19b171[_0xcc02('0x1f')];this['callbackuniqueid']=_0x19b171[_0xcc02('0x20')];this[_0xcc02('0x21')]=_0x19b171[_0xcc02('0x21')];this['recallme']=_0x19b171['recallme'];this['ContactId']=_0x19b171[_0xcc02('0x22')];this[_0xcc02('0x23')]=_0x19b171[_0xcc02('0x23')];this[_0xcc02('0x24')]=_0x19b171[_0xcc02('0x24')];this[_0xcc02('0x25')]=_0x19b171[_0xcc02('0x25')];this[_0xcc02('0x26')]=_0x19b171[_0xcc02('0x26')];this[_0xcc02('0x27')]=_0x19b171[_0xcc02('0x27')]||'';this[_0xcc02('0x28')]=_0x19b171[_0xcc02('0x28')]||'';}module[_0xcc02('0x29')]=AgentComplete;
\ No newline at end of file
index da8cd0a..7a427ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56e6=['diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','calleridname','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x56e6,0x6b));var _0x656e=function(_0x4ebdf3,_0x3ae1ef){_0x4ebdf3=_0x4ebdf3-0x0;var _0xea5a86=_0x56e6[_0x4ebdf3];return _0xea5a86;};'use strict';var util=require(_0x656e('0x0'));var _=require(_0x656e('0x1'));var moment=require(_0x656e('0x2'));function getSeconds(_0x75e34c,_0x3a7a6a){var _0x3833eb=moment(_0x75e34c)['milliseconds'](0x0);var _0x40a874=moment(_0x3a7a6a)[_0x656e('0x3')](0x0);return _0x3833eb[_0x656e('0x4')](_0x40a874,_0x656e('0x5'));}function Final(_0x123fd4){this[_0x656e('0x6')]=_0x123fd4[_0x656e('0x6')];this['scheduledat']=_0x123fd4[_0x656e('0x7')];this[_0x656e('0x8')]=_0x123fd4[_0x656e('0x8')];this[_0x656e('0x9')]=_0x123fd4[_0x656e('0x8')]===_0x656e('0xa')?_0x656e('0xb'):_0x123fd4[_0x656e('0x8')];this[_0x656e('0xc')]=_0x123fd4[_0x656e('0xc')];this[_0x656e('0xd')]=_0x123fd4[_0x656e('0xd')];this[_0x656e('0xe')]=_0x123fd4[_0x656e('0xe')];this['countglobal']=_0x123fd4['countbusyretry']+_0x123fd4[_0x656e('0xd')]+_0x123fd4[_0x656e('0xe')]+_0x123fd4[_0x656e('0xf')]+_0x123fd4[_0x656e('0x10')]+_0x123fd4['countabandonedretry']+_0x123fd4['countmachineretry']+_0x123fd4[_0x656e('0x11')];this[_0x656e('0xf')]=_0x123fd4['countnosuchnumberretry'];this[_0x656e('0x10')]=_0x123fd4['countdropretry'];this[_0x656e('0x12')]=_0x123fd4[_0x656e('0x12')];this[_0x656e('0x13')]=_0x123fd4[_0x656e('0x13')];this['countagentrejectretry']=_0x123fd4[_0x656e('0x11')];this[_0x656e('0xb')]=_0x123fd4[_0x656e('0xb')];this[_0x656e('0x14')]=_0x123fd4[_0x656e('0x14')];this['calleridnum']=_0x123fd4['calleridnum'];this['starttime']=_0x123fd4[_0x656e('0x15')];this[_0x656e('0x16')]=_0x123fd4['responsetime'];this[_0x656e('0x17')]=_0x123fd4['responsetime'];this['ringtime']=_0x123fd4['ringtime']||0x0;this[_0x656e('0x18')]=_0x123fd4[_0x656e('0x18')]||0x0;this[_0x656e('0x19')]=_0x123fd4[_0x656e('0x19')]||0x0;this['callback']=_0x123fd4[_0x656e('0x1a')];this[_0x656e('0x1b')]=_0x123fd4[_0x656e('0x1b')];this['callbackat']=_0x123fd4[_0x656e('0x1c')];this[_0x656e('0x1d')]=_0x123fd4[_0x656e('0x1d')];this[_0x656e('0x1e')]=_0x123fd4[_0x656e('0x1e')];this[_0x656e('0x1f')]=_0x123fd4[_0x656e('0x1f')];this['UserId']=_0x123fd4[_0x656e('0x20')];this[_0x656e('0x21')]=_0x123fd4['VoiceQueueId'];this['CampaignId']=_0x123fd4[_0x656e('0x22')];this['originatecalleridnum']=_0x123fd4[_0x656e('0x23')]||'';this['originatecalleridname']=_0x123fd4['originatecalleridname']||'';}module[_0x656e('0x24')]=Final;
\ No newline at end of file
+var _0x950a=['type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat'];(function(_0x4f21cd,_0x30f06f){var _0x1af331=function(_0x51145e){while(--_0x51145e){_0x4f21cd['push'](_0x4f21cd['shift']());}};_0x1af331(++_0x30f06f);}(_0x950a,0x111));var _0xa950=function(_0x23d7e7,_0x471b25){_0x23d7e7=_0x23d7e7-0x0;var _0x17ef3e=_0x950a[_0x23d7e7];return _0x17ef3e;};'use strict';var util=require(_0xa950('0x0'));var _=require(_0xa950('0x1'));var moment=require(_0xa950('0x2'));function getSeconds(_0x13e6a3,_0x5569f7){var _0x305b26=moment(_0x13e6a3)[_0xa950('0x3')](0x0);var _0x4c027f=moment(_0x5569f7)[_0xa950('0x3')](0x0);return _0x305b26['diff'](_0x4c027f,_0xa950('0x4'));}function Final(_0x46f86d){this['uniqueid']=_0x46f86d[_0xa950('0x5')];this[_0xa950('0x6')]=_0x46f86d['scheduledat'];this['type']=_0x46f86d[_0xa950('0x7')];this[_0xa950('0x8')]=_0x46f86d[_0xa950('0x7')]===_0xa950('0x9')?_0xa950('0xa'):_0x46f86d[_0xa950('0x7')];this['countbusyretry']=_0x46f86d['countbusyretry'];this['countcongestionretry']=_0x46f86d[_0xa950('0xb')];this['countnoanswerretry']=_0x46f86d[_0xa950('0xc')];this[_0xa950('0xd')]=_0x46f86d[_0xa950('0xe')]+_0x46f86d['countcongestionretry']+_0x46f86d[_0xa950('0xc')]+_0x46f86d['countnosuchnumberretry']+_0x46f86d[_0xa950('0xf')]+_0x46f86d[_0xa950('0x10')]+_0x46f86d[_0xa950('0x11')]+_0x46f86d['countagentrejectretry'];this[_0xa950('0x12')]=_0x46f86d[_0xa950('0x12')];this[_0xa950('0xf')]=_0x46f86d['countdropretry'];this[_0xa950('0x10')]=_0x46f86d[_0xa950('0x10')];this[_0xa950('0x11')]=_0x46f86d['countmachineretry'];this[_0xa950('0x13')]=_0x46f86d[_0xa950('0x13')];this[_0xa950('0xa')]=_0x46f86d['queue'];this[_0xa950('0x14')]=_0x46f86d[_0xa950('0x14')];this[_0xa950('0x15')]=_0x46f86d[_0xa950('0x15')];this[_0xa950('0x16')]=_0x46f86d[_0xa950('0x16')];this[_0xa950('0x17')]=_0x46f86d[_0xa950('0x17')];this[_0xa950('0x18')]=_0x46f86d[_0xa950('0x17')];this[_0xa950('0x19')]=_0x46f86d[_0xa950('0x19')]||0x0;this[_0xa950('0x1a')]=_0x46f86d['holdtime']||0x0;this[_0xa950('0x1b')]=_0x46f86d[_0xa950('0x1b')]||0x0;this['callback']=_0x46f86d[_0xa950('0x1c')];this[_0xa950('0x1d')]=_0x46f86d['callbackuniqueid'];this[_0xa950('0x1e')]=_0x46f86d['callbackat'];this[_0xa950('0x1f')]=_0x46f86d[_0xa950('0x1f')];this[_0xa950('0x20')]=_0x46f86d[_0xa950('0x20')];this['ListId']=_0x46f86d[_0xa950('0x21')];this[_0xa950('0x22')]=_0x46f86d[_0xa950('0x22')];this[_0xa950('0x23')]=_0x46f86d[_0xa950('0x23')];this[_0xa950('0x24')]=_0x46f86d[_0xa950('0x24')];this[_0xa950('0x25')]=_0x46f86d[_0xa950('0x25')]||'';this[_0xa950('0x26')]=_0x46f86d[_0xa950('0x26')]||'';}module[_0xa950('0x27')]=Final;
\ No newline at end of file
index 9318ad0..70d6b21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe34e=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','outbound','queue'];(function(_0x26d26f,_0x302cce){var _0x5c8c0e=function(_0x519b9d){while(--_0x519b9d){_0x26d26f['push'](_0x26d26f['shift']());}};_0x5c8c0e(++_0x302cce);}(_0xe34e,0x1ad));var _0xee34=function(_0x43f5a8,_0x45a117){_0x43f5a8=_0x43f5a8-0x0;var _0x14e841=_0xe34e[_0x43f5a8];return _0x14e841;};'use strict';var util=require(_0xee34('0x0'));var _=require(_0xee34('0x1'));var moment=require(_0xee34('0x2'));function getSeconds(_0x6769b,_0x49aba8){var _0x302fa4=moment(_0x6769b)[_0xee34('0x3')](0x0);var _0x389a51=moment(_0x49aba8)[_0xee34('0x3')](0x0);return _0x302fa4['diff'](_0x389a51,_0xee34('0x4'));}function Hangup(_0x53fc6f,_0x25a79e){this[_0xee34('0x5')]=0x4;this[_0xee34('0x6')]='Answer';this[_0xee34('0x7')]=_0x53fc6f[_0xee34('0x7')];this[_0xee34('0x8')]=_0x53fc6f[_0xee34('0x8')];this['campaigntype']=_0x53fc6f[_0xee34('0x8')]===_0xee34('0x9')?_0xee34('0xa'):_0x53fc6f['type'];this[_0xee34('0xb')]=_0x53fc6f['countbusyretry'];this[_0xee34('0xc')]=_0x53fc6f[_0xee34('0xc')];this[_0xee34('0xd')]=_0x53fc6f[_0xee34('0xd')];this[_0xee34('0xe')]=_0x53fc6f['countbusyretry']+_0x53fc6f[_0xee34('0xc')]+_0x53fc6f['countnoanswerretry']+_0x53fc6f[_0xee34('0xf')]+_0x53fc6f[_0xee34('0x10')]+_0x53fc6f[_0xee34('0x11')]+_0x53fc6f[_0xee34('0x12')]+_0x53fc6f[_0xee34('0x13')];this[_0xee34('0xf')]=_0x53fc6f[_0xee34('0xf')];this[_0xee34('0x10')]=_0x53fc6f[_0xee34('0x10')];this[_0xee34('0x11')]=_0x53fc6f[_0xee34('0x11')];this[_0xee34('0x12')]=_0x53fc6f[_0xee34('0x12')];this[_0xee34('0x13')]=_0x53fc6f[_0xee34('0x13')];this[_0xee34('0x14')]=_0x25a79e['uniqueid'];this[_0xee34('0x15')]=_0x53fc6f[_0xee34('0x16')];this[_0xee34('0x17')]=_0x53fc6f['number'];this['starttime']=_0x53fc6f[_0xee34('0x18')];this[_0xee34('0x19')]=_0x53fc6f[_0xee34('0x19')];this[_0xee34('0x1a')]=moment()[_0xee34('0x1b')](_0xee34('0x1c'));this[_0xee34('0x1d')]=getSeconds(_0x53fc6f[_0xee34('0x19')],_0x53fc6f['starttime']);this[_0xee34('0x1e')]=0x0;this['talktime']=getSeconds(this[_0xee34('0x1a')],_0x53fc6f[_0xee34('0x19')]);this[_0xee34('0xa')]=_0x53fc6f[_0xee34('0xa')];this[_0xee34('0x1f')]=_0xee34('0x20');this['reason']=_0x25a79e[_0xee34('0x21')];this[_0xee34('0x22')]=_0x53fc6f[_0xee34('0x22')];this[_0xee34('0x23')]=_0x53fc6f[_0xee34('0x23')];this[_0xee34('0x24')]=_0x53fc6f[_0xee34('0x24')];this['recallme']=_0x53fc6f[_0xee34('0x25')];this[_0xee34('0x26')]=_0x53fc6f[_0xee34('0x26')];this[_0xee34('0x27')]=_0x53fc6f[_0xee34('0x27')];this[_0xee34('0x28')]=_0x53fc6f[_0xee34('0x28')];this[_0xee34('0x29')]=_0x53fc6f[_0xee34('0x29')];this[_0xee34('0x2a')]=_0x53fc6f['CampaignId'];}module[_0xee34('0x2b')]=Hangup;
\ No newline at end of file
+var _0x80e4=['name','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','endtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x80e4,0x13a));var _0x480e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x80e4[_0xefd519];return _0x4bb882;};'use strict';var util=require('util');var _=require(_0x480e('0x0'));var moment=require(_0x480e('0x1'));function getSeconds(_0x4c8c4a,_0x30c428){var _0x19a74d=moment(_0x4c8c4a)[_0x480e('0x2')](0x0);var _0x5c8cbb=moment(_0x30c428)[_0x480e('0x2')](0x0);return _0x19a74d['diff'](_0x5c8cbb,_0x480e('0x3'));}function Hangup(_0x329fef,_0x33abda){this[_0x480e('0x4')]=0x4;this[_0x480e('0x5')]=_0x480e('0x6');this['scheduledat']=_0x329fef[_0x480e('0x7')];this[_0x480e('0x8')]=_0x329fef[_0x480e('0x8')];this['campaigntype']=_0x329fef[_0x480e('0x8')]===_0x480e('0x9')?_0x480e('0xa'):_0x329fef[_0x480e('0x8')];this[_0x480e('0xb')]=_0x329fef[_0x480e('0xb')];this[_0x480e('0xc')]=_0x329fef[_0x480e('0xc')];this[_0x480e('0xd')]=_0x329fef['countnoanswerretry'];this[_0x480e('0xe')]=_0x329fef['countbusyretry']+_0x329fef[_0x480e('0xc')]+_0x329fef[_0x480e('0xd')]+_0x329fef[_0x480e('0xf')]+_0x329fef['countdropretry']+_0x329fef['countabandonedretry']+_0x329fef['countmachineretry']+_0x329fef[_0x480e('0x10')];this['countnosuchnumberretry']=_0x329fef[_0x480e('0xf')];this[_0x480e('0x11')]=_0x329fef[_0x480e('0x11')];this[_0x480e('0x12')]=_0x329fef[_0x480e('0x12')];this['countmachineretry']=_0x329fef[_0x480e('0x13')];this[_0x480e('0x10')]=_0x329fef[_0x480e('0x10')];this['uniqueid']=_0x33abda[_0x480e('0x14')];this[_0x480e('0x15')]=_0x329fef[_0x480e('0x16')];this['calleridnum']=_0x329fef['number'];this[_0x480e('0x17')]=_0x329fef[_0x480e('0x17')];this[_0x480e('0x18')]=_0x329fef['responsetime'];this['endtime']=moment()[_0x480e('0x19')](_0x480e('0x1a'));this['ringtime']=getSeconds(_0x329fef['responsetime'],_0x329fef[_0x480e('0x17')]);this[_0x480e('0x1b')]=0x0;this['talktime']=getSeconds(this[_0x480e('0x1c')],_0x329fef['responsetime']);this[_0x480e('0xa')]=_0x329fef[_0x480e('0xa')];this[_0x480e('0x1d')]=_0x480e('0x1e');this[_0x480e('0x1f')]=_0x33abda[_0x480e('0x20')];this['callback']=_0x329fef[_0x480e('0x21')];this[_0x480e('0x22')]=_0x329fef[_0x480e('0x22')];this['callbackat']=_0x329fef['callbackat'];this['recallme']=_0x329fef[_0x480e('0x23')];this[_0x480e('0x24')]=_0x329fef[_0x480e('0x24')];this['ListId']=_0x329fef[_0x480e('0x25')];this[_0x480e('0x26')]=_0x329fef[_0x480e('0x26')];this[_0x480e('0x27')]=_0x329fef['VoiceQueueId'];this[_0x480e('0x28')]=_0x329fef[_0x480e('0x28')];}module[_0x480e('0x29')]=Hangup;
\ No newline at end of file
index ea5a257..1f2a866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccd1=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','queue','calleridnum','number','starttime','responsetime','endtime','ringtime'];(function(_0x2a71d2,_0x35bcda){var _0x200112=function(_0x40735f){while(--_0x40735f){_0x2a71d2['push'](_0x2a71d2['shift']());}};_0x200112(++_0x35bcda);}(_0xccd1,0xca));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x1ccd('0x0'));var _=require(_0x1ccd('0x1'));var moment=require(_0x1ccd('0x2'));function getSeconds(_0x27c7c5,_0x5d2341){var _0x57c98d=moment(_0x27c7c5)['milliseconds'](0x0);var _0x4f6b70=moment(_0x5d2341)[_0x1ccd('0x3')](0x0);return _0x57c98d[_0x1ccd('0x4')](_0x4f6b70,_0x1ccd('0x5'));}function History(_0x59a958){this[_0x1ccd('0x6')]=_0x59a958['uniqueid'];this[_0x1ccd('0x7')]=_0x59a958['scheduledat']||undefined;this[_0x1ccd('0x8')]=_0x59a958[_0x1ccd('0x8')];this['campaigntype']=_0x59a958['type']===_0x1ccd('0x9')?'queue':_0x59a958[_0x1ccd('0x8')];this[_0x1ccd('0xa')]=_0x59a958[_0x1ccd('0xa')];this['countcongestionretry']=_0x59a958['countcongestionretry'];this[_0x1ccd('0xb')]=_0x59a958[_0x1ccd('0xb')];this[_0x1ccd('0xc')]=_0x59a958[_0x1ccd('0xa')]+_0x59a958[_0x1ccd('0xd')]+_0x59a958[_0x1ccd('0xb')]+_0x59a958['countnosuchnumberretry']+_0x59a958[_0x1ccd('0xe')]+_0x59a958['countabandonedretry']+_0x59a958[_0x1ccd('0xf')]+_0x59a958[_0x1ccd('0x10')];this[_0x1ccd('0x11')]=_0x59a958[_0x1ccd('0x11')];this['countdropretry']=_0x59a958[_0x1ccd('0xe')];this['countabandonedretry']=_0x59a958[_0x1ccd('0x12')];this[_0x1ccd('0xf')]=_0x59a958[_0x1ccd('0xf')];this['countagentrejectretry']=_0x59a958[_0x1ccd('0x10')];this[_0x1ccd('0x13')]=_0x59a958[_0x1ccd('0x13')];this['calleridname']=_0x59a958['name'];this[_0x1ccd('0x14')]=_0x59a958[_0x1ccd('0x15')];this['starttime']=_0x59a958[_0x1ccd('0x16')];this['responsetime']=_0x59a958[_0x1ccd('0x17')];this[_0x1ccd('0x18')]=_0x59a958[_0x1ccd('0x17')];this[_0x1ccd('0x19')]=getSeconds(_0x59a958['responsetime'],_0x59a958[_0x1ccd('0x16')]);this[_0x1ccd('0x1a')]=0x0;this[_0x1ccd('0x1b')]=0x0;this[_0x1ccd('0x1c')]=_0x59a958[_0x1ccd('0x1c')];this[_0x1ccd('0x1d')]=_0x59a958[_0x1ccd('0x1d')];this[_0x1ccd('0x1e')]=_0x59a958[_0x1ccd('0x1e')];this[_0x1ccd('0x1f')]=_0x59a958[_0x1ccd('0x1f')];this[_0x1ccd('0x20')]=_0x59a958[_0x1ccd('0x20')];this[_0x1ccd('0x21')]=_0x59a958[_0x1ccd('0x21')];this[_0x1ccd('0x22')]=_0x59a958[_0x1ccd('0x22')];this[_0x1ccd('0x23')]=_0x59a958[_0x1ccd('0x23')];this['CampaignId']=_0x59a958[_0x1ccd('0x24')];this['originatecalleridnum']=_0x59a958['originatecalleridnum']||'';this[_0x1ccd('0x25')]=_0x59a958['originatecalleridname']||'';}module['exports']=History;
\ No newline at end of file
+var _0x716b=['countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','starttime','responsetime','endtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','queue','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x2e3986,_0x1715dd){var _0x2161c4=function(_0x4be1cb){while(--_0x4be1cb){_0x2e3986['push'](_0x2e3986['shift']());}};_0x2161c4(++_0x1715dd);}(_0x716b,0x1f2));var _0xb716=function(_0x54336b,_0x299d97){_0x54336b=_0x54336b-0x0;var _0xcd0bc5=_0x716b[_0x54336b];return _0xcd0bc5;};'use strict';var util=require(_0xb716('0x0'));var _=require('lodash');var moment=require(_0xb716('0x1'));function getSeconds(_0x3b401a,_0xd48c45){var _0x2b18fe=moment(_0x3b401a)[_0xb716('0x2')](0x0);var _0x3a210b=moment(_0xd48c45)['milliseconds'](0x0);return _0x2b18fe[_0xb716('0x3')](_0x3a210b,_0xb716('0x4'));}function History(_0x4ab194){this[_0xb716('0x5')]=_0x4ab194['uniqueid'];this['scheduledat']=_0x4ab194[_0xb716('0x6')]||undefined;this[_0xb716('0x7')]=_0x4ab194[_0xb716('0x7')];this['campaigntype']=_0x4ab194['type']==='outbound'?_0xb716('0x8'):_0x4ab194[_0xb716('0x7')];this['countbusyretry']=_0x4ab194['countbusyretry'];this['countcongestionretry']=_0x4ab194[_0xb716('0x9')];this[_0xb716('0xa')]=_0x4ab194[_0xb716('0xa')];this[_0xb716('0xb')]=_0x4ab194[_0xb716('0xc')]+_0x4ab194[_0xb716('0x9')]+_0x4ab194[_0xb716('0xa')]+_0x4ab194[_0xb716('0xd')]+_0x4ab194[_0xb716('0xe')]+_0x4ab194[_0xb716('0xf')]+_0x4ab194[_0xb716('0x10')]+_0x4ab194[_0xb716('0x11')];this['countnosuchnumberretry']=_0x4ab194['countnosuchnumberretry'];this['countdropretry']=_0x4ab194[_0xb716('0xe')];this[_0xb716('0xf')]=_0x4ab194[_0xb716('0xf')];this[_0xb716('0x10')]=_0x4ab194[_0xb716('0x10')];this[_0xb716('0x11')]=_0x4ab194[_0xb716('0x11')];this['queue']=_0x4ab194['queue'];this['calleridname']=_0x4ab194[_0xb716('0x12')];this[_0xb716('0x13')]=_0x4ab194['number'];this[_0xb716('0x14')]=_0x4ab194[_0xb716('0x14')];this['responsetime']=_0x4ab194[_0xb716('0x15')];this[_0xb716('0x16')]=_0x4ab194['responsetime'];this['ringtime']=getSeconds(_0x4ab194['responsetime'],_0x4ab194['starttime']);this[_0xb716('0x17')]=0x0;this['talktime']=0x0;this[_0xb716('0x18')]=_0x4ab194[_0xb716('0x18')];this[_0xb716('0x19')]=_0x4ab194[_0xb716('0x19')];this[_0xb716('0x1a')]=_0x4ab194['callbackat'];this['recallme']=_0x4ab194[_0xb716('0x1b')];this[_0xb716('0x1c')]=_0x4ab194['ContactId'];this['ListId']=_0x4ab194[_0xb716('0x1d')];this[_0xb716('0x1e')]=_0x4ab194[_0xb716('0x1e')];this[_0xb716('0x1f')]=_0x4ab194[_0xb716('0x1f')];this[_0xb716('0x20')]=_0x4ab194[_0xb716('0x20')];this[_0xb716('0x21')]=_0x4ab194[_0xb716('0x21')]||'';this['originatecalleridname']=_0x4ab194['originatecalleridname']||'';}module['exports']=History;
\ No newline at end of file
index 48c5a97..263925f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc1a=['prototype','sequence','enqueue','isNil','Action','status','channel','No\x20such\x20channel','type','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','catch','[rescheduleContact]\x20','unlockContact','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','updateOriginated','notFound','pick','UserId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','saveInDb','uniqueid','variable','exten','dialAMDActive','value','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','rescheduleContact','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','VoiceQueueId','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countagentrejectretry','stateGlobal','ContactId','CampaignId','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AGI','dialQueueProject','Unknow','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridname','[syncAgentComplete][createHistory][11]','syncNewExten','syncQueueMember','actionid','locked','stateinterface','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','run','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','resetActiveCalls','syncCampaigns','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','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','handlePower','dialPowerLevel','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialActive','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','dialPreviewRecallmeReminder','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','responsetime','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','reason\x2011\x20abandoned','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','[CatchErlangB]','outboundQueuePauses','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','getContactDialer','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','interval\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../preview/util/util','../../../config/logger','booked','predictive','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','milliseconds','diff','emit','outbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','waiting','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','[uniqueid]','clearZombieChannels','[actions]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc1a,0x170));var _0xabc1=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xbc1a[_0xc4001c];return _0x49f7bc;};'use strict';var util=require(_0xabc1('0x0'));var _=require(_0xabc1('0x1'));var BPromise=require(_0xabc1('0x2'));var uuid=require('uuid');var moment=require(_0xabc1('0x3'));var rr=require('rr');var md5=require(_0xabc1('0x4'));var Redis=require(_0xabc1('0x5'));var ut=require(_0xabc1('0x6'));var config=require('../../../config/environment/');var logger=require(_0xabc1('0x7'))('dialer');var loggerBooked=require(_0xabc1('0x7'))(_0xabc1('0x8'));var loggerPredictive=require(_0xabc1('0x7'))(_0xabc1('0x9'));var loggerPredictiveCalls=require(_0xabc1('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xabc1('0x7'))(_0xabc1('0xa'));var ami=require('../ami');config[_0xabc1('0xb')]=_[_0xabc1('0xc')](config[_0xabc1('0xb')],{'host':_0xabc1('0xd'),'port':0x18eb});var io=require(_0xabc1('0xe'))(new Redis(config['redis']));var cmHopper=require(_0xabc1('0xf'));var cmHopperHistory=require(_0xabc1('0x10'));var cmHopperBlack=require(_0xabc1('0x11'));var voiceQueueRt=require(_0xabc1('0x12'));var RpcSetting=require('../rpc/setting');var Action=require(_0xabc1('0x13'));var History=require(_0xabc1('0x14'));var Final=require(_0xabc1('0x15'));var AgentComplete=require(_0xabc1('0x16'));var QueueCallerAbandon=require(_0xabc1('0x17'));var Hangup=require(_0xabc1('0x18'));var ipAgi=process[_0xabc1('0x19')][_0xabc1('0x1a')]||_0xabc1('0x1b');var strategy={'rrmemory':_0xabc1('0x1c'),'roundrobin':_0xabc1('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x784482){this[_0xabc1('0x1e')]=this[_0xabc1('0x1e')]?this[_0xabc1('0x1e')][_0xabc1('0x1f')](_0x784482):_0x784482();};function Dialer(_0x235912,_0x173d58){this['sequence']=new Sequence();this[_0xabc1('0x20')]=_0x173d58;this['voiceQueues']=_0x235912[_0xabc1('0x21')];this['campaigns']=_0x235912[_0xabc1('0x22')];this[_0xabc1('0x23')]=_0x235912[_0xabc1('0x23')];this[_0xabc1('0x24')]=_0x235912[_0xabc1('0x24')];this['maxNumberOriginate']=config[_0xabc1('0x25')]||0x2;this[_0xabc1('0x26')]={};this[_0xabc1('0x27')]={};this['contactsId']={};this[_0xabc1('0x28')]={};this[_0xabc1('0x29')]={};this[_0xabc1('0x2a')]={};this['startProgressive']={};this[_0xabc1('0x2b')]={};this[_0xabc1('0x2c')]={};this[_0xabc1('0x2d')]={};ami['on'](_0xabc1('0x2e'),this['syncAgentConnect']['bind'](this));ami['on'](_0xabc1('0x2f'),this[_0xabc1('0x30')][_0xabc1('0x31')](this));ami['on'](_0xabc1('0x32'),this[_0xabc1('0x33')][_0xabc1('0x31')](this));ami['on'](_0xabc1('0x34'),this[_0xabc1('0x35')]['bind'](this));ami['on'](_0xabc1('0x36'),this['syncQueueSummary']['bind'](this));ami['on'](_0xabc1('0x37'),this[_0xabc1('0x38')]['bind'](this));ami['on'](_0xabc1('0x39'),this['syncNewExten']['bind'](this));ami['on']('varset',this[_0xabc1('0x3a')][_0xabc1('0x31')](this));ami['on'](_0xabc1('0x3b'),this['syncQueueMember'][_0xabc1('0x31')](this));ami['on'](_0xabc1('0x3c'),this[_0xabc1('0x3d')][_0xabc1('0x31')](this));this[_0xabc1('0x3e')]();this[_0xabc1('0x3f')]();RpcSetting['getSettings']()[_0xabc1('0x40')](function(_0x291dba){previewRecallmeReminderInterval=_0x291dba['previewRecallmeReminderInterval'];});}function isNotNull(_0x32262d){return _0x32262d!==null&&!_['isUndefined'](_0x32262d);}function checkIsLoggedIn(_0x2e2a3b,_0xd932f2){return function(){if(_0xd932f2<=0x0){_0x2e2a3b[_0xabc1('0x41')]=_0xabc1('0x42');throw _0x2e2a3b[_0xabc1('0x43')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x2d736d){return _0x2d736d;}function checkIsActive(_0x38176f,_0x56d834){return function(){if(!isActive(_0x56d834)){_0x38176f[_0xabc1('0x41')]=_0xabc1('0x44');throw _0x38176f['name']+_0xabc1('0x45');}};}function checkInterval(_0x52af45){return function(){if(!isNotNull(_0x52af45[_0xabc1('0x46')])){_0x52af45[_0xabc1('0x41')]='INTERVAL_IS_NULL';throw _0x52af45[_0xabc1('0x43')]+_0xabc1('0x47');}if(!isNotNull(_0x52af45[_0xabc1('0x46')]['Intervals'])){_0x52af45[_0xabc1('0x41')]=_0xabc1('0x48');throw _0x52af45[_0xabc1('0x43')]+_0xabc1('0x47');}if(!isNotNull(_[_0xabc1('0x49')](_0x52af45[_0xabc1('0x46')]['Intervals']))){_0x52af45[_0xabc1('0x41')]='INTERVAL_IS_NULL';throw _0x52af45[_0xabc1('0x43')]+_0xabc1('0x47');}};}function msgResponse(_0x1d7321,_0x62073a,_0x89915d){return{'action':_0x1d7321,'response':_0x62073a,'message':_0x89915d,'stack':_0x89915d};}function myreject(_0x23c1cc){return function(_0x33f904){return _0x23c1cc(msgResponse(_0xabc1('0x4a'),'Error',JSON['stringify'](_0x33f904)));};}function getSeconds(_0xe57b16,_0x1097e8){var _0x4ce375=moment(_0xe57b16)['milliseconds'](0x0);var _0x35cb65=moment(_0x1097e8)[_0xabc1('0x4b')](0x0);return _0x4ce375[_0xabc1('0x4c')](_0x35cb65,'seconds');}function emit(_0x549c24,_0x22ff9c,_0x29622d){io['to'](_0x549c24)[_0xabc1('0x4d')](_0x22ff9c,_0x29622d);}function emitVoiceQueueSummary(_0xd1fbae){if(_0xd1fbae['type']===_0xabc1('0x4e')){var _0x408f81={'id':_0xd1fbae['id'],'name':_0xd1fbae['name'],'strategy':_0xd1fbae[_0xabc1('0x4f')],'answered':_0xd1fbae[_0xabc1('0x50')],'available':_0xd1fbae[_0xabc1('0x51')],'loggedIn':_0xd1fbae[_0xabc1('0x52')],'pTalking':_0xd1fbae['pTalking'],'sumBillable':_0xd1fbae[_0xabc1('0x53')],'sumDuration':_0xd1fbae[_0xabc1('0x54')],'sumHoldTime':_0xd1fbae[_0xabc1('0x55')]||0x0,'talking':_0xd1fbae[_0xabc1('0x56')],'total':_0xd1fbae['total'],'type':_0xd1fbae['type'],'unmanaged':_0xd1fbae['unmanaged'],'abandoned':_0xd1fbae['abandoned'],'waiting':_0xd1fbae[_0xabc1('0x57')],'loggedInDb':_0xd1fbae[_0xabc1('0x58')],'dialActive':_0xd1fbae['dialActive'],'dialMethod':_0xd1fbae[_0xabc1('0x59')],'dialOriginateCallerIdName':_0xd1fbae['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xd1fbae[_0xabc1('0x5a')],'dialOriginateTimeout':_0xd1fbae[_0xabc1('0x5b')],'dialPrefix':_0xd1fbae[_0xabc1('0x5c')],'outboundAnswerAgiCallsDay':_0xd1fbae[_0xabc1('0x5d')],'outboundAnswerCallsDay':_0xd1fbae[_0xabc1('0x5e')],'outboundBlacklistCallsDay':_0xd1fbae['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0xd1fbae[_0xabc1('0x5f')],'outboundCongestionCallsDay':_0xd1fbae[_0xabc1('0x60')],'outboundDropCallsDayACS':_0xd1fbae[_0xabc1('0x61')],'outboundDropCallsDayCallersExit':_0xd1fbae[_0xabc1('0x62')],'outboundDropCallsDayTimeout':_0xd1fbae[_0xabc1('0x63')],'outboundNoAnswerCallsDay':_0xd1fbae[_0xabc1('0x64')],'outboundNoSuchCallsDay':_0xd1fbae[_0xabc1('0x65')],'outboundOriginateFailureCallsDay':_0xd1fbae[_0xabc1('0x66')],'outboundReCallsDay':_0xd1fbae[_0xabc1('0x67')],'outboundRejectCallsDay':_0xd1fbae[_0xabc1('0x68')],'outboundUnknownCallsDay':_0xd1fbae[_0xabc1('0x69')],'predictiveIntervalAnsweredCalls':_0xd1fbae['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xd1fbae[_0xabc1('0x6a')],'predictiveIntervalAvgTalktime':_0xd1fbae['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xd1fbae[_0xabc1('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0xd1fbae[_0xabc1('0x6c')],'predictiveIntervalErlangCalls':_0xd1fbae['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0xd1fbae[_0xabc1('0x6d')],'predictiveIntervalHitRate':_0xd1fbae[_0xabc1('0x6e')],'predictiveIntervalMultiplicativeFactor':_0xd1fbae[_0xabc1('0x6f')],'predictiveIntervalPauses':_0xd1fbae[_0xabc1('0x70')],'predictiveIntervalAvailable':_0xd1fbae['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0xd1fbae[_0xabc1('0x71')],'message':_0xd1fbae[_0xabc1('0x41')],'originated':_0xd1fbae[_0xabc1('0x72')],'erlangCalls':_0xd1fbae['erlangCalls'],'erlangCallToSecond':_0xd1fbae[_0xabc1('0x73')],'erlangAbandonmentRate':_0xd1fbae[_0xabc1('0x74')],'erlangBusyFactor':_0xd1fbae[_0xabc1('0x75')],'startPredictive':_0xd1fbae[_0xabc1('0x2a')],'startProgressive':_0xd1fbae[_0xabc1('0x76')]};if(_0xd1fbae[_0xabc1('0x77')]){_0x408f81[_0xabc1('0x77')]={'id':_0xd1fbae['Trunk']['id'],'name':_0xd1fbae[_0xabc1('0x77')][_0xabc1('0x43')],'active':_0xd1fbae['Trunk'][_0xabc1('0x78')],'callerid':_0xd1fbae['Trunk'][_0xabc1('0x79')]};}if(_0xd1fbae['Interval']){_0x408f81[_0xabc1('0x46')]={'id':_0xd1fbae['Interval']['id'],'name':_0xd1fbae[_0xabc1('0x46')][_0xabc1('0x43')]};}var _0x1c98c1=md5(JSON[_0xabc1('0x7a')](_0x408f81));if(_0xd1fbae[_0xabc1('0x4')]!==_0x1c98c1){_0xd1fbae[_0xabc1('0x4')]=_0x1c98c1;emit(util[_0xabc1('0x7b')](_0xabc1('0x7c'),_0x408f81['name']),_0xabc1('0x7d'),_0x408f81);}}}function emitCampaignSummary(_0x20a6b0){if(_0x20a6b0['type']===_0xabc1('0x7e')){emit(util['format'](_0xabc1('0x7f'),_0x20a6b0[_0xabc1('0x43')]),'campaign:save',_0x20a6b0);}}function checkGetDataPredictive(_0x550e85){if(isNotNull(_0x550e85)&&!_['isEmpty'](_0x550e85)){loggerPredictive['info'](_0xabc1('0x80'));loggerPredictive[_0xabc1('0x81')](_0xabc1('0x82'),_0x550e85[_0xabc1('0x71')]);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x83'),_0x550e85[_0xabc1('0x84')]);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x85'),_0x550e85['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x86'),_0x550e85[_0xabc1('0x6b')]);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x87'),_0x550e85[_0xabc1('0x6a')]);loggerPredictive[_0xabc1('0x81')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x550e85[_0xabc1('0x88')]);loggerPredictive['info'](_0xabc1('0x89'));if(_0x550e85[_0xabc1('0x71')]>0x0){if(!_[_0xabc1('0x8a')](_0x550e85[_0xabc1('0x88')])&&_0x550e85['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xabc1('0x81')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xabc1('0x8a')](_0x550e85[_0xabc1('0x6a')])&&_0x550e85[_0xabc1('0x6a')]>0x0){return!![];}loggerPredictive['info'](_0xabc1('0x8b'));}else{loggerPredictive[_0xabc1('0x81')](_0xabc1('0x8c'));}}else{loggerPredictive[_0xabc1('0x81')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x1b4000){return function(_0x347105){loggerPredictive[_0xabc1('0x81')](_0xabc1('0x8d'));loggerPredictive[_0xabc1('0x81')](_0xabc1('0x8e'),_0x347105[_0xabc1('0x8f')]);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x90'),_0x347105['erlangCallToSecond']);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x91'),_0x347105['erlangAbandonmentRate']);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x92'),_0x347105['erlangBusyFactor']);loggerPredictive[_0xabc1('0x81')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x347105['erlangAbandonmentRate']);loggerPredictive['info'](_0xabc1('0x89'));_[_0xabc1('0x93')](_0x1b4000,_0x347105);};}function getDiff(_0xd62f8b){var _0x166ddb=moment()['milliseconds'](0x0);var _0x207863=moment(_0xd62f8b)[_0xabc1('0x4b')](0x0);return _0x166ddb['diff'](_0x207863,_0xabc1('0x94'));}function ifInterval(_0x11899c,_0x45ceff){if(_[_0xabc1('0x8a')](_0x45ceff)){return![];}return getDiff(_0x45ceff)<_0x11899c*0x3c;}function freeVariablesPredictive(_0x170375){if(isNotNull(_0x170375)){if(!_[_0xabc1('0x8a')](_0x170375[_0xabc1('0x76')])){_0x170375['startProgressive']=undefined;loggerPredictive[_0xabc1('0x81')](_0x170375[_0xabc1('0x43')],_0xabc1('0x95'));}if(!_[_0xabc1('0x8a')](_0x170375['startPredictive'])){_0x170375[_0xabc1('0x2a')]=undefined;loggerPredictive[_0xabc1('0x81')](_0x170375['name'],_0xabc1('0x96'));}if(!_[_0xabc1('0x8a')](_0x170375[_0xabc1('0x97')])){clearInterval(_0x170375[_0xabc1('0x97')]);_0x170375[_0xabc1('0x97')]=undefined;loggerPredictive[_0xabc1('0x81')](_0x170375[_0xabc1('0x43')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x19c1eb,_0x421502){if(_0x421502===0x0){return 0x0;}var _0x2a4a41=0x1;for(var _0x10bdb1=0x1;_0x10bdb1<=_0x421502;_0x10bdb1+=0x1){_0x2a4a41=0x1+_0x2a4a41*_0x10bdb1/_0x19c1eb;}return 0x1/_0x2a4a41;}function isVoiceQueueOutbound(_0x371fa5){return _0x371fa5===_0xabc1('0x4e');}function isNotPreview(_0x271f69){return _0x271f69!==_0xabc1('0x20');}function isCampaignIvr(_0x1f8e60){return _0x1f8e60===_0xabc1('0x7e');}function getCallerId(_0x5608bd,_0x11d5c8,_0x49f9ed){if(!_[_0xabc1('0x8a')](_0x49f9ed)&&typeof _0x49f9ed==='string'&&!_[_0xabc1('0x49')](_0x49f9ed)){if(!_['isUndefined'](_0x11d5c8)&&typeof _0x11d5c8===_0xabc1('0x98')&&!_[_0xabc1('0x49')](_0x11d5c8)){return util['format']('\x22%s\x22\x20<%s>',_0x11d5c8,_0x49f9ed);}return util[_0xabc1('0x7b')](_0xabc1('0x99'),_0x49f9ed,_0x49f9ed);}if(!_[_0xabc1('0x8a')](_0x5608bd)&&typeof _0x5608bd===_0xabc1('0x98')&&!_[_0xabc1('0x49')](_0x5608bd)){return _0x5608bd;}return _0xabc1('0x9a');}function loggerCatchQueueSummary(_0x58e0bc,_0x3e35bc){return function(_0x391dff){freeVariablesPredictive(_0x3e35bc);emitVoiceQueueSummary(_0x3e35bc);emitCampaignSummary(_0x3e35bc);loggerSyncQueueSummary[_0xabc1('0x9b')](_0x58e0bc,util['inspect'](_0x391dff,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1c5a7a,_0x394468){return function(_0x5e7858){loggerPredictive[_0xabc1('0x9b')](_0x394468['name'],_0x1c5a7a);loggerPredictive['error'](_0x5e7858[_0xabc1('0x9c')]);freeVariablesPredictive(_0x394468);};}function loggerCatch(_0x2272fc){return function(_0x3546b8){logger[_0xabc1('0x9b')](_0x2272fc,util[_0xabc1('0x9d')](_0x3546b8,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2a09e7){return _0x2a09e7&&!_[_0xabc1('0x8a')](_0x2a09e7)&&_0x2a09e7['length']>0x0;}function decremetOriginate(_0x45dce8){if(!_[_0xabc1('0x8a')](_0x45dce8)&&_0x45dce8!==null){if(typeof _0x45dce8[_0xabc1('0x72')]!==_0xabc1('0x9e')){if(_0x45dce8['originated']>0x0){_0x45dce8[_0xabc1('0x72')]-=0x1;}else{logger[_0xabc1('0x9b')](_0xabc1('0x9f'));}}}else{logger[_0xabc1('0x9b')](_0xabc1('0xa0'));}}function checkContactLowerLimitOriginate(_0x2284d7,_0x4d51f3,_0x497132){if(_0x4d51f3>_0x497132){for(var _0x37e78c=0x0;_0x37e78c<_0x4d51f3-_0x497132;_0x37e78c+=0x1){decremetOriginate(_0x2284d7);}}}function loggerGetContactDialer(_0x247990,_0x38518e,_0x1cee75){return function(_0x4ed125){checkContactLowerLimitOriginate(_0x38518e,_0x1cee75,0x0);logger[_0xabc1('0x9b')](_0x247990,util[_0xabc1('0x9d')](_0x4ed125,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5d8ffa){return function(_0x23e7c8){if(isNotNull(_0x23e7c8)&&isNotNull(_0x23e7c8[0x0])){if(_0x23e7c8[0x0][_0xabc1('0xa1')]>0x0){_0x5d8ffa[_0xabc1('0x41')]=_0xabc1('0xa2');logger['info'](_0xabc1('0xa3')+_0x5d8ffa[_0xabc1('0x43')],_0x23e7c8[0x0]['contactsRescheduled'],'contacts');}else{_0x5d8ffa[_0xabc1('0x41')]=_0xabc1('0xa4');logger[_0xabc1('0x81')](_0xabc1('0xa5')+_0x5d8ffa['name']);}}};}function notSendMessagesQueue(_0x5a4216){if(_0x5a4216[_0xabc1('0xa6')]){freeVariablesPredictive(_0x5a4216);if(_0x5a4216[_0xabc1('0x72')]===0x0&&_0x5a4216[_0xabc1('0x56')]===0x0&&_0x5a4216['waiting']===0x0&&(_0x5a4216[_0xabc1('0xa7')]||0x0)===0x0){_0x5a4216[_0xabc1('0xa6')]=![];_0x5a4216[_0xabc1('0x51')]=0x0;_0x5a4216[_0xabc1('0x41')]=_0xabc1('0x44');loggerSyncQueueSummary[_0xabc1('0x9b')](_0xabc1('0xa8'),_0x5a4216[_0xabc1('0x43')],_0xabc1('0xa9'));}else{_0x5a4216['message']=_0xabc1('0xaa');loggerSyncQueueSummary['error'](_0xabc1('0xa8'),_0x5a4216[_0xabc1('0x43')],_0xabc1('0xab'));}emitVoiceQueueSummary(_0x5a4216);}}function notSendMessagesCampaign(_0xc29571){if(_0xc29571[_0xabc1('0xa6')]){if(_0xc29571['originated']===0x0){_0xc29571[_0xabc1('0xa6')]=![];_0xc29571[_0xabc1('0x41')]=_0xabc1('0x44');loggerSyncQueueSummary[_0xabc1('0x9b')](_0xabc1('0xac'),_0xc29571[_0xabc1('0x43')],_0xabc1('0xa9'));}else{_0xc29571[_0xabc1('0x41')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xabc1('0x9b')](_0xabc1('0xac'),_0xc29571[_0xabc1('0x43')],_0xabc1('0xab'));}emitCampaignSummary(_0xc29571);}}function createObjHistory(_0x39b818,_0x1a956d,_0x3484ea,_0x187a34,_0x2efda1){_0x39b818[_0xabc1('0x41')]=_0x3484ea;var _0x41414b=new Action(_0x39b818,_0x1a956d);var _0xa36513=new History(_0x41414b);_0xa36513[_0xabc1('0xad')]=_0x187a34;_0xa36513[_0xabc1('0xae')]=_0x2efda1;_0xa36513[_0xabc1('0xaf')]=_0x41414b[_0xabc1('0xb0')];return _0xa36513;}Dialer['prototype'][_0xabc1('0x3f')]=function(){var _0x21548a=this;setInterval(function(){_0x21548a['clearZombieChannels'](_0x21548a[_0xabc1('0x28')],_0xabc1('0xb1'));_0x21548a[_0xabc1('0xb2')](_0x21548a['actions'],_0xabc1('0xb3'));},0x32c8);};Dialer[_0xabc1('0xb4')][_0xabc1('0xb2')]=function(_0x3f5b48,_0x5c5b04){var _0x181ed7=this;for(var _0x99b46 in _0x3f5b48){if(typeof _0x3f5b48[_0x99b46]!==_0xabc1('0x9e')){this[_0xabc1('0xb5')][_0xabc1('0xb6')](function(){if(!_[_0xabc1('0xb7')](_0x3f5b48[_0x99b46])){return ami[_0xabc1('0xb8')]({'action':_0xabc1('0xb9'),'channel':_0x3f5b48[_0x99b46][_0xabc1('0xba')]})['catch'](function(_0x49ede5){if(_0x49ede5[_0xabc1('0x41')]===_0xabc1('0xbb')){setTimeout(function(){if(_0x3f5b48[_0x99b46]&&_0x3f5b48[_0x99b46][_0xabc1('0xbc')]!=='ivr'){_0x181ed7['updateOriginated'](_0x181ed7[_0xabc1('0x21')][_0x3f5b48[_0x99b46][_0xabc1('0xbd')]]);logger[_0xabc1('0x9b')](_0xabc1('0xbe'),_0x5c5b04,_0x99b46,_0x3f5b48[_0x99b46][_0xabc1('0xbd')]);delete _0x3f5b48[_0x99b46];}if(_0x3f5b48[_0x99b46]&&_0x3f5b48[_0x99b46][_0xabc1('0xbc')]===_0xabc1('0x7e')){_0x181ed7['updateOriginated'](_0x181ed7['campaigns'][_0x3f5b48[_0x99b46][_0xabc1('0xbd')]]);logger[_0xabc1('0x9b')](_0xabc1('0xbf'),_0x5c5b04,_0x99b46,_0x3f5b48[_0x99b46][_0xabc1('0xbd')]);delete _0x3f5b48[_0x99b46];}},0x2328);}});}});}}};Dialer[_0xabc1('0xb4')][_0xabc1('0xc0')]=function(_0x3a7ec9){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x3a7ec9))['catch'](loggerCatch(_0xabc1('0xc1')));};Dialer['prototype'][_0xabc1('0xc2')]=function(_0x3b41e6){return BPromise[_0xabc1('0xc3')]()['then'](cmHopperBlack[_0xabc1('0xc2')](_0x3b41e6))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xabc1('0xb4')]['checkIsBlackListIvr']=function(_0x4eb965){return BPromise[_0xabc1('0xc3')]()[_0xabc1('0x40')](cmHopperBlack[_0xabc1('0xc4')](_0x4eb965))['catch'](loggerCatch(_0xabc1('0xc5')));};Dialer[_0xabc1('0xb4')][_0xabc1('0xc6')]=function(_0x4864f4){return BPromise[_0xabc1('0xc3')]()[_0xabc1('0x40')](cmHopperHistory[_0xabc1('0xc7')](_0x4864f4))[_0xabc1('0xc8')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xabc1('0xb4')]['rescheduleContact']=function(_0x4d715f){return BPromise['resolve']()[_0xabc1('0x40')](cmHopper['rescheduleContact'](_0x4d715f))[_0xabc1('0xc8')](loggerCatch(_0xabc1('0xc9')));};Dialer[_0xabc1('0xb4')][_0xabc1('0xca')]=function(_0x5ad399,_0x366eb0,_0x1a65f3){return BPromise['resolve']()['then'](cmHopper['unlockContact'](_0x5ad399,_0x366eb0,_0x1a65f3))['catch'](loggerCatch('[unlockContact]\x20'));};Dialer[_0xabc1('0xb4')]['getContactDialer']=function(_0x2e0680,_0x10fb9a,_0x1aa7ae,_0x15962b,_0x251009){return BPromise[_0xabc1('0xc3')]()[_0xabc1('0x40')](cmHopper['getContactDialer'](_0x2e0680,_0x10fb9a,_0x1aa7ae,_0x15962b))['catch'](function(_0xd15eb6){_0x251009[_0xabc1('0xcb')]-=_0x1aa7ae;_0x251009['temp']=_0x251009['temp']>0x0?_0x251009[_0xabc1('0xcb')]:0x0;loggerCatch(_0xabc1('0xcc'))(_0xd15eb6);});};Dialer['prototype'][_0xabc1('0xcd')]=function(_0x4460fb,_0x7c72d9,_0x17a651,_0x52be95){return BPromise[_0xabc1('0xc3')]()[_0xabc1('0x40')](cmHopper[_0xabc1('0xcd')](_0x4460fb,_0x7c72d9,_0x17a651))[_0xabc1('0xc8')](function(_0x51f0b1){_0x52be95[_0xabc1('0xcb')]-=_0x7c72d9;_0x52be95[_0xabc1('0xcb')]=_0x52be95[_0xabc1('0xcb')]>0x0?_0x52be95[_0xabc1('0xcb')]:0x0;loggerCatch(_0xabc1('0xce'))(_0x51f0b1);});};Dialer[_0xabc1('0xb4')][_0xabc1('0xcf')]=function(_0x276e6){return BPromise[_0xabc1('0xc3')]()['then'](voiceQueueRt[_0xabc1('0xcf')](_0x276e6))[_0xabc1('0xc8')](loggerCatch(_0xabc1('0xd0')));};Dialer[_0xabc1('0xb4')][_0xabc1('0xd1')]=function(_0x5bdac3){return BPromise[_0xabc1('0xc3')]()[_0xabc1('0x40')](cmHopper[_0xabc1('0xd1')](_0x5bdac3))[_0xabc1('0xc8')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xabc1('0xb4')]['createHistory']=function(_0x4310d4){return BPromise[_0xabc1('0xc3')]()['then'](cmHopperHistory[_0xabc1('0xd2')](_0x4310d4))[_0xabc1('0xc8')](loggerCatch(_0xabc1('0xd3')));};Dialer[_0xabc1('0xb4')]['updateOriginated']=function(_0x5bbea3){if(!_['isUndefined'](_0x5bbea3)&&_0x5bbea3!==null){if(typeof _0x5bbea3[_0xabc1('0x72')]!==_0xabc1('0x9e')){if(_0x5bbea3[_0xabc1('0x72')]>0x0){_0x5bbea3['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xabc1('0x9b')](_0xabc1('0xd4'));}};Dialer[_0xabc1('0xb4')][_0xabc1('0xd5')]=function(_0x7807e2,_0x39dc26){var _0x7b1d72=this;return function(_0x3dee95){_0x7b1d72[_0xabc1('0xd6')](_0x39dc26);logger[_0xabc1('0x9b')](_0x7807e2,util[_0xabc1('0x9d')](_0x3dee95,{'showHidden':![],'depth':null}));};};Dialer[_0xabc1('0xb4')]['emptyContact']=function(_0x3881d3,_0x1cc5d9,_0x4c0f1d){var _0x1b3a9b={'state':0x19,'statedesc':_0xabc1('0xd7')};this[_0xabc1('0xd6')](_0x1cc5d9);this['saveInDb'](_[_0xabc1('0x93')](_0x1b3a9b,_[_0xabc1('0xd8')](_0x4c0f1d,['ContactId','ListId',_0xabc1('0xd9'),'VoiceQueueId','CampaignId'])),_0xabc1('0xda'),_0xabc1('0xdb'));logger[_0xabc1('0x9b')](_0x3881d3);};Dialer[_0xabc1('0xb4')][_0xabc1('0xdc')]=function(_0x43347e){return _0x43347e===_0xabc1('0xdd');};Dialer['prototype'][_0xabc1('0xde')]=function(_0x5e8551){return!_[_0xabc1('0x8a')](_0x5e8551)&&_0x5e8551&&!_[_0xabc1('0x8a')](_0x5e8551['name'])&&!_[_0xabc1('0x8a')](_0x5e8551[_0xabc1('0x78')])&&_0x5e8551[_0xabc1('0x78')]&&(this[_0xabc1('0x24')][util[_0xabc1('0x7b')](_0xabc1('0xdf'),_0x5e8551[_0xabc1('0x43')])][_0xabc1('0xb9')]===_0xabc1('0xe0')||this[_0xabc1('0x24')][util['format']('SIP/%s',_0x5e8551['name'])][_0xabc1('0xb9')]===_0xabc1('0xe1'));};Dialer[_0xabc1('0xb4')][_0xabc1('0xe2')]=function(_0x10d0d6,_0x4a7760,_0x590af7){this[_0xabc1('0xd2')](_0x10d0d6)[_0xabc1('0xc8')](loggerCatch(_0x4a7760));this[_0xabc1('0xd1')](_0x10d0d6)['catch'](loggerCatch(_0x590af7));};Dialer['prototype'][_0xabc1('0x3a')]=function(_0x4d182b){var _0xc67039=this[_0xabc1('0x28')][_0x4d182b[_0xabc1('0xe3')]];var _0x25774e;if(!_[_0xabc1('0xb7')](_0x4d182b)&&!_[_0xabc1('0xb7')](_0x4d182b['variable'])&&!_['isNil'](_0x4d182b[_0xabc1('0xe4')]['amdstatus'])&&_0x4d182b[_0xabc1('0xe5')]==='xcally-motion-dialer'&&_0xc67039){if(_0xc67039['type']!==_0xabc1('0x7e')&&this['voiceQueues'][_0xc67039[_0xabc1('0xbd')]][_0xabc1('0xe6')]&&_0x4d182b[_0xabc1('0xe7')]==='HANGUP'){delete this[_0xabc1('0x28')][_0x4d182b['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0xc67039['queue']]);this[_0xabc1('0x21')][_0xc67039['queue']][_0xabc1('0x5e')]+=0x1;this[_0xabc1('0x21')][_0xc67039[_0xabc1('0xbd')]]['outboundAnswerAgiCallsDay']+=0x1;_0x25774e=new Hangup(_0xc67039,_0x4d182b);_0x25774e[_0xabc1('0xad')]=0x12;_0x25774e[_0xabc1('0xae')]='HangupInAMD';_0x25774e[_0xabc1('0xe8')]=_0xabc1('0xe9');ami[_0xabc1('0x4d')](_0xabc1('0xea'),ut[_0xabc1('0xeb')](_0x25774e,_0xabc1('0xec')));this[_0xabc1('0xe2')](_0x25774e,_0xabc1('0xed'),_0xabc1('0xee'));}if(_0xc67039[_0xabc1('0xbc')]!==_0xabc1('0x7e')&&this[_0xabc1('0x21')][_0xc67039[_0xabc1('0xbd')]][_0xabc1('0xe6')]&&_0x4d182b[_0xabc1('0xe7')]===_0xabc1('0xef')){var _0x48c9a9=this;return new BPromise(function(_0x42f933,_0x1f5e63){delete _0x48c9a9[_0xabc1('0x28')][_0x4d182b[_0xabc1('0xe3')]];_0x48c9a9[_0xabc1('0xd6')](_0x48c9a9[_0xabc1('0x21')][_0xc67039[_0xabc1('0xbd')]]);_0x48c9a9[_0xabc1('0x21')][_0xc67039[_0xabc1('0xbd')]][_0xabc1('0x5e')]+=0x1;_0x48c9a9[_0xabc1('0x21')][_0xc67039['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x3c66d4=_0x48c9a9['voiceQueues'][_0xc67039[_0xabc1('0xbd')]];var _0x274239=new Hangup(_0xc67039,_0x4d182b);_0x274239[_0xabc1('0xad')]=0x13;_0x274239[_0xabc1('0xae')]='Machine';_0x274239[_0xabc1('0xe8')]=_0xabc1('0xe9');_0x274239[_0xabc1('0xf0')]+=0x1;_0x274239[_0xabc1('0xf1')]+=0x1;_0x274239[_0xabc1('0xec')]=!![];ami[_0xabc1('0x4d')](_0xabc1('0xea'),ut[_0xabc1('0xeb')](_0x274239,_0xabc1('0xec')));_0x48c9a9['createHistory'](_0x274239)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0xf2')));if(_0x274239['countbusyretry']+_0x274239[_0xabc1('0xf3')]+_0x274239[_0xabc1('0xf4')]+_0x274239['countnosuchnumberretry']+_0x274239[_0xabc1('0xf5')]+_0x274239[_0xabc1('0xf6')]+_0x274239[_0xabc1('0xf0')]+_0x274239['countagentrejectretry']>=_0x3c66d4[_0xabc1('0xf7')]){_0x48c9a9['stateGlobal'](_0x274239,_0x42f933,_0x1f5e63,_0xabc1('0xf8'));}else{if(_0x274239['countmachineretry']>=_0x3c66d4[_0xabc1('0xf9')]){_0x48c9a9[_0xabc1('0xfa')](_0x274239,_0x42f933,_0x1f5e63,_0xabc1('0xfb'));}else{_0x48c9a9[_0xabc1('0xfc')]({'active':![],'countmachineretry':_0x274239['countmachineretry'],'scheduledat':moment()[_0xabc1('0xfd')](_0x3c66d4[_0xabc1('0xfe')],_0xabc1('0xff'))[_0xabc1('0x7b')](_0xabc1('0x100')),'ContactId':_0x274239['ContactId'],'ListId':_0x274239[_0xabc1('0x101')],'VoiceQueueId':_0x274239[_0xabc1('0x102')]||undefined,'CampaignId':_0x274239['CampaignId']||undefined})[_0xabc1('0xc8')](loggerCatch('[rescheduleContact][Machine]'));_0x42f933({'reschedule':0x1});}}});}if(_0xc67039['type']===_0xabc1('0x7e')&&this[_0xabc1('0x22')][_0xc67039[_0xabc1('0xbd')]][_0xabc1('0xe6')]&&_0x4d182b['value']==='HANGUP'){delete this[_0xabc1('0x28')][_0x4d182b[_0xabc1('0xe3')]];this[_0xabc1('0xd6')](this[_0xabc1('0x22')][_0xc67039['queue']]);_0x25774e=new Hangup(_0xc67039,_0x4d182b);_0x25774e['state']=0x12;_0x25774e['statedesc']=_0xabc1('0x103');_0x25774e[_0xabc1('0xe8')]=_0xabc1('0xe9');ami['emit'](_0xabc1('0xea'),ut[_0xabc1('0xeb')](_0x25774e,_0xabc1('0xec')));this[_0xabc1('0xe2')](_0x25774e,_0xabc1('0x104'),_0xabc1('0x105'));}if(_0xc67039[_0xabc1('0xbc')]===_0xabc1('0x7e')&&this[_0xabc1('0x22')][_0xc67039[_0xabc1('0xbd')]][_0xabc1('0xe6')]&&_0x4d182b[_0xabc1('0xe7')]===_0xabc1('0xef')){var _0x48c9a9=this;return new BPromise(function(_0x461eaf,_0x41193){delete _0x48c9a9['uniqueId'][_0x4d182b['uniqueid']];_0x48c9a9[_0xabc1('0xd6')](_0x48c9a9[_0xabc1('0x22')][_0xc67039[_0xabc1('0xbd')]]);_0x48c9a9[_0xabc1('0x22')][_0xc67039['queue']][_0xabc1('0x5e')]+=0x1;_0x48c9a9[_0xabc1('0x22')][_0xc67039[_0xabc1('0xbd')]][_0xabc1('0x5d')]+=0x1;var _0xd4c95e=_0x48c9a9[_0xabc1('0x22')][_0xc67039['queue']];var _0x222b90=new Hangup(_0xc67039,_0x4d182b);_0x222b90['state']=0x13;_0x222b90[_0xabc1('0xae')]=_0xabc1('0x106');_0x222b90[_0xabc1('0xe8')]=_0xabc1('0xe9');_0x222b90['countmachineretry']+=0x1;_0x222b90[_0xabc1('0xf1')]+=0x1;_0x222b90[_0xabc1('0xec')]=!![];ami[_0xabc1('0x4d')](_0xabc1('0xea'),ut[_0xabc1('0xeb')](_0x222b90,_0xabc1('0xec')));_0x48c9a9[_0xabc1('0xd2')](_0x222b90)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0xf2')));if(_0x222b90['countbusyretry']+_0x222b90[_0xabc1('0xf3')]+_0x222b90[_0xabc1('0xf4')]+_0x222b90['countnosuchnumberretry']+_0x222b90[_0xabc1('0xf5')]+_0x222b90[_0xabc1('0xf6')]+_0x222b90['countmachineretry']+_0x222b90[_0xabc1('0x107')]>=_0xd4c95e[_0xabc1('0xf7')]){_0x48c9a9[_0xabc1('0x108')](_0x222b90,_0x461eaf,_0x41193,_0xabc1('0xf8'));}else{if(_0x222b90[_0xabc1('0xf0')]>=_0xd4c95e[_0xabc1('0xf9')]){_0x48c9a9[_0xabc1('0xfa')](_0x222b90,_0x461eaf,_0x41193,'reason\x2019\x20machine....');}else{_0x48c9a9[_0xabc1('0xfc')]({'active':![],'countmachineretry':_0x222b90[_0xabc1('0xf0')],'scheduledat':moment()[_0xabc1('0xfd')](_0xd4c95e[_0xabc1('0xfe')],_0xabc1('0xff'))['format'](_0xabc1('0x100')),'ContactId':_0x222b90[_0xabc1('0x109')],'ListId':_0x222b90[_0xabc1('0x101')],'VoiceQueueId':_0x222b90['VoiceQueueId']||undefined,'CampaignId':_0x222b90[_0xabc1('0x10a')]||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x10b')));_0x461eaf({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xabc1('0x38')]=function(_0x22e45c){var _0x295be6=this[_0xabc1('0x28')][_0x22e45c[_0xabc1('0xe3')]];var _0x4a2b27=this;var _0x534d1c;if(_0x295be6&&_0x295be6[_0xabc1('0xbc')]==='ivr'){delete this['uniqueId'][_0x22e45c[_0xabc1('0xe3')]];this[_0xabc1('0xd6')](this[_0xabc1('0x22')][_0x295be6[_0xabc1('0xbd')]]);this[_0xabc1('0x22')][_0x295be6['queue']][_0xabc1('0x10c')]+=0x1;_0x534d1c=new Hangup(_0x295be6,_0x22e45c);this[_0xabc1('0xd2')](_0x534d1c)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x10d')));this[_0xabc1('0xd1')](_0x534d1c)['catch'](loggerCatch(_0xabc1('0x10e')));}if(_0x295be6&&_0x295be6[_0xabc1('0xbc')]!==_0xabc1('0x7e')&&isNotNull(this[_0xabc1('0x21')][_0x295be6['queue']]['dialQueueProject'])){delete this[_0xabc1('0x28')][_0x22e45c[_0xabc1('0xe3')]];this[_0xabc1('0xd6')](this['voiceQueues'][_0x295be6[_0xabc1('0xbd')]]);this[_0xabc1('0x21')][_0x295be6[_0xabc1('0xbd')]][_0xabc1('0x5e')]+=0x1;this[_0xabc1('0x21')][_0x295be6[_0xabc1('0xbd')]][_0xabc1('0x5d')]+=0x1;_0x534d1c=new Hangup(_0x295be6,_0x22e45c);_0x534d1c[_0xabc1('0xad')]=0x10;_0x534d1c[_0xabc1('0xae')]='AnswerAGI';_0x534d1c[_0xabc1('0xe8')]=_0xabc1('0x10f');this[_0xabc1('0xd2')](_0x534d1c)[_0xabc1('0xc8')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xabc1('0xd1')](_0x534d1c)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x10e')));}if(_0x295be6&&_0x295be6['type']!=='ivr'&&!isNotNull(this[_0xabc1('0x21')][_0x295be6[_0xabc1('0xbd')]][_0xabc1('0x110')])){delete this[_0xabc1('0x28')][_0x22e45c[_0xabc1('0xe3')]];this[_0xabc1('0xd6')](this[_0xabc1('0x21')][_0x295be6[_0xabc1('0xbd')]]);this['voiceQueues'][_0x295be6[_0xabc1('0xbd')]][_0xabc1('0x69')]+=0x1;_0x534d1c=new Hangup(_0x295be6,_0x22e45c);_0x534d1c['state']=0xc;_0x534d1c[_0xabc1('0xae')]=_0x22e45c['cause-txt'];_0x534d1c[_0xabc1('0xe8')]=_0xabc1('0x111');this[_0xabc1('0xd2')](_0x534d1c)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x10d')));this['moveContactManagedDialer'](_0x534d1c)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xabc1('0x35')]=function(_0x1d86e3){var _0x170b8e=this['uniqueId'][_0x1d86e3['uniqueid']];var _0x1e94d2=this;if(this['voiceQueues'][_0x1d86e3['queue']]){if(_0x170b8e&&_0x170b8e[_0xabc1('0xbc')]!==_0xabc1('0x7e')){delete this[_0xabc1('0x28')][_0x1d86e3[_0xabc1('0xe3')]];this[_0xabc1('0x21')][_0x1d86e3[_0xabc1('0xbd')]]['outboundAnswerCallsDay']+=0x1;var _0x466e99=new AgentComplete(_0x170b8e,_0x1d86e3);if(_0x1d86e3['reason']===_0xabc1('0x112')){_0x466e99[_0xabc1('0x113')]=this[_0xabc1('0x21')][_0x1d86e3[_0xabc1('0xbd')]]['dialQueueProject2']&&this['voiceQueues'][_0x1d86e3[_0xabc1('0xbd')]][_0xabc1('0x114')]?moment()[_0xabc1('0x7b')](_0xabc1('0x100')):undefined;}this[_0xabc1('0xd2')](_0x466e99)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x115')));this[_0xabc1('0xd1')](_0x466e99)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x116')));}}};Dialer['prototype'][_0xabc1('0x117')]=function(_0x1f4fcd){if(this['voiceQueues'][_0x1f4fcd[_0xabc1('0xbd')]]){if(this['uniqueId'][_0x1f4fcd[_0xabc1('0xe3')]]&&this[_0xabc1('0x28')][_0x1f4fcd[_0xabc1('0xe3')]][_0xabc1('0xbc')]!==_0xabc1('0x7e')){this[_0xabc1('0xd6')](this['voiceQueues'][_0x1f4fcd[_0xabc1('0xbd')]]);this[_0xabc1('0x28')][_0x1f4fcd['uniqueid']]['answertime']=moment()[_0xabc1('0x7b')](_0xabc1('0x100'));}}};Dialer[_0xabc1('0xb4')]['queueCallerAbandonCreateState']=function(_0x136986){this[_0xabc1('0xd2')](_0x136986)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x115')));this[_0xabc1('0xd1')](_0x136986)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x118')));};Dialer['prototype'][_0xabc1('0x30')]=function(_0x4fc793){var _0x9e0033=this[_0xabc1('0x28')][_0x4fc793['uniqueid']];var _0x3abc2b=this;if(this['voiceQueues'][_0x4fc793[_0xabc1('0xbd')]]){if(_0x9e0033&&_0x9e0033[_0xabc1('0xbc')]!==_0xabc1('0x7e')){delete this[_0xabc1('0x28')][_0x4fc793[_0xabc1('0xe3')]];this[_0xabc1('0xd6')](this[_0xabc1('0x21')][_0x4fc793[_0xabc1('0xbd')]]);_0x9e0033['droptime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x20400e=new QueueCallerAbandon(_0x9e0033,_0x4fc793);if(getSeconds(_0x9e0033[_0xabc1('0x119')],_0x9e0033['responsetime'])>=_0x9e0033[_0xabc1('0x11a')]){this['voiceQueues'][_0x4fc793[_0xabc1('0xbd')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xabc1('0x21')][_0x4fc793['queue']][_0xabc1('0x63')]+=0x1;this[_0xabc1('0x21')][_0x4fc793[_0xabc1('0xbd')]][_0xabc1('0x6d')]+=0x1;_0x20400e['state']=0xa;_0x20400e[_0xabc1('0xae')]=_0xabc1('0x11b');_0x20400e[_0xabc1('0x11c')]='TIMEOUT';_0x20400e[_0xabc1('0x113')]=this[_0xabc1('0x21')][_0x4fc793[_0xabc1('0xbd')]][_0xabc1('0x11d')]?moment()[_0xabc1('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x20400e[_0xabc1('0xf5')]+=0x1;_0x20400e[_0xabc1('0xf1')]+=0x1;if(_0x20400e[_0xabc1('0xf5')]>=this[_0xabc1('0x21')][_0x4fc793[_0xabc1('0xbd')]][_0xabc1('0x11e')]){this[_0xabc1('0x11f')](_0x20400e);}else{this[_0xabc1('0xfc')]({'active':![],'countdropretry':_0x20400e['countdropretry'],'scheduledat':moment()[_0xabc1('0xfd')](this[_0xabc1('0x21')][_0x4fc793[_0xabc1('0xbd')]][_0xabc1('0x120')],_0xabc1('0xff'))[_0xabc1('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x9e0033[_0xabc1('0x109')],'ListId':_0x9e0033[_0xabc1('0x101')],'VoiceQueueId':_0x9e0033[_0xabc1('0x102')]||undefined,'CampaignId':_0x9e0033['CampaignId']||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x121')));var _0x25c591=new History(_0x20400e);_0x25c591[_0xabc1('0xad')]=0xa;_0x25c591[_0xabc1('0xae')]=_0xabc1('0x11b');_0x25c591[_0xabc1('0xb0')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x25c591['endtime']=_0x25c591[_0xabc1('0xb0')];_0x25c591['calleridname']=_0x20400e['calleridname'];_0x25c591[_0xabc1('0x122')]=_0x20400e[_0xabc1('0x122')];this['createHistory'](_0x25c591)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x123')));}}else{this[_0xabc1('0x21')][_0x4fc793[_0xabc1('0xbd')]][_0xabc1('0x6b')]+=0x1;this[_0xabc1('0x21')][_0x4fc793[_0xabc1('0xbd')]][_0xabc1('0x62')]+=0x1;_0x20400e['state']=0xb;_0x20400e[_0xabc1('0xae')]='Abandoned';_0x20400e[_0xabc1('0x11c')]=_0xabc1('0x124');_0x20400e[_0xabc1('0xf6')]+=0x1;_0x20400e['countglobal']+=0x1;if(_0x20400e[_0xabc1('0xf6')]>=this[_0xabc1('0x21')][_0x4fc793['queue']][_0xabc1('0x125')]){this[_0xabc1('0x11f')](_0x20400e);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x20400e['countabandonedretry'],'scheduledat':moment()[_0xabc1('0xfd')](this[_0xabc1('0x21')][_0x4fc793[_0xabc1('0xbd')]][_0xabc1('0x126')],'minutes')[_0xabc1('0x7b')](_0xabc1('0x100')),'ContactId':_0x9e0033[_0xabc1('0x109')],'ListId':_0x9e0033[_0xabc1('0x101')],'VoiceQueueId':_0x9e0033[_0xabc1('0x102')]||undefined,'CampaignId':_0x9e0033[_0xabc1('0x10a')]||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x127')));var _0x25c591=new History(_0x20400e);_0x25c591['state']=0xb;_0x25c591[_0xabc1('0xae')]='Abandoned';_0x25c591['starttime']=moment()['format'](_0xabc1('0x100'));_0x25c591[_0xabc1('0xaf')]=_0x25c591['starttime'];_0x25c591[_0xabc1('0x128')]=_0x20400e['calleridname'];_0x25c591[_0xabc1('0x122')]=_0x20400e['calleridnum'];this[_0xabc1('0xd2')](_0x25c591)['catch'](loggerCatch(_0xabc1('0x129')));}}}}};Dialer[_0xabc1('0xb4')][_0xabc1('0x12a')]=function(_0xe3bdbf){if(this['actions'][_0xe3bdbf[_0xabc1('0xe3')]]){this['actions'][_0xe3bdbf[_0xabc1('0xe3')]]['channel']=_0xe3bdbf[_0xabc1('0xba')];}if(this['uniqueId'][_0xe3bdbf[_0xabc1('0xe3')]]){this['uniqueId'][_0xe3bdbf[_0xabc1('0xe3')]]['channel']=_0xe3bdbf[_0xabc1('0xba')];}};Dialer['prototype'][_0xabc1('0x12b')]=function(_0x310191){if(strategy[this[_0xabc1('0x21')][this['actions'][_0x310191[_0xabc1('0x12c')]][_0xabc1('0xbd')]]['strategy']]===_0xabc1('0x1d')){if(this[_0xabc1('0x27')][_0x310191[_0xabc1('0x12c')]]&&_[_0xabc1('0xb7')](this[_0xabc1('0x27')][_0x310191[_0xabc1('0x12c')]][_0xabc1('0x12d')])&&_0x310191[_0xabc1('0xb9')]==='1'&&_0x310191['paused']==='0'){if(this['agents'][_0x310191[_0xabc1('0x12e')]]){if(!this['agents'][_0x310191[_0xabc1('0x12e')]][_0xabc1('0x12d')]){this['agents'][_0x310191[_0xabc1('0x12e')]][_0xabc1('0x12d')]=!![];this[_0xabc1('0x27')][_0x310191[_0xabc1('0x12c')]][_0xabc1('0x12d')]=!![];this['actions'][_0x310191['actionid']]['stateinterface']=_0x310191[_0xabc1('0x12e')];}}}}else if((strategy[this[_0xabc1('0x21')][this[_0xabc1('0x27')][_0x310191[_0xabc1('0x12c')]][_0xabc1('0xbd')]][_0xabc1('0x4f')]]||_0xabc1('0x1c'))===_0xabc1('0x1c')){if(this[_0xabc1('0x27')][_0x310191[_0xabc1('0x12c')]]){if(this['agents'][_0x310191[_0xabc1('0x12e')]]){this[_0xabc1('0x27')][_0x310191[_0xabc1('0x12c')]][_0xabc1('0x12e')]=_0x310191[_0xabc1('0x12e')];if(_[_0xabc1('0xb7')](this[_0xabc1('0x2c')][this['actions'][_0x310191['actionid']][_0xabc1('0xbd')]])){this[_0xabc1('0x2c')][this[_0xabc1('0x27')][_0x310191[_0xabc1('0x12c')]]['queue']]=[];}this[_0xabc1('0x2c')][this[_0xabc1('0x27')][_0x310191[_0xabc1('0x12c')]][_0xabc1('0xbd')]][_0xabc1('0x12f')](_[_0xabc1('0x93')](_[_0xabc1('0xd8')](this['actions'][_0x310191[_0xabc1('0x12c')]],[_0xabc1('0x130'),_0xabc1('0x12e')]),{'status':_0x310191['status'],'paused':_0x310191[_0xabc1('0x131')]}));}}}};function unlockQueueStatus(_0x227d83,_0x428ad7){setTimeout(function(){if(_[_0xabc1('0x8a')](_0x227d83[_0xabc1('0x132')])){loggerBooked[_0xabc1('0x9b')](_0xabc1('0x133'),_0x428ad7);}_0x227d83[_0xabc1('0x132')]=!![];loggerBooked[_0xabc1('0x81')]('[booked][unlockQueueStatus]',_0x428ad7,JSON[_0xabc1('0x7a')](_[_0xabc1('0xd8')](_0x227d83,['name',_0xabc1('0x132')])));},0x1f3);}Dialer[_0xabc1('0xb4')][_0xabc1('0x3d')]=function(_0x57a6fc){var _0x55cd82=this;var _0x15824a=_0x55cd82[_0xabc1('0x21')][_0x55cd82[_0xabc1('0x27')][_0x57a6fc['actionid']][_0xabc1('0xbd')]];if(strategy[this[_0xabc1('0x21')][this['actions'][_0x57a6fc['actionid']][_0xabc1('0xbd')]]['strategy']]===_0xabc1('0x1d')){if(this['actions'][_0x57a6fc['actionid']]&&this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x12e')]){this[_0xabc1('0x20')][_0xabc1('0x134')](this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x130')],this[_0xabc1('0x27')][_0x57a6fc['actionid']][_0xabc1('0x12e')])[_0xabc1('0xc8')](function(_0x149cd1){logger[_0xabc1('0x9b')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xabc1('0x9d')](_0x149cd1,{'showHidden':![],'depth':null}));})[_0xabc1('0x1f')](function(){_0x55cd82['updateOriginated'](_0x55cd82['voiceQueues'][_0x55cd82[_0xabc1('0x27')][_0x57a6fc['actionid']][_0xabc1('0xbd')]]);_0x55cd82['agents'][_0x55cd82[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]]['stateinterface']][_0xabc1('0x12d')]=![];delete _0x55cd82[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]];unlockQueueStatus(_0x15824a);});}else{this['updateOriginated'](this[_0xabc1('0x21')][this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]]);this[_0xabc1('0xfc')]({'active':![],'ContactId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]]['ContactId'],'ListId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x101')],'VoiceQueueId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x102')]||undefined,'CampaignId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x10a')]||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x135')));delete this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]];unlockQueueStatus(_0x15824a);}}else if((strategy[this[_0xabc1('0x21')][this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]][_0xabc1('0x4f')]]||_0xabc1('0x1c'))===_0xabc1('0x1c')){var _0x4f2dec;if(this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]]&&!_[_0xabc1('0x49')](this['queueBooked'][this[_0xabc1('0x27')][_0x57a6fc['actionid']][_0xabc1('0xbd')]])){if(this[_0xabc1('0x2d')][_0x55cd82['actions'][_0x57a6fc['actionid']][_0xabc1('0xbd')]]){this['queueBookedRR'][_0x55cd82[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]]=this['queueBookedRR'][this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]]?this['queueBookedRR'][this['actions'][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]]:this['queueBooked'][this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]]?this[_0xabc1('0x2c')][this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]][_0xabc1('0x136')]||0x0:0x0;}this[_0xabc1('0x2c')][this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]][_0xabc1('0x136')]=this[_0xabc1('0x2d')][this[_0xabc1('0x27')][_0x57a6fc['actionid']][_0xabc1('0xbd')]];for(var _0x4225f8=0x0;_0x4225f8<this['queueBooked'][this['actions'][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]][_0xabc1('0x137')];_0x4225f8+=0x1){_0x4f2dec=rr(this[_0xabc1('0x2c')][this['actions'][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]]);this['queueBookedRR'][_0x55cd82[_0xabc1('0x27')][_0x57a6fc['actionid']][_0xabc1('0xbd')]]=this['queueBooked'][this[_0xabc1('0x27')][_0x57a6fc['actionid']][_0xabc1('0xbd')]][_0xabc1('0x136')];if(_0x4f2dec[_0xabc1('0xb9')]==='1'&&_0x4f2dec[_0xabc1('0x131')]==='0'){break;}}if(!_[_0xabc1('0xb7')](_0x4f2dec)){this[_0xabc1('0x23')][_0x4f2dec[_0xabc1('0x12e')]][_0xabc1('0x138')]=_[_0xabc1('0x8a')](this[_0xabc1('0x23')][_0x4f2dec['stateinterface']][_0xabc1('0x138')])?!![]:this[_0xabc1('0x23')][_0x4f2dec[_0xabc1('0x12e')]][_0xabc1('0x138')];}loggerBooked[_0xabc1('0x81')](_0xabc1('0x139'),_0x57a6fc[_0xabc1('0x12c')],'Agent:\x20',JSON['stringify'](_[_0xabc1('0xd8')](this[_0xabc1('0x23')][_0x4f2dec['stateinterface']],[_0xabc1('0x43'),'unlockRR'])),_0xabc1('0x13a'),JSON['stringify'](_0x4f2dec['idHopper']));if(!_['isNil'](_0x4f2dec)&&_0x4f2dec[_0xabc1('0xb9')]==='1'&&_0x4f2dec[_0xabc1('0x131')]==='0'&&this['agents'][_0x4f2dec[_0xabc1('0x12e')]][_0xabc1('0x138')]){this[_0xabc1('0x23')][_0x4f2dec[_0xabc1('0x12e')]][_0xabc1('0x138')]=![];this[_0xabc1('0x2c')][_0x55cd82[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]]=[];this['preview'][_0xabc1('0x134')](_0x4f2dec[_0xabc1('0x130')],_0x4f2dec[_0xabc1('0x12e')])['catch'](function(_0x1e1870){logger[_0xabc1('0x9b')](_0xabc1('0x13b'),util['inspect'](_0x1e1870,{'showHidden':![],'depth':null}));})[_0xabc1('0x1f')](function(){_0x55cd82[_0xabc1('0xd6')](_0x55cd82[_0xabc1('0x21')][_0x55cd82[_0xabc1('0x27')][_0x57a6fc['actionid']][_0xabc1('0xbd')]]);setTimeout(function(){_0x55cd82[_0xabc1('0x23')][_0x4f2dec[_0xabc1('0x12e')]][_0xabc1('0x138')]=!![];loggerBooked[_0xabc1('0x81')](_0xabc1('0x13c'),_0x57a6fc[_0xabc1('0x12c')],_0xabc1('0x13d'),JSON[_0xabc1('0x7a')](_['pick'](_0x55cd82[_0xabc1('0x23')][_0x4f2dec[_0xabc1('0x12e')]],['name',_0xabc1('0x138')])),_0xabc1('0x13a'),JSON[_0xabc1('0x7a')](_0x4f2dec['idHopper']));},0xc7);delete _0x55cd82[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]];unlockQueueStatus(_0x15824a,_0x57a6fc[_0xabc1('0x12c')]);});}else{loggerBooked['info'](_0xabc1('0x13e'));this[_0xabc1('0xd6')](this[_0xabc1('0x21')][this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]]);this[_0xabc1('0xfc')]({'active':![],'ContactId':this['actions'][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x109')],'ListId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x101')],'VoiceQueueId':this[_0xabc1('0x27')][_0x57a6fc['actionid']][_0xabc1('0x102')]||undefined,'CampaignId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x10a')]||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x135')));delete this['actions'][_0x57a6fc['actionid']];unlockQueueStatus(_0x15824a);}}else{loggerBooked[_0xabc1('0x81')]('[booked][unlock2]');this[_0xabc1('0xd6')](this[_0xabc1('0x21')][this[_0xabc1('0x27')][_0x57a6fc['actionid']]['queue']]);this[_0xabc1('0xfc')]({'active':![],'ContactId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x109')],'ListId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x101')],'VoiceQueueId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]]['CampaignId']||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x13f')));delete this['actions'][_0x57a6fc['actionid']];unlockQueueStatus(_0x15824a);}}else{loggerBooked[_0xabc1('0x81')](_0xabc1('0x140'));this[_0xabc1('0xd6')](this[_0xabc1('0x21')][this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0xbd')]]);this[_0xabc1('0xfc')]({'active':![],'ContactId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x109')],'ListId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x101')],'VoiceQueueId':this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x57a6fc[_0xabc1('0x12c')]][_0xabc1('0x10a')]||undefined})[_0xabc1('0xc8')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0xabc1('0x27')][_0x57a6fc[_0xabc1('0x12c')]];unlockQueueStatus(_0x15824a);}};Dialer[_0xabc1('0xb4')]['loopCampaigns']=function(){var _0x3c6ecc=this;return BPromise['resolve']()[_0xabc1('0x40')](cmHopper[_0xabc1('0x141')]({}))[_0xabc1('0x40')](function(){setInterval(function(){_0x3c6ecc[_0xabc1('0x142')]();},0x3e8);});};Dialer[_0xabc1('0xb4')]['checkIsTrunkReachable']=function(_0x30005f){var _0x5363ab=this;return function(){if(!_0x5363ab['isTrunkReachable'](_0x30005f[_0xabc1('0x77')])){if(!_0x5363ab['isTrunkReachable'](_0x30005f[_0xabc1('0x143')])){_0x30005f[_0xabc1('0x41')]=_0xabc1('0x144');throw _0x30005f[_0xabc1('0x43')]+_0xabc1('0x145');}}};};Dialer[_0xabc1('0xb4')][_0xabc1('0x146')]=function(_0x5097f9,_0xd98a01,_0x2436e9,_0x53ddc0){var _0x9436e2=this;return function(){var _0x5abb3c=!![];return _0x9436e2['ifTime'](_0x5097f9,_0xd98a01,_0x2436e9,_0x53ddc0,_0x5abb3c);};};Dialer[_0xabc1('0xb4')][_0xabc1('0x147')]=function(_0x1aaa47,_0x40d5b2,_0x1dca0a,_0x43a0f7){var _0x408af1=this;return function(){var _0x18ec7d=![];return _0x408af1['ifTime'](_0x1aaa47['Intervals'],_0x40d5b2,_0x1dca0a,_0x43a0f7,_0x18ec7d);};};Dialer[_0xabc1('0xb4')]['ifTime']=function(_0x1fe273,_0x2e98e2,_0x3e9e9e,_0x148e9f,_0x5b502b){var _0x7c749f=[];return new BPromise(function(_0x5f2ce0,_0x9cd70b){if(!isNotNull(_0x1fe273)){_0x148e9f['message']=_0xabc1('0x48');return _0x9cd70b(msgResponse(_0xabc1('0x148'),_0xabc1('0x149'),_0x3e9e9e+_0xabc1('0x14a')));}if(_[_0xabc1('0x49')](_0x1fe273)){_0x148e9f['message']=_0xabc1('0x14b');return _0x9cd70b(msgResponse(_0xabc1('0x148'),_0xabc1('0x149'),_0x3e9e9e+_0xabc1('0x14c')));}if(_0x2e98e2&&_['isUndefined'](config[_0xabc1('0x14d')][_0x2e98e2])){_0x148e9f[_0xabc1('0x41')]=_0xabc1('0x14e');return _0x9cd70b(msgResponse(_0xabc1('0x148'),_0xabc1('0x149'),_0x3e9e9e+_0xabc1('0x14f')+_0x2e98e2));}if(_[_0xabc1('0x150')](_0x1fe273)){for(var _0x5a951e=0x0;_0x5a951e<_0x1fe273[_0xabc1('0x137')];_0x5a951e+=0x1){_0x7c749f['push'](ami[_0xabc1('0xb8')]({'action':_0xabc1('0x151'),'command':util[_0xabc1('0x7b')](_0xabc1('0x152'),_0x1fe273[_0x5a951e]['interval'],!_[_0xabc1('0x8a')](config[_0xabc1('0x14d')][_0x2e98e2])?_0x2e98e2:'')})[_0xabc1('0x40')](function(_0x8f1f14){return _0x8f1f14[_0xabc1('0x153')][_0xabc1('0x154')](_0xabc1('0x155'))>=0x0;})[_0xabc1('0xc8')](myreject(_0x9cd70b)));}}else{_0x7c749f[_0xabc1('0x12f')](ami['Action']({'action':_0xabc1('0x151'),'command':util[_0xabc1('0x7b')](_0xabc1('0x152'),_0x1fe273,!_['isUndefined'](config[_0xabc1('0x14d')][_0x2e98e2])?_0x2e98e2:'')})[_0xabc1('0x40')](function(_0x3fbae3){return _0x3fbae3['content']['indexOf'](_0xabc1('0x155'))>=0x0;})['catch'](myreject(_0x9cd70b)));}BPromise[_0xabc1('0x156')](_0x7c749f)['then'](function(_0x179f9a){var _0x2caa7c=_[_0xabc1('0x157')](_0x179f9a);if(_0x2caa7c){return _0x5f2ce0(_0x2caa7c);}else{_0x148e9f['message']=_0x5b502b?_0xabc1('0x158'):_0xabc1('0x159');return _0x9cd70b(msgResponse(_0xabc1('0x15a'),_0xabc1('0x149'),_0xabc1('0x15b')+_0x5b502b+'\x20'+_0x3e9e9e+'\x20Interval\x20is\x20overtime:\x20'+util[_0xabc1('0x9d')](_0x1fe273,{'showHidden':![],'depth':null})+_0xabc1('0x15c')+_0x2e98e2));}})[_0xabc1('0xc8')](function(_0x7f6afa){return _0x9cd70b(msgResponse('ifTime',_0xabc1('0x149'),JSON[_0xabc1('0x7a')](_0x7f6afa)));});});};Dialer['prototype'][_0xabc1('0x15d')]=function(_0x14f666){var _0x18efa8=this;return function(){switch(_0x14f666['dialMethod']){case'progressive':freeVariablesPredictive(_0x14f666);_0x18efa8[_0xabc1('0x15e')](_0x14f666,0x1);break;case'power':freeVariablesPredictive(_0x14f666);_0x18efa8[_0xabc1('0x15e')](_0x14f666,_0x14f666[_0xabc1('0x15f')]);break;case _0xabc1('0x9'):_0x18efa8[_0xabc1('0x9')](_0x14f666);break;case _0xabc1('0x8'):freeVariablesPredictive(_0x14f666);_0x18efa8[_0xabc1('0x15e')](_0x14f666,0x1);break;default:freeVariablesPredictive(_0x14f666);logger[_0xabc1('0x9b')]('Queue',_0x14f666['name'],'method\x20not\x20recognized');}};};Dialer[_0xabc1('0xb4')][_0xabc1('0x160')]=function(_0x24f9b6){return BPromise[_0xabc1('0xc3')]()[_0xabc1('0x40')](cmHopper[_0xabc1('0x161')](_0x24f9b6['id'],previewRecallmeReminderInterval))[_0xabc1('0x40')](function(_0x32bf3d){for(var _0x463bdd=0x0;_0x463bdd<_0x32bf3d[_0xabc1('0x137')];_0x463bdd++){var _0x4dfc40=_0x32bf3d[_0x463bdd][_0xabc1('0x162')][_0xabc1('0x43')];if(_0x4dfc40)io['to'](util[_0xabc1('0x7b')](_0xabc1('0x163'),_0x4dfc40))[_0xabc1('0x4d')](_0xabc1('0x164'),{'hopper':_0x32bf3d[_0x463bdd]});}})[_0xabc1('0xc8')](function(_0xc6ba12){});};Dialer[_0xabc1('0xb4')][_0xabc1('0x165')]=function(_0x2c46bf){var _0x16debe=this;return function(){_0x16debe[_0xabc1('0x166')](_0x2c46bf);};};Dialer[_0xabc1('0xb4')][_0xabc1('0xa')]=function(_0x292e5e){var _0x2c5520=this;if(isNotPreview(_0x292e5e[_0xabc1('0x59')])){if(isVoiceQueueOutbound(_0x292e5e[_0xabc1('0xbc')])&&isActive(_0x292e5e[_0xabc1('0x167')])){_0x292e5e['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0xabc1('0x40')](checkIsLoggedIn(_0x292e5e,_0x292e5e[_0xabc1('0x52')]))[_0xabc1('0x40')](checkIsActive(_0x292e5e,_0x292e5e['dialActive']))[_0xabc1('0x40')](checkInterval(_0x292e5e))[_0xabc1('0x40')](_0x2c5520[_0xabc1('0x168')](_0x292e5e))['then'](_0x2c5520[_0xabc1('0x146')](_0x292e5e[_0xabc1('0x169')],_0x292e5e['dialTimezone'],_0x292e5e[_0xabc1('0x43')],_0x292e5e))[_0xabc1('0x40')](_0x2c5520[_0xabc1('0x147')](_0x292e5e[_0xabc1('0x46')],_0x292e5e[_0xabc1('0x16a')],_0x292e5e[_0xabc1('0x43')],_0x292e5e))[_0xabc1('0x40')](_0x2c5520['checkDialMethod'](_0x292e5e))[_0xabc1('0xc8')](loggerCatchQueueSummary('[syncQueueSummary]',_0x292e5e));}else{notSendMessagesQueue(_0x292e5e);}}else{freeVariablesPredictive(_0x292e5e);if(_0x292e5e[_0xabc1('0x16b')]){_0x2c5520[_0xabc1('0x160')](_0x292e5e);}}};Dialer[_0xabc1('0xb4')]['syncCampaigns']=function(){var _0x48358=this;var _0x4f10e7;for(var _0x2ccf19 in this[_0xabc1('0x22')]){if(typeof this['campaigns'][_0x2ccf19]!==_0xabc1('0x9e')){_0x4f10e7=this['campaigns'][_0x2ccf19];if(isCampaignIvr(_0x4f10e7[_0xabc1('0xbc')])&&isActive(_0x4f10e7[_0xabc1('0x78')])){_0x4f10e7['sendMessageOneNotActive']=!![];BPromise[_0xabc1('0xc3')]()['then'](checkIsActive(_0x4f10e7,_0x4f10e7[_0xabc1('0x78')]))[_0xabc1('0x40')](checkInterval(_0x4f10e7))[_0xabc1('0x40')](_0x48358[_0xabc1('0x168')](_0x4f10e7))[_0xabc1('0x40')](_0x48358['checkIfTime'](_0x4f10e7[_0xabc1('0x169')],_0x4f10e7[_0xabc1('0x16a')],_0x4f10e7[_0xabc1('0x43')],_0x4f10e7))[_0xabc1('0x40')](_0x48358['checkIfTimeIntervals'](_0x4f10e7[_0xabc1('0x46')],_0x4f10e7[_0xabc1('0x16a')],_0x4f10e7[_0xabc1('0x43')],_0x4f10e7))[_0xabc1('0x40')](_0x48358[_0xabc1('0x165')](_0x4f10e7))[_0xabc1('0xc8')](loggerCatchQueueSummary(_0xabc1('0x16c'),_0x4f10e7));}else{notSendMessagesCampaign(_0x4f10e7);}}}};function getCallerIdRandom(_0xdbe9dd,_0x39df77){var _0x5282f5;var _0x1b232d;var _0x2f4559;if(_0x39df77<=0x0){_0x39df77=0x1;}_0x5282f5=new RegExp(_0xabc1('0x16d')+_0x39df77+'}$');_0x1b232d=Math[_0xabc1('0x16e')](0xa,_0x39df77-0x1);_0x2f4559=Math[_0xabc1('0x16e')](0xa,_0x39df77)-0x1;return util[_0xabc1('0x7b')]('%s',_[_0xabc1('0x16f')](_0xdbe9dd,_0x5282f5,_[_0xabc1('0x170')](_0x1b232d,_0x2f4559)));}function extractCalleridName(_0x17eefe){var _0x4083c6=_0x17eefe['match'](/"(.*?)"/);return _0x4083c6?_0x4083c6[0x1]:_0x17eefe;}function extractCalleridNumber(_0x44de8e){var _0xc6311=_0x44de8e[_0xabc1('0x171')](/<(.*?)>/);return _0xc6311?_0xc6311[0x1]:_0x44de8e;}Dialer['prototype'][_0xabc1('0x172')]=function(_0x4ef343,_0x1d6b52){var _0x31eba5=this;var _0x475d63=uuid['v4']();this[_0xabc1('0x27')][_0x475d63]=new Action(_0x4ef343,_0x1d6b52,_0x475d63);return new BPromise(function(_0x52ba17,_0x3a395a){if(_[_0xabc1('0x8a')](_0x4ef343)&&typeof _0x4ef343!==_0xabc1('0x173')){return _0x3a395a(msgResponse(_0xabc1('0x174'),_0xabc1('0x149'),_0xabc1('0x175')));}if(_[_0xabc1('0x8a')](_0x1d6b52['Contact'][_0xabc1('0x176')])||_0x1d6b52[_0xabc1('0x177')][_0xabc1('0x176')]===null){return _0x3a395a(msgResponse(_0xabc1('0x174'),_0xabc1('0x149'),_0xabc1('0x178')));}var _0x45da96={'XMD-CALLERID':_0x31eba5['actions'][_0x475d63][_0xabc1('0x179')](),'XMD-AGI':_0x4ef343[_0xabc1('0x110')]?util[_0xabc1('0x7b')](_0xabc1('0x17a'),ipAgi,_0x4ef343[_0xabc1('0x110')]):_0xabc1('0x17b'),'XMD-AGIAFTER':_0x4ef343[_0xabc1('0x11d')]?util[_0xabc1('0x7b')](_0xabc1('0x17a'),ipAgi,_0x4ef343['dialQueueProject2']):_0xabc1('0x17b'),'XMD-QUEUE':_0x4ef343['type']===_0xabc1('0x4e')?util[_0xabc1('0x7b')](_0xabc1('0x17c'),_0x4ef343[_0xabc1('0x43')],_0x4ef343[_0xabc1('0x17d')]||'',_0x4ef343['dialAgiAfterHangupAgent']?'c':'',_0x4ef343['dialQueueTimeout']||0x3):_0xabc1('0x17b'),'XMD-CONTACTID':_0x1d6b52[_0xabc1('0x109')],'XMD-CDRTYPE':_0xabc1('0x17e'),'CALLERID(all)':_0x31eba5['actions'][_0x475d63][_0xabc1('0x179')](),'XMD-AMD':_0x4ef343[_0xabc1('0xe6')]?_0xabc1('0x17f'):_0xabc1('0x17b'),'XMD-DESTINATION':_0xabc1('0x180')};if(_0x4ef343['dialAMDActive']){_0x45da96[_0xabc1('0x181')]=_0x4ef343['dialAMDInitialSilence']||0x9c4;_0x45da96[_0xabc1('0x182')]=_0x4ef343[_0xabc1('0x183')]||0x5dc;_0x45da96['XMD-AMDAFTERGREETINGSILENCE']=_0x4ef343[_0xabc1('0x184')]||0x320;_0x45da96['XMD-AMDTOTALANALYSISTIME']=_0x4ef343[_0xabc1('0x185')]||0x1388;_0x45da96[_0xabc1('0x186')]=_0x4ef343[_0xabc1('0x187')]||0x64;_0x45da96[_0xabc1('0x188')]=_0x4ef343['dialAMDBetweenWordsSilence']||0x32;_0x45da96['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x4ef343[_0xabc1('0x189')]||0x3;_0x45da96['XMD-AMDSILENCETHRESHOLD']=_0x4ef343[_0xabc1('0x18a')]||0x100;_0x45da96['XMD-AMDMAXIMUMWORDLENGTH']=_0x4ef343[_0xabc1('0x18b')]||0x1388;}if(_0x4ef343['type']===_0xabc1('0x4e')){_0x45da96[_0xabc1('0x18c')]=_0x1d6b52[_0xabc1('0x102')];}else{_0x45da96['XMD-CAMPAIGNID']=_0x1d6b52[_0xabc1('0x10a')];}for(var _0x546f54 in _0x1d6b52[_0xabc1('0x177')]){if(typeof _0x1d6b52['Contact'][_0x546f54]!==_0xabc1('0x9e')){if(isNotNull(_0x1d6b52[_0xabc1('0x177')][_0x546f54])&&_0x546f54!=='id'&&_0x546f54!==_0xabc1('0x18d')&&_0x546f54!==_0xabc1('0x18e')&&_0x546f54!=='updatedAt'){_0x45da96[util[_0xabc1('0x7b')](_0xabc1('0x18f'),_0xabc1('0x190'),_[_0xabc1('0x191')](_0x546f54))]=_0x1d6b52[_0xabc1('0x177')][_0x546f54];}}}var _0x25989e=_0x31eba5['isTrunkReachable'](_0x4ef343[_0xabc1('0x77')])?getCallerId(_0x4ef343['Trunk'][_0xabc1('0x79')],_0x4ef343[_0xabc1('0x192')],_0x4ef343[_0xabc1('0x193')]>0x0?getCallerIdRandom(_0x4ef343[_0xabc1('0x5a')],_0x4ef343[_0xabc1('0x193')]):_0x4ef343[_0xabc1('0x5a')]):getCallerId(_['isNil'](_0x4ef343[_0xabc1('0x143')])?_0x4ef343[_0xabc1('0x77')][_0xabc1('0x79')]:_0x4ef343['TrunkBackup']['callerid'],_0x4ef343[_0xabc1('0x192')],_0x4ef343[_0xabc1('0x193')]>0x0?getCallerIdRandom(_0x4ef343[_0xabc1('0x5a')],_0x4ef343[_0xabc1('0x193')]):_0x4ef343['dialOriginateCallerIdNumber']);if(_0x25989e){_0x45da96[_0xabc1('0x194')]=_0x31eba5[_0xabc1('0x27')][_0x475d63]['originatecalleridname']=extractCalleridName(_0x25989e);_0x45da96['XMD-ORIGINATECALLERIDNUM']=_0x31eba5[_0xabc1('0x27')][_0x475d63]['originatecalleridnum']=extractCalleridNumber(_0x25989e);}return ami['Action']({'actionid':_0x475d63,'action':_0xabc1('0x174'),'channel':_0x31eba5[_0xabc1('0xde')](_0x4ef343[_0xabc1('0x77')])?util[_0xabc1('0x7b')](_0xabc1('0x195'),_0x4ef343[_0xabc1('0x77')]['name'],isNotNull(_0x4ef343[_0xabc1('0x5c')])?_0x4ef343['dialPrefix'][_0xabc1('0x196')]()||'':'',_0x4ef343[_0xabc1('0x197')]>0x0?_0x1d6b52[_0xabc1('0x177')][_0xabc1('0x176')]['substring'](_0x4ef343['dialCutDigit']):_0x1d6b52[_0xabc1('0x177')][_0xabc1('0x176')]):util[_0xabc1('0x7b')](_0xabc1('0x195'),_['isNil'](_0x4ef343[_0xabc1('0x143')])?_0x4ef343[_0xabc1('0x77')]['name']:_0x4ef343[_0xabc1('0x143')]['name'],isNotNull(_0x4ef343['dialPrefix'])?_0x4ef343[_0xabc1('0x5c')][_0xabc1('0x196')]()||'':'',_0x4ef343[_0xabc1('0x197')]>0x0?_0x1d6b52[_0xabc1('0x177')]['phone'][_0xabc1('0x198')](_0x4ef343['dialCutDigit']):_0x1d6b52[_0xabc1('0x177')][_0xabc1('0x176')]),'callerid':_0x25989e,'Exten':_0xabc1('0x180'),'Context':_0xabc1('0x199'),'Priority':'1','variable':_0x45da96,'timeout':(_0x4ef343[_0xabc1('0x5b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x475d63})[_0xabc1('0x40')](function(_0x147848){return _0x52ba17(_0x147848);})[_0xabc1('0xc8')](function(_0x18cdc2){_0x4ef343['outboundOriginateFailureCallsDay']+=0x1;var _0x2932e3=new History(_0x31eba5[_0xabc1('0x27')][_0x475d63]);logger[_0xabc1('0x9b')](util[_0xabc1('0x7b')](_0xabc1('0x19a'),JSON['stringify'](_0x18cdc2)));_0x2932e3[_0xabc1('0xad')]=0xe;_0x2932e3[_0xabc1('0xae')]=_0xabc1('0x19b');_0x2932e3[_0xabc1('0xb0')]=moment()[_0xabc1('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');_0x2932e3[_0xabc1('0xaf')]=_0x2932e3['starttime'];_0x31eba5['createHistory'](_0x2932e3)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x19c')));_0x31eba5[_0xabc1('0xd1')](_0x2932e3)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x19c')))[_0xabc1('0x1f')](function(){delete _0x31eba5[_0xabc1('0x27')][_0x475d63];return _0x3a395a(msgResponse(_0xabc1('0x174'),_0xabc1('0x19d'),_0xabc1('0x19e')));});});});};Dialer['prototype'][_0xabc1('0x33')]=function(_0x30cbc9){var _0x27c44a=this[_0xabc1('0x27')][_0x30cbc9[_0xabc1('0x12c')]];if(_0x27c44a){delete this[_0xabc1('0x27')][_0x30cbc9[_0xabc1('0x12c')]];_0x27c44a[_0xabc1('0x19f')]=moment()[_0xabc1('0x7b')](_0xabc1('0x100'));var _0x178d8b=_0x27c44a[_0xabc1('0xbc')]===_0xabc1('0x7e')?this[_0xabc1('0x22')][_0x27c44a[_0xabc1('0xbd')]]:this[_0xabc1('0x21')][_0x27c44a[_0xabc1('0x1a0')]()];if(!this[_0xabc1('0xdc')](_0x30cbc9[_0xabc1('0x1a1')])){this['updateOriginated'](_0x178d8b);return this['callProgressDetecting'](_0x27c44a,_0x178d8b,_0x30cbc9)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x1a2')));}this['uniqueId'][_0x30cbc9[_0xabc1('0xe3')]]=_0x27c44a;}};Dialer[_0xabc1('0xb4')][_0xabc1('0x1a3')]=function(_0x5eed48,_0x7d70f3,_0x3c2600){var _0x5a6d78=new History(_0x7d70f3);if(_0x5a6d78[_0xabc1('0x1a4')]+_0x5a6d78['countcongestionretry']+_0x5a6d78[_0xabc1('0xf4')]+_0x5a6d78['countnosuchnumberretry']+_0x5a6d78[_0xabc1('0xf5')]+_0x5a6d78[_0xabc1('0xf6')]+_0x5a6d78[_0xabc1('0xf0')]+_0x5a6d78['countagentrejectretry']>=_0x3c2600[_0xabc1('0xf7')]-0x1){return!![];}switch(_0x5eed48){case 0x3:if(_0x5a6d78[_0xabc1('0xf4')]>=_0x3c2600[_0xabc1('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x5a6d78[_0xabc1('0xf4')]+=0x1,'scheduledat':moment()[_0xabc1('0xfd')](_0x3c2600[_0xabc1('0x1a6')],_0xabc1('0xff'))[_0xabc1('0x7b')](_0xabc1('0x100')),'ContactId':_0x5a6d78['ContactId'],'ListId':_0x5a6d78[_0xabc1('0x101')],'VoiceQueueId':_0x5a6d78['VoiceQueueId']||undefined,'CampaignId':_0x5a6d78['CampaignId']||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x1a7')));break;case 0x5:if(_0x5a6d78[_0xabc1('0x1a4')]>=_0x3c2600[_0xabc1('0x1a8')]-0x1){return!![];}this[_0xabc1('0xfc')]({'active':![],'countbusyretry':_0x5a6d78[_0xabc1('0x1a4')]+=0x1,'scheduledat':moment()[_0xabc1('0xfd')](_0x3c2600[_0xabc1('0x1a9')],'minutes')[_0xabc1('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5a6d78[_0xabc1('0x109')],'ListId':_0x5a6d78[_0xabc1('0x101')],'VoiceQueueId':_0x5a6d78[_0xabc1('0x102')]||undefined,'CampaignId':_0x5a6d78[_0xabc1('0x10a')]||undefined})['catch'](loggerCatch(_0xabc1('0x1aa')));break;case 0x8:if(_0x5a6d78['countcongestionretry']>=_0x3c2600[_0xabc1('0x1ab')]-0x1){return!![];}this[_0xabc1('0xfc')]({'active':![],'countcongestionretry':_0x5a6d78['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x3c2600[_0xabc1('0x1ac')],_0xabc1('0xff'))['format'](_0xabc1('0x100')),'ContactId':_0x5a6d78[_0xabc1('0x109')],'ListId':_0x5a6d78[_0xabc1('0x101')],'VoiceQueueId':_0x5a6d78[_0xabc1('0x102')]||undefined,'CampaignId':_0x5a6d78[_0xabc1('0x10a')]||undefined})['catch'](loggerCatch(_0xabc1('0x1ad')));break;case 0x0:if(_0x5a6d78[_0xabc1('0x1ae')]>=_0x3c2600[_0xabc1('0x1af')]-0x1){return!![];}else{this[_0xabc1('0xfc')]({'active':![],'countnosuchnumberretry':_0x5a6d78[_0xabc1('0x1ae')]+=0x1,'scheduledat':moment()[_0xabc1('0xfd')](_0x3c2600[_0xabc1('0x1b0')],_0xabc1('0xff'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5a6d78[_0xabc1('0x109')],'ListId':_0x5a6d78['ListId'],'VoiceQueueId':_0x5a6d78['VoiceQueueId']||undefined,'CampaignId':_0x5a6d78[_0xabc1('0x10a')]||undefined})[_0xabc1('0xc8')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x5a6d78['countdropretry']>=_0x3c2600[_0xabc1('0x11e')]-0x1){return!![];}this[_0xabc1('0xfc')]({'active':![],'countdropretry':_0x5a6d78['countdropretry']+=0x1,'scheduledat':moment()[_0xabc1('0xfd')](_0x3c2600[_0xabc1('0x120')],_0xabc1('0xff'))[_0xabc1('0x7b')](_0xabc1('0x100')),'ContactId':_0x5a6d78[_0xabc1('0x109')],'ListId':_0x5a6d78['ListId'],'VoiceQueueId':_0x5a6d78[_0xabc1('0x102')]||undefined,'CampaignId':_0x5a6d78[_0xabc1('0x10a')]||undefined})['catch'](loggerCatch(_0xabc1('0x121')));break;case 0xb:if(_0x5a6d78[_0xabc1('0xf6')]>=_0x3c2600[_0xabc1('0x125')]-0x1){return!![];}this[_0xabc1('0xfc')]({'active':![],'countabandonedretry':_0x5a6d78[_0xabc1('0xf6')]+=0x1,'scheduledat':moment()[_0xabc1('0xfd')](_0x3c2600[_0xabc1('0x126')],'minutes')[_0xabc1('0x7b')](_0xabc1('0x100')),'ContactId':_0x5a6d78[_0xabc1('0x109')],'ListId':_0x5a6d78[_0xabc1('0x101')],'VoiceQueueId':_0x5a6d78[_0xabc1('0x102')]||undefined,'CampaignId':_0x5a6d78[_0xabc1('0x10a')]||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x127')));break;case 0x13:if(_0x5a6d78[_0xabc1('0xf0')]>=_0x3c2600[_0xabc1('0xf9')]-0x1){return!![];}this[_0xabc1('0xfc')]({'active':![],'countmachineretry':_0x5a6d78[_0xabc1('0xf0')]+=0x1,'scheduledat':moment()[_0xabc1('0xfd')](_0x3c2600[_0xabc1('0xfe')],_0xabc1('0xff'))[_0xabc1('0x7b')](_0xabc1('0x100')),'ContactId':_0x5a6d78[_0xabc1('0x109')],'ListId':_0x5a6d78[_0xabc1('0x101')],'VoiceQueueId':_0x5a6d78['VoiceQueueId']||undefined,'CampaignId':_0x5a6d78[_0xabc1('0x10a')]||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x10b')));break;case 0x14:if(_0x5a6d78['countagentrejectretry']>=_0x3c2600[_0xabc1('0x1b1')]-0x1){return!![];}this[_0xabc1('0xfc')]({'active':![],'countagentrejectretry':_0x5a6d78[_0xabc1('0x107')]+=0x1,'scheduledat':moment()[_0xabc1('0xfd')](_0x3c2600['dialAgentRejectRetryFrequency'],_0xabc1('0xff'))[_0xabc1('0x7b')](_0xabc1('0x100')),'ContactId':_0x5a6d78[_0xabc1('0x109')],'ListId':_0x5a6d78['ListId'],'VoiceQueueId':_0x5a6d78[_0xabc1('0x102')]||undefined,'CampaignId':_0x5a6d78['CampaignId']||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x1b2')));break;default:return!![];}};Dialer[_0xabc1('0xb4')][_0xabc1('0x1b3')]=function(_0x55f74d,_0x32dbd3,_0x30eecb){var _0x43f7d9=this;var _0x47e9e5=new History(_0x55f74d);return new BPromise(function(_0x13e461,_0x37a62c){if(_[_0xabc1('0x8a')](_0x32dbd3)&&typeof _0x32dbd3!==_0xabc1('0x173')){return _0x37a62c(msgResponse(_0xabc1('0x1b4'),_0xabc1('0x149'),_0xabc1('0x1b5')));}if(_[_0xabc1('0x8a')](_0x30eecb)&&typeof _0x30eecb!=='object'){return _0x37a62c(msgResponse(_0xabc1('0x1b4'),_0xabc1('0x149'),_0xabc1('0x1b6')));}switch(_0x30eecb[_0xabc1('0x1b7')]){case'0':_0x32dbd3['outboundNoSuchCallsDay']+=0x1;_0x47e9e5[_0xabc1('0xad')]=0x0;_0x47e9e5[_0xabc1('0xae')]=_0xabc1('0x1b8');_0x47e9e5['countnosuchnumberretry']+=0x1;_0x47e9e5['countglobal']+=0x1;ami['emit'](_0xabc1('0x1b9'),ut['buildObj'](_0x55f74d,_0xabc1('0x1ba')));_0x43f7d9[_0xabc1('0xd2')](_0x47e9e5)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0xf2')));if(_0x43f7d9[_0xabc1('0x1a3')](0x0,_0x55f74d,_0x32dbd3)){if(_0x47e9e5['countnosuchnumberretry']>=_0x32dbd3[_0xabc1('0x1af')]){_0x43f7d9['createStateFinal'](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1bb'));}else{_0x43f7d9['stateGlobal'](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1bb'));}}break;case'3':_0x32dbd3[_0xabc1('0x64')]+=0x1;_0x47e9e5[_0xabc1('0xad')]=0x3;_0x47e9e5[_0xabc1('0xae')]=_0xabc1('0x1bc');_0x47e9e5[_0xabc1('0xf4')]+=0x1;_0x47e9e5['countglobal']+=0x1;ami[_0xabc1('0x4d')](_0xabc1('0x1bd'),ut[_0xabc1('0xeb')](_0x55f74d,_0xabc1('0x1be')));_0x43f7d9[_0xabc1('0xd2')](_0x47e9e5)['catch'](loggerCatch(_0xabc1('0x1bf')));if(_0x43f7d9[_0xabc1('0x1a3')](0x3,_0x55f74d,_0x32dbd3)){if(_0x47e9e5[_0xabc1('0xf4')]>=_0x32dbd3[_0xabc1('0x1a5')]){_0x43f7d9['createStateFinal'](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1c0'));}else{_0x43f7d9[_0xabc1('0x108')](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1c0'));}}break;case'5':_0x32dbd3[_0xabc1('0x5f')]+=0x1;_0x47e9e5[_0xabc1('0xad')]=0x5;_0x47e9e5['statedesc']=_0xabc1('0x1c1');_0x47e9e5[_0xabc1('0x1a4')]+=0x1;_0x47e9e5[_0xabc1('0xf1')]+=0x1;ami[_0xabc1('0x4d')](_0xabc1('0x1c2'),ut[_0xabc1('0xeb')](_0x55f74d,'busy'));_0x43f7d9['createHistory'](_0x47e9e5)['catch'](loggerCatch(_0xabc1('0x1c3')));if(_0x43f7d9[_0xabc1('0x1a3')](0x5,_0x55f74d,_0x32dbd3)){if(_0x47e9e5['countbusyretry']>=_0x32dbd3[_0xabc1('0x1a8')]){_0x43f7d9[_0xabc1('0xfa')](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1c4'));}else{_0x43f7d9[_0xabc1('0x108')](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1c4'));}}break;case'8':_0x32dbd3['outboundCongestionCallsDay']+=0x1;_0x47e9e5[_0xabc1('0xad')]=0x8;_0x47e9e5['statedesc']=_0xabc1('0x1c5');_0x47e9e5[_0xabc1('0xf3')]+=0x1;_0x47e9e5[_0xabc1('0xf1')]+=0x1;ami[_0xabc1('0x4d')](_0xabc1('0x1c6'),ut['buildObj'](_0x55f74d,_0xabc1('0x1c7')));_0x43f7d9[_0xabc1('0xd2')](_0x47e9e5)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x1c8')));if(_0x43f7d9[_0xabc1('0x1a3')](0x8,_0x55f74d,_0x32dbd3)){if(_0x47e9e5[_0xabc1('0xf3')]>=_0x32dbd3[_0xabc1('0x1ab')]){_0x43f7d9['createStateFinal'](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1c9'));}else{_0x43f7d9[_0xabc1('0x108')](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1c9'));}}break;case'11':_0x32dbd3[_0xabc1('0x1ca')]+=0x1;_0x47e9e5['state']=0xb;_0x47e9e5[_0xabc1('0xae')]=_0xabc1('0x1cb');_0x47e9e5['countabandonedretry']+=0x1;_0x47e9e5[_0xabc1('0xf1')]+=0x1;_0x43f7d9[_0xabc1('0xd2')](_0x47e9e5)['catch'](loggerCatch(_0xabc1('0x129')));if(_0x43f7d9[_0xabc1('0x1a3')](0xb,_0x55f74d,_0x32dbd3)){if(_0x47e9e5['countabandonedretry']>=_0x32dbd3[_0xabc1('0x125')]){_0x43f7d9['createStateFinal'](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1cc'));}else{_0x43f7d9[_0xabc1('0x108')](_0x47e9e5,_0x13e461,_0x37a62c,'reason\x2011\x20abandoned');}}break;case'20':_0x32dbd3[_0xabc1('0x68')]+=0x1;_0x47e9e5[_0xabc1('0xad')]=0x14;_0x47e9e5[_0xabc1('0xae')]='AgentReject';_0x47e9e5['countagentrejectretry']+=0x1;_0x47e9e5[_0xabc1('0xf1')]+=0x1;ami[_0xabc1('0x4d')](_0xabc1('0x1cd'),ut[_0xabc1('0xeb')](_0x55f74d,_0xabc1('0x1ce')));_0x43f7d9['createHistory'](_0x47e9e5)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x43f7d9[_0xabc1('0x1a3')](0x14,_0x55f74d,_0x32dbd3)){if(_0x47e9e5[_0xabc1('0x107')]>=_0x32dbd3[_0xabc1('0x1b1')]){_0x43f7d9['createStateFinal'](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1cf'));}else{_0x43f7d9[_0xabc1('0x108')](_0x47e9e5,_0x13e461,_0x37a62c,_0xabc1('0x1cf'));}}break;default:_0x32dbd3['outboundUnknownCallsDay']+=0x1;_0x47e9e5['state']=0xc;_0x47e9e5['statedesc']=_0x30eecb['reason'];_0x43f7d9['createHistory'](_0x47e9e5)[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x1d0')));if(_0x43f7d9['checkRetriveMax'](_0x30eecb[_0xabc1('0x1b7')],_0x55f74d,_0x32dbd3)){if(_0x47e9e5['countbusyretry']+_0x47e9e5[_0xabc1('0xf3')]+_0x47e9e5[_0xabc1('0xf4')]+_0x47e9e5[_0xabc1('0x1ae')]+_0x47e9e5[_0xabc1('0xf5')]+_0x47e9e5[_0xabc1('0xf6')]+_0x47e9e5['countmachineretry']+_0x47e9e5[_0xabc1('0x107')]>=_0x32dbd3[_0xabc1('0xf7')]){_0x43f7d9['stateGlobal'](_0x47e9e5,_0x13e461,_0x37a62c,_0x30eecb[_0xabc1('0x1b7')]);}else{_0x43f7d9[_0xabc1('0xfa')](_0x47e9e5,_0x13e461,_0x37a62c,_0x30eecb[_0xabc1('0x1b7')]);}}}});};Dialer['prototype'][_0xabc1('0x108')]=function(_0xab57c,_0x5ce931,_0x55fbc2,_0xfaa27f){var _0x22d8d2=new Final(_0xab57c);_0x22d8d2['state']=0xf;_0x22d8d2[_0xabc1('0xae')]=_0xabc1('0x1d1');this['createStateFinal'](_0x22d8d2,_0x5ce931,_0x55fbc2,_0xfaa27f);};Dialer[_0xabc1('0xb4')][_0xabc1('0xfa')]=function(_0x59f270,_0x4c1dfe,_0x4ec47c,_0xda0fb8){this[_0xabc1('0xd1')](_0x59f270)[_0xabc1('0x40')](function(){return _0x4c1dfe(msgResponse(_0xabc1('0x1b4'),_0xabc1('0xdd'),_0xda0fb8));})[_0xabc1('0xc8')](function(){return _0x4ec47c(msgResponse('[moveContactManagedDialer][0]','Failure',_0xabc1('0x1d2')));});};Dialer[_0xabc1('0xb4')]['predictive']=function(_0x50e13c){var _0x3d8b70=_0x50e13c[_0xabc1('0x1d3')]/0x64;var _0x5d1ef2=_0x50e13c[_0xabc1('0x63')]/(_0x50e13c[_0xabc1('0x63')]+_0x50e13c[_0xabc1('0x5e')]);var _0xdc2764=Math[_0xabc1('0x1d4')](_0x50e13c[_0xabc1('0x1d5')]*(_0x50e13c['predictiveIntervalMaxThreshold']/0x64));var _0xea87c6=Math[_0xabc1('0x1d4')](_0x50e13c[_0xabc1('0x1d5')]*(_0x50e13c[_0xabc1('0x1d6')]/0x64));var _0x5bc54f=_0x50e13c[_0xabc1('0x51')]+_0x50e13c[_0xabc1('0x56')];var _0x4239a8=Math['floor'](_0x50e13c[_0xabc1('0x8f')]*_0x50e13c[_0xabc1('0x74')]*_0x50e13c[_0xabc1('0x6e')]*_0x50e13c[_0xabc1('0x6f')]);if(_['isUndefined'](_0x50e13c[_0xabc1('0x76')])){if(!_[_0xabc1('0x8a')](_0x50e13c[_0xabc1('0x2a')])){_0x50e13c[_0xabc1('0x2a')]=undefined;loggerPredictive[_0xabc1('0x9b')](_0xabc1('0x1d7'),_0xabc1('0x1d8'));}if(!_['isUndefined'](_0x50e13c[_0xabc1('0x97')])){loggerPredictive[_0xabc1('0x9b')](_0xabc1('0x1d7'),_0xabc1('0x1d9'));clearInterval(_0x50e13c[_0xabc1('0x97')]);_0x50e13c[_0xabc1('0x97')]=undefined;}_0x50e13c[_0xabc1('0x76')]=moment()[_0xabc1('0x7b')](_0xabc1('0x100'));loggerPredictive[_0xabc1('0x81')](_0x50e13c[_0xabc1('0x43')],_0xabc1('0x1da'),_0x50e13c['startProgressive']);this['handlePower'](_0x50e13c,0x1);}else if(ifInterval(_0x50e13c[_0xabc1('0x1db')],_0x50e13c[_0xabc1('0x76')])){this[_0xabc1('0x15e')](_0x50e13c,0x1);loggerPredictiveCalls[_0xabc1('0x81')]('[startMethodPredictive][StartProgressive][Loop]',_0x50e13c[_0xabc1('0x76')],_0x50e13c[_0xabc1('0x43')]);_0x50e13c[_0xabc1('0x8f')]=0x0;_0x50e13c[_0xabc1('0x6d')]=0x0;}else if(_0x3d8b70<_0x5d1ef2&&_0x50e13c['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x50e13c);loggerPredictive['info'](_0xabc1('0x1dc'),_0xabc1('0x1dd'),_0x5d1ef2,_0xabc1('0x76'),_0x50e13c[_0xabc1('0x43')]);}else if(_0x4239a8<_0x50e13c[_0xabc1('0x6d')]&&_0x50e13c['dialPredictiveOptimization']===_0xabc1('0x1de')){freeVariablesPredictive(_0x50e13c);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x1df'),'Max\x20Drop\x20',_0x4239a8,_0xabc1('0x1e0'),_0x50e13c[_0xabc1('0x6d')],_0xabc1('0x76'),_0x50e13c['name']);}else if(!ifInterval(_0x50e13c['dialPredictiveInterval'],_0x50e13c[_0xabc1('0x76')])&&_[_0xabc1('0x8a')](_0x50e13c[_0xabc1('0x2a')])&&!_[_0xabc1('0x8a')](_0x50e13c[_0xabc1('0x76')])){_0x50e13c['startPredictive']=moment()[_0xabc1('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xabc1('0x81')](_0x50e13c[_0xabc1('0x43')],_0xabc1('0x1e1'),_0x50e13c[_0xabc1('0x2a')]);this['averageHandleTime'](_0x50e13c[_0xabc1('0x1db')])['then'](this[_0xabc1('0x1e2')](_0x50e13c))[_0xabc1('0x40')](mergeDataErlangB(_0x50e13c))['then'](this['startMethodPredictive'](_0x50e13c))['catch'](loggerCatchPredictive(_0xabc1('0x1e3'),_0x50e13c));}else if(!ifInterval(_0x50e13c[_0xabc1('0x1db')],_0x50e13c[_0xabc1('0x2a')])){_0x50e13c[_0xabc1('0x6d')]=0x0;_0x50e13c[_0xabc1('0x2a')]=moment()['format'](_0xabc1('0x100'));loggerPredictive[_0xabc1('0x81')](_0x50e13c[_0xabc1('0x43')],_0xabc1('0x1e4'),_0x50e13c[_0xabc1('0x2a')]);clearInterval(_0x50e13c[_0xabc1('0x97')]);_0x50e13c[_0xabc1('0x97')]=undefined;this[_0xabc1('0xc6')](_0x50e13c['dialPredictiveInterval'])[_0xabc1('0x40')](this['getDataPredictive'](_0x50e13c))[_0xabc1('0x40')](mergeDataErlangB(_0x50e13c))[_0xabc1('0x40')](this[_0xabc1('0x1e5')](_0x50e13c))[_0xabc1('0xc8')](loggerCatchPredictive(_0xabc1('0x1e6'),_0x50e13c));}else if(_0x50e13c['predictiveIntervalAvailable']&&_0x5bc54f<_0x50e13c['predictiveIntervalAvailable']-_0xea87c6){freeVariablesPredictive(_0x50e13c);loggerPredictive['info'](_0x50e13c[_0xabc1('0x43')],_0xabc1('0x1e7'),_0x5bc54f,_0xabc1('0x1e8'),_0x50e13c[_0xabc1('0x1d5')],'-',_0xea87c6,'=',_0x50e13c['predictiveIntervalAvailable']-_0xea87c6,')');}else if(_0x50e13c[_0xabc1('0x1d5')]&&_0x5bc54f>_0x50e13c[_0xabc1('0x1d5')]+_0xdc2764){freeVariablesPredictive(_0x50e13c);loggerPredictive[_0xabc1('0x81')](_0x50e13c['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5bc54f,')\x20are\x20more\x20than\x20threshold\x20(',_0x50e13c[_0xabc1('0x1d5')],'+',_0xdc2764,'=',_0x50e13c[_0xabc1('0x1d5')]+_0xdc2764,')');}};Dialer['prototype'][_0xabc1('0x1e2')]=function(_0x58423f){var _0x1deb15=this;return function(_0x1fab27){return new BPromise(function(_0x57e1a2,_0x2d0d9d){_[_0xabc1('0x93')](_0x58423f,_0x1fab27[0x0]);if(checkGetDataPredictive(_0x1fab27[0x0])){var _0x3d5ab9=_0x58423f[_0xabc1('0x1d5')]=_0x58423f[_0xabc1('0x56')]+_0x58423f[_0xabc1('0x51')];var _0x34d3b1=_0x58423f[_0xabc1('0x1db')]*0x3c;var _0x326a7a=_0x1fab27[0x0][_0xabc1('0x88')]+_0x1fab27[0x0][_0xabc1('0x6a')];var _0x36dcd2=(_0x1fab27[0x0][_0xabc1('0x84')]+_0x1fab27[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1fab27[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1fab27[0x0][_0xabc1('0x71')];_0x58423f['predictiveIntervalHitRate']=_0x36dcd2>0x0?_0x36dcd2:0x1;switch(_0x58423f[_0xabc1('0x1e9')]){case _0xabc1('0x1de'):var _0x393a95=_0x58423f['dialPredictiveOptimizationPercentage']/0x64;return _0x1deb15[_0xabc1('0x1ea')](_0x3d5ab9,_0x34d3b1,_0x326a7a,_0x36dcd2,_0x393a95)[_0xabc1('0x40')](function(_0xe75075){return _0x57e1a2(_0xe75075);});case _0xabc1('0x1eb'):var _0x59a214=_0x58423f[_0xabc1('0x1d3')]/0x64;return _0x1deb15[_0xabc1('0x1ec')](_0x3d5ab9,_0x34d3b1,_0x326a7a,_0x36dcd2,_0x59a214)[_0xabc1('0x40')](function(_0x180ce1){return _0x57e1a2(_0x180ce1);});default:return _0x2d0d9d(msgResponse('[getDataPredictive]',_0xabc1('0x149'),_0xabc1('0x1ed')));}}else{return _0x2d0d9d(msgResponse(_0xabc1('0x1ee'),_0xabc1('0x149'),_0xabc1('0x1ef')));}});};};Dialer[_0xabc1('0xb4')][_0xabc1('0x1f0')]=function(_0x43a333){var _0x56f191=this;return function(_0x8c6ad0){return new BPromise(function(_0x5a2ee4,_0xb178be){_[_0xabc1('0x93')](_0x43a333,_0x8c6ad0[0x0]);if(checkGetDataPredictive(_0x8c6ad0[0x0])){loggerPredictive['info'](JSON[_0xabc1('0x7a')](_0x8c6ad0[0x0]));if(_0x43a333[_0xabc1('0x1e9')]==='dropRate'){return _0x56f191[_0xabc1('0xcf')](_0x43a333['id'])[_0xabc1('0x40')](function(_0x23cf1d){var _0x3ad709=_0x43a333[_0xabc1('0x52')]-_0x23cf1d[0x0]['outboundQueuePauses'];var _0x319628=_0x43a333[_0xabc1('0x1db')]*0x3c;var _0x4640a9=_0x8c6ad0[0x0][_0xabc1('0x88')]+_0x8c6ad0[0x0][_0xabc1('0x6a')];var _0x48d19d=(_0x8c6ad0[0x0][_0xabc1('0x84')]+_0x8c6ad0[0x0][_0xabc1('0x6c')]+_0x8c6ad0[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x8c6ad0[0x0][_0xabc1('0x71')];var _0x356b2b=_0x43a333[_0xabc1('0x1d3')]/0x64;_0x43a333[_0xabc1('0x70')]=_0x23cf1d[0x0]['outboundQueuePauses']||0x0;_0x43a333['predictiveIntervalHitRate']=_0x48d19d>0x0?_0x48d19d:0x1;return _0x56f191[_0xabc1('0x1ea')](_0x3ad709,_0x319628,_0x4640a9,_0x48d19d,_0x356b2b);})[_0xabc1('0x40')](function(_0x23068f){return _0x5a2ee4(_0x23068f);})['catch'](function(_0x2c7884){return _0xb178be(msgResponse(_0xabc1('0x1f1'),_0xabc1('0x149'),JSON[_0xabc1('0x7a')](_0x2c7884)));});}if(_0x43a333[_0xabc1('0x1e9')]===_0xabc1('0x1eb')){return _0x56f191[_0xabc1('0xcf')](_0x43a333['id'])['then'](function(_0x224f10){var _0x2ea0e4=_0x43a333[_0xabc1('0x52')]-_0x224f10[0x0]['outboundQueuePauses'];var _0x1bcb57=_0x43a333['dialPredictiveInterval']*0x3c;var _0x11c954=_0x8c6ad0[0x0][_0xabc1('0x88')]+_0x8c6ad0[0x0][_0xabc1('0x6a')];var _0x539916=(_0x8c6ad0[0x0][_0xabc1('0x84')]+_0x8c6ad0[0x0][_0xabc1('0x6c')]+_0x8c6ad0[0x0][_0xabc1('0x6b')])/_0x8c6ad0[0x0][_0xabc1('0x71')];var _0x3f5626=_0x43a333[_0xabc1('0x1d3')]/0x64;_0x43a333[_0xabc1('0x70')]=_0x224f10[0x0][_0xabc1('0x1f2')]||0x0;_0x43a333[_0xabc1('0x6e')]=_0x539916>0x0?_0x539916:0x1;return _0x56f191[_0xabc1('0x1ec')](_0x2ea0e4,_0x1bcb57,_0x11c954,_0x539916,_0x3f5626);})[_0xabc1('0x40')](function(_0x5e91a1){return _0x5a2ee4(_0x5e91a1);})['catch'](function(_0x5458c6){return _0xb178be(msgResponse(_0xabc1('0x1f1'),_0xabc1('0x149'),JSON[_0xabc1('0x7a')](_0x5458c6)));});}}else{return _0xb178be(msgResponse(_0xabc1('0x1ee'),_0xabc1('0x149'),_0xabc1('0x1ef')));}});};};Dialer[_0xabc1('0xb4')][_0xabc1('0x1e5')]=function(_0x4673e7){var _0x1f2a60=this;return function(){var _0x3ddb63=0x0;var _0x2301af=Math['floor'](_0x4673e7[_0xabc1('0x73')]*0x3e8);if(_0x2301af>0x0){_0x2301af=_0x2301af<0x64?0x64:_0x2301af;loggerPredictive['info'](_0x4673e7[_0xabc1('0x43')],_0xabc1('0x1f3'),_0x2301af,_0xabc1('0x4b'));_0x4673e7[_0xabc1('0x97')]=setInterval(function(){_0x1f2a60['handlePredictive'](_0x4673e7);loggerPredictiveCalls[_0xabc1('0x81')](_0xabc1('0x1f4'),_0x3ddb63+=0x1);},_0x2301af);}else{loggerPredictive[_0xabc1('0x81')](_0x4673e7[_0xabc1('0x43')],_0xabc1('0x1f5'));}};};Dialer[_0xabc1('0xb4')][_0xabc1('0x1f6')]=function(_0x10e12c,_0x49dd5b){var _0x3cab82=this;return function(_0x36fbcc){if(_['isEmpty'](_0x36fbcc)){if(_[_0xabc1('0xb7')](_0x49dd5b[_0xabc1('0xd9')])||!_0x49dd5b[_0xabc1('0x1f7')]){if(_0x10e12c[_0xabc1('0x59')]===_0xabc1('0x8')){_0x10e12c['queueStatusComplete']=_[_0xabc1('0x8a')](_0x10e12c[_0xabc1('0x132')])?!![]:_0x10e12c[_0xabc1('0x132')];var _0x15545d=uuid['v4']();_0x3cab82[_0xabc1('0x27')][_0x15545d]=new Action(_0x10e12c,_0x49dd5b,_0x15545d);loggerBooked['info'](_0xabc1('0x1f8'),_0x15545d,'queueStatusComplete:\x20',JSON[_0xabc1('0x7a')](_0x10e12c[_0xabc1('0x132')]),_0xabc1('0x1f9'),_0x10e12c['name']);if(_0x10e12c['queueStatusComplete']){_0x10e12c['queueStatusComplete']=![];_0x3cab82[_0xabc1('0x2c')][_0x3cab82['actions'][_0x15545d]['queue']]=[];ami[_0xabc1('0xb8')]({'actionid':_0x15545d,'action':'queuestatus','queue':_0x10e12c['name']})[_0xabc1('0xc8')](function(){_0x3cab82[_0xabc1('0xd6')](_0x10e12c);_0x3cab82[_0xabc1('0xfc')]({'active':![],'ContactId':_0x3cab82[_0xabc1('0x27')][_0x15545d]['ContactId'],'ListId':_0x3cab82[_0xabc1('0x27')][_0x15545d]['ListId'],'VoiceQueueId':_0x3cab82[_0xabc1('0x27')][_0x15545d][_0xabc1('0x102')]||undefined,'CampaignId':_0x3cab82[_0xabc1('0x27')][_0x15545d][_0xabc1('0x10a')]||undefined})['catch'](loggerCatch(_0xabc1('0x1fa')));delete _0x3cab82[_0xabc1('0x27')][_0x15545d];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON['stringify'](_0x10e12c[_0xabc1('0x132')]),'Queue:\x20',_0x10e12c[_0xabc1('0x43')]);_0x3cab82[_0xabc1('0xd6')](_0x10e12c);_0x3cab82['rescheduleContact']({'active':![],'ContactId':_0x3cab82['actions'][_0x15545d]['ContactId'],'ListId':_0x3cab82[_0xabc1('0x27')][_0x15545d][_0xabc1('0x101')],'VoiceQueueId':_0x3cab82[_0xabc1('0x27')][_0x15545d]['VoiceQueueId']||undefined,'CampaignId':_0x3cab82[_0xabc1('0x27')][_0x15545d][_0xabc1('0x10a')]||undefined})[_0xabc1('0xc8')](loggerCatch(_0xabc1('0x1fa')));delete _0x3cab82['actions'][_0x15545d];}}else{return _0x3cab82['actionOriginate'](_0x10e12c,_0x49dd5b);}}else{if(getDiff(_0x49dd5b[_0xabc1('0x1fb')])<_0x10e12c[_0xabc1('0x1fc')]*0x3c){if(_0x49dd5b[_0xabc1('0x162')]&&!_0x49dd5b[_0xabc1('0x162')][_0xabc1('0x1fd')]){_0x3cab82[_0xabc1('0x20')]['run'](_0x49dd5b['id'])[_0xabc1('0x1f')](function(){_0x3cab82[_0xabc1('0xd6')](_0x10e12c);});}else{_0x3cab82['unlockContact']({'active':![]},_0x49dd5b['id'],0x1)[_0xabc1('0x1f')](function(){_0x3cab82[_0xabc1('0xd6')](_0x10e12c);});}}else{_0x10e12c[_0xabc1('0x67')]+=0x1;_0x3cab82[_0xabc1('0xd6')](_0x10e12c);if(_0x10e12c[_0xabc1('0x1fe')]){_0x3cab82[_0xabc1('0xfc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x49dd5b[_0xabc1('0x109')],'ListId':_0x49dd5b[_0xabc1('0x101')],'VoiceQueueId':_0x49dd5b[_0xabc1('0x102')]||undefined,'CampaignId':_0x49dd5b['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3cab82[_0xabc1('0xd2')](createObjHistory(_0x10e12c,_0x49dd5b,_0xabc1('0x1ff'),0x17,'RecallInQueue'))[_0xabc1('0xc8')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x3cab82[_0xabc1('0xe2')](createObjHistory(_0x10e12c,_0x49dd5b,_0xabc1('0x200'),0x16,_0xabc1('0x201')),_0xabc1('0x202'),'[Originate][HistoryRecallClose]');}}}}else{_0x10e12c['outboundBlacklistCallsDay']+=0x1;_0x3cab82[_0xabc1('0xe2')](createObjHistory(_0x10e12c,_0x49dd5b,'BLACKLIST',0xd,_0xabc1('0x203')),_0xabc1('0x204'),_0xabc1('0x205'));throw'inBlackList';}};};Dialer['prototype'][_0xabc1('0x166')]=function(_0x1b470a){var _0x5904fe=this;var _0x4e8049=_0x1b470a[_0xabc1('0x206')]-_0x1b470a[_0xabc1('0x72')]-_0x1b470a[_0xabc1('0xcb')];emitCampaignSummary(_0x1b470a);if(_0x4e8049>0x0){if(_0x4e8049>this[_0xabc1('0x25')]){_0x4e8049=this[_0xabc1('0x25')];}_0x1b470a[_0xabc1('0xcb')]+=_0x4e8049;this[_0xabc1('0xcd')](_0x1b470a['id'],_0x4e8049,_0x1b470a[_0xabc1('0x207')],_0x1b470a)['then'](function(_0x1f9dde){_0x1b470a['temp']-=_0x4e8049;_0x1b470a[_0xabc1('0xcb')]=_0x1b470a[_0xabc1('0xcb')]>0x0?_0x1b470a[_0xabc1('0xcb')]:0x0;if(!checkContactEmpty(_0x1f9dde)){_0x1b470a[_0xabc1('0x41')]=_0xabc1('0xa4');logger[_0xabc1('0x81')]('[getContactCampaign2][Empty]'+_0x1b470a[_0xabc1('0x43')]);}else{_0x1b470a[_0xabc1('0x72')]+=_0x1f9dde[_0xabc1('0x137')];_0x1b470a[_0xabc1('0x41')]=_0xabc1('0x208');for(var _0x1e2263=0x0;_0x1e2263<_0x1f9dde[_0xabc1('0x137')];_0x1e2263+=0x1){_0x1b470a[_0xabc1('0x209')]+=0x1;if(_[_0xabc1('0xb7')](_0x1f9dde[_0x1e2263])||_[_0xabc1('0xb7')](_0x1f9dde[_0x1e2263][_0xabc1('0x177')])||_[_0xabc1('0xb7')](_0x1f9dde[_0x1e2263][_0xabc1('0x177')][_0xabc1('0x176')])){_0x5904fe[_0xabc1('0x20a')](_0xabc1('0x20b'),_0x1b470a,_0x1f9dde[_0x1e2263]);}else{_0x5904fe['checkIsBlackListIvr'](_['pick'](_0x1f9dde[_0x1e2263],[_0xabc1('0x10a'),_0xabc1('0x20c')]))[_0xabc1('0x40')](_0x5904fe[_0xabc1('0x1f6')](_0x1b470a,_0x1f9dde[_0x1e2263]))['catch'](_0x5904fe[_0xabc1('0xd5')](_0xabc1('0x20d'),_0x1b470a));}}}})[_0xabc1('0xc8')](loggerGetContactDialer(_0xabc1('0x20e'),_0x1b470a,_0x4e8049));}};Dialer[_0xabc1('0xb4')][_0xabc1('0x15e')]=function(_0x3022ff,_0x42efc5){var _0x315c05=this;var _0x4dc56f=[];var _0x165195=_0x42efc5>=0x1?_0x42efc5:0x1;if(_0x3022ff[_0xabc1('0x59')]===_0xabc1('0x8')){_0x165195=0x1;}var _0x5ad47c=Math[_0xabc1('0x20f')](_0x3022ff[_0xabc1('0x51')]*_0x165195)-_0x3022ff[_0xabc1('0x72')]-_0x3022ff['temp'];emitVoiceQueueSummary(_0x3022ff);if(_0x3022ff[_0xabc1('0x210')]>0x0){var _0x24533e=_0x3022ff[_0xabc1('0x210')]-_0x3022ff[_0xabc1('0x72')]-_0x3022ff[_0xabc1('0x56')]-_0x3022ff[_0xabc1('0xcb')]-_0x3022ff[_0xabc1('0xa7')];if(_0x5ad47c>_0x24533e){_0x5ad47c=_0x24533e;}}if(_0x5ad47c>0x0){if(_0x3022ff[_0xabc1('0x59')]===_0xabc1('0x8')){_0x5ad47c=0x1;}if(_0x5ad47c>this[_0xabc1('0x25')]){_0x5ad47c=this['maxNumberOriginate'];}_0x3022ff['temp']+=_0x5ad47c;for(var _0x2e31ea in this['agents']){if(typeof this['agents'][_0x2e31ea]!==_0xabc1('0x9e')){if(this['agents'][_0x2e31ea][_0xabc1('0xad')]===_0xabc1('0x211')&&this[_0xabc1('0x23')][_0x2e31ea][_0xabc1('0xb9')]===_0xabc1('0xe0')){_0x4dc56f[_0xabc1('0x12f')](this[_0xabc1('0x23')][_0x2e31ea]['id']);}}}this[_0xabc1('0x212')](_0x3022ff['id'],_0x4dc56f,_0x5ad47c,_0x3022ff['dialOrderByScheduledAt'],_0x3022ff)[_0xabc1('0x40')](function(_0x112350){_0x3022ff[_0xabc1('0xcb')]-=_0x5ad47c;_0x3022ff[_0xabc1('0xcb')]=_0x3022ff[_0xabc1('0xcb')]>0x0?_0x3022ff[_0xabc1('0xcb')]:0x0;if(!checkContactEmpty(_0x112350)){_0x315c05[_0xabc1('0xc0')](_0x3022ff)['then'](sendMessageReschedule(_0x3022ff))[_0xabc1('0xc8')](loggerCatch('[countReScheduled]\x20'));}else{_0x3022ff[_0xabc1('0x72')]+=_0x112350[_0xabc1('0x137')];_0x3022ff[_0xabc1('0x41')]=_0x3022ff['dialMethod']===_0xabc1('0x8')?_0xabc1('0x17f'):_0xabc1('0x208');for(var _0x1e20ea=0x0;_0x1e20ea<_0x112350[_0xabc1('0x137')];_0x1e20ea+=0x1){if(_['isNil'](_0x112350[_0x1e20ea])||_['isNil'](_0x112350[_0x1e20ea][_0xabc1('0x177')])||_[_0xabc1('0xb7')](_0x112350[_0x1e20ea][_0xabc1('0x177')][_0xabc1('0x176')])){_0x315c05['emptyContact'](_0xabc1('0x20b'),_0x3022ff,_0x112350[_0x1e20ea]);}else{_0x315c05[_0xabc1('0xc2')](_['pick'](_0x112350[_0x1e20ea],[_0xabc1('0x102'),_0xabc1('0x20c')]))[_0xabc1('0x40')](_0x315c05[_0xabc1('0x1f6')](_0x3022ff,_0x112350[_0x1e20ea]))['catch'](_0x315c05['loggerHandler']('[actionOriginate]\x20',_0x3022ff));}}}})[_0xabc1('0xc8')](loggerGetContactDialer(_0xabc1('0x213'),_0x3022ff,_0x5ad47c));}};Dialer['prototype'][_0xabc1('0x97')]=function(_0x59b26b){if(_0x59b26b[_0xabc1('0x210')]>0x0){var _0x38a538=_0x59b26b['dialLimitQueue']-_0x59b26b[_0xabc1('0x72')]-_0x59b26b['talking'];if(_0x38a538>0x0){this[_0xabc1('0x214')](_0x59b26b);}else{loggerPredictiveCalls[_0xabc1('0x81')](_0xabc1('0x215'));}}else{this[_0xabc1('0x214')](_0x59b26b);}};Dialer[_0xabc1('0xb4')][_0xabc1('0x214')]=function(_0x44f792){var _0x44db8b=this;var _0x528d7a=[];_0x44f792[_0xabc1('0x72')]+=0x1;for(var _0x4a1c90 in this[_0xabc1('0x23')]){if(typeof this['agents'][_0x4a1c90]!==_0xabc1('0x9e')){if(this['agents'][_0x4a1c90][_0xabc1('0xad')]===_0xabc1('0x211')&&this['agents'][_0x4a1c90][_0xabc1('0xb9')]===_0xabc1('0xe0')){_0x528d7a[_0xabc1('0x12f')](this[_0xabc1('0x23')][_0x4a1c90]['id']);}}}this[_0xabc1('0x212')](_0x44f792['id'],_0x528d7a,0x1,_0x44f792[_0xabc1('0x207')],_0x44f792)[_0xabc1('0x40')](function(_0x4df265){if(!checkContactEmpty(_0x4df265)){checkContactLowerLimitOriginate(_0x44f792,0x1,0x0);_0x44db8b[_0xabc1('0xc0')](_0x44f792)[_0xabc1('0x40')](sendMessageReschedule(_0x44f792))[_0xabc1('0xc8')](loggerCatch(_0xabc1('0xc1')));}else{_0x44f792[_0xabc1('0x41')]=_0xabc1('0x208');if(_[_0xabc1('0xb7')](_0x4df265[0x0])||_['isNil'](_0x4df265[0x0][_0xabc1('0x177')])||_[_0xabc1('0xb7')](_0x4df265[0x0][_0xabc1('0x177')][_0xabc1('0x176')])){_0x44db8b[_0xabc1('0x20a')](_0xabc1('0x20b'),_0x44f792,_0x4df265[0x0]);}else{_0x44db8b[_0xabc1('0xc2')](_[_0xabc1('0xd8')](_0x4df265[0x0],[_0xabc1('0x102'),_0xabc1('0x20c')]))[_0xabc1('0x40')](_0x44db8b['checkContactBlack'](_0x44f792,_0x4df265[0x0]))[_0xabc1('0xc8')](_0x44db8b[_0xabc1('0xd5')]('[actionOriginatePredictive]\x20',_0x44f792));}}})['catch'](loggerGetContactDialer(_0xabc1('0x216'),_0x44f792,0x1));emitVoiceQueueSummary(_0x44f792);};Dialer[_0xabc1('0xb4')]['abandonmentRate']=function(_0xfdeb6f,_0x406c99,_0x1f854e,_0x3fd4d5,_0x4c2796,_0x1a267b){loggerPredictive[_0xabc1('0x81')]('--------\x20Drop\x20Rate\x20--------');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',_0xfdeb6f);loggerPredictive[_0xabc1('0x81')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x406c99);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x217'),_0x1f854e);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x218'),_0x3fd4d5);loggerPredictive['info'](_0xabc1('0x219'),_0x4c2796);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x89'));return new BPromise(function(_0x52ec68,_0x48bf46){if(_0xfdeb6f<=0x0||isNaN(_0xfdeb6f)){return _0x48bf46(msgResponse(_0xabc1('0x21a'),_0xabc1('0x19d'),_0xabc1('0x21b')+_0xfdeb6f));}if(_0x1f854e<=0x0||isNaN(_0x1f854e)){return _0x48bf46(msgResponse('[abandonmentRate]',_0xabc1('0x19d'),'Ts\x20=\x20'+_0x1f854e));}if(_0x3fd4d5<=0x0||isNaN(_0x3fd4d5)){return _0x48bf46(msgResponse(_0xabc1('0x21a'),_0xabc1('0x19d'),_0xabc1('0x21c')+_0x3fd4d5));}if(_0x406c99<=0x0||isNaN(_0x406c99)){return _0x48bf46(msgResponse(_0xabc1('0x21a'),_0xabc1('0x19d'),'interval\x20=\x20'+_0x406c99));}if(_0x4c2796<=0x0||isNaN(_0x4c2796)){return _0x48bf46(msgResponse(_0xabc1('0x21a'),'Error','Amax\x20=\x20'+_0x4c2796));}_0x1a267b=_0x1a267b||0x0;var _0x5139f3=0x1/_0x1f854e;var _0x1d4234=0x0;var _0x44eda1=0x0;var _0xb378ac=0x0;var _0x97ddc=0x0;for(var _0x4b8740=0x0;_0xb378ac<_0x4c2796;_0x4b8740+=0x1){_0x44eda1=_0x4b8740/_0x406c99;_0x1d4234=(_0x3fd4d5*_0x44eda1+_0x1a267b)/_0x5139f3;_0xb378ac=erlangb(_0x1d4234,_0xfdeb6f);_0x97ddc=_0x1d4234/_0xfdeb6f*(0x1-erlangb(_0x1d4234,_0xfdeb6f));}return _0x52ec68({'erlangCalls':_0x4b8740,'erlangCallToSecond':_0x406c99/_0x4b8740,'erlangAbandonmentRate':_0xb378ac,'erlangBusyFactor':_0x97ddc});});};Dialer[_0xabc1('0xb4')][_0xabc1('0x1ec')]=function(_0x2e2e28,_0x35d8e7,_0x47e8e0,_0x123536,_0x2a7139,_0x21d29e){loggerPredictive[_0xabc1('0x81')](_0xabc1('0x21d'));loggerPredictive[_0xabc1('0x81')](_0xabc1('0x21e'),_0x2e2e28);loggerPredictive[_0xabc1('0x81')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35d8e7);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x217'),_0x47e8e0);loggerPredictive[_0xabc1('0x81')]('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',_0x123536);loggerPredictive[_0xabc1('0x81')](_0xabc1('0x21f'),_0x2a7139);loggerPredictive['info'](_0xabc1('0x89'));return new BPromise(function(_0x25e7ac,_0x51d6c2){if(_0x2e2e28<=0x0||isNaN(_0x2e2e28)){return _0x51d6c2(msgResponse('[busyFactor]','Error',_0xabc1('0x21b')+_0x2e2e28));}if(_0x47e8e0<=0x0||isNaN(_0x47e8e0)){return _0x51d6c2(msgResponse(_0xabc1('0x220'),_0xabc1('0x19d'),_0xabc1('0x221')+_0x47e8e0));}if(_0x123536<=0x0||isNaN(_0x123536)){return _0x51d6c2(msgResponse(_0xabc1('0x220'),_0xabc1('0x19d'),'p\x20=\x20'+_0x123536));}if(_0x35d8e7<=0x0||isNaN(_0x35d8e7)){return _0x51d6c2(msgResponse(_0xabc1('0x220'),'Error',_0xabc1('0x222')+_0x35d8e7));}if(_0x2a7139<=0x0||isNaN(_0x2a7139)){return _0x51d6c2(msgResponse(_0xabc1('0x220'),_0xabc1('0x19d'),'Umin\x20=\x20'+_0x2a7139));}_0x21d29e=_0x21d29e||0x0;var _0x2d8c97=0x1/_0x47e8e0;var _0x2ea92b=0x0;var _0x20de6f=0x0;var _0x50701d=0x0;var _0x3aaadf=0x0;for(var _0x24f01a=0x0;_0x3aaadf<_0x2a7139;_0x24f01a+=0x1){_0x20de6f=_0x24f01a/_0x35d8e7;_0x2ea92b=(_0x123536*_0x20de6f+_0x21d29e)/_0x2d8c97;_0x50701d=erlangb(_0x2ea92b,_0x2e2e28);_0x3aaadf=_0x2ea92b/_0x2e2e28*(0x1-erlangb(_0x2ea92b,_0x2e2e28));}return _0x25e7ac({'erlangCalls':_0x24f01a,'erlangCallToSecond':_0x35d8e7/_0x24f01a,'erlangAbandonmentRate':_0x50701d,'erlangBusyFactor':_0x3aaadf});});};module[_0xabc1('0x223')]=Dialer;
\ No newline at end of file
+var _0x15f7=['dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','response','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','p\x20=\x20','Amax\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','util','bluebird','uuid','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','then','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Interval','Intervals','[ifTime][Action]','Error','stringify','milliseconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','abandoned','waiting','loggedInDb','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','Trunk','active','callerid','md5','voice:queue:%s','voice_queue:save','ivr','format','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','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\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','diff','seconds','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','originated','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','endtime','starttime','clearZombieChannels','[actions]','isNil','Action','status','catch','updateOriginated','voiceQueues','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','merge','pick','ContactId','ListId','UserId','CampaignId','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','queue','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','countmachineretry','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countbusyretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','calleridnum','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','calleridname','[syncAgentComplete][createHistory][11]','channel','actionid','locked','stateinterface','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','push','interval','content','indexOf','true','command','iftime\x20%s,%s','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','power','dialPowerLevel','handlePower','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','Agent','user:%s','launchHandleIvr','handleIvr','dialActive','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','dialPreviewRecallmeReminder','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence'];(function(_0x505668,_0xe31e48){var _0x19e1d8=function(_0x5081c0){while(--_0x5081c0){_0x505668['push'](_0x505668['shift']());}};_0x19e1d8(++_0xe31e48);}(_0x15f7,0x9d));var _0x715f=function(_0x14bf63,_0xdbd373){_0x14bf63=_0x14bf63-0x0;var _0x410d22=_0x15f7[_0x14bf63];return _0x410d22;};'use strict';var util=require(_0x715f('0x0'));var _=require('lodash');var BPromise=require(_0x715f('0x1'));var uuid=require(_0x715f('0x2'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require('../preview/util/util');var config=require(_0x715f('0x3'));var logger=require(_0x715f('0x4'))(_0x715f('0x5'));var loggerBooked=require('../../../config/logger')(_0x715f('0x6'));var loggerPredictive=require(_0x715f('0x4'))(_0x715f('0x7'));var loggerPredictiveCalls=require(_0x715f('0x4'))(_0x715f('0x8'));var loggerSyncQueueSummary=require(_0x715f('0x4'))(_0x715f('0x9'));var ami=require(_0x715f('0xa'));config[_0x715f('0xb')]=_[_0x715f('0xc')](config[_0x715f('0xb')],{'host':_0x715f('0xd'),'port':0x18eb});var io=require(_0x715f('0xe'))(new Redis(config[_0x715f('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x715f('0xf'));var cmHopperBlack=require(_0x715f('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x715f('0x11'));var Action=require(_0x715f('0x12'));var History=require(_0x715f('0x13'));var Final=require(_0x715f('0x14'));var AgentComplete=require(_0x715f('0x15'));var QueueCallerAbandon=require(_0x715f('0x16'));var Hangup=require(_0x715f('0x17'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x715f('0x18');var strategy={'rrmemory':_0x715f('0x19'),'roundrobin':_0x715f('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x715f('0x1b')][_0x715f('0x1c')]=function(_0x1f080d){this[_0x715f('0x1d')]=this[_0x715f('0x1d')]?this[_0x715f('0x1d')][_0x715f('0x1e')](_0x1f080d):_0x1f080d();};function Dialer(_0x33ebb7,_0x9f898e){this[_0x715f('0x1f')]=new Sequence();this[_0x715f('0x20')]=_0x9f898e;this['voiceQueues']=_0x33ebb7['voiceQueues'];this[_0x715f('0x21')]=_0x33ebb7['campaigns'];this[_0x715f('0x22')]=_0x33ebb7[_0x715f('0x22')];this[_0x715f('0x23')]=_0x33ebb7[_0x715f('0x23')];this[_0x715f('0x24')]=config['maxNumberOriginate']||0x2;this[_0x715f('0x25')]={};this[_0x715f('0x26')]={};this[_0x715f('0x27')]={};this[_0x715f('0x28')]={};this[_0x715f('0x29')]={};this[_0x715f('0x2a')]={};this[_0x715f('0x2b')]={};this[_0x715f('0x2c')]={};this[_0x715f('0x2d')]={};this[_0x715f('0x2e')]={};ami['on'](_0x715f('0x2f'),this[_0x715f('0x30')][_0x715f('0x31')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x715f('0x31')](this));ami['on'](_0x715f('0x32'),this[_0x715f('0x33')][_0x715f('0x31')](this));ami['on'](_0x715f('0x34'),this[_0x715f('0x35')]['bind'](this));ami['on'](_0x715f('0x36'),this[_0x715f('0x9')][_0x715f('0x31')](this));ami['on'](_0x715f('0x37'),this[_0x715f('0x38')][_0x715f('0x31')](this));ami['on']('newexten',this[_0x715f('0x39')][_0x715f('0x31')](this));ami['on'](_0x715f('0x3a'),this[_0x715f('0x3b')][_0x715f('0x31')](this));ami['on'](_0x715f('0x3c'),this[_0x715f('0x3d')]['bind'](this));ami['on'](_0x715f('0x3e'),this[_0x715f('0x3f')]['bind'](this));this['loopCampaigns']();this[_0x715f('0x40')]();RpcSetting['getSettings']()[_0x715f('0x41')](function(_0xafc46f){previewRecallmeReminderInterval=_0xafc46f[_0x715f('0x42')];});}function isNotNull(_0x262dbb){return _0x262dbb!==null&&!_['isUndefined'](_0x262dbb);}function checkIsLoggedIn(_0x76cc28,_0x1d7adb){return function(){if(_0x1d7adb<=0x0){_0x76cc28[_0x715f('0x43')]=_0x715f('0x44');throw _0x76cc28[_0x715f('0x45')]+_0x715f('0x46');}};}function isActive(_0x16c1c3){return _0x16c1c3;}function checkIsActive(_0x423579,_0x38463d){return function(){if(!isActive(_0x38463d)){_0x423579['message']='NOT_ACTIVE';throw _0x423579[_0x715f('0x45')]+_0x715f('0x47');}};}function checkInterval(_0x5d8152){return function(){if(!isNotNull(_0x5d8152['Interval'])){_0x5d8152[_0x715f('0x43')]=_0x715f('0x48');throw _0x5d8152[_0x715f('0x45')]+_0x715f('0x49');}if(!isNotNull(_0x5d8152['Interval']['Intervals'])){_0x5d8152['message']=_0x715f('0x48');throw _0x5d8152['name']+_0x715f('0x49');}if(!isNotNull(_[_0x715f('0x4a')](_0x5d8152[_0x715f('0x4b')][_0x715f('0x4c')]))){_0x5d8152[_0x715f('0x43')]=_0x715f('0x48');throw _0x5d8152[_0x715f('0x45')]+_0x715f('0x49');}};}function msgResponse(_0x40aa6c,_0x2a2f41,_0x3c3e26){return{'action':_0x40aa6c,'response':_0x2a2f41,'message':_0x3c3e26,'stack':_0x3c3e26};}function myreject(_0xde30b3){return function(_0x21e89f){return _0xde30b3(msgResponse(_0x715f('0x4d'),_0x715f('0x4e'),JSON[_0x715f('0x4f')](_0x21e89f)));};}function getSeconds(_0x560a46,_0x1f4b26){var _0x25dda9=moment(_0x560a46)['milliseconds'](0x0);var _0x20cb7c=moment(_0x1f4b26)[_0x715f('0x50')](0x0);return _0x25dda9['diff'](_0x20cb7c,'seconds');}function emit(_0x28b5ab,_0x56432f,_0x240481){io['to'](_0x28b5ab)[_0x715f('0x51')](_0x56432f,_0x240481);}function emitVoiceQueueSummary(_0x5a654c){if(_0x5a654c[_0x715f('0x52')]===_0x715f('0x53')){var _0x61feb2={'id':_0x5a654c['id'],'name':_0x5a654c[_0x715f('0x45')],'strategy':_0x5a654c[_0x715f('0x54')],'answered':_0x5a654c['answered'],'available':_0x5a654c[_0x715f('0x55')],'loggedIn':_0x5a654c[_0x715f('0x56')],'pTalking':_0x5a654c[_0x715f('0x57')],'sumBillable':_0x5a654c[_0x715f('0x58')],'sumDuration':_0x5a654c[_0x715f('0x59')],'sumHoldTime':_0x5a654c['sumHoldTime']||0x0,'talking':_0x5a654c[_0x715f('0x5a')],'total':_0x5a654c[_0x715f('0x5b')],'type':_0x5a654c[_0x715f('0x52')],'unmanaged':_0x5a654c['unmanaged'],'abandoned':_0x5a654c[_0x715f('0x5c')],'waiting':_0x5a654c[_0x715f('0x5d')],'loggedInDb':_0x5a654c[_0x715f('0x5e')],'dialActive':_0x5a654c['dialActive'],'dialMethod':_0x5a654c['dialMethod'],'dialOriginateCallerIdName':_0x5a654c['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5a654c['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x5a654c['dialOriginateTimeout'],'dialPrefix':_0x5a654c[_0x715f('0x5f')],'outboundAnswerAgiCallsDay':_0x5a654c['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5a654c[_0x715f('0x60')],'outboundBlacklistCallsDay':_0x5a654c['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5a654c[_0x715f('0x61')],'outboundCongestionCallsDay':_0x5a654c[_0x715f('0x62')],'outboundDropCallsDayACS':_0x5a654c[_0x715f('0x63')],'outboundDropCallsDayCallersExit':_0x5a654c[_0x715f('0x64')],'outboundDropCallsDayTimeout':_0x5a654c[_0x715f('0x65')],'outboundNoAnswerCallsDay':_0x5a654c[_0x715f('0x66')],'outboundNoSuchCallsDay':_0x5a654c['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x5a654c[_0x715f('0x67')],'outboundReCallsDay':_0x5a654c['outboundReCallsDay'],'outboundRejectCallsDay':_0x5a654c[_0x715f('0x68')],'outboundUnknownCallsDay':_0x5a654c[_0x715f('0x69')],'predictiveIntervalAnsweredCalls':_0x5a654c[_0x715f('0x6a')],'predictiveIntervalAvgHoldtime':_0x5a654c[_0x715f('0x6b')],'predictiveIntervalAvgTalktime':_0x5a654c[_0x715f('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x5a654c['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5a654c[_0x715f('0x6d')],'predictiveIntervalErlangCalls':_0x5a654c[_0x715f('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x5a654c['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x5a654c[_0x715f('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x5a654c[_0x715f('0x70')],'predictiveIntervalPauses':_0x5a654c[_0x715f('0x71')],'predictiveIntervalAvailable':_0x5a654c['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5a654c[_0x715f('0x72')],'message':_0x5a654c['message'],'originated':_0x5a654c['originated'],'erlangCalls':_0x5a654c[_0x715f('0x73')],'erlangCallToSecond':_0x5a654c[_0x715f('0x74')],'erlangAbandonmentRate':_0x5a654c['erlangAbandonmentRate'],'erlangBusyFactor':_0x5a654c['erlangBusyFactor'],'startPredictive':_0x5a654c[_0x715f('0x2a')],'startProgressive':_0x5a654c[_0x715f('0x2b')]};if(_0x5a654c[_0x715f('0x75')]){_0x61feb2[_0x715f('0x75')]={'id':_0x5a654c['Trunk']['id'],'name':_0x5a654c[_0x715f('0x75')][_0x715f('0x45')],'active':_0x5a654c[_0x715f('0x75')][_0x715f('0x76')],'callerid':_0x5a654c[_0x715f('0x75')][_0x715f('0x77')]};}if(_0x5a654c['Interval']){_0x61feb2['Interval']={'id':_0x5a654c[_0x715f('0x4b')]['id'],'name':_0x5a654c[_0x715f('0x4b')]['name']};}var _0x4127f0=md5(JSON[_0x715f('0x4f')](_0x61feb2));if(_0x5a654c[_0x715f('0x78')]!==_0x4127f0){_0x5a654c['md5']=_0x4127f0;emit(util['format'](_0x715f('0x79'),_0x61feb2['name']),_0x715f('0x7a'),_0x61feb2);}}}function emitCampaignSummary(_0x159e48){if(_0x159e48[_0x715f('0x52')]===_0x715f('0x7b')){emit(util[_0x715f('0x7c')]('campaign:ivr:%s',_0x159e48['name']),_0x715f('0x7d'),_0x159e48);}}function checkGetDataPredictive(_0x95b718){if(isNotNull(_0x95b718)&&!_[_0x715f('0x4a')](_0x95b718)){loggerPredictive[_0x715f('0x7e')](_0x715f('0x7f'));loggerPredictive[_0x715f('0x7e')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x95b718[_0x715f('0x72')]);loggerPredictive[_0x715f('0x7e')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x95b718[_0x715f('0x6a')]);loggerPredictive[_0x715f('0x7e')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x95b718[_0x715f('0x6d')]);loggerPredictive[_0x715f('0x7e')](_0x715f('0x80'),_0x95b718[_0x715f('0x81')]);loggerPredictive['info'](_0x715f('0x82'),_0x95b718[_0x715f('0x6b')]);loggerPredictive[_0x715f('0x7e')](_0x715f('0x83'),_0x95b718[_0x715f('0x6c')]);loggerPredictive[_0x715f('0x7e')](_0x715f('0x84'));if(_0x95b718[_0x715f('0x72')]>0x0){if(!_[_0x715f('0x85')](_0x95b718['predictiveIntervalAvgTalktime'])&&_0x95b718[_0x715f('0x6c')]>0x0){return!![];}loggerPredictive[_0x715f('0x7e')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x95b718[_0x715f('0x6b')])&&_0x95b718[_0x715f('0x6b')]>0x0){return!![];}loggerPredictive[_0x715f('0x7e')](_0x715f('0x86'));}else{loggerPredictive[_0x715f('0x7e')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x715f('0x7e')](_0x715f('0x87'));}return![];}function mergeDataErlangB(_0x4dc2dd){return function(_0x223f83){loggerPredictive['info'](_0x715f('0x88'));loggerPredictive['info'](_0x715f('0x89'),_0x223f83[_0x715f('0x73')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x223f83[_0x715f('0x74')]);loggerPredictive[_0x715f('0x7e')](_0x715f('0x8a'),_0x223f83[_0x715f('0x8b')]);loggerPredictive[_0x715f('0x7e')](_0x715f('0x8c'),_0x223f83['erlangBusyFactor']);loggerPredictive[_0x715f('0x7e')](_0x715f('0x8a'),_0x223f83[_0x715f('0x8b')]);loggerPredictive['info'](_0x715f('0x84'));_['merge'](_0x4dc2dd,_0x223f83);};}function getDiff(_0x480f9d){var _0x473db2=moment()[_0x715f('0x50')](0x0);var _0x4a1efb=moment(_0x480f9d)['milliseconds'](0x0);return _0x473db2[_0x715f('0x8d')](_0x4a1efb,_0x715f('0x8e'));}function ifInterval(_0x2d5fe2,_0x49a4df){if(_[_0x715f('0x85')](_0x49a4df)){return![];}return getDiff(_0x49a4df)<_0x2d5fe2*0x3c;}function freeVariablesPredictive(_0x434d69){if(isNotNull(_0x434d69)){if(!_[_0x715f('0x85')](_0x434d69[_0x715f('0x2b')])){_0x434d69[_0x715f('0x2b')]=undefined;loggerPredictive[_0x715f('0x7e')](_0x434d69[_0x715f('0x45')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x715f('0x85')](_0x434d69['startPredictive'])){_0x434d69[_0x715f('0x2a')]=undefined;loggerPredictive[_0x715f('0x7e')](_0x434d69[_0x715f('0x45')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x715f('0x85')](_0x434d69[_0x715f('0x8f')])){clearInterval(_0x434d69['handlePredictive']);_0x434d69[_0x715f('0x8f')]=undefined;loggerPredictive[_0x715f('0x7e')](_0x434d69[_0x715f('0x45')],_0x715f('0x90'));}}}function erlangb(_0x41616b,_0x2ef6a4){if(_0x2ef6a4===0x0){return 0x0;}var _0x4c7b12=0x1;for(var _0x221645=0x1;_0x221645<=_0x2ef6a4;_0x221645+=0x1){_0x4c7b12=0x1+_0x4c7b12*_0x221645/_0x41616b;}return 0x1/_0x4c7b12;}function isVoiceQueueOutbound(_0x43dc50){return _0x43dc50===_0x715f('0x53');}function isNotPreview(_0x1ed072){return _0x1ed072!=='preview';}function isCampaignIvr(_0x56070b){return _0x56070b===_0x715f('0x7b');}function getCallerId(_0x5800a,_0x3e4100,_0x2e5452){if(!_['isUndefined'](_0x2e5452)&&typeof _0x2e5452===_0x715f('0x91')&&!_[_0x715f('0x4a')](_0x2e5452)){if(!_[_0x715f('0x85')](_0x3e4100)&&typeof _0x3e4100==='string'&&!_[_0x715f('0x4a')](_0x3e4100)){return util[_0x715f('0x7c')](_0x715f('0x92'),_0x3e4100,_0x2e5452);}return util[_0x715f('0x7c')]('\x22%s\x22\x20<%s>',_0x2e5452,_0x2e5452);}if(!_[_0x715f('0x85')](_0x5800a)&&typeof _0x5800a===_0x715f('0x91')&&!_[_0x715f('0x4a')](_0x5800a)){return _0x5800a;}return _0x715f('0x93');}function loggerCatchQueueSummary(_0x1ba83d,_0x3a8818){return function(_0x329055){freeVariablesPredictive(_0x3a8818);emitVoiceQueueSummary(_0x3a8818);emitCampaignSummary(_0x3a8818);loggerSyncQueueSummary[_0x715f('0x94')](_0x1ba83d,util[_0x715f('0x95')](_0x329055,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4251d6,_0x2c1d53){return function(_0x59164a){loggerPredictive[_0x715f('0x94')](_0x2c1d53[_0x715f('0x45')],_0x4251d6);loggerPredictive['error'](_0x59164a[_0x715f('0x96')]);freeVariablesPredictive(_0x2c1d53);};}function loggerCatch(_0x175ac1){return function(_0x133915){logger[_0x715f('0x94')](_0x175ac1,util[_0x715f('0x95')](_0x133915,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x172330){return _0x172330&&!_['isUndefined'](_0x172330)&&_0x172330['length']>0x0;}function decremetOriginate(_0x1ce065){if(!_[_0x715f('0x85')](_0x1ce065)&&_0x1ce065!==null){if(typeof _0x1ce065[_0x715f('0x97')]!==_0x715f('0x98')){if(_0x1ce065[_0x715f('0x97')]>0x0){_0x1ce065[_0x715f('0x97')]-=0x1;}else{logger[_0x715f('0x94')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x715f('0x94')](_0x715f('0x99'));}}function checkContactLowerLimitOriginate(_0xedcdce,_0x59a28f,_0x2ca2c5){if(_0x59a28f>_0x2ca2c5){for(var _0x39a42b=0x0;_0x39a42b<_0x59a28f-_0x2ca2c5;_0x39a42b+=0x1){decremetOriginate(_0xedcdce);}}}function loggerGetContactDialer(_0x52d834,_0x407df3,_0xd9ccf6){return function(_0x5f2b0b){checkContactLowerLimitOriginate(_0x407df3,_0xd9ccf6,0x0);logger[_0x715f('0x94')](_0x52d834,util[_0x715f('0x95')](_0x5f2b0b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x42c448){return function(_0x54fdd3){if(isNotNull(_0x54fdd3)&&isNotNull(_0x54fdd3[0x0])){if(_0x54fdd3[0x0][_0x715f('0x9a')]>0x0){_0x42c448['message']=_0x715f('0x9b');logger[_0x715f('0x7e')](_0x715f('0x9c')+_0x42c448[_0x715f('0x45')],_0x54fdd3[0x0][_0x715f('0x9a')],'contacts');}else{_0x42c448['message']=_0x715f('0x9d');logger[_0x715f('0x7e')](_0x715f('0x9e')+_0x42c448['name']);}}};}function notSendMessagesQueue(_0x1cd00c){if(_0x1cd00c['sendMessageOneNotActive']){freeVariablesPredictive(_0x1cd00c);if(_0x1cd00c['originated']===0x0&&_0x1cd00c['talking']===0x0&&_0x1cd00c[_0x715f('0x5d')]===0x0&&(_0x1cd00c[_0x715f('0x57')]||0x0)===0x0){_0x1cd00c[_0x715f('0x9f')]=![];_0x1cd00c[_0x715f('0x55')]=0x0;_0x1cd00c[_0x715f('0x43')]=_0x715f('0xa0');loggerSyncQueueSummary[_0x715f('0x94')](_0x715f('0xa1'),_0x1cd00c[_0x715f('0x45')],'is\x20not\x20active');}else{_0x1cd00c[_0x715f('0x43')]=_0x715f('0xa2');loggerSyncQueueSummary['error'](_0x715f('0xa1'),_0x1cd00c[_0x715f('0x45')],_0x715f('0xa3'));}emitVoiceQueueSummary(_0x1cd00c);}}function notSendMessagesCampaign(_0x10b7fc){if(_0x10b7fc[_0x715f('0x9f')]){if(_0x10b7fc[_0x715f('0x97')]===0x0){_0x10b7fc[_0x715f('0x9f')]=![];_0x10b7fc[_0x715f('0x43')]=_0x715f('0xa0');loggerSyncQueueSummary[_0x715f('0x94')](_0x715f('0xa4'),_0x10b7fc[_0x715f('0x45')],_0x715f('0xa5'));}else{_0x10b7fc[_0x715f('0x43')]=_0x715f('0xa2');loggerSyncQueueSummary['error'](_0x715f('0xa4'),_0x10b7fc[_0x715f('0x45')],_0x715f('0xa3'));}emitCampaignSummary(_0x10b7fc);}}function createObjHistory(_0x1dbf99,_0x4c3fb1,_0x4c13ef,_0x397261,_0x28d854){_0x1dbf99[_0x715f('0x43')]=_0x4c13ef;var _0x4d17ae=new Action(_0x1dbf99,_0x4c3fb1);var _0x4d1656=new History(_0x4d17ae);_0x4d1656[_0x715f('0xa6')]=_0x397261;_0x4d1656[_0x715f('0xa7')]=_0x28d854;_0x4d1656[_0x715f('0xa8')]=_0x4d17ae[_0x715f('0xa9')];return _0x4d1656;}Dialer['prototype'][_0x715f('0x40')]=function(){var _0x454839=this;setInterval(function(){_0x454839['clearZombieChannels'](_0x454839[_0x715f('0x28')],'[uniqueid]');_0x454839[_0x715f('0xaa')](_0x454839[_0x715f('0x26')],_0x715f('0xab'));},0x32c8);};Dialer[_0x715f('0x1b')]['clearZombieChannels']=function(_0x46faa5,_0x503c31){var _0x22a125=this;for(var _0x6eff4b in _0x46faa5){if(typeof _0x46faa5[_0x6eff4b]!==_0x715f('0x98')){this[_0x715f('0x1f')][_0x715f('0x1c')](function(){if(!_[_0x715f('0xac')](_0x46faa5[_0x6eff4b])){return ami[_0x715f('0xad')]({'action':_0x715f('0xae'),'channel':_0x46faa5[_0x6eff4b]['channel']})[_0x715f('0xaf')](function(_0x1cd13b){if(_0x1cd13b['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x46faa5[_0x6eff4b]&&_0x46faa5[_0x6eff4b][_0x715f('0x52')]!==_0x715f('0x7b')){_0x22a125[_0x715f('0xb0')](_0x22a125[_0x715f('0xb1')][_0x46faa5[_0x6eff4b]['queue']]);logger['error'](_0x715f('0xb2'),_0x503c31,_0x6eff4b,_0x46faa5[_0x6eff4b]['queue']);delete _0x46faa5[_0x6eff4b];}if(_0x46faa5[_0x6eff4b]&&_0x46faa5[_0x6eff4b][_0x715f('0x52')]===_0x715f('0x7b')){_0x22a125['updateOriginated'](_0x22a125[_0x715f('0x21')][_0x46faa5[_0x6eff4b]['queue']]);logger[_0x715f('0x94')](_0x715f('0xb3'),_0x503c31,_0x6eff4b,_0x46faa5[_0x6eff4b]['queue']);delete _0x46faa5[_0x6eff4b];}},0x2328);}});}});}}};Dialer['prototype'][_0x715f('0xb4')]=function(_0x11761e){return BPromise['resolve']()['then'](cmHopper[_0x715f('0xb4')](_0x11761e))['catch'](loggerCatch(_0x715f('0xb5')));};Dialer[_0x715f('0x1b')]['checkIsBlackList']=function(_0x2447d){return BPromise[_0x715f('0xb6')]()[_0x715f('0x41')](cmHopperBlack[_0x715f('0xb7')](_0x2447d))['catch'](loggerCatch(_0x715f('0xb8')));};Dialer['prototype'][_0x715f('0xb9')]=function(_0x98f75f){return BPromise[_0x715f('0xb6')]()[_0x715f('0x41')](cmHopperBlack['checkIsBlackListIvr'](_0x98f75f))['catch'](loggerCatch(_0x715f('0xba')));};Dialer[_0x715f('0x1b')][_0x715f('0xbb')]=function(_0x27b26a){return BPromise[_0x715f('0xb6')]()[_0x715f('0x41')](cmHopperHistory[_0x715f('0xbc')](_0x27b26a))['catch'](loggerCatch(_0x715f('0xbd')));};Dialer[_0x715f('0x1b')][_0x715f('0xbe')]=function(_0x5688de){return BPromise['resolve']()[_0x715f('0x41')](cmHopper['rescheduleContact'](_0x5688de))['catch'](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x715f('0x1b')]['unlockContact']=function(_0x15aa59,_0x521e72,_0x32c6c8){return BPromise[_0x715f('0xb6')]()['then'](cmHopper['unlockContact'](_0x15aa59,_0x521e72,_0x32c6c8))['catch'](loggerCatch(_0x715f('0xbf')));};Dialer[_0x715f('0x1b')][_0x715f('0xc0')]=function(_0x17e8d,_0x5a54fa,_0x4cae7e,_0x51f3ef,_0x2d969a){return BPromise['resolve']()[_0x715f('0x41')](cmHopper[_0x715f('0xc0')](_0x17e8d,_0x5a54fa,_0x4cae7e,_0x51f3ef))[_0x715f('0xaf')](function(_0x3ab560){_0x2d969a['temp']-=_0x4cae7e;_0x2d969a[_0x715f('0xc1')]=_0x2d969a[_0x715f('0xc1')]>0x0?_0x2d969a['temp']:0x0;loggerCatch(_0x715f('0xc2'))(_0x3ab560);});};Dialer['prototype'][_0x715f('0xc3')]=function(_0x3137ca,_0x572bb8,_0x706de1,_0xcd3fd0){return BPromise['resolve']()['then'](cmHopper[_0x715f('0xc3')](_0x3137ca,_0x572bb8,_0x706de1))['catch'](function(_0x5cd434){_0xcd3fd0[_0x715f('0xc1')]-=_0x572bb8;_0xcd3fd0['temp']=_0xcd3fd0[_0x715f('0xc1')]>0x0?_0xcd3fd0[_0x715f('0xc1')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x5cd434);});};Dialer[_0x715f('0x1b')][_0x715f('0xc4')]=function(_0x5b7f6a){return BPromise[_0x715f('0xb6')]()[_0x715f('0x41')](voiceQueueRt[_0x715f('0xc4')](_0x5b7f6a))[_0x715f('0xaf')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x715f('0x1b')][_0x715f('0xc5')]=function(_0x263850){return BPromise[_0x715f('0xb6')]()[_0x715f('0x41')](cmHopper[_0x715f('0xc5')](_0x263850))['catch'](loggerCatch(_0x715f('0xc6')));};Dialer[_0x715f('0x1b')][_0x715f('0xc7')]=function(_0x42b8a2){return BPromise[_0x715f('0xb6')]()[_0x715f('0x41')](cmHopperHistory[_0x715f('0xc7')](_0x42b8a2))['catch'](loggerCatch(_0x715f('0xc8')));};Dialer[_0x715f('0x1b')][_0x715f('0xb0')]=function(_0x135629){if(!_[_0x715f('0x85')](_0x135629)&&_0x135629!==null){if(typeof _0x135629[_0x715f('0x97')]!==_0x715f('0x98')){if(_0x135629[_0x715f('0x97')]>0x0){_0x135629[_0x715f('0x97')]-=0x1;}else{logger[_0x715f('0x94')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x715f('0x94')](_0x715f('0xc9'));}};Dialer[_0x715f('0x1b')][_0x715f('0xca')]=function(_0xebcc61,_0x72264b){var _0x465098=this;return function(_0x48373d){_0x465098[_0x715f('0xb0')](_0x72264b);logger[_0x715f('0x94')](_0xebcc61,util[_0x715f('0x95')](_0x48373d,{'showHidden':![],'depth':null}));};};Dialer[_0x715f('0x1b')]['emptyContact']=function(_0x552f9b,_0x4da0ac,_0x407712){var _0x1de317={'state':0x19,'statedesc':_0x715f('0xcb')};this[_0x715f('0xb0')](_0x4da0ac);this[_0x715f('0xcc')](_[_0x715f('0xcd')](_0x1de317,_[_0x715f('0xce')](_0x407712,[_0x715f('0xcf'),_0x715f('0xd0'),_0x715f('0xd1'),'VoiceQueueId',_0x715f('0xd2')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0x715f('0x94')](_0x552f9b);};Dialer['prototype'][_0x715f('0xd3')]=function(_0x4d0fff){return _0x4d0fff===_0x715f('0xd4');};Dialer[_0x715f('0x1b')][_0x715f('0xd5')]=function(_0x7545b0){return!_[_0x715f('0x85')](_0x7545b0)&&_0x7545b0&&!_[_0x715f('0x85')](_0x7545b0[_0x715f('0x45')])&&!_[_0x715f('0x85')](_0x7545b0[_0x715f('0x76')])&&_0x7545b0['active']&&(this[_0x715f('0x23')][util[_0x715f('0x7c')](_0x715f('0xd6'),_0x7545b0[_0x715f('0x45')])][_0x715f('0xae')]===_0x715f('0xd7')||this[_0x715f('0x23')][util[_0x715f('0x7c')](_0x715f('0xd6'),_0x7545b0[_0x715f('0x45')])][_0x715f('0xae')]===_0x715f('0xd8'));};Dialer[_0x715f('0x1b')][_0x715f('0xcc')]=function(_0x53e37c,_0x3f009a,_0x15b32f){this[_0x715f('0xc7')](_0x53e37c)[_0x715f('0xaf')](loggerCatch(_0x3f009a));this['moveContactManagedDialer'](_0x53e37c)['catch'](loggerCatch(_0x15b32f));};Dialer['prototype'][_0x715f('0x3b')]=function(_0x15cac9){var _0x15b5ae=this[_0x715f('0x28')][_0x15cac9[_0x715f('0xd9')]];var _0x16c9bb;if(!_[_0x715f('0xac')](_0x15cac9)&&!_[_0x715f('0xac')](_0x15cac9[_0x715f('0xda')])&&!_[_0x715f('0xac')](_0x15cac9[_0x715f('0xda')][_0x715f('0xdb')])&&_0x15cac9[_0x715f('0xdc')]===_0x715f('0xdd')&&_0x15b5ae){if(_0x15b5ae[_0x715f('0x52')]!==_0x715f('0x7b')&&this['voiceQueues'][_0x15b5ae[_0x715f('0xde')]][_0x715f('0xdf')]&&_0x15cac9[_0x715f('0xe0')]===_0x715f('0xe1')){delete this[_0x715f('0x28')][_0x15cac9[_0x715f('0xd9')]];this[_0x715f('0xb0')](this[_0x715f('0xb1')][_0x15b5ae['queue']]);this['voiceQueues'][_0x15b5ae[_0x715f('0xde')]][_0x715f('0x60')]+=0x1;this[_0x715f('0xb1')][_0x15b5ae[_0x715f('0xde')]][_0x715f('0xe2')]+=0x1;_0x16c9bb=new Hangup(_0x15b5ae,_0x15cac9);_0x16c9bb[_0x715f('0xa6')]=0x12;_0x16c9bb[_0x715f('0xa7')]=_0x715f('0xe3');_0x16c9bb[_0x715f('0xe4')]=_0x715f('0xe5');ami['emit']('custom:amd',ut[_0x715f('0xe6')](_0x16c9bb,_0x715f('0xe7')));this[_0x715f('0xcc')](_0x16c9bb,_0x715f('0xe8'),'[syncHangupInAMD]');}if(_0x15b5ae[_0x715f('0x52')]!==_0x715f('0x7b')&&this[_0x715f('0xb1')][_0x15b5ae[_0x715f('0xde')]][_0x715f('0xdf')]&&_0x15cac9[_0x715f('0xe0')]===_0x715f('0xe9')){var _0x49215f=this;return new BPromise(function(_0x213e27,_0x1701c0){delete _0x49215f['uniqueId'][_0x15cac9['uniqueid']];_0x49215f[_0x715f('0xb0')](_0x49215f['voiceQueues'][_0x15b5ae[_0x715f('0xde')]]);_0x49215f[_0x715f('0xb1')][_0x15b5ae[_0x715f('0xde')]]['outboundAnswerCallsDay']+=0x1;_0x49215f[_0x715f('0xb1')][_0x15b5ae[_0x715f('0xde')]][_0x715f('0xe2')]+=0x1;var _0x32a31d=_0x49215f[_0x715f('0xb1')][_0x15b5ae['queue']];var _0x44a161=new Hangup(_0x15b5ae,_0x15cac9);_0x44a161[_0x715f('0xa6')]=0x13;_0x44a161[_0x715f('0xa7')]='Machine';_0x44a161[_0x715f('0xe4')]='AMD';_0x44a161[_0x715f('0xea')]+=0x1;_0x44a161[_0x715f('0xeb')]+=0x1;_0x44a161['amd']=!![];ami['emit'](_0x715f('0xec'),ut[_0x715f('0xe6')](_0x44a161,_0x715f('0xe7')));_0x49215f[_0x715f('0xc7')](_0x44a161)[_0x715f('0xaf')](loggerCatch(_0x715f('0xed')));if(_0x44a161['countbusyretry']+_0x44a161[_0x715f('0xee')]+_0x44a161[_0x715f('0xef')]+_0x44a161[_0x715f('0xf0')]+_0x44a161[_0x715f('0xf1')]+_0x44a161[_0x715f('0xf2')]+_0x44a161['countmachineretry']+_0x44a161[_0x715f('0xf3')]>=_0x32a31d[_0x715f('0xf4')]){_0x49215f[_0x715f('0xf5')](_0x44a161,_0x213e27,_0x1701c0,_0x715f('0xf6'));}else{if(_0x44a161[_0x715f('0xea')]>=_0x32a31d[_0x715f('0xf7')]){_0x49215f[_0x715f('0xf8')](_0x44a161,_0x213e27,_0x1701c0,_0x715f('0xf9'));}else{_0x49215f['rescheduleContact']({'active':![],'countmachineretry':_0x44a161[_0x715f('0xea')],'scheduledat':moment()[_0x715f('0xfa')](_0x32a31d[_0x715f('0xfb')],'minutes')['format'](_0x715f('0xfc')),'ContactId':_0x44a161[_0x715f('0xcf')],'ListId':_0x44a161['ListId'],'VoiceQueueId':_0x44a161[_0x715f('0xfd')]||undefined,'CampaignId':_0x44a161[_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch(_0x715f('0xfe')));_0x213e27({'reschedule':0x1});}}});}if(_0x15b5ae['type']===_0x715f('0x7b')&&this['campaigns'][_0x15b5ae[_0x715f('0xde')]][_0x715f('0xdf')]&&_0x15cac9['value']===_0x715f('0xe1')){delete this[_0x715f('0x28')][_0x15cac9[_0x715f('0xd9')]];this[_0x715f('0xb0')](this[_0x715f('0x21')][_0x15b5ae['queue']]);_0x16c9bb=new Hangup(_0x15b5ae,_0x15cac9);_0x16c9bb[_0x715f('0xa6')]=0x12;_0x16c9bb[_0x715f('0xa7')]=_0x715f('0xe3');_0x16c9bb[_0x715f('0xe4')]='AMD';ami[_0x715f('0x51')](_0x715f('0xec'),ut[_0x715f('0xe6')](_0x16c9bb,_0x715f('0xe7')));this['saveInDb'](_0x16c9bb,_0x715f('0xff'),_0x715f('0x100'));}if(_0x15b5ae[_0x715f('0x52')]===_0x715f('0x7b')&&this[_0x715f('0x21')][_0x15b5ae[_0x715f('0xde')]][_0x715f('0xdf')]&&_0x15cac9[_0x715f('0xe0')]===_0x715f('0xe9')){var _0x49215f=this;return new BPromise(function(_0x29328f,_0x2806b3){delete _0x49215f[_0x715f('0x28')][_0x15cac9['uniqueid']];_0x49215f['updateOriginated'](_0x49215f[_0x715f('0x21')][_0x15b5ae[_0x715f('0xde')]]);_0x49215f[_0x715f('0x21')][_0x15b5ae[_0x715f('0xde')]][_0x715f('0x60')]+=0x1;_0x49215f[_0x715f('0x21')][_0x15b5ae[_0x715f('0xde')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x5ce803=_0x49215f[_0x715f('0x21')][_0x15b5ae[_0x715f('0xde')]];var _0x3c076a=new Hangup(_0x15b5ae,_0x15cac9);_0x3c076a[_0x715f('0xa6')]=0x13;_0x3c076a[_0x715f('0xa7')]=_0x715f('0x101');_0x3c076a['membername']=_0x715f('0xe5');_0x3c076a[_0x715f('0xea')]+=0x1;_0x3c076a[_0x715f('0xeb')]+=0x1;_0x3c076a[_0x715f('0xe7')]=!![];ami[_0x715f('0x51')](_0x715f('0xec'),ut['buildObj'](_0x3c076a,'amd'));_0x49215f['createHistory'](_0x3c076a)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x3c076a[_0x715f('0x102')]+_0x3c076a[_0x715f('0xee')]+_0x3c076a[_0x715f('0xef')]+_0x3c076a['countnosuchnumberretry']+_0x3c076a[_0x715f('0xf1')]+_0x3c076a[_0x715f('0xf2')]+_0x3c076a[_0x715f('0xea')]+_0x3c076a[_0x715f('0xf3')]>=_0x5ce803[_0x715f('0xf4')]){_0x49215f[_0x715f('0xf5')](_0x3c076a,_0x29328f,_0x2806b3,_0x715f('0xf6'));}else{if(_0x3c076a['countmachineretry']>=_0x5ce803[_0x715f('0xf7')]){_0x49215f[_0x715f('0xf8')](_0x3c076a,_0x29328f,_0x2806b3,_0x715f('0xf9'));}else{_0x49215f[_0x715f('0xbe')]({'active':![],'countmachineretry':_0x3c076a[_0x715f('0xea')],'scheduledat':moment()[_0x715f('0xfa')](_0x5ce803['dialMachineRetryFrequency'],'minutes')['format'](_0x715f('0xfc')),'ContactId':_0x3c076a[_0x715f('0xcf')],'ListId':_0x3c076a[_0x715f('0xd0')],'VoiceQueueId':_0x3c076a[_0x715f('0xfd')]||undefined,'CampaignId':_0x3c076a[_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch(_0x715f('0xfe')));_0x29328f({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x3f78c9){var _0x117350=this['uniqueId'][_0x3f78c9['uniqueid']];var _0x4dfcc3=this;var _0x3bf539;if(_0x117350&&_0x117350[_0x715f('0x52')]==='ivr'){delete this['uniqueId'][_0x3f78c9[_0x715f('0xd9')]];this['updateOriginated'](this[_0x715f('0x21')][_0x117350[_0x715f('0xde')]]);this['campaigns'][_0x117350[_0x715f('0xde')]][_0x715f('0x103')]+=0x1;_0x3bf539=new Hangup(_0x117350,_0x3f78c9);this[_0x715f('0xc7')](_0x3bf539)['catch'](loggerCatch(_0x715f('0x104')));this[_0x715f('0xc5')](_0x3bf539)[_0x715f('0xaf')](loggerCatch(_0x715f('0x105')));}if(_0x117350&&_0x117350[_0x715f('0x52')]!==_0x715f('0x7b')&&isNotNull(this[_0x715f('0xb1')][_0x117350['queue']][_0x715f('0x106')])){delete this[_0x715f('0x28')][_0x3f78c9[_0x715f('0xd9')]];this[_0x715f('0xb0')](this['voiceQueues'][_0x117350[_0x715f('0xde')]]);this[_0x715f('0xb1')][_0x117350[_0x715f('0xde')]][_0x715f('0x60')]+=0x1;this[_0x715f('0xb1')][_0x117350['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x3bf539=new Hangup(_0x117350,_0x3f78c9);_0x3bf539[_0x715f('0xa6')]=0x10;_0x3bf539['statedesc']=_0x715f('0x107');_0x3bf539[_0x715f('0xe4')]=_0x715f('0x108');this[_0x715f('0xc7')](_0x3bf539)[_0x715f('0xaf')](loggerCatch(_0x715f('0x104')));this[_0x715f('0xc5')](_0x3bf539)['catch'](loggerCatch(_0x715f('0x105')));}if(_0x117350&&_0x117350[_0x715f('0x52')]!==_0x715f('0x7b')&&!isNotNull(this[_0x715f('0xb1')][_0x117350['queue']][_0x715f('0x106')])){delete this[_0x715f('0x28')][_0x3f78c9['uniqueid']];this[_0x715f('0xb0')](this[_0x715f('0xb1')][_0x117350['queue']]);this[_0x715f('0xb1')][_0x117350[_0x715f('0xde')]][_0x715f('0x69')]+=0x1;_0x3bf539=new Hangup(_0x117350,_0x3f78c9);_0x3bf539[_0x715f('0xa6')]=0xc;_0x3bf539['statedesc']=_0x3f78c9[_0x715f('0x109')];_0x3bf539[_0x715f('0xe4')]=_0x715f('0x10a');this[_0x715f('0xc7')](_0x3bf539)[_0x715f('0xaf')](loggerCatch(_0x715f('0x104')));this[_0x715f('0xc5')](_0x3bf539)[_0x715f('0xaf')](loggerCatch(_0x715f('0x105')));}};Dialer['prototype']['syncAgentComplete']=function(_0x2f0775){var _0x2add60=this['uniqueId'][_0x2f0775[_0x715f('0xd9')]];var _0xa9796d=this;if(this['voiceQueues'][_0x2f0775['queue']]){if(_0x2add60&&_0x2add60[_0x715f('0x52')]!==_0x715f('0x7b')){delete this[_0x715f('0x28')][_0x2f0775[_0x715f('0xd9')]];this['voiceQueues'][_0x2f0775[_0x715f('0xde')]][_0x715f('0x60')]+=0x1;var _0x554c96=new AgentComplete(_0x2add60,_0x2f0775);if(_0x2f0775[_0x715f('0x10b')]==='agent'){_0x554c96[_0x715f('0x10c')]=this['voiceQueues'][_0x2f0775['queue']][_0x715f('0x10d')]&&this[_0x715f('0xb1')][_0x2f0775[_0x715f('0xde')]][_0x715f('0x10e')]?moment()[_0x715f('0x7c')](_0x715f('0xfc')):undefined;}this['createHistory'](_0x554c96)['catch'](loggerCatch(_0x715f('0x10f')));this[_0x715f('0xc5')](_0x554c96)[_0x715f('0xaf')](loggerCatch(_0x715f('0x110')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x29112c){if(this[_0x715f('0xb1')][_0x29112c[_0x715f('0xde')]]){if(this[_0x715f('0x28')][_0x29112c['uniqueid']]&&this[_0x715f('0x28')][_0x29112c[_0x715f('0xd9')]][_0x715f('0x52')]!==_0x715f('0x7b')){this['updateOriginated'](this[_0x715f('0xb1')][_0x29112c[_0x715f('0xde')]]);this['uniqueId'][_0x29112c[_0x715f('0xd9')]][_0x715f('0x111')]=moment()[_0x715f('0x7c')](_0x715f('0xfc'));}}};Dialer['prototype'][_0x715f('0x112')]=function(_0x286bc0){this['createHistory'](_0x286bc0)['catch'](loggerCatch(_0x715f('0x10f')));this[_0x715f('0xc5')](_0x286bc0)[_0x715f('0xaf')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x715f('0x1b')]['syncQueueCallerAbandon']=function(_0x546f43){var _0x16a997=this[_0x715f('0x28')][_0x546f43['uniqueid']];var _0x651646=this;if(this[_0x715f('0xb1')][_0x546f43[_0x715f('0xde')]]){if(_0x16a997&&_0x16a997[_0x715f('0x52')]!==_0x715f('0x7b')){delete this[_0x715f('0x28')][_0x546f43[_0x715f('0xd9')]];this[_0x715f('0xb0')](this[_0x715f('0xb1')][_0x546f43[_0x715f('0xde')]]);_0x16a997[_0x715f('0x113')]=moment()[_0x715f('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x700d54=new QueueCallerAbandon(_0x16a997,_0x546f43);if(getSeconds(_0x16a997[_0x715f('0x113')],_0x16a997[_0x715f('0x114')])>=_0x16a997[_0x715f('0x115')]){this['voiceQueues'][_0x546f43['queue']][_0x715f('0x6d')]+=0x1;this['voiceQueues'][_0x546f43[_0x715f('0xde')]][_0x715f('0x65')]+=0x1;this['voiceQueues'][_0x546f43[_0x715f('0xde')]][_0x715f('0x116')]+=0x1;_0x700d54['state']=0xa;_0x700d54[_0x715f('0xa7')]=_0x715f('0x117');_0x700d54[_0x715f('0x118')]=_0x715f('0x119');_0x700d54[_0x715f('0x10c')]=this[_0x715f('0xb1')][_0x546f43[_0x715f('0xde')]]['dialQueueProject2']?moment()[_0x715f('0x7c')](_0x715f('0xfc')):undefined;_0x700d54['countdropretry']+=0x1;_0x700d54[_0x715f('0xeb')]+=0x1;if(_0x700d54[_0x715f('0xf1')]>=this['voiceQueues'][_0x546f43['queue']][_0x715f('0x11a')]){this['queueCallerAbandonCreateState'](_0x700d54);}else{this[_0x715f('0xbe')]({'active':![],'countdropretry':_0x700d54[_0x715f('0xf1')],'scheduledat':moment()[_0x715f('0xfa')](this[_0x715f('0xb1')][_0x546f43['queue']][_0x715f('0x11b')],_0x715f('0x11c'))[_0x715f('0x7c')](_0x715f('0xfc')),'ContactId':_0x16a997[_0x715f('0xcf')],'ListId':_0x16a997['ListId'],'VoiceQueueId':_0x16a997['VoiceQueueId']||undefined,'CampaignId':_0x16a997['CampaignId']||undefined})[_0x715f('0xaf')](loggerCatch(_0x715f('0x11d')));var _0x23ef55=new History(_0x700d54);_0x23ef55[_0x715f('0xa6')]=0xa;_0x23ef55['statedesc']='Drop';_0x23ef55[_0x715f('0xa9')]=moment()[_0x715f('0x7c')](_0x715f('0xfc'));_0x23ef55[_0x715f('0xa8')]=_0x23ef55['starttime'];_0x23ef55['calleridname']=_0x700d54['calleridname'];_0x23ef55[_0x715f('0x11e')]=_0x700d54[_0x715f('0x11e')];this[_0x715f('0xc7')](_0x23ef55)[_0x715f('0xaf')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x715f('0xb1')][_0x546f43[_0x715f('0xde')]][_0x715f('0x81')]+=0x1;this[_0x715f('0xb1')][_0x546f43[_0x715f('0xde')]][_0x715f('0x64')]+=0x1;_0x700d54[_0x715f('0xa6')]=0xb;_0x700d54[_0x715f('0xa7')]='Abandoned';_0x700d54[_0x715f('0x118')]=_0x715f('0x11f');_0x700d54[_0x715f('0xf2')]+=0x1;_0x700d54[_0x715f('0xeb')]+=0x1;if(_0x700d54[_0x715f('0xf2')]>=this[_0x715f('0xb1')][_0x546f43[_0x715f('0xde')]][_0x715f('0x120')]){this[_0x715f('0x112')](_0x700d54);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x700d54[_0x715f('0xf2')],'scheduledat':moment()[_0x715f('0xfa')](this[_0x715f('0xb1')][_0x546f43['queue']]['dialAbandonedRetryFrequency'],_0x715f('0x11c'))['format'](_0x715f('0xfc')),'ContactId':_0x16a997['ContactId'],'ListId':_0x16a997[_0x715f('0xd0')],'VoiceQueueId':_0x16a997[_0x715f('0xfd')]||undefined,'CampaignId':_0x16a997[_0x715f('0xd2')]||undefined})['catch'](loggerCatch(_0x715f('0x121')));var _0x23ef55=new History(_0x700d54);_0x23ef55[_0x715f('0xa6')]=0xb;_0x23ef55[_0x715f('0xa7')]=_0x715f('0x122');_0x23ef55[_0x715f('0xa9')]=moment()[_0x715f('0x7c')](_0x715f('0xfc'));_0x23ef55[_0x715f('0xa8')]=_0x23ef55['starttime'];_0x23ef55[_0x715f('0x123')]=_0x700d54[_0x715f('0x123')];_0x23ef55['calleridnum']=_0x700d54['calleridnum'];this[_0x715f('0xc7')](_0x23ef55)['catch'](loggerCatch(_0x715f('0x124')));}}}}};Dialer['prototype']['syncNewExten']=function(_0x4c240b){if(this[_0x715f('0x26')][_0x4c240b[_0x715f('0xd9')]]){this['actions'][_0x4c240b[_0x715f('0xd9')]]['channel']=_0x4c240b[_0x715f('0x125')];}if(this[_0x715f('0x28')][_0x4c240b[_0x715f('0xd9')]]){this[_0x715f('0x28')][_0x4c240b[_0x715f('0xd9')]][_0x715f('0x125')]=_0x4c240b[_0x715f('0x125')];}};Dialer['prototype'][_0x715f('0x3d')]=function(_0x50586d){if(strategy[this['voiceQueues'][this[_0x715f('0x26')][_0x50586d['actionid']][_0x715f('0xde')]][_0x715f('0x54')]]==='roundrobin'){if(this['actions'][_0x50586d['actionid']]&&_['isNil'](this[_0x715f('0x26')][_0x50586d[_0x715f('0x126')]][_0x715f('0x127')])&&_0x50586d[_0x715f('0xae')]==='1'&&_0x50586d['paused']==='0'){if(this[_0x715f('0x22')][_0x50586d['stateinterface']]){if(!this['agents'][_0x50586d[_0x715f('0x128')]][_0x715f('0x127')]){this[_0x715f('0x22')][_0x50586d[_0x715f('0x128')]][_0x715f('0x127')]=!![];this[_0x715f('0x26')][_0x50586d[_0x715f('0x126')]][_0x715f('0x127')]=!![];this['actions'][_0x50586d[_0x715f('0x126')]]['stateinterface']=_0x50586d['stateinterface'];}}}}else if((strategy[this[_0x715f('0xb1')][this[_0x715f('0x26')][_0x50586d[_0x715f('0x126')]][_0x715f('0xde')]][_0x715f('0x54')]]||'rrmemory')===_0x715f('0x19')){if(this[_0x715f('0x26')][_0x50586d[_0x715f('0x126')]]){if(this[_0x715f('0x22')][_0x50586d['stateinterface']]){this[_0x715f('0x26')][_0x50586d[_0x715f('0x126')]]['stateinterface']=_0x50586d[_0x715f('0x128')];if(_[_0x715f('0xac')](this[_0x715f('0x2d')][this['actions'][_0x50586d[_0x715f('0x126')]]['queue']])){this[_0x715f('0x2d')][this[_0x715f('0x26')][_0x50586d[_0x715f('0x126')]]['queue']]=[];}this[_0x715f('0x2d')][this[_0x715f('0x26')][_0x50586d[_0x715f('0x126')]]['queue']]['push'](_[_0x715f('0xcd')](_['pick'](this[_0x715f('0x26')][_0x50586d[_0x715f('0x126')]],[_0x715f('0x129'),'stateinterface']),{'status':_0x50586d['status'],'paused':_0x50586d[_0x715f('0x12a')]}));}}}};function unlockQueueStatus(_0x1f700f,_0x375ae0){setTimeout(function(){if(_[_0x715f('0x85')](_0x1f700f[_0x715f('0x12b')])){loggerBooked[_0x715f('0x94')](_0x715f('0x12c'),_0x375ae0);}_0x1f700f[_0x715f('0x12b')]=!![];loggerBooked[_0x715f('0x7e')](_0x715f('0x12d'),_0x375ae0,JSON[_0x715f('0x4f')](_[_0x715f('0xce')](_0x1f700f,['name',_0x715f('0x12b')])));},0x1f3);}Dialer[_0x715f('0x1b')][_0x715f('0x3f')]=function(_0x2650c7){var _0x4f1e44=this;var _0x3e4ff1=_0x4f1e44[_0x715f('0xb1')][_0x4f1e44[_0x715f('0x26')][_0x2650c7['actionid']]['queue']];if(strategy[this[_0x715f('0xb1')][this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]]['queue']][_0x715f('0x54')]]===_0x715f('0x1a')){if(this[_0x715f('0x26')][_0x2650c7['actionid']]&&this['actions'][_0x2650c7[_0x715f('0x126')]][_0x715f('0x128')]){this['preview'][_0x715f('0x12e')](this['actions'][_0x2650c7['actionid']]['idHopper'],this['actions'][_0x2650c7[_0x715f('0x126')]][_0x715f('0x128')])[_0x715f('0xaf')](function(_0x18b2be){logger[_0x715f('0x94')](_0x715f('0x12f'),util[_0x715f('0x95')](_0x18b2be,{'showHidden':![],'depth':null}));})['finally'](function(){_0x4f1e44[_0x715f('0xb0')](_0x4f1e44['voiceQueues'][_0x4f1e44[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]]['queue']]);_0x4f1e44[_0x715f('0x22')][_0x4f1e44[_0x715f('0x26')][_0x2650c7['actionid']]['stateinterface']][_0x715f('0x127')]=![];delete _0x4f1e44[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]];unlockQueueStatus(_0x3e4ff1);});}else{this[_0x715f('0xb0')](this[_0x715f('0xb1')][this['actions'][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]]);this[_0x715f('0xbe')]({'active':![],'ContactId':this[_0x715f('0x26')][_0x2650c7['actionid']][_0x715f('0xcf')],'ListId':this['actions'][_0x2650c7['actionid']][_0x715f('0xd0')],'VoiceQueueId':this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xfd')]||undefined,'CampaignId':this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x715f('0x130')));delete this[_0x715f('0x26')][_0x2650c7['actionid']];unlockQueueStatus(_0x3e4ff1);}}else if((strategy[this['voiceQueues'][this[_0x715f('0x26')][_0x2650c7['actionid']][_0x715f('0xde')]][_0x715f('0x54')]]||_0x715f('0x19'))==='rrmemory'){var _0x3cf42e;if(this[_0x715f('0x26')][_0x2650c7['actionid']]&&!_['isEmpty'](this[_0x715f('0x2d')][this[_0x715f('0x26')][_0x2650c7['actionid']][_0x715f('0xde')]])){if(this[_0x715f('0x2e')][_0x4f1e44[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]]){this[_0x715f('0x2e')][_0x4f1e44[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]]=this[_0x715f('0x2e')][this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]]?this[_0x715f('0x2e')][this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]]:this[_0x715f('0x2d')][this['actions'][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]]?this[_0x715f('0x2d')][this[_0x715f('0x26')][_0x2650c7['actionid']]['queue']]['_rr']||0x0:0x0;}this[_0x715f('0x2d')][this['actions'][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]][_0x715f('0x131')]=this[_0x715f('0x2e')][this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]];for(var _0x2b11f7=0x0;_0x2b11f7<this[_0x715f('0x2d')][this['actions'][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]][_0x715f('0x132')];_0x2b11f7+=0x1){_0x3cf42e=rr(this['queueBooked'][this['actions'][_0x2650c7['actionid']][_0x715f('0xde')]]);this[_0x715f('0x2e')][_0x4f1e44[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]]=this[_0x715f('0x2d')][this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]]['queue']][_0x715f('0x131')];if(_0x3cf42e[_0x715f('0xae')]==='1'&&_0x3cf42e[_0x715f('0x12a')]==='0'){break;}}if(!_['isNil'](_0x3cf42e)){this[_0x715f('0x22')][_0x3cf42e[_0x715f('0x128')]][_0x715f('0x133')]=_[_0x715f('0x85')](this[_0x715f('0x22')][_0x3cf42e['stateinterface']][_0x715f('0x133')])?!![]:this[_0x715f('0x22')][_0x3cf42e[_0x715f('0x128')]][_0x715f('0x133')];}loggerBooked[_0x715f('0x7e')](_0x715f('0x134'),_0x2650c7['actionid'],_0x715f('0x135'),JSON[_0x715f('0x4f')](_[_0x715f('0xce')](this[_0x715f('0x22')][_0x3cf42e[_0x715f('0x128')]],['name',_0x715f('0x133')])),_0x715f('0x136'),JSON[_0x715f('0x4f')](_0x3cf42e[_0x715f('0x129')]));if(!_[_0x715f('0xac')](_0x3cf42e)&&_0x3cf42e[_0x715f('0xae')]==='1'&&_0x3cf42e['paused']==='0'&&this[_0x715f('0x22')][_0x3cf42e[_0x715f('0x128')]][_0x715f('0x133')]){this[_0x715f('0x22')][_0x3cf42e[_0x715f('0x128')]][_0x715f('0x133')]=![];this['queueBooked'][_0x4f1e44[_0x715f('0x26')][_0x2650c7['actionid']]['queue']]=[];this[_0x715f('0x20')][_0x715f('0x12e')](_0x3cf42e[_0x715f('0x129')],_0x3cf42e['stateinterface'])[_0x715f('0xaf')](function(_0x5be45c){logger[_0x715f('0x94')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x715f('0x95')](_0x5be45c,{'showHidden':![],'depth':null}));})[_0x715f('0x1e')](function(){_0x4f1e44[_0x715f('0xb0')](_0x4f1e44[_0x715f('0xb1')][_0x4f1e44[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]]);setTimeout(function(){_0x4f1e44[_0x715f('0x22')][_0x3cf42e[_0x715f('0x128')]]['unlockRR']=!![];loggerBooked[_0x715f('0x7e')](_0x715f('0x137'),_0x2650c7[_0x715f('0x126')],_0x715f('0x135'),JSON[_0x715f('0x4f')](_[_0x715f('0xce')](_0x4f1e44['agents'][_0x3cf42e[_0x715f('0x128')]],[_0x715f('0x45'),_0x715f('0x133')])),_0x715f('0x136'),JSON[_0x715f('0x4f')](_0x3cf42e[_0x715f('0x129')]));},0xc7);delete _0x4f1e44['actions'][_0x2650c7[_0x715f('0x126')]];unlockQueueStatus(_0x3e4ff1,_0x2650c7[_0x715f('0x126')]);});}else{loggerBooked[_0x715f('0x7e')]('[booked][unlock]');this[_0x715f('0xb0')](this[_0x715f('0xb1')][this['actions'][_0x2650c7[_0x715f('0x126')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]]['ContactId'],'ListId':this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xd0')],'VoiceQueueId':this[_0x715f('0x26')][_0x2650c7['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]];unlockQueueStatus(_0x3e4ff1);}}else{loggerBooked[_0x715f('0x7e')](_0x715f('0x138'));this[_0x715f('0xb0')](this['voiceQueues'][this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]]);this[_0x715f('0xbe')]({'active':![],'ContactId':this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xcf')],'ListId':this['actions'][_0x2650c7[_0x715f('0x126')]][_0x715f('0xd0')],'VoiceQueueId':this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xfd')]||undefined,'CampaignId':this['actions'][_0x2650c7[_0x715f('0x126')]][_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch(_0x715f('0x139')));delete this[_0x715f('0x26')][_0x2650c7['actionid']];unlockQueueStatus(_0x3e4ff1);}}else{loggerBooked[_0x715f('0x7e')]('[booked][unlock3]');this[_0x715f('0xb0')](this[_0x715f('0xb1')][this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xde')]]);this[_0x715f('0xbe')]({'active':![],'ContactId':this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xcf')],'ListId':this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xd0')],'VoiceQueueId':this[_0x715f('0x26')][_0x2650c7['actionid']][_0x715f('0xfd')]||undefined,'CampaignId':this[_0x715f('0x26')][_0x2650c7[_0x715f('0x126')]][_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this['actions'][_0x2650c7[_0x715f('0x126')]];unlockQueueStatus(_0x3e4ff1);}};Dialer[_0x715f('0x1b')][_0x715f('0x13a')]=function(){var _0x590ab6=this;return BPromise['resolve']()[_0x715f('0x41')](cmHopper[_0x715f('0x13b')]({}))['then'](function(){setInterval(function(){_0x590ab6[_0x715f('0x13c')]();},0x3e8);});};Dialer['prototype'][_0x715f('0x13d')]=function(_0x3320b4){var _0x31f2f7=this;return function(){if(!_0x31f2f7[_0x715f('0xd5')](_0x3320b4[_0x715f('0x75')])){if(!_0x31f2f7[_0x715f('0xd5')](_0x3320b4[_0x715f('0x13e')])){_0x3320b4[_0x715f('0x43')]=_0x715f('0x13f');throw _0x3320b4[_0x715f('0x45')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0x715f('0x140')]=function(_0xdf5ac0,_0x14d66a,_0x4ba893,_0x132875){var _0x1b721d=this;return function(){var _0x50fab4=!![];return _0x1b721d[_0x715f('0x141')](_0xdf5ac0,_0x14d66a,_0x4ba893,_0x132875,_0x50fab4);};};Dialer[_0x715f('0x1b')]['checkIfTimeIntervals']=function(_0x560076,_0xff63ec,_0x3367bb,_0x1d7985){var _0x4ed079=this;return function(){var _0x9d8dbc=![];return _0x4ed079[_0x715f('0x141')](_0x560076[_0x715f('0x4c')],_0xff63ec,_0x3367bb,_0x1d7985,_0x9d8dbc);};};Dialer['prototype'][_0x715f('0x141')]=function(_0xcb59bf,_0x34aaf2,_0x53c78e,_0x2ebbb4,_0x236b25){var _0x4f1426=[];return new BPromise(function(_0x3a5aeb,_0x411a73){if(!isNotNull(_0xcb59bf)){_0x2ebbb4[_0x715f('0x43')]=_0x715f('0x48');return _0x411a73(msgResponse(_0x715f('0x141'),_0x715f('0x142'),_0x53c78e+_0x715f('0x143')));}if(_['isEmpty'](_0xcb59bf)){_0x2ebbb4[_0x715f('0x43')]=_0x715f('0x144');return _0x411a73(msgResponse(_0x715f('0x141'),_0x715f('0x142'),_0x53c78e+_0x715f('0x145')));}if(_0x34aaf2&&_[_0x715f('0x85')](config[_0x715f('0x146')][_0x34aaf2])){_0x2ebbb4[_0x715f('0x43')]=_0x715f('0x147');return _0x411a73(msgResponse(_0x715f('0x141'),_0x715f('0x142'),_0x53c78e+_0x715f('0x148')+_0x34aaf2));}if(_['isArray'](_0xcb59bf)){for(var _0x50efec=0x0;_0x50efec<_0xcb59bf[_0x715f('0x132')];_0x50efec+=0x1){_0x4f1426[_0x715f('0x149')](ami[_0x715f('0xad')]({'action':'command','command':util[_0x715f('0x7c')]('iftime\x20%s,%s',_0xcb59bf[_0x50efec][_0x715f('0x14a')],!_[_0x715f('0x85')](config[_0x715f('0x146')][_0x34aaf2])?_0x34aaf2:'')})['then'](function(_0x556419){return _0x556419[_0x715f('0x14b')][_0x715f('0x14c')](_0x715f('0x14d'))>=0x0;})[_0x715f('0xaf')](myreject(_0x411a73)));}}else{_0x4f1426[_0x715f('0x149')](ami[_0x715f('0xad')]({'action':_0x715f('0x14e'),'command':util[_0x715f('0x7c')](_0x715f('0x14f'),_0xcb59bf,!_['isUndefined'](config['timezones'][_0x34aaf2])?_0x34aaf2:'')})['then'](function(_0xfb84ba){return _0xfb84ba[_0x715f('0x14b')][_0x715f('0x14c')](_0x715f('0x14d'))>=0x0;})[_0x715f('0xaf')](myreject(_0x411a73)));}BPromise['all'](_0x4f1426)[_0x715f('0x41')](function(_0x417630){var _0x1c1211=_[_0x715f('0x150')](_0x417630);if(_0x1c1211){return _0x3a5aeb(_0x1c1211);}else{_0x2ebbb4[_0x715f('0x43')]=_0x236b25?_0x715f('0x151'):_0x715f('0x152');return _0x411a73(msgResponse(_0x715f('0x153'),_0x715f('0x142'),_0x715f('0x154')+_0x236b25+'\x20'+_0x53c78e+'\x20Interval\x20is\x20overtime:\x20'+util[_0x715f('0x95')](_0xcb59bf,{'showHidden':![],'depth':null})+_0x715f('0x155')+_0x34aaf2));}})[_0x715f('0xaf')](function(_0x22397f){return _0x411a73(msgResponse('ifTime',_0x715f('0x142'),JSON[_0x715f('0x4f')](_0x22397f)));});});};Dialer[_0x715f('0x1b')][_0x715f('0x156')]=function(_0x28eb73){var _0x4ca032=this;return function(){switch(_0x28eb73[_0x715f('0x157')]){case _0x715f('0x158'):freeVariablesPredictive(_0x28eb73);_0x4ca032['handlePower'](_0x28eb73,0x1);break;case _0x715f('0x159'):freeVariablesPredictive(_0x28eb73);_0x4ca032['handlePower'](_0x28eb73,_0x28eb73[_0x715f('0x15a')]);break;case _0x715f('0x7'):_0x4ca032[_0x715f('0x7')](_0x28eb73);break;case _0x715f('0x6'):freeVariablesPredictive(_0x28eb73);_0x4ca032[_0x715f('0x15b')](_0x28eb73,0x1);break;default:freeVariablesPredictive(_0x28eb73);logger[_0x715f('0x94')](_0x715f('0x15c'),_0x28eb73['name'],_0x715f('0x15d'));}};};Dialer['prototype'][_0x715f('0x15e')]=function(_0x445702){return BPromise['resolve']()[_0x715f('0x41')](cmHopper['handlePreviewRecallNotifications'](_0x445702['id'],previewRecallmeReminderInterval))[_0x715f('0x41')](function(_0x510c2e){for(var _0x163e2e=0x0;_0x163e2e<_0x510c2e[_0x715f('0x132')];_0x163e2e++){var _0x25faca=_0x510c2e[_0x163e2e][_0x715f('0x15f')][_0x715f('0x45')];if(_0x25faca)io['to'](util[_0x715f('0x7c')](_0x715f('0x160'),_0x25faca))[_0x715f('0x51')]('user:dialPreviewRecallReminder',{'hopper':_0x510c2e[_0x163e2e]});}})[_0x715f('0xaf')](function(_0x403d73){});};Dialer[_0x715f('0x1b')][_0x715f('0x161')]=function(_0x2172b9){var _0x5ebd7c=this;return function(){_0x5ebd7c[_0x715f('0x162')](_0x2172b9);};};Dialer['prototype'][_0x715f('0x9')]=function(_0x924e3b){var _0x175b4d=this;if(isNotPreview(_0x924e3b['dialMethod'])){if(isVoiceQueueOutbound(_0x924e3b[_0x715f('0x52')])&&isActive(_0x924e3b['dialActive'])){_0x924e3b[_0x715f('0x9f')]=!![];BPromise[_0x715f('0xb6')]()[_0x715f('0x41')](checkIsLoggedIn(_0x924e3b,_0x924e3b['loggedIn']))[_0x715f('0x41')](checkIsActive(_0x924e3b,_0x924e3b[_0x715f('0x163')]))[_0x715f('0x41')](checkInterval(_0x924e3b))[_0x715f('0x41')](_0x175b4d[_0x715f('0x13d')](_0x924e3b))[_0x715f('0x41')](_0x175b4d[_0x715f('0x140')](_0x924e3b['dialGlobalInterval'],_0x924e3b[_0x715f('0x164')],_0x924e3b[_0x715f('0x45')],_0x924e3b))['then'](_0x175b4d[_0x715f('0x165')](_0x924e3b['Interval'],_0x924e3b[_0x715f('0x164')],_0x924e3b[_0x715f('0x45')],_0x924e3b))[_0x715f('0x41')](_0x175b4d[_0x715f('0x156')](_0x924e3b))[_0x715f('0xaf')](loggerCatchQueueSummary(_0x715f('0x166'),_0x924e3b));}else{notSendMessagesQueue(_0x924e3b);}}else{freeVariablesPredictive(_0x924e3b);if(_0x924e3b[_0x715f('0x167')]){_0x175b4d['checkPreviewRecallReminder'](_0x924e3b);}}};Dialer['prototype'][_0x715f('0x13c')]=function(){var _0x27a6d7=this;var _0x19e486;for(var _0x5000a7 in this[_0x715f('0x21')]){if(typeof this[_0x715f('0x21')][_0x5000a7]!==_0x715f('0x98')){_0x19e486=this['campaigns'][_0x5000a7];if(isCampaignIvr(_0x19e486[_0x715f('0x52')])&&isActive(_0x19e486[_0x715f('0x76')])){_0x19e486[_0x715f('0x9f')]=!![];BPromise[_0x715f('0xb6')]()[_0x715f('0x41')](checkIsActive(_0x19e486,_0x19e486[_0x715f('0x76')]))['then'](checkInterval(_0x19e486))[_0x715f('0x41')](_0x27a6d7[_0x715f('0x13d')](_0x19e486))[_0x715f('0x41')](_0x27a6d7[_0x715f('0x140')](_0x19e486[_0x715f('0x168')],_0x19e486[_0x715f('0x164')],_0x19e486['name'],_0x19e486))[_0x715f('0x41')](_0x27a6d7[_0x715f('0x165')](_0x19e486[_0x715f('0x4b')],_0x19e486[_0x715f('0x164')],_0x19e486['name'],_0x19e486))['then'](_0x27a6d7[_0x715f('0x161')](_0x19e486))[_0x715f('0xaf')](loggerCatchQueueSummary(_0x715f('0x169'),_0x19e486));}else{notSendMessagesCampaign(_0x19e486);}}}};function getCallerIdRandom(_0x408c51,_0x2334d7){var _0x1aef16;var _0x274b8a;var _0x2daf6c;if(_0x2334d7<=0x0){_0x2334d7=0x1;}_0x1aef16=new RegExp(_0x715f('0x16a')+_0x2334d7+'}$');_0x274b8a=Math['pow'](0xa,_0x2334d7-0x1);_0x2daf6c=Math[_0x715f('0x16b')](0xa,_0x2334d7)-0x1;return util[_0x715f('0x7c')]('%s',_[_0x715f('0x16c')](_0x408c51,_0x1aef16,_['random'](_0x274b8a,_0x2daf6c)));}function extractCalleridName(_0x432386){var _0x2d3ee2=_0x432386[_0x715f('0x16d')](/"(.*?)"/);return _0x2d3ee2?_0x2d3ee2[0x1]:_0x432386;}function extractCalleridNumber(_0x4000ce){var _0x2960b4=_0x4000ce['match'](/<(.*?)>/);return _0x2960b4?_0x2960b4[0x1]:_0x4000ce;}Dialer[_0x715f('0x1b')][_0x715f('0x16e')]=function(_0x483835,_0x5218f4){var _0x3d26cf=this;var _0x5d0cf8=uuid['v4']();this[_0x715f('0x26')][_0x5d0cf8]=new Action(_0x483835,_0x5218f4,_0x5d0cf8);return new BPromise(function(_0x3d25d4,_0x55ebe4){if(_['isUndefined'](_0x483835)&&typeof _0x483835!==_0x715f('0x16f')){return _0x55ebe4(msgResponse('originate','Failure',_0x715f('0x170')));}if(_[_0x715f('0x85')](_0x5218f4[_0x715f('0x171')]['phone'])||_0x5218f4[_0x715f('0x171')][_0x715f('0x172')]===null){return _0x55ebe4(msgResponse(_0x715f('0x173'),'Failure',_0x715f('0x174')));}var _0x578d21={'XMD-CALLERID':_0x3d26cf[_0x715f('0x26')][_0x5d0cf8]['getCaller'](),'XMD-AGI':_0x483835['dialQueueProject']?util[_0x715f('0x7c')](_0x715f('0x175'),ipAgi,_0x483835[_0x715f('0x106')]):'NONE','XMD-AGIAFTER':_0x483835['dialQueueProject2']?util[_0x715f('0x7c')](_0x715f('0x175'),ipAgi,_0x483835[_0x715f('0x10d')]):_0x715f('0x176'),'XMD-QUEUE':_0x483835[_0x715f('0x52')]==='outbound'?util[_0x715f('0x7c')](_0x715f('0x177'),_0x483835[_0x715f('0x45')],_0x483835[_0x715f('0x178')]||'',_0x483835[_0x715f('0x10e')]?'c':'',_0x483835[_0x715f('0x115')]||0x3):'NONE','XMD-CONTACTID':_0x5218f4[_0x715f('0xcf')],'XMD-CDRTYPE':_0x715f('0x5'),'CALLERID(all)':_0x3d26cf[_0x715f('0x26')][_0x5d0cf8]['getCaller'](),'XMD-AMD':_0x483835[_0x715f('0xdf')]?_0x715f('0x179'):_0x715f('0x176'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x483835[_0x715f('0xdf')]){_0x578d21[_0x715f('0x17a')]=_0x483835[_0x715f('0x17b')]||0x9c4;_0x578d21[_0x715f('0x17c')]=_0x483835[_0x715f('0x17d')]||0x5dc;_0x578d21[_0x715f('0x17e')]=_0x483835['dialAMDAfterGreetingSilence']||0x320;_0x578d21[_0x715f('0x17f')]=_0x483835[_0x715f('0x180')]||0x1388;_0x578d21['XMD-AMDMINWORDLENGTH']=_0x483835[_0x715f('0x181')]||0x64;_0x578d21[_0x715f('0x182')]=_0x483835[_0x715f('0x183')]||0x32;_0x578d21['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x483835[_0x715f('0x184')]||0x3;_0x578d21[_0x715f('0x185')]=_0x483835[_0x715f('0x186')]||0x100;_0x578d21['XMD-AMDMAXIMUMWORDLENGTH']=_0x483835[_0x715f('0x187')]||0x1388;}if(_0x483835[_0x715f('0x52')]==='outbound'){_0x578d21[_0x715f('0x188')]=_0x5218f4[_0x715f('0xfd')];}else{_0x578d21['XMD-CAMPAIGNID']=_0x5218f4['CampaignId'];}for(var _0x31f56a in _0x5218f4[_0x715f('0x171')]){if(typeof _0x5218f4[_0x715f('0x171')][_0x31f56a]!==_0x715f('0x98')){if(isNotNull(_0x5218f4['Contact'][_0x31f56a])&&_0x31f56a!=='id'&&_0x31f56a!==_0x715f('0x189')&&_0x31f56a!==_0x715f('0x18a')&&_0x31f56a!==_0x715f('0x18b')){_0x578d21[util['format'](_0x715f('0x18c'),_0x715f('0x18d'),_[_0x715f('0x18e')](_0x31f56a))]=_0x5218f4[_0x715f('0x171')][_0x31f56a];}}}var _0x5350f0=_0x3d26cf[_0x715f('0xd5')](_0x483835[_0x715f('0x75')])?getCallerId(_0x483835[_0x715f('0x75')][_0x715f('0x77')],_0x483835['dialOriginateCallerIdName'],_0x483835[_0x715f('0x18f')]>0x0?getCallerIdRandom(_0x483835[_0x715f('0x190')],_0x483835[_0x715f('0x18f')]):_0x483835['dialOriginateCallerIdNumber']):getCallerId(_[_0x715f('0xac')](_0x483835[_0x715f('0x13e')])?_0x483835['Trunk']['callerid']:_0x483835[_0x715f('0x13e')][_0x715f('0x77')],_0x483835['dialOriginateCallerIdName'],_0x483835[_0x715f('0x18f')]>0x0?getCallerIdRandom(_0x483835[_0x715f('0x190')],_0x483835[_0x715f('0x18f')]):_0x483835[_0x715f('0x190')]);if(_0x5350f0){_0x578d21[_0x715f('0x191')]=_0x3d26cf[_0x715f('0x26')][_0x5d0cf8][_0x715f('0x192')]=extractCalleridName(_0x5350f0);_0x578d21[_0x715f('0x193')]=_0x3d26cf[_0x715f('0x26')][_0x5d0cf8][_0x715f('0x194')]=extractCalleridNumber(_0x5350f0);}return ami['Action']({'actionid':_0x5d0cf8,'action':'originate','channel':_0x3d26cf[_0x715f('0xd5')](_0x483835[_0x715f('0x75')])?util[_0x715f('0x7c')]('SIP/%s/%s%s',_0x483835['Trunk'][_0x715f('0x45')],isNotNull(_0x483835[_0x715f('0x5f')])?_0x483835[_0x715f('0x5f')][_0x715f('0x195')]()||'':'',_0x483835['dialCutDigit']>0x0?_0x5218f4[_0x715f('0x171')]['phone']['substring'](_0x483835[_0x715f('0x196')]):_0x5218f4[_0x715f('0x171')][_0x715f('0x172')]):util[_0x715f('0x7c')](_0x715f('0x197'),_[_0x715f('0xac')](_0x483835[_0x715f('0x13e')])?_0x483835['Trunk'][_0x715f('0x45')]:_0x483835['TrunkBackup'][_0x715f('0x45')],isNotNull(_0x483835['dialPrefix'])?_0x483835[_0x715f('0x5f')][_0x715f('0x195')]()||'':'',_0x483835[_0x715f('0x196')]>0x0?_0x5218f4[_0x715f('0x171')][_0x715f('0x172')]['substring'](_0x483835[_0x715f('0x196')]):_0x5218f4[_0x715f('0x171')][_0x715f('0x172')]),'callerid':_0x5350f0,'Exten':_0x715f('0xdd'),'Context':_0x715f('0x198'),'Priority':'1','variable':_0x578d21,'timeout':(_0x483835['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5d0cf8})['then'](function(_0x3a3fcb){return _0x3d25d4(_0x3a3fcb);})[_0x715f('0xaf')](function(_0x2bb541){_0x483835[_0x715f('0x67')]+=0x1;var _0x423da3=new History(_0x3d26cf['actions'][_0x5d0cf8]);logger[_0x715f('0x94')](util[_0x715f('0x7c')](_0x715f('0x199'),JSON[_0x715f('0x4f')](_0x2bb541)));_0x423da3['state']=0xe;_0x423da3[_0x715f('0xa7')]=_0x715f('0x19a');_0x423da3[_0x715f('0xa9')]=moment()['format'](_0x715f('0xfc'));_0x423da3[_0x715f('0xa8')]=_0x423da3[_0x715f('0xa9')];_0x3d26cf['createHistory'](_0x423da3)['catch'](loggerCatch(_0x715f('0x19b')));_0x3d26cf[_0x715f('0xc5')](_0x423da3)[_0x715f('0xaf')](loggerCatch(_0x715f('0x19b')))['finally'](function(){delete _0x3d26cf[_0x715f('0x26')][_0x5d0cf8];return _0x55ebe4(msgResponse(_0x715f('0x173'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x715f('0x1b')][_0x715f('0x33')]=function(_0x52af12){var _0x1855fa=this[_0x715f('0x26')][_0x52af12['actionid']];if(_0x1855fa){delete this[_0x715f('0x26')][_0x52af12[_0x715f('0x126')]];_0x1855fa[_0x715f('0x114')]=moment()[_0x715f('0x7c')](_0x715f('0xfc'));var _0xfbd060=_0x1855fa[_0x715f('0x52')]===_0x715f('0x7b')?this[_0x715f('0x21')][_0x1855fa[_0x715f('0xde')]]:this[_0x715f('0xb1')][_0x1855fa[_0x715f('0x19c')]()];if(!this[_0x715f('0xd3')](_0x52af12[_0x715f('0x19d')])){this[_0x715f('0xb0')](_0xfbd060);return this['callProgressDetecting'](_0x1855fa,_0xfbd060,_0x52af12)[_0x715f('0xaf')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x715f('0x28')][_0x52af12[_0x715f('0xd9')]]=_0x1855fa;}};Dialer['prototype'][_0x715f('0x19e')]=function(_0x520ef4,_0x29ff85,_0x3a73eb){var _0x20cfdd=new History(_0x29ff85);if(_0x20cfdd[_0x715f('0x102')]+_0x20cfdd['countcongestionretry']+_0x20cfdd[_0x715f('0xef')]+_0x20cfdd['countnosuchnumberretry']+_0x20cfdd[_0x715f('0xf1')]+_0x20cfdd[_0x715f('0xf2')]+_0x20cfdd[_0x715f('0xea')]+_0x20cfdd[_0x715f('0xf3')]>=_0x3a73eb[_0x715f('0xf4')]-0x1){return!![];}switch(_0x520ef4){case 0x3:if(_0x20cfdd[_0x715f('0xef')]>=_0x3a73eb[_0x715f('0x19f')]-0x1){return!![];}this[_0x715f('0xbe')]({'active':![],'countnoanswerretry':_0x20cfdd[_0x715f('0xef')]+=0x1,'scheduledat':moment()[_0x715f('0xfa')](_0x3a73eb[_0x715f('0x1a0')],_0x715f('0x11c'))['format'](_0x715f('0xfc')),'ContactId':_0x20cfdd[_0x715f('0xcf')],'ListId':_0x20cfdd[_0x715f('0xd0')],'VoiceQueueId':_0x20cfdd['VoiceQueueId']||undefined,'CampaignId':_0x20cfdd[_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x20cfdd[_0x715f('0x102')]>=_0x3a73eb[_0x715f('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x20cfdd[_0x715f('0x102')]+=0x1,'scheduledat':moment()[_0x715f('0xfa')](_0x3a73eb[_0x715f('0x1a2')],_0x715f('0x11c'))[_0x715f('0x7c')](_0x715f('0xfc')),'ContactId':_0x20cfdd[_0x715f('0xcf')],'ListId':_0x20cfdd[_0x715f('0xd0')],'VoiceQueueId':_0x20cfdd[_0x715f('0xfd')]||undefined,'CampaignId':_0x20cfdd['CampaignId']||undefined})[_0x715f('0xaf')](loggerCatch(_0x715f('0x1a3')));break;case 0x8:if(_0x20cfdd[_0x715f('0xee')]>=_0x3a73eb[_0x715f('0x1a4')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x20cfdd[_0x715f('0xee')]+=0x1,'scheduledat':moment()[_0x715f('0xfa')](_0x3a73eb[_0x715f('0x1a5')],_0x715f('0x11c'))[_0x715f('0x7c')](_0x715f('0xfc')),'ContactId':_0x20cfdd[_0x715f('0xcf')],'ListId':_0x20cfdd['ListId'],'VoiceQueueId':_0x20cfdd[_0x715f('0xfd')]||undefined,'CampaignId':_0x20cfdd[_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x20cfdd['countnosuchnumberretry']>=_0x3a73eb[_0x715f('0x1a6')]-0x1){return!![];}else{this[_0x715f('0xbe')]({'active':![],'countnosuchnumberretry':_0x20cfdd[_0x715f('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x3a73eb[_0x715f('0x1a7')],_0x715f('0x11c'))[_0x715f('0x7c')](_0x715f('0xfc')),'ContactId':_0x20cfdd['ContactId'],'ListId':_0x20cfdd[_0x715f('0xd0')],'VoiceQueueId':_0x20cfdd[_0x715f('0xfd')]||undefined,'CampaignId':_0x20cfdd[_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x20cfdd[_0x715f('0xf1')]>=_0x3a73eb[_0x715f('0x11a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x20cfdd[_0x715f('0xf1')]+=0x1,'scheduledat':moment()[_0x715f('0xfa')](_0x3a73eb['dialDropRetryFrequency'],'minutes')['format'](_0x715f('0xfc')),'ContactId':_0x20cfdd[_0x715f('0xcf')],'ListId':_0x20cfdd[_0x715f('0xd0')],'VoiceQueueId':_0x20cfdd[_0x715f('0xfd')]||undefined,'CampaignId':_0x20cfdd[_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch(_0x715f('0x11d')));break;case 0xb:if(_0x20cfdd[_0x715f('0xf2')]>=_0x3a73eb[_0x715f('0x120')]-0x1){return!![];}this[_0x715f('0xbe')]({'active':![],'countabandonedretry':_0x20cfdd[_0x715f('0xf2')]+=0x1,'scheduledat':moment()[_0x715f('0xfa')](_0x3a73eb[_0x715f('0x1a8')],_0x715f('0x11c'))['format'](_0x715f('0xfc')),'ContactId':_0x20cfdd['ContactId'],'ListId':_0x20cfdd[_0x715f('0xd0')],'VoiceQueueId':_0x20cfdd[_0x715f('0xfd')]||undefined,'CampaignId':_0x20cfdd[_0x715f('0xd2')]||undefined})['catch'](loggerCatch(_0x715f('0x121')));break;case 0x13:if(_0x20cfdd[_0x715f('0xea')]>=_0x3a73eb[_0x715f('0xf7')]-0x1){return!![];}this[_0x715f('0xbe')]({'active':![],'countmachineretry':_0x20cfdd[_0x715f('0xea')]+=0x1,'scheduledat':moment()[_0x715f('0xfa')](_0x3a73eb['dialMachineRetryFrequency'],'minutes')[_0x715f('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x20cfdd[_0x715f('0xcf')],'ListId':_0x20cfdd[_0x715f('0xd0')],'VoiceQueueId':_0x20cfdd[_0x715f('0xfd')]||undefined,'CampaignId':_0x20cfdd[_0x715f('0xd2')]||undefined})['catch'](loggerCatch(_0x715f('0xfe')));break;case 0x14:if(_0x20cfdd[_0x715f('0xf3')]>=_0x3a73eb['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x715f('0xbe')]({'active':![],'countagentrejectretry':_0x20cfdd['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x715f('0xfa')](_0x3a73eb['dialAgentRejectRetryFrequency'],_0x715f('0x11c'))['format'](_0x715f('0xfc')),'ContactId':_0x20cfdd[_0x715f('0xcf')],'ListId':_0x20cfdd[_0x715f('0xd0')],'VoiceQueueId':_0x20cfdd[_0x715f('0xfd')]||undefined,'CampaignId':_0x20cfdd[_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch(_0x715f('0x1a9')));break;default:return!![];}};Dialer[_0x715f('0x1b')][_0x715f('0x1aa')]=function(_0x11ab55,_0x101c71,_0x2e4430){var _0x30dfea=this;var _0x1c9fe0=new History(_0x11ab55);return new BPromise(function(_0x49ad61,_0x5e5dc9){if(_[_0x715f('0x85')](_0x101c71)&&typeof _0x101c71!==_0x715f('0x16f')){return _0x5e5dc9(msgResponse(_0x715f('0x1ab'),_0x715f('0x142'),_0x715f('0x1ac')));}if(_[_0x715f('0x85')](_0x2e4430)&&typeof _0x2e4430!=='object'){return _0x5e5dc9(msgResponse(_0x715f('0x1ab'),_0x715f('0x142'),_0x715f('0x1ad')));}switch(_0x2e4430[_0x715f('0x10b')]){case'0':_0x101c71[_0x715f('0x1ae')]+=0x1;_0x1c9fe0[_0x715f('0xa6')]=0x0;_0x1c9fe0['statedesc']=_0x715f('0x1af');_0x1c9fe0[_0x715f('0xf0')]+=0x1;_0x1c9fe0[_0x715f('0xeb')]+=0x1;ami[_0x715f('0x51')](_0x715f('0x1b0'),ut['buildObj'](_0x11ab55,_0x715f('0x1b1')));_0x30dfea['createHistory'](_0x1c9fe0)[_0x715f('0xaf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x30dfea[_0x715f('0x19e')](0x0,_0x11ab55,_0x101c71)){if(_0x1c9fe0['countnosuchnumberretry']>=_0x101c71[_0x715f('0x1a6')]){_0x30dfea[_0x715f('0xf8')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1b2'));}else{_0x30dfea[_0x715f('0xf5')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1b2'));}}break;case'3':_0x101c71[_0x715f('0x66')]+=0x1;_0x1c9fe0['state']=0x3;_0x1c9fe0['statedesc']='NoAnswer';_0x1c9fe0[_0x715f('0xef')]+=0x1;_0x1c9fe0[_0x715f('0xeb')]+=0x1;ami[_0x715f('0x51')](_0x715f('0x1b3'),ut[_0x715f('0xe6')](_0x11ab55,'noanswer'));_0x30dfea[_0x715f('0xc7')](_0x1c9fe0)[_0x715f('0xaf')](loggerCatch(_0x715f('0x1b4')));if(_0x30dfea['checkRetriveMax'](0x3,_0x11ab55,_0x101c71)){if(_0x1c9fe0[_0x715f('0xef')]>=_0x101c71[_0x715f('0x19f')]){_0x30dfea[_0x715f('0xf8')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1b5'));}else{_0x30dfea[_0x715f('0xf5')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1b5'));}}break;case'5':_0x101c71[_0x715f('0x61')]+=0x1;_0x1c9fe0[_0x715f('0xa6')]=0x5;_0x1c9fe0[_0x715f('0xa7')]='Busy';_0x1c9fe0['countbusyretry']+=0x1;_0x1c9fe0['countglobal']+=0x1;ami[_0x715f('0x51')](_0x715f('0x1b6'),ut[_0x715f('0xe6')](_0x11ab55,_0x715f('0x1b7')));_0x30dfea['createHistory'](_0x1c9fe0)[_0x715f('0xaf')](loggerCatch(_0x715f('0x1b8')));if(_0x30dfea[_0x715f('0x19e')](0x5,_0x11ab55,_0x101c71)){if(_0x1c9fe0[_0x715f('0x102')]>=_0x101c71['dialBusyMaxRetry']){_0x30dfea[_0x715f('0xf8')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1b9'));}else{_0x30dfea[_0x715f('0xf5')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1b9'));}}break;case'8':_0x101c71[_0x715f('0x62')]+=0x1;_0x1c9fe0[_0x715f('0xa6')]=0x8;_0x1c9fe0[_0x715f('0xa7')]=_0x715f('0x1ba');_0x1c9fe0[_0x715f('0xee')]+=0x1;_0x1c9fe0[_0x715f('0xeb')]+=0x1;ami[_0x715f('0x51')](_0x715f('0x1bb'),ut['buildObj'](_0x11ab55,_0x715f('0x1bc')));_0x30dfea[_0x715f('0xc7')](_0x1c9fe0)[_0x715f('0xaf')](loggerCatch(_0x715f('0x1bd')));if(_0x30dfea[_0x715f('0x19e')](0x8,_0x11ab55,_0x101c71)){if(_0x1c9fe0[_0x715f('0xee')]>=_0x101c71['dialCongestionMaxRetry']){_0x30dfea[_0x715f('0xf8')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1be'));}else{_0x30dfea[_0x715f('0xf5')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1be'));}}break;case'11':_0x101c71[_0x715f('0x1bf')]+=0x1;_0x1c9fe0[_0x715f('0xa6')]=0xb;_0x1c9fe0[_0x715f('0xa7')]='Abandoned';_0x1c9fe0[_0x715f('0xf2')]+=0x1;_0x1c9fe0[_0x715f('0xeb')]+=0x1;_0x30dfea[_0x715f('0xc7')](_0x1c9fe0)[_0x715f('0xaf')](loggerCatch(_0x715f('0x124')));if(_0x30dfea[_0x715f('0x19e')](0xb,_0x11ab55,_0x101c71)){if(_0x1c9fe0[_0x715f('0xf2')]>=_0x101c71[_0x715f('0x120')]){_0x30dfea[_0x715f('0xf8')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,'reason\x2011\x20abandoned');}else{_0x30dfea[_0x715f('0xf5')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1c0'));}}break;case'20':_0x101c71['outboundRejectCallsDay']+=0x1;_0x1c9fe0[_0x715f('0xa6')]=0x14;_0x1c9fe0[_0x715f('0xa7')]=_0x715f('0x1c1');_0x1c9fe0[_0x715f('0xf3')]+=0x1;_0x1c9fe0[_0x715f('0xeb')]+=0x1;ami[_0x715f('0x51')](_0x715f('0x1c2'),ut[_0x715f('0xe6')](_0x11ab55,_0x715f('0x1c3')));_0x30dfea[_0x715f('0xc7')](_0x1c9fe0)[_0x715f('0xaf')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x30dfea[_0x715f('0x19e')](0x14,_0x11ab55,_0x101c71)){if(_0x1c9fe0[_0x715f('0xf3')]>=_0x101c71[_0x715f('0x1c4')]){_0x30dfea[_0x715f('0xf8')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1c5'));}else{_0x30dfea[_0x715f('0xf5')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x715f('0x1c5'));}}break;default:_0x101c71[_0x715f('0x69')]+=0x1;_0x1c9fe0[_0x715f('0xa6')]=0xc;_0x1c9fe0[_0x715f('0xa7')]=_0x2e4430['reason'];_0x30dfea[_0x715f('0xc7')](_0x1c9fe0)[_0x715f('0xaf')](loggerCatch(_0x715f('0x1c6')));if(_0x30dfea[_0x715f('0x19e')](_0x2e4430[_0x715f('0x10b')],_0x11ab55,_0x101c71)){if(_0x1c9fe0['countbusyretry']+_0x1c9fe0[_0x715f('0xee')]+_0x1c9fe0['countnoanswerretry']+_0x1c9fe0[_0x715f('0xf0')]+_0x1c9fe0[_0x715f('0xf1')]+_0x1c9fe0[_0x715f('0xf2')]+_0x1c9fe0['countmachineretry']+_0x1c9fe0[_0x715f('0xf3')]>=_0x101c71[_0x715f('0xf4')]){_0x30dfea['stateGlobal'](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x2e4430['reason']);}else{_0x30dfea[_0x715f('0xf8')](_0x1c9fe0,_0x49ad61,_0x5e5dc9,_0x2e4430['reason']);}}}});};Dialer[_0x715f('0x1b')][_0x715f('0xf5')]=function(_0x30d1f5,_0xf9b1aa,_0x164208,_0x4ddf45){var _0x5c1653=new Final(_0x30d1f5);_0x5c1653[_0x715f('0xa6')]=0xf;_0x5c1653[_0x715f('0xa7')]=_0x715f('0x1c7');this[_0x715f('0xf8')](_0x5c1653,_0xf9b1aa,_0x164208,_0x4ddf45);};Dialer[_0x715f('0x1b')][_0x715f('0xf8')]=function(_0x55a308,_0x469d28,_0xfb033e,_0xe34042){this['moveContactManagedDialer'](_0x55a308)[_0x715f('0x41')](function(){return _0x469d28(msgResponse(_0x715f('0x1ab'),'Success',_0xe34042));})[_0x715f('0xaf')](function(){return _0xfb033e(msgResponse(_0x715f('0x1c8'),_0x715f('0x142'),'contact\x20not\x20moved'));});};Dialer[_0x715f('0x1b')][_0x715f('0x7')]=function(_0x21a838){var _0x22e303=_0x21a838[_0x715f('0x1c9')]/0x64;var _0x3fe203=_0x21a838[_0x715f('0x65')]/(_0x21a838['outboundDropCallsDayTimeout']+_0x21a838[_0x715f('0x60')]);var _0x22418b=Math['round'](_0x21a838[_0x715f('0x1ca')]*(_0x21a838[_0x715f('0x1cb')]/0x64));var _0x21ac2b=Math[_0x715f('0x1cc')](_0x21a838['predictiveIntervalAvailable']*(_0x21a838[_0x715f('0x1cd')]/0x64));var _0xe32a22=_0x21a838[_0x715f('0x55')]+_0x21a838['talking'];var _0xc6835c=Math[_0x715f('0x1ce')](_0x21a838[_0x715f('0x73')]*_0x21a838[_0x715f('0x8b')]*_0x21a838[_0x715f('0x6f')]*_0x21a838[_0x715f('0x70')]);if(_[_0x715f('0x85')](_0x21a838[_0x715f('0x2b')])){if(!_[_0x715f('0x85')](_0x21a838[_0x715f('0x2a')])){_0x21a838['startPredictive']=undefined;loggerPredictive[_0x715f('0x94')](_0x715f('0x1cf'),_0x715f('0x1d0'));}if(!_[_0x715f('0x85')](_0x21a838[_0x715f('0x8f')])){loggerPredictive[_0x715f('0x94')]('[startMethodPredictive][StartProgressive]',_0x715f('0x1d1'));clearInterval(_0x21a838['handlePredictive']);_0x21a838['handlePredictive']=undefined;}_0x21a838[_0x715f('0x2b')]=moment()[_0x715f('0x7c')](_0x715f('0xfc'));loggerPredictive[_0x715f('0x7e')](_0x21a838[_0x715f('0x45')],_0x715f('0x1d2'),_0x21a838[_0x715f('0x2b')]);this[_0x715f('0x15b')](_0x21a838,0x1);}else if(ifInterval(_0x21a838[_0x715f('0x1d3')],_0x21a838['startProgressive'])){this[_0x715f('0x15b')](_0x21a838,0x1);loggerPredictiveCalls[_0x715f('0x7e')](_0x715f('0x1d4'),_0x21a838[_0x715f('0x2b')],_0x21a838[_0x715f('0x45')]);_0x21a838[_0x715f('0x73')]=0x0;_0x21a838['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x22e303<_0x3fe203&&_0x21a838[_0x715f('0x1d5')]===_0x715f('0x1d6')){freeVariablesPredictive(_0x21a838);loggerPredictive[_0x715f('0x7e')](_0x715f('0x1d7'),_0x715f('0x1d8'),_0x3fe203,'startProgressive',_0x21a838['name']);}else if(_0xc6835c<_0x21a838[_0x715f('0x116')]&&_0x21a838[_0x715f('0x1d5')]===_0x715f('0x1d6')){freeVariablesPredictive(_0x21a838);loggerPredictive['info'](_0x715f('0x1d9'),_0x715f('0x1da'),_0xc6835c,_0x715f('0x1db'),_0x21a838[_0x715f('0x116')],_0x715f('0x2b'),_0x21a838[_0x715f('0x45')]);}else if(!ifInterval(_0x21a838[_0x715f('0x1d3')],_0x21a838[_0x715f('0x2b')])&&_[_0x715f('0x85')](_0x21a838[_0x715f('0x2a')])&&!_[_0x715f('0x85')](_0x21a838[_0x715f('0x2b')])){_0x21a838[_0x715f('0x2a')]=moment()[_0x715f('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x715f('0x7e')](_0x21a838[_0x715f('0x45')],'started\x20in\x20predictive\x20at',_0x21a838['startPredictive']);this['averageHandleTime'](_0x21a838[_0x715f('0x1d3')])[_0x715f('0x41')](this[_0x715f('0x1dc')](_0x21a838))[_0x715f('0x41')](mergeDataErlangB(_0x21a838))[_0x715f('0x41')](this[_0x715f('0x1dd')](_0x21a838))[_0x715f('0xaf')](loggerCatchPredictive(_0x715f('0x1de'),_0x21a838));}else if(!ifInterval(_0x21a838[_0x715f('0x1d3')],_0x21a838[_0x715f('0x2a')])){_0x21a838[_0x715f('0x116')]=0x0;_0x21a838['startPredictive']=moment()[_0x715f('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x715f('0x7e')](_0x21a838[_0x715f('0x45')],_0x715f('0x1df'),_0x21a838[_0x715f('0x2a')]);clearInterval(_0x21a838['handlePredictive']);_0x21a838[_0x715f('0x8f')]=undefined;this[_0x715f('0xbb')](_0x21a838['dialPredictiveInterval'])[_0x715f('0x41')](this[_0x715f('0x1dc')](_0x21a838))['then'](mergeDataErlangB(_0x21a838))[_0x715f('0x41')](this[_0x715f('0x1dd')](_0x21a838))[_0x715f('0xaf')](loggerCatchPredictive(_0x715f('0x1e0'),_0x21a838));}else if(_0x21a838[_0x715f('0x1ca')]&&_0xe32a22<_0x21a838[_0x715f('0x1ca')]-_0x21ac2b){freeVariablesPredictive(_0x21a838);loggerPredictive[_0x715f('0x7e')](_0x21a838[_0x715f('0x45')],_0x715f('0x1e1'),_0xe32a22,_0x715f('0x1e2'),_0x21a838['predictiveIntervalAvailable'],'-',_0x21ac2b,'=',_0x21a838[_0x715f('0x1ca')]-_0x21ac2b,')');}else if(_0x21a838[_0x715f('0x1ca')]&&_0xe32a22>_0x21a838[_0x715f('0x1ca')]+_0x22418b){freeVariablesPredictive(_0x21a838);loggerPredictive[_0x715f('0x7e')](_0x21a838[_0x715f('0x45')],_0x715f('0x1e1'),_0xe32a22,_0x715f('0x1e3'),_0x21a838[_0x715f('0x1ca')],'+',_0x22418b,'=',_0x21a838[_0x715f('0x1ca')]+_0x22418b,')');}};Dialer[_0x715f('0x1b')][_0x715f('0x1dc')]=function(_0x3b76ac){var _0x5cc457=this;return function(_0x9d8276){return new BPromise(function(_0x1aea5e,_0x433d1c){_[_0x715f('0xcd')](_0x3b76ac,_0x9d8276[0x0]);if(checkGetDataPredictive(_0x9d8276[0x0])){var _0xbc93bc=_0x3b76ac[_0x715f('0x1ca')]=_0x3b76ac[_0x715f('0x5a')]+_0x3b76ac[_0x715f('0x55')];var _0x2586ae=_0x3b76ac[_0x715f('0x1d3')]*0x3c;var _0x21ddaa=_0x9d8276[0x0][_0x715f('0x6c')]+_0x9d8276[0x0][_0x715f('0x6b')];var _0x5d683b=(_0x9d8276[0x0][_0x715f('0x6a')]+_0x9d8276[0x0][_0x715f('0x6d')]+_0x9d8276[0x0][_0x715f('0x81')])/_0x9d8276[0x0][_0x715f('0x72')];_0x3b76ac['predictiveIntervalHitRate']=_0x5d683b>0x0?_0x5d683b:0x1;switch(_0x3b76ac[_0x715f('0x1d5')]){case _0x715f('0x1d6'):var _0x53a89e=_0x3b76ac['dialPredictiveOptimizationPercentage']/0x64;return _0x5cc457[_0x715f('0x1e4')](_0xbc93bc,_0x2586ae,_0x21ddaa,_0x5d683b,_0x53a89e)[_0x715f('0x41')](function(_0x4262a3){return _0x1aea5e(_0x4262a3);});case _0x715f('0x1e5'):var _0x448598=_0x3b76ac[_0x715f('0x1c9')]/0x64;return _0x5cc457[_0x715f('0x1e6')](_0xbc93bc,_0x2586ae,_0x21ddaa,_0x5d683b,_0x448598)['then'](function(_0x18e4a1){return _0x1aea5e(_0x18e4a1);});default:return _0x433d1c(msgResponse(_0x715f('0x1e7'),_0x715f('0x142'),_0x715f('0x1e8')));}}else{return _0x433d1c(msgResponse(_0x715f('0x1e7'),_0x715f('0x142'),_0x715f('0x1e9')));}});};};Dialer[_0x715f('0x1b')][_0x715f('0x1ea')]=function(_0x16c1ee){var _0x120dea=this;return function(_0x5b28b3){return new BPromise(function(_0x527501,_0x4e7b7b){_[_0x715f('0xcd')](_0x16c1ee,_0x5b28b3[0x0]);if(checkGetDataPredictive(_0x5b28b3[0x0])){loggerPredictive[_0x715f('0x7e')](JSON['stringify'](_0x5b28b3[0x0]));if(_0x16c1ee[_0x715f('0x1d5')]===_0x715f('0x1d6')){return _0x120dea[_0x715f('0xc4')](_0x16c1ee['id'])['then'](function(_0x4d97cb){var _0xf892d1=_0x16c1ee[_0x715f('0x56')]-_0x4d97cb[0x0][_0x715f('0x1eb')];var _0x262b5e=_0x16c1ee[_0x715f('0x1d3')]*0x3c;var _0x56c210=_0x5b28b3[0x0][_0x715f('0x6c')]+_0x5b28b3[0x0][_0x715f('0x6b')];var _0x12225c=(_0x5b28b3[0x0][_0x715f('0x6a')]+_0x5b28b3[0x0][_0x715f('0x6d')]+_0x5b28b3[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5b28b3[0x0][_0x715f('0x72')];var _0xf2dbf9=_0x16c1ee['dialPredictiveOptimizationPercentage']/0x64;_0x16c1ee[_0x715f('0x71')]=_0x4d97cb[0x0][_0x715f('0x1eb')]||0x0;_0x16c1ee[_0x715f('0x6f')]=_0x12225c>0x0?_0x12225c:0x1;return _0x120dea['abandonmentRate'](_0xf892d1,_0x262b5e,_0x56c210,_0x12225c,_0xf2dbf9);})[_0x715f('0x41')](function(_0x588b7f){return _0x527501(_0x588b7f);})[_0x715f('0xaf')](function(_0x5a7e1d){return _0x4e7b7b(msgResponse(_0x715f('0x1ec'),_0x715f('0x142'),JSON[_0x715f('0x4f')](_0x5a7e1d)));});}if(_0x16c1ee[_0x715f('0x1d5')]===_0x715f('0x1e5')){return _0x120dea[_0x715f('0xc4')](_0x16c1ee['id'])['then'](function(_0x2a1cbe){var _0x4d3b98=_0x16c1ee[_0x715f('0x56')]-_0x2a1cbe[0x0][_0x715f('0x1eb')];var _0x3431ba=_0x16c1ee[_0x715f('0x1d3')]*0x3c;var _0x10da64=_0x5b28b3[0x0][_0x715f('0x6c')]+_0x5b28b3[0x0][_0x715f('0x6b')];var _0x22aa51=(_0x5b28b3[0x0]['predictiveIntervalAnsweredCalls']+_0x5b28b3[0x0][_0x715f('0x6d')]+_0x5b28b3[0x0][_0x715f('0x81')])/_0x5b28b3[0x0][_0x715f('0x72')];var _0x55f98b=_0x16c1ee[_0x715f('0x1c9')]/0x64;_0x16c1ee[_0x715f('0x71')]=_0x2a1cbe[0x0][_0x715f('0x1eb')]||0x0;_0x16c1ee[_0x715f('0x6f')]=_0x22aa51>0x0?_0x22aa51:0x1;return _0x120dea['busyFactor'](_0x4d3b98,_0x3431ba,_0x10da64,_0x22aa51,_0x55f98b);})[_0x715f('0x41')](function(_0x53e847){return _0x527501(_0x53e847);})[_0x715f('0xaf')](function(_0x233f1b){return _0x4e7b7b(msgResponse(_0x715f('0x1ec'),_0x715f('0x142'),JSON['stringify'](_0x233f1b)));});}}else{return _0x4e7b7b(msgResponse(_0x715f('0x1e7'),_0x715f('0x142'),_0x715f('0x1e9')));}});};};Dialer[_0x715f('0x1b')][_0x715f('0x1dd')]=function(_0x49e102){var _0x3c2d5d=this;return function(){var _0xa91ab3=0x0;var _0x264845=Math[_0x715f('0x1ce')](_0x49e102[_0x715f('0x74')]*0x3e8);if(_0x264845>0x0){_0x264845=_0x264845<0x64?0x64:_0x264845;loggerPredictive[_0x715f('0x7e')](_0x49e102['name'],_0x715f('0x1ed'),_0x264845,'milliseconds');_0x49e102[_0x715f('0x8f')]=setInterval(function(){_0x3c2d5d['handlePredictive'](_0x49e102);loggerPredictiveCalls[_0x715f('0x7e')]('[handlePredictive]',_0xa91ab3+=0x1);},_0x264845);}else{loggerPredictive[_0x715f('0x7e')](_0x49e102[_0x715f('0x45')],_0x715f('0x1ee'));}};};Dialer['prototype'][_0x715f('0x1ef')]=function(_0x6c6570,_0x4402f0){var _0x71ddee=this;return function(_0xaff49d){if(_['isEmpty'](_0xaff49d)){if(_[_0x715f('0xac')](_0x4402f0[_0x715f('0xd1')])||!_0x4402f0[_0x715f('0x1f0')]){if(_0x6c6570[_0x715f('0x157')]===_0x715f('0x6')){_0x6c6570[_0x715f('0x12b')]=_[_0x715f('0x85')](_0x6c6570['queueStatusComplete'])?!![]:_0x6c6570[_0x715f('0x12b')];var _0x5cc207=uuid['v4']();_0x71ddee[_0x715f('0x26')][_0x5cc207]=new Action(_0x6c6570,_0x4402f0,_0x5cc207);loggerBooked['info'](_0x715f('0x1f1'),_0x5cc207,_0x715f('0x1f2'),JSON[_0x715f('0x4f')](_0x6c6570[_0x715f('0x12b')]),_0x715f('0x1f3'),_0x6c6570['name']);if(_0x6c6570[_0x715f('0x12b')]){_0x6c6570[_0x715f('0x12b')]=![];_0x71ddee['queueBooked'][_0x71ddee[_0x715f('0x26')][_0x5cc207][_0x715f('0xde')]]=[];ami['Action']({'actionid':_0x5cc207,'action':_0x715f('0x1f4'),'queue':_0x6c6570['name']})['catch'](function(){_0x71ddee['updateOriginated'](_0x6c6570);_0x71ddee[_0x715f('0xbe')]({'active':![],'ContactId':_0x71ddee[_0x715f('0x26')][_0x5cc207][_0x715f('0xcf')],'ListId':_0x71ddee[_0x715f('0x26')][_0x5cc207][_0x715f('0xd0')],'VoiceQueueId':_0x71ddee['actions'][_0x5cc207][_0x715f('0xfd')]||undefined,'CampaignId':_0x71ddee[_0x715f('0x26')][_0x5cc207]['CampaignId']||undefined})[_0x715f('0xaf')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x71ddee[_0x715f('0x26')][_0x5cc207];});}else{loggerBooked[_0x715f('0x7e')](_0x715f('0x1f5'),JSON[_0x715f('0x4f')](_0x6c6570[_0x715f('0x12b')]),'Queue:\x20',_0x6c6570[_0x715f('0x45')]);_0x71ddee['updateOriginated'](_0x6c6570);_0x71ddee[_0x715f('0xbe')]({'active':![],'ContactId':_0x71ddee[_0x715f('0x26')][_0x5cc207][_0x715f('0xcf')],'ListId':_0x71ddee['actions'][_0x5cc207][_0x715f('0xd0')],'VoiceQueueId':_0x71ddee[_0x715f('0x26')][_0x5cc207][_0x715f('0xfd')]||undefined,'CampaignId':_0x71ddee[_0x715f('0x26')][_0x5cc207][_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch(_0x715f('0x1f6')));delete _0x71ddee[_0x715f('0x26')][_0x5cc207];}}else{return _0x71ddee['actionOriginate'](_0x6c6570,_0x4402f0);}}else{if(getDiff(_0x4402f0[_0x715f('0x1f7')])<_0x6c6570[_0x715f('0x1f8')]*0x3c){if(_0x4402f0[_0x715f('0x15f')]&&!_0x4402f0[_0x715f('0x15f')][_0x715f('0x1f9')]){_0x71ddee['preview'][_0x715f('0x12e')](_0x4402f0['id'])[_0x715f('0x1e')](function(){_0x71ddee[_0x715f('0xb0')](_0x6c6570);});}else{_0x71ddee[_0x715f('0x1fa')]({'active':![]},_0x4402f0['id'],0x1)[_0x715f('0x1e')](function(){_0x71ddee[_0x715f('0xb0')](_0x6c6570);});}}else{_0x6c6570[_0x715f('0x1fb')]+=0x1;_0x71ddee['updateOriginated'](_0x6c6570);if(_0x6c6570[_0x715f('0x1fc')]){_0x71ddee[_0x715f('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4402f0[_0x715f('0xcf')],'ListId':_0x4402f0['ListId'],'VoiceQueueId':_0x4402f0['VoiceQueueId']||undefined,'CampaignId':_0x4402f0[_0x715f('0xd2')]||undefined})[_0x715f('0xaf')](loggerCatch(_0x715f('0x1fd')));_0x71ddee[_0x715f('0xc7')](createObjHistory(_0x6c6570,_0x4402f0,_0x715f('0x1fe'),0x17,_0x715f('0x1ff')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x71ddee['saveInDb'](createObjHistory(_0x6c6570,_0x4402f0,_0x715f('0x200'),0x16,_0x715f('0x201')),'[Originate][HistoryRecallClose][historyCatch]',_0x715f('0x202'));}}}}else{_0x6c6570['outboundBlacklistCallsDay']+=0x1;_0x71ddee['saveInDb'](createObjHistory(_0x6c6570,_0x4402f0,_0x715f('0x203'),0xd,_0x715f('0x204')),'[Originate][historyBlacklist]',_0x715f('0x205'));throw _0x715f('0x206');}};};Dialer['prototype'][_0x715f('0x162')]=function(_0x5f433a){var _0x38cddc=this;var _0x697e85=_0x5f433a['limitCalls']-_0x5f433a[_0x715f('0x97')]-_0x5f433a['temp'];emitCampaignSummary(_0x5f433a);if(_0x697e85>0x0){if(_0x697e85>this[_0x715f('0x24')]){_0x697e85=this[_0x715f('0x24')];}_0x5f433a[_0x715f('0xc1')]+=_0x697e85;this[_0x715f('0xc3')](_0x5f433a['id'],_0x697e85,_0x5f433a['dialOrderByScheduledAt'],_0x5f433a)['then'](function(_0x1e4d02){_0x5f433a['temp']-=_0x697e85;_0x5f433a[_0x715f('0xc1')]=_0x5f433a[_0x715f('0xc1')]>0x0?_0x5f433a[_0x715f('0xc1')]:0x0;if(!checkContactEmpty(_0x1e4d02)){_0x5f433a[_0x715f('0x43')]=_0x715f('0x9d');logger[_0x715f('0x7e')]('[getContactCampaign2][Empty]'+_0x5f433a[_0x715f('0x45')]);}else{_0x5f433a[_0x715f('0x97')]+=_0x1e4d02[_0x715f('0x132')];_0x5f433a[_0x715f('0x43')]=_0x715f('0x207');for(var _0x3bf657=0x0;_0x3bf657<_0x1e4d02[_0x715f('0x132')];_0x3bf657+=0x1){_0x5f433a[_0x715f('0x208')]+=0x1;if(_[_0x715f('0xac')](_0x1e4d02[_0x3bf657])||_[_0x715f('0xac')](_0x1e4d02[_0x3bf657][_0x715f('0x171')])||_['isNil'](_0x1e4d02[_0x3bf657][_0x715f('0x171')]['phone'])){_0x38cddc[_0x715f('0x209')](_0x715f('0x20a'),_0x5f433a,_0x1e4d02[_0x3bf657]);}else{_0x38cddc[_0x715f('0xb9')](_[_0x715f('0xce')](_0x1e4d02[_0x3bf657],[_0x715f('0xd2'),_0x715f('0x20b')]))[_0x715f('0x41')](_0x38cddc['checkContactBlack'](_0x5f433a,_0x1e4d02[_0x3bf657]))[_0x715f('0xaf')](_0x38cddc['loggerHandler'](_0x715f('0x20c'),_0x5f433a));}}}})[_0x715f('0xaf')](loggerGetContactDialer('[getContactCampaign2]',_0x5f433a,_0x697e85));}};Dialer[_0x715f('0x1b')]['handlePower']=function(_0x36dab2,_0x1d9893){var _0x3f00ec=this;var _0x19b02f=[];var _0x3a6432=_0x1d9893>=0x1?_0x1d9893:0x1;if(_0x36dab2[_0x715f('0x157')]===_0x715f('0x6')){_0x3a6432=0x1;}var _0x4b22e2=Math[_0x715f('0x1ce')](_0x36dab2['available']*_0x3a6432)-_0x36dab2[_0x715f('0x97')]-_0x36dab2['temp'];emitVoiceQueueSummary(_0x36dab2);if(_0x36dab2[_0x715f('0x20d')]>0x0){var _0x181788=_0x36dab2['dialLimitQueue']-_0x36dab2[_0x715f('0x97')]-_0x36dab2[_0x715f('0x5a')]-_0x36dab2['temp']-_0x36dab2[_0x715f('0x57')];if(_0x4b22e2>_0x181788){_0x4b22e2=_0x181788;}}if(_0x4b22e2>0x0){if(_0x36dab2[_0x715f('0x157')]===_0x715f('0x6')){_0x4b22e2=0x1;}if(_0x4b22e2>this['maxNumberOriginate']){_0x4b22e2=this[_0x715f('0x24')];}_0x36dab2['temp']+=_0x4b22e2;for(var _0x48ea0e in this[_0x715f('0x22')]){if(typeof this[_0x715f('0x22')][_0x48ea0e]!=='undefined'){if(this[_0x715f('0x22')][_0x48ea0e]['state']===_0x715f('0x20e')&&this[_0x715f('0x22')][_0x48ea0e][_0x715f('0xae')]===_0x715f('0xd7')){_0x19b02f['push'](this[_0x715f('0x22')][_0x48ea0e]['id']);}}}this['getContactDialer'](_0x36dab2['id'],_0x19b02f,_0x4b22e2,_0x36dab2[_0x715f('0x20f')],_0x36dab2)[_0x715f('0x41')](function(_0x3be3ac){_0x36dab2['temp']-=_0x4b22e2;_0x36dab2[_0x715f('0xc1')]=_0x36dab2['temp']>0x0?_0x36dab2[_0x715f('0xc1')]:0x0;if(!checkContactEmpty(_0x3be3ac)){_0x3f00ec[_0x715f('0xb4')](_0x36dab2)[_0x715f('0x41')](sendMessageReschedule(_0x36dab2))[_0x715f('0xaf')](loggerCatch(_0x715f('0xb5')));}else{_0x36dab2[_0x715f('0x97')]+=_0x3be3ac[_0x715f('0x132')];_0x36dab2[_0x715f('0x43')]=_0x36dab2[_0x715f('0x157')]==='booked'?_0x715f('0x179'):_0x715f('0x207');for(var _0x5976ca=0x0;_0x5976ca<_0x3be3ac[_0x715f('0x132')];_0x5976ca+=0x1){if(_[_0x715f('0xac')](_0x3be3ac[_0x5976ca])||_[_0x715f('0xac')](_0x3be3ac[_0x5976ca][_0x715f('0x171')])||_[_0x715f('0xac')](_0x3be3ac[_0x5976ca][_0x715f('0x171')][_0x715f('0x172')])){_0x3f00ec['emptyContact'](_0x715f('0x20a'),_0x36dab2,_0x3be3ac[_0x5976ca]);}else{_0x3f00ec[_0x715f('0xb7')](_[_0x715f('0xce')](_0x3be3ac[_0x5976ca],[_0x715f('0xfd'),'Contact.phone']))[_0x715f('0x41')](_0x3f00ec[_0x715f('0x1ef')](_0x36dab2,_0x3be3ac[_0x5976ca]))['catch'](_0x3f00ec[_0x715f('0xca')](_0x715f('0x20a'),_0x36dab2));}}}})[_0x715f('0xaf')](loggerGetContactDialer(_0x715f('0x210'),_0x36dab2,_0x4b22e2));}};Dialer[_0x715f('0x1b')]['handlePredictive']=function(_0x93c24a){if(_0x93c24a[_0x715f('0x20d')]>0x0){var _0x430fdb=_0x93c24a[_0x715f('0x20d')]-_0x93c24a['originated']-_0x93c24a['talking'];if(_0x430fdb>0x0){this['tryOriginatePredictive'](_0x93c24a);}else{loggerPredictiveCalls['info'](_0x715f('0x211'));}}else{this[_0x715f('0x212')](_0x93c24a);}};Dialer[_0x715f('0x1b')]['tryOriginatePredictive']=function(_0x295f2c){var _0x24fc92=this;var _0x35029c=[];_0x295f2c[_0x715f('0x97')]+=0x1;for(var _0x56fb6c in this[_0x715f('0x22')]){if(typeof this['agents'][_0x56fb6c]!==_0x715f('0x98')){if(this[_0x715f('0x22')][_0x56fb6c]['state']===_0x715f('0x20e')&&this[_0x715f('0x22')][_0x56fb6c][_0x715f('0xae')]===_0x715f('0xd7')){_0x35029c[_0x715f('0x149')](this[_0x715f('0x22')][_0x56fb6c]['id']);}}}this['getContactDialer'](_0x295f2c['id'],_0x35029c,0x1,_0x295f2c[_0x715f('0x20f')],_0x295f2c)[_0x715f('0x41')](function(_0x33bac5){if(!checkContactEmpty(_0x33bac5)){checkContactLowerLimitOriginate(_0x295f2c,0x1,0x0);_0x24fc92[_0x715f('0xb4')](_0x295f2c)['then'](sendMessageReschedule(_0x295f2c))['catch'](loggerCatch(_0x715f('0xb5')));}else{_0x295f2c[_0x715f('0x43')]='RUNNING';if(_[_0x715f('0xac')](_0x33bac5[0x0])||_['isNil'](_0x33bac5[0x0][_0x715f('0x171')])||_[_0x715f('0xac')](_0x33bac5[0x0][_0x715f('0x171')][_0x715f('0x172')])){_0x24fc92[_0x715f('0x209')]('[actionOriginate]\x20',_0x295f2c,_0x33bac5[0x0]);}else{_0x24fc92[_0x715f('0xb7')](_[_0x715f('0xce')](_0x33bac5[0x0],[_0x715f('0xfd'),_0x715f('0x20b')]))['then'](_0x24fc92[_0x715f('0x1ef')](_0x295f2c,_0x33bac5[0x0]))[_0x715f('0xaf')](_0x24fc92[_0x715f('0xca')]('[actionOriginatePredictive]\x20',_0x295f2c));}}})[_0x715f('0xaf')](loggerGetContactDialer('[getContactDialerPredictive]',_0x295f2c,0x1));emitVoiceQueueSummary(_0x295f2c);};Dialer[_0x715f('0x1b')][_0x715f('0x1e4')]=function(_0x242988,_0x528c39,_0x819a4,_0x45d8de,_0x4dc8aa,_0x3dcfa7){loggerPredictive[_0x715f('0x7e')](_0x715f('0x213'));loggerPredictive[_0x715f('0x7e')](_0x715f('0x214'),_0x242988);loggerPredictive['info'](_0x715f('0x215'),_0x528c39);loggerPredictive['info'](_0x715f('0x216'),_0x819a4);loggerPredictive['info']('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',_0x45d8de);loggerPredictive[_0x715f('0x7e')](_0x715f('0x217'),_0x4dc8aa);loggerPredictive[_0x715f('0x7e')](_0x715f('0x84'));return new BPromise(function(_0x19b374,_0x207da4){if(_0x242988<=0x0||isNaN(_0x242988)){return _0x207da4(msgResponse(_0x715f('0x218'),_0x715f('0x4e'),_0x715f('0x219')+_0x242988));}if(_0x819a4<=0x0||isNaN(_0x819a4)){return _0x207da4(msgResponse(_0x715f('0x218'),_0x715f('0x4e'),'Ts\x20=\x20'+_0x819a4));}if(_0x45d8de<=0x0||isNaN(_0x45d8de)){return _0x207da4(msgResponse(_0x715f('0x218'),_0x715f('0x4e'),_0x715f('0x21a')+_0x45d8de));}if(_0x528c39<=0x0||isNaN(_0x528c39)){return _0x207da4(msgResponse(_0x715f('0x218'),'Error','interval\x20=\x20'+_0x528c39));}if(_0x4dc8aa<=0x0||isNaN(_0x4dc8aa)){return _0x207da4(msgResponse(_0x715f('0x218'),_0x715f('0x4e'),_0x715f('0x21b')+_0x4dc8aa));}_0x3dcfa7=_0x3dcfa7||0x0;var _0x32f139=0x1/_0x819a4;var _0x2bcb30=0x0;var _0x67743a=0x0;var _0x5dc018=0x0;var _0x1f12d6=0x0;for(var _0x5630e8=0x0;_0x5dc018<_0x4dc8aa;_0x5630e8+=0x1){_0x67743a=_0x5630e8/_0x528c39;_0x2bcb30=(_0x45d8de*_0x67743a+_0x3dcfa7)/_0x32f139;_0x5dc018=erlangb(_0x2bcb30,_0x242988);_0x1f12d6=_0x2bcb30/_0x242988*(0x1-erlangb(_0x2bcb30,_0x242988));}return _0x19b374({'erlangCalls':_0x5630e8,'erlangCallToSecond':_0x528c39/_0x5630e8,'erlangAbandonmentRate':_0x5dc018,'erlangBusyFactor':_0x1f12d6});});};Dialer['prototype'][_0x715f('0x1e6')]=function(_0x10b323,_0x299a7d,_0x2d5326,_0x1750c3,_0x2e010a,_0x5ae917){loggerPredictive[_0x715f('0x7e')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x715f('0x7e')](_0x715f('0x214'),_0x10b323);loggerPredictive[_0x715f('0x7e')](_0x715f('0x215'),_0x299a7d);loggerPredictive[_0x715f('0x7e')]('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',_0x2d5326);loggerPredictive[_0x715f('0x7e')](_0x715f('0x21c'),_0x1750c3);loggerPredictive[_0x715f('0x7e')](_0x715f('0x21d'),_0x2e010a);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x2ee0a1,_0x48c890){if(_0x10b323<=0x0||isNaN(_0x10b323)){return _0x48c890(msgResponse(_0x715f('0x21e'),'Error',_0x715f('0x219')+_0x10b323));}if(_0x2d5326<=0x0||isNaN(_0x2d5326)){return _0x48c890(msgResponse(_0x715f('0x21e'),_0x715f('0x4e'),'Ts\x20=\x20'+_0x2d5326));}if(_0x1750c3<=0x0||isNaN(_0x1750c3)){return _0x48c890(msgResponse(_0x715f('0x21e'),_0x715f('0x4e'),_0x715f('0x21a')+_0x1750c3));}if(_0x299a7d<=0x0||isNaN(_0x299a7d)){return _0x48c890(msgResponse(_0x715f('0x21e'),_0x715f('0x4e'),_0x715f('0x21f')+_0x299a7d));}if(_0x2e010a<=0x0||isNaN(_0x2e010a)){return _0x48c890(msgResponse(_0x715f('0x21e'),_0x715f('0x4e'),_0x715f('0x220')+_0x2e010a));}_0x5ae917=_0x5ae917||0x0;var _0x5c9824=0x1/_0x2d5326;var _0x3fc8f1=0x0;var _0x52d65a=0x0;var _0x404fae=0x0;var _0x5bc3de=0x0;for(var _0x25eeea=0x0;_0x5bc3de<_0x2e010a;_0x25eeea+=0x1){_0x52d65a=_0x25eeea/_0x299a7d;_0x3fc8f1=(_0x1750c3*_0x52d65a+_0x5ae917)/_0x5c9824;_0x404fae=erlangb(_0x3fc8f1,_0x10b323);_0x5bc3de=_0x3fc8f1/_0x10b323*(0x1-erlangb(_0x3fc8f1,_0x10b323));}return _0x2ee0a1({'erlangCalls':_0x25eeea,'erlangCallToSecond':_0x299a7d/_0x25eeea,'erlangAbandonmentRate':_0x404fae,'erlangBusyFactor':_0x5bc3de});});};module['exports']=Dialer;
\ No newline at end of file
index bcbeea4..35c98ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cd2=['membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime'];(function(_0x893a02,_0x92dd9e){var _0x15146d=function(_0x358a9f){while(--_0x358a9f){_0x893a02['push'](_0x893a02['shift']());}};_0x15146d(++_0x92dd9e);}(_0x8cd2,0x14e));var _0x28cd=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8cd2[_0x4b055c];return _0x4b62bb;};'use strict';var util=require('util');var _=require(_0x28cd('0x0'));var moment=require(_0x28cd('0x1'));function getSeconds(_0x118952,_0x1d2d5){var _0x5d1691=moment(_0x118952)[_0x28cd('0x2')](0x0);var _0x3866be=moment(_0x1d2d5)[_0x28cd('0x2')](0x0);return _0x5d1691[_0x28cd('0x3')](_0x3866be,_0x28cd('0x4'));}function QueueCallerAbandon(_0x1d5e2c,_0x52d39b){this[_0x28cd('0x5')]=_0x1d5e2c['scheduledat'];this[_0x28cd('0x6')]=_0x1d5e2c['type'];this[_0x28cd('0x7')]=_0x1d5e2c['type']==='outbound'?_0x28cd('0x8'):_0x1d5e2c[_0x28cd('0x6')];this[_0x28cd('0x9')]=_0x1d5e2c['countbusyretry'];this[_0x28cd('0xa')]=_0x1d5e2c[_0x28cd('0xa')];this['countnoanswerretry']=_0x1d5e2c['countnoanswerretry'];this[_0x28cd('0xb')]=_0x1d5e2c['countbusyretry']+_0x1d5e2c['countcongestionretry']+_0x1d5e2c['countnoanswerretry']+_0x1d5e2c[_0x28cd('0xc')]+_0x1d5e2c[_0x28cd('0xd')]+_0x1d5e2c[_0x28cd('0xe')]+_0x1d5e2c[_0x28cd('0xf')]+_0x1d5e2c[_0x28cd('0x10')];this['countnosuchnumberretry']=_0x1d5e2c[_0x28cd('0xc')];this[_0x28cd('0xd')]=_0x1d5e2c[_0x28cd('0xd')];this[_0x28cd('0xe')]=_0x1d5e2c[_0x28cd('0xe')];this['countmachineretry']=_0x1d5e2c[_0x28cd('0xf')];this['countagentrejectretry']=_0x1d5e2c['countagentrejectretry'];this['uniqueid']=_0x52d39b['uniqueid'];this[_0x28cd('0x11')]=_0x1d5e2c[_0x28cd('0x12')];this['calleridnum']=_0x1d5e2c[_0x28cd('0x13')];this['starttime']=_0x1d5e2c[_0x28cd('0x14')];this[_0x28cd('0x15')]=_0x1d5e2c[_0x28cd('0x15')];this[_0x28cd('0x16')]=_0x1d5e2c['droptime'];this[_0x28cd('0x17')]=this['droptime'];this[_0x28cd('0x18')]=getSeconds(_0x1d5e2c[_0x28cd('0x15')],_0x1d5e2c[_0x28cd('0x14')]);this[_0x28cd('0x19')]=getSeconds(this[_0x28cd('0x16')],_0x1d5e2c[_0x28cd('0x15')]);this['talktime']=0x0;this[_0x28cd('0x8')]=_0x52d39b[_0x28cd('0x8')];this[_0x28cd('0x1a')]=_0x52d39b[_0x28cd('0x1b')];this[_0x28cd('0x1c')]=_0x52d39b[_0x28cd('0x1c')];this['callback']=_0x1d5e2c[_0x28cd('0x1d')];this['callbackuniqueid']=_0x1d5e2c[_0x28cd('0x1e')];this[_0x28cd('0x1f')]=_0x1d5e2c[_0x28cd('0x1f')];this[_0x28cd('0x20')]=_0x1d5e2c['recallme'];this[_0x28cd('0x21')]=_0x1d5e2c[_0x28cd('0x21')];this[_0x28cd('0x22')]=_0x1d5e2c[_0x28cd('0x22')];this['UserId']=_0x1d5e2c[_0x28cd('0x23')];this[_0x28cd('0x24')]=_0x1d5e2c['VoiceQueueId'];this['CampaignId']=_0x1d5e2c[_0x28cd('0x25')];this['originatecalleridnum']=_0x1d5e2c[_0x28cd('0x26')]||'';this['originatecalleridname']=_0x1d5e2c['originatecalleridname']||'';}module[_0x28cd('0x27')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x154a=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','droptime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','campaigntype','type','outbound'];(function(_0x5a9aa7,_0x55b38f){var _0x298adf=function(_0x2643d4){while(--_0x2643d4){_0x5a9aa7['push'](_0x5a9aa7['shift']());}};_0x298adf(++_0x55b38f);}(_0x154a,0x1e5));var _0xa154=function(_0x55317b,_0x29759f){_0x55317b=_0x55317b-0x0;var _0x35b053=_0x154a[_0x55317b];return _0x35b053;};'use strict';var util=require(_0xa154('0x0'));var _=require(_0xa154('0x1'));var moment=require(_0xa154('0x2'));function getSeconds(_0x546bab,_0x1c98a5){var _0x19a72e=moment(_0x546bab)[_0xa154('0x3')](0x0);var _0x515fa2=moment(_0x1c98a5)[_0xa154('0x3')](0x0);return _0x19a72e[_0xa154('0x4')](_0x515fa2,_0xa154('0x5'));}function QueueCallerAbandon(_0x2f4809,_0x4585ca){this[_0xa154('0x6')]=_0x2f4809[_0xa154('0x6')];this['type']=_0x2f4809['type'];this[_0xa154('0x7')]=_0x2f4809[_0xa154('0x8')]===_0xa154('0x9')?_0xa154('0xa'):_0x2f4809['type'];this[_0xa154('0xb')]=_0x2f4809[_0xa154('0xb')];this[_0xa154('0xc')]=_0x2f4809[_0xa154('0xc')];this['countnoanswerretry']=_0x2f4809[_0xa154('0xd')];this[_0xa154('0xe')]=_0x2f4809['countbusyretry']+_0x2f4809[_0xa154('0xc')]+_0x2f4809[_0xa154('0xd')]+_0x2f4809['countnosuchnumberretry']+_0x2f4809[_0xa154('0xf')]+_0x2f4809[_0xa154('0x10')]+_0x2f4809[_0xa154('0x11')]+_0x2f4809[_0xa154('0x12')];this[_0xa154('0x13')]=_0x2f4809[_0xa154('0x13')];this['countdropretry']=_0x2f4809[_0xa154('0xf')];this[_0xa154('0x10')]=_0x2f4809[_0xa154('0x10')];this[_0xa154('0x11')]=_0x2f4809[_0xa154('0x11')];this['countagentrejectretry']=_0x2f4809[_0xa154('0x12')];this[_0xa154('0x14')]=_0x4585ca[_0xa154('0x14')];this[_0xa154('0x15')]=_0x2f4809[_0xa154('0x16')];this[_0xa154('0x17')]=_0x2f4809[_0xa154('0x18')];this[_0xa154('0x19')]=_0x2f4809['starttime'];this['responsetime']=_0x2f4809[_0xa154('0x1a')];this['droptime']=_0x2f4809['droptime'];this[_0xa154('0x1b')]=this[_0xa154('0x1c')];this['ringtime']=getSeconds(_0x2f4809[_0xa154('0x1a')],_0x2f4809[_0xa154('0x19')]);this[_0xa154('0x1d')]=getSeconds(this[_0xa154('0x1c')],_0x2f4809['responsetime']);this[_0xa154('0x1e')]=0x0;this[_0xa154('0xa')]=_0x4585ca[_0xa154('0xa')];this[_0xa154('0x1f')]=_0x4585ca[_0xa154('0x20')];this[_0xa154('0x21')]=_0x4585ca[_0xa154('0x21')];this[_0xa154('0x22')]=_0x2f4809[_0xa154('0x22')];this[_0xa154('0x23')]=_0x2f4809[_0xa154('0x23')];this[_0xa154('0x24')]=_0x2f4809[_0xa154('0x24')];this[_0xa154('0x25')]=_0x2f4809[_0xa154('0x25')];this[_0xa154('0x26')]=_0x2f4809[_0xa154('0x26')];this[_0xa154('0x27')]=_0x2f4809['ListId'];this[_0xa154('0x28')]=_0x2f4809[_0xa154('0x28')];this[_0xa154('0x29')]=_0x2f4809[_0xa154('0x29')];this[_0xa154('0x2a')]=_0x2f4809['CampaignId'];this['originatecalleridnum']=_0x2f4809['originatecalleridnum']||'';this[_0xa154('0x2b')]=_0x2f4809[_0xa154('0x2b')]||'';}module[_0xa154('0x2c')]=QueueCallerAbandon;
\ No newline at end of file
index e9eacad..aaa2f86 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(_0x3a6290,_0x2ab943){var _0x55345e=function(_0x5aa7f9){while(--_0x5aa7f9){_0x3a6290['push'](_0x3a6290['shift']());}};_0x55345e(++_0x2ab943);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x3638af,_0x4408ab){var _0x562033=function(_0x4e59ce){while(--_0x4e59ce){_0x3638af['push'](_0x3638af['shift']());}};_0x562033(++_0x4408ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 6cf42c4..aeefe07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['variable','value','channelstate','channelstatedesc','operation','status','filename','info','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','merge','pick','response','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','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','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','channels','faxAccounts','trunks','newchannel','syncNewchannel','varset','bind','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','actions','syncVarSet'];(function(_0x4144ca,_0x3f22e3){var _0x2de8ee=function(_0x160005){while(--_0x160005){_0x4144ca['push'](_0x4144ca['shift']());}};_0x2de8ee(++_0x3f22e3);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x485422,_0x549b4){_0x485422=_0x485422-0x0;var _0xde17e1=_0x6f7a[_0x485422];return _0xde17e1;};'use strict';var util=require(_0xa6f7('0x0'));var _=require(_0xa6f7('0x1'));var BPromise=require(_0xa6f7('0x2'));var uuid=require(_0xa6f7('0x3'));var moment=require('moment');var path=require(_0xa6f7('0x4'));var tiff2pdf=require(_0xa6f7('0x5'));var gs=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var ami=require(_0xa6f7('0x9'));var rpcDb=require(_0xa6f7('0xa'));var Channel=require(_0xa6f7('0xb'));var ut=require(_0xa6f7('0xc'));var Action=require(_0xa6f7('0xd'));var faxAccount=require(_0xa6f7('0xe'));var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x30f2a7){this[_0xa6f7('0xf')]={};this[_0xa6f7('0x10')]=_0x30f2a7[_0xa6f7('0x10')];this[_0xa6f7('0x11')]=_0x30f2a7['trunks'];this['actions']={};ami['on'](_0xa6f7('0x12'),this[_0xa6f7('0x13')]['bind'](this));ami['on'](_0xa6f7('0x14'),this['syncVarSet'][_0xa6f7('0x15')](this));ami['on'](_0xa6f7('0x16'),this[_0xa6f7('0x17')][_0xa6f7('0x15')](this));ami['on']('newexten',this[_0xa6f7('0x18')]['bind'](this));ami['on'](_0xa6f7('0x19'),this[_0xa6f7('0x1a')][_0xa6f7('0x15')](this));ami['on']('receivefax',this[_0xa6f7('0x1b')]['bind'](this));ami['on'](_0xa6f7('0x1c'),this['syncHangup'][_0xa6f7('0x15')](this));ami['on'](_0xa6f7('0x1d'),this[_0xa6f7('0x1e')]['bind'](this));}Fax[_0xa6f7('0x1f')][_0xa6f7('0x13')]=function(_0x131959){if(_0x131959[_0xa6f7('0x20')]==='from-voip-provider'){for(var _0x4a8827 in this[_0xa6f7('0x10')]){if(this['faxAccounts'][_0xa6f7('0x21')](_0x4a8827)){if(_0x131959[_0xa6f7('0x22')]===this['faxAccounts'][_0x4a8827][_0xa6f7('0x23')]){this[_0xa6f7('0xf')][_0x131959[_0xa6f7('0x24')]]={};this[_0xa6f7('0xf')][_0x131959[_0xa6f7('0x24')]][_0xa6f7('0x25')]=_0x131959['channel'];this[_0xa6f7('0xf')][_0x131959[_0xa6f7('0x24')]]['id']=this['faxAccounts'][_0x4a8827]['id'];this['channels'][_0x131959['uniqueid']][_0xa6f7('0x26')]=this[_0xa6f7('0x10')][_0x4a8827]['name'];logger['info'](_0x131959['uniqueid'],_0xa6f7('0x27'));}}}}if(this[_0xa6f7('0x28')][_0x131959[_0xa6f7('0x24')]]){this['channels'][_0x131959['uniqueid']]={};this[_0xa6f7('0xf')][_0x131959['uniqueid']]['channel']=_0x131959[_0xa6f7('0x25')];logger['info'](_0x131959[_0xa6f7('0x24')],_0xa6f7('0x27'));}};Fax[_0xa6f7('0x1f')][_0xa6f7('0x29')]=function(_0x3a3508){if(this['channels'][_0x3a3508['uniqueid']]){for(var _0x1c419b in _0x3a3508[_0xa6f7('0x2a')]){if(_0x3a3508['variable'][_0xa6f7('0x21')](_0x1c419b)){this[_0xa6f7('0xf')][_0x3a3508[_0xa6f7('0x24')]][_0x1c419b]=_0x3a3508[_0xa6f7('0x2b')];}}}};Fax[_0xa6f7('0x1f')][_0xa6f7('0x17')]=function(_0x353de8){if(this[_0xa6f7('0xf')][_0x353de8[_0xa6f7('0x24')]]){this[_0xa6f7('0xf')][_0x353de8[_0xa6f7('0x24')]][_0xa6f7('0x2c')]=_0x353de8['channelstate'];this[_0xa6f7('0xf')][_0x353de8[_0xa6f7('0x24')]]['channelstatedesc']=_0x353de8[_0xa6f7('0x2d')];}};Fax[_0xa6f7('0x1f')]['syncNewExten']=function(_0x55179e){if(this[_0xa6f7('0xf')][_0x55179e[_0xa6f7('0x24')]]){for(var _0x2b33d in _0x55179e[_0xa6f7('0x2a')]){if(_0x55179e[_0xa6f7('0x2a')]['hasOwnProperty'](_0x2b33d)){this['channels'][_0x55179e[_0xa6f7('0x24')]][_0x2b33d]=_0x55179e['value'];}}}};Fax[_0xa6f7('0x1f')][_0xa6f7('0x1a')]=function(_0xfa0fb6){if(this[_0xa6f7('0xf')][_0xfa0fb6[_0xa6f7('0x24')]]){this[_0xa6f7('0xf')][_0xfa0fb6['uniqueid']][_0xa6f7('0x2e')]=_0xfa0fb6[_0xa6f7('0x2e')];this[_0xa6f7('0xf')][_0xfa0fb6['uniqueid']][_0xa6f7('0x2f')]=_0xfa0fb6['status'];this[_0xa6f7('0xf')][_0xfa0fb6[_0xa6f7('0x24')]][_0xa6f7('0x23')]=_0xfa0fb6['localstationid'];this[_0xa6f7('0xf')][_0xfa0fb6[_0xa6f7('0x24')]][_0xa6f7('0x30')]=_0xfa0fb6[_0xa6f7('0x30')];logger[_0xa6f7('0x31')](_0xfa0fb6[_0xa6f7('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0xa6f7('0x1f')][_0xa6f7('0x1b')]=function(_0xc25a1b){var _0x2c7440=this;if(this[_0xa6f7('0xf')][_0xc25a1b[_0xa6f7('0x24')]]){var _0x45acdd=this[_0xa6f7('0xf')][_0xc25a1b['uniqueid']]['id'];this[_0xa6f7('0xf')][_0xc25a1b[_0xa6f7('0x24')]][_0xa6f7('0x32')]=_0xc25a1b['remotestationid'];this[_0xa6f7('0xf')][_0xc25a1b[_0xa6f7('0x24')]]['pagestransferred']=_0xc25a1b[_0xa6f7('0x33')];this[_0xa6f7('0xf')][_0xc25a1b[_0xa6f7('0x24')]][_0xa6f7('0x23')]=_0xc25a1b[_0xa6f7('0x23')];this['channels'][_0xc25a1b[_0xa6f7('0x24')]][_0xa6f7('0x34')]=_0xc25a1b[_0xa6f7('0x34')];this[_0xa6f7('0xf')][_0xc25a1b[_0xa6f7('0x24')]][_0xa6f7('0x35')]=_0xc25a1b[_0xa6f7('0x35')];this[_0xa6f7('0xf')][_0xc25a1b['uniqueid']]['filename']=_0xc25a1b[_0xa6f7('0x30')];this[_0xa6f7('0xf')][_0xc25a1b[_0xa6f7('0x24')]][_0xa6f7('0x36')]=_0xc25a1b[_0xa6f7('0x36')];if(this[_0xa6f7('0xf')][_0xc25a1b[_0xa6f7('0x24')]][_0xa6f7('0x33')]>0x0){tiff2pdf(_0xc25a1b[_0xa6f7('0x30')],_0xa6f7('0x37'),function(_0x55baa7){logger[_0xa6f7('0x31')](_0xc25a1b[_0xa6f7('0x24')],'\x20result\x20conversion\x20file\x20',_0x55baa7[_0xa6f7('0x38')]);attachment[_0xa6f7('0x39')]({'name':path[_0xa6f7('0x3a')](_0xc25a1b[_0xa6f7('0x30')])['name'],'basename':path[_0xa6f7('0x3a')](_0xc25a1b['filename'])['name']+_0xa6f7('0x3b'),'type':_0xa6f7('0x3c')})[_0xa6f7('0x3d')](function(_0x148bdf){faxAccount[_0xa6f7('0x3e')](_0x45acdd,{'from':_0xc25a1b[_0xa6f7('0x36')],'mapKey':_0xa6f7('0x8'),'body':path['parse'](_0xc25a1b[_0xa6f7('0x30')])[_0xa6f7('0x26')]+'.pdf','AttachmentId':_0x148bdf['id']})[_0xa6f7('0x3f')](function(_0x3726a1){logger[_0xa6f7('0x40')](_0xc25a1b['uniqueid'],_0xa6f7('0x41'),JSON['stringify'](_0x3726a1));});})[_0xa6f7('0x3f')](function(_0x306f06){logger[_0xa6f7('0x40')](_0xc25a1b['uniqueid'],'\x20receiveFax\x20',JSON[_0xa6f7('0x42')](_0x306f06));});});}logger['info'](_0xc25a1b[_0xa6f7('0x24')],'\x20receiveFax\x20');}};Fax['prototype'][_0xa6f7('0x1e')]=function(_0x2e3a04){if(this[_0xa6f7('0x28')][_0x2e3a04[_0xa6f7('0x24')]]){_[_0xa6f7('0x43')](this[_0xa6f7('0xf')][_0x2e3a04['uniqueid']],_[_0xa6f7('0x44')](_0x2e3a04,[_0xa6f7('0x45'),'reason']));}};function updateStatus(_0x190b1d){if(_0x190b1d['AttachmentId']){faxMessage[_0xa6f7('0x46')](_0x190b1d['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0xa6f7('0x3d')](function(_0x158af5){ut[_0xa6f7('0x47')](_0xa6f7('0x48'),_0x158af5);})[_0xa6f7('0x3f')](function(_0x50d9a9){ut[_0xa6f7('0x47')](_0xa6f7('0x49'),_0x50d9a9);});}else{ut['logger'](_0xa6f7('0x4a'));}}Fax['prototype'][_0xa6f7('0x4b')]=function(_0x1c2099,_0x134dd7,_0x55369a){var _0x287b4a=this;var _0x5dab05={};if(_0x134dd7){_0x5dab05={'read':_0x134dd7};}else{_0x5dab05={'failMessage':_0x55369a};}if(this[_0xa6f7('0x28')][_0x1c2099][_0xa6f7('0x4c')]){faxMessage[_0xa6f7('0x46')](this[_0xa6f7('0x28')][_0x1c2099][_0xa6f7('0x4c')],_0x5dab05)['then'](function(_0x5d05d6){ut[_0xa6f7('0x47')](_0xa6f7('0x4d'),_0x5d05d6);})[_0xa6f7('0x3f')](function(_0xa3867a){ut['logger'](_0xa6f7('0x4e'),_0xa3867a);})[_0xa6f7('0x4f')](function(){delete _0x287b4a[_0xa6f7('0xf')][_0x1c2099];delete _0x287b4a[_0xa6f7('0x28')][_0x1c2099];});}else{ut[_0xa6f7('0x47')](_0xa6f7('0x50'));delete this['channels'][_0x1c2099];delete this[_0xa6f7('0x28')][_0x1c2099];}};Fax[_0xa6f7('0x1f')][_0xa6f7('0x51')]=function(_0x5eac88){var _0xb049d7=this;if(this[_0xa6f7('0xf')][_0x5eac88[_0xa6f7('0x24')]]){if(this[_0xa6f7('0x28')][_0x5eac88['uniqueid']]){this['channels'][_0x5eac88[_0xa6f7('0x24')]]['id']=this[_0xa6f7('0x28')][_0x5eac88[_0xa6f7('0x24')]]['id'];this[_0xa6f7('0xf')][_0x5eac88[_0xa6f7('0x24')]][_0xa6f7('0x26')]=this[_0xa6f7('0x28')][_0x5eac88['uniqueid']][_0xa6f7('0x26')];}logger[_0xa6f7('0x31')](_0x5eac88[_0xa6f7('0x24')],this[_0xa6f7('0x28')][_0x5eac88[_0xa6f7('0x24')]]?_0xa6f7('0x52'):_0xa6f7('0x53'),JSON[_0xa6f7('0x42')](this[_0xa6f7('0xf')][_0x5eac88[_0xa6f7('0x24')]]));if(this[_0xa6f7('0x28')][_0x5eac88['uniqueid']]){if(this[_0xa6f7('0xf')][_0x5eac88['uniqueid']][_0xa6f7('0x54')]>0x0&&this['channels'][_0x5eac88[_0xa6f7('0x24')]][_0xa6f7('0x19')]==='SUCCESS'){this[_0xa6f7('0x4b')](_0x5eac88[_0xa6f7('0x24')],!![]);}else{this[_0xa6f7('0x4b')](_0x5eac88['uniqueid'],![],this[_0xa6f7('0xf')][_0x5eac88['uniqueid']][_0xa6f7('0x55')]?_0xa6f7('0x56')+this['channels'][_0x5eac88[_0xa6f7('0x24')]]['faxstatusstring']:_0xa6f7('0x57'));}}}};Fax['prototype'][_0xa6f7('0x58')]=function(_0x341dd6){var _0x2bf525=this;return new BPromise(function(_0xca47c2,_0x315939){_0x2bf525[_0xa6f7('0x59')](_0x341dd6,_0x2bf525[_0xa6f7('0x10')][_0x341dd6[_0xa6f7('0x5a')]])[_0xa6f7('0x3d')](function(_0x16ef40){ut[_0xa6f7('0x47')](_0xa6f7('0x5b'),_0x16ef40);_0xca47c2(ut['message'](_0xa6f7('0x5c')));})[_0xa6f7('0x3f')](function(_0xc8cdff){ut[_0xa6f7('0x47')](_0xa6f7('0x5d'),_0xc8cdff);updateStatus(_0x341dd6);_0x315939(ut[_0xa6f7('0x38')](_0xa6f7('0x5e')));});});};Fax[_0xa6f7('0x1f')]['checkAfterSend']=function(_0xec4fb2){var _0x3eaa1e=this;return new BPromise(function(_0x9c102f,_0x522caf){var _0x216eb1=_0x3eaa1e[_0xa6f7('0x5f')](_0x3eaa1e[_0xa6f7('0x10')][_0xec4fb2[_0xa6f7('0x5a')]][_0xa6f7('0x60')],_0xec4fb2);if(_0x216eb1[_0xa6f7('0x61')]){_0x9c102f(ut[_0xa6f7('0x38')](_0xa6f7('0x62')));}else{_0x522caf(ut['message'](_0x216eb1['message']));}});};function originate(_0x265194,_0x326feb,_0x5e6d94){return new BPromise(function(_0x3aa759,_0x18ff29){if(_0x5e6d94){var _0x1bec76=util['format'](_0xa6f7('0x63'),path['parse'](_0x265194['path'])['name'],_0x265194['path']);gs['execute'](_0x1bec76)[_0xa6f7('0x3d')](function(){_0x265194[_0xa6f7('0x4')]=util[_0xa6f7('0x64')]('%s/%s.tif',path[_0xa6f7('0x3a')](_0x265194[_0xa6f7('0x4')])[_0xa6f7('0x65')],path[_0xa6f7('0x3a')](_0x265194[_0xa6f7('0x4')])[_0xa6f7('0x26')]);_0x326feb[_0xa6f7('0x66')]=_0x265194[_0xa6f7('0x4')];ut[_0xa6f7('0x47')](_0xa6f7('0x67'),'');ami['Action'](ut[_0xa6f7('0x68')](_0x265194,_0x326feb))[_0xa6f7('0x3d')](function(_0x2ba30f){_0x3aa759(_0x2ba30f);})[_0xa6f7('0x3f')](function(_0x1637d3){_0x18ff29(_0x1637d3);});})[_0xa6f7('0x3f')](function(_0x4207ec){_0x18ff29(_0x4207ec);});}else{ami[_0xa6f7('0x69')](ut[_0xa6f7('0x68')](_0x265194,_0x326feb))[_0xa6f7('0x3d')](function(_0x5bd6a9){_0x3aa759(_0x5bd6a9);})['catch'](function(_0x4e2760){_0x18ff29(_0x4e2760);});}});}Fax[_0xa6f7('0x1f')][_0xa6f7('0x59')]=function(_0x3ba166,_0x53c199){var _0x3f129=this;return new BPromise(function(_0x36decb,_0x508469){var _0xb5acd0=uuid['v4']();var _0x2aea48=ut['addVariables'](_0x3ba166,_0x53c199);_0x3f129['actions'][_0xb5acd0]=new Action(_0xb5acd0,_0x53c199,_0x3ba166);var _0xadf749=_0x3f129['actions'][_0xb5acd0];if(path[_0xa6f7('0x3a')](_0x3ba166[_0xa6f7('0x4')])['ext']==='.pdf'){originate(_0xadf749,_0x2aea48,!![])[_0xa6f7('0x3d')](function(_0x1da89a){_0x36decb(_0x1da89a);})[_0xa6f7('0x3f')](function(_0x58f4c4){_0x508469(_0x58f4c4);});}else{originate(_0xadf749,_0x2aea48,![])[_0xa6f7('0x3d')](function(_0x4032eb){_0x36decb(_0x4032eb);})[_0xa6f7('0x3f')](function(_0x474489){_0x508469(_0x474489);});}});};Fax[_0xa6f7('0x1f')][_0xa6f7('0x6a')]=function(_0x3149a5){return!_[_0xa6f7('0x6b')](_0x3149a5)&&!_[_0xa6f7('0x6b')](_0x3149a5[_0xa6f7('0x26')])&&!_[_0xa6f7('0x6b')](_0x3149a5['active'])&&_0x3149a5[_0xa6f7('0x6c')]&&!_[_0xa6f7('0x6b')](this[_0xa6f7('0x11')][util[_0xa6f7('0x64')](_0xa6f7('0x6d'),_0x3149a5[_0xa6f7('0x26')])])&&!_['isNil'](this[_0xa6f7('0x11')][util[_0xa6f7('0x64')](_0xa6f7('0x6d'),_0x3149a5[_0xa6f7('0x26')])][_0xa6f7('0x2f')])&&(this[_0xa6f7('0x11')][util['format']('SIP/%s',_0x3149a5[_0xa6f7('0x26')])][_0xa6f7('0x2f')]===_0xa6f7('0x6e')||this[_0xa6f7('0x11')][util[_0xa6f7('0x64')]('SIP/%s',_0x3149a5[_0xa6f7('0x26')])]['status']===_0xa6f7('0x6f'));};Fax[_0xa6f7('0x1f')]['checkTrunk']=function(_0x47951a,_0x24c1f7){if(!this['isTrunkReachable'](_0x47951a)){ut['logger'](_0xa6f7('0x70'),_[_0xa6f7('0x6b')](_0x47951a)?'':_0x47951a[_0xa6f7('0x26')]+_0xa6f7('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xa6f7('0x6b')](_0x24c1f7[_0xa6f7('0x8')])){ut[_0xa6f7('0x47')](_0xa6f7('0x72'),JSON[_0xa6f7('0x42')](_0x24c1f7));return{'isValid':![],'message':_0xa6f7('0x73')};}if(_['isNil'](_0x24c1f7[_0xa6f7('0x4')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0xa6f7('0x42')](_0x24c1f7));return{'isValid':![],'message':_0xa6f7('0x74')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xa6f7('0x75')]=Fax;
\ No newline at end of file
+var _0x087b=['\x20result\x20conversion\x20file\x20','message','parse','.pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','then','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','FaxAccountId','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','context','hasOwnProperty','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum'];(function(_0x393b5c,_0x30834d){var _0x5cef14=function(_0x149d2e){while(--_0x149d2e){_0x393b5c['push'](_0x393b5c['shift']());}};_0x5cef14(++_0x30834d);}(_0x087b,0x11a));var _0xb087=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x087b[_0x2dadb9];return _0x2f0097;};'use strict';var util=require(_0xb087('0x0'));var _=require(_0xb087('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xb087('0x2'));var path=require('path');var tiff2pdf=require(_0xb087('0x3'));var gs=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var ami=require(_0xb087('0x7'));var rpcDb=require(_0xb087('0x8'));var Channel=require(_0xb087('0x9'));var ut=require(_0xb087('0xa'));var Action=require(_0xb087('0xb'));var faxAccount=require(_0xb087('0xc'));var attachment=require(_0xb087('0xd'));var faxMessage=require(_0xb087('0xe'));function Fax(_0x1dbe9f){this[_0xb087('0xf')]={};this[_0xb087('0x10')]=_0x1dbe9f[_0xb087('0x10')];this[_0xb087('0x11')]=_0x1dbe9f['trunks'];this[_0xb087('0x12')]={};ami['on'](_0xb087('0x13'),this[_0xb087('0x14')][_0xb087('0x15')](this));ami['on'](_0xb087('0x16'),this[_0xb087('0x17')][_0xb087('0x15')](this));ami['on']('newstate',this[_0xb087('0x18')][_0xb087('0x15')](this));ami['on'](_0xb087('0x19'),this['syncNewExten'][_0xb087('0x15')](this));ami['on'](_0xb087('0x1a'),this[_0xb087('0x1b')][_0xb087('0x15')](this));ami['on'](_0xb087('0x1c'),this[_0xb087('0x1d')][_0xb087('0x15')](this));ami['on'](_0xb087('0x1e'),this[_0xb087('0x1f')][_0xb087('0x15')](this));ami['on']('originateresponse',this[_0xb087('0x20')][_0xb087('0x15')](this));}Fax['prototype'][_0xb087('0x14')]=function(_0x2b83b7){if(_0x2b83b7[_0xb087('0x21')]==='from-voip-provider'){for(var _0x330005 in this[_0xb087('0x10')]){if(this[_0xb087('0x10')][_0xb087('0x22')](_0x330005)){if(_0x2b83b7['exten']===this[_0xb087('0x10')][_0x330005][_0xb087('0x23')]){this[_0xb087('0xf')][_0x2b83b7[_0xb087('0x24')]]={};this['channels'][_0x2b83b7['uniqueid']]['channel']=_0x2b83b7['channel'];this[_0xb087('0xf')][_0x2b83b7[_0xb087('0x24')]]['id']=this[_0xb087('0x10')][_0x330005]['id'];this[_0xb087('0xf')][_0x2b83b7[_0xb087('0x24')]][_0xb087('0x25')]=this[_0xb087('0x10')][_0x330005]['name'];logger[_0xb087('0x26')](_0x2b83b7[_0xb087('0x24')],_0xb087('0x27'));}}}}if(this[_0xb087('0x12')][_0x2b83b7[_0xb087('0x24')]]){this['channels'][_0x2b83b7[_0xb087('0x24')]]={};this[_0xb087('0xf')][_0x2b83b7['uniqueid']]['channel']=_0x2b83b7['channel'];logger['info'](_0x2b83b7['uniqueid'],_0xb087('0x27'));}};Fax[_0xb087('0x28')][_0xb087('0x17')]=function(_0x3ca2df){if(this[_0xb087('0xf')][_0x3ca2df[_0xb087('0x24')]]){for(var _0xf3f41f in _0x3ca2df[_0xb087('0x29')]){if(_0x3ca2df[_0xb087('0x29')][_0xb087('0x22')](_0xf3f41f)){this[_0xb087('0xf')][_0x3ca2df[_0xb087('0x24')]][_0xf3f41f]=_0x3ca2df[_0xb087('0x2a')];}}}};Fax[_0xb087('0x28')]['syncNewState']=function(_0x37393a){if(this[_0xb087('0xf')][_0x37393a[_0xb087('0x24')]]){this[_0xb087('0xf')][_0x37393a[_0xb087('0x24')]][_0xb087('0x2b')]=_0x37393a[_0xb087('0x2b')];this[_0xb087('0xf')][_0x37393a['uniqueid']]['channelstatedesc']=_0x37393a[_0xb087('0x2c')];}};Fax[_0xb087('0x28')]['syncNewExten']=function(_0x60bfe2){if(this[_0xb087('0xf')][_0x60bfe2[_0xb087('0x24')]]){for(var _0x32b20d in _0x60bfe2[_0xb087('0x29')]){if(_0x60bfe2[_0xb087('0x29')][_0xb087('0x22')](_0x32b20d)){this[_0xb087('0xf')][_0x60bfe2[_0xb087('0x24')]][_0x32b20d]=_0x60bfe2[_0xb087('0x2a')];}}}};Fax[_0xb087('0x28')][_0xb087('0x1b')]=function(_0x57ae94){if(this[_0xb087('0xf')][_0x57ae94['uniqueid']]){this[_0xb087('0xf')][_0x57ae94[_0xb087('0x24')]][_0xb087('0x2d')]=_0x57ae94[_0xb087('0x2d')];this[_0xb087('0xf')][_0x57ae94[_0xb087('0x24')]][_0xb087('0x2e')]=_0x57ae94[_0xb087('0x2e')];this[_0xb087('0xf')][_0x57ae94['uniqueid']]['localstationid']=_0x57ae94[_0xb087('0x23')];this[_0xb087('0xf')][_0x57ae94[_0xb087('0x24')]][_0xb087('0x2f')]=_0x57ae94[_0xb087('0x2f')];logger['info'](_0x57ae94[_0xb087('0x24')],_0xb087('0x30'));}};Fax['prototype']['syncReceiveFax']=function(_0x1726c2){var _0x1c7d90=this;if(this[_0xb087('0xf')][_0x1726c2['uniqueid']]){var _0x25d8de=this[_0xb087('0xf')][_0x1726c2[_0xb087('0x24')]]['id'];this[_0xb087('0xf')][_0x1726c2[_0xb087('0x24')]]['remotestationid']=_0x1726c2[_0xb087('0x31')];this['channels'][_0x1726c2[_0xb087('0x24')]]['pagestransferred']=_0x1726c2[_0xb087('0x32')];this[_0xb087('0xf')][_0x1726c2['uniqueid']][_0xb087('0x23')]=_0x1726c2['localstationid'];this[_0xb087('0xf')][_0x1726c2['uniqueid']][_0xb087('0x33')]=_0x1726c2[_0xb087('0x33')];this[_0xb087('0xf')][_0x1726c2[_0xb087('0x24')]][_0xb087('0x34')]=_0x1726c2[_0xb087('0x34')];this[_0xb087('0xf')][_0x1726c2['uniqueid']][_0xb087('0x2f')]=_0x1726c2['filename'];this[_0xb087('0xf')][_0x1726c2[_0xb087('0x24')]]['calleridnum']=_0x1726c2[_0xb087('0x35')];if(this[_0xb087('0xf')][_0x1726c2[_0xb087('0x24')]]['pagestransferred']>0x0){tiff2pdf(_0x1726c2[_0xb087('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0x2ff54e){logger[_0xb087('0x26')](_0x1726c2['uniqueid'],_0xb087('0x36'),_0x2ff54e[_0xb087('0x37')]);attachment['create']({'name':path[_0xb087('0x38')](_0x1726c2[_0xb087('0x2f')])['name'],'basename':path[_0xb087('0x38')](_0x1726c2[_0xb087('0x2f')])[_0xb087('0x25')]+_0xb087('0x39'),'type':'application/pdf'})['then'](function(_0x1a16d7){faxAccount[_0xb087('0x3a')](_0x25d8de,{'from':_0x1726c2[_0xb087('0x35')],'mapKey':_0xb087('0x6'),'body':path[_0xb087('0x38')](_0x1726c2[_0xb087('0x2f')])['name']+'.pdf','AttachmentId':_0x1a16d7['id']})[_0xb087('0x3b')](function(_0x520acc){logger[_0xb087('0x3c')](_0x1726c2[_0xb087('0x24')],_0xb087('0x3d'),JSON[_0xb087('0x3e')](_0x520acc));});})['catch'](function(_0x2be4f2){logger['error'](_0x1726c2[_0xb087('0x24')],_0xb087('0x3f'),JSON[_0xb087('0x3e')](_0x2be4f2));});});}logger[_0xb087('0x26')](_0x1726c2[_0xb087('0x24')],'\x20receiveFax\x20');}};Fax[_0xb087('0x28')][_0xb087('0x20')]=function(_0x588d96){if(this['actions'][_0x588d96[_0xb087('0x24')]]){_['merge'](this['channels'][_0x588d96[_0xb087('0x24')]],_[_0xb087('0x40')](_0x588d96,['response',_0xb087('0x41')]));}};function updateStatus(_0x2aa54c){if(_0x2aa54c[_0xb087('0x42')]){faxMessage['update'](_0x2aa54c['AttachmentId'],{'failMessage':_0xb087('0x43')})['then'](function(_0x5e40cb){ut[_0xb087('0x44')](_0xb087('0x45'),_0x5e40cb);})[_0xb087('0x3b')](function(_0x4067cf){ut[_0xb087('0x44')](_0xb087('0x46'),_0x4067cf);});}else{ut[_0xb087('0x44')](_0xb087('0x47'));}}Fax[_0xb087('0x28')][_0xb087('0x48')]=function(_0x47d47c,_0x2cfc44,_0x55e653){var _0x46d570=this;var _0x46548e={};if(_0x2cfc44){_0x46548e={'read':_0x2cfc44};}else{_0x46548e={'failMessage':_0x55e653};}if(this['actions'][_0x47d47c][_0xb087('0x42')]){faxMessage[_0xb087('0x49')](this[_0xb087('0x12')][_0x47d47c][_0xb087('0x42')],_0x46548e)[_0xb087('0x4a')](function(_0x3c85d1){ut[_0xb087('0x44')](_0xb087('0x4b'),_0x3c85d1);})[_0xb087('0x3b')](function(_0x357616){ut[_0xb087('0x44')]('[Fax][Message][NoUpdate1]',_0x357616);})[_0xb087('0x4c')](function(){delete _0x46d570['channels'][_0x47d47c];delete _0x46d570[_0xb087('0x12')][_0x47d47c];});}else{ut['logger'](_0xb087('0x4d'));delete this[_0xb087('0xf')][_0x47d47c];delete this[_0xb087('0x12')][_0x47d47c];}};Fax[_0xb087('0x28')][_0xb087('0x1f')]=function(_0x465ef6){var _0x383304=this;if(this[_0xb087('0xf')][_0x465ef6[_0xb087('0x24')]]){if(this[_0xb087('0x12')][_0x465ef6[_0xb087('0x24')]]){this[_0xb087('0xf')][_0x465ef6[_0xb087('0x24')]]['id']=this[_0xb087('0x12')][_0x465ef6[_0xb087('0x24')]]['id'];this[_0xb087('0xf')][_0x465ef6[_0xb087('0x24')]][_0xb087('0x25')]=this[_0xb087('0x12')][_0x465ef6[_0xb087('0x24')]][_0xb087('0x25')];}logger[_0xb087('0x26')](_0x465ef6['uniqueid'],this[_0xb087('0x12')][_0x465ef6[_0xb087('0x24')]]?_0xb087('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0xb087('0x3e')](this[_0xb087('0xf')][_0x465ef6['uniqueid']]));if(this[_0xb087('0x12')][_0x465ef6[_0xb087('0x24')]]){if(this[_0xb087('0xf')][_0x465ef6['uniqueid']][_0xb087('0x4f')]>0x0&&this[_0xb087('0xf')][_0x465ef6[_0xb087('0x24')]][_0xb087('0x1a')]===_0xb087('0x50')){this[_0xb087('0x48')](_0x465ef6[_0xb087('0x24')],!![]);}else{this[_0xb087('0x48')](_0x465ef6['uniqueid'],![],this[_0xb087('0xf')][_0x465ef6[_0xb087('0x24')]][_0xb087('0x51')]?'SENDING\x20FAILED:\x20'+this[_0xb087('0xf')][_0x465ef6['uniqueid']]['faxstatusstring']:_0xb087('0x52'));}}}};Fax[_0xb087('0x28')]['send']=function(_0x298fdb){var _0x524d18=this;return new BPromise(function(_0x52a263,_0x1a8237){_0x524d18['execOriginate'](_0x298fdb,_0x524d18['faxAccounts'][_0x298fdb[_0xb087('0x53')]])['then'](function(_0x5ede2e){ut[_0xb087('0x44')]('[Fax][execOriginate][success]',_0x5ede2e);_0x52a263(ut[_0xb087('0x37')]('Fax\x20received'));})[_0xb087('0x3b')](function(_0x132dd8){ut[_0xb087('0x44')](_0xb087('0x54'),_0x132dd8);updateStatus(_0x298fdb);_0x1a8237(ut[_0xb087('0x37')](_0xb087('0x55')));});});};Fax['prototype'][_0xb087('0x56')]=function(_0x4b8a79){var _0x22e010=this;return new BPromise(function(_0x245efb,_0x1060e1){var _0x59490f=_0x22e010[_0xb087('0x57')](_0x22e010['faxAccounts'][_0x4b8a79[_0xb087('0x53')]][_0xb087('0x58')],_0x4b8a79);if(_0x59490f[_0xb087('0x59')]){_0x245efb(ut[_0xb087('0x37')](_0xb087('0x5a')));}else{_0x1060e1(ut[_0xb087('0x37')](_0x59490f['message']));}});};function originate(_0x245d68,_0xd01a6b,_0x4bedbd){return new BPromise(function(_0x25a45f,_0x58de88){if(_0x4bedbd){var _0x19238d=util[_0xb087('0x5b')](_0xb087('0x5c'),path[_0xb087('0x38')](_0x245d68[_0xb087('0x5d')])[_0xb087('0x25')],_0x245d68[_0xb087('0x5d')]);gs[_0xb087('0x5e')](_0x19238d)['then'](function(){_0x245d68['path']=util['format'](_0xb087('0x5f'),path['parse'](_0x245d68[_0xb087('0x5d')])['dir'],path[_0xb087('0x38')](_0x245d68[_0xb087('0x5d')])[_0xb087('0x25')]);_0xd01a6b[_0xb087('0x60')]=_0x245d68['path'];ut[_0xb087('0x44')]('Convert\x20pdf\x20to\x20tif','');ami[_0xb087('0x61')](ut[_0xb087('0x62')](_0x245d68,_0xd01a6b))[_0xb087('0x4a')](function(_0x42f4a3){_0x25a45f(_0x42f4a3);})['catch'](function(_0x49d26a){_0x58de88(_0x49d26a);});})[_0xb087('0x3b')](function(_0x5a16bb){_0x58de88(_0x5a16bb);});}else{ami[_0xb087('0x61')](ut[_0xb087('0x62')](_0x245d68,_0xd01a6b))[_0xb087('0x4a')](function(_0x3a96ba){_0x25a45f(_0x3a96ba);})['catch'](function(_0x4bdd30){_0x58de88(_0x4bdd30);});}});}Fax[_0xb087('0x28')]['execOriginate']=function(_0x34e72c,_0x1c7cd7){var _0x445cb8=this;return new BPromise(function(_0x2f9631,_0x142b0f){var _0x581ad4=uuid['v4']();var _0x40af15=ut[_0xb087('0x63')](_0x34e72c,_0x1c7cd7);_0x445cb8['actions'][_0x581ad4]=new Action(_0x581ad4,_0x1c7cd7,_0x34e72c);var _0x544ee0=_0x445cb8['actions'][_0x581ad4];if(path[_0xb087('0x38')](_0x34e72c[_0xb087('0x5d')])[_0xb087('0x64')]===_0xb087('0x39')){originate(_0x544ee0,_0x40af15,!![])[_0xb087('0x4a')](function(_0x19d7ae){_0x2f9631(_0x19d7ae);})['catch'](function(_0xd1f58a){_0x142b0f(_0xd1f58a);});}else{originate(_0x544ee0,_0x40af15,![])[_0xb087('0x4a')](function(_0x1e01c5){_0x2f9631(_0x1e01c5);})[_0xb087('0x3b')](function(_0x42f6bd){_0x142b0f(_0x42f6bd);});}});};Fax[_0xb087('0x28')][_0xb087('0x65')]=function(_0x50454b){return!_[_0xb087('0x66')](_0x50454b)&&!_[_0xb087('0x66')](_0x50454b[_0xb087('0x25')])&&!_['isNil'](_0x50454b[_0xb087('0x67')])&&_0x50454b['active']&&!_[_0xb087('0x66')](this[_0xb087('0x11')][util[_0xb087('0x5b')](_0xb087('0x68'),_0x50454b[_0xb087('0x25')])])&&!_[_0xb087('0x66')](this['trunks'][util['format'](_0xb087('0x68'),_0x50454b[_0xb087('0x25')])]['status'])&&(this[_0xb087('0x11')][util[_0xb087('0x5b')](_0xb087('0x68'),_0x50454b[_0xb087('0x25')])][_0xb087('0x2e')]===_0xb087('0x69')||this['trunks'][util[_0xb087('0x5b')](_0xb087('0x68'),_0x50454b[_0xb087('0x25')])][_0xb087('0x2e')]===_0xb087('0x6a'));};Fax[_0xb087('0x28')][_0xb087('0x57')]=function(_0x1fc613,_0x1dc1ae){if(!this['isTrunkReachable'](_0x1fc613)){ut[_0xb087('0x44')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xb087('0x66')](_0x1fc613)?'':_0x1fc613[_0xb087('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xb087('0x6b')};}if(_[_0xb087('0x66')](_0x1dc1ae[_0xb087('0x6')])){ut[_0xb087('0x44')](_0xb087('0x6c'),JSON[_0xb087('0x3e')](_0x1dc1ae));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xb087('0x66')](_0x1dc1ae[_0xb087('0x5d')])){ut[_0xb087('0x44')](_0xb087('0x6d'),JSON[_0xb087('0x3e')](_0x1dc1ae));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xb087('0x6e')};};module[_0xb087('0x6f')]=Fax;
\ No newline at end of file
index 3b4f4c5..9cd2427 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15f7=['inspect','then','notify','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x15f7,0x9d));var _0x715f=function(_0x5458a6,_0x1688c5){_0x5458a6=_0x5458a6-0x0;var _0x2669fc=_0x15f7[_0x5458a6];return _0x2669fc;};'use strict';var util=require(_0x715f('0x0'));var BPromise=require('bluebird');var logger=require(_0x715f('0x1'))(_0x715f('0x2'));var _=require(_0x715f('0x3'));var faxAccount=require(_0x715f('0x4'));function loggerCatch(_0xff3e74){return function(_0x121e37){logger['error'](_0xff3e74,util[_0x715f('0x5')](_0x121e37,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0xb6e204,_0x3b15b5){return BPromise['resolve']()[_0x715f('0x6')](faxAccount[_0x715f('0x7')](_0xb6e204,_0x3b15b5))['catch'](loggerCatch(_0x715f('0x8')));};
\ No newline at end of file
+var _0x50cc=['util','bluebird','../../../config/logger','preview','../rpc/faxAccount','error','notify','resolve','then','catch','[Notify]\x20'];(function(_0x138a76,_0x4d8945){var _0xf8f1ab=function(_0x587329){while(--_0x587329){_0x138a76['push'](_0x138a76['shift']());}};_0xf8f1ab(++_0x4d8945);}(_0x50cc,0x6e));var _0xc50c=function(_0x2aefcb,_0x3c8f68){_0x2aefcb=_0x2aefcb-0x0;var _0x3d07c4=_0x50cc[_0x2aefcb];return _0x3d07c4;};'use strict';var util=require(_0xc50c('0x0'));var BPromise=require(_0xc50c('0x1'));var logger=require(_0xc50c('0x2'))(_0xc50c('0x3'));var _=require('lodash');var faxAccount=require(_0xc50c('0x4'));function loggerCatch(_0x17d5a7){return function(_0x37d4b8){logger[_0xc50c('0x5')](_0x17d5a7,util['inspect'](_0x37d4b8,{'showHidden':![],'depth':null}));};}exports[_0xc50c('0x6')]=function(_0x5f5963,_0x462e59){return BPromise[_0xc50c('0x7')]()[_0xc50c('0x8')](faxAccount[_0xc50c('0x6')](_0x5f5963,_0x462e59))[_0xc50c('0x9')](loggerCatch(_0xc50c('0xa')));};
\ No newline at end of file
index 8837c1f..462a353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf75c=['../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','inspect','util'];(function(_0x2a9b2f,_0xaa3f34){var _0x52da66=function(_0x2d2b46){while(--_0x2d2b46){_0x2a9b2f['push'](_0x2a9b2f['shift']());}};_0x52da66(++_0xaa3f34);}(_0xf75c,0x1cb));var _0xcf75=function(_0x59f2b5,_0x2ae2b5){_0x59f2b5=_0x59f2b5-0x0;var _0x5202e7=_0xf75c[_0x59f2b5];return _0x5202e7;};'use strict';var util=require(_0xcf75('0x0'));var logger=require(_0xcf75('0x1'))(_0xcf75('0x2'));var BPromise=require(_0xcf75('0x3'));var exec=require(_0xcf75('0x4'))[_0xcf75('0x5')];exports[_0xcf75('0x6')]=function(_0x4270d2){return new BPromise(function(_0x22fefb,_0x2ed4f5){exec(_0x4270d2,function(_0x3ed1a1,_0x5ae24a,_0x354d13){logger[_0xcf75('0x7')](_0xcf75('0x8'),_0x5ae24a);if(_0x3ed1a1){logger['info'](_0xcf75('0x8'),'\x20Error\x20:',util[_0xcf75('0x9')](_0x3ed1a1,{'showHidden':![],'depth':null}),_0x5ae24a,_0x354d13);_0x2ed4f5(_0x3ed1a1);}_0x22fefb(_0x5ae24a);});});};
\ No newline at end of file
+var _0xa665=['child_process','exec','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0xa665,0x176));var _0x5a66=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0xa665[_0x4da356];return _0x321b07;};'use strict';var util=require('util');var logger=require(_0x5a66('0x0'))(_0x5a66('0x1'));var BPromise=require('bluebird');var exec=require(_0x5a66('0x2'))[_0x5a66('0x3')];exports['execute']=function(_0x1974ca){return new BPromise(function(_0xd5ccdd,_0x2e347e){exec(_0x1974ca,function(_0x274e1b,_0xc0452c,_0x191b2c){logger[_0x5a66('0x4')](_0x5a66('0x5'),_0xc0452c);if(_0x274e1b){logger[_0x5a66('0x4')](_0x5a66('0x5'),_0x5a66('0x6'),util[_0x5a66('0x7')](_0x274e1b,{'showHidden':![],'depth':null}),_0xc0452c,_0x191b2c);_0x2e347e(_0x274e1b);}_0xd5ccdd(_0xc0452c);});});};
\ No newline at end of file
index c580d0f..9a209ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa572=['info','inspect','ecm','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','xcally-motion-fax','headerinfo','uniqueid','util','fax','message'];(function(_0x37fb7c,_0x44a2b1){var _0x37a2a9=function(_0x555658){while(--_0x555658){_0x37fb7c['push'](_0x37fb7c['shift']());}};_0x37a2a9(++_0x44a2b1);}(_0xa572,0x138));var _0x2a57=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xa572[_0x562f3b];return _0x1edd55;};'use strict';var util=require(_0x2a57('0x0'));var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')(_0x2a57('0x1'));exports[_0x2a57('0x2')]=function(_0x1d82e5){return{'message':_0x1d82e5};};exports['logger']=function(_0x194d85,_0x22749d){logger[_0x2a57('0x3')](_0x194d85,util[_0x2a57('0x4')](_0x22749d,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x549670,_0x127ed1){var _0x631824={'XMF-ECM':_0x127ed1[_0x2a57('0x5')],'XMF-HEADERINFO':_0x127ed1['headerinfo'],'XMF-MINRATE':_0x127ed1[_0x2a57('0x6')],'XMF-MAXRATE':_0x127ed1[_0x2a57('0x7')],'XMF-MODEM':util[_0x2a57('0x8')](_0x2a57('0x9'),_0x127ed1[_0x2a57('0xa')]),'XMF-GATEWAY':_0x127ed1[_0x2a57('0xb')],'XMF-FAXDETECT':_0x127ed1[_0x2a57('0xc')],'XMF-T38TIMEOUT':_0x127ed1[_0x2a57('0xd')],'XMF-LOCALSTATIONID':_0x127ed1[_0x2a57('0xe')],'XMF-PATH':_0x549670[_0x2a57('0xf')]};return _0x631824;};exports[_0x2a57('0x10')]=function(_0x42da09,_0x153e86){return{'actionid':_0x42da09['uniqueid'],'action':_0x2a57('0x11'),'channel':_0x42da09['channel'],'Exten':_0x2a57('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0x2a57('0x8')]('\x22%s\x22\x20<%s>',_0x42da09[_0x2a57('0x13')]?_0x42da09[_0x2a57('0x13')]:'',_0x42da09['localstationid']),'variable':_0x153e86,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x42da09[_0x2a57('0x14')]};};
\ No newline at end of file
+var _0x0fe0=['logger','info','inspect','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','lodash','moment','../../../../config/logger','fax','message'];(function(_0xfdbd2d,_0x5d7ae5){var _0xc3e63e=function(_0x2097b7){while(--_0x2097b7){_0xfdbd2d['push'](_0xfdbd2d['shift']());}};_0xc3e63e(++_0x5d7ae5);}(_0x0fe0,0x126));var _0x00fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0fe0[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0x00fe('0x0'));var moment=require(_0x00fe('0x1'));var logger=require(_0x00fe('0x2'))(_0x00fe('0x3'));exports[_0x00fe('0x4')]=function(_0x253f21){return{'message':_0x253f21};};exports[_0x00fe('0x5')]=function(_0x27ed24,_0x236500){logger[_0x00fe('0x6')](_0x27ed24,util[_0x00fe('0x7')](_0x236500,{'showHidden':![],'depth':null}));};exports[_0x00fe('0x8')]=function(_0x2accd2,_0x38fbc9){var _0x3d9340={'XMF-ECM':_0x38fbc9[_0x00fe('0x9')],'XMF-HEADERINFO':_0x38fbc9[_0x00fe('0xa')],'XMF-MINRATE':_0x38fbc9['minrate'],'XMF-MAXRATE':_0x38fbc9[_0x00fe('0xb')],'XMF-MODEM':util[_0x00fe('0xc')](_0x00fe('0xd'),_0x38fbc9[_0x00fe('0xe')]),'XMF-GATEWAY':_0x38fbc9[_0x00fe('0xf')],'XMF-FAXDETECT':_0x38fbc9['faxdetect'],'XMF-T38TIMEOUT':_0x38fbc9['t38timeout'],'XMF-LOCALSTATIONID':_0x38fbc9[_0x00fe('0x10')],'XMF-PATH':_0x2accd2[_0x00fe('0x11')]};return _0x3d9340;};exports[_0x00fe('0x12')]=function(_0x31e686,_0x3d200d){return{'actionid':_0x31e686[_0x00fe('0x13')],'action':'originate','channel':_0x31e686[_0x00fe('0x14')],'Exten':_0x00fe('0x15'),'Context':_0x00fe('0x16'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x31e686['headerinfo']?_0x31e686[_0x00fe('0xa')]:'',_0x31e686[_0x00fe('0x10')]),'variable':_0x3d200d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x31e686[_0x00fe('0x13')]};};
\ No newline at end of file
index 06d5fc0..bfc428c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94c9=['hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','inspect','listen','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./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','./rpc/integrations/dynamics365','../../config/logger','ami','get'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x94c9,0x79));var _0x994c=function(_0x1d291d,_0x17314a){_0x1d291d=_0x1d291d-0x0;var _0x44cc4e=_0x94c9[_0x1d291d];return _0x44cc4e;};'use strict';var BPromise=require(_0x994c('0x0'));var util=require(_0x994c('0x1'));var moment=require(_0x994c('0x2'));var server=require(_0x994c('0x3'));var Realtime=require(_0x994c('0x4'));var Report=require(_0x994c('0x5'));var Acw=require(_0x994c('0x6'));var Trigger=require(_0x994c('0x7'));var Dialer=require(_0x994c('0x8'));var Preview=require(_0x994c('0x9'));var Fax=require(_0x994c('0xa'));var user=require(_0x994c('0xb'));var voiceQueue=require(_0x994c('0xc'));var voiceQueueReport=require(_0x994c('0xd'));var voiceCallReport=require(_0x994c('0xe'));var trunk=require(_0x994c('0xf'));var trigger=require(_0x994c('0x10'));var template=require(_0x994c('0x11'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x994c('0x12'));var voiceExtension=require(_0x994c('0x13'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x994c('0x14'));var salesforce=require(_0x994c('0x15'));var sugarcrm=require(_0x994c('0x16'));var freshdesk=require(_0x994c('0x17'));var desk=require(_0x994c('0x18'));var zoho=require(_0x994c('0x19'));var vtiger=require(_0x994c('0x1a'));var freshsales=require(_0x994c('0x1b'));var servicenow=require(_0x994c('0x1c'));var dynamics365=require(_0x994c('0x1d'));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(_0x994c('0x1e'))(_0x994c('0x1f'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x994c('0x20')](_0x994c('0x21'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x994c('0x20')](_0x994c('0x21'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x994c('0x22')](user[_0x994c('0x23')]())[_0x994c('0x22')](realtime[_0x994c('0x24')]())[_0x994c('0x22')](user[_0x994c('0x25')]())['then'](realtime[_0x994c('0x26')]())[_0x994c('0x22')](trunk[_0x994c('0x27')]())['then'](realtime[_0x994c('0x28')]())[_0x994c('0x22')](voiceQueue[_0x994c('0x29')]())[_0x994c('0x22')](realtime[_0x994c('0x2a')]())[_0x994c('0x22')](trigger[_0x994c('0x2b')]())[_0x994c('0x22')](realtime[_0x994c('0x2c')]())[_0x994c('0x22')](template['getTemplates']())[_0x994c('0x22')](realtime['initTemplates']())[_0x994c('0x22')](zendesk[_0x994c('0x2d')]())[_0x994c('0x22')](realtime[_0x994c('0x2e')]())[_0x994c('0x22')](salesforce[_0x994c('0x2f')]())[_0x994c('0x22')](realtime[_0x994c('0x30')]())[_0x994c('0x22')](sugarcrm[_0x994c('0x31')]())[_0x994c('0x22')](realtime[_0x994c('0x32')]())['then'](freshdesk[_0x994c('0x33')]())['then'](realtime['initFreshdeskAccounts']())['then'](desk['getDeskAccounts']())[_0x994c('0x22')](realtime[_0x994c('0x34')]())[_0x994c('0x22')](zoho[_0x994c('0x35')]())[_0x994c('0x22')](realtime[_0x994c('0x36')]())['then'](vtiger['getVtigerAccounts']())[_0x994c('0x22')](realtime[_0x994c('0x37')]())[_0x994c('0x22')](freshsales[_0x994c('0x38')]())[_0x994c('0x22')](realtime[_0x994c('0x39')]())['then'](servicenow[_0x994c('0x3a')]())[_0x994c('0x22')](realtime[_0x994c('0x3b')]())[_0x994c('0x22')](dynamics365[_0x994c('0x3c')]())[_0x994c('0x22')](realtime[_0x994c('0x3d')]())[_0x994c('0x22')](campaign['getCampaigns']())[_0x994c('0x22')](realtime[_0x994c('0x3e')]())[_0x994c('0x22')](voiceExtension[_0x994c('0x3f')]())['then'](realtime[_0x994c('0x40')]())[_0x994c('0x22')](faxAccount[_0x994c('0x41')]())[_0x994c('0x22')](realtime[_0x994c('0x42')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x994c('0x43')]()[_0x994c('0x22')](voiceQueueReport[_0x994c('0x44')]())[_0x994c('0x22')](realtime[_0x994c('0x45')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x994c('0x22')](realtime['initVoiceQueueHopperHistory']())[_0x994c('0x22')](cmHopperHistory[_0x994c('0x46')]())[_0x994c('0x22')](realtime['initCampaignHopperHistory']())[_0x994c('0x22')](voiceCallReport[_0x994c('0x47')]())[_0x994c('0x22')](realtime[_0x994c('0x48')]())['catch'](function(_0x1549bf){logger[_0x994c('0x49')]('[index.js][initParams]',util[_0x994c('0x4a')](_0x1549bf,{'showHidden':![],'depth':null}));});}function main(){return server[_0x994c('0x4b')](realtime,preview,fax)[_0x994c('0x22')](function(_0x57b7de){return initRealtime();})[_0x994c('0x22')](function(){return initParams();})[_0x994c('0x22')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x33f59e){logger[_0x994c('0x49')](_0x994c('0x4c'),util['inspect'](_0x33f59e,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0xbec7=['initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]','inspect','sync','error','[index.js][main]','util','moment','./server','./report','./acw','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','../../config/logger','get','hour','resolve','getAgents','then','initAgents','initTelephones','getTrunks','initTrunks','initTriggers','getTemplates','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts'];(function(_0x3489ae,_0x504312){var _0xfc3b34=function(_0x4b4131){while(--_0x4b4131){_0x3489ae['push'](_0x3489ae['shift']());}};_0xfc3b34(++_0x504312);}(_0xbec7,0x11e));var _0x7bec=function(_0x4730e9,_0x3a132d){_0x4730e9=_0x4730e9-0x0;var _0x1647c5=_0xbec7[_0x4730e9];return _0x1647c5;};'use strict';var BPromise=require('bluebird');var util=require(_0x7bec('0x0'));var moment=require(_0x7bec('0x1'));var server=require(_0x7bec('0x2'));var Realtime=require('./realtime');var Report=require(_0x7bec('0x3'));var Acw=require(_0x7bec('0x4'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x7bec('0x5'));var Fax=require('./fax');var user=require(_0x7bec('0x6'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x7bec('0x7'));var voiceCallReport=require(_0x7bec('0x8'));var trunk=require('./rpc/trunk');var trigger=require(_0x7bec('0x9'));var template=require(_0x7bec('0xa'));var cmHopperHistory=require(_0x7bec('0xb'));var campaign=require(_0x7bec('0xc'));var voiceExtension=require(_0x7bec('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x7bec('0xe'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x7bec('0xf'));var freshdesk=require(_0x7bec('0x10'));var desk=require(_0x7bec('0x11'));var zoho=require(_0x7bec('0x12'));var vtiger=require(_0x7bec('0x13'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x7bec('0x14'));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(_0x7bec('0x15'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7bec('0x16')](_0x7bec('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7bec('0x16')](_0x7bec('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x7bec('0x18')]()['then'](user[_0x7bec('0x19')]())[_0x7bec('0x1a')](realtime[_0x7bec('0x1b')]())[_0x7bec('0x1a')](user['getTelephones']())['then'](realtime[_0x7bec('0x1c')]())[_0x7bec('0x1a')](trunk[_0x7bec('0x1d')]())[_0x7bec('0x1a')](realtime[_0x7bec('0x1e')]())['then'](voiceQueue['getVoiceQueues']())[_0x7bec('0x1a')](realtime['initVoiceQueues']())['then'](trigger['getTriggers']())['then'](realtime[_0x7bec('0x1f')]())[_0x7bec('0x1a')](template[_0x7bec('0x20')]())[_0x7bec('0x1a')](realtime['initTemplates']())['then'](zendesk['getZendeskAccounts']())[_0x7bec('0x1a')](realtime['initZendeskAccounts']())[_0x7bec('0x1a')](salesforce[_0x7bec('0x21')]())['then'](realtime[_0x7bec('0x22')]())[_0x7bec('0x1a')](sugarcrm[_0x7bec('0x23')]())['then'](realtime[_0x7bec('0x24')]())[_0x7bec('0x1a')](freshdesk[_0x7bec('0x25')]())['then'](realtime[_0x7bec('0x26')]())[_0x7bec('0x1a')](desk[_0x7bec('0x27')]())[_0x7bec('0x1a')](realtime[_0x7bec('0x28')]())[_0x7bec('0x1a')](zoho['getZohoAccounts']())[_0x7bec('0x1a')](realtime[_0x7bec('0x29')]())[_0x7bec('0x1a')](vtiger[_0x7bec('0x2a')]())['then'](realtime[_0x7bec('0x2b')]())[_0x7bec('0x1a')](freshsales['getFreshsalesAccounts']())[_0x7bec('0x1a')](realtime[_0x7bec('0x2c')]())[_0x7bec('0x1a')](servicenow['getServicenowAccounts']())[_0x7bec('0x1a')](realtime[_0x7bec('0x2d')]())[_0x7bec('0x1a')](dynamics365[_0x7bec('0x2e')]())['then'](realtime[_0x7bec('0x2f')]())['then'](campaign[_0x7bec('0x30')]())[_0x7bec('0x1a')](realtime[_0x7bec('0x31')]())[_0x7bec('0x1a')](voiceExtension[_0x7bec('0x32')]())[_0x7bec('0x1a')](realtime[_0x7bec('0x33')]())[_0x7bec('0x1a')](faxAccount[_0x7bec('0x34')]())[_0x7bec('0x1a')](realtime['initFaxAccounts']())[_0x7bec('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x7bec('0x18')]()[_0x7bec('0x1a')](voiceQueueReport[_0x7bec('0x35')]())[_0x7bec('0x1a')](realtime[_0x7bec('0x36')]())['then'](cmHopperHistory[_0x7bec('0x37')]())[_0x7bec('0x1a')](realtime[_0x7bec('0x38')]())[_0x7bec('0x1a')](cmHopperHistory[_0x7bec('0x39')]())[_0x7bec('0x1a')](realtime[_0x7bec('0x3a')]())[_0x7bec('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x7bec('0x1a')](realtime[_0x7bec('0x3b')]())[_0x7bec('0x3c')](function(_0x489df8){logger['error'](_0x7bec('0x3d'),util[_0x7bec('0x3e')](_0x489df8,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x7bec('0x1a')](function(_0x35383f){return initRealtime();})[_0x7bec('0x1a')](function(){return initParams();})[_0x7bec('0x1a')](function(){report[_0x7bec('0x3f')]();setInterval(initRealtime,0x1388);})[_0x7bec('0x3c')](function(_0x37ef4b){logger[_0x7bec('0x40')](_0x7bec('0x41'),util[_0x7bec('0x3e')](_0x37ef4b,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index b0c8d2a..97bafa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x44c7a2,_0x449be7){var _0x3efc90=function(_0x114726){while(--_0x114726){_0x44c7a2['push'](_0x44c7a2['shift']());}};_0x3efc90(++_0x449be7);}(_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 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
+var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x1814c8,_0x1e3ebe){var _0x36e794=function(_0x2b714e){while(--_0x2b714e){_0x1814c8['push'](_0x1814c8['shift']());}};_0x36e794(++_0x1e3ebe);}(_0xe706,0xa3));var _0x6e70=function(_0x135f1f,_0x45e875){_0x135f1f=_0x135f1f-0x0;var _0x547ed6=_0xe706[_0x135f1f];return _0x547ed6;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent;
\ No newline at end of file
index 26533ed..e393c6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f9f=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0x57b3d5,_0x3555ec){var _0x104de1=function(_0x24b9ea){while(--_0x24b9ea){_0x57b3d5['push'](_0x57b3d5['shift']());}};_0x104de1(++_0x3555ec);}(_0x0f9f,0x12e));var _0xf0f9=function(_0x2c574e,_0x491053){_0x2c574e=_0x2c574e-0x0;var _0x1101f7=_0x0f9f[_0x2c574e];return _0x1101f7;};'use strict';function Campaign(_0x3c5da4){this['id']=_0x3c5da4['id']||0x0;this[_0xf0f9('0x0')]=_0x3c5da4[_0xf0f9('0x0')]||'';this[_0xf0f9('0x1')]=_0x3c5da4['type']||'campaign';this[_0xf0f9('0x2')]=0x0;this[_0xf0f9('0x3')]=0x0;this[_0xf0f9('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xf0f9('0x5')]='';this[_0xf0f9('0x6')]=!![];this['active']=_0x3c5da4['active'];this[_0xf0f9('0x7')]=_0x3c5da4[_0xf0f9('0x7')];this['dialTimezone']=_0x3c5da4['dialTimezone']||null;this['dialGlobalInterval']=_0x3c5da4[_0xf0f9('0x8')]?_0x3c5da4[_0xf0f9('0x8')]:null;this[_0xf0f9('0x9')]=_0x3c5da4[_0xf0f9('0x9')];this[_0xf0f9('0xa')]=_0x3c5da4[_0xf0f9('0xa')];this['dialOriginateTimeout']=_0x3c5da4[_0xf0f9('0xb')]||0x1e;this[_0xf0f9('0xc')]=_0x3c5da4['dialCongestionMaxRetry'];this[_0xf0f9('0xd')]=_0x3c5da4[_0xf0f9('0xd')];this[_0xf0f9('0xe')]=_0x3c5da4[_0xf0f9('0xe')];this[_0xf0f9('0xf')]=_0x3c5da4[_0xf0f9('0xf')];this[_0xf0f9('0x10')]=_0x3c5da4[_0xf0f9('0x10')];this[_0xf0f9('0x11')]=_0x3c5da4[_0xf0f9('0x11')];this['dialGlobalMaxRetry']=_0x3c5da4[_0xf0f9('0x12')];this[_0xf0f9('0x13')]=_0x3c5da4['dialNoSuchNumberMaxRetry']||0x3;this[_0xf0f9('0x14')]=_0x3c5da4['dialNoSuchNumberRetryFrequency']||0x96;this[_0xf0f9('0x15')]=_0x3c5da4[_0xf0f9('0x15')]||0x3;this[_0xf0f9('0x16')]=_0x3c5da4['dialDropRetryFrequency']||0x96;this[_0xf0f9('0x17')]=_0x3c5da4['dialAbandonedMaxRetry']||0x3;this[_0xf0f9('0x18')]=_0x3c5da4[_0xf0f9('0x18')]||0x96;this[_0xf0f9('0x19')]=_0x3c5da4['dialMachineMaxRetry']||0x3;this[_0xf0f9('0x1a')]=_0x3c5da4[_0xf0f9('0x1a')]||0x96;this[_0xf0f9('0x1b')]=_0x3c5da4[_0xf0f9('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3c5da4[_0xf0f9('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x3c5da4['dialOrderByScheduledAt']||'DESC';this['dialPrefix']=_0x3c5da4[_0xf0f9('0x1d')]||undefined;this[_0xf0f9('0x1e')]=_0x3c5da4[_0xf0f9('0x1e')]||undefined;this[_0xf0f9('0x1f')]=_0x3c5da4[_0xf0f9('0x1f')]||undefined;this['TrunkBackup']=_0x3c5da4['TrunkBackup']?_0x3c5da4['TrunkBackup']:undefined;this[_0xf0f9('0x20')]=_0x3c5da4[_0xf0f9('0x20')]?_0x3c5da4[_0xf0f9('0x20')]:undefined;this[_0xf0f9('0x21')]=_0x3c5da4[_0xf0f9('0x21')]?_0x3c5da4[_0xf0f9('0x21')]:undefined;this[_0xf0f9('0x22')]=_0x3c5da4[_0xf0f9('0x22')]?_0x3c5da4[_0xf0f9('0x22')]:undefined;this[_0xf0f9('0x23')]=_0x3c5da4[_0xf0f9('0x22')]?_0x3c5da4[_0xf0f9('0x22')]['name']:undefined;this[_0xf0f9('0x24')]=_0x3c5da4[_0xf0f9('0x24')]||![];this['dialAMDInitialSilence']=_0x3c5da4[_0xf0f9('0x25')];this[_0xf0f9('0x26')]=_0x3c5da4['dialAMDGreeting'];this[_0xf0f9('0x27')]=_0x3c5da4[_0xf0f9('0x27')];this[_0xf0f9('0x28')]=_0x3c5da4[_0xf0f9('0x28')];this[_0xf0f9('0x29')]=_0x3c5da4[_0xf0f9('0x29')];this[_0xf0f9('0x2a')]=_0x3c5da4[_0xf0f9('0x2a')];this[_0xf0f9('0x2b')]=_0x3c5da4[_0xf0f9('0x2b')];this[_0xf0f9('0x2c')]=_0x3c5da4[_0xf0f9('0x2c')];this['dialAMDMaximumWordLength']=_0x3c5da4['dialAMDMaximumWordLength'];}module[_0xf0f9('0x2d')]=Campaign;
\ No newline at end of file
+var _0xdfd5=['TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','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'];(function(_0x5486b7,_0x4be4d0){var _0x305ebe=function(_0x3d8e6c){while(--_0x3d8e6c){_0x5486b7['push'](_0x5486b7['shift']());}};_0x305ebe(++_0x4be4d0);}(_0xdfd5,0x19f));var _0x5dfd=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xdfd5[_0x1f36bb];return _0xaf97fa;};'use strict';function Campaign(_0x5d4eb8){this['id']=_0x5d4eb8['id']||0x0;this[_0x5dfd('0x0')]=_0x5d4eb8[_0x5dfd('0x0')]||'';this[_0x5dfd('0x1')]=_0x5d4eb8['type']||_0x5dfd('0x2');this[_0x5dfd('0x3')]=0x0;this['temp']=0x0;this[_0x5dfd('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x5dfd('0x5')]='';this[_0x5dfd('0x6')]=!![];this[_0x5dfd('0x7')]=_0x5d4eb8['active'];this['limitCalls']=_0x5d4eb8['limitCalls'];this[_0x5dfd('0x8')]=_0x5d4eb8[_0x5dfd('0x8')]||null;this['dialGlobalInterval']=_0x5d4eb8[_0x5dfd('0x9')]?_0x5d4eb8['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x5d4eb8[_0x5dfd('0xa')];this['dialOriginateCallerIdNumber']=_0x5d4eb8[_0x5dfd('0xb')];this[_0x5dfd('0xc')]=_0x5d4eb8[_0x5dfd('0xc')]||0x1e;this[_0x5dfd('0xd')]=_0x5d4eb8[_0x5dfd('0xd')];this[_0x5dfd('0xe')]=_0x5d4eb8['dialCongestionRetryFrequency'];this[_0x5dfd('0xf')]=_0x5d4eb8[_0x5dfd('0xf')];this[_0x5dfd('0x10')]=_0x5d4eb8[_0x5dfd('0x10')];this[_0x5dfd('0x11')]=_0x5d4eb8[_0x5dfd('0x11')];this[_0x5dfd('0x12')]=_0x5d4eb8['dialNoAnswerRetryFrequency'];this[_0x5dfd('0x13')]=_0x5d4eb8[_0x5dfd('0x13')];this[_0x5dfd('0x14')]=_0x5d4eb8[_0x5dfd('0x14')]||0x3;this[_0x5dfd('0x15')]=_0x5d4eb8[_0x5dfd('0x15')]||0x96;this[_0x5dfd('0x16')]=_0x5d4eb8[_0x5dfd('0x16')]||0x3;this[_0x5dfd('0x17')]=_0x5d4eb8[_0x5dfd('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x5d4eb8[_0x5dfd('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x5d4eb8[_0x5dfd('0x19')]||0x96;this[_0x5dfd('0x1a')]=_0x5d4eb8[_0x5dfd('0x1a')]||0x3;this[_0x5dfd('0x1b')]=_0x5d4eb8['dialMachineRetryFrequency']||0x96;this[_0x5dfd('0x1c')]=_0x5d4eb8[_0x5dfd('0x1c')]||0x3;this[_0x5dfd('0x1d')]=_0x5d4eb8[_0x5dfd('0x1d')]||0x96;this[_0x5dfd('0x1e')]=_0x5d4eb8[_0x5dfd('0x1e')]||_0x5dfd('0x1f');this['dialPrefix']=_0x5d4eb8[_0x5dfd('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x5d4eb8[_0x5dfd('0x21')]||undefined;this[_0x5dfd('0x22')]=_0x5d4eb8['dialCutDigit']||undefined;this[_0x5dfd('0x23')]=_0x5d4eb8['TrunkBackup']?_0x5d4eb8['TrunkBackup']:undefined;this[_0x5dfd('0x24')]=_0x5d4eb8[_0x5dfd('0x24')]?_0x5d4eb8[_0x5dfd('0x24')]:undefined;this[_0x5dfd('0x25')]=_0x5d4eb8['Interval']?_0x5d4eb8['Interval']:undefined;this[_0x5dfd('0x26')]=_0x5d4eb8[_0x5dfd('0x26')]?_0x5d4eb8[_0x5dfd('0x26')]:undefined;this[_0x5dfd('0x27')]=_0x5d4eb8['SquareProject']?_0x5d4eb8[_0x5dfd('0x26')][_0x5dfd('0x0')]:undefined;this[_0x5dfd('0x28')]=_0x5d4eb8['dialAMDActive']||![];this[_0x5dfd('0x29')]=_0x5d4eb8[_0x5dfd('0x29')];this[_0x5dfd('0x2a')]=_0x5d4eb8[_0x5dfd('0x2a')];this[_0x5dfd('0x2b')]=_0x5d4eb8['dialAMDAfterGreetingSilence'];this[_0x5dfd('0x2c')]=_0x5d4eb8['dialAMDTotalAnalysisTime'];this[_0x5dfd('0x2d')]=_0x5d4eb8[_0x5dfd('0x2d')];this[_0x5dfd('0x2e')]=_0x5d4eb8['dialAMDBetweenWordsSilence'];this[_0x5dfd('0x2f')]=_0x5d4eb8[_0x5dfd('0x2f')];this['dialAMDSilenceThreshold']=_0x5d4eb8[_0x5dfd('0x30')];this[_0x5dfd('0x31')]=_0x5d4eb8['dialAMDMaximumWordLength'];}module['exports']=Campaign;
\ No newline at end of file
index 3a9f99c..376a94c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd7=['queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','exten','answertime','endtime','abandoned','lastapplication','lastdata','duration','billableseconds','disposition','monitorFilename'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xedd7,0x6f));var _0x7edd=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xedd7[_0x5d6456];return _0x4d66c1;};'use strict';function Channel(){this['starttime']=null;this[_0x7edd('0x0')]='';this[_0x7edd('0x1')]='';this[_0x7edd('0x2')]=0x0;this[_0x7edd('0x3')]='';this[_0x7edd('0x4')]=undefined;this[_0x7edd('0x5')]=undefined;this[_0x7edd('0x6')]=0x0;this['context']='';this[_0x7edd('0x7')]=0x0;this[_0x7edd('0x8')]=0x0;this[_0x7edd('0x9')]=0x0;this['answered']=![];this[_0x7edd('0xa')]=null;this[_0x7edd('0xb')]=null;this['unmanaged']=![];this[_0x7edd('0xc')]=![];this[_0x7edd('0xd')]='';this[_0x7edd('0xe')]='';this[_0x7edd('0xf')]=0x0;this[_0x7edd('0x10')]=0x0;this['holdtime']=0x0;this['type']=null;this['tag']=null;this[_0x7edd('0x11')]=null;this['monitor']=![];this[_0x7edd('0x12')]=null;this[_0x7edd('0x13')]=null;this[_0x7edd('0x14')]=[];this[_0x7edd('0x15')]=undefined;this[_0x7edd('0x16')]=undefined;this[_0x7edd('0x17')]=undefined;this[_0x7edd('0x18')]=0x0;}module[_0x7edd('0x19')]=Channel;
\ No newline at end of file
+var _0xd5fc=['queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answertime','endtime','lastdata','billableseconds','holdtime','tag','monitor'];(function(_0x2d04d8,_0x3ef363){var _0x3d0e80=function(_0x2c94da){while(--_0x2c94da){_0x2d04d8['push'](_0x2d04d8['shift']());}};_0x3d0e80(++_0x3ef363);}(_0xd5fc,0xae));var _0xcd5f=function(_0x3ba527,_0x1fa547){_0x3ba527=_0x3ba527-0x0;var _0x532e76=_0xd5fc[_0x3ba527];return _0x532e76;};'use strict';function Channel(){this[_0xcd5f('0x0')]=null;this['channel']='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0xcd5f('0x1')]='';this[_0xcd5f('0x2')]=undefined;this[_0xcd5f('0x3')]=undefined;this[_0xcd5f('0x4')]=0x0;this[_0xcd5f('0x5')]='';this[_0xcd5f('0x6')]=0x0;this['linkedid']=0x0;this[_0xcd5f('0x7')]=0x0;this['answered']=![];this[_0xcd5f('0x8')]=null;this[_0xcd5f('0x9')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this[_0xcd5f('0xa')]='';this['duration']=0x0;this[_0xcd5f('0xb')]=0x0;this[_0xcd5f('0xc')]=0x0;this['type']=null;this[_0xcd5f('0xd')]=null;this['disposition']=null;this[_0xcd5f('0xe')]=![];this['monitorFilename']=null;this[_0xcd5f('0xf')]=null;this[_0xcd5f('0x10')]=[];this[_0xcd5f('0x11')]=undefined;this[_0xcd5f('0x12')]=undefined;this['transferType']=undefined;this[_0xcd5f('0x13')]=0x0;}module[_0xcd5f('0x14')]=Channel;
\ No newline at end of file
index e502f3c..4fcc5bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19ae=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x4a13be,_0x540adc){var _0x105ae3=function(_0x1638c6){while(--_0x1638c6){_0x4a13be['push'](_0x4a13be['shift']());}};_0x105ae3(++_0x540adc);}(_0x19ae,0x159));var _0xe19a=function(_0xc95832,_0x5e89ec){_0xc95832=_0xc95832-0x0;var _0x3e09e8=_0x19ae[_0xc95832];return _0x3e09e8;};'use strict';function DeskAccount(_0x1c294b){this['id']=_0x1c294b['id']||0x0;this['name']=_0x1c294b[_0xe19a('0x0')]||'';this[_0xe19a('0x1')]=_0x1c294b[_0xe19a('0x1')]||'';this['remoteUri']=_0x1c294b[_0xe19a('0x2')]||'';this[_0xe19a('0x3')]=_0x1c294b[_0xe19a('0x3')]||'';this[_0xe19a('0x4')]=_0x1c294b[_0xe19a('0x4')]||'';this[_0xe19a('0x5')]=_0x1c294b[_0xe19a('0x5')]||'';this[_0xe19a('0x6')]=_0x1c294b[_0xe19a('0x6')]||'';this[_0xe19a('0x7')]=_0x1c294b[_0xe19a('0x7')]||'';this[_0xe19a('0x8')]=_0x1c294b[_0xe19a('0x8')]||'';this[_0xe19a('0x9')]=_0x1c294b['type']||'';this[_0xe19a('0xa')]=_0x1c294b[_0xe19a('0xa')]||'';this[_0xe19a('0xb')]=_0x1c294b[_0xe19a('0xb')]||{};}module[_0xe19a('0xc')]=DeskAccount;
\ No newline at end of file
+var _0xa62c=['type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x41b7b8,_0xd4ea98){var _0x2dd4cf=function(_0x5f0b69){while(--_0x5f0b69){_0x41b7b8['push'](_0x41b7b8['shift']());}};_0x2dd4cf(++_0xd4ea98);}(_0xa62c,0x1d8));var _0xca62=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0xa62c[_0x11f226];return _0x30be77;};'use strict';function DeskAccount(_0x30c6b2){this['id']=_0x30c6b2['id']||0x0;this[_0xca62('0x0')]=_0x30c6b2['name']||'';this[_0xca62('0x1')]=_0x30c6b2[_0xca62('0x1')]||'';this[_0xca62('0x2')]=_0x30c6b2[_0xca62('0x2')]||'';this[_0xca62('0x3')]=_0x30c6b2['authType']||'';this[_0xca62('0x4')]=_0x30c6b2[_0xca62('0x4')]||'';this[_0xca62('0x5')]=_0x30c6b2[_0xca62('0x5')]||'';this[_0xca62('0x6')]=_0x30c6b2[_0xca62('0x6')]||'';this[_0xca62('0x7')]=_0x30c6b2['token']||'';this[_0xca62('0x8')]=_0x30c6b2[_0xca62('0x8')]||'';this['type']=_0x30c6b2[_0xca62('0x9')]||'';this[_0xca62('0xa')]=_0x30c6b2[_0xca62('0xa')]||'';this[_0xca62('0xb')]=_0x30c6b2['Configurations']||{};}module[_0xca62('0xc')]=DeskAccount;
\ No newline at end of file
index 364eb79..c8e689b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc922=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xc922,0x199));var _0x2c92=function(_0x4bd104,_0x1f3496){_0x4bd104=_0x4bd104-0x0;var _0xf88d2e=_0xc922[_0x4bd104];return _0xf88d2e;};'use strict';function Dynamics365Account(_0x5e780b){this['id']=_0x5e780b['id']||0x0;this[_0x2c92('0x0')]=_0x5e780b[_0x2c92('0x0')]||'';this[_0x2c92('0x1')]=_0x5e780b[_0x2c92('0x1')]||'';this[_0x2c92('0x2')]=_0x5e780b[_0x2c92('0x2')]||'';this[_0x2c92('0x3')]=_0x5e780b[_0x2c92('0x3')]||'';this[_0x2c92('0x4')]=_0x5e780b[_0x2c92('0x4')]||'';this[_0x2c92('0x5')]=_0x5e780b['clientId']||'';this['clientSecret']=_0x5e780b[_0x2c92('0x6')]||{};this['serverUrl']=_0x5e780b[_0x2c92('0x7')]||'';this[_0x2c92('0x8')]=_0x5e780b[_0x2c92('0x8')]||![];this[_0x2c92('0x9')]=_0x5e780b[_0x2c92('0x9')]||{};this[_0x2c92('0xa')]=_0x5e780b[_0x2c92('0xa')]||{};}module[_0x2c92('0xb')]=Dynamics365Account;
\ No newline at end of file
+var _0xd147=['serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x1e307c,_0x38cca8){var _0x44600c=function(_0x143951){while(--_0x143951){_0x1e307c['push'](_0x1e307c['shift']());}};_0x44600c(++_0x38cca8);}(_0xd147,0x1cd));var _0x7d14=function(_0x30751e,_0xd5b76a){_0x30751e=_0x30751e-0x0;var _0x4e685f=_0xd147[_0x30751e];return _0x4e685f;};'use strict';function Dynamics365Account(_0x1042cb){this['id']=_0x1042cb['id']||0x0;this[_0x7d14('0x0')]=_0x1042cb[_0x7d14('0x0')]||'';this[_0x7d14('0x1')]=_0x1042cb[_0x7d14('0x1')]||'';this[_0x7d14('0x2')]=_0x1042cb[_0x7d14('0x2')]||'';this[_0x7d14('0x3')]=_0x1042cb['remoteUri']||'';this[_0x7d14('0x4')]=_0x1042cb[_0x7d14('0x4')]||'';this[_0x7d14('0x5')]=_0x1042cb[_0x7d14('0x5')]||'';this[_0x7d14('0x6')]=_0x1042cb['clientSecret']||{};this[_0x7d14('0x7')]=_0x1042cb[_0x7d14('0x7')]||'';this[_0x7d14('0x8')]=_0x1042cb[_0x7d14('0x8')]||![];this[_0x7d14('0x9')]=_0x1042cb['Configurations']||{};this[_0x7d14('0xa')]=_0x1042cb['CloudProvider']||{};}module[_0x7d14('0xb')]=Dynamics365Account;
\ No newline at end of file
index 8000b5b..8950fad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03fb=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x1e4f65,_0x10f500){var _0x1b87ca=function(_0x491324){while(--_0x491324){_0x1e4f65['push'](_0x1e4f65['shift']());}};_0x1b87ca(++_0x10f500);}(_0x03fb,0x1db));var _0xb03f=function(_0x3502e,_0x264b8b){_0x3502e=_0x3502e-0x0;var _0x300758=_0x03fb[_0x3502e];return _0x300758;};'use strict';function FaxAccount(_0xe8d04){this['id']=_0xe8d04['id']||0x0;this['name']=_0xe8d04[_0xb03f('0x0')]||'';this[_0xb03f('0x1')]=_0xe8d04[_0xb03f('0x1')];this['ecm']=_0xe8d04[_0xb03f('0x2')];this[_0xb03f('0x3')]=_0xe8d04['headerinfo'];this[_0xb03f('0x4')]=_0xe8d04[_0xb03f('0x4')];this[_0xb03f('0x5')]=_0xe8d04[_0xb03f('0x5')]||0x960;this[_0xb03f('0x6')]=_0xe8d04[_0xb03f('0x6')]||0x3840;this[_0xb03f('0x7')]=_0xe8d04[_0xb03f('0x7')]||_0xb03f('0x8');this[_0xb03f('0x9')]=_0xe8d04[_0xb03f('0x9')]||'no';this['faxdetect']=_0xe8d04[_0xb03f('0xa')]||'no';this[_0xb03f('0xb')]=_0xe8d04[_0xb03f('0xb')]||0x1388;this['tech']=_0xe8d04[_0xb03f('0xc')]||_0xb03f('0xd');this[_0xb03f('0xe')]=_0xe8d04[_0xb03f('0xe')]?_0xe8d04[_0xb03f('0xe')]:undefined;this[_0xb03f('0xf')]=_0xe8d04[_0xb03f('0xf')];this[_0xb03f('0x10')]=_0xe8d04['key'];}module[_0xb03f('0x11')]=FaxAccount;
\ No newline at end of file
+var _0x1a9d=['key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x2dfdc1,_0x45662b){var _0x3ff13b=function(_0x2f4552){while(--_0x2f4552){_0x2dfdc1['push'](_0x2dfdc1['shift']());}};_0x3ff13b(++_0x45662b);}(_0x1a9d,0xfe));var _0xd1a9=function(_0x44fe17,_0x4ffc46){_0x44fe17=_0x44fe17-0x0;var _0x4b71e7=_0x1a9d[_0x44fe17];return _0x4b71e7;};'use strict';function FaxAccount(_0xa070c0){this['id']=_0xa070c0['id']||0x0;this[_0xd1a9('0x0')]=_0xa070c0[_0xd1a9('0x0')]||'';this[_0xd1a9('0x1')]=_0xa070c0[_0xd1a9('0x1')];this[_0xd1a9('0x2')]=_0xa070c0[_0xd1a9('0x2')];this[_0xd1a9('0x3')]=_0xa070c0[_0xd1a9('0x3')];this[_0xd1a9('0x4')]=_0xa070c0[_0xd1a9('0x4')];this[_0xd1a9('0x5')]=_0xa070c0[_0xd1a9('0x5')]||0x960;this['maxrate']=_0xa070c0[_0xd1a9('0x6')]||0x3840;this[_0xd1a9('0x7')]=_0xa070c0[_0xd1a9('0x7')]||_0xd1a9('0x8');this[_0xd1a9('0x9')]=_0xa070c0[_0xd1a9('0x9')]||'no';this[_0xd1a9('0xa')]=_0xa070c0['faxdetect']||'no';this[_0xd1a9('0xb')]=_0xa070c0[_0xd1a9('0xb')]||0x1388;this[_0xd1a9('0xc')]=_0xa070c0[_0xd1a9('0xc')]||_0xd1a9('0xd');this['Trunk']=_0xa070c0[_0xd1a9('0xe')]?_0xa070c0[_0xd1a9('0xe')]:undefined;this[_0xd1a9('0xf')]=_0xa070c0[_0xd1a9('0xf')];this[_0xd1a9('0x10')]=_0xa070c0[_0xd1a9('0x10')];}module[_0xd1a9('0x11')]=FaxAccount;
\ No newline at end of file
index c8f1145..46a0600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac9=['serverUrl','Configurations','exports','name','username','token','remoteUri'];(function(_0x52badd,_0x1a9785){var _0x384748=function(_0x4d5371){while(--_0x4d5371){_0x52badd['push'](_0x52badd['shift']());}};_0x384748(++_0x1a9785);}(_0x9ac9,0x96));var _0x99ac=function(_0x47b5cb,_0x45686a){_0x47b5cb=_0x47b5cb-0x0;var _0x51d8c7=_0x9ac9[_0x47b5cb];return _0x51d8c7;};'use strict';function FreshdeskAccount(_0x367952){this['id']=_0x367952['id']||0x0;this[_0x99ac('0x0')]=_0x367952[_0x99ac('0x0')]||'';this[_0x99ac('0x1')]=_0x367952[_0x99ac('0x1')]||'';this['apiKey']=_0x367952[_0x99ac('0x2')]||'';this['remoteUri']=_0x367952[_0x99ac('0x3')]||'';this[_0x99ac('0x4')]=_0x367952[_0x99ac('0x4')]||'';this['Configurations']=_0x367952[_0x99ac('0x5')]||{};}module[_0x99ac('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0xd223=['Configurations','exports','name','apiKey','remoteUri','serverUrl'];(function(_0x1e2bc5,_0x170c50){var _0x430325=function(_0x117f81){while(--_0x117f81){_0x1e2bc5['push'](_0x1e2bc5['shift']());}};_0x430325(++_0x170c50);}(_0xd223,0xec));var _0x3d22=function(_0x237dec,_0x26136f){_0x237dec=_0x237dec-0x0;var _0xabd0dc=_0xd223[_0x237dec];return _0xabd0dc;};'use strict';function FreshdeskAccount(_0x9301a1){this['id']=_0x9301a1['id']||0x0;this[_0x3d22('0x0')]=_0x9301a1['name']||'';this['username']=_0x9301a1['username']||'';this[_0x3d22('0x1')]=_0x9301a1['token']||'';this[_0x3d22('0x2')]=_0x9301a1[_0x3d22('0x2')]||'';this[_0x3d22('0x3')]=_0x9301a1[_0x3d22('0x3')]||'';this[_0x3d22('0x4')]=_0x9301a1[_0x3d22('0x4')]||{};}module[_0x3d22('0x5')]=FreshdeskAccount;
\ No newline at end of file
index 4d87fc2..a5af4e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eb2=['Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x4342e6,_0x373dfb){var _0x2b3b55=function(_0x139339){while(--_0x139339){_0x4342e6['push'](_0x4342e6['shift']());}};_0x2b3b55(++_0x373dfb);}(_0x2eb2,0x19f));var _0x22eb=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x2eb2[_0x550d12];return _0x12103d;};'use strict';function FreshsalesAccount(_0x12836c){this['id']=_0x12836c['id']||0x0;this[_0x22eb('0x0')]=_0x12836c[_0x22eb('0x0')]||'';this[_0x22eb('0x1')]=_0x12836c[_0x22eb('0x1')]||'';this[_0x22eb('0x2')]=_0x12836c[_0x22eb('0x3')]||'';this['remoteUri']=_0x12836c[_0x22eb('0x4')]||'';this['serverUrl']=_0x12836c['serverUrl']||'';this[_0x22eb('0x5')]=_0x12836c[_0x22eb('0x5')]||{};}module[_0x22eb('0x6')]=FreshsalesAccount;
\ No newline at end of file
+var _0xb46f=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5067db,_0xf8d2f2){var _0x2771e4=function(_0x3d5cb2){while(--_0x3d5cb2){_0x5067db['push'](_0x5067db['shift']());}};_0x2771e4(++_0xf8d2f2);}(_0xb46f,0xb6));var _0xfb46=function(_0x5e1123,_0x2f6305){_0x5e1123=_0x5e1123-0x0;var _0x3f4916=_0xb46f[_0x5e1123];return _0x3f4916;};'use strict';function FreshsalesAccount(_0xe9857b){this['id']=_0xe9857b['id']||0x0;this[_0xfb46('0x0')]=_0xe9857b['name']||'';this[_0xfb46('0x1')]=_0xe9857b[_0xfb46('0x1')]||'';this[_0xfb46('0x2')]=_0xe9857b[_0xfb46('0x3')]||'';this[_0xfb46('0x4')]=_0xe9857b['remoteUri']||'';this[_0xfb46('0x5')]=_0xe9857b['serverUrl']||'';this[_0xfb46('0x6')]=_0xe9857b[_0xfb46('0x6')]||{};}module[_0xfb46('0x7')]=FreshsalesAccount;
\ No newline at end of file
index 07e712b..d6906a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84aa=['holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode'];(function(_0xa11c60,_0x247918){var _0xe31807=function(_0x244dac){while(--_0x244dac){_0xa11c60['push'](_0xa11c60['shift']());}};_0xe31807(++_0x247918);}(_0x84aa,0x1ee));var _0xa84a=function(_0x145802,_0x450a88){_0x145802=_0x145802-0x0;var _0x10b6bc=_0x84aa[_0x145802];return _0x10b6bc;};'use strict';function QueueReport(){this['type']=_0xa84a('0x0');this[_0xa84a('0x1')]='';this[_0xa84a('0x2')]='';this[_0xa84a('0x3')]='';this[_0xa84a('0x4')]='';this[_0xa84a('0x5')]=null;this[_0xa84a('0x6')]=null;this[_0xa84a('0x7')]=0x1;this[_0xa84a('0x8')]=0x1;this[_0xa84a('0x9')]=![];this[_0xa84a('0xa')]=null;this['queuecallercomplete']=![];this[_0xa84a('0xb')]=null;this[_0xa84a('0xc')]=![];this[_0xa84a('0xd')]=null;this[_0xa84a('0xe')]=0x1;this[_0xa84a('0xf')]='';this[_0xa84a('0x10')]='';this[_0xa84a('0x11')]='';this[_0xa84a('0x12')]='';this['context']='';this['exten']='';this['priority']='';this[_0xa84a('0x13')]=0x0;this[_0xa84a('0x14')]=![];this[_0xa84a('0x15')]='';this[_0xa84a('0x16')]=_0xa84a('0x17');this[_0xa84a('0x18')]=0x0;this[_0xa84a('0x19')]={};}module[_0xa84a('0x1a')]=QueueReport;
\ No newline at end of file
+var _0x860f=['voice','mohtime','variables','exports','type','inbound','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','holdtime','assigned','motionChannel'];(function(_0x2c4e32,_0x3a5590){var _0x1eac30=function(_0x236c8e){while(--_0x236c8e){_0x2c4e32['push'](_0x2c4e32['shift']());}};_0x1eac30(++_0x3a5590);}(_0x860f,0x144));var _0xf860=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x860f[_0x1ae5ab];return _0x1ce001;};'use strict';function QueueReport(){this[_0xf860('0x0')]=_0xf860('0x1');this[_0xf860('0x2')]='';this['calleridnum']='';this['calleridname']='';this[_0xf860('0x3')]='';this[_0xf860('0x4')]=null;this[_0xf860('0x5')]=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xf860('0x6')]=null;this[_0xf860('0x7')]=![];this[_0xf860('0x8')]=null;this[_0xf860('0x9')]=![];this[_0xf860('0xa')]=null;this['originalposition']=0x1;this['channel']='';this[_0xf860('0xb')]='';this[_0xf860('0xc')]='';this['accountcode']='';this['context']='';this['exten']='';this['priority']='';this[_0xf860('0xd')]=0x0;this[_0xf860('0xe')]=![];this['lastAssignedTo']='';this[_0xf860('0xf')]=_0xf860('0x10');this[_0xf860('0x11')]=0x0;this[_0xf860('0x12')]={};}module[_0xf860('0x13')]=QueueReport;
\ No newline at end of file
index 6fc804f..253d057 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22a8=['name','username','remoteUri','password','clientId','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x317946,_0x203a1a){var _0x584b0d=function(_0x1f5661){while(--_0x1f5661){_0x317946['push'](_0x317946['shift']());}};_0x584b0d(++_0x203a1a);}(_0x22a8,0x6e));var _0x822a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x22a8[_0x2c91e9];return _0x13f0ff;};'use strict';function SalesforceAccount(_0x160bea){this['id']=_0x160bea['id']||0x0;this[_0x822a('0x0')]=_0x160bea[_0x822a('0x0')]||'';this[_0x822a('0x1')]=_0x160bea[_0x822a('0x1')]||'';this[_0x822a('0x2')]=_0x160bea[_0x822a('0x2')]||'';this['password']=_0x160bea[_0x822a('0x3')]||'';this[_0x822a('0x4')]=_0x160bea[_0x822a('0x4')]||'';this['clientSecret']=_0x160bea['clientSecret']||'';this[_0x822a('0x5')]=_0x160bea[_0x822a('0x5')]||'';this[_0x822a('0x6')]=_0x160bea[_0x822a('0x6')]||_0x822a('0x7');this[_0x822a('0x8')]=_0x160bea[_0x822a('0x8')]||'';this[_0x822a('0x9')]=_0x160bea[_0x822a('0x9')]||{};}module[_0x822a('0xa')]=SalesforceAccount;
\ No newline at end of file
+var _0xd48e=['password','clientId','clientSecret','securityToken','type','Configurations','exports','name','username','remoteUri'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0xd48e,0x93));var _0xed48=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xd48e[_0x4a7631];return _0x1a5a6f;};'use strict';function SalesforceAccount(_0x260d9b){this['id']=_0x260d9b['id']||0x0;this[_0xed48('0x0')]=_0x260d9b[_0xed48('0x0')]||'';this[_0xed48('0x1')]=_0x260d9b[_0xed48('0x1')]||'';this[_0xed48('0x2')]=_0x260d9b['remoteUri']||'';this[_0xed48('0x3')]=_0x260d9b[_0xed48('0x3')]||'';this[_0xed48('0x4')]=_0x260d9b['clientId']||'';this[_0xed48('0x5')]=_0x260d9b[_0xed48('0x5')]||'';this[_0xed48('0x6')]=_0x260d9b['securityToken']||'';this[_0xed48('0x7')]=_0x260d9b[_0xed48('0x7')]||'integrationTab';this['serverUrl']=_0x260d9b['serverUrl']||'';this[_0xed48('0x8')]=_0x260d9b[_0xed48('0x8')]||{};}module[_0xed48('0x9')]=SalesforceAccount;
\ No newline at end of file
index dc1662d..d414258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a00=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x21cfc1,_0x4e3172){var _0x5c24b2=function(_0x3b1f16){while(--_0x3b1f16){_0x21cfc1['push'](_0x21cfc1['shift']());}};_0x5c24b2(++_0x4e3172);}(_0x0a00,0x177));var _0x00a0=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x0a00[_0x334841];return _0x5beb4b;};'use strict';function ServicenowAccount(_0x1825de){this['id']=_0x1825de['id']||0x0;this[_0x00a0('0x0')]=_0x1825de[_0x00a0('0x0')]||'';this[_0x00a0('0x1')]=_0x1825de[_0x00a0('0x1')]||'';this[_0x00a0('0x2')]=_0x1825de[_0x00a0('0x2')]||'';this[_0x00a0('0x3')]=_0x1825de[_0x00a0('0x3')]||'';this[_0x00a0('0x4')]=_0x1825de[_0x00a0('0x4')]||'';this['Configurations']=_0x1825de[_0x00a0('0x5')]||{};}module[_0x00a0('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0xabd8=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xc2522c,_0x464fcf){var _0x5684bb=function(_0xc872ab){while(--_0xc872ab){_0xc2522c['push'](_0xc2522c['shift']());}};_0x5684bb(++_0x464fcf);}(_0xabd8,0x124));var _0x8abd=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0xabd8[_0x22e47a];return _0x15a12a;};'use strict';function ServicenowAccount(_0x1998dd){this['id']=_0x1998dd['id']||0x0;this['name']=_0x1998dd[_0x8abd('0x0')]||'';this['username']=_0x1998dd[_0x8abd('0x1')]||'';this[_0x8abd('0x2')]=_0x1998dd[_0x8abd('0x2')]||'';this['remoteUri']=_0x1998dd[_0x8abd('0x3')]||'';this[_0x8abd('0x4')]=_0x1998dd['serverUrl']||'';this[_0x8abd('0x5')]=_0x1998dd[_0x8abd('0x5')]||{};}module[_0x8abd('0x6')]=ServicenowAccount;
\ No newline at end of file
index 4d36473..4f3b0f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe958=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x3d73ba,_0x356e23){var _0x47e406=function(_0x90df31){while(--_0x90df31){_0x3d73ba['push'](_0x3d73ba['shift']());}};_0x47e406(++_0x356e23);}(_0xe958,0x161));var _0x8e95=function(_0x51b2e5,_0x12eccf){_0x51b2e5=_0x51b2e5-0x0;var _0x233514=_0xe958[_0x51b2e5];return _0x233514;};'use strict';function SugarcrmAccount(_0x4afe83){this['id']=_0x4afe83['id']||0x0;this[_0x8e95('0x0')]=_0x4afe83[_0x8e95('0x0')]||'';this[_0x8e95('0x1')]=_0x4afe83[_0x8e95('0x1')]||'';this[_0x8e95('0x2')]=_0x4afe83[_0x8e95('0x2')]||'';this[_0x8e95('0x3')]=_0x4afe83[_0x8e95('0x3')]||'';this[_0x8e95('0x4')]=_0x4afe83['serverUrl']||'';this[_0x8e95('0x5')]=_0x4afe83[_0x8e95('0x5')]||{};}module[_0x8e95('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0x4ccf=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x1e6b44,_0x2d1dde){var _0x39bf3a=function(_0x46274c){while(--_0x46274c){_0x1e6b44['push'](_0x1e6b44['shift']());}};_0x39bf3a(++_0x2d1dde);}(_0x4ccf,0x170));var _0xf4cc=function(_0x563bf0,_0x265f5f){_0x563bf0=_0x563bf0-0x0;var _0x4b1ede=_0x4ccf[_0x563bf0];return _0x4b1ede;};'use strict';function SugarcrmAccount(_0x5239e3){this['id']=_0x5239e3['id']||0x0;this[_0xf4cc('0x0')]=_0x5239e3[_0xf4cc('0x0')]||'';this[_0xf4cc('0x1')]=_0x5239e3[_0xf4cc('0x1')]||'';this['password']=_0x5239e3[_0xf4cc('0x2')]||'';this['remoteUri']=_0x5239e3[_0xf4cc('0x3')]||'';this[_0xf4cc('0x4')]=_0x5239e3[_0xf4cc('0x4')]||'';this[_0xf4cc('0x5')]=_0x5239e3[_0xf4cc('0x5')]||{};}module[_0xf4cc('0x6')]=SugarcrmAccount;
\ No newline at end of file
index 1f3bbce..93bda1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d13=['stateTime','status','exports','name','accountcode','state','unknown'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7d13,0x6c));var _0x37d1=function(_0x4ccde3,_0x38ca57){_0x4ccde3=_0x4ccde3-0x0;var _0x3348ac=_0x7d13[_0x4ccde3];return _0x3348ac;};'use strict';function Telephone(_0x155f88){this['id']=_0x155f88['id']||0x0;this[_0x37d1('0x0')]=_0x155f88['name']||'';this[_0x37d1('0x1')]=_0x155f88['accountcode']||'';this[_0x37d1('0x2')]=_0x37d1('0x3');this[_0x37d1('0x4')]=0x0;this[_0x37d1('0x5')]=_0x37d1('0x3');this['address']='';}module[_0x37d1('0x6')]=Telephone;
\ No newline at end of file
+var _0xf9fd=['accountcode','stateTime','status','unknown','address','exports','name'];(function(_0x49cff4,_0x567173){var _0x173b56=function(_0x2a83f5){while(--_0x2a83f5){_0x49cff4['push'](_0x49cff4['shift']());}};_0x173b56(++_0x567173);}(_0xf9fd,0x14f));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';function Telephone(_0x555fda){this['id']=_0x555fda['id']||0x0;this[_0xdf9f('0x0')]=_0x555fda[_0xdf9f('0x0')]||'';this[_0xdf9f('0x1')]=_0x555fda[_0xdf9f('0x1')]||'';this['state']='unknown';this[_0xdf9f('0x2')]=0x0;this[_0xdf9f('0x3')]=_0xdf9f('0x4');this[_0xdf9f('0x5')]='';}module[_0xdf9f('0x6')]=Telephone;
\ No newline at end of file
index 7e61f7e..28d74b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x3f791a,_0x2baa1a){var _0x760b36=function(_0x2325a1){while(--_0x2325a1){_0x3f791a['push'](_0x3f791a['shift']());}};_0x760b36(++_0x2baa1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 _0xb10b=['name','html'];(function(_0x351879,_0x5919ec){var _0x3c55f2=function(_0x443656){while(--_0x443656){_0x351879['push'](_0x351879['shift']());}};_0x3c55f2(++_0x5919ec);}(_0xb10b,0x12a));var _0xbb10=function(_0x4ff3d1,_0x15c737){_0x4ff3d1=_0x4ff3d1-0x0;var _0x32af0c=_0xb10b[_0x4ff3d1];return _0x32af0c;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template;
\ No newline at end of file
index 5238e5c..c8df52d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0x845304,_0x154c0f){var _0x51c06d=function(_0x36a285){while(--_0x36a285){_0x845304['push'](_0x845304['shift']());}};_0x51c06d(++_0x154c0f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xb7e7[_0x1beef3];return _0x5af964;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('0x6')]=Trigger;
\ No newline at end of file
+var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x75b7c3,_0x40eb5b){var _0x1e7a62=function(_0x52f3db){while(--_0x52f3db){_0x75b7c3['push'](_0x75b7c3['shift']());}};_0x1e7a62(++_0x40eb5b);}(_0x2032,0xd9));var _0x2203=function(_0x5b7e0e,_0x1af331){_0x5b7e0e=_0x5b7e0e-0x0;var _0x37b96c=_0x2032[_0x5b7e0e];return _0x37b96c;};'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 1cdfd88..964f5d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5ea=['split','host','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','stateTime','status','registry','indexOf'];(function(_0x14b96f,_0x36e15a){var _0x4f1afa=function(_0x82d470){while(--_0x82d470){_0x14b96f['push'](_0x14b96f['shift']());}};_0x4f1afa(++_0x36e15a);}(_0xe5ea,0x180));var _0xae5e=function(_0x3f7bc5,_0x3b8feb){_0x3f7bc5=_0x3f7bc5-0x0;var _0x59db65=_0xe5ea[_0x3f7bc5];return _0x59db65;};'use strict';function Trunk(_0x4b3775){this['id']=_0x4b3775['id']||0x0;this[_0xae5e('0x0')]=_0x4b3775[_0xae5e('0x0')]||![];this[_0xae5e('0x1')]=_0x4b3775[_0xae5e('0x1')]||'';this['state']='unknown';this[_0xae5e('0x2')]=0x0;this[_0xae5e('0x3')]='unknown';this[_0xae5e('0x4')]=_0x4b3775[_0xae5e('0x4')]&&_0x4b3775[_0xae5e('0x4')][_0xae5e('0x5')](':')?_0x4b3775[_0xae5e('0x4')][_0xae5e('0x6')](':')[0x0]:'';this[_0xae5e('0x7')]='';this['port']='';this['domain']='';this[_0xae5e('0x8')]='';this[_0xae5e('0x9')]='';this[_0xae5e('0xa')]='unknown';this[_0xae5e('0xb')]='';this[_0xae5e('0xc')]='';this['defaultuser']=_0x4b3775[_0xae5e('0xd')]||'';}module[_0xae5e('0xe')]=Trunk;
\ No newline at end of file
+var _0x28b4=['stateTime','status','registry','split','host','port','domain','domainport','refresh','registrationtime','address','defaultuser','exports','active','name','state','unknown'];(function(_0x3a0f7b,_0x31796d){var _0x367609=function(_0x1d6baa){while(--_0x1d6baa){_0x3a0f7b['push'](_0x3a0f7b['shift']());}};_0x367609(++_0x31796d);}(_0x28b4,0x12e));var _0x428b=function(_0x39b583,_0x56c6fb){_0x39b583=_0x39b583-0x0;var _0x10a746=_0x28b4[_0x39b583];return _0x10a746;};'use strict';function Trunk(_0xe81663){this['id']=_0xe81663['id']||0x0;this[_0x428b('0x0')]=_0xe81663[_0x428b('0x0')]||![];this[_0x428b('0x1')]=_0xe81663[_0x428b('0x1')]||'';this[_0x428b('0x2')]=_0x428b('0x3');this[_0x428b('0x4')]=0x0;this[_0x428b('0x5')]='unknown';this[_0x428b('0x6')]=_0xe81663[_0x428b('0x6')]&&_0xe81663[_0x428b('0x6')]['indexOf'](':')?_0xe81663[_0x428b('0x6')][_0x428b('0x7')](':')[0x0]:'';this[_0x428b('0x8')]='';this[_0x428b('0x9')]='';this[_0x428b('0xa')]='';this[_0x428b('0xb')]='';this[_0x428b('0xc')]='';this['stateRegistry']='unknown';this[_0x428b('0xd')]='';this[_0x428b('0xe')]='';this['defaultuser']=_0xe81663[_0x428b('0xf')]||'';}module[_0x428b('0x10')]=Trunk;
\ No newline at end of file
index d241b80..e1863c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58a0=['recordingFormat','mandatoryDisposition','exten'];(function(_0x176e9e,_0x3dfe11){var _0x1b675f=function(_0x508167){while(--_0x508167){_0x176e9e['push'](_0x176e9e['shift']());}};_0x1b675f(++_0x3dfe11);}(_0x58a0,0x9e));var _0x058a=function(_0x43794c,_0x4b4158){_0x43794c=_0x43794c-0x0;var _0xa31045=_0x58a0[_0x43794c];return _0xa31045;};'use strict';function voiceExtension(_0x1294e1){this['id']=_0x1294e1['id']||0x0;this['exten']=_0x1294e1[_0x058a('0x0')]||'';this[_0x058a('0x1')]=_0x1294e1['recordingFormat']||'none';this[_0x058a('0x2')]=_0x1294e1['mandatoryDisposition']||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0x49f0=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x3a3e9f,_0x229a93){var _0x10c965=function(_0x175419){while(--_0x175419){_0x3a3e9f['push'](_0x3a3e9f['shift']());}};_0x10c965(++_0x229a93);}(_0x49f0,0x1d5));var _0x049f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x49f0[_0x19950b];return _0x3c6b41;};'use strict';function voiceExtension(_0x271ac8){this['id']=_0x271ac8['id']||0x0;this[_0x049f('0x0')]=_0x271ac8[_0x049f('0x0')]||'';this[_0x049f('0x1')]=_0x271ac8[_0x049f('0x1')]||_0x049f('0x2');this[_0x049f('0x3')]=_0x271ac8[_0x049f('0x3')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
index de22517..2afc330 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa557=['not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','gsm','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xa557,0x174));var _0x7a55=function(_0x3994eb,_0x17c5d1){_0x3994eb=_0x3994eb-0x0;var _0x4effec=_0xa557[_0x3994eb];return _0x4effec;};'use strict';var statusDesc=['unknown',_0x7a55('0x0'),_0x7a55('0x1'),_0x7a55('0x2'),_0x7a55('0x3'),_0x7a55('0x4'),_0x7a55('0x5'),_0x7a55('0x6'),_0x7a55('0x7')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0x7a55('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x7a55('0x9')};function VoiceQueue(_0x2fe369){this['id']=_0x2fe369['id']||0x0;this[_0x7a55('0xa')]=_0x2fe369[_0x7a55('0xa')]||'';this[_0x7a55('0xb')]=_0x2fe369[_0x7a55('0xb')]||'';this[_0x7a55('0xc')]=_0x2fe369[_0x7a55('0xc')]||_0x7a55('0xd');this[_0x7a55('0xe')]=0x0;this['talking']=0x0;this[_0x7a55('0xf')]=0x0;this[_0x7a55('0x10')]=0x0;this[_0x7a55('0x11')]=0x0;this[_0x7a55('0x12')]=0x0;this[_0x7a55('0x13')]=0x0;this[_0x7a55('0x14')]=0x0;this[_0x7a55('0x15')]=0x0;this[_0x7a55('0x16')]=0x0;this[_0x7a55('0x17')]=0x0;this[_0x7a55('0x18')]=_0x2fe369[_0x7a55('0x18')]||![];this[_0x7a55('0x19')]=_0x2fe369[_0x7a55('0x19')]||0xa;this[_0x7a55('0x1a')]=_0x2fe369[_0x7a55('0x1a')]||'no';this[_0x7a55('0x1b')]=!![];this['message']='';this[_0x7a55('0x1c')]=0x0;this[_0x7a55('0x1d')]=0x0;this[_0x7a55('0x1e')]=_0x2fe369[_0x7a55('0x1e')]||null;this[_0x7a55('0x1f')]=_0x2fe369[_0x7a55('0x1f')]?_0x2fe369[_0x7a55('0x1f')]:null;this[_0x7a55('0x20')]=_0x2fe369[_0x7a55('0x20')];this['dialMethod']=_0x2fe369[_0x7a55('0x21')]||'progressive';this[_0x7a55('0x22')]=_0x2fe369[_0x7a55('0x22')]||0x0;this[_0x7a55('0x23')]=_0x2fe369[_0x7a55('0x23')]||0x0;this['dialPowerLevel']=_0x2fe369[_0x7a55('0x24')]||0x1;this[_0x7a55('0x25')]=_0x2fe369['dialPredictiveOptimization']||_0x7a55('0x26');this[_0x7a55('0x27')]=_0x2fe369[_0x7a55('0x27')]||0.03;this[_0x7a55('0x28')]=_0x2fe369[_0x7a55('0x28')]||0x258;this[_0x7a55('0x29')]=_0x2fe369['dialOriginateCallerIdName']||_0x7a55('0x2a');this[_0x7a55('0x2b')]=_0x2fe369['dialOriginateCallerIdNumber']||_0x7a55('0x2a');this[_0x7a55('0x2c')]=_0x2fe369[_0x7a55('0x2c')]||0x1e;this[_0x7a55('0x2d')]=_0x2fe369[_0x7a55('0x2d')]||'tTxX';this[_0x7a55('0x2e')]=_0x2fe369[_0x7a55('0x2e')]||0x3;this[_0x7a55('0x2f')]=_0x2fe369['dialQueueProject']||undefined;this[_0x7a55('0x30')]=_0x2fe369[_0x7a55('0x30')]||0x3;this['dialCongestionRetryFrequency']=_0x2fe369[_0x7a55('0x31')]||0x96;this['dialBusyMaxRetry']=_0x2fe369[_0x7a55('0x32')]||0x3;this[_0x7a55('0x33')]=_0x2fe369['dialBusyRetryFrequency']||0x96;this[_0x7a55('0x34')]=_0x2fe369[_0x7a55('0x34')]||0x3;this[_0x7a55('0x35')]=_0x2fe369['dialNoAnswerRetryFrequency']||0x96;this[_0x7a55('0x36')]=_0x2fe369['dialNoSuchNumberMaxRetry']||0x3;this[_0x7a55('0x37')]=_0x2fe369[_0x7a55('0x37')]||0x96;this['dialDropMaxRetry']=_0x2fe369['dialDropMaxRetry']||0x3;this[_0x7a55('0x38')]=_0x2fe369[_0x7a55('0x38')]||0x96;this[_0x7a55('0x39')]=_0x2fe369['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x2fe369['dialAbandonedRetryFrequency']||0x96;this[_0x7a55('0x3a')]=_0x2fe369['dialMachineMaxRetry']||0x3;this[_0x7a55('0x3b')]=_0x2fe369['dialMachineRetryFrequency']||0x96;this[_0x7a55('0x3c')]=_0x2fe369['dialAgentRejectMaxRetry']||0x3;this[_0x7a55('0x3d')]=_0x2fe369[_0x7a55('0x3d')]||0x96;this['dialGlobalMaxRetry']=_0x2fe369[_0x7a55('0x3e')]||0x4;this['Trunk']=_0x2fe369[_0x7a55('0x3f')]?_0x2fe369['Trunk']:undefined;this['TrunkBackup']=_0x2fe369['TrunkBackup']?_0x2fe369[_0x7a55('0x40')]:undefined;this[_0x7a55('0x41')]=_0x2fe369[_0x7a55('0x41')]||undefined;this[_0x7a55('0x42')]=_0x2fe369[_0x7a55('0x42')]?_0x2fe369[_0x7a55('0x42')]:undefined;this[_0x7a55('0x43')]=_0x2fe369['dialOrderByScheduledAt']||_0x7a55('0x44');this['dialRandomLastDigitCallerIdNumber']=_0x2fe369['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x7a55('0x45')]=_0x2fe369['dialCutDigit']||undefined;this['strategy']=strategy[_0x2fe369[_0x7a55('0x46')]]||_0x7a55('0x47');this[_0x7a55('0x48')]=!![];this['dialAMDActive']=_0x2fe369[_0x7a55('0x49')]||![];this[_0x7a55('0x4a')]=_0x2fe369[_0x7a55('0x4a')];this[_0x7a55('0x4b')]=_0x2fe369[_0x7a55('0x4b')];this[_0x7a55('0x4c')]=_0x2fe369[_0x7a55('0x4c')];this[_0x7a55('0x4d')]=_0x2fe369[_0x7a55('0x4d')];this[_0x7a55('0x4e')]=_0x2fe369[_0x7a55('0x4e')];this[_0x7a55('0x4f')]=_0x2fe369[_0x7a55('0x4f')];this[_0x7a55('0x50')]=_0x2fe369[_0x7a55('0x50')];this[_0x7a55('0x51')]=_0x2fe369[_0x7a55('0x51')];this[_0x7a55('0x52')]=_0x2fe369[_0x7a55('0x52')];this[_0x7a55('0x53')]=0x0;this[_0x7a55('0x54')]=0x0;this['timeout']=_0x2fe369[_0x7a55('0x55')];this[_0x7a55('0x56')]=0x0;this[_0x7a55('0x57')]=0x0;this[_0x7a55('0x58')]=0x0;this[_0x7a55('0x59')]=0x0;this[_0x7a55('0x5a')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x7a55('0x5b')]=0x0;this[_0x7a55('0x5c')]=0x0;this[_0x7a55('0x5d')]=0x0;this[_0x7a55('0x5e')]=0x0;this[_0x7a55('0x5f')]=0x0;this[_0x7a55('0x60')]=0x0;this[_0x7a55('0x61')]=undefined;this['startPredictive']=undefined;this[_0x7a55('0x62')]=undefined;this[_0x7a55('0x63')]=1.05;this[_0x7a55('0x64')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x7a55('0x65')]=0x0;this[_0x7a55('0x66')]=0x0;this[_0x7a55('0x67')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x7a55('0x68')]=0x0;this[_0x7a55('0x69')]=0x0;this[_0x7a55('0x6a')]=_0x2fe369[_0x7a55('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x2fe369['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x7a55('0x6c')]=0x0;this[_0x7a55('0x6d')]=0x0;this[_0x7a55('0x6e')]=0x1;this[_0x7a55('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x7a55('0x70')]=0x0;this[_0x7a55('0x71')]=0x0;this[_0x7a55('0x72')]=_0x2fe369['dialRecallMeTimeout']||0x1e;this[_0x7a55('0x73')]=_0x2fe369[_0x7a55('0x73')]||![];this[_0x7a55('0x74')]=!!_0x2fe369[_0x7a55('0x74')]||![];this[_0x7a55('0x75')]=!!_0x2fe369['dialPreviewRecallmeReminder']||![];this['dialQueueProject2']=_0x2fe369[_0x7a55('0x76')]||undefined;this[_0x7a55('0x77')]=_0x2fe369[_0x7a55('0x77')]||![];this[_0x7a55('0x78')]=_0x2fe369[_0x7a55('0x78')]||![];this[_0x7a55('0xb')]=monitorFormat[_0x2fe369[_0x7a55('0xb')]]?monitorFormat[_0x2fe369[_0x7a55('0xb')]]:undefined;this[_0x7a55('0x79')]=_0x2fe369[_0x7a55('0x79')]||![];this[_0x7a55('0x7a')]=_0x2fe369['mandatoryDispositionPause']?_0x2fe369['mandatoryDispositionPause']:undefined;}module[_0x7a55('0x7b')]=VoiceQueue;
\ No newline at end of file
+var _0x5790=['dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','gsm','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency'];(function(_0x1161d6,_0x2e7c93){var _0x4706a8=function(_0x5635bb){while(--_0x5635bb){_0x1161d6['push'](_0x1161d6['shift']());}};_0x4706a8(++_0x2e7c93);}(_0x5790,0x129));var _0x0579=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5790[_0xfae23b];return _0x200640;};'use strict';var statusDesc=[_0x0579('0x0'),'not_inuse',_0x0579('0x1'),_0x0579('0x2'),'invalid',_0x0579('0x3'),_0x0579('0x4'),_0x0579('0x5'),_0x0579('0x6')];var monitorFormat={'wav':_0x0579('0x7'),'wav49':'wav49','gsm':_0x0579('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x0579('0x9')};function VoiceQueue(_0x2f3661){this['id']=_0x2f3661['id']||0x0;this[_0x0579('0xa')]=_0x2f3661[_0x0579('0xa')]||'';this[_0x0579('0xb')]=_0x2f3661[_0x0579('0xb')]||'';this[_0x0579('0xc')]=_0x2f3661['type']||_0x0579('0xd');this[_0x0579('0xe')]=0x0;this['talking']=0x0;this[_0x0579('0xf')]=0x0;this[_0x0579('0x10')]=0x0;this['sumDuration']=0x0;this[_0x0579('0x11')]=0x0;this[_0x0579('0x12')]=0x0;this[_0x0579('0x13')]=0x0;this['abandoned']=0x0;this[_0x0579('0x14')]=0x0;this[_0x0579('0x15')]=0x0;this[_0x0579('0x16')]=_0x2f3661[_0x0579('0x16')]||![];this[_0x0579('0x17')]=_0x2f3661[_0x0579('0x17')]||0xa;this['autopause']=_0x2f3661[_0x0579('0x18')]||'no';this[_0x0579('0x19')]=!![];this[_0x0579('0x1a')]='';this[_0x0579('0x1b')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x2f3661[_0x0579('0x1c')]||null;this[_0x0579('0x1d')]=_0x2f3661[_0x0579('0x1d')]?_0x2f3661[_0x0579('0x1d')]:null;this[_0x0579('0x1e')]=_0x2f3661[_0x0579('0x1e')];this[_0x0579('0x1f')]=_0x2f3661[_0x0579('0x1f')]||_0x0579('0x20');this[_0x0579('0x21')]=_0x2f3661[_0x0579('0x21')]||0x0;this[_0x0579('0x22')]=_0x2f3661[_0x0579('0x22')]||0x0;this[_0x0579('0x23')]=_0x2f3661[_0x0579('0x23')]||0x1;this['dialPredictiveOptimization']=_0x2f3661[_0x0579('0x24')]||_0x0579('0x25');this[_0x0579('0x26')]=_0x2f3661[_0x0579('0x26')]||0.03;this['dialPredictiveInterval']=_0x2f3661[_0x0579('0x27')]||0x258;this[_0x0579('0x28')]=_0x2f3661['dialOriginateCallerIdName']||_0x0579('0x29');this['dialOriginateCallerIdNumber']=_0x2f3661[_0x0579('0x2a')]||_0x0579('0x29');this[_0x0579('0x2b')]=_0x2f3661[_0x0579('0x2b')]||0x1e;this[_0x0579('0x2c')]=_0x2f3661[_0x0579('0x2c')]||_0x0579('0x2d');this[_0x0579('0x2e')]=_0x2f3661['dialQueueTimeout']||0x3;this[_0x0579('0x2f')]=_0x2f3661[_0x0579('0x2f')]||undefined;this[_0x0579('0x30')]=_0x2f3661[_0x0579('0x30')]||0x3;this[_0x0579('0x31')]=_0x2f3661['dialCongestionRetryFrequency']||0x96;this[_0x0579('0x32')]=_0x2f3661[_0x0579('0x32')]||0x3;this[_0x0579('0x33')]=_0x2f3661[_0x0579('0x33')]||0x96;this[_0x0579('0x34')]=_0x2f3661[_0x0579('0x34')]||0x3;this[_0x0579('0x35')]=_0x2f3661[_0x0579('0x35')]||0x96;this[_0x0579('0x36')]=_0x2f3661[_0x0579('0x36')]||0x3;this[_0x0579('0x37')]=_0x2f3661[_0x0579('0x37')]||0x96;this['dialDropMaxRetry']=_0x2f3661['dialDropMaxRetry']||0x3;this[_0x0579('0x38')]=_0x2f3661['dialDropRetryFrequency']||0x96;this[_0x0579('0x39')]=_0x2f3661[_0x0579('0x39')]||0x3;this['dialAbandonedRetryFrequency']=_0x2f3661['dialAbandonedRetryFrequency']||0x96;this[_0x0579('0x3a')]=_0x2f3661[_0x0579('0x3a')]||0x3;this[_0x0579('0x3b')]=_0x2f3661[_0x0579('0x3b')]||0x96;this[_0x0579('0x3c')]=_0x2f3661[_0x0579('0x3c')]||0x3;this[_0x0579('0x3d')]=_0x2f3661[_0x0579('0x3d')]||0x96;this[_0x0579('0x3e')]=_0x2f3661[_0x0579('0x3e')]||0x4;this[_0x0579('0x3f')]=_0x2f3661['Trunk']?_0x2f3661[_0x0579('0x3f')]:undefined;this[_0x0579('0x40')]=_0x2f3661['TrunkBackup']?_0x2f3661[_0x0579('0x40')]:undefined;this[_0x0579('0x41')]=_0x2f3661[_0x0579('0x41')]||undefined;this[_0x0579('0x42')]=_0x2f3661[_0x0579('0x42')]?_0x2f3661[_0x0579('0x42')]:undefined;this['dialOrderByScheduledAt']=_0x2f3661['dialOrderByScheduledAt']||_0x0579('0x43');this['dialRandomLastDigitCallerIdNumber']=_0x2f3661[_0x0579('0x44')]||undefined;this[_0x0579('0x45')]=_0x2f3661[_0x0579('0x45')]||undefined;this[_0x0579('0x46')]=strategy[_0x2f3661['strategy']]||_0x0579('0x47');this[_0x0579('0x48')]=!![];this[_0x0579('0x49')]=_0x2f3661[_0x0579('0x49')]||![];this[_0x0579('0x4a')]=_0x2f3661[_0x0579('0x4a')];this['dialAMDGreeting']=_0x2f3661['dialAMDGreeting'];this[_0x0579('0x4b')]=_0x2f3661[_0x0579('0x4b')];this[_0x0579('0x4c')]=_0x2f3661[_0x0579('0x4c')];this['dialAMDMinWordLength']=_0x2f3661[_0x0579('0x4d')];this['dialAMDBetweenWordsSilence']=_0x2f3661['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x2f3661['dialAMDMaximumNumberOfWords'];this[_0x0579('0x4e')]=_0x2f3661[_0x0579('0x4e')];this[_0x0579('0x4f')]=_0x2f3661['dialAMDMaximumWordLength'];this[_0x0579('0x50')]=0x0;this[_0x0579('0x51')]=0x0;this['timeout']=_0x2f3661['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0x0579('0x52')]=0x0;this[_0x0579('0x53')]=0x0;this[_0x0579('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x0579('0x55')]=0x0;this[_0x0579('0x56')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x0579('0x57')]=0x0;this[_0x0579('0x58')]=0x0;this[_0x0579('0x59')]=0x0;this[_0x0579('0x5a')]=0x0;this[_0x0579('0x5b')]=0x0;this[_0x0579('0x5c')]=0x0;this[_0x0579('0x5d')]=undefined;this['startPredictive']=undefined;this[_0x0579('0x5e')]=undefined;this[_0x0579('0x5f')]=1.05;this[_0x0579('0x60')]=0x0;this[_0x0579('0x61')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x0579('0x62')]=0x0;this[_0x0579('0x63')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x0579('0x64')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x0579('0x65')]=_0x2f3661['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x0579('0x66')]=_0x2f3661[_0x0579('0x67')]||0xa;this[_0x0579('0x68')]=0x0;this[_0x0579('0x69')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x0579('0x6a')]=0x0;this[_0x0579('0x6b')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x0579('0x6c')]=0x0;this['dialRecallMeTimeout']=_0x2f3661[_0x0579('0x6d')]||0x1e;this['dialRecallInQueue']=_0x2f3661[_0x0579('0x6e')]||![];this['dialPreviewAutoRecallMe']=!!_0x2f3661[_0x0579('0x6f')]||![];this[_0x0579('0x70')]=!!_0x2f3661[_0x0579('0x70')]||![];this['dialQueueProject2']=_0x2f3661[_0x0579('0x71')]||undefined;this['dialAgiAfterHangupClient']=_0x2f3661[_0x0579('0x72')]||![];this[_0x0579('0x73')]=_0x2f3661['dialAgiAfterHangupAgent']||![];this[_0x0579('0xb')]=monitorFormat[_0x2f3661['monitor_format']]?monitorFormat[_0x2f3661[_0x0579('0xb')]]:undefined;this[_0x0579('0x74')]=_0x2f3661[_0x0579('0x74')]||![];this[_0x0579('0x75')]=_0x2f3661[_0x0579('0x75')]?_0x2f3661[_0x0579('0x75')]:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
index 5d0997a..4367777 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x598d=['serverUrl','name','username','accessKey','remoteUri'];(function(_0xfea191,_0x21f5a9){var _0x5a908a=function(_0x4fac49){while(--_0x4fac49){_0xfea191['push'](_0xfea191['shift']());}};_0x5a908a(++_0x21f5a9);}(_0x598d,0x150));var _0xd598=function(_0x5a688c,_0x46f1f3){_0x5a688c=_0x5a688c-0x0;var _0x51cdd8=_0x598d[_0x5a688c];return _0x51cdd8;};'use strict';function VtigerAccount(_0x207f0a){this['id']=_0x207f0a['id']||0x0;this[_0xd598('0x0')]=_0x207f0a[_0xd598('0x0')]||'';this['username']=_0x207f0a[_0xd598('0x1')]||'';this[_0xd598('0x2')]=_0x207f0a['accessKey']||'';this[_0xd598('0x3')]=_0x207f0a[_0xd598('0x3')]||'';this[_0xd598('0x4')]=_0x207f0a[_0xd598('0x4')]||'';this['Configurations']=_0x207f0a['Configurations']||{};}module['exports']=VtigerAccount;
\ No newline at end of file
+var _0x65db=['name','username','accessKey','remoteUri','Configurations','exports'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x65db,0x1e0));var _0xb65d=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x65db[_0x40ac5e];return _0x2839d6;};'use strict';function VtigerAccount(_0x525a8c){this['id']=_0x525a8c['id']||0x0;this[_0xb65d('0x0')]=_0x525a8c['name']||'';this[_0xb65d('0x1')]=_0x525a8c[_0xb65d('0x1')]||'';this[_0xb65d('0x2')]=_0x525a8c[_0xb65d('0x2')]||'';this[_0xb65d('0x3')]=_0x525a8c['remoteUri']||'';this['serverUrl']=_0x525a8c['serverUrl']||'';this[_0xb65d('0x4')]=_0x525a8c[_0xb65d('0x4')]||{};}module[_0xb65d('0x5')]=VtigerAccount;
\ No newline at end of file
index c6584c7..c7372f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc01e=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc01e,0x1f0));var _0xec01=function(_0x4a4c74,_0xeceb){_0x4a4c74=_0x4a4c74-0x0;var _0x170a1f=_0xc01e[_0x4a4c74];return _0x170a1f;};'use strict';function ZendeskAccount(_0x51d8dc){this['id']=_0x51d8dc['id']||0x0;this[_0xec01('0x0')]=_0x51d8dc[_0xec01('0x0')]||'';this[_0xec01('0x1')]=_0x51d8dc['username']||'';this[_0xec01('0x2')]=_0x51d8dc['password']||'';this[_0xec01('0x3')]=_0x51d8dc[_0xec01('0x3')]||'';this[_0xec01('0x4')]=_0x51d8dc[_0xec01('0x4')]||'';this[_0xec01('0x5')]=_0x51d8dc[_0xec01('0x5')]||'';this['type']=_0x51d8dc[_0xec01('0x6')]||_0xec01('0x7');this[_0xec01('0x8')]=_0x51d8dc[_0xec01('0x8')]||'';this['Configurations']=_0x51d8dc[_0xec01('0x9')]||{};}module[_0xec01('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0xef88=['Configurations','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x35ca10,_0x5edb67){var _0x4d0021=function(_0x56c7a6){while(--_0x56c7a6){_0x35ca10['push'](_0x35ca10['shift']());}};_0x4d0021(++_0x5edb67);}(_0xef88,0xab));var _0x8ef8=function(_0x4947e4,_0x5779c9){_0x4947e4=_0x4947e4-0x0;var _0x3c0769=_0xef88[_0x4947e4];return _0x3c0769;};'use strict';function ZendeskAccount(_0x33bf8a){this['id']=_0x33bf8a['id']||0x0;this['name']=_0x33bf8a[_0x8ef8('0x0')]||'';this[_0x8ef8('0x1')]=_0x33bf8a[_0x8ef8('0x1')]||'';this['password']=_0x33bf8a[_0x8ef8('0x2')]||'';this[_0x8ef8('0x3')]=_0x33bf8a[_0x8ef8('0x3')]||'';this[_0x8ef8('0x4')]=_0x33bf8a[_0x8ef8('0x4')]||'';this['authType']=_0x33bf8a[_0x8ef8('0x5')]||'';this[_0x8ef8('0x6')]=_0x33bf8a[_0x8ef8('0x6')]||_0x8ef8('0x7');this[_0x8ef8('0x8')]=_0x33bf8a[_0x8ef8('0x8')]||'';this[_0x8ef8('0x9')]=_0x33bf8a[_0x8ef8('0x9')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
index 24f3bc6..8a1066b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ef0=['zone','clientId','clientSecret','code','refreshToken','Configurations','exports','name','description','host'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0x4ef0,0xe3));var _0x04ef=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x4ef0[_0x59d0cc];return _0x2ae79f;};'use strict';function ZohoAccount(_0x151889){this['id']=_0x151889['id']||0x0;this[_0x04ef('0x0')]=_0x151889[_0x04ef('0x0')]||'';this[_0x04ef('0x1')]=_0x151889[_0x04ef('0x1')]||'';this[_0x04ef('0x2')]=_0x151889[_0x04ef('0x2')]||'';this[_0x04ef('0x3')]=_0x151889['zone']||'';this['clientId']=_0x151889[_0x04ef('0x4')]||'';this[_0x04ef('0x5')]=_0x151889[_0x04ef('0x5')]||'';this['serverUrl']=_0x151889['serverUrl']||'';this[_0x04ef('0x6')]=_0x151889[_0x04ef('0x6')]||'';this[_0x04ef('0x7')]=_0x151889['refreshToken']||'';this[_0x04ef('0x8')]=_0x151889[_0x04ef('0x8')]||{};}module[_0x04ef('0x9')]=ZohoAccount;
\ No newline at end of file
+var _0xdc20=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x5ed905,_0x18c39d){var _0x1b8e91=function(_0x4a45cc){while(--_0x4a45cc){_0x5ed905['push'](_0x5ed905['shift']());}};_0x1b8e91(++_0x18c39d);}(_0xdc20,0x13b));var _0x0dc2=function(_0x4d21b6,_0x4bd6a4){_0x4d21b6=_0x4d21b6-0x0;var _0x56421b=_0xdc20[_0x4d21b6];return _0x56421b;};'use strict';function ZohoAccount(_0x5e13d6){this['id']=_0x5e13d6['id']||0x0;this[_0x0dc2('0x0')]=_0x5e13d6[_0x0dc2('0x0')]||'';this['description']=_0x5e13d6[_0x0dc2('0x1')]||'';this['host']=_0x5e13d6[_0x0dc2('0x2')]||'';this[_0x0dc2('0x3')]=_0x5e13d6[_0x0dc2('0x3')]||'';this[_0x0dc2('0x4')]=_0x5e13d6[_0x0dc2('0x4')]||'';this[_0x0dc2('0x5')]=_0x5e13d6[_0x0dc2('0x5')]||'';this[_0x0dc2('0x6')]=_0x5e13d6['serverUrl']||'';this['code']=_0x5e13d6[_0x0dc2('0x7')]||'';this[_0x0dc2('0x8')]=_0x5e13d6[_0x0dc2('0x8')]||'';this['Configurations']=_0x5e13d6[_0x0dc2('0x9')]||{};}module[_0x0dc2('0xa')]=ZohoAccount;
\ No newline at end of file
index 2219587..00a529f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f55=['UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','moment','isNil','string','uniqueid','idContact','name','type','queue','Agent','channelAgent','membername','format','SIP/%s','calleridname','Contact','firstName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x185aec,_0x2629e2){var _0x8458c3=function(_0x97e7b9){while(--_0x97e7b9){_0x185aec['push'](_0x185aec['shift']());}};_0x8458c3(++_0x2629e2);}(_0x0f55,0x157));var _0x50f5=function(_0x51f2c0,_0xb7c46e){_0x51f2c0=_0x51f2c0-0x0;var _0x34ffd5=_0x0f55[_0x51f2c0];return _0x34ffd5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x50f5('0x0'));function checkNameSurname(_0x1153b7,_0x48bd13,_0x5fb49f){var _0x670b00='';if(!_[_0x50f5('0x1')](_0x48bd13)&&_0x50f5('0x2')===typeof _0x48bd13){_0x670b00+=_0x48bd13;}if(!_[_0x50f5('0x1')](_0x5fb49f)&&'string'===typeof _0x5fb49f){_0x670b00+='\x20'+_0x5fb49f;}if(_0x670b00!==''){return _0x670b00;}return _0x1153b7;}function Action(_0x40ba06,_0x370d94,_0x1c2653,_0x2400d6,_0x119e5c){this[_0x50f5('0x3')]=_0x1c2653||undefined;this[_0x50f5('0x4')]=_0x40ba06['id'];this['queue']=_0x370d94[_0x50f5('0x5')];this[_0x50f5('0x6')]=_0x370d94['type'];this['campaigntype']=_0x50f5('0x7');this['dialAnswer']=![];this['membername']=_[_0x50f5('0x1')](_0x40ba06['Agent'])?undefined:_0x40ba06[_0x50f5('0x8')][_0x50f5('0x5')];this[_0x50f5('0x9')]=this[_0x50f5('0xa')]?util[_0x50f5('0xb')](_0x50f5('0xc'),this[_0x50f5('0xa')]):_0x2400d6||undefined;this[_0x50f5('0xd')]=checkNameSurname(_0x40ba06[_0x50f5('0xe')]['phone'],_0x40ba06[_0x50f5('0xe')][_0x50f5('0xf')],_0x40ba06['Contact']['lastName']);this[_0x50f5('0x10')]=_0x40ba06[_0x50f5('0x10')]||![];this[_0x50f5('0x11')]=_0x40ba06[_0x50f5('0xe')][_0x50f5('0x12')];this[_0x50f5('0x13')]=_0x40ba06['scheduledat'];this['countbusyretry']=_0x40ba06[_0x50f5('0x14')]||0x0;this[_0x50f5('0x15')]=_0x40ba06[_0x50f5('0x15')]||0x0;this[_0x50f5('0x16')]=_0x40ba06[_0x50f5('0x16')]||0x0;this[_0x50f5('0x17')]=(_0x40ba06[_0x50f5('0x14')]||0x0)+(_0x40ba06[_0x50f5('0x15')]||0x0)+(_0x40ba06[_0x50f5('0x16')]||0x0)+(_0x40ba06[_0x50f5('0x18')]||0x0)+(_0x40ba06[_0x50f5('0x19')]||0x0)+(_0x40ba06[_0x50f5('0x1a')]||0x0)+(_0x40ba06[_0x50f5('0x1b')]||0x0)+(_0x40ba06[_0x50f5('0x1c')]||0x0);this[_0x50f5('0x18')]=_0x40ba06['countnosuchnumberretry']||0x0;this[_0x50f5('0x19')]=_0x40ba06[_0x50f5('0x19')]||0x0;this[_0x50f5('0x1a')]=_0x40ba06['countabandonedretry']||0x0;this[_0x50f5('0x1b')]=_0x40ba06[_0x50f5('0x1b')]||0x0;this[_0x50f5('0x1c')]=_0x40ba06[_0x50f5('0x1c')]||0x0;this[_0x50f5('0x1d')]=_0x40ba06[_0x50f5('0x1d')];this['callbackuniqueid']=_0x40ba06[_0x50f5('0x1e')];this[_0x50f5('0x1f')]=_0x40ba06[_0x50f5('0x1f')];this[_0x50f5('0x20')]=_0x40ba06[_0x50f5('0x20')];this[_0x50f5('0x21')]=_0x40ba06[_0x50f5('0x21')];this['ListId']=_0x40ba06[_0x50f5('0x22')];this['UserId']=_[_0x50f5('0x1')](_0x40ba06[_0x50f5('0x8')])?_0x40ba06[_0x50f5('0x23')]:_0x40ba06['Agent']['id'];this[_0x50f5('0x24')]=_0x40ba06[_0x50f5('0x24')];this[_0x50f5('0x25')]='';this[_0x50f5('0x26')]='';}Action[_0x50f5('0x27')]['getCaller']=function(){return util[_0x50f5('0xb')](_0x50f5('0x28'),this[_0x50f5('0xd')],this[_0x50f5('0x29')]);};module['exports']=Action;
\ No newline at end of file
+var _0xfb2d=['lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','format','SIP/%s','Contact','phone','firstName'];(function(_0x3bbfde,_0x1e53c0){var _0x3025ff=function(_0x39ea1d){while(--_0x39ea1d){_0x3bbfde['push'](_0x3bbfde['shift']());}};_0x3025ff(++_0x1e53c0);}(_0xfb2d,0x1d2));var _0xdfb2=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xfb2d[_0x28aea5];return _0x6a55f9;};'use strict';var util=require(_0xdfb2('0x0'));var _=require(_0xdfb2('0x1'));var moment=require('moment');function checkNameSurname(_0x1949e1,_0x16743c,_0xb5fdb5){var _0x460d2f='';if(!_[_0xdfb2('0x2')](_0x16743c)&&_0xdfb2('0x3')===typeof _0x16743c){_0x460d2f+=_0x16743c;}if(!_['isNil'](_0xb5fdb5)&&_0xdfb2('0x3')===typeof _0xb5fdb5){_0x460d2f+='\x20'+_0xb5fdb5;}if(_0x460d2f!==''){return _0x460d2f;}return _0x1949e1;}function Action(_0x270a3f,_0x3a2d7f,_0x3180fc,_0x207687,_0x301ed1){this[_0xdfb2('0x4')]=_0x3180fc||undefined;this[_0xdfb2('0x5')]=_0x270a3f['id'];this['queue']=_0x3a2d7f[_0xdfb2('0x6')];this[_0xdfb2('0x7')]=_0x3a2d7f['type'];this[_0xdfb2('0x8')]=_0xdfb2('0x9');this[_0xdfb2('0xa')]=![];this[_0xdfb2('0xb')]=_[_0xdfb2('0x2')](_0x270a3f['Agent'])?undefined:_0x270a3f[_0xdfb2('0xc')][_0xdfb2('0x6')];this['channelAgent']=this[_0xdfb2('0xb')]?util[_0xdfb2('0xd')](_0xdfb2('0xe'),this[_0xdfb2('0xb')]):_0x207687||undefined;this['calleridname']=checkNameSurname(_0x270a3f[_0xdfb2('0xf')][_0xdfb2('0x10')],_0x270a3f[_0xdfb2('0xf')][_0xdfb2('0x11')],_0x270a3f[_0xdfb2('0xf')][_0xdfb2('0x12')]);this[_0xdfb2('0x13')]=_0x270a3f[_0xdfb2('0x13')]||![];this['calleridnum']=_0x270a3f[_0xdfb2('0xf')][_0xdfb2('0x10')];this['scheduledat']=_0x270a3f[_0xdfb2('0x14')];this[_0xdfb2('0x15')]=_0x270a3f['countbusyretry']||0x0;this[_0xdfb2('0x16')]=_0x270a3f[_0xdfb2('0x16')]||0x0;this['countnoanswerretry']=_0x270a3f[_0xdfb2('0x17')]||0x0;this[_0xdfb2('0x18')]=(_0x270a3f[_0xdfb2('0x15')]||0x0)+(_0x270a3f[_0xdfb2('0x16')]||0x0)+(_0x270a3f['countnoanswerretry']||0x0)+(_0x270a3f[_0xdfb2('0x19')]||0x0)+(_0x270a3f[_0xdfb2('0x1a')]||0x0)+(_0x270a3f[_0xdfb2('0x1b')]||0x0)+(_0x270a3f[_0xdfb2('0x1c')]||0x0)+(_0x270a3f[_0xdfb2('0x1d')]||0x0);this['countnosuchnumberretry']=_0x270a3f['countnosuchnumberretry']||0x0;this[_0xdfb2('0x1a')]=_0x270a3f[_0xdfb2('0x1a')]||0x0;this[_0xdfb2('0x1b')]=_0x270a3f[_0xdfb2('0x1b')]||0x0;this[_0xdfb2('0x1c')]=_0x270a3f[_0xdfb2('0x1c')]||0x0;this[_0xdfb2('0x1d')]=_0x270a3f[_0xdfb2('0x1d')]||0x0;this[_0xdfb2('0x1e')]=_0x270a3f[_0xdfb2('0x1e')];this[_0xdfb2('0x1f')]=_0x270a3f[_0xdfb2('0x1f')];this[_0xdfb2('0x20')]=_0x270a3f[_0xdfb2('0x20')];this[_0xdfb2('0x21')]=_0x270a3f[_0xdfb2('0x21')];this[_0xdfb2('0x22')]=_0x270a3f['ContactId'];this[_0xdfb2('0x23')]=_0x270a3f[_0xdfb2('0x23')];this[_0xdfb2('0x24')]=_[_0xdfb2('0x2')](_0x270a3f[_0xdfb2('0xc')])?_0x270a3f['UserId']:_0x270a3f[_0xdfb2('0xc')]['id'];this[_0xdfb2('0x25')]=_0x270a3f[_0xdfb2('0x25')];this[_0xdfb2('0x26')]='';this[_0xdfb2('0x27')]='';}Action['prototype'][_0xdfb2('0x28')]=function(){return util[_0xdfb2('0xd')](_0xdfb2('0x29'),this['calleridname'],this[_0xdfb2('0x2a')]);};module[_0xdfb2('0x2b')]=Action;
\ No newline at end of file
index 6efb844..99ec931 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a19=['outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','\x20Queue','BUSY','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','rescheduleContact','countbusyretry','dialBusyRetryFrequency','NOANSWER','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','isEmpty','Queue:\x20','\x20IdHopper:\x20','idContact','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Queue','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialCutDigit','substring','trim','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','clone','response','unlockContact','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','variable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','redis','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','answered','available','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS'];(function(_0x5452ec,_0x259456){var _0x4700e0=function(_0x648a10){while(--_0x648a10){_0x5452ec['push'](_0x5452ec['shift']());}};_0x4700e0(++_0x259456);}(_0x9a19,0x114));var _0x99a1=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x9a19[_0xa45395];return _0x3c83d2;};'use strict';var util=require(_0x99a1('0x0'));var _=require(_0x99a1('0x1'));var BPromise=require(_0x99a1('0x2'));var uuid=require('uuid');var moment=require(_0x99a1('0x3'));var md5=require(_0x99a1('0x4'));var Redis=require(_0x99a1('0x5'));var config=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var loggerAction=require(_0x99a1('0x7'))(_0x99a1('0x9'));var ami=require(_0x99a1('0xa'));var rpcDb=require(_0x99a1('0xb'));var Action=require(_0x99a1('0xc'));var ut=require('./util/util');config['redis']=_['defaults'](config[_0x99a1('0xd')],{'host':_0x99a1('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x99a1('0xf')][_0x99a1('0x10')]=function(_0x23db53){this[_0x99a1('0x11')]=this[_0x99a1('0x11')]?this['tail'][_0x99a1('0x12')](_0x23db53):_0x23db53();};function Preview(_0xdd29e1){this[_0x99a1('0x13')]=new Sequence();this[_0x99a1('0x14')]=_0xdd29e1[_0x99a1('0x15')];this[_0x99a1('0x16')]=_0xdd29e1[_0x99a1('0x16')];this[_0x99a1('0x17')]={};this[_0x99a1('0x18')]=_0xdd29e1[_0x99a1('0x18')];this[_0x99a1('0x19')]=0x0;ami['on'](_0x99a1('0x1a'),this[_0x99a1('0x1b')][_0x99a1('0x1c')](this));ami['on'](_0x99a1('0x1d'),this['syncHangup'][_0x99a1('0x1c')](this));ami['on'](_0x99a1('0x1e'),this[_0x99a1('0x1f')][_0x99a1('0x1c')](this));ami['on'](_0x99a1('0x20'),this[_0x99a1('0x21')][_0x99a1('0x1c')](this));ami['on']('newexten',this['syncNewExten'][_0x99a1('0x1c')](this));ami['on'](_0x99a1('0x22'),this[_0x99a1('0x23')][_0x99a1('0x1c')](this));ami['on'](_0x99a1('0x24'),this[_0x99a1('0x25')][_0x99a1('0x1c')](this));ami['on'](_0x99a1('0x26'),this[_0x99a1('0x27')][_0x99a1('0x1c')](this));this[_0x99a1('0x28')](this['campaignsPreview']);}function emit(_0x3023a1,_0x20007e,_0x5bed38){io['to'](_0x3023a1)[_0x99a1('0x29')](_0x20007e,_0x5bed38);}function emitCampaignPreview(_0x53093d){if(_0x53093d[_0x99a1('0x2a')]===_0x99a1('0x2b')){var _0x2d6f20={'id':_0x53093d['id'],'name':_0x53093d[_0x99a1('0x2c')],'strategy':_0x53093d['strategy'],'answered':_0x53093d[_0x99a1('0x2d')],'available':_0x53093d[_0x99a1('0x2e')],'loggedIn':_0x53093d['loggedIn'],'pTalking':_0x53093d[_0x99a1('0x2f')],'sumBillable':_0x53093d['sumBillable'],'sumDuration':_0x53093d[_0x99a1('0x30')],'sumHoldTime':_0x53093d[_0x99a1('0x31')]||0x0,'talking':_0x53093d[_0x99a1('0x32')],'total':_0x53093d[_0x99a1('0x33')],'type':_0x53093d[_0x99a1('0x2a')],'unmanaged':_0x53093d[_0x99a1('0x34')],'abandoned':_0x53093d['abandoned'],'waiting':_0x53093d[_0x99a1('0x35')],'loggedInDb':_0x53093d['loggedInDb'],'dialActive':_0x53093d['dialActive'],'dialMethod':_0x53093d[_0x99a1('0x36')],'dialOriginateCallerIdName':_0x53093d[_0x99a1('0x37')],'dialOriginateCallerIdNumber':_0x53093d[_0x99a1('0x38')],'dialOriginateTimeout':_0x53093d[_0x99a1('0x39')],'dialPrefix':_0x53093d[_0x99a1('0x3a')],'outboundAnswerAgiCallsDay':_0x53093d[_0x99a1('0x3b')],'outboundAnswerCallsDay':_0x53093d[_0x99a1('0x3c')],'outboundBlacklistCallsDay':_0x53093d['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x53093d[_0x99a1('0x3d')],'outboundCongestionCallsDay':_0x53093d['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x53093d[_0x99a1('0x3e')],'outboundDropCallsDayCallersExit':_0x53093d[_0x99a1('0x3f')],'outboundDropCallsDayTimeout':_0x53093d[_0x99a1('0x40')],'outboundNoAnswerCallsDay':_0x53093d['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x53093d[_0x99a1('0x41')],'outboundOriginateFailureCallsDay':_0x53093d[_0x99a1('0x42')],'outboundReCallsDay':_0x53093d['outboundReCallsDay'],'outboundRejectCallsDay':_0x53093d[_0x99a1('0x43')],'outboundUnknownCallsDay':_0x53093d[_0x99a1('0x44')],'outboundAbandonedCallsDay':_0x53093d[_0x99a1('0x45')],'predictiveIntervalAnsweredCalls':_0x53093d[_0x99a1('0x46')],'predictiveIntervalAvgHoldtime':_0x53093d[_0x99a1('0x47')],'predictiveIntervalAvgTalktime':_0x53093d[_0x99a1('0x48')],'predictiveIntervalDroppedCallsCallersExit':_0x53093d[_0x99a1('0x49')],'predictiveIntervalDroppedCallsTimeout':_0x53093d[_0x99a1('0x4a')],'predictiveIntervalErlangCalls':_0x53093d['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x53093d['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x53093d[_0x99a1('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x53093d['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x53093d[_0x99a1('0x4c')],'predictiveIntervalAvailable':_0x53093d[_0x99a1('0x4d')],'predictiveIntervalTotalCalls':_0x53093d['predictiveIntervalTotalCalls'],'message':_0x53093d[_0x99a1('0x4e')],'originated':_0x53093d[_0x99a1('0x4f')],'erlangCalls':_0x53093d[_0x99a1('0x50')],'erlangCallToSecond':_0x53093d[_0x99a1('0x51')],'erlangAbandonmentRate':_0x53093d[_0x99a1('0x52')],'erlangBusyFactor':_0x53093d[_0x99a1('0x53')],'startPredictive':_0x53093d[_0x99a1('0x54')],'startProgressive':_0x53093d[_0x99a1('0x55')]};if(_0x53093d[_0x99a1('0x56')]){_0x2d6f20[_0x99a1('0x56')]={'id':_0x53093d[_0x99a1('0x56')]['id'],'name':_0x53093d[_0x99a1('0x56')][_0x99a1('0x2c')],'active':_0x53093d[_0x99a1('0x56')]['active'],'callerid':_0x53093d['Trunk'][_0x99a1('0x57')]};}if(_0x53093d[_0x99a1('0x58')]){_0x2d6f20[_0x99a1('0x58')]={'id':_0x53093d[_0x99a1('0x58')]['id'],'name':_0x53093d[_0x99a1('0x58')][_0x99a1('0x2c')]};}var _0x318dab=md5(JSON['stringify'](_0x2d6f20));if(_0x53093d[_0x99a1('0x4')]!==_0x318dab){_0x53093d[_0x99a1('0x4')]=_0x318dab;emit(util['format'](_0x99a1('0x59'),_0x2d6f20[_0x99a1('0x2c')]),_0x99a1('0x5a'),_0x2d6f20);}}}function emitVoiceQueueChannelRemove(_0x3cd1a0){logger[_0x99a1('0x5b')](_0x99a1('0x5c'),JSON[_0x99a1('0x5d')](_0x3cd1a0));emit(util[_0x99a1('0x5e')](_0x99a1('0x59'),_0x3cd1a0[_0x99a1('0x2c')]),_0x99a1('0x5f'),_0x3cd1a0);io[_0x99a1('0x29')](_0x99a1('0x60'),_0x3cd1a0);}function notSendMessagesQueue(_0x5018e9){if(_0x5018e9['sendMessageOneNotActive']){if(_0x5018e9['originated']===0x0&&_0x5018e9[_0x99a1('0x2f')]===0x0){_0x5018e9[_0x99a1('0x61')]=![];_0x5018e9[_0x99a1('0x2e')]=0x0;_0x5018e9[_0x99a1('0x62')]=0x0;_0x5018e9[_0x99a1('0x4e')]='NOT_ACTIVE';ut[_0x99a1('0x63')](_0x99a1('0x64'),_0x5018e9[_0x99a1('0x2c')]+'\x20is\x20not\x20active');}else{_0x5018e9['message']=_0x99a1('0x65');ut[_0x99a1('0x63')](_0x99a1('0x64'),_0x5018e9['name']+_0x99a1('0x66'));}emitCampaignPreview(_0x5018e9);}}Preview[_0x99a1('0xf')][_0x99a1('0x28')]=function(){var _0x394762=this;setInterval(function(){_0x394762[_0x99a1('0x67')]();},0x7cf);};Preview[_0x99a1('0xf')][_0x99a1('0x67')]=function(){var _0x29d0a0=this[_0x99a1('0x14')];this[_0x99a1('0x19')]+=0x1;for(var _0x4b40e1 in _0x29d0a0){if(_0x29d0a0[_0x99a1('0x68')](_0x4b40e1)&&(_0x29d0a0[_0x4b40e1][_0x99a1('0x36')]===_0x99a1('0x8')||_0x29d0a0[_0x4b40e1]['dialMethod']===_0x99a1('0x69'))&&_0x29d0a0[_0x4b40e1]['type']===_0x99a1('0x2b')){if(this[_0x99a1('0x19')]>0x7){this[_0x99a1('0x19')]=0x0;this[_0x99a1('0x6a')]();}}if(_0x29d0a0[_0x99a1('0x68')](_0x4b40e1)&&_0x29d0a0[_0x4b40e1][_0x99a1('0x36')]==='preview'&&_0x29d0a0[_0x4b40e1][_0x99a1('0x2a')]==='outbound'){if(_0x29d0a0[_0x4b40e1][_0x99a1('0x6b')]){this[_0x99a1('0x6c')](_0x29d0a0[_0x4b40e1]);if(_0x29d0a0[_0x4b40e1][_0x99a1('0x6d')])this[_0x99a1('0x6e')](_0x29d0a0[_0x4b40e1]);}else{notSendMessagesQueue(_0x29d0a0[_0x4b40e1]);}}}};Preview[_0x99a1('0xf')][_0x99a1('0x6f')]=function(_0x31db25){var _0x3861b6=this;this[_0x99a1('0x13')][_0x99a1('0x10')](function(){if(!_[_0x99a1('0x70')](_0x3861b6['actions'][_0x31db25])){loggerAction[_0x99a1('0x5b')](_0x99a1('0x71'),_0x31db25,'Queue',_0x3861b6[_0x99a1('0x17')][_0x31db25][_0x99a1('0x72')],_0x99a1('0x73'),JSON[_0x99a1('0x5d')](_0x3861b6[_0x99a1('0x14')][_0x3861b6[_0x99a1('0x17')][_0x31db25][_0x99a1('0x72')]]['originated']),_0x99a1('0x74'),JSON['stringify'](_0x3861b6[_0x99a1('0x14')][_0x3861b6[_0x99a1('0x17')][_0x31db25]['queue']]['pTalking']),JSON[_0x99a1('0x5d')](_0x3861b6[_0x99a1('0x17')][_0x31db25][_0x99a1('0x75')]),JSON[_0x99a1('0x5d')](_[_0x99a1('0x76')](_0x3861b6['actions'][_0x31db25],['contactId','UserId',_0x99a1('0x77'),_0x99a1('0x78')])));return ami[_0x99a1('0x79')]({'action':_0x99a1('0x7a'),'channel':_0x3861b6[_0x99a1('0x17')][_0x31db25][_0x99a1('0x7b')]})[_0x99a1('0x7c')](function(_0x57a7ac){if(_0x57a7ac[_0x99a1('0x4e')]===_0x99a1('0x7d')){setTimeout(function(){if(_0x3861b6[_0x99a1('0x17')][_0x31db25]){ut['updateOriginated'](_0x3861b6[_0x99a1('0x14')][_0x3861b6['actions'][_0x31db25]['queue']],_0x99a1('0x7e'));if(_0x3861b6[_0x99a1('0x17')][_0x31db25][_0x99a1('0x75')]===!![]){ut[_0x99a1('0x7f')](_0x3861b6[_0x99a1('0x14')][_0x3861b6[_0x99a1('0x17')][_0x31db25][_0x99a1('0x72')]],_0x99a1('0x7e'));ut[_0x99a1('0x80')]('[Dialer][checkChannel][pTalking][Preview]'+_0x31db25,_0x3861b6[_0x99a1('0x17')][_0x31db25]['queue']);}ut[_0x99a1('0x80')](_0x99a1('0x81')+_0x31db25,_0x3861b6['actions'][_0x31db25][_0x99a1('0x72')]);delete _0x3861b6[_0x99a1('0x17')][_0x31db25];}},0x2328);}});}});};Preview[_0x99a1('0xf')][_0x99a1('0x6a')]=function(){var _0x2800d5=this;loggerAction[_0x99a1('0x5b')](_0x99a1('0x82'),_[_0x99a1('0x83')](this[_0x99a1('0x17')]));for(var _0x1c2926 in this[_0x99a1('0x17')]){if(_0x2800d5[_0x99a1('0x17')]['hasOwnProperty'](_0x1c2926)){_0x2800d5['clearZombieChannel'](_0x1c2926);}}};Preview[_0x99a1('0xf')][_0x99a1('0x6e')]=function(_0x28caeb){var _0x294cf0=this;rpcDb[_0x99a1('0x84')](_0x28caeb['id'],ut['agentReadyId'](this[_0x99a1('0x18')]))[_0x99a1('0x85')](function(_0x529f66){if(!_[_0x99a1('0x70')](_0x529f66)){for(var _0x95f20a=0x0;_0x95f20a<_0x529f66[_0x99a1('0x86')];_0x95f20a+=0x1){if(ut[_0x99a1('0x87')](_0x529f66[_0x95f20a][_0x99a1('0x88')])<_0x28caeb['dialRecallMeTimeout']*0x3c){if(_0x529f66[_0x95f20a][_0x99a1('0x89')]&&!_0x529f66[_0x95f20a][_0x99a1('0x89')][_0x99a1('0x8a')]){_0x294cf0[_0x99a1('0x8b')](_0x529f66[_0x95f20a]['id'])[_0x99a1('0x85')](ut[_0x99a1('0x8c')]('[RecallMe]'))[_0x99a1('0x7c')](ut[_0x99a1('0x8c')]('[RecallMe]'));}else{rpcDb[_0x99a1('0x8d')](_0x529f66[_0x95f20a]['id']);}}else{var _0x2b228e=new Action(_0x529f66[_0x95f20a],_0x28caeb);_0x2b228e[_0x99a1('0x8e')]=moment()[_0x99a1('0x5e')](_0x99a1('0x8f'));_0x28caeb['outboundReCallsDay']+=0x1;ut[_0x99a1('0x90')](_0x2b228e,0x17,'RecallInQueue');if(_0x28caeb['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0x99a1('0x91')](_0x529f66[_0x95f20a]));rpcDb[_0x99a1('0x92')](_0x2b228e,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x2b228e,0x16,_0x99a1('0x93'));rpcDb['createCustomerHistory'](_0x2b228e,_0x99a1('0x94'));rpcDb[_0x99a1('0x95')](_0x2b228e,_0x99a1('0x94'));}}}}})[_0x99a1('0x7c')](ut['logger2'](_0x99a1('0x96')));};Preview[_0x99a1('0xf')][_0x99a1('0x6c')]=function(_0x4fbfb3){_0x4fbfb3[_0x99a1('0x61')]=!![];if(ut['IsNotLoggedIn'](_0x4fbfb3[_0x99a1('0x97')])){_0x4fbfb3[_0x99a1('0x4e')]=_0x99a1('0x98');}else if(!ut[_0x99a1('0x99')](_0x4fbfb3[_0x99a1('0x6b')])){_0x4fbfb3['message']='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x4fbfb3[_0x99a1('0x56')])){if(!this[_0x99a1('0x9a')](_0x4fbfb3['TrunkBackup'])){_0x4fbfb3['message']=_0x99a1('0x9b');}else{_0x4fbfb3[_0x99a1('0x4e')]=_0x99a1('0x9c');}}else{_0x4fbfb3['message']='ACTIVE';}emitCampaignPreview(_0x4fbfb3);};Preview[_0x99a1('0xf')]['callProgressDetectingCustomer']=function(_0x2770fd,_0x129690,_0x32373b){var _0x4b946b=this;var _0x447e7d=this[_0x99a1('0x17')][_0x129690];var _0x4ac99e=this['campaignsPreview'][_0x447e7d[_0x99a1('0x72')]];var _0x532622;if(_0x4ac99e){switch(_0x32373b){case'1':_0x4ac99e[_0x99a1('0x41')]+=0x1;_0x447e7d[_0x99a1('0x9d')]+=0x1;_0x447e7d[_0x99a1('0x9e')]=ut['totalGlobal'](_0x447e7d);ut[_0x99a1('0x90')](_0x447e7d,0x0,_0x99a1('0x9f'));ami[_0x99a1('0x29')](_0x99a1('0xa0'),ut[_0x99a1('0xa1')](_0x447e7d,'nosuchnumber'));rpcDb['createCustomerHistory'](_0x447e7d,_0x99a1('0xa2'));if(ut[_0x99a1('0xa3')](_0x447e7d)>=_0x4ac99e[_0x99a1('0xa4')]){_0x532622=ut[_0x99a1('0xa5')](_0x447e7d,0xf,'Global');rpcDb[_0x99a1('0x95')](_0x532622,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x447e7d['countnosuchnumberretry']>=_0x4ac99e[_0x99a1('0xa6')]){rpcDb[_0x99a1('0x95')](_0x447e7d,_0x99a1('0xa7'));}else{rpcDb['rescheduleContact'](ut[_0x99a1('0xa8')](_0x447e7d,_0x99a1('0x9d'),_0x4ac99e[_0x99a1('0xa9')]),_0x447e7d[_0x99a1('0xaa')],_0x447e7d[_0x99a1('0xab')]);}}delete this['actions'][_0x2770fd[_0x99a1('0xac')]];break;case _0x99a1('0xad'):var _0x95efd2=moment()[_0x99a1('0x5e')](_0x99a1('0x8f'));_0x447e7d[_0x99a1('0xae')]=_0x95efd2;_0x447e7d['answertime']=_0x95efd2;_0x447e7d[_0x99a1('0x75')]=!![];_0x4ac99e[_0x99a1('0x2f')]+=0x1;logger[_0x99a1('0x5b')](_0x99a1('0xaf'),_0x447e7d[_0x99a1('0xb0')],'\x20Queue',_0x4ac99e[_0x99a1('0x2c')],_0x99a1('0x74'),_0x4ac99e[_0x99a1('0x2f')]);ami[_0x99a1('0x29')](_0x99a1('0xb1'),ut[_0x99a1('0xa1')](_0x447e7d,'connect',this[_0x99a1('0x14')][_0x447e7d[_0x99a1('0x72')]]));if(_0x4ac99e['acw']){ami['emit'](_0x99a1('0xb2'),ut[_0x99a1('0xb3')](_0x447e7d));}break;case'16':ami['emit'](_0x99a1('0xb4'),ut[_0x99a1('0xa1')](_0x447e7d,_0x99a1('0xb5'),this[_0x99a1('0x14')][_0x447e7d[_0x99a1('0x72')]]));emitVoiceQueueChannelRemove(ut[_0x99a1('0xa1')](_0x447e7d,_0x99a1('0xb5')));_0x4ac99e[_0x99a1('0x3c')]+=0x1;_0x4ac99e[_0x99a1('0x33')]+=0x1;_0x4ac99e[_0x99a1('0x2d')]+=0x1;ut[_0x99a1('0x7f')](_0x4ac99e,_0x99a1('0xb6'));_0x447e7d[_0x99a1('0x9e')]=ut['totalGlobal'](_0x447e7d);ut[_0x99a1('0x90')](_0x447e7d,0x4,'Answer');rpcDb['createCustomerHistory'](_0x447e7d,_0x99a1('0xb7'));rpcDb[_0x99a1('0x95')](_0x447e7d,_0x99a1('0xb8'));rpcDb[_0x99a1('0xb9')](_0x447e7d);_0x4ac99e[_0x99a1('0x30')]+=_0x447e7d[_0x99a1('0xba')];_0x4ac99e[_0x99a1('0xbb')]+=_0x447e7d[_0x99a1('0xba')];logger[_0x99a1('0x5b')]('[syncHangup][talking][decrement]',_0x447e7d[_0x99a1('0xb0')],_0x99a1('0xbc'),_0x4ac99e[_0x99a1('0x2c')],_0x99a1('0x74'),_0x4ac99e[_0x99a1('0x2f')]);delete this[_0x99a1('0x17')][_0x2770fd[_0x99a1('0xac')]];break;case _0x99a1('0xbd'):_0x4ac99e['outboundBusyCallsDay']+=0x1;_0x447e7d['countbusyretry']+=0x1;_0x447e7d['countglobal']=ut[_0x99a1('0xa3')](_0x447e7d);ut[_0x99a1('0x90')](_0x447e7d,0x5,'Busy');ami[_0x99a1('0x29')](_0x99a1('0xbe'),ut[_0x99a1('0xa1')](_0x447e7d,_0x99a1('0xbf')));rpcDb['createCustomerHistory'](_0x447e7d,_0x99a1('0xc0'));if(ut[_0x99a1('0xa3')](_0x447e7d)>=_0x4ac99e[_0x99a1('0xa4')]){_0x532622=ut[_0x99a1('0xa5')](_0x447e7d,0xf,'Global');rpcDb[_0x99a1('0x95')](_0x532622,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x447e7d['countbusyretry']>=_0x4ac99e['dialBusyMaxRetry']){rpcDb[_0x99a1('0x95')](_0x447e7d,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x99a1('0xc1')](ut[_0x99a1('0xa8')](_0x447e7d,_0x99a1('0xc2'),_0x4ac99e[_0x99a1('0xc3')]),_0x447e7d[_0x99a1('0xaa')],_0x447e7d[_0x99a1('0xab')]);}}break;case _0x99a1('0xc4'):_0x4ac99e['outboundNoAnswerCallsDay']+=0x1;_0x447e7d['countnoanswerretry']+=0x1;_0x447e7d[_0x99a1('0x9e')]=ut[_0x99a1('0xa3')](_0x447e7d);ut[_0x99a1('0x90')](_0x447e7d,0x3,'NoAnswer');ami[_0x99a1('0x29')](_0x99a1('0xc5'),ut[_0x99a1('0xa1')](_0x447e7d,'noanswer'));rpcDb[_0x99a1('0x92')](_0x447e7d,_0x99a1('0xc6'));if(ut[_0x99a1('0xa3')](_0x447e7d)>=_0x4ac99e['dialGlobalMaxRetry']){_0x532622=ut['cloneAction'](_0x447e7d,0xf,_0x99a1('0xc7'));rpcDb[_0x99a1('0x95')](_0x532622,_0x99a1('0xc8'));}else{if(_0x447e7d[_0x99a1('0xc9')]>=_0x4ac99e[_0x99a1('0xca')]){rpcDb['createCustomerFinal'](_0x447e7d,_0x99a1('0xc6'));}else{rpcDb['rescheduleContact'](ut[_0x99a1('0xa8')](_0x447e7d,_0x99a1('0xc9'),_0x4ac99e[_0x99a1('0xcb')]),_0x447e7d[_0x99a1('0xaa')],_0x447e7d[_0x99a1('0xab')]);}}break;case _0x99a1('0xcc'):_0x4ac99e['outboundCongestionCallsDay']+=0x1;_0x447e7d[_0x99a1('0xcd')]+=0x1;_0x447e7d[_0x99a1('0x9e')]=ut[_0x99a1('0xa3')](_0x447e7d);ut[_0x99a1('0x90')](_0x447e7d,0x8,_0x99a1('0xce'));ami['emit'](_0x99a1('0xcf'),ut['buildObj'](_0x447e7d,_0x99a1('0xd0')));rpcDb[_0x99a1('0x92')](_0x447e7d,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x99a1('0xa3')](_0x447e7d)>=_0x4ac99e['dialGlobalMaxRetry']){_0x532622=ut[_0x99a1('0xa5')](_0x447e7d,0xf,_0x99a1('0xc7'));rpcDb[_0x99a1('0x95')](_0x532622,_0x99a1('0xd1'));}else{if(_0x447e7d[_0x99a1('0xcd')]>=_0x4ac99e[_0x99a1('0xd2')]){rpcDb['createCustomerFinal'](_0x447e7d,_0x99a1('0xd3'));}else{rpcDb[_0x99a1('0xc1')](ut['scheduledAt'](_0x447e7d,_0x99a1('0xcd'),_0x4ac99e[_0x99a1('0xc3')]),_0x447e7d[_0x99a1('0xaa')],_0x447e7d['activeContact']);}}break;case _0x99a1('0xd4'):_0x4ac99e['outboundRejectCallsDay']+=0x1;_0x447e7d[_0x99a1('0xd5')]+=0x1;_0x447e7d[_0x99a1('0x9e')]=ut[_0x99a1('0xa3')](_0x447e7d);ut[_0x99a1('0x90')](_0x447e7d,0x14,_0x99a1('0xd6'));ami['emit'](_0x99a1('0xd7'),ut['buildObj'](_0x447e7d,'agentreject'));rpcDb[_0x99a1('0x92')](_0x447e7d,_0x99a1('0xd8'));if(ut['totalGlobal'](_0x447e7d)>=_0x4ac99e[_0x99a1('0xa4')]){_0x532622=ut[_0x99a1('0xa5')](_0x447e7d,0x14,_0x99a1('0xd6'));rpcDb['createCustomerFinal'](_0x532622,_0x99a1('0xd9'));}else{if(_0x447e7d[_0x99a1('0xd5')]>=_0x4ac99e[_0x99a1('0xda')]){rpcDb['createCustomerFinal'](_0x447e7d,_0x99a1('0xd9'));}else{rpcDb[_0x99a1('0xc1')](ut['scheduledAt'](_0x447e7d,_0x99a1('0xd5'),_0x4ac99e[_0x99a1('0xdb')]),_0x447e7d['unlockAgent'],_0x447e7d['activeContact']);}}break;case _0x99a1('0xdc'):_0x4ac99e[_0x99a1('0x45')]+=0x1;_0x447e7d[_0x99a1('0xdd')]+=0x1;_0x447e7d['countglobal']=ut[_0x99a1('0xa3')](_0x447e7d);ut[_0x99a1('0x90')](_0x447e7d,0xb,_0x99a1('0xde'));rpcDb[_0x99a1('0x92')](_0x447e7d,_0x99a1('0xdf'));if(ut[_0x99a1('0xa3')](_0x447e7d)>=_0x4ac99e['dialGlobalMaxRetry']){_0x532622=ut['cloneAction'](_0x447e7d,0xf,'Global');rpcDb[_0x99a1('0x95')](_0x532622,_0x99a1('0xdf'));}else{if(_0x447e7d[_0x99a1('0xe0')]>=_0x4ac99e[_0x99a1('0xe1')]){rpcDb[_0x99a1('0x95')](_0x447e7d,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x99a1('0xc1')](ut[_0x99a1('0xa8')](_0x447e7d,'countabandonedretry',_0x4ac99e['dialAbandonedRetryFrequency']),_0x447e7d[_0x99a1('0xaa')],_0x447e7d[_0x99a1('0xab')]);}}break;case'18':_0x4ac99e[_0x99a1('0x44')]+=0x1;_0x447e7d['countmachineretry']+=0x1;_0x447e7d[_0x99a1('0x9e')]=ut['totalGlobal'](_0x447e7d);ut[_0x99a1('0x90')](_0x447e7d,0x12,_0x2770fd['cause-txt']||_0x2770fd[_0x99a1('0xe2')]);ami[_0x99a1('0x29')]('custom:amd',ut[_0x99a1('0xa1')](_0x447e7d,_0x99a1('0xe3')));rpcDb['createCustomerHistory'](_0x447e7d,_0x99a1('0xe4'));if(ut[_0x99a1('0xa3')](_0x447e7d)>=_0x4ac99e[_0x99a1('0xa4')]){_0x532622=ut[_0x99a1('0xa5')](_0x447e7d,0xf,_0x99a1('0xc7'));rpcDb[_0x99a1('0x95')](_0x532622,_0x99a1('0xe4'));}else{rpcDb['createCustomerFinal'](_0x447e7d,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x99a1('0x17')][_0x2770fd[_0x99a1('0xac')]];break;case'19':_0x4ac99e['outboundUnknownCallsDay']+=0x1;_0x447e7d['countglobal']=ut[_0x99a1('0xa3')](_0x447e7d);ut['logCustomer'](_0x447e7d,0x13,_0x2770fd['cause-txt']||_0x2770fd['dialstatus']);ami[_0x99a1('0x29')]('custom:amd',ut[_0x99a1('0xa1')](_0x447e7d,_0x99a1('0xe3')));rpcDb[_0x99a1('0x92')](_0x447e7d,_0x99a1('0xe5'));if(ut[_0x99a1('0xa3')](_0x447e7d)>=_0x4ac99e[_0x99a1('0xa4')]){_0x532622=ut['cloneAction'](_0x447e7d,0xf,_0x99a1('0xc7'));rpcDb[_0x99a1('0x95')](_0x532622,_0x99a1('0xe5'));}else{rpcDb[_0x99a1('0x95')](_0x447e7d,_0x99a1('0xe5'));}delete this['actions'][_0x2770fd[_0x99a1('0xac')]];break;default:if(_0x447e7d[_0x99a1('0x75')]){ut[_0x99a1('0x7f')](_0x4ac99e,_0x99a1('0xe6'));ut[_0x99a1('0x80')](_0x99a1('0xe7')+_0x4ac99e[_0x99a1('0x2c')],_0x2770fd);}_0x4ac99e[_0x99a1('0x44')]+=0x1;_0x447e7d['countglobal']=ut[_0x99a1('0xa3')](_0x447e7d);ut[_0x99a1('0x90')](_0x447e7d,0xc,_0x2770fd[_0x99a1('0xe8')]||_0x2770fd[_0x99a1('0xe2')]);rpcDb[_0x99a1('0x92')](_0x447e7d,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x99a1('0xa3')](_0x447e7d)>=_0x4ac99e['dialGlobalMaxRetry']){_0x532622=ut[_0x99a1('0xa5')](_0x447e7d,0xf,_0x99a1('0xc7'));rpcDb[_0x99a1('0x95')](_0x532622,_0x99a1('0xe9'));}else{rpcDb['createCustomerFinal'](_0x447e7d,_0x99a1('0xe9'));}delete this[_0x99a1('0x17')][_0x2770fd[_0x99a1('0xac')]];}if(!(_0x447e7d['dialAnswer']&&_0x32373b==='16')){ut[_0x99a1('0xea')](_0x4ac99e,_0x99a1('0xeb'));logger[_0x99a1('0x5b')](_0x99a1('0xec'),_0x447e7d[_0x99a1('0xb0')],_0x99a1('0xbc'),_0x4ac99e[_0x99a1('0x2c')],_0x99a1('0x73'),_0x4ac99e[_0x99a1('0x4f')]);}if(_0x32373b!==_0x99a1('0xad')){delete this[_0x99a1('0x17')][_0x2770fd['linkedid']];delete this[_0x99a1('0x17')][_0x2770fd['destlinkedid']];}}};Preview[_0x99a1('0xf')][_0x99a1('0xed')]=function(_0x3b31e6,_0x487d3d,_0x1813c7){if(_[_0x99a1('0xee')](_0x487d3d)&&'object'!==typeof _0x487d3d){return;}if(_[_0x99a1('0xee')](_0x1813c7)&&'object'!==typeof _0x1813c7){return;}switch(_0x1813c7[_0x99a1('0xef')]){case'0':ut[_0x99a1('0xf0')](_0x3b31e6,0x0,_0x99a1('0x9f'));rpcDb[_0x99a1('0xf1')](_0x3b31e6,_0x99a1('0xf2'));break;case'3':ut['logAgent'](_0x3b31e6,0x3,_0x99a1('0xf3'));rpcDb[_0x99a1('0xf1')](_0x3b31e6,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x99a1('0xf0')](_0x3b31e6,0x5,'Busy');rpcDb['createAgentHistory'](_0x3b31e6,_0x99a1('0xf4'));break;case'8':ut[_0x99a1('0xf0')](_0x3b31e6,0x8,_0x99a1('0xce'));rpcDb[_0x99a1('0xf1')](_0x3b31e6,_0x99a1('0xf5'));break;case'22':ut[_0x99a1('0xf0')](_0x3b31e6,0x16,_0x99a1('0xf6'));rpcDb[_0x99a1('0xf1')](_0x3b31e6,_0x99a1('0xf7'));break;default:ut[_0x99a1('0xf0')](_0x3b31e6,0xc,_0x1813c7[_0x99a1('0xef')]);rpcDb[_0x99a1('0xf1')](_0x3b31e6,'[callProgressDetectingAgent][logCongestion]');}ut[_0x99a1('0xea')](_0x487d3d,_0x99a1('0xf8'));logger[_0x99a1('0x5b')](_0x99a1('0xf9'),_0x3b31e6[_0x99a1('0xb0')],_0x99a1('0xbc'),_0x487d3d['name'],_0x99a1('0x73'),_0x487d3d[_0x99a1('0x4f')]);delete this[_0x99a1('0x17')][_0x3b31e6[_0x99a1('0xb0')]];};Preview['prototype']['checkInBlack']=function(_0x28a742,_0x14f73d,_0x1880b7,_0x2a6474,_0x24bf8d){var _0x19cd40=this;return new BPromise(function(_0xadbc6f,_0x35077d){if(_[_0x99a1('0x70')](_0x14f73d)||_[_0x99a1('0x70')](_0x14f73d[_0x99a1('0xfa')])||_[_0x99a1('0x70')](_0x14f73d[_0x99a1('0xfa')][_0x99a1('0xfb')])||_[_0x99a1('0x70')](_0x14f73d[_0x99a1('0x77')])){_0x35077d(ut['message'](_0x99a1('0xfc'),_0x2a6474,_0x24bf8d));return;}var _0x4c79bc=uuid['v4']();var _0x304e41=_0x19cd40[_0x99a1('0x14')][_0x14f73d['Queue']['name']];var _0x4dec67=_0x1880b7?_0x19cd40[_0x99a1('0x18')][_0x1880b7]['id']:undefined;_0x19cd40['actions'][_0x4c79bc]=new Action(_0x14f73d,_0x304e41,_0x4c79bc,_0x1880b7,_0x4dec67);var _0x3dd6d7=_0x19cd40['actions'][_0x4c79bc];_0x3dd6d7['unlockAgent']=_0x2a6474;_0x3dd6d7[_0x99a1('0xab')]=_0x24bf8d;_0x3dd6d7['lookAgent']=_0x1880b7;if(_[_0x99a1('0xfd')](_0x28a742)){_0x19cd40['execCall'](_0x3dd6d7,_0x304e41,_0x14f73d,_0x1880b7)['then'](function(_0x3b5a7b){logger[_0x99a1('0x5b')]('[Preview][execCall][success]',_0x99a1('0xfe')+_0x3dd6d7[_0x99a1('0x72')]+_0x99a1('0xff')+_0x3dd6d7[_0x99a1('0x100')],JSON[_0x99a1('0x5d')](_0x3b5a7b));ami['emit']('custom:agentcalled',ut[_0x99a1('0xa1')](_0x3dd6d7,_0x99a1('0x101'),_0x19cd40[_0x99a1('0x14')][_0x3dd6d7[_0x99a1('0x72')]]));_0xadbc6f(ut[_0x99a1('0x4e')]('Calling'));})['catch'](function(_0x46d0d3){ut[_0x99a1('0x63')](_0x99a1('0x102'),_0x46d0d3);_0x35077d(ut[_0x99a1('0x4e')](_0x99a1('0x103'),_0x2a6474,_0x24bf8d));});}else{_0x304e41[_0x99a1('0x104')]+=0x1;ut[_0x99a1('0x105')](_0x3dd6d7);rpcDb[_0x99a1('0x106')](_0x3dd6d7,_0x99a1('0x107'));delete _0x19cd40[_0x99a1('0x17')][_0x4c79bc];_0x35077d(ut[_0x99a1('0x4e')](_0x99a1('0x108'),_0x2a6474,_0x24bf8d));}});};Preview[_0x99a1('0xf')][_0x99a1('0x9a')]=function(_0x236f79){return!_['isNil'](_0x236f79)&&!_[_0x99a1('0x70')](_0x236f79[_0x99a1('0x2c')])&&!_[_0x99a1('0x70')](_0x236f79[_0x99a1('0x109')])&&_0x236f79[_0x99a1('0x109')]&&!_[_0x99a1('0x70')](this[_0x99a1('0x16')][util[_0x99a1('0x5e')](_0x99a1('0x10a'),_0x236f79[_0x99a1('0x2c')])])&&!_[_0x99a1('0x70')](this['trunks'][util['format'](_0x99a1('0x10a'),_0x236f79['name'])]['status'])&&(this['trunks'][util[_0x99a1('0x5e')](_0x99a1('0x10a'),_0x236f79[_0x99a1('0x2c')])][_0x99a1('0x7a')]===_0x99a1('0x10b')||this[_0x99a1('0x16')][util[_0x99a1('0x5e')](_0x99a1('0x10a'),_0x236f79[_0x99a1('0x2c')])][_0x99a1('0x7a')]===_0x99a1('0x10c'));};Preview[_0x99a1('0xf')][_0x99a1('0x8b')]=function(_0x113476,_0x32e5d8){var _0x316d8b=this;return new BPromise(function(_0x4eaf77,_0x3c528a){_0x316d8b[_0x99a1('0x10d')](_0x113476,_0x32e5d8)['then'](function(_0x1cb9b7){_0x4eaf77(_[_0x99a1('0x76')](_0x1cb9b7,[_0x99a1('0x4e')]));})[_0x99a1('0x7c')](function(_0x582fe0){if(_0x582fe0[_0x99a1('0x10e')]){rpcDb['unlockContact'](_0x113476);}if(_0x582fe0['active']){rpcDb['disableContact'](_0x113476);}_0x3c528a(_['pick'](_0x582fe0,[_0x99a1('0x4e')]));});});};Preview[_0x99a1('0xf')]['execRun']=function(_0x498a3d,_0x50db57){var _0x2d8190=this;return new BPromise(function(_0x4f736b,_0x4e9adb){var _0xfe0e26,_0x152309;rpcDb[_0x99a1('0x10f')](_0x498a3d)[_0x99a1('0x85')](function(_0x191f1a){if(!_[_0x99a1('0x70')](_0x191f1a[0x0])){_0x152309=_0x191f1a[0x0][_0x99a1('0x110')]?![]:!![];_0xfe0e26=_0x191f1a[0x0][_0x99a1('0x110')]?!![]:![];_0xfe0e26=_0x50db57?!![]:_0xfe0e26;}var _0x1b299a=_0x2d8190[_0x99a1('0x111')](_0x191f1a);if(_0x1b299a['isValid']){rpcDb[_0x99a1('0x112')](_[_0x99a1('0x76')](_0x191f1a[0x0],['VoiceQueueId',_0x99a1('0x113')]))[_0x99a1('0x85')](function(_0x22757d){_0x2d8190[_0x99a1('0x114')](_0x22757d,_0x191f1a[0x0],_0x50db57,_0x152309,_0xfe0e26)[_0x99a1('0x85')](function(_0xa6f239){_0x4f736b(_0xa6f239);})[_0x99a1('0x7c')](function(_0x4a49c4){_0x4e9adb(_0x4a49c4);});})[_0x99a1('0x7c')](function(_0x3799c6){ut['logger'](_0x99a1('0x115'),_0x3799c6);_0x4e9adb(ut['message'](_0x99a1('0x116'),_0x152309,_0xfe0e26));});}else{_0x4e9adb(ut[_0x99a1('0x4e')](_0x1b299a[_0x99a1('0x4e')],_0x152309,_0xfe0e26));}})[_0x99a1('0x7c')](function(_0x1ca0cc){ut[_0x99a1('0x63')](_0x99a1('0x117'),_0x1ca0cc);_0x4e9adb(ut['message'](_0x99a1('0x116'),![],!![]));});});};Preview['prototype'][_0x99a1('0x111')]=function(_0x42dc9d){if(_['isNil'](_0x42dc9d)||_[_0x99a1('0xfd')](_0x42dc9d)||!_[_0x99a1('0x70')](_0x42dc9d[0x0][_0x99a1('0x89')])&&_['isNil'](_0x42dc9d[0x0]['Agent'][_0x99a1('0x2c')])){ut['logger'](_0x99a1('0x118'),_0x42dc9d);return{'isValid':![],'message':_0x99a1('0x119')};}var _0x3de019=this[_0x99a1('0x14')][_0x42dc9d[0x0][_0x99a1('0x11a')][_0x99a1('0x2c')]];_0x3de019[_0x99a1('0x4e')]=_0x99a1('0x9c');if(_[_0x99a1('0x70')](_0x3de019)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x3de019);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x99a1('0x9a')](_0x3de019[_0x99a1('0x56')])){ut[_0x99a1('0x63')](_0x99a1('0x11b'),_0x99a1('0x11c')+_0x3de019[_0x99a1('0x2c')]+_0x99a1('0x11d'));if(!this[_0x99a1('0x9a')](_0x3de019[_0x99a1('0x11e')])){ut['logger'](_0x99a1('0x11b'),_0x3de019[_0x99a1('0x2c')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x99a1('0x11f')};}}if(!ut[_0x99a1('0x99')](_0x3de019[_0x99a1('0x6b')])){ut[_0x99a1('0x63')](_0x99a1('0x120'),_0x3de019['name']+_0x99a1('0x121'));return{'isValid':![],'message':_0x99a1('0x11c')+_0x3de019[_0x99a1('0x2c')]+_0x99a1('0x121')};}return{'isValid':!![],'message':_0x99a1('0x122')};};Preview[_0x99a1('0xf')][_0x99a1('0x123')]=function(_0x30bda1,_0x2b369f,_0x3c6c19,_0x5b977a){var _0x894e29=this;return new BPromise(function(_0x30197b,_0x3e5d0a){var _0xa3512c=_0x30bda1[_0x99a1('0xb0')];var _0x322a78=_0x894e29[_0x99a1('0x9a')](_0x2b369f[_0x99a1('0x56')])?util['format'](_0x99a1('0x124'),_0x2b369f['Trunk'][_0x99a1('0x2c')],_['isNil'](_0x2b369f[_0x99a1('0x3a')])?'':_0x2b369f[_0x99a1('0x3a')]['trim']()||'',_0x2b369f[_0x99a1('0x125')]>0x0?_0x3c6c19[_0x99a1('0xfa')][_0x99a1('0xfb')][_0x99a1('0x126')](_0x2b369f[_0x99a1('0x125')]):_0x3c6c19[_0x99a1('0xfa')]['phone']):util[_0x99a1('0x5e')](_0x99a1('0x124'),_[_0x99a1('0x70')](_0x2b369f['TrunkBackup'])?_0x2b369f[_0x99a1('0x56')][_0x99a1('0x2c')]:_0x2b369f['TrunkBackup'][_0x99a1('0x2c')],_[_0x99a1('0x70')](_0x2b369f['dialPrefix'])?'':_0x2b369f['dialPrefix'][_0x99a1('0x127')]()||'',_0x2b369f[_0x99a1('0x125')]>0x0?_0x3c6c19[_0x99a1('0xfa')][_0x99a1('0xfb')][_0x99a1('0x126')](_0x2b369f[_0x99a1('0x125')]):_0x3c6c19[_0x99a1('0xfa')]['phone']);var _0x342612=_0x894e29[_0x99a1('0x9a')](_0x2b369f[_0x99a1('0x56')])?ut['getCallerId'](_0x2b369f[_0x99a1('0x56')]['callerid'],_0x2b369f['dialOriginateCallerIdName'],_0x2b369f[_0x99a1('0x128')]>0x0?ut[_0x99a1('0x129')](_0x2b369f['dialOriginateCallerIdNumber'],_0x2b369f[_0x99a1('0x128')]):_0x2b369f['dialOriginateCallerIdNumber']):ut[_0x99a1('0x12a')](_['isNil'](_0x2b369f['TrunkBackup'])?_0x2b369f['Trunk']['callerid']:_0x2b369f[_0x99a1('0x11e')][_0x99a1('0x57')],_0x2b369f['dialOriginateCallerIdName'],_0x2b369f['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x99a1('0x129')](_0x2b369f['dialOriginateCallerIdNumber'],_0x2b369f[_0x99a1('0x128')]):_0x2b369f[_0x99a1('0x38')]);if(_0x342612){_0x30bda1[_0x99a1('0x12b')]=ut['extractCalleridName'](_0x342612);_0x30bda1['originatecalleridnum']=ut['extractCalleridNumber'](_0x342612);}var _0x231f2f=ut[_0x99a1('0x12c')](_0x2b369f,_0x3c6c19,_0x322a78,_0x342612,_0xa3512c,_0x30bda1);_[_0x99a1('0x12d')](_0x30bda1,ut[_0x99a1('0x12e')](_0x231f2f));_0x30bda1[_0x99a1('0x8e')]=moment()[_0x99a1('0x5e')](_0x99a1('0x8f'));ami[_0x99a1('0x79')](ut[_0x99a1('0x12f')](_0x30bda1,_0x2b369f,_0x231f2f,_0x30bda1[_0x99a1('0xab')],_0x5b977a))[_0x99a1('0x85')](function(_0x50961b){_0x2b369f[_0x99a1('0x4f')]+=0x1;logger['info'](_0x99a1('0x130'),_0xa3512c,_0x99a1('0xbc'),_0x2b369f['name'],'originated:\x20',_0x2b369f['originated']);_0x30197b(_0x50961b);})[_0x99a1('0x7c')](function(_0x345b92){ut['logAgent'](_0x30bda1,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x30bda1,_0x99a1('0x131'));_0x3e5d0a(_0x345b92);});});};Preview[_0x99a1('0xf')]['syncNewExten']=function(_0x1c97f6){if(this[_0x99a1('0x17')][_0x1c97f6[_0x99a1('0xac')]]){this[_0x99a1('0x17')][_0x1c97f6[_0x99a1('0xac')]][_0x99a1('0x7b')]=_0x1c97f6[_0x99a1('0x7b')];}};Preview[_0x99a1('0xf')][_0x99a1('0x1b')]=function(_0x4e9f45){var _0x3270ea=this;var _0x1c7b68=this[_0x99a1('0x17')][_0x4e9f45[_0x99a1('0x132')]];if(_0x1c7b68){if(_0x1c7b68[_0x99a1('0x133')]&&this[_0x99a1('0x18')][_0x1c7b68[_0x99a1('0x133')]]){ut[_0x99a1('0x134')](_0x1c7b68,this[_0x99a1('0x18')][_0x1c7b68[_0x99a1('0x133')]]['name'],this[_0x99a1('0x18')][_0x1c7b68['lookAgent']]['id']);}var _0x31b80c=_[_0x99a1('0x135')](_0x1c7b68);_0x31b80c[_0x99a1('0xae')]=moment()[_0x99a1('0x5e')](_0x99a1('0x8f'));var _0x4454ed=_0x3270ea['campaignsPreview'][_0x1c7b68[_0x99a1('0x72')]];if(ut['isFailure'](_0x4e9f45[_0x99a1('0x136')])){if(_0x1c7b68[_0x99a1('0xaa')]){rpcDb[_0x99a1('0x137')](_0x1c7b68[_0x99a1('0x100')]);}if(_0x1c7b68[_0x99a1('0xab')]){rpcDb[_0x99a1('0x8d')](_0x1c7b68['idContact']);}ami[_0x99a1('0x29')](_0x99a1('0x138'),ut[_0x99a1('0xa1')](_0x1c7b68,_0x99a1('0x139'),this[_0x99a1('0x14')][_0x1c7b68[_0x99a1('0x72')]]));this[_0x99a1('0xed')](_0x31b80c,_0x4454ed,_0x4e9f45);}else{_0x1c7b68['starttime']=moment()[_0x99a1('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x99a1('0xf0')](_0x31b80c,0x4,_0x99a1('0x13a'));rpcDb[_0x99a1('0xf1')](_0x31b80c,_0x99a1('0x13b'));}}};Preview['prototype'][_0x99a1('0x13c')]=function(_0x4fba34){var _0x14ec6e=this;var _0x1dab5a=this['actions'][_0x4fba34[_0x99a1('0xac')]];var _0x722681;if(_0x1dab5a){_0x722681=this[_0x99a1('0x14')][_0x1dab5a[_0x99a1('0x72')]];logger[_0x99a1('0x5b')](_0x99a1('0x13d'),_0x4fba34[_0x99a1('0xac')],_0x99a1('0xbc'),_0x722681[_0x99a1('0x2c')],_0x99a1('0x74'),_0x722681[_0x99a1('0x2f')]);}if(this[_0x99a1('0x17')][_0x4fba34['linkedid']]&&_0x4fba34['linkedid']!==_0x4fba34[_0x99a1('0xb0')]){if(_0x4fba34[_0x99a1('0x13e')]==='16'&&this['actions'][_0x4fba34[_0x99a1('0xac')]][_0x99a1('0x75')]){this[_0x99a1('0x13f')](_0x4fba34,_0x4fba34[_0x99a1('0xac')],_0x4fba34['cause']);}else if(this[_0x99a1('0x17')][_0x4fba34['linkedid']][_0x99a1('0x75')]){logger[_0x99a1('0x5b')](_0x99a1('0x140'),_0x4fba34[_0x99a1('0xac')],_0x4fba34[_0x99a1('0x13e')],'\x20Queue',_0x722681[_0x99a1('0x2c')],_0x99a1('0x74'),_0x722681[_0x99a1('0x2f')]);this[_0x99a1('0x13f')](_0x4fba34,_0x4fba34[_0x99a1('0xac')],_0x4fba34['cause']);}}else if(_0x1dab5a&&_[_0x99a1('0x70')](_0x1dab5a[_0x99a1('0x141')])&&_0x722681[_0x99a1('0x142')]&&_0x4fba34[_0x99a1('0xac')]===_0x4fba34['uniqueid']&&_['isNil'](_0x4fba34[_0x99a1('0xef')])&&_0x4fba34[_0x99a1('0x13e')]==='16'&&_0x4fba34[_0x99a1('0x143')]==='6'&&_[_0x99a1('0xee')](_0x1dab5a[_0x99a1('0x144')])){if(_0x1dab5a[_0x99a1('0xaa')]){rpcDb[_0x99a1('0x137')](_0x1dab5a[_0x99a1('0x100')]);}if(_0x1dab5a['activeContact']){rpcDb[_0x99a1('0x8d')](_0x1dab5a[_0x99a1('0x100')]);}_0x4fba34[_0x99a1('0xef')]='22';this[_0x99a1('0xed')](_0x1dab5a,_0x722681,_0x4fba34);}else if(_0x1dab5a&&_0x1dab5a[_0x99a1('0x144')]){if(_0x4fba34[_0x99a1('0x13e')]==='16'&&this[_0x99a1('0x17')][_0x4fba34['linkedid']][_0x99a1('0x75')]){logger[_0x99a1('0x5b')](_0x99a1('0x145'),_0x4fba34['linkedid'],_0x4fba34[_0x99a1('0x13e')],_0x99a1('0xbc'),_0x722681['name'],_0x99a1('0x74'),_0x722681[_0x99a1('0x2f')]);this['callProgressDetectingCustomer'](_0x4fba34,_0x4fba34[_0x99a1('0xac')],_0x4fba34['cause']);}else if(this[_0x99a1('0x17')][_0x4fba34[_0x99a1('0xac')]][_0x99a1('0x75')]){logger['info']('[syncHangup][talking][cause]',_0x4fba34[_0x99a1('0xac')],_0x4fba34[_0x99a1('0x13e')],_0x99a1('0xbc'),_0x722681[_0x99a1('0x2c')],_0x99a1('0x74'),_0x722681['pTalking']);this['callProgressDetectingCustomer'](_0x4fba34,_0x4fba34[_0x99a1('0xac')],_0x4fba34[_0x99a1('0x13e')]);}}};Preview[_0x99a1('0xf')][_0x99a1('0x21')]=function(_0x38003e){if(this['actions'][_0x38003e['destlinkedid']]&&_0x38003e[_0x99a1('0x146')]!==_0x38003e[_0x99a1('0x147')]){this[_0x99a1('0x13f')](_0x38003e,_0x38003e[_0x99a1('0x146')],_0x38003e['dialstatus']);}};Preview[_0x99a1('0xf')]['syncHangupRequest']=function(_0x263abe){if(this[_0x99a1('0x17')][_0x263abe['linkedid']]&&_0x263abe[_0x99a1('0xac')]!==_0x263abe['uniqueid']&&!this['actions'][_0x263abe[_0x99a1('0xac')]][_0x99a1('0x75')]){if(_0x263abe[_0x99a1('0x13e')]==='1'){this['callProgressDetectingCustomer'](_0x263abe,_0x263abe[_0x99a1('0xac')],_0x263abe[_0x99a1('0x13e')]);}}};Preview[_0x99a1('0xf')][_0x99a1('0x148')]=function(_0x2b4206,_0x5ea2cc,_0x123783){if(this[_0x99a1('0x17')][_0x2b4206]){if(_[_0x99a1('0x70')](this[_0x99a1('0x17')][_0x2b4206]['variables'])){this[_0x99a1('0x17')][_0x2b4206][_0x99a1('0x149')]={};}this[_0x99a1('0x17')][_0x2b4206][_0x99a1('0x149')][_0x5ea2cc]=_0x123783;}};Preview['prototype'][_0x99a1('0x23')]=function(_0x3c7219){try{if(!_[_0x99a1('0x70')](_0x3c7219)){if(ut['filterKey'](_['keys'](_0x3c7219[_0x99a1('0x14a')])[0x0])){this[_0x99a1('0x148')](_0x3c7219['uniqueid'],_[_0x99a1('0x14b')](_0x3c7219[_0x99a1('0x14a')])[0x0],_0x3c7219[_0x99a1('0x14c')]);}}}catch(_0x390f56){logger[_0x99a1('0x14d')](_0x99a1('0x14e'),util[_0x99a1('0x14f')](_0x390f56,{'showHidden':![],'depth':null}));}};Preview[_0x99a1('0xf')]['syncAttendedTransfer']=function(_0x39d83f){if(_0x39d83f){if(this[_0x99a1('0x17')][_0x39d83f[_0x99a1('0x150')]]){this[_0x99a1('0x17')][_0x39d83f['transfertargetlinkedid']][_0x99a1('0x144')]=!![];}}};Preview[_0x99a1('0xf')]['syncBlindTransfer']=function(_0x14374f){if(_0x14374f){if(this[_0x99a1('0x17')][_0x14374f[_0x99a1('0x151')]]){this[_0x99a1('0x17')][_0x14374f[_0x99a1('0x151')]][_0x99a1('0x144')]=!![];}}};module[_0x99a1('0x152')]=Preview;
\ No newline at end of file
+var _0xcca7=['\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','OriginateError','[originateFailure][logOriginateFailure]','lookAgent','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','newexten','syncNewExten','varset','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','name','active','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emit','voice_queue_presence:remove','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','recallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','sendMessageOneNotActive','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','logCustomer','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','answertime','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countagentrejectretry','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','agents','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20'];(function(_0x78c79c,_0x2069f5){var _0x3f934e=function(_0x44a855){while(--_0x44a855){_0x78c79c['push'](_0x78c79c['shift']());}};_0x3f934e(++_0x2069f5);}(_0xcca7,0x1aa));var _0x7cca=function(_0x8af759,_0x340c5f){_0x8af759=_0x8af759-0x0;var _0x4268d7=_0xcca7[_0x8af759];return _0x4268d7;};'use strict';var util=require(_0x7cca('0x0'));var _=require(_0x7cca('0x1'));var BPromise=require(_0x7cca('0x2'));var uuid=require(_0x7cca('0x3'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x7cca('0x4'));var config=require('../../../config/environment');var logger=require(_0x7cca('0x5'))(_0x7cca('0x6'));var loggerAction=require(_0x7cca('0x5'))(_0x7cca('0x7'));var ami=require(_0x7cca('0x8'));var rpcDb=require(_0x7cca('0x9'));var Action=require('./action');var ut=require('./util/util');config[_0x7cca('0xa')]=_[_0x7cca('0xb')](config[_0x7cca('0xa')],{'host':_0x7cca('0xc'),'port':0x18eb});var io=require(_0x7cca('0xd'))(new Redis(config[_0x7cca('0xa')]));var Sequence=function(){};Sequence[_0x7cca('0xe')][_0x7cca('0xf')]=function(_0x27323a){this[_0x7cca('0x10')]=this['tail']?this[_0x7cca('0x10')][_0x7cca('0x11')](_0x27323a):_0x27323a();};function Preview(_0x275ab2){this[_0x7cca('0x12')]=new Sequence();this[_0x7cca('0x13')]=_0x275ab2['voiceQueues'];this[_0x7cca('0x14')]=_0x275ab2[_0x7cca('0x14')];this[_0x7cca('0x15')]={};this['agents']=_0x275ab2['agents'];this[_0x7cca('0x16')]=0x0;ami['on'](_0x7cca('0x17'),this[_0x7cca('0x18')][_0x7cca('0x19')](this));ami['on'](_0x7cca('0x1a'),this[_0x7cca('0x1b')][_0x7cca('0x19')](this));ami['on']('hanguprequest',this[_0x7cca('0x1c')]['bind'](this));ami['on']('dialend',this['syncDialEnd'][_0x7cca('0x19')](this));ami['on'](_0x7cca('0x1d'),this[_0x7cca('0x1e')][_0x7cca('0x19')](this));ami['on'](_0x7cca('0x1f'),this['syncVarSet'][_0x7cca('0x19')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0x7cca('0x20'),this[_0x7cca('0x21')][_0x7cca('0x19')](this));this[_0x7cca('0x22')](this[_0x7cca('0x13')]);}function emit(_0x45db2f,_0x2e023c,_0x1e183f){io['to'](_0x45db2f)['emit'](_0x2e023c,_0x1e183f);}function emitCampaignPreview(_0x31baf4){if(_0x31baf4[_0x7cca('0x23')]===_0x7cca('0x24')){var _0x4343a3={'id':_0x31baf4['id'],'name':_0x31baf4['name'],'strategy':_0x31baf4[_0x7cca('0x25')],'answered':_0x31baf4[_0x7cca('0x26')],'available':_0x31baf4[_0x7cca('0x27')],'loggedIn':_0x31baf4[_0x7cca('0x28')],'pTalking':_0x31baf4[_0x7cca('0x29')],'sumBillable':_0x31baf4[_0x7cca('0x2a')],'sumDuration':_0x31baf4[_0x7cca('0x2b')],'sumHoldTime':_0x31baf4[_0x7cca('0x2c')]||0x0,'talking':_0x31baf4['talking'],'total':_0x31baf4[_0x7cca('0x2d')],'type':_0x31baf4[_0x7cca('0x23')],'unmanaged':_0x31baf4[_0x7cca('0x2e')],'abandoned':_0x31baf4[_0x7cca('0x2f')],'waiting':_0x31baf4[_0x7cca('0x30')],'loggedInDb':_0x31baf4[_0x7cca('0x31')],'dialActive':_0x31baf4[_0x7cca('0x32')],'dialMethod':_0x31baf4[_0x7cca('0x33')],'dialOriginateCallerIdName':_0x31baf4['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x31baf4[_0x7cca('0x34')],'dialOriginateTimeout':_0x31baf4['dialOriginateTimeout'],'dialPrefix':_0x31baf4[_0x7cca('0x35')],'outboundAnswerAgiCallsDay':_0x31baf4[_0x7cca('0x36')],'outboundAnswerCallsDay':_0x31baf4['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x31baf4[_0x7cca('0x37')],'outboundBusyCallsDay':_0x31baf4[_0x7cca('0x38')],'outboundCongestionCallsDay':_0x31baf4['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x31baf4[_0x7cca('0x39')],'outboundDropCallsDayCallersExit':_0x31baf4[_0x7cca('0x3a')],'outboundDropCallsDayTimeout':_0x31baf4[_0x7cca('0x3b')],'outboundNoAnswerCallsDay':_0x31baf4['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x31baf4['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x31baf4[_0x7cca('0x3c')],'outboundReCallsDay':_0x31baf4[_0x7cca('0x3d')],'outboundRejectCallsDay':_0x31baf4[_0x7cca('0x3e')],'outboundUnknownCallsDay':_0x31baf4[_0x7cca('0x3f')],'outboundAbandonedCallsDay':_0x31baf4[_0x7cca('0x40')],'predictiveIntervalAnsweredCalls':_0x31baf4[_0x7cca('0x41')],'predictiveIntervalAvgHoldtime':_0x31baf4[_0x7cca('0x42')],'predictiveIntervalAvgTalktime':_0x31baf4['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x31baf4['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x31baf4[_0x7cca('0x43')],'predictiveIntervalErlangCalls':_0x31baf4[_0x7cca('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x31baf4[_0x7cca('0x45')],'predictiveIntervalHitRate':_0x31baf4['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x31baf4[_0x7cca('0x46')],'predictiveIntervalPauses':_0x31baf4['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x31baf4[_0x7cca('0x47')],'predictiveIntervalTotalCalls':_0x31baf4[_0x7cca('0x48')],'message':_0x31baf4[_0x7cca('0x49')],'originated':_0x31baf4[_0x7cca('0x4a')],'erlangCalls':_0x31baf4['erlangCalls'],'erlangCallToSecond':_0x31baf4[_0x7cca('0x4b')],'erlangAbandonmentRate':_0x31baf4[_0x7cca('0x4c')],'erlangBusyFactor':_0x31baf4[_0x7cca('0x4d')],'startPredictive':_0x31baf4['startPredictive'],'startProgressive':_0x31baf4['startProgressive']};if(_0x31baf4['Trunk']){_0x4343a3[_0x7cca('0x4e')]={'id':_0x31baf4[_0x7cca('0x4e')]['id'],'name':_0x31baf4['Trunk'][_0x7cca('0x4f')],'active':_0x31baf4[_0x7cca('0x4e')][_0x7cca('0x50')],'callerid':_0x31baf4[_0x7cca('0x4e')][_0x7cca('0x51')]};}if(_0x31baf4[_0x7cca('0x52')]){_0x4343a3[_0x7cca('0x52')]={'id':_0x31baf4['Interval']['id'],'name':_0x31baf4[_0x7cca('0x52')][_0x7cca('0x4f')]};}var _0x4128e5=md5(JSON[_0x7cca('0x53')](_0x4343a3));if(_0x31baf4['md5']!==_0x4128e5){_0x31baf4[_0x7cca('0x54')]=_0x4128e5;emit(util[_0x7cca('0x55')](_0x7cca('0x56'),_0x4343a3['name']),_0x7cca('0x57'),_0x4343a3);}}}function emitVoiceQueueChannelRemove(_0x4bc7a7){logger[_0x7cca('0x58')](_0x7cca('0x59'),JSON[_0x7cca('0x53')](_0x4bc7a7));emit(util[_0x7cca('0x55')](_0x7cca('0x56'),_0x4bc7a7[_0x7cca('0x4f')]),_0x7cca('0x5a'),_0x4bc7a7);io[_0x7cca('0x5b')](_0x7cca('0x5c'),_0x4bc7a7);}function notSendMessagesQueue(_0x4f1f11){if(_0x4f1f11['sendMessageOneNotActive']){if(_0x4f1f11[_0x7cca('0x4a')]===0x0&&_0x4f1f11[_0x7cca('0x29')]===0x0){_0x4f1f11['sendMessageOneNotActive']=![];_0x4f1f11['available']=0x0;_0x4f1f11[_0x7cca('0x5d')]=0x0;_0x4f1f11[_0x7cca('0x49')]=_0x7cca('0x5e');ut[_0x7cca('0x5f')](_0x7cca('0x60'),_0x4f1f11['name']+_0x7cca('0x61'));}else{_0x4f1f11['message']='IS_DISACTIVED';ut[_0x7cca('0x5f')](_0x7cca('0x60'),_0x4f1f11['name']+_0x7cca('0x62'));}emitCampaignPreview(_0x4f1f11);}}Preview['prototype'][_0x7cca('0x22')]=function(){var _0x3edb26=this;setInterval(function(){_0x3edb26[_0x7cca('0x63')]();},0x7cf);};Preview['prototype'][_0x7cca('0x63')]=function(){var _0x207250=this[_0x7cca('0x13')];this[_0x7cca('0x16')]+=0x1;for(var _0x516774 in _0x207250){if(_0x207250[_0x7cca('0x64')](_0x516774)&&(_0x207250[_0x516774][_0x7cca('0x33')]===_0x7cca('0x6')||_0x207250[_0x516774][_0x7cca('0x33')]===_0x7cca('0x65'))&&_0x207250[_0x516774][_0x7cca('0x23')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x207250[_0x7cca('0x64')](_0x516774)&&_0x207250[_0x516774]['dialMethod']==='preview'&&_0x207250[_0x516774][_0x7cca('0x23')]===_0x7cca('0x24')){if(_0x207250[_0x516774][_0x7cca('0x32')]){this[_0x7cca('0x66')](_0x207250[_0x516774]);if(_0x207250[_0x516774][_0x7cca('0x67')])this['recallMe'](_0x207250[_0x516774]);}else{notSendMessagesQueue(_0x207250[_0x516774]);}}}};Preview[_0x7cca('0xe')][_0x7cca('0x68')]=function(_0xba19aa){var _0x4919b4=this;this[_0x7cca('0x12')][_0x7cca('0xf')](function(){if(!_[_0x7cca('0x69')](_0x4919b4[_0x7cca('0x15')][_0xba19aa])){loggerAction[_0x7cca('0x58')](_0x7cca('0x6a'),_0xba19aa,_0x7cca('0x6b'),_0x4919b4['actions'][_0xba19aa]['queue'],_0x7cca('0x6c'),JSON[_0x7cca('0x53')](_0x4919b4[_0x7cca('0x13')][_0x4919b4[_0x7cca('0x15')][_0xba19aa][_0x7cca('0x6d')]][_0x7cca('0x4a')]),_0x7cca('0x6e'),JSON[_0x7cca('0x53')](_0x4919b4[_0x7cca('0x13')][_0x4919b4[_0x7cca('0x15')][_0xba19aa][_0x7cca('0x6d')]][_0x7cca('0x29')]),JSON['stringify'](_0x4919b4[_0x7cca('0x15')][_0xba19aa][_0x7cca('0x6f')]),JSON[_0x7cca('0x53')](_[_0x7cca('0x70')](_0x4919b4[_0x7cca('0x15')][_0xba19aa],[_0x7cca('0x71'),_0x7cca('0x72'),_0x7cca('0x73'),_0x7cca('0x74')])));return ami[_0x7cca('0x75')]({'action':_0x7cca('0x76'),'channel':_0x4919b4[_0x7cca('0x15')][_0xba19aa][_0x7cca('0x77')]})[_0x7cca('0x78')](function(_0x5edb41){if(_0x5edb41[_0x7cca('0x49')]===_0x7cca('0x79')){setTimeout(function(){if(_0x4919b4[_0x7cca('0x15')][_0xba19aa]){ut[_0x7cca('0x7a')](_0x4919b4[_0x7cca('0x13')][_0x4919b4[_0x7cca('0x15')][_0xba19aa][_0x7cca('0x6d')]],_0x7cca('0x7b'));if(_0x4919b4[_0x7cca('0x15')][_0xba19aa][_0x7cca('0x6f')]===!![]){ut[_0x7cca('0x7c')](_0x4919b4['campaignsPreview'][_0x4919b4[_0x7cca('0x15')][_0xba19aa][_0x7cca('0x6d')]],'[clearZombieChannel]');ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0xba19aa,_0x4919b4[_0x7cca('0x15')][_0xba19aa][_0x7cca('0x6d')]);}ut['loggerError'](_0x7cca('0x7d')+_0xba19aa,_0x4919b4[_0x7cca('0x15')][_0xba19aa]['queue']);delete _0x4919b4[_0x7cca('0x15')][_0xba19aa];}},0x2328);}});}});};Preview['prototype'][_0x7cca('0x7e')]=function(){var _0x385e4e=this;loggerAction[_0x7cca('0x58')](_0x7cca('0x7f'),_[_0x7cca('0x80')](this[_0x7cca('0x15')]));for(var _0x286c77 in this[_0x7cca('0x15')]){if(_0x385e4e[_0x7cca('0x15')][_0x7cca('0x64')](_0x286c77)){_0x385e4e[_0x7cca('0x68')](_0x286c77);}}};Preview[_0x7cca('0xe')][_0x7cca('0x81')]=function(_0x4fdc95){var _0x22b378=this;rpcDb['getContactRecallMe'](_0x4fdc95['id'],ut[_0x7cca('0x82')](this['agents']))[_0x7cca('0x83')](function(_0x282e6b){if(!_[_0x7cca('0x69')](_0x282e6b)){for(var _0x5610a3=0x0;_0x5610a3<_0x282e6b[_0x7cca('0x84')];_0x5610a3+=0x1){if(ut[_0x7cca('0x85')](_0x282e6b[_0x5610a3][_0x7cca('0x86')])<_0x4fdc95[_0x7cca('0x87')]*0x3c){if(_0x282e6b[_0x5610a3][_0x7cca('0x88')]&&!_0x282e6b[_0x5610a3]['Agent']['voicePause']){_0x22b378[_0x7cca('0x89')](_0x282e6b[_0x5610a3]['id'])[_0x7cca('0x83')](ut[_0x7cca('0x8a')](_0x7cca('0x8b')))[_0x7cca('0x78')](ut[_0x7cca('0x8a')](_0x7cca('0x8b')));}else{rpcDb[_0x7cca('0x8c')](_0x282e6b[_0x5610a3]['id']);}}else{var _0x3327b1=new Action(_0x282e6b[_0x5610a3],_0x4fdc95);_0x3327b1[_0x7cca('0x8d')]=moment()[_0x7cca('0x55')](_0x7cca('0x8e'));_0x4fdc95[_0x7cca('0x3d')]+=0x1;ut['logCustomer'](_0x3327b1,0x17,_0x7cca('0x8f'));if(_0x4fdc95[_0x7cca('0x90')]){rpcDb['rescheduleContactInQueue'](ut[_0x7cca('0x91')](_0x282e6b[_0x5610a3]));rpcDb[_0x7cca('0x92')](_0x3327b1,_0x7cca('0x93'));}else{ut['logCustomer'](_0x3327b1,0x16,_0x7cca('0x94'));rpcDb[_0x7cca('0x92')](_0x3327b1,_0x7cca('0x95'));rpcDb[_0x7cca('0x96')](_0x3327b1,_0x7cca('0x95'));}}}}})['catch'](ut[_0x7cca('0x8a')](_0x7cca('0x97')));};Preview[_0x7cca('0xe')][_0x7cca('0x66')]=function(_0x4ae638){_0x4ae638[_0x7cca('0x98')]=!![];if(ut[_0x7cca('0x99')](_0x4ae638['loggedIn'])){_0x4ae638[_0x7cca('0x49')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x7cca('0x9a')](_0x4ae638['dialActive'])){_0x4ae638[_0x7cca('0x49')]=_0x7cca('0x5e');}else if(!this[_0x7cca('0x9b')](_0x4ae638[_0x7cca('0x4e')])){if(!this[_0x7cca('0x9b')](_0x4ae638[_0x7cca('0x9c')])){_0x4ae638[_0x7cca('0x49')]=_0x7cca('0x9d');}else{_0x4ae638[_0x7cca('0x49')]=_0x7cca('0x9e');}}else{_0x4ae638[_0x7cca('0x49')]=_0x7cca('0x9e');}emitCampaignPreview(_0x4ae638);};Preview[_0x7cca('0xe')][_0x7cca('0x9f')]=function(_0x4dafb0,_0x418168,_0x451f2d){var _0x61c76=this;var _0x4e4fc4=this[_0x7cca('0x15')][_0x418168];var _0x4c8fa2=this[_0x7cca('0x13')][_0x4e4fc4[_0x7cca('0x6d')]];var _0x1529cd;if(_0x4c8fa2){switch(_0x451f2d){case'1':_0x4c8fa2[_0x7cca('0xa0')]+=0x1;_0x4e4fc4[_0x7cca('0xa1')]+=0x1;_0x4e4fc4[_0x7cca('0xa2')]=ut[_0x7cca('0xa3')](_0x4e4fc4);ut[_0x7cca('0xa4')](_0x4e4fc4,0x0,_0x7cca('0xa5'));ami[_0x7cca('0x5b')](_0x7cca('0xa6'),ut[_0x7cca('0xa7')](_0x4e4fc4,_0x7cca('0xa8')));rpcDb['createCustomerHistory'](_0x4e4fc4,_0x7cca('0xa9'));if(ut['totalGlobal'](_0x4e4fc4)>=_0x4c8fa2[_0x7cca('0xaa')]){_0x1529cd=ut[_0x7cca('0xab')](_0x4e4fc4,0xf,_0x7cca('0xac'));rpcDb[_0x7cca('0x96')](_0x1529cd,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x4e4fc4[_0x7cca('0xa1')]>=_0x4c8fa2[_0x7cca('0xad')]){rpcDb[_0x7cca('0x96')](_0x4e4fc4,_0x7cca('0xae'));}else{rpcDb[_0x7cca('0xaf')](ut[_0x7cca('0xb0')](_0x4e4fc4,'countnosuchnumberretry',_0x4c8fa2[_0x7cca('0xb1')]),_0x4e4fc4[_0x7cca('0xb2')],_0x4e4fc4[_0x7cca('0xb3')]);}}delete this[_0x7cca('0x15')][_0x4dafb0[_0x7cca('0xb4')]];break;case _0x7cca('0xb5'):var _0x33dfec=moment()[_0x7cca('0x55')](_0x7cca('0x8e'));_0x4e4fc4['responsetime']=_0x33dfec;_0x4e4fc4[_0x7cca('0xb6')]=_0x33dfec;_0x4e4fc4[_0x7cca('0x6f')]=!![];_0x4c8fa2['pTalking']+=0x1;logger[_0x7cca('0x58')]('[syncHangup][talking][increment]',_0x4e4fc4[_0x7cca('0xb7')],_0x7cca('0xb8'),_0x4c8fa2[_0x7cca('0x4f')],_0x7cca('0x6e'),_0x4c8fa2[_0x7cca('0x29')]);ami[_0x7cca('0x5b')](_0x7cca('0xb9'),ut[_0x7cca('0xa7')](_0x4e4fc4,_0x7cca('0xba'),this[_0x7cca('0x13')][_0x4e4fc4['queue']]));if(_0x4c8fa2[_0x7cca('0xbb')]){ami[_0x7cca('0x5b')](_0x7cca('0xbc'),ut[_0x7cca('0xbd')](_0x4e4fc4));}break;case'16':ami[_0x7cca('0x5b')](_0x7cca('0xbe'),ut[_0x7cca('0xa7')](_0x4e4fc4,_0x7cca('0xbf'),this['campaignsPreview'][_0x4e4fc4[_0x7cca('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x7cca('0xa7')](_0x4e4fc4,_0x7cca('0xbf')));_0x4c8fa2['outboundAnswerCallsDay']+=0x1;_0x4c8fa2[_0x7cca('0x2d')]+=0x1;_0x4c8fa2[_0x7cca('0x26')]+=0x1;ut[_0x7cca('0x7c')](_0x4c8fa2,_0x7cca('0xc0'));_0x4e4fc4['countglobal']=ut[_0x7cca('0xa3')](_0x4e4fc4);ut[_0x7cca('0xa4')](_0x4e4fc4,0x4,_0x7cca('0xc1'));rpcDb[_0x7cca('0x92')](_0x4e4fc4,_0x7cca('0xc2'));rpcDb[_0x7cca('0x96')](_0x4e4fc4,_0x7cca('0xc3'));rpcDb['crateCustomerReportQueue'](_0x4e4fc4);_0x4c8fa2[_0x7cca('0x2b')]+=_0x4e4fc4[_0x7cca('0xc4')];_0x4c8fa2[_0x7cca('0x2a')]+=_0x4e4fc4[_0x7cca('0xc4')];logger[_0x7cca('0x58')]('[syncHangup][talking][decrement]',_0x4e4fc4[_0x7cca('0xb7')],_0x7cca('0xb8'),_0x4c8fa2['name'],_0x7cca('0x6e'),_0x4c8fa2[_0x7cca('0x29')]);delete this['actions'][_0x4dafb0[_0x7cca('0xb4')]];break;case _0x7cca('0xc5'):_0x4c8fa2[_0x7cca('0x38')]+=0x1;_0x4e4fc4[_0x7cca('0xc6')]+=0x1;_0x4e4fc4[_0x7cca('0xa2')]=ut[_0x7cca('0xa3')](_0x4e4fc4);ut[_0x7cca('0xa4')](_0x4e4fc4,0x5,_0x7cca('0xc7'));ami[_0x7cca('0x5b')](_0x7cca('0xc8'),ut[_0x7cca('0xa7')](_0x4e4fc4,_0x7cca('0xc9')));rpcDb['createCustomerHistory'](_0x4e4fc4,_0x7cca('0xca'));if(ut[_0x7cca('0xa3')](_0x4e4fc4)>=_0x4c8fa2[_0x7cca('0xaa')]){_0x1529cd=ut[_0x7cca('0xab')](_0x4e4fc4,0xf,_0x7cca('0xac'));rpcDb[_0x7cca('0x96')](_0x1529cd,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x4e4fc4[_0x7cca('0xc6')]>=_0x4c8fa2[_0x7cca('0xcb')]){rpcDb[_0x7cca('0x96')](_0x4e4fc4,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x7cca('0xaf')](ut[_0x7cca('0xb0')](_0x4e4fc4,_0x7cca('0xc6'),_0x4c8fa2['dialBusyRetryFrequency']),_0x4e4fc4[_0x7cca('0xb2')],_0x4e4fc4['activeContact']);}}break;case _0x7cca('0xcc'):_0x4c8fa2[_0x7cca('0xcd')]+=0x1;_0x4e4fc4[_0x7cca('0xce')]+=0x1;_0x4e4fc4['countglobal']=ut[_0x7cca('0xa3')](_0x4e4fc4);ut['logCustomer'](_0x4e4fc4,0x3,'NoAnswer');ami[_0x7cca('0x5b')](_0x7cca('0xcf'),ut['buildObj'](_0x4e4fc4,_0x7cca('0xd0')));rpcDb[_0x7cca('0x92')](_0x4e4fc4,_0x7cca('0xd1'));if(ut['totalGlobal'](_0x4e4fc4)>=_0x4c8fa2[_0x7cca('0xaa')]){_0x1529cd=ut[_0x7cca('0xab')](_0x4e4fc4,0xf,_0x7cca('0xac'));rpcDb[_0x7cca('0x96')](_0x1529cd,_0x7cca('0xd2'));}else{if(_0x4e4fc4[_0x7cca('0xce')]>=_0x4c8fa2[_0x7cca('0xd3')]){rpcDb[_0x7cca('0x96')](_0x4e4fc4,_0x7cca('0xd1'));}else{rpcDb[_0x7cca('0xaf')](ut[_0x7cca('0xb0')](_0x4e4fc4,_0x7cca('0xce'),_0x4c8fa2[_0x7cca('0xd4')]),_0x4e4fc4[_0x7cca('0xb2')],_0x4e4fc4[_0x7cca('0xb3')]);}}break;case _0x7cca('0xd5'):_0x4c8fa2['outboundCongestionCallsDay']+=0x1;_0x4e4fc4[_0x7cca('0xd6')]+=0x1;_0x4e4fc4[_0x7cca('0xa2')]=ut[_0x7cca('0xa3')](_0x4e4fc4);ut['logCustomer'](_0x4e4fc4,0x8,_0x7cca('0xd7'));ami[_0x7cca('0x5b')](_0x7cca('0xd8'),ut[_0x7cca('0xa7')](_0x4e4fc4,_0x7cca('0xd9')));rpcDb[_0x7cca('0x92')](_0x4e4fc4,_0x7cca('0xda'));if(ut['totalGlobal'](_0x4e4fc4)>=_0x4c8fa2[_0x7cca('0xaa')]){_0x1529cd=ut[_0x7cca('0xab')](_0x4e4fc4,0xf,_0x7cca('0xac'));rpcDb['createCustomerFinal'](_0x1529cd,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x4e4fc4['countcongestionretry']>=_0x4c8fa2[_0x7cca('0xdb')]){rpcDb[_0x7cca('0x96')](_0x4e4fc4,_0x7cca('0xda'));}else{rpcDb[_0x7cca('0xaf')](ut['scheduledAt'](_0x4e4fc4,_0x7cca('0xd6'),_0x4c8fa2[_0x7cca('0xdc')]),_0x4e4fc4[_0x7cca('0xb2')],_0x4e4fc4['activeContact']);}}break;case _0x7cca('0xdd'):_0x4c8fa2[_0x7cca('0x3e')]+=0x1;_0x4e4fc4['countagentrejectretry']+=0x1;_0x4e4fc4[_0x7cca('0xa2')]=ut[_0x7cca('0xa3')](_0x4e4fc4);ut[_0x7cca('0xa4')](_0x4e4fc4,0x14,_0x7cca('0xde'));ami[_0x7cca('0x5b')](_0x7cca('0xdf'),ut[_0x7cca('0xa7')](_0x4e4fc4,_0x7cca('0xe0')));rpcDb[_0x7cca('0x92')](_0x4e4fc4,_0x7cca('0xe1'));if(ut[_0x7cca('0xa3')](_0x4e4fc4)>=_0x4c8fa2[_0x7cca('0xaa')]){_0x1529cd=ut[_0x7cca('0xab')](_0x4e4fc4,0x14,_0x7cca('0xde'));rpcDb[_0x7cca('0x96')](_0x1529cd,_0x7cca('0xe2'));}else{if(_0x4e4fc4['countagentrejectretry']>=_0x4c8fa2[_0x7cca('0xe3')]){rpcDb['createCustomerFinal'](_0x4e4fc4,_0x7cca('0xe2'));}else{rpcDb[_0x7cca('0xaf')](ut[_0x7cca('0xb0')](_0x4e4fc4,_0x7cca('0xe4'),_0x4c8fa2[_0x7cca('0xe5')]),_0x4e4fc4[_0x7cca('0xb2')],_0x4e4fc4['activeContact']);}}break;case'ABANDONED':_0x4c8fa2[_0x7cca('0x40')]+=0x1;_0x4e4fc4[_0x7cca('0xe6')]+=0x1;_0x4e4fc4[_0x7cca('0xa2')]=ut[_0x7cca('0xa3')](_0x4e4fc4);ut[_0x7cca('0xa4')](_0x4e4fc4,0xb,_0x7cca('0xe7'));rpcDb[_0x7cca('0x92')](_0x4e4fc4,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x4e4fc4)>=_0x4c8fa2[_0x7cca('0xaa')]){_0x1529cd=ut[_0x7cca('0xab')](_0x4e4fc4,0xf,'Global');rpcDb[_0x7cca('0x96')](_0x1529cd,_0x7cca('0xe8'));}else{if(_0x4e4fc4['countabandonedetry']>=_0x4c8fa2[_0x7cca('0xe9')]){rpcDb[_0x7cca('0x96')](_0x4e4fc4,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x7cca('0xaf')](ut[_0x7cca('0xb0')](_0x4e4fc4,'countabandonedretry',_0x4c8fa2['dialAbandonedRetryFrequency']),_0x4e4fc4[_0x7cca('0xb2')],_0x4e4fc4['activeContact']);}}break;case'18':_0x4c8fa2[_0x7cca('0x3f')]+=0x1;_0x4e4fc4[_0x7cca('0xea')]+=0x1;_0x4e4fc4[_0x7cca('0xa2')]=ut[_0x7cca('0xa3')](_0x4e4fc4);ut[_0x7cca('0xa4')](_0x4e4fc4,0x12,_0x4dafb0[_0x7cca('0xeb')]||_0x4dafb0[_0x7cca('0xec')]);ami['emit'](_0x7cca('0xed'),ut[_0x7cca('0xa7')](_0x4e4fc4,'amd'));rpcDb[_0x7cca('0x92')](_0x4e4fc4,_0x7cca('0xee'));if(ut[_0x7cca('0xa3')](_0x4e4fc4)>=_0x4c8fa2[_0x7cca('0xaa')]){_0x1529cd=ut[_0x7cca('0xab')](_0x4e4fc4,0xf,_0x7cca('0xac'));rpcDb[_0x7cca('0x96')](_0x1529cd,_0x7cca('0xee'));}else{rpcDb[_0x7cca('0x96')](_0x4e4fc4,_0x7cca('0xee'));}delete this[_0x7cca('0x15')][_0x4dafb0[_0x7cca('0xb4')]];break;case'19':_0x4c8fa2[_0x7cca('0x3f')]+=0x1;_0x4e4fc4[_0x7cca('0xa2')]=ut[_0x7cca('0xa3')](_0x4e4fc4);ut[_0x7cca('0xa4')](_0x4e4fc4,0x13,_0x4dafb0[_0x7cca('0xeb')]||_0x4dafb0['dialstatus']);ami[_0x7cca('0x5b')](_0x7cca('0xed'),ut[_0x7cca('0xa7')](_0x4e4fc4,_0x7cca('0xef')));rpcDb[_0x7cca('0x92')](_0x4e4fc4,_0x7cca('0xf0'));if(ut[_0x7cca('0xa3')](_0x4e4fc4)>=_0x4c8fa2['dialGlobalMaxRetry']){_0x1529cd=ut[_0x7cca('0xab')](_0x4e4fc4,0xf,'Global');rpcDb[_0x7cca('0x96')](_0x1529cd,_0x7cca('0xf0'));}else{rpcDb[_0x7cca('0x96')](_0x4e4fc4,_0x7cca('0xf0'));}delete this['actions'][_0x4dafb0[_0x7cca('0xb4')]];break;default:if(_0x4e4fc4[_0x7cca('0x6f')]){ut[_0x7cca('0x7c')](_0x4c8fa2,_0x7cca('0xf1'));ut[_0x7cca('0xf2')](_0x7cca('0xf3')+_0x4c8fa2['name'],_0x4dafb0);}_0x4c8fa2[_0x7cca('0x3f')]+=0x1;_0x4e4fc4[_0x7cca('0xa2')]=ut[_0x7cca('0xa3')](_0x4e4fc4);ut[_0x7cca('0xa4')](_0x4e4fc4,0xc,_0x4dafb0[_0x7cca('0xeb')]||_0x4dafb0['dialstatus']);rpcDb[_0x7cca('0x92')](_0x4e4fc4,_0x7cca('0xf4'));if(ut['totalGlobal'](_0x4e4fc4)>=_0x4c8fa2[_0x7cca('0xaa')]){_0x1529cd=ut[_0x7cca('0xab')](_0x4e4fc4,0xf,'Global');rpcDb['createCustomerFinal'](_0x1529cd,_0x7cca('0xf5'));}else{rpcDb[_0x7cca('0x96')](_0x4e4fc4,_0x7cca('0xf5'));}delete this[_0x7cca('0x15')][_0x4dafb0[_0x7cca('0xb4')]];}if(!(_0x4e4fc4[_0x7cca('0x6f')]&&_0x451f2d==='16')){ut['updateOriginated'](_0x4c8fa2,'[callProgressDetectingCustomer]');logger[_0x7cca('0x58')]('[originated][decrement][callProgressDetectingCustomer]',_0x4e4fc4[_0x7cca('0xb7')],'\x20Queue',_0x4c8fa2[_0x7cca('0x4f')],_0x7cca('0x6c'),_0x4c8fa2[_0x7cca('0x4a')]);}if(_0x451f2d!==_0x7cca('0xb5')){delete this[_0x7cca('0x15')][_0x4dafb0[_0x7cca('0xb4')]];delete this[_0x7cca('0x15')][_0x4dafb0[_0x7cca('0xf6')]];}}};Preview['prototype'][_0x7cca('0xf7')]=function(_0x52c0cf,_0x4ffac5,_0x42379e){if(_[_0x7cca('0xf8')](_0x4ffac5)&&_0x7cca('0xf9')!==typeof _0x4ffac5){return;}if(_[_0x7cca('0xf8')](_0x42379e)&&_0x7cca('0xf9')!==typeof _0x42379e){return;}switch(_0x42379e[_0x7cca('0xfa')]){case'0':ut['logAgent'](_0x52c0cf,0x0,_0x7cca('0xa5'));rpcDb[_0x7cca('0xfb')](_0x52c0cf,_0x7cca('0xfc'));break;case'3':ut[_0x7cca('0xfd')](_0x52c0cf,0x3,_0x7cca('0xfe'));rpcDb[_0x7cca('0xfb')](_0x52c0cf,_0x7cca('0xff'));break;case'5':ut[_0x7cca('0xfd')](_0x52c0cf,0x5,'Busy');rpcDb[_0x7cca('0xfb')](_0x52c0cf,_0x7cca('0x100'));break;case'8':ut[_0x7cca('0xfd')](_0x52c0cf,0x8,'Congestion');rpcDb[_0x7cca('0xfb')](_0x52c0cf,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x7cca('0xfd')](_0x52c0cf,0x16,_0x7cca('0x101'));rpcDb['createAgentHistory'](_0x52c0cf,_0x7cca('0x102'));break;default:ut[_0x7cca('0xfd')](_0x52c0cf,0xc,_0x42379e[_0x7cca('0xfa')]);rpcDb[_0x7cca('0xfb')](_0x52c0cf,'[callProgressDetectingAgent][logCongestion]');}ut[_0x7cca('0x7a')](_0x4ffac5,_0x7cca('0x103'));logger['info'](_0x7cca('0x104'),_0x52c0cf['uniqueid'],_0x7cca('0xb8'),_0x4ffac5[_0x7cca('0x4f')],_0x7cca('0x6c'),_0x4ffac5['originated']);delete this['actions'][_0x52c0cf[_0x7cca('0xb7')]];};Preview[_0x7cca('0xe')][_0x7cca('0x105')]=function(_0x3fe10e,_0x5e8a06,_0x4d1dfc,_0xb3e7fe,_0x4dd1e8){var _0x3ad770=this;return new BPromise(function(_0x246071,_0xee9035){if(_[_0x7cca('0x69')](_0x5e8a06)||_['isNil'](_0x5e8a06[_0x7cca('0x106')])||_[_0x7cca('0x69')](_0x5e8a06[_0x7cca('0x106')][_0x7cca('0x107')])||_[_0x7cca('0x69')](_0x5e8a06[_0x7cca('0x73')])){_0xee9035(ut[_0x7cca('0x49')](_0x7cca('0x108'),_0xb3e7fe,_0x4dd1e8));return;}var _0x4a2232=uuid['v4']();var _0x1acdb4=_0x3ad770['campaignsPreview'][_0x5e8a06[_0x7cca('0x6b')][_0x7cca('0x4f')]];var _0x371c52=_0x4d1dfc?_0x3ad770[_0x7cca('0x109')][_0x4d1dfc]['id']:undefined;_0x3ad770[_0x7cca('0x15')][_0x4a2232]=new Action(_0x5e8a06,_0x1acdb4,_0x4a2232,_0x4d1dfc,_0x371c52);var _0x56d04f=_0x3ad770[_0x7cca('0x15')][_0x4a2232];_0x56d04f[_0x7cca('0xb2')]=_0xb3e7fe;_0x56d04f[_0x7cca('0xb3')]=_0x4dd1e8;_0x56d04f['lookAgent']=_0x4d1dfc;if(_[_0x7cca('0x10a')](_0x3fe10e)){_0x3ad770[_0x7cca('0x10b')](_0x56d04f,_0x1acdb4,_0x5e8a06,_0x4d1dfc)[_0x7cca('0x83')](function(_0x2698cd){logger[_0x7cca('0x58')](_0x7cca('0x10c'),_0x7cca('0x10d')+_0x56d04f['queue']+_0x7cca('0x10e')+_0x56d04f[_0x7cca('0x10f')],JSON[_0x7cca('0x53')](_0x2698cd));ami['emit'](_0x7cca('0x110'),ut[_0x7cca('0xa7')](_0x56d04f,_0x7cca('0x111'),_0x3ad770['campaignsPreview'][_0x56d04f[_0x7cca('0x6d')]]));_0x246071(ut[_0x7cca('0x49')](_0x7cca('0x112')));})[_0x7cca('0x78')](function(_0x7553cd){ut['logger'](_0x7cca('0x113'),_0x7553cd);_0xee9035(ut[_0x7cca('0x49')](_0x7cca('0x114'),_0xb3e7fe,_0x4dd1e8));});}else{_0x1acdb4['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x56d04f);rpcDb['createHistory'](_0x56d04f,'[Blacklist][error]');delete _0x3ad770['actions'][_0x4a2232];_0xee9035(ut[_0x7cca('0x49')](_0x7cca('0x115'),_0xb3e7fe,_0x4dd1e8));}});};Preview['prototype'][_0x7cca('0x9b')]=function(_0x69394){return!_[_0x7cca('0x69')](_0x69394)&&!_[_0x7cca('0x69')](_0x69394['name'])&&!_[_0x7cca('0x69')](_0x69394[_0x7cca('0x50')])&&_0x69394[_0x7cca('0x50')]&&!_[_0x7cca('0x69')](this['trunks'][util[_0x7cca('0x55')](_0x7cca('0x116'),_0x69394[_0x7cca('0x4f')])])&&!_[_0x7cca('0x69')](this[_0x7cca('0x14')][util[_0x7cca('0x55')](_0x7cca('0x116'),_0x69394[_0x7cca('0x4f')])][_0x7cca('0x76')])&&(this[_0x7cca('0x14')][util['format'](_0x7cca('0x116'),_0x69394[_0x7cca('0x4f')])][_0x7cca('0x76')]===_0x7cca('0x117')||this['trunks'][util[_0x7cca('0x55')](_0x7cca('0x116'),_0x69394[_0x7cca('0x4f')])][_0x7cca('0x76')]===_0x7cca('0x118'));};Preview[_0x7cca('0xe')]['run']=function(_0x5d4223,_0x3005e8){var _0xa93621=this;return new BPromise(function(_0xafeaf0,_0x31d61b){_0xa93621[_0x7cca('0x119')](_0x5d4223,_0x3005e8)[_0x7cca('0x83')](function(_0x1a2a98){_0xafeaf0(_['pick'](_0x1a2a98,[_0x7cca('0x49')]));})[_0x7cca('0x78')](function(_0x45883e){if(_0x45883e[_0x7cca('0x11a')]){rpcDb[_0x7cca('0x11b')](_0x5d4223);}if(_0x45883e[_0x7cca('0x50')]){rpcDb[_0x7cca('0x8c')](_0x5d4223);}_0x31d61b(_[_0x7cca('0x70')](_0x45883e,[_0x7cca('0x49')]));});});};Preview[_0x7cca('0xe')][_0x7cca('0x119')]=function(_0x2d6e5b,_0x5507f6){var _0x4c047d=this;return new BPromise(function(_0x4b9c7d,_0xa114d4){var _0x8914ee,_0x1234a1;rpcDb[_0x7cca('0x11c')](_0x2d6e5b)[_0x7cca('0x83')](function(_0x1e6621){if(!_[_0x7cca('0x69')](_0x1e6621[0x0])){_0x1234a1=_0x1e6621[0x0]['recallme']?![]:!![];_0x8914ee=_0x1e6621[0x0][_0x7cca('0x11d')]?!![]:![];_0x8914ee=_0x5507f6?!![]:_0x8914ee;}var _0x4d99d1=_0x4c047d['validateContact'](_0x1e6621);if(_0x4d99d1['isValid']){rpcDb[_0x7cca('0x11e')](_['pick'](_0x1e6621[0x0],['VoiceQueueId','Contact.phone']))[_0x7cca('0x83')](function(_0x469c72){_0x4c047d[_0x7cca('0x105')](_0x469c72,_0x1e6621[0x0],_0x5507f6,_0x1234a1,_0x8914ee)[_0x7cca('0x83')](function(_0xa831e9){_0x4b9c7d(_0xa831e9);})[_0x7cca('0x78')](function(_0x2a255d){_0xa114d4(_0x2a255d);});})[_0x7cca('0x78')](function(_0x34d846){ut[_0x7cca('0x5f')](_0x7cca('0x11f'),_0x34d846);_0xa114d4(ut['message'](_0x7cca('0x120'),_0x1234a1,_0x8914ee));});}else{_0xa114d4(ut['message'](_0x4d99d1[_0x7cca('0x49')],_0x1234a1,_0x8914ee));}})[_0x7cca('0x78')](function(_0x1664b7){ut[_0x7cca('0x5f')](_0x7cca('0x121'),_0x1664b7);_0xa114d4(ut[_0x7cca('0x49')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x7cca('0xe')][_0x7cca('0x122')]=function(_0x4436ef){if(_['isNil'](_0x4436ef)||_[_0x7cca('0x10a')](_0x4436ef)||!_[_0x7cca('0x69')](_0x4436ef[0x0][_0x7cca('0x88')])&&_[_0x7cca('0x69')](_0x4436ef[0x0][_0x7cca('0x88')]['name'])){ut[_0x7cca('0x5f')](_0x7cca('0x123'),_0x4436ef);return{'isValid':![],'message':_0x7cca('0x124')};}var _0x482d2c=this[_0x7cca('0x13')][_0x4436ef[0x0]['Queue'][_0x7cca('0x4f')]];_0x482d2c[_0x7cca('0x49')]=_0x7cca('0x9e');if(_[_0x7cca('0x69')](_0x482d2c)){ut['logger'](_0x7cca('0x125'),_0x482d2c);return{'isValid':![],'message':_0x7cca('0x126')};}if(!this['isTrunkReachable'](_0x482d2c[_0x7cca('0x4e')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x7cca('0x127')+_0x482d2c[_0x7cca('0x4f')]+_0x7cca('0x128'));if(!this[_0x7cca('0x9b')](_0x482d2c[_0x7cca('0x9c')])){ut[_0x7cca('0x5f')](_0x7cca('0x129'),_0x482d2c[_0x7cca('0x4f')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x482d2c[_0x7cca('0x32')])){ut[_0x7cca('0x5f')](_0x7cca('0x12a'),_0x482d2c['name']+_0x7cca('0x12b'));return{'isValid':![],'message':_0x7cca('0x127')+_0x482d2c[_0x7cca('0x4f')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x7cca('0x12c')};};Preview[_0x7cca('0xe')][_0x7cca('0x10b')]=function(_0x3ee757,_0x4baa4a,_0x18292a,_0x147f2f){var _0x43f855=this;return new BPromise(function(_0x2a447e,_0x201f55){var _0x110399=_0x3ee757[_0x7cca('0xb7')];var _0xc4ac16=_0x43f855[_0x7cca('0x9b')](_0x4baa4a[_0x7cca('0x4e')])?util[_0x7cca('0x55')](_0x7cca('0x12d'),_0x4baa4a[_0x7cca('0x4e')][_0x7cca('0x4f')],_['isNil'](_0x4baa4a[_0x7cca('0x35')])?'':_0x4baa4a[_0x7cca('0x35')][_0x7cca('0x12e')]()||'',_0x4baa4a[_0x7cca('0x12f')]>0x0?_0x18292a[_0x7cca('0x106')][_0x7cca('0x107')][_0x7cca('0x130')](_0x4baa4a[_0x7cca('0x12f')]):_0x18292a[_0x7cca('0x106')]['phone']):util[_0x7cca('0x55')](_0x7cca('0x12d'),_[_0x7cca('0x69')](_0x4baa4a[_0x7cca('0x9c')])?_0x4baa4a[_0x7cca('0x4e')][_0x7cca('0x4f')]:_0x4baa4a['TrunkBackup'][_0x7cca('0x4f')],_['isNil'](_0x4baa4a['dialPrefix'])?'':_0x4baa4a[_0x7cca('0x35')]['trim']()||'',_0x4baa4a['dialCutDigit']>0x0?_0x18292a[_0x7cca('0x106')][_0x7cca('0x107')][_0x7cca('0x130')](_0x4baa4a[_0x7cca('0x12f')]):_0x18292a[_0x7cca('0x106')][_0x7cca('0x107')]);var _0x40eb6f=_0x43f855[_0x7cca('0x9b')](_0x4baa4a[_0x7cca('0x4e')])?ut['getCallerId'](_0x4baa4a[_0x7cca('0x4e')][_0x7cca('0x51')],_0x4baa4a[_0x7cca('0x131')],_0x4baa4a[_0x7cca('0x132')]>0x0?ut[_0x7cca('0x133')](_0x4baa4a[_0x7cca('0x34')],_0x4baa4a[_0x7cca('0x132')]):_0x4baa4a[_0x7cca('0x34')]):ut[_0x7cca('0x134')](_[_0x7cca('0x69')](_0x4baa4a[_0x7cca('0x9c')])?_0x4baa4a['Trunk'][_0x7cca('0x51')]:_0x4baa4a['TrunkBackup'][_0x7cca('0x51')],_0x4baa4a[_0x7cca('0x131')],_0x4baa4a['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x4baa4a[_0x7cca('0x34')],_0x4baa4a[_0x7cca('0x132')]):_0x4baa4a[_0x7cca('0x34')]);if(_0x40eb6f){_0x3ee757[_0x7cca('0x135')]=ut[_0x7cca('0x136')](_0x40eb6f);_0x3ee757[_0x7cca('0x137')]=ut[_0x7cca('0x138')](_0x40eb6f);}var _0x27564d=ut[_0x7cca('0x139')](_0x4baa4a,_0x18292a,_0xc4ac16,_0x40eb6f,_0x110399,_0x3ee757);_[_0x7cca('0x13a')](_0x3ee757,ut[_0x7cca('0x13b')](_0x27564d));_0x3ee757['starttime']=moment()[_0x7cca('0x55')](_0x7cca('0x8e'));ami[_0x7cca('0x75')](ut['variablesAction'](_0x3ee757,_0x4baa4a,_0x27564d,_0x3ee757['activeContact'],_0x147f2f))[_0x7cca('0x83')](function(_0x1508b5){_0x4baa4a['originated']+=0x1;logger['info']('[originated][increment]',_0x110399,_0x7cca('0xb8'),_0x4baa4a['name'],_0x7cca('0x6c'),_0x4baa4a[_0x7cca('0x4a')]);_0x2a447e(_0x1508b5);})[_0x7cca('0x78')](function(_0x16310a){ut['logAgent'](_0x3ee757,0xe,_0x7cca('0x13c'));rpcDb[_0x7cca('0xfb')](_0x3ee757,_0x7cca('0x13d'));_0x201f55(_0x16310a);});});};Preview[_0x7cca('0xe')][_0x7cca('0x1e')]=function(_0x4eab44){if(this[_0x7cca('0x15')][_0x4eab44['linkedid']]){this['actions'][_0x4eab44[_0x7cca('0xb4')]][_0x7cca('0x77')]=_0x4eab44[_0x7cca('0x77')];}};Preview[_0x7cca('0xe')]['syncOriginateResponse']=function(_0x91ac7){var _0xfd65c9=this;var _0x347707=this[_0x7cca('0x15')][_0x91ac7['actionid']];if(_0x347707){if(_0x347707[_0x7cca('0x13e')]&&this[_0x7cca('0x109')][_0x347707[_0x7cca('0x13e')]]){ut[_0x7cca('0x13f')](_0x347707,this[_0x7cca('0x109')][_0x347707[_0x7cca('0x13e')]][_0x7cca('0x4f')],this[_0x7cca('0x109')][_0x347707['lookAgent']]['id']);}var _0x3a87c5=_[_0x7cca('0x140')](_0x347707);_0x3a87c5[_0x7cca('0x141')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x1dc092=_0xfd65c9[_0x7cca('0x13')][_0x347707[_0x7cca('0x6d')]];if(ut[_0x7cca('0x142')](_0x91ac7[_0x7cca('0x143')])){if(_0x347707[_0x7cca('0xb2')]){rpcDb['unlockContact'](_0x347707[_0x7cca('0x10f')]);}if(_0x347707[_0x7cca('0xb3')]){rpcDb[_0x7cca('0x8c')](_0x347707[_0x7cca('0x10f')]);}ami[_0x7cca('0x5b')](_0x7cca('0x144'),ut[_0x7cca('0xa7')](_0x347707,'rejected',this[_0x7cca('0x13')][_0x347707[_0x7cca('0x6d')]]));this['callProgressDetectingAgent'](_0x3a87c5,_0x1dc092,_0x91ac7);}else{_0x347707[_0x7cca('0x8d')]=moment()[_0x7cca('0x55')](_0x7cca('0x8e'));ut['logAgent'](_0x3a87c5,0x4,_0x7cca('0xc1'));rpcDb[_0x7cca('0xfb')](_0x3a87c5,_0x7cca('0x145'));}}};Preview[_0x7cca('0xe')]['syncHangup']=function(_0x11127f){var _0x4ecb47=this;var _0x5565e7=this[_0x7cca('0x15')][_0x11127f[_0x7cca('0xb4')]];var _0x565e6b;if(_0x5565e7){_0x565e6b=this[_0x7cca('0x13')][_0x5565e7[_0x7cca('0x6d')]];logger[_0x7cca('0x58')](_0x7cca('0x146'),_0x11127f[_0x7cca('0xb4')],_0x7cca('0xb8'),_0x565e6b[_0x7cca('0x4f')],_0x7cca('0x6e'),_0x565e6b['pTalking']);}if(this['actions'][_0x11127f[_0x7cca('0xb4')]]&&_0x11127f[_0x7cca('0xb4')]!==_0x11127f[_0x7cca('0xb7')]){if(_0x11127f[_0x7cca('0x147')]==='16'&&this[_0x7cca('0x15')][_0x11127f[_0x7cca('0xb4')]][_0x7cca('0x6f')]){this[_0x7cca('0x9f')](_0x11127f,_0x11127f[_0x7cca('0xb4')],_0x11127f[_0x7cca('0x147')]);}else if(this[_0x7cca('0x15')][_0x11127f[_0x7cca('0xb4')]][_0x7cca('0x6f')]){logger[_0x7cca('0x58')](_0x7cca('0x148'),_0x11127f[_0x7cca('0xb4')],_0x11127f['cause'],'\x20Queue',_0x565e6b[_0x7cca('0x4f')],_0x7cca('0x6e'),_0x565e6b[_0x7cca('0x29')]);this[_0x7cca('0x9f')](_0x11127f,_0x11127f['linkedid'],_0x11127f[_0x7cca('0x147')]);}}else if(_0x5565e7&&_[_0x7cca('0x69')](_0x5565e7[_0x7cca('0x149')])&&_0x565e6b[_0x7cca('0x14a')]&&_0x11127f[_0x7cca('0xb4')]===_0x11127f[_0x7cca('0xb7')]&&_['isNil'](_0x11127f[_0x7cca('0xfa')])&&_0x11127f[_0x7cca('0x147')]==='16'&&_0x11127f[_0x7cca('0x14b')]==='6'&&_[_0x7cca('0xf8')](_0x5565e7['transfer'])){if(_0x5565e7[_0x7cca('0xb2')]){rpcDb['unlockContact'](_0x5565e7[_0x7cca('0x10f')]);}if(_0x5565e7[_0x7cca('0xb3')]){rpcDb['disableContact'](_0x5565e7[_0x7cca('0x10f')]);}_0x11127f[_0x7cca('0xfa')]='22';this[_0x7cca('0xf7')](_0x5565e7,_0x565e6b,_0x11127f);}else if(_0x5565e7&&_0x5565e7[_0x7cca('0x14c')]){if(_0x11127f[_0x7cca('0x147')]==='16'&&this['actions'][_0x11127f['linkedid']]['dialAnswer']){logger[_0x7cca('0x58')](_0x7cca('0x14d'),_0x11127f[_0x7cca('0xb4')],_0x11127f[_0x7cca('0x147')],_0x7cca('0xb8'),_0x565e6b[_0x7cca('0x4f')],_0x7cca('0x6e'),_0x565e6b[_0x7cca('0x29')]);this[_0x7cca('0x9f')](_0x11127f,_0x11127f[_0x7cca('0xb4')],_0x11127f['cause']);}else if(this[_0x7cca('0x15')][_0x11127f['linkedid']]['dialAnswer']){logger[_0x7cca('0x58')](_0x7cca('0x148'),_0x11127f[_0x7cca('0xb4')],_0x11127f['cause'],_0x7cca('0xb8'),_0x565e6b['name'],'pTalking:\x20',_0x565e6b[_0x7cca('0x29')]);this[_0x7cca('0x9f')](_0x11127f,_0x11127f[_0x7cca('0xb4')],_0x11127f[_0x7cca('0x147')]);}}};Preview[_0x7cca('0xe')][_0x7cca('0x14e')]=function(_0x3fd9fb){if(this[_0x7cca('0x15')][_0x3fd9fb['destlinkedid']]&&_0x3fd9fb[_0x7cca('0xf6')]!==_0x3fd9fb[_0x7cca('0x14f')]){this[_0x7cca('0x9f')](_0x3fd9fb,_0x3fd9fb['destlinkedid'],_0x3fd9fb[_0x7cca('0xec')]);}};Preview[_0x7cca('0xe')]['syncHangupRequest']=function(_0x70092c){if(this[_0x7cca('0x15')][_0x70092c[_0x7cca('0xb4')]]&&_0x70092c[_0x7cca('0xb4')]!==_0x70092c['uniqueid']&&!this[_0x7cca('0x15')][_0x70092c[_0x7cca('0xb4')]][_0x7cca('0x6f')]){if(_0x70092c[_0x7cca('0x147')]==='1'){this[_0x7cca('0x9f')](_0x70092c,_0x70092c[_0x7cca('0xb4')],_0x70092c[_0x7cca('0x147')]);}}};Preview[_0x7cca('0xe')][_0x7cca('0x150')]=function(_0xc1f13e,_0x508b1c,_0x397eb7){if(this[_0x7cca('0x15')][_0xc1f13e]){if(_[_0x7cca('0x69')](this[_0x7cca('0x15')][_0xc1f13e][_0x7cca('0x151')])){this[_0x7cca('0x15')][_0xc1f13e]['variables']={};}this[_0x7cca('0x15')][_0xc1f13e][_0x7cca('0x151')][_0x508b1c]=_0x397eb7;}};Preview[_0x7cca('0xe')][_0x7cca('0x152')]=function(_0x44fb88){try{if(!_[_0x7cca('0x69')](_0x44fb88)){if(ut[_0x7cca('0x153')](_[_0x7cca('0x154')](_0x44fb88['variable'])[0x0])){this['addVariable'](_0x44fb88[_0x7cca('0xb7')],_[_0x7cca('0x154')](_0x44fb88[_0x7cca('0x155')])[0x0],_0x44fb88['value']);}}}catch(_0x102a94){logger[_0x7cca('0x156')](_0x7cca('0x157'),util[_0x7cca('0x158')](_0x102a94,{'showHidden':![],'depth':null}));}};Preview[_0x7cca('0xe')][_0x7cca('0x159')]=function(_0x4731de){if(_0x4731de){if(this['actions'][_0x4731de[_0x7cca('0x15a')]]){this[_0x7cca('0x15')][_0x4731de[_0x7cca('0x15a')]]['transfer']=!![];}}};Preview[_0x7cca('0xe')]['syncBlindTransfer']=function(_0x2c7457){if(_0x2c7457){if(this[_0x7cca('0x15')][_0x2c7457[_0x7cca('0x15b')]]){this[_0x7cca('0x15')][_0x2c7457['transfererlinkedid']][_0x7cca('0x14c')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
index 9378e67..231ed53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x676f=['COMPLETED','create','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','then','resolve','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','active','rescheduleContact','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo'];(function(_0x66e2cf,_0x58eae6){var _0x2c7c91=function(_0x998579){while(--_0x998579){_0x66e2cf['push'](_0x66e2cf['shift']());}};_0x2c7c91(++_0x58eae6);}(_0x676f,0x1d0));var _0xf676=function(_0x498cc5,_0x5989b1){_0x498cc5=_0x498cc5-0x0;var _0x57c378=_0x676f[_0x498cc5];return _0x57c378;};'use strict';var util=require(_0xf676('0x0'));var BPromise=require(_0xf676('0x1'));var logger=require(_0xf676('0x2'))(_0xf676('0x3'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xf676('0x4'));var cmHopperHistory=require(_0xf676('0x5'));var cmHopperBlack=require(_0xf676('0x6'));var voiceQueueRt=require(_0xf676('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xf676('0x8'));function loggerCatch(_0xced47f){return function(_0x21aa0d){logger[_0xf676('0x9')](_0xced47f,util[_0xf676('0xa')](_0x21aa0d,{'showHidden':![],'depth':null}));};}function create(_0x219d26){return BPromise['resolve']()['then'](cmHopperHistory[_0xf676('0xb')](_0x219d26))[_0xf676('0xc')](loggerCatch(_0xf676('0xd')));}function createAgent(_0x4159af){return BPromise['resolve']()[_0xf676('0xe')](agentReportPreview[_0xf676('0xb')](_0x4159af))[_0xf676('0xc')](loggerCatch(_0xf676('0xd')));}function moveContact(_0x3acca6){return BPromise[_0xf676('0xf')]()['then'](cmHopper['moveContactManagedDialer'](_0x3acca6,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xf676('0x10')]=function(_0x4ce3b7){return BPromise[_0xf676('0xf')]()['then'](cmHopperBlack[_0xf676('0x10')](_0x4ce3b7))[_0xf676('0xc')](loggerCatch(_0xf676('0x11')));};exports[_0xf676('0x12')]=function(_0x21c628){return BPromise[_0xf676('0xf')]()[_0xf676('0xe')](cmHopper['getContactPreview'](_0x21c628))[_0xf676('0xc')](loggerCatch(_0xf676('0x13')));};exports['createHistory']=function(_0x2f3528,_0x325aea){create(_0x2f3528)[_0xf676('0xc')](loggerCatch(_0x325aea));moveContact(_0x2f3528)['catch'](loggerCatch(_0x325aea));};exports['createAgentHistory']=function(_0x157bc6,_0x50088a){createAgent(_0x157bc6)[_0xf676('0xc')](loggerCatch(_0x50088a));};exports[_0xf676('0x14')]=function(_0x5fb078,_0x29b6af){create(_0x5fb078)[_0xf676('0xc')](loggerCatch(_0x29b6af));};exports[_0xf676('0x15')]=function(_0xa7a50c,_0x5ec905){moveContact(_0xa7a50c)['catch'](loggerCatch(_0x5ec905));};exports['rescheduleContact']=function(_0x217115,_0x7185dc,_0x18cf40){if(_0x7185dc){_0x217115['UserId']=null;}if(_0x18cf40){_0x217115[_0xf676('0x16')]=![];}return BPromise[_0xf676('0xf')]()['then'](cmHopper[_0xf676('0x17')](_0x217115))[_0xf676('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xf676('0x18')]=function(_0x586013){return BPromise['resolve']()[_0xf676('0xe')](cmHopper[_0xf676('0x18')](_0x586013))[_0xf676('0xc')](loggerCatch(_0xf676('0x19')));};exports[_0xf676('0x1a')]=function(_0x211a9c){return BPromise['resolve']()[_0xf676('0xe')](cmHopper[_0xf676('0x1a')]({'UserId':null},_0x211a9c,0x1))['catch'](loggerCatch(_0xf676('0x1b')));};exports[_0xf676('0x1c')]=function(_0x3d638b){return BPromise[_0xf676('0xf')]()[_0xf676('0xe')](cmHopper['unlockContact']({'active':![]},_0x3d638b,0x1))[_0xf676('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0xf676('0x1d')]=function(_0x255a2f){var _0xef5b3c={};_0xef5b3c[_0xf676('0x1e')]=_0x255a2f[_0xf676('0x1e')];_0xef5b3c[_0xf676('0x1f')]=_0x255a2f['uniqueid'];_0xef5b3c[_0xf676('0x20')]=_0x255a2f[_0xf676('0x20')];_0xef5b3c['calleridname']=_0x255a2f[_0xf676('0x21')];_0xef5b3c[_0xf676('0x22')]=_0x255a2f['queue'];_0xef5b3c['queuecallerjoinAt']=_0x255a2f['answertime'];_0xef5b3c[_0xf676('0x23')]=_0x255a2f[_0xf676('0x24')];_0xef5b3c[_0xf676('0x25')]=0x1;_0xef5b3c['queuecallercompleteAt']=_0x255a2f['endtime'];_0xef5b3c[_0xf676('0x26')]=_0x255a2f[_0xf676('0x27')];_0xef5b3c[_0xf676('0x28')]=_0xf676('0x29');_0xef5b3c[_0xf676('0x2a')]=_0xf676('0x2b');_0xef5b3c[_0xf676('0x2c')]=0x0;_0xef5b3c['assigned']=0x1;_0xef5b3c[_0xf676('0x2d')]=_0x255a2f['membername'];_0xef5b3c['queuecallerexitreason']=_0xf676('0x2e');return BPromise[_0xf676('0xf')]()[_0xf676('0xe')](voiceQueueReport[_0xf676('0x2f')](_0xef5b3c))[_0xf676('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xf676('0x30')]=function(_0x3312ae,_0x2ce2d0){return BPromise['resolve']()['then'](cmHopper[_0xf676('0x30')](_0x3312ae,_0x2ce2d0))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xf676('0x31')]=function(_0x1aa90d){return BPromise[_0xf676('0xf')]()[_0xf676('0xe')](cmHopper[_0xf676('0x17')](_0x1aa90d,!![],!![]))['catch'](loggerCatch(_0xf676('0x32')));};
\ No newline at end of file
+var _0x3518=['moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20'];(function(_0x26636b,_0xa26759){var _0x3e37bd=function(_0x681ab8){while(--_0x681ab8){_0x26636b['push'](_0x26636b['shift']());}};_0x3e37bd(++_0xa26759);}(_0x3518,0x98));var _0x8351=function(_0x23f3fe,_0x37a19c){_0x23f3fe=_0x23f3fe-0x0;var _0x1b1cb1=_0x3518[_0x23f3fe];return _0x1b1cb1;};'use strict';var util=require(_0x8351('0x0'));var BPromise=require('bluebird');var logger=require(_0x8351('0x1'))(_0x8351('0x2'));var _=require('lodash');var cmHopper=require(_0x8351('0x3'));var cmHopperFinal=require(_0x8351('0x4'));var cmHopperHistory=require(_0x8351('0x5'));var cmHopperBlack=require(_0x8351('0x6'));var voiceQueueRt=require(_0x8351('0x7'));var agentReportPreview=require(_0x8351('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x54c0c5){return function(_0x33ab78){logger[_0x8351('0x9')](_0x54c0c5,util[_0x8351('0xa')](_0x33ab78,{'showHidden':![],'depth':null}));};}function create(_0x3425a4){return BPromise[_0x8351('0xb')]()[_0x8351('0xc')](cmHopperHistory['createHistory'](_0x3425a4))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x293f40){return BPromise[_0x8351('0xb')]()['then'](agentReportPreview[_0x8351('0xd')](_0x293f40))[_0x8351('0xe')](loggerCatch(_0x8351('0xf')));}function moveContact(_0x264019){return BPromise[_0x8351('0xb')]()[_0x8351('0xc')](cmHopper[_0x8351('0x10')](_0x264019,!![]))['catch'](loggerCatch(_0x8351('0x11')));}exports['checkIsBlackList']=function(_0x4fe4ea){return BPromise[_0x8351('0xb')]()[_0x8351('0xc')](cmHopperBlack['checkIsBlackList'](_0x4fe4ea))[_0x8351('0xe')](loggerCatch(_0x8351('0x12')));};exports[_0x8351('0x13')]=function(_0x46ec90){return BPromise[_0x8351('0xb')]()[_0x8351('0xc')](cmHopper['getContactPreview'](_0x46ec90))[_0x8351('0xe')](loggerCatch(_0x8351('0x14')));};exports[_0x8351('0xd')]=function(_0x89572a,_0x945888){create(_0x89572a)[_0x8351('0xe')](loggerCatch(_0x945888));moveContact(_0x89572a)[_0x8351('0xe')](loggerCatch(_0x945888));};exports['createAgentHistory']=function(_0x281dcf,_0x541417){createAgent(_0x281dcf)[_0x8351('0xe')](loggerCatch(_0x541417));};exports['createCustomerHistory']=function(_0x2ee19b,_0x37b0bf){create(_0x2ee19b)[_0x8351('0xe')](loggerCatch(_0x37b0bf));};exports['createCustomerFinal']=function(_0x425250,_0x9ba642){moveContact(_0x425250)[_0x8351('0xe')](loggerCatch(_0x9ba642));};exports[_0x8351('0x15')]=function(_0x26f8d1,_0x1f92a7,_0x5155dc){if(_0x1f92a7){_0x26f8d1[_0x8351('0x16')]=null;}if(_0x5155dc){_0x26f8d1[_0x8351('0x17')]=![];}return BPromise[_0x8351('0xb')]()[_0x8351('0xc')](cmHopper[_0x8351('0x15')](_0x26f8d1))[_0x8351('0xe')](loggerCatch(_0x8351('0x18')));};exports[_0x8351('0x19')]=function(_0x30f187){return BPromise[_0x8351('0xb')]()[_0x8351('0xc')](cmHopper[_0x8351('0x19')](_0x30f187))[_0x8351('0xe')](loggerCatch(_0x8351('0x1a')));};exports[_0x8351('0x1b')]=function(_0x22f70b){return BPromise[_0x8351('0xb')]()[_0x8351('0xc')](cmHopper[_0x8351('0x1b')]({'UserId':null},_0x22f70b,0x1))[_0x8351('0xe')](loggerCatch(_0x8351('0x1c')));};exports[_0x8351('0x1d')]=function(_0x46da65){return BPromise[_0x8351('0xb')]()[_0x8351('0xc')](cmHopper[_0x8351('0x1b')]({'active':![]},_0x46da65,0x1))[_0x8351('0xe')](loggerCatch(_0x8351('0x1e')));};exports['crateCustomerReportQueue']=function(_0x1c5c00){var _0x32ce09={};_0x32ce09[_0x8351('0x1f')]=_0x1c5c00[_0x8351('0x1f')];_0x32ce09[_0x8351('0x20')]=_0x1c5c00[_0x8351('0x20')];_0x32ce09[_0x8351('0x21')]=_0x1c5c00['calleridnum'];_0x32ce09['calleridname']=_0x1c5c00[_0x8351('0x22')];_0x32ce09[_0x8351('0x23')]=_0x1c5c00[_0x8351('0x23')];_0x32ce09[_0x8351('0x24')]=_0x1c5c00['answertime'];_0x32ce09[_0x8351('0x25')]=_0x1c5c00[_0x8351('0x26')];_0x32ce09[_0x8351('0x27')]=0x1;_0x32ce09[_0x8351('0x28')]=_0x1c5c00[_0x8351('0x29')];_0x32ce09[_0x8351('0x2a')]=_0x1c5c00['membername'];_0x32ce09[_0x8351('0x2b')]=_0x8351('0x2c');_0x32ce09[_0x8351('0x2d')]=_0x8351('0x2e');_0x32ce09['holdtime']=0x0;_0x32ce09[_0x8351('0x2f')]=0x1;_0x32ce09[_0x8351('0x30')]=_0x1c5c00[_0x8351('0x31')];_0x32ce09[_0x8351('0x32')]='COMPLETED';return BPromise[_0x8351('0xb')]()[_0x8351('0xc')](voiceQueueReport[_0x8351('0x33')](_0x32ce09))[_0x8351('0xe')](loggerCatch(_0x8351('0x34')));};exports[_0x8351('0x35')]=function(_0x30e8a9,_0x59b745){return BPromise['resolve']()[_0x8351('0xc')](cmHopper[_0x8351('0x35')](_0x30e8a9,_0x59b745))[_0x8351('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x8351('0x36')]=function(_0x370cbb){return BPromise[_0x8351('0xb')]()['then'](cmHopper[_0x8351('0x15')](_0x370cbb,!![],!![]))[_0x8351('0xe')](loggerCatch(_0x8351('0x37')));};
\ No newline at end of file
index 68cbc08..0ae98a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa597=['filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','util','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','logger','info','error','inspect','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','updatedAt','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','logLookAgent','membername','UserId','logCustomer','ringtime','talktime','answertime','Failure','RECALL','originate','channelAgent','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','mandatoryDisposition','uniqueid','agentReadyId','not_inuse','reachable','push','getDiff','CampaignId'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xa597,0xae));var _0x7a59=function(_0x54bc96,_0x20cb68){_0x54bc96=_0x54bc96-0x0;var _0x4685b9=_0xa597[_0x54bc96];return _0x4685b9;};'use strict';var util=require(_0x7a59('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x7a59('0x1'))(_0x7a59('0x2'));var ipAgi=process[_0x7a59('0x3')][_0x7a59('0x4')]||_0x7a59('0x5');function getSeconds(_0xce3f94,_0x3dfc1c){var _0x4a7d79=moment(_0xce3f94)[_0x7a59('0x6')](0x0);var _0x5a259d=moment(_0x3dfc1c)[_0x7a59('0x6')](0x0);return _0x4a7d79[_0x7a59('0x7')](_0x5a259d,_0x7a59('0x8'));}exports['loggerCatch']=function(_0x4f2361){return function(_0x5bd6a1){logger['error'](_0x4f2361,util['inspect'](_0x5bd6a1,{'showHidden':![],'depth':null}));};};exports[_0x7a59('0x9')]=function(_0x316c77,_0x3adc62){logger[_0x7a59('0xa')](_0x316c77,util['inspect'](_0x3adc62,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x221dcb,_0x2826b4){logger[_0x7a59('0xb')](_0x221dcb,util[_0x7a59('0xc')](_0x2826b4,{'showHidden':![],'depth':null}));};exports[_0x7a59('0xd')]=function(_0x300049){return function(_0x6e91de){logger['info'](_0x300049,util[_0x7a59('0xc')](_0x6e91de,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x14f439,_0x5a2ff7,_0x24e5aa){return{'message':_0x14f439,'unlock':_0x5a2ff7,'active':_0x24e5aa};};exports[_0x7a59('0xe')]=function(_0x1931a0,_0x303ce4,_0x34bc09){if(!_[_0x7a59('0xf')](_0x34bc09)&&_0x7a59('0x10')===typeof _0x34bc09&&!_[_0x7a59('0x11')](_0x34bc09)){if(!_[_0x7a59('0xf')](_0x303ce4)&&'string'===typeof _0x303ce4&&!_[_0x7a59('0x11')](_0x303ce4)){return util[_0x7a59('0x12')](_0x7a59('0x13'),_0x303ce4,_0x34bc09);}return util[_0x7a59('0x12')](_0x7a59('0x13'),_0x34bc09,_0x34bc09);}if(!_['isUndefined'](_0x1931a0)&&_0x7a59('0x10')===typeof _0x1931a0&&!_[_0x7a59('0x11')](_0x1931a0)){return _0x1931a0;}return _0x7a59('0x14');};exports[_0x7a59('0x15')]=function(_0x34e32e){if(_[_0x7a59('0x16')](_0x34e32e)){return![];}return _0x34e32e;};exports['addVariables']=function(_0x361d08,_0x20e194,_0x2c82e3,_0x497c73,_0x1f5818,_0x19c940){var _0x4d329b={'XMD-QUEUE':_0x20e194['Queue']?_0x20e194[_0x7a59('0x17')][_0x7a59('0x18')]:'','XMD-CALLERID':_0x497c73,'XMD-CALLERID-PREVIEW':_0x19c940?util['format'](_0x7a59('0x13'),_0x19c940[_0x7a59('0x19')],_0x19c940[_0x7a59('0x1a')]):_0x497c73,'XMD-DIALID':_0x1f5818,'XMD-CONTACTID':_0x20e194[_0x7a59('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x497c73,'XMD-VOICEQUEUEID':_0x20e194[_0x7a59('0x1c')],'XMD-DIALCHANNEL':_0x2c82e3,'XMD-DIALTIMEOUT':_0x361d08['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x7a59('0x12')](_0x7a59('0x1d'),_0x361d08[_0x7a59('0x1e')]?'g':'',_[_0x7a59('0x11')](_0x361d08['monitor_format'])?'':_0x7a59('0x1f')),'XMD-DIALURL':_0x361d08['dialPreviewUrl']||'','XMD-AGI':_0x361d08[_0x7a59('0x20')]?util[_0x7a59('0x12')](_0x7a59('0x21'),ipAgi,_0x361d08['dialQueueProject']):_0x7a59('0x22'),'XMD-AGIAFTER':_0x361d08['dialQueueProject2']?util[_0x7a59('0x12')](_0x7a59('0x21'),ipAgi,_0x361d08[_0x7a59('0x1e')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x19c940?_0x19c940[_0x7a59('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x19c940?_0x19c940[_0x7a59('0x24')]:'','XMD-DESTINATION':_0x7a59('0x25'),'SIPADDHEADER':_0x7a59('0x26')};if(!_[_0x7a59('0x11')](_0x361d08[_0x7a59('0x27')])){_0x4d329b[util['format']('%s',_0x7a59('0x28'))]=_0x361d08['monitor_format'];_0x4d329b[util['format']('%s',_0x7a59('0x29'))]=_0x1f5818;}if(_0x20e194&&_0x20e194['Contact']){for(var _0x173166 in _0x20e194[_0x7a59('0x2a')]){if(_0x20e194[_0x7a59('0x2a')][_0x7a59('0x2b')](_0x173166)){if(!_[_0x7a59('0x16')](_0x20e194[_0x7a59('0x2a')][_0x173166])&&_0x173166!=='id'&&_0x173166!=='tags'&&_0x173166!==_0x7a59('0x2c')&&_0x173166!==_0x7a59('0x2d')){_0x4d329b[util[_0x7a59('0x12')]('%s%s',_0x7a59('0x2e'),_[_0x7a59('0x2f')](_0x173166))]=_0x20e194[_0x7a59('0x2a')][_0x173166];}}}}return _0x4d329b;};exports['toLowerVariables']=function(_0x15e55e){var _0x181dde={};for(var _0x6365d3 in _0x15e55e){if(_0x15e55e[_0x7a59('0x2b')](_0x6365d3)){_0x181dde[util['format']('%s',_[_0x7a59('0x30')](_0x6365d3))]=_0x15e55e[_0x6365d3];}}return{'variables':_0x181dde};};exports[_0x7a59('0x31')]=function(_0x2e7c82,_0x572795){if(!_[_0x7a59('0x16')](_0x2e7c82)){if(_0x2e7c82[_0x7a59('0x2b')](_0x7a59('0x32'))){if(_0x2e7c82[_0x7a59('0x32')]>0x0){_0x2e7c82['originated']-=0x1;}else{logger[_0x7a59('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x572795);}}}else{logger[_0x7a59('0xb')](_0x7a59('0x33'),_0x572795);}};exports[_0x7a59('0x34')]=function(_0x4dd724){var _0x14cc26=moment()[_0x7a59('0x12')](_0x7a59('0x35'));_0x4dd724[_0x7a59('0x36')]=0xd;_0x4dd724[_0x7a59('0x37')]=_0x7a59('0x38');_0x4dd724[_0x7a59('0x39')]=_0x14cc26;_0x4dd724[_0x7a59('0x3a')]=_0x14cc26;_0x4dd724[_0x7a59('0x3b')]=_0x14cc26;};exports[_0x7a59('0x3c')]=function(_0x48d4b5,_0x3019df,_0x1d2db8){var _0x32d8ea=moment()['format'](_0x7a59('0x35'));_0x48d4b5[_0x7a59('0x36')]=_0x3019df;_0x48d4b5['statedesc']=_0x1d2db8;_0x48d4b5[_0x7a59('0x3a')]=_0x32d8ea;_0x48d4b5['ringtime']=getSeconds(_0x48d4b5['responsetime'],_0x48d4b5['starttime']);};exports[_0x7a59('0x3d')]=function(_0x183ada,_0xfc2716,_0x2ec5cd){_0x183ada[_0x7a59('0x3e')]=_0xfc2716;_0x183ada[_0x7a59('0x3f')]=_0x2ec5cd;};exports[_0x7a59('0x40')]=function(_0x27b995,_0x122c74,_0x46ebba){var _0x95a973=moment()[_0x7a59('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x27b995[_0x7a59('0x36')]=_0x122c74;_0x27b995[_0x7a59('0x37')]=_0x46ebba;_0x27b995[_0x7a59('0x3a')]=_0x27b995['responsetime']?_0x27b995[_0x7a59('0x3a')]:_0x95a973;_0x27b995['endtime']=_0x27b995[_0x7a59('0x3b')]?_0x27b995[_0x7a59('0x3b')]:_0x95a973;_0x27b995[_0x7a59('0x41')]=getSeconds(_0x27b995[_0x7a59('0x3a')]||0x0,_0x27b995['starttime']||0x0);_0x27b995[_0x7a59('0x42')]=_0x27b995[_0x7a59('0x43')]?getSeconds(_0x27b995[_0x7a59('0x3b')],_0x27b995[_0x7a59('0x43')]):0x0;};exports['isFailure']=function(_0x95f7bd){return _0x95f7bd===_0x7a59('0x44');};exports['variablesAction']=function(_0x410a56,_0x9f1c0b,_0x58354e,_0x901481,_0x32044b){var _0x13683b=_0x901481?_0x7a59('0x45'):_0x410a56[_0x7a59('0x19')];_0x13683b=_0x32044b?'BOOKED':_0x13683b;return{'actionid':_0x410a56['uniqueid'],'action':_0x7a59('0x46'),'channel':_0x410a56[_0x7a59('0x47')],'callerid':util['format'](_0x7a59('0x13'),_0x13683b,_0x410a56['calleridnum']),'Exten':_0x7a59('0x25'),'Context':_0x7a59('0x48'),'Priority':'1','variable':_0x58354e,'timeout':(_0x9f1c0b['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x410a56['uniqueid']};};exports['totalGlobal']=function(_0x4ef458){return _0x4ef458[_0x7a59('0x49')]+_0x4ef458[_0x7a59('0x4a')]+_0x4ef458[_0x7a59('0x4b')]+_0x4ef458[_0x7a59('0x4c')]+_0x4ef458[_0x7a59('0x4d')];};exports[_0x7a59('0x4e')]=function(_0x451cc7){var _0x2587f9=_['clone'](_0x451cc7);_0x2587f9['state']=0xf;_0x2587f9[_0x7a59('0x37')]=_0x7a59('0x4f');return _0x2587f9;};exports[_0x7a59('0x50')]=function(_0x753054,_0x5e6b79,_0x45da07){var _0x180807={};_0x180807[_0x5e6b79]=_0x753054[_0x5e6b79];_0x180807[_0x7a59('0x51')]=![];_0x180807['scheduledat']=moment()[_0x7a59('0x52')](_0x45da07,'minutes')['format'](_0x7a59('0x35'));_0x180807[_0x7a59('0x1b')]=_0x753054[_0x7a59('0x1b')];_0x180807['ListId']=_0x753054[_0x7a59('0x53')];_0x180807[_0x7a59('0x1c')]=_0x753054[_0x7a59('0x1c')]||undefined;return _0x180807;};exports[_0x7a59('0x54')]=function(_0x305e52,_0x23d0e6){if(!_[_0x7a59('0x16')](_0x305e52)){if(_0x305e52[_0x7a59('0x55')]>0x0){_0x305e52[_0x7a59('0x55')]-=0x1;}else{logger[_0x7a59('0xb')](_0x23d0e6,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x7a59('0xb')](_0x23d0e6,_0x7a59('0x56'));}};exports[_0x7a59('0x57')]=function(_0x3efdb5){if(_0x3efdb5<=0x0){return!![];}return![];};exports[_0x7a59('0x58')]=function(_0x3216c2,_0x364df1,_0x3fc479){_0x3216c2[_0x7a59('0x59')]=_0x364df1;_0x3216c2[_0x7a59('0x18')]=_0x3216c2[_0x7a59('0x5a')];_0x3216c2[_0x7a59('0x5b')]=_0x3216c2['channelAgent'];_0x3216c2['motionChannel']='voice';if(_0x3fc479){_0x3216c2[_0x7a59('0x5c')]=_0x3fc479['mandatoryDisposition'];}return _0x3216c2;};exports['buildAcw']=function(_0x13e22c){var _0x333aa4={};_0x333aa4[_0x7a59('0x5a')]=_0x13e22c[_0x7a59('0x5a')];_0x333aa4[_0x7a59('0x5b')]=_0x13e22c[_0x7a59('0x47')];_0x333aa4[_0x7a59('0x5d')]=_0x13e22c[_0x7a59('0x5d')];return _0x333aa4;};exports[_0x7a59('0x5e')]=function(_0x208d08){var _0x3aa7ed=[];for(var _0x35d567 in _0x208d08){if(_0x208d08[_0x7a59('0x2b')](_0x35d567)){if(!_[_0x7a59('0x16')](_0x208d08[_0x35d567])&&_0x208d08[_0x35d567][_0x7a59('0x36')]===_0x7a59('0x5f')&&_0x208d08[_0x35d567]['status']===_0x7a59('0x60')){_0x3aa7ed[_0x7a59('0x61')](_0x208d08[_0x35d567]['id']);}}}return _0x3aa7ed;};exports[_0x7a59('0x62')]=function(_0x25952f){var _0x32fdcd=moment()[_0x7a59('0x6')](0x0);var _0x387858=moment(_0x25952f)['milliseconds'](0x0);return _0x32fdcd[_0x7a59('0x7')](_0x387858,_0x7a59('0x8'));};exports['createBody']=function(_0x5e684d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5e684d[_0x7a59('0x1b')],'ListId':_0x5e684d[_0x7a59('0x53')],'VoiceQueueId':_0x5e684d[_0x7a59('0x1c')]||undefined,'CampaignId':_0x5e684d[_0x7a59('0x63')]||undefined};};exports[_0x7a59('0x64')]=function(_0x53f47c){if(_0x53f47c==='uniqueid'||_0x53f47c===_0x7a59('0x65')||_0x53f47c==='queue'||_0x53f47c===_0x7a59('0x66')||_0x53f47c===_0x7a59('0x67')||_0x53f47c===_0x7a59('0x68')||_0x53f47c===_0x7a59('0x3e')||_0x53f47c===_0x7a59('0x47')||_0x53f47c===_0x7a59('0x19')||_0x53f47c==='active'||_0x53f47c===_0x7a59('0x1a')||_0x53f47c==='scheduledat'||_0x53f47c===_0x7a59('0x49')||_0x53f47c===_0x7a59('0x4a')||_0x53f47c==='countnoanswerretry'||_0x53f47c===_0x7a59('0x69')||_0x53f47c===_0x7a59('0x6a')||_0x53f47c===_0x7a59('0x6b')||_0x53f47c===_0x7a59('0x6c')||_0x53f47c===_0x7a59('0x6d')||_0x53f47c===_0x7a59('0x1b')||_0x53f47c===_0x7a59('0x53')||_0x53f47c===_0x7a59('0x3f')||_0x53f47c===_0x7a59('0x1c')||_0x53f47c==='sipcallid'||_0x53f47c===_0x7a59('0x6e')||_0x53f47c===_0x7a59('0x6f')||_0x53f47c==='xmd-phone'||_0x53f47c===_0x7a59('0x70')||_0x53f47c===_0x7a59('0x71')||_0x53f47c===_0x7a59('0x72')||_0x53f47c==='xmd-dialoptions'||_0x53f47c==='xmd-dialid'||_0x53f47c===_0x7a59('0x73')||_0x53f47c===_0x7a59('0x74')||_0x53f47c===_0x7a59('0x75')||_0x53f47c===_0x7a59('0x76')||_0x53f47c===_0x7a59('0x77')||_0x53f47c===_0x7a59('0x78')||_0x53f47c===_0x7a59('0x79')||_0x53f47c===_0x7a59('0x7a')||_0x53f47c==='rtpaudioqosjitter'||_0x53f47c==='rtpaudioqosjitterbridged'||_0x53f47c===_0x7a59('0x7b')||_0x53f47c===_0x7a59('0x7c')||_0x53f47c===_0x7a59('0x7d')||_0x53f47c===_0x7a59('0x7e')||_0x53f47c===_0x7a59('0x79')||_0x53f47c==='rtpaudioqosbridged'||_0x53f47c===_0x7a59('0x7f')||_0x53f47c===_0x7a59('0x80')||_0x53f47c==='rtpaudioqosloss'||_0x53f47c==='rtpaudioqoslossbridged'||_0x53f47c===_0x7a59('0x7d')||_0x53f47c===_0x7a59('0x7e')||_0x53f47c===_0x7a59('0x81')||_0x53f47c===_0x7a59('0x82')||_0x53f47c==='state'||_0x53f47c===_0x7a59('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1de149,_0x505a12){var _0x3054cb,_0x22d1ba,_0x325aa7;if(_0x505a12<=0x0){_0x505a12=0x1;}_0x3054cb=new RegExp(_0x7a59('0x83')+_0x505a12+'}$');_0x22d1ba=Math[_0x7a59('0x84')](0xa,_0x505a12-0x1);_0x325aa7=Math[_0x7a59('0x84')](0xa,_0x505a12)-0x1;return util['format']('%s',_[_0x7a59('0x85')](_0x1de149,_0x3054cb,_['random'](_0x22d1ba,_0x325aa7)));};exports[_0x7a59('0x86')]=function(_0x416a52){var _0x4fb856=_0x416a52[_0x7a59('0x87')](/"(.*?)"/);return _0x4fb856?_0x4fb856[0x1]:_0x416a52;};exports[_0x7a59('0x88')]=function(_0x273457){var _0x1b641d=_0x273457[_0x7a59('0x87')](/<(.*?)>/);return _0x1b641d?_0x1b641d[0x1]:_0x273457;};
\ No newline at end of file
+var _0x2966=['logLookAgent','membername','UserId','endtime','ringtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','interface','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countbusyretry','countglobal','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','createdAt','updatedAt','%s%s','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','state'];(function(_0x30baae,_0x372253){var _0x245b08=function(_0x94feaa){while(--_0x94feaa){_0x30baae['push'](_0x30baae['shift']());}};_0x245b08(++_0x372253);}(_0x2966,0x169));var _0x6296=function(_0x262673,_0x1defcb){_0x262673=_0x262673-0x0;var _0x11293a=_0x2966[_0x262673];return _0x11293a;};'use strict';var util=require('util');var _=require(_0x6296('0x0'));var moment=require(_0x6296('0x1'));var logger=require(_0x6296('0x2'))('preview');var ipAgi=process[_0x6296('0x3')]['XCALLY_IP_AGI']||_0x6296('0x4');function getSeconds(_0x7480bc,_0x59da9d){var _0x9bacc7=moment(_0x7480bc)[_0x6296('0x5')](0x0);var _0x31f0f6=moment(_0x59da9d)[_0x6296('0x5')](0x0);return _0x9bacc7[_0x6296('0x6')](_0x31f0f6,_0x6296('0x7'));}exports[_0x6296('0x8')]=function(_0x146a73){return function(_0x3d37e8){logger[_0x6296('0x9')](_0x146a73,util[_0x6296('0xa')](_0x3d37e8,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x298273,_0x450624){logger[_0x6296('0xb')](_0x298273,util[_0x6296('0xa')](_0x450624,{'showHidden':![],'depth':null}));};exports[_0x6296('0xc')]=function(_0x54eb2b,_0x10d331){logger[_0x6296('0x9')](_0x54eb2b,util[_0x6296('0xa')](_0x10d331,{'showHidden':![],'depth':null}));};exports[_0x6296('0xd')]=function(_0x3d3acb){return function(_0x223006){logger[_0x6296('0xb')](_0x3d3acb,util[_0x6296('0xa')](_0x223006,{'showHidden':![],'depth':null}));};};exports[_0x6296('0xe')]=function(_0xa04a6a,_0x4ad940,_0x4abd3c){return{'message':_0xa04a6a,'unlock':_0x4ad940,'active':_0x4abd3c};};exports[_0x6296('0xf')]=function(_0x3738d3,_0x38d944,_0x439f5b){if(!_[_0x6296('0x10')](_0x439f5b)&&_0x6296('0x11')===typeof _0x439f5b&&!_[_0x6296('0x12')](_0x439f5b)){if(!_['isUndefined'](_0x38d944)&&_0x6296('0x11')===typeof _0x38d944&&!_['isEmpty'](_0x38d944)){return util['format']('\x22%s\x22\x20<%s>',_0x38d944,_0x439f5b);}return util[_0x6296('0x13')](_0x6296('0x14'),_0x439f5b,_0x439f5b);}if(!_[_0x6296('0x10')](_0x3738d3)&&_0x6296('0x11')===typeof _0x3738d3&&!_['isEmpty'](_0x3738d3)){return _0x3738d3;}return _0x6296('0x15');};exports[_0x6296('0x16')]=function(_0x176098){if(_['isNil'](_0x176098)){return![];}return _0x176098;};exports[_0x6296('0x17')]=function(_0x46f66e,_0x5c5c7b,_0x5ed400,_0xa58bcc,_0x17340d,_0x272711){var _0x319ba8={'XMD-QUEUE':_0x5c5c7b[_0x6296('0x18')]?_0x5c5c7b['Queue']['name']:'','XMD-CALLERID':_0xa58bcc,'XMD-CALLERID-PREVIEW':_0x272711?util[_0x6296('0x13')](_0x6296('0x14'),_0x272711[_0x6296('0x19')],_0x272711[_0x6296('0x1a')]):_0xa58bcc,'XMD-DIALID':_0x17340d,'XMD-CONTACTID':_0x5c5c7b[_0x6296('0x1b')],'XMD-CDRTYPE':_0x6296('0x1c'),'CALLERID(all)':_0xa58bcc,'XMD-VOICEQUEUEID':_0x5c5c7b[_0x6296('0x1d')],'XMD-DIALCHANNEL':_0x5ed400,'XMD-DIALTIMEOUT':_0x46f66e['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x6296('0x13')](_0x6296('0x1e'),_0x46f66e[_0x6296('0x1f')]?'g':'',_['isEmpty'](_0x46f66e[_0x6296('0x20')])?'':_0x6296('0x21')),'XMD-DIALURL':_0x46f66e['dialPreviewUrl']||'','XMD-AGI':_0x46f66e[_0x6296('0x22')]?util[_0x6296('0x13')](_0x6296('0x23'),ipAgi,_0x46f66e[_0x6296('0x22')]):_0x6296('0x24'),'XMD-AGIAFTER':_0x46f66e[_0x6296('0x1f')]?util[_0x6296('0x13')](_0x6296('0x23'),ipAgi,_0x46f66e[_0x6296('0x1f')]):_0x6296('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x272711?_0x272711['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x272711?_0x272711[_0x6296('0x25')]:'','XMD-DESTINATION':_0x6296('0x26'),'SIPADDHEADER':_0x6296('0x27')};if(!_[_0x6296('0x12')](_0x46f66e[_0x6296('0x20')])){_0x319ba8[util[_0x6296('0x13')]('%s',_0x6296('0x28'))]=_0x46f66e['monitor_format'];_0x319ba8[util[_0x6296('0x13')]('%s',_0x6296('0x29'))]=_0x17340d;}if(_0x5c5c7b&&_0x5c5c7b[_0x6296('0x2a')]){for(var _0x4af591 in _0x5c5c7b['Contact']){if(_0x5c5c7b['Contact'][_0x6296('0x2b')](_0x4af591)){if(!_[_0x6296('0x2c')](_0x5c5c7b[_0x6296('0x2a')][_0x4af591])&&_0x4af591!=='id'&&_0x4af591!=='tags'&&_0x4af591!==_0x6296('0x2d')&&_0x4af591!==_0x6296('0x2e')){_0x319ba8[util[_0x6296('0x13')](_0x6296('0x2f'),'XMD-',_['toUpper'](_0x4af591))]=_0x5c5c7b[_0x6296('0x2a')][_0x4af591];}}}}return _0x319ba8;};exports['toLowerVariables']=function(_0x4af2a6){var _0x4081cf={};for(var _0x41dce8 in _0x4af2a6){if(_0x4af2a6[_0x6296('0x2b')](_0x41dce8)){_0x4081cf[util[_0x6296('0x13')]('%s',_[_0x6296('0x30')](_0x41dce8))]=_0x4af2a6[_0x41dce8];}}return{'variables':_0x4081cf};};exports['updateOriginated']=function(_0x47c9d6,_0x1d1e16){if(!_[_0x6296('0x2c')](_0x47c9d6)){if(_0x47c9d6['hasOwnProperty'](_0x6296('0x31'))){if(_0x47c9d6[_0x6296('0x31')]>0x0){_0x47c9d6[_0x6296('0x31')]-=0x1;}else{logger[_0x6296('0x9')](_0x6296('0x32'),_0x1d1e16);}}}else{logger[_0x6296('0x9')](_0x6296('0x33'),_0x1d1e16);}};exports[_0x6296('0x34')]=function(_0x283c10){var _0x3c4049=moment()[_0x6296('0x13')](_0x6296('0x35'));_0x283c10['state']=0xd;_0x283c10[_0x6296('0x36')]=_0x6296('0x37');_0x283c10[_0x6296('0x38')]=_0x3c4049;_0x283c10[_0x6296('0x39')]=_0x3c4049;_0x283c10['endtime']=_0x3c4049;};exports['logAgent']=function(_0x580cb4,_0x8b7dd9,_0x489794){var _0x36a240=moment()[_0x6296('0x13')](_0x6296('0x35'));_0x580cb4[_0x6296('0x3a')]=_0x8b7dd9;_0x580cb4[_0x6296('0x36')]=_0x489794;_0x580cb4[_0x6296('0x39')]=_0x36a240;_0x580cb4['ringtime']=getSeconds(_0x580cb4[_0x6296('0x39')],_0x580cb4[_0x6296('0x38')]);};exports[_0x6296('0x3b')]=function(_0x4668c8,_0x5a2c37,_0x248f3a){_0x4668c8[_0x6296('0x3c')]=_0x5a2c37;_0x4668c8[_0x6296('0x3d')]=_0x248f3a;};exports['logCustomer']=function(_0x33c77c,_0x34022b,_0x16fe7f){var _0x495141=moment()[_0x6296('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x33c77c[_0x6296('0x3a')]=_0x34022b;_0x33c77c[_0x6296('0x36')]=_0x16fe7f;_0x33c77c[_0x6296('0x39')]=_0x33c77c[_0x6296('0x39')]?_0x33c77c[_0x6296('0x39')]:_0x495141;_0x33c77c[_0x6296('0x3e')]=_0x33c77c[_0x6296('0x3e')]?_0x33c77c[_0x6296('0x3e')]:_0x495141;_0x33c77c[_0x6296('0x3f')]=getSeconds(_0x33c77c[_0x6296('0x39')]||0x0,_0x33c77c[_0x6296('0x38')]||0x0);_0x33c77c[_0x6296('0x40')]=_0x33c77c[_0x6296('0x41')]?getSeconds(_0x33c77c[_0x6296('0x3e')],_0x33c77c[_0x6296('0x41')]):0x0;};exports['isFailure']=function(_0xfe90d3){return _0xfe90d3===_0x6296('0x42');};exports[_0x6296('0x43')]=function(_0x5d33da,_0x90c33d,_0x45e2c0,_0x1d5778,_0x254be7){var _0x930eee=_0x1d5778?_0x6296('0x44'):_0x5d33da[_0x6296('0x19')];_0x930eee=_0x254be7?_0x6296('0x45'):_0x930eee;return{'actionid':_0x5d33da[_0x6296('0x46')],'action':_0x6296('0x47'),'channel':_0x5d33da[_0x6296('0x48')],'callerid':util[_0x6296('0x13')](_0x6296('0x14'),_0x930eee,_0x5d33da[_0x6296('0x1a')]),'Exten':'xcally-motion-preview','Context':_0x6296('0x49'),'Priority':'1','variable':_0x45e2c0,'timeout':(_0x90c33d[_0x6296('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5d33da[_0x6296('0x46')]};};exports[_0x6296('0x4b')]=function(_0x1feb3e){return _0x1feb3e['countbusyretry']+_0x1feb3e[_0x6296('0x4c')]+_0x1feb3e[_0x6296('0x4d')]+_0x1feb3e[_0x6296('0x4e')]+_0x1feb3e[_0x6296('0x4f')];};exports['cloneAction']=function(_0xfd632){var _0x510d27=_['clone'](_0xfd632);_0x510d27[_0x6296('0x3a')]=0xf;_0x510d27[_0x6296('0x36')]='Global';return _0x510d27;};exports[_0x6296('0x50')]=function(_0x3c797e,_0x13b833,_0x371208){var _0x3e79dc={};_0x3e79dc[_0x13b833]=_0x3c797e[_0x13b833];_0x3e79dc[_0x6296('0x51')]=![];_0x3e79dc[_0x6296('0x52')]=moment()[_0x6296('0x53')](_0x371208,_0x6296('0x54'))['format'](_0x6296('0x35'));_0x3e79dc[_0x6296('0x1b')]=_0x3c797e[_0x6296('0x1b')];_0x3e79dc[_0x6296('0x55')]=_0x3c797e[_0x6296('0x55')];_0x3e79dc[_0x6296('0x1d')]=_0x3c797e[_0x6296('0x1d')]||undefined;return _0x3e79dc;};exports[_0x6296('0x56')]=function(_0x175313,_0x1c7d9a){if(!_[_0x6296('0x2c')](_0x175313)){if(_0x175313[_0x6296('0x57')]>0x0){_0x175313['pTalking']-=0x1;}else{logger['error'](_0x1c7d9a,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x1c7d9a,_0x6296('0x58'));}};exports[_0x6296('0x59')]=function(_0x984f5){if(_0x984f5<=0x0){return!![];}return![];};exports['buildObj']=function(_0x1e6c5d,_0x91eff3,_0xa2f2aa){_0x1e6c5d[_0x6296('0x5a')]=_0x91eff3;_0x1e6c5d[_0x6296('0x5b')]=_0x1e6c5d[_0x6296('0x5c')];_0x1e6c5d[_0x6296('0x5d')]=_0x1e6c5d['channelAgent'];_0x1e6c5d['motionChannel']=_0x6296('0x5e');if(_0xa2f2aa){_0x1e6c5d[_0x6296('0x5f')]=_0xa2f2aa['mandatoryDisposition'];}return _0x1e6c5d;};exports['buildAcw']=function(_0x2db53c){var _0x561e69={};_0x561e69[_0x6296('0x5c')]=_0x2db53c[_0x6296('0x5c')];_0x561e69[_0x6296('0x5d')]=_0x2db53c[_0x6296('0x48')];_0x561e69[_0x6296('0x46')]=_0x2db53c[_0x6296('0x46')];return _0x561e69;};exports[_0x6296('0x60')]=function(_0x4ae7e3){var _0xce9507=[];for(var _0x5b95c7 in _0x4ae7e3){if(_0x4ae7e3[_0x6296('0x2b')](_0x5b95c7)){if(!_['isNil'](_0x4ae7e3[_0x5b95c7])&&_0x4ae7e3[_0x5b95c7][_0x6296('0x3a')]===_0x6296('0x61')&&_0x4ae7e3[_0x5b95c7][_0x6296('0x62')]===_0x6296('0x63')){_0xce9507[_0x6296('0x64')](_0x4ae7e3[_0x5b95c7]['id']);}}}return _0xce9507;};exports['getDiff']=function(_0x1d0691){var _0x1b5257=moment()[_0x6296('0x5')](0x0);var _0x2f5165=moment(_0x1d0691)[_0x6296('0x5')](0x0);return _0x1b5257[_0x6296('0x6')](_0x2f5165,_0x6296('0x7'));};exports['createBody']=function(_0x4291ef){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4291ef[_0x6296('0x1b')],'ListId':_0x4291ef[_0x6296('0x55')],'VoiceQueueId':_0x4291ef[_0x6296('0x1d')]||undefined,'CampaignId':_0x4291ef[_0x6296('0x65')]||undefined};};exports[_0x6296('0x66')]=function(_0x32022f){if(_0x32022f===_0x6296('0x46')||_0x32022f===_0x6296('0x67')||_0x32022f===_0x6296('0x5c')||_0x32022f===_0x6296('0x68')||_0x32022f===_0x6296('0x69')||_0x32022f===_0x6296('0x6a')||_0x32022f==='membername'||_0x32022f===_0x6296('0x48')||_0x32022f===_0x6296('0x19')||_0x32022f===_0x6296('0x51')||_0x32022f===_0x6296('0x1a')||_0x32022f===_0x6296('0x52')||_0x32022f===_0x6296('0x6b')||_0x32022f===_0x6296('0x4c')||_0x32022f===_0x6296('0x4d')||_0x32022f===_0x6296('0x6c')||_0x32022f==='callback'||_0x32022f===_0x6296('0x6d')||_0x32022f===_0x6296('0x6e')||_0x32022f===_0x6296('0x6f')||_0x32022f===_0x6296('0x1b')||_0x32022f==='ListId'||_0x32022f===_0x6296('0x3d')||_0x32022f===_0x6296('0x1d')||_0x32022f==='sipcallid'||_0x32022f===_0x6296('0x70')||_0x32022f===_0x6296('0x71')||_0x32022f===_0x6296('0x72')||_0x32022f==='xmd-listid'||_0x32022f===_0x6296('0x73')||_0x32022f===_0x6296('0x74')||_0x32022f===_0x6296('0x75')||_0x32022f==='xmd-dialid'||_0x32022f===_0x6296('0x76')||_0x32022f===_0x6296('0x77')||_0x32022f===_0x6296('0x78')||_0x32022f==='xmd-callerid'||_0x32022f==='xmd-agiafter'||_0x32022f===_0x6296('0x79')||_0x32022f===_0x6296('0x7a')||_0x32022f==='rtpaudioqosbridged'||_0x32022f===_0x6296('0x7b')||_0x32022f==='rtpaudioqosjitterbridged'||_0x32022f==='rtpaudioqosloss'||_0x32022f===_0x6296('0x7c')||_0x32022f===_0x6296('0x7d')||_0x32022f===_0x6296('0x7e')||_0x32022f===_0x6296('0x7a')||_0x32022f===_0x6296('0x7f')||_0x32022f===_0x6296('0x7b')||_0x32022f===_0x6296('0x80')||_0x32022f===_0x6296('0x81')||_0x32022f===_0x6296('0x7c')||_0x32022f===_0x6296('0x7d')||_0x32022f===_0x6296('0x7e')||_0x32022f===_0x6296('0x82')||_0x32022f===_0x6296('0x83')||_0x32022f===_0x6296('0x3a')||_0x32022f===_0x6296('0x36')){return![];}return!![];};exports[_0x6296('0x84')]=function(_0x28853f,_0x1d5a5f){var _0x53a357,_0x39fce3,_0x310577;if(_0x1d5a5f<=0x0){_0x1d5a5f=0x1;}_0x53a357=new RegExp(_0x6296('0x85')+_0x1d5a5f+'}$');_0x39fce3=Math[_0x6296('0x86')](0xa,_0x1d5a5f-0x1);_0x310577=Math[_0x6296('0x86')](0xa,_0x1d5a5f)-0x1;return util['format']('%s',_[_0x6296('0x87')](_0x28853f,_0x53a357,_[_0x6296('0x88')](_0x39fce3,_0x310577)));};exports[_0x6296('0x89')]=function(_0x367555){var _0x240993=_0x367555[_0x6296('0x8a')](/"(.*?)"/);return _0x240993?_0x240993[0x1]:_0x367555;};exports[_0x6296('0x8b')]=function(_0x146472){var _0x15c19e=_0x146472[_0x6296('0x8a')](/<(.*?)>/);return _0x15c19e?_0x15c19e[0x1]:_0x146472;};
\ No newline at end of file
index 2d854b5..2bcf9b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x573c=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queueremove','queuepause','boolean','reload'];(function(_0x16cc7a,_0x304732){var _0x5d6e94=function(_0x5d8559){while(--_0x5d8559){_0x16cc7a['push'](_0x16cc7a['shift']());}};_0x5d6e94(++_0x304732);}(_0x573c,0x10c));var _0xc573=function(_0xcd4b3c,_0x395af3){_0xcd4b3c=_0xcd4b3c-0x0;var _0x3a96a6=_0x573c[_0xcd4b3c];return _0x3a96a6;};'use strict';exports[_0xc573('0x0')]={'queue':{'type':_0xc573('0x1'),'required':!![]},'interface':{'type':_0xc573('0x1'),'required':!![]},'membername':{'type':_0xc573('0x1'),'required':!![]},'penalty':{'type':_0xc573('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xc573('0x3')]={'queue':{'type':_0xc573('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xc573('0x4')]={'interface':{'type':_0xc573('0x1'),'required':!![]},'paused':{'type':_0xc573('0x5')},'reason':{'type':_0xc573('0x1'),'required':![]}};exports[_0xc573('0x6')]={'module':{'type':_0xc573('0x1'),'required':![]}};exports[_0xc573('0x7')]={'uniqueid':{'type':_0xc573('0x1'),'required':!![]}};exports[_0xc573('0x8')]={'uniqueid':{'type':_0xc573('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xc573('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xc573('0x9')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xc573('0xa')]={'uniqueid':{'type':_0xc573('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xc573('0x1')}};
\ No newline at end of file
+var _0x5f05=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause'];(function(_0x250760,_0x24886c){var _0x9318d8=function(_0x238636){while(--_0x238636){_0x250760['push'](_0x250760['shift']());}};_0x9318d8(++_0x24886c);}(_0x5f05,0x1bc));var _0x55f0=function(_0x4973bc,_0x1488de){_0x4973bc=_0x4973bc-0x0;var _0x3848e6=_0x5f05[_0x4973bc];return _0x3848e6;};'use strict';exports[_0x55f0('0x0')]={'queue':{'type':_0x55f0('0x1'),'required':!![]},'interface':{'type':_0x55f0('0x1'),'required':!![]},'membername':{'type':_0x55f0('0x1'),'required':!![]},'penalty':{'type':_0x55f0('0x2'),'required':![]},'paused':{'type':_0x55f0('0x3'),'required':![]}};exports[_0x55f0('0x4')]={'queue':{'type':_0x55f0('0x1'),'required':!![]},'interface':{'type':_0x55f0('0x1'),'required':!![]}};exports[_0x55f0('0x5')]={'interface':{'type':_0x55f0('0x1'),'required':!![]},'paused':{'type':_0x55f0('0x3')},'reason':{'type':_0x55f0('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x55f0('0x1'),'required':![]}};exports[_0x55f0('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x55f0('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x55f0('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x55f0('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x55f0('0x9')]={'uniqueid':{'type':_0x55f0('0x1'),'required':!![]},'exten':{'type':_0x55f0('0x1'),'required':!![]},'context':{'type':_0x55f0('0x1')}};
\ No newline at end of file
index 79b6a6e..b4dc761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x472a=['salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','name','total','answered','sumHoldTime','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','initTrunks','trunks','initVoiceQueues','length','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','deskAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallerleaveAt','ANSWERED','duration','billableseconds','campaigns','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','exports','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','zendeskAccounts'];(function(_0x2f94c5,_0x10aad3){var _0x465dd0=function(_0x160936){while(--_0x160936){_0x2f94c5['push'](_0x2f94c5['shift']());}};_0x465dd0(++_0x10aad3);}(_0x472a,0xc7));var _0xa472=function(_0x151317,_0x3e6c29){_0x151317=_0x151317-0x0;var _0x50b025=_0x472a[_0x151317];return _0x50b025;};'use strict';var BPromise=require(_0xa472('0x0'));var util=require(_0xa472('0x1'));var _=require(_0xa472('0x2'));var moment=require(_0xa472('0x3'));var Agent=require('../model/agent');var Telephone=require(_0xa472('0x4'));var Trunk=require(_0xa472('0x5'));var VoiceQueue=require(_0xa472('0x6'));var Trigger=require(_0xa472('0x7'));var Template=require(_0xa472('0x8'));var Campaign=require(_0xa472('0x9'));var VoiceExtension=require(_0xa472('0xa'));var ZendeskAccount=require(_0xa472('0xb'));var SalesforceAccount=require(_0xa472('0xc'));var FreshdeskAccount=require(_0xa472('0xd'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xa472('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xa472('0xf'));var ServicenowAccount=require(_0xa472('0x10'));var Dynamics365Account=require(_0xa472('0x11'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xa472('0x12'));var Realtime=function(){this[_0xa472('0x13')]={};this[_0xa472('0x14')]={};this['trunks']={};this[_0xa472('0x15')]={};this['triggers']={};this['campaigns']={};this[_0xa472('0x16')]={};this[_0xa472('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xa472('0x18')]={};this[_0xa472('0x19')]={};this[_0xa472('0x1a')]={};this[_0xa472('0x1b')]={};this['settings']={};this[_0xa472('0x1c')]={};this[_0xa472('0x1d')]={};this[_0xa472('0x1e')]={};this[_0xa472('0x1f')]={};this[_0xa472('0x20')]={};this['deskAccounts']={};this[_0xa472('0x21')]={};this['servicenowAccounts']={};this[_0xa472('0x22')]={};this['freshsalesAccounts']={};this[_0xa472('0x23')]={};};function freeIsNotKey(_0x378a64,_0x368ac3,_0x5b5a7f){var _0x2ffde6=_[_0xa472('0x24')](_0x378a64,function(_0x1b4a33,_0x291a71){return _0x1b4a33[_0x5b5a7f];});for(var _0x5ddbf1 in _0x368ac3){if(_0x368ac3[_0xa472('0x25')](_0x5ddbf1)){if(!_0x2ffde6[_0x5ddbf1]){delete _0x368ac3[_0x5ddbf1];}}}}function freeIsNotKeySip(_0xdfee8,_0x41338a){var _0x4b07c5=_[_0xa472('0x24')](_0xdfee8,function(_0x5e8feb,_0x4f5e55){return util[_0xa472('0x26')](_0xa472('0x27'),_0x5e8feb['name']);});for(var _0x4b3732 in _0x41338a){if(_0x41338a['hasOwnProperty'](_0x4b3732)){if(!_0x4b07c5[_0x4b3732]){delete _0x41338a[_0x4b3732];}}}}function freeIsNotKeyAgent(_0x1c1516,_0x2b7df1){var _0x4ebf38=_[_0xa472('0x24')](_0x1c1516,function(_0x24037f,_0x28b715){var _0x295092=_[_0xa472('0x28')](_0x24037f[_0xa472('0x29')])?util[_0xa472('0x26')](_0xa472('0x27'),_0x24037f[_0xa472('0x2a')]):_0x24037f[_0xa472('0x29')];return _0x295092;});for(var _0x4b362d in _0x2b7df1){if(_0x2b7df1[_0xa472('0x25')](_0x4b362d)){if(!_0x4ebf38[_0x4b362d]){delete _0x2b7df1[_0x4b362d];}}}}function clearVoiceCallReports(_0x1b39a8){_0x1b39a8[_0xa472('0x2b')]=0x0;_0x1b39a8[_0xa472('0x2c')]=0x0;_0x1b39a8[_0xa472('0x2d')]=0x0;_0x1b39a8['sumDuration']=0x0;_0x1b39a8['sumBillable']=0x0;}function clearCampaigns(_0x4593c8){if(!_[_0xa472('0x2e')](_0x4593c8)){for(var _0x228023 in _0x4593c8){if(_0x4593c8[_0xa472('0x25')](_0x228023)){_0x4593c8[_0x228023][_0xa472('0x2f')]=0x0;_0x4593c8[_0x228023][_0xa472('0x30')]=0x0;}}}}function clearVoiceQueues(_0x17ccb7){if(!_[_0xa472('0x2e')](_0x17ccb7)){for(var _0x3a646f in _0x17ccb7){if(_0x17ccb7[_0xa472('0x25')](_0x3a646f)){_0x17ccb7[_0x3a646f][_0xa472('0x2b')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x2c')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x31')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x32')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x2d')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x33')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x34')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x35')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x36')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x37')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x38')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x39')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x3a')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x3b')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x3c')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x3d')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x3e')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x3f')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x40')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x35')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x41')]=0x0;_0x17ccb7[_0x3a646f][_0xa472('0x42')]=!![];}}}}Realtime[_0xa472('0x43')][_0xa472('0x44')]=function(_0x3196ea,_0x437490){for(var _0x34029b in _0x437490){if(_0x3196ea[_0xa472('0x25')](_0x34029b)){_0x3196ea[_0x34029b]=_0x437490[_0x34029b];}}};Realtime[_0xa472('0x43')][_0xa472('0x45')]=function(){var _0x4088e4=this;return function(_0x3b44f0){if(_0x3b44f0){freeIsNotKeyAgent(_0x3b44f0,_0x4088e4[_0xa472('0x13')]);for(var _0xeed3ed=0x0,_0x75d2e0={},_0x9053c4={};_0xeed3ed<_0x3b44f0['length'];_0xeed3ed+=0x1){_0x75d2e0=_0x3b44f0[_0xeed3ed];var _0x428a84=_[_0xa472('0x28')](_0x75d2e0[_0xa472('0x29')])?util[_0xa472('0x26')](_0xa472('0x27'),_0x75d2e0[_0xa472('0x2a')]):_0x75d2e0[_0xa472('0x29')];if(_[_0xa472('0x46')](_0x4088e4[_0xa472('0x13')][_0x428a84])){_0x4088e4[_0xa472('0x13')][_0x428a84]=new Agent(_0x75d2e0);}else{_0x4088e4['mergeFromDatabase'](_0x4088e4[_0xa472('0x13')][_0x428a84],_0x75d2e0);}}}return _0x4088e4[_0xa472('0x13')];};};Realtime[_0xa472('0x43')][_0xa472('0x47')]=function(){var _0x46365f=this;return function(_0x20ecba){if(_0x20ecba){freeIsNotKeySip(_0x20ecba,_0x46365f['telephones']);for(var _0x2e009d=0x0,_0x24229d={},_0xf7ee5b={};_0x2e009d<_0x20ecba['length'];_0x2e009d+=0x1){_0x24229d=_0x20ecba[_0x2e009d];if(_['isUndefined'](_0x46365f[_0xa472('0x14')][util[_0xa472('0x26')](_0xa472('0x27'),_0x24229d[_0xa472('0x2a')])])){_0x46365f[_0xa472('0x14')][util[_0xa472('0x26')](_0xa472('0x27'),_0x24229d[_0xa472('0x2a')])]=new Telephone(_0x24229d);}else{_0x46365f[_0xa472('0x44')](_0x46365f['telephones'][util[_0xa472('0x26')](_0xa472('0x27'),_0x24229d[_0xa472('0x2a')])],_0x24229d);}}}return _0x46365f['telephones'];};};Realtime[_0xa472('0x43')][_0xa472('0x48')]=function(){var _0x23a92d=this;return function(_0x5d226a){if(_0x5d226a){freeIsNotKeySip(_0x5d226a,_0x23a92d[_0xa472('0x49')]);for(var _0x1d0d92=0x0,_0x2a03b6={},_0x5e25c5={};_0x1d0d92<_0x5d226a['length'];_0x1d0d92+=0x1){_0x2a03b6=_0x5d226a[_0x1d0d92];if(_[_0xa472('0x46')](_0x23a92d[_0xa472('0x49')][util[_0xa472('0x26')](_0xa472('0x27'),_0x2a03b6[_0xa472('0x2a')])])){_0x23a92d[_0xa472('0x49')][util[_0xa472('0x26')]('SIP/%s',_0x2a03b6[_0xa472('0x2a')])]=new Trunk(_0x2a03b6);}else{_0x23a92d[_0xa472('0x44')](_0x23a92d[_0xa472('0x49')][util[_0xa472('0x26')](_0xa472('0x27'),_0x2a03b6[_0xa472('0x2a')])],_0x2a03b6);}}}return _0x23a92d['trunks'];};};Realtime[_0xa472('0x43')][_0xa472('0x4a')]=function(){var _0x33fd3e=this;return function(_0x46f1cc){if(_0x46f1cc){freeIsNotKey(_0x46f1cc,_0x33fd3e[_0xa472('0x15')],_0xa472('0x2a'));for(var _0x341b93=0x0,_0x11a078={},_0x9e8b0d={};_0x341b93<_0x46f1cc[_0xa472('0x4b')];_0x341b93+=0x1){_0x11a078=_0x46f1cc[_0x341b93];if(_['isUndefined'](_0x33fd3e['voiceQueues'][_0x11a078[_0xa472('0x2a')]])){_0x33fd3e[_0xa472('0x15')][_0x11a078[_0xa472('0x2a')]]=new VoiceQueue(_0x11a078);}else{_0x33fd3e[_0xa472('0x44')](_0x33fd3e[_0xa472('0x15')][_0x11a078[_0xa472('0x2a')]],_0x11a078);}}}return _0x33fd3e[_0xa472('0x15')];};};Realtime['prototype'][_0xa472('0x4c')]=function(){var _0x3987f5=this;return function(_0x3f266d){if(_0x3f266d){freeIsNotKey(_0x3f266d,_0x3987f5[_0xa472('0x4d')],'id');for(var _0x401980=0x0,_0x42067a={},_0x2cf45c={};_0x401980<_0x3f266d[_0xa472('0x4b')];_0x401980+=0x1){_0x42067a=_0x3f266d[_0x401980];if(_[_0xa472('0x46')](_0x3987f5[_0xa472('0x4d')][_0x42067a['id']])){_0x3987f5[_0xa472('0x4d')][_0x42067a['id']]=new Trigger(_0x42067a);}else{_0x3987f5[_0xa472('0x44')](_0x3987f5[_0xa472('0x4d')][_0x42067a['id']],_0x42067a);}}}return _0x3987f5['triggers'];};};Realtime[_0xa472('0x43')][_0xa472('0x4e')]=function(){var _0x33b2bf=this;return function(_0x5db0e1){if(_0x5db0e1){freeIsNotKey(_0x5db0e1,_0x33b2bf[_0xa472('0x16')],'id');for(var _0x3910b7=0x0,_0x1c3108={},_0x5b4a43={};_0x3910b7<_0x5db0e1[_0xa472('0x4b')];_0x3910b7+=0x1){_0x1c3108=_0x5db0e1[_0x3910b7];if(_['isUndefined'](_0x33b2bf[_0xa472('0x16')][_0x1c3108['id']])){_0x33b2bf[_0xa472('0x16')][_0x1c3108['id']]=new Template(_0x1c3108);}else{_0x33b2bf[_0xa472('0x44')](_0x33b2bf[_0xa472('0x16')][_0x1c3108['id']],_0x1c3108);}}}return _0x33b2bf[_0xa472('0x16')];};};Realtime[_0xa472('0x43')][_0xa472('0x4f')]=function(){var _0x818acd=this;return function(_0x29d535){if(_0x29d535){freeIsNotKey(_0x29d535,_0x818acd[_0xa472('0x1c')],'id');for(var _0x518e11=0x0,_0x3bafee={},_0x4f91d9={};_0x518e11<_0x29d535[_0xa472('0x4b')];_0x518e11+=0x1){_0x3bafee=_0x29d535[_0x518e11];if(_['isUndefined'](_0x818acd[_0xa472('0x1c')][_0x3bafee['id']])){_0x818acd[_0xa472('0x1c')][_0x3bafee['id']]=new ZendeskAccount(_0x3bafee);}else{_0x818acd[_0xa472('0x44')](_0x818acd[_0xa472('0x1c')][_0x3bafee['id']],_0x3bafee);}}}return _0x818acd[_0xa472('0x1c')];};};Realtime[_0xa472('0x43')][_0xa472('0x50')]=function(){var _0xc737a6=this;return function(_0x442cec){if(_0x442cec){freeIsNotKey(_0x442cec,_0xc737a6['salesforceAccounts'],'id');for(var _0x1034e2=0x0,_0x4f2c46={},_0x324595={};_0x1034e2<_0x442cec['length'];_0x1034e2+=0x1){_0x4f2c46=_0x442cec[_0x1034e2];if(_[_0xa472('0x46')](_0xc737a6[_0xa472('0x1d')][_0x4f2c46['id']])){_0xc737a6[_0xa472('0x1d')][_0x4f2c46['id']]=new SalesforceAccount(_0x4f2c46);}else{_0xc737a6[_0xa472('0x44')](_0xc737a6[_0xa472('0x1d')][_0x4f2c46['id']],_0x4f2c46);}}}return _0xc737a6[_0xa472('0x1d')];};};Realtime['prototype'][_0xa472('0x51')]=function(){var _0x5f10ad=this;return function(_0x53399a){if(_0x53399a){freeIsNotKey(_0x53399a,_0x5f10ad[_0xa472('0x1f')],'id');for(var _0x23bf8=0x0,_0x149df0={},_0x34a0cf={};_0x23bf8<_0x53399a[_0xa472('0x4b')];_0x23bf8+=0x1){_0x149df0=_0x53399a[_0x23bf8];if(_[_0xa472('0x46')](_0x5f10ad[_0xa472('0x1f')][_0x149df0['id']])){_0x5f10ad[_0xa472('0x1f')][_0x149df0['id']]=new FreshdeskAccount(_0x149df0);}else{_0x5f10ad[_0xa472('0x44')](_0x5f10ad[_0xa472('0x1f')][_0x149df0['id']],_0x149df0);}}}return _0x5f10ad[_0xa472('0x1f')];};};Realtime[_0xa472('0x43')][_0xa472('0x52')]=function(){var _0x332f34=this;return function(_0x162054){if(_0x162054){freeIsNotKey(_0x162054,_0x332f34[_0xa472('0x20')],'id');for(var _0x414be1=0x0,_0x7a9fb9={},_0x41a3b4={};_0x414be1<_0x162054[_0xa472('0x4b')];_0x414be1+=0x1){_0x7a9fb9=_0x162054[_0x414be1];if(_['isUndefined'](_0x332f34[_0xa472('0x20')][_0x7a9fb9['id']])){_0x332f34[_0xa472('0x20')][_0x7a9fb9['id']]=new ZohoAccount(_0x7a9fb9);}else{_0x332f34[_0xa472('0x44')](_0x332f34[_0xa472('0x20')][_0x7a9fb9['id']],_0x7a9fb9);}}}return _0x332f34['zohoAccounts'];};};Realtime[_0xa472('0x43')]['initDeskAccounts']=function(){var _0x347aa8=this;return function(_0x2fee33){if(_0x2fee33){freeIsNotKey(_0x2fee33,_0x347aa8['deskAccounts'],'id');for(var _0x3d3c3c=0x0,_0x7eef73={},_0x1851cd={};_0x3d3c3c<_0x2fee33[_0xa472('0x4b')];_0x3d3c3c+=0x1){_0x7eef73=_0x2fee33[_0x3d3c3c];if(_[_0xa472('0x46')](_0x347aa8['deskAccounts'][_0x7eef73['id']])){_0x347aa8[_0xa472('0x53')][_0x7eef73['id']]=new DeskAccount(_0x7eef73);}else{_0x347aa8[_0xa472('0x44')](_0x347aa8[_0xa472('0x53')][_0x7eef73['id']],_0x7eef73);}}}return _0x347aa8[_0xa472('0x53')];};};Realtime[_0xa472('0x43')]['initSugarcrmAccounts']=function(){var _0x49c14a=this;return function(_0x355069){if(_0x355069){freeIsNotKey(_0x355069,_0x49c14a[_0xa472('0x1e')],'id');for(var _0x1602f4=0x0,_0x52c2b4={},_0x140586={};_0x1602f4<_0x355069['length'];_0x1602f4+=0x1){_0x52c2b4=_0x355069[_0x1602f4];if(_[_0xa472('0x46')](_0x49c14a[_0xa472('0x1e')][_0x52c2b4['id']])){_0x49c14a['sugarcrmAccounts'][_0x52c2b4['id']]=new SugarcrmAccount(_0x52c2b4);}else{_0x49c14a[_0xa472('0x44')](_0x49c14a[_0xa472('0x1e')][_0x52c2b4['id']],_0x52c2b4);}}}return _0x49c14a['sugarcrmAccounts'];};};Realtime[_0xa472('0x43')][_0xa472('0x54')]=function(){var _0x4703d3=this;return function(_0x39acc0){if(_0x39acc0){freeIsNotKey(_0x39acc0,_0x4703d3[_0xa472('0x21')],'id');for(var _0x408a3a=0x0,_0x3ce4dd={},_0x19d020={};_0x408a3a<_0x39acc0['length'];_0x408a3a+=0x1){_0x3ce4dd=_0x39acc0[_0x408a3a];if(_['isUndefined'](_0x4703d3['vtigerAccounts'][_0x3ce4dd['id']])){_0x4703d3['vtigerAccounts'][_0x3ce4dd['id']]=new VtigerAccount(_0x3ce4dd);}else{_0x4703d3[_0xa472('0x44')](_0x4703d3[_0xa472('0x21')][_0x3ce4dd['id']],_0x3ce4dd);}}}return _0x4703d3[_0xa472('0x21')];};};Realtime[_0xa472('0x43')][_0xa472('0x55')]=function(){var _0x5c6c19=this;return function(_0x1487f7){if(_0x1487f7){freeIsNotKey(_0x1487f7,_0x5c6c19[_0xa472('0x56')],'id');for(var _0x56bf11=0x0,_0x4ce6e6={},_0x327eac={};_0x56bf11<_0x1487f7[_0xa472('0x4b')];_0x56bf11+=0x1){_0x4ce6e6=_0x1487f7[_0x56bf11];if(_[_0xa472('0x46')](_0x5c6c19['servicenowAccounts'][_0x4ce6e6['id']])){_0x5c6c19[_0xa472('0x56')][_0x4ce6e6['id']]=new ServicenowAccount(_0x4ce6e6);}else{_0x5c6c19[_0xa472('0x44')](_0x5c6c19['servicenowAccounts'][_0x4ce6e6['id']],_0x4ce6e6);}}}return _0x5c6c19[_0xa472('0x56')];};};Realtime['prototype'][_0xa472('0x57')]=function(){var _0x5dc028=this;return function(_0x577866){if(_0x577866){freeIsNotKey(_0x577866,_0x5dc028[_0xa472('0x22')],'id');for(var _0x10bb2c=0x0,_0x105544={},_0x101f7c={};_0x10bb2c<_0x577866[_0xa472('0x4b')];_0x10bb2c+=0x1){_0x105544=_0x577866[_0x10bb2c];if(_['isUndefined'](_0x5dc028[_0xa472('0x22')][_0x105544['id']])){_0x5dc028[_0xa472('0x22')][_0x105544['id']]=new Dynamics365Account(_0x105544);}else{_0x5dc028[_0xa472('0x44')](_0x5dc028[_0xa472('0x22')][_0x105544['id']],_0x105544);}}}return _0x5dc028['dynamics365Accounts'];};};Realtime[_0xa472('0x43')][_0xa472('0x58')]=function(){var _0xf2c800=this;return function(_0x554495){if(_0x554495){freeIsNotKey(_0x554495,_0xf2c800[_0xa472('0x59')],'id');for(var _0xc3c41f=0x0,_0x339379={},_0x29832e={};_0xc3c41f<_0x554495[_0xa472('0x4b')];_0xc3c41f+=0x1){_0x339379=_0x554495[_0xc3c41f];if(_[_0xa472('0x46')](_0xf2c800[_0xa472('0x59')][_0x339379['id']])){_0xf2c800[_0xa472('0x59')][_0x339379['id']]=new FreshsalesAccount(_0x339379);}else{_0xf2c800[_0xa472('0x44')](_0xf2c800[_0xa472('0x59')][_0x339379['id']],_0x339379);}}}return _0xf2c800[_0xa472('0x59')];};};Realtime[_0xa472('0x43')]['initVoiceQueueHopperHistory']=function(){var _0x2c9345=this;return function(_0x27d564){for(var _0x53ff72=0x0;_0x53ff72<_0x27d564[_0xa472('0x4b')];_0x53ff72+=0x1){_[_0xa472('0x5a')](_0x2c9345[_0xa472('0x15')][_0x27d564[_0x53ff72]['name']],_0x27d564[_0x53ff72]);}return _0x2c9345[_0xa472('0x15')];};};Realtime[_0xa472('0x43')][_0xa472('0x5b')]=function(){var _0x4a67bf=this;return function(_0x2aa478){clearVoiceQueues(_0x4a67bf[_0xa472('0x15')]);if(_0x2aa478){_0x2aa478=_[_0xa472('0x5c')](_0x2aa478,_0xa472('0x5d'));for(var _0x35d733 in _0x2aa478){if(_0x2aa478[_0xa472('0x25')](_0x35d733)){var _0x175748={};for(var _0x46406d=0x0;_0x46406d<_0x2aa478[_0x35d733]['length'];_0x46406d+=0x1){var _0x184073=_0x2aa478[_0x35d733][_0x46406d][_0xa472('0x5e')];if(_0x4a67bf['voiceQueues'][_0x184073]){if(_0x2aa478[_0x35d733][_0x46406d][_0xa472('0x5f')]){_0x4a67bf[_0xa472('0x15')][_0x184073][_0xa472('0x31')]+=0x1;}if(_0x2aa478[_0x35d733][_0x46406d][_0xa472('0x60')]){_0x4a67bf['voiceQueues'][_0x184073][_0xa472('0x32')]+=0x1;}_0x4a67bf['voiceQueues'][_0x184073]['sumHoldTime']+=moment(_0x2aa478[_0x35d733][_0x46406d]['queuecallerleaveAt'])[_0xa472('0x61')](moment(_0x2aa478[_0x35d733][_0x46406d][_0xa472('0x62')]),_0xa472('0x63'))||0x0;if(_0x46406d===_0x2aa478[_0x35d733][_0xa472('0x4b')]-0x1){_0x4a67bf[_0xa472('0x15')][_0x184073]['sumDuration']+=moment(_0x2aa478[_0x35d733][_0x46406d][_0xa472('0x64')]||_0x2aa478[_0x35d733][_0x46406d][_0xa472('0x65')]||_0x2aa478[_0x35d733][_0x46406d][_0xa472('0x66')])[_0xa472('0x61')](moment(_0x2aa478[_0x35d733][_0x46406d][_0xa472('0x62')]),'seconds')||0x0;_0x4a67bf[_0xa472('0x15')][_0x184073][_0xa472('0x2b')]+=0x1;if(_0x2aa478[_0x35d733][_0x46406d][_0xa472('0x67')]){_0x4a67bf['voiceQueues'][_0x184073][_0xa472('0x2c')]+=0x1;_0x4a67bf[_0xa472('0x15')][_0x184073][_0xa472('0x34')]+=moment(_0x2aa478[_0x35d733][_0x46406d]['queuecallercompleteAt'])[_0xa472('0x61')](moment(_0x2aa478[_0x35d733][_0x46406d][_0xa472('0x68')]),'seconds')||0x0;}}else{_0x4a67bf[_0xa472('0x15')][_0x184073][_0xa472('0x33')]+=_0x4a67bf[_0xa472('0x15')][_0x184073][_0xa472('0x2d')]||0x0;}}}}}}return _0x4a67bf[_0xa472('0x15')];};};Realtime[_0xa472('0x43')]['initVoiceCallReports']=function(){var _0xd04ea2=this;return function(_0x117a86){clearVoiceCallReports(_0xd04ea2['outbound']);if(_0x117a86){for(var _0x5b40bc=0x0;_0x5b40bc<_0x117a86['length'];_0x5b40bc+=0x1){_0xd04ea2['outbound'][_0xa472('0x2b')]+=0x1;_0xd04ea2[_0xa472('0x17')][_0xa472('0x33')]+=_0x117a86[_0x5b40bc]['duration'];if(_0x117a86[_0x5b40bc]['disposition']===_0xa472('0x69')){_0xd04ea2[_0xa472('0x17')][_0xa472('0x2c')]+=0x1;_0xd04ea2[_0xa472('0x17')]['sumHoldTime']+=_0x117a86[_0x5b40bc][_0xa472('0x6a')]-_0x117a86[_0x5b40bc][_0xa472('0x6b')]||0x0;_0xd04ea2['outbound']['sumBillable']+=_0x117a86[_0x5b40bc][_0xa472('0x6b')];}}}return _0xd04ea2[_0xa472('0x17')];};};Realtime['prototype']['initCampaigns']=function(){var _0x2b36e5=this;return function(_0x460756){if(_0x460756){freeIsNotKey(_0x460756,_0x2b36e5['campaigns'],_0xa472('0x2a'));for(var _0x1ceab7=0x0,_0x393b7d={};_0x1ceab7<_0x460756[_0xa472('0x4b')];_0x1ceab7+=0x1){_0x393b7d=_0x460756[_0x1ceab7];if(_[_0xa472('0x46')](_0x2b36e5[_0xa472('0x6c')][_0x393b7d['name']])){_0x2b36e5[_0xa472('0x6c')][_0x393b7d['name']]=new Campaign(_0x393b7d);}else{_0x2b36e5[_0xa472('0x44')](_0x2b36e5['campaigns'][_0x393b7d[_0xa472('0x2a')]],_0x393b7d);_0x2b36e5[_0xa472('0x6c')][_0x393b7d[_0xa472('0x2a')]]['dialQueueProject']=_0x393b7d[_0xa472('0x6d')]?_0x393b7d[_0xa472('0x6d')][_0xa472('0x2a')]:undefined;}}}return _0x2b36e5[_0xa472('0x6c')];};};Realtime[_0xa472('0x43')][_0xa472('0x6e')]=function(){var _0x313f6a=this;return function(_0x7d325f){if(_0x7d325f){freeIsNotKey(_0x7d325f,_0x313f6a[_0xa472('0x6f')],'id');for(var _0x23dd1b=0x0,_0x1ecdf5={};_0x23dd1b<_0x7d325f['length'];_0x23dd1b+=0x1){_0x1ecdf5=_0x7d325f[_0x23dd1b];if(_[_0xa472('0x46')](_0x313f6a['voiceExtensions'][_0x1ecdf5['id']])){_0x313f6a[_0xa472('0x6f')][_0x1ecdf5['id']]=new VoiceExtension(_0x1ecdf5);}else{_0x313f6a[_0xa472('0x44')](_0x313f6a[_0xa472('0x6f')][_0x1ecdf5['id']],_0x1ecdf5);}}}return _0x313f6a[_0xa472('0x6f')];};};Realtime[_0xa472('0x43')][_0xa472('0x70')]=function(){var _0xa600c5=this;return function(_0x4fb693){clearCampaigns(_0xa600c5[_0xa472('0x6c')]);for(var _0x2746ad=0x0;_0x2746ad<_0x4fb693['length'];_0x2746ad+=0x1){_['merge'](_0xa600c5['campaigns'][_0x4fb693[_0x2746ad][_0xa472('0x2a')]],_0x4fb693[_0x2746ad]);}return _0xa600c5[_0xa472('0x6c')];};};Realtime[_0xa472('0x43')]['initFaxAccounts']=function(){var _0x3d91be=this;return function(_0x3c126c){if(_0x3c126c){freeIsNotKey(_0x3c126c,_0x3d91be[_0xa472('0x23')],'id');for(var _0x490367=0x0,_0x1ee90b={},_0x551f68={};_0x490367<_0x3c126c['length'];_0x490367+=0x1){_0x1ee90b=_0x3c126c[_0x490367];if(_[_0xa472('0x46')](_0x3d91be[_0xa472('0x23')][_0x1ee90b['id']])){_0x3d91be[_0xa472('0x23')][_0x1ee90b['id']]=new FaxAccount(_0x1ee90b);}else{_0x3d91be[_0xa472('0x44')](_0x3d91be['faxAccounts'][_0x1ee90b['id']],_0x1ee90b);}}}return _0x3d91be[_0xa472('0x23')];};};module[_0xa472('0x71')]=Realtime;
\ No newline at end of file
+var _0x65eb=['initVtigerAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initFaxAccounts','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','timers','settings','zendeskAccounts','freshdeskAccounts','deskAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','interface','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isNil','isUndefined','initTelephones','initTrunks','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0x65eb,0x16b));var _0xb65e=function(_0x368764,_0x3d0eac){_0x368764=_0x368764-0x0;var _0x38b0ee=_0x65eb[_0x368764];return _0x38b0ee;};'use strict';var BPromise=require(_0xb65e('0x0'));var util=require(_0xb65e('0x1'));var _=require(_0xb65e('0x2'));var moment=require(_0xb65e('0x3'));var Agent=require('../model/agent');var Telephone=require(_0xb65e('0x4'));var Trunk=require(_0xb65e('0x5'));var VoiceQueue=require(_0xb65e('0x6'));var Trigger=require(_0xb65e('0x7'));var Template=require(_0xb65e('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xb65e('0x9'));var ZendeskAccount=require(_0xb65e('0xa'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xb65e('0xb'));var ZohoAccount=require(_0xb65e('0xc'));var DeskAccount=require(_0xb65e('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xb65e('0xe'));var Dynamics365Account=require(_0xb65e('0xf'));var FreshsalesAccount=require(_0xb65e('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xb65e('0x11')]={};this[_0xb65e('0x12')]={};this[_0xb65e('0x13')]={};this[_0xb65e('0x14')]={};this[_0xb65e('0x15')]={};this[_0xb65e('0x16')]={};this[_0xb65e('0x17')]={};this[_0xb65e('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xb65e('0x19')]={};this[_0xb65e('0x1a')]={};this['outboundChannels']={};this[_0xb65e('0x1b')]={};this[_0xb65e('0x1c')]={};this[_0xb65e('0x1d')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0xb65e('0x1e')]={};this['zohoAccounts']={};this[_0xb65e('0x1f')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this[_0xb65e('0x20')]={};this[_0xb65e('0x21')]={};};function freeIsNotKey(_0x53d9d2,_0x2d09ab,_0x5b40ea){var _0x3f1dd1=_[_0xb65e('0x22')](_0x53d9d2,function(_0x46d118,_0x3a8cb6){return _0x46d118[_0x5b40ea];});for(var _0x42022f in _0x2d09ab){if(_0x2d09ab[_0xb65e('0x23')](_0x42022f)){if(!_0x3f1dd1[_0x42022f]){delete _0x2d09ab[_0x42022f];}}}}function freeIsNotKeySip(_0x132baa,_0x1c87e2){var _0x19c39d=_[_0xb65e('0x22')](_0x132baa,function(_0x5b3f59,_0xbb5638){return util[_0xb65e('0x24')]('SIP/%s',_0x5b3f59[_0xb65e('0x25')]);});for(var _0x472090 in _0x1c87e2){if(_0x1c87e2['hasOwnProperty'](_0x472090)){if(!_0x19c39d[_0x472090]){delete _0x1c87e2[_0x472090];}}}}function freeIsNotKeyAgent(_0x25b663,_0x1e3264){var _0x13b46d=_[_0xb65e('0x22')](_0x25b663,function(_0x1df452,_0x390d4c){var _0x18c4cf=_['isNil'](_0x1df452[_0xb65e('0x26')])?util['format'](_0xb65e('0x27'),_0x1df452[_0xb65e('0x25')]):_0x1df452['interface'];return _0x18c4cf;});for(var _0x587088 in _0x1e3264){if(_0x1e3264[_0xb65e('0x23')](_0x587088)){if(!_0x13b46d[_0x587088]){delete _0x1e3264[_0x587088];}}}}function clearVoiceCallReports(_0x213709){_0x213709[_0xb65e('0x28')]=0x0;_0x213709[_0xb65e('0x29')]=0x0;_0x213709[_0xb65e('0x2a')]=0x0;_0x213709[_0xb65e('0x2b')]=0x0;_0x213709[_0xb65e('0x2c')]=0x0;}function clearCampaigns(_0x219cdc){if(!_[_0xb65e('0x2d')](_0x219cdc)){for(var _0x2ecb1f in _0x219cdc){if(_0x219cdc[_0xb65e('0x23')](_0x2ecb1f)){_0x219cdc[_0x2ecb1f][_0xb65e('0x2e')]=0x0;_0x219cdc[_0x2ecb1f][_0xb65e('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x2d4602){if(!_[_0xb65e('0x2d')](_0x2d4602)){for(var _0x39bb85 in _0x2d4602){if(_0x2d4602['hasOwnProperty'](_0x39bb85)){_0x2d4602[_0x39bb85][_0xb65e('0x28')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x29')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x30')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x31')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x2a')]=0x0;_0x2d4602[_0x39bb85]['sumDuration']=0x0;_0x2d4602[_0x39bb85]['sumBillable']=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x32')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x33')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x34')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x35')]=0x0;_0x2d4602[_0x39bb85]['outboundNoSuchCallsDay']=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x36')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x37')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x38')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x39')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x3a')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x3b')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x3c')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x32')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x3d')]=0x0;_0x2d4602[_0x39bb85][_0xb65e('0x3e')]=!![];}}}}Realtime[_0xb65e('0x3f')][_0xb65e('0x40')]=function(_0xf00136,_0x45f685){for(var _0x502e1b in _0x45f685){if(_0xf00136[_0xb65e('0x23')](_0x502e1b)){_0xf00136[_0x502e1b]=_0x45f685[_0x502e1b];}}};Realtime[_0xb65e('0x3f')]['initAgents']=function(){var _0xb972b0=this;return function(_0x18dd1){if(_0x18dd1){freeIsNotKeyAgent(_0x18dd1,_0xb972b0['agents']);for(var _0x56f9b1=0x0,_0x1e7584={},_0xd2bda9={};_0x56f9b1<_0x18dd1[_0xb65e('0x41')];_0x56f9b1+=0x1){_0x1e7584=_0x18dd1[_0x56f9b1];var _0x32d0fa=_[_0xb65e('0x42')](_0x1e7584[_0xb65e('0x26')])?util[_0xb65e('0x24')](_0xb65e('0x27'),_0x1e7584[_0xb65e('0x25')]):_0x1e7584[_0xb65e('0x26')];if(_[_0xb65e('0x43')](_0xb972b0['agents'][_0x32d0fa])){_0xb972b0[_0xb65e('0x11')][_0x32d0fa]=new Agent(_0x1e7584);}else{_0xb972b0['mergeFromDatabase'](_0xb972b0['agents'][_0x32d0fa],_0x1e7584);}}}return _0xb972b0['agents'];};};Realtime['prototype'][_0xb65e('0x44')]=function(){var _0x37ced2=this;return function(_0x35e5dd){if(_0x35e5dd){freeIsNotKeySip(_0x35e5dd,_0x37ced2[_0xb65e('0x12')]);for(var _0x11e237=0x0,_0x19dd92={},_0x542210={};_0x11e237<_0x35e5dd[_0xb65e('0x41')];_0x11e237+=0x1){_0x19dd92=_0x35e5dd[_0x11e237];if(_[_0xb65e('0x43')](_0x37ced2['telephones'][util[_0xb65e('0x24')](_0xb65e('0x27'),_0x19dd92['name'])])){_0x37ced2[_0xb65e('0x12')][util[_0xb65e('0x24')](_0xb65e('0x27'),_0x19dd92[_0xb65e('0x25')])]=new Telephone(_0x19dd92);}else{_0x37ced2[_0xb65e('0x40')](_0x37ced2[_0xb65e('0x12')][util[_0xb65e('0x24')](_0xb65e('0x27'),_0x19dd92[_0xb65e('0x25')])],_0x19dd92);}}}return _0x37ced2['telephones'];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x45')]=function(){var _0x4c65c3=this;return function(_0x2f9ed4){if(_0x2f9ed4){freeIsNotKeySip(_0x2f9ed4,_0x4c65c3[_0xb65e('0x13')]);for(var _0x24045e=0x0,_0x2b82ee={},_0x22ac28={};_0x24045e<_0x2f9ed4[_0xb65e('0x41')];_0x24045e+=0x1){_0x2b82ee=_0x2f9ed4[_0x24045e];if(_['isUndefined'](_0x4c65c3[_0xb65e('0x13')][util[_0xb65e('0x24')](_0xb65e('0x27'),_0x2b82ee[_0xb65e('0x25')])])){_0x4c65c3[_0xb65e('0x13')][util[_0xb65e('0x24')]('SIP/%s',_0x2b82ee[_0xb65e('0x25')])]=new Trunk(_0x2b82ee);}else{_0x4c65c3[_0xb65e('0x40')](_0x4c65c3['trunks'][util[_0xb65e('0x24')]('SIP/%s',_0x2b82ee[_0xb65e('0x25')])],_0x2b82ee);}}}return _0x4c65c3[_0xb65e('0x13')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x380e90=this;return function(_0x5bc622){if(_0x5bc622){freeIsNotKey(_0x5bc622,_0x380e90[_0xb65e('0x14')],'name');for(var _0x20cdd6=0x0,_0x52ba19={},_0x1fff34={};_0x20cdd6<_0x5bc622[_0xb65e('0x41')];_0x20cdd6+=0x1){_0x52ba19=_0x5bc622[_0x20cdd6];if(_[_0xb65e('0x43')](_0x380e90[_0xb65e('0x14')][_0x52ba19[_0xb65e('0x25')]])){_0x380e90[_0xb65e('0x14')][_0x52ba19['name']]=new VoiceQueue(_0x52ba19);}else{_0x380e90[_0xb65e('0x40')](_0x380e90[_0xb65e('0x14')][_0x52ba19[_0xb65e('0x25')]],_0x52ba19);}}}return _0x380e90['voiceQueues'];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x46')]=function(){var _0x1b8697=this;return function(_0x5ad21d){if(_0x5ad21d){freeIsNotKey(_0x5ad21d,_0x1b8697[_0xb65e('0x15')],'id');for(var _0x21e886=0x0,_0x33d28c={},_0x2363db={};_0x21e886<_0x5ad21d[_0xb65e('0x41')];_0x21e886+=0x1){_0x33d28c=_0x5ad21d[_0x21e886];if(_['isUndefined'](_0x1b8697['triggers'][_0x33d28c['id']])){_0x1b8697[_0xb65e('0x15')][_0x33d28c['id']]=new Trigger(_0x33d28c);}else{_0x1b8697[_0xb65e('0x40')](_0x1b8697[_0xb65e('0x15')][_0x33d28c['id']],_0x33d28c);}}}return _0x1b8697['triggers'];};};Realtime['prototype'][_0xb65e('0x47')]=function(){var _0x54e09a=this;return function(_0x387087){if(_0x387087){freeIsNotKey(_0x387087,_0x54e09a[_0xb65e('0x17')],'id');for(var _0x5618d7=0x0,_0x383f2e={},_0x4053d6={};_0x5618d7<_0x387087[_0xb65e('0x41')];_0x5618d7+=0x1){_0x383f2e=_0x387087[_0x5618d7];if(_[_0xb65e('0x43')](_0x54e09a[_0xb65e('0x17')][_0x383f2e['id']])){_0x54e09a[_0xb65e('0x17')][_0x383f2e['id']]=new Template(_0x383f2e);}else{_0x54e09a['mergeFromDatabase'](_0x54e09a[_0xb65e('0x17')][_0x383f2e['id']],_0x383f2e);}}}return _0x54e09a[_0xb65e('0x17')];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x48')]=function(){var _0x987e45=this;return function(_0x25c44d){if(_0x25c44d){freeIsNotKey(_0x25c44d,_0x987e45[_0xb65e('0x1d')],'id');for(var _0x499bae=0x0,_0x5cf851={},_0x293cb2={};_0x499bae<_0x25c44d['length'];_0x499bae+=0x1){_0x5cf851=_0x25c44d[_0x499bae];if(_[_0xb65e('0x43')](_0x987e45[_0xb65e('0x1d')][_0x5cf851['id']])){_0x987e45[_0xb65e('0x1d')][_0x5cf851['id']]=new ZendeskAccount(_0x5cf851);}else{_0x987e45[_0xb65e('0x40')](_0x987e45[_0xb65e('0x1d')][_0x5cf851['id']],_0x5cf851);}}}return _0x987e45[_0xb65e('0x1d')];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x49')]=function(){var _0x52a18f=this;return function(_0x4e60c5){if(_0x4e60c5){freeIsNotKey(_0x4e60c5,_0x52a18f[_0xb65e('0x4a')],'id');for(var _0x37aad9=0x0,_0x52f676={},_0x595f68={};_0x37aad9<_0x4e60c5['length'];_0x37aad9+=0x1){_0x52f676=_0x4e60c5[_0x37aad9];if(_[_0xb65e('0x43')](_0x52a18f[_0xb65e('0x4a')][_0x52f676['id']])){_0x52a18f['salesforceAccounts'][_0x52f676['id']]=new SalesforceAccount(_0x52f676);}else{_0x52a18f[_0xb65e('0x40')](_0x52a18f[_0xb65e('0x4a')][_0x52f676['id']],_0x52f676);}}}return _0x52a18f[_0xb65e('0x4a')];};};Realtime['prototype'][_0xb65e('0x4b')]=function(){var _0x5964e4=this;return function(_0x5637b5){if(_0x5637b5){freeIsNotKey(_0x5637b5,_0x5964e4['freshdeskAccounts'],'id');for(var _0x36c2a=0x0,_0x39e8c8={},_0x210b0c={};_0x36c2a<_0x5637b5[_0xb65e('0x41')];_0x36c2a+=0x1){_0x39e8c8=_0x5637b5[_0x36c2a];if(_[_0xb65e('0x43')](_0x5964e4[_0xb65e('0x1e')][_0x39e8c8['id']])){_0x5964e4[_0xb65e('0x1e')][_0x39e8c8['id']]=new FreshdeskAccount(_0x39e8c8);}else{_0x5964e4[_0xb65e('0x40')](_0x5964e4['freshdeskAccounts'][_0x39e8c8['id']],_0x39e8c8);}}}return _0x5964e4[_0xb65e('0x1e')];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x4c')]=function(){var _0xaee124=this;return function(_0xba72fa){if(_0xba72fa){freeIsNotKey(_0xba72fa,_0xaee124[_0xb65e('0x4d')],'id');for(var _0x3ff5e2=0x0,_0x24dce4={},_0x10c932={};_0x3ff5e2<_0xba72fa['length'];_0x3ff5e2+=0x1){_0x24dce4=_0xba72fa[_0x3ff5e2];if(_[_0xb65e('0x43')](_0xaee124['zohoAccounts'][_0x24dce4['id']])){_0xaee124[_0xb65e('0x4d')][_0x24dce4['id']]=new ZohoAccount(_0x24dce4);}else{_0xaee124[_0xb65e('0x40')](_0xaee124[_0xb65e('0x4d')][_0x24dce4['id']],_0x24dce4);}}}return _0xaee124[_0xb65e('0x4d')];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x4e')]=function(){var _0x2c9586=this;return function(_0x1a1ff6){if(_0x1a1ff6){freeIsNotKey(_0x1a1ff6,_0x2c9586[_0xb65e('0x1f')],'id');for(var _0x1350a3=0x0,_0x253fc1={},_0x5479eb={};_0x1350a3<_0x1a1ff6[_0xb65e('0x41')];_0x1350a3+=0x1){_0x253fc1=_0x1a1ff6[_0x1350a3];if(_[_0xb65e('0x43')](_0x2c9586['deskAccounts'][_0x253fc1['id']])){_0x2c9586[_0xb65e('0x1f')][_0x253fc1['id']]=new DeskAccount(_0x253fc1);}else{_0x2c9586[_0xb65e('0x40')](_0x2c9586[_0xb65e('0x1f')][_0x253fc1['id']],_0x253fc1);}}}return _0x2c9586[_0xb65e('0x1f')];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x4f')]=function(){var _0x5e0724=this;return function(_0x6042a7){if(_0x6042a7){freeIsNotKey(_0x6042a7,_0x5e0724[_0xb65e('0x50')],'id');for(var _0x1661c2=0x0,_0x2c462e={},_0x3a0caa={};_0x1661c2<_0x6042a7['length'];_0x1661c2+=0x1){_0x2c462e=_0x6042a7[_0x1661c2];if(_[_0xb65e('0x43')](_0x5e0724[_0xb65e('0x50')][_0x2c462e['id']])){_0x5e0724[_0xb65e('0x50')][_0x2c462e['id']]=new SugarcrmAccount(_0x2c462e);}else{_0x5e0724['mergeFromDatabase'](_0x5e0724[_0xb65e('0x50')][_0x2c462e['id']],_0x2c462e);}}}return _0x5e0724[_0xb65e('0x50')];};};Realtime['prototype'][_0xb65e('0x51')]=function(){var _0x215c4b=this;return function(_0x4c61de){if(_0x4c61de){freeIsNotKey(_0x4c61de,_0x215c4b[_0xb65e('0x52')],'id');for(var _0x566bb4=0x0,_0xe7daf4={},_0x36b289={};_0x566bb4<_0x4c61de[_0xb65e('0x41')];_0x566bb4+=0x1){_0xe7daf4=_0x4c61de[_0x566bb4];if(_[_0xb65e('0x43')](_0x215c4b[_0xb65e('0x52')][_0xe7daf4['id']])){_0x215c4b[_0xb65e('0x52')][_0xe7daf4['id']]=new VtigerAccount(_0xe7daf4);}else{_0x215c4b[_0xb65e('0x40')](_0x215c4b[_0xb65e('0x52')][_0xe7daf4['id']],_0xe7daf4);}}}return _0x215c4b[_0xb65e('0x52')];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x53')]=function(){var _0x506edd=this;return function(_0x1a17b8){if(_0x1a17b8){freeIsNotKey(_0x1a17b8,_0x506edd[_0xb65e('0x54')],'id');for(var _0x34bd09=0x0,_0x1eb853={},_0x3a18f8={};_0x34bd09<_0x1a17b8[_0xb65e('0x41')];_0x34bd09+=0x1){_0x1eb853=_0x1a17b8[_0x34bd09];if(_[_0xb65e('0x43')](_0x506edd[_0xb65e('0x54')][_0x1eb853['id']])){_0x506edd[_0xb65e('0x54')][_0x1eb853['id']]=new ServicenowAccount(_0x1eb853);}else{_0x506edd[_0xb65e('0x40')](_0x506edd[_0xb65e('0x54')][_0x1eb853['id']],_0x1eb853);}}}return _0x506edd['servicenowAccounts'];};};Realtime['prototype'][_0xb65e('0x55')]=function(){var _0x215006=this;return function(_0x532a7b){if(_0x532a7b){freeIsNotKey(_0x532a7b,_0x215006[_0xb65e('0x56')],'id');for(var _0x53cb6a=0x0,_0x50eb7a={},_0x39f87f={};_0x53cb6a<_0x532a7b['length'];_0x53cb6a+=0x1){_0x50eb7a=_0x532a7b[_0x53cb6a];if(_[_0xb65e('0x43')](_0x215006[_0xb65e('0x56')][_0x50eb7a['id']])){_0x215006[_0xb65e('0x56')][_0x50eb7a['id']]=new Dynamics365Account(_0x50eb7a);}else{_0x215006[_0xb65e('0x40')](_0x215006[_0xb65e('0x56')][_0x50eb7a['id']],_0x50eb7a);}}}return _0x215006[_0xb65e('0x56')];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x57')]=function(){var _0x5669ac=this;return function(_0x516f5b){if(_0x516f5b){freeIsNotKey(_0x516f5b,_0x5669ac[_0xb65e('0x20')],'id');for(var _0x25daf6=0x0,_0xf43d95={},_0x56011f={};_0x25daf6<_0x516f5b['length'];_0x25daf6+=0x1){_0xf43d95=_0x516f5b[_0x25daf6];if(_[_0xb65e('0x43')](_0x5669ac[_0xb65e('0x20')][_0xf43d95['id']])){_0x5669ac[_0xb65e('0x20')][_0xf43d95['id']]=new FreshsalesAccount(_0xf43d95);}else{_0x5669ac[_0xb65e('0x40')](_0x5669ac[_0xb65e('0x20')][_0xf43d95['id']],_0xf43d95);}}}return _0x5669ac[_0xb65e('0x20')];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x58')]=function(){var _0x1354a4=this;return function(_0x25ef3d){for(var _0x24c801=0x0;_0x24c801<_0x25ef3d['length'];_0x24c801+=0x1){_[_0xb65e('0x59')](_0x1354a4[_0xb65e('0x14')][_0x25ef3d[_0x24c801]['name']],_0x25ef3d[_0x24c801]);}return _0x1354a4[_0xb65e('0x14')];};};Realtime[_0xb65e('0x3f')]['initVoiceQueueReports']=function(){var _0x55cd88=this;return function(_0x4f3dd9){clearVoiceQueues(_0x55cd88[_0xb65e('0x14')]);if(_0x4f3dd9){_0x4f3dd9=_[_0xb65e('0x5a')](_0x4f3dd9,_0xb65e('0x5b'));for(var _0x2364b7 in _0x4f3dd9){if(_0x4f3dd9[_0xb65e('0x23')](_0x2364b7)){var _0x38fa53={};for(var _0x827f9f=0x0;_0x827f9f<_0x4f3dd9[_0x2364b7]['length'];_0x827f9f+=0x1){var _0x5564a6=_0x4f3dd9[_0x2364b7][_0x827f9f][_0xb65e('0x5c')];if(_0x55cd88[_0xb65e('0x14')][_0x5564a6]){if(_0x4f3dd9[_0x2364b7][_0x827f9f][_0xb65e('0x5d')]){_0x55cd88[_0xb65e('0x14')][_0x5564a6]['unmanaged']+=0x1;}if(_0x4f3dd9[_0x2364b7][_0x827f9f][_0xb65e('0x5e')]){_0x55cd88[_0xb65e('0x14')][_0x5564a6][_0xb65e('0x31')]+=0x1;}_0x55cd88[_0xb65e('0x14')][_0x5564a6]['sumHoldTime']+=moment(_0x4f3dd9[_0x2364b7][_0x827f9f][_0xb65e('0x5f')])[_0xb65e('0x60')](moment(_0x4f3dd9[_0x2364b7][_0x827f9f][_0xb65e('0x61')]),_0xb65e('0x62'))||0x0;if(_0x827f9f===_0x4f3dd9[_0x2364b7][_0xb65e('0x41')]-0x1){_0x55cd88[_0xb65e('0x14')][_0x5564a6][_0xb65e('0x2b')]+=moment(_0x4f3dd9[_0x2364b7][_0x827f9f]['queuecallercompleteAt']||_0x4f3dd9[_0x2364b7][_0x827f9f][_0xb65e('0x63')]||_0x4f3dd9[_0x2364b7][_0x827f9f]['queuecallerexitAt'])[_0xb65e('0x60')](moment(_0x4f3dd9[_0x2364b7][_0x827f9f][_0xb65e('0x61')]),_0xb65e('0x62'))||0x0;_0x55cd88[_0xb65e('0x14')][_0x5564a6][_0xb65e('0x28')]+=0x1;if(_0x4f3dd9[_0x2364b7][_0x827f9f][_0xb65e('0x64')]){_0x55cd88['voiceQueues'][_0x5564a6]['answered']+=0x1;_0x55cd88[_0xb65e('0x14')][_0x5564a6][_0xb65e('0x2c')]+=moment(_0x4f3dd9[_0x2364b7][_0x827f9f][_0xb65e('0x65')])[_0xb65e('0x60')](moment(_0x4f3dd9[_0x2364b7][_0x827f9f][_0xb65e('0x5f')]),'seconds')||0x0;}}else{_0x55cd88[_0xb65e('0x14')][_0x5564a6][_0xb65e('0x2b')]+=_0x55cd88[_0xb65e('0x14')][_0x5564a6][_0xb65e('0x2a')]||0x0;}}}}}}return _0x55cd88['voiceQueues'];};};Realtime[_0xb65e('0x3f')][_0xb65e('0x66')]=function(){var _0x471004=this;return function(_0xdbdbec){clearVoiceCallReports(_0x471004['outbound']);if(_0xdbdbec){for(var _0x52ef0d=0x0;_0x52ef0d<_0xdbdbec[_0xb65e('0x41')];_0x52ef0d+=0x1){_0x471004['outbound'][_0xb65e('0x28')]+=0x1;_0x471004[_0xb65e('0x18')][_0xb65e('0x2b')]+=_0xdbdbec[_0x52ef0d][_0xb65e('0x67')];if(_0xdbdbec[_0x52ef0d][_0xb65e('0x68')]==='ANSWERED'){_0x471004[_0xb65e('0x18')][_0xb65e('0x29')]+=0x1;_0x471004[_0xb65e('0x18')][_0xb65e('0x2a')]+=_0xdbdbec[_0x52ef0d][_0xb65e('0x67')]-_0xdbdbec[_0x52ef0d][_0xb65e('0x69')]||0x0;_0x471004[_0xb65e('0x18')][_0xb65e('0x2c')]+=_0xdbdbec[_0x52ef0d]['billableseconds'];}}}return _0x471004[_0xb65e('0x18')];};};Realtime['prototype'][_0xb65e('0x6a')]=function(){var _0x1a8e42=this;return function(_0x38b226){if(_0x38b226){freeIsNotKey(_0x38b226,_0x1a8e42['campaigns'],_0xb65e('0x25'));for(var _0x2177d5=0x0,_0x4dd671={};_0x2177d5<_0x38b226[_0xb65e('0x41')];_0x2177d5+=0x1){_0x4dd671=_0x38b226[_0x2177d5];if(_[_0xb65e('0x43')](_0x1a8e42[_0xb65e('0x16')][_0x4dd671[_0xb65e('0x25')]])){_0x1a8e42[_0xb65e('0x16')][_0x4dd671['name']]=new Campaign(_0x4dd671);}else{_0x1a8e42[_0xb65e('0x40')](_0x1a8e42[_0xb65e('0x16')][_0x4dd671[_0xb65e('0x25')]],_0x4dd671);_0x1a8e42[_0xb65e('0x16')][_0x4dd671[_0xb65e('0x25')]][_0xb65e('0x6b')]=_0x4dd671['SquareProject']?_0x4dd671['SquareProject'][_0xb65e('0x25')]:undefined;}}}return _0x1a8e42[_0xb65e('0x16')];};};Realtime['prototype'][_0xb65e('0x6c')]=function(){var _0x181c80=this;return function(_0x105911){if(_0x105911){freeIsNotKey(_0x105911,_0x181c80[_0xb65e('0x6d')],'id');for(var _0x25c181=0x0,_0x302e77={};_0x25c181<_0x105911[_0xb65e('0x41')];_0x25c181+=0x1){_0x302e77=_0x105911[_0x25c181];if(_[_0xb65e('0x43')](_0x181c80['voiceExtensions'][_0x302e77['id']])){_0x181c80[_0xb65e('0x6d')][_0x302e77['id']]=new VoiceExtension(_0x302e77);}else{_0x181c80[_0xb65e('0x40')](_0x181c80['voiceExtensions'][_0x302e77['id']],_0x302e77);}}}return _0x181c80[_0xb65e('0x6d')];};};Realtime[_0xb65e('0x3f')]['initCampaignHopperHistory']=function(){var _0xc29d57=this;return function(_0x4be3df){clearCampaigns(_0xc29d57['campaigns']);for(var _0x35644a=0x0;_0x35644a<_0x4be3df['length'];_0x35644a+=0x1){_[_0xb65e('0x59')](_0xc29d57[_0xb65e('0x16')][_0x4be3df[_0x35644a]['name']],_0x4be3df[_0x35644a]);}return _0xc29d57[_0xb65e('0x16')];};};Realtime['prototype'][_0xb65e('0x6e')]=function(){var _0x4216e2=this;return function(_0x2a52f4){if(_0x2a52f4){freeIsNotKey(_0x2a52f4,_0x4216e2[_0xb65e('0x21')],'id');for(var _0x5a2967=0x0,_0xed3dc3={},_0x427d46={};_0x5a2967<_0x2a52f4['length'];_0x5a2967+=0x1){_0xed3dc3=_0x2a52f4[_0x5a2967];if(_['isUndefined'](_0x4216e2['faxAccounts'][_0xed3dc3['id']])){_0x4216e2[_0xb65e('0x21')][_0xed3dc3['id']]=new FaxAccount(_0xed3dc3);}else{_0x4216e2[_0xb65e('0x40')](_0x4216e2[_0xb65e('0x21')][_0xed3dc3['id']],_0xed3dc3);}}}return _0x4216e2[_0xb65e('0x21')];};};module['exports']=Realtime;
\ No newline at end of file
index 15591c5..812e644 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81a4=['prototype','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','format','SIP/%s','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','match','getAgentByInternal','keys','length','getCallType','channel','split','outbound','internal','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','calleridnum','transfers','linkedid','transfereelinkedid','uniqueid','isNil','UserId','create','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','indexOf','mobile','phone','substring','voiceDialReport','transfererlinkedid','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','agents','telephones'];(function(_0x2fa4fd,_0x5c2a41){var _0x445a78=function(_0x46154d){while(--_0x46154d){_0x2fa4fd['push'](_0x2fa4fd['shift']());}};_0x445a78(++_0x5c2a41);}(_0x81a4,0x110));var _0x481a=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0x81a4[_0x450bf9];return _0x268350;};'use strict';var _=require(_0x481a('0x0'));var moment=require(_0x481a('0x1'));var util=require(_0x481a('0x2'));var config=require('../../../config/environment');var ami=require(_0x481a('0x3'));var RpcVoiceAgentReport=require(_0x481a('0x4'));var RpcVoiceCallReport=require(_0x481a('0x5'));var RpcVoiceDialReport=require(_0x481a('0x6'));var RpcMemberReport=require(_0x481a('0x7'));var RpcVoiceQueueReport=require(_0x481a('0x8'));var RpcVoiceRecording=require(_0x481a('0x9'));var RpcVoiceTransferReport=require(_0x481a('0xa'));var VoiceQueueReport=require(_0x481a('0xb'));var VoiceCallReport=require(_0x481a('0xc'));var VoiceAgentReport=require(_0x481a('0xd'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0xff51ed){this['realtime']=_0xff51ed;this[_0x481a('0xe')]=_0xff51ed[_0x481a('0xe')];this[_0x481a('0xf')]=_0xff51ed[_0x481a('0xf')];}Report[_0x481a('0x10')][_0x481a('0x11')]=function(_0x2c52a2){var _0x299ab0=new VoiceQueueReport(this['realtime']);var _0x644c3f=new VoiceAgentReport(this[_0x481a('0x12')]);var _0x303123=new VoiceDialReport(this['realtime']);var _0x54ce22=new VoiceCallReport(this['realtime']);var _0x503b03=new UserReport(this[_0x481a('0x12')]);if(config[_0x481a('0x13')]&&config['xdr']['disabled']){ami['on'](_0x481a('0x14'),this[_0x481a('0x15')][_0x481a('0x16')](this));ami['on'](_0x481a('0x17'),this[_0x481a('0x18')][_0x481a('0x16')](this));ami['on'](_0x481a('0x19'),this[_0x481a('0x1a')][_0x481a('0x16')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0x481a('0x16')](this));ami['on'](_0x481a('0x1b'),this[_0x481a('0x1c')][_0x481a('0x16')](this));ami['on'](_0x481a('0x1d'),this[_0x481a('0x1e')][_0x481a('0x16')](this));}};Report[_0x481a('0x10')][_0x481a('0x1f')]=function(_0x4b312d){var _0x59b2e1;_0x59b2e1=_[_0x481a('0x20')](this['agents'],function(_0x12d7f4){return _0x12d7f4[_0x481a('0x21')]==_0x4b312d||_0x12d7f4['name']==_0x4b312d;});if(_['isNil'](_0x59b2e1)){var _0x31f987=_[_0x481a('0x20')](this['telephones'],function(_0x38ccc2){return _0x38ccc2[_0x481a('0x21')]==_0x4b312d||_0x38ccc2[_0x481a('0x22')]==_0x4b312d;});if(_0x31f987){_0x59b2e1=_[_0x481a('0x20')](this[_0x481a('0xe')],function(_0x519461){return _0x519461['interface']==util[_0x481a('0x23')](_0x481a('0x24'),_0x31f987[_0x481a('0x22')]);});}}return _0x59b2e1;};Report[_0x481a('0x10')][_0x481a('0x15')]=function(_0x3f6e6d){for(var _0x2fb931=0x0;_0x2fb931<_0x3f6e6d['length'];_0x2fb931+=0x1){var _0xe8c843=this[_0x481a('0x1f')](_0x3f6e6d[_0x2fb931][_0x481a('0x25')]);if(_0xe8c843){_0x3f6e6d[_0x2fb931][_0x481a('0x21')]=_0xe8c843[_0x481a('0x21')];_0x3f6e6d[_0x2fb931][_0x481a('0x26')]=!![];_0x3f6e6d[_0x2fb931][_0x481a('0x27')]=_0xe8c843['name'];_0x3f6e6d[_0x2fb931][_0x481a('0x28')]=_['isNil'](_0xe8c843[_0x481a('0x28')])?util[_0x481a('0x23')]('SIP/%s',_0xe8c843[_0x481a('0x22')]):_0xe8c843[_0x481a('0x28')];if(_0x3f6e6d[_0x2fb931]['queuecallercomplete']){_0x3f6e6d[_0x2fb931][_0x481a('0x29')]=moment()[_0x481a('0x23')](_0x481a('0x2a'));}if(_0x3f6e6d[_0x2fb931]['queuecallerexit']){_0x3f6e6d[_0x2fb931]['queuecallerexitAt']=moment()[_0x481a('0x23')](_0x481a('0x2a'));}RpcMemberReport[_0x481a('0x15')](_0x3f6e6d[_0x2fb931]);}RpcVoiceQueueReport['create'](_0x3f6e6d[_0x2fb931]);}};function extractCalleridNumber(_0x1706cb){var _0x2b5908=_0x1706cb[_0x481a('0x2b')](/<(.*?)>/);return _0x2b5908?_0x2b5908[0x1]:_0x1706cb;}Report[_0x481a('0x10')][_0x481a('0x2c')]=function(_0x19e3ee){for(var _0x3393a5=0x0;_0x3393a5<Object[_0x481a('0x2d')](this[_0x481a('0xe')])[_0x481a('0x2e')];_0x3393a5++){var _0x22b5c3=Object[_0x481a('0x2d')](this['agents'])[_0x3393a5];var _0x3c2420=this[_0x481a('0xe')][_0x22b5c3];if(_0x3c2420['accountcode']===Number(_0x19e3ee))return _0x3c2420;}return null;};Report[_0x481a('0x10')][_0x481a('0x2f')]=function(_0x433355){var _0x2f1f06=_0x433355[_0x481a('0x30')][_0x481a('0x31')]('-')[0x0];var _0x2fa24a=this[_0x481a('0xe')][_0x2f1f06];if(!_0x2fa24a)_0x2fa24a=this[_0x481a('0x2c')](_0x433355['calleridnum']);return!_0x2fa24a?_0x481a('0x32'):_0x481a('0x33');};Report[_0x481a('0x10')]['voiceCallReport']=function(_0xe5ed2d){_0xe5ed2d[_0x481a('0x34')]=_0xe5ed2d['destination']||_0xe5ed2d[_0x481a('0x35')];if(_0xe5ed2d[_0x481a('0x36')]==_0x481a('0x37')){_0xe5ed2d[_0x481a('0x38')]=_0x481a('0x39');_0xe5ed2d[_0x481a('0x3a')]=_0xe5ed2d[_0x481a('0x39')];if(_0xe5ed2d[_0x481a('0x3b')]==_0x481a('0x3c')){_0xe5ed2d[_0x481a('0x21')]='';_0xe5ed2d[_0x481a('0x34')]=extractCalleridNumber(_0xe5ed2d[_0x481a('0x3d')]);}else if(_0xe5ed2d[_0x481a('0x3b')]==_0x481a('0x3e')){if(_0xe5ed2d[_0x481a('0x34')]==_0x481a('0x3f')){_0xe5ed2d[_0x481a('0x34')]=extractCalleridNumber(_0xe5ed2d[_0x481a('0x40')]);_0xe5ed2d['calleridnum']=_0xe5ed2d[_0x481a('0x41')];_0xe5ed2d[_0x481a('0x42')]=[_0xe5ed2d[_0x481a('0x30')],_0xe5ed2d[_0x481a('0x30')]=_0xe5ed2d[_0x481a('0x42')]][0x0];_0xe5ed2d[_0x481a('0x3d')]=_0xe5ed2d[_0x481a('0x40')];}else{_0xe5ed2d['destination']=_0xe5ed2d['calleridnum'];_0xe5ed2d['calleridnum']=_0xe5ed2d[_0x481a('0x41')];if(_0xe5ed2d[_0x481a('0x43')]==_0x481a('0x44')){_0xe5ed2d['accountcode']=_0xe5ed2d['connectedlinenum'];}else{_0xe5ed2d['accountcode']='';}}}}else{_0xe5ed2d['callerid']=util[_0x481a('0x23')](_0x481a('0x45'),_0xe5ed2d[_0x481a('0x46')],_0xe5ed2d[_0x481a('0x47')]);}if(RpcVoiceTransferReport[_0x481a('0x48')][_0xe5ed2d[_0x481a('0x49')]]){var _0x4fa944=RpcVoiceTransferReport[_0x481a('0x48')][_0xe5ed2d[_0x481a('0x49')]];_0x4fa944[_0x481a('0x4a')]=_0xe5ed2d[_0x481a('0x4b')];RpcVoiceTransferReport[_0x481a('0x1c')](_0x4fa944);delete RpcVoiceTransferReport[_0x481a('0x48')][_0xe5ed2d['linkedid']];}if(_[_0x481a('0x4c')](_0xe5ed2d[_0x481a('0x36')])){_0xe5ed2d[_0x481a('0x36')]=this[_0x481a('0x2f')](_0xe5ed2d);}if(_['isNil'](_0xe5ed2d[_0x481a('0x4d')])){var _0x38cdee=_0xe5ed2d[_0x481a('0x30')]['split']('-')[0x0];var _0x888eca=this[_0x481a('0xe')][_0x38cdee];if(!_0x888eca)_0x888eca=this['getAgentByInternal'](_0xe5ed2d[_0x481a('0x21')]);if(_0x888eca){_0xe5ed2d['UserId']=_0x888eca['id'];_0xe5ed2d['membername']=_0x888eca[_0x481a('0x22')];}}RpcVoiceCallReport[_0x481a('0x4e')](_0xe5ed2d);if(_0xe5ed2d['monitor']){for(var _0x14272a=0x0;_0x14272a<_0xe5ed2d[_0x481a('0x4f')]['length'];_0x14272a+=0x1){_0xe5ed2d[_0x481a('0x50')]=_0xe5ed2d[_0x481a('0x4f')][_0x14272a][_0x481a('0x51')];_0xe5ed2d[_0x481a('0x52')]=_0xe5ed2d[_0x481a('0x4f')][_0x14272a]['createdAt'];if(_0xe5ed2d[_0x481a('0x35')]==_0x481a('0x3f')){_0xe5ed2d['calleridnum']=_0xe5ed2d[_0x481a('0x25')];_0xe5ed2d['calleridname']=_0xe5ed2d[_0x481a('0x53')];_0xe5ed2d[_0x481a('0x25')]=_0xe5ed2d[_0x481a('0x21')];_0xe5ed2d['connectedlinename']=_0xe5ed2d[_0x481a('0x54')];_0xe5ed2d[_0x481a('0x35')]=_0xe5ed2d['originatecalleridnum'];}else if(_0xe5ed2d['exten']==_0x481a('0x55')){_0xe5ed2d[_0x481a('0x47')]=_0xe5ed2d[_0x481a('0x34')];_0xe5ed2d['exten']=_0xe5ed2d[_0x481a('0x41')];}RpcVoiceRecording[_0x481a('0x4e')](_0xe5ed2d);}}};Report['prototype']['voiceAgentReport']=function(_0xcda252){if(_[_0x481a('0x56')](_0xcda252)){_0xcda252[_0x481a('0x57')](function(_0x3cd086){RpcVoiceAgentReport['create'](_0x3cd086);});}else{RpcVoiceAgentReport['create'](_0xcda252);}};Report[_0x481a('0x10')]['voiceDialReport']=function(_0x2a5331){RpcVoiceDialReport[_0x481a('0x4e')](_0x2a5331);var _0x3a1903;var _0x3fddeb;var _0x233581=_0x2a5331[_0x481a('0x30')];if(_[_0x481a('0x58')](_0x233581,'Local')){_0x3fddeb=_0x233581['substring'](_0x233581[_0x481a('0x59')]('/')+0x1,_0x233581[_0x481a('0x59')]('@'));_0x3a1903=_[_0x481a('0x20')](this[_0x481a('0xe')],function(_0x412a8a){return _0x412a8a[_0x481a('0x5a')]==_0x3fddeb||_0x412a8a[_0x481a('0x5b')]==_0x3fddeb||_0x412a8a[_0x481a('0x21')]==_0x3fddeb;});}else{_0x3fddeb=_0x233581[_0x481a('0x5c')](_0x233581['indexOf']('/')+0x1,_0x233581['lastIndexOf']('-'));_0x3a1903=this[_0x481a('0x1f')](_0x3fddeb);}if(_0x3a1903){_0x2a5331[_0x481a('0x28')]=_[_0x481a('0x4c')](_0x3a1903['interface'])?util[_0x481a('0x23')]('SIP/%s',_0x3a1903[_0x481a('0x22')]):_0x3a1903[_0x481a('0x28')];_0x2a5331[_0x481a('0x54')]=_0x3a1903['name'];_0x2a5331[_0x481a('0x21')]=_0x3a1903['accountcode'];RpcMemberReport[_0x481a('0x5d')](_0x2a5331);}};Report[_0x481a('0x10')][_0x481a('0x1c')]=function(_0xf7581a){RpcVoiceTransferReport['transfers'][_0xf7581a[_0x481a('0x5e')]]=_0xf7581a;};Report['prototype']['attendedTransfer']=function(_0x18f63a){RpcVoiceTransferReport['attendedTransfer'](_0x18f63a);};module[_0x481a('0x5f')]=Report;
\ No newline at end of file
+var _0x7cbe=['create','match','getAgentByInternal','keys','split','outbound','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','getCallType','UserId','membername','monitorFilename','monitors','createdAt','connectedlinename','xcally-motion-dialer','forEach','startsWith','Local','substring','indexOf','lastIndexOf','transfererlinkedid','exports','lodash','moment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','name','isNil','accountcode','interface','length','connectedlinenum','lastAssignedTo','format','SIP/%s','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt'];(function(_0x682056,_0x22afec){var _0xf4af3e=function(_0xfd240e){while(--_0xfd240e){_0x682056['push'](_0x682056['shift']());}};_0xf4af3e(++_0x22afec);}(_0x7cbe,0x194));var _0xe7cb=function(_0x37496d,_0xf738a6){_0x37496d=_0x37496d-0x0;var _0x3fc0e9=_0x7cbe[_0x37496d];return _0x3fc0e9;};'use strict';var _=require(_0xe7cb('0x0'));var moment=require(_0xe7cb('0x1'));var util=require('util');var config=require('../../../config/environment');var ami=require(_0xe7cb('0x2'));var RpcVoiceAgentReport=require(_0xe7cb('0x3'));var RpcVoiceCallReport=require(_0xe7cb('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xe7cb('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xe7cb('0x6'));var RpcVoiceTransferReport=require(_0xe7cb('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xe7cb('0x8'));var VoiceAgentReport=require(_0xe7cb('0x9'));var VoiceDialReport=require(_0xe7cb('0xa'));var UserReport=require(_0xe7cb('0xb'));function Report(_0x28a2df){this['realtime']=_0x28a2df;this[_0xe7cb('0xc')]=_0x28a2df[_0xe7cb('0xc')];this['telephones']=_0x28a2df[_0xe7cb('0xd')];}Report['prototype'][_0xe7cb('0xe')]=function(_0x29699c){var _0x580916=new VoiceQueueReport(this['realtime']);var _0x2a51b6=new VoiceAgentReport(this['realtime']);var _0x30a06b=new VoiceDialReport(this[_0xe7cb('0xf')]);var _0x41155e=new VoiceCallReport(this['realtime']);var _0x44ee89=new UserReport(this[_0xe7cb('0xf')]);if(config['xdr']&&config[_0xe7cb('0x10')][_0xe7cb('0x11')]){ami['on'](_0xe7cb('0x12'),this[_0xe7cb('0x13')][_0xe7cb('0x14')](this));ami['on'](_0xe7cb('0x15'),this[_0xe7cb('0x16')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0xe7cb('0x17')]['bind'](this));ami['on'](_0xe7cb('0x18'),this[_0xe7cb('0x19')]['bind'](this));ami['on'](_0xe7cb('0x1a'),this[_0xe7cb('0x1b')][_0xe7cb('0x14')](this));ami['on'](_0xe7cb('0x1c'),this[_0xe7cb('0x1d')][_0xe7cb('0x14')](this));}};Report[_0xe7cb('0x1e')][_0xe7cb('0x1f')]=function(_0x31efe1){var _0x2c7b09;_0x2c7b09=_[_0xe7cb('0x20')](this[_0xe7cb('0xc')],function(_0x3a45ca){return _0x3a45ca['accountcode']==_0x31efe1||_0x3a45ca[_0xe7cb('0x21')]==_0x31efe1;});if(_[_0xe7cb('0x22')](_0x2c7b09)){var _0xf1413f=_[_0xe7cb('0x20')](this['telephones'],function(_0x5b4117){return _0x5b4117[_0xe7cb('0x23')]==_0x31efe1||_0x5b4117[_0xe7cb('0x21')]==_0x31efe1;});if(_0xf1413f){_0x2c7b09=_[_0xe7cb('0x20')](this[_0xe7cb('0xc')],function(_0x2b1eb0){return _0x2b1eb0[_0xe7cb('0x24')]==util['format']('SIP/%s',_0xf1413f[_0xe7cb('0x21')]);});}}return _0x2c7b09;};Report[_0xe7cb('0x1e')][_0xe7cb('0x13')]=function(_0x205b74){for(var _0x548dc3=0x0;_0x548dc3<_0x205b74[_0xe7cb('0x25')];_0x548dc3+=0x1){var _0x3cf1e2=this[_0xe7cb('0x1f')](_0x205b74[_0x548dc3][_0xe7cb('0x26')]);if(_0x3cf1e2){_0x205b74[_0x548dc3][_0xe7cb('0x23')]=_0x3cf1e2['accountcode'];_0x205b74[_0x548dc3]['assigned']=!![];_0x205b74[_0x548dc3][_0xe7cb('0x27')]=_0x3cf1e2['name'];_0x205b74[_0x548dc3][_0xe7cb('0x24')]=_[_0xe7cb('0x22')](_0x3cf1e2[_0xe7cb('0x24')])?util[_0xe7cb('0x28')](_0xe7cb('0x29'),_0x3cf1e2[_0xe7cb('0x21')]):_0x3cf1e2[_0xe7cb('0x24')];if(_0x205b74[_0x548dc3][_0xe7cb('0x2a')]){_0x205b74[_0x548dc3]['queuecallercompleteAt']=moment()[_0xe7cb('0x28')](_0xe7cb('0x2b'));}if(_0x205b74[_0x548dc3][_0xe7cb('0x2c')]){_0x205b74[_0x548dc3][_0xe7cb('0x2d')]=moment()[_0xe7cb('0x28')](_0xe7cb('0x2b'));}RpcMemberReport[_0xe7cb('0x13')](_0x205b74[_0x548dc3]);}RpcVoiceQueueReport[_0xe7cb('0x2e')](_0x205b74[_0x548dc3]);}};function extractCalleridNumber(_0x526f62){var _0x2de3a6=_0x526f62[_0xe7cb('0x2f')](/<(.*?)>/);return _0x2de3a6?_0x2de3a6[0x1]:_0x526f62;}Report[_0xe7cb('0x1e')][_0xe7cb('0x30')]=function(_0x10f03c){for(var _0x37147d=0x0;_0x37147d<Object[_0xe7cb('0x31')](this['agents'])[_0xe7cb('0x25')];_0x37147d++){var _0x516a66=Object[_0xe7cb('0x31')](this[_0xe7cb('0xc')])[_0x37147d];var _0x49fb63=this[_0xe7cb('0xc')][_0x516a66];if(_0x49fb63[_0xe7cb('0x23')]===Number(_0x10f03c))return _0x49fb63;}return null;};Report[_0xe7cb('0x1e')]['getCallType']=function(_0x5b7e52){var _0x32b8af=_0x5b7e52['channel'][_0xe7cb('0x32')]('-')[0x0];var _0x27ea58=this[_0xe7cb('0xc')][_0x32b8af];if(!_0x27ea58)_0x27ea58=this['getAgentByInternal'](_0x5b7e52['calleridnum']);return!_0x27ea58?_0xe7cb('0x33'):'internal';};Report[_0xe7cb('0x1e')][_0xe7cb('0x16')]=function(_0x2df468){_0x2df468[_0xe7cb('0x34')]=_0x2df468[_0xe7cb('0x34')]||_0x2df468[_0xe7cb('0x35')];if(_0x2df468[_0xe7cb('0x36')]==_0xe7cb('0x37')){_0x2df468[_0xe7cb('0x38')]=_0xe7cb('0x39');_0x2df468[_0xe7cb('0x3a')]=_0x2df468['queue'];if(_0x2df468['context']==_0xe7cb('0x3b')){_0x2df468['accountcode']='';_0x2df468[_0xe7cb('0x34')]=extractCalleridNumber(_0x2df468[_0xe7cb('0x3c')]);}else if(_0x2df468[_0xe7cb('0x3d')]==_0xe7cb('0x3e')){if(_0x2df468['destination']==_0xe7cb('0x3f')){_0x2df468[_0xe7cb('0x34')]=extractCalleridNumber(_0x2df468[_0xe7cb('0x40')]);_0x2df468[_0xe7cb('0x41')]=_0x2df468['originatecalleridnum'];_0x2df468[_0xe7cb('0x42')]=[_0x2df468[_0xe7cb('0x43')],_0x2df468['channel']=_0x2df468[_0xe7cb('0x42')]][0x0];_0x2df468[_0xe7cb('0x3c')]=_0x2df468[_0xe7cb('0x40')];}else{_0x2df468[_0xe7cb('0x34')]=_0x2df468[_0xe7cb('0x41')];_0x2df468[_0xe7cb('0x41')]=_0x2df468[_0xe7cb('0x44')];if(_0x2df468['disposition']=='ANSWERED'){_0x2df468[_0xe7cb('0x23')]=_0x2df468['connectedlinenum'];}else{_0x2df468[_0xe7cb('0x23')]='';}}}}else{_0x2df468[_0xe7cb('0x3c')]=util[_0xe7cb('0x28')](_0xe7cb('0x45'),_0x2df468['calleridname'],_0x2df468['calleridnum']);}if(RpcVoiceTransferReport[_0xe7cb('0x46')][_0x2df468[_0xe7cb('0x47')]]){var _0x37e3b6=RpcVoiceTransferReport['transfers'][_0x2df468[_0xe7cb('0x47')]];_0x37e3b6[_0xe7cb('0x48')]=_0x2df468[_0xe7cb('0x49')];RpcVoiceTransferReport['blindTransfer'](_0x37e3b6);delete RpcVoiceTransferReport[_0xe7cb('0x46')][_0x2df468[_0xe7cb('0x47')]];}if(_['isNil'](_0x2df468[_0xe7cb('0x36')])){_0x2df468[_0xe7cb('0x36')]=this[_0xe7cb('0x4a')](_0x2df468);}if(_['isNil'](_0x2df468[_0xe7cb('0x4b')])){var _0x18df53=_0x2df468[_0xe7cb('0x43')]['split']('-')[0x0];var _0xb23e96=this['agents'][_0x18df53];if(!_0xb23e96)_0xb23e96=this[_0xe7cb('0x30')](_0x2df468['accountcode']);if(_0xb23e96){_0x2df468['UserId']=_0xb23e96['id'];_0x2df468[_0xe7cb('0x4c')]=_0xb23e96[_0xe7cb('0x21')];}}RpcVoiceCallReport[_0xe7cb('0x2e')](_0x2df468);if(_0x2df468['monitor']){for(var _0x1ce442=0x0;_0x1ce442<_0x2df468['monitors'][_0xe7cb('0x25')];_0x1ce442+=0x1){_0x2df468[_0xe7cb('0x4d')]=_0x2df468[_0xe7cb('0x4e')][_0x1ce442]['filename'];_0x2df468['createdAt']=_0x2df468[_0xe7cb('0x4e')][_0x1ce442][_0xe7cb('0x4f')];if(_0x2df468[_0xe7cb('0x35')]==_0xe7cb('0x3f')){_0x2df468[_0xe7cb('0x41')]=_0x2df468[_0xe7cb('0x26')];_0x2df468['calleridname']=_0x2df468[_0xe7cb('0x50')];_0x2df468[_0xe7cb('0x26')]=_0x2df468[_0xe7cb('0x23')];_0x2df468[_0xe7cb('0x50')]=_0x2df468['membername'];_0x2df468[_0xe7cb('0x35')]=_0x2df468['originatecalleridnum'];}else if(_0x2df468['exten']==_0xe7cb('0x51')){_0x2df468['calleridnum']=_0x2df468[_0xe7cb('0x34')];_0x2df468[_0xe7cb('0x35')]=_0x2df468[_0xe7cb('0x44')];}RpcVoiceRecording[_0xe7cb('0x2e')](_0x2df468);}}};Report[_0xe7cb('0x1e')][_0xe7cb('0x17')]=function(_0x2b74eb){if(_['isArray'](_0x2b74eb)){_0x2b74eb[_0xe7cb('0x52')](function(_0x8551c){RpcVoiceAgentReport[_0xe7cb('0x2e')](_0x8551c);});}else{RpcVoiceAgentReport[_0xe7cb('0x2e')](_0x2b74eb);}};Report['prototype'][_0xe7cb('0x19')]=function(_0x1c5558){RpcVoiceDialReport[_0xe7cb('0x2e')](_0x1c5558);var _0x1e2686;var _0x568690;var _0x9441c7=_0x1c5558['channel'];if(_[_0xe7cb('0x53')](_0x9441c7,_0xe7cb('0x54'))){_0x568690=_0x9441c7[_0xe7cb('0x55')](_0x9441c7['indexOf']('/')+0x1,_0x9441c7[_0xe7cb('0x56')]('@'));_0x1e2686=_['find'](this['agents'],function(_0x54eb6a){return _0x54eb6a['mobile']==_0x568690||_0x54eb6a['phone']==_0x568690||_0x54eb6a[_0xe7cb('0x23')]==_0x568690;});}else{_0x568690=_0x9441c7[_0xe7cb('0x55')](_0x9441c7[_0xe7cb('0x56')]('/')+0x1,_0x9441c7[_0xe7cb('0x57')]('-'));_0x1e2686=this[_0xe7cb('0x1f')](_0x568690);}if(_0x1e2686){_0x1c5558['interface']=_[_0xe7cb('0x22')](_0x1e2686[_0xe7cb('0x24')])?util[_0xe7cb('0x28')](_0xe7cb('0x29'),_0x1e2686[_0xe7cb('0x21')]):_0x1e2686[_0xe7cb('0x24')];_0x1c5558[_0xe7cb('0x4c')]=_0x1e2686[_0xe7cb('0x21')];_0x1c5558[_0xe7cb('0x23')]=_0x1e2686['accountcode'];RpcMemberReport[_0xe7cb('0x19')](_0x1c5558);}};Report['prototype']['blindTransfer']=function(_0x281d45){RpcVoiceTransferReport[_0xe7cb('0x46')][_0x281d45[_0xe7cb('0x58')]]=_0x281d45;};Report['prototype'][_0xe7cb('0x1d')]=function(_0x393a55){RpcVoiceTransferReport['attendedTransfer'](_0x393a55);};module[_0xe7cb('0x59')]=Report;
\ No newline at end of file
index f06850d..a160ac4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e14=['syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','actionDeviceStateList','[userReport][devicestatelist]','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','stateRegistry','omit','format','trunk:%s','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','debug','[userReport][devicestatechange]','local','toLowerCase','stateTime','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','startsWith','Local','substring','indexOf','mobile','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus'];(function(_0xd835b4,_0x3d1b77){var _0x4d167b=function(_0x134a4b){while(--_0x134a4b){_0xd835b4['push'](_0xd835b4['shift']());}};_0x4d167b(++_0x3d1b77);}(_0x6e14,0x15f));var _0x46e1=function(_0x6042b3,_0x237caa){_0x6042b3=_0x6042b3-0x0;var _0x419c35=_0x6e14[_0x6042b3];return _0x419c35;};'use strict';var _=require(_0x46e1('0x0'));var moment=require(_0x46e1('0x1'));var util=require('util');var Redis=require(_0x46e1('0x2'));var BPromise=require('bluebird');var config=require(_0x46e1('0x3'));var logger=require(_0x46e1('0x4'))('ami');var ami=require('../ami');config[_0x46e1('0x5')]=_[_0x46e1('0x6')](config['redis'],{'host':_0x46e1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0xc2c20){this[_0x46e1('0x8')]=_0xc2c20[_0x46e1('0x8')];this[_0x46e1('0x9')]=_0xc2c20[_0x46e1('0x9')];this['telephones']=_0xc2c20[_0x46e1('0xa')];ami['on'](_0x46e1('0xb'),this[_0x46e1('0xc')][_0x46e1('0xd')](this));ami['on'](_0x46e1('0xe'),this[_0x46e1('0xc')][_0x46e1('0xd')](this));ami['on'](_0x46e1('0xf'),this[_0x46e1('0x10')][_0x46e1('0xd')](this));ami['on'](_0x46e1('0x11'),this[_0x46e1('0x12')][_0x46e1('0xd')](this));return this[_0x46e1('0x13')]();}function showSipRegistrations(){Promise[_0x46e1('0x14')]()[_0x46e1('0x15')](ami[_0x46e1('0x16')]())[_0x46e1('0x17')](function(_0x562fc3){logger[_0x46e1('0x18')](_0x46e1('0x19'),util['inspect'](_0x562fc3,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x46e1('0x14')]()[_0x46e1('0x15')](ami[_0x46e1('0x1a')]())[_0x46e1('0x17')](function(_0x46853b){logger['error'](_0x46e1('0x1b'),util[_0x46e1('0x1c')](_0x46853b,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x46e1('0x14')]()[_0x46e1('0x15')](ami[_0x46e1('0x1d')]())[_0x46e1('0x17')](function(_0x39f27b){logger['error'](_0x46e1('0x1e'),util[_0x46e1('0x1c')](_0x39f27b,{'showHidden':![],'depth':null}));});}UserReport[_0x46e1('0x1f')][_0x46e1('0x13')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())['then'](listDeviceStates())[_0x46e1('0x15')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x46e1('0x20')]=function(_0x3eb1cd){return _0x3eb1cd!==null&&!_[_0x46e1('0x21')](_0x3eb1cd);};UserReport[_0x46e1('0x1f')][_0x46e1('0x22')]=function(_0x3cc089,_0x3d3af1,_0x4ea19a){io['to'](_0x3cc089)['emit'](_0x3d3af1,_0x4ea19a);};UserReport[_0x46e1('0x1f')][_0x46e1('0xc')]=function(_0xb02501){try{if(this[_0x46e1('0x20')](_0xb02501)){logger['info'](_0x46e1('0x23'),_0xb02501[_0x46e1('0x24')],_0xb02501[_0x46e1('0x25')]);logger['debug'](_0x46e1('0x26'),util[_0x46e1('0x1c')](_0xb02501,{'showHidden':![],'depth':null}));var _0x49d98d=_[_0x46e1('0x27')](this[_0x46e1('0x8')],{'defaultuser':_0xb02501[_0x46e1('0x24')]});if(_0x49d98d){_0xb02501[_0x46e1('0x28')]=_0xb02501[_0x46e1('0x25')];_['merge'](_0x49d98d,_[_0x46e1('0x29')](_0xb02501,['event','actionid',_0x46e1('0x24'),'state']));logger['debug']('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x46e1('0x1c')](_0x49d98d,{'showHidden':![],'depth':null}));this['emit'](util[_0x46e1('0x2a')](_0x46e1('0x2b'),_0x49d98d['name']),_0x46e1('0x2c'),_0x49d98d);}}}catch(_0x5375dd){logger[_0x46e1('0x18')](_0x46e1('0x26'),util[_0x46e1('0x1c')](_0x5375dd,{'showHidden':![],'depth':null}));}};UserReport[_0x46e1('0x1f')][_0x46e1('0x10')]=function(_0x3b1fcc){try{if(this[_0x46e1('0x20')](_0x3b1fcc)){logger[_0x46e1('0x2d')](_0x46e1('0x2e'),_0x3b1fcc[_0x46e1('0x2f')],_0x3b1fcc['state']);logger[_0x46e1('0x30')](_0x46e1('0x31'),util[_0x46e1('0x1c')](_0x3b1fcc,{'showHidden':![],'depth':null}));if(this['agents'][_0x3b1fcc[_0x46e1('0x2f')]]){if(!this[_0x46e1('0x9')][_0x3b1fcc[_0x46e1('0x2f')]][_0x46e1('0x32')]||_0x3b1fcc[_0x46e1('0x25')]['toLowerCase']()=='inuse'){this['agents'][_0x3b1fcc['device']][_0x46e1('0x32')]=![];if(this[_0x46e1('0x9')][_0x3b1fcc[_0x46e1('0x2f')]][_0x46e1('0x25')]!==_0x3b1fcc['state'][_0x46e1('0x33')]()){this[_0x46e1('0x9')][_0x3b1fcc[_0x46e1('0x2f')]][_0x46e1('0x34')]=_['toNumber'](moment()[_0x46e1('0x2a')]('x'));}this[_0x46e1('0x9')][_0x3b1fcc[_0x46e1('0x2f')]][_0x46e1('0x25')]=_0x3b1fcc[_0x46e1('0x25')][_0x46e1('0x33')]();this['agents'][_0x3b1fcc[_0x46e1('0x2f')]][_0x46e1('0x35')](_0x3b1fcc);}}else if(this[_0x46e1('0xa')][_0x3b1fcc[_0x46e1('0x2f')]]){if(this['telephones'][_0x3b1fcc['device']][_0x46e1('0x25')]!==_0x3b1fcc['state'][_0x46e1('0x33')]()){this[_0x46e1('0xa')][_0x3b1fcc['device']]['stateTime']=_[_0x46e1('0x36')](moment()[_0x46e1('0x2a')]('x'));}this[_0x46e1('0xa')][_0x3b1fcc[_0x46e1('0x2f')]][_0x46e1('0x25')]=_0x3b1fcc['state'][_0x46e1('0x33')]();logger['debug'](_0x46e1('0x37'),util[_0x46e1('0x1c')](this[_0x46e1('0xa')][_0x3b1fcc[_0x46e1('0x2f')]],{'showHidden':![],'depth':null}));this[_0x46e1('0x22')](util['format'](_0x46e1('0x38'),this[_0x46e1('0xa')][_0x3b1fcc[_0x46e1('0x2f')]]['name']),'telephone:save',this[_0x46e1('0xa')][_0x3b1fcc[_0x46e1('0x2f')]]);}else if(this[_0x46e1('0x8')][_0x3b1fcc[_0x46e1('0x2f')]]){if(this[_0x46e1('0x8')][_0x3b1fcc['device']][_0x46e1('0x25')]!==_0x3b1fcc['state'][_0x46e1('0x33')]()){this[_0x46e1('0x8')][_0x3b1fcc[_0x46e1('0x2f')]][_0x46e1('0x34')]=_[_0x46e1('0x36')](moment()['format']('x'));}this['trunks'][_0x3b1fcc['device']][_0x46e1('0x25')]=_0x3b1fcc['state'][_0x46e1('0x33')]();logger[_0x46e1('0x30')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x46e1('0x1c')](this['trunks'][_0x3b1fcc[_0x46e1('0x2f')]],{'showHidden':![],'depth':null}));this[_0x46e1('0x22')](util[_0x46e1('0x2a')](_0x46e1('0x2b'),this['trunks'][_0x3b1fcc['device']][_0x46e1('0x39')]),_0x46e1('0x2c'),this[_0x46e1('0x8')][_0x3b1fcc['device']]);}else if(_[_0x46e1('0x3a')](_0x3b1fcc[_0x46e1('0x2f')],_0x46e1('0x3b'))){var _0x53f014=_0x3b1fcc['device'];var _0x3731af=_0x53f014[_0x46e1('0x3c')](_0x53f014[_0x46e1('0x3d')]('/')+0x1,_0x53f014[_0x46e1('0x3d')]('@'));var _0x561119=_[_0x46e1('0x27')](this['agents'],function(_0x248741){return _0x248741[_0x46e1('0x3e')]==_0x3731af||_0x248741['phone']==_0x3731af||_0x248741[_0x46e1('0x3f')]==_0x3731af;});if(_0x561119){if(_0x561119[_0x46e1('0x25')]!==_0x3b1fcc[_0x46e1('0x25')][_0x46e1('0x33')]()){_0x561119[_0x46e1('0x34')]=_[_0x46e1('0x36')](moment()['format']('x'));}_0x561119['state']=_0x3b1fcc['state']['toLowerCase']();_0x561119[_0x46e1('0x32')]=!![];_0x561119[_0x46e1('0x35')](_0x3b1fcc);}}}}catch(_0x36d52d){logger[_0x46e1('0x18')](_0x46e1('0x31'),util[_0x46e1('0x1c')](_0x36d52d,{'showHidden':![],'depth':null}));}};UserReport[_0x46e1('0x1f')][_0x46e1('0x12')]=function(_0x52134c){try{if(this['isNotNull'](_0x52134c)&&this['isNotNull'](_0x52134c[_0x46e1('0x11')])){logger['info'](_0x46e1('0x40'),_0x52134c[_0x46e1('0x41')],_0x52134c['address'],_0x52134c[_0x46e1('0x11')]);logger[_0x46e1('0x30')](_0x46e1('0x42'),util[_0x46e1('0x1c')](_0x52134c,{'showHidden':![],'depth':null}));if(this[_0x46e1('0x9')][_0x52134c[_0x46e1('0x41')]]){if(!this['agents'][_0x52134c['peer']][_0x46e1('0x32')]||_0x52134c[_0x46e1('0x11')]['toLowerCase']()==_0x46e1('0x43')){this[_0x46e1('0x9')][_0x52134c[_0x46e1('0x41')]][_0x46e1('0x32')]=![];this[_0x46e1('0x9')][_0x52134c[_0x46e1('0x41')]][_0x46e1('0x44')]=_0x52134c['peerstatus'][_0x46e1('0x33')]();this[_0x46e1('0x9')][_0x52134c[_0x46e1('0x41')]]['address']=_0x52134c[_0x46e1('0x45')];this[_0x46e1('0x9')][_0x52134c[_0x46e1('0x41')]][_0x46e1('0x35')](_0x52134c);}}else if(this[_0x46e1('0xa')][_0x52134c[_0x46e1('0x41')]]){this[_0x46e1('0xa')][_0x52134c[_0x46e1('0x41')]][_0x46e1('0x44')]=_0x52134c['peerstatus'][_0x46e1('0x33')]();this['telephones'][_0x52134c[_0x46e1('0x41')]]['address']=_0x52134c[_0x46e1('0x45')];logger['debug'](_0x46e1('0x46'),util[_0x46e1('0x1c')](this[_0x46e1('0xa')][_0x52134c[_0x46e1('0x41')]],{'showHidden':![],'depth':null}));this[_0x46e1('0x22')](util[_0x46e1('0x2a')](_0x46e1('0x38'),this[_0x46e1('0xa')][_0x52134c['peer']][_0x46e1('0x39')]),_0x46e1('0x47'),this[_0x46e1('0xa')][_0x52134c[_0x46e1('0x41')]]);}else if(this[_0x46e1('0x8')][_0x52134c[_0x46e1('0x41')]]){this[_0x46e1('0x8')][_0x52134c[_0x46e1('0x41')]][_0x46e1('0x44')]=_0x52134c['peerstatus']['toLowerCase']();this[_0x46e1('0x8')][_0x52134c[_0x46e1('0x41')]][_0x46e1('0x45')]=_0x52134c[_0x46e1('0x45')];logger['debug'](_0x46e1('0x48'),util[_0x46e1('0x1c')](this[_0x46e1('0x8')][_0x52134c[_0x46e1('0x41')]],{'showHidden':![],'depth':null}));this[_0x46e1('0x22')](util['format'](_0x46e1('0x2b'),this[_0x46e1('0x8')][_0x52134c[_0x46e1('0x41')]][_0x46e1('0x39')]),'trunk:save',this[_0x46e1('0x8')][_0x52134c[_0x46e1('0x41')]]);}}}catch(_0x519658){logger['error'](_0x46e1('0x42'),util[_0x46e1('0x1c')](_0x519658,{'showHidden':![],'depth':null}));}};module[_0x46e1('0x49')]=UserReport;
\ No newline at end of file
+var _0x594c=['device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','substring','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','ioredis','../../../config/environment','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','devicestatechange','syncDeviceState','bind','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][sippeerstatus]','prototype','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','debug','format','trunk:%s','trunk:save','isNotNull','info'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x594c,0x1d0));var _0xc594=function(_0x18b3d1,_0x3f7423){_0x18b3d1=_0x18b3d1-0x0;var _0x21df76=_0x594c[_0x18b3d1];return _0x21df76;};'use strict';var _=require('lodash');var moment=require(_0xc594('0x0'));var util=require('util');var Redis=require(_0xc594('0x1'));var BPromise=require('bluebird');var config=require(_0xc594('0x2'));var logger=require('../../../config/logger')('ami');var ami=require(_0xc594('0x3'));config['redis']=_[_0xc594('0x4')](config[_0xc594('0x5')],{'host':_0xc594('0x6'),'port':0x18eb});var io=require(_0xc594('0x7'))(new Redis(config[_0xc594('0x5')]));function UserReport(_0x531c60){this[_0xc594('0x8')]=_0x531c60[_0xc594('0x8')];this[_0xc594('0x9')]=_0x531c60[_0xc594('0x9')];this[_0xc594('0xa')]=_0x531c60[_0xc594('0xa')];ami['on'](_0xc594('0xb'),this[_0xc594('0xc')]['bind'](this));ami['on'](_0xc594('0xd'),this[_0xc594('0xc')]['bind'](this));ami['on'](_0xc594('0xe'),this[_0xc594('0xf')][_0xc594('0x10')](this));ami['on'](_0xc594('0x11'),this[_0xc594('0x12')][_0xc594('0x10')](this));return this[_0xc594('0x13')]();}function showSipRegistrations(){Promise[_0xc594('0x14')]()[_0xc594('0x15')](ami['actionSipShowRegistry']())[_0xc594('0x16')](function(_0x28f0c8){logger[_0xc594('0x17')](_0xc594('0x18'),util[_0xc594('0x19')](_0x28f0c8,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xc594('0x14')]()['then'](ami[_0xc594('0x1a')]())[_0xc594('0x16')](function(_0x4be8d8){logger[_0xc594('0x17')]('[userReport][devicestatelist]',util[_0xc594('0x19')](_0x4be8d8,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xc594('0x14')]()[_0xc594('0x15')](ami['actionSipPeerStatus']())[_0xc594('0x16')](function(_0x1ce655){logger[_0xc594('0x17')](_0xc594('0x1b'),util[_0xc594('0x19')](_0x1ce655,{'showHidden':![],'depth':null}));});}UserReport[_0xc594('0x1c')][_0xc594('0x13')]=function(){setInterval(function(){BPromise[_0xc594('0x14')]()['then'](showSipRegistrations())[_0xc594('0x15')](listDeviceStates())[_0xc594('0x15')](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x351c8a){return _0x351c8a!==null&&!_[_0xc594('0x1d')](_0x351c8a);};UserReport[_0xc594('0x1c')][_0xc594('0x1e')]=function(_0x22fa72,_0x9ec01f,_0x16fb79){io['to'](_0x22fa72)[_0xc594('0x1e')](_0x9ec01f,_0x16fb79);};UserReport[_0xc594('0x1c')]['syncRegistry']=function(_0x50081f){try{if(this['isNotNull'](_0x50081f)){logger['info'](_0xc594('0x1f'),_0x50081f[_0xc594('0x20')],_0x50081f[_0xc594('0x21')]);logger['debug'](_0xc594('0x22'),util[_0xc594('0x19')](_0x50081f,{'showHidden':![],'depth':null}));var _0x292ea1=_[_0xc594('0x23')](this[_0xc594('0x8')],{'defaultuser':_0x50081f[_0xc594('0x20')]});if(_0x292ea1){_0x50081f[_0xc594('0x24')]=_0x50081f['state'];_[_0xc594('0x25')](_0x292ea1,_[_0xc594('0x26')](_0x50081f,[_0xc594('0x27'),_0xc594('0x28'),_0xc594('0x20'),_0xc594('0x21')]));logger[_0xc594('0x29')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0xc594('0x19')](_0x292ea1,{'showHidden':![],'depth':null}));this[_0xc594('0x1e')](util[_0xc594('0x2a')](_0xc594('0x2b'),_0x292ea1['name']),_0xc594('0x2c'),_0x292ea1);}}}catch(_0x4e7428){logger[_0xc594('0x17')](_0xc594('0x22'),util[_0xc594('0x19')](_0x4e7428,{'showHidden':![],'depth':null}));}};UserReport[_0xc594('0x1c')][_0xc594('0xf')]=function(_0x1ebebc){try{if(this[_0xc594('0x2d')](_0x1ebebc)){logger[_0xc594('0x2e')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x1ebebc[_0xc594('0x2f')],_0x1ebebc[_0xc594('0x21')]);logger[_0xc594('0x29')](_0xc594('0x30'),util[_0xc594('0x19')](_0x1ebebc,{'showHidden':![],'depth':null}));if(this[_0xc594('0x9')][_0x1ebebc[_0xc594('0x2f')]]){if(!this[_0xc594('0x9')][_0x1ebebc['device']][_0xc594('0x31')]||_0x1ebebc[_0xc594('0x21')]['toLowerCase']()==_0xc594('0x32')){this[_0xc594('0x9')][_0x1ebebc[_0xc594('0x2f')]]['local']=![];if(this['agents'][_0x1ebebc[_0xc594('0x2f')]][_0xc594('0x21')]!==_0x1ebebc[_0xc594('0x21')][_0xc594('0x33')]()){this[_0xc594('0x9')][_0x1ebebc[_0xc594('0x2f')]][_0xc594('0x34')]=_['toNumber'](moment()[_0xc594('0x2a')]('x'));}this[_0xc594('0x9')][_0x1ebebc[_0xc594('0x2f')]][_0xc594('0x21')]=_0x1ebebc[_0xc594('0x21')]['toLowerCase']();this['agents'][_0x1ebebc[_0xc594('0x2f')]][_0xc594('0x35')](_0x1ebebc);}}else if(this[_0xc594('0xa')][_0x1ebebc[_0xc594('0x2f')]]){if(this[_0xc594('0xa')][_0x1ebebc[_0xc594('0x2f')]][_0xc594('0x21')]!==_0x1ebebc[_0xc594('0x21')][_0xc594('0x33')]()){this[_0xc594('0xa')][_0x1ebebc[_0xc594('0x2f')]]['stateTime']=_[_0xc594('0x36')](moment()[_0xc594('0x2a')]('x'));}this[_0xc594('0xa')][_0x1ebebc[_0xc594('0x2f')]][_0xc594('0x21')]=_0x1ebebc[_0xc594('0x21')][_0xc594('0x33')]();logger['debug'](_0xc594('0x37'),util[_0xc594('0x19')](this[_0xc594('0xa')][_0x1ebebc[_0xc594('0x2f')]],{'showHidden':![],'depth':null}));this[_0xc594('0x1e')](util[_0xc594('0x2a')]('telephone:%s',this[_0xc594('0xa')][_0x1ebebc[_0xc594('0x2f')]][_0xc594('0x38')]),_0xc594('0x39'),this['telephones'][_0x1ebebc[_0xc594('0x2f')]]);}else if(this[_0xc594('0x8')][_0x1ebebc[_0xc594('0x2f')]]){if(this[_0xc594('0x8')][_0x1ebebc[_0xc594('0x2f')]][_0xc594('0x21')]!==_0x1ebebc[_0xc594('0x21')][_0xc594('0x33')]()){this[_0xc594('0x8')][_0x1ebebc['device']]['stateTime']=_[_0xc594('0x36')](moment()['format']('x'));}this['trunks'][_0x1ebebc['device']]['state']=_0x1ebebc[_0xc594('0x21')]['toLowerCase']();logger['debug'](_0xc594('0x3a'),util[_0xc594('0x19')](this[_0xc594('0x8')][_0x1ebebc['device']],{'showHidden':![],'depth':null}));this[_0xc594('0x1e')](util['format']('trunk:%s',this['trunks'][_0x1ebebc[_0xc594('0x2f')]][_0xc594('0x38')]),_0xc594('0x2c'),this[_0xc594('0x8')][_0x1ebebc['device']]);}else if(_['startsWith'](_0x1ebebc[_0xc594('0x2f')],_0xc594('0x3b'))){var _0x51db39=_0x1ebebc[_0xc594('0x2f')];var _0x4d9a27=_0x51db39[_0xc594('0x3c')](_0x51db39['indexOf']('/')+0x1,_0x51db39['indexOf']('@'));var _0x4d491b=_[_0xc594('0x23')](this[_0xc594('0x9')],function(_0x2e596d){return _0x2e596d[_0xc594('0x3d')]==_0x4d9a27||_0x2e596d[_0xc594('0x3e')]==_0x4d9a27||_0x2e596d[_0xc594('0x3f')]==_0x4d9a27;});if(_0x4d491b){if(_0x4d491b[_0xc594('0x21')]!==_0x1ebebc[_0xc594('0x21')][_0xc594('0x33')]()){_0x4d491b[_0xc594('0x34')]=_[_0xc594('0x36')](moment()[_0xc594('0x2a')]('x'));}_0x4d491b['state']=_0x1ebebc[_0xc594('0x21')][_0xc594('0x33')]();_0x4d491b[_0xc594('0x31')]=!![];_0x4d491b[_0xc594('0x35')](_0x1ebebc);}}}}catch(_0x5529b0){logger[_0xc594('0x17')]('[userReport][devicestatechange]',util['inspect'](_0x5529b0,{'showHidden':![],'depth':null}));}};UserReport[_0xc594('0x1c')][_0xc594('0x12')]=function(_0x32457f){try{if(this[_0xc594('0x2d')](_0x32457f)&&this[_0xc594('0x2d')](_0x32457f[_0xc594('0x11')])){logger[_0xc594('0x2e')](_0xc594('0x40'),_0x32457f[_0xc594('0x41')],_0x32457f['address'],_0x32457f[_0xc594('0x11')]);logger[_0xc594('0x29')](_0xc594('0x42'),util[_0xc594('0x19')](_0x32457f,{'showHidden':![],'depth':null}));if(this[_0xc594('0x9')][_0x32457f[_0xc594('0x41')]]){if(!this[_0xc594('0x9')][_0x32457f['peer']][_0xc594('0x31')]||_0x32457f[_0xc594('0x11')][_0xc594('0x33')]()==_0xc594('0x43')){this[_0xc594('0x9')][_0x32457f['peer']][_0xc594('0x31')]=![];this[_0xc594('0x9')][_0x32457f['peer']][_0xc594('0x44')]=_0x32457f[_0xc594('0x11')][_0xc594('0x33')]();this[_0xc594('0x9')][_0x32457f['peer']][_0xc594('0x45')]=_0x32457f[_0xc594('0x45')];this[_0xc594('0x9')][_0x32457f[_0xc594('0x41')]][_0xc594('0x35')](_0x32457f);}}else if(this[_0xc594('0xa')][_0x32457f[_0xc594('0x41')]]){this[_0xc594('0xa')][_0x32457f[_0xc594('0x41')]][_0xc594('0x44')]=_0x32457f['peerstatus'][_0xc594('0x33')]();this['telephones'][_0x32457f[_0xc594('0x41')]][_0xc594('0x45')]=_0x32457f['address'];logger[_0xc594('0x29')](_0xc594('0x46'),util[_0xc594('0x19')](this[_0xc594('0xa')][_0x32457f[_0xc594('0x41')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xc594('0x2a')]('telephone:%s',this['telephones'][_0x32457f['peer']][_0xc594('0x38')]),_0xc594('0x39'),this[_0xc594('0xa')][_0x32457f[_0xc594('0x41')]]);}else if(this['trunks'][_0x32457f[_0xc594('0x41')]]){this[_0xc594('0x8')][_0x32457f[_0xc594('0x41')]][_0xc594('0x44')]=_0x32457f[_0xc594('0x11')]['toLowerCase']();this[_0xc594('0x8')][_0x32457f[_0xc594('0x41')]][_0xc594('0x45')]=_0x32457f[_0xc594('0x45')];logger[_0xc594('0x29')](_0xc594('0x47'),util[_0xc594('0x19')](this[_0xc594('0x8')][_0x32457f[_0xc594('0x41')]],{'showHidden':![],'depth':null}));this[_0xc594('0x1e')](util['format'](_0xc594('0x2b'),this[_0xc594('0x8')][_0x32457f['peer']][_0xc594('0x38')]),'trunk:save',this[_0xc594('0x8')][_0x32457f[_0xc594('0x41')]]);}}}catch(_0x172f06){logger[_0xc594('0x17')](_0xc594('0x42'),util[_0xc594('0x19')](_0x172f06,{'showHidden':![],'depth':null}));}};module[_0xc594('0x48')]=UserReport;
\ No newline at end of file
index 333fb26..c1a4037 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(_0x190a33,_0x1046de){var _0xcd67ed=function(_0x1f7866){while(--_0x1f7866){_0x190a33['push'](_0x190a33['shift']());}};_0xcd67ed(++_0x1046de);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x35ab41,_0x5a513d){var _0x2bfd13=function(_0x1a6344){while(--_0x1a6344){_0x35ab41['push'](_0x35ab41['shift']());}};_0x2bfd13(++_0x5a513d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 d6fd728..496701d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2dc=['[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','user:agentcomplete','length','transferType','resolve','then','undefined','isEmpty','getSettings','Action','catch','StopMixMonitor','finally','event','BlindTransfer','type','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','ATTENDED','some','origtransfererlinkedid','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','extension','transfereruniqueid','transfererchannel','BLIND','syncHangup','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','exports','lodash','util','path','ioredis','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','channels','agents','blindTransfers','syncNewExten','bind','newstate','syncNewState','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isNotNull','isUndefined','emit','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','from-sip','exten','xcally-motion-preview','channel','split','destconnectedlinenum','format','user:%s','name','user:agentconnect','accountcode','connectedlinenum','[%s][voiceCallReport][newcallerid]','syncNewChannel','debug','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','applicationdata','appdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','application','starttime','duration','subtract','seconds','lastapplication','lastdata','startsWith','match','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','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','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0xa2dc,0xfb));var _0xca2d=function(_0x27d958,_0x29ef87){_0x27d958=_0x27d958-0x0;var _0x53e63e=_0xa2dc[_0x27d958];return _0x53e63e;};'use strict';var _=require(_0xca2d('0x0'));var moment=require('moment');var util=require(_0xca2d('0x1'));var path=require(_0xca2d('0x2'));var Redis=require(_0xca2d('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xca2d('0x4'));var ami=require(_0xca2d('0x5'));var Channel=require(_0xca2d('0x6'));var RpcSetting=require(_0xca2d('0x7'));var applications=[_0xca2d('0x8'),_0xca2d('0x9'),_0xca2d('0xa'),_0xca2d('0xb'),_0xca2d('0xc'),'voicemail'];var dispositions=[_0xca2d('0xd'),_0xca2d('0xe'),_0xca2d('0xe'),_0xca2d('0xd'),_0xca2d('0xd'),_0xca2d('0xd'),'ANSWERED',_0xca2d('0xf'),_0xca2d('0xe'),'FAILED',_0xca2d('0xe')];config[_0xca2d('0x10')]=_[_0xca2d('0x11')](config['redis'],{'host':_0xca2d('0x12'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xca2d('0x10')]));function VoiceCallReport(_0x2d9ca4){this[_0xca2d('0x13')]=_0x2d9ca4[_0xca2d('0x13')];this[_0xca2d('0x14')]=_0x2d9ca4[_0xca2d('0x14')];this[_0xca2d('0x15')]={};ami['on']('coreshowchannel',this[_0xca2d('0x16')]['bind'](this));ami['on']('newexten',this[_0xca2d('0x16')][_0xca2d('0x17')](this));ami['on']('newchannel',this['syncNewChannel'][_0xca2d('0x17')](this));ami['on'](_0xca2d('0x18'),this[_0xca2d('0x19')][_0xca2d('0x17')](this));ami['on']('varset',this['syncVarSet'][_0xca2d('0x17')](this));ami['on'](_0xca2d('0x1a'),this['syncHangup'][_0xca2d('0x17')](this));ami['on'](_0xca2d('0x1b'),this[_0xca2d('0x1c')][_0xca2d('0x17')](this));ami['on'](_0xca2d('0x1d'),this[_0xca2d('0x1e')][_0xca2d('0x17')](this));ami['on'](_0xca2d('0x1f'),this[_0xca2d('0x20')][_0xca2d('0x17')](this));ami['on']('musiconholdstart',this[_0xca2d('0x21')][_0xca2d('0x17')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0xca2d('0x17')](this));try{logger[_0xca2d('0x22')](_0xca2d('0x23'));ami[_0xca2d('0x24')]();}catch(_0x1f547b){logger[_0xca2d('0x25')]('[voiceCallReport][coreshowchannels]',util[_0xca2d('0x26')](_0x1f547b,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xca2d('0x27')][_0xca2d('0x28')]=function(_0x3ac4a1){return _0x3ac4a1!==null&&!_[_0xca2d('0x29')](_0x3ac4a1);};VoiceCallReport[_0xca2d('0x27')][_0xca2d('0x2a')]=function(_0x53da28,_0x35d323,_0x549af4){io['to'](_0x53da28)[_0xca2d('0x2a')](_0x35d323,_0x549af4);};VoiceCallReport[_0xca2d('0x27')][_0xca2d('0x1c')]=function(_0x5e88e7){try{if(this['isNotNull'](_0x5e88e7)){logger[_0xca2d('0x22')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x5e88e7[_0xca2d('0x2b')],_0x5e88e7[_0xca2d('0x2c')],_0x5e88e7[_0xca2d('0x2d')]);logger['debug'](_0xca2d('0x2e'),_0x5e88e7[_0xca2d('0x2b')],util['inspect'](_0x5e88e7,{'showHidden':![],'depth':null}));if(_0x5e88e7['uniqueid']===_0x5e88e7[_0xca2d('0x2f')]){if(!_[_0xca2d('0x29')](this[_0xca2d('0x13')][_0x5e88e7['uniqueid']])){_[_0xca2d('0x30')](this['channels'][_0x5e88e7[_0xca2d('0x2b')]],_[_0xca2d('0x31')](_0x5e88e7,_[_0xca2d('0x32')](this[_0xca2d('0x13')][_0x5e88e7[_0xca2d('0x2b')]])));}}if(_0x5e88e7[_0xca2d('0x33')]===_0xca2d('0x34')){if(this[_0xca2d('0x14')][_0x5e88e7['channel']['split']('-')[0x0]]){if(_0x5e88e7[_0xca2d('0x35')]==_0xca2d('0x36')){this['agents'][_0x5e88e7[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]][_0xca2d('0x39')]=_0x5e88e7['connectedlinenum'];this['emit'](util[_0xca2d('0x3a')](_0xca2d('0x3b'),this['agents'][_0x5e88e7['channel'][_0xca2d('0x38')]('-')[0x0]][_0xca2d('0x3c')]),_0xca2d('0x3d'),{'destaccountcode':this['agents'][_0x5e88e7[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]][_0xca2d('0x3e')],'destconnectedlinenum':_0x5e88e7[_0xca2d('0x3f')]});}}}}}catch(_0x39eb62){logger[_0xca2d('0x25')](_0xca2d('0x40'),_0x5e88e7['uniqueid'],util[_0xca2d('0x26')](_0x39eb62,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xca2d('0x41')]=function(_0x731c0e){try{if(this['isNotNull'](_0x731c0e)){logger[_0xca2d('0x42')]('[%s][voiceCallReport][newchannel]\x20event:',_0x731c0e[_0xca2d('0x2b')],util['inspect'](_0x731c0e,{'showHidden':![],'depth':null}));if(this[_0xca2d('0x13')][_0x731c0e['uniqueid']])return;if(_0x731c0e['channel']===_0xca2d('0x43'))return;if(_0x731c0e['uniqueid']!==_0x731c0e[_0xca2d('0x2f')]&&!this[_0xca2d('0x15')][_0x731c0e['linkedid']])return;logger[_0xca2d('0x22')](_0xca2d('0x44'),_0x731c0e[_0xca2d('0x2b')],_0x731c0e[_0xca2d('0x33')],_0x731c0e['exten']);this['channels'][_0x731c0e[_0xca2d('0x2b')]]=new Channel();this[_0xca2d('0x13')][_0x731c0e[_0xca2d('0x2b')]]['starttime']=moment()[_0xca2d('0x3a')](_0xca2d('0x45'));this['channels'][_0x731c0e[_0xca2d('0x2b')]][_0xca2d('0x46')]=dispositions[_[_0xca2d('0x47')](_0x731c0e[_0xca2d('0x48')])];_['merge'](this[_0xca2d('0x13')][_0x731c0e[_0xca2d('0x2b')]],_[_0xca2d('0x31')](_0x731c0e,_[_0xca2d('0x32')](this[_0xca2d('0x13')][_0x731c0e['uniqueid']])));if(_0x731c0e[_0xca2d('0x33')]===_0xca2d('0x34')){if(this['agents'][_0x731c0e[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]]){if(_[_0xca2d('0x29')](this[_0xca2d('0x14')][_0x731c0e[_0xca2d('0x37')]['split']('-')[0x0]]['destconnectedlinenum'])){this[_0xca2d('0x14')][_0x731c0e[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]][_0xca2d('0x39')]=_0x731c0e['exten'];logger[_0xca2d('0x42')](_0xca2d('0x49'),_0x731c0e[_0xca2d('0x2b')],util[_0xca2d('0x26')]({'id':this[_0xca2d('0x14')][_0x731c0e[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xca2d('0x14')][_0x731c0e[_0xca2d('0x37')]['split']('-')[0x0]][_0xca2d('0x3e')],'destconnectedlinenum':_0x731c0e[_0xca2d('0x35')]},{'showHidden':![],'depth':null}));this[_0xca2d('0x2a')](util[_0xca2d('0x3a')](_0xca2d('0x3b'),this['agents'][_0x731c0e[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]]['name']),_0xca2d('0x3d'),{'id':this[_0xca2d('0x14')][_0x731c0e['channel'][_0xca2d('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xca2d('0x14')][_0x731c0e[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]][_0xca2d('0x3e')],'destconnectedlinenum':_0x731c0e[_0xca2d('0x35')]});}}}}}catch(_0x42fcfa){logger['error'](_0xca2d('0x4a'),_0x731c0e[_0xca2d('0x2b')],util['inspect'](_0x42fcfa,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xca2d('0x27')]['syncNewExten']=function(_0x1caf14){try{if(this['isNotNull'](_0x1caf14)){logger['debug'](_0xca2d('0x4b'),_0x1caf14['uniqueid'],util['inspect'](_0x1caf14,{'showHidden':![],'depth':null}));if(_0x1caf14['channel']===_0xca2d('0x43')||_0x1caf14[_0xca2d('0x35')]==='h')return;if(_0x1caf14['uniqueid']===_0x1caf14['linkedid']||this[_0xca2d('0x15')][_0x1caf14[_0xca2d('0x2f')]]){_0x1caf14['application']=_0x1caf14['application']['toLowerCase']();_0x1caf14[_0xca2d('0x4c')]=_0x1caf14[_0xca2d('0x4d')]&&_0x1caf14[_0xca2d('0x4d')]['startsWith']('CDR(routeAlias)')?_0x1caf14['appdata']:(_0x1caf14[_0xca2d('0x4d')]||_0x1caf14[_0xca2d('0x4c')])[_0xca2d('0x4e')]();logger[_0xca2d('0x22')](_0xca2d('0x4f'),_0x1caf14['uniqueid'],_0x1caf14[_0xca2d('0x50')],_0x1caf14[_0xca2d('0x4c')]);if(_[_0xca2d('0x29')](this['channels'][_0x1caf14[_0xca2d('0x2b')]])){this[_0xca2d('0x13')][_0x1caf14['uniqueid']]=new Channel();this[_0xca2d('0x13')][_0x1caf14[_0xca2d('0x2b')]][_0xca2d('0x51')]=_0x1caf14[_0xca2d('0x52')]?moment()[_0xca2d('0x53')](moment[_0xca2d('0x52')](_0x1caf14['duration'])[_0xca2d('0x54')](),_0xca2d('0x54'))[_0xca2d('0x3a')](_0xca2d('0x45')):moment()[_0xca2d('0x3a')](_0xca2d('0x45'));this[_0xca2d('0x13')][_0x1caf14[_0xca2d('0x2b')]]['disposition']='NO\x20ANSWER';}_[_0xca2d('0x30')](this[_0xca2d('0x13')][_0x1caf14[_0xca2d('0x2b')]],_['pick'](_0x1caf14,_[_0xca2d('0x32')](this['channels'][_0x1caf14[_0xca2d('0x2b')]])));if(_['includes'](applications,_0x1caf14[_0xca2d('0x50')])){this['channels'][_0x1caf14[_0xca2d('0x2b')]][_0xca2d('0x55')]=_0x1caf14[_0xca2d('0x50')];this[_0xca2d('0x13')][_0x1caf14['uniqueid']][_0xca2d('0x56')]=_0x1caf14['applicationdata'];if(_0x1caf14['application']===_0xca2d('0x8')&&_[_0xca2d('0x57')](_0x1caf14['applicationdata'][_0xca2d('0x4e')](),'cdr(')){var _0x697e95=_0x1caf14[_0xca2d('0x4c')][_0xca2d('0x38')]('=');var _0xbcff59=_0x697e95[0x0][_0xca2d('0x4e')]()[_0xca2d('0x58')](/cdr\((.*)\)/);if(_0xbcff59){if(_0xbcff59[0x1]==='type'&&!_[_0xca2d('0x59')](this[_0xca2d('0x13')][_0x1caf14[_0xca2d('0x2b')]][_0xbcff59[0x1]]))return;this[_0xca2d('0x13')][_0x1caf14[_0xca2d('0x2b')]][_0xbcff59[0x1]]=_0x697e95[0x1];}}else if(_0x1caf14[_0xca2d('0x50')]==='queue'){this['channels'][_0x1caf14['uniqueid']][_0xca2d('0x9')]=_0x1caf14[_0xca2d('0x4c')][_0xca2d('0x38')](',')[0x0];}}}}}catch(_0x289f2a){logger[_0xca2d('0x25')](_0xca2d('0x5a'),_0x1caf14[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x289f2a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xca2d('0x27')]['syncNewState']=function(_0x1b2966){try{if(this[_0xca2d('0x28')](_0x1b2966)){logger[_0xca2d('0x22')](_0xca2d('0x5b'),_0x1b2966[_0xca2d('0x2b')],_0x1b2966[_0xca2d('0x2f')],_0x1b2966[_0xca2d('0x2c')],_0x1b2966['calleridnum']);logger['debug'](_0xca2d('0x5c'),_0x1b2966[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x1b2966,{'showHidden':![],'depth':null}));if(_0x1b2966['channelstate']!=='6')return;if(_0x1b2966[_0xca2d('0x2b')]!==_0x1b2966[_0xca2d('0x2f')]){var _0x4af0ec=moment();if(this['channels'][_0x1b2966[_0xca2d('0x2f')]]){if(!this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x5d')]){this['channels'][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x5d')]=!![];this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x5e')]=_0x4af0ec['format'](_0xca2d('0x45'));if(this[_0xca2d('0x13')][_0x1b2966['linkedid']][_0xca2d('0x51')]){this['channels'][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x5f')]=_0x4af0ec[_0xca2d('0x60')](this['channels'][_0x1b2966[_0xca2d('0x2f')]]['starttime'],_0xca2d('0x54'));}}this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x2f')]=_0x1b2966['uniqueid'];if(_0x1b2966[_0xca2d('0x2d')]!==_0xca2d('0x36')){this['channels'][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x3f')]=_0x1b2966[_0xca2d('0x2d')];}this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x61')]=_0x1b2966[_0xca2d('0x2c')];this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x62')]=_0x1b2966[_0xca2d('0x37')];this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x46')]=dispositions[_[_0xca2d('0x47')](_0x1b2966[_0xca2d('0x48')])];if(this[_0xca2d('0x14')][_0x1b2966[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]]){this[_0xca2d('0x13')][_0x1b2966['linkedid']][_0xca2d('0x63')]=this['agents'][_0x1b2966['channel'][_0xca2d('0x38')]('-')[0x0]]['id'];this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2f')]]['membername']=this['agents'][_0x1b2966['channel'][_0xca2d('0x38')]('-')[0x0]][_0xca2d('0x3c')];}}if(this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2b')]]){if(!this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2b')]]['answered']){this['channels'][_0x1b2966['uniqueid']]['answered']=!![];this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2b')]][_0xca2d('0x5e')]=_0x4af0ec[_0xca2d('0x3a')](_0xca2d('0x45'));if(this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2b')]]['starttime']){this['channels'][_0x1b2966[_0xca2d('0x2b')]][_0xca2d('0x5f')]=_0x4af0ec[_0xca2d('0x60')](this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2b')]]['starttime'],'seconds');}}if(_0x1b2966[_0xca2d('0x2d')]!==_0xca2d('0x36')){this['channels'][_0x1b2966['uniqueid']][_0xca2d('0x3f')]=_0x1b2966[_0xca2d('0x2d')];}this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2b')]][_0xca2d('0x61')]=_0x1b2966[_0xca2d('0x2c')];this[_0xca2d('0x13')][_0x1b2966['uniqueid']][_0xca2d('0x62')]=_0x1b2966[_0xca2d('0x37')];this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2b')]]['disposition']=dispositions[_[_0xca2d('0x47')](_0x1b2966[_0xca2d('0x48')])];}}else{if(this['channels'][_0x1b2966['uniqueid']]){if(this[_0xca2d('0x14')][_0x1b2966[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]]){this['channels'][_0x1b2966[_0xca2d('0x2b')]][_0xca2d('0x63')]=this[_0xca2d('0x14')][_0x1b2966['channel']['split']('-')[0x0]]['id'];this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2b')]][_0xca2d('0x64')]=this[_0xca2d('0x14')][_0x1b2966[_0xca2d('0x37')]['split']('-')[0x0]][_0xca2d('0x3c')];}}}if(_0x1b2966[_0xca2d('0x33')]===_0xca2d('0x34')){if(this[_0xca2d('0x14')][_0x1b2966[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]]){this[_0xca2d('0x14')][_0x1b2966[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]][_0xca2d('0x39')]=_0x1b2966[_0xca2d('0x35')];var _0x593374,_0x5856fc;if(this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2b')]]){_0x593374=this[_0xca2d('0x13')][_0x1b2966['uniqueid']][_0xca2d('0x65')];_0x5856fc=this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2b')]][_0xca2d('0x9')];}else if(this['channels'][_0x1b2966['linkedid']]){_0x593374=this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x65')];_0x5856fc=this[_0xca2d('0x13')][_0x1b2966[_0xca2d('0x2f')]][_0xca2d('0x9')];}logger[_0xca2d('0x42')](_0xca2d('0x66'),_0x1b2966[_0xca2d('0x2b')],util[_0xca2d('0x26')]({'id':this[_0xca2d('0x14')][_0x1b2966['channel'][_0xca2d('0x38')]('-')[0x0]]['id'],'destaccountcode':this[_0xca2d('0x14')][_0x1b2966['channel']['split']('-')[0x0]][_0xca2d('0x3e')],'destconnectedlinenum':_0x1b2966[_0xca2d('0x35')],'routealias':_0x593374,'queue':_0x5856fc||undefined},{'showHidden':![],'depth':null}));this[_0xca2d('0x2a')](util[_0xca2d('0x3a')](_0xca2d('0x3b'),this[_0xca2d('0x14')][_0x1b2966[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]][_0xca2d('0x3c')]),'user:agentconnect',{'id':this[_0xca2d('0x14')][_0x1b2966[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xca2d('0x14')][_0x1b2966[_0xca2d('0x37')]['split']('-')[0x0]][_0xca2d('0x3e')],'destconnectedlinenum':_0x1b2966[_0xca2d('0x35')],'routealias':_0x593374,'queue':_0x5856fc||undefined});}}}}catch(_0x4376a1){logger[_0xca2d('0x25')]('[%s][voiceCallReport][newstate]',_0x1b2966[_0xca2d('0x2b')],util['inspect'](_0x4376a1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xca2d('0x67')]=function(_0x3479a7,_0x2ec8ed){try{if(this[_0xca2d('0x13')][_0x3479a7]){logger[_0xca2d('0x22')](_0xca2d('0x68'),_0x3479a7,_0x2ec8ed);this[_0xca2d('0x13')][_0x3479a7][_0xca2d('0x69')]=!![];if(_[_0xca2d('0x6a')](_0x2ec8ed,_0xca2d('0x6b'))){_0x2ec8ed=_0x2ec8ed[_0xca2d('0x6c')](_0xca2d('0x6b'),'.WAV');}this[_0xca2d('0x13')][_0x3479a7][_0xca2d('0x6d')]=_0x2ec8ed;var _0x3c24e=_[_0xca2d('0x6e')](this[_0xca2d('0x13')][_0x3479a7]['monitors'],{'filename':_0x2ec8ed});if(_[_0xca2d('0x59')](_0x3c24e)){this[_0xca2d('0x13')][_0x3479a7][_0xca2d('0x6f')][_0xca2d('0x70')]({'filename':_0x2ec8ed,'createdAt':moment()[_0xca2d('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xca2d('0x71')});}}}catch(_0x394533){logger['error'](_0xca2d('0x72'),_0x3479a7,util[_0xca2d('0x26')](_0x394533,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xca2d('0x27')][_0xca2d('0x73')]=function(_0x1feaf8){try{if(this['isNotNull'](_0x1feaf8)){logger[_0xca2d('0x42')](_0xca2d('0x74'),_0x1feaf8[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x1feaf8,{'showHidden':![],'depth':null}));if(this['channels'][_0x1feaf8[_0xca2d('0x2b')]]&&_0x1feaf8['channel']!='OutgoingSpoolFailed'){if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')])){if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')][_0xca2d('0x76')])){logger[_0xca2d('0x22')](_0xca2d('0x77'),_0x1feaf8[_0xca2d('0x2b')],_0x1feaf8[_0xca2d('0x78')]);this[_0xca2d('0x67')](_0x1feaf8[_0xca2d('0x2b')],_0x1feaf8[_0xca2d('0x78')]);}else if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')][_0xca2d('0x79')])){logger[_0xca2d('0x22')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x1feaf8[_0xca2d('0x2b')],_0x1feaf8[_0xca2d('0x78')]);this[_0xca2d('0x13')][_0x1feaf8[_0xca2d('0x2b')]][_0xca2d('0x2d')]=_0x1feaf8[_0xca2d('0x78')];}else if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')][_0xca2d('0x7a')])){logger[_0xca2d('0x22')](_0xca2d('0x7b'),_0x1feaf8[_0xca2d('0x2b')],_0x1feaf8[_0xca2d('0x78')]);this['channels'][_0x1feaf8['uniqueid']][_0xca2d('0x7c')]=_0x1feaf8[_0xca2d('0x78')];}else if(this['isNotNull'](_0x1feaf8[_0xca2d('0x75')][_0xca2d('0x7d')])){logger[_0xca2d('0x22')](_0xca2d('0x7e'),_0x1feaf8['uniqueid'],_0x1feaf8[_0xca2d('0x78')]);this[_0xca2d('0x13')][_0x1feaf8[_0xca2d('0x2b')]]['type']=_0x1feaf8[_0xca2d('0x78')];}else if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')][_0xca2d('0x7f')])){logger['info'](_0xca2d('0x80'),_0x1feaf8[_0xca2d('0x2b')],_0x1feaf8['value'][_0xca2d('0x38')](',')[0x0]);this[_0xca2d('0x13')][_0x1feaf8[_0xca2d('0x2b')]]['queue']=_0x1feaf8[_0xca2d('0x78')][_0xca2d('0x38')](',')[0x0];}else if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')][_0xca2d('0x81')])){logger[_0xca2d('0x22')](_0xca2d('0x82'),_0x1feaf8[_0xca2d('0x2b')],_0x1feaf8['value']);this[_0xca2d('0x13')][_0x1feaf8[_0xca2d('0x2b')]][_0xca2d('0x83')]=_0x1feaf8['value'];}else if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')]['xmd-destination'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x1feaf8[_0xca2d('0x2b')],_0x1feaf8[_0xca2d('0x78')]);this[_0xca2d('0x13')][_0x1feaf8[_0xca2d('0x2b')]][_0xca2d('0x84')]=_0x1feaf8[_0xca2d('0x78')];}else if(this['isNotNull'](_0x1feaf8[_0xca2d('0x75')][_0xca2d('0x85')])){logger[_0xca2d('0x22')](_0xca2d('0x86'),_0x1feaf8[_0xca2d('0x2b')],_0x1feaf8[_0xca2d('0x78')]);this['channels'][_0x1feaf8['uniqueid']][_0xca2d('0x87')]=_0x1feaf8[_0xca2d('0x78')];}else if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')][_0xca2d('0x88')])){logger[_0xca2d('0x22')](_0xca2d('0x89'),_0x1feaf8['uniqueid'],_0x1feaf8['value']);this[_0xca2d('0x13')][_0x1feaf8[_0xca2d('0x2b')]][_0xca2d('0x9')]=_0x1feaf8[_0xca2d('0x78')];}else if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')]['sipcallid'])){logger['info'](_0xca2d('0x8a'),_0x1feaf8[_0xca2d('0x2b')],_0x1feaf8[_0xca2d('0x78')]);this[_0xca2d('0x13')][_0x1feaf8[_0xca2d('0x2b')]]['sipcalluniqueid']=_0x1feaf8['value'];}}}else if(this['isNotNull'](_0x1feaf8[_0xca2d('0x75')][_0xca2d('0x76')])){if(_0x1feaf8['value']){var _0x95d0c6=path[_0xca2d('0x8b')](_0x1feaf8[_0xca2d('0x78')])[_0xca2d('0x3c')];logger[_0xca2d('0x22')](_0xca2d('0x77'),_0x95d0c6,_0x1feaf8[_0xca2d('0x78')]);this[_0xca2d('0x67')](_0x95d0c6,_0x1feaf8[_0xca2d('0x78')]);}}else if(this[_0xca2d('0x13')][_0x1feaf8[_0xca2d('0x2f')]]){if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')])){if(this[_0xca2d('0x28')](_0x1feaf8[_0xca2d('0x75')][_0xca2d('0x8c')])){logger[_0xca2d('0x22')](_0xca2d('0x8a'),_0x1feaf8[_0xca2d('0x2f')],_0x1feaf8[_0xca2d('0x78')]);this[_0xca2d('0x13')][_0x1feaf8[_0xca2d('0x2f')]][_0xca2d('0x8d')]=_0x1feaf8[_0xca2d('0x78')];}}}}}catch(_0x506811){logger[_0xca2d('0x25')](_0xca2d('0x8e'),_0x1feaf8['uniqueid'],util[_0xca2d('0x26')](_0x506811,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncHangup']=function(_0x1db5e2){try{if(this['isNotNull'](_0x1db5e2)){logger[_0xca2d('0x42')](_0xca2d('0x8f'),_0x1db5e2['uniqueid'],util['inspect'](_0x1db5e2,{'showHidden':![],'depth':null}));if(this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]]){if(this['channels'][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2f')]]){this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2f')]][_0xca2d('0x2b')]=_0x1db5e2[_0xca2d('0x2b')];this['channels'][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2f')]][_0xca2d('0x5d')]=this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x5d')];this['channels'][this['blindTransfers'][_0x1db5e2['linkedid']][_0xca2d('0x2f')]][_0xca2d('0x5e')]=this[_0xca2d('0x13')][_0x1db5e2['uniqueid']][_0xca2d('0x5e')];this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2f')]]['destinationchannel']=this[_0xca2d('0x13')][this['blindTransfers'][_0x1db5e2['linkedid']][_0xca2d('0x2f')]]['channel'];this['channels'][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]]['linkedid']][_0xca2d('0x46')]=this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]]['disposition'];this[_0xca2d('0x13')][_0x1db5e2['uniqueid']]=this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2['linkedid']][_0xca2d('0x2f')]];delete this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2f')]];}else if(this['channels'][this['blindTransfers'][_0x1db5e2['linkedid']][_0xca2d('0x2b')]]){this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2b')]][_0xca2d('0x2b')]=[this[_0xca2d('0x13')][this['blindTransfers'][_0x1db5e2[_0xca2d('0x2f')]]['uniqueid']][_0xca2d('0x2f')],this['channels'][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]]['uniqueid']][_0xca2d('0x2f')]=this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2b')]][_0xca2d('0x2b')]][0x0];this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2b')]][_0xca2d('0x5d')]=this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x5d')];this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2b')]]['answertime']=this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x5e')];this['channels'][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2b')]]['destinationchannel']=this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]]['uniqueid']][_0xca2d('0x37')];this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2['linkedid']][_0xca2d('0x2b')]]['disposition']=this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]]['disposition'];this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]]=this[_0xca2d('0x13')][this[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2b')]];delete this[_0xca2d('0x13')][this['blindTransfers'][_0x1db5e2[_0xca2d('0x2f')]][_0xca2d('0x2b')]];}}if(this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]]){logger[_0xca2d('0x22')](_0xca2d('0x90'),_0x1db5e2[_0xca2d('0x2b')],_0x1db5e2[_0xca2d('0x91')]);var _0x5f0a67=moment();this[_0xca2d('0x13')][_0x1db5e2['uniqueid']][_0xca2d('0x92')]=_0x5f0a67[_0xca2d('0x3a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x52')]=_0x5f0a67[_0xca2d('0x60')](this['channels'][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x51')],_0xca2d('0x54'));if(this[_0xca2d('0x13')][_0x1db5e2['uniqueid']][_0xca2d('0x5d')]){this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x93')]=_0x5f0a67[_0xca2d('0x60')](this['channels'][_0x1db5e2['uniqueid']][_0xca2d('0x5e')],_0xca2d('0x54'));this['channels'][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x5f')]=this[_0xca2d('0x13')][_0x1db5e2['uniqueid']]['duration']-this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x93')];}if(_0x1db5e2['context']===_0xca2d('0x34')){if(this['agents'][_0x1db5e2[_0xca2d('0x37')]['split']('-')[0x0]]){this[_0xca2d('0x14')][_0x1db5e2[_0xca2d('0x37')]['split']('-')[0x0]]=_['omit'](this['agents'][_0x1db5e2[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]],['destconnectedlinenum']);logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x1db5e2['uniqueid'],util[_0xca2d('0x26')]({'id':this['agents'][_0x1db5e2[_0xca2d('0x37')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xca2d('0x14')][_0x1db5e2[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]][_0xca2d('0x3e')]},{'showHidden':![],'depth':null}));this[_0xca2d('0x2a')](util['format'](_0xca2d('0x3b'),this[_0xca2d('0x14')][_0x1db5e2[_0xca2d('0x37')][_0xca2d('0x38')]('-')[0x0]]['name']),_0xca2d('0x94'),{'id':this[_0xca2d('0x14')][_0x1db5e2[_0xca2d('0x37')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1db5e2[_0xca2d('0x37')]['split']('-')[0x0]][_0xca2d('0x3e')]});for(var _0x4092fe=0x0;_0x4092fe<Object['keys'](this['agents'])[_0xca2d('0x95')];_0x4092fe++){var _0xcf40db=Object[_0xca2d('0x32')](this[_0xca2d('0x14')])[_0x4092fe];var _0x1738d9=this['agents'][_0xcf40db];if(_0x1738d9['accountcode']===Number(_0x1db5e2[_0xca2d('0x3f')])){this[_0xca2d('0x2a')](util[_0xca2d('0x3a')](_0xca2d('0x3b'),_0x1738d9[_0xca2d('0x3c')]),_0xca2d('0x94'),{'id':_0x1738d9['id'],'destaccountcode':_0x1738d9['accountcode'],'transfer':this[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x96')]});break;}}}}var _0x1e3ee8=this;Promise[_0xca2d('0x97')]()[_0xca2d('0x98')](function(){var _0x301d45=_0x1e3ee8[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]];if(typeof _0x301d45['transferType']===_0xca2d('0x99'))return;if(_[_0xca2d('0x9a')](_0x301d45[_0xca2d('0x6f')]))return;return RpcSetting[_0xca2d('0x9b')]()['then'](function(_0x388db4){if(!_0x388db4['stopRecordingOnTransfer'])return;return Promise[_0xca2d('0x97')]()['then'](function(){return ami[_0xca2d('0x9c')]({'action':'StopMixMonitor','channel':_0x301d45[_0xca2d('0x37')]})[_0xca2d('0x9d')](function(){});})[_0xca2d('0x98')](function(){return ami['Action']({'action':_0xca2d('0x9e'),'channel':_0x301d45[_0xca2d('0x62')]})['catch'](function(){})[_0xca2d('0x9f')](function(){var _0x4d8562=_0x1e3ee8[_0xca2d('0x14')][_0x301d45[_0xca2d('0x62')][_0xca2d('0x38')]('-')[0x0]];if(!_0x4d8562)return;io[_0xca2d('0x2a')]('webbar:stopmonitors',{'agentId':_0x4d8562['id'],'uniqueid':_0x301d45[_0xca2d('0x2b')]});});});});})[_0xca2d('0x98')](function(){if(_0x1db5e2[_0xca2d('0xa0')]===_0xca2d('0xa1')){_0x1e3ee8[_0xca2d('0x15')][_0x1db5e2[_0xca2d('0x2b')]]=_0x1db5e2;}else{if(_0x1e3ee8[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0xa2')]===_0xca2d('0xa3')&&_0x1e3ee8['blindTransfers'][_0x1db5e2['uniqueid']]){_0x1e3ee8[_0xca2d('0x13')][_0x1db5e2['uniqueid']][_0xca2d('0x2b')]=[_0x1e3ee8['channels'][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x2f')],_0x1e3ee8[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x2f')]=_0x1e3ee8[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]][_0xca2d('0x2b')]][0x0];delete _0x1e3ee8['blindTransfers'][_0x1db5e2[_0xca2d('0x2b')]];}}logger[_0xca2d('0x42')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x1db5e2[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x1e3ee8[_0xca2d('0x13')][_0x1db5e2[_0xca2d('0x2b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xca2d('0xa4'),_0x1e3ee8['channels'][_0x1db5e2['uniqueid']]);delete _0x1e3ee8[_0xca2d('0x13')][_0x1db5e2['uniqueid']];});}}}catch(_0x2496eb){logger[_0xca2d('0x25')](_0xca2d('0xa5'),_0x1db5e2['uniqueid'],util['inspect'](_0x2496eb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xca2d('0x27')][_0xca2d('0x1e')]=function(_0x4b4b22){try{if(this[_0xca2d('0x28')](_0x4b4b22)){logger[_0xca2d('0x22')](_0xca2d('0xa6'),_0x4b4b22[_0xca2d('0x2b')],_0x4b4b22['origtransferercalleridnum'],_0x4b4b22[_0xca2d('0xa7')]);logger[_0xca2d('0x42')](_0xca2d('0xa8'),_0x4b4b22['uniqueid'],util[_0xca2d('0x26')](_0x4b4b22,{'showHidden':![],'depth':null}));var _0x41215d;if(this[_0xca2d('0x13')][_0x4b4b22['transfereeuniqueid']]){this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xa9')]]['transfercalleridnum']=_0x4b4b22[_0xca2d('0xaa')];this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xa9')]][_0xca2d('0xab')]=_0x4b4b22[_0xca2d('0xa7')];if(this['channels'][_0x4b4b22[_0xca2d('0xac')]]){_0x41215d=this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xac')]];this['channels'][_0x4b4b22['secondtransfereruniqueid']]=this[_0xca2d('0x13')][_0x4b4b22['transfereeuniqueid']];this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xa9')]]=_0x41215d;}this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xac')]][_0xca2d('0x96')]='ATTENDED';}else if(this['channels'][_0x4b4b22['transfertargetuniqueid']]){this['channels'][_0x4b4b22[_0xca2d('0xad')]][_0xca2d('0xae')]=_0x4b4b22[_0xca2d('0xaa')];this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xad')]][_0xca2d('0xab')]=_0x4b4b22[_0xca2d('0xa7')];if(this['channels'][_0x4b4b22[_0xca2d('0xaf')]]){_0x41215d=this['channels'][_0x4b4b22[_0xca2d('0xaf')]];this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xaf')]]=this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xad')]];this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xad')]]=_0x41215d;}this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xad')]]['transferType']=_0xca2d('0xb0');}if((this[_0xca2d('0x13')][_0x4b4b22['origtransfereruniqueid']]||this[_0xca2d('0x13')][_0x4b4b22['origtransfererlinkedid']])&&this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xac')]]){var _0x2297c1=_[_0xca2d('0xb1')]([this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xaf')]],this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xb2')]],this['channels'][_0x4b4b22['secondtransfereruniqueid']]],function(_0x3dd966){return _0x3dd966&&_0x3dd966[_0xca2d('0xa2')]===_0xca2d('0xa3')&&_0x3dd966[_0xca2d('0xb3')];});if(_0x2297c1){if(this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xaf')]])this['channels'][_0x4b4b22[_0xca2d('0xaf')]][_0xca2d('0x96')]=_0xca2d('0xb0');if(this['channels'][_0x4b4b22[_0xca2d('0xb2')]])this[_0xca2d('0x13')][_0x4b4b22[_0xca2d('0xb2')]][_0xca2d('0x96')]=_0xca2d('0xb0');this['channels'][_0x4b4b22['secondtransfereruniqueid']][_0xca2d('0x96')]=_0xca2d('0xb0');}}}}catch(_0x96d67a){logger[_0xca2d('0x25')](_0xca2d('0xb4'),_0x4b4b22[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x96d67a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xca2d('0x27')][_0xca2d('0x20')]=function(_0x122135){try{if(this[_0xca2d('0x28')](_0x122135)){logger[_0xca2d('0x22')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x122135[_0xca2d('0x2b')],_0x122135[_0xca2d('0xb5')],_0x122135['extension']);logger[_0xca2d('0x42')](_0xca2d('0xb6'),_0x122135[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x122135,{'showHidden':![],'depth':null}));if(this[_0xca2d('0x13')][_0x122135[_0xca2d('0xa9')]]){this['channels'][_0x122135[_0xca2d('0xa9')]][_0xca2d('0xae')]=_0x122135[_0xca2d('0xb5')];this['channels'][_0x122135[_0xca2d('0xa9')]][_0xca2d('0xab')]=_0x122135[_0xca2d('0xb7')];this[_0xca2d('0x13')][_0x122135[_0xca2d('0xa9')]][_0xca2d('0x96')]='BLIND';this['syncHangup']({'event':_0xca2d('0xa1'),'uniqueid':_0x122135['transfereeuniqueid'],'linkedid':_0x122135[_0xca2d('0xb8')],'context':_0x122135[_0xca2d('0x33')],'channel':_0x122135[_0xca2d('0xb9')]});}else{this[_0xca2d('0x13')][_0x122135['transfereruniqueid']]['transferType']=_0xca2d('0xba');this[_0xca2d('0xbb')]({'event':'BlindTransfer','uniqueid':_0x122135[_0xca2d('0xb8')],'linkedid':_0x122135[_0xca2d('0xa9')],'context':_0x122135['context'],'channel':_0x122135[_0xca2d('0xb9')]});}}}catch(_0x380504){logger[_0xca2d('0x25')](_0xca2d('0xbc'),_0x122135[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x380504,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xca2d('0x27')][_0xca2d('0x21')]=function(_0x2603cc){try{if(this[_0xca2d('0x28')](_0x2603cc)){logger['debug']('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x2603cc[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x2603cc,{'showHidden':![],'depth':null}));if(this[_0xca2d('0x13')][_0x2603cc[_0xca2d('0x2b')]]){if(!_[_0xca2d('0x59')](this[_0xca2d('0x13')][_0x2603cc[_0xca2d('0x2b')]][_0xca2d('0x5e')])){this[_0xca2d('0x13')][_0x2603cc[_0xca2d('0x2b')]][_0xca2d('0xbd')]=moment()[_0xca2d('0x3a')](_0xca2d('0x45'));logger['info'](_0xca2d('0xbe'),_0x2603cc[_0xca2d('0x2b')],this[_0xca2d('0x13')][_0x2603cc[_0xca2d('0x2b')]]['mohstarttime']);}}}}catch(_0x1559dd){logger['error'](_0xca2d('0xbf'),_0x2603cc[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x1559dd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xca2d('0x27')][_0xca2d('0xc0')]=function(_0x242c42){try{if(this['isNotNull'](_0x242c42)){logger[_0xca2d('0x42')](_0xca2d('0xc1'),_0x242c42[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x242c42,{'showHidden':![],'depth':null}));if(this[_0xca2d('0x13')][_0x242c42[_0xca2d('0x2b')]]){if(!_[_0xca2d('0x59')](this[_0xca2d('0x13')][_0x242c42['uniqueid']][_0xca2d('0xbd')])){this[_0xca2d('0x13')][_0x242c42['uniqueid']][_0xca2d('0xc2')]+=moment()[_0xca2d('0xc3')](0x0)[_0xca2d('0x60')](this[_0xca2d('0x13')][_0x242c42[_0xca2d('0x2b')]][_0xca2d('0xbd')],_0xca2d('0x54'));logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x242c42[_0xca2d('0x2b')],this[_0xca2d('0x13')][_0x242c42['uniqueid']][_0xca2d('0xc2')]);delete this[_0xca2d('0x13')][_0x242c42[_0xca2d('0x2b')]]['mohstarttime'];}}}}catch(_0x2a0697){logger[_0xca2d('0x25')]('[%s][voiceCallReport][musiconholdstop]',_0x242c42[_0xca2d('0x2b')],util[_0xca2d('0x26')](_0x2a0697,{'showHidden':![],'depth':null}));}};module[_0xca2d('0xc4')]=VoiceCallReport;
\ No newline at end of file
+var _0x5aab=['calleridname','debug','uniqueid','linkedid','isUndefined','pick','from-sip','channel','exten','destconnectedlinenum','connectedlinenum','user:%s','split','name','user:agentconnect','accountcode','error','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','context','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','keys','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','duration','subtract','seconds','includes','lastapplication','lastdata','startsWith','toLowerCase','match','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','xcally-motion-preview','destinationchannel','UserId','connectedlinename','membername','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','OutgoingSpoolFailed','variable','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcallid','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','transferType','resolve','undefined','then','stopRecordingOnTransfer','Action','StopMixMonitor','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','util','path','ioredis','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','defaults','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','syncVarSet','syncHangup','attendedtransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','inspect','prototype','isNotNull','emit','syncNewCallerId','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s'];(function(_0x58ed9d,_0x53de7f){var _0x180d6e=function(_0x2ec03e){while(--_0x2ec03e){_0x58ed9d['push'](_0x58ed9d['shift']());}};_0x180d6e(++_0x53de7f);}(_0x5aab,0x90));var _0xb5aa=function(_0x264a2e,_0xdfe38b){_0x264a2e=_0x264a2e-0x0;var _0x68bcc4=_0x5aab[_0x264a2e];return _0x68bcc4;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xb5aa('0x0'));var path=require(_0xb5aa('0x1'));var Redis=require(_0xb5aa('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xb5aa('0x3'));var ami=require(_0xb5aa('0x4'));var Channel=require(_0xb5aa('0x5'));var RpcSetting=require(_0xb5aa('0x6'));var applications=[_0xb5aa('0x7'),_0xb5aa('0x8'),_0xb5aa('0x9'),_0xb5aa('0xa'),'playback',_0xb5aa('0xb')];var dispositions=[_0xb5aa('0xc'),_0xb5aa('0xd'),_0xb5aa('0xd'),'NO\x20ANSWER',_0xb5aa('0xc'),_0xb5aa('0xc'),_0xb5aa('0xe'),'BUSY','FAILED',_0xb5aa('0xd'),_0xb5aa('0xd')];config['redis']=_[_0xb5aa('0xf')](config[_0xb5aa('0x10')],{'host':_0xb5aa('0x11'),'port':0x18eb});var io=require(_0xb5aa('0x12'))(new Redis(config[_0xb5aa('0x10')]));function VoiceCallReport(_0x50d1d7){this[_0xb5aa('0x13')]=_0x50d1d7['channels'];this[_0xb5aa('0x14')]=_0x50d1d7[_0xb5aa('0x14')];this[_0xb5aa('0x15')]={};ami['on'](_0xb5aa('0x16'),this[_0xb5aa('0x17')][_0xb5aa('0x18')](this));ami['on'](_0xb5aa('0x19'),this['syncNewExten'][_0xb5aa('0x18')](this));ami['on'](_0xb5aa('0x1a'),this['syncNewChannel'][_0xb5aa('0x18')](this));ami['on'](_0xb5aa('0x1b'),this[_0xb5aa('0x1c')][_0xb5aa('0x18')](this));ami['on']('varset',this[_0xb5aa('0x1d')][_0xb5aa('0x18')](this));ami['on']('hangup',this[_0xb5aa('0x1e')][_0xb5aa('0x18')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0xb5aa('0x18')](this));ami['on'](_0xb5aa('0x1f'),this['syncAttendedTransfer'][_0xb5aa('0x18')](this));ami['on'](_0xb5aa('0x20'),this[_0xb5aa('0x21')][_0xb5aa('0x18')](this));ami['on']('musiconholdstart',this[_0xb5aa('0x22')]['bind'](this));ami['on'](_0xb5aa('0x23'),this['syncMusicOnHoldStop'][_0xb5aa('0x18')](this));try{logger['info'](_0xb5aa('0x24'));ami[_0xb5aa('0x25')]();}catch(_0x2fd010){logger['error']('[voiceCallReport][coreshowchannels]',util[_0xb5aa('0x26')](_0x2fd010,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xb5aa('0x27')][_0xb5aa('0x28')]=function(_0xd69c32){return _0xd69c32!==null&&!_['isUndefined'](_0xd69c32);};VoiceCallReport[_0xb5aa('0x27')][_0xb5aa('0x29')]=function(_0x28f1c9,_0x48bd4f,_0x5cf622){io['to'](_0x28f1c9)[_0xb5aa('0x29')](_0x48bd4f,_0x5cf622);};VoiceCallReport[_0xb5aa('0x27')][_0xb5aa('0x2a')]=function(_0x274a83){try{if(this[_0xb5aa('0x28')](_0x274a83)){logger[_0xb5aa('0x2b')](_0xb5aa('0x2c'),_0x274a83['uniqueid'],_0x274a83[_0xb5aa('0x2d')],_0x274a83['calleridnum']);logger[_0xb5aa('0x2e')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x274a83[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x274a83,{'showHidden':![],'depth':null}));if(_0x274a83[_0xb5aa('0x2f')]===_0x274a83[_0xb5aa('0x30')]){if(!_[_0xb5aa('0x31')](this[_0xb5aa('0x13')][_0x274a83[_0xb5aa('0x2f')]])){_['merge'](this[_0xb5aa('0x13')][_0x274a83[_0xb5aa('0x2f')]],_[_0xb5aa('0x32')](_0x274a83,_['keys'](this[_0xb5aa('0x13')][_0x274a83[_0xb5aa('0x2f')]])));}}if(_0x274a83['context']===_0xb5aa('0x33')){if(this[_0xb5aa('0x14')][_0x274a83[_0xb5aa('0x34')]['split']('-')[0x0]]){if(_0x274a83[_0xb5aa('0x35')]=='xcally-motion-preview'){this['agents'][_0x274a83[_0xb5aa('0x34')]['split']('-')[0x0]][_0xb5aa('0x36')]=_0x274a83[_0xb5aa('0x37')];this[_0xb5aa('0x29')](util['format'](_0xb5aa('0x38'),this['agents'][_0x274a83[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]][_0xb5aa('0x3a')]),_0xb5aa('0x3b'),{'destaccountcode':this[_0xb5aa('0x14')][_0x274a83[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]][_0xb5aa('0x3c')],'destconnectedlinenum':_0x274a83[_0xb5aa('0x37')]});}}}}}catch(_0x4ec8f3){logger[_0xb5aa('0x3d')](_0xb5aa('0x3e'),_0x274a83[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x4ec8f3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb5aa('0x27')]['syncNewChannel']=function(_0x5b5a44){try{if(this[_0xb5aa('0x28')](_0x5b5a44)){logger[_0xb5aa('0x2e')](_0xb5aa('0x3f'),_0x5b5a44[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x5b5a44,{'showHidden':![],'depth':null}));if(this[_0xb5aa('0x13')][_0x5b5a44['uniqueid']])return;if(_0x5b5a44[_0xb5aa('0x34')]==='OutgoingSpoolFailed')return;if(_0x5b5a44[_0xb5aa('0x2f')]!==_0x5b5a44['linkedid']&&!this[_0xb5aa('0x15')][_0x5b5a44[_0xb5aa('0x30')]])return;logger['info']('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x5b5a44[_0xb5aa('0x2f')],_0x5b5a44[_0xb5aa('0x40')],_0x5b5a44['exten']);this[_0xb5aa('0x13')][_0x5b5a44[_0xb5aa('0x2f')]]=new Channel();this[_0xb5aa('0x13')][_0x5b5a44[_0xb5aa('0x2f')]][_0xb5aa('0x41')]=moment()[_0xb5aa('0x42')](_0xb5aa('0x43'));this['channels'][_0x5b5a44[_0xb5aa('0x2f')]][_0xb5aa('0x44')]=dispositions[_[_0xb5aa('0x45')](_0x5b5a44[_0xb5aa('0x46')])];_[_0xb5aa('0x47')](this[_0xb5aa('0x13')][_0x5b5a44[_0xb5aa('0x2f')]],_['pick'](_0x5b5a44,_[_0xb5aa('0x48')](this[_0xb5aa('0x13')][_0x5b5a44[_0xb5aa('0x2f')]])));if(_0x5b5a44[_0xb5aa('0x40')]===_0xb5aa('0x33')){if(this['agents'][_0x5b5a44['channel'][_0xb5aa('0x39')]('-')[0x0]]){if(_['isUndefined'](this['agents'][_0x5b5a44[_0xb5aa('0x34')]['split']('-')[0x0]][_0xb5aa('0x36')])){this[_0xb5aa('0x14')][_0x5b5a44[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]]['destconnectedlinenum']=_0x5b5a44[_0xb5aa('0x35')];logger[_0xb5aa('0x2e')](_0xb5aa('0x49'),_0x5b5a44[_0xb5aa('0x2f')],util['inspect']({'id':this[_0xb5aa('0x14')][_0x5b5a44['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0xb5aa('0x14')][_0x5b5a44[_0xb5aa('0x34')]['split']('-')[0x0]][_0xb5aa('0x3c')],'destconnectedlinenum':_0x5b5a44[_0xb5aa('0x35')]},{'showHidden':![],'depth':null}));this[_0xb5aa('0x29')](util[_0xb5aa('0x42')](_0xb5aa('0x38'),this['agents'][_0x5b5a44['channel'][_0xb5aa('0x39')]('-')[0x0]][_0xb5aa('0x3a')]),_0xb5aa('0x3b'),{'id':this[_0xb5aa('0x14')][_0x5b5a44['channel'][_0xb5aa('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xb5aa('0x14')][_0x5b5a44['channel'][_0xb5aa('0x39')]('-')[0x0]][_0xb5aa('0x3c')],'destconnectedlinenum':_0x5b5a44[_0xb5aa('0x35')]});}}}}}catch(_0x35b744){logger[_0xb5aa('0x3d')](_0xb5aa('0x4a'),_0x5b5a44[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x35b744,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb5aa('0x27')][_0xb5aa('0x17')]=function(_0x2ed35b){try{if(this['isNotNull'](_0x2ed35b)){logger[_0xb5aa('0x2e')](_0xb5aa('0x4b'),_0x2ed35b['uniqueid'],util['inspect'](_0x2ed35b,{'showHidden':![],'depth':null}));if(_0x2ed35b[_0xb5aa('0x34')]==='OutgoingSpoolFailed'||_0x2ed35b[_0xb5aa('0x35')]==='h')return;if(_0x2ed35b['uniqueid']===_0x2ed35b[_0xb5aa('0x30')]||this[_0xb5aa('0x15')][_0x2ed35b[_0xb5aa('0x30')]]){_0x2ed35b[_0xb5aa('0x4c')]=_0x2ed35b[_0xb5aa('0x4c')]['toLowerCase']();_0x2ed35b[_0xb5aa('0x4d')]=_0x2ed35b[_0xb5aa('0x4e')]&&_0x2ed35b[_0xb5aa('0x4e')]['startsWith']('CDR(routeAlias)')?_0x2ed35b[_0xb5aa('0x4e')]:(_0x2ed35b[_0xb5aa('0x4e')]||_0x2ed35b[_0xb5aa('0x4d')])['toLowerCase']();logger[_0xb5aa('0x2b')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x2ed35b[_0xb5aa('0x2f')],_0x2ed35b['application'],_0x2ed35b['applicationdata']);if(_['isUndefined'](this[_0xb5aa('0x13')][_0x2ed35b[_0xb5aa('0x2f')]])){this['channels'][_0x2ed35b[_0xb5aa('0x2f')]]=new Channel();this[_0xb5aa('0x13')][_0x2ed35b[_0xb5aa('0x2f')]][_0xb5aa('0x41')]=_0x2ed35b[_0xb5aa('0x4f')]?moment()[_0xb5aa('0x50')](moment[_0xb5aa('0x4f')](_0x2ed35b['duration'])[_0xb5aa('0x51')](),_0xb5aa('0x51'))[_0xb5aa('0x42')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xb5aa('0x42')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb5aa('0x13')][_0x2ed35b[_0xb5aa('0x2f')]][_0xb5aa('0x44')]=_0xb5aa('0xc');}_[_0xb5aa('0x47')](this['channels'][_0x2ed35b[_0xb5aa('0x2f')]],_['pick'](_0x2ed35b,_[_0xb5aa('0x48')](this[_0xb5aa('0x13')][_0x2ed35b['uniqueid']])));if(_[_0xb5aa('0x52')](applications,_0x2ed35b[_0xb5aa('0x4c')])){this['channels'][_0x2ed35b['uniqueid']][_0xb5aa('0x53')]=_0x2ed35b[_0xb5aa('0x4c')];this['channels'][_0x2ed35b['uniqueid']][_0xb5aa('0x54')]=_0x2ed35b[_0xb5aa('0x4d')];if(_0x2ed35b[_0xb5aa('0x4c')]===_0xb5aa('0x7')&&_[_0xb5aa('0x55')](_0x2ed35b[_0xb5aa('0x4d')][_0xb5aa('0x56')](),'cdr(')){var _0x4c5d0a=_0x2ed35b[_0xb5aa('0x4d')][_0xb5aa('0x39')]('=');var _0x38b1f6=_0x4c5d0a[0x0][_0xb5aa('0x56')]()[_0xb5aa('0x57')](/cdr\((.*)\)/);if(_0x38b1f6){if(_0x38b1f6[0x1]==='type'&&!_['isNil'](this['channels'][_0x2ed35b[_0xb5aa('0x2f')]][_0x38b1f6[0x1]]))return;this[_0xb5aa('0x13')][_0x2ed35b['uniqueid']][_0x38b1f6[0x1]]=_0x4c5d0a[0x1];}}else if(_0x2ed35b[_0xb5aa('0x4c')]===_0xb5aa('0x8')){this[_0xb5aa('0x13')][_0x2ed35b[_0xb5aa('0x2f')]][_0xb5aa('0x8')]=_0x2ed35b[_0xb5aa('0x4d')]['split'](',')[0x0];}}}}}catch(_0x11aa66){logger[_0xb5aa('0x3d')]('[%s][voiceCallReport][newexten]',_0x2ed35b[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x11aa66,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb5aa('0x27')][_0xb5aa('0x1c')]=function(_0x5af890){try{if(this['isNotNull'](_0x5af890)){logger[_0xb5aa('0x2b')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x5af890['uniqueid'],_0x5af890['linkedid'],_0x5af890['calleridname'],_0x5af890[_0xb5aa('0x58')]);logger['debug'](_0xb5aa('0x59'),_0x5af890[_0xb5aa('0x2f')],util['inspect'](_0x5af890,{'showHidden':![],'depth':null}));if(_0x5af890[_0xb5aa('0x46')]!=='6')return;if(_0x5af890['uniqueid']!==_0x5af890[_0xb5aa('0x30')]){var _0x5579ed=moment();if(this['channels'][_0x5af890[_0xb5aa('0x30')]]){if(!this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x30')]][_0xb5aa('0x5a')]){this['channels'][_0x5af890['linkedid']]['answered']=!![];this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x30')]][_0xb5aa('0x5b')]=_0x5579ed[_0xb5aa('0x42')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xb5aa('0x13')][_0x5af890['linkedid']][_0xb5aa('0x41')]){this[_0xb5aa('0x13')][_0x5af890['linkedid']][_0xb5aa('0x5c')]=_0x5579ed[_0xb5aa('0x5d')](this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x30')]][_0xb5aa('0x41')],'seconds');}}this['channels'][_0x5af890[_0xb5aa('0x30')]]['linkedid']=_0x5af890[_0xb5aa('0x2f')];if(_0x5af890[_0xb5aa('0x58')]!==_0xb5aa('0x5e')){this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x30')]]['connectedlinenum']=_0x5af890[_0xb5aa('0x58')];}this['channels'][_0x5af890[_0xb5aa('0x30')]]['connectedlinename']=_0x5af890[_0xb5aa('0x2d')];this[_0xb5aa('0x13')][_0x5af890['linkedid']][_0xb5aa('0x5f')]=_0x5af890[_0xb5aa('0x34')];this['channels'][_0x5af890[_0xb5aa('0x30')]][_0xb5aa('0x44')]=dispositions[_[_0xb5aa('0x45')](_0x5af890['channelstate'])];if(this[_0xb5aa('0x14')][_0x5af890['channel'][_0xb5aa('0x39')]('-')[0x0]]){this['channels'][_0x5af890['linkedid']][_0xb5aa('0x60')]=this[_0xb5aa('0x14')][_0x5af890['channel'][_0xb5aa('0x39')]('-')[0x0]]['id'];this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x30')]]['membername']=this['agents'][_0x5af890[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]]['name'];}}if(this[_0xb5aa('0x13')][_0x5af890['uniqueid']]){if(!this[_0xb5aa('0x13')][_0x5af890['uniqueid']][_0xb5aa('0x5a')]){this['channels'][_0x5af890[_0xb5aa('0x2f')]][_0xb5aa('0x5a')]=!![];this[_0xb5aa('0x13')][_0x5af890['uniqueid']][_0xb5aa('0x5b')]=_0x5579ed['format'](_0xb5aa('0x43'));if(this[_0xb5aa('0x13')][_0x5af890['uniqueid']]['starttime']){this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x2f')]]['holdtime']=_0x5579ed[_0xb5aa('0x5d')](this['channels'][_0x5af890[_0xb5aa('0x2f')]][_0xb5aa('0x41')],'seconds');}}if(_0x5af890[_0xb5aa('0x58')]!==_0xb5aa('0x5e')){this['channels'][_0x5af890[_0xb5aa('0x2f')]][_0xb5aa('0x37')]=_0x5af890[_0xb5aa('0x58')];}this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x2f')]][_0xb5aa('0x61')]=_0x5af890[_0xb5aa('0x2d')];this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x2f')]][_0xb5aa('0x5f')]=_0x5af890['channel'];this['channels'][_0x5af890[_0xb5aa('0x2f')]][_0xb5aa('0x44')]=dispositions[_[_0xb5aa('0x45')](_0x5af890[_0xb5aa('0x46')])];}}else{if(this[_0xb5aa('0x13')][_0x5af890['uniqueid']]){if(this[_0xb5aa('0x14')][_0x5af890[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]]){this[_0xb5aa('0x13')][_0x5af890['uniqueid']][_0xb5aa('0x60')]=this['agents'][_0x5af890[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]]['id'];this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x2f')]][_0xb5aa('0x62')]=this['agents'][_0x5af890['channel'][_0xb5aa('0x39')]('-')[0x0]][_0xb5aa('0x3a')];}}}if(_0x5af890['context']===_0xb5aa('0x33')){if(this[_0xb5aa('0x14')][_0x5af890['channel'][_0xb5aa('0x39')]('-')[0x0]]){this['agents'][_0x5af890[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]][_0xb5aa('0x36')]=_0x5af890['exten'];var _0x4b8099,_0x264743;if(this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x2f')]]){_0x4b8099=this[_0xb5aa('0x13')][_0x5af890['uniqueid']][_0xb5aa('0x63')];_0x264743=this['channels'][_0x5af890[_0xb5aa('0x2f')]][_0xb5aa('0x8')];}else if(this['channels'][_0x5af890[_0xb5aa('0x30')]]){_0x4b8099=this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x30')]][_0xb5aa('0x63')];_0x264743=this[_0xb5aa('0x13')][_0x5af890[_0xb5aa('0x30')]][_0xb5aa('0x8')];}logger[_0xb5aa('0x2e')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x5af890[_0xb5aa('0x2f')],util['inspect']({'id':this[_0xb5aa('0x14')][_0x5af890[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xb5aa('0x14')][_0x5af890[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]][_0xb5aa('0x3c')],'destconnectedlinenum':_0x5af890['exten'],'routealias':_0x4b8099,'queue':_0x264743||undefined},{'showHidden':![],'depth':null}));this[_0xb5aa('0x29')](util['format']('user:%s',this[_0xb5aa('0x14')][_0x5af890[_0xb5aa('0x34')]['split']('-')[0x0]][_0xb5aa('0x3a')]),_0xb5aa('0x3b'),{'id':this[_0xb5aa('0x14')][_0x5af890['channel'][_0xb5aa('0x39')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xb5aa('0x14')][_0x5af890['channel']['split']('-')[0x0]][_0xb5aa('0x3c')],'destconnectedlinenum':_0x5af890[_0xb5aa('0x35')],'routealias':_0x4b8099,'queue':_0x264743||undefined});}}}}catch(_0xa81048){logger['error'](_0xb5aa('0x64'),_0x5af890[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0xa81048,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb5aa('0x65')]=function(_0x23886f,_0x4dc2f3){try{if(this['channels'][_0x23886f]){logger[_0xb5aa('0x2b')](_0xb5aa('0x66'),_0x23886f,_0x4dc2f3);this['channels'][_0x23886f][_0xb5aa('0x67')]=!![];if(_[_0xb5aa('0x68')](_0x4dc2f3,_0xb5aa('0x69'))){_0x4dc2f3=_0x4dc2f3[_0xb5aa('0x6a')](_0xb5aa('0x69'),_0xb5aa('0x6b'));}this[_0xb5aa('0x13')][_0x23886f][_0xb5aa('0x6c')]=_0x4dc2f3;var _0x3a13ac=_['find'](this[_0xb5aa('0x13')][_0x23886f][_0xb5aa('0x6d')],{'filename':_0x4dc2f3});if(_[_0xb5aa('0x6e')](_0x3a13ac)){this[_0xb5aa('0x13')][_0x23886f]['monitors'][_0xb5aa('0x6f')]({'filename':_0x4dc2f3,'createdAt':moment()[_0xb5aa('0x42')](_0xb5aa('0x43')),'mixmonitorid':'','status':'rec'});}}}catch(_0x5ae34a){logger[_0xb5aa('0x3d')](_0xb5aa('0x70'),_0x23886f,util[_0xb5aa('0x26')](_0x5ae34a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncVarSet']=function(_0x387921){try{if(this[_0xb5aa('0x28')](_0x387921)){logger[_0xb5aa('0x2e')]('[%s][voiceCallReport][varset]\x20event:',_0x387921[_0xb5aa('0x2f')],util['inspect'](_0x387921,{'showHidden':![],'depth':null}));if(this[_0xb5aa('0x13')][_0x387921[_0xb5aa('0x2f')]]&&_0x387921[_0xb5aa('0x34')]!=_0xb5aa('0x71')){if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')])){if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')]['mixmonitor_filename'])){logger[_0xb5aa('0x2b')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x387921[_0xb5aa('0x2f')],_0x387921['value']);this[_0xb5aa('0x65')](_0x387921[_0xb5aa('0x2f')],_0x387921[_0xb5aa('0x73')]);}else if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')]['xmd-phone'])){logger[_0xb5aa('0x2b')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x387921[_0xb5aa('0x2f')],_0x387921[_0xb5aa('0x73')]);this[_0xb5aa('0x13')][_0x387921[_0xb5aa('0x2f')]][_0xb5aa('0x58')]=_0x387921['value'];}else if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')][_0xb5aa('0x74')])){logger['info'](_0xb5aa('0x75'),_0x387921[_0xb5aa('0x2f')],_0x387921['value']);this['channels'][_0x387921['uniqueid']][_0xb5aa('0x76')]=_0x387921[_0xb5aa('0x73')];}else if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')][_0xb5aa('0x77')])){logger[_0xb5aa('0x2b')](_0xb5aa('0x78'),_0x387921[_0xb5aa('0x2f')],_0x387921['value']);this[_0xb5aa('0x13')][_0x387921[_0xb5aa('0x2f')]][_0xb5aa('0x79')]=_0x387921[_0xb5aa('0x73')];}else if(this[_0xb5aa('0x28')](_0x387921['variable'][_0xb5aa('0x7a')])){logger[_0xb5aa('0x2b')](_0xb5aa('0x7b'),_0x387921[_0xb5aa('0x2f')],_0x387921[_0xb5aa('0x73')][_0xb5aa('0x39')](',')[0x0]);this[_0xb5aa('0x13')][_0x387921[_0xb5aa('0x2f')]]['queue']=_0x387921[_0xb5aa('0x73')][_0xb5aa('0x39')](',')[0x0];}else if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')][_0xb5aa('0x7c')])){logger[_0xb5aa('0x2b')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x387921[_0xb5aa('0x2f')],_0x387921[_0xb5aa('0x73')]);this[_0xb5aa('0x13')][_0x387921[_0xb5aa('0x2f')]]['originatecalleridnum']=_0x387921[_0xb5aa('0x73')];}else if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')][_0xb5aa('0x7d')])){logger[_0xb5aa('0x2b')](_0xb5aa('0x7e'),_0x387921[_0xb5aa('0x2f')],_0x387921[_0xb5aa('0x73')]);this['channels'][_0x387921[_0xb5aa('0x2f')]]['destination']=_0x387921[_0xb5aa('0x73')];}else if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')][_0xb5aa('0x7f')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x387921['uniqueid'],_0x387921[_0xb5aa('0x73')]);this['channels'][_0x387921[_0xb5aa('0x2f')]][_0xb5aa('0x80')]=_0x387921['value'];}else if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')][_0xb5aa('0x81')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x387921[_0xb5aa('0x2f')],_0x387921['value']);this['channels'][_0x387921['uniqueid']]['queue']=_0x387921[_0xb5aa('0x73')];}else if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')]['sipcallid'])){logger[_0xb5aa('0x2b')](_0xb5aa('0x82'),_0x387921['uniqueid'],_0x387921[_0xb5aa('0x73')]);this[_0xb5aa('0x13')][_0x387921['uniqueid']][_0xb5aa('0x83')]=_0x387921[_0xb5aa('0x73')];}}}else if(this['isNotNull'](_0x387921[_0xb5aa('0x72')]['mixmonitor_filename'])){if(_0x387921[_0xb5aa('0x73')]){var _0x2d1fe5=path['parse'](_0x387921[_0xb5aa('0x73')])[_0xb5aa('0x3a')];logger[_0xb5aa('0x2b')](_0xb5aa('0x84'),_0x2d1fe5,_0x387921['value']);this[_0xb5aa('0x65')](_0x2d1fe5,_0x387921[_0xb5aa('0x73')]);}}else if(this[_0xb5aa('0x13')][_0x387921['linkedid']]){if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')])){if(this[_0xb5aa('0x28')](_0x387921[_0xb5aa('0x72')][_0xb5aa('0x85')])){logger['info'](_0xb5aa('0x82'),_0x387921['linkedid'],_0x387921['value']);this[_0xb5aa('0x13')][_0x387921[_0xb5aa('0x30')]][_0xb5aa('0x86')]=_0x387921['value'];}}}}}catch(_0x3699b9){logger[_0xb5aa('0x3d')]('[%s][voiceCallReport][varset]',_0x387921[_0xb5aa('0x2f')],util['inspect'](_0x3699b9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb5aa('0x27')][_0xb5aa('0x1e')]=function(_0x2cfb25){try{if(this[_0xb5aa('0x28')](_0x2cfb25)){logger[_0xb5aa('0x2e')](_0xb5aa('0x87'),_0x2cfb25[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x2cfb25,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x2cfb25['linkedid']]){if(this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x30')]]['linkedid']]){this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25['linkedid']][_0xb5aa('0x30')]][_0xb5aa('0x2f')]=_0x2cfb25[_0xb5aa('0x2f')];this['channels'][this[_0xb5aa('0x15')][_0x2cfb25['linkedid']][_0xb5aa('0x30')]][_0xb5aa('0x5a')]=this[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]][_0xb5aa('0x5a')];this['channels'][this[_0xb5aa('0x15')][_0x2cfb25['linkedid']][_0xb5aa('0x30')]][_0xb5aa('0x5b')]=this[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]]['answertime'];this[_0xb5aa('0x13')][this['blindTransfers'][_0x2cfb25[_0xb5aa('0x30')]][_0xb5aa('0x30')]][_0xb5aa('0x5f')]=this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25['linkedid']][_0xb5aa('0x30')]][_0xb5aa('0x34')];this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x30')]][_0xb5aa('0x30')]]['disposition']=this[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]]['disposition'];this['channels'][_0x2cfb25[_0xb5aa('0x2f')]]=this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x30')]][_0xb5aa('0x30')]];delete this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x30')]]['linkedid']];}else if(this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x30')]]['uniqueid']]){this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25['linkedid']][_0xb5aa('0x2f')]][_0xb5aa('0x2f')]=[this[_0xb5aa('0x13')][this['blindTransfers'][_0x2cfb25[_0xb5aa('0x30')]][_0xb5aa('0x2f')]][_0xb5aa('0x30')],this[_0xb5aa('0x13')][this['blindTransfers'][_0x2cfb25[_0xb5aa('0x30')]][_0xb5aa('0x2f')]][_0xb5aa('0x30')]=this['channels'][this[_0xb5aa('0x15')][_0x2cfb25['linkedid']][_0xb5aa('0x2f')]]['uniqueid']][0x0];this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25['linkedid']][_0xb5aa('0x2f')]][_0xb5aa('0x5a')]=this[_0xb5aa('0x13')][_0x2cfb25['uniqueid']][_0xb5aa('0x5a')];this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x30')]][_0xb5aa('0x2f')]][_0xb5aa('0x5b')]=this[_0xb5aa('0x13')][_0x2cfb25['uniqueid']]['answertime'];this[_0xb5aa('0x13')][this['blindTransfers'][_0x2cfb25['linkedid']][_0xb5aa('0x2f')]][_0xb5aa('0x5f')]=this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x30')]][_0xb5aa('0x2f')]][_0xb5aa('0x34')];this['channels'][this[_0xb5aa('0x15')][_0x2cfb25['linkedid']]['uniqueid']][_0xb5aa('0x44')]=this[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]][_0xb5aa('0x44')];this[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]]=this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x30')]]['uniqueid']];delete this[_0xb5aa('0x13')][this[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x30')]][_0xb5aa('0x2f')]];}}if(this[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]]){logger[_0xb5aa('0x2b')](_0xb5aa('0x88'),_0x2cfb25['uniqueid'],_0x2cfb25[_0xb5aa('0x89')]);var _0x3bcd8f=moment();this[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]][_0xb5aa('0x8a')]=_0x3bcd8f[_0xb5aa('0x42')](_0xb5aa('0x43'));this['channels'][_0x2cfb25[_0xb5aa('0x2f')]][_0xb5aa('0x4f')]=_0x3bcd8f[_0xb5aa('0x5d')](this['channels'][_0x2cfb25['uniqueid']][_0xb5aa('0x41')],'seconds');if(this[_0xb5aa('0x13')][_0x2cfb25['uniqueid']][_0xb5aa('0x5a')]){this[_0xb5aa('0x13')][_0x2cfb25['uniqueid']]['billableseconds']=_0x3bcd8f['diff'](this[_0xb5aa('0x13')][_0x2cfb25['uniqueid']]['answertime'],_0xb5aa('0x51'));this[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]][_0xb5aa('0x5c')]=this['channels'][_0x2cfb25['uniqueid']][_0xb5aa('0x4f')]-this[_0xb5aa('0x13')][_0x2cfb25['uniqueid']][_0xb5aa('0x8b')];}if(_0x2cfb25['context']==='from-sip'){if(this[_0xb5aa('0x14')][_0x2cfb25['channel'][_0xb5aa('0x39')]('-')[0x0]]){this['agents'][_0x2cfb25[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]]=_['omit'](this['agents'][_0x2cfb25['channel'][_0xb5aa('0x39')]('-')[0x0]],['destconnectedlinenum']);logger[_0xb5aa('0x2e')](_0xb5aa('0x8c'),_0x2cfb25[_0xb5aa('0x2f')],util[_0xb5aa('0x26')]({'id':this[_0xb5aa('0x14')][_0x2cfb25[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xb5aa('0x14')][_0x2cfb25[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0xb5aa('0x42')](_0xb5aa('0x38'),this[_0xb5aa('0x14')][_0x2cfb25[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]][_0xb5aa('0x3a')]),_0xb5aa('0x8d'),{'id':this['agents'][_0x2cfb25[_0xb5aa('0x34')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xb5aa('0x14')][_0x2cfb25[_0xb5aa('0x34')][_0xb5aa('0x39')]('-')[0x0]][_0xb5aa('0x3c')]});for(var _0x398eca=0x0;_0x398eca<Object['keys'](this[_0xb5aa('0x14')])['length'];_0x398eca++){var _0x3ade3f=Object['keys'](this['agents'])[_0x398eca];var _0x5d0995=this[_0xb5aa('0x14')][_0x3ade3f];if(_0x5d0995[_0xb5aa('0x3c')]===Number(_0x2cfb25['connectedlinenum'])){this['emit'](util[_0xb5aa('0x42')](_0xb5aa('0x38'),_0x5d0995['name']),_0xb5aa('0x8d'),{'id':_0x5d0995['id'],'destaccountcode':_0x5d0995[_0xb5aa('0x3c')],'transfer':this[_0xb5aa('0x13')][_0x2cfb25['uniqueid']][_0xb5aa('0x8e')]});break;}}}}var _0x3fe338=this;Promise[_0xb5aa('0x8f')]()['then'](function(){var _0x4df971=_0x3fe338[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]];if(typeof _0x4df971[_0xb5aa('0x8e')]===_0xb5aa('0x90'))return;if(_['isEmpty'](_0x4df971[_0xb5aa('0x6d')]))return;return RpcSetting['getSettings']()[_0xb5aa('0x91')](function(_0x45475c){if(!_0x45475c[_0xb5aa('0x92')])return;return Promise[_0xb5aa('0x8f')]()[_0xb5aa('0x91')](function(){return ami['Action']({'action':'StopMixMonitor','channel':_0x4df971[_0xb5aa('0x34')]})['catch'](function(){});})[_0xb5aa('0x91')](function(){return ami[_0xb5aa('0x93')]({'action':_0xb5aa('0x94'),'channel':_0x4df971['destinationchannel']})['catch'](function(){})[_0xb5aa('0x95')](function(){var _0x19629d=_0x3fe338['agents'][_0x4df971[_0xb5aa('0x5f')][_0xb5aa('0x39')]('-')[0x0]];if(!_0x19629d)return;io[_0xb5aa('0x29')](_0xb5aa('0x96'),{'agentId':_0x19629d['id'],'uniqueid':_0x4df971[_0xb5aa('0x2f')]});});});});})[_0xb5aa('0x91')](function(){if(_0x2cfb25[_0xb5aa('0x97')]===_0xb5aa('0x98')){_0x3fe338[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x2f')]]=_0x2cfb25;}else{if(_0x3fe338[_0xb5aa('0x13')][_0x2cfb25['uniqueid']]['type']===_0xb5aa('0x99')&&_0x3fe338[_0xb5aa('0x15')][_0x2cfb25[_0xb5aa('0x2f')]]){_0x3fe338[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]][_0xb5aa('0x2f')]=[_0x3fe338[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]][_0xb5aa('0x30')],_0x3fe338[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]][_0xb5aa('0x30')]=_0x3fe338['channels'][_0x2cfb25[_0xb5aa('0x2f')]]['uniqueid']][0x0];delete _0x3fe338['blindTransfers'][_0x2cfb25[_0xb5aa('0x2f')]];}}logger[_0xb5aa('0x2e')](_0xb5aa('0x9a'),_0x2cfb25[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x3fe338[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]],{'showHidden':![],'depth':null}));ami[_0xb5aa('0x29')](_0xb5aa('0x9b'),_0x3fe338['channels'][_0x2cfb25['uniqueid']]);delete _0x3fe338[_0xb5aa('0x13')][_0x2cfb25[_0xb5aa('0x2f')]];});}}}catch(_0x415f7e){logger[_0xb5aa('0x3d')]('[%s][voiceCallReport][hangup]',_0x2cfb25[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x415f7e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb5aa('0x9c')]=function(_0x21c0e0){try{if(this[_0xb5aa('0x28')](_0x21c0e0)){logger[_0xb5aa('0x2b')](_0xb5aa('0x9d'),_0x21c0e0[_0xb5aa('0x2f')],_0x21c0e0[_0xb5aa('0x9e')],_0x21c0e0[_0xb5aa('0x9f')]);logger[_0xb5aa('0x2e')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x21c0e0[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x21c0e0,{'showHidden':![],'depth':null}));var _0x523e68;if(this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa0')]]){this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa0')]]['transfercalleridnum']=_0x21c0e0[_0xb5aa('0x9e')];this[_0xb5aa('0x13')][_0x21c0e0['transfereeuniqueid']][_0xb5aa('0xa1')]=_0x21c0e0[_0xb5aa('0x9f')];if(this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa2')]]){_0x523e68=this[_0xb5aa('0x13')][_0x21c0e0['secondtransfereruniqueid']];this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa2')]]=this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa0')]];this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa0')]]=_0x523e68;}this[_0xb5aa('0x13')][_0x21c0e0['secondtransfereruniqueid']][_0xb5aa('0x8e')]=_0xb5aa('0xa3');}else if(this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa4')]]){this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa4')]][_0xb5aa('0xa5')]=_0x21c0e0[_0xb5aa('0x9e')];this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa4')]][_0xb5aa('0xa1')]=_0x21c0e0[_0xb5aa('0x9f')];if(this[_0xb5aa('0x13')][_0x21c0e0['origtransfereruniqueid']]){_0x523e68=this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa6')]];this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa6')]]=this['channels'][_0x21c0e0[_0xb5aa('0xa4')]];this['channels'][_0x21c0e0['transfertargetuniqueid']]=_0x523e68;}this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa4')]][_0xb5aa('0x8e')]=_0xb5aa('0xa3');}if((this['channels'][_0x21c0e0['origtransfereruniqueid']]||this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa7')]])&&this['channels'][_0x21c0e0[_0xb5aa('0xa2')]]){var _0x97571a=_[_0xb5aa('0xa8')]([this[_0xb5aa('0x13')][_0x21c0e0['origtransfereruniqueid']],this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa7')]],this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa2')]]],function(_0x195476){return _0x195476&&_0x195476[_0xb5aa('0x79')]===_0xb5aa('0x99')&&_0x195476[_0xb5aa('0xa9')];});if(_0x97571a){if(this[_0xb5aa('0x13')][_0x21c0e0[_0xb5aa('0xa6')]])this[_0xb5aa('0x13')][_0x21c0e0['origtransfereruniqueid']][_0xb5aa('0x8e')]=_0xb5aa('0xa3');if(this['channels'][_0x21c0e0[_0xb5aa('0xa7')]])this[_0xb5aa('0x13')][_0x21c0e0['origtransfererlinkedid']]['transferType']=_0xb5aa('0xa3');this[_0xb5aa('0x13')][_0x21c0e0['secondtransfereruniqueid']][_0xb5aa('0x8e')]='ATTENDED';}}}}catch(_0xd31d95){logger['error'](_0xb5aa('0xaa'),_0x21c0e0[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0xd31d95,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb5aa('0x27')]['syncBlindTransfer']=function(_0x3a9f02){try{if(this['isNotNull'](_0x3a9f02)){logger[_0xb5aa('0x2b')](_0xb5aa('0xab'),_0x3a9f02['uniqueid'],_0x3a9f02[_0xb5aa('0xac')],_0x3a9f02[_0xb5aa('0xad')]);logger['debug'](_0xb5aa('0xae'),_0x3a9f02[_0xb5aa('0x2f')],util['inspect'](_0x3a9f02,{'showHidden':![],'depth':null}));if(this['channels'][_0x3a9f02[_0xb5aa('0xa0')]]){this[_0xb5aa('0x13')][_0x3a9f02[_0xb5aa('0xa0')]][_0xb5aa('0xa5')]=_0x3a9f02['transfereecalleridnum'];this[_0xb5aa('0x13')][_0x3a9f02['transfereeuniqueid']][_0xb5aa('0xa1')]=_0x3a9f02['extension'];this['channels'][_0x3a9f02['transfereeuniqueid']]['transferType']=_0xb5aa('0xaf');this[_0xb5aa('0x1e')]({'event':'BlindTransfer','uniqueid':_0x3a9f02[_0xb5aa('0xa0')],'linkedid':_0x3a9f02[_0xb5aa('0xb0')],'context':_0x3a9f02[_0xb5aa('0x40')],'channel':_0x3a9f02['transfererchannel']});}else{this['channels'][_0x3a9f02[_0xb5aa('0xb0')]][_0xb5aa('0x8e')]=_0xb5aa('0xaf');this[_0xb5aa('0x1e')]({'event':_0xb5aa('0x98'),'uniqueid':_0x3a9f02[_0xb5aa('0xb0')],'linkedid':_0x3a9f02['transfereeuniqueid'],'context':_0x3a9f02[_0xb5aa('0x40')],'channel':_0x3a9f02['transfererchannel']});}}}catch(_0xf7f4f6){logger[_0xb5aa('0x3d')](_0xb5aa('0xb1'),_0x3a9f02[_0xb5aa('0x2f')],util['inspect'](_0xf7f4f6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb5aa('0x27')][_0xb5aa('0x22')]=function(_0x51640a){try{if(this[_0xb5aa('0x28')](_0x51640a)){logger[_0xb5aa('0x2e')](_0xb5aa('0xb2'),_0x51640a[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x51640a,{'showHidden':![],'depth':null}));if(this[_0xb5aa('0x13')][_0x51640a[_0xb5aa('0x2f')]]){if(!_[_0xb5aa('0x6e')](this['channels'][_0x51640a[_0xb5aa('0x2f')]][_0xb5aa('0x5b')])){this[_0xb5aa('0x13')][_0x51640a[_0xb5aa('0x2f')]][_0xb5aa('0xb3')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xb5aa('0x2b')](_0xb5aa('0xb4'),_0x51640a[_0xb5aa('0x2f')],this[_0xb5aa('0x13')][_0x51640a[_0xb5aa('0x2f')]]['mohstarttime']);}}}}catch(_0x5f4fca){logger[_0xb5aa('0x3d')](_0xb5aa('0xb5'),_0x51640a[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x5f4fca,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb5aa('0xb6')]=function(_0x40f5e0){try{if(this[_0xb5aa('0x28')](_0x40f5e0)){logger['debug'](_0xb5aa('0xb7'),_0x40f5e0[_0xb5aa('0x2f')],util['inspect'](_0x40f5e0,{'showHidden':![],'depth':null}));if(this[_0xb5aa('0x13')][_0x40f5e0[_0xb5aa('0x2f')]]){if(!_[_0xb5aa('0x6e')](this['channels'][_0x40f5e0[_0xb5aa('0x2f')]]['mohstarttime'])){this[_0xb5aa('0x13')][_0x40f5e0['uniqueid']][_0xb5aa('0xb8')]+=moment()[_0xb5aa('0xb9')](0x0)['diff'](this[_0xb5aa('0x13')][_0x40f5e0['uniqueid']][_0xb5aa('0xb3')],'seconds');logger['info'](_0xb5aa('0xba'),_0x40f5e0[_0xb5aa('0x2f')],this[_0xb5aa('0x13')][_0x40f5e0['uniqueid']][_0xb5aa('0xb8')]);delete this[_0xb5aa('0x13')][_0x40f5e0['uniqueid']][_0xb5aa('0xb3')];}}}}catch(_0x5435e4){logger[_0xb5aa('0x3d')](_0xb5aa('0xbb'),_0x40f5e0[_0xb5aa('0x2f')],util[_0xb5aa('0x26')](_0x5435e4,{'showHidden':![],'depth':null}));}};module[_0xb5aa('0xbc')]=VoiceCallReport;
\ No newline at end of file
index 0cde474..4b24bbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33c5=['../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','variable','value','voice','info','outboundrouteid','keys','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','total','holdtime','billableseconds','sumHoldTime','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','toLowerCase','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','moment','util'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x33c5,0xe6));var _0x533c=function(_0x3eb450,_0x592b0a){_0x3eb450=_0x3eb450-0x0;var _0x2c4cfd=_0x33c5[_0x3eb450];return _0x2c4cfd;};'use strict';var _=require('lodash');var moment=require(_0x533c('0x0'));var util=require(_0x533c('0x1'));var Redis=require('ioredis');var config=require(_0x533c('0x2'));var logger=require(_0x533c('0x3'))(_0x533c('0x4'));var ami=require(_0x533c('0x5'));config[_0x533c('0x6')]=_['defaults'](config[_0x533c('0x6')],{'host':_0x533c('0x7'),'port':0x18eb});var io=require(_0x533c('0x8'))(new Redis(config[_0x533c('0x6')]));function VoiceDialReport(_0x34ca89){this[_0x533c('0x9')]=_0x34ca89[_0x533c('0xa')];this[_0x533c('0xb')]=_0x34ca89[_0x533c('0xb')];this[_0x533c('0xc')]={};this[_0x533c('0xd')]={};ami['on'](_0x533c('0xe'),this[_0x533c('0xf')][_0x533c('0x10')](this));ami['on'](_0x533c('0x11'),this[_0x533c('0x12')]['bind'](this));ami['on'](_0x533c('0x13'),this[_0x533c('0x14')][_0x533c('0x10')](this));ami['on'](_0x533c('0x15'),this[_0x533c('0x16')][_0x533c('0x10')](this));}VoiceDialReport['prototype'][_0x533c('0x17')]=function(_0xf93007){return _0xf93007!==null&&!_[_0x533c('0x18')](_0xf93007);};VoiceDialReport[_0x533c('0x19')][_0x533c('0x1a')]=function(_0x1a2a83,_0x8d7c66,_0xa616ca){io['to'](_0x1a2a83)['emit'](_0x8d7c66,_0xa616ca);};VoiceDialReport[_0x533c('0x19')][_0x533c('0xf')]=function(_0x3f4a5c){try{if(this[_0x533c('0x17')](_0x3f4a5c)){logger['debug'](_0x533c('0x1b'),_0x3f4a5c[_0x533c('0x1c')],util[_0x533c('0x1d')](_0x3f4a5c,{'showHidden':![],'depth':null}));if(this[_0x533c('0x9')][_0x3f4a5c[_0x533c('0x1c')]]){_[_0x533c('0x1e')](this[_0x533c('0x9')][_0x3f4a5c[_0x533c('0x1c')]],{'starttime':moment()[_0x533c('0x1f')](_0x533c('0x20')),'lastevent':_0x533c('0x21'),'interface':_0x3f4a5c[_0x533c('0x22')][_0x533c('0x23')](0x0,_0x3f4a5c[_0x533c('0x22')][_0x533c('0x24')]('-')),'membername':_0x3f4a5c[_0x533c('0x22')][_0x533c('0x23')](_0x3f4a5c[_0x533c('0x22')]['lastIndexOf']('/')+0x1,_0x3f4a5c[_0x533c('0x22')]['lastIndexOf']('-'))},_['omit'](_0x3f4a5c,[_0x533c('0x25'),_0x533c('0x26')]));logger['info'](_0x533c('0x27'),_0x3f4a5c[_0x533c('0x1c')],this[_0x533c('0x9')][_0x3f4a5c[_0x533c('0x1c')]]['membername'],this[_0x533c('0x9')][_0x3f4a5c[_0x533c('0x1c')]][_0x533c('0x28')]);logger[_0x533c('0x29')](_0x533c('0x2a'),_0x3f4a5c[_0x533c('0x1c')],util[_0x533c('0x1d')](this[_0x533c('0x9')][_0x3f4a5c[_0x533c('0x1c')]],{'showHidden':![],'depth':null}));if(this[_0x533c('0xc')][_0x3f4a5c['uniqueid']])_[_0x533c('0x1e')](this[_0x533c('0x9')][_0x3f4a5c['uniqueid']],this[_0x533c('0xc')][_0x3f4a5c['uniqueid']]);this[_0x533c('0x1a')](_0x533c('0x2b'),_0x533c('0x2c'),this[_0x533c('0x9')][_0x3f4a5c[_0x533c('0x1c')]]);logger[_0x533c('0x29')](_0x533c('0x2d'),_0x3f4a5c[_0x533c('0x1c')],util[_0x533c('0x1d')](this[_0x533c('0x9')][_0x3f4a5c[_0x533c('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x533c('0x1a')]('custom:dialbegin',this[_0x533c('0x9')][_0x3f4a5c['uniqueid']]);}}}catch(_0x3290de){logger[_0x533c('0x2e')](_0x533c('0x2f'),_0x3f4a5c[_0x533c('0x1c')],util[_0x533c('0x1d')](_0x3290de,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x533c('0x19')][_0x533c('0x12')]=function(_0x624d84){try{if(this[_0x533c('0x17')](_0x624d84)){logger[_0x533c('0x29')](_0x533c('0x30'),_0x624d84[_0x533c('0x1c')],util[_0x533c('0x1d')](_0x624d84,{'showHidden':![],'depth':null}));if(this[_0x533c('0x9')][_0x624d84[_0x533c('0x1c')]]){this['channels'][_0x624d84[_0x533c('0x1c')]][_0x533c('0x31')]=_0x624d84[_0x533c('0x31')];if(_0x624d84[_0x533c('0x31')]==='ANSWER'){this[_0x533c('0x9')][_0x624d84[_0x533c('0x1c')]][_0x533c('0x32')]=_0x624d84[_0x533c('0x32')];this[_0x533c('0x9')][_0x624d84['uniqueid']]['connectedlinename']=_0x624d84['connectedlinename'];this['channels'][_0x624d84['uniqueid']][_0x533c('0x33')]=moment()['format'](_0x533c('0x20'));this['channels'][_0x624d84[_0x533c('0x1c')]][_0x533c('0x34')]=_0x533c('0x35');logger['info'](_0x533c('0x36'),_0x624d84[_0x533c('0x1c')],_0x624d84[_0x533c('0x22')]['substring'](_0x624d84[_0x533c('0x22')][_0x533c('0x24')]('/')+0x1,_0x624d84[_0x533c('0x22')]['lastIndexOf']('-')));logger[_0x533c('0x29')](_0x533c('0x37'),_0x624d84[_0x533c('0x1c')],util[_0x533c('0x1d')](this[_0x533c('0x9')][_0x624d84[_0x533c('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x533c('0x1a')](_0x533c('0x38'),this[_0x533c('0x9')][_0x624d84[_0x533c('0x1c')]]);}logger[_0x533c('0x29')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x624d84[_0x533c('0x1c')],util[_0x533c('0x1d')](this[_0x533c('0x9')][_0x624d84[_0x533c('0x1c')]],{'showHidden':![],'depth':null}));this[_0x533c('0x1a')](_0x533c('0x2b'),'voice_outbound_channel:save',this[_0x533c('0x9')][_0x624d84[_0x533c('0x1c')]]);}}}catch(_0x41f5a2){logger['error'](_0x533c('0x39'),_0x624d84[_0x533c('0x1c')],util[_0x533c('0x1d')](_0x41f5a2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x533c('0x19')]['syncVarSet']=function(_0x365e71){try{if(this['isNotNull'](_0x365e71)){logger[_0x533c('0x29')](_0x533c('0x3a'),_0x365e71['uniqueid'],util[_0x533c('0x1d')](_0x365e71,{'showHidden':![],'depth':null}));this[_0x533c('0x3b')](_0x365e71[_0x533c('0x1c')],_['keys'](_0x365e71['variable'])[0x0],_0x365e71['value']);if(this['isNotNull'](_0x365e71[_0x533c('0x3c')])&&this['isNotNull'](_0x365e71[_0x533c('0x3c')]['outboundrouteid'])){if(_[_0x533c('0x18')](this['channels'][_0x365e71[_0x533c('0x1c')]])){this[_0x533c('0x9')][_0x365e71['uniqueid']]={'routeId':_0x365e71[_0x533c('0x3d')],'variables':this[_0x533c('0xd')][_0x365e71[_0x533c('0x1c')]],'motionChannel':_0x533c('0x3e')};logger[_0x533c('0x3f')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x365e71[_0x533c('0x1c')],_0x365e71[_0x533c('0x3c')][_0x533c('0x40')],_[_0x533c('0x41')](_0x365e71['variable'])[0x0],_0x365e71[_0x533c('0x3d')]);logger[_0x533c('0x29')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x365e71['uniqueid'],util[_0x533c('0x1d')](this['channels'][_0x365e71[_0x533c('0x1c')]],{'showHidden':![],'depth':null}));this[_0x533c('0x1a')](_0x533c('0x2b'),_0x533c('0x2c'),this[_0x533c('0x9')][_0x365e71[_0x533c('0x1c')]]);}}}}catch(_0xa34f64){logger[_0x533c('0x2e')]('[%s][voiceDialReport][varset]',_0x365e71[_0x533c('0x1c')],util[_0x533c('0x1d')](_0xa34f64,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x533c('0x19')]['addVariable']=function(_0x2f0256,_0x30f457,_0x5ce027){var _0x1d081c=['rtpaudioqos',_0x533c('0x42'),_0x533c('0x43'),_0x533c('0x44'),_0x533c('0x45'),_0x533c('0x46'),_0x533c('0x47'),_0x533c('0x48'),'sipcallid',_0x533c('0x49'),_0x533c('0x4a'),_0x533c('0x4b'),_0x533c('0x4c'),_0x533c('0x4d'),_0x533c('0x4e'),_0x533c('0x4f'),'membername','memberpenalty','memberrealtime'];if(!_['isNil'](_0x30f457)&&!_[_0x533c('0x50')](_0x1d081c,_0x30f457)){if(_[_0x533c('0x18')](this['variables'][_0x2f0256])){this[_0x533c('0xd')][_0x2f0256]={};}this[_0x533c('0xd')][_0x2f0256][_0x30f457]=_0x5ce027;}};VoiceDialReport[_0x533c('0x19')]['syncHangup']=function(_0x1de19e){try{if(this['isNotNull'](_0x1de19e)){logger['debug'](_0x533c('0x51'),_0x1de19e[_0x533c('0x1c')],util[_0x533c('0x1d')](_0x1de19e,{'showHidden':![],'depth':null}));if(this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]]){logger[_0x533c('0x3f')](_0x533c('0x52'),_0x1de19e['uniqueid'],_0x1de19e[_0x533c('0x53')]);this['channels'][_0x1de19e[_0x533c('0x1c')]][_0x533c('0x54')]=moment()[_0x533c('0x1f')](_0x533c('0x20'));this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]][_0x533c('0x55')]=moment(this[_0x533c('0x9')][_0x1de19e['uniqueid']][_0x533c('0x54')])[_0x533c('0x56')](this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]][_0x533c('0x57')],_0x533c('0x58'));this['channels'][_0x1de19e[_0x533c('0x1c')]]['lastevent']=_0x533c('0x59');this[_0x533c('0xb')][_0x533c('0x5a')]+=0x1;if(this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]][_0x533c('0x33')]){this['outbound']['answered']+=0x1;this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]][_0x533c('0x5b')]=moment(this[_0x533c('0x9')][_0x1de19e['uniqueid']][_0x533c('0x33')])[_0x533c('0x56')](this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]][_0x533c('0x57')],_0x533c('0x58'));this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]][_0x533c('0x5c')]=moment(this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]][_0x533c('0x54')])[_0x533c('0x56')](this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]][_0x533c('0x33')],_0x533c('0x58'));this['outbound'][_0x533c('0x5d')]+=this['channels'][_0x1de19e['uniqueid']][_0x533c('0x5b')]||0x0;this[_0x533c('0xb')][_0x533c('0x5e')]+=this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]][_0x533c('0x5c')];}this[_0x533c('0xb')]['sumDuration']+=this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]]['duration'];logger[_0x533c('0x29')](_0x533c('0x5f'),_0x1de19e[_0x533c('0x1c')],util[_0x533c('0x1d')](this['channels'][_0x1de19e[_0x533c('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x533c('0x1a')]('custom:voiceDialReport',this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]]);logger['debug'](_0x533c('0x60'),_0x1de19e[_0x533c('0x1c')],util['inspect'](this[_0x533c('0x9')][_0x1de19e['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x533c('0x61'),this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]]);logger[_0x533c('0x29')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x1de19e[_0x533c('0x1c')],util[_0x533c('0x1d')](this[_0x533c('0x9')][_0x1de19e[_0x533c('0x1c')]],{'showHidden':![],'depth':null}));this[_0x533c('0x1a')]('voice:outbound',_0x533c('0x62'),this['outbound']);logger[_0x533c('0x3f')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x533c('0x63')](this['channels'][_0x1de19e['uniqueid']]));logger['debug'](_0x533c('0x64'),_0x1de19e[_0x533c('0x1c')],util[_0x533c('0x1d')](this['channels'][_0x1de19e[_0x533c('0x1c')]],{'showHidden':![],'depth':null}));this[_0x533c('0x1a')](_0x533c('0x2b'),_0x533c('0x65'),this[_0x533c('0x9')][_0x1de19e['uniqueid']]);delete this['channels'][_0x1de19e[_0x533c('0x1c')]];}else if(this[_0x533c('0x9')][_0x1de19e[_0x533c('0x66')]]){this[_0x533c('0x9')][_0x1de19e[_0x533c('0x66')]][_0x533c('0x1c')]=this[_0x533c('0x9')][_0x1de19e[_0x533c('0x66')]][_0x533c('0x67')];}if(this['variables'][_0x1de19e[_0x533c('0x1c')]]){delete this[_0x533c('0xd')][_0x1de19e[_0x533c('0x1c')]];}}}catch(_0x1be91f){logger[_0x533c('0x2e')](_0x533c('0x68'),_0x1de19e[_0x533c('0x1c')],util[_0x533c('0x1d')](_0x1be91f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x533c('0x19')][_0x533c('0x69')]=function(_0xfd598d){try{if(this[_0x533c('0x17')](_0xfd598d)){logger[_0x533c('0x29')](_0x533c('0x6a'),_0xfd598d[_0x533c('0x1c')],util[_0x533c('0x1d')](_0xfd598d,{'showHidden':![],'depth':null}));if(_0xfd598d[_0x533c('0x6b')]['toLowerCase']()===_0x533c('0x6c')){_0xfd598d[_0x533c('0x6d')]=(_0xfd598d['appdata']||_0xfd598d['applicationdata'])[_0x533c('0x6e')]();if(_['startsWith'](_0xfd598d[_0x533c('0x6d')],_0x533c('0x6f'))){if(_[_0x533c('0x18')](this[_0x533c('0xc')][_0xfd598d[_0x533c('0x1c')]]))this['applications'][_0xfd598d[_0x533c('0x1c')]]={};logger[_0x533c('0x3f')](_0x533c('0x70'),_0xfd598d[_0x533c('0x1c')],_0xfd598d[_0x533c('0x6b')],_0xfd598d[_0x533c('0x6d')]);var _0x1aa938=_0xfd598d[_0x533c('0x6d')][_0x533c('0x71')]('=');var _0x104964=_0x1aa938[0x0][_0x533c('0x72')](/cdr\((.*)\)/);if(_0x104964)this[_0x533c('0xc')][_0xfd598d[_0x533c('0x1c')]][_0x104964[0x1]]=_0x1aa938[0x1];}}}}catch(_0x452759){logger[_0x533c('0x2e')](_0x533c('0x73'),_0xfd598d[_0x533c('0x1c')],util[_0x533c('0x1d')](_0x452759,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
+var _0x31f0=['emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','channels','merge','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','info','interface','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]','keys','variable','outboundrouteid','value','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','endtime','diff','starttime','seconds','total','answertime','holdtime','sumBillable','billableseconds','sumDuration','duration','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','applicationdata','startsWith','split','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','outboundChannels','outbound','applications','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined'];(function(_0x3dec3a,_0xff4bb5){var _0x162b3e=function(_0x1f6130){while(--_0x1f6130){_0x3dec3a['push'](_0x3dec3a['shift']());}};_0x162b3e(++_0xff4bb5);}(_0x31f0,0xb7));var _0x031f=function(_0x422bb8,_0x56a648){_0x422bb8=_0x422bb8-0x0;var _0x4ee124=_0x31f0[_0x422bb8];return _0x4ee124;};'use strict';var _=require(_0x031f('0x0'));var moment=require('moment');var util=require(_0x031f('0x1'));var Redis=require('ioredis');var config=require(_0x031f('0x2'));var logger=require(_0x031f('0x3'))(_0x031f('0x4'));var ami=require(_0x031f('0x5'));config['redis']=_[_0x031f('0x6')](config[_0x031f('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x3dc98e){this['channels']=_0x3dc98e[_0x031f('0x8')];this[_0x031f('0x9')]=_0x3dc98e[_0x031f('0x9')];this[_0x031f('0xa')]={};this['variables']={};ami['on'](_0x031f('0xb'),this[_0x031f('0xc')][_0x031f('0xd')](this));ami['on'](_0x031f('0xe'),this[_0x031f('0xf')][_0x031f('0xd')](this));ami['on'](_0x031f('0x10'),this[_0x031f('0x11')]['bind'](this));ami['on'](_0x031f('0x12'),this[_0x031f('0x13')][_0x031f('0xd')](this));}VoiceDialReport[_0x031f('0x14')][_0x031f('0x15')]=function(_0x405896){return _0x405896!==null&&!_[_0x031f('0x16')](_0x405896);};VoiceDialReport['prototype'][_0x031f('0x17')]=function(_0x23b40c,_0x17a699,_0x2e3dfe){io['to'](_0x23b40c)[_0x031f('0x17')](_0x17a699,_0x2e3dfe);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x1f08db){try{if(this[_0x031f('0x15')](_0x1f08db)){logger[_0x031f('0x18')](_0x031f('0x19'),_0x1f08db['uniqueid'],util[_0x031f('0x1a')](_0x1f08db,{'showHidden':![],'depth':null}));if(this[_0x031f('0x1b')][_0x1f08db['uniqueid']]){_[_0x031f('0x1c')](this['channels'][_0x1f08db[_0x031f('0x1d')]],{'starttime':moment()[_0x031f('0x1e')](_0x031f('0x1f')),'lastevent':_0x031f('0x20'),'interface':_0x1f08db[_0x031f('0x21')][_0x031f('0x22')](0x0,_0x1f08db[_0x031f('0x21')][_0x031f('0x23')]('-')),'membername':_0x1f08db[_0x031f('0x21')][_0x031f('0x22')](_0x1f08db[_0x031f('0x21')]['lastIndexOf']('/')+0x1,_0x1f08db[_0x031f('0x21')][_0x031f('0x23')]('-'))},_[_0x031f('0x24')](_0x1f08db,['event','privilege']));logger[_0x031f('0x25')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x1f08db[_0x031f('0x1d')],this['channels'][_0x1f08db['uniqueid']]['membername'],this[_0x031f('0x1b')][_0x1f08db[_0x031f('0x1d')]][_0x031f('0x26')]);logger[_0x031f('0x18')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x1f08db[_0x031f('0x1d')],util['inspect'](this[_0x031f('0x1b')][_0x1f08db[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));if(this[_0x031f('0xa')][_0x1f08db['uniqueid']])_[_0x031f('0x1c')](this[_0x031f('0x1b')][_0x1f08db['uniqueid']],this[_0x031f('0xa')][_0x1f08db[_0x031f('0x1d')]]);this[_0x031f('0x17')]('voice:outbound',_0x031f('0x27'),this[_0x031f('0x1b')][_0x1f08db[_0x031f('0x1d')]]);logger[_0x031f('0x18')](_0x031f('0x28'),_0x1f08db[_0x031f('0x1d')],util['inspect'](this[_0x031f('0x1b')][_0x1f08db[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));ami[_0x031f('0x17')](_0x031f('0x29'),this[_0x031f('0x1b')][_0x1f08db[_0x031f('0x1d')]]);}}}catch(_0x378692){logger[_0x031f('0x2a')](_0x031f('0x2b'),_0x1f08db[_0x031f('0x1d')],util[_0x031f('0x1a')](_0x378692,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x031f('0xf')]=function(_0xe5f11c){try{if(this[_0x031f('0x15')](_0xe5f11c)){logger[_0x031f('0x18')](_0x031f('0x2c'),_0xe5f11c[_0x031f('0x1d')],util[_0x031f('0x1a')](_0xe5f11c,{'showHidden':![],'depth':null}));if(this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]]){this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]][_0x031f('0x2d')]=_0xe5f11c[_0x031f('0x2d')];if(_0xe5f11c['dialstatus']===_0x031f('0x2e')){this[_0x031f('0x1b')][_0xe5f11c['uniqueid']][_0x031f('0x2f')]=_0xe5f11c[_0x031f('0x2f')];this['channels'][_0xe5f11c[_0x031f('0x1d')]][_0x031f('0x30')]=_0xe5f11c[_0x031f('0x30')];this[_0x031f('0x1b')][_0xe5f11c['uniqueid']]['answertime']=moment()[_0x031f('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]][_0x031f('0x31')]='connect';logger['info'](_0x031f('0x32'),_0xe5f11c['uniqueid'],_0xe5f11c['channel'][_0x031f('0x22')](_0xe5f11c[_0x031f('0x21')][_0x031f('0x23')]('/')+0x1,_0xe5f11c[_0x031f('0x21')][_0x031f('0x23')]('-')));logger[_0x031f('0x18')](_0x031f('0x33'),_0xe5f11c['uniqueid'],util[_0x031f('0x1a')](this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));ami[_0x031f('0x17')]('custom:dialconnect',this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]]);}logger[_0x031f('0x18')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0xe5f11c[_0x031f('0x1d')],util[_0x031f('0x1a')](this['channels'][_0xe5f11c[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));this[_0x031f('0x17')]('voice:outbound','voice_outbound_channel:save',this[_0x031f('0x1b')][_0xe5f11c[_0x031f('0x1d')]]);}}}catch(_0x9efbc4){logger[_0x031f('0x2a')](_0x031f('0x34'),_0xe5f11c[_0x031f('0x1d')],util[_0x031f('0x1a')](_0x9efbc4,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x031f('0x11')]=function(_0xe71615){try{if(this['isNotNull'](_0xe71615)){logger[_0x031f('0x18')]('[%s][voiceDialReport][varset]\x20event:',_0xe71615[_0x031f('0x1d')],util[_0x031f('0x1a')](_0xe71615,{'showHidden':![],'depth':null}));this['addVariable'](_0xe71615[_0x031f('0x1d')],_[_0x031f('0x35')](_0xe71615[_0x031f('0x36')])[0x0],_0xe71615['value']);if(this[_0x031f('0x15')](_0xe71615[_0x031f('0x36')])&&this[_0x031f('0x15')](_0xe71615[_0x031f('0x36')][_0x031f('0x37')])){if(_[_0x031f('0x16')](this[_0x031f('0x1b')][_0xe71615[_0x031f('0x1d')]])){this[_0x031f('0x1b')][_0xe71615['uniqueid']]={'routeId':_0xe71615[_0x031f('0x38')],'variables':this[_0x031f('0x39')][_0xe71615[_0x031f('0x1d')]],'motionChannel':_0x031f('0x3a')};logger[_0x031f('0x25')](_0x031f('0x3b'),_0xe71615[_0x031f('0x1d')],_0xe71615[_0x031f('0x36')][_0x031f('0x37')],_['keys'](_0xe71615[_0x031f('0x36')])[0x0],_0xe71615['value']);logger['debug'](_0x031f('0x3c'),_0xe71615[_0x031f('0x1d')],util[_0x031f('0x1a')](this[_0x031f('0x1b')][_0xe71615[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));this['emit'](_0x031f('0x3d'),_0x031f('0x27'),this[_0x031f('0x1b')][_0xe71615['uniqueid']]);}}}}catch(_0x274166){logger[_0x031f('0x2a')](_0x031f('0x3e'),_0xe71615[_0x031f('0x1d')],util[_0x031f('0x1a')](_0x274166,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x031f('0x14')]['addVariable']=function(_0x569d8f,_0xd28ade,_0x579b17){var _0x3b8c04=[_0x031f('0x3f'),'rtpaudioqosbridged',_0x031f('0x40'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x031f('0x41'),'rtpaudioqosrtt',_0x031f('0x42'),'sipcallid',_0x031f('0x43'),_0x031f('0x44'),'bridgepvtcallid',_0x031f('0x45'),_0x031f('0x46'),'memberinterface',_0x031f('0x47'),'membername',_0x031f('0x48'),'memberrealtime'];if(!_[_0x031f('0x49')](_0xd28ade)&&!_[_0x031f('0x4a')](_0x3b8c04,_0xd28ade)){if(_[_0x031f('0x16')](this[_0x031f('0x39')][_0x569d8f])){this[_0x031f('0x39')][_0x569d8f]={};}this['variables'][_0x569d8f][_0xd28ade]=_0x579b17;}};VoiceDialReport[_0x031f('0x14')]['syncHangup']=function(_0x186957){try{if(this[_0x031f('0x15')](_0x186957)){logger['debug'](_0x031f('0x4b'),_0x186957[_0x031f('0x1d')],util['inspect'](_0x186957,{'showHidden':![],'depth':null}));if(this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]){logger[_0x031f('0x25')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x186957[_0x031f('0x1d')],_0x186957['cause-txt']);this[_0x031f('0x1b')][_0x186957['uniqueid']][_0x031f('0x4c')]=moment()['format'](_0x031f('0x1f'));this[_0x031f('0x1b')][_0x186957['uniqueid']]['duration']=moment(this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]['endtime'])[_0x031f('0x4d')](this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]][_0x031f('0x4e')],_0x031f('0x4f'));this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]][_0x031f('0x31')]='complete';this[_0x031f('0x9')][_0x031f('0x50')]+=0x1;if(this[_0x031f('0x1b')][_0x186957['uniqueid']][_0x031f('0x51')]){this[_0x031f('0x9')]['answered']+=0x1;this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]][_0x031f('0x52')]=moment(this[_0x031f('0x1b')][_0x186957['uniqueid']]['answertime'])['diff'](this['channels'][_0x186957[_0x031f('0x1d')]][_0x031f('0x4e')],'seconds');this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]['billableseconds']=moment(this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]][_0x031f('0x4c')])[_0x031f('0x4d')](this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]][_0x031f('0x51')],_0x031f('0x4f'));this[_0x031f('0x9')]['sumHoldTime']+=this[_0x031f('0x1b')][_0x186957['uniqueid']][_0x031f('0x52')]||0x0;this[_0x031f('0x9')][_0x031f('0x53')]+=this['channels'][_0x186957['uniqueid']][_0x031f('0x54')];}this[_0x031f('0x9')][_0x031f('0x55')]+=this[_0x031f('0x1b')][_0x186957['uniqueid']][_0x031f('0x56')];logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x186957[_0x031f('0x1d')],util['inspect'](this['channels'][_0x186957[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));ami[_0x031f('0x17')](_0x031f('0x57'),this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x186957[_0x031f('0x1d')],util['inspect'](this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));ami['emit'](_0x031f('0x58'),this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]);logger[_0x031f('0x18')](_0x031f('0x59'),_0x186957[_0x031f('0x1d')],util['inspect'](this['channels'][_0x186957[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));this[_0x031f('0x17')](_0x031f('0x3d'),_0x031f('0x5a'),this[_0x031f('0x9')]);logger[_0x031f('0x25')](_0x031f('0x5b'),JSON['stringify'](this['channels'][_0x186957['uniqueid']]));logger['debug'](_0x031f('0x5c'),_0x186957[_0x031f('0x1d')],util[_0x031f('0x1a')](this['channels'][_0x186957[_0x031f('0x1d')]],{'showHidden':![],'depth':null}));this[_0x031f('0x17')]('voice:outbound',_0x031f('0x5d'),this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]]);delete this[_0x031f('0x1b')][_0x186957[_0x031f('0x1d')]];}else if(this[_0x031f('0x1b')][_0x186957[_0x031f('0x5e')]]){this['channels'][_0x186957['linkedid']][_0x031f('0x1d')]=this['channels'][_0x186957[_0x031f('0x5e')]]['destuniqueid'];}if(this[_0x031f('0x39')][_0x186957[_0x031f('0x1d')]]){delete this[_0x031f('0x39')][_0x186957['uniqueid']];}}}catch(_0x46507a){logger['error'](_0x031f('0x5f'),_0x186957[_0x031f('0x1d')],util[_0x031f('0x1a')](_0x46507a,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x031f('0x60')]=function(_0x398e7c){try{if(this[_0x031f('0x15')](_0x398e7c)){logger[_0x031f('0x18')](_0x031f('0x61'),_0x398e7c['uniqueid'],util['inspect'](_0x398e7c,{'showHidden':![],'depth':null}));if(_0x398e7c[_0x031f('0x62')][_0x031f('0x63')]()==='set'){_0x398e7c[_0x031f('0x64')]=(_0x398e7c['appdata']||_0x398e7c[_0x031f('0x64')])[_0x031f('0x63')]();if(_[_0x031f('0x65')](_0x398e7c[_0x031f('0x64')],'cdr(')){if(_[_0x031f('0x16')](this[_0x031f('0xa')][_0x398e7c[_0x031f('0x1d')]]))this['applications'][_0x398e7c[_0x031f('0x1d')]]={};logger[_0x031f('0x25')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x398e7c[_0x031f('0x1d')],_0x398e7c[_0x031f('0x62')],_0x398e7c[_0x031f('0x64')]);var _0x2fb2a8=_0x398e7c[_0x031f('0x64')][_0x031f('0x66')]('=');var _0x3f3582=_0x2fb2a8[0x0]['match'](/cdr\((.*)\)/);if(_0x3f3582)this[_0x031f('0xa')][_0x398e7c[_0x031f('0x1d')]][_0x3f3582[0x1]]=_0x2fb2a8[0x1];}}}}catch(_0x23cc40){logger['error']('[%s][voiceDialReport][newexten]',_0x398e7c[_0x031f('0x1d')],util['inspect'](_0x23cc40,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
index 9f9f3c3..7256f42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3884=['blindtransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','enqueue','isNil','Action','status','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','debug',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','emitVoiceQueueSummary','type','strategy','answered','available','loggedIn','pTalking','sumHoldTime','unmanaged','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','loopQueueShow','[voiceQueueReport][queues]','flagQueueSummary','isNotNull','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','custom:queuesummary','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','uniqueid','isUndefined','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','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','[%s][voiceQueueReport][agentcomplete]','membername','queuecallercomplete','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','COMPLETEDBY','reason','toUpperCase','[%s][voiceQueueReport][varset]','addVariable','keys','value','variable','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','memberrealtime','[%s][voiceQueueReport][hangup]','length','diff','total','sumBillable','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','sumDuration','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','switch','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','ioredis','../../../config/environment','../ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','tail','finally','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3884,0xbf));var _0x4388=function(_0x5dc755,_0x3254d0){_0x5dc755=_0x5dc755-0x0;var _0x24ce81=_0x3884[_0x5dc755];return _0x24ce81;};'use strict';var _=require(_0x4388('0x0'));var moment=require(_0x4388('0x1'));var util=require(_0x4388('0x2'));var md5=require(_0x4388('0x3'));var Redis=require(_0x4388('0x4'));var config=require(_0x4388('0x5'));var logger=require('../../../config/logger')('ami');var ami=require(_0x4388('0x6'));var QueueReport=require(_0x4388('0x7'));config[_0x4388('0x8')]=_[_0x4388('0x9')](config[_0x4388('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x4388('0xa'))(new Redis(config[_0x4388('0x8')]));var Sequence=function(){};Sequence[_0x4388('0xb')]['enqueue']=function(_0x12ad51){this[_0x4388('0xc')]=this['tail']?this['tail'][_0x4388('0xd')](_0x12ad51):_0x12ad51();};function VoiceQueueReport(_0x1422d3){this['sequence']=new Sequence();this[_0x4388('0xe')]={};this[_0x4388('0xf')]=_0x1422d3[_0x4388('0xf')];this[_0x4388('0x10')]=_0x1422d3[_0x4388('0x11')];this['voiceQueues']=_0x1422d3[_0x4388('0x12')];this['flagQueueSummary']=!![];this[_0x4388('0x13')]=_0x1422d3[_0x4388('0x13')];this[_0x4388('0x14')]={};ami['on'](_0x4388('0x15'),this[_0x4388('0x16')][_0x4388('0x17')](this));ami['on'](_0x4388('0x18'),this[_0x4388('0x19')]['bind'](this));ami['on'](_0x4388('0x1a'),this['syncQueueCallerJoin'][_0x4388('0x17')](this));ami['on'](_0x4388('0x1b'),this['syncQueueCallerAbandon'][_0x4388('0x17')](this));ami['on'](_0x4388('0x1c'),this[_0x4388('0x1d')][_0x4388('0x17')](this));ami['on'](_0x4388('0x1e'),this[_0x4388('0x1f')][_0x4388('0x17')](this));ami['on'](_0x4388('0x20'),this[_0x4388('0x21')]['bind'](this));ami['on'](_0x4388('0x22'),this[_0x4388('0x23')]['bind'](this));ami['on'](_0x4388('0x24'),this[_0x4388('0x25')]['bind'](this));ami['on'](_0x4388('0x26'),this[_0x4388('0x27')][_0x4388('0x17')](this));ami['on']('musiconholdstart',this[_0x4388('0x28')][_0x4388('0x17')](this));ami['on'](_0x4388('0x29'),this[_0x4388('0x2a')][_0x4388('0x17')](this));ami['on'](_0x4388('0x2b'),this[_0x4388('0x2c')][_0x4388('0x17')](this));ami['on'](_0x4388('0x2d'),this['syncBlindTransfer']['bind'](this));this[_0x4388('0x2e')]();this['loopQueueShow']();}function clearChannels(_0x4610bd){if(!_[_0x4388('0x2f')](_0x4610bd)){for(var _0x497ecb in _0x4610bd){if(_0x4610bd[_0x4388('0x30')](_0x497ecb)){delete _0x4610bd[_0x497ecb];}}}}function clearCampaigns(_0x45913b){if(!_[_0x4388('0x2f')](_0x45913b)){for(var _0x3eea06 in _0x45913b){if(_0x45913b[_0x4388('0x30')](_0x3eea06)){_0x45913b[_0x3eea06][_0x4388('0x31')]=0x0;}}}}function clearVoiceQueues(_0x4f6405){if(!_[_0x4388('0x2f')](_0x4f6405)){for(var _0x1b5eaf in _0x4f6405){if(_0x4f6405['hasOwnProperty'](_0x1b5eaf)){_0x4f6405[_0x1b5eaf][_0x4388('0x31')]=0x0;_0x4f6405[_0x1b5eaf][_0x4388('0x32')]=0x0;_0x4f6405[_0x1b5eaf]['pTalking']=0x0;_0x4f6405[_0x1b5eaf][_0x4388('0x33')]=0x0;_0x4f6405[_0x1b5eaf][_0x4388('0x34')]=!![];}}}}function clearAgentBooked(_0xfc60f3){if(!_['isEmpty'](_0xfc60f3)){for(var _0x5d070a in _0xfc60f3){if(_0xfc60f3[_0x4388('0x30')](_0x5d070a)){_0xfc60f3[_0x5d070a][_0x4388('0x35')]=!![];}}}}VoiceQueueReport[_0x4388('0xb')][_0x4388('0x36')]=function(){var _0x4e99be=this;for(var _0x29f9cb in this[_0x4388('0x10')]){if(this[_0x4388('0x10')]['hasOwnProperty'](_0x29f9cb)&&!this['channels'][_0x29f9cb]['switch']){this['sequence'][_0x4388('0x37')](function(){if(!_[_0x4388('0x38')](_0x4e99be[_0x4388('0x10')][_0x29f9cb])){return ami[_0x4388('0x39')]({'action':_0x4388('0x3a'),'channel':_0x4e99be['channels'][_0x29f9cb]['channel']})[_0x4388('0x3b')](function(_0x27168c){if(_0x27168c[_0x4388('0x3c')]===_0x4388('0x3d')){setTimeout(function(){if(_0x4e99be[_0x4388('0x10')][_0x29f9cb]){delete _0x4e99be[_0x4388('0x10')][_0x29f9cb];logger[_0x4388('0x3e')](_0x4388('0x3f'),_0x29f9cb,util[_0x4388('0x40')](_0x27168c,{'showHidden':![],'depth':null}));}if(_0x4e99be[_0x4388('0xe')][_0x29f9cb]){delete _0x4e99be[_0x4388('0xe')][_0x29f9cb];logger[_0x4388('0x3e')](_0x4388('0x41'),_0x29f9cb,util[_0x4388('0x40')](_0x27168c,{'showHidden':![],'depth':null}));}if(_0x4e99be[_0x4388('0x14')][_0x29f9cb]){delete _0x4e99be[_0x4388('0x14')][_0x29f9cb];logger[_0x4388('0x3e')](_0x4388('0x42'),_0x29f9cb,util[_0x4388('0x40')](_0x27168c,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x27')]=function(){logger['error']('[FullyBooted]\x20clear\x20realtime');clearChannels(this['channels']);this[_0x4388('0x43')](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x4388('0x12')]);clearCampaigns(this[_0x4388('0x13')]);};VoiceQueueReport[_0x4388('0xb')]['clearQueueReport']=function(_0x59c500){var _0xb54214=this;if(!_[_0x4388('0x2f')](_0x59c500)){for(var _0xfbdadb in _0x59c500){if(_0x59c500[_0x4388('0x30')](_0xfbdadb)){_0xb54214[_0x4388('0x44')](_0x59c500[_0xfbdadb],_0x4388('0x45'));delete _0x59c500[_0xfbdadb];}}}};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x46')]=function(_0x4886fe,_0x50cd28,_0x4f75b7){io['to'](_0x4886fe)[_0x4388('0x46')](_0x50cd28,_0x4f75b7);};VoiceQueueReport[_0x4388('0xb')]['emitVoiceQueueChannelSave']=function(_0x43b09a,_0x43382e){logger[_0x4388('0x47')]('[%s][voiceQueueReport]['+_0x43382e+_0x4388('0x48'),_0x43b09a['uniqueid'],util[_0x4388('0x40')](_0x43b09a,{'showHidden':![],'depth':null}));this[_0x4388('0x46')](util[_0x4388('0x49')](_0x4388('0x4a'),_0x43b09a[_0x4388('0x4b')]),_0x4388('0x4c'),_0x43b09a);io['emit'](_0x4388('0x4d'),_0x43b09a);};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x44')]=function(_0x53893e,_0x13d46f){logger[_0x4388('0x47')]('[%s][voiceQueueReport]['+_0x13d46f+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x53893e['uniqueid'],util[_0x4388('0x40')](_0x53893e,{'showHidden':![],'depth':null}));if(_0x53893e[_0x4388('0x4e')]===_0x4388('0x4f'))return;this[_0x4388('0x46')](util[_0x4388('0x49')](_0x4388('0x4a'),_0x53893e[_0x4388('0x4b')]),_0x4388('0x50'),_0x53893e);io['emit']('voice_queue_presence:remove',_0x53893e);};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x51')]=function(_0x56ab39,_0x3d6292){if(_0x56ab39[_0x4388('0x52')]==='inbound'){var _0x1e38eb={'id':_0x56ab39['id'],'name':_0x56ab39[_0x4388('0x4b')],'strategy':_0x56ab39[_0x4388('0x53')],'answered':_0x56ab39[_0x4388('0x54')],'available':_0x56ab39[_0x4388('0x55')],'loggedIn':_0x56ab39[_0x4388('0x56')],'pTalking':_0x56ab39[_0x4388('0x57')],'sumBillable':_0x56ab39['sumBillable'],'sumDuration':_0x56ab39['sumDuration'],'sumHoldTime':_0x56ab39[_0x4388('0x58')]||0x0,'talking':_0x56ab39[_0x4388('0x32')],'total':_0x56ab39['total'],'type':_0x56ab39['type'],'unmanaged':_0x56ab39[_0x4388('0x59')],'abandoned':_0x56ab39['abandoned'],'waiting':_0x56ab39[_0x4388('0x33')]};if(_0x56ab39[_0x4388('0x5a')]){_0x1e38eb[_0x4388('0x5a')]={'id':_0x56ab39['Trunk']['id'],'name':_0x56ab39[_0x4388('0x5a')][_0x4388('0x4b')],'active':_0x56ab39[_0x4388('0x5a')][_0x4388('0x5b')],'callerid':_0x56ab39['Trunk'][_0x4388('0x5c')]};}if(_0x56ab39[_0x4388('0x5d')]){_0x1e38eb[_0x4388('0x5d')]={'id':_0x56ab39[_0x4388('0x5d')]['id'],'name':_0x56ab39[_0x4388('0x5d')][_0x4388('0x4b')]};}var _0x5dfb29=md5(JSON[_0x4388('0x5e')](_0x1e38eb));if(_0x56ab39[_0x4388('0x3')]!==_0x5dfb29){_0x56ab39[_0x4388('0x3')]=_0x5dfb29;logger[_0x4388('0x47')](_0x4388('0x5f')+_0x3d6292+_0x4388('0x60'),util[_0x4388('0x40')](_0x1e38eb,{'showHidden':![],'depth':null}));this[_0x4388('0x46')](util[_0x4388('0x49')](_0x4388('0x4a'),_0x1e38eb[_0x4388('0x4b')]),_0x4388('0x61'),_0x1e38eb);}}};VoiceQueueReport[_0x4388('0xb')]['isNotNull']=function(_0x58b187){return _0x58b187!==null&&!_['isUndefined'](_0x58b187);};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x62')]=function(){var _0x33d3bf=this;setInterval(function(){_0x33d3bf['clearZombieChannels']();ami[_0x4388('0x39')]({'action':'queues'})[_0x4388('0x3b')](function(_0x131a94){logger['error'](_0x4388('0x63'),util[_0x4388('0x40')](_0x131a94,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x2e')]=function(){var _0x59773b=this;setInterval(function(){if(_0x59773b[_0x4388('0x64')]){return ami['Action']({'action':_0x4388('0x15')})['then'](function(){_0x59773b[_0x4388('0x64')]=![];})[_0x4388('0x3b')](function(_0x5b5315){logger['error']('[voiceQueueReport][queuesummary]',util[_0x4388('0x40')](_0x5b5315,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x16')]=function(_0x561b6b){try{if(this['isNotNull'](_0x561b6b)&&this[_0x4388('0x65')](_0x561b6b['queue'])){logger[_0x4388('0x47')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x4388('0x40')](_0x561b6b,{'showHidden':![],'depth':null}));if(this[_0x4388('0x12')][_0x561b6b[_0x4388('0x66')]]){logger[_0x4388('0x67')](_0x4388('0x68'),_0x561b6b[_0x4388('0x66')]);var _0x555615=_[_0x4388('0x69')](this[_0x4388('0x10')],_0x4388('0x66'))[_0x561b6b[_0x4388('0x66')]]||0x0;var _0x5bba10=_0x555615-_0x561b6b[_0x4388('0x6a')];if(this['voiceQueues'][_0x561b6b[_0x4388('0x66')]][_0x4388('0x33')]!==_[_0x4388('0x6b')](_0x561b6b['callers'])||this['voiceQueues'][_0x561b6b[_0x4388('0x66')]]['loggedIn']!==_['toNumber'](_0x561b6b[_0x4388('0x6c')])||this[_0x4388('0x12')][_0x561b6b['queue']][_0x4388('0x55')]!==_[_0x4388('0x6b')](_0x561b6b[_0x4388('0x55')])||this[_0x4388('0x12')][_0x561b6b[_0x4388('0x66')]]['talking']!==_0x5bba10){this[_0x4388('0x12')][_0x561b6b[_0x4388('0x66')]][_0x4388('0x33')]=_[_0x4388('0x6b')](_0x561b6b[_0x4388('0x6a')]);this[_0x4388('0x12')][_0x561b6b[_0x4388('0x66')]][_0x4388('0x56')]=_[_0x4388('0x6b')](_0x561b6b['loggedin']);this['voiceQueues'][_0x561b6b[_0x4388('0x66')]][_0x4388('0x55')]=_[_0x4388('0x6b')](_0x561b6b['available']);this[_0x4388('0x12')][_0x561b6b['queue']]['talking']=_0x5bba10>0x0?_0x5bba10:0x0;this[_0x4388('0x12')][_0x561b6b['queue']][_0x4388('0x32')]=this['voiceQueues'][_0x561b6b[_0x4388('0x66')]][_0x4388('0x32')]>_['toNumber'](_0x561b6b[_0x4388('0x6c')])?_['toNumber'](_0x561b6b[_0x4388('0x6c')]):this[_0x4388('0x12')][_0x561b6b[_0x4388('0x66')]][_0x4388('0x32')];this[_0x4388('0x51')](this['voiceQueues'][_0x561b6b[_0x4388('0x66')]],_0x4388('0x15'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x4388('0x40')](this[_0x4388('0x12')][_0x561b6b['queue']],{'showHidden':![],'depth':null}));ami[_0x4388('0x46')](_0x4388('0x6d'),this[_0x4388('0x12')][_0x561b6b['queue']]);}}}catch(_0x53a850){logger[_0x4388('0x3e')]('[voiceQueueReport][queuesummary]',util[_0x4388('0x40')](_0x53a850,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4388('0xb')]['syncQueueSummaryComplete']=function(_0x7ea6f6){logger[_0x4388('0x47')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x4388('0x40')](_0x7ea6f6,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x6e')]=function(_0x30e8cb){try{if(this[_0x4388('0x65')](_0x30e8cb)){logger[_0x4388('0x47')](_0x4388('0x6f'),_0x30e8cb['uniqueid'],util[_0x4388('0x40')](_0x30e8cb,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x4388('0xe')][_0x30e8cb['uniqueid']]))this[_0x4388('0xe')][_0x30e8cb[_0x4388('0x70')]]=[];if(_[_0x4388('0x71')](this[_0x4388('0x10')][_0x30e8cb['uniqueid']]))this['channels'][_0x30e8cb[_0x4388('0x70')]]={};var _0x1ca436=new QueueReport();_0x1ca436[_0x4388('0x4b')]=_0x30e8cb['queue'];_0x1ca436[_0x4388('0x52')]=this[_0x4388('0x12')][_0x1ca436[_0x4388('0x4b')]]&&this[_0x4388('0x12')][_0x1ca436[_0x4388('0x4b')]]['type']?this[_0x4388('0x12')][_0x1ca436['name']][_0x4388('0x52')]||_0x4388('0x72'):'inbound';_0x1ca436[_0x4388('0x66')]=_0x30e8cb[_0x4388('0x66')];_0x1ca436[_0x4388('0x73')]=moment()[_0x4388('0x49')](_0x4388('0x74'));_0x1ca436['position']=_0x30e8cb[_0x4388('0x75')];_0x1ca436['count']=_0x30e8cb[_0x4388('0x76')];_0x1ca436['uniqueid']=_0x30e8cb['uniqueid'];_0x1ca436[_0x4388('0x77')]=this[_0x4388('0x10')][_0x30e8cb[_0x4388('0x70')]][_0x4388('0x77')];logger[_0x4388('0x67')](_0x4388('0x78'),_0x1ca436[_0x4388('0x4b')],_0x1ca436[_0x4388('0x52')]);_[_0x4388('0x79')](_0x1ca436,_[_0x4388('0x7a')](_0x30e8cb,_['keys'](_0x1ca436)));this[_0x4388('0xe')][_0x30e8cb['uniqueid']]['push'](_0x1ca436);this[_0x4388('0x10')][_0x30e8cb[_0x4388('0x70')]]=_0x1ca436;this[_0x4388('0x7b')](_0x1ca436,_0x4388('0x1a'));}}catch(_0x4d663d){logger[_0x4388('0x3e')](_0x4388('0x6f'),_0x30e8cb[_0x4388('0x70')],util['inspect'](_0x4d663d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4388('0xb')]['syncQueueCallerAbandon']=function(_0x1b7138){try{if(this['isNotNull'](_0x1b7138)){logger[_0x4388('0x47')](_0x4388('0x7c'),_0x1b7138[_0x4388('0x70')],util[_0x4388('0x40')](_0x1b7138,{'showHidden':![],'depth':null}));if(this[_0x4388('0xe')][_0x1b7138[_0x4388('0x70')]]){var _0x4044e4=_[_0x4388('0x7d')](this['queueReports'][_0x1b7138[_0x4388('0x70')]]);_0x4044e4['queuecallercomplete']=![];_0x4044e4[_0x4388('0x7e')]=null;_0x4044e4[_0x4388('0x7f')]=_0x1b7138[_0x4388('0x7f')];_0x4044e4[_0x4388('0x80')]=_0x1b7138[_0x4388('0x80')];_0x4044e4[_0x4388('0x1b')]=!![];_0x4044e4[_0x4388('0x81')]=moment()[_0x4388('0x49')](_0x4388('0x74'));_0x4044e4[_0x4388('0x4e')]=_0x4388('0x82');_0x4044e4[_0x4388('0x83')]=null;logger[_0x4388('0x67')](_0x4388('0x84'),_0x4044e4['name'],_0x4044e4[_0x4388('0x52')]);this['channels'][_0x1b7138[_0x4388('0x70')]]=_0x4044e4;this['emitVoiceQueueChannelRemove'](_0x4044e4,_0x4388('0x1b'));}}}catch(_0x3f4152){logger[_0x4388('0x3e')](_0x4388('0x7c'),_0x1b7138['uniqueid'],util[_0x4388('0x40')](_0x3f4152,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x1d')]=function(_0x2e1da6){try{if(this['isNotNull'](_0x2e1da6)){logger[_0x4388('0x47')](_0x4388('0x85'),_0x2e1da6[_0x4388('0x70')],util['inspect'](_0x2e1da6,{'showHidden':![],'depth':null}));if(this[_0x4388('0xe')][_0x2e1da6['uniqueid']]){var _0x2129bf=_['last'](this['queueReports'][_0x2e1da6[_0x4388('0x70')]]);_0x2129bf[_0x4388('0x86')]=moment()[_0x4388('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x2129bf['connectedlinenum']=_0x2e1da6[_0x4388('0x87')];_0x2129bf[_0x4388('0x88')]=_0x2e1da6[_0x4388('0x88')];logger[_0x4388('0x67')](_0x4388('0x89'),_0x2129bf['name'],_0x2129bf[_0x4388('0x52')],_0x2e1da6['connectedlinenum'],_0x2e1da6[_0x4388('0x88')]);this[_0x4388('0x10')][_0x2e1da6[_0x4388('0x70')]]=_0x2129bf;this[_0x4388('0x7b')](_0x2129bf,_0x4388('0x1c'));}}}catch(_0x16ea2a){logger[_0x4388('0x3e')]('[%s][voiceQueueReport][queuecallerleave]',_0x2e1da6[_0x4388('0x70')],util[_0x4388('0x40')](_0x16ea2a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x21')]=function(_0x19e616){try{if(this[_0x4388('0x65')](_0x19e616)){logger[_0x4388('0x47')](_0x4388('0x8a'),_0x19e616[_0x4388('0x70')],util['inspect'](_0x19e616,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x19e616[_0x4388('0x70')]]){var _0x1a8197=_[_0x4388('0x7d')](this[_0x4388('0xe')][_0x19e616[_0x4388('0x70')]]);_0x1a8197['queuecallercomplete']=!![];_0x1a8197['queuecallerexitreason']=_0x4388('0x8b');logger[_0x4388('0x67')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x1a8197[_0x4388('0x4b')],_0x1a8197[_0x4388('0x52')]);}}}catch(_0x3b79dd){logger[_0x4388('0x3e')](_0x4388('0x8a'),_0x19e616[_0x4388('0x70')],util['inspect'](_0x3b79dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x1f')]=function(_0x43a603){try{if(this['isNotNull'](_0x43a603)){logger[_0x4388('0x47')](_0x4388('0x8c'),_0x43a603[_0x4388('0x70')],util[_0x4388('0x40')](_0x43a603,{'showHidden':![],'depth':null}));if(this[_0x4388('0xe')][_0x43a603['uniqueid']]){var _0x15bf93=_[_0x4388('0x7d')](this[_0x4388('0xe')][_0x43a603[_0x4388('0x70')]]);_0x15bf93[_0x4388('0x1b')]=![];_0x15bf93[_0x4388('0x81')]=null;_0x15bf93['assigned']=!![];_0x15bf93[_0x4388('0x83')]=_0x43a603[_0x4388('0x8d')];_0x15bf93[_0x4388('0x7f')]=_0x43a603[_0x4388('0x7f')];_0x15bf93[_0x4388('0x8e')]=!![];_0x15bf93[_0x4388('0x8f')]=![];_0x15bf93[_0x4388('0x90')]=null;if(!_0x15bf93[_0x4388('0x91')]){if(_0x43a603['reason']==_0x4388('0x91')){_0x15bf93[_0x4388('0x4e')]=_0x4388('0x92');logger[_0x4388('0x67')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x15bf93['name'],_0x15bf93['type']);}else{if(_[_0x4388('0x93')](_0x43a603[_0x4388('0x94')][_0x4388('0x95')](),_0x4388('0x96'))){if(this['queueReports'][_0x43a603['linkedid']]){var _0x46e933=_[_0x4388('0x7d')](this['queueReports'][_0x43a603[_0x4388('0x97')]]);_0x46e933['queuecallercomplete']=![];_0x46e933[_0x4388('0x8f')]=!![];_0x46e933[_0x4388('0x90')]=moment(_0x15bf93[_0x4388('0x73')])[_0x4388('0x98')](_0x43a603[_0x4388('0x7f')],_0x4388('0x99'))[_0x4388('0x49')](_0x4388('0x74'));_0x46e933[_0x4388('0x4e')]=_0x4388('0x9a');_0x46e933[_0x4388('0x91')]=!![];_0x46e933[_0x4388('0x9b')]=_0x4388('0x9c');_0x46e933[_0x4388('0x9d')]=_0x43a603[_0x4388('0x9e')];_0x46e933['transferuniqueid']=_0x43a603[_0x4388('0x70')];logger[_0x4388('0x67')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x46e933['name'],_0x46e933['type']);var _0x2e6885=this[_0x4388('0xe')][_0x43a603['linkedid']];this['queueReports'][_0x43a603[_0x4388('0x97')]]=this[_0x4388('0xe')][_0x43a603['uniqueid']];this[_0x4388('0xe')][_0x43a603[_0x4388('0x70')]]=_0x2e6885;}}else{_0x15bf93[_0x4388('0x4e')]=_0x4388('0x9f')+_0x43a603[_0x4388('0xa0')][_0x4388('0xa1')]();logger[_0x4388('0x67')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x15bf93[_0x4388('0x4b')],_0x15bf93[_0x4388('0x52')],_0x15bf93['queuecallerexitreason']);}}}this[_0x4388('0x10')][_0x43a603[_0x4388('0x70')]]=_0x15bf93;this['emitVoiceQueueChannelRemove'](_0x15bf93,'agentcomplete');}}}catch(_0x8ced54){logger[_0x4388('0x3e')](_0x4388('0x8c'),_0x43a603['uniqueid'],util[_0x4388('0x40')](_0x8ced54,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x23')]=function(_0x580403){try{if(this[_0x4388('0x65')](_0x580403)){logger[_0x4388('0x47')](_0x4388('0xa2'),_0x580403[_0x4388('0x70')],util[_0x4388('0x40')](_0x580403,{'showHidden':![],'depth':null}));this[_0x4388('0xa3')](_0x580403[_0x4388('0x70')],_[_0x4388('0xa4')](_0x580403['variable'])[0x0],_0x580403[_0x4388('0xa5')]);if(this[_0x4388('0xe')][_0x580403[_0x4388('0x70')]]){var _0x2539e2=_[_0x4388('0x7d')](this[_0x4388('0xe')][_0x580403[_0x4388('0x70')]]);if(_0x2539e2){if(this[_0x4388('0x65')](_0x580403[_0x4388('0xa6')])&&this['isNotNull'](_0x580403[_0x4388('0xa6')][_0x4388('0xa7')])){switch(_0x580403[_0x4388('0xa5')]){case _0x4388('0xa8'):_0x2539e2[_0x4388('0x8f')]=![];_0x2539e2[_0x4388('0x90')]=null;break;case _0x4388('0xa9'):_0x2539e2[_0x4388('0xaa')]=_0x4388('0xab');_0x2539e2[_0x4388('0x8f')]=!![];_0x2539e2['queuecallerexitAt']=moment()['format'](_0x4388('0x74'));_0x2539e2[_0x4388('0x86')]=moment()[_0x4388('0x49')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x4388('0xac'),_0x580403[_0x4388('0x70')],util[_0x4388('0x40')](_0x2539e2,{'showHidden':![],'depth':null}));ami[_0x4388('0x46')](_0x4388('0xad'),_0x2539e2);break;default:_0x2539e2[_0x4388('0x8f')]=!![];_0x2539e2[_0x4388('0x90')]=moment()[_0x4388('0x49')](_0x4388('0x74'));_0x2539e2[_0x4388('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2539e2[_0x4388('0x1b')]=![];_0x2539e2[_0x4388('0x81')]=null;_0x2539e2[_0x4388('0x4e')]=_0x580403[_0x4388('0xa5')];this[_0x4388('0x10')][_0x580403['uniqueid']]=_0x2539e2;this[_0x4388('0x44')](_0x2539e2,'varset');}else if(this[_0x4388('0x65')](_0x580403[_0x4388('0xa6')])&&this[_0x4388('0x65')](_0x580403[_0x4388('0xa6')]['queueposition'])){if(!_0x2539e2[_0x4388('0x1b')]){_0x2539e2['queuecallerexit']=!![];_0x2539e2[_0x4388('0x90')]=moment()[_0x4388('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x2539e2['queuecallerexitreason']='EXITWITHKEY';_0x2539e2[_0x4388('0x86')]=moment()[_0x4388('0x49')](_0x4388('0x74'));this[_0x4388('0x10')][_0x580403[_0x4388('0x70')]]=_0x2539e2;}}logger[_0x4388('0x67')](_0x4388('0xae'),_0x580403['uniqueid'],_0x2539e2['name'],_0x2539e2[_0x4388('0x52')],_[_0x4388('0xa4')](_0x580403['variable'])[0x0],_0x580403['value']);_0x2539e2[_0x4388('0x14')]=this[_0x4388('0x14')][_0x580403[_0x4388('0x70')]];}}}}catch(_0x192538){logger[_0x4388('0x3e')](_0x4388('0xa2'),_0x580403['uniqueid'],util[_0x4388('0x40')](_0x192538,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4388('0xb')][_0x4388('0xa3')]=function(_0x83e244,_0x3d9981,_0x5d70f3){var _0x3d5f30=['rtpaudioqos',_0x4388('0xaf'),_0x4388('0xb0'),_0x4388('0xb1'),_0x4388('0xb2'),_0x4388('0xb3'),_0x4388('0xb4'),_0x4388('0xb5'),_0x4388('0xb6'),'sipuri',_0x4388('0xb7'),_0x4388('0xb8'),'membercalls','memberdynamic',_0x4388('0xb9'),_0x4388('0xba'),_0x4388('0x8d'),'memberpenalty',_0x4388('0xbb')];if(!_[_0x4388('0x38')](_0x3d9981)&&!_['includes'](_0x3d5f30,_0x3d9981)){if(_[_0x4388('0x71')](this[_0x4388('0x14')][_0x83e244])){this[_0x4388('0x14')][_0x83e244]={};}this[_0x4388('0x14')][_0x83e244][_0x3d9981]=_0x5d70f3;}};VoiceQueueReport['prototype'][_0x4388('0x25')]=function(_0x135651){try{if(this[_0x4388('0x65')](_0x135651)){logger['debug'](_0x4388('0xbc'),_0x135651['uniqueid'],util[_0x4388('0x40')](_0x135651,{'showHidden':![],'depth':null}));if(this[_0x4388('0xe')][_0x135651[_0x4388('0x70')]]){for(var _0x39de85=0x0,_0x3c7610={};_0x39de85<this[_0x4388('0xe')][_0x135651[_0x4388('0x70')]]['length'];_0x39de85+=0x1){_0x3c7610=this[_0x4388('0xe')][_0x135651[_0x4388('0x70')]][_0x39de85];if(this['voiceQueues'][_0x3c7610[_0x4388('0x66')]]){if(_0x3c7610[_0x4388('0x8f')]&&_0x3c7610[_0x4388('0x91')]!=!![]){this['voiceQueues'][_0x3c7610['queue']]['unmanaged']+=0x1;}if(_0x3c7610['queuecallerabandon']){this[_0x4388('0x12')][_0x3c7610['queue']]['abandoned']+=0x1;}this[_0x4388('0x12')][_0x3c7610[_0x4388('0x66')]]['sumHoldTime']+=moment(_0x3c7610[_0x4388('0x86')])['diff'](_0x3c7610[_0x4388('0x73')],_0x4388('0x99'))||0x0;if(_0x39de85===this[_0x4388('0xe')][_0x135651['uniqueid']][_0x4388('0xbd')]-0x1){this[_0x4388('0x12')][_0x3c7610[_0x4388('0x66')]]['sumDuration']+=moment()['milliseconds'](0x0)[_0x4388('0xbe')](_0x3c7610[_0x4388('0x73')],'seconds');this[_0x4388('0x12')][_0x3c7610[_0x4388('0x66')]][_0x4388('0xbf')]+=0x1;if(_0x3c7610['queuecallercomplete']){this['voiceQueues'][_0x3c7610[_0x4388('0x66')]][_0x4388('0x54')]+=0x1;this[_0x4388('0x12')][_0x3c7610[_0x4388('0x66')]][_0x4388('0xc0')]+=moment()[_0x4388('0xc1')](0x0)['diff'](_0x3c7610['queuecallerleaveAt'],_0x4388('0x99'));_0x3c7610[_0x4388('0x7e')]=moment()[_0x4388('0x49')](_0x4388('0x74'));_0x3c7610[_0x4388('0x8f')]=![];_0x3c7610[_0x4388('0x90')]=null;}if(_0x3c7610[_0x4388('0x8f')]&&_0x3c7610[_0x4388('0x91')]!=!![]){_0x3c7610[_0x4388('0xaa')]=_0x4388('0x59');logger[_0x4388('0x47')](_0x4388('0xc2'),_0x135651[_0x4388('0x70')],util[_0x4388('0x40')](_0x3c7610,{'showHidden':![],'depth':null}));ami['emit'](_0x4388('0xc3'),_0x3c7610);}if(_0x3c7610[_0x4388('0x1b')]){_0x3c7610[_0x4388('0xaa')]=_0x4388('0xc4');logger[_0x4388('0x47')](_0x4388('0xc5'),_0x135651['uniqueid'],util[_0x4388('0x40')](_0x3c7610,{'showHidden':![],'depth':null}));ami[_0x4388('0x46')](_0x4388('0xc6'),_0x3c7610);}}else{this['voiceQueues'][_0x3c7610[_0x4388('0x66')]][_0x4388('0xc7')]+=this[_0x4388('0x12')][_0x3c7610[_0x4388('0x66')]][_0x4388('0x58')];}logger['info']('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x135651[_0x4388('0x70')],_0x3c7610[_0x4388('0x4b')],_0x3c7610[_0x4388('0x52')],_0x135651[_0x4388('0xc8')]);this[_0x4388('0x10')][_0x135651['uniqueid']]=_0x3c7610;this[_0x4388('0x44')](_0x3c7610,_0x4388('0x24'));this[_0x4388('0x51')](this[_0x4388('0x12')][_0x3c7610[_0x4388('0x66')]],_0x4388('0x24'));}}logger[_0x4388('0x47')](_0x4388('0xc9'),_0x135651[_0x4388('0x70')],util['inspect'](this['queueReports'][_0x135651[_0x4388('0x70')]],{'showHidden':![],'depth':null}));ami[_0x4388('0x46')](_0x4388('0xca'),this[_0x4388('0xe')][_0x135651[_0x4388('0x70')]]);if(_0x3c7610[_0x4388('0x4e')]==='ATTENDEDTRANSFER')return;delete this[_0x4388('0xe')][_0x135651[_0x4388('0x70')]];delete this[_0x4388('0x10')][_0x135651['uniqueid']];}if(this['variables'][_0x135651[_0x4388('0x70')]]){delete this[_0x4388('0x14')][_0x135651[_0x4388('0x70')]];}}}catch(_0x467999){logger[_0x4388('0x3e')]('[%s][voiceQueueReport][hangup]',_0x135651[_0x4388('0x70')],util['inspect'](_0x467999,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4388('0x2c')]=function(_0x2549ee){try{if(this['isNotNull'](_0x2549ee)){logger['debug']('[%s][voiceQueueReport][attendedtransfer]',_0x2549ee[_0x4388('0x70')],util[_0x4388('0x40')](_0x2549ee,{'showHidden':![],'depth':null}));var _0x30e4fe;var _0x51dce1;var _0x59f746;if(this[_0x4388('0xe')][_0x2549ee[_0x4388('0xcb')]]){_0x30e4fe=_[_0x4388('0x7d')](this[_0x4388('0xe')][_0x2549ee['transfereeuniqueid']]);_0x30e4fe['transferexten']=_0x2549ee[_0x4388('0xcc')];_0x30e4fe[_0x4388('0xcd')]=_0x2549ee[_0x4388('0xce')];_0x30e4fe[_0x4388('0x4e')]='ATTENDEDTRANSFER';_0x30e4fe[_0x4388('0x91')]=!![];_0x30e4fe[_0x4388('0x9b')]='ATTENDED';if(this['queueReports'][_0x2549ee[_0x4388('0xce')]]){_0x59f746=this[_0x4388('0xe')][_0x2549ee[_0x4388('0xce')]];this['queueReports'][_0x2549ee[_0x4388('0xce')]]=this[_0x4388('0xe')][_0x2549ee['transfereeuniqueid']];this['queueReports'][_0x2549ee[_0x4388('0xcb')]]=_0x59f746;_0x51dce1=_[_0x4388('0x7d')](this[_0x4388('0xe')][_0x2549ee[_0x4388('0xcb')]]);_0x51dce1[_0x4388('0xcf')]=!![];}logger[_0x4388('0x67')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x2549ee[_0x4388('0x70')],_0x30e4fe['name'],_0x30e4fe['type'],_0x30e4fe['transferexten'],_0x30e4fe[_0x4388('0xcd')]);}else if(this['queueReports'][_0x2549ee['transfertargetuniqueid']]){_0x30e4fe=_[_0x4388('0x7d')](this['queueReports'][_0x2549ee[_0x4388('0xd0')]]);_0x30e4fe[_0x4388('0x9d')]=_0x2549ee[_0x4388('0xd1')];_0x30e4fe[_0x4388('0xcd')]=_0x2549ee[_0x4388('0xd2')];_0x30e4fe[_0x4388('0x4e')]=_0x4388('0x4f');_0x30e4fe[_0x4388('0x91')]=!![];_0x30e4fe[_0x4388('0x9b')]=_0x4388('0xd3');if(this[_0x4388('0xe')][_0x2549ee[_0x4388('0xd2')]]){_0x59f746=this['queueReports'][_0x2549ee[_0x4388('0xd2')]];this[_0x4388('0xe')][_0x2549ee[_0x4388('0xd2')]]=this['queueReports'][_0x2549ee[_0x4388('0xd0')]];this['queueReports'][_0x2549ee[_0x4388('0xd0')]]=_0x59f746;_0x51dce1=_['last'](this['queueReports'][_0x2549ee[_0x4388('0xd0')]]);_0x51dce1['switch']=!![];}logger[_0x4388('0x67')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x2549ee[_0x4388('0x70')],_0x30e4fe[_0x4388('0x4b')],_0x30e4fe[_0x4388('0x52')],_0x30e4fe[_0x4388('0x9d')],_0x30e4fe['transferuniqueid']);}else if(this[_0x4388('0xe')][_0x2549ee[_0x4388('0xd2')]]){_0x30e4fe=_[_0x4388('0x7d')](this[_0x4388('0xe')][_0x2549ee[_0x4388('0xd2')]]);_0x30e4fe[_0x4388('0x9d')]=_0x2549ee['origtransfererexten'];_0x30e4fe['transferuniqueid']=_0x2549ee['origtransfereruniqueid'];_0x30e4fe[_0x4388('0x4e')]=_0x4388('0x4f');_0x30e4fe[_0x4388('0x91')]=!![];_0x30e4fe[_0x4388('0x9b')]=_0x4388('0xd3');}else if(this['queueReports'][_0x2549ee[_0x4388('0xce')]]){_0x30e4fe=_['last'](this[_0x4388('0xe')][_0x2549ee[_0x4388('0xce')]]);_0x30e4fe[_0x4388('0x9d')]=_0x2549ee['secondtransfererexten'];_0x30e4fe[_0x4388('0xcd')]=_0x2549ee[_0x4388('0xce')];_0x30e4fe[_0x4388('0x4e')]=_0x4388('0x4f');_0x30e4fe[_0x4388('0x91')]=!![];_0x30e4fe[_0x4388('0x9b')]='ATTENDED';}}}catch(_0x43abcf){logger[_0x4388('0x3e')](_0x4388('0xd4'),_0x2549ee[_0x4388('0x70')],util[_0x4388('0x40')](_0x43abcf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4388('0xb')]['syncBlindTransfer']=function(_0x21c54d){try{if(this[_0x4388('0x65')](_0x21c54d)){logger[_0x4388('0x47')]('[%s][voiceQueueReport][blindtransfer]',_0x21c54d[_0x4388('0x70')],util[_0x4388('0x40')](_0x21c54d,{'showHidden':![],'depth':null}));if(this[_0x4388('0xe')][_0x21c54d[_0x4388('0xcb')]]){var _0xa652d1=_[_0x4388('0x7d')](this[_0x4388('0xe')][_0x21c54d[_0x4388('0xcb')]]);_0xa652d1[_0x4388('0x4e')]=_0x4388('0xd5');_0xa652d1[_0x4388('0x91')]=!![];_0xa652d1[_0x4388('0x9b')]=_0x4388('0xd6');_0xa652d1['transferexten']=_0x21c54d['extension'];_0xa652d1['transferuniqueid']=_0x21c54d[_0x4388('0xcb')];logger[_0x4388('0x67')](_0x4388('0xd7'),_0x21c54d[_0x4388('0x70')],_0xa652d1[_0x4388('0x4b')],_0xa652d1[_0x4388('0x52')],_0xa652d1[_0x4388('0x9d')],_0xa652d1[_0x4388('0xcd')]);this['syncHangup']({'event':_0x4388('0xd8'),'uniqueid':_0x21c54d[_0x4388('0xcb')],'context':_0x21c54d[_0x4388('0xd9')],'channel':_0x21c54d[_0x4388('0xda')]});}}}catch(_0x14b064){logger['error']('[%s][voiceQueueReport][blindtransfer]',_0x21c54d['uniqueid'],util[_0x4388('0x40')](_0x14b064,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4388('0xb')][_0x4388('0x28')]=function(_0x148536){try{if(this[_0x4388('0x65')](_0x148536)){logger[_0x4388('0x47')](_0x4388('0xdb'),_0x148536[_0x4388('0x70')],util[_0x4388('0x40')](_0x148536,{'showHidden':![],'depth':null}));if(this[_0x4388('0xe')][_0x148536[_0x4388('0x70')]]){var _0x5311ef=_[_0x4388('0x7d')](this[_0x4388('0xe')][_0x148536[_0x4388('0x70')]]);if(!_[_0x4388('0x38')](_0x5311ef[_0x4388('0x86')])){_0x5311ef[_0x4388('0xdc')]=moment()[_0x4388('0x49')](_0x4388('0x74'));logger[_0x4388('0x67')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x148536[_0x4388('0x70')],_0x5311ef['mohstarttime']);}}}}catch(_0xfa1846){logger[_0x4388('0x3e')]('[%s][voiceQueueReport][musiconholdstart]',_0x148536[_0x4388('0x70')],util['inspect'](_0xfa1846,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4388('0x2a')]=function(_0x191696){try{if(this[_0x4388('0x65')](_0x191696)){logger['debug']('[%s][voiceQueueReport][musiconholdstop]',_0x191696['uniqueid'],util[_0x4388('0x40')](_0x191696,{'showHidden':![],'depth':null}));if(this[_0x4388('0xe')][_0x191696[_0x4388('0x70')]]){var _0x29e73c=_[_0x4388('0x7d')](this[_0x4388('0xe')][_0x191696[_0x4388('0x70')]]);if(!_[_0x4388('0x38')](_0x29e73c['mohstarttime'])){_0x29e73c['mohtime']+=moment()['milliseconds'](0x0)['diff'](_0x29e73c['mohstarttime'],_0x4388('0x99'));logger[_0x4388('0x67')](_0x4388('0xdd'),_0x191696[_0x4388('0x70')],_0x29e73c[_0x4388('0xde')]);delete _0x29e73c[_0x4388('0xdc')];}}}}catch(_0x4e3211){logger[_0x4388('0x3e')](_0x4388('0xdf'),_0x191696['uniqueid'],util[_0x4388('0x40')](_0x4e3211,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4388('0xb')]['syncNewExten']=function(_0x5edd6f){try{if(this[_0x4388('0x65')](_0x5edd6f)){logger['debug'](_0x4388('0xe0'),_0x5edd6f[_0x4388('0x70')],util['inspect'](_0x5edd6f,{'showHidden':![],'depth':null}));if(_0x5edd6f[_0x4388('0xe1')]['toLowerCase']()===_0x4388('0xe2')){_0x5edd6f[_0x4388('0xe3')]=_0x5edd6f['appdata']&&_0x5edd6f[_0x4388('0xe4')][_0x4388('0x93')](_0x4388('0xe5'))?_0x5edd6f['appdata']:(_0x5edd6f[_0x4388('0xe4')]||_0x5edd6f[_0x4388('0xe3')])['toLowerCase']();if(_[_0x4388('0x93')](_0x5edd6f[_0x4388('0xe3')][_0x4388('0x95')](),_0x4388('0xe6'))){logger['info'](_0x4388('0xe7'),_0x5edd6f['uniqueid'],_0x5edd6f[_0x4388('0xe1')],_0x5edd6f[_0x4388('0xe3')]);if(_['isUndefined'](this[_0x4388('0x10')][_0x5edd6f[_0x4388('0x70')]]))this[_0x4388('0x10')][_0x5edd6f['uniqueid']]={};var _0x187fef=_0x5edd6f[_0x4388('0xe3')][_0x4388('0xe8')]('=');var _0x4a09c8=_0x187fef[0x0]['toLowerCase']()[_0x4388('0xe9')](/cdr\((.*)\)/);if(_0x4a09c8)this[_0x4388('0x10')][_0x5edd6f[_0x4388('0x70')]][_0x4a09c8[0x1]]=_0x187fef[0x1];}}}}catch(_0x344f09){logger[_0x4388('0x3e')](_0x4388('0xea'),_0x5edd6f['uniqueid'],util[_0x4388('0x40')](_0x344f09,{'showHidden':![],'depth':null}));}};module[_0x4388('0xeb')]=VoiceQueueReport;
\ No newline at end of file
+var _0x1ee5=['varset','syncVarSet','hangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','enqueue','isNil','Action','status','channel','catch','message','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','debug','[%s][voiceQueueReport][','uniqueid','voice:queue:%s','name','voice_queue_channel:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','loggedIn','sumBillable','sumHoldTime','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','format','voice_queue:save','isNotNull','queues','[voiceQueueReport][queues]','loopQueueSummary','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','available','queuesummary','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleave','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','membername','queuecallerexit','queuecallerexitAt','reason','transfer','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','toLowerCase','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','transferexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[%s][voiceQueueReport][varset]','addVariable','variable','queuestatus','value','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','sumDuration','milliseconds','diff','answered','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','syncAttendedTransfer','transfereeuniqueid','secondtransfererexten','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','syncHangup','BlindTransfer','context','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','startsWith','CDR(routeAlias)','appdata','applicationdata','split','[%s][voiceQueueReport][newexten]','exports','lodash','md5','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','sequence','queueReports','agents','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncAgentConnect'];(function(_0x2d9ec9,_0x23b8e6){var _0x188832=function(_0x23bc0b){while(--_0x23bc0b){_0x2d9ec9['push'](_0x2d9ec9['shift']());}};_0x188832(++_0x23b8e6);}(_0x1ee5,0x1ba));var _0x51ee=function(_0x532671,_0x4b4b1e){_0x532671=_0x532671-0x0;var _0x2d28ee=_0x1ee5[_0x532671];return _0x2d28ee;};'use strict';var _=require(_0x51ee('0x0'));var moment=require('moment');var util=require('util');var md5=require(_0x51ee('0x1'));var Redis=require('ioredis');var config=require(_0x51ee('0x2'));var logger=require(_0x51ee('0x3'))(_0x51ee('0x4'));var ami=require('../ami');var QueueReport=require(_0x51ee('0x5'));config[_0x51ee('0x6')]=_[_0x51ee('0x7')](config[_0x51ee('0x6')],{'host':_0x51ee('0x8'),'port':0x18eb});var io=require(_0x51ee('0x9'))(new Redis(config[_0x51ee('0x6')]));var Sequence=function(){};Sequence[_0x51ee('0xa')]['enqueue']=function(_0x21d000){this['tail']=this[_0x51ee('0xb')]?this[_0x51ee('0xb')]['finally'](_0x21d000):_0x21d000();};function VoiceQueueReport(_0x3666cd){this[_0x51ee('0xc')]=new Sequence();this[_0x51ee('0xd')]={};this['agents']=_0x3666cd[_0x51ee('0xe')];this['channels']=_0x3666cd['queueChannels'];this['voiceQueues']=_0x3666cd[_0x51ee('0xf')];this[_0x51ee('0x10')]=!![];this[_0x51ee('0x11')]=_0x3666cd[_0x51ee('0x11')];this[_0x51ee('0x12')]={};ami['on']('queuesummary',this[_0x51ee('0x13')][_0x51ee('0x14')](this));ami['on']('queuesummarycomplete',this[_0x51ee('0x15')][_0x51ee('0x14')](this));ami['on'](_0x51ee('0x16'),this['syncQueueCallerJoin']['bind'](this));ami['on'](_0x51ee('0x17'),this[_0x51ee('0x18')][_0x51ee('0x14')](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0x51ee('0x14')](this));ami['on'](_0x51ee('0x19'),this[_0x51ee('0x1a')][_0x51ee('0x14')](this));ami['on']('agentconnect',this[_0x51ee('0x1b')][_0x51ee('0x14')](this));ami['on'](_0x51ee('0x1c'),this[_0x51ee('0x1d')]['bind'](this));ami['on'](_0x51ee('0x1e'),this['syncHangup'][_0x51ee('0x14')](this));ami['on'](_0x51ee('0x1f'),this[_0x51ee('0x20')][_0x51ee('0x14')](this));ami['on']('musiconholdstart',this[_0x51ee('0x21')]['bind'](this));ami['on'](_0x51ee('0x22'),this[_0x51ee('0x23')]['bind'](this));ami['on'](_0x51ee('0x24'),this['syncAttendedTransfer'][_0x51ee('0x14')](this));ami['on'](_0x51ee('0x25'),this[_0x51ee('0x26')][_0x51ee('0x14')](this));this['loopQueueSummary']();this[_0x51ee('0x27')]();}function clearChannels(_0x3210be){if(!_['isEmpty'](_0x3210be)){for(var _0x248260 in _0x3210be){if(_0x3210be[_0x51ee('0x28')](_0x248260)){delete _0x3210be[_0x248260];}}}}function clearCampaigns(_0x3c7565){if(!_[_0x51ee('0x29')](_0x3c7565)){for(var _0x23260b in _0x3c7565){if(_0x3c7565[_0x51ee('0x28')](_0x23260b)){_0x3c7565[_0x23260b][_0x51ee('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x877f90){if(!_[_0x51ee('0x29')](_0x877f90)){for(var _0x2164b3 in _0x877f90){if(_0x877f90['hasOwnProperty'](_0x2164b3)){_0x877f90[_0x2164b3][_0x51ee('0x2a')]=0x0;_0x877f90[_0x2164b3][_0x51ee('0x2b')]=0x0;_0x877f90[_0x2164b3][_0x51ee('0x2c')]=0x0;_0x877f90[_0x2164b3][_0x51ee('0x2d')]=0x0;_0x877f90[_0x2164b3][_0x51ee('0x2e')]=!![];}}}}function clearAgentBooked(_0x220a75){if(!_[_0x51ee('0x29')](_0x220a75)){for(var _0x33500e in _0x220a75){if(_0x220a75[_0x51ee('0x28')](_0x33500e)){_0x220a75[_0x33500e][_0x51ee('0x2f')]=!![];}}}}VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x30')]=function(){var _0x1e02c4=this;for(var _0x3c6efd in this[_0x51ee('0x31')]){if(this['channels']['hasOwnProperty'](_0x3c6efd)&&!this[_0x51ee('0x31')][_0x3c6efd][_0x51ee('0x32')]){this[_0x51ee('0xc')][_0x51ee('0x33')](function(){if(!_[_0x51ee('0x34')](_0x1e02c4[_0x51ee('0x31')][_0x3c6efd])){return ami[_0x51ee('0x35')]({'action':_0x51ee('0x36'),'channel':_0x1e02c4[_0x51ee('0x31')][_0x3c6efd][_0x51ee('0x37')]})[_0x51ee('0x38')](function(_0x46df89){if(_0x46df89[_0x51ee('0x39')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1e02c4[_0x51ee('0x31')][_0x3c6efd]){delete _0x1e02c4[_0x51ee('0x31')][_0x3c6efd];logger['error'](_0x51ee('0x3a'),_0x3c6efd,util[_0x51ee('0x3b')](_0x46df89,{'showHidden':![],'depth':null}));}if(_0x1e02c4[_0x51ee('0xd')][_0x3c6efd]){delete _0x1e02c4[_0x51ee('0xd')][_0x3c6efd];logger[_0x51ee('0x3c')](_0x51ee('0x3d'),_0x3c6efd,util[_0x51ee('0x3b')](_0x46df89,{'showHidden':![],'depth':null}));}if(_0x1e02c4[_0x51ee('0x12')][_0x3c6efd]){delete _0x1e02c4['variables'][_0x3c6efd];logger[_0x51ee('0x3c')](_0x51ee('0x3e'),_0x3c6efd,util[_0x51ee('0x3b')](_0x46df89,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x20')]=function(){logger[_0x51ee('0x3c')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x51ee('0x31')]);this[_0x51ee('0x3f')](this[_0x51ee('0xd')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x51ee('0xf')]);clearCampaigns(this[_0x51ee('0x11')]);};VoiceQueueReport[_0x51ee('0xa')]['clearQueueReport']=function(_0x33ab15){var _0x30ddf4=this;if(!_['isEmpty'](_0x33ab15)){for(var _0x3e247d in _0x33ab15){if(_0x33ab15[_0x51ee('0x28')](_0x3e247d)){_0x30ddf4[_0x51ee('0x40')](_0x33ab15[_0x3e247d],_0x51ee('0x41'));delete _0x33ab15[_0x3e247d];}}}};VoiceQueueReport['prototype'][_0x51ee('0x42')]=function(_0x4d82b7,_0x3e9d9c,_0x3b48db){io['to'](_0x4d82b7)[_0x51ee('0x42')](_0x3e9d9c,_0x3b48db);};VoiceQueueReport['prototype']['emitVoiceQueueChannelSave']=function(_0x161ec1,_0x94ebef){logger[_0x51ee('0x43')](_0x51ee('0x44')+_0x94ebef+']\x20sending\x20voice_queue_channel:save\x20event:',_0x161ec1[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x161ec1,{'showHidden':![],'depth':null}));this[_0x51ee('0x42')](util['format'](_0x51ee('0x46'),_0x161ec1[_0x51ee('0x47')]),_0x51ee('0x48'),_0x161ec1);io[_0x51ee('0x42')]('voice_queue_presence:save',_0x161ec1);};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x40')]=function(_0x44d025,_0x128261){logger[_0x51ee('0x43')](_0x51ee('0x44')+_0x128261+_0x51ee('0x49'),_0x44d025[_0x51ee('0x45')],util['inspect'](_0x44d025,{'showHidden':![],'depth':null}));if(_0x44d025[_0x51ee('0x4a')]===_0x51ee('0x4b'))return;this['emit'](util['format'](_0x51ee('0x46'),_0x44d025['name']),'voice_queue_channel:remove',_0x44d025);io[_0x51ee('0x42')](_0x51ee('0x4c'),_0x44d025);};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x4d')]=function(_0x33009f,_0xc8b975){if(_0x33009f[_0x51ee('0x4e')]===_0x51ee('0x4f')){var _0x2be38b={'id':_0x33009f['id'],'name':_0x33009f[_0x51ee('0x47')],'strategy':_0x33009f['strategy'],'answered':_0x33009f['answered'],'available':_0x33009f['available'],'loggedIn':_0x33009f[_0x51ee('0x50')],'pTalking':_0x33009f[_0x51ee('0x2c')],'sumBillable':_0x33009f[_0x51ee('0x51')],'sumDuration':_0x33009f['sumDuration'],'sumHoldTime':_0x33009f[_0x51ee('0x52')]||0x0,'talking':_0x33009f[_0x51ee('0x2b')],'total':_0x33009f[_0x51ee('0x53')],'type':_0x33009f[_0x51ee('0x4e')],'unmanaged':_0x33009f[_0x51ee('0x54')],'abandoned':_0x33009f[_0x51ee('0x55')],'waiting':_0x33009f[_0x51ee('0x2d')]};if(_0x33009f[_0x51ee('0x56')]){_0x2be38b[_0x51ee('0x56')]={'id':_0x33009f['Trunk']['id'],'name':_0x33009f[_0x51ee('0x56')][_0x51ee('0x47')],'active':_0x33009f[_0x51ee('0x56')][_0x51ee('0x57')],'callerid':_0x33009f[_0x51ee('0x56')][_0x51ee('0x58')]};}if(_0x33009f[_0x51ee('0x59')]){_0x2be38b['Interval']={'id':_0x33009f['Interval']['id'],'name':_0x33009f['Interval'][_0x51ee('0x47')]};}var _0x460fa1=md5(JSON[_0x51ee('0x5a')](_0x2be38b));if(_0x33009f[_0x51ee('0x1')]!==_0x460fa1){_0x33009f[_0x51ee('0x1')]=_0x460fa1;logger[_0x51ee('0x43')](_0x51ee('0x5b')+_0xc8b975+_0x51ee('0x5c'),util[_0x51ee('0x3b')](_0x2be38b,{'showHidden':![],'depth':null}));this[_0x51ee('0x42')](util[_0x51ee('0x5d')](_0x51ee('0x46'),_0x2be38b[_0x51ee('0x47')]),_0x51ee('0x5e'),_0x2be38b);}}};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x5f')]=function(_0x172152){return _0x172152!==null&&!_['isUndefined'](_0x172152);};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x27')]=function(){var _0x4c274b=this;setInterval(function(){_0x4c274b[_0x51ee('0x30')]();ami[_0x51ee('0x35')]({'action':_0x51ee('0x60')})['catch'](function(_0x13af86){logger['error'](_0x51ee('0x61'),util[_0x51ee('0x3b')](_0x13af86,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x62')]=function(){var _0x2dd678=this;setInterval(function(){if(_0x2dd678[_0x51ee('0x10')]){return ami[_0x51ee('0x35')]({'action':'queuesummary'})[_0x51ee('0x63')](function(){_0x2dd678[_0x51ee('0x10')]=![];})[_0x51ee('0x38')](function(_0xa8afc5){logger[_0x51ee('0x3c')](_0x51ee('0x64'),util[_0x51ee('0x3b')](_0xa8afc5,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x51ee('0x13')]=function(_0x5a45ee){try{if(this[_0x51ee('0x5f')](_0x5a45ee)&&this['isNotNull'](_0x5a45ee[_0x51ee('0x65')])){logger[_0x51ee('0x43')](_0x51ee('0x66'),util['inspect'](_0x5a45ee,{'showHidden':![],'depth':null}));if(this[_0x51ee('0xf')][_0x5a45ee[_0x51ee('0x65')]]){logger[_0x51ee('0x67')](_0x51ee('0x68'),_0x5a45ee[_0x51ee('0x65')]);var _0x26bdca=_[_0x51ee('0x69')](this[_0x51ee('0x31')],'queue')[_0x5a45ee[_0x51ee('0x65')]]||0x0;var _0x108f34=_0x26bdca-_0x5a45ee[_0x51ee('0x6a')];if(this[_0x51ee('0xf')][_0x5a45ee['queue']][_0x51ee('0x2d')]!==_[_0x51ee('0x6b')](_0x5a45ee[_0x51ee('0x6a')])||this[_0x51ee('0xf')][_0x5a45ee[_0x51ee('0x65')]][_0x51ee('0x50')]!==_[_0x51ee('0x6b')](_0x5a45ee[_0x51ee('0x6c')])||this[_0x51ee('0xf')][_0x5a45ee['queue']][_0x51ee('0x6d')]!==_[_0x51ee('0x6b')](_0x5a45ee[_0x51ee('0x6d')])||this[_0x51ee('0xf')][_0x5a45ee[_0x51ee('0x65')]]['talking']!==_0x108f34){this[_0x51ee('0xf')][_0x5a45ee[_0x51ee('0x65')]][_0x51ee('0x2d')]=_[_0x51ee('0x6b')](_0x5a45ee['callers']);this[_0x51ee('0xf')][_0x5a45ee[_0x51ee('0x65')]][_0x51ee('0x50')]=_[_0x51ee('0x6b')](_0x5a45ee['loggedin']);this['voiceQueues'][_0x5a45ee[_0x51ee('0x65')]][_0x51ee('0x6d')]=_['toNumber'](_0x5a45ee[_0x51ee('0x6d')]);this[_0x51ee('0xf')][_0x5a45ee[_0x51ee('0x65')]][_0x51ee('0x2b')]=_0x108f34>0x0?_0x108f34:0x0;this[_0x51ee('0xf')][_0x5a45ee[_0x51ee('0x65')]]['talking']=this[_0x51ee('0xf')][_0x5a45ee[_0x51ee('0x65')]]['talking']>_['toNumber'](_0x5a45ee[_0x51ee('0x6c')])?_[_0x51ee('0x6b')](_0x5a45ee[_0x51ee('0x6c')]):this[_0x51ee('0xf')][_0x5a45ee['queue']]['talking'];this['emitVoiceQueueSummary'](this[_0x51ee('0xf')][_0x5a45ee['queue']],_0x51ee('0x6e'));}logger['debug'](_0x51ee('0x6f'),util[_0x51ee('0x3b')](this[_0x51ee('0xf')][_0x5a45ee['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x51ee('0x70'),this[_0x51ee('0xf')][_0x5a45ee['queue']]);}}}catch(_0x1426f1){logger['error'](_0x51ee('0x64'),util[_0x51ee('0x3b')](_0x1426f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x51ee('0x15')]=function(_0xe8b3f9){logger[_0x51ee('0x43')](_0x51ee('0x71'),util[_0x51ee('0x3b')](_0xe8b3f9,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x72')]=function(_0x17e864){try{if(this[_0x51ee('0x5f')](_0x17e864)){logger[_0x51ee('0x43')](_0x51ee('0x73'),_0x17e864[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x17e864,{'showHidden':![],'depth':null}));if(_[_0x51ee('0x74')](this['queueReports'][_0x17e864[_0x51ee('0x45')]]))this[_0x51ee('0xd')][_0x17e864[_0x51ee('0x45')]]=[];if(_['isUndefined'](this[_0x51ee('0x31')][_0x17e864[_0x51ee('0x45')]]))this[_0x51ee('0x31')][_0x17e864['uniqueid']]={};var _0x3e1987=new QueueReport();_0x3e1987['name']=_0x17e864[_0x51ee('0x65')];_0x3e1987[_0x51ee('0x4e')]=this[_0x51ee('0xf')][_0x3e1987[_0x51ee('0x47')]]&&this[_0x51ee('0xf')][_0x3e1987[_0x51ee('0x47')]][_0x51ee('0x4e')]?this[_0x51ee('0xf')][_0x3e1987[_0x51ee('0x47')]]['type']||'inbound':_0x51ee('0x4f');_0x3e1987[_0x51ee('0x65')]=_0x17e864['queue'];_0x3e1987['queuecallerjoinAt']=moment()[_0x51ee('0x5d')](_0x51ee('0x75'));_0x3e1987['position']=_0x17e864[_0x51ee('0x76')];_0x3e1987[_0x51ee('0x77')]=_0x17e864[_0x51ee('0x77')];_0x3e1987[_0x51ee('0x45')]=_0x17e864[_0x51ee('0x45')];_0x3e1987[_0x51ee('0x78')]=this[_0x51ee('0x31')][_0x17e864['uniqueid']][_0x51ee('0x78')];logger['info'](_0x51ee('0x79'),_0x3e1987['name'],_0x3e1987['type']);_[_0x51ee('0x7a')](_0x3e1987,_[_0x51ee('0x7b')](_0x17e864,_[_0x51ee('0x7c')](_0x3e1987)));this['queueReports'][_0x17e864[_0x51ee('0x45')]][_0x51ee('0x7d')](_0x3e1987);this['channels'][_0x17e864['uniqueid']]=_0x3e1987;this[_0x51ee('0x7e')](_0x3e1987,_0x51ee('0x16'));}}catch(_0x983310){logger[_0x51ee('0x3c')](_0x51ee('0x73'),_0x17e864[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x983310,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x51ee('0xa')]['syncQueueCallerAbandon']=function(_0x3527df){try{if(this[_0x51ee('0x5f')](_0x3527df)){logger[_0x51ee('0x43')](_0x51ee('0x7f'),_0x3527df[_0x51ee('0x45')],util['inspect'](_0x3527df,{'showHidden':![],'depth':null}));if(this[_0x51ee('0xd')][_0x3527df[_0x51ee('0x45')]]){var _0x417668=_[_0x51ee('0x80')](this['queueReports'][_0x3527df[_0x51ee('0x45')]]);_0x417668[_0x51ee('0x81')]=![];_0x417668[_0x51ee('0x82')]=null;_0x417668['holdtime']=_0x3527df[_0x51ee('0x83')];_0x417668[_0x51ee('0x84')]=_0x3527df[_0x51ee('0x84')];_0x417668[_0x51ee('0x17')]=!![];_0x417668[_0x51ee('0x85')]=moment()[_0x51ee('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x417668[_0x51ee('0x4a')]=_0x51ee('0x86');_0x417668[_0x51ee('0x87')]=null;logger[_0x51ee('0x67')](_0x51ee('0x88'),_0x417668[_0x51ee('0x47')],_0x417668[_0x51ee('0x4e')]);this[_0x51ee('0x31')][_0x3527df[_0x51ee('0x45')]]=_0x417668;this[_0x51ee('0x40')](_0x417668,_0x51ee('0x17'));}}}catch(_0x581590){logger[_0x51ee('0x3c')](_0x51ee('0x7f'),_0x3527df['uniqueid'],util[_0x51ee('0x3b')](_0x581590,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x89')]=function(_0x481412){try{if(this[_0x51ee('0x5f')](_0x481412)){logger['debug'](_0x51ee('0x8a'),_0x481412[_0x51ee('0x45')],util['inspect'](_0x481412,{'showHidden':![],'depth':null}));if(this[_0x51ee('0xd')][_0x481412[_0x51ee('0x45')]]){var _0xde843f=_[_0x51ee('0x80')](this['queueReports'][_0x481412[_0x51ee('0x45')]]);_0xde843f['queuecallerleaveAt']=moment()[_0x51ee('0x5d')](_0x51ee('0x75'));_0xde843f['connectedlinenum']=_0x481412['connectedlinenum'];_0xde843f['connectedlinename']=_0x481412['connectedlinename'];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xde843f['name'],_0xde843f['type'],_0x481412[_0x51ee('0x8b')],_0x481412[_0x51ee('0x8c')]);this[_0x51ee('0x31')][_0x481412[_0x51ee('0x45')]]=_0xde843f;this[_0x51ee('0x7e')](_0xde843f,_0x51ee('0x8d'));}}}catch(_0x123640){logger[_0x51ee('0x3c')](_0x51ee('0x8a'),_0x481412[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x123640,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x1b')]=function(_0x1046b7){try{if(this[_0x51ee('0x5f')](_0x1046b7)){logger[_0x51ee('0x43')](_0x51ee('0x8e'),_0x1046b7[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x1046b7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1046b7[_0x51ee('0x45')]]){var _0x41096c=_[_0x51ee('0x80')](this[_0x51ee('0xd')][_0x1046b7[_0x51ee('0x45')]]);_0x41096c[_0x51ee('0x81')]=!![];_0x41096c[_0x51ee('0x4a')]='COMPLETEDBYAGENT';logger[_0x51ee('0x67')](_0x51ee('0x8f'),_0x41096c['name'],_0x41096c[_0x51ee('0x4e')]);}}}catch(_0x5da990){logger[_0x51ee('0x3c')](_0x51ee('0x8e'),_0x1046b7[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x5da990,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x1a')]=function(_0x3a7d41){try{if(this[_0x51ee('0x5f')](_0x3a7d41)){logger['debug'](_0x51ee('0x90'),_0x3a7d41['uniqueid'],util[_0x51ee('0x3b')](_0x3a7d41,{'showHidden':![],'depth':null}));if(this[_0x51ee('0xd')][_0x3a7d41[_0x51ee('0x45')]]){var _0x25224e=_['last'](this['queueReports'][_0x3a7d41[_0x51ee('0x45')]]);_0x25224e[_0x51ee('0x17')]=![];_0x25224e[_0x51ee('0x85')]=null;_0x25224e['assigned']=!![];_0x25224e[_0x51ee('0x87')]=_0x3a7d41[_0x51ee('0x91')];_0x25224e[_0x51ee('0x83')]=_0x3a7d41['holdtime'];_0x25224e['queuecallercomplete']=!![];_0x25224e[_0x51ee('0x92')]=![];_0x25224e[_0x51ee('0x93')]=null;if(!_0x25224e['transfer']){if(_0x3a7d41[_0x51ee('0x94')]==_0x51ee('0x95')){_0x25224e[_0x51ee('0x4a')]='COMPLETED';logger[_0x51ee('0x67')](_0x51ee('0x96'),_0x25224e[_0x51ee('0x47')],_0x25224e['type']);}else{if(_['startsWith'](_0x3a7d41[_0x51ee('0x37')][_0x51ee('0x97')](),'local/')){if(this[_0x51ee('0xd')][_0x3a7d41[_0x51ee('0x98')]]){var _0x27c33e=_['last'](this['queueReports'][_0x3a7d41[_0x51ee('0x98')]]);_0x27c33e[_0x51ee('0x81')]=![];_0x27c33e['queuecallerexit']=!![];_0x27c33e['queuecallerexitAt']=moment(_0x25224e[_0x51ee('0x99')])[_0x51ee('0x9a')](_0x3a7d41[_0x51ee('0x83')],_0x51ee('0x9b'))[_0x51ee('0x5d')](_0x51ee('0x75'));_0x27c33e[_0x51ee('0x4a')]=_0x51ee('0x9c');_0x27c33e[_0x51ee('0x95')]=!![];_0x27c33e[_0x51ee('0x9d')]='FORWARD';_0x27c33e[_0x51ee('0x9e')]=_0x3a7d41['destexten'];_0x27c33e[_0x51ee('0x9f')]=_0x3a7d41['uniqueid'];logger[_0x51ee('0x67')](_0x51ee('0xa0'),_0x27c33e[_0x51ee('0x47')],_0x27c33e[_0x51ee('0x4e')]);var _0x32f606=this[_0x51ee('0xd')][_0x3a7d41[_0x51ee('0x98')]];this[_0x51ee('0xd')][_0x3a7d41['linkedid']]=this[_0x51ee('0xd')][_0x3a7d41[_0x51ee('0x45')]];this[_0x51ee('0xd')][_0x3a7d41[_0x51ee('0x45')]]=_0x32f606;}}else{_0x25224e[_0x51ee('0x4a')]=_0x51ee('0xa1')+_0x3a7d41['reason']['toUpperCase']();logger[_0x51ee('0x67')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x25224e[_0x51ee('0x47')],_0x25224e[_0x51ee('0x4e')],_0x25224e[_0x51ee('0x4a')]);}}}this[_0x51ee('0x31')][_0x3a7d41['uniqueid']]=_0x25224e;this[_0x51ee('0x40')](_0x25224e,_0x51ee('0x19'));}}}catch(_0xab0b07){logger['error'](_0x51ee('0x90'),_0x3a7d41[_0x51ee('0x45')],util['inspect'](_0xab0b07,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x1d')]=function(_0x287f6f){try{if(this[_0x51ee('0x5f')](_0x287f6f)){logger[_0x51ee('0x43')](_0x51ee('0xa2'),_0x287f6f[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x287f6f,{'showHidden':![],'depth':null}));this[_0x51ee('0xa3')](_0x287f6f['uniqueid'],_[_0x51ee('0x7c')](_0x287f6f[_0x51ee('0xa4')])[0x0],_0x287f6f['value']);if(this[_0x51ee('0xd')][_0x287f6f[_0x51ee('0x45')]]){var _0x1d55d8=_[_0x51ee('0x80')](this[_0x51ee('0xd')][_0x287f6f[_0x51ee('0x45')]]);if(_0x1d55d8){if(this[_0x51ee('0x5f')](_0x287f6f[_0x51ee('0xa4')])&&this[_0x51ee('0x5f')](_0x287f6f['variable'][_0x51ee('0xa5')])){switch(_0x287f6f[_0x51ee('0xa6')]){case _0x51ee('0xa7'):_0x1d55d8['queuecallerexit']=![];_0x1d55d8[_0x51ee('0x93')]=null;break;case _0x51ee('0xa8'):_0x1d55d8[_0x51ee('0xa9')]=_0x51ee('0xaa');_0x1d55d8[_0x51ee('0x92')]=!![];_0x1d55d8[_0x51ee('0x93')]=moment()[_0x51ee('0x5d')](_0x51ee('0x75'));_0x1d55d8[_0x51ee('0xab')]=moment()[_0x51ee('0x5d')](_0x51ee('0x75'));logger[_0x51ee('0x43')](_0x51ee('0xac'),_0x287f6f[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x1d55d8,{'showHidden':![],'depth':null}));ami[_0x51ee('0x42')]('custom:timeout',_0x1d55d8);break;default:_0x1d55d8[_0x51ee('0x92')]=!![];_0x1d55d8[_0x51ee('0x93')]=moment()[_0x51ee('0x5d')](_0x51ee('0x75'));_0x1d55d8[_0x51ee('0xab')]=moment()[_0x51ee('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1d55d8['queuecallerabandon']=![];_0x1d55d8[_0x51ee('0x85')]=null;_0x1d55d8[_0x51ee('0x4a')]=_0x287f6f['value'];this[_0x51ee('0x31')][_0x287f6f[_0x51ee('0x45')]]=_0x1d55d8;this[_0x51ee('0x40')](_0x1d55d8,_0x51ee('0x1c'));}else if(this[_0x51ee('0x5f')](_0x287f6f[_0x51ee('0xa4')])&&this['isNotNull'](_0x287f6f[_0x51ee('0xa4')][_0x51ee('0xad')])){if(!_0x1d55d8['queuecallerabandon']){_0x1d55d8[_0x51ee('0x92')]=!![];_0x1d55d8[_0x51ee('0x93')]=moment()[_0x51ee('0x5d')](_0x51ee('0x75'));_0x1d55d8['queuecallerexitreason']=_0x51ee('0xae');_0x1d55d8['queuecallerleaveAt']=moment()[_0x51ee('0x5d')](_0x51ee('0x75'));this[_0x51ee('0x31')][_0x287f6f[_0x51ee('0x45')]]=_0x1d55d8;}}logger[_0x51ee('0x67')](_0x51ee('0xaf'),_0x287f6f[_0x51ee('0x45')],_0x1d55d8[_0x51ee('0x47')],_0x1d55d8[_0x51ee('0x4e')],_[_0x51ee('0x7c')](_0x287f6f[_0x51ee('0xa4')])[0x0],_0x287f6f[_0x51ee('0xa6')]);_0x1d55d8[_0x51ee('0x12')]=this['variables'][_0x287f6f['uniqueid']];}}}}catch(_0x2a4ec9){logger[_0x51ee('0x3c')](_0x51ee('0xa2'),_0x287f6f[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x2a4ec9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0xa3')]=function(_0x44f8dc,_0x5394c1,_0x1bd58c){var _0x16f5a4=['rtpaudioqos',_0x51ee('0xb0'),_0x51ee('0xb1'),_0x51ee('0xb2'),_0x51ee('0xb3'),'rtpaudioqoslossbridged',_0x51ee('0xb4'),'rtpaudioqosrttbridged',_0x51ee('0xb5'),_0x51ee('0xb6'),_0x51ee('0xb7'),_0x51ee('0xb8'),'membercalls',_0x51ee('0xb9'),'memberinterface',_0x51ee('0xba'),_0x51ee('0x91'),_0x51ee('0xbb'),_0x51ee('0xbc')];if(!_[_0x51ee('0x34')](_0x5394c1)&&!_[_0x51ee('0xbd')](_0x16f5a4,_0x5394c1)){if(_[_0x51ee('0x74')](this[_0x51ee('0x12')][_0x44f8dc])){this[_0x51ee('0x12')][_0x44f8dc]={};}this[_0x51ee('0x12')][_0x44f8dc][_0x5394c1]=_0x1bd58c;}};VoiceQueueReport[_0x51ee('0xa')]['syncHangup']=function(_0x502c0d){try{if(this[_0x51ee('0x5f')](_0x502c0d)){logger[_0x51ee('0x43')](_0x51ee('0xbe'),_0x502c0d[_0x51ee('0x45')],util['inspect'](_0x502c0d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x502c0d['uniqueid']]){for(var _0x500395=0x0,_0x37669={};_0x500395<this[_0x51ee('0xd')][_0x502c0d[_0x51ee('0x45')]][_0x51ee('0xbf')];_0x500395+=0x1){_0x37669=this[_0x51ee('0xd')][_0x502c0d[_0x51ee('0x45')]][_0x500395];if(this['voiceQueues'][_0x37669[_0x51ee('0x65')]]){if(_0x37669['queuecallerexit']&&_0x37669['transfer']!=!![]){this['voiceQueues'][_0x37669[_0x51ee('0x65')]][_0x51ee('0x54')]+=0x1;}if(_0x37669[_0x51ee('0x17')]){this[_0x51ee('0xf')][_0x37669[_0x51ee('0x65')]][_0x51ee('0x55')]+=0x1;}this[_0x51ee('0xf')][_0x37669[_0x51ee('0x65')]][_0x51ee('0x52')]+=moment(_0x37669[_0x51ee('0xab')])['diff'](_0x37669[_0x51ee('0x99')],'seconds')||0x0;if(_0x500395===this[_0x51ee('0xd')][_0x502c0d[_0x51ee('0x45')]][_0x51ee('0xbf')]-0x1){this[_0x51ee('0xf')][_0x37669[_0x51ee('0x65')]][_0x51ee('0xc0')]+=moment()[_0x51ee('0xc1')](0x0)[_0x51ee('0xc2')](_0x37669[_0x51ee('0x99')],_0x51ee('0x9b'));this[_0x51ee('0xf')][_0x37669[_0x51ee('0x65')]]['total']+=0x1;if(_0x37669[_0x51ee('0x81')]){this[_0x51ee('0xf')][_0x37669[_0x51ee('0x65')]][_0x51ee('0xc3')]+=0x1;this[_0x51ee('0xf')][_0x37669['queue']][_0x51ee('0x51')]+=moment()[_0x51ee('0xc1')](0x0)[_0x51ee('0xc2')](_0x37669[_0x51ee('0xab')],_0x51ee('0x9b'));_0x37669[_0x51ee('0x82')]=moment()[_0x51ee('0x5d')](_0x51ee('0x75'));_0x37669[_0x51ee('0x92')]=![];_0x37669[_0x51ee('0x93')]=null;}if(_0x37669[_0x51ee('0x92')]&&_0x37669[_0x51ee('0x95')]!=!![]){_0x37669['lastevent']=_0x51ee('0x54');logger[_0x51ee('0x43')](_0x51ee('0xc4'),_0x502c0d[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x37669,{'showHidden':![],'depth':null}));ami[_0x51ee('0x42')](_0x51ee('0xc5'),_0x37669);}if(_0x37669[_0x51ee('0x17')]){_0x37669['lastevent']=_0x51ee('0x55');logger[_0x51ee('0x43')](_0x51ee('0xc6'),_0x502c0d[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x37669,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerabandon',_0x37669);}}else{this['voiceQueues'][_0x37669[_0x51ee('0x65')]][_0x51ee('0xc0')]+=this[_0x51ee('0xf')][_0x37669[_0x51ee('0x65')]][_0x51ee('0x52')];}logger[_0x51ee('0x67')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x502c0d[_0x51ee('0x45')],_0x37669['name'],_0x37669[_0x51ee('0x4e')],_0x502c0d[_0x51ee('0xc7')]);this['channels'][_0x502c0d[_0x51ee('0x45')]]=_0x37669;this['emitVoiceQueueChannelRemove'](_0x37669,_0x51ee('0x1e'));this['emitVoiceQueueSummary'](this[_0x51ee('0xf')][_0x37669[_0x51ee('0x65')]],_0x51ee('0x1e'));}}logger[_0x51ee('0x43')](_0x51ee('0xc8'),_0x502c0d[_0x51ee('0x45')],util['inspect'](this['queueReports'][_0x502c0d[_0x51ee('0x45')]],{'showHidden':![],'depth':null}));ami[_0x51ee('0x42')]('custom:voiceQueueReport',this[_0x51ee('0xd')][_0x502c0d[_0x51ee('0x45')]]);if(_0x37669[_0x51ee('0x4a')]===_0x51ee('0x4b'))return;delete this[_0x51ee('0xd')][_0x502c0d[_0x51ee('0x45')]];delete this[_0x51ee('0x31')][_0x502c0d['uniqueid']];}if(this[_0x51ee('0x12')][_0x502c0d[_0x51ee('0x45')]]){delete this['variables'][_0x502c0d[_0x51ee('0x45')]];}}}catch(_0x1e350b){logger[_0x51ee('0x3c')](_0x51ee('0xbe'),_0x502c0d[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x1e350b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x51ee('0xc9')]=function(_0x30d742){try{if(this[_0x51ee('0x5f')](_0x30d742)){logger[_0x51ee('0x43')]('[%s][voiceQueueReport][attendedtransfer]',_0x30d742['uniqueid'],util[_0x51ee('0x3b')](_0x30d742,{'showHidden':![],'depth':null}));var _0x597f9e;var _0x2efeb2;var _0x29574a;if(this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xca')]]){_0x597f9e=_[_0x51ee('0x80')](this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xca')]]);_0x597f9e['transferexten']=_0x30d742[_0x51ee('0xcb')];_0x597f9e[_0x51ee('0x9f')]=_0x30d742['secondtransfereruniqueid'];_0x597f9e[_0x51ee('0x4a')]=_0x51ee('0x4b');_0x597f9e[_0x51ee('0x95')]=!![];_0x597f9e[_0x51ee('0x9d')]=_0x51ee('0xcc');if(this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xcd')]]){_0x29574a=this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xcd')]];this[_0x51ee('0xd')][_0x30d742['secondtransfereruniqueid']]=this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xca')]];this['queueReports'][_0x30d742[_0x51ee('0xca')]]=_0x29574a;_0x2efeb2=_[_0x51ee('0x80')](this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xca')]]);_0x2efeb2[_0x51ee('0x32')]=!![];}logger[_0x51ee('0x67')](_0x51ee('0xce'),_0x30d742[_0x51ee('0x45')],_0x597f9e[_0x51ee('0x47')],_0x597f9e['type'],_0x597f9e[_0x51ee('0x9e')],_0x597f9e[_0x51ee('0x9f')]);}else if(this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xcf')]]){_0x597f9e=_[_0x51ee('0x80')](this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xcf')]]);_0x597f9e[_0x51ee('0x9e')]=_0x30d742[_0x51ee('0xd0')];_0x597f9e[_0x51ee('0x9f')]=_0x30d742[_0x51ee('0xd1')];_0x597f9e[_0x51ee('0x4a')]=_0x51ee('0x4b');_0x597f9e[_0x51ee('0x95')]=!![];_0x597f9e[_0x51ee('0x9d')]='ATTENDED';if(this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xd1')]]){_0x29574a=this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xd1')]];this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xd1')]]=this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xcf')]];this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xcf')]]=_0x29574a;_0x2efeb2=_[_0x51ee('0x80')](this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xcf')]]);_0x2efeb2['switch']=!![];}logger[_0x51ee('0x67')](_0x51ee('0xce'),_0x30d742[_0x51ee('0x45')],_0x597f9e[_0x51ee('0x47')],_0x597f9e[_0x51ee('0x4e')],_0x597f9e[_0x51ee('0x9e')],_0x597f9e['transferuniqueid']);}else if(this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xd1')]]){_0x597f9e=_[_0x51ee('0x80')](this['queueReports'][_0x30d742[_0x51ee('0xd1')]]);_0x597f9e[_0x51ee('0x9e')]=_0x30d742[_0x51ee('0xd0')];_0x597f9e[_0x51ee('0x9f')]=_0x30d742[_0x51ee('0xd1')];_0x597f9e['queuecallerexitreason']='ATTENDEDTRANSFER';_0x597f9e['transfer']=!![];_0x597f9e[_0x51ee('0x9d')]=_0x51ee('0xcc');}else if(this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xcd')]]){_0x597f9e=_[_0x51ee('0x80')](this[_0x51ee('0xd')][_0x30d742[_0x51ee('0xcd')]]);_0x597f9e[_0x51ee('0x9e')]=_0x30d742[_0x51ee('0xcb')];_0x597f9e[_0x51ee('0x9f')]=_0x30d742['secondtransfereruniqueid'];_0x597f9e[_0x51ee('0x4a')]=_0x51ee('0x4b');_0x597f9e[_0x51ee('0x95')]=!![];_0x597f9e[_0x51ee('0x9d')]=_0x51ee('0xcc');}}}catch(_0x29fefd){logger[_0x51ee('0x3c')](_0x51ee('0xd2'),_0x30d742[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x29fefd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x26')]=function(_0x3ce3dd){try{if(this[_0x51ee('0x5f')](_0x3ce3dd)){logger['debug'](_0x51ee('0xd3'),_0x3ce3dd['uniqueid'],util[_0x51ee('0x3b')](_0x3ce3dd,{'showHidden':![],'depth':null}));if(this[_0x51ee('0xd')][_0x3ce3dd[_0x51ee('0xca')]]){var _0xa983a=_[_0x51ee('0x80')](this[_0x51ee('0xd')][_0x3ce3dd[_0x51ee('0xca')]]);_0xa983a[_0x51ee('0x4a')]=_0x51ee('0xd4');_0xa983a[_0x51ee('0x95')]=!![];_0xa983a[_0x51ee('0x9d')]=_0x51ee('0xd5');_0xa983a['transferexten']=_0x3ce3dd[_0x51ee('0xd6')];_0xa983a[_0x51ee('0x9f')]=_0x3ce3dd[_0x51ee('0xca')];logger[_0x51ee('0x67')](_0x51ee('0xd7'),_0x3ce3dd[_0x51ee('0x45')],_0xa983a[_0x51ee('0x47')],_0xa983a['type'],_0xa983a['transferexten'],_0xa983a[_0x51ee('0x9f')]);this[_0x51ee('0xd8')]({'event':_0x51ee('0xd9'),'uniqueid':_0x3ce3dd[_0x51ee('0xca')],'context':_0x3ce3dd[_0x51ee('0xda')],'channel':_0x3ce3dd['transfererchannel']});}}}catch(_0x32c8a1){logger[_0x51ee('0x3c')](_0x51ee('0xd3'),_0x3ce3dd[_0x51ee('0x45')],util['inspect'](_0x32c8a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0x21')]=function(_0x3ebcba){try{if(this[_0x51ee('0x5f')](_0x3ebcba)){logger[_0x51ee('0x43')]('[%s][voiceQueueReport][musiconholdstart]',_0x3ebcba[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x3ebcba,{'showHidden':![],'depth':null}));if(this[_0x51ee('0xd')][_0x3ebcba[_0x51ee('0x45')]]){var _0x899484=_[_0x51ee('0x80')](this[_0x51ee('0xd')][_0x3ebcba['uniqueid']]);if(!_[_0x51ee('0x34')](_0x899484[_0x51ee('0xab')])){_0x899484[_0x51ee('0xdb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x51ee('0x67')](_0x51ee('0xdc'),_0x3ebcba['uniqueid'],_0x899484[_0x51ee('0xdb')]);}}}}catch(_0x9f2e72){logger['error']('[%s][voiceQueueReport][musiconholdstart]',_0x3ebcba[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x9f2e72,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x51ee('0xa')]['syncMusicOnHoldStop']=function(_0x46f4b4){try{if(this[_0x51ee('0x5f')](_0x46f4b4)){logger['debug'](_0x51ee('0xdd'),_0x46f4b4[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0x46f4b4,{'showHidden':![],'depth':null}));if(this[_0x51ee('0xd')][_0x46f4b4[_0x51ee('0x45')]]){var _0x4ce59c=_[_0x51ee('0x80')](this[_0x51ee('0xd')][_0x46f4b4[_0x51ee('0x45')]]);if(!_[_0x51ee('0x34')](_0x4ce59c[_0x51ee('0xdb')])){_0x4ce59c[_0x51ee('0xde')]+=moment()[_0x51ee('0xc1')](0x0)['diff'](_0x4ce59c[_0x51ee('0xdb')],_0x51ee('0x9b'));logger['info'](_0x51ee('0xdf'),_0x46f4b4[_0x51ee('0x45')],_0x4ce59c['mohtime']);delete _0x4ce59c[_0x51ee('0xdb')];}}}}catch(_0x4ae57d){logger[_0x51ee('0x3c')]('[%s][voiceQueueReport][musiconholdstop]',_0x46f4b4[_0x51ee('0x45')],util['inspect'](_0x4ae57d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x51ee('0xa')][_0x51ee('0xe0')]=function(_0x4d3647){try{if(this[_0x51ee('0x5f')](_0x4d3647)){logger[_0x51ee('0x43')](_0x51ee('0xe1'),_0x4d3647['uniqueid'],util[_0x51ee('0x3b')](_0x4d3647,{'showHidden':![],'depth':null}));if(_0x4d3647[_0x51ee('0xe2')][_0x51ee('0x97')]()===_0x51ee('0xe3')){_0x4d3647['applicationdata']=_0x4d3647['appdata']&&_0x4d3647['appdata'][_0x51ee('0xe4')](_0x51ee('0xe5'))?_0x4d3647[_0x51ee('0xe6')]:(_0x4d3647[_0x51ee('0xe6')]||_0x4d3647['applicationdata'])[_0x51ee('0x97')]();if(_['startsWith'](_0x4d3647[_0x51ee('0xe7')][_0x51ee('0x97')](),'cdr(')){logger[_0x51ee('0x67')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x4d3647[_0x51ee('0x45')],_0x4d3647['application'],_0x4d3647['applicationdata']);if(_[_0x51ee('0x74')](this[_0x51ee('0x31')][_0x4d3647[_0x51ee('0x45')]]))this[_0x51ee('0x31')][_0x4d3647[_0x51ee('0x45')]]={};var _0xd81ad9=_0x4d3647[_0x51ee('0xe7')][_0x51ee('0xe8')]('=');var _0x2a15c9=_0xd81ad9[0x0][_0x51ee('0x97')]()['match'](/cdr\((.*)\)/);if(_0x2a15c9)this[_0x51ee('0x31')][_0x4d3647['uniqueid']][_0x2a15c9[0x1]]=_0xd81ad9[0x1];}}}}catch(_0xafb56f){logger['error'](_0x51ee('0xe9'),_0x4d3647[_0x51ee('0x45')],util[_0x51ee('0x3b')](_0xafb56f,{'showHidden':![],'depth':null}));}};module[_0x51ee('0xea')]=VoiceQueueReport;
\ No newline at end of file
index 2194e21..2a12dfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe566=['Request','CreateReportAgentPreview','createHistory','campaign'];(function(_0x18c1c5,_0x141a86){var _0x457642=function(_0x2af529){while(--_0x2af529){_0x18c1c5['push'](_0x18c1c5['shift']());}};_0x457642(++_0x141a86);}(_0xe566,0xee));var _0x6e56=function(_0x35bcdb,_0xfb390d){_0x35bcdb=_0x35bcdb-0x0;var _0x3d09a5=_0xe566[_0x35bcdb];return _0x3d09a5;};'use strict';var client=require('../client');exports[_0x6e56('0x0')]=function(_0x26e1a5){return function(){_0x26e1a5[_0x6e56('0x1')]=_0x26e1a5['queue'];return client[_0x6e56('0x2')]('CreateReportAgentPreview',{'body':_0x26e1a5,'log':_0x6e56('0x3')});};};
\ No newline at end of file
+var _0x1765=['campaign','queue','Request','CreateReportAgentPreview','createHistory'];(function(_0x543bd6,_0x4e2358){var _0x414e9b=function(_0x1f8335){while(--_0x1f8335){_0x543bd6['push'](_0x543bd6['shift']());}};_0x414e9b(++_0x4e2358);}(_0x1765,0x135));var _0x5176=function(_0x3220bb,_0x342a03){_0x3220bb=_0x3220bb-0x0;var _0x23415c=_0x1765[_0x3220bb];return _0x23415c;};'use strict';var client=require('../client');exports[_0x5176('0x0')]=function(_0x2f7fc6){return function(){_0x2f7fc6[_0x5176('0x1')]=_0x2f7fc6[_0x5176('0x2')];return client[_0x5176('0x3')](_0x5176('0x4'),{'body':_0x2f7fc6,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
index 20219d8..bb768d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3d8=['Request','CreateAttachment','../client','create'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa3d8,0xd2));var _0x8a3d=function(_0x8c928e,_0x131021){_0x8c928e=_0x8c928e-0x0;var _0x2069a3=_0xa3d8[_0x8c928e];return _0x2069a3;};'use strict';var client=require(_0x8a3d('0x0'));exports[_0x8a3d('0x1')]=function(_0x5783c0){return client[_0x8a3d('0x2')](_0x8a3d('0x3'),{'body':_0x5783c0,'log':_0x8a3d('0x3')});};
\ No newline at end of file
+var _0x066e=['CreateAttachment','../client','Request'];(function(_0x2a3a26,_0x3d97bf){var _0x14e1fd=function(_0x1c3a40){while(--_0x1c3a40){_0x2a3a26['push'](_0x2a3a26['shift']());}};_0x14e1fd(++_0x3d97bf);}(_0x066e,0xca));var _0xe066=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x066e[_0x5bd426];return _0x23a7eb;};'use strict';var client=require(_0xe066('0x0'));exports['create']=function(_0x4c55ac){return client[_0xe066('0x1')](_0xe066('0x2'),{'body':_0x4c55ac,'log':_0xe066('0x2')});};
\ No newline at end of file
index 40ce33a..b90aa7a 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(_0x2e05ef,_0x108e20){var _0xdba460=function(_0x31b029){while(--_0x31b029){_0x2e05ef['push'](_0x2e05ef['shift']());}};_0xdba460(++_0x108e20);}(_0x7a54,0x106));var _0x47a5=function(_0x28b2fd,_0x210392){_0x28b2fd=_0x28b2fd-0x0;var _0x11e983=_0x7a54[_0x28b2fd];return _0x11e983;};'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 _0x1261=['Interval','interval','SquareProject','getCampaign','getCampaigns','Request','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','TrunkBackup','callerid'];(function(_0x155339,_0x2441ff){var _0x1e08cb=function(_0x33a285){while(--_0x33a285){_0x155339['push'](_0x155339['shift']());}};_0x1e08cb(++_0x2441ff);}(_0x1261,0x144));var _0x1126=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0x1261[_0x120376];return _0x28c529;};'use strict';var client=require('../client');exports[_0x1126('0x0')]=function(){return function(){return client[_0x1126('0x1')](_0x1126('0x2'),{'options':{'raw':![],'attributes':['id',_0x1126('0x3'),_0x1126('0x4'),_0x1126('0x5'),_0x1126('0x6'),_0x1126('0x7'),_0x1126('0x8'),_0x1126('0x9'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x1126('0xa'),_0x1126('0xb'),'dialNoAnswerMaxRetry',_0x1126('0xc'),_0x1126('0xd'),_0x1126('0xe'),_0x1126('0xf'),_0x1126('0x10'),'dialDropRetryFrequency',_0x1126('0x11'),_0x1126('0x12'),_0x1126('0x13'),'dialMachineRetryFrequency',_0x1126('0x14'),'dialAgentRejectRetryFrequency','dialTimezone',_0x1126('0x15'),'dialAMDActive',_0x1126('0x16'),_0x1126('0x17'),_0x1126('0x18'),_0x1126('0x19'),_0x1126('0x1a'),_0x1126('0x1b'),_0x1126('0x1c'),_0x1126('0x1d'),_0x1126('0x1e'),'dialOrderByScheduledAt','dialPrefix',_0x1126('0x1f'),_0x1126('0x20')],'include':[{'model':_0x1126('0x21'),'as':'Trunk','attributes':['id',_0x1126('0x3'),'callerid',_0x1126('0x5')]},{'model':_0x1126('0x21'),'as':_0x1126('0x22'),'attributes':['id','name',_0x1126('0x23'),_0x1126('0x5')]},{'model':'Interval','as':'Interval','attributes':['id',_0x1126('0x3')],'include':[{'model':_0x1126('0x24'),'as':'Intervals','attributes':['id','name',_0x1126('0x25')]}]},{'model':'SquareProject','as':_0x1126('0x26'),'attributes':['id',_0x1126('0x3')]}]},'log':_0x1126('0x27')});};};
\ No newline at end of file
index 02cc25a..7a51b92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3236=['createContact','CreateCmContact','getContacts','Request','GetCmContact'];(function(_0x388451,_0x840114){var _0xed4eda=function(_0x275624){while(--_0x275624){_0x388451['push'](_0x388451['shift']());}};_0xed4eda(++_0x840114);}(_0x3236,0x186));var _0x6323=function(_0x18efbf,_0xe7acda){_0x18efbf=_0x18efbf-0x0;var _0xa59f0d=_0x3236[_0x18efbf];return _0xa59f0d;};'use strict';var client=require('../client');exports[_0x6323('0x0')]=function(_0xd62ea6){return function(){return client['Request'](_0x6323('0x1'),{'body':_0xd62ea6,'log':'CreateCmContact'});};};exports[_0x6323('0x2')]=function(_0x50fa8a){return function(){return client[_0x6323('0x3')](_0x6323('0x4'),{'options':_0x50fa8a,'log':_0x6323('0x4')});};};
\ No newline at end of file
+var _0x38e0=['createContact','Request','getContacts','GetCmContact','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x38e0,0x1e4));var _0x038e=function(_0x13d430,_0xfe5f60){_0x13d430=_0x13d430-0x0;var _0x40d925=_0x38e0[_0x13d430];return _0x40d925;};'use strict';var client=require(_0x038e('0x0'));exports[_0x038e('0x1')]=function(_0xc8c090){return function(){return client[_0x038e('0x2')]('CreateCmContact',{'body':_0xc8c090,'log':'CreateCmContact'});};};exports[_0x038e('0x3')]=function(_0x1da75b){return function(){return client[_0x038e('0x2')](_0x038e('0x4'),{'options':_0x1da75b,'log':'GetCmContact'});};};
\ No newline at end of file
index a9c272d..a8f9879 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe94=['resetActiveCalls','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','handlePreviewRecallNotifications','lodash','getContacts','GetCmHopper','CmContact','Contact','getCmHopper','Request','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','ContactId','ListId','rescheduleContact','destroyContact','getContactDialer','GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr','GetContactDialerIvr','queue','MoveContactManagedDialer','VoiceQueueId','CampaignId','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','Agent','name','VoiceQueue','unlockContact','getContactRecallMe','GetContactRecallMe','User','voicePause'];(function(_0x588a19,_0x11b899){var _0x2c520a=function(_0x5d65d6){while(--_0x5d65d6){_0x588a19['push'](_0x588a19['shift']());}};_0x2c520a(++_0x11b899);}(_0xfe94,0x1d2));var _0x4fe9=function(_0x11abfe,_0x26ad7d){_0x11abfe=_0x11abfe-0x0;var _0x1cadcd=_0xfe94[_0x11abfe];return _0x1cadcd;};'use strict';var client=require('../client');var moment=require('moment');var _=require(_0x4fe9('0x0'));exports[_0x4fe9('0x1')]=function(_0x3bf63d,_0x3bf444){return function(){return client['Request'](_0x4fe9('0x2'),{'options':{'where':{'VoiceQueueId':_0x3bf63d},'include':[{'model':_0x4fe9('0x3'),'as':_0x4fe9('0x4')}],'limit':_0x3bf444,'raw':![]},'log':_0x4fe9('0x5')});};};exports['updateContacts']=function(_0xf49e73,_0x15abe0,_0xdb9545){return function(){return client[_0x4fe9('0x6')](_0x4fe9('0x7'),{'body':_0xf49e73,'options':{'where':{'VoiceQueueId':_0x15abe0,'scheduledat':{'$lte':moment()[_0x4fe9('0x8')](_0x4fe9('0x9'))}},'limit':_0xdb9545},'log':_0x4fe9('0x7')});};};exports['rescheduleContact']=function(_0x5e8d95){return function(){return client[_0x4fe9('0x6')](_0x4fe9('0x7'),{'body':_0x5e8d95,'options':{'where':{'ContactId':_0x5e8d95[_0x4fe9('0xa')],'ListId':_0x5e8d95[_0x4fe9('0xb')],'VoiceQueueId':_0x5e8d95['VoiceQueueId'],'CampaignId':_0x5e8d95['CampaignId']}},'log':_0x4fe9('0xc')});};};exports[_0x4fe9('0xd')]=function(_0x481256,_0x347ebc,_0x35c1eb){return function(){return client[_0x4fe9('0x6')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x481256,'ListId':_0x347ebc,'ContactId':_0x35c1eb}},'log':'DestroyCmHopper'});};};exports[_0x4fe9('0xe')]=function(_0x147f9e,_0x53f04c,_0x57180f,_0xba61af){return function(){return client[_0x4fe9('0x6')](_0x4fe9('0xf'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x147f9e,'active':![],'scheduledat':{'$lte':moment()[_0x4fe9('0x8')](_0x4fe9('0x9'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x53f04c}}]},'order':[[_0x4fe9('0x10'),_0x4fe9('0x11')],[_0x4fe9('0x12'),_0xba61af],['id',_0x4fe9('0x13')]],'raw':!![],'limit':_0x57180f},'log':_0x4fe9('0xf')});};};exports[_0x4fe9('0x14')]=function(_0x2b5f40,_0x16c4fa,_0x5365fd){return function(){return client['Request'](_0x4fe9('0xf'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2b5f40,'active':![],'scheduledat':{'$lte':moment()[_0x4fe9('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0x4fe9('0x3'),'as':_0x4fe9('0x4')}],'order':[['priority',_0x4fe9('0x11')],[_0x4fe9('0x12'),_0x5365fd],['id',_0x4fe9('0x13')]],'raw':!![],'limit':_0x16c4fa},'log':_0x4fe9('0x15')});};};exports['moveContactManagedDialer']=function(_0x3297d1,_0x1df1d5){return function(){_0x3297d1['campaign']=_0x3297d1[_0x4fe9('0x16')];return client[_0x4fe9('0x6')](_0x4fe9('0x17'),{'body':_0x3297d1,'options':{'where':{'ContactId':_0x3297d1[_0x4fe9('0xa')],'ListId':_0x3297d1[_0x4fe9('0xb')],'VoiceQueueId':_0x3297d1[_0x4fe9('0x18')],'CampaignId':_0x3297d1[_0x4fe9('0x19')],'active':_0x1df1d5?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0x4fe9('0x1a')]=function(_0x29517b){return function(){return client[_0x4fe9('0x6')](_0x4fe9('0x1b'),{'options':{'where':{'VoiceQueueId':_0x29517b['id']?_0x29517b['id']||null:null}},'log':_0x4fe9('0x1a')});};};exports[_0x4fe9('0x1c')]=function(_0x438c01){return function(){return client['Request'](_0x4fe9('0x1d'),{'options':{'where':{'id':_0x438c01},'include':[{'model':_0x4fe9('0x3'),'as':_0x4fe9('0x4')},{'model':'User','as':_0x4fe9('0x1e'),'attributes':['id',_0x4fe9('0x1f')]},{'model':_0x4fe9('0x20'),'as':'Queue','attributes':['id',_0x4fe9('0x1f')]}],'raw':!![]},'log':'getCmHopper'});};};exports[_0x4fe9('0x21')]=function(_0x42841b,_0x4acfda,_0x5a9ceb){return function(){return client[_0x4fe9('0x6')]('UpdateCmHopper',{'body':_0x42841b,'options':{'where':{'id':_0x4acfda},'limit':_0x5a9ceb},'log':_0x4fe9('0x7')});};};exports[_0x4fe9('0x22')]=function(_0x527071,_0x29b9cd){return function(){return client[_0x4fe9('0x6')](_0x4fe9('0x23'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x527071,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x4fe9('0x8')](_0x4fe9('0x9'))},'UserId':{'$in':_0x29b9cd}},'order':[[_0x4fe9('0x10'),_0x4fe9('0x11')],[_0x4fe9('0x12'),_0x4fe9('0x11')],['id',_0x4fe9('0x13')]],'include':[{'model':_0x4fe9('0x3'),'as':_0x4fe9('0x4')},{'model':_0x4fe9('0x24'),'as':_0x4fe9('0x1e'),'attributes':['id','name',_0x4fe9('0x25')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x4fe9('0xf')});};};exports[_0x4fe9('0x26')]=function(_0x303cc4){return function(){return client[_0x4fe9('0x6')](_0x4fe9('0x27'),{'body':_0x303cc4,'options':{},'log':_0x4fe9('0x27')});};};exports['handlePreviewRecallNotifications']=function(_0xa4ea18,_0x431b5d){return function(){return client[_0x4fe9('0x6')](_0x4fe9('0x28'),{'body':{'where':{'voiceQueueId':_0xa4ea18,'interval':_0x431b5d}},'log':_0x4fe9('0x29')});};};
\ No newline at end of file
+var _0x917b=['getContactRecallMe','GetContactRecallMe','Agent','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','moment','lodash','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','scheduledat','ASC','getContactDialerIvr','GetContactDialer','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','User','VoiceQueue','Queue','unlockContact'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x917b,0x117));var _0xb917=function(_0x5e2dfc,_0x2b4c21){_0x5e2dfc=_0x5e2dfc-0x0;var _0x187a97=_0x917b[_0x5e2dfc];return _0x187a97;};'use strict';var client=require('../client');var moment=require(_0xb917('0x0'));var _=require(_0xb917('0x1'));exports[_0xb917('0x2')]=function(_0x3f81f4,_0xdec273){return function(){return client[_0xb917('0x3')](_0xb917('0x4'),{'options':{'where':{'VoiceQueueId':_0x3f81f4},'include':[{'model':_0xb917('0x5'),'as':_0xb917('0x6')}],'limit':_0xdec273,'raw':![]},'log':_0xb917('0x7')});};};exports[_0xb917('0x8')]=function(_0x420f48,_0x53e6d2,_0x444089){return function(){return client[_0xb917('0x3')](_0xb917('0x9'),{'body':_0x420f48,'options':{'where':{'VoiceQueueId':_0x53e6d2,'scheduledat':{'$lte':moment()[_0xb917('0xa')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x444089},'log':_0xb917('0x9')});};};exports['rescheduleContact']=function(_0x5eb24f){return function(){return client[_0xb917('0x3')](_0xb917('0x9'),{'body':_0x5eb24f,'options':{'where':{'ContactId':_0x5eb24f[_0xb917('0xb')],'ListId':_0x5eb24f[_0xb917('0xc')],'VoiceQueueId':_0x5eb24f[_0xb917('0xd')],'CampaignId':_0x5eb24f[_0xb917('0xe')]}},'log':'rescheduleContact'});};};exports[_0xb917('0xf')]=function(_0x57cac4,_0x406469,_0x55b0a7){return function(){return client['Request'](_0xb917('0x10'),{'options':{'where':{'VoiceQueueId':_0x57cac4,'ListId':_0x406469,'ContactId':_0x55b0a7}},'log':_0xb917('0x10')});};};exports[_0xb917('0x11')]=function(_0x169fe6,_0x4b326d,_0x4ef535,_0x181fb2){return function(){return client[_0xb917('0x3')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x169fe6,'active':![],'scheduledat':{'$lte':moment()[_0xb917('0xa')](_0xb917('0x12'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x4b326d}}]},'order':[[_0xb917('0x13'),_0xb917('0x14')],[_0xb917('0x15'),_0x181fb2],['id',_0xb917('0x16')]],'raw':!![],'limit':_0x4ef535},'log':'GetContactDialer'});};};exports[_0xb917('0x17')]=function(_0x25160a,_0x9478e6,_0x3da651){return function(){return client['Request'](_0xb917('0x18'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x25160a,'active':![],'scheduledat':{'$lte':moment()['format'](_0xb917('0x12'))}},'include':[{'model':_0xb917('0x5'),'as':'Contact'}],'order':[[_0xb917('0x13'),_0xb917('0x14')],[_0xb917('0x15'),_0x3da651],['id',_0xb917('0x16')]],'raw':!![],'limit':_0x9478e6},'log':'GetContactDialerIvr'});};};exports[_0xb917('0x19')]=function(_0x74141b,_0x287c87){return function(){_0x74141b[_0xb917('0x1a')]=_0x74141b[_0xb917('0x1b')];return client['Request'](_0xb917('0x1c'),{'body':_0x74141b,'options':{'where':{'ContactId':_0x74141b[_0xb917('0xb')],'ListId':_0x74141b[_0xb917('0xc')],'VoiceQueueId':_0x74141b['VoiceQueueId'],'CampaignId':_0x74141b['CampaignId'],'active':_0x287c87?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0xb917('0x1d')]=function(_0x13fbc3){return function(){return client[_0xb917('0x3')](_0xb917('0x1e'),{'options':{'where':{'VoiceQueueId':_0x13fbc3['id']?_0x13fbc3['id']||null:null}},'log':_0xb917('0x1d')});};};exports[_0xb917('0x1f')]=function(_0x14d03d){return function(){return client[_0xb917('0x3')]('GetCmHopperPreview',{'options':{'where':{'id':_0x14d03d},'include':[{'model':_0xb917('0x5'),'as':_0xb917('0x6')},{'model':_0xb917('0x20'),'as':'Agent','attributes':['id','name']},{'model':_0xb917('0x21'),'as':_0xb917('0x22'),'attributes':['id','name']}],'raw':!![]},'log':'getCmHopper'});};};exports[_0xb917('0x23')]=function(_0x3b40d7,_0x269f21,_0x2b7df9){return function(){return client[_0xb917('0x3')](_0xb917('0x9'),{'body':_0x3b40d7,'options':{'where':{'id':_0x269f21},'limit':_0x2b7df9},'log':_0xb917('0x9')});};};exports[_0xb917('0x24')]=function(_0x454eaf,_0x2706b1){return function(){return client['Request'](_0xb917('0x25'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x454eaf,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xb917('0xa')](_0xb917('0x12'))},'UserId':{'$in':_0x2706b1}},'order':[[_0xb917('0x13'),_0xb917('0x14')],[_0xb917('0x15'),_0xb917('0x14')],['id',_0xb917('0x16')]],'include':[{'model':'CmContact','as':'Contact'},{'model':'User','as':_0xb917('0x26'),'attributes':['id','name',_0xb917('0x27')]}],'group':_0xb917('0x28'),'raw':!![]},'log':_0xb917('0x18')});};};exports[_0xb917('0x29')]=function(_0x492575){return function(){return client[_0xb917('0x3')](_0xb917('0x2a'),{'body':_0x492575,'options':{},'log':'ResetActiveCalls'});};};exports[_0xb917('0x2b')]=function(_0x117ee4,_0x5cc626){return function(){return client[_0xb917('0x3')](_0xb917('0x2c'),{'body':{'where':{'voiceQueueId':_0x117ee4,'interval':_0x5cc626}},'log':'handlePreviewRecallNotifications'});};};
\ No newline at end of file
index f417afe..b8073df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f8=['checkIsBlackList','Request','GetCmHopperBlack','VoiceQueueId','Contact','phone','checkIsBlackListIvr','GetCmHopperBlackIvr'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0x57f8,0x198));var _0x857f=function(_0x50576c,_0x502d9c){_0x50576c=_0x50576c-0x0;var _0x22c1ef=_0x57f8[_0x50576c];return _0x22c1ef;};'use strict';var client=require('../client');exports[_0x857f('0x0')]=function(_0x57a538){return function(){return client[_0x857f('0x1')](_0x857f('0x2'),{'options':{'where':{'VoiceQueueId':_0x57a538[_0x857f('0x3')],'phone':_0x57a538[_0x857f('0x4')][_0x857f('0x5')]},'raw':![]},'log':_0x857f('0x2')});};};exports[_0x857f('0x6')]=function(_0xced48e){return function(){return client[_0x857f('0x1')](_0x857f('0x2'),{'options':{'where':{'CampaignId':_0xced48e['CampaignId'],'phone':_0xced48e[_0x857f('0x4')][_0x857f('0x5')]},'raw':![]},'log':_0x857f('0x7')});};};
\ No newline at end of file
+var _0xe820=['GetCmHopperBlack','CampaignId','../client','VoiceQueueId','Contact','phone','checkIsBlackListIvr','Request'];(function(_0x276d91,_0x3eb812){var _0x1f1823=function(_0x4682c7){while(--_0x4682c7){_0x276d91['push'](_0x276d91['shift']());}};_0x1f1823(++_0x3eb812);}(_0xe820,0xd2));var _0x0e82=function(_0xac895a,_0x2e2e04){_0xac895a=_0xac895a-0x0;var _0x3b3693=_0xe820[_0xac895a];return _0x3b3693;};'use strict';var client=require(_0x0e82('0x0'));exports['checkIsBlackList']=function(_0x908a54){return function(){return client['Request']('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x908a54[_0x0e82('0x1')],'phone':_0x908a54[_0x0e82('0x2')][_0x0e82('0x3')]},'raw':![]},'log':'GetCmHopperBlack'});};};exports[_0x0e82('0x4')]=function(_0x5de50f){return function(){return client[_0x0e82('0x5')](_0x0e82('0x6'),{'options':{'where':{'CampaignId':_0x5de50f[_0x0e82('0x7')],'phone':_0x5de50f[_0x0e82('0x2')][_0x0e82('0x3')]},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
index 4803500..c0961ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd627=['CreateCmHopperFinal','../client','Request'];(function(_0x34c0ac,_0x1cc797){var _0x292649=function(_0x58cc3d){while(--_0x58cc3d){_0x34c0ac['push'](_0x34c0ac['shift']());}};_0x292649(++_0x1cc797);}(_0xd627,0x85));var _0x7d62=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0xd627[_0x54ccd7];return _0x4e667b;};'use strict';var client=require(_0x7d62('0x0'));exports['createContact']=function(_0x16fe7b){return function(){_0x16fe7b['campaign']=_0x16fe7b['queue'];return client[_0x7d62('0x1')](_0x7d62('0x2'),{'body':_0x16fe7b,'log':_0x7d62('0x2')});};};
\ No newline at end of file
+var _0x5bfa=['../client','createContact','campaign','queue','Request','CreateCmHopperFinal'];(function(_0x14a794,_0x4e6986){var _0x4205fe=function(_0x3ec4b2){while(--_0x3ec4b2){_0x14a794['push'](_0x14a794['shift']());}};_0x4205fe(++_0x4e6986);}(_0x5bfa,0xea));var _0xa5bf=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x5bfa[_0x5a776b];return _0xbbef59;};'use strict';var client=require(_0xa5bf('0x0'));exports[_0xa5bf('0x1')]=function(_0x31a274){return function(){_0x31a274[_0xa5bf('0x2')]=_0x31a274[_0xa5bf('0x3')];return client[_0xa5bf('0x4')]('CreateCmHopperFinal',{'body':_0x31a274,'log':_0xa5bf('0x5')});};};
\ No newline at end of file
index e3a1c95..24546f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cda=['../client','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','getCampaignHopperHistory','GetCampaignHopperHistory','endOf','ivr'];(function(_0x314154,_0xc7903d){var _0x4fe6c7=function(_0xd8a0a){while(--_0xd8a0a){_0x314154['push'](_0x314154['shift']());}};_0x4fe6c7(++_0xc7903d);}(_0x1cda,0xb0));var _0xa1cd=function(_0x4ba8bb,_0x11a9bb){_0x4ba8bb=_0x4ba8bb-0x0;var _0x5826e2=_0x1cda[_0x4ba8bb];return _0x5826e2;};'use strict';var client=require(_0xa1cd('0x0'));var moment=require(_0xa1cd('0x1'));exports[_0xa1cd('0x2')]=function(_0x140000){return function(){_0x140000[_0xa1cd('0x3')]=_0x140000[_0xa1cd('0x4')];return client[_0xa1cd('0x5')](_0xa1cd('0x6'),{'body':_0x140000,'log':_0xa1cd('0x6')});};};exports[_0xa1cd('0x7')]=function(_0x26e4e5){return function(){return client[_0xa1cd('0x5')](_0xa1cd('0x8'),{'options':{'where':{'endtime':{'$between':[moment()[_0xa1cd('0x9')](_0x26e4e5,_0xa1cd('0xa'))[_0xa1cd('0xb')](_0xa1cd('0xc')),moment()['format'](_0xa1cd('0xc'))]}},'raw':![]},'log':_0xa1cd('0xd')});};};exports[_0xa1cd('0xe')]=function(_0x5a3a4a){return function(){return client['Request'](_0xa1cd('0xf'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xa1cd('0x10')](_0xa1cd('0x11'))[_0xa1cd('0xb')](_0xa1cd('0xc')),moment()['endOf'](_0xa1cd('0x11'))[_0xa1cd('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':'queue'},'raw':![]},'log':_0xa1cd('0xf')});};};exports[_0xa1cd('0x12')]=function(_0x2b95b0){return function(){return client[_0xa1cd('0x5')](_0xa1cd('0x13'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xa1cd('0x11'))[_0xa1cd('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xa1cd('0x14')]('day')[_0xa1cd('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0xa1cd('0x15')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
+var _0x0e1c=['minutes','format','YYYY-MM-DD\x20HH:mm:ss','getVoiceQueueHopperHistory','startOf','day','GetVoiceQueueHopperHistory','getCampaignHopperHistory','GetCampaignHopperHistory','endOf','../client','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract'];(function(_0x41da88,_0x23d1ce){var _0x18abd0=function(_0x2b80dc){while(--_0x2b80dc){_0x41da88['push'](_0x41da88['shift']());}};_0x18abd0(++_0x23d1ce);}(_0x0e1c,0x172));var _0xc0e1=function(_0x471eb9,_0x590161){_0x471eb9=_0x471eb9-0x0;var _0x18a718=_0x0e1c[_0x471eb9];return _0x18a718;};'use strict';var client=require(_0xc0e1('0x0'));var moment=require(_0xc0e1('0x1'));exports[_0xc0e1('0x2')]=function(_0x510e26){return function(){_0x510e26[_0xc0e1('0x3')]=_0x510e26[_0xc0e1('0x4')];return client[_0xc0e1('0x5')](_0xc0e1('0x6'),{'body':_0x510e26,'log':_0xc0e1('0x6')});};};exports[_0xc0e1('0x7')]=function(_0x2f9a05){return function(){return client[_0xc0e1('0x5')](_0xc0e1('0x8'),{'options':{'where':{'endtime':{'$between':[moment()[_0xc0e1('0x9')](_0x2f9a05,_0xc0e1('0xa'))[_0xc0e1('0xb')](_0xc0e1('0xc')),moment()['format'](_0xc0e1('0xc'))]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports[_0xc0e1('0xd')]=function(_0x4a20be){return function(){return client[_0xc0e1('0x5')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xc0e1('0xe')](_0xc0e1('0xf'))[_0xc0e1('0xb')](_0xc0e1('0xc')),moment()['endOf'](_0xc0e1('0xf'))[_0xc0e1('0xb')](_0xc0e1('0xc'))]},'campaigntype':_0xc0e1('0x4')},'raw':![]},'log':_0xc0e1('0x10')});};};exports[_0xc0e1('0x11')]=function(_0x177dbd){return function(){return client[_0xc0e1('0x5')](_0xc0e1('0x12'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xc0e1('0xe')](_0xc0e1('0xf'))[_0xc0e1('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc0e1('0x13')]('day')[_0xc0e1('0xb')](_0xc0e1('0xc'))]},'campaigntype':'ivr'},'raw':![]},'log':_0xc0e1('0x12')});};};
\ No newline at end of file
index e6372fb..d39a14c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5c1=['description','headerinfo','localstationid','minrate','maxrate','modem','gateway','t38timeout','TrunkId','ListId','key','Trunk','callerid','active','notify','NotifyFaxAccount','../client','getFaxAccounts','Request'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x28f792,_0x1965a6){_0x28f792=_0x28f792-0x0;var _0x330fa6=_0xa5c1[_0x28f792];return _0x330fa6;};'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
+var _0x6629=['t38timeout','TrunkId','key','Trunk','callerid','active','getFaxAccount','notify','Request','NotifyFaxAccount','../client','GetFaxAccount','name','description','ecm','localstationid','minrate','maxrate','gateway','faxdetect'];(function(_0x4c367b,_0x2f749e){var _0x122fcb=function(_0x43d063){while(--_0x43d063){_0x4c367b['push'](_0x4c367b['shift']());}};_0x122fcb(++_0x2f749e);}(_0x6629,0x1c2));var _0x9662=function(_0x2bd6e7,_0x1bcfc8){_0x2bd6e7=_0x2bd6e7-0x0;var _0x4c2564=_0x6629[_0x2bd6e7];return _0x4c2564;};'use strict';var client=require(_0x9662('0x0'));exports['getFaxAccounts']=function(){return function(){return client['Request'](_0x9662('0x1'),{'options':{'raw':![],'attributes':['id',_0x9662('0x2'),_0x9662('0x3'),_0x9662('0x4'),'headerinfo',_0x9662('0x5'),_0x9662('0x6'),_0x9662('0x7'),'modem',_0x9662('0x8'),_0x9662('0x9'),_0x9662('0xa'),'tech',_0x9662('0xb'),'ListId',_0x9662('0xc')],'include':[{'model':_0x9662('0xd'),'as':_0x9662('0xd'),'attributes':['id',_0x9662('0x2'),_0x9662('0xe'),_0x9662('0xf')]}]},'log':_0x9662('0x10')});};};exports[_0x9662('0x11')]=function(_0x3bb261,_0x3202d8){return client[_0x9662('0x12')]('NotifyFaxAccount',{'account':{'id':_0x3bb261},'body':_0x3202d8,'log':_0x9662('0x13')});};
\ No newline at end of file
index b75d860..0d789fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb0=['Request','UpdateFaxMessage','update'];(function(_0x4777db,_0x5684e6){var _0x54773c=function(_0x18a5ac){while(--_0x18a5ac){_0x4777db['push'](_0x4777db['shift']());}};_0x54773c(++_0x5684e6);}(_0x5eb0,0x68));var _0x05eb=function(_0x121b06,_0x53b76b){_0x121b06=_0x121b06-0x0;var _0x25da8c=_0x5eb0[_0x121b06];return _0x25da8c;};'use strict';var client=require('../client');exports[_0x05eb('0x0')]=function(_0x2df957,_0x77515e){return client[_0x05eb('0x1')](_0x05eb('0x2'),{'body':_0x77515e,'options':{'where':{'AttachmentId':_0x2df957}},'log':_0x05eb('0x2')});};
\ No newline at end of file
+var _0x2dfb=['../client','update','Request','UpdateFaxMessage'];(function(_0x18e7d4,_0x15ae91){var _0x4a657e=function(_0xc3290){while(--_0xc3290){_0x18e7d4['push'](_0x18e7d4['shift']());}};_0x4a657e(++_0x15ae91);}(_0x2dfb,0xbc));var _0xb2df=function(_0x5e275e,_0x190a72){_0x5e275e=_0x5e275e-0x0;var _0x969919=_0x2dfb[_0x5e275e];return _0x969919;};'use strict';var client=require(_0xb2df('0x0'));exports[_0xb2df('0x1')]=function(_0x5461d8,_0x2e6439){return client[_0xb2df('0x2')](_0xb2df('0x3'),{'body':_0x2e6439,'options':{'where':{'AttachmentId':_0x5461d8}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
index 2a79cf9..b171bf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1ce=['variableName','Variable','Descriptions','content','key','keyContent','type','idField','nameField','customField','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','remoteUri','authType','DeskConfiguration','DeskField','Subjects'];(function(_0x13f2ec,_0x407206){var _0x389ca9=function(_0x43d7d6){while(--_0x43d7d6){_0x13f2ec['push'](_0x13f2ec['shift']());}};_0x389ca9(++_0x407206);}(_0xb1ce,0x1bb));var _0xeb1c=function(_0x1f46b0,_0x539013){_0x1f46b0=_0x1f46b0-0x0;var _0x5e4365=_0xb1ce[_0x1f46b0];return _0x5e4365;};'use strict';var client=require(_0xeb1c('0x0'));exports[_0xeb1c('0x1')]=function(){return function(_0x33cac1){return client[_0xeb1c('0x2')](_0xeb1c('0x3'),{'options':{'raw':![],'attributes':['id',_0xeb1c('0x4'),_0xeb1c('0x5'),_0xeb1c('0x6'),_0xeb1c('0x7'),_0xeb1c('0x8'),_0xeb1c('0x9'),'type','serverUrl'],'include':[{'model':_0xeb1c('0xa'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0xeb1c('0xb'),'as':_0xeb1c('0xc'),'attributes':['id','type','content',_0xeb1c('0xd')],'include':[{'model':_0xeb1c('0xe'),'as':_0xeb1c('0xe'),'attributes':['id','name']}]},{'model':_0xeb1c('0xb'),'as':_0xeb1c('0xf'),'attributes':['id','type',_0xeb1c('0x10'),_0xeb1c('0x11'),'keyType',_0xeb1c('0x12'),'variableName'],'include':[{'model':_0xeb1c('0xe'),'as':_0xeb1c('0xe'),'attributes':['id',_0xeb1c('0x4')]}]},{'model':_0xeb1c('0xb'),'as':'Fields','attributes':['id',_0xeb1c('0x13'),_0xeb1c('0x10'),_0xeb1c('0x14'),_0xeb1c('0x15'),_0xeb1c('0x16'),_0xeb1c('0xd')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xeb1c('0x4')]}]},{'model':'Tag','as':_0xeb1c('0x17'),'attributes':['id',_0xeb1c('0x4')]}]}]},'log':_0xeb1c('0x3')});};};
\ No newline at end of file
+var _0xe26c=['authType','DeskConfiguration','Configurations','DeskField','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','customField','Tag','../../client','Request','GetDeskAccount','name','description','username','password','remoteUri'];(function(_0x47e6ac,_0x174b8d){var _0x2660f8=function(_0x24f343){while(--_0x24f343){_0x47e6ac['push'](_0x47e6ac['shift']());}};_0x2660f8(++_0x174b8d);}(_0xe26c,0x1ec));var _0xce26=function(_0x42845a,_0x15ad68){_0x42845a=_0x42845a-0x0;var _0xe7d723=_0xe26c[_0x42845a];return _0xe7d723;};'use strict';var client=require(_0xce26('0x0'));exports['getDeskAccounts']=function(){return function(_0x11d87d){return client[_0xce26('0x1')](_0xce26('0x2'),{'options':{'raw':![],'attributes':['id',_0xce26('0x3'),_0xce26('0x4'),_0xce26('0x5'),_0xce26('0x6'),_0xce26('0x7'),_0xce26('0x8'),'type','serverUrl'],'include':[{'model':_0xce26('0x9'),'as':_0xce26('0xa'),'attributes':['id','name'],'include':[{'model':_0xce26('0xb'),'as':'Subjects','attributes':['id',_0xce26('0xc'),_0xce26('0xd'),_0xce26('0xe')],'include':[{'model':_0xce26('0xf'),'as':_0xce26('0xf'),'attributes':['id',_0xce26('0x3')]}]},{'model':_0xce26('0xb'),'as':_0xce26('0x10'),'attributes':['id','type',_0xce26('0xd'),_0xce26('0x11'),_0xce26('0x12'),_0xce26('0x13'),_0xce26('0xe')],'include':[{'model':_0xce26('0xf'),'as':'Variable','attributes':['id',_0xce26('0x3')]}]},{'model':_0xce26('0xb'),'as':_0xce26('0x14'),'attributes':['id','type',_0xce26('0xd'),_0xce26('0x15'),_0xce26('0x16'),_0xce26('0x17'),_0xce26('0xe')],'include':[{'model':_0xce26('0xf'),'as':_0xce26('0xf'),'attributes':['id',_0xce26('0x3')]}]},{'model':_0xce26('0x18'),'as':'Tags','attributes':['id',_0xce26('0x3')]}]}]},'log':_0xce26('0x2')});};};
\ No newline at end of file
index 1d037a9..467e664 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdace=['tenantId','clientSecret','serverUrl','description','Dynamics365Configuration','Configurations','name','moduleCreate','Dynamics365Field','Subjects','variableName','Variable','Descriptions','content','keyType','keyContent','Fields','idField','nameField','customField','CloudProvider','data2','data5','../../client','Request','GetDynamics365Account','username','password','remoteUri'];(function(_0x192fed,_0x3f6d20){var _0x1f9dce=function(_0x28ad42){while(--_0x28ad42){_0x192fed['push'](_0x192fed['shift']());}};_0x1f9dce(++_0x3f6d20);}(_0xdace,0xc5));var _0xedac=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xdace[_0x174ef5];return _0x1cc379;};'use strict';var client=require(_0xedac('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x1c76b2){return client[_0xedac('0x1')](_0xedac('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xedac('0x3'),_0xedac('0x4'),_0xedac('0x5'),_0xedac('0x6'),'clientId',_0xedac('0x7'),_0xedac('0x8'),_0xedac('0x9'),'modernAuthentication'],'include':[{'model':_0xedac('0xa'),'as':_0xedac('0xb'),'attributes':['id',_0xedac('0xc'),'ticketType',_0xedac('0xd')],'include':[{'model':_0xedac('0xe'),'as':_0xedac('0xf'),'attributes':['id','type','content',_0xedac('0x10')],'include':[{'model':_0xedac('0x11'),'as':'Variable','attributes':['id','name']}]},{'model':_0xedac('0xe'),'as':_0xedac('0x12'),'attributes':['id','type',_0xedac('0x13'),'key',_0xedac('0x14'),_0xedac('0x15'),_0xedac('0x10')],'include':[{'model':_0xedac('0x11'),'as':_0xedac('0x11'),'attributes':['id',_0xedac('0xc')]}]},{'model':_0xedac('0xe'),'as':_0xedac('0x16'),'attributes':['id','type',_0xedac('0x13'),_0xedac('0x17'),_0xedac('0x18'),_0xedac('0x19'),_0xedac('0x10')],'include':[{'model':'Variable','as':_0xedac('0x11'),'attributes':['id','name']}]}]},{'model':_0xedac('0x1a'),'as':_0xedac('0x1a'),'attributes':['id',_0xedac('0x1b'),_0xedac('0x1c'),'data7']}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
+var _0xf109=['variableName','Variable','Descriptions','content','keyType','keyContent','name','Fields','nameField','customField','CloudProvider','data2','data5','GetDynamics365Account','../../client','getDynamics365Accounts','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','description','modernAuthentication','Dynamics365Configuration','Configurations','ticketType','moduleCreate','Dynamics365Field','Subjects','type'];(function(_0x50305d,_0x1fe9e2){var _0x4114a5=function(_0x15b468){while(--_0x15b468){_0x50305d['push'](_0x50305d['shift']());}};_0x4114a5(++_0x1fe9e2);}(_0xf109,0xce));var _0x9f10=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf109[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0x9f10('0x0'));exports[_0x9f10('0x1')]=function(){return function(_0x44c4f2){return client['Request']('GetDynamics365Account',{'options':{'raw':![],'attributes':['id','name',_0x9f10('0x2'),_0x9f10('0x3'),_0x9f10('0x4'),_0x9f10('0x5'),_0x9f10('0x6'),_0x9f10('0x7'),_0x9f10('0x8'),_0x9f10('0x9'),_0x9f10('0xa')],'include':[{'model':_0x9f10('0xb'),'as':_0x9f10('0xc'),'attributes':['id','name',_0x9f10('0xd'),_0x9f10('0xe')],'include':[{'model':_0x9f10('0xf'),'as':_0x9f10('0x10'),'attributes':['id',_0x9f10('0x11'),'content',_0x9f10('0x12')],'include':[{'model':_0x9f10('0x13'),'as':_0x9f10('0x13'),'attributes':['id','name']}]},{'model':'Dynamics365Field','as':_0x9f10('0x14'),'attributes':['id',_0x9f10('0x11'),_0x9f10('0x15'),'key',_0x9f10('0x16'),_0x9f10('0x17'),_0x9f10('0x12')],'include':[{'model':'Variable','as':_0x9f10('0x13'),'attributes':['id',_0x9f10('0x18')]}]},{'model':'Dynamics365Field','as':_0x9f10('0x19'),'attributes':['id',_0x9f10('0x11'),'content','idField',_0x9f10('0x1a'),_0x9f10('0x1b'),'variableName'],'include':[{'model':_0x9f10('0x13'),'as':'Variable','attributes':['id',_0x9f10('0x18')]}]}]},{'model':_0x9f10('0x1c'),'as':'CloudProvider','attributes':['id',_0x9f10('0x1d'),_0x9f10('0x1e'),'data7']}]},'log':_0x9f10('0x1f')});};};
\ No newline at end of file
index 6bbad0a..4978050 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e5=['customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','apiKey','FreshdeskConfiguration','FreshdeskField','Variable','Descriptions','type','content','key','keyContent','nameField'];(function(_0x44483c,_0x2f3473){var _0x32b136=function(_0x9d3307){while(--_0x9d3307){_0x44483c['push'](_0x44483c['shift']());}};_0x32b136(++_0x2f3473);}(_0x58e5,0xd1));var _0x558e=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x58e5[_0x176329];return _0x31997c;};'use strict';var client=require(_0x558e('0x0'));exports[_0x558e('0x1')]=function(){return function(_0x41331c){return client[_0x558e('0x2')](_0x558e('0x3'),{'options':{'raw':![],'attributes':['id',_0x558e('0x4'),'username',_0x558e('0x5'),'remoteUri','serverUrl'],'include':[{'model':_0x558e('0x6'),'as':'Configurations','attributes':['id',_0x558e('0x4')],'include':[{'model':'Tag','attributes':['id',_0x558e('0x4')]},{'model':_0x558e('0x7'),'as':'Subjects','attributes':['id','type','content','variableName'],'include':[{'model':'Variable','as':_0x558e('0x8'),'attributes':['id',_0x558e('0x4')]}]},{'model':'FreshdeskField','as':_0x558e('0x9'),'attributes':['id',_0x558e('0xa'),_0x558e('0xb'),_0x558e('0xc'),'keyType',_0x558e('0xd'),'variableName'],'include':[{'model':_0x558e('0x8'),'as':_0x558e('0x8'),'attributes':['id',_0x558e('0x4')]}]},{'model':_0x558e('0x7'),'as':'Fields','attributes':['id',_0x558e('0xa'),_0x558e('0xb'),'idField',_0x558e('0xe'),_0x558e('0xf'),'variableName'],'include':[{'model':_0x558e('0x8'),'as':'Variable','attributes':['id',_0x558e('0x4')]}]}]}]},'log':_0x558e('0x3')});};};
\ No newline at end of file
+var _0x4f08=['Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','FreshdeskField','idField','nameField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','username','apiKey','remoteUri','FreshdeskConfiguration','name','Tag'];(function(_0x263ed5,_0x9b8324){var _0x5cd77c=function(_0x30db62){while(--_0x30db62){_0x263ed5['push'](_0x263ed5['shift']());}};_0x5cd77c(++_0x9b8324);}(_0x4f08,0x194));var _0x84f0=function(_0x2d90d5,_0x49e0fe){_0x2d90d5=_0x2d90d5-0x0;var _0x3453e6=_0x4f08[_0x2d90d5];return _0x3453e6;};'use strict';var client=require(_0x84f0('0x0'));exports[_0x84f0('0x1')]=function(){return function(_0x4bff2d){return client[_0x84f0('0x2')](_0x84f0('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x84f0('0x4'),_0x84f0('0x5'),_0x84f0('0x6'),'serverUrl'],'include':[{'model':_0x84f0('0x7'),'as':'Configurations','attributes':['id',_0x84f0('0x8')],'include':[{'model':_0x84f0('0x9'),'attributes':['id',_0x84f0('0x8')]},{'model':'FreshdeskField','as':_0x84f0('0xa'),'attributes':['id',_0x84f0('0xb'),_0x84f0('0xc'),_0x84f0('0xd')],'include':[{'model':_0x84f0('0xe'),'as':_0x84f0('0xe'),'attributes':['id','name']}]},{'model':'FreshdeskField','as':_0x84f0('0xf'),'attributes':['id',_0x84f0('0xb'),_0x84f0('0xc'),_0x84f0('0x10'),_0x84f0('0x11'),_0x84f0('0x12'),_0x84f0('0xd')],'include':[{'model':_0x84f0('0xe'),'as':_0x84f0('0xe'),'attributes':['id','name']}]},{'model':_0x84f0('0x13'),'as':'Fields','attributes':['id',_0x84f0('0xb'),'content',_0x84f0('0x14'),_0x84f0('0x15'),_0x84f0('0x16'),_0x84f0('0xd')],'include':[{'model':_0x84f0('0xe'),'as':_0x84f0('0xe'),'attributes':['id',_0x84f0('0x8')]}]}]}]},'log':_0x84f0('0x3')});};};
\ No newline at end of file
index aa0bc6e..f90f7c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ca9=['key','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','username','serverUrl','Configurations','FreshsalesField','Subjects','type','content','variableName','Variable','Descriptions'];(function(_0x4bb4a3,_0xb74f9f){var _0x1e39a3=function(_0x5e75cd){while(--_0x5e75cd){_0x4bb4a3['push'](_0x4bb4a3['shift']());}};_0x1e39a3(++_0xb74f9f);}(_0x8ca9,0x9c));var _0x98ca=function(_0x239dfc,_0x2389ee){_0x239dfc=_0x239dfc-0x0;var _0x2fb1bf=_0x8ca9[_0x239dfc];return _0x2fb1bf;};'use strict';var client=require(_0x98ca('0x0'));exports[_0x98ca('0x1')]=function(){return function(_0x3acd03){return client[_0x98ca('0x2')](_0x98ca('0x3'),{'options':{'raw':![],'attributes':['id',_0x98ca('0x4'),_0x98ca('0x5'),'apiKey','remoteUri',_0x98ca('0x6')],'include':[{'model':'FreshsalesConfiguration','as':_0x98ca('0x7'),'attributes':['id','name'],'include':[{'model':_0x98ca('0x8'),'as':_0x98ca('0x9'),'attributes':['id',_0x98ca('0xa'),_0x98ca('0xb'),_0x98ca('0xc')],'include':[{'model':_0x98ca('0xd'),'as':_0x98ca('0xd'),'attributes':['id',_0x98ca('0x4')]}]},{'model':_0x98ca('0x8'),'as':_0x98ca('0xe'),'attributes':['id',_0x98ca('0xa'),_0x98ca('0xb'),_0x98ca('0xf'),_0x98ca('0x10'),_0x98ca('0x11'),_0x98ca('0xc')],'include':[{'model':_0x98ca('0xd'),'as':_0x98ca('0xd'),'attributes':['id','name']}]}]}]},'log':_0x98ca('0x12')});};};
\ No newline at end of file
+var _0x4745=['keyContent','variableName','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','content','Variable','Descriptions','type','key','keyType'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x4745,0x1e7));var _0x5474=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x4745[_0x56482c];return _0x5aae7a;};'use strict';var client=require(_0x5474('0x0'));exports[_0x5474('0x1')]=function(){return function(_0x46e81b){return client[_0x5474('0x2')](_0x5474('0x3'),{'options':{'raw':![],'attributes':['id',_0x5474('0x4'),_0x5474('0x5'),_0x5474('0x6'),_0x5474('0x7'),_0x5474('0x8')],'include':[{'model':_0x5474('0x9'),'as':_0x5474('0xa'),'attributes':['id','name'],'include':[{'model':_0x5474('0xb'),'as':_0x5474('0xc'),'attributes':['id','type',_0x5474('0xd'),'variableName'],'include':[{'model':_0x5474('0xe'),'as':_0x5474('0xe'),'attributes':['id','name']}]},{'model':_0x5474('0xb'),'as':_0x5474('0xf'),'attributes':['id',_0x5474('0x10'),_0x5474('0xd'),_0x5474('0x11'),_0x5474('0x12'),_0x5474('0x13'),_0x5474('0x14')],'include':[{'model':'Variable','as':_0x5474('0xe'),'attributes':['id',_0x5474('0x4')]}]}]}]},'log':_0x5474('0x15')});};};
\ No newline at end of file
index 6554ef1..37d90b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e56=['SalesforceConfiguration','ticketType','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead','SalesforceField','Variable','../../client','getSalesforceAccounts','GetSalesforceAccount','name','username','password','remoteUri','securityToken','serverUrl'];(function(_0x434413,_0x314bab){var _0x4f99e3=function(_0x42adc2){while(--_0x42adc2){_0x434413['push'](_0x434413['shift']());}};_0x4f99e3(++_0x314bab);}(_0x7e56,0x107));var _0x67e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e56[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x67e5('0x0'));exports[_0x67e5('0x1')]=function(){return function(_0xa88189){return client['Request'](_0x67e5('0x2'),{'options':{'raw':![],'attributes':['id',_0x67e5('0x3'),_0x67e5('0x4'),_0x67e5('0x5'),_0x67e5('0x6'),'clientId','clientSecret',_0x67e5('0x7'),_0x67e5('0x8'),'type'],'include':[{'model':_0x67e5('0x9'),'as':'Configurations','attributes':['id',_0x67e5('0x3'),'moduleSearch','moduleCreate',_0x67e5('0xa'),_0x67e5('0xb'),_0x67e5('0xc'),_0x67e5('0xd'),_0x67e5('0xe')],'include':[{'model':_0x67e5('0xf'),'as':'Subjects','include':[{'model':'Variable','as':_0x67e5('0x10'),'attributes':['id',_0x67e5('0x3')]}]},{'model':'SalesforceField','as':'Descriptions','include':[{'model':_0x67e5('0x10'),'as':_0x67e5('0x10'),'attributes':['id','name']}]},{'model':_0x67e5('0xf'),'as':'Fields','include':[{'model':_0x67e5('0x10'),'as':_0x67e5('0x10'),'attributes':['id',_0x67e5('0x3')]}]}]}]},'log':_0x67e5('0x2')});};};
\ No newline at end of file
+var _0xe7a0=['clientId','clientSecret','securityToken','serverUrl','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchLead','SalesforceField','Variable','Descriptions','Fields','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','username','password'];(function(_0x3aded,_0x1665bf){var _0x249a68=function(_0x51aa38){while(--_0x51aa38){_0x3aded['push'](_0x3aded['shift']());}};_0x249a68(++_0x1665bf);}(_0xe7a0,0x10d));var _0x0e7a=function(_0x5e15c8,_0x4fa20e){_0x5e15c8=_0x5e15c8-0x0;var _0x2ba1c4=_0xe7a0[_0x5e15c8];return _0x2ba1c4;};'use strict';var client=require(_0x0e7a('0x0'));exports[_0x0e7a('0x1')]=function(){return function(_0xcee8ba){return client[_0x0e7a('0x2')](_0x0e7a('0x3'),{'options':{'raw':![],'attributes':['id',_0x0e7a('0x4'),_0x0e7a('0x5'),_0x0e7a('0x6'),'remoteUri',_0x0e7a('0x7'),_0x0e7a('0x8'),_0x0e7a('0x9'),_0x0e7a('0xa'),'type'],'include':[{'model':_0x0e7a('0xb'),'as':_0x0e7a('0xc'),'attributes':['id',_0x0e7a('0x4'),_0x0e7a('0xd'),_0x0e7a('0xe'),_0x0e7a('0xf'),_0x0e7a('0x10'),_0x0e7a('0x11'),'additionalSearchContact',_0x0e7a('0x12')],'include':[{'model':_0x0e7a('0x13'),'as':'Subjects','include':[{'model':_0x0e7a('0x14'),'as':_0x0e7a('0x14'),'attributes':['id',_0x0e7a('0x4')]}]},{'model':_0x0e7a('0x13'),'as':_0x0e7a('0x15'),'include':[{'model':_0x0e7a('0x14'),'as':_0x0e7a('0x14'),'attributes':['id','name']}]},{'model':_0x0e7a('0x13'),'as':_0x0e7a('0x16'),'include':[{'model':'Variable','as':_0x0e7a('0x14'),'attributes':['id',_0x0e7a('0x4')]}]}]}]},'log':_0x0e7a('0x3')});};};
\ No newline at end of file
index d6be2b6..73c9231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['Variable','Descriptions','key','keyType','variableName','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','name','ServicenowField','type','content'];(function(_0xd67ff6,_0x22b13e){var _0x55d4e6=function(_0x2a874d){while(--_0x2a874d){_0xd67ff6['push'](_0xd67ff6['shift']());}};_0x55d4e6(++_0x22b13e);}(_0x687b,0x14a));var _0xb687=function(_0x2fc960,_0x5219db){_0x2fc960=_0x2fc960-0x0;var _0x3072a7=_0x687b[_0x2fc960];return _0x3072a7;};'use strict';var client=require(_0xb687('0x0'));exports[_0xb687('0x1')]=function(){return function(_0xd000be){return client[_0xb687('0x2')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id','name',_0xb687('0x3'),_0xb687('0x4'),_0xb687('0x5'),_0xb687('0x6'),_0xb687('0x7'),_0xb687('0x8')],'include':[{'model':_0xb687('0x9'),'as':_0xb687('0xa'),'attributes':['id',_0xb687('0xb')],'include':[{'model':_0xb687('0xc'),'as':'Subjects','attributes':['id',_0xb687('0xd'),_0xb687('0xe'),'variableName'],'include':[{'model':_0xb687('0xf'),'as':_0xb687('0xf'),'attributes':['id',_0xb687('0xb')]}]},{'model':_0xb687('0xc'),'as':_0xb687('0x10'),'attributes':['id',_0xb687('0xd'),_0xb687('0xe'),_0xb687('0x11'),_0xb687('0x12'),'keyContent',_0xb687('0x13')],'include':[{'model':_0xb687('0xf'),'as':_0xb687('0xf'),'attributes':['id',_0xb687('0xb')]}]},{'model':'ServicenowField','as':'Fields','attributes':['id',_0xb687('0xd'),_0xb687('0xe'),'idField',_0xb687('0x14'),_0xb687('0x15'),_0xb687('0x13')],'include':[{'model':_0xb687('0xf'),'as':_0xb687('0xf'),'attributes':['id',_0xb687('0xb')]}]}]}]},'log':_0xb687('0x16')});};};
\ No newline at end of file
+var _0x524e=['name','description','username','password','email','remoteUri','serverUrl','Configurations','ServicenowField','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','Request','GetServicenowAccount'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x524e,0x15e));var _0xe524=function(_0x24bb77,_0x5779bc){_0x24bb77=_0x24bb77-0x0;var _0x219e8b=_0x524e[_0x24bb77];return _0x219e8b;};'use strict';var client=require('../../client');exports['getServicenowAccounts']=function(){return function(_0x353d8a){return client[_0xe524('0x0')](_0xe524('0x1'),{'options':{'raw':![],'attributes':['id',_0xe524('0x2'),_0xe524('0x3'),_0xe524('0x4'),_0xe524('0x5'),_0xe524('0x6'),_0xe524('0x7'),_0xe524('0x8')],'include':[{'model':'ServicenowConfiguration','as':_0xe524('0x9'),'attributes':['id',_0xe524('0x2')],'include':[{'model':_0xe524('0xa'),'as':'Subjects','attributes':['id',_0xe524('0xb'),_0xe524('0xc'),_0xe524('0xd')],'include':[{'model':_0xe524('0xe'),'as':_0xe524('0xe'),'attributes':['id',_0xe524('0x2')]}]},{'model':_0xe524('0xa'),'as':_0xe524('0xf'),'attributes':['id',_0xe524('0xb'),_0xe524('0xc'),_0xe524('0x10'),_0xe524('0x11'),_0xe524('0x12'),_0xe524('0xd')],'include':[{'model':_0xe524('0xe'),'as':_0xe524('0xe'),'attributes':['id','name']}]},{'model':'ServicenowField','as':_0xe524('0x13'),'attributes':['id',_0xe524('0xb'),_0xe524('0xc'),_0xe524('0x14'),_0xe524('0x15'),'customField',_0xe524('0xd')],'include':[{'model':'Variable','as':_0xe524('0xe'),'attributes':['id',_0xe524('0x2')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
index 7022833..418a773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','serverUrl','Configurations','type','content','variableName','Variable','key','keyType','Fields','idField'];(function(_0x41111c,_0x4f18d5){var _0x5cc7c0=function(_0x368e62){while(--_0x368e62){_0x41111c['push'](_0x41111c['shift']());}};_0x5cc7c0(++_0x4f18d5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var client=require('../../client');exports[_0x65f6('0x0')]=function(){return function(_0x4a3887){return client[_0x65f6('0x1')](_0x65f6('0x2'),{'options':{'raw':![],'attributes':['id',_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'remoteUri',_0x65f6('0x6')],'include':[{'model':'SugarcrmConfiguration','as':_0x65f6('0x7'),'attributes':['id',_0x65f6('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x65f6('0x8'),_0x65f6('0x9'),_0x65f6('0xa')],'include':[{'model':_0x65f6('0xb'),'as':_0x65f6('0xb'),'attributes':['id',_0x65f6('0x3')]}]},{'model':'SugarcrmField','as':'Descriptions','attributes':['id',_0x65f6('0x8'),_0x65f6('0x9'),_0x65f6('0xc'),_0x65f6('0xd'),'keyContent',_0x65f6('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x65f6('0x3')]}]},{'model':'SugarcrmField','as':_0x65f6('0xe'),'attributes':['id','type',_0x65f6('0x9'),_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0xa')],'include':[{'model':_0x65f6('0xb'),'as':_0x65f6('0xb'),'attributes':['id',_0x65f6('0x3')]}]}]}]},'log':_0x65f6('0x2')});};};
\ No newline at end of file
+var _0x0295=['remoteUri','serverUrl','SugarcrmConfiguration','Configurations','name','SugarcrmField','Subjects','Variable','Descriptions','content','key','keyType','variableName','Fields','customField','GetSugarcrmAccount','../../client','Request','username','password'];(function(_0x3860f9,_0x2d1690){var _0x21f922=function(_0x50debb){while(--_0x50debb){_0x3860f9['push'](_0x3860f9['shift']());}};_0x21f922(++_0x2d1690);}(_0x0295,0x1f0));var _0x5029=function(_0x3a3fcc,_0x38afb3){_0x3a3fcc=_0x3a3fcc-0x0;var _0xe16438=_0x0295[_0x3a3fcc];return _0xe16438;};'use strict';var client=require(_0x5029('0x0'));exports['getSugarcrmAccounts']=function(){return function(_0x5e71d0){return client[_0x5029('0x1')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id','name',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5')],'include':[{'model':_0x5029('0x6'),'as':_0x5029('0x7'),'attributes':['id',_0x5029('0x8')],'include':[{'model':_0x5029('0x9'),'as':_0x5029('0xa'),'attributes':['id','type','content','variableName'],'include':[{'model':_0x5029('0xb'),'as':'Variable','attributes':['id',_0x5029('0x8')]}]},{'model':'SugarcrmField','as':_0x5029('0xc'),'attributes':['id','type',_0x5029('0xd'),_0x5029('0xe'),_0x5029('0xf'),'keyContent',_0x5029('0x10')],'include':[{'model':_0x5029('0xb'),'as':_0x5029('0xb'),'attributes':['id','name']}]},{'model':_0x5029('0x9'),'as':_0x5029('0x11'),'attributes':['id','type','content','idField','nameField',_0x5029('0x12'),_0x5029('0x10')],'include':[{'model':_0x5029('0xb'),'as':_0x5029('0xb'),'attributes':['id',_0x5029('0x8')]}]}]}]},'log':_0x5029('0x13')});};};
\ No newline at end of file
index 6cf8916..a6a6b50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d34=['username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Subjects','type','variableName','Variable','name','VtigerField','Descriptions','content','key','keyType','keyContent','Fields','idField','nameField','getVtigerAccounts','Request','GetVtigerAccount','description'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2d34,0xcb));var _0x42d3=function(_0xa18cf7,_0xd2ca52){_0xa18cf7=_0xa18cf7-0x0;var _0x959286=_0x2d34[_0xa18cf7];return _0x959286;};'use strict';var client=require('../../client');exports[_0x42d3('0x0')]=function(){return function(_0x213a9b){return client[_0x42d3('0x1')](_0x42d3('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x42d3('0x3'),_0x42d3('0x4'),_0x42d3('0x5'),_0x42d3('0x6'),_0x42d3('0x7')],'include':[{'model':_0x42d3('0x8'),'as':'Configurations','attributes':['id','name'],'include':[{'model':'VtigerField','as':_0x42d3('0x9'),'attributes':['id',_0x42d3('0xa'),'content',_0x42d3('0xb')],'include':[{'model':_0x42d3('0xc'),'as':_0x42d3('0xc'),'attributes':['id',_0x42d3('0xd')]}]},{'model':_0x42d3('0xe'),'as':_0x42d3('0xf'),'attributes':['id',_0x42d3('0xa'),_0x42d3('0x10'),_0x42d3('0x11'),_0x42d3('0x12'),_0x42d3('0x13'),_0x42d3('0xb')],'include':[{'model':_0x42d3('0xc'),'as':_0x42d3('0xc'),'attributes':['id','name']}]},{'model':_0x42d3('0xe'),'as':_0x42d3('0x14'),'attributes':['id',_0x42d3('0xa'),_0x42d3('0x10'),_0x42d3('0x15'),_0x42d3('0x16'),'customField',_0x42d3('0xb')],'include':[{'model':_0x42d3('0xc'),'as':_0x42d3('0xc'),'attributes':['id',_0x42d3('0xd')]}]}]}]},'log':_0x42d3('0x2')});};};
\ No newline at end of file
+var _0xa776=['keyType','keyContent','Fields','idField','GetVtigerAccount','Request','name','username','accessKey','serverUrl','VtigerConfiguration','Configurations','VtigerField','Subjects','content','variableName','Variable','Descriptions','type','key'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xa776,0x69));var _0x6a77=function(_0x22ed71,_0x358827){_0x22ed71=_0x22ed71-0x0;var _0x4d5b1=_0xa776[_0x22ed71];return _0x4d5b1;};'use strict';var client=require('../../client');exports['getVtigerAccounts']=function(){return function(_0x26a4d6){return client[_0x6a77('0x0')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x6a77('0x1'),'description',_0x6a77('0x2'),_0x6a77('0x3'),'remoteUri',_0x6a77('0x4')],'include':[{'model':_0x6a77('0x5'),'as':_0x6a77('0x6'),'attributes':['id',_0x6a77('0x1')],'include':[{'model':_0x6a77('0x7'),'as':_0x6a77('0x8'),'attributes':['id','type',_0x6a77('0x9'),_0x6a77('0xa')],'include':[{'model':_0x6a77('0xb'),'as':_0x6a77('0xb'),'attributes':['id',_0x6a77('0x1')]}]},{'model':_0x6a77('0x7'),'as':_0x6a77('0xc'),'attributes':['id',_0x6a77('0xd'),_0x6a77('0x9'),_0x6a77('0xe'),_0x6a77('0xf'),_0x6a77('0x10'),'variableName'],'include':[{'model':_0x6a77('0xb'),'as':_0x6a77('0xb'),'attributes':['id',_0x6a77('0x1')]}]},{'model':_0x6a77('0x7'),'as':_0x6a77('0x11'),'attributes':['id',_0x6a77('0xd'),_0x6a77('0x9'),_0x6a77('0x12'),'nameField','customField',_0x6a77('0xa')],'include':[{'model':_0x6a77('0xb'),'as':_0x6a77('0xb'),'attributes':['id','name']}]}]}]},'log':_0x6a77('0x13')});};};
\ No newline at end of file
index c8d9bb5..93bf422 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff3b=['ZendeskField','Descriptions','keyContent','idField','nameField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','token','remoteUri','authType','type','Tag','content','variableName','Variable'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xff3b,0xfc));var _0xbff3=function(_0x426364,_0x49c7fd){_0x426364=_0x426364-0x0;var _0x212b9b=_0xff3b[_0x426364];return _0x212b9b;};'use strict';var client=require(_0xbff3('0x0'));exports[_0xbff3('0x1')]=function(){return function(_0x1f5b04){return client[_0xbff3('0x2')](_0xbff3('0x3'),{'options':{'raw':![],'attributes':['id',_0xbff3('0x4'),_0xbff3('0x5'),'password',_0xbff3('0x6'),_0xbff3('0x7'),_0xbff3('0x8'),'serverUrl',_0xbff3('0x9')],'include':[{'model':'ZendeskConfiguration','as':'Configurations','attributes':['id',_0xbff3('0x4')],'include':[{'model':_0xbff3('0xa'),'attributes':['id',_0xbff3('0x4')]},{'model':'ZendeskField','as':'Subjects','attributes':['id',_0xbff3('0x9'),_0xbff3('0xb'),_0xbff3('0xc')],'include':[{'model':_0xbff3('0xd'),'as':_0xbff3('0xd'),'attributes':['id','name']}]},{'model':_0xbff3('0xe'),'as':_0xbff3('0xf'),'attributes':['id',_0xbff3('0x9'),_0xbff3('0xb'),'key','keyType',_0xbff3('0x10'),'variableName'],'include':[{'model':_0xbff3('0xd'),'as':'Variable','attributes':['id',_0xbff3('0x4')]}]},{'model':_0xbff3('0xe'),'as':'Fields','attributes':['id',_0xbff3('0x9'),'content',_0xbff3('0x11'),_0xbff3('0x12'),'customField',_0xbff3('0xc')],'include':[{'model':'Variable','as':_0xbff3('0xd'),'attributes':['id','name']}]}]}]},'log':_0xbff3('0x3')});};};
\ No newline at end of file
+var _0x1be9=['name','username','password','remoteUri','authType','serverUrl','type','ZendeskConfiguration','Tag','ZendeskField','Subjects','content','variableName','Variable','Descriptions','key','keyType','Fields','nameField','customField','../../client','Request','GetZendeskAccount'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0x1be9,0x156));var _0x91be=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x1be9[_0x138adb];return _0x1b27f2;};'use strict';var client=require(_0x91be('0x0'));exports['getZendeskAccounts']=function(){return function(_0xafc7d2){return client[_0x91be('0x1')](_0x91be('0x2'),{'options':{'raw':![],'attributes':['id',_0x91be('0x3'),_0x91be('0x4'),_0x91be('0x5'),'token',_0x91be('0x6'),_0x91be('0x7'),_0x91be('0x8'),_0x91be('0x9')],'include':[{'model':_0x91be('0xa'),'as':'Configurations','attributes':['id',_0x91be('0x3')],'include':[{'model':_0x91be('0xb'),'attributes':['id',_0x91be('0x3')]},{'model':_0x91be('0xc'),'as':_0x91be('0xd'),'attributes':['id',_0x91be('0x9'),_0x91be('0xe'),_0x91be('0xf')],'include':[{'model':_0x91be('0x10'),'as':_0x91be('0x10'),'attributes':['id',_0x91be('0x3')]}]},{'model':_0x91be('0xc'),'as':_0x91be('0x11'),'attributes':['id',_0x91be('0x9'),_0x91be('0xe'),_0x91be('0x12'),_0x91be('0x13'),'keyContent','variableName'],'include':[{'model':_0x91be('0x10'),'as':_0x91be('0x10'),'attributes':['id',_0x91be('0x3')]}]},{'model':'ZendeskField','as':_0x91be('0x14'),'attributes':['id',_0x91be('0x9'),'content','idField',_0x91be('0x15'),_0x91be('0x16'),_0x91be('0xf')],'include':[{'model':_0x91be('0x10'),'as':_0x91be('0x10'),'attributes':['id',_0x91be('0x3')]}]}]}]},'log':_0x91be('0x2')});};};
\ No newline at end of file
index 17146f9..56bc5ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfae5=['clientId','serverUrl','refreshToken','ZohoConfiguration','Configurations','name','moduleCreate','moduleSearch','ZohoField','Subjects','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','Fields','nameField','customField','GetZohoAccount','../../client','getZohoAccounts','Request','description','host','zone'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xfae5,0xbe));var _0x5fae=function(_0x3104ab,_0x284be0){_0x3104ab=_0x3104ab-0x0;var _0x53e3ec=_0xfae5[_0x3104ab];return _0x53e3ec;};'use strict';var client=require(_0x5fae('0x0'));exports[_0x5fae('0x1')]=function(){return function(_0x1d81cd){return client[_0x5fae('0x2')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id','name',_0x5fae('0x3'),_0x5fae('0x4'),_0x5fae('0x5'),_0x5fae('0x6'),'clientSecret',_0x5fae('0x7'),'code',_0x5fae('0x8')],'include':[{'model':_0x5fae('0x9'),'as':_0x5fae('0xa'),'attributes':['id',_0x5fae('0xb'),_0x5fae('0xc'),_0x5fae('0xd'),_0x5fae('0x3')],'include':[{'model':_0x5fae('0xe'),'as':_0x5fae('0xf'),'attributes':['id',_0x5fae('0x10'),_0x5fae('0x11'),'variableName'],'include':[{'model':_0x5fae('0x12'),'as':_0x5fae('0x12'),'attributes':['id',_0x5fae('0xb')]}]},{'model':_0x5fae('0xe'),'as':_0x5fae('0x13'),'attributes':['id',_0x5fae('0x10'),'content',_0x5fae('0x14'),_0x5fae('0x15'),_0x5fae('0x16'),_0x5fae('0x17')],'include':[{'model':_0x5fae('0x12'),'as':_0x5fae('0x12'),'attributes':['id','name']}]},{'model':'ZohoField','as':_0x5fae('0x18'),'attributes':['id',_0x5fae('0x10'),_0x5fae('0x11'),'idField',_0x5fae('0x19'),_0x5fae('0x1a'),'variableName'],'include':[{'model':_0x5fae('0x12'),'as':_0x5fae('0x12'),'attributes':['id',_0x5fae('0xb')]}]}]}]},'log':_0x5fae('0x1b')});};};
\ No newline at end of file
+var _0xa1f7=['ZohoField','Subjects','content','variableName','Variable','type','keyType','keyContent','Fields','idField','customField','GetZohoAccount','../../client','Request','name','host','zone','clientId','ZohoConfiguration','Configurations','moduleCreate','moduleSearch','description'];(function(_0x53c29a,_0x27b475){var _0x4ea7d6=function(_0x38759a){while(--_0x38759a){_0x53c29a['push'](_0x53c29a['shift']());}};_0x4ea7d6(++_0x27b475);}(_0xa1f7,0x96));var _0x7a1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa1f7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7a1f('0x0'));exports['getZohoAccounts']=function(){return function(_0x5038c7){return client[_0x7a1f('0x1')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id',_0x7a1f('0x2'),'description',_0x7a1f('0x3'),_0x7a1f('0x4'),_0x7a1f('0x5'),'clientSecret','serverUrl','code','refreshToken'],'include':[{'model':_0x7a1f('0x6'),'as':_0x7a1f('0x7'),'attributes':['id',_0x7a1f('0x2'),_0x7a1f('0x8'),_0x7a1f('0x9'),_0x7a1f('0xa')],'include':[{'model':_0x7a1f('0xb'),'as':_0x7a1f('0xc'),'attributes':['id','type',_0x7a1f('0xd'),_0x7a1f('0xe')],'include':[{'model':_0x7a1f('0xf'),'as':'Variable','attributes':['id',_0x7a1f('0x2')]}]},{'model':_0x7a1f('0xb'),'as':'Descriptions','attributes':['id',_0x7a1f('0x10'),'content','key',_0x7a1f('0x11'),_0x7a1f('0x12'),_0x7a1f('0xe')],'include':[{'model':_0x7a1f('0xf'),'as':_0x7a1f('0xf'),'attributes':['id','name']}]},{'model':_0x7a1f('0xb'),'as':_0x7a1f('0x13'),'attributes':['id','type',_0x7a1f('0xd'),_0x7a1f('0x14'),'nameField',_0x7a1f('0x15'),_0x7a1f('0xe')],'include':[{'model':_0x7a1f('0xf'),'as':'Variable','attributes':['id',_0x7a1f('0x2')]}]}]}]},'log':_0x7a1f('0x16')});};};
\ No newline at end of file
index f3a4835..65963d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x554e=['interface','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound','exten','queue','agent','accountcode','voiceDialReport','membername','starttime','endtime','outbound','dialstring','toNumber','util','../client','queuecallercompleteAt','CreateMemberReport','voice','lastAssignedTo','isNil'];(function(_0x4ba48b,_0x1f997f){var _0x3c8ae9=function(_0x3d0a37){while(--_0x3d0a37){_0x4ba48b['push'](_0x4ba48b['shift']());}};_0x3c8ae9(++_0x1f997f);}(_0x554e,0x165));var _0xe554=function(_0x1cad88,_0x41d38c){_0x1cad88=_0x1cad88-0x0;var _0x134d48=_0x554e[_0x1cad88];return _0x134d48;};'use strict';var moment=require('moment');var _=require('lodash');var util=require(_0xe554('0x0'));var client=require(_0xe554('0x1'));exports['voiceQueueReport']=function(_0xeaa3fd){var _0xbb2c6c=_0xeaa3fd[_0xe554('0x2')]||_0xeaa3fd['queuecallerexitAt'];return client['Request'](_0xe554('0x3'),{'body':{'channel':_0xe554('0x4'),'membername':_0xeaa3fd[_0xe554('0x5')],'interface':_[_0xe554('0x6')](_0xeaa3fd[_0xe554('0x7')])?util[_0xe554('0x8')](_0xe554('0x9'),_0xeaa3fd[_0xe554('0x5')]):_0xeaa3fd[_0xe554('0x7')],'type':_0xe554('0xa'),'enterAt':_0xeaa3fd['queuecallerleaveAt'],'exitAt':_0xbb2c6c,'duration':moment(_0xbb2c6c)[_0xe554('0xb')](_0xeaa3fd[_0xe554('0xc')],_0xe554('0xd')),'data1':_0xe554('0xe'),'data2':_0xeaa3fd['calleridnum'],'data3':_0xeaa3fd[_0xe554('0xf')],'data4':null,'data5':_0xeaa3fd[_0xe554('0x10')],'role':_0xe554('0x11'),'internal':_0xeaa3fd[_0xe554('0x12')]?_['toNumber'](_0xeaa3fd[_0xe554('0x12')]):undefined,'uniqueid':_0xeaa3fd['uniqueid']},'log':_0xe554('0x3')});};exports[_0xe554('0x13')]=function(_0x40e576){return client['Request'](_0xe554('0x3'),{'body':{'channel':'voice','membername':_0x40e576[_0xe554('0x14')],'interface':_0x40e576[_0xe554('0x7')],'type':_0xe554('0xa'),'enterAt':_0x40e576[_0xe554('0x15')],'exitAt':_0x40e576['endtime'],'duration':moment(_0x40e576[_0xe554('0x16')])[_0xe554('0xb')](_0x40e576['starttime'],'seconds')>=0x0?moment(_0x40e576['endtime'])[_0xe554('0xb')](_0x40e576['starttime'],'seconds'):null,'data1':_0xe554('0x17'),'data2':_0x40e576[_0xe554('0x12')],'data3':_0x40e576['exten'],'data4':_0x40e576[_0xe554('0x18')]||null,'role':'agent','internal':_0x40e576[_0xe554('0x12')]?_[_0xe554('0x19')](_0x40e576[_0xe554('0x12')]):undefined,'uniqueid':_0x40e576['uniqueid']},'log':_0xe554('0x3')});};
\ No newline at end of file
+var _0xd4ed=['agent','toNumber','uniqueid','voiceDialReport','membername','endtime','starttime','seconds','outbound','accountcode','dialstring','lodash','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue'];(function(_0x4970de,_0x14dadb){var _0xef9d06=function(_0x5708a8){while(--_0x5708a8){_0x4970de['push'](_0x4970de['shift']());}};_0xef9d06(++_0x14dadb);}(_0xd4ed,0x13f));var _0xdd4e=function(_0x627dd4,_0x3ca86c){_0x627dd4=_0x627dd4-0x0;var _0xaab970=_0xd4ed[_0x627dd4];return _0xaab970;};'use strict';var moment=require('moment');var _=require(_0xdd4e('0x0'));var util=require('util');var client=require('../client');exports['voiceQueueReport']=function(_0x5a2e96){var _0x19e9b6=_0x5a2e96[_0xdd4e('0x1')]||_0x5a2e96[_0xdd4e('0x2')];return client[_0xdd4e('0x3')](_0xdd4e('0x4'),{'body':{'channel':_0xdd4e('0x5'),'membername':_0x5a2e96['lastAssignedTo'],'interface':_[_0xdd4e('0x6')](_0x5a2e96[_0xdd4e('0x7')])?util[_0xdd4e('0x8')](_0xdd4e('0x9'),_0x5a2e96['lastAssignedTo']):_0x5a2e96['interface'],'type':_0xdd4e('0xa'),'enterAt':_0x5a2e96[_0xdd4e('0xb')],'exitAt':_0x19e9b6,'duration':moment(_0x19e9b6)[_0xdd4e('0xc')](_0x5a2e96[_0xdd4e('0xb')],'seconds'),'data1':_0xdd4e('0xd'),'data2':_0x5a2e96[_0xdd4e('0xe')],'data3':_0x5a2e96[_0xdd4e('0xf')],'data4':null,'data5':_0x5a2e96[_0xdd4e('0x10')],'role':_0xdd4e('0x11'),'internal':_0x5a2e96['accountcode']?_[_0xdd4e('0x12')](_0x5a2e96['accountcode']):undefined,'uniqueid':_0x5a2e96[_0xdd4e('0x13')]},'log':_0xdd4e('0x4')});};exports[_0xdd4e('0x14')]=function(_0x5a6afd){return client[_0xdd4e('0x3')](_0xdd4e('0x4'),{'body':{'channel':'voice','membername':_0x5a6afd[_0xdd4e('0x15')],'interface':_0x5a6afd[_0xdd4e('0x7')],'type':_0xdd4e('0xa'),'enterAt':_0x5a6afd['starttime'],'exitAt':_0x5a6afd['endtime'],'duration':moment(_0x5a6afd[_0xdd4e('0x16')])[_0xdd4e('0xc')](_0x5a6afd[_0xdd4e('0x17')],_0xdd4e('0x18'))>=0x0?moment(_0x5a6afd[_0xdd4e('0x16')])[_0xdd4e('0xc')](_0x5a6afd[_0xdd4e('0x17')],_0xdd4e('0x18')):null,'data1':_0xdd4e('0x19'),'data2':_0x5a6afd[_0xdd4e('0x1a')],'data3':_0x5a6afd['exten'],'data4':_0x5a6afd[_0xdd4e('0x1b')]||null,'role':_0xdd4e('0x11'),'internal':_0x5a6afd[_0xdd4e('0x1a')]?_[_0xdd4e('0x12')](_0x5a6afd[_0xdd4e('0x1a')]):undefined,'uniqueid':_0x5a6afd['uniqueid']},'log':_0xdd4e('0x4')});};
\ No newline at end of file
index 537ba91..03bb023 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75e3=['getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x1921c6,_0x18f5d0){var _0x9c98ed=function(_0x400379){while(--_0x400379){_0x1921c6['push'](_0x1921c6['shift']());}};_0x9c98ed(++_0x18f5d0);}(_0x75e3,0x104));var _0x375e=function(_0x38d12c,_0x288712){_0x38d12c=_0x38d12c-0x0;var _0x698766=_0x75e3[_0x38d12c];return _0x698766;};'use strict';var client=require('../client');exports[_0x375e('0x0')]=function(){return client[_0x375e('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x375e('0x2'),_0x375e('0x3')]},'log':_0x375e('0x4')});};
\ No newline at end of file
+var _0x315f=['../client','Request','previewRecallmeReminderInterval'];(function(_0x4daa54,_0x4ad5ae){var _0x2c9865=function(_0x3f1b86){while(--_0x3f1b86){_0x4daa54['push'](_0x4daa54['shift']());}};_0x2c9865(++_0x4ad5ae);}(_0x315f,0x174));var _0xf315=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0x315f[_0x2f227c];return _0x5032bc;};'use strict';var client=require(_0xf315('0x0'));exports['getSettings']=function(){return client[_0xf315('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0xf315('0x2')]},'log':'GetSettings'});};
\ No newline at end of file
index 303afa8..b6770e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28a6=['name','html','GetTemplate','../client','getTemplates'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x28a6,0x8f));var _0x628a=function(_0x10316a,_0x125dc8){_0x10316a=_0x10316a-0x0;var _0x36ac2e=_0x28a6[_0x10316a];return _0x36ac2e;};'use strict';var client=require(_0x628a('0x0'));exports[_0x628a('0x1')]=function(_0x1990a7){return function(_0x17ac0d){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x628a('0x2'),_0x628a('0x3')]},'log':_0x628a('0x4')});};};
\ No newline at end of file
+var _0x416b=['../client','getTemplates','Request','name','html','GetTemplate'];(function(_0x5e77db,_0x468bb0){var _0x14fae7=function(_0x5c64d8){while(--_0x5c64d8){_0x5e77db['push'](_0x5e77db['shift']());}};_0x14fae7(++_0x468bb0);}(_0x416b,0x1c8));var _0xb416=function(_0x6376b0,_0x52d8c1){_0x6376b0=_0x6376b0-0x0;var _0x47ac71=_0x416b[_0x6376b0];return _0x47ac71;};'use strict';var client=require(_0xb416('0x0'));exports[_0xb416('0x1')]=function(_0x49566c){return function(_0x512f2d){return client[_0xb416('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xb416('0x3'),_0xb416('0x4')]},'log':_0xb416('0x5')});};};
\ No newline at end of file
index 72717d6..dd71de3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbba1=['value','Action','action','data1','data2','data3','data4','data5','data6','data7','getTriggers','Request','GetTrigger','name','status','Condition','field','operator'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0xbba1,0xbe));var _0x1bba=function(_0xfaab65,_0x10441f){_0xfaab65=_0xfaab65-0x0;var _0x542c83=_0xbba1[_0xfaab65];return _0x542c83;};'use strict';var client=require('../client');exports[_0x1bba('0x0')]=function(_0xbb9f21){return function(_0x14ad23){return client[_0x1bba('0x1')](_0x1bba('0x2'),{'options':{'raw':![],'attributes':['id',_0x1bba('0x3'),'channel',_0x1bba('0x4')],'include':[{'model':_0x1bba('0x5'),'as':'AllConditions','attributes':['id',_0x1bba('0x6'),_0x1bba('0x7'),'value']},{'model':_0x1bba('0x5'),'as':'AnyConditions','attributes':['id',_0x1bba('0x6'),'operator',_0x1bba('0x8')]},{'model':_0x1bba('0x9'),'as':'Actions','attributes':['id',_0x1bba('0xa'),_0x1bba('0xb'),_0x1bba('0xc'),_0x1bba('0xd'),_0x1bba('0xe'),_0x1bba('0xf'),_0x1bba('0x10'),_0x1bba('0x11')]}]},'log':_0x1bba('0x2')});};};
\ No newline at end of file
+var _0x14fd=['GetTrigger','status','Condition','field','AnyConditions','operator','value','Actions','action','data1','data2','data3','data4','data5','getTriggers','Request'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x14fd,0x16e));var _0xd14f=function(_0x4ad4ce,_0x1a4168){_0x4ad4ce=_0x4ad4ce-0x0;var _0x52e4f1=_0x14fd[_0x4ad4ce];return _0x52e4f1;};'use strict';var client=require('../client');exports[_0xd14f('0x0')]=function(_0x10d1ac){return function(_0xdb74e1){return client[_0xd14f('0x1')](_0xd14f('0x2'),{'options':{'raw':![],'attributes':['id','name','channel',_0xd14f('0x3')],'include':[{'model':_0xd14f('0x4'),'as':'AllConditions','attributes':['id',_0xd14f('0x5'),'operator','value']},{'model':'Condition','as':_0xd14f('0x6'),'attributes':['id',_0xd14f('0x5'),_0xd14f('0x7'),_0xd14f('0x8')]},{'model':'Action','as':_0xd14f('0x9'),'attributes':['id',_0xd14f('0xa'),_0xd14f('0xb'),_0xd14f('0xc'),_0xd14f('0xd'),_0xd14f('0xe'),_0xd14f('0xf'),'data6','data7']}]},'log':_0xd14f('0x2')});};};
\ No newline at end of file
index 74f8f26..0989eda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda49=['name','defaultuser','GetTrunk','../client','getTrunks','Request'];(function(_0x4d08ef,_0x4debcf){var _0x5e92c1=function(_0x59886e){while(--_0x59886e){_0x4d08ef['push'](_0x4d08ef['shift']());}};_0x5e92c1(++_0x4debcf);}(_0xda49,0x1b3));var _0x9da4=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xda49[_0x4792c8];return _0x35edb1;};'use strict';var client=require(_0x9da4('0x0'));exports[_0x9da4('0x1')]=function(_0x3f11e0){return function(_0x3acfbc){return client[_0x9da4('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9da4('0x3'),'registry',_0x9da4('0x4')]},'log':_0x9da4('0x5')});};};
\ No newline at end of file
+var _0x28aa=['GetTrunk','name','defaultuser','getTrunks','Request'];(function(_0x23f875,_0x393c8f){var _0x4497d5=function(_0x5e5f7d){while(--_0x5e5f7d){_0x23f875['push'](_0x23f875['shift']());}};_0x4497d5(++_0x393c8f);}(_0x28aa,0xf8));var _0xa28a=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x28aa[_0x164eca];return _0x2ce562;};'use strict';var client=require('../client');exports[_0xa28a('0x0')]=function(_0x293c33){return function(_0x8af9dd){return client[_0xa28a('0x1')](_0xa28a('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa28a('0x3'),'registry',_0xa28a('0x4')]},'log':_0xa28a('0x2')});};};
\ No newline at end of file
index d640b9c..0490f56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x309283,_0x1f8f88){var _0x4991a2=function(_0x5c1da6){while(--_0x5c1da6){_0x309283['push'](_0x309283['shift']());}};_0x4991a2(++_0x1f8f88);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});};
\ No newline at end of file
+var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
index 46cad2d..42238d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7837=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7837,0x178));var _0x7783=function(_0x2cf545,_0x371f6a){_0x2cf545=_0x2cf545-0x0;var _0x1d68cb=_0x7837[_0x2cf545];return _0x1d68cb;};'use strict';var client=require('../client');exports[_0x7783('0x0')]=function(_0x449880){return client[_0x7783('0x1')](_0x7783('0x2'),{'body':_0x449880,'log':_0x7783('0x2')});};exports['update']=function(_0x1e282a,_0x4356ef,_0x386c23){return client[_0x7783('0x1')](_0x7783('0x3'),{'body':_0x1e282a,'options':{'where':{'uniqueid':_0x4356ef,'interface':_0x386c23,'agentcomplete':!![]}},'log':_0x7783('0x3')});};
\ No newline at end of file
+var _0x5fed=['CreateVoiceAgentReport'];(function(_0x4cbff2,_0x51e888){var _0x49f284=function(_0x5cf786){while(--_0x5cf786){_0x4cbff2['push'](_0x4cbff2['shift']());}};_0x49f284(++_0x51e888);}(_0x5fed,0x191));var _0xd5fe=function(_0x2d7116,_0x37bee1){_0x2d7116=_0x2d7116-0x0;var _0x522d5a=_0x5fed[_0x2d7116];return _0x522d5a;};'use strict';var client=require('../client');exports['create']=function(_0x192717){return client['Request'](_0xd5fe('0x0'),{'body':_0x192717,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x8c6ec2,_0x5ba3b3,_0x3c0120){return client['Request']('UpdateVoiceAgentReport',{'body':_0x8c6ec2,'options':{'where':{'uniqueid':_0x5ba3b3,'interface':_0x3c0120,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
index 7c47591..ead1f62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4bc=['create','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','Request','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','billableseconds','moment','util','lodash','../client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe4bc,0x176));var _0xce4b=function(_0x15381a,_0x54c6bb){_0x15381a=_0x15381a-0x0;var _0x554e06=_0xe4bc[_0x15381a];return _0x554e06;};'use strict';var moment=require(_0xce4b('0x0'));var util=require(_0xce4b('0x1'));var _=require(_0xce4b('0x2'));var client=require(_0xce4b('0x3'));exports[_0xce4b('0x4')]=function(_0x2da662){return client['Request']('CreateVoiceCallReport',{'body':_[_0xce4b('0x5')](_0x2da662,{'source':_0x2da662[_0xce4b('0x6')],'destinationcontext':_0x2da662[_0xce4b('0x7')],'callerid':_0x2da662[_0xce4b('0x8')],'amaflags':_0xce4b('0x9')}),'log':_0xce4b('0xa')});};exports[_0xce4b('0xb')]=function(){return function(){return client[_0xce4b('0xc')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xce4b('0xd'))['format'](_0xce4b('0xe')),moment()[_0xce4b('0xf')](_0xce4b('0xd'))[_0xce4b('0x10')](_0xce4b('0xe'))]}},'attributes':[_0xce4b('0x11'),_0xce4b('0x12'),_0xce4b('0x13'),_0xce4b('0x14')]},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
+var _0xdf3b=['disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','create','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','YYYY-MM-DD\x20HH:mm:ss','day','type'];(function(_0x4291d3,_0x760d53){var _0x507bd7=function(_0x236eb3){while(--_0x236eb3){_0x4291d3['push'](_0x4291d3['shift']());}};_0x507bd7(++_0x760d53);}(_0xdf3b,0x1a6));var _0xbdf3=function(_0x3e4285,_0x83a4f0){_0x3e4285=_0x3e4285-0x0;var _0xce09e7=_0xdf3b[_0x3e4285];return _0xce09e7;};'use strict';var moment=require('moment');var util=require(_0xbdf3('0x0'));var _=require(_0xbdf3('0x1'));var client=require('../client');exports[_0xbdf3('0x2')]=function(_0x593f06){return client['Request'](_0xbdf3('0x3'),{'body':_[_0xbdf3('0x4')](_0x593f06,{'source':_0x593f06['calleridnum'],'destinationcontext':_0x593f06[_0xbdf3('0x5')],'callerid':_0x593f06[_0xbdf3('0x6')],'amaflags':_0xbdf3('0x7')}),'log':_0xbdf3('0x3')});};exports[_0xbdf3('0x8')]=function(){return function(){return client['Request'](_0xbdf3('0x9'),{'options':{'where':{'type':[_0xbdf3('0xa')],'createdAt':{'$between':[moment()[_0xbdf3('0xb')]('day')['format'](_0xbdf3('0xc')),moment()['endOf'](_0xbdf3('0xd'))['format'](_0xbdf3('0xc'))]}},'attributes':[_0xbdf3('0xe'),_0xbdf3('0xf'),_0xbdf3('0x10'),_0xbdf3('0x11')]},'log':_0xbdf3('0x12')});};};
\ No newline at end of file
index c1b21e5..c77646a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb701=['Request','CreateVoiceDialReport','../client','create'];(function(_0x87095a,_0x10c45b){var _0x192a93=function(_0x37830c){while(--_0x37830c){_0x87095a['push'](_0x87095a['shift']());}};_0x192a93(++_0x10c45b);}(_0xb701,0xca));var _0x1b70=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xb701[_0x46e363];return _0x3fb059;};'use strict';var client=require(_0x1b70('0x0'));exports[_0x1b70('0x1')]=function(_0x318ef7){return client[_0x1b70('0x2')](_0x1b70('0x3'),{'body':_0x318ef7,'log':_0x1b70('0x3')});};
\ No newline at end of file
+var _0xf71b=['create','CreateVoiceDialReport'];(function(_0x54fc68,_0x4d6cd3){var _0x23d6d8=function(_0x4dcf30){while(--_0x4dcf30){_0x54fc68['push'](_0x54fc68['shift']());}};_0x23d6d8(++_0x4d6cd3);}(_0xf71b,0x140));var _0xbf71=function(_0x4fbbc3,_0x40ea39){_0x4fbbc3=_0x4fbbc3-0x0;var _0x14ff34=_0xf71b[_0x4fbbc3];return _0x14ff34;};'use strict';var client=require('../client');exports[_0xbf71('0x0')]=function(_0x5d77d8){return client['Request'](_0xbf71('0x1'),{'body':_0x5d77d8,'log':_0xbf71('0x1')});};
\ No newline at end of file
index 4aa9d0f..29bb7e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf45e=['recordingFormat','getVoiceExtensions','../client','Request','exten'];(function(_0x1cb86d,_0x202738){var _0x4130c3=function(_0xa77dec){while(--_0xa77dec){_0x1cb86d['push'](_0x1cb86d['shift']());}};_0x4130c3(++_0x202738);}(_0xf45e,0x115));var _0xef45=function(_0x253de2,_0x53544a){_0x253de2=_0x253de2-0x0;var _0xc0e21e=_0xf45e[_0x253de2];return _0xc0e21e;};'use strict';var client=require(_0xef45('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xef45('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xef45('0x2'),_0xef45('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xef45('0x4')});};};
\ No newline at end of file
+var _0xfa20=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0xfa20,0x141));var _0x0fa2=function(_0x4446fe,_0x2ae626){_0x4446fe=_0x4446fe-0x0;var _0x43f10c=_0xfa20[_0x4446fe];return _0x43f10c;};'use strict';var client=require(_0x0fa2('0x0'));exports[_0x0fa2('0x1')]=function(){return function(){return client[_0x0fa2('0x2')](_0x0fa2('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0fa2('0x4'),_0x0fa2('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x0fa2('0x1')});};};
\ No newline at end of file
index 43d3e0a..dda9b79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd601=['dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xd601,0x17e));var _0x1d60=function(_0x1cd165,_0x3a84b1){_0x1cd165=_0x1cd165-0x0;var _0x3bb5e0=_0xd601[_0x1cd165];return _0x3bb5e0;};'use strict';var client=require('../client');exports[_0x1d60('0x0')]=function(){return function(){return client[_0x1d60('0x1')](_0x1d60('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d60('0x3'),_0x1d60('0x4'),'acwTimeout',_0x1d60('0x5'),_0x1d60('0x6'),'type',_0x1d60('0x7'),_0x1d60('0x8'),'dialLimitChannel',_0x1d60('0x9'),'dialPowerLevel',_0x1d60('0xa'),_0x1d60('0xb'),_0x1d60('0xc'),_0x1d60('0xd'),_0x1d60('0xe'),_0x1d60('0xf'),'dialQueueOptions','dialQueueTimeout',_0x1d60('0x10'),'dialCongestionMaxRetry',_0x1d60('0x11'),_0x1d60('0x12'),_0x1d60('0x13'),_0x1d60('0x14'),_0x1d60('0x15'),_0x1d60('0x16'),'dialTimezone','dialGlobalInterval',_0x1d60('0x17'),'dialCheckDuplicateType',_0x1d60('0x18'),_0x1d60('0x19'),'dialAMDGreeting',_0x1d60('0x1a'),_0x1d60('0x1b'),_0x1d60('0x1c'),_0x1d60('0x1d'),'dialAMDMaximumNumberOfWords',_0x1d60('0x1e'),_0x1d60('0x1f'),'timeout','dialRecallMeTimeout',_0x1d60('0x20'),_0x1d60('0x21'),_0x1d60('0x22'),_0x1d60('0x23'),_0x1d60('0x24'),_0x1d60('0x6'),'strategy',_0x1d60('0x25'),_0x1d60('0x26'),_0x1d60('0x27'),'dialNoSuchNumberRetryFrequency',_0x1d60('0x28'),_0x1d60('0x29'),'dialAbandonedMaxRetry',_0x1d60('0x2a'),_0x1d60('0x2b'),'dialMachineRetryFrequency',_0x1d60('0x2c'),'dialAgentRejectRetryFrequency',_0x1d60('0x2d'),_0x1d60('0x2e'),_0x1d60('0x2f'),_0x1d60('0x30'),_0x1d60('0x31')],'include':[{'model':'Trunk','as':_0x1d60('0x32'),'attributes':['id','name',_0x1d60('0x33'),_0x1d60('0x34')]},{'model':_0x1d60('0x35'),'as':_0x1d60('0x36'),'attributes':['id',_0x1d60('0x3')]},{'model':_0x1d60('0x32'),'as':'TrunkBackup','attributes':['id',_0x1d60('0x3'),_0x1d60('0x33'),_0x1d60('0x34')]},{'model':_0x1d60('0x37'),'as':_0x1d60('0x37'),'attributes':['id',_0x1d60('0x3')],'include':[{'model':'Interval','as':_0x1d60('0x38'),'attributes':['id','name',_0x1d60('0x39')]}]}]},'log':_0x1d60('0x0')});};};
\ No newline at end of file
+var _0x7342=['dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','name','acw','autopause','monitor_format','type','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt'];(function(_0x183faa,_0x59d5){var _0x1058cf=function(_0x2781ab){while(--_0x2781ab){_0x183faa['push'](_0x183faa['shift']());}};_0x1058cf(++_0x59d5);}(_0x7342,0x1cc));var _0x2734=function(_0x44ddf9,_0x59c1bd){_0x44ddf9=_0x44ddf9-0x0;var _0x501911=_0x7342[_0x44ddf9];return _0x501911;};'use strict';var client=require('../client');exports[_0x2734('0x0')]=function(){return function(){return client[_0x2734('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x2734('0x2'),_0x2734('0x3'),'acwTimeout',_0x2734('0x4'),_0x2734('0x5'),_0x2734('0x6'),_0x2734('0x7'),'dialMethod',_0x2734('0x8'),'dialLimitQueue',_0x2734('0x9'),_0x2734('0xa'),_0x2734('0xb'),_0x2734('0xc'),_0x2734('0xd'),_0x2734('0xe'),'dialOriginateTimeout',_0x2734('0xf'),_0x2734('0x10'),_0x2734('0x11'),'dialCongestionMaxRetry',_0x2734('0x12'),_0x2734('0x13'),_0x2734('0x14'),_0x2734('0x15'),_0x2734('0x16'),_0x2734('0x17'),'dialTimezone',_0x2734('0x18'),_0x2734('0x19'),_0x2734('0x1a'),_0x2734('0x1b'),_0x2734('0x1c'),_0x2734('0x1d'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x2734('0x1e'),_0x2734('0x1f'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x2734('0x20'),'timeout',_0x2734('0x21'),_0x2734('0x22'),_0x2734('0x23'),_0x2734('0x24'),_0x2734('0x25'),'dialQueueProject2',_0x2734('0x5'),_0x2734('0x26'),_0x2734('0x27'),'dialCutDigit',_0x2734('0x28'),_0x2734('0x29'),_0x2734('0x2a'),_0x2734('0x2b'),_0x2734('0x2c'),_0x2734('0x2d'),'dialMachineMaxRetry',_0x2734('0x2e'),_0x2734('0x2f'),_0x2734('0x30'),_0x2734('0x31'),'dialPredictiveIntervalMaxThreshold',_0x2734('0x32'),_0x2734('0x33'),_0x2734('0x34')],'include':[{'model':_0x2734('0x35'),'as':_0x2734('0x35'),'attributes':['id',_0x2734('0x2'),_0x2734('0x36'),_0x2734('0x37')]},{'model':_0x2734('0x38'),'as':_0x2734('0x39'),'attributes':['id','name']},{'model':_0x2734('0x35'),'as':_0x2734('0x3a'),'attributes':['id',_0x2734('0x2'),_0x2734('0x36'),_0x2734('0x37')]},{'model':_0x2734('0x3b'),'as':_0x2734('0x3b'),'attributes':['id',_0x2734('0x2')],'include':[{'model':_0x2734('0x3b'),'as':_0x2734('0x3c'),'attributes':['id','name',_0x2734('0x3d')]}]}]},'log':_0x2734('0x0')});};};
\ No newline at end of file
index 18428d1..dd0f49f 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(_0xe6967a,_0x4cd660){var _0x1547c0=function(_0x789c9c){while(--_0x789c9c){_0xe6967a['push'](_0xe6967a['shift']());}};_0x1547c0(++_0x4cd660);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x45fda5,_0x3a94e5){var _0x4490b1=function(_0x1c9b1c){while(--_0x1c9b1c){_0x45fda5['push'](_0x45fda5['shift']());}};_0x4490b1(++_0x3a94e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 1a2673c..f9cc60d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73c8=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x73c8,0x157));var _0x873c=function(_0x218e04,_0x1c52db){_0x218e04=_0x218e04-0x0;var _0xb251f4=_0x73c8[_0x218e04];return _0xb251f4;};'use strict';var client=require(_0x873c('0x0'));exports[_0x873c('0x1')]=function(_0x416ccc){return function(){return client['Request'](_0x873c('0x2'),{'options':{'where':{'VoiceQueueId':_0x416ccc,'paused':!![]},'raw':!![]},'log':_0x873c('0x1')});};};
\ No newline at end of file
+var _0x57c4=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x57c4,0x148));var _0x457c=function(_0x4821dc,_0xba8acf){_0x4821dc=_0x4821dc-0x0;var _0x2738eb=_0x57c4[_0x4821dc];return _0x2738eb;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x392afc){return function(){return client[_0x457c('0x0')](_0x457c('0x1'),{'options':{'where':{'VoiceQueueId':_0x392afc,'paused':!![]},'raw':!![]},'log':_0x457c('0x2')});};};
\ No newline at end of file
index 6e3ba0b..311aacb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1d1ffa,_0x5a8b42){var _0x3d1004=function(_0x571f36){while(--_0x571f36){_0x1d1ffa['push'](_0x1d1ffa['shift']());}};_0x3d1004(++_0x5a8b42);}(_0x7a54,0x106));var _0x47a5=function(_0xbb1847,_0x3c60e1){_0xbb1847=_0xbb1847-0x0;var _0x1d9e23=_0x7a54[_0xbb1847];return _0x1d9e23;};'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(_0x3427d1,_0x442f64){var _0x5d544d=function(_0x539d47){while(--_0x539d47){_0x3427d1['push'](_0x3427d1['shift']());}};_0x5d544d(++_0x442f64);}(_0x7a54,0x106));var _0x47a5=function(_0x371627,_0x2175a3){_0x371627=_0x371627-0x0;var _0x406fe3=_0x7a54[_0x371627];return _0x406fe3;};'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 2e07a91..90b39d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84df=['transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename'];(function(_0x4898ec,_0x5a2551){var _0xe0d249=function(_0x5d735c){while(--_0x5d735c){_0x4898ec['push'](_0x4898ec['shift']());}};_0xe0d249(++_0x5a2551);}(_0x84df,0xfb));var _0xf84d=function(_0x2e5a8c,_0x35f4bf){_0x2e5a8c=_0x2e5a8c-0x0;var _0x5816ec=_0x84df[_0x2e5a8c];return _0x5816ec;};'use strict';var client=require('../client');exports[_0xf84d('0x0')]={};exports[_0xf84d('0x1')]=function(_0x4371ee){return client['Request'](_0xf84d('0x2'),{'body':{'result':_0x4371ee[_0xf84d('0x3')],'transfererchannel':_0x4371ee[_0xf84d('0x4')],'transferercalleridnum':_0x4371ee[_0xf84d('0x5')],'transferercalleridname':_0x4371ee[_0xf84d('0x6')],'transfererconnectedlinenum':_0x4371ee['transfererconnectedlinenum'],'transfererconnectedlinename':_0x4371ee['transfererconnectedlinename'],'transfereraccountcode':_0x4371ee[_0xf84d('0x7')],'transferercontext':_0x4371ee[_0xf84d('0x8')],'transfererexten':_0x4371ee[_0xf84d('0x9')],'transfererlinkedid':_0x4371ee['transfererlinkedid'],'transfereechannel':_0x4371ee[_0xf84d('0xa')],'transfereecalleridnum':_0x4371ee[_0xf84d('0xb')],'transfereecalleridname':_0x4371ee[_0xf84d('0xc')],'transfereeconnectedlinenum':_0x4371ee[_0xf84d('0xd')],'transfereeconnectedlinename':_0x4371ee[_0xf84d('0xe')],'transfereeaccountcode':_0x4371ee[_0xf84d('0xf')],'transfereecontext':_0x4371ee[_0xf84d('0x10')],'transfereeexten':_0x4371ee[_0xf84d('0x11')],'transfereelinkedid':_0x4371ee['transfereelinkedid'],'isexternal':_0x4371ee[_0xf84d('0x12')],'context':_0x4371ee[_0xf84d('0x13')],'extension':_0x4371ee[_0xf84d('0x14')],'type':_0xf84d('0x15')},'log':_0xf84d('0x2')});};exports['attendedTransfer']=function(_0x50567e){return client[_0xf84d('0x16')](_0xf84d('0x2'),{'body':{'result':_0x50567e[_0xf84d('0x3')],'transfererchannel':_0x50567e[_0xf84d('0x17')],'transferercalleridnum':_0x50567e[_0xf84d('0x18')],'transferercalleridname':_0x50567e[_0xf84d('0x19')],'transfererconnectedlinenum':_0x50567e['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x50567e[_0xf84d('0x1a')],'transfereraccountcode':_0x50567e['origtransfereraccountcode'],'transferercontext':_0x50567e[_0xf84d('0x1b')],'transfererexten':_0x50567e[_0xf84d('0x1c')],'transfererlinkedid':_0x50567e[_0xf84d('0x1d')],'transfereechannel':_0x50567e['transfertargetchannel'],'transfereecalleridnum':_0x50567e[_0xf84d('0x1e')],'transfereecalleridname':_0x50567e[_0xf84d('0x1f')],'transfereeconnectedlinenum':_0x50567e[_0xf84d('0x20')],'transfereeconnectedlinename':_0x50567e[_0xf84d('0x21')],'transfereeaccountcode':_0x50567e[_0xf84d('0x22')],'transfereecontext':_0x50567e[_0xf84d('0x23')],'transfereeexten':_0x50567e[_0xf84d('0x24')],'transfereelinkedid':_0x50567e[_0xf84d('0x25')],'isexternal':_0x50567e['isexternal'],'context':_0x50567e['origtransferercontext'],'extension':_0x50567e['origtransfererexten'],'type':'attended'},'log':_0xf84d('0x2')});};
\ No newline at end of file
+var _0x253b=['transfererconnectedlinenum','transfererconnectedlinename','transfereeconnectedlinenum','transfereeconnectedlinename','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname'];(function(_0x5ec951,_0x3203b9){var _0x10d933=function(_0x4ead02){while(--_0x4ead02){_0x5ec951['push'](_0x5ec951['shift']());}};_0x10d933(++_0x3203b9);}(_0x253b,0x1cc));var _0xb253=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x253b[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xb253('0x0'));exports[_0xb253('0x1')]={};exports[_0xb253('0x2')]=function(_0xed4948){return client[_0xb253('0x3')](_0xb253('0x4'),{'body':{'result':_0xed4948['result'],'transfererchannel':_0xed4948[_0xb253('0x5')],'transferercalleridnum':_0xed4948[_0xb253('0x6')],'transferercalleridname':_0xed4948[_0xb253('0x7')],'transfererconnectedlinenum':_0xed4948[_0xb253('0x8')],'transfererconnectedlinename':_0xed4948[_0xb253('0x9')],'transfereraccountcode':_0xed4948['transfereraccountcode'],'transferercontext':_0xed4948['transferercontext'],'transfererexten':_0xed4948['transfererexten'],'transfererlinkedid':_0xed4948['transfererlinkedid'],'transfereechannel':_0xed4948['transfereechannel'],'transfereecalleridnum':_0xed4948['transfereecalleridnum'],'transfereecalleridname':_0xed4948['transfereecalleridname'],'transfereeconnectedlinenum':_0xed4948[_0xb253('0xa')],'transfereeconnectedlinename':_0xed4948[_0xb253('0xb')],'transfereeaccountcode':_0xed4948['transfereeaccountcode'],'transfereecontext':_0xed4948['transfereecontext'],'transfereeexten':_0xed4948['transfereeexten'],'transfereelinkedid':_0xed4948[_0xb253('0xc')],'isexternal':_0xed4948[_0xb253('0xd')],'context':_0xed4948[_0xb253('0xe')],'extension':_0xed4948[_0xb253('0xf')],'type':_0xb253('0x10')},'log':'CreateVoiceTransferReport'});};exports[_0xb253('0x11')]=function(_0x2d089b){return client[_0xb253('0x3')](_0xb253('0x4'),{'body':{'result':_0x2d089b[_0xb253('0x12')],'transfererchannel':_0x2d089b[_0xb253('0x13')],'transferercalleridnum':_0x2d089b[_0xb253('0x14')],'transferercalleridname':_0x2d089b[_0xb253('0x15')],'transfererconnectedlinenum':_0x2d089b[_0xb253('0x16')],'transfererconnectedlinename':_0x2d089b[_0xb253('0x17')],'transfereraccountcode':_0x2d089b[_0xb253('0x18')],'transferercontext':_0x2d089b['secondtransferercontext'],'transfererexten':_0x2d089b['secondtransfererexten'],'transfererlinkedid':_0x2d089b[_0xb253('0x19')],'transfereechannel':_0x2d089b[_0xb253('0x1a')],'transfereecalleridnum':_0x2d089b[_0xb253('0x1b')],'transfereecalleridname':_0x2d089b['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x2d089b[_0xb253('0x1c')],'transfereeconnectedlinename':_0x2d089b[_0xb253('0x1d')],'transfereeaccountcode':_0x2d089b[_0xb253('0x1e')],'transfereecontext':_0x2d089b[_0xb253('0x1f')],'transfereeexten':_0x2d089b[_0xb253('0x20')],'transfereelinkedid':_0x2d089b[_0xb253('0x21')],'isexternal':_0x2d089b['isexternal'],'context':_0x2d089b['origtransferercontext'],'extension':_0x2d089b[_0xb253('0x22')],'type':_0xb253('0x23')},'log':_0xb253('0x4')});};
\ No newline at end of file
index 2ea7de1..2171735 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdbd=['sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','find','omit','undefined','values','isConnected','voicechannel','length','map','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','faxAccounts','checkAfterSend','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk','username','ami\x20disconnected','join','pick','keys','module','Action','then','catch','error','message','action','Command','voiceQueues','strategy','available','loggedIn','pTalking'];(function(_0x6a4f1f,_0x481573){var _0x37596b=function(_0x96f198){while(--_0x96f198){_0x6a4f1f['push'](_0x6a4f1f['shift']());}};_0x37596b(++_0x481573);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfdbd[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var jayson=require(_0xdfdb('0x2'));var schema=require(_0xdfdb('0x3'));var BPromise=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var config=require(_0xdfdb('0x6'));var properties=require(_0xdfdb('0x7'));var ami=require(_0xdfdb('0x8'));exports['listen']=function(_0x3f5b2d,_0x4a4a3f,_0x453ef6){return new BPromise(function(_0x41bd5e,_0x489f19){var _0x556dc0={'QueuePause':function(_0x590b5d){return new Promise(function(_0x188508,_0xf72a24){var _0x47c629=util[_0xdfdb('0x9')](_0xdfdb('0xa'),_0xdfdb('0xb'),_0x590b5d[_0xdfdb('0xc')]);if(_0x3f5b2d[_0xdfdb('0xd')]&&_0x3f5b2d[_0xdfdb('0xd')][_0x47c629]&&_0x3f5b2d[_0xdfdb('0xd')][_0x47c629]['timer']){_0x3f5b2d[_0xdfdb('0xd')][_0x47c629][_0xdfdb('0xe')]();}if(_0x3f5b2d['agents'][_0x47c629]){_0x3f5b2d[_0xdfdb('0xf')][_0x47c629][_0xdfdb('0x10')]({'statePause':_0x590b5d[_0xdfdb('0x11')]?!![]:![]});}_0x188508({'code':0xc8,'message':_0xdfdb('0x12')});});},'Reload':function(_0x2a95f1){var _0x13ada2=this;return new Promise(function(_0xf5d903,_0x16017d){if(ami['isConnected']()==![]){return _0x16017d(_0x13ada2['error'](0x1f4,[config[_0xdfdb('0x13')]['ip'],config['asterisk'][_0xdfdb('0x14')],_0xdfdb('0x15')][_0xdfdb('0x16')]('\x20')));}_0x2a95f1=_[_0xdfdb('0x17')](_0x2a95f1,_[_0xdfdb('0x18')](properties[_0xdfdb('0x19')]));_0x2a95f1['action']='Reload';return ami[_0xdfdb('0x1a')](_0x2a95f1)[_0xdfdb('0x1b')](function(_0x2c1070){_0xf5d903({'code':0xc8,'message':_0x2c1070['message']});})[_0xdfdb('0x1c')](function(_0xb677b1){_0x16017d(_0x13ada2[_0xdfdb('0x1d')](0x1f5,_0xb677b1[_0xdfdb('0x1e')]));});});},'Command':function(_0x306a33){var _0x2294de=this;return new Promise(function(_0x693a2c,_0x29a639){if(ami['isConnected']()==![]){return _0x29a639(_0x2294de[_0xdfdb('0x1d')](0x1f4,[config[_0xdfdb('0x13')]['ip'],config[_0xdfdb('0x13')]['username'],_0xdfdb('0x15')][_0xdfdb('0x16')]('\x20')));}_0x306a33=_[_0xdfdb('0x17')](_0x306a33,'command');_0x306a33[_0xdfdb('0x1f')]=_0xdfdb('0x20');return ami[_0xdfdb('0x1a')](_0x306a33)['then'](function(_0x2a80c1){_0x693a2c({'code':0xc8,'message':_0x2a80c1['content']});})[_0xdfdb('0x1c')](function(_0x145350){_0x29a639(_0x2294de[_0xdfdb('0x1d')](0x1f5,_0x145350[_0xdfdb('0x1e')]));});});},'VoiceQueues':function(_0x4f69cf){return new Promise(function(_0x4c253e,_0x4363d8){var _0x956843=[];for(var _0x400663 in _0x3f5b2d[_0xdfdb('0x21')]){if(_0x3f5b2d[_0xdfdb('0x21')]['hasOwnProperty'](_0x400663)){var _0xec4d22=_0x3f5b2d[_0xdfdb('0x21')][_0x400663];var _0xdf3a5c={'id':_0xec4d22['id'],'name':_0xec4d22['name'],'strategy':_0xec4d22[_0xdfdb('0x22')],'answered':_0xec4d22['answered'],'available':_0xec4d22[_0xdfdb('0x23')],'loggedIn':_0xec4d22[_0xdfdb('0x24')],'pTalking':_0xec4d22[_0xdfdb('0x25')],'sumBillable':_0xec4d22['sumBillable'],'sumDuration':_0xec4d22['sumDuration'],'sumHoldTime':_0xec4d22[_0xdfdb('0x26')]||0x0,'talking':_0xec4d22[_0xdfdb('0x27')],'total':_0xec4d22[_0xdfdb('0x28')],'type':_0xec4d22[_0xdfdb('0x29')],'unmanaged':_0xec4d22[_0xdfdb('0x2a')],'abandoned':_0xec4d22[_0xdfdb('0x2b')],'waiting':_0xec4d22['waiting'],'loggedInDb':_0xec4d22[_0xdfdb('0x2c')]};if(_0xec4d22[_0xdfdb('0x29')]===_0xdfdb('0x2d')){_0xdf3a5c[_0xdfdb('0x2e')]=_0xec4d22[_0xdfdb('0x2e')];_0xdf3a5c[_0xdfdb('0x2f')]=_0xec4d22[_0xdfdb('0x2f')];_0xdf3a5c[_0xdfdb('0x30')]=_0xec4d22[_0xdfdb('0x30')];_0xdf3a5c[_0xdfdb('0x31')]=_0xec4d22[_0xdfdb('0x31')];_0xdf3a5c['dialOriginateTimeout']=_0xec4d22['dialOriginateTimeout'];_0xdf3a5c[_0xdfdb('0x32')]=_0xec4d22['dialPrefix'];_0xdf3a5c[_0xdfdb('0x33')]=_0xec4d22[_0xdfdb('0x33')];_0xdf3a5c[_0xdfdb('0x34')]=_0xec4d22[_0xdfdb('0x34')];_0xdf3a5c['outboundAnswerCallsDay']=_0xec4d22[_0xdfdb('0x35')];_0xdf3a5c['outboundBlacklistCallsDay']=_0xec4d22[_0xdfdb('0x36')];_0xdf3a5c[_0xdfdb('0x37')]=_0xec4d22[_0xdfdb('0x37')];_0xdf3a5c[_0xdfdb('0x38')]=_0xec4d22[_0xdfdb('0x38')];_0xdf3a5c[_0xdfdb('0x39')]=_0xec4d22['outboundDropCallsDayACS'];_0xdf3a5c[_0xdfdb('0x3a')]=_0xec4d22[_0xdfdb('0x3a')];_0xdf3a5c['outboundDropCallsDayTimeout']=_0xec4d22[_0xdfdb('0x3b')];_0xdf3a5c[_0xdfdb('0x3c')]=_0xec4d22[_0xdfdb('0x3c')];_0xdf3a5c[_0xdfdb('0x3d')]=_0xec4d22[_0xdfdb('0x3d')];_0xdf3a5c[_0xdfdb('0x3e')]=_0xec4d22[_0xdfdb('0x3e')];_0xdf3a5c[_0xdfdb('0x3f')]=_0xec4d22[_0xdfdb('0x3f')];_0xdf3a5c[_0xdfdb('0x40')]=_0xec4d22[_0xdfdb('0x40')];_0xdf3a5c['outboundUnknownCallsDay']=_0xec4d22[_0xdfdb('0x41')];_0xdf3a5c[_0xdfdb('0x42')]=_0xec4d22[_0xdfdb('0x42')];_0xdf3a5c[_0xdfdb('0x43')]=_0xec4d22[_0xdfdb('0x43')];_0xdf3a5c[_0xdfdb('0x44')]=_0xec4d22[_0xdfdb('0x44')];_0xdf3a5c[_0xdfdb('0x45')]=_0xec4d22['predictiveIntervalDroppedCallsCallersExit'];_0xdf3a5c['predictiveIntervalDroppedCallsTimeout']=_0xec4d22[_0xdfdb('0x46')];_0xdf3a5c[_0xdfdb('0x47')]=_0xec4d22[_0xdfdb('0x47')];_0xdf3a5c[_0xdfdb('0x48')]=_0xec4d22[_0xdfdb('0x48')];_0xdf3a5c[_0xdfdb('0x49')]=_0xec4d22[_0xdfdb('0x49')];_0xdf3a5c[_0xdfdb('0x4a')]=_0xec4d22[_0xdfdb('0x4a')];_0xdf3a5c['predictiveIntervalPauses']=_0xec4d22[_0xdfdb('0x4b')];_0xdf3a5c[_0xdfdb('0x4c')]=_0xec4d22[_0xdfdb('0x4c')];_0xdf3a5c[_0xdfdb('0x4d')]=_0xec4d22[_0xdfdb('0x4d')];_0xdf3a5c['message']=_0xec4d22[_0xdfdb('0x1e')];_0xdf3a5c[_0xdfdb('0x4e')]=_0xec4d22[_0xdfdb('0x4e')];_0xdf3a5c[_0xdfdb('0x4f')]=_0xec4d22[_0xdfdb('0x4f')];_0xdf3a5c['erlangCallToSecond']=_0xec4d22[_0xdfdb('0x50')];_0xdf3a5c[_0xdfdb('0x51')]=_0xec4d22[_0xdfdb('0x51')];_0xdf3a5c['erlangBusyFactor']=_0xec4d22[_0xdfdb('0x52')];_0xdf3a5c['startPredictive']=_0xec4d22[_0xdfdb('0x53')];_0xdf3a5c['startProgressive']=_0xec4d22[_0xdfdb('0x54')];}if(_0xec4d22[_0xdfdb('0x55')]){_0xdf3a5c['Trunk']={'id':_0xec4d22[_0xdfdb('0x55')]['id'],'name':_0xec4d22['Trunk'][_0xdfdb('0xc')],'active':_0xec4d22[_0xdfdb('0x55')][_0xdfdb('0x56')],'callerid':_0xec4d22[_0xdfdb('0x55')][_0xdfdb('0x57')]};}if(_0xec4d22['Interval']){_0xdf3a5c['Interval']={'id':_0xec4d22[_0xdfdb('0x58')]['id'],'name':_0xec4d22[_0xdfdb('0x58')]['name']};}_0x956843[_0xdfdb('0x59')](_0xdf3a5c);}}_0x4c253e({'count':_0x956843['length'],'rows':_0x956843});});},'UpdateVoiceQueue':function(_0xa7be4b){return new Promise(function(_0x158407,_0x8b1db1){var _0x103166=_[_0xdfdb('0x5a')](_0x3f5b2d[_0xdfdb('0x21')],{'id':parseInt(_0xa7be4b['id'])});var _0x41701c=_[_0xdfdb('0x5b')](_0xa7be4b,['id']);if(_0x103166){for(var _0x2ac36e in _0x41701c){if(typeof _0x41701c[_0x2ac36e]!==_0xdfdb('0x5c')&&typeof _0x103166[_0x2ac36e]!==_0xdfdb('0x5c')){_0x103166[_0x2ac36e]=_0x41701c[_0x2ac36e];}}_0x158407(_0x103166);}else{_0x8b1db1();}});},'VoiceChannels':function(_0x3c8460){return new Promise(function(_0x2d58f4,_0x202c25){var _0x1c08fb=_[_0xdfdb('0x5d')](_0x3f5b2d['channels']);_0x2d58f4({'count':_0x1c08fb['length'],'rows':_0x1c08fb});});},'VoiceChannelMixMonitor':function(_0x6b03a3){var _0x1aff71=this;return new Promise(function(_0x2f1d06,_0x4bbb88){if(ami[_0xdfdb('0x5e')]()==![]){return _0x4bbb88(_0x1aff71[_0xdfdb('0x1d')](0x1f4,[config[_0xdfdb('0x13')]['ip'],config[_0xdfdb('0x13')]['username'],_0xdfdb('0x15')][_0xdfdb('0x16')]('\x20')));}var _0x5446f6=schema(properties[_0xdfdb('0x5f')])[_0xdfdb('0x3')](_0x6b03a3);if(_0x5446f6[_0xdfdb('0x60')]>0x0){return _0x4bbb88(_0x1aff71[_0xdfdb('0x1d')](0x1f4,_[_0xdfdb('0x61')](_0x5446f6,_0xdfdb('0x1e'))[_0xdfdb('0x16')](',\x20')));}var _0x1f5b88=_[_0xdfdb('0x5a')](_0x3f5b2d['channels'],{'uniqueid':_0x6b03a3[_0xdfdb('0x62')]});if(_0x1f5b88&&_0x1f5b88['channel']){var _0x15185c=util[_0xdfdb('0x9')](_0xdfdb('0x63'),_0x6b03a3[_0xdfdb('0x64')]||_0x6b03a3[_0xdfdb('0x62')],_0x6b03a3[_0xdfdb('0x9')]||_0xdfdb('0x65'));return ami['Action']({'action':_0xdfdb('0x66'),'channel':_0x1f5b88[_0xdfdb('0x67')],'file':_0x15185c,'options':_0xdfdb('0x68')})[_0xdfdb('0x1b')](function(_0xd2b334){var _0x5018a0=_[_0xdfdb('0x5a')](_0x1f5b88['monitors'],{'filename':_0xdfdb('0x69')+_0x15185c[_0xdfdb('0x6a')]()});if(_[_0xdfdb('0x6b')](_0x5018a0)){_0x1f5b88[_0xdfdb('0x6c')][_0xdfdb('0x59')]({'filename':'/var/spool/asterisk/monitor/'+_0x15185c[_0xdfdb('0x6a')](),'createdAt':moment()[_0xdfdb('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0xd2b334[_0xdfdb('0x6d')],'status':_0xdfdb('0x6e')});}else{_0x5018a0[_0xdfdb('0x6d')]=_0xd2b334['mixmonitorid'];_0x5018a0[_0xdfdb('0x6f')]=_0xdfdb('0x6e');}_0x2f1d06({'code':0xc8,'message':[_0x6b03a3[_0xdfdb('0x62')],_0xdfdb('0x70'),_0xd2b334[_0xdfdb('0x6d')]][_0xdfdb('0x16')]('\x20'),'mixmonitorid':_0xd2b334['mixmonitorid']});})['catch'](function(_0x21b486){_0x4bbb88(_0x1aff71['error'](0x1f5,[_0x6b03a3['uniqueid'],_0x21b486['message'][_0xdfdb('0x6a')]()][_0xdfdb('0x16')]('\x20')));});}else{return _0x4bbb88(_0x1aff71[_0xdfdb('0x1d')](0x1f5,_0xdfdb('0x71')));}});},'VoiceChannelStopMixMonitor':function(_0x8bd5c0){var _0x17834e=this;return new Promise(function(_0xa1d520,_0x1132ca){if(ami[_0xdfdb('0x5e')]()==![]){return _0x1132ca(_0x17834e['error'](0x1f4,[config['asterisk']['ip'],config[_0xdfdb('0x13')]['username'],_0xdfdb('0x15')][_0xdfdb('0x16')]('\x20')));}var _0x3ec0c6=schema(properties['voicechannel'])[_0xdfdb('0x3')](_0x8bd5c0);if(_0x3ec0c6[_0xdfdb('0x60')]>0x0){return _0x1132ca(_0x17834e[_0xdfdb('0x1d')](0x1f4,_[_0xdfdb('0x61')](_0x3ec0c6,_0xdfdb('0x1e'))[_0xdfdb('0x16')](',\x20')));}var _0x7e6cd1=_[_0xdfdb('0x5a')](_0x3f5b2d['channels'],{'uniqueid':_0x8bd5c0[_0xdfdb('0x62')]});if(_0x7e6cd1){return BPromise[_0xdfdb('0x72')]()['then'](function(){if(_0x7e6cd1[_0xdfdb('0x67')]){return ami[_0xdfdb('0x1a')]({'action':_0xdfdb('0x73'),'channel':_0x7e6cd1[_0xdfdb('0x67')],'mixmonitorid':_0x8bd5c0['mixmonitorid']})['catch'](function(_0x140467){});}})[_0xdfdb('0x1b')](function(){if(_0x7e6cd1['destinationchannel']){return ami[_0xdfdb('0x1a')]({'action':_0xdfdb('0x73'),'channel':_0x7e6cd1[_0xdfdb('0x74')],'mixmonitorid':_0x8bd5c0['mixmonitorid']})['catch'](function(_0x42ad97){});}})[_0xdfdb('0x1b')](function(_0x5cfade){var _0x57ac74=_[_0xdfdb('0x5a')](_0x7e6cd1['monitors'],{'mixmonitorid':_0x8bd5c0['mixmonitorid']});if(_0x57ac74){_0x57ac74[_0xdfdb('0x6f')]='stop';}})[_0xdfdb('0x1b')](function(){var _0x1f0727=util['format']('%s.%s',_0x8bd5c0[_0xdfdb('0x64')]||_0x8bd5c0[_0xdfdb('0x62')],_0x8bd5c0['format']||_0xdfdb('0x65'));var _0xe7a000=_[_0xdfdb('0x5a')](_0x7e6cd1[_0xdfdb('0x6c')],{'filename':_0xdfdb('0x69')+_0x1f0727['toLowerCase']()});if(_0xe7a000){_0xe7a000['status']=_0xdfdb('0x75');}})[_0xdfdb('0x1b')](function(){_0xa1d520({'code':0xc8,'message':[_0x8bd5c0[_0xdfdb('0x62')],_0xdfdb('0x76')][_0xdfdb('0x16')]('\x20')});})[_0xdfdb('0x1c')](function(_0x505073){_0x1132ca(_0x17834e[_0xdfdb('0x1d')](0x1f5,[_0x8bd5c0[_0xdfdb('0x62')],_0x505073[_0xdfdb('0x1e')][_0xdfdb('0x6a')]()][_0xdfdb('0x16')]('\x20')));});}else{return _0x1132ca(_0x17834e[_0xdfdb('0x1d')](0x1f5,_0xdfdb('0x71')));}});},'VoiceQueuesChannels':function(_0x4cdcdc){return new Promise(function(_0x38fa9c,_0x3eca7f){var _0x5ae367=_[_0xdfdb('0x5d')](_0x3f5b2d[_0xdfdb('0x77')]);_0x38fa9c({'count':_0x5ae367[_0xdfdb('0x60')],'rows':_0x5ae367});});},'VoiceQueuesChannel':function(_0x45bfc0){var _0x2c9405=this;return new Promise(function(_0x590a16,_0x2df838){var _0x2b9971=schema(properties[_0xdfdb('0x78')])[_0xdfdb('0x3')](_0x45bfc0);if(_0x2b9971['length']>0x0){return _0x2df838(_0x2c9405[_0xdfdb('0x1d')](0x1f4,_[_0xdfdb('0x61')](_0x2b9971,_0xdfdb('0x1e'))[_0xdfdb('0x16')](',\x20')));}var _0x2edd45=_[_0xdfdb('0x5a')](_0x3f5b2d[_0xdfdb('0x77')],{'uniqueid':_0x45bfc0[_0xdfdb('0x62')]});if(_0x2edd45){_0x590a16(_0x2edd45);}else{return _0x2df838(_0x2c9405[_0xdfdb('0x1d')](0x1f5,_0xdfdb('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x4eacf){var _0x5ea604=this;return new Promise(function(_0x1bf0d2,_0x616d29){if(ami['isConnected']()==![]){return _0x616d29(_0x5ea604[_0xdfdb('0x1d')](0x1f4,[config[_0xdfdb('0x13')]['ip'],config[_0xdfdb('0x13')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x9f2170=schema(properties[_0xdfdb('0x79')])[_0xdfdb('0x3')](_0x4eacf);if(_0x9f2170[_0xdfdb('0x60')]>0x0){return _0x616d29(_0x5ea604[_0xdfdb('0x1d')](0x1f4,_[_0xdfdb('0x61')](_0x9f2170,_0xdfdb('0x1e'))['join'](',\x20')));}var _0x7f85ce=_[_0xdfdb('0x5a')](_0x3f5b2d[_0xdfdb('0x77')],{'uniqueid':_0x4eacf[_0xdfdb('0x62')]});if(_0x7f85ce&&_0x7f85ce[_0xdfdb('0x67')]){return ami[_0xdfdb('0x1a')]({'action':_0xdfdb('0x7a'),'channel':_0x7f85ce['channel']})[_0xdfdb('0x1b')](function(_0x117cd7){_0x1bf0d2({'code':0xc8,'message':[_0x4eacf[_0xdfdb('0x62')],_0x117cd7[_0xdfdb('0x1e')][_0xdfdb('0x6a')]()]['join']('\x20')});})[_0xdfdb('0x1c')](function(_0x56a633){_0x616d29(_0x5ea604[_0xdfdb('0x1d')](0x1f5,[_0x4eacf[_0xdfdb('0x62')],_0x56a633[_0xdfdb('0x1e')][_0xdfdb('0x6a')]()][_0xdfdb('0x16')]('\x20')));});}else{return _0x616d29(_0x5ea604['error'](0x1f5,_0xdfdb('0x71')));}});},'VoiceQueuesChannelRedirect':function(_0x1f8e13){var _0x55cf4d=this;return new Promise(function(_0x5f32f7,_0x284439){if(ami['isConnected']()==![]){return _0x284439(_0x55cf4d['error'](0x1f4,[config[_0xdfdb('0x13')]['ip'],config[_0xdfdb('0x13')][_0xdfdb('0x14')],_0xdfdb('0x15')][_0xdfdb('0x16')]('\x20')));}var _0x4669c2=schema(properties[_0xdfdb('0x7b')])[_0xdfdb('0x3')](_0x1f8e13);if(_0x4669c2['length']>0x0){return _0x284439(_0x55cf4d[_0xdfdb('0x1d')](0x1f4,_['map'](_0x4669c2,_0xdfdb('0x1e'))[_0xdfdb('0x16')](',\x20')));}var _0xffc426=_[_0xdfdb('0x5a')](_0x3f5b2d[_0xdfdb('0x77')],{'uniqueid':_0x1f8e13['uniqueid']});if(_0xffc426&&_0xffc426[_0xdfdb('0x67')]){return ami[_0xdfdb('0x1a')]({'action':_0xdfdb('0x7c'),'channel':_0xffc426[_0xdfdb('0x67')],'exten':_0x1f8e13[_0xdfdb('0x7d')],'context':_0x1f8e13['context']||_0xffc426['context'],'priority':0x1})[_0xdfdb('0x1b')](function(_0x68fad5){_0x5f32f7({'code':0xc8,'message':[_0x1f8e13['uniqueid'],_0x68fad5[_0xdfdb('0x1e')]['toLowerCase']()][_0xdfdb('0x16')]('\x20')});})[_0xdfdb('0x1c')](function(_0xeadf25){_0x284439(_0x55cf4d['error'](0x1f5,[_0x1f8e13[_0xdfdb('0x62')],_0xeadf25['message']['toLowerCase']()][_0xdfdb('0x16')]('\x20')));});}else{return _0x284439(_0x55cf4d['error'](0x1f5,_0xdfdb('0x71')));}});},'Agents':function(_0x3a16e2){return new Promise(function(_0x162eeb,_0x24bd3c){var _0x191d45=_[_0xdfdb('0x5d')](_0x3f5b2d[_0xdfdb('0xf')]);_0x162eeb({'count':_0x191d45[_0xdfdb('0x60')],'rows':_0x191d45});});},'Telephones':function(_0x1fb331){return new Promise(function(_0x40cfba,_0x5ed460){var _0x5d2dc1=_[_0xdfdb('0x5d')](_0x3f5b2d['telephones']);_0x40cfba({'count':_0x5d2dc1['length'],'rows':_0x5d2dc1});});},'Trunks':function(_0x5542da){return new Promise(function(_0x4dcfbd,_0x197f51){var _0x2caabb=_[_0xdfdb('0x5d')](_0x3f5b2d[_0xdfdb('0x7e')]);_0x4dcfbd({'count':_0x2caabb[_0xdfdb('0x60')],'rows':_0x2caabb});});},'OutboundChannels':function(_0x12f4f7){return new Promise(function(_0x479488,_0x114373){var _0x258738=_[_0xdfdb('0x5d')](_0x3f5b2d[_0xdfdb('0x7f')]);_0x479488({'count':_0x258738[_0xdfdb('0x60')],'rows':_0x258738});});},'Outbound':function(_0x309be3){return new Promise(function(_0x561ced,_0x5979fa){_0x561ced(_0x3f5b2d[_0xdfdb('0x2d')]);});},'Campaigns':function(_0x45fcae){return new Promise(function(_0x5837da,_0x82e712){var _0x44d944=_[_0xdfdb('0x5d')](_0x3f5b2d[_0xdfdb('0x80')]);_0x5837da({'count':_0x44d944[_0xdfdb('0x60')],'rows':_0x44d944});});},'VoiceQueuesPreview':function(_0xd72296){var _0x5bc5a9=this;return new Promise(function(_0x306e18,_0x3a2d02){_0x4a4a3f[_0xdfdb('0x81')](_0xd72296['id'])[_0xdfdb('0x1b')](function(_0x23cbd0){_0x306e18({'code':0xc8,'message':_0x23cbd0[_0xdfdb('0x1e')]});})['catch'](function(_0x156da8){_0x3a2d02(_0x5bc5a9[_0xdfdb('0x1d')](0x1f4,_0x156da8[_0xdfdb('0x1e')]));});});},'EventManager':function(_0x3c09ec){var _0x370c7b=this;return new Promise(function(_0x2bd06f,_0x5e67bd){if(!_0x3c09ec[_0xdfdb('0x82')]){return _0x5e67bd(_0x370c7b[_0xdfdb('0x1d')](0x1f4,_0xdfdb('0x83')));}ami['emit']('custom:'+_0x3c09ec[_0xdfdb('0x82')],_0x3c09ec['message']);_0x2bd06f({'code':0xc8,'message':_0x3c09ec});});},'FaxAccounts':function(_0x5c7601){return new Promise(function(_0x276efc,_0x27c72c){var _0x57d5e3=_['values'](_0x3f5b2d[_0xdfdb('0x84')]);_0x276efc({'count':_0x57d5e3[_0xdfdb('0x60')],'rows':_0x57d5e3});});},'SendFax':function(_0x1f87d3){var _0x1bc293=this;return new Promise(function(_0x36b01e,_0x5b883b){_0x453ef6['send'](_0x1f87d3)[_0xdfdb('0x1b')](function(_0x576570){_0x36b01e({'code':0xc8,'message':_0x576570[_0xdfdb('0x1e')]});})[_0xdfdb('0x1c')](function(_0x3c9465){_0x5b883b(_0x1bc293['error'](0x1f4,_0x3c9465[_0xdfdb('0x1e')]));});});},'CheckAfterSend':function(_0x38a439){var _0x3e0208=this;return new Promise(function(_0x14293d,_0x4c08d0){_0x453ef6[_0xdfdb('0x85')](_0x38a439)[_0xdfdb('0x1b')](function(_0x3fe95d){_0x14293d({'code':0xc8,'message':_0x3fe95d[_0xdfdb('0x1e')]});})['catch'](function(_0xa31219){_0x4c08d0(_0x3e0208['error'](0x1f4,_0xa31219['message']));});});}};var _0x55a7d2=jayson['server'](_0x556dc0)['http']();_0x55a7d2['on'](_0xdfdb('0x1d'),function(_0xe8ac6c){return _0x489f19(_0xe8ac6c);});_0x55a7d2[_0xdfdb('0x86')](0x232a,_0xdfdb('0x87'),function(){console[_0xdfdb('0x88')](_0xdfdb('0x89'),0x232a);return _0x41bd5e(_0xdfdb('0x8a')+0x232a);});});};
\ No newline at end of file
+var _0xaa37=['values','username','voicechannel','map','channel','%s.%s','filename','uniqueid','MixMonitor','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','agents','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','Reload','then','catch','message','command','action','Action','content','voiceQueues','hasOwnProperty','answered','available','loggedIn','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','undefined'];(function(_0x4ce226,_0x1f7b6f){var _0x3478e6=function(_0x1cd541){while(--_0x1cd541){_0x4ce226['push'](_0x4ce226['shift']());}};_0x3478e6(++_0x1f7b6f);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xaa37[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var jayson=require(_0x7aa3('0x2'));var schema=require(_0x7aa3('0x3'));var BPromise=require('bluebird');var moment=require(_0x7aa3('0x4'));var config=require(_0x7aa3('0x5'));var properties=require(_0x7aa3('0x6'));var ami=require(_0x7aa3('0x7'));exports[_0x7aa3('0x8')]=function(_0x2801a2,_0x2679bb,_0x5b738a){return new BPromise(function(_0x437b90,_0xbbcc8a){var _0x5d1627={'QueuePause':function(_0x100894){return new Promise(function(_0x390c82,_0x394097){var _0x4f43f1=util[_0x7aa3('0x9')](_0x7aa3('0xa'),_0x7aa3('0xb'),_0x100894[_0x7aa3('0xc')]);if(_0x2801a2[_0x7aa3('0xd')]&&_0x2801a2[_0x7aa3('0xd')][_0x4f43f1]&&_0x2801a2['timers'][_0x4f43f1]['timer']){_0x2801a2[_0x7aa3('0xd')][_0x4f43f1]['updateAcw']();}if(_0x2801a2[_0x7aa3('0xe')][_0x4f43f1]){_0x2801a2[_0x7aa3('0xe')][_0x4f43f1]['updateStatusRealtime']({'statePause':_0x100894[_0x7aa3('0xf')]?!![]:![]});}_0x390c82({'code':0xc8,'message':_0x7aa3('0x10')});});},'Reload':function(_0x552ec9){var _0x5a6751=this;return new Promise(function(_0x4b844b,_0x1a7474){if(ami[_0x7aa3('0x11')]()==![]){return _0x1a7474(_0x5a6751[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')]['username'],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}_0x552ec9=_[_0x7aa3('0x16')](_0x552ec9,_[_0x7aa3('0x17')](properties['module']));_0x552ec9['action']=_0x7aa3('0x18');return ami['Action'](_0x552ec9)[_0x7aa3('0x19')](function(_0x3f9a75){_0x4b844b({'code':0xc8,'message':_0x3f9a75['message']});})[_0x7aa3('0x1a')](function(_0xe5e683){_0x1a7474(_0x5a6751[_0x7aa3('0x12')](0x1f5,_0xe5e683[_0x7aa3('0x1b')]));});});},'Command':function(_0x12fdd3){var _0x5994b6=this;return new Promise(function(_0x22e93b,_0x266529){if(ami[_0x7aa3('0x11')]()==![]){return _0x266529(_0x5994b6[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')]['username'],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}_0x12fdd3=_[_0x7aa3('0x16')](_0x12fdd3,_0x7aa3('0x1c'));_0x12fdd3[_0x7aa3('0x1d')]='Command';return ami[_0x7aa3('0x1e')](_0x12fdd3)[_0x7aa3('0x19')](function(_0x2a6773){_0x22e93b({'code':0xc8,'message':_0x2a6773[_0x7aa3('0x1f')]});})[_0x7aa3('0x1a')](function(_0x10887d){_0x266529(_0x5994b6[_0x7aa3('0x12')](0x1f5,_0x10887d[_0x7aa3('0x1b')]));});});},'VoiceQueues':function(_0x1d5271){return new Promise(function(_0x23f168,_0x44377a){var _0x1c5fef=[];for(var _0x1f1d82 in _0x2801a2['voiceQueues']){if(_0x2801a2[_0x7aa3('0x20')][_0x7aa3('0x21')](_0x1f1d82)){var _0x3c1422=_0x2801a2[_0x7aa3('0x20')][_0x1f1d82];var _0x183ffc={'id':_0x3c1422['id'],'name':_0x3c1422[_0x7aa3('0xc')],'strategy':_0x3c1422['strategy'],'answered':_0x3c1422[_0x7aa3('0x22')],'available':_0x3c1422[_0x7aa3('0x23')],'loggedIn':_0x3c1422[_0x7aa3('0x24')],'pTalking':_0x3c1422['pTalking'],'sumBillable':_0x3c1422[_0x7aa3('0x25')],'sumDuration':_0x3c1422[_0x7aa3('0x26')],'sumHoldTime':_0x3c1422['sumHoldTime']||0x0,'talking':_0x3c1422[_0x7aa3('0x27')],'total':_0x3c1422[_0x7aa3('0x28')],'type':_0x3c1422[_0x7aa3('0x29')],'unmanaged':_0x3c1422[_0x7aa3('0x2a')],'abandoned':_0x3c1422[_0x7aa3('0x2b')],'waiting':_0x3c1422[_0x7aa3('0x2c')],'loggedInDb':_0x3c1422[_0x7aa3('0x2d')]};if(_0x3c1422[_0x7aa3('0x29')]===_0x7aa3('0x2e')){_0x183ffc[_0x7aa3('0x2f')]=_0x3c1422[_0x7aa3('0x2f')];_0x183ffc[_0x7aa3('0x30')]=_0x3c1422[_0x7aa3('0x30')];_0x183ffc[_0x7aa3('0x31')]=_0x3c1422[_0x7aa3('0x31')];_0x183ffc[_0x7aa3('0x32')]=_0x3c1422[_0x7aa3('0x32')];_0x183ffc[_0x7aa3('0x33')]=_0x3c1422[_0x7aa3('0x33')];_0x183ffc[_0x7aa3('0x34')]=_0x3c1422[_0x7aa3('0x34')];_0x183ffc['temp']=_0x3c1422[_0x7aa3('0x35')];_0x183ffc[_0x7aa3('0x36')]=_0x3c1422[_0x7aa3('0x36')];_0x183ffc[_0x7aa3('0x37')]=_0x3c1422[_0x7aa3('0x37')];_0x183ffc[_0x7aa3('0x38')]=_0x3c1422[_0x7aa3('0x38')];_0x183ffc[_0x7aa3('0x39')]=_0x3c1422[_0x7aa3('0x39')];_0x183ffc[_0x7aa3('0x3a')]=_0x3c1422[_0x7aa3('0x3a')];_0x183ffc['outboundDropCallsDayACS']=_0x3c1422[_0x7aa3('0x3b')];_0x183ffc[_0x7aa3('0x3c')]=_0x3c1422[_0x7aa3('0x3c')];_0x183ffc[_0x7aa3('0x3d')]=_0x3c1422[_0x7aa3('0x3d')];_0x183ffc[_0x7aa3('0x3e')]=_0x3c1422[_0x7aa3('0x3e')];_0x183ffc[_0x7aa3('0x3f')]=_0x3c1422[_0x7aa3('0x3f')];_0x183ffc[_0x7aa3('0x40')]=_0x3c1422[_0x7aa3('0x40')];_0x183ffc[_0x7aa3('0x41')]=_0x3c1422[_0x7aa3('0x41')];_0x183ffc[_0x7aa3('0x42')]=_0x3c1422['outboundRejectCallsDay'];_0x183ffc[_0x7aa3('0x43')]=_0x3c1422[_0x7aa3('0x43')];_0x183ffc[_0x7aa3('0x44')]=_0x3c1422[_0x7aa3('0x44')];_0x183ffc['predictiveIntervalAvgHoldtime']=_0x3c1422[_0x7aa3('0x45')];_0x183ffc['predictiveIntervalAvgTalktime']=_0x3c1422[_0x7aa3('0x46')];_0x183ffc[_0x7aa3('0x47')]=_0x3c1422[_0x7aa3('0x47')];_0x183ffc[_0x7aa3('0x48')]=_0x3c1422[_0x7aa3('0x48')];_0x183ffc[_0x7aa3('0x49')]=_0x3c1422[_0x7aa3('0x49')];_0x183ffc[_0x7aa3('0x4a')]=_0x3c1422[_0x7aa3('0x4a')];_0x183ffc[_0x7aa3('0x4b')]=_0x3c1422['predictiveIntervalHitRate'];_0x183ffc[_0x7aa3('0x4c')]=_0x3c1422[_0x7aa3('0x4c')];_0x183ffc[_0x7aa3('0x4d')]=_0x3c1422[_0x7aa3('0x4d')];_0x183ffc[_0x7aa3('0x4e')]=_0x3c1422[_0x7aa3('0x4e')];_0x183ffc[_0x7aa3('0x4f')]=_0x3c1422[_0x7aa3('0x4f')];_0x183ffc[_0x7aa3('0x1b')]=_0x3c1422[_0x7aa3('0x1b')];_0x183ffc[_0x7aa3('0x50')]=_0x3c1422[_0x7aa3('0x50')];_0x183ffc[_0x7aa3('0x51')]=_0x3c1422[_0x7aa3('0x51')];_0x183ffc['erlangCallToSecond']=_0x3c1422[_0x7aa3('0x52')];_0x183ffc[_0x7aa3('0x53')]=_0x3c1422['erlangAbandonmentRate'];_0x183ffc[_0x7aa3('0x54')]=_0x3c1422[_0x7aa3('0x54')];_0x183ffc['startPredictive']=_0x3c1422[_0x7aa3('0x55')];_0x183ffc[_0x7aa3('0x56')]=_0x3c1422[_0x7aa3('0x56')];}if(_0x3c1422[_0x7aa3('0x57')]){_0x183ffc['Trunk']={'id':_0x3c1422['Trunk']['id'],'name':_0x3c1422[_0x7aa3('0x57')]['name'],'active':_0x3c1422[_0x7aa3('0x57')]['active'],'callerid':_0x3c1422['Trunk'][_0x7aa3('0x58')]};}if(_0x3c1422[_0x7aa3('0x59')]){_0x183ffc[_0x7aa3('0x59')]={'id':_0x3c1422[_0x7aa3('0x59')]['id'],'name':_0x3c1422[_0x7aa3('0x59')]['name']};}_0x1c5fef[_0x7aa3('0x5a')](_0x183ffc);}}_0x23f168({'count':_0x1c5fef[_0x7aa3('0x5b')],'rows':_0x1c5fef});});},'UpdateVoiceQueue':function(_0x5a5a88){return new Promise(function(_0x262a16,_0xcf97e0){var _0x3cdcfe=_['find'](_0x2801a2[_0x7aa3('0x20')],{'id':parseInt(_0x5a5a88['id'])});var _0x2d8e1d=_['omit'](_0x5a5a88,['id']);if(_0x3cdcfe){for(var _0x2cc4aa in _0x2d8e1d){if(typeof _0x2d8e1d[_0x2cc4aa]!==_0x7aa3('0x5c')&&typeof _0x3cdcfe[_0x2cc4aa]!=='undefined'){_0x3cdcfe[_0x2cc4aa]=_0x2d8e1d[_0x2cc4aa];}}_0x262a16(_0x3cdcfe);}else{_0xcf97e0();}});},'VoiceChannels':function(_0x4a2bfd){return new Promise(function(_0x368e27,_0x1a990){var _0x41f9fe=_[_0x7aa3('0x5d')](_0x2801a2['channels']);_0x368e27({'count':_0x41f9fe['length'],'rows':_0x41f9fe});});},'VoiceChannelMixMonitor':function(_0x41cbac){var _0x1d9ace=this;return new Promise(function(_0x1ccd3d,_0x16ad02){if(ami['isConnected']()==![]){return _0x16ad02(_0x1d9ace['error'](0x1f4,[config['asterisk']['ip'],config[_0x7aa3('0x13')][_0x7aa3('0x5e')],_0x7aa3('0x14')]['join']('\x20')));}var _0x24017d=schema(properties[_0x7aa3('0x5f')])[_0x7aa3('0x3')](_0x41cbac);if(_0x24017d[_0x7aa3('0x5b')]>0x0){return _0x16ad02(_0x1d9ace[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x24017d,'message')[_0x7aa3('0x15')](',\x20')));}var _0x4d93c0=_['find'](_0x2801a2['channels'],{'uniqueid':_0x41cbac['uniqueid']});if(_0x4d93c0&&_0x4d93c0[_0x7aa3('0x61')]){var _0x2b6d01=util['format'](_0x7aa3('0x62'),_0x41cbac[_0x7aa3('0x63')]||_0x41cbac[_0x7aa3('0x64')],_0x41cbac['format']||'wav');return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x65'),'channel':_0x4d93c0[_0x7aa3('0x61')],'file':_0x2b6d01,'options':'ai(mixmonitorid)'})['then'](function(_0x53bb2e){var _0x5c6f1f=_[_0x7aa3('0x66')](_0x4d93c0[_0x7aa3('0x67')],{'filename':_0x7aa3('0x68')+_0x2b6d01[_0x7aa3('0x69')]()});if(_['isNil'](_0x5c6f1f)){_0x4d93c0[_0x7aa3('0x67')][_0x7aa3('0x5a')]({'filename':_0x7aa3('0x68')+_0x2b6d01[_0x7aa3('0x69')](),'createdAt':moment()[_0x7aa3('0x9')](_0x7aa3('0x6a')),'mixmonitorid':_0x53bb2e[_0x7aa3('0x6b')],'status':_0x7aa3('0x6c')});}else{_0x5c6f1f['mixmonitorid']=_0x53bb2e[_0x7aa3('0x6b')];_0x5c6f1f[_0x7aa3('0x6d')]=_0x7aa3('0x6c');}_0x1ccd3d({'code':0xc8,'message':[_0x41cbac[_0x7aa3('0x64')],_0x7aa3('0x6e'),_0x53bb2e[_0x7aa3('0x6b')]][_0x7aa3('0x15')]('\x20'),'mixmonitorid':_0x53bb2e[_0x7aa3('0x6b')]});})['catch'](function(_0x88aca4){_0x16ad02(_0x1d9ace[_0x7aa3('0x12')](0x1f5,[_0x41cbac['uniqueid'],_0x88aca4[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x16ad02(_0x1d9ace[_0x7aa3('0x12')](0x1f5,_0x7aa3('0x6f')));}});},'VoiceChannelStopMixMonitor':function(_0x20dde8){var _0x9f277d=this;return new Promise(function(_0x32efc6,_0x5275ba){if(ami[_0x7aa3('0x11')]()==![]){return _0x5275ba(_0x9f277d[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')][_0x7aa3('0x5e')],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}var _0x3552d2=schema(properties[_0x7aa3('0x5f')])[_0x7aa3('0x3')](_0x20dde8);if(_0x3552d2[_0x7aa3('0x5b')]>0x0){return _0x5275ba(_0x9f277d[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x3552d2,_0x7aa3('0x1b'))['join'](',\x20')));}var _0x53d3d4=_[_0x7aa3('0x66')](_0x2801a2['channels'],{'uniqueid':_0x20dde8[_0x7aa3('0x64')]});if(_0x53d3d4){return BPromise['resolve']()['then'](function(){if(_0x53d3d4['channel']){return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x70'),'channel':_0x53d3d4[_0x7aa3('0x61')],'mixmonitorid':_0x20dde8[_0x7aa3('0x6b')]})['catch'](function(_0x448b71){});}})['then'](function(){if(_0x53d3d4['destinationchannel']){return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x70'),'channel':_0x53d3d4[_0x7aa3('0x71')],'mixmonitorid':_0x20dde8[_0x7aa3('0x6b')]})[_0x7aa3('0x1a')](function(_0x27642a){});}})[_0x7aa3('0x19')](function(_0x16724c){var _0xaf3894=_['find'](_0x53d3d4[_0x7aa3('0x67')],{'mixmonitorid':_0x20dde8[_0x7aa3('0x6b')]});if(_0xaf3894){_0xaf3894[_0x7aa3('0x6d')]=_0x7aa3('0x72');}})[_0x7aa3('0x19')](function(){var _0x4bb221=util[_0x7aa3('0x9')]('%s.%s',_0x20dde8['filename']||_0x20dde8[_0x7aa3('0x64')],_0x20dde8[_0x7aa3('0x9')]||'wav');var _0xaea2f0=_[_0x7aa3('0x66')](_0x53d3d4[_0x7aa3('0x67')],{'filename':'/var/spool/asterisk/monitor/'+_0x4bb221[_0x7aa3('0x69')]()});if(_0xaea2f0){_0xaea2f0['status']=_0x7aa3('0x72');}})[_0x7aa3('0x19')](function(){_0x32efc6({'code':0xc8,'message':[_0x20dde8[_0x7aa3('0x64')],_0x7aa3('0x73')][_0x7aa3('0x15')]('\x20')});})[_0x7aa3('0x1a')](function(_0x397c57){_0x5275ba(_0x9f277d['error'](0x1f5,[_0x20dde8[_0x7aa3('0x64')],_0x397c57[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x5275ba(_0x9f277d['error'](0x1f5,_0x7aa3('0x6f')));}});},'VoiceQueuesChannels':function(_0x4942d1){return new Promise(function(_0x442723,_0x5f30b8){var _0x254278=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x74')]);_0x442723({'count':_0x254278[_0x7aa3('0x5b')],'rows':_0x254278});});},'VoiceQueuesChannel':function(_0x558c6e){var _0x5303fa=this;return new Promise(function(_0x4a72c0,_0x4e4f7a){var _0x1f880a=schema(properties[_0x7aa3('0x75')])[_0x7aa3('0x3')](_0x558c6e);if(_0x1f880a[_0x7aa3('0x5b')]>0x0){return _0x4e4f7a(_0x5303fa[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x1f880a,_0x7aa3('0x1b'))[_0x7aa3('0x15')](',\x20')));}var _0x817cd1=_['find'](_0x2801a2['queueChannels'],{'uniqueid':_0x558c6e[_0x7aa3('0x64')]});if(_0x817cd1){_0x4a72c0(_0x817cd1);}else{return _0x4e4f7a(_0x5303fa['error'](0x1f5,_0x7aa3('0x6f')));}});},'VoiceQueuesChannelHangup':function(_0xab9995){var _0x32fa77=this;return new Promise(function(_0x4850c2,_0x23f831){if(ami[_0x7aa3('0x11')]()==![]){return _0x23f831(_0x32fa77['error'](0x1f4,[config['asterisk']['ip'],config[_0x7aa3('0x13')][_0x7aa3('0x5e')],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}var _0x34aa41=schema(properties[_0x7aa3('0x76')])[_0x7aa3('0x3')](_0xab9995);if(_0x34aa41[_0x7aa3('0x5b')]>0x0){return _0x23f831(_0x32fa77[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x34aa41,_0x7aa3('0x1b'))[_0x7aa3('0x15')](',\x20')));}var _0x29ffbe=_[_0x7aa3('0x66')](_0x2801a2[_0x7aa3('0x74')],{'uniqueid':_0xab9995['uniqueid']});if(_0x29ffbe&&_0x29ffbe[_0x7aa3('0x61')]){return ami[_0x7aa3('0x1e')]({'action':_0x7aa3('0x77'),'channel':_0x29ffbe[_0x7aa3('0x61')]})[_0x7aa3('0x19')](function(_0x53d208){_0x4850c2({'code':0xc8,'message':[_0xab9995[_0x7aa3('0x64')],_0x53d208[_0x7aa3('0x1b')][_0x7aa3('0x69')]()]['join']('\x20')});})[_0x7aa3('0x1a')](function(_0x4d7a1c){_0x23f831(_0x32fa77[_0x7aa3('0x12')](0x1f5,[_0xab9995[_0x7aa3('0x64')],_0x4d7a1c[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x23f831(_0x32fa77[_0x7aa3('0x12')](0x1f5,_0x7aa3('0x6f')));}});},'VoiceQueuesChannelRedirect':function(_0x26191f){var _0xa0b103=this;return new Promise(function(_0xd58880,_0x4b2568){if(ami[_0x7aa3('0x11')]()==![]){return _0x4b2568(_0xa0b103[_0x7aa3('0x12')](0x1f4,[config[_0x7aa3('0x13')]['ip'],config[_0x7aa3('0x13')]['username'],_0x7aa3('0x14')][_0x7aa3('0x15')]('\x20')));}var _0x5a0642=schema(properties[_0x7aa3('0x78')])[_0x7aa3('0x3')](_0x26191f);if(_0x5a0642[_0x7aa3('0x5b')]>0x0){return _0x4b2568(_0xa0b103[_0x7aa3('0x12')](0x1f4,_[_0x7aa3('0x60')](_0x5a0642,_0x7aa3('0x1b'))[_0x7aa3('0x15')](',\x20')));}var _0x2ca603=_[_0x7aa3('0x66')](_0x2801a2['queueChannels'],{'uniqueid':_0x26191f[_0x7aa3('0x64')]});if(_0x2ca603&&_0x2ca603[_0x7aa3('0x61')]){return ami['Action']({'action':_0x7aa3('0x79'),'channel':_0x2ca603['channel'],'exten':_0x26191f[_0x7aa3('0x7a')],'context':_0x26191f[_0x7aa3('0x7b')]||_0x2ca603[_0x7aa3('0x7b')],'priority':0x1})[_0x7aa3('0x19')](function(_0x517a99){_0xd58880({'code':0xc8,'message':[_0x26191f[_0x7aa3('0x64')],_0x517a99[_0x7aa3('0x1b')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x16cd57){_0x4b2568(_0xa0b103['error'](0x1f5,[_0x26191f[_0x7aa3('0x64')],_0x16cd57[_0x7aa3('0x1b')][_0x7aa3('0x69')]()][_0x7aa3('0x15')]('\x20')));});}else{return _0x4b2568(_0xa0b103['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2e7d5e){return new Promise(function(_0x142763,_0x285c34){var _0x3b8baa=_[_0x7aa3('0x5d')](_0x2801a2['agents']);_0x142763({'count':_0x3b8baa[_0x7aa3('0x5b')],'rows':_0x3b8baa});});},'Telephones':function(_0x2f17a6){return new Promise(function(_0x572e95,_0x3735a8){var _0x2def81=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x7c')]);_0x572e95({'count':_0x2def81[_0x7aa3('0x5b')],'rows':_0x2def81});});},'Trunks':function(_0x4a6858){return new Promise(function(_0x5288c6,_0x542fe3){var _0x4444b8=_['values'](_0x2801a2['trunks']);_0x5288c6({'count':_0x4444b8['length'],'rows':_0x4444b8});});},'OutboundChannels':function(_0x3baa9d){return new Promise(function(_0x1e47c1,_0x1b4146){var _0x1165a4=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x7d')]);_0x1e47c1({'count':_0x1165a4[_0x7aa3('0x5b')],'rows':_0x1165a4});});},'Outbound':function(_0x41a8f2){return new Promise(function(_0x4a53b5,_0xeb18b7){_0x4a53b5(_0x2801a2[_0x7aa3('0x2e')]);});},'Campaigns':function(_0x347807){return new Promise(function(_0x294a35,_0x1ee74e){var _0xc6a9dc=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x7e')]);_0x294a35({'count':_0xc6a9dc[_0x7aa3('0x5b')],'rows':_0xc6a9dc});});},'VoiceQueuesPreview':function(_0x593e3e){var _0x4e67d5=this;return new Promise(function(_0xb15dc0,_0x1ed982){_0x2679bb[_0x7aa3('0x7f')](_0x593e3e['id'])[_0x7aa3('0x19')](function(_0x2bc37a){_0xb15dc0({'code':0xc8,'message':_0x2bc37a[_0x7aa3('0x1b')]});})[_0x7aa3('0x1a')](function(_0x8a57ea){_0x1ed982(_0x4e67d5[_0x7aa3('0x12')](0x1f4,_0x8a57ea[_0x7aa3('0x1b')]));});});},'EventManager':function(_0x1ba1cc){var _0x50f320=this;return new Promise(function(_0x33e263,_0x4120d1){if(!_0x1ba1cc['event']){return _0x4120d1(_0x50f320[_0x7aa3('0x12')](0x1f4,_0x7aa3('0x80')));}ami[_0x7aa3('0x81')](_0x7aa3('0x82')+_0x1ba1cc[_0x7aa3('0x83')],_0x1ba1cc[_0x7aa3('0x1b')]);_0x33e263({'code':0xc8,'message':_0x1ba1cc});});},'FaxAccounts':function(_0x576379){return new Promise(function(_0x590077,_0x509caf){var _0x176c3f=_[_0x7aa3('0x5d')](_0x2801a2[_0x7aa3('0x84')]);_0x590077({'count':_0x176c3f[_0x7aa3('0x5b')],'rows':_0x176c3f});});},'SendFax':function(_0x42e1c8){var _0x43bbb9=this;return new Promise(function(_0x1b8cbe,_0x1da203){_0x5b738a[_0x7aa3('0x85')](_0x42e1c8)[_0x7aa3('0x19')](function(_0x1e3a8a){_0x1b8cbe({'code':0xc8,'message':_0x1e3a8a[_0x7aa3('0x1b')]});})[_0x7aa3('0x1a')](function(_0x1c2195){_0x1da203(_0x43bbb9['error'](0x1f4,_0x1c2195[_0x7aa3('0x1b')]));});});},'CheckAfterSend':function(_0x55515d){var _0x4c2b21=this;return new Promise(function(_0x4c838a,_0x3a0b89){_0x5b738a['checkAfterSend'](_0x55515d)[_0x7aa3('0x19')](function(_0x2954a3){_0x4c838a({'code':0xc8,'message':_0x2954a3[_0x7aa3('0x1b')]});})[_0x7aa3('0x1a')](function(_0xe33081){_0x3a0b89(_0x4c2b21[_0x7aa3('0x12')](0x1f4,_0xe33081[_0x7aa3('0x1b')]));});});}};var _0x5ee939=jayson[_0x7aa3('0x86')](_0x5d1627)[_0x7aa3('0x87')]();_0x5ee939['on'](_0x7aa3('0x12'),function(_0x2523be){return _0xbbcc8a(_0x2523be);});_0x5ee939[_0x7aa3('0x8')](0x232a,_0x7aa3('0x88'),function(){console[_0x7aa3('0x89')](_0x7aa3('0x8a'),0x232a);return _0x437b90(_0x7aa3('0x8b')+0x232a);});});};
\ No newline at end of file
index 989a82f..a192dcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb821=['routeId','destcalleridnum','calleridname','Unknown','destcalleridname','<unknown>','push','format','name','trigger:%s','action','toLowerCase','merge','length','bluebird','ioredis','../../../../config/logger','redis','defaults','localhost','info','[CM][%s][%s]','stringify','exec','data1','data2','data5','xmd-contactid','ListId','data3','phone','map','calleridnum','firstName','lastName','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0xb821,0xa7));var _0x1b82=function(_0x200a2c,_0x1a883d){_0x200a2c=_0x200a2c-0x0;var _0x313ef6=_0xb821[_0x200a2c];return _0x313ef6;};'use strict';var _=require('lodash');var BPromise=require(_0x1b82('0x0'));var Redis=require(_0x1b82('0x1'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x1b82('0x2'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x1b82('0x3')]=_[_0x1b82('0x4')](config[_0x1b82('0x3')],{'host':_0x1b82('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1b82('0x3')]));function emit(_0x192434,_0x202a5f,_0x3632dd,_0x18f45f,_0x7b87e8){logger[_0x1b82('0x6')](_0x1b82('0x7'),_0x192434,_0x202a5f['id'],_0x3632dd,_0x18f45f,JSON[_0x1b82('0x8')](_0x7b87e8));io['to'](_0x3632dd)['emit'](_0x18f45f,_0x7b87e8);}exports[_0x1b82('0x9')]=function(_0x30c6ee,_0x44dfd4,_0x14c57a,_0xcffb87){var _0x17a96b,_0x739f99;var _0x1ce719={};var _0x5f521f=Number(_0x14c57a[_0x1b82('0xa')]);var _0x241d11=_0x14c57a[_0x1b82('0xb')]?Boolean(Number(_0x14c57a[_0x1b82('0xb')])):![];var _0x50aed7;var _0x1a6285=![];if(!_['isNil'](_0x14c57a['data5'])){if(_0x14c57a[_0x1b82('0xc')]=='1')_0x1a6285=!![];}if(!_0x1a6285){if(_0xcffb87['xmd-contactid']){_0x1ce719['id']=_0xcffb87[_0x1b82('0xd')];}}if(!_0x1ce719['id']){_0x1ce719[_0x1b82('0xe')]=_0x5f521f;_0x50aed7=_0x14c57a['data3']&&_0x14c57a[_0x1b82('0xf')]!=='0'?_0x14c57a['data3']['split'](','):[_0x1b82('0x10')];_0x1ce719['$or']=_[_0x1b82('0x11')](_0x50aed7,function(_0x25228b){var _0xf42818={};_0xf42818[_0x25228b]=_0xcffb87['routeId']?_0xcffb87['destcalleridnum']:_0xcffb87[_0x1b82('0x12')];return _0xf42818;});}var _0x5d66c3=['id',_0x1b82('0x13'),_0x1b82('0x14'),_0x1b82('0x10'),'mobile',_0x1b82('0x15'),_0x1b82('0xe'),_0x1b82('0x16'),_0x1b82('0x17'),_0x1b82('0x18')];var _0x47e99b=_[_0x1b82('0x19')](_0x5d66c3,_0x50aed7);BPromise[_0x1b82('0x1a')]()[_0x1b82('0x1b')](cmContactRpc[_0x1b82('0x1c')]({'attributes':_0x47e99b,'where':_0x1ce719}))[_0x1b82('0x1b')](function(_0x31fd64){_0x739f99=_0x31fd64;if(!_[_0x1b82('0x1d')](_0x739f99)){if(_0x739f99['length']===0x1){_0x17a96b=_0x739f99[0x0];logger[_0x1b82('0x6')](_0x1b82('0x1e'),_0xcffb87['uniqueid'],_0x44dfd4['id'],_0x17a96b['id']);}else{logger[_0x1b82('0x6')](_0x1b82('0x1f'),_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id'],_['map'](_0x739f99,'id')[_0x1b82('0x21')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0xcffb87['uniqueid'],_0x44dfd4['id']);var _0xf2e556={'ListId':_0x5f521f};var _0x149d0f=_0x14c57a[_0x1b82('0x22')]&&_0x14c57a[_0x1b82('0x22')]!=='0'?_0x14c57a['data4']:_0x1b82('0x10');if(_0x241d11){logger[_0x1b82('0x6')](_0x1b82('0x23'),_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id']);_0xf2e556[_0x149d0f]=_[_0x1b82('0x24')](_0xcffb87[_0x1b82('0x25')])?_0xcffb87[_0x1b82('0x12')]:_0xcffb87[_0x1b82('0x26')];if(_[_0x1b82('0x24')](_0xcffb87[_0x1b82('0x25')])){_0xf2e556[_0x1b82('0x13')]=_0xcffb87[_0x1b82('0x27')]&&_0xcffb87[_0x1b82('0x27')]!=='<unknown>'?_0xcffb87[_0x1b82('0x27')]:_0x1b82('0x28');}else{_0xf2e556[_0x1b82('0x13')]=_0xcffb87[_0x1b82('0x29')]&&_0xcffb87[_0x1b82('0x29')]!==_0x1b82('0x2a')?_0xcffb87[_0x1b82('0x29')]:_0x1b82('0x28');}return BPromise[_0x1b82('0x1a')]()[_0x1b82('0x1b')](cmContactRpc['createContact'](_0xf2e556))[_0x1b82('0x1b')](function(_0x29a31e){_0x17a96b=_0x29a31e;_0x739f99[_0x1b82('0x2b')](_0x29a31e);if(_0x17a96b){logger[_0x1b82('0x6')]('[CM][%s][%s]\x20Contact\x20created:%s',_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id'],_0x17a96b['id']);}return;});}else{logger[_0x1b82('0x6')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0xcffb87[_0x1b82('0x20')],_0x44dfd4['id']);_0xf2e556[_0x149d0f]=_[_0x1b82('0x24')](_0xcffb87[_0x1b82('0x25')])?_0xcffb87['calleridnum']:_0xcffb87['destcalleridnum'];if(_[_0x1b82('0x24')](_0xcffb87['routeId'])){_0xf2e556['firstName']=_0xcffb87[_0x1b82('0x27')]&&_0xcffb87[_0x1b82('0x27')]!==_0x1b82('0x2a')?_0xcffb87['calleridname']:_0x1b82('0x28');}else{_0xf2e556[_0x1b82('0x13')]=_0xcffb87[_0x1b82('0x29')]&&_0xcffb87[_0x1b82('0x29')]!=='<unknown>'?_0xcffb87[_0x1b82('0x29')]:_0x1b82('0x28');}_0x17a96b=_0xf2e556;_0x739f99[_0x1b82('0x2b')](_0xf2e556);return;}}})['then'](function(){if(_0x30c6ee){emit(_0xcffb87['uniqueid'],_0x44dfd4,util[_0x1b82('0x2c')]('user:%s',_0x30c6ee[_0x1b82('0x2d')]),util[_0x1b82('0x2c')](_0x1b82('0x2e'),_0x14c57a[_0x1b82('0x2f')][_0x1b82('0x30')]()),{'evt':_[_0x1b82('0x31')](_0xcffb87,{'autoCreate':_0x241d11}),'contact':_0x17a96b===undefined?{}:_0x17a96b,'contacts':_0x739f99[_0x1b82('0x32')]===0x0?undefined:_0x739f99});}});};
\ No newline at end of file
+var _0xb458=['redis','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','format','user:%s','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/logger','trigger','../../rpc/cmContact'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xb458,0x103));var _0x8b45=function(_0x5081b8,_0x32491a){_0x5081b8=_0x5081b8-0x0;var _0x25cb76=_0xb458[_0x5081b8];return _0x25cb76;};'use strict';var _=require(_0x8b45('0x0'));var BPromise=require(_0x8b45('0x1'));var Redis=require(_0x8b45('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x8b45('0x3'))(_0x8b45('0x4'));var cmContactRpc=require(_0x8b45('0x5'));config[_0x8b45('0x6')]=_['defaults'](config[_0x8b45('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8b45('0x6')]));function emit(_0x12bd05,_0x2daa9a,_0x3a8ccb,_0x32342f,_0x4d1718){logger[_0x8b45('0x7')](_0x8b45('0x8'),_0x12bd05,_0x2daa9a['id'],_0x3a8ccb,_0x32342f,JSON[_0x8b45('0x9')](_0x4d1718));io['to'](_0x3a8ccb)[_0x8b45('0xa')](_0x32342f,_0x4d1718);}exports[_0x8b45('0xb')]=function(_0x499899,_0x2a4c83,_0x7cc49b,_0x57faf9){var _0x5316af,_0x5bb708;var _0x4e28bb={};var _0x43a4c3=Number(_0x7cc49b[_0x8b45('0xc')]);var _0x37c220=_0x7cc49b['data2']?Boolean(Number(_0x7cc49b[_0x8b45('0xd')])):![];var _0x455ecf;var _0x42bb72=![];if(!_[_0x8b45('0xe')](_0x7cc49b[_0x8b45('0xf')])){if(_0x7cc49b[_0x8b45('0xf')]=='1')_0x42bb72=!![];}if(!_0x42bb72){if(_0x57faf9['xmd-contactid']){_0x4e28bb['id']=_0x57faf9['xmd-contactid'];}}if(!_0x4e28bb['id']){_0x4e28bb[_0x8b45('0x10')]=_0x43a4c3;_0x455ecf=_0x7cc49b[_0x8b45('0x11')]&&_0x7cc49b[_0x8b45('0x11')]!=='0'?_0x7cc49b[_0x8b45('0x11')][_0x8b45('0x12')](','):[_0x8b45('0x13')];_0x4e28bb[_0x8b45('0x14')]=_[_0x8b45('0x15')](_0x455ecf,function(_0x33102e){var _0x391d1e={};_0x391d1e[_0x33102e]=_0x57faf9[_0x8b45('0x16')]?_0x57faf9[_0x8b45('0x17')]:_0x57faf9[_0x8b45('0x18')];return _0x391d1e;});}var _0x43ffb7=['id',_0x8b45('0x19'),_0x8b45('0x1a'),_0x8b45('0x13'),_0x8b45('0x1b'),'fax',_0x8b45('0x10'),_0x8b45('0x1c'),_0x8b45('0x1d'),_0x8b45('0x1e')];var _0x3e1438=_[_0x8b45('0x1f')](_0x43ffb7,_0x455ecf);BPromise[_0x8b45('0x20')]()[_0x8b45('0x21')](cmContactRpc['getContacts']({'attributes':_0x3e1438,'where':_0x4e28bb}))['then'](function(_0x41154a){_0x5bb708=_0x41154a;if(!_['isEmpty'](_0x5bb708)){if(_0x5bb708[_0x8b45('0x22')]===0x1){_0x5316af=_0x5bb708[0x0];logger[_0x8b45('0x7')](_0x8b45('0x23'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_0x5316af['id']);}else{logger[_0x8b45('0x7')](_0x8b45('0x25'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_['map'](_0x5bb708,'id')['join'](','));}return;}else{logger[_0x8b45('0x7')](_0x8b45('0x26'),_0x57faf9['uniqueid'],_0x2a4c83['id']);var _0x5723a2={'ListId':_0x43a4c3};var _0x129c35=_0x7cc49b[_0x8b45('0x27')]&&_0x7cc49b[_0x8b45('0x27')]!=='0'?_0x7cc49b[_0x8b45('0x27')]:'phone';if(_0x37c220){logger[_0x8b45('0x7')](_0x8b45('0x28'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id']);_0x5723a2[_0x129c35]=_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])?_0x57faf9[_0x8b45('0x18')]:_0x57faf9[_0x8b45('0x17')];if(_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])){_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x29')]&&_0x57faf9[_0x8b45('0x29')]!==_0x8b45('0x2a')?_0x57faf9['calleridname']:_0x8b45('0x2b');}else{_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x2c')]&&_0x57faf9[_0x8b45('0x2c')]!==_0x8b45('0x2a')?_0x57faf9[_0x8b45('0x2c')]:_0x8b45('0x2b');}return BPromise[_0x8b45('0x20')]()['then'](cmContactRpc[_0x8b45('0x2d')](_0x5723a2))[_0x8b45('0x21')](function(_0x50302){_0x5316af=_0x50302;_0x5bb708[_0x8b45('0x2e')](_0x50302);if(_0x5316af){logger[_0x8b45('0x7')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_0x5316af['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id']);_0x5723a2[_0x129c35]=_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])?_0x57faf9[_0x8b45('0x18')]:_0x57faf9[_0x8b45('0x17')];if(_[_0x8b45('0xe')](_0x57faf9['routeId'])){_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x29')]&&_0x57faf9[_0x8b45('0x29')]!==_0x8b45('0x2a')?_0x57faf9['calleridname']:_0x8b45('0x2b');}else{_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x2c')]&&_0x57faf9['destcalleridname']!==_0x8b45('0x2a')?_0x57faf9[_0x8b45('0x2c')]:_0x8b45('0x2b');}_0x5316af=_0x5723a2;_0x5bb708['push'](_0x5723a2);return;}}})[_0x8b45('0x21')](function(){if(_0x499899){emit(_0x57faf9[_0x8b45('0x24')],_0x2a4c83,util[_0x8b45('0x2f')](_0x8b45('0x30'),_0x499899['name']),util[_0x8b45('0x2f')](_0x8b45('0x31'),_0x7cc49b[_0x8b45('0x32')][_0x8b45('0x33')]()),{'evt':_[_0x8b45('0x34')](_0x57faf9,{'autoCreate':_0x37c220}),'contact':_0x5316af===undefined?{}:_0x5316af,'contacts':_0x5bb708[_0x8b45('0x22')]===0x0?undefined:_0x5bb708});}});};
\ No newline at end of file
index a506a51..cad7dad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa945=['buildUri','data3','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','user:%s','name','format','trigger:%s','exec','integration','queue','routeId','urlforward','parse','query','search','replace','channel','AllConditions','checkConditions','AnyConditions','some','chat','ChatWebsiteId','operator','value','AccountId','message','event','agent','membername','lastevent','null','substatus','undefined','created','equals','util','lodash','url','./urlforward','./cmContact','../../../config/environment','trigger','../ami','defaults','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','clone','motionChannel','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','render','template\x20not\x20found'];(function(_0x195ae9,_0xbfabda){var _0x959eb6=function(_0x46d038){while(--_0x46d038){_0x195ae9['push'](_0x195ae9['shift']());}};_0x959eb6(++_0xbfabda);}(_0xa945,0x118));var _0x5a94=function(_0x4970b7,_0x4299ba){_0x4970b7=_0x4970b7-0x0;var _0x4ae40f=_0xa945[_0x4970b7];return _0x4ae40f;};'use strict';var util=require(_0x5a94('0x0'));var _=require(_0x5a94('0x1'));var url=require(_0x5a94('0x2'));var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require(_0x5a94('0x3'));var integration=require('./integration');var cmContact=require(_0x5a94('0x4'));var script=require('./script');var config=require(_0x5a94('0x5'));var logger=require('../../../config/logger')(_0x5a94('0x6'));var ami=require(_0x5a94('0x7'));config['redis']=_[_0x5a94('0x8')](config[_0x5a94('0x9')],{'host':_0x5a94('0xa'),'port':0x18eb});var io=require(_0x5a94('0xb'))(new Redis(config[_0x5a94('0x9')]));var operators={'equals':function(_0x2f795f,_0xae329){return _0x2f795f==_0xae329;},'not_equals':function(_0x544257,_0x52c755){return _0x544257!=_0x52c755;}};var barAndWebActions=[_0x5a94('0xc'),_0x5a94('0x2'),_0x5a94('0xd')];function Trigger(_0x2c7782){this['triggers']=_0x2c7782[_0x5a94('0xe')];this[_0x5a94('0xf')]=_0x2c7782['agents'];this[_0x5a94('0x10')]=_0x2c7782[_0x5a94('0x10')];this[_0x5a94('0x11')]=_0x2c7782[_0x5a94('0x11')];this[_0x5a94('0x12')]=_0x2c7782[_0x5a94('0x12')];this[_0x5a94('0x13')]=_0x2c7782['zendeskAccounts'];this['freshdeskAccounts']=_0x2c7782[_0x5a94('0x14')];this['salesforceAccounts']=_0x2c7782[_0x5a94('0x15')];this[_0x5a94('0x16')]=_0x2c7782[_0x5a94('0x16')];this[_0x5a94('0x17')]=_0x2c7782[_0x5a94('0x17')];this[_0x5a94('0x18')]=_0x2c7782[_0x5a94('0x18')];this[_0x5a94('0x19')]=_0x2c7782[_0x5a94('0x19')];this[_0x5a94('0x1a')]=_0x2c7782['servicenowAccounts'];this[_0x5a94('0x1b')]=_0x2c7782[_0x5a94('0x1b')];this[_0x5a94('0x1c')]=_0x2c7782[_0x5a94('0x1c')];this[_0x5a94('0x1d')]={'zendesk':this[_0x5a94('0x13')],'salesforce':this[_0x5a94('0x15')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x5a94('0x16')],'zoho':this[_0x5a94('0x17')],'desk':this[_0x5a94('0x18')],'vtiger':this[_0x5a94('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x5a94('0x1a')]};ami['on'](_0x5a94('0x1e'),this[_0x5a94('0x1f')]['bind'](this));ami['on']('custom:agentconnect',this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x21'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on']('custom:agentcomplete',this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x22'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x23'),this['syncCustomEvent'][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x24'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x25'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on']('custom:agentreject',this[_0x5a94('0x1f')]['bind'](this));ami['on'](_0x5a94('0x26'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x27'),this['syncCustomEvent'][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x28'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on']('custom:dialbegin',this[_0x5a94('0x29')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x2a'),this['syncAgentDial'][_0x5a94('0x20')](this));ami['on']('custom:dialend',this[_0x5a94('0x29')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x2b'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x5a94('0x20')](this));ami['on']('custom:substatus',this['syncCustomEvent'][_0x5a94('0x20')](this));ami['on']('custom:incomingmessage',this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on'](_0x5a94('0x2c'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));ami['on']('custom:acceptmessage',this[_0x5a94('0x1f')]['bind'](this));ami['on'](_0x5a94('0x2d'),this[_0x5a94('0x1f')]['bind'](this));ami['on'](_0x5a94('0x2e'),this[_0x5a94('0x1f')][_0x5a94('0x20')](this));}Trigger[_0x5a94('0x2f')][_0x5a94('0x30')]=function(_0xf457f0,_0x306464,_0x4b2306){logger[_0x5a94('0x31')](_0xf457f0,_0x306464,JSON['stringify'](_0x4b2306));io['to'](_0xf457f0)['emit'](_0x306464,_0x4b2306);};Trigger[_0x5a94('0x2f')]['syncCustomEvent']=function(_0x118558){var _0x2ca3f2=_[_0x5a94('0x32')](_0x118558);if(typeof _0x2ca3f2[_0x5a94('0x33')]==='undefined'){_0x2ca3f2[_0x5a94('0x33')]='voice';}this[_0x5a94('0x34')](_0x2ca3f2);};Trigger[_0x5a94('0x2f')][_0x5a94('0x29')]=function(_0x351226){if(this[_0x5a94('0xf')][_0x351226[_0x5a94('0x35')]]){this[_0x5a94('0x1f')](_0x351226);}};Trigger['prototype'][_0x5a94('0x34')]=function(_0x13b934){var _0x92bdea;for(var _0x23d4c8 in this[_0x5a94('0xe')]){if(this[_0x5a94('0xe')][_0x5a94('0x36')](_0x23d4c8)){if(this[_0x5a94('0xe')][_0x23d4c8][_0x5a94('0x37')]){_0x92bdea=this[_0x5a94('0x38')](this['triggers'][_0x23d4c8],_0x13b934);if(_0x92bdea){_[_0x5a94('0x39')](_0x13b934,_0x13b934[_0x5a94('0x3a')]);for(var _0x404c8f=0x0,_0x27742b,_0x22c896,_0x3cf28d;_0x404c8f<this['triggers'][_0x23d4c8][_0x5a94('0x3b')][_0x5a94('0x3c')];_0x404c8f+=0x1){_0x27742b=this[_0x5a94('0xe')][_0x23d4c8][_0x5a94('0x3b')][_0x404c8f];if(this[_0x5a94('0xf')][_0x13b934[_0x5a94('0x35')]]){switch(_0x27742b[_0x5a94('0x3d')][_0x5a94('0x3e')]()){case _0x5a94('0x3f'):break;case'motionbar':case _0x5a94('0x40'):var _0x13b632={};switch(barAndWebActions[_0x27742b[_0x5a94('0x41')]]){case'popup':_0x13b632[_0x5a94('0x42')]=_0x27742b[_0x5a94('0x43')];_0x13b632[_0x5a94('0x44')]=this[_0x5a94('0x11')][_0x27742b[_0x5a94('0x43')]]?Mustache[_0x5a94('0x45')](this[_0x5a94('0x11')][_0x27742b[_0x5a94('0x43')]][_0x5a94('0x44')],_0x13b934):_0x5a94('0x46');break;case _0x5a94('0x2'):_0x13b632['uri']=this[_0x5a94('0x47')](_0x27742b[_0x5a94('0x43')],_0x13b934,_['isNil'](_0x27742b[_0x5a94('0x48')])?!![]:parseInt(_0x27742b[_0x5a94('0x48')],0xa));if(_[_0x5a94('0x49')](_0x27742b[_0x5a94('0x4a')])){_0x13b632[_0x5a94('0x4b')]='0';}else{_0x13b632[_0x5a94('0x4c')]=_0x27742b['data4'];_0x13b632[_0x5a94('0x4d')]=_[_0x5a94('0x49')](_0x27742b[_0x5a94('0x4e')])?_0x5a94('0x4f'):_0x27742b[_0x5a94('0x4e')];_0x13b632[_0x5a94('0x50')]=_[_0x5a94('0x49')](_0x27742b[_0x5a94('0x51')])?_0x5a94('0x52'):_0x27742b['data6'];}break;case _0x5a94('0xd'):_0x13b632[_0x5a94('0x53')]=_0x27742b[_0x5a94('0x43')]?Mustache['render'](_0x27742b[_0x5a94('0x43')],_0x13b934):'';_0x13b632['winArguments']=_0x27742b[_0x5a94('0x48')]?Mustache[_0x5a94('0x45')](_0x27742b[_0x5a94('0x48')],_0x13b934):'';break;}this['emit'](util['format'](_0x5a94('0x54'),this[_0x5a94('0xf')][_0x13b934[_0x5a94('0x35')]][_0x5a94('0x55')]),util[_0x5a94('0x56')]('trigger:%s:%s',_0x27742b['action'][_0x5a94('0x3e')](),barAndWebActions[_0x27742b[_0x5a94('0x41')]]),_[_0x5a94('0x39')](_0x13b632,_0x13b934));break;case'jscripty':this[_0x5a94('0x30')](util[_0x5a94('0x56')](_0x5a94('0x54'),this[_0x5a94('0xf')][_0x13b934[_0x5a94('0x35')]][_0x5a94('0x55')]),util[_0x5a94('0x56')](_0x5a94('0x57'),_0x27742b[_0x5a94('0x3d')][_0x5a94('0x3e')]()),_['merge']({'ProjectId':parseInt(_0x27742b[_0x5a94('0x41')],0xa)},_0x13b934));break;default:this[_0x5a94('0x30')](util['format'](_0x5a94('0x54'),this[_0x5a94('0xf')][_0x13b934['interface']][_0x5a94('0x55')]),util[_0x5a94('0x56')](_0x5a94('0x57'),_0x27742b[_0x5a94('0x3d')]['toLowerCase']()),_[_0x5a94('0x39')]({},_0x27742b,_0x13b934));}}switch(_0x27742b['action'][_0x5a94('0x3e')]()){case _0x5a94('0x3f'):cmContact[_0x5a94('0x58')](this[_0x5a94('0xf')][_0x13b934['interface']],this[_0x5a94('0xe')][_0x23d4c8],_0x27742b,_0x13b934);break;case _0x5a94('0x59'):integration[_0x5a94('0x58')](_0x27742b,_0x13b934,this[_0x5a94('0x1d')],this[_0x5a94('0xf')][_0x13b934[_0x5a94('0x35')]],this[_0x5a94('0x10')][_0x13b934[_0x5a94('0x5a')]],this['voiceExtensions'][_0x13b934[_0x5a94('0x5b')]]);break;case _0x5a94('0x5c'):urlforward['exec'](_0x27742b,_0x13b934);break;case'script':script['exec'](_0x27742b,_0x13b934);break;}}}}}}};Trigger[_0x5a94('0x2f')]['buildUri']=function(_0x503d4a,_0x42fe41,_0x201bc0){var _0x33c8bc=url[_0x5a94('0x5d')](Mustache[_0x5a94('0x45')](_0x503d4a,_0x42fe41),!![]);if(_0x201bc0){_[_0x5a94('0x39')](_0x33c8bc[_0x5a94('0x5e')],_0x42fe41);}delete _0x33c8bc[_0x5a94('0x5f')];var _0x302dc5=url[_0x5a94('0x56')](_0x33c8bc);_0x302dc5=_0x302dc5[_0x5a94('0x60')](/\/\?/g,'?');return _0x302dc5;};Trigger['prototype'][_0x5a94('0x38')]=function(_0x2ffa18,_0x2dda5c){var _0x24fc78=!![];var _0x40382a=!![];var _0x51c6f1=![];if(_0x2ffa18[_0x5a94('0x61')]===_0x2dda5c[_0x5a94('0x33')]){_0x51c6f1=!![];}if(_0x2ffa18[_0x5a94('0x62')][_0x5a94('0x3c')]){_0x24fc78=_['every'](_0x2ffa18['AllConditions'],this[_0x5a94('0x63')](_0x2dda5c,_0x2ffa18[_0x5a94('0x61')]));}if(_0x2ffa18[_0x5a94('0x64')][_0x5a94('0x3c')]){_0x40382a=_[_0x5a94('0x65')](_0x2ffa18['AnyConditions'],this[_0x5a94('0x63')](_0x2dda5c,_0x2ffa18['channel']));}return _0x51c6f1&&_0x24fc78&&_0x40382a;};Trigger[_0x5a94('0x2f')][_0x5a94('0x63')]=function(_0x279874,_0x153d0f){return function(_0xe04f40){switch(_0xe04f40['field']){case'account':if(_0x279874[_0x5a94('0x61')]===_0x153d0f){if(_0x153d0f===_0x5a94('0x66')){return _0x279874[_0x5a94('0x67')]?operators[_0xe04f40[_0x5a94('0x68')]](Number(_0xe04f40[_0x5a94('0x69')]),_0x279874[_0x5a94('0x67')]):![];}else{return _0x279874[_['upperFirst'](_0x153d0f)+_0x5a94('0x6a')]?operators[_0xe04f40['operator']](Number(_0xe04f40[_0x5a94('0x69')]),_0x279874[_['upperFirst'](_0x153d0f)+_0x5a94('0x6a')]):![];}}break;case'interaction':case _0x5a94('0x6b'):if(_0x279874[_0x5a94('0x61')]===_0x153d0f){return _0x279874[_0x5a94('0x6c')]?operators[_0xe04f40['operator']](_0xe04f40['value'],_0x279874[_0x5a94('0x6c')]):![];}break;case _0x5a94('0x5a'):return _0x279874['queue']?operators[_0xe04f40[_0x5a94('0x68')]](_0xe04f40[_0x5a94('0x69')],_0x279874[_0x5a94('0x5a')]):![];case _0x5a94('0x6d'):return _0x279874[_0x5a94('0x6e')]?operators[_0xe04f40[_0x5a94('0x68')]](_0xe04f40[_0x5a94('0x69')],_0x279874[_0x5a94('0x6e')]):![];case _0x5a94('0x6f'):return _0x279874['lastevent']?operators[_0xe04f40[_0x5a94('0x68')]](_0xe04f40[_0x5a94('0x69')],_0x279874[_0x5a94('0x6f')]):![];case _0x5a94('0x5b'):return _0x279874[_0x5a94('0x5b')]?operators[_0xe04f40[_0x5a94('0x68')]](_0xe04f40[_0x5a94('0x69')],_0x279874[_0x5a94('0x5b')]):![];case'mailSubstatus':if(_0xe04f40[_0x5a94('0x69')]===_0x5a94('0x70'))_0xe04f40['value']=null;return typeof _0x279874[_0x5a94('0x71')]!==_0x5a94('0x72')?operators[_0xe04f40[_0x5a94('0x68')]](_0xe04f40['value'],_0x279874[_0x5a94('0x71')]):![];case'offlineMessage':if(_0x279874[_0x5a94('0x61')]===_0x153d0f){return _0xe04f40[_0x5a94('0x69')]===_0x5a94('0x73')&&_0xe04f40[_0x5a94('0x68')]===_0x5a94('0x74')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0x4473=['popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','dynamics365Accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','emit','info','stringify','prototype','clone','motionChannel','undefined','voice','checkTriggers','status','checkTrigger','merge','Actions','length','interface','toLowerCase','motionbar','browser','TemplateId','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','uriLocation','data5','800','windowHeight','data6','winArguments','render','format','user:%s','name','trigger:%s:%s','data1','action','exec','integration','queue','routeId','urlforward','script','parse','query','replace','channel','AllConditions','every','AnyConditions','checkConditions','field','account','chat','operator','value','ChatWebsiteId','AccountId','interaction','event','agent','membername','lastevent','null','substatus','offlineMessage','equals','exports','./urlforward','./integration','./cmContact','trigger','../ami','redis','defaults','localhost','socket.io-emitter'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x4473,0x15c));var _0x3447=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4473[_0x167cc1];return _0x10bc4b;};'use strict';var util=require('util');var _=require('lodash');var url=require('url');var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require(_0x3447('0x0'));var integration=require(_0x3447('0x1'));var cmContact=require(_0x3447('0x2'));var script=require('./script');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x3447('0x3'));var ami=require(_0x3447('0x4'));config[_0x3447('0x5')]=_[_0x3447('0x6')](config[_0x3447('0x5')],{'host':_0x3447('0x7'),'port':0x18eb});var io=require(_0x3447('0x8'))(new Redis(config[_0x3447('0x5')]));var operators={'equals':function(_0x25d333,_0x59bd50){return _0x25d333==_0x59bd50;},'not_equals':function(_0x553691,_0x23c107){return _0x553691!=_0x23c107;}};var barAndWebActions=[_0x3447('0x9'),_0x3447('0xa'),_0x3447('0xb')];function Trigger(_0x23ebda){this['triggers']=_0x23ebda[_0x3447('0xc')];this[_0x3447('0xd')]=_0x23ebda[_0x3447('0xd')];this['voiceQueues']=_0x23ebda[_0x3447('0xe')];this[_0x3447('0xf')]=_0x23ebda[_0x3447('0xf')];this[_0x3447('0x10')]=_0x23ebda[_0x3447('0x10')];this['zendeskAccounts']=_0x23ebda[_0x3447('0x11')];this[_0x3447('0x12')]=_0x23ebda[_0x3447('0x12')];this[_0x3447('0x13')]=_0x23ebda[_0x3447('0x13')];this[_0x3447('0x14')]=_0x23ebda[_0x3447('0x14')];this[_0x3447('0x15')]=_0x23ebda[_0x3447('0x15')];this['deskAccounts']=_0x23ebda[_0x3447('0x16')];this[_0x3447('0x17')]=_0x23ebda[_0x3447('0x17')];this[_0x3447('0x18')]=_0x23ebda[_0x3447('0x18')];this['dynamics365Accounts']=_0x23ebda['dynamics365Accounts'];this[_0x3447('0x19')]=_0x23ebda[_0x3447('0x19')];this[_0x3447('0x1a')]={'zendesk':this[_0x3447('0x11')],'salesforce':this[_0x3447('0x13')],'freshdesk':this[_0x3447('0x12')],'sugarcrm':this[_0x3447('0x14')],'zoho':this['zohoAccounts'],'desk':this[_0x3447('0x16')],'vtiger':this[_0x3447('0x17')],'dynamics365':this[_0x3447('0x1b')],'freshsales':this[_0x3447('0x19')],'servicenow':this['servicenowAccounts']};ami['on'](_0x3447('0x1c'),this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on']('custom:agentconnect',this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on']('custom:agentringnoanswer',this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x1f'),this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x20'),this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on']('custom:agentnoanswer',this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x21'),this[_0x3447('0x1d')]['bind'](this));ami['on']('custom:agentcongestion',this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x22'),this['syncCustomEvent']['bind'](this));ami['on'](_0x3447('0x23'),this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x24'),this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x25'),this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x26'),this[_0x3447('0x27')]['bind'](this));ami['on'](_0x3447('0x28'),this[_0x3447('0x27')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x29'),this[_0x3447('0x27')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x2a'),this[_0x3447('0x1d')]['bind'](this));ami['on'](_0x3447('0x2b'),this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on']('custom:substatus',this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x2c'),this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x2d'),this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on']('custom:acceptmessage',this[_0x3447('0x1d')][_0x3447('0x1e')](this));ami['on'](_0x3447('0x2e'),this[_0x3447('0x1d')]['bind'](this));ami['on'](_0x3447('0x2f'),this[_0x3447('0x1d')][_0x3447('0x1e')](this));}Trigger['prototype'][_0x3447('0x30')]=function(_0x1c06b1,_0x4a1280,_0x5797d0){logger[_0x3447('0x31')](_0x1c06b1,_0x4a1280,JSON[_0x3447('0x32')](_0x5797d0));io['to'](_0x1c06b1)[_0x3447('0x30')](_0x4a1280,_0x5797d0);};Trigger[_0x3447('0x33')]['syncCustomEvent']=function(_0x847e0){var _0x102ea2=_[_0x3447('0x34')](_0x847e0);if(typeof _0x102ea2[_0x3447('0x35')]===_0x3447('0x36')){_0x102ea2[_0x3447('0x35')]=_0x3447('0x37');}this[_0x3447('0x38')](_0x102ea2);};Trigger['prototype']['syncAgentDial']=function(_0x232d0d){if(this[_0x3447('0xd')][_0x232d0d['interface']]){this[_0x3447('0x1d')](_0x232d0d);}};Trigger[_0x3447('0x33')][_0x3447('0x38')]=function(_0x31ce93){var _0x167b72;for(var _0x43bb88 in this[_0x3447('0xc')]){if(this['triggers']['hasOwnProperty'](_0x43bb88)){if(this['triggers'][_0x43bb88][_0x3447('0x39')]){_0x167b72=this[_0x3447('0x3a')](this[_0x3447('0xc')][_0x43bb88],_0x31ce93);if(_0x167b72){_[_0x3447('0x3b')](_0x31ce93,_0x31ce93['variables']);for(var _0x1f3a7c=0x0,_0x3f6841,_0x1bc72f,_0x5543ff;_0x1f3a7c<this['triggers'][_0x43bb88][_0x3447('0x3c')][_0x3447('0x3d')];_0x1f3a7c+=0x1){_0x3f6841=this['triggers'][_0x43bb88][_0x3447('0x3c')][_0x1f3a7c];if(this[_0x3447('0xd')][_0x31ce93[_0x3447('0x3e')]]){switch(_0x3f6841['action'][_0x3447('0x3f')]()){case'contactmanager':break;case _0x3447('0x40'):case _0x3447('0x41'):var _0x53060e={};switch(barAndWebActions[_0x3f6841['data1']]){case _0x3447('0x9'):_0x53060e[_0x3447('0x42')]=_0x3f6841[_0x3447('0x43')];_0x53060e[_0x3447('0x44')]=this[_0x3447('0xf')][_0x3f6841['data2']]?Mustache['render'](this[_0x3447('0xf')][_0x3f6841[_0x3447('0x43')]]['html'],_0x31ce93):_0x3447('0x45');break;case _0x3447('0xa'):_0x53060e[_0x3447('0x46')]=this[_0x3447('0x47')](_0x3f6841[_0x3447('0x43')],_0x31ce93,_[_0x3447('0x48')](_0x3f6841[_0x3447('0x49')])?!![]:parseInt(_0x3f6841[_0x3447('0x49')],0xa));if(_[_0x3447('0x48')](_0x3f6841[_0x3447('0x4a')])){_0x53060e['location']='0';}else{_0x53060e[_0x3447('0x4b')]=_0x3f6841['data4'];_0x53060e['windowWidth']=_['isNil'](_0x3f6841[_0x3447('0x4c')])?_0x3447('0x4d'):_0x3f6841[_0x3447('0x4c')];_0x53060e[_0x3447('0x4e')]=_['isNil'](_0x3f6841[_0x3447('0x4f')])?'600':_0x3f6841['data6'];}break;case _0x3447('0xb'):_0x53060e['winApplication']=_0x3f6841['data2']?Mustache['render'](_0x3f6841[_0x3447('0x43')],_0x31ce93):'';_0x53060e[_0x3447('0x50')]=_0x3f6841[_0x3447('0x49')]?Mustache[_0x3447('0x51')](_0x3f6841[_0x3447('0x49')],_0x31ce93):'';break;}this['emit'](util[_0x3447('0x52')](_0x3447('0x53'),this[_0x3447('0xd')][_0x31ce93[_0x3447('0x3e')]][_0x3447('0x54')]),util[_0x3447('0x52')](_0x3447('0x55'),_0x3f6841['action'][_0x3447('0x3f')](),barAndWebActions[_0x3f6841[_0x3447('0x56')]]),_[_0x3447('0x3b')](_0x53060e,_0x31ce93));break;case'jscripty':this[_0x3447('0x30')](util[_0x3447('0x52')](_0x3447('0x53'),this[_0x3447('0xd')][_0x31ce93[_0x3447('0x3e')]][_0x3447('0x54')]),util[_0x3447('0x52')]('trigger:%s',_0x3f6841[_0x3447('0x57')][_0x3447('0x3f')]()),_[_0x3447('0x3b')]({'ProjectId':parseInt(_0x3f6841[_0x3447('0x56')],0xa)},_0x31ce93));break;default:this[_0x3447('0x30')](util[_0x3447('0x52')](_0x3447('0x53'),this['agents'][_0x31ce93[_0x3447('0x3e')]][_0x3447('0x54')]),util['format']('trigger:%s',_0x3f6841[_0x3447('0x57')][_0x3447('0x3f')]()),_[_0x3447('0x3b')]({},_0x3f6841,_0x31ce93));}}switch(_0x3f6841[_0x3447('0x57')][_0x3447('0x3f')]()){case'contactmanager':cmContact[_0x3447('0x58')](this[_0x3447('0xd')][_0x31ce93[_0x3447('0x3e')]],this[_0x3447('0xc')][_0x43bb88],_0x3f6841,_0x31ce93);break;case _0x3447('0x59'):integration['exec'](_0x3f6841,_0x31ce93,this[_0x3447('0x1a')],this[_0x3447('0xd')][_0x31ce93[_0x3447('0x3e')]],this[_0x3447('0xe')][_0x31ce93[_0x3447('0x5a')]],this[_0x3447('0x10')][_0x31ce93[_0x3447('0x5b')]]);break;case _0x3447('0x5c'):urlforward[_0x3447('0x58')](_0x3f6841,_0x31ce93);break;case _0x3447('0x5d'):script[_0x3447('0x58')](_0x3f6841,_0x31ce93);break;}}}}}}};Trigger[_0x3447('0x33')]['buildUri']=function(_0x3f52a0,_0x2cc8c3,_0x10b774){var _0x39ee66=url[_0x3447('0x5e')](Mustache[_0x3447('0x51')](_0x3f52a0,_0x2cc8c3),!![]);if(_0x10b774){_[_0x3447('0x3b')](_0x39ee66[_0x3447('0x5f')],_0x2cc8c3);}delete _0x39ee66['search'];var _0x5ccdfe=url[_0x3447('0x52')](_0x39ee66);_0x5ccdfe=_0x5ccdfe[_0x3447('0x60')](/\/\?/g,'?');return _0x5ccdfe;};Trigger['prototype'][_0x3447('0x3a')]=function(_0x34d017,_0x7d962e){var _0x3809f7=!![];var _0x2d73cf=!![];var _0x478888=![];if(_0x34d017[_0x3447('0x61')]===_0x7d962e[_0x3447('0x35')]){_0x478888=!![];}if(_0x34d017[_0x3447('0x62')][_0x3447('0x3d')]){_0x3809f7=_[_0x3447('0x63')](_0x34d017['AllConditions'],this['checkConditions'](_0x7d962e,_0x34d017[_0x3447('0x61')]));}if(_0x34d017[_0x3447('0x64')][_0x3447('0x3d')]){_0x2d73cf=_['some'](_0x34d017[_0x3447('0x64')],this['checkConditions'](_0x7d962e,_0x34d017[_0x3447('0x61')]));}return _0x478888&&_0x3809f7&&_0x2d73cf;};Trigger[_0x3447('0x33')][_0x3447('0x65')]=function(_0x5981d3,_0x32b1c3){return function(_0x40c2a8){switch(_0x40c2a8[_0x3447('0x66')]){case _0x3447('0x67'):if(_0x5981d3[_0x3447('0x61')]===_0x32b1c3){if(_0x32b1c3===_0x3447('0x68')){return _0x5981d3['ChatWebsiteId']?operators[_0x40c2a8[_0x3447('0x69')]](Number(_0x40c2a8[_0x3447('0x6a')]),_0x5981d3[_0x3447('0x6b')]):![];}else{return _0x5981d3[_['upperFirst'](_0x32b1c3)+_0x3447('0x6c')]?operators[_0x40c2a8[_0x3447('0x69')]](Number(_0x40c2a8[_0x3447('0x6a')]),_0x5981d3[_['upperFirst'](_0x32b1c3)+_0x3447('0x6c')]):![];}}break;case _0x3447('0x6d'):case'message':if(_0x5981d3[_0x3447('0x61')]===_0x32b1c3){return _0x5981d3[_0x3447('0x6e')]?operators[_0x40c2a8[_0x3447('0x69')]](_0x40c2a8[_0x3447('0x6a')],_0x5981d3['event']):![];}break;case _0x3447('0x5a'):return _0x5981d3[_0x3447('0x5a')]?operators[_0x40c2a8[_0x3447('0x69')]](_0x40c2a8[_0x3447('0x6a')],_0x5981d3['queue']):![];case _0x3447('0x6f'):return _0x5981d3[_0x3447('0x70')]?operators[_0x40c2a8[_0x3447('0x69')]](_0x40c2a8[_0x3447('0x6a')],_0x5981d3[_0x3447('0x70')]):![];case _0x3447('0x71'):return _0x5981d3['lastevent']?operators[_0x40c2a8['operator']](_0x40c2a8[_0x3447('0x6a')],_0x5981d3[_0x3447('0x71')]):![];case _0x3447('0x5b'):return _0x5981d3[_0x3447('0x5b')]?operators[_0x40c2a8[_0x3447('0x69')]](_0x40c2a8[_0x3447('0x6a')],_0x5981d3['routeId']):![];case'mailSubstatus':if(_0x40c2a8[_0x3447('0x6a')]===_0x3447('0x72'))_0x40c2a8[_0x3447('0x6a')]=null;return typeof _0x5981d3[_0x3447('0x73')]!==_0x3447('0x36')?operators[_0x40c2a8['operator']](_0x40c2a8[_0x3447('0x6a')],_0x5981d3[_0x3447('0x73')]):![];case _0x3447('0x74'):if(_0x5981d3[_0x3447('0x61')]===_0x32b1c3){return _0x40c2a8[_0x3447('0x6a')]==='created'&&_0x40c2a8[_0x3447('0x69')]===_0x3447('0x75')?!![]:![];}break;}return![];};};module[_0x3447('0x76')]=Trigger;
\ No newline at end of file
index bf87967..2436175 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','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','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','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','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x4a3f22,_0x5f02ae){var _0x4ce83c=function(_0x1f6672){while(--_0x1f6672){_0x4a3f22['push'](_0x4a3f22['shift']());}};_0x4ce83c(++_0x5f02ae);}(_0x814b,0x1a2));var _0xb814=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x814b[_0x365e54];return _0x13317a;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});};
\ 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(_0x495b36,_0xb0de98){var _0xc1b7ae=function(_0x4b9ad4){while(--_0x4b9ad4){_0x495b36['push'](_0x495b36['shift']());}};_0xc1b7ae(++_0xb0de98);}(_0x7217,0x19e));var _0x7721=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7217[_0x4154a6];return _0x3b2786;};'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 3c8a251..a8f99f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb71=['assign','Subjects','getString','Descriptions','Fields','phonecall','callDirection','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','unmanaged','data7','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','name','lodash','request-promise','util','./util','ioredis','dynamics365','redis','localhost','modernAuthentication','remoteUri','CloudProvider','resolve','data5','POST','clientId','username','password','clientSecret','then','access_token','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','type','customField','indexOf','ticketType','incident'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbb71,0x145));var _0x1bb7=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xbb71[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x1bb7('0x0'));var rp=require(_0x1bb7('0x1'));var util=require(_0x1bb7('0x2'));var intUtil=require(_0x1bb7('0x3'));var md5=require('md5');var Redis=require(_0x1bb7('0x4'));var logger=require('../../../../config/logger')(_0x1bb7('0x5'));var config=require('../../../../config/environment');config[_0x1bb7('0x6')]=_['defaults'](config[_0x1bb7('0x6')],{'host':_0x1bb7('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1bb7('0x6')]));function getAuthToken(_0x491f62,_0x440792,_0x4f0f72){if(_0x491f62[_0x1bb7('0x8')]){_0x491f62[_0x1bb7('0x9')]=_0x491f62['CloudProvider']['data7'];_0x491f62['tenantId']=_0x491f62[_0x1bb7('0xa')]['data2'];return Promise[_0x1bb7('0xb')](_0x491f62[_0x1bb7('0xa')][_0x1bb7('0xc')]);}var _0x3ff6c6={'method':_0x1bb7('0xd'),'uri':_0x440792,'form':{'client_id':_0x491f62[_0x1bb7('0xe')],'resource':_0x491f62[_0x1bb7('0x9')],'username':_0x491f62[_0x1bb7('0xf')],'password':_0x491f62[_0x1bb7('0x10')],'grant_type':_0x1bb7('0x10'),'client_secret':_0x491f62[_0x1bb7('0x11')]},'json':!![]};return rp(_0x3ff6c6)[_0x1bb7('0x12')](function(_0x3ee0be){return _0x3ee0be[_0x1bb7('0x13')];})['catch'](function(_0x405910){logger[_0x1bb7('0x14')]('['+[_0x4f0f72['toUpperCase']()]+_0x1bb7('0x15'));return _0x405910[_0x1bb7('0x16')];});}function getUser(_0x2a2dd6,_0x45dc5a,_0x547c28,_0x200bcc,_0x2a9190,_0xf250a1){return new Promise(function(_0x1bf7a6,_0x551622){return getAuthToken(_0x45dc5a,_0x200bcc,_0xf250a1)['then'](function(_0x281e85){var _0x8c4753={'method':_0x1bb7('0x17'),'uri':_0x2a9190+_0x1bb7('0x18'),'headers':{'Authorization':_0x1bb7('0x19')+_0x281e85,'OData-Version':_0x1bb7('0x1a')},'json':!![]};return rp(_0x8c4753);})['then'](function(_0x536667){var _0x4e8547=_0x536667[_0x1bb7('0x1b')];var _0x1c4dd0=![];var _0x42026e=null;if(!_[_0x1bb7('0x1c')](_0x547c28)){if(intUtil[_0x1bb7('0x1d')](_0x547c28[_0x1bb7('0x1e')])){_0x2a2dd6['userEmail']=_0x547c28[_0x1bb7('0x1e')];for(_0x42026e=0x0;_0x42026e<_0x4e8547[_0x1bb7('0x1f')];_0x42026e++){if(_0x4e8547[_0x42026e][_0x1bb7('0x20')]===_0x547c28[_0x1bb7('0x1e')]&&!_0x4e8547[_0x42026e]['isdisabled']){_0x1c4dd0=!![];logger[_0x1bb7('0x21')]('['+[_0xf250a1[_0x1bb7('0x22')]()]+_0x1bb7('0x23')+_0x4e8547[_0x42026e][_0x1bb7('0x24')]+'!');_0x2a2dd6[_0x1bb7('0x25')]=_0x4e8547[_0x42026e]['systemuserid'];}}}}if(!_0x1c4dd0){logger['info']('['+[_0xf250a1['toUpperCase']()]+_0x1bb7('0x26'));_0x2a2dd6['userEmail']=_0x45dc5a[_0x1bb7('0xf')];for(_0x42026e=0x0;_0x42026e<_0x4e8547[_0x1bb7('0x1f')];_0x42026e++){if(_0x4e8547[_0x42026e][_0x1bb7('0x20')]===_0x45dc5a[_0x1bb7('0xf')]){_0x2a2dd6[_0x1bb7('0x25')]=_0x4e8547[_0x42026e]['systemuserid'];}}}_0x1bf7a6(_0x2a2dd6);})[_0x1bb7('0x27')](function(_0x7ed475){_0x551622(_0x7ed475[_0x1bb7('0x16')]);});});}function createEndUser(_0x50dc43,_0x5ce6bf,_0x5b4f67,_0x3b278a,_0xb4d284,_0x41e902){return new Promise(function(_0xde1096,_0xc3c985){return getAuthToken(_0x5ce6bf,_0x5b4f67,_0x41e902)[_0x1bb7('0x12')](function(_0x256b94){var _0x3234eb=_0x41e902[_0x1bb7('0x28')]()===_0x1bb7('0x29')?_0xb4d284[_0x1bb7('0x2a')]:_0xb4d284[_0x1bb7('0x2b')];var _0x5ad592={'method':_0x1bb7('0xd'),'uri':_0x3b278a+_0x1bb7('0x2c'),'body':{'telephone1':_0x3234eb,'fullname':_0x3234eb,'firstname':_0x3234eb,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1bb7('0x2d')+_0x50dc43['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x256b94,'OData-Version':_0x1bb7('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5ad592);})[_0x1bb7('0x12')](function(_0x33410b){var _0x273de4=_0x33410b['headers'][_0x1bb7('0x2e')];var _0x5960ca=_0x273de4[_0x1bb7('0x2f')](_0x273de4[_0x1bb7('0x30')]('(')+0x1,_0x273de4['lastIndexOf'](')'));_0x50dc43[_0x1bb7('0x31')]=_0x5960ca;_0xde1096(_0x50dc43);})['catch'](function(_0x5616c3){_0xc3c985(_0x5616c3[_0x1bb7('0x16')]);});});}function getEndUser(_0x2007a5,_0x30da23,_0x350914,_0x2ba6a1,_0xa0484b,_0x399a24,_0x53b00d){var _0x3b35a7=_0x399a24[_0x1bb7('0x28')]()==='outbound'?_0xa0484b[_0x1bb7('0x2a')]:_0xa0484b['calleridnum'];return getAuthToken(_0x30da23,_0x350914,_0x399a24)['then'](function(_0x42ff7a){var _0x3bd519={'method':_0x1bb7('0x17'),'uri':_0x2ba6a1+_0x1bb7('0x32')+_0x3b35a7[_0x1bb7('0x33')]('+','%2b')+'\x27','headers':{'Authorization':_0x1bb7('0x19')+_0x42ff7a,'If-None-Match':null,'OData-Version':_0x1bb7('0x1a')},'json':!![]};return rp(_0x3bd519);})[_0x1bb7('0x12')](function(_0x5857b7){var _0x18d6ec=![];if(!_0x5857b7)return _0x18d6ec;var _0x362a64=_0x5857b7['value'];for(var _0x31074e=0x0;_0x31074e<_0x362a64[_0x1bb7('0x1f')];_0x31074e++){if(_0x362a64[_0x31074e]['telephone1']===_0x3b35a7){_0x18d6ec=!![];_0x2007a5[_0x1bb7('0x31')]=_0x362a64[_0x31074e]['contactid'];}}return _0x18d6ec;})['then'](function(_0x383316){if(_0x383316)return _0x2007a5;if(_0x53b00d===_0x1bb7('0x34')){logger[_0x1bb7('0x21')]('['+[_0x399a24[_0x1bb7('0x22')]()]+_0x1bb7('0x35'));return _0x2007a5;}return createEndUser(_0x2007a5,_0x30da23,_0x350914,_0x2ba6a1,_0xa0484b,_0x399a24)[_0x1bb7('0x12')](function(_0x31c0f9){logger['info']('['+[_0x399a24[_0x1bb7('0x22')]()]+_0x1bb7('0x36'),_0x31c0f9['enduserId']);return _0x31c0f9;});});}function getCustomFields(_0x469e0c,_0x4d993a,_0x433054){var _0x347bdc={};if(_0x469e0c['length']>0x0){_[_0x1bb7('0x37')](_0x469e0c,function(_0x483917){if(_['includes']([_0x1bb7('0x38'),_0x1bb7('0x39')],_0x483917[_0x1bb7('0x3a')])&&_0x483917['nameField']&&!_0x483917[_0x1bb7('0x3b')]){var _0x3d2828=_0x483917['idField']['toLowerCase']();var _0xbcd8a2=_0x3d2828[_0x1bb7('0x2f')](0x0,_0x3d2828[_0x1bb7('0x3c')]('_'));var _0x5baaa0=_0x3d2828['substring'](_0x3d2828['indexOf']('_')+0x1);if(_0xbcd8a2===_0x433054){_0x347bdc[_0x5baaa0]=_0x483917['content'];}}});}return _0x347bdc;}function getTicket(_0xc15073,_0x5c23e4,_0x5bdbae,_0x54d062,_0x2ac6db,_0x212d7e,_0xb47474){return new Promise(function(_0x5bdca3,_0x4cf52a){var _0x46c352;return getAuthToken(_0x5c23e4,_0x5bdbae,_0xb47474)[_0x1bb7('0x12')](function(_0x943d94){if(_0x212d7e[_0x1bb7('0x3d')]===_0x1bb7('0x3e')){_0x46c352={'method':_0x1bb7('0xd'),'uri':_0x54d062+'incidents','body':Object[_0x1bb7('0x3f')]({},{'title':intUtil['getString'](_0x212d7e[_0x1bb7('0x40')],_0x2ac6db,'\x20'),'description':intUtil[_0x1bb7('0x41')](_0x212d7e[_0x1bb7('0x42')],_0x2ac6db,'\x0a'),'customerid_contact@odata.bind':_0xc15073[_0x1bb7('0x31')]?'/contacts('+_0xc15073[_0x1bb7('0x31')]+')':undefined,'ownerid@odata.bind':_0x1bb7('0x2d')+_0xc15073[_0x1bb7('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x212d7e[_0x1bb7('0x43')],_0x2ac6db,_0x212d7e['ticketType'])),'headers':{'Authorization':_0x1bb7('0x19')+_0x943d94,'OData-Version':_0x1bb7('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x212d7e[_0x1bb7('0x3d')]===_0x1bb7('0x44')){var _0x406c1f=_0xc15073[_0x1bb7('0x31')]?[{'partyid_systemuser@odata.bind':_0x1bb7('0x2d')+_0xc15073['userId']+')','participationtypemask':_0xc15073[_0x1bb7('0x45')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0xc15073[_0x1bb7('0x31')]+')','participationtypemask':_0xc15073['callDirection']===_0x1bb7('0x46')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x1bb7('0x2d')+_0xc15073['userId']+')','participationtypemask':_0xc15073[_0x1bb7('0x45')]==='queue'?0x2:0x1}];_0x46c352={'method':_0x1bb7('0xd'),'uri':_0x54d062+_0x1bb7('0x47'),'body':Object[_0x1bb7('0x3f')]({},{'subject':intUtil['getString'](_0x212d7e['Subjects'],_0x2ac6db,'\x20'),'phonenumber':String(_0x2ac6db[_0x1bb7('0x2b')]),'description':intUtil['getString'](_0x212d7e['Descriptions'],_0x2ac6db,'\x0a'),'regardingobjectid_contact@odata.bind':_0xc15073[_0x1bb7('0x31')]?'/contacts('+_0xc15073[_0x1bb7('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0xc15073[_0x1bb7('0x25')]+')','directioncode':_0xc15073[_0x1bb7('0x45')]===_0x1bb7('0x46')?![]:!![],'phonecall_activity_parties':_0x406c1f},getCustomFields(_0x212d7e['Fields'],_0x2ac6db,_0x212d7e[_0x1bb7('0x3d')])),'headers':{'Authorization':'Bearer\x20'+_0x943d94,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x46c352);})[_0x1bb7('0x12')](function(_0x4c1b98){var _0x4235fb=_0x4c1b98['headers'][_0x1bb7('0x2e')];var _0x4f7d8e=_0x4235fb[_0x1bb7('0x2f')](_0x4235fb[_0x1bb7('0x30')]('(')+0x1,_0x4235fb['lastIndexOf'](')'));_0xc15073[_0x1bb7('0x48')]=_0x4f7d8e;_0x5bdca3(_0xc15073);})[_0x1bb7('0x27')](function(_0x43ce64){_0x4cf52a(_0x43ce64[_0x1bb7('0x16')]);});});}function emit(_0x3d5139,_0x43abf3,_0x13cbf9,_0x4c4e0){var _0x544728={'uri':util[_0x1bb7('0x49')](_0x1bb7('0x4a'),_0x3d5139,_0x13cbf9,_0x4c4e0)};io['to'](util[_0x1bb7('0x49')]('user:%s',_0x43abf3))[_0x1bb7('0x4b')](_0x1bb7('0x4c'),_0x544728);}exports['cs']=function(_0x26e89b,_0x5a1722,_0xeb0991,_0x1f9cfc,_0x3ee2e1,_0x414fa1,_0x1db760,_0x211662){var _0x3f8b57={};_0x414fa1[_0x1bb7('0x9')]=_0x414fa1[_0x1bb7('0x8')]?intUtil['stripTrailingSlash'](_0x414fa1[_0x1bb7('0xa')]['data7']):intUtil['stripTrailingSlash'](_0x414fa1[_0x1bb7('0x9')]);_0x414fa1[_0x1bb7('0x4d')]=intUtil[_0x1bb7('0x4e')](_0x414fa1[_0x1bb7('0x4d')]);_0x3f8b57[_0x1bb7('0x45')]=_0x211662===_0x1bb7('0x46')||_0x211662===_0x1bb7('0x4f')?_0x1bb7('0x46'):_0x1bb7('0x29');var _0x3ad53a=_0x414fa1[_0x1bb7('0x8')]?util[_0x1bb7('0x49')]('%s/api/data/v9.0/',_0x414fa1[_0x1bb7('0xa')][_0x1bb7('0x50')]):util['format']('%s/api/data/v9.0/',_0x414fa1[_0x1bb7('0x9')]);var _0x502f09=util['format'](_0x1bb7('0x51'),_0x414fa1[_0x1bb7('0x52')]);var _0x3334db=util[_0x1bb7('0x49')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x414fa1[_0x1bb7('0x4d')],_0x5a1722['uniqueid'],md5(_0x5a1722[_0x1bb7('0x53')]));if(_0x3ee2e1&&_0x3ee2e1['monitor_format']){logger[_0x1bb7('0x21')](_0x1bb7('0x54'),_0x1bb7('0x55'));_0x5a1722[_0x1bb7('0x56')]=_0x3334db;}else if(_0x1db760&&_0x1db760['recordingFormat']&&_0x1db760['recordingFormat']!==_0x1bb7('0x57')){logger['info'](_0x1bb7('0x58'),_0x1bb7('0x55'));_0x5a1722[_0x1bb7('0x56')]=_0x3334db;}else{_0x5a1722[_0x1bb7('0x56')]='';}return getUser(_0x3f8b57,_0x414fa1,_0x1f9cfc,_0x502f09,_0x3ad53a,_0x211662)[_0x1bb7('0x12')](function(_0x4953e1){logger[_0x1bb7('0x21')]('['+_0x211662[_0x1bb7('0x22')]()+_0x1bb7('0x59'),_0x4953e1[_0x1bb7('0x25')]);logger[_0x1bb7('0x21')]('['+_0x211662['toUpperCase']()+_0x1bb7('0x5a'),_0x4953e1[_0x1bb7('0x5b')]);return getEndUser(_0x4953e1,_0x414fa1,_0x502f09,_0x3ad53a,_0x5a1722,_0x211662,_0xeb0991[_0x1bb7('0x5c')]);})[_0x1bb7('0x12')](function(_0xb8df53){logger[_0x1bb7('0x21')]('['+_0x211662[_0x1bb7('0x22')]()+_0x1bb7('0x5d'),_0xb8df53['enduserId']);logger[_0x1bb7('0x21')]('['+_0x211662['toUpperCase']()+_0x1bb7('0x5e'),_0x5a1722['calleridnum']);return getTicket(_0xb8df53,_0x414fa1,_0x502f09,_0x3ad53a,_0x5a1722,_0xeb0991,_0x211662);})[_0x1bb7('0x12')](function(_0x50c987){logger[_0x1bb7('0x21')](util[_0x1bb7('0x49')]('['+_0x211662[_0x1bb7('0x22')]()+_0x1bb7('0x5f'),_0xeb0991[_0x1bb7('0x3d')],_0x50c987[_0x1bb7('0x48')]));logger[_0x1bb7('0x21')](util[_0x1bb7('0x49')]('['+_0x211662[_0x1bb7('0x22')]()+']\x20Call\x20direction:\x20%s',_0x211662));if(_0x211662!==_0x1bb7('0x4f')){logger[_0x1bb7('0x21')]('['+_0x211662[_0x1bb7('0x22')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x414fa1[_0x1bb7('0x9')],_0x1f9cfc[_0x1bb7('0x60')],_0xeb0991[_0x1bb7('0x3d')],_0x50c987['ticketId']);}})[_0x1bb7('0x27')](function(_0x45d55b){logger[_0x1bb7('0x14')]('['+_0x211662[_0x1bb7('0x22')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x45d55b[_0x1bb7('0x16')]);});};
\ No newline at end of file
+var _0x4e83=[']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','../../../../config/logger','redis','localhost','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','message','toLowerCase','outbound','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','picklist','nameField','customField','idField','content','ticketType','incident','incidents','getString','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','phonecalls','Subjects','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate'];(function(_0x34aee1,_0x313559){var _0x40d781=function(_0x19635e){while(--_0x19635e){_0x34aee1['push'](_0x34aee1['shift']());}};_0x40d781(++_0x313559);}(_0x4e83,0x1ae));var _0x34e8=function(_0x44db8e,_0x143b54){_0x44db8e=_0x44db8e-0x0;var _0x40667a=_0x4e83[_0x44db8e];return _0x40667a;};'use strict';var _=require(_0x34e8('0x0'));var rp=require('request-promise');var util=require(_0x34e8('0x1'));var intUtil=require(_0x34e8('0x2'));var md5=require(_0x34e8('0x3'));var Redis=require(_0x34e8('0x4'));var logger=require(_0x34e8('0x5'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0x34e8('0x6')],{'host':_0x34e8('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x34e8('0x6')]));function getAuthToken(_0x4567bd,_0x28677c,_0x5b5ddc){if(_0x4567bd[_0x34e8('0x8')]){_0x4567bd[_0x34e8('0x9')]=_0x4567bd[_0x34e8('0xa')]['data7'];_0x4567bd[_0x34e8('0xb')]=_0x4567bd[_0x34e8('0xa')][_0x34e8('0xc')];return Promise[_0x34e8('0xd')](_0x4567bd[_0x34e8('0xa')][_0x34e8('0xe')]);}var _0x419ca2={'method':_0x34e8('0xf'),'uri':_0x28677c,'form':{'client_id':_0x4567bd[_0x34e8('0x10')],'resource':_0x4567bd['remoteUri'],'username':_0x4567bd[_0x34e8('0x11')],'password':_0x4567bd[_0x34e8('0x12')],'grant_type':'password','client_secret':_0x4567bd[_0x34e8('0x13')]},'json':!![]};return rp(_0x419ca2)[_0x34e8('0x14')](function(_0x368d5f){return _0x368d5f[_0x34e8('0x15')];})[_0x34e8('0x16')](function(_0x70f65a){logger[_0x34e8('0x17')]('['+[_0x5b5ddc[_0x34e8('0x18')]()]+_0x34e8('0x19'));return _0x70f65a['message'];});}function getUser(_0xeb505,_0x4447d3,_0x36adfb,_0x332735,_0x3772d7,_0x4a4d17){return new Promise(function(_0x35cf64,_0x37b6ae){return getAuthToken(_0x4447d3,_0x332735,_0x4a4d17)[_0x34e8('0x14')](function(_0x708dd4){var _0x381484={'method':_0x34e8('0x1a'),'uri':_0x3772d7+_0x34e8('0x1b'),'headers':{'Authorization':_0x34e8('0x1c')+_0x708dd4,'OData-Version':_0x34e8('0x1d')},'json':!![]};return rp(_0x381484);})[_0x34e8('0x14')](function(_0x404b99){var _0x53b90a=_0x404b99[_0x34e8('0x1e')];var _0x368706=![];var _0xe42e15=null;if(!_[_0x34e8('0x1f')](_0x36adfb)){if(intUtil[_0x34e8('0x20')](_0x36adfb[_0x34e8('0x21')])){_0xeb505[_0x34e8('0x22')]=_0x36adfb[_0x34e8('0x21')];for(_0xe42e15=0x0;_0xe42e15<_0x53b90a['length'];_0xe42e15++){if(_0x53b90a[_0xe42e15][_0x34e8('0x23')]===_0x36adfb[_0x34e8('0x21')]&&!_0x53b90a[_0xe42e15]['isdisabled']){_0x368706=!![];logger[_0x34e8('0x24')]('['+[_0x4a4d17['toUpperCase']()]+_0x34e8('0x25')+_0x53b90a[_0xe42e15][_0x34e8('0x26')]+'!');_0xeb505[_0x34e8('0x27')]=_0x53b90a[_0xe42e15]['systemuserid'];}}}}if(!_0x368706){logger['info']('['+[_0x4a4d17[_0x34e8('0x18')]()]+_0x34e8('0x28'));_0xeb505[_0x34e8('0x22')]=_0x4447d3[_0x34e8('0x11')];for(_0xe42e15=0x0;_0xe42e15<_0x53b90a[_0x34e8('0x29')];_0xe42e15++){if(_0x53b90a[_0xe42e15][_0x34e8('0x23')]===_0x4447d3[_0x34e8('0x11')]){_0xeb505['userId']=_0x53b90a[_0xe42e15][_0x34e8('0x26')];}}}_0x35cf64(_0xeb505);})[_0x34e8('0x16')](function(_0x46c2a0){_0x37b6ae(_0x46c2a0[_0x34e8('0x2a')]);});});}function createEndUser(_0xe77c9e,_0x23934c,_0x21f31e,_0xae7ab8,_0x2b445a,_0x18490b){return new Promise(function(_0x3f5421,_0x6f4428){return getAuthToken(_0x23934c,_0x21f31e,_0x18490b)[_0x34e8('0x14')](function(_0x1e0d5e){var _0x37b81b=_0x18490b[_0x34e8('0x2b')]()===_0x34e8('0x2c')?_0x2b445a['destcalleridnum']:_0x2b445a[_0x34e8('0x2d')];var _0x1a3146={'method':'POST','uri':_0xae7ab8+_0x34e8('0x2e'),'body':{'telephone1':_0x37b81b,'fullname':_0x37b81b,'firstname':_0x37b81b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x34e8('0x2f')+_0xe77c9e[_0x34e8('0x27')]+')'},'headers':{'Authorization':_0x34e8('0x1c')+_0x1e0d5e,'OData-Version':_0x34e8('0x1d')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1a3146);})[_0x34e8('0x14')](function(_0x1b64a0){var _0x1673d3=_0x1b64a0[_0x34e8('0x30')][_0x34e8('0x31')];var _0x15b5fd=_0x1673d3[_0x34e8('0x32')](_0x1673d3[_0x34e8('0x33')]('(')+0x1,_0x1673d3[_0x34e8('0x33')](')'));_0xe77c9e[_0x34e8('0x34')]=_0x15b5fd;_0x3f5421(_0xe77c9e);})[_0x34e8('0x16')](function(_0x44c9d0){_0x6f4428(_0x44c9d0['message']);});});}function getEndUser(_0x3b5395,_0x3580d3,_0x59fcc2,_0x351c62,_0x38a525,_0x1fb985,_0xde0d37){var _0x13ca19=_0x1fb985[_0x34e8('0x2b')]()===_0x34e8('0x2c')?_0x38a525['destcalleridnum']:_0x38a525['calleridnum'];return getAuthToken(_0x3580d3,_0x59fcc2,_0x1fb985)[_0x34e8('0x14')](function(_0x3e7be9){var _0x356269={'method':'GET','uri':_0x351c62+_0x34e8('0x35')+_0x13ca19[_0x34e8('0x36')]('+',_0x34e8('0x37'))+'\x27','headers':{'Authorization':_0x34e8('0x1c')+_0x3e7be9,'If-None-Match':null,'OData-Version':_0x34e8('0x1d')},'json':!![]};return rp(_0x356269);})[_0x34e8('0x14')](function(_0x2ad2c6){var _0x2e4fce=![];if(!_0x2ad2c6)return _0x2e4fce;var _0x50a32c=_0x2ad2c6[_0x34e8('0x1e')];for(var _0x380394=0x0;_0x380394<_0x50a32c[_0x34e8('0x29')];_0x380394++){if(_0x50a32c[_0x380394]['telephone1']===_0x13ca19){_0x2e4fce=!![];_0x3b5395[_0x34e8('0x34')]=_0x50a32c[_0x380394][_0x34e8('0x38')];}}return _0x2e4fce;})['then'](function(_0x5d7ff7){if(_0x5d7ff7)return _0x3b5395;if(_0xde0d37===_0x34e8('0x39')){logger[_0x34e8('0x24')]('['+[_0x1fb985['toUpperCase']()]+_0x34e8('0x3a'));return _0x3b5395;}return createEndUser(_0x3b5395,_0x3580d3,_0x59fcc2,_0x351c62,_0x38a525,_0x1fb985)[_0x34e8('0x14')](function(_0x29fb22){logger[_0x34e8('0x24')]('['+[_0x1fb985[_0x34e8('0x18')]()]+_0x34e8('0x3b'),_0x29fb22[_0x34e8('0x34')]);return _0x29fb22;});});}function getCustomFields(_0x1221e2,_0x330f9f,_0x5b8011){var _0x56035b={};if(_0x1221e2[_0x34e8('0x29')]>0x0){_['forEach'](_0x1221e2,function(_0x29d788){if(_[_0x34e8('0x3c')]([_0x34e8('0x3d'),_0x34e8('0x3e')],_0x29d788['type'])&&_0x29d788[_0x34e8('0x3f')]&&!_0x29d788[_0x34e8('0x40')]){var _0x18a158=_0x29d788[_0x34e8('0x41')][_0x34e8('0x2b')]();var _0x58b74f=_0x18a158[_0x34e8('0x32')](0x0,_0x18a158['indexOf']('_'));var _0x317e63=_0x18a158[_0x34e8('0x32')](_0x18a158['indexOf']('_')+0x1);if(_0x58b74f===_0x5b8011){_0x56035b[_0x317e63]=_0x29d788[_0x34e8('0x42')];}}});}return _0x56035b;}function getTicket(_0x1445a0,_0xed3be7,_0x3aa0c8,_0x59a026,_0x3d8aa0,_0x3cda30,_0x5884f0){return new Promise(function(_0x507a32,_0x2dc751){var _0x55c484;return getAuthToken(_0xed3be7,_0x3aa0c8,_0x5884f0)[_0x34e8('0x14')](function(_0x4af150){if(_0x3cda30[_0x34e8('0x43')]===_0x34e8('0x44')){_0x55c484={'method':'POST','uri':_0x59a026+_0x34e8('0x45'),'body':Object['assign']({},{'title':intUtil[_0x34e8('0x46')](_0x3cda30['Subjects'],_0x3d8aa0,'\x20'),'description':intUtil[_0x34e8('0x46')](_0x3cda30[_0x34e8('0x47')],_0x3d8aa0,'\x0a'),'customerid_contact@odata.bind':_0x1445a0[_0x34e8('0x34')]?_0x34e8('0x48')+_0x1445a0[_0x34e8('0x34')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x1445a0['userId']+')','caseorigincode':'1'},getCustomFields(_0x3cda30[_0x34e8('0x49')],_0x3d8aa0,_0x3cda30[_0x34e8('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0x4af150,'OData-Version':_0x34e8('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3cda30[_0x34e8('0x43')]===_0x34e8('0x4a')){var _0x52db3a=_0x1445a0[_0x34e8('0x34')]?[{'partyid_systemuser@odata.bind':_0x34e8('0x2f')+_0x1445a0['userId']+')','participationtypemask':_0x1445a0['callDirection']===_0x34e8('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x1445a0[_0x34e8('0x34')]+')','participationtypemask':_0x1445a0[_0x34e8('0x4c')]===_0x34e8('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x34e8('0x2f')+_0x1445a0[_0x34e8('0x27')]+')','participationtypemask':_0x1445a0[_0x34e8('0x4c')]===_0x34e8('0x4b')?0x2:0x1}];_0x55c484={'method':_0x34e8('0xf'),'uri':_0x59a026+_0x34e8('0x4d'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x3cda30[_0x34e8('0x4e')],_0x3d8aa0,'\x20'),'phonenumber':String(_0x3d8aa0[_0x34e8('0x2d')]),'description':intUtil[_0x34e8('0x46')](_0x3cda30[_0x34e8('0x47')],_0x3d8aa0,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1445a0[_0x34e8('0x34')]?_0x34e8('0x48')+_0x1445a0[_0x34e8('0x34')]+')':undefined,'ownerid@odata.bind':_0x34e8('0x2f')+_0x1445a0[_0x34e8('0x27')]+')','directioncode':_0x1445a0['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':_0x52db3a},getCustomFields(_0x3cda30[_0x34e8('0x49')],_0x3d8aa0,_0x3cda30[_0x34e8('0x43')])),'headers':{'Authorization':_0x34e8('0x1c')+_0x4af150,'OData-Version':_0x34e8('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x55c484);})[_0x34e8('0x14')](function(_0x1dccd0){var _0x5d72a5=_0x1dccd0[_0x34e8('0x30')][_0x34e8('0x31')];var _0x4d8835=_0x5d72a5[_0x34e8('0x32')](_0x5d72a5[_0x34e8('0x33')]('(')+0x1,_0x5d72a5[_0x34e8('0x33')](')'));_0x1445a0[_0x34e8('0x4f')]=_0x4d8835;_0x507a32(_0x1445a0);})[_0x34e8('0x16')](function(_0x25d3da){_0x2dc751(_0x25d3da[_0x34e8('0x2a')]);});});}function emit(_0x3b7fa9,_0x43d9ad,_0x123293,_0x21c119){var _0x2360d9={'uri':util[_0x34e8('0x50')](_0x34e8('0x51'),_0x3b7fa9,_0x123293,_0x21c119)};io['to'](util[_0x34e8('0x50')](_0x34e8('0x52'),_0x43d9ad))[_0x34e8('0x53')]('trigger:browser:url',_0x2360d9);}exports['cs']=function(_0x4676b2,_0x3b80e1,_0x18ebef,_0x3d78b4,_0x3de43a,_0x3b5842,_0x97da41,_0x1c9426){var _0x294b8a={};_0x3b5842[_0x34e8('0x9')]=_0x3b5842[_0x34e8('0x8')]?intUtil[_0x34e8('0x54')](_0x3b5842['CloudProvider'][_0x34e8('0x55')]):intUtil[_0x34e8('0x54')](_0x3b5842[_0x34e8('0x9')]);_0x3b5842[_0x34e8('0x56')]=intUtil[_0x34e8('0x54')](_0x3b5842[_0x34e8('0x56')]);_0x294b8a[_0x34e8('0x4c')]=_0x1c9426===_0x34e8('0x4b')||_0x1c9426===_0x34e8('0x57')?_0x34e8('0x4b'):_0x34e8('0x2c');var _0x24226f=_0x3b5842[_0x34e8('0x8')]?util['format'](_0x34e8('0x58'),_0x3b5842['CloudProvider']['data7']):util[_0x34e8('0x50')]('%s/api/data/v9.0/',_0x3b5842[_0x34e8('0x9')]);var _0x527a71=util[_0x34e8('0x50')]('https://login.microsoftonline.com/%s/oauth2/token',_0x3b5842[_0x34e8('0xb')]);var _0x26636a=util[_0x34e8('0x50')](_0x34e8('0x59'),_0x3b5842['serverUrl'],_0x3b80e1[_0x34e8('0x5a')],md5(_0x3b80e1[_0x34e8('0x5a')]));if(_0x3de43a&&_0x3de43a[_0x34e8('0x5b')]){logger['info'](_0x34e8('0x5c'),_0x34e8('0x5d'));_0x3b80e1[_0x34e8('0x5e')]=_0x26636a;}else if(_0x97da41&&_0x97da41['recordingFormat']&&_0x97da41[_0x34e8('0x5f')]!=='none'){logger[_0x34e8('0x24')](_0x34e8('0x60'),'Recording\x20is\x20enabled!');_0x3b80e1[_0x34e8('0x5e')]=_0x26636a;}else{_0x3b80e1[_0x34e8('0x5e')]='';}return getUser(_0x294b8a,_0x3b5842,_0x3d78b4,_0x527a71,_0x24226f,_0x1c9426)['then'](function(_0x4d1ad9){logger['info']('['+_0x1c9426[_0x34e8('0x18')]()+_0x34e8('0x61'),_0x4d1ad9['userId']);logger[_0x34e8('0x24')]('['+_0x1c9426[_0x34e8('0x18')]()+_0x34e8('0x62'),_0x4d1ad9[_0x34e8('0x22')]);return getEndUser(_0x4d1ad9,_0x3b5842,_0x527a71,_0x24226f,_0x3b80e1,_0x1c9426,_0x18ebef[_0x34e8('0x63')]);})[_0x34e8('0x14')](function(_0x464c81){logger[_0x34e8('0x24')]('['+_0x1c9426[_0x34e8('0x18')]()+_0x34e8('0x64'),_0x464c81[_0x34e8('0x34')]);logger['info']('['+_0x1c9426[_0x34e8('0x18')]()+_0x34e8('0x65'),_0x3b80e1['calleridnum']);return getTicket(_0x464c81,_0x3b5842,_0x527a71,_0x24226f,_0x3b80e1,_0x18ebef,_0x1c9426);})[_0x34e8('0x14')](function(_0x427419){logger['info'](util['format']('['+_0x1c9426[_0x34e8('0x18')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x18ebef['ticketType'],_0x427419['ticketId']));logger[_0x34e8('0x24')](util['format']('['+_0x1c9426[_0x34e8('0x18')]()+_0x34e8('0x66'),_0x1c9426));if(_0x1c9426!==_0x34e8('0x57')){logger[_0x34e8('0x24')]('['+_0x1c9426[_0x34e8('0x18')]()+']',_0x34e8('0x67'));emit(_0x3b5842[_0x34e8('0x9')],_0x3d78b4[_0x34e8('0x68')],_0x18ebef[_0x34e8('0x43')],_0x427419[_0x34e8('0x4f')]);}})[_0x34e8('0x16')](function(_0x4b47ed){logger[_0x34e8('0x17')]('['+_0x1c9426[_0x34e8('0x18')]()+_0x34e8('0x69'),_0x4b47ed[_0x34e8('0x2a')]);});};
\ No newline at end of file
index cbd0fca..4ffc68f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d4e=['md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','<br>','Tags','name','custom_fields','keyBy','value','%s/api/v2/tickets','validateEmail','%s/api/v2/agents','then','length','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','remoteUri','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','POST','Enduser\x20created.','Basic\x20%s','base64','stringify','GET','map','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','idField','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]','catch','toUpperCase','Ticket\x20created!','lastevent','lodash'];(function(_0x28d5e3,_0x5658d8){var _0x355678=function(_0x61a038){while(--_0x61a038){_0x28d5e3['push'](_0x28d5e3['shift']());}};_0x355678(++_0x5658d8);}(_0x9d4e,0xad));var _0xe9d4=function(_0x574dea,_0x4cf209){_0x574dea=_0x574dea-0x0;var _0x3ed444=_0x9d4e[_0x574dea];return _0x3ed444;};'use strict';var _=require(_0xe9d4('0x0'));var rp=require('request-promise');var md5=require(_0xe9d4('0x1'));var util=require('util');var Redis=require(_0xe9d4('0x2'));var intUtil=require(_0xe9d4('0x3'));var config=require(_0xe9d4('0x4'));var logger=require(_0xe9d4('0x5'))('freshdesk');config[_0xe9d4('0x6')]=_[_0xe9d4('0x7')](config[_0xe9d4('0x6')],{'host':_0xe9d4('0x8'),'port':0x18eb});var io=require(_0xe9d4('0x9'))(new Redis(config[_0xe9d4('0x6')]));var headers={'Content-Type':'application/json','Accept':_0xe9d4('0xa')};function emit(_0x5ec07d,_0x579845,_0x338986){io['to'](_0x5ec07d)['emit'](_0x579845,_0x338986);}function getTicket(_0x5773ea,_0x44f5e6,_0x14e382,_0x3f4672,_0x36dd82){logger[_0xe9d4('0xb')](_0xe9d4('0xc'));var _0x1ab2ef=_[_0xe9d4('0xd')]({'responder_id':_0x44f5e6['id'],'requester_id':_0x14e382['id'],'name':util[_0xe9d4('0xe')]('Caller\x20-\x20%s',_0x36dd82[_0xe9d4('0xf')]),'phone':_0x36dd82[_0xe9d4('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe9d4('0x11')](_0x3f4672[_0xe9d4('0x12')],_0x36dd82,'\x20'),'description':intUtil[_0xe9d4('0x11')](_0x3f4672['Descriptions'],_0x36dd82,_0xe9d4('0x13')),'tags':getTags(_0x3f4672[_0xe9d4('0x14')],_0xe9d4('0x15'))},getCustomFields(_0x3f4672['Fields'],_0x36dd82));_0x1ab2ef[_0xe9d4('0x16')]=_['mapValues'](_[_0xe9d4('0x17')](_0x1ab2ef[_0xe9d4('0x16')],'id'),_0xe9d4('0x18'));return request({'uri':util[_0xe9d4('0xe')](_0xe9d4('0x19'),_0x5773ea['remoteUri']),'method':'POST','body':_0x1ab2ef})['then'](function(_0x4198b5){logger[_0xe9d4('0xb')]('Ticket\x20created!');return _0x4198b5;});}function getUser(_0x261a56,_0x395f25){if(intUtil[_0xe9d4('0x1a')](_0x395f25)){return request({'uri':util[_0xe9d4('0xe')](_0xe9d4('0x1b'),_0x261a56['remoteUri']),'qs':{'email':_0x395f25}})[_0xe9d4('0x1c')](function(_0x3496af){if(_0x3496af[_0xe9d4('0x1d')]){logger[_0xe9d4('0xb')]('Agent\x20found!');return _[_0xe9d4('0x1e')](_0x3496af,function(_0x48facc){return _0x48facc['contact']['email']===_0x395f25;});}else{logger[_0xe9d4('0xb')](_0xe9d4('0x1f'));return request({'uri':util[_0xe9d4('0xe')](_0xe9d4('0x20'),_0x261a56[_0xe9d4('0x21')])})[_0xe9d4('0x1c')](function(_0x4f8529){logger[_0xe9d4('0xb')](_0xe9d4('0x22'));return _0x4f8529;});}});}else{logger['info'](_0xe9d4('0x23'));return request({'uri':util[_0xe9d4('0xe')](_0xe9d4('0x20'),_0x261a56[_0xe9d4('0x21')])})[_0xe9d4('0x1c')](function(_0x5cb0a3){logger['info'](_0xe9d4('0x22'));return _0x5cb0a3;});}}function getEndUser(_0x3478a8,_0x5e7256,_0x1521ac){logger[_0xe9d4('0xb')](_0xe9d4('0x24'),_0x1521ac);return request({'uri':util[_0xe9d4('0xe')](_0xe9d4('0x25'),_0x3478a8['remoteUri']),'qs':{'phone':_0x1521ac}})[_0xe9d4('0x1c')](function(_0x1d69a7){if(_0x1d69a7[_0xe9d4('0x1d')]){logger[_0xe9d4('0xb')](_0xe9d4('0x26'));return _[_0xe9d4('0x1e')](_0x1d69a7,{'phone':_0x1521ac});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xe9d4('0xe')](_0xe9d4('0x25'),_0x3478a8[_0xe9d4('0x21')]),'method':_0xe9d4('0x27'),'body':{'name':_0x5e7256,'phone':_0x1521ac}})['then'](function(_0x34436a){logger[_0xe9d4('0xb')](_0xe9d4('0x28'));return _0x34436a;});}});}function getAuth(_0x4cec8f){return util['format'](_0xe9d4('0x29'),new Buffer(_0x4cec8f['apiKey']+':X')['toString'](_0xe9d4('0x2a')));}function request(_0x28a453){logger['debug']('[HTTP]',JSON[_0xe9d4('0x2b')](_0x28a453));return rp(_[_0xe9d4('0x7')](_0x28a453,{'method':_0xe9d4('0x2c'),'headers':headers,'json':!![]}));}function getTags(_0xac74d0,_0x5d586c){var _0x3d3ed3=[];if(_0xac74d0&&_0xac74d0[_0xe9d4('0x1d')]>0x0){_0x3d3ed3=_[_0xe9d4('0x2d')](_0xac74d0,_0x5d586c);}return _0x3d3ed3;}function getCustomFields(_0x117d2e,_0x2301b8){var _0x2bd1b8=[];var _0x173859={'custom_fields':[]};if(_0x117d2e[_0xe9d4('0x1d')]>0x0){_['forEach'](_0x117d2e,function(_0x353da1){if(_[_0xe9d4('0x2e')]([_0xe9d4('0x2f'),'picklist'],_0x353da1[_0xe9d4('0x30')])&&_0x353da1[_0xe9d4('0x31')]&&!_0x353da1[_0xe9d4('0x32')]){_0x173859[_0x353da1[_0xe9d4('0x31')][_0xe9d4('0x33')]()]=_0x353da1[_0xe9d4('0x34')][_0xe9d4('0x35')]();}else if(_[_0xe9d4('0x2e')]([_0xe9d4('0x2f'),_0xe9d4('0x36')],_0x353da1[_0xe9d4('0x30')])&&_0x353da1[_0xe9d4('0x37')]&&_0x353da1[_0xe9d4('0x32')]){_0x173859[_0xe9d4('0x16')][_0xe9d4('0x38')]({'id':_0x353da1[_0xe9d4('0x37')],'value':_0x353da1[_0xe9d4('0x34')][_0xe9d4('0x35')]()});}else if(_0x353da1[_0xe9d4('0x30')]==='variable'&&_0x353da1[_0xe9d4('0x39')]&&_0x353da1[_0xe9d4('0x37')]&&_0x353da1[_0xe9d4('0x32')]){_0x2301b8[_0x353da1[_0xe9d4('0x39')]]&&_0x173859[_0xe9d4('0x16')][_0xe9d4('0x38')]({'id':_0x353da1[_0xe9d4('0x37')],'value':_0x2301b8[_0x353da1[_0xe9d4('0x39')]][_0xe9d4('0x35')]()});}else if(_0x353da1[_0xe9d4('0x30')]===_0xe9d4('0x3a')&&_0x353da1[_0xe9d4('0x3b')]&&_0x353da1[_0xe9d4('0x3b')][_0xe9d4('0x15')]&&_0x353da1['idField']&&_0x353da1[_0xe9d4('0x32')]){_0x2301b8[_0x353da1[_0xe9d4('0x3b')]['name'][_0xe9d4('0x33')]()]&&_0x173859['custom_fields'][_0xe9d4('0x38')]({'id':_0x353da1[_0xe9d4('0x37')],'value':_0x2301b8[_0x353da1[_0xe9d4('0x3b')][_0xe9d4('0x15')][_0xe9d4('0x33')]()]['toString']()});}});}return _0x173859;}exports[_0xe9d4('0x3c')]=function(_0x22da03,_0x3b3744,_0x70f876,_0xa663d8,_0x7f0c7c,_0x164d42){var _0x1ab6dc,_0x5dd8c8;_0x164d42[_0xe9d4('0x21')]=intUtil[_0xe9d4('0x3d')](_0x164d42[_0xe9d4('0x21')]);_0x164d42[_0xe9d4('0x3e')]=intUtil[_0xe9d4('0x3d')](_0x164d42['serverUrl']);if(_0x7f0c7c&&_0x7f0c7c[_0xe9d4('0x3f')]){logger[_0xe9d4('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b3744[_0xe9d4('0x40')]=util[_0xe9d4('0xe')](_0xe9d4('0x41'),_0x164d42['serverUrl'],_0x3b3744[_0xe9d4('0x42')],md5(_0x3b3744[_0xe9d4('0x42')]));}else{_0x3b3744['recordingURL']='';}headers[_0xe9d4('0x43')]=getAuth(_0x164d42);return getUser(_0x164d42,_0xa663d8[_0xe9d4('0x44')])[_0xe9d4('0x1c')](function(_0xda51f1){_0x1ab6dc=_0xda51f1;logger[_0xe9d4('0xb')](_0xe9d4('0x45'),_0x1ab6dc['id']);return getEndUser(_0x164d42,_0x3b3744[_0xe9d4('0xf')],_0x3b3744[_0xe9d4('0x10')]);})['then'](function(_0x47d25e){_0x5dd8c8=_0x47d25e;logger[_0xe9d4('0xb')](_0xe9d4('0x46'),_0x5dd8c8['id']);return getTicket(_0x164d42,_0x1ab6dc,_0x5dd8c8,_0x70f876,_0x3b3744);})[_0xe9d4('0x1c')](function(_0x2ddc28){if(_0x2ddc28&&_0x2ddc28['id']){logger[_0xe9d4('0xb')]('Ticket\x20created!');logger[_0xe9d4('0xb')](_0xe9d4('0x47'),_0x2ddc28['id']);logger[_0xe9d4('0xb')](_0xe9d4('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe9d4('0xe')](_0xe9d4('0x49'),_0xa663d8['name']),_0xe9d4('0x4a'),{'uri':util[_0xe9d4('0xe')](_0xe9d4('0x4b'),_0x164d42['remoteUri'],_0x2ddc28['id'])});}})['catch'](function(_0x36365c){logger[_0xe9d4('0x4c')](_0xe9d4('0x48'),JSON[_0xe9d4('0x2b')](_0x36365c));});};exports['outbound']=function(_0x2c1872,_0x23c583,_0x36695a,_0x22dedc,_0x26262b,_0x18e435,_0x41834a){var _0x28f4b8,_0xd4c984;_0x18e435[_0xe9d4('0x21')]=intUtil[_0xe9d4('0x3d')](_0x18e435['remoteUri']);_0x18e435[_0xe9d4('0x3e')]=intUtil[_0xe9d4('0x3d')](_0x18e435['serverUrl']);if(_0x41834a&&_0x41834a[_0xe9d4('0x4d')]&&_0x41834a[_0xe9d4('0x4d')]!==_0xe9d4('0x4e')){logger[_0xe9d4('0xb')]('[OUTBOUND]',_0xe9d4('0x4f'));_0x23c583[_0xe9d4('0x40')]=util[_0xe9d4('0xe')](_0xe9d4('0x41'),_0x18e435[_0xe9d4('0x3e')],_0x23c583['uniqueid'],md5(_0x23c583[_0xe9d4('0x42')]));}headers[_0xe9d4('0x43')]=getAuth(_0x18e435);return getUser(_0x18e435,_0x22dedc[_0xe9d4('0x44')])[_0xe9d4('0x1c')](function(_0x1e7623){_0x28f4b8=_0x1e7623;logger['info'](_0xe9d4('0x45'),_0x28f4b8['id']);return getEndUser(_0x18e435,_0x23c583[_0xe9d4('0x50')],_0x23c583[_0xe9d4('0x51')]);})[_0xe9d4('0x1c')](function(_0x15552c){_0xd4c984=_0x15552c;logger[_0xe9d4('0xb')](_0xe9d4('0x46'),_0xd4c984['id']);return getTicket(_0x18e435,_0x28f4b8,_0xd4c984,_0x36695a,_0x23c583);})[_0xe9d4('0x1c')](function(_0xf676a1){if(_0xf676a1&&_0xf676a1['id']){logger[_0xe9d4('0xb')]('Ticket\x20created!');logger[_0xe9d4('0xb')]('The\x20Ticket\x20ID\x20is:',_0xf676a1['id']);logger[_0xe9d4('0xb')](_0xe9d4('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe9d4('0xe')](_0xe9d4('0x49'),_0x22dedc[_0xe9d4('0x15')]),_0xe9d4('0x4a'),{'uri':util['format'](_0xe9d4('0x4b'),_0x18e435[_0xe9d4('0x21')],_0xf676a1['id'])});}})[_0xe9d4('0x53')](function(_0x1f2ccb){logger['error'](_0xe9d4('0x52'),JSON[_0xe9d4('0x2b')](_0x1f2ccb));});};exports['unmanaged']=function(_0x2196bd,_0x31d58a,_0x59559d,_0x5b56aa,_0xae4b32,_0x558dc9){var _0x2fbe4f,_0x33502c;_0x558dc9[_0xe9d4('0x21')]=intUtil[_0xe9d4('0x3d')](_0x558dc9[_0xe9d4('0x21')]);_0x558dc9[_0xe9d4('0x3e')]=intUtil['stripTrailingSlash'](_0x558dc9[_0xe9d4('0x3e')]);if(_0xae4b32&&_0xae4b32[_0xe9d4('0x3f')]){logger[_0xe9d4('0xb')]('['+_0x31d58a['lastevent'][_0xe9d4('0x54')]()+']',_0xe9d4('0x4f'));_0x31d58a[_0xe9d4('0x40')]=util[_0xe9d4('0xe')](_0xe9d4('0x41'),_0x558dc9[_0xe9d4('0x3e')],_0x31d58a[_0xe9d4('0x42')],md5(_0x31d58a[_0xe9d4('0x42')]));}else{_0x31d58a['recordingURL']='';}headers['Authorization']=getAuth(_0x558dc9);return getUser(_0x558dc9,'')['then'](function(_0x3fa285){_0x2fbe4f=_0x3fa285;logger[_0xe9d4('0xb')](_0xe9d4('0x45'),_0x2fbe4f['id']);return getEndUser(_0x558dc9,_0x31d58a[_0xe9d4('0xf')],_0x31d58a[_0xe9d4('0x10')]);})[_0xe9d4('0x1c')](function(_0x4b415a){_0x33502c=_0x4b415a;logger[_0xe9d4('0xb')]('The\x20Enduser\x20ID\x20is:',_0x33502c['id']);return getTicket(_0x558dc9,_0x2fbe4f,_0x33502c,_0x59559d,_0x31d58a);})[_0xe9d4('0x1c')](function(_0x2a142e){if(_0x2a142e){logger['info'](_0xe9d4('0x55'));logger[_0xe9d4('0xb')](_0xe9d4('0x47'),_0x2a142e['id']);}})[_0xe9d4('0x53')](function(_0x590ebc){logger[_0xe9d4('0x4c')]('['+_0x31d58a[_0xe9d4('0x56')][_0xe9d4('0x54')]()+']',JSON['stringify'](_0x590ebc));});};
\ No newline at end of file
+var _0xf4ff=['name','customField','toLowerCase','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','localhost','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','<br>','Tags','keyBy','custom_fields','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','remoteUri','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','apiKey','toString','[HTTP]','stringify','includes','type','content','string','idField','push','variable','variableName','customVariable','Variable'];(function(_0x3ef5ac,_0x2a71ac){var _0x17050b=function(_0x47259c){while(--_0x47259c){_0x3ef5ac['push'](_0x3ef5ac['shift']());}};_0x17050b(++_0x2a71ac);}(_0xf4ff,0x73));var _0xff4f=function(_0x12509c,_0x4c439b){_0x12509c=_0x12509c-0x0;var _0x493de9=_0xf4ff[_0x12509c];return _0x493de9;};'use strict';var _=require(_0xff4f('0x0'));var rp=require('request-promise');var md5=require(_0xff4f('0x1'));var util=require('util');var Redis=require(_0xff4f('0x2'));var intUtil=require(_0xff4f('0x3'));var config=require(_0xff4f('0x4'));var logger=require(_0xff4f('0x5'))('freshdesk');config['redis']=_[_0xff4f('0x6')](config['redis'],{'host':_0xff4f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xff4f('0x8')};function emit(_0x3edb5d,_0x4a7514,_0x1d8fb5){io['to'](_0x3edb5d)[_0xff4f('0x9')](_0x4a7514,_0x1d8fb5);}function getTicket(_0x4afc14,_0x13c42c,_0x4696d7,_0x2bd4f7,_0x3e0898){logger[_0xff4f('0xa')]('Creating\x20new\x20ticket...');var _0x21ae5d=_[_0xff4f('0xb')]({'responder_id':_0x13c42c['id'],'requester_id':_0x4696d7['id'],'name':util[_0xff4f('0xc')](_0xff4f('0xd'),_0x3e0898[_0xff4f('0xe')]),'phone':_0x3e0898[_0xff4f('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x2bd4f7[_0xff4f('0x10')],_0x3e0898,'\x20'),'description':intUtil[_0xff4f('0x11')](_0x2bd4f7['Descriptions'],_0x3e0898,_0xff4f('0x12')),'tags':getTags(_0x2bd4f7[_0xff4f('0x13')],'name')},getCustomFields(_0x2bd4f7['Fields'],_0x3e0898));_0x21ae5d['custom_fields']=_['mapValues'](_[_0xff4f('0x14')](_0x21ae5d[_0xff4f('0x15')],'id'),_0xff4f('0x16'));return request({'uri':util['format'](_0xff4f('0x17'),_0x4afc14['remoteUri']),'method':_0xff4f('0x18'),'body':_0x21ae5d})[_0xff4f('0x19')](function(_0x2c76b7){logger[_0xff4f('0xa')](_0xff4f('0x1a'));return _0x2c76b7;});}function getUser(_0x8f5434,_0x111adc){if(intUtil[_0xff4f('0x1b')](_0x111adc)){return request({'uri':util[_0xff4f('0xc')](_0xff4f('0x1c'),_0x8f5434['remoteUri']),'qs':{'email':_0x111adc}})[_0xff4f('0x19')](function(_0x40818e){if(_0x40818e[_0xff4f('0x1d')]){logger[_0xff4f('0xa')](_0xff4f('0x1e'));return _[_0xff4f('0x1f')](_0x40818e,function(_0x957302){return _0x957302[_0xff4f('0x20')][_0xff4f('0x21')]===_0x111adc;});}else{logger[_0xff4f('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xff4f('0xc')](_0xff4f('0x22'),_0x8f5434[_0xff4f('0x23')])})[_0xff4f('0x19')](function(_0x196ee3){logger[_0xff4f('0xa')](_0xff4f('0x24'));return _0x196ee3;});}});}else{logger[_0xff4f('0xa')](_0xff4f('0x25'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x8f5434['remoteUri'])})['then'](function(_0xf74ab6){logger[_0xff4f('0xa')](_0xff4f('0x24'));return _0xf74ab6;});}}function getEndUser(_0x403db9,_0x59a281,_0x521257){logger['info'](_0xff4f('0x26'),_0x521257);return request({'uri':util[_0xff4f('0xc')]('%s/api/v2/contacts',_0x403db9['remoteUri']),'qs':{'phone':_0x521257}})[_0xff4f('0x19')](function(_0x581240){if(_0x581240['length']){logger[_0xff4f('0xa')](_0xff4f('0x27'));return _['find'](_0x581240,{'phone':_0x521257});}else{logger[_0xff4f('0xa')](_0xff4f('0x28'));return request({'uri':util[_0xff4f('0xc')](_0xff4f('0x29'),_0x403db9[_0xff4f('0x23')]),'method':_0xff4f('0x18'),'body':{'name':_0x59a281,'phone':_0x521257}})[_0xff4f('0x19')](function(_0x34e26b){logger[_0xff4f('0xa')](_0xff4f('0x2a'));return _0x34e26b;});}});}function getAuth(_0x2c2649){return util[_0xff4f('0xc')]('Basic\x20%s',new Buffer(_0x2c2649[_0xff4f('0x2b')]+':X')[_0xff4f('0x2c')]('base64'));}function request(_0x58a14d){logger['debug'](_0xff4f('0x2d'),JSON[_0xff4f('0x2e')](_0x58a14d));return rp(_[_0xff4f('0x6')](_0x58a14d,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5a8029,_0x406313){var _0x207d3d=[];if(_0x5a8029&&_0x5a8029[_0xff4f('0x1d')]>0x0){_0x207d3d=_['map'](_0x5a8029,_0x406313);}return _0x207d3d;}function getCustomFields(_0x241229,_0xf2478a){var _0x162fc4=[];var _0x4f27fd={'custom_fields':[]};if(_0x241229[_0xff4f('0x1d')]>0x0){_['forEach'](_0x241229,function(_0xee5fc){if(_[_0xff4f('0x2f')](['string','picklist'],_0xee5fc[_0xff4f('0x30')])&&_0xee5fc['nameField']&&!_0xee5fc['customField']){_0x4f27fd[_0xee5fc['nameField']['toLowerCase']()]=_0xee5fc[_0xff4f('0x31')][_0xff4f('0x2c')]();}else if(_[_0xff4f('0x2f')]([_0xff4f('0x32'),'picklist'],_0xee5fc[_0xff4f('0x30')])&&_0xee5fc[_0xff4f('0x33')]&&_0xee5fc['customField']){_0x4f27fd['custom_fields'][_0xff4f('0x34')]({'id':_0xee5fc[_0xff4f('0x33')],'value':_0xee5fc[_0xff4f('0x31')][_0xff4f('0x2c')]()});}else if(_0xee5fc['type']===_0xff4f('0x35')&&_0xee5fc[_0xff4f('0x36')]&&_0xee5fc['idField']&&_0xee5fc['customField']){_0xf2478a[_0xee5fc['variableName']]&&_0x4f27fd[_0xff4f('0x15')][_0xff4f('0x34')]({'id':_0xee5fc[_0xff4f('0x33')],'value':_0xf2478a[_0xee5fc[_0xff4f('0x36')]]['toString']()});}else if(_0xee5fc['type']===_0xff4f('0x37')&&_0xee5fc[_0xff4f('0x38')]&&_0xee5fc[_0xff4f('0x38')][_0xff4f('0x39')]&&_0xee5fc[_0xff4f('0x33')]&&_0xee5fc[_0xff4f('0x3a')]){_0xf2478a[_0xee5fc[_0xff4f('0x38')][_0xff4f('0x39')][_0xff4f('0x3b')]()]&&_0x4f27fd[_0xff4f('0x15')][_0xff4f('0x34')]({'id':_0xee5fc[_0xff4f('0x33')],'value':_0xf2478a[_0xee5fc[_0xff4f('0x38')][_0xff4f('0x39')]['toLowerCase']()]['toString']()});}});}return _0x4f27fd;}exports['queue']=function(_0x6aaad7,_0x47144c,_0x1ce71c,_0x2024a1,_0x459a9e,_0x3bafbe){var _0x5d05e6,_0x4b2b2f;_0x3bafbe['remoteUri']=intUtil[_0xff4f('0x3c')](_0x3bafbe[_0xff4f('0x23')]);_0x3bafbe[_0xff4f('0x3d')]=intUtil[_0xff4f('0x3c')](_0x3bafbe[_0xff4f('0x3d')]);if(_0x459a9e&&_0x459a9e['monitor_format']){logger[_0xff4f('0xa')](_0xff4f('0x3e'),_0xff4f('0x3f'));_0x47144c['recordingURL']=util[_0xff4f('0xc')](_0xff4f('0x40'),_0x3bafbe[_0xff4f('0x3d')],_0x47144c[_0xff4f('0x41')],md5(_0x47144c[_0xff4f('0x41')]));}else{_0x47144c['recordingURL']='';}headers[_0xff4f('0x42')]=getAuth(_0x3bafbe);return getUser(_0x3bafbe,_0x2024a1[_0xff4f('0x21')])[_0xff4f('0x19')](function(_0x450b83){_0x5d05e6=_0x450b83;logger[_0xff4f('0xa')](_0xff4f('0x43'),_0x5d05e6['id']);return getEndUser(_0x3bafbe,_0x47144c[_0xff4f('0xe')],_0x47144c[_0xff4f('0xf')]);})[_0xff4f('0x19')](function(_0xb28ace){_0x4b2b2f=_0xb28ace;logger[_0xff4f('0xa')]('The\x20Enduser\x20ID\x20is:',_0x4b2b2f['id']);return getTicket(_0x3bafbe,_0x5d05e6,_0x4b2b2f,_0x1ce71c,_0x47144c);})[_0xff4f('0x19')](function(_0xaf3528){if(_0xaf3528&&_0xaf3528['id']){logger[_0xff4f('0xa')]('Ticket\x20created!');logger[_0xff4f('0xa')](_0xff4f('0x44'),_0xaf3528['id']);logger[_0xff4f('0xa')](_0xff4f('0x3e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xff4f('0xc')](_0xff4f('0x45'),_0x2024a1[_0xff4f('0x39')]),'trigger:browser:url',{'uri':util[_0xff4f('0xc')](_0xff4f('0x46'),_0x3bafbe[_0xff4f('0x23')],_0xaf3528['id'])});}})[_0xff4f('0x47')](function(_0x466c9b){logger[_0xff4f('0x48')](_0xff4f('0x3e'),JSON['stringify'](_0x466c9b));});};exports[_0xff4f('0x49')]=function(_0x3373ac,_0x2d6664,_0x2b2648,_0x4445dd,_0x37cff2,_0x867b0c,_0x559813){var _0x1e196d,_0x76e92c;_0x867b0c['remoteUri']=intUtil[_0xff4f('0x3c')](_0x867b0c[_0xff4f('0x23')]);_0x867b0c[_0xff4f('0x3d')]=intUtil[_0xff4f('0x3c')](_0x867b0c[_0xff4f('0x3d')]);if(_0x559813&&_0x559813[_0xff4f('0x4a')]&&_0x559813[_0xff4f('0x4a')]!==_0xff4f('0x4b')){logger[_0xff4f('0xa')](_0xff4f('0x4c'),_0xff4f('0x3f'));_0x2d6664[_0xff4f('0x4d')]=util['format'](_0xff4f('0x40'),_0x867b0c[_0xff4f('0x3d')],_0x2d6664[_0xff4f('0x41')],md5(_0x2d6664['uniqueid']));}headers[_0xff4f('0x42')]=getAuth(_0x867b0c);return getUser(_0x867b0c,_0x4445dd[_0xff4f('0x21')])[_0xff4f('0x19')](function(_0x41420a){_0x1e196d=_0x41420a;logger['info'](_0xff4f('0x43'),_0x1e196d['id']);return getEndUser(_0x867b0c,_0x2d6664[_0xff4f('0x4e')],_0x2d6664[_0xff4f('0x4f')]);})['then'](function(_0x666212){_0x76e92c=_0x666212;logger[_0xff4f('0xa')](_0xff4f('0x50'),_0x76e92c['id']);return getTicket(_0x867b0c,_0x1e196d,_0x76e92c,_0x2b2648,_0x2d6664);})[_0xff4f('0x19')](function(_0x17e0d5){if(_0x17e0d5&&_0x17e0d5['id']){logger[_0xff4f('0xa')](_0xff4f('0x1a'));logger[_0xff4f('0xa')](_0xff4f('0x44'),_0x17e0d5['id']);logger['info'](_0xff4f('0x4c'),_0xff4f('0x51'));emit(util[_0xff4f('0xc')](_0xff4f('0x45'),_0x4445dd[_0xff4f('0x39')]),_0xff4f('0x52'),{'uri':util[_0xff4f('0xc')](_0xff4f('0x46'),_0x867b0c[_0xff4f('0x23')],_0x17e0d5['id'])});}})[_0xff4f('0x47')](function(_0xfbaedb){logger[_0xff4f('0x48')]('[OUTBOUND]',JSON[_0xff4f('0x2e')](_0xfbaedb));});};exports[_0xff4f('0x53')]=function(_0x185750,_0x4555a4,_0x52b1fe,_0x4a3a13,_0x15de1a,_0x56c27b){var _0x4c6dd9,_0x4c74d6;_0x56c27b[_0xff4f('0x23')]=intUtil[_0xff4f('0x3c')](_0x56c27b[_0xff4f('0x23')]);_0x56c27b[_0xff4f('0x3d')]=intUtil[_0xff4f('0x3c')](_0x56c27b[_0xff4f('0x3d')]);if(_0x15de1a&&_0x15de1a['monitor_format']){logger[_0xff4f('0xa')]('['+_0x4555a4[_0xff4f('0x54')]['toUpperCase']()+']',_0xff4f('0x3f'));_0x4555a4[_0xff4f('0x4d')]=util['format'](_0xff4f('0x40'),_0x56c27b[_0xff4f('0x3d')],_0x4555a4['uniqueid'],md5(_0x4555a4[_0xff4f('0x41')]));}else{_0x4555a4[_0xff4f('0x4d')]='';}headers['Authorization']=getAuth(_0x56c27b);return getUser(_0x56c27b,'')['then'](function(_0x3ae0aa){_0x4c6dd9=_0x3ae0aa;logger[_0xff4f('0xa')]('The\x20User\x20ID\x20is:',_0x4c6dd9['id']);return getEndUser(_0x56c27b,_0x4555a4[_0xff4f('0xe')],_0x4555a4[_0xff4f('0xf')]);})[_0xff4f('0x19')](function(_0x3fe615){_0x4c74d6=_0x3fe615;logger['info'](_0xff4f('0x50'),_0x4c74d6['id']);return getTicket(_0x56c27b,_0x4c6dd9,_0x4c74d6,_0x52b1fe,_0x4555a4);})[_0xff4f('0x19')](function(_0x449f2a){if(_0x449f2a){logger['info'](_0xff4f('0x1a'));logger[_0xff4f('0xa')](_0xff4f('0x44'),_0x449f2a['id']);}})[_0xff4f('0x47')](function(_0x400a8f){logger[_0xff4f('0x48')]('['+_0x4555a4[_0xff4f('0x54')][_0xff4f('0x55')]()+']',JSON[_0xff4f('0x2e')](_0x400a8f));});};
\ No newline at end of file
index 8508a68..f503009 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05e6=['The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','message','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','email','User\x20found:','userId','adminId','catch','toUpperCase','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','ticketId','task','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','outbound','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!'];(function(_0x2860ff,_0x1ded8c){var _0xb35ccd=function(_0x5b6e9f){while(--_0x5b6e9f){_0x2860ff['push'](_0x2860ff['shift']());}};_0xb35ccd(++_0x1ded8c);}(_0x05e6,0x9f));var _0x605e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x05e6[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x605e('0x0'));var util=require(_0x605e('0x1'));var moment=require(_0x605e('0x2'));var Promise=require('bluebird');var Redis=require(_0x605e('0x3'));var intUtil=require('./util');var config=require(_0x605e('0x4'));var logger=require(_0x605e('0x5'))('freshsales');config[_0x605e('0x6')]=_[_0x605e('0x7')](config[_0x605e('0x6')],{'host':_0x605e('0x8'),'port':0x18eb});var io=require(_0x605e('0x9'))(new Redis(config[_0x605e('0x6')]));function getAdminId(_0x47c35b,_0x32c881,_0x256b26,_0x263076){return new Promise(function(_0x593f8b,_0x57cd2e){var _0x47af5c=![];var _0x1feff={'method':_0x605e('0xa'),'uri':_0x263076+_0x605e('0xb'),'json':!![]};_0x1feff[_0x605e('0xc')]=_0x256b26;logger[_0x605e('0xd')](_0x605e('0xe'));return rp(_0x1feff)[_0x605e('0xf')](function(_0x485373){if(_0x485373){var _0x234b30=_0x485373[_0x605e('0x10')];var _0x612ec8=null;for(_0x612ec8=0x0;_0x612ec8<_0x234b30['length'];_0x612ec8++){if(_0x234b30[_0x612ec8]['email']===_0x47c35b[_0x605e('0x11')]){_0x47c35b['adminId']=_0x234b30[_0x612ec8]['id'];_0x47af5c=!![];}}if(_0x47af5c){logger[_0x605e('0xd')](_0x605e('0x12'),_0x47c35b['adminId']);_0x593f8b(_0x47c35b);}else{_0x57cd2e({'statusCode':0x194,'message':_0x605e('0x13')});}}else{_0x57cd2e({'statusCode':0x194,'message':_0x605e('0x13')});}})['catch'](function(_0x5d1d9f){logger[_0x605e('0x14')]('['+[_0x32c881['toUpperCase']()]+']',_0x5d1d9f[_0x605e('0x15')]);_0x57cd2e(_0x5d1d9f);});});}function getUser(_0x1036fb,_0x4816e8,_0x320ac5){return function(_0x2cbe5d){return new Promise(function(_0x4c572e,_0x51de7b){var _0xc21dcf={'method':_0x605e('0xa'),'uri':_0x320ac5+_0x605e('0xb'),'json':!![]};_0xc21dcf[_0x605e('0xc')]=_0x4816e8;logger[_0x605e('0xd')](_0x605e('0x16'));return rp(_0xc21dcf)[_0x605e('0xf')](function(_0x1abf55){if(_0x1abf55){var _0x519a8e=_0x1abf55[_0x605e('0x10')];var _0x57a047=![];var _0x2c708f=null;if(_0x2cbe5d['agentEmail']!==null){logger[_0x605e('0xd')](_0x605e('0x17'),_0x2cbe5d[_0x605e('0x18')]);_0x2cbe5d[_0x605e('0x19')]=_0x2cbe5d[_0x605e('0x18')];for(_0x2c708f=0x0;_0x2c708f<_0x519a8e['length'];_0x2c708f++){if(_0x519a8e[_0x2c708f][_0x605e('0x1a')]===_0x2cbe5d[_0x605e('0x18')]){_0x57a047=!![];_0x2cbe5d['userId']=_0x519a8e[_0x2c708f]['id'];logger[_0x605e('0xd')](_0x605e('0x1b'),_0x2cbe5d[_0x605e('0x1c')]);}}}if(!_0x57a047){logger['info']('Admin\x20selected');_0x2cbe5d[_0x605e('0x19')]=_0x2cbe5d[_0x605e('0x11')];_0x2cbe5d[_0x605e('0x1c')]=_0x2cbe5d[_0x605e('0x1d')];_0x57a047=!![];}if(_0x57a047){_0x4c572e(_0x2cbe5d);}else{_0x51de7b({'statusCode':0x194,'message':_0x605e('0x13')});}}else{_0x51de7b({'statusCode':0x194,'message':_0x605e('0x13')});}})[_0x605e('0x1e')](function(_0xccedde){logger[_0x605e('0x14')]('['+[_0x1036fb[_0x605e('0x1f')]()]+']',_0xccedde[_0x605e('0x15')]);_0x51de7b(_0xccedde);});});};}function searchContact(_0x5cc60e,_0x35b7da,_0x1b76de,_0x17102f){return new Promise(function(_0x281acc,_0x31f14a){var _0x556bf3={'method':'GET','headers':_0x35b7da,'uri':_0x5cc60e+_0x605e('0x20')+_0x17102f+_0x605e('0x21')+_0x1b76de+'&entities=contact','json':!![]};rp(_0x556bf3)[_0x605e('0xf')](function(_0xd09f01){var _0x1523db=_[_0x605e('0x22')](_0xd09f01[_0x605e('0x23')][_0x605e('0x23')],[_0x1b76de,_0x17102f]);_0x281acc(_0x1523db);})[_0x605e('0x1e')](function(_0x1a46fa){_0x31f14a(_0x1a46fa);});});}function getEndUser(_0x36ce04,_0x512538,_0x2b2f2c){return function(_0x297af7){return new Promise(function(_0x475702,_0x148eef){logger[_0x605e('0xd')](util[_0x605e('0x24')](_0x605e('0x25'),_0x297af7[_0x605e('0x26')]));searchContact(_0x2b2f2c,_0x512538,'mobile_number',_0x297af7[_0x605e('0x26')])['then'](function(_0x5e1931){if(_0x5e1931){_0x297af7['endUserId']=_0x5e1931['id'];logger['info'](_0x605e('0x27'),_0x297af7[_0x605e('0x28')]);return _0x475702(_0x297af7);}searchContact(_0x2b2f2c,_0x512538,_0x605e('0x29'),_0x297af7[_0x605e('0x26')])[_0x605e('0xf')](function(_0x4b7a27){if(_0x4b7a27){_0x297af7[_0x605e('0x28')]=_0x4b7a27['id'];logger[_0x605e('0xd')](_0x605e('0x2a'),_0x297af7[_0x605e('0x28')]);return _0x475702(_0x297af7);}createEndUser(_0x297af7,_0x36ce04,_0x512538,_0x2b2f2c)[_0x605e('0xf')](function(_0x25f4bd){logger['info']('Contact\x20created:',_0x25f4bd[_0x605e('0x28')]);return _0x475702(_0x25f4bd);});});})[_0x605e('0x1e')](function(_0x4946fa){_0x148eef(_0x4946fa);});});};}function createEndUser(_0x5c013a,_0x258ada,_0x4b891f,_0x3ab24e){return new Promise(function(_0xe5d48b,_0x63bde9){var _0x4a1a2b=moment();var _0x13121f={'method':_0x605e('0x2b'),'uri':_0x3ab24e+_0x605e('0x2c'),'body':{'contact':{'last_name':_0x5c013a[_0x605e('0x26')],'work_number':_0x5c013a[_0x605e('0x26')],'mobile_number':_0x5c013a['contactNumber'],'owner_id':_0x5c013a['userId'],'created_at':_0x4a1a2b[_0x605e('0x24')](_0x605e('0x2d'))}},'json':!![]};_0x13121f[_0x605e('0xc')]=_0x4b891f;logger[_0x605e('0xd')](_0x605e('0x2e'));return rp(_0x13121f)[_0x605e('0xf')](function(_0x53fc6d){_0x5c013a['endUserId']=_0x53fc6d[_0x605e('0x2f')]['id'];_0xe5d48b(_0x5c013a);})['catch'](function(_0x3ada12){logger[_0x605e('0x14')]('['+[_0x258ada[_0x605e('0x1f')]()]+']',_0x3ada12[_0x605e('0x15')]);_0x63bde9(_0x3ada12[_0x605e('0x15')]);});});}function getTicket(_0x5e1ca9,_0x12baa1,_0x10e055,_0x616de0,_0x48e463){return function(_0x3abb58){logger[_0x605e('0xd')](_0x605e('0x30'));return new Promise(function(_0x396567,_0x2fba0c){var _0x391583=moment();var _0x2fe453={'method':_0x605e('0x2b'),'uri':_0x10e055+_0x605e('0x31'),'body':{'title':intUtil[_0x605e('0x32')](_0x616de0[_0x605e('0x33')],_0x48e463,'\x20'),'description':intUtil[_0x605e('0x32')](_0x616de0[_0x605e('0x34')],_0x48e463,'\x0a'),'owner_id':_0x3abb58[_0x605e('0x1c')],'creater_id':_0x3abb58[_0x605e('0x1d')],'targetable_id':_0x3abb58['endUserId'],'targetable_type':'Contact','created_at':_0x391583[_0x605e('0x24')](_0x605e('0x2d')),'due_date':_0x391583[_0x605e('0x35')](0x1e,'m')[_0x605e('0x24')](_0x605e('0x2d'))},'json':!![]};_0x2fe453[_0x605e('0xc')]=_0x12baa1;return rp(_0x2fe453)[_0x605e('0xf')](function(_0x20b7b1){_0x3abb58[_0x605e('0x36')]=_0x20b7b1[_0x605e('0x37')]['id'];logger[_0x605e('0xd')]('Task\x20created:',_0x3abb58[_0x605e('0x36')]);_0x396567(_0x3abb58);})[_0x605e('0x1e')](function(_0x5cf39d){logger['error']('['+[_0x5e1ca9['toUpperCase']()]+']',_0x5cf39d['message']);_0x2fba0c(_0x5cf39d[_0x605e('0x15')]);});});};}function emit(_0x46bc99,_0x54c93b,_0x33ebd6){var _0x1fd5ea={'uri':_0x46bc99+_0x605e('0x38')+_0x33ebd6};io['to'](util[_0x605e('0x24')](_0x605e('0x39'),_0x54c93b))[_0x605e('0x3a')]('trigger:browser:url',_0x1fd5ea);}exports['cs']=function(_0x576ea6,_0x24d2fa,_0x4f7f5a,_0xd93965,_0xa0d6ec,_0x3b9337,_0x4410fb,_0x80f422){var _0x5583f9={};var _0x4a5d74={'Authorization':_0x605e('0x3b')+_0x3b9337[_0x605e('0x3c')]};_0x3b9337[_0x605e('0x3d')]=intUtil[_0x605e('0x3e')](_0x3b9337[_0x605e('0x3d')]);_0x3b9337[_0x605e('0x3f')]=intUtil[_0x605e('0x3e')](_0x3b9337['serverUrl']);var _0x2c6266=_0x3b9337[_0x605e('0x3d')];_0x5583f9[_0x605e('0x11')]=_0x3b9337['username'];_0x5583f9[_0x605e('0x26')]=_0x80f422['toLowerCase']()===_0x605e('0x40')?_0x24d2fa[_0x605e('0x41')]:_0x24d2fa['calleridnum'];_0x5583f9['callDirection']=_0x80f422===_0x605e('0x42')||_0x80f422===_0x605e('0x43')?'queue':_0x605e('0x40');if(_0xd93965){_0x5583f9[_0x605e('0x18')]=_0xd93965[_0x605e('0x1a')];}var _0x3702f4=util['format'](_0x605e('0x44'),_0x3b9337['serverUrl'],_0x24d2fa['uniqueid'],md5(_0x24d2fa['uniqueid']));if(_0xa0d6ec&&_0xa0d6ec['monitor_format']){logger['info'](_0x605e('0x45'),'Recording\x20is\x20enabled!');_0x24d2fa[_0x605e('0x46')]=_0x3702f4;}else if(_0x4410fb&&_0x4410fb[_0x605e('0x47')]&&_0x4410fb[_0x605e('0x47')]!==_0x605e('0x48')){logger[_0x605e('0xd')](_0x605e('0x49'),_0x605e('0x4a'));_0x24d2fa[_0x605e('0x46')]=_0x3702f4;}else{_0x24d2fa[_0x605e('0x46')]='';}return getAdminId(_0x5583f9,_0x80f422,_0x4a5d74,_0x2c6266)[_0x605e('0xf')](getUser(_0x80f422,_0x4a5d74,_0x2c6266))[_0x605e('0xf')](getEndUser(_0x80f422,_0x4a5d74,_0x2c6266))[_0x605e('0xf')](getTicket(_0x80f422,_0x4a5d74,_0x2c6266,_0x4f7f5a,_0x24d2fa))[_0x605e('0xf')](function(_0x31fa63){logger[_0x605e('0xd')](util[_0x605e('0x24')](_0x605e('0x4b'),_0x31fa63[_0x605e('0x36')]));if(_0x80f422!=='unmanaged'){logger[_0x605e('0xd')]('['+[_0x80f422[_0x605e('0x1f')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x2c6266,_0xd93965['name'],_0x31fa63[_0x605e('0x28')]);}})[_0x605e('0x1e')](function(_0x2df292){logger[_0x605e('0x14')]('['+[_0x80f422[_0x605e('0x1f')]()]+_0x605e('0x4c'),util[_0x605e('0x4d')](_0x2df292,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xd5f3=['&f=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','work_number','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','%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','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','util','moment','bluebird','ioredis','freshsales','redis','defaults','socket.io-emitter','/api/selector/owners','info','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','Admin\x20selected','GET','/api/lookup?q='];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd5f3,0x86));var _0x3d5f=function(_0x5691e0,_0x2536dd){_0x5691e0=_0x5691e0-0x0;var _0x21ac8c=_0xd5f3[_0x5691e0];return _0x21ac8c;};'use strict';var _=require('lodash');var rp=require(_0x3d5f('0x0'));var md5=require(_0x3d5f('0x1'));var util=require(_0x3d5f('0x2'));var moment=require(_0x3d5f('0x3'));var Promise=require(_0x3d5f('0x4'));var Redis=require(_0x3d5f('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x3d5f('0x6'));config[_0x3d5f('0x7')]=_[_0x3d5f('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3d5f('0x9'))(new Redis(config[_0x3d5f('0x7')]));function getAdminId(_0x2a7ef1,_0x222d78,_0x147fe2,_0x3571bd){return new Promise(function(_0x1e3113,_0x3151b1){var _0x3ee739=![];var _0x44fec3={'method':'GET','uri':_0x3571bd+_0x3d5f('0xa'),'json':!![]};_0x44fec3['headers']=_0x147fe2;logger[_0x3d5f('0xb')]('Getting\x20admin\x20information');return rp(_0x44fec3)[_0x3d5f('0xc')](function(_0x317e91){if(_0x317e91){var _0x262143=_0x317e91[_0x3d5f('0xd')];var _0x2fbbcf=null;for(_0x2fbbcf=0x0;_0x2fbbcf<_0x262143[_0x3d5f('0xe')];_0x2fbbcf++){if(_0x262143[_0x2fbbcf][_0x3d5f('0xf')]===_0x2a7ef1[_0x3d5f('0x10')]){_0x2a7ef1[_0x3d5f('0x11')]=_0x262143[_0x2fbbcf]['id'];_0x3ee739=!![];}}if(_0x3ee739){logger[_0x3d5f('0xb')](_0x3d5f('0x12'),_0x2a7ef1[_0x3d5f('0x11')]);_0x1e3113(_0x2a7ef1);}else{_0x3151b1({'statusCode':0x194,'message':_0x3d5f('0x13')});}}else{_0x3151b1({'statusCode':0x194,'message':_0x3d5f('0x13')});}})[_0x3d5f('0x14')](function(_0x142562){logger[_0x3d5f('0x15')]('['+[_0x222d78[_0x3d5f('0x16')]()]+']',_0x142562[_0x3d5f('0x17')]);_0x3151b1(_0x142562);});});}function getUser(_0x44e302,_0x3bcede,_0x4a927f){return function(_0x16333a){return new Promise(function(_0x158536,_0x57201c){var _0x8880fd={'method':'GET','uri':_0x4a927f+'/api/selector/owners','json':!![]};_0x8880fd[_0x3d5f('0x18')]=_0x3bcede;logger[_0x3d5f('0xb')](_0x3d5f('0x19'));return rp(_0x8880fd)[_0x3d5f('0xc')](function(_0x193426){if(_0x193426){var _0x3009f9=_0x193426['users'];var _0x2d484b=![];var _0x50d94b=null;if(_0x16333a[_0x3d5f('0x1a')]!==null){logger[_0x3d5f('0xb')](_0x3d5f('0x1b'),_0x16333a[_0x3d5f('0x1a')]);_0x16333a[_0x3d5f('0x1c')]=_0x16333a[_0x3d5f('0x1a')];for(_0x50d94b=0x0;_0x50d94b<_0x3009f9[_0x3d5f('0xe')];_0x50d94b++){if(_0x3009f9[_0x50d94b][_0x3d5f('0xf')]===_0x16333a[_0x3d5f('0x1a')]){_0x2d484b=!![];_0x16333a['userId']=_0x3009f9[_0x50d94b]['id'];logger[_0x3d5f('0xb')](_0x3d5f('0x1d'),_0x16333a[_0x3d5f('0x1e')]);}}}if(!_0x2d484b){logger[_0x3d5f('0xb')](_0x3d5f('0x1f'));_0x16333a[_0x3d5f('0x1c')]=_0x16333a[_0x3d5f('0x10')];_0x16333a[_0x3d5f('0x1e')]=_0x16333a[_0x3d5f('0x11')];_0x2d484b=!![];}if(_0x2d484b){_0x158536(_0x16333a);}else{_0x57201c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x57201c({'statusCode':0x194,'message':_0x3d5f('0x13')});}})[_0x3d5f('0x14')](function(_0x5c4562){logger['error']('['+[_0x44e302[_0x3d5f('0x16')]()]+']',_0x5c4562[_0x3d5f('0x17')]);_0x57201c(_0x5c4562);});});};}function searchContact(_0x39942b,_0x569444,_0x4f7063,_0x2398ac){return new Promise(function(_0x2aa46d,_0x9b3231){var _0x58330d={'method':_0x3d5f('0x20'),'headers':_0x569444,'uri':_0x39942b+_0x3d5f('0x21')+_0x2398ac+_0x3d5f('0x22')+_0x4f7063+'&entities=contact','json':!![]};rp(_0x58330d)[_0x3d5f('0xc')](function(_0x4db52d){var _0x3ace2a=_['find'](_0x4db52d[_0x3d5f('0x23')][_0x3d5f('0x23')],[_0x4f7063,_0x2398ac]);_0x2aa46d(_0x3ace2a);})['catch'](function(_0x2da2c0){_0x9b3231(_0x2da2c0);});});}function getEndUser(_0x59c501,_0x5d621c,_0x5ed321){return function(_0x14fe71){return new Promise(function(_0x465a5b,_0x3fcdf1){logger[_0x3d5f('0xb')](util[_0x3d5f('0x24')](_0x3d5f('0x25'),_0x14fe71[_0x3d5f('0x26')]));searchContact(_0x5ed321,_0x5d621c,'mobile_number',_0x14fe71[_0x3d5f('0x26')])['then'](function(_0x3e9286){if(_0x3e9286){_0x14fe71[_0x3d5f('0x27')]=_0x3e9286['id'];logger[_0x3d5f('0xb')]('Contact\x20found\x20mobile_number:',_0x14fe71[_0x3d5f('0x27')]);return _0x465a5b(_0x14fe71);}searchContact(_0x5ed321,_0x5d621c,_0x3d5f('0x28'),_0x14fe71[_0x3d5f('0x26')])[_0x3d5f('0xc')](function(_0x5e998e){if(_0x5e998e){_0x14fe71[_0x3d5f('0x27')]=_0x5e998e['id'];logger[_0x3d5f('0xb')]('Contact\x20found\x20work_number:',_0x14fe71[_0x3d5f('0x27')]);return _0x465a5b(_0x14fe71);}createEndUser(_0x14fe71,_0x59c501,_0x5d621c,_0x5ed321)['then'](function(_0x24e0d0){logger[_0x3d5f('0xb')]('Contact\x20created:',_0x24e0d0[_0x3d5f('0x27')]);return _0x465a5b(_0x24e0d0);});});})['catch'](function(_0x567bd6){_0x3fcdf1(_0x567bd6);});});};}function createEndUser(_0x320290,_0x2dad97,_0x6a0f6b,_0x3e0b1b){return new Promise(function(_0x1c1428,_0x19a297){var _0x5ab23a=moment();var _0x441375={'method':_0x3d5f('0x29'),'uri':_0x3e0b1b+_0x3d5f('0x2a'),'body':{'contact':{'last_name':_0x320290['contactNumber'],'work_number':_0x320290['contactNumber'],'mobile_number':_0x320290['contactNumber'],'owner_id':_0x320290[_0x3d5f('0x1e')],'created_at':_0x5ab23a[_0x3d5f('0x24')](_0x3d5f('0x2b'))}},'json':!![]};_0x441375[_0x3d5f('0x18')]=_0x6a0f6b;logger['info'](_0x3d5f('0x2c'));return rp(_0x441375)[_0x3d5f('0xc')](function(_0x4202c0){_0x320290[_0x3d5f('0x27')]=_0x4202c0[_0x3d5f('0x2d')]['id'];_0x1c1428(_0x320290);})['catch'](function(_0x5a5012){logger['error']('['+[_0x2dad97[_0x3d5f('0x16')]()]+']',_0x5a5012['message']);_0x19a297(_0x5a5012[_0x3d5f('0x17')]);});});}function getTicket(_0x8a373c,_0xd4a412,_0x20ede7,_0x129355,_0x482eea){return function(_0x105870){logger[_0x3d5f('0xb')](_0x3d5f('0x2e'));return new Promise(function(_0x54bc7e,_0x5676cc){var _0x5b7b95=moment();var _0x287cdf={'method':_0x3d5f('0x29'),'uri':_0x20ede7+'/api/tasks','body':{'title':intUtil[_0x3d5f('0x2f')](_0x129355['Subjects'],_0x482eea,'\x20'),'description':intUtil[_0x3d5f('0x2f')](_0x129355[_0x3d5f('0x30')],_0x482eea,'\x0a'),'owner_id':_0x105870['userId'],'creater_id':_0x105870[_0x3d5f('0x11')],'targetable_id':_0x105870[_0x3d5f('0x27')],'targetable_type':_0x3d5f('0x31'),'created_at':_0x5b7b95[_0x3d5f('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x5b7b95[_0x3d5f('0x32')](0x1e,'m')[_0x3d5f('0x24')](_0x3d5f('0x2b'))},'json':!![]};_0x287cdf[_0x3d5f('0x18')]=_0xd4a412;return rp(_0x287cdf)['then'](function(_0x4ada66){_0x105870[_0x3d5f('0x33')]=_0x4ada66[_0x3d5f('0x34')]['id'];logger[_0x3d5f('0xb')](_0x3d5f('0x35'),_0x105870[_0x3d5f('0x33')]);_0x54bc7e(_0x105870);})['catch'](function(_0x2d237e){logger[_0x3d5f('0x15')]('['+[_0x8a373c['toUpperCase']()]+']',_0x2d237e[_0x3d5f('0x17')]);_0x5676cc(_0x2d237e[_0x3d5f('0x17')]);});});};}function emit(_0x3b5842,_0x38a042,_0x50b5e3){var _0x2b0502={'uri':_0x3b5842+_0x3d5f('0x36')+_0x50b5e3};io['to'](util[_0x3d5f('0x24')](_0x3d5f('0x37'),_0x38a042))[_0x3d5f('0x38')](_0x3d5f('0x39'),_0x2b0502);}exports['cs']=function(_0x49327c,_0x55ddd7,_0x540109,_0x244c79,_0x249d37,_0x55ebb7,_0x477322,_0x2cd516){var _0x52ea40={};var _0x5081e0={'Authorization':_0x3d5f('0x3a')+_0x55ebb7[_0x3d5f('0x3b')]};_0x55ebb7[_0x3d5f('0x3c')]=intUtil[_0x3d5f('0x3d')](_0x55ebb7[_0x3d5f('0x3c')]);_0x55ebb7[_0x3d5f('0x3e')]=intUtil[_0x3d5f('0x3d')](_0x55ebb7[_0x3d5f('0x3e')]);var _0xf0e25c=_0x55ebb7['remoteUri'];_0x52ea40[_0x3d5f('0x10')]=_0x55ebb7[_0x3d5f('0x3f')];_0x52ea40['contactNumber']=_0x2cd516[_0x3d5f('0x40')]()===_0x3d5f('0x41')?_0x55ddd7[_0x3d5f('0x42')]:_0x55ddd7[_0x3d5f('0x43')];_0x52ea40[_0x3d5f('0x44')]=_0x2cd516===_0x3d5f('0x45')||_0x2cd516==='unmanaged'?_0x3d5f('0x45'):_0x3d5f('0x41');if(_0x244c79){_0x52ea40[_0x3d5f('0x1a')]=_0x244c79[_0x3d5f('0xf')];}var _0x49ed55=util['format'](_0x3d5f('0x46'),_0x55ebb7[_0x3d5f('0x3e')],_0x55ddd7['uniqueid'],md5(_0x55ddd7[_0x3d5f('0x47')]));if(_0x249d37&&_0x249d37[_0x3d5f('0x48')]){logger['info'](_0x3d5f('0x49'),_0x3d5f('0x4a'));_0x55ddd7[_0x3d5f('0x4b')]=_0x49ed55;}else if(_0x477322&&_0x477322[_0x3d5f('0x4c')]&&_0x477322[_0x3d5f('0x4c')]!==_0x3d5f('0x4d')){logger['info'](_0x3d5f('0x4e'),_0x3d5f('0x4a'));_0x55ddd7[_0x3d5f('0x4b')]=_0x49ed55;}else{_0x55ddd7['recordingURL']='';}return getAdminId(_0x52ea40,_0x2cd516,_0x5081e0,_0xf0e25c)['then'](getUser(_0x2cd516,_0x5081e0,_0xf0e25c))[_0x3d5f('0xc')](getEndUser(_0x2cd516,_0x5081e0,_0xf0e25c))['then'](getTicket(_0x2cd516,_0x5081e0,_0xf0e25c,_0x540109,_0x55ddd7))[_0x3d5f('0xc')](function(_0x5b71bf){logger[_0x3d5f('0xb')](util['format'](_0x3d5f('0x4f'),_0x5b71bf[_0x3d5f('0x33')]));if(_0x2cd516!==_0x3d5f('0x50')){logger[_0x3d5f('0xb')]('['+[_0x2cd516['toUpperCase']()]+']',_0x3d5f('0x51'));emit(_0xf0e25c,_0x244c79[_0x3d5f('0x52')],_0x5b71bf[_0x3d5f('0x27')]);}})['catch'](function(_0x37a172){logger[_0x3d5f('0x15')]('['+[_0x2cd516['toUpperCase']()]+_0x3d5f('0x53'),util['inspect'](_0x37a172,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 805df1b..8c2a85b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3afd=['format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./zoho','./desk','./dynamics365','zendesk','freshdesk','zoho','desk','vtiger','servicenow','exec','includes','toLowerCase','data1','data2','find','Configurations','queue','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','freshsales','dynamics365','unknown\x20integration','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found'];(function(_0x378e73,_0x5e229c){var _0x5de6db=function(_0xd5f932){while(--_0xd5f932){_0x378e73['push'](_0x378e73['shift']());}};_0x5de6db(++_0x5e229c);}(_0x3afd,0x18e));var _0xd3af=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x3afd[_0x3aeb36];return _0xa2ef21;};'use strict';var _=require(_0xd3af('0x0'));var util=require(_0xd3af('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xd3af('0x2'));var sugarcrm=require(_0xd3af('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0xd3af('0x4'));var desk=require(_0xd3af('0x5'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0xd3af('0x6'));var freshsales=require('./freshsales');var integrations=[_0xd3af('0x7'),'salesforce','sugarcrm',_0xd3af('0x8'),_0xd3af('0x9'),_0xd3af('0xa'),_0xd3af('0xb'),'dynamics365','freshsales',_0xd3af('0xc')];exports[_0xd3af('0xd')]=function(_0x84c30,_0x34c7ab,_0xc4b79b,_0x4d1f8c,_0x214c7f,_0x3a3446){if(_0xc4b79b){if(_[_0xd3af('0xe')](integrations,_0x84c30['data1'][_0xd3af('0xf')]())){try{var _0x1f4f86=null;var _0xbffd05='';var _0x437c93=_0xc4b79b[_0x84c30[_0xd3af('0x10')][_0xd3af('0xf')]()];if(_0x437c93){var _0x3fc3fd=_0x437c93[_0x84c30[_0xd3af('0x11')]];if(_0x3fc3fd){var _0xadd3a5=_[_0xd3af('0x12')](_0x3fc3fd[_0xd3af('0x13')],{'id':parseInt(_0x84c30['data3'],0xa)});if(_0xadd3a5){if(_0x4d1f8c){if(_0x214c7f&&_0x34c7ab['queue']){_0xbffd05=_0xd3af('0x14');}else if(_0x34c7ab['routeId']){_0xbffd05='outbound';}else{console[_0xd3af('0x15')](_0xd3af('0x16'),_0x34c7ab);}}else{_0xbffd05=_0xd3af('0x17');}switch(_0x84c30['data1'][_0xd3af('0xf')]()){case _0xd3af('0x7'):zendesk[_0xbffd05](_0x84c30,_0x34c7ab,_0xadd3a5,_0x4d1f8c,_0x214c7f,_0x3fc3fd,_0x3a3446);break;case'salesforce':salesforce[_0xbffd05](_0x84c30,_0x34c7ab,_0xadd3a5,_0x4d1f8c,_0x214c7f,_0x3fc3fd,_0x3a3446);break;case _0xd3af('0x18'):sugarcrm[_0xbffd05](_0x84c30,_0x34c7ab,_0xadd3a5,_0x4d1f8c,_0x214c7f,_0x3fc3fd,_0x3a3446);break;case'freshdesk':freshdesk[_0xbffd05](_0x84c30,_0x34c7ab,_0xadd3a5,_0x4d1f8c,_0x214c7f,_0x3fc3fd,_0x3a3446);break;case _0xd3af('0x9'):zoho[_0xbffd05](_0x84c30,_0x34c7ab,_0xadd3a5,_0x4d1f8c,_0x214c7f,_0x3fc3fd,_0x3a3446);break;case _0xd3af('0xa'):desk[_0xbffd05](_0x84c30,_0x34c7ab,_0xadd3a5,_0x4d1f8c,_0x214c7f,_0x3fc3fd,_0x3a3446);break;case _0xd3af('0xb'):vtiger[_0xbffd05](_0x84c30,_0x34c7ab,_0xadd3a5,_0x4d1f8c,_0x214c7f,_0x3fc3fd,_0x3a3446);break;case _0xd3af('0x19'):freshsales['cs'](_0x84c30,_0x34c7ab,_0xadd3a5,_0x4d1f8c,_0x214c7f,_0x3fc3fd,_0x3a3446,_0xbffd05);break;case _0xd3af('0xc'):servicenow['cs'](_0x84c30,_0x34c7ab,_0xadd3a5,_0x4d1f8c,_0x214c7f,_0x3fc3fd,_0x3a3446,_0xbffd05);break;case _0xd3af('0x1a'):dynamics365['cs'](_0x84c30,_0x34c7ab,_0xadd3a5,_0x4d1f8c,_0x214c7f,_0x3fc3fd,_0x3a3446,_0xbffd05);break;default:console['log'](_0xd3af('0x1b'));}}else{_0x1f4f86=require('../../../../config/logger')(_0x84c30[_0xd3af('0x10')][_0xd3af('0xf')]());_0x1f4f86[_0xd3af('0x1c')](_0xd3af('0x1d'),util['format'](_0xd3af('0x1e'),_0x84c30[_0xd3af('0x10')][_0xd3af('0xf')](),_0x84c30['data3']));}}else{_0x1f4f86=require('../../../../config/logger')(_0x84c30[_0xd3af('0x10')][_0xd3af('0xf')]());_0x1f4f86[_0xd3af('0x1c')](_0xd3af('0x1d'),util[_0xd3af('0x1f')](_0xd3af('0x20'),_0x84c30[_0xd3af('0x10')][_0xd3af('0xf')](),_0x84c30[_0xd3af('0x11')]));}}else{}}catch(_0x1daa51){console['error'](_0x1daa51);}}}};
\ No newline at end of file
+var _0xcaaf=['lodash','./zendesk','./freshdesk','./zoho','./vtiger','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','servicenow','includes','data1','toLowerCase','data2','find','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','vtiger','freshsales','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','error'];(function(_0x4e7c1c,_0x56eafd){var _0x47adb2=function(_0x346135){while(--_0x346135){_0x4e7c1c['push'](_0x4e7c1c['shift']());}};_0x47adb2(++_0x56eafd);}(_0xcaaf,0x66));var _0xfcaa=function(_0xd1dc93,_0x5ed915){_0xd1dc93=_0xd1dc93-0x0;var _0x19a77a=_0xcaaf[_0xd1dc93];return _0x19a77a;};'use strict';var _=require(_0xfcaa('0x0'));var util=require('util');var zendesk=require(_0xfcaa('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xfcaa('0x2'));var zoho=require(_0xfcaa('0x3'));var desk=require('./desk');var vtiger=require(_0xfcaa('0x4'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0xfcaa('0x5'));var integrations=[_0xfcaa('0x6'),_0xfcaa('0x7'),_0xfcaa('0x8'),_0xfcaa('0x9'),_0xfcaa('0xa'),_0xfcaa('0xb'),'vtiger',_0xfcaa('0xc'),'freshsales',_0xfcaa('0xd')];exports['exec']=function(_0x101ac0,_0x593c04,_0x586902,_0x345e39,_0x4bf6dd,_0x286174){if(_0x586902){if(_[_0xfcaa('0xe')](integrations,_0x101ac0[_0xfcaa('0xf')][_0xfcaa('0x10')]())){try{var _0x278a68=null;var _0x33664f='';var _0x1f26e3=_0x586902[_0x101ac0[_0xfcaa('0xf')]['toLowerCase']()];if(_0x1f26e3){var _0x5831ba=_0x1f26e3[_0x101ac0[_0xfcaa('0x11')]];if(_0x5831ba){var _0x129b69=_[_0xfcaa('0x12')](_0x5831ba['Configurations'],{'id':parseInt(_0x101ac0[_0xfcaa('0x13')],0xa)});if(_0x129b69){if(_0x345e39){if(_0x4bf6dd&&_0x593c04[_0xfcaa('0x14')]){_0x33664f=_0xfcaa('0x14');}else if(_0x593c04[_0xfcaa('0x15')]){_0x33664f='outbound';}else{console[_0xfcaa('0x16')](_0xfcaa('0x17'),_0x593c04);}}else{_0x33664f=_0xfcaa('0x18');}switch(_0x101ac0['data1'][_0xfcaa('0x10')]()){case _0xfcaa('0x6'):zendesk[_0x33664f](_0x101ac0,_0x593c04,_0x129b69,_0x345e39,_0x4bf6dd,_0x5831ba,_0x286174);break;case'salesforce':salesforce[_0x33664f](_0x101ac0,_0x593c04,_0x129b69,_0x345e39,_0x4bf6dd,_0x5831ba,_0x286174);break;case _0xfcaa('0x8'):sugarcrm[_0x33664f](_0x101ac0,_0x593c04,_0x129b69,_0x345e39,_0x4bf6dd,_0x5831ba,_0x286174);break;case'freshdesk':freshdesk[_0x33664f](_0x101ac0,_0x593c04,_0x129b69,_0x345e39,_0x4bf6dd,_0x5831ba,_0x286174);break;case'zoho':zoho[_0x33664f](_0x101ac0,_0x593c04,_0x129b69,_0x345e39,_0x4bf6dd,_0x5831ba,_0x286174);break;case _0xfcaa('0xb'):desk[_0x33664f](_0x101ac0,_0x593c04,_0x129b69,_0x345e39,_0x4bf6dd,_0x5831ba,_0x286174);break;case _0xfcaa('0x19'):vtiger[_0x33664f](_0x101ac0,_0x593c04,_0x129b69,_0x345e39,_0x4bf6dd,_0x5831ba,_0x286174);break;case _0xfcaa('0x1a'):freshsales['cs'](_0x101ac0,_0x593c04,_0x129b69,_0x345e39,_0x4bf6dd,_0x5831ba,_0x286174,_0x33664f);break;case _0xfcaa('0xd'):servicenow['cs'](_0x101ac0,_0x593c04,_0x129b69,_0x345e39,_0x4bf6dd,_0x5831ba,_0x286174,_0x33664f);break;case _0xfcaa('0xc'):dynamics365['cs'](_0x101ac0,_0x593c04,_0x129b69,_0x345e39,_0x4bf6dd,_0x5831ba,_0x286174,_0x33664f);break;default:console[_0xfcaa('0x16')](_0xfcaa('0x1b'));}}else{_0x278a68=require(_0xfcaa('0x1c'))(_0x101ac0[_0xfcaa('0xf')][_0xfcaa('0x10')]());_0x278a68['error'](_0xfcaa('0x1d'),util[_0xfcaa('0x1e')](_0xfcaa('0x1f'),_0x101ac0[_0xfcaa('0xf')][_0xfcaa('0x10')](),_0x101ac0[_0xfcaa('0x13')]));}}else{_0x278a68=require(_0xfcaa('0x1c'))(_0x101ac0[_0xfcaa('0xf')][_0xfcaa('0x10')]());_0x278a68['error'](_0xfcaa('0x1d'),util[_0xfcaa('0x1e')](_0xfcaa('0x20'),_0x101ac0['data1'][_0xfcaa('0x10')](),_0x101ac0['data2']));}}else{}}catch(_0x4642bb){console[_0xfcaa('0x21')](_0x4642bb);}}}};
\ No newline at end of file
index aaa099e..ecb53e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d46=[']\x20Integration\x20account\x20type\x20%s.','moment','bluebird','util','ioredis','./util','../../../../config/environment','salesforce','defaults','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','Task','utc','IsRecurrence','contact','endUserType','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','then','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','execute','additionalSearchLead','additionalSearchAccount','Account','Contact','Lead','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','<unknown>','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','No\x20Company','upperFirst','create','forEach','picklist','idField','content','toString','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','trigger:browser:url','error','calleridnum','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x8d46,0x1e5));var _0x68d4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8d46[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x68d4('0x0'));var BPromise=require(_0x68d4('0x1'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0x68d4('0x2'));var Redis=require(_0x68d4('0x3'));var intUtil=require(_0x68d4('0x4'));var config=require(_0x68d4('0x5'));var logger=require('../../../../config/logger')(_0x68d4('0x6'));config['redis']=_[_0x68d4('0x7')](config[_0x68d4('0x8')],{'host':_0x68d4('0x9'),'port':0x18eb});var io=require(_0x68d4('0xa'))(new Redis(config[_0x68d4('0x8')]));function emit(_0x2564e9,_0x257456,_0x36907f){io['to'](_0x2564e9)[_0x68d4('0xb')](_0x257456,_0x36907f);}function getTicket(_0x4b2634,_0x55973e,_0x23f917,_0xed4517,_0x55979a,_0x49a888,_0x106d93,_0x91eb4c){var _0x122c84=Object[_0x68d4('0xc')]({},{'OwnerId':_0x55973e['id'],'Subject':intUtil[_0x68d4('0xd')](_0xed4517['Subjects'],_0x55979a,'\x20'),'Description':intUtil[_0x68d4('0xd')](_0xed4517[_0x68d4('0xe')],_0x55979a,'\x0a')},getCustomFields(_0x49a888,_0x55979a));if(_0x23f917){if(_0xed4517[_0x68d4('0xf')]===_0x68d4('0x10')){_0x122c84['ActivityDate']=moment[_0x68d4('0x11')]();_0x122c84['IsReminderSet']=![];_0x122c84[_0x68d4('0x12')]=![];if(_0x23f917['endUserType']===_0x68d4('0x13')||_0x23f917[_0x68d4('0x14')]===_0x68d4('0x15')){_0x122c84[_0x68d4('0x16')]=_0x23f917['id'];}else if(_0x23f917[_0x68d4('0x14')]===_0x68d4('0x17')){_0x122c84[_0x68d4('0x18')]=_0x23f917['id'];}}else if(_0xed4517[_0x68d4('0xf')]===_0x68d4('0x19')){if(_0x23f917[_0x68d4('0x14')]==='contact'){_0x122c84[_0x68d4('0x1a')]=_0x23f917['id'];}else if(_0x23f917['endUserType']===_0x68d4('0x17')){_0x122c84[_0x68d4('0x1b')]=_0x23f917['id'];}else if(_0x23f917[_0x68d4('0x14')]===_0x68d4('0x15')&&_0xed4517[_0x68d4('0x1c')]){_0x122c84[_0xed4517[_0x68d4('0x1c')]]=_0x23f917['id'];}else{logger[_0x68d4('0x1d')](_0x68d4('0x1e'));}}}return _0x106d93[_0x68d4('0x1f')](_0xed4517[_0x68d4('0xf')])['create'](_0x122c84);}function getUser(_0x5d88e7,_0x6d247a,_0x224904){if(!_[_0x68d4('0x20')](_0x6d247a)&&intUtil[_0x68d4('0x21')](_0x6d247a)){var _0x4aa921={'Email':_0x6d247a};var _0x387087={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x224904[_0x68d4('0x1f')](_0x68d4('0x22'))[_0x68d4('0x23')](_0x4aa921,_0x387087)['execute']()[_0x68d4('0x24')](function(_0x4a554e){if(_0x4a554e[_0x68d4('0x25')]){var _0x39cd69=_['find'](_0x4a554e,function(_0x57b683){return _0x57b683[_0x68d4('0x26')]===_0x6d247a;});if(_0x39cd69){logger[_0x68d4('0x1d')]('Agent\x20%s\x20found.',_0x6d247a);return BPromise[_0x68d4('0x27')]({'id':_0x39cd69['Id'],'name':_0x39cd69[_0x68d4('0x28')]});}}else{logger[_0x68d4('0x1d')](_0x68d4('0x29'),_0x6d247a);return _0x224904[_0x68d4('0x2a')]()[_0x68d4('0x24')](function(_0x375aa8){return BPromise['resolve']({'id':_0x375aa8[_0x68d4('0x2b')],'name':_0x375aa8['display_name']});});}});}else{logger[_0x68d4('0x1d')](_0x68d4('0x29'),_0x6d247a);return _0x224904[_0x68d4('0x2a')]()['then'](function(_0x4ae789){return BPromise[_0x68d4('0x27')]({'id':_0x4ae789['user_id'],'name':_0x4ae789['display_name']});});}}function getEndUser(_0x68d733,_0x41b333,_0xcc31f7,_0x4bb615,_0x100109){var _0x5e68c1={'$or':{'Phone':_0x4bb615}};var _0x17aa84={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x68d4('0x27')]()[_0x68d4('0x24')](function(){logger[_0x68d4('0x1d')](_0x68d4('0x2c'),_0x4bb615,_0x41b333[_0x68d4('0x2d')]);switch(_0x41b333[_0x68d4('0x2d')]){case _0x68d4('0x2e'):var _0x3bff2d=_[_0x68d4('0x2f')](_0x5e68c1);if(_0x41b333[_0x68d4('0x30')]){var _0x24cfa3={};_0x24cfa3[_0x41b333['additionalSearchContact']]=_0x4bb615;_[_0x68d4('0x31')](_0x3bff2d[_0x68d4('0x32')],_0x24cfa3);}return _0x100109[_0x68d4('0x1f')]('Contact')[_0x68d4('0x23')](_0x3bff2d,_0x17aa84)[_0x68d4('0x33')]()[_0x68d4('0x24')](function(_0x435b77){if(_0x435b77&&_0x435b77[_0x68d4('0x25')]){return _0x435b77;}else{var _0x124d57=_[_0x68d4('0x2f')](_0x5e68c1);if(_0x41b333[_0x68d4('0x34')]){var _0x5681b8={};_0x5681b8[_0x41b333['additionalSearchLead']]=_0x4bb615;_[_0x68d4('0x31')](_0x124d57[_0x68d4('0x32')],_0x5681b8);}return _0x100109[_0x68d4('0x1f')]('Lead')[_0x68d4('0x23')](_0x124d57,_0x17aa84);}});case'account_contact_lead':var _0x562d2e=_['cloneDeep'](_0x5e68c1);if(_0x41b333[_0x68d4('0x35')]){var _0x24cfa3={};_0x24cfa3[_0x41b333[_0x68d4('0x35')]]=_0x4bb615;_['merge'](_0x562d2e[_0x68d4('0x32')],_0x24cfa3);}return _0x100109[_0x68d4('0x1f')](_0x68d4('0x36'))[_0x68d4('0x23')](_0x562d2e,_0x17aa84)[_0x68d4('0x33')]()[_0x68d4('0x24')](function(_0x5759bf){if(_0x5759bf&&_0x5759bf[_0x68d4('0x25')]){return _0x5759bf;}else{var _0x1e2869=_[_0x68d4('0x2f')](_0x5e68c1);if(_0x41b333[_0x68d4('0x30')]){var _0x224b32={};_0x224b32[_0x41b333[_0x68d4('0x30')]]=_0x4bb615;_[_0x68d4('0x31')](_0x1e2869[_0x68d4('0x32')],_0x224b32);}return _0x100109[_0x68d4('0x1f')](_0x68d4('0x37'))[_0x68d4('0x23')](_0x1e2869,_0x17aa84)[_0x68d4('0x24')](function(_0x3939f9){if(_0x3939f9&&_0x3939f9['length']){return _0x3939f9;}else{var _0x633f6b=_[_0x68d4('0x2f')](_0x5e68c1);if(_0x41b333[_0x68d4('0x34')]){var _0x303f6e={};_0x303f6e[_0x41b333[_0x68d4('0x34')]]=_0x4bb615;_[_0x68d4('0x31')](_0x633f6b[_0x68d4('0x32')],_0x303f6e);}return _0x100109[_0x68d4('0x1f')](_0x68d4('0x38'))[_0x68d4('0x23')](_0x633f6b,_0x17aa84);}});}});case'contact':var _0x3bff2d=_[_0x68d4('0x2f')](_0x5e68c1);if(_0x41b333[_0x68d4('0x30')]){var _0x24cfa3={};_0x24cfa3[_0x41b333[_0x68d4('0x30')]]=_0x4bb615;_[_0x68d4('0x31')](_0x3bff2d['$or'],_0x24cfa3);}return _0x100109[_0x68d4('0x1f')](_0x68d4('0x37'))[_0x68d4('0x23')](_0x3bff2d,_0x17aa84)[_0x68d4('0x33')]();case'lead':var _0x52b1b7=_[_0x68d4('0x2f')](_0x5e68c1);if(_0x41b333[_0x68d4('0x34')]){var _0x24cfa3={};_0x24cfa3[_0x41b333[_0x68d4('0x34')]]=_0x4bb615;_['merge'](_0x52b1b7['$or'],_0x24cfa3);}return _0x100109[_0x68d4('0x1f')](_0x68d4('0x38'))['find'](_0x52b1b7,_0x17aa84);case _0x68d4('0x17'):var _0x562d2e=_[_0x68d4('0x2f')](_0x5e68c1);if(_0x41b333['additionalSearchAccount']){var _0x24cfa3={};_0x24cfa3[_0x41b333['additionalSearchAccount']]=_0x4bb615;_[_0x68d4('0x31')](_0x562d2e['$or'],_0x24cfa3);}return _0x100109[_0x68d4('0x1f')](_0x68d4('0x36'))[_0x68d4('0x23')](_0x562d2e,_0x17aa84);default:return null;}})[_0x68d4('0x24')](function(_0x398e36){if(_0x398e36&&_0x398e36['length']){var _0x1a5efc=_['first'](_0x398e36);if(_0x1a5efc){return BPromise[_0x68d4('0x27')]({'id':_0x1a5efc['Id'],'name':_0x1a5efc[_0x68d4('0x28')],'phone':_0x1a5efc['Phone'],'endUserType':_0x1a5efc['attributes'][_0x68d4('0x39')][_0x68d4('0x3a')]()});}}})[_0x68d4('0x24')](function(_0x5dbbf7){if(_0x5dbbf7){logger[_0x68d4('0x1d')](_0x68d4('0x3b'),_0x5dbbf7['endUserType'],_0x4bb615);return BPromise[_0x68d4('0x27')](_0x5dbbf7);}else{logger[_0x68d4('0x1d')](_0x68d4('0x3c'),_0x4bb615);var _0x220ddb={'Phone':_0x4bb615};if(_0x41b333[_0x68d4('0x3d')]){if(_0x41b333['moduleCreate']===_0x68d4('0x13')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4bb615,_0x41b333[_0x68d4('0x3d')]);_0x220ddb['LastName']=_0xcc31f7!==_0x68d4('0x3e')?_0xcc31f7:util['format'](_0x68d4('0x3f'),_0x4bb615);}else if(_0x41b333[_0x68d4('0x3d')]===_0x68d4('0x15')){logger[_0x68d4('0x1d')](_0x68d4('0x40'),_0x4bb615,_0x41b333[_0x68d4('0x3d')]);_0x220ddb[_0x68d4('0x41')]=_0xcc31f7!==_0x68d4('0x3e')?_0xcc31f7:util[_0x68d4('0x42')](_0x68d4('0x3f'),_0x4bb615);_0x220ddb['Company']=_0x68d4('0x43');}else if(_0x41b333['moduleCreate']===_0x68d4('0x17')){logger[_0x68d4('0x1d')](_0x68d4('0x40'),_0x4bb615,_0x41b333['moduleCreate']);_0x220ddb[_0x68d4('0x28')]=_0xcc31f7!==_0x68d4('0x3e')?_0xcc31f7:util[_0x68d4('0x42')](_0x68d4('0x3f'),_0x4bb615);}else{return null;}}return _0x100109['sobject'](_[_0x68d4('0x44')](_0x41b333['moduleCreate']))[_0x68d4('0x45')](_0x220ddb)[_0x68d4('0x24')](function(_0x387f86){return BPromise['resolve']({'id':_0x387f86['id'],'endUserType':_0x41b333[_0x68d4('0x3d')]});});}});}function getCustomFields(_0x2c9210,_0x45346b){var _0x34433f={};if(_0x2c9210[_0x68d4('0x25')]>0x0){_[_0x68d4('0x46')](_0x2c9210,function(_0x3dee3e){if(_['includes'](['string',_0x68d4('0x47')],_0x3dee3e['type'])&&_0x3dee3e['idField']){_0x34433f[_0x3dee3e[_0x68d4('0x48')]]=_0x3dee3e[_0x68d4('0x49')][_0x68d4('0x4a')]();}else if(_0x3dee3e['type']==='variable'&&_0x3dee3e['variableName']&&_0x3dee3e[_0x68d4('0x48')]){_0x45346b[_0x3dee3e[_0x68d4('0x4b')]]&&(_0x34433f[_0x3dee3e['idField']]=_0x45346b[_0x3dee3e[_0x68d4('0x4b')]][_0x68d4('0x4a')]());}else if(_0x3dee3e[_0x68d4('0x39')]===_0x68d4('0x4c')&&_0x3dee3e[_0x68d4('0x4d')]&&_0x3dee3e[_0x68d4('0x4d')][_0x68d4('0x4e')]&&_0x3dee3e[_0x68d4('0x48')]){_0x45346b[_0x3dee3e[_0x68d4('0x4d')][_0x68d4('0x4e')][_0x68d4('0x3a')]()]&&(_0x34433f[_0x3dee3e[_0x68d4('0x48')]]=_0x45346b[_0x3dee3e[_0x68d4('0x4d')][_0x68d4('0x4e')][_0x68d4('0x3a')]()][_0x68d4('0x4a')]());}});}return _0x34433f;}function getConnection(_0x5a1a1f){var _0x24ad4a=_0x5a1a1f['password'][_0x68d4('0x4f')](_0x5a1a1f[_0x68d4('0x50')]);var _0x56d517=new jsforce[(_0x68d4('0x51'))]({'oauth2':{'loginUrl':_0x5a1a1f[_0x68d4('0x52')]||_0x68d4('0x53'),'clientId':_0x5a1a1f['clientId'],'clientSecret':_0x5a1a1f[_0x68d4('0x54')]}});return _0x56d517[_0x68d4('0x55')](_0x5a1a1f[_0x68d4('0x56')],_0x24ad4a)[_0x68d4('0x24')](function(){logger['info']('Connection\x20established.');return _0x56d517;});}exports[_0x68d4('0x57')]=function(_0x54469c,_0x2550db,_0x20bc16,_0x16729a,_0x14f7e2,_0x1a714d){var _0xe2f148,_0x8147ef,_0x16ff62,_0x5db745;_0x1a714d[_0x68d4('0x58')]=intUtil[_0x68d4('0x59')](_0x1a714d[_0x68d4('0x58')]);_0x1a714d[_0x68d4('0x52')]=intUtil[_0x68d4('0x59')](_0x1a714d[_0x68d4('0x52')]);if(_0x14f7e2&&_0x14f7e2[_0x68d4('0x5a')]){logger[_0x68d4('0x1d')](_0x68d4('0x5b'),_0x68d4('0x5c'));_0x2550db[_0x68d4('0x5d')]=util[_0x68d4('0x42')](_0x68d4('0x5e'),_0x1a714d[_0x68d4('0x58')],_0x2550db[_0x68d4('0x5f')],md5(_0x2550db[_0x68d4('0x5f')]));}else{_0x2550db[_0x68d4('0x5d')]='';}return getConnection(_0x1a714d)[_0x68d4('0x24')](function(_0x55f6ed){_0x5db745=_0x55f6ed;return getUser(_0x1a714d,_0x16729a[_0x68d4('0x60')],_0x5db745);})[_0x68d4('0x24')](function(_0x5927b7){_0xe2f148=_0x5927b7;return getEndUser(_0x1a714d,_0x20bc16,_0x2550db['calleridname'],_0x2550db['calleridnum'],_0x5db745);})[_0x68d4('0x24')](function(_0x8b83e1){_0x8147ef=_0x8b83e1;return getTicket(_0x1a714d,_0xe2f148,_0x8147ef,_0x20bc16,_0x2550db,_0x20bc16[_0x68d4('0x61')],_0x5db745,_0x68d4('0x57'));})[_0x68d4('0x24')](function(_0x429b13){_0x16ff62=_0x429b13;logger[_0x68d4('0x1d')](_0x68d4('0x62'),_0x16ff62['id']);logger[_0x68d4('0x1d')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x16ff62['id'],_0x16729a[_0x68d4('0x4e')],_0x1a714d[_0x68d4('0x39')]);switch(_0x1a714d['type']){case _0x68d4('0x63'):emit(util['format'](_0x68d4('0x64'),_0x16729a[_0x68d4('0x4e')]),_0x68d4('0x65'),{'recordId':_0x16ff62['id']});break;case'newTab':emit(util[_0x68d4('0x42')](_0x68d4('0x64'),_0x16729a['name']),'trigger:browser:url',{'uri':util[_0x68d4('0x42')](_0x68d4('0x66'),_0x5db745[_0x68d4('0x67')],_0x16ff62['id'])});break;default:logger['error'](_0x68d4('0x68'));}})[_0x68d4('0x69')](function(_0x736424){logger['error'](_0x68d4('0x5b'),_0x736424);});};exports[_0x68d4('0x6a')]=function(_0x53ac55,_0x5647ee,_0x114c90,_0x3f3f6a,_0x1d2aef,_0x571c73,_0x283563){var _0x3a2730,_0x10d347,_0x4829a9,_0x15430b;_0x571c73[_0x68d4('0x58')]=intUtil[_0x68d4('0x59')](_0x571c73[_0x68d4('0x58')]);_0x571c73[_0x68d4('0x52')]=intUtil[_0x68d4('0x59')](_0x571c73['remoteUri']);if(_0x283563&&_0x283563[_0x68d4('0x6b')]&&_0x283563[_0x68d4('0x6b')]!==_0x68d4('0x6c')){logger[_0x68d4('0x1d')](_0x68d4('0x6d'),'Recording\x20is\x20enabled!');_0x5647ee['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x571c73[_0x68d4('0x58')],_0x5647ee[_0x68d4('0x5f')],md5(_0x5647ee[_0x68d4('0x5f')]));}return getConnection(_0x571c73)[_0x68d4('0x24')](function(_0x198e2b){_0x15430b=_0x198e2b;return getUser(_0x571c73,_0x3f3f6a['email'],_0x15430b);})[_0x68d4('0x24')](function(_0x2891ad){_0x3a2730=_0x2891ad;return getEndUser(_0x571c73,_0x114c90,_0x5647ee['destcalleridname'],_0x5647ee[_0x68d4('0x6e')],_0x15430b);})['then'](function(_0x3967dd){_0x10d347=_0x3967dd;return getTicket(_0x571c73,_0x3a2730,_0x10d347,_0x114c90,_0x5647ee,_0x114c90[_0x68d4('0x61')],_0x15430b,_0x68d4('0x6a'));})['then'](function(_0x10c11f){_0x4829a9=_0x10c11f;logger[_0x68d4('0x1d')](_0x68d4('0x6f'),_0x4829a9['id']);logger[_0x68d4('0x1d')](_0x68d4('0x70'),_0x4829a9['id'],_0x3f3f6a[_0x68d4('0x4e')],_0x571c73[_0x68d4('0x39')]);switch(_0x571c73[_0x68d4('0x39')]){case _0x68d4('0x63'):emit(util['format']('user:%s',_0x3f3f6a[_0x68d4('0x4e')]),'trigger:salesforce:display',{'recordId':_0x4829a9['id']});break;case _0x68d4('0x71'):emit(util[_0x68d4('0x42')](_0x68d4('0x64'),_0x3f3f6a[_0x68d4('0x4e')]),_0x68d4('0x72'),{'uri':util['format'](_0x68d4('0x66'),_0x15430b[_0x68d4('0x67')],_0x4829a9['id'])});break;default:logger['error']('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x68d4('0x69')](function(_0x4cc23f){logger[_0x68d4('0x73')](_0x68d4('0x6d'),_0x4cc23f);});};exports['unmanaged']=function(_0x2f2b46,_0x15e658,_0x8c1d5b,_0x2fdc25,_0x19063d,_0x27d290){var _0x5a1a77,_0x52737,_0x22b511,_0x3820bc;_0x27d290[_0x68d4('0x58')]=intUtil['stripTrailingSlash'](_0x27d290[_0x68d4('0x58')]);_0x27d290['remoteUri']=intUtil['stripTrailingSlash'](_0x27d290[_0x68d4('0x52')]);if(_0x19063d&&_0x19063d['monitor_format']){logger[_0x68d4('0x1d')]('['+_0x15e658['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x15e658[_0x68d4('0x5d')]=util['format'](_0x68d4('0x5e'),_0x27d290[_0x68d4('0x58')],_0x15e658['uniqueid'],md5(_0x15e658[_0x68d4('0x5f')]));}else{_0x15e658[_0x68d4('0x5d')]='';}return getConnection(_0x27d290)[_0x68d4('0x24')](function(_0x239e2b){_0x3820bc=_0x239e2b;if(!_[_0x68d4('0x20')](_0x2fdc25)){return getUser(_0x27d290,_0x2fdc25[_0x68d4('0x4e')],_0x3820bc);}else{return getUser(_0x27d290,null,_0x3820bc);}})[_0x68d4('0x24')](function(_0x21dbb5){_0x5a1a77=_0x21dbb5;return getEndUser(_0x27d290,_0x8c1d5b,_0x15e658['calleridname'],_0x15e658[_0x68d4('0x74')],_0x3820bc);})[_0x68d4('0x24')](function(_0x2d4b47){_0x52737=_0x2d4b47;return getTicket(_0x27d290,_0x5a1a77,_0x52737,_0x8c1d5b,_0x15e658,_0x8c1d5b[_0x68d4('0x61')],_0x3820bc);})[_0x68d4('0x24')](function(_0xa6ad7f){_0x22b511=_0xa6ad7f;logger[_0x68d4('0x1d')]('['+_0x15e658[_0x68d4('0x75')][_0x68d4('0x76')]()+_0x68d4('0x77'),_0x22b511['id']);logger[_0x68d4('0x1d')]('['+_0x15e658['lastevent'][_0x68d4('0x76')]()+_0x68d4('0x78'),_0x27d290['type']);})[_0x68d4('0x69')](function(_0xc78e50){logger[_0x68d4('0x73')]('['+_0x15e658[_0x68d4('0x75')][_0x68d4('0x76')]()+']',_0xc78e50);});};
\ No newline at end of file
+var _0xa1a9=['error','recordingFormat','none','destcalleridname','destcalleridnum','Fields','outbound','%s/%s/e','[OUTBOUND]','catch','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','salesforce','redis','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','WhatId','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','then','info','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','execute','length','additionalSearchLead','additionalSearchAccount','Account','Lead','Contact','Name','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','LastName','<unknown>','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','forEach','includes','picklist','content','toString','variableName','idField','Variable','name','securityToken','Connection','clientId','clientSecret','login','username','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0xa1a9,0x84));var _0x9a1a=function(_0x32670e,_0x5086d7){_0x32670e=_0x32670e-0x0;var _0x578659=_0xa1a9[_0x32670e];return _0x578659;};'use strict';var _=require(_0x9a1a('0x0'));var rp=require(_0x9a1a('0x1'));var moment=require(_0x9a1a('0x2'));var BPromise=require(_0x9a1a('0x3'));var md5=require(_0x9a1a('0x4'));var jsforce=require(_0x9a1a('0x5'));var util=require('util');var Redis=require(_0x9a1a('0x6'));var intUtil=require(_0x9a1a('0x7'));var config=require(_0x9a1a('0x8'));var logger=require('../../../../config/logger')(_0x9a1a('0x9'));config['redis']=_['defaults'](config[_0x9a1a('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x9a1a('0xb'))(new Redis(config['redis']));function emit(_0x3198e3,_0xe9a593,_0x2c6afb){io['to'](_0x3198e3)[_0x9a1a('0xc')](_0xe9a593,_0x2c6afb);}function getTicket(_0x2ec6db,_0x5e767e,_0x100307,_0x2d8110,_0x55737d,_0x4ce37f,_0x5b3e1d,_0x20e30b){var _0x5519cb=Object['assign']({},{'OwnerId':_0x5e767e['id'],'Subject':intUtil[_0x9a1a('0xd')](_0x2d8110[_0x9a1a('0xe')],_0x55737d,'\x20'),'Description':intUtil[_0x9a1a('0xd')](_0x2d8110[_0x9a1a('0xf')],_0x55737d,'\x0a')},getCustomFields(_0x4ce37f,_0x55737d));if(_0x100307){if(_0x2d8110[_0x9a1a('0x10')]===_0x9a1a('0x11')){_0x5519cb[_0x9a1a('0x12')]=moment[_0x9a1a('0x13')]();_0x5519cb[_0x9a1a('0x14')]=![];_0x5519cb[_0x9a1a('0x15')]=![];if(_0x100307[_0x9a1a('0x16')]===_0x9a1a('0x17')||_0x100307[_0x9a1a('0x16')]===_0x9a1a('0x18')){_0x5519cb['WhoId']=_0x100307['id'];}else if(_0x100307[_0x9a1a('0x16')]===_0x9a1a('0x19')){_0x5519cb[_0x9a1a('0x1a')]=_0x100307['id'];}}else if(_0x2d8110['ticketType']==='Case'){if(_0x100307[_0x9a1a('0x16')]==='contact'){_0x5519cb[_0x9a1a('0x1b')]=_0x100307['id'];}else if(_0x100307['endUserType']===_0x9a1a('0x19')){_0x5519cb[_0x9a1a('0x1c')]=_0x100307['id'];}else if(_0x100307[_0x9a1a('0x16')]==='lead'&&_0x2d8110[_0x9a1a('0x1d')]){_0x5519cb[_0x2d8110['leadId']]=_0x100307['id'];}else{logger['info'](_0x9a1a('0x1e'));}}}return _0x5b3e1d[_0x9a1a('0x1f')](_0x2d8110['ticketType'])[_0x9a1a('0x20')](_0x5519cb);}function getUser(_0x28d412,_0x3055fc,_0xe6da7){if(!_[_0x9a1a('0x21')](_0x3055fc)&&intUtil[_0x9a1a('0x22')](_0x3055fc)){var _0x23e2b8={'Email':_0x3055fc};var _0x2cdf93={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xe6da7[_0x9a1a('0x1f')]('User')[_0x9a1a('0x23')](_0x23e2b8,_0x2cdf93)['execute']()[_0x9a1a('0x24')](function(_0x1c0371){if(_0x1c0371['length']){var _0x54a7f9=_[_0x9a1a('0x23')](_0x1c0371,function(_0x4116e3){return _0x4116e3['Email']===_0x3055fc;});if(_0x54a7f9){logger[_0x9a1a('0x25')]('Agent\x20%s\x20found.',_0x3055fc);return BPromise[_0x9a1a('0x26')]({'id':_0x54a7f9['Id'],'name':_0x54a7f9['Name']});}}else{logger[_0x9a1a('0x25')](_0x9a1a('0x27'),_0x3055fc);return _0xe6da7[_0x9a1a('0x28')]()['then'](function(_0x5c828a){return BPromise[_0x9a1a('0x26')]({'id':_0x5c828a[_0x9a1a('0x29')],'name':_0x5c828a[_0x9a1a('0x2a')]});});}});}else{logger[_0x9a1a('0x25')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3055fc);return _0xe6da7[_0x9a1a('0x28')]()['then'](function(_0xff8ede){return BPromise[_0x9a1a('0x26')]({'id':_0xff8ede['user_id'],'name':_0xff8ede['display_name']});});}}function getEndUser(_0x596dbb,_0x1dad47,_0x5dffad,_0x3a7703,_0x5b2279){var _0x5b101f={'$or':{'Phone':_0x3a7703}};var _0x50739b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x9a1a('0x24')](function(){logger[_0x9a1a('0x25')](_0x9a1a('0x2b'),_0x3a7703,_0x1dad47[_0x9a1a('0x2c')]);switch(_0x1dad47[_0x9a1a('0x2c')]){case _0x9a1a('0x2d'):var _0x1bc796=_[_0x9a1a('0x2e')](_0x5b101f);if(_0x1dad47[_0x9a1a('0x2f')]){var _0x58db7b={};_0x58db7b[_0x1dad47['additionalSearchContact']]=_0x3a7703;_[_0x9a1a('0x30')](_0x1bc796[_0x9a1a('0x31')],_0x58db7b);}return _0x5b2279[_0x9a1a('0x1f')]('Contact')['find'](_0x1bc796,_0x50739b)[_0x9a1a('0x32')]()[_0x9a1a('0x24')](function(_0x48ec39){if(_0x48ec39&&_0x48ec39[_0x9a1a('0x33')]){return _0x48ec39;}else{var _0x79018e=_[_0x9a1a('0x2e')](_0x5b101f);if(_0x1dad47[_0x9a1a('0x34')]){var _0x4ca0fd={};_0x4ca0fd[_0x1dad47['additionalSearchLead']]=_0x3a7703;_[_0x9a1a('0x30')](_0x79018e[_0x9a1a('0x31')],_0x4ca0fd);}return _0x5b2279[_0x9a1a('0x1f')]('Lead')[_0x9a1a('0x23')](_0x79018e,_0x50739b);}});case'account_contact_lead':var _0x39b861=_[_0x9a1a('0x2e')](_0x5b101f);if(_0x1dad47[_0x9a1a('0x35')]){var _0x58db7b={};_0x58db7b[_0x1dad47['additionalSearchAccount']]=_0x3a7703;_[_0x9a1a('0x30')](_0x39b861[_0x9a1a('0x31')],_0x58db7b);}return _0x5b2279[_0x9a1a('0x1f')](_0x9a1a('0x36'))[_0x9a1a('0x23')](_0x39b861,_0x50739b)[_0x9a1a('0x32')]()[_0x9a1a('0x24')](function(_0x4d0017){if(_0x4d0017&&_0x4d0017[_0x9a1a('0x33')]){return _0x4d0017;}else{var _0x47c647=_[_0x9a1a('0x2e')](_0x5b101f);if(_0x1dad47[_0x9a1a('0x2f')]){var _0x2ced79={};_0x2ced79[_0x1dad47[_0x9a1a('0x2f')]]=_0x3a7703;_['merge'](_0x47c647[_0x9a1a('0x31')],_0x2ced79);}return _0x5b2279[_0x9a1a('0x1f')]('Contact')[_0x9a1a('0x23')](_0x47c647,_0x50739b)['then'](function(_0x391de5){if(_0x391de5&&_0x391de5['length']){return _0x391de5;}else{var _0x467edd=_[_0x9a1a('0x2e')](_0x5b101f);if(_0x1dad47[_0x9a1a('0x34')]){var _0x32db68={};_0x32db68[_0x1dad47[_0x9a1a('0x34')]]=_0x3a7703;_[_0x9a1a('0x30')](_0x467edd[_0x9a1a('0x31')],_0x32db68);}return _0x5b2279[_0x9a1a('0x1f')](_0x9a1a('0x37'))[_0x9a1a('0x23')](_0x467edd,_0x50739b);}});}});case _0x9a1a('0x17'):var _0x1bc796=_[_0x9a1a('0x2e')](_0x5b101f);if(_0x1dad47['additionalSearchContact']){var _0x58db7b={};_0x58db7b[_0x1dad47[_0x9a1a('0x2f')]]=_0x3a7703;_[_0x9a1a('0x30')](_0x1bc796[_0x9a1a('0x31')],_0x58db7b);}return _0x5b2279[_0x9a1a('0x1f')](_0x9a1a('0x38'))[_0x9a1a('0x23')](_0x1bc796,_0x50739b)[_0x9a1a('0x32')]();case _0x9a1a('0x18'):var _0x1d12b9=_['cloneDeep'](_0x5b101f);if(_0x1dad47[_0x9a1a('0x34')]){var _0x58db7b={};_0x58db7b[_0x1dad47[_0x9a1a('0x34')]]=_0x3a7703;_['merge'](_0x1d12b9[_0x9a1a('0x31')],_0x58db7b);}return _0x5b2279[_0x9a1a('0x1f')](_0x9a1a('0x37'))[_0x9a1a('0x23')](_0x1d12b9,_0x50739b);case _0x9a1a('0x19'):var _0x39b861=_[_0x9a1a('0x2e')](_0x5b101f);if(_0x1dad47[_0x9a1a('0x35')]){var _0x58db7b={};_0x58db7b[_0x1dad47[_0x9a1a('0x35')]]=_0x3a7703;_[_0x9a1a('0x30')](_0x39b861[_0x9a1a('0x31')],_0x58db7b);}return _0x5b2279['sobject'](_0x9a1a('0x36'))[_0x9a1a('0x23')](_0x39b861,_0x50739b);default:return null;}})['then'](function(_0x5ab376){if(_0x5ab376&&_0x5ab376[_0x9a1a('0x33')]){var _0x2d0bcd=_['first'](_0x5ab376);if(_0x2d0bcd){return BPromise['resolve']({'id':_0x2d0bcd['Id'],'name':_0x2d0bcd[_0x9a1a('0x39')],'phone':_0x2d0bcd['Phone'],'endUserType':_0x2d0bcd[_0x9a1a('0x3a')][_0x9a1a('0x3b')][_0x9a1a('0x3c')]()});}}})[_0x9a1a('0x24')](function(_0x2d62ab){if(_0x2d62ab){logger[_0x9a1a('0x25')](_0x9a1a('0x3d'),_0x2d62ab[_0x9a1a('0x16')],_0x3a7703);return BPromise[_0x9a1a('0x26')](_0x2d62ab);}else{logger[_0x9a1a('0x25')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x3a7703);var _0x24743b={'Phone':_0x3a7703};if(_0x1dad47[_0x9a1a('0x3e')]){if(_0x1dad47[_0x9a1a('0x3e')]===_0x9a1a('0x17')){logger[_0x9a1a('0x25')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3a7703,_0x1dad47[_0x9a1a('0x3e')]);_0x24743b[_0x9a1a('0x3f')]=_0x5dffad!==_0x9a1a('0x40')?_0x5dffad:util[_0x9a1a('0x41')](_0x9a1a('0x42'),_0x3a7703);}else if(_0x1dad47['moduleCreate']===_0x9a1a('0x18')){logger['info'](_0x9a1a('0x43'),_0x3a7703,_0x1dad47[_0x9a1a('0x3e')]);_0x24743b[_0x9a1a('0x3f')]=_0x5dffad!=='<unknown>'?_0x5dffad:util[_0x9a1a('0x41')]('Caller\x20-\x20%s',_0x3a7703);_0x24743b[_0x9a1a('0x44')]=_0x9a1a('0x45');}else if(_0x1dad47['moduleCreate']===_0x9a1a('0x19')){logger[_0x9a1a('0x25')](_0x9a1a('0x43'),_0x3a7703,_0x1dad47[_0x9a1a('0x3e')]);_0x24743b['Name']=_0x5dffad!==_0x9a1a('0x40')?_0x5dffad:util[_0x9a1a('0x41')]('Caller\x20-\x20%s',_0x3a7703);}else{return null;}}return _0x5b2279['sobject'](_['upperFirst'](_0x1dad47[_0x9a1a('0x3e')]))['create'](_0x24743b)[_0x9a1a('0x24')](function(_0x42f7c0){return BPromise['resolve']({'id':_0x42f7c0['id'],'endUserType':_0x1dad47['moduleCreate']});});}});}function getCustomFields(_0x24c81a,_0xe31f6e){var _0x1dcf1d={};if(_0x24c81a[_0x9a1a('0x33')]>0x0){_[_0x9a1a('0x46')](_0x24c81a,function(_0x3eabdd){if(_[_0x9a1a('0x47')](['string',_0x9a1a('0x48')],_0x3eabdd[_0x9a1a('0x3b')])&&_0x3eabdd['idField']){_0x1dcf1d[_0x3eabdd['idField']]=_0x3eabdd[_0x9a1a('0x49')][_0x9a1a('0x4a')]();}else if(_0x3eabdd[_0x9a1a('0x3b')]==='variable'&&_0x3eabdd[_0x9a1a('0x4b')]&&_0x3eabdd[_0x9a1a('0x4c')]){_0xe31f6e[_0x3eabdd[_0x9a1a('0x4b')]]&&(_0x1dcf1d[_0x3eabdd[_0x9a1a('0x4c')]]=_0xe31f6e[_0x3eabdd['variableName']][_0x9a1a('0x4a')]());}else if(_0x3eabdd[_0x9a1a('0x3b')]==='customVariable'&&_0x3eabdd[_0x9a1a('0x4d')]&&_0x3eabdd[_0x9a1a('0x4d')][_0x9a1a('0x4e')]&&_0x3eabdd[_0x9a1a('0x4c')]){_0xe31f6e[_0x3eabdd[_0x9a1a('0x4d')][_0x9a1a('0x4e')][_0x9a1a('0x3c')]()]&&(_0x1dcf1d[_0x3eabdd[_0x9a1a('0x4c')]]=_0xe31f6e[_0x3eabdd[_0x9a1a('0x4d')][_0x9a1a('0x4e')]['toLowerCase']()][_0x9a1a('0x4a')]());}});}return _0x1dcf1d;}function getConnection(_0x46d9bf){var _0x3b8994=_0x46d9bf['password']['concat'](_0x46d9bf[_0x9a1a('0x4f')]);var _0x51bc07=new jsforce[(_0x9a1a('0x50'))]({'oauth2':{'loginUrl':_0x46d9bf['remoteUri']||'https://login.salesforce.com','clientId':_0x46d9bf[_0x9a1a('0x51')],'clientSecret':_0x46d9bf[_0x9a1a('0x52')]}});return _0x51bc07[_0x9a1a('0x53')](_0x46d9bf[_0x9a1a('0x54')],_0x3b8994)['then'](function(){logger[_0x9a1a('0x25')]('Connection\x20established.');return _0x51bc07;});}exports['queue']=function(_0x5c19bb,_0x311fe9,_0x5ec135,_0x1369b4,_0x13f345,_0x196bdb){var _0x251f93,_0x506d54,_0x5205c3,_0x1ac02d;_0x196bdb[_0x9a1a('0x55')]=intUtil[_0x9a1a('0x56')](_0x196bdb[_0x9a1a('0x55')]);_0x196bdb[_0x9a1a('0x57')]=intUtil[_0x9a1a('0x56')](_0x196bdb[_0x9a1a('0x57')]);if(_0x13f345&&_0x13f345[_0x9a1a('0x58')]){logger[_0x9a1a('0x25')](_0x9a1a('0x59'),'Recording\x20is\x20enabled!');_0x311fe9[_0x9a1a('0x5a')]=util[_0x9a1a('0x41')](_0x9a1a('0x5b'),_0x196bdb[_0x9a1a('0x55')],_0x311fe9[_0x9a1a('0x5c')],md5(_0x311fe9['uniqueid']));}else{_0x311fe9[_0x9a1a('0x5a')]='';}return getConnection(_0x196bdb)[_0x9a1a('0x24')](function(_0x48aa96){_0x1ac02d=_0x48aa96;return getUser(_0x196bdb,_0x1369b4[_0x9a1a('0x5d')],_0x1ac02d);})[_0x9a1a('0x24')](function(_0x1522cd){_0x251f93=_0x1522cd;return getEndUser(_0x196bdb,_0x5ec135,_0x311fe9[_0x9a1a('0x5e')],_0x311fe9[_0x9a1a('0x5f')],_0x1ac02d);})[_0x9a1a('0x24')](function(_0x19bce2){_0x506d54=_0x19bce2;return getTicket(_0x196bdb,_0x251f93,_0x506d54,_0x5ec135,_0x311fe9,_0x5ec135['Fields'],_0x1ac02d,'queue');})[_0x9a1a('0x24')](function(_0x2b6f2b){_0x5205c3=_0x2b6f2b;logger[_0x9a1a('0x25')](_0x9a1a('0x60'),_0x5205c3['id']);logger['info'](_0x9a1a('0x61'),_0x5205c3['id'],_0x1369b4[_0x9a1a('0x4e')],_0x196bdb[_0x9a1a('0x3b')]);switch(_0x196bdb[_0x9a1a('0x3b')]){case _0x9a1a('0x62'):emit(util[_0x9a1a('0x41')](_0x9a1a('0x63'),_0x1369b4[_0x9a1a('0x4e')]),_0x9a1a('0x64'),{'recordId':_0x5205c3['id']});break;case _0x9a1a('0x65'):emit(util[_0x9a1a('0x41')](_0x9a1a('0x63'),_0x1369b4[_0x9a1a('0x4e')]),_0x9a1a('0x66'),{'uri':util[_0x9a1a('0x41')]('%s/%s/e',_0x1ac02d[_0x9a1a('0x67')],_0x5205c3['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x2d7bcc){logger[_0x9a1a('0x68')](_0x9a1a('0x59'),_0x2d7bcc);});};exports['outbound']=function(_0x5a6af7,_0x4e555b,_0x183867,_0x9960f7,_0x459ccc,_0x13b47e,_0x13fd84){var _0x5154cd,_0x4ed507,_0x110865,_0x595328;_0x13b47e['serverUrl']=intUtil['stripTrailingSlash'](_0x13b47e[_0x9a1a('0x55')]);_0x13b47e[_0x9a1a('0x57')]=intUtil[_0x9a1a('0x56')](_0x13b47e[_0x9a1a('0x57')]);if(_0x13fd84&&_0x13fd84[_0x9a1a('0x69')]&&_0x13fd84[_0x9a1a('0x69')]!==_0x9a1a('0x6a')){logger[_0x9a1a('0x25')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4e555b[_0x9a1a('0x5a')]=util[_0x9a1a('0x41')](_0x9a1a('0x5b'),_0x13b47e[_0x9a1a('0x55')],_0x4e555b[_0x9a1a('0x5c')],md5(_0x4e555b[_0x9a1a('0x5c')]));}return getConnection(_0x13b47e)[_0x9a1a('0x24')](function(_0x56c6b7){_0x595328=_0x56c6b7;return getUser(_0x13b47e,_0x9960f7['email'],_0x595328);})[_0x9a1a('0x24')](function(_0x4d4829){_0x5154cd=_0x4d4829;return getEndUser(_0x13b47e,_0x183867,_0x4e555b[_0x9a1a('0x6b')],_0x4e555b[_0x9a1a('0x6c')],_0x595328);})[_0x9a1a('0x24')](function(_0x1626a5){_0x4ed507=_0x1626a5;return getTicket(_0x13b47e,_0x5154cd,_0x4ed507,_0x183867,_0x4e555b,_0x183867[_0x9a1a('0x6d')],_0x595328,_0x9a1a('0x6e'));})[_0x9a1a('0x24')](function(_0x270c1d){_0x110865=_0x270c1d;logger[_0x9a1a('0x25')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x110865['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x110865['id'],_0x9960f7[_0x9a1a('0x4e')],_0x13b47e['type']);switch(_0x13b47e[_0x9a1a('0x3b')]){case'integrationTab':emit(util['format'](_0x9a1a('0x63'),_0x9960f7[_0x9a1a('0x4e')]),'trigger:salesforce:display',{'recordId':_0x110865['id']});break;case _0x9a1a('0x65'):emit(util[_0x9a1a('0x41')]('user:%s',_0x9960f7[_0x9a1a('0x4e')]),_0x9a1a('0x66'),{'uri':util[_0x9a1a('0x41')](_0x9a1a('0x6f'),_0x595328[_0x9a1a('0x67')],_0x110865['id'])});break;default:logger[_0x9a1a('0x68')](_0x9a1a('0x70'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x9a1a('0x71')](function(_0x1ff37e){logger[_0x9a1a('0x68')](_0x9a1a('0x70'),_0x1ff37e);});};exports[_0x9a1a('0x72')]=function(_0x21f2c6,_0x86682b,_0x2bb0e6,_0x38b814,_0xffaf8d,_0x14c01c){var _0x25006e,_0x24cf72,_0xc7986a,_0x522022;_0x14c01c[_0x9a1a('0x55')]=intUtil[_0x9a1a('0x56')](_0x14c01c[_0x9a1a('0x55')]);_0x14c01c[_0x9a1a('0x57')]=intUtil[_0x9a1a('0x56')](_0x14c01c[_0x9a1a('0x57')]);if(_0xffaf8d&&_0xffaf8d[_0x9a1a('0x58')]){logger[_0x9a1a('0x25')]('['+_0x86682b['lastevent'][_0x9a1a('0x73')]()+']','Recording\x20is\x20enabled!');_0x86682b[_0x9a1a('0x5a')]=util[_0x9a1a('0x41')](_0x9a1a('0x5b'),_0x14c01c[_0x9a1a('0x55')],_0x86682b[_0x9a1a('0x5c')],md5(_0x86682b[_0x9a1a('0x5c')]));}else{_0x86682b[_0x9a1a('0x5a')]='';}return getConnection(_0x14c01c)[_0x9a1a('0x24')](function(_0x5a4d31){_0x522022=_0x5a4d31;if(!_['isNil'](_0x38b814)){return getUser(_0x14c01c,_0x38b814[_0x9a1a('0x4e')],_0x522022);}else{return getUser(_0x14c01c,null,_0x522022);}})[_0x9a1a('0x24')](function(_0x1fa1f8){_0x25006e=_0x1fa1f8;return getEndUser(_0x14c01c,_0x2bb0e6,_0x86682b['calleridname'],_0x86682b['calleridnum'],_0x522022);})[_0x9a1a('0x24')](function(_0x566c11){_0x24cf72=_0x566c11;return getTicket(_0x14c01c,_0x25006e,_0x24cf72,_0x2bb0e6,_0x86682b,_0x2bb0e6[_0x9a1a('0x6d')],_0x522022);})['then'](function(_0xd823fd){_0xc7986a=_0xd823fd;logger['info']('['+_0x86682b[_0x9a1a('0x74')][_0x9a1a('0x73')]()+_0x9a1a('0x75'),_0xc7986a['id']);logger[_0x9a1a('0x25')]('['+_0x86682b[_0x9a1a('0x74')][_0x9a1a('0x73')]()+']\x20Integration\x20account\x20type\x20%s.',_0x14c01c[_0x9a1a('0x3b')]);})[_0x9a1a('0x71')](function(_0x430951){logger['error']('['+_0x86682b['lastevent']['toUpperCase']()+']',_0x430951);});};
\ No newline at end of file
index fa834f0..8013ac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae22=['POST','sys_user?','endUserNumber','user','System','endUserId','error','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','content','string','idField','customField','toLowerCase','toString','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','username','password','sysparm_limit=1','stripTrailingSlash','serverUrl','format','%s/api/now/table/','remoteUri','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae22,0xbc));var _0x2ae2=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xae22[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x2ae2('0x0'));var Promise=require(_0x2ae2('0x1'));var rp=require(_0x2ae2('0x2'));var util=require(_0x2ae2('0x3'));var md5=require(_0x2ae2('0x4'));var Redis=require(_0x2ae2('0x5'));var intUtil=require(_0x2ae2('0x6'));var config=require('../../../../config/environment');var logger=require(_0x2ae2('0x7'))(_0x2ae2('0x8'));config['redis']=_[_0x2ae2('0x9')](config[_0x2ae2('0xa')],{'host':_0x2ae2('0xb'),'port':0x18eb});var io=require(_0x2ae2('0xc'))(new Redis(config[_0x2ae2('0xa')]));function getAdminUser(_0x2bf98b,_0x198f09,_0x551cdf,_0x593664,_0x4b6b61,_0x28b7ac){return new Promise(function(_0x38a962,_0x5ce8f0){var _0x4f039b={'method':_0x2ae2('0xd'),'uri':_0x593664+_0x2ae2('0xe')+'&'+_0x4b6b61+'&'+_0x28b7ac,'auth':_0x198f09,'json':!![]};return rp(_0x4f039b)[_0x2ae2('0xf')](function(_0x54d26d){if(_0x54d26d[_0x2ae2('0x10')][_0x2ae2('0x11')]>0x0){_0x551cdf['adminId']=_0x54d26d[_0x2ae2('0x10')][0x0][_0x2ae2('0x12')];}logger['info']('['+[_0x2bf98b[_0x2ae2('0x13')]()]+_0x2ae2('0x14'),_0x551cdf);_0x38a962(_0x551cdf);})[_0x2ae2('0x15')](function(_0xd74776){logger['error']('['+[_0x2bf98b[_0x2ae2('0x13')]()]+']',_0xd74776[_0x2ae2('0x16')]);_0x5ce8f0(_0xd74776[_0x2ae2('0x16')]);});});}function getUser(_0x1b7866,_0x5d02c9,_0x65180c,_0x28c2bf,_0x47550f){return function(_0x383485){logger[_0x2ae2('0x17')]('['+[_0x1b7866[_0x2ae2('0x13')]()]+_0x2ae2('0x18'),_0x383485);return new Promise(function(_0x4da591,_0x40a812){if(intUtil[_0x2ae2('0x19')](_0x383485[_0x2ae2('0x1a')])){var _0x1cfafd={'method':'GET','uri':_0x65180c+_0x2ae2('0x1b')+_0x383485[_0x2ae2('0x1a')]+'&'+_0x28c2bf+'&'+_0x47550f,'auth':_0x5d02c9,'json':!![]};logger[_0x2ae2('0x17')]('['+[_0x1b7866[_0x2ae2('0x13')]()]+_0x2ae2('0x1c'),_0x1cfafd);return rp(_0x1cfafd)[_0x2ae2('0xf')](function(_0x2291e7){logger[_0x2ae2('0x17')]('['+[_0x1b7866[_0x2ae2('0x13')]()]+'],\x20getUser\x20entity',_0x2291e7);if(_0x2291e7['result'][_0x2ae2('0x11')]>0x0&&String(_0x2291e7['result'][0x0][_0x2ae2('0x1d')])===_0x2ae2('0x1e')){_0x383485[_0x2ae2('0x1f')]=_0x2291e7[_0x2ae2('0x10')][0x0][_0x2ae2('0x12')];}else{_0x383485[_0x2ae2('0x1f')]=_0x383485['adminId'];_0x383485[_0x2ae2('0x1a')]=_0x383485[_0x2ae2('0x20')];}logger[_0x2ae2('0x17')]('['+[_0x1b7866[_0x2ae2('0x13')]()]+_0x2ae2('0x21'),_0x383485);_0x4da591(_0x383485);})[_0x2ae2('0x15')](function(_0x121fa0){logger['error']('['+[_0x1b7866[_0x2ae2('0x13')]()]+']',_0x121fa0[_0x2ae2('0x16')]);_0x40a812(_0x121fa0[_0x2ae2('0x16')]);});}else{logger[_0x2ae2('0x17')]('['+[_0x1b7866['toUpperCase']()]+_0x2ae2('0x22'));_0x383485['userId']=_0x383485['adminId'];_0x383485[_0x2ae2('0x1a')]=_0x383485[_0x2ae2('0x20')];_0x4da591(_0x383485);}});};}function createEndUser(_0x275111,_0x351e29,_0x37685a,_0x91017a,_0x43f783){logger[_0x2ae2('0x17')]('['+[_0x275111[_0x2ae2('0x13')]()]+_0x2ae2('0x23'),_0x37685a);return new Promise(function(_0x5b5809,_0x5dd085){var _0x2b0eaf={'method':_0x2ae2('0x24'),'uri':_0x91017a+_0x2ae2('0x25')+_0x43f783,'body':{'user_name':_0x37685a[_0x2ae2('0x26')],'roles':_0x2ae2('0x27'),'first_name':_0x37685a[_0x2ae2('0x26')],'active':_0x2ae2('0x1e'),'date_format':_0x2ae2('0x28'),'phone':_0x37685a[_0x2ae2('0x26')]},'auth':_0x351e29,'json':!![]};return rp(_0x2b0eaf)[_0x2ae2('0xf')](function(_0x5eebe8){logger[_0x2ae2('0x17')]('['+[_0x275111[_0x2ae2('0x13')]()]+'],\x20EndUser\x20schema',_0x5eebe8[_0x2ae2('0x10')]);_0x37685a[_0x2ae2('0x29')]=_0x5eebe8[_0x2ae2('0x10')]['sys_id'];_0x5b5809(_0x37685a);})[_0x2ae2('0x15')](function(_0x124733){logger[_0x2ae2('0x2a')]('['+[_0x275111[_0x2ae2('0x13')]()]+']',_0x124733[_0x2ae2('0x16')]);_0x5dd085(_0x124733[_0x2ae2('0x16')]);});});}function getEndUser(_0x542d7c,_0x1af6e4,_0x5c79ad,_0x28260f,_0x4a7e29){return function(_0x7bc6b9){logger['info']('['+[_0x542d7c[_0x2ae2('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x7bc6b9);return new Promise(function(_0x353015,_0x2331d3){var _0x4129b3={'method':_0x2ae2('0xd'),'uri':_0x5c79ad+_0x2ae2('0x2b')+_0x7bc6b9[_0x2ae2('0x26')]+'&'+_0x28260f+'&'+_0x4a7e29,'auth':_0x1af6e4,'json':!![]};return rp(_0x4129b3)[_0x2ae2('0xf')](function(_0x40fbb4){if(_0x40fbb4[_0x2ae2('0x10')][_0x2ae2('0x11')]>0x0){_0x7bc6b9[_0x2ae2('0x29')]=_0x40fbb4[_0x2ae2('0x10')][0x0][_0x2ae2('0x12')];logger[_0x2ae2('0x17')]('['+[_0x542d7c[_0x2ae2('0x13')]()]+_0x2ae2('0x2c'),_0x7bc6b9);_0x353015(_0x7bc6b9);}else{return createEndUser(_0x542d7c,_0x1af6e4,_0x7bc6b9,_0x5c79ad,_0x28260f)[_0x2ae2('0xf')](function(_0x43a91f){logger[_0x2ae2('0x17')]('['+[_0x542d7c[_0x2ae2('0x13')]()]+_0x2ae2('0x2d'),_0x43a91f);_0x353015(_0x43a91f);});}})[_0x2ae2('0x15')](function(_0x3bb2d3){logger[_0x2ae2('0x2a')]('['+[_0x542d7c[_0x2ae2('0x13')]()]+']',_0x3bb2d3[_0x2ae2('0x16')]);_0x2331d3(_0x3bb2d3['message']);});});};}function getCustomFields(_0xc8ecc0,_0x14aac8){var _0x3ff2e7={};if(_0xc8ecc0['length']>0x0){_[_0x2ae2('0x2e')](_0xc8ecc0,function(_0x2f6cb6){if(_[_0x2ae2('0x2f')](['string',_0x2ae2('0x30')],_0x2f6cb6[_0x2ae2('0x31')])&&_0x2f6cb6[_0x2ae2('0x32')]&&!_0x2f6cb6['customField']){_0x3ff2e7[_0x2f6cb6['nameField']['toLowerCase']()]=_0x2f6cb6[_0x2ae2('0x33')]['toString']();}else if(_[_0x2ae2('0x2f')]([_0x2ae2('0x34'),_0x2ae2('0x30')],_0x2f6cb6['type'])&&_0x2f6cb6[_0x2ae2('0x35')]&&_0x2f6cb6[_0x2ae2('0x36')]){_0x3ff2e7[_0x2f6cb6['idField'][_0x2ae2('0x37')]()]=_0x2f6cb6['content'][_0x2ae2('0x38')]();}else if(_0x2f6cb6[_0x2ae2('0x31')]===_0x2ae2('0x39')&&_0x2f6cb6['variableName']&&_0x2f6cb6[_0x2ae2('0x35')]&&_0x2f6cb6[_0x2ae2('0x36')]){_0x3ff2e7[_0x2f6cb6[_0x2ae2('0x35')][_0x2ae2('0x37')]()]=_0x14aac8[_0x2f6cb6[_0x2ae2('0x3a')]][_0x2ae2('0x38')]();}else if(_0x2f6cb6['type']==='customVariable'&&_0x2f6cb6['Variable']&&_0x2f6cb6[_0x2ae2('0x3b')][_0x2ae2('0x3c')]&&_0x2f6cb6[_0x2ae2('0x35')]&&_0x2f6cb6[_0x2ae2('0x36')]){_0x3ff2e7[_0x2f6cb6[_0x2ae2('0x35')][_0x2ae2('0x37')]()]=_0x14aac8[_0x2f6cb6[_0x2ae2('0x3b')][_0x2ae2('0x3c')]['toLowerCase']()][_0x2ae2('0x38')]();}});}return _0x3ff2e7;}function getTicket(_0x2a91c0,_0xc11564,_0x5ac000,_0x1eea7f,_0x349a27,_0x37869a){return function(_0x347ae3){logger['info']('['+[_0x2a91c0[_0x2ae2('0x13')]()]+_0x2ae2('0x3d'),_0x347ae3);return new Promise(function(_0x3100f9,_0x190164){var _0x469fe5=_0x2a91c0['toLowerCase']()===_0x2ae2('0x3e')?_0x347ae3['userId']:_0x347ae3[_0x2ae2('0x29')];var _0x21b986={'method':'POST','uri':_0x5ac000+_0x2ae2('0x3f')+'?'+_0x37869a,'body':Object[_0x2ae2('0x40')]({},{'active':_0x2ae2('0x1e'),'caller_id':_0x469fe5,'assigned_to':_0x347ae3['userId'],'short_description':intUtil[_0x2ae2('0x41')](_0x1eea7f[_0x2ae2('0x42')],_0x349a27,'\x20'),'description':intUtil['getString'](_0x1eea7f[_0x2ae2('0x43')],_0x349a27,'\x0a')},getCustomFields(_0x1eea7f[_0x2ae2('0x44')],_0x349a27)),'auth':_0xc11564,'json':!![]};return rp(_0x21b986)[_0x2ae2('0xf')](function(_0x32f658){logger[_0x2ae2('0x17')]('['+[_0x2a91c0[_0x2ae2('0x13')]()]+_0x2ae2('0x45'),_0x32f658[_0x2ae2('0x10')]);_0x347ae3[_0x2ae2('0x46')]=_0x32f658[_0x2ae2('0x10')][_0x2ae2('0x12')];_0x347ae3[_0x2ae2('0x47')]=_0x32f658[_0x2ae2('0x10')][_0x2ae2('0x48')];logger['info']('['+[_0x2a91c0['toUpperCase']()]+_0x2ae2('0x49'),_0x347ae3);_0x3100f9(_0x347ae3);})[_0x2ae2('0x15')](function(_0x8d9bc7){logger[_0x2ae2('0x2a')]('['+[_0x2a91c0[_0x2ae2('0x13')]()]+']',_0x8d9bc7[_0x2ae2('0x16')]);_0x190164(_0x8d9bc7['message']);});});};}function createRemoteTag(_0x42a9d2,_0x525f3e,_0x54bb65,_0x2aa960){return new Promise(function(_0x4ed886,_0x12d908){var _0x2bdb43={'method':_0x2ae2('0x24'),'uri':_0x54bb65+_0x2ae2('0x4a')+'?'+_0x2aa960,'body':{'short_description':_0x42a9d2,'global':!![],'active':!![],'name':_0x42a9d2},'auth':_0x525f3e,'json':!![]};return rp(_0x2bdb43)[_0x2ae2('0xf')](function(_0x530384){var _0x522e2b=_0x530384[_0x2ae2('0x10')][_0x2ae2('0x12')];_0x4ed886(_0x522e2b);});});}function getRemoteTag(_0x41fca4,_0x1ee426,_0x2ca90f,_0x40186e,_0x188a7f){return new Promise(function(_0x52fcdc,_0x13d48c){var _0x2e0d16={'method':'GET','uri':_0x2ca90f+_0x2ae2('0x4a')+_0x2ae2('0x4b')+_0x41fca4+'&'+_0x40186e,'auth':_0x1ee426,'json':!![]};return rp(_0x2e0d16)[_0x2ae2('0xf')](function(_0x1bd1ee){if(_0x1bd1ee['result']['length']>0x0){var _0x5bbc6c=_0x1bd1ee[_0x2ae2('0x10')][0x0][_0x2ae2('0x12')];_0x52fcdc(_0x5bbc6c);}else{return createRemoteTag(_0x41fca4,_0x1ee426,_0x2ca90f,_0x40186e)['then'](function(_0x5dd326){_0x52fcdc(_0x5dd326);});}});});}function assignTagToIncident(_0x328080,_0x41059c,_0x2bcae7,_0x584341,_0x586c0d){return new Promise(function(_0x21e136,_0x3498bb){var _0x201431={'method':'POST','uri':_0x2bcae7+_0x2ae2('0x4c')+'?'+_0x586c0d,'body':{'label':_0x328080,'table':_0x2ae2('0x3f'),'id_type':'Incident','table_key':_0x584341[_0x2ae2('0x46')],'title':_0x2ae2('0x4d')+_0x584341[_0x2ae2('0x47')],'id_display':_0x584341[_0x2ae2('0x47')]},'auth':_0x41059c,'json':!![]};return rp(_0x201431)[_0x2ae2('0xf')](function(_0x2baf19){_0x21e136();})[_0x2ae2('0x15')](function(){_0x21e136();});});}function manageTags(_0xa2bcf6,_0x5152b3,_0x4cc7e8,_0x26a9ab,_0xb77c2d,_0x43ecbd,_0x39e725){return new Promise(function(_0x13be12,_0x44351f){var _0x4ed5b4=[];_0x5152b3['forEach'](function(_0x434da0){_0x4ed5b4['push'](getRemoteTag(_0x434da0,_0x4cc7e8,_0x26a9ab,_0x43ecbd,_0x39e725));});return Promise[_0x2ae2('0x4e')](_0x4ed5b4)[_0x2ae2('0xf')](function(_0x2c0f8c){if(_0x2c0f8c[_0x2ae2('0x11')]){logger[_0x2ae2('0x17')]('['+[_0xa2bcf6[_0x2ae2('0x13')]()]+_0x2ae2('0x4f'),_0x2c0f8c);var _0x111cad=[];_0x2c0f8c[_0x2ae2('0x2e')](function(_0x11da38){_0x111cad[_0x2ae2('0x50')](assignTagToIncident(_0x11da38,_0x4cc7e8,_0x26a9ab,_0xb77c2d,_0x43ecbd));});return Promise[_0x2ae2('0x4e')](_0x111cad)[_0x2ae2('0xf')](function(){_0x13be12();})['catch'](function(){_0x13be12();});}else{_0x13be12();}});});}function getTags(_0x541ee3,_0x5afba5,_0x466767,_0x282aa8,_0x5188c6,_0x44a8ea){return function(_0x3a4b9a){return new Promise(function(_0x379e0d,_0x17a31a){var _0xe41926=[];var _0x568e03=_0x282aa8['Tags'];if(_0x568e03&&_0x568e03[_0x2ae2('0x11')]>0x0){_0xe41926=_[_0x2ae2('0x51')](_0x568e03,_0x2ae2('0x3c'));}if(_0xe41926['length']>0x0){return manageTags(_0x541ee3,_0xe41926,_0x5afba5,_0x466767,_0x3a4b9a,_0x5188c6,_0x44a8ea)[_0x2ae2('0xf')](function(){_0x379e0d(_0x3a4b9a);});}else{_0x379e0d(_0x3a4b9a);}});};}function emit(_0x21bf4c,_0x399e52,_0x267088){var _0x143e22=_0x2ae2('0x52')+_0x2ae2('0x53')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x2ae2('0x54');var _0x444bf9={'uri':_0x21bf4c+_0x2ae2('0x55')+_0x267088+_0x143e22};io['to'](util['format'](_0x2ae2('0x56'),_0x399e52))[_0x2ae2('0x57')]('trigger:browser:url',_0x444bf9);}exports['cs']=function(_0x5a5396,_0x2b1bf9,_0x420034,_0x3dd68b,_0x2be116,_0x5198e8,_0x57e57d,_0x30f1cf){var _0x28ee49={};var _0x501e5d={'user':_0x5198e8[_0x2ae2('0x58')],'pass':_0x5198e8[_0x2ae2('0x59')]};var _0x52557d=_0x2ae2('0x5a');var _0x55d39d='sysparm_display_value=true';_0x5198e8['remoteUri']=intUtil[_0x2ae2('0x5b')](_0x5198e8['remoteUri']);_0x5198e8['serverUrl']=intUtil['stripTrailingSlash'](_0x5198e8[_0x2ae2('0x5c')]);var _0xf4da7d=util[_0x2ae2('0x5d')](_0x2ae2('0x5e'),_0x5198e8[_0x2ae2('0x5f')]);_0x28ee49[_0x2ae2('0x1a')]=!_[_0x2ae2('0x60')](_0x3dd68b)?_0x3dd68b[_0x2ae2('0x61')]:null;_0x28ee49[_0x2ae2('0x20')]=_0x5198e8[_0x2ae2('0x61')];_0x28ee49[_0x2ae2('0x26')]=_0x30f1cf[_0x2ae2('0x37')]()==='outbound'?_0x2b1bf9[_0x2ae2('0x62')]:_0x2b1bf9[_0x2ae2('0x63')];_0x28ee49['callDirection']=_0x30f1cf===_0x2ae2('0x64')||_0x30f1cf===_0x2ae2('0x65')?'queue':_0x2ae2('0x3e');var _0x4c953d=util[_0x2ae2('0x5d')](_0x2ae2('0x66'),_0x5198e8[_0x2ae2('0x5c')],_0x2b1bf9[_0x2ae2('0x67')],md5(_0x2b1bf9[_0x2ae2('0x67')]));if(_0x2be116&&_0x2be116[_0x2ae2('0x68')]){logger[_0x2ae2('0x17')](_0x2ae2('0x69'),'Recording\x20is\x20enabled!');_0x2b1bf9[_0x2ae2('0x6a')]=_0x4c953d;}else if(_0x57e57d&&_0x57e57d[_0x2ae2('0x6b')]&&_0x57e57d[_0x2ae2('0x6b')]!==_0x2ae2('0x6c')){logger[_0x2ae2('0x17')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2b1bf9['recordingURL']=_0x4c953d;}else{_0x2b1bf9['recordingURL']='';}return getAdminUser(_0x30f1cf,_0x501e5d,_0x28ee49,_0xf4da7d,_0x55d39d,_0x52557d)[_0x2ae2('0xf')](getUser(_0x30f1cf,_0x501e5d,_0xf4da7d,_0x55d39d,_0x52557d))[_0x2ae2('0xf')](getEndUser(_0x30f1cf,_0x501e5d,_0xf4da7d,_0x55d39d,_0x52557d))['then'](getTicket(_0x30f1cf,_0x501e5d,_0xf4da7d,_0x420034,_0x2b1bf9,_0x55d39d))[_0x2ae2('0xf')](function(_0x3084e9){logger[_0x2ae2('0x17')](util[_0x2ae2('0x5d')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3084e9[_0x2ae2('0x46')]));logger[_0x2ae2('0x17')](util[_0x2ae2('0x5d')](_0x2ae2('0x6d'),_0x30f1cf));if(_0x30f1cf!==_0x2ae2('0x65')){logger[_0x2ae2('0x17')]('['+[_0x30f1cf[_0x2ae2('0x13')]()]+']',_0x2ae2('0x6e'));emit(_0x5198e8['remoteUri'],_0x3dd68b[_0x2ae2('0x3c')],_0x3084e9[_0x2ae2('0x46')]);}})['catch'](function(_0x2e4329){logger['error']('['+[_0x30f1cf[_0x2ae2('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x2ae2('0x6f')](_0x2e4329,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x8423=['none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET','then','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','length','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','forEach','all','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat'];(function(_0x3a166a,_0x2018be){var _0x1b0279=function(_0x5b98dd){while(--_0x5b98dd){_0x3a166a['push'](_0x3a166a['shift']());}};_0x1b0279(++_0x2018be);}(_0x8423,0x150));var _0x3842=function(_0x127219,_0x58e1d4){_0x127219=_0x127219-0x0;var _0x23ab3a=_0x8423[_0x127219];return _0x23ab3a;};'use strict';var _=require(_0x3842('0x0'));var Promise=require(_0x3842('0x1'));var rp=require(_0x3842('0x2'));var util=require(_0x3842('0x3'));var md5=require('md5');var Redis=require(_0x3842('0x4'));var intUtil=require(_0x3842('0x5'));var config=require(_0x3842('0x6'));var logger=require('../../../../config/logger')('servicenow');config[_0x3842('0x7')]=_[_0x3842('0x8')](config[_0x3842('0x7')],{'host':_0x3842('0x9'),'port':0x18eb});var io=require(_0x3842('0xa'))(new Redis(config[_0x3842('0x7')]));function getAdminUser(_0xa3f393,_0x45bb68,_0x5ab21d,_0x283079,_0x533fbb,_0x2e480e){return new Promise(function(_0x4e3426,_0x710e18){var _0x19788e={'method':_0x3842('0xb'),'uri':_0x283079+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x533fbb+'&'+_0x2e480e,'auth':_0x45bb68,'json':!![]};return rp(_0x19788e)[_0x3842('0xc')](function(_0xae3e01){if(_0xae3e01['result']['length']>0x0){_0x5ab21d[_0x3842('0xd')]=_0xae3e01[_0x3842('0xe')][0x0][_0x3842('0xf')];}logger[_0x3842('0x10')]('['+[_0xa3f393[_0x3842('0x11')]()]+_0x3842('0x12'),_0x5ab21d);_0x4e3426(_0x5ab21d);})[_0x3842('0x13')](function(_0x5c0880){logger[_0x3842('0x14')]('['+[_0xa3f393[_0x3842('0x11')]()]+']',_0x5c0880[_0x3842('0x15')]);_0x710e18(_0x5c0880[_0x3842('0x15')]);});});}function getUser(_0x490841,_0x159899,_0x170260,_0x2b9b85,_0x9f80e1){return function(_0xf72ae7){logger[_0x3842('0x10')]('['+[_0x490841[_0x3842('0x11')]()]+'],\x20getUser\x20input\x20crm',_0xf72ae7);return new Promise(function(_0x3fac68,_0x24cd3){if(intUtil[_0x3842('0x16')](_0xf72ae7['userEmail'])){var _0x2df278={'method':_0x3842('0xb'),'uri':_0x170260+_0x3842('0x17')+_0xf72ae7[_0x3842('0x18')]+'&'+_0x2b9b85+'&'+_0x9f80e1,'auth':_0x159899,'json':!![]};logger[_0x3842('0x10')]('['+[_0x490841[_0x3842('0x11')]()]+_0x3842('0x19'),_0x2df278);return rp(_0x2df278)[_0x3842('0xc')](function(_0x12ce87){logger[_0x3842('0x10')]('['+[_0x490841['toUpperCase']()]+'],\x20getUser\x20entity',_0x12ce87);if(_0x12ce87[_0x3842('0xe')][_0x3842('0x1a')]>0x0&&String(_0x12ce87[_0x3842('0xe')][0x0]['active'])==='true'){_0xf72ae7[_0x3842('0x1b')]=_0x12ce87[_0x3842('0xe')][0x0][_0x3842('0xf')];}else{_0xf72ae7['userId']=_0xf72ae7[_0x3842('0xd')];_0xf72ae7[_0x3842('0x18')]=_0xf72ae7[_0x3842('0x1c')];}logger[_0x3842('0x10')]('['+[_0x490841[_0x3842('0x11')]()]+_0x3842('0x1d'),_0xf72ae7);_0x3fac68(_0xf72ae7);})[_0x3842('0x13')](function(_0x3f192c){logger[_0x3842('0x14')]('['+[_0x490841[_0x3842('0x11')]()]+']',_0x3f192c[_0x3842('0x15')]);_0x24cd3(_0x3f192c[_0x3842('0x15')]);});}else{logger['info']('['+[_0x490841['toUpperCase']()]+']\x20using\x20admin\x20profile');_0xf72ae7[_0x3842('0x1b')]=_0xf72ae7[_0x3842('0xd')];_0xf72ae7['userEmail']=_0xf72ae7[_0x3842('0x1c')];_0x3fac68(_0xf72ae7);}});};}function createEndUser(_0x44cc3e,_0x319e4f,_0x118a6a,_0x3e342a,_0x1cce28){logger[_0x3842('0x10')]('['+[_0x44cc3e['toUpperCase']()]+_0x3842('0x1e'),_0x118a6a);return new Promise(function(_0x344924,_0x1ae7d9){var _0x4e2416={'method':_0x3842('0x1f'),'uri':_0x3e342a+_0x3842('0x20')+_0x1cce28,'body':{'user_name':_0x118a6a['endUserNumber'],'roles':_0x3842('0x21'),'first_name':_0x118a6a[_0x3842('0x22')],'active':_0x3842('0x23'),'date_format':'System','phone':_0x118a6a[_0x3842('0x22')]},'auth':_0x319e4f,'json':!![]};return rp(_0x4e2416)[_0x3842('0xc')](function(_0x5311cf){logger[_0x3842('0x10')]('['+[_0x44cc3e[_0x3842('0x11')]()]+_0x3842('0x24'),_0x5311cf['result']);_0x118a6a[_0x3842('0x25')]=_0x5311cf['result'][_0x3842('0xf')];_0x344924(_0x118a6a);})[_0x3842('0x13')](function(_0x3498e7){logger[_0x3842('0x14')]('['+[_0x44cc3e[_0x3842('0x11')]()]+']',_0x3498e7['message']);_0x1ae7d9(_0x3498e7[_0x3842('0x15')]);});});}function getEndUser(_0x4371a5,_0x36982c,_0x1cd080,_0x5cc779,_0x36dad0){return function(_0xc511d6){logger[_0x3842('0x10')]('['+[_0x4371a5[_0x3842('0x11')]()]+_0x3842('0x26'),_0xc511d6);return new Promise(function(_0x2296e1,_0x4dedd0){var _0x335bdd={'method':_0x3842('0xb'),'uri':_0x1cd080+_0x3842('0x27')+_0xc511d6[_0x3842('0x22')]+'&'+_0x5cc779+'&'+_0x36dad0,'auth':_0x36982c,'json':!![]};return rp(_0x335bdd)[_0x3842('0xc')](function(_0x3bc22d){if(_0x3bc22d[_0x3842('0xe')]['length']>0x0){_0xc511d6[_0x3842('0x25')]=_0x3bc22d['result'][0x0][_0x3842('0xf')];logger[_0x3842('0x10')]('['+[_0x4371a5[_0x3842('0x11')]()]+'],\x20getEndUser\x20crm',_0xc511d6);_0x2296e1(_0xc511d6);}else{return createEndUser(_0x4371a5,_0x36982c,_0xc511d6,_0x1cd080,_0x5cc779)['then'](function(_0x548f37){logger['info']('['+[_0x4371a5['toUpperCase']()]+_0x3842('0x28'),_0x548f37);_0x2296e1(_0x548f37);});}})['catch'](function(_0x46a7ae){logger[_0x3842('0x14')]('['+[_0x4371a5['toUpperCase']()]+']',_0x46a7ae[_0x3842('0x15')]);_0x4dedd0(_0x46a7ae[_0x3842('0x15')]);});});};}function getCustomFields(_0xcf8aaa,_0x410194){var _0x2b38b1={};if(_0xcf8aaa[_0x3842('0x1a')]>0x0){_['forEach'](_0xcf8aaa,function(_0x282322){if(_[_0x3842('0x29')]([_0x3842('0x2a'),_0x3842('0x2b')],_0x282322[_0x3842('0x2c')])&&_0x282322[_0x3842('0x2d')]&&!_0x282322[_0x3842('0x2e')]){_0x2b38b1[_0x282322[_0x3842('0x2d')][_0x3842('0x2f')]()]=_0x282322[_0x3842('0x30')][_0x3842('0x31')]();}else if(_[_0x3842('0x29')]([_0x3842('0x2a'),_0x3842('0x2b')],_0x282322['type'])&&_0x282322[_0x3842('0x32')]&&_0x282322['customField']){_0x2b38b1[_0x282322[_0x3842('0x32')][_0x3842('0x2f')]()]=_0x282322[_0x3842('0x30')][_0x3842('0x31')]();}else if(_0x282322[_0x3842('0x2c')]===_0x3842('0x33')&&_0x282322['variableName']&&_0x282322['idField']&&_0x282322[_0x3842('0x2e')]){_0x2b38b1[_0x282322[_0x3842('0x32')]['toLowerCase']()]=_0x410194[_0x282322[_0x3842('0x34')]][_0x3842('0x31')]();}else if(_0x282322['type']===_0x3842('0x35')&&_0x282322[_0x3842('0x36')]&&_0x282322[_0x3842('0x36')][_0x3842('0x37')]&&_0x282322['idField']&&_0x282322['customField']){_0x2b38b1[_0x282322[_0x3842('0x32')][_0x3842('0x2f')]()]=_0x410194[_0x282322[_0x3842('0x36')][_0x3842('0x37')][_0x3842('0x2f')]()][_0x3842('0x31')]();}});}return _0x2b38b1;}function getTicket(_0x1c747a,_0x21d93a,_0x4c978b,_0x55f68b,_0x15302e,_0x403912){return function(_0x559474){logger[_0x3842('0x10')]('['+[_0x1c747a[_0x3842('0x11')]()]+_0x3842('0x38'),_0x559474);return new Promise(function(_0x53efa0,_0x15f3bc){var _0x119037=_0x1c747a[_0x3842('0x2f')]()===_0x3842('0x39')?_0x559474[_0x3842('0x1b')]:_0x559474[_0x3842('0x25')];var _0x1779c1={'method':'POST','uri':_0x4c978b+_0x3842('0x3a')+'?'+_0x403912,'body':Object['assign']({},{'active':_0x3842('0x23'),'caller_id':_0x119037,'assigned_to':_0x559474[_0x3842('0x1b')],'short_description':intUtil[_0x3842('0x3b')](_0x55f68b[_0x3842('0x3c')],_0x15302e,'\x20'),'description':intUtil[_0x3842('0x3b')](_0x55f68b[_0x3842('0x3d')],_0x15302e,'\x0a')},getCustomFields(_0x55f68b[_0x3842('0x3e')],_0x15302e)),'auth':_0x21d93a,'json':!![]};return rp(_0x1779c1)[_0x3842('0xc')](function(_0x122b43){logger[_0x3842('0x10')]('['+[_0x1c747a['toUpperCase']()]+_0x3842('0x3f'),_0x122b43['result']);_0x559474[_0x3842('0x40')]=_0x122b43[_0x3842('0xe')][_0x3842('0xf')];_0x559474[_0x3842('0x41')]=_0x122b43[_0x3842('0xe')][_0x3842('0x42')];logger[_0x3842('0x10')]('['+[_0x1c747a['toUpperCase']()]+_0x3842('0x43'),_0x559474);_0x53efa0(_0x559474);})[_0x3842('0x13')](function(_0x1fe22b){logger['error']('['+[_0x1c747a[_0x3842('0x11')]()]+']',_0x1fe22b[_0x3842('0x15')]);_0x15f3bc(_0x1fe22b[_0x3842('0x15')]);});});};}function createRemoteTag(_0x1b9009,_0x1a6b90,_0x4651a3,_0x4ca14b){return new Promise(function(_0x45c399,_0x2502e0){var _0x5896dc={'method':'POST','uri':_0x4651a3+_0x3842('0x44')+'?'+_0x4ca14b,'body':{'short_description':_0x1b9009,'global':!![],'active':!![],'name':_0x1b9009},'auth':_0x1a6b90,'json':!![]};return rp(_0x5896dc)[_0x3842('0xc')](function(_0x5ebb86){var _0x35956a=_0x5ebb86['result']['sys_id'];_0x45c399(_0x35956a);});});}function getRemoteTag(_0x4788cb,_0x2a3897,_0x2f9b45,_0xd0736e,_0x5dfab8){return new Promise(function(_0x1ea733,_0x51e445){var _0x428c2d={'method':_0x3842('0xb'),'uri':_0x2f9b45+_0x3842('0x44')+_0x3842('0x45')+_0x4788cb+'&'+_0xd0736e,'auth':_0x2a3897,'json':!![]};return rp(_0x428c2d)[_0x3842('0xc')](function(_0x17e7d1){if(_0x17e7d1[_0x3842('0xe')][_0x3842('0x1a')]>0x0){var _0x4bd9d1=_0x17e7d1[_0x3842('0xe')][0x0][_0x3842('0xf')];_0x1ea733(_0x4bd9d1);}else{return createRemoteTag(_0x4788cb,_0x2a3897,_0x2f9b45,_0xd0736e)[_0x3842('0xc')](function(_0x192278){_0x1ea733(_0x192278);});}});});}function assignTagToIncident(_0xf1af37,_0x2fc83b,_0x15914d,_0x4fa972,_0x15987e){return new Promise(function(_0x31c8ec,_0x3509d4){var _0x1ac9f8={'method':_0x3842('0x1f'),'uri':_0x15914d+_0x3842('0x46')+'?'+_0x15987e,'body':{'label':_0xf1af37,'table':_0x3842('0x3a'),'id_type':_0x3842('0x47'),'table_key':_0x4fa972[_0x3842('0x40')],'title':_0x3842('0x48')+_0x4fa972[_0x3842('0x41')],'id_display':_0x4fa972[_0x3842('0x41')]},'auth':_0x2fc83b,'json':!![]};return rp(_0x1ac9f8)['then'](function(_0x4fc380){_0x31c8ec();})[_0x3842('0x13')](function(){_0x31c8ec();});});}function manageTags(_0x155690,_0x2bd987,_0x29d29b,_0x35738c,_0x33fcdd,_0x34256f,_0x3a3b3b){return new Promise(function(_0x19f147,_0x5a15fe){var _0x23de7c=[];_0x2bd987[_0x3842('0x49')](function(_0xedc8e5){_0x23de7c['push'](getRemoteTag(_0xedc8e5,_0x29d29b,_0x35738c,_0x34256f,_0x3a3b3b));});return Promise[_0x3842('0x4a')](_0x23de7c)[_0x3842('0xc')](function(_0x431d31){if(_0x431d31['length']){logger[_0x3842('0x10')]('['+[_0x155690['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x431d31);var _0x5bc379=[];_0x431d31['forEach'](function(_0x23d1c0){_0x5bc379['push'](assignTagToIncident(_0x23d1c0,_0x29d29b,_0x35738c,_0x33fcdd,_0x34256f));});return Promise[_0x3842('0x4a')](_0x5bc379)[_0x3842('0xc')](function(){_0x19f147();})[_0x3842('0x13')](function(){_0x19f147();});}else{_0x19f147();}});});}function getTags(_0x573b3a,_0x1422b7,_0x48a472,_0x415eb3,_0x128a61,_0x5ecff5){return function(_0x1e9d1b){return new Promise(function(_0x4ca1da,_0x533a36){var _0x103f05=[];var _0xf00d19=_0x415eb3[_0x3842('0x4b')];if(_0xf00d19&&_0xf00d19['length']>0x0){_0x103f05=_[_0x3842('0x4c')](_0xf00d19,_0x3842('0x37'));}if(_0x103f05[_0x3842('0x1a')]>0x0){return manageTags(_0x573b3a,_0x103f05,_0x1422b7,_0x48a472,_0x1e9d1b,_0x128a61,_0x5ecff5)[_0x3842('0xc')](function(){_0x4ca1da(_0x1e9d1b);});}else{_0x4ca1da(_0x1e9d1b);}});};}function emit(_0x198fc3,_0x19d1cf,_0x171b92){var _0x139e8b='%26sysparm_record_target%3Dincident'+_0x3842('0x4d')+_0x3842('0x4e')+_0x3842('0x4f');var _0x338528={'uri':_0x198fc3+_0x3842('0x50')+_0x171b92+_0x139e8b};io['to'](util[_0x3842('0x51')](_0x3842('0x52'),_0x19d1cf))[_0x3842('0x53')](_0x3842('0x54'),_0x338528);}exports['cs']=function(_0x590108,_0xd58ac1,_0x9f8733,_0x14f60f,_0x29cb45,_0x54d97c,_0x5a7a7c,_0x9edcd7){var _0x50bfed={};var _0x459ccc={'user':_0x54d97c['username'],'pass':_0x54d97c[_0x3842('0x55')]};var _0x1dc848=_0x3842('0x56');var _0x43ab06=_0x3842('0x57');_0x54d97c[_0x3842('0x58')]=intUtil[_0x3842('0x59')](_0x54d97c['remoteUri']);_0x54d97c[_0x3842('0x5a')]=intUtil[_0x3842('0x59')](_0x54d97c[_0x3842('0x5a')]);var _0x1353ec=util[_0x3842('0x51')](_0x3842('0x5b'),_0x54d97c[_0x3842('0x58')]);_0x50bfed[_0x3842('0x18')]=!_['isNil'](_0x14f60f)?_0x14f60f[_0x3842('0x5c')]:null;_0x50bfed[_0x3842('0x1c')]=_0x54d97c[_0x3842('0x5c')];_0x50bfed[_0x3842('0x22')]=_0x9edcd7[_0x3842('0x2f')]()===_0x3842('0x39')?_0xd58ac1[_0x3842('0x5d')]:_0xd58ac1[_0x3842('0x5e')];_0x50bfed[_0x3842('0x5f')]=_0x9edcd7===_0x3842('0x60')||_0x9edcd7===_0x3842('0x61')?_0x3842('0x60'):_0x3842('0x39');var _0x53a194=util['format'](_0x3842('0x62'),_0x54d97c[_0x3842('0x5a')],_0xd58ac1['uniqueid'],md5(_0xd58ac1[_0x3842('0x63')]));if(_0x29cb45&&_0x29cb45[_0x3842('0x64')]){logger[_0x3842('0x10')](_0x3842('0x65'),_0x3842('0x66'));_0xd58ac1['recordingURL']=_0x53a194;}else if(_0x5a7a7c&&_0x5a7a7c[_0x3842('0x67')]&&_0x5a7a7c['recordingFormat']!==_0x3842('0x68')){logger[_0x3842('0x10')](_0x3842('0x69'),'Recording\x20is\x20enabled!');_0xd58ac1[_0x3842('0x6a')]=_0x53a194;}else{_0xd58ac1[_0x3842('0x6a')]='';}return getAdminUser(_0x9edcd7,_0x459ccc,_0x50bfed,_0x1353ec,_0x43ab06,_0x1dc848)[_0x3842('0xc')](getUser(_0x9edcd7,_0x459ccc,_0x1353ec,_0x43ab06,_0x1dc848))['then'](getEndUser(_0x9edcd7,_0x459ccc,_0x1353ec,_0x43ab06,_0x1dc848))[_0x3842('0xc')](getTicket(_0x9edcd7,_0x459ccc,_0x1353ec,_0x9f8733,_0xd58ac1,_0x43ab06))[_0x3842('0xc')](function(_0xc6bce0){logger[_0x3842('0x10')](util[_0x3842('0x51')](_0x3842('0x6b'),_0xc6bce0[_0x3842('0x40')]));logger[_0x3842('0x10')](util[_0x3842('0x51')](_0x3842('0x6c'),_0x9edcd7));if(_0x9edcd7!==_0x3842('0x61')){logger['info']('['+[_0x9edcd7[_0x3842('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x54d97c[_0x3842('0x58')],_0x14f60f['name'],_0xc6bce0['ticketId']);}})[_0x3842('0x13')](function(_0x107956){logger[_0x3842('0x14')]('['+[_0x9edcd7[_0x3842('0x11')]()]+_0x3842('0x6d'),util['inspect'](_0x107956,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index ee052ca..3bc6c38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8694=['remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','catch','error','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','POST','emit','name','getString','assigned_user_id','description','Descriptions','date_start','toISOString','slice','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','then','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','find','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','debug','[HTTP]','type','nameField','content','string','customField','custom_fields','toString','variable','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship'];(function(_0x3ea5b9,_0x1d7d1d){var _0x64d019=function(_0xfdab83){while(--_0xfdab83){_0x3ea5b9['push'](_0x3ea5b9['shift']());}};_0x64d019(++_0x1d7d1d);}(_0x8694,0x9d));var _0x4869=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x8694[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x4869('0x0'));var rp=require(_0x4869('0x1'));var BPromise=require(_0x4869('0x2'));var md5=require(_0x4869('0x3'));var util=require(_0x4869('0x4'));var Redis=require(_0x4869('0x5'));var intUtil=require(_0x4869('0x6'));var config=require(_0x4869('0x7'));var logger=require('../../../../config/logger')(_0x4869('0x8'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4869('0x9')]));var def={'method':_0x4869('0xa'),'json':!![]};function emit(_0x32fb4a,_0x2dfdb7,_0x2c7596){io['to'](_0x32fb4a)[_0x4869('0xb')](_0x2dfdb7,_0x2c7596);}function getTicket(_0x465c0a,_0x3262fc,_0x5aca54,_0x11e778,_0x49c153,_0x452c8b,_0xb0b299,_0x31af33){logger['info']('Creating\x20new\x20ticket...');var _0x3e504c=new Date();var _0x23c71b=[{'name':_0x4869('0xc'),'value':intUtil[_0x4869('0xd')](_0x11e778['Subjects'],_0x49c153,'\x20')},{'name':_0x4869('0xe'),'value':_0x3262fc['id']},{'name':'created_by','value':_0x3262fc['id']},{'name':_0x4869('0xf'),'value':intUtil[_0x4869('0xd')](_0x11e778[_0x4869('0x10')],_0x49c153,'\x0a')},{'name':_0x4869('0x11'),'value':_0x3e504c[_0x4869('0x12')]()[_0x4869('0x13')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x4869('0x14'),'value':'15'},{'name':_0x4869('0x15'),'value':_0x5aca54['id']},{'name':_0x4869('0x16'),'value':'Contacts'},{'name':_0x4869('0x17'),'value':_0x5aca54['name']},{'name':_0x4869('0x18'),'value':_0x31af33}];if(_0x452c8b[_0x4869('0x19')]){_[_0x4869('0x1a')](_0x452c8b,function(_0x1cbd7e){if(_0x49c153[_0x1cbd7e['variableName']]){_0x23c71b[_0x4869('0x1b')]({'name':_0x1cbd7e[_0x4869('0x1c')],'value':_0x49c153[_0x1cbd7e[_0x4869('0x1d')]]});}});}return request({'form':{'method':_0x4869('0x1e'),'input_type':_0x4869('0x1f'),'response_type':_0x4869('0x1f'),'rest_data':JSON[_0x4869('0x20')]({'session':_0xb0b299['id'],'module_name':_0x4869('0x21'),'name_value_list':_0x23c71b})}});}function getAuth(_0x4afb54){return util[_0x4869('0x22')](_0x4869('0x23'),new Buffer(_0x4afb54[_0x4869('0x24')]+':X')['toString']('base64'));}function getServerInfo(_0x2d39fb){return request({'form':{'method':_0x4869('0x25'),'input_type':_0x4869('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2d39fb['id']})}});}function getUser(_0xee6505,_0x21f2ba,_0x2f0692){if(!_[_0x4869('0x26')](_0x21f2ba)){logger[_0x4869('0x27')](_0x4869('0x28'),_0x21f2ba);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x4869('0x1f'),'rest_data':JSON['stringify']({'session':_0x2f0692['id'],'module_name':'Employees','query':util[_0x4869('0x22')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x21f2ba),'order_by':'','offset':'0','select_fields':['id',_0x4869('0xc'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4869('0x29')](function(_0x3a6fba){if(_0x3a6fba[_0x4869('0x2a')][_0x4869('0x19')]){var _0x1ff5ca=_['find'](_0x3a6fba[_0x4869('0x2a')],function(_0xd84d21){return _0xd84d21[_0x4869('0x2b')][_0x4869('0x2c')][_0x4869('0x2d')]===_0x21f2ba;});if(_0x1ff5ca){logger[_0x4869('0x27')](_0x4869('0x2e'));return BPromise[_0x4869('0x2f')]({'id':_0x1ff5ca[_0x4869('0x2b')]['id']['value'],'name':_0x1ff5ca[_0x4869('0x2b')][_0x4869('0xc')][_0x4869('0x2d')]});}}logger[_0x4869('0x27')](_0x4869('0x30'));return BPromise[_0x4869('0x2f')]({'id':_0x2f0692[_0x4869('0x2b')][_0x4869('0x31')][_0x4869('0x2d')],'name':_0x2f0692[_0x4869('0x2b')][_0x4869('0x2c')][_0x4869('0x2d')]});});}else{logger[_0x4869('0x27')](_0x4869('0x32'));return BPromise[_0x4869('0x2f')]({'id':_0x2f0692[_0x4869('0x2b')][_0x4869('0x31')][_0x4869('0x2d')],'name':_0x2f0692['name_value_list'][_0x4869('0x2c')][_0x4869('0x2d')]});}}function getEndUser(_0x254d81,_0x396bf2,_0x38fb97,_0x59f3ba){logger[_0x4869('0x27')](_0x4869('0x33'),_0x38fb97);return request({'form':{'method':_0x4869('0x34'),'input_type':_0x4869('0x1f'),'response_type':_0x4869('0x1f'),'rest_data':JSON[_0x4869('0x20')]({'session':_0x59f3ba['id'],'module_name':_0x4869('0x35'),'query':util[_0x4869('0x22')](_0x4869('0x36'),_0x38fb97),'order_by':'','offset':'0','select_fields':['id',_0x4869('0xc'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4869('0x29')](function(_0xced62d){if(_0xced62d[_0x4869('0x2a')][_0x4869('0x19')]){var _0x265a8f=_[_0x4869('0x37')](_0xced62d['entry_list'],function(_0x57778b){return _0x57778b['name_value_list'][_0x4869('0x38')][_0x4869('0x2d')]===_0x38fb97;});if(_0x265a8f){logger[_0x4869('0x27')](_0x4869('0x39'));return BPromise[_0x4869('0x2f')]({'id':_0x265a8f[_0x4869('0x2b')]['id']['value'],'name':_0x265a8f[_0x4869('0x2b')]['name'][_0x4869('0x2d')],'phone':_0x265a8f[_0x4869('0x2b')][_0x4869('0x38')][_0x4869('0x2d')]});}}else{logger[_0x4869('0x27')](_0x4869('0x3a'));return request({'form':{'method':_0x4869('0x1e'),'input_type':_0x4869('0x1f'),'response_type':_0x4869('0x1f'),'rest_data':JSON[_0x4869('0x20')]({'session':_0x59f3ba['id'],'module_name':_0x4869('0x35'),'name_value_list':[{'name':_0x4869('0x3b'),'value':_0x396bf2!==_0x4869('0x3c')?_0x396bf2:util[_0x4869('0x22')](_0x4869('0x3d'),_0x38fb97)},{'name':_0x4869('0x38'),'value':_0x38fb97}]})}})[_0x4869('0x29')](function(_0x2ebf04){logger[_0x4869('0x27')]('Enduser\x20created.');return BPromise[_0x4869('0x2f')]({'id':_0x2ebf04['id'],'name':_0x2ebf04[_0x4869('0x2a')][_0x4869('0x3b')][_0x4869('0x2d')],'phone':_0x2ebf04['entry_list'][_0x4869('0x38')]['value']});});}});}function request(_0x45ae38){logger[_0x4869('0x3e')](_0x4869('0x3f'),JSON[_0x4869('0x20')](_0x45ae38));return rp(_['merge'](def,_0x45ae38));}function getTags(_0x30178d,_0x2c47ed){var _0x3efea8=[];if(_0x30178d&&_0x30178d[_0x4869('0x19')]>0x0){_0x3efea8=_['map'](_0x30178d,_0x2c47ed);}return _0x3efea8;}function getCustomFields(_0xee4aa1,_0x527e82){var _0x34cac9=[];var _0x17b804={'custom_fields':[]};if(_0xee4aa1[_0x4869('0x19')]>0x0){_[_0x4869('0x1a')](_0xee4aa1,function(_0x16bacf){if(_0x16bacf[_0x4869('0x40')]==='string'&&_0x16bacf[_0x4869('0x41')]&&!_0x16bacf['customField']){_0x17b804[_0x16bacf[_0x4869('0x41')]['toLowerCase']()]=_0x16bacf[_0x4869('0x42')]['toString']();}else if(_0x16bacf['type']===_0x4869('0x43')&&_0x16bacf['idField']&&_0x16bacf[_0x4869('0x44')]){_0x17b804[_0x4869('0x45')][_0x4869('0x1b')]({'id':_0x16bacf['idField'],'value':_0x16bacf['content'][_0x4869('0x46')]()});}else if(_0x16bacf[_0x4869('0x40')]===_0x4869('0x47')&&_0x16bacf[_0x4869('0x1d')]&&_0x16bacf[_0x4869('0x1c')]&&_0x16bacf[_0x4869('0x44')]){_0x527e82[_0x16bacf['variableName']]&&_0x17b804['custom_fields'][_0x4869('0x1b')]({'id':_0x16bacf[_0x4869('0x1c')],'value':_0x527e82[_0x16bacf[_0x4869('0x1d')]][_0x4869('0x46')]()});}else if(_0x16bacf[_0x4869('0x40')]===_0x4869('0x48')&&_0x16bacf[_0x4869('0x49')]&&_0x16bacf[_0x4869('0x49')][_0x4869('0xc')]&&_0x16bacf['idField']&&_0x16bacf[_0x4869('0x44')]){_0x527e82[_0x16bacf['Variable'][_0x4869('0xc')][_0x4869('0x4a')]()]&&_0x17b804[_0x4869('0x45')]['push']({'id':_0x16bacf[_0x4869('0x1c')],'value':_0x527e82[_0x16bacf['Variable'][_0x4869('0xc')][_0x4869('0x4a')]()]['toString']()});}});}return _0x17b804;}function getConnection(_0x224890){return request({'method':_0x4869('0xa'),'form':{'method':_0x4869('0x4b'),'input_type':_0x4869('0x1f'),'response_type':_0x4869('0x1f'),'rest_data':JSON[_0x4869('0x20')]({'user_auth':{'user_name':_0x224890[_0x4869('0x4c')],'password':_0x224890[_0x4869('0x4d')],'encryption':_0x4869('0x4e')},'application':_0x4869('0x4f')})}})[_0x4869('0x29')](function(_0x38ce78){var _0x5cdb45=_0x38ce78;if(_0x5cdb45['id']){def[_0x4869('0x50')]=_0x5cdb45['id'];return BPromise[_0x4869('0x2f')](_0x5cdb45);}else{throw new Error(util['format'](_0x4869('0x51'),_0x224890['id']));}});}function setRelationship(_0x10e962,_0x30ed25,_0x52afa5,_0x93a7ca){return request({'form':{'method':_0x4869('0x52'),'input_type':'JSON','response_type':_0x4869('0x1f'),'rest_data':JSON[_0x4869('0x20')]({'session':_0x10e962['id'],'module_name':'Calls','module_id':_0x52afa5['id'],'link_field_name':_0x93a7ca,'related_ids':[_0x30ed25['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x214d80,_0x4e2074,_0x341bdc,_0x23e083,_0xde7be,_0x27a588){var _0x564423,_0x1435b8,_0x4c0b0b,_0xe5661c;_0x27a588['remoteUri']=intUtil['stripTrailingSlash'](_0x27a588[_0x4869('0x53')]);_0x27a588[_0x4869('0x54')]=intUtil[_0x4869('0x55')](_0x27a588['serverUrl']);def[_0x4869('0x56')]=util[_0x4869('0x22')](_0x4869('0x57'),_0x27a588[_0x4869('0x53')]);if(_0xde7be&&_0xde7be['monitor_format']){logger[_0x4869('0x27')](_0x4869('0x58'),_0x4869('0x59'));_0x4e2074[_0x4869('0x5a')]=util['format'](_0x4869('0x5b'),_0x27a588[_0x4869('0x54')],_0x4e2074[_0x4869('0x5c')],md5(_0x4e2074[_0x4869('0x5c')]));}else{_0x4e2074[_0x4869('0x5a')]='';}return getConnection(_0x27a588)[_0x4869('0x29')](function(_0x4b0bfa){_0xe5661c=_0x4b0bfa;return getUser(_0x27a588,_0x23e083[_0x4869('0xc')],_0xe5661c);})['then'](function(_0x175b9b){_0x564423=_0x175b9b;logger[_0x4869('0x27')](_0x4869('0x5d'),_0x564423['id']);return getEndUser(_0x27a588,_0x4e2074['calleridname'],_0x4e2074[_0x4869('0x5e')],_0xe5661c);})[_0x4869('0x29')](function(_0x224ef4){_0x1435b8=_0x224ef4;logger['info'](_0x4869('0x5f'),_0x1435b8['id']);return getTicket(_0x27a588,_0x564423,_0x1435b8,_0x341bdc,_0x4e2074,_0x341bdc[_0x4869('0x60')],_0xe5661c,_0x4869('0x61'));})[_0x4869('0x29')](function(_0x26decd){_0x4c0b0b=_0x26decd;logger[_0x4869('0x27')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x4c0b0b['id']);return setRelationship(_0xe5661c,_0x564423,_0x4c0b0b,_0x4869('0x62'));})[_0x4869('0x29')](function(){return setRelationship(_0xe5661c,_0x1435b8,_0x4c0b0b,'contacts');})[_0x4869('0x29')](function(){return getServerInfo(_0xe5661c);})[_0x4869('0x29')](function(_0x140013){var _0x150121=parseInt(_0x140013['version'][_0x4869('0x63')](0x0));var _0x5d9448=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x27a588['remoteUri'],_0x4c0b0b['id']);if(_0x150121>0x6){_0x5d9448=util[_0x4869('0x22')](_0x4869('0x64'),_0x27a588[_0x4869('0x53')],_0x4c0b0b['id']);}logger[_0x4869('0x27')]('[QUEUE]',_0x4869('0x65'));emit(util[_0x4869('0x22')]('user:%s',_0x23e083[_0x4869('0xc')]),_0x4869('0x66'),{'uri':_0x5d9448});})['catch'](function(_0x9b26fc){logger['error'](_0x4869('0x58'),JSON[_0x4869('0x20')](_0x9b26fc));});};exports['outbound']=function(_0x7acb85,_0x383343,_0x4b0bdb,_0x4439ca,_0x4d3014,_0x2e0d8d,_0x3c0dc5){var _0x170ddf,_0xab38f9,_0x87f920,_0x5819f2;_0x2e0d8d['remoteUri']=intUtil[_0x4869('0x55')](_0x2e0d8d[_0x4869('0x53')]);_0x2e0d8d['serverUrl']=intUtil['stripTrailingSlash'](_0x2e0d8d['serverUrl']);def['uri']=util[_0x4869('0x22')]('%s/service/v4_1/rest.php',_0x2e0d8d['remoteUri']);if(_0x3c0dc5&&_0x3c0dc5[_0x4869('0x67')]&&_0x3c0dc5['recordingFormat']!==_0x4869('0x68')){logger[_0x4869('0x27')](_0x4869('0x69'),'Recording\x20is\x20enabled!');_0x383343[_0x4869('0x5a')]=util[_0x4869('0x22')](_0x4869('0x5b'),_0x2e0d8d[_0x4869('0x54')],_0x383343['uniqueid'],md5(_0x383343[_0x4869('0x5c')]));}return getConnection(_0x2e0d8d)['then'](function(_0x557654){_0x5819f2=_0x557654;return getUser(_0x2e0d8d,_0x4439ca[_0x4869('0xc')],_0x5819f2);})['then'](function(_0x4de546){_0x170ddf=_0x4de546;logger[_0x4869('0x27')]('The\x20User\x20ID\x20is:',_0x170ddf['id']);return getEndUser(_0x2e0d8d,_0x383343[_0x4869('0x6a')],_0x383343[_0x4869('0x6b')],_0x5819f2);})[_0x4869('0x29')](function(_0x43110f){_0xab38f9=_0x43110f;logger[_0x4869('0x27')](_0x4869('0x5f'),_0xab38f9['id']);return getTicket(_0x2e0d8d,_0x170ddf,_0xab38f9,_0x4b0bdb,_0x383343,_0x4b0bdb['Fields'],_0x5819f2,_0x4869('0x6c'));})['then'](function(_0x48e486){_0x87f920=_0x48e486;logger[_0x4869('0x27')](_0x4869('0x6d'));logger[_0x4869('0x27')](_0x4869('0x6e'),_0x87f920['id']);return setRelationship(_0x5819f2,_0x170ddf,_0x87f920,_0x4869('0x62'));})[_0x4869('0x29')](function(){return setRelationship(_0x5819f2,_0xab38f9,_0x87f920,_0x4869('0x6f'));})[_0x4869('0x29')](function(){return getServerInfo(_0x5819f2);})[_0x4869('0x29')](function(_0x55e25e){var _0x5445c0=parseInt(_0x55e25e['version'][_0x4869('0x63')](0x0));var _0x29307a=util[_0x4869('0x22')](_0x4869('0x70'),_0x2e0d8d[_0x4869('0x53')],_0x87f920['id']);if(_0x5445c0>0x6){_0x29307a=util['format'](_0x4869('0x64'),_0x2e0d8d[_0x4869('0x53')],_0x87f920['id']);}logger[_0x4869('0x27')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4869('0x22')](_0x4869('0x71'),_0x4439ca['name']),'trigger:browser:url',{'uri':_0x29307a});})[_0x4869('0x72')](function(_0xab0150){logger[_0x4869('0x73')]('[OUTBOUND]',JSON['stringify'](_0xab0150));});};exports[_0x4869('0x74')]=function(_0xc44a43,_0x1a7cc8,_0x572300,_0x137aa7,_0x24d0bf,_0x40b401){var _0xa3e589,_0x3969a2,_0x42ad56,_0x3436f3;_0x40b401[_0x4869('0x53')]=intUtil[_0x4869('0x55')](_0x40b401['remoteUri']);_0x40b401['serverUrl']=intUtil['stripTrailingSlash'](_0x40b401['serverUrl']);def[_0x4869('0x56')]=util[_0x4869('0x22')](_0x4869('0x57'),_0x40b401['remoteUri']);if(_0x24d0bf&&_0x24d0bf[_0x4869('0x75')]){logger[_0x4869('0x27')]('['+_0x1a7cc8[_0x4869('0x76')][_0x4869('0x77')]()+']',_0x4869('0x59'));_0x1a7cc8[_0x4869('0x5a')]=util[_0x4869('0x22')](_0x4869('0x5b'),_0x40b401[_0x4869('0x54')],_0x1a7cc8[_0x4869('0x5c')],md5(_0x1a7cc8[_0x4869('0x5c')]));}else{_0x1a7cc8[_0x4869('0x5a')]='';}return getConnection(_0x40b401)[_0x4869('0x29')](function(_0x37216b){_0x3436f3=_0x37216b;if(!_[_0x4869('0x26')](_0x137aa7)){return getUser(_0x40b401,_0x137aa7[_0x4869('0xc')],_0x3436f3);}else{return getUser(_0x40b401,null,_0x3436f3);}})['then'](function(_0x443b32){_0xa3e589=_0x443b32;logger[_0x4869('0x27')]('The\x20User\x20ID\x20is:',_0xa3e589['id']);return getEndUser(_0x40b401,_0x1a7cc8['calleridname'],_0x1a7cc8[_0x4869('0x5e')],_0x3436f3);})['then'](function(_0x34a751){_0x3969a2=_0x34a751;logger['info'](_0x4869('0x5f'),_0x3969a2['id']);return getTicket(_0x40b401,_0xa3e589,_0x3969a2,_0x572300,_0x1a7cc8,_0x572300[_0x4869('0x60')],_0x3436f3,_0x4869('0x61'));})[_0x4869('0x29')](function(_0x11dee9){_0x42ad56=_0x11dee9;logger[_0x4869('0x27')](_0x4869('0x6d'));logger[_0x4869('0x27')](_0x4869('0x6e'),_0x42ad56['id']);return setRelationship(_0x3436f3,_0xa3e589,_0x42ad56,_0x4869('0x62'));})['then'](function(){return setRelationship(_0x3436f3,_0x3969a2,_0x42ad56,_0x4869('0x6f'));})[_0x4869('0x29')](function(){return getServerInfo(_0x3436f3);})[_0x4869('0x72')](function(_0x14b3d8){logger[_0x4869('0x73')]('['+_0x1a7cc8[_0x4869('0x76')][_0x4869('0x77')]()+']',JSON[_0x4869('0x20')](_0x14b3d8));});};
\ No newline at end of file
+var _0xf6ba=['Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','Calls','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','lastevent','toUpperCase','calleridnum','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','POST','info','getString','assigned_user_id','description','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','variableName','push','set_entry','JSON','stringify','format','Basic\x20%s','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then','find','entry_list','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','custom_fields','idField','content','variable'];(function(_0x30a9ba,_0xe4c82a){var _0x240dd6=function(_0x11a543){while(--_0x11a543){_0x30a9ba['push'](_0x30a9ba['shift']());}};_0x240dd6(++_0xe4c82a);}(_0xf6ba,0x18a));var _0xaf6b=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xf6ba[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var rp=require(_0xaf6b('0x0'));var BPromise=require('bluebird');var md5=require(_0xaf6b('0x1'));var util=require(_0xaf6b('0x2'));var Redis=require(_0xaf6b('0x3'));var intUtil=require('./util');var config=require(_0xaf6b('0x4'));var logger=require(_0xaf6b('0x5'))(_0xaf6b('0x6'));config[_0xaf6b('0x7')]=_['defaults'](config[_0xaf6b('0x7')],{'host':_0xaf6b('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaf6b('0x7')]));var def={'method':_0xaf6b('0x9'),'json':!![]};function emit(_0x1500af,_0x21b939,_0x4b19c7){io['to'](_0x1500af)['emit'](_0x21b939,_0x4b19c7);}function getTicket(_0x5e369d,_0x1a5430,_0x40f7db,_0x182c6b,_0x12593f,_0x25f66d,_0xf5dda0,_0x1ac12b){logger[_0xaf6b('0xa')]('Creating\x20new\x20ticket...');var _0x21bb79=new Date();var _0x38287d=[{'name':'name','value':intUtil[_0xaf6b('0xb')](_0x182c6b['Subjects'],_0x12593f,'\x20')},{'name':_0xaf6b('0xc'),'value':_0x1a5430['id']},{'name':'created_by','value':_0x1a5430['id']},{'name':_0xaf6b('0xd'),'value':intUtil[_0xaf6b('0xb')](_0x182c6b[_0xaf6b('0xe')],_0x12593f,'\x0a')},{'name':_0xaf6b('0xf'),'value':_0x21bb79['toISOString']()[_0xaf6b('0x10')](0x0,0x13)[_0xaf6b('0x11')]('T','\x20')},{'name':_0xaf6b('0x12'),'value':'0'},{'name':_0xaf6b('0x13'),'value':'15'},{'name':_0xaf6b('0x14'),'value':_0x40f7db['id']},{'name':_0xaf6b('0x15'),'value':_0xaf6b('0x16')},{'name':'parent_name','value':_0x40f7db['name']},{'name':_0xaf6b('0x17'),'value':_0x1ac12b}];if(_0x25f66d[_0xaf6b('0x18')]){_['forEach'](_0x25f66d,function(_0x122856){if(_0x12593f[_0x122856[_0xaf6b('0x19')]]){_0x38287d[_0xaf6b('0x1a')]({'name':_0x122856['idField'],'value':_0x12593f[_0x122856['variableName']]});}});}return request({'form':{'method':_0xaf6b('0x1b'),'input_type':_0xaf6b('0x1c'),'response_type':'JSON','rest_data':JSON[_0xaf6b('0x1d')]({'session':_0xf5dda0['id'],'module_name':'Calls','name_value_list':_0x38287d})}});}function getAuth(_0x233448){return util[_0xaf6b('0x1e')](_0xaf6b('0x1f'),new Buffer(_0x233448['apiKey']+':X')[_0xaf6b('0x20')]('base64'));}function getServerInfo(_0x458074){return request({'form':{'method':_0xaf6b('0x21'),'input_type':_0xaf6b('0x1c'),'response_type':_0xaf6b('0x1c'),'rest_data':JSON['stringify']({'session':_0x458074['id']})}});}function getUser(_0x7bd880,_0x538591,_0x59a4aa){if(!_[_0xaf6b('0x22')](_0x538591)){logger[_0xaf6b('0xa')](_0xaf6b('0x23'),_0x538591);return request({'form':{'method':'get_entry_list','input_type':_0xaf6b('0x1c'),'response_type':_0xaf6b('0x1c'),'rest_data':JSON['stringify']({'session':_0x59a4aa['id'],'module_name':'Employees','query':util[_0xaf6b('0x1e')](_0xaf6b('0x24'),_0x538591),'order_by':'','offset':'0','select_fields':['id',_0xaf6b('0x25'),_0xaf6b('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xaf6b('0x27')](function(_0x53495c){if(_0x53495c['entry_list']['length']){var _0x3398cc=_[_0xaf6b('0x28')](_0x53495c[_0xaf6b('0x29')],function(_0x3cfea1){return _0x3cfea1[_0xaf6b('0x2a')]['user_name'][_0xaf6b('0x2b')]===_0x538591;});if(_0x3398cc){logger[_0xaf6b('0xa')]('Agent\x20found!');return BPromise[_0xaf6b('0x2c')]({'id':_0x3398cc[_0xaf6b('0x2a')]['id'][_0xaf6b('0x2b')],'name':_0x3398cc['name_value_list'][_0xaf6b('0x25')][_0xaf6b('0x2b')]});}}logger['info'](_0xaf6b('0x2d'));return BPromise['resolve']({'id':_0x59a4aa[_0xaf6b('0x2a')][_0xaf6b('0x2e')][_0xaf6b('0x2b')],'name':_0x59a4aa['name_value_list']['user_name']['value']});});}else{logger[_0xaf6b('0xa')](_0xaf6b('0x2f'));return BPromise[_0xaf6b('0x2c')]({'id':_0x59a4aa[_0xaf6b('0x2a')]['user_id']['value'],'name':_0x59a4aa[_0xaf6b('0x2a')][_0xaf6b('0x26')][_0xaf6b('0x2b')]});}}function getEndUser(_0x1ccf67,_0x26857,_0x375900,_0x2d40c3){logger[_0xaf6b('0xa')](_0xaf6b('0x30'),_0x375900);return request({'form':{'method':_0xaf6b('0x31'),'input_type':_0xaf6b('0x1c'),'response_type':_0xaf6b('0x1c'),'rest_data':JSON[_0xaf6b('0x1d')]({'session':_0x2d40c3['id'],'module_name':'Contacts','query':util[_0xaf6b('0x1e')](_0xaf6b('0x32'),_0x375900),'order_by':'','offset':'0','select_fields':['id','name',_0xaf6b('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1332ee){if(_0x1332ee[_0xaf6b('0x29')][_0xaf6b('0x18')]){var _0x116a3a=_[_0xaf6b('0x28')](_0x1332ee['entry_list'],function(_0x1d2392){return _0x1d2392[_0xaf6b('0x2a')][_0xaf6b('0x33')][_0xaf6b('0x2b')]===_0x375900;});if(_0x116a3a){logger[_0xaf6b('0xa')](_0xaf6b('0x34'));return BPromise['resolve']({'id':_0x116a3a['name_value_list']['id'][_0xaf6b('0x2b')],'name':_0x116a3a[_0xaf6b('0x2a')][_0xaf6b('0x25')][_0xaf6b('0x2b')],'phone':_0x116a3a['name_value_list'][_0xaf6b('0x33')][_0xaf6b('0x2b')]});}}else{logger[_0xaf6b('0xa')](_0xaf6b('0x35'));return request({'form':{'method':_0xaf6b('0x1b'),'input_type':'JSON','response_type':_0xaf6b('0x1c'),'rest_data':JSON[_0xaf6b('0x1d')]({'session':_0x2d40c3['id'],'module_name':'Contacts','name_value_list':[{'name':_0xaf6b('0x36'),'value':_0x26857!==_0xaf6b('0x37')?_0x26857:util[_0xaf6b('0x1e')]('Caller\x20-\x20%s',_0x375900)},{'name':_0xaf6b('0x33'),'value':_0x375900}]})}})['then'](function(_0x342c55){logger[_0xaf6b('0xa')](_0xaf6b('0x38'));return BPromise[_0xaf6b('0x2c')]({'id':_0x342c55['id'],'name':_0x342c55[_0xaf6b('0x29')]['first_name']['value'],'phone':_0x342c55[_0xaf6b('0x29')][_0xaf6b('0x33')][_0xaf6b('0x2b')]});});}});}function request(_0x4266cf){logger[_0xaf6b('0x39')](_0xaf6b('0x3a'),JSON[_0xaf6b('0x1d')](_0x4266cf));return rp(_[_0xaf6b('0x3b')](def,_0x4266cf));}function getTags(_0x37b499,_0x4209a8){var _0x119ef2=[];if(_0x37b499&&_0x37b499[_0xaf6b('0x18')]>0x0){_0x119ef2=_[_0xaf6b('0x3c')](_0x37b499,_0x4209a8);}return _0x119ef2;}function getCustomFields(_0x194ae8,_0x15b34d){var _0x523ff7=[];var _0x50215e={'custom_fields':[]};if(_0x194ae8['length']>0x0){_[_0xaf6b('0x3d')](_0x194ae8,function(_0x150cf8){if(_0x150cf8[_0xaf6b('0x3e')]===_0xaf6b('0x3f')&&_0x150cf8[_0xaf6b('0x40')]&&!_0x150cf8['customField']){_0x50215e[_0x150cf8[_0xaf6b('0x40')]['toLowerCase']()]=_0x150cf8['content'][_0xaf6b('0x20')]();}else if(_0x150cf8[_0xaf6b('0x3e')]===_0xaf6b('0x3f')&&_0x150cf8['idField']&&_0x150cf8[_0xaf6b('0x41')]){_0x50215e[_0xaf6b('0x42')][_0xaf6b('0x1a')]({'id':_0x150cf8[_0xaf6b('0x43')],'value':_0x150cf8[_0xaf6b('0x44')][_0xaf6b('0x20')]()});}else if(_0x150cf8[_0xaf6b('0x3e')]===_0xaf6b('0x45')&&_0x150cf8[_0xaf6b('0x19')]&&_0x150cf8[_0xaf6b('0x43')]&&_0x150cf8[_0xaf6b('0x41')]){_0x15b34d[_0x150cf8[_0xaf6b('0x19')]]&&_0x50215e['custom_fields'][_0xaf6b('0x1a')]({'id':_0x150cf8[_0xaf6b('0x43')],'value':_0x15b34d[_0x150cf8[_0xaf6b('0x19')]][_0xaf6b('0x20')]()});}else if(_0x150cf8['type']==='customVariable'&&_0x150cf8[_0xaf6b('0x46')]&&_0x150cf8[_0xaf6b('0x46')][_0xaf6b('0x25')]&&_0x150cf8[_0xaf6b('0x43')]&&_0x150cf8[_0xaf6b('0x41')]){_0x15b34d[_0x150cf8['Variable'][_0xaf6b('0x25')][_0xaf6b('0x47')]()]&&_0x50215e[_0xaf6b('0x42')][_0xaf6b('0x1a')]({'id':_0x150cf8[_0xaf6b('0x43')],'value':_0x15b34d[_0x150cf8[_0xaf6b('0x46')][_0xaf6b('0x25')][_0xaf6b('0x47')]()][_0xaf6b('0x20')]()});}});}return _0x50215e;}function getConnection(_0x370b5c){return request({'method':_0xaf6b('0x9'),'form':{'method':_0xaf6b('0x48'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x370b5c[_0xaf6b('0x49')],'password':_0x370b5c[_0xaf6b('0x4a')],'encryption':_0xaf6b('0x4b')},'application':_0xaf6b('0x4c')})}})[_0xaf6b('0x27')](function(_0x18188c){var _0xc37d29=_0x18188c;if(_0xc37d29['id']){def['sessionID']=_0xc37d29['id'];return BPromise[_0xaf6b('0x2c')](_0xc37d29);}else{throw new Error(util[_0xaf6b('0x1e')](_0xaf6b('0x4d'),_0x370b5c['id']));}});}function setRelationship(_0x33a7c7,_0x355788,_0x18a9a3,_0x3de061){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0xaf6b('0x1c'),'rest_data':JSON[_0xaf6b('0x1d')]({'session':_0x33a7c7['id'],'module_name':_0xaf6b('0x4e'),'module_id':_0x18a9a3['id'],'link_field_name':_0x3de061,'related_ids':[_0x355788['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x1443b9,_0x5ad147,_0xc78cd4,_0x27d7b9,_0x245dbe,_0x2383b6){var _0x7bc816,_0x101d24,_0x47cb78,_0x22a922;_0x2383b6['remoteUri']=intUtil[_0xaf6b('0x4f')](_0x2383b6[_0xaf6b('0x50')]);_0x2383b6[_0xaf6b('0x51')]=intUtil[_0xaf6b('0x4f')](_0x2383b6[_0xaf6b('0x51')]);def[_0xaf6b('0x52')]=util[_0xaf6b('0x1e')](_0xaf6b('0x53'),_0x2383b6['remoteUri']);if(_0x245dbe&&_0x245dbe[_0xaf6b('0x54')]){logger[_0xaf6b('0xa')](_0xaf6b('0x55'),_0xaf6b('0x56'));_0x5ad147[_0xaf6b('0x57')]=util[_0xaf6b('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2383b6[_0xaf6b('0x51')],_0x5ad147['uniqueid'],md5(_0x5ad147[_0xaf6b('0x58')]));}else{_0x5ad147[_0xaf6b('0x57')]='';}return getConnection(_0x2383b6)[_0xaf6b('0x27')](function(_0x27f683){_0x22a922=_0x27f683;return getUser(_0x2383b6,_0x27d7b9[_0xaf6b('0x25')],_0x22a922);})[_0xaf6b('0x27')](function(_0x1362ec){_0x7bc816=_0x1362ec;logger['info'](_0xaf6b('0x59'),_0x7bc816['id']);return getEndUser(_0x2383b6,_0x5ad147[_0xaf6b('0x5a')],_0x5ad147['calleridnum'],_0x22a922);})[_0xaf6b('0x27')](function(_0x59f9f2){_0x101d24=_0x59f9f2;logger[_0xaf6b('0xa')](_0xaf6b('0x5b'),_0x101d24['id']);return getTicket(_0x2383b6,_0x7bc816,_0x101d24,_0xc78cd4,_0x5ad147,_0xc78cd4[_0xaf6b('0x5c')],_0x22a922,_0xaf6b('0x5d'));})[_0xaf6b('0x27')](function(_0x1633e9){_0x47cb78=_0x1633e9;logger[_0xaf6b('0xa')]('Ticket\x20created!');logger[_0xaf6b('0xa')](_0xaf6b('0x5e'),_0x47cb78['id']);return setRelationship(_0x22a922,_0x7bc816,_0x47cb78,_0xaf6b('0x5f'));})[_0xaf6b('0x27')](function(){return setRelationship(_0x22a922,_0x101d24,_0x47cb78,_0xaf6b('0x60'));})[_0xaf6b('0x27')](function(){return getServerInfo(_0x22a922);})[_0xaf6b('0x27')](function(_0x354562){var _0x4bf147=parseInt(_0x354562[_0xaf6b('0x61')][_0xaf6b('0x62')](0x0));var _0x883457=util[_0xaf6b('0x1e')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2383b6[_0xaf6b('0x50')],_0x47cb78['id']);if(_0x4bf147>0x6){_0x883457=util['format'](_0xaf6b('0x63'),_0x2383b6[_0xaf6b('0x50')],_0x47cb78['id']);}logger['info'](_0xaf6b('0x55'),_0xaf6b('0x64'));emit(util[_0xaf6b('0x1e')]('user:%s',_0x27d7b9[_0xaf6b('0x25')]),_0xaf6b('0x65'),{'uri':_0x883457});})[_0xaf6b('0x66')](function(_0x553e09){logger[_0xaf6b('0x67')](_0xaf6b('0x55'),JSON[_0xaf6b('0x1d')](_0x553e09));});};exports[_0xaf6b('0x68')]=function(_0x5e87f1,_0x1d9fc7,_0x2fda50,_0x150326,_0x210b0c,_0x2e5166,_0x1c2ea6){var _0x3d63cb,_0x5a5f59,_0x259d95,_0x4db90b;_0x2e5166[_0xaf6b('0x50')]=intUtil['stripTrailingSlash'](_0x2e5166[_0xaf6b('0x50')]);_0x2e5166['serverUrl']=intUtil[_0xaf6b('0x4f')](_0x2e5166['serverUrl']);def[_0xaf6b('0x52')]=util[_0xaf6b('0x1e')](_0xaf6b('0x53'),_0x2e5166[_0xaf6b('0x50')]);if(_0x1c2ea6&&_0x1c2ea6[_0xaf6b('0x69')]&&_0x1c2ea6[_0xaf6b('0x69')]!=='none'){logger[_0xaf6b('0xa')](_0xaf6b('0x6a'),_0xaf6b('0x56'));_0x1d9fc7[_0xaf6b('0x57')]=util[_0xaf6b('0x1e')](_0xaf6b('0x6b'),_0x2e5166['serverUrl'],_0x1d9fc7[_0xaf6b('0x58')],md5(_0x1d9fc7[_0xaf6b('0x58')]));}return getConnection(_0x2e5166)[_0xaf6b('0x27')](function(_0x4f1f06){_0x4db90b=_0x4f1f06;return getUser(_0x2e5166,_0x150326[_0xaf6b('0x25')],_0x4db90b);})['then'](function(_0x321c5a){_0x3d63cb=_0x321c5a;logger[_0xaf6b('0xa')]('The\x20User\x20ID\x20is:',_0x3d63cb['id']);return getEndUser(_0x2e5166,_0x1d9fc7[_0xaf6b('0x6c')],_0x1d9fc7[_0xaf6b('0x6d')],_0x4db90b);})[_0xaf6b('0x27')](function(_0x2c0495){_0x5a5f59=_0x2c0495;logger[_0xaf6b('0xa')](_0xaf6b('0x5b'),_0x5a5f59['id']);return getTicket(_0x2e5166,_0x3d63cb,_0x5a5f59,_0x2fda50,_0x1d9fc7,_0x2fda50[_0xaf6b('0x5c')],_0x4db90b,'Outbound');})[_0xaf6b('0x27')](function(_0x248594){_0x259d95=_0x248594;logger[_0xaf6b('0xa')](_0xaf6b('0x6e'));logger['info'](_0xaf6b('0x5e'),_0x259d95['id']);return setRelationship(_0x4db90b,_0x3d63cb,_0x259d95,_0xaf6b('0x5f'));})[_0xaf6b('0x27')](function(){return setRelationship(_0x4db90b,_0x5a5f59,_0x259d95,_0xaf6b('0x60'));})[_0xaf6b('0x27')](function(){return getServerInfo(_0x4db90b);})[_0xaf6b('0x27')](function(_0x4d7d30){var _0x20b208=parseInt(_0x4d7d30[_0xaf6b('0x61')][_0xaf6b('0x62')](0x0));var _0x526a0e=util[_0xaf6b('0x1e')](_0xaf6b('0x6f'),_0x2e5166['remoteUri'],_0x259d95['id']);if(_0x20b208>0x6){_0x526a0e=util['format'](_0xaf6b('0x63'),_0x2e5166[_0xaf6b('0x50')],_0x259d95['id']);}logger[_0xaf6b('0xa')](_0xaf6b('0x6a'),_0xaf6b('0x64'));emit(util[_0xaf6b('0x1e')](_0xaf6b('0x70'),_0x150326[_0xaf6b('0x25')]),_0xaf6b('0x65'),{'uri':_0x526a0e});})[_0xaf6b('0x66')](function(_0xb50901){logger[_0xaf6b('0x67')]('[OUTBOUND]',JSON[_0xaf6b('0x1d')](_0xb50901));});};exports['unmanaged']=function(_0x141838,_0x22776e,_0x44b4a3,_0x482687,_0x5c0363,_0x3364f0){var _0x4bb5f5,_0x5538ee,_0xd38e31,_0x44e7fe;_0x3364f0[_0xaf6b('0x50')]=intUtil['stripTrailingSlash'](_0x3364f0[_0xaf6b('0x50')]);_0x3364f0['serverUrl']=intUtil['stripTrailingSlash'](_0x3364f0[_0xaf6b('0x51')]);def['uri']=util[_0xaf6b('0x1e')]('%s/service/v4_1/rest.php',_0x3364f0[_0xaf6b('0x50')]);if(_0x5c0363&&_0x5c0363[_0xaf6b('0x54')]){logger[_0xaf6b('0xa')]('['+_0x22776e[_0xaf6b('0x71')][_0xaf6b('0x72')]()+']',_0xaf6b('0x56'));_0x22776e[_0xaf6b('0x57')]=util[_0xaf6b('0x1e')](_0xaf6b('0x6b'),_0x3364f0[_0xaf6b('0x51')],_0x22776e[_0xaf6b('0x58')],md5(_0x22776e[_0xaf6b('0x58')]));}else{_0x22776e['recordingURL']='';}return getConnection(_0x3364f0)['then'](function(_0x2933a3){_0x44e7fe=_0x2933a3;if(!_['isNil'](_0x482687)){return getUser(_0x3364f0,_0x482687[_0xaf6b('0x25')],_0x44e7fe);}else{return getUser(_0x3364f0,null,_0x44e7fe);}})['then'](function(_0x21fa0e){_0x4bb5f5=_0x21fa0e;logger[_0xaf6b('0xa')](_0xaf6b('0x59'),_0x4bb5f5['id']);return getEndUser(_0x3364f0,_0x22776e['calleridname'],_0x22776e[_0xaf6b('0x73')],_0x44e7fe);})['then'](function(_0x3d82f4){_0x5538ee=_0x3d82f4;logger[_0xaf6b('0xa')]('The\x20Enduser\x20ID\x20is:',_0x5538ee['id']);return getTicket(_0x3364f0,_0x4bb5f5,_0x5538ee,_0x44b4a3,_0x22776e,_0x44b4a3[_0xaf6b('0x5c')],_0x44e7fe,'Inbound');})[_0xaf6b('0x27')](function(_0x26a400){_0xd38e31=_0x26a400;logger[_0xaf6b('0xa')]('Ticket\x20created!');logger['info'](_0xaf6b('0x5e'),_0xd38e31['id']);return setRelationship(_0x44e7fe,_0x4bb5f5,_0xd38e31,_0xaf6b('0x5f'));})['then'](function(){return setRelationship(_0x44e7fe,_0x5538ee,_0xd38e31,_0xaf6b('0x60'));})[_0xaf6b('0x27')](function(){return getServerInfo(_0x44e7fe);})[_0xaf6b('0x66')](function(_0x234e47){logger[_0xaf6b('0x67')]('['+_0x22776e[_0xaf6b('0x71')][_0xaf6b('0x72')]()+']',JSON[_0xaf6b('0x1d')](_0x234e47));});};
\ No newline at end of file
index bfed913..db32dec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea23=['keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','test','lodash','util','length','sortBy','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xea23,0x125));var _0x3ea2=function(_0x3bf8d0,_0x3d3484){_0x3bf8d0=_0x3bf8d0-0x0;var _0x546ae1=_0xea23[_0x3bf8d0];return _0x546ae1;};'use strict';var _=require(_0x3ea2('0x0'));var util=require(_0x3ea2('0x1'));exports['getString']=function(_0x479120,_0x243075,_0x1536d0){var _0x3e6996=[];if(_0x479120[_0x3ea2('0x2')]>0x0){var _0x53b8b7=_[_0x3ea2('0x3')](_0x479120,['id']);for(var _0x19bcd2=0x0;_0x19bcd2<_0x53b8b7[_0x3ea2('0x2')];_0x19bcd2++){var _0x56f5dc=_0x53b8b7[_0x19bcd2];if(_0x56f5dc[_0x3ea2('0x4')]===_0x3ea2('0x5')){_0x3e6996[_0x3ea2('0x6')](_0x56f5dc[_0x3ea2('0x7')]);}else if(_0x56f5dc[_0x3ea2('0x4')]===_0x3ea2('0x8')&&_0x56f5dc[_0x3ea2('0x9')]){_0x243075[_0x56f5dc[_0x3ea2('0x9')]]&&_0x3e6996[_0x3ea2('0x6')](_0x243075[_0x56f5dc['variableName']][_0x3ea2('0xa')]());}else if(_0x56f5dc[_0x3ea2('0x4')]==='customVariable'&&_0x56f5dc['Variable']&&_0x56f5dc[_0x3ea2('0xb')][_0x3ea2('0xc')]){_0x243075[_0x56f5dc[_0x3ea2('0xb')][_0x3ea2('0xc')]['toLowerCase']()]&&_0x3e6996[_0x3ea2('0x6')](_0x243075[_0x56f5dc[_0x3ea2('0xb')]['name'][_0x3ea2('0xd')]()][_0x3ea2('0xa')]());}else if(_0x56f5dc[_0x3ea2('0x4')]===_0x3ea2('0xe')){if(_0x56f5dc[_0x3ea2('0xf')]==='string'&&_0x56f5dc[_0x3ea2('0x10')]){_0x3e6996[_0x3ea2('0x6')](util[_0x3ea2('0x11')](_0x3ea2('0x12'),_0x56f5dc['key'],_0x56f5dc[_0x3ea2('0x13')]));}else if(_0x56f5dc[_0x3ea2('0xf')]===_0x3ea2('0x8')&&_0x56f5dc[_0x3ea2('0x9')]&&_0x56f5dc[_0x3ea2('0x10')]){_0x243075[_0x56f5dc[_0x3ea2('0x9')]]&&_0x3e6996[_0x3ea2('0x6')](util[_0x3ea2('0x11')](_0x3ea2('0x12'),_0x56f5dc[_0x3ea2('0x10')],_0x243075[_0x56f5dc[_0x3ea2('0x9')]]));}else if(_0x56f5dc['keyType']==='customVariable'&&_0x56f5dc['Variable']&&_0x56f5dc['Variable']['name']&&_0x56f5dc[_0x3ea2('0x10')]){_0x243075[_0x56f5dc['Variable'][_0x3ea2('0xc')]['toLowerCase']()]&&_0x3e6996[_0x3ea2('0x6')](util[_0x3ea2('0x11')](_0x3ea2('0x12'),_0x56f5dc[_0x3ea2('0x10')],_0x243075[_0x56f5dc[_0x3ea2('0xb')]['name'][_0x3ea2('0xd')]()]));}}}}return _0x3e6996[_0x3ea2('0x14')](_0x1536d0);};exports[_0x3ea2('0x15')]=function(_0x2461e0){var _0x44765a=_0x2461e0[_0x3ea2('0x16')](-0x1);if(_0x44765a==='/'){_0x2461e0=_0x2461e0[_0x3ea2('0x17')](0x0,_0x2461e0[_0x3ea2('0x18')](_0x44765a));}return _0x2461e0;};exports['validateEmail']=function(_0x2e59ee){if(!_['isNil'](_0x2e59ee)&&_0x2e59ee!==''){var _0x360ccb=/^(([^<>()\[\]\\.,;:\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 _0x360ccb[_0x3ea2('0x19')](String(_0x2e59ee)[_0x3ea2('0xd')]());}else{return![];}};
\ No newline at end of file
+var _0xa8a5=['toLowerCase','keyType','string','key','keyContent','format','%s:\x20%s','stripTrailingSlash','slice','substring','validateEmail','test','lodash','util','length','sortBy','type','push','content','variable','variableName','toString','customVariable','Variable','name'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xa8a5,0x1b5));var _0x5a8a=function(_0x581af1,_0x4f02c5){_0x581af1=_0x581af1-0x0;var _0x54c22e=_0xa8a5[_0x581af1];return _0x54c22e;};'use strict';var _=require(_0x5a8a('0x0'));var util=require(_0x5a8a('0x1'));exports['getString']=function(_0x5d8a1e,_0x5de7a2,_0x2e7cf6){var _0x2c6024=[];if(_0x5d8a1e[_0x5a8a('0x2')]>0x0){var _0x5177b6=_[_0x5a8a('0x3')](_0x5d8a1e,['id']);for(var _0x12b950=0x0;_0x12b950<_0x5177b6[_0x5a8a('0x2')];_0x12b950++){var _0xbe9788=_0x5177b6[_0x12b950];if(_0xbe9788[_0x5a8a('0x4')]==='string'){_0x2c6024[_0x5a8a('0x5')](_0xbe9788[_0x5a8a('0x6')]);}else if(_0xbe9788[_0x5a8a('0x4')]===_0x5a8a('0x7')&&_0xbe9788['variableName']){_0x5de7a2[_0xbe9788[_0x5a8a('0x8')]]&&_0x2c6024[_0x5a8a('0x5')](_0x5de7a2[_0xbe9788[_0x5a8a('0x8')]][_0x5a8a('0x9')]());}else if(_0xbe9788[_0x5a8a('0x4')]===_0x5a8a('0xa')&&_0xbe9788[_0x5a8a('0xb')]&&_0xbe9788[_0x5a8a('0xb')]['name']){_0x5de7a2[_0xbe9788[_0x5a8a('0xb')]['name']['toLowerCase']()]&&_0x2c6024[_0x5a8a('0x5')](_0x5de7a2[_0xbe9788[_0x5a8a('0xb')][_0x5a8a('0xc')][_0x5a8a('0xd')]()][_0x5a8a('0x9')]());}else if(_0xbe9788[_0x5a8a('0x4')]==='keyValue'){if(_0xbe9788[_0x5a8a('0xe')]===_0x5a8a('0xf')&&_0xbe9788[_0x5a8a('0x10')]){_0x2c6024['push'](util['format']('%s:\x20%s',_0xbe9788[_0x5a8a('0x10')],_0xbe9788[_0x5a8a('0x11')]));}else if(_0xbe9788[_0x5a8a('0xe')]==='variable'&&_0xbe9788[_0x5a8a('0x8')]&&_0xbe9788[_0x5a8a('0x10')]){_0x5de7a2[_0xbe9788['variableName']]&&_0x2c6024[_0x5a8a('0x5')](util[_0x5a8a('0x12')](_0x5a8a('0x13'),_0xbe9788['key'],_0x5de7a2[_0xbe9788[_0x5a8a('0x8')]]));}else if(_0xbe9788['keyType']===_0x5a8a('0xa')&&_0xbe9788[_0x5a8a('0xb')]&&_0xbe9788[_0x5a8a('0xb')][_0x5a8a('0xc')]&&_0xbe9788[_0x5a8a('0x10')]){_0x5de7a2[_0xbe9788[_0x5a8a('0xb')][_0x5a8a('0xc')][_0x5a8a('0xd')]()]&&_0x2c6024[_0x5a8a('0x5')](util[_0x5a8a('0x12')](_0x5a8a('0x13'),_0xbe9788[_0x5a8a('0x10')],_0x5de7a2[_0xbe9788[_0x5a8a('0xb')]['name']['toLowerCase']()]));}}}}return _0x2c6024['join'](_0x2e7cf6);};exports[_0x5a8a('0x14')]=function(_0x5a4252){var _0x11855f=_0x5a4252[_0x5a8a('0x15')](-0x1);if(_0x11855f==='/'){_0x5a4252=_0x5a4252[_0x5a8a('0x16')](0x0,_0x5a4252['lastIndexOf'](_0x11855f));}return _0x5a4252;};exports[_0x5a8a('0x17')]=function(_0x42e7de){if(!_['isNil'](_0x42e7de)&&_0x42e7de!==''){var _0xe2ed6d=/^(([^<>()\[\]\\.,;:\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 _0xe2ed6d[_0x5a8a('0x18')](String(_0x42e7de)[_0x5a8a('0xd')]());}else{return![];}};
\ No newline at end of file
index 3974387..b8565cb 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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x1a1dea,_0x216818){var _0x20d48a=function(_0x2cb37c){while(--_0x2cb37c){_0x1a1dea['push'](_0x1a1dea['shift']());}};_0x20d48a(++_0x216818);}(_0x34e8,0x12c));var _0x834e=function(_0x4c2e73,_0x2ee17f){_0x4c2e73=_0x4c2e73-0x0;var _0x21a341=_0x34e8[_0x4c2e73];return _0x21a341;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});};
\ No newline at end of file
index c1499f6..09116b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3319=['error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','newTab','unmanaged','lastevent','toUpperCase','Authorization','\x20Error\x20running\x20Zendesk\x20integration','md5','util','ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','name','getString','Subjects','Descriptions','then','validateEmail','Getting\x20agent\x20with\x20email','format','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','%s/users/me.json','type:user\x20role:end-user\x20phone:%s','length','filter','first','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]','includes','string','type','customField','nameField','toLowerCase','content','picklist','custom_fields','push','idField','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2'];(function(_0x23b143,_0x4698d9){var _0x45e85c=function(_0x496b63){while(--_0x496b63){_0x23b143['push'](_0x23b143['shift']());}};_0x45e85c(++_0x4698d9);}(_0x3319,0xe1));var _0x9331=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3319[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x9331('0x0'));var util=require(_0x9331('0x1'));var Redis=require(_0x9331('0x2'));var intUtil=require(_0x9331('0x3'));var config=require(_0x9331('0x4'));var logger=require('../../../../config/logger')(_0x9331('0x5'));config[_0x9331('0x6')]=_[_0x9331('0x7')](config[_0x9331('0x6')],{'host':_0x9331('0x8'),'port':0x18eb});var io=require(_0x9331('0x9'))(new Redis(config[_0x9331('0x6')]));function emit(_0x3cb8b0,_0xb4460e,_0x54db25){io['to'](_0x3cb8b0)[_0x9331('0xa')](_0xb4460e,_0x54db25);}var headers={'Content-Type':_0x9331('0xb'),'Accept':_0x9331('0xb')};function getTicket(_0x12a99f,_0x48a9ef,_0x6c2582,_0x253a07,_0x525d12){logger[_0x9331('0xc')](_0x9331('0xd'));return request({'uri':util['format'](_0x9331('0xe'),_0x12a99f[_0x9331('0xf')]),'method':_0x9331('0x10'),'body':{'ticket':_[_0x9331('0x11')]({'requester_id':_0x6c2582['id'],'submitter_id':_0x48a9ef?_0x48a9ef['id']:undefined,'assignee_id':_0x48a9ef?_0x48a9ef['id']:undefined,'tags':getTags(_0x253a07['Tags'],_0x9331('0x12')),'subject':intUtil[_0x9331('0x13')](_0x253a07[_0x9331('0x14')],_0x525d12,'\x20'),'description':intUtil[_0x9331('0x13')](_0x253a07['Descriptions'],_0x525d12,'\x0a'),'comment':{'public':![],'body':intUtil[_0x9331('0x13')](_0x253a07[_0x9331('0x15')],_0x525d12,'\x0a')}},getCustomFields(_0x253a07['Fields'],_0x525d12))}})[_0x9331('0x16')](function(_0x409c14){logger[_0x9331('0xc')]('Ticket\x20created!');return _0x409c14['ticket'];});}function getUser(_0x5a8f94,_0x1bc95f){if(intUtil[_0x9331('0x17')](_0x1bc95f)){logger[_0x9331('0xc')](_0x9331('0x18'),_0x1bc95f);return request({'uri':util[_0x9331('0x19')]('%s/search.json',_0x5a8f94['remoteUri']),'qs':{'query':util[_0x9331('0x19')]('type:user\x20role:agent\x20email:%s',_0x1bc95f)}})[_0x9331('0x16')](function(_0x54044f){if(_0x54044f[_0x9331('0x1a')]){logger[_0x9331('0xc')](_0x9331('0x1b'));return _[_0x9331('0x1c')](_0x54044f[_0x9331('0x1d')],{'email':_0x1bc95f,'role':_0x9331('0x1e')});}else{logger['info'](_0x9331('0x1f'));return request({'uri':util[_0x9331('0x19')]('%s/users/me.json',_0x5a8f94[_0x9331('0xf')])})[_0x9331('0x16')](function(_0x6ecb31){logger[_0x9331('0xc')]('Admin\x20account\x20selected.');return _0x6ecb31[_0x9331('0x20')];});}});}else{logger['info'](_0x9331('0x1f'));return request({'uri':util[_0x9331('0x19')](_0x9331('0x21'),_0x5a8f94[_0x9331('0xf')])})[_0x9331('0x16')](function(_0x325a9f){logger[_0x9331('0xc')]('Admin\x20account\x20selected.');return _0x325a9f[_0x9331('0x20')];});}}function getEndUser(_0xc6c879,_0x54f97a,_0x149858){logger[_0x9331('0xc')]('Searching\x20enduser\x20with\x20phone',_0x149858);return request({'uri':util[_0x9331('0x19')]('%s/search.json',_0xc6c879[_0x9331('0xf')]),'qs':{'query':util[_0x9331('0x19')](_0x9331('0x22'),_0x149858)}})['then'](function(_0x41e790){var _0x3bf9a8;if(_0x41e790['results'][_0x9331('0x23')]){_0x41e790[_0x9331('0x1d')]=_[_0x9331('0x24')](_0x41e790[_0x9331('0x1d')],{'suspended':![],'role':'end-user'});if(_0x41e790['results'][_0x9331('0x23')]){_0x3bf9a8=_[_0x9331('0x25')](_0x41e790['results']);}}if(_0x3bf9a8){logger[_0x9331('0xc')]('Enduser\x20found!');return _0x3bf9a8;}else{logger['info'](_0x9331('0x26'));return request({'uri':util[_0x9331('0x19')](_0x9331('0x27'),_0xc6c879[_0x9331('0xf')]),'method':_0x9331('0x10'),'body':{'user':{'role':_0x9331('0x28'),'name':util[_0x9331('0x19')](_0x9331('0x29'),_0x54f97a||_0x149858),'phone':_0x149858}}})[_0x9331('0x16')](function(_0x1491bc){logger[_0x9331('0xc')](_0x9331('0x2a'));return _0x1491bc[_0x9331('0x20')];});}});}function getAuth(_0x1b34dd){var _0x136eb4;if(_0x1b34dd[_0x9331('0x2b')]===_0x9331('0x2c')){_0x136eb4=util[_0x9331('0x19')](_0x9331('0x2d'),_0x1b34dd[_0x9331('0x2e')],_0x1b34dd[_0x9331('0x2c')]);}else if(_0x1b34dd['authType']===_0x9331('0x2f')){_0x136eb4=util[_0x9331('0x19')]('%s/token:%s',_0x1b34dd['username'],_0x1b34dd[_0x9331('0x2f')]);}return util['format'](_0x9331('0x30'),new Buffer(_0x136eb4)[_0x9331('0x31')](_0x9331('0x32')));}function request(_0x53ee83){logger[_0x9331('0x33')](_0x9331('0x34'),JSON['stringify'](_0x53ee83));return rp(_[_0x9331('0x7')](_0x53ee83,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3794aa,_0x3539bb){var _0x3d09db=[];if(_0x3794aa&&_0x3794aa[_0x9331('0x23')]>0x0){_0x3d09db=_['map'](_0x3794aa,_0x3539bb);}return _0x3d09db;}function getCustomFields(_0x31ce16,_0x41f875){var _0x38d093=[];var _0x51c176={'custom_fields':[]};if(_0x31ce16[_0x9331('0x23')]>0x0){_['forEach'](_0x31ce16,function(_0x16009e){if(_[_0x9331('0x35')]([_0x9331('0x36'),'picklist'],_0x16009e[_0x9331('0x37')])&&_0x16009e['nameField']&&!_0x16009e[_0x9331('0x38')]){_0x51c176[_0x16009e[_0x9331('0x39')][_0x9331('0x3a')]()]=_0x16009e[_0x9331('0x3b')]['toString']();}else if(_[_0x9331('0x35')](['string',_0x9331('0x3c')],_0x16009e[_0x9331('0x37')])&&_0x16009e['idField']&&_0x16009e['customField']){_0x51c176[_0x9331('0x3d')][_0x9331('0x3e')]({'id':_0x16009e[_0x9331('0x3f')],'value':_0x16009e[_0x9331('0x3b')][_0x9331('0x31')]()});}else if(_0x16009e[_0x9331('0x37')]==='variable'&&_0x16009e['variableName']&&_0x16009e['idField']&&_0x16009e[_0x9331('0x38')]){_0x41f875[_0x16009e['variableName']]&&_0x51c176[_0x9331('0x3d')][_0x9331('0x3e')]({'id':_0x16009e[_0x9331('0x3f')],'value':_0x41f875[_0x16009e['variableName']][_0x9331('0x31')]()});}else if(_0x16009e[_0x9331('0x37')]===_0x9331('0x40')&&_0x16009e[_0x9331('0x41')]&&_0x16009e[_0x9331('0x41')][_0x9331('0x12')]&&_0x16009e[_0x9331('0x3f')]&&_0x16009e['customField']){_0x41f875[_0x16009e['Variable']['name'][_0x9331('0x3a')]()]&&_0x51c176[_0x9331('0x3d')][_0x9331('0x3e')]({'id':_0x16009e[_0x9331('0x3f')],'value':_0x41f875[_0x16009e[_0x9331('0x41')][_0x9331('0x12')][_0x9331('0x3a')]()][_0x9331('0x31')]()});}});}return _0x51c176;}exports[_0x9331('0x42')]=function(_0x100626,_0x40c630,_0x168b23,_0x4927f4,_0x496a2f,_0x19a829){var _0x1a613a,_0x2938a1;_0x19a829[_0x9331('0xf')]=intUtil[_0x9331('0x43')](_0x19a829[_0x9331('0xf')]);_0x19a829['serverUrl']=intUtil[_0x9331('0x43')](_0x19a829[_0x9331('0x44')]);if(_0x496a2f&&_0x496a2f[_0x9331('0x45')]){logger[_0x9331('0xc')](_0x9331('0x46'),_0x9331('0x47'));_0x40c630['recordingURL']=util['format'](_0x9331('0x48'),_0x19a829[_0x9331('0x44')],_0x40c630[_0x9331('0x49')],md5(_0x40c630[_0x9331('0x49')]));}else{_0x40c630[_0x9331('0x4a')]='';}headers['Authorization']=getAuth(_0x19a829);return getUser(_0x19a829,_0x4927f4[_0x9331('0x4b')])[_0x9331('0x16')](function(_0x16641e){_0x1a613a=_0x16641e;logger[_0x9331('0xc')](_0x9331('0x4c'),_0x1a613a['id']);return getEndUser(_0x19a829,_0x40c630[_0x9331('0x4d')],_0x40c630[_0x9331('0x4e')]);})['then'](function(_0x275c38){_0x2938a1=_0x275c38;logger['info'](_0x9331('0x4f'),_0x2938a1['id']);return getTicket(_0x19a829,_0x1a613a,_0x2938a1,_0x168b23,_0x40c630);})['then'](function(_0x40133e){if(_0x40133e){logger[_0x9331('0xc')](_0x9331('0x50'),_0x40133e['id']);switch(_0x19a829[_0x9331('0x37')]){case _0x9331('0x51'):logger[_0x9331('0xc')]('[QUEUE]',_0x9331('0x52'));return request({'uri':util[_0x9331('0x19')](_0x9331('0x53'),_0x19a829['remoteUri'],_0x1a613a['id'],_0x40133e['id']),'method':_0x9331('0x10')});case'newTab':logger['info'](_0x9331('0x46'),_0x9331('0x54'));emit(util[_0x9331('0x19')](_0x9331('0x55'),_0x4927f4[_0x9331('0x12')]),_0x9331('0x56'),{'uri':util[_0x9331('0x19')](_0x9331('0x57'),_0x19a829['remoteUri'][_0x9331('0x58')](_0x9331('0x59'),''),_0x40133e['id'])});break;default:logger[_0x9331('0x5a')](_0x9331('0x46'),_0x9331('0x5b'));}}})[_0x9331('0x5c')](function(_0x1cfdc3){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x9331('0x5d')](_0x1cfdc3,{'showHidden':!![],'depth':null}));});};exports[_0x9331('0x5e')]=function(_0x245e0f,_0x2f6087,_0x53ff5a,_0xa83dde,_0x26c6e4,_0x4c20ab,_0x2962a2){var _0x2705a0,_0x34999f;_0x4c20ab[_0x9331('0xf')]=intUtil['stripTrailingSlash'](_0x4c20ab[_0x9331('0xf')]);_0x4c20ab[_0x9331('0x44')]=intUtil[_0x9331('0x43')](_0x4c20ab['serverUrl']);if(_0x2962a2&&_0x2962a2[_0x9331('0x5f')]&&_0x2962a2[_0x9331('0x5f')]!==_0x9331('0x60')){logger['info'](_0x9331('0x61'),_0x9331('0x47'));_0x2f6087['recordingURL']=util['format'](_0x9331('0x48'),_0x4c20ab[_0x9331('0x44')],_0x2f6087[_0x9331('0x49')],md5(_0x2f6087[_0x9331('0x49')]));}headers['Authorization']=getAuth(_0x4c20ab);return getUser(_0x4c20ab,_0xa83dde[_0x9331('0x4b')])[_0x9331('0x16')](function(_0x651283){_0x2705a0=_0x651283;logger[_0x9331('0xc')](_0x9331('0x4c'),_0x2705a0['id']);return getEndUser(_0x4c20ab,_0x2f6087[_0x9331('0x62')],_0x2f6087['destcalleridnum']);})[_0x9331('0x16')](function(_0x4574ef){_0x34999f=_0x4574ef;logger[_0x9331('0xc')](_0x9331('0x4f'),_0x34999f['id']);return getTicket(_0x4c20ab,_0x2705a0,_0x34999f,_0x53ff5a,_0x2f6087);})[_0x9331('0x16')](function(_0x30cdae){if(_0x30cdae){logger['info'](_0x9331('0x50'),_0x30cdae['id']);switch(_0x4c20ab['type']){case'integrationTab':logger['info'](_0x9331('0x61'),_0x9331('0x52'));return request({'uri':util[_0x9331('0x19')](_0x9331('0x53'),_0x4c20ab['remoteUri'],_0x2705a0['id'],_0x30cdae['id']),'method':_0x9331('0x10')});case _0x9331('0x63'):logger[_0x9331('0xc')]('[OUTBOUND]',_0x9331('0x54'));emit(util[_0x9331('0x19')]('user:%s',_0xa83dde[_0x9331('0x12')]),_0x9331('0x56'),{'uri':util['format'](_0x9331('0x57'),_0x4c20ab[_0x9331('0xf')][_0x9331('0x58')](_0x9331('0x59'),''),_0x30cdae['id'])});break;default:logger[_0x9331('0x5a')](_0x9331('0x61'),_0x9331('0x5b'));}}})[_0x9331('0x5c')](function(_0x2bacad){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x9331('0x5d')](_0x2bacad,{'showHidden':!![],'depth':null}));});};exports[_0x9331('0x64')]=function(_0x55d5fd,_0x438671,_0xaa84fe,_0x3465bc,_0x22dd15,_0x5866b9){var _0x1e1a24,_0x1eebdc;_0x5866b9[_0x9331('0xf')]=intUtil['stripTrailingSlash'](_0x5866b9[_0x9331('0xf')]);_0x5866b9[_0x9331('0x44')]=intUtil[_0x9331('0x43')](_0x5866b9[_0x9331('0x44')]);if(_0x22dd15&&_0x22dd15[_0x9331('0x45')]){logger['info']('['+_0x438671[_0x9331('0x65')][_0x9331('0x66')]()+']',_0x9331('0x47'));_0x438671['recordingURL']=util[_0x9331('0x19')](_0x9331('0x48'),_0x5866b9['serverUrl'],_0x438671[_0x9331('0x49')],md5(_0x438671[_0x9331('0x49')]));}else{_0x438671[_0x9331('0x4a')]='';}headers[_0x9331('0x67')]=getAuth(_0x5866b9);return getUser(_0x5866b9)[_0x9331('0x16')](function(_0x13bc0d){_0x1e1a24=_0x13bc0d;logger[_0x9331('0xc')](_0x9331('0x4c'),_0x1e1a24['id']);return getEndUser(_0x5866b9,_0x438671[_0x9331('0x4d')],_0x438671[_0x9331('0x4e')]);})[_0x9331('0x16')](function(_0x16dc39){_0x1eebdc=_0x16dc39;logger[_0x9331('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1eebdc['id']);return getTicket(_0x5866b9,_0x1e1a24,_0x1eebdc,_0xaa84fe,_0x438671);})[_0x9331('0x16')](function(_0x17c3b9){if(_0x17c3b9){logger[_0x9331('0xc')](_0x9331('0x50'),_0x17c3b9['id']);}})['catch'](function(_0x28d028){logger['error']('['+_0x438671[_0x9331('0x65')][_0x9331('0x66')]()+']'+_0x9331('0x68'),util['inspect'](_0x28d028,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xdbd7=['Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','results','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','authType','%s/token:%s','username','token','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','includes','type','nameField','customField','toLowerCase','content','string','picklist','idField','custom_fields','variable','variableName','push','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','uniqueid','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','trigger:browser:url','replace','inspect','unmanaged','toUpperCase','lastevent','md5','util','../../../../config/environment','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','POST','merge'];(function(_0x1f782d,_0x5906b8){var _0x228cce=function(_0x3036cc){while(--_0x3036cc){_0x1f782d['push'](_0x1f782d['shift']());}};_0x228cce(++_0x5906b8);}(_0xdbd7,0x1b2));var _0x7dbd=function(_0x4c4327,_0x2653b0){_0x4c4327=_0x4c4327-0x0;var _0x3f77e8=_0xdbd7[_0x4c4327];return _0x3f77e8;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x7dbd('0x0'));var util=require(_0x7dbd('0x1'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x7dbd('0x2'));var logger=require('../../../../config/logger')(_0x7dbd('0x3'));config[_0x7dbd('0x4')]=_[_0x7dbd('0x5')](config[_0x7dbd('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x7dbd('0x6'))(new Redis(config[_0x7dbd('0x4')]));function emit(_0x17989c,_0x5b1910,_0x5ef6d5){io['to'](_0x17989c)[_0x7dbd('0x7')](_0x5b1910,_0x5ef6d5);}var headers={'Content-Type':'application/json','Accept':_0x7dbd('0x8')};function getTicket(_0x245d8e,_0x30a5ef,_0x5a9f0c,_0xdab5cb,_0x3750f0){logger[_0x7dbd('0x9')](_0x7dbd('0xa'));return request({'uri':util[_0x7dbd('0xb')]('%s/tickets.json',_0x245d8e['remoteUri']),'method':_0x7dbd('0xc'),'body':{'ticket':_[_0x7dbd('0xd')]({'requester_id':_0x5a9f0c['id'],'submitter_id':_0x30a5ef?_0x30a5ef['id']:undefined,'assignee_id':_0x30a5ef?_0x30a5ef['id']:undefined,'tags':getTags(_0xdab5cb[_0x7dbd('0xe')],_0x7dbd('0xf')),'subject':intUtil[_0x7dbd('0x10')](_0xdab5cb[_0x7dbd('0x11')],_0x3750f0,'\x20'),'description':intUtil['getString'](_0xdab5cb[_0x7dbd('0x12')],_0x3750f0,'\x0a'),'comment':{'public':![],'body':intUtil[_0x7dbd('0x10')](_0xdab5cb[_0x7dbd('0x12')],_0x3750f0,'\x0a')}},getCustomFields(_0xdab5cb[_0x7dbd('0x13')],_0x3750f0))}})[_0x7dbd('0x14')](function(_0x4ffd56){logger[_0x7dbd('0x9')](_0x7dbd('0x15'));return _0x4ffd56[_0x7dbd('0x16')];});}function getUser(_0x54c5b5,_0x24297e){if(intUtil[_0x7dbd('0x17')](_0x24297e)){logger[_0x7dbd('0x9')](_0x7dbd('0x18'),_0x24297e);return request({'uri':util[_0x7dbd('0xb')]('%s/search.json',_0x54c5b5['remoteUri']),'qs':{'query':util[_0x7dbd('0xb')](_0x7dbd('0x19'),_0x24297e)}})['then'](function(_0x4c2033){if(_0x4c2033[_0x7dbd('0x1a')]){logger[_0x7dbd('0x9')](_0x7dbd('0x1b'));return _[_0x7dbd('0x1c')](_0x4c2033['results'],{'email':_0x24297e,'role':_0x7dbd('0x1d')});}else{logger[_0x7dbd('0x9')](_0x7dbd('0x1e'));return request({'uri':util[_0x7dbd('0xb')](_0x7dbd('0x1f'),_0x54c5b5[_0x7dbd('0x20')])})[_0x7dbd('0x14')](function(_0x3fe808){logger[_0x7dbd('0x9')](_0x7dbd('0x21'));return _0x3fe808[_0x7dbd('0x22')];});}});}else{logger[_0x7dbd('0x9')](_0x7dbd('0x1e'));return request({'uri':util[_0x7dbd('0xb')](_0x7dbd('0x1f'),_0x54c5b5[_0x7dbd('0x20')])})[_0x7dbd('0x14')](function(_0x4cc5d7){logger[_0x7dbd('0x9')](_0x7dbd('0x21'));return _0x4cc5d7[_0x7dbd('0x22')];});}}function getEndUser(_0x3f6525,_0x56c24f,_0x2cbcbd){logger[_0x7dbd('0x9')](_0x7dbd('0x23'),_0x2cbcbd);return request({'uri':util['format'](_0x7dbd('0x24'),_0x3f6525['remoteUri']),'qs':{'query':util[_0x7dbd('0xb')](_0x7dbd('0x25'),_0x2cbcbd)}})[_0x7dbd('0x14')](function(_0x35dc25){var _0x544c18;if(_0x35dc25['results']['length']){_0x35dc25[_0x7dbd('0x26')]=_['filter'](_0x35dc25['results'],{'suspended':![],'role':_0x7dbd('0x27')});if(_0x35dc25[_0x7dbd('0x26')][_0x7dbd('0x28')]){_0x544c18=_['first'](_0x35dc25[_0x7dbd('0x26')]);}}if(_0x544c18){logger[_0x7dbd('0x9')](_0x7dbd('0x29'));return _0x544c18;}else{logger[_0x7dbd('0x9')](_0x7dbd('0x2a'));return request({'uri':util['format'](_0x7dbd('0x2b'),_0x3f6525[_0x7dbd('0x20')]),'method':'POST','body':{'user':{'role':_0x7dbd('0x27'),'name':util['format'](_0x7dbd('0x2c'),_0x56c24f||_0x2cbcbd),'phone':_0x2cbcbd}}})[_0x7dbd('0x14')](function(_0x4c22fe){logger['info'](_0x7dbd('0x2d'));return _0x4c22fe['user'];});}});}function getAuth(_0xc232cb){var _0x354c30;if(_0xc232cb['authType']===_0x7dbd('0x2e')){_0x354c30=util[_0x7dbd('0xb')](_0x7dbd('0x2f'),_0xc232cb['username'],_0xc232cb['password']);}else if(_0xc232cb[_0x7dbd('0x30')]==='token'){_0x354c30=util[_0x7dbd('0xb')](_0x7dbd('0x31'),_0xc232cb[_0x7dbd('0x32')],_0xc232cb[_0x7dbd('0x33')]);}return util[_0x7dbd('0xb')](_0x7dbd('0x34'),new Buffer(_0x354c30)[_0x7dbd('0x35')]('base64'));}function request(_0x2d2a07){logger[_0x7dbd('0x36')](_0x7dbd('0x37'),JSON[_0x7dbd('0x38')](_0x2d2a07));return rp(_['defaults'](_0x2d2a07,{'method':_0x7dbd('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x12821e,_0x28032c){var _0x549798=[];if(_0x12821e&&_0x12821e[_0x7dbd('0x28')]>0x0){_0x549798=_[_0x7dbd('0x3a')](_0x12821e,_0x28032c);}return _0x549798;}function getCustomFields(_0x1e9b0d,_0x4d21a5){var _0x353627=[];var _0xfe457d={'custom_fields':[]};if(_0x1e9b0d[_0x7dbd('0x28')]>0x0){_[_0x7dbd('0x3b')](_0x1e9b0d,function(_0x26a22b){if(_[_0x7dbd('0x3c')](['string','picklist'],_0x26a22b[_0x7dbd('0x3d')])&&_0x26a22b[_0x7dbd('0x3e')]&&!_0x26a22b[_0x7dbd('0x3f')]){_0xfe457d[_0x26a22b[_0x7dbd('0x3e')][_0x7dbd('0x40')]()]=_0x26a22b[_0x7dbd('0x41')][_0x7dbd('0x35')]();}else if(_[_0x7dbd('0x3c')]([_0x7dbd('0x42'),_0x7dbd('0x43')],_0x26a22b[_0x7dbd('0x3d')])&&_0x26a22b[_0x7dbd('0x44')]&&_0x26a22b[_0x7dbd('0x3f')]){_0xfe457d[_0x7dbd('0x45')]['push']({'id':_0x26a22b[_0x7dbd('0x44')],'value':_0x26a22b[_0x7dbd('0x41')][_0x7dbd('0x35')]()});}else if(_0x26a22b[_0x7dbd('0x3d')]===_0x7dbd('0x46')&&_0x26a22b['variableName']&&_0x26a22b['idField']&&_0x26a22b[_0x7dbd('0x3f')]){_0x4d21a5[_0x26a22b[_0x7dbd('0x47')]]&&_0xfe457d[_0x7dbd('0x45')][_0x7dbd('0x48')]({'id':_0x26a22b[_0x7dbd('0x44')],'value':_0x4d21a5[_0x26a22b['variableName']][_0x7dbd('0x35')]()});}else if(_0x26a22b['type']==='customVariable'&&_0x26a22b[_0x7dbd('0x49')]&&_0x26a22b['Variable'][_0x7dbd('0xf')]&&_0x26a22b['idField']&&_0x26a22b['customField']){_0x4d21a5[_0x26a22b[_0x7dbd('0x49')][_0x7dbd('0xf')][_0x7dbd('0x40')]()]&&_0xfe457d[_0x7dbd('0x45')]['push']({'id':_0x26a22b['idField'],'value':_0x4d21a5[_0x26a22b['Variable'][_0x7dbd('0xf')]['toLowerCase']()]['toString']()});}});}return _0xfe457d;}exports[_0x7dbd('0x4a')]=function(_0xd4ec77,_0x23efd0,_0x569806,_0x25aaa6,_0x3ae6e4,_0x1020bf){var _0x33e24d,_0x4bb53b;_0x1020bf[_0x7dbd('0x20')]=intUtil[_0x7dbd('0x4b')](_0x1020bf[_0x7dbd('0x20')]);_0x1020bf[_0x7dbd('0x4c')]=intUtil[_0x7dbd('0x4b')](_0x1020bf[_0x7dbd('0x4c')]);if(_0x3ae6e4&&_0x3ae6e4[_0x7dbd('0x4d')]){logger[_0x7dbd('0x9')](_0x7dbd('0x4e'),_0x7dbd('0x4f'));_0x23efd0[_0x7dbd('0x50')]=util[_0x7dbd('0xb')](_0x7dbd('0x51'),_0x1020bf[_0x7dbd('0x4c')],_0x23efd0['uniqueid'],md5(_0x23efd0['uniqueid']));}else{_0x23efd0['recordingURL']='';}headers['Authorization']=getAuth(_0x1020bf);return getUser(_0x1020bf,_0x25aaa6[_0x7dbd('0x52')])[_0x7dbd('0x14')](function(_0x12b8c1){_0x33e24d=_0x12b8c1;logger[_0x7dbd('0x9')](_0x7dbd('0x53'),_0x33e24d['id']);return getEndUser(_0x1020bf,_0x23efd0[_0x7dbd('0x54')],_0x23efd0[_0x7dbd('0x55')]);})[_0x7dbd('0x14')](function(_0x2adf1f){_0x4bb53b=_0x2adf1f;logger[_0x7dbd('0x9')](_0x7dbd('0x56'),_0x4bb53b['id']);return getTicket(_0x1020bf,_0x33e24d,_0x4bb53b,_0x569806,_0x23efd0);})[_0x7dbd('0x14')](function(_0x4eacdb){if(_0x4eacdb){logger[_0x7dbd('0x9')](_0x7dbd('0x57'),_0x4eacdb['id']);switch(_0x1020bf[_0x7dbd('0x3d')]){case _0x7dbd('0x58'):logger[_0x7dbd('0x9')](_0x7dbd('0x4e'),_0x7dbd('0x59'));return request({'uri':util[_0x7dbd('0xb')](_0x7dbd('0x5a'),_0x1020bf[_0x7dbd('0x20')],_0x33e24d['id'],_0x4eacdb['id']),'method':_0x7dbd('0xc')});case _0x7dbd('0x5b'):logger[_0x7dbd('0x9')](_0x7dbd('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7dbd('0xb')](_0x7dbd('0x5c'),_0x25aaa6[_0x7dbd('0xf')]),'trigger:browser:url',{'uri':util[_0x7dbd('0xb')](_0x7dbd('0x5d'),_0x1020bf[_0x7dbd('0x20')]['replace'](_0x7dbd('0x5e'),''),_0x4eacdb['id'])});break;default:logger[_0x7dbd('0x5f')](_0x7dbd('0x4e'),_0x7dbd('0x60'));}}})[_0x7dbd('0x61')](function(_0x26c446){logger[_0x7dbd('0x5f')](_0x7dbd('0x62'),util['inspect'](_0x26c446,{'showHidden':!![],'depth':null}));});};exports[_0x7dbd('0x63')]=function(_0x566309,_0x3495c6,_0x27b445,_0x59d88b,_0x4fe03a,_0x2e8235,_0x23723a){var _0x527142,_0x10a1e0;_0x2e8235['remoteUri']=intUtil['stripTrailingSlash'](_0x2e8235[_0x7dbd('0x20')]);_0x2e8235[_0x7dbd('0x4c')]=intUtil['stripTrailingSlash'](_0x2e8235[_0x7dbd('0x4c')]);if(_0x23723a&&_0x23723a['recordingFormat']&&_0x23723a[_0x7dbd('0x64')]!=='none'){logger['info']('[OUTBOUND]',_0x7dbd('0x4f'));_0x3495c6[_0x7dbd('0x50')]=util[_0x7dbd('0xb')](_0x7dbd('0x51'),_0x2e8235[_0x7dbd('0x4c')],_0x3495c6['uniqueid'],md5(_0x3495c6[_0x7dbd('0x65')]));}headers[_0x7dbd('0x66')]=getAuth(_0x2e8235);return getUser(_0x2e8235,_0x59d88b[_0x7dbd('0x52')])[_0x7dbd('0x14')](function(_0x36831a){_0x527142=_0x36831a;logger[_0x7dbd('0x9')](_0x7dbd('0x53'),_0x527142['id']);return getEndUser(_0x2e8235,_0x3495c6[_0x7dbd('0x67')],_0x3495c6[_0x7dbd('0x68')]);})[_0x7dbd('0x14')](function(_0x2568d5){_0x10a1e0=_0x2568d5;logger[_0x7dbd('0x9')]('The\x20Enduser\x20ID\x20is:',_0x10a1e0['id']);return getTicket(_0x2e8235,_0x527142,_0x10a1e0,_0x27b445,_0x3495c6);})[_0x7dbd('0x14')](function(_0x262780){if(_0x262780){logger['info'](_0x7dbd('0x57'),_0x262780['id']);switch(_0x2e8235[_0x7dbd('0x3d')]){case'integrationTab':logger[_0x7dbd('0x9')](_0x7dbd('0x69'),_0x7dbd('0x59'));return request({'uri':util[_0x7dbd('0xb')](_0x7dbd('0x5a'),_0x2e8235[_0x7dbd('0x20')],_0x527142['id'],_0x262780['id']),'method':_0x7dbd('0xc')});case'newTab':logger[_0x7dbd('0x9')](_0x7dbd('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7dbd('0xb')]('user:%s',_0x59d88b[_0x7dbd('0xf')]),_0x7dbd('0x6a'),{'uri':util[_0x7dbd('0xb')](_0x7dbd('0x5d'),_0x2e8235[_0x7dbd('0x20')][_0x7dbd('0x6b')](_0x7dbd('0x5e'),''),_0x262780['id'])});break;default:logger[_0x7dbd('0x5f')](_0x7dbd('0x69'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x7dbd('0x61')](function(_0x1e5120){logger[_0x7dbd('0x5f')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x7dbd('0x6c')](_0x1e5120,{'showHidden':!![],'depth':null}));});};exports[_0x7dbd('0x6d')]=function(_0x3eee6b,_0x3ae2cb,_0x5527f5,_0x41927f,_0xdd1e3c,_0x4e8583){var _0x51a2bc,_0x300fb5;_0x4e8583['remoteUri']=intUtil['stripTrailingSlash'](_0x4e8583[_0x7dbd('0x20')]);_0x4e8583[_0x7dbd('0x4c')]=intUtil[_0x7dbd('0x4b')](_0x4e8583[_0x7dbd('0x4c')]);if(_0xdd1e3c&&_0xdd1e3c[_0x7dbd('0x4d')]){logger['info']('['+_0x3ae2cb['lastevent'][_0x7dbd('0x6e')]()+']',_0x7dbd('0x4f'));_0x3ae2cb[_0x7dbd('0x50')]=util[_0x7dbd('0xb')](_0x7dbd('0x51'),_0x4e8583[_0x7dbd('0x4c')],_0x3ae2cb['uniqueid'],md5(_0x3ae2cb[_0x7dbd('0x65')]));}else{_0x3ae2cb[_0x7dbd('0x50')]='';}headers[_0x7dbd('0x66')]=getAuth(_0x4e8583);return getUser(_0x4e8583)[_0x7dbd('0x14')](function(_0x19032f){_0x51a2bc=_0x19032f;logger['info']('The\x20User\x20ID\x20is:',_0x51a2bc['id']);return getEndUser(_0x4e8583,_0x3ae2cb[_0x7dbd('0x54')],_0x3ae2cb[_0x7dbd('0x55')]);})['then'](function(_0x5b9a8e){_0x300fb5=_0x5b9a8e;logger[_0x7dbd('0x9')](_0x7dbd('0x56'),_0x300fb5['id']);return getTicket(_0x4e8583,_0x51a2bc,_0x300fb5,_0x5527f5,_0x3ae2cb);})['then'](function(_0x3c7309){if(_0x3c7309){logger[_0x7dbd('0x9')](_0x7dbd('0x57'),_0x3c7309['id']);}})[_0x7dbd('0x61')](function(_0x51029d){logger['error']('['+_0x3ae2cb[_0x7dbd('0x6f')][_0x7dbd('0x6e')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x7dbd('0x6c')](_0x51029d,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 5fdac3b..04765a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca7d=['SUCCESS','startCase','The\x20failing\x20result\x20is','log','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','format','mm:ss','answertime','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','details','err','queue','host','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:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','monitor_format','lastevent','toUpperCase','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','debug','stringify','length','forEach','string','picklist','idField','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','clientSecret','then','seconds','error','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca7d,0x182));var _0xdca7=function(_0x7daa25,_0x418f72){_0x7daa25=_0x7daa25-0x0;var _0xe33d6e=_0xca7d[_0x7daa25];return _0xe33d6e;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xdca7('0x0'));var util=require(_0xdca7('0x1'));var intUtil=require(_0xdca7('0x2'));var moment=require(_0xdca7('0x3'));var Redis=require(_0xdca7('0x4'));var BPromise=require(_0xdca7('0x5'));var config=require(_0xdca7('0x6'));var logger=require(_0xdca7('0x7'))(_0xdca7('0x8'));config['redis']=_['defaults'](config[_0xdca7('0x9')],{'host':_0xdca7('0xa'),'port':0x18eb});var io=require(_0xdca7('0xb'))(new Redis(config[_0xdca7('0x9')]));function emit(_0x26acca,_0x5530fc,_0x8375cc){io['to'](_0x26acca)['emit'](_0x5530fc,_0x8375cc);}function request(_0x30500d){logger[_0xdca7('0xc')]('[HTTP]',JSON[_0xdca7('0xd')](_0x30500d));return rp(_0x30500d);}function getCustomFields(_0xea991,_0xf1b550){var _0x42bb4a={};if(_0xea991[_0xdca7('0xe')]>0x0){_[_0xdca7('0xf')](_0xea991,function(_0x42c63b){if(_['includes']([_0xdca7('0x10'),_0xdca7('0x11')],_0x42c63b['type'])&&_0x42c63b['idField']){_0x42bb4a[_0x42c63b[_0xdca7('0x12')]]=_0x42c63b['content']['toString']();}else if(_0x42c63b[_0xdca7('0x13')]===_0xdca7('0x14')&&_0x42c63b['variableName']&&_0x42c63b[_0xdca7('0x12')]&&_0xf1b550[_0x42c63b[_0xdca7('0x15')]]){_0x42bb4a[_0x42c63b['idField']]=_0xf1b550[_0x42c63b['variableName']][_0xdca7('0x16')]();}else if(_0x42c63b[_0xdca7('0x13')]===_0xdca7('0x17')&&_0x42c63b['Variable']&&_0x42c63b[_0xdca7('0x18')][_0xdca7('0x19')]&&_0x42c63b[_0xdca7('0x12')]&&_0xf1b550[_0x42c63b['Variable'][_0xdca7('0x19')][_0xdca7('0x1a')]()]){_0x42bb4a[_0x42c63b['idField']]=_0xf1b550[_0x42c63b[_0xdca7('0x18')][_0xdca7('0x19')][_0xdca7('0x1a')]()][_0xdca7('0x16')]();}});}return _0x42bb4a;}function getName(_0x20e773){if(_0x20e773['indexOf']('\x20')>0x0){var _0x3a6441=_0x20e773['split'](/ (.+)/);if(_0x3a6441[0x1]){return _0x3a6441;}}return[_0x20e773,_0x20e773];}var accountsTokens={};function getAccessToken(_0x5e66a5){return new Promise(function(_0x5586c3,_0x1812c6){if(!_[_0xdca7('0x1b')](accountsTokens[_0x5e66a5['id']])&&!_['isNil'](accountsTokens[_0x5e66a5['id']][_0xdca7('0x1c')])){if(moment()[_0xdca7('0x1d')](accountsTokens[_0x5e66a5['id']][_0xdca7('0x1e')])){_0x5586c3(accountsTokens[_0x5e66a5['id']]['access_token']);}}var _0x4df375;switch(_0x5e66a5[_0xdca7('0x1f')]){case'US':_0x4df375=_0xdca7('0x20');break;case'AU':_0x4df375=_0xdca7('0x21');break;case'EU':_0x4df375=_0xdca7('0x22');break;case'IN':_0x4df375='https://accounts.zoho.in';break;case'CN':_0x4df375=_0xdca7('0x23');break;default:_0x4df375=_0xdca7('0x22');break;}var _0x566aff={'method':_0xdca7('0x24'),'uri':_0x4df375+'/oauth/v2/token','qs':{'refresh_token':_0x5e66a5['refreshToken'],'client_id':_0x5e66a5['clientId'],'client_secret':_0x5e66a5[_0xdca7('0x25')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x566aff)[_0xdca7('0x26')](function(_0x126195){accountsTokens[_0x5e66a5['id']]={'access_token':_0x126195['access_token'],'expires_in':moment()['add'](_0x126195['expires_in'],_0xdca7('0x27'))};_0x5586c3(_0x126195[_0xdca7('0x1c')]);})['catch'](function(_0x1dd13e){logger[_0xdca7('0x28')]('Failing\x20creating\x20the\x20access_token',_0x1dd13e['stack']);_0x1812c6(_0x1dd13e);});});}function getUser(_0x2f5c23,_0x5caaf5,_0x284bac,_0x17c602){logger[_0xdca7('0x29')](_0xdca7('0x2a'));return request({'method':_0xdca7('0x2b'),'uri':util['format'](_0xdca7('0x2c'),_0x5caaf5),'qs':{'type':_0xdca7('0x2d')},'headers':{'Authorization':_0xdca7('0x2e')+_0x2f5c23},'json':!![]})[_0xdca7('0x26')](function(_0x1d311){if(_0x1d311[_0xdca7('0x2f')]){var _0x4caf0b=-0x1;if(_[_0xdca7('0x30')](_0x1d311[_0xdca7('0x2f')])){if(!_[_0xdca7('0x1b')](_0x17c602)){_0x4caf0b=_[_0xdca7('0x31')](_0x1d311['users'],function(_0xb4a2c6){return _0xb4a2c6[_0xdca7('0x32')]===_0x17c602;});}if(_0x4caf0b>=0x0){logger[_0xdca7('0x29')](_0xdca7('0x33'));}else{logger[_0xdca7('0x29')](_0xdca7('0x34'));_0x4caf0b=_['findIndex'](_0x1d311[_0xdca7('0x2f')],function(_0x55c478){return _0x55c478[_0xdca7('0x35')][_0xdca7('0x19')]===_0xdca7('0x36');});}return _0x1d311[_0xdca7('0x2f')][_0x4caf0b];}else{if(_0x1d311[_0xdca7('0x37')][_0xdca7('0x35')][_0xdca7('0x19')]===_0xdca7('0x36')){logger['info'](_0xdca7('0x34'));user=_0x1d311[_0xdca7('0x37')];return user;}else{logger[_0xdca7('0x28')]('The\x20failing\x20result\x20is',JSON[_0xdca7('0xd')](_0x1d311));throw new Error(_0xdca7('0x38')+JSON[_0xdca7('0xd')](_0x1d311));}}}else{logger[_0xdca7('0x28')]('The\x20failing\x20result\x20is',JSON[_0xdca7('0xd')](_0x1d311));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x1d311));}})[_0xdca7('0x39')](function(_0x130d3c){console[_0xdca7('0x28')](_0x130d3c);});}function getZohoUser(_0x51258e,_0x382b11){return new BPromise(function(_0x3ac139,_0x66a46a){request(_0x51258e)[_0xdca7('0x26')](function(_0x396ba4){var _0x386aab=null;if(_0x396ba4){_0x386aab=_0x396ba4[_0xdca7('0x3a')][0x0];_0x386aab[_0xdca7('0x3b')]=_0x382b11;}_0x3ac139(_0x386aab);})[_0xdca7('0x39')](function(_0x53db26){_0x66a46a(_0x53db26);});});}function createEndUser(_0x52740d,_0x557eb0,_0x3c05bb,_0x3a6d21,_0x7efa41,_0x2767e4){var _0x3c05bb=getName(_0x3c05bb);return request({'method':'POST','uri':_0xdca7('0x3c')+_0x557eb0+_0xdca7('0x3d')+_['startCase'](_0x2767e4[_0xdca7('0x3e')])+'s','body':{'data':[{'Last_Name':_0x3c05bb[0x1],'First_Name':_0x3c05bb[0x0],'Phone':_0x3a6d21,'Owner':{'name':!_[_0xdca7('0x1b')](_0x7efa41[_0xdca7('0x3f')]['name'])?_0x7efa41[_0xdca7('0x3f')][_0xdca7('0x19')]:!_[_0xdca7('0x1b')](_0x7efa41[_0xdca7('0x40')])?_0x7efa41[_0xdca7('0x40')]+'\x20'+_0x7efa41[_0xdca7('0x41')]:_0x7efa41[_0xdca7('0x41')],'id':_0x7efa41['id']}}]},'headers':{'Authorization':_0xdca7('0x2e')+_0x52740d},'json':!![]})[_0xdca7('0x26')](function(_0x526b98){if(_0x526b98&&_0x526b98[_0xdca7('0x3a')][0x0][_0xdca7('0x42')]===_0xdca7('0x43')){var _0x1172a6=_0x526b98['data'][0x0]['details'];_0x1172a6['enduserType']=_[_0xdca7('0x44')](_0x2767e4[_0xdca7('0x3e')])+'s';return _0x1172a6;}logger[_0xdca7('0x28')](_0xdca7('0x45'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0xdca7('0xd')](data));})['catch'](function(_0x415019){console[_0xdca7('0x46')]('CREATE\x20ERROR',_0x415019);});}function getEndUser(_0x4b6709,_0x42408a,_0x1101a2,_0x401e3e,_0x4535a3,_0x3f0b1d,_0x248b5e){var _0x481232={'method':_0xdca7('0x2b'),'uri':'','headers':{'Authorization':_0xdca7('0x2e')+_0x4b6709},'json':!![]};switch(_0x248b5e['moduleSearch']){case _0xdca7('0x47'):_0x481232['uri']=_0xdca7('0x3c')+_0x42408a+_0xdca7('0x48')+_0x4535a3+'))';return getZohoUser(_0x481232,_0xdca7('0x49'))['then'](function(_0x4de651){if(_0x4de651)return _0x4de651;_0x481232[_0xdca7('0x4a')]='https://www.zohoapis.'+_0x42408a+_0xdca7('0x4b')+_0x4535a3+'))';return getZohoUser(_0x481232,_0xdca7('0x4c'))['then'](function(_0xe479ab){if(_0xe479ab)return _0xe479ab;if(_0x248b5e[_0xdca7('0x3e')]!=_0xdca7('0x4d')){return createEndUser(_0x4b6709,_0x42408a,_0x401e3e,_0x4535a3,_0x3f0b1d,_0x248b5e);}else{return{};}});});break;case _0xdca7('0x4e'):_0x481232['uri']=_0xdca7('0x3c')+_0x42408a+_0xdca7('0x48')+_0x4535a3+'))';return getZohoUser(_0x481232,'Contacts')['then'](function(_0x4f6886){if(_0x4f6886)return _0x4f6886;if(_0x248b5e[_0xdca7('0x3e')]!=_0xdca7('0x4d')){return createEndUser(_0x4b6709,_0x42408a,_0x401e3e,_0x4535a3,_0x3f0b1d,_0x248b5e);}else{return{};}});break;case _0xdca7('0x4f'):_0x481232[_0xdca7('0x4a')]='https://www.zohoapis.'+_0x42408a+_0xdca7('0x4b')+_0x4535a3+'))';return getZohoUser(_0x481232,_0xdca7('0x4c'))[_0xdca7('0x26')](function(_0x1a324c){if(_0x1a324c)return _0x1a324c;if(_0x248b5e[_0xdca7('0x3e')]!=_0xdca7('0x4d')){return createEndUser(_0x4b6709,_0x42408a,_0x401e3e,_0x4535a3,_0x3f0b1d,_0x248b5e);}else{return{};}});break;}}function getCall(_0x1595d5,_0x5dca9d,_0x16d37a,_0x4ef0fd,_0x19d182,_0x16a695,_0x26041c,_0x421ec7){logger[_0xdca7('0x29')](_0xdca7('0x50'));var _0x2afe56={};_0x2afe56[_0xdca7('0x51')]={'name':!_[_0xdca7('0x1b')](_0x4ef0fd[_0xdca7('0x3f')][_0xdca7('0x19')])&&!_['isNil'](_0x4ef0fd[_0xdca7('0x35')][_0xdca7('0x19')])&&_0x4ef0fd[_0xdca7('0x35')][_0xdca7('0x19')]===_0xdca7('0x52')?_0x4ef0fd[_0xdca7('0x3f')]['name']:!_['isNil'](_0x4ef0fd[_0xdca7('0x40')])?_0x4ef0fd[_0xdca7('0x40')]+'\x20'+_0x4ef0fd[_0xdca7('0x41')]:_0x4ef0fd[_0xdca7('0x41')],'id':_0x4ef0fd['id']};_0x2afe56['Subject']=intUtil[_0xdca7('0x53')](_0x16a695[_0xdca7('0x54')],_0x26041c,'\x20');_0x2afe56[_0xdca7('0x55')]=intUtil[_0xdca7('0x53')](_0x16a695[_0xdca7('0x56')],_0x26041c,'\x0a');if(_0x19d182[_0xdca7('0x3b')]===_0xdca7('0x49')){_0x2afe56[_0xdca7('0x57')]={'name':!_[_0xdca7('0x1b')](_0x19d182[_0xdca7('0x58')])?_0x19d182[_0xdca7('0x58')]:!_[_0xdca7('0x1b')](_0x19d182[_0xdca7('0x59')])?_0x19d182['First_Name']+'\x20'+_0x19d182[_0xdca7('0x5a')]:_0x19d182[_0xdca7('0x5a')],'id':_0x19d182['id']};}if(_0x19d182['enduserType']===_0xdca7('0x4c')){_0x2afe56[_0xdca7('0x5b')]={'name':!_[_0xdca7('0x1b')](_0x19d182[_0xdca7('0x58')])?_0x19d182[_0xdca7('0x58')]:!_[_0xdca7('0x1b')](_0x19d182[_0xdca7('0x59')])?_0x19d182[_0xdca7('0x59')]+'\x20'+_0x19d182[_0xdca7('0x5a')]:_0x19d182['Last_Name'],'id':_0x19d182['id']};_0x2afe56['$se_module']=_[_0xdca7('0x44')](_0x19d182[_0xdca7('0x3b')]);}if(_0x26041c[_0xdca7('0x5c')]){_0x2afe56[_0xdca7('0x5d')]=moment[_0xdca7('0x5e')](parseInt(_0x26041c['talktime'])*0x3e8)[_0xdca7('0x5f')](_0xdca7('0x60'));}else if(_0x26041c[_0xdca7('0x61')]&&_0x26041c['endtime']){_0x2afe56['Call_Duration']=moment[_0xdca7('0x5e')](moment(_0x26041c['endtime'],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x26041c[_0xdca7('0x62')],_0xdca7('0x63'))))['format'](_0xdca7('0x60'));}switch(_0x26041c['lastevent']){case _0xdca7('0x64'):_0x2afe56[_0xdca7('0x65')]=_0xdca7('0x66');break;case _0xdca7('0x67'):case _0xdca7('0x68'):_0x2afe56[_0xdca7('0x65')]=_0xdca7('0x69');break;case _0xdca7('0x6a'):_0x2afe56[_0xdca7('0x65')]=_0xdca7('0x6b');break;case _0xdca7('0x6c'):_0x2afe56['Call_Result']=_0xdca7('0x6d');break;case _0xdca7('0x6e'):_0x2afe56[_0xdca7('0x65')]=_0xdca7('0x6f');default:}_0x2afe56['Call_Start_Time']=(_0x421ec7===_0xdca7('0x70')?moment(_0x26041c[_0xdca7('0x62')])[_0xdca7('0x5f')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x26041c[_0xdca7('0x71')])[_0xdca7('0x5f')](_0xdca7('0x63')))||moment()[_0xdca7('0x5f')]('YYYY-MM-DDTHH:mm:ss');_0x2afe56[_0xdca7('0x72')]=_0x421ec7||_0xdca7('0x73');_0x2afe56=_[_0xdca7('0x74')](_0x2afe56,getCustomFields(_0x16a695[_0xdca7('0x75')],_0x26041c));return request({'method':_0xdca7('0x24'),'uri':_0xdca7('0x3c')+_0x5dca9d+'/crm/v2/Calls','headers':{'Authorization':_0xdca7('0x2e')+_0x1595d5},'body':{'data':[_0x2afe56]},'json':!![]})[_0xdca7('0x26')](function(_0x2de2bd){if(_0x2de2bd&&_0x2de2bd[_0xdca7('0x3a')][0x0][_0xdca7('0x42')]===_0xdca7('0x43')){logger['info'](_0xdca7('0x76'));return{'id':_0x2de2bd[_0xdca7('0x3a')][0x0][_0xdca7('0x77')]['id']};}})[_0xdca7('0x39')](function(_0x4292fa){logger[_0xdca7('0x29')](_0xdca7('0x78'),_0x4292fa['stack']);console[_0xdca7('0x46')](_0xdca7('0x78'),_0x4292fa);});}exports[_0xdca7('0x79')]=function(_0x4f9f0e,_0x1187dd,_0x26fc13,_0x48026d,_0x1bdd94,_0x5c3d6a){var _0xe9c0b0,_0x5acc08,_0xeef913;_0x5c3d6a[_0xdca7('0x7a')]=intUtil['stripTrailingSlash'](_0x5c3d6a['host']);_0x5c3d6a[_0xdca7('0x7b')]=intUtil['stripTrailingSlash'](_0x5c3d6a[_0xdca7('0x7b')]);if(_0x1bdd94&&_0x1bdd94['monitor_format']){logger[_0xdca7('0x29')](_0xdca7('0x7c'),_0xdca7('0x7d'));_0x1187dd[_0xdca7('0x7e')]=_0x5c3d6a['serverUrl']+_0xdca7('0x7f')+_0x1187dd[_0xdca7('0x80')]+_0xdca7('0x81')+md5(_0x1187dd[_0xdca7('0x80')]);}else{_0x1187dd[_0xdca7('0x7e')]='';}var _0x10bda4=_0x5c3d6a[_0xdca7('0x7a')]===_0xdca7('0x82')?'eu':_0xdca7('0x83');return getAccessToken(_0x5c3d6a)[_0xdca7('0x26')](function(_0x3ff2b9){_0xeef913=_0x3ff2b9;return getUser(_0xeef913,_0x10bda4,_0x5c3d6a,_0x48026d['email']);})[_0xdca7('0x26')](function(_0x5a2cd2){_0xe9c0b0=_0x5a2cd2;logger[_0xdca7('0x29')](_0xdca7('0x84'),_0xe9c0b0['id']);return getEndUser(_0xeef913,_0x10bda4,_0x5c3d6a,_0x1187dd[_0xdca7('0x85')],_0x1187dd[_0xdca7('0x86')],_0xe9c0b0,_0x26fc13);})[_0xdca7('0x26')](function(_0x12ce22){_0x5acc08=_0x12ce22;return getCall(_0xeef913,_0x10bda4,_0x5c3d6a,_0xe9c0b0,_0x5acc08,_0x26fc13,_0x1187dd,_0xdca7('0x73'));})[_0xdca7('0x26')](function(_0x5376c0){if(_0x5376c0){logger[_0xdca7('0x29')](_0xdca7('0x87'),_0x5376c0['id']);logger[_0xdca7('0x29')](_0xdca7('0x7c'),_0xdca7('0x88'));emit(util[_0xdca7('0x5f')](_0xdca7('0x89'),_0x48026d[_0xdca7('0x19')]),'trigger:browser:url',{'uri':_0xdca7('0x8a')+_0x5c3d6a[_0xdca7('0x7a')]+_0xdca7('0x8b')+_0x5376c0['id']});}})[_0xdca7('0x39')](function(_0x2ecea6){logger['error']('[QUEUE]',JSON['stringify'](_0x2ecea6));});};exports[_0xdca7('0x70')]=function(_0x35d6bd,_0x448ba3,_0x8ba4af,_0x98143e,_0x4cd8c5,_0x9ed435,_0x1f60b8){var _0xbefad,_0x4799a1,_0x5f2654;_0x9ed435['host']=intUtil[_0xdca7('0x8c')](_0x9ed435[_0xdca7('0x7a')]);_0x9ed435[_0xdca7('0x7b')]=intUtil['stripTrailingSlash'](_0x9ed435[_0xdca7('0x7b')]);if(_0x1f60b8&&_0x1f60b8[_0xdca7('0x8d')]&&_0x1f60b8[_0xdca7('0x8d')]!==_0xdca7('0x8e')){logger[_0xdca7('0x29')](_0xdca7('0x8f'),'Recording\x20is\x20enabled!');_0x448ba3[_0xdca7('0x7e')]=_0x9ed435[_0xdca7('0x7b')]+'/api/voice/recordings/'+_0x448ba3[_0xdca7('0x80')]+_0xdca7('0x81')+md5(_0x448ba3['uniqueid']);}var _0x41c8b2=_0x9ed435['host']===_0xdca7('0x82')?'eu':_0xdca7('0x83');return getAccessToken(_0x9ed435)['then'](function(_0x544da1){_0x5f2654=_0x544da1;return getUser(_0x5f2654,_0x41c8b2,_0x9ed435,_0x98143e[_0xdca7('0x32')]);})[_0xdca7('0x26')](function(_0x344b34){_0xbefad=_0x344b34;logger['info'](_0xdca7('0x84'),_0xbefad['id']);return getEndUser(_0x5f2654,_0x41c8b2,_0x9ed435,_0x448ba3[_0xdca7('0x90')],_0x448ba3[_0xdca7('0x91')],_0xbefad,_0x8ba4af);})[_0xdca7('0x26')](function(_0xaccc4d){_0x4799a1=_0xaccc4d;return getCall(_0x5f2654,_0x41c8b2,_0x9ed435,_0xbefad,_0x4799a1,_0x8ba4af,_0x448ba3,_0xdca7('0x92'));})[_0xdca7('0x26')](function(_0x37dc4b){if(_0x37dc4b){logger['info'](_0xdca7('0x87'),_0x37dc4b['id']);logger[_0xdca7('0x29')](_0xdca7('0x8f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xdca7('0x89'),_0x98143e['name']),_0xdca7('0x93'),{'uri':'https://crm.'+_0x9ed435[_0xdca7('0x7a')]+'/crm/EntityInfo.do?module=Calls&id='+_0x37dc4b['id']});}})[_0xdca7('0x39')](function(_0x4ff5b){logger[_0xdca7('0x28')](_0xdca7('0x8f'),JSON[_0xdca7('0xd')](_0x4ff5b));});};exports['unmanaged']=function(_0x25dcfb,_0x1e117b,_0x3e254e,_0x41f1ee,_0x264fd5,_0x11ff0c){var _0x16a55e,_0x2131f5,_0x26997a;_0x11ff0c[_0xdca7('0x7a')]=intUtil[_0xdca7('0x8c')](_0x11ff0c[_0xdca7('0x7a')]);_0x11ff0c[_0xdca7('0x7b')]=intUtil[_0xdca7('0x8c')](_0x11ff0c['serverUrl']);if(_0x264fd5&&_0x264fd5[_0xdca7('0x94')]){logger[_0xdca7('0x29')]('['+_0x1e117b[_0xdca7('0x95')]['toUpperCase']()+']',_0xdca7('0x7d'));_0x1e117b['recordingURL']=_0x11ff0c[_0xdca7('0x7b')]+_0xdca7('0x7f')+_0x1e117b[_0xdca7('0x80')]+_0xdca7('0x81')+md5(_0x1e117b[_0xdca7('0x80')]);}else{_0x1e117b[_0xdca7('0x7e')]='';}var _0x2ab7ed=_0x11ff0c[_0xdca7('0x7a')]==='zoho.eu'?'eu':_0xdca7('0x83');return getAccessToken(_0x11ff0c)[_0xdca7('0x26')](function(_0x321a39){_0x26997a=_0x321a39;return getUser(_0x26997a,_0x2ab7ed,_0x11ff0c);})['then'](function(_0x2618a8){_0x16a55e=_0x2618a8;logger[_0xdca7('0x29')](_0xdca7('0x84'),_0x16a55e['id']);return getEndUser(_0x26997a,_0x2ab7ed,_0x11ff0c,_0x1e117b[_0xdca7('0x85')],_0x1e117b[_0xdca7('0x86')],_0x16a55e,_0x3e254e);})['then'](function(_0x38bccf){_0x2131f5=_0x38bccf;return getCall(_0x26997a,_0x2ab7ed,_0x11ff0c,_0x16a55e,_0x2131f5,_0x3e254e,_0x1e117b,'Inbound');})[_0xdca7('0x26')](function(_0x1b17e6){if(_0x1b17e6){logger['info'](_0xdca7('0x87'),_0x1b17e6['id']);}})[_0xdca7('0x39')](function(_0x5a338b){logger[_0xdca7('0x28')]('['+_0x1e117b[_0xdca7('0x95')][_0xdca7('0x96')]()+']',JSON[_0xdca7('0xd')](_0x5a338b));});};
\ No newline at end of file
+var _0xaf5c=['YYYY-MM-DDTHH:mm:ss','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','host','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','com','email','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','/downloads?type=uniqueid&token=','zoho.eu','destcalleridname','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]','unmanaged','monitor_format','toUpperCase','calleridnum','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','includes','string','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','https://www.zohoapis.','startCase','role','first_name','last_name','code','SUCCESS','details','enduserType','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','uri','lead','Creating\x20new\x20call...','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','mm:ss','endtime'];(function(_0x5011f5,_0x92181b){var _0x2b0e3f=function(_0x47393c){while(--_0x47393c){_0x5011f5['push'](_0x5011f5['shift']());}};_0x2b0e3f(++_0x92181b);}(_0xaf5c,0x161));var _0xcaf5=function(_0x394c26,_0x3ac237){_0x394c26=_0x394c26-0x0;var _0x4664be=_0xaf5c[_0x394c26];return _0x4664be;};'use strict';var _=require('lodash');var rp=require(_0xcaf5('0x0'));var md5=require(_0xcaf5('0x1'));var util=require(_0xcaf5('0x2'));var intUtil=require(_0xcaf5('0x3'));var moment=require('moment');var Redis=require(_0xcaf5('0x4'));var BPromise=require(_0xcaf5('0x5'));var config=require('../../../../config/environment');var logger=require(_0xcaf5('0x6'))('zoho');config[_0xcaf5('0x7')]=_[_0xcaf5('0x8')](config[_0xcaf5('0x7')],{'host':_0xcaf5('0x9'),'port':0x18eb});var io=require(_0xcaf5('0xa'))(new Redis(config[_0xcaf5('0x7')]));function emit(_0x577980,_0x543b48,_0x4831b5){io['to'](_0x577980)['emit'](_0x543b48,_0x4831b5);}function request(_0x3d7b63){logger[_0xcaf5('0xb')](_0xcaf5('0xc'),JSON['stringify'](_0x3d7b63));return rp(_0x3d7b63);}function getCustomFields(_0x4035ee,_0x369ceb){var _0x3c8093={};if(_0x4035ee['length']>0x0){_['forEach'](_0x4035ee,function(_0x4e741f){if(_[_0xcaf5('0xd')]([_0xcaf5('0xe'),'picklist'],_0x4e741f[_0xcaf5('0xf')])&&_0x4e741f[_0xcaf5('0x10')]){_0x3c8093[_0x4e741f[_0xcaf5('0x10')]]=_0x4e741f['content'][_0xcaf5('0x11')]();}else if(_0x4e741f['type']===_0xcaf5('0x12')&&_0x4e741f[_0xcaf5('0x13')]&&_0x4e741f[_0xcaf5('0x10')]&&_0x369ceb[_0x4e741f[_0xcaf5('0x13')]]){_0x3c8093[_0x4e741f[_0xcaf5('0x10')]]=_0x369ceb[_0x4e741f[_0xcaf5('0x13')]][_0xcaf5('0x11')]();}else if(_0x4e741f[_0xcaf5('0xf')]===_0xcaf5('0x14')&&_0x4e741f[_0xcaf5('0x15')]&&_0x4e741f[_0xcaf5('0x15')][_0xcaf5('0x16')]&&_0x4e741f['idField']&&_0x369ceb[_0x4e741f['Variable'][_0xcaf5('0x16')][_0xcaf5('0x17')]()]){_0x3c8093[_0x4e741f[_0xcaf5('0x10')]]=_0x369ceb[_0x4e741f[_0xcaf5('0x15')]['name'][_0xcaf5('0x17')]()][_0xcaf5('0x11')]();}});}return _0x3c8093;}function getName(_0x23235f){if(_0x23235f['indexOf']('\x20')>0x0){var _0x3017f1=_0x23235f[_0xcaf5('0x18')](/ (.+)/);if(_0x3017f1[0x1]){return _0x3017f1;}}return[_0x23235f,_0x23235f];}var accountsTokens={};function getAccessToken(_0x358a70){return new Promise(function(_0xfff444,_0x2d5aea){if(!_[_0xcaf5('0x19')](accountsTokens[_0x358a70['id']])&&!_[_0xcaf5('0x19')](accountsTokens[_0x358a70['id']][_0xcaf5('0x1a')])){if(moment()[_0xcaf5('0x1b')](accountsTokens[_0x358a70['id']][_0xcaf5('0x1c')])){_0xfff444(accountsTokens[_0x358a70['id']][_0xcaf5('0x1a')]);}}var _0x55083a;switch(_0x358a70[_0xcaf5('0x1d')]){case'US':_0x55083a=_0xcaf5('0x1e');break;case'AU':_0x55083a='https://accounts.zoho.com.au';break;case'EU':_0x55083a=_0xcaf5('0x1f');break;case'IN':_0x55083a='https://accounts.zoho.in';break;case'CN':_0x55083a=_0xcaf5('0x20');break;default:_0x55083a=_0xcaf5('0x1f');break;}var _0x54c93b={'method':_0xcaf5('0x21'),'uri':_0x55083a+'/oauth/v2/token','qs':{'refresh_token':_0x358a70[_0xcaf5('0x22')],'client_id':_0x358a70[_0xcaf5('0x23')],'client_secret':_0x358a70[_0xcaf5('0x24')],'grant_type':_0xcaf5('0x25')},'json':!![]};return rp(_0x54c93b)[_0xcaf5('0x26')](function(_0x4ff4b8){accountsTokens[_0x358a70['id']]={'access_token':_0x4ff4b8[_0xcaf5('0x1a')],'expires_in':moment()[_0xcaf5('0x27')](_0x4ff4b8['expires_in'],_0xcaf5('0x28'))};_0xfff444(_0x4ff4b8[_0xcaf5('0x1a')]);})['catch'](function(_0x56f769){logger['error']('Failing\x20creating\x20the\x20access_token',_0x56f769[_0xcaf5('0x29')]);_0x2d5aea(_0x56f769);});});}function getUser(_0x45fabd,_0x27ecc0,_0x32e88f,_0x4fa696){logger[_0xcaf5('0x2a')](_0xcaf5('0x2b'));return request({'method':_0xcaf5('0x2c'),'uri':util[_0xcaf5('0x2d')](_0xcaf5('0x2e'),_0x27ecc0),'qs':{'type':_0xcaf5('0x2f')},'headers':{'Authorization':_0xcaf5('0x30')+_0x45fabd},'json':!![]})[_0xcaf5('0x26')](function(_0x19d914){if(_0x19d914[_0xcaf5('0x31')]){var _0x2271da=-0x1;if(_['isArrayLikeObject'](_0x19d914[_0xcaf5('0x31')])){if(!_[_0xcaf5('0x19')](_0x4fa696)){_0x2271da=_[_0xcaf5('0x32')](_0x19d914['users'],function(_0x25f856){return _0x25f856['email']===_0x4fa696;});}if(_0x2271da>=0x0){logger[_0xcaf5('0x2a')]('Agent\x20found!');}else{logger['info'](_0xcaf5('0x33'));_0x2271da=_[_0xcaf5('0x32')](_0x19d914[_0xcaf5('0x31')],function(_0x52fa2c){return _0x52fa2c[_0xcaf5('0x34')]['name']===_0xcaf5('0x35');});}return _0x19d914[_0xcaf5('0x31')][_0x2271da];}else{if(_0x19d914[_0xcaf5('0x36')][_0xcaf5('0x34')][_0xcaf5('0x16')]==='Administrator'){logger[_0xcaf5('0x2a')](_0xcaf5('0x33'));user=_0x19d914['user'];return user;}else{logger[_0xcaf5('0x37')](_0xcaf5('0x38'),JSON[_0xcaf5('0x39')](_0x19d914));throw new Error(_0xcaf5('0x3a')+JSON['stringify'](_0x19d914));}}}else{logger[_0xcaf5('0x37')](_0xcaf5('0x38'),JSON[_0xcaf5('0x39')](_0x19d914));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xcaf5('0x39')](_0x19d914));}})[_0xcaf5('0x3b')](function(_0x4f03d4){console[_0xcaf5('0x37')](_0x4f03d4);});}function getZohoUser(_0x42eac4,_0x3e3293){return new BPromise(function(_0x3e4820,_0x283dab){request(_0x42eac4)[_0xcaf5('0x26')](function(_0x5a31f5){var _0x83133c=null;if(_0x5a31f5){_0x83133c=_0x5a31f5[_0xcaf5('0x3c')][0x0];_0x83133c['enduserType']=_0x3e3293;}_0x3e4820(_0x83133c);})[_0xcaf5('0x3b')](function(_0x134058){_0x283dab(_0x134058);});});}function createEndUser(_0x5677a5,_0x3dd755,_0x18a698,_0x19a919,_0x15443c,_0x30c2a6){var _0x18a698=getName(_0x18a698);return request({'method':'POST','uri':_0xcaf5('0x3d')+_0x3dd755+'/crm/v2/'+_[_0xcaf5('0x3e')](_0x30c2a6['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x18a698[0x1],'First_Name':_0x18a698[0x0],'Phone':_0x19a919,'Owner':{'name':!_[_0xcaf5('0x19')](_0x15443c['role'][_0xcaf5('0x16')])?_0x15443c[_0xcaf5('0x3f')][_0xcaf5('0x16')]:!_['isNil'](_0x15443c[_0xcaf5('0x40')])?_0x15443c[_0xcaf5('0x40')]+'\x20'+_0x15443c[_0xcaf5('0x41')]:_0x15443c[_0xcaf5('0x41')],'id':_0x15443c['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5677a5},'json':!![]})[_0xcaf5('0x26')](function(_0x25ed3a){if(_0x25ed3a&&_0x25ed3a[_0xcaf5('0x3c')][0x0][_0xcaf5('0x42')]===_0xcaf5('0x43')){var _0x5ae576=_0x25ed3a[_0xcaf5('0x3c')][0x0][_0xcaf5('0x44')];_0x5ae576[_0xcaf5('0x45')]=_['startCase'](_0x30c2a6[_0xcaf5('0x46')])+'s';return _0x5ae576;}logger[_0xcaf5('0x37')](_0xcaf5('0x38'),JSON[_0xcaf5('0x39')](data));throw new Error(_0xcaf5('0x47')+JSON[_0xcaf5('0x39')](data));})[_0xcaf5('0x3b')](function(_0x1c3c1a){console[_0xcaf5('0x48')](_0xcaf5('0x49'),_0x1c3c1a);});}function getEndUser(_0x1af6f6,_0x5d76a9,_0x45c96e,_0xbc45d1,_0x38e8a7,_0x4e7f24,_0x578a54){var _0xcffe04={'method':_0xcaf5('0x2c'),'uri':'','headers':{'Authorization':_0xcaf5('0x30')+_0x1af6f6},'json':!![]};switch(_0x578a54[_0xcaf5('0x4a')]){case _0xcaf5('0x4b'):_0xcffe04['uri']='https://www.zohoapis.'+_0x5d76a9+_0xcaf5('0x4c')+_0x38e8a7+'))';return getZohoUser(_0xcffe04,_0xcaf5('0x4d'))['then'](function(_0x5302d1){if(_0x5302d1)return _0x5302d1;_0xcffe04['uri']='https://www.zohoapis.'+_0x5d76a9+_0xcaf5('0x4e')+_0x38e8a7+'))';return getZohoUser(_0xcffe04,_0xcaf5('0x4f'))['then'](function(_0xa659e0){if(_0xa659e0)return _0xa659e0;if(_0x578a54[_0xcaf5('0x46')]!=_0xcaf5('0x50')){return createEndUser(_0x1af6f6,_0x5d76a9,_0xbc45d1,_0x38e8a7,_0x4e7f24,_0x578a54);}else{return{};}});});break;case _0xcaf5('0x51'):_0xcffe04[_0xcaf5('0x52')]=_0xcaf5('0x3d')+_0x5d76a9+_0xcaf5('0x4c')+_0x38e8a7+'))';return getZohoUser(_0xcffe04,'Contacts')[_0xcaf5('0x26')](function(_0x2d7a20){if(_0x2d7a20)return _0x2d7a20;if(_0x578a54[_0xcaf5('0x46')]!='nothing'){return createEndUser(_0x1af6f6,_0x5d76a9,_0xbc45d1,_0x38e8a7,_0x4e7f24,_0x578a54);}else{return{};}});break;case _0xcaf5('0x53'):_0xcffe04[_0xcaf5('0x52')]=_0xcaf5('0x3d')+_0x5d76a9+_0xcaf5('0x4e')+_0x38e8a7+'))';return getZohoUser(_0xcffe04,_0xcaf5('0x4f'))[_0xcaf5('0x26')](function(_0x148571){if(_0x148571)return _0x148571;if(_0x578a54[_0xcaf5('0x46')]!=_0xcaf5('0x50')){return createEndUser(_0x1af6f6,_0x5d76a9,_0xbc45d1,_0x38e8a7,_0x4e7f24,_0x578a54);}else{return{};}});break;}}function getCall(_0x12c358,_0x38236a,_0x361d66,_0x29d735,_0x18f51a,_0x5288c4,_0x4a518b,_0x39cacd){logger[_0xcaf5('0x2a')](_0xcaf5('0x54'));var _0x2c7b17={};_0x2c7b17['Owner']={'name':!_[_0xcaf5('0x19')](_0x29d735['role']['name'])&&!_[_0xcaf5('0x19')](_0x29d735[_0xcaf5('0x34')][_0xcaf5('0x16')])&&_0x29d735['profile'][_0xcaf5('0x16')]===_0xcaf5('0x55')?_0x29d735[_0xcaf5('0x3f')][_0xcaf5('0x16')]:!_[_0xcaf5('0x19')](_0x29d735['first_name'])?_0x29d735[_0xcaf5('0x40')]+'\x20'+_0x29d735['last_name']:_0x29d735[_0xcaf5('0x41')],'id':_0x29d735['id']};_0x2c7b17[_0xcaf5('0x56')]=intUtil[_0xcaf5('0x57')](_0x5288c4['Subjects'],_0x4a518b,'\x20');_0x2c7b17[_0xcaf5('0x58')]=intUtil[_0xcaf5('0x57')](_0x5288c4[_0xcaf5('0x59')],_0x4a518b,'\x0a');if(_0x18f51a['enduserType']===_0xcaf5('0x4d')){_0x2c7b17[_0xcaf5('0x5a')]={'name':!_[_0xcaf5('0x19')](_0x18f51a[_0xcaf5('0x5b')])?_0x18f51a[_0xcaf5('0x5b')]:!_['isNil'](_0x18f51a[_0xcaf5('0x5c')])?_0x18f51a[_0xcaf5('0x5c')]+'\x20'+_0x18f51a[_0xcaf5('0x5d')]:_0x18f51a[_0xcaf5('0x5d')],'id':_0x18f51a['id']};}if(_0x18f51a['enduserType']===_0xcaf5('0x4f')){_0x2c7b17[_0xcaf5('0x5e')]={'name':!_['isNil'](_0x18f51a[_0xcaf5('0x5b')])?_0x18f51a[_0xcaf5('0x5b')]:!_[_0xcaf5('0x19')](_0x18f51a[_0xcaf5('0x5c')])?_0x18f51a[_0xcaf5('0x5c')]+'\x20'+_0x18f51a[_0xcaf5('0x5d')]:_0x18f51a[_0xcaf5('0x5d')],'id':_0x18f51a['id']};_0x2c7b17[_0xcaf5('0x5f')]=_[_0xcaf5('0x3e')](_0x18f51a[_0xcaf5('0x45')]);}if(_0x4a518b['talktime']){_0x2c7b17[_0xcaf5('0x60')]=moment[_0xcaf5('0x61')](parseInt(_0x4a518b['talktime'])*0x3e8)['format'](_0xcaf5('0x62'));}else if(_0x4a518b['answertime']&&_0x4a518b[_0xcaf5('0x63')]){_0x2c7b17[_0xcaf5('0x60')]=moment['utc'](moment(_0x4a518b[_0xcaf5('0x63')],_0xcaf5('0x64'))['diff'](moment(_0x4a518b['starttime'],_0xcaf5('0x64'))))[_0xcaf5('0x2d')]('mm:ss');}switch(_0x4a518b[_0xcaf5('0x65')]){case _0xcaf5('0x66'):_0x2c7b17['Call_Result']=_0xcaf5('0x67');break;case _0xcaf5('0x68'):case _0xcaf5('0x69'):_0x2c7b17[_0xcaf5('0x6a')]=_0xcaf5('0x6b');break;case _0xcaf5('0x6c'):_0x2c7b17['Call_Result']='Rejected';break;case _0xcaf5('0x6d'):_0x2c7b17[_0xcaf5('0x6a')]=_0xcaf5('0x6e');break;case _0xcaf5('0x6f'):_0x2c7b17['Call_Result']=_0xcaf5('0x70');default:}_0x2c7b17[_0xcaf5('0x71')]=(_0x39cacd===_0xcaf5('0x72')?moment(_0x4a518b[_0xcaf5('0x73')])[_0xcaf5('0x2d')](_0xcaf5('0x64')):moment(_0x4a518b[_0xcaf5('0x74')])[_0xcaf5('0x2d')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xcaf5('0x2d')](_0xcaf5('0x64'));_0x2c7b17[_0xcaf5('0x75')]=_0x39cacd||_0xcaf5('0x76');_0x2c7b17=_[_0xcaf5('0x77')](_0x2c7b17,getCustomFields(_0x5288c4[_0xcaf5('0x78')],_0x4a518b));return request({'method':_0xcaf5('0x21'),'uri':_0xcaf5('0x3d')+_0x38236a+_0xcaf5('0x79'),'headers':{'Authorization':_0xcaf5('0x30')+_0x12c358},'body':{'data':[_0x2c7b17]},'json':!![]})[_0xcaf5('0x26')](function(_0x34778d){if(_0x34778d&&_0x34778d[_0xcaf5('0x3c')][0x0][_0xcaf5('0x42')]==='SUCCESS'){logger[_0xcaf5('0x2a')](_0xcaf5('0x7a'));return{'id':_0x34778d[_0xcaf5('0x3c')][0x0]['details']['id']};}})[_0xcaf5('0x3b')](function(_0x1acf8c){logger[_0xcaf5('0x2a')](_0xcaf5('0x7b'),_0x1acf8c['stack']);console['log'](_0xcaf5('0x7b'),_0x1acf8c);});}exports['queue']=function(_0x326420,_0x7c3569,_0x58bed0,_0x4e77e0,_0x4c30bc,_0x39e14f){var _0x1b4467,_0x3eec85,_0x4b55f5;_0x39e14f[_0xcaf5('0x7c')]=intUtil['stripTrailingSlash'](_0x39e14f[_0xcaf5('0x7c')]);_0x39e14f[_0xcaf5('0x7d')]=intUtil[_0xcaf5('0x7e')](_0x39e14f[_0xcaf5('0x7d')]);if(_0x4c30bc&&_0x4c30bc['monitor_format']){logger[_0xcaf5('0x2a')](_0xcaf5('0x7f'),_0xcaf5('0x80'));_0x7c3569[_0xcaf5('0x81')]=_0x39e14f[_0xcaf5('0x7d')]+_0xcaf5('0x82')+_0x7c3569[_0xcaf5('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x7c3569[_0xcaf5('0x83')]);}else{_0x7c3569[_0xcaf5('0x81')]='';}var _0x5ca2cd=_0x39e14f[_0xcaf5('0x7c')]==='zoho.eu'?'eu':_0xcaf5('0x84');return getAccessToken(_0x39e14f)[_0xcaf5('0x26')](function(_0x3537fe){_0x4b55f5=_0x3537fe;return getUser(_0x4b55f5,_0x5ca2cd,_0x39e14f,_0x4e77e0[_0xcaf5('0x85')]);})[_0xcaf5('0x26')](function(_0x1fe252){_0x1b4467=_0x1fe252;logger[_0xcaf5('0x2a')](_0xcaf5('0x86'),_0x1b4467['id']);return getEndUser(_0x4b55f5,_0x5ca2cd,_0x39e14f,_0x7c3569[_0xcaf5('0x87')],_0x7c3569['calleridnum'],_0x1b4467,_0x58bed0);})[_0xcaf5('0x26')](function(_0x3ee9c7){_0x3eec85=_0x3ee9c7;return getCall(_0x4b55f5,_0x5ca2cd,_0x39e14f,_0x1b4467,_0x3eec85,_0x58bed0,_0x7c3569,'Inbound');})[_0xcaf5('0x26')](function(_0x2742de){if(_0x2742de){logger[_0xcaf5('0x2a')](_0xcaf5('0x88'),_0x2742de['id']);logger[_0xcaf5('0x2a')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcaf5('0x2d')](_0xcaf5('0x89'),_0x4e77e0[_0xcaf5('0x16')]),_0xcaf5('0x8a'),{'uri':'https://crm.'+_0x39e14f[_0xcaf5('0x7c')]+_0xcaf5('0x8b')+_0x2742de['id']});}})[_0xcaf5('0x3b')](function(_0x27b9b2){logger[_0xcaf5('0x37')]('[QUEUE]',JSON[_0xcaf5('0x39')](_0x27b9b2));});};exports[_0xcaf5('0x72')]=function(_0x1b51ea,_0x50640d,_0x30a2cd,_0x537823,_0x264388,_0x40dfb3,_0x30a5d7){var _0x28aa50,_0x38e85d,_0xb0d4ca;_0x40dfb3[_0xcaf5('0x7c')]=intUtil['stripTrailingSlash'](_0x40dfb3[_0xcaf5('0x7c')]);_0x40dfb3['serverUrl']=intUtil[_0xcaf5('0x7e')](_0x40dfb3[_0xcaf5('0x7d')]);if(_0x30a5d7&&_0x30a5d7[_0xcaf5('0x8c')]&&_0x30a5d7['recordingFormat']!==_0xcaf5('0x8d')){logger['info']('[OUTBOUND]',_0xcaf5('0x80'));_0x50640d[_0xcaf5('0x81')]=_0x40dfb3[_0xcaf5('0x7d')]+'/api/voice/recordings/'+_0x50640d[_0xcaf5('0x83')]+_0xcaf5('0x8e')+md5(_0x50640d[_0xcaf5('0x83')]);}var _0x5c332f=_0x40dfb3[_0xcaf5('0x7c')]===_0xcaf5('0x8f')?'eu':'com';return getAccessToken(_0x40dfb3)[_0xcaf5('0x26')](function(_0x456984){_0xb0d4ca=_0x456984;return getUser(_0xb0d4ca,_0x5c332f,_0x40dfb3,_0x537823[_0xcaf5('0x85')]);})['then'](function(_0x29b25d){_0x28aa50=_0x29b25d;logger[_0xcaf5('0x2a')](_0xcaf5('0x86'),_0x28aa50['id']);return getEndUser(_0xb0d4ca,_0x5c332f,_0x40dfb3,_0x50640d[_0xcaf5('0x90')],_0x50640d['destcalleridnum'],_0x28aa50,_0x30a2cd);})[_0xcaf5('0x26')](function(_0x3ae634){_0x38e85d=_0x3ae634;return getCall(_0xb0d4ca,_0x5c332f,_0x40dfb3,_0x28aa50,_0x38e85d,_0x30a2cd,_0x50640d,'Outbound');})[_0xcaf5('0x26')](function(_0x558c2c){if(_0x558c2c){logger[_0xcaf5('0x2a')]('The\x20Call\x20ID\x20is:',_0x558c2c['id']);logger[_0xcaf5('0x2a')]('[OUTBOUND]',_0xcaf5('0x91'));emit(util[_0xcaf5('0x2d')](_0xcaf5('0x89'),_0x537823[_0xcaf5('0x16')]),'trigger:browser:url',{'uri':'https://crm.'+_0x40dfb3[_0xcaf5('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x558c2c['id']});}})[_0xcaf5('0x3b')](function(_0x21b1ae){logger['error'](_0xcaf5('0x92'),JSON[_0xcaf5('0x39')](_0x21b1ae));});};exports[_0xcaf5('0x93')]=function(_0x5263e4,_0x28ea27,_0xf640dd,_0x50a05a,_0x175f9e,_0x503ea3){var _0x32b107,_0x394a9a,_0x42d01d;_0x503ea3[_0xcaf5('0x7c')]=intUtil[_0xcaf5('0x7e')](_0x503ea3[_0xcaf5('0x7c')]);_0x503ea3[_0xcaf5('0x7d')]=intUtil[_0xcaf5('0x7e')](_0x503ea3[_0xcaf5('0x7d')]);if(_0x175f9e&&_0x175f9e[_0xcaf5('0x94')]){logger['info']('['+_0x28ea27[_0xcaf5('0x65')][_0xcaf5('0x95')]()+']','Recording\x20is\x20enabled!');_0x28ea27[_0xcaf5('0x81')]=_0x503ea3[_0xcaf5('0x7d')]+_0xcaf5('0x82')+_0x28ea27[_0xcaf5('0x83')]+_0xcaf5('0x8e')+md5(_0x28ea27[_0xcaf5('0x83')]);}else{_0x28ea27[_0xcaf5('0x81')]='';}var _0x14da80=_0x503ea3[_0xcaf5('0x7c')]===_0xcaf5('0x8f')?'eu':_0xcaf5('0x84');return getAccessToken(_0x503ea3)[_0xcaf5('0x26')](function(_0x372d0b){_0x42d01d=_0x372d0b;return getUser(_0x42d01d,_0x14da80,_0x503ea3);})[_0xcaf5('0x26')](function(_0x1b73be){_0x32b107=_0x1b73be;logger[_0xcaf5('0x2a')]('The\x20User\x20ID\x20is:',_0x32b107['id']);return getEndUser(_0x42d01d,_0x14da80,_0x503ea3,_0x28ea27[_0xcaf5('0x87')],_0x28ea27[_0xcaf5('0x96')],_0x32b107,_0xf640dd);})[_0xcaf5('0x26')](function(_0x224ee6){_0x394a9a=_0x224ee6;return getCall(_0x42d01d,_0x14da80,_0x503ea3,_0x32b107,_0x394a9a,_0xf640dd,_0x28ea27,_0xcaf5('0x76'));})[_0xcaf5('0x26')](function(_0x50b278){if(_0x50b278){logger[_0xcaf5('0x2a')]('The\x20Call\x20ID\x20is:',_0x50b278['id']);}})[_0xcaf5('0x3b')](function(_0x7a2945){logger['error']('['+_0x28ea27[_0xcaf5('0x65')]['toUpperCase']()+']',JSON[_0xcaf5('0x39')](_0x7a2945));});};
\ No newline at end of file
index 1e891b0..5bbe031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2abd=['data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec'];(function(_0x1ee248,_0x599053){var _0x9227e6=function(_0x302566){while(--_0x302566){_0x1ee248['push'](_0x1ee248['shift']());}};_0x9227e6(++_0x599053);}(_0x2abd,0x1c1));var _0xd2ab=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x2abd[_0x39096d];return _0x13da4f;};'use strict';var util=require(_0xd2ab('0x0'));var sh=require(_0xd2ab('0x1'));var Mustache=require(_0xd2ab('0x2'));var logger=require(_0xd2ab('0x3'))(_0xd2ab('0x4'));exports[_0xd2ab('0x5')]=function(_0x542f22,_0xff8d8f){var _0x492a91=_0x542f22[_0xd2ab('0x6')]?_0x542f22[_0xd2ab('0x6')]:_0xd2ab('0x7');var _0x8079d1=_0x542f22['data3']?Mustache[_0xd2ab('0x8')](_0x542f22[_0xd2ab('0x9')],_0xff8d8f):_0xff8d8f;sh['exec'](_0x8079d1,function(_0x3c0cb1,_0x4c43b9,_0x3ff2fb){if(_0x3c0cb1!==0x0){logger[_0xd2ab('0xa')](util[_0xd2ab('0xb')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x492a91,_0x8079d1,_0x3c0cb1,_0x3ff2fb));}else{logger['info'](util[_0xd2ab('0xb')](_0xd2ab('0xc'),_0x492a91,_0x8079d1,_0x4c43b9));}});};
\ No newline at end of file
+var _0x9442=['data3','render','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','../../../../config/logger','trigger','exec','data2','Script'];(function(_0x483ad2,_0x5034bc){var _0x1a5251=function(_0x26a631){while(--_0x26a631){_0x483ad2['push'](_0x483ad2['shift']());}};_0x1a5251(++_0x5034bc);}(_0x9442,0x69));var _0x2944=function(_0x47a0c9,_0x3ce549){_0x47a0c9=_0x47a0c9-0x0;var _0x5b09f7=_0x9442[_0x47a0c9];return _0x5b09f7;};'use strict';var util=require(_0x2944('0x0'));var sh=require(_0x2944('0x1'));var Mustache=require('mustache');var logger=require(_0x2944('0x2'))(_0x2944('0x3'));exports[_0x2944('0x4')]=function(_0x4eb96d,_0x228db1){var _0x324d91=_0x4eb96d[_0x2944('0x5')]?_0x4eb96d['data2']:_0x2944('0x6');var _0x53071b=_0x4eb96d[_0x2944('0x7')]?Mustache[_0x2944('0x8')](_0x4eb96d[_0x2944('0x7')],_0x228db1):_0x228db1;sh[_0x2944('0x4')](_0x53071b,function(_0x3ae328,_0x5ea637,_0x4f717d){if(_0x3ae328!==0x0){logger[_0x2944('0x9')](util['format'](_0x2944('0xa'),_0x324d91,_0x53071b,_0x3ae328,_0x4f717d));}else{logger[_0x2944('0xb')](util[_0x2944('0xc')](_0x2944('0xd'),_0x324d91,_0x53071b,_0x5ea637));}});};
\ No newline at end of file
index 45cd7d9..317078f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e98=['data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','message','request-promise','util','lodash','../../../../config/logger','exec','data1','data2','data5','number','headers','render','data6','error','stack','toUpperCase','DELETE','parse'];(function(_0x48338c,_0x579750){var _0x411564=function(_0x4440c3){while(--_0x4440c3){_0x48338c['push'](_0x48338c['shift']());}};_0x411564(++_0x579750);}(_0x2e98,0xc8));var _0x82e9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2e98[_0x4b369d];return _0x571a98;};'use strict';var rp=require(_0x82e9('0x0'));var util=require(_0x82e9('0x1'));var _=require(_0x82e9('0x2'));var Mustache=require('mustache');var logger=require(_0x82e9('0x3'))('trigger');exports[_0x82e9('0x4')]=function(_0x1e45e6,_0xa5d996){var _0x5dd4fe,_0x1a922b;var _0x968ce={'method':_0x1e45e6[_0x82e9('0x5')]['toUpperCase'](),'uri':Mustache['render'](_0x1e45e6[_0x82e9('0x6')],_0xa5d996),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1e45e6[_0x82e9('0x7')])===_0x82e9('0x8')&&parseInt(_0x1e45e6[_0x82e9('0x7')])>=0x1&&parseInt(_0x1e45e6[_0x82e9('0x7')])<=0xa?parseInt(_0x1e45e6[_0x82e9('0x7')])*0x3e8:0x5*0x3e8};try{_0x968ce[_0x82e9('0x9')]=_0x1e45e6['data6']?JSON['parse'](Mustache[_0x82e9('0xa')](_0x1e45e6[_0x82e9('0xb')],_0xa5d996)):{};}catch(_0x3e27f1){logger[_0x82e9('0xc')](_0x3e27f1[_0x82e9('0xd')]);}switch(_0x1e45e6[_0x82e9('0x5')][_0x82e9('0xe')]()){case'GET':case _0x82e9('0xf'):_0x5dd4fe=null;_0x968ce['qs']=_0xa5d996;break;case'POST':case'PUT':if(_0x1e45e6['data7']){try{_0x5dd4fe=JSON[_0x82e9('0x10')](Mustache[_0x82e9('0xa')](_0x1e45e6[_0x82e9('0x11')],_0xa5d996));_0x968ce[_0x82e9('0x12')]=_0x5dd4fe;}catch(_0x44f69f){logger[_0x82e9('0xc')](_0x44f69f[_0x82e9('0xd')]);logger['error'](_0x82e9('0x13'));}}else{_0x5dd4fe=_0xa5d996;_0x968ce[_0x82e9('0x12')]=_0x5dd4fe;}break;}logger[_0x82e9('0x14')](util[_0x82e9('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x1e45e6[_0x82e9('0x5')],_0x1e45e6[_0x82e9('0x6')],JSON[_0x82e9('0x16')](_0x968ce)));rp(_0x968ce)[_0x82e9('0x17')](function(_0x53f6a6){_0x5dd4fe=!_[_0x82e9('0x18')](_0x5dd4fe)?_0x82e9('0x19')+_0x5dd4fe:'';_0x1a922b=typeof _0x53f6a6['body']===_0x82e9('0x1a')?JSON[_0x82e9('0x16')](_0x53f6a6[_0x82e9('0x12')]):_0x53f6a6['body'];logger[_0x82e9('0x14')](util[_0x82e9('0x15')](_0x82e9('0x1b'),_0x1e45e6[_0x82e9('0x5')],_0x1e45e6[_0x82e9('0x6')],_0x53f6a6[_0x82e9('0x1c')],_0x1a922b));})[_0x82e9('0x1d')](function(_0x2c3660){logger[_0x82e9('0xc')](util[_0x82e9('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x1e45e6['data1'],_0x1e45e6['data2'],_0x2c3660[_0x82e9('0x1c')],_0x2c3660['name'],_0x2c3660[_0x82e9('0x1e')]));});};
\ No newline at end of file
+var _0x398d=['exec','data1','render','data2','data5','number','headers','data6','parse','error','stack','GET','POST','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','statusCode','name','message','util','lodash','mustache','../../../../config/logger','trigger'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x398d,0x109));var _0xd398=function(_0x35c624,_0xc238b1){_0x35c624=_0x35c624-0x0;var _0x215e7b=_0x398d[_0x35c624];return _0x215e7b;};'use strict';var rp=require('request-promise');var util=require(_0xd398('0x0'));var _=require(_0xd398('0x1'));var Mustache=require(_0xd398('0x2'));var logger=require(_0xd398('0x3'))(_0xd398('0x4'));exports[_0xd398('0x5')]=function(_0x31e3bf,_0x1594bc){var _0x1ad1f8,_0xf0ada8;var _0x34b849={'method':_0x31e3bf[_0xd398('0x6')]['toUpperCase'](),'uri':Mustache[_0xd398('0x7')](_0x31e3bf[_0xd398('0x8')],_0x1594bc),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x31e3bf[_0xd398('0x9')])===_0xd398('0xa')&&parseInt(_0x31e3bf['data5'])>=0x1&&parseInt(_0x31e3bf[_0xd398('0x9')])<=0xa?parseInt(_0x31e3bf[_0xd398('0x9')])*0x3e8:0x5*0x3e8};try{_0x34b849[_0xd398('0xb')]=_0x31e3bf[_0xd398('0xc')]?JSON[_0xd398('0xd')](Mustache[_0xd398('0x7')](_0x31e3bf[_0xd398('0xc')],_0x1594bc)):{};}catch(_0xb42bc6){logger[_0xd398('0xe')](_0xb42bc6[_0xd398('0xf')]);}switch(_0x31e3bf[_0xd398('0x6')]['toUpperCase']()){case _0xd398('0x10'):case'DELETE':_0x1ad1f8=null;_0x34b849['qs']=_0x1594bc;break;case _0xd398('0x11'):case'PUT':if(_0x31e3bf['data7']){try{_0x1ad1f8=JSON['parse'](Mustache[_0xd398('0x7')](_0x31e3bf['data7'],_0x1594bc));_0x34b849[_0xd398('0x12')]=_0x1ad1f8;}catch(_0x17b15d){logger[_0xd398('0xe')](_0x17b15d[_0xd398('0xf')]);logger[_0xd398('0xe')](_0xd398('0x13'));}}else{_0x1ad1f8=_0x1594bc;_0x34b849[_0xd398('0x12')]=_0x1ad1f8;}break;}logger[_0xd398('0x14')](util[_0xd398('0x15')](_0xd398('0x16'),_0x31e3bf['data1'],_0x31e3bf['data2'],JSON[_0xd398('0x17')](_0x34b849)));rp(_0x34b849)[_0xd398('0x18')](function(_0x5b20da){_0x1ad1f8=!_[_0xd398('0x19')](_0x1ad1f8)?_0xd398('0x1a')+_0x1ad1f8:'';_0xf0ada8=typeof _0x5b20da['body']==='object'?JSON[_0xd398('0x17')](_0x5b20da[_0xd398('0x12')]):_0x5b20da[_0xd398('0x12')];logger[_0xd398('0x14')](util[_0xd398('0x15')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x31e3bf[_0xd398('0x6')],_0x31e3bf['data2'],_0x5b20da[_0xd398('0x1b')],_0xf0ada8));})['catch'](function(_0x509e8f){logger[_0xd398('0xe')](util[_0xd398('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x31e3bf[_0xd398('0x6')],_0x31e3bf['data2'],_0x509e8f[_0xd398('0x1b')],_0x509e8f[_0xd398('0x1c')],_0x509e8f[_0xd398('0x1d')]));});};
\ No newline at end of file
index 36d604d..eb5779b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f4f=['bluebird','../../config/logger','routing','Request','then','error','rpc','message','result','catch','exports'];(function(_0x494601,_0x28438d){var _0x5ae602=function(_0x8acc78){while(--_0x8acc78){_0x494601['push'](_0x494601['shift']());}};_0x5ae602(++_0x28438d);}(_0x9f4f,0x11e));var _0xf9f4=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x9f4f[_0x548627];return _0x844a84;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xf9f4('0x0'));var logger=require(_0xf9f4('0x1'))(_0xf9f4('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0xf9f4('0x3')]=function(_0x1735d6,_0x492e4d){return new BPromise(function(_0x1e3ee6,_0x2a2760){return client['request'](_0x1735d6,_0x492e4d)[_0xf9f4('0x4')](function(_0x508e79){logger['debug']('rpc','routing',_0x1735d6,_0x492e4d,_0x508e79);if(_0x508e79[_0xf9f4('0x5')]){logger[_0xf9f4('0x5')](_0xf9f4('0x6'),_0xf9f4('0x2'),_0x1735d6,_0x508e79[_0xf9f4('0x5')][_0xf9f4('0x7')],_0x492e4d);return _0x2a2760(_0x508e79[_0xf9f4('0x5')][_0xf9f4('0x7')]);}else{return _0x1e3ee6(_0x508e79[_0xf9f4('0x8')]);}})[_0xf9f4('0x9')](function(_0x28d6d6){logger[_0xf9f4('0x5')](_0xf9f4('0x6'),_0xf9f4('0x2'),_0x1735d6,_0x28d6d6,_0x492e4d);return _0x2a2760(_0x28d6d6);});});};module[_0xf9f4('0xa')]=client;
\ No newline at end of file
+var _0x6ec6=['routing','client','http','Request','then','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger'];(function(_0x36436a,_0x4e3c1d){var _0x245a2d=function(_0x58a992){while(--_0x58a992){_0x36436a['push'](_0x36436a['shift']());}};_0x245a2d(++_0x4e3c1d);}(_0x6ec6,0x9a));var _0x66ec=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x6ec6[_0x3712e2];return _0x1faff4;};'use strict';var jayson=require(_0x66ec('0x0'));var BPromise=require('bluebird');var logger=require(_0x66ec('0x1'))(_0x66ec('0x2'));var client=jayson[_0x66ec('0x3')][_0x66ec('0x4')]({'port':0x2329});client[_0x66ec('0x5')]=function(_0x5883ed,_0x1f9a46){return new BPromise(function(_0x3694a9,_0x78d9e){return client['request'](_0x5883ed,_0x1f9a46)[_0x66ec('0x6')](function(_0x42c694){logger['debug'](_0x66ec('0x7'),_0x66ec('0x2'),_0x5883ed,_0x1f9a46,_0x42c694);if(_0x42c694[_0x66ec('0x8')]){logger[_0x66ec('0x8')](_0x66ec('0x7'),_0x66ec('0x2'),_0x5883ed,_0x42c694[_0x66ec('0x8')][_0x66ec('0x9')],_0x1f9a46);return _0x78d9e(_0x42c694[_0x66ec('0x8')]['message']);}else{return _0x3694a9(_0x42c694[_0x66ec('0xa')]);}})[_0x66ec('0xb')](function(_0x219258){logger[_0x66ec('0x8')](_0x66ec('0x7'),_0x66ec('0x2'),_0x5883ed,_0x219258,_0x1f9a46);return _0x78d9e(_0x219258);});});};module[_0x66ec('0xc')]=client;
\ No newline at end of file
index fa6aa20..c48dfec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68b9=['getSettings','loginMailFrequency','catch','error','./server','./realtime','./rpc/setting','../../config/logger','email','getMailAccounts','then','refresh','mailAccounts','listen'];(function(_0x3a18c5,_0x3e00b8){var _0x456ac9=function(_0x3cd712){while(--_0x3cd712){_0x3a18c5['push'](_0x3a18c5['shift']());}};_0x456ac9(++_0x3e00b8);}(_0x68b9,0xba));var _0x968b=function(_0x3fa296,_0x2bd315){_0x3fa296=_0x3fa296-0x0;var _0x10b19f=_0x68b9[_0x3fa296];return _0x10b19f;};'use strict';var server=require(_0x968b('0x0'));var Realtime=require(_0x968b('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0x968b('0x2'));var logger=require(_0x968b('0x3'))(_0x968b('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount[_0x968b('0x5')]())[_0x968b('0x6')](realtime['initMailAccounts']())[_0x968b('0x6')](function(){email[_0x968b('0x7')](realtime[_0x968b('0x8')]);return realtime;});}function main(){return server[_0x968b('0x9')](realtime,email)['then'](function(){return initRealtime();})[_0x968b('0x6')](function(){return setting[_0x968b('0xa')]();})[_0x968b('0x6')](function(_0xb9512a){return setInterval(initRealtime,_0xb9512a[_0x968b('0xb')]*0x3e8);})[_0x968b('0xc')](function(_0x287e6d){logger[_0x968b('0xd')]('Email\x20service\x20initialization',_0x287e6d);});}main();
\ No newline at end of file
+var _0xdb3e=['getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','then','initMailAccounts','refresh','listen'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xdb3e,0x17c));var _0xedb3=function(_0x3eebf6,_0x4392db){_0x3eebf6=_0x3eebf6-0x0;var _0x15d933=_0xdb3e[_0x3eebf6];return _0x15d933;};'use strict';var server=require('./server');var Realtime=require(_0xedb3('0x0'));var EmailChannel=require(_0xedb3('0x1'));var mailAccount=require(_0xedb3('0x2'));var setting=require(_0xedb3('0x3'));var logger=require(_0xedb3('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xedb3('0x5')]()[_0xedb3('0x6')](mailAccount['getMailAccounts']())[_0xedb3('0x6')](realtime[_0xedb3('0x7')]())[_0xedb3('0x6')](function(){email[_0xedb3('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xedb3('0x9')](realtime,email)[_0xedb3('0x6')](function(){return initRealtime();})[_0xedb3('0x6')](function(){return setting[_0xedb3('0xa')]();})['then'](function(_0x113d65){return setInterval(initRealtime,_0x113d65[_0xedb3('0xb')]*0x3e8);})[_0xedb3('0xc')](function(_0xca3ca2){logger[_0xedb3('0xd')](_0xedb3('0xe'),_0xca3ca2);});}main();
\ No newline at end of file
index 30d9fa2..fffb770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0cf=['messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','Smtp','verify','verified','exports','lodash','bluebird','md5','ioredis','../../../config/logger','email','defaults','socket.io-emitter','redis','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','total','isNil','stringify','refresh','service','provider','custom','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','name'];(function(_0x4746f9,_0x3168c0){var _0x248c39=function(_0x14cf4b){while(--_0x14cf4b){_0x4746f9['push'](_0x4746f9['shift']());}};_0x248c39(++_0x3168c0);}(_0xc0cf,0x1c7));var _0xfc0c=function(_0xcf072f,_0x2f57cd){_0xcf072f=_0xcf072f-0x0;var _0x18645a=_0xc0cf[_0xcf072f];return _0x18645a;};'use strict';var _=require(_0xfc0c('0x0'));var moment=require('moment');var BPromise=require(_0xfc0c('0x1'));var md5=require(_0xfc0c('0x2'));var Redis=require(_0xfc0c('0x3'));var config=require('../../../config/environment');var logger=require(_0xfc0c('0x4'))(_0xfc0c('0x5'));config['redis']=_[_0xfc0c('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xfc0c('0x7'))(new Redis(config[_0xfc0c('0x8')]));var EmailImap=require(_0xfc0c('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xfc0c('0xa'));var md5Accounts={};function EmailChannel(_0x47b234){logger[_0xfc0c('0xb')](_0xfc0c('0xc'));this[_0xfc0c('0xd')]=_0x47b234[_0xfc0c('0xd')];this[_0xfc0c('0xe')]={};this[_0xfc0c('0xf')]=new EmailSmtp();}EmailChannel[_0xfc0c('0x10')][_0xfc0c('0x11')]=function(_0x394d50){var _0x59c0d8=this[_0xfc0c('0xd')][_0x394d50];var _0x166f29={'id':_0x59c0d8['id'],'name':_0x59c0d8['name'],'key':_0x59c0d8[_0xfc0c('0x12')],'active':_0x59c0d8[_0xfc0c('0x13')],'Imap':{'status':_0x59c0d8[_0xfc0c('0x14')][_0xfc0c('0x15')],'messageStatus':_0x59c0d8[_0xfc0c('0x14')][_0xfc0c('0x16')],'total':_0x59c0d8['Imap'][_0xfc0c('0x17')]}};if(_[_0xfc0c('0x18')](md5Accounts[_0x394d50])){md5Accounts[_0x394d50]={};}var _0x2c383d=md5(JSON[_0xfc0c('0x19')](_0x166f29));if(md5Accounts[_0x394d50][_0xfc0c('0x2')]!==_0x2c383d){md5Accounts[_0x394d50][_0xfc0c('0x2')]=_0x2c383d;io['emit']('mailAccount:update',_0x166f29);}};EmailChannel['prototype'][_0xfc0c('0x1a')]=function(_0x3b660b){for(var _0x567a25 in _0x3b660b){if(_0x3b660b['hasOwnProperty'](_0x567a25)){if(_0x3b660b[_0x567a25][_0xfc0c('0x14')]&&_0x3b660b[_0x567a25][_0xfc0c('0x13')]){var _0x29b112=_0x3b660b[_0x567a25]['Imap'];if(!_0x29b112[_0xfc0c('0x1b')]&&_0x3b660b[_0x567a25][_0xfc0c('0x1c')]!==_0xfc0c('0x1d'))_0x29b112[_0xfc0c('0x1b')]=_0x3b660b[_0x567a25][_0xfc0c('0x1c')];if(!this[_0xfc0c('0xe')][_0xfc0c('0x1e')](_0x29b112['id'])){this[_0xfc0c('0xe')][_0x29b112['id']]=new EmailImap(_0x29b112,_0x3b660b[_0x567a25][_0xfc0c('0x5')]);this['imapAccounts'][_0x29b112['id']]['on']('box',this[_0xfc0c('0x1f')][_0xfc0c('0x20')](this,_0x567a25));this[_0xfc0c('0xe')][_0x29b112['id']]['on']('email',this[_0xfc0c('0x21')]['bind'](this,_0x567a25));this[_0xfc0c('0xe')][_0x29b112['id']]['on'](_0xfc0c('0x22'),this[_0xfc0c('0x23')][_0xfc0c('0x20')](this,_0x567a25));this['imapAccounts'][_0x29b112['id']]['on'](_0xfc0c('0x24'),this[_0xfc0c('0x25')]['bind'](this,_0x567a25));}}else{if(_[_0xfc0c('0x18')](this['mailAccounts'][_0x567a25][_0xfc0c('0x14')])){this[_0xfc0c('0xd')][_0x567a25][_0xfc0c('0x14')]={};}this['mailAccounts'][_0x567a25][_0xfc0c('0x14')]['status']=_0xfc0c('0x26');this[_0xfc0c('0xd')][_0x567a25]['Imap'][_0xfc0c('0x16')]='';this['emit'](_0x567a25);}}}};EmailChannel[_0xfc0c('0x10')]['handleImapBox']=function(_0x5c4e54,_0x1e7289){if(this[_0xfc0c('0xd')][_0x5c4e54]){this['mailAccounts'][_0x5c4e54]['Imap']['status']='connected';this[_0xfc0c('0xd')][_0x5c4e54][_0xfc0c('0x14')]['messageStatus']=_0x1e7289[_0xfc0c('0x27')];if(_0x1e7289[_0xfc0c('0x28')]){this[_0xfc0c('0xd')][_0x5c4e54]['Imap'][_0xfc0c('0x17')]=_0x1e7289[_0xfc0c('0x28')]['total'];}return this[_0xfc0c('0x11')](_0x5c4e54);}};EmailChannel['prototype']['handleImapEmail']=function(_0x14d2f1,_0x392a75){logger[_0xfc0c('0xb')](_0xfc0c('0x29'),_0x392a75[_0xfc0c('0x2a')],_0x392a75[_0xfc0c('0x2b')],_0x392a75[_0xfc0c('0x2c')],_0x14d2f1);if(this[_0xfc0c('0xd')][_0x14d2f1]){return mailAccount['notify'](_0x14d2f1,_0x392a75)[_0xfc0c('0x2d')](function(_0x58e273){if(_0x58e273){logger['info'](_0xfc0c('0x2e'));}})[_0xfc0c('0x2f')](function(_0x17f16b){logger[_0xfc0c('0x24')](_0xfc0c('0x30'),JSON[_0xfc0c('0x19')](_0x17f16b));});}};EmailChannel[_0xfc0c('0x10')][_0xfc0c('0x23')]=function(_0x5e7b5c){if(this[_0xfc0c('0xd')][_0x5e7b5c]&&this[_0xfc0c('0xd')][_0x5e7b5c][_0xfc0c('0x14')]){if(this[_0xfc0c('0xe')][this[_0xfc0c('0xd')][_0x5e7b5c][_0xfc0c('0x14')]['id']]){delete this[_0xfc0c('0xe')][this[_0xfc0c('0xd')][_0x5e7b5c][_0xfc0c('0x14')]['id']];}this[_0xfc0c('0xd')][_0x5e7b5c]['Imap'][_0xfc0c('0x31')]=moment();this[_0xfc0c('0x11')](_0x5e7b5c);}};EmailChannel[_0xfc0c('0x10')]['handleImapError']=function(_0x57b228,_0x17ec32){if(this[_0xfc0c('0xd')][_0x57b228]){this['mailAccounts'][_0x57b228][_0xfc0c('0x14')]['status']='error';this[_0xfc0c('0xd')][_0x57b228][_0xfc0c('0x14')][_0xfc0c('0x16')]=_0x17ec32;return this[_0xfc0c('0x11')](_0x57b228);}};EmailChannel['prototype'][_0xfc0c('0x32')]=function(_0x17e7aa,_0x108b9b){return this[_0xfc0c('0xf')]['send'](_0x17e7aa,_0x108b9b);};EmailChannel[_0xfc0c('0x10')]['verifySmtp']=function(_0x491f6b){var _0x1e4107=this;if(this[_0xfc0c('0xd')][_0x491f6b['id']]){if(_[_0xfc0c('0x18')](this[_0xfc0c('0xd')][_0x491f6b['id']]['Smtp'])){this[_0xfc0c('0xd')][_0x491f6b['id']][_0xfc0c('0x33')]={};}this[_0xfc0c('0xd')][_0x491f6b['id']][_0xfc0c('0x33')][_0xfc0c('0x31')]=moment();return new BPromise(function(_0x5c658f,_0x32018e){return _0x1e4107[_0xfc0c('0xf')][_0xfc0c('0x34')](_0x491f6b)[_0xfc0c('0x2d')](function(_0x4814bf){_0x1e4107[_0xfc0c('0xd')][_0x491f6b['id']][_0xfc0c('0x33')][_0xfc0c('0x15')]=_0xfc0c('0x35');_0x1e4107[_0xfc0c('0xd')][_0x491f6b['id']][_0xfc0c('0x33')][_0xfc0c('0x16')]='';_0x1e4107[_0xfc0c('0x11')](_0x491f6b['id']);_0x5c658f(_0x4814bf);})['catch'](function(_0x10d2b3){_0x1e4107[_0xfc0c('0xd')][_0x491f6b['id']][_0xfc0c('0x33')][_0xfc0c('0x15')]=_0xfc0c('0x24');_0x1e4107['mailAccounts'][_0x491f6b['id']][_0xfc0c('0x33')][_0xfc0c('0x16')]=_0x10d2b3;_0x1e4107[_0xfc0c('0x11')](_0x491f6b['id']);_0x32018e(_0x10d2b3);});});}return this[_0xfc0c('0xf')][_0xfc0c('0x34')](_0x491f6b);};module[_0xfc0c('0x36')]=EmailChannel;
\ No newline at end of file
+var _0x4e13=['active','Imap','total','isNil','emit','mailAccount:update','refresh','hasOwnProperty','service','provider','imapAccounts','email','box','bind','handleImapEmail','handleImapEnd','error','status','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','messageStatus','sendMail','send','Smtp','verify','verified','exports','moment','bluebird','md5','../../../config/environment','../../../config/logger','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','prototype','name'];(function(_0x13d6f7,_0x4768f2){var _0x19d424=function(_0x5c2b79){while(--_0x5c2b79){_0x13d6f7['push'](_0x13d6f7['shift']());}};_0x19d424(++_0x4768f2);}(_0x4e13,0x136));var _0x34e1=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x4e13[_0x1a3e23];return _0x5ee0d8;};'use strict';var _=require('lodash');var moment=require(_0x34e1('0x0'));var BPromise=require(_0x34e1('0x1'));var md5=require(_0x34e1('0x2'));var Redis=require('ioredis');var config=require(_0x34e1('0x3'));var logger=require(_0x34e1('0x4'))('email');config[_0x34e1('0x5')]=_['defaults'](config[_0x34e1('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x34e1('0x6'))(new Redis(config[_0x34e1('0x5')]));var EmailImap=require(_0x34e1('0x7'));var EmailSmtp=require(_0x34e1('0x8'));var mailAccount=require(_0x34e1('0x9'));var md5Accounts={};function EmailChannel(_0x146466){logger[_0x34e1('0xa')]('start\x20email\x20channel');this[_0x34e1('0xb')]=_0x146466['mailAccounts'];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0x34e1('0xc')]['emit']=function(_0x59cacb){var _0x5748f4=this[_0x34e1('0xb')][_0x59cacb];var _0x1e9912={'id':_0x5748f4['id'],'name':_0x5748f4[_0x34e1('0xd')],'key':_0x5748f4['key'],'active':_0x5748f4[_0x34e1('0xe')],'Imap':{'status':_0x5748f4[_0x34e1('0xf')]['status'],'messageStatus':_0x5748f4['Imap']['messageStatus'],'total':_0x5748f4[_0x34e1('0xf')][_0x34e1('0x10')]}};if(_[_0x34e1('0x11')](md5Accounts[_0x59cacb])){md5Accounts[_0x59cacb]={};}var _0x461ecd=md5(JSON['stringify'](_0x1e9912));if(md5Accounts[_0x59cacb][_0x34e1('0x2')]!==_0x461ecd){md5Accounts[_0x59cacb][_0x34e1('0x2')]=_0x461ecd;io[_0x34e1('0x12')](_0x34e1('0x13'),_0x1e9912);}};EmailChannel[_0x34e1('0xc')][_0x34e1('0x14')]=function(_0x3c54de){for(var _0x5b5163 in _0x3c54de){if(_0x3c54de[_0x34e1('0x15')](_0x5b5163)){if(_0x3c54de[_0x5b5163][_0x34e1('0xf')]&&_0x3c54de[_0x5b5163][_0x34e1('0xe')]){var _0x54ee59=_0x3c54de[_0x5b5163][_0x34e1('0xf')];if(!_0x54ee59[_0x34e1('0x16')]&&_0x3c54de[_0x5b5163][_0x34e1('0x17')]!=='custom')_0x54ee59[_0x34e1('0x16')]=_0x3c54de[_0x5b5163]['provider'];if(!this[_0x34e1('0x18')][_0x34e1('0x15')](_0x54ee59['id'])){this['imapAccounts'][_0x54ee59['id']]=new EmailImap(_0x54ee59,_0x3c54de[_0x5b5163][_0x34e1('0x19')]);this['imapAccounts'][_0x54ee59['id']]['on'](_0x34e1('0x1a'),this['handleImapBox'][_0x34e1('0x1b')](this,_0x5b5163));this[_0x34e1('0x18')][_0x54ee59['id']]['on'](_0x34e1('0x19'),this[_0x34e1('0x1c')]['bind'](this,_0x5b5163));this[_0x34e1('0x18')][_0x54ee59['id']]['on']('end',this[_0x34e1('0x1d')][_0x34e1('0x1b')](this,_0x5b5163));this['imapAccounts'][_0x54ee59['id']]['on'](_0x34e1('0x1e'),this['handleImapError'][_0x34e1('0x1b')](this,_0x5b5163));}}else{if(_['isNil'](this[_0x34e1('0xb')][_0x5b5163]['Imap'])){this[_0x34e1('0xb')][_0x5b5163][_0x34e1('0xf')]={};}this[_0x34e1('0xb')][_0x5b5163][_0x34e1('0xf')][_0x34e1('0x1f')]=_0x34e1('0x20');this[_0x34e1('0xb')][_0x5b5163][_0x34e1('0xf')]['messageStatus']='';this[_0x34e1('0x12')](_0x5b5163);}}}};EmailChannel['prototype'][_0x34e1('0x21')]=function(_0x5d53a,_0x1e0d6f){if(this[_0x34e1('0xb')][_0x5d53a]){this[_0x34e1('0xb')][_0x5d53a]['Imap'][_0x34e1('0x1f')]=_0x34e1('0x22');this[_0x34e1('0xb')][_0x5d53a][_0x34e1('0xf')]['messageStatus']=_0x1e0d6f[_0x34e1('0xd')];if(_0x1e0d6f[_0x34e1('0x23')]){this[_0x34e1('0xb')][_0x5d53a]['Imap'][_0x34e1('0x10')]=_0x1e0d6f[_0x34e1('0x23')]['total'];}return this['emit'](_0x5d53a);}};EmailChannel[_0x34e1('0xc')]['handleImapEmail']=function(_0xfee3d7,_0x24058f){logger[_0x34e1('0xa')](_0x34e1('0x24'),_0x24058f[_0x34e1('0x25')],_0x24058f[_0x34e1('0x26')],_0x24058f[_0x34e1('0x27')],_0xfee3d7);if(this[_0x34e1('0xb')][_0xfee3d7]){return mailAccount['notify'](_0xfee3d7,_0x24058f)[_0x34e1('0x28')](function(_0x11d80c){if(_0x11d80c){logger[_0x34e1('0xa')](_0x34e1('0x29'));}})[_0x34e1('0x2a')](function(_0xaec3c0){logger[_0x34e1('0x1e')](_0x34e1('0x2b'),JSON[_0x34e1('0x2c')](_0xaec3c0));});}};EmailChannel[_0x34e1('0xc')][_0x34e1('0x1d')]=function(_0x6d088a){if(this['mailAccounts'][_0x6d088a]&&this[_0x34e1('0xb')][_0x6d088a][_0x34e1('0xf')]){if(this['imapAccounts'][this[_0x34e1('0xb')][_0x6d088a][_0x34e1('0xf')]['id']]){delete this[_0x34e1('0x18')][this[_0x34e1('0xb')][_0x6d088a][_0x34e1('0xf')]['id']];}this[_0x34e1('0xb')][_0x6d088a][_0x34e1('0xf')][_0x34e1('0x2d')]=moment();this[_0x34e1('0x12')](_0x6d088a);}};EmailChannel[_0x34e1('0xc')][_0x34e1('0x2e')]=function(_0x4acb6c,_0x1d7512){if(this['mailAccounts'][_0x4acb6c]){this['mailAccounts'][_0x4acb6c][_0x34e1('0xf')]['status']=_0x34e1('0x1e');this[_0x34e1('0xb')][_0x4acb6c][_0x34e1('0xf')][_0x34e1('0x2f')]=_0x1d7512;return this['emit'](_0x4acb6c);}};EmailChannel['prototype'][_0x34e1('0x30')]=function(_0xde9237,_0x4f605a){return this['smtp'][_0x34e1('0x31')](_0xde9237,_0x4f605a);};EmailChannel[_0x34e1('0xc')]['verifySmtp']=function(_0x424e5c){var _0x263fb2=this;if(this[_0x34e1('0xb')][_0x424e5c['id']]){if(_[_0x34e1('0x11')](this[_0x34e1('0xb')][_0x424e5c['id']]['Smtp'])){this['mailAccounts'][_0x424e5c['id']][_0x34e1('0x32')]={};}this[_0x34e1('0xb')][_0x424e5c['id']][_0x34e1('0x32')]['lastSync']=moment();return new BPromise(function(_0x57f6cb,_0x4cc752){return _0x263fb2['smtp'][_0x34e1('0x33')](_0x424e5c)[_0x34e1('0x28')](function(_0x3c47c1){_0x263fb2['mailAccounts'][_0x424e5c['id']][_0x34e1('0x32')]['status']=_0x34e1('0x34');_0x263fb2['mailAccounts'][_0x424e5c['id']][_0x34e1('0x32')][_0x34e1('0x2f')]='';_0x263fb2[_0x34e1('0x12')](_0x424e5c['id']);_0x57f6cb(_0x3c47c1);})[_0x34e1('0x2a')](function(_0x3910d7){_0x263fb2['mailAccounts'][_0x424e5c['id']]['Smtp'][_0x34e1('0x1f')]='error';_0x263fb2[_0x34e1('0xb')][_0x424e5c['id']][_0x34e1('0x32')][_0x34e1('0x2f')]=_0x3910d7;_0x263fb2[_0x34e1('0x12')](_0x424e5c['id']);_0x4cc752(_0x3910d7);});});}return this['smtp'][_0x34e1('0x33')](_0x424e5c);};module[_0x34e1('0x35')]=EmailChannel;
\ No newline at end of file
index 07e29d8..d7257d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781d=['handleFetchError','handleCloseBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','closeBox','handleEnd','textCode','hasOwnProperty','upperFirst','exports','lodash','util','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','account','getAccount','imap','ready','handleReady','once','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','xoauth2','generateXOAuth2Token','CloudProvider','data5','anonymous@xcally.com','handleOpenBox','emit','readUnseen','end','handleReadUnseen','length','fetch','message'];(function(_0x2ae24d,_0x47ff04){var _0x179c96=function(_0x5cdde2){while(--_0x5cdde2){_0x2ae24d['push'](_0x2ae24d['shift']());}};_0x179c96(++_0x47ff04);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var Imap=require('imap');var simpleParser=require('mailparser')[_0xd781('0x2')];var Iconv=require(_0xd781('0x3'))[_0xd781('0x4')];var EventEmitter=require(_0xd781('0x5'))[_0xd781('0x6')];var utils=require(_0xd781('0x7'));var logger=require(_0xd781('0x8'))(_0xd781('0x9'));function EmailImap(_0x830b,_0x2f98ee){this['mailbox']=_0xd781('0xa');this[_0xd781('0xb')]=this[_0xd781('0xc')](_0x830b,_0x2f98ee);this[_0xd781('0xd')]=new Imap(this['account']);this[_0xd781('0xd')]['once'](_0xd781('0xe'),this[_0xd781('0xf')]['bind'](this));this[_0xd781('0xd')][_0xd781('0x10')]('end',this['handleEnd'][_0xd781('0x11')](this));this[_0xd781('0xd')]['on'](_0xd781('0x12'),this[_0xd781('0x13')][_0xd781('0x11')](this));this[_0xd781('0xd')][_0xd781('0x14')]();}util[_0xd781('0x15')](EmailImap,EventEmitter);EmailImap[_0xd781('0x16')][_0xd781('0xc')]=function(_0xd454e7,_0x587953){var _0x477bdc={'connTimeout':_0xd454e7[_0xd781('0x17')]?_0xd454e7['connTimeout']*0x3e8:0x2710,'authTimeout':_0xd454e7[_0xd781('0x18')]?_0xd454e7['authTimeout']*0x3e8:0x1388};if(_[_0xd781('0x19')](_0xd454e7[_0xd781('0x1a')])){if(_0xd454e7[_0xd781('0x1b')]){_0x477bdc[_0xd781('0x1c')]=_0xd454e7[_0xd781('0x1c')];_0x477bdc[_0xd781('0x1d')]=_0xd454e7[_0xd781('0x1d')];}_0x477bdc['host']=_0xd454e7[_0xd781('0x1e')];_0x477bdc[_0xd781('0x1f')]=_0xd454e7[_0xd781('0x1f')]||0x3e1;if(_0xd454e7[_0xd781('0x20')]){_0x477bdc[_0xd781('0x20')]=!![];}else{_0x477bdc[_0xd781('0x20')]=![];_0x477bdc[_0xd781('0x21')]=_0xd781('0x22');}}else{if(_0xd454e7['modernAuthentication']){_0x477bdc[_0xd781('0x23')]=utils[_0xd781('0x24')](_0xd454e7[_0xd781('0x25')][_0xd781('0x26')],_0xd454e7[_0xd781('0x1c')]);_0x477bdc[_0xd781('0x1c')]=_0xd454e7[_0xd781('0x1c')];}else{_0x477bdc['user']=_0xd454e7[_0xd781('0x1c')];_0x477bdc['password']=_0xd454e7['password'];}_0x477bdc[_0xd781('0x1e')]=utils['getHost'](_0xd454e7[_0xd781('0x1a')]);_0x477bdc[_0xd781('0x1f')]=0x3e1;_0x477bdc[_0xd781('0x20')]=!![];}_0x477bdc[_0xd781('0x9')]=_0x587953||_0xd454e7[_0xd781('0x1c')]||_0xd781('0x27');return _0x477bdc;};EmailImap[_0xd781('0x16')][_0xd781('0xf')]=function(){this[_0xd781('0xd')]['openBox'](this['mailbox'],![],this[_0xd781('0x28')][_0xd781('0x11')](this));};EmailImap[_0xd781('0x16')]['handleOpenBox']=function(_0xa1349e,_0x5a431b){if(_0xa1349e){this['handleError'](_0xa1349e,!![]);}else{this[_0xd781('0x29')]('box',_0x5a431b);this[_0xd781('0x2a')]();}};EmailImap[_0xd781('0x16')]['handleCloseBox']=function(_0x5b6b9d){if(_0x5b6b9d){this[_0xd781('0x13')](_0x5b6b9d,!![]);}else{this['imap'][_0xd781('0x2b')]();}};EmailImap['prototype'][_0xd781('0x2a')]=function(){this[_0xd781('0xd')]['search'](['UNSEEN'],this[_0xd781('0x2c')][_0xd781('0x11')](this));};EmailImap[_0xd781('0x16')]['handleReadUnseen']=function(_0x5291f5,_0x360f72){if(_0x5291f5){this[_0xd781('0x13')](_0x5291f5,!![]);}else{if(_0x360f72[_0xd781('0x2d')]){try{var _0x5bcd40=this['imap'][_0xd781('0x2e')](_0x360f72,{'bodies':'','markSeen':!![]});_0x5bcd40['on'](_0xd781('0x2f'),this['handleFetchMessage'][_0xd781('0x11')](this));_0x5bcd40[_0xd781('0x10')]('error',this[_0xd781('0x30')][_0xd781('0x11')](this));_0x5bcd40[_0xd781('0x10')](_0xd781('0x2b'),this['handleFetchEnd'][_0xd781('0x11')](this));}catch(_0x13d59f){logger[_0xd781('0x12')](_0x13d59f);}}else{this[_0xd781('0xd')]['closeBox'](!![],this[_0xd781('0x31')][_0xd781('0x11')](this));}}};EmailImap['prototype'][_0xd781('0x32')]=function(_0x51d0b7){_0x51d0b7['on'](_0xd781('0x33'),this[_0xd781('0x34')]['bind'](this));_0x51d0b7[_0xd781('0x10')](_0xd781('0x35'),this['handleMessageAttributes'][_0xd781('0x11')](this));_0x51d0b7['once'](_0xd781('0x2b'),this[_0xd781('0x36')]['bind'](this));};EmailImap[_0xd781('0x16')][_0xd781('0x34')]=function(_0x5651de){simpleParser(_0x5651de,{'Iconv':Iconv},this[_0xd781('0x37')][_0xd781('0x11')](this));};EmailImap[_0xd781('0x16')]['handleMessageAttributes']=function(){};EmailImap[_0xd781('0x16')][_0xd781('0x36')]=function(){};EmailImap[_0xd781('0x16')][_0xd781('0x37')]=function(_0x2e8218,_0x282d30){if(_0x2e8218){logger[_0xd781('0x12')](_0x2e8218);}else{var _0x140567=this;utils[_0xd781('0x38')](this['account'],_0x282d30,function(_0x2a60d6){_0x140567['emit'](_0xd781('0x9'),_0x2a60d6);});}};EmailImap[_0xd781('0x16')]['handleFetchEnd']=function(){this[_0xd781('0xd')][_0xd781('0x39')](!![],this[_0xd781('0x31')][_0xd781('0x11')](this));};EmailImap['prototype'][_0xd781('0x30')]=function(_0x515357){this[_0xd781('0x13')](_0x515357);this[_0xd781('0xd')]['closeBox'](!![],this['handleCloseBox'][_0xd781('0x11')](this));};EmailImap[_0xd781('0x16')][_0xd781('0x3a')]=function(){this[_0xd781('0x29')]('end');};EmailImap[_0xd781('0x16')][_0xd781('0x13')]=function(_0x4f35b6,_0x4c9f47){logger[_0xd781('0x12')](_0xd781('0x13'),this[_0xd781('0xb')]['email'],JSON['stringify'](_0x4f35b6));var _0x46828e='';if(_0x4f35b6){if(_0x4f35b6[_0xd781('0x3b')]){_0x46828e=_0x4f35b6[_0xd781('0x3b')];}else{for(var _0x411b63 in _0x4f35b6){if(_0x4f35b6[_0xd781('0x3c')](_0x411b63)){_0x46828e+=_[_0xd781('0x3d')](_0x411b63)+':\x20'+_0x4f35b6[_0x411b63]+'\x0a';}}}}if(_0x4c9f47){this['imap']['end']();}else{this[_0xd781('0x29')](_0xd781('0x12'),_0x46828e);this[_0xd781('0x29')](_0xd781('0x2b'));}};module[_0xd781('0x3e')]=EmailImap;
\ No newline at end of file
+var _0xbd51=['handleError','connect','inherits','prototype','connTimeout','isNil','service','authentication','user','password','host','tls','autotls','required','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','simpleParser','iconv','../../../config/logger','email','mailbox','INBOX','account','getAccount','ready','handleReady','bind','once','end','error'];(function(_0x4668a6,_0x4e8a1f){var _0x23215d=function(_0x4f4cfc){while(--_0x4f4cfc){_0x4668a6['push'](_0x4668a6['shift']());}};_0x23215d(++_0x4e8a1f);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1d80a7,_0x219d35){_0x1d80a7=_0x1d80a7-0x0;var _0x451dd7=_0xbd51[_0x1d80a7];return _0x451dd7;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var Imap=require(_0x1bd5('0x1'));var simpleParser=require(_0x1bd5('0x2'))[_0x1bd5('0x3')];var Iconv=require(_0x1bd5('0x4'))['Iconv'];var EventEmitter=require('events')['EventEmitter'];var utils=require('./utils');var logger=require(_0x1bd5('0x5'))(_0x1bd5('0x6'));function EmailImap(_0x43e6b6,_0x59ddfb){this[_0x1bd5('0x7')]=_0x1bd5('0x8');this[_0x1bd5('0x9')]=this[_0x1bd5('0xa')](_0x43e6b6,_0x59ddfb);this[_0x1bd5('0x1')]=new Imap(this['account']);this[_0x1bd5('0x1')]['once'](_0x1bd5('0xb'),this[_0x1bd5('0xc')][_0x1bd5('0xd')](this));this[_0x1bd5('0x1')][_0x1bd5('0xe')](_0x1bd5('0xf'),this['handleEnd'][_0x1bd5('0xd')](this));this['imap']['on'](_0x1bd5('0x10'),this[_0x1bd5('0x11')][_0x1bd5('0xd')](this));this[_0x1bd5('0x1')][_0x1bd5('0x12')]();}util[_0x1bd5('0x13')](EmailImap,EventEmitter);EmailImap[_0x1bd5('0x14')]['getAccount']=function(_0x5650b5,_0x8b2390){var _0x6d2c40={'connTimeout':_0x5650b5[_0x1bd5('0x15')]?_0x5650b5[_0x1bd5('0x15')]*0x3e8:0x2710,'authTimeout':_0x5650b5['authTimeout']?_0x5650b5['authTimeout']*0x3e8:0x1388};if(_[_0x1bd5('0x16')](_0x5650b5[_0x1bd5('0x17')])){if(_0x5650b5[_0x1bd5('0x18')]){_0x6d2c40[_0x1bd5('0x19')]=_0x5650b5[_0x1bd5('0x19')];_0x6d2c40[_0x1bd5('0x1a')]=_0x5650b5[_0x1bd5('0x1a')];}_0x6d2c40[_0x1bd5('0x1b')]=_0x5650b5[_0x1bd5('0x1b')];_0x6d2c40['port']=_0x5650b5['port']||0x3e1;if(_0x5650b5[_0x1bd5('0x1c')]){_0x6d2c40[_0x1bd5('0x1c')]=!![];}else{_0x6d2c40[_0x1bd5('0x1c')]=![];_0x6d2c40[_0x1bd5('0x1d')]=_0x1bd5('0x1e');}}else{if(_0x5650b5[_0x1bd5('0x1f')]){_0x6d2c40[_0x1bd5('0x20')]=utils[_0x1bd5('0x21')](_0x5650b5[_0x1bd5('0x22')][_0x1bd5('0x23')],_0x5650b5[_0x1bd5('0x19')]);_0x6d2c40[_0x1bd5('0x19')]=_0x5650b5[_0x1bd5('0x19')];}else{_0x6d2c40[_0x1bd5('0x19')]=_0x5650b5[_0x1bd5('0x19')];_0x6d2c40[_0x1bd5('0x1a')]=_0x5650b5[_0x1bd5('0x1a')];}_0x6d2c40[_0x1bd5('0x1b')]=utils['getHost'](_0x5650b5[_0x1bd5('0x17')]);_0x6d2c40['port']=0x3e1;_0x6d2c40[_0x1bd5('0x1c')]=!![];}_0x6d2c40[_0x1bd5('0x6')]=_0x8b2390||_0x5650b5[_0x1bd5('0x19')]||'anonymous@xcally.com';return _0x6d2c40;};EmailImap[_0x1bd5('0x14')]['handleReady']=function(){this[_0x1bd5('0x1')][_0x1bd5('0x24')](this[_0x1bd5('0x7')],![],this[_0x1bd5('0x25')]['bind'](this));};EmailImap[_0x1bd5('0x14')][_0x1bd5('0x25')]=function(_0x20245c,_0x3b1090){if(_0x20245c){this['handleError'](_0x20245c,!![]);}else{this[_0x1bd5('0x26')](_0x1bd5('0x27'),_0x3b1090);this[_0x1bd5('0x28')]();}};EmailImap[_0x1bd5('0x14')][_0x1bd5('0x29')]=function(_0xc73670){if(_0xc73670){this['handleError'](_0xc73670,!![]);}else{this[_0x1bd5('0x1')][_0x1bd5('0xf')]();}};EmailImap[_0x1bd5('0x14')]['readUnseen']=function(){this[_0x1bd5('0x1')][_0x1bd5('0x2a')]([_0x1bd5('0x2b')],this[_0x1bd5('0x2c')][_0x1bd5('0xd')](this));};EmailImap[_0x1bd5('0x14')]['handleReadUnseen']=function(_0x49ea1e,_0x26be8e){if(_0x49ea1e){this[_0x1bd5('0x11')](_0x49ea1e,!![]);}else{if(_0x26be8e['length']){try{var _0x36649d=this[_0x1bd5('0x1')][_0x1bd5('0x2d')](_0x26be8e,{'bodies':'','markSeen':!![]});_0x36649d['on'](_0x1bd5('0x2e'),this['handleFetchMessage'][_0x1bd5('0xd')](this));_0x36649d[_0x1bd5('0xe')](_0x1bd5('0x10'),this[_0x1bd5('0x2f')][_0x1bd5('0xd')](this));_0x36649d[_0x1bd5('0xe')](_0x1bd5('0xf'),this[_0x1bd5('0x30')]['bind'](this));}catch(_0x473f1d){logger[_0x1bd5('0x10')](_0x473f1d);}}else{this[_0x1bd5('0x1')][_0x1bd5('0x31')](!![],this[_0x1bd5('0x29')][_0x1bd5('0xd')](this));}}};EmailImap[_0x1bd5('0x14')]['handleFetchMessage']=function(_0x448aad){_0x448aad['on'](_0x1bd5('0x32'),this[_0x1bd5('0x33')][_0x1bd5('0xd')](this));_0x448aad[_0x1bd5('0xe')](_0x1bd5('0x34'),this[_0x1bd5('0x35')]['bind'](this));_0x448aad['once'](_0x1bd5('0xf'),this[_0x1bd5('0x36')][_0x1bd5('0xd')](this));};EmailImap['prototype'][_0x1bd5('0x33')]=function(_0x5af974){simpleParser(_0x5af974,{'Iconv':Iconv},this[_0x1bd5('0x37')][_0x1bd5('0xd')](this));};EmailImap[_0x1bd5('0x14')][_0x1bd5('0x35')]=function(){};EmailImap[_0x1bd5('0x14')][_0x1bd5('0x36')]=function(){};EmailImap[_0x1bd5('0x14')][_0x1bd5('0x37')]=function(_0x4bbefc,_0x114a96){if(_0x4bbefc){logger[_0x1bd5('0x10')](_0x4bbefc);}else{var _0x502724=this;utils[_0x1bd5('0x38')](this[_0x1bd5('0x9')],_0x114a96,function(_0x20b25c){_0x502724['emit'](_0x1bd5('0x6'),_0x20b25c);});}};EmailImap[_0x1bd5('0x14')][_0x1bd5('0x30')]=function(){this[_0x1bd5('0x1')]['closeBox'](!![],this[_0x1bd5('0x29')][_0x1bd5('0xd')](this));};EmailImap[_0x1bd5('0x14')][_0x1bd5('0x2f')]=function(_0x4de69a){this['handleError'](_0x4de69a);this[_0x1bd5('0x1')][_0x1bd5('0x31')](!![],this[_0x1bd5('0x29')]['bind'](this));};EmailImap[_0x1bd5('0x14')][_0x1bd5('0x39')]=function(){this['emit'](_0x1bd5('0xf'));};EmailImap['prototype'][_0x1bd5('0x11')]=function(_0x218efb,_0x53ad5c){logger[_0x1bd5('0x10')](_0x1bd5('0x11'),this[_0x1bd5('0x9')][_0x1bd5('0x6')],JSON[_0x1bd5('0x3a')](_0x218efb));var _0x25b35a='';if(_0x218efb){if(_0x218efb[_0x1bd5('0x3b')]){_0x25b35a=_0x218efb[_0x1bd5('0x3b')];}else{for(var _0x162c83 in _0x218efb){if(_0x218efb[_0x1bd5('0x3c')](_0x162c83)){_0x25b35a+=_[_0x1bd5('0x3d')](_0x162c83)+':\x20'+_0x218efb[_0x162c83]+'\x0a';}}}}if(_0x53ad5c){this[_0x1bd5('0x1')]['end']();}else{this[_0x1bd5('0x26')](_0x1bd5('0x10'),_0x25b35a);this[_0x1bd5('0x26')]('end');}};module[_0x1bd5('0x3e')]=EmailImap;
\ No newline at end of file
index ff0db2c..0da87ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c85=['toString','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','use','compile','sendMail','createTransport','verify'];(function(_0x3d94ed,_0x561b11){var _0x190772=function(_0x2fa77a){while(--_0x2fa77a){_0x3d94ed['push'](_0x3d94ed['shift']());}};_0x190772(++_0x561b11);}(_0x8c85,0x9d));var _0x58c8=function(_0x175550,_0x4a93e0){_0x175550=_0x175550-0x0;var _0x46e6c1=_0x8c85[_0x175550];return _0x46e6c1;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x58c8('0x0'));function EmailSmtp(){}EmailSmtp[_0x58c8('0x1')][_0x58c8('0x2')]=function(_0x3906ca,_0x50f0cd){return new Promise(function(_0x95674a,_0x5e0235){var _0x538937=nodemailer['createTransport'](_0x3906ca);_0x538937[_0x58c8('0x3')](_0x58c8('0x4'),inlineBase64());_0x538937[_0x58c8('0x5')](_0x50f0cd,function(_0x38c2cd,_0x11fa5a){if(_0x38c2cd){_0x5e0235(_0x38c2cd['toString']());}else{_0x95674a(_0x11fa5a);}});});};EmailSmtp[_0x58c8('0x1')]['verify']=function(_0x3aa5d0){return new Promise(function(_0xe7c2e0,_0x2c7a8b){var _0xee7c66=nodemailer[_0x58c8('0x6')](_0x3aa5d0);_0xee7c66[_0x58c8('0x7')](function(_0x4d414e,_0x3fc67c){if(_0x4d414e){_0x2c7a8b(_0x4d414e[_0x58c8('0x8')]());}else{if(_0x3fc67c){_0xe7c2e0(_0x3fc67c);}else{_0x2c7a8b(_0x58c8('0x9'));}}});});};module[_0x58c8('0xa')]=EmailSmtp;
\ No newline at end of file
+var _0x83dc=['compile','sendMail','toString','prototype','verify','createTransport','Not\x20verifired','nodemailer','send','use'];(function(_0xa3cf69,_0x52a786){var _0x3e3d46=function(_0x5189aa){while(--_0x5189aa){_0xa3cf69['push'](_0xa3cf69['shift']());}};_0x3e3d46(++_0x52a786);}(_0x83dc,0x133));var _0xc83d=function(_0x41f581,_0x47e8d7){_0x41f581=_0x41f581-0x0;var _0x4c016b=_0x83dc[_0x41f581];return _0x4c016b;};'use strict';var nodemailer=require(_0xc83d('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xc83d('0x1')]=function(_0x8942a0,_0x146a92){return new Promise(function(_0x8d3e51,_0x2d8d96){var _0x243a9e=nodemailer['createTransport'](_0x8942a0);_0x243a9e[_0xc83d('0x2')](_0xc83d('0x3'),inlineBase64());_0x243a9e[_0xc83d('0x4')](_0x146a92,function(_0x15d12e,_0x16efb4){if(_0x15d12e){_0x2d8d96(_0x15d12e[_0xc83d('0x5')]());}else{_0x8d3e51(_0x16efb4);}});});};EmailSmtp[_0xc83d('0x6')][_0xc83d('0x7')]=function(_0x56ac9e){return new Promise(function(_0x5c032d,_0x551486){var _0x3c4c26=nodemailer[_0xc83d('0x8')](_0x56ac9e);_0x3c4c26[_0xc83d('0x7')](function(_0x7c9680,_0x22bc82){if(_0x7c9680){_0x551486(_0x7c9680['toString']());}else{if(_0x22bc82){_0x5c032d(_0x22bc82);}else{_0x551486(_0xc83d('0x9'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
index b69afa4..57a41c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4032=['filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','message','originTo','originCc','bcc','attach','attachment','attachment-','format','%s-%s','now','root','writeFileSync','content','push','headerLines','Auto-Submitted:\x20auto-replied','indexOf','line','isAutoreply','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','generateXOAuth2Token','user=','utf-8','toString','base64','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','split','length','slice','join','Anonymous','pop','isEmpty','html','replace','includes','<img','attachments','forEach'];(function(_0xb62bc6,_0xb5659c){var _0x572c6b=function(_0x4c565f){while(--_0x4c565f){_0xb62bc6['push'](_0xb62bc6['shift']());}};_0x572c6b(++_0xb5659c);}(_0x4032,0x1ca));var _0x2403=function(_0x5c023f,_0x416c3b){_0x5c023f=_0x5c023f-0x0;var _0x109b20=_0x4032[_0x5c023f];return _0x109b20;};'use strict';var _=require('lodash');var moment=require(_0x2403('0x0'));var random=require(_0x2403('0x1'));var fs=require('fs');var path=require(_0x2403('0x2'));var util=require(_0x2403('0x3'));var tnef=require('node-tnef');var logger=require(_0x2403('0x4'))(_0x2403('0x5'));var config=require(_0x2403('0x6'));function getAddress(_0x547a2a){var _0x48ac17=_[_0x2403('0x7')](_0x547a2a[_0x2403('0x8')]);return _0x48ac17&&_0x48ac17[_0x2403('0x9')]?_0x48ac17[_0x2403('0x9')]:_0x2403('0xa')+random[_0x2403('0xb')](0x6)+_0x2403('0xc');}function getFirstName(_0x49cfe1){var _0x5d9b35=_[_0x2403('0x7')](_0x49cfe1[_0x2403('0x8')]);if(_0x5d9b35&&_0x5d9b35['name']){if(_0x5d9b35[_0x2403('0xd')]==_0x5d9b35[_0x2403('0x9')]){return _0x5d9b35['name'][_0x2403('0xe')](0x0,_0x5d9b35[_0x2403('0xd')]['indexOf']('@'));}var _0x507330=_0x5d9b35['name'][_0x2403('0xf')](/\s+/);return _0x507330[_0x2403('0x10')]>0x1?_0x507330[_0x2403('0x11')](0x0,-0x1)[_0x2403('0x12')]('\x20'):_0x5d9b35[_0x2403('0xd')];}return _0x2403('0x13');}function getLastName(_0x192991){var _0x7e4b87=_[_0x2403('0x7')](_0x192991['value']);if(_0x7e4b87&&_0x7e4b87[_0x2403('0xd')]){var _0x101cfb=_0x7e4b87['name'][_0x2403('0xf')](/\s+/);return _0x101cfb[_0x2403('0x10')]>0x1?_0x101cfb[_0x2403('0x14')]():'';}return'';}function getMails(_0x2a72ed,_0x2974fd){var _0xfc45dc='';for(var _0x17e5c9=0x0;_0x17e5c9<_0x2974fd['value'][_0x2403('0x10')];_0x17e5c9+=0x1){if(_0x2974fd[_0x2403('0x8')][_0x17e5c9][_0x2403('0x9')]!==_0x2a72ed){if(!_[_0x2403('0x15')](_0xfc45dc)){_0xfc45dc+=',';}_0xfc45dc+=_0x2974fd[_0x2403('0x8')][_0x17e5c9][_0x2403('0xd')]||_0x2974fd[_0x2403('0x8')][_0x17e5c9][_0x2403('0x9')]||'';_0xfc45dc+='\x20<';_0xfc45dc+=_0x2974fd[_0x2403('0x8')][_0x17e5c9][_0x2403('0x9')]?_0x2974fd[_0x2403('0x8')][_0x17e5c9][_0x2403('0x9')]:_0x2403('0xa')+random[_0x2403('0xb')](0x6)+_0x2403('0xc');_0xfc45dc+='>';}}return _0xfc45dc;}function parseEmail(_0x477527,_0x461df9,_0x30252c){if(_0x461df9[_0x2403('0x16')]){var _0x6cc304=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x6cc304['test'](_0x461df9['html'])){_0x461df9[_0x2403('0x16')]=_0x461df9[_0x2403('0x16')][_0x2403('0x17')](_0x6cc304,'');}if(_0x461df9['html'][_0x2403('0x18')](_0x2403('0x19'))){var _0x4caf9c=[];_0x461df9[_0x2403('0x1a')][_0x2403('0x1b')](_0x5e5999=>{_0x4caf9c['push'](_0x5e5999[_0x2403('0x1c')]);});var _0x250471=/<img.*? _SRC(.*?)[^>]+>/g;var _0x1172e6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2e1a41=_0x461df9[_0x2403('0x16')][_0x2403('0x17')](_0x1172e6,_0x2403('0x1d'));var _0x5e10bb=_0x2e1a41[_0x2403('0x17')](_0x250471,_0x2403('0x1e'));for(let _0x203c16=0x0;_0x203c16<_0x4caf9c['length'];_0x203c16++){var _0x26d4be=_0x5e10bb[_0x2403('0x17')](_0x2403('0x1e'),_0x2403('0x1f')+_0x4caf9c[_0x203c16]+_0x2403('0x20'));_0x5e10bb=_0x26d4be;}_0x461df9['html']=_0x5e10bb;}_0x30252c[_0x2403('0x21')]=_0x461df9[_0x2403('0x16')];}else{_0x30252c[_0x2403('0x21')]=_0x461df9['textAsHtml'];}if(_0x30252c[_0x2403('0x21')]){_0x30252c['body']=_0x30252c[_0x2403('0x21')][_0x2403('0x17')](/<a\s+/gi,'<a\x20target=\x22_blank\x22\x20');}if(_0x461df9['to']){_0x30252c[_0x2403('0x22')][_0x2403('0x23')]=getMails(null,_0x461df9['to']);var _0x25174b=getMails(_0x477527[_0x2403('0x5')],_0x461df9['to']);if(!_[_0x2403('0x15')](_0x25174b)){_0x30252c[_0x2403('0x22')]['cc']+=_0x25174b;}}if(_0x461df9['cc']){_0x30252c[_0x2403('0x22')][_0x2403('0x24')]=getMails(null,_0x461df9['cc']);var _0x2234e5=getMails(_0x477527[_0x2403('0x5')],_0x461df9['cc']);if(!_[_0x2403('0x15')](_0x2234e5)){if(!_[_0x2403('0x15')](_0x30252c[_0x2403('0x22')]['cc'])){_0x30252c['message']['cc']+=',';}_0x30252c[_0x2403('0x22')]['cc']+=_0x2234e5;}}if(!_[_0x2403('0x18')](_0x30252c[_0x2403('0x22')][_0x2403('0x23')],_0x477527[_0x2403('0x5')])&&!_[_0x2403('0x18')](_0x30252c[_0x2403('0x22')][_0x2403('0x24')],_0x477527[_0x2403('0x5')])){_0x30252c[_0x2403('0x22')][_0x2403('0x25')]=_0x477527['email'];}if(_0x461df9[_0x2403('0x1a')]&&_0x461df9[_0x2403('0x1a')][_0x2403('0x10')]){_0x30252c[_0x2403('0x22')][_0x2403('0x26')]=_0x461df9[_0x2403('0x1a')][_0x2403('0x10')];for(var _0x3da1dc=0x0,_0x1ff615,_0x31bbc2,_0x3024ea;_0x3da1dc<_0x461df9[_0x2403('0x1a')]['length'];_0x3da1dc+=0x1){if(_0x461df9['attachments'][_0x3da1dc]['type']===_0x2403('0x27')){_0x3024ea=_0x461df9[_0x2403('0x1a')][_0x3da1dc][_0x2403('0x1c')]||_0x2403('0x28')+_0x3da1dc;_0x1ff615=util[_0x2403('0x29')](_0x2403('0x2a'),Date[_0x2403('0x2b')](),_0x3024ea);_0x31bbc2=path[_0x2403('0x12')](config[_0x2403('0x2c')],'server/files/attachments/',_0x1ff615);fs[_0x2403('0x2d')](_0x31bbc2,_0x461df9[_0x2403('0x1a')][_0x3da1dc][_0x2403('0x2e')]);_0x30252c[_0x2403('0x22')]['attachments'][_0x2403('0x2f')]({'name':_0x3024ea,'basename':_0x1ff615,'type':_0x461df9['attachments'][_0x3da1dc]['contentType'],'filepath':_0x31bbc2});}}}if(_0x461df9[_0x2403('0x30')]&&_0x461df9[_0x2403('0x30')][_0x2403('0x10')]>0x0){var _0x17d32a=[_0x2403('0x31'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x2185ca=0x0;_0x2185ca<_0x461df9['headerLines'][_0x2403('0x10')];_0x2185ca++){var _0x39af49=_[_0x2403('0x32')](_0x17d32a,_0x461df9[_0x2403('0x30')][_0x2185ca][_0x2403('0x33')]);if(_0x39af49>=0x0){_0x30252c[_0x2403('0x34')]=!![];}}}return _0x30252c;}exports['parser']=function(_0x4ff45d,_0x4d284f,_0x2b01a9){var _0x335575={'from':getAddress(_0x4d284f[_0x2403('0x35')]),'firstName':getFirstName(_0x4d284f[_0x2403('0x35')]),'lastName':getLastName(_0x4d284f[_0x2403('0x35')]),'mapKey':_0x2403('0x5'),'message':{'from':getMails(_0x4ff45d[_0x2403('0x5')],_0x4d284f[_0x2403('0x35')]),'to':_0x4ff45d['email'],'cc':'','subject':_0x4d284f['subject']||'','messageId':_0x4d284f[_0x2403('0x36')],'inReplyTo':_0x4d284f[_0x2403('0x37')],'sentAt':moment(_0x4d284f[_0x2403('0x38')])['format'](_0x2403('0x39')),'attach':![],'attachments':[]}};if(!_0x4d284f[_0x2403('0x16')]&&!_0x4d284f['textAsHtml']){var _0x31191b=_[_0x2403('0x3a')](_0x4d284f[_0x2403('0x1a')],{'contentType':_0x2403('0x3b')});if(_0x31191b['length']){logger['info'](util[_0x2403('0x29')](_0x2403('0x3c'),_0x4d284f[_0x2403('0x36')]));tnef['parseBuffer'](_[_0x2403('0x3d')](_0x31191b)[_0x2403('0x2e')],function(_0x304dbf,_0x36f917){if(_0x36f917){_0x4d284f[_0x2403('0x16')]=_0x36f917[_0x2403('0x3e')]||_0x2403('0x3f');if(_0x36f917[_0x2403('0x40')]){for(var _0x519323=0x0;_0x519323<_0x36f917[_0x2403('0x40')][_0x2403('0x10')];_0x519323++){var _0x242434=_0x36f917[_0x2403('0x40')][_0x519323];_0x335575['message'][_0x2403('0x1a')]['push']({'filename':_0x242434[_0x2403('0x41')],'content':Buffer[_0x2403('0x35')](_0x242434[_0x2403('0x42')])});}}}_0x2b01a9(parseEmail(_0x4ff45d,_0x4d284f,_0x335575));});}else{_0x4d284f[_0x2403('0x16')]=_0x2403('0x3f');_0x2b01a9(parseEmail(_0x4ff45d,_0x4d284f,_0x335575));}}else{_0x2b01a9(parseEmail(_0x4ff45d,_0x4d284f,_0x335575));}};exports[_0x2403('0x43')]=function(_0x3af410){switch(_0x3af410){case'gmail':return _0x2403('0x44');case _0x2403('0x45'):return _0x2403('0x46');case _0x2403('0x47'):return _0x2403('0x48');case _0x2403('0x49'):return _0x2403('0x4a');}return _0x2403('0x4b');};exports[_0x2403('0x4c')]=function(_0x20599d,_0x22731c){var _0x6522e7=[_0x2403('0x4d')+(_0x22731c||''),'auth=Bearer\x20'+_0x20599d,'',''];return Buffer['from'](_0x6522e7[_0x2403('0x12')]('\ 1'),_0x2403('0x4e'))[_0x2403('0x4f')](_0x2403('0x50'));};
\ No newline at end of file
+var _0x8d26=['auth=Bearer\x20','join','utf-8','toString','base64','lodash','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','length','slice','split','pop','isEmpty','html','test','replace','includes','<img','attachments','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originCc','originTo','bcc','attach','type','attachment','filename','attachment-','format','%s-%s','now','root','server/files/attachments/','content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','gmail','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','generateXOAuth2Token','user='];(function(_0x44f05d,_0x6437c2){var _0x84fda0=function(_0x3dd483){while(--_0x3dd483){_0x44f05d['push'](_0x44f05d['shift']());}};_0x84fda0(++_0x6437c2);}(_0x8d26,0x1f1));var _0x68d2=function(_0x486f8e,_0x52fb5f){_0x486f8e=_0x486f8e-0x0;var _0x528b66=_0x8d26[_0x486f8e];return _0x528b66;};'use strict';var _=require(_0x68d2('0x0'));var moment=require('moment');var random=require(_0x68d2('0x1'));var fs=require('fs');var path=require(_0x68d2('0x2'));var util=require('util');var tnef=require(_0x68d2('0x3'));var logger=require(_0x68d2('0x4'))(_0x68d2('0x5'));var config=require(_0x68d2('0x6'));function getAddress(_0x2e421d){var _0xa60044=_[_0x68d2('0x7')](_0x2e421d[_0x68d2('0x8')]);return _0xa60044&&_0xa60044[_0x68d2('0x9')]?_0xa60044['address']:'anonymous'+random[_0x68d2('0xa')](0x6)+_0x68d2('0xb');}function getFirstName(_0xb1f55d){var _0x247a5a=_[_0x68d2('0x7')](_0xb1f55d[_0x68d2('0x8')]);if(_0x247a5a&&_0x247a5a[_0x68d2('0xc')]){if(_0x247a5a[_0x68d2('0xc')]==_0x247a5a['address']){return _0x247a5a[_0x68d2('0xc')][_0x68d2('0xd')](0x0,_0x247a5a[_0x68d2('0xc')][_0x68d2('0xe')]('@'));}var _0x539f56=_0x247a5a[_0x68d2('0xc')]['split'](/\s+/);return _0x539f56[_0x68d2('0xf')]>0x1?_0x539f56[_0x68d2('0x10')](0x0,-0x1)['join']('\x20'):_0x247a5a[_0x68d2('0xc')];}return'Anonymous';}function getLastName(_0x280e3f){var _0x5944ea=_[_0x68d2('0x7')](_0x280e3f[_0x68d2('0x8')]);if(_0x5944ea&&_0x5944ea[_0x68d2('0xc')]){var _0x189f47=_0x5944ea[_0x68d2('0xc')][_0x68d2('0x11')](/\s+/);return _0x189f47['length']>0x1?_0x189f47[_0x68d2('0x12')]():'';}return'';}function getMails(_0x2e6f32,_0x5330fc){var _0x251349='';for(var _0x463cf7=0x0;_0x463cf7<_0x5330fc[_0x68d2('0x8')][_0x68d2('0xf')];_0x463cf7+=0x1){if(_0x5330fc[_0x68d2('0x8')][_0x463cf7][_0x68d2('0x9')]!==_0x2e6f32){if(!_[_0x68d2('0x13')](_0x251349)){_0x251349+=',';}_0x251349+=_0x5330fc[_0x68d2('0x8')][_0x463cf7][_0x68d2('0xc')]||_0x5330fc[_0x68d2('0x8')][_0x463cf7]['address']||'';_0x251349+='\x20<';_0x251349+=_0x5330fc[_0x68d2('0x8')][_0x463cf7][_0x68d2('0x9')]?_0x5330fc[_0x68d2('0x8')][_0x463cf7][_0x68d2('0x9')]:'anonymous'+random[_0x68d2('0xa')](0x6)+_0x68d2('0xb');_0x251349+='>';}}return _0x251349;}function parseEmail(_0x4cacf8,_0x26ea27,_0x5acc73){if(_0x26ea27[_0x68d2('0x14')]){var _0x445452=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x445452[_0x68d2('0x15')](_0x26ea27[_0x68d2('0x14')])){_0x26ea27[_0x68d2('0x14')]=_0x26ea27['html'][_0x68d2('0x16')](_0x445452,'');}if(_0x26ea27['html'][_0x68d2('0x17')](_0x68d2('0x18'))){var _0x48a71f=[];_0x26ea27[_0x68d2('0x19')]['forEach'](_0xbc855=>{_0x48a71f['push'](_0xbc855['filename']);});var _0x4ab55e=/<img.*? _SRC(.*?)[^>]+>/g;var _0x1ba385=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5cf26c=_0x26ea27[_0x68d2('0x14')][_0x68d2('0x16')](_0x1ba385,'_SRC');var _0x27ad1a=_0x5cf26c[_0x68d2('0x16')](_0x4ab55e,'_IMG');for(let _0x5d273a=0x0;_0x5d273a<_0x48a71f[_0x68d2('0xf')];_0x5d273a++){var _0x31cd1d=_0x27ad1a[_0x68d2('0x16')](_0x68d2('0x1a'),_0x68d2('0x1b')+_0x48a71f[_0x5d273a]+'\x20]</span>');_0x27ad1a=_0x31cd1d;}_0x26ea27[_0x68d2('0x14')]=_0x27ad1a;}_0x5acc73[_0x68d2('0x1c')]=_0x26ea27['html'];}else{_0x5acc73['body']=_0x26ea27[_0x68d2('0x1d')];}if(_0x5acc73[_0x68d2('0x1c')]){_0x5acc73['body']=_0x5acc73[_0x68d2('0x1c')]['replace'](/<a\s+/gi,_0x68d2('0x1e'));}if(_0x26ea27['to']){_0x5acc73[_0x68d2('0x1f')]['originTo']=getMails(null,_0x26ea27['to']);var _0x438ba1=getMails(_0x4cacf8[_0x68d2('0x5')],_0x26ea27['to']);if(!_['isEmpty'](_0x438ba1)){_0x5acc73[_0x68d2('0x1f')]['cc']+=_0x438ba1;}}if(_0x26ea27['cc']){_0x5acc73[_0x68d2('0x1f')][_0x68d2('0x20')]=getMails(null,_0x26ea27['cc']);var _0x35d3c8=getMails(_0x4cacf8[_0x68d2('0x5')],_0x26ea27['cc']);if(!_[_0x68d2('0x13')](_0x35d3c8)){if(!_[_0x68d2('0x13')](_0x5acc73[_0x68d2('0x1f')]['cc'])){_0x5acc73[_0x68d2('0x1f')]['cc']+=',';}_0x5acc73[_0x68d2('0x1f')]['cc']+=_0x35d3c8;}}if(!_[_0x68d2('0x17')](_0x5acc73[_0x68d2('0x1f')][_0x68d2('0x21')],_0x4cacf8['email'])&&!_['includes'](_0x5acc73[_0x68d2('0x1f')][_0x68d2('0x20')],_0x4cacf8['email'])){_0x5acc73[_0x68d2('0x1f')][_0x68d2('0x22')]=_0x4cacf8['email'];}if(_0x26ea27[_0x68d2('0x19')]&&_0x26ea27[_0x68d2('0x19')][_0x68d2('0xf')]){_0x5acc73[_0x68d2('0x1f')][_0x68d2('0x23')]=_0x26ea27[_0x68d2('0x19')]['length'];for(var _0xc107d3=0x0,_0xdfb2a1,_0x390248,_0x4877cb;_0xc107d3<_0x26ea27[_0x68d2('0x19')]['length'];_0xc107d3+=0x1){if(_0x26ea27[_0x68d2('0x19')][_0xc107d3][_0x68d2('0x24')]===_0x68d2('0x25')){_0x4877cb=_0x26ea27['attachments'][_0xc107d3][_0x68d2('0x26')]||_0x68d2('0x27')+_0xc107d3;_0xdfb2a1=util[_0x68d2('0x28')](_0x68d2('0x29'),Date[_0x68d2('0x2a')](),_0x4877cb);_0x390248=path['join'](config[_0x68d2('0x2b')],_0x68d2('0x2c'),_0xdfb2a1);fs['writeFileSync'](_0x390248,_0x26ea27['attachments'][_0xc107d3][_0x68d2('0x2d')]);_0x5acc73[_0x68d2('0x1f')]['attachments'][_0x68d2('0x2e')]({'name':_0x4877cb,'basename':_0xdfb2a1,'type':_0x26ea27[_0x68d2('0x19')][_0xc107d3][_0x68d2('0x2f')],'filepath':_0x390248});}}}if(_0x26ea27['headerLines']&&_0x26ea27[_0x68d2('0x30')][_0x68d2('0xf')]>0x0){var _0x4fc835=[_0x68d2('0x31'),_0x68d2('0x32'),_0x68d2('0x33')];for(var _0x2373d7=0x0;_0x2373d7<_0x26ea27[_0x68d2('0x30')][_0x68d2('0xf')];_0x2373d7++){var _0x552ac1=_[_0x68d2('0xe')](_0x4fc835,_0x26ea27[_0x68d2('0x30')][_0x2373d7][_0x68d2('0x34')]);if(_0x552ac1>=0x0){_0x5acc73[_0x68d2('0x35')]=!![];}}}return _0x5acc73;}exports[_0x68d2('0x36')]=function(_0x12a88a,_0x1c5981,_0x18f393){var _0x14c6ae={'from':getAddress(_0x1c5981[_0x68d2('0x37')]),'firstName':getFirstName(_0x1c5981[_0x68d2('0x37')]),'lastName':getLastName(_0x1c5981[_0x68d2('0x37')]),'mapKey':_0x68d2('0x5'),'message':{'from':getMails(_0x12a88a['email'],_0x1c5981[_0x68d2('0x37')]),'to':_0x12a88a[_0x68d2('0x5')],'cc':'','subject':_0x1c5981[_0x68d2('0x38')]||'','messageId':_0x1c5981['messageId'],'inReplyTo':_0x1c5981[_0x68d2('0x39')],'sentAt':moment(_0x1c5981[_0x68d2('0x3a')])[_0x68d2('0x28')](_0x68d2('0x3b')),'attach':![],'attachments':[]}};if(!_0x1c5981[_0x68d2('0x14')]&&!_0x1c5981[_0x68d2('0x1d')]){var _0x46cf74=_[_0x68d2('0x3c')](_0x1c5981[_0x68d2('0x19')],{'contentType':_0x68d2('0x3d')});if(_0x46cf74[_0x68d2('0xf')]){logger[_0x68d2('0x3e')](util[_0x68d2('0x28')](_0x68d2('0x3f'),_0x1c5981['messageId']));tnef[_0x68d2('0x40')](_['first'](_0x46cf74)['content'],function(_0x51fa5a,_0x35f396){if(_0x35f396){_0x1c5981['html']=_0x35f396[_0x68d2('0x41')]||_0x68d2('0x42');if(_0x35f396['Attachments']){for(var _0x4d1f39=0x0;_0x4d1f39<_0x35f396[_0x68d2('0x43')][_0x68d2('0xf')];_0x4d1f39++){var _0x19b146=_0x35f396[_0x68d2('0x43')][_0x4d1f39];_0x14c6ae['message'][_0x68d2('0x19')][_0x68d2('0x2e')]({'filename':_0x19b146[_0x68d2('0x44')],'content':Buffer[_0x68d2('0x37')](_0x19b146['Data'])});}}}_0x18f393(parseEmail(_0x12a88a,_0x1c5981,_0x14c6ae));});}else{_0x1c5981['html']=_0x68d2('0x42');_0x18f393(parseEmail(_0x12a88a,_0x1c5981,_0x14c6ae));}}else{_0x18f393(parseEmail(_0x12a88a,_0x1c5981,_0x14c6ae));}};exports['getHost']=function(_0xba728a){switch(_0xba728a){case _0x68d2('0x45'):return'imap.gmail.com';case'yahoo':return _0x68d2('0x46');case _0x68d2('0x47'):return'imap-mail.outlook.com';case _0x68d2('0x48'):return _0x68d2('0x49');}return _0x68d2('0x4a');};exports[_0x68d2('0x4b')]=function(_0x1e7443,_0x52a096){var _0x5df980=[_0x68d2('0x4c')+(_0x52a096||''),_0x68d2('0x4d')+_0x1e7443,'',''];return Buffer[_0x68d2('0x37')](_0x5df980[_0x68d2('0x4e')]('\ 1'),_0x68d2('0x4f'))[_0x68d2('0x50')](_0x68d2('0x51'));};
\ No newline at end of file
index a486dc9..6cd8cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad1c=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x5d1eff,_0x48d692){var _0x4ebb29=function(_0x52b228){while(--_0x52b228){_0x5d1eff['push'](_0x5d1eff['shift']());}};_0x4ebb29(++_0x48d692);}(_0xad1c,0x7f));var _0xcad1=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xad1c[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0xcad1('0x0'));function MailAccount(_0x3ee231){this['id']=_0x3ee231['id']||0x0;this[_0xcad1('0x1')]=_0x3ee231[_0xcad1('0x1')]||_0xcad1('0x2');this[_0xcad1('0x3')]=_0x3ee231[_0xcad1('0x3')]||_0xcad1('0x4');this['active']=_0x3ee231[_0xcad1('0x5')]||![];this[_0xcad1('0x6')]=_0x3ee231['Imap']||[];this[_0xcad1('0x7')]=_0x3ee231[_0xcad1('0x7')]||[];}module[_0xcad1('0x8')]=MailAccount;
\ No newline at end of file
+var _0x9a5c=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x2a206b,_0x7d17f2){var _0x54aaf8=function(_0x1e81b1){while(--_0x1e81b1){_0x2a206b['push'](_0x2a206b['shift']());}};_0x54aaf8(++_0x7d17f2);}(_0x9a5c,0x10e));var _0xc9a5=function(_0x45fca1,_0x4786c7){_0x45fca1=_0x45fca1-0x0;var _0x3e3cf1=_0x9a5c[_0x45fca1];return _0x3e3cf1;};'use strict';var _=require(_0xc9a5('0x0'));function MailAccount(_0x1c8221){this['id']=_0x1c8221['id']||0x0;this['name']=_0x1c8221[_0xc9a5('0x1')]||_0xc9a5('0x2');this[_0xc9a5('0x3')]=_0x1c8221[_0xc9a5('0x3')]||_0xc9a5('0x4');this[_0xc9a5('0x5')]=_0x1c8221[_0xc9a5('0x5')]||![];this['Imap']=_0x1c8221[_0xc9a5('0x6')]||[];this[_0xc9a5('0x7')]=_0x1c8221[_0xc9a5('0x7')]||[];}module[_0xc9a5('0x8')]=MailAccount;
\ No newline at end of file
index f26a383..9e64ef4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3954=['initMailAccounts','length','isUndefined','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x91e7f3,_0x30dbe4){var _0x1f996b=function(_0xecc8a1){while(--_0xecc8a1){_0x91e7f3['push'](_0x91e7f3['shift']());}};_0x1f996b(++_0x30dbe4);}(_0x3954,0x7c));var _0x4395=function(_0x4e7944,_0x468d08){_0x4e7944=_0x4e7944-0x0;var _0x9dbcc8=_0x3954[_0x4e7944];return _0x9dbcc8;};'use strict';var _=require('lodash');var MailAccount=require(_0x4395('0x0'));var Realtime=function(){this[_0x4395('0x1')]={};};function freeIsNotKey(_0x503270,_0x1d2864,_0x485d57){var _0x58fb51=_[_0x4395('0x2')](_0x503270,function(_0x35404a,_0x17d2cb){return _0x35404a[_0x485d57];});for(var _0x4a662f in _0x1d2864){if(_0x1d2864[_0x4395('0x3')](_0x4a662f)){if(!_0x58fb51[_0x4a662f]){delete _0x1d2864[_0x4a662f];}}}}Realtime[_0x4395('0x4')][_0x4395('0x5')]=function(_0x5af9d9,_0x57dec1){for(var _0xdfec60 in _0x57dec1){if(_0x5af9d9['hasOwnProperty'](_0xdfec60)){_0x5af9d9[_0xdfec60]=_0x57dec1[_0xdfec60];}}};Realtime[_0x4395('0x4')][_0x4395('0x6')]=function(){var _0x32e280=this;return function(_0x3c1b44){if(_0x3c1b44){freeIsNotKey(_0x3c1b44,_0x32e280['mailAccounts'],'id');for(var _0x3723b0=0x0,_0x2b9da4={},_0x3b5b80={};_0x3723b0<_0x3c1b44[_0x4395('0x7')];_0x3723b0+=0x1){_0x2b9da4=_0x3c1b44[_0x3723b0];if(_[_0x4395('0x8')](_0x32e280['mailAccounts'][_0x2b9da4['id']])){_0x32e280['mailAccounts'][_0x2b9da4['id']]=new MailAccount(_0x2b9da4);}else{_['merge'](_0x32e280[_0x4395('0x1')][_0x2b9da4['id']],_0x2b9da4);}}}return _0x32e280[_0x4395('0x1')];};};module[_0x4395('0x9')]=Realtime;
\ No newline at end of file
+var _0x2b0d=['prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x1ffd67,_0x1c18ba){var _0xce170f=function(_0x16cdb2){while(--_0x16cdb2){_0x1ffd67['push'](_0x1ffd67['shift']());}};_0xce170f(++_0x1c18ba);}(_0x2b0d,0xb7));var _0xd2b0=function(_0x511fad,_0x26cf29){_0x511fad=_0x511fad-0x0;var _0x4b61bd=_0x2b0d[_0x511fad];return _0x4b61bd;};'use strict';var _=require(_0xd2b0('0x0'));var MailAccount=require(_0xd2b0('0x1'));var Realtime=function(){this[_0xd2b0('0x2')]={};};function freeIsNotKey(_0x4a5407,_0x586c6a,_0x3aef88){var _0x2d0931=_[_0xd2b0('0x3')](_0x4a5407,function(_0x1a987d,_0x3f64a5){return _0x1a987d[_0x3aef88];});for(var _0x8c3a7a in _0x586c6a){if(_0x586c6a['hasOwnProperty'](_0x8c3a7a)){if(!_0x2d0931[_0x8c3a7a]){delete _0x586c6a[_0x8c3a7a];}}}}Realtime[_0xd2b0('0x4')][_0xd2b0('0x5')]=function(_0x46a9fe,_0x7f7763){for(var _0x3d2de2 in _0x7f7763){if(_0x46a9fe['hasOwnProperty'](_0x3d2de2)){_0x46a9fe[_0x3d2de2]=_0x7f7763[_0x3d2de2];}}};Realtime[_0xd2b0('0x4')][_0xd2b0('0x6')]=function(){var _0x2976b9=this;return function(_0x2926d0){if(_0x2926d0){freeIsNotKey(_0x2926d0,_0x2976b9[_0xd2b0('0x2')],'id');for(var _0x545c56=0x0,_0x59a997={},_0x158422={};_0x545c56<_0x2926d0[_0xd2b0('0x7')];_0x545c56+=0x1){_0x59a997=_0x2926d0[_0x545c56];if(_[_0xd2b0('0x8')](_0x2976b9[_0xd2b0('0x2')][_0x59a997['id']])){_0x2976b9[_0xd2b0('0x2')][_0x59a997['id']]=new MailAccount(_0x59a997);}else{_[_0xd2b0('0x9')](_0x2976b9[_0xd2b0('0x2')][_0x59a997['id']],_0x59a997);}}}return _0x2976b9[_0xd2b0('0x2')];};};module[_0xd2b0('0xa')]=Realtime;
\ No newline at end of file
index 346a75c..7bc6728 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8561=['type','data5','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','name','service','active','ListId','TemplateId','CloudProvider'];(function(_0x1e3329,_0x162371){var _0x2a8d8d=function(_0x1186f3){while(--_0x1186f3){_0x1e3329['push'](_0x1e3329['shift']());}};_0x2a8d8d(++_0x162371);}(_0x8561,0x1b2));var _0x1856=function(_0x367759,_0x3ccdb9){_0x367759=_0x367759-0x0;var _0x3c8b9f=_0x8561[_0x367759];return _0x3c8b9f;};'use strict';var client=require('../client');exports[_0x1856('0x0')]=function(){return function(){return client[_0x1856('0x1')]('GetMailAccount',{'options':{'attributes':['id',_0x1856('0x2'),'provider',_0x1856('0x3'),'email',_0x1856('0x4'),'key',_0x1856('0x5'),_0x1856('0x6')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0x1856('0x7'),'attributes':['id','name','service',_0x1856('0x8'),'data5'],'as':'CloudProvider'}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x1856('0x7'),'attributes':['id',_0x1856('0x2'),'service','type',_0x1856('0x9')],'as':'CloudProvider'}]}]},'log':_0x1856('0xa')});};};exports[_0x1856('0xb')]=function(_0xcf5a16,_0x5bae90){return client[_0x1856('0x1')](_0x1856('0xc'),{'account':{'id':_0xcf5a16},'body':_0x5bae90,'log':'NotifyMailAccount'});};
\ No newline at end of file
+var _0x8200=['getMailAccounts','Request','name','provider','service','active','TemplateId','Imap','CloudProvider','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client'];(function(_0x409ad2,_0x5129c1){var _0x595b5f=function(_0x592974){while(--_0x592974){_0x409ad2['push'](_0x409ad2['shift']());}};_0x595b5f(++_0x5129c1);}(_0x8200,0x11f));var _0x0820=function(_0x316fef,_0xbe8705){_0x316fef=_0x316fef-0x0;var _0x153dd9=_0x8200[_0x316fef];return _0x153dd9;};'use strict';var client=require(_0x0820('0x0'));exports[_0x0820('0x1')]=function(){return function(){return client[_0x0820('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x0820('0x3'),_0x0820('0x4'),_0x0820('0x5'),'email',_0x0820('0x6'),'key','ListId',_0x0820('0x7')],'raw':![],'include':[{'model':'MailServerIn','as':_0x0820('0x8'),'include':[{'model':_0x0820('0x9'),'attributes':['id',_0x0820('0x3'),'service','type',_0x0820('0xa')],'as':'CloudProvider'}]},{'model':_0x0820('0xb'),'as':_0x0820('0xc'),'include':[{'model':_0x0820('0x9'),'attributes':['id',_0x0820('0x3'),_0x0820('0x5'),'type','data5'],'as':_0x0820('0x9')}]}]},'log':_0x0820('0xd')});};};exports[_0x0820('0xe')]=function(_0x3c17ed,_0x5a77f7){return client['Request'](_0x0820('0xf'),{'account':{'id':_0x3c17ed},'body':_0x5a77f7,'log':_0x0820('0xf')});};
\ No newline at end of file
index 9f847a4..00c5862 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdacd=['GetSettings','ShowSetting','loginMailFrequency'];(function(_0x17a627,_0x377afe){var _0x53e6ce=function(_0x53c29f){while(--_0x53c29f){_0x17a627['push'](_0x17a627['shift']());}};_0x53e6ce(++_0x377afe);}(_0xdacd,0x190));var _0xddac=function(_0x1fd3e8,_0x5a4ab0){_0x1fd3e8=_0x1fd3e8-0x0;var _0x13b973=_0xdacd[_0x1fd3e8];return _0x13b973;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request'](_0xddac('0x0'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xddac('0x1')]},'log':_0xddac('0x2')});};
\ No newline at end of file
+var _0x82a0=['GetSettings','getSettings','Request','loginMailFrequency'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x82a0,0x161));var _0x082a=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x82a0[_0x46800d];return _0x3824cd;};'use strict';var client=require('../client');exports[_0x082a('0x0')]=function(){return client[_0x082a('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x082a('0x2')]},'log':_0x082a('0x3')});};
\ No newline at end of file
index 5fcfae3..d2f033f 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 57d259f..7ad127b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cc7=['listening','log','lodash','express','sticky-session','ioredis','../../config/environment','timeout','port','socket.io','websocket','polling','adapter','redis','default','../../config/socketio','../../routes','once'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x5cc7,0x1d6));var _0x75cc=function(_0x24437e,_0x4ba9a6){_0x24437e=_0x24437e-0x0;var _0x441683=_0x5cc7[_0x24437e];return _0x441683;};'use strict';var _=require(_0x75cc('0x0'));var http=require('http');var express=require(_0x75cc('0x1'));var sticky=require(_0x75cc('0x2'));var Redis=require(_0x75cc('0x3'));var config=require(_0x75cc('0x4'));var app=express();var server=http['createServer'](app);server[_0x75cc('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0x75cc('0x6')])){var socketio=require(_0x75cc('0x7'))(server,{'transports':[_0x75cc('0x8'),_0x75cc('0x9')]});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x75cc('0xa')](require('socket.io-redis')({'pubClient':new Redis(config[_0x75cc('0xb')]),'subClient':new Redis(config[_0x75cc('0xb')])}));require('../../config/triggers')[_0x75cc('0xc')]();require(_0x75cc('0xd'))[_0x75cc('0xc')](socketio);require('../../config/express')[_0x75cc('0xc')](app);require(_0x75cc('0xe'))[_0x75cc('0xc')](app);}else{server[_0x75cc('0xf')](_0x75cc('0x10'),function(){console[_0x75cc('0x11')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x75cc('0x6')]);});}exports=module['exports']=app;
\ No newline at end of file
+var _0xee46=['default','../../config/express','../../routes','listening','exports','lodash','http','sticky-session','../../config/environment','createServer','timeout','listen','port','websocket','redis','defaults','adapter','socket.io-redis','../../config/triggers'];(function(_0x3d274c,_0x2edc2b){var _0x46d63a=function(_0x188574){while(--_0x188574){_0x3d274c['push'](_0x3d274c['shift']());}};_0x46d63a(++_0x2edc2b);}(_0xee46,0xfc));var _0x6ee4=function(_0x24ed36,_0x520615){_0x24ed36=_0x24ed36-0x0;var _0x10d646=_0xee46[_0x24ed36];return _0x10d646;};'use strict';var _=require(_0x6ee4('0x0'));var http=require(_0x6ee4('0x1'));var express=require('express');var sticky=require(_0x6ee4('0x2'));var Redis=require('ioredis');var config=require(_0x6ee4('0x3'));var app=express();var server=http[_0x6ee4('0x4')](app);server[_0x6ee4('0x5')]=0xdbba0;if(sticky[_0x6ee4('0x6')](server,config[_0x6ee4('0x7')])){var socketio=require('socket.io')(server,{'transports':[_0x6ee4('0x8'),'polling']});config[_0x6ee4('0x9')]=_[_0x6ee4('0xa')](config[_0x6ee4('0x9')],{'host':'localhost','port':0x18eb});socketio[_0x6ee4('0xb')](require(_0x6ee4('0xc'))({'pubClient':new Redis(config[_0x6ee4('0x9')]),'subClient':new Redis(config[_0x6ee4('0x9')])}));require(_0x6ee4('0xd'))[_0x6ee4('0xe')]();require('../../config/socketio')[_0x6ee4('0xe')](socketio);require(_0x6ee4('0xf'))[_0x6ee4('0xe')](app);require(_0x6ee4('0x10'))[_0x6ee4('0xe')](app);}else{server['once'](_0x6ee4('0x11'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x6ee4('0x7')]);});}exports=module[_0x6ee4('0x12')]=app;
\ No newline at end of file
index 00d2827..123325d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62c0=['client','http','request','then','rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing'];(function(_0x16b43b,_0x385679){var _0x259b90=function(_0x4881d6){while(--_0x4881d6){_0x16b43b['push'](_0x16b43b['shift']());}};_0x259b90(++_0x385679);}(_0x62c0,0xcd));var _0x062c=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x62c0[_0x255d5b];return _0x3e141a;};'use strict';var jayson=require(_0x062c('0x0'));var BPromise=require(_0x062c('0x1'));var logger=require('../../config/logger')(_0x062c('0x2'));var client=jayson[_0x062c('0x3')][_0x062c('0x4')]({'port':0x2329});client['Request']=function(_0x579ec7,_0x302f66){return new BPromise(function(_0x92bb51,_0x41437c){return client[_0x062c('0x5')](_0x579ec7,_0x302f66)[_0x062c('0x6')](function(_0x4d4abf){logger['debug'](_0x062c('0x7'),_0x062c('0x2'),_0x579ec7,_0x302f66,_0x4d4abf);if(_0x4d4abf['error']){logger[_0x062c('0x8')]('rpc',_0x062c('0x2'),_0x579ec7,_0x4d4abf['error'][_0x062c('0x9')],_0x302f66);return _0x41437c(_0x4d4abf[_0x062c('0x8')]['message']);}else{return _0x92bb51(_0x4d4abf[_0x062c('0xa')]);}})[_0x062c('0xb')](function(_0x13a955){logger[_0x062c('0x8')]('rpc',_0x062c('0x2'),_0x579ec7,_0x13a955,_0x302f66);return _0x41437c(_0x13a955);});});};module[_0x062c('0xc')]=client;
\ No newline at end of file
+var _0xf1fa=['../../config/logger','routing','client','Request','then','debug','error','rpc','message','result','catch','exports','jayson/promise','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf1fa,0xc2));var _0xaf1f=function(_0x3057e4,_0x33f099){_0x3057e4=_0x3057e4-0x0;var _0x4089ac=_0xf1fa[_0x3057e4];return _0x4089ac;};'use strict';var jayson=require(_0xaf1f('0x0'));var BPromise=require(_0xaf1f('0x1'));var logger=require(_0xaf1f('0x2'))(_0xaf1f('0x3'));var client=jayson[_0xaf1f('0x4')]['http']({'port':0x2329});client[_0xaf1f('0x5')]=function(_0x31b51f,_0x248831){return new BPromise(function(_0x247708,_0x11aba3){return client['request'](_0x31b51f,_0x248831)[_0xaf1f('0x6')](function(_0x3c3647){logger[_0xaf1f('0x7')]('rpc',_0xaf1f('0x3'),_0x31b51f,_0x248831,_0x3c3647);if(_0x3c3647[_0xaf1f('0x8')]){logger[_0xaf1f('0x8')](_0xaf1f('0x9'),_0xaf1f('0x3'),_0x31b51f,_0x3c3647['error'][_0xaf1f('0xa')],_0x248831);return _0x11aba3(_0x3c3647['error'][_0xaf1f('0xa')]);}else{return _0x247708(_0x3c3647[_0xaf1f('0xb')]);}})[_0xaf1f('0xc')](function(_0x1ef4eb){logger[_0xaf1f('0x8')]('rpc',_0xaf1f('0x3'),_0x31b51f,_0x1ef4eb,_0x248831);return _0x11aba3(_0x1ef4eb);});});};module[_0xaf1f('0xd')]=client;
\ No newline at end of file
index 85c0ec9..9a7fe39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c9a=['./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','catch','log','bluebird','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2c9a,0x8b));var _0xa2c9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2c9a[_0x2dafbe];return _0x58a45a;};'use strict';var BPromise=require(_0xa2c9('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require(_0xa2c9('0x1'));var interval=require(_0xa2c9('0x2'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xa2c9('0x3'));var smsQueue=require(_0xa2c9('0x4'));var mailQueue=require(_0xa2c9('0x5'));var faxQueue=require(_0xa2c9('0x6'));var whatsappQueue=require(_0xa2c9('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xa2c9('0x8')]()[_0xa2c9('0x9')](user[_0xa2c9('0xa')]())[_0xa2c9('0x9')](realtime[_0xa2c9('0xb')]())[_0xa2c9('0x9')](interval[_0xa2c9('0xc')]())['then'](realtime[_0xa2c9('0xd')]())[_0xa2c9('0x9')](openchannelQueue[_0xa2c9('0xe')]())[_0xa2c9('0x9')](realtime[_0xa2c9('0xf')]())[_0xa2c9('0x9')](chatQueue[_0xa2c9('0x10')]())[_0xa2c9('0x9')](realtime[_0xa2c9('0x11')]())[_0xa2c9('0x9')](smsQueue['getSmsQueues']())[_0xa2c9('0x9')](realtime[_0xa2c9('0x12')]())[_0xa2c9('0x9')](mailQueue[_0xa2c9('0x13')]())[_0xa2c9('0x9')](realtime['initMailQueues']())[_0xa2c9('0x9')](faxQueue[_0xa2c9('0x14')]())[_0xa2c9('0x9')](realtime[_0xa2c9('0x15')]())[_0xa2c9('0x9')](whatsappQueue['getWhatsappQueues']())['then'](realtime['initWhatsappQueues']())[_0xa2c9('0x9')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xa2c9('0x9')](function(_0x311285){return initRealtime();})[_0xa2c9('0x9')](function(_0x17e133){return setInterval(initRealtime,0x1388);})[_0xa2c9('0x16')](function(_0x5c9023){console[_0xa2c9('0x17')](_0x5c9023);});}main();
\ No newline at end of file
+var _0x16b9=['./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','getIntervals','initOpenchannelQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue'];(function(_0x2859f2,_0x1e3102){var _0x4974cd=function(_0x13ec65){while(--_0x13ec65){_0x2859f2['push'](_0x2859f2['shift']());}};_0x4974cd(++_0x1e3102);}(_0x16b9,0x163));var _0x916b=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x16b9[_0x17406a];return _0x1501ff;};'use strict';var BPromise=require(_0x916b('0x0'));var server=require('./server');var Realtime=require(_0x916b('0x1'));var user=require(_0x916b('0x2'));var interval=require(_0x916b('0x3'));var openchannelQueue=require(_0x916b('0x4'));var chatQueue=require(_0x916b('0x5'));var smsQueue=require(_0x916b('0x6'));var mailQueue=require(_0x916b('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x916b('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x916b('0x9')]()[_0x916b('0xa')](user[_0x916b('0xb')]())['then'](realtime['initAgents']())[_0x916b('0xa')](interval[_0x916b('0xc')]())['then'](realtime['initIntervals']())[_0x916b('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x916b('0xa')](realtime[_0x916b('0xd')]())[_0x916b('0xa')](chatQueue['getChatQueues']())[_0x916b('0xa')](realtime['initChatQueues']())[_0x916b('0xa')](smsQueue[_0x916b('0xe')]())['then'](realtime[_0x916b('0xf')]())['then'](mailQueue[_0x916b('0x10')]())[_0x916b('0xa')](realtime[_0x916b('0x11')]())[_0x916b('0xa')](faxQueue[_0x916b('0x12')]())['then'](realtime[_0x916b('0x13')]())[_0x916b('0xa')](whatsappQueue[_0x916b('0x14')]())[_0x916b('0xa')](realtime[_0x916b('0x15')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x916b('0xa')](function(_0x490ed3){return initRealtime();})[_0x916b('0xa')](function(_0x15aa63){return setInterval(initRealtime,0x1388);})[_0x916b('0x16')](function(_0x3ce47d){console[_0x916b('0x17')](_0x3ce47d);});}main();
\ No newline at end of file
index 0f8cb9d..ed2c7dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x12aec6,_0x3dcd28){var _0x21d989=function(_0x159f6d){while(--_0x159f6d){_0x12aec6['push'](_0x12aec6['shift']());}};_0x21d989(++_0x3dcd28);}(_0xe14b,0x93));var _0xbe14=function(_0x2bbc1a,_0x5b111c){_0x2bbc1a=_0x2bbc1a-0x0;var _0x5a1785=_0xe14b[_0x2bbc1a];return _0x5a1785;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine;
\ No newline at end of file
+var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x2a0346,_0x2c1300){_0x2a0346=_0x2a0346-0x0;var _0x1f5232=_0x1261[_0x2a0346];return _0x1f5232;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine;
\ No newline at end of file
index 5a7f468..e67a908 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e06=['catch','client','http','error','message','result'];(function(_0x38823a,_0x138bac){var _0x1aa579=function(_0xcd909e){while(--_0xcd909e){_0x38823a['push'](_0x38823a['shift']());}};_0x1aa579(++_0x138bac);}(_0x6e06,0x1ab));var _0x66e0=function(_0x13a439,_0x42a8f5){_0x13a439=_0x13a439-0x0;var _0x39f1d9=_0x6e06[_0x13a439];return _0x39f1d9;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x66e0('0x0')][_0x66e0('0x1')]({'port':0x232b});function request(_0x11c714,_0x1a05ee){return new BPromise(function(_0x14be75,_0x500bfc){return client['request'](_0x11c714,_0x1a05ee)['then'](function(_0x461abd){if(_0x461abd['error']){return _0x500bfc(_0x461abd[_0x66e0('0x2')][_0x66e0('0x3')]);}else{return _0x14be75(_0x461abd[_0x66e0('0x4')]);}})[_0x66e0('0x5')](function(_0x1450d6){return _0x500bfc(_0x1450d6);});});}exports['sendMailMessage']=function(_0x156f44,_0x481244){return request('SendMail',{'account':_0x156f44,'message':_0x481244});};
\ No newline at end of file
+var _0x6751=['http','request','then','error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x738518,_0x4bc290){var _0x37fd6a=function(_0x1aac49){while(--_0x1aac49){_0x738518['push'](_0x738518['shift']());}};_0x37fd6a(++_0x4bc290);}(_0x6751,0x97));var _0x1675=function(_0x2a0739,_0x148e11){_0x2a0739=_0x2a0739-0x0;var _0x2c0f19=_0x6751[_0x2a0739];return _0x2c0f19;};'use strict';var BPromise=require(_0x1675('0x0'));var jayson=require(_0x1675('0x1'));var client=jayson[_0x1675('0x2')][_0x1675('0x3')]({'port':0x232b});function request(_0x38ac3a,_0x1b87b6){return new BPromise(function(_0x6b560b,_0x5965f9){return client[_0x1675('0x4')](_0x38ac3a,_0x1b87b6)[_0x1675('0x5')](function(_0x3051d8){if(_0x3051d8[_0x1675('0x6')]){return _0x5965f9(_0x3051d8[_0x1675('0x6')][_0x1675('0x7')]);}else{return _0x6b560b(_0x3051d8[_0x1675('0x8')]);}})['catch'](function(_0x29ecd7){return _0x5965f9(_0x29ecd7);});});}exports[_0x1675('0x9')]=function(_0x2c3ec5,_0x24df5d){return request(_0x1675('0xa'),{'account':_0x2c3ec5,'message':_0x24df5d});};
\ No newline at end of file
index f0b6204..1e608e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57df=['faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','chat','openchannel','sms','whatsapp','Status','StatusTime','format','chatStatus','mailCurrentCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCurrentCapacity','stringify','emit','user:save','exports','lodash','md5','../../../config/environment','redis','defaults','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity'];(function(_0x1e5893,_0x2747e4){var _0x501749=function(_0x15cdac){while(--_0x15cdac){_0x1e5893['push'](_0x1e5893['shift']());}};_0x501749(++_0x2747e4);}(_0x57df,0xd4));var _0xf57d=function(_0x21394e,_0x145bc6){_0x21394e=_0x21394e-0x0;var _0x36e0e5=_0x57df[_0x21394e];return _0x36e0e5;};'use strict';var _=require(_0xf57d('0x0'));var moment=require('moment');var md5=require(_0xf57d('0x1'));var Redis=require('ioredis');var config=require(_0xf57d('0x2'));config[_0xf57d('0x3')]=_[_0xf57d('0x4')](config[_0xf57d('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf57d('0x3')]));function Agent(_0xe9c5b5){this['id']=_0xe9c5b5['id']||0x0;this[_0xf57d('0x5')]=_0xe9c5b5[_0xf57d('0x5')]||'';this[_0xf57d('0x6')]=_0xe9c5b5[_0xf57d('0x6')]||!![];this[_0xf57d('0x7')]=_0xe9c5b5['voicePause']||![];this[_0xf57d('0x8')]=_0xe9c5b5[_0xf57d('0x8')]||![];this[_0xf57d('0x9')]=_0xe9c5b5[_0xf57d('0x9')]||![];this['faxPause']=_0xe9c5b5[_0xf57d('0xa')]||![];this[_0xf57d('0xb')]=_0xe9c5b5[_0xf57d('0xb')]||![];this[_0xf57d('0xc')]=_0xe9c5b5[_0xf57d('0xc')]||![];this['chatStatus']=_0xf57d('0xd');this[_0xf57d('0xe')]=0x0;this[_0xf57d('0xf')]=_0xe9c5b5[_0xf57d('0xf')]||0x0;this[_0xf57d('0x10')]=0x0;this[_0xf57d('0x11')]=_0xf57d('0xd');this[_0xf57d('0x12')]=0x0;this[_0xf57d('0x13')]=_0xe9c5b5[_0xf57d('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xf57d('0x14')]=_0xf57d('0xd');this[_0xf57d('0x15')]=0x0;this[_0xf57d('0x16')]=_0xe9c5b5['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0xf57d('0x17')]=_0xf57d('0xd');this[_0xf57d('0x18')]=0x0;this[_0xf57d('0x19')]=_0xe9c5b5['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0xf57d('0x1a')]=_0xf57d('0xd');this['whatsappStatusTime']=0x0;this[_0xf57d('0x1b')]=_0xe9c5b5['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xf57d('0x1c')]=_0xf57d('0xd');this[_0xf57d('0x1d')]=0x0;this['openchannelCapacity']=_0xe9c5b5[_0xf57d('0x1e')]||0x0;this[_0xf57d('0x1f')]=0x0;this[_0xf57d('0x20')]=![];this[_0xf57d('0x21')]=undefined;this[_0xf57d('0x1')]='';this['updateRealtime']();}Agent[_0xf57d('0x22')][_0xf57d('0x23')]=function(_0x52b683){if(this[_0x52b683+_0xf57d('0x24')]>0x0){if(this[_0x52b683+_0xf57d('0x25')]>0x0&&this[_0x52b683+_0xf57d('0x24')]>=this[_0x52b683+_0xf57d('0x25')]){return _0xf57d('0x26');}else{return _0xf57d('0x27');}}else{return _0xf57d('0x28');}};Agent['prototype'][_0xf57d('0x29')]=function(){var _0x256e1d=['mail',_0xf57d('0x2a'),_0xf57d('0x2b'),'fax',_0xf57d('0x2c'),_0xf57d('0x2d')];for(var _0xd99393=0x0;_0xd99393<_0x256e1d['length'];_0xd99393+=0x1){var _0x574acc=this[_0xf57d('0x23')](_0x256e1d[_0xd99393]);if(this[_0x256e1d[_0xd99393]+_0xf57d('0x2e')]!==_0x574acc){this[_0x256e1d[_0xd99393]+_0xf57d('0x2f')]=_['toNumber'](moment()[_0xf57d('0x30')]('x'));}this[_0x256e1d[_0xd99393]+'Status']=_0x574acc;}var _0x18fef7={'id':this['id'],'name':this['name'],'online':this[_0xf57d('0x6')],'voicePause':this['voicePause'],'chatPause':this[_0xf57d('0x8')],'mailPause':this['mailPause'],'smsPause':this[_0xf57d('0xb')],'faxPause':this[_0xf57d('0xa')],'openchannelPause':this[_0xf57d('0xc')],'chatStatus':this[_0xf57d('0x31')],'chatStatusTime':this[_0xf57d('0xe')],'chatCapacity':this[_0xf57d('0xf')],'chatCurrentCapacity':this[_0xf57d('0x10')],'mailStatus':this[_0xf57d('0x11')],'mailStatusTime':this[_0xf57d('0x12')],'mailCapacity':this[_0xf57d('0x13')],'mailCurrentCapacity':this[_0xf57d('0x32')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xf57d('0x15')],'faxCapacity':this[_0xf57d('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xf57d('0x17')],'smsStatusTime':this[_0xf57d('0x18')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xf57d('0x33')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xf57d('0x34')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xf57d('0x35')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xf57d('0x1d')],'openchannelCapacity':this[_0xf57d('0x1e')],'openchannelCurrentCapacity':this[_0xf57d('0x1f')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x18ea64=md5(JSON[_0xf57d('0x36')](_0x18fef7));if(this[_0xf57d('0x1')]!==_0x18ea64){this['md5']=_0x18ea64;io[_0xf57d('0x37')](_0xf57d('0x38'),_0x18fef7);}};module[_0xf57d('0x39')]=Agent;
\ No newline at end of file
+var _0x5d2f=['openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','fax','sms','length','Status','toNumber','format','chatStatus','smsCurrentCapacity','whatsappStatus','stringify','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus'];(function(_0x6ca98a,_0x943052){var _0x58bbe5=function(_0x2e6673){while(--_0x2e6673){_0x6ca98a['push'](_0x6ca98a['shift']());}};_0x58bbe5(++_0x943052);}(_0x5d2f,0x17d));var _0xf5d2=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x5d2f[_0xef4cf0];return _0x497ad2;};'use strict';var _=require(_0xf5d2('0x0'));var moment=require('moment');var md5=require(_0xf5d2('0x1'));var Redis=require(_0xf5d2('0x2'));var config=require(_0xf5d2('0x3'));config[_0xf5d2('0x4')]=_['defaults'](config[_0xf5d2('0x4')],{'host':_0xf5d2('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x3b5b20){this['id']=_0x3b5b20['id']||0x0;this['name']=_0x3b5b20[_0xf5d2('0x6')]||'';this[_0xf5d2('0x7')]=_0x3b5b20[_0xf5d2('0x7')]||!![];this['voicePause']=_0x3b5b20[_0xf5d2('0x8')]||![];this[_0xf5d2('0x9')]=_0x3b5b20[_0xf5d2('0x9')]||![];this[_0xf5d2('0xa')]=_0x3b5b20[_0xf5d2('0xa')]||![];this[_0xf5d2('0xb')]=_0x3b5b20[_0xf5d2('0xb')]||![];this[_0xf5d2('0xc')]=_0x3b5b20[_0xf5d2('0xc')]||![];this[_0xf5d2('0xd')]=_0x3b5b20[_0xf5d2('0xd')]||![];this['chatStatus']=_0xf5d2('0xe');this[_0xf5d2('0xf')]=0x0;this[_0xf5d2('0x10')]=_0x3b5b20[_0xf5d2('0x10')]||0x0;this[_0xf5d2('0x11')]=0x0;this[_0xf5d2('0x12')]=_0xf5d2('0xe');this[_0xf5d2('0x13')]=0x0;this[_0xf5d2('0x14')]=_0x3b5b20[_0xf5d2('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xf5d2('0x15')]=_0xf5d2('0xe');this[_0xf5d2('0x16')]=0x0;this[_0xf5d2('0x17')]=_0x3b5b20[_0xf5d2('0x17')]||0x0;this[_0xf5d2('0x18')]=0x0;this[_0xf5d2('0x19')]=_0xf5d2('0xe');this[_0xf5d2('0x1a')]=0x0;this['smsCapacity']=_0x3b5b20[_0xf5d2('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0xf5d2('0xe');this[_0xf5d2('0x1c')]=0x0;this[_0xf5d2('0x1d')]=_0x3b5b20[_0xf5d2('0x1d')]||0x0;this[_0xf5d2('0x1e')]=0x0;this[_0xf5d2('0x1f')]=_0xf5d2('0xe');this[_0xf5d2('0x20')]=0x0;this[_0xf5d2('0x21')]=_0x3b5b20['openchannelCapacity']||0x0;this[_0xf5d2('0x22')]=0x0;this[_0xf5d2('0x23')]=![];this[_0xf5d2('0x24')]=undefined;this[_0xf5d2('0x1')]='';this[_0xf5d2('0x25')]();}Agent[_0xf5d2('0x26')]['getChannelStatus']=function(_0x21735b){if(this[_0x21735b+_0xf5d2('0x27')]>0x0){if(this[_0x21735b+_0xf5d2('0x28')]>0x0&&this[_0x21735b+_0xf5d2('0x27')]>=this[_0x21735b+'Capacity']){return _0xf5d2('0x29');}else{return _0xf5d2('0x2a');}}else{return _0xf5d2('0x2b');}};Agent[_0xf5d2('0x26')][_0xf5d2('0x25')]=function(){var _0x294275=['mail',_0xf5d2('0x2c'),_0xf5d2('0x2d'),_0xf5d2('0x2e'),_0xf5d2('0x2f'),'whatsapp'];for(var _0x19f2db=0x0;_0x19f2db<_0x294275[_0xf5d2('0x30')];_0x19f2db+=0x1){var _0x2733eb=this['getChannelStatus'](_0x294275[_0x19f2db]);if(this[_0x294275[_0x19f2db]+_0xf5d2('0x31')]!==_0x2733eb){this[_0x294275[_0x19f2db]+'StatusTime']=_[_0xf5d2('0x32')](moment()[_0xf5d2('0x33')]('x'));}this[_0x294275[_0x19f2db]+_0xf5d2('0x31')]=_0x2733eb;}var _0x4eac86={'id':this['id'],'name':this[_0xf5d2('0x6')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xf5d2('0x9')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0xf5d2('0xd')],'chatStatus':this[_0xf5d2('0x34')],'chatStatusTime':this[_0xf5d2('0xf')],'chatCapacity':this[_0xf5d2('0x10')],'chatCurrentCapacity':this[_0xf5d2('0x11')],'mailStatus':this[_0xf5d2('0x12')],'mailStatusTime':this[_0xf5d2('0x13')],'mailCapacity':this[_0xf5d2('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xf5d2('0x16')],'faxCapacity':this[_0xf5d2('0x17')],'faxCurrentCapacity':this[_0xf5d2('0x18')],'smsStatus':this[_0xf5d2('0x19')],'smsStatusTime':this[_0xf5d2('0x1a')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xf5d2('0x35')],'whatsappStatus':this[_0xf5d2('0x36')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xf5d2('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xf5d2('0x1f')],'openchannelStatusTime':this[_0xf5d2('0x20')],'openchannelCapacity':this[_0xf5d2('0x21')],'openchannelCurrentCapacity':this[_0xf5d2('0x22')],'busy':this[_0xf5d2('0x23')],'busyQueue':this[_0xf5d2('0x24')]};var _0x5ced0e=md5(JSON[_0xf5d2('0x37')](_0x4eac86));if(this[_0xf5d2('0x1')]!==_0x5ced0e){this['md5']=_0x5ced0e;io[_0xf5d2('0x38')](_0xf5d2('0x39'),_0x4eac86);}};module[_0xf5d2('0x3a')]=Agent;
\ No newline at end of file
index 150ea3f..e2e40d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4407=['emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','format'];(function(_0x19ba87,_0x269e4f){var _0x1e7f3f=function(_0x226068){while(--_0x226068){_0x19ba87['push'](_0x19ba87['shift']());}};_0x1e7f3f(++_0x269e4f);}(_0x4407,0x163));var _0x7440=function(_0x122f8,_0x5e8920){_0x122f8=_0x122f8-0x0;var _0x4574af=_0x4407[_0x122f8];return _0x4574af;};'use strict';var _=require(_0x7440('0x0'));var md5=require(_0x7440('0x1'));var util=require(_0x7440('0x2'));var Redis=require(_0x7440('0x3'));var config=require(_0x7440('0x4'));config['redis']=_[_0x7440('0x5')](config['redis'],{'host':_0x7440('0x6'),'port':0x18eb});var io=require(_0x7440('0x7'))(new Redis(config[_0x7440('0x8')]));function ChatQueue(_0x257f2a){this['id']=_0x257f2a['id']||0x0;this[_0x7440('0x9')]=_0x257f2a[_0x7440('0x9')]||'';this[_0x7440('0xa')]=_0x257f2a[_0x7440('0xa')]||0xa;this[_0x7440('0xb')]=_0x257f2a[_0x7440('0xb')]||_0x7440('0xc');this[_0x7440('0xd')]=_0x257f2a['Agents'];this[_0x7440('0xe')]={};this[_0x7440('0xf')]=0x0;this[_0x7440('0x1')]='';this['updateRouting']();this[_0x7440('0x10')]();}ChatQueue[_0x7440('0x11')][_0x7440('0x12')]=function(){var _0x26bbf0=this['mapAgentsId'][_0x7440('0x13')];this['mapAgentsId']=_[_0x7440('0x14')](this[_0x7440('0xd')],'id');this[_0x7440('0xe')][_0x7440('0x13')]=_0x26bbf0;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x7440('0x15')]=0x0;this[_0x7440('0x16')]=0x0;for(var _0x4f4ac5=0x0;_0x4f4ac5<this[_0x7440('0xd')][_0x7440('0x17')];_0x4f4ac5+=0x1){if(this[_0x7440('0xd')][_0x4f4ac5][_0x7440('0x18')]){this[_0x7440('0x15')]+=0x1;}if(this['Agents'][_0x4f4ac5][_0x7440('0x19')]){this[_0x7440('0x16')]+=0x1;}}this[_0x7440('0x1a')]=this[_0x7440('0x15')]-this[_0x7440('0x16')];this['available']=this['available']>=0x0?this['available']:0x0;var _0x370572={'id':this['id'],'available':this[_0x7440('0x1a')],'loggedIn':this['loggedIn'],'name':this[_0x7440('0x9')],'paused':this[_0x7440('0x16')],'waiting':this[_0x7440('0xf')]};var _0x3db12e=md5(JSON[_0x7440('0x1b')](_0x370572));if(this[_0x7440('0x1')]!==_0x3db12e){this[_0x7440('0x1')]=_0x3db12e;io['to'](util[_0x7440('0x1c')]('chat:queue:%s',_0x370572[_0x7440('0x9')]))[_0x7440('0x1d')](_0x7440('0x1e'),_0x370572);}};module[_0x7440('0x1f')]=ChatQueue;
\ No newline at end of file
+var _0x2d3a=['socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','chatPause','available','format','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x2d3a,0x111));var _0xa2d3=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x2d3a[_0x295314];return _0x584b0c;};'use strict';var _=require(_0xa2d3('0x0'));var md5=require(_0xa2d3('0x1'));var util=require(_0xa2d3('0x2'));var Redis=require(_0xa2d3('0x3'));var config=require(_0xa2d3('0x4'));config[_0xa2d3('0x5')]=_['defaults'](config['redis'],{'host':_0xa2d3('0x6'),'port':0x18eb});var io=require(_0xa2d3('0x7'))(new Redis(config[_0xa2d3('0x5')]));function ChatQueue(_0x507bb0){this['id']=_0x507bb0['id']||0x0;this['name']=_0x507bb0[_0xa2d3('0x8')]||'';this[_0xa2d3('0x9')]=_0x507bb0[_0xa2d3('0x9')]||0xa;this[_0xa2d3('0xa')]=_0x507bb0['strategy']||'beepall';this[_0xa2d3('0xb')]=_0x507bb0['Agents'];this[_0xa2d3('0xc')]={};this[_0xa2d3('0xd')]=0x0;this['md5']='';this[_0xa2d3('0xe')]();this['updateRealtime']();}ChatQueue[_0xa2d3('0xf')][_0xa2d3('0xe')]=function(){var _0x2c813d=this[_0xa2d3('0xc')][_0xa2d3('0x10')];this[_0xa2d3('0xc')]=_[_0xa2d3('0x11')](this[_0xa2d3('0xb')],'id');this[_0xa2d3('0xc')][_0xa2d3('0x10')]=_0x2c813d;};ChatQueue[_0xa2d3('0xf')][_0xa2d3('0x12')]=function(){this[_0xa2d3('0x13')]=0x0;this[_0xa2d3('0x14')]=0x0;for(var _0x234424=0x0;_0x234424<this[_0xa2d3('0xb')][_0xa2d3('0x15')];_0x234424+=0x1){if(this[_0xa2d3('0xb')][_0x234424]['online']){this[_0xa2d3('0x13')]+=0x1;}if(this[_0xa2d3('0xb')][_0x234424][_0xa2d3('0x16')]){this['paused']+=0x1;}}this['available']=this[_0xa2d3('0x13')]-this[_0xa2d3('0x14')];this['available']=this['available']>=0x0?this[_0xa2d3('0x17')]:0x0;var _0x4efa90={'id':this['id'],'available':this[_0xa2d3('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xa2d3('0x8')],'paused':this[_0xa2d3('0x14')],'waiting':this[_0xa2d3('0xd')]};var _0x1d1d28=md5(JSON['stringify'](_0x4efa90));if(this[_0xa2d3('0x1')]!==_0x1d1d28){this[_0xa2d3('0x1')]=_0x1d1d28;io['to'](util[_0xa2d3('0x18')]('chat:queue:%s',_0x4efa90[_0xa2d3('0x8')]))[_0xa2d3('0x19')](_0xa2d3('0x1a'),_0x4efa90);}};module[_0xa2d3('0x1b')]=ChatQueue;
\ No newline at end of file
index 9d49411..57d2f83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67ca=['util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','faxPause','available','waiting','stringify','fax_queue:save','exports','lodash','md5'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0x67ca,0x72));var _0xa67c=function(_0xc5644f,_0x460820){_0xc5644f=_0xc5644f-0x0;var _0xefca00=_0x67ca[_0xc5644f];return _0xefca00;};'use strict';var _=require(_0xa67c('0x0'));var md5=require(_0xa67c('0x1'));var util=require(_0xa67c('0x2'));var Redis=require(_0xa67c('0x3'));var config=require(_0xa67c('0x4'));config[_0xa67c('0x5')]=_[_0xa67c('0x6')](config['redis'],{'host':_0xa67c('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa67c('0x5')]));function FaxQueue(_0x5a940c){this['id']=_0x5a940c['id']||0x0;this[_0xa67c('0x8')]=_0x5a940c['name']||'';this[_0xa67c('0x9')]=_0x5a940c[_0xa67c('0x9')]||0xa;this[_0xa67c('0xa')]=_0x5a940c[_0xa67c('0xa')]||_0xa67c('0xb');this[_0xa67c('0xc')]=_0x5a940c[_0xa67c('0xc')];this[_0xa67c('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0xa67c('0xe')]();this[_0xa67c('0xf')]();}FaxQueue[_0xa67c('0x10')][_0xa67c('0xe')]=function(){var _0x5248b5=this[_0xa67c('0xd')][_0xa67c('0x11')];this[_0xa67c('0xd')]=_[_0xa67c('0x12')](this[_0xa67c('0xc')],'id');this[_0xa67c('0xd')][_0xa67c('0x11')]=_0x5248b5;};FaxQueue[_0xa67c('0x10')][_0xa67c('0xf')]=function(){this[_0xa67c('0x13')]=0x0;this[_0xa67c('0x14')]=0x0;for(var _0x1875ea=0x0;_0x1875ea<this['Agents'][_0xa67c('0x15')];_0x1875ea+=0x1){if(this['Agents'][_0x1875ea][_0xa67c('0x16')]){this[_0xa67c('0x13')]+=0x1;}if(this[_0xa67c('0xc')][_0x1875ea][_0xa67c('0x17')]){this[_0xa67c('0x14')]+=0x1;}}this[_0xa67c('0x18')]=this['loggedIn']-this[_0xa67c('0x14')];this[_0xa67c('0x18')]=this[_0xa67c('0x18')]>=0x0?this[_0xa67c('0x18')]:0x0;var _0x565a87={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa67c('0x13')],'name':this['name'],'paused':this[_0xa67c('0x14')],'waiting':this[_0xa67c('0x19')]};var _0x1eab12=md5(JSON[_0xa67c('0x1a')](_0x565a87));if(this['md5']!==_0x1eab12){this['md5']=_0x1eab12;io['to'](util['format']('fax:queue:%s',_0x565a87['name']))['emit'](_0xa67c('0x1b'),_0x565a87);}};module[_0xa67c('0x1c')]=FaxQueue;
\ No newline at end of file
+var _0xf911=['strategy','Agents','mapAgentsId','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','name','timeout'];(function(_0x4d1161,_0x303ba9){var _0x8df968=function(_0x23b36b){while(--_0x23b36b){_0x4d1161['push'](_0x4d1161['shift']());}};_0x8df968(++_0x303ba9);}(_0xf911,0x94));var _0x1f91=function(_0x229b09,_0x141b41){_0x229b09=_0x229b09-0x0;var _0x5206cc=_0xf911[_0x229b09];return _0x5206cc;};'use strict';var _=require(_0x1f91('0x0'));var md5=require(_0x1f91('0x1'));var util=require('util');var Redis=require(_0x1f91('0x2'));var config=require(_0x1f91('0x3'));config[_0x1f91('0x4')]=_[_0x1f91('0x5')](config[_0x1f91('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1f91('0x4')]));function FaxQueue(_0x342b5b){this['id']=_0x342b5b['id']||0x0;this[_0x1f91('0x6')]=_0x342b5b['name']||'';this['timeout']=_0x342b5b[_0x1f91('0x7')]||0xa;this['strategy']=_0x342b5b[_0x1f91('0x8')]||'beepall';this[_0x1f91('0x9')]=_0x342b5b[_0x1f91('0x9')];this[_0x1f91('0xa')]={};this['waiting']=0x0;this[_0x1f91('0x1')]='';this[_0x1f91('0xb')]();this['updateRealtime']();}FaxQueue[_0x1f91('0xc')][_0x1f91('0xb')]=function(){var _0x1f77bb=this[_0x1f91('0xa')]['_rr'];this[_0x1f91('0xa')]=_[_0x1f91('0xd')](this[_0x1f91('0x9')],'id');this[_0x1f91('0xa')][_0x1f91('0xe')]=_0x1f77bb;};FaxQueue['prototype'][_0x1f91('0xf')]=function(){this[_0x1f91('0x10')]=0x0;this[_0x1f91('0x11')]=0x0;for(var _0x462f3b=0x0;_0x462f3b<this['Agents'][_0x1f91('0x12')];_0x462f3b+=0x1){if(this[_0x1f91('0x9')][_0x462f3b][_0x1f91('0x13')]){this['loggedIn']+=0x1;}if(this[_0x1f91('0x9')][_0x462f3b][_0x1f91('0x14')]){this[_0x1f91('0x11')]+=0x1;}}this[_0x1f91('0x15')]=this[_0x1f91('0x10')]-this['paused'];this[_0x1f91('0x15')]=this[_0x1f91('0x15')]>=0x0?this[_0x1f91('0x15')]:0x0;var _0x3caa46={'id':this['id'],'available':this[_0x1f91('0x15')],'loggedIn':this[_0x1f91('0x10')],'name':this[_0x1f91('0x6')],'paused':this[_0x1f91('0x11')],'waiting':this['waiting']};var _0x23cdf9=md5(JSON[_0x1f91('0x16')](_0x3caa46));if(this[_0x1f91('0x1')]!==_0x23cdf9){this[_0x1f91('0x1')]=_0x23cdf9;io['to'](util['format'](_0x1f91('0x17'),_0x3caa46[_0x1f91('0x6')]))[_0x1f91('0x18')](_0x1f91('0x19'),_0x3caa46);}};module['exports']=FaxQueue;
\ No newline at end of file
index 1c2a6ea..cab91c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb42=['name'];(function(_0x35cdf8,_0xca1235){var _0x4a23ce=function(_0x850ecf){while(--_0x850ecf){_0x35cdf8['push'](_0x35cdf8['shift']());}};_0x4a23ce(++_0xca1235);}(_0xdb42,0xbc));var _0x2db4=function(_0x3ace59,_0x10d008){_0x3ace59=_0x3ace59-0x0;var _0xcde312=_0xdb42[_0x3ace59];return _0xcde312;};'use strict';function Interval(_0x11c740){this['id']=_0x11c740['id']||0x0;this[_0x2db4('0x0')]=_0x11c740[_0x2db4('0x0')]||'';this['Intervals']=_0x11c740['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
+var _0xe916=['Intervals','exports'];(function(_0x4ece58,_0x50922a){var _0x20d209=function(_0x3de5f6){while(--_0x3de5f6){_0x4ece58['push'](_0x4ece58['shift']());}};_0x20d209(++_0x50922a);}(_0xe916,0xf4));var _0x6e91=function(_0x57bfbe,_0x5a7649){_0x57bfbe=_0x57bfbe-0x0;var _0x54a8b3=_0xe916[_0x57bfbe];return _0x54a8b3;};'use strict';function Interval(_0x31652d){this['id']=_0x31652d['id']||0x0;this['name']=_0x31652d['name']||'';this[_0x6e91('0x0')]=_0x31652d[_0x6e91('0x0')]||{};}module[_0x6e91('0x1')]=Interval;
\ No newline at end of file
index 54319d1..2770755 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcad3=['emit','mail_queue:save','lodash','md5','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','mailPause','available','stringify','format'];(function(_0x2ffefe,_0x5a389a){var _0x5c15b0=function(_0x41b43d){while(--_0x41b43d){_0x2ffefe['push'](_0x2ffefe['shift']());}};_0x5c15b0(++_0x5a389a);}(_0xcad3,0x12b));var _0x3cad=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0xcad3[_0xa4f636];return _0x37e02a;};'use strict';var _=require(_0x3cad('0x0'));var md5=require(_0x3cad('0x1'));var util=require('util');var Redis=require(_0x3cad('0x2'));var config=require('../../../config/environment');config[_0x3cad('0x3')]=_[_0x3cad('0x4')](config[_0x3cad('0x3')],{'host':_0x3cad('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3cad('0x3')]));function MailQueue(_0x216610){this['id']=_0x216610['id']||0x0;this['name']=_0x216610[_0x3cad('0x6')]||'';this[_0x3cad('0x7')]=_0x216610[_0x3cad('0x7')]||0xa;this[_0x3cad('0x8')]=_0x216610[_0x3cad('0x8')]||_0x3cad('0x9');this[_0x3cad('0xa')]=_0x216610[_0x3cad('0xa')];this[_0x3cad('0xb')]={};this[_0x3cad('0xc')]=0x0;this['md5']='';this[_0x3cad('0xd')]();this[_0x3cad('0xe')]();}MailQueue[_0x3cad('0xf')]['updateRouting']=function(){var _0x281421=this[_0x3cad('0xb')][_0x3cad('0x10')];this[_0x3cad('0xb')]=_['map'](this[_0x3cad('0xa')],'id');this['mapAgentsId'][_0x3cad('0x10')]=_0x281421;};MailQueue[_0x3cad('0xf')][_0x3cad('0xe')]=function(){this[_0x3cad('0x11')]=0x0;this[_0x3cad('0x12')]=0x0;for(var _0x1507f9=0x0;_0x1507f9<this['Agents'][_0x3cad('0x13')];_0x1507f9+=0x1){if(this[_0x3cad('0xa')][_0x1507f9][_0x3cad('0x14')]){this[_0x3cad('0x11')]+=0x1;}if(this[_0x3cad('0xa')][_0x1507f9][_0x3cad('0x15')]){this[_0x3cad('0x12')]+=0x1;}}this[_0x3cad('0x16')]=this[_0x3cad('0x11')]-this[_0x3cad('0x12')];this[_0x3cad('0x16')]=this[_0x3cad('0x16')]>=0x0?this[_0x3cad('0x16')]:0x0;var _0x10a546={'id':this['id'],'available':this[_0x3cad('0x16')],'loggedIn':this[_0x3cad('0x11')],'name':this['name'],'paused':this[_0x3cad('0x12')],'waiting':this[_0x3cad('0xc')]};var _0x2a8dab=md5(JSON[_0x3cad('0x17')](_0x10a546));if(this[_0x3cad('0x1')]!==_0x2a8dab){this[_0x3cad('0x1')]=_0x2a8dab;io['to'](util[_0x3cad('0x18')]('mail:queue:%s',_0x10a546['name']))[_0x3cad('0x19')](_0x3cad('0x1a'),_0x10a546);}};module['exports']=MailQueue;
\ No newline at end of file
+var _0x026e=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','length','online','loggedIn','paused','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x026e,0x1aa));var _0xe026=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x026e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe026('0x0'));var md5=require(_0xe026('0x1'));var util=require(_0xe026('0x2'));var Redis=require(_0xe026('0x3'));var config=require(_0xe026('0x4'));config[_0xe026('0x5')]=_[_0xe026('0x6')](config[_0xe026('0x5')],{'host':_0xe026('0x7'),'port':0x18eb});var io=require(_0xe026('0x8'))(new Redis(config[_0xe026('0x5')]));function MailQueue(_0x3f6c87){this['id']=_0x3f6c87['id']||0x0;this[_0xe026('0x9')]=_0x3f6c87[_0xe026('0x9')]||'';this[_0xe026('0xa')]=_0x3f6c87[_0xe026('0xa')]||0xa;this[_0xe026('0xb')]=_0x3f6c87[_0xe026('0xb')]||_0xe026('0xc');this['Agents']=_0x3f6c87[_0xe026('0xd')];this[_0xe026('0xe')]={};this[_0xe026('0xf')]=0x0;this[_0xe026('0x1')]='';this['updateRouting']();this[_0xe026('0x10')]();}MailQueue[_0xe026('0x11')][_0xe026('0x12')]=function(){var _0x378a2f=this[_0xe026('0xe')][_0xe026('0x13')];this[_0xe026('0xe')]=_[_0xe026('0x14')](this[_0xe026('0xd')],'id');this['mapAgentsId'][_0xe026('0x13')]=_0x378a2f;};MailQueue[_0xe026('0x11')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x486c58=0x0;_0x486c58<this[_0xe026('0xd')][_0xe026('0x15')];_0x486c58+=0x1){if(this['Agents'][_0x486c58][_0xe026('0x16')]){this[_0xe026('0x17')]+=0x1;}if(this[_0xe026('0xd')][_0x486c58]['mailPause']){this[_0xe026('0x18')]+=0x1;}}this[_0xe026('0x19')]=this[_0xe026('0x17')]-this['paused'];this['available']=this[_0xe026('0x19')]>=0x0?this[_0xe026('0x19')]:0x0;var _0x2d2c92={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xe026('0x9')],'paused':this[_0xe026('0x18')],'waiting':this[_0xe026('0xf')]};var _0x552911=md5(JSON[_0xe026('0x1a')](_0x2d2c92));if(this['md5']!==_0x552911){this[_0xe026('0x1')]=_0x552911;io['to'](util[_0xe026('0x1b')](_0xe026('0x1c'),_0x2d2c92[_0xe026('0x9')]))['emit'](_0xe026('0x1d'),_0x2d2c92);}};module[_0xe026('0x1e')]=MailQueue;
\ No newline at end of file
index 365ea43..7fb499e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x2a18b7,_0x5041c8){var _0x45e74e=function(_0x1d32d6){while(--_0x1d32d6){_0x2a18b7['push'](_0x2a18b7['shift']());}};_0x45e74e(++_0x5041c8);}(_0x2ef3,0xba));var _0x32ef=function(_0x127a37,_0x5d49c7){_0x127a37=_0x127a37-0x0;var _0x5eb657=_0x2ef3[_0x127a37];return _0x5eb657;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009<this[_0x32ef('0xa')][_0x32ef('0x11')];_0x4d8009+=0x1){if(this[_0x32ef('0xa')][_0x4d8009][_0x32ef('0x12')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x4d8009]['openchannelPause']){this[_0x32ef('0x10')]+=0x1;}}this[_0x32ef('0x13')]=this[_0x32ef('0x14')]-this['paused'];this['available']=this[_0x32ef('0x13')]>=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=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(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'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 469abad..2d44262 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdab2=['sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','format'];(function(_0x3c6a2e,_0x3465ed){var _0x481c0e=function(_0x316c49){while(--_0x316c49){_0x3c6a2e['push'](_0x3c6a2e['shift']());}};_0x481c0e(++_0x3465ed);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var md5=require(_0x2dab('0x1'));var util=require('util');var Redis=require(_0x2dab('0x2'));var config=require(_0x2dab('0x3'));config[_0x2dab('0x4')]=_[_0x2dab('0x5')](config['redis'],{'host':_0x2dab('0x6'),'port':0x18eb});var io=require(_0x2dab('0x7'))(new Redis(config[_0x2dab('0x4')]));function SmsQueue(_0x203350){this['id']=_0x203350['id']||0x0;this[_0x2dab('0x8')]=_0x203350[_0x2dab('0x8')]||'';this[_0x2dab('0x9')]=_0x203350[_0x2dab('0x9')]||0xa;this[_0x2dab('0xa')]=_0x203350[_0x2dab('0xa')]||_0x2dab('0xb');this[_0x2dab('0xc')]=_0x203350[_0x2dab('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x2dab('0x1')]='';this[_0x2dab('0xd')]();this[_0x2dab('0xe')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x29e96b=this[_0x2dab('0xf')][_0x2dab('0x10')];this[_0x2dab('0xf')]=_[_0x2dab('0x11')](this['Agents'],'id');this[_0x2dab('0xf')][_0x2dab('0x10')]=_0x29e96b;};SmsQueue['prototype'][_0x2dab('0xe')]=function(){this[_0x2dab('0x12')]=0x0;this[_0x2dab('0x13')]=0x0;for(var _0x597a6e=0x0;_0x597a6e<this[_0x2dab('0xc')][_0x2dab('0x14')];_0x597a6e+=0x1){if(this['Agents'][_0x597a6e][_0x2dab('0x15')]){this[_0x2dab('0x12')]+=0x1;}if(this[_0x2dab('0xc')][_0x597a6e][_0x2dab('0x16')]){this[_0x2dab('0x13')]+=0x1;}}this['available']=this[_0x2dab('0x12')]-this[_0x2dab('0x13')];this[_0x2dab('0x17')]=this[_0x2dab('0x17')]>=0x0?this[_0x2dab('0x17')]:0x0;var _0x2a86b5={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2dab('0x12')],'name':this[_0x2dab('0x8')],'paused':this[_0x2dab('0x13')],'waiting':this['waiting']};var _0x3340fd=md5(JSON[_0x2dab('0x18')](_0x2a86b5));if(this[_0x2dab('0x1')]!==_0x3340fd){this['md5']=_0x3340fd;io['to'](util[_0x2dab('0x19')](_0x2dab('0x1a'),_0x2a86b5[_0x2dab('0x8')]))[_0x2dab('0x1b')](_0x2dab('0x1c'),_0x2a86b5);}};module[_0x2dab('0x1d')]=SmsQueue;
\ No newline at end of file
+var _0x6a24=['name','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','smsPause','available','waiting','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter'];(function(_0x511ebc,_0x428b7f){var _0x29b5b5=function(_0x16fe50){while(--_0x16fe50){_0x511ebc['push'](_0x511ebc['shift']());}};_0x29b5b5(++_0x428b7f);}(_0x6a24,0xd1));var _0x46a2=function(_0x13e700,_0x38cf61){_0x13e700=_0x13e700-0x0;var _0x276fb8=_0x6a24[_0x13e700];return _0x276fb8;};'use strict';var _=require(_0x46a2('0x0'));var md5=require(_0x46a2('0x1'));var util=require('util');var Redis=require(_0x46a2('0x2'));var config=require(_0x46a2('0x3'));config[_0x46a2('0x4')]=_[_0x46a2('0x5')](config[_0x46a2('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x46a2('0x6'))(new Redis(config[_0x46a2('0x4')]));function SmsQueue(_0x4f6948){this['id']=_0x4f6948['id']||0x0;this[_0x46a2('0x7')]=_0x4f6948[_0x46a2('0x7')]||'';this['timeout']=_0x4f6948['timeout']||0xa;this[_0x46a2('0x8')]=_0x4f6948[_0x46a2('0x8')]||'beepall';this[_0x46a2('0x9')]=_0x4f6948['Agents'];this[_0x46a2('0xa')]={};this['waiting']=0x0;this[_0x46a2('0x1')]='';this[_0x46a2('0xb')]();this[_0x46a2('0xc')]();}SmsQueue[_0x46a2('0xd')][_0x46a2('0xb')]=function(){var _0x40ef63=this[_0x46a2('0xa')][_0x46a2('0xe')];this['mapAgentsId']=_['map'](this[_0x46a2('0x9')],'id');this[_0x46a2('0xa')]['_rr']=_0x40ef63;};SmsQueue[_0x46a2('0xd')][_0x46a2('0xc')]=function(){this[_0x46a2('0xf')]=0x0;this[_0x46a2('0x10')]=0x0;for(var _0xddc328=0x0;_0xddc328<this[_0x46a2('0x9')][_0x46a2('0x11')];_0xddc328+=0x1){if(this[_0x46a2('0x9')][_0xddc328]['online']){this['loggedIn']+=0x1;}if(this[_0x46a2('0x9')][_0xddc328][_0x46a2('0x12')]){this['paused']+=0x1;}}this[_0x46a2('0x13')]=this[_0x46a2('0xf')]-this['paused'];this[_0x46a2('0x13')]=this[_0x46a2('0x13')]>=0x0?this['available']:0x0;var _0x27250b={'id':this['id'],'available':this[_0x46a2('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x46a2('0x7')],'paused':this[_0x46a2('0x10')],'waiting':this[_0x46a2('0x14')]};var _0xc28d15=md5(JSON[_0x46a2('0x15')](_0x27250b));if(this[_0x46a2('0x1')]!==_0xc28d15){this[_0x46a2('0x1')]=_0xc28d15;io['to'](util[_0x46a2('0x16')](_0x46a2('0x17'),_0x27250b[_0x46a2('0x7')]))[_0x46a2('0x18')](_0x46a2('0x19'),_0x27250b);}};module[_0x46a2('0x1a')]=SmsQueue;
\ No newline at end of file
index 969285a..49b897e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a28=['paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn'];(function(_0x27efdd,_0x29c6a6){var _0x1fc2c0=function(_0x1eade2){while(--_0x1eade2){_0x27efdd['push'](_0x27efdd['shift']());}};_0x1fc2c0(++_0x29c6a6);}(_0x9a28,0x1cb));var _0x89a2=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x9a28[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x89a2('0x0'));var md5=require(_0x89a2('0x1'));var util=require('util');var Redis=require(_0x89a2('0x2'));var config=require(_0x89a2('0x3'));config[_0x89a2('0x4')]=_[_0x89a2('0x5')](config[_0x89a2('0x4')],{'host':_0x89a2('0x6'),'port':0x18eb});var io=require(_0x89a2('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x41e691){this['id']=_0x41e691['id']||0x0;this[_0x89a2('0x8')]=_0x41e691[_0x89a2('0x8')]||'';this[_0x89a2('0x9')]=_0x41e691[_0x89a2('0x9')]||0xa;this[_0x89a2('0xa')]=_0x41e691[_0x89a2('0xa')]||_0x89a2('0xb');this[_0x89a2('0xc')]=_0x41e691[_0x89a2('0xc')];this[_0x89a2('0xd')]={};this[_0x89a2('0xe')]=0x0;this[_0x89a2('0x1')]='';this[_0x89a2('0xf')]();this[_0x89a2('0x10')]();}WhatsappQueue[_0x89a2('0x11')]['updateRouting']=function(){var _0x5a60b7=this['mapAgentsId']['_rr'];this[_0x89a2('0xd')]=_[_0x89a2('0x12')](this['Agents'],'id');this[_0x89a2('0xd')][_0x89a2('0x13')]=_0x5a60b7;};WhatsappQueue[_0x89a2('0x11')]['updateRealtime']=function(){this[_0x89a2('0x14')]=0x0;this[_0x89a2('0x15')]=0x0;for(var _0x1b2c9d=0x0;_0x1b2c9d<this[_0x89a2('0xc')][_0x89a2('0x16')];_0x1b2c9d+=0x1){if(this[_0x89a2('0xc')][_0x1b2c9d][_0x89a2('0x17')]){this[_0x89a2('0x14')]+=0x1;}if(this[_0x89a2('0xc')][_0x1b2c9d][_0x89a2('0x18')]){this[_0x89a2('0x15')]+=0x1;}}this[_0x89a2('0x19')]=this[_0x89a2('0x14')]-this[_0x89a2('0x15')];this[_0x89a2('0x19')]=this[_0x89a2('0x19')]>=0x0?this[_0x89a2('0x19')]:0x0;var _0x2099e7={'id':this['id'],'available':this[_0x89a2('0x19')],'loggedIn':this[_0x89a2('0x14')],'name':this[_0x89a2('0x8')],'paused':this[_0x89a2('0x15')],'waiting':this['waiting']};var _0x2f7ffd=md5(JSON[_0x89a2('0x1a')](_0x2099e7));if(this[_0x89a2('0x1')]!==_0x2f7ffd){this[_0x89a2('0x1')]=_0x2f7ffd;io['to'](util[_0x89a2('0x1b')](_0x89a2('0x1c'),_0x2099e7[_0x89a2('0x8')]))[_0x89a2('0x1d')](_0x89a2('0x1e'),_0x2099e7);}};module[_0x89a2('0x1f')]=WhatsappQueue;
\ No newline at end of file
+var _0xc9a9=['updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0xc9a9,0xe9));var _0x9c9a=function(_0x36c16a,_0x492ad7){_0x36c16a=_0x36c16a-0x0;var _0x24727f=_0xc9a9[_0x36c16a];return _0x24727f;};'use strict';var _=require(_0x9c9a('0x0'));var md5=require(_0x9c9a('0x1'));var util=require(_0x9c9a('0x2'));var Redis=require(_0x9c9a('0x3'));var config=require(_0x9c9a('0x4'));config[_0x9c9a('0x5')]=_[_0x9c9a('0x6')](config[_0x9c9a('0x5')],{'host':_0x9c9a('0x7'),'port':0x18eb});var io=require(_0x9c9a('0x8'))(new Redis(config[_0x9c9a('0x5')]));function WhatsappQueue(_0x28d4e3){this['id']=_0x28d4e3['id']||0x0;this[_0x9c9a('0x9')]=_0x28d4e3[_0x9c9a('0x9')]||'';this['timeout']=_0x28d4e3['timeout']||0xa;this[_0x9c9a('0xa')]=_0x28d4e3['strategy']||_0x9c9a('0xb');this['Agents']=_0x28d4e3[_0x9c9a('0xc')];this[_0x9c9a('0xd')]={};this[_0x9c9a('0xe')]=0x0;this['md5']='';this[_0x9c9a('0xf')]();this['updateRealtime']();}WhatsappQueue[_0x9c9a('0x10')][_0x9c9a('0xf')]=function(){var _0x62fe6=this['mapAgentsId'][_0x9c9a('0x11')];this[_0x9c9a('0xd')]=_[_0x9c9a('0x12')](this[_0x9c9a('0xc')],'id');this['mapAgentsId']['_rr']=_0x62fe6;};WhatsappQueue[_0x9c9a('0x10')][_0x9c9a('0x13')]=function(){this[_0x9c9a('0x14')]=0x0;this[_0x9c9a('0x15')]=0x0;for(var _0x3a8e86=0x0;_0x3a8e86<this['Agents'][_0x9c9a('0x16')];_0x3a8e86+=0x1){if(this['Agents'][_0x3a8e86][_0x9c9a('0x17')]){this['loggedIn']+=0x1;}if(this[_0x9c9a('0xc')][_0x3a8e86][_0x9c9a('0x18')]){this[_0x9c9a('0x15')]+=0x1;}}this['available']=this[_0x9c9a('0x14')]-this['paused'];this[_0x9c9a('0x19')]=this[_0x9c9a('0x19')]>=0x0?this[_0x9c9a('0x19')]:0x0;var _0x304ac9={'id':this['id'],'available':this[_0x9c9a('0x19')],'loggedIn':this[_0x9c9a('0x14')],'name':this[_0x9c9a('0x9')],'paused':this[_0x9c9a('0x15')],'waiting':this['waiting']};var _0x1a2751=md5(JSON[_0x9c9a('0x1a')](_0x304ac9));if(this[_0x9c9a('0x1')]!==_0x1a2751){this[_0x9c9a('0x1')]=_0x1a2751;io['to'](util[_0x9c9a('0x1b')](_0x9c9a('0x1c'),_0x304ac9[_0x9c9a('0x9')]))[_0x9c9a('0x1d')](_0x9c9a('0x1e'),_0x304ac9);}};module['exports']=WhatsappQueue;
\ No newline at end of file
index d47b0e1..8ccf3fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x450fcd,_0x51c2cf){var _0x294426=function(_0x1aafe8){while(--_0x1aafe8){_0x450fcd['push'](_0x450fcd['shift']());}};_0x294426(++_0x51c2cf);}(_0xb10b,0x12a));var _0xbb10=function(_0x10482b,_0x1461c7){_0x10482b=_0x10482b-0x0;var _0x2388d4=_0xb10b[_0x10482b];return _0x2388d4;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
+var _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(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 4012722..5907bf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x894e=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x23e0aa,_0x16306b){var _0x2ead18=function(_0x4a4c9b){while(--_0x4a4c9b){_0x23e0aa['push'](_0x23e0aa['shift']());}};_0x2ead18(++_0x16306b);}(_0x894e,0x8a));var _0xe894=function(_0x2c32fb,_0x45b9a8){_0x2c32fb=_0x2c32fb-0x0;var _0x1f2836=_0x894e[_0x2c32fb];return _0x1f2836;};'use strict';var client=require(_0xe894('0x0'));exports[_0xe894('0x1')]=function(_0x1d3a32,_0x44217f){return client[_0xe894('0x2')](_0xe894('0x3'),{'body':_0x44217f,'options':{'where':{'id':_0x1d3a32}},'log':_0xe894('0x4')});};exports[_0xe894('0x5')]=function(_0x470326,_0x3dd1fb){return client[_0xe894('0x2')](_0xe894('0x6'),{'body':_0x3dd1fb,'options':{'where':{'id':_0x470326}},'log':_0xe894('0x7')});};
\ No newline at end of file
+var _0x9e1d=['UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request'];(function(_0x3b8e27,_0x50efd7){var _0x2da151=function(_0x4bf94c){while(--_0x4bf94c){_0x3b8e27['push'](_0x3b8e27['shift']());}};_0x2da151(++_0x50efd7);}(_0x9e1d,0xe2));var _0xd9e1=function(_0x1c11ad,_0x53cebc){_0x1c11ad=_0x1c11ad-0x0;var _0xe6e74f=_0x9e1d[_0x1c11ad];return _0xe6e74f;};'use strict';var client=require('../client');exports[_0xd9e1('0x0')]=function(_0x13fa36,_0x544829){return client[_0xd9e1('0x1')](_0xd9e1('0x2'),{'body':_0x544829,'options':{'where':{'id':_0x13fa36}},'log':_0xd9e1('0x3')});};exports['addTags']=function(_0x5a2f5e,_0x1a84f8){return client[_0xd9e1('0x1')](_0xd9e1('0x4'),{'body':_0x1a84f8,'options':{'where':{'id':_0x5a2f5e}},'log':_0xd9e1('0x5')});};
\ No newline at end of file
index 0aff0b2..1d61c75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5612=['../client','Request','createChatMessage'];(function(_0x4ec84a,_0x49de2d){var _0x56c0de=function(_0x3bd511){while(--_0x3bd511){_0x4ec84a['push'](_0x4ec84a['shift']());}};_0x56c0de(++_0x49de2d);}(_0x5612,0x108));var _0x2561=function(_0x15c068,_0x441624){_0x15c068=_0x15c068-0x0;var _0x369daf=_0x5612[_0x15c068];return _0x369daf;};'use strict';var client=require(_0x2561('0x0'));exports['create']=function(_0x12cf70){return client[_0x2561('0x1')]('CreateChatMessage',{'body':_0x12cf70,'log':_0x2561('0x2')});};
\ No newline at end of file
+var _0xb850=['createChatMessage','Request','CreateChatMessage'];(function(_0x4a05b5,_0x38adff){var _0x78e285=function(_0x2333f1){while(--_0x2333f1){_0x4a05b5['push'](_0x4a05b5['shift']());}};_0x78e285(++_0x38adff);}(_0xb850,0x1b4));var _0x0b85=function(_0x3102ab,_0x481c69){_0x3102ab=_0x3102ab-0x0;var _0x232720=_0xb850[_0x3102ab];return _0x232720;};'use strict';var client=require('../client');exports['create']=function(_0x2eb200){return client[_0x0b85('0x0')](_0x0b85('0x1'),{'body':_0x2eb200,'log':_0x0b85('0x2')});};
\ No newline at end of file
index 23cfdce..1485920 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c3b=['../client','getChatQueues','Request','timeout','strategy','User','Agents','name','online'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x1c3b,0xab));var _0xb1c3=function(_0x54cb48,_0x55f172){_0x54cb48=_0x54cb48-0x0;var _0x5ca057=_0x1c3b[_0x54cb48];return _0x5ca057;};'use strict';var client=require(_0xb1c3('0x0'));exports[_0xb1c3('0x1')]=function(){return function(){return client[_0xb1c3('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0xb1c3('0x3'),_0xb1c3('0x4')],'include':[{'model':_0xb1c3('0x5'),'as':_0xb1c3('0x6'),'attributes':['id',_0xb1c3('0x7'),_0xb1c3('0x8'),'chatPause']}]},'log':_0xb1c3('0x1')});};};
\ No newline at end of file
+var _0x4b19=['../client','Request','GetChatQueue','name','strategy','User','Agents','online','chatPause'];(function(_0x59a40c,_0x35999f){var _0x3cf340=function(_0x3d2c47){while(--_0x3d2c47){_0x59a40c['push'](_0x59a40c['shift']());}};_0x3cf340(++_0x35999f);}(_0x4b19,0x195));var _0x94b1=function(_0x1acee2,_0x58bf24){_0x1acee2=_0x1acee2-0x0;var _0x23dc85=_0x4b19[_0x1acee2];return _0x23dc85;};'use strict';var client=require(_0x94b1('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x94b1('0x1')](_0x94b1('0x2'),{'options':{'raw':![],'attributes':['id',_0x94b1('0x3'),'timeout',_0x94b1('0x4')],'include':[{'model':_0x94b1('0x5'),'as':_0x94b1('0x6'),'attributes':['id','name',_0x94b1('0x7'),_0x94b1('0x8')]}]},'log':'getChatQueues'});};};
\ No newline at end of file
index a2a460c..54c4930 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac65=['update','Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport'];(function(_0x32980b,_0x489e9d){var _0x2eac50=function(_0x4e81d5){while(--_0x4e81d5){_0x32980b['push'](_0x32980b['shift']());}};_0x2eac50(++_0x489e9d);}(_0xac65,0x11d));var _0x5ac6=function(_0x20e044,_0x29372a){_0x20e044=_0x20e044-0x0;var _0x344638=_0xac65[_0x20e044];return _0x344638;};'use strict';var client=require(_0x5ac6('0x0'));exports[_0x5ac6('0x1')]=function(_0x11c244){return client['Request'](_0x5ac6('0x2'),{'body':_0x11c244,'log':_0x5ac6('0x2')});};exports[_0x5ac6('0x3')]=function(_0x4a8183,_0x16800d){return client[_0x5ac6('0x4')](_0x5ac6('0x5'),{'body':_0x16800d,'options':{'where':{'uniqueid':_0x4a8183},'order':[['id','DESC']],'limit':0x1},'log':_0x5ac6('0x5')});};
\ No newline at end of file
+var _0x5c12=['Request','UpdateChatQueueReport','create','CreateChatQueueReport','update'];(function(_0x1d7c83,_0x2d8f2d){var _0x283ef2=function(_0x68da53){while(--_0x68da53){_0x1d7c83['push'](_0x1d7c83['shift']());}};_0x283ef2(++_0x2d8f2d);}(_0x5c12,0x188));var _0x25c1=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0x5c12[_0x540133];return _0x26b6e9;};'use strict';var client=require('../client');exports[_0x25c1('0x0')]=function(_0x1e452d){return client['Request'](_0x25c1('0x1'),{'body':_0x1e452d,'log':_0x25c1('0x1')});};exports[_0x25c1('0x2')]=function(_0x10f10c,_0x2c5df0){return client[_0x25c1('0x3')](_0x25c1('0x4'),{'body':_0x2c5df0,'options':{'where':{'uniqueid':_0x10f10c},'order':[['id','DESC']],'limit':0x1},'log':_0x25c1('0x4')});};
\ No newline at end of file
index e4952b6..558944b 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(_0x44bca0,_0x219367){var _0x372db4=function(_0x8a123d){while(--_0x8a123d){_0x44bca0['push'](_0x44bca0['shift']());}};_0x372db4(++_0x219367);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x19afe7,_0xa17b86){var _0xa90996=function(_0x171171){while(--_0x171171){_0x19afe7['push'](_0x19afe7['shift']());}};_0xa90996(++_0xa17b86);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
index 27540e1..bae8e99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebfe=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x47b865,_0x24cf3c){var _0xd82d57=function(_0x1c2782){while(--_0x1c2782){_0x47b865['push'](_0x47b865['shift']());}};_0xd82d57(++_0x24cf3c);}(_0xebfe,0x107));var _0xeebf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xebfe[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xeebf('0x0'));exports[_0xeebf('0x1')]=function(_0x646464){return client[_0xeebf('0x2')](_0xeebf('0x3'),{'body':_0x646464,'log':_0xeebf('0x4')});};
\ No newline at end of file
+var _0xb33e=['create','Request','CreateFaxMessage'];(function(_0x2cad07,_0xdfa252){var _0x46b8ad=function(_0x441250){while(--_0x441250){_0x2cad07['push'](_0x2cad07['shift']());}};_0x46b8ad(++_0xdfa252);}(_0xb33e,0x117));var _0xeb33=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb33e[_0x21a9d9];return _0x46adce;};'use strict';var client=require('../client');exports[_0xeb33('0x0')]=function(_0x239621){return client[_0xeb33('0x1')](_0xeb33('0x2'),{'body':_0x239621,'log':'createFaxMessage'});};
\ No newline at end of file
index 02ced3b..18e551c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0733=['faxPause','../client','getFaxQueues','Request','name','strategy','User','Agents','online'];(function(_0x4489f2,_0x1f9128){var _0x5cc527=function(_0x44201f){while(--_0x44201f){_0x4489f2['push'](_0x4489f2['shift']());}};_0x5cc527(++_0x1f9128);}(_0x0733,0x91));var _0x3073=function(_0x3a061a,_0x5d5c2b){_0x3a061a=_0x3a061a-0x0;var _0x464d5c=_0x0733[_0x3a061a];return _0x464d5c;};'use strict';var client=require(_0x3073('0x0'));exports[_0x3073('0x1')]=function(){return function(){return client[_0x3073('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x3073('0x3'),'timeout',_0x3073('0x4')],'include':[{'model':_0x3073('0x5'),'as':_0x3073('0x6'),'attributes':['id',_0x3073('0x3'),_0x3073('0x7'),_0x3073('0x8')]}]},'log':_0x3073('0x1')});};};
\ No newline at end of file
+var _0xe3d5=['strategy','User','Agents','online','faxPause','../client','getFaxQueues','name'];(function(_0x429aef,_0x354389){var _0x2e6ebc=function(_0x544a6d){while(--_0x544a6d){_0x429aef['push'](_0x429aef['shift']());}};_0x2e6ebc(++_0x354389);}(_0xe3d5,0x65));var _0x5e3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3d5[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x5e3d('0x0'));exports[_0x5e3d('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x5e3d('0x2'),'timeout',_0x5e3d('0x3')],'include':[{'model':_0x5e3d('0x4'),'as':_0x5e3d('0x5'),'attributes':['id','name',_0x5e3d('0x6'),_0x5e3d('0x7')]}]},'log':_0x5e3d('0x1')});};};
\ No newline at end of file
index ea918b1..52ec3b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb02=['update','UpdateFaxQueueReport','DESC','../client','Request','CreateFaxQueueReport'];(function(_0x42bc40,_0x3623b2){var _0x3f25b6=function(_0xd08fd9){while(--_0xd08fd9){_0x42bc40['push'](_0x42bc40['shift']());}};_0x3f25b6(++_0x3623b2);}(_0xcb02,0xd5));var _0x2cb0=function(_0x227f7a,_0x5b519e){_0x227f7a=_0x227f7a-0x0;var _0xde3f49=_0xcb02[_0x227f7a];return _0xde3f49;};'use strict';var client=require(_0x2cb0('0x0'));exports['create']=function(_0x182a32){return client[_0x2cb0('0x1')](_0x2cb0('0x2'),{'body':_0x182a32,'log':_0x2cb0('0x2')});};exports[_0x2cb0('0x3')]=function(_0x3cf832,_0x48e06f){return client[_0x2cb0('0x1')](_0x2cb0('0x4'),{'body':_0x48e06f,'options':{'where':{'uniqueid':_0x3cf832},'order':[['id',_0x2cb0('0x5')]],'limit':0x1},'log':_0x2cb0('0x4')});};
\ No newline at end of file
+var _0xd2ab=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x27cfc5,_0x630ac4){var _0x21eb36=function(_0x67e00d){while(--_0x67e00d){_0x27cfc5['push'](_0x27cfc5['shift']());}};_0x21eb36(++_0x630ac4);}(_0xd2ab,0x1da));var _0xbd2a=function(_0x1fb948,_0x4e30af){_0x1fb948=_0x1fb948-0x0;var _0x204b4f=_0xd2ab[_0x1fb948];return _0x204b4f;};'use strict';var client=require(_0xbd2a('0x0'));exports[_0xbd2a('0x1')]=function(_0xd8c3c2){return client[_0xbd2a('0x2')](_0xbd2a('0x3'),{'body':_0xd8c3c2,'log':'CreateFaxQueueReport'});};exports[_0xbd2a('0x4')]=function(_0x20ef52,_0x1d3fb9){return client[_0xbd2a('0x2')](_0xbd2a('0x5'),{'body':_0x1d3fb9,'options':{'where':{'uniqueid':_0x20ef52},'order':[['id',_0xbd2a('0x6')]],'limit':0x1},'log':_0xbd2a('0x5')});};
\ No newline at end of file
index 659a8b1..4f47e43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63bc=['name','Interval','Intervals','interval','../client','getIntervals','GetInterval'];(function(_0x44dd5d,_0x5982e3){var _0x5985c1=function(_0x2125a0){while(--_0x2125a0){_0x44dd5d['push'](_0x44dd5d['shift']());}};_0x5985c1(++_0x5982e3);}(_0x63bc,0x115));var _0xc63b=function(_0x445a09,_0x3f89a6){_0x445a09=_0x445a09-0x0;var _0x5e74a0=_0x63bc[_0x445a09];return _0x5e74a0;};'use strict';var client=require(_0xc63b('0x0'));exports[_0xc63b('0x1')]=function(){return function(){return client['Request'](_0xc63b('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc63b('0x3')],'include':[{'model':_0xc63b('0x4'),'as':_0xc63b('0x5'),'attributes':['id',_0xc63b('0x3'),_0xc63b('0x6')]}]},'log':_0xc63b('0x1')});};};
\ No newline at end of file
+var _0x0af8=['../client','Request','GetInterval','Interval','Intervals','name','interval','getIntervals'];(function(_0x2f6d0e,_0x3f84c5){var _0x1beb67=function(_0x2e1529){while(--_0x2e1529){_0x2f6d0e['push'](_0x2f6d0e['shift']());}};_0x1beb67(++_0x3f84c5);}(_0x0af8,0x178));var _0x80af=function(_0x429bd5,_0x4076ae){_0x429bd5=_0x429bd5-0x0;var _0x1ffb67=_0x0af8[_0x429bd5];return _0x1ffb67;};'use strict';var client=require(_0x80af('0x0'));exports['getIntervals']=function(){return function(){return client[_0x80af('0x1')](_0x80af('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x80af('0x3'),'as':_0x80af('0x4'),'attributes':['id',_0x80af('0x5'),_0x80af('0x6')]}]},'log':_0x80af('0x7')});};};
\ No newline at end of file
index b6bf44f..a4fe2a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1893=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x3ff3c6,_0x30abd7){var _0x524a87=function(_0x295360){while(--_0x295360){_0x3ff3c6['push'](_0x3ff3c6['shift']());}};_0x524a87(++_0x30abd7);}(_0x1893,0xa2));var _0x3189=function(_0xa9d9c4,_0x2cfe0c){_0xa9d9c4=_0xa9d9c4-0x0;var _0x18d97e=_0x1893[_0xa9d9c4];return _0x18d97e;};'use strict';var client=require('../client');exports['update']=function(_0x1bfe8b,_0x3aec2b){return client[_0x3189('0x0')](_0x3189('0x1'),{'body':_0x3aec2b,'options':{'where':{'id':_0x1bfe8b}},'log':_0x3189('0x2')});};exports[_0x3189('0x3')]=function(_0x3953a2,_0x5371db){return client[_0x3189('0x0')](_0x3189('0x4'),{'body':_0x5371db,'options':{'where':{'id':_0x3953a2}},'log':_0x3189('0x5')});};
\ No newline at end of file
+var _0x5204=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0x5204,0xdf));var _0x4520=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x5204[_0x2f9467];return _0x39894c;};'use strict';var client=require(_0x4520('0x0'));exports[_0x4520('0x1')]=function(_0x53b1ab,_0x12a3a1){return client[_0x4520('0x2')](_0x4520('0x3'),{'body':_0x12a3a1,'options':{'where':{'id':_0x53b1ab}},'log':_0x4520('0x4')});};exports[_0x4520('0x5')]=function(_0x592fe0,_0x41d89c){return client['Request'](_0x4520('0x6'),{'body':_0x41d89c,'options':{'where':{'id':_0x592fe0}},'log':_0x4520('0x7')});};
\ No newline at end of file
index 2b36d4c..536937a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e1b=['CreateMailMessage','../client','Request'];(function(_0x408c51,_0x509100){var _0x1f338b=function(_0xb1cac5){while(--_0xb1cac5){_0x408c51['push'](_0x408c51['shift']());}};_0x1f338b(++_0x509100);}(_0x1e1b,0x100));var _0xb1e1=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1e1b[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0xb1e1('0x0'));exports['create']=function(_0xc4889c){return client[_0xb1e1('0x1')](_0xb1e1('0x2'),{'body':_0xc4889c,'log':'createMailMessage'});};
\ No newline at end of file
+var _0xfbdf=['../client','create','CreateMailMessage','createMailMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfbdf,0x11c));var _0xffbd=function(_0x5e3a1f,_0x24c078){_0x5e3a1f=_0x5e3a1f-0x0;var _0x3c27fd=_0xfbdf[_0x5e3a1f];return _0x3c27fd;};'use strict';var client=require(_0xffbd('0x0'));exports[_0xffbd('0x1')]=function(_0x3e547a){return client['Request'](_0xffbd('0x2'),{'body':_0x3e547a,'log':_0xffbd('0x3')});};
\ No newline at end of file
index 816a8be..e794399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd97e=['online','mailPause','getMailQueues','Request','GetMailQueue','strategy','User','name'];(function(_0x6990cd,_0xb82440){var _0x642e9b=function(_0x5b305e){while(--_0x5b305e){_0x6990cd['push'](_0x6990cd['shift']());}};_0x642e9b(++_0xb82440);}(_0xd97e,0x7a));var _0xed97=function(_0x2bc412,_0x33201e){_0x2bc412=_0x2bc412-0x0;var _0x20170f=_0xd97e[_0x2bc412];return _0x20170f;};'use strict';var client=require('../client');exports[_0xed97('0x0')]=function(){return function(){return client[_0xed97('0x1')](_0xed97('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xed97('0x3')],'include':[{'model':_0xed97('0x4'),'as':'Agents','attributes':['id',_0xed97('0x5'),_0xed97('0x6'),_0xed97('0x7')]}]},'log':_0xed97('0x0')});};};
\ No newline at end of file
+var _0x35ed=['strategy','User','online','mailPause','getMailQueues','name'];(function(_0x19eefb,_0x1c6597){var _0x37f9cc=function(_0x517365){while(--_0x517365){_0x19eefb['push'](_0x19eefb['shift']());}};_0x37f9cc(++_0x1c6597);}(_0x35ed,0xd0));var _0xd35e=function(_0x5d9f5d,_0x9f0780){_0x5d9f5d=_0x5d9f5d-0x0;var _0x4e4710=_0x35ed[_0x5d9f5d];return _0x4e4710;};'use strict';var client=require('../client');exports[_0xd35e('0x0')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xd35e('0x1'),'timeout',_0xd35e('0x2')],'include':[{'model':_0xd35e('0x3'),'as':'Agents','attributes':['id',_0xd35e('0x1'),_0xd35e('0x4'),_0xd35e('0x5')]}]},'log':_0xd35e('0x0')});};};
\ No newline at end of file
index c196178..b3d1d36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb783=['update','DESC','../client','create','CreateMailQueueReport'];(function(_0x48c238,_0x5a1ca0){var _0x59f6fb=function(_0x369129){while(--_0x369129){_0x48c238['push'](_0x48c238['shift']());}};_0x59f6fb(++_0x5a1ca0);}(_0xb783,0x1e2));var _0x3b78=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xb783[_0x68c979];return _0x4f0001;};'use strict';var client=require(_0x3b78('0x0'));exports[_0x3b78('0x1')]=function(_0x5514c3){return client['Request'](_0x3b78('0x2'),{'body':_0x5514c3,'log':_0x3b78('0x2')});};exports[_0x3b78('0x3')]=function(_0x42e9bd,_0x22f8cf){return client['Request']('UpdateMailQueueReport',{'body':_0x22f8cf,'options':{'where':{'uniqueid':_0x42e9bd},'order':[['id',_0x3b78('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
+var _0xd7ae=['DESC','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xd7ae,0x1d0));var _0xed7a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd7ae[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0xed7a('0x0'));exports[_0xed7a('0x1')]=function(_0x3adba1){return client[_0xed7a('0x2')](_0xed7a('0x3'),{'body':_0x3adba1,'log':_0xed7a('0x3')});};exports[_0xed7a('0x4')]=function(_0x21f7ef,_0x90bd1d){return client[_0xed7a('0x2')]('UpdateMailQueueReport',{'body':_0x90bd1d,'options':{'where':{'uniqueid':_0x21f7ef},'order':[['id',_0xed7a('0x5')]],'limit':0x1},'log':_0xed7a('0x6')});};
\ No newline at end of file
index 6415719..6c5e89c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4600=['Request','AddTagsToOpenchannelInteraction','../client','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x66dcd4,_0x3c0a54){var _0x3b72c9=function(_0x491bdc){while(--_0x491bdc){_0x66dcd4['push'](_0x66dcd4['shift']());}};_0x3b72c9(++_0x3c0a54);}(_0x4600,0x13a));var _0x0460=function(_0x208331,_0x16a0d0){_0x208331=_0x208331-0x0;var _0xa34762=_0x4600[_0x208331];return _0xa34762;};'use strict';var client=require(_0x0460('0x0'));exports['update']=function(_0x1ba954,_0x24643b){return client['Request'](_0x0460('0x1'),{'body':_0x24643b,'options':{'where':{'id':_0x1ba954}},'log':_0x0460('0x2')});};exports[_0x0460('0x3')]=function(_0x2b04d7,_0x26ca15){return client[_0x0460('0x4')](_0x0460('0x5'),{'body':_0x26ca15,'options':{'where':{'id':_0x2b04d7}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0x51f9=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x51f9,0x187));var _0x951f=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x51f9[_0x5ce15c];return _0x36e4f5;};'use strict';var client=require(_0x951f('0x0'));exports[_0x951f('0x1')]=function(_0x5ac254,_0x20e361){return client[_0x951f('0x2')](_0x951f('0x3'),{'body':_0x20e361,'options':{'where':{'id':_0x5ac254}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x58f74b,_0x479c62){return client[_0x951f('0x2')](_0x951f('0x4'),{'body':_0x479c62,'options':{'where':{'id':_0x58f74b}},'log':_0x951f('0x5')});};
\ No newline at end of file
index 077f217..fbc11b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe9e=['../client','create','Request','createOpenchannelMessage'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xbe9e,0xc4));var _0xebe9=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbe9e[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0xebe9('0x0'));exports[_0xebe9('0x1')]=function(_0x29e90d){return client[_0xebe9('0x2')]('CreateOpenchannelMessage',{'body':_0x29e90d,'log':_0xebe9('0x3')});};
\ No newline at end of file
+var _0x79de=['../client','Request','createOpenchannelMessage'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x79de,0x153));var _0xe79d=function(_0x155aa7,_0x3e6814){_0x155aa7=_0x155aa7-0x0;var _0x461a2d=_0x79de[_0x155aa7];return _0x461a2d;};'use strict';var client=require(_0xe79d('0x0'));exports['create']=function(_0x46d12a){return client[_0xe79d('0x1')]('CreateOpenchannelMessage',{'body':_0x46d12a,'log':_0xe79d('0x2')});};
\ No newline at end of file
index f32fcec..3844243 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4357=['strategy','User','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout'];(function(_0x3db5d0,_0x86382){var _0x1b9b01=function(_0x24210d){while(--_0x24210d){_0x3db5d0['push'](_0x3db5d0['shift']());}};_0x1b9b01(++_0x86382);}(_0x4357,0xa7));var _0x7435=function(_0x584513,_0x37c6c9){_0x584513=_0x584513-0x0;var _0xe4a14e=_0x4357[_0x584513];return _0xe4a14e;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x7435('0x0')](_0x7435('0x1'),{'options':{'raw':![],'attributes':['id',_0x7435('0x2'),_0x7435('0x3'),_0x7435('0x4')],'include':[{'model':_0x7435('0x5'),'as':'Agents','attributes':['id',_0x7435('0x2'),_0x7435('0x6'),_0x7435('0x7')]}]},'log':_0x7435('0x8')});};};
\ No newline at end of file
+var _0x38ad=['name','timeout','strategy','User','Agents','online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x5ef10f,_0x2efccf){var _0x1676c3=function(_0x49be57){while(--_0x49be57){_0x5ef10f['push'](_0x5ef10f['shift']());}};_0x1676c3(++_0x2efccf);}(_0x38ad,0x16e));var _0xd38a=function(_0x1ca7fc,_0x1166e1){_0x1ca7fc=_0x1ca7fc-0x0;var _0x238bc9=_0x38ad[_0x1ca7fc];return _0x238bc9;};'use strict';var client=require(_0xd38a('0x0'));exports[_0xd38a('0x1')]=function(){return function(){return client[_0xd38a('0x2')](_0xd38a('0x3'),{'options':{'raw':![],'attributes':['id',_0xd38a('0x4'),_0xd38a('0x5'),_0xd38a('0x6')],'include':[{'model':_0xd38a('0x7'),'as':_0xd38a('0x8'),'attributes':['id',_0xd38a('0x4'),_0xd38a('0x9'),'openchannelPause']}]},'log':_0xd38a('0x1')});};};
\ No newline at end of file
index 7bf6aa8..d040f91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc35=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','../client','Request'];(function(_0x3eb4ae,_0x493c5b){var _0x1aa0d4=function(_0x194a3b){while(--_0x194a3b){_0x3eb4ae['push'](_0x3eb4ae['shift']());}};_0x1aa0d4(++_0x493c5b);}(_0xdc35,0xd6));var _0x5dc3=function(_0x48b175,_0x1d9725){_0x48b175=_0x48b175-0x0;var _0x47490e=_0xdc35[_0x48b175];return _0x47490e;};'use strict';var client=require(_0x5dc3('0x0'));exports['create']=function(_0x3be9c5){return client[_0x5dc3('0x1')](_0x5dc3('0x2'),{'body':_0x3be9c5,'log':_0x5dc3('0x2')});};exports['update']=function(_0x3b2e91,_0xae0d9e){return client['Request'](_0x5dc3('0x3'),{'body':_0xae0d9e,'options':{'where':{'uniqueid':_0x3b2e91},'order':[['id','DESC']],'limit':0x1},'log':_0x5dc3('0x3')});};
\ No newline at end of file
+var _0xbee7=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x182cdd,_0x20c7d1){var _0x5c4424=function(_0x15ce57){while(--_0x15ce57){_0x182cdd['push'](_0x182cdd['shift']());}};_0x5c4424(++_0x20c7d1);}(_0xbee7,0x1c6));var _0x7bee=function(_0x20315c,_0x18720d){_0x20315c=_0x20315c-0x0;var _0x561cb3=_0xbee7[_0x20315c];return _0x561cb3;};'use strict';var client=require(_0x7bee('0x0'));exports[_0x7bee('0x1')]=function(_0x1be2eb){return client[_0x7bee('0x2')](_0x7bee('0x3'),{'body':_0x1be2eb,'log':_0x7bee('0x3')});};exports['update']=function(_0x550384,_0x46c318){return client[_0x7bee('0x2')](_0x7bee('0x4'),{'body':_0x46c318,'options':{'where':{'uniqueid':_0x550384},'order':[['id',_0x7bee('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
index 4b14d9a..0d54457 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1af5=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x2d6cd2,_0x333d65){var _0x163843=function(_0x21f9ba){while(--_0x21f9ba){_0x2d6cd2['push'](_0x2d6cd2['shift']());}};_0x163843(++_0x333d65);}(_0x1af5,0x17d));var _0x51af=function(_0x4a0ddf,_0x59c85c){_0x4a0ddf=_0x4a0ddf-0x0;var _0x324fde=_0x1af5[_0x4a0ddf];return _0x324fde;};'use strict';var client=require(_0x51af('0x0'));exports['update']=function(_0x45dbac,_0x26eee9){return client[_0x51af('0x1')](_0x51af('0x2'),{'body':_0x26eee9,'options':{'where':{'id':_0x45dbac}},'log':_0x51af('0x3')});};exports[_0x51af('0x4')]=function(_0x3e09ac,_0x1ef226){return client[_0x51af('0x1')](_0x51af('0x5'),{'body':_0x1ef226,'options':{'where':{'id':_0x3e09ac}},'log':_0x51af('0x6')});};
\ No newline at end of file
+var _0x9ff4=['addTagsToSmsInteraction','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction'];(function(_0x1a7a1b,_0x518846){var _0x350750=function(_0x4ab680){while(--_0x4ab680){_0x1a7a1b['push'](_0x1a7a1b['shift']());}};_0x350750(++_0x518846);}(_0x9ff4,0x196));var _0x49ff=function(_0x27dbbf,_0x49f640){_0x27dbbf=_0x27dbbf-0x0;var _0x42636e=_0x9ff4[_0x27dbbf];return _0x42636e;};'use strict';var client=require('../client');exports['update']=function(_0x5a5e42,_0x2e465b){return client[_0x49ff('0x0')](_0x49ff('0x1'),{'body':_0x2e465b,'options':{'where':{'id':_0x5a5e42}},'log':_0x49ff('0x2')});};exports['addTags']=function(_0x9207f0,_0x44482a){return client[_0x49ff('0x0')](_0x49ff('0x3'),{'body':_0x44482a,'options':{'where':{'id':_0x9207f0}},'log':_0x49ff('0x4')});};
\ No newline at end of file
index aae5591..bb829d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbb9=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x5291a1,_0x5447b6){var _0x34e7cf=function(_0x222d4f){while(--_0x222d4f){_0x5291a1['push'](_0x5291a1['shift']());}};_0x34e7cf(++_0x5447b6);}(_0xfbb9,0x119));var _0x9fbb=function(_0x9ea8f2,_0xd04c51){_0x9ea8f2=_0x9ea8f2-0x0;var _0x2aab15=_0xfbb9[_0x9ea8f2];return _0x2aab15;};'use strict';var client=require(_0x9fbb('0x0'));exports[_0x9fbb('0x1')]=function(_0x1a65ee){return client[_0x9fbb('0x2')](_0x9fbb('0x3'),{'body':_0x1a65ee,'log':_0x9fbb('0x4')});};
\ No newline at end of file
+var _0x786b=['../client','Request','createSmsMessage'];(function(_0x1ae9cd,_0x1fdea7){var _0x3c819c=function(_0x312319){while(--_0x312319){_0x1ae9cd['push'](_0x1ae9cd['shift']());}};_0x3c819c(++_0x1fdea7);}(_0x786b,0x129));var _0xb786=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x786b[_0x53ccf2];return _0x5a2964;};'use strict';var client=require(_0xb786('0x0'));exports['create']=function(_0x4750aa){return client[_0xb786('0x1')]('CreateSmsMessage',{'body':_0x4750aa,'log':_0xb786('0x2')});};
\ No newline at end of file
index a99196d..fb4bfde 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(_0x1bf940,_0x11883a){var _0x678fc8=function(_0x55abce){while(--_0x55abce){_0x1bf940['push'](_0x1bf940['shift']());}};_0x678fc8(++_0x11883a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0xcb91[_0x35f7f5];return _0x5567a4;};'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(_0x4db702,_0x477504){var _0x5ac59f=function(_0x528548){while(--_0x528548){_0x4db702['push'](_0x4db702['shift']());}};_0x5ac59f(++_0x477504);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 ec0e948..471702e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x261017,_0x19e537){var _0x23e8a8=function(_0x4ca8e5){while(--_0x4ca8e5){_0x261017['push'](_0x261017['shift']());}};_0x23e8a8(++_0x19e537);}(_0x3e74,0x175));var _0x43e7=function(_0xabc751,_0x506c53){_0xabc751=_0xabc751-0x0;var _0x121cd1=_0x3e74[_0xabc751];return _0x121cd1;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});};
\ No newline at end of file
+var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x158cd3,_0x31d521){var _0x4eab2f=function(_0x5b09c3){while(--_0x5b09c3){_0x158cd3['push'](_0x158cd3['shift']());}};_0x4eab2f(++_0x31d521);}(_0x3e74,0x175));var _0x43e7=function(_0x5d203f,_0x25e9bd){_0x5d203f=_0x5d203f-0x0;var _0x2b7f1a=_0x3e74[_0x5d203f];return _0x2b7f1a;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});};
\ No newline at end of file
index d5614ed..5e3a51e 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(_0x3bd710,_0x541b35){var _0x5efba4=function(_0xcebfc4){while(--_0xcebfc4){_0x3bd710['push'](_0x3bd710['shift']());}};_0x5efba4(++_0x541b35);}(_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(_0x5320c8,_0x1a131a){var _0x5f795d=function(_0x3a5957){while(--_0x3a5957){_0x5320c8['push'](_0x5320c8['shift']());}};_0x5f795d(++_0x1a131a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 92754b6..6202d05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa46e=['../client','update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x330ac6,_0x3adc83){var _0x59b845=function(_0x191b10){while(--_0x191b10){_0x330ac6['push'](_0x330ac6['shift']());}};_0x59b845(++_0x3adc83);}(_0xa46e,0x8a));var _0xea46=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0xa46e[_0x136a0d];return _0x212ea5;};'use strict';var client=require(_0xea46('0x0'));exports[_0xea46('0x1')]=function(_0x5c746c,_0x372d94){return client[_0xea46('0x2')](_0xea46('0x3'),{'body':_0x372d94,'options':{'where':{'id':_0x5c746c}},'log':'updateWhatsappInteraction'});};exports[_0xea46('0x4')]=function(_0x4b6e4a,_0x3a2209){return client['Request'](_0xea46('0x5'),{'body':_0x3a2209,'options':{'where':{'id':_0x4b6e4a}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0x9fd4=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x444314,_0x359e0e){var _0x31a0f4=function(_0x1dda96){while(--_0x1dda96){_0x444314['push'](_0x444314['shift']());}};_0x31a0f4(++_0x359e0e);}(_0x9fd4,0x16c));var _0x49fd=function(_0x57fd08,_0x413740){_0x57fd08=_0x57fd08-0x0;var _0x26c3b8=_0x9fd4[_0x57fd08];return _0x26c3b8;};'use strict';var client=require(_0x49fd('0x0'));exports[_0x49fd('0x1')]=function(_0x29d5af,_0x30771e){return client[_0x49fd('0x2')](_0x49fd('0x3'),{'body':_0x30771e,'options':{'where':{'id':_0x29d5af}},'log':_0x49fd('0x4')});};exports[_0x49fd('0x5')]=function(_0x3f149e,_0x55dda5){return client['Request'](_0x49fd('0x6'),{'body':_0x55dda5,'options':{'where':{'id':_0x3f149e}},'log':_0x49fd('0x7')});};
\ No newline at end of file
index a9fe500..6083bc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../client','create','Request'];(function(_0x52e0da,_0x46546d){var _0x3490ec=function(_0x426afd){while(--_0x426afd){_0x52e0da['push'](_0x52e0da['shift']());}};_0x3490ec(++_0x46546d);}(_0x70e0,0x15f));var _0x070e=function(_0x24d3f3,_0x2d4632){_0x24d3f3=_0x24d3f3-0x0;var _0x254914=_0x70e0[_0x24d3f3];return _0x254914;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x2f40e0){return client[_0x070e('0x2')]('CreateWhatsappMessage',{'body':_0x2f40e0,'log':'createWhatsappMessage'});};
\ No newline at end of file
+var _0x6b82=['../client','create','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x5cc3d4,_0xbcbf9b){var _0x17ca31=function(_0x5dbd6d){while(--_0x5dbd6d){_0x5cc3d4['push'](_0x5cc3d4['shift']());}};_0x17ca31(++_0xbcbf9b);}(_0x6b82,0x1a0));var _0x26b8=function(_0x4237dc,_0x171899){_0x4237dc=_0x4237dc-0x0;var _0x35ed7f=_0x6b82[_0x4237dc];return _0x35ed7f;};'use strict';var client=require(_0x26b8('0x0'));exports[_0x26b8('0x1')]=function(_0x2136f2){return client['Request'](_0x26b8('0x2'),{'body':_0x2136f2,'log':_0x26b8('0x3')});};
\ No newline at end of file
index ed4e274..57c2520 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73b1=['online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x73b1,0x19f));var _0x173b=function(_0x31e4bd,_0x1cb650){_0x31e4bd=_0x31e4bd-0x0;var _0x10c084=_0x73b1[_0x31e4bd];return _0x10c084;};'use strict';var client=require('../client');exports[_0x173b('0x0')]=function(){return function(){return client[_0x173b('0x1')](_0x173b('0x2'),{'options':{'raw':![],'attributes':['id',_0x173b('0x3'),_0x173b('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x173b('0x3'),_0x173b('0x5'),_0x173b('0x6')]}]},'log':_0x173b('0x0')});};};
\ No newline at end of file
+var _0x3e5d=['whatsappPause','getWhatsappQueues','../client','Request','GetWhatsappQueue','User','Agents','name'];(function(_0x277224,_0x3090f2){var _0x2212c1=function(_0xb84f84){while(--_0xb84f84){_0x277224['push'](_0x277224['shift']());}};_0x2212c1(++_0x3090f2);}(_0x3e5d,0xba));var _0xd3e5=function(_0x125fba,_0x15a86d){_0x125fba=_0x125fba-0x0;var _0x885f4=_0x3e5d[_0x125fba];return _0x885f4;};'use strict';var client=require(_0xd3e5('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xd3e5('0x1')](_0xd3e5('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xd3e5('0x3'),'as':_0xd3e5('0x4'),'attributes':['id',_0xd3e5('0x5'),'online',_0xd3e5('0x6')]}]},'log':_0xd3e5('0x7')});};};
\ No newline at end of file
index c64adbc..fd841d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeffc=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','create','Request'];(function(_0x44731a,_0x3417bb){var _0x5541bd=function(_0x26d125){while(--_0x26d125){_0x44731a['push'](_0x44731a['shift']());}};_0x5541bd(++_0x3417bb);}(_0xeffc,0x106));var _0xceff=function(_0x270417,_0x3e491d){_0x270417=_0x270417-0x0;var _0x3f3eb7=_0xeffc[_0x270417];return _0x3f3eb7;};'use strict';var client=require('../client');exports[_0xceff('0x0')]=function(_0x45aa61){return client[_0xceff('0x1')](_0xceff('0x2'),{'body':_0x45aa61,'log':_0xceff('0x2')});};exports[_0xceff('0x3')]=function(_0x26cbd7,_0x1cab4a){return client[_0xceff('0x1')](_0xceff('0x4'),{'body':_0x1cab4a,'options':{'where':{'uniqueid':_0x26cbd7},'order':[['id',_0xceff('0x5')]],'limit':0x1},'log':_0xceff('0x4')});};
\ No newline at end of file
+var _0x20b3=['../client','create','CreateWhatsappQueueReport','update','Request','DESC'];(function(_0x214a25,_0x15071d){var _0x405988=function(_0x5c6fc1){while(--_0x5c6fc1){_0x214a25['push'](_0x214a25['shift']());}};_0x405988(++_0x15071d);}(_0x20b3,0x90));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x320b('0x0'));exports[_0x320b('0x1')]=function(_0x4d3065){return client['Request'](_0x320b('0x2'),{'body':_0x4d3065,'log':_0x320b('0x2')});};exports[_0x320b('0x3')]=function(_0x21d7f3,_0x297b04){return client[_0x320b('0x4')]('UpdateWhatsappQueueReport',{'body':_0x297b04,'options':{'where':{'uniqueid':_0x21d7f3},'order':[['id',_0x320b('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
index aaf3e5e..e94990c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe647=['format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','message','join','stop','find','agents','timeout','createQueue','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info'];(function(_0x4921f8,_0x5cfbe0){var _0x10272e=function(_0x3810c8){while(--_0x3810c8){_0x4921f8['push'](_0x4921f8['shift']());}};_0x10272e(++_0x5cfbe0);}(_0xe647,0x16d));var _0x7e64=function(_0x1adc58,_0x3993fd){_0x1adc58=_0x1adc58-0x0;var _0x3d8963=_0xe647[_0x1adc58];return _0x3d8963;};'use strict';var schema=require(_0x7e64('0x0'));var _=require(_0x7e64('0x1'));var util=require('util');var seqqueue=require(_0x7e64('0x2'));var logger=require(_0x7e64('0x3'))(_0x7e64('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x7e64('0x5')},'timeout':{'type':_0x7e64('0x6'),'message':_0x7e64('0x7')}});function writeLog(_0x1383d6,_0x221235,_0x552ed3){return logger[_0x7e64('0x8')](util[_0x7e64('0x9')](_0x7e64('0xa'),_0x1383d6,_0x221235[_0x7e64('0xb')],_0x552ed3));}function handleFindAgent(_0x2e8d60){return function(_0x894990){return _0x894990[_0x7e64('0xb')][_0x7e64('0xc')]()===_0x2e8d60[_0x7e64('0xc')]();};}exports[_0x7e64('0xd')]=function(_0x55b588,_0x56d2d4,_0x4ff322,_0x2981b0){return function(_0x4185c6){try{var _0x3457d7={'name':_0x56d2d4[0x0],'timeout':_0x56d2d4[0x1]};var _0x4ecb28=queue[_0x7e64('0x0')](_0x3457d7,{'typecast':!![]});if(_0x4ecb28[_0x7e64('0xe')]){logger['error']('[%s][AGENT]\x20%s',_0x55b588,_[_0x7e64('0xf')](_0x4ecb28,_0x7e64('0x10'))[_0x7e64('0x11')](',\x20'));_0x4185c6[_0x7e64('0x12')]();}else{var _0x5a24f0=_[_0x7e64('0x13')](_0x4ff322[_0x7e64('0x14')],handleFindAgent(_0x3457d7[_0x7e64('0xb')]));if(_0x5a24f0){var _0x47e201=(_0x3457d7[_0x7e64('0x15')]||0xa)*0x3e8;var _0x266b34,_0x30de16;var _0x570787=seqqueue[_0x7e64('0x16')](_0x47e201);_0x570787['id']=_0x55b588;_0x570787['atimeout']=_0x47e201;_0x570787[_0x7e64('0x17')]=_0x2981b0[_0x7e64('0x17')];writeLog(_0x55b588,_0x5a24f0,util[_0x7e64('0x9')]('START:%s',_0x47e201));_0x4ff322['rules'][_0x55b588]['on'](_0x7e64('0x18'),function(){logger[_0x7e64('0x8')](_0x7e64('0x19'),_0x55b588);clearTimeout(_0x30de16);_0x30de16=undefined;_0x570787[_0x7e64('0x1a')]();if(_0x4ff322['rules'][_0x55b588]){delete _0x4ff322[_0x7e64('0x1b')][_0x55b588];}_0x4185c6['stop']();});_0x4ff322[_0x7e64('0x1b')][_0x55b588]['on'](_0x7e64('0x1c'),function(){if(_0x4ff322[_0x7e64('0x1b')][_0x55b588]){delete _0x4ff322[_0x7e64('0x1b')][_0x55b588];}});_0x30de16=setTimeout(function(){logger[_0x7e64('0x8')](_0x7e64('0x1d'),_0x55b588);clearTimeout(_0x30de16);_0x570787[_0x7e64('0x1a')]();_0x4185c6['next']();},_0x47e201);strategy['agent'](_0x570787,_0x5a24f0,_0x4ff322,_0x2981b0);}else{logger[_0x7e64('0x1e')](_0x7e64('0x1f'),_0x55b588,_0x3457d7[_0x7e64('0xb')]);_0x4185c6['stop']();}}}catch(_0x27b9ab){console[_0x7e64('0x20')](_0x27b9ab);logger['error']('[%s][QUEUE]\x20%s',_0x55b588,_0x27b9ab[_0x7e64('0x21')]);_0x4185c6['stop']();}};};
\ No newline at end of file
+var _0x062b=['message','join','find','agents','timeout','createQueue','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','length','error','map'];(function(_0x58ef68,_0x275204){var _0x169a7f=function(_0x479c79){while(--_0x479c79){_0x58ef68['push'](_0x58ef68['shift']());}};_0x169a7f(++_0x275204);}(_0x062b,0xe3));var _0xb062=function(_0x9c894d,_0x7816d0){_0x9c894d=_0x9c894d-0x0;var _0x4f2e46=_0x062b[_0x9c894d];return _0x4f2e46;};'use strict';var schema=require(_0xb062('0x0'));var _=require(_0xb062('0x1'));var util=require(_0xb062('0x2'));var seqqueue=require(_0xb062('0x3'));var logger=require(_0xb062('0x4'))(_0xb062('0x5'));var strategy=require(_0xb062('0x6'));var queue=schema({'name':{'type':_0xb062('0x7'),'required':!![],'message':_0xb062('0x8')},'timeout':{'type':_0xb062('0x9'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x39aebc,_0x19faf2,_0x2f69c7){return logger[_0xb062('0xa')](util[_0xb062('0xb')](_0xb062('0xc'),_0x39aebc,_0x19faf2[_0xb062('0xd')],_0x2f69c7));}function handleFindAgent(_0x7733be){return function(_0x19623f){return _0x19623f[_0xb062('0xd')]['toLowerCase']()===_0x7733be['toLowerCase']();};}exports[_0xb062('0xe')]=function(_0x347e2b,_0x4a7aef,_0x463c3d,_0x597595){return function(_0x3191a8){try{var _0xc09680={'name':_0x4a7aef[0x0],'timeout':_0x4a7aef[0x1]};var _0xf713f5=queue[_0xb062('0x0')](_0xc09680,{'typecast':!![]});if(_0xf713f5[_0xb062('0xf')]){logger[_0xb062('0x10')]('[%s][AGENT]\x20%s',_0x347e2b,_[_0xb062('0x11')](_0xf713f5,_0xb062('0x12'))[_0xb062('0x13')](',\x20'));_0x3191a8['stop']();}else{var _0x2686e0=_[_0xb062('0x14')](_0x463c3d[_0xb062('0x15')],handleFindAgent(_0xc09680[_0xb062('0xd')]));if(_0x2686e0){var _0x33d6b8=(_0xc09680[_0xb062('0x16')]||0xa)*0x3e8;var _0x1236e3,_0x25507b;var _0x472b90=seqqueue[_0xb062('0x17')](_0x33d6b8);_0x472b90['id']=_0x347e2b;_0x472b90['atimeout']=_0x33d6b8;_0x472b90['channel']=_0x597595['channel'];writeLog(_0x347e2b,_0x2686e0,util[_0xb062('0xb')](_0xb062('0x18'),_0x33d6b8));_0x463c3d[_0xb062('0x19')][_0x347e2b]['on'](_0xb062('0x1a'),function(){logger['info'](_0xb062('0x1b'),_0x347e2b);clearTimeout(_0x25507b);_0x25507b=undefined;_0x472b90[_0xb062('0x1c')]();if(_0x463c3d['rules'][_0x347e2b]){delete _0x463c3d[_0xb062('0x19')][_0x347e2b];}_0x3191a8['stop']();});_0x463c3d[_0xb062('0x19')][_0x347e2b]['on']('complete',function(){if(_0x463c3d[_0xb062('0x19')][_0x347e2b]){delete _0x463c3d[_0xb062('0x19')][_0x347e2b];}});_0x25507b=setTimeout(function(){logger['info'](_0xb062('0x1d'),_0x347e2b);clearTimeout(_0x25507b);_0x472b90[_0xb062('0x1c')]();_0x3191a8['next']();},_0x33d6b8);strategy[_0xb062('0x1e')](_0x472b90,_0x2686e0,_0x463c3d,_0x597595);}else{logger[_0xb062('0x10')](_0xb062('0x1f'),_0x347e2b,_0xc09680[_0xb062('0xd')]);_0x3191a8[_0xb062('0x20')]();}}}catch(_0x278b79){console[_0xb062('0x21')](_0x278b79);logger[_0xb062('0x10')]('[%s][QUEUE]\x20%s',_0x347e2b,_0x278b79[_0xb062('0x22')]);_0x3191a8[_0xb062('0x20')]();}};};
\ No newline at end of file
index 44ce0aa..c4238a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe7a=['catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','postText','message','amazonlex','providerName','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','ChatWebsiteId','account','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then'];(function(_0x3f5bfb,_0x1e145e){var _0x1c0f1e=function(_0x4fe32c){while(--_0x4fe32c){_0x3f5bfb['push'](_0x3f5bfb['shift']());}};_0x1c0f1e(++_0x1e145e);}(_0xfe7a,0x7a));var _0xafe7=function(_0x24c1f4,_0xf7c1ca){_0x24c1f4=_0x24c1f4-0x0;var _0x538cda=_0xfe7a[_0x24c1f4];return _0x538cda;};'use strict';var _=require(_0xafe7('0x0'));var moment=require(_0xafe7('0x1'));var AWS=require(_0xafe7('0x2'));var utils=require(_0xafe7('0x3'));var logger=require(_0xafe7('0x4'))(_0xafe7('0x5'));var rpc={'chatMessage':require(_0xafe7('0x6')),'openchannelMessage':require(_0xafe7('0x7')),'mailMessage':require(_0xafe7('0x8')),'smsMessage':require(_0xafe7('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xafe7('0xa')]=function(_0x2dd67b,_0x5b4795){return function(_0x13f2bd){try{if(!_[_0xafe7('0xb')](this['interaction'][_0xafe7('0xc')])){logger[_0xafe7('0xd')](_0xafe7('0xe'),_0x2dd67b,_0xafe7('0xf'));return _0x13f2bd[_0xafe7('0x10')]();}var _0x4d18e2={'ContactId':this[_0xafe7('0x11')]['id'],'sentAt':moment()[_0xafe7('0x12')](_0xafe7('0x13')),'direction':_0xafe7('0x14')};if(this[_0xafe7('0x15')]===_0xafe7('0x16')||this[_0xafe7('0x15')]===_0xafe7('0x17')){_0x4d18e2[_0xafe7('0x18')]=this[_0xafe7('0x19')][_0xafe7('0x18')];}var _0x47400c=this[_0xafe7('0x15')];if(_0x47400c==='chat'){_0x4d18e2[_0xafe7('0x1a')]=this[_0xafe7('0x1b')]['id'];}else{_0x4d18e2[_['upperFirst'](_0x47400c)+_0xafe7('0x1c')]=this[_0xafe7('0x1b')]['id'];}_0x4d18e2[_['upperFirst'](_0x47400c)+_0xafe7('0x1d')]=this['interaction']['id'];if(this['interaction'][_0xafe7('0x1e')]){var _0x319dfb=_0x5b4795[0x4];if(!_[_0xafe7('0x1f')](_0x319dfb)){_0x4d18e2[_0xafe7('0x20')]=utils[_0xafe7('0x21')](_0x319dfb,this);return rpc[_0x47400c+_0xafe7('0x22')][_0xafe7('0x23')](_0x4d18e2)[_0xafe7('0x24')](function(_0x1ca1f0){logger[_0xafe7('0xd')]('[%s][AMAZONLEX]\x20%s',_0x2dd67b,_0x4d18e2[_0xafe7('0x20')]);})[_0xafe7('0x25')](function(_0x27246a){logger[_0xafe7('0x26')](_0xafe7('0xe'),_0x2dd67b,JSON[_0xafe7('0x27')](_0x27246a));})[_0xafe7('0x28')](function(){logger[_0xafe7('0xd')](_0xafe7('0x29'),_0x2dd67b);_0x13f2bd[_0xafe7('0x2a')]();});}else{logger[_0xafe7('0xd')](_0xafe7('0x2b'),_0x2dd67b);_0x13f2bd['stop']();}}else{var _0x395bab=this;var _0x5b591f=new AWS[(_0xafe7('0x2c'))]({'accessKeyId':_0x5b4795[0x0],'secretAccessKey':_0x5b4795[0x1],'region':_0x5b4795[0x2]});var _0x281384={'botAlias':_0xafe7('0x2d'),'botName':_0x5b4795[0x3],'inputText':this['message'][_0xafe7('0x20')],'userId':this['channel']+':'+this[_0xafe7('0x19')]['id']['toString']()};_0x5b591f[_0xafe7('0x2e')](_0x281384,function(_0x1da57e,_0x16ca97){if(_0x1da57e){logger[_0xafe7('0x26')](_0xafe7('0xe'),_0x2dd67b,_0x1da57e['message']);_0x13f2bd[_0xafe7('0x10')]();}else if(_0x16ca97&&_0x16ca97[_0xafe7('0x2f')]){_0x395bab[_0xafe7('0x20')][_0xafe7('0x30')]=_0x16ca97;_0x4d18e2[_0xafe7('0x20')]=_0x16ca97[_0xafe7('0x2f')];_0x4d18e2[_0xafe7('0x31')]=_0xafe7('0x30');_0x4d18e2[_0xafe7('0x32')]=JSON[_0xafe7('0x27')](_0x16ca97);return rpc[_0x47400c+_0xafe7('0x22')][_0xafe7('0x23')](_0x4d18e2)[_0xafe7('0x24')](function(_0x5ec3fd){logger[_0xafe7('0xd')]('[%s][AMAZONLEX]\x20%s',_0x2dd67b,_0x4d18e2[_0xafe7('0x20')]);if(_0x16ca97[_0xafe7('0x33')]==_0xafe7('0x34')){_0x13f2bd[_0xafe7('0x10')]();}else{_0x13f2bd[_0xafe7('0x2a')]();}})['catch'](function(_0x2c5018){logger[_0xafe7('0x26')]('[%s][AMAZONLEX]\x20%s',_0x2dd67b,JSON[_0xafe7('0x27')](_0x2c5018));_0x13f2bd[_0xafe7('0x10')]();});}else{_0x13f2bd[_0xafe7('0x10')]();}});}}catch(_0x59cd78){logger[_0xafe7('0x26')]('[%s][AMAZONLEX]\x20%s',_0x2dd67b,JSON[_0xafe7('0x27')](_0x59cd78));_0x13f2bd[_0xafe7('0x2a')]();}};};
\ No newline at end of file
+var _0x0f89=['stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','toString','postText','message','next','amazonlex','providerResponse','dialogState','Failed','moment','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','ChatWebsiteId','account','upperFirst','body','getMustacheRender','Message','create','then','catch','error'];(function(_0x4ab9b3,_0x537f67){var _0x2ca94f=function(_0x303f52){while(--_0x303f52){_0x4ab9b3['push'](_0x4ab9b3['shift']());}};_0x2ca94f(++_0x537f67);}(_0x0f89,0x1a4));var _0x90f8=function(_0x19ac0c,_0x4d794c){_0x19ac0c=_0x19ac0c-0x0;var _0xe90175=_0x0f89[_0x19ac0c];return _0xe90175;};'use strict';var _=require('lodash');var moment=require(_0x90f8('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x90f8('0x1'));var rpc={'chatMessage':require(_0x90f8('0x2')),'openchannelMessage':require(_0x90f8('0x3')),'mailMessage':require(_0x90f8('0x4')),'smsMessage':require(_0x90f8('0x5')),'faxMessage':require(_0x90f8('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x90f8('0x7')]=function(_0x2a2af4,_0x10f2db){return function(_0x3ad5d2){try{if(!_[_0x90f8('0x8')](this['interaction']['UserId'])){logger[_0x90f8('0x9')](_0x90f8('0xa'),_0x2a2af4,_0x90f8('0xb'));return _0x3ad5d2['next']();}var _0x41930b={'ContactId':this[_0x90f8('0xc')]['id'],'sentAt':moment()[_0x90f8('0xd')](_0x90f8('0xe')),'direction':'out'};if(this[_0x90f8('0xf')]===_0x90f8('0x10')||this[_0x90f8('0xf')]===_0x90f8('0x11')){_0x41930b[_0x90f8('0x12')]=this[_0x90f8('0x13')][_0x90f8('0x12')];}var _0x2510aa=this[_0x90f8('0xf')];if(_0x2510aa==='chat'){_0x41930b[_0x90f8('0x14')]=this[_0x90f8('0x15')]['id'];}else{_0x41930b[_[_0x90f8('0x16')](_0x2510aa)+'AccountId']=this[_0x90f8('0x15')]['id'];}_0x41930b[_['upperFirst'](_0x2510aa)+'InteractionId']=this['interaction']['id'];if(this[_0x90f8('0x13')]['created']){var _0x39c1b9=_0x10f2db[0x4];if(!_['isEmpty'](_0x39c1b9)){_0x41930b[_0x90f8('0x17')]=utils[_0x90f8('0x18')](_0x39c1b9,this);return rpc[_0x2510aa+_0x90f8('0x19')][_0x90f8('0x1a')](_0x41930b)[_0x90f8('0x1b')](function(_0x46ed03){logger[_0x90f8('0x9')](_0x90f8('0xa'),_0x2a2af4,_0x41930b[_0x90f8('0x17')]);})[_0x90f8('0x1c')](function(_0x193796){logger[_0x90f8('0x1d')](_0x90f8('0xa'),_0x2a2af4,JSON[_0x90f8('0x1e')](_0x193796));})[_0x90f8('0x1f')](function(){logger[_0x90f8('0x9')](_0x90f8('0x20'),_0x2a2af4);_0x3ad5d2['stop']();});}else{logger[_0x90f8('0x9')](_0x90f8('0x21'),_0x2a2af4);_0x3ad5d2[_0x90f8('0x22')]();}}else{var _0x5d78cd=this;var _0x1f14fc=new AWS[(_0x90f8('0x23'))]({'accessKeyId':_0x10f2db[0x0],'secretAccessKey':_0x10f2db[0x1],'region':_0x10f2db[0x2]});var _0x13890a={'botAlias':_0x90f8('0x24'),'botName':_0x10f2db[0x3],'inputText':this['message'][_0x90f8('0x17')],'userId':this['channel']+':'+this[_0x90f8('0x13')]['id'][_0x90f8('0x25')]()};_0x1f14fc[_0x90f8('0x26')](_0x13890a,function(_0x3ea819,_0x270821){if(_0x3ea819){logger[_0x90f8('0x1d')](_0x90f8('0xa'),_0x2a2af4,_0x3ea819[_0x90f8('0x27')]);_0x3ad5d2[_0x90f8('0x28')]();}else if(_0x270821&&_0x270821[_0x90f8('0x27')]){_0x5d78cd['body']['amazonlex']=_0x270821;_0x41930b[_0x90f8('0x17')]=_0x270821[_0x90f8('0x27')];_0x41930b['providerName']=_0x90f8('0x29');_0x41930b[_0x90f8('0x2a')]=JSON[_0x90f8('0x1e')](_0x270821);return rpc[_0x2510aa+_0x90f8('0x19')][_0x90f8('0x1a')](_0x41930b)['then'](function(_0x2da182){logger['info']('[%s][AMAZONLEX]\x20%s',_0x2a2af4,_0x41930b['body']);if(_0x270821[_0x90f8('0x2b')]==_0x90f8('0x2c')){_0x3ad5d2[_0x90f8('0x28')]();}else{_0x3ad5d2[_0x90f8('0x22')]();}})['catch'](function(_0x51b675){logger['error'](_0x90f8('0xa'),_0x2a2af4,JSON[_0x90f8('0x1e')](_0x51b675));_0x3ad5d2[_0x90f8('0x28')]();});}else{_0x3ad5d2[_0x90f8('0x28')]();}});}}catch(_0x59499d){logger[_0x90f8('0x1d')](_0x90f8('0xa'),_0x2a2af4,JSON['stringify'](_0x59499d));_0x3ad5d2[_0x90f8('0x22')]();}};};
\ No newline at end of file
index cdcb7ed..91c543e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8142=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','[%s][AUTOREPLY]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','phone','read','subject','Re:','Re:\x20','ChatWebsiteId','upperFirst','AccountId','account','Smtp','service','host','port','secure','authentication','user','pass','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','headers','auto-replied','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','autoreplyExecuted','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x8142,0x91));var _0x2814=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0x8142[_0x1af0e5];return _0x3c444a;};'use strict';var _=require(_0x2814('0x0'));var moment=require(_0x2814('0x1'));var utils=require(_0x2814('0x2'));var logger=require(_0x2814('0x3'))(_0x2814('0x4'));var rpc={'chatMessage':require(_0x2814('0x5')),'openchannelMessage':require(_0x2814('0x6')),'mailMessage':require(_0x2814('0x7')),'smsMessage':require(_0x2814('0x8')),'faxMessage':require(_0x2814('0x9')),'whatsappMessage':require(_0x2814('0xa')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x2814('0xb')),'smsInteraction':require(_0x2814('0xc')),'faxInteraction':require(_0x2814('0xd')),'whatsappInteraction':require(_0x2814('0xe'))};var mailRpc=require('../../mailRpc');exports[_0x2814('0xf')]=function(_0x57f9c1,_0x310ea6,_0x50a15e,_0x33c6af){return function(_0x1f5906){try{var _0x8d766a=this[_0x2814('0x10')];if(_0x8d766a===_0x2814('0x11')&&_0x33c6af[_0x2814('0x12')][_0x2814('0x13')]){logger[_0x2814('0x14')]('[%s][AUTOREPLY]\x20%s',_0x57f9c1,_0x2814('0x15'));return _0x1f5906[_0x2814('0x16')]();}if(_0x310ea6[0x0]==='1'&&(_[_0x2814('0x17')](this['interaction'][_0x2814('0x18')])||!this[_0x2814('0x19')][_0x2814('0x18')])){logger[_0x2814('0x14')](_0x2814('0x1a'),_0x57f9c1,'Autoreply\x20already\x20sent');return _0x1f5906[_0x2814('0x16')]();}if(_0x310ea6[0x0]==='2'&&this[_0x2814('0x19')]['autoreplyExecuted']){logger[_0x2814('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x57f9c1,_0x2814('0x1b'));return _0x1f5906[_0x2814('0x16')]();}var _0x264936={'ContactId':this[_0x2814('0x1c')]['id'],'sentAt':moment()[_0x2814('0x1d')](_0x2814('0x1e')),'direction':'out'};if(this[_0x2814('0x10')]===_0x2814('0x11')){_0x264936['body']=utils[_0x2814('0x1f')](_0x310ea6[0x2],this);}else{_0x264936['body']=utils[_0x2814('0x1f')](_0x310ea6[0x1],this);}if(this[_0x2814('0x20')]){_0x264936['to']=this[_0x2814('0x20')]['from']||'';if(this[_0x2814('0x10')]===_0x2814('0x11')&&_0x310ea6[0x1]==='1'){_0x264936['cc']=this[_0x2814('0x20')]['cc']||'';}_0x264936['from']=this[_0x2814('0x20')]['to']||'';_0x264936[_0x2814('0x21')]=this[_0x2814('0x20')][_0x2814('0x21')]||'';_0x264936[_0x2814('0x22')]=!![];if(this[_0x2814('0x20')][_0x2814('0x23')]){_0x264936['subject']='';_0x264936[_0x2814('0x23')]+=_['startsWith'](this[_0x2814('0x20')][_0x2814('0x23')],_0x2814('0x24'))?'':_0x2814('0x25');_0x264936[_0x2814('0x23')]+=this['message'][_0x2814('0x23')];}}if(this['channel']==='chat'){_0x264936[_0x2814('0x26')]=this['account']['id'];}else{_0x264936[_[_0x2814('0x27')](this[_0x2814('0x10')])+_0x2814('0x28')]=this[_0x2814('0x29')]['id'];}_0x264936[_['upperFirst'](this[_0x2814('0x10')])+'InteractionId']=this['interaction']['id'];var _0x120298=this[_0x2814('0x19')];if(rpc[this[_0x2814('0x10')]+'Message']){if(this['channel']===_0x2814('0x11')){var _0x16098c={'tls':{'rejectUnauthorized':![]}};if(this[_0x2814('0x29')]['Smtp']['service']){_0x16098c['service']=this[_0x2814('0x29')][_0x2814('0x2a')][_0x2814('0x2b')];}else{_0x16098c[_0x2814('0x2c')]=this['account'][_0x2814('0x2a')][_0x2814('0x2c')];_0x16098c[_0x2814('0x2d')]=this[_0x2814('0x29')][_0x2814('0x2a')][_0x2814('0x2d')];_0x16098c[_0x2814('0x2e')]=this[_0x2814('0x29')]['Smtp']['secure'];}if(this[_0x2814('0x29')]['Smtp'][_0x2814('0x2f')]){_0x16098c['auth']={'user':this[_0x2814('0x29')][_0x2814('0x2a')][_0x2814('0x30')],'pass':this[_0x2814('0x29')]['Smtp'][_0x2814('0x31')]};}_0x264936['inReplyTo']=this[_0x2814('0x20')][_0x2814('0x32')];_0x264936[_0x2814('0x33')]=_0x2814('0x34')+_[_0x2814('0x35')](_0x264936[_0x2814('0x12')],_0x2814('0x36'),'<div')+'</div>';_0x264936[_0x2814('0x37')]={'Auto-Submitted':_0x2814('0x38'),'X-Auto-Response-Suppress':'All','Precedence':_0x2814('0x39')};return mailRpc['sendMailMessage'](_0x16098c,_0x264936)[_0x2814('0x3a')](function(_0xcc0e8){logger[_0x2814('0x14')](_0x2814('0x3b'),_0x57f9c1);_0x264936[_0x2814('0x32')]=_0xcc0e8[_0x2814('0x20')][_0x2814('0x32')];return rpc[_0x8d766a+_0x2814('0x3c')][_0x2814('0x3d')](_0x264936);})[_0x2814('0x3a')](function(_0x1f4968){logger[_0x2814('0x14')](_0x2814('0x1a'),_0x57f9c1,JSON['stringify'](_0x1f4968));})[_0x2814('0x3e')](function(_0x546085){logger[_0x2814('0x3f')](_0x2814('0x40'),_0x57f9c1,JSON[_0x2814('0x41')](_0x546085));})[_0x2814('0x42')](function(){Promise['resolve']()[_0x2814('0x3a')](function(){if(_0x310ea6[0x0]!=='2'||_0x120298[_0x2814('0x43')])return;return rpc[_0x8d766a+_0x2814('0x44')][_0x2814('0x45')](_0x120298['id'],{'autoreplyExecuted':!![]})[_0x2814('0x3a')](function(_0x28925a){logger[_0x2814('0x14')](_0x2814('0x46'),_0x57f9c1,JSON['stringify'](_0x28925a));})['catch'](function(_0x36fc01){logger[_0x2814('0x3f')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x57f9c1,JSON[_0x2814('0x41')](_0x36fc01));});})[_0x2814('0x3a')](function(){_0x1f5906['next']();});});}else{return rpc[this['channel']+_0x2814('0x3c')]['create'](_0x264936)[_0x2814('0x3a')](function(_0x218939){logger[_0x2814('0x14')]('[%s][AUTOREPLY]\x20%s',_0x57f9c1,_0x264936[_0x2814('0x12')]);})['catch'](function(_0x44979f){logger[_0x2814('0x3f')](_0x2814('0x1a'),_0x57f9c1,JSON[_0x2814('0x41')](_0x44979f));})[_0x2814('0x42')](function(){Promise[_0x2814('0x47')]()['then'](function(){if(_0x310ea6[0x0]!=='2'||_0x120298[_0x2814('0x43')])return;return rpc[_0x8d766a+_0x2814('0x44')][_0x2814('0x45')](_0x120298['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1eb60b){logger[_0x2814('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x57f9c1,JSON['stringify'](_0x1eb60b));})[_0x2814('0x3e')](function(_0x2702e9){logger[_0x2814('0x3f')](_0x2814('0x48'),_0x57f9c1,JSON[_0x2814('0x41')](_0x2702e9));});})[_0x2814('0x3a')](function(){_0x1f5906[_0x2814('0x16')]();});});}}}catch(_0x13ad24){logger['error'](_0x2814('0x1a'),_0x57f9c1,JSON[_0x2814('0x41')](_0x13ad24));_0x1f5906[_0x2814('0x49')]();}};};
\ No newline at end of file
+var _0x6bcf=['[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','autoreplyExecuted','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','created','interaction','Autoreply\x20already\x20sent','next','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','channel','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','service','Smtp','host','port','secure','user','pass','messageId','html','<div\x20id=\x22xm-mail-content\x22>','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6bcf,0xa0));var _0xf6bc=function(_0x16a2df,_0x26678c){_0x16a2df=_0x16a2df-0x0;var _0x502216=_0x6bcf[_0x16a2df];return _0x502216;};'use strict';var _=require(_0xf6bc('0x0'));var moment=require(_0xf6bc('0x1'));var utils=require(_0xf6bc('0x2'));var logger=require(_0xf6bc('0x3'))(_0xf6bc('0x4'));var rpc={'chatMessage':require(_0xf6bc('0x5')),'openchannelMessage':require(_0xf6bc('0x6')),'mailMessage':require(_0xf6bc('0x7')),'smsMessage':require(_0xf6bc('0x8')),'faxMessage':require(_0xf6bc('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xf6bc('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xf6bc('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xf6bc('0xc')),'whatsappInteraction':require(_0xf6bc('0xd'))};var mailRpc=require(_0xf6bc('0xe'));exports[_0xf6bc('0xf')]=function(_0x39a0b2,_0x27b98a,_0x175caa,_0x788810){return function(_0x486e59){try{var _0x161f5e=this['channel'];if(_0x161f5e===_0xf6bc('0x10')&&_0x788810[_0xf6bc('0x11')][_0xf6bc('0x12')]){logger[_0xf6bc('0x13')](_0xf6bc('0x14'),_0x39a0b2,_0xf6bc('0x15'));return _0x486e59['next']();}if(_0x27b98a[0x0]==='1'&&(_['isNil'](this['interaction'][_0xf6bc('0x16')])||!this[_0xf6bc('0x17')][_0xf6bc('0x16')])){logger[_0xf6bc('0x13')](_0xf6bc('0x14'),_0x39a0b2,_0xf6bc('0x18'));return _0x486e59[_0xf6bc('0x19')]();}if(_0x27b98a[0x0]==='2'&&this[_0xf6bc('0x17')]['autoreplyExecuted']){logger[_0xf6bc('0x13')](_0xf6bc('0x1a'),_0x39a0b2,_0xf6bc('0x1b'));return _0x486e59['next']();}var _0x5d3f4e={'ContactId':this['contact']['id'],'sentAt':moment()[_0xf6bc('0x1c')](_0xf6bc('0x1d')),'direction':_0xf6bc('0x1e')};if(this['channel']===_0xf6bc('0x10')){_0x5d3f4e['body']=utils[_0xf6bc('0x1f')](_0x27b98a[0x2],this);}else{_0x5d3f4e[_0xf6bc('0x11')]=utils[_0xf6bc('0x1f')](_0x27b98a[0x1],this);}if(this[_0xf6bc('0x20')]){_0x5d3f4e['to']=this[_0xf6bc('0x20')][_0xf6bc('0x21')]||'';if(this[_0xf6bc('0x22')]===_0xf6bc('0x10')&&_0x27b98a[0x1]==='1'){_0x5d3f4e['cc']=this[_0xf6bc('0x20')]['cc']||'';}_0x5d3f4e[_0xf6bc('0x21')]=this[_0xf6bc('0x20')]['to']||'';_0x5d3f4e[_0xf6bc('0x23')]=this[_0xf6bc('0x20')]['phone']||'';_0x5d3f4e[_0xf6bc('0x24')]=!![];if(this[_0xf6bc('0x20')][_0xf6bc('0x25')]){_0x5d3f4e[_0xf6bc('0x25')]='';_0x5d3f4e[_0xf6bc('0x25')]+=_[_0xf6bc('0x26')](this[_0xf6bc('0x20')][_0xf6bc('0x25')],_0xf6bc('0x27'))?'':'Re:\x20';_0x5d3f4e[_0xf6bc('0x25')]+=this[_0xf6bc('0x20')][_0xf6bc('0x25')];}}if(this[_0xf6bc('0x22')]===_0xf6bc('0x28')){_0x5d3f4e[_0xf6bc('0x29')]=this['account']['id'];}else{_0x5d3f4e[_[_0xf6bc('0x2a')](this['channel'])+_0xf6bc('0x2b')]=this[_0xf6bc('0x2c')]['id'];}_0x5d3f4e[_[_0xf6bc('0x2a')](this[_0xf6bc('0x22')])+'InteractionId']=this[_0xf6bc('0x17')]['id'];var _0x30db57=this[_0xf6bc('0x17')];if(rpc[this[_0xf6bc('0x22')]+_0xf6bc('0x2d')]){if(this['channel']==='mail'){var _0x49617a={'tls':{'rejectUnauthorized':![]}};if(this[_0xf6bc('0x2c')]['Smtp'][_0xf6bc('0x2e')]){_0x49617a['service']=this[_0xf6bc('0x2c')][_0xf6bc('0x2f')][_0xf6bc('0x2e')];}else{_0x49617a[_0xf6bc('0x30')]=this['account'][_0xf6bc('0x2f')][_0xf6bc('0x30')];_0x49617a[_0xf6bc('0x31')]=this[_0xf6bc('0x2c')]['Smtp'][_0xf6bc('0x31')];_0x49617a['secure']=this['account']['Smtp'][_0xf6bc('0x32')];}if(this[_0xf6bc('0x2c')][_0xf6bc('0x2f')]['authentication']){_0x49617a['auth']={'user':this['account']['Smtp'][_0xf6bc('0x33')],'pass':this[_0xf6bc('0x2c')]['Smtp'][_0xf6bc('0x34')]};}_0x5d3f4e['inReplyTo']=this[_0xf6bc('0x20')][_0xf6bc('0x35')];_0x5d3f4e[_0xf6bc('0x36')]=_0xf6bc('0x37')+_['replace'](_0x5d3f4e[_0xf6bc('0x11')],_0xf6bc('0x38'),_0xf6bc('0x39'))+_0xf6bc('0x3a');_0x5d3f4e[_0xf6bc('0x3b')]={'Auto-Submitted':_0xf6bc('0x3c'),'X-Auto-Response-Suppress':_0xf6bc('0x3d'),'Precedence':_0xf6bc('0x3e')};return mailRpc[_0xf6bc('0x3f')](_0x49617a,_0x5d3f4e)[_0xf6bc('0x40')](function(_0x7ab2ad){logger['info'](_0xf6bc('0x41'),_0x39a0b2);_0x5d3f4e[_0xf6bc('0x35')]=_0x7ab2ad['message'][_0xf6bc('0x35')];return rpc[_0x161f5e+_0xf6bc('0x2d')][_0xf6bc('0x42')](_0x5d3f4e);})[_0xf6bc('0x40')](function(_0x27bec3){logger[_0xf6bc('0x13')](_0xf6bc('0x14'),_0x39a0b2,JSON[_0xf6bc('0x43')](_0x27bec3));})['catch'](function(_0x2d2909){logger[_0xf6bc('0x44')](_0xf6bc('0x45'),_0x39a0b2,JSON[_0xf6bc('0x43')](_0x2d2909));})['finally'](function(){Promise[_0xf6bc('0x46')]()['then'](function(){if(_0x27b98a[0x0]!=='2'||_0x30db57['autoreplyExecuted'])return;return rpc[_0x161f5e+_0xf6bc('0x47')][_0xf6bc('0x48')](_0x30db57['id'],{'autoreplyExecuted':!![]})[_0xf6bc('0x40')](function(_0x5beace){logger[_0xf6bc('0x13')](_0xf6bc('0x1a'),_0x39a0b2,JSON[_0xf6bc('0x43')](_0x5beace));})[_0xf6bc('0x49')](function(_0x298915){logger['error'](_0xf6bc('0x4a'),_0x39a0b2,JSON[_0xf6bc('0x43')](_0x298915));});})[_0xf6bc('0x40')](function(){_0x486e59[_0xf6bc('0x19')]();});});}else{return rpc[this[_0xf6bc('0x22')]+'Message']['create'](_0x5d3f4e)[_0xf6bc('0x40')](function(_0x2efa15){logger[_0xf6bc('0x13')]('[%s][AUTOREPLY]\x20%s',_0x39a0b2,_0x5d3f4e[_0xf6bc('0x11')]);})[_0xf6bc('0x49')](function(_0x5ef2d2){logger[_0xf6bc('0x44')](_0xf6bc('0x14'),_0x39a0b2,JSON['stringify'](_0x5ef2d2));})[_0xf6bc('0x4b')](function(){Promise[_0xf6bc('0x46')]()[_0xf6bc('0x40')](function(){if(_0x27b98a[0x0]!=='2'||_0x30db57[_0xf6bc('0x4c')])return;return rpc[_0x161f5e+_0xf6bc('0x47')][_0xf6bc('0x48')](_0x30db57['id'],{'autoreplyExecuted':!![]})['then'](function(_0x57be4d){logger[_0xf6bc('0x13')](_0xf6bc('0x1a'),_0x39a0b2,JSON[_0xf6bc('0x43')](_0x57be4d));})['catch'](function(_0x52f8b3){logger[_0xf6bc('0x44')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x39a0b2,JSON['stringify'](_0x52f8b3));});})['then'](function(){_0x486e59['next']();});});}}}catch(_0x31a00d){logger[_0xf6bc('0x44')](_0xf6bc('0x14'),_0x39a0b2,JSON['stringify'](_0x31a00d));_0x486e59[_0xf6bc('0x4d')]();}};};
\ No newline at end of file
index fc39215..11e2886 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ffe=['../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','stop','moment'];(function(_0x386005,_0x54cab2){var _0xe61ca9=function(_0x55c9ac){while(--_0x55c9ac){_0x386005['push'](_0x386005['shift']());}};_0xe61ca9(++_0x54cab2);}(_0x5ffe,0x125));var _0xe5ff=function(_0x3cc80e,_0x5e5a7a){_0x3cc80e=_0x3cc80e-0x0;var _0x1d9eb0=_0x5ffe[_0x3cc80e];return _0x1d9eb0;};'use strict';var moment=require(_0xe5ff('0x0'));var logger=require(_0xe5ff('0x1'))(_0xe5ff('0x2'));var rpc={'chatInteraction':require(_0xe5ff('0x3')),'openchannelInteraction':require(_0xe5ff('0x4')),'smsInteraction':require(_0xe5ff('0x5')),'mailInteraction':require(_0xe5ff('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xe5ff('0x7'))};exports[_0xe5ff('0x8')]=function(_0x1f2e33,_0x1c77bc,_0x3ff8b2,_0x212daa){return function(_0x19057a){try{logger['info'](_0xe5ff('0x9'),_0x1f2e33,_0x1c77bc[0x0]);var _0x55eaaa={'closed':0x1,'closedAt':moment()[_0xe5ff('0xa')](_0xe5ff('0xb')),'closeReason':'system','disposition':_0x1c77bc[0x0]};if(rpc[_0x212daa[_0xe5ff('0xc')]+_0xe5ff('0xd')]){rpc[_0x212daa[_0xe5ff('0xc')]+'Interaction']['update'](_0x212daa[_0xe5ff('0xe')]['id'],_0x55eaaa)[_0xe5ff('0xf')](function(_0x5e2f10){logger['info'](_0xe5ff('0x10'),_0x1f2e33,_0x212daa[_0xe5ff('0xe')]['id']);})['catch'](function(_0x4a5281){logger[_0xe5ff('0x11')](_0xe5ff('0x12'),_0x1f2e33,JSON[_0xe5ff('0x13')](_0x4a5281));})['finally'](function(){_0x19057a[_0xe5ff('0x14')]();});}}catch(_0x192dbf){logger[_0xe5ff('0x11')](_0xe5ff('0x12'),_0x1f2e33,JSON[_0xe5ff('0x13')](_0x192dbf));_0x19057a['stop']();}};};
\ No newline at end of file
+var _0xf0b4=['channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x40fa9c,_0x5a0a31){var _0x1a237d=function(_0x1058d8){while(--_0x1058d8){_0x40fa9c['push'](_0x40fa9c['shift']());}};_0x1a237d(++_0x5a0a31);}(_0xf0b4,0x193));var _0x4f0b=function(_0x210e53,_0x46a7b6){_0x210e53=_0x210e53-0x0;var _0x4ff379=_0xf0b4[_0x210e53];return _0x4ff379;};'use strict';var moment=require(_0x4f0b('0x0'));var logger=require(_0x4f0b('0x1'))(_0x4f0b('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x4f0b('0x3')),'mailInteraction':require(_0x4f0b('0x4')),'faxInteraction':require(_0x4f0b('0x5')),'whatsappInteraction':require(_0x4f0b('0x6'))};exports[_0x4f0b('0x7')]=function(_0x1b7834,_0x58ddb7,_0xd9b2,_0x20bb37){return function(_0x8149ea){try{logger[_0x4f0b('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x1b7834,_0x58ddb7[0x0]);var _0x25808b={'closed':0x1,'closedAt':moment()['format'](_0x4f0b('0x9')),'closeReason':_0x4f0b('0xa'),'disposition':_0x58ddb7[0x0]};if(rpc[_0x20bb37[_0x4f0b('0xb')]+_0x4f0b('0xc')]){rpc[_0x20bb37['channel']+_0x4f0b('0xc')][_0x4f0b('0xd')](_0x20bb37[_0x4f0b('0xe')]['id'],_0x25808b)[_0x4f0b('0xf')](function(_0x3c5345){logger[_0x4f0b('0x8')](_0x4f0b('0x10'),_0x1b7834,_0x20bb37[_0x4f0b('0xe')]['id']);})[_0x4f0b('0x11')](function(_0x15e5cc){logger[_0x4f0b('0x12')](_0x4f0b('0x13'),_0x1b7834,JSON[_0x4f0b('0x14')](_0x15e5cc));})[_0x4f0b('0x15')](function(){_0x8149ea['stop']();});}}catch(_0x4414db){logger[_0x4f0b('0x12')](_0x4f0b('0x13'),_0x1b7834,JSON[_0x4f0b('0x14')](_0x4414db));_0x8149ea[_0x4f0b('0x16')]();}};};
\ No newline at end of file
index 6fb53cb..6a1ea55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd50=['contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','interaction','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','stop','textRequest','dialogflow','result','fulfillment','speech','providerName','providerResponse','Message','metadata','message','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next'];(function(_0x20bd5f,_0x22366c){var _0x530f07=function(_0x13f201){while(--_0x13f201){_0x20bd5f['push'](_0x20bd5f['shift']());}};_0x530f07(++_0x22366c);}(_0xfd50,0x178));var _0x0fd5=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xfd50[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var moment=require(_0x0fd5('0x0'));var apiai=require(_0x0fd5('0x1'));var md5=require(_0x0fd5('0x2'));var utils=require(_0x0fd5('0x3'));var logger=require(_0x0fd5('0x4'))('routing');var rpc={'chatMessage':require(_0x0fd5('0x5')),'openchannelMessage':require(_0x0fd5('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x0fd5('0x7')),'whatsappMessage':require(_0x0fd5('0x8'))};exports[_0x0fd5('0x9')]=function(_0x24319e,_0x50c54f){return function(_0x1baf7){try{if(!_[_0x0fd5('0xa')](this['interaction'][_0x0fd5('0xb')])){logger[_0x0fd5('0xc')](_0x0fd5('0xd'),_0x24319e,_0x0fd5('0xe'));return _0x1baf7[_0x0fd5('0xf')]();}var _0x1dfd3f={'ContactId':this[_0x0fd5('0x10')]['id'],'sentAt':moment()['format'](_0x0fd5('0x11')),'direction':_0x0fd5('0x12')};if(this['channel']===_0x0fd5('0x13')||this[_0x0fd5('0x14')]===_0x0fd5('0x15')){_0x1dfd3f[_0x0fd5('0x16')]=this[_0x0fd5('0x17')][_0x0fd5('0x16')];}var _0x2b3251=this['channel'];if(_0x2b3251==='chat'){_0x1dfd3f[_0x0fd5('0x18')]=this['account']['id'];}else{_0x1dfd3f[_[_0x0fd5('0x19')](_0x2b3251)+_0x0fd5('0x1a')]=this[_0x0fd5('0x1b')]['id'];}_0x1dfd3f[_[_0x0fd5('0x19')](_0x2b3251)+_0x0fd5('0x1c')]=this['interaction']['id'];if(this[_0x0fd5('0x17')][_0x0fd5('0x1d')]){var _0x2721d9=_0x50c54f[0x2];if(!_[_0x0fd5('0x1e')](_0x2721d9)){_0x1dfd3f[_0x0fd5('0x1f')]=utils[_0x0fd5('0x20')](_0x2721d9,this);return rpc[_0x2b3251+'Message'][_0x0fd5('0x21')](_0x1dfd3f)[_0x0fd5('0x22')](function(_0x3f1843){logger[_0x0fd5('0xc')](_0x0fd5('0xd'),_0x24319e,_0x1dfd3f['body']);})[_0x0fd5('0x23')](function(_0x202cbf){logger[_0x0fd5('0x24')](_0x0fd5('0xd'),_0x24319e,JSON[_0x0fd5('0x25')](_0x202cbf));})['finally'](function(){logger[_0x0fd5('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x24319e);_0x1baf7[_0x0fd5('0x26')]();});}else{logger[_0x0fd5('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x24319e);_0x1baf7[_0x0fd5('0x26')]();}}else{var _0xf5cefa=this;var _0x349fda=apiai(_0x50c54f[0x0],{'language':_0x50c54f[0x1]||'en'});return _0x349fda[_0x0fd5('0x27')](this['message'][_0x0fd5('0x1f')],{'sessionId':md5(this[_0x0fd5('0x17')]['id'])})[_0x0fd5('0x22')](function(_0x236e1e){_0xf5cefa['body'][_0x0fd5('0x28')]=_0x236e1e;_0x1dfd3f[_0x0fd5('0x1f')]=_0x236e1e[_0x0fd5('0x29')][_0x0fd5('0x2a')][_0x0fd5('0x2b')];_0x1dfd3f[_0x0fd5('0x2c')]=_0x0fd5('0x28');_0x1dfd3f[_0x0fd5('0x2d')]=JSON[_0x0fd5('0x25')](_0x236e1e);return rpc[_0x2b3251+_0x0fd5('0x2e')][_0x0fd5('0x21')](_0x1dfd3f)[_0x0fd5('0x22')](function(_0x2596d7){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x24319e,_0x1dfd3f['body']);if(_0x236e1e[_0x0fd5('0x29')][_0x0fd5('0x2f')]['endConversation']){_0x1baf7[_0x0fd5('0xf')]();}else{_0x1baf7[_0x0fd5('0x26')]();}})[_0x0fd5('0x23')](function(_0x79a5a){logger['error'](_0x0fd5('0xd'),_0x24319e,JSON[_0x0fd5('0x25')](_0x79a5a));_0x1baf7[_0x0fd5('0xf')]();});})['catch'](function(_0x3e41d4){logger[_0x0fd5('0x24')](_0x0fd5('0xd'),_0x24319e,_0x3e41d4[_0x0fd5('0x30')]);_0x1baf7[_0x0fd5('0xf')]();});}}catch(_0x50d329){logger[_0x0fd5('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x24319e,JSON['stringify'](_0x50d329));_0x1baf7[_0x0fd5('0x26')]();}};};
\ No newline at end of file
+var _0x96aa=['stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','result','speech','providerName','dialogflow','metadata','next','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','error'];(function(_0x1498ad,_0x1574a1){var _0x4d91f0=function(_0x4093af){while(--_0x4093af){_0x1498ad['push'](_0x1498ad['shift']());}};_0x4d91f0(++_0x1574a1);}(_0x96aa,0x67));var _0xa96a=function(_0x5c1606,_0x2a3344){_0x5c1606=_0x5c1606-0x0;var _0x329fe7=_0x96aa[_0x5c1606];return _0x329fe7;};'use strict';var _=require(_0xa96a('0x0'));var moment=require(_0xa96a('0x1'));var apiai=require('apiai-promise');var md5=require(_0xa96a('0x2'));var utils=require(_0xa96a('0x3'));var logger=require(_0xa96a('0x4'))(_0xa96a('0x5'));var rpc={'chatMessage':require(_0xa96a('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa96a('0x7')),'smsMessage':require(_0xa96a('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa96a('0x9'))};exports[_0xa96a('0xa')]=function(_0x282c8c,_0x3f391e){return function(_0x44fb9d){try{if(!_[_0xa96a('0xb')](this[_0xa96a('0xc')][_0xa96a('0xd')])){logger[_0xa96a('0xe')](_0xa96a('0xf'),_0x282c8c,_0xa96a('0x10'));return _0x44fb9d['next']();}var _0x33b786={'ContactId':this['contact']['id'],'sentAt':moment()[_0xa96a('0x11')](_0xa96a('0x12')),'direction':'out'};if(this[_0xa96a('0x13')]===_0xa96a('0x14')||this[_0xa96a('0x13')]===_0xa96a('0x15')){_0x33b786[_0xa96a('0x16')]=this[_0xa96a('0xc')][_0xa96a('0x16')];}var _0x197116=this[_0xa96a('0x13')];if(_0x197116===_0xa96a('0x17')){_0x33b786[_0xa96a('0x18')]=this[_0xa96a('0x19')]['id'];}else{_0x33b786[_['upperFirst'](_0x197116)+'AccountId']=this[_0xa96a('0x19')]['id'];}_0x33b786[_['upperFirst'](_0x197116)+_0xa96a('0x1a')]=this['interaction']['id'];if(this[_0xa96a('0xc')][_0xa96a('0x1b')]){var _0x1f623e=_0x3f391e[0x2];if(!_[_0xa96a('0x1c')](_0x1f623e)){_0x33b786[_0xa96a('0x1d')]=utils[_0xa96a('0x1e')](_0x1f623e,this);return rpc[_0x197116+'Message'][_0xa96a('0x1f')](_0x33b786)[_0xa96a('0x20')](function(_0x48ca06){logger[_0xa96a('0xe')](_0xa96a('0xf'),_0x282c8c,_0x33b786[_0xa96a('0x1d')]);})[_0xa96a('0x21')](function(_0x482c59){logger[_0xa96a('0x22')](_0xa96a('0xf'),_0x282c8c,JSON[_0xa96a('0x23')](_0x482c59));})[_0xa96a('0x24')](function(){logger['info'](_0xa96a('0x25'),_0x282c8c);_0x44fb9d['stop']();});}else{logger[_0xa96a('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x282c8c);_0x44fb9d[_0xa96a('0x26')]();}}else{var _0x96a6b2=this;var _0x484ee7=apiai(_0x3f391e[0x0],{'language':_0x3f391e[0x1]||'en'});return _0x484ee7['textRequest'](this[_0xa96a('0x27')][_0xa96a('0x1d')],{'sessionId':md5(this[_0xa96a('0xc')]['id'])})[_0xa96a('0x20')](function(_0x3eca00){_0x96a6b2[_0xa96a('0x1d')]['dialogflow']=_0x3eca00;_0x33b786['body']=_0x3eca00[_0xa96a('0x28')]['fulfillment'][_0xa96a('0x29')];_0x33b786[_0xa96a('0x2a')]=_0xa96a('0x2b');_0x33b786['providerResponse']=JSON[_0xa96a('0x23')](_0x3eca00);return rpc[_0x197116+'Message']['create'](_0x33b786)[_0xa96a('0x20')](function(_0x4f76e0){logger[_0xa96a('0xe')](_0xa96a('0xf'),_0x282c8c,_0x33b786[_0xa96a('0x1d')]);if(_0x3eca00['result'][_0xa96a('0x2c')]['endConversation']){_0x44fb9d['next']();}else{_0x44fb9d[_0xa96a('0x26')]();}})['catch'](function(_0x585af1){logger[_0xa96a('0x22')](_0xa96a('0xf'),_0x282c8c,JSON['stringify'](_0x585af1));_0x44fb9d[_0xa96a('0x2d')]();});})[_0xa96a('0x21')](function(_0x472d59){logger[_0xa96a('0x22')](_0xa96a('0xf'),_0x282c8c,_0x472d59['message']);_0x44fb9d[_0xa96a('0x2d')]();});}}catch(_0x17b6e9){logger['error'](_0xa96a('0xf'),_0x282c8c,JSON[_0xa96a('0x23')](_0x17b6e9));_0x44fb9d[_0xa96a('0x26')]();}};};
\ No newline at end of file
index b91e986..220ec68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f50=['then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','message','detectIntent','length','dialogflowV2','diagnosticInfo','queryResult','fields','end_conversation','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','isNil','interaction','UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender'];(function(_0xf9627a,_0x4f4aa1){var _0x5149d3=function(_0x25bdd2){while(--_0x25bdd2){_0xf9627a['push'](_0xf9627a['shift']());}};_0x5149d3(++_0x4f4aa1);}(_0x5f50,0xbb));var _0x05f5=function(_0x503e1f,_0x283b79){_0x503e1f=_0x503e1f-0x0;var _0x3d3a87=_0x5f50[_0x503e1f];return _0x3d3a87;};'use strict';var _=require(_0x05f5('0x0'));var dialogflow=require(_0x05f5('0x1'));var md5=require(_0x05f5('0x2'));var moment=require(_0x05f5('0x3'));var Promise=require(_0x05f5('0x4'));var logger=require(_0x05f5('0x5'))(_0x05f5('0x6'));var utils=require(_0x05f5('0x7'));var rpc={'chatMessage':require(_0x05f5('0x8')),'openchannelMessage':require(_0x05f5('0x9')),'mailMessage':require(_0x05f5('0xa')),'smsMessage':require(_0x05f5('0xb')),'faxMessage':require(_0x05f5('0xc')),'whatsappMessage':require(_0x05f5('0xd'))};function createMessage(_0xc33a5,_0x3e0e1f,_0x2e0f9f,_0x58a7a8){return new Promise(function(_0x3489eb,_0x5edcff){var _0x8870d5=_[_0x05f5('0xe')](_0x2e0f9f);_0x8870d5[_0x05f5('0xf')]=_0x58a7a8;return rpc[_0x3e0e1f+_0x05f5('0x10')][_0x05f5('0x11')](_0x8870d5)['then'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0xc33a5,_0x8870d5[_0x05f5('0xf')]);_0x3489eb();})[_0x05f5('0x12')](function(_0x3c0d96){logger[_0x05f5('0x13')](_0x05f5('0x14'),_0xc33a5,JSON[_0x05f5('0x15')](_0x3c0d96));_0x5edcff(_0x3c0d96);});});}exports['consequence']=function(_0x4ce7f6,_0x552139){return function(_0x43e0eb){try{if(!_[_0x05f5('0x16')](this[_0x05f5('0x17')][_0x05f5('0x18')])){logger[_0x05f5('0x19')](_0x05f5('0x14'),_0x4ce7f6,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x43e0eb[_0x05f5('0x1a')]();}var _0x5435d1={'ContactId':this[_0x05f5('0x1b')]['id'],'sentAt':moment()[_0x05f5('0x1c')](_0x05f5('0x1d')),'direction':_0x05f5('0x1e')};if(this[_0x05f5('0x1f')]===_0x05f5('0x20')||this[_0x05f5('0x1f')]===_0x05f5('0x21')){_0x5435d1[_0x05f5('0x22')]=this[_0x05f5('0x17')][_0x05f5('0x22')];}var _0x1ce0a6=this[_0x05f5('0x1f')];if(_0x1ce0a6===_0x05f5('0x23')){_0x5435d1[_0x05f5('0x24')]=this['account']['id'];}else{_0x5435d1[_[_0x05f5('0x25')](_0x1ce0a6)+_0x05f5('0x26')]=this[_0x05f5('0x27')]['id'];}_0x5435d1[_[_0x05f5('0x25')](_0x1ce0a6)+_0x05f5('0x28')]=this[_0x05f5('0x17')]['id'];if(this[_0x05f5('0x17')][_0x05f5('0x29')]){var _0xc3172c=_0x552139[0x4];if(!_[_0x05f5('0x2a')](_0xc3172c)){_0x5435d1[_0x05f5('0xf')]=utils[_0x05f5('0x2b')](_0xc3172c,this);return rpc[_0x1ce0a6+_0x05f5('0x10')][_0x05f5('0x11')](_0x5435d1)[_0x05f5('0x2c')](function(_0x13525a){logger[_0x05f5('0x19')](_0x05f5('0x14'),_0x4ce7f6,_0x5435d1['body']);})[_0x05f5('0x12')](function(_0x73515f){logger[_0x05f5('0x13')](_0x05f5('0x14'),_0x4ce7f6,JSON[_0x05f5('0x15')](_0x73515f));})[_0x05f5('0x2d')](function(){logger['info'](_0x05f5('0x2e'),_0x4ce7f6);_0x43e0eb[_0x05f5('0x2f')]();});}else{logger[_0x05f5('0x19')](_0x05f5('0x30'),_0x4ce7f6);_0x43e0eb[_0x05f5('0x2f')]();}}else{var _0x4ac964=this;var _0x49524d=_0x552139[0x2][_0x05f5('0x31')](/\\n/g,'\x0a');var _0x2720a4={'credentials':{'private_key':_0x49524d,'client_email':_0x552139[0x1]}};var _0x393e02=new dialogflow['SessionsClient'](_0x2720a4);var _0x50c720=_0x393e02[_0x05f5('0x32')](_0x552139[0x0],md5(_0x4ac964['interaction']['id']));var _0xdec973={'session':_0x50c720,'queryInput':{'text':{'text':_0x4ac964[_0x05f5('0x33')]['body'],'languageCode':_0x552139[0x3]||'en'}}};return _0x393e02[_0x05f5('0x34')](_0xdec973)[_0x05f5('0x2c')](function(_0x41a6a2){if(_0x41a6a2&&_0x41a6a2[_0x05f5('0x35')]){_0x4ac964[_0x05f5('0xf')][_0x05f5('0x36')]=_0x41a6a2;var _0x4c6ff6=_0x41a6a2[0x0];var _0x4ad174=_0x4c6ff6['queryResult'][_0x05f5('0x37')]&&_0x4c6ff6[_0x05f5('0x38')][_0x05f5('0x37')][_0x05f5('0x39')]?_0x4c6ff6[_0x05f5('0x38')][_0x05f5('0x37')][_0x05f5('0x39')][_0x05f5('0x3a')]['boolValue']:![];_0x4ac964[_0x05f5('0xf')][_0x05f5('0x3b')]=_0x4c6ff6['queryResult']['action'];_0x4ac964[_0x05f5('0xf')][_0x05f5('0x3c')]=_0x4c6ff6[_0x05f5('0x38')][_0x05f5('0x3d')];_0x4ac964[_0x05f5('0xf')][_0x05f5('0x3e')]=_0x4c6ff6[_0x05f5('0x38')]['diagnosticInfo']&&_0x4c6ff6[_0x05f5('0x38')][_0x05f5('0x37')][_0x05f5('0x39')]?_0x4c6ff6['queryResult'][_0x05f5('0x37')][_0x05f5('0x39')][_0x05f5('0x3a')][_0x05f5('0x3f')]:![];_0x4ac964[_0x05f5('0xf')][_0x05f5('0x40')]=_0x4c6ff6[_0x05f5('0x38')][_0x05f5('0x41')]['name'];_0x4ac964[_0x05f5('0xf')][_0x05f5('0x42')]=_0x4c6ff6[_0x05f5('0x38')][_0x05f5('0x41')][_0x05f5('0x43')];_0x4ac964['body'][_0x05f5('0x44')]=_0x4c6ff6[_0x05f5('0x38')]['intent']['isFallback'];_0x4ac964[_0x05f5('0xf')][_0x05f5('0x45')]=_0x4c6ff6[_0x05f5('0x38')][_0x05f5('0x46')];_0x4ac964[_0x05f5('0xf')]['DIALOGFLOWV2_QUERYTEXT']=_0x4c6ff6['queryResult'][_0x05f5('0x47')];_0x4ac964[_0x05f5('0xf')][_0x05f5('0x48')]=_0x4c6ff6[_0x05f5('0x38')][_0x05f5('0x49')];_0x5435d1[_0x05f5('0x4a')]=_0x05f5('0x36');_0x5435d1['providerResponse']=JSON[_0x05f5('0x15')](_0x41a6a2);var _0xc8c91f=[];for(var _0x53f861=0x0;_0x53f861<_0x41a6a2[_0x05f5('0x35')];_0x53f861++){var _0x23ea85=_0x41a6a2[_0x53f861];if(_0x23ea85&&_0x23ea85[_0x05f5('0x38')]&&_0x23ea85[_0x05f5('0x38')][_0x05f5('0x4b')]){_0xc8c91f['push'](createMessage(_0x4ce7f6,_0x1ce0a6,_0x5435d1,_0x23ea85[_0x05f5('0x38')][_0x05f5('0x4b')]));}}return Promise[_0x05f5('0x4c')](_0xc8c91f)[_0x05f5('0x2c')](function(){if(_0x4ad174){_0x43e0eb[_0x05f5('0x1a')]();}else{_0x43e0eb[_0x05f5('0x2f')]();}})[_0x05f5('0x12')](function(_0x3ade59){logger[_0x05f5('0x13')](_0x05f5('0x14'),_0x4ce7f6,JSON['stringify'](_0x3ade59));_0x43e0eb[_0x05f5('0x1a')]();});}})[_0x05f5('0x12')](function(_0x28c625){logger[_0x05f5('0x13')](_0x05f5('0x14'),_0x4ce7f6,_0x28c625[_0x05f5('0x33')]);_0x43e0eb[_0x05f5('0x1a')]();});}}catch(_0x6dafac){logger[_0x05f5('0x13')](_0x05f5('0x14'),_0x4ce7f6,JSON[_0x05f5('0x15')](_0x6dafac));_0x43e0eb[_0x05f5('0x2f')]();}};};
\ No newline at end of file
+var _0xc3c4=['displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','push','fulfillmentText','all','next','lodash','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','info','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','then','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent'];(function(_0x4287b0,_0x5e551c){var _0x1e6a1e=function(_0x1b2735){while(--_0x1b2735){_0x4287b0['push'](_0x4287b0['shift']());}};_0x1e6a1e(++_0x5e551c);}(_0xc3c4,0xf5));var _0x4c3c=function(_0x293503,_0x4e5bff){_0x293503=_0x293503-0x0;var _0x3e0000=_0xc3c4[_0x293503];return _0x3e0000;};'use strict';var _=require(_0x4c3c('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x4c3c('0x1'));var moment=require(_0x4c3c('0x2'));var Promise=require(_0x4c3c('0x3'));var logger=require(_0x4c3c('0x4'))(_0x4c3c('0x5'));var utils=require(_0x4c3c('0x6'));var rpc={'chatMessage':require(_0x4c3c('0x7')),'openchannelMessage':require(_0x4c3c('0x8')),'mailMessage':require(_0x4c3c('0x9')),'smsMessage':require(_0x4c3c('0xa')),'faxMessage':require(_0x4c3c('0xb')),'whatsappMessage':require(_0x4c3c('0xc'))};function createMessage(_0x4dd58a,_0x1e0019,_0x31b054,_0x5a034d){return new Promise(function(_0xcc08dc,_0xbbf0f9){var _0x523733=_[_0x4c3c('0xd')](_0x31b054);_0x523733[_0x4c3c('0xe')]=_0x5a034d;return rpc[_0x1e0019+_0x4c3c('0xf')][_0x4c3c('0x10')](_0x523733)['then'](function(){logger[_0x4c3c('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x4dd58a,_0x523733[_0x4c3c('0xe')]);_0xcc08dc();})[_0x4c3c('0x12')](function(_0x55ced1){logger['error'](_0x4c3c('0x13'),_0x4dd58a,JSON[_0x4c3c('0x14')](_0x55ced1));_0xbbf0f9(_0x55ced1);});});}exports['consequence']=function(_0x10d41f,_0x1b9046){return function(_0x2ebc33){try{if(!_[_0x4c3c('0x15')](this[_0x4c3c('0x16')]['UserId'])){logger[_0x4c3c('0x11')](_0x4c3c('0x13'),_0x10d41f,_0x4c3c('0x17'));return _0x2ebc33['next']();}var _0x3312fa={'ContactId':this[_0x4c3c('0x18')]['id'],'sentAt':moment()[_0x4c3c('0x19')](_0x4c3c('0x1a')),'direction':_0x4c3c('0x1b')};if(this[_0x4c3c('0x1c')]===_0x4c3c('0x1d')||this[_0x4c3c('0x1c')]===_0x4c3c('0x1e')){_0x3312fa[_0x4c3c('0x1f')]=this[_0x4c3c('0x16')][_0x4c3c('0x1f')];}var _0x27f4c3=this[_0x4c3c('0x1c')];if(_0x27f4c3===_0x4c3c('0x20')){_0x3312fa[_0x4c3c('0x21')]=this[_0x4c3c('0x22')]['id'];}else{_0x3312fa[_['upperFirst'](_0x27f4c3)+_0x4c3c('0x23')]=this[_0x4c3c('0x22')]['id'];}_0x3312fa[_[_0x4c3c('0x24')](_0x27f4c3)+_0x4c3c('0x25')]=this[_0x4c3c('0x16')]['id'];if(this[_0x4c3c('0x16')][_0x4c3c('0x26')]){var _0x697643=_0x1b9046[0x4];if(!_[_0x4c3c('0x27')](_0x697643)){_0x3312fa[_0x4c3c('0xe')]=utils[_0x4c3c('0x28')](_0x697643,this);return rpc[_0x27f4c3+_0x4c3c('0xf')][_0x4c3c('0x10')](_0x3312fa)[_0x4c3c('0x29')](function(_0x37befb){logger[_0x4c3c('0x11')](_0x4c3c('0x13'),_0x10d41f,_0x3312fa[_0x4c3c('0xe')]);})[_0x4c3c('0x12')](function(_0x2fde64){logger[_0x4c3c('0x2a')](_0x4c3c('0x13'),_0x10d41f,JSON['stringify'](_0x2fde64));})[_0x4c3c('0x2b')](function(){logger['info'](_0x4c3c('0x2c'),_0x10d41f);_0x2ebc33[_0x4c3c('0x2d')]();});}else{logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x10d41f);_0x2ebc33['stop']();}}else{var _0x2b7830=this;var _0x1fbb97=_0x1b9046[0x2][_0x4c3c('0x2e')](/\\n/g,'\x0a');var _0x40e543={'credentials':{'private_key':_0x1fbb97,'client_email':_0x1b9046[0x1]}};var _0x5572cc=new dialogflow[(_0x4c3c('0x2f'))](_0x40e543);var _0x7525d5=_0x5572cc['sessionPath'](_0x1b9046[0x0],md5(_0x2b7830[_0x4c3c('0x16')]['id']));var _0x3e7a52={'session':_0x7525d5,'queryInput':{'text':{'text':_0x2b7830[_0x4c3c('0x30')][_0x4c3c('0xe')],'languageCode':_0x1b9046[0x3]||'en'}}};return _0x5572cc[_0x4c3c('0x31')](_0x3e7a52)[_0x4c3c('0x29')](function(_0x1d1cab){if(_0x1d1cab&&_0x1d1cab[_0x4c3c('0x32')]){_0x2b7830[_0x4c3c('0xe')][_0x4c3c('0x33')]=_0x1d1cab;var _0x1a0cad=_0x1d1cab[0x0];var _0x3ad8ef=_0x1a0cad[_0x4c3c('0x34')][_0x4c3c('0x35')]&&_0x1a0cad[_0x4c3c('0x34')][_0x4c3c('0x35')][_0x4c3c('0x36')]?_0x1a0cad['queryResult'][_0x4c3c('0x35')][_0x4c3c('0x36')][_0x4c3c('0x37')][_0x4c3c('0x38')]:![];_0x2b7830[_0x4c3c('0xe')][_0x4c3c('0x39')]=_0x1a0cad[_0x4c3c('0x34')][_0x4c3c('0x3a')];_0x2b7830[_0x4c3c('0xe')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x1a0cad[_0x4c3c('0x34')]['allRequiredParamsPresent'];_0x2b7830['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x1a0cad['queryResult'][_0x4c3c('0x35')]&&_0x1a0cad[_0x4c3c('0x34')][_0x4c3c('0x35')][_0x4c3c('0x36')]?_0x1a0cad['queryResult'][_0x4c3c('0x35')][_0x4c3c('0x36')]['end_conversation'][_0x4c3c('0x38')]:![];_0x2b7830['body'][_0x4c3c('0x3b')]=_0x1a0cad[_0x4c3c('0x34')]['intent'][_0x4c3c('0x3c')];_0x2b7830[_0x4c3c('0xe')][_0x4c3c('0x3d')]=_0x1a0cad[_0x4c3c('0x34')][_0x4c3c('0x3e')][_0x4c3c('0x3f')];_0x2b7830[_0x4c3c('0xe')][_0x4c3c('0x40')]=_0x1a0cad[_0x4c3c('0x34')][_0x4c3c('0x3e')]['isFallback'];_0x2b7830[_0x4c3c('0xe')][_0x4c3c('0x41')]=_0x1a0cad['queryResult'][_0x4c3c('0x42')];_0x2b7830[_0x4c3c('0xe')][_0x4c3c('0x43')]=_0x1a0cad['queryResult'][_0x4c3c('0x44')];_0x2b7830['body'][_0x4c3c('0x45')]=_0x1a0cad['queryResult'][_0x4c3c('0x46')];_0x3312fa[_0x4c3c('0x47')]=_0x4c3c('0x33');_0x3312fa[_0x4c3c('0x48')]=JSON[_0x4c3c('0x14')](_0x1d1cab);var _0x4ef274=[];for(var _0x46c494=0x0;_0x46c494<_0x1d1cab[_0x4c3c('0x32')];_0x46c494++){var _0x4e230a=_0x1d1cab[_0x46c494];if(_0x4e230a&&_0x4e230a[_0x4c3c('0x34')]&&_0x4e230a[_0x4c3c('0x34')]['fulfillmentText']){_0x4ef274[_0x4c3c('0x49')](createMessage(_0x10d41f,_0x27f4c3,_0x3312fa,_0x4e230a[_0x4c3c('0x34')][_0x4c3c('0x4a')]));}}return Promise[_0x4c3c('0x4b')](_0x4ef274)[_0x4c3c('0x29')](function(){if(_0x3ad8ef){_0x2ebc33[_0x4c3c('0x4c')]();}else{_0x2ebc33[_0x4c3c('0x2d')]();}})[_0x4c3c('0x12')](function(_0x5c7300){logger[_0x4c3c('0x2a')](_0x4c3c('0x13'),_0x10d41f,JSON[_0x4c3c('0x14')](_0x5c7300));_0x2ebc33[_0x4c3c('0x4c')]();});}})['catch'](function(_0x4374e7){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x10d41f,_0x4374e7[_0x4c3c('0x30')]);_0x2ebc33[_0x4c3c('0x4c')]();});}}catch(_0x581d94){logger[_0x4c3c('0x2a')](_0x4c3c('0x13'),_0x10d41f,JSON['stringify'](_0x581d94));_0x2ebc33[_0x4c3c('0x2d')]();}};};
\ No newline at end of file
index 366e38b..071d6e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdf3=['replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','priorityFalse','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','validate','lodash','html-to-text','./utils','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender'];(function(_0x345493,_0x3b180f){var _0x58f4d7=function(_0xc3fc17){while(--_0xc3fc17){_0x345493['push'](_0x345493['shift']());}};_0x58f4d7(++_0x3b180f);}(_0xcdf3,0x1a5));var _0x3cdf=function(_0x3b8f30,_0x429728){_0x3b8f30=_0x3b8f30-0x0;var _0x2eac1b=_0xcdf3[_0x3b8f30];return _0x2eac1b;};'use strict';var schema=require(_0x3cdf('0x0'));var _=require(_0x3cdf('0x1'));var htmlToText=require(_0x3cdf('0x2'));var utils=require(_0x3cdf('0x3'));var logger=require('../../../../config/logger')(_0x3cdf('0x4'));var gotoif=schema({'condition':{'type':_0x3cdf('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x3cdf('0x6'),'message':_0x3cdf('0x7')}});exports[_0x3cdf('0x8')]=function(_0x448047,_0x565c25){return function(_0x3b877b){try{var _0x3c8c1d={'condition':htmlToText[_0x3cdf('0x9')](utils[_0x3cdf('0xa')](_0x565c25[0x0],this),{'wordwrap':![]})[_0x3cdf('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x565c25[0x1],'priorityFalse':_0x565c25[0x2]};var _0x3f2e81=gotoif[_0x3cdf('0x0')](_0x3c8c1d,{'typecast':!![]});if(_0x3f2e81[_0x3cdf('0xc')]){logger[_0x3cdf('0xd')](_0x3cdf('0xe'),_0x448047,_[_0x3cdf('0xf')](_0x3f2e81,_0x3cdf('0x10'))[_0x3cdf('0x11')](',\x20'));_0x3b877b['stop']();}else{try{var _0xd523d6=eval('('+_0x3c8c1d['condition']+')');var _0x805bd=_0xd523d6?_0x3c8c1d['priorityTrue']:_0x3c8c1d[_0x3cdf('0x12')];logger[_0x3cdf('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x448047,_0x3c8c1d['condition'],_0xd523d6,_0x805bd||_0x3cdf('0x14'));if(_0x805bd){var _0x2f3ad8=_[_0x3cdf('0x15')](_0x3b877b[_0x3cdf('0x16')](),{'p':_0x805bd});if(_0x2f3ad8>=0x0){logger[_0x3cdf('0x13')](_0x3cdf('0x17'),_0x448047,_0x805bd||_0x3cdf('0x14'),_0x2f3ad8);_0x3b877b['next'](_0x2f3ad8);}else{logger[_0x3cdf('0x13')](_0x3cdf('0x18'),_0x448047,_0x805bd||'next');_0x3b877b['stop']();}}else{_0x3b877b['next']();}}catch(_0x45e458){logger[_0x3cdf('0xd')](_0x3cdf('0x19'),_0x448047,_0x45e458['message']);_0x3b877b[_0x3cdf('0x1a')]();}}}catch(_0x47c660){logger[_0x3cdf('0xd')](_0x3cdf('0xe'),_0x448047,JSON['stringify'](_0x47c660));_0x3b877b[_0x3cdf('0x1a')]();}};};
\ No newline at end of file
+var _0x19f4=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition'];(function(_0x1d4fc5,_0xe24470){var _0x4e44ad=function(_0x3b75e7){while(--_0x3b75e7){_0x1d4fc5['push'](_0x1d4fc5['shift']());}};_0x4e44ad(++_0xe24470);}(_0x19f4,0x148));var _0x419f=function(_0x5d613b,_0x66ad2b){_0x5d613b=_0x5d613b-0x0;var _0x2186b5=_0x19f4[_0x5d613b];return _0x2186b5;};'use strict';var schema=require(_0x419f('0x0'));var _=require(_0x419f('0x1'));var htmlToText=require(_0x419f('0x2'));var utils=require('./utils');var logger=require(_0x419f('0x3'))(_0x419f('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x419f('0x5')},'priorityTrue':{'type':_0x419f('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x419f('0x6'),'message':_0x419f('0x7')}});exports['consequence']=function(_0x1639eb,_0x3e4838){return function(_0x901de5){try{var _0x3015b4={'condition':htmlToText[_0x419f('0x8')](utils[_0x419f('0x9')](_0x3e4838[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3e4838[0x1],'priorityFalse':_0x3e4838[0x2]};var _0x2ba395=gotoif[_0x419f('0x0')](_0x3015b4,{'typecast':!![]});if(_0x2ba395[_0x419f('0xa')]){logger[_0x419f('0xb')](_0x419f('0xc'),_0x1639eb,_['map'](_0x2ba395,_0x419f('0xd'))[_0x419f('0xe')](',\x20'));_0x901de5[_0x419f('0xf')]();}else{try{var _0x30524c=eval('('+_0x3015b4[_0x419f('0x10')]+')');var _0x20628f=_0x30524c?_0x3015b4['priorityTrue']:_0x3015b4['priorityFalse'];logger[_0x419f('0x11')](_0x419f('0x12'),_0x1639eb,_0x3015b4[_0x419f('0x10')],_0x30524c,_0x20628f||_0x419f('0x13'));if(_0x20628f){var _0x341678=_[_0x419f('0x14')](_0x901de5['rules'](),{'p':_0x20628f});if(_0x341678>=0x0){logger[_0x419f('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1639eb,_0x20628f||_0x419f('0x13'),_0x341678);_0x901de5['next'](_0x341678);}else{logger[_0x419f('0x11')](_0x419f('0x15'),_0x1639eb,_0x20628f||_0x419f('0x13'));_0x901de5[_0x419f('0xf')]();}}else{_0x901de5['next']();}}catch(_0x19ddb5){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x1639eb,_0x19ddb5[_0x419f('0xd')]);_0x901de5[_0x419f('0xf')]();}}}catch(_0x18245e){logger[_0x419f('0xb')](_0x419f('0xc'),_0x1639eb,JSON[_0x419f('0x16')](_0x18245e));_0x901de5[_0x419f('0xf')]();}};};
\ No newline at end of file
index 9725db6..1cf68af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11c2=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x11c2,0x199));var _0x211c=function(_0x5ea7fd,_0x5cf6ec){_0x5ea7fd=_0x5ea7fd-0x0;var _0x5ec954=_0x11c2[_0x5ea7fd];return _0x5ec954;};'use strict';var schema=require(_0x211c('0x0'));var _=require(_0x211c('0x1'));var logger=require(_0x211c('0x2'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x211c('0x3')}});exports['consequence']=function(_0x3f1f2e,_0x482964){return function(_0x55f94c){try{var _0x40fb25={'priority':_0x482964[0x0]};var _0x312c09=gotop[_0x211c('0x0')](_0x40fb25,{'typecast':!![]});if(_0x312c09[_0x211c('0x4')]){logger[_0x211c('0x5')](_0x211c('0x6'),_0x3f1f2e,_[_0x211c('0x7')](_0x312c09,'message')[_0x211c('0x8')](',\x20'));_0x55f94c[_0x211c('0x9')]();}else{logger[_0x211c('0xa')](_0x211c('0xb'),_0x3f1f2e,_0x40fb25[_0x211c('0xc')]);if(_0x40fb25[_0x211c('0xc')]){var _0x258c16=_[_0x211c('0xd')](_0x55f94c['rules'](),{'p':_0x40fb25['priority']});if(_0x258c16>=0x0){logger[_0x211c('0xa')](_0x211c('0xe'),_0x3f1f2e,_0x40fb25[_0x211c('0xc')]||_0x211c('0xf'),_0x258c16);_0x55f94c[_0x211c('0xf')](_0x258c16);}else{logger['info'](_0x211c('0x10'),_0x3f1f2e,_0x40fb25[_0x211c('0xc')]||_0x211c('0xf'));_0x55f94c[_0x211c('0x9')]();}}else{_0x55f94c['next']();}}}catch(_0x31e05a){logger['error']('[%s][GOTOP]\x20%s',_0x3f1f2e,JSON['stringify'](_0x31e05a));_0x55f94c['stop']();}};};
\ No newline at end of file
+var _0xdff6=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error','validate','number','consequence','length','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules'];(function(_0xee058e,_0x249927){var _0x437fd2=function(_0x5ef2e9){while(--_0x5ef2e9){_0xee058e['push'](_0xee058e['shift']());}};_0x437fd2(++_0x249927);}(_0xdff6,0x1e3));var _0x6dff=function(_0x3add88,_0x10eb70){_0x3add88=_0x3add88-0x0;var _0x239644=_0xdff6[_0x3add88];return _0x239644;};'use strict';var schema=require(_0x6dff('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x6dff('0x1'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x6dff('0x2')]=function(_0x1629f7,_0x19b724){return function(_0x34fd41){try{var _0xbb5aa4={'priority':_0x19b724[0x0]};var _0x13560a=gotop[_0x6dff('0x0')](_0xbb5aa4,{'typecast':!![]});if(_0x13560a[_0x6dff('0x3')]){logger['error'](_0x6dff('0x4'),_0x1629f7,_['map'](_0x13560a,_0x6dff('0x5'))[_0x6dff('0x6')](',\x20'));_0x34fd41[_0x6dff('0x7')]();}else{logger[_0x6dff('0x8')](_0x6dff('0x9'),_0x1629f7,_0xbb5aa4[_0x6dff('0xa')]);if(_0xbb5aa4[_0x6dff('0xa')]){var _0x3e1ba6=_[_0x6dff('0xb')](_0x34fd41[_0x6dff('0xc')](),{'p':_0xbb5aa4[_0x6dff('0xa')]});if(_0x3e1ba6>=0x0){logger[_0x6dff('0x8')](_0x6dff('0xd'),_0x1629f7,_0xbb5aa4['priority']||_0x6dff('0xe'),_0x3e1ba6);_0x34fd41[_0x6dff('0xe')](_0x3e1ba6);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1629f7,_0xbb5aa4[_0x6dff('0xa')]||_0x6dff('0xe'));_0x34fd41[_0x6dff('0x7')]();}}else{_0x34fd41[_0x6dff('0xe')]();}}}catch(_0x2a7612){logger[_0x6dff('0xf')](_0x6dff('0x4'),_0x1629f7,JSON['stringify'](_0x2a7612));_0x34fd41[_0x6dff('0x7')]();}};};
\ No newline at end of file
index 476928c..a00c7ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61d0=['stop','lodash','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','account','channel','AccountId','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x61d0,0x187));var _0x061d=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0x61d0[_0x3cb152];return _0x4f54c3;};'use strict';var _=require(_0x061d('0x0'));var utils=require('./utils');var logger=require(_0x061d('0x1'))(_0x061d('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x061d('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x061d('0x4')),'faxMessage':require(_0x061d('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x061d('0x6')]=function(_0x152a73,_0x14e976){return function(_0x255478){try{var _0x1edb0c={'body':utils[_0x061d('0x7')](_0x14e976[0x0],this),'ContactId':this[_0x061d('0x8')]['id']};if(this['channel']==='chat'){_0x1edb0c['ChatWebsiteId']=this[_0x061d('0x9')]['id'];}else{_0x1edb0c[_['upperFirst'](this[_0x061d('0xa')])+_0x061d('0xb')]=this['account']['id'];}_0x1edb0c[_[_0x061d('0xc')](this[_0x061d('0xa')])+_0x061d('0xd')]=this[_0x061d('0xe')]['id'];if(rpc[this[_0x061d('0xa')]+_0x061d('0xf')]){return rpc[this[_0x061d('0xa')]+'Message'][_0x061d('0x10')](_0x1edb0c)[_0x061d('0x11')](function(_0x1bbe47){logger[_0x061d('0x12')](_0x061d('0x13'),_0x152a73,_0x1edb0c[_0x061d('0x14')]);_0x255478[_0x061d('0x15')]();})[_0x061d('0x16')](function(_0x46fd62){logger[_0x061d('0x17')]('[%s][MESSAGE]\x20%s',_0x152a73,JSON[_0x061d('0x18')](_0x46fd62));_0x255478[_0x061d('0x19')]();});}}catch(_0x457423){logger['error'](_0x061d('0x13'),_0x152a73,JSON['stringify'](_0x457423));_0x255478['stop']();}};};
\ No newline at end of file
+var _0x3e9e=['../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','channel','chat','ChatWebsiteId','account','upperFirst','interaction','Message','create','info','next','catch','error','[%s][MESSAGE]\x20%s','stop','./utils','routing','../../rpc/openchannelMessage'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x3e9e,0x13d));var _0xe3e9=function(_0x554d07,_0x43a8dc){_0x554d07=_0x554d07-0x0;var _0x2c2198=_0x3e9e[_0x554d07];return _0x2c2198;};'use strict';var _=require('lodash');var utils=require(_0xe3e9('0x0'));var logger=require('../../../../config/logger')(_0xe3e9('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe3e9('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe3e9('0x3')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xe3e9('0x4'))};exports[_0xe3e9('0x5')]=function(_0x554839,_0x50c4bd){return function(_0x4c49af){try{var _0x372fba={'body':utils['getMustacheRender'](_0x50c4bd[0x0],this),'ContactId':this['contact']['id']};if(this[_0xe3e9('0x6')]===_0xe3e9('0x7')){_0x372fba[_0xe3e9('0x8')]=this[_0xe3e9('0x9')]['id'];}else{_0x372fba[_[_0xe3e9('0xa')](this['channel'])+'AccountId']=this[_0xe3e9('0x9')]['id'];}_0x372fba[_['upperFirst'](this[_0xe3e9('0x6')])+'InteractionId']=this[_0xe3e9('0xb')]['id'];if(rpc[this['channel']+_0xe3e9('0xc')]){return rpc[this[_0xe3e9('0x6')]+_0xe3e9('0xc')][_0xe3e9('0xd')](_0x372fba)['then'](function(_0x5c1f26){logger[_0xe3e9('0xe')]('[%s][MESSAGE]\x20%s',_0x554839,_0x372fba['body']);_0x4c49af[_0xe3e9('0xf')]();})[_0xe3e9('0x10')](function(_0x4f36e7){logger[_0xe3e9('0x11')](_0xe3e9('0x12'),_0x554839,JSON['stringify'](_0x4f36e7));_0x4c49af[_0xe3e9('0x13')]();});}}catch(_0x174cd5){logger[_0xe3e9('0x11')](_0xe3e9('0x12'),_0x554839,JSON['stringify'](_0x174cd5));_0x4c49af[_0xe3e9('0x13')]();}};};
\ No newline at end of file
index 34bd2bf..11e56f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1139=['routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','stop','../../../../config/logger'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x1139,0x180));var _0x9113=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1139[_0x5d6456];return _0x4d66c1;};'use strict';var utils=require('./utils');var logger=require(_0x9113('0x0'))(_0x9113('0x1'));exports[_0x9113('0x2')]=function(_0x436c77,_0x9b5967){return function(_0x10065a){try{logger[_0x9113('0x3')](_0x9113('0x4'),_0x436c77,utils[_0x9113('0x5')](_0x9b5967[0x0],this));_0x10065a['next']();}catch(_0x30f376){logger['error']('[%s][NOOP]\x20%s',_0x436c77,JSON['stringify'](_0x30f376));_0x10065a[_0x9113('0x6')]();}};};
\ No newline at end of file
+var _0xb561=['info','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','../../../../config/logger','consequence'];(function(_0x42131b,_0x3b638e){var _0x308002=function(_0x19343c){while(--_0x19343c){_0x42131b['push'](_0x42131b['shift']());}};_0x308002(++_0x3b638e);}(_0xb561,0x12f));var _0x1b56=function(_0xdee1ee,_0x3050ba){_0xdee1ee=_0xdee1ee-0x0;var _0x56908b=_0xb561[_0xdee1ee];return _0x56908b;};'use strict';var utils=require(_0x1b56('0x0'));var logger=require(_0x1b56('0x1'))('routing');exports[_0x1b56('0x2')]=function(_0x46e200,_0x12aaa3){return function(_0x4103e8){try{logger[_0x1b56('0x3')](_0x1b56('0x4'),_0x46e200,utils['getMustacheRender'](_0x12aaa3[0x0],this));_0x4103e8[_0x1b56('0x5')]();}catch(_0xf37c03){logger[_0x1b56('0x6')](_0x1b56('0x4'),_0x46e200,JSON[_0x1b56('0x7')](_0xf37c03));_0x4103e8[_0x1b56('0x8')]();}};};
\ No newline at end of file
index ad19fb5..b907ca6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1bd=['account','queue','from','emit','clone','format','pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','upperFirst','channel','InteractionId','interaction','MessageId','message','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','update','update\x20queue\x20report','timeout','toLowerCase','consequence','validate','map','stop','find','Queues','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','defaults','redis','localhost','queue_id'];(function(_0x2c2390,_0x37ef1c){var _0x478b7e=function(_0x2ea947){while(--_0x2ea947){_0x2c2390['push'](_0x2c2390['shift']());}};_0x478b7e(++_0x37ef1c);}(_0xc1bd,0xd2));var _0xdc1b=function(_0x4a7bac,_0x1a8719){_0x4a7bac=_0x4a7bac-0x0;var _0x284a73=_0xc1bd[_0x4a7bac];return _0x284a73;};'use strict';var schema=require('validate');var _=require(_0xdc1b('0x0'));var util=require(_0xdc1b('0x1'));var seqqueue=require(_0xdc1b('0x2'));var moment=require(_0xdc1b('0x3'));var Redis=require(_0xdc1b('0x4'));var config=require(_0xdc1b('0x5'));var logger=require('../../../../config/logger')(_0xdc1b('0x6'));var strategy=require(_0xdc1b('0x7'));config['redis']=_[_0xdc1b('0x8')](config[_0xdc1b('0x9')],{'host':_0xdc1b('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdc1b('0x9')]));var attributes=['id',_0xdc1b('0xb'),_0xdc1b('0xc'),_0xdc1b('0xd'),_0xdc1b('0xe'),'joinAt'];function emit(_0x3cfcec,_0x371699,_0xfdd9e9){io['to'](_0x3cfcec)[_0xdc1b('0xf')](_0x371699,_0xfdd9e9);}function emitChannelQueueInteraction(_0x52d17c,_0x112d8b,_0x530555,_0x2b2ee9,_0x3ab1c2,_0x468495,_0x45e1c0,_0x57506e){var _0x446d9f=_[_0xdc1b('0x10')](_0x530555);_0x446d9f[_0xdc1b('0xb')]=_0x57506e;_0x446d9f[_0xdc1b('0xd')]=_0x112d8b;_0x446d9f[_0xdc1b('0xc')]=_0x2b2ee9;_0x446d9f['id']=_0x3ab1c2;if(_0x468495){_0x45e1c0[util[_0xdc1b('0x11')]('%sQueuesWaitingInteractions',_0x52d17c)][_0x3ab1c2]=_[_0xdc1b('0x12')](_0x446d9f,attributes);}else{delete _0x45e1c0[util[_0xdc1b('0x11')]('%sQueuesWaitingInteractions',_0x52d17c)][_0x3ab1c2];}emit(util['format'](_0xdc1b('0x13'),_0x52d17c,_0x112d8b),util[_0xdc1b('0x11')]('%s_queue_waiting_interaction:%s',_0x52d17c,_0x468495?_0xdc1b('0x14'):_0xdc1b('0x15')),_[_0xdc1b('0x12')](_0x446d9f,attributes));}var rpc={'openchannelQueueReport':require(_0xdc1b('0x16')),'mailQueueReport':require(_0xdc1b('0x17')),'chatQueueReport':require(_0xdc1b('0x18')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xdc1b('0x19')),'whatsappQueueReport':require(_0xdc1b('0x1a'))};var queue=schema({'name':{'type':_0xdc1b('0x1b'),'required':!![],'message':_0xdc1b('0x1c')},'timeout':{'type':_0xdc1b('0x1d'),'message':_0xdc1b('0x1e')}});function startRouting(_0x1fed15,_0x3b3097,_0x5a6c91,_0x4d8d41){if(_0x1fed15&&_0x3b3097&&_0x5a6c91){_0x3b3097['waiting']+=0x1;var _0x4d71e2={'uniqueid':_0x1fed15,'from':_0x5a6c91[_0xdc1b('0x1f')]?_0x5a6c91[_0xdc1b('0x1f')][_0xdc1b('0xe')]:'','joinAt':moment()['format'](_0xdc1b('0x20')),'ContactId':_0x5a6c91[_0xdc1b('0x21')]?_0x5a6c91['contact']['id']:null,'ListId':_0x5a6c91[_0xdc1b('0x22')]?_0x5a6c91['list']['id']:null};_0x4d71e2[_['upperFirst'](_0x5a6c91['channel'])+_0xdc1b('0x23')]=_0x3b3097['id']||null;_0x4d71e2[_[_0xdc1b('0x24')](_0x5a6c91[_0xdc1b('0x25')])+_0xdc1b('0x26')]=_0x5a6c91[_0xdc1b('0x27')]?_0x5a6c91['interaction']['id']:null;_0x4d71e2[_[_0xdc1b('0x24')](_0x5a6c91[_0xdc1b('0x25')])+_0xdc1b('0x28')]=_0x5a6c91[_0xdc1b('0x29')]?_0x5a6c91[_0xdc1b('0x29')]['id']:null;_0x4d71e2[_[_0xdc1b('0x24')](_0x5a6c91[_0xdc1b('0x25')])+(_0x5a6c91[_0xdc1b('0x25')]!=='chat'?'AccountId':_0xdc1b('0x2a'))]=_0x5a6c91[_0xdc1b('0xc')]?_0x5a6c91[_0xdc1b('0xc')]['id']:null;logger[_0xdc1b('0x2b')](util[_0xdc1b('0x11')](_0xdc1b('0x2c'),_0x1fed15,_0x3b3097[_0xdc1b('0x2d')]));emitChannelQueueInteraction(_0x5a6c91[_0xdc1b('0x25')],_0x3b3097[_0xdc1b('0x2d')],_0x4d71e2,_0x5a6c91[_0xdc1b('0xc')][_0xdc1b('0x2d')],_0x5a6c91[_0xdc1b('0x29')]['id'],!![],_0x4d8d41,_0x3b3097['id']);if(rpc[_0x5a6c91[_0xdc1b('0x25')]+_0xdc1b('0x2e')]){return rpc[_0x5a6c91[_0xdc1b('0x25')]+_0xdc1b('0x2e')][_0xdc1b('0x2f')](_0x4d71e2)[_0xdc1b('0x30')](function(_0x4d9a09){logger[_0xdc1b('0x31')](_0xdc1b('0x32'));});}}}function stopRouting(_0x7a529f,_0x3cdb37,_0x21a498,_0x22290f){if(_0x7a529f&&_0x3cdb37){_0x3cdb37[_0xdc1b('0x33')]-=0x1;var _0x2f6bb3={'leaveAt':moment()[_0xdc1b('0x11')](_0xdc1b('0x20')),'acceptAt':moment()[_0xdc1b('0x11')](_0xdc1b('0x20')),'reason':'accepted'};logger[_0xdc1b('0x2b')](util[_0xdc1b('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x7a529f,_0x3cdb37[_0xdc1b('0x2d')]));emitChannelQueueInteraction(_0x21a498[_0xdc1b('0x25')],_0x3cdb37[_0xdc1b('0x2d')],_0x21a498[_0xdc1b('0x1f')],_0x21a498['account']['name'],_0x21a498[_0xdc1b('0x29')]['id'],![],_0x22290f,_0x3cdb37['id']);if(rpc[_0x21a498[_0xdc1b('0x25')]+_0xdc1b('0x2e')]){return rpc[_0x21a498[_0xdc1b('0x25')]+'QueueReport'][_0xdc1b('0x34')](_0x7a529f,_0x2f6bb3)[_0xdc1b('0x30')](function(_0x6292fe){logger['error'](_0xdc1b('0x35'));});}}}function endRouting(_0x3875df,_0x32246e,_0xca852b,_0x501fa8){if(_0x3875df&&_0x32246e){_0x32246e[_0xdc1b('0x33')]-=0x1;var _0xe4ea08={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xdc1b('0x36')};logger['info'](util[_0xdc1b('0x11')]('[%s][END:QUEUE][NAME:%s]',_0x3875df,_0x32246e[_0xdc1b('0x2d')]));emitChannelQueueInteraction(_0xca852b['channel'],_0x32246e[_0xdc1b('0x2d')],_0xca852b[_0xdc1b('0x1f')],_0xca852b['account'][_0xdc1b('0x2d')],_0xca852b[_0xdc1b('0x29')]['id'],![],_0x501fa8);if(rpc[_0xca852b[_0xdc1b('0x25')]+_0xdc1b('0x2e')]){return rpc[_0xca852b['channel']+_0xdc1b('0x2e')]['update'](_0x3875df,_0xe4ea08)['catch'](function(_0x3c05af){logger[_0xdc1b('0x31')](_0xdc1b('0x35'));});}}}function handleFindQueue(_0x1bdf23){return function(_0x3510d8){return _0x3510d8[_0xdc1b('0x2d')][_0xdc1b('0x37')]()===_0x1bdf23[_0xdc1b('0x37')]();};}exports[_0xdc1b('0x38')]=function(_0x59bb6f,_0x5298d6,_0x5c2fd2,_0x262caf){return function(_0x5252cd){try{var _0x47825e={'name':_0x5298d6[0x0],'timeout':_0x5298d6[0x1]};var _0x154d19=queue[_0xdc1b('0x39')](_0x47825e,{'typecast':!![]});if(_0x154d19['length']){logger['error']('[%s][QUEUE]\x20%s',_0x59bb6f,_[_0xdc1b('0x3a')](_0x154d19,_0xdc1b('0x29'))['join'](',\x20'));_0x5252cd[_0xdc1b('0x3b')]();}else{var _0x4940d5=_[_0xdc1b('0x3c')](_0x5c2fd2[_0x262caf[_0xdc1b('0x25')]+_0xdc1b('0x3d')],handleFindQueue(_0x47825e[_0xdc1b('0x2d')]));if(_0x4940d5){startRouting(_0x59bb6f,_0x4940d5,_0x262caf,_0x5c2fd2);var _0x279857=(_0x4940d5['timeout']||0xa)*0x3e8;var _0x440daa=(_0x47825e['timeout']||0x14)*0x3e8;var _0x48b9fb,_0xf1f01b;if(_0x279857>_0x440daa){_0x440daa=_0x279857;}var _0x1fb6ab=seqqueue['createQueue'](_0x279857);_0x1fb6ab['id']=_0x59bb6f;_0x1fb6ab[_0xdc1b('0x3e')]=_0x279857;_0x1fb6ab['qtimeout']=_0x440daa;_0x1fb6ab[_0xdc1b('0x25')]=_0x262caf[_0xdc1b('0x25')];_0x5c2fd2[_0xdc1b('0x3f')][_0x59bb6f]['on'](_0xdc1b('0x40'),function(){logger[_0xdc1b('0x2b')](_0xdc1b('0x41'),_0x59bb6f);stopRouting(_0x59bb6f,_0x4940d5,_0x262caf,_0x5c2fd2);clearTimeout(_0x48b9fb);_0x48b9fb=undefined;_0x1fb6ab['close'](!![]);if(_0x5c2fd2[_0xdc1b('0x3f')][_0x59bb6f]){delete _0x5c2fd2[_0xdc1b('0x3f')][_0x59bb6f];}_0x5252cd[_0xdc1b('0x3b')]();});_0x5c2fd2[_0xdc1b('0x3f')][_0x59bb6f]['on'](_0xdc1b('0x42'),function(){if(_0x5c2fd2[_0xdc1b('0x3f')][_0x59bb6f]){delete _0x5c2fd2[_0xdc1b('0x3f')][_0x59bb6f];}});_0x48b9fb=setTimeout(function(){logger[_0xdc1b('0x2b')](_0xdc1b('0x43'),_0x59bb6f);endRouting(_0x59bb6f,_0x4940d5,_0x262caf,_0x5c2fd2);clearTimeout(_0x48b9fb);_0x1fb6ab[_0xdc1b('0x44')](!![]);_0x5252cd[_0xdc1b('0x45')]();},_0x440daa);switch(_0x4940d5[_0xdc1b('0x46')]){case _0xdc1b('0x47'):strategy['rrmemory'](_0x1fb6ab,_0x4940d5,_0x5c2fd2,_0x262caf);break;default:strategy[_0xdc1b('0x48')](_0x1fb6ab,_0x4940d5,_0x5c2fd2,_0x262caf);}}else{logger[_0xdc1b('0x31')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x59bb6f,_0x47825e[_0xdc1b('0x2d')]);_0x5252cd[_0xdc1b('0x3b')]();}}}catch(_0x923175){console['log'](_0x923175);logger[_0xdc1b('0x31')]('[%s][QUEUE]\x20%s',_0x59bb6f,_0x923175[_0xdc1b('0x49')]);_0x5252cd[_0xdc1b('0x3b')]();}};};
\ No newline at end of file
+var _0x1226=['[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','[%s][QUEUE]\x20%s','map','join','stop','find','atimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','queue_id','account','queue','from','joinAt','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','upperFirst','InteractionId','message','chat','AccountId','name','QueueReport','error','create\x20queue\x20report','waiting','info'];(function(_0x58c608,_0x16f6df){var _0x4fb8aa=function(_0xcc6b8d){while(--_0xcc6b8d){_0x58c608['push'](_0x58c608['shift']());}};_0x4fb8aa(++_0x16f6df);}(_0x1226,0x1c1));var _0x6122=function(_0x1fd988,_0x24f144){_0x1fd988=_0x1fd988-0x0;var _0x3adeb2=_0x1226[_0x1fd988];return _0x3adeb2;};'use strict';var schema=require(_0x6122('0x0'));var _=require(_0x6122('0x1'));var util=require(_0x6122('0x2'));var seqqueue=require(_0x6122('0x3'));var moment=require(_0x6122('0x4'));var Redis=require(_0x6122('0x5'));var config=require(_0x6122('0x6'));var logger=require(_0x6122('0x7'))(_0x6122('0x8'));var strategy=require('./strategy');config[_0x6122('0x9')]=_[_0x6122('0xa')](config[_0x6122('0x9')],{'host':_0x6122('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x6122('0xc'),_0x6122('0xd'),_0x6122('0xe'),_0x6122('0xf'),_0x6122('0x10')];function emit(_0x36ff73,_0xad7d04,_0x7f19a6){io['to'](_0x36ff73)['emit'](_0xad7d04,_0x7f19a6);}function emitChannelQueueInteraction(_0x3dcea8,_0x414391,_0x4f4250,_0x190d8e,_0x44c993,_0x4eaa95,_0xc31467,_0x1de27d){var _0x3738a4=_[_0x6122('0x11')](_0x4f4250);_0x3738a4[_0x6122('0xc')]=_0x1de27d;_0x3738a4[_0x6122('0xe')]=_0x414391;_0x3738a4['account']=_0x190d8e;_0x3738a4['id']=_0x44c993;if(_0x4eaa95){_0xc31467[util[_0x6122('0x12')](_0x6122('0x13'),_0x3dcea8)][_0x44c993]=_[_0x6122('0x14')](_0x3738a4,attributes);}else{delete _0xc31467[util[_0x6122('0x12')](_0x6122('0x13'),_0x3dcea8)][_0x44c993];}emit(util['format'](_0x6122('0x15'),_0x3dcea8,_0x414391),util['format']('%s_queue_waiting_interaction:%s',_0x3dcea8,_0x4eaa95?_0x6122('0x16'):_0x6122('0x17')),_[_0x6122('0x14')](_0x3738a4,attributes));}var rpc={'openchannelQueueReport':require(_0x6122('0x18')),'mailQueueReport':require(_0x6122('0x19')),'chatQueueReport':require(_0x6122('0x1a')),'smsQueueReport':require(_0x6122('0x1b')),'faxQueueReport':require(_0x6122('0x1c')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x6122('0x1d'),'required':!![],'message':_0x6122('0x1e')},'timeout':{'type':'number','message':_0x6122('0x1f')}});function startRouting(_0x2a5908,_0xcbf31a,_0x37319e,_0x797278){if(_0x2a5908&&_0xcbf31a&&_0x37319e){_0xcbf31a['waiting']+=0x1;var _0x3f6cd2={'uniqueid':_0x2a5908,'from':_0x37319e['body']?_0x37319e[_0x6122('0x20')][_0x6122('0xf')]:'','joinAt':moment()[_0x6122('0x12')](_0x6122('0x21')),'ContactId':_0x37319e[_0x6122('0x22')]?_0x37319e[_0x6122('0x22')]['id']:null,'ListId':_0x37319e[_0x6122('0x23')]?_0x37319e[_0x6122('0x23')]['id']:null};_0x3f6cd2[_['upperFirst'](_0x37319e[_0x6122('0x24')])+'QueueId']=_0xcbf31a['id']||null;_0x3f6cd2[_[_0x6122('0x25')](_0x37319e[_0x6122('0x24')])+_0x6122('0x26')]=_0x37319e['interaction']?_0x37319e['interaction']['id']:null;_0x3f6cd2[_['upperFirst'](_0x37319e[_0x6122('0x24')])+'MessageId']=_0x37319e[_0x6122('0x27')]?_0x37319e[_0x6122('0x27')]['id']:null;_0x3f6cd2[_[_0x6122('0x25')](_0x37319e['channel'])+(_0x37319e[_0x6122('0x24')]!==_0x6122('0x28')?_0x6122('0x29'):'WebsiteId')]=_0x37319e['account']?_0x37319e[_0x6122('0xd')]['id']:null;logger['info'](util[_0x6122('0x12')]('[%s][START:QUEUE][NAME:%s]',_0x2a5908,_0xcbf31a['name']));emitChannelQueueInteraction(_0x37319e[_0x6122('0x24')],_0xcbf31a[_0x6122('0x2a')],_0x3f6cd2,_0x37319e[_0x6122('0xd')][_0x6122('0x2a')],_0x37319e[_0x6122('0x27')]['id'],!![],_0x797278,_0xcbf31a['id']);if(rpc[_0x37319e[_0x6122('0x24')]+_0x6122('0x2b')]){return rpc[_0x37319e[_0x6122('0x24')]+_0x6122('0x2b')]['create'](_0x3f6cd2)['catch'](function(_0x3cc864){logger[_0x6122('0x2c')](_0x6122('0x2d'));});}}}function stopRouting(_0x1795f4,_0x341d62,_0x4c7f36,_0x57df51){if(_0x1795f4&&_0x341d62){_0x341d62[_0x6122('0x2e')]-=0x1;var _0x44189e={'leaveAt':moment()[_0x6122('0x12')](_0x6122('0x21')),'acceptAt':moment()[_0x6122('0x12')](_0x6122('0x21')),'reason':'accepted'};logger[_0x6122('0x2f')](util[_0x6122('0x12')](_0x6122('0x30'),_0x1795f4,_0x341d62[_0x6122('0x2a')]));emitChannelQueueInteraction(_0x4c7f36[_0x6122('0x24')],_0x341d62['name'],_0x4c7f36[_0x6122('0x20')],_0x4c7f36[_0x6122('0xd')][_0x6122('0x2a')],_0x4c7f36[_0x6122('0x27')]['id'],![],_0x57df51,_0x341d62['id']);if(rpc[_0x4c7f36[_0x6122('0x24')]+'QueueReport']){return rpc[_0x4c7f36[_0x6122('0x24')]+_0x6122('0x2b')][_0x6122('0x31')](_0x1795f4,_0x44189e)[_0x6122('0x32')](function(_0x3e09c0){logger[_0x6122('0x2c')](_0x6122('0x33'));});}}}function endRouting(_0x1ee37a,_0x35fda9,_0x5a4b7c,_0x21519b){if(_0x1ee37a&&_0x35fda9){_0x35fda9[_0x6122('0x2e')]-=0x1;var _0xade340={'leaveAt':moment()[_0x6122('0x12')](_0x6122('0x21')),'exitAt':moment()['format'](_0x6122('0x21')),'reason':_0x6122('0x34')};logger[_0x6122('0x2f')](util['format'](_0x6122('0x35'),_0x1ee37a,_0x35fda9[_0x6122('0x2a')]));emitChannelQueueInteraction(_0x5a4b7c[_0x6122('0x24')],_0x35fda9['name'],_0x5a4b7c['body'],_0x5a4b7c[_0x6122('0xd')]['name'],_0x5a4b7c[_0x6122('0x27')]['id'],![],_0x21519b);if(rpc[_0x5a4b7c[_0x6122('0x24')]+'QueueReport']){return rpc[_0x5a4b7c[_0x6122('0x24')]+'QueueReport']['update'](_0x1ee37a,_0xade340)[_0x6122('0x32')](function(_0x5245ad){logger[_0x6122('0x2c')](_0x6122('0x33'));});}}}function handleFindQueue(_0x2ebf0b){return function(_0x5055d8){return _0x5055d8[_0x6122('0x2a')]['toLowerCase']()===_0x2ebf0b[_0x6122('0x36')]();};}exports['consequence']=function(_0x3b2ad3,_0x2f8873,_0x12b0c3,_0x4fb2cf){return function(_0x50e215){try{var _0x22e97d={'name':_0x2f8873[0x0],'timeout':_0x2f8873[0x1]};var _0x4e2508=queue[_0x6122('0x0')](_0x22e97d,{'typecast':!![]});if(_0x4e2508['length']){logger[_0x6122('0x2c')](_0x6122('0x37'),_0x3b2ad3,_[_0x6122('0x38')](_0x4e2508,_0x6122('0x27'))[_0x6122('0x39')](',\x20'));_0x50e215[_0x6122('0x3a')]();}else{var _0x4e3aff=_[_0x6122('0x3b')](_0x12b0c3[_0x4fb2cf[_0x6122('0x24')]+'Queues'],handleFindQueue(_0x22e97d[_0x6122('0x2a')]));if(_0x4e3aff){startRouting(_0x3b2ad3,_0x4e3aff,_0x4fb2cf,_0x12b0c3);var _0x44d395=(_0x4e3aff[_0x6122('0x34')]||0xa)*0x3e8;var _0x77f2d=(_0x22e97d['timeout']||0x14)*0x3e8;var _0x1e2297,_0x2e3b17;if(_0x44d395>_0x77f2d){_0x77f2d=_0x44d395;}var _0x3990d1=seqqueue['createQueue'](_0x44d395);_0x3990d1['id']=_0x3b2ad3;_0x3990d1[_0x6122('0x3c')]=_0x44d395;_0x3990d1['qtimeout']=_0x77f2d;_0x3990d1[_0x6122('0x24')]=_0x4fb2cf['channel'];_0x12b0c3[_0x6122('0x3d')][_0x3b2ad3]['on']('end',function(){logger[_0x6122('0x2f')](_0x6122('0x3e'),_0x3b2ad3);stopRouting(_0x3b2ad3,_0x4e3aff,_0x4fb2cf,_0x12b0c3);clearTimeout(_0x1e2297);_0x1e2297=undefined;_0x3990d1[_0x6122('0x3f')](!![]);if(_0x12b0c3['rules'][_0x3b2ad3]){delete _0x12b0c3[_0x6122('0x3d')][_0x3b2ad3];}_0x50e215[_0x6122('0x3a')]();});_0x12b0c3['rules'][_0x3b2ad3]['on']('complete',function(){if(_0x12b0c3[_0x6122('0x3d')][_0x3b2ad3]){delete _0x12b0c3[_0x6122('0x3d')][_0x3b2ad3];}});_0x1e2297=setTimeout(function(){logger['info'](_0x6122('0x40'),_0x3b2ad3);endRouting(_0x3b2ad3,_0x4e3aff,_0x4fb2cf,_0x12b0c3);clearTimeout(_0x1e2297);_0x3990d1[_0x6122('0x3f')](!![]);_0x50e215[_0x6122('0x41')]();},_0x77f2d);switch(_0x4e3aff[_0x6122('0x42')]){case _0x6122('0x43'):strategy[_0x6122('0x43')](_0x3990d1,_0x4e3aff,_0x12b0c3,_0x4fb2cf);break;default:strategy[_0x6122('0x44')](_0x3990d1,_0x4e3aff,_0x12b0c3,_0x4fb2cf);}}else{logger[_0x6122('0x2c')](_0x6122('0x45'),_0x3b2ad3,_0x22e97d[_0x6122('0x2a')]);_0x50e215['stop']();}}}catch(_0x20fec9){console['log'](_0x20fec9);logger['error'](_0x6122('0x37'),_0x3b2ad3,_0x20fec9[_0x6122('0x46')]);_0x50e215[_0x6122('0x3a')]();}};};
\ No newline at end of file
index 91c752d..2d4a649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf430=['handleTimeout','handleDrained','prototype','push','info','agent','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','routing','notificationId','squeue','realtime','handleRun','bind'];(function(_0x39e6b7,_0x4e2c35){var _0x38057b=function(_0x581103){while(--_0x581103){_0x39e6b7['push'](_0x39e6b7['shift']());}};_0x38057b(++_0x4e2c35);}(_0xf430,0x1e4));var _0x0f43=function(_0x53ddab,_0x4ada9d){_0x53ddab=_0x53ddab-0x0;var _0x5819ac=_0xf430[_0x53ddab];return _0x5819ac;};'use strict';var _=require(_0x0f43('0x0'));var uuid=require(_0x0f43('0x1'));var util=require(_0x0f43('0x2'));var logger=require('../../../../../config/logger')(_0x0f43('0x3'));var Agent=function(_0x7d24d9,_0x5f0981,_0x4e2851,_0x462c88){this[_0x0f43('0x4')]=uuid['v4']();this[_0x0f43('0x5')]=_0x7d24d9;this['agent']=_0x5f0981;this[_0x0f43('0x6')]=_0x4e2851;this[_0x0f43('0x3')]=_0x462c88;this[_0x0f43('0x5')]['push'](this[_0x0f43('0x7')][_0x0f43('0x8')](this),this[_0x0f43('0x9')]['bind'](this));this[_0x0f43('0x5')]['on']('timeout',this[_0x0f43('0x9')][_0x0f43('0x8')](this));this['squeue']['on']('drained',this[_0x0f43('0xa')][_0x0f43('0x8')](this));};Agent[_0x0f43('0xb')][_0x0f43('0xc')]=function(){this[_0x0f43('0x5')]['push'](this[_0x0f43('0x7')][_0x0f43('0x8')](this),this[_0x0f43('0x9')][_0x0f43('0x8')](this));};Agent[_0x0f43('0xb')][_0x0f43('0xa')]=function(){this[_0x0f43('0x9')](!![]);};Agent[_0x0f43('0xb')][_0x0f43('0x7')]=function(_0x13d3b9){logger[_0x0f43('0xd')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x0f43('0x5')]['id'],this[_0x0f43('0xe')]['id']);if(_['isNil'](this[_0x0f43('0x6')][_0x0f43('0xf')][this[_0x0f43('0xe')]['id']])){logger['info'](_0x0f43('0x10'),this['squeue']['id'],this[_0x0f43('0xe')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x0f43('0x3')]['forcedOwnership']||util[_0x0f43('0x11')](this['squeue']['id'],this[_0x0f43('0x6')][_0x0f43('0xf')][this[_0x0f43('0xe')]['id']],this[_0x0f43('0x5')][_0x0f43('0x12')],![])){this[_0x0f43('0x6')]['agents'][this[_0x0f43('0xe')]['id']][_0x0f43('0x13')]=!![];this[_0x0f43('0x6')][_0x0f43('0xf')][this[_0x0f43('0xe')]['id']][_0x0f43('0x14')]=undefined;util[_0x0f43('0x15')](this[_0x0f43('0x4')],this['squeue']['id'],this['realtime'][_0x0f43('0xf')][this['agent']['id']],null,this[_0x0f43('0x3')]);util[_0x0f43('0x16')](this[_0x0f43('0x5')]['id'],this[_0x0f43('0x6')]['agents'][this[_0x0f43('0xe')]['id']],_0x0f43('0x17')+(this[_0x0f43('0x3')]['forcedOwnership']?':FORCED':''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x0f43('0x5')]['id'],this[_0x0f43('0xe')]['id']);setTimeout(this[_0x0f43('0xc')][_0x0f43('0x8')](this),0x3e8);}}};Agent[_0x0f43('0xb')][_0x0f43('0x9')]=function(_0x499b6b){if(_[_0x0f43('0x18')](this[_0x0f43('0x6')][_0x0f43('0xf')][this[_0x0f43('0xe')]['id']])){return logger[_0x0f43('0xd')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x0f43('0x5')]['id'],this[_0x0f43('0xe')]['id']);}else{logger[_0x0f43('0xd')](_0x0f43('0x19'),this['squeue']['id'],this[_0x0f43('0xe')]['id']);util[_0x0f43('0x1a')](this[_0x0f43('0x4')],this[_0x0f43('0x5')]['id'],this['realtime'][_0x0f43('0xf')][this[_0x0f43('0xe')]['id']],null,this['routing']);this[_0x0f43('0x6')][_0x0f43('0xf')][this[_0x0f43('0xe')]['id']][_0x0f43('0x13')]=![];this['realtime'][_0x0f43('0xf')][this['agent']['id']]['busyQueue']=undefined;util['writeLog'](this[_0x0f43('0x5')]['id'],this[_0x0f43('0x6')]['agents'][this[_0x0f43('0xe')]['id']],_0x499b6b?_0x0f43('0x1b'):_0x0f43('0x1c'));}if(!_0x499b6b){setTimeout(this[_0x0f43('0xc')]['bind'](this),0x3e8);}};function agent(_0x17ff50,_0x5830a2,_0x39a414,_0x467bee){return new Agent(_0x17ff50,_0x5830a2,_0x39a414,_0x467bee);}module['exports']=agent;
\ No newline at end of file
+var _0xe334=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','showNotification','writeLog','RINGING',':FORCED','hideNotification','busyQueue','TIMEOUT','exports','lodash','./util','routing','notificationId','agent','realtime','push','handleRun','bind','handleTimeout','squeue','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil'];(function(_0x556375,_0x1c7b3f){var _0x4ffb7b=function(_0x5c0415){while(--_0x5c0415){_0x556375['push'](_0x556375['shift']());}};_0x4ffb7b(++_0x1c7b3f);}(_0xe334,0x6e));var _0x4e33=function(_0x2002c0,_0x16b4fd){_0x2002c0=_0x2002c0-0x0;var _0x3c8705=_0xe334[_0x2002c0];return _0x3c8705;};'use strict';var _=require(_0x4e33('0x0'));var uuid=require('uuid');var util=require(_0x4e33('0x1'));var logger=require('../../../../../config/logger')(_0x4e33('0x2'));var Agent=function(_0x44a348,_0x3692f0,_0x38896b,_0x37d452){this[_0x4e33('0x3')]=uuid['v4']();this['squeue']=_0x44a348;this[_0x4e33('0x4')]=_0x3692f0;this[_0x4e33('0x5')]=_0x38896b;this[_0x4e33('0x2')]=_0x37d452;this['squeue'][_0x4e33('0x6')](this[_0x4e33('0x7')][_0x4e33('0x8')](this),this[_0x4e33('0x9')][_0x4e33('0x8')](this));this[_0x4e33('0xa')]['on'](_0x4e33('0xb'),this['handleTimeout'][_0x4e33('0x8')](this));this[_0x4e33('0xa')]['on'](_0x4e33('0xc'),this['handleDrained'][_0x4e33('0x8')](this));};Agent['prototype'][_0x4e33('0x6')]=function(){this[_0x4e33('0xa')][_0x4e33('0x6')](this[_0x4e33('0x7')][_0x4e33('0x8')](this),this[_0x4e33('0x9')][_0x4e33('0x8')](this));};Agent['prototype'][_0x4e33('0xd')]=function(){this[_0x4e33('0x9')](!![]);};Agent[_0x4e33('0xe')][_0x4e33('0x7')]=function(_0x330ae8){logger[_0x4e33('0xf')](_0x4e33('0x10'),this[_0x4e33('0xa')]['id'],this[_0x4e33('0x4')]['id']);if(_[_0x4e33('0x11')](this[_0x4e33('0x5')]['agents'][this[_0x4e33('0x4')]['id']])){logger[_0x4e33('0xf')](_0x4e33('0x12'),this[_0x4e33('0xa')]['id'],this[_0x4e33('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x4e33('0x2')][_0x4e33('0x13')]||util[_0x4e33('0x14')](this[_0x4e33('0xa')]['id'],this[_0x4e33('0x5')][_0x4e33('0x15')][this[_0x4e33('0x4')]['id']],this[_0x4e33('0xa')][_0x4e33('0x16')],![])){this['realtime'][_0x4e33('0x15')][this[_0x4e33('0x4')]['id']][_0x4e33('0x17')]=!![];this[_0x4e33('0x5')]['agents'][this[_0x4e33('0x4')]['id']]['busyQueue']=undefined;util[_0x4e33('0x18')](this[_0x4e33('0x3')],this['squeue']['id'],this[_0x4e33('0x5')]['agents'][this[_0x4e33('0x4')]['id']],null,this[_0x4e33('0x2')]);util[_0x4e33('0x19')](this[_0x4e33('0xa')]['id'],this[_0x4e33('0x5')][_0x4e33('0x15')][this[_0x4e33('0x4')]['id']],_0x4e33('0x1a')+(this[_0x4e33('0x2')]['forcedOwnership']?_0x4e33('0x1b'):''));}else{logger[_0x4e33('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x4e33('0xa')]['id'],this[_0x4e33('0x4')]['id']);setTimeout(this['push'][_0x4e33('0x8')](this),0x3e8);}}};Agent[_0x4e33('0xe')][_0x4e33('0x9')]=function(_0x4df979){if(_[_0x4e33('0x11')](this[_0x4e33('0x5')][_0x4e33('0x15')][this[_0x4e33('0x4')]['id']])){return logger[_0x4e33('0xf')](_0x4e33('0x12'),this[_0x4e33('0xa')]['id'],this[_0x4e33('0x4')]['id']);}else{logger[_0x4e33('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x4e33('0x4')]['id']);util[_0x4e33('0x1c')](this[_0x4e33('0x3')],this['squeue']['id'],this[_0x4e33('0x5')][_0x4e33('0x15')][this[_0x4e33('0x4')]['id']],null,this[_0x4e33('0x2')]);this[_0x4e33('0x5')][_0x4e33('0x15')][this[_0x4e33('0x4')]['id']][_0x4e33('0x17')]=![];this[_0x4e33('0x5')][_0x4e33('0x15')][this[_0x4e33('0x4')]['id']][_0x4e33('0x1d')]=undefined;util[_0x4e33('0x19')](this[_0x4e33('0xa')]['id'],this[_0x4e33('0x5')]['agents'][this['agent']['id']],_0x4df979?'STOP':_0x4e33('0x1e'));}if(!_0x4df979){setTimeout(this[_0x4e33('0x6')][_0x4e33('0x8')](this),0x3e8);}};function agent(_0x2ad140,_0x2d1263,_0x2112d4,_0x35969d){return new Agent(_0x2ad140,_0x2d1263,_0x2112d4,_0x35969d);}module[_0x4e33('0x1f')]=agent;
\ No newline at end of file
index d7f245d..23e9e52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bb4=['queue','realtime','push','handleRun','timeout','bind','drained','prototype','handleTimeout','handleDrained','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','STOP','TIMEOUT','busy','exports','lodash','uuid','./util','routing','notificationId','squeue'];(function(_0x526d76,_0x3f97af){var _0x416d8d=function(_0x3dfa4e){while(--_0x3dfa4e){_0x526d76['push'](_0x526d76['shift']());}};_0x416d8d(++_0x3f97af);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x16f0e0,_0x4803c6){_0x16f0e0=_0x16f0e0-0x0;var _0x1c8673=_0x6bb4[_0x16f0e0];return _0x1c8673;};'use strict';var _=require(_0x46bb('0x0'));var uuid=require(_0x46bb('0x1'));var util=require(_0x46bb('0x2'));var logger=require('../../../../../config/logger')(_0x46bb('0x3'));var Beepall=function(_0xd0784,_0x4eb2a9,_0x74054,_0x100be2){this[_0x46bb('0x4')]=uuid['v4']();this[_0x46bb('0x5')]=_0xd0784;this[_0x46bb('0x6')]=_0x4eb2a9;this[_0x46bb('0x7')]=_0x74054;this['routing']=_0x100be2;this['squeue'][_0x46bb('0x8')](this[_0x46bb('0x9')]['bind'](this),this['handleTimeout']['bind'](this));this[_0x46bb('0x5')]['on'](_0x46bb('0xa'),this['handleTimeout'][_0x46bb('0xb')](this));this[_0x46bb('0x5')]['on'](_0x46bb('0xc'),this['handleDrained'][_0x46bb('0xb')](this));};Beepall[_0x46bb('0xd')]['push']=function(){this[_0x46bb('0x5')][_0x46bb('0x8')](this[_0x46bb('0x9')]['bind'](this),this[_0x46bb('0xe')]['bind'](this));};Beepall['prototype'][_0x46bb('0xf')]=function(_0x5c319c){this[_0x46bb('0xe')](!![]);};Beepall[_0x46bb('0xd')]['handleRun']=function(_0x365805){var _0x5a5468=!![];if(!_[_0x46bb('0x10')](this['queue'])&&!_[_0x46bb('0x10')](this['queue']['Agents'])&&this[_0x46bb('0x6')][_0x46bb('0x11')]['length']>0x0){for(var _0x3f0817=0x0,_0x2afac6;_0x3f0817<this['queue']['Agents'][_0x46bb('0x12')];_0x3f0817+=0x1){_0x2afac6=this[_0x46bb('0x6')][_0x46bb('0x11')][_0x3f0817]['id'];if(_[_0x46bb('0x10')](this[_0x46bb('0x7')][_0x46bb('0x13')][_0x2afac6])){logger[_0x46bb('0x14')](_0x46bb('0x15'),this['squeue']['id'],_0x2afac6);}else{if(util['isAgentAvailable'](this[_0x46bb('0x5')]['id'],this[_0x46bb('0x7')][_0x46bb('0x13')][_0x2afac6],this['squeue']['channel'],!![])){_0x5a5468=![];util['writeLog'](this[_0x46bb('0x5')]['id'],this[_0x46bb('0x7')][_0x46bb('0x13')][_0x2afac6],_0x46bb('0x16'));this['realtime']['agents'][_0x2afac6]['busy']=!![];this['realtime']['agents'][_0x2afac6][_0x46bb('0x17')]=this['queue'][_0x46bb('0x18')];util[_0x46bb('0x19')](this[_0x46bb('0x4')],this[_0x46bb('0x5')]['id'],this[_0x46bb('0x7')][_0x46bb('0x13')][_0x2afac6],this[_0x46bb('0x6')],this[_0x46bb('0x3')]);}}}if(_0x5a5468){logger[_0x46bb('0x14')](_0x46bb('0x1a'),this['squeue']['id']);setTimeout(this[_0x46bb('0x8')][_0x46bb('0xb')](this),0x3e8);}}else{logger['info'](_0x46bb('0x1b'),this[_0x46bb('0x5')]['id']);setTimeout(this[_0x46bb('0x8')][_0x46bb('0xb')](this),0x3e8);}};Beepall[_0x46bb('0xd')][_0x46bb('0xe')]=function(_0xbbbfb3){if(!_[_0x46bb('0x10')](this[_0x46bb('0x6')])&&!_[_0x46bb('0x10')](this[_0x46bb('0x6')][_0x46bb('0x11')])){for(var _0x2d34d6=0x0,_0x226a13;_0x2d34d6<this[_0x46bb('0x6')][_0x46bb('0x11')][_0x46bb('0x12')];_0x2d34d6+=0x1){_0x226a13=this[_0x46bb('0x6')][_0x46bb('0x11')][_0x2d34d6]['id'];if(_[_0x46bb('0x10')](this[_0x46bb('0x7')]['agents'][_0x226a13])){logger[_0x46bb('0x14')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x46bb('0x5')]['id'],_0x226a13);}else{util['hideNotification'](this[_0x46bb('0x4')],this[_0x46bb('0x5')]['id'],this[_0x46bb('0x7')]['agents'][_0x226a13],this[_0x46bb('0x6')],this[_0x46bb('0x3')]);util[_0x46bb('0x1c')](this[_0x46bb('0x5')]['id'],this[_0x46bb('0x7')]['agents'][_0x226a13],_0xbbbfb3?_0x46bb('0x1d'):_0x46bb('0x1e'));this[_0x46bb('0x7')][_0x46bb('0x13')][_0x226a13][_0x46bb('0x1f')]=![];this[_0x46bb('0x7')][_0x46bb('0x13')][_0x226a13][_0x46bb('0x17')]=undefined;}}}if(!_0xbbbfb3){setTimeout(this[_0x46bb('0x8')][_0x46bb('0xb')](this),0x3e8);}};function beepall(_0x11bf75,_0x461735,_0x7e9c51,_0x365445){return new Beepall(_0x11bf75,_0x461735,_0x7e9c51,_0x365445);}module[_0x46bb('0x20')]=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(_0x506377,_0xe76541){var _0x23e4b0=function(_0x4efc36){while(--_0x4efc36){_0x506377['push'](_0x506377['shift']());}};_0x23e4b0(++_0xe76541);}(_0x979e,0x195));var _0xe979=function(_0x261002,_0x25f344){_0x261002=_0x261002-0x0;var _0x482583=_0x979e[_0x261002];return _0x482583;};'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 21b57ad..77486ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed65=['./rrmemory','./beepall','exports'];(function(_0x5bb5bf,_0x3498fe){var _0x5ef9f1=function(_0x1600ef){while(--_0x1600ef){_0x5bb5bf['push'](_0x5bb5bf['shift']());}};_0x5ef9f1(++_0x3498fe);}(_0xed65,0x1e2));var _0x5ed6=function(_0x1d83db,_0x89d115){_0x1d83db=_0x1d83db-0x0;var _0x2dc1d1=_0xed65[_0x1d83db];return _0x2dc1d1;};'use strict';module[_0x5ed6('0x0')]={'rrmemory':require(_0x5ed6('0x1')),'beepall':require(_0x5ed6('0x2')),'agent':require('./agent')};
\ No newline at end of file
+var _0xf318=['./agent','./rrmemory'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0xf318,0x6b));var _0x8f31=function(_0x2044aa,_0x20b510){_0x2044aa=_0x2044aa-0x0;var _0x44a658=_0xf318[_0x2044aa];return _0x44a658;};'use strict';module['exports']={'rrmemory':require(_0x8f31('0x0')),'beepall':require('./beepall'),'agent':require(_0x8f31('0x1'))};
\ No newline at end of file
index 112655d..56d845e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31dc=['showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','done','hideNotification','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','realtime','routing','intervals','push','handleRun','handleTimeout','bind','module','timeout','drained','prototype','handleCheckReject','isAgentAvailable','agents','agentId','info','[%s][QUEUE]\x20available\x20again\x20%s','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','busyQueue','queue','name'];(function(_0x30c0c2,_0x2529dd){var _0x12d3c7=function(_0x4b3b4c){while(--_0x4b3b4c){_0x30c0c2['push'](_0x30c0c2['shift']());}};_0x12d3c7(++_0x2529dd);}(_0x31dc,0xc4));var _0xc31d=function(_0x3361ba,_0x4e92cc){_0x3361ba=_0x3361ba-0x0;var _0xd02f74=_0x31dc[_0x3361ba];return _0xd02f74;};'use strict';var rr=require('rr');var _=require(_0xc31d('0x0'));var uuid=require(_0xc31d('0x1'));var util=require(_0xc31d('0x2'));var logger=require(_0xc31d('0x3'))('routing');var RRMemory=function(_0x127af6,_0x69c237,_0x2c5cc0,_0x25d407){this[_0xc31d('0x4')]=uuid['v4']();this[_0xc31d('0x5')]=_0x127af6;this['queue']=_0x69c237;this[_0xc31d('0x6')]=_0x2c5cc0;this[_0xc31d('0x7')]=_0x25d407;this[_0xc31d('0x8')]={};this['squeue'][_0xc31d('0x9')](this[_0xc31d('0xa')]['bind'](this),this[_0xc31d('0xb')][_0xc31d('0xc')](this),this[_0xc31d('0xd')]);this[_0xc31d('0x5')]['on'](_0xc31d('0xe'),this[_0xc31d('0xb')][_0xc31d('0xc')](this));this[_0xc31d('0x5')]['on'](_0xc31d('0xf'),this['handleDrained'][_0xc31d('0xc')](this));};RRMemory[_0xc31d('0x10')][_0xc31d('0x9')]=function(){this[_0xc31d('0x5')]['push'](this[_0xc31d('0xa')][_0xc31d('0xc')](this),this['handleTimeout'][_0xc31d('0xc')](this));};RRMemory[_0xc31d('0x10')]['handleDrained']=function(_0x55841a){this['handleTimeout'](!![]);};RRMemory[_0xc31d('0x10')][_0xc31d('0x11')]=function(_0x2e9c0b){if(util[_0xc31d('0x12')](this[_0xc31d('0x5')]['id'],this[_0xc31d('0x6')][_0xc31d('0x13')][this[_0xc31d('0x14')]],this['squeue']['channel'],!![])){logger[_0xc31d('0x15')](_0xc31d('0x16'),this[_0xc31d('0x5')]['id'],this[_0xc31d('0x14')]);clearInterval(this[_0xc31d('0x8')][this[_0xc31d('0x14')]]);_0x2e9c0b['done']();setTimeout(this[_0xc31d('0x9')][_0xc31d('0xc')](this),0x3e8);}};RRMemory[_0xc31d('0x10')]['handleRun']=function(_0x3977f2){this['agentId']=rr(this['queue'][_0xc31d('0x17')]);logger[_0xc31d('0x15')](_0xc31d('0x18'),this[_0xc31d('0x5')]['id'],this[_0xc31d('0x14')]);if(_[_0xc31d('0x19')](this['realtime'][_0xc31d('0x13')][this[_0xc31d('0x14')]])){logger[_0xc31d('0x15')](_0xc31d('0x1a'),this[_0xc31d('0x5')]['id'],this[_0xc31d('0x14')]);_0x3977f2['done']();setTimeout(this[_0xc31d('0x9')][_0xc31d('0xc')](this),0x3e8);}else{if(util[_0xc31d('0x12')](this[_0xc31d('0x5')]['id'],this['realtime']['agents'][this[_0xc31d('0x14')]],this[_0xc31d('0x5')][_0xc31d('0x1b')],!![])){this[_0xc31d('0x6')]['agents'][this[_0xc31d('0x14')]][_0xc31d('0x1c')]=!![];this[_0xc31d('0x6')][_0xc31d('0x13')][this[_0xc31d('0x14')]][_0xc31d('0x1d')]=this[_0xc31d('0x1e')][_0xc31d('0x1f')];util[_0xc31d('0x20')](this[_0xc31d('0x4')],this[_0xc31d('0x5')]['id'],this[_0xc31d('0x6')][_0xc31d('0x13')][this[_0xc31d('0x14')]],this[_0xc31d('0x1e')],this[_0xc31d('0x7')]);util[_0xc31d('0x21')](this[_0xc31d('0x5')]['id'],this[_0xc31d('0x6')][_0xc31d('0x13')][this['agentId']],_0xc31d('0x22'));this[_0xc31d('0x8')][this[_0xc31d('0x14')]]=setInterval(this[_0xc31d('0x11')][_0xc31d('0xc')](this,_0x3977f2),0x3e8);}else{logger[_0xc31d('0x15')](_0xc31d('0x23'),this[_0xc31d('0x5')]['id'],this[_0xc31d('0x14')]);_0x3977f2[_0xc31d('0x24')]();setTimeout(this['push'][_0xc31d('0xc')](this),0x3e8);}}};RRMemory['prototype']['handleTimeout']=function(_0x2ed4d0){logger[_0xc31d('0x15')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this[_0xc31d('0x5')]['id'],this[_0xc31d('0x14')]);if(_[_0xc31d('0x19')](this[_0xc31d('0x6')][_0xc31d('0x13')][this[_0xc31d('0x14')]])){logger[_0xc31d('0x15')](_0xc31d('0x1a'),this['squeue']['id'],this['agentId']);}else{clearInterval(this[_0xc31d('0x8')][this[_0xc31d('0x14')]]);util[_0xc31d('0x25')](this[_0xc31d('0x4')],this[_0xc31d('0x5')]['id'],this[_0xc31d('0x6')]['agents'][this['agentId']],this['queue'],this[_0xc31d('0x7')]);util[_0xc31d('0x21')](this[_0xc31d('0x5')]['id'],this[_0xc31d('0x6')][_0xc31d('0x13')][this['agentId']],'TIMEOUT');this[_0xc31d('0x6')][_0xc31d('0x13')][this['agentId']][_0xc31d('0x1c')]=![];this[_0xc31d('0x6')][_0xc31d('0x13')][this[_0xc31d('0x14')]][_0xc31d('0x1d')]=undefined;}if(!_0x2ed4d0){setTimeout(this[_0xc31d('0x9')][_0xc31d('0xc')](this),0x3e8);}};function rrmemory(_0x43a372,_0x1b179a,_0x3068c8,_0x31ea6e){return new RRMemory(_0x43a372,_0x1b179a,_0x3068c8,_0x31ea6e);}module['exports']=rrmemory;
\ No newline at end of file
+var _0x11c6=['writeLog','TIMEOUT','exports','lodash','../../../../../config/logger','notificationId','squeue','queue','realtime','intervals','handleRun','handleTimeout','bind','module','drained','handleDrained','prototype','push','handleCheckReject','isAgentAvailable','[%s][QUEUE]\x20available\x20again\x20%s','agentId','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','agents','channel','busy','busyQueue','name','showNotification','routing','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x11c6,0x147));var _0x611c=function(_0x5f0432,_0x2b29c8){_0x5f0432=_0x5f0432-0x0;var _0x48eb08=_0x11c6[_0x5f0432];return _0x48eb08;};'use strict';var rr=require('rr');var _=require(_0x611c('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x611c('0x1'))('routing');var RRMemory=function(_0xf2e03e,_0x4d78fc,_0x46771f,_0x5d8efa){this[_0x611c('0x2')]=uuid['v4']();this[_0x611c('0x3')]=_0xf2e03e;this[_0x611c('0x4')]=_0x4d78fc;this[_0x611c('0x5')]=_0x46771f;this['routing']=_0x5d8efa;this[_0x611c('0x6')]={};this[_0x611c('0x3')]['push'](this[_0x611c('0x7')]['bind'](this),this[_0x611c('0x8')][_0x611c('0x9')](this),this[_0x611c('0xa')]);this[_0x611c('0x3')]['on']('timeout',this[_0x611c('0x8')][_0x611c('0x9')](this));this['squeue']['on'](_0x611c('0xb'),this[_0x611c('0xc')][_0x611c('0x9')](this));};RRMemory[_0x611c('0xd')]['push']=function(){this[_0x611c('0x3')][_0x611c('0xe')](this[_0x611c('0x7')][_0x611c('0x9')](this),this[_0x611c('0x8')]['bind'](this));};RRMemory[_0x611c('0xd')]['handleDrained']=function(_0x4934e7){this[_0x611c('0x8')](!![]);};RRMemory[_0x611c('0xd')][_0x611c('0xf')]=function(_0x29caa8){if(util[_0x611c('0x10')](this[_0x611c('0x3')]['id'],this[_0x611c('0x5')]['agents'][this['agentId']],this[_0x611c('0x3')]['channel'],!![])){logger['info'](_0x611c('0x11'),this['squeue']['id'],this[_0x611c('0x12')]);clearInterval(this['intervals'][this[_0x611c('0x12')]]);_0x29caa8[_0x611c('0x13')]();setTimeout(this['push'][_0x611c('0x9')](this),0x3e8);}};RRMemory['prototype'][_0x611c('0x7')]=function(_0x242476){this[_0x611c('0x12')]=rr(this['queue'][_0x611c('0x14')]);logger['info'](_0x611c('0x15'),this[_0x611c('0x3')]['id'],this[_0x611c('0x12')]);if(_[_0x611c('0x16')](this[_0x611c('0x5')][_0x611c('0x17')][this[_0x611c('0x12')]])){logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x611c('0x3')]['id'],this[_0x611c('0x12')]);_0x242476['done']();setTimeout(this[_0x611c('0xe')][_0x611c('0x9')](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0x611c('0x3')]['id'],this[_0x611c('0x5')][_0x611c('0x17')][this[_0x611c('0x12')]],this[_0x611c('0x3')][_0x611c('0x18')],!![])){this['realtime'][_0x611c('0x17')][this[_0x611c('0x12')]][_0x611c('0x19')]=!![];this[_0x611c('0x5')][_0x611c('0x17')][this[_0x611c('0x12')]][_0x611c('0x1a')]=this[_0x611c('0x4')][_0x611c('0x1b')];util[_0x611c('0x1c')](this['notificationId'],this['squeue']['id'],this['realtime'][_0x611c('0x17')][this[_0x611c('0x12')]],this[_0x611c('0x4')],this[_0x611c('0x1d')]);util['writeLog'](this[_0x611c('0x3')]['id'],this['realtime'][_0x611c('0x17')][this[_0x611c('0x12')]],'RINGING');this[_0x611c('0x6')][this['agentId']]=setInterval(this[_0x611c('0xf')]['bind'](this,_0x242476),0x3e8);}else{logger[_0x611c('0x1e')]('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this['squeue']['id'],this[_0x611c('0x12')]);_0x242476[_0x611c('0x13')]();setTimeout(this['push'][_0x611c('0x9')](this),0x3e8);}}};RRMemory[_0x611c('0xd')][_0x611c('0x8')]=function(_0x43b1fd){logger['info']('[%s][QUEUE]\x20timeout\x20with\x20%s',this[_0x611c('0x3')]['id'],this['agentId']);if(_[_0x611c('0x16')](this['realtime'][_0x611c('0x17')][this[_0x611c('0x12')]])){logger['info'](_0x611c('0x1f'),this[_0x611c('0x3')]['id'],this[_0x611c('0x12')]);}else{clearInterval(this[_0x611c('0x6')][this[_0x611c('0x12')]]);util[_0x611c('0x20')](this[_0x611c('0x2')],this[_0x611c('0x3')]['id'],this[_0x611c('0x5')][_0x611c('0x17')][this[_0x611c('0x12')]],this[_0x611c('0x4')],this[_0x611c('0x1d')]);util[_0x611c('0x21')](this[_0x611c('0x3')]['id'],this[_0x611c('0x5')][_0x611c('0x17')][this[_0x611c('0x12')]],_0x611c('0x22'));this['realtime'][_0x611c('0x17')][this[_0x611c('0x12')]][_0x611c('0x19')]=![];this[_0x611c('0x5')][_0x611c('0x17')][this['agentId']][_0x611c('0x1a')]=undefined;}if(!_0x43b1fd){setTimeout(this[_0x611c('0xe')][_0x611c('0x9')](this),0x3e8);}};function rrmemory(_0x334def,_0x188482,_0x3ff531,_0x2bea76){return new RRMemory(_0x334def,_0x188482,_0x3ff531,_0x2bea76);}module[_0x611c('0x23')]=rrmemory;
\ No newline at end of file
index deaf459..812e650 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['emit','name','user:save','split','\x20interaction','account','notificationSound','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','notification:%s','save','remove','info','isAgentAvailable','busy','BUSY','Pause','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','routing','redis','localhost'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x2ef3,0xba));var _0x32ef=function(_0x2d257d,_0x146f59){_0x2d257d=_0x2d257d-0x0;var _0x39bbe2=_0x2ef3[_0x2d257d];return _0x39bbe2;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var utils=require(_0x32ef('0x2'));var Mustache=require(_0x32ef('0x3'));var Redis=require(_0x32ef('0x4'));var config=require(_0x32ef('0x5'));var logger=require('../../../../../config/logger')(_0x32ef('0x6'));config[_0x32ef('0x7')]=_['defaults'](config[_0x32ef('0x7')],{'host':_0x32ef('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x2c0089,_0x4bfcf8,_0x367c39){io['to'](_0x2c0089)[_0x32ef('0x9')](_0x4bfcf8,_0x367c39);}function sendNotification(_0x234863,_0x298066,_0x2484a0,_0x2bbb50,_0x28275c,_0x77df79){io['to'](util['format']('user:%s',_0x2bbb50[_0x32ef('0xa')]))[_0x32ef('0x9')](_0x32ef('0xb'),_0x2bbb50);var _0x1499c2=_0x77df79||{};var _0x5af651=_0x2484a0[_0x32ef('0xc')]('.');var _0x5afcc2={'uniqueid':_0x298066,'channel':_0x5af651[0x0],'id':_0x5af651[0x1],'title':_0x5af651[0x0]+_0x32ef('0xd'),'interactionId':_0x5af651[0x2],'queue':_0x28275c?_0x28275c['name']:null,'sound':_0x1499c2[_0x32ef('0xe')][_0x32ef('0xf')],'shake':_0x1499c2['account']['notificationShake']};try{if(!_0x1499c2[_0x32ef('0x10')]){_0x1499c2['body']={};}if(_0x28275c){_0x1499c2[_0x32ef('0x10')][_0x32ef('0x11')]=_0x28275c;}else if(_0x1499c2[_0x32ef('0x10')][_0x32ef('0x11')]){delete _0x1499c2['body']['queue'];}_0x5afcc2['msg']=utils[_0x32ef('0x12')](_0x1499c2[_0x32ef('0xe')][_0x32ef('0x13')],_0x1499c2);}catch(_0x53a5ca){_0x5afcc2['msg']=_0x32ef('0x14');logger[_0x32ef('0x15')](util[_0x32ef('0x16')]('[%s][QUEUE]\x20%s',_0x298066,_0x53a5ca[_0x32ef('0x17')]));}io['to'](util[_0x32ef('0x16')]('user:%s',_0x2bbb50[_0x32ef('0xa')]))[_0x32ef('0x9')](util[_0x32ef('0x16')](_0x32ef('0x18'),_0x234863?_0x32ef('0x19'):_0x32ef('0x1a')),_0x5afcc2);}function writeLog(_0x4de441,_0x3c5b78,_0x5cc3ef){return logger[_0x32ef('0x1b')](util[_0x32ef('0x16')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x4de441,_0x3c5b78[_0x32ef('0xa')],_0x5cc3ef));}exports[_0x32ef('0x1c')]=function(_0x5e8898,_0x55f7f2,_0x57f5e5,_0x22f2d7){if(_0x55f7f2[_0x32ef('0x1d')]){writeLog(_0x5e8898,_0x55f7f2,_0x32ef('0x1e'));return![];}if(!_0x55f7f2['online']){writeLog(_0x5e8898,_0x55f7f2,'OFFLINE');return![];}if(_0x55f7f2[_0x57f5e5+_0x32ef('0x1f')]){writeLog(_0x5e8898,_0x55f7f2,'PAUSE');return![];}if(_0x22f2d7&&_0x55f7f2['hasOwnProperty'](_0x57f5e5+_0x32ef('0x20'))&&_0x55f7f2[_0x32ef('0x21')](_0x57f5e5+_0x32ef('0x22'))){if(_0x55f7f2[_0x57f5e5+_0x32ef('0x20')]>0x0&&_0x55f7f2[_0x57f5e5+_0x32ef('0x22')]>=_0x55f7f2[_0x57f5e5+_0x32ef('0x20')]){writeLog(_0x5e8898,_0x55f7f2,_0x57f5e5[_0x32ef('0x23')]()+_0x32ef('0x24'));return![];}}return!![];};exports[_0x32ef('0x25')]=function(_0x2f52d7,_0x1335e2,_0xba4b3f,_0x5a88a5,_0xd65fde){return sendNotification(!![],_0x2f52d7,_0x1335e2,_0xba4b3f,_0x5a88a5,_0xd65fde);};exports[_0x32ef('0x26')]=function(_0x5a04cd,_0x12de1a,_0x3c569d,_0x30b250,_0x26e207){return sendNotification(![],_0x5a04cd,_0x12de1a,_0x3c569d,_0x30b250,_0x26e207);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0x5d17=['../../../../../config/logger','redis','defaults','localhost','emit','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','queue','body','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','notification:%s','save','remove','info','isAgentAvailable','busy','BUSY','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','showNotification','writeLog','lodash','util','ioredis','../../../../../config/environment'];(function(_0x2a0346,_0x2c1300){var _0x1f5232=function(_0x345c8e){while(--_0x345c8e){_0x2a0346['push'](_0x2a0346['shift']());}};_0x1f5232(++_0x2c1300);}(_0x5d17,0x114));var _0x75d1=function(_0x9166ea,_0x1f21b0){_0x9166ea=_0x9166ea-0x0;var _0xdceec9=_0x5d17[_0x9166ea];return _0xdceec9;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0x75d1('0x2'));var config=require(_0x75d1('0x3'));var logger=require(_0x75d1('0x4'))('routing');config[_0x75d1('0x5')]=_[_0x75d1('0x6')](config[_0x75d1('0x5')],{'host':_0x75d1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x75d1('0x5')]));function emit(_0x116a51,_0x5c957a,_0x1ee61b){io['to'](_0x116a51)[_0x75d1('0x8')](_0x5c957a,_0x1ee61b);}function sendNotification(_0x105607,_0xf9f8e,_0x5acfa0,_0x4cf632,_0x40df40,_0x4a3bb3){io['to'](util['format'](_0x75d1('0x9'),_0x4cf632[_0x75d1('0xa')]))['emit'](_0x75d1('0xb'),_0x4cf632);var _0x3d7e39=_0x4a3bb3||{};var _0x28b9b4=_0x5acfa0[_0x75d1('0xc')]('.');var _0x6c1265={'uniqueid':_0xf9f8e,'channel':_0x28b9b4[0x0],'id':_0x28b9b4[0x1],'title':_0x28b9b4[0x0]+_0x75d1('0xd'),'interactionId':_0x28b9b4[0x2],'queue':_0x40df40?_0x40df40['name']:null,'sound':_0x3d7e39[_0x75d1('0xe')][_0x75d1('0xf')],'shake':_0x3d7e39[_0x75d1('0xe')][_0x75d1('0x10')]};try{if(!_0x3d7e39['body']){_0x3d7e39['body']={};}if(_0x40df40){_0x3d7e39['body'][_0x75d1('0x11')]=_0x40df40;}else if(_0x3d7e39[_0x75d1('0x12')][_0x75d1('0x11')]){delete _0x3d7e39['body'][_0x75d1('0x11')];}_0x6c1265[_0x75d1('0x13')]=utils[_0x75d1('0x14')](_0x3d7e39[_0x75d1('0xe')][_0x75d1('0x15')],_0x3d7e39);}catch(_0x39a26b){_0x6c1265[_0x75d1('0x13')]=_0x75d1('0x16');logger[_0x75d1('0x17')](util[_0x75d1('0x18')](_0x75d1('0x19'),_0xf9f8e,_0x39a26b['message']));}io['to'](util['format'](_0x75d1('0x9'),_0x4cf632[_0x75d1('0xa')]))['emit'](util[_0x75d1('0x18')](_0x75d1('0x1a'),_0x105607?_0x75d1('0x1b'):_0x75d1('0x1c')),_0x6c1265);}function writeLog(_0xa42dbe,_0xac6a24,_0x51d3b0){return logger[_0x75d1('0x1d')](util[_0x75d1('0x18')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0xa42dbe,_0xac6a24[_0x75d1('0xa')],_0x51d3b0));}exports[_0x75d1('0x1e')]=function(_0x526f6c,_0x2c0c21,_0x5e70ec,_0x3a85c0){if(_0x2c0c21[_0x75d1('0x1f')]){writeLog(_0x526f6c,_0x2c0c21,_0x75d1('0x20'));return![];}if(!_0x2c0c21['online']){writeLog(_0x526f6c,_0x2c0c21,'OFFLINE');return![];}if(_0x2c0c21[_0x5e70ec+_0x75d1('0x21')]){writeLog(_0x526f6c,_0x2c0c21,_0x75d1('0x22'));return![];}if(_0x3a85c0&&_0x2c0c21[_0x75d1('0x23')](_0x5e70ec+_0x75d1('0x24'))&&_0x2c0c21['hasOwnProperty'](_0x5e70ec+_0x75d1('0x25'))){if(_0x2c0c21[_0x5e70ec+_0x75d1('0x24')]>0x0&&_0x2c0c21[_0x5e70ec+_0x75d1('0x25')]>=_0x2c0c21[_0x5e70ec+'Capacity']){writeLog(_0x526f6c,_0x2c0c21,_0x5e70ec['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x75d1('0x26')]=function(_0x30d9f3,_0x45c182,_0x468bf0,_0x38653d,_0x519ceb){return sendNotification(!![],_0x30d9f3,_0x45c182,_0x468bf0,_0x38653d,_0x519ceb);};exports['hideNotification']=function(_0x410e16,_0x197f52,_0x4967b5,_0x2408b6,_0x5aa4fa){return sendNotification(![],_0x410e16,_0x197f52,_0x4967b5,_0x2408b6,_0x5aa4fa);};exports[_0x75d1('0x27')]=writeLog;
\ No newline at end of file
index 87c8bf9..4f98b03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78f0=['error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','shelljs','lodash','./utils','../../../../config/logger','routing','consequence','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x78f0,0x1dc));var _0x078f=function(_0x297d32,_0x118aed){_0x297d32=_0x297d32-0x0;var _0x56bd7a=_0x78f0[_0x297d32];return _0x56bd7a;};'use strict';var schema=require('validate');var sh=require(_0x078f('0x0'));var _=require(_0x078f('0x1'));var utils=require(_0x078f('0x2'));var logger=require(_0x078f('0x3'))(_0x078f('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x078f('0x5')]=function(_0x478069,_0xee699d){return function(_0x201377){try{var _0x14761f={'command':_0xee699d[0x0]};var _0x332899=system['validate'](_0x14761f,{'typecast':!![]});if(_0x332899[_0x078f('0x6')]){logger[_0x078f('0x7')]('[%s][SYSTEM]\x20%s',_0x478069,_[_0x078f('0x8')](_0x332899,_0x078f('0x9'))[_0x078f('0xa')](',\x20'));logger[_0x078f('0xb')](_0x078f('0xc'),_0x478069);_0x201377[_0x078f('0xd')]();}else{var _0x140c07=this;var _0x5f3429=utils['getMustacheRender'](_0xee699d[0x0],this);logger[_0x078f('0xb')](_0x078f('0xe'),_0x478069,_0x5f3429);sh[_0x078f('0xf')](_['trim'](_0x5f3429),function(_0x3b929f,_0x2ce89f){logger[_0x078f('0xb')](_0x078f('0x10'),_0x478069,_0x3b929f);if(_0x3b929f==0x0){var _0x415ded=_0x2ce89f[_0x078f('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0xee699d[0x1])||_[_0x078f('0x12')](_0xee699d[0x1])){logger[_0x078f('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x478069);_0x140c07[_0x078f('0x13')][_0xee699d[0x1]]=_0x415ded;}else{logger[_0x078f('0xb')](_0x078f('0x14'),_0x478069,_0xee699d[0x1],_0x415ded);_0x140c07[_0x078f('0x13')][_0xee699d[0x1]]=_0x415ded;}}_0x201377[_0x078f('0xd')]();});}}catch(_0x5ca9b6){logger[_0x078f('0x7')](_0x078f('0x15'),_0x478069,_[_0x078f('0x16')](_0x5ca9b6)?JSON['stringify'](_0x5ca9b6):_0x5ca9b6);logger[_0x078f('0xb')](_0x078f('0xc'),_0x478069);_0x201377['next']();}};};
\ No newline at end of file
+var _0xedef=['error','map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','info','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x4eb07e,_0x53d900){var _0x3fd2fc=function(_0x11ae95){while(--_0x11ae95){_0x4eb07e['push'](_0x4eb07e['shift']());}};_0x3fd2fc(++_0x53d900);}(_0xedef,0xd6));var _0xfede=function(_0x5693cb,_0x175eda){_0x5693cb=_0x5693cb-0x0;var _0x2e8ebe=_0xedef[_0x5693cb];return _0x2e8ebe;};'use strict';var schema=require(_0xfede('0x0'));var sh=require(_0xfede('0x1'));var _=require(_0xfede('0x2'));var utils=require(_0xfede('0x3'));var logger=require(_0xfede('0x4'))(_0xfede('0x5'));var system=schema({'command':{'type':_0xfede('0x6'),'required':!![],'message':_0xfede('0x7')}});exports[_0xfede('0x8')]=function(_0x41cdde,_0x548e96){return function(_0x56536a){try{var _0x9f50b0={'command':_0x548e96[0x0]};var _0x472284=system['validate'](_0x9f50b0,{'typecast':!![]});if(_0x472284[_0xfede('0x9')]){logger[_0xfede('0xa')]('[%s][SYSTEM]\x20%s',_0x41cdde,_[_0xfede('0xb')](_0x472284,_0xfede('0xc'))['join'](',\x20'));logger['info'](_0xfede('0xd'),_0x41cdde);_0x56536a['next']();}else{var _0x10205d=this;var _0x415c86=utils[_0xfede('0xe')](_0x548e96[0x0],this);logger[_0xfede('0xf')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x41cdde,_0x415c86);sh[_0xfede('0x10')](_[_0xfede('0x11')](_0x415c86),function(_0xa66b95,_0x23a997){logger[_0xfede('0xf')](_0xfede('0x12'),_0x41cdde,_0xa66b95);if(_0xa66b95==0x0){var _0x527772=_0x23a997[_0xfede('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xfede('0x14')](_0x548e96[0x1])||_[_0xfede('0x15')](_0x548e96[0x1])){logger['info'](_0xfede('0x16'),_0x41cdde);_0x10205d['body'][_0x548e96[0x1]]=_0x527772;}else{logger[_0xfede('0xf')](_0xfede('0x17'),_0x41cdde,_0x548e96[0x1],_0x527772);_0x10205d[_0xfede('0x18')][_0x548e96[0x1]]=_0x527772;}}_0x56536a['next']();});}}catch(_0x1ee45a){logger[_0xfede('0xa')]('[%s][SYSTEM]\x20%s',_0x41cdde,_[_0xfede('0x19')](_0x1ee45a)?JSON[_0xfede('0x1a')](_0x1ee45a):_0x1ee45a);logger['info'](_0xfede('0xd'),_0x41cdde);_0x56536a[_0xfede('0x1b')]();}};};
\ No newline at end of file
index 81d896a..cc83e61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6575=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','info','next','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate','lodash'];(function(_0x32df8b,_0x252171){var _0x229e54=function(_0xa383f3){while(--_0xa383f3){_0x32df8b['push'](_0x32df8b['shift']());}};_0x229e54(++_0x252171);}(_0x6575,0xd6));var _0x5657=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6575[_0x3ab51d];return _0x29a04e;};'use strict';var schema=require(_0x5657('0x0'));var _=require(_0x5657('0x1'));var rpc={'chatInteraction':require(_0x5657('0x2')),'openchannelInteraction':require(_0x5657('0x3')),'smsInteraction':require(_0x5657('0x4')),'mailInteraction':require(_0x5657('0x5')),'faxInteraction':require(_0x5657('0x6')),'whatsappInteraction':require(_0x5657('0x7'))};var logger=require(_0x5657('0x8'))('routing');var tag=schema({'tag':{'type':_0x5657('0x9'),'required':!![],'message':_0x5657('0xa')}});exports[_0x5657('0xb')]=function(_0x5878cc,_0x6cedeb,_0x179d74,_0x5d30df){return function(_0x5673a8){try{var _0x4f88c2={'tag':_0x6cedeb[0x0]};var _0x3c4ddd=tag[_0x5657('0x0')](_0x4f88c2,{'typecast':!![]});if(_0x3c4ddd[_0x5657('0xc')]){logger[_0x5657('0xd')](_0x5657('0xe'),_0x5878cc,_[_0x5657('0xf')](_0x3c4ddd,_0x5657('0x10'))['join'](',\x20'));logger[_0x5657('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5878cc);_0x5673a8[_0x5657('0x12')]();}else{var _0x5cf614={'ids':[_0x6cedeb[0x0]]};if(rpc[_0x5d30df[_0x5657('0x13')]+'Interaction']){rpc[_0x5d30df[_0x5657('0x13')]+'Interaction'][_0x5657('0x14')](_0x5d30df[_0x5657('0x15')]['id'],_0x5cf614)[_0x5657('0x16')](function(_0x36e80d){logger[_0x5657('0x11')](_0x5657('0x17'),_0x5878cc,_0x6cedeb[0x1],_0x5d30df[_0x5657('0x13')],_0x5d30df['interaction']['id']);})[_0x5657('0x18')](function(_0x3219cc){logger[_0x5657('0xd')](_0x5657('0xe'),_0x5878cc,JSON[_0x5657('0x19')](_0x3219cc));logger[_0x5657('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5878cc);})['finally'](function(){_0x5673a8['next']();});}}}catch(_0x19332d){logger['error']('[%s][TAG]\x20%s',_0x5878cc,_['isObject'](_0x19332d)?JSON[_0x5657('0x19')](_0x19332d):_0x19332d);logger[_0x5657('0x11')](_0x5657('0x1a'),_0x5878cc);_0x5673a8[_0x5657('0x12')]();}};};
\ No newline at end of file
+var _0xa706=['number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing'];(function(_0x344bbf,_0x49672a){var _0x33afa7=function(_0x49d4fa){while(--_0x49d4fa){_0x344bbf['push'](_0x344bbf['shift']());}};_0x33afa7(++_0x49672a);}(_0xa706,0x19a));var _0x6a70=function(_0xd62bf,_0x3b74f2){_0xd62bf=_0xd62bf-0x0;var _0x503d63=_0xa706[_0xd62bf];return _0x503d63;};'use strict';var schema=require(_0x6a70('0x0'));var _=require(_0x6a70('0x1'));var rpc={'chatInteraction':require(_0x6a70('0x2')),'openchannelInteraction':require(_0x6a70('0x3')),'smsInteraction':require(_0x6a70('0x4')),'mailInteraction':require(_0x6a70('0x5')),'faxInteraction':require(_0x6a70('0x6')),'whatsappInteraction':require(_0x6a70('0x7'))};var logger=require(_0x6a70('0x8'))(_0x6a70('0x9'));var tag=schema({'tag':{'type':_0x6a70('0xa'),'required':!![],'message':_0x6a70('0xb')}});exports[_0x6a70('0xc')]=function(_0x339afc,_0x380fc4,_0x464316,_0x32451e){return function(_0x283a76){try{var _0x5677d2={'tag':_0x380fc4[0x0]};var _0x94f0f5=tag[_0x6a70('0x0')](_0x5677d2,{'typecast':!![]});if(_0x94f0f5[_0x6a70('0xd')]){logger[_0x6a70('0xe')](_0x6a70('0xf'),_0x339afc,_['map'](_0x94f0f5,'message')[_0x6a70('0x10')](',\x20'));logger['info'](_0x6a70('0x11'),_0x339afc);_0x283a76[_0x6a70('0x12')]();}else{var _0x179c16={'ids':[_0x380fc4[0x0]]};if(rpc[_0x32451e['channel']+_0x6a70('0x13')]){rpc[_0x32451e[_0x6a70('0x14')]+_0x6a70('0x13')][_0x6a70('0x15')](_0x32451e[_0x6a70('0x16')]['id'],_0x179c16)[_0x6a70('0x17')](function(_0x38b454){logger[_0x6a70('0x18')](_0x6a70('0x19'),_0x339afc,_0x380fc4[0x1],_0x32451e[_0x6a70('0x14')],_0x32451e[_0x6a70('0x16')]['id']);})[_0x6a70('0x1a')](function(_0x36aafb){logger[_0x6a70('0xe')](_0x6a70('0xf'),_0x339afc,JSON[_0x6a70('0x1b')](_0x36aafb));logger[_0x6a70('0x18')](_0x6a70('0x11'),_0x339afc);})['finally'](function(){_0x283a76[_0x6a70('0x12')]();});}}}catch(_0x50fbcf){logger['error'](_0x6a70('0xf'),_0x339afc,_['isObject'](_0x50fbcf)?JSON[_0x6a70('0x1b')](_0x50fbcf):_0x50fbcf);logger['info'](_0x6a70('0x11'),_0x339afc);_0x283a76[_0x6a70('0x12')]();}};};
\ No newline at end of file
index ddec7d7..fc20413 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ae8=['then','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','\x20-\x20','replace','includes','push','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','2.0','method','login','params','stringify','utf8','POST','application/json-rpc','parse','result','logged','&sessionId='];(function(_0x2f8d43,_0x20f9ff){var _0x2f50fb=function(_0x262630){while(--_0x262630){_0x2f8d43['push'](_0x2f8d43['shift']());}};_0x2f50fb(++_0x20f9ff);}(_0x3ae8,0x106));var _0x83ae=function(_0x5cdc8b,_0x18a296){_0x5cdc8b=_0x5cdc8b-0x0;var _0x39b035=_0x3ae8[_0x5cdc8b];return _0x39b035;};'use strict';var rp=require(_0x83ae('0x0'));var logger=require(_0x83ae('0x1'))(_0x83ae('0x2'));var _=require(_0x83ae('0x3'));var arr=[];exports[_0x83ae('0x4')]=function(_0x55ef65,_0x1c8c1a){return function(_0x2be7c7){var _0x1ec40c=_0x1c8c1a[0xa];var _0x839b14=_0x1c8c1a[0xb];var _0x34184d=_0x1c8c1a[0xc];var _0x481090=_0x1c8c1a[0xd];var _0x27bad1=_0x1c8c1a[0xe];var _0x5cde2c=_0x1c8c1a[0xf]['replace'](/\n/g,_0x83ae('0x5'));var _0x57999d=_0x1c8c1a[0x10][_0x83ae('0x6')](/\n/g,'\x20');if(!arr[_0x83ae('0x7')](_0x839b14)){arr[_0x83ae('0x8')](_0x839b14);var _0x1fbdd9=_0x1c8c1a[0x3];var _0x521fa1=_0x1c8c1a[0x4];var _0xaedd23=_0x1c8c1a[0x1];var _0x9307cd=_0x1c8c1a[0x0];var _0x38310c={};_0x38310c[_0x83ae('0x9')]=_0x1c8c1a[0x8]+'?params='+_0x34184d+'|'+_0x1ec40c+'|'+_0x481090+'|'+_0x839b14+'|'+_0x27bad1;_0x38310c[_0x83ae('0xa')]=_0x1c8c1a[0x7]+_0x83ae('0xb')+_0x34184d+'|'+_0x1ec40c+'|'+_0x481090+'|'+_0x839b14+'|'+_0x27bad1+'|'+_0x5cde2c+'|'+_0x57999d;_0x38310c[_0x83ae('0xc')]=_0x1c8c1a[0x9];var _0x4445b4={};_0x4445b4[_0x83ae('0xd')]=_0x83ae('0xe');_0x4445b4[_0x83ae('0xf')]=_0x83ae('0x10');var _0x163639=[];_0x163639[_0x83ae('0x8')](_0x1c8c1a[0x2]);_0x163639[_0x83ae('0x8')](_0x1c8c1a[0x5]);_0x163639[_0x83ae('0x8')](_0x1c8c1a[0x6]);_0x4445b4[_0x83ae('0x11')]=_0x163639;_0x4445b4['id']=0x1;var _0x3545ce=JSON[_0x83ae('0x12')](_0x4445b4);var _0x2ff087={'encoding':_0x83ae('0x13'),'method':_0x83ae('0x14'),'timeout':0x2710,'url':_0x1fbdd9,'headers':{'Content-Type':_0x83ae('0x15')},'body':_0x3545ce};return rp(_0x2ff087)['then'](function(_0x520e90){const _0x331a7b=JSON[_0x83ae('0x16')](_0x520e90);if(!_0x331a7b[_0x83ae('0x17')][_0x83ae('0x18')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x4bde6b=_0x839b14;var _0x29ac6f='channelId='+_0xaedd23+'&serviceId='+_0x9307cd+_0x83ae('0x19')+_0x4bde6b+'&data='+JSON[_0x83ae('0x12')](_0x38310c);var _0x552987=_0x521fa1+'?'+_0x29ac6f;return rp(_0x552987);})[_0x83ae('0x1a')](function(_0x197a49){logger['info'](_0x83ae('0x1b'),_0x55ef65,_0x197a49);_0x2be7c7['stop']();})[_0x83ae('0x1c')](function(_0x4caba8){logger[_0x83ae('0x1d')](_0x83ae('0x1e'),_0x55ef65,_[_0x83ae('0x1f')](_0x4caba8)?JSON[_0x83ae('0x12')](_0x4caba8):_0x4caba8);_0x2be7c7[_0x83ae('0x20')]();});}else{logger[_0x83ae('0x21')](_0x83ae('0x22'),_0x55ef65);_0x2be7c7[_0x83ae('0x23')]();}};};
\ No newline at end of file
+var _0x7354=['includes','push','?params=','title','jsonrpc','2.0','method','params','stringify','utf8','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','consequence','replace','\x20-\x20'];(function(_0x23e239,_0x46021e){var _0x5e8bac=function(_0x377210){while(--_0x377210){_0x23e239['push'](_0x23e239['shift']());}};_0x5e8bac(++_0x46021e);}(_0x7354,0x1ad));var _0x4735=function(_0x561098,_0xdd1933){_0x561098=_0x561098-0x0;var _0x42701a=_0x7354[_0x561098];return _0x42701a;};'use strict';var rp=require(_0x4735('0x0'));var logger=require(_0x4735('0x1'))(_0x4735('0x2'));var _=require('lodash');var arr=[];exports[_0x4735('0x3')]=function(_0x54da1b,_0x38dfaf){return function(_0x57b9f5){var _0x1f43fe=_0x38dfaf[0xa];var _0x22731d=_0x38dfaf[0xb];var _0x21e6cc=_0x38dfaf[0xc];var _0x35686f=_0x38dfaf[0xd];var _0x3fc201=_0x38dfaf[0xe];var _0xbe8cf2=_0x38dfaf[0xf][_0x4735('0x4')](/\n/g,_0x4735('0x5'));var _0x472f29=_0x38dfaf[0x10][_0x4735('0x4')](/\n/g,'\x20');if(!arr[_0x4735('0x6')](_0x22731d)){arr[_0x4735('0x7')](_0x22731d);var _0x49c5c4=_0x38dfaf[0x3];var _0x7fb358=_0x38dfaf[0x4];var _0xc0edf5=_0x38dfaf[0x1];var _0x117abd=_0x38dfaf[0x0];var _0x4b85e6={};_0x4b85e6['urlOnAnswer']=_0x38dfaf[0x8]+_0x4735('0x8')+_0x21e6cc+'|'+_0x1f43fe+'|'+_0x35686f+'|'+_0x22731d+'|'+_0x3fc201;_0x4b85e6['urlOnRing']=_0x38dfaf[0x7]+'?params='+_0x21e6cc+'|'+_0x1f43fe+'|'+_0x35686f+'|'+_0x22731d+'|'+_0x3fc201+'|'+_0xbe8cf2+'|'+_0x472f29;_0x4b85e6[_0x4735('0x9')]=_0x38dfaf[0x9];var _0x81b326={};_0x81b326[_0x4735('0xa')]=_0x4735('0xb');_0x81b326[_0x4735('0xc')]='login';var _0x343abf=[];_0x343abf[_0x4735('0x7')](_0x38dfaf[0x2]);_0x343abf[_0x4735('0x7')](_0x38dfaf[0x5]);_0x343abf[_0x4735('0x7')](_0x38dfaf[0x6]);_0x81b326[_0x4735('0xd')]=_0x343abf;_0x81b326['id']=0x1;var _0x36c9b0=JSON[_0x4735('0xe')](_0x81b326);var _0x151858={'encoding':_0x4735('0xf'),'method':'POST','timeout':0x2710,'url':_0x49c5c4,'headers':{'Content-Type':'application/json-rpc'},'body':_0x36c9b0};return rp(_0x151858)[_0x4735('0x10')](function(_0x512d86){const _0xc7c6b2=JSON['parse'](_0x512d86);if(!_0xc7c6b2[_0x4735('0x11')][_0x4735('0x12')]){throw new Error(_0x4735('0x13'));}var _0x220724=_0x22731d;var _0x17a56d='channelId='+_0xc0edf5+_0x4735('0x14')+_0x117abd+'&sessionId='+_0x220724+_0x4735('0x15')+JSON[_0x4735('0xe')](_0x4b85e6);var _0xc8cc3e=_0x7fb358+'?'+_0x17a56d;return rp(_0xc8cc3e);})[_0x4735('0x10')](function(_0xed7408){logger['info'](_0x4735('0x16'),_0x54da1b,_0xed7408);_0x57b9f5[_0x4735('0x17')]();})[_0x4735('0x18')](function(_0x3ad552){logger['error'](_0x4735('0x19'),_0x54da1b,_[_0x4735('0x1a')](_0x3ad552)?JSON[_0x4735('0xe')](_0x3ad552):_0x3ad552);_0x57b9f5[_0x4735('0x17')]();});}else{logger[_0x4735('0x1b')](_0x4735('0x1c'),_0x54da1b);_0x57b9f5['next']();}};};
\ No newline at end of file
index 70c2711..497c296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x300046,_0x1e30b1){var _0x53911b=function(_0x1da599){while(--_0x1da599){_0x300046['push'](_0x300046['shift']());}};_0x53911b(++_0x1e30b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}};
\ No newline at end of file
+var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x361632,_0x23de4e){var _0x4031f5=function(_0x8d9e1a){while(--_0x8d9e1a){_0x361632['push'](_0x361632['shift']());}};_0x4031f5(++_0x23de4e);}(_0xe706,0xa3));var _0x6e70=function(_0x265721,_0x1503f2){_0x265721=_0x265721-0x0;var _0x11ec95=_0xe706[_0x265721];return _0x11ec95;};'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
index 31163c9..5185161 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0427=['paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','path','jayson/promise','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','Intervals','map','interval','isNil','listen','message','interaction','applications','length','existsSync','app','.js','appdata','split','channel','push','slice','join','dialogflow','dialogflowv2','amazonlex','tag','tvox','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','./applications/','info','Push\x20new\x20rule','on\x20interval','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','rules','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','chatQueues','available','loggedIn','name'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0427,0x137));var _0x7042=function(_0x517354,_0x463655){_0x517354=_0x517354-0x0;var _0x1bddec=_0x0427[_0x517354];return _0x1bddec;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x7042('0x0'));var fs=require('fs');var jayson=require(_0x7042('0x1'));var BPromise=require('bluebird');var uuid=require(_0x7042('0x2'));var utils=require(_0x7042('0x3'));var config=require(_0x7042('0x4'));var logger=require(_0x7042('0x5'))(_0x7042('0x6'));var rpc={'openchannelQueueReport':require(_0x7042('0x7')),'mailQueueReport':require(_0x7042('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x7042('0x9')),'faxQueueReport':require(_0x7042('0xa')),'whatsappQueueReport':require(_0x7042('0xb'))};var RuleEngine=require(_0x7042('0xc'));function getId(_0x295b19,_0x978169,_0x40caa9){return util[_0x7042('0xd')](_0x7042('0xe'),_0x295b19,_0x978169||0x0,_0x40caa9||0x0);}function getIntervals(_0x5a29aa,_0x326210){var _0x5c3f0f=[];if(!_['isNil'](_0x326210['IntervalId'])&&!_['isNil'](_0x5a29aa[_0x326210[_0x7042('0xf')]])&&!_['isNil'](_0x5a29aa[_0x326210[_0x7042('0xf')]][_0x7042('0x10')])){_0x5c3f0f=_[_0x7042('0x11')](_0x5a29aa[_0x326210['IntervalId']]['Intervals'],_0x7042('0x12'));}else if(!_[_0x7042('0x13')](_0x326210[_0x7042('0x12')])){_0x5c3f0f=[_0x326210[_0x7042('0x12')]];}return _0x5c3f0f;}exports[_0x7042('0x14')]=function(_0xee4c2){_0xee4c2['rules']={};return new BPromise(function(_0x3c8ecd,_0x2c0a32){var _0x6ed505={'Start':function(_0x5c1ef0){var _0x4c68c4=this;return new Promise(function(_0xc7e44e,_0x4de51e){if(_0x5c1ef0){try{var _0x208d0d=[];var _0x590edd=getId(_0x5c1ef0['channel'],_0x5c1ef0[_0x7042('0x15')]?_0x5c1ef0[_0x7042('0x15')]['id']:0x0,_0x5c1ef0[_0x7042('0x16')]?_0x5c1ef0[_0x7042('0x16')]['id']:0x0);if(_0x5c1ef0[_0x7042('0x17')]&&_['isArray'](_0x5c1ef0[_0x7042('0x17')])&&_0x5c1ef0[_0x7042('0x17')][_0x7042('0x18')]){for(var _0x39cfbe=0x0;_0x39cfbe<_0x5c1ef0[_0x7042('0x17')]['length'];_0x39cfbe+=0x1){var _0x462d9c=_0x5c1ef0['applications'][_0x39cfbe];if(fs[_0x7042('0x19')](path['join'](__dirname,_0x7042('0x17'),_0x462d9c[_0x7042('0x1a')]+_0x7042('0x1b')))){var _0x456dfc=[];switch(_0x462d9c['app']['toLowerCase']()){case'autoreply':var _0x62e3d0=_0x462d9c[_0x7042('0x1c')][_0x7042('0x1d')](',');if(_0x5c1ef0[_0x7042('0x1e')]==='mail'){_0x456dfc[_0x7042('0x1f')](_0x62e3d0[0x0]);_0x456dfc[_0x7042('0x1f')](_0x62e3d0[0x1]);_0x456dfc[_0x7042('0x1f')](_0x62e3d0[_0x7042('0x20')](0x2,_0x62e3d0[_0x7042('0x18')])['join'](','));}else{_0x456dfc[_0x7042('0x1f')](_0x62e3d0[0x0]);_0x456dfc[_0x7042('0x1f')](_0x62e3d0[_0x7042('0x20')](0x1,_0x62e3d0[_0x7042('0x18')])[_0x7042('0x21')](','));}break;case _0x7042('0x22'):var _0x162ac7=_0x462d9c[_0x7042('0x1c')][_0x7042('0x1d')](',');_0x456dfc[_0x7042('0x1f')](_0x162ac7[0x0]);_0x456dfc[_0x7042('0x1f')](_0x162ac7[0x1]);_0x456dfc[_0x7042('0x1f')](_0x162ac7[_0x7042('0x20')](0x2,_0x162ac7[_0x7042('0x18')])[_0x7042('0x21')](','));break;case _0x7042('0x23'):var _0x477972=_0x462d9c[_0x7042('0x1c')][_0x7042('0x1d')](',');_0x456dfc['push'](_0x477972[0x0]);_0x456dfc['push'](_0x477972[0x1]);_0x456dfc[_0x7042('0x1f')](_0x477972[0x2]);_0x456dfc[_0x7042('0x1f')](_0x477972[0x3]);_0x456dfc[_0x7042('0x1f')](_0x477972[_0x7042('0x20')](0x4,_0x477972[_0x7042('0x18')])[_0x7042('0x21')](','));break;case _0x7042('0x24'):var _0x52362b=_0x462d9c['appdata'][_0x7042('0x1d')](',');_0x456dfc[_0x7042('0x1f')](_0x52362b[0x0]);_0x456dfc['push'](_0x52362b[0x1]);_0x456dfc[_0x7042('0x1f')](_0x52362b[0x2]);_0x456dfc[_0x7042('0x1f')](_0x52362b[0x3]);_0x456dfc['push'](_0x52362b[_0x7042('0x20')](0x4,_0x52362b[_0x7042('0x18')])[_0x7042('0x21')](','));break;case _0x7042('0x15'):_0x456dfc[_0x7042('0x1f')](_0x462d9c['appdata']);break;case _0x7042('0x25'):_0x456dfc['push'](_0x462d9c['TagId']);_0x456dfc[_0x7042('0x1f')](_0x462d9c['appdata']);break;case _0x7042('0x26'):var _0x28dad1=utils['getMustacheRender'](_0x5c1ef0[_0x7042('0x27')]['notificationTemplate'],_0x5c1ef0);var _0x232c48=_0x462d9c[_0x7042('0x1c')][_0x7042('0x1d')](',');_0x456dfc[_0x7042('0x1f')](_0x232c48[0x0]);_0x456dfc[_0x7042('0x1f')](_0x232c48[0x1]);_0x456dfc[_0x7042('0x1f')](_0x232c48[0x2]);_0x456dfc[_0x7042('0x1f')](_0x232c48[0x3]);_0x456dfc[_0x7042('0x1f')](_0x232c48[0x4]);_0x456dfc[_0x7042('0x1f')](_0x232c48[0x5]);_0x456dfc['push'](_0x232c48[0x6]);_0x456dfc[_0x7042('0x1f')](_0x232c48[0x7]);_0x456dfc[_0x7042('0x1f')](_0x232c48[0x8]);_0x456dfc[_0x7042('0x1f')](_0x232c48[0x9]);_0x456dfc['push'](_0x232c48[0xa]);_0x456dfc['push'](_0x5c1ef0[_0x7042('0x16')]['id']);_0x456dfc[_0x7042('0x1f')](_0x5c1ef0['message']['id']);_0x456dfc[_0x7042('0x1f')](_0x462d9c[_0x7042('0x28')]);_0x456dfc[_0x7042('0x1f')](_0x5c1ef0[_0x7042('0x16')][_0x7042('0x29')]);_0x456dfc[_0x7042('0x1f')](_0x5c1ef0[_0x7042('0x2a')][_0x7042('0x2a')]);_0x456dfc[_0x7042('0x1f')](_0x28dad1);break;default:_0x456dfc=_[_0x7042('0x13')](_0x462d9c[_0x7042('0x1c')])?[]:_0x462d9c[_0x7042('0x1c')][_0x7042('0x1d')](',');}var _0x53a424={'id':util['format'](_0x7042('0x2b'),_0x590edd,_0x462d9c['id'],_0x462d9c[_0x7042('0x1a')]),'condition':require(_0x7042('0x2c'))[_0x7042('0x2d')](_0x590edd,getIntervals(_0xee4c2['intervals'],_0x462d9c),_0xee4c2),'consequence':require(_0x7042('0x2e')+_0x462d9c[_0x7042('0x1a')])['consequence'](_0x590edd,_0x456dfc,_0xee4c2,_0x5c1ef0),'p':_0x462d9c['priority']||0x0};logger[_0x7042('0x2f')](_0x7042('0x30'),_0x53a424['id'],_0x7042('0x31'),getIntervals(_0xee4c2[_0x7042('0x32')],_0x462d9c)[_0x7042('0x21')]('\x20|\x20'));_0x208d0d['push'](_0x53a424);}else{logger[_0x7042('0x33')](_0x7042('0x34'),path['join'](__dirname,_0x7042('0x17'),_0x462d9c[_0x7042('0x1a')]+_0x7042('0x1b')));}}_0xee4c2['rules'][_0x590edd]=new RuleEngine(_0x208d0d);_0xee4c2['rules'][_0x590edd][_0x7042('0x35')](_0x5c1ef0,function(_0x44413e){logger[_0x7042('0x2f')]('Applications\x20executed',JSON[_0x7042('0x36')](_0x44413e[_0x7042('0x37')]));if(_0xee4c2['rules'][_0x590edd]){_0xee4c2[_0x7042('0x38')][_0x590edd][_0x7042('0x39')](_0x7042('0x3a'));}});return _0xc7e44e({'code':0xc8,'message':_0x5c1ef0});}else{logger[_0x7042('0x2f')](_0x7042('0x3b'));return _0xc7e44e({'code':0xc8,'message':_0x5c1ef0});}}catch(_0x3e5f23){logger[_0x7042('0x33')](_0x3e5f23['stack']);return _0x4de51e(_0x4c68c4[_0x7042('0x33')](0x1f4,_0x3e5f23));}}return _0x4de51e(_0x7042('0x3c'));});},'AcceptMessage':function(_0x4cd0a0){var _0x292ebf=this;return new Promise(function(_0xd0d738,_0x3a6730){if(_0x4cd0a0[_0x7042('0x3d')]&&_0x4cd0a0[_0x7042('0x3d')]['id']){if(_0xee4c2[_0x7042('0x3e')][_0x4cd0a0['agent']['id']]){_0xee4c2['agents'][_0x4cd0a0['agent']['id']][_0x7042('0x3f')]=![];_0xee4c2['agents'][_0x4cd0a0['agent']['id']][_0x7042('0x40')]=undefined;}}if(_0x4cd0a0['message']&&_0x4cd0a0[_0x7042('0x15')]['id']){try{var _0x1553e3=getId(_0x4cd0a0[_0x7042('0x1e')],_0x4cd0a0[_0x7042('0x15')]?_0x4cd0a0[_0x7042('0x15')]['id']:0x0,_0x4cd0a0[_0x7042('0x16')]?_0x4cd0a0[_0x7042('0x16')]['id']:0x0);if(_0xee4c2[_0x7042('0x38')][_0x1553e3]){_0xee4c2[_0x7042('0x38')][_0x1553e3][_0x7042('0x39')](_0x7042('0x41'));if(rpc[_0x4cd0a0[_0x7042('0x1e')]+_0x7042('0x42')]){rpc[_0x4cd0a0['channel']+_0x7042('0x42')][_0x7042('0x43')](_0x1553e3,{'UserId':_0x4cd0a0[_0x7042('0x15')][_0x7042('0x44')]})[_0x7042('0x45')](function(_0x288a11){logger[_0x7042('0x33')](_0x7042('0x46'));});}}return _0xd0d738({'code':0xc8,'message':_0x4cd0a0});}catch(_0x3b258d){logger[_0x7042('0x33')](_0x3b258d[_0x7042('0x47')]);return _0x3a6730(_0x292ebf[_0x7042('0x33')](0x1f4,_0x3b258d));}}logger[_0x7042('0x33')]('message\x20is\x20empty');return _0x3a6730(_0x292ebf[_0x7042('0x33')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2cb2da){var _0x1a2b3a=this;return new Promise(function(_0x418794,_0x5a0c85){if(_0x2cb2da['agent']&&_0x2cb2da[_0x7042('0x3d')]['id']){try{if(_0xee4c2[_0x7042('0x3e')][_0x2cb2da[_0x7042('0x3d')]['id']]){_0xee4c2[_0x7042('0x3e')][_0x2cb2da['agent']['id']]['busy']=![];_0xee4c2[_0x7042('0x3e')][_0x2cb2da[_0x7042('0x3d')]['id']]['busyQueue']=undefined;}return _0x418794({'code':0xc8,'message':_0x2cb2da});}catch(_0x382b74){logger[_0x7042('0x33')](_0x382b74['stack']);return _0x5a0c85(_0x1a2b3a[_0x7042('0x33')](0x1f4,_0x382b74));}}logger[_0x7042('0x33')]('message\x20is\x20empty');return _0x5a0c85(_0x1a2b3a[_0x7042('0x33')](0x1f4,_0x7042('0x48')));});},'AbandonInteraction':function(_0x3a437b){var _0x4fad37=this;return new Promise(function(_0xc85038,_0x346760){if(_0x3a437b[_0x7042('0x1e')]&&_0x3a437b[_0x7042('0x16')]&&_0x3a437b[_0x7042('0x16')]['id']){try{var _0x35af12=getId(_0x3a437b[_0x7042('0x1e')],_0x3a437b[_0x7042('0x15')]?_0x3a437b[_0x7042('0x15')]['id']:0x0,_0x3a437b[_0x7042('0x16')]?_0x3a437b[_0x7042('0x16')]['id']:0x0);if(_0xee4c2[_0x7042('0x38')][_0x35af12]){_0xee4c2['rules'][_0x35af12][_0x7042('0x39')](_0x7042('0x41'));}return _0xc85038({'code':0xc8,'message':_0x3a437b});}catch(_0x5d41f6){logger[_0x7042('0x33')](_0x5d41f6[_0x7042('0x47')]);return _0x346760(_0x4fad37[_0x7042('0x33')](0x1f4,_0x5d41f6));}}logger['error'](_0x7042('0x48'));return _0x346760(_0x4fad37[_0x7042('0x33')](0x1f4,_0x7042('0x48')));});},'AgentCapacity':function(_0x4ba034){var _0x13fb0e=this;return new Promise(function(_0x122096,_0x27bf9a){if(_0xee4c2[_0x7042('0x3e')][_0x7042('0x49')](_0x4ba034['id'])){for(var _0x2b50cc in _0x4ba034[_0x7042('0x4a')]){if(_0x4ba034[_0x7042('0x4a')]['hasOwnProperty'](_0x2b50cc)){if(_0xee4c2[_0x7042('0x3e')][_0x4ba034['id']][_0x7042('0x49')](_0x2b50cc+_0x7042('0x4b'))){_0xee4c2[_0x7042('0x3e')][_0x4ba034['id']][_0x2b50cc+_0x7042('0x4b')]=parseInt(_0x4ba034[_0x7042('0x4a')][_0x2b50cc],0xa);}}}_0xee4c2[_0x7042('0x3e')][_0x4ba034['id']]['updateRealtime']();return _0x122096({'code':0xc8,'message':_0xee4c2[_0x7042('0x3e')][_0x4ba034['id']]});}else{return _0x27bf9a(_0x13fb0e['error'](0x1f4,_0x7042('0x4c')));}});},'Agents':function(_0x207995){return new Promise(function(_0x3395f0,_0x8a0a9e){var _0x50f7c5=_['values'](_0xee4c2[_0x7042('0x3e')]);_0x3395f0({'count':_0x50f7c5[_0x7042('0x18')],'rows':_0x50f7c5});});},'ChatQueues':function(_0x4d07f2){return new Promise(function(_0x242abc,_0x412142){var _0x12df51=[];for(var _0x195f08 in _0xee4c2[_0x7042('0x4d')]){if(_0xee4c2[_0x7042('0x4d')][_0x7042('0x49')](_0x195f08)){var _0x221489=_0xee4c2[_0x7042('0x4d')][_0x195f08];var _0x5c14ca={'id':_0x221489['id'],'available':_0x221489[_0x7042('0x4e')],'loggedIn':_0x221489[_0x7042('0x4f')],'name':_0x221489[_0x7042('0x50')],'paused':_0x221489[_0x7042('0x51')],'waiting':_0x221489['waiting']};_0x12df51[_0x7042('0x1f')](_0x5c14ca);}}_0x242abc({'count':_0x12df51['length'],'rows':_0x12df51});});},'MailQueues':function(_0x158338){return new Promise(function(_0x354682,_0x58b669){var _0x5559dc=[];for(var _0x3ca818 in _0xee4c2['mailQueues']){if(_0xee4c2[_0x7042('0x52')][_0x7042('0x49')](_0x3ca818)){var _0x2ae9b2=_0xee4c2['mailQueues'][_0x3ca818];var _0x5ee669={'id':_0x2ae9b2['id'],'available':_0x2ae9b2['available'],'loggedIn':_0x2ae9b2[_0x7042('0x4f')],'name':_0x2ae9b2[_0x7042('0x50')],'paused':_0x2ae9b2['paused'],'waiting':_0x2ae9b2[_0x7042('0x53')]};_0x5559dc[_0x7042('0x1f')](_0x5ee669);}}_0x354682({'count':_0x5559dc[_0x7042('0x18')],'rows':_0x5559dc});});},'OpenchannelQueues':function(_0x4c70f4){return new Promise(function(_0x245201,_0x2cf592){var _0x5a742f=[];for(var _0x57113b in _0xee4c2[_0x7042('0x54')]){if(_0xee4c2['openchannelQueues']['hasOwnProperty'](_0x57113b)){var _0x27273b=_0xee4c2[_0x7042('0x54')][_0x57113b];var _0x43bc0f={'id':_0x27273b['id'],'available':_0x27273b[_0x7042('0x4e')],'loggedIn':_0x27273b[_0x7042('0x4f')],'name':_0x27273b[_0x7042('0x50')],'paused':_0x27273b[_0x7042('0x51')],'waiting':_0x27273b[_0x7042('0x53')]};_0x5a742f['push'](_0x43bc0f);}}_0x245201({'count':_0x5a742f['length'],'rows':_0x5a742f});});},'SmsQueues':function(_0x2e2747){return new Promise(function(_0x3bba1c,_0x1d1e20){var _0x5a5516=[];for(var _0x5671c2 in _0xee4c2[_0x7042('0x55')]){if(_0xee4c2['smsQueues'][_0x7042('0x49')](_0x5671c2)){var _0x1b7396=_0xee4c2[_0x7042('0x55')][_0x5671c2];var _0x49ecd2={'id':_0x1b7396['id'],'available':_0x1b7396[_0x7042('0x4e')],'loggedIn':_0x1b7396[_0x7042('0x4f')],'name':_0x1b7396['name'],'paused':_0x1b7396[_0x7042('0x51')],'waiting':_0x1b7396[_0x7042('0x53')]};_0x5a5516['push'](_0x49ecd2);}}_0x3bba1c({'count':_0x5a5516['length'],'rows':_0x5a5516});});},'FaxQueues':function(_0x383379){return new Promise(function(_0x33f827,_0x4e1909){var _0x18e0e7=[];for(var _0x1baa3c in _0xee4c2[_0x7042('0x56')]){if(_0xee4c2[_0x7042('0x56')][_0x7042('0x49')](_0x1baa3c)){var _0x8fd4ec=_0xee4c2[_0x7042('0x56')][_0x1baa3c];var _0x2c4d6f={'id':_0x8fd4ec['id'],'available':_0x8fd4ec[_0x7042('0x4e')],'loggedIn':_0x8fd4ec[_0x7042('0x4f')],'name':_0x8fd4ec['name'],'paused':_0x8fd4ec[_0x7042('0x51')],'waiting':_0x8fd4ec[_0x7042('0x53')]};_0x18e0e7[_0x7042('0x1f')](_0x2c4d6f);}}_0x33f827({'count':_0x18e0e7[_0x7042('0x18')],'rows':_0x18e0e7});});},'WhatsappQueues':function(_0x4e6ae6){return new Promise(function(_0x34966b,_0xf81376){var _0x4750f2=[];for(var _0x1749fe in _0xee4c2['whatsappQueues']){if(_0xee4c2[_0x7042('0x57')][_0x7042('0x49')](_0x1749fe)){var _0x18d850=_0xee4c2[_0x7042('0x57')][_0x1749fe];var _0x42312b={'id':_0x18d850['id'],'available':_0x18d850['available'],'loggedIn':_0x18d850['loggedIn'],'name':_0x18d850[_0x7042('0x50')],'paused':_0x18d850['paused'],'waiting':_0x18d850[_0x7042('0x53')]};_0x4750f2[_0x7042('0x1f')](_0x42312b);}}_0x34966b({'count':_0x4750f2[_0x7042('0x18')],'rows':_0x4750f2});});},'ChatQueuesWaitingInteractions':function(_0x206afd){return new Promise(function(_0x109c0b,_0x4634a2){var _0x4d9a06=_[_0x7042('0x58')](_0xee4c2['chatQueuesWaitingInteractions']);_0x109c0b({'count':_0x4d9a06[_0x7042('0x18')],'rows':_0x4d9a06});});},'MailQueuesWaitingInteractions':function(_0x377f0a){return new Promise(function(_0x58878d,_0x20a996){var _0x400004=_[_0x7042('0x58')](_0xee4c2[_0x7042('0x59')]);_0x58878d({'count':_0x400004['length'],'rows':_0x400004});});},'OpenchannelQueuesWaitingInteractions':function(_0x2b3fb1){return new Promise(function(_0x462bb5,_0xcebbb8){var _0x19cb17=_[_0x7042('0x58')](_0xee4c2[_0x7042('0x5a')]);_0x462bb5({'count':_0x19cb17[_0x7042('0x18')],'rows':_0x19cb17});});},'SmsQueuesWaitingInteractions':function(_0x356841){return new Promise(function(_0x1d7b93,_0x497380){var _0xa75735=_[_0x7042('0x58')](_0xee4c2[_0x7042('0x5b')]);_0x1d7b93({'count':_0xa75735['length'],'rows':_0xa75735});});},'FaxQueuesWaitingInteractions':function(_0x41fafb){return new Promise(function(_0x4a86de,_0x5e3d0f){var _0x12e55f=_[_0x7042('0x58')](_0xee4c2[_0x7042('0x5c')]);_0x4a86de({'count':_0x12e55f['length'],'rows':_0x12e55f});});},'WhatsappQueuesWaitingInteractions':function(_0x282751){return new Promise(function(_0x2476eb,_0x6676cc){var _0x567967=_[_0x7042('0x58')](_0xee4c2[_0x7042('0x5d')]);_0x2476eb({'count':_0x567967[_0x7042('0x18')],'rows':_0x567967});});}};var _0x231269=jayson[_0x7042('0x5e')](_0x6ed505)[_0x7042('0x5f')]();_0x231269['on'](_0x7042('0x33'),function(_0x55f9f7){logger['error'](JSON[_0x7042('0x36')](_0x55f9f7));return _0x2c0a32(_0x55f9f7);});_0x231269['listen'](0x232c,_0x7042('0x60'),function(){console[_0x7042('0x61')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x3c8ecd('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
+var _0x43c8=['message','interaction','isArray','applications','length','join','.js','app','toLowerCase','split','channel','mail','push','slice','dialogflow','appdata','amazonlex','tag','account','notificationTemplate','ChatWebsiteId','body','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','execute','stringify','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','isNil','IntervalId','Intervals','map','interval','listen','rules'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x43c8,0xaf));var _0x843c=function(_0x3bf619,_0x442781){_0x3bf619=_0x3bf619-0x0;var _0x39a740=_0x43c8[_0x3bf619];return _0x39a740;};'use strict';var _=require('lodash');var util=require(_0x843c('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x843c('0x1'));var BPromise=require(_0x843c('0x2'));var uuid=require(_0x843c('0x3'));var utils=require(_0x843c('0x4'));var config=require(_0x843c('0x5'));var logger=require(_0x843c('0x6'))(_0x843c('0x7'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x843c('0x8')),'chatQueueReport':require(_0x843c('0x9')),'smsQueueReport':require(_0x843c('0xa')),'faxQueueReport':require(_0x843c('0xb')),'whatsappQueueReport':require(_0x843c('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x327327,_0x41f56d,_0x508789){return util[_0x843c('0xd')]('%s.%s.%s',_0x327327,_0x41f56d||0x0,_0x508789||0x0);}function getIntervals(_0x4eed13,_0x204fdb){var _0x5f0005=[];if(!_[_0x843c('0xe')](_0x204fdb[_0x843c('0xf')])&&!_[_0x843c('0xe')](_0x4eed13[_0x204fdb[_0x843c('0xf')]])&&!_['isNil'](_0x4eed13[_0x204fdb[_0x843c('0xf')]][_0x843c('0x10')])){_0x5f0005=_[_0x843c('0x11')](_0x4eed13[_0x204fdb[_0x843c('0xf')]][_0x843c('0x10')],_0x843c('0x12'));}else if(!_[_0x843c('0xe')](_0x204fdb[_0x843c('0x12')])){_0x5f0005=[_0x204fdb[_0x843c('0x12')]];}return _0x5f0005;}exports[_0x843c('0x13')]=function(_0x313947){_0x313947[_0x843c('0x14')]={};return new BPromise(function(_0x2ad766,_0x1c7bc6){var _0x3c67eb={'Start':function(_0x5577ff){var _0x3dc50d=this;return new Promise(function(_0x2c013c,_0x1d92cf){if(_0x5577ff){try{var _0x42558b=[];var _0x16e8f6=getId(_0x5577ff['channel'],_0x5577ff[_0x843c('0x15')]?_0x5577ff[_0x843c('0x15')]['id']:0x0,_0x5577ff[_0x843c('0x16')]?_0x5577ff[_0x843c('0x16')]['id']:0x0);if(_0x5577ff['applications']&&_[_0x843c('0x17')](_0x5577ff[_0x843c('0x18')])&&_0x5577ff[_0x843c('0x18')][_0x843c('0x19')]){for(var _0x1db871=0x0;_0x1db871<_0x5577ff['applications'][_0x843c('0x19')];_0x1db871+=0x1){var _0x5d0920=_0x5577ff[_0x843c('0x18')][_0x1db871];if(fs['existsSync'](path[_0x843c('0x1a')](__dirname,_0x843c('0x18'),_0x5d0920['app']+_0x843c('0x1b')))){var _0x30c897=[];switch(_0x5d0920[_0x843c('0x1c')][_0x843c('0x1d')]()){case'autoreply':var _0x5df320=_0x5d0920['appdata'][_0x843c('0x1e')](',');if(_0x5577ff[_0x843c('0x1f')]===_0x843c('0x20')){_0x30c897[_0x843c('0x21')](_0x5df320[0x0]);_0x30c897[_0x843c('0x21')](_0x5df320[0x1]);_0x30c897[_0x843c('0x21')](_0x5df320[_0x843c('0x22')](0x2,_0x5df320['length'])[_0x843c('0x1a')](','));}else{_0x30c897[_0x843c('0x21')](_0x5df320[0x0]);_0x30c897[_0x843c('0x21')](_0x5df320['slice'](0x1,_0x5df320[_0x843c('0x19')])['join'](','));}break;case _0x843c('0x23'):var _0x1ee7e3=_0x5d0920[_0x843c('0x24')]['split'](',');_0x30c897[_0x843c('0x21')](_0x1ee7e3[0x0]);_0x30c897[_0x843c('0x21')](_0x1ee7e3[0x1]);_0x30c897[_0x843c('0x21')](_0x1ee7e3[_0x843c('0x22')](0x2,_0x1ee7e3[_0x843c('0x19')])[_0x843c('0x1a')](','));break;case'dialogflowv2':var _0xff406d=_0x5d0920['appdata'][_0x843c('0x1e')](',');_0x30c897[_0x843c('0x21')](_0xff406d[0x0]);_0x30c897[_0x843c('0x21')](_0xff406d[0x1]);_0x30c897[_0x843c('0x21')](_0xff406d[0x2]);_0x30c897['push'](_0xff406d[0x3]);_0x30c897[_0x843c('0x21')](_0xff406d[_0x843c('0x22')](0x4,_0xff406d[_0x843c('0x19')])[_0x843c('0x1a')](','));break;case _0x843c('0x25'):var _0x129d46=_0x5d0920[_0x843c('0x24')][_0x843c('0x1e')](',');_0x30c897[_0x843c('0x21')](_0x129d46[0x0]);_0x30c897[_0x843c('0x21')](_0x129d46[0x1]);_0x30c897[_0x843c('0x21')](_0x129d46[0x2]);_0x30c897[_0x843c('0x21')](_0x129d46[0x3]);_0x30c897['push'](_0x129d46[_0x843c('0x22')](0x4,_0x129d46['length'])[_0x843c('0x1a')](','));break;case _0x843c('0x15'):_0x30c897['push'](_0x5d0920[_0x843c('0x24')]);break;case _0x843c('0x26'):_0x30c897[_0x843c('0x21')](_0x5d0920['TagId']);_0x30c897[_0x843c('0x21')](_0x5d0920[_0x843c('0x24')]);break;case'tvox':var _0x3907e3=utils['getMustacheRender'](_0x5577ff[_0x843c('0x27')][_0x843c('0x28')],_0x5577ff);var _0x5676ad=_0x5d0920['appdata'][_0x843c('0x1e')](',');_0x30c897[_0x843c('0x21')](_0x5676ad[0x0]);_0x30c897[_0x843c('0x21')](_0x5676ad[0x1]);_0x30c897[_0x843c('0x21')](_0x5676ad[0x2]);_0x30c897[_0x843c('0x21')](_0x5676ad[0x3]);_0x30c897['push'](_0x5676ad[0x4]);_0x30c897[_0x843c('0x21')](_0x5676ad[0x5]);_0x30c897[_0x843c('0x21')](_0x5676ad[0x6]);_0x30c897[_0x843c('0x21')](_0x5676ad[0x7]);_0x30c897[_0x843c('0x21')](_0x5676ad[0x8]);_0x30c897[_0x843c('0x21')](_0x5676ad[0x9]);_0x30c897[_0x843c('0x21')](_0x5676ad[0xa]);_0x30c897['push'](_0x5577ff[_0x843c('0x16')]['id']);_0x30c897[_0x843c('0x21')](_0x5577ff[_0x843c('0x15')]['id']);_0x30c897[_0x843c('0x21')](_0x5d0920[_0x843c('0x29')]);_0x30c897[_0x843c('0x21')](_0x5577ff[_0x843c('0x16')]['ContactId']);_0x30c897['push'](_0x5577ff[_0x843c('0x2a')][_0x843c('0x2a')]);_0x30c897[_0x843c('0x21')](_0x3907e3);break;default:_0x30c897=_['isNil'](_0x5d0920[_0x843c('0x24')])?[]:_0x5d0920[_0x843c('0x24')][_0x843c('0x1e')](',');}var _0x2083da={'id':util[_0x843c('0xd')]('%s:%s:%s',_0x16e8f6,_0x5d0920['id'],_0x5d0920[_0x843c('0x1c')]),'condition':require(_0x843c('0x2b'))[_0x843c('0x2c')](_0x16e8f6,getIntervals(_0x313947[_0x843c('0x2d')],_0x5d0920),_0x313947),'consequence':require(_0x843c('0x2e')+_0x5d0920[_0x843c('0x1c')])[_0x843c('0x2f')](_0x16e8f6,_0x30c897,_0x313947,_0x5577ff),'p':_0x5d0920[_0x843c('0x30')]||0x0};logger[_0x843c('0x31')](_0x843c('0x32'),_0x2083da['id'],_0x843c('0x33'),getIntervals(_0x313947[_0x843c('0x2d')],_0x5d0920)[_0x843c('0x1a')](_0x843c('0x34')));_0x42558b[_0x843c('0x21')](_0x2083da);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x843c('0x18'),_0x5d0920['app']+_0x843c('0x1b')));}}_0x313947[_0x843c('0x14')][_0x16e8f6]=new RuleEngine(_0x42558b);_0x313947['rules'][_0x16e8f6][_0x843c('0x35')](_0x5577ff,function(_0x5690a2){logger['info']('Applications\x20executed',JSON[_0x843c('0x36')](_0x5690a2['matchPath']));if(_0x313947[_0x843c('0x14')][_0x16e8f6]){_0x313947[_0x843c('0x14')][_0x16e8f6]['emit']('complete');}});return _0x2c013c({'code':0xc8,'message':_0x5577ff});}else{logger[_0x843c('0x31')](_0x843c('0x37'));return _0x2c013c({'code':0xc8,'message':_0x5577ff});}}catch(_0x2c5800){logger[_0x843c('0x38')](_0x2c5800[_0x843c('0x39')]);return _0x1d92cf(_0x3dc50d['error'](0x1f4,_0x2c5800));}}return _0x1d92cf(_0x843c('0x3a'));});},'AcceptMessage':function(_0x56c51e){var _0x3e9a75=this;return new Promise(function(_0x2551e3,_0x2222a8){if(_0x56c51e[_0x843c('0x3b')]&&_0x56c51e[_0x843c('0x3b')]['id']){if(_0x313947[_0x843c('0x3c')][_0x56c51e[_0x843c('0x3b')]['id']]){_0x313947[_0x843c('0x3c')][_0x56c51e[_0x843c('0x3b')]['id']][_0x843c('0x3d')]=![];_0x313947[_0x843c('0x3c')][_0x56c51e[_0x843c('0x3b')]['id']][_0x843c('0x3e')]=undefined;}}if(_0x56c51e[_0x843c('0x15')]&&_0x56c51e[_0x843c('0x15')]['id']){try{var _0x1c6eef=getId(_0x56c51e[_0x843c('0x1f')],_0x56c51e['message']?_0x56c51e[_0x843c('0x15')]['id']:0x0,_0x56c51e[_0x843c('0x16')]?_0x56c51e[_0x843c('0x16')]['id']:0x0);if(_0x313947[_0x843c('0x14')][_0x1c6eef]){_0x313947[_0x843c('0x14')][_0x1c6eef]['emit'](_0x843c('0x3f'));if(rpc[_0x56c51e['channel']+_0x843c('0x40')]){rpc[_0x56c51e['channel']+_0x843c('0x40')][_0x843c('0x41')](_0x1c6eef,{'UserId':_0x56c51e[_0x843c('0x15')][_0x843c('0x42')]})[_0x843c('0x43')](function(_0x2236d1){logger[_0x843c('0x38')](_0x843c('0x44'));});}}return _0x2551e3({'code':0xc8,'message':_0x56c51e});}catch(_0x14b257){logger[_0x843c('0x38')](_0x14b257['stack']);return _0x2222a8(_0x3e9a75[_0x843c('0x38')](0x1f4,_0x14b257));}}logger[_0x843c('0x38')](_0x843c('0x45'));return _0x2222a8(_0x3e9a75[_0x843c('0x38')](0x1f4,_0x843c('0x45')));});},'RejectMessage':function(_0x1f7f5d){var _0x3da0f7=this;return new Promise(function(_0x428884,_0x29fe16){if(_0x1f7f5d[_0x843c('0x3b')]&&_0x1f7f5d['agent']['id']){try{if(_0x313947[_0x843c('0x3c')][_0x1f7f5d[_0x843c('0x3b')]['id']]){_0x313947[_0x843c('0x3c')][_0x1f7f5d['agent']['id']][_0x843c('0x3d')]=![];_0x313947[_0x843c('0x3c')][_0x1f7f5d[_0x843c('0x3b')]['id']][_0x843c('0x3e')]=undefined;}return _0x428884({'code':0xc8,'message':_0x1f7f5d});}catch(_0x3d2d2d){logger[_0x843c('0x38')](_0x3d2d2d[_0x843c('0x39')]);return _0x29fe16(_0x3da0f7[_0x843c('0x38')](0x1f4,_0x3d2d2d));}}logger['error']('message\x20is\x20empty');return _0x29fe16(_0x3da0f7[_0x843c('0x38')](0x1f4,_0x843c('0x45')));});},'AbandonInteraction':function(_0x33cbd5){var _0x550197=this;return new Promise(function(_0x124701,_0x2eec34){if(_0x33cbd5[_0x843c('0x1f')]&&_0x33cbd5[_0x843c('0x16')]&&_0x33cbd5[_0x843c('0x16')]['id']){try{var _0x55803e=getId(_0x33cbd5[_0x843c('0x1f')],_0x33cbd5['message']?_0x33cbd5[_0x843c('0x15')]['id']:0x0,_0x33cbd5[_0x843c('0x16')]?_0x33cbd5[_0x843c('0x16')]['id']:0x0);if(_0x313947[_0x843c('0x14')][_0x55803e]){_0x313947[_0x843c('0x14')][_0x55803e]['emit'](_0x843c('0x3f'));}return _0x124701({'code':0xc8,'message':_0x33cbd5});}catch(_0x4f93a2){logger[_0x843c('0x38')](_0x4f93a2[_0x843c('0x39')]);return _0x2eec34(_0x550197['error'](0x1f4,_0x4f93a2));}}logger[_0x843c('0x38')](_0x843c('0x45'));return _0x2eec34(_0x550197[_0x843c('0x38')](0x1f4,_0x843c('0x45')));});},'AgentCapacity':function(_0x3d8da1){var _0xcb8c8=this;return new Promise(function(_0x1e4073,_0x616e4f){if(_0x313947[_0x843c('0x3c')]['hasOwnProperty'](_0x3d8da1['id'])){for(var _0xede000 in _0x3d8da1[_0x843c('0x46')]){if(_0x3d8da1['capacity'][_0x843c('0x47')](_0xede000)){if(_0x313947[_0x843c('0x3c')][_0x3d8da1['id']]['hasOwnProperty'](_0xede000+_0x843c('0x48'))){_0x313947[_0x843c('0x3c')][_0x3d8da1['id']][_0xede000+_0x843c('0x48')]=parseInt(_0x3d8da1['capacity'][_0xede000],0xa);}}}_0x313947['agents'][_0x3d8da1['id']][_0x843c('0x49')]();return _0x1e4073({'code':0xc8,'message':_0x313947['agents'][_0x3d8da1['id']]});}else{return _0x616e4f(_0xcb8c8[_0x843c('0x38')](0x1f4,_0x843c('0x4a')));}});},'Agents':function(_0x357d82){return new Promise(function(_0x1098d0,_0x30ea9a){var _0x31a4c5=_[_0x843c('0x4b')](_0x313947[_0x843c('0x3c')]);_0x1098d0({'count':_0x31a4c5[_0x843c('0x19')],'rows':_0x31a4c5});});},'ChatQueues':function(_0x5e43bf){return new Promise(function(_0x1bd68f,_0x5e4880){var _0x1bdf14=[];for(var _0x49d091 in _0x313947[_0x843c('0x4c')]){if(_0x313947[_0x843c('0x4c')][_0x843c('0x47')](_0x49d091)){var _0x426426=_0x313947['chatQueues'][_0x49d091];var _0xbf1c81={'id':_0x426426['id'],'available':_0x426426[_0x843c('0x4d')],'loggedIn':_0x426426[_0x843c('0x4e')],'name':_0x426426['name'],'paused':_0x426426[_0x843c('0x4f')],'waiting':_0x426426[_0x843c('0x50')]};_0x1bdf14[_0x843c('0x21')](_0xbf1c81);}}_0x1bd68f({'count':_0x1bdf14[_0x843c('0x19')],'rows':_0x1bdf14});});},'MailQueues':function(_0x53d1dc){return new Promise(function(_0x16983d,_0x3d3fb9){var _0x50db50=[];for(var _0x1e1e04 in _0x313947['mailQueues']){if(_0x313947[_0x843c('0x51')][_0x843c('0x47')](_0x1e1e04)){var _0xfb882=_0x313947['mailQueues'][_0x1e1e04];var _0x4770da={'id':_0xfb882['id'],'available':_0xfb882['available'],'loggedIn':_0xfb882[_0x843c('0x4e')],'name':_0xfb882[_0x843c('0x52')],'paused':_0xfb882[_0x843c('0x4f')],'waiting':_0xfb882[_0x843c('0x50')]};_0x50db50[_0x843c('0x21')](_0x4770da);}}_0x16983d({'count':_0x50db50[_0x843c('0x19')],'rows':_0x50db50});});},'OpenchannelQueues':function(_0x398b65){return new Promise(function(_0x3a8572,_0x42c84f){var _0x6779d1=[];for(var _0xfc619a in _0x313947[_0x843c('0x53')]){if(_0x313947[_0x843c('0x53')][_0x843c('0x47')](_0xfc619a)){var _0x1dd5f7=_0x313947[_0x843c('0x53')][_0xfc619a];var _0x3a449c={'id':_0x1dd5f7['id'],'available':_0x1dd5f7[_0x843c('0x4d')],'loggedIn':_0x1dd5f7[_0x843c('0x4e')],'name':_0x1dd5f7[_0x843c('0x52')],'paused':_0x1dd5f7[_0x843c('0x4f')],'waiting':_0x1dd5f7[_0x843c('0x50')]};_0x6779d1[_0x843c('0x21')](_0x3a449c);}}_0x3a8572({'count':_0x6779d1['length'],'rows':_0x6779d1});});},'SmsQueues':function(_0x191941){return new Promise(function(_0x5113c6,_0x875262){var _0x323f27=[];for(var _0x478e8f in _0x313947['smsQueues']){if(_0x313947['smsQueues'][_0x843c('0x47')](_0x478e8f)){var _0x35a2ce=_0x313947[_0x843c('0x54')][_0x478e8f];var _0x4f6deb={'id':_0x35a2ce['id'],'available':_0x35a2ce[_0x843c('0x4d')],'loggedIn':_0x35a2ce[_0x843c('0x4e')],'name':_0x35a2ce[_0x843c('0x52')],'paused':_0x35a2ce[_0x843c('0x4f')],'waiting':_0x35a2ce[_0x843c('0x50')]};_0x323f27['push'](_0x4f6deb);}}_0x5113c6({'count':_0x323f27[_0x843c('0x19')],'rows':_0x323f27});});},'FaxQueues':function(_0x2846b2){return new Promise(function(_0xcebebe,_0x125b6c){var _0x5e98c8=[];for(var _0x454054 in _0x313947['faxQueues']){if(_0x313947['faxQueues'][_0x843c('0x47')](_0x454054)){var _0x124db5=_0x313947[_0x843c('0x55')][_0x454054];var _0x41b16a={'id':_0x124db5['id'],'available':_0x124db5['available'],'loggedIn':_0x124db5['loggedIn'],'name':_0x124db5[_0x843c('0x52')],'paused':_0x124db5[_0x843c('0x4f')],'waiting':_0x124db5[_0x843c('0x50')]};_0x5e98c8[_0x843c('0x21')](_0x41b16a);}}_0xcebebe({'count':_0x5e98c8[_0x843c('0x19')],'rows':_0x5e98c8});});},'WhatsappQueues':function(_0x17295a){return new Promise(function(_0x43b137,_0x41b975){var _0x31b7a6=[];for(var _0x3a5965 in _0x313947[_0x843c('0x56')]){if(_0x313947[_0x843c('0x56')][_0x843c('0x47')](_0x3a5965)){var _0x43a502=_0x313947[_0x843c('0x56')][_0x3a5965];var _0x319564={'id':_0x43a502['id'],'available':_0x43a502[_0x843c('0x4d')],'loggedIn':_0x43a502[_0x843c('0x4e')],'name':_0x43a502[_0x843c('0x52')],'paused':_0x43a502['paused'],'waiting':_0x43a502['waiting']};_0x31b7a6[_0x843c('0x21')](_0x319564);}}_0x43b137({'count':_0x31b7a6[_0x843c('0x19')],'rows':_0x31b7a6});});},'ChatQueuesWaitingInteractions':function(_0x3fc7fa){return new Promise(function(_0x5a891c,_0x5432b2){var _0x512049=_[_0x843c('0x4b')](_0x313947[_0x843c('0x57')]);_0x5a891c({'count':_0x512049[_0x843c('0x19')],'rows':_0x512049});});},'MailQueuesWaitingInteractions':function(_0x3ad05d){return new Promise(function(_0x55986f,_0x56d264){var _0x3c908d=_[_0x843c('0x4b')](_0x313947[_0x843c('0x58')]);_0x55986f({'count':_0x3c908d[_0x843c('0x19')],'rows':_0x3c908d});});},'OpenchannelQueuesWaitingInteractions':function(_0x131764){return new Promise(function(_0x511a26,_0x309ab8){var _0x39212a=_['values'](_0x313947[_0x843c('0x59')]);_0x511a26({'count':_0x39212a[_0x843c('0x19')],'rows':_0x39212a});});},'SmsQueuesWaitingInteractions':function(_0x20de30){return new Promise(function(_0x38d6cc,_0x4ba2b7){var _0x12c8b9=_[_0x843c('0x4b')](_0x313947['smsQueuesWaitingInteractions']);_0x38d6cc({'count':_0x12c8b9['length'],'rows':_0x12c8b9});});},'FaxQueuesWaitingInteractions':function(_0x383d9d){return new Promise(function(_0x24edde,_0x2f0a8e){var _0x58cc86=_[_0x843c('0x4b')](_0x313947[_0x843c('0x5a')]);_0x24edde({'count':_0x58cc86['length'],'rows':_0x58cc86});});},'WhatsappQueuesWaitingInteractions':function(_0x519914){return new Promise(function(_0x3d9d34,_0x571893){var _0x2b5eae=_[_0x843c('0x4b')](_0x313947[_0x843c('0x5b')]);_0x3d9d34({'count':_0x2b5eae[_0x843c('0x19')],'rows':_0x2b5eae});});}};var _0x72f77=jayson[_0x843c('0x5c')](_0x3c67eb)[_0x843c('0x5d')]();_0x72f77['on']('error',function(_0x36bb53){logger['error'](JSON[_0x843c('0x36')](_0x36bb53));return _0x1c7bc6(_0x36bb53);});_0x72f77[_0x843c('0x13')](0x232c,_0x843c('0x5e'),function(){console[_0x843c('0x5f')](_0x843c('0x60'),0x232c);return _0x2ad766(_0x843c('0x61')+0x232c);});});};
\ No newline at end of file
index 374a45c..b4b739d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66c7=['jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','Command','format','indexOf','true','error','all','some','info','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x66c7,0x1d0));var _0x766c=function(_0x2849bd,_0x166aaf){_0x2849bd=_0x2849bd-0x0;var _0x4ed88a=_0x66c7[_0x2849bd];return _0x4ed88a;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x766c('0x0'));var _=require(_0x766c('0x1'));var logger=require(_0x766c('0x2'))(_0x766c('0x3'));var client=jayson[_0x766c('0x4')][_0x766c('0x5')]({'port':0x232a});function request(_0x1e7858,_0x14e2b7){return new BPromise(function(_0x4db3be,_0x1d907e){return client[_0x766c('0x6')](_0x1e7858,_0x14e2b7)[_0x766c('0x7')](function(_0x10b8d7){if(_0x10b8d7['error']){return _0x1d907e(_0x10b8d7['error'][_0x766c('0x8')]);}else{return _0x4db3be(_0x10b8d7[_0x766c('0x9')]);}})[_0x766c('0xa')](function(_0x3818e4){return _0x1d907e(_0x3818e4);});});}exports[_0x766c('0xb')]=function(_0x485a4f,_0x187b01,_0x211872){return function(_0x10078c){if(_0x211872[_0x766c('0xc')]&&!_0x211872['rules'][_0x485a4f]){logger['info'](_0x766c('0xd'),_0x485a4f);return _0x10078c['stop']();}var _0x14a4c6=[];for(var _0x2874af=0x0;_0x2874af<_0x187b01['length'];_0x2874af+=0x1){_0x14a4c6[_0x766c('0xe')](request(_0x766c('0xf'),{'command':util[_0x766c('0x10')]('iftime\x20%s',_0x187b01[_0x2874af])})['then'](function(_0x5cc185){return _0x5cc185&&_0x5cc185[_0x766c('0x8')]&&_0x5cc185[_0x766c('0x8')][_0x766c('0x11')](_0x766c('0x12'))>=0x0?!![]:![];})[_0x766c('0xa')](function(_0x6d047a){logger[_0x766c('0x13')]('[%s][INTERVAL]\x20%s',_0x485a4f,_0x187b01[_0x2874af]);}));}BPromise[_0x766c('0x14')](_0x14a4c6)[_0x766c('0x7')](function(_0x16185e){var _0x5b1320=_[_0x766c('0x15')](_0x16185e);logger[_0x766c('0x16')](_0x766c('0x17'),_0x485a4f,_0x187b01['join'](_0x766c('0x18')),_0x5b1320);_0x10078c[_0x766c('0x19')](_0x5b1320);})[_0x766c('0xa')](function(_0x5cc151){console[_0x766c('0x1a')](_0x5cc151);logger[_0x766c('0x13')](_0x766c('0x17'),_0x485a4f,_0x187b01[_0x766c('0x1b')](_0x766c('0x18')),_0x5cc151[_0x766c('0x1c')]);_0x10078c['stop']();});};};
\ No newline at end of file
+var _0xf559=['info','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some'];(function(_0xe71e4d,_0x5da390){var _0x3f5dc8=function(_0x5b495a){while(--_0x5b495a){_0xe71e4d['push'](_0xe71e4d['shift']());}};_0x3f5dc8(++_0x5da390);}(_0xf559,0x1e3));var _0x9f55=function(_0xba7f9a,_0x3b4c45){_0xba7f9a=_0xba7f9a-0x0;var _0x3541f4=_0xf559[_0xba7f9a];return _0x3541f4;};'use strict';var util=require(_0x9f55('0x0'));var BPromise=require(_0x9f55('0x1'));var jayson=require(_0x9f55('0x2'));var _=require(_0x9f55('0x3'));var logger=require(_0x9f55('0x4'))(_0x9f55('0x5'));var client=jayson[_0x9f55('0x6')][_0x9f55('0x7')]({'port':0x232a});function request(_0xd1e8eb,_0x58a969){return new BPromise(function(_0x10ad2c,_0x211993){return client[_0x9f55('0x8')](_0xd1e8eb,_0x58a969)[_0x9f55('0x9')](function(_0x3e0761){if(_0x3e0761['error']){return _0x211993(_0x3e0761[_0x9f55('0xa')]['message']);}else{return _0x10ad2c(_0x3e0761[_0x9f55('0xb')]);}})[_0x9f55('0xc')](function(_0x56bba2){return _0x211993(_0x56bba2);});});}exports[_0x9f55('0xd')]=function(_0x56981a,_0x3c815b,_0x3182cb){return function(_0x54acc9){if(_0x3182cb['rules']&&!_0x3182cb[_0x9f55('0xe')][_0x56981a]){logger['info'](_0x9f55('0xf'),_0x56981a);return _0x54acc9[_0x9f55('0x10')]();}var _0x5c3850=[];for(var _0x5f214a=0x0;_0x5f214a<_0x3c815b[_0x9f55('0x11')];_0x5f214a+=0x1){_0x5c3850[_0x9f55('0x12')](request('Command',{'command':util[_0x9f55('0x13')](_0x9f55('0x14'),_0x3c815b[_0x5f214a])})['then'](function(_0x59366d){return _0x59366d&&_0x59366d[_0x9f55('0x15')]&&_0x59366d[_0x9f55('0x15')][_0x9f55('0x16')](_0x9f55('0x17'))>=0x0?!![]:![];})[_0x9f55('0xc')](function(_0x1eab19){logger[_0x9f55('0xa')](_0x9f55('0x18'),_0x56981a,_0x3c815b[_0x5f214a]);}));}BPromise[_0x9f55('0x19')](_0x5c3850)['then'](function(_0x4f9815){var _0xc2644b=_[_0x9f55('0x1a')](_0x4f9815);logger[_0x9f55('0x1b')]('[%s][INTERVAL]\x20%s\x20%s',_0x56981a,_0x3c815b[_0x9f55('0x1c')](_0x9f55('0x1d')),_0xc2644b);_0x54acc9[_0x9f55('0x1e')](_0xc2644b);})['catch'](function(_0x1396df){console[_0x9f55('0x1f')](_0x1396df);logger['error'](_0x9f55('0x20'),_0x56981a,_0x3c815b[_0x9f55('0x1c')](_0x9f55('0x1d')),_0x1396df[_0x9f55('0x21')]);_0x54acc9['stop']();});};};
\ No newline at end of file
index 1075a61..109819f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0102=['agentringnoanswerAt','now','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','util','./utils','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]'];(function(_0x37deef,_0xbf2cf8){var _0x490516=function(_0xe9e835){while(--_0xe9e835){_0x37deef['push'](_0x37deef['shift']());}};_0x490516(++_0xbf2cf8);}(_0x0102,0x186));var _0x2010=function(_0x4a7b7b,_0x24c6a3){_0x4a7b7b=_0x4a7b7b-0x0;var _0x37c4b2=_0x0102[_0x4a7b7b];return _0x37c4b2;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var utils=require(_0x2010('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x34c31e,_0x9ae519){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x34c31e['uniqueid'],_0x34c31e['channel'],_0x34c31e[_0x2010('0x2')],_0x34c31e[_0x2010('0x3')],_0x34c31e[_0x2010('0x4')],_0x34c31e[_0x2010('0x5')],_0x34c31e['connectedlinenum'],_0x34c31e[_0x2010('0x6')]));if(_0x34c31e['queue']){utils[_0x2010('0x7')](_0x34c31e[_0x2010('0x2')])['then'](function(_0x1f94ca){if(_0x1f94ca){_0x34c31e[_0x2010('0x8')]=_0x1f94ca[_0x2010('0x8')];_0x34c31e[_0x2010('0x9')]=_0x34c31e[_0x2010('0xa')]?_0x1f94ca[_0x2010('0xb')]:![];_0x34c31e[_0x2010('0xc')]=_0x34c31e[_0x2010('0x9')]?_0x1f94ca[_0x2010('0xd')]:0x0;}utils[_0x2010('0xe')](_0x2010('0xf'),_0x34c31e);});}else{utils[_0x2010('0xe')](_0x2010('0xf'),_0x34c31e);}if(_0x9ae519){delete transfers[_0x34c31e[_0x2010('0x10')]];}else{delete agents[_0x34c31e[_0x2010('0x11')]];}}exports[_0x2010('0x12')]=function(_0x528a38){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x14'),_0x528a38[_0x2010('0x10')]),_0x528a38);agents[_0x528a38[_0x2010('0x11')]]=_0x528a38;agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x15')]=utils['now']();agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x6')]='called';agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x16')]=null;agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x17')]=null;utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x19'),_0x528a38[_0x2010('0x10')],agents[_0x528a38[_0x2010('0x11')]]['membername'],_0x528a38['destuniqueid']));}catch(_0x3c72a8){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x14'),_0x528a38['uniqueid']),_0x3c72a8);}};exports['agentringnoanswer']=function(_0x22c252){try{if(!_[_0x2010('0x1b')](agents[_0x22c252[_0x2010('0x11')]])){utils[_0x2010('0x1c')](util[_0x2010('0x13')](_0x2010('0x1d'),_0x22c252['uniqueid']),_0x22c252);utils[_0x2010('0x18')](util[_0x2010('0x13')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x22c252['uniqueid'],agents[_0x22c252['destuniqueid']][_0x2010('0x3')],_0x22c252['destuniqueid']));agents[_0x22c252[_0x2010('0x11')]]['agentringnoanswer']=!![];agents[_0x22c252['destuniqueid']][_0x2010('0x1e')]=utils[_0x2010('0x1f')]();agents[_0x22c252['destuniqueid']][_0x2010('0x6')]='timeout';agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x20')]=_0x2010('0x21');agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x22')]=_0x22c252[_0x2010('0x23')]?parseInt(_0x22c252[_0x2010('0x23')])/0x3e8:0x0;agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x24')]=0x0;unanswered[_0x2010('0x25')](_0x22c252[_0x2010('0x11')]);}}catch(_0x2ebdbb){utils['error'](util[_0x2010('0x13')]('[%s][agents][agentringnoanswer]',_0x22c252[_0x2010('0x10')]),_0x2ebdbb);}};exports[_0x2010('0x26')]=function(_0xd16c04){try{_[_0x2010('0x27')](agents,function(_0x564a64,_0x554f66){if(_0x564a64[_0x2010('0x10')]==_0xd16c04['uniqueid']&&!_[_0x2010('0x28')](unanswered,_0x564a64[_0x2010('0x11')])){utils['debug'](util[_0x2010('0x13')](_0x2010('0x29'),_0xd16c04[_0x2010('0x10')]),_0xd16c04);utils[_0x2010('0x18')](util[_0x2010('0x13')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0xd16c04[_0x2010('0x10')],_0x564a64[_0x2010('0x3')],_0x564a64[_0x2010('0x11')]));_0x564a64['agentringnoanswer']=!![];_0x564a64['agentringnoanswerAt']=utils[_0x2010('0x1f')]();_0x564a64[_0x2010('0x6')]=_0x2010('0x2a');_0x564a64['reason']='abandoned';_0x564a64[_0x2010('0x22')]=_0xd16c04[_0x2010('0x22')];_0x564a64[_0x2010('0x24')]=0x0;writeDB(_0x564a64);}});}catch(_0x339fd2){utils[_0x2010('0x1a')](util['format']('[%s][agents][queuecallerabandon]',_0xd16c04['uniqueid']),_0x339fd2);}};exports[_0x2010('0x2b')]=function(_0x447eed){try{if(agents[_0x447eed[_0x2010('0x11')]]){utils['debug'](util[_0x2010('0x13')](_0x2010('0x2c'),_0x447eed[_0x2010('0x10')]),_0x447eed);utils[_0x2010('0x18')](util['format'](_0x2010('0x2d'),_0x447eed[_0x2010('0x10')],agents[_0x447eed[_0x2010('0x11')]]['membername'],_0x447eed[_0x2010('0x11')]));agents[_0x447eed['destuniqueid']][_0x2010('0x2e')]=utils[_0x2010('0x1f')]();agents[_0x447eed[_0x2010('0x11')]][_0x2010('0x16')]=_0x447eed[_0x2010('0x16')];agents[_0x447eed[_0x2010('0x11')]]['connectedlinename']=_0x447eed[_0x2010('0x17')];agents[_0x447eed['destuniqueid']][_0x2010('0x22')]=_0x447eed[_0x2010('0x23')];agents[_0x447eed[_0x2010('0x11')]][_0x2010('0x6')]=_0x2010('0x2f');_[_0x2010('0x27')](agents,function(_0x398f10,_0x36ff3e){if(_0x398f10[_0x2010('0x11')]!=_0x447eed[_0x2010('0x11')]&&_0x398f10[_0x2010('0x10')]==_0x447eed[_0x2010('0x10')]){_0x398f10[_0x2010('0x24')]=0x0;_0x398f10[_0x2010('0x22')]=_0x447eed['ringtime'];_0x398f10['agentringnoanswer']=!![];_0x398f10[_0x2010('0x1e')]=utils[_0x2010('0x1f')]();_0x398f10[_0x2010('0x6')]=_0x2010('0x30');_0x398f10[_0x2010('0x20')]=_0x2010('0x30');_0x398f10[_0x2010('0x31')]=_0x447eed['destuniqueid'];_0x398f10[_0x2010('0x32')]=_0x447eed['membername'];writeDB(_0x398f10);}});}}catch(_0x27fd64){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x2c'),_0x447eed[_0x2010('0x10')]),_0x27fd64);}};exports['agentcomplete']=function(_0x364338){try{if(!_[_0x2010('0x1b')](agents[_0x364338[_0x2010('0x11')]])){utils[_0x2010('0x1c')](util['format'](_0x2010('0x33'),_0x364338['uniqueid']),_0x364338);utils['info'](util['format'](_0x2010('0x34'),_0x364338[_0x2010('0x10')],agents[_0x364338[_0x2010('0x11')]][_0x2010('0x3')],_0x364338[_0x2010('0x11')]));agents[_0x364338[_0x2010('0x11')]]['agentcomplete']=!![];agents[_0x364338[_0x2010('0x11')]][_0x2010('0x35')]=utils[_0x2010('0x1f')]();agents[_0x364338['destuniqueid']]['talktime']=utils[_0x2010('0x36')](agents[_0x364338['destuniqueid']][_0x2010('0x35')],agents[_0x364338[_0x2010('0x11')]][_0x2010('0x2e')]);agents[_0x364338[_0x2010('0x11')]]['reason']=_0x364338[_0x2010('0x20')];agents[_0x364338[_0x2010('0x11')]][_0x2010('0x6')]=_0x2010('0x37');writeDB(agents[_0x364338[_0x2010('0x11')]]);}}catch(_0x2a53b3){utils['error'](util[_0x2010('0x13')](_0x2010('0x33'),_0x364338[_0x2010('0x10')]),_0x2a53b3);}};exports['blindtransfer']=function(_0x30e5d0){try{if(!_[_0x2010('0x1b')](agents[_0x30e5d0['transfereruniqueid']])){utils[_0x2010('0x1c')](util[_0x2010('0x13')](_0x2010('0x38'),_0x30e5d0[_0x2010('0x10')]),_0x30e5d0);utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x39'),_0x30e5d0[_0x2010('0x10')],agents[_0x30e5d0['transfereruniqueid']]['membername'],agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x10')]));agents[_0x30e5d0['transfereruniqueid']][_0x2010('0x3b')]=!![];agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x3c')]=_0x2010('0x3d');agents[_0x30e5d0[_0x2010('0x3a')]]['transferexten']=_0x30e5d0['extension'];agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x3e')]=agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x10')];}}catch(_0x38e596){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x38'),_0x30e5d0[_0x2010('0x10')]),_0x38e596);}};exports[_0x2010('0x3f')]=function(_0x1cc164){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x40'),_0x1cc164['origtransfereruniqueid']),_0x1cc164);if(_0x1cc164[_0x2010('0x41')]==_0x1cc164[_0x2010('0x42')]){if(!_[_0x2010('0x1b')](agents[_0x1cc164[_0x2010('0x43')]])){utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x44'),_0x1cc164[_0x2010('0x41')],agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3')]));agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3b')]=!![];agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3c')]=_0x2010('0x45');agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x46')]=_0x1cc164[_0x2010('0x47')];agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3e')]=_0x1cc164[_0x2010('0x41')];}if(_0x1cc164[_0x2010('0x48')]&&agents[_0x1cc164[_0x2010('0x48')]]){agents[_0x1cc164['transfereeuniqueid']][_0x2010('0x49')]=0x1;transfers[_0x1cc164['transfereeuniqueid']]=_['clone'](agents[_0x1cc164[_0x2010('0x48')]]);transfers[_0x1cc164[_0x2010('0x48')]]['calleridnum']=agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x5')];transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x4a')]=agents[_0x1cc164['secondtransfereruniqueid']][_0x2010('0x4a')];transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x15')]=utils[_0x2010('0x1f')]();transfers[_0x1cc164['transfereeuniqueid']][_0x2010('0x2e')]=utils['now']();transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x22')]=0x0;transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x49')]=0x2;}}else if(_0x1cc164['secondtransfereruniqueid']==_0x1cc164['secondtransfererlinkedid']){if(!_[_0x2010('0x1b')](agents[_0x1cc164[_0x2010('0x41')]])){utils['info'](util['format'](_0x2010('0x44'),_0x1cc164[_0x2010('0x41')],agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x3')]));agents[_0x1cc164['origtransfereruniqueid']][_0x2010('0x3b')]=!![];agents[_0x1cc164['origtransfereruniqueid']][_0x2010('0x3c')]=_0x2010('0x45');agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x46')]=_0x1cc164['secondtransfererexten'];agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x3e')]=_0x1cc164['secondtransfereruniqueid'];}if(_0x1cc164[_0x2010('0x4b')]&&agents[_0x1cc164[_0x2010('0x4b')]]){agents[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x49')]=0x1;transfers[_0x1cc164[_0x2010('0x4b')]]=_[_0x2010('0x4c')](agents[_0x1cc164[_0x2010('0x4b')]]);transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x5')]=agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x5')];transfers[_0x1cc164[_0x2010('0x4b')]]['calleridname']=agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x4a')];transfers[_0x1cc164[_0x2010('0x4b')]]['agentcalledAt']=utils['now']();transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x2e')]=utils[_0x2010('0x1f')]();transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x22')]=0x0;transfers[_0x1cc164[_0x2010('0x4b')]]['agententerreason']=0x2;}}}catch(_0xe37cef){utils[_0x2010('0x1a')](util[_0x2010('0x13')]('[%s][agents][attendedtransfer]',_0x1cc164[_0x2010('0x41')]),_0xe37cef);}};exports[_0x2010('0x4d')]=function(_0x13d06d){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x4e'),_0x13d06d['uniqueid']),_0x13d06d);if(agents[_0x13d06d['uniqueid']]&&agents[_0x13d06d[_0x2010('0x10')]]['reason']==='timeout'){if(_0x13d06d[_0x2010('0x4f')]==='21'){agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')]=_0x2010('0x50');agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]=_0x2010('0x50');}utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d['uniqueid'],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x3')],agents[_0x13d06d['uniqueid']][_0x2010('0x20')],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]));writeDB(agents[_0x13d06d[_0x2010('0x10')]]);var _0x517afa=unanswered[_0x2010('0x52')](_0x13d06d[_0x2010('0x10')]);if(_0x517afa>-0x1){unanswered['splice'](_0x517afa,0x1);}}if(transfers[_0x13d06d['uniqueid']]){transfers[_0x13d06d[_0x2010('0x10')]]['agentcomplete']=!![];transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x35')]=utils[_0x2010('0x1f')]();transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x24')]=utils[_0x2010('0x36')](transfers[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt'],transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x2e')]);transfers[_0x13d06d[_0x2010('0x10')]]['reason']=_0x2010('0x53');transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]=_0x2010('0x37');utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d[_0x2010('0x10')],transfers[_0x13d06d['uniqueid']][_0x2010('0x3')],transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')],transfers[_0x13d06d['uniqueid']][_0x2010('0x6')]));writeDB(transfers[_0x13d06d[_0x2010('0x10')]],!![]);}if(agents[_0x13d06d['uniqueid']]&&agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x2e')]){agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0xa')]=!![];agents[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt']=utils[_0x2010('0x1f')]();agents[_0x13d06d[_0x2010('0x10')]]['talktime']=utils[_0x2010('0x36')](agents[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt'],agents[_0x13d06d[_0x2010('0x10')]]['agentconnectAt']);agents[_0x13d06d['uniqueid']][_0x2010('0x20')]=agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x3b')]?_0x2010('0x3b'):_0x2010('0x53');agents[_0x13d06d[_0x2010('0x10')]]['lastevent']=_0x2010('0x37');utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d['uniqueid'],agents[_0x13d06d[_0x2010('0x10')]]['membername'],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]));writeDB(agents[_0x13d06d['uniqueid']]);}}catch(_0x496280){utils['error'](util[_0x2010('0x13')]('[%s][agents][hangup]',_0x13d06d[_0x2010('0x10')]),_0x496280);}};
\ No newline at end of file
+var _0xf109=['transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','now','called','info','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','error','queuecallerabandon','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','forIn','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer'];(function(_0x1d1ecf,_0x3364a7){var _0x5728f4=function(_0x1e859f){while(--_0x1e859f){_0x1d1ecf['push'](_0x1d1ecf['shift']());}};_0x5728f4(++_0x3364a7);}(_0xf109,0xce));var _0x9f10=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xf109[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var utils=require(_0x9f10('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5d2950,_0x5b381d){utils['info'](util[_0x9f10('0x3')](_0x9f10('0x4'),_0x5d2950[_0x9f10('0x5')],_0x5d2950[_0x9f10('0x6')],_0x5d2950[_0x9f10('0x7')],_0x5d2950[_0x9f10('0x8')],_0x5d2950[_0x9f10('0x9')],_0x5d2950[_0x9f10('0xa')],_0x5d2950[_0x9f10('0xb')],_0x5d2950[_0x9f10('0xc')]));if(_0x5d2950[_0x9f10('0x7')]){utils['getVoiceQueueByName'](_0x5d2950[_0x9f10('0x7')])[_0x9f10('0xd')](function(_0x1a0668){if(_0x1a0668){_0x5d2950[_0x9f10('0xe')]=_0x1a0668[_0x9f10('0xe')];_0x5d2950['agentacw']=_0x5d2950[_0x9f10('0xf')]?_0x1a0668[_0x9f10('0x10')]:![];_0x5d2950[_0x9f10('0x11')]=_0x5d2950['agentacw']?_0x1a0668['acwTimeout']:0x0;}utils[_0x9f10('0x12')](_0x9f10('0x13'),_0x5d2950);});}else{utils[_0x9f10('0x12')]('CreateVoiceAgentReport',_0x5d2950);}if(_0x5b381d){delete transfers[_0x5d2950[_0x9f10('0x5')]];}else{delete agents[_0x5d2950[_0x9f10('0x14')]];}}exports[_0x9f10('0x15')]=function(_0x58067f){try{utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][agentcalled]',_0x58067f[_0x9f10('0x5')]),_0x58067f);agents[_0x58067f[_0x9f10('0x14')]]=_0x58067f;agents[_0x58067f['destuniqueid']]['agentcalledAt']=utils[_0x9f10('0x17')]();agents[_0x58067f[_0x9f10('0x14')]]['lastevent']=_0x9f10('0x18');agents[_0x58067f['destuniqueid']][_0x9f10('0xb')]=null;agents[_0x58067f[_0x9f10('0x14')]]['connectedlinename']=null;utils[_0x9f10('0x19')](util[_0x9f10('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x58067f[_0x9f10('0x5')],agents[_0x58067f['destuniqueid']][_0x9f10('0x8')],_0x58067f['destuniqueid']));}catch(_0x2c5064){utils['error'](util['format'](_0x9f10('0x1a'),_0x58067f[_0x9f10('0x5')]),_0x2c5064);}};exports[_0x9f10('0x1b')]=function(_0x3a78be){try{if(!_[_0x9f10('0x1c')](agents[_0x3a78be[_0x9f10('0x14')]])){utils[_0x9f10('0x16')](util['format'](_0x9f10('0x1d'),_0x3a78be['uniqueid']),_0x3a78be);utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x1e'),_0x3a78be['uniqueid'],agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x8')],_0x3a78be[_0x9f10('0x14')]));agents[_0x3a78be['destuniqueid']][_0x9f10('0x1b')]=!![];agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x1f')]=utils['now']();agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0xc')]=_0x9f10('0x20');agents[_0x3a78be[_0x9f10('0x14')]]['reason']='timeout';agents[_0x3a78be['destuniqueid']][_0x9f10('0x21')]=_0x3a78be['ringtime']?parseInt(_0x3a78be[_0x9f10('0x22')])/0x3e8:0x0;agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x23')]=0x0;unanswered[_0x9f10('0x24')](_0x3a78be[_0x9f10('0x14')]);}}catch(_0x4f6b0c){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x1d'),_0x3a78be[_0x9f10('0x5')]),_0x4f6b0c);}};exports[_0x9f10('0x26')]=function(_0x2c4373){try{_['forIn'](agents,function(_0x358d3f,_0x501ee){if(_0x358d3f[_0x9f10('0x5')]==_0x2c4373[_0x9f10('0x5')]&&!_['includes'](unanswered,_0x358d3f[_0x9f10('0x14')])){utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][queuecallerabandon]',_0x2c4373[_0x9f10('0x5')]),_0x2c4373);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x27'),_0x2c4373[_0x9f10('0x5')],_0x358d3f['membername'],_0x358d3f[_0x9f10('0x14')]));_0x358d3f[_0x9f10('0x1b')]=!![];_0x358d3f[_0x9f10('0x1f')]=utils[_0x9f10('0x17')]();_0x358d3f[_0x9f10('0xc')]='abandoned';_0x358d3f[_0x9f10('0x28')]='abandoned';_0x358d3f[_0x9f10('0x21')]=_0x2c4373[_0x9f10('0x21')];_0x358d3f[_0x9f10('0x23')]=0x0;writeDB(_0x358d3f);}});}catch(_0x11ee9c){utils[_0x9f10('0x25')](util[_0x9f10('0x3')]('[%s][agents][queuecallerabandon]',_0x2c4373[_0x9f10('0x5')]),_0x11ee9c);}};exports[_0x9f10('0x29')]=function(_0x1b8018){try{if(agents[_0x1b8018['destuniqueid']]){utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][agentconnect]',_0x1b8018[_0x9f10('0x5')]),_0x1b8018);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x2a'),_0x1b8018[_0x9f10('0x5')],agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0x8')],_0x1b8018[_0x9f10('0x14')]));agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0x2b')]=utils['now']();agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0xb')]=_0x1b8018[_0x9f10('0xb')];agents[_0x1b8018['destuniqueid']][_0x9f10('0x2c')]=_0x1b8018[_0x9f10('0x2c')];agents[_0x1b8018['destuniqueid']][_0x9f10('0x21')]=_0x1b8018[_0x9f10('0x22')];agents[_0x1b8018[_0x9f10('0x14')]]['lastevent']='connect';_[_0x9f10('0x2d')](agents,function(_0x2ff98d,_0x1deed4){if(_0x2ff98d[_0x9f10('0x14')]!=_0x1b8018[_0x9f10('0x14')]&&_0x2ff98d[_0x9f10('0x5')]==_0x1b8018[_0x9f10('0x5')]){_0x2ff98d[_0x9f10('0x23')]=0x0;_0x2ff98d[_0x9f10('0x21')]=_0x1b8018[_0x9f10('0x22')];_0x2ff98d[_0x9f10('0x1b')]=!![];_0x2ff98d[_0x9f10('0x1f')]=utils['now']();_0x2ff98d['lastevent']='answered_elsewhere';_0x2ff98d[_0x9f10('0x28')]='answered_elsewhere';_0x2ff98d[_0x9f10('0x2e')]=_0x1b8018[_0x9f10('0x14')];_0x2ff98d[_0x9f10('0x2f')]=_0x1b8018['membername'];writeDB(_0x2ff98d);}});}}catch(_0x3cfce6){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x30'),_0x1b8018[_0x9f10('0x5')]),_0x3cfce6);}};exports['agentcomplete']=function(_0x578368){try{if(!_['isNil'](agents[_0x578368[_0x9f10('0x14')]])){utils['debug'](util[_0x9f10('0x3')]('[%s][agents][agentcomplete]',_0x578368[_0x9f10('0x5')]),_0x578368);utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x31'),_0x578368['uniqueid'],agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x8')],_0x578368['destuniqueid']));agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0xf')]=!![];agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x23')]=utils[_0x9f10('0x33')](agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x32')],agents[_0x578368['destuniqueid']][_0x9f10('0x2b')]);agents[_0x578368[_0x9f10('0x14')]]['reason']=_0x578368[_0x9f10('0x28')];agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0xc')]=_0x9f10('0x34');writeDB(agents[_0x578368['destuniqueid']]);}}catch(_0x283f04){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x35'),_0x578368[_0x9f10('0x5')]),_0x283f04);}};exports[_0x9f10('0x36')]=function(_0x479b46){try{if(!_[_0x9f10('0x1c')](agents[_0x479b46[_0x9f10('0x37')]])){utils[_0x9f10('0x16')](util[_0x9f10('0x3')](_0x9f10('0x38'),_0x479b46[_0x9f10('0x5')]),_0x479b46);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x39'),_0x479b46[_0x9f10('0x5')],agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x8')],agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x5')]));agents[_0x479b46[_0x9f10('0x37')]]['transfer']=!![];agents[_0x479b46[_0x9f10('0x37')]]['transfertype']=_0x9f10('0x3a');agents[_0x479b46['transfereruniqueid']][_0x9f10('0x3b')]=_0x479b46[_0x9f10('0x3c')];agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x3d')]=agents[_0x479b46[_0x9f10('0x37')]]['uniqueid'];}}catch(_0x12cf34){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x38'),_0x479b46['uniqueid']),_0x12cf34);}};exports['attendedtransfer']=function(_0x265f69){try{utils[_0x9f10('0x16')](util['format']('[%s][agents][attendedtransfer]',_0x265f69[_0x9f10('0x3e')]),_0x265f69);if(_0x265f69[_0x9f10('0x3e')]==_0x265f69[_0x9f10('0x3f')]){if(!_['isNil'](agents[_0x265f69[_0x9f10('0x40')]])){utils[_0x9f10('0x19')](util[_0x9f10('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x265f69[_0x9f10('0x3e')],agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x8')]));agents[_0x265f69['secondtransfereruniqueid']][_0x9f10('0x41')]=!![];agents[_0x265f69[_0x9f10('0x40')]]['transfertype']=_0x9f10('0x42');agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x3b')]=_0x265f69[_0x9f10('0x43')];agents[_0x265f69[_0x9f10('0x40')]]['transferuniqueid']=_0x265f69[_0x9f10('0x3e')];}if(_0x265f69['transfereeuniqueid']&&agents[_0x265f69['transfereeuniqueid']]){agents[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x45')]=0x1;transfers[_0x265f69[_0x9f10('0x44')]]=_[_0x9f10('0x46')](agents[_0x265f69[_0x9f10('0x44')]]);transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0xa')]=agents[_0x265f69['secondtransfereruniqueid']]['calleridnum'];transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x47')]=agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x47')];transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x48')]=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfereeuniqueid']][_0x9f10('0x2b')]=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfereeuniqueid']][_0x9f10('0x21')]=0x0;transfers[_0x265f69[_0x9f10('0x44')]]['agententerreason']=0x2;}}else if(_0x265f69[_0x9f10('0x40')]==_0x265f69[_0x9f10('0x49')]){if(!_['isNil'](agents[_0x265f69[_0x9f10('0x3e')]])){utils['info'](util[_0x9f10('0x3')](_0x9f10('0x4a'),_0x265f69[_0x9f10('0x3e')],agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x8')]));agents[_0x265f69['origtransfereruniqueid']][_0x9f10('0x41')]=!![];agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x4b')]='ATTENDED';agents[_0x265f69['origtransfereruniqueid']][_0x9f10('0x3b')]=_0x265f69[_0x9f10('0x4c')];agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x3d')]=_0x265f69[_0x9f10('0x40')];}if(_0x265f69[_0x9f10('0x4d')]&&agents[_0x265f69[_0x9f10('0x4d')]]){agents[_0x265f69['transfertargetuniqueid']][_0x9f10('0x45')]=0x1;transfers[_0x265f69[_0x9f10('0x4d')]]=_['clone'](agents[_0x265f69[_0x9f10('0x4d')]]);transfers[_0x265f69['transfertargetuniqueid']][_0x9f10('0xa')]=agents[_0x265f69[_0x9f10('0x3e')]]['calleridnum'];transfers[_0x265f69[_0x9f10('0x4d')]]['calleridname']=agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x47')];transfers[_0x265f69[_0x9f10('0x4d')]]['agentcalledAt']=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfertargetuniqueid']][_0x9f10('0x2b')]=utils[_0x9f10('0x17')]();transfers[_0x265f69[_0x9f10('0x4d')]]['holdtime']=0x0;transfers[_0x265f69[_0x9f10('0x4d')]]['agententerreason']=0x2;}}}catch(_0x5708c1){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x4e'),_0x265f69['origtransfereruniqueid']),_0x5708c1);}};exports[_0x9f10('0x4f')]=function(_0x5a64ae){try{utils['debug'](util[_0x9f10('0x3')]('[%s][agents][hangup]',_0x5a64ae['uniqueid']),_0x5a64ae);if(agents[_0x5a64ae[_0x9f10('0x5')]]&&agents[_0x5a64ae['uniqueid']][_0x9f10('0x28')]===_0x9f10('0x20')){if(_0x5a64ae[_0x9f10('0x50')]==='21'){agents[_0x5a64ae['uniqueid']][_0x9f10('0x28')]=_0x9f10('0x51');agents[_0x5a64ae['uniqueid']][_0x9f10('0xc')]='rejected';}utils['info'](util[_0x9f10('0x3')](_0x9f10('0x52'),_0x5a64ae[_0x9f10('0x5')],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x8')],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')],agents[_0x5a64ae['uniqueid']][_0x9f10('0xc')]));writeDB(agents[_0x5a64ae[_0x9f10('0x5')]]);var _0x27f337=unanswered[_0x9f10('0x53')](_0x5a64ae[_0x9f10('0x5')]);if(_0x27f337>-0x1){unanswered[_0x9f10('0x54')](_0x27f337,0x1);}}if(transfers[_0x5a64ae[_0x9f10('0x5')]]){transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xf')]=!![];transfers[_0x5a64ae['uniqueid']][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x23')]=utils['diffTime'](transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x2b')]);transfers[_0x5a64ae['uniqueid']]['reason']=_0x9f10('0x55');transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]=_0x9f10('0x34');utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x52'),_0x5a64ae[_0x9f10('0x5')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x8')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]));writeDB(transfers[_0x5a64ae[_0x9f10('0x5')]],!![]);}if(agents[_0x5a64ae['uniqueid']]&&agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x2b')]){agents[_0x5a64ae['uniqueid']][_0x9f10('0xf')]=!![];agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();agents[_0x5a64ae['uniqueid']][_0x9f10('0x23')]=utils['diffTime'](agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')],agents[_0x5a64ae[_0x9f10('0x5')]]['agentconnectAt']);agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')]=agents[_0x5a64ae[_0x9f10('0x5')]]['transfer']?_0x9f10('0x41'):_0x9f10('0x55');agents[_0x5a64ae[_0x9f10('0x5')]]['lastevent']='complete';utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5a64ae['uniqueid'],agents[_0x5a64ae['uniqueid']][_0x9f10('0x8')],agents[_0x5a64ae[_0x9f10('0x5')]]['reason'],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]));writeDB(agents[_0x5a64ae[_0x9f10('0x5')]]);}}catch(_0x3b3dd8){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x56'),_0x5a64ae[_0x9f10('0x5')]),_0x3b3dd8);}};
\ No newline at end of file
index 00d8956..06e6e2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c84=['CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','channel','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','error','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','ANSWERED','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','[%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','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','util','./utils','NO\x20ANSWER','FAILED','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','calleridnum','connectedlinenum','accountcode','UserId','request'];(function(_0x2fff52,_0x1580ac){var _0x4fef52=function(_0x422782){while(--_0x422782){_0x2fff52['push'](_0x2fff52['shift']());}};_0x4fef52(++_0x1580ac);}(_0x4c84,0x124));var _0x44c8=function(_0x542151,_0x2067af){_0x542151=_0x542151-0x0;var _0x10c252=_0x4c84[_0x542151];return _0x10c252;};'use strict';var _=require('lodash');var util=require(_0x44c8('0x0'));var utils=require(_0x44c8('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0x44c8('0x2'),_0x44c8('0x3'),_0x44c8('0x3'),_0x44c8('0x2'),'NO\x20ANSWER','NO\x20ANSWER','ANSWERED','BUSY',_0x44c8('0x3'),'FAILED',_0x44c8('0x3')];var channels={};function writeDB(_0x622988){var _0x6e7032;if(transfers['blinds'][_0x622988[_0x44c8('0x4')]]){_0x6e7032=_0x622988['uniqueid'];_0x622988[_0x44c8('0x4')]=transfers[_0x44c8('0x5')][_0x622988[_0x44c8('0x4')]][_0x44c8('0x6')];}utils[_0x44c8('0x7')](util[_0x44c8('0x8')](_0x44c8('0x9'),_0x622988[_0x44c8('0x4')],_0x622988['channel'],_0x622988[_0x44c8('0xa')],_0x622988[_0x44c8('0xb')],_0x622988['interface'],_0x622988[_0x44c8('0xc')],_0x622988[_0x44c8('0xd')],_0x622988['lastevent']));if(_0x622988[_0x44c8('0xe')]){utils['getUserByInternal'](_0x622988[_0x44c8('0xe')])['then'](function(_0x1bca65){if(_0x1bca65){_0x622988[_0x44c8('0xf')]=_0x1bca65['id'];}utils[_0x44c8('0x10')](_0x44c8('0x11'),_0x622988);});}else{utils[_0x44c8('0x10')](_0x44c8('0x11'),_0x622988);}if(channels[_0x622988[_0x44c8('0x4')]]){delete channels[_0x622988[_0x44c8('0x4')]];}else if(_0x6e7032&&channels[_0x6e7032]){if(!transfers['blinds'][_0x6e7032][_0x44c8('0x12')])delete transfers['blinds'][_0x6e7032];delete channels[_0x6e7032];}}exports['newchannel']=function(_0x23c57e){try{utils[_0x44c8('0x13')](util['format'](_0x44c8('0x14'),_0x23c57e[_0x44c8('0x4')]),_0x23c57e);if(_0x23c57e[_0x44c8('0x4')]==_0x23c57e['linkedid']&&_0x23c57e[_0x44c8('0x15')]!='OutgoingSpoolFailed'){utils[_0x44c8('0x7')](util[_0x44c8('0x8')](_0x44c8('0x16'),_0x23c57e[_0x44c8('0x4')],_0x23c57e[_0x44c8('0x17')],_0x23c57e[_0x44c8('0x18')]));channels[_0x23c57e[_0x44c8('0x4')]]={'uniqueid':_0x23c57e[_0x44c8('0x4')],'accountcode':_0x23c57e[_0x44c8('0xe')],'source':_0x23c57e[_0x44c8('0xc')],'destination':_0x23c57e['exten'],'destinationcontext':_0x23c57e[_0x44c8('0x17')],'channel':_0x23c57e['channel'],'starttime':utils[_0x44c8('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x5096cc){utils[_0x44c8('0x1a')](util[_0x44c8('0x8')](_0x44c8('0x14'),_0x23c57e['uniqueid']),_0x5096cc);}};exports[_0x44c8('0x1b')]=function(_0x599f45){try{utils[_0x44c8('0x13')](util[_0x44c8('0x8')](_0x44c8('0x1c'),_0x599f45['uniqueid']),_0x599f45);if(!_[_0x44c8('0x1d')](channels[_0x599f45[_0x44c8('0x4')]])&&_0x599f45[_0x44c8('0x1e')]==0x6){utils['info'](util[_0x44c8('0x8')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x599f45[_0x44c8('0x4')],_0x599f45[_0x44c8('0x17')],_0x599f45[_0x44c8('0x15')]));if(_[_0x44c8('0x1d')](channels[_0x599f45['uniqueid']][_0x44c8('0x1f')])){channels[_0x599f45[_0x44c8('0x4')]][_0x44c8('0x1f')]=utils[_0x44c8('0x19')]();}}else if(!_[_0x44c8('0x1d')](channels[_0x599f45[_0x44c8('0x20')]])&&_0x599f45[_0x44c8('0x1e')]==0x6&&_0x599f45['context']!=_0x44c8('0x21')){utils['info'](util[_0x44c8('0x8')](_0x44c8('0x22'),_0x599f45[_0x44c8('0x4')],_0x599f45[_0x44c8('0x20')],_0x599f45[_0x44c8('0x17')],_0x599f45[_0x44c8('0x15')]));channels[_0x599f45[_0x44c8('0x20')]][_0x44c8('0xe')]=_0x599f45[_0x44c8('0xe')];channels[_0x599f45[_0x44c8('0x20')]][_0x44c8('0x23')]=_0x599f45[_0x44c8('0x15')];if(_[_0x44c8('0x1d')](channels[_0x599f45[_0x44c8('0x20')]]['answertime'])){channels[_0x599f45[_0x44c8('0x20')]][_0x44c8('0x24')]=utils[_0x44c8('0x19')]();}channels[_0x599f45['linkedid']][_0x44c8('0x25')]=dispositions[_['toNumber'](_0x599f45[_0x44c8('0x1e')])]||_0x44c8('0x26');}}catch(_0x2319ff){utils[_0x44c8('0x1a')](util['format'](_0x44c8('0x1c'),_0x599f45[_0x44c8('0x4')]),_0x2319ff);}};exports[_0x44c8('0x27')]=function(_0x2d806e){try{if(!_[_0x44c8('0x1d')](channels[_0x2d806e[_0x44c8('0x4')]])){utils[_0x44c8('0x13')](util[_0x44c8('0x8')]('[%s][calls][hangup]',_0x2d806e['uniqueid']),_0x2d806e);if(_[_0x44c8('0x1d')](channels[_0x2d806e[_0x44c8('0x4')]][_0x44c8('0x28')])){channels[_0x2d806e[_0x44c8('0x4')]][_0x44c8('0x28')]=_0x2d806e[_0x44c8('0x29')]+'\x20<'+_0x2d806e[_0x44c8('0xc')]+'>';}utils[_0x44c8('0x7')](util[_0x44c8('0x8')](_0x44c8('0x2a'),_0x2d806e[_0x44c8('0x4')],channels[_0x2d806e[_0x44c8('0x4')]][_0x44c8('0x28')],_0x2d806e[_0x44c8('0x2b')]));channels[_0x2d806e[_0x44c8('0x4')]][_0x44c8('0x2c')]=utils['now']();channels[_0x2d806e[_0x44c8('0x4')]]['duration']=utils[_0x44c8('0x2d')](channels[_0x2d806e[_0x44c8('0x4')]][_0x44c8('0x2c')],channels[_0x2d806e[_0x44c8('0x4')]][_0x44c8('0x2e')]);channels[_0x2d806e[_0x44c8('0x4')]][_0x44c8('0x2f')]=channels[_0x2d806e['uniqueid']][_0x44c8('0x24')]?utils[_0x44c8('0x2d')](channels[_0x2d806e[_0x44c8('0x4')]][_0x44c8('0x2c')],channels[_0x2d806e[_0x44c8('0x4')]][_0x44c8('0x24')]):0x0;writeDB(channels[_0x2d806e[_0x44c8('0x4')]]);}}catch(_0x4d7ed1){utils[_0x44c8('0x1a')](util[_0x44c8('0x8')](_0x44c8('0x30'),_0x2d806e[_0x44c8('0x4')]),_0x4d7ed1);}};exports[_0x44c8('0x31')]=function(_0x3e6bc6){try{if(!_[_0x44c8('0x1d')](channels[_0x3e6bc6[_0x44c8('0x32')]])){utils['debug'](util[_0x44c8('0x8')](_0x44c8('0x33'),_0x3e6bc6['origtransfereruniqueid']),_0x3e6bc6);if(channels[_0x3e6bc6['localtwolinkedid']][_0x44c8('0x15')]==_0x3e6bc6['transfereechannel']){utils[_0x44c8('0x7')](util[_0x44c8('0x8')](_0x44c8('0x34'),_0x3e6bc6[_0x44c8('0x35')],_0x3e6bc6[_0x44c8('0x32')],_0x3e6bc6[_0x44c8('0x36')]));channels[_0x3e6bc6[_0x44c8('0x32')]]['destinationchannel']=_0x3e6bc6[_0x44c8('0x36')];channels[_0x3e6bc6['localtwolinkedid']]['userfield']='_attended';}else if(channels[_0x3e6bc6[_0x44c8('0x32')]][_0x44c8('0x15')]=_0x3e6bc6[_0x44c8('0x37')]){utils[_0x44c8('0x7')](util[_0x44c8('0x8')](_0x44c8('0x34'),_0x3e6bc6['origtransfereruniqueid'],_0x3e6bc6[_0x44c8('0x32')],_0x3e6bc6[_0x44c8('0x38')]));channels[_0x3e6bc6['localtwolinkedid']]['destinationchannel']=_0x3e6bc6[_0x44c8('0x38')];channels[_0x3e6bc6[_0x44c8('0x32')]]['userfield']='_attended';}}}catch(_0x5f0409){utils[_0x44c8('0x1a')](util[_0x44c8('0x8')](_0x44c8('0x33'),_0x3e6bc6[_0x44c8('0x35')]),_0x5f0409);}};exports['musiconholdstart']=function(_0x5ac716){try{if(!_[_0x44c8('0x1d')](channels[_0x5ac716['uniqueid']])){utils[_0x44c8('0x13')](util[_0x44c8('0x8')](_0x44c8('0x39'),_0x5ac716[_0x44c8('0x4')]),_0x5ac716);channels[_0x5ac716[_0x44c8('0x4')]][_0x44c8('0x3a')]=utils[_0x44c8('0x19')]();utils['info'](util[_0x44c8('0x8')](_0x44c8('0x3b'),_0x5ac716[_0x44c8('0x4')],channels[_0x5ac716[_0x44c8('0x4')]][_0x44c8('0x3a')]));}}catch(_0x1fe59d){utils[_0x44c8('0x1a')](util[_0x44c8('0x8')](_0x44c8('0x39'),_0x5ac716[_0x44c8('0x4')]),_0x1fe59d);}};exports[_0x44c8('0x3c')]=function(_0x4421e2){try{if(!_[_0x44c8('0x1d')](channels[_0x4421e2[_0x44c8('0x4')]])){utils['debug'](util[_0x44c8('0x8')](_0x44c8('0x3d'),_0x4421e2[_0x44c8('0x4')]),_0x4421e2);if(!_[_0x44c8('0x1d')](channels[_0x4421e2[_0x44c8('0x4')]][_0x44c8('0x3a')])){channels[_0x4421e2[_0x44c8('0x4')]][_0x44c8('0x3e')]+=utils['diffTime'](utils[_0x44c8('0x19')](),channels[_0x4421e2['uniqueid']][_0x44c8('0x3a')]);utils[_0x44c8('0x7')](util['format'](_0x44c8('0x3f'),_0x4421e2[_0x44c8('0x4')],channels[_0x4421e2['uniqueid']][_0x44c8('0x3e')]));delete channels[_0x4421e2[_0x44c8('0x4')]][_0x44c8('0x3a')];}}}catch(_0x626025){utils[_0x44c8('0x1a')](util[_0x44c8('0x8')](_0x44c8('0x3d'),_0x4421e2[_0x44c8('0x4')]),_0x626025);}};exports[_0x44c8('0x40')]=function(_0x3a954e){try{if(!_[_0x44c8('0x1d')](channels[_0x3a954e[_0x44c8('0x4')]])){utils[_0x44c8('0x13')](util[_0x44c8('0x8')](_0x44c8('0x41'),_0x3a954e[_0x44c8('0x4')]),_0x3a954e);if(!_[_0x44c8('0x1d')](_0x3a954e[_0x44c8('0x42')][_0x44c8('0x43')])){utils[_0x44c8('0x7')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x3a954e[_0x44c8('0x4')],_0x3a954e[_0x44c8('0x44')]));channels[_0x3a954e['uniqueid']]['source']=_0x3a954e[_0x44c8('0x44')];}if(!_[_0x44c8('0x1d')](_0x3a954e[_0x44c8('0x42')]['xmd-phone'])){utils[_0x44c8('0x7')](util[_0x44c8('0x8')](_0x44c8('0x45'),_0x3a954e[_0x44c8('0x4')],_0x3a954e[_0x44c8('0x44')]));channels[_0x3a954e[_0x44c8('0x4')]][_0x44c8('0x46')]=_0x3a954e[_0x44c8('0x44')];channels[_0x3a954e[_0x44c8('0x4')]][_0x44c8('0x28')]='\x22'+_0x3a954e['value']+_0x44c8('0x47')+_0x3a954e[_0x44c8('0x44')]+'>';}if(!_[_0x44c8('0x1d')](_0x3a954e[_0x44c8('0x42')][_0x44c8('0x48')])||!_[_0x44c8('0x1d')](_0x3a954e[_0x44c8('0x42')][_0x44c8('0x49')])){utils[_0x44c8('0x7')](util[_0x44c8('0x8')](_0x44c8('0x4a'),_0x3a954e['uniqueid'],!_['isNil'](_0x3a954e[_0x44c8('0x42')][_0x44c8('0x48')])?_0x44c8('0x48'):_0x44c8('0x49'),_0x3a954e['value']));channels[_0x3a954e[_0x44c8('0x4')]][_0x44c8('0x28')]=_0x3a954e['value'];}if(!_['isNil'](_0x3a954e['variable'][_0x44c8('0x4b')])||!_[_0x44c8('0x1d')](_0x3a954e['variable'][_0x44c8('0x4c')])){utils[_0x44c8('0x7')](util['format'](_0x44c8('0x4a'),_0x3a954e['uniqueid'],!_[_0x44c8('0x1d')](_0x3a954e[_0x44c8('0x42')][_0x44c8('0x4b')])?_0x44c8('0x4b'):'xmcs-queue',_0x3a954e[_0x44c8('0x44')]));channels[_0x3a954e['uniqueid']][_0x44c8('0x4d')]=_0x44c8('0x4e');channels[_0x3a954e[_0x44c8('0x4')]][_0x44c8('0x4f')]=_0x3a954e['value'];channels[_0x3a954e[_0x44c8('0x4')]][_0x44c8('0xa')]=!![];}if(!_[_0x44c8('0x1d')](_0x3a954e[_0x44c8('0x42')][_0x44c8('0x50')])){utils['info'](util[_0x44c8('0x8')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x3a954e[_0x44c8('0x4')],_0x3a954e[_0x44c8('0x44')]));channels[_0x3a954e[_0x44c8('0x4')]][_0x44c8('0x51')]=_0x3a954e[_0x44c8('0x44')];}if(!_[_0x44c8('0x1d')](_0x3a954e['variable'][_0x44c8('0x52')])){utils['info'](util['format'](_0x44c8('0x53'),_0x3a954e[_0x44c8('0x4')],_0x3a954e[_0x44c8('0x44')]));channels[_0x3a954e['uniqueid']]['type']=_0x3a954e[_0x44c8('0x44')];}if(!_[_0x44c8('0x1d')](_0x3a954e[_0x44c8('0x42')][_0x44c8('0x54')])){utils[_0x44c8('0x7')](util['format'](_0x44c8('0x55'),_0x3a954e[_0x44c8('0x4')],_0x3a954e[_0x44c8('0x44')]));channels[_0x3a954e[_0x44c8('0x4')]][_0x44c8('0x56')]=_0x3a954e[_0x44c8('0x44')];}if(!_['isNil'](_0x3a954e[_0x44c8('0x42')][_0x44c8('0x57')])){utils[_0x44c8('0x7')](util['format'](_0x44c8('0x58'),_0x3a954e[_0x44c8('0x4')],_0x3a954e[_0x44c8('0x44')]));channels[_0x3a954e[_0x44c8('0x4')]][_0x44c8('0x57')]=_0x3a954e[_0x44c8('0x44')];}}}catch(_0x83e21e){utils[_0x44c8('0x1a')](util[_0x44c8('0x8')]('[%s][calls][varset]',_0x3a954e[_0x44c8('0x4')]),_0x83e21e);}};exports['newexten']=function(_0x95ba2d){try{if(!_['isNil'](channels[_0x95ba2d[_0x44c8('0x4')]])){utils[_0x44c8('0x13')](util[_0x44c8('0x8')](_0x44c8('0x59'),_0x95ba2d[_0x44c8('0x4')]),_0x95ba2d);utils[_0x44c8('0x7')](util[_0x44c8('0x8')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x95ba2d[_0x44c8('0x4')],_0x95ba2d[_0x44c8('0x5a')],_0x95ba2d[_0x44c8('0x5b')]));if(_0x95ba2d[_0x44c8('0x5a')][_0x44c8('0x5c')]()==_0x44c8('0x5d')&&_[_0x44c8('0x5e')](_0x95ba2d[_0x44c8('0x5b')][_0x44c8('0x5c')](),_0x44c8('0x5f'))){var _0xc7f18c=_0x95ba2d[_0x44c8('0x5b')][_0x44c8('0x60')]('=');var _0x294c16=_0xc7f18c[0x0][_0x44c8('0x61')](_0xc7f18c[0x0]['lastIndexOf']('(')+0x1,_0xc7f18c[0x0][_0x44c8('0x62')](')'));var _0x8072c6=_0xc7f18c[0x1];channels[_0x95ba2d[_0x44c8('0x4')]][_0x294c16]=_0x8072c6;}if(!_[_0x44c8('0x63')]([_0x44c8('0x27'),_0x44c8('0x64'),_0x44c8('0x65'),'set',_0x44c8('0x66')],_0x95ba2d['application'][_0x44c8('0x5c')]())){channels[_0x95ba2d[_0x44c8('0x4')]][_0x44c8('0x4d')]=_0x95ba2d[_0x44c8('0x5a')];channels[_0x95ba2d[_0x44c8('0x4')]][_0x44c8('0x4f')]=_0x95ba2d[_0x44c8('0x5b')];}}}catch(_0xa2a2f2){utils[_0x44c8('0x1a')](util[_0x44c8('0x8')](_0x44c8('0x59'),_0x95ba2d['uniqueid']),_0xa2a2f2);}};
\ No newline at end of file
+var _0xa412=['[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','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','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','lastdata','xmd-contactid','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error'];(function(_0x15e348,_0x3e4eb9){var _0xb148de=function(_0x93d0cd){while(--_0x93d0cd){_0x15e348['push'](_0x15e348['shift']());}};_0xb148de(++_0x3e4eb9);}(_0xa412,0x127));var _0x2a41=function(_0x5287a4,_0x1d896b){_0x5287a4=_0x5287a4-0x0;var _0x59d0af=_0xa412[_0x5287a4];return _0x59d0af;};'use strict';var _=require(_0x2a41('0x0'));var util=require(_0x2a41('0x1'));var utils=require(_0x2a41('0x2'));var transfers=require(_0x2a41('0x3'));var dispositions=[_0x2a41('0x4'),'FAILED',_0x2a41('0x5'),'NO\x20ANSWER',_0x2a41('0x4'),_0x2a41('0x4'),'ANSWERED',_0x2a41('0x6'),_0x2a41('0x5'),'FAILED',_0x2a41('0x5')];var channels={};function writeDB(_0x3c3620){var _0x32af58;if(transfers['blinds'][_0x3c3620[_0x2a41('0x7')]]){_0x32af58=_0x3c3620[_0x2a41('0x7')];_0x3c3620[_0x2a41('0x7')]=transfers[_0x2a41('0x8')][_0x3c3620[_0x2a41('0x7')]][_0x2a41('0x9')];}utils[_0x2a41('0xa')](util[_0x2a41('0xb')](_0x2a41('0xc'),_0x3c3620[_0x2a41('0x7')],_0x3c3620['channel'],_0x3c3620[_0x2a41('0xd')],_0x3c3620[_0x2a41('0xe')],_0x3c3620[_0x2a41('0xf')],_0x3c3620[_0x2a41('0x10')],_0x3c3620[_0x2a41('0x11')],_0x3c3620['lastevent']));if(_0x3c3620['accountcode']){utils[_0x2a41('0x12')](_0x3c3620[_0x2a41('0x13')])[_0x2a41('0x14')](function(_0x458919){if(_0x458919){_0x3c3620[_0x2a41('0x15')]=_0x458919['id'];}utils[_0x2a41('0x16')](_0x2a41('0x17'),_0x3c3620);});}else{utils['request'](_0x2a41('0x17'),_0x3c3620);}if(channels[_0x3c3620['uniqueid']]){delete channels[_0x3c3620[_0x2a41('0x7')]];}else if(_0x32af58&&channels[_0x32af58]){if(!transfers[_0x2a41('0x8')][_0x32af58]['recording'])delete transfers[_0x2a41('0x8')][_0x32af58];delete channels[_0x32af58];}}exports[_0x2a41('0x18')]=function(_0x494236){try{utils[_0x2a41('0x19')](util['format'](_0x2a41('0x1a'),_0x494236[_0x2a41('0x7')]),_0x494236);if(_0x494236[_0x2a41('0x7')]==_0x494236['linkedid']&&_0x494236[_0x2a41('0x1b')]!=_0x2a41('0x1c')){utils[_0x2a41('0xa')](util['format'](_0x2a41('0x1d'),_0x494236['uniqueid'],_0x494236[_0x2a41('0x1e')],_0x494236[_0x2a41('0x1f')]));channels[_0x494236[_0x2a41('0x7')]]={'uniqueid':_0x494236[_0x2a41('0x7')],'accountcode':_0x494236[_0x2a41('0x13')],'source':_0x494236[_0x2a41('0x10')],'destination':_0x494236[_0x2a41('0x1f')],'destinationcontext':_0x494236[_0x2a41('0x1e')],'channel':_0x494236['channel'],'starttime':utils[_0x2a41('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2a41('0x4'),'amaflags':_0x2a41('0x21')};}}catch(_0x623ebf){utils[_0x2a41('0x22')](util[_0x2a41('0xb')](_0x2a41('0x1a'),_0x494236[_0x2a41('0x7')]),_0x623ebf);}};exports['newstate']=function(_0x1366bf){try{utils[_0x2a41('0x19')](util[_0x2a41('0xb')](_0x2a41('0x23'),_0x1366bf['uniqueid']),_0x1366bf);if(!_[_0x2a41('0x24')](channels[_0x1366bf[_0x2a41('0x7')]])&&_0x1366bf[_0x2a41('0x25')]==0x6){utils[_0x2a41('0xa')](util[_0x2a41('0xb')](_0x2a41('0x26'),_0x1366bf[_0x2a41('0x7')],_0x1366bf['context'],_0x1366bf[_0x2a41('0x1b')]));if(_['isNil'](channels[_0x1366bf[_0x2a41('0x7')]][_0x2a41('0x27')])){channels[_0x1366bf['uniqueid']][_0x2a41('0x27')]=utils[_0x2a41('0x20')]();}}else if(!_[_0x2a41('0x24')](channels[_0x1366bf[_0x2a41('0x28')]])&&_0x1366bf[_0x2a41('0x25')]==0x6&&_0x1366bf[_0x2a41('0x1e')]!=_0x2a41('0x29')){utils['info'](util[_0x2a41('0xb')](_0x2a41('0x2a'),_0x1366bf[_0x2a41('0x7')],_0x1366bf[_0x2a41('0x28')],_0x1366bf[_0x2a41('0x1e')],_0x1366bf[_0x2a41('0x1b')]));channels[_0x1366bf[_0x2a41('0x28')]]['accountcode']=_0x1366bf[_0x2a41('0x13')];channels[_0x1366bf[_0x2a41('0x28')]]['destinationchannel']=_0x1366bf[_0x2a41('0x1b')];if(_[_0x2a41('0x24')](channels[_0x1366bf[_0x2a41('0x28')]][_0x2a41('0x2b')])){channels[_0x1366bf[_0x2a41('0x28')]]['answertime']=utils[_0x2a41('0x20')]();}channels[_0x1366bf[_0x2a41('0x28')]]['disposition']=dispositions[_['toNumber'](_0x1366bf[_0x2a41('0x25')])]||_0x2a41('0x2c');}}catch(_0x50cc0c){utils[_0x2a41('0x22')](util[_0x2a41('0xb')]('[%s][calls][newstate]',_0x1366bf[_0x2a41('0x7')]),_0x50cc0c);}};exports[_0x2a41('0x2d')]=function(_0x22154b){try{if(!_[_0x2a41('0x24')](channels[_0x22154b[_0x2a41('0x7')]])){utils['debug'](util['format'](_0x2a41('0x2e'),_0x22154b[_0x2a41('0x7')]),_0x22154b);if(_[_0x2a41('0x24')](channels[_0x22154b['uniqueid']][_0x2a41('0x2f')])){channels[_0x22154b[_0x2a41('0x7')]][_0x2a41('0x2f')]=_0x22154b[_0x2a41('0x30')]+'\x20<'+_0x22154b[_0x2a41('0x10')]+'>';}utils[_0x2a41('0xa')](util[_0x2a41('0xb')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x22154b['uniqueid'],channels[_0x22154b[_0x2a41('0x7')]][_0x2a41('0x2f')],_0x22154b['cause-txt']));channels[_0x22154b[_0x2a41('0x7')]][_0x2a41('0x31')]=utils[_0x2a41('0x20')]();channels[_0x22154b[_0x2a41('0x7')]][_0x2a41('0x32')]=utils[_0x2a41('0x33')](channels[_0x22154b[_0x2a41('0x7')]]['endtime'],channels[_0x22154b['uniqueid']][_0x2a41('0x34')]);channels[_0x22154b['uniqueid']][_0x2a41('0x35')]=channels[_0x22154b[_0x2a41('0x7')]][_0x2a41('0x2b')]?utils['diffTime'](channels[_0x22154b[_0x2a41('0x7')]]['endtime'],channels[_0x22154b['uniqueid']][_0x2a41('0x2b')]):0x0;writeDB(channels[_0x22154b[_0x2a41('0x7')]]);}}catch(_0x3cec9d){utils[_0x2a41('0x22')](util[_0x2a41('0xb')](_0x2a41('0x2e'),_0x22154b[_0x2a41('0x7')]),_0x3cec9d);}};exports[_0x2a41('0x36')]=function(_0x265311){try{if(!_[_0x2a41('0x24')](channels[_0x265311[_0x2a41('0x37')]])){utils[_0x2a41('0x19')](util[_0x2a41('0xb')](_0x2a41('0x38'),_0x265311[_0x2a41('0x39')]),_0x265311);if(channels[_0x265311[_0x2a41('0x37')]]['channel']==_0x265311[_0x2a41('0x3a')]){utils[_0x2a41('0xa')](util[_0x2a41('0xb')](_0x2a41('0x3b'),_0x265311[_0x2a41('0x39')],_0x265311['localtwolinkedid'],_0x265311[_0x2a41('0x3c')]));channels[_0x265311[_0x2a41('0x37')]][_0x2a41('0x3d')]=_0x265311['secondtransfererchannel'];channels[_0x265311[_0x2a41('0x37')]][_0x2a41('0x3e')]='_attended';}else if(channels[_0x265311[_0x2a41('0x37')]][_0x2a41('0x1b')]=_0x265311[_0x2a41('0x3f')]){utils['info'](util[_0x2a41('0xb')](_0x2a41('0x3b'),_0x265311[_0x2a41('0x39')],_0x265311[_0x2a41('0x37')],_0x265311[_0x2a41('0x40')]));channels[_0x265311[_0x2a41('0x37')]][_0x2a41('0x3d')]=_0x265311[_0x2a41('0x40')];channels[_0x265311['localtwolinkedid']][_0x2a41('0x3e')]=_0x2a41('0x41');}}}catch(_0x2b933a){utils[_0x2a41('0x22')](util[_0x2a41('0xb')](_0x2a41('0x38'),_0x265311[_0x2a41('0x39')]),_0x2b933a);}};exports[_0x2a41('0x42')]=function(_0x4bd39b){try{if(!_[_0x2a41('0x24')](channels[_0x4bd39b['uniqueid']])){utils[_0x2a41('0x19')](util[_0x2a41('0xb')](_0x2a41('0x43'),_0x4bd39b[_0x2a41('0x7')]),_0x4bd39b);channels[_0x4bd39b[_0x2a41('0x7')]][_0x2a41('0x44')]=utils[_0x2a41('0x20')]();utils[_0x2a41('0xa')](util[_0x2a41('0xb')](_0x2a41('0x45'),_0x4bd39b[_0x2a41('0x7')],channels[_0x4bd39b[_0x2a41('0x7')]][_0x2a41('0x44')]));}}catch(_0x358666){utils[_0x2a41('0x22')](util[_0x2a41('0xb')](_0x2a41('0x43'),_0x4bd39b[_0x2a41('0x7')]),_0x358666);}};exports[_0x2a41('0x46')]=function(_0x5db126){try{if(!_[_0x2a41('0x24')](channels[_0x5db126[_0x2a41('0x7')]])){utils[_0x2a41('0x19')](util[_0x2a41('0xb')](_0x2a41('0x47'),_0x5db126['uniqueid']),_0x5db126);if(!_[_0x2a41('0x24')](channels[_0x5db126[_0x2a41('0x7')]][_0x2a41('0x44')])){channels[_0x5db126['uniqueid']][_0x2a41('0x48')]+=utils[_0x2a41('0x33')](utils[_0x2a41('0x20')](),channels[_0x5db126[_0x2a41('0x7')]][_0x2a41('0x44')]);utils['info'](util[_0x2a41('0xb')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5db126[_0x2a41('0x7')],channels[_0x5db126[_0x2a41('0x7')]][_0x2a41('0x48')]));delete channels[_0x5db126['uniqueid']]['musiconholdstartAt'];}}}catch(_0x309b96){utils['error'](util[_0x2a41('0xb')](_0x2a41('0x47'),_0x5db126[_0x2a41('0x7')]),_0x309b96);}};exports[_0x2a41('0x49')]=function(_0x4dd627){try{if(!_[_0x2a41('0x24')](channels[_0x4dd627[_0x2a41('0x7')]])){utils[_0x2a41('0x19')](util[_0x2a41('0xb')](_0x2a41('0x4a'),_0x4dd627[_0x2a41('0x7')]),_0x4dd627);if(!_[_0x2a41('0x24')](_0x4dd627[_0x2a41('0x4b')][_0x2a41('0x4c')])){utils['info'](util[_0x2a41('0xb')](_0x2a41('0x4d'),_0x4dd627[_0x2a41('0x7')],_0x4dd627[_0x2a41('0x4e')]));channels[_0x4dd627[_0x2a41('0x7')]][_0x2a41('0x4f')]=_0x4dd627['value'];}if(!_[_0x2a41('0x24')](_0x4dd627['variable'][_0x2a41('0x50')])){utils[_0x2a41('0xa')](util['format'](_0x2a41('0x51'),_0x4dd627[_0x2a41('0x7')],_0x4dd627[_0x2a41('0x4e')]));channels[_0x4dd627[_0x2a41('0x7')]]['destination']=_0x4dd627[_0x2a41('0x4e')];channels[_0x4dd627['uniqueid']][_0x2a41('0x2f')]='\x22'+_0x4dd627[_0x2a41('0x4e')]+_0x2a41('0x52')+_0x4dd627[_0x2a41('0x4e')]+'>';}if(!_[_0x2a41('0x24')](_0x4dd627[_0x2a41('0x4b')][_0x2a41('0x53')])||!_[_0x2a41('0x24')](_0x4dd627['variable']['xmd-callerid'])){utils[_0x2a41('0xa')](util[_0x2a41('0xb')](_0x2a41('0x54'),_0x4dd627[_0x2a41('0x7')],!_[_0x2a41('0x24')](_0x4dd627[_0x2a41('0x4b')]['xmd-callerid-preview'])?_0x2a41('0x53'):'xmd-callerid',_0x4dd627['value']));channels[_0x4dd627['uniqueid']][_0x2a41('0x2f')]=_0x4dd627[_0x2a41('0x4e')];}if(!_['isNil'](_0x4dd627['variable'][_0x2a41('0x55')])||!_[_0x2a41('0x24')](_0x4dd627['variable']['xmcs-queue'])){utils[_0x2a41('0xa')](util[_0x2a41('0xb')](_0x2a41('0x54'),_0x4dd627['uniqueid'],!_[_0x2a41('0x24')](_0x4dd627[_0x2a41('0x4b')][_0x2a41('0x55')])?'xmd-queue':'xmcs-queue',_0x4dd627[_0x2a41('0x4e')]));channels[_0x4dd627[_0x2a41('0x7')]][_0x2a41('0x56')]='Queue';channels[_0x4dd627[_0x2a41('0x7')]][_0x2a41('0x57')]=_0x4dd627['value'];channels[_0x4dd627['uniqueid']][_0x2a41('0xd')]=!![];}if(!_[_0x2a41('0x24')](_0x4dd627[_0x2a41('0x4b')][_0x2a41('0x58')])){utils[_0x2a41('0xa')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x4dd627[_0x2a41('0x7')],_0x4dd627['value']));channels[_0x4dd627['uniqueid']][_0x2a41('0x59')]=_0x4dd627[_0x2a41('0x4e')];}if(!_[_0x2a41('0x24')](_0x4dd627[_0x2a41('0x4b')][_0x2a41('0x5a')])){utils['info'](util[_0x2a41('0xb')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4dd627['uniqueid'],_0x4dd627[_0x2a41('0x4e')]));channels[_0x4dd627[_0x2a41('0x7')]][_0x2a41('0x5b')]=_0x4dd627[_0x2a41('0x4e')];}if(!_[_0x2a41('0x24')](_0x4dd627['variable'][_0x2a41('0x5c')])){utils[_0x2a41('0xa')](util['format'](_0x2a41('0x5d'),_0x4dd627[_0x2a41('0x7')],_0x4dd627[_0x2a41('0x4e')]));channels[_0x4dd627[_0x2a41('0x7')]][_0x2a41('0x5e')]=_0x4dd627[_0x2a41('0x4e')];}if(!_['isNil'](_0x4dd627[_0x2a41('0x4b')]['sipcallid'])){utils[_0x2a41('0xa')](util[_0x2a41('0xb')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x4dd627[_0x2a41('0x7')],_0x4dd627[_0x2a41('0x4e')]));channels[_0x4dd627[_0x2a41('0x7')]]['sipcallid']=_0x4dd627[_0x2a41('0x4e')];}}}catch(_0x233bfe){utils['error'](util['format'](_0x2a41('0x4a'),_0x4dd627[_0x2a41('0x7')]),_0x233bfe);}};exports[_0x2a41('0x5f')]=function(_0x5c8c35){try{if(!_['isNil'](channels[_0x5c8c35[_0x2a41('0x7')]])){utils[_0x2a41('0x19')](util[_0x2a41('0xb')](_0x2a41('0x60'),_0x5c8c35[_0x2a41('0x7')]),_0x5c8c35);utils['info'](util[_0x2a41('0xb')](_0x2a41('0x61'),_0x5c8c35[_0x2a41('0x7')],_0x5c8c35[_0x2a41('0x62')],_0x5c8c35[_0x2a41('0x63')]));if(_0x5c8c35[_0x2a41('0x62')][_0x2a41('0x64')]()==_0x2a41('0x65')&&_[_0x2a41('0x66')](_0x5c8c35[_0x2a41('0x63')][_0x2a41('0x64')](),_0x2a41('0x67'))){var _0x30378c=_0x5c8c35['appdata'][_0x2a41('0x68')]('=');var _0x45bc87=_0x30378c[0x0][_0x2a41('0x69')](_0x30378c[0x0][_0x2a41('0x6a')]('(')+0x1,_0x30378c[0x0]['lastIndexOf'](')'));var _0x37b06c=_0x30378c[0x1];channels[_0x5c8c35[_0x2a41('0x7')]][_0x45bc87]=_0x37b06c;}if(!_[_0x2a41('0x6b')]([_0x2a41('0x2d'),'noop',_0x2a41('0x6c'),_0x2a41('0x65'),_0x2a41('0x6d')],_0x5c8c35[_0x2a41('0x62')][_0x2a41('0x64')]())){channels[_0x5c8c35[_0x2a41('0x7')]][_0x2a41('0x56')]=_0x5c8c35['application'];channels[_0x5c8c35[_0x2a41('0x7')]][_0x2a41('0x57')]=_0x5c8c35[_0x2a41('0x63')];}}}catch(_0x110a12){utils[_0x2a41('0x22')](util['format'](_0x2a41('0x60'),_0x5c8c35[_0x2a41('0x7')]),_0x110a12);}};
\ No newline at end of file
index 4cc7fdc..3744420 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5f8=['[core]\x20shutdown','fullybooted','info','[core]\x20fullybooted','error','[core]\x20close','managerevent','connect','[core]\x20connected','shutdown'];(function(_0x51fa7d,_0x44406b){var _0x4f8f59=function(_0x3b969b){while(--_0x3b969b){_0x51fa7d['push'](_0x51fa7d['shift']());}};_0x4f8f59(++_0x44406b);}(_0xa5f8,0xf7));var _0x8a5f=function(_0x2d5a6d,_0x58f24f){_0x2d5a6d=_0x2d5a6d-0x0;var _0x1ced77=_0xa5f8[_0x2d5a6d];return _0x1ced77;};'use strict';var utils=require('./utils');exports[_0x8a5f('0x0')]=function(){utils['info'](_0x8a5f('0x1'));};exports[_0x8a5f('0x2')]=function(){utils['info'](_0x8a5f('0x3'));};exports[_0x8a5f('0x4')]=function(){utils[_0x8a5f('0x5')](_0x8a5f('0x6'));};exports[_0x8a5f('0x7')]=function(_0x4937ff){utils[_0x8a5f('0x7')]('[core]\x20error',_0x4937ff);};exports['close']=function(){utils[_0x8a5f('0x5')](_0x8a5f('0x8'));};exports[_0x8a5f('0x9')]=function(_0x5ba253){};
\ No newline at end of file
+var _0xe891=['close','[core]\x20close','managerevent','./utils','[core]\x20connected','shutdown','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x2060f7,_0x498137){var _0x4e6c6a=function(_0x50cf63){while(--_0x50cf63){_0x2060f7['push'](_0x2060f7['shift']());}};_0x4e6c6a(++_0x498137);}(_0xe891,0xcf));var _0x1e89=function(_0x4481e6,_0x423294){_0x4481e6=_0x4481e6-0x0;var _0x4b2a0d=_0xe891[_0x4481e6];return _0x4b2a0d;};'use strict';var utils=require(_0x1e89('0x0'));exports['connect']=function(){utils['info'](_0x1e89('0x1'));};exports[_0x1e89('0x2')]=function(){utils[_0x1e89('0x3')](_0x1e89('0x4'));};exports[_0x1e89('0x5')]=function(){utils['info'](_0x1e89('0x6'));};exports[_0x1e89('0x7')]=function(_0xde293a){utils['error'](_0x1e89('0x8'),_0xde293a);};exports[_0x1e89('0x9')]=function(){utils[_0x1e89('0x3')](_0x1e89('0xa'));};exports[_0x1e89('0xb')]=function(_0x50e7f6){};
\ No newline at end of file
index 21ce594..147a32c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a2=['error','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','value'];(function(_0x356481,_0x129ce3){var _0x77e370=function(_0x319fb4){while(--_0x319fb4){_0x356481['push'](_0x356481['shift']());}};_0x77e370(++_0x129ce3);}(_0xd3a2,0x17c));var _0x2d3a=function(_0x34768e,_0x589e73){_0x34768e=_0x34768e-0x0;var _0x5d13e6=_0xd3a2[_0x34768e];return _0x5d13e6;};'use strict';var _=require(_0x2d3a('0x0'));var util=require(_0x2d3a('0x1'));var utils=require(_0x2d3a('0x2'));var dials={};function writeDB(_0x1c896f){utils[_0x2d3a('0x3')](util[_0x2d3a('0x4')](_0x2d3a('0x5'),_0x1c896f[_0x2d3a('0x6')],_0x1c896f[_0x2d3a('0x7')],_0x1c896f[_0x2d3a('0x8')],_0x1c896f[_0x2d3a('0x9')],_0x1c896f[_0x2d3a('0xa')],_0x1c896f[_0x2d3a('0xb')]));utils[_0x2d3a('0xc')]('CreateVoiceDialReport',_0x1c896f);delete dials[_0x1c896f[_0x2d3a('0x6')]];}exports['newexten']=function(_0x3418cb){try{utils['debug'](util[_0x2d3a('0x4')](_0x2d3a('0xd'),_0x3418cb[_0x2d3a('0x6')]),_0x3418cb);utils[_0x2d3a('0x3')](util[_0x2d3a('0x4')](_0x2d3a('0xe'),_0x3418cb[_0x2d3a('0x6')],_0x3418cb[_0x2d3a('0xf')],_0x3418cb[_0x2d3a('0x10')]));if(_0x3418cb[_0x2d3a('0xf')][_0x2d3a('0x11')]()==_0x2d3a('0x12')&&_[_0x2d3a('0x13')](_0x3418cb[_0x2d3a('0x10')][_0x2d3a('0x11')](),_0x2d3a('0x14'))){var _0xb02906=_0x3418cb[_0x2d3a('0x10')][_0x2d3a('0x15')]('=');dials[_0x3418cb[_0x2d3a('0x6')]]={'routeId':_0xb02906[0x1]};}}catch(_0x87d43){utils['error'](util[_0x2d3a('0x4')](_0x2d3a('0xd'),_0x3418cb[_0x2d3a('0x6')]),_0x87d43);}};exports['varset']=function(_0x5b7e67){try{utils[_0x2d3a('0x16')](util[_0x2d3a('0x4')](_0x2d3a('0x17'),_0x5b7e67[_0x2d3a('0x6')]),_0x5b7e67);if(!_[_0x2d3a('0x18')](_0x5b7e67[_0x2d3a('0x19')][_0x2d3a('0x1a')])){utils[_0x2d3a('0x3')](util[_0x2d3a('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x5b7e67['uniqueid'],_0x5b7e67[_0x2d3a('0x1b')]));dials[_0x5b7e67[_0x2d3a('0x6')]]={'routeId':_0x5b7e67['value']};}}catch(_0x3b90ba){utils[_0x2d3a('0x1c')](util[_0x2d3a('0x4')](_0x2d3a('0x17'),_0x5b7e67[_0x2d3a('0x6')]),_0x3b90ba);}};exports[_0x2d3a('0x1d')]=function(_0x43653){try{if(!_[_0x2d3a('0x18')](dials[_0x43653['uniqueid']])){utils[_0x2d3a('0x16')](util[_0x2d3a('0x4')](_0x2d3a('0x1e'),_0x43653[_0x2d3a('0x6')]),_0x43653);dials[_0x43653[_0x2d3a('0x6')]]=_[_0x2d3a('0x1f')](dials[_0x43653[_0x2d3a('0x6')]],_0x43653);dials[_0x43653[_0x2d3a('0x6')]]['starttime']=utils[_0x2d3a('0x20')]();dials[_0x43653['uniqueid']][_0x2d3a('0x21')]='called';utils[_0x2d3a('0x3')](util[_0x2d3a('0x4')](_0x2d3a('0x22'),_0x43653[_0x2d3a('0x6')],dials[_0x43653['uniqueid']][_0x2d3a('0x23')]));}}catch(_0x294eae){utils[_0x2d3a('0x1c')](util[_0x2d3a('0x4')](_0x2d3a('0x1e'),_0x43653[_0x2d3a('0x6')]),_0x294eae);}};exports[_0x2d3a('0x24')]=function(_0xbcf569){try{if(!_[_0x2d3a('0x18')](dials[_0xbcf569['uniqueid']])){utils['debug'](util[_0x2d3a('0x4')](_0x2d3a('0x25'),_0xbcf569[_0x2d3a('0x6')]),_0xbcf569);dials[_0xbcf569[_0x2d3a('0x6')]]['dialstatus']=_0xbcf569[_0x2d3a('0xb')];if(_0xbcf569['dialstatus']=='ANSWER'){dials[_0xbcf569[_0x2d3a('0x6')]]=_[_0x2d3a('0x1f')](dials[_0xbcf569['uniqueid']],_0xbcf569);dials[_0xbcf569[_0x2d3a('0x6')]][_0x2d3a('0x26')]=utils[_0x2d3a('0x20')]();dials[_0xbcf569[_0x2d3a('0x6')]][_0x2d3a('0x21')]='connect';utils[_0x2d3a('0x3')](util[_0x2d3a('0x4')](_0x2d3a('0x27'),_0xbcf569['uniqueid'],_0xbcf569['dialstatus'],dials[_0xbcf569[_0x2d3a('0x6')]][_0x2d3a('0x26')]));}else{utils[_0x2d3a('0x3')](util[_0x2d3a('0x4')](_0x2d3a('0x28'),_0xbcf569[_0x2d3a('0x6')],_0xbcf569[_0x2d3a('0xb')]));}}}catch(_0x1ff444){utils[_0x2d3a('0x1c')](util['format'](_0x2d3a('0x25'),_0xbcf569[_0x2d3a('0x6')]),_0x1ff444);}};exports[_0x2d3a('0x29')]=function(_0xf5c4ab){try{if(!_[_0x2d3a('0x18')](dials[_0xf5c4ab[_0x2d3a('0x6')]])){utils['debug'](util[_0x2d3a('0x4')](_0x2d3a('0x2a'),_0xf5c4ab[_0x2d3a('0x6')]),_0xf5c4ab);utils[_0x2d3a('0x3')](util[_0x2d3a('0x4')](_0x2d3a('0x2b'),_0xf5c4ab['uniqueid'],_0xf5c4ab[_0x2d3a('0x9')],_0xf5c4ab[_0x2d3a('0x2c')],_0xf5c4ab[_0x2d3a('0x2d')]));dials[_0xf5c4ab[_0x2d3a('0x6')]]=_[_0x2d3a('0x1f')](dials[_0xf5c4ab[_0x2d3a('0x6')]],{'endtime':utils[_0x2d3a('0x20')](),'lastevent':'complete'});dials[_0xf5c4ab[_0x2d3a('0x6')]][_0x2d3a('0x2e')]=utils[_0x2d3a('0x2f')](dials[_0xf5c4ab[_0x2d3a('0x6')]][_0x2d3a('0x30')],dials[_0xf5c4ab['uniqueid']][_0x2d3a('0x23')]);dials[_0xf5c4ab['uniqueid']][_0x2d3a('0x31')]=utils['diffTime'](dials[_0xf5c4ab[_0x2d3a('0x6')]]['answertime']||dials[_0xf5c4ab[_0x2d3a('0x6')]]['endtime'],dials[_0xf5c4ab[_0x2d3a('0x6')]][_0x2d3a('0x23')]);dials[_0xf5c4ab[_0x2d3a('0x6')]][_0x2d3a('0x32')]=dials[_0xf5c4ab[_0x2d3a('0x6')]][_0x2d3a('0x26')]?utils[_0x2d3a('0x2f')](dials[_0xf5c4ab[_0x2d3a('0x6')]][_0x2d3a('0x30')],dials[_0xf5c4ab['uniqueid']][_0x2d3a('0x26')]):0x0;writeDB(dials[_0xf5c4ab[_0x2d3a('0x6')]]);}}catch(_0x19f6ee){utils[_0x2d3a('0x1c')](util[_0x2d3a('0x4')](_0x2d3a('0x2a'),_0xf5c4ab[_0x2d3a('0x6')]),_0x19f6ee);}};
\ No newline at end of file
+var _0xa7a4=['debug','format','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','varset','[%s][dials][varset]','variable','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','uniqueid','newexten'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xa7a4,0xb5));var _0x4a7a=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0xa7a4[_0x2a558d];return _0xa7bc9c;};'use strict';var _=require(_0x4a7a('0x0'));var util=require(_0x4a7a('0x1'));var utils=require(_0x4a7a('0x2'));var dials={};function writeDB(_0x5b162b){utils[_0x4a7a('0x3')](util['format'](_0x4a7a('0x4'),_0x5b162b['uniqueid'],_0x5b162b['channel'],_0x5b162b['dialstring'],_0x5b162b[_0x4a7a('0x5')],_0x5b162b[_0x4a7a('0x6')],_0x5b162b[_0x4a7a('0x7')]));utils['request'](_0x4a7a('0x8'),_0x5b162b);delete dials[_0x5b162b[_0x4a7a('0x9')]];}exports[_0x4a7a('0xa')]=function(_0x47eacf){try{utils[_0x4a7a('0xb')](util[_0x4a7a('0xc')](_0x4a7a('0xd'),_0x47eacf[_0x4a7a('0x9')]),_0x47eacf);utils[_0x4a7a('0x3')](util[_0x4a7a('0xc')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x47eacf[_0x4a7a('0x9')],_0x47eacf[_0x4a7a('0xe')],_0x47eacf[_0x4a7a('0xf')]));if(_0x47eacf[_0x4a7a('0xe')][_0x4a7a('0x10')]()==_0x4a7a('0x11')&&_[_0x4a7a('0x12')](_0x47eacf[_0x4a7a('0xf')][_0x4a7a('0x10')](),_0x4a7a('0x13'))){var _0x294ee2=_0x47eacf[_0x4a7a('0xf')]['split']('=');dials[_0x47eacf[_0x4a7a('0x9')]]={'routeId':_0x294ee2[0x1]};}}catch(_0x254602){utils[_0x4a7a('0x14')](util[_0x4a7a('0xc')]('[%s][dials][newexten]',_0x47eacf[_0x4a7a('0x9')]),_0x254602);}};exports[_0x4a7a('0x15')]=function(_0x342143){try{utils[_0x4a7a('0xb')](util['format'](_0x4a7a('0x16'),_0x342143[_0x4a7a('0x9')]),_0x342143);if(!_['isNil'](_0x342143[_0x4a7a('0x17')]['outboundrouteid'])){utils[_0x4a7a('0x3')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x342143[_0x4a7a('0x9')],_0x342143['value']));dials[_0x342143[_0x4a7a('0x9')]]={'routeId':_0x342143['value']};}}catch(_0x5484fc){utils[_0x4a7a('0x14')](util[_0x4a7a('0xc')](_0x4a7a('0x16'),_0x342143['uniqueid']),_0x5484fc);}};exports[_0x4a7a('0x18')]=function(_0x4a9b07){try{if(!_[_0x4a7a('0x19')](dials[_0x4a9b07['uniqueid']])){utils[_0x4a7a('0xb')](util['format'](_0x4a7a('0x1a'),_0x4a9b07[_0x4a7a('0x9')]),_0x4a9b07);dials[_0x4a9b07[_0x4a7a('0x9')]]=_[_0x4a7a('0x1b')](dials[_0x4a9b07['uniqueid']],_0x4a9b07);dials[_0x4a9b07[_0x4a7a('0x9')]][_0x4a7a('0x1c')]=utils[_0x4a7a('0x1d')]();dials[_0x4a9b07['uniqueid']][_0x4a7a('0x1e')]='called';utils[_0x4a7a('0x3')](util['format'](_0x4a7a('0x1f'),_0x4a9b07['uniqueid'],dials[_0x4a9b07[_0x4a7a('0x9')]][_0x4a7a('0x1c')]));}}catch(_0x4626aa){utils['error'](util[_0x4a7a('0xc')](_0x4a7a('0x1a'),_0x4a9b07[_0x4a7a('0x9')]),_0x4626aa);}};exports[_0x4a7a('0x20')]=function(_0x1ce26f){try{if(!_[_0x4a7a('0x19')](dials[_0x1ce26f[_0x4a7a('0x9')]])){utils['debug'](util[_0x4a7a('0xc')](_0x4a7a('0x21'),_0x1ce26f['uniqueid']),_0x1ce26f);dials[_0x1ce26f['uniqueid']][_0x4a7a('0x7')]=_0x1ce26f[_0x4a7a('0x7')];if(_0x1ce26f['dialstatus']==_0x4a7a('0x22')){dials[_0x1ce26f[_0x4a7a('0x9')]]=_[_0x4a7a('0x1b')](dials[_0x1ce26f['uniqueid']],_0x1ce26f);dials[_0x1ce26f['uniqueid']][_0x4a7a('0x23')]=utils['now']();dials[_0x1ce26f[_0x4a7a('0x9')]]['lastevent']=_0x4a7a('0x24');utils[_0x4a7a('0x3')](util[_0x4a7a('0xc')](_0x4a7a('0x25'),_0x1ce26f[_0x4a7a('0x9')],_0x1ce26f['dialstatus'],dials[_0x1ce26f[_0x4a7a('0x9')]]['answertime']));}else{utils[_0x4a7a('0x3')](util['format'](_0x4a7a('0x26'),_0x1ce26f[_0x4a7a('0x9')],_0x1ce26f[_0x4a7a('0x7')]));}}}catch(_0x12f5ba){utils['error'](util['format'](_0x4a7a('0x21'),_0x1ce26f[_0x4a7a('0x9')]),_0x12f5ba);}};exports[_0x4a7a('0x27')]=function(_0x1b921c){try{if(!_[_0x4a7a('0x19')](dials[_0x1b921c[_0x4a7a('0x9')]])){utils[_0x4a7a('0xb')](util[_0x4a7a('0xc')]('[%s][dials][hangup]',_0x1b921c['uniqueid']),_0x1b921c);utils[_0x4a7a('0x3')](util['format'](_0x4a7a('0x28'),_0x1b921c[_0x4a7a('0x9')],_0x1b921c['calleridnum'],_0x1b921c[_0x4a7a('0x29')],_0x1b921c[_0x4a7a('0x2a')]));dials[_0x1b921c['uniqueid']]=_[_0x4a7a('0x1b')](dials[_0x1b921c['uniqueid']],{'endtime':utils[_0x4a7a('0x1d')](),'lastevent':_0x4a7a('0x2b')});dials[_0x1b921c['uniqueid']]['duration']=utils[_0x4a7a('0x2c')](dials[_0x1b921c[_0x4a7a('0x9')]][_0x4a7a('0x2d')],dials[_0x1b921c[_0x4a7a('0x9')]]['starttime']);dials[_0x1b921c[_0x4a7a('0x9')]][_0x4a7a('0x2e')]=utils[_0x4a7a('0x2c')](dials[_0x1b921c[_0x4a7a('0x9')]][_0x4a7a('0x23')]||dials[_0x1b921c[_0x4a7a('0x9')]][_0x4a7a('0x2d')],dials[_0x1b921c['uniqueid']][_0x4a7a('0x1c')]);dials[_0x1b921c[_0x4a7a('0x9')]][_0x4a7a('0x2f')]=dials[_0x1b921c[_0x4a7a('0x9')]][_0x4a7a('0x23')]?utils['diffTime'](dials[_0x1b921c[_0x4a7a('0x9')]][_0x4a7a('0x2d')],dials[_0x1b921c[_0x4a7a('0x9')]]['answertime']):0x0;writeDB(dials[_0x1b921c['uniqueid']]);}}catch(_0x1095e8){utils[_0x4a7a('0x14')](util[_0x4a7a('0xc')]('[%s][dials][hangup]',_0x1b921c[_0x4a7a('0x9')]),_0x1095e8);}};
\ No newline at end of file
index 220bc4a..899f12f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1db9=['./core.controller','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','env','production','local','asterisk','username','password','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./transfers.controller'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x1db9,0x176));var _0x91db=function(_0x2c13a2,_0x323d3c){_0x2c13a2=_0x2c13a2-0x0;var _0x15622f=_0x1db9[_0x2c13a2];return _0x15622f;};var AsteriskManager=require(_0x91db('0x0'));var config=require(_0x91db('0x1'));var utils=require(_0x91db('0x2'));var util=require(_0x91db('0x3'));var isXDREnabled=config[_0x91db('0x4')]&&!config[_0x91db('0x4')]['disabled'];var isProduction=config[_0x91db('0x5')]===_0x91db('0x6')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0x91db('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config[_0x91db('0x8')]['ip'],config[_0x91db('0x8')][_0x91db('0x9')],config[_0x91db('0x8')][_0x91db('0xa')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x91db('0xb')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x91db('0xb')](_0x91db('0xc'));}else{var agents=require(_0x91db('0xd'));var calls=require('./calls.controller');var queues=require(_0x91db('0xe'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x91db('0xf'));var core=require(_0x91db('0x10'));ami['on']('connect',core['connect']);ami['on'](_0x91db('0x11'),core[_0x91db('0x11')]);ami['on'](_0x91db('0x12'),core[_0x91db('0x12')]);ami['on'](_0x91db('0x13'),core['error']);ami['on'](_0x91db('0x14'),core[_0x91db('0x14')]);ami['on'](_0x91db('0x15'),core[_0x91db('0x15')]);ami['on'](_0x91db('0x16'),function(_0x33b39d){try{utils[_0x91db('0x17')](util[_0x91db('0x18')](_0x91db('0x19'),_0x33b39d[_0x91db('0x1a')]),_0x33b39d);members[_0x91db('0x16')](_0x33b39d);}catch(_0x12416f){utils['error'](util[_0x91db('0x18')](_0x91db('0x19'),_0x33b39d[_0x91db('0x1a')]),_0x12416f);}});ami['on'](_0x91db('0x1b'),function(_0xeb51b0){try{utils[_0x91db('0x17')](util['format']('[%s][index][agentcalled]',_0xeb51b0[_0x91db('0x1c')]),_0xeb51b0);agents[_0x91db('0x1b')](_0xeb51b0);}catch(_0x2c3915){utils[_0x91db('0x13')](util['format'](_0x91db('0x1d'),_0xeb51b0[_0x91db('0x1c')]),_0x2c3915);}});ami['on'](_0x91db('0x1e'),function(_0x23c287){try{utils[_0x91db('0x17')](util[_0x91db('0x18')](_0x91db('0x1f'),_0x23c287[_0x91db('0x1c')]),_0x23c287);agents[_0x91db('0x1e')](_0x23c287);}catch(_0x31295f){utils['error'](util['format'](_0x91db('0x1f'),_0x23c287[_0x91db('0x1c')]),_0x31295f);}});ami['on']('agentconnect',function(_0xc82085){try{utils[_0x91db('0x17')](util[_0x91db('0x18')](_0x91db('0x20'),_0xc82085[_0x91db('0x1c')]),_0xc82085);agents['agentconnect'](_0xc82085);queues['agentconnect'](_0xc82085);}catch(_0x42e53f){utils[_0x91db('0x13')](util[_0x91db('0x18')]('[%s][index][agentconnect]',_0xc82085[_0x91db('0x1c')]),_0x42e53f);}});ami['on'](_0x91db('0x21'),function(_0x46c0e8){try{utils[_0x91db('0x17')](util['format'](_0x91db('0x22'),_0x46c0e8[_0x91db('0x1c')]),_0x46c0e8);agents[_0x91db('0x21')](_0x46c0e8);queues['agentcomplete'](_0x46c0e8);members[_0x91db('0x21')](_0x46c0e8);}catch(_0x69fdc2){utils[_0x91db('0x13')](util[_0x91db('0x18')](_0x91db('0x22'),_0x46c0e8[_0x91db('0x1c')]),_0x69fdc2);}});ami['on'](_0x91db('0x23'),function(_0x1b5a7b){try{utils[_0x91db('0x17')](util[_0x91db('0x18')](_0x91db('0x24'),_0x1b5a7b[_0x91db('0x1c')]),_0x1b5a7b);agents[_0x91db('0x23')](_0x1b5a7b);queues[_0x91db('0x23')](_0x1b5a7b);}catch(_0x5a6d47){utils[_0x91db('0x13')](util[_0x91db('0x18')](_0x91db('0x24'),_0x1b5a7b[_0x91db('0x1c')]),_0x5a6d47);}});ami['on'](_0x91db('0x25'),function(_0x593920){try{utils[_0x91db('0x17')](util[_0x91db('0x18')](_0x91db('0x26'),_0x593920['uniqueid']),_0x593920);queues[_0x91db('0x25')](_0x593920);recordings['queuecallerjoin'](_0x593920);}catch(_0x458e47){utils[_0x91db('0x13')](util[_0x91db('0x18')](_0x91db('0x26'),_0x593920['uniqueid']),_0x458e47);}});ami['on'](_0x91db('0x27'),function(_0xeace1d){try{utils[_0x91db('0x17')](util['format'](_0x91db('0x28'),_0xeace1d[_0x91db('0x1c')]),_0xeace1d);queues['queuecallerleave'](_0xeace1d);}catch(_0x451639){utils[_0x91db('0x13')](util['format'](_0x91db('0x28'),_0xeace1d['uniqueid']),_0x451639);}});ami['on'](_0x91db('0x29'),function(_0x42db53){try{utils['debug'](util['format']('[%s][index][musiconholdstart]',_0x42db53[_0x91db('0x1c')]),_0x42db53);queues[_0x91db('0x29')](_0x42db53);calls['musiconholdstart'](_0x42db53);}catch(_0x1cda26){utils[_0x91db('0x13')](util[_0x91db('0x18')](_0x91db('0x2a'),_0x42db53[_0x91db('0x1c')]),_0x1cda26);}});ami['on'](_0x91db('0x2b'),function(_0x1862f6){try{utils[_0x91db('0x17')](util[_0x91db('0x18')](_0x91db('0x2c'),_0x1862f6[_0x91db('0x1c')]),_0x1862f6);queues['musiconholdstop'](_0x1862f6);calls[_0x91db('0x2b')](_0x1862f6);}catch(_0x50c414){utils[_0x91db('0x13')](util[_0x91db('0x18')]('[%s][index][musiconholdstop]',_0x1862f6[_0x91db('0x1c')]),_0x50c414);}});ami['on'](_0x91db('0x2d'),function(_0x16a7e9){try{utils[_0x91db('0x17')](util[_0x91db('0x18')]('[%s][index][newstate]',_0x16a7e9[_0x91db('0x1c')]),_0x16a7e9);calls[_0x91db('0x2d')](_0x16a7e9);recordings[_0x91db('0x2d')](_0x16a7e9);}catch(_0x55188b){utils[_0x91db('0x13')](util[_0x91db('0x18')](_0x91db('0x2e'),_0x16a7e9['uniqueid']),_0x55188b);}});ami['on'](_0x91db('0x2f'),function(_0x2b7830){try{utils[_0x91db('0x17')](util[_0x91db('0x18')](_0x91db('0x30'),_0x2b7830['uniqueid']),_0x2b7830);calls[_0x91db('0x2f')](_0x2b7830);recordings['hangup'](_0x2b7830);dials[_0x91db('0x2f')](_0x2b7830);agents[_0x91db('0x2f')](_0x2b7830);queues[_0x91db('0x2f')](_0x2b7830);}catch(_0x3e07fc){utils[_0x91db('0x13')](util[_0x91db('0x18')](_0x91db('0x30'),_0x2b7830[_0x91db('0x1c')]),_0x3e07fc);}});ami['on'](_0x91db('0x31'),function(_0x219b1a){try{utils[_0x91db('0x17')](util['format']('[%s][index][cdr]',_0x219b1a[_0x91db('0x1c')]),_0x219b1a);members[_0x91db('0x31')](_0x219b1a);}catch(_0x2775f6){utils['error'](util[_0x91db('0x18')](_0x91db('0x32'),_0x219b1a[_0x91db('0x1c')]),_0x2775f6);}});ami['on'](_0x91db('0x33'),function(_0xd09147){try{utils['debug'](util[_0x91db('0x18')]('[%s][index][blindtransfer]',_0xd09147[_0x91db('0x1c')]),_0xd09147);queues[_0x91db('0x33')](_0xd09147);agents[_0x91db('0x33')](_0xd09147);transfers[_0x91db('0x33')](_0xd09147);recordings[_0x91db('0x33')](_0xd09147);}catch(_0x465bcc){utils[_0x91db('0x13')](util[_0x91db('0x18')](_0x91db('0x34'),_0xd09147['uniqueid']),_0x465bcc);}});ami['on']('attendedtransfer',function(_0x44fb24){try{utils[_0x91db('0x17')](util[_0x91db('0x18')](_0x91db('0x35'),_0x44fb24[_0x91db('0x36')]),_0x44fb24);queues['attendedtransfer'](_0x44fb24);transfers[_0x91db('0x37')](_0x44fb24);agents[_0x91db('0x37')](_0x44fb24);calls[_0x91db('0x37')](_0x44fb24);}catch(_0x2dbd11){utils[_0x91db('0x13')](util['format'](_0x91db('0x35'),_0x44fb24[_0x91db('0x36')]),_0x2dbd11);}});ami['on'](_0x91db('0x38'),function(_0x9b6a4e){try{utils[_0x91db('0x17')](util[_0x91db('0x18')]('[%s][index][varset]',_0x9b6a4e['uniqueid']),_0x9b6a4e);queues[_0x91db('0x38')](_0x9b6a4e);recordings['varset'](_0x9b6a4e);calls[_0x91db('0x38')](_0x9b6a4e);dials['varset'](_0x9b6a4e);}catch(_0x54c327){utils[_0x91db('0x13')](util[_0x91db('0x18')](_0x91db('0x39'),_0x9b6a4e['uniqueid']),_0x54c327);}});ami['on'](_0x91db('0x3a'),function(_0x462e71){try{utils[_0x91db('0x17')](util['format']('[%s][index][newexten]',_0x462e71[_0x91db('0x1c')]),_0x462e71);calls[_0x91db('0x3a')](_0x462e71);recordings['newexten'](_0x462e71);dials[_0x91db('0x3a')](_0x462e71);}catch(_0x4df392){utils[_0x91db('0x13')](util[_0x91db('0x18')](_0x91db('0x3b'),_0x462e71[_0x91db('0x1c')]),_0x4df392);}});ami['on']('newchannel',function(_0x3f98de){try{utils[_0x91db('0x17')](util[_0x91db('0x18')](_0x91db('0x3c'),_0x3f98de[_0x91db('0x1c')]),_0x3f98de);calls[_0x91db('0x3d')](_0x3f98de);recordings[_0x91db('0x3d')](_0x3f98de);}catch(_0x20d41b){utils[_0x91db('0x13')](util[_0x91db('0x18')]('[%s][index][newchannel]',_0x3f98de[_0x91db('0x1c')]),_0x20d41b);}});ami['on'](_0x91db('0x3e'),function(_0x445c2b){try{utils[_0x91db('0x17')](util[_0x91db('0x18')]('[%s][index][dialbegin]',_0x445c2b[_0x91db('0x1c')]),_0x445c2b);dials['dialbegin'](_0x445c2b);}catch(_0x1a22dd){utils[_0x91db('0x13')](util['format']('[%s]dialbegin',_0x445c2b[_0x91db('0x1c')]),_0x1a22dd);}});ami['on'](_0x91db('0x3f'),function(_0xf48f2){try{utils['debug'](util[_0x91db('0x18')](_0x91db('0x40'),_0xf48f2[_0x91db('0x1c')]),_0xf48f2);dials[_0x91db('0x3f')](_0xf48f2);}catch(_0x2678f1){utils[_0x91db('0x13')](util['format'](_0x91db('0x40'),_0xf48f2[_0x91db('0x1c')]),_0x2678f1);}});}
\ No newline at end of file
+var _0x4250=['format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','debug','[%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]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','[%s][index][devicestatechange]','device'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4250,0x146));var _0x0425=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x4250[_0x47e7cb];return _0x2a8874;};var AsteriskManager=require(_0x0425('0x0'));var config=require(_0x0425('0x1'));var utils=require(_0x0425('0x2'));var util=require(_0x0425('0x3'));var isXDREnabled=config['xdr']&&!config[_0x0425('0x4')][_0x0425('0x5')];var isProduction=config[_0x0425('0x6')]==='production'||![];var isLocalAsterisk=config[_0x0425('0x4')]&&config[_0x0425('0x4')][_0x0425('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x0425('0x8')][_0x0425('0x9')],config[_0x0425('0x8')]['ip'],config[_0x0425('0x8')][_0x0425('0xa')],config[_0x0425('0x8')][_0x0425('0xb')],!![]);ami[_0x0425('0xc')]();if(!isXDREnabled){utils[_0x0425('0xd')](_0x0425('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x0425('0xd')](_0x0425('0xf'));}else{var agents=require(_0x0425('0x10'));var calls=require(_0x0425('0x11'));var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0x0425('0x12'));var dials=require('./dials.controller');var transfers=require(_0x0425('0x13'));var core=require(_0x0425('0x14'));ami['on']('connect',core[_0x0425('0x15')]);ami['on'](_0x0425('0x16'),core[_0x0425('0x16')]);ami['on'](_0x0425('0x17'),core['fullybooted']);ami['on'](_0x0425('0x18'),core[_0x0425('0x18')]);ami['on']('close',core['close']);ami['on']('managerevent',core[_0x0425('0x19')]);ami['on'](_0x0425('0x1a'),function(_0x1cd255){try{utils['debug'](util['format'](_0x0425('0x1b'),_0x1cd255[_0x0425('0x1c')]),_0x1cd255);members[_0x0425('0x1a')](_0x1cd255);}catch(_0x376621){utils[_0x0425('0x18')](util[_0x0425('0x1d')](_0x0425('0x1b'),_0x1cd255[_0x0425('0x1c')]),_0x376621);}});ami['on'](_0x0425('0x1e'),function(_0x3fe230){try{utils['debug'](util[_0x0425('0x1d')](_0x0425('0x1f'),_0x3fe230[_0x0425('0x20')]),_0x3fe230);agents[_0x0425('0x1e')](_0x3fe230);}catch(_0x3f2d7a){utils[_0x0425('0x18')](util[_0x0425('0x1d')](_0x0425('0x1f'),_0x3fe230[_0x0425('0x20')]),_0x3f2d7a);}});ami['on'](_0x0425('0x21'),function(_0x522888){try{utils[_0x0425('0x22')](util['format'](_0x0425('0x23'),_0x522888[_0x0425('0x20')]),_0x522888);agents[_0x0425('0x21')](_0x522888);}catch(_0x10d3b4){utils[_0x0425('0x18')](util[_0x0425('0x1d')](_0x0425('0x23'),_0x522888[_0x0425('0x20')]),_0x10d3b4);}});ami['on']('agentconnect',function(_0x3a4a37){try{utils['debug'](util[_0x0425('0x1d')](_0x0425('0x24'),_0x3a4a37[_0x0425('0x20')]),_0x3a4a37);agents['agentconnect'](_0x3a4a37);queues[_0x0425('0x25')](_0x3a4a37);}catch(_0x2b4e98){utils[_0x0425('0x18')](util[_0x0425('0x1d')](_0x0425('0x24'),_0x3a4a37[_0x0425('0x20')]),_0x2b4e98);}});ami['on'](_0x0425('0x26'),function(_0x43db4f){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x27'),_0x43db4f[_0x0425('0x20')]),_0x43db4f);agents[_0x0425('0x26')](_0x43db4f);queues['agentcomplete'](_0x43db4f);members[_0x0425('0x26')](_0x43db4f);}catch(_0x9ce829){utils[_0x0425('0x18')](util[_0x0425('0x1d')](_0x0425('0x27'),_0x43db4f[_0x0425('0x20')]),_0x9ce829);}});ami['on'](_0x0425('0x28'),function(_0x240462){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x29'),_0x240462[_0x0425('0x20')]),_0x240462);agents[_0x0425('0x28')](_0x240462);queues[_0x0425('0x28')](_0x240462);}catch(_0x17556f){utils[_0x0425('0x18')](util[_0x0425('0x1d')](_0x0425('0x29'),_0x240462[_0x0425('0x20')]),_0x17556f);}});ami['on'](_0x0425('0x2a'),function(_0x8d8f58){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x2b'),_0x8d8f58['uniqueid']),_0x8d8f58);queues[_0x0425('0x2a')](_0x8d8f58);recordings['queuecallerjoin'](_0x8d8f58);}catch(_0x22b4b4){utils[_0x0425('0x18')](util[_0x0425('0x1d')](_0x0425('0x2b'),_0x8d8f58[_0x0425('0x20')]),_0x22b4b4);}});ami['on']('queuecallerleave',function(_0x215762){try{utils['debug'](util[_0x0425('0x1d')](_0x0425('0x2c'),_0x215762['uniqueid']),_0x215762);queues[_0x0425('0x2d')](_0x215762);}catch(_0x4668da){utils[_0x0425('0x18')](util['format'](_0x0425('0x2c'),_0x215762[_0x0425('0x20')]),_0x4668da);}});ami['on'](_0x0425('0x2e'),function(_0x121481){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x2f'),_0x121481['uniqueid']),_0x121481);queues['musiconholdstart'](_0x121481);calls['musiconholdstart'](_0x121481);}catch(_0x44c2ff){utils['error'](util[_0x0425('0x1d')](_0x0425('0x2f'),_0x121481[_0x0425('0x20')]),_0x44c2ff);}});ami['on'](_0x0425('0x30'),function(_0x1a0714){try{utils['debug'](util[_0x0425('0x1d')](_0x0425('0x31'),_0x1a0714[_0x0425('0x20')]),_0x1a0714);queues[_0x0425('0x30')](_0x1a0714);calls[_0x0425('0x30')](_0x1a0714);}catch(_0x208581){utils[_0x0425('0x18')](util['format'](_0x0425('0x31'),_0x1a0714[_0x0425('0x20')]),_0x208581);}});ami['on'](_0x0425('0x32'),function(_0x3238fe){try{utils['debug'](util[_0x0425('0x1d')](_0x0425('0x33'),_0x3238fe['uniqueid']),_0x3238fe);calls[_0x0425('0x32')](_0x3238fe);recordings[_0x0425('0x32')](_0x3238fe);}catch(_0xe322de){utils['error'](util[_0x0425('0x1d')](_0x0425('0x33'),_0x3238fe[_0x0425('0x20')]),_0xe322de);}});ami['on'](_0x0425('0x34'),function(_0x8ba4f9){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x35'),_0x8ba4f9['uniqueid']),_0x8ba4f9);calls[_0x0425('0x34')](_0x8ba4f9);recordings[_0x0425('0x34')](_0x8ba4f9);dials[_0x0425('0x34')](_0x8ba4f9);agents['hangup'](_0x8ba4f9);queues[_0x0425('0x34')](_0x8ba4f9);}catch(_0x197bbc){utils[_0x0425('0x18')](util[_0x0425('0x1d')]('[%s][index][hangup]',_0x8ba4f9[_0x0425('0x20')]),_0x197bbc);}});ami['on'](_0x0425('0x36'),function(_0x341218){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x37'),_0x341218[_0x0425('0x20')]),_0x341218);members[_0x0425('0x36')](_0x341218);}catch(_0x2f9c4d){utils[_0x0425('0x18')](util[_0x0425('0x1d')](_0x0425('0x37'),_0x341218[_0x0425('0x20')]),_0x2f9c4d);}});ami['on'](_0x0425('0x38'),function(_0x12ad77){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x39'),_0x12ad77['uniqueid']),_0x12ad77);queues[_0x0425('0x38')](_0x12ad77);agents[_0x0425('0x38')](_0x12ad77);transfers['blindtransfer'](_0x12ad77);recordings[_0x0425('0x38')](_0x12ad77);}catch(_0x19bc11){utils[_0x0425('0x18')](util['format']('[%s][index][blindtransfer]',_0x12ad77[_0x0425('0x20')]),_0x19bc11);}});ami['on'](_0x0425('0x3a'),function(_0x1cd6cb){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x3b'),_0x1cd6cb['origtransfereruniqueid']),_0x1cd6cb);queues['attendedtransfer'](_0x1cd6cb);transfers[_0x0425('0x3a')](_0x1cd6cb);agents[_0x0425('0x3a')](_0x1cd6cb);calls[_0x0425('0x3a')](_0x1cd6cb);}catch(_0x2cec9f){utils['error'](util[_0x0425('0x1d')](_0x0425('0x3b'),_0x1cd6cb['origtransfereruniqueid']),_0x2cec9f);}});ami['on']('varset',function(_0x360553){try{utils[_0x0425('0x22')](util['format'](_0x0425('0x3c'),_0x360553[_0x0425('0x20')]),_0x360553);queues[_0x0425('0x3d')](_0x360553);recordings[_0x0425('0x3d')](_0x360553);calls[_0x0425('0x3d')](_0x360553);dials[_0x0425('0x3d')](_0x360553);}catch(_0x5803cb){utils[_0x0425('0x18')](util[_0x0425('0x1d')]('[%s][index][varset]',_0x360553[_0x0425('0x20')]),_0x5803cb);}});ami['on'](_0x0425('0x3e'),function(_0x23f1b0){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x3f'),_0x23f1b0[_0x0425('0x20')]),_0x23f1b0);calls[_0x0425('0x3e')](_0x23f1b0);recordings[_0x0425('0x3e')](_0x23f1b0);dials['newexten'](_0x23f1b0);}catch(_0x4836f5){utils[_0x0425('0x18')](util[_0x0425('0x1d')]('[%s][index][newexten]',_0x23f1b0[_0x0425('0x20')]),_0x4836f5);}});ami['on'](_0x0425('0x40'),function(_0x2b42ec){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')]('[%s][index][newchannel]',_0x2b42ec[_0x0425('0x20')]),_0x2b42ec);calls[_0x0425('0x40')](_0x2b42ec);recordings[_0x0425('0x40')](_0x2b42ec);}catch(_0x446c9c){utils[_0x0425('0x18')](util[_0x0425('0x1d')](_0x0425('0x41'),_0x2b42ec[_0x0425('0x20')]),_0x446c9c);}});ami['on'](_0x0425('0x42'),function(_0x1ca7e0){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x43'),_0x1ca7e0['uniqueid']),_0x1ca7e0);dials['dialbegin'](_0x1ca7e0);}catch(_0x2c450c){utils['error'](util[_0x0425('0x1d')](_0x0425('0x44'),_0x1ca7e0[_0x0425('0x20')]),_0x2c450c);}});ami['on']('dialend',function(_0x4149e4){try{utils[_0x0425('0x22')](util[_0x0425('0x1d')](_0x0425('0x45'),_0x4149e4[_0x0425('0x20')]),_0x4149e4);dials[_0x0425('0x46')](_0x4149e4);}catch(_0x3dcac7){utils[_0x0425('0x18')](util[_0x0425('0x1d')](_0x0425('0x45'),_0x4149e4[_0x0425('0x20')]),_0x3dcac7);}});}
\ No newline at end of file
index fed9e9c..cb10138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdeb=['cdr','[%s][members][cdr]','assign','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','util','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','data2','membername','type','interface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','uniqueid','startsWith','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','exitAt','duration','diffTime','enterAt','isNil','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]'];(function(_0x38db3a,_0x244702){var _0x2ead95=function(_0x558eab){while(--_0x558eab){_0x38db3a['push'](_0x38db3a['shift']());}};_0x2ead95(++_0x244702);}(_0xbdeb,0x6f));var _0xbbde=function(_0x55af95,_0x4c0dd6){_0x55af95=_0x55af95-0x0;var _0x397e00=_0xbdeb[_0x55af95];return _0x397e00;};'use strict';var _=require('lodash');var util=require(_0xbbde('0x0'));var utils=require('./utils');var members={};var exclude=[_0xbbde('0x1'),'Queue:'];function writeDB(_0x1279b0){utils[_0xbbde('0x2')](util[_0xbbde('0x3')](_0xbbde('0x4'),_0x1279b0['uniqueid'],_0x1279b0['interface'],_0x1279b0[_0xbbde('0x5')],_0x1279b0[_0xbbde('0x6')],_0x1279b0[_0xbbde('0x7')],_0x1279b0[_0xbbde('0x8')]));if(_0x1279b0['interface']){utils['getUserByInterface'](_0x1279b0[_0xbbde('0x9')])[_0xbbde('0xa')](function(_0x51706d){if(_0x51706d){_0x1279b0[_0xbbde('0x7')]=_0x51706d[_0xbbde('0xb')];_0x1279b0[_0xbbde('0xc')]=_0x51706d[_0xbbde('0xc')];utils[_0xbbde('0xd')](_0xbbde('0xe'),_0x1279b0);}else{utils[_0xbbde('0xf')](_0x1279b0[_0xbbde('0x9')][_0xbbde('0x10')]('/')[0x1])[_0xbbde('0xa')](function(_0x597125){if(_0x597125){_0x1279b0['membername']=_0x597125[_0xbbde('0xb')];_0x1279b0['internal']=_0x597125[_0xbbde('0xc')];utils['request'](_0xbbde('0xe'),_0x1279b0);}});}})[_0xbbde('0x11')](function(_0x3b0da7){utils[_0xbbde('0x12')](util[_0xbbde('0x3')](_0xbbde('0x13'),_0x1279b0[_0xbbde('0x14')]),_0x3b0da7);});}delete members[_0x1279b0['interface']];}function startsWith(_0x259c16,_0x13db58){return _['some'](_0x259c16,function(_0x5ce713){return _[_0xbbde('0x15')](_0x13db58,_0x5ce713);});}exports['devicestatechange']=function(_0x88e8a5){try{utils['debug'](util[_0xbbde('0x3')](_0xbbde('0x16'),members[_0x88e8a5['device']]?members[_0x88e8a5[_0xbbde('0x17')]][_0xbbde('0x14')]:_0x88e8a5[_0xbbde('0x17')]),_0x88e8a5);utils[_0xbbde('0x2')](util[_0xbbde('0x3')](_0xbbde('0x18'),members[_0x88e8a5['device']]?members[_0x88e8a5[_0xbbde('0x17')]][_0xbbde('0x14')]:_0x88e8a5[_0xbbde('0x17')],_0x88e8a5[_0xbbde('0x19')],_0x88e8a5[_0xbbde('0x17')]));switch(_0x88e8a5['state']){case _0xbbde('0x1a'):case _0xbbde('0x1b'):if(!startsWith(exclude,_0x88e8a5[_0xbbde('0x17')])){members[_0x88e8a5[_0xbbde('0x17')]]={'channel':_0xbbde('0x1c'),'interface':_0x88e8a5[_0xbbde('0x17')],'type':_0xbbde('0x1d'),'enterAt':utils[_0xbbde('0x1e')](),'role':_0xbbde('0x1f')};}break;case _0xbbde('0x20'):if(!_['isNil'](members[_0x88e8a5[_0xbbde('0x17')]])){members[_0x88e8a5[_0xbbde('0x17')]][_0xbbde('0x21')]=utils['now']();members[_0x88e8a5[_0xbbde('0x17')]][_0xbbde('0x22')]=utils[_0xbbde('0x23')](members[_0x88e8a5[_0xbbde('0x17')]][_0xbbde('0x21')],members[_0x88e8a5['device']][_0xbbde('0x24')]);if(members[_0x88e8a5[_0xbbde('0x17')]]['uniqueid']){writeDB(members[_0x88e8a5[_0xbbde('0x17')]]);}}break;default:break;}}catch(_0x3d1c58){utils[_0xbbde('0x12')](util[_0xbbde('0x3')](_0xbbde('0x16'),members[_0x88e8a5['device']]?members[_0x88e8a5['device']][_0xbbde('0x14')]:_0x88e8a5[_0xbbde('0x17')]),_0x3d1c58);}};exports['agentcomplete']=function(_0x1ee462){try{if(!_[_0xbbde('0x25')](members[_0x1ee462[_0xbbde('0x9')]])){utils[_0xbbde('0x26')](util[_0xbbde('0x3')]('[%s][members][agentcomplete]',_0x1ee462[_0xbbde('0x14')]),_0x1ee462);utils[_0xbbde('0x2')](util[_0xbbde('0x3')](_0xbbde('0x27'),_0x1ee462[_0xbbde('0x14')],_0x1ee462['interface'],_0x1ee462[_0xbbde('0x28')]));members[_0x1ee462[_0xbbde('0x9')]]=_['assign'](members[_0x1ee462['interface']],{'data4':_0x1ee462[_0xbbde('0x28')],'uniqueid':_0x1ee462[_0xbbde('0x14')]});}}catch(_0x222df2){utils[_0xbbde('0x12')](util[_0xbbde('0x3')](_0xbbde('0x29'),_0x1ee462[_0xbbde('0x14')]),_0x222df2);}};exports[_0xbbde('0x2a')]=function(_0x2e734e){try{utils['debug'](util[_0xbbde('0x3')](_0xbbde('0x2b'),_0x2e734e[_0xbbde('0x14')]),_0x2e734e);if(_0x2e734e[_0xbbde('0x5')]){var _0x56f37b=_0x2e734e['channel'][_0xbbde('0x10')]('-')[0x0];if(!_[_0xbbde('0x25')](members[_0x56f37b])){members[_0x56f37b]=_[_0xbbde('0x2c')](members[_0x56f37b],{'data1':members[_0x56f37b][_0xbbde('0x2d')]||_0x2e734e['type'],'data2':members[_0x56f37b][_0xbbde('0x6')]||_0x2e734e['source'],'data3':members[_0x56f37b][_0xbbde('0x2e')]||_0x2e734e[_0xbbde('0x2f')],'uniqueid':members[_0x56f37b][_0xbbde('0x14')]||_0x2e734e[_0xbbde('0x14')]});utils[_0xbbde('0x2')](util['format'](_0xbbde('0x30'),_0x2e734e[_0xbbde('0x14')],members[_0x56f37b]['data1'],members[_0x56f37b][_0xbbde('0x6')],members[_0x56f37b][_0xbbde('0x2e')]));if(members[_0x56f37b]['exitAt']){writeDB(members[_0x56f37b]);}}}if(_0x2e734e[_0xbbde('0x31')]){var _0x576273=_0x2e734e[_0xbbde('0x31')][_0xbbde('0x10')]('-')[0x0];if(!_[_0xbbde('0x25')](members[_0x576273])){members[_0x576273]=_['assign'](members[_0x576273],{'data1':members[_0x576273][_0xbbde('0x2d')]||_0x2e734e[_0xbbde('0x8')],'data2':members[_0x576273]['data2']||_0x2e734e[_0xbbde('0x32')],'data3':members[_0x576273]['data3']||_0x2e734e[_0xbbde('0x2f')],'uniqueid':members[_0x576273][_0xbbde('0x14')]||_0x2e734e['uniqueid']});utils[_0xbbde('0x2')](util[_0xbbde('0x3')](_0xbbde('0x30'),_0x2e734e[_0xbbde('0x14')],members[_0x576273]['data1'],members[_0x576273][_0xbbde('0x6')],members[_0x576273][_0xbbde('0x2e')]));if(members[_0x576273]['exitAt']){writeDB(members[_0x576273]);}}}}catch(_0x253a96){utils[_0xbbde('0x12')](util[_0xbbde('0x3')](_0xbbde('0x2b'),_0x2e734e['uniqueid']),_0x253a96);}};
\ No newline at end of file
+var _0x25a3=['state','INUSE','voice','TALKING','now','NOT_INUSE','exitAt','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','isNil','[%s][members][agentcomplete]','queue','cdr','[%s][members][cdr]','data1','type','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','assign','lodash','util','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','membername','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0x25a3,0x121));var _0x325a=function(_0x4e1922,_0x507283){_0x4e1922=_0x4e1922-0x0;var _0x175d52=_0x25a3[_0x4e1922];return _0x175d52;};'use strict';var _=require(_0x325a('0x0'));var util=require(_0x325a('0x1'));var utils=require(_0x325a('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x325a('0x3')];function writeDB(_0x50e9ba){utils[_0x325a('0x4')](util[_0x325a('0x5')](_0x325a('0x6'),_0x50e9ba['uniqueid'],_0x50e9ba[_0x325a('0x7')],_0x50e9ba[_0x325a('0x8')],_0x50e9ba[_0x325a('0x9')],_0x50e9ba['membername'],_0x50e9ba['type']));if(_0x50e9ba[_0x325a('0x7')]){utils[_0x325a('0xa')](_0x50e9ba[_0x325a('0x7')])[_0x325a('0xb')](function(_0x5a4f52){if(_0x5a4f52){_0x50e9ba['membername']=_0x5a4f52[_0x325a('0xc')];_0x50e9ba[_0x325a('0xd')]=_0x5a4f52[_0x325a('0xd')];utils[_0x325a('0xe')](_0x325a('0xf'),_0x50e9ba);}else{utils[_0x325a('0x10')](_0x50e9ba['interface'][_0x325a('0x11')]('/')[0x1])[_0x325a('0xb')](function(_0x4c9f54){if(_0x4c9f54){_0x50e9ba[_0x325a('0x12')]=_0x4c9f54[_0x325a('0xc')];_0x50e9ba[_0x325a('0xd')]=_0x4c9f54[_0x325a('0xd')];utils['request']('CreateMemberReport',_0x50e9ba);}});}})[_0x325a('0x13')](function(_0x5a4731){utils[_0x325a('0x14')](util[_0x325a('0x5')](_0x325a('0x15'),_0x50e9ba[_0x325a('0x16')]),_0x5a4731);});}delete members[_0x50e9ba[_0x325a('0x7')]];}function startsWith(_0x3d198c,_0x1d7efc){return _[_0x325a('0x17')](_0x3d198c,function(_0x1fd4ec){return _[_0x325a('0x18')](_0x1d7efc,_0x1fd4ec);});}exports[_0x325a('0x19')]=function(_0x21315f){try{utils[_0x325a('0x1a')](util[_0x325a('0x5')]('[%s][members][devicestatechange]',members[_0x21315f[_0x325a('0x1b')]]?members[_0x21315f[_0x325a('0x1b')]]['uniqueid']:_0x21315f[_0x325a('0x1b')]),_0x21315f);utils[_0x325a('0x4')](util[_0x325a('0x5')](_0x325a('0x1c'),members[_0x21315f[_0x325a('0x1b')]]?members[_0x21315f[_0x325a('0x1b')]][_0x325a('0x16')]:_0x21315f[_0x325a('0x1b')],_0x21315f[_0x325a('0x1d')],_0x21315f[_0x325a('0x1b')]));switch(_0x21315f[_0x325a('0x1d')]){case _0x325a('0x1e'):case'BUSY':if(!startsWith(exclude,_0x21315f[_0x325a('0x1b')])){members[_0x21315f[_0x325a('0x1b')]]={'channel':_0x325a('0x1f'),'interface':_0x21315f[_0x325a('0x1b')],'type':_0x325a('0x20'),'enterAt':utils[_0x325a('0x21')](),'role':'agent'};}break;case _0x325a('0x22'):if(!_['isNil'](members[_0x21315f[_0x325a('0x1b')]])){members[_0x21315f[_0x325a('0x1b')]][_0x325a('0x23')]=utils[_0x325a('0x21')]();members[_0x21315f[_0x325a('0x1b')]]['duration']=utils[_0x325a('0x24')](members[_0x21315f['device']][_0x325a('0x23')],members[_0x21315f[_0x325a('0x1b')]][_0x325a('0x25')]);if(members[_0x21315f['device']][_0x325a('0x16')]){writeDB(members[_0x21315f[_0x325a('0x1b')]]);}}break;default:break;}}catch(_0x2514df){utils[_0x325a('0x14')](util[_0x325a('0x5')](_0x325a('0x26'),members[_0x21315f[_0x325a('0x1b')]]?members[_0x21315f[_0x325a('0x1b')]][_0x325a('0x16')]:_0x21315f['device']),_0x2514df);}};exports[_0x325a('0x27')]=function(_0x3fa4f6){try{if(!_[_0x325a('0x28')](members[_0x3fa4f6[_0x325a('0x7')]])){utils[_0x325a('0x1a')](util['format'](_0x325a('0x29'),_0x3fa4f6['uniqueid']),_0x3fa4f6);utils[_0x325a('0x4')](util[_0x325a('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x3fa4f6[_0x325a('0x16')],_0x3fa4f6[_0x325a('0x7')],_0x3fa4f6[_0x325a('0x2a')]));members[_0x3fa4f6[_0x325a('0x7')]]=_['assign'](members[_0x3fa4f6[_0x325a('0x7')]],{'data4':_0x3fa4f6[_0x325a('0x2a')],'uniqueid':_0x3fa4f6[_0x325a('0x16')]});}}catch(_0x46b5b2){utils['error'](util[_0x325a('0x5')](_0x325a('0x29'),_0x3fa4f6[_0x325a('0x16')]),_0x46b5b2);}};exports[_0x325a('0x2b')]=function(_0x26cabc){try{utils[_0x325a('0x1a')](util['format'](_0x325a('0x2c'),_0x26cabc[_0x325a('0x16')]),_0x26cabc);if(_0x26cabc['channel']){var _0x3a283f=_0x26cabc[_0x325a('0x8')]['split']('-')[0x0];if(!_[_0x325a('0x28')](members[_0x3a283f])){members[_0x3a283f]=_['assign'](members[_0x3a283f],{'data1':members[_0x3a283f][_0x325a('0x2d')]||_0x26cabc[_0x325a('0x2e')],'data2':members[_0x3a283f][_0x325a('0x9')]||_0x26cabc[_0x325a('0x2f')],'data3':members[_0x3a283f]['data3']||_0x26cabc[_0x325a('0x30')],'uniqueid':members[_0x3a283f]['uniqueid']||_0x26cabc[_0x325a('0x16')]});utils['info'](util['format'](_0x325a('0x31'),_0x26cabc[_0x325a('0x16')],members[_0x3a283f][_0x325a('0x2d')],members[_0x3a283f]['data2'],members[_0x3a283f][_0x325a('0x32')]));if(members[_0x3a283f]['exitAt']){writeDB(members[_0x3a283f]);}}}if(_0x26cabc[_0x325a('0x33')]){var _0x445da7=_0x26cabc[_0x325a('0x33')][_0x325a('0x11')]('-')[0x0];if(!_[_0x325a('0x28')](members[_0x445da7])){members[_0x445da7]=_[_0x325a('0x34')](members[_0x445da7],{'data1':members[_0x445da7][_0x325a('0x2d')]||_0x26cabc[_0x325a('0x2e')],'data2':members[_0x445da7]['data2']||_0x26cabc[_0x325a('0x2f')],'data3':members[_0x445da7][_0x325a('0x32')]||_0x26cabc[_0x325a('0x30')],'uniqueid':members[_0x445da7][_0x325a('0x16')]||_0x26cabc[_0x325a('0x16')]});utils[_0x325a('0x4')](util[_0x325a('0x5')](_0x325a('0x31'),_0x26cabc[_0x325a('0x16')],members[_0x445da7]['data1'],members[_0x445da7][_0x325a('0x9')],members[_0x445da7][_0x325a('0x32')]));if(members[_0x445da7][_0x325a('0x23')]){writeDB(members[_0x445da7]);}}}}catch(_0x2b2f05){utils[_0x325a('0x14')](util[_0x325a('0x5')](_0x325a('0x2c'),_0x26cabc[_0x325a('0x16')]),_0x2b2f05);}};
\ No newline at end of file
index c1901d4..ded5c8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc487=['transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','error','varset','[%s][queues][varset]','queuestatus','CONTINUE','queuecallerabandonAt','queuecallerexitAt','info','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','variable','queueposition','now','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleaveAt','holdtime','diffTime','count','connectedlinename','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','accountcode','agentcomplete','transfer','COMPLETEDBY','reason','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xc487,0x14d));var _0x7c48=function(_0x81da75,_0x3803c5){_0x81da75=_0x81da75-0x0;var _0x22ec27=_0xc487[_0x81da75];return _0x22ec27;};'use strict';var _=require(_0x7c48('0x0'));var util=require(_0x7c48('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x183403){utils['info'](util['format'](_0x7c48('0x2'),_0x183403[_0x7c48('0x3')],_0x183403[_0x7c48('0x4')],_0x183403['queue'],_0x183403[_0x7c48('0x5')],_0x183403['calleridnum'],_0x183403['accountcode'],_0x183403[_0x7c48('0x6')]));if(_0x183403[_0x7c48('0x7')]){utils[_0x7c48('0x8')](_0x183403[_0x7c48('0x7')])[_0x7c48('0x9')](function(_0x279353){if(_0x279353){_0x183403[_0x7c48('0xa')]=_0x279353[_0x7c48('0xa')];}utils[_0x7c48('0xb')]('CreateVoiceQueueReport',_0x183403);});}else{utils[_0x7c48('0xb')]('CreateVoiceQueueReport',_0x183403);}if(_0x183403['transfereduniqueid']){delete queues[_0x183403[_0x7c48('0xc')]];}else{delete queues[_0x183403[_0x7c48('0x3')]];}}exports[_0x7c48('0xd')]=function(_0xdce1bf){try{utils[_0x7c48('0xe')](util['format']('[%s][queues][queuecallerjoin]',_0xdce1bf[_0x7c48('0x3')]),_0xdce1bf);utils['info'](util[_0x7c48('0xf')](_0x7c48('0x10'),_0xdce1bf['uniqueid'],_0xdce1bf[_0x7c48('0x7')],_0xdce1bf[_0x7c48('0x11')]));queues[_0xdce1bf[_0x7c48('0x3')]]=_[_0x7c48('0x12')](_0xdce1bf,{'originalposition':_0xdce1bf[_0x7c48('0x11')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x352d96){utils['error'](util[_0x7c48('0xf')](_0x7c48('0x13'),_0xdce1bf[_0x7c48('0x3')]),_0x352d96);}};exports[_0x7c48('0x14')]=function(_0x3cd655){try{if(!_[_0x7c48('0x15')](queues[_0x3cd655[_0x7c48('0x3')]])){utils[_0x7c48('0xe')](util[_0x7c48('0xf')](_0x7c48('0x16'),_0x3cd655[_0x7c48('0x3')]),_0x3cd655);if(queues[_0x3cd655[_0x7c48('0x3')]]['queuecallerleaveAt']){if(!queues[_0x3cd655['uniqueid']][_0x7c48('0x17')]&&!queues[_0x3cd655[_0x7c48('0x3')]][_0x7c48('0x18')]){queues[_0x3cd655[_0x7c48('0x3')]][_0x7c48('0x19')]=!![];queues[_0x3cd655[_0x7c48('0x3')]][_0x7c48('0x1a')]=utils['now']();queues[_0x3cd655['uniqueid']][_0x7c48('0x6')]='COMPLETEDBYAGENT';}utils['info'](util[_0x7c48('0xf')](_0x7c48('0x1b'),_0x3cd655['uniqueid'],queues[_0x3cd655['uniqueid']][_0x7c48('0x1c')],queues[_0x3cd655[_0x7c48('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x3cd655[_0x7c48('0x3')]]);}else if(queues[_0x3cd655['uniqueid']][_0x7c48('0xc')]){utils['info'](util[_0x7c48('0xf')](_0x7c48('0x1d'),_0x3cd655[_0x7c48('0x3')],queues[_0x3cd655['uniqueid']][_0x7c48('0x1c')],queues[_0x3cd655[_0x7c48('0x3')]]['transfereduniqueid']));queues[queues[_0x3cd655[_0x7c48('0x3')]][_0x7c48('0xc')]]=queues[_0x3cd655['uniqueid']];queues[queues[_0x3cd655[_0x7c48('0x3')]][_0x7c48('0xc')]]['queuecallerenterreason']=0x2;delete queues[_0x3cd655['uniqueid']];}}}catch(_0x3dbcec){utils[_0x7c48('0x1e')](util[_0x7c48('0xf')](_0x7c48('0x16'),_0x3cd655[_0x7c48('0x3')]),_0x3dbcec);}};exports[_0x7c48('0x1f')]=function(_0x10ac34){try{utils[_0x7c48('0xe')](util[_0x7c48('0xf')](_0x7c48('0x20'),_0x10ac34[_0x7c48('0x3')]),_0x10ac34);if(!_['isNil'](_0x10ac34['variable'][_0x7c48('0x21')])&&_0x10ac34['value']['toUpperCase']()!==_0x7c48('0x22')){if(!_[_0x7c48('0x15')](queues[_0x10ac34[_0x7c48('0x3')]])){queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x17')]=![];queues[_0x10ac34['uniqueid']][_0x7c48('0x23')]=null;queues[_0x10ac34['uniqueid']]['queuecallerexit']=!![];queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x24')]=utils['now']();queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x6')]=_0x10ac34['value']['toUpperCase']();utils[_0x7c48('0x25')](util[_0x7c48('0xf')](_0x7c48('0x26'),_0x10ac34[_0x7c48('0x3')],queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x1c')],_0x10ac34[_0x7c48('0x27')],queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x6')]));writeDB(queues[_0x10ac34[_0x7c48('0x3')]]);}}else if(!_[_0x7c48('0x15')](_0x10ac34[_0x7c48('0x28')][_0x7c48('0x29')])){if(!_[_0x7c48('0x15')](queues[_0x10ac34[_0x7c48('0x3')]])&&!queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x17')]){queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x17')]=![];queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x23')]=null;queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x18')]=!![];queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x24')]=utils[_0x7c48('0x2a')]();queues[_0x10ac34['uniqueid']]['queuecallerexitreason']='EXITWITHKEY';utils['info'](util[_0x7c48('0xf')](_0x7c48('0x2b'),_0x10ac34[_0x7c48('0x3')],queues[_0x10ac34['uniqueid']]['name'],_0x10ac34[_0x7c48('0x27')],queues[_0x10ac34[_0x7c48('0x3')]][_0x7c48('0x6')]));}}}catch(_0x1184db){utils[_0x7c48('0x1e')](util[_0x7c48('0xf')](_0x7c48('0x20'),_0x10ac34['uniqueid']),_0x1184db);}};exports[_0x7c48('0x17')]=function(_0x4401de){try{if(!_[_0x7c48('0x15')](queues[_0x4401de[_0x7c48('0x3')]])){utils['debug'](util['format'](_0x7c48('0x2c'),_0x4401de[_0x7c48('0x3')]),_0x4401de);queues[_0x4401de['uniqueid']][_0x7c48('0x18')]=![];queues[_0x4401de['uniqueid']][_0x7c48('0x24')]=null;queues[_0x4401de['uniqueid']][_0x7c48('0x17')]=!![];queues[_0x4401de[_0x7c48('0x3')]][_0x7c48('0x23')]=utils['now']();queues[_0x4401de[_0x7c48('0x3')]]['queuecallerexitreason']=_0x7c48('0x2d');utils[_0x7c48('0x25')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x4401de['uniqueid'],queues[_0x4401de[_0x7c48('0x3')]][_0x7c48('0x1c')],queues[_0x4401de['uniqueid']][_0x7c48('0x6')]));}}catch(_0x5496aa){utils[_0x7c48('0x1e')](util[_0x7c48('0xf')](_0x7c48('0x2c'),_0x4401de[_0x7c48('0x3')]),_0x5496aa);}};exports[_0x7c48('0x2e')]=function(_0xd56903){try{if(!_[_0x7c48('0x15')](queues[_0xd56903[_0x7c48('0x3')]])){utils[_0x7c48('0xe')](util[_0x7c48('0xf')](_0x7c48('0x2f'),_0xd56903[_0x7c48('0x3')]),_0xd56903);utils['info'](util[_0x7c48('0xf')](_0x7c48('0x30'),_0xd56903[_0x7c48('0x3')],queues[_0xd56903[_0x7c48('0x3')]][_0x7c48('0x1c')],_0xd56903[_0x7c48('0x31')],_0xd56903['connectedlinename']));queues[_0xd56903[_0x7c48('0x3')]]['queuecallerleave']=!![];queues[_0xd56903[_0x7c48('0x3')]][_0x7c48('0x32')]=utils[_0x7c48('0x2a')]();queues[_0xd56903[_0x7c48('0x3')]][_0x7c48('0x33')]=utils[_0x7c48('0x34')](queues[_0xd56903[_0x7c48('0x3')]]['queuecallerleaveAt'],queues[_0xd56903['uniqueid']]['queuecallerjoinAt']);queues[_0xd56903['uniqueid']][_0x7c48('0x11')]=_0xd56903[_0x7c48('0x11')];queues[_0xd56903[_0x7c48('0x3')]][_0x7c48('0x35')]=_0xd56903[_0x7c48('0x35')];queues[_0xd56903['uniqueid']][_0x7c48('0x31')]=_0xd56903[_0x7c48('0x31')];queues[_0xd56903[_0x7c48('0x3')]][_0x7c48('0x36')]=_0xd56903[_0x7c48('0x36')];}}catch(_0x8c527d){utils[_0x7c48('0x1e')](util[_0x7c48('0xf')]('[%s][queues][queuecallerleave]',_0xd56903[_0x7c48('0x3')]),_0x8c527d);}};exports['agentconnect']=function(_0x4cabae){try{if(!_[_0x7c48('0x15')](queues[_0x4cabae['uniqueid']])){utils['debug'](util['format'](_0x7c48('0x37'),_0x4cabae[_0x7c48('0x3')]),_0x4cabae);utils['info'](util[_0x7c48('0xf')](_0x7c48('0x38'),_0x4cabae[_0x7c48('0x3')],queues[_0x4cabae['uniqueid']][_0x7c48('0x1c')],_0x4cabae[_0x7c48('0x39')],_0x4cabae[_0x7c48('0x3a')]));queues[_0x4cabae[_0x7c48('0x3')]][_0x7c48('0x17')]=![];queues[_0x4cabae[_0x7c48('0x3')]][_0x7c48('0x17')]=![];queues[_0x4cabae['uniqueid']][_0x7c48('0x23')]=null;queues[_0x4cabae[_0x7c48('0x3')]][_0x7c48('0x18')]=![];queues[_0x4cabae[_0x7c48('0x3')]][_0x7c48('0x6')]=null;queues[_0x4cabae[_0x7c48('0x3')]][_0x7c48('0x24')]=null;queues[_0x4cabae[_0x7c48('0x3')]][_0x7c48('0x3b')]=!![];queues[_0x4cabae[_0x7c48('0x3')]][_0x7c48('0x3c')]=_0x4cabae[_0x7c48('0x3a')];queues[_0x4cabae[_0x7c48('0x3')]][_0x7c48('0x5')]=_0x4cabae[_0x7c48('0x39')];}}catch(_0x3de1e8){utils[_0x7c48('0x1e')](util['format'](_0x7c48('0x37'),_0x4cabae['uniqueid']),_0x3de1e8);}};exports[_0x7c48('0x3d')]=function(_0x2c85bf){try{if(!_[_0x7c48('0x15')](queues[_0x2c85bf[_0x7c48('0x3')]])){if(queues[_0x2c85bf[_0x7c48('0x3')]][_0x7c48('0x32')]){utils['debug'](util[_0x7c48('0xf')]('[%s][queues][agentcomplete]',_0x2c85bf[_0x7c48('0x3')]),_0x2c85bf);queues[_0x2c85bf[_0x7c48('0x3')]][_0x7c48('0x17')]=![];queues[_0x2c85bf[_0x7c48('0x3')]][_0x7c48('0x17')]=![];queues[_0x2c85bf[_0x7c48('0x3')]]['queuecallerabandonAt']=null;queues[_0x2c85bf[_0x7c48('0x3')]][_0x7c48('0x18')]=![];queues[_0x2c85bf[_0x7c48('0x3')]][_0x7c48('0x24')]=null;queues[_0x2c85bf[_0x7c48('0x3')]][_0x7c48('0x3b')]=!![];queues[_0x2c85bf[_0x7c48('0x3')]]['lastAssignedTo']=_0x2c85bf[_0x7c48('0x39')];queues[_0x2c85bf[_0x7c48('0x3')]][_0x7c48('0x19')]=!![];queues[_0x2c85bf[_0x7c48('0x3')]][_0x7c48('0x1a')]=utils[_0x7c48('0x2a')]();if(_0x2c85bf['reason']==_0x7c48('0x3e')){if(!queues[_0x2c85bf['uniqueid']][_0x7c48('0x3e')]){queues[_0x2c85bf[_0x7c48('0x3')]][_0x7c48('0x6')]='TRANSFER';}}else{queues[_0x2c85bf[_0x7c48('0x3')]]['queuecallerexitreason']=_0x7c48('0x3f')+_0x2c85bf[_0x7c48('0x40')][_0x7c48('0x41')]();}utils[_0x7c48('0x25')](util[_0x7c48('0xf')](_0x7c48('0x42'),_0x2c85bf['uniqueid'],queues[_0x2c85bf[_0x7c48('0x3')]][_0x7c48('0x1c')],_0x2c85bf[_0x7c48('0x39')],queues[_0x2c85bf[_0x7c48('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x2c85bf[_0x7c48('0x3')]]);}}}catch(_0x3b4d12){utils['error'](util[_0x7c48('0xf')](_0x7c48('0x43'),_0x2c85bf[_0x7c48('0x3')]),_0x3b4d12);}};exports[_0x7c48('0x44')]=function(_0x3c49da){try{if(!_[_0x7c48('0x15')](queues[_0x3c49da[_0x7c48('0x45')]])){utils['debug'](util['format'](_0x7c48('0x46'),_0x3c49da[_0x7c48('0x3')]),_0x3c49da);queues[_0x3c49da[_0x7c48('0x45')]][_0x7c48('0x3e')]=!![];queues[_0x3c49da[_0x7c48('0x45')]][_0x7c48('0x47')]='BLIND';queues[_0x3c49da[_0x7c48('0x45')]][_0x7c48('0x48')]=_0x3c49da[_0x7c48('0x49')];queues[_0x3c49da[_0x7c48('0x45')]][_0x7c48('0x4a')]=_0x3c49da[_0x7c48('0x45')];queues[_0x3c49da['transfereeuniqueid']]['queuecallerexitreason']=_0x7c48('0x4b');utils['info'](util[_0x7c48('0xf')](_0x7c48('0x4c'),_0x3c49da[_0x7c48('0x3')],queues[_0x3c49da[_0x7c48('0x45')]][_0x7c48('0x1c')],_0x3c49da[_0x7c48('0x45')],_0x3c49da['extension']));}}catch(_0x5d4089){utils[_0x7c48('0x1e')](util[_0x7c48('0xf')](_0x7c48('0x46'),_0x3c49da[_0x7c48('0x3')]),_0x5d4089);}};exports[_0x7c48('0x4d')]=function(_0x221078){try{utils['debug'](util[_0x7c48('0xf')](_0x7c48('0x4e'),_0x221078['origtransfereruniqueid']),_0x221078);if(_0x221078[_0x7c48('0x4f')]==_0x221078[_0x7c48('0x50')]){if(!_[_0x7c48('0x15')](queues[_0x221078[_0x7c48('0x51')]])){utils[_0x7c48('0x25')](util[_0x7c48('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x221078['origtransfereruniqueid'],queues[_0x221078[_0x7c48('0x51')]][_0x7c48('0x1c')],_0x221078[_0x7c48('0x52')]));queues[_0x221078[_0x7c48('0x51')]][_0x7c48('0x3e')]=!![];queues[_0x221078['secondtransfererlinkedid']][_0x7c48('0x47')]=_0x7c48('0x53');queues[_0x221078[_0x7c48('0x51')]]['transferexten']=_0x221078[_0x7c48('0x52')];queues[_0x221078[_0x7c48('0x51')]][_0x7c48('0x4a')]=_0x221078[_0x7c48('0x4f')];queues[_0x221078[_0x7c48('0x51')]][_0x7c48('0x6')]=_0x7c48('0x54');}if(!_[_0x7c48('0x15')](queues[_0x221078[_0x7c48('0x50')]])){if(_0x221078[_0x7c48('0x55')]&&queues[_0x221078[_0x7c48('0x55')]]){queues[_0x221078['transfereelinkedid']][_0x7c48('0x56')]=0x1;queues[_0x221078[_0x7c48('0x45')]]=_['clone'](queues[_0x221078[_0x7c48('0x55')]]);queues[_0x221078['transfereeuniqueid']][_0x7c48('0xc')]=_0x221078[_0x7c48('0x57')];queues[_0x221078[_0x7c48('0x45')]][_0x7c48('0x56')]=0x2;queues[_0x221078[_0x7c48('0x45')]][_0x7c48('0x58')]=queues[_0x221078[_0x7c48('0x51')]]['calleridnum'];queues[_0x221078['transfereeuniqueid']][_0x7c48('0x59')]=queues[_0x221078[_0x7c48('0x51')]][_0x7c48('0x59')];queues[_0x221078['transfereeuniqueid']][_0x7c48('0x5a')]=utils['now']();queues[_0x221078['transfereeuniqueid']][_0x7c48('0x32')]=utils[_0x7c48('0x2a')]();queues[_0x221078[_0x7c48('0x45')]][_0x7c48('0x33')]=0x0;queues[_0x221078['transfereeuniqueid']]['mohtime']=0x0;utils[_0x7c48('0x25')](util['format'](_0x7c48('0x5b'),_0x221078[_0x7c48('0x4f')],queues[_0x221078[_0x7c48('0x45')]][_0x7c48('0x1c')],queues[_0x221078[_0x7c48('0x45')]][_0x7c48('0x58')],queues[_0x221078[_0x7c48('0x45')]][_0x7c48('0x59')]));}else{utils[_0x7c48('0x25')](util[_0x7c48('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x221078[_0x7c48('0x4f')],queues[_0x221078[_0x7c48('0x50')]][_0x7c48('0x1c')],_0x221078['secondtransfererlinkedid']));queues[_0x221078[_0x7c48('0x50')]][_0x7c48('0xc')]=_0x221078[_0x7c48('0x51')];}}}else if(_0x221078[_0x7c48('0x5c')]==_0x221078[_0x7c48('0x51')]){if(!_['isNil'](queues[_0x221078[_0x7c48('0x50')]])){utils[_0x7c48('0x25')](util[_0x7c48('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x221078[_0x7c48('0x4f')],queues[_0x221078[_0x7c48('0x50')]][_0x7c48('0x1c')],_0x221078['secondtransfereruniqueid'],_0x221078[_0x7c48('0x5d')]));queues[_0x221078[_0x7c48('0x50')]]['transfer']=!![];queues[_0x221078[_0x7c48('0x50')]][_0x7c48('0x47')]=_0x7c48('0x53');queues[_0x221078[_0x7c48('0x50')]][_0x7c48('0x48')]=_0x221078[_0x7c48('0x5d')];queues[_0x221078[_0x7c48('0x50')]][_0x7c48('0x4a')]=_0x221078[_0x7c48('0x5c')];queues[_0x221078[_0x7c48('0x50')]][_0x7c48('0x6')]='ATTENDEDTRANSFER';}if(!_[_0x7c48('0x15')](queues[_0x221078[_0x7c48('0x51')]])){if(_0x221078[_0x7c48('0x5e')]&&queues[_0x221078[_0x7c48('0x5e')]]){queues[_0x221078[_0x7c48('0x5e')]][_0x7c48('0x56')]=0x1;queues[_0x221078[_0x7c48('0x57')]]=_[_0x7c48('0x5f')](queues[_0x221078['transfertargetlinkedid']]);queues[_0x221078[_0x7c48('0x57')]][_0x7c48('0xc')]=_0x221078[_0x7c48('0x57')];queues[_0x221078[_0x7c48('0x57')]]['queuecallerenterreason']=0x2;queues[_0x221078[_0x7c48('0x57')]][_0x7c48('0x58')]=queues[_0x221078[_0x7c48('0x50')]][_0x7c48('0x58')];queues[_0x221078['transfertargetuniqueid']][_0x7c48('0x59')]=queues[_0x221078['origtransfererlinkedid']][_0x7c48('0x59')];queues[_0x221078[_0x7c48('0x57')]][_0x7c48('0x5a')]=utils[_0x7c48('0x2a')]();queues[_0x221078[_0x7c48('0x57')]]['queuecallerleaveAt']=utils['now']();queues[_0x221078[_0x7c48('0x57')]]['holdtime']=0x0;queues[_0x221078[_0x7c48('0x57')]][_0x7c48('0x60')]=0x0;utils[_0x7c48('0x25')](util[_0x7c48('0xf')](_0x7c48('0x61'),_0x221078[_0x7c48('0x4f')],queues[_0x221078[_0x7c48('0x57')]][_0x7c48('0x1c')],queues[_0x221078[_0x7c48('0x57')]][_0x7c48('0xc')],queues[_0x221078['transfertargetuniqueid']][_0x7c48('0x58')],queues[_0x221078[_0x7c48('0x57')]][_0x7c48('0x59')]));}else{utils[_0x7c48('0x25')](util[_0x7c48('0xf')](_0x7c48('0x62'),_0x221078['origtransfereruniqueid'],queues[_0x221078['secondtransfererlinkedid']][_0x7c48('0x1c')],_0x221078['origtransfererlinkedid']));queues[_0x221078[_0x7c48('0x51')]][_0x7c48('0xc')]=_0x221078[_0x7c48('0x50')];}}}}catch(_0x47182e){utils[_0x7c48('0x1e')](util['format'](_0x7c48('0x4e'),_0x221078[_0x7c48('0x4f')]),_0x47182e);}};exports[_0x7c48('0x63')]=function(_0x199d6c){try{if(!_['isNil'](queues[_0x199d6c['uniqueid']])){utils['debug'](util[_0x7c48('0xf')](_0x7c48('0x64'),_0x199d6c['uniqueid']),_0x199d6c);queues[_0x199d6c[_0x7c48('0x3')]][_0x7c48('0x65')]=utils[_0x7c48('0x2a')]();utils[_0x7c48('0x25')](util[_0x7c48('0xf')](_0x7c48('0x66'),_0x199d6c[_0x7c48('0x3')],queues[_0x199d6c[_0x7c48('0x3')]][_0x7c48('0x1c')],queues[_0x199d6c[_0x7c48('0x3')]][_0x7c48('0x65')]));}}catch(_0x39d622){utils['error'](util[_0x7c48('0xf')](_0x7c48('0x64'),_0x199d6c['uniqueid']),_0x39d622);}};exports[_0x7c48('0x67')]=function(_0x584ea7){try{if(!_[_0x7c48('0x15')](queues[_0x584ea7[_0x7c48('0x3')]])){if(!_[_0x7c48('0x15')](queues[_0x584ea7['uniqueid']][_0x7c48('0x65')])){utils[_0x7c48('0xe')](util[_0x7c48('0xf')](_0x7c48('0x68'),_0x584ea7[_0x7c48('0x3')]),_0x584ea7);queues[_0x584ea7[_0x7c48('0x3')]]['mohtime']+=utils[_0x7c48('0x34')](utils['now'](),queues[_0x584ea7[_0x7c48('0x3')]][_0x7c48('0x65')]);utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x584ea7[_0x7c48('0x3')],queues[_0x584ea7['uniqueid']][_0x7c48('0x1c')],queues[_0x584ea7[_0x7c48('0x3')]][_0x7c48('0x60')]));delete queues[_0x584ea7[_0x7c48('0x3')]]['musiconholdstartAt'];}}}catch(_0x8411b4){utils['error'](util[_0x7c48('0xf')](_0x7c48('0x68'),_0x584ea7[_0x7c48('0x3')]),_0x8411b4);}};
\ No newline at end of file
+var _0xf4ef=['transfertargetuniqueid','queuecallerenterreason','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','error','varset','[%s][queues][varset]','queuestatus','toUpperCase','CONTINUE','queuecallerexit','value','[%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]','queuecallerabandonAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone'];(function(_0x471c9b,_0x3884ec){var _0x5cbf53=function(_0x1c77f8){while(--_0x1c77f8){_0x471c9b['push'](_0x471c9b['shift']());}};_0x5cbf53(++_0x3884ec);}(_0xf4ef,0x145));var _0xff4e=function(_0x5eca50,_0xc1e3f8){_0x5eca50=_0x5eca50-0x0;var _0x41fb84=_0xf4ef[_0x5eca50];return _0x41fb84;};'use strict';var _=require(_0xff4e('0x0'));var util=require('util');var utils=require(_0xff4e('0x1'));var queues={};function writeDB(_0x313c2d){utils[_0xff4e('0x2')](util[_0xff4e('0x3')](_0xff4e('0x4'),_0x313c2d[_0xff4e('0x5')],_0x313c2d[_0xff4e('0x6')],_0x313c2d[_0xff4e('0x7')],_0x313c2d[_0xff4e('0x8')],_0x313c2d[_0xff4e('0x9')],_0x313c2d[_0xff4e('0xa')],_0x313c2d['queuecallerexitreason']));if(_0x313c2d[_0xff4e('0x7')]){utils['getVoiceQueueByName'](_0x313c2d[_0xff4e('0x7')])['then'](function(_0x51f665){if(_0x51f665){_0x313c2d[_0xff4e('0xb')]=_0x51f665[_0xff4e('0xb')];}utils[_0xff4e('0xc')](_0xff4e('0xd'),_0x313c2d);});}else{utils[_0xff4e('0xc')](_0xff4e('0xd'),_0x313c2d);}if(_0x313c2d[_0xff4e('0xe')]){delete queues[_0x313c2d[_0xff4e('0xe')]];}else{delete queues[_0x313c2d[_0xff4e('0x5')]];}}exports[_0xff4e('0xf')]=function(_0x599b25){try{utils[_0xff4e('0x10')](util['format']('[%s][queues][queuecallerjoin]',_0x599b25['uniqueid']),_0x599b25);utils[_0xff4e('0x2')](util[_0xff4e('0x3')](_0xff4e('0x11'),_0x599b25[_0xff4e('0x5')],_0x599b25['queue'],_0x599b25[_0xff4e('0x12')]));queues[_0x599b25['uniqueid']]=_[_0xff4e('0x13')](_0x599b25,{'originalposition':_0x599b25['position'],'queuecallerjoinAt':utils[_0xff4e('0x14')](),'mohtime':0x0});}catch(_0x149571){utils['error'](util['format'](_0xff4e('0x15'),_0x599b25[_0xff4e('0x5')]),_0x149571);}};exports[_0xff4e('0x16')]=function(_0x401dc9){try{if(!_[_0xff4e('0x17')](queues[_0x401dc9[_0xff4e('0x5')]])){utils['debug'](util['format'](_0xff4e('0x18'),_0x401dc9[_0xff4e('0x5')]),_0x401dc9);if(queues[_0x401dc9[_0xff4e('0x5')]][_0xff4e('0x19')]){if(!queues[_0x401dc9[_0xff4e('0x5')]][_0xff4e('0x1a')]&&!queues[_0x401dc9['uniqueid']]['queuecallerexit']){queues[_0x401dc9[_0xff4e('0x5')]][_0xff4e('0x1b')]=!![];queues[_0x401dc9[_0xff4e('0x5')]][_0xff4e('0x1c')]=utils[_0xff4e('0x14')]();queues[_0x401dc9[_0xff4e('0x5')]]['queuecallerexitreason']=_0xff4e('0x1d');}utils[_0xff4e('0x2')](util['format'](_0xff4e('0x1e'),_0x401dc9[_0xff4e('0x5')],queues[_0x401dc9[_0xff4e('0x5')]][_0xff4e('0x1f')],queues[_0x401dc9[_0xff4e('0x5')]][_0xff4e('0x20')]));writeDB(queues[_0x401dc9[_0xff4e('0x5')]]);}else if(queues[_0x401dc9[_0xff4e('0x5')]][_0xff4e('0xe')]){utils['info'](util[_0xff4e('0x3')](_0xff4e('0x21'),_0x401dc9[_0xff4e('0x5')],queues[_0x401dc9[_0xff4e('0x5')]][_0xff4e('0x1f')],queues[_0x401dc9[_0xff4e('0x5')]][_0xff4e('0xe')]));queues[queues[_0x401dc9[_0xff4e('0x5')]][_0xff4e('0xe')]]=queues[_0x401dc9['uniqueid']];queues[queues[_0x401dc9['uniqueid']]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x401dc9['uniqueid']];}}}catch(_0xd6b2){utils[_0xff4e('0x22')](util[_0xff4e('0x3')]('[%s][queues][hangup]',_0x401dc9[_0xff4e('0x5')]),_0xd6b2);}};exports[_0xff4e('0x23')]=function(_0x4fd744){try{utils['debug'](util['format'](_0xff4e('0x24'),_0x4fd744['uniqueid']),_0x4fd744);if(!_[_0xff4e('0x17')](_0x4fd744['variable'][_0xff4e('0x25')])&&_0x4fd744['value'][_0xff4e('0x26')]()!==_0xff4e('0x27')){if(!_['isNil'](queues[_0x4fd744[_0xff4e('0x5')]])){queues[_0x4fd744['uniqueid']][_0xff4e('0x1a')]=![];queues[_0x4fd744[_0xff4e('0x5')]]['queuecallerabandonAt']=null;queues[_0x4fd744[_0xff4e('0x5')]][_0xff4e('0x28')]=!![];queues[_0x4fd744[_0xff4e('0x5')]]['queuecallerexitAt']=utils[_0xff4e('0x14')]();queues[_0x4fd744[_0xff4e('0x5')]]['queuecallerexitreason']=_0x4fd744[_0xff4e('0x29')]['toUpperCase']();utils[_0xff4e('0x2')](util['format'](_0xff4e('0x2a'),_0x4fd744[_0xff4e('0x5')],queues[_0x4fd744[_0xff4e('0x5')]][_0xff4e('0x1f')],_0x4fd744[_0xff4e('0x29')],queues[_0x4fd744['uniqueid']][_0xff4e('0x20')]));writeDB(queues[_0x4fd744[_0xff4e('0x5')]]);}}else if(!_[_0xff4e('0x17')](_0x4fd744['variable'][_0xff4e('0x2b')])){if(!_[_0xff4e('0x17')](queues[_0x4fd744['uniqueid']])&&!queues[_0x4fd744['uniqueid']][_0xff4e('0x1a')]){queues[_0x4fd744['uniqueid']][_0xff4e('0x1a')]=![];queues[_0x4fd744['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4fd744[_0xff4e('0x5')]][_0xff4e('0x28')]=!![];queues[_0x4fd744['uniqueid']][_0xff4e('0x2c')]=utils['now']();queues[_0x4fd744[_0xff4e('0x5')]]['queuecallerexitreason']=_0xff4e('0x2d');utils[_0xff4e('0x2')](util[_0xff4e('0x3')](_0xff4e('0x2e'),_0x4fd744['uniqueid'],queues[_0x4fd744['uniqueid']][_0xff4e('0x1f')],_0x4fd744['value'],queues[_0x4fd744[_0xff4e('0x5')]][_0xff4e('0x20')]));}}}catch(_0x37c796){utils['error'](util['format']('[%s][queues][varset]',_0x4fd744[_0xff4e('0x5')]),_0x37c796);}};exports[_0xff4e('0x1a')]=function(_0x32200c){try{if(!_[_0xff4e('0x17')](queues[_0x32200c['uniqueid']])){utils['debug'](util[_0xff4e('0x3')](_0xff4e('0x2f'),_0x32200c['uniqueid']),_0x32200c);queues[_0x32200c[_0xff4e('0x5')]][_0xff4e('0x28')]=![];queues[_0x32200c[_0xff4e('0x5')]][_0xff4e('0x2c')]=null;queues[_0x32200c[_0xff4e('0x5')]][_0xff4e('0x1a')]=!![];queues[_0x32200c[_0xff4e('0x5')]][_0xff4e('0x30')]=utils[_0xff4e('0x14')]();queues[_0x32200c[_0xff4e('0x5')]][_0xff4e('0x20')]=_0xff4e('0x31');utils['info'](util['format'](_0xff4e('0x32'),_0x32200c[_0xff4e('0x5')],queues[_0x32200c[_0xff4e('0x5')]][_0xff4e('0x1f')],queues[_0x32200c['uniqueid']]['queuecallerexitreason']));}}catch(_0x227783){utils[_0xff4e('0x22')](util[_0xff4e('0x3')](_0xff4e('0x2f'),_0x32200c[_0xff4e('0x5')]),_0x227783);}};exports['queuecallerleave']=function(_0xcea64e){try{if(!_[_0xff4e('0x17')](queues[_0xcea64e['uniqueid']])){utils[_0xff4e('0x10')](util['format'](_0xff4e('0x33'),_0xcea64e['uniqueid']),_0xcea64e);utils['info'](util[_0xff4e('0x3')](_0xff4e('0x34'),_0xcea64e[_0xff4e('0x5')],queues[_0xcea64e[_0xff4e('0x5')]][_0xff4e('0x1f')],_0xcea64e['connectedlinenum'],_0xcea64e['connectedlinename']));queues[_0xcea64e[_0xff4e('0x5')]][_0xff4e('0x35')]=!![];queues[_0xcea64e['uniqueid']][_0xff4e('0x19')]=utils['now']();queues[_0xcea64e[_0xff4e('0x5')]][_0xff4e('0x36')]=utils[_0xff4e('0x37')](queues[_0xcea64e[_0xff4e('0x5')]][_0xff4e('0x19')],queues[_0xcea64e[_0xff4e('0x5')]][_0xff4e('0x38')]);queues[_0xcea64e['uniqueid']][_0xff4e('0x12')]=_0xcea64e[_0xff4e('0x12')];queues[_0xcea64e[_0xff4e('0x5')]][_0xff4e('0x39')]=_0xcea64e[_0xff4e('0x39')];queues[_0xcea64e[_0xff4e('0x5')]][_0xff4e('0x3a')]=_0xcea64e[_0xff4e('0x3a')];queues[_0xcea64e['uniqueid']][_0xff4e('0x3b')]=_0xcea64e[_0xff4e('0x3b')];}}catch(_0x390d5d){utils['error'](util[_0xff4e('0x3')](_0xff4e('0x33'),_0xcea64e[_0xff4e('0x5')]),_0x390d5d);}};exports[_0xff4e('0x3c')]=function(_0x2f073b){try{if(!_['isNil'](queues[_0x2f073b[_0xff4e('0x5')]])){utils[_0xff4e('0x10')](util[_0xff4e('0x3')](_0xff4e('0x3d'),_0x2f073b['uniqueid']),_0x2f073b);utils['info'](util[_0xff4e('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2f073b[_0xff4e('0x5')],queues[_0x2f073b['uniqueid']]['name'],_0x2f073b[_0xff4e('0x3e')],_0x2f073b[_0xff4e('0x3f')]));queues[_0x2f073b[_0xff4e('0x5')]][_0xff4e('0x1a')]=![];queues[_0x2f073b[_0xff4e('0x5')]][_0xff4e('0x1a')]=![];queues[_0x2f073b[_0xff4e('0x5')]][_0xff4e('0x30')]=null;queues[_0x2f073b[_0xff4e('0x5')]]['queuecallerexit']=![];queues[_0x2f073b[_0xff4e('0x5')]][_0xff4e('0x20')]=null;queues[_0x2f073b[_0xff4e('0x5')]][_0xff4e('0x2c')]=null;queues[_0x2f073b['uniqueid']][_0xff4e('0x40')]=!![];queues[_0x2f073b[_0xff4e('0x5')]][_0xff4e('0xa')]=_0x2f073b[_0xff4e('0x3f')];queues[_0x2f073b[_0xff4e('0x5')]][_0xff4e('0x8')]=_0x2f073b[_0xff4e('0x3e')];}}catch(_0xa5aa0c){utils[_0xff4e('0x22')](util[_0xff4e('0x3')](_0xff4e('0x3d'),_0x2f073b[_0xff4e('0x5')]),_0xa5aa0c);}};exports['agentcomplete']=function(_0x2eb640){try{if(!_[_0xff4e('0x17')](queues[_0x2eb640[_0xff4e('0x5')]])){if(queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x19')]){utils[_0xff4e('0x10')](util[_0xff4e('0x3')](_0xff4e('0x41'),_0x2eb640['uniqueid']),_0x2eb640);queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x1a')]=![];queues[_0x2eb640['uniqueid']][_0xff4e('0x1a')]=![];queues[_0x2eb640['uniqueid']][_0xff4e('0x30')]=null;queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x28')]=![];queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x2c')]=null;queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x40')]=!![];queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x8')]=_0x2eb640[_0xff4e('0x3e')];queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x1b')]=!![];queues[_0x2eb640[_0xff4e('0x5')]]['queuecallercompleteAt']=utils[_0xff4e('0x14')]();if(_0x2eb640[_0xff4e('0x42')]=='transfer'){if(!queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x43')]){queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x20')]=_0xff4e('0x44');}}else{queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x20')]=_0xff4e('0x45')+_0x2eb640[_0xff4e('0x42')][_0xff4e('0x26')]();}utils[_0xff4e('0x2')](util[_0xff4e('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2eb640[_0xff4e('0x5')],queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x1f')],_0x2eb640[_0xff4e('0x3e')],queues[_0x2eb640[_0xff4e('0x5')]][_0xff4e('0x20')]));writeDB(queues[_0x2eb640[_0xff4e('0x5')]]);}}}catch(_0x2ad0e2){utils[_0xff4e('0x22')](util[_0xff4e('0x3')](_0xff4e('0x41'),_0x2eb640[_0xff4e('0x5')]),_0x2ad0e2);}};exports[_0xff4e('0x46')]=function(_0x51548e){try{if(!_['isNil'](queues[_0x51548e[_0xff4e('0x47')]])){utils[_0xff4e('0x10')](util['format'](_0xff4e('0x48'),_0x51548e[_0xff4e('0x5')]),_0x51548e);queues[_0x51548e['transfereeuniqueid']][_0xff4e('0x43')]=!![];queues[_0x51548e[_0xff4e('0x47')]][_0xff4e('0x49')]='BLIND';queues[_0x51548e[_0xff4e('0x47')]][_0xff4e('0x4a')]=_0x51548e[_0xff4e('0x4b')];queues[_0x51548e[_0xff4e('0x47')]][_0xff4e('0x4c')]=_0x51548e[_0xff4e('0x47')];queues[_0x51548e[_0xff4e('0x47')]][_0xff4e('0x20')]='BLINDTRANSFER';utils['info'](util['format'](_0xff4e('0x4d'),_0x51548e['uniqueid'],queues[_0x51548e['transfereeuniqueid']][_0xff4e('0x1f')],_0x51548e[_0xff4e('0x47')],_0x51548e[_0xff4e('0x4b')]));}}catch(_0x4f8fb7){utils[_0xff4e('0x22')](util[_0xff4e('0x3')](_0xff4e('0x48'),_0x51548e[_0xff4e('0x5')]),_0x4f8fb7);}};exports['attendedtransfer']=function(_0x48dd92){try{utils[_0xff4e('0x10')](util['format']('[%s][queues][attendedtransfer]',_0x48dd92[_0xff4e('0x4e')]),_0x48dd92);if(_0x48dd92[_0xff4e('0x4e')]==_0x48dd92[_0xff4e('0x4f')]){if(!_[_0xff4e('0x17')](queues[_0x48dd92[_0xff4e('0x50')]])){utils['info'](util[_0xff4e('0x3')](_0xff4e('0x51'),_0x48dd92[_0xff4e('0x4e')],queues[_0x48dd92['secondtransfererlinkedid']][_0xff4e('0x1f')],_0x48dd92[_0xff4e('0x52')]));queues[_0x48dd92[_0xff4e('0x50')]][_0xff4e('0x43')]=!![];queues[_0x48dd92[_0xff4e('0x50')]][_0xff4e('0x49')]=_0xff4e('0x53');queues[_0x48dd92[_0xff4e('0x50')]][_0xff4e('0x4a')]=_0x48dd92[_0xff4e('0x52')];queues[_0x48dd92[_0xff4e('0x50')]][_0xff4e('0x4c')]=_0x48dd92[_0xff4e('0x4e')];queues[_0x48dd92['secondtransfererlinkedid']]['queuecallerexitreason']=_0xff4e('0x54');}if(!_['isNil'](queues[_0x48dd92[_0xff4e('0x4f')]])){if(_0x48dd92[_0xff4e('0x55')]&&queues[_0x48dd92[_0xff4e('0x55')]]){queues[_0x48dd92[_0xff4e('0x55')]]['queuecallerenterreason']=0x1;queues[_0x48dd92[_0xff4e('0x47')]]=_[_0xff4e('0x56')](queues[_0x48dd92[_0xff4e('0x55')]]);queues[_0x48dd92[_0xff4e('0x47')]][_0xff4e('0xe')]=_0x48dd92[_0xff4e('0x57')];queues[_0x48dd92[_0xff4e('0x47')]][_0xff4e('0x58')]=0x2;queues[_0x48dd92[_0xff4e('0x47')]][_0xff4e('0x9')]=queues[_0x48dd92[_0xff4e('0x50')]][_0xff4e('0x9')];queues[_0x48dd92[_0xff4e('0x47')]][_0xff4e('0x59')]=queues[_0x48dd92[_0xff4e('0x50')]][_0xff4e('0x59')];queues[_0x48dd92[_0xff4e('0x47')]]['queuecallerjoinAt']=utils[_0xff4e('0x14')]();queues[_0x48dd92[_0xff4e('0x47')]]['queuecallerleaveAt']=utils[_0xff4e('0x14')]();queues[_0x48dd92[_0xff4e('0x47')]][_0xff4e('0x36')]=0x0;queues[_0x48dd92[_0xff4e('0x47')]]['mohtime']=0x0;utils[_0xff4e('0x2')](util[_0xff4e('0x3')](_0xff4e('0x5a'),_0x48dd92[_0xff4e('0x4e')],queues[_0x48dd92[_0xff4e('0x47')]]['name'],queues[_0x48dd92[_0xff4e('0x47')]][_0xff4e('0x9')],queues[_0x48dd92[_0xff4e('0x47')]][_0xff4e('0x59')]));}else{utils[_0xff4e('0x2')](util[_0xff4e('0x3')](_0xff4e('0x5b'),_0x48dd92[_0xff4e('0x4e')],queues[_0x48dd92[_0xff4e('0x4f')]][_0xff4e('0x1f')],_0x48dd92[_0xff4e('0x50')]));queues[_0x48dd92[_0xff4e('0x4f')]][_0xff4e('0xe')]=_0x48dd92[_0xff4e('0x50')];}}}else if(_0x48dd92[_0xff4e('0x5c')]==_0x48dd92[_0xff4e('0x50')]){if(!_[_0xff4e('0x17')](queues[_0x48dd92[_0xff4e('0x4f')]])){utils[_0xff4e('0x2')](util[_0xff4e('0x3')](_0xff4e('0x5d'),_0x48dd92['origtransfereruniqueid'],queues[_0x48dd92['origtransfererlinkedid']][_0xff4e('0x1f')],_0x48dd92[_0xff4e('0x5c')],_0x48dd92[_0xff4e('0x5e')]));queues[_0x48dd92[_0xff4e('0x4f')]][_0xff4e('0x43')]=!![];queues[_0x48dd92[_0xff4e('0x4f')]][_0xff4e('0x49')]=_0xff4e('0x53');queues[_0x48dd92[_0xff4e('0x4f')]]['transferexten']=_0x48dd92[_0xff4e('0x5e')];queues[_0x48dd92[_0xff4e('0x4f')]][_0xff4e('0x4c')]=_0x48dd92[_0xff4e('0x5c')];queues[_0x48dd92[_0xff4e('0x4f')]][_0xff4e('0x20')]='ATTENDEDTRANSFER';}if(!_[_0xff4e('0x17')](queues[_0x48dd92[_0xff4e('0x50')]])){if(_0x48dd92[_0xff4e('0x5f')]&&queues[_0x48dd92[_0xff4e('0x5f')]]){queues[_0x48dd92[_0xff4e('0x5f')]][_0xff4e('0x58')]=0x1;queues[_0x48dd92[_0xff4e('0x57')]]=_[_0xff4e('0x56')](queues[_0x48dd92[_0xff4e('0x5f')]]);queues[_0x48dd92[_0xff4e('0x57')]]['transfereduniqueid']=_0x48dd92[_0xff4e('0x57')];queues[_0x48dd92[_0xff4e('0x57')]][_0xff4e('0x58')]=0x2;queues[_0x48dd92[_0xff4e('0x57')]][_0xff4e('0x9')]=queues[_0x48dd92[_0xff4e('0x4f')]][_0xff4e('0x9')];queues[_0x48dd92[_0xff4e('0x57')]][_0xff4e('0x59')]=queues[_0x48dd92[_0xff4e('0x4f')]][_0xff4e('0x59')];queues[_0x48dd92['transfertargetuniqueid']][_0xff4e('0x38')]=utils[_0xff4e('0x14')]();queues[_0x48dd92[_0xff4e('0x57')]][_0xff4e('0x19')]=utils['now']();queues[_0x48dd92[_0xff4e('0x57')]][_0xff4e('0x36')]=0x0;queues[_0x48dd92[_0xff4e('0x57')]][_0xff4e('0x60')]=0x0;utils['info'](util[_0xff4e('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x48dd92[_0xff4e('0x4e')],queues[_0x48dd92['transfertargetuniqueid']][_0xff4e('0x1f')],queues[_0x48dd92[_0xff4e('0x57')]][_0xff4e('0xe')],queues[_0x48dd92[_0xff4e('0x57')]][_0xff4e('0x9')],queues[_0x48dd92[_0xff4e('0x57')]][_0xff4e('0x59')]));}else{utils[_0xff4e('0x2')](util[_0xff4e('0x3')](_0xff4e('0x5b'),_0x48dd92[_0xff4e('0x4e')],queues[_0x48dd92['secondtransfererlinkedid']]['name'],_0x48dd92[_0xff4e('0x4f')]));queues[_0x48dd92['secondtransfererlinkedid']][_0xff4e('0xe')]=_0x48dd92[_0xff4e('0x4f')];}}}}catch(_0x31540e){utils[_0xff4e('0x22')](util[_0xff4e('0x3')](_0xff4e('0x61'),_0x48dd92[_0xff4e('0x4e')]),_0x31540e);}};exports['musiconholdstart']=function(_0x4c62d2){try{if(!_[_0xff4e('0x17')](queues[_0x4c62d2[_0xff4e('0x5')]])){utils[_0xff4e('0x10')](util[_0xff4e('0x3')]('[%s][queues][musiconholdstart]',_0x4c62d2[_0xff4e('0x5')]),_0x4c62d2);queues[_0x4c62d2[_0xff4e('0x5')]][_0xff4e('0x62')]=utils[_0xff4e('0x14')]();utils[_0xff4e('0x2')](util[_0xff4e('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x4c62d2[_0xff4e('0x5')],queues[_0x4c62d2[_0xff4e('0x5')]][_0xff4e('0x1f')],queues[_0x4c62d2[_0xff4e('0x5')]][_0xff4e('0x62')]));}}catch(_0x245803){utils[_0xff4e('0x22')](util['format'](_0xff4e('0x63'),_0x4c62d2['uniqueid']),_0x245803);}};exports[_0xff4e('0x64')]=function(_0x39bbb9){try{if(!_[_0xff4e('0x17')](queues[_0x39bbb9[_0xff4e('0x5')]])){if(!_[_0xff4e('0x17')](queues[_0x39bbb9[_0xff4e('0x5')]]['musiconholdstartAt'])){utils['debug'](util['format'](_0xff4e('0x65'),_0x39bbb9[_0xff4e('0x5')]),_0x39bbb9);queues[_0x39bbb9[_0xff4e('0x5')]][_0xff4e('0x60')]+=utils[_0xff4e('0x37')](utils[_0xff4e('0x14')](),queues[_0x39bbb9['uniqueid']][_0xff4e('0x62')]);utils['info'](util['format'](_0xff4e('0x66'),_0x39bbb9[_0xff4e('0x5')],queues[_0x39bbb9['uniqueid']]['name'],queues[_0x39bbb9[_0xff4e('0x5')]][_0xff4e('0x60')]));delete queues[_0x39bbb9[_0xff4e('0x5')]][_0xff4e('0x62')];}}}catch(_0x580c9c){utils[_0xff4e('0x22')](util[_0xff4e('0x3')]('[%s][queues][musiconholdstop]',_0x39bbb9[_0xff4e('0x5')]),_0x580c9c);}};
\ No newline at end of file
index 3de49c3..4c8d16a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1613=['queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','error','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','value','endsWith','replace','.wav49','find','monitors','push','[%s][recordings][varset]','hangup','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]'];(function(_0x366e20,_0x4b850f){var _0x8c1181=function(_0x3669bd){while(--_0x3669bd){_0x366e20['push'](_0x366e20['shift']());}};_0x8c1181(++_0x4b850f);}(_0x1613,0x183));var _0x3161=function(_0x6bb3db,_0x2fea7b){_0x6bb3db=_0x6bb3db-0x0;var _0x592bf4=_0x1613[_0x6bb3db];return _0x592bf4;};'use strict';var _=require(_0x3161('0x0'));var util=require(_0x3161('0x1'));var utils=require(_0x3161('0x2'));var transfers=require(_0x3161('0x3'));var recordings={};function writeDB(_0x5261f5){var _0x465e57;utils[_0x3161('0x4')](util['format'](_0x3161('0x5'),_0x5261f5[_0x3161('0x6')]));if(transfers[_0x3161('0x7')][_0x5261f5['uniqueid']]){_0x465e57=_0x5261f5[_0x3161('0x6')];_0x5261f5['uniqueid']=transfers[_0x3161('0x7')][_0x5261f5[_0x3161('0x6')]][_0x3161('0x8')];}if(_0x5261f5[_0x3161('0x9')]){utils[_0x3161('0xa')](_0x5261f5[_0x3161('0x9')])[_0x3161('0xb')](function(_0x559430){if(_0x559430){_0x5261f5[_0x3161('0xc')]=_0x559430[_0x3161('0xd')];_0x5261f5[_0x3161('0xe')]=_0x559430['id'];}utils[_0x3161('0xf')](_0x3161('0x10'),_0x5261f5);});}else{utils[_0x3161('0xf')](_0x3161('0x10'),_0x5261f5);}if(_0x465e57)delete transfers['blinds'][_0x465e57];}exports[_0x3161('0x11')]=function(_0x4c7690){try{utils[_0x3161('0x12')](util[_0x3161('0x13')](_0x3161('0x14'),_0x4c7690[_0x3161('0x6')]),_0x4c7690);if(_0x4c7690['uniqueid']==_0x4c7690[_0x3161('0x15')]){utils[_0x3161('0x4')](util[_0x3161('0x13')](_0x3161('0x16'),_0x4c7690['uniqueid'],_0x4c7690['context'],_0x4c7690[_0x3161('0x17')]));recordings[_0x4c7690['uniqueid']]={'uniqueid':_0x4c7690[_0x3161('0x6')],'accountcode':_0x4c7690[_0x3161('0x9')],'exten':_0x4c7690[_0x3161('0x17')],'context':_0x4c7690[_0x3161('0x18')],'channel':_0x4c7690[_0x3161('0x19')],'monitors':[]};}}catch(_0x108322){utils['error'](util[_0x3161('0x13')](_0x3161('0x14'),_0x4c7690[_0x3161('0x6')]),_0x108322);}};exports['newstate']=function(_0x41204f){try{utils[_0x3161('0x12')](util[_0x3161('0x13')]('[%s][recordings][newstate]',_0x41204f[_0x3161('0x6')]),_0x41204f);if(!_[_0x3161('0x1a')](recordings[_0x41204f['uniqueid']])&&_0x41204f['channelstate']==0x6){utils[_0x3161('0x4')](util[_0x3161('0x13')](_0x3161('0x1b'),_0x41204f[_0x3161('0x6')],_0x41204f[_0x3161('0x18')],_0x41204f['channel']));}else if(!_[_0x3161('0x1a')](recordings[_0x41204f[_0x3161('0x15')]])&&_0x41204f[_0x3161('0x1c')]==0x6&&_0x41204f['context']!=_0x3161('0x1d')){utils[_0x3161('0x4')](util[_0x3161('0x13')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x41204f['uniqueid'],_0x41204f[_0x3161('0x15')],_0x41204f[_0x3161('0x18')],_0x41204f[_0x3161('0x19')]));recordings[_0x41204f['linkedid']][_0x3161('0x9')]=_0x41204f[_0x3161('0x9')];}}catch(_0x3c4cf5){utils[_0x3161('0x1e')](util[_0x3161('0x13')](_0x3161('0x1f'),_0x41204f[_0x3161('0x6')]),_0x3c4cf5);}};exports[_0x3161('0x20')]=function(_0x3d5837){try{if(!_[_0x3161('0x1a')](_0x3d5837[_0x3161('0x21')])&&!_[_0x3161('0x1a')](_0x3d5837[_0x3161('0x21')][_0x3161('0x22')])){utils[_0x3161('0x12')](util[_0x3161('0x13')]('[%s][recordings][varset]',_0x3d5837['uniqueid']),_0x3d5837);utils['info'](util[_0x3161('0x13')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3d5837['uniqueid'],_0x3d5837[_0x3161('0x21')],_0x3d5837[_0x3161('0x23')]));if(_[_0x3161('0x24')](_0x3d5837['value'],'.wav49')){_0x3d5837['value']=_0x3d5837[_0x3161('0x23')][_0x3161('0x25')](_0x3161('0x26'),'.WAV');}if(recordings[_0x3d5837[_0x3161('0x15')]]){var _0x236e67=_[_0x3161('0x27')](recordings[_0x3d5837[_0x3161('0x15')]]['monitors'],{'value':_0x3d5837[_0x3161('0x23')]});if(_[_0x3161('0x1a')](_0x236e67)){recordings[_0x3d5837[_0x3161('0x15')]][_0x3161('0x28')][_0x3161('0x29')]({'value':_0x3d5837['value']});}}}}catch(_0x124d0e){utils[_0x3161('0x1e')](util[_0x3161('0x13')](_0x3161('0x2a'),_0x3d5837[_0x3161('0x6')]),_0x124d0e);}};exports[_0x3161('0x2b')]=function(_0x2533c1){try{if(!_[_0x3161('0x1a')](recordings[_0x2533c1[_0x3161('0x6')]])){utils[_0x3161('0x12')](util['format']('[%s][recordings][hangup]',_0x2533c1['uniqueid']),_0x2533c1);utils[_0x3161('0x4')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x2533c1[_0x3161('0x6')],_0x2533c1[_0x3161('0x2c')],_0x2533c1['calleridname'],_0x2533c1[_0x3161('0x2d')]));recordings[_0x2533c1[_0x3161('0x6')]]['calleridnum']=_0x2533c1[_0x3161('0x2c')];recordings[_0x2533c1[_0x3161('0x6')]][_0x3161('0x2e')]=_0x2533c1[_0x3161('0x2e')];recordings[_0x2533c1[_0x3161('0x6')]][_0x3161('0x2f')]=_0x2533c1[_0x3161('0x2f')];recordings[_0x2533c1[_0x3161('0x6')]][_0x3161('0x30')]=_0x2533c1[_0x3161('0x30')];if(recordings[_0x2533c1[_0x3161('0x6')]]['type']==_0x3161('0x31')&&recordings[_0x2533c1[_0x3161('0x6')]][_0x3161('0x9')]){recordings[_0x2533c1[_0x3161('0x6')]][_0x3161('0x2f')]=recordings[_0x2533c1[_0x3161('0x6')]]['accountcode'];recordings[_0x2533c1[_0x3161('0x6')]][_0x3161('0x30')]='';}recordings[_0x2533c1[_0x3161('0x6')]][_0x3161('0x28')][_0x3161('0x32')](function(_0x7352aa){var _0x388cdb=_[_0x3161('0x33')](recordings[_0x2533c1['uniqueid']]);_0x388cdb[_0x3161('0x23')]=_0x7352aa[_0x3161('0x23')];writeDB(_0x388cdb);});delete recordings[_0x2533c1[_0x3161('0x6')]];}}catch(_0x1adab9){utils[_0x3161('0x1e')](util[_0x3161('0x13')]('[%s][recordings][hangup]',_0x2533c1[_0x3161('0x6')]),_0x1adab9);}};exports[_0x3161('0x34')]=function(_0x4b2f1d){try{if(!_['isNil'](recordings[_0x4b2f1d[_0x3161('0x6')]])){utils[_0x3161('0x12')](util[_0x3161('0x13')]('[%s][recordings][newexten]',_0x4b2f1d['uniqueid']),_0x4b2f1d);utils[_0x3161('0x4')](util[_0x3161('0x13')](_0x3161('0x35'),_0x4b2f1d[_0x3161('0x6')],_0x4b2f1d[_0x3161('0x36')],_0x4b2f1d[_0x3161('0x37')]));if(_0x4b2f1d['application'][_0x3161('0x38')]()==_0x3161('0x39')&&_['startsWith'](_0x4b2f1d[_0x3161('0x37')][_0x3161('0x38')](),_0x3161('0x3a'))){var _0x5e4125=_0x4b2f1d[_0x3161('0x37')][_0x3161('0x3b')]('=');var _0x4524e1=_0x5e4125[0x0][_0x3161('0x3c')](_0x5e4125[0x0][_0x3161('0x3d')]('(')+0x1,_0x5e4125[0x0]['lastIndexOf'](')'));var _0x4badf5=_0x5e4125[0x1];recordings[_0x4b2f1d[_0x3161('0x6')]][_0x4524e1]=_0x4badf5;}}}catch(_0x4bff27){utils[_0x3161('0x1e')](util['format'](_0x3161('0x3e'),_0x4b2f1d[_0x3161('0x6')]),_0x4bff27);}};exports[_0x3161('0x3f')]=function(_0x23982f){try{if(!_[_0x3161('0x1a')](recordings[_0x23982f[_0x3161('0x6')]])){utils[_0x3161('0x12')](util['format'](_0x3161('0x40'),_0x23982f[_0x3161('0x6')]),_0x23982f);utils['info'](util[_0x3161('0x13')](_0x3161('0x41'),_0x23982f['uniqueid'],_0x23982f[_0x3161('0x42')]));recordings[_0x23982f[_0x3161('0x6')]][_0x3161('0x42')]=_0x23982f[_0x3161('0x42')];}}catch(_0x1d259b){utils[_0x3161('0x1e')](util[_0x3161('0x13')](_0x3161('0x40'),_0x23982f['uniqueid']),_0x1d259b);}};exports[_0x3161('0x43')]=function(_0x516402){try{utils['debug'](util[_0x3161('0x13')](_0x3161('0x44'),_0x516402[_0x3161('0x6')]),_0x516402);utils['info'](util[_0x3161('0x13')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x516402['uniqueid'],_0x516402[_0x3161('0x45')],_0x516402[_0x3161('0x46')],_0x516402[_0x3161('0x47')],_0x516402[_0x3161('0x48')]));if(recordings[_0x516402[_0x3161('0x49')]]&&transfers[_0x3161('0x7')][_0x516402[_0x3161('0x49')]]){transfers[_0x3161('0x7')][_0x516402[_0x3161('0x49')]][_0x3161('0x4a')]=!![];}}catch(_0x5eec92){utils[_0x3161('0x1e')](util[_0x3161('0x13')]('[%s][recordings][blindtransfer]',_0x516402[_0x3161('0x6')]),_0x5eec92);}};
\ No newline at end of file
+var _0x29f6=['[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate'];(function(_0x5088dc,_0x5737e9){var _0xede36=function(_0x491534){while(--_0x491534){_0x5088dc['push'](_0x5088dc['shift']());}};_0xede36(++_0x5737e9);}(_0x29f6,0x78));var _0x629f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x629f('0x0'));var util=require(_0x629f('0x1'));var utils=require(_0x629f('0x2'));var transfers=require(_0x629f('0x3'));var recordings={};function writeDB(_0x2f7d81){var _0x16fbbc;utils[_0x629f('0x4')](util[_0x629f('0x5')]('[%s][recordings][writeDB]',_0x2f7d81[_0x629f('0x6')]));if(transfers[_0x629f('0x7')][_0x2f7d81[_0x629f('0x6')]]){_0x16fbbc=_0x2f7d81[_0x629f('0x6')];_0x2f7d81[_0x629f('0x6')]=transfers['blinds'][_0x2f7d81[_0x629f('0x6')]][_0x629f('0x8')];}if(_0x2f7d81[_0x629f('0x9')]){utils[_0x629f('0xa')](_0x2f7d81[_0x629f('0x9')])[_0x629f('0xb')](function(_0x234888){if(_0x234888){_0x2f7d81['membername']=_0x234888[_0x629f('0xc')];_0x2f7d81[_0x629f('0xd')]=_0x234888['id'];}utils[_0x629f('0xe')](_0x629f('0xf'),_0x2f7d81);});}else{utils[_0x629f('0xe')]('CreateVoiceRecording',_0x2f7d81);}if(_0x16fbbc)delete transfers[_0x629f('0x7')][_0x16fbbc];}exports['newchannel']=function(_0x371e1a){try{utils[_0x629f('0x10')](util['format'](_0x629f('0x11'),_0x371e1a[_0x629f('0x6')]),_0x371e1a);if(_0x371e1a[_0x629f('0x6')]==_0x371e1a[_0x629f('0x12')]){utils['info'](util[_0x629f('0x5')](_0x629f('0x13'),_0x371e1a['uniqueid'],_0x371e1a[_0x629f('0x14')],_0x371e1a[_0x629f('0x15')]));recordings[_0x371e1a[_0x629f('0x6')]]={'uniqueid':_0x371e1a[_0x629f('0x6')],'accountcode':_0x371e1a['accountcode'],'exten':_0x371e1a[_0x629f('0x15')],'context':_0x371e1a['context'],'channel':_0x371e1a[_0x629f('0x16')],'monitors':[]};}}catch(_0x486a5a){utils[_0x629f('0x17')](util[_0x629f('0x5')](_0x629f('0x11'),_0x371e1a[_0x629f('0x6')]),_0x486a5a);}};exports[_0x629f('0x18')]=function(_0x26b1aa){try{utils[_0x629f('0x10')](util[_0x629f('0x5')](_0x629f('0x19'),_0x26b1aa[_0x629f('0x6')]),_0x26b1aa);if(!_[_0x629f('0x1a')](recordings[_0x26b1aa['uniqueid']])&&_0x26b1aa[_0x629f('0x1b')]==0x6){utils['info'](util[_0x629f('0x5')](_0x629f('0x1c'),_0x26b1aa['uniqueid'],_0x26b1aa['context'],_0x26b1aa['channel']));}else if(!_['isNil'](recordings[_0x26b1aa['linkedid']])&&_0x26b1aa[_0x629f('0x1b')]==0x6&&_0x26b1aa[_0x629f('0x14')]!=_0x629f('0x1d')){utils[_0x629f('0x4')](util[_0x629f('0x5')](_0x629f('0x1e'),_0x26b1aa['uniqueid'],_0x26b1aa['linkedid'],_0x26b1aa[_0x629f('0x14')],_0x26b1aa[_0x629f('0x16')]));recordings[_0x26b1aa[_0x629f('0x12')]][_0x629f('0x9')]=_0x26b1aa[_0x629f('0x9')];}}catch(_0x2d0cb6){utils['error'](util[_0x629f('0x5')](_0x629f('0x19'),_0x26b1aa[_0x629f('0x6')]),_0x2d0cb6);}};exports[_0x629f('0x1f')]=function(_0x5708f4){try{if(!_[_0x629f('0x1a')](_0x5708f4[_0x629f('0x20')])&&!_[_0x629f('0x1a')](_0x5708f4[_0x629f('0x20')][_0x629f('0x21')])){utils['debug'](util[_0x629f('0x5')](_0x629f('0x22'),_0x5708f4[_0x629f('0x6')]),_0x5708f4);utils[_0x629f('0x4')](util[_0x629f('0x5')](_0x629f('0x23'),_0x5708f4[_0x629f('0x6')],_0x5708f4[_0x629f('0x20')],_0x5708f4[_0x629f('0x24')]));if(_['endsWith'](_0x5708f4[_0x629f('0x24')],_0x629f('0x25'))){_0x5708f4[_0x629f('0x24')]=_0x5708f4[_0x629f('0x24')]['replace']('.wav49',_0x629f('0x26'));}if(recordings[_0x5708f4['linkedid']]){var _0x2089b1=_[_0x629f('0x27')](recordings[_0x5708f4[_0x629f('0x12')]][_0x629f('0x28')],{'value':_0x5708f4[_0x629f('0x24')]});if(_[_0x629f('0x1a')](_0x2089b1)){recordings[_0x5708f4[_0x629f('0x12')]][_0x629f('0x28')][_0x629f('0x29')]({'value':_0x5708f4[_0x629f('0x24')]});}}}}catch(_0x1d8417){utils['error'](util[_0x629f('0x5')](_0x629f('0x22'),_0x5708f4['uniqueid']),_0x1d8417);}};exports[_0x629f('0x2a')]=function(_0x395f39){try{if(!_[_0x629f('0x1a')](recordings[_0x395f39[_0x629f('0x6')]])){utils[_0x629f('0x10')](util['format'](_0x629f('0x2b'),_0x395f39['uniqueid']),_0x395f39);utils['info'](util[_0x629f('0x5')](_0x629f('0x2c'),_0x395f39[_0x629f('0x6')],_0x395f39[_0x629f('0x2d')],_0x395f39['calleridname'],_0x395f39[_0x629f('0x2e')]));recordings[_0x395f39[_0x629f('0x6')]][_0x629f('0x2d')]=_0x395f39['calleridnum'];recordings[_0x395f39['uniqueid']]['calleridname']=_0x395f39['calleridname'];recordings[_0x395f39[_0x629f('0x6')]][_0x629f('0x2f')]=_0x395f39['connectedlinenum'];recordings[_0x395f39[_0x629f('0x6')]][_0x629f('0x30')]=_0x395f39[_0x629f('0x30')];if(recordings[_0x395f39[_0x629f('0x6')]][_0x629f('0x31')]==_0x629f('0x32')&&recordings[_0x395f39['uniqueid']]['accountcode']){recordings[_0x395f39[_0x629f('0x6')]]['connectedlinenum']=recordings[_0x395f39[_0x629f('0x6')]]['accountcode'];recordings[_0x395f39[_0x629f('0x6')]][_0x629f('0x30')]='';}recordings[_0x395f39[_0x629f('0x6')]]['monitors'][_0x629f('0x33')](function(_0x440c9d){var _0x13db5f=_['clone'](recordings[_0x395f39[_0x629f('0x6')]]);_0x13db5f[_0x629f('0x24')]=_0x440c9d[_0x629f('0x24')];writeDB(_0x13db5f);});delete recordings[_0x395f39[_0x629f('0x6')]];}}catch(_0x57f3eb){utils[_0x629f('0x17')](util[_0x629f('0x5')]('[%s][recordings][hangup]',_0x395f39[_0x629f('0x6')]),_0x57f3eb);}};exports[_0x629f('0x34')]=function(_0x417170){try{if(!_[_0x629f('0x1a')](recordings[_0x417170[_0x629f('0x6')]])){utils[_0x629f('0x10')](util['format']('[%s][recordings][newexten]',_0x417170[_0x629f('0x6')]),_0x417170);utils[_0x629f('0x4')](util[_0x629f('0x5')](_0x629f('0x35'),_0x417170[_0x629f('0x6')],_0x417170[_0x629f('0x36')],_0x417170['appdata']));if(_0x417170[_0x629f('0x36')][_0x629f('0x37')]()==_0x629f('0x38')&&_['startsWith'](_0x417170[_0x629f('0x39')][_0x629f('0x37')](),_0x629f('0x3a'))){var _0x563cb9=_0x417170[_0x629f('0x39')]['split']('=');var _0x343f54=_0x563cb9[0x0][_0x629f('0x3b')](_0x563cb9[0x0][_0x629f('0x3c')]('(')+0x1,_0x563cb9[0x0][_0x629f('0x3c')](')'));var _0x21dc04=_0x563cb9[0x1];recordings[_0x417170[_0x629f('0x6')]][_0x343f54]=_0x21dc04;}}}catch(_0x2f7293){utils['error'](util[_0x629f('0x5')](_0x629f('0x3d'),_0x417170[_0x629f('0x6')]),_0x2f7293);}};exports[_0x629f('0x3e')]=function(_0x38c0dd){try{if(!_[_0x629f('0x1a')](recordings[_0x38c0dd[_0x629f('0x6')]])){utils[_0x629f('0x10')](util['format'](_0x629f('0x3f'),_0x38c0dd['uniqueid']),_0x38c0dd);utils[_0x629f('0x4')](util[_0x629f('0x5')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x38c0dd[_0x629f('0x6')],_0x38c0dd[_0x629f('0x40')]));recordings[_0x38c0dd['uniqueid']][_0x629f('0x40')]=_0x38c0dd[_0x629f('0x40')];}}catch(_0x53bfee){utils['error'](util[_0x629f('0x5')](_0x629f('0x3f'),_0x38c0dd[_0x629f('0x6')]),_0x53bfee);}};exports[_0x629f('0x41')]=function(_0x222549){try{utils[_0x629f('0x10')](util[_0x629f('0x5')](_0x629f('0x42'),_0x222549[_0x629f('0x6')]),_0x222549);utils['info'](util[_0x629f('0x5')](_0x629f('0x43'),_0x222549[_0x629f('0x6')],_0x222549[_0x629f('0x44')],_0x222549[_0x629f('0x45')],_0x222549[_0x629f('0x46')],_0x222549[_0x629f('0x47')]));if(recordings[_0x222549[_0x629f('0x48')]]&&transfers['blinds'][_0x222549[_0x629f('0x48')]]){transfers[_0x629f('0x7')][_0x222549[_0x629f('0x48')]][_0x629f('0x49')]=!![];}}catch(_0x8b7dbd){utils[_0x629f('0x17')](util['format']('[%s][recordings][blindtransfer]',_0x222549[_0x629f('0x6')]),_0x8b7dbd);}};
\ No newline at end of file
index 212ccf8..d3b7307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8719=['transfertargetlinkedid','error','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','origtransferercontext','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x8719,0x15a));var _0x9871=function(_0x333af7,_0x571587){_0x333af7=_0x333af7-0x0;var _0x3c0885=_0x8719[_0x333af7];return _0x3c0885;};'use strict';var _=require(_0x9871('0x0'));var util=require(_0x9871('0x1'));var utils=require('./utils');function writeDB(_0x15dda8){utils[_0x9871('0x2')](util[_0x9871('0x3')](_0x9871('0x4'),_0x15dda8[_0x9871('0x5')]==='attended'?_0x15dda8[_0x9871('0x6')]:_0x15dda8[_0x9871('0x7')],_0x15dda8[_0x9871('0x5')]));utils[_0x9871('0x8')](_0x9871('0x9'),_0x15dda8);}exports[_0x9871('0xa')]={};exports[_0x9871('0xb')]=function(_0x16b61c){try{utils[_0x9871('0xc')](util[_0x9871('0x3')](_0x9871('0xd'),_0x16b61c['uniqueid']),_0x16b61c);utils[_0x9871('0x2')](util['format'](_0x9871('0xe'),_0x16b61c[_0x9871('0x7')],_0x16b61c[_0x9871('0xf')],_0x16b61c[_0x9871('0x10')],_0x16b61c[_0x9871('0x11')],_0x16b61c[_0x9871('0x12')]));_0x16b61c[_0x9871('0x5')]=_0x9871('0x13');exports[_0x9871('0xa')][_0x16b61c['transfereruniqueid']]=_0x16b61c;writeDB(_0x16b61c);}catch(_0x4d8dce){utils['error'](util['format']('[%s][transfers][blindtransfer]',_0x16b61c['uniqueid']),_0x4d8dce);}};exports[_0x9871('0x14')]=function(_0x12dee8){try{utils[_0x9871('0xc')](util['format'](_0x9871('0x15'),_0x12dee8[_0x9871('0x6')]),_0x12dee8);utils[_0x9871('0x2')](util[_0x9871('0x3')](_0x9871('0x16'),_0x12dee8[_0x9871('0x6')],_0x12dee8['origtransferercalleridnum'],_0x12dee8['origtransferercalleridname'],_0x12dee8['transfertargetcalleridnum'],_0x12dee8['transfertargetcalleridname']));_0x12dee8=_['assign'](_0x12dee8,{'transfererchannel':_0x12dee8[_0x9871('0x17')],'transferercalleridnum':_0x12dee8[_0x9871('0x18')],'transferercalleridname':_0x12dee8[_0x9871('0x19')],'transfererconnectedlinenum':_0x12dee8[_0x9871('0x1a')],'transfererconnectedlinename':_0x12dee8[_0x9871('0x1b')],'transfereraccountcode':_0x12dee8['origtransfereraccountcode'],'transferercontext':_0x12dee8[_0x9871('0x1c')],'transfererexten':_0x12dee8['secondtransfererexten'],'transfererlinkedid':_0x12dee8[_0x9871('0x1d')],'context':_0x12dee8[_0x9871('0x1e')],'extension':_0x12dee8['origtransfererexten'],'type':_0x9871('0x1f')});if(_[_0x9871('0x20')](_0x12dee8[_0x9871('0x21')])){_0x12dee8=_[_0x9871('0x22')](_0x12dee8,{'transfereechannel':_0x12dee8[_0x9871('0x23')],'transfereecalleridnum':_0x12dee8['transfertargetcalleridnum'],'transfereecalleridname':_0x12dee8[_0x9871('0x24')],'transfereeconnectedlinenum':_0x12dee8[_0x9871('0x25')],'transfereeconnectedlinename':_0x12dee8[_0x9871('0x26')],'transfereeaccountcode':_0x12dee8['transfertargetaccountcode'],'transfereecontext':_0x12dee8[_0x9871('0x27')],'transfereeexten':_0x12dee8[_0x9871('0x28')],'transfereelinkedid':_0x12dee8[_0x9871('0x29')]});}writeDB(_0x12dee8);}catch(_0x37db3f){utils[_0x9871('0x2a')](util['format'](_0x9871('0x15'),_0x12dee8[_0x9871('0x6')]),_0x37db3f);}};
\ No newline at end of file
+var _0x2f5a=['blinds','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','info','format','attended','origtransfereruniqueid','uniqueid','type','CreateVoiceTransferReport'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2f5a,0x14e));var _0xa2f5=function(_0x2b9d5c,_0x173518){_0x2b9d5c=_0x2b9d5c-0x0;var _0x37bb93=_0x2f5a[_0x2b9d5c];return _0x37bb93;};'use strict';var _=require(_0xa2f5('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x5a64c2){utils[_0xa2f5('0x1')](util[_0xa2f5('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x5a64c2['type']===_0xa2f5('0x3')?_0x5a64c2[_0xa2f5('0x4')]:_0x5a64c2[_0xa2f5('0x5')],_0x5a64c2[_0xa2f5('0x6')]));utils['request'](_0xa2f5('0x7'),_0x5a64c2);}exports[_0xa2f5('0x8')]={};exports[_0xa2f5('0x9')]=function(_0x179a62){try{utils['debug'](util[_0xa2f5('0x2')](_0xa2f5('0xa'),_0x179a62['uniqueid']),_0x179a62);utils[_0xa2f5('0x1')](util[_0xa2f5('0x2')](_0xa2f5('0xb'),_0x179a62['uniqueid'],_0x179a62[_0xa2f5('0xc')],_0x179a62[_0xa2f5('0xd')],_0x179a62['transfereecalleridnum'],_0x179a62[_0xa2f5('0xe')]));_0x179a62[_0xa2f5('0x6')]=_0xa2f5('0xf');exports['blinds'][_0x179a62[_0xa2f5('0x10')]]=_0x179a62;writeDB(_0x179a62);}catch(_0x1a2069){utils[_0xa2f5('0x11')](util[_0xa2f5('0x2')](_0xa2f5('0xa'),_0x179a62[_0xa2f5('0x5')]),_0x1a2069);}};exports[_0xa2f5('0x12')]=function(_0x390298){try{utils[_0xa2f5('0x13')](util[_0xa2f5('0x2')](_0xa2f5('0x14'),_0x390298[_0xa2f5('0x4')]),_0x390298);utils[_0xa2f5('0x1')](util[_0xa2f5('0x2')](_0xa2f5('0x15'),_0x390298['origtransfereruniqueid'],_0x390298['origtransferercalleridnum'],_0x390298[_0xa2f5('0x16')],_0x390298[_0xa2f5('0x17')],_0x390298['transfertargetcalleridname']));_0x390298=_[_0xa2f5('0x18')](_0x390298,{'transfererchannel':_0x390298[_0xa2f5('0x19')],'transferercalleridnum':_0x390298['origtransferercalleridnum'],'transferercalleridname':_0x390298[_0xa2f5('0x16')],'transfererconnectedlinenum':_0x390298[_0xa2f5('0x1a')],'transfererconnectedlinename':_0x390298[_0xa2f5('0x1b')],'transfereraccountcode':_0x390298[_0xa2f5('0x1c')],'transferercontext':_0x390298[_0xa2f5('0x1d')],'transfererexten':_0x390298['secondtransfererexten'],'transfererlinkedid':_0x390298[_0xa2f5('0x1e')],'context':_0x390298[_0xa2f5('0x1f')],'extension':_0x390298[_0xa2f5('0x20')],'type':_0xa2f5('0x3')});if(_['isNil'](_0x390298['transfereechannel'])){_0x390298=_[_0xa2f5('0x18')](_0x390298,{'transfereechannel':_0x390298[_0xa2f5('0x21')],'transfereecalleridnum':_0x390298[_0xa2f5('0x17')],'transfereecalleridname':_0x390298['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x390298[_0xa2f5('0x22')],'transfereeconnectedlinename':_0x390298['transfertargetconnectedlinename'],'transfereeaccountcode':_0x390298[_0xa2f5('0x23')],'transfereecontext':_0x390298[_0xa2f5('0x24')],'transfereeexten':_0x390298['transfertargetexten'],'transfereelinkedid':_0x390298[_0xa2f5('0x25')]});}writeDB(_0x390298);}catch(_0xa7fff6){utils[_0xa2f5('0x11')](util['format'](_0xa2f5('0x14'),_0x390298[_0xa2f5('0x4')]),_0xa7fff6);}};
\ No newline at end of file
index d3843fd..779ee89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef1a=['getUserByInternal','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','found','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','moment','util','client','http','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','interface','[utils][getUser]\x20where:%s','stringify','length'];(function(_0x2c61d2,_0x31bbcc){var _0x533be3=function(_0xfd675e){while(--_0xfd675e){_0x2c61d2['push'](_0x2c61d2['shift']());}};_0x533be3(++_0x31bbcc);}(_0xef1a,0xaf));var _0xaef1=function(_0x48ec4a,_0x166db5){_0x48ec4a=_0x48ec4a-0x0;var _0x2c25b3=_0xef1a[_0x48ec4a];return _0x2c25b3;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xaef1('0x0'));var util=require(_0xaef1('0x1'));var client=jayson[_0xaef1('0x2')][_0xaef1('0x3')]({'port':0x2329});var logger=require('../../config/logger')(_0xaef1('0x4'));exports['info']=function(_0x4de826,_0x245a47){logger[_0xaef1('0x5')](_0x4de826,_0x245a47?util['inspect'](_0x245a47,{'showHidden':![],'depth':null}):'');};exports[_0xaef1('0x6')]=function(_0xd5ee9,_0x41c912){logger[_0xaef1('0x6')](_0xd5ee9,_0x41c912?util[_0xaef1('0x7')](_0x41c912,{'showHidden':![],'depth':null}):'');};exports[_0xaef1('0x8')]=function(_0x3b61f0,_0x20dcd1){logger[_0xaef1('0x8')](_0x3b61f0,_0x20dcd1?util[_0xaef1('0x7')](_0x20dcd1,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0xdec181,_0x122620){return client[_0xaef1('0x9')](_0xdec181,{'body':_0x122620})[_0xaef1('0xa')](function(_0x1b9e61){logger[_0xaef1('0x6')](_0xaef1('0xb'),_0xdec181,_0x1b9e61?util['inspect'](_0x1b9e61,{'showHidden':![],'depth':null}):'');})[_0xaef1('0xc')](function(_0x4f8242){logger['error']('[utils][request]\x20name:%s',_0xdec181,_0x4f8242?util[_0xaef1('0x7')](_0x4f8242,{'showHidden':![],'depth':null}):'');});};function getUser(_0x7879a9){return client[_0xaef1('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal','name',_0xaef1('0xd')],'where':_0x7879a9,'limit':0x1}})['then'](function(_0x6ebe9a){logger[_0xaef1('0x6')](_0xaef1('0xe'),JSON[_0xaef1('0xf')](_0x7879a9),_0x6ebe9a?util[_0xaef1('0x7')](_0x6ebe9a,{'showHidden':![],'depth':null}):'');return _0x6ebe9a['result'][_0xaef1('0x10')]?_0x6ebe9a['result'][0x0]:null;});}exports[_0xaef1('0x11')]=function(_0x3053a7){return new BPromise(function(_0xdd460,_0x2a9052){if(_0x3053a7){return getUser({'internal':_0x3053a7})[_0xaef1('0xa')](function(_0x52c9d5){logger[_0xaef1('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x3053a7,_0x52c9d5?'found':_0xaef1('0x12'));return _0xdd460(_0x52c9d5);})[_0xaef1('0xc')](function(_0x52e24b){logger[_0xaef1('0x8')](_0xaef1('0x13'),_0x52e24b?util[_0xaef1('0x7')](_0x52e24b,{'showHidden':![],'depth':null}):'');return _0xdd460(null);});}return _0xdd460(null);});};exports[_0xaef1('0x14')]=function(_0x310f67){return new BPromise(function(_0x40db30,_0x55bc36){if(_0x310f67){return getUser({'interface':_0x310f67})['then'](function(_0x4c87dc){logger[_0xaef1('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x310f67,_0x4c87dc?'found':'notfound');return _0x40db30(_0x4c87dc);})[_0xaef1('0xc')](function(_0x3ac9c1){logger[_0xaef1('0x8')](_0xaef1('0x15'),_0x3ac9c1?util[_0xaef1('0x7')](_0x3ac9c1,{'showHidden':![],'depth':null}):'');return _0x40db30(null);});}return _0x40db30(null);});};exports[_0xaef1('0x16')]=function(_0x33ebfb){return new BPromise(function(_0x47a5ad,_0x28e317){if(_0x33ebfb){return getUser({'name':_0x33ebfb})['then'](function(_0x916bf3){logger[_0xaef1('0x5')](_0xaef1('0x17'),_0x33ebfb,_0x916bf3?_0xaef1('0x18'):_0xaef1('0x12'));return _0x47a5ad(_0x916bf3);})[_0xaef1('0xc')](function(_0x4186b){logger[_0xaef1('0x8')](_0xaef1('0x19'),_0x4186b?util[_0xaef1('0x7')](_0x4186b,{'showHidden':![],'depth':null}):'');return _0x47a5ad(null);});}return _0x47a5ad(null);});};exports[_0xaef1('0x1a')]=function(_0x597111){return new BPromise(function(_0x39d88e,_0x2a633d){if(_0x597111){return client[_0xaef1('0x9')](_0xaef1('0x1b'),{'options':{'raw':!![],'attributes':['id','name',_0xaef1('0x1c'),_0xaef1('0x1d'),_0xaef1('0x1e')],'where':{'name':_0x597111},'limit':0x1}})[_0xaef1('0xa')](function(_0x28a7af){logger[_0xaef1('0x6')](_0xaef1('0x1f'),_0x597111,_0x28a7af?util[_0xaef1('0x7')](_0x28a7af,{'showHidden':![],'depth':null}):'');logger[_0xaef1('0x5')](_0xaef1('0x20'),_0x597111,_0x28a7af?_0xaef1('0x18'):'notfound');return _0x39d88e(_0x28a7af[_0xaef1('0x21')][_0xaef1('0x10')]?_0x28a7af[_0xaef1('0x21')][0x0]:null);})['catch'](function(_0x12fe90){logger[_0xaef1('0x8')](_0xaef1('0x22'),_0x12fe90?util['inspect'](_0x12fe90,{'showHidden':![],'depth':null}):'');return _0x39d88e(null);});}return _0x39d88e(null);});};exports[_0xaef1('0x23')]=function(_0x40a050,_0x3958a8){return moment(_0x40a050)[_0xaef1('0x24')](_0x3958a8,_0xaef1('0x25'))[_0xaef1('0x26')](_0xaef1('0x27'));};exports[_0xaef1('0x28')]=function(_0x4e6713,_0x3ac430){return moment(_0x4e6713)[_0xaef1('0x29')](_0x3ac430,'seconds')[_0xaef1('0x26')](_0xaef1('0x27'));};exports[_0xaef1('0x2a')]=function(_0x4e3125,_0x4c8f3f){return moment(_0x4e3125)[_0xaef1('0x2b')](moment(_0x4c8f3f),_0xaef1('0x25'));};exports[_0xaef1('0x2c')]=function(_0x70b46b,_0xa7b98e){return parseInt(_0x70b46b,0xa)+parseInt(_0xa7b98e,0xa);};exports[_0xaef1('0x2d')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xaef1('0x2e')]=function(_0x1c1af9,_0x2c9c40){if(_0x2c9c40){return moment(_0x1c1af9)[_0xaef1('0x2e')](_0x2c9c40);}return!![];};exports['isBefore']=function(_0x70b146,_0x375586){if(_0x375586){return moment(_0x70b146)[_0xaef1('0x2f')](_0x375586);}else if(_0x70b146){return!![];}return![];};
\ No newline at end of file
+var _0x2256=['YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','sumTime','isAfter','isBefore','bluebird','moment','util','client','../../config/logger','info','inspect','debug','error','then','[utils][request]\x20name:%s','request','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format'];(function(_0x5c27ae,_0x10dfb7){var _0x3eef82=function(_0x35b90c){while(--_0x35b90c){_0x5c27ae['push'](_0x5c27ae['shift']());}};_0x3eef82(++_0x10dfb7);}(_0x2256,0x166));var _0x6225=function(_0x189b89,_0x24d098){_0x189b89=_0x189b89-0x0;var _0x3b928d=_0x2256[_0x189b89];return _0x3b928d;};'use strict';var BPromise=require(_0x6225('0x0'));var jayson=require('jayson/promise');var moment=require(_0x6225('0x1'));var util=require(_0x6225('0x2'));var client=jayson[_0x6225('0x3')]['http']({'port':0x2329});var logger=require(_0x6225('0x4'))('xdr');exports['info']=function(_0x35731f,_0x3bf961){logger[_0x6225('0x5')](_0x35731f,_0x3bf961?util[_0x6225('0x6')](_0x3bf961,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x5e0fe4,_0x48cada){logger[_0x6225('0x7')](_0x5e0fe4,_0x48cada?util[_0x6225('0x6')](_0x48cada,{'showHidden':![],'depth':null}):'');};exports[_0x6225('0x8')]=function(_0x4a53f2,_0x58757d){logger[_0x6225('0x8')](_0x4a53f2,_0x58757d?util['inspect'](_0x58757d,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x391119,_0x23bca3){return client['request'](_0x391119,{'body':_0x23bca3})[_0x6225('0x9')](function(_0x341bf3){logger[_0x6225('0x7')](_0x6225('0xa'),_0x391119,_0x341bf3?util[_0x6225('0x6')](_0x341bf3,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x1fe848){logger[_0x6225('0x8')](_0x6225('0xa'),_0x391119,_0x1fe848?util[_0x6225('0x6')](_0x1fe848,{'showHidden':![],'depth':null}):'');});};function getUser(_0x49c76b){return client[_0x6225('0xb')](_0x6225('0xc'),{'options':{'raw':!![],'attributes':['id',_0x6225('0xd'),_0x6225('0xe'),_0x6225('0xf')],'where':_0x49c76b,'limit':0x1}})[_0x6225('0x9')](function(_0x50cc94){logger[_0x6225('0x7')](_0x6225('0x10'),JSON[_0x6225('0x11')](_0x49c76b),_0x50cc94?util[_0x6225('0x6')](_0x50cc94,{'showHidden':![],'depth':null}):'');return _0x50cc94[_0x6225('0x12')][_0x6225('0x13')]?_0x50cc94['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x14875c){return new BPromise(function(_0x3a53ba,_0x1518a9){if(_0x14875c){return getUser({'internal':_0x14875c})['then'](function(_0x1edaf8){logger[_0x6225('0x5')](_0x6225('0x14'),_0x14875c,_0x1edaf8?_0x6225('0x15'):_0x6225('0x16'));return _0x3a53ba(_0x1edaf8);})[_0x6225('0x17')](function(_0x256a12){logger['error'](_0x6225('0x18'),_0x256a12?util[_0x6225('0x6')](_0x256a12,{'showHidden':![],'depth':null}):'');return _0x3a53ba(null);});}return _0x3a53ba(null);});};exports['getUserByInterface']=function(_0x181cb0){return new BPromise(function(_0x101f88,_0x472318){if(_0x181cb0){return getUser({'interface':_0x181cb0})['then'](function(_0x482ae7){logger[_0x6225('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x181cb0,_0x482ae7?_0x6225('0x15'):'notfound');return _0x101f88(_0x482ae7);})[_0x6225('0x17')](function(_0x58f3fa){logger['error']('[utils][getUserByInterface]',_0x58f3fa?util[_0x6225('0x6')](_0x58f3fa,{'showHidden':![],'depth':null}):'');return _0x101f88(null);});}return _0x101f88(null);});};exports[_0x6225('0x19')]=function(_0x2790eb){return new BPromise(function(_0x4568c1,_0x382194){if(_0x2790eb){return getUser({'name':_0x2790eb})['then'](function(_0x7a4001){logger['info'](_0x6225('0x1a'),_0x2790eb,_0x7a4001?_0x6225('0x15'):_0x6225('0x16'));return _0x4568c1(_0x7a4001);})[_0x6225('0x17')](function(_0x948667){logger[_0x6225('0x8')](_0x6225('0x1b'),_0x948667?util['inspect'](_0x948667,{'showHidden':![],'depth':null}):'');return _0x4568c1(null);});}return _0x4568c1(null);});};exports[_0x6225('0x1c')]=function(_0x236a77){return new BPromise(function(_0x544974,_0x3277d9){if(_0x236a77){return client[_0x6225('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0x6225('0x1d'),_0x6225('0x1e'),'acwTimeout'],'where':{'name':_0x236a77},'limit':0x1}})['then'](function(_0x5078a0){logger[_0x6225('0x7')](_0x6225('0x1f'),_0x236a77,_0x5078a0?util[_0x6225('0x6')](_0x5078a0,{'showHidden':![],'depth':null}):'');logger[_0x6225('0x5')](_0x6225('0x20'),_0x236a77,_0x5078a0?_0x6225('0x15'):_0x6225('0x16'));return _0x544974(_0x5078a0['result'][_0x6225('0x13')]?_0x5078a0[_0x6225('0x12')][0x0]:null);})[_0x6225('0x17')](function(_0x3b6c8a){logger['error'](_0x6225('0x21'),_0x3b6c8a?util['inspect'](_0x3b6c8a,{'showHidden':![],'depth':null}):'');return _0x544974(null);});}return _0x544974(null);});};exports[_0x6225('0x22')]=function(_0x25330a,_0x438de6){return moment(_0x25330a)[_0x6225('0x23')](_0x438de6,_0x6225('0x24'))[_0x6225('0x25')](_0x6225('0x26'));};exports[_0x6225('0x27')]=function(_0x18c0c5,_0x17395b){return moment(_0x18c0c5)[_0x6225('0x28')](_0x17395b,'seconds')[_0x6225('0x25')](_0x6225('0x26'));};exports['diffTime']=function(_0x409234,_0x4f36f3){return moment(_0x409234)['diff'](moment(_0x4f36f3),_0x6225('0x24'));};exports[_0x6225('0x29')]=function(_0x398ca4,_0x54e02f){return parseInt(_0x398ca4,0xa)+parseInt(_0x54e02f,0xa);};exports['now']=function(){return moment()['format'](_0x6225('0x26'));};exports[_0x6225('0x2a')]=function(_0x587b11,_0x3097a5){if(_0x3097a5){return moment(_0x587b11)[_0x6225('0x2a')](_0x3097a5);}return!![];};exports[_0x6225('0x2b')]=function(_0x418323,_0x458249){if(_0x458249){return moment(_0x418323)[_0x6225('0x2b')](_0x458249);}else if(_0x418323){return!![];}return![];};
\ No newline at end of file
index 3120772..8f464bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a8d=['connection','url','other','agent_name','test','setupLoggers','fs-extra','lodash','path','util','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','client','ensureDir','catch','log','then','user','no-user','data','timestamp','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','remoteAddress','statusCode','responseTime','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)'];(function(_0x2f13dc,_0x475849){var _0x4337ee=function(_0x4efe74){while(--_0x4efe74){_0x2f13dc['push'](_0x2f13dc['shift']());}};_0x4337ee(++_0x475849);}(_0x6a8d,0x99));var _0xd6a8=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x6a8d[_0x1589dd];return _0x1bddd1;};var fs=require(_0xd6a8('0x0'));var _=require(_0xd6a8('0x1'));var ewinston=require('express-winston');var path=require(_0xd6a8('0x2'));var util=require(_0xd6a8('0x3'));var fileLogger=require(_0xd6a8('0x4'))['fileLogger'];var safeTemplate=require(_0xd6a8('0x5'))[_0xd6a8('0x6')];var maskSensitiveData=require(_0xd6a8('0x7'))[_0xd6a8('0x8')];function ClientSideLogger(){function _0x594911(_0x2949f3){var _0x9361a7=path['join'](_0xd6a8('0x9'),'log','xcally');var _0x4803f9=path['join'](_0xd6a8('0xa'),_0x2949f3['role']+'-'+_0x2949f3['name']);return fs[_0xd6a8('0xb')](path['join'](_0x9361a7,_0x4803f9))['then'](function(){var _0x1e249e=fileLogger(_0xd6a8('0xa'),path['join'](_0x9361a7,_0x4803f9));return _0x1e249e;})[_0xd6a8('0xc')](function(_0x5286c4){throw _0x5286c4;});}this[_0xd6a8('0xd')]=function(_0x38cb05,_0x364a67,_0x2855e2,_0x415a4e){return _0x594911(_0x38cb05['user'])[_0xd6a8('0xe')](function(_0x5f3785){var _0x63ea0c=_0x5f3785[_0x364a67];return _0x63ea0c;})[_0xd6a8('0xe')](function(_0x195e30){var _0x44dd0c=_0x38cb05[_0xd6a8('0xf')]?_0x38cb05[_0xd6a8('0xf')]['id']:_0xd6a8('0x10');var _0x32efd7=_0x415a4e[_0xd6a8('0x11')];var _0x19c341=_0x415a4e[_0xd6a8('0x12')];var _0x48c600=new Date(Number(_0x19c341));return _0x195e30(_0x44dd0c,_0x48c600,_0x2855e2,_0x32efd7);})[_0xd6a8('0xc')](function(_0x548744){fileLogger(_0xd6a8('0xa'))[_0xd6a8('0x13')](_0x548744);});};}function setupLoggers(_0x305c24){return new Promise(function(_0x5a489c){var _0x5d168c=new ClientSideLogger();var _0x320a7b=fileLogger(_0xd6a8('0x14'));var _0x1ceb29=fileLogger(_0xd6a8('0x15'));_0x305c24[_0xd6a8('0x16')](_0xd6a8('0x17'),_0x5d168c);_0x305c24[_0xd6a8('0x18')](ewinston[_0xd6a8('0x19')]({'winstonInstance':_0x320a7b,'meta':![],'statusLevels':!![],'msg':function(_0x11ec1f,_0xfe7474){var _0x335fc9=_0xd6a8('0x1a');if(!_[_0xd6a8('0x1b')](_0x11ec1f[_0xd6a8('0x1c')])){_0x335fc9+=_0xd6a8('0x1d');var _0x173d97=_0x11ec1f['body'];maskSensitiveData(_0x173d97);}return safeTemplate(util[_0xd6a8('0x1e')](_0x335fc9,_0x11ec1f[_0xd6a8('0x1f')],_0x11ec1f[_0xd6a8('0x20')][_0xd6a8('0x21')]?_0x11ec1f[_0xd6a8('0x20')][_0xd6a8('0x21')]:_0x11ec1f['connection'][_0xd6a8('0x22')]||_0x11ec1f['ip'],_0x11ec1f['url'],_0xfe7474[_0xd6a8('0x23')],_0xfe7474[_0xd6a8('0x24')],_0x11ec1f[_0xd6a8('0xf')]?_0x11ec1f[_0xd6a8('0xf')]['id']:null,_0x11ec1f['user']?_0x11ec1f[_0xd6a8('0xf')][_0xd6a8('0x25')]:null,_0x11ec1f[_0xd6a8('0xf')]?_0x11ec1f[_0xd6a8('0xf')][_0xd6a8('0x26')]:null,_0x173d97?util['inspect'](_0x173d97,![],null):''));}}));_0x305c24['use'](ewinston[_0xd6a8('0x19')]({'winstonInstance':_0x1ceb29,'meta':![],'statusLevels':!![],'msg':function(_0x22212a,_0x206f03){var _0x2b44a0=_0xd6a8('0x27');if(_0x22212a[_0xd6a8('0x1c')]&&_0x22212a['body'][_0xd6a8('0x28')]&&_0x22212a['body'][_0xd6a8('0x29')]){_0x2b44a0=_0xd6a8('0x2a');}return util[_0xd6a8('0x1e')](_0x2b44a0,_0x22212a['method'],_0x22212a[_0xd6a8('0x20')]['x-forwarded-for']?_0x22212a[_0xd6a8('0x20')][_0xd6a8('0x21')]:_0x22212a[_0xd6a8('0x2b')][_0xd6a8('0x22')]||_0x22212a['ip'],_0x22212a[_0xd6a8('0x2c')],_0x206f03[_0xd6a8('0x23')],_0x206f03[_0xd6a8('0x24')],_0x22212a[_0xd6a8('0xf')]?_0x22212a['user']['id']:null,_0x22212a[_0xd6a8('0xf')]?_0x22212a[_0xd6a8('0xf')][_0xd6a8('0x25')]:null,_0x22212a[_0xd6a8('0xf')]?_0x22212a['user'][_0xd6a8('0x26')]:null,_0x22212a[_0xd6a8('0x1c')]&&_0x22212a[_0xd6a8('0x1c')]['device']?_0x22212a[_0xd6a8('0x1c')][_0xd6a8('0x28')]:_0xd6a8('0x2d'),_0x22212a[_0xd6a8('0x1c')]&&_0x22212a[_0xd6a8('0x1c')][_0xd6a8('0x29')]?_0x22212a[_0xd6a8('0x1c')][_0xd6a8('0x29')]:'',_0x22212a[_0xd6a8('0x1c')]&&_0x22212a[_0xd6a8('0x1c')][_0xd6a8('0x2e')]?_0x22212a[_0xd6a8('0x1c')]['agent_name']:'');},'ignoreRoute':function(_0xa91887){var _0x1ec0cc=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1ec0cc[_0xd6a8('0x2f')](_0xa91887[_0xd6a8('0x2c')]);}}));return _0x5a489c();});}exports[_0xd6a8('0x30')]=setupLoggers;
\ No newline at end of file
+var _0xd5b9=['logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','util','fileLogger','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','role','ensureDir','then','client','catch','timestamp','api','auth','set','client-side-logger','use'];(function(_0x12dfb7,_0x211cf1){var _0x3f2144=function(_0x42fc1e){while(--_0x42fc1e){_0x12dfb7['push'](_0x12dfb7['shift']());}};_0x3f2144(++_0x211cf1);}(_0xd5b9,0x152));var _0x9d5b=function(_0x53777e,_0x304efc){_0x53777e=_0x53777e-0x0;var _0x43c0c5=_0xd5b9[_0x53777e];return _0x43c0c5;};var fs=require(_0x9d5b('0x0'));var _=require(_0x9d5b('0x1'));var ewinston=require(_0x9d5b('0x2'));var path=require('path');var util=require(_0x9d5b('0x3'));var fileLogger=require('./loggers')[_0x9d5b('0x4')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0x9d5b('0x5'))[_0x9d5b('0x6')];function ClientSideLogger(){function _0x39265c(_0x4e08db){var _0x77fcd8=path[_0x9d5b('0x7')](_0x9d5b('0x8'),_0x9d5b('0x9'),_0x9d5b('0xa'));var _0x445ce6=path[_0x9d5b('0x7')]('client',_0x4e08db[_0x9d5b('0xb')]+'-'+_0x4e08db['name']);return fs[_0x9d5b('0xc')](path[_0x9d5b('0x7')](_0x77fcd8,_0x445ce6))[_0x9d5b('0xd')](function(){var _0x3233b6=fileLogger(_0x9d5b('0xe'),path[_0x9d5b('0x7')](_0x77fcd8,_0x445ce6));return _0x3233b6;})[_0x9d5b('0xf')](function(_0x3244fd){throw _0x3244fd;});}this[_0x9d5b('0x9')]=function(_0x1be6a9,_0x23d2d4,_0x5a6b44,_0x3b5ce2){return _0x39265c(_0x1be6a9['user'])[_0x9d5b('0xd')](function(_0x2a5cc3){var _0x5478af=_0x2a5cc3[_0x23d2d4];return _0x5478af;})[_0x9d5b('0xd')](function(_0x30d3c6){var _0x6f1eea=_0x1be6a9['user']?_0x1be6a9['user']['id']:'no-user';var _0x5e4403=_0x3b5ce2['data'];var _0xb8c746=_0x3b5ce2[_0x9d5b('0x10')];var _0x594dfb=new Date(Number(_0xb8c746));return _0x30d3c6(_0x6f1eea,_0x594dfb,_0x5a6b44,_0x5e4403);})[_0x9d5b('0xf')](function(_0x3cf51f){fileLogger(_0x9d5b('0xe'))['error'](_0x3cf51f);});};}function setupLoggers(_0x22683b){return new Promise(function(_0x4bc84d){var _0x7812a8=new ClientSideLogger();var _0x56341a=fileLogger(_0x9d5b('0x11'));var _0xc91760=fileLogger(_0x9d5b('0x12'));_0x22683b[_0x9d5b('0x13')](_0x9d5b('0x14'),_0x7812a8);_0x22683b[_0x9d5b('0x15')](ewinston[_0x9d5b('0x16')]({'winstonInstance':_0x56341a,'meta':![],'statusLevels':!![],'msg':function(_0x4081e3,_0x1b05bd){var _0x5e4ac0=_0x9d5b('0x17');if(!_[_0x9d5b('0x18')](_0x4081e3['body'])){_0x5e4ac0+='\x20body=%s';var _0x24e502=_0x4081e3['body'];maskSensitiveData(_0x24e502);}return safeTemplate(util[_0x9d5b('0x19')](_0x5e4ac0,_0x4081e3[_0x9d5b('0x1a')],_0x4081e3[_0x9d5b('0x1b')][_0x9d5b('0x1c')]?_0x4081e3['headers'][_0x9d5b('0x1c')]:_0x4081e3[_0x9d5b('0x1d')][_0x9d5b('0x1e')]||_0x4081e3['ip'],_0x4081e3[_0x9d5b('0x1f')],_0x1b05bd[_0x9d5b('0x20')],_0x1b05bd[_0x9d5b('0x21')],_0x4081e3[_0x9d5b('0x22')]?_0x4081e3[_0x9d5b('0x22')]['id']:null,_0x4081e3['user']?_0x4081e3[_0x9d5b('0x22')][_0x9d5b('0x23')]:null,_0x4081e3['user']?_0x4081e3[_0x9d5b('0x22')]['role']:null,_0x24e502?util[_0x9d5b('0x24')](_0x24e502,![],null):''));}}));_0x22683b[_0x9d5b('0x15')](ewinston[_0x9d5b('0x16')]({'winstonInstance':_0xc91760,'meta':![],'statusLevels':!![],'msg':function(_0x2e87b2,_0x509f87){var _0x499c3d=_0x9d5b('0x25');if(_0x2e87b2['body']&&_0x2e87b2[_0x9d5b('0x26')][_0x9d5b('0x27')]&&_0x2e87b2[_0x9d5b('0x26')][_0x9d5b('0x28')]){_0x499c3d=_0x9d5b('0x29');}return util[_0x9d5b('0x19')](_0x499c3d,_0x2e87b2[_0x9d5b('0x1a')],_0x2e87b2[_0x9d5b('0x1b')][_0x9d5b('0x1c')]?_0x2e87b2[_0x9d5b('0x1b')][_0x9d5b('0x1c')]:_0x2e87b2['connection'][_0x9d5b('0x1e')]||_0x2e87b2['ip'],_0x2e87b2[_0x9d5b('0x1f')],_0x509f87[_0x9d5b('0x20')],_0x509f87[_0x9d5b('0x21')],_0x2e87b2[_0x9d5b('0x22')]?_0x2e87b2['user']['id']:null,_0x2e87b2[_0x9d5b('0x22')]?_0x2e87b2[_0x9d5b('0x22')]['name']:null,_0x2e87b2[_0x9d5b('0x22')]?_0x2e87b2[_0x9d5b('0x22')]['role']:null,_0x2e87b2[_0x9d5b('0x26')]&&_0x2e87b2[_0x9d5b('0x26')]['device']?_0x2e87b2[_0x9d5b('0x26')][_0x9d5b('0x27')]:'other',_0x2e87b2['body']&&_0x2e87b2['body'][_0x9d5b('0x28')]?_0x2e87b2['body'][_0x9d5b('0x28')]:'',_0x2e87b2[_0x9d5b('0x26')]&&_0x2e87b2[_0x9d5b('0x26')][_0x9d5b('0x2a')]?_0x2e87b2[_0x9d5b('0x26')][_0x9d5b('0x2a')]:'');},'ignoreRoute':function(_0x4d0096){var _0x5d41e7=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5d41e7[_0x9d5b('0x2b')](_0x4d0096['url']);}}));return _0x4bc84d();});}exports[_0x9d5b('0x2c')]=setupLoggers;
\ No newline at end of file
index 0f9a889..6872593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b2=['red','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','util','winston','../config/environment','debugLevel','toLowerCase','info'];(function(_0xe9db2f,_0x266cc2){var _0x1cd357=function(_0x2f2380){while(--_0x2f2380){_0xe9db2f['push'](_0xe9db2f['shift']());}};_0x1cd357(++_0x266cc2);}(_0xe5b2,0x13e));var _0x2e5b=function(_0x21e9be,_0x145bbd){_0x21e9be=_0x21e9be-0x0;var _0x57797b=_0xe5b2[_0x21e9be];return _0x57797b;};'use strict';var path=require('path');var util=require(_0x2e5b('0x0'));var moment=require('moment');var winston=require(_0x2e5b('0x1'));var config=require(_0x2e5b('0x2'));var debugLevel=config[_0x2e5b('0x3')]?config[_0x2e5b('0x3')][_0x2e5b('0x4')]():_0x2e5b('0x5');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':'redBG\x20white','error':_0x2e5b('0x6'),'warn':'bold\x20yellow','info':'white','print':_0x2e5b('0x7'),'success':_0x2e5b('0x8'),'http':_0x2e5b('0x9'),'verbose':_0x2e5b('0xa'),'debug':'bold\x20blue','silly':_0x2e5b('0xb')};winston[_0x2e5b('0xc')](XC_LOG_COLORS);function getLogFileName(_0x5bcfd1,_0x4f8df8,_0x1cbe69){var _0x1bf8bb=_0x5bcfd1||_0x2e5b('0xd');return path[_0x2e5b('0xe')](_0x1bf8bb,util[_0x2e5b('0xf')](_0x2e5b('0x10'),_0x4f8df8,_0x1cbe69));}function formatter(_0x37b649,_0x16412){_0x16412[_0x2e5b('0x11')]=_0x16412[_0x2e5b('0x11')][_0x2e5b('0x12')](/@@{/g,_0x2e5b('0x13'))[_0x2e5b('0x12')](/}@@/g,'}}}')[_0x2e5b('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0x2e5b('0x14'),moment()[_0x2e5b('0xf')](_0x2e5b('0x15')),_0x16412[_0x2e5b('0x16')][_0x2e5b('0x17')](),_0x37b649,_0x16412[_0x2e5b('0x11')]);}function fileFormat(_0x5e7810,_0x30ca35){_0x30ca35['message']=_0x30ca35[_0x2e5b('0x11')]['replace'](/@@{/g,_0x2e5b('0x13'))['replace'](/}@@/g,_0x2e5b('0x18'))[_0x2e5b('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x5cbadf=_0x30ca35['meta']&&Object['keys'](_0x30ca35[_0x2e5b('0x19')])[_0x2e5b('0x1a')]?'\x0a\x09'+JSON['stringify'](_0x30ca35[_0x2e5b('0x19')]):'';return util[_0x2e5b('0xf')](_0x2e5b('0x1b'),moment()[_0x2e5b('0xf')](_0x2e5b('0x15')),_0x30ca35[_0x2e5b('0x16')][_0x2e5b('0x17')](),_0x5e7810,_0x30ca35[_0x2e5b('0x11')],_0x5cbadf);}function consoleLogger(){var _0x33befe=new winston[(_0x2e5b('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2e5b('0x1d'))][(_0x2e5b('0x1e'))]({'level':_0x2e5b('0x1f'),'json':![],'formatter':function(_0x2be7d7){return formatter('',_0x2be7d7);}})]});return _0x33befe;}function fileLogger(_0x2c5816,_0xbd11e3){var _0x28d132=new winston[(_0x2e5b('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2e5b('0x1d'))][(_0x2e5b('0x20'))]({'name':util[_0x2e5b('0xf')](_0x2e5b('0x21'),_0x2c5816,_0x2e5b('0x22')),'filename':getLogFileName(_0xbd11e3,_0x2c5816,_0x2e5b('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4da481){return fileFormat(_0x2c5816,_0x4da481);}}),new winston[(_0x2e5b('0x1d'))][(_0x2e5b('0x20'))]({'name':util[_0x2e5b('0xf')](_0x2e5b('0x21'),_0x2c5816,debugLevel),'filename':getLogFileName(_0xbd11e3,_0x2c5816,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x264db9){return fileFormat(_0x2c5816,_0x264db9);}}),new winston[(_0x2e5b('0x1d'))][(_0x2e5b('0x1e'))]({'level':_0x2e5b('0x1f'),'json':![],'formatter':function(_0xa547b2){return fileFormat(_0x2c5816,_0xa547b2);}})]});return _0x28d132;}exports[_0x2e5b('0x23')]=consoleLogger;exports['fileLogger']=fileLogger;
\ No newline at end of file
+var _0xb944=['warn','File','%s-%s','error','transports','consoleLogger','fileLogger','moment','debugLevel','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Console'];(function(_0xc0e73e,_0xd1e30f){var _0x400bf1=function(_0x324a7b){while(--_0x324a7b){_0xc0e73e['push'](_0xc0e73e['shift']());}};_0x400bf1(++_0xd1e30f);}(_0xb944,0x103));var _0x4b94=function(_0x1d7d77,_0x2429c8){_0x1d7d77=_0x1d7d77-0x0;var _0x1451f4=_0xb944[_0x1d7d77];return _0x1451f4;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x4b94('0x0'));var winston=require('winston');var config=require('../config/environment');var debugLevel=config[_0x4b94('0x1')]?config[_0x4b94('0x1')]['toLowerCase']():_0x4b94('0x2');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':_0x4b94('0x3'),'error':_0x4b94('0x4'),'warn':_0x4b94('0x5'),'info':_0x4b94('0x6'),'print':_0x4b94('0x7'),'success':_0x4b94('0x8'),'http':_0x4b94('0x9'),'verbose':_0x4b94('0xa'),'debug':_0x4b94('0xb'),'silly':'bold\x20cyan'};winston[_0x4b94('0xc')](XC_LOG_COLORS);function getLogFileName(_0x33705a,_0x14b37e,_0x3e4a09){var _0x5cd068=_0x33705a||_0x4b94('0xd');return path[_0x4b94('0xe')](_0x5cd068,util[_0x4b94('0xf')]('%s-%s.log',_0x14b37e,_0x3e4a09));}function formatter(_0x136877,_0x55ddf3){_0x55ddf3['message']=_0x55ddf3[_0x4b94('0x10')][_0x4b94('0x11')](/@@{/g,'{{{')[_0x4b94('0x11')](/}@@/g,_0x4b94('0x12'))[_0x4b94('0x11')](/@{/g,'{{')[_0x4b94('0x11')](/}@/g,'}}');return util[_0x4b94('0xf')](_0x4b94('0x13'),moment()[_0x4b94('0xf')](_0x4b94('0x14')),_0x55ddf3[_0x4b94('0x15')][_0x4b94('0x16')](),_0x136877,_0x55ddf3[_0x4b94('0x10')]);}function fileFormat(_0x27db4f,_0x1b32cd){_0x1b32cd[_0x4b94('0x10')]=_0x1b32cd[_0x4b94('0x10')][_0x4b94('0x11')](/@@{/g,_0x4b94('0x17'))[_0x4b94('0x11')](/}@@/g,'}}}')[_0x4b94('0x11')](/@{/g,'{{')[_0x4b94('0x11')](/}@/g,'}}');var _0x100f43=_0x1b32cd[_0x4b94('0x18')]&&Object[_0x4b94('0x19')](_0x1b32cd[_0x4b94('0x18')])['length']?'\x0a\x09'+JSON[_0x4b94('0x1a')](_0x1b32cd['meta']):'';return util[_0x4b94('0xf')](_0x4b94('0x1b'),moment()[_0x4b94('0xf')](_0x4b94('0x14')),_0x1b32cd['level'][_0x4b94('0x16')](),_0x27db4f,_0x1b32cd['message'],_0x100f43);}function consoleLogger(){var _0x24a816=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x4b94('0x1c'))]({'level':_0x4b94('0x1d'),'json':![],'formatter':function(_0x1fa9d6){return formatter('',_0x1fa9d6);}})]});return _0x24a816;}function fileLogger(_0x5b996e,_0x19a9de){var _0x3102c7=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x4b94('0x1e'))]({'name':util[_0x4b94('0xf')](_0x4b94('0x1f'),_0x5b996e,_0x4b94('0x20')),'filename':getLogFileName(_0x19a9de,_0x5b996e,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3a9ac2){return fileFormat(_0x5b996e,_0x3a9ac2);}}),new winston[(_0x4b94('0x21'))][(_0x4b94('0x1e'))]({'name':util[_0x4b94('0xf')]('%s-%s',_0x5b996e,debugLevel),'filename':getLogFileName(_0x19a9de,_0x5b996e,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2ff580){return fileFormat(_0x5b996e,_0x2ff580);}}),new winston['transports'][(_0x4b94('0x1c'))]({'level':_0x4b94('0x1d'),'json':![],'formatter':function(_0x11af87){return fileFormat(_0x5b996e,_0x11af87);}})]});return _0x3102c7;}exports[_0x4b94('0x22')]=consoleLogger;exports[_0x4b94('0x23')]=fileLogger;
\ No newline at end of file
index 4cdbb96..068c3f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['consumerSecret','membername','calleridname','exten','privateKey','secretaccesskey','user','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','length','isPlainObject','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','lastName','street','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','consumerKey'];(function(_0x107f48,_0x30cd96){var _0x277cb1=function(_0x318adb){while(--_0x318adb){_0x107f48['push'](_0x107f48['shift']());}};_0x277cb1(++_0x30cd96);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};var _=require('lodash');var sensitiveFields=[_0x65f6('0x0'),'password',_0x65f6('0x1'),_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'phone',_0x65f6('0x6'),'fax',_0x65f6('0x7'),_0x65f6('0x8'),'clientSecret','securityToken',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'accessTokenSecret','authToken',_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0x12'),'calleridnum',_0x65f6('0x13'),'vidaooApiKey','clientEmail',_0x65f6('0x14'),'accesskeyid',_0x65f6('0x15'),'key',_0x65f6('0x16'),_0x65f6('0x17'),_0x65f6('0x18'),_0x65f6('0x19'),_0x65f6('0x1a'),_0x65f6('0x1b'),_0x65f6('0x1c'),_0x65f6('0x1d')];function maskSensitiveData(_0x46dbc6){const _0x3440af=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x46dbc6)){for(const _0x19b9ff in _0x46dbc6){if(_['isArray'](_0x46dbc6[_0x19b9ff])){for(let _0x5dd324=0x0;_0x5dd324<_0x46dbc6[_0x19b9ff][_0x65f6('0x1e')];_0x5dd324++){maskSensitiveData(_0x46dbc6[_0x19b9ff][_0x5dd324]);}}else if(_[_0x65f6('0x1f')](_0x46dbc6[_0x19b9ff])){maskSensitiveData(_0x46dbc6[_0x19b9ff]);}else if(_[_0x65f6('0x20')](_0x46dbc6[_0x19b9ff])){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](/{{{/g,_0x65f6('0x22'))[_0x65f6('0x21')](/}}}/g,_0x65f6('0x23'))[_0x65f6('0x21')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x19b9ff)){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](_0x3440af,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
+var _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0x322749,_0xdb4126){var _0x5c590b=function(_0x45ec7b){while(--_0x45ec7b){_0x322749['push'](_0x322749['shift']());}};_0x5c590b(++_0xdb4126);}(_0x66fa,0x117));var _0xa66f=function(_0x5c3c77,_0x30be70){_0x5c3c77=_0x5c3c77-0x0;var _0x24a6c2=_0x66fa[_0x5c3c77];return _0x24a6c2;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData;
\ No newline at end of file
index 0fdcb9f..b454937 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['exports','{\x20{\x20','\x20}\x20}','string','isArray','map','isPlainObject','keys','reduce'];(function(_0x325e8a,_0xc2e6b2){var _0x37cefe=function(_0x659509){while(--_0x659509){_0x325e8a['push'](_0x325e8a['shift']());}};_0x37cefe(++_0xc2e6b2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x286ac2){return _0x286ac2==='{{'?_0x0baf('0x0'):_0x0baf('0x1');}function safeTemplate(_0x263f79){var _0x1688bc=_0x263f79;if(typeof _0x263f79===_0x0baf('0x2')){_0x1688bc=_0x263f79['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x0baf('0x3')](_0x263f79)){_0x1688bc=_0x263f79[_0x0baf('0x4')](function(_0x2d3fa5){return safeTemplate(_0x2d3fa5);});}else if(_[_0x0baf('0x5')](_0x263f79)){_0x1688bc=Object[_0x0baf('0x6')](_0x263f79)[_0x0baf('0x7')](function(_0x1a10b1,_0x2dcaac){_0x1a10b1[_0x2dcaac]=safeTemplate(_0x263f79[_0x2dcaac]);return _0x1a10b1;},{});}return _0x1688bc;}module[_0x0baf('0x8')]['safeTemplate']=safeTemplate;
\ No newline at end of file
+var _0xb62e=['map','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x22c77d,_0x410a83){var _0x372a02=function(_0x1e8a77){while(--_0x1e8a77){_0x22c77d['push'](_0x22c77d['shift']());}};_0x372a02(++_0x410a83);}(_0xb62e,0x1de));var _0xeb62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb62e[_0x3dd15e];return _0x231fd0;};var _=require(_0xeb62('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x46335b){return _0x46335b==='{{'?_0xeb62('0x1'):_0xeb62('0x2');}function safeTemplate(_0x57a5ba){var _0x3dfdef=_0x57a5ba;if(typeof _0x57a5ba===_0xeb62('0x3')){_0x3dfdef=_0x57a5ba[_0xeb62('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb62('0x5')](_0x57a5ba)){_0x3dfdef=_0x57a5ba[_0xeb62('0x6')](function(_0x1ebdbb){return safeTemplate(_0x1ebdbb);});}else if(_['isPlainObject'](_0x57a5ba)){_0x3dfdef=Object[_0xeb62('0x7')](_0x57a5ba)[_0xeb62('0x8')](function(_0x31f5ea,_0x5e0dc4){_0x31f5ea[_0x5e0dc4]=safeTemplate(_0x57a5ba[_0x5e0dc4]);return _0x31f5ea;},{});}return _0x3dfdef;}module[_0xeb62('0x9')][_0xeb62('0xa')]=safeTemplate;
\ No newline at end of file